From 9dbe435518b467771f2e8fe305a941e784c8beca Mon Sep 17 00:00:00 2001 From: Matthew Zeitlin <37011898+mzeitlin11@users.noreply.github.com> Date: Tue, 19 Mar 2024 21:12:27 -0400 Subject: [PATCH 1/6] Squashed commit of the following: commit 88d7dbc04dbd6a0d8ec2018f2e30f5901bedef92 Author: Matthew Zeitlin <37011898+mzeitlin11@users.noreply.github.com> Date: Sun Jan 7 15:00:26 2024 -0500 Use OpenAPI definitions in webhook event definition commit 6adf3f9fc430784a5a7e7ab99a2aaa49752cf195 Author: Matthew Zeitlin <37011898+mzeitlin11@users.noreply.github.com> Date: Fri Jan 5 15:01:03 2024 -0800 Remove unnecessary test closure commit c3e3c8fe87bd13aa5f23b89a66bcc0aac5ed4e01 Author: Matthew Zeitlin <37011898+mzeitlin11@users.noreply.github.com> Date: Fri Jan 5 12:59:07 2024 -0800 Remove AsRef generated impl for enums commit 815712263e68fabc69b4b5991efcdf191b0e1bc8 Author: Matthew Zeitlin <37011898+mzeitlin11@users.noreply.github.com> Date: Thu Dec 28 12:45:11 2023 -0500 Fix polymorphic returned types, add test commit 4b4f4939b334cff1cd2aabded3a7fee689e33386 Author: Matthew Zeitlin <37011898+mzeitlin11@users.noreply.github.com> Date: Wed Dec 27 15:57:14 2023 -0500 Deduplication WIP commit acc796e772666f7d7e123969869f950b57351686 Author: Matthew Zeitlin <37011898+mzeitlin11@users.noreply.github.com> Date: Tue Dec 26 14:24:59 2023 -0500 Clean update some codegen, start adding back dedup commit e09c203a5d819a0134b54de8bcd7362cf90cab58 Author: Matthew Zeitlin <37011898+mzeitlin11@users.noreply.github.com> Date: Sat Dec 23 15:33:37 2023 -0500 DOC: fix cases of crazy-long lines in doc comments commit 3009c4910ce10293ef4d19c0c59b939194ba17c8 Author: Matthew Zeitlin <37011898+mzeitlin11@users.noreply.github.com> Date: Sat Dec 23 13:59:38 2023 -0500 Try to flatten the namespace as much as possible commit feb13c44894f107d1919474820ae63f4bb09b205 Author: Matthew Zeitlin <37011898+mzeitlin11@users.noreply.github.com> Date: Sat Dec 23 11:47:48 2023 -0500 Add test for charge having nullable refunds commit d8a2dec58f753d9465ee109024dd271daae30ac1 Author: Matthew Zeitlin <37011898+mzeitlin11@users.noreply.github.com> Date: Sat Dec 23 11:33:51 2023 -0500 List -> Option>, no more List defaults commit 3abe2e667f88533fe8bccbc78d84865eb5959387 Author: Matthew Zeitlin <37011898+mzeitlin11@users.noreply.github.com> Date: Fri Dec 22 13:00:18 2023 -0500 Patch URLFinder handling commit 00c139c0298f9c703d9e7848cf0011bdc1dab2bf Author: Matthew Zeitlin <37011898+mzeitlin11@users.noreply.github.com> Date: Fri Dec 22 12:04:16 2023 -0500 Reintegrate search pagination too, add lots more pagination testing commit ccb9570540eb77317a8b52920d77b0ec5fff70b9 Author: Matthew Zeitlin <37011898+mzeitlin11@users.noreply.github.com> Date: Sun Dec 17 16:31:39 2023 -0500 Add back AsCursor trait and clean up Expandable removed id method commit 993085370d149ddbb58c9a8772c5969ac20d4a09 Author: Matthew Zeitlin <37011898+mzeitlin11@users.noreply.github.com> Date: Sun Dec 17 16:00:16 2023 -0500 Workaround stripe docs change, don't require doc urls commit b279dcb82aa1883bdefc39a72c5d09a79bf7eae4 Author: Matthew Zeitlin <37011898+mzeitlin11@users.noreply.github.com> Date: Sun Dec 17 15:53:17 2023 -0500 Keep simple, relegate more generated code to specific generated crates commit 0a4ae2095a6c8ae036abf940125393eed040470b Author: Matthew Zeitlin <37011898+mzeitlin11@users.noreply.github.com> Date: Sun Dec 10 14:28:28 2023 -0500 Add initial README changes, migration guide commit 8e2f6418dc07da7510ec699646b4e673d628f347 Author: Matthew Zeitlin <37011898+mzeitlin11@users.noreply.github.com> Date: Sun Dec 10 10:50:47 2023 -0500 Update contributing docs and add codegen readme commit f7a0999a89a65ff03dd12402f9b0b007dad1fe11 Author: Matthew Zeitlin <37011898+mzeitlin11@users.noreply.github.com> Date: Sun Dec 3 20:00:16 2023 -0500 [skip ci] Add readme to examples directory commit 11d80e6b302ae7c328c7b95bbefa41db3c277cd1 Author: Matthew Zeitlin <37011898+mzeitlin11@users.noreply.github.com> Date: Sun Dec 3 19:41:57 2023 -0500 Clean up some codegen, add ability to autogenerate generated crate description commit a6bba63a9595c1208c0ff5ceecbcea9000eeffd8 Author: Matthew Zeitlin <37011898+mzeitlin11@users.noreply.github.com> Date: Sun Dec 3 13:10:20 2023 -0500 Make webhook examples more easily runnable without features commit cfb4fd0bd44ee1471685e732b022d003840906bd Author: Matthew Zeitlin <37011898+mzeitlin11@users.noreply.github.com> Date: Fri Dec 1 12:59:10 2023 -0500 Address initial comments and fix openapi clippy commit 975440d8faedcc79bdefbd83c1c0fbe92c242c8b Author: Matthew Zeitlin <37011898+mzeitlin11@users.noreply.github.com> Date: Thu Nov 30 15:16:06 2023 -0500 Add some manual renaming to lessen breaking changes / use clearer names commit 8c0493858cf2389992165191a42bc8ac1e814328 Author: Matthew Zeitlin <37011898+mzeitlin11@users.noreply.github.com> Date: Thu Nov 30 14:52:16 2023 -0500 Remove rustfmt hack for stripe_treasury long lines commit 30eb3c1c432a3b8344cf926a72f763ae9c882648 Author: Matthew Zeitlin <37011898+mzeitlin11@users.noreply.github.com> Date: Thu Nov 30 14:48:16 2023 -0500 Try using just path to infer object struct name commit b7630f9a248a44b02b61dcb2ab6ae91056b9f56f Author: Matthew Zeitlin <37011898+mzeitlin11@users.noreply.github.com> Date: Thu Nov 30 12:35:03 2023 -0500 Make sure nested paths are also reexported so don't need stripe_types commit c402ad98b6c90aa3552f6d4d072b0d2ddbfc3561 Author: Matthew Zeitlin <37011898+mzeitlin11@users.noreply.github.com> Date: Thu Nov 30 12:04:22 2023 -0500 Allow codegen to replace Default::default() -> None for common option case commit 12db0bcc8908fd6f43e00015e058e5979d39220c Author: Matthew Zeitlin <37011898+mzeitlin11@users.noreply.github.com> Date: Sun Nov 26 17:57:26 2023 -0500 Add examples back to CI commit 30673e9a880afb19fc4dd8b51e8ba717f6d1f3a3 Author: Matthew Zeitlin <37011898+mzeitlin11@users.noreply.github.com> Date: Sun Nov 26 15:23:29 2023 -0500 Quiet some tracing, make sure nightly formatting present for CI commit 3c817c86a645bfbd25729c037036319986eee0ec Author: Matthew Zeitlin <37011898+mzeitlin11@users.noreply.github.com> Date: Sun Nov 26 15:17:15 2023 -0500 Ci fixups: async-std tests + don't expect out dir to exist commit 9836631906915c2f75da0e95a577da32962347c4 Author: Matthew Zeitlin <37011898+mzeitlin11@users.noreply.github.com> Date: Sun Nov 26 15:08:50 2023 -0500 Keep examples separate in ci for now commit 18c4348f5a43aef0a44a737111b1049facbdc7b2 Author: Matthew Zeitlin <37011898+mzeitlin11@users.noreply.github.com> Date: Sun Nov 26 15:02:39 2023 -0500 Make CI use same indexmap versions commit 168eedaa961c46bc5bde6376d0c5d2637400abdf Author: Matthew Zeitlin <37011898+mzeitlin11@users.noreply.github.com> Date: Sun Nov 26 14:59:14 2023 -0500 Try to fix gh actions commit 1f83a151da6b1a1f92a5c97ff4a4a7ab994473fa Author: Matthew Zeitlin <37011898+mzeitlin11@users.noreply.github.com> Date: Sun Nov 26 14:24:26 2023 -0500 Add more tests for closable issues commit 0b466852926b88dd07985298a4878b86d50ed1b8 Author: Matthew Zeitlin <37011898+mzeitlin11@users.noreply.github.com> Date: Sun Nov 26 12:40:40 2023 -0500 Make id inference safer and more correct commit 0b958dcf8dcde7993821b9001f0b1996c6551b1c Author: Matthew Zeitlin <37011898+mzeitlin11@users.noreply.github.com> Date: Sun Nov 26 11:02:44 2023 -0500 Add some testing commit 1026ea5bf565d6cda9d656c202fa136b9241dfd0 Author: Matthew Zeitlin <37011898+mzeitlin11@users.noreply.github.com> Date: Sun Nov 26 10:56:16 2023 -0500 Move id handling to external mappings file commit 99d3fa55c12b42bacf0c58a2672b4b4770cd3a81 Author: Matthew Zeitlin <37011898+mzeitlin11@users.noreply.github.com> Date: Sun Nov 26 00:20:43 2023 -0500 Remove no longer used generated code commit aa9e78c32dcf4a668c77ab19f1751e58295eff28 Author: Matthew Zeitlin <37011898+mzeitlin11@users.noreply.github.com> Date: Sat Nov 25 20:34:03 2023 -0500 Migrate git workflows commit 6e1b11e04dc292a2a89d73e1fd279d104243f830 Author: Matthew Zeitlin <37011898+mzeitlin11@users.noreply.github.com> Date: Sat Nov 25 20:30:07 2023 -0500 Migrate old examples, add back from branch commit 02ba0fa7b7804686bbb758133a842bc69bf69785 Author: Matthew Zeitlin <37011898+mzeitlin11@users.noreply.github.com> Date: Sat Nov 25 17:53:52 2023 -0500 Migrate old tests, add back from branch commit 6ff0bacbf83530401374772c855bfe9a4188fe09 Author: Matthew Zeitlin <37011898+mzeitlin11@users.noreply.github.com> Date: Sat Nov 25 16:58:03 2023 -0500 Add generated files and webhook crate commit 50afbe3975dddff5f362a623bf584b89b7846616 Author: Matthew Zeitlin <37011898+mzeitlin11@users.noreply.github.com> Date: Sat Nov 25 16:47:14 2023 -0500 Add codegen changes commit edea437b86525b543efc8916cf22959b5727b5dd Author: Matthew Zeitlin <37011898+mzeitlin11@users.noreply.github.com> Date: Sat Nov 25 13:53:40 2023 -0500 Remove extra files commit 25077cb6eb070120db7e8a05c163f15c5e1bda89 Author: Matthew Zeitlin <37011898+mzeitlin11@users.noreply.github.com> Date: Sat Nov 25 13:49:41 2023 -0500 Stripe client changes + core types crate More merge changes --- .github/workflows/async-stripe.yml | 176 +- .github/workflows/openapi.yml | 49 +- .gitignore | 1 + CHANGELOG.md | 176 + CONTRIBUTING.md | 41 +- Cargo.toml | 215 +- Makefile.toml | 83 - README.md | 84 +- async-stripe/Cargo.toml | 106 + build.rs => async-stripe/build.rs | 0 .../src}/client/base/async_std.rs | 22 +- .../src}/client/base/tokio.rs | 63 +- .../src}/client/base/tokio_blocking.rs | 12 +- async-stripe/src/client/headers.rs | 44 + {src => async-stripe/src}/client/mod.rs | 7 +- .../src}/client/request_strategy.rs | 0 {src => async-stripe/src}/client/stripe.rs | 66 +- async-stripe/src/error.rs | 32 + {src => async-stripe/src}/lib.rs | 25 +- async-stripe/src/pagination.rs | 176 + crate_info.md | 110 + examples/README.md | 11 + examples/customer.rs | 70 - examples/endpoints/Cargo.toml | 26 + examples/endpoints/src/checkout.rs | 91 + examples/endpoints/src/connect.rs | 46 + examples/endpoints/src/customer.rs | 54 + examples/endpoints/src/main.rs | 43 + examples/endpoints/src/payment_intent.rs | 94 + examples/endpoints/src/payment_link.rs | 53 + examples/endpoints/src/strategy.rs | 15 + examples/endpoints/src/subscriptions.rs | 111 + examples/pagination/Cargo.toml | 21 + examples/pagination/src/main.rs | 24 + examples/payment-intent.rs | 117 - examples/payment-link.rs | 62 - examples/strategy.rs | 26 - examples/subscriptions.rs | 135 - examples/webhook-actix/Cargo.toml | 11 + .../src/main.rs} | 23 +- examples/webhook-axum/Cargo.toml | 11 + .../src/main.rs} | 18 +- examples/webhook-rocket/Cargo.toml | 10 + .../src/main.rs} | 35 +- generated/stripe_billing/Cargo.toml | 76 + .../src/billing_portal_configuration/mod.rs | 5 + .../billing_portal_configuration/requests.rs | 1208 + .../src/billing_portal_configuration/types.rs | 35 + .../src/billing_portal_session/mod.rs | 5 + .../src/billing_portal_session/requests.rs | 379 + .../src/billing_portal_session/types.rs | 240 + .../stripe_billing/src/credit_note/mod.rs | 4 + .../src/credit_note/requests.rs | 689 + .../src/credit_note_line_item/mod.rs | 4 + .../src/credit_note_line_item/requests.rs | 42 + generated/stripe_billing/src/invoice/mod.rs | 4 + .../stripe_billing/src/invoice/requests.rs | 6253 +++ .../stripe_billing/src/invoice_item/mod.rs | 4 + .../src/invoice_item/requests.rs | 784 +- .../src/invoice_line_item/mod.rs | 4 + .../src/invoice_line_item/requests.rs | 434 + generated/stripe_billing/src/mod.rs | 183 + generated/stripe_billing/src/plan/mod.rs | 4 + generated/stripe_billing/src/plan/requests.rs | 392 + .../src/portal_business_profile.rs | 9 + .../src/portal_customer_update.rs | 74 + .../stripe_billing/src/portal_features.rs | 9 + ...ws_after_completion_hosted_confirmation.rs | 5 + .../portal_flows_after_completion_redirect.rs | 5 + .../src/portal_flows_coupon_offer.rs | 5 + .../stripe_billing/src/portal_flows_flow.rs | 74 + .../src/portal_flows_flow_after_completion.rs | 68 + .../portal_flows_flow_subscription_cancel.rs | 7 + .../portal_flows_flow_subscription_update.rs | 5 + ..._flows_flow_subscription_update_confirm.rs | 11 + .../src/portal_flows_retention.rs | 59 + ...ws_subscription_update_confirm_discount.rs | 7 + ..._flows_subscription_update_confirm_item.rs | 18 + .../stripe_billing/src/portal_invoice_list.rs | 5 + .../stripe_billing/src/portal_login_page.rs | 10 + .../src/portal_payment_method_update.rs | 5 + .../src/portal_subscription_cancel.rs | 124 + ...portal_subscription_cancellation_reason.rs | 82 + .../src/portal_subscription_pause.rs | 5 + .../src/portal_subscription_update.rs | 133 + .../src/portal_subscription_update_product.rs | 7 + generated/stripe_billing/src/quote/mod.rs | 4 + .../stripe_billing/src/quote/requests.rs | 1221 + .../stripe_billing/src/subscription/mod.rs | 4 + .../src/subscription/requests.rs | 4436 ++ .../src/subscription_item/mod.rs | 4 + .../src/subscription_item/requests.rs | 929 + .../src/subscription_schedule/mod.rs | 4 + .../src/subscription_schedule/requests.rs | 2455 + generated/stripe_billing/src/tax_id/mod.rs | 4 + .../stripe_billing/src/tax_id/requests.rs | 838 + .../src/test_helpers_test_clock/mod.rs | 4 + .../src/test_helpers_test_clock/requests.rs | 137 + .../stripe_billing/src/usage_record/mod.rs | 5 + .../src/usage_record/requests.rs | 109 + .../stripe_billing/src/usage_record/types.rs | 26 + .../src/usage_record_summary/mod.rs | 4 + .../src/usage_record_summary/requests.rs | 52 + generated/stripe_checkout/Cargo.toml | 46 + .../checkout_acss_debit_mandate_options.rs | 190 + ...ckout_acss_debit_payment_method_options.rs | 201 + .../checkout_affirm_payment_method_options.rs | 70 + ...fterpay_clearpay_payment_method_options.rs | 70 + .../checkout_alipay_payment_method_options.rs | 70 + ...ut_au_becs_debit_payment_method_options.rs | 70 + ...ckout_bacs_debit_payment_method_options.rs | 76 + ...ckout_bancontact_payment_method_options.rs | 70 + .../checkout_boleto_payment_method_options.rs | 79 + .../src/checkout_card_installments_options.rs | 6 + .../checkout_card_payment_method_options.rs | 90 + ...checkout_cashapp_payment_method_options.rs | 70 + ...ce_bank_transfer_payment_method_options.rs | 162 + ...customer_balance_payment_method_options.rs | 131 + .../checkout_eps_payment_method_options.rs | 70 + .../checkout_fpx_payment_method_options.rs | 70 + ...checkout_giropay_payment_method_options.rs | 70 + ...heckout_grab_pay_payment_method_options.rs | 70 + .../checkout_ideal_payment_method_options.rs | 70 + .../checkout_klarna_payment_method_options.rs | 76 + ...checkout_konbini_payment_method_options.rs | 73 + .../checkout_link_payment_method_options.rs | 73 + .../checkout_oxxo_payment_method_options.rs | 73 + .../checkout_p24_payment_method_options.rs | 70 + .../checkout_paynow_payment_method_options.rs | 70 + .../checkout_paypal_payment_method_options.rs | 135 + .../checkout_pix_payment_method_options.rs | 5 + ...kout_revolut_pay_payment_method_options.rs | 2 + ...ckout_sepa_debit_payment_method_options.rs | 76 + .../src/checkout_session/mod.rs | 5 + .../src/checkout_session/requests.rs | 6570 +++ .../src/checkout_session/types.rs | 840 + ...checkout_session_payment_method_options.rs | 61 + .../checkout_sofort_payment_method_options.rs | 70 + .../checkout_swish_payment_method_options.rs | 6 + ..._us_bank_account_payment_method_options.rs | 138 + generated/stripe_checkout/src/mod.rs | 247 + ...pages_checkout_session_after_expiration.rs | 5 + ...ckout_session_after_expiration_recovery.rs | 13 + ...nt_pages_checkout_session_automatic_tax.rs | 71 + .../payment_pages_checkout_session_consent.rs | 120 + ...ges_checkout_session_consent_collection.rs | 130 + ...es_checkout_session_currency_conversion.rs | 11 + ...nt_pages_checkout_session_custom_fields.rs | 79 + ...checkout_session_custom_fields_dropdown.rs | 7 + ...es_checkout_session_custom_fields_label.rs | 62 + ..._checkout_session_custom_fields_numeric.rs | 9 + ...s_checkout_session_custom_fields_option.rs | 8 + ...ges_checkout_session_custom_fields_text.rs | 9 + ...ment_pages_checkout_session_custom_text.rs | 12 + ...s_checkout_session_custom_text_position.rs | 5 + ...pages_checkout_session_customer_details.rs | 78 + ...pages_checkout_session_invoice_creation.rs | 6 + ...pages_checkout_session_invoice_settings.rs | 19 + ..._session_payment_method_reuse_agreement.rs | 70 + ...heckout_session_phone_number_collection.rs | 5 + ...out_session_shipping_address_collection.rs | 776 + ...nt_pages_checkout_session_shipping_cost.rs | 14 + ..._pages_checkout_session_shipping_option.rs | 7 + .../payment_pages_checkout_session_tax_id.rs | 258 + ...ages_checkout_session_tax_id_collection.rs | 5 + ...nt_pages_checkout_session_total_details.rs | 12 + ...ession_total_details_resource_breakdown.rs | 7 + generated/stripe_connect/Cargo.toml | 72 + generated/stripe_connect/src/account/mod.rs | 4 + .../stripe_connect/src/account/requests.rs | 2275 + .../stripe_connect/src/account_link/mod.rs | 5 + .../src/account_link/requests.rs | 248 + .../stripe_connect/src/account_link/types.rs | 15 + .../stripe_connect/src/account_session/mod.rs | 5 + .../src/account_session/requests.rs | 127 + .../src/account_session/types.rs | 28 + .../stripe_connect/src/application_fee/mod.rs | 4 + .../src/application_fee/requests.rs | 67 + .../src/application_fee_refund/mod.rs | 4 + .../src/application_fee_refund/requests.rs | 139 + .../stripe_connect/src/apps_secret/mod.rs | 5 + .../src/apps_secret/requests.rs | 363 + .../stripe_connect/src/apps_secret/types.rs | 39 + .../stripe_connect/src/capability/mod.rs | 4 + .../stripe_connect/src/capability/requests.rs | 86 + ...edded_account_session_create_components.rs | 7 + .../src/connect_embedded_base_config_claim.rs | 6 + .../src/connect_embedded_base_features.rs | 2 + .../src/connect_embedded_payments_config.rs | 6 + .../src/connect_embedded_payments_features.rs | 10 + .../src/connect_embedded_payouts_config.rs | 6 + .../src/connect_embedded_payouts_features.rs | 12 + .../stripe_connect/src/country_spec/mod.rs | 5 + .../src/country_spec/requests.rs | 60 + .../stripe_connect/src/country_spec/types.rs | 33 + ...country_spec_verification_field_details.rs | 7 + .../src/country_spec_verification_fields.rs | 5 + .../src/external_account/mod.rs | 4 + .../src/external_account/requests.rs | 379 + .../stripe_connect/src/login_link/mod.rs | 5 + .../stripe_connect/src/login_link/requests.rs | 27 + .../stripe_connect/src/login_link/types.rs | 10 + generated/stripe_connect/src/mod.rs | 121 + generated/stripe_connect/src/person/mod.rs | 4 + .../stripe_connect/src/person/requests.rs | 619 + .../src/secret_service_resource_scope.rs | 64 + generated/stripe_connect/src/topup/mod.rs | 4 + .../stripe_connect/src/topup/requests.rs | 225 + generated/stripe_connect/src/transfer/mod.rs | 4 + .../stripe_connect/src/transfer/requests.rs | 211 + .../src/transfer_reversal/mod.rs | 4 + .../src/transfer_reversal/requests.rs | 149 + generated/stripe_core/Cargo.toml | 84 + generated/stripe_core/src/balance/mod.rs | 5 + generated/stripe_core/src/balance/requests.rs | 18 + generated/stripe_core/src/balance/types.rs | 33 + generated/stripe_core/src/balance_amount.rs | 10 + .../src}/balance_amount_by_source_type.rs | 11 +- .../stripe_core/src/balance_amount_net.rs | 10 + generated/stripe_core/src/balance_detail.rs | 5 + .../src/balance_transaction/mod.rs | 4 + .../src/balance_transaction/requests.rs | 83 + generated/stripe_core/src/cash_balance/mod.rs | 4 + .../stripe_core/src/cash_balance/requests.rs | 114 + generated/stripe_core/src/charge/mod.rs | 4 + generated/stripe_core/src/charge/requests.rs | 495 + generated/stripe_core/src/customer/mod.rs | 4 + .../stripe_core/src/customer/requests.rs | 1639 + .../src/customer_balance_transaction/mod.rs | 4 + .../customer_balance_transaction/requests.rs | 142 + .../customer_cash_balance_transaction/mod.rs | 4 + .../requests.rs | 70 + .../stripe_core/src/customer_session/mod.rs | 5 + .../src/customer_session/requests.rs | 58 + .../stripe_core/src/customer_session/types.rs | 22 + .../customer_session_resource_components.rs | 6 + ...resource_components_resource_buy_button.rs | 6 + ...ource_components_resource_pricing_table.rs | 6 + generated/stripe_core/src/dispute/mod.rs | 4 + generated/stripe_core/src/dispute/requests.rs | 239 + generated/stripe_core/src/event/mod.rs | 4 + generated/stripe_core/src/event/requests.rs | 76 + generated/stripe_core/src/file/mod.rs | 4 + generated/stripe_core/src/file/requests.rs | 67 + generated/stripe_core/src/file_link/mod.rs | 4 + .../stripe_core/src/file_link/requests.rs | 132 + generated/stripe_core/src/mandate/mod.rs | 4 + generated/stripe_core/src/mandate/requests.rs | 21 + generated/stripe_core/src/mod.rs | 192 + .../stripe_core/src/payment_intent/mod.rs | 4 + .../src/payment_intent/requests.rs | 20712 ++++++++ .../stripe_core/src/payment_source/mod.rs | 4 + .../src/payment_source/requests.rs | 101 + generated/stripe_core/src/payout/mod.rs | 4 + generated/stripe_core/src/payout/requests.rs | 323 + generated/stripe_core/src/refund/mod.rs | 4 + generated/stripe_core/src/refund/requests.rs | 311 + .../stripe_core/src/setup_attempt/mod.rs | 4 + .../stripe_core/src/setup_attempt/requests.rs | 54 + generated/stripe_core/src/setup_intent/mod.rs | 4 + .../stripe_core/src/setup_intent/requests.rs | 8296 +++ generated/stripe_core/src/token/mod.rs | 5 + generated/stripe_core/src/token/requests.rs | 1208 + generated/stripe_core/src/token/types.rs | 49 + generated/stripe_fraud/Cargo.toml | 52 + .../src/deleted_radar_value_list.rs | 13 + .../src/deleted_radar_value_list_item.rs | 13 + generated/stripe_fraud/src/mod.rs | 28 + .../src/radar_early_fraud_warning/mod.rs | 5 + .../src/radar_early_fraud_warning/requests.rs | 71 + .../src/radar_early_fraud_warning/types.rs | 51 +- .../stripe_fraud/src/radar_value_list/mod.rs | 5 + .../src/radar_value_list/requests.rs | 162 + .../src/radar_value_list/types.rs | 112 + .../src/radar_value_list_item/mod.rs | 5 + .../src/radar_value_list_item/requests.rs | 121 + .../src/radar_value_list_item/types.rs | 27 + generated/stripe_fraud/src/review/mod.rs | 4 + generated/stripe_fraud/src/review/requests.rs | 82 + generated/stripe_issuing/Cargo.toml | 56 + .../src/issuing_authorization/mod.rs | 4 + .../src/issuing_authorization/requests.rs | 2145 + .../stripe_issuing/src/issuing_card/mod.rs | 4 + .../src/issuing_card/requests.rs | 6903 +++ .../src/issuing_cardholder/mod.rs | 4 + .../src/issuing_cardholder/requests.rs | 6792 +++ .../stripe_issuing/src/issuing_dispute/mod.rs | 4 + .../src/issuing_dispute/requests.rs | 1125 + .../stripe_issuing/src/issuing_token/mod.rs | 4 + .../src/issuing_token/requests.rs | 148 + .../src/issuing_transaction/mod.rs | 4 + .../src/issuing_transaction/requests.rs | 2722 + generated/stripe_issuing/src/mod.rs | 81 + generated/stripe_misc/Cargo.toml | 82 + .../stripe_misc/src/apple_pay_domain/mod.rs | 5 + .../src/apple_pay_domain/requests.rs | 97 + .../stripe_misc/src/apple_pay_domain/types.rs | 17 + ...bank_connections_resource_accountholder.rs | 69 + .../src/bank_connections_resource_balance.rs | 78 + ...ource_balance_api_resource_cash_balance.rs | 11 + ...rce_balance_api_resource_credit_balance.rs | 11 + ...nk_connections_resource_balance_refresh.rs | 71 + ...s_resource_link_account_session_filters.rs | 5 + ..._connections_resource_ownership_refresh.rs | 67 + ...onnections_resource_transaction_refresh.rs | 80 + ...transaction_resource_status_transitions.rs | 7 + .../stripe_misc/src/climate_order/mod.rs | 5 + .../stripe_misc/src/climate_order/requests.rs | 173 + .../stripe_misc/src/climate_order/types.rs | 179 + .../stripe_misc/src/climate_product/mod.rs | 5 + .../src/climate_product/requests.rs | 60 + .../stripe_misc/src/climate_product/types.rs | 32 + .../src/climate_removals_beneficiary.rs | 5 + .../src/climate_removals_location.rs | 13 + .../src/climate_removals_order_deliveries.rs | 13 + .../src/climate_removals_products_price.rs | 9 + .../stripe_misc/src/climate_supplier/mod.rs | 5 + .../src/climate_supplier/requests.rs | 60 + .../stripe_misc/src/climate_supplier/types.rs | 81 + .../src/deleted_apple_pay_domain.rs | 13 + .../src/deleted_webhook_endpoint.rs | 13 + .../stripe_misc/src/ephemeral_key/mod.rs | 5 + .../stripe_misc/src/ephemeral_key/requests.rs | 50 + .../stripe_misc/src/ephemeral_key/types.rs | 21 + .../stripe_misc/src/exchange_rate/mod.rs | 5 + .../stripe_misc/src/exchange_rate/requests.rs | 59 + .../stripe_misc/src/exchange_rate/types.rs | 43 + .../src/financial_connections_account/mod.rs | 5 + .../financial_connections_account/requests.rs | 373 + .../financial_connections_account/types.rs | 432 + .../financial_connections_account_owner.rs | 25 + ...financial_connections_account_ownership.rs | 17 + .../src/financial_connections_session/mod.rs | 5 + .../financial_connections_session/requests.rs | 145 + .../financial_connections_session/types.rs | 150 + .../financial_connections_transaction/mod.rs | 5 + .../requests.rs | 91 + .../types.rs | 92 + ...rting_finance_report_run_run_parameters.rs | 32 + ...lato_data_document_report_date_of_birth.rs | 10 + ...to_data_document_report_expiration_date.rs | 10 + ...gelato_data_document_report_issued_date.rs | 10 + .../src/gelato_data_id_number_report_date.rs | 10 + .../src/gelato_data_verified_outputs_date.rs | 10 + .../stripe_misc/src/gelato_document_report.rs | 140 + .../src/gelato_document_report_error.rs | 66 + .../src/gelato_id_number_report.rs | 130 + .../src/gelato_id_number_report_error.rs | 66 + .../src/gelato_report_document_options.rs | 76 + .../src/gelato_report_id_number_options.rs | 2 + .../stripe_misc/src/gelato_selfie_report.rs | 66 + .../src/gelato_selfie_report_error.rs | 68 + .../src/gelato_session_document_options.rs | 76 + .../src/gelato_session_id_number_options.rs | 2 + .../src/gelato_session_last_error.rs | 104 + .../src/gelato_verification_report_options.rs | 7 + .../gelato_verification_session_options.rs | 7 + .../src/gelato_verified_outputs.rs | 73 + .../src/identity_verification_report/mod.rs | 5 + .../identity_verification_report/requests.rs | 70 + .../src/identity_verification_report/types.rs | 97 + .../src/identity_verification_session/mod.rs | 5 + .../identity_verification_session/requests.rs | 394 + .../identity_verification_session/types.rs | 176 + generated/stripe_misc/src/mod.rs | 320 + .../src/reporting_report_run/mod.rs | 5 + .../src/reporting_report_run/requests.rs | 2123 + .../src/reporting_report_run/types.rs | 42 + .../src/reporting_report_type/mod.rs | 5 + .../src/reporting_report_type/requests.rs | 47 + .../src/reporting_report_type/types.rs | 38 + .../src/scheduled_query_run/mod.rs | 5 + .../src/scheduled_query_run/requests.rs | 60 + .../src/scheduled_query_run/types.rs | 36 + .../src/sigma_scheduled_query_run_error.rs | 5 + .../stripe_misc/src/tax_calculation/mod.rs | 5 + .../src/tax_calculation/requests.rs | 663 + .../stripe_misc/src/tax_calculation/types.rs | 41 + .../src/tax_calculation_line_item.rs | 89 + ..._registrations_resource_country_options.rs | 101 + ...ce_country_options_ca_province_standard.rs | 5 + ...rations_resource_country_options_canada.rs | 69 + ...ations_resource_country_options_default.rs | 60 + ...ns_resource_country_options_eu_standard.rs | 69 + ...rations_resource_country_options_europe.rs | 71 + ...ons_resource_country_options_simplified.rs | 60 + ..._resource_country_options_united_states.rs | 79 + ..._country_options_us_local_amusement_tax.rs | 5 + ...urce_country_options_us_local_lease_tax.rs | 5 + .../tax_product_resource_customer_details.rs | 130 + ...source_customer_details_resource_tax_id.rs | 260 + .../src/tax_product_resource_jurisdiction.rs | 76 + ...roduct_resource_line_item_tax_breakdown.rs | 171 + ...uct_resource_line_item_tax_rate_details.rs | 97 + .../tax_product_resource_postal_address.rs | 16 + .../src/tax_product_resource_tax_breakdown.rs | 110 + ..._resource_tax_calculation_shipping_cost.rs | 78 + .../tax_product_resource_tax_rate_details.rs | 96 + ..._product_resource_tax_settings_defaults.rs | 69 + ...oduct_resource_tax_settings_head_office.rs | 4 + ...ct_resource_tax_settings_status_details.rs | 7 + ...settings_status_details_resource_active.rs | 2 + ...ettings_status_details_resource_pending.rs | 8 + ...transaction_line_item_resource_reversal.rs | 5 + ...ource_tax_transaction_resource_reversal.rs | 5 + ..._resource_tax_transaction_shipping_cost.rs | 79 + .../stripe_misc/src/tax_registration/mod.rs | 5 + .../src/tax_registration/requests.rs | 5035 ++ .../stripe_misc/src/tax_registration/types.rs | 92 + generated/stripe_misc/src/tax_settings/mod.rs | 5 + .../stripe_misc/src/tax_settings/requests.rs | 148 + .../stripe_misc/src/tax_settings/types.rs | 72 + .../stripe_misc/src/tax_transaction/mod.rs | 5 + .../src/tax_transaction/requests.rs | 241 + .../stripe_misc/src/tax_transaction/types.rs | 97 + .../src/tax_transaction_line_item.rs | 149 + .../src/verification_session_redaction.rs | 60 + .../stripe_misc/src/webhook_endpoint/mod.rs | 5 + .../src/webhook_endpoint/requests.rs | 1709 + .../stripe_misc/src/webhook_endpoint/types.rs | 45 + generated/stripe_payment/Cargo.toml | 58 + .../stripe_payment/src/bank_account/mod.rs | 4 + .../src/bank_account/requests.rs | 459 + generated/stripe_payment/src/card/mod.rs | 4 + generated/stripe_payment/src/card/requests.rs | 430 + generated/stripe_payment/src/mod.rs | 252 + .../stripe_payment/src/payment_link/mod.rs | 4 + .../src/payment_link/requests.rs | 4025 ++ .../stripe_payment/src/payment_method/mod.rs | 4 + .../src/payment_method/requests.rs | 1675 + ...thod_config_resource_display_preference.rs | 127 + ...nfig_resource_payment_method_properties.rs | 7 + .../src/payment_method_configuration/mod.rs | 5 + .../payment_method_configuration/requests.rs | 5730 +++ .../src/payment_method_configuration/types.rs | 115 + .../src/payment_method_domain/mod.rs | 5 + .../src/payment_method_domain/requests.rs | 153 + .../src/payment_method_domain/types.rs | 31 + ...d_domain_resource_payment_method_status.rs | 66 + ..._resource_payment_method_status_details.rs | 6 + generated/stripe_payment/src/source/mod.rs | 4 + .../stripe_payment/src/source/requests.rs | 1272 + .../src/source_mandate_notification.rs | 38 + ...ce_mandate_notification_acss_debit_data.rs | 6 + ...ce_mandate_notification_bacs_debit_data.rs | 6 + ...ce_mandate_notification_sepa_debit_data.rs | 12 + generated/stripe_product/Cargo.toml | 58 + generated/stripe_product/src/coupon/mod.rs | 4 + .../stripe_product/src/coupon/requests.rs | 207 + generated/stripe_product/src/mod.rs | 40 + generated/stripe_product/src/price/mod.rs | 4 + .../stripe_product/src/price/requests.rs | 907 + generated/stripe_product/src/product/mod.rs | 4 + .../stripe_product/src/product/requests.rs | 975 +- .../stripe_product/src/promotion_code/mod.rs | 4 + .../src/promotion_code/requests.rs | 223 + .../stripe_product/src/shipping_rate/mod.rs | 4 + .../src/shipping_rate/requests.rs | 391 + generated/stripe_product/src/tax_code/mod.rs | 4 + .../stripe_product/src/tax_code/requests.rs | 59 + generated/stripe_product/src/tax_rate/mod.rs | 4 + .../stripe_product/src/tax_rate/requests.rs | 185 + generated/stripe_shared/Cargo.toml | 27 + generated/stripe_shared/src/account.rs | 198 + .../src/account_annual_revenue.rs | 12 + .../account_bacs_debit_payments_settings.rs | 14 + .../src/account_branding_settings.rs | 13 + .../src/account_business_profile.rs | 29 + .../stripe_shared/src/account_capabilities.rs | 173 + .../account_capability_future_requirements.rs | 26 + .../src/account_capability_requirements.rs | 33 + .../src/account_card_issuing_settings.rs | 5 + .../src/account_card_payments_settings.rs | 17 + .../src/account_dashboard_settings.rs | 9 + .../src/account_decline_charge_on.rs | 9 + .../src/account_future_requirements.rs | 26 + .../src/account_invoices_settings.rs | 6 + .../src/account_monthly_estimated_revenue.rs | 8 + .../src/account_payments_settings.rs | 18 + .../src/account_payout_settings.rs | 11 + .../stripe_shared/src/account_requirements.rs | 27 + .../src/account_requirements_alternative.rs | 7 + .../src/account_requirements_error.rs | 387 + .../account_sepa_debit_payments_settings.rs | 6 + .../stripe_shared/src/account_settings.rs | 19 + .../src/account_terms_of_service.rs | 10 + .../src/account_tos_acceptance.rs | 15 + .../src/account_treasury_settings.rs | 5 + .../account_unification_account_controller.rs | 67 + .../stripe_shared/src}/address.rs | 14 +- generated/stripe_shared/src/api_errors.rs | 690 + generated/stripe_shared/src/api_version.rs | 350 + generated/stripe_shared/src/application.rs | 14 + .../stripe_shared/src/application_fee.rs | 39 + .../src/application_fee_refund.rs | 33 + generated/stripe_shared/src/automatic_tax.rs | 69 + .../stripe_shared/src/balance_transaction.rs | 228 + .../src/balance_transaction_source.rs | 63 + generated/stripe_shared/src/bank_account.rs | 133 + .../stripe_shared/src/billing_details.rs | 11 + .../stripe_shared/src/cancellation_details.rs | 138 + generated/stripe_shared/src/capability.rs | 92 + .../stripe_shared/src}/card.rs | 184 +- .../card_issuing_account_terms_of_service.rs | 10 + .../card_mandate_payment_method_details.rs | 2 + generated/stripe_shared/src/cash_balance.rs | 17 + generated/stripe_shared/src/charge.rs | 192 + .../stripe_shared/src/charge_fraud_details.rs | 9 + generated/stripe_shared/src/charge_outcome.rs | 34 + .../stripe_shared/src/charge_transfer_data.rs | 8 + .../src/checkout_session_item.rs | 38 + .../src/connect_account_reference.rs | 63 + .../src/connect_collection_transfer.rs | 21 + generated/stripe_shared/src/coupon.rs | 112 + .../stripe_shared/src/coupon_applies_to.rs | 5 + .../src/coupon_currency_option.rs | 5 + generated/stripe_shared/src/credit_note.rs | 251 + .../src/credit_note_line_item.rs | 101 + .../src/credit_note_tax_amount.rs | 111 + .../stripe_shared/src/currency_option.rs | 81 + .../stripe_shared/src}/custom_unit_amount.rs | 12 +- generated/stripe_shared/src/customer.rs | 167 + .../stripe_shared/src/customer_acceptance.rs | 66 + ...tomer_balance_customer_balance_settings.rs | 64 + ...saction_resource_adjusted_for_overdraft.rs | 7 + ...resource_applied_to_payment_transaction.rs | 5 + ...transaction_resource_funded_transaction.rs | 5 + ...nded_transaction_resource_bank_transfer.rs | 82 + ...bank_transfer_resource_eu_bank_transfer.rs | 10 + ...bank_transfer_resource_gb_bank_transfer.rs | 10 + ...bank_transfer_resource_jp_bank_transfer.rs | 10 + ...bank_transfer_resource_us_bank_transfer.rs | 65 + ...ource_refunded_from_payment_transaction.rs | 5 + ...saction_resource_transferred_to_balance.rs | 5 + ...urce_unapplied_from_payment_transaction.rs | 5 + .../src/customer_balance_transaction.rs | 129 + .../src/customer_cash_balance_transaction.rs | 131 + generated/stripe_shared/src/customer_tax.rs | 69 + .../src/customer_tax_location.rs | 69 + .../stripe_shared/src/deleted_account.rs | 13 + .../stripe_shared/src/deleted_bank_account.rs | 16 + generated/stripe_shared/src/deleted_card.rs | 16 + generated/stripe_shared/src/deleted_coupon.rs | 13 + .../stripe_shared/src/deleted_customer.rs | 13 + .../stripe_shared/src/deleted_discount.rs | 31 + .../src/deleted_external_account.rs | 18 + .../stripe_shared/src/deleted_invoice.rs | 13 + .../stripe_shared/src/deleted_invoiceitem.rs | 13 + .../src/deleted_payment_source.rs | 18 + generated/stripe_shared/src/deleted_person.rs | 13 + generated/stripe_shared/src/deleted_plan.rs | 13 + .../stripe_shared/src/deleted_product.rs | 13 + .../src/deleted_subscription_item.rs | 13 + generated/stripe_shared/src/deleted_tax_id.rs | 13 + .../src/deleted_test_helpers_test_clock.rs | 13 + .../src/destination_details_unimplemented.rs | 2 + .../stripe_shared/src}/discount.rs | 67 +- .../src/discounts_resource_discount_amount.rs | 7 + generated/stripe_shared/src/dispute.rs | 124 + .../stripe_shared/src/dispute_evidence.rs | 67 + .../src/dispute_evidence_details.rs | 14 + .../src/dispute_payment_method_details.rs | 60 + .../dispute_payment_method_details_card.rs | 9 + generated/stripe_shared/src/email_sent.rs | 7 + generated/stripe_shared/src/error.rs | 5 + generated/stripe_shared/src/event.rs | 832 + .../stripe_shared/src/external_account.rs | 18 + .../src/external_account_requirements.rs | 15 + generated/stripe_shared/src/fee.rs | 15 + generated/stripe_shared/src/file.rs | 136 + generated/stripe_shared/src/file_link.rs | 32 + .../stripe_shared/src/funding_instructions.rs | 68 + .../src/funding_instructions_bank_transfer.rs | 65 + ...g_instructions_bank_transfer_aba_record.rs | 10 + ...uctions_bank_transfer_financial_address.rs | 165 + ..._instructions_bank_transfer_iban_record.rs | 12 + ...ructions_bank_transfer_sort_code_record.rs | 10 + ..._instructions_bank_transfer_spei_record.rs | 10 + ...instructions_bank_transfer_swift_record.rs | 10 + ...nstructions_bank_transfer_zengin_record.rs | 18 + generated/stripe_shared/src/invoice.rs | 539 + .../src/invoice_installments_card.rs | 5 + generated/stripe_shared/src/invoice_item.rs | 78 + .../src/invoice_item_threshold_reason.rs | 7 + .../stripe_shared/src/invoice_line_item.rs | 120 + .../src/invoice_line_item_period.rs | 7 + .../src/invoice_mandate_options_card.rs | 68 + ...voice_payment_method_options_acss_debit.rs | 68 + ...thod_options_acss_debit_mandate_options.rs | 60 + ...voice_payment_method_options_bancontact.rs | 68 + .../invoice_payment_method_options_card.rs | 71 + ...payment_method_options_customer_balance.rs | 64 + ..._options_customer_balance_bank_transfer.rs | 10 + ..._balance_bank_transfer_eu_bank_transfer.rs | 82 + .../invoice_payment_method_options_konbini.rs | 2 + ..._payment_method_options_us_bank_account.rs | 69 + ..._us_bank_account_linked_account_options.rs | 122 + .../src/invoice_rendering_pdf.rs | 66 + .../src/invoice_setting_custom_field.rs | 7 + .../src/invoice_setting_customer_setting.rs | 11 + .../src/invoice_setting_quote_setting.rs | 7 + .../src/invoice_setting_rendering_options.rs | 5 + ...ing_subscription_schedule_phase_setting.rs | 13 + ...e_setting_subscription_schedule_setting.rs | 11 + .../stripe_shared/src/invoice_tax_amount.rs | 111 + .../src/invoice_threshold_reason.rs | 7 + .../src/invoice_transfer_data.rs | 8 + .../src/invoices_from_invoice.rs | 7 + .../src/invoices_invoice_rendering.rs | 7 + .../src/invoices_payment_method_options.rs | 15 + .../src/invoices_payment_settings.rs | 143 + .../src/invoices_resource_invoice_tax_id.rs | 258 + ...ices_resource_line_items_credited_items.rs | 7 + ...s_resource_line_items_proration_details.rs | 5 + .../src/invoices_shipping_cost.rs | 14 + .../src/invoices_status_transitions.rs | 11 + .../src/issuing_authorization.rs | 203 + .../issuing_authorization_amount_details.rs | 7 + ..._authorization_authentication_exemption.rs | 125 + .../issuing_authorization_merchant_data.rs | 37 +- .../src/issuing_authorization_network_data.rs | 11 + .../issuing_authorization_pending_request.rs | 21 + .../src/issuing_authorization_request.rs | 131 + .../issuing_authorization_three_d_secure.rs | 66 + .../src/issuing_authorization_treasury.rs | 9 + ...issuing_authorization_verification_data.rs | 258 + generated/stripe_shared/src/issuing_card.rs | 293 + .../src/issuing_card_apple_pay.rs | 65 + .../issuing_card_authorization_controls.rs | 2075 + .../src/issuing_card_google_pay.rs | 65 + .../src/issuing_card_shipping.rs | 269 + .../src/issuing_card_shipping_customs.rs | 6 + .../src/issuing_card_spending_limit.rs | 1107 + .../stripe_shared/src/issuing_card_wallets.rs | 7 + .../stripe_shared/src/issuing_cardholder.rs | 223 + .../src/issuing_cardholder_address.rs | 4 + ...suing_cardholder_authorization_controls.rs | 2077 + .../src/issuing_cardholder_card_issuing.rs | 6 + .../src/issuing_cardholder_company.rs | 5 + .../src/issuing_cardholder_id_document.rs | 7 + .../src/issuing_cardholder_individual.rs | 18 + .../src/issuing_cardholder_individual_dob.rs | 9 + .../src/issuing_cardholder_requirements.rs | 154 + .../src/issuing_cardholder_spending_limit.rs | 1107 + ...ssuing_cardholder_user_terms_acceptance.rs | 9 + .../src/issuing_cardholder_verification.rs | 5 + .../stripe_shared/src/issuing_dispute.rs | 101 + .../src/issuing_dispute_canceled_evidence.rs | 133 + .../src/issuing_dispute_duplicate_evidence.rs | 16 + .../src/issuing_dispute_evidence.rs | 90 + .../issuing_dispute_fraudulent_evidence.rs | 7 + ...e_merchandise_not_as_described_evidence.rs | 72 + .../issuing_dispute_not_received_evidence.rs | 70 + .../src/issuing_dispute_other_evidence.rs | 66 + ...spute_service_not_as_described_evidence.rs | 13 + .../src/issuing_dispute_treasury.rs | 7 + .../src/issuing_network_token_address.rs | 7 + .../src/issuing_network_token_device.rs | 81 + .../src/issuing_network_token_mastercard.rs | 14 + .../src/issuing_network_token_network_data.rs | 71 + .../src/issuing_network_token_visa.rs | 13 + .../issuing_network_token_wallet_provider.rs | 299 + generated/stripe_shared/src/issuing_token.rs | 209 + .../stripe_shared/src/issuing_transaction.rs | 177 + .../src/issuing_transaction_amount_details.rs | 7 + .../src/issuing_transaction_flight_data.rs | 13 + .../issuing_transaction_flight_data_leg.rs | 15 + .../src/issuing_transaction_fuel_data.rs | 13 + .../src/issuing_transaction_lodging_data.rs | 7 + .../src/issuing_transaction_network_data.rs | 14 + .../issuing_transaction_purchase_details.rs | 13 + .../src/issuing_transaction_receipt_data.rs | 11 + .../src/issuing_transaction_treasury.rs | 7 + .../stripe_shared/src/legal_entity_company.rs | 182 + .../src/legal_entity_company_verification.rs | 4 + ...al_entity_company_verification_document.rs | 12 + .../stripe_shared/src/legal_entity_dob.rs | 9 + .../src}/legal_entity_japan_address.rs | 18 +- .../src/legal_entity_person_verification.rs | 19 + ...gal_entity_person_verification_document.rs | 13 + .../src/legal_entity_ubo_declaration.rs | 9 + generated/stripe_shared/src/level3.rs | 13 + .../stripe_shared/src/level3_line_items.rs | 9 + .../src/line_items_discount_amount.rs | 6 + .../src/line_items_tax_amount.rs | 108 + .../linked_account_options_us_bank_account.rs | 130 + generated/stripe_shared/src/mandate.rs | 142 + .../stripe_shared/src/mandate_acss_debit.rs | 180 + .../src/mandate_au_becs_debit.rs | 6 + .../stripe_shared/src/mandate_bacs_debit.rs | 138 + .../stripe_shared/src/mandate_cashapp.rs | 2 + generated/stripe_shared/src/mandate_link.rs | 2 + .../stripe_shared/src/mandate_multi_use.rs | 2 + .../src/mandate_payment_method_details.rs | 25 + generated/stripe_shared/src/mandate_paypal.rs | 8 + .../stripe_shared/src/mandate_sepa_debit.rs | 8 + .../stripe_shared/src/mandate_single_use.rs | 7 + .../src/mandate_us_bank_account.rs | 58 + generated/stripe_shared/src/mod.rs | 2465 + generated/stripe_shared/src/networks.rs | 8 + .../src/notification_event_data.rs | 11 + .../src/notification_event_request.rs | 10 + .../stripe_shared/src/offline_acceptance.rs | 2 + .../stripe_shared/src/online_acceptance.rs | 7 + .../stripe_shared/src/package_dimensions.rs | 11 + .../src/payment_flows_amount_details.rs | 5 + ...yment_flows_amount_details_resource_tip.rs | 6 + ...utomatic_payment_methods_payment_intent.rs | 73 + ..._automatic_payment_methods_setup_intent.rs | 71 + ...nt_flows_private_payment_methods_alipay.rs | 2 + ..._private_payment_methods_alipay_details.rs | 12 + ...ed_authorization_extended_authorization.rs | 59 + ...authorization_incremental_authorization.rs | 59 + ...rprise_features_overcapture_overcapture.rs | 61 + ..._card_details_api_resource_multicapture.rs | 66 + ...lows_private_payment_methods_klarna_dob.rs | 9 + generated/stripe_shared/src/payment_intent.rs | 442 + .../src/payment_intent_card_processing.rs | 5 + .../src/payment_intent_next_action.rs | 51 + ...tent_next_action_alipay_handle_redirect.rs | 11 + .../src/payment_intent_next_action_boleto.rs | 11 + ...ent_next_action_card_await_notification.rs | 9 + ...happ_handle_redirect_or_display_qr_code.rs | 8 + ...ment_intent_next_action_cashapp_qr_code.rs | 9 + ...tion_display_bank_transfer_instructions.rs | 86 + ...intent_next_action_display_oxxo_details.rs | 9 + .../src/payment_intent_next_action_konbini.rs | 8 + ...t_intent_next_action_konbini_familymart.rs | 8 + ...yment_intent_next_action_konbini_lawson.rs | 8 + ...ent_intent_next_action_konbini_ministop.rs | 8 + ...nt_intent_next_action_konbini_seicomart.rs | 8 + ...yment_intent_next_action_konbini_stores.rs | 11 + ...tent_next_action_paynow_display_qr_code.rs | 11 + ..._intent_next_action_pix_display_qr_code.rs | 18 + ...t_next_action_promptpay_display_qr_code.rs | 11 + ...ment_intent_next_action_redirect_to_url.rs | 7 + ...wish_handle_redirect_or_display_qr_code.rs | 11 + ...ayment_intent_next_action_swish_qr_code.rs | 12 + ...t_next_action_verify_with_microdeposits.rs | 70 + ..._next_action_wechat_pay_display_qr_code.rs | 13 + ...tion_wechat_pay_redirect_to_android_app.rs | 17 + ...t_action_wechat_pay_redirect_to_ios_app.rs | 5 + .../payment_intent_payment_method_options.rs | 73 + ...ntent_payment_method_options_acss_debit.rs | 142 + ...nt_payment_method_options_au_becs_debit.rs | 76 + ...ment_intent_payment_method_options_blik.rs | 70 + ...ment_intent_payment_method_options_card.rs | 551 + ...yment_intent_payment_method_options_eps.rs | 70 + ...ment_intent_payment_method_options_link.rs | 132 + ...thod_options_mandate_options_acss_debit.rs | 128 + ...thod_options_mandate_options_sepa_debit.rs | 2 + ...ntent_payment_method_options_sepa_debit.rs | 79 + ...ent_intent_payment_method_options_swish.rs | 73 + ..._payment_method_options_us_bank_account.rs | 203 + .../src/payment_intent_processing.rs | 59 + ...intent_processing_customer_notification.rs | 8 + generated/stripe_shared/src/payment_link.rs | 446 + ...payment_links_resource_after_completion.rs | 66 + .../payment_links_resource_automatic_tax.rs | 9 + ...yment_links_resource_completed_sessions.rs | 7 + ...e_completion_behavior_confirmation_page.rs | 5 + ...s_resource_completion_behavior_redirect.rs | 5 + ...yment_links_resource_consent_collection.rs | 126 + .../payment_links_resource_custom_fields.rs | 77 + ...t_links_resource_custom_fields_dropdown.rs | 5 + ..._resource_custom_fields_dropdown_option.rs | 8 + ...ment_links_resource_custom_fields_label.rs | 60 + ...nt_links_resource_custom_fields_numeric.rs | 7 + ...yment_links_resource_custom_fields_text.rs | 7 + .../src/payment_links_resource_custom_text.rs | 11 + ...ent_links_resource_custom_text_position.rs | 5 + ...payment_links_resource_invoice_creation.rs | 7 + ...payment_links_resource_invoice_settings.rs | 19 + ...ment_links_resource_payment_intent_data.rs | 138 + ...resource_payment_method_reuse_agreement.rs | 68 + ..._links_resource_phone_number_collection.rs | 5 + .../payment_links_resource_restrictions.rs | 4 + ...ks_resource_shipping_address_collection.rs | 772 + .../payment_links_resource_shipping_option.rs | 7 + ...ayment_links_resource_subscription_data.rs | 13 + ...urce_subscription_data_invoice_settings.rs | 4 + ...ayment_links_resource_tax_id_collection.rs | 5 + .../payment_links_resource_transfer_data.rs | 8 + generated/stripe_shared/src/payment_method.rs | 265 + .../src/payment_method_acss_debit.rs | 14 + .../src/payment_method_affirm.rs | 2 + .../src/payment_method_afterpay_clearpay.rs | 2 + .../src/payment_method_au_becs_debit.rs | 10 + .../src/payment_method_bacs_debit.rs | 10 + .../src/payment_method_bancontact.rs | 2 + .../stripe_shared/src/payment_method_blik.rs | 2 + .../src/payment_method_boleto.rs | 5 + .../stripe_shared/src/payment_method_card.rs | 44 + .../src/payment_method_card_checks.rs | 9 + .../src/payment_method_card_present.rs | 108 + .../payment_method_card_present_networks.rs | 7 + .../src/payment_method_card_wallet.rs | 95 + ...ethod_card_wallet_amex_express_checkout.rs | 2 + .../payment_method_card_wallet_apple_pay.rs | 2 + .../payment_method_card_wallet_google_pay.rs | 2 + .../src/payment_method_card_wallet_link.rs | 2 + .../payment_method_card_wallet_masterpass.rs | 19 + .../payment_method_card_wallet_samsung_pay.rs | 2 + ...ayment_method_card_wallet_visa_checkout.rs | 19 + .../src/payment_method_cashapp.rs | 7 + ...iz_payment_method_configuration_details.rs | 7 + .../src/payment_method_customer_balance.rs | 2 + .../src/payment_method_details.rs | 90 + ...ment_method_details_ach_credit_transfer.rs | 11 + .../src/payment_method_details_ach_debit.rs | 73 + .../src/payment_method_details_acss_debit.rs | 17 + .../src/payment_method_details_affirm.rs | 2 + ...ayment_method_details_afterpay_clearpay.rs | 7 + .../payment_method_details_au_becs_debit.rs | 13 + .../src/payment_method_details_bacs_debit.rs | 12 + .../src/payment_method_details_bancontact.rs | 85 + .../src/payment_method_details_blik.rs | 2 + .../src/payment_method_details_boleto.rs | 5 + .../src/payment_method_details_card.rs | 71 + .../src/payment_method_details_card_checks.rs | 9 + ...ayment_method_details_card_installments.rs | 5 + ...t_method_details_card_installments_plan.rs | 120 + ...yment_method_details_card_network_token.rs | 5 + .../payment_method_details_card_present.rs | 128 + ...ent_method_details_card_present_offline.rs | 5 + ...ent_method_details_card_present_receipt.rs | 85 + .../src/payment_method_details_card_wallet.rs | 97 + ...tails_card_wallet_amex_express_checkout.rs | 2 + ...nt_method_details_card_wallet_apple_pay.rs | 2 + ...t_method_details_card_wallet_google_pay.rs | 2 + ...payment_method_details_card_wallet_link.rs | 2 + ...t_method_details_card_wallet_masterpass.rs | 19 + ..._method_details_card_wallet_samsung_pay.rs | 2 + ...ethod_details_card_wallet_visa_checkout.rs | 19 + .../src/payment_method_details_cashapp.rs | 7 + ...payment_method_details_customer_balance.rs | 2 + .../src/payment_method_details_eps.rs | 146 + .../src/payment_method_details_fpx.rs | 183 + .../src/payment_method_details_giropay.rs | 13 + .../src/payment_method_details_grabpay.rs | 5 + .../src/payment_method_details_ideal.rs | 219 + .../payment_method_details_interac_present.rs | 119 + ..._method_details_interac_present_receipt.rs | 82 + .../src/payment_method_details_klarna.rs | 9 + .../src/payment_method_details_konbini.rs | 5 + .../payment_method_details_konbini_store.rs | 66 + .../src/payment_method_details_link.rs | 6 + .../src/payment_method_details_multibanco.rs | 7 + .../src/payment_method_details_oxxo.rs | 5 + .../src/payment_method_details_p24.rs | 142 + .../src/payment_method_details_paynow.rs | 5 + .../src/payment_method_details_paypal.rs | 15 + .../src/payment_method_details_pix.rs | 6 + .../src/payment_method_details_promptpay.rs | 5 + .../src/payment_method_details_revolut_pay.rs | 2 + ...ent_method_details_sepa_credit_transfer.rs | 9 + .../src/payment_method_details_sepa_debit.rs | 17 + .../src/payment_method_details_sofort.rs | 96 + .../payment_method_details_stripe_account.rs | 2 + .../src/payment_method_details_swish.rs | 10 + .../payment_method_details_us_bank_account.rs | 130 + .../src/payment_method_details_wechat.rs | 2 + .../src/payment_method_details_wechat_pay.rs | 8 + .../src/payment_method_details_zip.rs | 2 + .../stripe_shared/src/payment_method_eps.rs | 142 + .../stripe_shared/src/payment_method_fpx.rs | 181 + .../src/payment_method_giropay.rs | 2 + .../src/payment_method_grabpay.rs | 2 + .../stripe_shared/src/payment_method_ideal.rs | 210 + .../src/payment_method_interac_present.rs | 109 + .../src/payment_method_klarna.rs | 5 + .../src/payment_method_konbini.rs | 2 + .../stripe_shared/src/payment_method_link.rs | 8 + .../src/payment_method_options_affirm.rs | 126 + ...ayment_method_options_afterpay_clearpay.rs | 131 + .../src/payment_method_options_alipay.rs | 71 + .../src/payment_method_options_bacs_debit.rs | 76 + .../src/payment_method_options_bancontact.rs | 138 + .../src/payment_method_options_boleto.rs | 77 + ...ayment_method_options_card_installments.rs | 9 + ...ent_method_options_card_mandate_options.rs | 207 + .../payment_method_options_card_present.rs | 8 + .../src/payment_method_options_cashapp.rs | 131 + ...payment_method_options_customer_balance.rs | 130 + ..._options_customer_balance_bank_transfer.rs | 154 + ...ptions_customer_balance_eu_bank_account.rs | 76 + .../src/payment_method_options_fpx.rs | 68 + .../src/payment_method_options_giropay.rs | 70 + .../src/payment_method_options_grabpay.rs | 70 + .../src/payment_method_options_ideal.rs | 71 + .../payment_method_options_interac_present.rs | 2 + .../src/payment_method_options_klarna.rs | 125 + .../src/payment_method_options_konbini.rs | 80 + .../src/payment_method_options_oxxo.rs | 71 + .../src/payment_method_options_p24.rs | 68 + .../src/payment_method_options_paynow.rs | 68 + .../src/payment_method_options_paypal.rs | 131 + .../src/payment_method_options_pix.rs | 72 + .../src/payment_method_options_promptpay.rs | 70 + .../src/payment_method_options_revolut_pay.rs | 2 + .../src/payment_method_options_sofort.rs | 145 + ...options_us_bank_account_mandate_options.rs | 62 + .../src/payment_method_options_wechat_pay.rs | 132 + .../src/payment_method_options_zip.rs | 68 + .../stripe_shared/src/payment_method_oxxo.rs | 2 + .../stripe_shared/src/payment_method_p24.rs | 134 + .../src/payment_method_paynow.rs | 2 + .../src/payment_method_paypal.rs | 8 + .../stripe_shared/src/payment_method_pix.rs | 2 + .../src/payment_method_promptpay.rs | 2 + .../src/payment_method_revolut_pay.rs | 2 + .../src/payment_method_sepa_debit.rs | 16 + .../src/payment_method_sofort.rs | 5 + .../stripe_shared/src/payment_method_swish.rs | 2 + .../src/payment_method_us_bank_account.rs | 134 + .../payment_method_us_bank_account_blocked.rs | 161 + ...t_method_us_bank_account_status_details.rs | 5 + .../src/payment_method_wechat_pay.rs | 2 + .../stripe_shared/src/payment_method_zip.rs | 2 + generated/stripe_shared/src/payment_source.rs | 24 + generated/stripe_shared/src/payout.rs | 185 + .../src/paypal_seller_protection.rs | 119 + generated/stripe_shared/src/period.rs | 7 + generated/stripe_shared/src/person.rs | 157 + .../src/person_additional_tos_acceptance.rs | 9 + .../src/person_additional_tos_acceptances.rs | 4 + .../src/person_future_requirements.rs | 21 + .../stripe_shared/src/person_relationship.rs | 21 + .../stripe_shared/src/person_requirements.rs | 20 + generated/stripe_shared/src/plan.rs | 355 + generated/stripe_shared/src/plan_tier.rs | 13 + .../stripe_shared/src/platform_tax_fee.rs | 19 + generated/stripe_shared/src/price.rs | 294 + generated/stripe_shared/src/price_tier.rs | 13 + generated/stripe_shared/src/product.rs | 118 + .../stripe_shared/src/product_feature.rs | 6 + generated/stripe_shared/src/promotion_code.rs | 40 + .../src/promotion_code_currency_option.rs | 5 + .../promotion_codes_resource_restrictions.rs | 18 + generated/stripe_shared/src/quote.rs | 204 + .../src/quotes_resource_automatic_tax.rs | 69 + .../src/quotes_resource_computed.rs | 8 + .../src/quotes_resource_from_quote.rs | 7 + .../src/quotes_resource_recurring.rs | 74 + .../src/quotes_resource_status_transitions.rs | 9 + ...rce_subscription_data_subscription_data.rs | 18 + .../src/quotes_resource_total_details.rs | 11 + ...source_total_details_resource_breakdown.rs | 7 + .../src/quotes_resource_transfer_data.rs | 12 + .../src/quotes_resource_upfront.rs | 12 + .../stripe_shared/src}/radar_radar_options.rs | 11 +- .../src/radar_review_resource_location.rs | 13 + .../src/radar_review_resource_session.rs | 11 + generated/stripe_shared/src/recurring.rs | 196 + generated/stripe_shared/src/refund.rs | 127 + .../src/refund_destination_details.rs | 64 + .../src/refund_destination_details_card.rs | 73 + .../src/refund_destination_details_generic.rs | 7 + .../stripe_shared/src/refund_next_action.rs | 8 + .../src/refund_next_action_display_details.rs | 6 + .../stripe_shared/src/reserve_transaction.rs | 18 + generated/stripe_shared/src/review.rs | 164 + generated/stripe_shared/src/rule.rs | 16 + .../src/schedules_phase_automatic_tax.rs | 9 + .../src/sepa_debit_generated_from.rs | 7 + generated/stripe_shared/src/setup_attempt.rs | 109 + .../setup_attempt_payment_method_details.rs | 38 + ...tempt_payment_method_details_acss_debit.rs | 2 + ...pt_payment_method_details_au_becs_debit.rs | 2 + ...tempt_payment_method_details_bacs_debit.rs | 2 + ...tempt_payment_method_details_bancontact.rs | 85 + ...p_attempt_payment_method_details_boleto.rs | 2 + ...tup_attempt_payment_method_details_card.rs | 45 + ...empt_payment_method_details_card_checks.rs | 9 + ...mpt_payment_method_details_card_present.rs | 5 + ...empt_payment_method_details_card_wallet.rs | 74 + ..._attempt_payment_method_details_cashapp.rs | 2 + ...up_attempt_payment_method_details_ideal.rs | 219 + ...p_attempt_payment_method_details_klarna.rs | 2 + ...tup_attempt_payment_method_details_link.rs | 2 + ...p_attempt_payment_method_details_paypal.rs | 2 + ...tempt_payment_method_details_sepa_debit.rs | 2 + ...p_attempt_payment_method_details_sofort.rs | 85 + ..._payment_method_details_us_bank_account.rs | 2 + generated/stripe_shared/src/setup_intent.rs | 279 + .../src/setup_intent_next_action.rs | 18 + ...etup_intent_next_action_redirect_to_url.rs | 7 + ...t_next_action_verify_with_microdeposits.rs | 68 + .../setup_intent_payment_method_options.rs | 15 + ...ntent_payment_method_options_acss_debit.rs | 128 + ...etup_intent_payment_method_options_card.rs | 161 + ...ent_method_options_card_mandate_options.rs | 213 + ...etup_intent_payment_method_options_link.rs | 5 + ...thod_options_mandate_options_acss_debit.rs | 186 + ...thod_options_mandate_options_sepa_debit.rs | 2 + ...up_intent_payment_method_options_paypal.rs | 6 + ...ntent_payment_method_options_sepa_debit.rs | 6 + ..._payment_method_options_us_bank_account.rs | 72 + .../stripe_shared/src}/shipping.rs | 18 +- generated/stripe_shared/src/shipping_rate.rs | 149 + .../src/shipping_rate_currency_option.rs | 67 + .../src/shipping_rate_delivery_estimate.rs | 7 + .../shipping_rate_delivery_estimate_bound.rs | 71 + .../src/shipping_rate_fixed_amount.rs | 17 + generated/stripe_shared/src/source.rs | 224 + .../src/source_code_verification_flow.rs | 7 + generated/stripe_shared/src/source_order.rs | 15 + .../stripe_shared/src/source_order_item.rs | 19 + generated/stripe_shared/src/source_owner.rs | 27 + .../stripe_shared/src/source_receiver_flow.rs | 22 + .../stripe_shared/src/source_redirect_flow.rs | 12 + .../stripe_shared/src/source_transaction.rs | 141 + ...ce_transaction_ach_credit_transfer_data.rs | 15 + ...ce_transaction_chf_credit_transfer_data.rs | 18 + ...ce_transaction_gbp_credit_transfer_data.rs | 26 + .../source_transaction_paper_check_data.rs | 10 + ...e_transaction_sepa_credit_transfer_data.rs | 12 + .../src/source_type_ach_credit_transfer.rs | 19 + .../src/source_type_ach_debit.rs | 16 + .../src/source_type_acss_debit.rs | 23 + .../stripe_shared/src/source_type_alipay.rs | 9 + .../src/source_type_au_becs_debit.rs | 9 + .../src/source_type_bancontact.rs | 15 + .../stripe_shared/src/source_type_card.rs | 37 + .../src/source_type_card_present.rs | 55 + .../stripe_shared/src/source_type_eps.rs | 7 + .../stripe_shared/src/source_type_giropay.rs | 11 + .../stripe_shared/src/source_type_ideal.rs | 11 + .../stripe_shared/src/source_type_klarna.rs | 55 + .../src/source_type_multibanco.rs | 23 + .../stripe_shared/src/source_type_p24.rs | 5 + .../src/source_type_sepa_credit_transfer.rs | 25 + .../src/source_type_sepa_debit.rs | 17 + .../stripe_shared/src/source_type_sofort.rs | 17 + .../src/source_type_three_d_secure.rs | 43 + .../stripe_shared/src/source_type_wechat.rs | 9 + generated/stripe_shared/src/subscription.rs | 290 + .../src/subscription_automatic_tax.rs | 9 + .../src}/subscription_billing_thresholds.rs | 13 +- .../src/subscription_details_data.rs | 6 + .../stripe_shared/src/subscription_item.rs | 33 + .../subscription_item_billing_thresholds.rs | 5 + ...ubscription_payment_method_options_card.rs | 161 + ...scription_pending_invoice_item_interval.rs | 72 + .../src/subscription_schedule.rs | 179 + .../subscription_schedule_add_invoice_item.rs | 11 + ...ubscription_schedule_configuration_item.rs | 20 + .../subscription_schedule_current_phase.rs | 7 + ...bscription_schedule_phase_configuration.rs | 239 + ...ion_schedules_resource_default_settings.rs | 153 + ...resource_default_settings_automatic_tax.rs | 9 + .../src}/subscription_transfer_data.rs | 16 +- ...ns_resource_billing_cycle_anchor_config.rs | 13 + ...subscriptions_resource_pause_collection.rs | 71 + ...iptions_resource_payment_method_options.rs | 15 + ...subscriptions_resource_payment_settings.rs | 201 + .../subscriptions_resource_pending_update.rs | 19 + ...scriptions_trials_resource_end_behavior.rs | 66 + ...riptions_trials_resource_trial_settings.rs | 5 + generated/stripe_shared/src/tax_code.rs | 19 + .../src/tax_deducted_at_source.rs | 20 + generated/stripe_shared/src/tax_i_ds_owner.rs | 75 + generated/stripe_shared/src/tax_id.rs | 286 + .../stripe_shared/src/tax_id_verification.rs | 69 + generated/stripe_shared/src/tax_rate.rs | 212 + .../src/test_helpers_test_clock.rs | 86 + .../src/three_d_secure_details.rs | 336 + .../src/three_d_secure_details_charge.rs | 403 + .../stripe_shared/src/three_d_secure_usage.rs | 5 + generated/stripe_shared/src/topup.rs | 116 + generated/stripe_shared/src/transfer.rs | 62 + generated/stripe_shared/src/transfer_data.rs | 13 + .../stripe_shared/src/transfer_reversal.rs | 45 + .../stripe_shared/src/transfer_schedule.rs | 17 + .../stripe_shared/src/transform_quantity.rs | 61 + .../stripe_shared/src/transform_usage.rs | 61 + .../src/us_bank_account_networks.rs | 62 + .../stripe_shared/src/usage_record_summary.rs | 21 + generated/stripe_shared/src/version.rs | 1 + generated/stripe_terminal/Cargo.toml | 52 + .../src/deleted_terminal_configuration.rs | 13 + .../src/deleted_terminal_location.rs | 13 + .../src/deleted_terminal_reader.rs | 13 + generated/stripe_terminal/src/mod.rs | 85 + .../src/terminal_configuration/mod.rs | 5 + .../src/terminal_configuration/requests.rs | 291 + .../src/terminal_configuration/types.rs | 29 + ...ation_resource_currency_specific_config.rs | 12 + ...on_resource_device_type_specific_config.rs | 6 + ...n_configuration_resource_offline_config.rs | 6 + ...guration_configuration_resource_tipping.rs | 45 + .../src/terminal_connection_token/mod.rs | 5 + .../src/terminal_connection_token/requests.rs | 27 + .../src/terminal_connection_token/types.rs | 15 + .../src/terminal_location/mod.rs | 5 + .../src/terminal_location/requests.rs | 217 + .../src/terminal_location/types.rs | 28 + .../src/terminal_reader/mod.rs | 5 + .../src/terminal_reader/requests.rs | 554 + .../src/terminal_reader/types.rs | 156 + .../terminal_reader_reader_resource_cart.rs | 15 + ...rminal_reader_reader_resource_line_item.rs | 11 + ...l_reader_reader_resource_process_config.rs | 9 + ..._resource_process_payment_intent_action.rs | 8 + ...er_reader_resource_process_setup_config.rs | 3 + ...er_resource_process_setup_intent_action.rs | 12 + ...al_reader_reader_resource_reader_action.rs | 147 + ...r_reader_resource_refund_payment_action.rs | 94 + ...ader_resource_set_reader_display_action.rs | 63 + ...l_reader_reader_resource_tipping_config.rs | 8 + generated/stripe_treasury/Cargo.toml | 64 + .../stripe_treasury/src/inbound_transfers.rs | 61 + ..._payment_method_details_us_bank_account.rs | 185 + generated/stripe_treasury/src/mod.rs | 209 + ...utbound_payments_payment_method_details.rs | 67 + ...ayment_method_details_financial_account.rs | 61 + ..._payment_method_details_us_bank_account.rs | 188 + ...tbound_transfers_payment_method_details.rs | 62 + ..._payment_method_details_us_bank_account.rs | 190 + ...ayment_method_details_financial_account.rs | 61 + .../src/treasury_credit_reversal/mod.rs | 5 + .../src/treasury_credit_reversal/requests.rs | 104 + .../src/treasury_credit_reversal/types.rs | 150 + .../src/treasury_debit_reversal/mod.rs | 5 + .../src/treasury_debit_reversal/requests.rs | 203 + .../src/treasury_debit_reversal/types.rs | 153 + .../src/treasury_financial_account/mod.rs | 5 + .../treasury_financial_account/requests.rs | 951 + .../src/treasury_financial_account/types.rs | 181 + .../treasury_financial_account_features.rs | 24 + ..._financial_accounts_resource_aba_record.rs | 14 + ...l_accounts_resource_aba_toggle_settings.rs | 71 + ...l_accounts_resource_ach_toggle_settings.rs | 71 + ...ury_financial_accounts_resource_balance.rs | 10 + ...accounts_resource_closed_status_details.rs | 65 + ...ial_accounts_resource_financial_address.rs | 122 + ...s_resource_financial_addresses_features.rs | 6 + ...ial_accounts_resource_inbound_transfers.rs | 6 + ...ial_accounts_resource_outbound_payments.rs | 8 + ...al_accounts_resource_outbound_transfers.rs | 8 + ...accounts_resource_platform_restrictions.rs | 118 + ...ancial_accounts_resource_status_details.rs | 5 + ...ncial_accounts_resource_toggle_settings.rs | 71 + ...resource_toggles_setting_status_details.rs | 201 + .../src/treasury_inbound_transfer/mod.rs | 5 + .../src/treasury_inbound_transfer/requests.rs | 328 + .../src/treasury_inbound_transfer/types.rs | 116 + ...ound_transfers_resource_failure_details.rs | 96 + ..._inbound_transfer_resource_linked_flows.rs | 5 + ...nd_transfer_resource_status_transitions.rs | 10 + .../src/treasury_outbound_payment/mod.rs | 5 + .../src/treasury_outbound_payment/requests.rs | 706 + .../src/treasury_outbound_payment/types.rs | 127 + ...bound_payment_resource_end_user_details.rs | 11 + ...und_payment_resource_status_transitions.rs | 11 + ...bound_payments_resource_returned_status.rs | 88 + .../src/treasury_outbound_transfer/mod.rs | 5 + .../treasury_outbound_transfer/requests.rs | 398 + .../src/treasury_outbound_transfer/types.rs | 118 + ...und_transfers_resource_returned_details.rs | 88 + ...d_transfers_resource_status_transitions.rs | 11 + .../src/treasury_received_credit/mod.rs | 5 + .../src/treasury_received_credit/requests.rs | 312 + .../src/treasury_received_credit/types.rs | 218 + ..._received_credits_resource_linked_flows.rs | 18 + ...eived_credits_resource_reversal_details.rs | 75 + ...d_credits_resource_source_flows_details.rs | 75 + ...ved_credits_resource_status_transitions.rs | 5 + .../src/treasury_received_debit/mod.rs | 5 + .../src/treasury_received_debit/requests.rs | 242 + .../src/treasury_received_debit/types.rs | 218 + ...ts_resource_debit_reversal_linked_flows.rs | 5 + ...y_received_debits_resource_linked_flows.rs | 11 + ...ceived_debits_resource_reversal_details.rs | 75 + ...ived_debits_resource_status_transitions.rs | 5 + ...reasury_shared_resource_billing_details.rs | 8 + ...tails_initiating_payment_method_details.rs | 156 + ..._payment_method_details_us_bank_account.rs | 9 + .../src/treasury_transaction/mod.rs | 5 + .../src/treasury_transaction/requests.rs | 145 + .../src/treasury_transaction/types.rs | 171 + .../src/treasury_transaction_entry/mod.rs | 5 + .../treasury_transaction_entry/requests.rs | 130 + .../src/treasury_transaction_entry/types.rs | 223 + ...transaction_resource_status_transitions.rs | 7 + ...ry_transactions_resource_balance_impact.rs | 13 +- ...sury_transactions_resource_flow_details.rs | 100 + keys.json | 619 - openapi/.gitignore | 2 + openapi/Cargo.toml | 19 +- openapi/README.md | 72 + openapi/doc_urls.json | 84 + openapi/gen_crates.toml | 151 + openapi/id_prefixes.json | 96 + openapi/main.c | 7 - openapi/out.log | 189 - openapi/src/codegen.rs | 1762 +- openapi/src/components.rs | 366 + openapi/src/crate_inference.rs | 227 + openapi/src/crate_table.rs | 47 + openapi/src/crates.rs | 107 + openapi/src/deduplication.rs | 188 + openapi/src/file_generator.rs | 246 - openapi/src/graph.rs | 60 + openapi/src/ids.rs | 46 + openapi/src/lib.rs | 26 + openapi/src/main.rs | 143 +- openapi/src/mappings.rs | 547 - openapi/src/metadata.rs | 318 - openapi/src/object_writing.rs | 123 + openapi/src/overrides.rs | 78 + openapi/src/printable.rs | 213 + openapi/src/requests.rs | 335 + openapi/src/rust_object.rs | 264 + openapi/src/rust_type.rs | 467 + openapi/src/spec.rs | 128 +- openapi/src/spec_fetch.rs | 4 +- openapi/src/spec_inference.rs | 481 + openapi/src/stripe_object.rs | 351 + openapi/src/templates/cargo_toml.rs | 109 + openapi/src/templates/derives.rs | 42 + openapi/src/templates/enums.rs | 189 + openapi/src/templates/mod.rs | 10 + openapi/src/templates/object_trait.rs | 50 + openapi/src/templates/object_writer.rs | 96 + openapi/src/templates/requests.rs | 127 + openapi/src/templates/structs.rs | 98 + openapi/src/templates/utils.rs | 116 + openapi/src/types.rs | 124 +- openapi/src/url_finder.rs | 134 +- openapi/src/util.rs | 133 - openapi/src/utils.rs | 50 + openapi/src/visitor.rs | 63 + openapi/src/webhook.rs | 144 + openapi/test | Bin 24752 -> 0 bytes out.diff | 32200 ------------ out.log | 236 - src/error.rs | 217 - src/ids.rs | 758 - src/params.rs | 920 - src/resources.rs | 369 - src/resources/account_ext.rs | 15 - src/resources/balance_ext.rs | 15 - src/resources/balance_transaction_ext.rs | 159 - src/resources/bank_account_ext.rs | 36 - src/resources/card.rs | 55 - src/resources/charge_ext.rs | 80 - src/resources/checkout_session_ext.rs | 24 - src/resources/credit_note_ext.rs | 12 - .../customer_balance_transaction_ext.rs | 137 - src/resources/customer_ext.rs | 183 - src/resources/generated.rs | 172 - src/resources/generated/account.rs | 4635 -- .../account_application_authorized.rs | 10 - .../account_application_deauthorized.rs | 10 - .../account_external_account_created.rs | 10 - .../account_external_account_deleted.rs | 10 - .../account_external_account_updated.rs | 10 - src/resources/generated/account_link.rs | 243 - src/resources/generated/account_session.rs | 291 - src/resources/generated/account_updated.rs | 10 - src/resources/generated/api_errors.rs | 507 - src/resources/generated/apple_pay_domain.rs | 41 - src/resources/generated/application.rs | 32 - src/resources/generated/application_fee.rs | 150 - .../generated/application_fee_created.rs | 10 - .../application_fee_refund_updated.rs | 10 - .../generated/application_fee_refunded.rs | 10 - src/resources/generated/apps_secret.rs | 93 - src/resources/generated/balance.rs | 82 - src/resources/generated/balance_available.rs | 10 - .../generated/balance_transaction.rs | 323 - src/resources/generated/bank_account.rs | 392 - ...bank_connections_resource_accountholder.rs | 62 - src/resources/generated/billing_details.rs | 23 - .../generated/billing_portal_configuration.rs | 418 - .../billing_portal_configuration_created.rs | 10 - .../billing_portal_configuration_updated.rs | 10 - .../generated/billing_portal_session.rs | 729 - .../billing_portal_session_created.rs | 10 - src/resources/generated/capability.rs | 399 - src/resources/generated/capability_updated.rs | 10 - src/resources/generated/cash_balance.rs | 78 - .../generated/cash_balance_funds_available.rs | 10 - src/resources/generated/charge.rs | 3261 -- src/resources/generated/charge_captured.rs | 10 - .../generated/charge_dispute_closed.rs | 10 - .../generated/charge_dispute_created.rs | 10 - .../charge_dispute_funds_reinstated.rs | 10 - .../charge_dispute_funds_withdrawn.rs | 10 - .../generated/charge_dispute_updated.rs | 10 - src/resources/generated/charge_expired.rs | 10 - src/resources/generated/charge_failed.rs | 10 - src/resources/generated/charge_pending.rs | 10 - .../generated/charge_refund_updated.rs | 10 - src/resources/generated/charge_refunded.rs | 10 - src/resources/generated/charge_succeeded.rs | 10 - src/resources/generated/charge_updated.rs | 10 - src/resources/generated/checkout_session.rs | 9245 ---- .../checkout_session_async_payment_failed.rs | 10 - ...heckout_session_async_payment_succeeded.rs | 10 - .../generated/checkout_session_completed.rs | 10 - .../generated/checkout_session_expired.rs | 10 - src/resources/generated/climate_order.rs | 223 - .../generated/climate_order_canceled.rs | 10 - .../generated/climate_order_created.rs | 10 - .../generated/climate_order_delayed.rs | 10 - .../generated/climate_order_delivered.rs | 10 - .../climate_order_product_substituted.rs | 10 - src/resources/generated/climate_product.rs | 66 - .../generated/climate_product_created.rs | 10 - .../climate_product_pricing_updated.rs | 10 - src/resources/generated/climate_supplier.rs | 96 - .../generated/connect_account_reference.rs | 55 - .../generated/connect_collection_transfer.rs | 40 - src/resources/generated/country_spec.rs | 129 - src/resources/generated/coupon.rs | 391 - src/resources/generated/coupon_created.rs | 10 - src/resources/generated/coupon_deleted.rs | 10 - src/resources/generated/coupon_updated.rs | 10 - src/resources/generated/credit_note.rs | 634 - .../generated/credit_note_created.rs | 10 - .../generated/credit_note_line_item.rs | 197 - .../generated/credit_note_updated.rs | 10 - src/resources/generated/credit_note_voided.rs | 10 - src/resources/generated/customer.rs | 1299 - .../generated/customer_balance_transaction.rs | 127 - .../customer_cash_balance_transaction.rs | 321 - ...stomer_cash_balance_transaction_created.rs | 10 - src/resources/generated/customer_created.rs | 10 - src/resources/generated/customer_deleted.rs | 10 - .../generated/customer_discount_created.rs | 10 - .../generated/customer_discount_deleted.rs | 10 - .../generated/customer_discount_updated.rs | 10 - src/resources/generated/customer_session.rs | 131 - .../generated/customer_source_created.rs | 10 - .../generated/customer_source_deleted.rs | 10 - .../generated/customer_source_expiring.rs | 10 - .../generated/customer_source_updated.rs | 10 - .../customer_subscription_created.rs | 10 - .../customer_subscription_deleted.rs | 10 - .../generated/customer_subscription_paused.rs | 10 - ...mer_subscription_pending_update_applied.rs | 10 - ...mer_subscription_pending_update_expired.rs | 10 - .../customer_subscription_resumed.rs | 10 - .../customer_subscription_trial_will_end.rs | 10 - .../customer_subscription_updated.rs | 10 - .../generated/customer_tax_id_created.rs | 10 - .../generated/customer_tax_id_deleted.rs | 10 - .../generated/customer_tax_id_updated.rs | 10 - src/resources/generated/customer_updated.rs | 10 - src/resources/generated/dispute.rs | 380 - src/resources/generated/ephemeral_key.rs | 93 - src/resources/generated/event.rs | 160 - src/resources/generated/exchange_rate.rs | 91 - src/resources/generated/fee_refund.rs | 52 - src/resources/generated/file.rs | 192 - src/resources/generated/file_created.rs | 10 - src/resources/generated/file_link.rs | 208 - .../financial_connections_account.rs | 566 - .../financial_connections_account_created.rs | 10 - ...nancial_connections_account_deactivated.rs | 10 - ...ancial_connections_account_disconnected.rs | 10 - .../financial_connections_account_owner.rs | 42 - ...financial_connections_account_ownership.rs | 33 - ...nancial_connections_account_reactivated.rs | 10 - ...l_connections_account_refreshed_balance.rs | 10 - ...nections_account_refreshed_transactions.rs | 10 - .../financial_connections_session.rs | 325 - .../financial_connections_transaction.rs | 112 - .../generated/funding_instructions.rs | 326 - .../generated/identity_verification_report.rs | 625 - .../identity_verification_session.rs | 411 - .../identity_verification_session_canceled.rs | 10 - .../identity_verification_session_created.rs | 10 - ...dentity_verification_session_processing.rs | 10 - .../identity_verification_session_redacted.rs | 10 - ...ity_verification_session_requires_input.rs | 10 - .../identity_verification_session_verified.rs | 10 - src/resources/generated/invoice.rs | 2946 -- src/resources/generated/invoice_created.rs | 10 - src/resources/generated/invoice_deleted.rs | 10 - .../generated/invoice_finalization_failed.rs | 10 - src/resources/generated/invoice_finalized.rs | 10 - .../generated/invoice_marked_uncollectible.rs | 10 - src/resources/generated/invoice_paid.rs | 10 - .../invoice_payment_action_required.rs | 10 - .../generated/invoice_payment_failed.rs | 10 - ...voice_payment_method_options_acss_debit.rs | 98 - ...voice_payment_method_options_bancontact.rs | 50 - ...payment_method_options_customer_balance.rs | 122 - .../invoice_payment_method_options_konbini.rs | 9 - ..._payment_method_options_us_bank_account.rs | 145 - .../generated/invoice_payment_succeeded.rs | 10 - src/resources/generated/invoice_sent.rs | 10 - .../invoice_setting_rendering_options.rs | 12 - src/resources/generated/invoice_upcoming.rs | 10 - src/resources/generated/invoice_updated.rs | 10 - src/resources/generated/invoice_voided.rs | 10 - .../generated/invoiceitem_created.rs | 10 - .../generated/invoiceitem_deleted.rs | 10 - .../generated/invoices_shipping_cost.rs | 106 - .../generated/issuing_authorization.rs | 438 - .../issuing_authorization_amount_details.rs | 16 - .../issuing_authorization_created.rs | 10 - .../issuing_authorization_request.rs | 10 - .../issuing_authorization_updated.rs | 10 - src/resources/generated/issuing_card.rs | 1154 - .../generated/issuing_card_created.rs | 10 - .../generated/issuing_card_updated.rs | 10 - src/resources/generated/issuing_cardholder.rs | 1090 - .../generated/issuing_cardholder_created.rs | 10 - .../generated/issuing_cardholder_updated.rs | 10 - src/resources/generated/issuing_dispute.rs | 459 - .../generated/issuing_dispute_closed.rs | 10 - .../generated/issuing_dispute_created.rs | 10 - .../issuing_dispute_funds_reinstated.rs | 10 - .../generated/issuing_dispute_submitted.rs | 10 - .../generated/issuing_dispute_updated.rs | 10 - src/resources/generated/issuing_token.rs | 545 - .../generated/issuing_token_created.rs | 10 - .../generated/issuing_token_updated.rs | 10 - .../generated/issuing_transaction.rs | 285 - .../generated/issuing_transaction_created.rs | 10 - .../generated/issuing_transaction_updated.rs | 10 - src/resources/generated/item.rs | 151 - src/resources/generated/line_item.rs | 251 - .../linked_account_options_us_bank_account.rs | 96 - src/resources/generated/login_link.rs | 29 - src/resources/generated/mandate.rs | 540 - src/resources/generated/mandate_updated.rs | 10 - .../generated/notification_event_data.rs | 21 - src/resources/generated/payment_intent.rs | 14759 ------ ...ayment_intent_amount_capturable_updated.rs | 10 - .../generated/payment_intent_canceled.rs | 10 - .../generated/payment_intent_created.rs | 10 - ...happ_handle_redirect_or_display_qr_code.rs | 31 - .../payment_intent_partially_funded.rs | 10 - .../payment_intent_payment_failed.rs | 10 - .../generated/payment_intent_processing.rs | 10 - .../payment_intent_requires_action.rs | 10 - .../generated/payment_intent_succeeded.rs | 10 - src/resources/generated/payment_link.rs | 5397 -- .../generated/payment_link_created.rs | 10 - .../generated/payment_link_updated.rs | 10 - src/resources/generated/payment_method.rs | 2917 -- .../generated/payment_method_attached.rs | 10 - .../payment_method_automatically_updated.rs | 10 - .../payment_method_card_present_networks.rs | 15 - ...iz_payment_method_configuration_details.rs | 12 - .../generated/payment_method_configuration.rs | 4429 -- .../generated/payment_method_detached.rs | 10 - ...t_method_details_card_installments_plan.rs | 85 - ...nt_method_details_card_wallet_apple_pay.rs | 9 - ...t_method_details_card_wallet_google_pay.rs | 9 - .../generated/payment_method_domain.rs | 234 - ...ptions_customer_balance_eu_bank_account.rs | 62 - ...options_us_bank_account_mandate_options.rs | 45 - .../generated/payment_method_updated.rs | 10 - src/resources/generated/payout.rs | 445 - src/resources/generated/payout_canceled.rs | 10 - src/resources/generated/payout_created.rs | 10 - src/resources/generated/payout_failed.rs | 10 - src/resources/generated/payout_paid.rs | 10 - .../payout_reconciliation_completed.rs | 10 - src/resources/generated/payout_updated.rs | 10 - src/resources/generated/person.rs | 577 - src/resources/generated/person_created.rs | 10 - src/resources/generated/person_deleted.rs | 10 - src/resources/generated/person_updated.rs | 10 - src/resources/generated/placeholders.rs | 582 - src/resources/generated/plan.rs | 516 - src/resources/generated/plan_created.rs | 10 - src/resources/generated/plan_deleted.rs | 10 - src/resources/generated/plan_updated.rs | 10 - src/resources/generated/platform_tax_fee.rs | 35 - src/resources/generated/price.rs | 1460 - src/resources/generated/price_created.rs | 10 - src/resources/generated/price_deleted.rs | 10 - src/resources/generated/price_updated.rs | 10 - src/resources/generated/product_created.rs | 10 - src/resources/generated/product_deleted.rs | 10 - src/resources/generated/product_updated.rs | 10 - src/resources/generated/promotion_code.rs | 247 - .../generated/promotion_code_created.rs | 10 - .../generated/promotion_code_updated.rs | 10 - src/resources/generated/quote.rs | 516 - src/resources/generated/quote_accepted.rs | 10 - src/resources/generated/quote_canceled.rs | 10 - src/resources/generated/quote_created.rs | 10 - src/resources/generated/quote_finalized.rs | 10 - .../quotes_resource_total_details.rs | 116 - .../radar_early_fraud_warning_created.rs | 10 - .../radar_early_fraud_warning_updated.rs | 10 - src/resources/generated/radar_value_list.rs | 119 - .../generated/radar_value_list_item.rs | 52 - src/resources/generated/refund.rs | 605 - src/resources/generated/refund_created.rs | 10 - src/resources/generated/refund_updated.rs | 10 - .../generated/reporting_report_run.rs | 103 - .../generated/reporting_report_run_failed.rs | 10 - .../reporting_report_run_succeeded.rs | 10 - .../generated/reporting_report_type.rs | 57 - .../reporting_report_type_updated.rs | 10 - .../generated/reserve_transaction.rs | 38 - src/resources/generated/review.rs | 245 - src/resources/generated/review_closed.rs | 10 - src/resources/generated/review_opened.rs | 10 - .../generated/scheduled_query_run.rs | 63 - src/resources/generated/setup_attempt.rs | 937 - src/resources/generated/setup_intent.rs | 5580 -- .../generated/setup_intent_canceled.rs | 10 - .../generated/setup_intent_created.rs | 10 - .../generated/setup_intent_requires_action.rs | 10 - .../generated/setup_intent_setup_failed.rs | 10 - .../generated/setup_intent_succeeded.rs | 10 - src/resources/generated/shipping_rate.rs | 712 - .../sigma_scheduled_query_run_created.rs | 10 - src/resources/generated/source.rs | 1780 - src/resources/generated/source_canceled.rs | 10 - src/resources/generated/source_chargeable.rs | 10 - src/resources/generated/source_failed.rs | 10 - .../generated/source_mandate_notification.rs | 98 - .../source_refund_attributes_required.rs | 10 - src/resources/generated/source_transaction.rs | 237 - .../generated/source_transaction_created.rs | 10 - .../generated/source_transaction_updated.rs | 10 - src/resources/generated/subscription.rs | 3872 -- src/resources/generated/subscription_item.rs | 551 - .../subscription_item_billing_thresholds.rs | 12 - .../generated/subscription_schedule.rs | 1931 - .../subscription_schedule_aborted.rs | 10 - .../subscription_schedule_canceled.rs | 10 - .../subscription_schedule_completed.rs | 10 - .../subscription_schedule_created.rs | 10 - .../subscription_schedule_expiring.rs | 10 - .../subscription_schedule_released.rs | 10 - .../subscription_schedule_updated.rs | 10 - ...riptions_trials_resource_trial_settings.rs | 55 - src/resources/generated/tax_calculation.rs | 560 - .../generated/tax_calculation_line_item.rs | 364 - src/resources/generated/tax_code.rs | 93 - .../generated/tax_deducted_at_source.rs | 38 - src/resources/generated/tax_id.rs | 720 - .../tax_product_resource_customer_details.rs | 293 - src/resources/generated/tax_rate.rs | 415 - src/resources/generated/tax_rate_created.rs | 10 - src/resources/generated/tax_rate_updated.rs | 10 - src/resources/generated/tax_registration.rs | 535 - src/resources/generated/tax_settings.rs | 150 - .../generated/tax_settings_updated.rs | 10 - src/resources/generated/tax_transaction.rs | 423 - .../generated/tax_transaction_line_item.rs | 142 - .../generated/terminal_configuration.rs | 522 - .../generated/terminal_connection_token.rs | 66 - src/resources/generated/terminal_location.rs | 181 - src/resources/generated/terminal_reader.rs | 583 - .../terminal_reader_action_failed.rs | 10 - .../terminal_reader_action_succeeded.rs | 10 - .../generated/test_helpers_test_clock.rs | 91 - .../test_helpers_test_clock_advancing.rs | 10 - .../test_helpers_test_clock_created.rs | 10 - .../test_helpers_test_clock_deleted.rs | 10 - ...est_helpers_test_clock_internal_failure.rs | 10 - .../test_helpers_test_clock_ready.rs | 10 - src/resources/generated/token.rs | 526 - src/resources/generated/topup.rs | 283 - src/resources/generated/topup_canceled.rs | 10 - src/resources/generated/topup_created.rs | 10 - src/resources/generated/topup_failed.rs | 10 - src/resources/generated/topup_reversed.rs | 10 - src/resources/generated/topup_succeeded.rs | 10 - src/resources/generated/transfer.rs | 320 - src/resources/generated/transfer_created.rs | 10 - src/resources/generated/transfer_reversal.rs | 58 - src/resources/generated/transfer_reversed.rs | 10 - src/resources/generated/transfer_updated.rs | 10 - .../generated/treasury_credit_reversal.rs | 143 - .../treasury_credit_reversal_created.rs | 10 - .../treasury_credit_reversal_posted.rs | 10 - .../generated/treasury_debit_reversal.rs | 153 - .../treasury_debit_reversal_completed.rs | 10 - .../treasury_debit_reversal_created.rs | 10 - ...y_debit_reversal_initial_credit_granted.rs | 10 - .../generated/treasury_financial_account.rs | 518 - .../treasury_financial_account_closed.rs | 10 - .../treasury_financial_account_created.rs | 10 - .../treasury_financial_account_features.rs | 256 - ...nancial_account_features_status_updated.rs | 10 - ...l_accounts_resource_ach_toggle_settings.rs | 187 - ...ncial_accounts_resource_toggle_settings.rs | 187 - .../generated/treasury_inbound_transfer.rs | 389 - .../treasury_inbound_transfer_canceled.rs | 10 - .../treasury_inbound_transfer_created.rs | 10 - .../treasury_inbound_transfer_failed.rs | 10 - .../treasury_inbound_transfer_succeeded.rs | 10 - .../generated/treasury_outbound_payment.rs | 452 - .../treasury_outbound_payment_canceled.rs | 10 - .../treasury_outbound_payment_created.rs | 10 - ...d_payment_expected_arrival_date_updated.rs | 10 - .../treasury_outbound_payment_failed.rs | 10 - .../treasury_outbound_payment_posted.rs | 10 - .../treasury_outbound_payment_returned.rs | 10 - .../generated/treasury_outbound_transfer.rs | 380 - .../treasury_outbound_transfer_canceled.rs | 10 - .../treasury_outbound_transfer_created.rs | 10 - ..._transfer_expected_arrival_date_updated.rs | 10 - .../treasury_outbound_transfer_failed.rs | 10 - .../treasury_outbound_transfer_posted.rs | 10 - .../treasury_outbound_transfer_returned.rs | 10 - .../generated/treasury_received_credit.rs | 314 - .../treasury_received_credit_created.rs | 10 - .../treasury_received_credit_failed.rs | 10 - .../treasury_received_credit_succeeded.rs | 10 - .../generated/treasury_received_debit.rs | 251 - .../treasury_received_debit_created.rs | 10 - ...reasury_shared_resource_billing_details.rs | 19 - ...tails_initiating_payment_method_details.rs | 164 - .../generated/treasury_transaction.rs | 164 - .../generated/treasury_transaction_entry.rs | 180 - ...sury_transactions_resource_flow_details.rs | 89 - src/resources/generated/usage_record.rs | 39 - .../generated/usage_record_summary.rs | 52 - src/resources/generated/version.rs | 3 - src/resources/generated/webhook_endpoint.rs | 1030 - src/resources/invoice_ext.rs | 113 - src/resources/issuing_authorization_ext.rs | 93 - src/resources/issuing_card_ext.rs | 137 - src/resources/issuing_dispute_ext.rs | 69 - src/resources/issuing_merchant_data.rs | 331 - src/resources/issuing_transaction_ext.rs | 44 - src/resources/line_item_ext.rs | 46 - src/resources/login_links_ext.rs | 26 - src/resources/order_ext.rs | 34 - src/resources/payment_intent_ext.rs | 233 - src/resources/payment_method_ext.rs | 33 - src/resources/payment_source.rs | 111 - src/resources/payout_ext.rs | 42 - src/resources/placeholders.rs | 34 - src/resources/price_ext.rs | 29 - src/resources/product_ext.rs | 29 - src/resources/review_ext.rs | 44 - src/resources/setup_intent_ext.rs | 58 - src/resources/source_ext.rs | 147 - src/resources/subscription_ext.rs | 67 - src/resources/token_ext.rs | 40 - src/resources/transfer_reversal_ext.rs | 35 - src/resources/types.rs | 411 - src/resources/usage_record_ext.rs | 44 - src/resources/webhook_endpoint_ext.rs | 30 - src/resources/webhook_events.rs | 666 - stripe.json | 42430 ---------------- stripe_types/Cargo.toml | 20 + .../src}/currency.rs | 47 +- stripe_types/src/expandable.rs | 56 + stripe_types/src/ids.rs | 336 + stripe_types/src/lib.rs | 16 + stripe_types/src/pagination.rs | 187 + stripe_types/src/params.rs | 134 + stripe_webhook/Cargo.toml | 30 + stripe_webhook/src/error.rs | 16 + stripe_webhook/src/generated/mod.rs | 1227 + stripe_webhook/src/lib.rs | 14 + stripe_webhook/src/webhook.rs | 316 + tests/Cargo.toml | 35 + tests/account.rs | 17 - tests/charge.rs | 41 - tests/checkout.rs | 16 - tests/customer.rs | 32 - tests/mock/mod.rs | 14 - tests/plan_interval.rs | 44 - tests/subscription.rs | 43 - tests/subscription_item.rs | 21 - tests/tests/it/async_tests/mod.rs | 1 + tests/tests/it/async_tests/pagination.rs | 176 + tests/tests/it/blocking/account.rs | 33 + tests/tests/it/blocking/charge.rs | 15 + tests/tests/it/blocking/checkout.rs | 12 + tests/tests/it/blocking/customer.rs | 41 + tests/tests/it/blocking/invoice.rs | 61 + tests/tests/it/blocking/mod.rs | 13 + tests/tests/it/blocking/plan_interval.rs | 39 + tests/tests/it/blocking/price.rs | 26 + tests/tests/it/blocking/product.rs | 18 + tests/tests/it/blocking/promotion_code.rs | 15 + tests/tests/it/blocking/subscription.rs | 46 + tests/tests/it/blocking/subscription_item.rs | 22 + tests/tests/it/blocking/token.rs | 19 + tests/tests/it/blocking/transfer_reversal.rs | 17 + tests/{encoding.rs => tests/it/deser.rs} | 147 +- tests/tests/it/main.rs | 14 + tests/tests/it/mock.rs | 7 + tests/tests/it/pagination_utils.rs | 188 + tests/{ => tests/it}/price.rs | 6 +- 1694 files changed, 192475 insertions(+), 187479 deletions(-) delete mode 100644 Makefile.toml create mode 100644 async-stripe/Cargo.toml rename build.rs => async-stripe/build.rs (100%) rename {src => async-stripe/src}/client/base/async_std.rs (93%) rename {src => async-stripe/src}/client/base/tokio.rs (84%) rename {src => async-stripe/src}/client/base/tokio_blocking.rs (93%) create mode 100644 async-stripe/src/client/headers.rs rename {src => async-stripe/src}/client/mod.rs (91%) rename {src => async-stripe/src}/client/request_strategy.rs (100%) rename {src => async-stripe/src}/client/stripe.rs (83%) create mode 100644 async-stripe/src/error.rs rename {src => async-stripe/src}/lib.rs (83%) create mode 100644 async-stripe/src/pagination.rs create mode 100644 crate_info.md create mode 100644 examples/README.md delete mode 100644 examples/customer.rs create mode 100644 examples/endpoints/Cargo.toml create mode 100644 examples/endpoints/src/checkout.rs create mode 100644 examples/endpoints/src/connect.rs create mode 100644 examples/endpoints/src/customer.rs create mode 100644 examples/endpoints/src/main.rs create mode 100644 examples/endpoints/src/payment_intent.rs create mode 100644 examples/endpoints/src/payment_link.rs create mode 100644 examples/endpoints/src/strategy.rs create mode 100644 examples/endpoints/src/subscriptions.rs create mode 100644 examples/pagination/Cargo.toml create mode 100644 examples/pagination/src/main.rs delete mode 100644 examples/payment-intent.rs delete mode 100644 examples/payment-link.rs delete mode 100644 examples/strategy.rs delete mode 100644 examples/subscriptions.rs create mode 100644 examples/webhook-actix/Cargo.toml rename examples/{webhook-actix.rs => webhook-actix/src/main.rs} (71%) create mode 100644 examples/webhook-axum/Cargo.toml rename examples/{webhook-axum.rs => webhook-axum/src/main.rs} (74%) create mode 100644 examples/webhook-rocket/Cargo.toml rename examples/{webhook-rocket.rs => webhook-rocket/src/main.rs} (66%) create mode 100644 generated/stripe_billing/Cargo.toml create mode 100644 generated/stripe_billing/src/billing_portal_configuration/mod.rs create mode 100644 generated/stripe_billing/src/billing_portal_configuration/requests.rs create mode 100644 generated/stripe_billing/src/billing_portal_configuration/types.rs create mode 100644 generated/stripe_billing/src/billing_portal_session/mod.rs create mode 100644 generated/stripe_billing/src/billing_portal_session/requests.rs create mode 100644 generated/stripe_billing/src/billing_portal_session/types.rs create mode 100644 generated/stripe_billing/src/credit_note/mod.rs create mode 100644 generated/stripe_billing/src/credit_note/requests.rs create mode 100644 generated/stripe_billing/src/credit_note_line_item/mod.rs create mode 100644 generated/stripe_billing/src/credit_note_line_item/requests.rs create mode 100644 generated/stripe_billing/src/invoice/mod.rs create mode 100644 generated/stripe_billing/src/invoice/requests.rs create mode 100644 generated/stripe_billing/src/invoice_item/mod.rs rename src/resources/generated/invoiceitem.rs => generated/stripe_billing/src/invoice_item/requests.rs (51%) create mode 100644 generated/stripe_billing/src/invoice_line_item/mod.rs create mode 100644 generated/stripe_billing/src/invoice_line_item/requests.rs create mode 100644 generated/stripe_billing/src/mod.rs create mode 100644 generated/stripe_billing/src/plan/mod.rs create mode 100644 generated/stripe_billing/src/plan/requests.rs create mode 100644 generated/stripe_billing/src/portal_business_profile.rs create mode 100644 generated/stripe_billing/src/portal_customer_update.rs create mode 100644 generated/stripe_billing/src/portal_features.rs create mode 100644 generated/stripe_billing/src/portal_flows_after_completion_hosted_confirmation.rs create mode 100644 generated/stripe_billing/src/portal_flows_after_completion_redirect.rs create mode 100644 generated/stripe_billing/src/portal_flows_coupon_offer.rs create mode 100644 generated/stripe_billing/src/portal_flows_flow.rs create mode 100644 generated/stripe_billing/src/portal_flows_flow_after_completion.rs create mode 100644 generated/stripe_billing/src/portal_flows_flow_subscription_cancel.rs create mode 100644 generated/stripe_billing/src/portal_flows_flow_subscription_update.rs create mode 100644 generated/stripe_billing/src/portal_flows_flow_subscription_update_confirm.rs create mode 100644 generated/stripe_billing/src/portal_flows_retention.rs create mode 100644 generated/stripe_billing/src/portal_flows_subscription_update_confirm_discount.rs create mode 100644 generated/stripe_billing/src/portal_flows_subscription_update_confirm_item.rs create mode 100644 generated/stripe_billing/src/portal_invoice_list.rs create mode 100644 generated/stripe_billing/src/portal_login_page.rs create mode 100644 generated/stripe_billing/src/portal_payment_method_update.rs create mode 100644 generated/stripe_billing/src/portal_subscription_cancel.rs create mode 100644 generated/stripe_billing/src/portal_subscription_cancellation_reason.rs create mode 100644 generated/stripe_billing/src/portal_subscription_pause.rs create mode 100644 generated/stripe_billing/src/portal_subscription_update.rs create mode 100644 generated/stripe_billing/src/portal_subscription_update_product.rs create mode 100644 generated/stripe_billing/src/quote/mod.rs create mode 100644 generated/stripe_billing/src/quote/requests.rs create mode 100644 generated/stripe_billing/src/subscription/mod.rs create mode 100644 generated/stripe_billing/src/subscription/requests.rs create mode 100644 generated/stripe_billing/src/subscription_item/mod.rs create mode 100644 generated/stripe_billing/src/subscription_item/requests.rs create mode 100644 generated/stripe_billing/src/subscription_schedule/mod.rs create mode 100644 generated/stripe_billing/src/subscription_schedule/requests.rs create mode 100644 generated/stripe_billing/src/tax_id/mod.rs create mode 100644 generated/stripe_billing/src/tax_id/requests.rs create mode 100644 generated/stripe_billing/src/test_helpers_test_clock/mod.rs create mode 100644 generated/stripe_billing/src/test_helpers_test_clock/requests.rs create mode 100644 generated/stripe_billing/src/usage_record/mod.rs create mode 100644 generated/stripe_billing/src/usage_record/requests.rs create mode 100644 generated/stripe_billing/src/usage_record/types.rs create mode 100644 generated/stripe_billing/src/usage_record_summary/mod.rs create mode 100644 generated/stripe_billing/src/usage_record_summary/requests.rs create mode 100644 generated/stripe_checkout/Cargo.toml create mode 100644 generated/stripe_checkout/src/checkout_acss_debit_mandate_options.rs create mode 100644 generated/stripe_checkout/src/checkout_acss_debit_payment_method_options.rs create mode 100644 generated/stripe_checkout/src/checkout_affirm_payment_method_options.rs create mode 100644 generated/stripe_checkout/src/checkout_afterpay_clearpay_payment_method_options.rs create mode 100644 generated/stripe_checkout/src/checkout_alipay_payment_method_options.rs create mode 100644 generated/stripe_checkout/src/checkout_au_becs_debit_payment_method_options.rs create mode 100644 generated/stripe_checkout/src/checkout_bacs_debit_payment_method_options.rs create mode 100644 generated/stripe_checkout/src/checkout_bancontact_payment_method_options.rs create mode 100644 generated/stripe_checkout/src/checkout_boleto_payment_method_options.rs create mode 100644 generated/stripe_checkout/src/checkout_card_installments_options.rs create mode 100644 generated/stripe_checkout/src/checkout_card_payment_method_options.rs create mode 100644 generated/stripe_checkout/src/checkout_cashapp_payment_method_options.rs create mode 100644 generated/stripe_checkout/src/checkout_customer_balance_bank_transfer_payment_method_options.rs create mode 100644 generated/stripe_checkout/src/checkout_customer_balance_payment_method_options.rs create mode 100644 generated/stripe_checkout/src/checkout_eps_payment_method_options.rs create mode 100644 generated/stripe_checkout/src/checkout_fpx_payment_method_options.rs create mode 100644 generated/stripe_checkout/src/checkout_giropay_payment_method_options.rs create mode 100644 generated/stripe_checkout/src/checkout_grab_pay_payment_method_options.rs create mode 100644 generated/stripe_checkout/src/checkout_ideal_payment_method_options.rs create mode 100644 generated/stripe_checkout/src/checkout_klarna_payment_method_options.rs create mode 100644 generated/stripe_checkout/src/checkout_konbini_payment_method_options.rs create mode 100644 generated/stripe_checkout/src/checkout_link_payment_method_options.rs create mode 100644 generated/stripe_checkout/src/checkout_oxxo_payment_method_options.rs create mode 100644 generated/stripe_checkout/src/checkout_p24_payment_method_options.rs create mode 100644 generated/stripe_checkout/src/checkout_paynow_payment_method_options.rs create mode 100644 generated/stripe_checkout/src/checkout_paypal_payment_method_options.rs create mode 100644 generated/stripe_checkout/src/checkout_pix_payment_method_options.rs create mode 100644 generated/stripe_checkout/src/checkout_revolut_pay_payment_method_options.rs create mode 100644 generated/stripe_checkout/src/checkout_sepa_debit_payment_method_options.rs create mode 100644 generated/stripe_checkout/src/checkout_session/mod.rs create mode 100644 generated/stripe_checkout/src/checkout_session/requests.rs create mode 100644 generated/stripe_checkout/src/checkout_session/types.rs create mode 100644 generated/stripe_checkout/src/checkout_session_payment_method_options.rs create mode 100644 generated/stripe_checkout/src/checkout_sofort_payment_method_options.rs create mode 100644 generated/stripe_checkout/src/checkout_swish_payment_method_options.rs create mode 100644 generated/stripe_checkout/src/checkout_us_bank_account_payment_method_options.rs create mode 100644 generated/stripe_checkout/src/mod.rs create mode 100644 generated/stripe_checkout/src/payment_pages_checkout_session_after_expiration.rs create mode 100644 generated/stripe_checkout/src/payment_pages_checkout_session_after_expiration_recovery.rs create mode 100644 generated/stripe_checkout/src/payment_pages_checkout_session_automatic_tax.rs create mode 100644 generated/stripe_checkout/src/payment_pages_checkout_session_consent.rs create mode 100644 generated/stripe_checkout/src/payment_pages_checkout_session_consent_collection.rs create mode 100644 generated/stripe_checkout/src/payment_pages_checkout_session_currency_conversion.rs create mode 100644 generated/stripe_checkout/src/payment_pages_checkout_session_custom_fields.rs create mode 100644 generated/stripe_checkout/src/payment_pages_checkout_session_custom_fields_dropdown.rs create mode 100644 generated/stripe_checkout/src/payment_pages_checkout_session_custom_fields_label.rs create mode 100644 generated/stripe_checkout/src/payment_pages_checkout_session_custom_fields_numeric.rs create mode 100644 generated/stripe_checkout/src/payment_pages_checkout_session_custom_fields_option.rs create mode 100644 generated/stripe_checkout/src/payment_pages_checkout_session_custom_fields_text.rs create mode 100644 generated/stripe_checkout/src/payment_pages_checkout_session_custom_text.rs create mode 100644 generated/stripe_checkout/src/payment_pages_checkout_session_custom_text_position.rs create mode 100644 generated/stripe_checkout/src/payment_pages_checkout_session_customer_details.rs create mode 100644 generated/stripe_checkout/src/payment_pages_checkout_session_invoice_creation.rs create mode 100644 generated/stripe_checkout/src/payment_pages_checkout_session_invoice_settings.rs create mode 100644 generated/stripe_checkout/src/payment_pages_checkout_session_payment_method_reuse_agreement.rs create mode 100644 generated/stripe_checkout/src/payment_pages_checkout_session_phone_number_collection.rs create mode 100644 generated/stripe_checkout/src/payment_pages_checkout_session_shipping_address_collection.rs create mode 100644 generated/stripe_checkout/src/payment_pages_checkout_session_shipping_cost.rs create mode 100644 generated/stripe_checkout/src/payment_pages_checkout_session_shipping_option.rs create mode 100644 generated/stripe_checkout/src/payment_pages_checkout_session_tax_id.rs create mode 100644 generated/stripe_checkout/src/payment_pages_checkout_session_tax_id_collection.rs create mode 100644 generated/stripe_checkout/src/payment_pages_checkout_session_total_details.rs create mode 100644 generated/stripe_checkout/src/payment_pages_checkout_session_total_details_resource_breakdown.rs create mode 100644 generated/stripe_connect/Cargo.toml create mode 100644 generated/stripe_connect/src/account/mod.rs create mode 100644 generated/stripe_connect/src/account/requests.rs create mode 100644 generated/stripe_connect/src/account_link/mod.rs create mode 100644 generated/stripe_connect/src/account_link/requests.rs create mode 100644 generated/stripe_connect/src/account_link/types.rs create mode 100644 generated/stripe_connect/src/account_session/mod.rs create mode 100644 generated/stripe_connect/src/account_session/requests.rs create mode 100644 generated/stripe_connect/src/account_session/types.rs create mode 100644 generated/stripe_connect/src/application_fee/mod.rs create mode 100644 generated/stripe_connect/src/application_fee/requests.rs create mode 100644 generated/stripe_connect/src/application_fee_refund/mod.rs create mode 100644 generated/stripe_connect/src/application_fee_refund/requests.rs create mode 100644 generated/stripe_connect/src/apps_secret/mod.rs create mode 100644 generated/stripe_connect/src/apps_secret/requests.rs create mode 100644 generated/stripe_connect/src/apps_secret/types.rs create mode 100644 generated/stripe_connect/src/capability/mod.rs create mode 100644 generated/stripe_connect/src/capability/requests.rs create mode 100644 generated/stripe_connect/src/connect_embedded_account_session_create_components.rs create mode 100644 generated/stripe_connect/src/connect_embedded_base_config_claim.rs create mode 100644 generated/stripe_connect/src/connect_embedded_base_features.rs create mode 100644 generated/stripe_connect/src/connect_embedded_payments_config.rs create mode 100644 generated/stripe_connect/src/connect_embedded_payments_features.rs create mode 100644 generated/stripe_connect/src/connect_embedded_payouts_config.rs create mode 100644 generated/stripe_connect/src/connect_embedded_payouts_features.rs create mode 100644 generated/stripe_connect/src/country_spec/mod.rs create mode 100644 generated/stripe_connect/src/country_spec/requests.rs create mode 100644 generated/stripe_connect/src/country_spec/types.rs create mode 100644 generated/stripe_connect/src/country_spec_verification_field_details.rs create mode 100644 generated/stripe_connect/src/country_spec_verification_fields.rs create mode 100644 generated/stripe_connect/src/external_account/mod.rs create mode 100644 generated/stripe_connect/src/external_account/requests.rs create mode 100644 generated/stripe_connect/src/login_link/mod.rs create mode 100644 generated/stripe_connect/src/login_link/requests.rs create mode 100644 generated/stripe_connect/src/login_link/types.rs create mode 100644 generated/stripe_connect/src/mod.rs create mode 100644 generated/stripe_connect/src/person/mod.rs create mode 100644 generated/stripe_connect/src/person/requests.rs create mode 100644 generated/stripe_connect/src/secret_service_resource_scope.rs create mode 100644 generated/stripe_connect/src/topup/mod.rs create mode 100644 generated/stripe_connect/src/topup/requests.rs create mode 100644 generated/stripe_connect/src/transfer/mod.rs create mode 100644 generated/stripe_connect/src/transfer/requests.rs create mode 100644 generated/stripe_connect/src/transfer_reversal/mod.rs create mode 100644 generated/stripe_connect/src/transfer_reversal/requests.rs create mode 100644 generated/stripe_core/Cargo.toml create mode 100644 generated/stripe_core/src/balance/mod.rs create mode 100644 generated/stripe_core/src/balance/requests.rs create mode 100644 generated/stripe_core/src/balance/types.rs create mode 100644 generated/stripe_core/src/balance_amount.rs rename {src/resources/generated => generated/stripe_core/src}/balance_amount_by_source_type.rs (56%) create mode 100644 generated/stripe_core/src/balance_amount_net.rs create mode 100644 generated/stripe_core/src/balance_detail.rs create mode 100644 generated/stripe_core/src/balance_transaction/mod.rs create mode 100644 generated/stripe_core/src/balance_transaction/requests.rs create mode 100644 generated/stripe_core/src/cash_balance/mod.rs create mode 100644 generated/stripe_core/src/cash_balance/requests.rs create mode 100644 generated/stripe_core/src/charge/mod.rs create mode 100644 generated/stripe_core/src/charge/requests.rs create mode 100644 generated/stripe_core/src/customer/mod.rs create mode 100644 generated/stripe_core/src/customer/requests.rs create mode 100644 generated/stripe_core/src/customer_balance_transaction/mod.rs create mode 100644 generated/stripe_core/src/customer_balance_transaction/requests.rs create mode 100644 generated/stripe_core/src/customer_cash_balance_transaction/mod.rs create mode 100644 generated/stripe_core/src/customer_cash_balance_transaction/requests.rs create mode 100644 generated/stripe_core/src/customer_session/mod.rs create mode 100644 generated/stripe_core/src/customer_session/requests.rs create mode 100644 generated/stripe_core/src/customer_session/types.rs create mode 100644 generated/stripe_core/src/customer_session_resource_components.rs create mode 100644 generated/stripe_core/src/customer_session_resource_components_resource_buy_button.rs create mode 100644 generated/stripe_core/src/customer_session_resource_components_resource_pricing_table.rs create mode 100644 generated/stripe_core/src/dispute/mod.rs create mode 100644 generated/stripe_core/src/dispute/requests.rs create mode 100644 generated/stripe_core/src/event/mod.rs create mode 100644 generated/stripe_core/src/event/requests.rs create mode 100644 generated/stripe_core/src/file/mod.rs create mode 100644 generated/stripe_core/src/file/requests.rs create mode 100644 generated/stripe_core/src/file_link/mod.rs create mode 100644 generated/stripe_core/src/file_link/requests.rs create mode 100644 generated/stripe_core/src/mandate/mod.rs create mode 100644 generated/stripe_core/src/mandate/requests.rs create mode 100644 generated/stripe_core/src/mod.rs create mode 100644 generated/stripe_core/src/payment_intent/mod.rs create mode 100644 generated/stripe_core/src/payment_intent/requests.rs create mode 100644 generated/stripe_core/src/payment_source/mod.rs create mode 100644 generated/stripe_core/src/payment_source/requests.rs create mode 100644 generated/stripe_core/src/payout/mod.rs create mode 100644 generated/stripe_core/src/payout/requests.rs create mode 100644 generated/stripe_core/src/refund/mod.rs create mode 100644 generated/stripe_core/src/refund/requests.rs create mode 100644 generated/stripe_core/src/setup_attempt/mod.rs create mode 100644 generated/stripe_core/src/setup_attempt/requests.rs create mode 100644 generated/stripe_core/src/setup_intent/mod.rs create mode 100644 generated/stripe_core/src/setup_intent/requests.rs create mode 100644 generated/stripe_core/src/token/mod.rs create mode 100644 generated/stripe_core/src/token/requests.rs create mode 100644 generated/stripe_core/src/token/types.rs create mode 100644 generated/stripe_fraud/Cargo.toml create mode 100644 generated/stripe_fraud/src/deleted_radar_value_list.rs create mode 100644 generated/stripe_fraud/src/deleted_radar_value_list_item.rs create mode 100644 generated/stripe_fraud/src/mod.rs create mode 100644 generated/stripe_fraud/src/radar_early_fraud_warning/mod.rs create mode 100644 generated/stripe_fraud/src/radar_early_fraud_warning/requests.rs rename src/resources/generated/radar_early_fraud_warning.rs => generated/stripe_fraud/src/radar_early_fraud_warning/types.rs (50%) create mode 100644 generated/stripe_fraud/src/radar_value_list/mod.rs create mode 100644 generated/stripe_fraud/src/radar_value_list/requests.rs create mode 100644 generated/stripe_fraud/src/radar_value_list/types.rs create mode 100644 generated/stripe_fraud/src/radar_value_list_item/mod.rs create mode 100644 generated/stripe_fraud/src/radar_value_list_item/requests.rs create mode 100644 generated/stripe_fraud/src/radar_value_list_item/types.rs create mode 100644 generated/stripe_fraud/src/review/mod.rs create mode 100644 generated/stripe_fraud/src/review/requests.rs create mode 100644 generated/stripe_issuing/Cargo.toml create mode 100644 generated/stripe_issuing/src/issuing_authorization/mod.rs create mode 100644 generated/stripe_issuing/src/issuing_authorization/requests.rs create mode 100644 generated/stripe_issuing/src/issuing_card/mod.rs create mode 100644 generated/stripe_issuing/src/issuing_card/requests.rs create mode 100644 generated/stripe_issuing/src/issuing_cardholder/mod.rs create mode 100644 generated/stripe_issuing/src/issuing_cardholder/requests.rs create mode 100644 generated/stripe_issuing/src/issuing_dispute/mod.rs create mode 100644 generated/stripe_issuing/src/issuing_dispute/requests.rs create mode 100644 generated/stripe_issuing/src/issuing_token/mod.rs create mode 100644 generated/stripe_issuing/src/issuing_token/requests.rs create mode 100644 generated/stripe_issuing/src/issuing_transaction/mod.rs create mode 100644 generated/stripe_issuing/src/issuing_transaction/requests.rs create mode 100644 generated/stripe_issuing/src/mod.rs create mode 100644 generated/stripe_misc/Cargo.toml create mode 100644 generated/stripe_misc/src/apple_pay_domain/mod.rs create mode 100644 generated/stripe_misc/src/apple_pay_domain/requests.rs create mode 100644 generated/stripe_misc/src/apple_pay_domain/types.rs create mode 100644 generated/stripe_misc/src/bank_connections_resource_accountholder.rs create mode 100644 generated/stripe_misc/src/bank_connections_resource_balance.rs create mode 100644 generated/stripe_misc/src/bank_connections_resource_balance_api_resource_cash_balance.rs create mode 100644 generated/stripe_misc/src/bank_connections_resource_balance_api_resource_credit_balance.rs create mode 100644 generated/stripe_misc/src/bank_connections_resource_balance_refresh.rs create mode 100644 generated/stripe_misc/src/bank_connections_resource_link_account_session_filters.rs create mode 100644 generated/stripe_misc/src/bank_connections_resource_ownership_refresh.rs create mode 100644 generated/stripe_misc/src/bank_connections_resource_transaction_refresh.rs create mode 100644 generated/stripe_misc/src/bank_connections_resource_transaction_resource_status_transitions.rs create mode 100644 generated/stripe_misc/src/climate_order/mod.rs create mode 100644 generated/stripe_misc/src/climate_order/requests.rs create mode 100644 generated/stripe_misc/src/climate_order/types.rs create mode 100644 generated/stripe_misc/src/climate_product/mod.rs create mode 100644 generated/stripe_misc/src/climate_product/requests.rs create mode 100644 generated/stripe_misc/src/climate_product/types.rs create mode 100644 generated/stripe_misc/src/climate_removals_beneficiary.rs create mode 100644 generated/stripe_misc/src/climate_removals_location.rs create mode 100644 generated/stripe_misc/src/climate_removals_order_deliveries.rs create mode 100644 generated/stripe_misc/src/climate_removals_products_price.rs create mode 100644 generated/stripe_misc/src/climate_supplier/mod.rs create mode 100644 generated/stripe_misc/src/climate_supplier/requests.rs create mode 100644 generated/stripe_misc/src/climate_supplier/types.rs create mode 100644 generated/stripe_misc/src/deleted_apple_pay_domain.rs create mode 100644 generated/stripe_misc/src/deleted_webhook_endpoint.rs create mode 100644 generated/stripe_misc/src/ephemeral_key/mod.rs create mode 100644 generated/stripe_misc/src/ephemeral_key/requests.rs create mode 100644 generated/stripe_misc/src/ephemeral_key/types.rs create mode 100644 generated/stripe_misc/src/exchange_rate/mod.rs create mode 100644 generated/stripe_misc/src/exchange_rate/requests.rs create mode 100644 generated/stripe_misc/src/exchange_rate/types.rs create mode 100644 generated/stripe_misc/src/financial_connections_account/mod.rs create mode 100644 generated/stripe_misc/src/financial_connections_account/requests.rs create mode 100644 generated/stripe_misc/src/financial_connections_account/types.rs create mode 100644 generated/stripe_misc/src/financial_connections_account_owner.rs create mode 100644 generated/stripe_misc/src/financial_connections_account_ownership.rs create mode 100644 generated/stripe_misc/src/financial_connections_session/mod.rs create mode 100644 generated/stripe_misc/src/financial_connections_session/requests.rs create mode 100644 generated/stripe_misc/src/financial_connections_session/types.rs create mode 100644 generated/stripe_misc/src/financial_connections_transaction/mod.rs create mode 100644 generated/stripe_misc/src/financial_connections_transaction/requests.rs create mode 100644 generated/stripe_misc/src/financial_connections_transaction/types.rs create mode 100644 generated/stripe_misc/src/financial_reporting_finance_report_run_run_parameters.rs create mode 100644 generated/stripe_misc/src/gelato_data_document_report_date_of_birth.rs create mode 100644 generated/stripe_misc/src/gelato_data_document_report_expiration_date.rs create mode 100644 generated/stripe_misc/src/gelato_data_document_report_issued_date.rs create mode 100644 generated/stripe_misc/src/gelato_data_id_number_report_date.rs create mode 100644 generated/stripe_misc/src/gelato_data_verified_outputs_date.rs create mode 100644 generated/stripe_misc/src/gelato_document_report.rs create mode 100644 generated/stripe_misc/src/gelato_document_report_error.rs create mode 100644 generated/stripe_misc/src/gelato_id_number_report.rs create mode 100644 generated/stripe_misc/src/gelato_id_number_report_error.rs create mode 100644 generated/stripe_misc/src/gelato_report_document_options.rs create mode 100644 generated/stripe_misc/src/gelato_report_id_number_options.rs create mode 100644 generated/stripe_misc/src/gelato_selfie_report.rs create mode 100644 generated/stripe_misc/src/gelato_selfie_report_error.rs create mode 100644 generated/stripe_misc/src/gelato_session_document_options.rs create mode 100644 generated/stripe_misc/src/gelato_session_id_number_options.rs create mode 100644 generated/stripe_misc/src/gelato_session_last_error.rs create mode 100644 generated/stripe_misc/src/gelato_verification_report_options.rs create mode 100644 generated/stripe_misc/src/gelato_verification_session_options.rs create mode 100644 generated/stripe_misc/src/gelato_verified_outputs.rs create mode 100644 generated/stripe_misc/src/identity_verification_report/mod.rs create mode 100644 generated/stripe_misc/src/identity_verification_report/requests.rs create mode 100644 generated/stripe_misc/src/identity_verification_report/types.rs create mode 100644 generated/stripe_misc/src/identity_verification_session/mod.rs create mode 100644 generated/stripe_misc/src/identity_verification_session/requests.rs create mode 100644 generated/stripe_misc/src/identity_verification_session/types.rs create mode 100644 generated/stripe_misc/src/mod.rs create mode 100644 generated/stripe_misc/src/reporting_report_run/mod.rs create mode 100644 generated/stripe_misc/src/reporting_report_run/requests.rs create mode 100644 generated/stripe_misc/src/reporting_report_run/types.rs create mode 100644 generated/stripe_misc/src/reporting_report_type/mod.rs create mode 100644 generated/stripe_misc/src/reporting_report_type/requests.rs create mode 100644 generated/stripe_misc/src/reporting_report_type/types.rs create mode 100644 generated/stripe_misc/src/scheduled_query_run/mod.rs create mode 100644 generated/stripe_misc/src/scheduled_query_run/requests.rs create mode 100644 generated/stripe_misc/src/scheduled_query_run/types.rs create mode 100644 generated/stripe_misc/src/sigma_scheduled_query_run_error.rs create mode 100644 generated/stripe_misc/src/tax_calculation/mod.rs create mode 100644 generated/stripe_misc/src/tax_calculation/requests.rs create mode 100644 generated/stripe_misc/src/tax_calculation/types.rs create mode 100644 generated/stripe_misc/src/tax_calculation_line_item.rs create mode 100644 generated/stripe_misc/src/tax_product_registrations_resource_country_options.rs create mode 100644 generated/stripe_misc/src/tax_product_registrations_resource_country_options_ca_province_standard.rs create mode 100644 generated/stripe_misc/src/tax_product_registrations_resource_country_options_canada.rs create mode 100644 generated/stripe_misc/src/tax_product_registrations_resource_country_options_default.rs create mode 100644 generated/stripe_misc/src/tax_product_registrations_resource_country_options_eu_standard.rs create mode 100644 generated/stripe_misc/src/tax_product_registrations_resource_country_options_europe.rs create mode 100644 generated/stripe_misc/src/tax_product_registrations_resource_country_options_simplified.rs create mode 100644 generated/stripe_misc/src/tax_product_registrations_resource_country_options_united_states.rs create mode 100644 generated/stripe_misc/src/tax_product_registrations_resource_country_options_us_local_amusement_tax.rs create mode 100644 generated/stripe_misc/src/tax_product_registrations_resource_country_options_us_local_lease_tax.rs create mode 100644 generated/stripe_misc/src/tax_product_resource_customer_details.rs create mode 100644 generated/stripe_misc/src/tax_product_resource_customer_details_resource_tax_id.rs create mode 100644 generated/stripe_misc/src/tax_product_resource_jurisdiction.rs create mode 100644 generated/stripe_misc/src/tax_product_resource_line_item_tax_breakdown.rs create mode 100644 generated/stripe_misc/src/tax_product_resource_line_item_tax_rate_details.rs create mode 100644 generated/stripe_misc/src/tax_product_resource_postal_address.rs create mode 100644 generated/stripe_misc/src/tax_product_resource_tax_breakdown.rs create mode 100644 generated/stripe_misc/src/tax_product_resource_tax_calculation_shipping_cost.rs create mode 100644 generated/stripe_misc/src/tax_product_resource_tax_rate_details.rs create mode 100644 generated/stripe_misc/src/tax_product_resource_tax_settings_defaults.rs create mode 100644 generated/stripe_misc/src/tax_product_resource_tax_settings_head_office.rs create mode 100644 generated/stripe_misc/src/tax_product_resource_tax_settings_status_details.rs create mode 100644 generated/stripe_misc/src/tax_product_resource_tax_settings_status_details_resource_active.rs create mode 100644 generated/stripe_misc/src/tax_product_resource_tax_settings_status_details_resource_pending.rs create mode 100644 generated/stripe_misc/src/tax_product_resource_tax_transaction_line_item_resource_reversal.rs create mode 100644 generated/stripe_misc/src/tax_product_resource_tax_transaction_resource_reversal.rs create mode 100644 generated/stripe_misc/src/tax_product_resource_tax_transaction_shipping_cost.rs create mode 100644 generated/stripe_misc/src/tax_registration/mod.rs create mode 100644 generated/stripe_misc/src/tax_registration/requests.rs create mode 100644 generated/stripe_misc/src/tax_registration/types.rs create mode 100644 generated/stripe_misc/src/tax_settings/mod.rs create mode 100644 generated/stripe_misc/src/tax_settings/requests.rs create mode 100644 generated/stripe_misc/src/tax_settings/types.rs create mode 100644 generated/stripe_misc/src/tax_transaction/mod.rs create mode 100644 generated/stripe_misc/src/tax_transaction/requests.rs create mode 100644 generated/stripe_misc/src/tax_transaction/types.rs create mode 100644 generated/stripe_misc/src/tax_transaction_line_item.rs create mode 100644 generated/stripe_misc/src/verification_session_redaction.rs create mode 100644 generated/stripe_misc/src/webhook_endpoint/mod.rs create mode 100644 generated/stripe_misc/src/webhook_endpoint/requests.rs create mode 100644 generated/stripe_misc/src/webhook_endpoint/types.rs create mode 100644 generated/stripe_payment/Cargo.toml create mode 100644 generated/stripe_payment/src/bank_account/mod.rs create mode 100644 generated/stripe_payment/src/bank_account/requests.rs create mode 100644 generated/stripe_payment/src/card/mod.rs create mode 100644 generated/stripe_payment/src/card/requests.rs create mode 100644 generated/stripe_payment/src/mod.rs create mode 100644 generated/stripe_payment/src/payment_link/mod.rs create mode 100644 generated/stripe_payment/src/payment_link/requests.rs create mode 100644 generated/stripe_payment/src/payment_method/mod.rs create mode 100644 generated/stripe_payment/src/payment_method/requests.rs create mode 100644 generated/stripe_payment/src/payment_method_config_resource_display_preference.rs create mode 100644 generated/stripe_payment/src/payment_method_config_resource_payment_method_properties.rs create mode 100644 generated/stripe_payment/src/payment_method_configuration/mod.rs create mode 100644 generated/stripe_payment/src/payment_method_configuration/requests.rs create mode 100644 generated/stripe_payment/src/payment_method_configuration/types.rs create mode 100644 generated/stripe_payment/src/payment_method_domain/mod.rs create mode 100644 generated/stripe_payment/src/payment_method_domain/requests.rs create mode 100644 generated/stripe_payment/src/payment_method_domain/types.rs create mode 100644 generated/stripe_payment/src/payment_method_domain_resource_payment_method_status.rs create mode 100644 generated/stripe_payment/src/payment_method_domain_resource_payment_method_status_details.rs create mode 100644 generated/stripe_payment/src/source/mod.rs create mode 100644 generated/stripe_payment/src/source/requests.rs create mode 100644 generated/stripe_payment/src/source_mandate_notification.rs create mode 100644 generated/stripe_payment/src/source_mandate_notification_acss_debit_data.rs create mode 100644 generated/stripe_payment/src/source_mandate_notification_bacs_debit_data.rs create mode 100644 generated/stripe_payment/src/source_mandate_notification_sepa_debit_data.rs create mode 100644 generated/stripe_product/Cargo.toml create mode 100644 generated/stripe_product/src/coupon/mod.rs create mode 100644 generated/stripe_product/src/coupon/requests.rs create mode 100644 generated/stripe_product/src/mod.rs create mode 100644 generated/stripe_product/src/price/mod.rs create mode 100644 generated/stripe_product/src/price/requests.rs create mode 100644 generated/stripe_product/src/product/mod.rs rename src/resources/generated/product.rs => generated/stripe_product/src/product/requests.rs (55%) create mode 100644 generated/stripe_product/src/promotion_code/mod.rs create mode 100644 generated/stripe_product/src/promotion_code/requests.rs create mode 100644 generated/stripe_product/src/shipping_rate/mod.rs create mode 100644 generated/stripe_product/src/shipping_rate/requests.rs create mode 100644 generated/stripe_product/src/tax_code/mod.rs create mode 100644 generated/stripe_product/src/tax_code/requests.rs create mode 100644 generated/stripe_product/src/tax_rate/mod.rs create mode 100644 generated/stripe_product/src/tax_rate/requests.rs create mode 100644 generated/stripe_shared/Cargo.toml create mode 100644 generated/stripe_shared/src/account.rs create mode 100644 generated/stripe_shared/src/account_annual_revenue.rs create mode 100644 generated/stripe_shared/src/account_bacs_debit_payments_settings.rs create mode 100644 generated/stripe_shared/src/account_branding_settings.rs create mode 100644 generated/stripe_shared/src/account_business_profile.rs create mode 100644 generated/stripe_shared/src/account_capabilities.rs create mode 100644 generated/stripe_shared/src/account_capability_future_requirements.rs create mode 100644 generated/stripe_shared/src/account_capability_requirements.rs create mode 100644 generated/stripe_shared/src/account_card_issuing_settings.rs create mode 100644 generated/stripe_shared/src/account_card_payments_settings.rs create mode 100644 generated/stripe_shared/src/account_dashboard_settings.rs create mode 100644 generated/stripe_shared/src/account_decline_charge_on.rs create mode 100644 generated/stripe_shared/src/account_future_requirements.rs create mode 100644 generated/stripe_shared/src/account_invoices_settings.rs create mode 100644 generated/stripe_shared/src/account_monthly_estimated_revenue.rs create mode 100644 generated/stripe_shared/src/account_payments_settings.rs create mode 100644 generated/stripe_shared/src/account_payout_settings.rs create mode 100644 generated/stripe_shared/src/account_requirements.rs create mode 100644 generated/stripe_shared/src/account_requirements_alternative.rs create mode 100644 generated/stripe_shared/src/account_requirements_error.rs create mode 100644 generated/stripe_shared/src/account_sepa_debit_payments_settings.rs create mode 100644 generated/stripe_shared/src/account_settings.rs create mode 100644 generated/stripe_shared/src/account_terms_of_service.rs create mode 100644 generated/stripe_shared/src/account_tos_acceptance.rs create mode 100644 generated/stripe_shared/src/account_treasury_settings.rs create mode 100644 generated/stripe_shared/src/account_unification_account_controller.rs rename {src/resources/generated => generated/stripe_shared/src}/address.rs (67%) create mode 100644 generated/stripe_shared/src/api_errors.rs create mode 100644 generated/stripe_shared/src/api_version.rs create mode 100644 generated/stripe_shared/src/application.rs create mode 100644 generated/stripe_shared/src/application_fee.rs create mode 100644 generated/stripe_shared/src/application_fee_refund.rs create mode 100644 generated/stripe_shared/src/automatic_tax.rs create mode 100644 generated/stripe_shared/src/balance_transaction.rs create mode 100644 generated/stripe_shared/src/balance_transaction_source.rs create mode 100644 generated/stripe_shared/src/bank_account.rs create mode 100644 generated/stripe_shared/src/billing_details.rs create mode 100644 generated/stripe_shared/src/cancellation_details.rs create mode 100644 generated/stripe_shared/src/capability.rs rename {src/resources/generated => generated/stripe_shared/src}/card.rs (64%) create mode 100644 generated/stripe_shared/src/card_issuing_account_terms_of_service.rs create mode 100644 generated/stripe_shared/src/card_mandate_payment_method_details.rs create mode 100644 generated/stripe_shared/src/cash_balance.rs create mode 100644 generated/stripe_shared/src/charge.rs create mode 100644 generated/stripe_shared/src/charge_fraud_details.rs create mode 100644 generated/stripe_shared/src/charge_outcome.rs create mode 100644 generated/stripe_shared/src/charge_transfer_data.rs create mode 100644 generated/stripe_shared/src/checkout_session_item.rs create mode 100644 generated/stripe_shared/src/connect_account_reference.rs create mode 100644 generated/stripe_shared/src/connect_collection_transfer.rs create mode 100644 generated/stripe_shared/src/coupon.rs create mode 100644 generated/stripe_shared/src/coupon_applies_to.rs create mode 100644 generated/stripe_shared/src/coupon_currency_option.rs create mode 100644 generated/stripe_shared/src/credit_note.rs create mode 100644 generated/stripe_shared/src/credit_note_line_item.rs create mode 100644 generated/stripe_shared/src/credit_note_tax_amount.rs create mode 100644 generated/stripe_shared/src/currency_option.rs rename {src/resources/generated => generated/stripe_shared/src}/custom_unit_amount.rs (57%) create mode 100644 generated/stripe_shared/src/customer.rs create mode 100644 generated/stripe_shared/src/customer_acceptance.rs create mode 100644 generated/stripe_shared/src/customer_balance_customer_balance_settings.rs create mode 100644 generated/stripe_shared/src/customer_balance_resource_cash_balance_transaction_resource_adjusted_for_overdraft.rs create mode 100644 generated/stripe_shared/src/customer_balance_resource_cash_balance_transaction_resource_applied_to_payment_transaction.rs create mode 100644 generated/stripe_shared/src/customer_balance_resource_cash_balance_transaction_resource_funded_transaction.rs create mode 100644 generated/stripe_shared/src/customer_balance_resource_cash_balance_transaction_resource_funded_transaction_resource_bank_transfer.rs create mode 100644 generated/stripe_shared/src/customer_balance_resource_cash_balance_transaction_resource_funded_transaction_resource_bank_transfer_resource_eu_bank_transfer.rs create mode 100644 generated/stripe_shared/src/customer_balance_resource_cash_balance_transaction_resource_funded_transaction_resource_bank_transfer_resource_gb_bank_transfer.rs create mode 100644 generated/stripe_shared/src/customer_balance_resource_cash_balance_transaction_resource_funded_transaction_resource_bank_transfer_resource_jp_bank_transfer.rs create mode 100644 generated/stripe_shared/src/customer_balance_resource_cash_balance_transaction_resource_funded_transaction_resource_bank_transfer_resource_us_bank_transfer.rs create mode 100644 generated/stripe_shared/src/customer_balance_resource_cash_balance_transaction_resource_refunded_from_payment_transaction.rs create mode 100644 generated/stripe_shared/src/customer_balance_resource_cash_balance_transaction_resource_transferred_to_balance.rs create mode 100644 generated/stripe_shared/src/customer_balance_resource_cash_balance_transaction_resource_unapplied_from_payment_transaction.rs create mode 100644 generated/stripe_shared/src/customer_balance_transaction.rs create mode 100644 generated/stripe_shared/src/customer_cash_balance_transaction.rs create mode 100644 generated/stripe_shared/src/customer_tax.rs create mode 100644 generated/stripe_shared/src/customer_tax_location.rs create mode 100644 generated/stripe_shared/src/deleted_account.rs create mode 100644 generated/stripe_shared/src/deleted_bank_account.rs create mode 100644 generated/stripe_shared/src/deleted_card.rs create mode 100644 generated/stripe_shared/src/deleted_coupon.rs create mode 100644 generated/stripe_shared/src/deleted_customer.rs create mode 100644 generated/stripe_shared/src/deleted_discount.rs create mode 100644 generated/stripe_shared/src/deleted_external_account.rs create mode 100644 generated/stripe_shared/src/deleted_invoice.rs create mode 100644 generated/stripe_shared/src/deleted_invoiceitem.rs create mode 100644 generated/stripe_shared/src/deleted_payment_source.rs create mode 100644 generated/stripe_shared/src/deleted_person.rs create mode 100644 generated/stripe_shared/src/deleted_plan.rs create mode 100644 generated/stripe_shared/src/deleted_product.rs create mode 100644 generated/stripe_shared/src/deleted_subscription_item.rs create mode 100644 generated/stripe_shared/src/deleted_tax_id.rs create mode 100644 generated/stripe_shared/src/deleted_test_helpers_test_clock.rs create mode 100644 generated/stripe_shared/src/destination_details_unimplemented.rs rename {src/resources/generated => generated/stripe_shared/src}/discount.rs (55%) create mode 100644 generated/stripe_shared/src/discounts_resource_discount_amount.rs create mode 100644 generated/stripe_shared/src/dispute.rs create mode 100644 generated/stripe_shared/src/dispute_evidence.rs create mode 100644 generated/stripe_shared/src/dispute_evidence_details.rs create mode 100644 generated/stripe_shared/src/dispute_payment_method_details.rs create mode 100644 generated/stripe_shared/src/dispute_payment_method_details_card.rs create mode 100644 generated/stripe_shared/src/email_sent.rs create mode 100644 generated/stripe_shared/src/error.rs create mode 100644 generated/stripe_shared/src/event.rs create mode 100644 generated/stripe_shared/src/external_account.rs create mode 100644 generated/stripe_shared/src/external_account_requirements.rs create mode 100644 generated/stripe_shared/src/fee.rs create mode 100644 generated/stripe_shared/src/file.rs create mode 100644 generated/stripe_shared/src/file_link.rs create mode 100644 generated/stripe_shared/src/funding_instructions.rs create mode 100644 generated/stripe_shared/src/funding_instructions_bank_transfer.rs create mode 100644 generated/stripe_shared/src/funding_instructions_bank_transfer_aba_record.rs create mode 100644 generated/stripe_shared/src/funding_instructions_bank_transfer_financial_address.rs create mode 100644 generated/stripe_shared/src/funding_instructions_bank_transfer_iban_record.rs create mode 100644 generated/stripe_shared/src/funding_instructions_bank_transfer_sort_code_record.rs create mode 100644 generated/stripe_shared/src/funding_instructions_bank_transfer_spei_record.rs create mode 100644 generated/stripe_shared/src/funding_instructions_bank_transfer_swift_record.rs create mode 100644 generated/stripe_shared/src/funding_instructions_bank_transfer_zengin_record.rs create mode 100644 generated/stripe_shared/src/invoice.rs create mode 100644 generated/stripe_shared/src/invoice_installments_card.rs create mode 100644 generated/stripe_shared/src/invoice_item.rs create mode 100644 generated/stripe_shared/src/invoice_item_threshold_reason.rs create mode 100644 generated/stripe_shared/src/invoice_line_item.rs create mode 100644 generated/stripe_shared/src/invoice_line_item_period.rs create mode 100644 generated/stripe_shared/src/invoice_mandate_options_card.rs create mode 100644 generated/stripe_shared/src/invoice_payment_method_options_acss_debit.rs create mode 100644 generated/stripe_shared/src/invoice_payment_method_options_acss_debit_mandate_options.rs create mode 100644 generated/stripe_shared/src/invoice_payment_method_options_bancontact.rs create mode 100644 generated/stripe_shared/src/invoice_payment_method_options_card.rs create mode 100644 generated/stripe_shared/src/invoice_payment_method_options_customer_balance.rs create mode 100644 generated/stripe_shared/src/invoice_payment_method_options_customer_balance_bank_transfer.rs create mode 100644 generated/stripe_shared/src/invoice_payment_method_options_customer_balance_bank_transfer_eu_bank_transfer.rs create mode 100644 generated/stripe_shared/src/invoice_payment_method_options_konbini.rs create mode 100644 generated/stripe_shared/src/invoice_payment_method_options_us_bank_account.rs create mode 100644 generated/stripe_shared/src/invoice_payment_method_options_us_bank_account_linked_account_options.rs create mode 100644 generated/stripe_shared/src/invoice_rendering_pdf.rs create mode 100644 generated/stripe_shared/src/invoice_setting_custom_field.rs create mode 100644 generated/stripe_shared/src/invoice_setting_customer_setting.rs create mode 100644 generated/stripe_shared/src/invoice_setting_quote_setting.rs create mode 100644 generated/stripe_shared/src/invoice_setting_rendering_options.rs create mode 100644 generated/stripe_shared/src/invoice_setting_subscription_schedule_phase_setting.rs create mode 100644 generated/stripe_shared/src/invoice_setting_subscription_schedule_setting.rs create mode 100644 generated/stripe_shared/src/invoice_tax_amount.rs create mode 100644 generated/stripe_shared/src/invoice_threshold_reason.rs create mode 100644 generated/stripe_shared/src/invoice_transfer_data.rs create mode 100644 generated/stripe_shared/src/invoices_from_invoice.rs create mode 100644 generated/stripe_shared/src/invoices_invoice_rendering.rs create mode 100644 generated/stripe_shared/src/invoices_payment_method_options.rs create mode 100644 generated/stripe_shared/src/invoices_payment_settings.rs create mode 100644 generated/stripe_shared/src/invoices_resource_invoice_tax_id.rs create mode 100644 generated/stripe_shared/src/invoices_resource_line_items_credited_items.rs create mode 100644 generated/stripe_shared/src/invoices_resource_line_items_proration_details.rs create mode 100644 generated/stripe_shared/src/invoices_shipping_cost.rs create mode 100644 generated/stripe_shared/src/invoices_status_transitions.rs create mode 100644 generated/stripe_shared/src/issuing_authorization.rs create mode 100644 generated/stripe_shared/src/issuing_authorization_amount_details.rs create mode 100644 generated/stripe_shared/src/issuing_authorization_authentication_exemption.rs rename {src/resources/generated => generated/stripe_shared/src}/issuing_authorization_merchant_data.rs (51%) create mode 100644 generated/stripe_shared/src/issuing_authorization_network_data.rs create mode 100644 generated/stripe_shared/src/issuing_authorization_pending_request.rs create mode 100644 generated/stripe_shared/src/issuing_authorization_request.rs create mode 100644 generated/stripe_shared/src/issuing_authorization_three_d_secure.rs create mode 100644 generated/stripe_shared/src/issuing_authorization_treasury.rs create mode 100644 generated/stripe_shared/src/issuing_authorization_verification_data.rs create mode 100644 generated/stripe_shared/src/issuing_card.rs create mode 100644 generated/stripe_shared/src/issuing_card_apple_pay.rs create mode 100644 generated/stripe_shared/src/issuing_card_authorization_controls.rs create mode 100644 generated/stripe_shared/src/issuing_card_google_pay.rs create mode 100644 generated/stripe_shared/src/issuing_card_shipping.rs create mode 100644 generated/stripe_shared/src/issuing_card_shipping_customs.rs create mode 100644 generated/stripe_shared/src/issuing_card_spending_limit.rs create mode 100644 generated/stripe_shared/src/issuing_card_wallets.rs create mode 100644 generated/stripe_shared/src/issuing_cardholder.rs create mode 100644 generated/stripe_shared/src/issuing_cardholder_address.rs create mode 100644 generated/stripe_shared/src/issuing_cardholder_authorization_controls.rs create mode 100644 generated/stripe_shared/src/issuing_cardholder_card_issuing.rs create mode 100644 generated/stripe_shared/src/issuing_cardholder_company.rs create mode 100644 generated/stripe_shared/src/issuing_cardholder_id_document.rs create mode 100644 generated/stripe_shared/src/issuing_cardholder_individual.rs create mode 100644 generated/stripe_shared/src/issuing_cardholder_individual_dob.rs create mode 100644 generated/stripe_shared/src/issuing_cardholder_requirements.rs create mode 100644 generated/stripe_shared/src/issuing_cardholder_spending_limit.rs create mode 100644 generated/stripe_shared/src/issuing_cardholder_user_terms_acceptance.rs create mode 100644 generated/stripe_shared/src/issuing_cardholder_verification.rs create mode 100644 generated/stripe_shared/src/issuing_dispute.rs create mode 100644 generated/stripe_shared/src/issuing_dispute_canceled_evidence.rs create mode 100644 generated/stripe_shared/src/issuing_dispute_duplicate_evidence.rs create mode 100644 generated/stripe_shared/src/issuing_dispute_evidence.rs create mode 100644 generated/stripe_shared/src/issuing_dispute_fraudulent_evidence.rs create mode 100644 generated/stripe_shared/src/issuing_dispute_merchandise_not_as_described_evidence.rs create mode 100644 generated/stripe_shared/src/issuing_dispute_not_received_evidence.rs create mode 100644 generated/stripe_shared/src/issuing_dispute_other_evidence.rs create mode 100644 generated/stripe_shared/src/issuing_dispute_service_not_as_described_evidence.rs create mode 100644 generated/stripe_shared/src/issuing_dispute_treasury.rs create mode 100644 generated/stripe_shared/src/issuing_network_token_address.rs create mode 100644 generated/stripe_shared/src/issuing_network_token_device.rs create mode 100644 generated/stripe_shared/src/issuing_network_token_mastercard.rs create mode 100644 generated/stripe_shared/src/issuing_network_token_network_data.rs create mode 100644 generated/stripe_shared/src/issuing_network_token_visa.rs create mode 100644 generated/stripe_shared/src/issuing_network_token_wallet_provider.rs create mode 100644 generated/stripe_shared/src/issuing_token.rs create mode 100644 generated/stripe_shared/src/issuing_transaction.rs create mode 100644 generated/stripe_shared/src/issuing_transaction_amount_details.rs create mode 100644 generated/stripe_shared/src/issuing_transaction_flight_data.rs create mode 100644 generated/stripe_shared/src/issuing_transaction_flight_data_leg.rs create mode 100644 generated/stripe_shared/src/issuing_transaction_fuel_data.rs create mode 100644 generated/stripe_shared/src/issuing_transaction_lodging_data.rs create mode 100644 generated/stripe_shared/src/issuing_transaction_network_data.rs create mode 100644 generated/stripe_shared/src/issuing_transaction_purchase_details.rs create mode 100644 generated/stripe_shared/src/issuing_transaction_receipt_data.rs create mode 100644 generated/stripe_shared/src/issuing_transaction_treasury.rs create mode 100644 generated/stripe_shared/src/legal_entity_company.rs create mode 100644 generated/stripe_shared/src/legal_entity_company_verification.rs create mode 100644 generated/stripe_shared/src/legal_entity_company_verification_document.rs create mode 100644 generated/stripe_shared/src/legal_entity_dob.rs rename {src/resources/generated => generated/stripe_shared/src}/legal_entity_japan_address.rs (60%) create mode 100644 generated/stripe_shared/src/legal_entity_person_verification.rs create mode 100644 generated/stripe_shared/src/legal_entity_person_verification_document.rs create mode 100644 generated/stripe_shared/src/legal_entity_ubo_declaration.rs create mode 100644 generated/stripe_shared/src/level3.rs create mode 100644 generated/stripe_shared/src/level3_line_items.rs create mode 100644 generated/stripe_shared/src/line_items_discount_amount.rs create mode 100644 generated/stripe_shared/src/line_items_tax_amount.rs create mode 100644 generated/stripe_shared/src/linked_account_options_us_bank_account.rs create mode 100644 generated/stripe_shared/src/mandate.rs create mode 100644 generated/stripe_shared/src/mandate_acss_debit.rs create mode 100644 generated/stripe_shared/src/mandate_au_becs_debit.rs create mode 100644 generated/stripe_shared/src/mandate_bacs_debit.rs create mode 100644 generated/stripe_shared/src/mandate_cashapp.rs create mode 100644 generated/stripe_shared/src/mandate_link.rs create mode 100644 generated/stripe_shared/src/mandate_multi_use.rs create mode 100644 generated/stripe_shared/src/mandate_payment_method_details.rs create mode 100644 generated/stripe_shared/src/mandate_paypal.rs create mode 100644 generated/stripe_shared/src/mandate_sepa_debit.rs create mode 100644 generated/stripe_shared/src/mandate_single_use.rs create mode 100644 generated/stripe_shared/src/mandate_us_bank_account.rs create mode 100644 generated/stripe_shared/src/mod.rs create mode 100644 generated/stripe_shared/src/networks.rs create mode 100644 generated/stripe_shared/src/notification_event_data.rs create mode 100644 generated/stripe_shared/src/notification_event_request.rs create mode 100644 generated/stripe_shared/src/offline_acceptance.rs create mode 100644 generated/stripe_shared/src/online_acceptance.rs create mode 100644 generated/stripe_shared/src/package_dimensions.rs create mode 100644 generated/stripe_shared/src/payment_flows_amount_details.rs create mode 100644 generated/stripe_shared/src/payment_flows_amount_details_resource_tip.rs create mode 100644 generated/stripe_shared/src/payment_flows_automatic_payment_methods_payment_intent.rs create mode 100644 generated/stripe_shared/src/payment_flows_automatic_payment_methods_setup_intent.rs create mode 100644 generated/stripe_shared/src/payment_flows_private_payment_methods_alipay.rs create mode 100644 generated/stripe_shared/src/payment_flows_private_payment_methods_alipay_details.rs create mode 100644 generated/stripe_shared/src/payment_flows_private_payment_methods_card_details_api_resource_enterprise_features_extended_authorization_extended_authorization.rs create mode 100644 generated/stripe_shared/src/payment_flows_private_payment_methods_card_details_api_resource_enterprise_features_incremental_authorization_incremental_authorization.rs create mode 100644 generated/stripe_shared/src/payment_flows_private_payment_methods_card_details_api_resource_enterprise_features_overcapture_overcapture.rs create mode 100644 generated/stripe_shared/src/payment_flows_private_payment_methods_card_details_api_resource_multicapture.rs create mode 100644 generated/stripe_shared/src/payment_flows_private_payment_methods_klarna_dob.rs create mode 100644 generated/stripe_shared/src/payment_intent.rs create mode 100644 generated/stripe_shared/src/payment_intent_card_processing.rs create mode 100644 generated/stripe_shared/src/payment_intent_next_action.rs create mode 100644 generated/stripe_shared/src/payment_intent_next_action_alipay_handle_redirect.rs create mode 100644 generated/stripe_shared/src/payment_intent_next_action_boleto.rs create mode 100644 generated/stripe_shared/src/payment_intent_next_action_card_await_notification.rs create mode 100644 generated/stripe_shared/src/payment_intent_next_action_cashapp_handle_redirect_or_display_qr_code.rs create mode 100644 generated/stripe_shared/src/payment_intent_next_action_cashapp_qr_code.rs create mode 100644 generated/stripe_shared/src/payment_intent_next_action_display_bank_transfer_instructions.rs create mode 100644 generated/stripe_shared/src/payment_intent_next_action_display_oxxo_details.rs create mode 100644 generated/stripe_shared/src/payment_intent_next_action_konbini.rs create mode 100644 generated/stripe_shared/src/payment_intent_next_action_konbini_familymart.rs create mode 100644 generated/stripe_shared/src/payment_intent_next_action_konbini_lawson.rs create mode 100644 generated/stripe_shared/src/payment_intent_next_action_konbini_ministop.rs create mode 100644 generated/stripe_shared/src/payment_intent_next_action_konbini_seicomart.rs create mode 100644 generated/stripe_shared/src/payment_intent_next_action_konbini_stores.rs create mode 100644 generated/stripe_shared/src/payment_intent_next_action_paynow_display_qr_code.rs create mode 100644 generated/stripe_shared/src/payment_intent_next_action_pix_display_qr_code.rs create mode 100644 generated/stripe_shared/src/payment_intent_next_action_promptpay_display_qr_code.rs create mode 100644 generated/stripe_shared/src/payment_intent_next_action_redirect_to_url.rs create mode 100644 generated/stripe_shared/src/payment_intent_next_action_swish_handle_redirect_or_display_qr_code.rs create mode 100644 generated/stripe_shared/src/payment_intent_next_action_swish_qr_code.rs create mode 100644 generated/stripe_shared/src/payment_intent_next_action_verify_with_microdeposits.rs create mode 100644 generated/stripe_shared/src/payment_intent_next_action_wechat_pay_display_qr_code.rs create mode 100644 generated/stripe_shared/src/payment_intent_next_action_wechat_pay_redirect_to_android_app.rs create mode 100644 generated/stripe_shared/src/payment_intent_next_action_wechat_pay_redirect_to_ios_app.rs create mode 100644 generated/stripe_shared/src/payment_intent_payment_method_options.rs create mode 100644 generated/stripe_shared/src/payment_intent_payment_method_options_acss_debit.rs create mode 100644 generated/stripe_shared/src/payment_intent_payment_method_options_au_becs_debit.rs create mode 100644 generated/stripe_shared/src/payment_intent_payment_method_options_blik.rs create mode 100644 generated/stripe_shared/src/payment_intent_payment_method_options_card.rs create mode 100644 generated/stripe_shared/src/payment_intent_payment_method_options_eps.rs create mode 100644 generated/stripe_shared/src/payment_intent_payment_method_options_link.rs create mode 100644 generated/stripe_shared/src/payment_intent_payment_method_options_mandate_options_acss_debit.rs create mode 100644 generated/stripe_shared/src/payment_intent_payment_method_options_mandate_options_sepa_debit.rs create mode 100644 generated/stripe_shared/src/payment_intent_payment_method_options_sepa_debit.rs create mode 100644 generated/stripe_shared/src/payment_intent_payment_method_options_swish.rs create mode 100644 generated/stripe_shared/src/payment_intent_payment_method_options_us_bank_account.rs create mode 100644 generated/stripe_shared/src/payment_intent_processing.rs create mode 100644 generated/stripe_shared/src/payment_intent_processing_customer_notification.rs create mode 100644 generated/stripe_shared/src/payment_link.rs create mode 100644 generated/stripe_shared/src/payment_links_resource_after_completion.rs create mode 100644 generated/stripe_shared/src/payment_links_resource_automatic_tax.rs create mode 100644 generated/stripe_shared/src/payment_links_resource_completed_sessions.rs create mode 100644 generated/stripe_shared/src/payment_links_resource_completion_behavior_confirmation_page.rs create mode 100644 generated/stripe_shared/src/payment_links_resource_completion_behavior_redirect.rs create mode 100644 generated/stripe_shared/src/payment_links_resource_consent_collection.rs create mode 100644 generated/stripe_shared/src/payment_links_resource_custom_fields.rs create mode 100644 generated/stripe_shared/src/payment_links_resource_custom_fields_dropdown.rs create mode 100644 generated/stripe_shared/src/payment_links_resource_custom_fields_dropdown_option.rs create mode 100644 generated/stripe_shared/src/payment_links_resource_custom_fields_label.rs create mode 100644 generated/stripe_shared/src/payment_links_resource_custom_fields_numeric.rs create mode 100644 generated/stripe_shared/src/payment_links_resource_custom_fields_text.rs create mode 100644 generated/stripe_shared/src/payment_links_resource_custom_text.rs create mode 100644 generated/stripe_shared/src/payment_links_resource_custom_text_position.rs create mode 100644 generated/stripe_shared/src/payment_links_resource_invoice_creation.rs create mode 100644 generated/stripe_shared/src/payment_links_resource_invoice_settings.rs create mode 100644 generated/stripe_shared/src/payment_links_resource_payment_intent_data.rs create mode 100644 generated/stripe_shared/src/payment_links_resource_payment_method_reuse_agreement.rs create mode 100644 generated/stripe_shared/src/payment_links_resource_phone_number_collection.rs create mode 100644 generated/stripe_shared/src/payment_links_resource_restrictions.rs create mode 100644 generated/stripe_shared/src/payment_links_resource_shipping_address_collection.rs create mode 100644 generated/stripe_shared/src/payment_links_resource_shipping_option.rs create mode 100644 generated/stripe_shared/src/payment_links_resource_subscription_data.rs create mode 100644 generated/stripe_shared/src/payment_links_resource_subscription_data_invoice_settings.rs create mode 100644 generated/stripe_shared/src/payment_links_resource_tax_id_collection.rs create mode 100644 generated/stripe_shared/src/payment_links_resource_transfer_data.rs create mode 100644 generated/stripe_shared/src/payment_method.rs create mode 100644 generated/stripe_shared/src/payment_method_acss_debit.rs create mode 100644 generated/stripe_shared/src/payment_method_affirm.rs create mode 100644 generated/stripe_shared/src/payment_method_afterpay_clearpay.rs create mode 100644 generated/stripe_shared/src/payment_method_au_becs_debit.rs create mode 100644 generated/stripe_shared/src/payment_method_bacs_debit.rs create mode 100644 generated/stripe_shared/src/payment_method_bancontact.rs create mode 100644 generated/stripe_shared/src/payment_method_blik.rs create mode 100644 generated/stripe_shared/src/payment_method_boleto.rs create mode 100644 generated/stripe_shared/src/payment_method_card.rs create mode 100644 generated/stripe_shared/src/payment_method_card_checks.rs create mode 100644 generated/stripe_shared/src/payment_method_card_present.rs create mode 100644 generated/stripe_shared/src/payment_method_card_present_networks.rs create mode 100644 generated/stripe_shared/src/payment_method_card_wallet.rs create mode 100644 generated/stripe_shared/src/payment_method_card_wallet_amex_express_checkout.rs create mode 100644 generated/stripe_shared/src/payment_method_card_wallet_apple_pay.rs create mode 100644 generated/stripe_shared/src/payment_method_card_wallet_google_pay.rs create mode 100644 generated/stripe_shared/src/payment_method_card_wallet_link.rs create mode 100644 generated/stripe_shared/src/payment_method_card_wallet_masterpass.rs create mode 100644 generated/stripe_shared/src/payment_method_card_wallet_samsung_pay.rs create mode 100644 generated/stripe_shared/src/payment_method_card_wallet_visa_checkout.rs create mode 100644 generated/stripe_shared/src/payment_method_cashapp.rs create mode 100644 generated/stripe_shared/src/payment_method_config_biz_payment_method_configuration_details.rs create mode 100644 generated/stripe_shared/src/payment_method_customer_balance.rs create mode 100644 generated/stripe_shared/src/payment_method_details.rs create mode 100644 generated/stripe_shared/src/payment_method_details_ach_credit_transfer.rs create mode 100644 generated/stripe_shared/src/payment_method_details_ach_debit.rs create mode 100644 generated/stripe_shared/src/payment_method_details_acss_debit.rs create mode 100644 generated/stripe_shared/src/payment_method_details_affirm.rs create mode 100644 generated/stripe_shared/src/payment_method_details_afterpay_clearpay.rs create mode 100644 generated/stripe_shared/src/payment_method_details_au_becs_debit.rs create mode 100644 generated/stripe_shared/src/payment_method_details_bacs_debit.rs create mode 100644 generated/stripe_shared/src/payment_method_details_bancontact.rs create mode 100644 generated/stripe_shared/src/payment_method_details_blik.rs create mode 100644 generated/stripe_shared/src/payment_method_details_boleto.rs create mode 100644 generated/stripe_shared/src/payment_method_details_card.rs create mode 100644 generated/stripe_shared/src/payment_method_details_card_checks.rs create mode 100644 generated/stripe_shared/src/payment_method_details_card_installments.rs create mode 100644 generated/stripe_shared/src/payment_method_details_card_installments_plan.rs create mode 100644 generated/stripe_shared/src/payment_method_details_card_network_token.rs create mode 100644 generated/stripe_shared/src/payment_method_details_card_present.rs create mode 100644 generated/stripe_shared/src/payment_method_details_card_present_offline.rs create mode 100644 generated/stripe_shared/src/payment_method_details_card_present_receipt.rs create mode 100644 generated/stripe_shared/src/payment_method_details_card_wallet.rs create mode 100644 generated/stripe_shared/src/payment_method_details_card_wallet_amex_express_checkout.rs create mode 100644 generated/stripe_shared/src/payment_method_details_card_wallet_apple_pay.rs create mode 100644 generated/stripe_shared/src/payment_method_details_card_wallet_google_pay.rs create mode 100644 generated/stripe_shared/src/payment_method_details_card_wallet_link.rs create mode 100644 generated/stripe_shared/src/payment_method_details_card_wallet_masterpass.rs create mode 100644 generated/stripe_shared/src/payment_method_details_card_wallet_samsung_pay.rs create mode 100644 generated/stripe_shared/src/payment_method_details_card_wallet_visa_checkout.rs create mode 100644 generated/stripe_shared/src/payment_method_details_cashapp.rs create mode 100644 generated/stripe_shared/src/payment_method_details_customer_balance.rs create mode 100644 generated/stripe_shared/src/payment_method_details_eps.rs create mode 100644 generated/stripe_shared/src/payment_method_details_fpx.rs create mode 100644 generated/stripe_shared/src/payment_method_details_giropay.rs create mode 100644 generated/stripe_shared/src/payment_method_details_grabpay.rs create mode 100644 generated/stripe_shared/src/payment_method_details_ideal.rs create mode 100644 generated/stripe_shared/src/payment_method_details_interac_present.rs create mode 100644 generated/stripe_shared/src/payment_method_details_interac_present_receipt.rs create mode 100644 generated/stripe_shared/src/payment_method_details_klarna.rs create mode 100644 generated/stripe_shared/src/payment_method_details_konbini.rs create mode 100644 generated/stripe_shared/src/payment_method_details_konbini_store.rs create mode 100644 generated/stripe_shared/src/payment_method_details_link.rs create mode 100644 generated/stripe_shared/src/payment_method_details_multibanco.rs create mode 100644 generated/stripe_shared/src/payment_method_details_oxxo.rs create mode 100644 generated/stripe_shared/src/payment_method_details_p24.rs create mode 100644 generated/stripe_shared/src/payment_method_details_paynow.rs create mode 100644 generated/stripe_shared/src/payment_method_details_paypal.rs create mode 100644 generated/stripe_shared/src/payment_method_details_pix.rs create mode 100644 generated/stripe_shared/src/payment_method_details_promptpay.rs create mode 100644 generated/stripe_shared/src/payment_method_details_revolut_pay.rs create mode 100644 generated/stripe_shared/src/payment_method_details_sepa_credit_transfer.rs create mode 100644 generated/stripe_shared/src/payment_method_details_sepa_debit.rs create mode 100644 generated/stripe_shared/src/payment_method_details_sofort.rs create mode 100644 generated/stripe_shared/src/payment_method_details_stripe_account.rs create mode 100644 generated/stripe_shared/src/payment_method_details_swish.rs create mode 100644 generated/stripe_shared/src/payment_method_details_us_bank_account.rs create mode 100644 generated/stripe_shared/src/payment_method_details_wechat.rs create mode 100644 generated/stripe_shared/src/payment_method_details_wechat_pay.rs create mode 100644 generated/stripe_shared/src/payment_method_details_zip.rs create mode 100644 generated/stripe_shared/src/payment_method_eps.rs create mode 100644 generated/stripe_shared/src/payment_method_fpx.rs create mode 100644 generated/stripe_shared/src/payment_method_giropay.rs create mode 100644 generated/stripe_shared/src/payment_method_grabpay.rs create mode 100644 generated/stripe_shared/src/payment_method_ideal.rs create mode 100644 generated/stripe_shared/src/payment_method_interac_present.rs create mode 100644 generated/stripe_shared/src/payment_method_klarna.rs create mode 100644 generated/stripe_shared/src/payment_method_konbini.rs create mode 100644 generated/stripe_shared/src/payment_method_link.rs create mode 100644 generated/stripe_shared/src/payment_method_options_affirm.rs create mode 100644 generated/stripe_shared/src/payment_method_options_afterpay_clearpay.rs create mode 100644 generated/stripe_shared/src/payment_method_options_alipay.rs create mode 100644 generated/stripe_shared/src/payment_method_options_bacs_debit.rs create mode 100644 generated/stripe_shared/src/payment_method_options_bancontact.rs create mode 100644 generated/stripe_shared/src/payment_method_options_boleto.rs create mode 100644 generated/stripe_shared/src/payment_method_options_card_installments.rs create mode 100644 generated/stripe_shared/src/payment_method_options_card_mandate_options.rs create mode 100644 generated/stripe_shared/src/payment_method_options_card_present.rs create mode 100644 generated/stripe_shared/src/payment_method_options_cashapp.rs create mode 100644 generated/stripe_shared/src/payment_method_options_customer_balance.rs create mode 100644 generated/stripe_shared/src/payment_method_options_customer_balance_bank_transfer.rs create mode 100644 generated/stripe_shared/src/payment_method_options_customer_balance_eu_bank_account.rs create mode 100644 generated/stripe_shared/src/payment_method_options_fpx.rs create mode 100644 generated/stripe_shared/src/payment_method_options_giropay.rs create mode 100644 generated/stripe_shared/src/payment_method_options_grabpay.rs create mode 100644 generated/stripe_shared/src/payment_method_options_ideal.rs create mode 100644 generated/stripe_shared/src/payment_method_options_interac_present.rs create mode 100644 generated/stripe_shared/src/payment_method_options_klarna.rs create mode 100644 generated/stripe_shared/src/payment_method_options_konbini.rs create mode 100644 generated/stripe_shared/src/payment_method_options_oxxo.rs create mode 100644 generated/stripe_shared/src/payment_method_options_p24.rs create mode 100644 generated/stripe_shared/src/payment_method_options_paynow.rs create mode 100644 generated/stripe_shared/src/payment_method_options_paypal.rs create mode 100644 generated/stripe_shared/src/payment_method_options_pix.rs create mode 100644 generated/stripe_shared/src/payment_method_options_promptpay.rs create mode 100644 generated/stripe_shared/src/payment_method_options_revolut_pay.rs create mode 100644 generated/stripe_shared/src/payment_method_options_sofort.rs create mode 100644 generated/stripe_shared/src/payment_method_options_us_bank_account_mandate_options.rs create mode 100644 generated/stripe_shared/src/payment_method_options_wechat_pay.rs create mode 100644 generated/stripe_shared/src/payment_method_options_zip.rs create mode 100644 generated/stripe_shared/src/payment_method_oxxo.rs create mode 100644 generated/stripe_shared/src/payment_method_p24.rs create mode 100644 generated/stripe_shared/src/payment_method_paynow.rs create mode 100644 generated/stripe_shared/src/payment_method_paypal.rs create mode 100644 generated/stripe_shared/src/payment_method_pix.rs create mode 100644 generated/stripe_shared/src/payment_method_promptpay.rs create mode 100644 generated/stripe_shared/src/payment_method_revolut_pay.rs create mode 100644 generated/stripe_shared/src/payment_method_sepa_debit.rs create mode 100644 generated/stripe_shared/src/payment_method_sofort.rs create mode 100644 generated/stripe_shared/src/payment_method_swish.rs create mode 100644 generated/stripe_shared/src/payment_method_us_bank_account.rs create mode 100644 generated/stripe_shared/src/payment_method_us_bank_account_blocked.rs create mode 100644 generated/stripe_shared/src/payment_method_us_bank_account_status_details.rs create mode 100644 generated/stripe_shared/src/payment_method_wechat_pay.rs create mode 100644 generated/stripe_shared/src/payment_method_zip.rs create mode 100644 generated/stripe_shared/src/payment_source.rs create mode 100644 generated/stripe_shared/src/payout.rs create mode 100644 generated/stripe_shared/src/paypal_seller_protection.rs create mode 100644 generated/stripe_shared/src/period.rs create mode 100644 generated/stripe_shared/src/person.rs create mode 100644 generated/stripe_shared/src/person_additional_tos_acceptance.rs create mode 100644 generated/stripe_shared/src/person_additional_tos_acceptances.rs create mode 100644 generated/stripe_shared/src/person_future_requirements.rs create mode 100644 generated/stripe_shared/src/person_relationship.rs create mode 100644 generated/stripe_shared/src/person_requirements.rs create mode 100644 generated/stripe_shared/src/plan.rs create mode 100644 generated/stripe_shared/src/plan_tier.rs create mode 100644 generated/stripe_shared/src/platform_tax_fee.rs create mode 100644 generated/stripe_shared/src/price.rs create mode 100644 generated/stripe_shared/src/price_tier.rs create mode 100644 generated/stripe_shared/src/product.rs create mode 100644 generated/stripe_shared/src/product_feature.rs create mode 100644 generated/stripe_shared/src/promotion_code.rs create mode 100644 generated/stripe_shared/src/promotion_code_currency_option.rs create mode 100644 generated/stripe_shared/src/promotion_codes_resource_restrictions.rs create mode 100644 generated/stripe_shared/src/quote.rs create mode 100644 generated/stripe_shared/src/quotes_resource_automatic_tax.rs create mode 100644 generated/stripe_shared/src/quotes_resource_computed.rs create mode 100644 generated/stripe_shared/src/quotes_resource_from_quote.rs create mode 100644 generated/stripe_shared/src/quotes_resource_recurring.rs create mode 100644 generated/stripe_shared/src/quotes_resource_status_transitions.rs create mode 100644 generated/stripe_shared/src/quotes_resource_subscription_data_subscription_data.rs create mode 100644 generated/stripe_shared/src/quotes_resource_total_details.rs create mode 100644 generated/stripe_shared/src/quotes_resource_total_details_resource_breakdown.rs create mode 100644 generated/stripe_shared/src/quotes_resource_transfer_data.rs create mode 100644 generated/stripe_shared/src/quotes_resource_upfront.rs rename {src/resources/generated => generated/stripe_shared/src}/radar_radar_options.rs (52%) create mode 100644 generated/stripe_shared/src/radar_review_resource_location.rs create mode 100644 generated/stripe_shared/src/radar_review_resource_session.rs create mode 100644 generated/stripe_shared/src/recurring.rs create mode 100644 generated/stripe_shared/src/refund.rs create mode 100644 generated/stripe_shared/src/refund_destination_details.rs create mode 100644 generated/stripe_shared/src/refund_destination_details_card.rs create mode 100644 generated/stripe_shared/src/refund_destination_details_generic.rs create mode 100644 generated/stripe_shared/src/refund_next_action.rs create mode 100644 generated/stripe_shared/src/refund_next_action_display_details.rs create mode 100644 generated/stripe_shared/src/reserve_transaction.rs create mode 100644 generated/stripe_shared/src/review.rs create mode 100644 generated/stripe_shared/src/rule.rs create mode 100644 generated/stripe_shared/src/schedules_phase_automatic_tax.rs create mode 100644 generated/stripe_shared/src/sepa_debit_generated_from.rs create mode 100644 generated/stripe_shared/src/setup_attempt.rs create mode 100644 generated/stripe_shared/src/setup_attempt_payment_method_details.rs create mode 100644 generated/stripe_shared/src/setup_attempt_payment_method_details_acss_debit.rs create mode 100644 generated/stripe_shared/src/setup_attempt_payment_method_details_au_becs_debit.rs create mode 100644 generated/stripe_shared/src/setup_attempt_payment_method_details_bacs_debit.rs create mode 100644 generated/stripe_shared/src/setup_attempt_payment_method_details_bancontact.rs create mode 100644 generated/stripe_shared/src/setup_attempt_payment_method_details_boleto.rs create mode 100644 generated/stripe_shared/src/setup_attempt_payment_method_details_card.rs create mode 100644 generated/stripe_shared/src/setup_attempt_payment_method_details_card_checks.rs create mode 100644 generated/stripe_shared/src/setup_attempt_payment_method_details_card_present.rs create mode 100644 generated/stripe_shared/src/setup_attempt_payment_method_details_card_wallet.rs create mode 100644 generated/stripe_shared/src/setup_attempt_payment_method_details_cashapp.rs create mode 100644 generated/stripe_shared/src/setup_attempt_payment_method_details_ideal.rs create mode 100644 generated/stripe_shared/src/setup_attempt_payment_method_details_klarna.rs create mode 100644 generated/stripe_shared/src/setup_attempt_payment_method_details_link.rs create mode 100644 generated/stripe_shared/src/setup_attempt_payment_method_details_paypal.rs create mode 100644 generated/stripe_shared/src/setup_attempt_payment_method_details_sepa_debit.rs create mode 100644 generated/stripe_shared/src/setup_attempt_payment_method_details_sofort.rs create mode 100644 generated/stripe_shared/src/setup_attempt_payment_method_details_us_bank_account.rs create mode 100644 generated/stripe_shared/src/setup_intent.rs create mode 100644 generated/stripe_shared/src/setup_intent_next_action.rs create mode 100644 generated/stripe_shared/src/setup_intent_next_action_redirect_to_url.rs create mode 100644 generated/stripe_shared/src/setup_intent_next_action_verify_with_microdeposits.rs create mode 100644 generated/stripe_shared/src/setup_intent_payment_method_options.rs create mode 100644 generated/stripe_shared/src/setup_intent_payment_method_options_acss_debit.rs create mode 100644 generated/stripe_shared/src/setup_intent_payment_method_options_card.rs create mode 100644 generated/stripe_shared/src/setup_intent_payment_method_options_card_mandate_options.rs create mode 100644 generated/stripe_shared/src/setup_intent_payment_method_options_link.rs create mode 100644 generated/stripe_shared/src/setup_intent_payment_method_options_mandate_options_acss_debit.rs create mode 100644 generated/stripe_shared/src/setup_intent_payment_method_options_mandate_options_sepa_debit.rs create mode 100644 generated/stripe_shared/src/setup_intent_payment_method_options_paypal.rs create mode 100644 generated/stripe_shared/src/setup_intent_payment_method_options_sepa_debit.rs create mode 100644 generated/stripe_shared/src/setup_intent_payment_method_options_us_bank_account.rs rename {src/resources/generated => generated/stripe_shared/src}/shipping.rs (69%) create mode 100644 generated/stripe_shared/src/shipping_rate.rs create mode 100644 generated/stripe_shared/src/shipping_rate_currency_option.rs create mode 100644 generated/stripe_shared/src/shipping_rate_delivery_estimate.rs create mode 100644 generated/stripe_shared/src/shipping_rate_delivery_estimate_bound.rs create mode 100644 generated/stripe_shared/src/shipping_rate_fixed_amount.rs create mode 100644 generated/stripe_shared/src/source.rs create mode 100644 generated/stripe_shared/src/source_code_verification_flow.rs create mode 100644 generated/stripe_shared/src/source_order.rs create mode 100644 generated/stripe_shared/src/source_order_item.rs create mode 100644 generated/stripe_shared/src/source_owner.rs create mode 100644 generated/stripe_shared/src/source_receiver_flow.rs create mode 100644 generated/stripe_shared/src/source_redirect_flow.rs create mode 100644 generated/stripe_shared/src/source_transaction.rs create mode 100644 generated/stripe_shared/src/source_transaction_ach_credit_transfer_data.rs create mode 100644 generated/stripe_shared/src/source_transaction_chf_credit_transfer_data.rs create mode 100644 generated/stripe_shared/src/source_transaction_gbp_credit_transfer_data.rs create mode 100644 generated/stripe_shared/src/source_transaction_paper_check_data.rs create mode 100644 generated/stripe_shared/src/source_transaction_sepa_credit_transfer_data.rs create mode 100644 generated/stripe_shared/src/source_type_ach_credit_transfer.rs create mode 100644 generated/stripe_shared/src/source_type_ach_debit.rs create mode 100644 generated/stripe_shared/src/source_type_acss_debit.rs create mode 100644 generated/stripe_shared/src/source_type_alipay.rs create mode 100644 generated/stripe_shared/src/source_type_au_becs_debit.rs create mode 100644 generated/stripe_shared/src/source_type_bancontact.rs create mode 100644 generated/stripe_shared/src/source_type_card.rs create mode 100644 generated/stripe_shared/src/source_type_card_present.rs create mode 100644 generated/stripe_shared/src/source_type_eps.rs create mode 100644 generated/stripe_shared/src/source_type_giropay.rs create mode 100644 generated/stripe_shared/src/source_type_ideal.rs create mode 100644 generated/stripe_shared/src/source_type_klarna.rs create mode 100644 generated/stripe_shared/src/source_type_multibanco.rs create mode 100644 generated/stripe_shared/src/source_type_p24.rs create mode 100644 generated/stripe_shared/src/source_type_sepa_credit_transfer.rs create mode 100644 generated/stripe_shared/src/source_type_sepa_debit.rs create mode 100644 generated/stripe_shared/src/source_type_sofort.rs create mode 100644 generated/stripe_shared/src/source_type_three_d_secure.rs create mode 100644 generated/stripe_shared/src/source_type_wechat.rs create mode 100644 generated/stripe_shared/src/subscription.rs create mode 100644 generated/stripe_shared/src/subscription_automatic_tax.rs rename {src/resources/generated => generated/stripe_shared/src}/subscription_billing_thresholds.rs (63%) create mode 100644 generated/stripe_shared/src/subscription_details_data.rs create mode 100644 generated/stripe_shared/src/subscription_item.rs create mode 100644 generated/stripe_shared/src/subscription_item_billing_thresholds.rs create mode 100644 generated/stripe_shared/src/subscription_payment_method_options_card.rs create mode 100644 generated/stripe_shared/src/subscription_pending_invoice_item_interval.rs create mode 100644 generated/stripe_shared/src/subscription_schedule.rs create mode 100644 generated/stripe_shared/src/subscription_schedule_add_invoice_item.rs create mode 100644 generated/stripe_shared/src/subscription_schedule_configuration_item.rs create mode 100644 generated/stripe_shared/src/subscription_schedule_current_phase.rs create mode 100644 generated/stripe_shared/src/subscription_schedule_phase_configuration.rs create mode 100644 generated/stripe_shared/src/subscription_schedules_resource_default_settings.rs create mode 100644 generated/stripe_shared/src/subscription_schedules_resource_default_settings_automatic_tax.rs rename {src/resources/generated => generated/stripe_shared/src}/subscription_transfer_data.rs (52%) create mode 100644 generated/stripe_shared/src/subscriptions_resource_billing_cycle_anchor_config.rs create mode 100644 generated/stripe_shared/src/subscriptions_resource_pause_collection.rs create mode 100644 generated/stripe_shared/src/subscriptions_resource_payment_method_options.rs create mode 100644 generated/stripe_shared/src/subscriptions_resource_payment_settings.rs create mode 100644 generated/stripe_shared/src/subscriptions_resource_pending_update.rs create mode 100644 generated/stripe_shared/src/subscriptions_trials_resource_end_behavior.rs create mode 100644 generated/stripe_shared/src/subscriptions_trials_resource_trial_settings.rs create mode 100644 generated/stripe_shared/src/tax_code.rs create mode 100644 generated/stripe_shared/src/tax_deducted_at_source.rs create mode 100644 generated/stripe_shared/src/tax_i_ds_owner.rs create mode 100644 generated/stripe_shared/src/tax_id.rs create mode 100644 generated/stripe_shared/src/tax_id_verification.rs create mode 100644 generated/stripe_shared/src/tax_rate.rs create mode 100644 generated/stripe_shared/src/test_helpers_test_clock.rs create mode 100644 generated/stripe_shared/src/three_d_secure_details.rs create mode 100644 generated/stripe_shared/src/three_d_secure_details_charge.rs create mode 100644 generated/stripe_shared/src/three_d_secure_usage.rs create mode 100644 generated/stripe_shared/src/topup.rs create mode 100644 generated/stripe_shared/src/transfer.rs create mode 100644 generated/stripe_shared/src/transfer_data.rs create mode 100644 generated/stripe_shared/src/transfer_reversal.rs create mode 100644 generated/stripe_shared/src/transfer_schedule.rs create mode 100644 generated/stripe_shared/src/transform_quantity.rs create mode 100644 generated/stripe_shared/src/transform_usage.rs create mode 100644 generated/stripe_shared/src/us_bank_account_networks.rs create mode 100644 generated/stripe_shared/src/usage_record_summary.rs create mode 100644 generated/stripe_shared/src/version.rs create mode 100644 generated/stripe_terminal/Cargo.toml create mode 100644 generated/stripe_terminal/src/deleted_terminal_configuration.rs create mode 100644 generated/stripe_terminal/src/deleted_terminal_location.rs create mode 100644 generated/stripe_terminal/src/deleted_terminal_reader.rs create mode 100644 generated/stripe_terminal/src/mod.rs create mode 100644 generated/stripe_terminal/src/terminal_configuration/mod.rs create mode 100644 generated/stripe_terminal/src/terminal_configuration/requests.rs create mode 100644 generated/stripe_terminal/src/terminal_configuration/types.rs create mode 100644 generated/stripe_terminal/src/terminal_configuration_configuration_resource_currency_specific_config.rs create mode 100644 generated/stripe_terminal/src/terminal_configuration_configuration_resource_device_type_specific_config.rs create mode 100644 generated/stripe_terminal/src/terminal_configuration_configuration_resource_offline_config.rs create mode 100644 generated/stripe_terminal/src/terminal_configuration_configuration_resource_tipping.rs create mode 100644 generated/stripe_terminal/src/terminal_connection_token/mod.rs create mode 100644 generated/stripe_terminal/src/terminal_connection_token/requests.rs create mode 100644 generated/stripe_terminal/src/terminal_connection_token/types.rs create mode 100644 generated/stripe_terminal/src/terminal_location/mod.rs create mode 100644 generated/stripe_terminal/src/terminal_location/requests.rs create mode 100644 generated/stripe_terminal/src/terminal_location/types.rs create mode 100644 generated/stripe_terminal/src/terminal_reader/mod.rs create mode 100644 generated/stripe_terminal/src/terminal_reader/requests.rs create mode 100644 generated/stripe_terminal/src/terminal_reader/types.rs create mode 100644 generated/stripe_terminal/src/terminal_reader_reader_resource_cart.rs create mode 100644 generated/stripe_terminal/src/terminal_reader_reader_resource_line_item.rs create mode 100644 generated/stripe_terminal/src/terminal_reader_reader_resource_process_config.rs create mode 100644 generated/stripe_terminal/src/terminal_reader_reader_resource_process_payment_intent_action.rs create mode 100644 generated/stripe_terminal/src/terminal_reader_reader_resource_process_setup_config.rs create mode 100644 generated/stripe_terminal/src/terminal_reader_reader_resource_process_setup_intent_action.rs create mode 100644 generated/stripe_terminal/src/terminal_reader_reader_resource_reader_action.rs create mode 100644 generated/stripe_terminal/src/terminal_reader_reader_resource_refund_payment_action.rs create mode 100644 generated/stripe_terminal/src/terminal_reader_reader_resource_set_reader_display_action.rs create mode 100644 generated/stripe_terminal/src/terminal_reader_reader_resource_tipping_config.rs create mode 100644 generated/stripe_treasury/Cargo.toml create mode 100644 generated/stripe_treasury/src/inbound_transfers.rs create mode 100644 generated/stripe_treasury/src/inbound_transfers_payment_method_details_us_bank_account.rs create mode 100644 generated/stripe_treasury/src/mod.rs create mode 100644 generated/stripe_treasury/src/outbound_payments_payment_method_details.rs create mode 100644 generated/stripe_treasury/src/outbound_payments_payment_method_details_financial_account.rs create mode 100644 generated/stripe_treasury/src/outbound_payments_payment_method_details_us_bank_account.rs create mode 100644 generated/stripe_treasury/src/outbound_transfers_payment_method_details.rs create mode 100644 generated/stripe_treasury/src/outbound_transfers_payment_method_details_us_bank_account.rs create mode 100644 generated/stripe_treasury/src/received_payment_method_details_financial_account.rs create mode 100644 generated/stripe_treasury/src/treasury_credit_reversal/mod.rs create mode 100644 generated/stripe_treasury/src/treasury_credit_reversal/requests.rs create mode 100644 generated/stripe_treasury/src/treasury_credit_reversal/types.rs create mode 100644 generated/stripe_treasury/src/treasury_debit_reversal/mod.rs create mode 100644 generated/stripe_treasury/src/treasury_debit_reversal/requests.rs create mode 100644 generated/stripe_treasury/src/treasury_debit_reversal/types.rs create mode 100644 generated/stripe_treasury/src/treasury_financial_account/mod.rs create mode 100644 generated/stripe_treasury/src/treasury_financial_account/requests.rs create mode 100644 generated/stripe_treasury/src/treasury_financial_account/types.rs create mode 100644 generated/stripe_treasury/src/treasury_financial_account_features.rs create mode 100644 generated/stripe_treasury/src/treasury_financial_accounts_resource_aba_record.rs create mode 100644 generated/stripe_treasury/src/treasury_financial_accounts_resource_aba_toggle_settings.rs create mode 100644 generated/stripe_treasury/src/treasury_financial_accounts_resource_ach_toggle_settings.rs create mode 100644 generated/stripe_treasury/src/treasury_financial_accounts_resource_balance.rs create mode 100644 generated/stripe_treasury/src/treasury_financial_accounts_resource_closed_status_details.rs create mode 100644 generated/stripe_treasury/src/treasury_financial_accounts_resource_financial_address.rs create mode 100644 generated/stripe_treasury/src/treasury_financial_accounts_resource_financial_addresses_features.rs create mode 100644 generated/stripe_treasury/src/treasury_financial_accounts_resource_inbound_transfers.rs create mode 100644 generated/stripe_treasury/src/treasury_financial_accounts_resource_outbound_payments.rs create mode 100644 generated/stripe_treasury/src/treasury_financial_accounts_resource_outbound_transfers.rs create mode 100644 generated/stripe_treasury/src/treasury_financial_accounts_resource_platform_restrictions.rs create mode 100644 generated/stripe_treasury/src/treasury_financial_accounts_resource_status_details.rs create mode 100644 generated/stripe_treasury/src/treasury_financial_accounts_resource_toggle_settings.rs create mode 100644 generated/stripe_treasury/src/treasury_financial_accounts_resource_toggles_setting_status_details.rs create mode 100644 generated/stripe_treasury/src/treasury_inbound_transfer/mod.rs create mode 100644 generated/stripe_treasury/src/treasury_inbound_transfer/requests.rs create mode 100644 generated/stripe_treasury/src/treasury_inbound_transfer/types.rs create mode 100644 generated/stripe_treasury/src/treasury_inbound_transfers_resource_failure_details.rs create mode 100644 generated/stripe_treasury/src/treasury_inbound_transfers_resource_inbound_transfer_resource_linked_flows.rs create mode 100644 generated/stripe_treasury/src/treasury_inbound_transfers_resource_inbound_transfer_resource_status_transitions.rs create mode 100644 generated/stripe_treasury/src/treasury_outbound_payment/mod.rs create mode 100644 generated/stripe_treasury/src/treasury_outbound_payment/requests.rs create mode 100644 generated/stripe_treasury/src/treasury_outbound_payment/types.rs create mode 100644 generated/stripe_treasury/src/treasury_outbound_payments_resource_outbound_payment_resource_end_user_details.rs create mode 100644 generated/stripe_treasury/src/treasury_outbound_payments_resource_outbound_payment_resource_status_transitions.rs create mode 100644 generated/stripe_treasury/src/treasury_outbound_payments_resource_returned_status.rs create mode 100644 generated/stripe_treasury/src/treasury_outbound_transfer/mod.rs create mode 100644 generated/stripe_treasury/src/treasury_outbound_transfer/requests.rs create mode 100644 generated/stripe_treasury/src/treasury_outbound_transfer/types.rs create mode 100644 generated/stripe_treasury/src/treasury_outbound_transfers_resource_returned_details.rs create mode 100644 generated/stripe_treasury/src/treasury_outbound_transfers_resource_status_transitions.rs create mode 100644 generated/stripe_treasury/src/treasury_received_credit/mod.rs create mode 100644 generated/stripe_treasury/src/treasury_received_credit/requests.rs create mode 100644 generated/stripe_treasury/src/treasury_received_credit/types.rs create mode 100644 generated/stripe_treasury/src/treasury_received_credits_resource_linked_flows.rs create mode 100644 generated/stripe_treasury/src/treasury_received_credits_resource_reversal_details.rs create mode 100644 generated/stripe_treasury/src/treasury_received_credits_resource_source_flows_details.rs create mode 100644 generated/stripe_treasury/src/treasury_received_credits_resource_status_transitions.rs create mode 100644 generated/stripe_treasury/src/treasury_received_debit/mod.rs create mode 100644 generated/stripe_treasury/src/treasury_received_debit/requests.rs create mode 100644 generated/stripe_treasury/src/treasury_received_debit/types.rs create mode 100644 generated/stripe_treasury/src/treasury_received_debits_resource_debit_reversal_linked_flows.rs create mode 100644 generated/stripe_treasury/src/treasury_received_debits_resource_linked_flows.rs create mode 100644 generated/stripe_treasury/src/treasury_received_debits_resource_reversal_details.rs create mode 100644 generated/stripe_treasury/src/treasury_received_debits_resource_status_transitions.rs create mode 100644 generated/stripe_treasury/src/treasury_shared_resource_billing_details.rs create mode 100644 generated/stripe_treasury/src/treasury_shared_resource_initiating_payment_method_details_initiating_payment_method_details.rs create mode 100644 generated/stripe_treasury/src/treasury_shared_resource_initiating_payment_method_details_us_bank_account.rs create mode 100644 generated/stripe_treasury/src/treasury_transaction/mod.rs create mode 100644 generated/stripe_treasury/src/treasury_transaction/requests.rs create mode 100644 generated/stripe_treasury/src/treasury_transaction/types.rs create mode 100644 generated/stripe_treasury/src/treasury_transaction_entry/mod.rs create mode 100644 generated/stripe_treasury/src/treasury_transaction_entry/requests.rs create mode 100644 generated/stripe_treasury/src/treasury_transaction_entry/types.rs create mode 100644 generated/stripe_treasury/src/treasury_transactions_resource_abstract_transaction_resource_status_transitions.rs rename {src/resources/generated => generated/stripe_treasury/src}/treasury_transactions_resource_balance_impact.rs (58%) create mode 100644 generated/stripe_treasury/src/treasury_transactions_resource_flow_details.rs delete mode 100644 keys.json create mode 100644 openapi/README.md create mode 100644 openapi/doc_urls.json create mode 100644 openapi/gen_crates.toml create mode 100644 openapi/id_prefixes.json delete mode 100644 openapi/main.c delete mode 100644 openapi/out.log create mode 100644 openapi/src/components.rs create mode 100644 openapi/src/crate_inference.rs create mode 100644 openapi/src/crate_table.rs create mode 100644 openapi/src/crates.rs create mode 100644 openapi/src/deduplication.rs delete mode 100644 openapi/src/file_generator.rs create mode 100644 openapi/src/graph.rs create mode 100644 openapi/src/ids.rs create mode 100644 openapi/src/lib.rs delete mode 100644 openapi/src/mappings.rs delete mode 100644 openapi/src/metadata.rs create mode 100644 openapi/src/object_writing.rs create mode 100644 openapi/src/overrides.rs create mode 100644 openapi/src/printable.rs create mode 100644 openapi/src/requests.rs create mode 100644 openapi/src/rust_object.rs create mode 100644 openapi/src/rust_type.rs create mode 100644 openapi/src/spec_inference.rs create mode 100644 openapi/src/stripe_object.rs create mode 100644 openapi/src/templates/cargo_toml.rs create mode 100644 openapi/src/templates/derives.rs create mode 100644 openapi/src/templates/enums.rs create mode 100644 openapi/src/templates/mod.rs create mode 100644 openapi/src/templates/object_trait.rs create mode 100644 openapi/src/templates/object_writer.rs create mode 100644 openapi/src/templates/requests.rs create mode 100644 openapi/src/templates/structs.rs create mode 100644 openapi/src/templates/utils.rs delete mode 100644 openapi/src/util.rs create mode 100644 openapi/src/utils.rs create mode 100644 openapi/src/visitor.rs create mode 100644 openapi/src/webhook.rs delete mode 100755 openapi/test delete mode 100644 out.diff delete mode 100644 out.log delete mode 100644 src/error.rs delete mode 100644 src/ids.rs delete mode 100644 src/params.rs delete mode 100644 src/resources.rs delete mode 100644 src/resources/account_ext.rs delete mode 100644 src/resources/balance_ext.rs delete mode 100644 src/resources/balance_transaction_ext.rs delete mode 100644 src/resources/bank_account_ext.rs delete mode 100644 src/resources/card.rs delete mode 100644 src/resources/charge_ext.rs delete mode 100644 src/resources/checkout_session_ext.rs delete mode 100644 src/resources/credit_note_ext.rs delete mode 100644 src/resources/customer_balance_transaction_ext.rs delete mode 100644 src/resources/customer_ext.rs delete mode 100644 src/resources/generated.rs delete mode 100644 src/resources/generated/account.rs delete mode 100644 src/resources/generated/account_application_authorized.rs delete mode 100644 src/resources/generated/account_application_deauthorized.rs delete mode 100644 src/resources/generated/account_external_account_created.rs delete mode 100644 src/resources/generated/account_external_account_deleted.rs delete mode 100644 src/resources/generated/account_external_account_updated.rs delete mode 100644 src/resources/generated/account_link.rs delete mode 100644 src/resources/generated/account_session.rs delete mode 100644 src/resources/generated/account_updated.rs delete mode 100644 src/resources/generated/api_errors.rs delete mode 100644 src/resources/generated/apple_pay_domain.rs delete mode 100644 src/resources/generated/application.rs delete mode 100644 src/resources/generated/application_fee.rs delete mode 100644 src/resources/generated/application_fee_created.rs delete mode 100644 src/resources/generated/application_fee_refund_updated.rs delete mode 100644 src/resources/generated/application_fee_refunded.rs delete mode 100644 src/resources/generated/apps_secret.rs delete mode 100644 src/resources/generated/balance.rs delete mode 100644 src/resources/generated/balance_available.rs delete mode 100644 src/resources/generated/balance_transaction.rs delete mode 100644 src/resources/generated/bank_account.rs delete mode 100644 src/resources/generated/bank_connections_resource_accountholder.rs delete mode 100644 src/resources/generated/billing_details.rs delete mode 100644 src/resources/generated/billing_portal_configuration.rs delete mode 100644 src/resources/generated/billing_portal_configuration_created.rs delete mode 100644 src/resources/generated/billing_portal_configuration_updated.rs delete mode 100644 src/resources/generated/billing_portal_session.rs delete mode 100644 src/resources/generated/billing_portal_session_created.rs delete mode 100644 src/resources/generated/capability.rs delete mode 100644 src/resources/generated/capability_updated.rs delete mode 100644 src/resources/generated/cash_balance.rs delete mode 100644 src/resources/generated/cash_balance_funds_available.rs delete mode 100644 src/resources/generated/charge.rs delete mode 100644 src/resources/generated/charge_captured.rs delete mode 100644 src/resources/generated/charge_dispute_closed.rs delete mode 100644 src/resources/generated/charge_dispute_created.rs delete mode 100644 src/resources/generated/charge_dispute_funds_reinstated.rs delete mode 100644 src/resources/generated/charge_dispute_funds_withdrawn.rs delete mode 100644 src/resources/generated/charge_dispute_updated.rs delete mode 100644 src/resources/generated/charge_expired.rs delete mode 100644 src/resources/generated/charge_failed.rs delete mode 100644 src/resources/generated/charge_pending.rs delete mode 100644 src/resources/generated/charge_refund_updated.rs delete mode 100644 src/resources/generated/charge_refunded.rs delete mode 100644 src/resources/generated/charge_succeeded.rs delete mode 100644 src/resources/generated/charge_updated.rs delete mode 100644 src/resources/generated/checkout_session.rs delete mode 100644 src/resources/generated/checkout_session_async_payment_failed.rs delete mode 100644 src/resources/generated/checkout_session_async_payment_succeeded.rs delete mode 100644 src/resources/generated/checkout_session_completed.rs delete mode 100644 src/resources/generated/checkout_session_expired.rs delete mode 100644 src/resources/generated/climate_order.rs delete mode 100644 src/resources/generated/climate_order_canceled.rs delete mode 100644 src/resources/generated/climate_order_created.rs delete mode 100644 src/resources/generated/climate_order_delayed.rs delete mode 100644 src/resources/generated/climate_order_delivered.rs delete mode 100644 src/resources/generated/climate_order_product_substituted.rs delete mode 100644 src/resources/generated/climate_product.rs delete mode 100644 src/resources/generated/climate_product_created.rs delete mode 100644 src/resources/generated/climate_product_pricing_updated.rs delete mode 100644 src/resources/generated/climate_supplier.rs delete mode 100644 src/resources/generated/connect_account_reference.rs delete mode 100644 src/resources/generated/connect_collection_transfer.rs delete mode 100644 src/resources/generated/country_spec.rs delete mode 100644 src/resources/generated/coupon.rs delete mode 100644 src/resources/generated/coupon_created.rs delete mode 100644 src/resources/generated/coupon_deleted.rs delete mode 100644 src/resources/generated/coupon_updated.rs delete mode 100644 src/resources/generated/credit_note.rs delete mode 100644 src/resources/generated/credit_note_created.rs delete mode 100644 src/resources/generated/credit_note_line_item.rs delete mode 100644 src/resources/generated/credit_note_updated.rs delete mode 100644 src/resources/generated/credit_note_voided.rs delete mode 100644 src/resources/generated/customer.rs delete mode 100644 src/resources/generated/customer_balance_transaction.rs delete mode 100644 src/resources/generated/customer_cash_balance_transaction.rs delete mode 100644 src/resources/generated/customer_cash_balance_transaction_created.rs delete mode 100644 src/resources/generated/customer_created.rs delete mode 100644 src/resources/generated/customer_deleted.rs delete mode 100644 src/resources/generated/customer_discount_created.rs delete mode 100644 src/resources/generated/customer_discount_deleted.rs delete mode 100644 src/resources/generated/customer_discount_updated.rs delete mode 100644 src/resources/generated/customer_session.rs delete mode 100644 src/resources/generated/customer_source_created.rs delete mode 100644 src/resources/generated/customer_source_deleted.rs delete mode 100644 src/resources/generated/customer_source_expiring.rs delete mode 100644 src/resources/generated/customer_source_updated.rs delete mode 100644 src/resources/generated/customer_subscription_created.rs delete mode 100644 src/resources/generated/customer_subscription_deleted.rs delete mode 100644 src/resources/generated/customer_subscription_paused.rs delete mode 100644 src/resources/generated/customer_subscription_pending_update_applied.rs delete mode 100644 src/resources/generated/customer_subscription_pending_update_expired.rs delete mode 100644 src/resources/generated/customer_subscription_resumed.rs delete mode 100644 src/resources/generated/customer_subscription_trial_will_end.rs delete mode 100644 src/resources/generated/customer_subscription_updated.rs delete mode 100644 src/resources/generated/customer_tax_id_created.rs delete mode 100644 src/resources/generated/customer_tax_id_deleted.rs delete mode 100644 src/resources/generated/customer_tax_id_updated.rs delete mode 100644 src/resources/generated/customer_updated.rs delete mode 100644 src/resources/generated/dispute.rs delete mode 100644 src/resources/generated/ephemeral_key.rs delete mode 100644 src/resources/generated/event.rs delete mode 100644 src/resources/generated/exchange_rate.rs delete mode 100644 src/resources/generated/fee_refund.rs delete mode 100644 src/resources/generated/file.rs delete mode 100644 src/resources/generated/file_created.rs delete mode 100644 src/resources/generated/file_link.rs delete mode 100644 src/resources/generated/financial_connections_account.rs delete mode 100644 src/resources/generated/financial_connections_account_created.rs delete mode 100644 src/resources/generated/financial_connections_account_deactivated.rs delete mode 100644 src/resources/generated/financial_connections_account_disconnected.rs delete mode 100644 src/resources/generated/financial_connections_account_owner.rs delete mode 100644 src/resources/generated/financial_connections_account_ownership.rs delete mode 100644 src/resources/generated/financial_connections_account_reactivated.rs delete mode 100644 src/resources/generated/financial_connections_account_refreshed_balance.rs delete mode 100644 src/resources/generated/financial_connections_account_refreshed_transactions.rs delete mode 100644 src/resources/generated/financial_connections_session.rs delete mode 100644 src/resources/generated/financial_connections_transaction.rs delete mode 100644 src/resources/generated/funding_instructions.rs delete mode 100644 src/resources/generated/identity_verification_report.rs delete mode 100644 src/resources/generated/identity_verification_session.rs delete mode 100644 src/resources/generated/identity_verification_session_canceled.rs delete mode 100644 src/resources/generated/identity_verification_session_created.rs delete mode 100644 src/resources/generated/identity_verification_session_processing.rs delete mode 100644 src/resources/generated/identity_verification_session_redacted.rs delete mode 100644 src/resources/generated/identity_verification_session_requires_input.rs delete mode 100644 src/resources/generated/identity_verification_session_verified.rs delete mode 100644 src/resources/generated/invoice.rs delete mode 100644 src/resources/generated/invoice_created.rs delete mode 100644 src/resources/generated/invoice_deleted.rs delete mode 100644 src/resources/generated/invoice_finalization_failed.rs delete mode 100644 src/resources/generated/invoice_finalized.rs delete mode 100644 src/resources/generated/invoice_marked_uncollectible.rs delete mode 100644 src/resources/generated/invoice_paid.rs delete mode 100644 src/resources/generated/invoice_payment_action_required.rs delete mode 100644 src/resources/generated/invoice_payment_failed.rs delete mode 100644 src/resources/generated/invoice_payment_method_options_acss_debit.rs delete mode 100644 src/resources/generated/invoice_payment_method_options_bancontact.rs delete mode 100644 src/resources/generated/invoice_payment_method_options_customer_balance.rs delete mode 100644 src/resources/generated/invoice_payment_method_options_konbini.rs delete mode 100644 src/resources/generated/invoice_payment_method_options_us_bank_account.rs delete mode 100644 src/resources/generated/invoice_payment_succeeded.rs delete mode 100644 src/resources/generated/invoice_sent.rs delete mode 100644 src/resources/generated/invoice_setting_rendering_options.rs delete mode 100644 src/resources/generated/invoice_upcoming.rs delete mode 100644 src/resources/generated/invoice_updated.rs delete mode 100644 src/resources/generated/invoice_voided.rs delete mode 100644 src/resources/generated/invoiceitem_created.rs delete mode 100644 src/resources/generated/invoiceitem_deleted.rs delete mode 100644 src/resources/generated/invoices_shipping_cost.rs delete mode 100644 src/resources/generated/issuing_authorization.rs delete mode 100644 src/resources/generated/issuing_authorization_amount_details.rs delete mode 100644 src/resources/generated/issuing_authorization_created.rs delete mode 100644 src/resources/generated/issuing_authorization_request.rs delete mode 100644 src/resources/generated/issuing_authorization_updated.rs delete mode 100644 src/resources/generated/issuing_card.rs delete mode 100644 src/resources/generated/issuing_card_created.rs delete mode 100644 src/resources/generated/issuing_card_updated.rs delete mode 100644 src/resources/generated/issuing_cardholder.rs delete mode 100644 src/resources/generated/issuing_cardholder_created.rs delete mode 100644 src/resources/generated/issuing_cardholder_updated.rs delete mode 100644 src/resources/generated/issuing_dispute.rs delete mode 100644 src/resources/generated/issuing_dispute_closed.rs delete mode 100644 src/resources/generated/issuing_dispute_created.rs delete mode 100644 src/resources/generated/issuing_dispute_funds_reinstated.rs delete mode 100644 src/resources/generated/issuing_dispute_submitted.rs delete mode 100644 src/resources/generated/issuing_dispute_updated.rs delete mode 100644 src/resources/generated/issuing_token.rs delete mode 100644 src/resources/generated/issuing_token_created.rs delete mode 100644 src/resources/generated/issuing_token_updated.rs delete mode 100644 src/resources/generated/issuing_transaction.rs delete mode 100644 src/resources/generated/issuing_transaction_created.rs delete mode 100644 src/resources/generated/issuing_transaction_updated.rs delete mode 100644 src/resources/generated/item.rs delete mode 100644 src/resources/generated/line_item.rs delete mode 100644 src/resources/generated/linked_account_options_us_bank_account.rs delete mode 100644 src/resources/generated/login_link.rs delete mode 100644 src/resources/generated/mandate.rs delete mode 100644 src/resources/generated/mandate_updated.rs delete mode 100644 src/resources/generated/notification_event_data.rs delete mode 100644 src/resources/generated/payment_intent.rs delete mode 100644 src/resources/generated/payment_intent_amount_capturable_updated.rs delete mode 100644 src/resources/generated/payment_intent_canceled.rs delete mode 100644 src/resources/generated/payment_intent_created.rs delete mode 100644 src/resources/generated/payment_intent_next_action_cashapp_handle_redirect_or_display_qr_code.rs delete mode 100644 src/resources/generated/payment_intent_partially_funded.rs delete mode 100644 src/resources/generated/payment_intent_payment_failed.rs delete mode 100644 src/resources/generated/payment_intent_processing.rs delete mode 100644 src/resources/generated/payment_intent_requires_action.rs delete mode 100644 src/resources/generated/payment_intent_succeeded.rs delete mode 100644 src/resources/generated/payment_link.rs delete mode 100644 src/resources/generated/payment_link_created.rs delete mode 100644 src/resources/generated/payment_link_updated.rs delete mode 100644 src/resources/generated/payment_method.rs delete mode 100644 src/resources/generated/payment_method_attached.rs delete mode 100644 src/resources/generated/payment_method_automatically_updated.rs delete mode 100644 src/resources/generated/payment_method_card_present_networks.rs delete mode 100644 src/resources/generated/payment_method_config_biz_payment_method_configuration_details.rs delete mode 100644 src/resources/generated/payment_method_configuration.rs delete mode 100644 src/resources/generated/payment_method_detached.rs delete mode 100644 src/resources/generated/payment_method_details_card_installments_plan.rs delete mode 100644 src/resources/generated/payment_method_details_card_wallet_apple_pay.rs delete mode 100644 src/resources/generated/payment_method_details_card_wallet_google_pay.rs delete mode 100644 src/resources/generated/payment_method_domain.rs delete mode 100644 src/resources/generated/payment_method_options_customer_balance_eu_bank_account.rs delete mode 100644 src/resources/generated/payment_method_options_us_bank_account_mandate_options.rs delete mode 100644 src/resources/generated/payment_method_updated.rs delete mode 100644 src/resources/generated/payout.rs delete mode 100644 src/resources/generated/payout_canceled.rs delete mode 100644 src/resources/generated/payout_created.rs delete mode 100644 src/resources/generated/payout_failed.rs delete mode 100644 src/resources/generated/payout_paid.rs delete mode 100644 src/resources/generated/payout_reconciliation_completed.rs delete mode 100644 src/resources/generated/payout_updated.rs delete mode 100644 src/resources/generated/person.rs delete mode 100644 src/resources/generated/person_created.rs delete mode 100644 src/resources/generated/person_deleted.rs delete mode 100644 src/resources/generated/person_updated.rs delete mode 100644 src/resources/generated/placeholders.rs delete mode 100644 src/resources/generated/plan.rs delete mode 100644 src/resources/generated/plan_created.rs delete mode 100644 src/resources/generated/plan_deleted.rs delete mode 100644 src/resources/generated/plan_updated.rs delete mode 100644 src/resources/generated/platform_tax_fee.rs delete mode 100644 src/resources/generated/price.rs delete mode 100644 src/resources/generated/price_created.rs delete mode 100644 src/resources/generated/price_deleted.rs delete mode 100644 src/resources/generated/price_updated.rs delete mode 100644 src/resources/generated/product_created.rs delete mode 100644 src/resources/generated/product_deleted.rs delete mode 100644 src/resources/generated/product_updated.rs delete mode 100644 src/resources/generated/promotion_code.rs delete mode 100644 src/resources/generated/promotion_code_created.rs delete mode 100644 src/resources/generated/promotion_code_updated.rs delete mode 100644 src/resources/generated/quote.rs delete mode 100644 src/resources/generated/quote_accepted.rs delete mode 100644 src/resources/generated/quote_canceled.rs delete mode 100644 src/resources/generated/quote_created.rs delete mode 100644 src/resources/generated/quote_finalized.rs delete mode 100644 src/resources/generated/quotes_resource_total_details.rs delete mode 100644 src/resources/generated/radar_early_fraud_warning_created.rs delete mode 100644 src/resources/generated/radar_early_fraud_warning_updated.rs delete mode 100644 src/resources/generated/radar_value_list.rs delete mode 100644 src/resources/generated/radar_value_list_item.rs delete mode 100644 src/resources/generated/refund.rs delete mode 100644 src/resources/generated/refund_created.rs delete mode 100644 src/resources/generated/refund_updated.rs delete mode 100644 src/resources/generated/reporting_report_run.rs delete mode 100644 src/resources/generated/reporting_report_run_failed.rs delete mode 100644 src/resources/generated/reporting_report_run_succeeded.rs delete mode 100644 src/resources/generated/reporting_report_type.rs delete mode 100644 src/resources/generated/reporting_report_type_updated.rs delete mode 100644 src/resources/generated/reserve_transaction.rs delete mode 100644 src/resources/generated/review.rs delete mode 100644 src/resources/generated/review_closed.rs delete mode 100644 src/resources/generated/review_opened.rs delete mode 100644 src/resources/generated/scheduled_query_run.rs delete mode 100644 src/resources/generated/setup_attempt.rs delete mode 100644 src/resources/generated/setup_intent.rs delete mode 100644 src/resources/generated/setup_intent_canceled.rs delete mode 100644 src/resources/generated/setup_intent_created.rs delete mode 100644 src/resources/generated/setup_intent_requires_action.rs delete mode 100644 src/resources/generated/setup_intent_setup_failed.rs delete mode 100644 src/resources/generated/setup_intent_succeeded.rs delete mode 100644 src/resources/generated/shipping_rate.rs delete mode 100644 src/resources/generated/sigma_scheduled_query_run_created.rs delete mode 100644 src/resources/generated/source.rs delete mode 100644 src/resources/generated/source_canceled.rs delete mode 100644 src/resources/generated/source_chargeable.rs delete mode 100644 src/resources/generated/source_failed.rs delete mode 100644 src/resources/generated/source_mandate_notification.rs delete mode 100644 src/resources/generated/source_refund_attributes_required.rs delete mode 100644 src/resources/generated/source_transaction.rs delete mode 100644 src/resources/generated/source_transaction_created.rs delete mode 100644 src/resources/generated/source_transaction_updated.rs delete mode 100644 src/resources/generated/subscription.rs delete mode 100644 src/resources/generated/subscription_item.rs delete mode 100644 src/resources/generated/subscription_item_billing_thresholds.rs delete mode 100644 src/resources/generated/subscription_schedule.rs delete mode 100644 src/resources/generated/subscription_schedule_aborted.rs delete mode 100644 src/resources/generated/subscription_schedule_canceled.rs delete mode 100644 src/resources/generated/subscription_schedule_completed.rs delete mode 100644 src/resources/generated/subscription_schedule_created.rs delete mode 100644 src/resources/generated/subscription_schedule_expiring.rs delete mode 100644 src/resources/generated/subscription_schedule_released.rs delete mode 100644 src/resources/generated/subscription_schedule_updated.rs delete mode 100644 src/resources/generated/subscriptions_trials_resource_trial_settings.rs delete mode 100644 src/resources/generated/tax_calculation.rs delete mode 100644 src/resources/generated/tax_calculation_line_item.rs delete mode 100644 src/resources/generated/tax_code.rs delete mode 100644 src/resources/generated/tax_deducted_at_source.rs delete mode 100644 src/resources/generated/tax_id.rs delete mode 100644 src/resources/generated/tax_product_resource_customer_details.rs delete mode 100644 src/resources/generated/tax_rate.rs delete mode 100644 src/resources/generated/tax_rate_created.rs delete mode 100644 src/resources/generated/tax_rate_updated.rs delete mode 100644 src/resources/generated/tax_registration.rs delete mode 100644 src/resources/generated/tax_settings.rs delete mode 100644 src/resources/generated/tax_settings_updated.rs delete mode 100644 src/resources/generated/tax_transaction.rs delete mode 100644 src/resources/generated/tax_transaction_line_item.rs delete mode 100644 src/resources/generated/terminal_configuration.rs delete mode 100644 src/resources/generated/terminal_connection_token.rs delete mode 100644 src/resources/generated/terminal_location.rs delete mode 100644 src/resources/generated/terminal_reader.rs delete mode 100644 src/resources/generated/terminal_reader_action_failed.rs delete mode 100644 src/resources/generated/terminal_reader_action_succeeded.rs delete mode 100644 src/resources/generated/test_helpers_test_clock.rs delete mode 100644 src/resources/generated/test_helpers_test_clock_advancing.rs delete mode 100644 src/resources/generated/test_helpers_test_clock_created.rs delete mode 100644 src/resources/generated/test_helpers_test_clock_deleted.rs delete mode 100644 src/resources/generated/test_helpers_test_clock_internal_failure.rs delete mode 100644 src/resources/generated/test_helpers_test_clock_ready.rs delete mode 100644 src/resources/generated/token.rs delete mode 100644 src/resources/generated/topup.rs delete mode 100644 src/resources/generated/topup_canceled.rs delete mode 100644 src/resources/generated/topup_created.rs delete mode 100644 src/resources/generated/topup_failed.rs delete mode 100644 src/resources/generated/topup_reversed.rs delete mode 100644 src/resources/generated/topup_succeeded.rs delete mode 100644 src/resources/generated/transfer.rs delete mode 100644 src/resources/generated/transfer_created.rs delete mode 100644 src/resources/generated/transfer_reversal.rs delete mode 100644 src/resources/generated/transfer_reversed.rs delete mode 100644 src/resources/generated/transfer_updated.rs delete mode 100644 src/resources/generated/treasury_credit_reversal.rs delete mode 100644 src/resources/generated/treasury_credit_reversal_created.rs delete mode 100644 src/resources/generated/treasury_credit_reversal_posted.rs delete mode 100644 src/resources/generated/treasury_debit_reversal.rs delete mode 100644 src/resources/generated/treasury_debit_reversal_completed.rs delete mode 100644 src/resources/generated/treasury_debit_reversal_created.rs delete mode 100644 src/resources/generated/treasury_debit_reversal_initial_credit_granted.rs delete mode 100644 src/resources/generated/treasury_financial_account.rs delete mode 100644 src/resources/generated/treasury_financial_account_closed.rs delete mode 100644 src/resources/generated/treasury_financial_account_created.rs delete mode 100644 src/resources/generated/treasury_financial_account_features.rs delete mode 100644 src/resources/generated/treasury_financial_account_features_status_updated.rs delete mode 100644 src/resources/generated/treasury_financial_accounts_resource_ach_toggle_settings.rs delete mode 100644 src/resources/generated/treasury_financial_accounts_resource_toggle_settings.rs delete mode 100644 src/resources/generated/treasury_inbound_transfer.rs delete mode 100644 src/resources/generated/treasury_inbound_transfer_canceled.rs delete mode 100644 src/resources/generated/treasury_inbound_transfer_created.rs delete mode 100644 src/resources/generated/treasury_inbound_transfer_failed.rs delete mode 100644 src/resources/generated/treasury_inbound_transfer_succeeded.rs delete mode 100644 src/resources/generated/treasury_outbound_payment.rs delete mode 100644 src/resources/generated/treasury_outbound_payment_canceled.rs delete mode 100644 src/resources/generated/treasury_outbound_payment_created.rs delete mode 100644 src/resources/generated/treasury_outbound_payment_expected_arrival_date_updated.rs delete mode 100644 src/resources/generated/treasury_outbound_payment_failed.rs delete mode 100644 src/resources/generated/treasury_outbound_payment_posted.rs delete mode 100644 src/resources/generated/treasury_outbound_payment_returned.rs delete mode 100644 src/resources/generated/treasury_outbound_transfer.rs delete mode 100644 src/resources/generated/treasury_outbound_transfer_canceled.rs delete mode 100644 src/resources/generated/treasury_outbound_transfer_created.rs delete mode 100644 src/resources/generated/treasury_outbound_transfer_expected_arrival_date_updated.rs delete mode 100644 src/resources/generated/treasury_outbound_transfer_failed.rs delete mode 100644 src/resources/generated/treasury_outbound_transfer_posted.rs delete mode 100644 src/resources/generated/treasury_outbound_transfer_returned.rs delete mode 100644 src/resources/generated/treasury_received_credit.rs delete mode 100644 src/resources/generated/treasury_received_credit_created.rs delete mode 100644 src/resources/generated/treasury_received_credit_failed.rs delete mode 100644 src/resources/generated/treasury_received_credit_succeeded.rs delete mode 100644 src/resources/generated/treasury_received_debit.rs delete mode 100644 src/resources/generated/treasury_received_debit_created.rs delete mode 100644 src/resources/generated/treasury_shared_resource_billing_details.rs delete mode 100644 src/resources/generated/treasury_shared_resource_initiating_payment_method_details_initiating_payment_method_details.rs delete mode 100644 src/resources/generated/treasury_transaction.rs delete mode 100644 src/resources/generated/treasury_transaction_entry.rs delete mode 100644 src/resources/generated/treasury_transactions_resource_flow_details.rs delete mode 100644 src/resources/generated/usage_record.rs delete mode 100644 src/resources/generated/usage_record_summary.rs delete mode 100644 src/resources/generated/version.rs delete mode 100644 src/resources/generated/webhook_endpoint.rs delete mode 100644 src/resources/invoice_ext.rs delete mode 100644 src/resources/issuing_authorization_ext.rs delete mode 100644 src/resources/issuing_card_ext.rs delete mode 100644 src/resources/issuing_dispute_ext.rs delete mode 100644 src/resources/issuing_merchant_data.rs delete mode 100644 src/resources/issuing_transaction_ext.rs delete mode 100644 src/resources/line_item_ext.rs delete mode 100644 src/resources/login_links_ext.rs delete mode 100644 src/resources/order_ext.rs delete mode 100644 src/resources/payment_intent_ext.rs delete mode 100644 src/resources/payment_method_ext.rs delete mode 100644 src/resources/payment_source.rs delete mode 100644 src/resources/payout_ext.rs delete mode 100644 src/resources/placeholders.rs delete mode 100644 src/resources/price_ext.rs delete mode 100644 src/resources/product_ext.rs delete mode 100644 src/resources/review_ext.rs delete mode 100644 src/resources/setup_intent_ext.rs delete mode 100644 src/resources/source_ext.rs delete mode 100644 src/resources/subscription_ext.rs delete mode 100644 src/resources/token_ext.rs delete mode 100644 src/resources/transfer_reversal_ext.rs delete mode 100644 src/resources/types.rs delete mode 100644 src/resources/usage_record_ext.rs delete mode 100644 src/resources/webhook_endpoint_ext.rs delete mode 100644 src/resources/webhook_events.rs delete mode 100644 stripe.json create mode 100644 stripe_types/Cargo.toml rename {src/resources => stripe_types/src}/currency.rs (92%) create mode 100644 stripe_types/src/expandable.rs create mode 100644 stripe_types/src/ids.rs create mode 100644 stripe_types/src/lib.rs create mode 100644 stripe_types/src/pagination.rs create mode 100644 stripe_types/src/params.rs create mode 100644 stripe_webhook/Cargo.toml create mode 100644 stripe_webhook/src/error.rs create mode 100644 stripe_webhook/src/generated/mod.rs create mode 100644 stripe_webhook/src/lib.rs create mode 100644 stripe_webhook/src/webhook.rs create mode 100644 tests/Cargo.toml delete mode 100644 tests/account.rs delete mode 100644 tests/charge.rs delete mode 100644 tests/checkout.rs delete mode 100644 tests/customer.rs delete mode 100644 tests/mock/mod.rs delete mode 100644 tests/plan_interval.rs delete mode 100644 tests/subscription.rs delete mode 100644 tests/subscription_item.rs create mode 100644 tests/tests/it/async_tests/mod.rs create mode 100644 tests/tests/it/async_tests/pagination.rs create mode 100644 tests/tests/it/blocking/account.rs create mode 100644 tests/tests/it/blocking/charge.rs create mode 100644 tests/tests/it/blocking/checkout.rs create mode 100644 tests/tests/it/blocking/customer.rs create mode 100644 tests/tests/it/blocking/invoice.rs create mode 100644 tests/tests/it/blocking/mod.rs create mode 100644 tests/tests/it/blocking/plan_interval.rs create mode 100644 tests/tests/it/blocking/price.rs create mode 100644 tests/tests/it/blocking/product.rs create mode 100644 tests/tests/it/blocking/promotion_code.rs create mode 100644 tests/tests/it/blocking/subscription.rs create mode 100644 tests/tests/it/blocking/subscription_item.rs create mode 100644 tests/tests/it/blocking/token.rs create mode 100644 tests/tests/it/blocking/transfer_reversal.rs rename tests/{encoding.rs => tests/it/deser.rs} (61%) create mode 100644 tests/tests/it/main.rs create mode 100644 tests/tests/it/mock.rs create mode 100644 tests/tests/it/pagination_utils.rs rename tests/{ => tests/it}/price.rs (95%) diff --git a/.github/workflows/async-stripe.yml b/.github/workflows/async-stripe.yml index 9e9cd68a3..09f83a19b 100644 --- a/.github/workflows/async-stripe.yml +++ b/.github/workflows/async-stripe.yml @@ -6,52 +6,70 @@ on: pull_request: branches: - master + +env: + RUSTFLAGS: -Dwarnings + rust_min: 1.68 + jobs: format: - runs-on: ubuntu-20.04 + runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 - - uses: actions-rs/toolchain@v1 + - name: Checkout sources + uses: actions/checkout@v3 + + - name: Install toolchain + uses: dtolnay/rust-toolchain@nightly with: - profile: minimal - toolchain: nightly components: rustfmt - - uses: davidB/rust-cargo-make@v1 - - name: regenerate openapi - uses: actions-rs/cargo@v1 - with: - command: make - args: check - verify-codegen: - runs-on: ubuntu-20.04 + - name: Check formatting for workspace + run: cargo fmt --all -- --check + + verify-codegen-crate: + runs-on: ubuntu-latest + defaults: + run: + working-directory: openapi + steps: - - uses: actions/checkout@v2 - - uses: actions-rs/toolchain@v1 + - name: Checkout sources + uses: actions/checkout@v3 + + - name: Install nightly toolchain + uses: dtolnay/rust-toolchain@nightly with: - profile: minimal - toolchain: nightly components: rustfmt - - uses: davidB/rust-cargo-make@v1 - - name: regenerate openapi - uses: actions-rs/cargo@v1 + + - name: Check formatting + run: cargo +nightly fmt -- --check + + - name: Install toolchain + uses: dtolnay/rust-toolchain@stable with: - command: make - args: openapi-install - - name: ensure generated files unchanged + components: clippy + + - name: Run clippy + run: cargo clippy + + - name: Run codegen + run: cargo run --release -- --fetch current + + - name: Ensure generated files unchanged uses: tj-actions/verify-changed-files@v11.1 id: verify-changed-files with: files: | **/*.rs - - name: report changed files + + - name: Report changed files if: steps.verify-changed-files.outputs.files_changed == 'true' run: | echo "Some files changed after code generation: ${{ steps.verify-changed-files.outputs.changed_files }}" exit 1 clippy: - runs-on: ubuntu-20.04 + runs-on: ubuntu-latest strategy: matrix: runtime: @@ -65,29 +83,22 @@ jobs: blocking-rustls-webpki, ] steps: - - uses: actions/checkout@v2 - - uses: actions-rs/toolchain@v1 + - name: Checkout sources + uses: actions/checkout@v3 + + - name: Install Rust + uses: dtolnay/rust-toolchain@stable with: - profile: minimal - toolchain: stable + toolchain: ${{ env.rust_min }} components: clippy - - uses: actions/cache@v2 - with: - path: | - ~/.cargo/registry - ~/.cargo/git - target - key: ${{ runner.os }}-clippy-${{ matrix.runtime }}-${{ hashFiles('**/Cargo.lock') }} - - uses: actions-rs/cargo@v1 - with: - command: clippy - args: > - --no-default-features - --features runtime-${{ matrix.runtime }} + + - uses: Swatinem/rust-cache@v2 + + - name: Run clippy + run: cargo clippy --features "runtime-${{ matrix.runtime }} full" + test: - runs-on: ubuntu-20.04 - env: - RUSTFLAGS: -D warnings + runs-on: ubuntu-latest strategy: matrix: runtime: @@ -107,31 +118,54 @@ jobs: - 12111:12111 - 12112:12112 steps: - - uses: actions/checkout@v2 - - uses: actions-rs/toolchain@v1 + - uses: actions/checkout@v3 + + - name: Install Rust + uses: dtolnay/rust-toolchain@stable with: - profile: minimal - toolchain: "1.68.0" - override: true - - uses: actions/cache@v2 + toolchain: ${{ env.rust_min }} + + - uses: Swatinem/rust-cache@v2 + + - uses: taiki-e/install-action@cargo-llvm-cov + - name: Test and gather coverage + run: cargo llvm-cov --lcov --output-path lcov.info --features runtime-${{ matrix.runtime }} + - name: Upload to codecov.io + uses: codecov/codecov-action@v2.1.0 + with: + token: ${{secrets.CODECOV_TOKEN}} + files: lcov.info + - name: Archive code coverage results + uses: actions/upload-artifact@v1 with: - path: | - ~/.cargo/registry - ~/.cargo/git - target - key: ${{ runner.os }}-test-${{ matrix.runtime }}-${{ hashFiles('**/Cargo.lock') }} - - name: Test - run: cargo test --features runtime-${{ matrix.runtime }} - # - uses: taiki-e/install-action@cargo-llvm-cov - # - name: Test and gather coverage - # run: cargo llvm-cov --lcov --output-path lcov.info --features runtime-${{ matrix.runtime }} - # - name: Upload to codecov.io - # uses: codecov/codecov-action@v2.1.0 - # with: - # token: ${{secrets.CODECOV_TOKEN}} - # files: lcov.info - # - name: Archive code coverage results - # uses: actions/upload-artifact@v1 - # with: - # name: code-coverage-report - # path: lcov.info + name: code-coverage-report + path: lcov.info + + docs: + name: Docs + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + + - name: Install Rust + uses: dtolnay/rust-toolchain@stable + + - uses: Swatinem/rust-cache@v2 + + - name: Build Documentation + run: cargo doc --lib --no-deps --features "runtime-tokio-hyper full" + + # Examples tested separately so that we can use crates which don't match our MSRV + examples: + name: Check Examples + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + + - name: Install Rust + uses: dtolnay/rust-toolchain@stable + + - uses: Swatinem/rust-cache@v2 + + - name: Check examples + run: cargo clippy --features "runtime-tokio-hyper-rustls" --workspace diff --git a/.github/workflows/openapi.yml b/.github/workflows/openapi.yml index 084b67132..411dbe45c 100644 --- a/.github/workflows/openapi.yml +++ b/.github/workflows/openapi.yml @@ -7,55 +7,24 @@ jobs: update-openapi: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 - - name: Install minimal nightly with rustfmt - uses: actions-rs/toolchain@v1 + - uses: actions/checkout@v3 + + - name: Install Rust with rustfmt + uses: dtolnay/rust-toolchain@nightly with: - profile: minimal - toolchain: nightly components: rustfmt - - uses: davidB/rust-cargo-make@v1 - - name: regenerate openapi - uses: actions-rs/cargo@v1 - with: - command: make - args: openapi-install-latest - - name: verify - id: verify - # currently waiting for https://github.com/actions-rs/cargo/pull/206 - # so we use this in the mean time - uses: arlyon/cargo@v1.0.4 - with: - command: make - args: verify - - name: duplicates - id: duplicates - # currently waiting for https://github.com/actions-rs/cargo/pull/206 - # so we use this in the mean time - uses: arlyon/cargo@v1.0.4 - with: - command: make - args: duplicates + + - name: Run Codegen + run: cargo run --release -- --fetch latest + - name: create pull request uses: peter-evans/create-pull-request@v3 with: token: ${{ secrets.REPO_SCOPED_TOKEN }} - commit-message: "feat: generate latest changes from OpenApi spec" + commit-message: Generate latest changes from OpenApi spec title: Generate latest changes from OpenApi spec body: | This is an automated PR that tries to build the latest changes generated from the [Stripe OpenApi spec](https://github.com/stripe/openapi). - - Here are the missing exports: - - ``` - ${{ steps.verify.outputs.stdout }} - ``` - - Here are the duplicate exports: - - ``` - ${{ steps.duplicates.outputs.stdout }} - ``` branch: openapi branch-suffix: timestamp reviewers: arlyon diff --git a/.gitignore b/.gitignore index fe20ccef7..d37a3e254 100644 --- a/.gitignore +++ b/.gitignore @@ -5,6 +5,7 @@ Cargo.lock # Test artifacts stripe-mock/ +lcov.info # IDE artifacts .DS_Store diff --git a/CHANGELOG.md b/CHANGELOG.md index c27ec97c9..23f92cc34 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,179 @@ +# Unreleased changes (release date TBD) + +## Breaking Changes + +This release overhauls the code generation process to achieve near-complete coverage of the Stripe API +(https://github.com/arlyon/async-stripe/issues/32). To avoid further bloating compile times, it also includes +crates splitting. Consequently, __there are many breaking changes in this release__. If you have any trouble updating to this release or want help with it, please file an issue! There +will likely be multiple release candidates, so suggestions are welcome for ways to improve ergonomics along the release candidate trail. This release +should not regress compile times, but will not improve them. However, it paves the way for upcoming improvements! + +### Request Migration +The main breaking changes center around crate splitting and naming. Please see the [README](README.md#relevant-crates) for a +more detailed overview of the new crate structure. In short, instead of one `async-stripe` crate, there is now: +- `async-stripe`: A client for making Stripe requests +- `stripe-*`: A collection of crates implementing requests for different subsets of the Stripe API + +So while client initialization is unchanged, making a request requires the following general migration: + +#### Before +`Cargo.toml` +```toml +async-stripe = { version = "0.28", features = ["runtime-tokio-hyper", "core"] } +``` + +```rust +use stripe::{Client, CreateCustomer, Customer}; + +async fn create_customer(client: &Client) -> Result<(), stripe::Error> { + let customer = Customer::create( + &client, + CreateCustomer { + email: Some("test@async-stripe.com"), + ..Default::default() + }, + ).await?; + Ok(()) +} +``` + +#### After +`Cargo.toml` +```toml +async-stripe = { version = "TBD", features = ["runtime-tokio-hyper"] } +# Note the addition of the `customer` feature as well - each object in the Stripe API +# now has its related requests feature-gated. +stripe-core = { version = "TBD", features = ["runtime-tokio-hyper", "customer"] } +``` + +```rust +use stripe::Client; +use stripe_core::customer::CreateCustomer; + +async fn create_customer(client: &Client) -> Result<(), stripe::Error> { + let customer = CreateCustomer { + email: Some("test@async-stripe.com"), + ..Default::default() + } + .send(client) + .await?; + Ok(()) +} +``` + +The locations where such a migration is necessary are most easily found due to compiler errors on upgrading. Information +on determining the crate a request lives in can be found in the [README](README.md#stripe-request-crates). The +general steps will be: +1. Find the required crate and feature for the request by [searching here](crate_info.md) +2. Using `Account` and `create` as an example, convert the general structure: + - `Account::create(&client, CreateAccount::new()).await` to `CreateAccount::new().send(&client).await` +3. Resolve any parameter name changes (with help from autocompletion or the docs). Naming should hopefully be more +consistent and there will no longer be cases of duplicate names (https://github.com/arlyon/async-stripe/issues/154) + + +### Webhook Improvements +The generated webhook `EventObject` now takes advantage of explicit webhook object types +exposed in the OpenAPI spec. This allows keeping generated definitions up to date with the latest +events more easily. Destructuring `EventObject` now directly gives the inner object type, rather +than requiring matching on both `EventType` and `EventObject`. See the migration example below for how +usage changes. + +#### Before +```rust +use stripe::{EventType, EventObject}; + +fn handle_webhook_event(event: stripe::Event) { + match event.type_ { + EventType::CheckoutSessionCompleted => { + if let EventObject::CheckoutSession(session) = event.data.object { + println!("Checkout session completed! {session:?}"); + } else { + // How should we handle an unexpected object for this event type? + println!("Unexpected object for checkout event"); + } + } + _ => {}, + } +} +``` + +#### After +```rust +use stripe_webhook::{Event, EventObject}; + +fn handle_webhook_event(event: stripe::Event) { + match event.data.object { + EventObject::CheckoutSessionCompleted(session) => { + println!("Checkout session completed! {session:?}"); + } + _ => {}, + } +} + +``` +The same examples for use with `axum`, `actix-web`, and `rocket` can be found in the [examples](/examples) folder. +Instead of importing from `stripe` and enabling the `webhook` feature, you should include the dependency +`stripe_webhook` and import from that crate instead. + +### Generated Type Definitions +- `Deleted<>` objects (such `Deleted`) no longer expose a boolean `deleted`. This was always `true` and only +used internally as a discriminant when deserializing. The generic type `Deleted` has been removed and replaced by +generated types such as `DeletedAccount`, which sometimes contain additional fields. +- Optional `List` no longer deserialized with `serde(default)`, the type has been changed `List` -> `Option>`. The default +implementation of `List` produced data not upholding the `List` invariant of having a meaningful `url`. +- Types used only for requests now use borrowed types more consistently (and more often). For example, previously the top-level +`CreateCustomer.description` expected `Option<&str>`, but `CreateCustomerShipping.phone` expected `Option`. Now +both expect `Option<&str>`. In general, the following changes are made to request parameters that required owned data: + - `String` -> `&str` + - `Metadata` (alias for `HashMap`) -> `&HashMap` + - `Vec<>` -> `&[<>]` + +### Pagination +The required migration is similar to the [migration](#request-migration) for other requests. The main changes +are around parameter handling to avoid lifetime issues (https://github.com/arlyon/async-stripe/issues/246). + +Additionally, obtaining a paginable stream no longer requires a separate request for the first page. `paginate` can +be called directly on `List*` parameters. + +#### Before +``` +let params = ListCustomers::new(); +let mut stream = Customer::list(&client, ¶ms).await?.paginate(params); +// ...Any desired stream operations +``` + +#### After +``` +let mut stream = ListAccount::new().paginate().stream(&client) +// ...Any desired stream operations +``` + +### Other Breaking Changes +- Enums no longer implement `Default` (the OpenAPI spec does not specify that a specific variant should be preferred.) +- Some more complex definitions of `*Id` have been relaxed. This should not affect general usage treating +such types as opaque identifiers, but types such as `PaymentSourceId` now just are a newtype wrapper around a `String`. This +change was made to both simplify code generation, and avoid deserialization errors due to missing +or changed prefix specifications (which was common since the Stripe API does not consider this a [breaking change](https://stripe.com/docs/upgrades#what-changes-does-stripe-consider-to-be-backwards-compatible). +- To minimize compile time, deserialization implementations are limited to where they are necessary. Previously, +some nested parameter types (such as `CreateAccountDocuments`, but not `CreateAccount`) would provide deserialization +implementations. Please let us know if such implementations are useful, and they could be added under a feature flag. +- Types related to the errors Stripe returns now use generated types, which should ensure +they stay up to date, preventing errors error deserialization errors like (https://github.com/arlyon/async-stripe/issues/381) and (https://github.com/arlyon/async-stripe/issues/384) + - The main user-facing change will be `StripeError::Stripe(RequestError)` -> `StripeError::Stripe(ApiErrors, StatusCode)` since the autogenerated `ApiErrors` + does not include the status code. +- The `id` method on `Expandable` now returns a reference: `&T::Id`. All id types implement `Clone` so +to achieve the previous behavior, use `.id().clone()`. +- Removed the `AsRef` implementation for enums, use `as_str` instead. + +Since most of these changes are related to code generation, it is likely there are some +breaking changes we missed here. If so, please open an issue (especially for changes that degrade library ergonomics). + +### Non-breaking Changes +- `List<>` types now are paginable. This allows usage such as paginating the external accounts returned +as `List` from retrieving an account. +- `SearchList<>` types are now paginable. +- The `smart-default` dependency was removed. + ## [0.34.2](https://github.com/arlyon/async-stripe/compare/v0.34.1...v0.34.2) (2024-02-21) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 11cdcc5f8..151190786 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -3,7 +3,7 @@ 1. Fork it! 2. Create your feature branch: `git checkout -b my-new-feature` 3. Test it: `cargo test --features runtime-blocking` -4. Lint it: `cargo +nightly clippy --all --all-targets -- -D warnings` +4. Lint it: `cargo clippy --workspace -- -D warnings` 5. Commit your changes: `git commit -am 'Add some feature'` 6. Push to the branch: `git push origin my-new-feature` 7. Submit a pull request :D @@ -48,21 +48,26 @@ It is expected that code is uniformly formatted. Before submitting code, make su to run `cargo fmt` to make sure it conforms to the standard. ## Code Generation - This library is (mostly) authored via code generation by parsing the OpenAPI specification for Stripe. -To automatically update the generated code, copy it into the `generated` folder, and format, use the `cargo make` target -`openapi-install`. This will also fetch the spec matching the OpenAPI release used for the generated -code on `master`. - +It consists of 3 main pieces: +- `async-stripe`: The definition of the `Stripe` client +- `stripe_types`: Core type definitions, used a ton in generated code +- `generated/*`: Generated crates which implement `Stripe` API requests and related types. +- `stripe_webhook`: Glue code for parsing and validating `Stripe` webhook events and generated +code for deserializing the events themselves. + +No changes should be made to code in a `generated/*` folder. If you'd like to change that +code, please see the `README` in the `openapi` crate which explains the code generation process +in more detail. + +If you'd like to update the version of the OpenAPI specification being used to generated code, you +can run (in the `openapi` directory) ```sh -cargo make openapi-install +cargo run --release -- --fetch latest ``` -To instead update the generated code using the latest OpenAPI specification release, use - -```sh -cargo make openapi-install-latest -``` +This will automatically pull the latest OpenAPI spec, generate new code, format it, and copy it into +library. ## Testing @@ -78,15 +83,3 @@ cargo test --features runtime-blocking It is encouraged to open an issue before you create a PR as a place for pre-implementation discussion. If you're unsure about your contribution or simply want to ask a question about anything just open an issue and we'll chat. - -## Architecture - -This project makes wide use of code generation, with API types generated directly from the stripe -openapi spec. This is what the openapi tool does. All generated code ends up in the handily named -generated folder which is exposed based on features specified. - -In some cases, it is helpful to have additional logic associated with a datatype to, for example, -capture a create `Charge` object. This additional impl goes in the `charge_ext.rs` file in the -`resources` folder, to provide a clean seperation between generated and hand maintained files. -If you notice that logic is missing, please add it to (or create) the appropriate `ext` file. - diff --git a/Cargo.toml b/Cargo.toml index 646319a5a..eb7f3960b 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,19 +1,30 @@ [workspace] members = [ - ".", - "openapi", - "bench/binary_size" -] - -[package] -name = "async-stripe" -version = "0.34.2" + "async-stripe", + "stripe_types", + "stripe_webhook", + "tests", + "generated/*", + "examples/*", +] + +# Skip "examples/*" when running default commands since that adds a bunch of deps that makes +# development feedback loop slower +default-members = ["async-stripe", "stripe_types", "stripe_webhook", "tests", "generated/*"] +resolver = "2" +# Makes dependency management simpler to allow codegen crate to use whichever dep versions +# it wants without affecting dependency resolution of the user-facing library crates +exclude = ["openapi"] + +[workspace.package] +version = "0.22.2" description = "API bindings for the Stripe HTTP API" rust-version = "1.68.0" authors = [ - "Anna Baldwin ", - "Kevin Stenerson ", - "Alexander Lyon ", + "Anna Baldwin ", + "Kevin Stenerson ", + "Alexander Lyon ", + "Matthew Zeitlin " ] license = "MIT OR Apache-2.0" readme = "README.md" @@ -24,182 +35,8 @@ keywords = ["stripe", "v1", "api", "async"] categories = ["api-bindings"] edition = "2021" -[package.metadata.docs.rs] -features = ["runtime-tokio-hyper"] - -[lib] -name = "stripe" - -[features] -default = ["full", "webhook-events", "uuid", "stream"] -full = [ - "checkout", - "billing", - "connect", - "fraud", - "issuing", - "orders", - "sigma", - "terminal", - "webhook-endpoints", - "tax-calculation", - "products", -] - -stream = [] - -# stripe feature groups -checkout = ["billing"] -billing = [] -connect = [] -fraud = [] -issuing = [] -orders = [] -sigma = [] -terminal = [] -webhook-endpoints = [] -tax-calculation = [] -products = [] - -# deserialize events from webhooks -webhook-events = ["events", "hmac", "sha2", "chrono", "hex"] -events = [] - -# runtimes -async = ["futures-util"] -blocking = [] - -runtime-tokio-hyper = [ - "tokio", - "hyper-client", - "hyper-tls", - "async", -] -runtime-tokio-hyper-rustls = [ - "tokio", - "hyper-client", - "hyper-rustls", - "hyper-rustls-native", - "async", -] -runtime-tokio-hyper-rustls-webpki = [ - "tokio", - "hyper-client", - "hyper-rustls-webpki", - "async", -] -runtime-blocking = [ - "tokio", - "tokio/rt", - "hyper-client", - "hyper-tls", - "blocking", -] -runtime-blocking-rustls = [ - "tokio", - "tokio/rt", - "hyper-client", - "hyper-rustls-native", - "blocking", -] -runtime-blocking-rustls-webpki = [ - "tokio", - "tokio/rt", - "hyper-client", - "hyper-rustls-webpki", - "blocking", -] -runtime-async-std-surf = [ - "async-std", - "surf", - "async", -] - -# we need the compat crate if using hyper -hyper-client = ["hyper", "http-types/hyperium_http"] - -hyper-rustls-native = ["hyper-rustls", "hyper-rustls/native-tokio"] -hyper-rustls-webpki = ["hyper-rustls", "hyper-rustls/webpki-tokio"] - -[dependencies] -async-std = {version = "1.8,<1.11", optional = true} - -chrono = { version = "0.4", default-features = false, features = ["serde", "clock"], optional = true } -thiserror = "1.0.24" -http-types = { version = "2.12.0", default-features = false } -hyper = { version = "0.14", default-features = false, features = ["http1", "http2", "client", "tcp"], optional = true } -hyper-tls = { version = "0.5", optional = true } -hyper-rustls = { version = "0.24", default-features = false, features = ["http1", "http2", "tls12", "logging"], optional = true } +[workspace.dependencies] serde = {version = ">=1.0.79", features = ["derive"] } # we use `serde(other)` which was introduced in 1.0.79 -serde_json = "1.0" -serde_qs = "0.10.1" -serde_path_to_error = "0.1.8" -smol_str = "0.1" -surf = { version = "2.1", optional = true } -tokio = { version = "1", optional = true } -smart-default = "0.6.0" -uuid = { version = "0.8", optional=true, features=["v4"] } - -# stream for lists -futures-util = { version = "0.3.21", optional = true } - -# webhook support -hmac = { version = "0.12", optional = true } -sha2 = { version = "0.10", optional = true } -hex = { version = "0.4", optional = true } - -rocket = { version = "0.4", optional = true } - -[dev-dependencies] -async-std = { version = "1.10.0", features = ["attributes"] } -httpmock = "0.6.6" -tokio = { version = "1.24.1", features = ["rt", "macros"] } -axum = { version = "0.7.4", features = ["macros"] } -async-trait = "0.1" -actix-web = "4.2.1" - -# MSRV PINS -# -# We have a few deps that have MSRVs that are higher than our own. -# We pin them here to ensure that we can run tests on the MSRV -bumpalo = ">=3.0.0, <= 3.15.0" - -[[example]] -name = "checkout" -required-features = ["async"] - -[[example]] -name = "connect" -required-features = ["async"] - -[[example]] -name = "customer" -required-features = ["async"] - -[[example]] -name = "payment-intent" -required-features = ["async"] - -[[example]] -name = "payment-link" -required-features = ["async"] - -[[example]] -name = "strategy" -required-features = ["async"] - -[[example]] -name = "subscriptions" -required-features = ["async"] - -[[example]] -name = "webhook-axum" -required-features = ["async"] - -[[example]] -name = "webhook-actix" -required-features = ["async"] - -[[example]] -name = "webhook-rocket" -required-features = ["rocket"] +http-types = { version = "2.12.0", default-features = false } +smol_str = { version = "0.2.0", features = ["serde"] } +serde_json = "1.0" \ No newline at end of file diff --git a/Makefile.toml b/Makefile.toml deleted file mode 100644 index 96c8caf49..000000000 --- a/Makefile.toml +++ /dev/null @@ -1,83 +0,0 @@ -[tasks.openapi-delete] -cwd = "openapi" -command = "rm" -args = ["-rf", "spec3.sdk.json", "out"] - -[tasks.openapi-delete-out] -cwd = "openapi" -command = "rm" -args = ["-rf", "out"] - -# verifies if all the apis are exported, and reports which are missing -[tasks.verify] -script = ''' -#!/usr/bin/env bash -for filename in src/resources/generated/*.rs ; do - BASE=$(basename $filename '.rs') - if ! grep -Fq "pub mod $BASE;" src/resources/generated.rs ; then - echo $BASE missing module - fi - if ! grep -Fq "$BASE::*," src/resources.rs ; then - echo $BASE missing export - fi -done -''' - -[tasks.duplicates] -script = ''' -rg -N --no-filename -i '^pub (struct|enum) ([A-Z][a-zA-z0-9]+).*?$' src/resources/generated -g '!placeholders.rs' -r '$2'\ - | sort\ - | uniq -cd -''' - -[tasks.openapi-generate-no-fetch] -cwd = "openapi" -command = "cargo" -args = ["run", "spec3.sdk.json"] -dependencies = ["openapi-delete-out"] - -[tasks.openapi-generate] -cwd = "openapi" -command = "cargo" -args = ["run", "spec3.sdk.json", "--fetch", "current"] -dependencies = ["openapi-delete-out"] - -[tasks.openapi-generate-latest] -cwd = "openapi" -command = "cargo" -args = ["run", "spec3.sdk.json", "--fetch", "latest"] -dependencies = ["openapi-delete-out"] - -[tasks.openapi-copy] -cwd = "openapi" -command = "rsync" -# --delete so that generated files don't stick around when not -# generated anymore, see https://github.com/arlyon/async-stripe/issues/229 -args = ["-a", "--delete-during", "out/", "../src/resources/generated"] - -[tasks.fmt] -command = "cargo" -toolchain = "nightly" -install_crate = "rustfmt" -# we set this to true because missing files currently cause rustfmt to fail -# which impacts our weekly CI job -ignore_errors = true -args = ["fmt"] - -[tasks.check] -command = "cargo" -toolchain = "nightly" -install_crate = "rustfmt" -args = ["fmt", "--", "--check"] - -[tasks.openapi-install] -dependencies = ["openapi-generate", "openapi-copy", "fmt"] - -[tasks.openapi-install-latest] -dependencies = ["openapi-generate-latest", "openapi-copy", "fmt"] - -[tasks.openapi-install-no-fetch] -dependencies = ["openapi-generate-no-fetch", "openapi-copy", "fmt"] - -[config] -default_to_workspace = false diff --git a/README.md b/README.md index 1b51766f5..21bbb5f61 100644 --- a/README.md +++ b/README.md @@ -13,39 +13,85 @@ Want to see a changelog of the Stripe API? [Look no further](https://stripe.com/ See the [Rust API docs](https://docs.rs/async-stripe), the [examples](/examples), or [payments.rs](https://payments.rs). -## Installation +## Example +This asynchronous example uses `Tokio` to create a [Stripe Customer](https://stripe.com/docs/api/customers/object). Your `Cargo.toml` could look like this: +```toml +tokio = { version = "1", features = ["full"] } +async-stripe = { version = "0.28", features = ["runtime-tokio-hyper"] } +stripe_core = { version = "0.28", features = ["customer"]} +``` +And then the code: +```rust +#[tokio::main] +async fn main() -> Result<(), Box> { + let secret_key = "very-secret-key-for-testing"; + let client = stripe::Client::new(secret_key); + let customer = stripe_core::customer::CreateCustomer { + name: Some("Test User"), + email: Some("test@async-stripe.com"), + description: Some( + "A fake customer that is used to illustrate the examples in async-stripe.", + ), + ..Default::default() + } + .send(&client) + .await?; + + println!("created a customer at https://dashboard.stripe.com/test/customers/{}", customer.id); + Ok(()) +} +``` +A full list of examples can be found in the [examples](/examples). +## Relevant Crates + +### Stripe Client +The main entry point is the `async-stripe` crate which provides a client for making Stripe API requests. `async-stripe` is compatible with the [`async-std`](https://github.com/async-rs/async-std) and [`tokio`](https://github.com/tokio-rs/tokio) runtimes and the `native-tls` and `rustls` backends. When adding the dependency, you must select a runtime feature. +#### Installation ```toml [dependencies] async-stripe = { version = "0.31", features = ["runtime-tokio-hyper"] } ``` -## Feature Flags - -### Runtimes - +#### Feature Flags +`async-stripe` supports the following features combining runtime and TLS choices: - `runtime-tokio-hyper` - `runtime-tokio-hyper-rustls` +- `runtime-tokio-hyper-rustls-webpki` - `runtime-blocking` - `runtime-blocking-rustls` +- `runtime-blocking-rustls-webpki` - `runtime-async-std-surf` -### API Features - -Additionally, since this is a large library, it is possible to conditionally -enable features as required to reduce compile times and final binary size. -Refer to the [Stripe API docs](https://stripe.com/docs/api) to determine -which APIs are included as part of each feature flag. - -```toml -# Example: Core-only (enough to create a `Charge` or `Card` or `Customer`) -async-stripe = { version = "*", default-features = false, features = ["runtime-async-std-surf"] } - -# Example: Support for "Subscriptions" and "Invoices" -async-stripe = { version = "*", default-features = false, features = ["runtime-async-std-surf", "billing"] } -``` +### Stripe Request Crates +To actually make requests with the client, you will have to use crates like `stripe-*`, which define requests for a subset of the `Stripe` API. For example, +`stripe_connect` includes all requests under the `Connect` part of the sidebar in the [Stripe API docs](https://stripe.com/docs/api) + +The organization of the Stripe API chunks into crates is currently: +- `stripe_billing`: `Billing` +- `stripe_checkout`: `Checkout` +- `stripe_connect`: `Connect` +- `stripe_core`: `Core Resources` +- `stripe_fraud`: `Fraud` +- `stripe_issuing`: `Issuing` +- `stripe_payment`: `Payment Methods` and `Payment Links` +- `stripe_product`: `Products` +- `stripe_terminal`: `Terminal` +- `stripe_treasury`: `Treasury` +- `stripe_misc`: `Tax`, `Identity`, `Reporting`, `Sigma`, `Financial Connections` + and `Webhooks` + +To help minimize compile times, within each of these crates, API requests are gated by features. For example, +making requests related to [Accounts](https://stripe.com/docs/api/accounts) requires enabling the `account` +feature flag in `stripe_connect`. + +For a full, up-to-date list of where each Stripe API request lives, please see [this table](crate_info.md) + +### Stripe Webhooks +The `stripe_webhook` crate includes functionality for receiving and validating [Stripe Webhook Events](https://stripe.com/docs/webhooks). +The [examples](/examples) directory includes examples for listening to webhooks with `axum`, `actix-web`, and `rocket`. ## API Versions diff --git a/async-stripe/Cargo.toml b/async-stripe/Cargo.toml new file mode 100644 index 000000000..a3b75428a --- /dev/null +++ b/async-stripe/Cargo.toml @@ -0,0 +1,106 @@ +[package] +name = "async-stripe" +version.workspace = true +edition.workspace = true +rust-version.workspace = true +authors.workspace = true +license.workspace = true +homepage.workspace = true +repository.workspace = true +keywords.workspace = true +categories.workspace = true + +[package.metadata.docs.rs] +features = ["runtime-tokio-hyper"] + +[lib] +name = "stripe" + +[features] +default = ["uuid", "stream"] + +stream = [] + +# runtimes +async = ["futures-util"] +blocking = [] + +runtime-tokio-hyper = [ + "tokio", + "hyper-client", + "hyper-tls", + "async", +] +runtime-tokio-hyper-rustls = [ + "tokio", + "hyper-client", + "hyper-rustls", + "hyper-rustls-native", + "async", +] +runtime-tokio-hyper-rustls-webpki = [ + "tokio", + "hyper-client", + "hyper-rustls-webpki", + "async", +] +runtime-blocking = [ + "tokio", + "tokio/rt", + "hyper-client", + "hyper-tls", + "blocking", +] +runtime-blocking-rustls = [ + "tokio", + "tokio/rt", + "hyper-client", + "hyper-rustls-native", + "blocking", +] +runtime-blocking-rustls-webpki = [ + "tokio", + "tokio/rt", + "hyper-client", + "hyper-rustls-webpki", + "blocking", +] +runtime-async-std-surf = [ + "async-std", + "surf", + "async", +] + +# we need the compat crate if using hyper +hyper-client = ["hyper", "http-types/hyperium_http"] + +hyper-rustls-native = ["hyper-rustls", "hyper-rustls/native-tokio"] +hyper-rustls-webpki = ["hyper-rustls", "hyper-rustls/webpki-tokio"] + +[dependencies] +stripe_types = {path = "../stripe_types"} +stripe_shared = {path = "../generated/stripe_shared"} +async-std = {version = "1.8,<1.11", optional = true} + +thiserror = "1.0.24" +hyper = { version = "0.14", default-features = false, features = ["http1", "http2", "client", "tcp"], optional = true } +hyper-tls = { version = "0.5", optional = true } +hyper-rustls = { version = "0.24", default-features = false, features = ["http1", "http2", "tls12", "logging"], optional = true } +serde_json.workspace = true +serde_qs = "0.12.0" +serde_path_to_error = "0.1.8" +surf = { version = "2.1", optional = true } +tokio = { version = "1.2", optional = true } +uuid = { version = "1.6.1", optional=true, features=["v4"] } + +serde.workspace = true +http-types.workspace = true +smol_str.workspace = true + +# stream for lists +futures-util = { version = "0.3.21", optional = true } + +[dev-dependencies] +httpmock = "0.6.7" +async-std = { version = "1.10.0", features = ["attributes"] } +tokio = { version = "1.24.1", features = ["rt", "macros"] } \ No newline at end of file diff --git a/build.rs b/async-stripe/build.rs similarity index 100% rename from build.rs rename to async-stripe/build.rs diff --git a/src/client/base/async_std.rs b/async-stripe/src/client/base/async_std.rs similarity index 93% rename from src/client/base/async_std.rs rename to async-stripe/src/client/base/async_std.rs index 7cbec65ac..b13c56da8 100644 --- a/src/client/base/async_std.rs +++ b/async-stripe/src/client/base/async_std.rs @@ -6,17 +6,10 @@ use http_types::{Request, StatusCode}; use serde::de::DeserializeOwned; use crate::client::request_strategy::{Outcome, RequestStrategy}; -use crate::error::{ErrorResponse, StripeError}; +use crate::error::StripeError; pub type Response = Pin> + Send>>; -#[allow(dead_code)] -#[inline(always)] -pub(crate) fn ok(ok: T) -> Response { - Box::pin(future::ready(Ok(ok))) -} - -#[allow(dead_code)] #[inline(always)] pub(crate) fn err(err: StripeError) -> Response { Box::pin(future::ready(Err(err))) @@ -51,6 +44,12 @@ impl AsyncStdClient { } } +impl Default for AsyncStdClient { + fn default() -> Self { + Self::new() + } +} + async fn send_inner( client: &surf::Client, mut request: Request, @@ -103,10 +102,7 @@ async fn send_inner( tries += 1; let json_deserializer = &mut serde_json::Deserializer::from_slice(&bytes); last_error = serde_path_to_error::deserialize(json_deserializer) - .map(|mut e: ErrorResponse| { - e.error.http_status = status.into(); - StripeError::from(e.error) - }) + .map(|e: stripe_shared::Error| StripeError::Stripe(*e.error, status.into())) .unwrap_or_else(StripeError::from); last_status = Some(status); last_retry_header = retry; @@ -172,7 +168,7 @@ mod tests { mock.assert_hits_async(1).await; match res { - Err(StripeError::Stripe(x)) => println!("{:?}", x), + Err(StripeError::Stripe(x, _)) => println!("{:?}", x), _ => panic!("Expected stripe error {:?}", res), } } diff --git a/src/client/base/tokio.rs b/async-stripe/src/client/base/tokio.rs similarity index 84% rename from src/client/base/tokio.rs rename to async-stripe/src/client/base/tokio.rs index 3ba3ae73f..c0b8e0d66 100644 --- a/src/client/base/tokio.rs +++ b/async-stripe/src/client/base/tokio.rs @@ -8,7 +8,7 @@ use serde::de::DeserializeOwned; use tokio::time::sleep; use crate::client::request_strategy::{Outcome, RequestStrategy}; -use crate::error::{ErrorResponse, StripeError}; +use crate::error::StripeError; #[cfg(feature = "hyper-rustls-native")] mod connector { @@ -59,12 +59,6 @@ type HttpClient = hyper::Client, Body>; pub type Response = Pin> + Send>>; -#[allow(dead_code)] -#[inline(always)] -pub(crate) fn ok(ok: T) -> Response { - Box::pin(future::ready(Ok(ok))) -} - #[allow(dead_code)] #[inline(always)] pub(crate) fn err(err: StripeError) -> Response { @@ -101,6 +95,12 @@ impl TokioClient { } } +impl Default for TokioClient { + fn default() -> Self { + Self::new() + } +} + async fn send_inner( client: &HttpClient, mut request: Request, @@ -155,9 +155,8 @@ async fn send_inner( tries += 1; let json_deserializer = &mut serde_json::Deserializer::from_slice(&bytes); last_error = serde_path_to_error::deserialize(json_deserializer) - .map(|mut e: ErrorResponse| { - e.error.http_status = status.into(); - StripeError::from(e.error) + .map(|e: stripe_shared::Error| { + StripeError::Stripe(*e.error, status.as_u16()) }) .unwrap_or_else(StripeError::from); last_status = Some( @@ -191,6 +190,8 @@ mod tests { use http_types::{Method, Request, Url}; use httpmock::prelude::*; use hyper::{body::to_bytes, Body, Request as HyperRequest}; + use serde_json::json; + use stripe_shared::api_errors::{ApiErrorsCode, ApiErrorsType}; use super::convert_request; use super::TokioClient; @@ -292,7 +293,7 @@ mod tests { mock.assert_hits_async(1).await; match res { - Err(StripeError::Stripe(x)) => println!("{:?}", x), + Err(StripeError::Stripe(x, _)) => println!("{:?}", x), _ => panic!("Expected stripe error {:?}", res), } } @@ -379,4 +380,44 @@ mod tests { hello_mock.assert_hits_async(5).await; assert!(res.is_err()); } + + // https://github.com/arlyon/async-stripe/issues/384 + #[tokio::test] + async fn user_error_transfers() { + let client = TokioClient::new(); + + // Start a lightweight mock server. + let server = MockServer::start_async().await; + let message = "Your destination account needs to have at least one of the following capabilities enabled: transfers, crypto_transfers, legacy_payments"; + let log_url = "https://dashboard.stripe.com/logs/req_nIhlutaV4amLEs?t=1685040634"; + let mock = server.mock(|when, then| { + when.method(GET).path("/v1/transfers"); + then.status(400).json_body(json!({ + "error": { + "code": "insufficient_capabilities_for_transfer", + "message": message, + "request_log_url": log_url, + "type": "invalid_request_error" + } + })); + }); + + let req = Request::get(Url::parse(&server.url("/v1/transfers")).unwrap()); + let res = client.execute::<()>(req, &RequestStrategy::Once).await.unwrap_err(); + mock.assert_hits_async(1).await; + + match res { + StripeError::Stripe(err, status_code) => { + assert_eq!(status_code, 400); + assert_eq!(err.type_, ApiErrorsType::InvalidRequestError); + assert_eq!(err.message.as_deref(), Some(message)); + assert_eq!(err.request_log_url.as_deref(), Some(log_url)); + // NB: `Unknown` here because the error code reported in the issue is not + // present in the OpenAPI spec. Reporting unknown instead of an error seems + // better regardless so that stripe adding new variants is not a breaking change + assert_eq!(err.code, Some(ApiErrorsCode::Unknown)); + } + _ => panic!("Expected stripe error, got {:?}", res), + } + } } diff --git a/src/client/base/tokio_blocking.rs b/async-stripe/src/client/base/tokio_blocking.rs similarity index 93% rename from src/client/base/tokio_blocking.rs rename to async-stripe/src/client/base/tokio_blocking.rs index 8192eeabf..e29be6c22 100644 --- a/src/client/base/tokio_blocking.rs +++ b/async-stripe/src/client/base/tokio_blocking.rs @@ -1,3 +1,4 @@ +#![allow(clippy::missing_errors_doc)] use std::{sync::Arc, time::Duration}; use http_types::Request; @@ -12,11 +13,6 @@ const DEFAULT_TIMEOUT: Duration = Duration::from_secs(30); pub type Response = Result; -#[inline(always)] -pub(crate) fn ok(ok: T) -> Response { - Ok(ok) -} - #[inline(always)] pub(crate) fn err(err: crate::StripeError) -> Response { Err(err) @@ -59,3 +55,9 @@ impl TokioBlockingClient { } } } + +impl Default for TokioBlockingClient { + fn default() -> Self { + Self::new() + } +} diff --git a/async-stripe/src/client/headers.rs b/async-stripe/src/client/headers.rs new file mode 100644 index 000000000..ac0400410 --- /dev/null +++ b/async-stripe/src/client/headers.rs @@ -0,0 +1,44 @@ +use crate::AccountId; +use crate::ApiVersion; +use crate::ApplicationId; + +#[derive(Clone, Default)] +pub struct AppInfo { + pub name: String, + pub url: Option, + pub version: Option, +} + +impl ToString for AppInfo { + /// Formats a plugin's 'App Info' into a string that can be added to the end of an User-Agent string. + /// + /// This formatting matches that of other libraries, and if changed then it should be changed everywhere. + fn to_string(&self) -> String { + match (&self.version, &self.url) { + (Some(a), Some(b)) => format!("{}/{} ({})", &self.name, a, b), + (Some(a), None) => format!("{}/{}", &self.name, a), + (None, Some(b)) => format!("{} ({})", &self.name, b), + _ => self.name.to_string(), + } + } +} + +#[derive(Clone)] +pub struct Headers { + pub stripe_version: ApiVersion, + pub user_agent: String, + + pub client_id: Option, + pub stripe_account: Option, +} + +impl Headers { + pub fn to_array(&self) -> [(&str, Option<&str>); 4] { + [ + ("Client-Id", self.client_id.as_deref()), + ("Stripe-Account", self.stripe_account.as_deref()), + ("Stripe-Version", Some(self.stripe_version.as_str())), + ("User-Agent", Some(&self.user_agent)), + ] + } +} diff --git a/src/client/mod.rs b/async-stripe/src/client/mod.rs similarity index 91% rename from src/client/mod.rs rename to async-stripe/src/client/mod.rs index 89228a48a..33a5d332d 100644 --- a/src/client/mod.rs +++ b/async-stripe/src/client/mod.rs @@ -1,3 +1,4 @@ +mod headers; mod request_strategy; mod stripe; @@ -29,7 +30,7 @@ mod base { feature = "runtime-blocking-rustls-webpki" ))] pub(crate) mod config { - pub(crate) use super::base::tokio_blocking::{err, ok}; + pub(crate) use super::base::tokio_blocking::err; pub use super::base::tokio_blocking::{Response, TokioBlockingClient as BaseClient}; } @@ -39,13 +40,13 @@ pub(crate) mod config { feature = "runtime-tokio-hyper-rustls-webpki" ))] pub(crate) mod config { - pub(crate) use super::base::tokio::{err, ok}; + pub(crate) use super::base::tokio::err; pub use super::base::tokio::{Response, TokioClient as BaseClient}; } #[cfg(feature = "runtime-async-std-surf")] pub(crate) mod config { - pub(crate) use super::base::async_std::{err, ok}; + pub(crate) use super::base::async_std::err; pub use super::base::async_std::{AsyncStdClient as BaseClient, Response}; } diff --git a/src/client/request_strategy.rs b/async-stripe/src/client/request_strategy.rs similarity index 100% rename from src/client/request_strategy.rs rename to async-stripe/src/client/request_strategy.rs diff --git a/src/client/stripe.rs b/async-stripe/src/client/stripe.rs similarity index 83% rename from src/client/stripe.rs rename to async-stripe/src/client/stripe.rs index d3b0aa23d..bf720b048 100644 --- a/src/client/stripe.rs +++ b/async-stripe/src/client/stripe.rs @@ -1,19 +1,23 @@ +// Necessary under tokio-blocking since `Response` is a type alias to a `Result` +#![allow(clippy::missing_errors_doc)] use http_types::{Body, Method, Request, Url}; -use serde::{de::DeserializeOwned, Serialize}; +use serde::de::DeserializeOwned; +use serde::Serialize; +use stripe_shared::version::VERSION; +use crate::client::headers::{AppInfo, Headers}; use crate::{ client::{request_strategy::RequestStrategy, BaseClient, Response}, config::err, - generated::core::version::VERSION, - params::AppInfo, - AccountId, ApplicationId, Headers, StripeError, + StripeError, }; +use crate::{AccountId, ApplicationId}; static USER_AGENT: &str = concat!("Stripe/v1 RustBindings/", env!("CARGO_PKG_VERSION")); #[derive(Clone)] pub struct Client { - client: crate::client::BaseClient, + client: BaseClient, secret_key: String, headers: Headers, strategy: RequestStrategy, @@ -67,7 +71,7 @@ impl Client { /// Set the application info for the client. /// /// It is recommended that applications set this so that - /// stripe is able to undestand usage patterns from your + /// stripe is able to understand usage patterns from your /// user agent. pub fn with_app_info( mut self, @@ -83,8 +87,7 @@ impl Client { /// Make a `GET` http request with just a path pub fn get(&self, path: &str) -> Response { - let url = self.url(path); - self.client.execute::(self.create_request(Method::Get, url), &self.strategy) + self.send(path, Method::Get) } /// Make a `GET` http request with url query parameters @@ -100,29 +103,23 @@ impl Client { self.client.execute::(self.create_request(Method::Get, url), &self.strategy) } - /// Make a `DELETE` http request with just a path - pub fn delete(&self, path: &str) -> Response { - let url = self.url(path); - self.client.execute::(self.create_request(Method::Delete, url), &self.strategy) - } - - /// Make a `DELETE` http request with url query parameters - pub fn delete_query( + pub fn send( &self, path: &str, - params: P, + method: Method, ) -> Response { - let url = match self.url_with_params(path, params) { - Err(e) => return err(e), - Ok(ok) => ok, - }; - self.client.execute::(self.create_request(Method::Delete, url), &self.strategy) + let url = self.url(path); + self.client.execute::(self.create_request(method, url), &self.strategy) + } + + /// Make a `DELETE` http request with just a path + pub fn delete(&self, path: &str) -> Response { + self.send(path, Method::Delete) } /// Make a `POST` http request with just a path pub fn post(&self, path: &str) -> Response { - let url = self.url(path); - self.client.execute::(self.create_request(Method::Post, url), &self.strategy) + self.send(path, Method::Post) } /// Make a `POST` http request with urlencoded body @@ -130,9 +127,28 @@ impl Client { &self, path: &str, form: F, + ) -> Response { + self.send_form(path, form, Method::Post) + } + + /// Make a `DELETE` http request with urlencoded body + pub fn delete_form( + &self, + path: &str, + form: F, + ) -> Response { + self.send_form(path, form, Method::Delete) + } + + /// Make an http request with urlencoded body + pub fn send_form( + &self, + path: &str, + form: F, + method: Method, ) -> Response { let url = self.url(path); - let mut req = self.create_request(Method::Post, url); + let mut req = self.create_request(method, url); let mut params_buffer = Vec::new(); let qs_ser = &mut serde_qs::Serializer::new(&mut params_buffer); diff --git a/async-stripe/src/error.rs b/async-stripe/src/error.rs new file mode 100644 index 000000000..51b440e28 --- /dev/null +++ b/async-stripe/src/error.rs @@ -0,0 +1,32 @@ +use stripe_shared::ApiErrors; +use thiserror::Error; + +/// An error encountered when communicating with the Stripe API. +#[derive(Debug, Error)] +pub enum StripeError { + #[error("error reported by stripe: {0:#?}, status code: {1}")] + Stripe(ApiErrors, u16), + #[error("error serializing or deserializing a querystring: {0}")] + QueryStringSerialize(#[from] serde_path_to_error::Error), + #[error("error serializing or deserializing a request")] + JSONSerialize(#[from] serde_path_to_error::Error), + #[error("attempted to access an unsupported version of the api")] + UnsupportedVersion, + #[error("error communicating with stripe: {0}")] + ClientError(String), + #[error("timeout communicating with stripe")] + Timeout, +} + +#[cfg(feature = "hyper")] +impl From for StripeError { + fn from(err: hyper::Error) -> StripeError { + StripeError::ClientError(err.to_string()) + } +} + +impl From for StripeError { + fn from(err: http_types::Error) -> StripeError { + StripeError::ClientError(err.to_string()) + } +} diff --git a/src/lib.rs b/async-stripe/src/lib.rs similarity index 83% rename from src/lib.rs rename to async-stripe/src/lib.rs index c95651479..962bbc0c5 100644 --- a/src/lib.rs +++ b/async-stripe/src/lib.rs @@ -7,7 +7,6 @@ // except according to those terms. #![doc(html_root_url = "https://docs.rs/async-stripe/")] -#![recursion_limit = "128"] //! This crate provides Rust bindings to the Stripe HTTP API. //! @@ -53,19 +52,17 @@ //! Otherwise, we are open to turning this into an open trait so that you can implement your own strategy. #![allow(clippy::map_clone, clippy::large_enum_variant)] -#![warn(clippy::unwrap_used, clippy::missing_errors_doc, clippy::missing_panics_doc)] +#![warn(clippy::unwrap_used, clippy::missing_errors_doc)] #![forbid(unsafe_code)] -// Give a clear error when a required runtime error is not present. Would be better for this -// to be a fatal error preventing emission of further compile errors relating to lack of -// a runtime feature, but that does not seem currently possible: -// https://github.com/rust-lang/rust/issues/68838 - mod client; mod error; -mod ids; -mod params; -mod resources; +mod pagination; + +pub use pagination::{ListPaginator, PaginationExt}; +pub use stripe_shared::AccountId; +pub use stripe_shared::ApiVersion; +pub use stripe_shared::ApplicationId; // N.B. Ideally we would support both a blocking client and // an async client without a feature flag, but the originally @@ -75,10 +72,4 @@ mod resources; // See https://github.com/wyyerd/stripe-rs/issues/24#issuecomment-451514187 // See https://github.com/rust-lang/rust/issues/44265 pub use crate::client::*; -pub use crate::error::{ErrorCode, ErrorType, RequestError, StripeError, WebhookError}; -pub use crate::ids::*; -pub use crate::params::{ - Expandable, Headers, IdOrCreate, List, Metadata, Object, RangeBounds, RangeQuery, SearchList, - Timestamp, -}; -pub use crate::resources::*; +pub use crate::error::StripeError; diff --git a/async-stripe/src/pagination.rs b/async-stripe/src/pagination.rs new file mode 100644 index 000000000..64fe81908 --- /dev/null +++ b/async-stripe/src/pagination.rs @@ -0,0 +1,176 @@ +// Necessary under tokio-blocking since `Response` is a type alias to a `Result` +#![allow(clippy::missing_errors_doc)] +use serde::Serialize; +use stripe_types::{List, PaginableList, SearchList}; + +use crate::Client; + +#[derive(Debug)] +pub struct ListPaginator { + page: T, + params: serde_json::Value, +} + +pub trait PaginationExt { + type Data; + + fn into_paginator(self) -> ListPaginator; +} + +impl PaginationExt for List +where + T: Sync + Send + 'static, + List: PaginableList, +{ + type Data = List; + + fn into_paginator(mut self) -> ListPaginator> { + let mut params = Default::default(); + self.update_params(&mut params); + ListPaginator { page: self, params } + } +} + +impl PaginationExt for SearchList +where + T: Sync + Send + 'static, + SearchList: PaginableList, +{ + type Data = SearchList; + + fn into_paginator(mut self) -> ListPaginator> { + let mut params = Default::default(); + self.update_params(&mut params); + ListPaginator { page: self, params } + } +} + +impl ListPaginator> { + /// Kept public so that the generated code crates can access this trait. Used by `Search*` params + /// to implement `PaginationExt`. Not part of the public API. + #[doc(hidden)] + pub fn from_search_params(url: &str, params: impl Serialize) -> Self { + let page = SearchList { + url: url.to_string(), + has_more: true, + data: vec![], + next_page: None, + total_count: None, + }; + Self { + page, + params: serde_json::to_value(params) + // Expect should be safe since we control which types call this + .expect("all Stripe types implement `Serialize` infallibly"), + } + } +} + +impl ListPaginator> { + /// Kept public so that the generated code crates can access this trait. Used by `List*` params + /// to implement `PaginationExt`. Not part of the public API. + #[doc(hidden)] + pub fn from_list_params(url: &str, params: impl Serialize) -> Self { + let page = List { data: vec![], has_more: true, total_count: None, url: url.to_string() }; + Self { + page, + params: serde_json::to_value(params) + .expect("all Stripe types implement `Serialize` infallibly"), + } + } +} + +impl ListPaginator +where + T: PaginableList + Send + Sync + 'static, +{ + /// Repeatedly queries Stripe for more data until all elements in list are fetched, using + /// Stripe's default page size. + /// + /// Requires `feature = "blocking"`. + #[cfg(feature = "blocking")] + pub fn get_all(self, client: &Client) -> crate::Response> { + let mut data = vec![]; + let mut parts = self.page.into_parts(); + let mut params = self.params; + loop { + // `append` empties `parts.data` + data.append(&mut parts.data); + + if !parts.has_more { + break; + } + + let mut next_page: T = + client.get_query(parts.url.trim_start_matches("/v1/"), ¶ms)?; + next_page.update_params(&mut params); + parts = next_page.into_parts(); + } + Ok(data) + } + + /// Get all values in this List, consuming self and lazily paginating until all values are fetched. + /// + /// This function repeatedly queries Stripe for more data until all elements in list are fetched, using + /// the page size specified in params, or Stripe's default page size if none is specified. + /// + /// + /// Requires `feature = ["async", "stream"]`. + #[cfg(all(feature = "async", feature = "stream"))] + pub fn stream( + self, + client: &Client, + ) -> impl futures_util::Stream> + Unpin { + // We are going to be popping items off the end of the list, so we need to reverse it. + let mut page = self.page.into_parts(); + page.data.reverse(); + let paginator = ListPaginator { page: T::from_parts(page), params: self.params }; + + Box::pin(futures_util::stream::unfold( + Some((paginator, client.clone())), + Self::unfold_stream, + )) + } + + /// unfold a single item from the stream + #[cfg(all(feature = "async", feature = "stream"))] + async fn unfold_stream( + state: Option<(Self, Client)>, + ) -> Option<(Result, Option<(Self, Client)>)> { + let (paginator, client) = state?; // If none, our last request was an error, so stop here + let mut parts = paginator.page.into_parts(); + if let Some(next_val) = parts.data.pop() { + // We have more data on this page + return Some(( + Ok(next_val), + Some((Self { page: T::from_parts(parts), params: paginator.params }, client)), + )); + } + + // Final value of the stream, no errors + if !parts.has_more { + return None; + } + + match client + .get_query::(parts.url.trim_start_matches("/v1/"), &paginator.params) + .await + { + Ok(mut next_page) => { + let mut params = paginator.params; + next_page.update_params(&mut params); + + let mut parts = next_page.into_parts(); + + // We are going to be popping items off the end of the list, so we need to reverse it. + parts.data.reverse(); + + let next_val = parts.data.pop()?; + + // Yield last value of this page, the next page (and client) becomes the state + Some((Ok(next_val), Some((Self { page: T::from_parts(parts), params }, client)))) + } + Err(err) => Some((Err(err), None)), // We ran into an error. The last value of the stream will be the error. + } + } +} diff --git a/crate_info.md b/crate_info.md new file mode 100644 index 000000000..8cfffff4c --- /dev/null +++ b/crate_info.md @@ -0,0 +1,110 @@ +| Name | Crate | Feature Gate | +|--------------------------------------------------------------------------------------------------|-----------------|-----------------------------------| +| BillingPortalConfiguration | stripe_billing | billing_portal_configuration | +| BillingPortalSession | stripe_billing | billing_portal_session | +| InvoiceLineItem | stripe_billing | invoice_line_item | +| TestHelpersTestClock | stripe_billing | test_helpers_test_clock | +| UsageRecordSummary | stripe_billing | usage_record_summary | +| [CreditNoteLineItem](https://stripe.com/docs/api/credit_notes/line_item) | stripe_billing | credit_note_line_item | +| [CreditNote](https://stripe.com/docs/api/credit_notes/object) | stripe_billing | credit_note | +| [InvoiceItem](https://stripe.com/docs/api/invoiceitems/object) | stripe_billing | invoice_item | +| [Invoice](https://stripe.com/docs/api/invoices/object) | stripe_billing | invoice | +| [Plan](https://stripe.com/docs/api/plans/object) | stripe_billing | plan | +| [Quote](https://stripe.com/docs/api/quotes/object) | stripe_billing | quote | +| [SubscriptionItem](https://stripe.com/docs/api/subscription_items/object) | stripe_billing | subscription_item | +| [SubscriptionSchedule](https://stripe.com/docs/api/subscription_schedules/object) | stripe_billing | subscription_schedule | +| [Subscription](https://stripe.com/docs/api/subscriptions/object) | stripe_billing | subscription | +| [TaxId](https://stripe.com/docs/api/tax_ids/object) | stripe_billing | tax_id | +| [UsageRecord](https://stripe.com/docs/api/usage_records/object) | stripe_billing | usage_record | +| [CheckoutSession](https://stripe.com/docs/api/checkout/sessions/object) | stripe_checkout | checkout_session | +| AppsSecret | stripe_connect | apps_secret | +| ExternalAccount | stripe_connect | external_account | +| [AccountLink](https://stripe.com/docs/api/account_links/object) | stripe_connect | account_link | +| [AccountSession](https://stripe.com/docs/api/account_sessions/object) | stripe_connect | account_session | +| [Account](https://stripe.com/docs/api/accounts/object) | stripe_connect | account | +| [ApplicationFeeRefund](https://stripe.com/docs/api/fee_refunds/object) | stripe_connect | application_fee_refund | +| [ApplicationFee](https://stripe.com/docs/api/application_fees/object) | stripe_connect | application_fee | +| [Capability](https://stripe.com/docs/api/capabilities/object) | stripe_connect | capability | +| [CountrySpec](https://stripe.com/docs/api/country_specs/object) | stripe_connect | country_spec | +| [LoginLink](https://stripe.com/docs/api/account/login_link) | stripe_connect | login_link | +| [Person](https://stripe.com/docs/api/persons/object) | stripe_connect | person | +| [Topup](https://stripe.com/docs/api/topups/object) | stripe_connect | topup | +| [TransferReversal](https://stripe.com/docs/api/transfer_reversals/object) | stripe_connect | transfer_reversal | +| [Transfer](https://stripe.com/docs/api/transfers/object) | stripe_connect | transfer | +| CustomerSession | stripe_core | customer_session | +| PaymentSource | stripe_core | payment_source | +| [BalanceTransaction](https://stripe.com/docs/api/balance_transactions/object) | stripe_core | balance_transaction | +| [Balance](https://stripe.com/docs/api/balance/balance_object) | stripe_core | balance | +| [CashBalance](https://stripe.com/docs/api/cash_balance/object) | stripe_core | cash_balance | +| [Charge](https://stripe.com/docs/api/charges/object) | stripe_core | charge | +| [CustomerBalanceTransaction](https://stripe.com/docs/api/customer_balance_transactions/object) | stripe_core | customer_balance_transaction | +| [CustomerCashBalanceTransaction](https://stripe.com/docs/api/cash_balance_transactions/object) | stripe_core | customer_cash_balance_transaction | +| [Customer](https://stripe.com/docs/api/customers/object) | stripe_core | customer | +| [Dispute](https://stripe.com/docs/api/disputes/object) | stripe_core | dispute | +| [Event](https://stripe.com/docs/api/events/object) | stripe_core | event | +| [FileLink](https://stripe.com/docs/api/file_links/object) | stripe_core | file_link | +| [File](https://stripe.com/docs/api/files/object) | stripe_core | file | +| [Mandate](https://stripe.com/docs/api/mandates/object) | stripe_core | mandate | +| [PaymentIntent](https://stripe.com/docs/api/payment_intents/object) | stripe_core | payment_intent | +| [Payout](https://stripe.com/docs/api/payouts/object) | stripe_core | payout | +| [Refund](https://stripe.com/docs/api/refunds/object) | stripe_core | refund | +| [SetupAttempt](https://stripe.com/docs/api/setup_attempts/object) | stripe_core | setup_attempt | +| [SetupIntent](https://stripe.com/docs/api/setup_intents/object) | stripe_core | setup_intent | +| [Token](https://stripe.com/docs/api/tokens/object) | stripe_core | token | +| RadarEarlyFraudWarning | stripe_fraud | radar_early_fraud_warning | +| [RadarValueListItem](https://stripe.com/docs/api/radar/value_list_items/object) | stripe_fraud | radar_value_list_item | +| [RadarValueList](https://stripe.com/docs/api/radar/value_lists/object) | stripe_fraud | radar_value_list | +| [Review](https://stripe.com/docs/api/radar/reviews/object) | stripe_fraud | review | +| [IssuingAuthorization](https://stripe.com/docs/api/issuing/authorizations/object) | stripe_issuing | issuing_authorization | +| [IssuingCard](https://stripe.com/docs/api/issuing/cards/object) | stripe_issuing | issuing_card | +| [IssuingCardholder](https://stripe.com/docs/api/issuing/cardholders/object) | stripe_issuing | issuing_cardholder | +| [IssuingDispute](https://stripe.com/docs/api/issuing/disputes/object) | stripe_issuing | issuing_dispute | +| [IssuingToken](https://stripe.com/docs/api/issuing/tokens/object) | stripe_issuing | issuing_token | +| [IssuingTransaction](https://stripe.com/docs/api/issuing/transactions/object) | stripe_issuing | issuing_transaction | +| ApplePayDomain | stripe_misc | apple_pay_domain | +| ClimateOrder | stripe_misc | climate_order | +| ClimateProduct | stripe_misc | climate_product | +| ClimateSupplier | stripe_misc | climate_supplier | +| EphemeralKey | stripe_misc | ephemeral_key | +| ExchangeRate | stripe_misc | exchange_rate | +| FinancialConnectionsTransaction | stripe_misc | financial_connections_transaction | +| TaxRegistration | stripe_misc | tax_registration | +| [FinancialConnectionsAccount](https://stripe.com/docs/api/financial_connections/accounts/object) | stripe_misc | financial_connections_account | +| [FinancialConnectionsSession](https://stripe.com/docs/api/financial_connections/sessions/object) | stripe_misc | financial_connections_session | +| [IdentityVerificationReport](https://stripe.com/docs/api/identity/verification_reports/object) | stripe_misc | identity_verification_report | +| [IdentityVerificationSession](https://stripe.com/docs/api/identity/verification_sessions/object) | stripe_misc | identity_verification_session | +| [ReportingReportRun](https://stripe.com/docs/api/reporting/report_run/object) | stripe_misc | reporting_report_run | +| [ReportingReportType](https://stripe.com/docs/api/reporting/report_type/object) | stripe_misc | reporting_report_type | +| [ScheduledQueryRun](https://stripe.com/docs/api/sigma/scheduled_queries/object) | stripe_misc | scheduled_query_run | +| [TaxCalculation](https://stripe.com/docs/api/tax/calculations/object) | stripe_misc | tax_calculation | +| [TaxSettings](https://stripe.com/docs/api/tax/settings/object) | stripe_misc | tax_settings | +| [TaxTransaction](https://stripe.com/docs/api/tax/transactions/object) | stripe_misc | tax_transaction | +| [WebhookEndpoint](https://stripe.com/docs/api/webhook_endpoints/object) | stripe_misc | webhook_endpoint | +| BankAccount | stripe_payment | bank_account | +| [Card](https://stripe.com/docs/api/cards/object) | stripe_payment | card | +| [PaymentLink](https://stripe.com/docs/api/payment_links/payment_links/object) | stripe_payment | payment_link | +| [PaymentMethodConfiguration](https://stripe.com/docs/api/payment_method_configurations/object) | stripe_payment | payment_method_configuration | +| [PaymentMethodDomain](https://stripe.com/docs/api/payment_method_domains/object) | stripe_payment | payment_method_domain | +| [PaymentMethod](https://stripe.com/docs/api/payment_methods/object) | stripe_payment | payment_method | +| [Source](https://stripe.com/docs/api/sources/object) | stripe_payment | source | +| [Coupon](https://stripe.com/docs/api/coupons/object) | stripe_product | coupon | +| [Price](https://stripe.com/docs/api/prices/object) | stripe_product | price | +| [Product](https://stripe.com/docs/api/products/object) | stripe_product | product | +| [PromotionCode](https://stripe.com/docs/api/promotion_codes/object) | stripe_product | promotion_code | +| [ShippingRate](https://stripe.com/docs/api/shipping_rates/object) | stripe_product | shipping_rate | +| [TaxCode](https://stripe.com/docs/api/tax_codes/object) | stripe_product | tax_code | +| [TaxRate](https://stripe.com/docs/api/tax_rates/object) | stripe_product | tax_rate | +| [TerminalConfiguration](https://stripe.com/docs/api/terminal/configuration/object) | stripe_terminal | terminal_configuration | +| [TerminalConnectionToken](https://stripe.com/docs/api/terminal/connection_tokens/object) | stripe_terminal | terminal_connection_token | +| [TerminalLocation](https://stripe.com/docs/api/terminal/locations/object) | stripe_terminal | terminal_location | +| [TerminalReader](https://stripe.com/docs/api/terminal/readers/object) | stripe_terminal | terminal_reader | +| TreasuryCreditReversal | stripe_treasury | treasury_credit_reversal | +| TreasuryDebitReversal | stripe_treasury | treasury_debit_reversal | +| TreasuryFinancialAccount | stripe_treasury | treasury_financial_account | +| TreasuryInboundTransfer | stripe_treasury | treasury_inbound_transfer | +| TreasuryOutboundPayment | stripe_treasury | treasury_outbound_payment | +| TreasuryOutboundTransfer | stripe_treasury | treasury_outbound_transfer | +| TreasuryReceivedCredit | stripe_treasury | treasury_received_credit | +| TreasuryReceivedDebit | stripe_treasury | treasury_received_debit | +| TreasuryTransaction | stripe_treasury | treasury_transaction | +| TreasuryTransactionEntry | stripe_treasury | treasury_transaction_entry | \ No newline at end of file diff --git a/examples/README.md b/examples/README.md new file mode 100644 index 000000000..80ed41f8e --- /dev/null +++ b/examples/README.md @@ -0,0 +1,11 @@ +# Examples +This folder contains examples showing how to use `async-stripe`. Each example +is setup as its own crate so the dependencies are clear. + +The examples include: +- `endpoints`: General usage, including API calls for commonly used resources, along + with examples of using different request strategies. +- `pagination`: Async streaming of Stripe API calls which allow [Pagination](https://stripe.com/docs/api/pagination) +- `webhook-actix`: Receiving Stripe webhooks using the web framework `actix-web` +- `webhook-rocket`: Receiving Stripe webhooks using the web framework `rocket` +- `webhook-axum`: Receiving Stripe webhooks using the web framework `axum` \ No newline at end of file diff --git a/examples/customer.rs b/examples/customer.rs deleted file mode 100644 index b831ac517..000000000 --- a/examples/customer.rs +++ /dev/null @@ -1,70 +0,0 @@ -//! Customer -//! ======== -//! -//! Reference: -//! -//! This example shows how to create and list customers. - -use futures_util::StreamExt; -use futures_util::TryStreamExt; -use stripe::{Client, CreateCustomer, Customer, ListCustomers}; - -#[tokio::main] -async fn main() { - let secret_key = std::env::var("STRIPE_SECRET_KEY").expect("Missing STRIPE_SECRET_KEY in env"); - let client = Client::new(secret_key); - - let customer = Customer::create( - &client, - CreateCustomer { - name: Some("Alexander Lyon"), - email: Some("test@async-stripe.com"), - description: Some( - "A fake customer that is used to illustrate the examples in async-stripe.", - ), - metadata: Some(std::collections::HashMap::from([( - String::from("async-stripe"), - String::from("true"), - )])), - - ..Default::default() - }, - ) - .await - .unwrap(); - - println!("created a customer at https://dashboard.stripe.com/test/customers/{}", customer.id); - - let customer = Customer::create( - &client, - CreateCustomer { - name: Some("Someone Else"), - email: Some("test@async-stripe.com"), - description: Some( - "A fake customer that is used to illustrate the examples in async-stripe.", - ), - metadata: Some(std::collections::HashMap::from([( - String::from("async-stripe"), - String::from("true"), - )])), - - ..Default::default() - }, - ) - .await - .unwrap(); - - println!("created a customer at https://dashboard.stripe.com/test/customers/{}", customer.id); - - let params = ListCustomers { ..Default::default() }; - let paginator = Customer::list(&client, ¶ms).await.unwrap().paginate(params); - let mut stream = paginator.stream(&client); - - // get the next customer - let _next = stream.next().await.unwrap(); - - // or collect them - let customers = stream.try_collect::>().await.unwrap(); - - println!("fetched {} customers: {:?}", customers.len(), customers); -} diff --git a/examples/endpoints/Cargo.toml b/examples/endpoints/Cargo.toml new file mode 100644 index 000000000..94f8903cc --- /dev/null +++ b/examples/endpoints/Cargo.toml @@ -0,0 +1,26 @@ +[package] +name = "endpoints" +version = "0.1.0" +edition = "2021" +publish = false + + +[dependencies] +futures-util = "0.3.28" +tokio = { version = "1.24.1", features = ["rt-multi-thread", "macros"] } +async-stripe = {path = "../../async-stripe"} +stripe_types = {path = "../../stripe_types"} +stripe_billing = {path = "../../generated/stripe_billing", features = ["subscription"]} +stripe_core = {path = "../../generated/stripe_core", features = ["customer", "payment_intent"]} +stripe_product = {path = "../../generated/stripe_product", features = ["product", "price"]} +stripe_payment = {path = "../../generated/stripe_payment", features = ["payment_method", "payment_link"]} +stripe_checkout = {path = "../../generated/stripe_checkout", features = ["checkout_session"]} +stripe_connect = {path = "../../generated/stripe_connect", features = ["account", "account_link"]} + +[features] +async = [] + +runtime-tokio-hyper = ["async-stripe/runtime-tokio-hyper", "async"] +runtime-tokio-hyper-rustls = ["async-stripe/runtime-tokio-hyper-rustls", "async"] +runtime-tokio-hyper-rustls-webpki = ["async-stripe/runtime-tokio-hyper-rustls-webpki", "async"] +runtime-async-std-surf = ["async-stripe/runtime-async-std-surf", "async"] \ No newline at end of file diff --git a/examples/endpoints/src/checkout.rs b/examples/endpoints/src/checkout.rs new file mode 100644 index 000000000..8bec77d5d --- /dev/null +++ b/examples/endpoints/src/checkout.rs @@ -0,0 +1,91 @@ +//! Checkout +//! ======== +//! +//! Reference: +//! +//! This example shows how to build a checkout session for +//! a particular product and price. Creating a checkout +//! session generates a URL that the user can use to pay. +//! Notice you have to define the customer ahead of time. +//! If you'd rather avoid this, you can use a [stripe_types::PaymentLink]. + +use stripe::StripeError; +use stripe_checkout::checkout_session::{CreateCheckoutSession, CreateCheckoutSessionLineItems}; +use stripe_checkout::CheckoutSessionMode; +use stripe_core::customer::CreateCustomer; +use stripe_product::price::CreatePrice; +use stripe_product::product::CreateProduct; +use stripe_types::Expandable; + +pub async fn run_checkout_session_example(client: &stripe::Client) -> Result<(), StripeError> { + let metadata = + std::collections::HashMap::from([(String::from("async-stripe"), String::from("true"))]); + let customer = CreateCustomer { + name: Some("Alexander Lyon"), + email: Some("test@async-stripe.com"), + description: Some( + "A fake customer that is used to illustrate the examples in async-stripe.", + ), + metadata: Some(&metadata), + ..Default::default() + } + .send(client) + .await?; + + println!("created a customer at https://dashboard.stripe.com/test/customers/{}", customer.id); + + // create a new example product + let product = { + let mut create_product = CreateProduct::new("T-Shirt"); + create_product.metadata = Some(&metadata); + create_product.send(client).await? + }; + + // and add a price for it in USD + let price = { + let mut create_price = CreatePrice::new(stripe_types::Currency::USD); + create_price.product = Some(product.id.as_str()); + create_price.metadata = Some(&metadata); + create_price.unit_amount = Some(1000); + create_price.expand = Some(&["product"]); + create_price.send(client).await? + }; + + println!( + "created a product {:?} at price {} {}", + product.name, + price.unit_amount.unwrap() / 100, + price.currency + ); + + // finally, create a checkout session for this product / price + let line_items = vec![CreateCheckoutSessionLineItems { + quantity: Some(3), + price: Some(&price.id), + ..Default::default() + }]; + let checkout_session = { + let mut params = CreateCheckoutSession::new(); + params.cancel_url = Some("http://test.com/cancel"); + params.customer = Some(customer.id.as_str()); + params.mode = Some(CheckoutSessionMode::Payment); + params.line_items = Some(&line_items); + params.expand = Some(&["line_items", "line_items.data.price.product"]); + params.send(client).await? + }; + + let created_item = &checkout_session.line_items.expect("line items were created").data[0]; + println!( + "created a {} checkout session for {} {:?} for {} {} at {}", + checkout_session.payment_status, + created_item.quantity.unwrap(), + match &created_item.price.as_ref().unwrap().product { + Expandable::Object(p) => &p.name, + _ => panic!("product not found"), + }, + checkout_session.amount_subtotal.unwrap() / 100, + created_item.price.as_ref().unwrap().currency, + checkout_session.url.unwrap() + ); + Ok(()) +} diff --git a/examples/endpoints/src/connect.rs b/examples/endpoints/src/connect.rs new file mode 100644 index 000000000..9169ed0ee --- /dev/null +++ b/examples/endpoints/src/connect.rs @@ -0,0 +1,46 @@ +//! Stripe Connect +//! ============== +//! +//! Reference: +//! +//! This example shows how to manage a Stripe connect account, +//! initiating an account link which can be used to onboard a +//! new user to your application. +//! +//! Note: To get started, you'll need to make sure you have signed up to +//! use stripe connect and configure branding settings with an icon and a +//! brand color. See more: + +use stripe::StripeError; +use stripe_connect::account::{CapabilitiesParam, CapabilityParam, CreateAccount}; +use stripe_connect::account_link::{CreateAccountLink, CreateAccountLinkType}; +use stripe_connect::AccountType; + +pub async fn run_connect_example(client: &stripe::Client) -> Result<(), StripeError> { + let account = CreateAccount { + type_: Some(AccountType::Express), + capabilities: Some(CapabilitiesParam { + card_payments: Some(CapabilityParam { requested: Some(true) }), + transfers: Some(CapabilityParam { requested: Some(true) }), + ..Default::default() + }), + ..Default::default() + } + .send(client) + .await?; + + let link = CreateAccountLink { + account: &account.id, + type_: CreateAccountLinkType::AccountOnboarding, + refresh_url: Some("https://test.com/refresh"), + return_url: Some("https://test.com/return"), + expand: None, + collect: None, + collection_options: None, + } + .send(client) + .await?; + + println!("created a stripe connect link at {}", link.url); + Ok(()) +} diff --git a/examples/endpoints/src/customer.rs b/examples/endpoints/src/customer.rs new file mode 100644 index 000000000..c89394550 --- /dev/null +++ b/examples/endpoints/src/customer.rs @@ -0,0 +1,54 @@ +//! Customer +//! ======== +//! +//! Reference: +//! +//! This example shows how to create and list customers. + +use futures_util::StreamExt; +use futures_util::TryStreamExt; +use stripe::{Client, StripeError}; +use stripe_core::customer::{CreateCustomer, ListCustomer}; + +pub async fn run_customer_example(client: &Client) -> Result<(), StripeError> { + let meta = + std::collections::HashMap::from([(String::from("async-stripe"), String::from("true"))]); + let customer = CreateCustomer { + name: Some("Alexander Lyon"), + email: Some("test@async-stripe.com"), + description: Some( + "A fake customer that is used to illustrate the examples in async-stripe.", + ), + metadata: Some(&meta), + ..Default::default() + } + .send(client) + .await?; + + println!("created a customer at https://dashboard.stripe.com/test/customers/{}", customer.id); + + let customer = CreateCustomer { + name: Some("Someone Else"), + email: Some("test@async-stripe.com"), + description: Some( + "A fake customer that is used to illustrate the examples in async-stripe.", + ), + metadata: Some(&meta), + ..Default::default() + } + .send(client) + .await?; + + println!("created a customer at https://dashboard.stripe.com/test/customers/{}", customer.id); + + let mut stream = ListCustomer::new().paginate().stream(client); + + // get the next customer + let _next = stream.next().await.unwrap(); + + // or collect them + let customers = stream.try_collect::>().await.unwrap(); + + println!("fetched {} customers: {:?}", customers.len(), customers); + Ok(()) +} diff --git a/examples/endpoints/src/main.rs b/examples/endpoints/src/main.rs new file mode 100644 index 000000000..a36d290be --- /dev/null +++ b/examples/endpoints/src/main.rs @@ -0,0 +1,43 @@ +#[cfg(feature = "async")] +mod checkout; +#[cfg(feature = "async")] +mod connect; +#[cfg(feature = "async")] +mod customer; +#[cfg(feature = "async")] +mod payment_intent; +#[cfg(feature = "async")] +mod payment_link; +#[cfg(feature = "async")] +mod strategy; +#[cfg(feature = "async")] +mod subscriptions; + +#[cfg(feature = "async")] +#[tokio::main] +async fn main() -> Result<(), stripe::StripeError> { + use stripe::Client; + + use crate::checkout::run_checkout_session_example; + use crate::connect::run_connect_example; + use crate::customer::run_customer_example; + use crate::payment_intent::run_payment_intent_example; + use crate::payment_link::run_payment_link_example; + use crate::strategy::run_strategy_example; + use crate::subscriptions::run_subscriptions_example; + + let secret_key = + std::env::var("STRIPE_TEST_SECRET_KEY").expect("Missing STRIPE_TEST_SECRET_KEY in env"); + let client = Client::new(secret_key); + run_checkout_session_example(&client).await?; + run_connect_example(&client).await?; + run_customer_example(&client).await?; + run_payment_intent_example(&client).await?; + run_payment_link_example(&client).await?; + run_subscriptions_example(&client).await?; + run_strategy_example().await?; + Ok(()) +} + +#[cfg(not(feature = "async"))] +fn main() {} diff --git a/examples/endpoints/src/payment_intent.rs b/examples/endpoints/src/payment_intent.rs new file mode 100644 index 000000000..f6183c930 --- /dev/null +++ b/examples/endpoints/src/payment_intent.rs @@ -0,0 +1,94 @@ +//! Payment Intent +//! ============== +//! +//! Reference: +//! +//! This example shows how to create a [stripe_types::PaymentIntent] and use it to create a +//! charge for a fictional card. We create a customer, an intent, update +//! their payment information, and lastly use the intent to create a charge. + +use stripe::{Client, StripeError}; +use stripe_core::customer::CreateCustomer; +use stripe_core::payment_intent::{ConfirmPaymentIntent, CreatePaymentIntent, UpdatePaymentIntent}; +use stripe_payment::payment_method::{ + AttachPaymentMethod, CreatePaymentMethod, CreatePaymentMethodCard, + CreatePaymentMethodCardDetailsParams, CreatePaymentMethodType, +}; +use stripe_types::Currency; + +pub async fn run_payment_intent_example(client: &Client) -> Result<(), StripeError> { + let customer = CreateCustomer { + name: Some("Alexander Lyon"), + email: Some("test@async-stripe.com"), + description: Some( + "A fake customer that is used to illustrate the examples in async-stripe.", + ), + metadata: Some(&std::collections::HashMap::from([( + String::from("async-stripe"), + String::from("true"), + )])), + + ..Default::default() + } + .send(client) + .await?; + + println!("created a customer at https://dashboard.stripe.com/test/customers/{}", customer.id); + + // we create an intent to pay + let meta = [("color".to_string(), "red".to_string())].iter().cloned().collect(); + let payment_intent = { + let mut create_intent = CreatePaymentIntent::new(1000, Currency::USD); + create_intent.payment_method_types = Some(&["card"]); + create_intent.statement_descriptor = Some("Purchasing a new car"); + create_intent.metadata = Some(&meta); + create_intent.send(client).await? + }; + + println!( + "created a payment intent at https://dashboard.stripe.com/test/payments/{} with status '{}'", + payment_intent.id, payment_intent.status + ); + + let payment_method = { + let pm = CreatePaymentMethod { + type_: Some(CreatePaymentMethodType::Card), + card: Some(CreatePaymentMethodCard::CardDetailsParams( + CreatePaymentMethodCardDetailsParams { + number: "4000008260000000", // UK visa + exp_year: 2025, + exp_month: 1, + cvc: Some("123"), + }, + )), + ..Default::default() + } + .send(client) + .await?; + + AttachPaymentMethod { customer: &customer.id, expand: None }.send(client, &pm.id).await?; + + pm + }; + + println!( + "created a payment method with id {} and attached it to {}", + payment_method.id, + customer.name.unwrap() + ); + + // lets update the payment intent with their details + let payment_intent = UpdatePaymentIntent { + payment_method: Some(payment_method.id.as_str()), + customer: Some(customer.id.as_str()), // this is not strictly required but good practice to ensure we have the right person + ..Default::default() + } + .send(client, &payment_intent.id) + .await?; + + println!("updated payment intent with status '{}'", payment_intent.status); + + let payment_intent = ConfirmPaymentIntent::new().send(client, &payment_intent.id).await?; + println!("completed payment intent with status {}", payment_intent.status); + Ok(()) +} diff --git a/examples/endpoints/src/payment_link.rs b/examples/endpoints/src/payment_link.rs new file mode 100644 index 000000000..70559d15a --- /dev/null +++ b/examples/endpoints/src/payment_link.rs @@ -0,0 +1,53 @@ +//! Payment Link +//! ============ +//! +//! Reference: +//! +//! This example shows how to create a payment link for +//! a particular product and price. The nice thing with +//! this API is the lack of associated customer. + +use stripe::{Client, StripeError}; +use stripe_payment::payment_link::{CreatePaymentLink, CreatePaymentLinkLineItems}; +use stripe_product::price::CreatePrice; +use stripe_product::product::CreateProduct; +use stripe_types::Currency; + +pub async fn run_payment_link_example(client: &Client) -> Result<(), StripeError> { + // create a new example project + let meta = + std::collections::HashMap::from([(String::from("async-stripe"), String::from("true"))]); + let product = { + let mut create_product = CreateProduct::new("T-Shirt"); + create_product.metadata = Some(&meta); + create_product.send(client).await? + }; + + // and add a price for it in USD + let price = { + let mut create_price = CreatePrice::new(Currency::USD); + create_price.product = Some(product.id.as_str()); + create_price.metadata = Some(&meta); + create_price.unit_amount = Some(1000); + create_price.expand = Some(&["product"]); + create_price.send(client).await? + }; + + println!( + "created a product {:?} at price {} {}", + product.name, + price.unit_amount.unwrap() / 100, + price.currency, + ); + + let payment_link = CreatePaymentLink::new(&[CreatePaymentLinkLineItems { + adjustable_quantity: None, + quantity: 3, + price: &price.id, + }]) + .send(client) + .await?; + + println!("created a payment link {}", payment_link.url); + Ok(()) +} diff --git a/examples/endpoints/src/strategy.rs b/examples/endpoints/src/strategy.rs new file mode 100644 index 000000000..5586bccba --- /dev/null +++ b/examples/endpoints/src/strategy.rs @@ -0,0 +1,15 @@ +//! This example shows how to make a request with a specific `RequestStrategy`. +use stripe::{Client, RequestStrategy, StripeError}; +use stripe_core::customer::ListCustomer; + +pub async fn run_strategy_example() -> Result<(), StripeError> { + let secret_key = std::env::var("STRIPE_SECRET_KEY").expect("Missing STRIPE_SECRET_KEY in env"); + let client = Client::new(secret_key).with_strategy(RequestStrategy::idempotent_with_uuid()); + let first_page = ListCustomer::new().send(&client).await?; + + println!( + "first page of customers: {:#?}", + first_page.data.iter().map(|c| c.name.as_ref().unwrap()).collect::>() + ); + Ok(()) +} diff --git a/examples/endpoints/src/subscriptions.rs b/examples/endpoints/src/subscriptions.rs new file mode 100644 index 000000000..83ab13cfa --- /dev/null +++ b/examples/endpoints/src/subscriptions.rs @@ -0,0 +1,111 @@ +//! Subscription +//! ============ +//! +//! Reference: +//! +//! This example shows how to create a subscription for +//! a particular product and recurring price. + +use stripe::{Client, StripeError}; +use stripe_billing::subscription::{CreateSubscription, CreateSubscriptionItems}; +use stripe_core::customer::CreateCustomer; +use stripe_payment::payment_method::{ + AttachPaymentMethod, CreatePaymentMethod, CreatePaymentMethodCard, + CreatePaymentMethodCardDetailsParams, CreatePaymentMethodType, +}; +use stripe_product::price::{CreatePrice, CreatePriceRecurring, CreatePriceRecurringInterval}; +use stripe_product::product::CreateProduct; +use stripe_types::{Currency, Expandable}; + +pub async fn run_subscriptions_example(client: &Client) -> Result<(), StripeError> { + let meta = + std::collections::HashMap::from([(String::from("async-stripe"), String::from("true"))]); + let customer = CreateCustomer { + name: Some("Alexander Lyon"), + email: Some("test@async-stripe.com"), + description: Some( + "A fake customer that is used to illustrate the examples in async-stripe.", + ), + metadata: Some(&meta), + ..Default::default() + } + .send(client) + .await?; + + println!("created a customer at https://dashboard.stripe.com/test/customers/{}", customer.id); + + let payment_method = { + let pm = CreatePaymentMethod { + type_: Some(CreatePaymentMethodType::Card), + card: Some(CreatePaymentMethodCard::CardDetailsParams( + CreatePaymentMethodCardDetailsParams { + number: "4000008260000000", // UK visa + exp_year: 2025, + exp_month: 1, + cvc: Some("123"), + }, + )), + ..Default::default() + } + .send(client) + .await?; + + AttachPaymentMethod::new(&customer.id).send(client, &pm.id).await?; + pm + }; + + println!( + "created a payment method with id {} and attached it to {}", + payment_method.id, + customer.name.unwrap() + ); + + // create a new example product + let product = { + let mut create_product = CreateProduct::new("Monthly T-Shirt Subscription"); + create_product.metadata = Some(&meta); + create_product.send(client).await? + }; + + // and add a price for it in USD + let price = { + let mut create_price = CreatePrice::new(Currency::USD); + create_price.product = Some(&product.id); + create_price.metadata = Some(&meta); + create_price.unit_amount = Some(1000); + create_price.recurring = + Some(CreatePriceRecurring::new(CreatePriceRecurringInterval::Month)); + create_price.expand = Some(&["product"]); + create_price.send(client).await? + }; + + println!( + "created a product {:?} at price {} {}", + product.name, + price.unit_amount.unwrap() / 100, + price.currency, + ); + + let create_items = [CreateSubscriptionItems { price: Some(&price.id), ..Default::default() }]; + let subscription = { + let mut params = CreateSubscription::new(&customer.id); + params.items = Some(&create_items); + params.default_payment_method = Some(&payment_method.id); + params.expand = Some(&["items", "items.data.price.product", "schedule"]); + params.send(client).await? + }; + + println!( + "created a {} subscription for {:?} for {} {} per {} at https://dashboard.stripe.com/test/subscriptions/{}", + subscription.status, + match &subscription.items.data[0].price.product { + Expandable::Object(p) => &p.name, + _ => panic!("product not found"), + }, + subscription.items.data[0].price.unit_amount.unwrap() / 100, + subscription.items.data[0].price.currency, + subscription.items.data[0].price.recurring.as_ref().unwrap().interval, + subscription.id + ); + Ok(()) +} diff --git a/examples/pagination/Cargo.toml b/examples/pagination/Cargo.toml new file mode 100644 index 000000000..16919b358 --- /dev/null +++ b/examples/pagination/Cargo.toml @@ -0,0 +1,21 @@ +[package] +name = "pagination" +version = "0.1.0" +edition = "2021" +publish = false + +# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html + +[dependencies] +futures-util = "0.3.28" +tokio = { version = "1.24.1", features = ["rt-multi-thread", "macros"] } +async-stripe = {path = "../../async-stripe"} +stripe_core = {path = "../../generated/stripe_core", features = ["customer"]} + +[features] +async = [] + +runtime-tokio-hyper = ["async-stripe/runtime-tokio-hyper", "async"] +runtime-tokio-hyper-rustls = ["async-stripe/runtime-tokio-hyper-rustls", "async"] +runtime-tokio-hyper-rustls-webpki = ["async-stripe/runtime-tokio-hyper-rustls-webpki", "async"] +runtime-async-std-surf = ["async-stripe/runtime-async-std-surf", "async"] \ No newline at end of file diff --git a/examples/pagination/src/main.rs b/examples/pagination/src/main.rs new file mode 100644 index 000000000..e20da6967 --- /dev/null +++ b/examples/pagination/src/main.rs @@ -0,0 +1,24 @@ +#[cfg(feature = "async")] +#[tokio::main] +async fn main() -> Result<(), stripe::StripeError> { + use futures_util::TryStreamExt; + use stripe::Client; + use stripe_core::customer::ListCustomer; + + let secret_key = std::env::var("STRIPE_SECRET_KEY").expect("Missing STRIPE_SECRET_KEY in env"); + let client = Client::new(secret_key); + let paginator = ListCustomer::new().paginate(); + let mut stream = paginator.stream(&client); + + // take a value out from the stream + if let Some(val) = stream.try_next().await? { + println!("GOT = {:?}", val); + } + + // alternatively, you can use stream combinators + let _ = stream.try_collect::>().await?; + Ok(()) +} + +#[cfg(not(feature = "async"))] +fn main() {} diff --git a/examples/payment-intent.rs b/examples/payment-intent.rs deleted file mode 100644 index 3384e411c..000000000 --- a/examples/payment-intent.rs +++ /dev/null @@ -1,117 +0,0 @@ -//! Payment Intent -//! ============== -//! -//! Reference: -//! -//! This example shows how to creeate a [PaymentIntent] and use it to create a -//! charge for a fictional card. We create a customer, an intent, update -//! their payment information, and lastly use the intent to create a charge. - -use stripe::{ - AttachPaymentMethod, CardDetailsParams, Client, CreateCustomer, CreatePaymentIntent, - CreatePaymentMethod, CreatePaymentMethodCardUnion, Currency, Customer, PaymentIntent, - PaymentIntentConfirmParams, PaymentMethod, PaymentMethodTypeFilter, UpdatePaymentIntent, -}; - -#[tokio::main] -async fn main() { - let secret_key = std::env::var("STRIPE_SECRET_KEY").expect("Missing STRIPE_SECRET_KEY in env"); - let client = Client::new(secret_key); - - let customer = Customer::create( - &client, - CreateCustomer { - name: Some("Alexander Lyon"), - email: Some("test@async-stripe.com"), - description: Some( - "A fake customer that is used to illustrate the examples in async-stripe.", - ), - metadata: Some(std::collections::HashMap::from([( - String::from("async-stripe"), - String::from("true"), - )])), - - ..Default::default() - }, - ) - .await - .unwrap(); - - println!("created a customer at https://dashboard.stripe.com/test/customers/{}", customer.id); - - // we create an intent to pay - let payment_intent = { - let mut create_intent = CreatePaymentIntent::new(1000, Currency::USD); - create_intent.payment_method_types = Some(vec!["card".to_string()]); - create_intent.statement_descriptor = Some("Purchasing a new car"); - create_intent.metadata = - Some([("color".to_string(), "red".to_string())].iter().cloned().collect()); - - PaymentIntent::create(&client, create_intent).await.unwrap() - }; - - println!( - "created a payment intent at https://dashboard.stripe.com/test/payments/{} with status '{}'", - payment_intent.id, payment_intent.status - ); - - let payment_method = { - let pm = PaymentMethod::create( - &client, - CreatePaymentMethod { - type_: Some(PaymentMethodTypeFilter::Card), - card: Some(CreatePaymentMethodCardUnion::CardDetailsParams(CardDetailsParams { - number: "4000008260000000".to_string(), // UK visa - exp_year: 2025, - exp_month: 1, - cvc: Some("123".to_string()), - ..Default::default() - })), - ..Default::default() - }, - ) - .await - .unwrap(); - - PaymentMethod::attach( - &client, - &pm.id, - AttachPaymentMethod { customer: customer.id.clone() }, - ) - .await - .unwrap(); - - pm - }; - - println!( - "created a payment method with id {} and attached it to {}", - payment_method.id, - customer.name.unwrap() - ); - - // lets update the payment intent with their details - let payment_intent = PaymentIntent::update( - &client, - &payment_intent.id, - UpdatePaymentIntent { - payment_method: Some(payment_method.id), - customer: Some(customer.id), // this is not strictly required but good practice to ensure we have the right person - ..Default::default() - }, - ) - .await - .unwrap(); - - println!("updated payment intent with status '{}'", payment_intent.status); - - let payment_intent = PaymentIntent::confirm( - &client, - &payment_intent.id, - PaymentIntentConfirmParams { ..Default::default() }, - ) - .await - .unwrap(); - - println!("completed payment intent with status {}", payment_intent.status); -} diff --git a/examples/payment-link.rs b/examples/payment-link.rs deleted file mode 100644 index bd2a353f0..000000000 --- a/examples/payment-link.rs +++ /dev/null @@ -1,62 +0,0 @@ -//! Payment Link -//! ============ -//! -//! Reference: -//! -//! This example shows how to create a payment link for -//! a particular product and price. The nice thing with -//! this API is the lack of associated customer. - -use stripe::{ - Client, CreatePaymentLink, CreatePaymentLinkLineItems, CreatePrice, CreateProduct, Currency, - IdOrCreate, PaymentLink, Price, Product, -}; - -#[tokio::main] -async fn main() { - let secret_key = std::env::var("STRIPE_SECRET_KEY").expect("Missing STRIPE_SECRET_KEY in env"); - let client = Client::new(secret_key); - - // create a new example project - let product = { - let mut create_product = CreateProduct::new("T-Shirt"); - create_product.metadata = Some(std::collections::HashMap::from([( - String::from("async-stripe"), - String::from("true"), - )])); - Product::create(&client, create_product).await.unwrap() - }; - - // and add a price for it in USD - let price = { - let mut create_price = CreatePrice::new(Currency::USD); - create_price.product = Some(IdOrCreate::Id(&product.id)); - create_price.metadata = Some(std::collections::HashMap::from([( - String::from("async-stripe"), - String::from("true"), - )])); - create_price.unit_amount = Some(1000); - create_price.expand = &["product"]; - Price::create(&client, create_price).await.unwrap() - }; - - println!( - "created a product {:?} at price {} {}", - product.name.unwrap(), - price.unit_amount.unwrap() / 100, - price.currency.unwrap() - ); - - let payment_link = PaymentLink::create( - &client, - CreatePaymentLink::new(vec![CreatePaymentLinkLineItems { - quantity: 3, - price: price.id.to_string(), - ..Default::default() - }]), - ) - .await - .unwrap(); - - println!("created a payment link {}", payment_link.url); -} diff --git a/examples/strategy.rs b/examples/strategy.rs deleted file mode 100644 index a928ab7b4..000000000 --- a/examples/strategy.rs +++ /dev/null @@ -1,26 +0,0 @@ -//! Payment Link -//! ============ -//! -//! Reference: -//! -//! This example shows how to create a payment link for -//! a particular product and price. The nice thing with -//! this API is the lack of associated customer. - -use stripe::{Client, Customer, ListCustomers, RequestStrategy}; - -#[tokio::main] -async fn main() { - let secret_key = std::env::var("STRIPE_SECRET_KEY").expect("Missing STRIPE_SECRET_KEY in env"); - let client = Client::new(secret_key).with_strategy(RequestStrategy::idempotent_with_uuid()); - - let first_page = - Customer::list(&client, &ListCustomers { limit: Some(1), ..Default::default() }) - .await - .unwrap(); - - println!( - "first page of customers: {:#?}", - first_page.data.iter().map(|c| c.name.as_ref().unwrap()).collect::>() - ); -} diff --git a/examples/subscriptions.rs b/examples/subscriptions.rs deleted file mode 100644 index 391fc08b1..000000000 --- a/examples/subscriptions.rs +++ /dev/null @@ -1,135 +0,0 @@ -//! Subscription -//! ============ -//! -//! Reference: -//! -//! This example shows how to create a subscription for -//! a particular product and recurring price. - -use stripe::{ - AttachPaymentMethod, CardDetailsParams, Client, CreateCustomer, CreatePaymentMethod, - CreatePaymentMethodCardUnion, CreatePrice, CreatePriceRecurring, CreatePriceRecurringInterval, - CreateProduct, CreateSubscription, CreateSubscriptionItems, Currency, Customer, Expandable, - IdOrCreate, PaymentMethod, PaymentMethodTypeFilter, Price, Product, Subscription, -}; - -#[tokio::main] -async fn main() { - let secret_key = std::env::var("STRIPE_SECRET_KEY").expect("Missing STRIPE_SECRET_KEY in env"); - let client = Client::new(secret_key); - - let customer = Customer::create( - &client, - CreateCustomer { - name: Some("Alexander Lyon"), - email: Some("test@async-stripe.com"), - description: Some( - "A fake customer that is used to illustrate the examples in async-stripe.", - ), - metadata: Some(std::collections::HashMap::from([( - String::from("async-stripe"), - String::from("true"), - )])), - - ..Default::default() - }, - ) - .await - .unwrap(); - - println!("created a customer at https://dashboard.stripe.com/test/customers/{}", customer.id); - - let payment_method = { - let pm = PaymentMethod::create( - &client, - CreatePaymentMethod { - type_: Some(PaymentMethodTypeFilter::Card), - card: Some(CreatePaymentMethodCardUnion::CardDetailsParams(CardDetailsParams { - number: "4000008260000000".to_string(), // UK visa - exp_year: 2025, - exp_month: 1, - cvc: Some("123".to_string()), - ..Default::default() - })), - ..Default::default() - }, - ) - .await - .unwrap(); - - PaymentMethod::attach( - &client, - &pm.id, - AttachPaymentMethod { customer: customer.id.clone() }, - ) - .await - .unwrap(); - - pm - }; - - println!( - "created a payment method with id {} and attached it to {}", - payment_method.id, - customer.name.unwrap() - ); - - // create a new exmaple project - let product = { - let mut create_product = CreateProduct::new("Monthly T-Shirt Subscription"); - create_product.metadata = Some(std::collections::HashMap::from([( - String::from("async-stripe"), - String::from("true"), - )])); - Product::create(&client, create_product).await.unwrap() - }; - - // and add a price for it in USD - let price = { - let mut create_price = CreatePrice::new(Currency::USD); - create_price.product = Some(IdOrCreate::Id(&product.id)); - create_price.metadata = Some(std::collections::HashMap::from([( - String::from("async-stripe"), - String::from("true"), - )])); - create_price.unit_amount = Some(1000); - create_price.recurring = Some(CreatePriceRecurring { - interval: CreatePriceRecurringInterval::Month, - ..Default::default() - }); - create_price.expand = &["product"]; - Price::create(&client, create_price).await.unwrap() - }; - - println!( - "created a product {:?} at price {} {}", - product.name.unwrap(), - price.unit_amount.unwrap() / 100, - price.currency.unwrap() - ); - - let subscription = { - let mut params = CreateSubscription::new(customer.id); - params.items = Some(vec![CreateSubscriptionItems { - price: Some(price.id.to_string()), - ..Default::default() - }]); - params.default_payment_method = Some(&payment_method.id); - params.expand = &["items", "items.data.price.product", "schedule"]; - - Subscription::create(&client, params).await.unwrap() - }; - - println!( - "created a {} subscription for {:?} for {} {} per {} at https://dashboard.stripe.com/test/subscriptions/{}", - subscription.status, - match subscription.items.data[0].price.as_ref().unwrap().product.as_ref().unwrap() { - Expandable::Object(p) => p.name.as_ref().unwrap(), - _ => panic!("product not found"), - }, - subscription.items.data[0].price.as_ref().unwrap().unit_amount.unwrap() / 100, - subscription.items.data[0].price.as_ref().unwrap().currency.unwrap(), - subscription.items.data[0].price.as_ref().unwrap().recurring.as_ref().unwrap().interval, - subscription.id - ); -} diff --git a/examples/webhook-actix/Cargo.toml b/examples/webhook-actix/Cargo.toml new file mode 100644 index 000000000..36e266078 --- /dev/null +++ b/examples/webhook-actix/Cargo.toml @@ -0,0 +1,11 @@ +[package] +name = "webhook-actix" +version = "0.1.0" +edition = "2021" +publish = false + +[dependencies] +actix-web = "4.2.1" +stripe_webhook = {path = "../../stripe_webhook", features = ["stripe_checkout"]} +stripe_checkout = {path = "../../generated/stripe_checkout", features = ["runtime-tokio-hyper-rustls"]} +stripe_connect = {path = "../../generated/stripe_connect", features = ["runtime-tokio-hyper-rustls"]} diff --git a/examples/webhook-actix.rs b/examples/webhook-actix/src/main.rs similarity index 71% rename from examples/webhook-actix.rs rename to examples/webhook-actix/src/main.rs index 434f18fca..d2879c098 100644 --- a/examples/webhook-actix.rs +++ b/examples/webhook-actix/src/main.rs @@ -1,7 +1,7 @@ //! Web Hooks //! ========= //! -//! Reference: https://stripe.com/docs/webhooks/test +//! Reference: //! //! This example shows how to manage web hooks. //! To trigger it, you can use the stripe cli. @@ -17,7 +17,8 @@ use std::borrow::Borrow; use actix_web::{post, web, App, HttpRequest, HttpResponse, HttpServer}; -use stripe::{EventObject, EventType, Webhook, WebhookError}; +use stripe_connect::Account; +use stripe_webhook::{EventObject, Webhook, WebhookError}; #[actix_web::main] async fn main() -> std::io::Result<()> { @@ -36,16 +37,12 @@ pub fn handle_webhook(req: HttpRequest, payload: web::Bytes) -> Result<(), Webho let stripe_signature = get_header_value(&req, "Stripe-Signature").unwrap_or_default(); if let Ok(event) = Webhook::construct_event(payload_str, stripe_signature, "whsec_xxxxx") { - match event.type_ { - EventType::AccountUpdated => { - if let EventObject::Account(account) = event.data.object { - handle_account_updated(account)?; - } + match event.data.object { + EventObject::AccountUpdated(account) => { + handle_account_updated(account)?; } - EventType::CheckoutSessionCompleted => { - if let EventObject::CheckoutSession(session) = event.data.object { - handle_checkout_session(session)?; - } + EventObject::CheckoutSessionCompleted(session) => { + handle_checkout_session(session)?; } _ => { println!("Unknown event encountered in webhook: {:?}", event.type_); @@ -62,12 +59,12 @@ fn get_header_value<'b>(req: &'b HttpRequest, key: &'b str) -> Option<&'b str> { req.headers().get(key)?.to_str().ok() } -fn handle_account_updated(account: stripe::Account) -> Result<(), WebhookError> { +fn handle_account_updated(account: Account) -> Result<(), WebhookError> { println!("Received account updated webhook for account: {:?}", account.id); Ok(()) } -fn handle_checkout_session(session: stripe::CheckoutSession) -> Result<(), WebhookError> { +fn handle_checkout_session(session: stripe_checkout::CheckoutSession) -> Result<(), WebhookError> { println!("Received checkout session completed webhook with id: {:?}", session.id); Ok(()) } diff --git a/examples/webhook-axum/Cargo.toml b/examples/webhook-axum/Cargo.toml new file mode 100644 index 000000000..cf09b9ea1 --- /dev/null +++ b/examples/webhook-axum/Cargo.toml @@ -0,0 +1,11 @@ +[package] +name = "webhook-axum" +version = "0.1.0" +edition = "2021" +publish = false + +[dependencies] +tokio = { version = "1.24.1", features = ["rt-multi-thread", "macros"] } +axum = { version = "0.7.4", features = ["macros"] } +stripe_webhook = { path = "../../stripe_webhook", features = ["stripe_checkout"] } +async-trait = "0.1" \ No newline at end of file diff --git a/examples/webhook-axum.rs b/examples/webhook-axum/src/main.rs similarity index 74% rename from examples/webhook-axum.rs rename to examples/webhook-axum/src/main.rs index 27e985c59..993aa336d 100644 --- a/examples/webhook-axum.rs +++ b/examples/webhook-axum/src/main.rs @@ -21,7 +21,7 @@ use axum::{ routing::post, Error, Router, }; -use stripe::{Event, EventObject, EventType}; +use stripe_webhook::{Event, EventObject, Webhook}; pub type Result = std::result::Result; @@ -58,7 +58,7 @@ where String::from_request(req, state).await.map_err(IntoResponse::into_response)?; Ok(Self( - stripe::Webhook::construct_event(&payload, signature.to_str().unwrap(), "whsec_xxxxx") + Webhook::construct_event(&payload, signature.to_str().unwrap(), "whsec_xxxxx") .map_err(|_| StatusCode::BAD_REQUEST.into_response())?, )) } @@ -66,16 +66,12 @@ where #[axum::debug_handler] async fn handle_webhook(StripeEvent(event): StripeEvent) { - match event.type_ { - EventType::CheckoutSessionCompleted => { - if let EventObject::CheckoutSession(session) = event.data.object { - println!("Received checkout session completed webhook with id: {:?}", session.id); - } + match event.data.object { + EventObject::CheckoutSessionCompleted(session) => { + println!("Received checkout session completed webhook with id: {:?}", session.id); } - EventType::AccountUpdated => { - if let EventObject::Account(account) = event.data.object { - println!("Received account updated webhook for account: {:?}", account.id); - } + EventObject::AccountUpdated(account) => { + println!("Received account updated webhook for account: {:?}", account.id); } _ => println!("Unknown event encountered in webhook: {:?}", event.type_), } diff --git a/examples/webhook-rocket/Cargo.toml b/examples/webhook-rocket/Cargo.toml new file mode 100644 index 000000000..28abd7c76 --- /dev/null +++ b/examples/webhook-rocket/Cargo.toml @@ -0,0 +1,10 @@ +[package] +name = "webhook-rocket" +version = "0.1.0" +edition = "2021" +publish = false + +[dependencies] +rocket = "0.5.0" +stripe_webhook = {path = "../../stripe_webhook", features = ["stripe_checkout"]} +stripe_checkout = {path = "../../generated/stripe_checkout", features = ["runtime-tokio-hyper-rustls"]} \ No newline at end of file diff --git a/examples/webhook-rocket.rs b/examples/webhook-rocket/src/main.rs similarity index 66% rename from examples/webhook-rocket.rs rename to examples/webhook-rocket/src/main.rs index acf3cb793..f43e17b94 100644 --- a/examples/webhook-rocket.rs +++ b/examples/webhook-rocket/src/main.rs @@ -1,7 +1,7 @@ //! Web Hooks //! ========= //! -//! Reference: https://stripe.com/docs/webhooks/test +//! Reference: //! //! This example shows how to manage web hooks. //! To trigger it, you can use the stripe cli. @@ -17,8 +17,10 @@ extern crate rocket; use rocket::data::{self, Data, FromData, ToByteUnit}; use rocket::http::Status; -use rocket::request::{FromRequest, Outcome, Request}; -use stripe::{CheckoutSession, EventObject, EventType, Webhook}; +use rocket::outcome::Outcome; +use rocket::request::{FromRequest, Request}; +use stripe_checkout::CheckoutSession; +use stripe_webhook::{EventObject, Webhook}; #[launch] async fn rocket() -> _ { @@ -32,15 +34,11 @@ pub async fn stripe_webhooks(stripe_signature: StripeSignature<'_>, payload: Pay stripe_signature.signature, "webhook_secret_key", ) { - match event.event_type { - EventType::CheckoutSessionCompleted => { - if let EventObject::CheckoutSession(session) = event.data.object { - match checkout_session_completed(session) { - Ok(_) => Status::Accepted, - Err(_) => Status::BadRequest, - } - } else { - Status::BadRequest + match event.data.object { + EventObject::CheckoutSessionCompleted(session) => { + match checkout_session_completed(session) { + Ok(_) => Status::Accepted, + Err(_) => Status::BadRequest, } } _ => Status::Accepted, @@ -73,17 +71,14 @@ impl<'r> FromData<'r> for Payload { type Error = Error; async fn from_data(req: &'r Request<'_>, data: Data<'r>) -> data::Outcome<'r, Self> { - use rocket::outcome::Outcome::*; - use Error::*; - let limit = req.limits().get("form").unwrap_or_else(|| 1_000_000.bytes()); let contents = match data.open(limit).into_string().await { Ok(string) if string.is_complete() => string.into_inner(), - Ok(_) => return Failure((Status::PayloadTooLarge, TooLarge)), - Err(e) => return Failure((Status::InternalServerError, Io(e))), + Ok(_) => return Outcome::Error((Status::PayloadTooLarge, Error::TooLarge)), + Err(e) => return Outcome::Error((Status::InternalServerError, Error::Io(e))), }; - Success(Payload { contents }) + Outcome::Success(Payload { contents }) } } @@ -95,9 +90,9 @@ pub struct StripeSignature<'a> { impl<'r> FromRequest<'r> for StripeSignature<'r> { type Error = &'r str; - async fn from_request(req: &'r Request<'_>) -> Outcome { + async fn from_request(req: &'r Request<'_>) -> rocket::request::Outcome { match req.headers().get_one("Stripe-Signature") { - None => Outcome::Failure((Status::BadRequest, "No signature provided")), + None => Outcome::Error((Status::BadRequest, "No signature provided")), Some(signature) => Outcome::Success(StripeSignature { signature }), } } diff --git a/generated/stripe_billing/Cargo.toml b/generated/stripe_billing/Cargo.toml new file mode 100644 index 000000000..7d6c2572c --- /dev/null +++ b/generated/stripe_billing/Cargo.toml @@ -0,0 +1,76 @@ +[package] +name = "stripe_billing" +version.workspace = true +description.workspace = true +edition.workspace = true +rust-version.workspace = true +authors.workspace = true +license.workspace = true +homepage.workspace = true +repository.workspace = true +keywords.workspace = true +categories.workspace = true + +[lib] +path = "src/mod.rs" + +[dependencies] +serde.workspace = true +smol_str.workspace = true +serde_json.workspace = true +stripe_types = {path = "../../stripe_types"} + +http-types.workspace = true +async-stripe = {path = "../../async-stripe"} + + +stripe_shared = {path = "../../generated/stripe_shared"} + + +[features] +runtime-tokio-hyper = ["async-stripe/runtime-tokio-hyper"] +runtime-tokio-hyper-rustls = ["async-stripe/runtime-tokio-hyper-rustls"] +runtime-tokio-hyper-rustls-webpki = ["async-stripe/runtime-tokio-hyper-rustls-webpki"] +runtime-blocking = ["async-stripe/runtime-blocking"] +runtime-blocking-rustls = ["async-stripe/runtime-blocking-rustls"] +runtime-blocking-rustls-webpki = ["async-stripe/runtime-blocking-rustls-webpki"] +runtime-async-std-surf = ["async-stripe/runtime-async-std-surf"] + +billing_portal_configuration = [] +billing_portal_session = [] +credit_note = [] +credit_note_line_item = [] +invoice = [] +invoice_item = [] +invoice_line_item = [] +plan = [] +quote = [] +subscription = [] +subscription_item = [] +subscription_schedule = [] +tax_id = [] +test_helpers_test_clock = [] +usage_record = [] +usage_record_summary = [] + +full = ["billing_portal_configuration", +"billing_portal_session", +"credit_note", +"credit_note_line_item", +"invoice", +"invoice_item", +"invoice_line_item", +"plan", +"quote", +"subscription", +"subscription_item", +"subscription_schedule", +"tax_id", +"test_helpers_test_clock", +"usage_record", +"usage_record_summary"] + + +[package.metadata.docs.rs] +features = ["runtime-tokio-hyper", "full"] + diff --git a/generated/stripe_billing/src/billing_portal_configuration/mod.rs b/generated/stripe_billing/src/billing_portal_configuration/mod.rs new file mode 100644 index 000000000..bdfd53c4b --- /dev/null +++ b/generated/stripe_billing/src/billing_portal_configuration/mod.rs @@ -0,0 +1,5 @@ +#[cfg(feature = "billing_portal_configuration")] +mod requests; +pub(crate) mod types; +#[cfg(feature = "billing_portal_configuration")] +pub use requests::*; diff --git a/generated/stripe_billing/src/billing_portal_configuration/requests.rs b/generated/stripe_billing/src/billing_portal_configuration/requests.rs new file mode 100644 index 000000000..36d17f455 --- /dev/null +++ b/generated/stripe_billing/src/billing_portal_configuration/requests.rs @@ -0,0 +1,1208 @@ +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct ListBillingPortalConfiguration<'a> { + /// Only return configurations that are active or inactive (e.g., pass `true` to only list active configurations). + #[serde(skip_serializing_if = "Option::is_none")] + pub active: Option, + /// A cursor for use in pagination. + /// `ending_before` is an object ID that defines your place in the list. + /// For instance, if you make a list request and receive 100 objects, starting with `obj_bar`, your subsequent call can include `ending_before=obj_bar` in order to fetch the previous page of the list. + #[serde(skip_serializing_if = "Option::is_none")] + pub ending_before: Option<&'a str>, + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, + /// Only return the default or non-default configurations (e.g., pass `true` to only list the default configuration). + #[serde(skip_serializing_if = "Option::is_none")] + pub is_default: Option, + /// A limit on the number of objects to be returned. + /// Limit can range between 1 and 100, and the default is 10. + #[serde(skip_serializing_if = "Option::is_none")] + pub limit: Option, + /// A cursor for use in pagination. + /// `starting_after` is an object ID that defines your place in the list. + /// For instance, if you make a list request and receive 100 objects, ending with `obj_foo`, your subsequent call can include `starting_after=obj_foo` in order to fetch the next page of the list. + #[serde(skip_serializing_if = "Option::is_none")] + pub starting_after: Option<&'a str>, +} +impl<'a> ListBillingPortalConfiguration<'a> { + pub fn new() -> Self { + Self::default() + } +} +impl<'a> ListBillingPortalConfiguration<'a> { + /// Returns a list of configurations that describe the functionality of the customer portal. + pub fn send( + &self, + client: &stripe::Client, + ) -> stripe::Response> { + client.get_query("/billing_portal/configurations", self) + } + pub fn paginate( + self, + ) -> stripe::ListPaginator> { + stripe::ListPaginator::from_list_params("/billing_portal/configurations", self) + } +} +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct RetrieveBillingPortalConfiguration<'a> { + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, +} +impl<'a> RetrieveBillingPortalConfiguration<'a> { + pub fn new() -> Self { + Self::default() + } +} +impl<'a> RetrieveBillingPortalConfiguration<'a> { + /// Retrieves a configuration that describes the functionality of the customer portal. + pub fn send( + &self, + client: &stripe::Client, + configuration: &stripe_billing::BillingPortalConfigurationId, + ) -> stripe::Response { + client.get_query(&format!("/billing_portal/configurations/{configuration}"), self) + } +} +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreateBillingPortalConfiguration<'a> { + /// The business information shown to customers in the portal. + pub business_profile: CreateBillingPortalConfigurationBusinessProfile<'a>, + /// The default URL to redirect customers to when they click on the portal's link to return to your website. + /// This can be [overriden](https://stripe.com/docs/api/customer_portal/sessions/create#create_portal_session-return_url) when creating the session. + #[serde(skip_serializing_if = "Option::is_none")] + pub default_return_url: Option<&'a str>, + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, + /// Information about the features available in the portal. + pub features: CreateBillingPortalConfigurationFeatures<'a>, + /// The hosted login page for this configuration. + /// Learn more about the portal login page in our [integration docs](https://stripe.com/docs/billing/subscriptions/integrating-customer-portal#share). + #[serde(skip_serializing_if = "Option::is_none")] + pub login_page: Option, + /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. + /// This can be useful for storing additional information about the object in a structured format. + /// Individual keys can be unset by posting an empty value to them. + /// All keys can be unset by posting an empty value to `metadata`. + #[serde(skip_serializing_if = "Option::is_none")] + pub metadata: Option<&'a std::collections::HashMap>, +} +impl<'a> CreateBillingPortalConfiguration<'a> { + pub fn new( + business_profile: CreateBillingPortalConfigurationBusinessProfile<'a>, + features: CreateBillingPortalConfigurationFeatures<'a>, + ) -> Self { + Self { + business_profile, + default_return_url: None, + expand: None, + features, + login_page: None, + metadata: None, + } + } +} +/// The business information shown to customers in the portal. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreateBillingPortalConfigurationBusinessProfile<'a> { + /// The messaging shown to customers in the portal. + #[serde(skip_serializing_if = "Option::is_none")] + pub headline: Option<&'a str>, + /// A link to the business’s publicly available privacy policy. + #[serde(skip_serializing_if = "Option::is_none")] + pub privacy_policy_url: Option<&'a str>, + /// A link to the business’s publicly available terms of service. + #[serde(skip_serializing_if = "Option::is_none")] + pub terms_of_service_url: Option<&'a str>, +} +impl<'a> CreateBillingPortalConfigurationBusinessProfile<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// Information about the features available in the portal. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreateBillingPortalConfigurationFeatures<'a> { + /// Information about updating the customer details in the portal. + #[serde(skip_serializing_if = "Option::is_none")] + pub customer_update: Option>, + /// Information about showing the billing history in the portal. + #[serde(skip_serializing_if = "Option::is_none")] + pub invoice_history: Option, + /// Information about updating payment methods in the portal. + #[serde(skip_serializing_if = "Option::is_none")] + pub payment_method_update: Option, + /// Information about canceling subscriptions in the portal. + #[serde(skip_serializing_if = "Option::is_none")] + pub subscription_cancel: Option>, + /// Information about pausing subscriptions in the portal. + #[serde(skip_serializing_if = "Option::is_none")] + pub subscription_pause: Option, + /// Information about updating subscriptions in the portal. + #[serde(skip_serializing_if = "Option::is_none")] + pub subscription_update: Option>, +} +impl<'a> CreateBillingPortalConfigurationFeatures<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// Information about updating the customer details in the portal. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreateBillingPortalConfigurationFeaturesCustomerUpdate<'a> { + /// The types of customer updates that are supported. When empty, customers are not updateable. + #[serde(skip_serializing_if = "Option::is_none")] + pub allowed_updates: + Option<&'a [CreateBillingPortalConfigurationFeaturesCustomerUpdateAllowedUpdates]>, + /// Whether the feature is enabled. + pub enabled: bool, +} +impl<'a> CreateBillingPortalConfigurationFeaturesCustomerUpdate<'a> { + pub fn new(enabled: bool) -> Self { + Self { allowed_updates: None, enabled } + } +} +/// The types of customer updates that are supported. When empty, customers are not updateable. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreateBillingPortalConfigurationFeaturesCustomerUpdateAllowedUpdates { + Address, + Email, + Name, + Phone, + Shipping, + TaxId, +} +impl CreateBillingPortalConfigurationFeaturesCustomerUpdateAllowedUpdates { + pub fn as_str(self) -> &'static str { + use CreateBillingPortalConfigurationFeaturesCustomerUpdateAllowedUpdates::*; + match self { + Address => "address", + Email => "email", + Name => "name", + Phone => "phone", + Shipping => "shipping", + TaxId => "tax_id", + } + } +} + +impl std::str::FromStr for CreateBillingPortalConfigurationFeaturesCustomerUpdateAllowedUpdates { + type Err = (); + fn from_str(s: &str) -> Result { + use CreateBillingPortalConfigurationFeaturesCustomerUpdateAllowedUpdates::*; + match s { + "address" => Ok(Address), + "email" => Ok(Email), + "name" => Ok(Name), + "phone" => Ok(Phone), + "shipping" => Ok(Shipping), + "tax_id" => Ok(TaxId), + _ => Err(()), + } + } +} +impl std::fmt::Display for CreateBillingPortalConfigurationFeaturesCustomerUpdateAllowedUpdates { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreateBillingPortalConfigurationFeaturesCustomerUpdateAllowedUpdates { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreateBillingPortalConfigurationFeaturesCustomerUpdateAllowedUpdates { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Information about showing the billing history in the portal. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreateBillingPortalConfigurationFeaturesInvoiceHistory { + /// Whether the feature is enabled. + pub enabled: bool, +} +impl CreateBillingPortalConfigurationFeaturesInvoiceHistory { + pub fn new(enabled: bool) -> Self { + Self { enabled } + } +} +/// Information about updating payment methods in the portal. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreateBillingPortalConfigurationFeaturesPaymentMethodUpdate { + /// Whether the feature is enabled. + pub enabled: bool, +} +impl CreateBillingPortalConfigurationFeaturesPaymentMethodUpdate { + pub fn new(enabled: bool) -> Self { + Self { enabled } + } +} +/// Information about canceling subscriptions in the portal. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreateBillingPortalConfigurationFeaturesSubscriptionCancel<'a> { + /// Whether the cancellation reasons will be collected in the portal and which options are exposed to the customer. + #[serde(skip_serializing_if = "Option::is_none")] + pub cancellation_reason: + Option>, + /// Whether the feature is enabled. + pub enabled: bool, + /// Whether to cancel subscriptions immediately or at the end of the billing period. + #[serde(skip_serializing_if = "Option::is_none")] + pub mode: Option, + /// Whether to create prorations when canceling subscriptions. + /// Possible values are `none` and `create_prorations`, which is only compatible with `mode=immediately`. + /// No prorations are generated when canceling a subscription at the end of its natural billing period. + #[serde(skip_serializing_if = "Option::is_none")] + pub proration_behavior: + Option, +} +impl<'a> CreateBillingPortalConfigurationFeaturesSubscriptionCancel<'a> { + pub fn new(enabled: bool) -> Self { + Self { cancellation_reason: None, enabled, mode: None, proration_behavior: None } + } +} +/// Whether the cancellation reasons will be collected in the portal and which options are exposed to the customer. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreateBillingPortalConfigurationFeaturesSubscriptionCancelCancellationReason<'a> { + /// Whether the feature is enabled. + pub enabled: bool, + /// Which cancellation reasons will be given as options to the customer. + pub options: + &'a [CreateBillingPortalConfigurationFeaturesSubscriptionCancelCancellationReasonOptions], +} +impl<'a> CreateBillingPortalConfigurationFeaturesSubscriptionCancelCancellationReason<'a> { + pub fn new( + enabled: bool, + options: &'a [CreateBillingPortalConfigurationFeaturesSubscriptionCancelCancellationReasonOptions], + ) -> Self { + Self { enabled, options } + } +} +/// Which cancellation reasons will be given as options to the customer. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreateBillingPortalConfigurationFeaturesSubscriptionCancelCancellationReasonOptions { + CustomerService, + LowQuality, + MissingFeatures, + Other, + SwitchedService, + TooComplex, + TooExpensive, + Unused, +} +impl CreateBillingPortalConfigurationFeaturesSubscriptionCancelCancellationReasonOptions { + pub fn as_str(self) -> &'static str { + use CreateBillingPortalConfigurationFeaturesSubscriptionCancelCancellationReasonOptions::*; + match self { + CustomerService => "customer_service", + LowQuality => "low_quality", + MissingFeatures => "missing_features", + Other => "other", + SwitchedService => "switched_service", + TooComplex => "too_complex", + TooExpensive => "too_expensive", + Unused => "unused", + } + } +} + +impl std::str::FromStr + for CreateBillingPortalConfigurationFeaturesSubscriptionCancelCancellationReasonOptions +{ + type Err = (); + fn from_str(s: &str) -> Result { + use CreateBillingPortalConfigurationFeaturesSubscriptionCancelCancellationReasonOptions::*; + match s { + "customer_service" => Ok(CustomerService), + "low_quality" => Ok(LowQuality), + "missing_features" => Ok(MissingFeatures), + "other" => Ok(Other), + "switched_service" => Ok(SwitchedService), + "too_complex" => Ok(TooComplex), + "too_expensive" => Ok(TooExpensive), + "unused" => Ok(Unused), + _ => Err(()), + } + } +} +impl std::fmt::Display + for CreateBillingPortalConfigurationFeaturesSubscriptionCancelCancellationReasonOptions +{ + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug + for CreateBillingPortalConfigurationFeaturesSubscriptionCancelCancellationReasonOptions +{ + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize + for CreateBillingPortalConfigurationFeaturesSubscriptionCancelCancellationReasonOptions +{ + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Whether to cancel subscriptions immediately or at the end of the billing period. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreateBillingPortalConfigurationFeaturesSubscriptionCancelMode { + AtPeriodEnd, + Immediately, +} +impl CreateBillingPortalConfigurationFeaturesSubscriptionCancelMode { + pub fn as_str(self) -> &'static str { + use CreateBillingPortalConfigurationFeaturesSubscriptionCancelMode::*; + match self { + AtPeriodEnd => "at_period_end", + Immediately => "immediately", + } + } +} + +impl std::str::FromStr for CreateBillingPortalConfigurationFeaturesSubscriptionCancelMode { + type Err = (); + fn from_str(s: &str) -> Result { + use CreateBillingPortalConfigurationFeaturesSubscriptionCancelMode::*; + match s { + "at_period_end" => Ok(AtPeriodEnd), + "immediately" => Ok(Immediately), + _ => Err(()), + } + } +} +impl std::fmt::Display for CreateBillingPortalConfigurationFeaturesSubscriptionCancelMode { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreateBillingPortalConfigurationFeaturesSubscriptionCancelMode { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreateBillingPortalConfigurationFeaturesSubscriptionCancelMode { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Whether to create prorations when canceling subscriptions. +/// Possible values are `none` and `create_prorations`, which is only compatible with `mode=immediately`. +/// No prorations are generated when canceling a subscription at the end of its natural billing period. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreateBillingPortalConfigurationFeaturesSubscriptionCancelProrationBehavior { + AlwaysInvoice, + CreateProrations, + None, +} +impl CreateBillingPortalConfigurationFeaturesSubscriptionCancelProrationBehavior { + pub fn as_str(self) -> &'static str { + use CreateBillingPortalConfigurationFeaturesSubscriptionCancelProrationBehavior::*; + match self { + AlwaysInvoice => "always_invoice", + CreateProrations => "create_prorations", + None => "none", + } + } +} + +impl std::str::FromStr + for CreateBillingPortalConfigurationFeaturesSubscriptionCancelProrationBehavior +{ + type Err = (); + fn from_str(s: &str) -> Result { + use CreateBillingPortalConfigurationFeaturesSubscriptionCancelProrationBehavior::*; + match s { + "always_invoice" => Ok(AlwaysInvoice), + "create_prorations" => Ok(CreateProrations), + "none" => Ok(None), + _ => Err(()), + } + } +} +impl std::fmt::Display + for CreateBillingPortalConfigurationFeaturesSubscriptionCancelProrationBehavior +{ + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug + for CreateBillingPortalConfigurationFeaturesSubscriptionCancelProrationBehavior +{ + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize + for CreateBillingPortalConfigurationFeaturesSubscriptionCancelProrationBehavior +{ + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Information about updating subscriptions in the portal. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreateBillingPortalConfigurationFeaturesSubscriptionUpdate<'a> { + /// The types of subscription updates that are supported. When empty, subscriptions are not updateable. + pub default_allowed_updates: + &'a [CreateBillingPortalConfigurationFeaturesSubscriptionUpdateDefaultAllowedUpdates], + /// Whether the feature is enabled. + pub enabled: bool, + /// The list of up to 10 products that support subscription updates. + pub products: &'a [SubscriptionUpdateProductParam<'a>], + /// Determines how to handle prorations resulting from subscription updates. + /// Valid values are `none`, `create_prorations`, and `always_invoice`. + #[serde(skip_serializing_if = "Option::is_none")] + pub proration_behavior: + Option, +} +impl<'a> CreateBillingPortalConfigurationFeaturesSubscriptionUpdate<'a> { + pub fn new( + default_allowed_updates: &'a [CreateBillingPortalConfigurationFeaturesSubscriptionUpdateDefaultAllowedUpdates], + enabled: bool, + products: &'a [SubscriptionUpdateProductParam<'a>], + ) -> Self { + Self { default_allowed_updates, enabled, products, proration_behavior: None } + } +} +/// The types of subscription updates that are supported. When empty, subscriptions are not updateable. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreateBillingPortalConfigurationFeaturesSubscriptionUpdateDefaultAllowedUpdates { + Price, + PromotionCode, + Quantity, +} +impl CreateBillingPortalConfigurationFeaturesSubscriptionUpdateDefaultAllowedUpdates { + pub fn as_str(self) -> &'static str { + use CreateBillingPortalConfigurationFeaturesSubscriptionUpdateDefaultAllowedUpdates::*; + match self { + Price => "price", + PromotionCode => "promotion_code", + Quantity => "quantity", + } + } +} + +impl std::str::FromStr + for CreateBillingPortalConfigurationFeaturesSubscriptionUpdateDefaultAllowedUpdates +{ + type Err = (); + fn from_str(s: &str) -> Result { + use CreateBillingPortalConfigurationFeaturesSubscriptionUpdateDefaultAllowedUpdates::*; + match s { + "price" => Ok(Price), + "promotion_code" => Ok(PromotionCode), + "quantity" => Ok(Quantity), + _ => Err(()), + } + } +} +impl std::fmt::Display + for CreateBillingPortalConfigurationFeaturesSubscriptionUpdateDefaultAllowedUpdates +{ + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug + for CreateBillingPortalConfigurationFeaturesSubscriptionUpdateDefaultAllowedUpdates +{ + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize + for CreateBillingPortalConfigurationFeaturesSubscriptionUpdateDefaultAllowedUpdates +{ + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Determines how to handle prorations resulting from subscription updates. +/// Valid values are `none`, `create_prorations`, and `always_invoice`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreateBillingPortalConfigurationFeaturesSubscriptionUpdateProrationBehavior { + AlwaysInvoice, + CreateProrations, + None, +} +impl CreateBillingPortalConfigurationFeaturesSubscriptionUpdateProrationBehavior { + pub fn as_str(self) -> &'static str { + use CreateBillingPortalConfigurationFeaturesSubscriptionUpdateProrationBehavior::*; + match self { + AlwaysInvoice => "always_invoice", + CreateProrations => "create_prorations", + None => "none", + } + } +} + +impl std::str::FromStr + for CreateBillingPortalConfigurationFeaturesSubscriptionUpdateProrationBehavior +{ + type Err = (); + fn from_str(s: &str) -> Result { + use CreateBillingPortalConfigurationFeaturesSubscriptionUpdateProrationBehavior::*; + match s { + "always_invoice" => Ok(AlwaysInvoice), + "create_prorations" => Ok(CreateProrations), + "none" => Ok(None), + _ => Err(()), + } + } +} +impl std::fmt::Display + for CreateBillingPortalConfigurationFeaturesSubscriptionUpdateProrationBehavior +{ + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug + for CreateBillingPortalConfigurationFeaturesSubscriptionUpdateProrationBehavior +{ + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize + for CreateBillingPortalConfigurationFeaturesSubscriptionUpdateProrationBehavior +{ + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// The hosted login page for this configuration. +/// Learn more about the portal login page in our [integration docs](https://stripe.com/docs/billing/subscriptions/integrating-customer-portal#share). +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreateBillingPortalConfigurationLoginPage { + /// Set to `true` to generate a shareable URL [`login_page.url`](https://stripe.com/docs/api/customer_portal/configuration#portal_configuration_object-login_page-url) that will take your customers to a hosted login page for the customer portal. + pub enabled: bool, +} +impl CreateBillingPortalConfigurationLoginPage { + pub fn new(enabled: bool) -> Self { + Self { enabled } + } +} +impl<'a> CreateBillingPortalConfiguration<'a> { + /// Creates a configuration that describes the functionality and behavior of a PortalSession + pub fn send( + &self, + client: &stripe::Client, + ) -> stripe::Response { + client.send_form("/billing_portal/configurations", self, http_types::Method::Post) + } +} +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdateBillingPortalConfiguration<'a> { + /// Whether the configuration is active and can be used to create portal sessions. + #[serde(skip_serializing_if = "Option::is_none")] + pub active: Option, + /// The business information shown to customers in the portal. + #[serde(skip_serializing_if = "Option::is_none")] + pub business_profile: Option>, + /// The default URL to redirect customers to when they click on the portal's link to return to your website. + /// This can be [overriden](https://stripe.com/docs/api/customer_portal/sessions/create#create_portal_session-return_url) when creating the session. + #[serde(skip_serializing_if = "Option::is_none")] + pub default_return_url: Option<&'a str>, + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, + /// Information about the features available in the portal. + #[serde(skip_serializing_if = "Option::is_none")] + pub features: Option>, + /// The hosted login page for this configuration. + /// Learn more about the portal login page in our [integration docs](https://stripe.com/docs/billing/subscriptions/integrating-customer-portal#share). + #[serde(skip_serializing_if = "Option::is_none")] + pub login_page: Option, + /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. + /// This can be useful for storing additional information about the object in a structured format. + /// Individual keys can be unset by posting an empty value to them. + /// All keys can be unset by posting an empty value to `metadata`. + #[serde(skip_serializing_if = "Option::is_none")] + pub metadata: Option<&'a std::collections::HashMap>, +} +impl<'a> UpdateBillingPortalConfiguration<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// The business information shown to customers in the portal. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdateBillingPortalConfigurationBusinessProfile<'a> { + /// The messaging shown to customers in the portal. + #[serde(skip_serializing_if = "Option::is_none")] + pub headline: Option<&'a str>, + /// A link to the business’s publicly available privacy policy. + #[serde(skip_serializing_if = "Option::is_none")] + pub privacy_policy_url: Option<&'a str>, + /// A link to the business’s publicly available terms of service. + #[serde(skip_serializing_if = "Option::is_none")] + pub terms_of_service_url: Option<&'a str>, +} +impl<'a> UpdateBillingPortalConfigurationBusinessProfile<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// Information about the features available in the portal. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdateBillingPortalConfigurationFeatures<'a> { + /// Information about updating the customer details in the portal. + #[serde(skip_serializing_if = "Option::is_none")] + pub customer_update: Option>, + /// Information about showing the billing history in the portal. + #[serde(skip_serializing_if = "Option::is_none")] + pub invoice_history: Option, + /// Information about updating payment methods in the portal. + #[serde(skip_serializing_if = "Option::is_none")] + pub payment_method_update: Option, + /// Information about canceling subscriptions in the portal. + #[serde(skip_serializing_if = "Option::is_none")] + pub subscription_cancel: Option>, + /// Information about pausing subscriptions in the portal. + #[serde(skip_serializing_if = "Option::is_none")] + pub subscription_pause: Option, + /// Information about updating subscriptions in the portal. + #[serde(skip_serializing_if = "Option::is_none")] + pub subscription_update: Option>, +} +impl<'a> UpdateBillingPortalConfigurationFeatures<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// Information about updating the customer details in the portal. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdateBillingPortalConfigurationFeaturesCustomerUpdate<'a> { + /// The types of customer updates that are supported. When empty, customers are not updateable. + #[serde(skip_serializing_if = "Option::is_none")] + pub allowed_updates: + Option<&'a [UpdateBillingPortalConfigurationFeaturesCustomerUpdateAllowedUpdates]>, + /// Whether the feature is enabled. + #[serde(skip_serializing_if = "Option::is_none")] + pub enabled: Option, +} +impl<'a> UpdateBillingPortalConfigurationFeaturesCustomerUpdate<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// The types of customer updates that are supported. When empty, customers are not updateable. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum UpdateBillingPortalConfigurationFeaturesCustomerUpdateAllowedUpdates { + Address, + Email, + Name, + Phone, + Shipping, + TaxId, +} +impl UpdateBillingPortalConfigurationFeaturesCustomerUpdateAllowedUpdates { + pub fn as_str(self) -> &'static str { + use UpdateBillingPortalConfigurationFeaturesCustomerUpdateAllowedUpdates::*; + match self { + Address => "address", + Email => "email", + Name => "name", + Phone => "phone", + Shipping => "shipping", + TaxId => "tax_id", + } + } +} + +impl std::str::FromStr for UpdateBillingPortalConfigurationFeaturesCustomerUpdateAllowedUpdates { + type Err = (); + fn from_str(s: &str) -> Result { + use UpdateBillingPortalConfigurationFeaturesCustomerUpdateAllowedUpdates::*; + match s { + "address" => Ok(Address), + "email" => Ok(Email), + "name" => Ok(Name), + "phone" => Ok(Phone), + "shipping" => Ok(Shipping), + "tax_id" => Ok(TaxId), + _ => Err(()), + } + } +} +impl std::fmt::Display for UpdateBillingPortalConfigurationFeaturesCustomerUpdateAllowedUpdates { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for UpdateBillingPortalConfigurationFeaturesCustomerUpdateAllowedUpdates { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for UpdateBillingPortalConfigurationFeaturesCustomerUpdateAllowedUpdates { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Information about showing the billing history in the portal. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct UpdateBillingPortalConfigurationFeaturesInvoiceHistory { + /// Whether the feature is enabled. + pub enabled: bool, +} +impl UpdateBillingPortalConfigurationFeaturesInvoiceHistory { + pub fn new(enabled: bool) -> Self { + Self { enabled } + } +} +/// Information about updating payment methods in the portal. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct UpdateBillingPortalConfigurationFeaturesPaymentMethodUpdate { + /// Whether the feature is enabled. + pub enabled: bool, +} +impl UpdateBillingPortalConfigurationFeaturesPaymentMethodUpdate { + pub fn new(enabled: bool) -> Self { + Self { enabled } + } +} +/// Information about canceling subscriptions in the portal. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdateBillingPortalConfigurationFeaturesSubscriptionCancel<'a> { + /// Whether the cancellation reasons will be collected in the portal and which options are exposed to the customer. + #[serde(skip_serializing_if = "Option::is_none")] + pub cancellation_reason: + Option>, + /// Whether the feature is enabled. + #[serde(skip_serializing_if = "Option::is_none")] + pub enabled: Option, + /// Whether to cancel subscriptions immediately or at the end of the billing period. + #[serde(skip_serializing_if = "Option::is_none")] + pub mode: Option, + /// Whether to create prorations when canceling subscriptions. + /// Possible values are `none` and `create_prorations`, which is only compatible with `mode=immediately`. + /// No prorations are generated when canceling a subscription at the end of its natural billing period. + #[serde(skip_serializing_if = "Option::is_none")] + pub proration_behavior: + Option, +} +impl<'a> UpdateBillingPortalConfigurationFeaturesSubscriptionCancel<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// Whether the cancellation reasons will be collected in the portal and which options are exposed to the customer. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct UpdateBillingPortalConfigurationFeaturesSubscriptionCancelCancellationReason<'a> { + /// Whether the feature is enabled. + pub enabled: bool, + /// Which cancellation reasons will be given as options to the customer. + #[serde(skip_serializing_if = "Option::is_none")] + pub options: Option< + &'a [UpdateBillingPortalConfigurationFeaturesSubscriptionCancelCancellationReasonOptions], + >, +} +impl<'a> UpdateBillingPortalConfigurationFeaturesSubscriptionCancelCancellationReason<'a> { + pub fn new(enabled: bool) -> Self { + Self { enabled, options: None } + } +} +/// Which cancellation reasons will be given as options to the customer. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum UpdateBillingPortalConfigurationFeaturesSubscriptionCancelCancellationReasonOptions { + CustomerService, + LowQuality, + MissingFeatures, + Other, + SwitchedService, + TooComplex, + TooExpensive, + Unused, +} +impl UpdateBillingPortalConfigurationFeaturesSubscriptionCancelCancellationReasonOptions { + pub fn as_str(self) -> &'static str { + use UpdateBillingPortalConfigurationFeaturesSubscriptionCancelCancellationReasonOptions::*; + match self { + CustomerService => "customer_service", + LowQuality => "low_quality", + MissingFeatures => "missing_features", + Other => "other", + SwitchedService => "switched_service", + TooComplex => "too_complex", + TooExpensive => "too_expensive", + Unused => "unused", + } + } +} + +impl std::str::FromStr + for UpdateBillingPortalConfigurationFeaturesSubscriptionCancelCancellationReasonOptions +{ + type Err = (); + fn from_str(s: &str) -> Result { + use UpdateBillingPortalConfigurationFeaturesSubscriptionCancelCancellationReasonOptions::*; + match s { + "customer_service" => Ok(CustomerService), + "low_quality" => Ok(LowQuality), + "missing_features" => Ok(MissingFeatures), + "other" => Ok(Other), + "switched_service" => Ok(SwitchedService), + "too_complex" => Ok(TooComplex), + "too_expensive" => Ok(TooExpensive), + "unused" => Ok(Unused), + _ => Err(()), + } + } +} +impl std::fmt::Display + for UpdateBillingPortalConfigurationFeaturesSubscriptionCancelCancellationReasonOptions +{ + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug + for UpdateBillingPortalConfigurationFeaturesSubscriptionCancelCancellationReasonOptions +{ + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize + for UpdateBillingPortalConfigurationFeaturesSubscriptionCancelCancellationReasonOptions +{ + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Whether to cancel subscriptions immediately or at the end of the billing period. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum UpdateBillingPortalConfigurationFeaturesSubscriptionCancelMode { + AtPeriodEnd, + Immediately, +} +impl UpdateBillingPortalConfigurationFeaturesSubscriptionCancelMode { + pub fn as_str(self) -> &'static str { + use UpdateBillingPortalConfigurationFeaturesSubscriptionCancelMode::*; + match self { + AtPeriodEnd => "at_period_end", + Immediately => "immediately", + } + } +} + +impl std::str::FromStr for UpdateBillingPortalConfigurationFeaturesSubscriptionCancelMode { + type Err = (); + fn from_str(s: &str) -> Result { + use UpdateBillingPortalConfigurationFeaturesSubscriptionCancelMode::*; + match s { + "at_period_end" => Ok(AtPeriodEnd), + "immediately" => Ok(Immediately), + _ => Err(()), + } + } +} +impl std::fmt::Display for UpdateBillingPortalConfigurationFeaturesSubscriptionCancelMode { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for UpdateBillingPortalConfigurationFeaturesSubscriptionCancelMode { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for UpdateBillingPortalConfigurationFeaturesSubscriptionCancelMode { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Whether to create prorations when canceling subscriptions. +/// Possible values are `none` and `create_prorations`, which is only compatible with `mode=immediately`. +/// No prorations are generated when canceling a subscription at the end of its natural billing period. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum UpdateBillingPortalConfigurationFeaturesSubscriptionCancelProrationBehavior { + AlwaysInvoice, + CreateProrations, + None, +} +impl UpdateBillingPortalConfigurationFeaturesSubscriptionCancelProrationBehavior { + pub fn as_str(self) -> &'static str { + use UpdateBillingPortalConfigurationFeaturesSubscriptionCancelProrationBehavior::*; + match self { + AlwaysInvoice => "always_invoice", + CreateProrations => "create_prorations", + None => "none", + } + } +} + +impl std::str::FromStr + for UpdateBillingPortalConfigurationFeaturesSubscriptionCancelProrationBehavior +{ + type Err = (); + fn from_str(s: &str) -> Result { + use UpdateBillingPortalConfigurationFeaturesSubscriptionCancelProrationBehavior::*; + match s { + "always_invoice" => Ok(AlwaysInvoice), + "create_prorations" => Ok(CreateProrations), + "none" => Ok(None), + _ => Err(()), + } + } +} +impl std::fmt::Display + for UpdateBillingPortalConfigurationFeaturesSubscriptionCancelProrationBehavior +{ + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug + for UpdateBillingPortalConfigurationFeaturesSubscriptionCancelProrationBehavior +{ + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize + for UpdateBillingPortalConfigurationFeaturesSubscriptionCancelProrationBehavior +{ + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Information about updating subscriptions in the portal. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdateBillingPortalConfigurationFeaturesSubscriptionUpdate<'a> { + /// The types of subscription updates that are supported. When empty, subscriptions are not updateable. + #[serde(skip_serializing_if = "Option::is_none")] + pub default_allowed_updates: Option< + &'a [UpdateBillingPortalConfigurationFeaturesSubscriptionUpdateDefaultAllowedUpdates], + >, + /// Whether the feature is enabled. + #[serde(skip_serializing_if = "Option::is_none")] + pub enabled: Option, + /// The list of up to 10 products that support subscription updates. + #[serde(skip_serializing_if = "Option::is_none")] + pub products: Option<&'a [SubscriptionUpdateProductParam<'a>]>, + /// Determines how to handle prorations resulting from subscription updates. + /// Valid values are `none`, `create_prorations`, and `always_invoice`. + #[serde(skip_serializing_if = "Option::is_none")] + pub proration_behavior: + Option, +} +impl<'a> UpdateBillingPortalConfigurationFeaturesSubscriptionUpdate<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// The types of subscription updates that are supported. When empty, subscriptions are not updateable. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum UpdateBillingPortalConfigurationFeaturesSubscriptionUpdateDefaultAllowedUpdates { + Price, + PromotionCode, + Quantity, +} +impl UpdateBillingPortalConfigurationFeaturesSubscriptionUpdateDefaultAllowedUpdates { + pub fn as_str(self) -> &'static str { + use UpdateBillingPortalConfigurationFeaturesSubscriptionUpdateDefaultAllowedUpdates::*; + match self { + Price => "price", + PromotionCode => "promotion_code", + Quantity => "quantity", + } + } +} + +impl std::str::FromStr + for UpdateBillingPortalConfigurationFeaturesSubscriptionUpdateDefaultAllowedUpdates +{ + type Err = (); + fn from_str(s: &str) -> Result { + use UpdateBillingPortalConfigurationFeaturesSubscriptionUpdateDefaultAllowedUpdates::*; + match s { + "price" => Ok(Price), + "promotion_code" => Ok(PromotionCode), + "quantity" => Ok(Quantity), + _ => Err(()), + } + } +} +impl std::fmt::Display + for UpdateBillingPortalConfigurationFeaturesSubscriptionUpdateDefaultAllowedUpdates +{ + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug + for UpdateBillingPortalConfigurationFeaturesSubscriptionUpdateDefaultAllowedUpdates +{ + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize + for UpdateBillingPortalConfigurationFeaturesSubscriptionUpdateDefaultAllowedUpdates +{ + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Determines how to handle prorations resulting from subscription updates. +/// Valid values are `none`, `create_prorations`, and `always_invoice`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum UpdateBillingPortalConfigurationFeaturesSubscriptionUpdateProrationBehavior { + AlwaysInvoice, + CreateProrations, + None, +} +impl UpdateBillingPortalConfigurationFeaturesSubscriptionUpdateProrationBehavior { + pub fn as_str(self) -> &'static str { + use UpdateBillingPortalConfigurationFeaturesSubscriptionUpdateProrationBehavior::*; + match self { + AlwaysInvoice => "always_invoice", + CreateProrations => "create_prorations", + None => "none", + } + } +} + +impl std::str::FromStr + for UpdateBillingPortalConfigurationFeaturesSubscriptionUpdateProrationBehavior +{ + type Err = (); + fn from_str(s: &str) -> Result { + use UpdateBillingPortalConfigurationFeaturesSubscriptionUpdateProrationBehavior::*; + match s { + "always_invoice" => Ok(AlwaysInvoice), + "create_prorations" => Ok(CreateProrations), + "none" => Ok(None), + _ => Err(()), + } + } +} +impl std::fmt::Display + for UpdateBillingPortalConfigurationFeaturesSubscriptionUpdateProrationBehavior +{ + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug + for UpdateBillingPortalConfigurationFeaturesSubscriptionUpdateProrationBehavior +{ + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize + for UpdateBillingPortalConfigurationFeaturesSubscriptionUpdateProrationBehavior +{ + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// The hosted login page for this configuration. +/// Learn more about the portal login page in our [integration docs](https://stripe.com/docs/billing/subscriptions/integrating-customer-portal#share). +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct UpdateBillingPortalConfigurationLoginPage { + /// Set to `true` to generate a shareable URL [`login_page.url`](https://stripe.com/docs/api/customer_portal/configuration#portal_configuration_object-login_page-url) that will take your customers to a hosted login page for the customer portal. + /// + /// Set to `false` to deactivate the `login_page.url`. + pub enabled: bool, +} +impl UpdateBillingPortalConfigurationLoginPage { + pub fn new(enabled: bool) -> Self { + Self { enabled } + } +} +impl<'a> UpdateBillingPortalConfiguration<'a> { + /// Updates a configuration that describes the functionality of the customer portal. + pub fn send( + &self, + client: &stripe::Client, + configuration: &stripe_billing::BillingPortalConfigurationId, + ) -> stripe::Response { + client.send_form( + &format!("/billing_portal/configurations/{configuration}"), + self, + http_types::Method::Post, + ) + } +} +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct SubscriptionPauseParam { + /// Whether the feature is enabled. + #[serde(skip_serializing_if = "Option::is_none")] + pub enabled: Option, +} +impl SubscriptionPauseParam { + pub fn new() -> Self { + Self::default() + } +} +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct SubscriptionUpdateProductParam<'a> { + /// The list of price IDs for the product that a subscription can be updated to. + pub prices: &'a [&'a str], + /// The product id. + pub product: &'a str, +} +impl<'a> SubscriptionUpdateProductParam<'a> { + pub fn new(prices: &'a [&'a str], product: &'a str) -> Self { + Self { prices, product } + } +} diff --git a/generated/stripe_billing/src/billing_portal_configuration/types.rs b/generated/stripe_billing/src/billing_portal_configuration/types.rs new file mode 100644 index 000000000..8bca7d765 --- /dev/null +++ b/generated/stripe_billing/src/billing_portal_configuration/types.rs @@ -0,0 +1,35 @@ +/// A portal configuration describes the functionality and behavior of a portal session. +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct BillingPortalConfiguration { + /// Whether the configuration is active and can be used to create portal sessions. + pub active: bool, + /// ID of the Connect Application that created the configuration. + pub application: Option>, + pub business_profile: stripe_billing::PortalBusinessProfile, + /// Time at which the object was created. Measured in seconds since the Unix epoch. + pub created: stripe_types::Timestamp, + /// The default URL to redirect customers to when they click on the portal's link to return to your website. + /// This can be [overriden](https://stripe.com/docs/api/customer_portal/sessions/create#create_portal_session-return_url) when creating the session. + pub default_return_url: Option, + pub features: stripe_billing::PortalFeatures, + /// Unique identifier for the object. + pub id: stripe_billing::BillingPortalConfigurationId, + /// Whether the configuration is the default. + /// If `true`, this configuration can be managed in the Dashboard and portal sessions will use this configuration unless it is overriden when creating the session. + pub is_default: bool, + /// Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + pub livemode: bool, + pub login_page: stripe_billing::PortalLoginPage, + /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. + /// This can be useful for storing additional information about the object in a structured format. + pub metadata: Option>, + /// Time at which the object was last updated. Measured in seconds since the Unix epoch. + pub updated: stripe_types::Timestamp, +} +impl stripe_types::Object for BillingPortalConfiguration { + type Id = stripe_billing::BillingPortalConfigurationId; + fn id(&self) -> &Self::Id { + &self.id + } +} +stripe_types::def_id!(BillingPortalConfigurationId, "bpc_"); diff --git a/generated/stripe_billing/src/billing_portal_session/mod.rs b/generated/stripe_billing/src/billing_portal_session/mod.rs new file mode 100644 index 000000000..509b668f2 --- /dev/null +++ b/generated/stripe_billing/src/billing_portal_session/mod.rs @@ -0,0 +1,5 @@ +#[cfg(feature = "billing_portal_session")] +mod requests; +pub(crate) mod types; +#[cfg(feature = "billing_portal_session")] +pub use requests::*; diff --git a/generated/stripe_billing/src/billing_portal_session/requests.rs b/generated/stripe_billing/src/billing_portal_session/requests.rs new file mode 100644 index 000000000..85fcfaa43 --- /dev/null +++ b/generated/stripe_billing/src/billing_portal_session/requests.rs @@ -0,0 +1,379 @@ +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreateBillingPortalSession<'a> { + /// The ID of an existing [configuration](https://stripe.com/docs/api/customer_portal/configuration) to use for this session, describing its functionality and features. + /// If not specified, the session uses the default configuration. + #[serde(skip_serializing_if = "Option::is_none")] + pub configuration: Option<&'a str>, + /// The ID of an existing customer. + pub customer: &'a str, + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, + /// Information about a specific flow for the customer to go through. + /// See the [docs](https://stripe.com/docs/customer-management/portal-deep-links) to learn more about using customer portal deep links and flows. + #[serde(skip_serializing_if = "Option::is_none")] + pub flow_data: Option>, + /// The IETF language tag of the locale customer portal is displayed in. + /// If blank or auto, the customer’s `preferred_locales` or browser’s locale is used. + #[serde(skip_serializing_if = "Option::is_none")] + pub locale: Option, + /// The `on_behalf_of` account to use for this session. + /// When specified, only subscriptions and invoices with this `on_behalf_of` account appear in the portal. + /// For more information, see the [docs](https://stripe.com/docs/connect/separate-charges-and-transfers#on-behalf-of). + /// Use the [Accounts API](https://stripe.com/docs/api/accounts/object#account_object-settings-branding) to modify the `on_behalf_of` account's branding settings, which the portal displays. + #[serde(skip_serializing_if = "Option::is_none")] + pub on_behalf_of: Option<&'a str>, + /// The default URL to redirect customers to when they click on the portal's link to return to your website. + #[serde(skip_serializing_if = "Option::is_none")] + pub return_url: Option<&'a str>, +} +impl<'a> CreateBillingPortalSession<'a> { + pub fn new(customer: &'a str) -> Self { + Self { + configuration: None, + customer, + expand: None, + flow_data: None, + locale: None, + on_behalf_of: None, + return_url: None, + } + } +} +/// Information about a specific flow for the customer to go through. +/// See the [docs](https://stripe.com/docs/customer-management/portal-deep-links) to learn more about using customer portal deep links and flows. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreateBillingPortalSessionFlowData<'a> { + /// Behavior after the flow is completed. + #[serde(skip_serializing_if = "Option::is_none")] + pub after_completion: Option>, + /// Configuration when `flow_data.type=subscription_cancel`. + #[serde(skip_serializing_if = "Option::is_none")] + pub subscription_cancel: Option>, + /// Configuration when `flow_data.type=subscription_update`. + #[serde(skip_serializing_if = "Option::is_none")] + pub subscription_update: Option>, + /// Configuration when `flow_data.type=subscription_update_confirm`. + #[serde(skip_serializing_if = "Option::is_none")] + pub subscription_update_confirm: + Option>, + /// Type of flow that the customer will go through. + #[serde(rename = "type")] + pub type_: CreateBillingPortalSessionFlowDataType, +} +impl<'a> CreateBillingPortalSessionFlowData<'a> { + pub fn new(type_: CreateBillingPortalSessionFlowDataType) -> Self { + Self { + after_completion: None, + subscription_cancel: None, + subscription_update: None, + subscription_update_confirm: None, + type_, + } + } +} +/// Behavior after the flow is completed. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreateBillingPortalSessionFlowDataAfterCompletion<'a> { + /// Configuration when `after_completion.type=hosted_confirmation`. + #[serde(skip_serializing_if = "Option::is_none")] + pub hosted_confirmation: + Option>, + /// Configuration when `after_completion.type=redirect`. + #[serde(skip_serializing_if = "Option::is_none")] + pub redirect: Option>, + /// The specified behavior after the flow is completed. + #[serde(rename = "type")] + pub type_: CreateBillingPortalSessionFlowDataAfterCompletionType, +} +impl<'a> CreateBillingPortalSessionFlowDataAfterCompletion<'a> { + pub fn new(type_: CreateBillingPortalSessionFlowDataAfterCompletionType) -> Self { + Self { hosted_confirmation: None, redirect: None, type_ } + } +} +/// Configuration when `after_completion.type=hosted_confirmation`. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreateBillingPortalSessionFlowDataAfterCompletionHostedConfirmation<'a> { + /// A custom message to display to the customer after the flow is completed. + #[serde(skip_serializing_if = "Option::is_none")] + pub custom_message: Option<&'a str>, +} +impl<'a> CreateBillingPortalSessionFlowDataAfterCompletionHostedConfirmation<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// Configuration when `after_completion.type=redirect`. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreateBillingPortalSessionFlowDataAfterCompletionRedirect<'a> { + /// The URL the customer will be redirected to after the flow is completed. + pub return_url: &'a str, +} +impl<'a> CreateBillingPortalSessionFlowDataAfterCompletionRedirect<'a> { + pub fn new(return_url: &'a str) -> Self { + Self { return_url } + } +} +/// The specified behavior after the flow is completed. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreateBillingPortalSessionFlowDataAfterCompletionType { + HostedConfirmation, + PortalHomepage, + Redirect, +} +impl CreateBillingPortalSessionFlowDataAfterCompletionType { + pub fn as_str(self) -> &'static str { + use CreateBillingPortalSessionFlowDataAfterCompletionType::*; + match self { + HostedConfirmation => "hosted_confirmation", + PortalHomepage => "portal_homepage", + Redirect => "redirect", + } + } +} + +impl std::str::FromStr for CreateBillingPortalSessionFlowDataAfterCompletionType { + type Err = (); + fn from_str(s: &str) -> Result { + use CreateBillingPortalSessionFlowDataAfterCompletionType::*; + match s { + "hosted_confirmation" => Ok(HostedConfirmation), + "portal_homepage" => Ok(PortalHomepage), + "redirect" => Ok(Redirect), + _ => Err(()), + } + } +} +impl std::fmt::Display for CreateBillingPortalSessionFlowDataAfterCompletionType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreateBillingPortalSessionFlowDataAfterCompletionType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreateBillingPortalSessionFlowDataAfterCompletionType { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Configuration when `flow_data.type=subscription_cancel`. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreateBillingPortalSessionFlowDataSubscriptionCancel<'a> { + /// Specify a retention strategy to be used in the cancellation flow. + #[serde(skip_serializing_if = "Option::is_none")] + pub retention: Option>, + /// The ID of the subscription to be canceled. + pub subscription: &'a str, +} +impl<'a> CreateBillingPortalSessionFlowDataSubscriptionCancel<'a> { + pub fn new(subscription: &'a str) -> Self { + Self { retention: None, subscription } + } +} +/// Specify a retention strategy to be used in the cancellation flow. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreateBillingPortalSessionFlowDataSubscriptionCancelRetention<'a> { + /// Configuration when `retention.type=coupon_offer`. + pub coupon_offer: CreateBillingPortalSessionFlowDataSubscriptionCancelRetentionCouponOffer<'a>, + /// Type of retention strategy to use with the customer. + #[serde(rename = "type")] + pub type_: CreateBillingPortalSessionFlowDataSubscriptionCancelRetentionType, +} +impl<'a> CreateBillingPortalSessionFlowDataSubscriptionCancelRetention<'a> { + pub fn new( + coupon_offer: CreateBillingPortalSessionFlowDataSubscriptionCancelRetentionCouponOffer<'a>, + type_: CreateBillingPortalSessionFlowDataSubscriptionCancelRetentionType, + ) -> Self { + Self { coupon_offer, type_ } + } +} +/// Configuration when `retention.type=coupon_offer`. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreateBillingPortalSessionFlowDataSubscriptionCancelRetentionCouponOffer<'a> { + /// The ID of the coupon to be offered. + pub coupon: &'a str, +} +impl<'a> CreateBillingPortalSessionFlowDataSubscriptionCancelRetentionCouponOffer<'a> { + pub fn new(coupon: &'a str) -> Self { + Self { coupon } + } +} +/// Type of retention strategy to use with the customer. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreateBillingPortalSessionFlowDataSubscriptionCancelRetentionType { + CouponOffer, +} +impl CreateBillingPortalSessionFlowDataSubscriptionCancelRetentionType { + pub fn as_str(self) -> &'static str { + use CreateBillingPortalSessionFlowDataSubscriptionCancelRetentionType::*; + match self { + CouponOffer => "coupon_offer", + } + } +} + +impl std::str::FromStr for CreateBillingPortalSessionFlowDataSubscriptionCancelRetentionType { + type Err = (); + fn from_str(s: &str) -> Result { + use CreateBillingPortalSessionFlowDataSubscriptionCancelRetentionType::*; + match s { + "coupon_offer" => Ok(CouponOffer), + _ => Err(()), + } + } +} +impl std::fmt::Display for CreateBillingPortalSessionFlowDataSubscriptionCancelRetentionType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreateBillingPortalSessionFlowDataSubscriptionCancelRetentionType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreateBillingPortalSessionFlowDataSubscriptionCancelRetentionType { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Configuration when `flow_data.type=subscription_update`. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreateBillingPortalSessionFlowDataSubscriptionUpdate<'a> { + /// The ID of the subscription to be updated. + pub subscription: &'a str, +} +impl<'a> CreateBillingPortalSessionFlowDataSubscriptionUpdate<'a> { + pub fn new(subscription: &'a str) -> Self { + Self { subscription } + } +} +/// Configuration when `flow_data.type=subscription_update_confirm`. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreateBillingPortalSessionFlowDataSubscriptionUpdateConfirm<'a> { + /// The coupon or promotion code to apply to this subscription update. + /// Currently, only up to one may be specified. + #[serde(skip_serializing_if = "Option::is_none")] + pub discounts: + Option<&'a [CreateBillingPortalSessionFlowDataSubscriptionUpdateConfirmDiscounts<'a>]>, + /// The [subscription item](https://stripe.com/docs/api/subscription_items) to be updated through this flow. + /// Currently, only up to one may be specified and subscriptions with multiple items are not updatable. + pub items: &'a [CreateBillingPortalSessionFlowDataSubscriptionUpdateConfirmItems<'a>], + /// The ID of the subscription to be updated. + pub subscription: &'a str, +} +impl<'a> CreateBillingPortalSessionFlowDataSubscriptionUpdateConfirm<'a> { + pub fn new( + items: &'a [CreateBillingPortalSessionFlowDataSubscriptionUpdateConfirmItems<'a>], + subscription: &'a str, + ) -> Self { + Self { discounts: None, items, subscription } + } +} +/// The coupon or promotion code to apply to this subscription update. +/// Currently, only up to one may be specified. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreateBillingPortalSessionFlowDataSubscriptionUpdateConfirmDiscounts<'a> { + /// The ID of the coupon to apply to this subscription update. + #[serde(skip_serializing_if = "Option::is_none")] + pub coupon: Option<&'a str>, + /// The ID of a promotion code to apply to this subscription update. + #[serde(skip_serializing_if = "Option::is_none")] + pub promotion_code: Option<&'a str>, +} +impl<'a> CreateBillingPortalSessionFlowDataSubscriptionUpdateConfirmDiscounts<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// The [subscription item](https://stripe.com/docs/api/subscription_items) to be updated through this flow. +/// Currently, only up to one may be specified and subscriptions with multiple items are not updatable. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreateBillingPortalSessionFlowDataSubscriptionUpdateConfirmItems<'a> { + /// The ID of the [subscription item](https://stripe.com/docs/api/subscriptions/object#subscription_object-items-data-id) to be updated. + pub id: &'a str, + /// The price the customer should subscribe to through this flow. + /// The price must also be included in the configuration's [`features.subscription_update.products`](https://stripe.com/docs/api/customer_portal/configuration#portal_configuration_object-features-subscription_update-products). + #[serde(skip_serializing_if = "Option::is_none")] + pub price: Option<&'a str>, + /// [Quantity](https://stripe.com/docs/subscriptions/quantities) for this item that the customer should subscribe to through this flow. + #[serde(skip_serializing_if = "Option::is_none")] + pub quantity: Option, +} +impl<'a> CreateBillingPortalSessionFlowDataSubscriptionUpdateConfirmItems<'a> { + pub fn new(id: &'a str) -> Self { + Self { id, price: None, quantity: None } + } +} +/// Type of flow that the customer will go through. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreateBillingPortalSessionFlowDataType { + PaymentMethodUpdate, + SubscriptionCancel, + SubscriptionUpdate, + SubscriptionUpdateConfirm, +} +impl CreateBillingPortalSessionFlowDataType { + pub fn as_str(self) -> &'static str { + use CreateBillingPortalSessionFlowDataType::*; + match self { + PaymentMethodUpdate => "payment_method_update", + SubscriptionCancel => "subscription_cancel", + SubscriptionUpdate => "subscription_update", + SubscriptionUpdateConfirm => "subscription_update_confirm", + } + } +} + +impl std::str::FromStr for CreateBillingPortalSessionFlowDataType { + type Err = (); + fn from_str(s: &str) -> Result { + use CreateBillingPortalSessionFlowDataType::*; + match s { + "payment_method_update" => Ok(PaymentMethodUpdate), + "subscription_cancel" => Ok(SubscriptionCancel), + "subscription_update" => Ok(SubscriptionUpdate), + "subscription_update_confirm" => Ok(SubscriptionUpdateConfirm), + _ => Err(()), + } + } +} +impl std::fmt::Display for CreateBillingPortalSessionFlowDataType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreateBillingPortalSessionFlowDataType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreateBillingPortalSessionFlowDataType { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'a> CreateBillingPortalSession<'a> { + /// Creates a session of the customer portal. + pub fn send( + &self, + client: &stripe::Client, + ) -> stripe::Response { + client.send_form("/billing_portal/sessions", self, http_types::Method::Post) + } +} diff --git a/generated/stripe_billing/src/billing_portal_session/types.rs b/generated/stripe_billing/src/billing_portal_session/types.rs new file mode 100644 index 000000000..04d6bd964 --- /dev/null +++ b/generated/stripe_billing/src/billing_portal_session/types.rs @@ -0,0 +1,240 @@ +/// The Billing customer portal is a Stripe-hosted UI for subscription and +/// billing management. +/// +/// A portal configuration describes the functionality and features that you +/// want to provide to your customers through the portal. +/// +/// A portal session describes the instantiation of the customer portal for +/// a particular customer. By visiting the session's URL, the customer +/// can manage their subscriptions and billing details. For security reasons, +/// sessions are short-lived and will expire if the customer does not visit the URL. +/// Create sessions on-demand when customers intend to manage their subscriptions +/// and billing details. +/// +/// Learn more in the [integration guide](https://stripe.com/docs/billing/subscriptions/integrating-customer-portal). +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct BillingPortalSession { + /// The configuration used by this session, describing the features available. + pub configuration: stripe_types::Expandable, + /// Time at which the object was created. Measured in seconds since the Unix epoch. + pub created: stripe_types::Timestamp, + /// The ID of the customer for this session. + pub customer: String, + /// Information about a specific flow for the customer to go through. + /// See the [docs](https://stripe.com/docs/customer-management/portal-deep-links) to learn more about using customer portal deep links and flows. + pub flow: Option, + /// Unique identifier for the object. + pub id: stripe_billing::BillingPortalSessionId, + /// Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + pub livemode: bool, + /// The IETF language tag of the locale Customer Portal is displayed in. + /// If blank or auto, the customer’s `preferred_locales` or browser’s locale is used. + pub locale: Option, + /// The account for which the session was created on behalf of. + /// When specified, only subscriptions and invoices with this `on_behalf_of` account appear in the portal. + /// For more information, see the [docs](https://stripe.com/docs/connect/separate-charges-and-transfers#on-behalf-of). + /// Use the [Accounts API](https://stripe.com/docs/api/accounts/object#account_object-settings-branding) to modify the `on_behalf_of` account's branding settings, which the portal displays. + pub on_behalf_of: Option, + /// The URL to redirect customers to when they click on the portal's link to return to your website. + pub return_url: Option, + /// The short-lived URL of the session that gives customers access to the customer portal. + pub url: String, +} +impl stripe_types::Object for BillingPortalSession { + type Id = stripe_billing::BillingPortalSessionId; + fn id(&self) -> &Self::Id { + &self.id + } +} +stripe_types::def_id!(BillingPortalSessionId, "bps_"); +#[derive(Copy, Clone, Eq, PartialEq)] +#[non_exhaustive] +pub enum BillingPortalSessionLocale { + Auto, + Bg, + Cs, + Da, + De, + El, + En, + EnMinusAu, + EnMinusCa, + EnMinusGb, + EnMinusIe, + EnMinusIn, + EnMinusNz, + EnMinusSg, + Es, + EsMinus419, + Et, + Fi, + Fil, + Fr, + FrMinusCa, + Hr, + Hu, + Id, + It, + Ja, + Ko, + Lt, + Lv, + Ms, + Mt, + Nb, + Nl, + Pl, + Pt, + PtMinusBr, + Ro, + Ru, + Sk, + Sl, + Sv, + Th, + Tr, + Vi, + Zh, + ZhMinusHk, + ZhMinusTw, + /// An unrecognized value from Stripe. Should not be used as a request parameter. + Unknown, +} +impl BillingPortalSessionLocale { + pub fn as_str(self) -> &'static str { + use BillingPortalSessionLocale::*; + match self { + Auto => "auto", + Bg => "bg", + Cs => "cs", + Da => "da", + De => "de", + El => "el", + En => "en", + EnMinusAu => "en-AU", + EnMinusCa => "en-CA", + EnMinusGb => "en-GB", + EnMinusIe => "en-IE", + EnMinusIn => "en-IN", + EnMinusNz => "en-NZ", + EnMinusSg => "en-SG", + Es => "es", + EsMinus419 => "es-419", + Et => "et", + Fi => "fi", + Fil => "fil", + Fr => "fr", + FrMinusCa => "fr-CA", + Hr => "hr", + Hu => "hu", + Id => "id", + It => "it", + Ja => "ja", + Ko => "ko", + Lt => "lt", + Lv => "lv", + Ms => "ms", + Mt => "mt", + Nb => "nb", + Nl => "nl", + Pl => "pl", + Pt => "pt", + PtMinusBr => "pt-BR", + Ro => "ro", + Ru => "ru", + Sk => "sk", + Sl => "sl", + Sv => "sv", + Th => "th", + Tr => "tr", + Vi => "vi", + Zh => "zh", + ZhMinusHk => "zh-HK", + ZhMinusTw => "zh-TW", + Unknown => "unknown", + } + } +} + +impl std::str::FromStr for BillingPortalSessionLocale { + type Err = (); + fn from_str(s: &str) -> Result { + use BillingPortalSessionLocale::*; + match s { + "auto" => Ok(Auto), + "bg" => Ok(Bg), + "cs" => Ok(Cs), + "da" => Ok(Da), + "de" => Ok(De), + "el" => Ok(El), + "en" => Ok(En), + "en-AU" => Ok(EnMinusAu), + "en-CA" => Ok(EnMinusCa), + "en-GB" => Ok(EnMinusGb), + "en-IE" => Ok(EnMinusIe), + "en-IN" => Ok(EnMinusIn), + "en-NZ" => Ok(EnMinusNz), + "en-SG" => Ok(EnMinusSg), + "es" => Ok(Es), + "es-419" => Ok(EsMinus419), + "et" => Ok(Et), + "fi" => Ok(Fi), + "fil" => Ok(Fil), + "fr" => Ok(Fr), + "fr-CA" => Ok(FrMinusCa), + "hr" => Ok(Hr), + "hu" => Ok(Hu), + "id" => Ok(Id), + "it" => Ok(It), + "ja" => Ok(Ja), + "ko" => Ok(Ko), + "lt" => Ok(Lt), + "lv" => Ok(Lv), + "ms" => Ok(Ms), + "mt" => Ok(Mt), + "nb" => Ok(Nb), + "nl" => Ok(Nl), + "pl" => Ok(Pl), + "pt" => Ok(Pt), + "pt-BR" => Ok(PtMinusBr), + "ro" => Ok(Ro), + "ru" => Ok(Ru), + "sk" => Ok(Sk), + "sl" => Ok(Sl), + "sv" => Ok(Sv), + "th" => Ok(Th), + "tr" => Ok(Tr), + "vi" => Ok(Vi), + "zh" => Ok(Zh), + "zh-HK" => Ok(ZhMinusHk), + "zh-TW" => Ok(ZhMinusTw), + _ => Err(()), + } + } +} +impl std::fmt::Display for BillingPortalSessionLocale { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for BillingPortalSessionLocale { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for BillingPortalSessionLocale { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for BillingPortalSessionLocale { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Ok(Self::from_str(&s).unwrap_or(BillingPortalSessionLocale::Unknown)) + } +} diff --git a/generated/stripe_billing/src/credit_note/mod.rs b/generated/stripe_billing/src/credit_note/mod.rs new file mode 100644 index 000000000..f9c02cb73 --- /dev/null +++ b/generated/stripe_billing/src/credit_note/mod.rs @@ -0,0 +1,4 @@ +#[cfg(feature = "credit_note")] +mod requests; +#[cfg(feature = "credit_note")] +pub use requests::*; diff --git a/generated/stripe_billing/src/credit_note/requests.rs b/generated/stripe_billing/src/credit_note/requests.rs new file mode 100644 index 000000000..7fa35022d --- /dev/null +++ b/generated/stripe_billing/src/credit_note/requests.rs @@ -0,0 +1,689 @@ +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct ListCreditNote<'a> { + /// Only return credit notes for the customer specified by this customer ID. + #[serde(skip_serializing_if = "Option::is_none")] + pub customer: Option<&'a str>, + /// A cursor for use in pagination. + /// `ending_before` is an object ID that defines your place in the list. + /// For instance, if you make a list request and receive 100 objects, starting with `obj_bar`, your subsequent call can include `ending_before=obj_bar` in order to fetch the previous page of the list. + #[serde(skip_serializing_if = "Option::is_none")] + pub ending_before: Option<&'a str>, + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, + /// Only return credit notes for the invoice specified by this invoice ID. + #[serde(skip_serializing_if = "Option::is_none")] + pub invoice: Option<&'a str>, + /// A limit on the number of objects to be returned. + /// Limit can range between 1 and 100, and the default is 10. + #[serde(skip_serializing_if = "Option::is_none")] + pub limit: Option, + /// A cursor for use in pagination. + /// `starting_after` is an object ID that defines your place in the list. + /// For instance, if you make a list request and receive 100 objects, ending with `obj_foo`, your subsequent call can include `starting_after=obj_foo` in order to fetch the next page of the list. + #[serde(skip_serializing_if = "Option::is_none")] + pub starting_after: Option<&'a str>, +} +impl<'a> ListCreditNote<'a> { + pub fn new() -> Self { + Self::default() + } +} +impl<'a> ListCreditNote<'a> { + /// Returns a list of credit notes. + pub fn send( + &self, + client: &stripe::Client, + ) -> stripe::Response> { + client.get_query("/credit_notes", self) + } + pub fn paginate(self) -> stripe::ListPaginator> { + stripe::ListPaginator::from_list_params("/credit_notes", self) + } +} +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct RetrieveCreditNote<'a> { + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, +} +impl<'a> RetrieveCreditNote<'a> { + pub fn new() -> Self { + Self::default() + } +} +impl<'a> RetrieveCreditNote<'a> { + /// Retrieves the credit note object with the given identifier. + pub fn send( + &self, + client: &stripe::Client, + id: &stripe_shared::CreditNoteId, + ) -> stripe::Response { + client.get_query(&format!("/credit_notes/{id}"), self) + } +} +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct PreviewCreditNote<'a> { + /// The integer amount in cents (or local equivalent) representing the total amount of the credit note. + #[serde(skip_serializing_if = "Option::is_none")] + pub amount: Option, + /// The integer amount in cents (or local equivalent) representing the amount to credit the customer's balance, which will be automatically applied to their next invoice. + #[serde(skip_serializing_if = "Option::is_none")] + pub credit_amount: Option, + /// The date when this credit note is in effect. + /// Same as `created` unless overwritten. + /// When defined, this value replaces the system-generated 'Date of issue' printed on the credit note PDF. + #[serde(skip_serializing_if = "Option::is_none")] + pub effective_at: Option, + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, + /// ID of the invoice. + pub invoice: &'a str, + /// Line items that make up the credit note. + #[serde(skip_serializing_if = "Option::is_none")] + pub lines: Option<&'a [PreviewCreditNoteLines<'a>]>, + /// The credit note's memo appears on the credit note PDF. + #[serde(skip_serializing_if = "Option::is_none")] + pub memo: Option<&'a str>, + /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. + /// This can be useful for storing additional information about the object in a structured format. + /// Individual keys can be unset by posting an empty value to them. + /// All keys can be unset by posting an empty value to `metadata`. + #[serde(skip_serializing_if = "Option::is_none")] + pub metadata: Option<&'a std::collections::HashMap>, + /// The integer amount in cents (or local equivalent) representing the amount that is credited outside of Stripe. + #[serde(skip_serializing_if = "Option::is_none")] + pub out_of_band_amount: Option, + /// Reason for issuing this credit note, one of `duplicate`, `fraudulent`, `order_change`, or `product_unsatisfactory`. + #[serde(skip_serializing_if = "Option::is_none")] + pub reason: Option, + /// ID of an existing refund to link this credit note to. + #[serde(skip_serializing_if = "Option::is_none")] + pub refund: Option<&'a str>, + /// The integer amount in cents (or local equivalent) representing the amount to refund. + /// If set, a refund will be created for the charge associated with the invoice. + #[serde(skip_serializing_if = "Option::is_none")] + pub refund_amount: Option, + /// When shipping_cost contains the shipping_rate from the invoice, the shipping_cost is included in the credit note. + #[serde(skip_serializing_if = "Option::is_none")] + pub shipping_cost: Option>, +} +impl<'a> PreviewCreditNote<'a> { + pub fn new(invoice: &'a str) -> Self { + Self { + amount: None, + credit_amount: None, + effective_at: None, + expand: None, + invoice, + lines: None, + memo: None, + metadata: None, + out_of_band_amount: None, + reason: None, + refund: None, + refund_amount: None, + shipping_cost: None, + } + } +} +/// Line items that make up the credit note. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct PreviewCreditNoteLines<'a> { + /// The line item amount to credit. Only valid when `type` is `invoice_line_item`. + #[serde(skip_serializing_if = "Option::is_none")] + pub amount: Option, + /// The description of the credit note line item. Only valid when the `type` is `custom_line_item`. + #[serde(skip_serializing_if = "Option::is_none")] + pub description: Option<&'a str>, + /// The invoice line item to credit. Only valid when the `type` is `invoice_line_item`. + #[serde(skip_serializing_if = "Option::is_none")] + pub invoice_line_item: Option<&'a str>, + /// The line item quantity to credit. + #[serde(skip_serializing_if = "Option::is_none")] + pub quantity: Option, + /// A list of up to 10 tax amounts for the credit note line item. Cannot be mixed with `tax_rates`. + #[serde(skip_serializing_if = "Option::is_none")] + pub tax_amounts: Option<&'a [TaxAmountWithTaxRateParam<'a>]>, + /// The tax rates which apply to the credit note line item. + /// Only valid when the `type` is `custom_line_item` and cannot be mixed with `tax_amounts`. + #[serde(skip_serializing_if = "Option::is_none")] + pub tax_rates: Option<&'a [&'a str]>, + /// Type of the credit note line item, one of `invoice_line_item` or `custom_line_item` + #[serde(rename = "type")] + pub type_: PreviewCreditNoteLinesType, + /// The integer unit amount in cents (or local equivalent) of the credit note line item. + /// This `unit_amount` will be multiplied by the quantity to get the full amount to credit for this line item. + /// Only valid when `type` is `custom_line_item`. + #[serde(skip_serializing_if = "Option::is_none")] + pub unit_amount: Option, + /// Same as `unit_amount`, but accepts a decimal value in cents (or local equivalent) with at most 12 decimal places. + /// Only one of `unit_amount` and `unit_amount_decimal` can be set. + #[serde(skip_serializing_if = "Option::is_none")] + pub unit_amount_decimal: Option<&'a str>, +} +impl<'a> PreviewCreditNoteLines<'a> { + pub fn new(type_: PreviewCreditNoteLinesType) -> Self { + Self { + amount: None, + description: None, + invoice_line_item: None, + quantity: None, + tax_amounts: None, + tax_rates: None, + type_, + unit_amount: None, + unit_amount_decimal: None, + } + } +} +/// Type of the credit note line item, one of `invoice_line_item` or `custom_line_item` +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum PreviewCreditNoteLinesType { + CustomLineItem, + InvoiceLineItem, +} +impl PreviewCreditNoteLinesType { + pub fn as_str(self) -> &'static str { + use PreviewCreditNoteLinesType::*; + match self { + CustomLineItem => "custom_line_item", + InvoiceLineItem => "invoice_line_item", + } + } +} + +impl std::str::FromStr for PreviewCreditNoteLinesType { + type Err = (); + fn from_str(s: &str) -> Result { + use PreviewCreditNoteLinesType::*; + match s { + "custom_line_item" => Ok(CustomLineItem), + "invoice_line_item" => Ok(InvoiceLineItem), + _ => Err(()), + } + } +} +impl std::fmt::Display for PreviewCreditNoteLinesType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for PreviewCreditNoteLinesType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for PreviewCreditNoteLinesType { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'a> PreviewCreditNote<'a> { + /// Get a preview of a credit note without creating it. + pub fn send(&self, client: &stripe::Client) -> stripe::Response { + client.get_query("/credit_notes/preview", self) + } +} +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct PreviewLinesCreditNote<'a> { + /// The integer amount in cents (or local equivalent) representing the total amount of the credit note. + #[serde(skip_serializing_if = "Option::is_none")] + pub amount: Option, + /// The integer amount in cents (or local equivalent) representing the amount to credit the customer's balance, which will be automatically applied to their next invoice. + #[serde(skip_serializing_if = "Option::is_none")] + pub credit_amount: Option, + /// The date when this credit note is in effect. + /// Same as `created` unless overwritten. + /// When defined, this value replaces the system-generated 'Date of issue' printed on the credit note PDF. + #[serde(skip_serializing_if = "Option::is_none")] + pub effective_at: Option, + /// A cursor for use in pagination. + /// `ending_before` is an object ID that defines your place in the list. + /// For instance, if you make a list request and receive 100 objects, starting with `obj_bar`, your subsequent call can include `ending_before=obj_bar` in order to fetch the previous page of the list. + #[serde(skip_serializing_if = "Option::is_none")] + pub ending_before: Option<&'a str>, + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, + /// ID of the invoice. + pub invoice: &'a str, + /// A limit on the number of objects to be returned. + /// Limit can range between 1 and 100, and the default is 10. + #[serde(skip_serializing_if = "Option::is_none")] + pub limit: Option, + /// Line items that make up the credit note. + #[serde(skip_serializing_if = "Option::is_none")] + pub lines: Option<&'a [PreviewLinesCreditNoteLines<'a>]>, + /// The credit note's memo appears on the credit note PDF. + #[serde(skip_serializing_if = "Option::is_none")] + pub memo: Option<&'a str>, + /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. + /// This can be useful for storing additional information about the object in a structured format. + /// Individual keys can be unset by posting an empty value to them. + /// All keys can be unset by posting an empty value to `metadata`. + #[serde(skip_serializing_if = "Option::is_none")] + pub metadata: Option<&'a std::collections::HashMap>, + /// The integer amount in cents (or local equivalent) representing the amount that is credited outside of Stripe. + #[serde(skip_serializing_if = "Option::is_none")] + pub out_of_band_amount: Option, + /// Reason for issuing this credit note, one of `duplicate`, `fraudulent`, `order_change`, or `product_unsatisfactory`. + #[serde(skip_serializing_if = "Option::is_none")] + pub reason: Option, + /// ID of an existing refund to link this credit note to. + #[serde(skip_serializing_if = "Option::is_none")] + pub refund: Option<&'a str>, + /// The integer amount in cents (or local equivalent) representing the amount to refund. + /// If set, a refund will be created for the charge associated with the invoice. + #[serde(skip_serializing_if = "Option::is_none")] + pub refund_amount: Option, + /// When shipping_cost contains the shipping_rate from the invoice, the shipping_cost is included in the credit note. + #[serde(skip_serializing_if = "Option::is_none")] + pub shipping_cost: Option>, + /// A cursor for use in pagination. + /// `starting_after` is an object ID that defines your place in the list. + /// For instance, if you make a list request and receive 100 objects, ending with `obj_foo`, your subsequent call can include `starting_after=obj_foo` in order to fetch the next page of the list. + #[serde(skip_serializing_if = "Option::is_none")] + pub starting_after: Option<&'a str>, +} +impl<'a> PreviewLinesCreditNote<'a> { + pub fn new(invoice: &'a str) -> Self { + Self { + amount: None, + credit_amount: None, + effective_at: None, + ending_before: None, + expand: None, + invoice, + limit: None, + lines: None, + memo: None, + metadata: None, + out_of_band_amount: None, + reason: None, + refund: None, + refund_amount: None, + shipping_cost: None, + starting_after: None, + } + } +} +/// Line items that make up the credit note. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct PreviewLinesCreditNoteLines<'a> { + /// The line item amount to credit. Only valid when `type` is `invoice_line_item`. + #[serde(skip_serializing_if = "Option::is_none")] + pub amount: Option, + /// The description of the credit note line item. Only valid when the `type` is `custom_line_item`. + #[serde(skip_serializing_if = "Option::is_none")] + pub description: Option<&'a str>, + /// The invoice line item to credit. Only valid when the `type` is `invoice_line_item`. + #[serde(skip_serializing_if = "Option::is_none")] + pub invoice_line_item: Option<&'a str>, + /// The line item quantity to credit. + #[serde(skip_serializing_if = "Option::is_none")] + pub quantity: Option, + /// A list of up to 10 tax amounts for the credit note line item. Cannot be mixed with `tax_rates`. + #[serde(skip_serializing_if = "Option::is_none")] + pub tax_amounts: Option<&'a [TaxAmountWithTaxRateParam<'a>]>, + /// The tax rates which apply to the credit note line item. + /// Only valid when the `type` is `custom_line_item` and cannot be mixed with `tax_amounts`. + #[serde(skip_serializing_if = "Option::is_none")] + pub tax_rates: Option<&'a [&'a str]>, + /// Type of the credit note line item, one of `invoice_line_item` or `custom_line_item` + #[serde(rename = "type")] + pub type_: PreviewLinesCreditNoteLinesType, + /// The integer unit amount in cents (or local equivalent) of the credit note line item. + /// This `unit_amount` will be multiplied by the quantity to get the full amount to credit for this line item. + /// Only valid when `type` is `custom_line_item`. + #[serde(skip_serializing_if = "Option::is_none")] + pub unit_amount: Option, + /// Same as `unit_amount`, but accepts a decimal value in cents (or local equivalent) with at most 12 decimal places. + /// Only one of `unit_amount` and `unit_amount_decimal` can be set. + #[serde(skip_serializing_if = "Option::is_none")] + pub unit_amount_decimal: Option<&'a str>, +} +impl<'a> PreviewLinesCreditNoteLines<'a> { + pub fn new(type_: PreviewLinesCreditNoteLinesType) -> Self { + Self { + amount: None, + description: None, + invoice_line_item: None, + quantity: None, + tax_amounts: None, + tax_rates: None, + type_, + unit_amount: None, + unit_amount_decimal: None, + } + } +} +/// Type of the credit note line item, one of `invoice_line_item` or `custom_line_item` +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum PreviewLinesCreditNoteLinesType { + CustomLineItem, + InvoiceLineItem, +} +impl PreviewLinesCreditNoteLinesType { + pub fn as_str(self) -> &'static str { + use PreviewLinesCreditNoteLinesType::*; + match self { + CustomLineItem => "custom_line_item", + InvoiceLineItem => "invoice_line_item", + } + } +} + +impl std::str::FromStr for PreviewLinesCreditNoteLinesType { + type Err = (); + fn from_str(s: &str) -> Result { + use PreviewLinesCreditNoteLinesType::*; + match s { + "custom_line_item" => Ok(CustomLineItem), + "invoice_line_item" => Ok(InvoiceLineItem), + _ => Err(()), + } + } +} +impl std::fmt::Display for PreviewLinesCreditNoteLinesType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for PreviewLinesCreditNoteLinesType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for PreviewLinesCreditNoteLinesType { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'a> PreviewLinesCreditNote<'a> { + /// When retrieving a credit note preview, you’ll get a **lines** property containing the first handful of those items. + /// This URL you can retrieve the full (paginated) list of line items. + pub fn send( + &self, + client: &stripe::Client, + ) -> stripe::Response> { + client.get_query("/credit_notes/preview/lines", self) + } + pub fn paginate( + self, + ) -> stripe::ListPaginator> { + stripe::ListPaginator::from_list_params("/credit_notes/preview/lines", self) + } +} +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreateCreditNote<'a> { + /// The integer amount in cents (or local equivalent) representing the total amount of the credit note. + #[serde(skip_serializing_if = "Option::is_none")] + pub amount: Option, + /// The integer amount in cents (or local equivalent) representing the amount to credit the customer's balance, which will be automatically applied to their next invoice. + #[serde(skip_serializing_if = "Option::is_none")] + pub credit_amount: Option, + /// The date when this credit note is in effect. + /// Same as `created` unless overwritten. + /// When defined, this value replaces the system-generated 'Date of issue' printed on the credit note PDF. + #[serde(skip_serializing_if = "Option::is_none")] + pub effective_at: Option, + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, + /// ID of the invoice. + pub invoice: &'a str, + /// Line items that make up the credit note. + #[serde(skip_serializing_if = "Option::is_none")] + pub lines: Option<&'a [CreateCreditNoteLines<'a>]>, + /// The credit note's memo appears on the credit note PDF. + #[serde(skip_serializing_if = "Option::is_none")] + pub memo: Option<&'a str>, + /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. + /// This can be useful for storing additional information about the object in a structured format. + /// Individual keys can be unset by posting an empty value to them. + /// All keys can be unset by posting an empty value to `metadata`. + #[serde(skip_serializing_if = "Option::is_none")] + pub metadata: Option<&'a std::collections::HashMap>, + /// The integer amount in cents (or local equivalent) representing the amount that is credited outside of Stripe. + #[serde(skip_serializing_if = "Option::is_none")] + pub out_of_band_amount: Option, + /// Reason for issuing this credit note, one of `duplicate`, `fraudulent`, `order_change`, or `product_unsatisfactory`. + #[serde(skip_serializing_if = "Option::is_none")] + pub reason: Option, + /// ID of an existing refund to link this credit note to. + #[serde(skip_serializing_if = "Option::is_none")] + pub refund: Option<&'a str>, + /// The integer amount in cents (or local equivalent) representing the amount to refund. + /// If set, a refund will be created for the charge associated with the invoice. + #[serde(skip_serializing_if = "Option::is_none")] + pub refund_amount: Option, + /// When shipping_cost contains the shipping_rate from the invoice, the shipping_cost is included in the credit note. + #[serde(skip_serializing_if = "Option::is_none")] + pub shipping_cost: Option>, +} +impl<'a> CreateCreditNote<'a> { + pub fn new(invoice: &'a str) -> Self { + Self { + amount: None, + credit_amount: None, + effective_at: None, + expand: None, + invoice, + lines: None, + memo: None, + metadata: None, + out_of_band_amount: None, + reason: None, + refund: None, + refund_amount: None, + shipping_cost: None, + } + } +} +/// Line items that make up the credit note. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreateCreditNoteLines<'a> { + /// The line item amount to credit. Only valid when `type` is `invoice_line_item`. + #[serde(skip_serializing_if = "Option::is_none")] + pub amount: Option, + /// The description of the credit note line item. Only valid when the `type` is `custom_line_item`. + #[serde(skip_serializing_if = "Option::is_none")] + pub description: Option<&'a str>, + /// The invoice line item to credit. Only valid when the `type` is `invoice_line_item`. + #[serde(skip_serializing_if = "Option::is_none")] + pub invoice_line_item: Option<&'a str>, + /// The line item quantity to credit. + #[serde(skip_serializing_if = "Option::is_none")] + pub quantity: Option, + /// A list of up to 10 tax amounts for the credit note line item. Cannot be mixed with `tax_rates`. + #[serde(skip_serializing_if = "Option::is_none")] + pub tax_amounts: Option<&'a [TaxAmountWithTaxRateParam<'a>]>, + /// The tax rates which apply to the credit note line item. + /// Only valid when the `type` is `custom_line_item` and cannot be mixed with `tax_amounts`. + #[serde(skip_serializing_if = "Option::is_none")] + pub tax_rates: Option<&'a [&'a str]>, + /// Type of the credit note line item, one of `invoice_line_item` or `custom_line_item` + #[serde(rename = "type")] + pub type_: CreateCreditNoteLinesType, + /// The integer unit amount in cents (or local equivalent) of the credit note line item. + /// This `unit_amount` will be multiplied by the quantity to get the full amount to credit for this line item. + /// Only valid when `type` is `custom_line_item`. + #[serde(skip_serializing_if = "Option::is_none")] + pub unit_amount: Option, + /// Same as `unit_amount`, but accepts a decimal value in cents (or local equivalent) with at most 12 decimal places. + /// Only one of `unit_amount` and `unit_amount_decimal` can be set. + #[serde(skip_serializing_if = "Option::is_none")] + pub unit_amount_decimal: Option<&'a str>, +} +impl<'a> CreateCreditNoteLines<'a> { + pub fn new(type_: CreateCreditNoteLinesType) -> Self { + Self { + amount: None, + description: None, + invoice_line_item: None, + quantity: None, + tax_amounts: None, + tax_rates: None, + type_, + unit_amount: None, + unit_amount_decimal: None, + } + } +} +/// Type of the credit note line item, one of `invoice_line_item` or `custom_line_item` +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreateCreditNoteLinesType { + CustomLineItem, + InvoiceLineItem, +} +impl CreateCreditNoteLinesType { + pub fn as_str(self) -> &'static str { + use CreateCreditNoteLinesType::*; + match self { + CustomLineItem => "custom_line_item", + InvoiceLineItem => "invoice_line_item", + } + } +} + +impl std::str::FromStr for CreateCreditNoteLinesType { + type Err = (); + fn from_str(s: &str) -> Result { + use CreateCreditNoteLinesType::*; + match s { + "custom_line_item" => Ok(CustomLineItem), + "invoice_line_item" => Ok(InvoiceLineItem), + _ => Err(()), + } + } +} +impl std::fmt::Display for CreateCreditNoteLinesType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreateCreditNoteLinesType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreateCreditNoteLinesType { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'a> CreateCreditNote<'a> { + /// Issue a credit note to adjust the amount of a finalized invoice. + /// For a `status=open` invoice, a credit note reduces. + /// its `amount_due`. + /// For a `status=paid` invoice, a credit note does not affect its `amount_due`. + /// Instead, it can result. + /// in any combination of the following: + /// + ///
    + ///
  • Refund: create a new refund (using `refund_amount`) or link an existing refund (using `refund`).
  • . + ///
  • Customer balance credit: credit the customer’s balance (using `credit_amount`) which will be automatically applied to their next invoice when it’s finalized.
  • . + ///
  • Outside of Stripe credit: record the amount that is or will be credited outside of Stripe (using `out_of_band_amount`).
  • . + ///
+ /// + /// For post-payment credit notes the sum of the refund, credit and outside of Stripe amounts must equal the credit note total. + /// + /// You may issue multiple credit notes for an invoice. + /// Each credit note will increment the invoice’s `pre_payment_credit_notes_amount`. + /// or `post_payment_credit_notes_amount` depending on its `status` at the time of credit note creation. + pub fn send(&self, client: &stripe::Client) -> stripe::Response { + client.send_form("/credit_notes", self, http_types::Method::Post) + } +} +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdateCreditNote<'a> { + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, + /// Credit note memo. + #[serde(skip_serializing_if = "Option::is_none")] + pub memo: Option<&'a str>, + /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. + /// This can be useful for storing additional information about the object in a structured format. + /// Individual keys can be unset by posting an empty value to them. + /// All keys can be unset by posting an empty value to `metadata`. + #[serde(skip_serializing_if = "Option::is_none")] + pub metadata: Option<&'a std::collections::HashMap>, +} +impl<'a> UpdateCreditNote<'a> { + pub fn new() -> Self { + Self::default() + } +} +impl<'a> UpdateCreditNote<'a> { + /// Updates an existing credit note. + pub fn send( + &self, + client: &stripe::Client, + id: &stripe_shared::CreditNoteId, + ) -> stripe::Response { + client.send_form(&format!("/credit_notes/{id}"), self, http_types::Method::Post) + } +} +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct VoidCreditNoteCreditNote<'a> { + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, +} +impl<'a> VoidCreditNoteCreditNote<'a> { + pub fn new() -> Self { + Self::default() + } +} +impl<'a> VoidCreditNoteCreditNote<'a> { + /// Marks a credit note as void. + /// Learn more about [voiding credit notes](https://stripe.com/docs/billing/invoices/credit-notes#voiding). + pub fn send( + &self, + client: &stripe::Client, + id: &stripe_shared::CreditNoteId, + ) -> stripe::Response { + client.send_form(&format!("/credit_notes/{id}/void"), self, http_types::Method::Post) + } +} +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct TaxAmountWithTaxRateParam<'a> { + /// The amount, in cents (or local equivalent), of the tax. + pub amount: i64, + /// The id of the tax rate for this tax amount. + /// The tax rate must have been automatically created by Stripe. + pub tax_rate: &'a str, + /// The amount on which tax is calculated, in cents (or local equivalent). + pub taxable_amount: i64, +} +impl<'a> TaxAmountWithTaxRateParam<'a> { + pub fn new(amount: i64, tax_rate: &'a str, taxable_amount: i64) -> Self { + Self { amount, tax_rate, taxable_amount } + } +} +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreditNoteShippingCost<'a> { + /// The ID of the shipping rate to use for this order. + #[serde(skip_serializing_if = "Option::is_none")] + pub shipping_rate: Option<&'a str>, +} +impl<'a> CreditNoteShippingCost<'a> { + pub fn new() -> Self { + Self::default() + } +} diff --git a/generated/stripe_billing/src/credit_note_line_item/mod.rs b/generated/stripe_billing/src/credit_note_line_item/mod.rs new file mode 100644 index 000000000..5a3037035 --- /dev/null +++ b/generated/stripe_billing/src/credit_note_line_item/mod.rs @@ -0,0 +1,4 @@ +#[cfg(feature = "credit_note_line_item")] +mod requests; +#[cfg(feature = "credit_note_line_item")] +pub use requests::*; diff --git a/generated/stripe_billing/src/credit_note_line_item/requests.rs b/generated/stripe_billing/src/credit_note_line_item/requests.rs new file mode 100644 index 000000000..bc841a139 --- /dev/null +++ b/generated/stripe_billing/src/credit_note_line_item/requests.rs @@ -0,0 +1,42 @@ +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct ListCreditNoteCreditNoteLineItem<'a> { + /// A cursor for use in pagination. + /// `ending_before` is an object ID that defines your place in the list. + /// For instance, if you make a list request and receive 100 objects, starting with `obj_bar`, your subsequent call can include `ending_before=obj_bar` in order to fetch the previous page of the list. + #[serde(skip_serializing_if = "Option::is_none")] + pub ending_before: Option<&'a str>, + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, + /// A limit on the number of objects to be returned. + /// Limit can range between 1 and 100, and the default is 10. + #[serde(skip_serializing_if = "Option::is_none")] + pub limit: Option, + /// A cursor for use in pagination. + /// `starting_after` is an object ID that defines your place in the list. + /// For instance, if you make a list request and receive 100 objects, ending with `obj_foo`, your subsequent call can include `starting_after=obj_foo` in order to fetch the next page of the list. + #[serde(skip_serializing_if = "Option::is_none")] + pub starting_after: Option<&'a str>, +} +impl<'a> ListCreditNoteCreditNoteLineItem<'a> { + pub fn new() -> Self { + Self::default() + } +} +impl<'a> ListCreditNoteCreditNoteLineItem<'a> { + /// When retrieving a credit note, you’ll get a **lines** property containing the the first handful of those items. + /// There is also a URL where you can retrieve the full (paginated) list of line items. + pub fn send( + &self, + client: &stripe::Client, + credit_note: &stripe_shared::CreditNoteId, + ) -> stripe::Response> { + client.get_query(&format!("/credit_notes/{credit_note}/lines"), self) + } + pub fn paginate( + self, + credit_note: &stripe_shared::CreditNoteId, + ) -> stripe::ListPaginator> { + stripe::ListPaginator::from_list_params(&format!("/credit_notes/{credit_note}/lines"), self) + } +} diff --git a/generated/stripe_billing/src/invoice/mod.rs b/generated/stripe_billing/src/invoice/mod.rs new file mode 100644 index 000000000..d8a66a015 --- /dev/null +++ b/generated/stripe_billing/src/invoice/mod.rs @@ -0,0 +1,4 @@ +#[cfg(feature = "invoice")] +mod requests; +#[cfg(feature = "invoice")] +pub use requests::*; diff --git a/generated/stripe_billing/src/invoice/requests.rs b/generated/stripe_billing/src/invoice/requests.rs new file mode 100644 index 000000000..ae4506f97 --- /dev/null +++ b/generated/stripe_billing/src/invoice/requests.rs @@ -0,0 +1,6253 @@ +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct DeleteInvoice {} +impl DeleteInvoice { + pub fn new() -> Self { + Self::default() + } +} +impl DeleteInvoice { + /// Permanently deletes a one-off invoice draft. + /// This cannot be undone. + /// Attempts to delete invoices that are no longer in a draft state will fail; once an invoice has been finalized or if an invoice is for a subscription, it must be [voided](https://stripe.com/docs/api#void_invoice). + pub fn send( + &self, + client: &stripe::Client, + invoice: &stripe_shared::InvoiceId, + ) -> stripe::Response { + client.send_form(&format!("/invoices/{invoice}"), self, http_types::Method::Delete) + } +} +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct ListInvoice<'a> { + /// The collection method of the invoice to retrieve. Either `charge_automatically` or `send_invoice`. + #[serde(skip_serializing_if = "Option::is_none")] + pub collection_method: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub created: Option, + /// Only return invoices for the customer specified by this customer ID. + #[serde(skip_serializing_if = "Option::is_none")] + pub customer: Option<&'a str>, + #[serde(skip_serializing_if = "Option::is_none")] + pub due_date: Option, + /// A cursor for use in pagination. + /// `ending_before` is an object ID that defines your place in the list. + /// For instance, if you make a list request and receive 100 objects, starting with `obj_bar`, your subsequent call can include `ending_before=obj_bar` in order to fetch the previous page of the list. + #[serde(skip_serializing_if = "Option::is_none")] + pub ending_before: Option<&'a str>, + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, + /// A limit on the number of objects to be returned. + /// Limit can range between 1 and 100, and the default is 10. + #[serde(skip_serializing_if = "Option::is_none")] + pub limit: Option, + /// A cursor for use in pagination. + /// `starting_after` is an object ID that defines your place in the list. + /// For instance, if you make a list request and receive 100 objects, ending with `obj_foo`, your subsequent call can include `starting_after=obj_foo` in order to fetch the next page of the list. + #[serde(skip_serializing_if = "Option::is_none")] + pub starting_after: Option<&'a str>, + /// The status of the invoice, one of `draft`, `open`, `paid`, `uncollectible`, or `void`. + /// [Learn more](https://stripe.com/docs/billing/invoices/workflow#workflow-overview). + #[serde(skip_serializing_if = "Option::is_none")] + pub status: Option, + /// Only return invoices for the subscription specified by this subscription ID. + #[serde(skip_serializing_if = "Option::is_none")] + pub subscription: Option<&'a str>, +} +impl<'a> ListInvoice<'a> { + pub fn new() -> Self { + Self::default() + } +} +impl<'a> ListInvoice<'a> { + /// You can list all invoices, or list the invoices for a specific customer. + /// The invoices are returned sorted by creation date, with the most recently created invoices appearing first. + pub fn send( + &self, + client: &stripe::Client, + ) -> stripe::Response> { + client.get_query("/invoices", self) + } + pub fn paginate(self) -> stripe::ListPaginator> { + stripe::ListPaginator::from_list_params("/invoices", self) + } +} +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct RetrieveInvoice<'a> { + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, +} +impl<'a> RetrieveInvoice<'a> { + pub fn new() -> Self { + Self::default() + } +} +impl<'a> RetrieveInvoice<'a> { + /// Retrieves the invoice with the given ID. + pub fn send( + &self, + client: &stripe::Client, + invoice: &stripe_shared::InvoiceId, + ) -> stripe::Response { + client.get_query(&format!("/invoices/{invoice}"), self) + } +} +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct SearchInvoice<'a> { + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, + /// A limit on the number of objects to be returned. + /// Limit can range between 1 and 100, and the default is 10. + #[serde(skip_serializing_if = "Option::is_none")] + pub limit: Option, + /// A cursor for pagination across multiple pages of results. + /// Don't include this parameter on the first call. + /// Use the next_page value returned in a previous response to request subsequent results. + #[serde(skip_serializing_if = "Option::is_none")] + pub page: Option<&'a str>, + /// The search query string. + /// See [search query language](https://stripe.com/docs/search#search-query-language) and the list of supported [query fields for invoices](https://stripe.com/docs/search#query-fields-for-invoices). + pub query: &'a str, +} +impl<'a> SearchInvoice<'a> { + pub fn new(query: &'a str) -> Self { + Self { expand: None, limit: None, page: None, query } + } +} +impl<'a> SearchInvoice<'a> { + /// Search for invoices you’ve previously created using Stripe’s [Search Query Language](https://stripe.com/docs/search#search-query-language). + /// Don’t use search in read-after-write flows where strict consistency is necessary. + /// Under normal operating. + /// conditions, data is searchable in less than a minute. + /// Occasionally, propagation of new or updated data can be up. + /// to an hour behind during outages. Search functionality is not available to merchants in India. + pub fn send( + &self, + client: &stripe::Client, + ) -> stripe::Response> { + client.get_query("/invoices/search", self) + } + pub fn paginate( + self, + ) -> stripe::ListPaginator> { + stripe::ListPaginator::from_search_params("/invoices/search", self) + } +} +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpcomingInvoice<'a> { + /// Settings for automatic tax lookup for this invoice preview. + #[serde(skip_serializing_if = "Option::is_none")] + pub automatic_tax: Option>, + /// The code of the coupon to apply. + /// If `subscription` or `subscription_items` is provided, the invoice returned will preview updating or creating a subscription with that coupon. + /// Otherwise, it will preview applying that coupon to the customer for the next upcoming invoice from among the customer's subscriptions. + /// The invoice can be previewed without a coupon by passing this value as an empty string. + #[serde(skip_serializing_if = "Option::is_none")] + pub coupon: Option<&'a str>, + /// The currency to preview this invoice in. Defaults to that of `customer` if not specified. + #[serde(skip_serializing_if = "Option::is_none")] + pub currency: Option, + /// The identifier of the customer whose upcoming invoice you'd like to retrieve. + /// If `automatic_tax` is enabled then one of `customer`, `customer_details`, `subscription`, or `schedule` must be set. + #[serde(skip_serializing_if = "Option::is_none")] + pub customer: Option<&'a str>, + /// Details about the customer you want to invoice or overrides for an existing customer. + /// If `automatic_tax` is enabled then one of `customer`, `customer_details`, `subscription`, or `schedule` must be set. + #[serde(skip_serializing_if = "Option::is_none")] + pub customer_details: Option>, + /// The coupons to redeem into discounts for the invoice preview. + /// If not specified, inherits the discount from the customer or subscription. + /// This only works for coupons directly applied to the invoice. + /// To apply a coupon to a subscription, you must use the `coupon` parameter instead. + /// Pass an empty string to avoid inheriting any discounts. + /// To preview the upcoming invoice for a subscription that hasn't been created, use `coupon` instead. + #[serde(skip_serializing_if = "Option::is_none")] + pub discounts: Option<&'a [DiscountsDataParam<'a>]>, + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, + /// List of invoice items to add or update in the upcoming invoice preview. + #[serde(skip_serializing_if = "Option::is_none")] + pub invoice_items: Option<&'a [UpcomingInvoiceInvoiceItems<'a>]>, + /// The connected account that issues the invoice. + /// The invoice is presented with the branding and support information of the specified account. + #[serde(skip_serializing_if = "Option::is_none")] + pub issuer: Option>, + /// The account (if any) for which the funds of the invoice payment are intended. + /// If set, the invoice will be presented with the branding and support information of the specified account. + /// See the [Invoices with Connect](https://stripe.com/docs/billing/invoices/connect) documentation for details. + #[serde(skip_serializing_if = "Option::is_none")] + pub on_behalf_of: Option<&'a str>, + /// The identifier of the schedule whose upcoming invoice you'd like to retrieve. + /// Cannot be used with subscription or subscription fields. + #[serde(skip_serializing_if = "Option::is_none")] + pub schedule: Option<&'a str>, + /// The identifier of the subscription for which you'd like to retrieve the upcoming invoice. + /// If not provided, but a `subscription_items` is provided, you will preview creating a subscription with those items. + /// If neither `subscription` nor `subscription_items` is provided, you will retrieve the next upcoming invoice from among the customer's subscriptions. + #[serde(skip_serializing_if = "Option::is_none")] + pub subscription: Option<&'a str>, + /// For new subscriptions, a future timestamp to anchor the subscription's [billing cycle](https://stripe.com/docs/subscriptions/billing-cycle). + /// This is used to determine the date of the first full invoice, and, for plans with `month` or `year` intervals, the day of the month for subsequent invoices. + /// For existing subscriptions, the value can only be set to `now` or `unchanged`. + #[serde(skip_serializing_if = "Option::is_none")] + pub subscription_billing_cycle_anchor: Option, + /// A timestamp at which the subscription should cancel. + /// If set to a date before the current period ends, this will cause a proration if prorations have been enabled using `proration_behavior`. + /// If set during a future period, this will always cause a proration for that period. + #[serde(skip_serializing_if = "Option::is_none")] + pub subscription_cancel_at: Option, + /// Boolean indicating whether this subscription should cancel at the end of the current period. + #[serde(skip_serializing_if = "Option::is_none")] + pub subscription_cancel_at_period_end: Option, + /// This simulates the subscription being canceled or expired immediately. + #[serde(skip_serializing_if = "Option::is_none")] + pub subscription_cancel_now: Option, + /// If provided, the invoice returned will preview updating or creating a subscription with these default tax rates. + /// The default tax rates will apply to any line item that does not have `tax_rates` set. + #[serde(skip_serializing_if = "Option::is_none")] + pub subscription_default_tax_rates: Option<&'a [&'a str]>, + /// A list of up to 20 subscription items, each with an attached price. + #[serde(skip_serializing_if = "Option::is_none")] + pub subscription_items: Option<&'a [UpcomingInvoiceSubscriptionItems<'a>]>, + /// Determines how to handle [prorations](https://stripe.com/docs/subscriptions/billing-cycle#prorations) when the billing cycle changes (e.g., when switching plans, resetting `billing_cycle_anchor=now`, or starting a trial), or if an item's `quantity` changes. + /// The default value is `create_prorations`. + #[serde(skip_serializing_if = "Option::is_none")] + pub subscription_proration_behavior: Option, + /// If previewing an update to a subscription, and doing proration, `subscription_proration_date` forces the proration to be calculated as though the update was done at the specified time. + /// The time given must be within the current subscription period and within the current phase of the schedule backing this subscription, if the schedule exists. + /// If set, `subscription`, and one of `subscription_items`, or `subscription_trial_end` are required. + /// Also, `subscription_proration_behavior` cannot be set to 'none'. + #[serde(skip_serializing_if = "Option::is_none")] + pub subscription_proration_date: Option, + /// For paused subscriptions, setting `subscription_resume_at` to `now` will preview the invoice that will be generated if the subscription is resumed. + #[serde(skip_serializing_if = "Option::is_none")] + pub subscription_resume_at: Option, + /// Date a subscription is intended to start (can be future or past). + #[serde(skip_serializing_if = "Option::is_none")] + pub subscription_start_date: Option, + /// If provided, the invoice returned will preview updating or creating a subscription with that trial end. + /// If set, one of `subscription_items` or `subscription` is required. + #[serde(skip_serializing_if = "Option::is_none")] + pub subscription_trial_end: Option, + /// Indicates if a plan's `trial_period_days` should be applied to the subscription. + /// Setting `subscription_trial_end` per subscription is preferred, and this defaults to `false`. + /// Setting this flag to `true` together with `subscription_trial_end` is not allowed. + /// See [Using trial periods on subscriptions](https://stripe.com/docs/billing/subscriptions/trials) to learn more. + #[serde(skip_serializing_if = "Option::is_none")] + pub subscription_trial_from_plan: Option, +} +impl<'a> UpcomingInvoice<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// Settings for automatic tax lookup for this invoice preview. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct UpcomingInvoiceAutomaticTax<'a> { + /// Whether Stripe automatically computes tax on this invoice. + /// Note that incompatible invoice items (invoice items with manually specified [tax rates](https://stripe.com/docs/api/tax_rates), negative amounts, or `tax_behavior=unspecified`) cannot be added to automatic tax invoices. + pub enabled: bool, + /// The account that's liable for tax. + /// If set, the business address and tax registrations required to perform the tax calculation are loaded from this account. + /// The tax transaction is returned in the report of the connected account. + #[serde(skip_serializing_if = "Option::is_none")] + pub liability: Option>, +} +impl<'a> UpcomingInvoiceAutomaticTax<'a> { + pub fn new(enabled: bool) -> Self { + Self { enabled, liability: None } + } +} +/// The account that's liable for tax. +/// If set, the business address and tax registrations required to perform the tax calculation are loaded from this account. +/// The tax transaction is returned in the report of the connected account. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct UpcomingInvoiceAutomaticTaxLiability<'a> { + /// The connected account being referenced when `type` is `account`. + #[serde(skip_serializing_if = "Option::is_none")] + pub account: Option<&'a str>, + /// Type of the account referenced in the request. + #[serde(rename = "type")] + pub type_: UpcomingInvoiceAutomaticTaxLiabilityType, +} +impl<'a> UpcomingInvoiceAutomaticTaxLiability<'a> { + pub fn new(type_: UpcomingInvoiceAutomaticTaxLiabilityType) -> Self { + Self { account: None, type_ } + } +} +/// Type of the account referenced in the request. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum UpcomingInvoiceAutomaticTaxLiabilityType { + Account, + Self_, +} +impl UpcomingInvoiceAutomaticTaxLiabilityType { + pub fn as_str(self) -> &'static str { + use UpcomingInvoiceAutomaticTaxLiabilityType::*; + match self { + Account => "account", + Self_ => "self", + } + } +} + +impl std::str::FromStr for UpcomingInvoiceAutomaticTaxLiabilityType { + type Err = (); + fn from_str(s: &str) -> Result { + use UpcomingInvoiceAutomaticTaxLiabilityType::*; + match s { + "account" => Ok(Account), + "self" => Ok(Self_), + _ => Err(()), + } + } +} +impl std::fmt::Display for UpcomingInvoiceAutomaticTaxLiabilityType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for UpcomingInvoiceAutomaticTaxLiabilityType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for UpcomingInvoiceAutomaticTaxLiabilityType { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Details about the customer you want to invoice or overrides for an existing customer. +/// If `automatic_tax` is enabled then one of `customer`, `customer_details`, `subscription`, or `schedule` must be set. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpcomingInvoiceCustomerDetails<'a> { + /// The customer's address. + #[serde(skip_serializing_if = "Option::is_none")] + pub address: Option>, + /// The customer's shipping information. Appears on invoices emailed to this customer. + #[serde(skip_serializing_if = "Option::is_none")] + pub shipping: Option>, + /// Tax details about the customer. + #[serde(skip_serializing_if = "Option::is_none")] + pub tax: Option>, + /// The customer's tax exemption. One of `none`, `exempt`, or `reverse`. + #[serde(skip_serializing_if = "Option::is_none")] + pub tax_exempt: Option, + /// The customer's tax IDs. + #[serde(skip_serializing_if = "Option::is_none")] + pub tax_ids: Option<&'a [UpcomingInvoiceCustomerDetailsTaxIds<'a>]>, +} +impl<'a> UpcomingInvoiceCustomerDetails<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// The customer's tax exemption. One of `none`, `exempt`, or `reverse`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum UpcomingInvoiceCustomerDetailsTaxExempt { + Exempt, + None, + Reverse, +} +impl UpcomingInvoiceCustomerDetailsTaxExempt { + pub fn as_str(self) -> &'static str { + use UpcomingInvoiceCustomerDetailsTaxExempt::*; + match self { + Exempt => "exempt", + None => "none", + Reverse => "reverse", + } + } +} + +impl std::str::FromStr for UpcomingInvoiceCustomerDetailsTaxExempt { + type Err = (); + fn from_str(s: &str) -> Result { + use UpcomingInvoiceCustomerDetailsTaxExempt::*; + match s { + "exempt" => Ok(Exempt), + "none" => Ok(None), + "reverse" => Ok(Reverse), + _ => Err(()), + } + } +} +impl std::fmt::Display for UpcomingInvoiceCustomerDetailsTaxExempt { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for UpcomingInvoiceCustomerDetailsTaxExempt { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for UpcomingInvoiceCustomerDetailsTaxExempt { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// The customer's tax IDs. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct UpcomingInvoiceCustomerDetailsTaxIds<'a> { + /// Type of the tax ID, one of `ad_nrt`, `ae_trn`, `ar_cuit`, `au_abn`, `au_arn`, `bg_uic`, `bo_tin`, `br_cnpj`, `br_cpf`, `ca_bn`, `ca_gst_hst`, `ca_pst_bc`, `ca_pst_mb`, `ca_pst_sk`, `ca_qst`, `ch_vat`, `cl_tin`, `cn_tin`, `co_nit`, `cr_tin`, `do_rcn`, `ec_ruc`, `eg_tin`, `es_cif`, `eu_oss_vat`, `eu_vat`, `gb_vat`, `ge_vat`, `hk_br`, `hu_tin`, `id_npwp`, `il_vat`, `in_gst`, `is_vat`, `jp_cn`, `jp_rn`, `jp_trn`, `ke_pin`, `kr_brn`, `li_uid`, `mx_rfc`, `my_frp`, `my_itn`, `my_sst`, `no_vat`, `nz_gst`, `pe_ruc`, `ph_tin`, `ro_tin`, `rs_pib`, `ru_inn`, `ru_kpp`, `sa_vat`, `sg_gst`, `sg_uen`, `si_tin`, `sv_nit`, `th_vat`, `tr_tin`, `tw_vat`, `ua_vat`, `us_ein`, `uy_ruc`, `ve_rif`, `vn_tin`, or `za_vat`. + #[serde(rename = "type")] + pub type_: UpcomingInvoiceCustomerDetailsTaxIdsType, + /// Value of the tax ID. + pub value: &'a str, +} +impl<'a> UpcomingInvoiceCustomerDetailsTaxIds<'a> { + pub fn new(type_: UpcomingInvoiceCustomerDetailsTaxIdsType, value: &'a str) -> Self { + Self { type_, value } + } +} +/// Type of the tax ID, one of `ad_nrt`, `ae_trn`, `ar_cuit`, `au_abn`, `au_arn`, `bg_uic`, `bo_tin`, `br_cnpj`, `br_cpf`, `ca_bn`, `ca_gst_hst`, `ca_pst_bc`, `ca_pst_mb`, `ca_pst_sk`, `ca_qst`, `ch_vat`, `cl_tin`, `cn_tin`, `co_nit`, `cr_tin`, `do_rcn`, `ec_ruc`, `eg_tin`, `es_cif`, `eu_oss_vat`, `eu_vat`, `gb_vat`, `ge_vat`, `hk_br`, `hu_tin`, `id_npwp`, `il_vat`, `in_gst`, `is_vat`, `jp_cn`, `jp_rn`, `jp_trn`, `ke_pin`, `kr_brn`, `li_uid`, `mx_rfc`, `my_frp`, `my_itn`, `my_sst`, `no_vat`, `nz_gst`, `pe_ruc`, `ph_tin`, `ro_tin`, `rs_pib`, `ru_inn`, `ru_kpp`, `sa_vat`, `sg_gst`, `sg_uen`, `si_tin`, `sv_nit`, `th_vat`, `tr_tin`, `tw_vat`, `ua_vat`, `us_ein`, `uy_ruc`, `ve_rif`, `vn_tin`, or `za_vat`. +#[derive(Copy, Clone, Eq, PartialEq)] +#[non_exhaustive] +pub enum UpcomingInvoiceCustomerDetailsTaxIdsType { + AdNrt, + AeTrn, + ArCuit, + AuAbn, + AuArn, + BgUic, + BoTin, + BrCnpj, + BrCpf, + CaBn, + CaGstHst, + CaPstBc, + CaPstMb, + CaPstSk, + CaQst, + ChVat, + ClTin, + CnTin, + CoNit, + CrTin, + DoRcn, + EcRuc, + EgTin, + EsCif, + EuOssVat, + EuVat, + GbVat, + GeVat, + HkBr, + HuTin, + IdNpwp, + IlVat, + InGst, + IsVat, + JpCn, + JpRn, + JpTrn, + KePin, + KrBrn, + LiUid, + MxRfc, + MyFrp, + MyItn, + MySst, + NoVat, + NzGst, + PeRuc, + PhTin, + RoTin, + RsPib, + RuInn, + RuKpp, + SaVat, + SgGst, + SgUen, + SiTin, + SvNit, + ThVat, + TrTin, + TwVat, + UaVat, + UsEin, + UyRuc, + VeRif, + VnTin, + ZaVat, + /// An unrecognized value from Stripe. Should not be used as a request parameter. + Unknown, +} +impl UpcomingInvoiceCustomerDetailsTaxIdsType { + pub fn as_str(self) -> &'static str { + use UpcomingInvoiceCustomerDetailsTaxIdsType::*; + match self { + AdNrt => "ad_nrt", + AeTrn => "ae_trn", + ArCuit => "ar_cuit", + AuAbn => "au_abn", + AuArn => "au_arn", + BgUic => "bg_uic", + BoTin => "bo_tin", + BrCnpj => "br_cnpj", + BrCpf => "br_cpf", + CaBn => "ca_bn", + CaGstHst => "ca_gst_hst", + CaPstBc => "ca_pst_bc", + CaPstMb => "ca_pst_mb", + CaPstSk => "ca_pst_sk", + CaQst => "ca_qst", + ChVat => "ch_vat", + ClTin => "cl_tin", + CnTin => "cn_tin", + CoNit => "co_nit", + CrTin => "cr_tin", + DoRcn => "do_rcn", + EcRuc => "ec_ruc", + EgTin => "eg_tin", + EsCif => "es_cif", + EuOssVat => "eu_oss_vat", + EuVat => "eu_vat", + GbVat => "gb_vat", + GeVat => "ge_vat", + HkBr => "hk_br", + HuTin => "hu_tin", + IdNpwp => "id_npwp", + IlVat => "il_vat", + InGst => "in_gst", + IsVat => "is_vat", + JpCn => "jp_cn", + JpRn => "jp_rn", + JpTrn => "jp_trn", + KePin => "ke_pin", + KrBrn => "kr_brn", + LiUid => "li_uid", + MxRfc => "mx_rfc", + MyFrp => "my_frp", + MyItn => "my_itn", + MySst => "my_sst", + NoVat => "no_vat", + NzGst => "nz_gst", + PeRuc => "pe_ruc", + PhTin => "ph_tin", + RoTin => "ro_tin", + RsPib => "rs_pib", + RuInn => "ru_inn", + RuKpp => "ru_kpp", + SaVat => "sa_vat", + SgGst => "sg_gst", + SgUen => "sg_uen", + SiTin => "si_tin", + SvNit => "sv_nit", + ThVat => "th_vat", + TrTin => "tr_tin", + TwVat => "tw_vat", + UaVat => "ua_vat", + UsEin => "us_ein", + UyRuc => "uy_ruc", + VeRif => "ve_rif", + VnTin => "vn_tin", + ZaVat => "za_vat", + Unknown => "unknown", + } + } +} + +impl std::str::FromStr for UpcomingInvoiceCustomerDetailsTaxIdsType { + type Err = (); + fn from_str(s: &str) -> Result { + use UpcomingInvoiceCustomerDetailsTaxIdsType::*; + match s { + "ad_nrt" => Ok(AdNrt), + "ae_trn" => Ok(AeTrn), + "ar_cuit" => Ok(ArCuit), + "au_abn" => Ok(AuAbn), + "au_arn" => Ok(AuArn), + "bg_uic" => Ok(BgUic), + "bo_tin" => Ok(BoTin), + "br_cnpj" => Ok(BrCnpj), + "br_cpf" => Ok(BrCpf), + "ca_bn" => Ok(CaBn), + "ca_gst_hst" => Ok(CaGstHst), + "ca_pst_bc" => Ok(CaPstBc), + "ca_pst_mb" => Ok(CaPstMb), + "ca_pst_sk" => Ok(CaPstSk), + "ca_qst" => Ok(CaQst), + "ch_vat" => Ok(ChVat), + "cl_tin" => Ok(ClTin), + "cn_tin" => Ok(CnTin), + "co_nit" => Ok(CoNit), + "cr_tin" => Ok(CrTin), + "do_rcn" => Ok(DoRcn), + "ec_ruc" => Ok(EcRuc), + "eg_tin" => Ok(EgTin), + "es_cif" => Ok(EsCif), + "eu_oss_vat" => Ok(EuOssVat), + "eu_vat" => Ok(EuVat), + "gb_vat" => Ok(GbVat), + "ge_vat" => Ok(GeVat), + "hk_br" => Ok(HkBr), + "hu_tin" => Ok(HuTin), + "id_npwp" => Ok(IdNpwp), + "il_vat" => Ok(IlVat), + "in_gst" => Ok(InGst), + "is_vat" => Ok(IsVat), + "jp_cn" => Ok(JpCn), + "jp_rn" => Ok(JpRn), + "jp_trn" => Ok(JpTrn), + "ke_pin" => Ok(KePin), + "kr_brn" => Ok(KrBrn), + "li_uid" => Ok(LiUid), + "mx_rfc" => Ok(MxRfc), + "my_frp" => Ok(MyFrp), + "my_itn" => Ok(MyItn), + "my_sst" => Ok(MySst), + "no_vat" => Ok(NoVat), + "nz_gst" => Ok(NzGst), + "pe_ruc" => Ok(PeRuc), + "ph_tin" => Ok(PhTin), + "ro_tin" => Ok(RoTin), + "rs_pib" => Ok(RsPib), + "ru_inn" => Ok(RuInn), + "ru_kpp" => Ok(RuKpp), + "sa_vat" => Ok(SaVat), + "sg_gst" => Ok(SgGst), + "sg_uen" => Ok(SgUen), + "si_tin" => Ok(SiTin), + "sv_nit" => Ok(SvNit), + "th_vat" => Ok(ThVat), + "tr_tin" => Ok(TrTin), + "tw_vat" => Ok(TwVat), + "ua_vat" => Ok(UaVat), + "us_ein" => Ok(UsEin), + "uy_ruc" => Ok(UyRuc), + "ve_rif" => Ok(VeRif), + "vn_tin" => Ok(VnTin), + "za_vat" => Ok(ZaVat), + _ => Err(()), + } + } +} +impl std::fmt::Display for UpcomingInvoiceCustomerDetailsTaxIdsType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for UpcomingInvoiceCustomerDetailsTaxIdsType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for UpcomingInvoiceCustomerDetailsTaxIdsType { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// List of invoice items to add or update in the upcoming invoice preview. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpcomingInvoiceInvoiceItems<'a> { + /// The integer amount in cents (or local equivalent) of previewed invoice item. + #[serde(skip_serializing_if = "Option::is_none")] + pub amount: Option, + /// Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. + /// Must be a [supported currency](https://stripe.com/docs/currencies). + /// Only applicable to new invoice items. + #[serde(skip_serializing_if = "Option::is_none")] + pub currency: Option, + /// An arbitrary string which you can attach to the invoice item. + /// The description is displayed in the invoice for easy tracking. + #[serde(skip_serializing_if = "Option::is_none")] + pub description: Option<&'a str>, + /// Explicitly controls whether discounts apply to this invoice item. + /// Defaults to true, except for negative invoice items. + #[serde(skip_serializing_if = "Option::is_none")] + pub discountable: Option, + /// The coupons to redeem into discounts for the invoice item in the preview. + #[serde(skip_serializing_if = "Option::is_none")] + pub discounts: Option<&'a [DiscountsDataParam<'a>]>, + /// The ID of the invoice item to update in preview. + /// If not specified, a new invoice item will be added to the preview of the upcoming invoice. + #[serde(skip_serializing_if = "Option::is_none")] + pub invoiceitem: Option<&'a str>, + /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. + /// This can be useful for storing additional information about the object in a structured format. + /// Individual keys can be unset by posting an empty value to them. + /// All keys can be unset by posting an empty value to `metadata`. + #[serde(skip_serializing_if = "Option::is_none")] + pub metadata: Option<&'a std::collections::HashMap>, + /// The period associated with this invoice item. + /// When set to different values, the period will be rendered on the invoice. + /// If you have [Stripe Revenue Recognition](https://stripe.com/docs/revenue-recognition) enabled, the period will be used to recognize and defer revenue. + /// See the [Revenue Recognition documentation](https://stripe.com/docs/revenue-recognition/methodology/subscriptions-and-invoicing) for details. + #[serde(skip_serializing_if = "Option::is_none")] + pub period: Option, + /// The ID of the price object. + #[serde(skip_serializing_if = "Option::is_none")] + pub price: Option<&'a str>, + /// Data used to generate a new [Price](https://stripe.com/docs/api/prices) object inline. + #[serde(skip_serializing_if = "Option::is_none")] + pub price_data: Option>, + /// Non-negative integer. The quantity of units for the invoice item. + #[serde(skip_serializing_if = "Option::is_none")] + pub quantity: Option, + /// Only required if a [default tax behavior](https://stripe.com/docs/tax/products-prices-tax-categories-tax-behavior#setting-a-default-tax-behavior-(recommended)) was not provided in the Stripe Tax settings. + /// Specifies whether the price is considered inclusive of taxes or exclusive of taxes. + /// One of `inclusive`, `exclusive`, or `unspecified`. + /// Once specified as either `inclusive` or `exclusive`, it cannot be changed. + #[serde(skip_serializing_if = "Option::is_none")] + pub tax_behavior: Option, + /// A [tax code](https://stripe.com/docs/tax/tax-categories) ID. + #[serde(skip_serializing_if = "Option::is_none")] + pub tax_code: Option<&'a str>, + /// The tax rates that apply to the item. When set, any `default_tax_rates` do not apply to this item. + #[serde(skip_serializing_if = "Option::is_none")] + pub tax_rates: Option<&'a [&'a str]>, + /// The integer unit amount in cents (or local equivalent) of the charge to be applied to the upcoming invoice. + /// This unit_amount will be multiplied by the quantity to get the full amount. + /// If you want to apply a credit to the customer's account, pass a negative unit_amount. + #[serde(skip_serializing_if = "Option::is_none")] + pub unit_amount: Option, + /// Same as `unit_amount`, but accepts a decimal value in cents (or local equivalent) with at most 12 decimal places. + /// Only one of `unit_amount` and `unit_amount_decimal` can be set. + #[serde(skip_serializing_if = "Option::is_none")] + pub unit_amount_decimal: Option<&'a str>, +} +impl<'a> UpcomingInvoiceInvoiceItems<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// Data used to generate a new [Price](https://stripe.com/docs/api/prices) object inline. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct UpcomingInvoiceInvoiceItemsPriceData<'a> { + /// Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. + /// Must be a [supported currency](https://stripe.com/docs/currencies). + pub currency: stripe_types::Currency, + /// The ID of the product that this price will belong to. + pub product: &'a str, + /// Only required if a [default tax behavior](https://stripe.com/docs/tax/products-prices-tax-categories-tax-behavior#setting-a-default-tax-behavior-(recommended)) was not provided in the Stripe Tax settings. + /// Specifies whether the price is considered inclusive of taxes or exclusive of taxes. + /// One of `inclusive`, `exclusive`, or `unspecified`. + /// Once specified as either `inclusive` or `exclusive`, it cannot be changed. + #[serde(skip_serializing_if = "Option::is_none")] + pub tax_behavior: Option, + /// A positive integer in cents (or local equivalent) (or 0 for a free price) representing how much to charge. + #[serde(skip_serializing_if = "Option::is_none")] + pub unit_amount: Option, + /// Same as `unit_amount`, but accepts a decimal value in cents (or local equivalent) with at most 12 decimal places. + /// Only one of `unit_amount` and `unit_amount_decimal` can be set. + #[serde(skip_serializing_if = "Option::is_none")] + pub unit_amount_decimal: Option<&'a str>, +} +impl<'a> UpcomingInvoiceInvoiceItemsPriceData<'a> { + pub fn new(currency: stripe_types::Currency, product: &'a str) -> Self { + Self { currency, product, tax_behavior: None, unit_amount: None, unit_amount_decimal: None } + } +} +/// Only required if a [default tax behavior](https://stripe.com/docs/tax/products-prices-tax-categories-tax-behavior#setting-a-default-tax-behavior-(recommended)) was not provided in the Stripe Tax settings. +/// Specifies whether the price is considered inclusive of taxes or exclusive of taxes. +/// One of `inclusive`, `exclusive`, or `unspecified`. +/// Once specified as either `inclusive` or `exclusive`, it cannot be changed. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum UpcomingInvoiceInvoiceItemsPriceDataTaxBehavior { + Exclusive, + Inclusive, + Unspecified, +} +impl UpcomingInvoiceInvoiceItemsPriceDataTaxBehavior { + pub fn as_str(self) -> &'static str { + use UpcomingInvoiceInvoiceItemsPriceDataTaxBehavior::*; + match self { + Exclusive => "exclusive", + Inclusive => "inclusive", + Unspecified => "unspecified", + } + } +} + +impl std::str::FromStr for UpcomingInvoiceInvoiceItemsPriceDataTaxBehavior { + type Err = (); + fn from_str(s: &str) -> Result { + use UpcomingInvoiceInvoiceItemsPriceDataTaxBehavior::*; + match s { + "exclusive" => Ok(Exclusive), + "inclusive" => Ok(Inclusive), + "unspecified" => Ok(Unspecified), + _ => Err(()), + } + } +} +impl std::fmt::Display for UpcomingInvoiceInvoiceItemsPriceDataTaxBehavior { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for UpcomingInvoiceInvoiceItemsPriceDataTaxBehavior { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for UpcomingInvoiceInvoiceItemsPriceDataTaxBehavior { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Only required if a [default tax behavior](https://stripe.com/docs/tax/products-prices-tax-categories-tax-behavior#setting-a-default-tax-behavior-(recommended)) was not provided in the Stripe Tax settings. +/// Specifies whether the price is considered inclusive of taxes or exclusive of taxes. +/// One of `inclusive`, `exclusive`, or `unspecified`. +/// Once specified as either `inclusive` or `exclusive`, it cannot be changed. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum UpcomingInvoiceInvoiceItemsTaxBehavior { + Exclusive, + Inclusive, + Unspecified, +} +impl UpcomingInvoiceInvoiceItemsTaxBehavior { + pub fn as_str(self) -> &'static str { + use UpcomingInvoiceInvoiceItemsTaxBehavior::*; + match self { + Exclusive => "exclusive", + Inclusive => "inclusive", + Unspecified => "unspecified", + } + } +} + +impl std::str::FromStr for UpcomingInvoiceInvoiceItemsTaxBehavior { + type Err = (); + fn from_str(s: &str) -> Result { + use UpcomingInvoiceInvoiceItemsTaxBehavior::*; + match s { + "exclusive" => Ok(Exclusive), + "inclusive" => Ok(Inclusive), + "unspecified" => Ok(Unspecified), + _ => Err(()), + } + } +} +impl std::fmt::Display for UpcomingInvoiceInvoiceItemsTaxBehavior { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for UpcomingInvoiceInvoiceItemsTaxBehavior { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for UpcomingInvoiceInvoiceItemsTaxBehavior { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// The connected account that issues the invoice. +/// The invoice is presented with the branding and support information of the specified account. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct UpcomingInvoiceIssuer<'a> { + /// The connected account being referenced when `type` is `account`. + #[serde(skip_serializing_if = "Option::is_none")] + pub account: Option<&'a str>, + /// Type of the account referenced in the request. + #[serde(rename = "type")] + pub type_: UpcomingInvoiceIssuerType, +} +impl<'a> UpcomingInvoiceIssuer<'a> { + pub fn new(type_: UpcomingInvoiceIssuerType) -> Self { + Self { account: None, type_ } + } +} +/// Type of the account referenced in the request. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum UpcomingInvoiceIssuerType { + Account, + Self_, +} +impl UpcomingInvoiceIssuerType { + pub fn as_str(self) -> &'static str { + use UpcomingInvoiceIssuerType::*; + match self { + Account => "account", + Self_ => "self", + } + } +} + +impl std::str::FromStr for UpcomingInvoiceIssuerType { + type Err = (); + fn from_str(s: &str) -> Result { + use UpcomingInvoiceIssuerType::*; + match s { + "account" => Ok(Account), + "self" => Ok(Self_), + _ => Err(()), + } + } +} +impl std::fmt::Display for UpcomingInvoiceIssuerType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for UpcomingInvoiceIssuerType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for UpcomingInvoiceIssuerType { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// For new subscriptions, a future timestamp to anchor the subscription's [billing cycle](https://stripe.com/docs/subscriptions/billing-cycle). +/// This is used to determine the date of the first full invoice, and, for plans with `month` or `year` intervals, the day of the month for subsequent invoices. +/// For existing subscriptions, the value can only be set to `now` or `unchanged`. +#[derive(Copy, Clone, Debug, serde::Serialize)] +#[serde(untagged)] +pub enum UpcomingInvoiceSubscriptionBillingCycleAnchor { + Now, + Unchanged, + Timestamp(stripe_types::Timestamp), +} +/// A list of up to 20 subscription items, each with an attached price. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpcomingInvoiceSubscriptionItems<'a> { + /// Define thresholds at which an invoice will be sent, and the subscription advanced to a new billing period. + /// When updating, pass an empty string to remove previously-defined thresholds. + #[serde(skip_serializing_if = "Option::is_none")] + pub billing_thresholds: Option, + /// Delete all usage for a given subscription item. + /// Allowed only when `deleted` is set to `true` and the current plan's `usage_type` is `metered`. + #[serde(skip_serializing_if = "Option::is_none")] + pub clear_usage: Option, + /// A flag that, if set to `true`, will delete the specified item. + #[serde(skip_serializing_if = "Option::is_none")] + pub deleted: Option, + /// Subscription item to update. + #[serde(skip_serializing_if = "Option::is_none")] + pub id: Option<&'a str>, + /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. + /// This can be useful for storing additional information about the object in a structured format. + /// Individual keys can be unset by posting an empty value to them. + /// All keys can be unset by posting an empty value to `metadata`. + #[serde(skip_serializing_if = "Option::is_none")] + pub metadata: Option<&'a std::collections::HashMap>, + /// Plan ID for this item, as a string. + #[serde(skip_serializing_if = "Option::is_none")] + pub plan: Option<&'a str>, + /// The ID of the price object. + /// When changing a subscription item's price, `quantity` is set to 1 unless a `quantity` parameter is provided. + #[serde(skip_serializing_if = "Option::is_none")] + pub price: Option<&'a str>, + /// Data used to generate a new [Price](https://stripe.com/docs/api/prices) object inline. + #[serde(skip_serializing_if = "Option::is_none")] + pub price_data: Option>, + /// Quantity for this item. + #[serde(skip_serializing_if = "Option::is_none")] + pub quantity: Option, + /// A list of [Tax Rate](https://stripe.com/docs/api/tax_rates) ids. + /// These Tax Rates will override the [`default_tax_rates`](https://stripe.com/docs/api/subscriptions/create#create_subscription-default_tax_rates) on the Subscription. + /// When updating, pass an empty string to remove previously-defined tax rates. + #[serde(skip_serializing_if = "Option::is_none")] + pub tax_rates: Option<&'a [&'a str]>, +} +impl<'a> UpcomingInvoiceSubscriptionItems<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// Data used to generate a new [Price](https://stripe.com/docs/api/prices) object inline. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct UpcomingInvoiceSubscriptionItemsPriceData<'a> { + /// Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. + /// Must be a [supported currency](https://stripe.com/docs/currencies). + pub currency: stripe_types::Currency, + /// The ID of the product that this price will belong to. + pub product: &'a str, + /// The recurring components of a price such as `interval` and `interval_count`. + pub recurring: UpcomingInvoiceSubscriptionItemsPriceDataRecurring, + /// Only required if a [default tax behavior](https://stripe.com/docs/tax/products-prices-tax-categories-tax-behavior#setting-a-default-tax-behavior-(recommended)) was not provided in the Stripe Tax settings. + /// Specifies whether the price is considered inclusive of taxes or exclusive of taxes. + /// One of `inclusive`, `exclusive`, or `unspecified`. + /// Once specified as either `inclusive` or `exclusive`, it cannot be changed. + #[serde(skip_serializing_if = "Option::is_none")] + pub tax_behavior: Option, + /// A positive integer in cents (or local equivalent) (or 0 for a free price) representing how much to charge. + #[serde(skip_serializing_if = "Option::is_none")] + pub unit_amount: Option, + /// Same as `unit_amount`, but accepts a decimal value in cents (or local equivalent) with at most 12 decimal places. + /// Only one of `unit_amount` and `unit_amount_decimal` can be set. + #[serde(skip_serializing_if = "Option::is_none")] + pub unit_amount_decimal: Option<&'a str>, +} +impl<'a> UpcomingInvoiceSubscriptionItemsPriceData<'a> { + pub fn new( + currency: stripe_types::Currency, + product: &'a str, + recurring: UpcomingInvoiceSubscriptionItemsPriceDataRecurring, + ) -> Self { + Self { + currency, + product, + recurring, + tax_behavior: None, + unit_amount: None, + unit_amount_decimal: None, + } + } +} +/// The recurring components of a price such as `interval` and `interval_count`. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct UpcomingInvoiceSubscriptionItemsPriceDataRecurring { + /// Specifies billing frequency. Either `day`, `week`, `month` or `year`. + pub interval: UpcomingInvoiceSubscriptionItemsPriceDataRecurringInterval, + /// The number of intervals between subscription billings. + /// For example, `interval=month` and `interval_count=3` bills every 3 months. + /// Maximum of three years interval allowed (3 years, 36 months, or 156 weeks). + #[serde(skip_serializing_if = "Option::is_none")] + pub interval_count: Option, +} +impl UpcomingInvoiceSubscriptionItemsPriceDataRecurring { + pub fn new(interval: UpcomingInvoiceSubscriptionItemsPriceDataRecurringInterval) -> Self { + Self { interval, interval_count: None } + } +} +/// Specifies billing frequency. Either `day`, `week`, `month` or `year`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum UpcomingInvoiceSubscriptionItemsPriceDataRecurringInterval { + Day, + Month, + Week, + Year, +} +impl UpcomingInvoiceSubscriptionItemsPriceDataRecurringInterval { + pub fn as_str(self) -> &'static str { + use UpcomingInvoiceSubscriptionItemsPriceDataRecurringInterval::*; + match self { + Day => "day", + Month => "month", + Week => "week", + Year => "year", + } + } +} + +impl std::str::FromStr for UpcomingInvoiceSubscriptionItemsPriceDataRecurringInterval { + type Err = (); + fn from_str(s: &str) -> Result { + use UpcomingInvoiceSubscriptionItemsPriceDataRecurringInterval::*; + match s { + "day" => Ok(Day), + "month" => Ok(Month), + "week" => Ok(Week), + "year" => Ok(Year), + _ => Err(()), + } + } +} +impl std::fmt::Display for UpcomingInvoiceSubscriptionItemsPriceDataRecurringInterval { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for UpcomingInvoiceSubscriptionItemsPriceDataRecurringInterval { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for UpcomingInvoiceSubscriptionItemsPriceDataRecurringInterval { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Only required if a [default tax behavior](https://stripe.com/docs/tax/products-prices-tax-categories-tax-behavior#setting-a-default-tax-behavior-(recommended)) was not provided in the Stripe Tax settings. +/// Specifies whether the price is considered inclusive of taxes or exclusive of taxes. +/// One of `inclusive`, `exclusive`, or `unspecified`. +/// Once specified as either `inclusive` or `exclusive`, it cannot be changed. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum UpcomingInvoiceSubscriptionItemsPriceDataTaxBehavior { + Exclusive, + Inclusive, + Unspecified, +} +impl UpcomingInvoiceSubscriptionItemsPriceDataTaxBehavior { + pub fn as_str(self) -> &'static str { + use UpcomingInvoiceSubscriptionItemsPriceDataTaxBehavior::*; + match self { + Exclusive => "exclusive", + Inclusive => "inclusive", + Unspecified => "unspecified", + } + } +} + +impl std::str::FromStr for UpcomingInvoiceSubscriptionItemsPriceDataTaxBehavior { + type Err = (); + fn from_str(s: &str) -> Result { + use UpcomingInvoiceSubscriptionItemsPriceDataTaxBehavior::*; + match s { + "exclusive" => Ok(Exclusive), + "inclusive" => Ok(Inclusive), + "unspecified" => Ok(Unspecified), + _ => Err(()), + } + } +} +impl std::fmt::Display for UpcomingInvoiceSubscriptionItemsPriceDataTaxBehavior { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for UpcomingInvoiceSubscriptionItemsPriceDataTaxBehavior { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for UpcomingInvoiceSubscriptionItemsPriceDataTaxBehavior { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Determines how to handle [prorations](https://stripe.com/docs/subscriptions/billing-cycle#prorations) when the billing cycle changes (e.g., when switching plans, resetting `billing_cycle_anchor=now`, or starting a trial), or if an item's `quantity` changes. +/// The default value is `create_prorations`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum UpcomingInvoiceSubscriptionProrationBehavior { + AlwaysInvoice, + CreateProrations, + None, +} +impl UpcomingInvoiceSubscriptionProrationBehavior { + pub fn as_str(self) -> &'static str { + use UpcomingInvoiceSubscriptionProrationBehavior::*; + match self { + AlwaysInvoice => "always_invoice", + CreateProrations => "create_prorations", + None => "none", + } + } +} + +impl std::str::FromStr for UpcomingInvoiceSubscriptionProrationBehavior { + type Err = (); + fn from_str(s: &str) -> Result { + use UpcomingInvoiceSubscriptionProrationBehavior::*; + match s { + "always_invoice" => Ok(AlwaysInvoice), + "create_prorations" => Ok(CreateProrations), + "none" => Ok(None), + _ => Err(()), + } + } +} +impl std::fmt::Display for UpcomingInvoiceSubscriptionProrationBehavior { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for UpcomingInvoiceSubscriptionProrationBehavior { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for UpcomingInvoiceSubscriptionProrationBehavior { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// For paused subscriptions, setting `subscription_resume_at` to `now` will preview the invoice that will be generated if the subscription is resumed. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum UpcomingInvoiceSubscriptionResumeAt { + Now, +} +impl UpcomingInvoiceSubscriptionResumeAt { + pub fn as_str(self) -> &'static str { + use UpcomingInvoiceSubscriptionResumeAt::*; + match self { + Now => "now", + } + } +} + +impl std::str::FromStr for UpcomingInvoiceSubscriptionResumeAt { + type Err = (); + fn from_str(s: &str) -> Result { + use UpcomingInvoiceSubscriptionResumeAt::*; + match s { + "now" => Ok(Now), + _ => Err(()), + } + } +} +impl std::fmt::Display for UpcomingInvoiceSubscriptionResumeAt { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for UpcomingInvoiceSubscriptionResumeAt { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for UpcomingInvoiceSubscriptionResumeAt { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// If provided, the invoice returned will preview updating or creating a subscription with that trial end. +/// If set, one of `subscription_items` or `subscription` is required. +#[derive(Copy, Clone, Debug, serde::Serialize)] +#[serde(untagged)] +pub enum UpcomingInvoiceSubscriptionTrialEnd { + Now, + Timestamp(stripe_types::Timestamp), +} +impl<'a> UpcomingInvoice<'a> { + /// At any time, you can preview the upcoming invoice for a customer. + /// This will show you all the charges that are pending, including subscription renewal charges, invoice item charges, etc. + /// It will also show you any discounts that are applicable to the invoice. + /// + /// Note that when you are viewing an upcoming invoice, you are simply viewing a preview – the invoice has not yet been created. + /// As such, the upcoming invoice will not show up in invoice listing calls, and you cannot use the API to pay or edit the invoice. + /// If you want to change the amount that your customer will be billed, you can add, remove, or update pending invoice items, or update the customer’s discount. + /// + /// You can preview the effects of updating a subscription, including a preview of what proration will take place. + /// To ensure that the actual proration is calculated exactly the same as the previewed proration, you should pass a `proration_date` parameter when doing the actual subscription update. + /// The value passed in should be the same as the `subscription_proration_date` returned on the upcoming invoice resource. + /// The recommended way to get only the prorations being previewed is to consider only proration line items where `period[start]` is equal to the `subscription_proration_date` on the upcoming invoice resource. + pub fn send(&self, client: &stripe::Client) -> stripe::Response { + client.get_query("/invoices/upcoming", self) + } +} +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpcomingLinesInvoice<'a> { + /// Settings for automatic tax lookup for this invoice preview. + #[serde(skip_serializing_if = "Option::is_none")] + pub automatic_tax: Option>, + /// The code of the coupon to apply. + /// If `subscription` or `subscription_items` is provided, the invoice returned will preview updating or creating a subscription with that coupon. + /// Otherwise, it will preview applying that coupon to the customer for the next upcoming invoice from among the customer's subscriptions. + /// The invoice can be previewed without a coupon by passing this value as an empty string. + #[serde(skip_serializing_if = "Option::is_none")] + pub coupon: Option<&'a str>, + /// The currency to preview this invoice in. Defaults to that of `customer` if not specified. + #[serde(skip_serializing_if = "Option::is_none")] + pub currency: Option, + /// The identifier of the customer whose upcoming invoice you'd like to retrieve. + /// If `automatic_tax` is enabled then one of `customer`, `customer_details`, `subscription`, or `schedule` must be set. + #[serde(skip_serializing_if = "Option::is_none")] + pub customer: Option<&'a str>, + /// Details about the customer you want to invoice or overrides for an existing customer. + /// If `automatic_tax` is enabled then one of `customer`, `customer_details`, `subscription`, or `schedule` must be set. + #[serde(skip_serializing_if = "Option::is_none")] + pub customer_details: Option>, + /// The coupons to redeem into discounts for the invoice preview. + /// If not specified, inherits the discount from the customer or subscription. + /// This only works for coupons directly applied to the invoice. + /// To apply a coupon to a subscription, you must use the `coupon` parameter instead. + /// Pass an empty string to avoid inheriting any discounts. + /// To preview the upcoming invoice for a subscription that hasn't been created, use `coupon` instead. + #[serde(skip_serializing_if = "Option::is_none")] + pub discounts: Option<&'a [DiscountsDataParam<'a>]>, + /// A cursor for use in pagination. + /// `ending_before` is an object ID that defines your place in the list. + /// For instance, if you make a list request and receive 100 objects, starting with `obj_bar`, your subsequent call can include `ending_before=obj_bar` in order to fetch the previous page of the list. + #[serde(skip_serializing_if = "Option::is_none")] + pub ending_before: Option<&'a str>, + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, + /// List of invoice items to add or update in the upcoming invoice preview. + #[serde(skip_serializing_if = "Option::is_none")] + pub invoice_items: Option<&'a [UpcomingLinesInvoiceInvoiceItems<'a>]>, + /// The connected account that issues the invoice. + /// The invoice is presented with the branding and support information of the specified account. + #[serde(skip_serializing_if = "Option::is_none")] + pub issuer: Option>, + /// A limit on the number of objects to be returned. + /// Limit can range between 1 and 100, and the default is 10. + #[serde(skip_serializing_if = "Option::is_none")] + pub limit: Option, + /// The account (if any) for which the funds of the invoice payment are intended. + /// If set, the invoice will be presented with the branding and support information of the specified account. + /// See the [Invoices with Connect](https://stripe.com/docs/billing/invoices/connect) documentation for details. + #[serde(skip_serializing_if = "Option::is_none")] + pub on_behalf_of: Option<&'a str>, + /// The identifier of the schedule whose upcoming invoice you'd like to retrieve. + /// Cannot be used with subscription or subscription fields. + #[serde(skip_serializing_if = "Option::is_none")] + pub schedule: Option<&'a str>, + /// A cursor for use in pagination. + /// `starting_after` is an object ID that defines your place in the list. + /// For instance, if you make a list request and receive 100 objects, ending with `obj_foo`, your subsequent call can include `starting_after=obj_foo` in order to fetch the next page of the list. + #[serde(skip_serializing_if = "Option::is_none")] + pub starting_after: Option<&'a str>, + /// The identifier of the subscription for which you'd like to retrieve the upcoming invoice. + /// If not provided, but a `subscription_items` is provided, you will preview creating a subscription with those items. + /// If neither `subscription` nor `subscription_items` is provided, you will retrieve the next upcoming invoice from among the customer's subscriptions. + #[serde(skip_serializing_if = "Option::is_none")] + pub subscription: Option<&'a str>, + /// For new subscriptions, a future timestamp to anchor the subscription's [billing cycle](https://stripe.com/docs/subscriptions/billing-cycle). + /// This is used to determine the date of the first full invoice, and, for plans with `month` or `year` intervals, the day of the month for subsequent invoices. + /// For existing subscriptions, the value can only be set to `now` or `unchanged`. + #[serde(skip_serializing_if = "Option::is_none")] + pub subscription_billing_cycle_anchor: + Option, + /// A timestamp at which the subscription should cancel. + /// If set to a date before the current period ends, this will cause a proration if prorations have been enabled using `proration_behavior`. + /// If set during a future period, this will always cause a proration for that period. + #[serde(skip_serializing_if = "Option::is_none")] + pub subscription_cancel_at: Option, + /// Boolean indicating whether this subscription should cancel at the end of the current period. + #[serde(skip_serializing_if = "Option::is_none")] + pub subscription_cancel_at_period_end: Option, + /// This simulates the subscription being canceled or expired immediately. + #[serde(skip_serializing_if = "Option::is_none")] + pub subscription_cancel_now: Option, + /// If provided, the invoice returned will preview updating or creating a subscription with these default tax rates. + /// The default tax rates will apply to any line item that does not have `tax_rates` set. + #[serde(skip_serializing_if = "Option::is_none")] + pub subscription_default_tax_rates: Option<&'a [&'a str]>, + /// A list of up to 20 subscription items, each with an attached price. + #[serde(skip_serializing_if = "Option::is_none")] + pub subscription_items: Option<&'a [UpcomingLinesInvoiceSubscriptionItems<'a>]>, + /// Determines how to handle [prorations](https://stripe.com/docs/subscriptions/billing-cycle#prorations) when the billing cycle changes (e.g., when switching plans, resetting `billing_cycle_anchor=now`, or starting a trial), or if an item's `quantity` changes. + /// The default value is `create_prorations`. + #[serde(skip_serializing_if = "Option::is_none")] + pub subscription_proration_behavior: Option, + /// If previewing an update to a subscription, and doing proration, `subscription_proration_date` forces the proration to be calculated as though the update was done at the specified time. + /// The time given must be within the current subscription period and within the current phase of the schedule backing this subscription, if the schedule exists. + /// If set, `subscription`, and one of `subscription_items`, or `subscription_trial_end` are required. + /// Also, `subscription_proration_behavior` cannot be set to 'none'. + #[serde(skip_serializing_if = "Option::is_none")] + pub subscription_proration_date: Option, + /// For paused subscriptions, setting `subscription_resume_at` to `now` will preview the invoice that will be generated if the subscription is resumed. + #[serde(skip_serializing_if = "Option::is_none")] + pub subscription_resume_at: Option, + /// Date a subscription is intended to start (can be future or past). + #[serde(skip_serializing_if = "Option::is_none")] + pub subscription_start_date: Option, + /// If provided, the invoice returned will preview updating or creating a subscription with that trial end. + /// If set, one of `subscription_items` or `subscription` is required. + #[serde(skip_serializing_if = "Option::is_none")] + pub subscription_trial_end: Option, + /// Indicates if a plan's `trial_period_days` should be applied to the subscription. + /// Setting `subscription_trial_end` per subscription is preferred, and this defaults to `false`. + /// Setting this flag to `true` together with `subscription_trial_end` is not allowed. + /// See [Using trial periods on subscriptions](https://stripe.com/docs/billing/subscriptions/trials) to learn more. + #[serde(skip_serializing_if = "Option::is_none")] + pub subscription_trial_from_plan: Option, +} +impl<'a> UpcomingLinesInvoice<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// Settings for automatic tax lookup for this invoice preview. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct UpcomingLinesInvoiceAutomaticTax<'a> { + /// Whether Stripe automatically computes tax on this invoice. + /// Note that incompatible invoice items (invoice items with manually specified [tax rates](https://stripe.com/docs/api/tax_rates), negative amounts, or `tax_behavior=unspecified`) cannot be added to automatic tax invoices. + pub enabled: bool, + /// The account that's liable for tax. + /// If set, the business address and tax registrations required to perform the tax calculation are loaded from this account. + /// The tax transaction is returned in the report of the connected account. + #[serde(skip_serializing_if = "Option::is_none")] + pub liability: Option>, +} +impl<'a> UpcomingLinesInvoiceAutomaticTax<'a> { + pub fn new(enabled: bool) -> Self { + Self { enabled, liability: None } + } +} +/// The account that's liable for tax. +/// If set, the business address and tax registrations required to perform the tax calculation are loaded from this account. +/// The tax transaction is returned in the report of the connected account. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct UpcomingLinesInvoiceAutomaticTaxLiability<'a> { + /// The connected account being referenced when `type` is `account`. + #[serde(skip_serializing_if = "Option::is_none")] + pub account: Option<&'a str>, + /// Type of the account referenced in the request. + #[serde(rename = "type")] + pub type_: UpcomingLinesInvoiceAutomaticTaxLiabilityType, +} +impl<'a> UpcomingLinesInvoiceAutomaticTaxLiability<'a> { + pub fn new(type_: UpcomingLinesInvoiceAutomaticTaxLiabilityType) -> Self { + Self { account: None, type_ } + } +} +/// Type of the account referenced in the request. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum UpcomingLinesInvoiceAutomaticTaxLiabilityType { + Account, + Self_, +} +impl UpcomingLinesInvoiceAutomaticTaxLiabilityType { + pub fn as_str(self) -> &'static str { + use UpcomingLinesInvoiceAutomaticTaxLiabilityType::*; + match self { + Account => "account", + Self_ => "self", + } + } +} + +impl std::str::FromStr for UpcomingLinesInvoiceAutomaticTaxLiabilityType { + type Err = (); + fn from_str(s: &str) -> Result { + use UpcomingLinesInvoiceAutomaticTaxLiabilityType::*; + match s { + "account" => Ok(Account), + "self" => Ok(Self_), + _ => Err(()), + } + } +} +impl std::fmt::Display for UpcomingLinesInvoiceAutomaticTaxLiabilityType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for UpcomingLinesInvoiceAutomaticTaxLiabilityType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for UpcomingLinesInvoiceAutomaticTaxLiabilityType { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Details about the customer you want to invoice or overrides for an existing customer. +/// If `automatic_tax` is enabled then one of `customer`, `customer_details`, `subscription`, or `schedule` must be set. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpcomingLinesInvoiceCustomerDetails<'a> { + /// The customer's address. + #[serde(skip_serializing_if = "Option::is_none")] + pub address: Option>, + /// The customer's shipping information. Appears on invoices emailed to this customer. + #[serde(skip_serializing_if = "Option::is_none")] + pub shipping: Option>, + /// Tax details about the customer. + #[serde(skip_serializing_if = "Option::is_none")] + pub tax: Option>, + /// The customer's tax exemption. One of `none`, `exempt`, or `reverse`. + #[serde(skip_serializing_if = "Option::is_none")] + pub tax_exempt: Option, + /// The customer's tax IDs. + #[serde(skip_serializing_if = "Option::is_none")] + pub tax_ids: Option<&'a [UpcomingLinesInvoiceCustomerDetailsTaxIds<'a>]>, +} +impl<'a> UpcomingLinesInvoiceCustomerDetails<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// The customer's tax exemption. One of `none`, `exempt`, or `reverse`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum UpcomingLinesInvoiceCustomerDetailsTaxExempt { + Exempt, + None, + Reverse, +} +impl UpcomingLinesInvoiceCustomerDetailsTaxExempt { + pub fn as_str(self) -> &'static str { + use UpcomingLinesInvoiceCustomerDetailsTaxExempt::*; + match self { + Exempt => "exempt", + None => "none", + Reverse => "reverse", + } + } +} + +impl std::str::FromStr for UpcomingLinesInvoiceCustomerDetailsTaxExempt { + type Err = (); + fn from_str(s: &str) -> Result { + use UpcomingLinesInvoiceCustomerDetailsTaxExempt::*; + match s { + "exempt" => Ok(Exempt), + "none" => Ok(None), + "reverse" => Ok(Reverse), + _ => Err(()), + } + } +} +impl std::fmt::Display for UpcomingLinesInvoiceCustomerDetailsTaxExempt { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for UpcomingLinesInvoiceCustomerDetailsTaxExempt { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for UpcomingLinesInvoiceCustomerDetailsTaxExempt { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// The customer's tax IDs. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct UpcomingLinesInvoiceCustomerDetailsTaxIds<'a> { + /// Type of the tax ID, one of `ad_nrt`, `ae_trn`, `ar_cuit`, `au_abn`, `au_arn`, `bg_uic`, `bo_tin`, `br_cnpj`, `br_cpf`, `ca_bn`, `ca_gst_hst`, `ca_pst_bc`, `ca_pst_mb`, `ca_pst_sk`, `ca_qst`, `ch_vat`, `cl_tin`, `cn_tin`, `co_nit`, `cr_tin`, `do_rcn`, `ec_ruc`, `eg_tin`, `es_cif`, `eu_oss_vat`, `eu_vat`, `gb_vat`, `ge_vat`, `hk_br`, `hu_tin`, `id_npwp`, `il_vat`, `in_gst`, `is_vat`, `jp_cn`, `jp_rn`, `jp_trn`, `ke_pin`, `kr_brn`, `li_uid`, `mx_rfc`, `my_frp`, `my_itn`, `my_sst`, `no_vat`, `nz_gst`, `pe_ruc`, `ph_tin`, `ro_tin`, `rs_pib`, `ru_inn`, `ru_kpp`, `sa_vat`, `sg_gst`, `sg_uen`, `si_tin`, `sv_nit`, `th_vat`, `tr_tin`, `tw_vat`, `ua_vat`, `us_ein`, `uy_ruc`, `ve_rif`, `vn_tin`, or `za_vat`. + #[serde(rename = "type")] + pub type_: UpcomingLinesInvoiceCustomerDetailsTaxIdsType, + /// Value of the tax ID. + pub value: &'a str, +} +impl<'a> UpcomingLinesInvoiceCustomerDetailsTaxIds<'a> { + pub fn new(type_: UpcomingLinesInvoiceCustomerDetailsTaxIdsType, value: &'a str) -> Self { + Self { type_, value } + } +} +/// Type of the tax ID, one of `ad_nrt`, `ae_trn`, `ar_cuit`, `au_abn`, `au_arn`, `bg_uic`, `bo_tin`, `br_cnpj`, `br_cpf`, `ca_bn`, `ca_gst_hst`, `ca_pst_bc`, `ca_pst_mb`, `ca_pst_sk`, `ca_qst`, `ch_vat`, `cl_tin`, `cn_tin`, `co_nit`, `cr_tin`, `do_rcn`, `ec_ruc`, `eg_tin`, `es_cif`, `eu_oss_vat`, `eu_vat`, `gb_vat`, `ge_vat`, `hk_br`, `hu_tin`, `id_npwp`, `il_vat`, `in_gst`, `is_vat`, `jp_cn`, `jp_rn`, `jp_trn`, `ke_pin`, `kr_brn`, `li_uid`, `mx_rfc`, `my_frp`, `my_itn`, `my_sst`, `no_vat`, `nz_gst`, `pe_ruc`, `ph_tin`, `ro_tin`, `rs_pib`, `ru_inn`, `ru_kpp`, `sa_vat`, `sg_gst`, `sg_uen`, `si_tin`, `sv_nit`, `th_vat`, `tr_tin`, `tw_vat`, `ua_vat`, `us_ein`, `uy_ruc`, `ve_rif`, `vn_tin`, or `za_vat`. +#[derive(Copy, Clone, Eq, PartialEq)] +#[non_exhaustive] +pub enum UpcomingLinesInvoiceCustomerDetailsTaxIdsType { + AdNrt, + AeTrn, + ArCuit, + AuAbn, + AuArn, + BgUic, + BoTin, + BrCnpj, + BrCpf, + CaBn, + CaGstHst, + CaPstBc, + CaPstMb, + CaPstSk, + CaQst, + ChVat, + ClTin, + CnTin, + CoNit, + CrTin, + DoRcn, + EcRuc, + EgTin, + EsCif, + EuOssVat, + EuVat, + GbVat, + GeVat, + HkBr, + HuTin, + IdNpwp, + IlVat, + InGst, + IsVat, + JpCn, + JpRn, + JpTrn, + KePin, + KrBrn, + LiUid, + MxRfc, + MyFrp, + MyItn, + MySst, + NoVat, + NzGst, + PeRuc, + PhTin, + RoTin, + RsPib, + RuInn, + RuKpp, + SaVat, + SgGst, + SgUen, + SiTin, + SvNit, + ThVat, + TrTin, + TwVat, + UaVat, + UsEin, + UyRuc, + VeRif, + VnTin, + ZaVat, + /// An unrecognized value from Stripe. Should not be used as a request parameter. + Unknown, +} +impl UpcomingLinesInvoiceCustomerDetailsTaxIdsType { + pub fn as_str(self) -> &'static str { + use UpcomingLinesInvoiceCustomerDetailsTaxIdsType::*; + match self { + AdNrt => "ad_nrt", + AeTrn => "ae_trn", + ArCuit => "ar_cuit", + AuAbn => "au_abn", + AuArn => "au_arn", + BgUic => "bg_uic", + BoTin => "bo_tin", + BrCnpj => "br_cnpj", + BrCpf => "br_cpf", + CaBn => "ca_bn", + CaGstHst => "ca_gst_hst", + CaPstBc => "ca_pst_bc", + CaPstMb => "ca_pst_mb", + CaPstSk => "ca_pst_sk", + CaQst => "ca_qst", + ChVat => "ch_vat", + ClTin => "cl_tin", + CnTin => "cn_tin", + CoNit => "co_nit", + CrTin => "cr_tin", + DoRcn => "do_rcn", + EcRuc => "ec_ruc", + EgTin => "eg_tin", + EsCif => "es_cif", + EuOssVat => "eu_oss_vat", + EuVat => "eu_vat", + GbVat => "gb_vat", + GeVat => "ge_vat", + HkBr => "hk_br", + HuTin => "hu_tin", + IdNpwp => "id_npwp", + IlVat => "il_vat", + InGst => "in_gst", + IsVat => "is_vat", + JpCn => "jp_cn", + JpRn => "jp_rn", + JpTrn => "jp_trn", + KePin => "ke_pin", + KrBrn => "kr_brn", + LiUid => "li_uid", + MxRfc => "mx_rfc", + MyFrp => "my_frp", + MyItn => "my_itn", + MySst => "my_sst", + NoVat => "no_vat", + NzGst => "nz_gst", + PeRuc => "pe_ruc", + PhTin => "ph_tin", + RoTin => "ro_tin", + RsPib => "rs_pib", + RuInn => "ru_inn", + RuKpp => "ru_kpp", + SaVat => "sa_vat", + SgGst => "sg_gst", + SgUen => "sg_uen", + SiTin => "si_tin", + SvNit => "sv_nit", + ThVat => "th_vat", + TrTin => "tr_tin", + TwVat => "tw_vat", + UaVat => "ua_vat", + UsEin => "us_ein", + UyRuc => "uy_ruc", + VeRif => "ve_rif", + VnTin => "vn_tin", + ZaVat => "za_vat", + Unknown => "unknown", + } + } +} + +impl std::str::FromStr for UpcomingLinesInvoiceCustomerDetailsTaxIdsType { + type Err = (); + fn from_str(s: &str) -> Result { + use UpcomingLinesInvoiceCustomerDetailsTaxIdsType::*; + match s { + "ad_nrt" => Ok(AdNrt), + "ae_trn" => Ok(AeTrn), + "ar_cuit" => Ok(ArCuit), + "au_abn" => Ok(AuAbn), + "au_arn" => Ok(AuArn), + "bg_uic" => Ok(BgUic), + "bo_tin" => Ok(BoTin), + "br_cnpj" => Ok(BrCnpj), + "br_cpf" => Ok(BrCpf), + "ca_bn" => Ok(CaBn), + "ca_gst_hst" => Ok(CaGstHst), + "ca_pst_bc" => Ok(CaPstBc), + "ca_pst_mb" => Ok(CaPstMb), + "ca_pst_sk" => Ok(CaPstSk), + "ca_qst" => Ok(CaQst), + "ch_vat" => Ok(ChVat), + "cl_tin" => Ok(ClTin), + "cn_tin" => Ok(CnTin), + "co_nit" => Ok(CoNit), + "cr_tin" => Ok(CrTin), + "do_rcn" => Ok(DoRcn), + "ec_ruc" => Ok(EcRuc), + "eg_tin" => Ok(EgTin), + "es_cif" => Ok(EsCif), + "eu_oss_vat" => Ok(EuOssVat), + "eu_vat" => Ok(EuVat), + "gb_vat" => Ok(GbVat), + "ge_vat" => Ok(GeVat), + "hk_br" => Ok(HkBr), + "hu_tin" => Ok(HuTin), + "id_npwp" => Ok(IdNpwp), + "il_vat" => Ok(IlVat), + "in_gst" => Ok(InGst), + "is_vat" => Ok(IsVat), + "jp_cn" => Ok(JpCn), + "jp_rn" => Ok(JpRn), + "jp_trn" => Ok(JpTrn), + "ke_pin" => Ok(KePin), + "kr_brn" => Ok(KrBrn), + "li_uid" => Ok(LiUid), + "mx_rfc" => Ok(MxRfc), + "my_frp" => Ok(MyFrp), + "my_itn" => Ok(MyItn), + "my_sst" => Ok(MySst), + "no_vat" => Ok(NoVat), + "nz_gst" => Ok(NzGst), + "pe_ruc" => Ok(PeRuc), + "ph_tin" => Ok(PhTin), + "ro_tin" => Ok(RoTin), + "rs_pib" => Ok(RsPib), + "ru_inn" => Ok(RuInn), + "ru_kpp" => Ok(RuKpp), + "sa_vat" => Ok(SaVat), + "sg_gst" => Ok(SgGst), + "sg_uen" => Ok(SgUen), + "si_tin" => Ok(SiTin), + "sv_nit" => Ok(SvNit), + "th_vat" => Ok(ThVat), + "tr_tin" => Ok(TrTin), + "tw_vat" => Ok(TwVat), + "ua_vat" => Ok(UaVat), + "us_ein" => Ok(UsEin), + "uy_ruc" => Ok(UyRuc), + "ve_rif" => Ok(VeRif), + "vn_tin" => Ok(VnTin), + "za_vat" => Ok(ZaVat), + _ => Err(()), + } + } +} +impl std::fmt::Display for UpcomingLinesInvoiceCustomerDetailsTaxIdsType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for UpcomingLinesInvoiceCustomerDetailsTaxIdsType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for UpcomingLinesInvoiceCustomerDetailsTaxIdsType { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// List of invoice items to add or update in the upcoming invoice preview. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpcomingLinesInvoiceInvoiceItems<'a> { + /// The integer amount in cents (or local equivalent) of previewed invoice item. + #[serde(skip_serializing_if = "Option::is_none")] + pub amount: Option, + /// Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. + /// Must be a [supported currency](https://stripe.com/docs/currencies). + /// Only applicable to new invoice items. + #[serde(skip_serializing_if = "Option::is_none")] + pub currency: Option, + /// An arbitrary string which you can attach to the invoice item. + /// The description is displayed in the invoice for easy tracking. + #[serde(skip_serializing_if = "Option::is_none")] + pub description: Option<&'a str>, + /// Explicitly controls whether discounts apply to this invoice item. + /// Defaults to true, except for negative invoice items. + #[serde(skip_serializing_if = "Option::is_none")] + pub discountable: Option, + /// The coupons to redeem into discounts for the invoice item in the preview. + #[serde(skip_serializing_if = "Option::is_none")] + pub discounts: Option<&'a [DiscountsDataParam<'a>]>, + /// The ID of the invoice item to update in preview. + /// If not specified, a new invoice item will be added to the preview of the upcoming invoice. + #[serde(skip_serializing_if = "Option::is_none")] + pub invoiceitem: Option<&'a str>, + /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. + /// This can be useful for storing additional information about the object in a structured format. + /// Individual keys can be unset by posting an empty value to them. + /// All keys can be unset by posting an empty value to `metadata`. + #[serde(skip_serializing_if = "Option::is_none")] + pub metadata: Option<&'a std::collections::HashMap>, + /// The period associated with this invoice item. + /// When set to different values, the period will be rendered on the invoice. + /// If you have [Stripe Revenue Recognition](https://stripe.com/docs/revenue-recognition) enabled, the period will be used to recognize and defer revenue. + /// See the [Revenue Recognition documentation](https://stripe.com/docs/revenue-recognition/methodology/subscriptions-and-invoicing) for details. + #[serde(skip_serializing_if = "Option::is_none")] + pub period: Option, + /// The ID of the price object. + #[serde(skip_serializing_if = "Option::is_none")] + pub price: Option<&'a str>, + /// Data used to generate a new [Price](https://stripe.com/docs/api/prices) object inline. + #[serde(skip_serializing_if = "Option::is_none")] + pub price_data: Option>, + /// Non-negative integer. The quantity of units for the invoice item. + #[serde(skip_serializing_if = "Option::is_none")] + pub quantity: Option, + /// Only required if a [default tax behavior](https://stripe.com/docs/tax/products-prices-tax-categories-tax-behavior#setting-a-default-tax-behavior-(recommended)) was not provided in the Stripe Tax settings. + /// Specifies whether the price is considered inclusive of taxes or exclusive of taxes. + /// One of `inclusive`, `exclusive`, or `unspecified`. + /// Once specified as either `inclusive` or `exclusive`, it cannot be changed. + #[serde(skip_serializing_if = "Option::is_none")] + pub tax_behavior: Option, + /// A [tax code](https://stripe.com/docs/tax/tax-categories) ID. + #[serde(skip_serializing_if = "Option::is_none")] + pub tax_code: Option<&'a str>, + /// The tax rates that apply to the item. When set, any `default_tax_rates` do not apply to this item. + #[serde(skip_serializing_if = "Option::is_none")] + pub tax_rates: Option<&'a [&'a str]>, + /// The integer unit amount in cents (or local equivalent) of the charge to be applied to the upcoming invoice. + /// This unit_amount will be multiplied by the quantity to get the full amount. + /// If you want to apply a credit to the customer's account, pass a negative unit_amount. + #[serde(skip_serializing_if = "Option::is_none")] + pub unit_amount: Option, + /// Same as `unit_amount`, but accepts a decimal value in cents (or local equivalent) with at most 12 decimal places. + /// Only one of `unit_amount` and `unit_amount_decimal` can be set. + #[serde(skip_serializing_if = "Option::is_none")] + pub unit_amount_decimal: Option<&'a str>, +} +impl<'a> UpcomingLinesInvoiceInvoiceItems<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// Data used to generate a new [Price](https://stripe.com/docs/api/prices) object inline. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct UpcomingLinesInvoiceInvoiceItemsPriceData<'a> { + /// Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. + /// Must be a [supported currency](https://stripe.com/docs/currencies). + pub currency: stripe_types::Currency, + /// The ID of the product that this price will belong to. + pub product: &'a str, + /// Only required if a [default tax behavior](https://stripe.com/docs/tax/products-prices-tax-categories-tax-behavior#setting-a-default-tax-behavior-(recommended)) was not provided in the Stripe Tax settings. + /// Specifies whether the price is considered inclusive of taxes or exclusive of taxes. + /// One of `inclusive`, `exclusive`, or `unspecified`. + /// Once specified as either `inclusive` or `exclusive`, it cannot be changed. + #[serde(skip_serializing_if = "Option::is_none")] + pub tax_behavior: Option, + /// A positive integer in cents (or local equivalent) (or 0 for a free price) representing how much to charge. + #[serde(skip_serializing_if = "Option::is_none")] + pub unit_amount: Option, + /// Same as `unit_amount`, but accepts a decimal value in cents (or local equivalent) with at most 12 decimal places. + /// Only one of `unit_amount` and `unit_amount_decimal` can be set. + #[serde(skip_serializing_if = "Option::is_none")] + pub unit_amount_decimal: Option<&'a str>, +} +impl<'a> UpcomingLinesInvoiceInvoiceItemsPriceData<'a> { + pub fn new(currency: stripe_types::Currency, product: &'a str) -> Self { + Self { currency, product, tax_behavior: None, unit_amount: None, unit_amount_decimal: None } + } +} +/// Only required if a [default tax behavior](https://stripe.com/docs/tax/products-prices-tax-categories-tax-behavior#setting-a-default-tax-behavior-(recommended)) was not provided in the Stripe Tax settings. +/// Specifies whether the price is considered inclusive of taxes or exclusive of taxes. +/// One of `inclusive`, `exclusive`, or `unspecified`. +/// Once specified as either `inclusive` or `exclusive`, it cannot be changed. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum UpcomingLinesInvoiceInvoiceItemsPriceDataTaxBehavior { + Exclusive, + Inclusive, + Unspecified, +} +impl UpcomingLinesInvoiceInvoiceItemsPriceDataTaxBehavior { + pub fn as_str(self) -> &'static str { + use UpcomingLinesInvoiceInvoiceItemsPriceDataTaxBehavior::*; + match self { + Exclusive => "exclusive", + Inclusive => "inclusive", + Unspecified => "unspecified", + } + } +} + +impl std::str::FromStr for UpcomingLinesInvoiceInvoiceItemsPriceDataTaxBehavior { + type Err = (); + fn from_str(s: &str) -> Result { + use UpcomingLinesInvoiceInvoiceItemsPriceDataTaxBehavior::*; + match s { + "exclusive" => Ok(Exclusive), + "inclusive" => Ok(Inclusive), + "unspecified" => Ok(Unspecified), + _ => Err(()), + } + } +} +impl std::fmt::Display for UpcomingLinesInvoiceInvoiceItemsPriceDataTaxBehavior { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for UpcomingLinesInvoiceInvoiceItemsPriceDataTaxBehavior { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for UpcomingLinesInvoiceInvoiceItemsPriceDataTaxBehavior { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Only required if a [default tax behavior](https://stripe.com/docs/tax/products-prices-tax-categories-tax-behavior#setting-a-default-tax-behavior-(recommended)) was not provided in the Stripe Tax settings. +/// Specifies whether the price is considered inclusive of taxes or exclusive of taxes. +/// One of `inclusive`, `exclusive`, or `unspecified`. +/// Once specified as either `inclusive` or `exclusive`, it cannot be changed. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum UpcomingLinesInvoiceInvoiceItemsTaxBehavior { + Exclusive, + Inclusive, + Unspecified, +} +impl UpcomingLinesInvoiceInvoiceItemsTaxBehavior { + pub fn as_str(self) -> &'static str { + use UpcomingLinesInvoiceInvoiceItemsTaxBehavior::*; + match self { + Exclusive => "exclusive", + Inclusive => "inclusive", + Unspecified => "unspecified", + } + } +} + +impl std::str::FromStr for UpcomingLinesInvoiceInvoiceItemsTaxBehavior { + type Err = (); + fn from_str(s: &str) -> Result { + use UpcomingLinesInvoiceInvoiceItemsTaxBehavior::*; + match s { + "exclusive" => Ok(Exclusive), + "inclusive" => Ok(Inclusive), + "unspecified" => Ok(Unspecified), + _ => Err(()), + } + } +} +impl std::fmt::Display for UpcomingLinesInvoiceInvoiceItemsTaxBehavior { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for UpcomingLinesInvoiceInvoiceItemsTaxBehavior { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for UpcomingLinesInvoiceInvoiceItemsTaxBehavior { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// The connected account that issues the invoice. +/// The invoice is presented with the branding and support information of the specified account. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct UpcomingLinesInvoiceIssuer<'a> { + /// The connected account being referenced when `type` is `account`. + #[serde(skip_serializing_if = "Option::is_none")] + pub account: Option<&'a str>, + /// Type of the account referenced in the request. + #[serde(rename = "type")] + pub type_: UpcomingLinesInvoiceIssuerType, +} +impl<'a> UpcomingLinesInvoiceIssuer<'a> { + pub fn new(type_: UpcomingLinesInvoiceIssuerType) -> Self { + Self { account: None, type_ } + } +} +/// Type of the account referenced in the request. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum UpcomingLinesInvoiceIssuerType { + Account, + Self_, +} +impl UpcomingLinesInvoiceIssuerType { + pub fn as_str(self) -> &'static str { + use UpcomingLinesInvoiceIssuerType::*; + match self { + Account => "account", + Self_ => "self", + } + } +} + +impl std::str::FromStr for UpcomingLinesInvoiceIssuerType { + type Err = (); + fn from_str(s: &str) -> Result { + use UpcomingLinesInvoiceIssuerType::*; + match s { + "account" => Ok(Account), + "self" => Ok(Self_), + _ => Err(()), + } + } +} +impl std::fmt::Display for UpcomingLinesInvoiceIssuerType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for UpcomingLinesInvoiceIssuerType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for UpcomingLinesInvoiceIssuerType { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// For new subscriptions, a future timestamp to anchor the subscription's [billing cycle](https://stripe.com/docs/subscriptions/billing-cycle). +/// This is used to determine the date of the first full invoice, and, for plans with `month` or `year` intervals, the day of the month for subsequent invoices. +/// For existing subscriptions, the value can only be set to `now` or `unchanged`. +#[derive(Copy, Clone, Debug, serde::Serialize)] +#[serde(untagged)] +pub enum UpcomingLinesInvoiceSubscriptionBillingCycleAnchor { + Now, + Unchanged, + Timestamp(stripe_types::Timestamp), +} +/// A list of up to 20 subscription items, each with an attached price. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpcomingLinesInvoiceSubscriptionItems<'a> { + /// Define thresholds at which an invoice will be sent, and the subscription advanced to a new billing period. + /// When updating, pass an empty string to remove previously-defined thresholds. + #[serde(skip_serializing_if = "Option::is_none")] + pub billing_thresholds: Option, + /// Delete all usage for a given subscription item. + /// Allowed only when `deleted` is set to `true` and the current plan's `usage_type` is `metered`. + #[serde(skip_serializing_if = "Option::is_none")] + pub clear_usage: Option, + /// A flag that, if set to `true`, will delete the specified item. + #[serde(skip_serializing_if = "Option::is_none")] + pub deleted: Option, + /// Subscription item to update. + #[serde(skip_serializing_if = "Option::is_none")] + pub id: Option<&'a str>, + /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. + /// This can be useful for storing additional information about the object in a structured format. + /// Individual keys can be unset by posting an empty value to them. + /// All keys can be unset by posting an empty value to `metadata`. + #[serde(skip_serializing_if = "Option::is_none")] + pub metadata: Option<&'a std::collections::HashMap>, + /// Plan ID for this item, as a string. + #[serde(skip_serializing_if = "Option::is_none")] + pub plan: Option<&'a str>, + /// The ID of the price object. + /// When changing a subscription item's price, `quantity` is set to 1 unless a `quantity` parameter is provided. + #[serde(skip_serializing_if = "Option::is_none")] + pub price: Option<&'a str>, + /// Data used to generate a new [Price](https://stripe.com/docs/api/prices) object inline. + #[serde(skip_serializing_if = "Option::is_none")] + pub price_data: Option>, + /// Quantity for this item. + #[serde(skip_serializing_if = "Option::is_none")] + pub quantity: Option, + /// A list of [Tax Rate](https://stripe.com/docs/api/tax_rates) ids. + /// These Tax Rates will override the [`default_tax_rates`](https://stripe.com/docs/api/subscriptions/create#create_subscription-default_tax_rates) on the Subscription. + /// When updating, pass an empty string to remove previously-defined tax rates. + #[serde(skip_serializing_if = "Option::is_none")] + pub tax_rates: Option<&'a [&'a str]>, +} +impl<'a> UpcomingLinesInvoiceSubscriptionItems<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// Data used to generate a new [Price](https://stripe.com/docs/api/prices) object inline. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct UpcomingLinesInvoiceSubscriptionItemsPriceData<'a> { + /// Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. + /// Must be a [supported currency](https://stripe.com/docs/currencies). + pub currency: stripe_types::Currency, + /// The ID of the product that this price will belong to. + pub product: &'a str, + /// The recurring components of a price such as `interval` and `interval_count`. + pub recurring: UpcomingLinesInvoiceSubscriptionItemsPriceDataRecurring, + /// Only required if a [default tax behavior](https://stripe.com/docs/tax/products-prices-tax-categories-tax-behavior#setting-a-default-tax-behavior-(recommended)) was not provided in the Stripe Tax settings. + /// Specifies whether the price is considered inclusive of taxes or exclusive of taxes. + /// One of `inclusive`, `exclusive`, or `unspecified`. + /// Once specified as either `inclusive` or `exclusive`, it cannot be changed. + #[serde(skip_serializing_if = "Option::is_none")] + pub tax_behavior: Option, + /// A positive integer in cents (or local equivalent) (or 0 for a free price) representing how much to charge. + #[serde(skip_serializing_if = "Option::is_none")] + pub unit_amount: Option, + /// Same as `unit_amount`, but accepts a decimal value in cents (or local equivalent) with at most 12 decimal places. + /// Only one of `unit_amount` and `unit_amount_decimal` can be set. + #[serde(skip_serializing_if = "Option::is_none")] + pub unit_amount_decimal: Option<&'a str>, +} +impl<'a> UpcomingLinesInvoiceSubscriptionItemsPriceData<'a> { + pub fn new( + currency: stripe_types::Currency, + product: &'a str, + recurring: UpcomingLinesInvoiceSubscriptionItemsPriceDataRecurring, + ) -> Self { + Self { + currency, + product, + recurring, + tax_behavior: None, + unit_amount: None, + unit_amount_decimal: None, + } + } +} +/// The recurring components of a price such as `interval` and `interval_count`. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct UpcomingLinesInvoiceSubscriptionItemsPriceDataRecurring { + /// Specifies billing frequency. Either `day`, `week`, `month` or `year`. + pub interval: UpcomingLinesInvoiceSubscriptionItemsPriceDataRecurringInterval, + /// The number of intervals between subscription billings. + /// For example, `interval=month` and `interval_count=3` bills every 3 months. + /// Maximum of three years interval allowed (3 years, 36 months, or 156 weeks). + #[serde(skip_serializing_if = "Option::is_none")] + pub interval_count: Option, +} +impl UpcomingLinesInvoiceSubscriptionItemsPriceDataRecurring { + pub fn new(interval: UpcomingLinesInvoiceSubscriptionItemsPriceDataRecurringInterval) -> Self { + Self { interval, interval_count: None } + } +} +/// Specifies billing frequency. Either `day`, `week`, `month` or `year`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum UpcomingLinesInvoiceSubscriptionItemsPriceDataRecurringInterval { + Day, + Month, + Week, + Year, +} +impl UpcomingLinesInvoiceSubscriptionItemsPriceDataRecurringInterval { + pub fn as_str(self) -> &'static str { + use UpcomingLinesInvoiceSubscriptionItemsPriceDataRecurringInterval::*; + match self { + Day => "day", + Month => "month", + Week => "week", + Year => "year", + } + } +} + +impl std::str::FromStr for UpcomingLinesInvoiceSubscriptionItemsPriceDataRecurringInterval { + type Err = (); + fn from_str(s: &str) -> Result { + use UpcomingLinesInvoiceSubscriptionItemsPriceDataRecurringInterval::*; + match s { + "day" => Ok(Day), + "month" => Ok(Month), + "week" => Ok(Week), + "year" => Ok(Year), + _ => Err(()), + } + } +} +impl std::fmt::Display for UpcomingLinesInvoiceSubscriptionItemsPriceDataRecurringInterval { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for UpcomingLinesInvoiceSubscriptionItemsPriceDataRecurringInterval { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for UpcomingLinesInvoiceSubscriptionItemsPriceDataRecurringInterval { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Only required if a [default tax behavior](https://stripe.com/docs/tax/products-prices-tax-categories-tax-behavior#setting-a-default-tax-behavior-(recommended)) was not provided in the Stripe Tax settings. +/// Specifies whether the price is considered inclusive of taxes or exclusive of taxes. +/// One of `inclusive`, `exclusive`, or `unspecified`. +/// Once specified as either `inclusive` or `exclusive`, it cannot be changed. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum UpcomingLinesInvoiceSubscriptionItemsPriceDataTaxBehavior { + Exclusive, + Inclusive, + Unspecified, +} +impl UpcomingLinesInvoiceSubscriptionItemsPriceDataTaxBehavior { + pub fn as_str(self) -> &'static str { + use UpcomingLinesInvoiceSubscriptionItemsPriceDataTaxBehavior::*; + match self { + Exclusive => "exclusive", + Inclusive => "inclusive", + Unspecified => "unspecified", + } + } +} + +impl std::str::FromStr for UpcomingLinesInvoiceSubscriptionItemsPriceDataTaxBehavior { + type Err = (); + fn from_str(s: &str) -> Result { + use UpcomingLinesInvoiceSubscriptionItemsPriceDataTaxBehavior::*; + match s { + "exclusive" => Ok(Exclusive), + "inclusive" => Ok(Inclusive), + "unspecified" => Ok(Unspecified), + _ => Err(()), + } + } +} +impl std::fmt::Display for UpcomingLinesInvoiceSubscriptionItemsPriceDataTaxBehavior { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for UpcomingLinesInvoiceSubscriptionItemsPriceDataTaxBehavior { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for UpcomingLinesInvoiceSubscriptionItemsPriceDataTaxBehavior { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Determines how to handle [prorations](https://stripe.com/docs/subscriptions/billing-cycle#prorations) when the billing cycle changes (e.g., when switching plans, resetting `billing_cycle_anchor=now`, or starting a trial), or if an item's `quantity` changes. +/// The default value is `create_prorations`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum UpcomingLinesInvoiceSubscriptionProrationBehavior { + AlwaysInvoice, + CreateProrations, + None, +} +impl UpcomingLinesInvoiceSubscriptionProrationBehavior { + pub fn as_str(self) -> &'static str { + use UpcomingLinesInvoiceSubscriptionProrationBehavior::*; + match self { + AlwaysInvoice => "always_invoice", + CreateProrations => "create_prorations", + None => "none", + } + } +} + +impl std::str::FromStr for UpcomingLinesInvoiceSubscriptionProrationBehavior { + type Err = (); + fn from_str(s: &str) -> Result { + use UpcomingLinesInvoiceSubscriptionProrationBehavior::*; + match s { + "always_invoice" => Ok(AlwaysInvoice), + "create_prorations" => Ok(CreateProrations), + "none" => Ok(None), + _ => Err(()), + } + } +} +impl std::fmt::Display for UpcomingLinesInvoiceSubscriptionProrationBehavior { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for UpcomingLinesInvoiceSubscriptionProrationBehavior { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for UpcomingLinesInvoiceSubscriptionProrationBehavior { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// For paused subscriptions, setting `subscription_resume_at` to `now` will preview the invoice that will be generated if the subscription is resumed. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum UpcomingLinesInvoiceSubscriptionResumeAt { + Now, +} +impl UpcomingLinesInvoiceSubscriptionResumeAt { + pub fn as_str(self) -> &'static str { + use UpcomingLinesInvoiceSubscriptionResumeAt::*; + match self { + Now => "now", + } + } +} + +impl std::str::FromStr for UpcomingLinesInvoiceSubscriptionResumeAt { + type Err = (); + fn from_str(s: &str) -> Result { + use UpcomingLinesInvoiceSubscriptionResumeAt::*; + match s { + "now" => Ok(Now), + _ => Err(()), + } + } +} +impl std::fmt::Display for UpcomingLinesInvoiceSubscriptionResumeAt { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for UpcomingLinesInvoiceSubscriptionResumeAt { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for UpcomingLinesInvoiceSubscriptionResumeAt { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// If provided, the invoice returned will preview updating or creating a subscription with that trial end. +/// If set, one of `subscription_items` or `subscription` is required. +#[derive(Copy, Clone, Debug, serde::Serialize)] +#[serde(untagged)] +pub enum UpcomingLinesInvoiceSubscriptionTrialEnd { + Now, + Timestamp(stripe_types::Timestamp), +} +impl<'a> UpcomingLinesInvoice<'a> { + /// When retrieving an upcoming invoice, you’ll get a **lines** property containing the total count of line items and the first handful of those items. + /// There is also a URL where you can retrieve the full (paginated) list of line items. + pub fn send( + &self, + client: &stripe::Client, + ) -> stripe::Response> { + client.get_query("/invoices/upcoming/lines", self) + } + pub fn paginate( + self, + ) -> stripe::ListPaginator> { + stripe::ListPaginator::from_list_params("/invoices/upcoming/lines", self) + } +} +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreateInvoice<'a> { + /// The account tax IDs associated with the invoice. Only editable when the invoice is a draft. + #[serde(skip_serializing_if = "Option::is_none")] + pub account_tax_ids: Option<&'a [&'a str]>, + /// A fee in cents (or local equivalent) that will be applied to the invoice and transferred to the application owner's Stripe account. + /// The request must be made with an OAuth key or the Stripe-Account header in order to take an application fee. + /// For more information, see the application fees [documentation](https://stripe.com/docs/billing/invoices/connect#collecting-fees). + #[serde(skip_serializing_if = "Option::is_none")] + pub application_fee_amount: Option, + /// Controls whether Stripe performs [automatic collection](https://stripe.com/docs/invoicing/integration/automatic-advancement-collection) of the invoice. + /// If `false`, the invoice's state doesn't automatically advance without an explicit action. + #[serde(skip_serializing_if = "Option::is_none")] + pub auto_advance: Option, + /// Settings for automatic tax lookup for this invoice. + #[serde(skip_serializing_if = "Option::is_none")] + pub automatic_tax: Option>, + /// Either `charge_automatically`, or `send_invoice`. + /// When charging automatically, Stripe will attempt to pay this invoice using the default source attached to the customer. + /// When sending an invoice, Stripe will email this invoice to the customer with payment instructions. + /// Defaults to `charge_automatically`. + #[serde(skip_serializing_if = "Option::is_none")] + pub collection_method: Option, + /// The currency to create this invoice in. Defaults to that of `customer` if not specified. + #[serde(skip_serializing_if = "Option::is_none")] + pub currency: Option, + /// A list of up to 4 custom fields to be displayed on the invoice. + #[serde(skip_serializing_if = "Option::is_none")] + pub custom_fields: Option<&'a [CustomFieldParams<'a>]>, + /// The ID of the customer who will be billed. + #[serde(skip_serializing_if = "Option::is_none")] + pub customer: Option<&'a str>, + /// The number of days from when the invoice is created until it is due. + /// Valid only for invoices where `collection_method=send_invoice`. + #[serde(skip_serializing_if = "Option::is_none")] + pub days_until_due: Option, + /// ID of the default payment method for the invoice. + /// It must belong to the customer associated with the invoice. + /// If not set, defaults to the subscription's default payment method, if any, or to the default payment method in the customer's invoice settings. + #[serde(skip_serializing_if = "Option::is_none")] + pub default_payment_method: Option<&'a str>, + /// ID of the default payment source for the invoice. + /// It must belong to the customer associated with the invoice and be in a chargeable state. + /// If not set, defaults to the subscription's default source, if any, or to the customer's default source. + #[serde(skip_serializing_if = "Option::is_none")] + pub default_source: Option<&'a str>, + /// The tax rates that will apply to any line item that does not have `tax_rates` set. + #[serde(skip_serializing_if = "Option::is_none")] + pub default_tax_rates: Option<&'a [&'a str]>, + /// An arbitrary string attached to the object. + /// Often useful for displaying to users. + /// Referenced as 'memo' in the Dashboard. + #[serde(skip_serializing_if = "Option::is_none")] + pub description: Option<&'a str>, + /// The coupons to redeem into discounts for the invoice. + /// If not specified, inherits the discount from the invoice's customer. + /// Pass an empty string to avoid inheriting any discounts. + #[serde(skip_serializing_if = "Option::is_none")] + pub discounts: Option<&'a [CreateInvoiceDiscounts<'a>]>, + /// The date on which payment for this invoice is due. + /// Valid only for invoices where `collection_method=send_invoice`. + #[serde(skip_serializing_if = "Option::is_none")] + pub due_date: Option, + /// The date when this invoice is in effect. + /// Same as `finalized_at` unless overwritten. + /// When defined, this value replaces the system-generated 'Date of issue' printed on the invoice PDF and receipt. + #[serde(skip_serializing_if = "Option::is_none")] + pub effective_at: Option, + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, + /// Footer to be displayed on the invoice. + #[serde(skip_serializing_if = "Option::is_none")] + pub footer: Option<&'a str>, + /// Revise an existing invoice. + /// The new invoice will be created in `status=draft`. + /// See the [revision documentation](https://stripe.com/docs/invoicing/invoice-revisions) for more details. + #[serde(skip_serializing_if = "Option::is_none")] + pub from_invoice: Option>, + /// The connected account that issues the invoice. + /// The invoice is presented with the branding and support information of the specified account. + #[serde(skip_serializing_if = "Option::is_none")] + pub issuer: Option>, + /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. + /// This can be useful for storing additional information about the object in a structured format. + /// Individual keys can be unset by posting an empty value to them. + /// All keys can be unset by posting an empty value to `metadata`. + #[serde(skip_serializing_if = "Option::is_none")] + pub metadata: Option<&'a std::collections::HashMap>, + /// The account (if any) for which the funds of the invoice payment are intended. + /// If set, the invoice will be presented with the branding and support information of the specified account. + /// See the [Invoices with Connect](https://stripe.com/docs/billing/invoices/connect) documentation for details. + #[serde(skip_serializing_if = "Option::is_none")] + pub on_behalf_of: Option<&'a str>, + /// Configuration settings for the PaymentIntent that is generated when the invoice is finalized. + #[serde(skip_serializing_if = "Option::is_none")] + pub payment_settings: Option>, + /// How to handle pending invoice items on invoice creation. + /// One of `include` or `exclude`. + /// `include` will include any pending invoice items, and will create an empty draft invoice if no pending invoice items exist. + /// `exclude` will always create an empty invoice draft regardless if there are pending invoice items or not. + /// Defaults to `exclude` if the parameter is omitted. + #[serde(skip_serializing_if = "Option::is_none")] + pub pending_invoice_items_behavior: Option, + /// The rendering-related settings that control how the invoice is displayed on customer-facing surfaces such as PDF and Hosted Invoice Page. + #[serde(skip_serializing_if = "Option::is_none")] + pub rendering: Option, + /// This is a legacy field that will be removed soon. + /// For details about `rendering_options`, refer to `rendering` instead. + /// Options for invoice PDF rendering. + #[serde(skip_serializing_if = "Option::is_none")] + pub rendering_options: Option, + /// Settings for the cost of shipping for this invoice. + #[serde(skip_serializing_if = "Option::is_none")] + pub shipping_cost: Option>, + /// Shipping details for the invoice. + /// The Invoice PDF will use the `shipping_details` value if it is set, otherwise the PDF will render the shipping address from the customer. + #[serde(skip_serializing_if = "Option::is_none")] + pub shipping_details: Option>, + /// Extra information about a charge for the customer's credit card statement. + /// It must contain at least one letter. + /// If not specified and this invoice is part of a subscription, the default `statement_descriptor` will be set to the first subscription item's product's `statement_descriptor`. + #[serde(skip_serializing_if = "Option::is_none")] + pub statement_descriptor: Option<&'a str>, + /// The ID of the subscription to invoice, if any. + /// If set, the created invoice will only include pending invoice items for that subscription. + /// The subscription's billing cycle and regular subscription events won't be affected. + #[serde(skip_serializing_if = "Option::is_none")] + pub subscription: Option<&'a str>, + /// If specified, the funds from the invoice will be transferred to the destination and the ID of the resulting transfer will be found on the invoice's charge. + #[serde(skip_serializing_if = "Option::is_none")] + pub transfer_data: Option>, +} +impl<'a> CreateInvoice<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// Settings for automatic tax lookup for this invoice. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreateInvoiceAutomaticTax<'a> { + /// Whether Stripe automatically computes tax on this invoice. + /// Note that incompatible invoice items (invoice items with manually specified [tax rates](https://stripe.com/docs/api/tax_rates), negative amounts, or `tax_behavior=unspecified`) cannot be added to automatic tax invoices. + pub enabled: bool, + /// The account that's liable for tax. + /// If set, the business address and tax registrations required to perform the tax calculation are loaded from this account. + /// The tax transaction is returned in the report of the connected account. + #[serde(skip_serializing_if = "Option::is_none")] + pub liability: Option>, +} +impl<'a> CreateInvoiceAutomaticTax<'a> { + pub fn new(enabled: bool) -> Self { + Self { enabled, liability: None } + } +} +/// The account that's liable for tax. +/// If set, the business address and tax registrations required to perform the tax calculation are loaded from this account. +/// The tax transaction is returned in the report of the connected account. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreateInvoiceAutomaticTaxLiability<'a> { + /// The connected account being referenced when `type` is `account`. + #[serde(skip_serializing_if = "Option::is_none")] + pub account: Option<&'a str>, + /// Type of the account referenced in the request. + #[serde(rename = "type")] + pub type_: CreateInvoiceAutomaticTaxLiabilityType, +} +impl<'a> CreateInvoiceAutomaticTaxLiability<'a> { + pub fn new(type_: CreateInvoiceAutomaticTaxLiabilityType) -> Self { + Self { account: None, type_ } + } +} +/// Type of the account referenced in the request. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreateInvoiceAutomaticTaxLiabilityType { + Account, + Self_, +} +impl CreateInvoiceAutomaticTaxLiabilityType { + pub fn as_str(self) -> &'static str { + use CreateInvoiceAutomaticTaxLiabilityType::*; + match self { + Account => "account", + Self_ => "self", + } + } +} + +impl std::str::FromStr for CreateInvoiceAutomaticTaxLiabilityType { + type Err = (); + fn from_str(s: &str) -> Result { + use CreateInvoiceAutomaticTaxLiabilityType::*; + match s { + "account" => Ok(Account), + "self" => Ok(Self_), + _ => Err(()), + } + } +} +impl std::fmt::Display for CreateInvoiceAutomaticTaxLiabilityType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreateInvoiceAutomaticTaxLiabilityType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreateInvoiceAutomaticTaxLiabilityType { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// The coupons to redeem into discounts for the invoice. +/// If not specified, inherits the discount from the invoice's customer. +/// Pass an empty string to avoid inheriting any discounts. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreateInvoiceDiscounts<'a> { + /// ID of the coupon to create a new discount for. + #[serde(skip_serializing_if = "Option::is_none")] + pub coupon: Option<&'a str>, + /// ID of an existing discount on the object (or one of its ancestors) to reuse. + #[serde(skip_serializing_if = "Option::is_none")] + pub discount: Option<&'a str>, +} +impl<'a> CreateInvoiceDiscounts<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// Revise an existing invoice. +/// The new invoice will be created in `status=draft`. +/// See the [revision documentation](https://stripe.com/docs/invoicing/invoice-revisions) for more details. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreateInvoiceFromInvoice<'a> { + /// The relation between the new invoice and the original invoice. + /// Currently, only 'revision' is permitted. + pub action: CreateInvoiceFromInvoiceAction, + /// The `id` of the invoice that will be cloned. + pub invoice: &'a str, +} +impl<'a> CreateInvoiceFromInvoice<'a> { + pub fn new(action: CreateInvoiceFromInvoiceAction, invoice: &'a str) -> Self { + Self { action, invoice } + } +} +/// The relation between the new invoice and the original invoice. +/// Currently, only 'revision' is permitted. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreateInvoiceFromInvoiceAction { + Revision, +} +impl CreateInvoiceFromInvoiceAction { + pub fn as_str(self) -> &'static str { + use CreateInvoiceFromInvoiceAction::*; + match self { + Revision => "revision", + } + } +} + +impl std::str::FromStr for CreateInvoiceFromInvoiceAction { + type Err = (); + fn from_str(s: &str) -> Result { + use CreateInvoiceFromInvoiceAction::*; + match s { + "revision" => Ok(Revision), + _ => Err(()), + } + } +} +impl std::fmt::Display for CreateInvoiceFromInvoiceAction { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreateInvoiceFromInvoiceAction { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreateInvoiceFromInvoiceAction { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// The connected account that issues the invoice. +/// The invoice is presented with the branding and support information of the specified account. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreateInvoiceIssuer<'a> { + /// The connected account being referenced when `type` is `account`. + #[serde(skip_serializing_if = "Option::is_none")] + pub account: Option<&'a str>, + /// Type of the account referenced in the request. + #[serde(rename = "type")] + pub type_: CreateInvoiceIssuerType, +} +impl<'a> CreateInvoiceIssuer<'a> { + pub fn new(type_: CreateInvoiceIssuerType) -> Self { + Self { account: None, type_ } + } +} +/// Type of the account referenced in the request. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreateInvoiceIssuerType { + Account, + Self_, +} +impl CreateInvoiceIssuerType { + pub fn as_str(self) -> &'static str { + use CreateInvoiceIssuerType::*; + match self { + Account => "account", + Self_ => "self", + } + } +} + +impl std::str::FromStr for CreateInvoiceIssuerType { + type Err = (); + fn from_str(s: &str) -> Result { + use CreateInvoiceIssuerType::*; + match s { + "account" => Ok(Account), + "self" => Ok(Self_), + _ => Err(()), + } + } +} +impl std::fmt::Display for CreateInvoiceIssuerType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreateInvoiceIssuerType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreateInvoiceIssuerType { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Configuration settings for the PaymentIntent that is generated when the invoice is finalized. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreateInvoicePaymentSettings<'a> { + /// ID of the mandate to be used for this invoice. + /// It must correspond to the payment method used to pay the invoice, including the invoice's default_payment_method or default_source, if set. + #[serde(skip_serializing_if = "Option::is_none")] + pub default_mandate: Option<&'a str>, + /// Payment-method-specific configuration to provide to the invoice’s PaymentIntent. + #[serde(skip_serializing_if = "Option::is_none")] + pub payment_method_options: Option>, + /// The list of payment method types (e.g. + /// card) to provide to the invoice’s PaymentIntent. + /// If not set, Stripe attempts to automatically determine the types to use by looking at the invoice’s default payment method, the subscription’s default payment method, the customer’s default payment method, and your [invoice template settings](https://dashboard.stripe.com/settings/billing/invoice). + #[serde(skip_serializing_if = "Option::is_none")] + pub payment_method_types: Option<&'a [CreateInvoicePaymentSettingsPaymentMethodTypes]>, +} +impl<'a> CreateInvoicePaymentSettings<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// Payment-method-specific configuration to provide to the invoice’s PaymentIntent. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreateInvoicePaymentSettingsPaymentMethodOptions<'a> { + /// If paying by `acss_debit`, this sub-hash contains details about the Canadian pre-authorized debit payment method options to pass to the invoice’s PaymentIntent. + #[serde(skip_serializing_if = "Option::is_none")] + pub acss_debit: Option, + /// If paying by `bancontact`, this sub-hash contains details about the Bancontact payment method options to pass to the invoice’s PaymentIntent. + #[serde(skip_serializing_if = "Option::is_none")] + pub bancontact: Option, + /// If paying by `card`, this sub-hash contains details about the Card payment method options to pass to the invoice’s PaymentIntent. + #[serde(skip_serializing_if = "Option::is_none")] + pub card: Option, + /// If paying by `customer_balance`, this sub-hash contains details about the Bank transfer payment method options to pass to the invoice’s PaymentIntent. + #[serde(skip_serializing_if = "Option::is_none")] + pub customer_balance: Option>, + /// If paying by `konbini`, this sub-hash contains details about the Konbini payment method options to pass to the invoice’s PaymentIntent. + #[serde(skip_serializing_if = "Option::is_none")] + pub konbini: Option<&'a serde_json::Value>, + /// If paying by `us_bank_account`, this sub-hash contains details about the ACH direct debit payment method options to pass to the invoice’s PaymentIntent. + #[serde(skip_serializing_if = "Option::is_none")] + pub us_bank_account: Option>, +} +impl<'a> CreateInvoicePaymentSettingsPaymentMethodOptions<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// If paying by `acss_debit`, this sub-hash contains details about the Canadian pre-authorized debit payment method options to pass to the invoice’s PaymentIntent. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreateInvoicePaymentSettingsPaymentMethodOptionsAcssDebit { + /// Additional fields for Mandate creation + #[serde(skip_serializing_if = "Option::is_none")] + pub mandate_options: + Option, + /// Verification method for the intent + #[serde(skip_serializing_if = "Option::is_none")] + pub verification_method: + Option, +} +impl CreateInvoicePaymentSettingsPaymentMethodOptionsAcssDebit { + pub fn new() -> Self { + Self::default() + } +} +/// Additional fields for Mandate creation +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreateInvoicePaymentSettingsPaymentMethodOptionsAcssDebitMandateOptions { + /// Transaction type of the mandate. + #[serde(skip_serializing_if = "Option::is_none")] + pub transaction_type: Option< + CreateInvoicePaymentSettingsPaymentMethodOptionsAcssDebitMandateOptionsTransactionType, + >, +} +impl CreateInvoicePaymentSettingsPaymentMethodOptionsAcssDebitMandateOptions { + pub fn new() -> Self { + Self::default() + } +} +/// Transaction type of the mandate. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreateInvoicePaymentSettingsPaymentMethodOptionsAcssDebitMandateOptionsTransactionType { + Business, + Personal, +} +impl CreateInvoicePaymentSettingsPaymentMethodOptionsAcssDebitMandateOptionsTransactionType { + pub fn as_str(self) -> &'static str { + use CreateInvoicePaymentSettingsPaymentMethodOptionsAcssDebitMandateOptionsTransactionType::*; + match self { + Business => "business", + Personal => "personal", + } + } +} + +impl std::str::FromStr + for CreateInvoicePaymentSettingsPaymentMethodOptionsAcssDebitMandateOptionsTransactionType +{ + type Err = (); + fn from_str(s: &str) -> Result { + use CreateInvoicePaymentSettingsPaymentMethodOptionsAcssDebitMandateOptionsTransactionType::*; + match s { + "business" => Ok(Business), + "personal" => Ok(Personal), + _ => Err(()), + } + } +} +impl std::fmt::Display + for CreateInvoicePaymentSettingsPaymentMethodOptionsAcssDebitMandateOptionsTransactionType +{ + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug + for CreateInvoicePaymentSettingsPaymentMethodOptionsAcssDebitMandateOptionsTransactionType +{ + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize + for CreateInvoicePaymentSettingsPaymentMethodOptionsAcssDebitMandateOptionsTransactionType +{ + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Verification method for the intent +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreateInvoicePaymentSettingsPaymentMethodOptionsAcssDebitVerificationMethod { + Automatic, + Instant, + Microdeposits, +} +impl CreateInvoicePaymentSettingsPaymentMethodOptionsAcssDebitVerificationMethod { + pub fn as_str(self) -> &'static str { + use CreateInvoicePaymentSettingsPaymentMethodOptionsAcssDebitVerificationMethod::*; + match self { + Automatic => "automatic", + Instant => "instant", + Microdeposits => "microdeposits", + } + } +} + +impl std::str::FromStr + for CreateInvoicePaymentSettingsPaymentMethodOptionsAcssDebitVerificationMethod +{ + type Err = (); + fn from_str(s: &str) -> Result { + use CreateInvoicePaymentSettingsPaymentMethodOptionsAcssDebitVerificationMethod::*; + match s { + "automatic" => Ok(Automatic), + "instant" => Ok(Instant), + "microdeposits" => Ok(Microdeposits), + _ => Err(()), + } + } +} +impl std::fmt::Display + for CreateInvoicePaymentSettingsPaymentMethodOptionsAcssDebitVerificationMethod +{ + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug + for CreateInvoicePaymentSettingsPaymentMethodOptionsAcssDebitVerificationMethod +{ + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize + for CreateInvoicePaymentSettingsPaymentMethodOptionsAcssDebitVerificationMethod +{ + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// If paying by `bancontact`, this sub-hash contains details about the Bancontact payment method options to pass to the invoice’s PaymentIntent. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreateInvoicePaymentSettingsPaymentMethodOptionsBancontact { + /// Preferred language of the Bancontact authorization page that the customer is redirected to. + #[serde(skip_serializing_if = "Option::is_none")] + pub preferred_language: + Option, +} +impl CreateInvoicePaymentSettingsPaymentMethodOptionsBancontact { + pub fn new() -> Self { + Self::default() + } +} +/// Preferred language of the Bancontact authorization page that the customer is redirected to. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreateInvoicePaymentSettingsPaymentMethodOptionsBancontactPreferredLanguage { + De, + En, + Fr, + Nl, +} +impl CreateInvoicePaymentSettingsPaymentMethodOptionsBancontactPreferredLanguage { + pub fn as_str(self) -> &'static str { + use CreateInvoicePaymentSettingsPaymentMethodOptionsBancontactPreferredLanguage::*; + match self { + De => "de", + En => "en", + Fr => "fr", + Nl => "nl", + } + } +} + +impl std::str::FromStr + for CreateInvoicePaymentSettingsPaymentMethodOptionsBancontactPreferredLanguage +{ + type Err = (); + fn from_str(s: &str) -> Result { + use CreateInvoicePaymentSettingsPaymentMethodOptionsBancontactPreferredLanguage::*; + match s { + "de" => Ok(De), + "en" => Ok(En), + "fr" => Ok(Fr), + "nl" => Ok(Nl), + _ => Err(()), + } + } +} +impl std::fmt::Display + for CreateInvoicePaymentSettingsPaymentMethodOptionsBancontactPreferredLanguage +{ + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug + for CreateInvoicePaymentSettingsPaymentMethodOptionsBancontactPreferredLanguage +{ + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize + for CreateInvoicePaymentSettingsPaymentMethodOptionsBancontactPreferredLanguage +{ + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// If paying by `card`, this sub-hash contains details about the Card payment method options to pass to the invoice’s PaymentIntent. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreateInvoicePaymentSettingsPaymentMethodOptionsCard { + /// Installment configuration for payments attempted on this invoice (Mexico Only). + /// + /// For more information, see the [installments integration guide](https://stripe.com/docs/payments/installments). + #[serde(skip_serializing_if = "Option::is_none")] + pub installments: Option, + /// We strongly recommend that you rely on our SCA Engine to automatically prompt your customers for authentication based on risk level and [other requirements](https://stripe.com/docs/strong-customer-authentication). + /// However, if you wish to request 3D Secure based on logic from your own fraud engine, provide this option. + /// Read our guide on [manually requesting 3D Secure](https://stripe.com/docs/payments/3d-secure#manual-three-ds) for more information on how this configuration interacts with Radar and our SCA Engine. + #[serde(skip_serializing_if = "Option::is_none")] + pub request_three_d_secure: + Option, +} +impl CreateInvoicePaymentSettingsPaymentMethodOptionsCard { + pub fn new() -> Self { + Self::default() + } +} +/// Installment configuration for payments attempted on this invoice (Mexico Only). +/// +/// For more information, see the [installments integration guide](https://stripe.com/docs/payments/installments). +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreateInvoicePaymentSettingsPaymentMethodOptionsCardInstallments { + /// Setting to true enables installments for this invoice. + /// Setting to false will prevent any selected plan from applying to a payment. + #[serde(skip_serializing_if = "Option::is_none")] + pub enabled: Option, + /// The selected installment plan to use for this invoice. + #[serde(skip_serializing_if = "Option::is_none")] + pub plan: Option, +} +impl CreateInvoicePaymentSettingsPaymentMethodOptionsCardInstallments { + pub fn new() -> Self { + Self::default() + } +} +/// The selected installment plan to use for this invoice. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreateInvoicePaymentSettingsPaymentMethodOptionsCardInstallmentsPlan { + /// For `fixed_count` installment plans, this is the number of installment payments your customer will make to their credit card. + pub count: u64, + /// For `fixed_count` installment plans, this is the interval between installment payments your customer will make to their credit card. + /// One of `month`. + pub interval: CreateInvoicePaymentSettingsPaymentMethodOptionsCardInstallmentsPlanInterval, + /// Type of installment plan, one of `fixed_count`. + #[serde(rename = "type")] + pub type_: CreateInvoicePaymentSettingsPaymentMethodOptionsCardInstallmentsPlanType, +} +impl CreateInvoicePaymentSettingsPaymentMethodOptionsCardInstallmentsPlan { + pub fn new( + count: u64, + interval: CreateInvoicePaymentSettingsPaymentMethodOptionsCardInstallmentsPlanInterval, + type_: CreateInvoicePaymentSettingsPaymentMethodOptionsCardInstallmentsPlanType, + ) -> Self { + Self { count, interval, type_ } + } +} +/// For `fixed_count` installment plans, this is the interval between installment payments your customer will make to their credit card. +/// One of `month`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreateInvoicePaymentSettingsPaymentMethodOptionsCardInstallmentsPlanInterval { + Month, +} +impl CreateInvoicePaymentSettingsPaymentMethodOptionsCardInstallmentsPlanInterval { + pub fn as_str(self) -> &'static str { + use CreateInvoicePaymentSettingsPaymentMethodOptionsCardInstallmentsPlanInterval::*; + match self { + Month => "month", + } + } +} + +impl std::str::FromStr + for CreateInvoicePaymentSettingsPaymentMethodOptionsCardInstallmentsPlanInterval +{ + type Err = (); + fn from_str(s: &str) -> Result { + use CreateInvoicePaymentSettingsPaymentMethodOptionsCardInstallmentsPlanInterval::*; + match s { + "month" => Ok(Month), + _ => Err(()), + } + } +} +impl std::fmt::Display + for CreateInvoicePaymentSettingsPaymentMethodOptionsCardInstallmentsPlanInterval +{ + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug + for CreateInvoicePaymentSettingsPaymentMethodOptionsCardInstallmentsPlanInterval +{ + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize + for CreateInvoicePaymentSettingsPaymentMethodOptionsCardInstallmentsPlanInterval +{ + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Type of installment plan, one of `fixed_count`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreateInvoicePaymentSettingsPaymentMethodOptionsCardInstallmentsPlanType { + FixedCount, +} +impl CreateInvoicePaymentSettingsPaymentMethodOptionsCardInstallmentsPlanType { + pub fn as_str(self) -> &'static str { + use CreateInvoicePaymentSettingsPaymentMethodOptionsCardInstallmentsPlanType::*; + match self { + FixedCount => "fixed_count", + } + } +} + +impl std::str::FromStr + for CreateInvoicePaymentSettingsPaymentMethodOptionsCardInstallmentsPlanType +{ + type Err = (); + fn from_str(s: &str) -> Result { + use CreateInvoicePaymentSettingsPaymentMethodOptionsCardInstallmentsPlanType::*; + match s { + "fixed_count" => Ok(FixedCount), + _ => Err(()), + } + } +} +impl std::fmt::Display + for CreateInvoicePaymentSettingsPaymentMethodOptionsCardInstallmentsPlanType +{ + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreateInvoicePaymentSettingsPaymentMethodOptionsCardInstallmentsPlanType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreateInvoicePaymentSettingsPaymentMethodOptionsCardInstallmentsPlanType { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// We strongly recommend that you rely on our SCA Engine to automatically prompt your customers for authentication based on risk level and [other requirements](https://stripe.com/docs/strong-customer-authentication). +/// However, if you wish to request 3D Secure based on logic from your own fraud engine, provide this option. +/// Read our guide on [manually requesting 3D Secure](https://stripe.com/docs/payments/3d-secure#manual-three-ds) for more information on how this configuration interacts with Radar and our SCA Engine. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreateInvoicePaymentSettingsPaymentMethodOptionsCardRequestThreeDSecure { + Any, + Automatic, + Challenge, +} +impl CreateInvoicePaymentSettingsPaymentMethodOptionsCardRequestThreeDSecure { + pub fn as_str(self) -> &'static str { + use CreateInvoicePaymentSettingsPaymentMethodOptionsCardRequestThreeDSecure::*; + match self { + Any => "any", + Automatic => "automatic", + Challenge => "challenge", + } + } +} + +impl std::str::FromStr for CreateInvoicePaymentSettingsPaymentMethodOptionsCardRequestThreeDSecure { + type Err = (); + fn from_str(s: &str) -> Result { + use CreateInvoicePaymentSettingsPaymentMethodOptionsCardRequestThreeDSecure::*; + match s { + "any" => Ok(Any), + "automatic" => Ok(Automatic), + "challenge" => Ok(Challenge), + _ => Err(()), + } + } +} +impl std::fmt::Display for CreateInvoicePaymentSettingsPaymentMethodOptionsCardRequestThreeDSecure { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreateInvoicePaymentSettingsPaymentMethodOptionsCardRequestThreeDSecure { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreateInvoicePaymentSettingsPaymentMethodOptionsCardRequestThreeDSecure { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// If paying by `us_bank_account`, this sub-hash contains details about the ACH direct debit payment method options to pass to the invoice’s PaymentIntent. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreateInvoicePaymentSettingsPaymentMethodOptionsUsBankAccount<'a> { + /// Additional fields for Financial Connections Session creation + #[serde(skip_serializing_if = "Option::is_none")] + pub financial_connections: Option< + CreateInvoicePaymentSettingsPaymentMethodOptionsUsBankAccountFinancialConnections<'a>, + >, + /// Verification method for the intent + #[serde(skip_serializing_if = "Option::is_none")] + pub verification_method: + Option, +} +impl<'a> CreateInvoicePaymentSettingsPaymentMethodOptionsUsBankAccount<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// Additional fields for Financial Connections Session creation +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreateInvoicePaymentSettingsPaymentMethodOptionsUsBankAccountFinancialConnections<'a> { + /// The list of permissions to request. + /// If this parameter is passed, the `payment_method` permission must be included. + /// Valid permissions include: `balances`, `ownership`, `payment_method`, and `transactions`. +#[serde(skip_serializing_if = "Option::is_none")] +pub permissions: Option<&'a [CreateInvoicePaymentSettingsPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions]>, + /// List of data features that you would like to retrieve upon account creation. +#[serde(skip_serializing_if = "Option::is_none")] +pub prefetch: Option<&'a [CreateInvoicePaymentSettingsPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch]>, + +} +impl<'a> CreateInvoicePaymentSettingsPaymentMethodOptionsUsBankAccountFinancialConnections<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// The list of permissions to request. +/// If this parameter is passed, the `payment_method` permission must be included. +/// Valid permissions include: `balances`, `ownership`, `payment_method`, and `transactions`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreateInvoicePaymentSettingsPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions +{ + Balances, + Ownership, + PaymentMethod, + Transactions, +} +impl CreateInvoicePaymentSettingsPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions { + pub fn as_str(self) -> &'static str { + use CreateInvoicePaymentSettingsPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions::*; + match self { + Balances => "balances", + Ownership => "ownership", + PaymentMethod => "payment_method", + Transactions => "transactions", + } + } +} + +impl std::str::FromStr + for CreateInvoicePaymentSettingsPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions +{ + type Err = (); + fn from_str(s: &str) -> Result { + use CreateInvoicePaymentSettingsPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions::*; + match s { + "balances" => Ok(Balances), + "ownership" => Ok(Ownership), + "payment_method" => Ok(PaymentMethod), + "transactions" => Ok(Transactions), + _ => Err(()), + } + } +} +impl std::fmt::Display + for CreateInvoicePaymentSettingsPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions +{ + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug + for CreateInvoicePaymentSettingsPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions +{ + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize + for CreateInvoicePaymentSettingsPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions +{ + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// List of data features that you would like to retrieve upon account creation. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreateInvoicePaymentSettingsPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch { + Balances, + Transactions, +} +impl CreateInvoicePaymentSettingsPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch { + pub fn as_str(self) -> &'static str { + use CreateInvoicePaymentSettingsPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch::*; + match self { + Balances => "balances", + Transactions => "transactions", + } + } +} + +impl std::str::FromStr + for CreateInvoicePaymentSettingsPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch +{ + type Err = (); + fn from_str(s: &str) -> Result { + use CreateInvoicePaymentSettingsPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch::*; + match s { + "balances" => Ok(Balances), + "transactions" => Ok(Transactions), + _ => Err(()), + } + } +} +impl std::fmt::Display + for CreateInvoicePaymentSettingsPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch +{ + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug + for CreateInvoicePaymentSettingsPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch +{ + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize + for CreateInvoicePaymentSettingsPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch +{ + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Verification method for the intent +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreateInvoicePaymentSettingsPaymentMethodOptionsUsBankAccountVerificationMethod { + Automatic, + Instant, + Microdeposits, +} +impl CreateInvoicePaymentSettingsPaymentMethodOptionsUsBankAccountVerificationMethod { + pub fn as_str(self) -> &'static str { + use CreateInvoicePaymentSettingsPaymentMethodOptionsUsBankAccountVerificationMethod::*; + match self { + Automatic => "automatic", + Instant => "instant", + Microdeposits => "microdeposits", + } + } +} + +impl std::str::FromStr + for CreateInvoicePaymentSettingsPaymentMethodOptionsUsBankAccountVerificationMethod +{ + type Err = (); + fn from_str(s: &str) -> Result { + use CreateInvoicePaymentSettingsPaymentMethodOptionsUsBankAccountVerificationMethod::*; + match s { + "automatic" => Ok(Automatic), + "instant" => Ok(Instant), + "microdeposits" => Ok(Microdeposits), + _ => Err(()), + } + } +} +impl std::fmt::Display + for CreateInvoicePaymentSettingsPaymentMethodOptionsUsBankAccountVerificationMethod +{ + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug + for CreateInvoicePaymentSettingsPaymentMethodOptionsUsBankAccountVerificationMethod +{ + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize + for CreateInvoicePaymentSettingsPaymentMethodOptionsUsBankAccountVerificationMethod +{ + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// The list of payment method types (e.g. +/// card) to provide to the invoice’s PaymentIntent. +/// If not set, Stripe attempts to automatically determine the types to use by looking at the invoice’s default payment method, the subscription’s default payment method, the customer’s default payment method, and your [invoice template settings](https://dashboard.stripe.com/settings/billing/invoice). +#[derive(Copy, Clone, Eq, PartialEq)] +#[non_exhaustive] +pub enum CreateInvoicePaymentSettingsPaymentMethodTypes { + AchCreditTransfer, + AchDebit, + AcssDebit, + AuBecsDebit, + BacsDebit, + Bancontact, + Boleto, + Card, + Cashapp, + CustomerBalance, + Eps, + Fpx, + Giropay, + Grabpay, + Ideal, + Konbini, + Link, + P24, + Paynow, + Paypal, + Promptpay, + SepaCreditTransfer, + SepaDebit, + Sofort, + UsBankAccount, + WechatPay, + /// An unrecognized value from Stripe. Should not be used as a request parameter. + Unknown, +} +impl CreateInvoicePaymentSettingsPaymentMethodTypes { + pub fn as_str(self) -> &'static str { + use CreateInvoicePaymentSettingsPaymentMethodTypes::*; + match self { + AchCreditTransfer => "ach_credit_transfer", + AchDebit => "ach_debit", + AcssDebit => "acss_debit", + AuBecsDebit => "au_becs_debit", + BacsDebit => "bacs_debit", + Bancontact => "bancontact", + Boleto => "boleto", + Card => "card", + Cashapp => "cashapp", + CustomerBalance => "customer_balance", + Eps => "eps", + Fpx => "fpx", + Giropay => "giropay", + Grabpay => "grabpay", + Ideal => "ideal", + Konbini => "konbini", + Link => "link", + P24 => "p24", + Paynow => "paynow", + Paypal => "paypal", + Promptpay => "promptpay", + SepaCreditTransfer => "sepa_credit_transfer", + SepaDebit => "sepa_debit", + Sofort => "sofort", + UsBankAccount => "us_bank_account", + WechatPay => "wechat_pay", + Unknown => "unknown", + } + } +} + +impl std::str::FromStr for CreateInvoicePaymentSettingsPaymentMethodTypes { + type Err = (); + fn from_str(s: &str) -> Result { + use CreateInvoicePaymentSettingsPaymentMethodTypes::*; + match s { + "ach_credit_transfer" => Ok(AchCreditTransfer), + "ach_debit" => Ok(AchDebit), + "acss_debit" => Ok(AcssDebit), + "au_becs_debit" => Ok(AuBecsDebit), + "bacs_debit" => Ok(BacsDebit), + "bancontact" => Ok(Bancontact), + "boleto" => Ok(Boleto), + "card" => Ok(Card), + "cashapp" => Ok(Cashapp), + "customer_balance" => Ok(CustomerBalance), + "eps" => Ok(Eps), + "fpx" => Ok(Fpx), + "giropay" => Ok(Giropay), + "grabpay" => Ok(Grabpay), + "ideal" => Ok(Ideal), + "konbini" => Ok(Konbini), + "link" => Ok(Link), + "p24" => Ok(P24), + "paynow" => Ok(Paynow), + "paypal" => Ok(Paypal), + "promptpay" => Ok(Promptpay), + "sepa_credit_transfer" => Ok(SepaCreditTransfer), + "sepa_debit" => Ok(SepaDebit), + "sofort" => Ok(Sofort), + "us_bank_account" => Ok(UsBankAccount), + "wechat_pay" => Ok(WechatPay), + _ => Err(()), + } + } +} +impl std::fmt::Display for CreateInvoicePaymentSettingsPaymentMethodTypes { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreateInvoicePaymentSettingsPaymentMethodTypes { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreateInvoicePaymentSettingsPaymentMethodTypes { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// How to handle pending invoice items on invoice creation. +/// One of `include` or `exclude`. +/// `include` will include any pending invoice items, and will create an empty draft invoice if no pending invoice items exist. +/// `exclude` will always create an empty invoice draft regardless if there are pending invoice items or not. +/// Defaults to `exclude` if the parameter is omitted. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreateInvoicePendingInvoiceItemsBehavior { + Exclude, + Include, + IncludeAndRequire, +} +impl CreateInvoicePendingInvoiceItemsBehavior { + pub fn as_str(self) -> &'static str { + use CreateInvoicePendingInvoiceItemsBehavior::*; + match self { + Exclude => "exclude", + Include => "include", + IncludeAndRequire => "include_and_require", + } + } +} + +impl std::str::FromStr for CreateInvoicePendingInvoiceItemsBehavior { + type Err = (); + fn from_str(s: &str) -> Result { + use CreateInvoicePendingInvoiceItemsBehavior::*; + match s { + "exclude" => Ok(Exclude), + "include" => Ok(Include), + "include_and_require" => Ok(IncludeAndRequire), + _ => Err(()), + } + } +} +impl std::fmt::Display for CreateInvoicePendingInvoiceItemsBehavior { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreateInvoicePendingInvoiceItemsBehavior { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreateInvoicePendingInvoiceItemsBehavior { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// The rendering-related settings that control how the invoice is displayed on customer-facing surfaces such as PDF and Hosted Invoice Page. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreateInvoiceRendering { + /// How line-item prices and amounts will be displayed with respect to tax on invoice PDFs. + /// One of `exclude_tax` or `include_inclusive_tax`. + /// `include_inclusive_tax` will include inclusive tax (and exclude exclusive tax) in invoice PDF amounts. + /// `exclude_tax` will exclude all tax (inclusive and exclusive alike) from invoice PDF amounts. + #[serde(skip_serializing_if = "Option::is_none")] + pub amount_tax_display: Option, + /// Invoice pdf rendering options + #[serde(skip_serializing_if = "Option::is_none")] + pub pdf: Option, +} +impl CreateInvoiceRendering { + pub fn new() -> Self { + Self::default() + } +} +/// How line-item prices and amounts will be displayed with respect to tax on invoice PDFs. +/// One of `exclude_tax` or `include_inclusive_tax`. +/// `include_inclusive_tax` will include inclusive tax (and exclude exclusive tax) in invoice PDF amounts. +/// `exclude_tax` will exclude all tax (inclusive and exclusive alike) from invoice PDF amounts. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreateInvoiceRenderingAmountTaxDisplay { + ExcludeTax, + IncludeInclusiveTax, +} +impl CreateInvoiceRenderingAmountTaxDisplay { + pub fn as_str(self) -> &'static str { + use CreateInvoiceRenderingAmountTaxDisplay::*; + match self { + ExcludeTax => "exclude_tax", + IncludeInclusiveTax => "include_inclusive_tax", + } + } +} + +impl std::str::FromStr for CreateInvoiceRenderingAmountTaxDisplay { + type Err = (); + fn from_str(s: &str) -> Result { + use CreateInvoiceRenderingAmountTaxDisplay::*; + match s { + "exclude_tax" => Ok(ExcludeTax), + "include_inclusive_tax" => Ok(IncludeInclusiveTax), + _ => Err(()), + } + } +} +impl std::fmt::Display for CreateInvoiceRenderingAmountTaxDisplay { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreateInvoiceRenderingAmountTaxDisplay { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreateInvoiceRenderingAmountTaxDisplay { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Invoice pdf rendering options +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreateInvoiceRenderingPdf { + /// Page size for invoice PDF. Can be set to `a4`, `letter`, or `auto`. + /// If set to `auto`, invoice PDF page size defaults to `a4` for customers with + /// Japanese locale and `letter` for customers with other locales. + #[serde(skip_serializing_if = "Option::is_none")] + pub page_size: Option, +} +impl CreateInvoiceRenderingPdf { + pub fn new() -> Self { + Self::default() + } +} +/// Page size for invoice PDF. Can be set to `a4`, `letter`, or `auto`. +/// If set to `auto`, invoice PDF page size defaults to `a4` for customers with +/// Japanese locale and `letter` for customers with other locales. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreateInvoiceRenderingPdfPageSize { + A4, + Auto, + Letter, +} +impl CreateInvoiceRenderingPdfPageSize { + pub fn as_str(self) -> &'static str { + use CreateInvoiceRenderingPdfPageSize::*; + match self { + A4 => "a4", + Auto => "auto", + Letter => "letter", + } + } +} + +impl std::str::FromStr for CreateInvoiceRenderingPdfPageSize { + type Err = (); + fn from_str(s: &str) -> Result { + use CreateInvoiceRenderingPdfPageSize::*; + match s { + "a4" => Ok(A4), + "auto" => Ok(Auto), + "letter" => Ok(Letter), + _ => Err(()), + } + } +} +impl std::fmt::Display for CreateInvoiceRenderingPdfPageSize { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreateInvoiceRenderingPdfPageSize { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreateInvoiceRenderingPdfPageSize { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// This is a legacy field that will be removed soon. +/// For details about `rendering_options`, refer to `rendering` instead. +/// Options for invoice PDF rendering. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreateInvoiceRenderingOptions { + /// How line-item prices and amounts will be displayed with respect to tax on invoice PDFs. + /// One of `exclude_tax` or `include_inclusive_tax`. + /// `include_inclusive_tax` will include inclusive tax (and exclude exclusive tax) in invoice PDF amounts. + /// `exclude_tax` will exclude all tax (inclusive and exclusive alike) from invoice PDF amounts. + #[serde(skip_serializing_if = "Option::is_none")] + pub amount_tax_display: Option, +} +impl CreateInvoiceRenderingOptions { + pub fn new() -> Self { + Self::default() + } +} +/// How line-item prices and amounts will be displayed with respect to tax on invoice PDFs. +/// One of `exclude_tax` or `include_inclusive_tax`. +/// `include_inclusive_tax` will include inclusive tax (and exclude exclusive tax) in invoice PDF amounts. +/// `exclude_tax` will exclude all tax (inclusive and exclusive alike) from invoice PDF amounts. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreateInvoiceRenderingOptionsAmountTaxDisplay { + ExcludeTax, + IncludeInclusiveTax, +} +impl CreateInvoiceRenderingOptionsAmountTaxDisplay { + pub fn as_str(self) -> &'static str { + use CreateInvoiceRenderingOptionsAmountTaxDisplay::*; + match self { + ExcludeTax => "exclude_tax", + IncludeInclusiveTax => "include_inclusive_tax", + } + } +} + +impl std::str::FromStr for CreateInvoiceRenderingOptionsAmountTaxDisplay { + type Err = (); + fn from_str(s: &str) -> Result { + use CreateInvoiceRenderingOptionsAmountTaxDisplay::*; + match s { + "exclude_tax" => Ok(ExcludeTax), + "include_inclusive_tax" => Ok(IncludeInclusiveTax), + _ => Err(()), + } + } +} +impl std::fmt::Display for CreateInvoiceRenderingOptionsAmountTaxDisplay { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreateInvoiceRenderingOptionsAmountTaxDisplay { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreateInvoiceRenderingOptionsAmountTaxDisplay { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Settings for the cost of shipping for this invoice. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreateInvoiceShippingCost<'a> { + /// The ID of the shipping rate to use for this order. + #[serde(skip_serializing_if = "Option::is_none")] + pub shipping_rate: Option<&'a str>, + /// Parameters to create a new ad-hoc shipping rate for this order. + #[serde(skip_serializing_if = "Option::is_none")] + pub shipping_rate_data: Option>, +} +impl<'a> CreateInvoiceShippingCost<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// Parameters to create a new ad-hoc shipping rate for this order. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreateInvoiceShippingCostShippingRateData<'a> { + /// The estimated range for how long shipping will take, meant to be displayable to the customer. + /// This will appear on CheckoutSessions. + #[serde(skip_serializing_if = "Option::is_none")] + pub delivery_estimate: Option, + /// The name of the shipping rate, meant to be displayable to the customer. + /// This will appear on CheckoutSessions. + pub display_name: &'a str, + /// Describes a fixed amount to charge for shipping. Must be present if type is `fixed_amount`. + #[serde(skip_serializing_if = "Option::is_none")] + pub fixed_amount: Option>, + /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. + /// This can be useful for storing additional information about the object in a structured format. + /// Individual keys can be unset by posting an empty value to them. + /// All keys can be unset by posting an empty value to `metadata`. + #[serde(skip_serializing_if = "Option::is_none")] + pub metadata: Option<&'a std::collections::HashMap>, + /// Specifies whether the rate is considered inclusive of taxes or exclusive of taxes. + /// One of `inclusive`, `exclusive`, or `unspecified`. + #[serde(skip_serializing_if = "Option::is_none")] + pub tax_behavior: Option, + /// A [tax code](https://stripe.com/docs/tax/tax-categories) ID. + /// The Shipping tax code is `txcd_92010001`. + #[serde(skip_serializing_if = "Option::is_none")] + pub tax_code: Option<&'a str>, + /// The type of calculation to use on the shipping rate. Can only be `fixed_amount` for now. + #[serde(rename = "type")] + #[serde(skip_serializing_if = "Option::is_none")] + pub type_: Option, +} +impl<'a> CreateInvoiceShippingCostShippingRateData<'a> { + pub fn new(display_name: &'a str) -> Self { + Self { + delivery_estimate: None, + display_name, + fixed_amount: None, + metadata: None, + tax_behavior: None, + tax_code: None, + type_: None, + } + } +} +/// The estimated range for how long shipping will take, meant to be displayable to the customer. +/// This will appear on CheckoutSessions. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreateInvoiceShippingCostShippingRateDataDeliveryEstimate { + /// The upper bound of the estimated range. If empty, represents no upper bound i.e., infinite. + #[serde(skip_serializing_if = "Option::is_none")] + pub maximum: Option, + /// The lower bound of the estimated range. If empty, represents no lower bound. + #[serde(skip_serializing_if = "Option::is_none")] + pub minimum: Option, +} +impl CreateInvoiceShippingCostShippingRateDataDeliveryEstimate { + pub fn new() -> Self { + Self::default() + } +} +/// The upper bound of the estimated range. If empty, represents no upper bound i.e., infinite. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreateInvoiceShippingCostShippingRateDataDeliveryEstimateMaximum { + /// A unit of time. + pub unit: CreateInvoiceShippingCostShippingRateDataDeliveryEstimateMaximumUnit, + /// Must be greater than 0. + pub value: i64, +} +impl CreateInvoiceShippingCostShippingRateDataDeliveryEstimateMaximum { + pub fn new( + unit: CreateInvoiceShippingCostShippingRateDataDeliveryEstimateMaximumUnit, + value: i64, + ) -> Self { + Self { unit, value } + } +} +/// A unit of time. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreateInvoiceShippingCostShippingRateDataDeliveryEstimateMaximumUnit { + BusinessDay, + Day, + Hour, + Month, + Week, +} +impl CreateInvoiceShippingCostShippingRateDataDeliveryEstimateMaximumUnit { + pub fn as_str(self) -> &'static str { + use CreateInvoiceShippingCostShippingRateDataDeliveryEstimateMaximumUnit::*; + match self { + BusinessDay => "business_day", + Day => "day", + Hour => "hour", + Month => "month", + Week => "week", + } + } +} + +impl std::str::FromStr for CreateInvoiceShippingCostShippingRateDataDeliveryEstimateMaximumUnit { + type Err = (); + fn from_str(s: &str) -> Result { + use CreateInvoiceShippingCostShippingRateDataDeliveryEstimateMaximumUnit::*; + match s { + "business_day" => Ok(BusinessDay), + "day" => Ok(Day), + "hour" => Ok(Hour), + "month" => Ok(Month), + "week" => Ok(Week), + _ => Err(()), + } + } +} +impl std::fmt::Display for CreateInvoiceShippingCostShippingRateDataDeliveryEstimateMaximumUnit { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreateInvoiceShippingCostShippingRateDataDeliveryEstimateMaximumUnit { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreateInvoiceShippingCostShippingRateDataDeliveryEstimateMaximumUnit { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// The lower bound of the estimated range. If empty, represents no lower bound. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreateInvoiceShippingCostShippingRateDataDeliveryEstimateMinimum { + /// A unit of time. + pub unit: CreateInvoiceShippingCostShippingRateDataDeliveryEstimateMinimumUnit, + /// Must be greater than 0. + pub value: i64, +} +impl CreateInvoiceShippingCostShippingRateDataDeliveryEstimateMinimum { + pub fn new( + unit: CreateInvoiceShippingCostShippingRateDataDeliveryEstimateMinimumUnit, + value: i64, + ) -> Self { + Self { unit, value } + } +} +/// A unit of time. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreateInvoiceShippingCostShippingRateDataDeliveryEstimateMinimumUnit { + BusinessDay, + Day, + Hour, + Month, + Week, +} +impl CreateInvoiceShippingCostShippingRateDataDeliveryEstimateMinimumUnit { + pub fn as_str(self) -> &'static str { + use CreateInvoiceShippingCostShippingRateDataDeliveryEstimateMinimumUnit::*; + match self { + BusinessDay => "business_day", + Day => "day", + Hour => "hour", + Month => "month", + Week => "week", + } + } +} + +impl std::str::FromStr for CreateInvoiceShippingCostShippingRateDataDeliveryEstimateMinimumUnit { + type Err = (); + fn from_str(s: &str) -> Result { + use CreateInvoiceShippingCostShippingRateDataDeliveryEstimateMinimumUnit::*; + match s { + "business_day" => Ok(BusinessDay), + "day" => Ok(Day), + "hour" => Ok(Hour), + "month" => Ok(Month), + "week" => Ok(Week), + _ => Err(()), + } + } +} +impl std::fmt::Display for CreateInvoiceShippingCostShippingRateDataDeliveryEstimateMinimumUnit { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreateInvoiceShippingCostShippingRateDataDeliveryEstimateMinimumUnit { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreateInvoiceShippingCostShippingRateDataDeliveryEstimateMinimumUnit { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Describes a fixed amount to charge for shipping. Must be present if type is `fixed_amount`. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreateInvoiceShippingCostShippingRateDataFixedAmount<'a> { + /// A non-negative integer in cents representing how much to charge. + pub amount: i64, + /// Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. + /// Must be a [supported currency](https://stripe.com/docs/currencies). + pub currency: stripe_types::Currency, + /// Shipping rates defined in each available currency option. + /// Each key must be a three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html) and a [supported currency](https://stripe.com/docs/currencies). + #[serde(skip_serializing_if = "Option::is_none")] + pub currency_options: Option< + &'a std::collections::HashMap< + stripe_types::Currency, + CreateInvoiceShippingCostShippingRateDataFixedAmountCurrencyOptions, + >, + >, +} +impl<'a> CreateInvoiceShippingCostShippingRateDataFixedAmount<'a> { + pub fn new(amount: i64, currency: stripe_types::Currency) -> Self { + Self { amount, currency, currency_options: None } + } +} +/// Shipping rates defined in each available currency option. +/// Each key must be a three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html) and a [supported currency](https://stripe.com/docs/currencies). +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreateInvoiceShippingCostShippingRateDataFixedAmountCurrencyOptions { + /// A non-negative integer in cents representing how much to charge. + pub amount: i64, + /// Specifies whether the rate is considered inclusive of taxes or exclusive of taxes. + /// One of `inclusive`, `exclusive`, or `unspecified`. + #[serde(skip_serializing_if = "Option::is_none")] + pub tax_behavior: + Option, +} +impl CreateInvoiceShippingCostShippingRateDataFixedAmountCurrencyOptions { + pub fn new(amount: i64) -> Self { + Self { amount, tax_behavior: None } + } +} +/// Specifies whether the rate is considered inclusive of taxes or exclusive of taxes. +/// One of `inclusive`, `exclusive`, or `unspecified`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreateInvoiceShippingCostShippingRateDataFixedAmountCurrencyOptionsTaxBehavior { + Exclusive, + Inclusive, + Unspecified, +} +impl CreateInvoiceShippingCostShippingRateDataFixedAmountCurrencyOptionsTaxBehavior { + pub fn as_str(self) -> &'static str { + use CreateInvoiceShippingCostShippingRateDataFixedAmountCurrencyOptionsTaxBehavior::*; + match self { + Exclusive => "exclusive", + Inclusive => "inclusive", + Unspecified => "unspecified", + } + } +} + +impl std::str::FromStr + for CreateInvoiceShippingCostShippingRateDataFixedAmountCurrencyOptionsTaxBehavior +{ + type Err = (); + fn from_str(s: &str) -> Result { + use CreateInvoiceShippingCostShippingRateDataFixedAmountCurrencyOptionsTaxBehavior::*; + match s { + "exclusive" => Ok(Exclusive), + "inclusive" => Ok(Inclusive), + "unspecified" => Ok(Unspecified), + _ => Err(()), + } + } +} +impl std::fmt::Display + for CreateInvoiceShippingCostShippingRateDataFixedAmountCurrencyOptionsTaxBehavior +{ + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug + for CreateInvoiceShippingCostShippingRateDataFixedAmountCurrencyOptionsTaxBehavior +{ + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize + for CreateInvoiceShippingCostShippingRateDataFixedAmountCurrencyOptionsTaxBehavior +{ + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Specifies whether the rate is considered inclusive of taxes or exclusive of taxes. +/// One of `inclusive`, `exclusive`, or `unspecified`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreateInvoiceShippingCostShippingRateDataTaxBehavior { + Exclusive, + Inclusive, + Unspecified, +} +impl CreateInvoiceShippingCostShippingRateDataTaxBehavior { + pub fn as_str(self) -> &'static str { + use CreateInvoiceShippingCostShippingRateDataTaxBehavior::*; + match self { + Exclusive => "exclusive", + Inclusive => "inclusive", + Unspecified => "unspecified", + } + } +} + +impl std::str::FromStr for CreateInvoiceShippingCostShippingRateDataTaxBehavior { + type Err = (); + fn from_str(s: &str) -> Result { + use CreateInvoiceShippingCostShippingRateDataTaxBehavior::*; + match s { + "exclusive" => Ok(Exclusive), + "inclusive" => Ok(Inclusive), + "unspecified" => Ok(Unspecified), + _ => Err(()), + } + } +} +impl std::fmt::Display for CreateInvoiceShippingCostShippingRateDataTaxBehavior { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreateInvoiceShippingCostShippingRateDataTaxBehavior { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreateInvoiceShippingCostShippingRateDataTaxBehavior { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// The type of calculation to use on the shipping rate. Can only be `fixed_amount` for now. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreateInvoiceShippingCostShippingRateDataType { + FixedAmount, +} +impl CreateInvoiceShippingCostShippingRateDataType { + pub fn as_str(self) -> &'static str { + use CreateInvoiceShippingCostShippingRateDataType::*; + match self { + FixedAmount => "fixed_amount", + } + } +} + +impl std::str::FromStr for CreateInvoiceShippingCostShippingRateDataType { + type Err = (); + fn from_str(s: &str) -> Result { + use CreateInvoiceShippingCostShippingRateDataType::*; + match s { + "fixed_amount" => Ok(FixedAmount), + _ => Err(()), + } + } +} +impl std::fmt::Display for CreateInvoiceShippingCostShippingRateDataType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreateInvoiceShippingCostShippingRateDataType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreateInvoiceShippingCostShippingRateDataType { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'a> CreateInvoice<'a> { + /// This endpoint creates a draft invoice for a given customer. + /// The invoice remains a draft until you [finalize](https://stripe.com/docs/api#finalize_invoice) the invoice, which allows you to [pay](https://stripe.com/docs/api#pay_invoice) or [send](https://stripe.com/docs/api#send_invoice) the invoice to your customers. + pub fn send(&self, client: &stripe::Client) -> stripe::Response { + client.send_form("/invoices", self, http_types::Method::Post) + } +} +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdateInvoice<'a> { + /// The account tax IDs associated with the invoice. Only editable when the invoice is a draft. + #[serde(skip_serializing_if = "Option::is_none")] + pub account_tax_ids: Option<&'a [&'a str]>, + /// A fee in cents (or local equivalent) that will be applied to the invoice and transferred to the application owner's Stripe account. + /// The request must be made with an OAuth key or the Stripe-Account header in order to take an application fee. + /// For more information, see the application fees [documentation](https://stripe.com/docs/billing/invoices/connect#collecting-fees). + #[serde(skip_serializing_if = "Option::is_none")] + pub application_fee_amount: Option, + /// Controls whether Stripe performs [automatic collection](https://stripe.com/docs/invoicing/integration/automatic-advancement-collection) of the invoice. + #[serde(skip_serializing_if = "Option::is_none")] + pub auto_advance: Option, + /// Settings for automatic tax lookup for this invoice. + #[serde(skip_serializing_if = "Option::is_none")] + pub automatic_tax: Option>, + /// Either `charge_automatically` or `send_invoice`. + /// This field can be updated only on `draft` invoices. + #[serde(skip_serializing_if = "Option::is_none")] + pub collection_method: Option, + /// A list of up to 4 custom fields to be displayed on the invoice. + /// If a value for `custom_fields` is specified, the list specified will replace the existing custom field list on this invoice. + /// Pass an empty string to remove previously-defined fields. + #[serde(skip_serializing_if = "Option::is_none")] + pub custom_fields: Option<&'a [CustomFieldParams<'a>]>, + /// The number of days from which the invoice is created until it is due. + /// Only valid for invoices where `collection_method=send_invoice`. + /// This field can only be updated on `draft` invoices. + #[serde(skip_serializing_if = "Option::is_none")] + pub days_until_due: Option, + /// ID of the default payment method for the invoice. + /// It must belong to the customer associated with the invoice. + /// If not set, defaults to the subscription's default payment method, if any, or to the default payment method in the customer's invoice settings. + #[serde(skip_serializing_if = "Option::is_none")] + pub default_payment_method: Option<&'a str>, + /// ID of the default payment source for the invoice. + /// It must belong to the customer associated with the invoice and be in a chargeable state. + /// If not set, defaults to the subscription's default source, if any, or to the customer's default source. + #[serde(skip_serializing_if = "Option::is_none")] + pub default_source: Option<&'a str>, + /// The tax rates that will apply to any line item that does not have `tax_rates` set. + /// Pass an empty string to remove previously-defined tax rates. + #[serde(skip_serializing_if = "Option::is_none")] + pub default_tax_rates: Option<&'a [&'a str]>, + /// An arbitrary string attached to the object. + /// Often useful for displaying to users. + /// Referenced as 'memo' in the Dashboard. + #[serde(skip_serializing_if = "Option::is_none")] + pub description: Option<&'a str>, + /// The discounts that will apply to the invoice. + /// Pass an empty string to remove previously-defined discounts. + #[serde(skip_serializing_if = "Option::is_none")] + pub discounts: Option<&'a [UpdateInvoiceDiscounts<'a>]>, + /// The date on which payment for this invoice is due. + /// Only valid for invoices where `collection_method=send_invoice`. + /// This field can only be updated on `draft` invoices. + #[serde(skip_serializing_if = "Option::is_none")] + pub due_date: Option, + /// The date when this invoice is in effect. + /// Same as `finalized_at` unless overwritten. + /// When defined, this value replaces the system-generated 'Date of issue' printed on the invoice PDF and receipt. + #[serde(skip_serializing_if = "Option::is_none")] + pub effective_at: Option, + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, + /// Footer to be displayed on the invoice. + #[serde(skip_serializing_if = "Option::is_none")] + pub footer: Option<&'a str>, + /// The connected account that issues the invoice. + /// The invoice is presented with the branding and support information of the specified account. + #[serde(skip_serializing_if = "Option::is_none")] + pub issuer: Option>, + /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. + /// This can be useful for storing additional information about the object in a structured format. + /// Individual keys can be unset by posting an empty value to them. + /// All keys can be unset by posting an empty value to `metadata`. + #[serde(skip_serializing_if = "Option::is_none")] + pub metadata: Option<&'a std::collections::HashMap>, + /// The account (if any) for which the funds of the invoice payment are intended. + /// If set, the invoice will be presented with the branding and support information of the specified account. + /// See the [Invoices with Connect](https://stripe.com/docs/billing/invoices/connect) documentation for details. + #[serde(skip_serializing_if = "Option::is_none")] + pub on_behalf_of: Option<&'a str>, + /// Configuration settings for the PaymentIntent that is generated when the invoice is finalized. + #[serde(skip_serializing_if = "Option::is_none")] + pub payment_settings: Option>, + /// The rendering-related settings that control how the invoice is displayed on customer-facing surfaces such as PDF and Hosted Invoice Page. + #[serde(skip_serializing_if = "Option::is_none")] + pub rendering: Option, + /// This is a legacy field that will be removed soon. + /// For details about `rendering_options`, refer to `rendering` instead. + /// Options for invoice PDF rendering. + #[serde(skip_serializing_if = "Option::is_none")] + pub rendering_options: Option, + /// Settings for the cost of shipping for this invoice. + #[serde(skip_serializing_if = "Option::is_none")] + pub shipping_cost: Option>, + /// Shipping details for the invoice. + /// The Invoice PDF will use the `shipping_details` value if it is set, otherwise the PDF will render the shipping address from the customer. + #[serde(skip_serializing_if = "Option::is_none")] + pub shipping_details: Option>, + /// Extra information about a charge for the customer's credit card statement. + /// It must contain at least one letter. + /// If not specified and this invoice is part of a subscription, the default `statement_descriptor` will be set to the first subscription item's product's `statement_descriptor`. + #[serde(skip_serializing_if = "Option::is_none")] + pub statement_descriptor: Option<&'a str>, + /// If specified, the funds from the invoice will be transferred to the destination and the ID of the resulting transfer will be found on the invoice's charge. + /// This will be unset if you POST an empty value. + #[serde(skip_serializing_if = "Option::is_none")] + pub transfer_data: Option>, +} +impl<'a> UpdateInvoice<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// Settings for automatic tax lookup for this invoice. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct UpdateInvoiceAutomaticTax<'a> { + /// Whether Stripe automatically computes tax on this invoice. + /// Note that incompatible invoice items (invoice items with manually specified [tax rates](https://stripe.com/docs/api/tax_rates), negative amounts, or `tax_behavior=unspecified`) cannot be added to automatic tax invoices. + pub enabled: bool, + /// The account that's liable for tax. + /// If set, the business address and tax registrations required to perform the tax calculation are loaded from this account. + /// The tax transaction is returned in the report of the connected account. + #[serde(skip_serializing_if = "Option::is_none")] + pub liability: Option>, +} +impl<'a> UpdateInvoiceAutomaticTax<'a> { + pub fn new(enabled: bool) -> Self { + Self { enabled, liability: None } + } +} +/// The account that's liable for tax. +/// If set, the business address and tax registrations required to perform the tax calculation are loaded from this account. +/// The tax transaction is returned in the report of the connected account. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct UpdateInvoiceAutomaticTaxLiability<'a> { + /// The connected account being referenced when `type` is `account`. + #[serde(skip_serializing_if = "Option::is_none")] + pub account: Option<&'a str>, + /// Type of the account referenced in the request. + #[serde(rename = "type")] + pub type_: UpdateInvoiceAutomaticTaxLiabilityType, +} +impl<'a> UpdateInvoiceAutomaticTaxLiability<'a> { + pub fn new(type_: UpdateInvoiceAutomaticTaxLiabilityType) -> Self { + Self { account: None, type_ } + } +} +/// Type of the account referenced in the request. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum UpdateInvoiceAutomaticTaxLiabilityType { + Account, + Self_, +} +impl UpdateInvoiceAutomaticTaxLiabilityType { + pub fn as_str(self) -> &'static str { + use UpdateInvoiceAutomaticTaxLiabilityType::*; + match self { + Account => "account", + Self_ => "self", + } + } +} + +impl std::str::FromStr for UpdateInvoiceAutomaticTaxLiabilityType { + type Err = (); + fn from_str(s: &str) -> Result { + use UpdateInvoiceAutomaticTaxLiabilityType::*; + match s { + "account" => Ok(Account), + "self" => Ok(Self_), + _ => Err(()), + } + } +} +impl std::fmt::Display for UpdateInvoiceAutomaticTaxLiabilityType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for UpdateInvoiceAutomaticTaxLiabilityType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for UpdateInvoiceAutomaticTaxLiabilityType { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// The discounts that will apply to the invoice. +/// Pass an empty string to remove previously-defined discounts. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdateInvoiceDiscounts<'a> { + /// ID of the coupon to create a new discount for. + #[serde(skip_serializing_if = "Option::is_none")] + pub coupon: Option<&'a str>, + /// ID of an existing discount on the object (or one of its ancestors) to reuse. + #[serde(skip_serializing_if = "Option::is_none")] + pub discount: Option<&'a str>, +} +impl<'a> UpdateInvoiceDiscounts<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// The connected account that issues the invoice. +/// The invoice is presented with the branding and support information of the specified account. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct UpdateInvoiceIssuer<'a> { + /// The connected account being referenced when `type` is `account`. + #[serde(skip_serializing_if = "Option::is_none")] + pub account: Option<&'a str>, + /// Type of the account referenced in the request. + #[serde(rename = "type")] + pub type_: UpdateInvoiceIssuerType, +} +impl<'a> UpdateInvoiceIssuer<'a> { + pub fn new(type_: UpdateInvoiceIssuerType) -> Self { + Self { account: None, type_ } + } +} +/// Type of the account referenced in the request. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum UpdateInvoiceIssuerType { + Account, + Self_, +} +impl UpdateInvoiceIssuerType { + pub fn as_str(self) -> &'static str { + use UpdateInvoiceIssuerType::*; + match self { + Account => "account", + Self_ => "self", + } + } +} + +impl std::str::FromStr for UpdateInvoiceIssuerType { + type Err = (); + fn from_str(s: &str) -> Result { + use UpdateInvoiceIssuerType::*; + match s { + "account" => Ok(Account), + "self" => Ok(Self_), + _ => Err(()), + } + } +} +impl std::fmt::Display for UpdateInvoiceIssuerType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for UpdateInvoiceIssuerType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for UpdateInvoiceIssuerType { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Configuration settings for the PaymentIntent that is generated when the invoice is finalized. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdateInvoicePaymentSettings<'a> { + /// ID of the mandate to be used for this invoice. + /// It must correspond to the payment method used to pay the invoice, including the invoice's default_payment_method or default_source, if set. + #[serde(skip_serializing_if = "Option::is_none")] + pub default_mandate: Option<&'a str>, + /// Payment-method-specific configuration to provide to the invoice’s PaymentIntent. + #[serde(skip_serializing_if = "Option::is_none")] + pub payment_method_options: Option>, + /// The list of payment method types (e.g. + /// card) to provide to the invoice’s PaymentIntent. + /// If not set, Stripe attempts to automatically determine the types to use by looking at the invoice’s default payment method, the subscription’s default payment method, the customer’s default payment method, and your [invoice template settings](https://dashboard.stripe.com/settings/billing/invoice). + #[serde(skip_serializing_if = "Option::is_none")] + pub payment_method_types: Option<&'a [UpdateInvoicePaymentSettingsPaymentMethodTypes]>, +} +impl<'a> UpdateInvoicePaymentSettings<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// Payment-method-specific configuration to provide to the invoice’s PaymentIntent. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdateInvoicePaymentSettingsPaymentMethodOptions<'a> { + /// If paying by `acss_debit`, this sub-hash contains details about the Canadian pre-authorized debit payment method options to pass to the invoice’s PaymentIntent. + #[serde(skip_serializing_if = "Option::is_none")] + pub acss_debit: Option, + /// If paying by `bancontact`, this sub-hash contains details about the Bancontact payment method options to pass to the invoice’s PaymentIntent. + #[serde(skip_serializing_if = "Option::is_none")] + pub bancontact: Option, + /// If paying by `card`, this sub-hash contains details about the Card payment method options to pass to the invoice’s PaymentIntent. + #[serde(skip_serializing_if = "Option::is_none")] + pub card: Option, + /// If paying by `customer_balance`, this sub-hash contains details about the Bank transfer payment method options to pass to the invoice’s PaymentIntent. + #[serde(skip_serializing_if = "Option::is_none")] + pub customer_balance: Option>, + /// If paying by `konbini`, this sub-hash contains details about the Konbini payment method options to pass to the invoice’s PaymentIntent. + #[serde(skip_serializing_if = "Option::is_none")] + pub konbini: Option<&'a serde_json::Value>, + /// If paying by `us_bank_account`, this sub-hash contains details about the ACH direct debit payment method options to pass to the invoice’s PaymentIntent. + #[serde(skip_serializing_if = "Option::is_none")] + pub us_bank_account: Option>, +} +impl<'a> UpdateInvoicePaymentSettingsPaymentMethodOptions<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// If paying by `acss_debit`, this sub-hash contains details about the Canadian pre-authorized debit payment method options to pass to the invoice’s PaymentIntent. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdateInvoicePaymentSettingsPaymentMethodOptionsAcssDebit { + /// Additional fields for Mandate creation + #[serde(skip_serializing_if = "Option::is_none")] + pub mandate_options: + Option, + /// Verification method for the intent + #[serde(skip_serializing_if = "Option::is_none")] + pub verification_method: + Option, +} +impl UpdateInvoicePaymentSettingsPaymentMethodOptionsAcssDebit { + pub fn new() -> Self { + Self::default() + } +} +/// Additional fields for Mandate creation +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdateInvoicePaymentSettingsPaymentMethodOptionsAcssDebitMandateOptions { + /// Transaction type of the mandate. + #[serde(skip_serializing_if = "Option::is_none")] + pub transaction_type: Option< + UpdateInvoicePaymentSettingsPaymentMethodOptionsAcssDebitMandateOptionsTransactionType, + >, +} +impl UpdateInvoicePaymentSettingsPaymentMethodOptionsAcssDebitMandateOptions { + pub fn new() -> Self { + Self::default() + } +} +/// Transaction type of the mandate. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum UpdateInvoicePaymentSettingsPaymentMethodOptionsAcssDebitMandateOptionsTransactionType { + Business, + Personal, +} +impl UpdateInvoicePaymentSettingsPaymentMethodOptionsAcssDebitMandateOptionsTransactionType { + pub fn as_str(self) -> &'static str { + use UpdateInvoicePaymentSettingsPaymentMethodOptionsAcssDebitMandateOptionsTransactionType::*; + match self { + Business => "business", + Personal => "personal", + } + } +} + +impl std::str::FromStr + for UpdateInvoicePaymentSettingsPaymentMethodOptionsAcssDebitMandateOptionsTransactionType +{ + type Err = (); + fn from_str(s: &str) -> Result { + use UpdateInvoicePaymentSettingsPaymentMethodOptionsAcssDebitMandateOptionsTransactionType::*; + match s { + "business" => Ok(Business), + "personal" => Ok(Personal), + _ => Err(()), + } + } +} +impl std::fmt::Display + for UpdateInvoicePaymentSettingsPaymentMethodOptionsAcssDebitMandateOptionsTransactionType +{ + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug + for UpdateInvoicePaymentSettingsPaymentMethodOptionsAcssDebitMandateOptionsTransactionType +{ + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize + for UpdateInvoicePaymentSettingsPaymentMethodOptionsAcssDebitMandateOptionsTransactionType +{ + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Verification method for the intent +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum UpdateInvoicePaymentSettingsPaymentMethodOptionsAcssDebitVerificationMethod { + Automatic, + Instant, + Microdeposits, +} +impl UpdateInvoicePaymentSettingsPaymentMethodOptionsAcssDebitVerificationMethod { + pub fn as_str(self) -> &'static str { + use UpdateInvoicePaymentSettingsPaymentMethodOptionsAcssDebitVerificationMethod::*; + match self { + Automatic => "automatic", + Instant => "instant", + Microdeposits => "microdeposits", + } + } +} + +impl std::str::FromStr + for UpdateInvoicePaymentSettingsPaymentMethodOptionsAcssDebitVerificationMethod +{ + type Err = (); + fn from_str(s: &str) -> Result { + use UpdateInvoicePaymentSettingsPaymentMethodOptionsAcssDebitVerificationMethod::*; + match s { + "automatic" => Ok(Automatic), + "instant" => Ok(Instant), + "microdeposits" => Ok(Microdeposits), + _ => Err(()), + } + } +} +impl std::fmt::Display + for UpdateInvoicePaymentSettingsPaymentMethodOptionsAcssDebitVerificationMethod +{ + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug + for UpdateInvoicePaymentSettingsPaymentMethodOptionsAcssDebitVerificationMethod +{ + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize + for UpdateInvoicePaymentSettingsPaymentMethodOptionsAcssDebitVerificationMethod +{ + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// If paying by `bancontact`, this sub-hash contains details about the Bancontact payment method options to pass to the invoice’s PaymentIntent. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdateInvoicePaymentSettingsPaymentMethodOptionsBancontact { + /// Preferred language of the Bancontact authorization page that the customer is redirected to. + #[serde(skip_serializing_if = "Option::is_none")] + pub preferred_language: + Option, +} +impl UpdateInvoicePaymentSettingsPaymentMethodOptionsBancontact { + pub fn new() -> Self { + Self::default() + } +} +/// Preferred language of the Bancontact authorization page that the customer is redirected to. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum UpdateInvoicePaymentSettingsPaymentMethodOptionsBancontactPreferredLanguage { + De, + En, + Fr, + Nl, +} +impl UpdateInvoicePaymentSettingsPaymentMethodOptionsBancontactPreferredLanguage { + pub fn as_str(self) -> &'static str { + use UpdateInvoicePaymentSettingsPaymentMethodOptionsBancontactPreferredLanguage::*; + match self { + De => "de", + En => "en", + Fr => "fr", + Nl => "nl", + } + } +} + +impl std::str::FromStr + for UpdateInvoicePaymentSettingsPaymentMethodOptionsBancontactPreferredLanguage +{ + type Err = (); + fn from_str(s: &str) -> Result { + use UpdateInvoicePaymentSettingsPaymentMethodOptionsBancontactPreferredLanguage::*; + match s { + "de" => Ok(De), + "en" => Ok(En), + "fr" => Ok(Fr), + "nl" => Ok(Nl), + _ => Err(()), + } + } +} +impl std::fmt::Display + for UpdateInvoicePaymentSettingsPaymentMethodOptionsBancontactPreferredLanguage +{ + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug + for UpdateInvoicePaymentSettingsPaymentMethodOptionsBancontactPreferredLanguage +{ + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize + for UpdateInvoicePaymentSettingsPaymentMethodOptionsBancontactPreferredLanguage +{ + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// If paying by `card`, this sub-hash contains details about the Card payment method options to pass to the invoice’s PaymentIntent. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdateInvoicePaymentSettingsPaymentMethodOptionsCard { + /// Installment configuration for payments attempted on this invoice (Mexico Only). + /// + /// For more information, see the [installments integration guide](https://stripe.com/docs/payments/installments). + #[serde(skip_serializing_if = "Option::is_none")] + pub installments: Option, + /// We strongly recommend that you rely on our SCA Engine to automatically prompt your customers for authentication based on risk level and [other requirements](https://stripe.com/docs/strong-customer-authentication). + /// However, if you wish to request 3D Secure based on logic from your own fraud engine, provide this option. + /// Read our guide on [manually requesting 3D Secure](https://stripe.com/docs/payments/3d-secure#manual-three-ds) for more information on how this configuration interacts with Radar and our SCA Engine. + #[serde(skip_serializing_if = "Option::is_none")] + pub request_three_d_secure: + Option, +} +impl UpdateInvoicePaymentSettingsPaymentMethodOptionsCard { + pub fn new() -> Self { + Self::default() + } +} +/// Installment configuration for payments attempted on this invoice (Mexico Only). +/// +/// For more information, see the [installments integration guide](https://stripe.com/docs/payments/installments). +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdateInvoicePaymentSettingsPaymentMethodOptionsCardInstallments { + /// Setting to true enables installments for this invoice. + /// Setting to false will prevent any selected plan from applying to a payment. + #[serde(skip_serializing_if = "Option::is_none")] + pub enabled: Option, + /// The selected installment plan to use for this invoice. + #[serde(skip_serializing_if = "Option::is_none")] + pub plan: Option, +} +impl UpdateInvoicePaymentSettingsPaymentMethodOptionsCardInstallments { + pub fn new() -> Self { + Self::default() + } +} +/// The selected installment plan to use for this invoice. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct UpdateInvoicePaymentSettingsPaymentMethodOptionsCardInstallmentsPlan { + /// For `fixed_count` installment plans, this is the number of installment payments your customer will make to their credit card. + pub count: u64, + /// For `fixed_count` installment plans, this is the interval between installment payments your customer will make to their credit card. + /// One of `month`. + pub interval: UpdateInvoicePaymentSettingsPaymentMethodOptionsCardInstallmentsPlanInterval, + /// Type of installment plan, one of `fixed_count`. + #[serde(rename = "type")] + pub type_: UpdateInvoicePaymentSettingsPaymentMethodOptionsCardInstallmentsPlanType, +} +impl UpdateInvoicePaymentSettingsPaymentMethodOptionsCardInstallmentsPlan { + pub fn new( + count: u64, + interval: UpdateInvoicePaymentSettingsPaymentMethodOptionsCardInstallmentsPlanInterval, + type_: UpdateInvoicePaymentSettingsPaymentMethodOptionsCardInstallmentsPlanType, + ) -> Self { + Self { count, interval, type_ } + } +} +/// For `fixed_count` installment plans, this is the interval between installment payments your customer will make to their credit card. +/// One of `month`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum UpdateInvoicePaymentSettingsPaymentMethodOptionsCardInstallmentsPlanInterval { + Month, +} +impl UpdateInvoicePaymentSettingsPaymentMethodOptionsCardInstallmentsPlanInterval { + pub fn as_str(self) -> &'static str { + use UpdateInvoicePaymentSettingsPaymentMethodOptionsCardInstallmentsPlanInterval::*; + match self { + Month => "month", + } + } +} + +impl std::str::FromStr + for UpdateInvoicePaymentSettingsPaymentMethodOptionsCardInstallmentsPlanInterval +{ + type Err = (); + fn from_str(s: &str) -> Result { + use UpdateInvoicePaymentSettingsPaymentMethodOptionsCardInstallmentsPlanInterval::*; + match s { + "month" => Ok(Month), + _ => Err(()), + } + } +} +impl std::fmt::Display + for UpdateInvoicePaymentSettingsPaymentMethodOptionsCardInstallmentsPlanInterval +{ + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug + for UpdateInvoicePaymentSettingsPaymentMethodOptionsCardInstallmentsPlanInterval +{ + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize + for UpdateInvoicePaymentSettingsPaymentMethodOptionsCardInstallmentsPlanInterval +{ + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Type of installment plan, one of `fixed_count`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum UpdateInvoicePaymentSettingsPaymentMethodOptionsCardInstallmentsPlanType { + FixedCount, +} +impl UpdateInvoicePaymentSettingsPaymentMethodOptionsCardInstallmentsPlanType { + pub fn as_str(self) -> &'static str { + use UpdateInvoicePaymentSettingsPaymentMethodOptionsCardInstallmentsPlanType::*; + match self { + FixedCount => "fixed_count", + } + } +} + +impl std::str::FromStr + for UpdateInvoicePaymentSettingsPaymentMethodOptionsCardInstallmentsPlanType +{ + type Err = (); + fn from_str(s: &str) -> Result { + use UpdateInvoicePaymentSettingsPaymentMethodOptionsCardInstallmentsPlanType::*; + match s { + "fixed_count" => Ok(FixedCount), + _ => Err(()), + } + } +} +impl std::fmt::Display + for UpdateInvoicePaymentSettingsPaymentMethodOptionsCardInstallmentsPlanType +{ + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for UpdateInvoicePaymentSettingsPaymentMethodOptionsCardInstallmentsPlanType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for UpdateInvoicePaymentSettingsPaymentMethodOptionsCardInstallmentsPlanType { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// We strongly recommend that you rely on our SCA Engine to automatically prompt your customers for authentication based on risk level and [other requirements](https://stripe.com/docs/strong-customer-authentication). +/// However, if you wish to request 3D Secure based on logic from your own fraud engine, provide this option. +/// Read our guide on [manually requesting 3D Secure](https://stripe.com/docs/payments/3d-secure#manual-three-ds) for more information on how this configuration interacts with Radar and our SCA Engine. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum UpdateInvoicePaymentSettingsPaymentMethodOptionsCardRequestThreeDSecure { + Any, + Automatic, + Challenge, +} +impl UpdateInvoicePaymentSettingsPaymentMethodOptionsCardRequestThreeDSecure { + pub fn as_str(self) -> &'static str { + use UpdateInvoicePaymentSettingsPaymentMethodOptionsCardRequestThreeDSecure::*; + match self { + Any => "any", + Automatic => "automatic", + Challenge => "challenge", + } + } +} + +impl std::str::FromStr for UpdateInvoicePaymentSettingsPaymentMethodOptionsCardRequestThreeDSecure { + type Err = (); + fn from_str(s: &str) -> Result { + use UpdateInvoicePaymentSettingsPaymentMethodOptionsCardRequestThreeDSecure::*; + match s { + "any" => Ok(Any), + "automatic" => Ok(Automatic), + "challenge" => Ok(Challenge), + _ => Err(()), + } + } +} +impl std::fmt::Display for UpdateInvoicePaymentSettingsPaymentMethodOptionsCardRequestThreeDSecure { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for UpdateInvoicePaymentSettingsPaymentMethodOptionsCardRequestThreeDSecure { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for UpdateInvoicePaymentSettingsPaymentMethodOptionsCardRequestThreeDSecure { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// If paying by `us_bank_account`, this sub-hash contains details about the ACH direct debit payment method options to pass to the invoice’s PaymentIntent. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdateInvoicePaymentSettingsPaymentMethodOptionsUsBankAccount<'a> { + /// Additional fields for Financial Connections Session creation + #[serde(skip_serializing_if = "Option::is_none")] + pub financial_connections: Option< + UpdateInvoicePaymentSettingsPaymentMethodOptionsUsBankAccountFinancialConnections<'a>, + >, + /// Verification method for the intent + #[serde(skip_serializing_if = "Option::is_none")] + pub verification_method: + Option, +} +impl<'a> UpdateInvoicePaymentSettingsPaymentMethodOptionsUsBankAccount<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// Additional fields for Financial Connections Session creation +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdateInvoicePaymentSettingsPaymentMethodOptionsUsBankAccountFinancialConnections<'a> { + /// The list of permissions to request. + /// If this parameter is passed, the `payment_method` permission must be included. + /// Valid permissions include: `balances`, `ownership`, `payment_method`, and `transactions`. +#[serde(skip_serializing_if = "Option::is_none")] +pub permissions: Option<&'a [UpdateInvoicePaymentSettingsPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions]>, + /// List of data features that you would like to retrieve upon account creation. +#[serde(skip_serializing_if = "Option::is_none")] +pub prefetch: Option<&'a [UpdateInvoicePaymentSettingsPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch]>, + +} +impl<'a> UpdateInvoicePaymentSettingsPaymentMethodOptionsUsBankAccountFinancialConnections<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// The list of permissions to request. +/// If this parameter is passed, the `payment_method` permission must be included. +/// Valid permissions include: `balances`, `ownership`, `payment_method`, and `transactions`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum UpdateInvoicePaymentSettingsPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions +{ + Balances, + Ownership, + PaymentMethod, + Transactions, +} +impl UpdateInvoicePaymentSettingsPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions { + pub fn as_str(self) -> &'static str { + use UpdateInvoicePaymentSettingsPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions::*; + match self { + Balances => "balances", + Ownership => "ownership", + PaymentMethod => "payment_method", + Transactions => "transactions", + } + } +} + +impl std::str::FromStr + for UpdateInvoicePaymentSettingsPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions +{ + type Err = (); + fn from_str(s: &str) -> Result { + use UpdateInvoicePaymentSettingsPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions::*; + match s { + "balances" => Ok(Balances), + "ownership" => Ok(Ownership), + "payment_method" => Ok(PaymentMethod), + "transactions" => Ok(Transactions), + _ => Err(()), + } + } +} +impl std::fmt::Display + for UpdateInvoicePaymentSettingsPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions +{ + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug + for UpdateInvoicePaymentSettingsPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions +{ + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize + for UpdateInvoicePaymentSettingsPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions +{ + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// List of data features that you would like to retrieve upon account creation. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum UpdateInvoicePaymentSettingsPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch { + Balances, + Transactions, +} +impl UpdateInvoicePaymentSettingsPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch { + pub fn as_str(self) -> &'static str { + use UpdateInvoicePaymentSettingsPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch::*; + match self { + Balances => "balances", + Transactions => "transactions", + } + } +} + +impl std::str::FromStr + for UpdateInvoicePaymentSettingsPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch +{ + type Err = (); + fn from_str(s: &str) -> Result { + use UpdateInvoicePaymentSettingsPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch::*; + match s { + "balances" => Ok(Balances), + "transactions" => Ok(Transactions), + _ => Err(()), + } + } +} +impl std::fmt::Display + for UpdateInvoicePaymentSettingsPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch +{ + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug + for UpdateInvoicePaymentSettingsPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch +{ + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize + for UpdateInvoicePaymentSettingsPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch +{ + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Verification method for the intent +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum UpdateInvoicePaymentSettingsPaymentMethodOptionsUsBankAccountVerificationMethod { + Automatic, + Instant, + Microdeposits, +} +impl UpdateInvoicePaymentSettingsPaymentMethodOptionsUsBankAccountVerificationMethod { + pub fn as_str(self) -> &'static str { + use UpdateInvoicePaymentSettingsPaymentMethodOptionsUsBankAccountVerificationMethod::*; + match self { + Automatic => "automatic", + Instant => "instant", + Microdeposits => "microdeposits", + } + } +} + +impl std::str::FromStr + for UpdateInvoicePaymentSettingsPaymentMethodOptionsUsBankAccountVerificationMethod +{ + type Err = (); + fn from_str(s: &str) -> Result { + use UpdateInvoicePaymentSettingsPaymentMethodOptionsUsBankAccountVerificationMethod::*; + match s { + "automatic" => Ok(Automatic), + "instant" => Ok(Instant), + "microdeposits" => Ok(Microdeposits), + _ => Err(()), + } + } +} +impl std::fmt::Display + for UpdateInvoicePaymentSettingsPaymentMethodOptionsUsBankAccountVerificationMethod +{ + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug + for UpdateInvoicePaymentSettingsPaymentMethodOptionsUsBankAccountVerificationMethod +{ + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize + for UpdateInvoicePaymentSettingsPaymentMethodOptionsUsBankAccountVerificationMethod +{ + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// The list of payment method types (e.g. +/// card) to provide to the invoice’s PaymentIntent. +/// If not set, Stripe attempts to automatically determine the types to use by looking at the invoice’s default payment method, the subscription’s default payment method, the customer’s default payment method, and your [invoice template settings](https://dashboard.stripe.com/settings/billing/invoice). +#[derive(Copy, Clone, Eq, PartialEq)] +#[non_exhaustive] +pub enum UpdateInvoicePaymentSettingsPaymentMethodTypes { + AchCreditTransfer, + AchDebit, + AcssDebit, + AuBecsDebit, + BacsDebit, + Bancontact, + Boleto, + Card, + Cashapp, + CustomerBalance, + Eps, + Fpx, + Giropay, + Grabpay, + Ideal, + Konbini, + Link, + P24, + Paynow, + Paypal, + Promptpay, + SepaCreditTransfer, + SepaDebit, + Sofort, + UsBankAccount, + WechatPay, + /// An unrecognized value from Stripe. Should not be used as a request parameter. + Unknown, +} +impl UpdateInvoicePaymentSettingsPaymentMethodTypes { + pub fn as_str(self) -> &'static str { + use UpdateInvoicePaymentSettingsPaymentMethodTypes::*; + match self { + AchCreditTransfer => "ach_credit_transfer", + AchDebit => "ach_debit", + AcssDebit => "acss_debit", + AuBecsDebit => "au_becs_debit", + BacsDebit => "bacs_debit", + Bancontact => "bancontact", + Boleto => "boleto", + Card => "card", + Cashapp => "cashapp", + CustomerBalance => "customer_balance", + Eps => "eps", + Fpx => "fpx", + Giropay => "giropay", + Grabpay => "grabpay", + Ideal => "ideal", + Konbini => "konbini", + Link => "link", + P24 => "p24", + Paynow => "paynow", + Paypal => "paypal", + Promptpay => "promptpay", + SepaCreditTransfer => "sepa_credit_transfer", + SepaDebit => "sepa_debit", + Sofort => "sofort", + UsBankAccount => "us_bank_account", + WechatPay => "wechat_pay", + Unknown => "unknown", + } + } +} + +impl std::str::FromStr for UpdateInvoicePaymentSettingsPaymentMethodTypes { + type Err = (); + fn from_str(s: &str) -> Result { + use UpdateInvoicePaymentSettingsPaymentMethodTypes::*; + match s { + "ach_credit_transfer" => Ok(AchCreditTransfer), + "ach_debit" => Ok(AchDebit), + "acss_debit" => Ok(AcssDebit), + "au_becs_debit" => Ok(AuBecsDebit), + "bacs_debit" => Ok(BacsDebit), + "bancontact" => Ok(Bancontact), + "boleto" => Ok(Boleto), + "card" => Ok(Card), + "cashapp" => Ok(Cashapp), + "customer_balance" => Ok(CustomerBalance), + "eps" => Ok(Eps), + "fpx" => Ok(Fpx), + "giropay" => Ok(Giropay), + "grabpay" => Ok(Grabpay), + "ideal" => Ok(Ideal), + "konbini" => Ok(Konbini), + "link" => Ok(Link), + "p24" => Ok(P24), + "paynow" => Ok(Paynow), + "paypal" => Ok(Paypal), + "promptpay" => Ok(Promptpay), + "sepa_credit_transfer" => Ok(SepaCreditTransfer), + "sepa_debit" => Ok(SepaDebit), + "sofort" => Ok(Sofort), + "us_bank_account" => Ok(UsBankAccount), + "wechat_pay" => Ok(WechatPay), + _ => Err(()), + } + } +} +impl std::fmt::Display for UpdateInvoicePaymentSettingsPaymentMethodTypes { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for UpdateInvoicePaymentSettingsPaymentMethodTypes { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for UpdateInvoicePaymentSettingsPaymentMethodTypes { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// The rendering-related settings that control how the invoice is displayed on customer-facing surfaces such as PDF and Hosted Invoice Page. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdateInvoiceRendering { + /// How line-item prices and amounts will be displayed with respect to tax on invoice PDFs. + /// One of `exclude_tax` or `include_inclusive_tax`. + /// `include_inclusive_tax` will include inclusive tax (and exclude exclusive tax) in invoice PDF amounts. + /// `exclude_tax` will exclude all tax (inclusive and exclusive alike) from invoice PDF amounts. + #[serde(skip_serializing_if = "Option::is_none")] + pub amount_tax_display: Option, + /// Invoice pdf rendering options + #[serde(skip_serializing_if = "Option::is_none")] + pub pdf: Option, +} +impl UpdateInvoiceRendering { + pub fn new() -> Self { + Self::default() + } +} +/// How line-item prices and amounts will be displayed with respect to tax on invoice PDFs. +/// One of `exclude_tax` or `include_inclusive_tax`. +/// `include_inclusive_tax` will include inclusive tax (and exclude exclusive tax) in invoice PDF amounts. +/// `exclude_tax` will exclude all tax (inclusive and exclusive alike) from invoice PDF amounts. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum UpdateInvoiceRenderingAmountTaxDisplay { + ExcludeTax, + IncludeInclusiveTax, +} +impl UpdateInvoiceRenderingAmountTaxDisplay { + pub fn as_str(self) -> &'static str { + use UpdateInvoiceRenderingAmountTaxDisplay::*; + match self { + ExcludeTax => "exclude_tax", + IncludeInclusiveTax => "include_inclusive_tax", + } + } +} + +impl std::str::FromStr for UpdateInvoiceRenderingAmountTaxDisplay { + type Err = (); + fn from_str(s: &str) -> Result { + use UpdateInvoiceRenderingAmountTaxDisplay::*; + match s { + "exclude_tax" => Ok(ExcludeTax), + "include_inclusive_tax" => Ok(IncludeInclusiveTax), + _ => Err(()), + } + } +} +impl std::fmt::Display for UpdateInvoiceRenderingAmountTaxDisplay { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for UpdateInvoiceRenderingAmountTaxDisplay { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for UpdateInvoiceRenderingAmountTaxDisplay { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Invoice pdf rendering options +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdateInvoiceRenderingPdf { + /// Page size for invoice PDF. Can be set to `a4`, `letter`, or `auto`. + /// If set to `auto`, invoice PDF page size defaults to `a4` for customers with + /// Japanese locale and `letter` for customers with other locales. + #[serde(skip_serializing_if = "Option::is_none")] + pub page_size: Option, +} +impl UpdateInvoiceRenderingPdf { + pub fn new() -> Self { + Self::default() + } +} +/// Page size for invoice PDF. Can be set to `a4`, `letter`, or `auto`. +/// If set to `auto`, invoice PDF page size defaults to `a4` for customers with +/// Japanese locale and `letter` for customers with other locales. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum UpdateInvoiceRenderingPdfPageSize { + A4, + Auto, + Letter, +} +impl UpdateInvoiceRenderingPdfPageSize { + pub fn as_str(self) -> &'static str { + use UpdateInvoiceRenderingPdfPageSize::*; + match self { + A4 => "a4", + Auto => "auto", + Letter => "letter", + } + } +} + +impl std::str::FromStr for UpdateInvoiceRenderingPdfPageSize { + type Err = (); + fn from_str(s: &str) -> Result { + use UpdateInvoiceRenderingPdfPageSize::*; + match s { + "a4" => Ok(A4), + "auto" => Ok(Auto), + "letter" => Ok(Letter), + _ => Err(()), + } + } +} +impl std::fmt::Display for UpdateInvoiceRenderingPdfPageSize { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for UpdateInvoiceRenderingPdfPageSize { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for UpdateInvoiceRenderingPdfPageSize { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// This is a legacy field that will be removed soon. +/// For details about `rendering_options`, refer to `rendering` instead. +/// Options for invoice PDF rendering. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdateInvoiceRenderingOptions { + /// How line-item prices and amounts will be displayed with respect to tax on invoice PDFs. + /// One of `exclude_tax` or `include_inclusive_tax`. + /// `include_inclusive_tax` will include inclusive tax (and exclude exclusive tax) in invoice PDF amounts. + /// `exclude_tax` will exclude all tax (inclusive and exclusive alike) from invoice PDF amounts. + #[serde(skip_serializing_if = "Option::is_none")] + pub amount_tax_display: Option, +} +impl UpdateInvoiceRenderingOptions { + pub fn new() -> Self { + Self::default() + } +} +/// How line-item prices and amounts will be displayed with respect to tax on invoice PDFs. +/// One of `exclude_tax` or `include_inclusive_tax`. +/// `include_inclusive_tax` will include inclusive tax (and exclude exclusive tax) in invoice PDF amounts. +/// `exclude_tax` will exclude all tax (inclusive and exclusive alike) from invoice PDF amounts. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum UpdateInvoiceRenderingOptionsAmountTaxDisplay { + ExcludeTax, + IncludeInclusiveTax, +} +impl UpdateInvoiceRenderingOptionsAmountTaxDisplay { + pub fn as_str(self) -> &'static str { + use UpdateInvoiceRenderingOptionsAmountTaxDisplay::*; + match self { + ExcludeTax => "exclude_tax", + IncludeInclusiveTax => "include_inclusive_tax", + } + } +} + +impl std::str::FromStr for UpdateInvoiceRenderingOptionsAmountTaxDisplay { + type Err = (); + fn from_str(s: &str) -> Result { + use UpdateInvoiceRenderingOptionsAmountTaxDisplay::*; + match s { + "exclude_tax" => Ok(ExcludeTax), + "include_inclusive_tax" => Ok(IncludeInclusiveTax), + _ => Err(()), + } + } +} +impl std::fmt::Display for UpdateInvoiceRenderingOptionsAmountTaxDisplay { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for UpdateInvoiceRenderingOptionsAmountTaxDisplay { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for UpdateInvoiceRenderingOptionsAmountTaxDisplay { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Settings for the cost of shipping for this invoice. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdateInvoiceShippingCost<'a> { + /// The ID of the shipping rate to use for this order. + #[serde(skip_serializing_if = "Option::is_none")] + pub shipping_rate: Option<&'a str>, + /// Parameters to create a new ad-hoc shipping rate for this order. + #[serde(skip_serializing_if = "Option::is_none")] + pub shipping_rate_data: Option>, +} +impl<'a> UpdateInvoiceShippingCost<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// Parameters to create a new ad-hoc shipping rate for this order. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct UpdateInvoiceShippingCostShippingRateData<'a> { + /// The estimated range for how long shipping will take, meant to be displayable to the customer. + /// This will appear on CheckoutSessions. + #[serde(skip_serializing_if = "Option::is_none")] + pub delivery_estimate: Option, + /// The name of the shipping rate, meant to be displayable to the customer. + /// This will appear on CheckoutSessions. + pub display_name: &'a str, + /// Describes a fixed amount to charge for shipping. Must be present if type is `fixed_amount`. + #[serde(skip_serializing_if = "Option::is_none")] + pub fixed_amount: Option>, + /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. + /// This can be useful for storing additional information about the object in a structured format. + /// Individual keys can be unset by posting an empty value to them. + /// All keys can be unset by posting an empty value to `metadata`. + #[serde(skip_serializing_if = "Option::is_none")] + pub metadata: Option<&'a std::collections::HashMap>, + /// Specifies whether the rate is considered inclusive of taxes or exclusive of taxes. + /// One of `inclusive`, `exclusive`, or `unspecified`. + #[serde(skip_serializing_if = "Option::is_none")] + pub tax_behavior: Option, + /// A [tax code](https://stripe.com/docs/tax/tax-categories) ID. + /// The Shipping tax code is `txcd_92010001`. + #[serde(skip_serializing_if = "Option::is_none")] + pub tax_code: Option<&'a str>, + /// The type of calculation to use on the shipping rate. Can only be `fixed_amount` for now. + #[serde(rename = "type")] + #[serde(skip_serializing_if = "Option::is_none")] + pub type_: Option, +} +impl<'a> UpdateInvoiceShippingCostShippingRateData<'a> { + pub fn new(display_name: &'a str) -> Self { + Self { + delivery_estimate: None, + display_name, + fixed_amount: None, + metadata: None, + tax_behavior: None, + tax_code: None, + type_: None, + } + } +} +/// The estimated range for how long shipping will take, meant to be displayable to the customer. +/// This will appear on CheckoutSessions. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdateInvoiceShippingCostShippingRateDataDeliveryEstimate { + /// The upper bound of the estimated range. If empty, represents no upper bound i.e., infinite. + #[serde(skip_serializing_if = "Option::is_none")] + pub maximum: Option, + /// The lower bound of the estimated range. If empty, represents no lower bound. + #[serde(skip_serializing_if = "Option::is_none")] + pub minimum: Option, +} +impl UpdateInvoiceShippingCostShippingRateDataDeliveryEstimate { + pub fn new() -> Self { + Self::default() + } +} +/// The upper bound of the estimated range. If empty, represents no upper bound i.e., infinite. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct UpdateInvoiceShippingCostShippingRateDataDeliveryEstimateMaximum { + /// A unit of time. + pub unit: UpdateInvoiceShippingCostShippingRateDataDeliveryEstimateMaximumUnit, + /// Must be greater than 0. + pub value: i64, +} +impl UpdateInvoiceShippingCostShippingRateDataDeliveryEstimateMaximum { + pub fn new( + unit: UpdateInvoiceShippingCostShippingRateDataDeliveryEstimateMaximumUnit, + value: i64, + ) -> Self { + Self { unit, value } + } +} +/// A unit of time. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum UpdateInvoiceShippingCostShippingRateDataDeliveryEstimateMaximumUnit { + BusinessDay, + Day, + Hour, + Month, + Week, +} +impl UpdateInvoiceShippingCostShippingRateDataDeliveryEstimateMaximumUnit { + pub fn as_str(self) -> &'static str { + use UpdateInvoiceShippingCostShippingRateDataDeliveryEstimateMaximumUnit::*; + match self { + BusinessDay => "business_day", + Day => "day", + Hour => "hour", + Month => "month", + Week => "week", + } + } +} + +impl std::str::FromStr for UpdateInvoiceShippingCostShippingRateDataDeliveryEstimateMaximumUnit { + type Err = (); + fn from_str(s: &str) -> Result { + use UpdateInvoiceShippingCostShippingRateDataDeliveryEstimateMaximumUnit::*; + match s { + "business_day" => Ok(BusinessDay), + "day" => Ok(Day), + "hour" => Ok(Hour), + "month" => Ok(Month), + "week" => Ok(Week), + _ => Err(()), + } + } +} +impl std::fmt::Display for UpdateInvoiceShippingCostShippingRateDataDeliveryEstimateMaximumUnit { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for UpdateInvoiceShippingCostShippingRateDataDeliveryEstimateMaximumUnit { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for UpdateInvoiceShippingCostShippingRateDataDeliveryEstimateMaximumUnit { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// The lower bound of the estimated range. If empty, represents no lower bound. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct UpdateInvoiceShippingCostShippingRateDataDeliveryEstimateMinimum { + /// A unit of time. + pub unit: UpdateInvoiceShippingCostShippingRateDataDeliveryEstimateMinimumUnit, + /// Must be greater than 0. + pub value: i64, +} +impl UpdateInvoiceShippingCostShippingRateDataDeliveryEstimateMinimum { + pub fn new( + unit: UpdateInvoiceShippingCostShippingRateDataDeliveryEstimateMinimumUnit, + value: i64, + ) -> Self { + Self { unit, value } + } +} +/// A unit of time. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum UpdateInvoiceShippingCostShippingRateDataDeliveryEstimateMinimumUnit { + BusinessDay, + Day, + Hour, + Month, + Week, +} +impl UpdateInvoiceShippingCostShippingRateDataDeliveryEstimateMinimumUnit { + pub fn as_str(self) -> &'static str { + use UpdateInvoiceShippingCostShippingRateDataDeliveryEstimateMinimumUnit::*; + match self { + BusinessDay => "business_day", + Day => "day", + Hour => "hour", + Month => "month", + Week => "week", + } + } +} + +impl std::str::FromStr for UpdateInvoiceShippingCostShippingRateDataDeliveryEstimateMinimumUnit { + type Err = (); + fn from_str(s: &str) -> Result { + use UpdateInvoiceShippingCostShippingRateDataDeliveryEstimateMinimumUnit::*; + match s { + "business_day" => Ok(BusinessDay), + "day" => Ok(Day), + "hour" => Ok(Hour), + "month" => Ok(Month), + "week" => Ok(Week), + _ => Err(()), + } + } +} +impl std::fmt::Display for UpdateInvoiceShippingCostShippingRateDataDeliveryEstimateMinimumUnit { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for UpdateInvoiceShippingCostShippingRateDataDeliveryEstimateMinimumUnit { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for UpdateInvoiceShippingCostShippingRateDataDeliveryEstimateMinimumUnit { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Describes a fixed amount to charge for shipping. Must be present if type is `fixed_amount`. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct UpdateInvoiceShippingCostShippingRateDataFixedAmount<'a> { + /// A non-negative integer in cents representing how much to charge. + pub amount: i64, + /// Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. + /// Must be a [supported currency](https://stripe.com/docs/currencies). + pub currency: stripe_types::Currency, + /// Shipping rates defined in each available currency option. + /// Each key must be a three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html) and a [supported currency](https://stripe.com/docs/currencies). + #[serde(skip_serializing_if = "Option::is_none")] + pub currency_options: Option< + &'a std::collections::HashMap< + stripe_types::Currency, + UpdateInvoiceShippingCostShippingRateDataFixedAmountCurrencyOptions, + >, + >, +} +impl<'a> UpdateInvoiceShippingCostShippingRateDataFixedAmount<'a> { + pub fn new(amount: i64, currency: stripe_types::Currency) -> Self { + Self { amount, currency, currency_options: None } + } +} +/// Shipping rates defined in each available currency option. +/// Each key must be a three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html) and a [supported currency](https://stripe.com/docs/currencies). +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct UpdateInvoiceShippingCostShippingRateDataFixedAmountCurrencyOptions { + /// A non-negative integer in cents representing how much to charge. + pub amount: i64, + /// Specifies whether the rate is considered inclusive of taxes or exclusive of taxes. + /// One of `inclusive`, `exclusive`, or `unspecified`. + #[serde(skip_serializing_if = "Option::is_none")] + pub tax_behavior: + Option, +} +impl UpdateInvoiceShippingCostShippingRateDataFixedAmountCurrencyOptions { + pub fn new(amount: i64) -> Self { + Self { amount, tax_behavior: None } + } +} +/// Specifies whether the rate is considered inclusive of taxes or exclusive of taxes. +/// One of `inclusive`, `exclusive`, or `unspecified`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum UpdateInvoiceShippingCostShippingRateDataFixedAmountCurrencyOptionsTaxBehavior { + Exclusive, + Inclusive, + Unspecified, +} +impl UpdateInvoiceShippingCostShippingRateDataFixedAmountCurrencyOptionsTaxBehavior { + pub fn as_str(self) -> &'static str { + use UpdateInvoiceShippingCostShippingRateDataFixedAmountCurrencyOptionsTaxBehavior::*; + match self { + Exclusive => "exclusive", + Inclusive => "inclusive", + Unspecified => "unspecified", + } + } +} + +impl std::str::FromStr + for UpdateInvoiceShippingCostShippingRateDataFixedAmountCurrencyOptionsTaxBehavior +{ + type Err = (); + fn from_str(s: &str) -> Result { + use UpdateInvoiceShippingCostShippingRateDataFixedAmountCurrencyOptionsTaxBehavior::*; + match s { + "exclusive" => Ok(Exclusive), + "inclusive" => Ok(Inclusive), + "unspecified" => Ok(Unspecified), + _ => Err(()), + } + } +} +impl std::fmt::Display + for UpdateInvoiceShippingCostShippingRateDataFixedAmountCurrencyOptionsTaxBehavior +{ + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug + for UpdateInvoiceShippingCostShippingRateDataFixedAmountCurrencyOptionsTaxBehavior +{ + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize + for UpdateInvoiceShippingCostShippingRateDataFixedAmountCurrencyOptionsTaxBehavior +{ + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Specifies whether the rate is considered inclusive of taxes or exclusive of taxes. +/// One of `inclusive`, `exclusive`, or `unspecified`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum UpdateInvoiceShippingCostShippingRateDataTaxBehavior { + Exclusive, + Inclusive, + Unspecified, +} +impl UpdateInvoiceShippingCostShippingRateDataTaxBehavior { + pub fn as_str(self) -> &'static str { + use UpdateInvoiceShippingCostShippingRateDataTaxBehavior::*; + match self { + Exclusive => "exclusive", + Inclusive => "inclusive", + Unspecified => "unspecified", + } + } +} + +impl std::str::FromStr for UpdateInvoiceShippingCostShippingRateDataTaxBehavior { + type Err = (); + fn from_str(s: &str) -> Result { + use UpdateInvoiceShippingCostShippingRateDataTaxBehavior::*; + match s { + "exclusive" => Ok(Exclusive), + "inclusive" => Ok(Inclusive), + "unspecified" => Ok(Unspecified), + _ => Err(()), + } + } +} +impl std::fmt::Display for UpdateInvoiceShippingCostShippingRateDataTaxBehavior { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for UpdateInvoiceShippingCostShippingRateDataTaxBehavior { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for UpdateInvoiceShippingCostShippingRateDataTaxBehavior { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// The type of calculation to use on the shipping rate. Can only be `fixed_amount` for now. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum UpdateInvoiceShippingCostShippingRateDataType { + FixedAmount, +} +impl UpdateInvoiceShippingCostShippingRateDataType { + pub fn as_str(self) -> &'static str { + use UpdateInvoiceShippingCostShippingRateDataType::*; + match self { + FixedAmount => "fixed_amount", + } + } +} + +impl std::str::FromStr for UpdateInvoiceShippingCostShippingRateDataType { + type Err = (); + fn from_str(s: &str) -> Result { + use UpdateInvoiceShippingCostShippingRateDataType::*; + match s { + "fixed_amount" => Ok(FixedAmount), + _ => Err(()), + } + } +} +impl std::fmt::Display for UpdateInvoiceShippingCostShippingRateDataType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for UpdateInvoiceShippingCostShippingRateDataType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for UpdateInvoiceShippingCostShippingRateDataType { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'a> UpdateInvoice<'a> { + /// Draft invoices are fully editable. + /// Once an invoice is [finalized](https://stripe.com/docs/billing/invoices/workflow#finalized),. + /// monetary values, as well as `collection_method`, become uneditable. + /// + /// If you would like to stop the Stripe Billing engine from automatically finalizing, reattempting payments on,. + /// sending reminders for, or [automatically reconciling](https://stripe.com/docs/billing/invoices/reconciliation) invoices, pass. + /// `auto_advance=false`. + pub fn send( + &self, + client: &stripe::Client, + invoice: &stripe_shared::InvoiceId, + ) -> stripe::Response { + client.send_form(&format!("/invoices/{invoice}"), self, http_types::Method::Post) + } +} +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct FinalizeInvoiceInvoice<'a> { + /// Controls whether Stripe performs [automatic collection](https://stripe.com/docs/invoicing/integration/automatic-advancement-collection) of the invoice. + /// If `false`, the invoice's state doesn't automatically advance without an explicit action. + #[serde(skip_serializing_if = "Option::is_none")] + pub auto_advance: Option, + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, +} +impl<'a> FinalizeInvoiceInvoice<'a> { + pub fn new() -> Self { + Self::default() + } +} +impl<'a> FinalizeInvoiceInvoice<'a> { + /// Stripe automatically finalizes drafts before sending and attempting payment on invoices. + /// However, if you’d like to finalize a draft invoice manually, you can do so using this method. + pub fn send( + &self, + client: &stripe::Client, + invoice: &stripe_shared::InvoiceId, + ) -> stripe::Response { + client.send_form(&format!("/invoices/{invoice}/finalize"), self, http_types::Method::Post) + } +} +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct MarkUncollectibleInvoice<'a> { + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, +} +impl<'a> MarkUncollectibleInvoice<'a> { + pub fn new() -> Self { + Self::default() + } +} +impl<'a> MarkUncollectibleInvoice<'a> { + /// Marking an invoice as uncollectible is useful for keeping track of bad debts that can be written off for accounting purposes. + pub fn send( + &self, + client: &stripe::Client, + invoice: &stripe_shared::InvoiceId, + ) -> stripe::Response { + client.send_form( + &format!("/invoices/{invoice}/mark_uncollectible"), + self, + http_types::Method::Post, + ) + } +} +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct PayInvoice<'a> { + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, + /// In cases where the source used to pay the invoice has insufficient funds, passing `forgive=true` controls whether a charge should be attempted for the full amount available on the source, up to the amount to fully pay the invoice. + /// This effectively forgives the difference between the amount available on the source and the amount due. + /// + /// + /// Passing `forgive=false` will fail the charge if the source hasn't been pre-funded with the right amount. + /// An example for this case is with ACH Credit Transfers and wires: if the amount wired is less than the amount due by a small amount, you might want to forgive the difference. + /// Defaults to `false`. + #[serde(skip_serializing_if = "Option::is_none")] + pub forgive: Option, + /// ID of the mandate to be used for this invoice. + /// It must correspond to the payment method used to pay the invoice, including the payment_method param or the invoice's default_payment_method or default_source, if set. + #[serde(skip_serializing_if = "Option::is_none")] + pub mandate: Option<&'a str>, + /// Indicates if a customer is on or off-session while an invoice payment is attempted. + /// Defaults to `true` (off-session). + #[serde(skip_serializing_if = "Option::is_none")] + pub off_session: Option, + /// Boolean representing whether an invoice is paid outside of Stripe. + /// This will result in no charge being made. + /// Defaults to `false`. + #[serde(skip_serializing_if = "Option::is_none")] + pub paid_out_of_band: Option, + /// A PaymentMethod to be charged. + /// The PaymentMethod must be the ID of a PaymentMethod belonging to the customer associated with the invoice being paid. + #[serde(skip_serializing_if = "Option::is_none")] + pub payment_method: Option<&'a str>, + /// A payment source to be charged. + /// The source must be the ID of a source belonging to the customer associated with the invoice being paid. + #[serde(skip_serializing_if = "Option::is_none")] + pub source: Option<&'a str>, +} +impl<'a> PayInvoice<'a> { + pub fn new() -> Self { + Self::default() + } +} +impl<'a> PayInvoice<'a> { + /// Stripe automatically creates and then attempts to collect payment on invoices for customers on subscriptions according to your [subscriptions settings](https://dashboard.stripe.com/account/billing/automatic). + /// However, if you’d like to attempt payment on an invoice out of the normal collection schedule or for some other reason, you can do so. + pub fn send( + &self, + client: &stripe::Client, + invoice: &stripe_shared::InvoiceId, + ) -> stripe::Response { + client.send_form(&format!("/invoices/{invoice}/pay"), self, http_types::Method::Post) + } +} +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct SendInvoiceInvoice<'a> { + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, +} +impl<'a> SendInvoiceInvoice<'a> { + pub fn new() -> Self { + Self::default() + } +} +impl<'a> SendInvoiceInvoice<'a> { + /// Stripe will automatically send invoices to customers according to your [subscriptions settings](https://dashboard.stripe.com/account/billing/automatic). + /// However, if you’d like to manually send an invoice to your customer out of the normal schedule, you can do so. + /// When sending invoices that have already been paid, there will be no reference to the payment in the email. + /// + /// Requests made in test-mode result in no emails being sent, despite sending an `invoice.sent` event. + pub fn send( + &self, + client: &stripe::Client, + invoice: &stripe_shared::InvoiceId, + ) -> stripe::Response { + client.send_form(&format!("/invoices/{invoice}/send"), self, http_types::Method::Post) + } +} +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct VoidInvoiceInvoice<'a> { + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, +} +impl<'a> VoidInvoiceInvoice<'a> { + pub fn new() -> Self { + Self::default() + } +} +impl<'a> VoidInvoiceInvoice<'a> { + /// Mark a finalized invoice as void. + /// This cannot be undone. + /// Voiding an invoice is similar to [deletion](https://stripe.com/docs/api#delete_invoice), however it only applies to finalized invoices and maintains a papertrail where the invoice can still be found. + pub fn send( + &self, + client: &stripe::Client, + invoice: &stripe_shared::InvoiceId, + ) -> stripe::Response { + client.send_form(&format!("/invoices/{invoice}/void"), self, http_types::Method::Post) + } +} +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct OptionalFieldsAddress<'a> { + /// City, district, suburb, town, or village. + #[serde(skip_serializing_if = "Option::is_none")] + pub city: Option<&'a str>, + /// Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). + #[serde(skip_serializing_if = "Option::is_none")] + pub country: Option<&'a str>, + /// Address line 1 (e.g., street, PO Box, or company name). + #[serde(skip_serializing_if = "Option::is_none")] + pub line1: Option<&'a str>, + /// Address line 2 (e.g., apartment, suite, unit, or building). + #[serde(skip_serializing_if = "Option::is_none")] + pub line2: Option<&'a str>, + /// ZIP or postal code. + #[serde(skip_serializing_if = "Option::is_none")] + pub postal_code: Option<&'a str>, + /// State, county, province, or region. + #[serde(skip_serializing_if = "Option::is_none")] + pub state: Option<&'a str>, +} +impl<'a> OptionalFieldsAddress<'a> { + pub fn new() -> Self { + Self::default() + } +} +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct TaxParam<'a> { + /// A recent IP address of the customer used for tax reporting and tax location inference. + /// Stripe recommends updating the IP address when a new PaymentMethod is attached or the address field on the customer is updated. + /// We recommend against updating this field more frequently since it could result in unexpected tax location/reporting outcomes. + #[serde(skip_serializing_if = "Option::is_none")] + pub ip_address: Option<&'a str>, +} +impl<'a> TaxParam<'a> { + pub fn new() -> Self { + Self::default() + } +} +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct DiscountsDataParam<'a> { + /// ID of the coupon to create a new discount for. + #[serde(skip_serializing_if = "Option::is_none")] + pub coupon: Option<&'a str>, + /// ID of an existing discount on the object (or one of its ancestors) to reuse. + #[serde(skip_serializing_if = "Option::is_none")] + pub discount: Option<&'a str>, + /// ID of the promotion code to create a new discount for. + #[serde(skip_serializing_if = "Option::is_none")] + pub promotion_code: Option<&'a str>, +} +impl<'a> DiscountsDataParam<'a> { + pub fn new() -> Self { + Self::default() + } +} +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct Period { + /// The end of the period, which must be greater than or equal to the start. This value is inclusive. + pub end: stripe_types::Timestamp, + /// The start of the period. This value is inclusive. + pub start: stripe_types::Timestamp, +} +impl Period { + pub fn new(end: stripe_types::Timestamp, start: stripe_types::Timestamp) -> Self { + Self { end, start } + } +} +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct ItemBillingThresholdsParam { + /// Number of units that meets the billing threshold to advance the subscription to a new billing period (e.g., it takes 10 $5 units to meet a $50 [monetary threshold](https://stripe.com/docs/api/subscriptions/update#update_subscription-billing_thresholds-amount_gte)). + pub usage_gte: i64, +} +impl ItemBillingThresholdsParam { + pub fn new(usage_gte: i64) -> Self { + Self { usage_gte } + } +} +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CustomFieldParams<'a> { + /// The name of the custom field. This may be up to 30 characters. + pub name: &'a str, + /// The value of the custom field. This may be up to 30 characters. + pub value: &'a str, +} +impl<'a> CustomFieldParams<'a> { + pub fn new(name: &'a str, value: &'a str) -> Self { + Self { name, value } + } +} +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct EuBankTransferParam<'a> { + /// The desired country code of the bank account information. + /// Permitted values include: `BE`, `DE`, `ES`, `FR`, `IE`, or `NL`. + pub country: &'a str, +} +impl<'a> EuBankTransferParam<'a> { + pub fn new(country: &'a str) -> Self { + Self { country } + } +} +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct TransferDataSpecs<'a> { + /// The amount that will be transferred automatically when the invoice is paid. + /// If no amount is set, the full amount is transferred. + #[serde(skip_serializing_if = "Option::is_none")] + pub amount: Option, + /// ID of an existing, connected Stripe account. + pub destination: &'a str, +} +impl<'a> TransferDataSpecs<'a> { + pub fn new(destination: &'a str) -> Self { + Self { amount: None, destination } + } +} +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CustomerShipping<'a> { + /// Customer shipping address. + pub address: OptionalFieldsAddress<'a>, + /// Customer name. + pub name: &'a str, + /// Customer phone (including extension). + #[serde(skip_serializing_if = "Option::is_none")] + pub phone: Option<&'a str>, +} +impl<'a> CustomerShipping<'a> { + pub fn new(address: OptionalFieldsAddress<'a>, name: &'a str) -> Self { + Self { address, name, phone: None } + } +} +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct BankTransferParam<'a> { + /// Configuration for eu_bank_transfer funding type. + #[serde(skip_serializing_if = "Option::is_none")] + pub eu_bank_transfer: Option>, + /// The bank transfer type that can be used for funding. + /// Permitted values include: `eu_bank_transfer`, `gb_bank_transfer`, `jp_bank_transfer`, `mx_bank_transfer`, or `us_bank_transfer`. + #[serde(rename = "type")] + #[serde(skip_serializing_if = "Option::is_none")] + pub type_: Option<&'a str>, +} +impl<'a> BankTransferParam<'a> { + pub fn new() -> Self { + Self::default() + } +} +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct RecipientShippingWithOptionalFieldsAddress<'a> { + /// Shipping address + pub address: OptionalFieldsAddress<'a>, + /// Recipient name. + pub name: &'a str, + /// Recipient phone (including extension) + #[serde(skip_serializing_if = "Option::is_none")] + pub phone: Option<&'a str>, +} +impl<'a> RecipientShippingWithOptionalFieldsAddress<'a> { + pub fn new(address: OptionalFieldsAddress<'a>, name: &'a str) -> Self { + Self { address, name, phone: None } + } +} +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct InvoicePaymentMethodOptionsParam<'a> { + /// Configuration for the bank transfer funding type, if the `funding_type` is set to `bank_transfer`. + #[serde(skip_serializing_if = "Option::is_none")] + pub bank_transfer: Option>, + /// The funding method type to be used when there are not enough funds in the customer balance. + /// Permitted values include: `bank_transfer`. + #[serde(skip_serializing_if = "Option::is_none")] + pub funding_type: Option<&'a str>, +} +impl<'a> InvoicePaymentMethodOptionsParam<'a> { + pub fn new() -> Self { + Self::default() + } +} diff --git a/generated/stripe_billing/src/invoice_item/mod.rs b/generated/stripe_billing/src/invoice_item/mod.rs new file mode 100644 index 000000000..d08c875ae --- /dev/null +++ b/generated/stripe_billing/src/invoice_item/mod.rs @@ -0,0 +1,4 @@ +#[cfg(feature = "invoice_item")] +mod requests; +#[cfg(feature = "invoice_item")] +pub use requests::*; diff --git a/src/resources/generated/invoiceitem.rs b/generated/stripe_billing/src/invoice_item/requests.rs similarity index 51% rename from src/resources/generated/invoiceitem.rs rename to generated/stripe_billing/src/invoice_item/requests.rs index bc114979d..be135e7f6 100644 --- a/src/resources/generated/invoiceitem.rs +++ b/generated/stripe_billing/src/invoice_item/requests.rs @@ -1,633 +1,579 @@ -// ====================================== -// This file was automatically generated. -// ====================================== - -use serde::{Deserialize, Serialize}; - -use crate::client::{Client, Response}; -use crate::ids::{CustomerId, InvoiceId, InvoiceItemId, PriceId, SubscriptionId}; -use crate::params::{ - Deleted, Expand, Expandable, List, Metadata, Object, Paginable, RangeQuery, Timestamp, -}; -use crate::resources::{ - Currency, Customer, Discount, Invoice, Period, Plan, Price, Subscription, TaxRate, - TestHelpersTestClock, -}; - -/// The resource representing a Stripe "InvoiceItem". -/// -/// For more details see -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct InvoiceItem { - /// Unique identifier for the object. - pub id: InvoiceItemId, - - /// Amount (in the `currency` specified) of the invoice item. - /// - /// This should always be equal to `unit_amount * quantity`. - #[serde(skip_serializing_if = "Option::is_none")] - pub amount: Option, - - /// Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. - /// - /// Must be a [supported currency](https://stripe.com/docs/currencies). - #[serde(skip_serializing_if = "Option::is_none")] - pub currency: Option, - - /// The ID of the customer who will be billed when this invoice item is billed. - #[serde(skip_serializing_if = "Option::is_none")] - pub customer: Option>, - - /// Time at which the object was created. - /// - /// Measured in seconds since the Unix epoch. - #[serde(skip_serializing_if = "Option::is_none")] - pub date: Option, - - // Always true for a deleted object - #[serde(default)] - pub deleted: bool, - - /// An arbitrary string attached to the object. - /// - /// Often useful for displaying to users. - #[serde(skip_serializing_if = "Option::is_none")] - pub description: Option, - - /// If true, discounts will apply to this invoice item. - /// - /// Always false for prorations. - #[serde(skip_serializing_if = "Option::is_none")] - pub discountable: Option, - - /// The discounts which apply to the invoice item. - /// - /// Item discounts are applied before invoice discounts. - /// Use `expand[]=discounts` to expand each discount. - #[serde(skip_serializing_if = "Option::is_none")] - pub discounts: Option>>, - - /// The ID of the invoice this invoice item belongs to. - #[serde(skip_serializing_if = "Option::is_none")] - pub invoice: Option>, - - /// Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. - #[serde(skip_serializing_if = "Option::is_none")] - pub livemode: Option, - - /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. - /// - /// This can be useful for storing additional information about the object in a structured format. - #[serde(skip_serializing_if = "Option::is_none")] - pub metadata: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub period: Option, - - /// If the invoice item is a proration, the plan of the subscription that the proration was computed for. - #[serde(skip_serializing_if = "Option::is_none")] - pub plan: Option, - - /// The price of the invoice item. - #[serde(skip_serializing_if = "Option::is_none")] - pub price: Option, - - /// Whether the invoice item was created automatically as a proration adjustment when the customer switched plans. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct DeleteInvoiceItem {} +impl DeleteInvoiceItem { + pub fn new() -> Self { + Self::default() + } +} +impl DeleteInvoiceItem { + /// Deletes an invoice item, removing it from an invoice. + /// Deleting invoice items is only possible when they’re not attached to invoices, or if it’s attached to a draft invoice. + pub fn send( + &self, + client: &stripe::Client, + invoiceitem: &stripe_shared::InvoiceItemId, + ) -> stripe::Response { + client.send_form(&format!("/invoiceitems/{invoiceitem}"), self, http_types::Method::Delete) + } +} +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct ListInvoiceItem<'a> { #[serde(skip_serializing_if = "Option::is_none")] - pub proration: Option, - - /// Quantity of units for the invoice item. - /// - /// If the invoice item is a proration, the quantity of the subscription that the proration was computed for. + pub created: Option, + /// The identifier of the customer whose invoice items to return. + /// If none is provided, all invoice items will be returned. #[serde(skip_serializing_if = "Option::is_none")] - pub quantity: Option, - - /// The subscription that this invoice item has been created for, if any. + pub customer: Option<&'a str>, + /// A cursor for use in pagination. + /// `ending_before` is an object ID that defines your place in the list. + /// For instance, if you make a list request and receive 100 objects, starting with `obj_bar`, your subsequent call can include `ending_before=obj_bar` in order to fetch the previous page of the list. #[serde(skip_serializing_if = "Option::is_none")] - pub subscription: Option>, - - /// The subscription item that this invoice item has been created for, if any. + pub ending_before: Option<&'a str>, + /// Specifies which fields in the response should be expanded. #[serde(skip_serializing_if = "Option::is_none")] - pub subscription_item: Option, - - /// The tax rates which apply to the invoice item. - /// - /// When set, the `default_tax_rates` on the invoice do not apply to this invoice item. + pub expand: Option<&'a [&'a str]>, + /// Only return invoice items belonging to this invoice. + /// If none is provided, all invoice items will be returned. + /// If specifying an invoice, no customer identifier is needed. #[serde(skip_serializing_if = "Option::is_none")] - pub tax_rates: Option>, - - /// ID of the test clock this invoice item belongs to. + pub invoice: Option<&'a str>, + /// A limit on the number of objects to be returned. + /// Limit can range between 1 and 100, and the default is 10. #[serde(skip_serializing_if = "Option::is_none")] - pub test_clock: Option>, - - /// Unit amount (in the `currency` specified) of the invoice item. + pub limit: Option, + /// Set to `true` to only show pending invoice items, which are not yet attached to any invoices. + /// Set to `false` to only show invoice items already attached to invoices. + /// If unspecified, no filter is applied. #[serde(skip_serializing_if = "Option::is_none")] - pub unit_amount: Option, - - /// Same as `unit_amount`, but contains a decimal value with at most 12 decimal places. + pub pending: Option, + /// A cursor for use in pagination. + /// `starting_after` is an object ID that defines your place in the list. + /// For instance, if you make a list request and receive 100 objects, ending with `obj_foo`, your subsequent call can include `starting_after=obj_foo` in order to fetch the next page of the list. #[serde(skip_serializing_if = "Option::is_none")] - pub unit_amount_decimal: Option, + pub starting_after: Option<&'a str>, } - -impl InvoiceItem { +impl<'a> ListInvoiceItem<'a> { + pub fn new() -> Self { + Self::default() + } +} +impl<'a> ListInvoiceItem<'a> { /// Returns a list of your invoice items. - /// /// Invoice items are returned sorted by creation date, with the most recently created invoice items appearing first. - pub fn list(client: &Client, params: &ListInvoiceItems<'_>) -> Response> { - client.get_query("/invoiceitems", ¶ms) - } - - /// Creates an item to be added to a draft invoice (up to 250 items per invoice). - /// - /// If no invoice is specified, the item will be on the next invoice created for the customer specified. - pub fn create(client: &Client, params: CreateInvoiceItem<'_>) -> Response { - client.post_form("/invoiceitems", ¶ms) - } - - /// Retrieves the invoice item with the given ID. - pub fn retrieve(client: &Client, id: &InvoiceItemId, expand: &[&str]) -> Response { - client.get_query(&format!("/invoiceitems/{}", id), &Expand { expand }) + pub fn send( + &self, + client: &stripe::Client, + ) -> stripe::Response> { + client.get_query("/invoiceitems", self) } - - /// Updates the amount or description of an invoice item on an upcoming invoice. - /// - /// Updating an invoice item is only possible before the invoice it’s attached to is closed. - pub fn update( - client: &Client, - id: &InvoiceItemId, - params: UpdateInvoiceItem<'_>, - ) -> Response { - client.post_form(&format!("/invoiceitems/{}", id), ¶ms) - } - - /// Deletes an invoice item, removing it from an invoice. - /// - /// Deleting invoice items is only possible when they’re not attached to invoices, or if it’s attached to a draft invoice. - pub fn delete(client: &Client, id: &InvoiceItemId) -> Response> { - client.delete(&format!("/invoiceitems/{}", id)) + pub fn paginate(self) -> stripe::ListPaginator> { + stripe::ListPaginator::from_list_params("/invoiceitems", self) } } - -impl Object for InvoiceItem { - type Id = InvoiceItemId; - fn id(&self) -> Self::Id { - self.id.clone() +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct RetrieveInvoiceItem<'a> { + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, +} +impl<'a> RetrieveInvoiceItem<'a> { + pub fn new() -> Self { + Self::default() } - fn object(&self) -> &'static str { - "invoiceitem" +} +impl<'a> RetrieveInvoiceItem<'a> { + /// Retrieves the invoice item with the given ID. + pub fn send( + &self, + client: &stripe::Client, + invoiceitem: &stripe_shared::InvoiceItemId, + ) -> stripe::Response { + client.get_query(&format!("/invoiceitems/{invoiceitem}"), self) } } - -/// The parameters for `InvoiceItem::create`. -#[derive(Clone, Debug, Serialize)] +#[derive(Copy, Clone, Debug, serde::Serialize)] pub struct CreateInvoiceItem<'a> { /// The integer amount in cents (or local equivalent) of the charge to be applied to the upcoming invoice. - /// /// Passing in a negative `amount` will reduce the `amount_due` on the invoice. #[serde(skip_serializing_if = "Option::is_none")] pub amount: Option, - /// Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. - /// /// Must be a [supported currency](https://stripe.com/docs/currencies). #[serde(skip_serializing_if = "Option::is_none")] - pub currency: Option, - + pub currency: Option, /// The ID of the customer who will be billed when this invoice item is billed. - pub customer: CustomerId, - + pub customer: &'a str, /// An arbitrary string which you can attach to the invoice item. - /// /// The description is displayed in the invoice for easy tracking. #[serde(skip_serializing_if = "Option::is_none")] pub description: Option<&'a str>, - /// Controls whether discounts apply to this invoice item. - /// /// Defaults to false for prorations or negative invoice items, and true for all other invoice items. #[serde(skip_serializing_if = "Option::is_none")] pub discountable: Option, - /// The coupons to redeem into discounts for the invoice item or invoice line item. #[serde(skip_serializing_if = "Option::is_none")] - pub discounts: Option>, - + pub discounts: Option<&'a [DiscountsDataParam<'a>]>, /// Specifies which fields in the response should be expanded. - #[serde(skip_serializing_if = "Expand::is_empty")] - pub expand: &'a [&'a str], - + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, /// The ID of an existing invoice to add this invoice item to. - /// /// When left blank, the invoice item will be added to the next upcoming scheduled invoice. /// This is useful when adding invoice items in response to an invoice.created webhook. /// You can only add invoice items to draft invoices and there is a maximum of 250 items per invoice. #[serde(skip_serializing_if = "Option::is_none")] - pub invoice: Option, - + pub invoice: Option<&'a str>, /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. - /// /// This can be useful for storing additional information about the object in a structured format. /// Individual keys can be unset by posting an empty value to them. /// All keys can be unset by posting an empty value to `metadata`. #[serde(skip_serializing_if = "Option::is_none")] - pub metadata: Option, - + pub metadata: Option<&'a std::collections::HashMap>, /// The period associated with this invoice item. - /// /// When set to different values, the period will be rendered on the invoice. /// If you have [Stripe Revenue Recognition](https://stripe.com/docs/revenue-recognition) enabled, the period will be used to recognize and defer revenue. /// See the [Revenue Recognition documentation](https://stripe.com/docs/revenue-recognition/methodology/subscriptions-and-invoicing) for details. #[serde(skip_serializing_if = "Option::is_none")] pub period: Option, - /// The ID of the price object. #[serde(skip_serializing_if = "Option::is_none")] - pub price: Option, - + pub price: Option<&'a str>, /// Data used to generate a new [Price](https://stripe.com/docs/api/prices) object inline. #[serde(skip_serializing_if = "Option::is_none")] - pub price_data: Option, - - /// Non-negative integer. - /// - /// The quantity of units for the invoice item. + pub price_data: Option>, + /// Non-negative integer. The quantity of units for the invoice item. #[serde(skip_serializing_if = "Option::is_none")] pub quantity: Option, - /// The ID of a subscription to add this invoice item to. - /// /// When left blank, the invoice item will be be added to the next upcoming scheduled invoice. /// When set, scheduled invoices for subscriptions other than the specified subscription will ignore the invoice item. /// Use this when you want to express that an invoice item has been accrued within the context of a particular subscription. #[serde(skip_serializing_if = "Option::is_none")] - pub subscription: Option, - + pub subscription: Option<&'a str>, /// Only required if a [default tax behavior](https://stripe.com/docs/tax/products-prices-tax-categories-tax-behavior#setting-a-default-tax-behavior-(recommended)) was not provided in the Stripe Tax settings. - /// /// Specifies whether the price is considered inclusive of taxes or exclusive of taxes. /// One of `inclusive`, `exclusive`, or `unspecified`. /// Once specified as either `inclusive` or `exclusive`, it cannot be changed. #[serde(skip_serializing_if = "Option::is_none")] - pub tax_behavior: Option, - + pub tax_behavior: Option, /// A [tax code](https://stripe.com/docs/tax/tax-categories) ID. #[serde(skip_serializing_if = "Option::is_none")] - pub tax_code: Option, - + pub tax_code: Option<&'a str>, /// The tax rates which apply to the invoice item. - /// /// When set, the `default_tax_rates` on the invoice do not apply to this invoice item. #[serde(skip_serializing_if = "Option::is_none")] - pub tax_rates: Option>, - + pub tax_rates: Option<&'a [&'a str]>, /// The integer unit amount in cents (or local equivalent) of the charge to be applied to the upcoming invoice. - /// /// This `unit_amount` will be multiplied by the quantity to get the full amount. /// Passing in a negative `unit_amount` will reduce the `amount_due` on the invoice. #[serde(skip_serializing_if = "Option::is_none")] pub unit_amount: Option, - /// Same as `unit_amount`, but accepts a decimal value in cents (or local equivalent) with at most 12 decimal places. - /// /// Only one of `unit_amount` and `unit_amount_decimal` can be set. #[serde(skip_serializing_if = "Option::is_none")] pub unit_amount_decimal: Option<&'a str>, } - impl<'a> CreateInvoiceItem<'a> { - pub fn new(customer: CustomerId) -> Self { - CreateInvoiceItem { - amount: Default::default(), - currency: Default::default(), + pub fn new(customer: &'a str) -> Self { + Self { + amount: None, + currency: None, customer, - description: Default::default(), - discountable: Default::default(), - discounts: Default::default(), - expand: Default::default(), - invoice: Default::default(), - metadata: Default::default(), - period: Default::default(), - price: Default::default(), - price_data: Default::default(), - quantity: Default::default(), - subscription: Default::default(), - tax_behavior: Default::default(), - tax_code: Default::default(), - tax_rates: Default::default(), - unit_amount: Default::default(), - unit_amount_decimal: Default::default(), + description: None, + discountable: None, + discounts: None, + expand: None, + invoice: None, + metadata: None, + period: None, + price: None, + price_data: None, + quantity: None, + subscription: None, + tax_behavior: None, + tax_code: None, + tax_rates: None, + unit_amount: None, + unit_amount_decimal: None, } } } - -/// The parameters for `InvoiceItem::list`. -#[derive(Clone, Debug, Serialize, Default)] -pub struct ListInvoiceItems<'a> { - #[serde(skip_serializing_if = "Option::is_none")] - pub created: Option>, - - /// The identifier of the customer whose invoice items to return. - /// - /// If none is provided, all invoice items will be returned. - #[serde(skip_serializing_if = "Option::is_none")] - pub customer: Option, - - /// A cursor for use in pagination. - /// - /// `ending_before` is an object ID that defines your place in the list. - /// For instance, if you make a list request and receive 100 objects, starting with `obj_bar`, your subsequent call can include `ending_before=obj_bar` in order to fetch the previous page of the list. +/// Data used to generate a new [Price](https://stripe.com/docs/api/prices) object inline. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreateInvoiceItemPriceData<'a> { + /// Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. + /// Must be a [supported currency](https://stripe.com/docs/currencies). + pub currency: stripe_types::Currency, + /// The ID of the product that this price will belong to. + pub product: &'a str, + /// Only required if a [default tax behavior](https://stripe.com/docs/tax/products-prices-tax-categories-tax-behavior#setting-a-default-tax-behavior-(recommended)) was not provided in the Stripe Tax settings. + /// Specifies whether the price is considered inclusive of taxes or exclusive of taxes. + /// One of `inclusive`, `exclusive`, or `unspecified`. + /// Once specified as either `inclusive` or `exclusive`, it cannot be changed. #[serde(skip_serializing_if = "Option::is_none")] - pub ending_before: Option, - - /// Specifies which fields in the response should be expanded. - #[serde(skip_serializing_if = "Expand::is_empty")] - pub expand: &'a [&'a str], - - /// Only return invoice items belonging to this invoice. - /// - /// If none is provided, all invoice items will be returned. - /// If specifying an invoice, no customer identifier is needed. + pub tax_behavior: Option, + /// A positive integer in cents (or local equivalent) (or 0 for a free price) representing how much to charge. #[serde(skip_serializing_if = "Option::is_none")] - pub invoice: Option, - - /// A limit on the number of objects to be returned. - /// - /// Limit can range between 1 and 100, and the default is 10. + pub unit_amount: Option, + /// Same as `unit_amount`, but accepts a decimal value in cents (or local equivalent) with at most 12 decimal places. + /// Only one of `unit_amount` and `unit_amount_decimal` can be set. #[serde(skip_serializing_if = "Option::is_none")] - pub limit: Option, + pub unit_amount_decimal: Option<&'a str>, +} +impl<'a> CreateInvoiceItemPriceData<'a> { + pub fn new(currency: stripe_types::Currency, product: &'a str) -> Self { + Self { currency, product, tax_behavior: None, unit_amount: None, unit_amount_decimal: None } + } +} +/// Only required if a [default tax behavior](https://stripe.com/docs/tax/products-prices-tax-categories-tax-behavior#setting-a-default-tax-behavior-(recommended)) was not provided in the Stripe Tax settings. +/// Specifies whether the price is considered inclusive of taxes or exclusive of taxes. +/// One of `inclusive`, `exclusive`, or `unspecified`. +/// Once specified as either `inclusive` or `exclusive`, it cannot be changed. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreateInvoiceItemPriceDataTaxBehavior { + Exclusive, + Inclusive, + Unspecified, +} +impl CreateInvoiceItemPriceDataTaxBehavior { + pub fn as_str(self) -> &'static str { + use CreateInvoiceItemPriceDataTaxBehavior::*; + match self { + Exclusive => "exclusive", + Inclusive => "inclusive", + Unspecified => "unspecified", + } + } +} - /// Set to `true` to only show pending invoice items, which are not yet attached to any invoices. - /// - /// Set to `false` to only show invoice items already attached to invoices. - /// If unspecified, no filter is applied. - #[serde(skip_serializing_if = "Option::is_none")] - pub pending: Option, +impl std::str::FromStr for CreateInvoiceItemPriceDataTaxBehavior { + type Err = (); + fn from_str(s: &str) -> Result { + use CreateInvoiceItemPriceDataTaxBehavior::*; + match s { + "exclusive" => Ok(Exclusive), + "inclusive" => Ok(Inclusive), + "unspecified" => Ok(Unspecified), + _ => Err(()), + } + } +} +impl std::fmt::Display for CreateInvoiceItemPriceDataTaxBehavior { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} - /// A cursor for use in pagination. - /// - /// `starting_after` is an object ID that defines your place in the list. - /// For instance, if you make a list request and receive 100 objects, ending with `obj_foo`, your subsequent call can include `starting_after=obj_foo` in order to fetch the next page of the list. - #[serde(skip_serializing_if = "Option::is_none")] - pub starting_after: Option, +impl std::fmt::Debug for CreateInvoiceItemPriceDataTaxBehavior { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreateInvoiceItemPriceDataTaxBehavior { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Only required if a [default tax behavior](https://stripe.com/docs/tax/products-prices-tax-categories-tax-behavior#setting-a-default-tax-behavior-(recommended)) was not provided in the Stripe Tax settings. +/// Specifies whether the price is considered inclusive of taxes or exclusive of taxes. +/// One of `inclusive`, `exclusive`, or `unspecified`. +/// Once specified as either `inclusive` or `exclusive`, it cannot be changed. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreateInvoiceItemTaxBehavior { + Exclusive, + Inclusive, + Unspecified, +} +impl CreateInvoiceItemTaxBehavior { + pub fn as_str(self) -> &'static str { + use CreateInvoiceItemTaxBehavior::*; + match self { + Exclusive => "exclusive", + Inclusive => "inclusive", + Unspecified => "unspecified", + } + } } -impl<'a> ListInvoiceItems<'a> { - pub fn new() -> Self { - ListInvoiceItems { - created: Default::default(), - customer: Default::default(), - ending_before: Default::default(), - expand: Default::default(), - invoice: Default::default(), - limit: Default::default(), - pending: Default::default(), - starting_after: Default::default(), +impl std::str::FromStr for CreateInvoiceItemTaxBehavior { + type Err = (); + fn from_str(s: &str) -> Result { + use CreateInvoiceItemTaxBehavior::*; + match s { + "exclusive" => Ok(Exclusive), + "inclusive" => Ok(Inclusive), + "unspecified" => Ok(Unspecified), + _ => Err(()), } } } -impl Paginable for ListInvoiceItems<'_> { - type O = InvoiceItem; - fn set_last(&mut self, item: Self::O) { - self.starting_after = Some(item.id()); +impl std::fmt::Display for CreateInvoiceItemTaxBehavior { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) } } -/// The parameters for `InvoiceItem::update`. -#[derive(Clone, Debug, Serialize, Default)] + +impl std::fmt::Debug for CreateInvoiceItemTaxBehavior { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreateInvoiceItemTaxBehavior { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'a> CreateInvoiceItem<'a> { + /// Creates an item to be added to a draft invoice (up to 250 items per invoice). + /// If no invoice is specified, the item will be on the next invoice created for the customer specified. + pub fn send(&self, client: &stripe::Client) -> stripe::Response { + client.send_form("/invoiceitems", self, http_types::Method::Post) + } +} +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] pub struct UpdateInvoiceItem<'a> { /// The integer amount in cents (or local equivalent) of the charge to be applied to the upcoming invoice. - /// /// If you want to apply a credit to the customer's account, pass a negative amount. #[serde(skip_serializing_if = "Option::is_none")] pub amount: Option, - /// An arbitrary string which you can attach to the invoice item. - /// /// The description is displayed in the invoice for easy tracking. #[serde(skip_serializing_if = "Option::is_none")] pub description: Option<&'a str>, - /// Controls whether discounts apply to this invoice item. - /// /// Defaults to false for prorations or negative invoice items, and true for all other invoice items. /// Cannot be set to true for prorations. #[serde(skip_serializing_if = "Option::is_none")] pub discountable: Option, - /// The coupons & existing discounts which apply to the invoice item or invoice line item. - /// /// Item discounts are applied before invoice discounts. /// Pass an empty string to remove previously-defined discounts. #[serde(skip_serializing_if = "Option::is_none")] - pub discounts: Option>, - + pub discounts: Option<&'a [DiscountsDataParam<'a>]>, /// Specifies which fields in the response should be expanded. - #[serde(skip_serializing_if = "Expand::is_empty")] - pub expand: &'a [&'a str], - + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. - /// /// This can be useful for storing additional information about the object in a structured format. /// Individual keys can be unset by posting an empty value to them. /// All keys can be unset by posting an empty value to `metadata`. #[serde(skip_serializing_if = "Option::is_none")] - pub metadata: Option, - + pub metadata: Option<&'a std::collections::HashMap>, /// The period associated with this invoice item. - /// /// When set to different values, the period will be rendered on the invoice. /// If you have [Stripe Revenue Recognition](https://stripe.com/docs/revenue-recognition) enabled, the period will be used to recognize and defer revenue. /// See the [Revenue Recognition documentation](https://stripe.com/docs/revenue-recognition/methodology/subscriptions-and-invoicing) for details. #[serde(skip_serializing_if = "Option::is_none")] pub period: Option, - /// The ID of the price object. #[serde(skip_serializing_if = "Option::is_none")] - pub price: Option, - + pub price: Option<&'a str>, /// Data used to generate a new [Price](https://stripe.com/docs/api/prices) object inline. #[serde(skip_serializing_if = "Option::is_none")] - pub price_data: Option, - - /// Non-negative integer. - /// - /// The quantity of units for the invoice item. + pub price_data: Option>, + /// Non-negative integer. The quantity of units for the invoice item. #[serde(skip_serializing_if = "Option::is_none")] pub quantity: Option, - /// Only required if a [default tax behavior](https://stripe.com/docs/tax/products-prices-tax-categories-tax-behavior#setting-a-default-tax-behavior-(recommended)) was not provided in the Stripe Tax settings. - /// /// Specifies whether the price is considered inclusive of taxes or exclusive of taxes. /// One of `inclusive`, `exclusive`, or `unspecified`. /// Once specified as either `inclusive` or `exclusive`, it cannot be changed. #[serde(skip_serializing_if = "Option::is_none")] - pub tax_behavior: Option, - + pub tax_behavior: Option, /// A [tax code](https://stripe.com/docs/tax/tax-categories) ID. #[serde(skip_serializing_if = "Option::is_none")] - pub tax_code: Option, - + pub tax_code: Option<&'a str>, /// The tax rates which apply to the invoice item. - /// /// When set, the `default_tax_rates` on the invoice do not apply to this invoice item. /// Pass an empty string to remove previously-defined tax rates. #[serde(skip_serializing_if = "Option::is_none")] - pub tax_rates: Option>, - + pub tax_rates: Option<&'a [&'a str]>, /// The integer unit amount in cents (or local equivalent) of the charge to be applied to the upcoming invoice. - /// /// This unit_amount will be multiplied by the quantity to get the full amount. /// If you want to apply a credit to the customer's account, pass a negative unit_amount. #[serde(skip_serializing_if = "Option::is_none")] pub unit_amount: Option, - /// Same as `unit_amount`, but accepts a decimal value in cents (or local equivalent) with at most 12 decimal places. - /// /// Only one of `unit_amount` and `unit_amount_decimal` can be set. #[serde(skip_serializing_if = "Option::is_none")] pub unit_amount_decimal: Option<&'a str>, } - impl<'a> UpdateInvoiceItem<'a> { pub fn new() -> Self { - UpdateInvoiceItem { - amount: Default::default(), - description: Default::default(), - discountable: Default::default(), - discounts: Default::default(), - expand: Default::default(), - metadata: Default::default(), - period: Default::default(), - price: Default::default(), - price_data: Default::default(), - quantity: Default::default(), - tax_behavior: Default::default(), - tax_code: Default::default(), - tax_rates: Default::default(), - unit_amount: Default::default(), - unit_amount_decimal: Default::default(), - } + Self::default() } } - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreateInvoiceItemDiscounts { - /// ID of the coupon to create a new discount for. - #[serde(skip_serializing_if = "Option::is_none")] - pub coupon: Option, - - /// ID of an existing discount on the object (or one of its ancestors) to reuse. - #[serde(skip_serializing_if = "Option::is_none")] - pub discount: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct InvoiceItemPriceData { +/// Data used to generate a new [Price](https://stripe.com/docs/api/prices) object inline. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct UpdateInvoiceItemPriceData<'a> { /// Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. - /// /// Must be a [supported currency](https://stripe.com/docs/currencies). - pub currency: Currency, - + pub currency: stripe_types::Currency, /// The ID of the product that this price will belong to. - pub product: String, - + pub product: &'a str, /// Only required if a [default tax behavior](https://stripe.com/docs/tax/products-prices-tax-categories-tax-behavior#setting-a-default-tax-behavior-(recommended)) was not provided in the Stripe Tax settings. - /// /// Specifies whether the price is considered inclusive of taxes or exclusive of taxes. /// One of `inclusive`, `exclusive`, or `unspecified`. /// Once specified as either `inclusive` or `exclusive`, it cannot be changed. #[serde(skip_serializing_if = "Option::is_none")] - pub tax_behavior: Option, - + pub tax_behavior: Option, /// A positive integer in cents (or local equivalent) (or 0 for a free price) representing how much to charge. #[serde(skip_serializing_if = "Option::is_none")] pub unit_amount: Option, - /// Same as `unit_amount`, but accepts a decimal value in cents (or local equivalent) with at most 12 decimal places. - /// /// Only one of `unit_amount` and `unit_amount_decimal` can be set. #[serde(skip_serializing_if = "Option::is_none")] - pub unit_amount_decimal: Option, + pub unit_amount_decimal: Option<&'a str>, } - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UpdateInvoiceItemDiscounts { - /// ID of the coupon to create a new discount for. - #[serde(skip_serializing_if = "Option::is_none")] - pub coupon: Option, - - /// ID of an existing discount on the object (or one of its ancestors) to reuse. - #[serde(skip_serializing_if = "Option::is_none")] - pub discount: Option, +impl<'a> UpdateInvoiceItemPriceData<'a> { + pub fn new(currency: stripe_types::Currency, product: &'a str) -> Self { + Self { currency, product, tax_behavior: None, unit_amount: None, unit_amount_decimal: None } + } } - -/// An enum representing the possible values of an `InvoiceItemPriceData`'s `tax_behavior` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum InvoiceItemPriceDataTaxBehavior { +/// Only required if a [default tax behavior](https://stripe.com/docs/tax/products-prices-tax-categories-tax-behavior#setting-a-default-tax-behavior-(recommended)) was not provided in the Stripe Tax settings. +/// Specifies whether the price is considered inclusive of taxes or exclusive of taxes. +/// One of `inclusive`, `exclusive`, or `unspecified`. +/// Once specified as either `inclusive` or `exclusive`, it cannot be changed. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum UpdateInvoiceItemPriceDataTaxBehavior { Exclusive, Inclusive, Unspecified, } - -impl InvoiceItemPriceDataTaxBehavior { +impl UpdateInvoiceItemPriceDataTaxBehavior { pub fn as_str(self) -> &'static str { + use UpdateInvoiceItemPriceDataTaxBehavior::*; match self { - InvoiceItemPriceDataTaxBehavior::Exclusive => "exclusive", - InvoiceItemPriceDataTaxBehavior::Inclusive => "inclusive", - InvoiceItemPriceDataTaxBehavior::Unspecified => "unspecified", + Exclusive => "exclusive", + Inclusive => "inclusive", + Unspecified => "unspecified", } } } -impl AsRef for InvoiceItemPriceDataTaxBehavior { - fn as_ref(&self) -> &str { - self.as_str() +impl std::str::FromStr for UpdateInvoiceItemPriceDataTaxBehavior { + type Err = (); + fn from_str(s: &str) -> Result { + use UpdateInvoiceItemPriceDataTaxBehavior::*; + match s { + "exclusive" => Ok(Exclusive), + "inclusive" => Ok(Inclusive), + "unspecified" => Ok(Unspecified), + _ => Err(()), + } + } +} +impl std::fmt::Display for UpdateInvoiceItemPriceDataTaxBehavior { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) } } -impl std::fmt::Display for InvoiceItemPriceDataTaxBehavior { +impl std::fmt::Debug for UpdateInvoiceItemPriceDataTaxBehavior { fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) + f.write_str(self.as_str()) } } -impl std::default::Default for InvoiceItemPriceDataTaxBehavior { - fn default() -> Self { - Self::Exclusive +impl serde::Serialize for UpdateInvoiceItemPriceDataTaxBehavior { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) } } - -/// An enum representing the possible values of an `CreateInvoiceItem`'s `tax_behavior` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum InvoiceItemTaxBehavior { +/// Only required if a [default tax behavior](https://stripe.com/docs/tax/products-prices-tax-categories-tax-behavior#setting-a-default-tax-behavior-(recommended)) was not provided in the Stripe Tax settings. +/// Specifies whether the price is considered inclusive of taxes or exclusive of taxes. +/// One of `inclusive`, `exclusive`, or `unspecified`. +/// Once specified as either `inclusive` or `exclusive`, it cannot be changed. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum UpdateInvoiceItemTaxBehavior { Exclusive, Inclusive, Unspecified, } - -impl InvoiceItemTaxBehavior { +impl UpdateInvoiceItemTaxBehavior { pub fn as_str(self) -> &'static str { + use UpdateInvoiceItemTaxBehavior::*; match self { - InvoiceItemTaxBehavior::Exclusive => "exclusive", - InvoiceItemTaxBehavior::Inclusive => "inclusive", - InvoiceItemTaxBehavior::Unspecified => "unspecified", + Exclusive => "exclusive", + Inclusive => "inclusive", + Unspecified => "unspecified", } } } -impl AsRef for InvoiceItemTaxBehavior { - fn as_ref(&self) -> &str { - self.as_str() +impl std::str::FromStr for UpdateInvoiceItemTaxBehavior { + type Err = (); + fn from_str(s: &str) -> Result { + use UpdateInvoiceItemTaxBehavior::*; + match s { + "exclusive" => Ok(Exclusive), + "inclusive" => Ok(Inclusive), + "unspecified" => Ok(Unspecified), + _ => Err(()), + } + } +} +impl std::fmt::Display for UpdateInvoiceItemTaxBehavior { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) } } -impl std::fmt::Display for InvoiceItemTaxBehavior { +impl std::fmt::Debug for UpdateInvoiceItemTaxBehavior { fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) + f.write_str(self.as_str()) } } -impl std::default::Default for InvoiceItemTaxBehavior { - fn default() -> Self { - Self::Exclusive +impl serde::Serialize for UpdateInvoiceItemTaxBehavior { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'a> UpdateInvoiceItem<'a> { + /// Updates the amount or description of an invoice item on an upcoming invoice. + /// Updating an invoice item is only possible before the invoice it’s attached to is closed. + pub fn send( + &self, + client: &stripe::Client, + invoiceitem: &stripe_shared::InvoiceItemId, + ) -> stripe::Response { + client.send_form(&format!("/invoiceitems/{invoiceitem}"), self, http_types::Method::Post) + } +} +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct DiscountsDataParam<'a> { + /// ID of the coupon to create a new discount for. + #[serde(skip_serializing_if = "Option::is_none")] + pub coupon: Option<&'a str>, + /// ID of an existing discount on the object (or one of its ancestors) to reuse. + #[serde(skip_serializing_if = "Option::is_none")] + pub discount: Option<&'a str>, +} +impl<'a> DiscountsDataParam<'a> { + pub fn new() -> Self { + Self::default() + } +} +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct Period { + /// The end of the period, which must be greater than or equal to the start. This value is inclusive. + pub end: stripe_types::Timestamp, + /// The start of the period. This value is inclusive. + pub start: stripe_types::Timestamp, +} +impl Period { + pub fn new(end: stripe_types::Timestamp, start: stripe_types::Timestamp) -> Self { + Self { end, start } } } diff --git a/generated/stripe_billing/src/invoice_line_item/mod.rs b/generated/stripe_billing/src/invoice_line_item/mod.rs new file mode 100644 index 000000000..6802d7402 --- /dev/null +++ b/generated/stripe_billing/src/invoice_line_item/mod.rs @@ -0,0 +1,4 @@ +#[cfg(feature = "invoice_line_item")] +mod requests; +#[cfg(feature = "invoice_line_item")] +pub use requests::*; diff --git a/generated/stripe_billing/src/invoice_line_item/requests.rs b/generated/stripe_billing/src/invoice_line_item/requests.rs new file mode 100644 index 000000000..0ea7ef846 --- /dev/null +++ b/generated/stripe_billing/src/invoice_line_item/requests.rs @@ -0,0 +1,434 @@ +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct ListInvoiceInvoiceLineItem<'a> { + /// A cursor for use in pagination. + /// `ending_before` is an object ID that defines your place in the list. + /// For instance, if you make a list request and receive 100 objects, starting with `obj_bar`, your subsequent call can include `ending_before=obj_bar` in order to fetch the previous page of the list. + #[serde(skip_serializing_if = "Option::is_none")] + pub ending_before: Option<&'a str>, + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, + /// A limit on the number of objects to be returned. + /// Limit can range between 1 and 100, and the default is 10. + #[serde(skip_serializing_if = "Option::is_none")] + pub limit: Option, + /// A cursor for use in pagination. + /// `starting_after` is an object ID that defines your place in the list. + /// For instance, if you make a list request and receive 100 objects, ending with `obj_foo`, your subsequent call can include `starting_after=obj_foo` in order to fetch the next page of the list. + #[serde(skip_serializing_if = "Option::is_none")] + pub starting_after: Option<&'a str>, +} +impl<'a> ListInvoiceInvoiceLineItem<'a> { + pub fn new() -> Self { + Self::default() + } +} +impl<'a> ListInvoiceInvoiceLineItem<'a> { + /// When retrieving an invoice, you’ll get a **lines** property containing the total count of line items and the first handful of those items. + /// There is also a URL where you can retrieve the full (paginated) list of line items. + pub fn send( + &self, + client: &stripe::Client, + invoice: &stripe_shared::InvoiceId, + ) -> stripe::Response> { + client.get_query(&format!("/invoices/{invoice}/lines"), self) + } + pub fn paginate( + self, + invoice: &stripe_shared::InvoiceId, + ) -> stripe::ListPaginator> { + stripe::ListPaginator::from_list_params(&format!("/invoices/{invoice}/lines"), self) + } +} +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdateInvoiceLineItem<'a> { + /// The integer amount in cents (or local equivalent) of the charge to be applied to the upcoming invoice. + /// If you want to apply a credit to the customer's account, pass a negative amount. + #[serde(skip_serializing_if = "Option::is_none")] + pub amount: Option, + /// An arbitrary string which you can attach to the invoice item. + /// The description is displayed in the invoice for easy tracking. + #[serde(skip_serializing_if = "Option::is_none")] + pub description: Option<&'a str>, + /// Controls whether discounts apply to this line item. + /// Defaults to false for prorations or negative line items, and true for all other line items. + /// Cannot be set to true for prorations. + #[serde(skip_serializing_if = "Option::is_none")] + pub discountable: Option, + /// The coupons & existing discounts which apply to the line item. + /// Item discounts are applied before invoice discounts. + /// Pass an empty string to remove previously-defined discounts. + #[serde(skip_serializing_if = "Option::is_none")] + pub discounts: Option<&'a [UpdateInvoiceLineItemDiscounts<'a>]>, + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, + /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. + /// This can be useful for storing additional information about the object in a structured format. + /// Individual keys can be unset by posting an empty value to them. + /// All keys can be unset by posting an empty value to `metadata`. + #[serde(skip_serializing_if = "Option::is_none")] + pub metadata: Option<&'a std::collections::HashMap>, + /// The period associated with this invoice item. + /// When set to different values, the period will be rendered on the invoice. + /// If you have [Stripe Revenue Recognition](https://stripe.com/docs/revenue-recognition) enabled, the period will be used to recognize and defer revenue. + /// See the [Revenue Recognition documentation](https://stripe.com/docs/revenue-recognition/methodology/subscriptions-and-invoicing) for details. + #[serde(skip_serializing_if = "Option::is_none")] + pub period: Option, + /// The ID of the price object. + #[serde(skip_serializing_if = "Option::is_none")] + pub price: Option<&'a str>, + /// Data used to generate a new [Price](https://stripe.com/docs/api/prices) object inline. + #[serde(skip_serializing_if = "Option::is_none")] + pub price_data: Option>, + /// Non-negative integer. The quantity of units for the line item. + #[serde(skip_serializing_if = "Option::is_none")] + pub quantity: Option, + /// A list of up to 10 tax amounts for this line item. + /// This can be useful if you calculate taxes on your own or use a third-party to calculate them. + /// You cannot set tax amounts if any line item has [tax_rates](https://stripe.com/docs/api/invoices/line_item#invoice_line_item_object-tax_rates) or if the invoice has [default_tax_rates](https://stripe.com/docs/api/invoices/object#invoice_object-default_tax_rates) or uses [automatic tax](https://stripe.com/docs/tax/invoicing). + /// Pass an empty string to remove previously defined tax amounts. + #[serde(skip_serializing_if = "Option::is_none")] + pub tax_amounts: Option<&'a [UpdateInvoiceLineItemTaxAmounts<'a>]>, + /// The tax rates which apply to the line item. + /// When set, the `default_tax_rates` on the invoice do not apply to this line item. + /// Pass an empty string to remove previously-defined tax rates. + #[serde(skip_serializing_if = "Option::is_none")] + pub tax_rates: Option<&'a [&'a str]>, +} +impl<'a> UpdateInvoiceLineItem<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// The coupons & existing discounts which apply to the line item. +/// Item discounts are applied before invoice discounts. +/// Pass an empty string to remove previously-defined discounts. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdateInvoiceLineItemDiscounts<'a> { + /// ID of the coupon to create a new discount for. + #[serde(skip_serializing_if = "Option::is_none")] + pub coupon: Option<&'a str>, + /// ID of an existing discount on the object (or one of its ancestors) to reuse. + #[serde(skip_serializing_if = "Option::is_none")] + pub discount: Option<&'a str>, +} +impl<'a> UpdateInvoiceLineItemDiscounts<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// The period associated with this invoice item. +/// When set to different values, the period will be rendered on the invoice. +/// If you have [Stripe Revenue Recognition](https://stripe.com/docs/revenue-recognition) enabled, the period will be used to recognize and defer revenue. +/// See the [Revenue Recognition documentation](https://stripe.com/docs/revenue-recognition/methodology/subscriptions-and-invoicing) for details. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct UpdateInvoiceLineItemPeriod { + /// The end of the period, which must be greater than or equal to the start. This value is inclusive. + pub end: stripe_types::Timestamp, + /// The start of the period. This value is inclusive. + pub start: stripe_types::Timestamp, +} +impl UpdateInvoiceLineItemPeriod { + pub fn new(end: stripe_types::Timestamp, start: stripe_types::Timestamp) -> Self { + Self { end, start } + } +} +/// Data used to generate a new [Price](https://stripe.com/docs/api/prices) object inline. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct UpdateInvoiceLineItemPriceData<'a> { + /// Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. + /// Must be a [supported currency](https://stripe.com/docs/currencies). + pub currency: stripe_types::Currency, + /// The ID of the product that this price will belong to. + /// One of `product` or `product_data` is required. + #[serde(skip_serializing_if = "Option::is_none")] + pub product: Option<&'a str>, + /// Data used to generate a new product object inline. One of `product` or `product_data` is required. + #[serde(skip_serializing_if = "Option::is_none")] + pub product_data: Option>, + /// Only required if a [default tax behavior](https://stripe.com/docs/tax/products-prices-tax-categories-tax-behavior#setting-a-default-tax-behavior-(recommended)) was not provided in the Stripe Tax settings. + /// Specifies whether the price is considered inclusive of taxes or exclusive of taxes. + /// One of `inclusive`, `exclusive`, or `unspecified`. + /// Once specified as either `inclusive` or `exclusive`, it cannot be changed. + #[serde(skip_serializing_if = "Option::is_none")] + pub tax_behavior: Option, + /// A non-negative integer in cents (or local equivalent) representing how much to charge. + /// One of `unit_amount` or `unit_amount_decimal` is required. + #[serde(skip_serializing_if = "Option::is_none")] + pub unit_amount: Option, + /// Same as `unit_amount`, but accepts a decimal value in cents (or local equivalent) with at most 12 decimal places. + /// Only one of `unit_amount` and `unit_amount_decimal` can be set. + #[serde(skip_serializing_if = "Option::is_none")] + pub unit_amount_decimal: Option<&'a str>, +} +impl<'a> UpdateInvoiceLineItemPriceData<'a> { + pub fn new(currency: stripe_types::Currency) -> Self { + Self { + currency, + product: None, + product_data: None, + tax_behavior: None, + unit_amount: None, + unit_amount_decimal: None, + } + } +} +/// Data used to generate a new product object inline. One of `product` or `product_data` is required. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct UpdateInvoiceLineItemPriceDataProductData<'a> { + /// The product's description, meant to be displayable to the customer. + /// Use this field to optionally store a long form explanation of the product being sold for your own rendering purposes. + #[serde(skip_serializing_if = "Option::is_none")] + pub description: Option<&'a str>, + /// A list of up to 8 URLs of images for this product, meant to be displayable to the customer. + #[serde(skip_serializing_if = "Option::is_none")] + pub images: Option<&'a [&'a str]>, + /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. + /// This can be useful for storing additional information about the object in a structured format. + /// Individual keys can be unset by posting an empty value to them. + /// All keys can be unset by posting an empty value to `metadata`. + #[serde(skip_serializing_if = "Option::is_none")] + pub metadata: Option<&'a std::collections::HashMap>, + /// The product's name, meant to be displayable to the customer. + pub name: &'a str, + /// A [tax code](https://stripe.com/docs/tax/tax-categories) ID. + #[serde(skip_serializing_if = "Option::is_none")] + pub tax_code: Option<&'a str>, +} +impl<'a> UpdateInvoiceLineItemPriceDataProductData<'a> { + pub fn new(name: &'a str) -> Self { + Self { description: None, images: None, metadata: None, name, tax_code: None } + } +} +/// Only required if a [default tax behavior](https://stripe.com/docs/tax/products-prices-tax-categories-tax-behavior#setting-a-default-tax-behavior-(recommended)) was not provided in the Stripe Tax settings. +/// Specifies whether the price is considered inclusive of taxes or exclusive of taxes. +/// One of `inclusive`, `exclusive`, or `unspecified`. +/// Once specified as either `inclusive` or `exclusive`, it cannot be changed. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum UpdateInvoiceLineItemPriceDataTaxBehavior { + Exclusive, + Inclusive, + Unspecified, +} +impl UpdateInvoiceLineItemPriceDataTaxBehavior { + pub fn as_str(self) -> &'static str { + use UpdateInvoiceLineItemPriceDataTaxBehavior::*; + match self { + Exclusive => "exclusive", + Inclusive => "inclusive", + Unspecified => "unspecified", + } + } +} + +impl std::str::FromStr for UpdateInvoiceLineItemPriceDataTaxBehavior { + type Err = (); + fn from_str(s: &str) -> Result { + use UpdateInvoiceLineItemPriceDataTaxBehavior::*; + match s { + "exclusive" => Ok(Exclusive), + "inclusive" => Ok(Inclusive), + "unspecified" => Ok(Unspecified), + _ => Err(()), + } + } +} +impl std::fmt::Display for UpdateInvoiceLineItemPriceDataTaxBehavior { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for UpdateInvoiceLineItemPriceDataTaxBehavior { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for UpdateInvoiceLineItemPriceDataTaxBehavior { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// A list of up to 10 tax amounts for this line item. +/// This can be useful if you calculate taxes on your own or use a third-party to calculate them. +/// You cannot set tax amounts if any line item has [tax_rates](https://stripe.com/docs/api/invoices/line_item#invoice_line_item_object-tax_rates) or if the invoice has [default_tax_rates](https://stripe.com/docs/api/invoices/object#invoice_object-default_tax_rates) or uses [automatic tax](https://stripe.com/docs/tax/invoicing). +/// Pass an empty string to remove previously defined tax amounts. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct UpdateInvoiceLineItemTaxAmounts<'a> { + /// The amount, in cents (or local equivalent), of the tax. + pub amount: i64, + /// Data to find or create a TaxRate object. + /// + /// Stripe automatically creates or reuses a TaxRate object for each tax amount. + /// If the `tax_rate_data` exactly matches a previous value, Stripe will reuse the TaxRate object. + /// TaxRate objects created automatically by Stripe are immediately archived, do not appear in the line item’s `tax_rates`, and cannot be directly added to invoices, payments, or line items. + pub tax_rate_data: UpdateInvoiceLineItemTaxAmountsTaxRateData<'a>, + /// The amount on which tax is calculated, in cents (or local equivalent). + pub taxable_amount: i64, +} +impl<'a> UpdateInvoiceLineItemTaxAmounts<'a> { + pub fn new( + amount: i64, + tax_rate_data: UpdateInvoiceLineItemTaxAmountsTaxRateData<'a>, + taxable_amount: i64, + ) -> Self { + Self { amount, tax_rate_data, taxable_amount } + } +} +/// Data to find or create a TaxRate object. +/// +/// Stripe automatically creates or reuses a TaxRate object for each tax amount. +/// If the `tax_rate_data` exactly matches a previous value, Stripe will reuse the TaxRate object. +/// TaxRate objects created automatically by Stripe are immediately archived, do not appear in the line item’s `tax_rates`, and cannot be directly added to invoices, payments, or line items. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct UpdateInvoiceLineItemTaxAmountsTaxRateData<'a> { + /// Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). + #[serde(skip_serializing_if = "Option::is_none")] + pub country: Option<&'a str>, + /// An arbitrary string attached to the tax rate for your internal use only. + /// It will not be visible to your customers. + #[serde(skip_serializing_if = "Option::is_none")] + pub description: Option<&'a str>, + /// The display name of the tax rate, which will be shown to users. + pub display_name: &'a str, + /// This specifies if the tax rate is inclusive or exclusive. + pub inclusive: bool, + /// The jurisdiction for the tax rate. + /// You can use this label field for tax reporting purposes. + /// It also appears on your customer’s invoice. + #[serde(skip_serializing_if = "Option::is_none")] + pub jurisdiction: Option<&'a str>, + /// The statutory tax rate percent. + /// This field accepts decimal values between 0 and 100 inclusive with at most 4 decimal places. + /// To accommodate fixed-amount taxes, set the percentage to zero. + /// Stripe will not display zero percentages on the invoice unless the `amount` of the tax is also zero. + pub percentage: f64, + /// [ISO 3166-2 subdivision code](https://en.wikipedia.org/wiki/ISO_3166-2:US), without country prefix. + /// For example, "NY" for New York, United States. + #[serde(skip_serializing_if = "Option::is_none")] + pub state: Option<&'a str>, + /// The high-level tax type, such as `vat` or `sales_tax`. + #[serde(skip_serializing_if = "Option::is_none")] + pub tax_type: Option, +} +impl<'a> UpdateInvoiceLineItemTaxAmountsTaxRateData<'a> { + pub fn new(display_name: &'a str, inclusive: bool, percentage: f64) -> Self { + Self { + country: None, + description: None, + display_name, + inclusive, + jurisdiction: None, + percentage, + state: None, + tax_type: None, + } + } +} +/// The high-level tax type, such as `vat` or `sales_tax`. +#[derive(Copy, Clone, Eq, PartialEq)] +#[non_exhaustive] +pub enum UpdateInvoiceLineItemTaxAmountsTaxRateDataTaxType { + AmusementTax, + CommunicationsTax, + Gst, + Hst, + Igst, + Jct, + LeaseTax, + Pst, + Qst, + Rst, + SalesTax, + ServiceTax, + Vat, + /// An unrecognized value from Stripe. Should not be used as a request parameter. + Unknown, +} +impl UpdateInvoiceLineItemTaxAmountsTaxRateDataTaxType { + pub fn as_str(self) -> &'static str { + use UpdateInvoiceLineItemTaxAmountsTaxRateDataTaxType::*; + match self { + AmusementTax => "amusement_tax", + CommunicationsTax => "communications_tax", + Gst => "gst", + Hst => "hst", + Igst => "igst", + Jct => "jct", + LeaseTax => "lease_tax", + Pst => "pst", + Qst => "qst", + Rst => "rst", + SalesTax => "sales_tax", + ServiceTax => "service_tax", + Vat => "vat", + Unknown => "unknown", + } + } +} + +impl std::str::FromStr for UpdateInvoiceLineItemTaxAmountsTaxRateDataTaxType { + type Err = (); + fn from_str(s: &str) -> Result { + use UpdateInvoiceLineItemTaxAmountsTaxRateDataTaxType::*; + match s { + "amusement_tax" => Ok(AmusementTax), + "communications_tax" => Ok(CommunicationsTax), + "gst" => Ok(Gst), + "hst" => Ok(Hst), + "igst" => Ok(Igst), + "jct" => Ok(Jct), + "lease_tax" => Ok(LeaseTax), + "pst" => Ok(Pst), + "qst" => Ok(Qst), + "rst" => Ok(Rst), + "sales_tax" => Ok(SalesTax), + "service_tax" => Ok(ServiceTax), + "vat" => Ok(Vat), + _ => Err(()), + } + } +} +impl std::fmt::Display for UpdateInvoiceLineItemTaxAmountsTaxRateDataTaxType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for UpdateInvoiceLineItemTaxAmountsTaxRateDataTaxType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for UpdateInvoiceLineItemTaxAmountsTaxRateDataTaxType { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'a> UpdateInvoiceLineItem<'a> { + /// Updates an invoice’s line item. + /// Some fields, such as `tax_amounts`, only live on the invoice line item,. + /// so they can only be updated through this endpoint. + /// Other fields, such as `amount`, live on both the invoice. + /// item and the invoice line item, so updates on this endpoint will propagate to the invoice item as well. + /// Updating an invoice’s line item is only possible before the invoice is finalized. + pub fn send( + &self, + client: &stripe::Client, + invoice: &stripe_shared::InvoiceId, + line_item_id: &str, + ) -> stripe::Response { + client.send_form( + &format!("/invoices/{invoice}/lines/{line_item_id}"), + self, + http_types::Method::Post, + ) + } +} diff --git a/generated/stripe_billing/src/mod.rs b/generated/stripe_billing/src/mod.rs new file mode 100644 index 000000000..86d826774 --- /dev/null +++ b/generated/stripe_billing/src/mod.rs @@ -0,0 +1,183 @@ +#![recursion_limit = "256"] +#![allow(clippy::large_enum_variant)] +#![allow(rustdoc::broken_intra_doc_links)] +#![allow(rustdoc::invalid_html_tags)] + +//! This crate provides Rust bindings to the Stripe HTTP API, specifically +//! for requests mentioned in the `Billing` section of the [Stripe API docs](https://stripe.com/docs/api) + +extern crate self as stripe_billing; +pub use billing_portal_configuration::types::*; +pub use stripe_shared::automatic_tax::*; +pub mod billing_portal_configuration; +pub use billing_portal_session::types::*; +pub mod billing_portal_session; +pub use stripe_shared::cancellation_details::*; +pub mod credit_note; +pub use stripe_shared::credit_note::*; +pub mod credit_note_line_item; +pub use stripe_shared::credit_note_line_item::*; +pub use stripe_shared::credit_note_tax_amount::*; +pub use stripe_shared::deleted_invoice::*; +pub use stripe_shared::deleted_invoiceitem::*; +pub use stripe_shared::deleted_plan::*; +pub use stripe_shared::deleted_subscription_item::*; +pub use stripe_shared::deleted_tax_id::*; +pub use stripe_shared::deleted_test_helpers_test_clock::*; +pub use stripe_shared::discounts_resource_discount_amount::*; +pub mod invoice; +pub use stripe_shared::invoice::*;pub use stripe_shared::invoice_installments_card::*;pub use stripe_shared::invoice_item_threshold_reason::*;pub use stripe_shared::invoice_line_item_period::*;pub use stripe_shared::invoice_mandate_options_card::*;pub use stripe_shared::invoice_payment_method_options_acss_debit::*;pub use stripe_shared::invoice_payment_method_options_acss_debit_mandate_options::*;pub use stripe_shared::invoice_payment_method_options_bancontact::*;pub use stripe_shared::invoice_payment_method_options_card::*;pub use stripe_shared::invoice_payment_method_options_customer_balance::*;pub use stripe_shared::invoice_payment_method_options_customer_balance_bank_transfer::*;pub use stripe_shared::invoice_payment_method_options_customer_balance_bank_transfer_eu_bank_transfer::*;pub use stripe_shared::invoice_payment_method_options_konbini::*;pub use stripe_shared::invoice_payment_method_options_us_bank_account::*;pub use stripe_shared::invoice_payment_method_options_us_bank_account_linked_account_options::*;pub use stripe_shared::invoice_rendering_pdf::*;pub use stripe_shared::invoice_setting_custom_field::*;pub use stripe_shared::invoice_setting_customer_setting::*;pub use stripe_shared::invoice_setting_quote_setting::*;pub use stripe_shared::invoice_setting_rendering_options::*;pub use stripe_shared::invoice_setting_subscription_schedule_phase_setting::*;pub use stripe_shared::invoice_setting_subscription_schedule_setting::*;pub use stripe_shared::invoice_tax_amount::*;pub use stripe_shared::invoice_threshold_reason::*;pub use stripe_shared::invoice_transfer_data::*; +pub mod invoice_item; +pub use stripe_shared::checkout_session_item::*; +pub use stripe_shared::invoice_item::*; +pub use stripe_shared::invoices_from_invoice::*; +pub use stripe_shared::invoices_invoice_rendering::*; +pub use stripe_shared::invoices_payment_method_options::*; +pub use stripe_shared::invoices_payment_settings::*; +pub use stripe_shared::invoices_resource_invoice_tax_id::*; +pub use stripe_shared::invoices_resource_line_items_credited_items::*; +pub use stripe_shared::invoices_resource_line_items_proration_details::*; +pub use stripe_shared::invoices_shipping_cost::*; +pub use stripe_shared::invoices_status_transitions::*; +pub mod invoice_line_item; +pub use stripe_shared::invoice_line_item::*; +pub mod usage_record_summary; +pub use stripe_shared::period::*; +pub use stripe_shared::usage_record_summary::*; +pub mod plan; +pub use stripe_shared::plan::*; +pub use stripe_shared::plan_tier::*; +#[doc(hidden)] +pub mod portal_business_profile; +#[doc(inline)] +pub use portal_business_profile::*; +#[doc(hidden)] +pub mod portal_customer_update; +#[doc(inline)] +pub use portal_customer_update::*; +#[doc(hidden)] +pub mod portal_features; +#[doc(inline)] +pub use portal_features::*; +#[doc(hidden)] +pub mod portal_flows_after_completion_hosted_confirmation; +#[doc(inline)] +pub use portal_flows_after_completion_hosted_confirmation::*; +#[doc(hidden)] +pub mod portal_flows_after_completion_redirect; +#[doc(inline)] +pub use portal_flows_after_completion_redirect::*; +#[doc(hidden)] +pub mod portal_flows_coupon_offer; +#[doc(inline)] +pub use portal_flows_coupon_offer::*; +#[doc(hidden)] +pub mod portal_flows_flow; +#[doc(inline)] +pub use portal_flows_flow::*; +#[doc(hidden)] +pub mod portal_flows_flow_after_completion; +#[doc(inline)] +pub use portal_flows_flow_after_completion::*; +#[doc(hidden)] +pub mod portal_flows_flow_subscription_cancel; +#[doc(inline)] +pub use portal_flows_flow_subscription_cancel::*; +#[doc(hidden)] +pub mod portal_flows_flow_subscription_update; +#[doc(inline)] +pub use portal_flows_flow_subscription_update::*; +#[doc(hidden)] +pub mod portal_flows_flow_subscription_update_confirm; +#[doc(inline)] +pub use portal_flows_flow_subscription_update_confirm::*; +#[doc(hidden)] +pub mod portal_flows_retention; +#[doc(inline)] +pub use portal_flows_retention::*; +#[doc(hidden)] +pub mod portal_flows_subscription_update_confirm_discount; +#[doc(inline)] +pub use portal_flows_subscription_update_confirm_discount::*; +#[doc(hidden)] +pub mod portal_flows_subscription_update_confirm_item; +#[doc(inline)] +pub use portal_flows_subscription_update_confirm_item::*; +#[doc(hidden)] +pub mod portal_invoice_list; +#[doc(inline)] +pub use portal_invoice_list::*; +#[doc(hidden)] +pub mod portal_login_page; +#[doc(inline)] +pub use portal_login_page::*; +#[doc(hidden)] +pub mod portal_payment_method_update; +#[doc(inline)] +pub use portal_payment_method_update::*; +#[doc(hidden)] +pub mod portal_subscription_cancel; +#[doc(inline)] +pub use portal_subscription_cancel::*; +#[doc(hidden)] +pub mod portal_subscription_cancellation_reason; +#[doc(inline)] +pub use portal_subscription_cancellation_reason::*; +#[doc(hidden)] +pub mod portal_subscription_pause; +#[doc(inline)] +pub use portal_subscription_pause::*; +#[doc(hidden)] +pub mod portal_subscription_update; +#[doc(inline)] +pub use portal_subscription_update::*; +#[doc(hidden)] +pub mod portal_subscription_update_product; +#[doc(inline)] +pub use portal_subscription_update_product::*; +pub mod quote; +pub use stripe_shared::quote::*; +pub use stripe_shared::quotes_resource_automatic_tax::*; +pub use stripe_shared::quotes_resource_computed::*; +pub use stripe_shared::quotes_resource_from_quote::*; +pub use stripe_shared::quotes_resource_recurring::*; +pub use stripe_shared::quotes_resource_status_transitions::*; +pub use stripe_shared::quotes_resource_subscription_data_subscription_data::*; +pub use stripe_shared::quotes_resource_total_details::*; +pub use stripe_shared::quotes_resource_total_details_resource_breakdown::*; +pub use stripe_shared::quotes_resource_transfer_data::*; +pub use stripe_shared::quotes_resource_upfront::*; +pub use stripe_shared::schedules_phase_automatic_tax::*; +pub use usage_record::types::*; +pub mod subscription; +pub mod usage_record; +pub use stripe_shared::subscription::*; +pub use stripe_shared::subscription_automatic_tax::*; +pub use stripe_shared::subscription_billing_thresholds::*; +pub use stripe_shared::subscription_details_data::*; +pub mod subscription_item; +pub use stripe_shared::subscription_item::*; +pub use stripe_shared::subscription_item_billing_thresholds::*; +pub use stripe_shared::subscription_payment_method_options_card::*; +pub use stripe_shared::subscription_pending_invoice_item_interval::*; +pub mod subscription_schedule; +pub use stripe_shared::subscription_schedule::*; +pub use stripe_shared::subscription_schedule_add_invoice_item::*; +pub use stripe_shared::subscription_schedule_configuration_item::*; +pub use stripe_shared::subscription_schedule_current_phase::*; +pub use stripe_shared::subscription_schedule_phase_configuration::*; +pub use stripe_shared::subscription_schedules_resource_default_settings::*; +pub use stripe_shared::subscription_schedules_resource_default_settings_automatic_tax::*; +pub use stripe_shared::subscription_transfer_data::*; +pub use stripe_shared::subscriptions_resource_billing_cycle_anchor_config::*; +pub use stripe_shared::subscriptions_resource_pause_collection::*; +pub use stripe_shared::subscriptions_resource_payment_method_options::*; +pub use stripe_shared::subscriptions_resource_payment_settings::*; +pub use stripe_shared::subscriptions_resource_pending_update::*; +pub use stripe_shared::tax_i_ds_owner::*; +pub mod tax_id; +pub use stripe_shared::tax_id::*; +pub use stripe_shared::tax_id_verification::*; +pub mod test_helpers_test_clock; +pub use stripe_shared::test_helpers_test_clock::*; +pub use stripe_shared::transform_usage::*; diff --git a/generated/stripe_billing/src/plan/mod.rs b/generated/stripe_billing/src/plan/mod.rs new file mode 100644 index 000000000..e198ea1b0 --- /dev/null +++ b/generated/stripe_billing/src/plan/mod.rs @@ -0,0 +1,4 @@ +#[cfg(feature = "plan")] +mod requests; +#[cfg(feature = "plan")] +pub use requests::*; diff --git a/generated/stripe_billing/src/plan/requests.rs b/generated/stripe_billing/src/plan/requests.rs new file mode 100644 index 000000000..c2394c9db --- /dev/null +++ b/generated/stripe_billing/src/plan/requests.rs @@ -0,0 +1,392 @@ +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct DeletePlan {} +impl DeletePlan { + pub fn new() -> Self { + Self::default() + } +} +impl DeletePlan { + /// Deleting plans means new subscribers can’t be added. Existing subscribers aren’t affected. + pub fn send( + &self, + client: &stripe::Client, + plan: &stripe_shared::PlanId, + ) -> stripe::Response { + client.send_form(&format!("/plans/{plan}"), self, http_types::Method::Delete) + } +} +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct ListPlan<'a> { + /// Only return plans that are active or inactive (e.g., pass `false` to list all inactive plans). + #[serde(skip_serializing_if = "Option::is_none")] + pub active: Option, + /// A filter on the list, based on the object `created` field. + /// The value can be a string with an integer Unix timestamp, or it can be a dictionary with a number of different query options. + #[serde(skip_serializing_if = "Option::is_none")] + pub created: Option, + /// A cursor for use in pagination. + /// `ending_before` is an object ID that defines your place in the list. + /// For instance, if you make a list request and receive 100 objects, starting with `obj_bar`, your subsequent call can include `ending_before=obj_bar` in order to fetch the previous page of the list. + #[serde(skip_serializing_if = "Option::is_none")] + pub ending_before: Option<&'a str>, + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, + /// A limit on the number of objects to be returned. + /// Limit can range between 1 and 100, and the default is 10. + #[serde(skip_serializing_if = "Option::is_none")] + pub limit: Option, + /// Only return plans for the given product. + #[serde(skip_serializing_if = "Option::is_none")] + pub product: Option<&'a str>, + /// A cursor for use in pagination. + /// `starting_after` is an object ID that defines your place in the list. + /// For instance, if you make a list request and receive 100 objects, ending with `obj_foo`, your subsequent call can include `starting_after=obj_foo` in order to fetch the next page of the list. + #[serde(skip_serializing_if = "Option::is_none")] + pub starting_after: Option<&'a str>, +} +impl<'a> ListPlan<'a> { + pub fn new() -> Self { + Self::default() + } +} +impl<'a> ListPlan<'a> { + /// Returns a list of your plans. + pub fn send( + &self, + client: &stripe::Client, + ) -> stripe::Response> { + client.get_query("/plans", self) + } + pub fn paginate(self) -> stripe::ListPaginator> { + stripe::ListPaginator::from_list_params("/plans", self) + } +} +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct RetrievePlan<'a> { + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, +} +impl<'a> RetrievePlan<'a> { + pub fn new() -> Self { + Self::default() + } +} +impl<'a> RetrievePlan<'a> { + /// Retrieves the plan with the given ID. + pub fn send( + &self, + client: &stripe::Client, + plan: &stripe_shared::PlanId, + ) -> stripe::Response { + client.get_query(&format!("/plans/{plan}"), self) + } +} +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreatePlan<'a> { + /// Whether the plan is currently available for new subscriptions. Defaults to `true`. + #[serde(skip_serializing_if = "Option::is_none")] + pub active: Option, + /// Specifies a usage aggregation strategy for plans of `usage_type=metered`. + /// Allowed values are `sum` for summing up all usage during a period, `last_during_period` for using the last usage record reported within a period, `last_ever` for using the last usage record ever (across period bounds) or `max` which uses the usage record with the maximum reported usage during a period. + /// Defaults to `sum`. + #[serde(skip_serializing_if = "Option::is_none")] + pub aggregate_usage: Option, + /// A positive integer in cents (or local equivalent) (or 0 for a free plan) representing how much to charge on a recurring basis. + #[serde(skip_serializing_if = "Option::is_none")] + pub amount: Option, + /// Same as `amount`, but accepts a decimal value with at most 12 decimal places. + /// Only one of `amount` and `amount_decimal` can be set. + #[serde(skip_serializing_if = "Option::is_none")] + pub amount_decimal: Option<&'a str>, + /// Describes how to compute the price per period. + /// Either `per_unit` or `tiered`. + /// `per_unit` indicates that the fixed amount (specified in `amount`) will be charged per unit in `quantity` (for plans with `usage_type=licensed`), or per unit of total usage (for plans with `usage_type=metered`). + /// `tiered` indicates that the unit pricing will be computed using a tiering strategy as defined using the `tiers` and `tiers_mode` attributes. + #[serde(skip_serializing_if = "Option::is_none")] + pub billing_scheme: Option, + /// Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. + /// Must be a [supported currency](https://stripe.com/docs/currencies). + pub currency: stripe_types::Currency, + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, + /// An identifier randomly generated by Stripe. + /// Used to identify this plan when subscribing a customer. + /// You can optionally override this ID, but the ID must be unique across all plans in your Stripe account. + /// You can, however, use the same plan ID in both live and test modes. + #[serde(skip_serializing_if = "Option::is_none")] + pub id: Option<&'a str>, + /// Specifies billing frequency. Either `day`, `week`, `month` or `year`. + pub interval: stripe_shared::PlanInterval, + /// The number of intervals between subscription billings. + /// For example, `interval=month` and `interval_count=3` bills every 3 months. + /// Maximum of three years interval allowed (3 years, 36 months, or 156 weeks). + #[serde(skip_serializing_if = "Option::is_none")] + pub interval_count: Option, + /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. + /// This can be useful for storing additional information about the object in a structured format. + /// Individual keys can be unset by posting an empty value to them. + /// All keys can be unset by posting an empty value to `metadata`. + #[serde(skip_serializing_if = "Option::is_none")] + pub metadata: Option<&'a std::collections::HashMap>, + /// A brief description of the plan, hidden from customers. + #[serde(skip_serializing_if = "Option::is_none")] + pub nickname: Option<&'a str>, + #[serde(skip_serializing_if = "Option::is_none")] + pub product: Option>, + /// Each element represents a pricing tier. + /// This parameter requires `billing_scheme` to be set to `tiered`. + /// See also the documentation for `billing_scheme`. + #[serde(skip_serializing_if = "Option::is_none")] + pub tiers: Option<&'a [CreatePlanTiers<'a>]>, + /// Defines if the tiering price should be `graduated` or `volume` based. + /// In `volume`-based tiering, the maximum quantity within a period determines the per unit price, in `graduated` tiering pricing can successively change as the quantity grows. + #[serde(skip_serializing_if = "Option::is_none")] + pub tiers_mode: Option, + /// Apply a transformation to the reported usage or set quantity before computing the billed price. + /// Cannot be combined with `tiers`. + #[serde(skip_serializing_if = "Option::is_none")] + pub transform_usage: Option, + /// Default number of trial days when subscribing a customer to this plan using [`trial_from_plan=true`](https://stripe.com/docs/api#create_subscription-trial_from_plan). + #[serde(skip_serializing_if = "Option::is_none")] + pub trial_period_days: Option, + /// Configures how the quantity per period should be determined. + /// Can be either `metered` or `licensed`. + /// `licensed` automatically bills the `quantity` set when adding it to a subscription. + /// `metered` aggregates the total usage based on usage records. + /// Defaults to `licensed`. + #[serde(skip_serializing_if = "Option::is_none")] + pub usage_type: Option, +} +impl<'a> CreatePlan<'a> { + pub fn new(currency: stripe_types::Currency, interval: stripe_shared::PlanInterval) -> Self { + Self { + active: None, + aggregate_usage: None, + amount: None, + amount_decimal: None, + billing_scheme: None, + currency, + expand: None, + id: None, + interval, + interval_count: None, + metadata: None, + nickname: None, + product: None, + tiers: None, + tiers_mode: None, + transform_usage: None, + trial_period_days: None, + usage_type: None, + } + } +} +#[derive(Copy, Clone, Debug, serde::Serialize)] +#[serde(untagged)] +pub enum CreatePlanProduct<'a> { + InlineProductParams(CreatePlanInlineProductParams<'a>), + Id(&'a str), +} +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreatePlanInlineProductParams<'a> { + /// Whether the product is currently available for purchase. Defaults to `true`. + #[serde(skip_serializing_if = "Option::is_none")] + pub active: Option, + /// The identifier for the product. + /// Must be unique. + /// If not provided, an identifier will be randomly generated. + #[serde(skip_serializing_if = "Option::is_none")] + pub id: Option<&'a str>, + /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. + /// This can be useful for storing additional information about the object in a structured format. + /// Individual keys can be unset by posting an empty value to them. + /// All keys can be unset by posting an empty value to `metadata`. + #[serde(skip_serializing_if = "Option::is_none")] + pub metadata: Option<&'a std::collections::HashMap>, + /// The product's name, meant to be displayable to the customer. + pub name: &'a str, + /// An arbitrary string to be displayed on your customer's credit card or bank statement. + /// While most banks display this information consistently, some may display it incorrectly or not at all. + /// + /// This may be up to 22 characters. + /// The statement description may not include `<`, `>`, `\`, `"`, `'` characters, and will appear on your customer's statement in capital letters. + /// Non-ASCII characters are automatically stripped. + #[serde(skip_serializing_if = "Option::is_none")] + pub statement_descriptor: Option<&'a str>, + /// A [tax code](https://stripe.com/docs/tax/tax-categories) ID. + #[serde(skip_serializing_if = "Option::is_none")] + pub tax_code: Option<&'a str>, + /// A label that represents units of this product. + /// When set, this will be included in customers' receipts, invoices, Checkout, and the customer portal. + #[serde(skip_serializing_if = "Option::is_none")] + pub unit_label: Option<&'a str>, +} +impl<'a> CreatePlanInlineProductParams<'a> { + pub fn new(name: &'a str) -> Self { + Self { + active: None, + id: None, + metadata: None, + name, + statement_descriptor: None, + tax_code: None, + unit_label: None, + } + } +} +/// Each element represents a pricing tier. +/// This parameter requires `billing_scheme` to be set to `tiered`. +/// See also the documentation for `billing_scheme`. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreatePlanTiers<'a> { + /// The flat billing amount for an entire tier, regardless of the number of units in the tier. + #[serde(skip_serializing_if = "Option::is_none")] + pub flat_amount: Option, + /// Same as `flat_amount`, but accepts a decimal value representing an integer in the minor units of the currency. + /// Only one of `flat_amount` and `flat_amount_decimal` can be set. + #[serde(skip_serializing_if = "Option::is_none")] + pub flat_amount_decimal: Option<&'a str>, + /// The per unit billing amount for each individual unit for which this tier applies. + #[serde(skip_serializing_if = "Option::is_none")] + pub unit_amount: Option, + /// Same as `unit_amount`, but accepts a decimal value in cents (or local equivalent) with at most 12 decimal places. + /// Only one of `unit_amount` and `unit_amount_decimal` can be set. + #[serde(skip_serializing_if = "Option::is_none")] + pub unit_amount_decimal: Option<&'a str>, + /// Specifies the upper bound of this tier. + /// The lower bound of a tier is the upper bound of the previous tier adding one. + /// Use `inf` to define a fallback tier. + pub up_to: CreatePlanTiersUpTo, +} +impl<'a> CreatePlanTiers<'a> { + pub fn new(up_to: CreatePlanTiersUpTo) -> Self { + Self { + flat_amount: None, + flat_amount_decimal: None, + unit_amount: None, + unit_amount_decimal: None, + up_to, + } + } +} +/// Specifies the upper bound of this tier. +/// The lower bound of a tier is the upper bound of the previous tier adding one. +/// Use `inf` to define a fallback tier. +#[derive(Copy, Clone, Debug, serde::Serialize)] +#[serde(untagged)] +pub enum CreatePlanTiersUpTo { + Inf, + I64(i64), +} +/// Apply a transformation to the reported usage or set quantity before computing the billed price. +/// Cannot be combined with `tiers`. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreatePlanTransformUsage { + /// Divide usage by this number. + pub divide_by: i64, + /// After division, either round the result `up` or `down`. + pub round: CreatePlanTransformUsageRound, +} +impl CreatePlanTransformUsage { + pub fn new(divide_by: i64, round: CreatePlanTransformUsageRound) -> Self { + Self { divide_by, round } + } +} +/// After division, either round the result `up` or `down`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreatePlanTransformUsageRound { + Down, + Up, +} +impl CreatePlanTransformUsageRound { + pub fn as_str(self) -> &'static str { + use CreatePlanTransformUsageRound::*; + match self { + Down => "down", + Up => "up", + } + } +} + +impl std::str::FromStr for CreatePlanTransformUsageRound { + type Err = (); + fn from_str(s: &str) -> Result { + use CreatePlanTransformUsageRound::*; + match s { + "down" => Ok(Down), + "up" => Ok(Up), + _ => Err(()), + } + } +} +impl std::fmt::Display for CreatePlanTransformUsageRound { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreatePlanTransformUsageRound { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreatePlanTransformUsageRound { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'a> CreatePlan<'a> { + /// You can now model subscriptions more flexibly using the [Prices API](https://stripe.com/docs/api#prices). + /// It replaces the Plans API and is backwards compatible to simplify your migration. + pub fn send(&self, client: &stripe::Client) -> stripe::Response { + client.send_form("/plans", self, http_types::Method::Post) + } +} +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdatePlan<'a> { + /// Whether the plan is currently available for new subscriptions. + #[serde(skip_serializing_if = "Option::is_none")] + pub active: Option, + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, + /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. + /// This can be useful for storing additional information about the object in a structured format. + /// Individual keys can be unset by posting an empty value to them. + /// All keys can be unset by posting an empty value to `metadata`. + #[serde(skip_serializing_if = "Option::is_none")] + pub metadata: Option<&'a std::collections::HashMap>, + /// A brief description of the plan, hidden from customers. + #[serde(skip_serializing_if = "Option::is_none")] + pub nickname: Option<&'a str>, + /// The product the plan belongs to. + /// This cannot be changed once it has been used in a subscription or subscription schedule. + #[serde(skip_serializing_if = "Option::is_none")] + pub product: Option<&'a str>, + /// Default number of trial days when subscribing a customer to this plan using [`trial_from_plan=true`](https://stripe.com/docs/api#create_subscription-trial_from_plan). + #[serde(skip_serializing_if = "Option::is_none")] + pub trial_period_days: Option, +} +impl<'a> UpdatePlan<'a> { + pub fn new() -> Self { + Self::default() + } +} +impl<'a> UpdatePlan<'a> { + /// Updates the specified plan by setting the values of the parameters passed. + /// Any parameters not provided are left unchanged. + /// By design, you cannot change a plan’s ID, amount, currency, or billing cycle. + pub fn send( + &self, + client: &stripe::Client, + plan: &stripe_shared::PlanId, + ) -> stripe::Response { + client.send_form(&format!("/plans/{plan}"), self, http_types::Method::Post) + } +} diff --git a/generated/stripe_billing/src/portal_business_profile.rs b/generated/stripe_billing/src/portal_business_profile.rs new file mode 100644 index 000000000..3252be5c4 --- /dev/null +++ b/generated/stripe_billing/src/portal_business_profile.rs @@ -0,0 +1,9 @@ +#[derive(Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct PortalBusinessProfile { + /// The messaging shown to customers in the portal. + pub headline: Option, + /// A link to the business’s publicly available privacy policy. + pub privacy_policy_url: Option, + /// A link to the business’s publicly available terms of service. + pub terms_of_service_url: Option, +} diff --git a/generated/stripe_billing/src/portal_customer_update.rs b/generated/stripe_billing/src/portal_customer_update.rs new file mode 100644 index 000000000..7bb767b97 --- /dev/null +++ b/generated/stripe_billing/src/portal_customer_update.rs @@ -0,0 +1,74 @@ +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct PortalCustomerUpdate { + /// The types of customer updates that are supported. When empty, customers are not updateable. + pub allowed_updates: Vec, + /// Whether the feature is enabled. + pub enabled: bool, +} +/// The types of customer updates that are supported. When empty, customers are not updateable. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum PortalCustomerUpdateAllowedUpdates { + Address, + Email, + Name, + Phone, + Shipping, + TaxId, +} +impl PortalCustomerUpdateAllowedUpdates { + pub fn as_str(self) -> &'static str { + use PortalCustomerUpdateAllowedUpdates::*; + match self { + Address => "address", + Email => "email", + Name => "name", + Phone => "phone", + Shipping => "shipping", + TaxId => "tax_id", + } + } +} + +impl std::str::FromStr for PortalCustomerUpdateAllowedUpdates { + type Err = (); + fn from_str(s: &str) -> Result { + use PortalCustomerUpdateAllowedUpdates::*; + match s { + "address" => Ok(Address), + "email" => Ok(Email), + "name" => Ok(Name), + "phone" => Ok(Phone), + "shipping" => Ok(Shipping), + "tax_id" => Ok(TaxId), + _ => Err(()), + } + } +} +impl std::fmt::Display for PortalCustomerUpdateAllowedUpdates { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for PortalCustomerUpdateAllowedUpdates { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for PortalCustomerUpdateAllowedUpdates { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for PortalCustomerUpdateAllowedUpdates { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| { + serde::de::Error::custom("Unknown value for PortalCustomerUpdateAllowedUpdates") + }) + } +} diff --git a/generated/stripe_billing/src/portal_features.rs b/generated/stripe_billing/src/portal_features.rs new file mode 100644 index 000000000..e5ad9e671 --- /dev/null +++ b/generated/stripe_billing/src/portal_features.rs @@ -0,0 +1,9 @@ +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct PortalFeatures { + pub customer_update: stripe_billing::PortalCustomerUpdate, + pub invoice_history: stripe_billing::PortalInvoiceList, + pub payment_method_update: stripe_billing::PortalPaymentMethodUpdate, + pub subscription_cancel: stripe_billing::PortalSubscriptionCancel, + pub subscription_pause: stripe_billing::PortalSubscriptionPause, + pub subscription_update: stripe_billing::PortalSubscriptionUpdate, +} diff --git a/generated/stripe_billing/src/portal_flows_after_completion_hosted_confirmation.rs b/generated/stripe_billing/src/portal_flows_after_completion_hosted_confirmation.rs new file mode 100644 index 000000000..1c65b58ad --- /dev/null +++ b/generated/stripe_billing/src/portal_flows_after_completion_hosted_confirmation.rs @@ -0,0 +1,5 @@ +#[derive(Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct PortalFlowsAfterCompletionHostedConfirmation { + /// A custom message to display to the customer after the flow is completed. + pub custom_message: Option, +} diff --git a/generated/stripe_billing/src/portal_flows_after_completion_redirect.rs b/generated/stripe_billing/src/portal_flows_after_completion_redirect.rs new file mode 100644 index 000000000..e8a4b2d5c --- /dev/null +++ b/generated/stripe_billing/src/portal_flows_after_completion_redirect.rs @@ -0,0 +1,5 @@ +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct PortalFlowsAfterCompletionRedirect { + /// The URL the customer will be redirected to after the flow is completed. + pub return_url: String, +} diff --git a/generated/stripe_billing/src/portal_flows_coupon_offer.rs b/generated/stripe_billing/src/portal_flows_coupon_offer.rs new file mode 100644 index 000000000..d56e0fd0f --- /dev/null +++ b/generated/stripe_billing/src/portal_flows_coupon_offer.rs @@ -0,0 +1,5 @@ +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct PortalFlowsCouponOffer { + /// The ID of the coupon to be offered. + pub coupon: String, +} diff --git a/generated/stripe_billing/src/portal_flows_flow.rs b/generated/stripe_billing/src/portal_flows_flow.rs new file mode 100644 index 000000000..6258cfb43 --- /dev/null +++ b/generated/stripe_billing/src/portal_flows_flow.rs @@ -0,0 +1,74 @@ +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct PortalFlowsFlow { + pub after_completion: stripe_billing::PortalFlowsFlowAfterCompletion, + /// Configuration when `flow.type=subscription_cancel`. + pub subscription_cancel: Option, + /// Configuration when `flow.type=subscription_update`. + pub subscription_update: Option, + /// Configuration when `flow.type=subscription_update_confirm`. + pub subscription_update_confirm: + Option, + /// Type of flow that the customer will go through. + #[serde(rename = "type")] + pub type_: PortalFlowsFlowType, +} +/// Type of flow that the customer will go through. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum PortalFlowsFlowType { + PaymentMethodUpdate, + SubscriptionCancel, + SubscriptionUpdate, + SubscriptionUpdateConfirm, +} +impl PortalFlowsFlowType { + pub fn as_str(self) -> &'static str { + use PortalFlowsFlowType::*; + match self { + PaymentMethodUpdate => "payment_method_update", + SubscriptionCancel => "subscription_cancel", + SubscriptionUpdate => "subscription_update", + SubscriptionUpdateConfirm => "subscription_update_confirm", + } + } +} + +impl std::str::FromStr for PortalFlowsFlowType { + type Err = (); + fn from_str(s: &str) -> Result { + use PortalFlowsFlowType::*; + match s { + "payment_method_update" => Ok(PaymentMethodUpdate), + "subscription_cancel" => Ok(SubscriptionCancel), + "subscription_update" => Ok(SubscriptionUpdate), + "subscription_update_confirm" => Ok(SubscriptionUpdateConfirm), + _ => Err(()), + } + } +} +impl std::fmt::Display for PortalFlowsFlowType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for PortalFlowsFlowType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for PortalFlowsFlowType { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for PortalFlowsFlowType { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s) + .map_err(|_| serde::de::Error::custom("Unknown value for PortalFlowsFlowType")) + } +} diff --git a/generated/stripe_billing/src/portal_flows_flow_after_completion.rs b/generated/stripe_billing/src/portal_flows_flow_after_completion.rs new file mode 100644 index 000000000..7c36e7a79 --- /dev/null +++ b/generated/stripe_billing/src/portal_flows_flow_after_completion.rs @@ -0,0 +1,68 @@ +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct PortalFlowsFlowAfterCompletion { + /// Configuration when `after_completion.type=hosted_confirmation`. + pub hosted_confirmation: Option, + /// Configuration when `after_completion.type=redirect`. + pub redirect: Option, + /// The specified type of behavior after the flow is completed. + #[serde(rename = "type")] + pub type_: PortalFlowsFlowAfterCompletionType, +} +/// The specified type of behavior after the flow is completed. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum PortalFlowsFlowAfterCompletionType { + HostedConfirmation, + PortalHomepage, + Redirect, +} +impl PortalFlowsFlowAfterCompletionType { + pub fn as_str(self) -> &'static str { + use PortalFlowsFlowAfterCompletionType::*; + match self { + HostedConfirmation => "hosted_confirmation", + PortalHomepage => "portal_homepage", + Redirect => "redirect", + } + } +} + +impl std::str::FromStr for PortalFlowsFlowAfterCompletionType { + type Err = (); + fn from_str(s: &str) -> Result { + use PortalFlowsFlowAfterCompletionType::*; + match s { + "hosted_confirmation" => Ok(HostedConfirmation), + "portal_homepage" => Ok(PortalHomepage), + "redirect" => Ok(Redirect), + _ => Err(()), + } + } +} +impl std::fmt::Display for PortalFlowsFlowAfterCompletionType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for PortalFlowsFlowAfterCompletionType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for PortalFlowsFlowAfterCompletionType { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for PortalFlowsFlowAfterCompletionType { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| { + serde::de::Error::custom("Unknown value for PortalFlowsFlowAfterCompletionType") + }) + } +} diff --git a/generated/stripe_billing/src/portal_flows_flow_subscription_cancel.rs b/generated/stripe_billing/src/portal_flows_flow_subscription_cancel.rs new file mode 100644 index 000000000..64d6de5d8 --- /dev/null +++ b/generated/stripe_billing/src/portal_flows_flow_subscription_cancel.rs @@ -0,0 +1,7 @@ +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct PortalFlowsFlowSubscriptionCancel { + /// Specify a retention strategy to be used in the cancellation flow. + pub retention: Option, + /// The ID of the subscription to be canceled. + pub subscription: String, +} diff --git a/generated/stripe_billing/src/portal_flows_flow_subscription_update.rs b/generated/stripe_billing/src/portal_flows_flow_subscription_update.rs new file mode 100644 index 000000000..36545392d --- /dev/null +++ b/generated/stripe_billing/src/portal_flows_flow_subscription_update.rs @@ -0,0 +1,5 @@ +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct PortalFlowsFlowSubscriptionUpdate { + /// The ID of the subscription to be updated. + pub subscription: String, +} diff --git a/generated/stripe_billing/src/portal_flows_flow_subscription_update_confirm.rs b/generated/stripe_billing/src/portal_flows_flow_subscription_update_confirm.rs new file mode 100644 index 000000000..6b2ff9a61 --- /dev/null +++ b/generated/stripe_billing/src/portal_flows_flow_subscription_update_confirm.rs @@ -0,0 +1,11 @@ +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct PortalFlowsFlowSubscriptionUpdateConfirm { + /// The coupon or promotion code to apply to this subscription update. + /// Currently, only up to one may be specified. + pub discounts: Option>, + /// The [subscription item](https://stripe.com/docs/api/subscription_items) to be updated through this flow. + /// Currently, only up to one may be specified and subscriptions with multiple items are not updatable. + pub items: Vec, + /// The ID of the subscription to be updated. + pub subscription: String, +} diff --git a/generated/stripe_billing/src/portal_flows_retention.rs b/generated/stripe_billing/src/portal_flows_retention.rs new file mode 100644 index 000000000..8b633441f --- /dev/null +++ b/generated/stripe_billing/src/portal_flows_retention.rs @@ -0,0 +1,59 @@ +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct PortalFlowsRetention { + /// Configuration when `retention.type=coupon_offer`. + pub coupon_offer: Option, + /// Type of retention strategy that will be used. + #[serde(rename = "type")] + pub type_: PortalFlowsRetentionType, +} +/// Type of retention strategy that will be used. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum PortalFlowsRetentionType { + CouponOffer, +} +impl PortalFlowsRetentionType { + pub fn as_str(self) -> &'static str { + use PortalFlowsRetentionType::*; + match self { + CouponOffer => "coupon_offer", + } + } +} + +impl std::str::FromStr for PortalFlowsRetentionType { + type Err = (); + fn from_str(s: &str) -> Result { + use PortalFlowsRetentionType::*; + match s { + "coupon_offer" => Ok(CouponOffer), + _ => Err(()), + } + } +} +impl std::fmt::Display for PortalFlowsRetentionType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for PortalFlowsRetentionType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for PortalFlowsRetentionType { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for PortalFlowsRetentionType { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s) + .map_err(|_| serde::de::Error::custom("Unknown value for PortalFlowsRetentionType")) + } +} diff --git a/generated/stripe_billing/src/portal_flows_subscription_update_confirm_discount.rs b/generated/stripe_billing/src/portal_flows_subscription_update_confirm_discount.rs new file mode 100644 index 000000000..eb869a581 --- /dev/null +++ b/generated/stripe_billing/src/portal_flows_subscription_update_confirm_discount.rs @@ -0,0 +1,7 @@ +#[derive(Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct PortalFlowsSubscriptionUpdateConfirmDiscount { + /// The ID of the coupon to apply to this subscription update. + pub coupon: Option, + /// The ID of a promotion code to apply to this subscription update. + pub promotion_code: Option, +} diff --git a/generated/stripe_billing/src/portal_flows_subscription_update_confirm_item.rs b/generated/stripe_billing/src/portal_flows_subscription_update_confirm_item.rs new file mode 100644 index 000000000..498cdec57 --- /dev/null +++ b/generated/stripe_billing/src/portal_flows_subscription_update_confirm_item.rs @@ -0,0 +1,18 @@ +#[derive(Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct PortalFlowsSubscriptionUpdateConfirmItem { + /// The ID of the [subscription item](https://stripe.com/docs/api/subscriptions/object#subscription_object-items-data-id) to be updated. + pub id: Option, + /// The price the customer should subscribe to through this flow. + /// The price must also be included in the configuration's [`features.subscription_update.products`](https://stripe.com/docs/api/customer_portal/configuration#portal_configuration_object-features-subscription_update-products). + pub price: Option, + /// [Quantity](https://stripe.com/docs/subscriptions/quantities) for this item that the customer should subscribe to through this flow. + #[serde(skip_serializing_if = "Option::is_none")] + pub quantity: Option, +} +impl stripe_types::Object for PortalFlowsSubscriptionUpdateConfirmItem { + type Id = Option; + fn id(&self) -> &Self::Id { + &self.id + } +} +stripe_types::def_id!(PortalFlowsSubscriptionUpdateConfirmItemId); diff --git a/generated/stripe_billing/src/portal_invoice_list.rs b/generated/stripe_billing/src/portal_invoice_list.rs new file mode 100644 index 000000000..5bfc9c90a --- /dev/null +++ b/generated/stripe_billing/src/portal_invoice_list.rs @@ -0,0 +1,5 @@ +#[derive(Copy, Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct PortalInvoiceList { + /// Whether the feature is enabled. + pub enabled: bool, +} diff --git a/generated/stripe_billing/src/portal_login_page.rs b/generated/stripe_billing/src/portal_login_page.rs new file mode 100644 index 000000000..79231eab9 --- /dev/null +++ b/generated/stripe_billing/src/portal_login_page.rs @@ -0,0 +1,10 @@ +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct PortalLoginPage { + /// If `true`, a shareable `url` will be generated that will take your customers to a hosted login page for the customer portal. + /// + /// If `false`, the previously generated `url`, if any, will be deactivated. + pub enabled: bool, + /// A shareable URL to the hosted portal login page. + /// Your customers will be able to log in with their [email](https://stripe.com/docs/api/customers/object#customer_object-email) and receive a link to their customer portal. + pub url: Option, +} diff --git a/generated/stripe_billing/src/portal_payment_method_update.rs b/generated/stripe_billing/src/portal_payment_method_update.rs new file mode 100644 index 000000000..1c2e06ae5 --- /dev/null +++ b/generated/stripe_billing/src/portal_payment_method_update.rs @@ -0,0 +1,5 @@ +#[derive(Copy, Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct PortalPaymentMethodUpdate { + /// Whether the feature is enabled. + pub enabled: bool, +} diff --git a/generated/stripe_billing/src/portal_subscription_cancel.rs b/generated/stripe_billing/src/portal_subscription_cancel.rs new file mode 100644 index 000000000..40e5023bb --- /dev/null +++ b/generated/stripe_billing/src/portal_subscription_cancel.rs @@ -0,0 +1,124 @@ +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct PortalSubscriptionCancel { + pub cancellation_reason: stripe_billing::PortalSubscriptionCancellationReason, + /// Whether the feature is enabled. + pub enabled: bool, + /// Whether to cancel subscriptions immediately or at the end of the billing period. + pub mode: PortalSubscriptionCancelMode, + /// Whether to create prorations when canceling subscriptions. + /// Possible values are `none` and `create_prorations`. + pub proration_behavior: PortalSubscriptionCancelProrationBehavior, +} +/// Whether to cancel subscriptions immediately or at the end of the billing period. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum PortalSubscriptionCancelMode { + AtPeriodEnd, + Immediately, +} +impl PortalSubscriptionCancelMode { + pub fn as_str(self) -> &'static str { + use PortalSubscriptionCancelMode::*; + match self { + AtPeriodEnd => "at_period_end", + Immediately => "immediately", + } + } +} + +impl std::str::FromStr for PortalSubscriptionCancelMode { + type Err = (); + fn from_str(s: &str) -> Result { + use PortalSubscriptionCancelMode::*; + match s { + "at_period_end" => Ok(AtPeriodEnd), + "immediately" => Ok(Immediately), + _ => Err(()), + } + } +} +impl std::fmt::Display for PortalSubscriptionCancelMode { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for PortalSubscriptionCancelMode { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for PortalSubscriptionCancelMode { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for PortalSubscriptionCancelMode { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s) + .map_err(|_| serde::de::Error::custom("Unknown value for PortalSubscriptionCancelMode")) + } +} +/// Whether to create prorations when canceling subscriptions. +/// Possible values are `none` and `create_prorations`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum PortalSubscriptionCancelProrationBehavior { + AlwaysInvoice, + CreateProrations, + None, +} +impl PortalSubscriptionCancelProrationBehavior { + pub fn as_str(self) -> &'static str { + use PortalSubscriptionCancelProrationBehavior::*; + match self { + AlwaysInvoice => "always_invoice", + CreateProrations => "create_prorations", + None => "none", + } + } +} + +impl std::str::FromStr for PortalSubscriptionCancelProrationBehavior { + type Err = (); + fn from_str(s: &str) -> Result { + use PortalSubscriptionCancelProrationBehavior::*; + match s { + "always_invoice" => Ok(AlwaysInvoice), + "create_prorations" => Ok(CreateProrations), + "none" => Ok(None), + _ => Err(()), + } + } +} +impl std::fmt::Display for PortalSubscriptionCancelProrationBehavior { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for PortalSubscriptionCancelProrationBehavior { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for PortalSubscriptionCancelProrationBehavior { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for PortalSubscriptionCancelProrationBehavior { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| { + serde::de::Error::custom("Unknown value for PortalSubscriptionCancelProrationBehavior") + }) + } +} diff --git a/generated/stripe_billing/src/portal_subscription_cancellation_reason.rs b/generated/stripe_billing/src/portal_subscription_cancellation_reason.rs new file mode 100644 index 000000000..689eb829c --- /dev/null +++ b/generated/stripe_billing/src/portal_subscription_cancellation_reason.rs @@ -0,0 +1,82 @@ +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct PortalSubscriptionCancellationReason { + /// Whether the feature is enabled. + pub enabled: bool, + /// Which cancellation reasons will be given as options to the customer. + pub options: Vec, +} +/// Which cancellation reasons will be given as options to the customer. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum PortalSubscriptionCancellationReasonOptions { + CustomerService, + LowQuality, + MissingFeatures, + Other, + SwitchedService, + TooComplex, + TooExpensive, + Unused, +} +impl PortalSubscriptionCancellationReasonOptions { + pub fn as_str(self) -> &'static str { + use PortalSubscriptionCancellationReasonOptions::*; + match self { + CustomerService => "customer_service", + LowQuality => "low_quality", + MissingFeatures => "missing_features", + Other => "other", + SwitchedService => "switched_service", + TooComplex => "too_complex", + TooExpensive => "too_expensive", + Unused => "unused", + } + } +} + +impl std::str::FromStr for PortalSubscriptionCancellationReasonOptions { + type Err = (); + fn from_str(s: &str) -> Result { + use PortalSubscriptionCancellationReasonOptions::*; + match s { + "customer_service" => Ok(CustomerService), + "low_quality" => Ok(LowQuality), + "missing_features" => Ok(MissingFeatures), + "other" => Ok(Other), + "switched_service" => Ok(SwitchedService), + "too_complex" => Ok(TooComplex), + "too_expensive" => Ok(TooExpensive), + "unused" => Ok(Unused), + _ => Err(()), + } + } +} +impl std::fmt::Display for PortalSubscriptionCancellationReasonOptions { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for PortalSubscriptionCancellationReasonOptions { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for PortalSubscriptionCancellationReasonOptions { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for PortalSubscriptionCancellationReasonOptions { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| { + serde::de::Error::custom( + "Unknown value for PortalSubscriptionCancellationReasonOptions", + ) + }) + } +} diff --git a/generated/stripe_billing/src/portal_subscription_pause.rs b/generated/stripe_billing/src/portal_subscription_pause.rs new file mode 100644 index 000000000..edb26171c --- /dev/null +++ b/generated/stripe_billing/src/portal_subscription_pause.rs @@ -0,0 +1,5 @@ +#[derive(Copy, Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct PortalSubscriptionPause { + /// Whether the feature is enabled. + pub enabled: bool, +} diff --git a/generated/stripe_billing/src/portal_subscription_update.rs b/generated/stripe_billing/src/portal_subscription_update.rs new file mode 100644 index 000000000..dad7ba67c --- /dev/null +++ b/generated/stripe_billing/src/portal_subscription_update.rs @@ -0,0 +1,133 @@ +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct PortalSubscriptionUpdate { + /// The types of subscription updates that are supported for items listed in the `products` attribute. + /// When empty, subscriptions are not updateable. + pub default_allowed_updates: Vec, + /// Whether the feature is enabled. + pub enabled: bool, + /// The list of up to 10 products that support subscription updates. + pub products: Option>, + /// Determines how to handle prorations resulting from subscription updates. + /// Valid values are `none`, `create_prorations`, and `always_invoice`. + pub proration_behavior: PortalSubscriptionUpdateProrationBehavior, +} +/// The types of subscription updates that are supported for items listed in the `products` attribute. +/// When empty, subscriptions are not updateable. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum PortalSubscriptionUpdateDefaultAllowedUpdates { + Price, + PromotionCode, + Quantity, +} +impl PortalSubscriptionUpdateDefaultAllowedUpdates { + pub fn as_str(self) -> &'static str { + use PortalSubscriptionUpdateDefaultAllowedUpdates::*; + match self { + Price => "price", + PromotionCode => "promotion_code", + Quantity => "quantity", + } + } +} + +impl std::str::FromStr for PortalSubscriptionUpdateDefaultAllowedUpdates { + type Err = (); + fn from_str(s: &str) -> Result { + use PortalSubscriptionUpdateDefaultAllowedUpdates::*; + match s { + "price" => Ok(Price), + "promotion_code" => Ok(PromotionCode), + "quantity" => Ok(Quantity), + _ => Err(()), + } + } +} +impl std::fmt::Display for PortalSubscriptionUpdateDefaultAllowedUpdates { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for PortalSubscriptionUpdateDefaultAllowedUpdates { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for PortalSubscriptionUpdateDefaultAllowedUpdates { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for PortalSubscriptionUpdateDefaultAllowedUpdates { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| { + serde::de::Error::custom( + "Unknown value for PortalSubscriptionUpdateDefaultAllowedUpdates", + ) + }) + } +} +/// Determines how to handle prorations resulting from subscription updates. +/// Valid values are `none`, `create_prorations`, and `always_invoice`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum PortalSubscriptionUpdateProrationBehavior { + AlwaysInvoice, + CreateProrations, + None, +} +impl PortalSubscriptionUpdateProrationBehavior { + pub fn as_str(self) -> &'static str { + use PortalSubscriptionUpdateProrationBehavior::*; + match self { + AlwaysInvoice => "always_invoice", + CreateProrations => "create_prorations", + None => "none", + } + } +} + +impl std::str::FromStr for PortalSubscriptionUpdateProrationBehavior { + type Err = (); + fn from_str(s: &str) -> Result { + use PortalSubscriptionUpdateProrationBehavior::*; + match s { + "always_invoice" => Ok(AlwaysInvoice), + "create_prorations" => Ok(CreateProrations), + "none" => Ok(None), + _ => Err(()), + } + } +} +impl std::fmt::Display for PortalSubscriptionUpdateProrationBehavior { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for PortalSubscriptionUpdateProrationBehavior { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for PortalSubscriptionUpdateProrationBehavior { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for PortalSubscriptionUpdateProrationBehavior { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| { + serde::de::Error::custom("Unknown value for PortalSubscriptionUpdateProrationBehavior") + }) + } +} diff --git a/generated/stripe_billing/src/portal_subscription_update_product.rs b/generated/stripe_billing/src/portal_subscription_update_product.rs new file mode 100644 index 000000000..6eb5cf77c --- /dev/null +++ b/generated/stripe_billing/src/portal_subscription_update_product.rs @@ -0,0 +1,7 @@ +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct PortalSubscriptionUpdateProduct { + /// The list of price IDs which, when subscribed to, a subscription can be updated. + pub prices: Vec, + /// The product ID. + pub product: String, +} diff --git a/generated/stripe_billing/src/quote/mod.rs b/generated/stripe_billing/src/quote/mod.rs new file mode 100644 index 000000000..069f82751 --- /dev/null +++ b/generated/stripe_billing/src/quote/mod.rs @@ -0,0 +1,4 @@ +#[cfg(feature = "quote")] +mod requests; +#[cfg(feature = "quote")] +pub use requests::*; diff --git a/generated/stripe_billing/src/quote/requests.rs b/generated/stripe_billing/src/quote/requests.rs new file mode 100644 index 000000000..909de6f16 --- /dev/null +++ b/generated/stripe_billing/src/quote/requests.rs @@ -0,0 +1,1221 @@ +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct ListQuote<'a> { + /// The ID of the customer whose quotes will be retrieved. + #[serde(skip_serializing_if = "Option::is_none")] + pub customer: Option<&'a str>, + /// A cursor for use in pagination. + /// `ending_before` is an object ID that defines your place in the list. + /// For instance, if you make a list request and receive 100 objects, starting with `obj_bar`, your subsequent call can include `ending_before=obj_bar` in order to fetch the previous page of the list. + #[serde(skip_serializing_if = "Option::is_none")] + pub ending_before: Option<&'a str>, + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, + /// A limit on the number of objects to be returned. + /// Limit can range between 1 and 100, and the default is 10. + #[serde(skip_serializing_if = "Option::is_none")] + pub limit: Option, + /// A cursor for use in pagination. + /// `starting_after` is an object ID that defines your place in the list. + /// For instance, if you make a list request and receive 100 objects, ending with `obj_foo`, your subsequent call can include `starting_after=obj_foo` in order to fetch the next page of the list. + #[serde(skip_serializing_if = "Option::is_none")] + pub starting_after: Option<&'a str>, + /// The status of the quote. + #[serde(skip_serializing_if = "Option::is_none")] + pub status: Option, + /// Provides a list of quotes that are associated with the specified test clock. + /// The response will not include quotes with test clocks if this and the customer parameter is not set. + #[serde(skip_serializing_if = "Option::is_none")] + pub test_clock: Option<&'a str>, +} +impl<'a> ListQuote<'a> { + pub fn new() -> Self { + Self::default() + } +} +impl<'a> ListQuote<'a> { + /// Returns a list of your quotes. + pub fn send( + &self, + client: &stripe::Client, + ) -> stripe::Response> { + client.get_query("/quotes", self) + } + pub fn paginate(self) -> stripe::ListPaginator> { + stripe::ListPaginator::from_list_params("/quotes", self) + } +} +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct RetrieveQuote<'a> { + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, +} +impl<'a> RetrieveQuote<'a> { + pub fn new() -> Self { + Self::default() + } +} +impl<'a> RetrieveQuote<'a> { + /// Retrieves the quote with the given ID. + pub fn send( + &self, + client: &stripe::Client, + quote: &stripe_shared::QuoteId, + ) -> stripe::Response { + client.get_query(&format!("/quotes/{quote}"), self) + } +} +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct ListComputedUpfrontLineItemsQuote<'a> { + /// A cursor for use in pagination. + /// `ending_before` is an object ID that defines your place in the list. + /// For instance, if you make a list request and receive 100 objects, starting with `obj_bar`, your subsequent call can include `ending_before=obj_bar` in order to fetch the previous page of the list. + #[serde(skip_serializing_if = "Option::is_none")] + pub ending_before: Option<&'a str>, + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, + /// A limit on the number of objects to be returned. + /// Limit can range between 1 and 100, and the default is 10. + #[serde(skip_serializing_if = "Option::is_none")] + pub limit: Option, + /// A cursor for use in pagination. + /// `starting_after` is an object ID that defines your place in the list. + /// For instance, if you make a list request and receive 100 objects, ending with `obj_foo`, your subsequent call can include `starting_after=obj_foo` in order to fetch the next page of the list. + #[serde(skip_serializing_if = "Option::is_none")] + pub starting_after: Option<&'a str>, +} +impl<'a> ListComputedUpfrontLineItemsQuote<'a> { + pub fn new() -> Self { + Self::default() + } +} +impl<'a> ListComputedUpfrontLineItemsQuote<'a> { + /// When retrieving a quote, there is an includable **computed.upfront.line_items** property containing the first handful of those items. + /// There is also a URL where you can retrieve the full (paginated) list of upfront line items. + pub fn send( + &self, + client: &stripe::Client, + quote: &stripe_shared::QuoteId, + ) -> stripe::Response> { + client.get_query(&format!("/quotes/{quote}/computed_upfront_line_items"), self) + } + pub fn paginate( + self, + quote: &stripe_shared::QuoteId, + ) -> stripe::ListPaginator> { + stripe::ListPaginator::from_list_params( + &format!("/quotes/{quote}/computed_upfront_line_items"), + self, + ) + } +} +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct ListLineItemsQuote<'a> { + /// A cursor for use in pagination. + /// `ending_before` is an object ID that defines your place in the list. + /// For instance, if you make a list request and receive 100 objects, starting with `obj_bar`, your subsequent call can include `ending_before=obj_bar` in order to fetch the previous page of the list. + #[serde(skip_serializing_if = "Option::is_none")] + pub ending_before: Option<&'a str>, + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, + /// A limit on the number of objects to be returned. + /// Limit can range between 1 and 100, and the default is 10. + #[serde(skip_serializing_if = "Option::is_none")] + pub limit: Option, + /// A cursor for use in pagination. + /// `starting_after` is an object ID that defines your place in the list. + /// For instance, if you make a list request and receive 100 objects, ending with `obj_foo`, your subsequent call can include `starting_after=obj_foo` in order to fetch the next page of the list. + #[serde(skip_serializing_if = "Option::is_none")] + pub starting_after: Option<&'a str>, +} +impl<'a> ListLineItemsQuote<'a> { + pub fn new() -> Self { + Self::default() + } +} +impl<'a> ListLineItemsQuote<'a> { + /// When retrieving a quote, there is an includable **line_items** property containing the first handful of those items. + /// There is also a URL where you can retrieve the full (paginated) list of line items. + pub fn send( + &self, + client: &stripe::Client, + quote: &stripe_shared::QuoteId, + ) -> stripe::Response> { + client.get_query(&format!("/quotes/{quote}/line_items"), self) + } + pub fn paginate( + self, + quote: &stripe_shared::QuoteId, + ) -> stripe::ListPaginator> { + stripe::ListPaginator::from_list_params(&format!("/quotes/{quote}/line_items"), self) + } +} +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreateQuote<'a> { + /// The amount of the application fee (if any) that will be requested to be applied to the payment and transferred to the application owner's Stripe account. + /// There cannot be any line items with recurring prices when using this field. + #[serde(skip_serializing_if = "Option::is_none")] + pub application_fee_amount: Option, + /// A non-negative decimal between 0 and 100, with at most two decimal places. + /// This represents the percentage of the subscription invoice total that will be transferred to the application owner's Stripe account. + /// There must be at least 1 line item with a recurring price to use this field. + #[serde(skip_serializing_if = "Option::is_none")] + pub application_fee_percent: Option, + /// Settings for automatic tax lookup for this quote and resulting invoices and subscriptions. + #[serde(skip_serializing_if = "Option::is_none")] + pub automatic_tax: Option>, + /// Either `charge_automatically`, or `send_invoice`. + /// When charging automatically, Stripe will attempt to pay invoices at the end of the subscription cycle or at invoice finalization using the default payment method attached to the subscription or customer. + /// When sending an invoice, Stripe will email your customer an invoice with payment instructions and mark the subscription as `active`. + /// Defaults to `charge_automatically`. + #[serde(skip_serializing_if = "Option::is_none")] + pub collection_method: Option, + /// The customer for which this quote belongs to. + /// A customer is required before finalizing the quote. + /// Once specified, it cannot be changed. + #[serde(skip_serializing_if = "Option::is_none")] + pub customer: Option<&'a str>, + /// The tax rates that will apply to any line item that does not have `tax_rates` set. + #[serde(skip_serializing_if = "Option::is_none")] + pub default_tax_rates: Option<&'a [&'a str]>, + /// A description that will be displayed on the quote PDF. + /// If no value is passed, the default description configured in your [quote template settings](https://dashboard.stripe.com/settings/billing/quote) will be used. + #[serde(skip_serializing_if = "Option::is_none")] + pub description: Option<&'a str>, + /// The discounts applied to the quote. You can only set up to one discount. + #[serde(skip_serializing_if = "Option::is_none")] + pub discounts: Option<&'a [DiscountsDataParam<'a>]>, + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, + /// A future timestamp on which the quote will be canceled if in `open` or `draft` status. + /// Measured in seconds since the Unix epoch. + /// If no value is passed, the default expiration date configured in your [quote template settings](https://dashboard.stripe.com/settings/billing/quote) will be used. + #[serde(skip_serializing_if = "Option::is_none")] + pub expires_at: Option, + /// A footer that will be displayed on the quote PDF. + /// If no value is passed, the default footer configured in your [quote template settings](https://dashboard.stripe.com/settings/billing/quote) will be used. + #[serde(skip_serializing_if = "Option::is_none")] + pub footer: Option<&'a str>, + /// Clone an existing quote. + /// The new quote will be created in `status=draft`. + /// When using this parameter, you cannot specify any other parameters except for `expires_at`. + #[serde(skip_serializing_if = "Option::is_none")] + pub from_quote: Option>, + /// A header that will be displayed on the quote PDF. + /// If no value is passed, the default header configured in your [quote template settings](https://dashboard.stripe.com/settings/billing/quote) will be used. + #[serde(skip_serializing_if = "Option::is_none")] + pub header: Option<&'a str>, + /// All invoices will be billed using the specified settings. + #[serde(skip_serializing_if = "Option::is_none")] + pub invoice_settings: Option>, + /// A list of line items the customer is being quoted for. + /// Each line item includes information about the product, the quantity, and the resulting cost. + #[serde(skip_serializing_if = "Option::is_none")] + pub line_items: Option<&'a [CreateQuoteLineItems<'a>]>, + /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. + /// This can be useful for storing additional information about the object in a structured format. + /// Individual keys can be unset by posting an empty value to them. + /// All keys can be unset by posting an empty value to `metadata`. + #[serde(skip_serializing_if = "Option::is_none")] + pub metadata: Option<&'a std::collections::HashMap>, + /// The account on behalf of which to charge. + #[serde(skip_serializing_if = "Option::is_none")] + pub on_behalf_of: Option<&'a str>, + /// When creating a subscription or subscription schedule, the specified configuration data will be used. + /// There must be at least one line item with a recurring price for a subscription or subscription schedule to be created. + /// A subscription schedule is created if `subscription_data[effective_date]` is present and in the future, otherwise a subscription is created. + #[serde(skip_serializing_if = "Option::is_none")] + pub subscription_data: Option>, + /// ID of the test clock to attach to the quote. + #[serde(skip_serializing_if = "Option::is_none")] + pub test_clock: Option<&'a str>, + /// The data with which to automatically create a Transfer for each of the invoices. + #[serde(skip_serializing_if = "Option::is_none")] + pub transfer_data: Option>, +} +impl<'a> CreateQuote<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// Settings for automatic tax lookup for this quote and resulting invoices and subscriptions. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreateQuoteAutomaticTax<'a> { + /// Controls whether Stripe will automatically compute tax on the resulting invoices or subscriptions as well as the quote itself. + pub enabled: bool, + /// The account that's liable for tax. + /// If set, the business address and tax registrations required to perform the tax calculation are loaded from this account. + /// The tax transaction is returned in the report of the connected account. + #[serde(skip_serializing_if = "Option::is_none")] + pub liability: Option>, +} +impl<'a> CreateQuoteAutomaticTax<'a> { + pub fn new(enabled: bool) -> Self { + Self { enabled, liability: None } + } +} +/// The account that's liable for tax. +/// If set, the business address and tax registrations required to perform the tax calculation are loaded from this account. +/// The tax transaction is returned in the report of the connected account. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreateQuoteAutomaticTaxLiability<'a> { + /// The connected account being referenced when `type` is `account`. + #[serde(skip_serializing_if = "Option::is_none")] + pub account: Option<&'a str>, + /// Type of the account referenced in the request. + #[serde(rename = "type")] + pub type_: CreateQuoteAutomaticTaxLiabilityType, +} +impl<'a> CreateQuoteAutomaticTaxLiability<'a> { + pub fn new(type_: CreateQuoteAutomaticTaxLiabilityType) -> Self { + Self { account: None, type_ } + } +} +/// Type of the account referenced in the request. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreateQuoteAutomaticTaxLiabilityType { + Account, + Self_, +} +impl CreateQuoteAutomaticTaxLiabilityType { + pub fn as_str(self) -> &'static str { + use CreateQuoteAutomaticTaxLiabilityType::*; + match self { + Account => "account", + Self_ => "self", + } + } +} + +impl std::str::FromStr for CreateQuoteAutomaticTaxLiabilityType { + type Err = (); + fn from_str(s: &str) -> Result { + use CreateQuoteAutomaticTaxLiabilityType::*; + match s { + "account" => Ok(Account), + "self" => Ok(Self_), + _ => Err(()), + } + } +} +impl std::fmt::Display for CreateQuoteAutomaticTaxLiabilityType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreateQuoteAutomaticTaxLiabilityType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreateQuoteAutomaticTaxLiabilityType { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Clone an existing quote. +/// The new quote will be created in `status=draft`. +/// When using this parameter, you cannot specify any other parameters except for `expires_at`. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreateQuoteFromQuote<'a> { + /// Whether this quote is a revision of the previous quote. + #[serde(skip_serializing_if = "Option::is_none")] + pub is_revision: Option, + /// The `id` of the quote that will be cloned. + pub quote: &'a str, +} +impl<'a> CreateQuoteFromQuote<'a> { + pub fn new(quote: &'a str) -> Self { + Self { is_revision: None, quote } + } +} +/// All invoices will be billed using the specified settings. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreateQuoteInvoiceSettings<'a> { + /// Number of days within which a customer must pay the invoice generated by this quote. + /// This value will be `null` for quotes where `collection_method=charge_automatically`. + #[serde(skip_serializing_if = "Option::is_none")] + pub days_until_due: Option, + /// The connected account that issues the invoice. + /// The invoice is presented with the branding and support information of the specified account. + #[serde(skip_serializing_if = "Option::is_none")] + pub issuer: Option>, +} +impl<'a> CreateQuoteInvoiceSettings<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// The connected account that issues the invoice. +/// The invoice is presented with the branding and support information of the specified account. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreateQuoteInvoiceSettingsIssuer<'a> { + /// The connected account being referenced when `type` is `account`. + #[serde(skip_serializing_if = "Option::is_none")] + pub account: Option<&'a str>, + /// Type of the account referenced in the request. + #[serde(rename = "type")] + pub type_: CreateQuoteInvoiceSettingsIssuerType, +} +impl<'a> CreateQuoteInvoiceSettingsIssuer<'a> { + pub fn new(type_: CreateQuoteInvoiceSettingsIssuerType) -> Self { + Self { account: None, type_ } + } +} +/// Type of the account referenced in the request. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreateQuoteInvoiceSettingsIssuerType { + Account, + Self_, +} +impl CreateQuoteInvoiceSettingsIssuerType { + pub fn as_str(self) -> &'static str { + use CreateQuoteInvoiceSettingsIssuerType::*; + match self { + Account => "account", + Self_ => "self", + } + } +} + +impl std::str::FromStr for CreateQuoteInvoiceSettingsIssuerType { + type Err = (); + fn from_str(s: &str) -> Result { + use CreateQuoteInvoiceSettingsIssuerType::*; + match s { + "account" => Ok(Account), + "self" => Ok(Self_), + _ => Err(()), + } + } +} +impl std::fmt::Display for CreateQuoteInvoiceSettingsIssuerType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreateQuoteInvoiceSettingsIssuerType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreateQuoteInvoiceSettingsIssuerType { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// A list of line items the customer is being quoted for. +/// Each line item includes information about the product, the quantity, and the resulting cost. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreateQuoteLineItems<'a> { + /// The ID of the price object. One of `price` or `price_data` is required. + #[serde(skip_serializing_if = "Option::is_none")] + pub price: Option<&'a str>, + /// Data used to generate a new [Price](https://stripe.com/docs/api/prices) object inline. + /// One of `price` or `price_data` is required. + #[serde(skip_serializing_if = "Option::is_none")] + pub price_data: Option>, + /// The quantity of the line item. + #[serde(skip_serializing_if = "Option::is_none")] + pub quantity: Option, + /// The tax rates which apply to the line item. + /// When set, the `default_tax_rates` on the quote do not apply to this line item. + #[serde(skip_serializing_if = "Option::is_none")] + pub tax_rates: Option<&'a [&'a str]>, +} +impl<'a> CreateQuoteLineItems<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// Data used to generate a new [Price](https://stripe.com/docs/api/prices) object inline. +/// One of `price` or `price_data` is required. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreateQuoteLineItemsPriceData<'a> { + /// Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. + /// Must be a [supported currency](https://stripe.com/docs/currencies). + pub currency: stripe_types::Currency, + /// The ID of the product that this price will belong to. + pub product: &'a str, + /// The recurring components of a price such as `interval` and `interval_count`. + #[serde(skip_serializing_if = "Option::is_none")] + pub recurring: Option, + /// Only required if a [default tax behavior](https://stripe.com/docs/tax/products-prices-tax-categories-tax-behavior#setting-a-default-tax-behavior-(recommended)) was not provided in the Stripe Tax settings. + /// Specifies whether the price is considered inclusive of taxes or exclusive of taxes. + /// One of `inclusive`, `exclusive`, or `unspecified`. + /// Once specified as either `inclusive` or `exclusive`, it cannot be changed. + #[serde(skip_serializing_if = "Option::is_none")] + pub tax_behavior: Option, + /// A positive integer in cents (or local equivalent) (or 0 for a free price) representing how much to charge. + #[serde(skip_serializing_if = "Option::is_none")] + pub unit_amount: Option, + /// Same as `unit_amount`, but accepts a decimal value in cents (or local equivalent) with at most 12 decimal places. + /// Only one of `unit_amount` and `unit_amount_decimal` can be set. + #[serde(skip_serializing_if = "Option::is_none")] + pub unit_amount_decimal: Option<&'a str>, +} +impl<'a> CreateQuoteLineItemsPriceData<'a> { + pub fn new(currency: stripe_types::Currency, product: &'a str) -> Self { + Self { + currency, + product, + recurring: None, + tax_behavior: None, + unit_amount: None, + unit_amount_decimal: None, + } + } +} +/// The recurring components of a price such as `interval` and `interval_count`. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreateQuoteLineItemsPriceDataRecurring { + /// Specifies billing frequency. Either `day`, `week`, `month` or `year`. + pub interval: CreateQuoteLineItemsPriceDataRecurringInterval, + /// The number of intervals between subscription billings. + /// For example, `interval=month` and `interval_count=3` bills every 3 months. + /// Maximum of three years interval allowed (3 years, 36 months, or 156 weeks). + #[serde(skip_serializing_if = "Option::is_none")] + pub interval_count: Option, +} +impl CreateQuoteLineItemsPriceDataRecurring { + pub fn new(interval: CreateQuoteLineItemsPriceDataRecurringInterval) -> Self { + Self { interval, interval_count: None } + } +} +/// Specifies billing frequency. Either `day`, `week`, `month` or `year`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreateQuoteLineItemsPriceDataRecurringInterval { + Day, + Month, + Week, + Year, +} +impl CreateQuoteLineItemsPriceDataRecurringInterval { + pub fn as_str(self) -> &'static str { + use CreateQuoteLineItemsPriceDataRecurringInterval::*; + match self { + Day => "day", + Month => "month", + Week => "week", + Year => "year", + } + } +} + +impl std::str::FromStr for CreateQuoteLineItemsPriceDataRecurringInterval { + type Err = (); + fn from_str(s: &str) -> Result { + use CreateQuoteLineItemsPriceDataRecurringInterval::*; + match s { + "day" => Ok(Day), + "month" => Ok(Month), + "week" => Ok(Week), + "year" => Ok(Year), + _ => Err(()), + } + } +} +impl std::fmt::Display for CreateQuoteLineItemsPriceDataRecurringInterval { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreateQuoteLineItemsPriceDataRecurringInterval { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreateQuoteLineItemsPriceDataRecurringInterval { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Only required if a [default tax behavior](https://stripe.com/docs/tax/products-prices-tax-categories-tax-behavior#setting-a-default-tax-behavior-(recommended)) was not provided in the Stripe Tax settings. +/// Specifies whether the price is considered inclusive of taxes or exclusive of taxes. +/// One of `inclusive`, `exclusive`, or `unspecified`. +/// Once specified as either `inclusive` or `exclusive`, it cannot be changed. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreateQuoteLineItemsPriceDataTaxBehavior { + Exclusive, + Inclusive, + Unspecified, +} +impl CreateQuoteLineItemsPriceDataTaxBehavior { + pub fn as_str(self) -> &'static str { + use CreateQuoteLineItemsPriceDataTaxBehavior::*; + match self { + Exclusive => "exclusive", + Inclusive => "inclusive", + Unspecified => "unspecified", + } + } +} + +impl std::str::FromStr for CreateQuoteLineItemsPriceDataTaxBehavior { + type Err = (); + fn from_str(s: &str) -> Result { + use CreateQuoteLineItemsPriceDataTaxBehavior::*; + match s { + "exclusive" => Ok(Exclusive), + "inclusive" => Ok(Inclusive), + "unspecified" => Ok(Unspecified), + _ => Err(()), + } + } +} +impl std::fmt::Display for CreateQuoteLineItemsPriceDataTaxBehavior { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreateQuoteLineItemsPriceDataTaxBehavior { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreateQuoteLineItemsPriceDataTaxBehavior { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// When creating a subscription or subscription schedule, the specified configuration data will be used. +/// There must be at least one line item with a recurring price for a subscription or subscription schedule to be created. +/// A subscription schedule is created if `subscription_data[effective_date]` is present and in the future, otherwise a subscription is created. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreateQuoteSubscriptionData<'a> { + /// The subscription's description, meant to be displayable to the customer. + /// Use this field to optionally store an explanation of the subscription for rendering in Stripe surfaces and certain local payment methods UIs. + #[serde(skip_serializing_if = "Option::is_none")] + pub description: Option<&'a str>, + /// When creating a new subscription, the date of which the subscription schedule will start after the quote is accepted. + /// When updating a subscription, the date of which the subscription will be updated using a subscription schedule. + /// The special value `current_period_end` can be provided to update a subscription at the end of its current period. + /// The `effective_date` is ignored if it is in the past when the quote is accepted. + #[serde(skip_serializing_if = "Option::is_none")] + pub effective_date: Option, + /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that will set metadata on the subscription or subscription schedule when the quote is accepted. + /// If a recurring price is included in `line_items`, this field will be passed to the resulting subscription's `metadata` field. + /// If `subscription_data.effective_date` is used, this field will be passed to the resulting subscription schedule's `phases.metadata` field. + /// Unlike object-level metadata, this field is declarative. + /// Updates will clear prior values. + #[serde(skip_serializing_if = "Option::is_none")] + pub metadata: Option<&'a std::collections::HashMap>, + /// Integer representing the number of trial period days before the customer is charged for the first time. + #[serde(skip_serializing_if = "Option::is_none")] + pub trial_period_days: Option, +} +impl<'a> CreateQuoteSubscriptionData<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// When creating a new subscription, the date of which the subscription schedule will start after the quote is accepted. +/// When updating a subscription, the date of which the subscription will be updated using a subscription schedule. +/// The special value `current_period_end` can be provided to update a subscription at the end of its current period. +/// The `effective_date` is ignored if it is in the past when the quote is accepted. +#[derive(Copy, Clone, Debug, serde::Serialize)] +#[serde(untagged)] +pub enum CreateQuoteSubscriptionDataEffectiveDate { + CurrentPeriodEnd, + Timestamp(stripe_types::Timestamp), +} +impl<'a> CreateQuote<'a> { + /// A quote models prices and services for a customer. + /// Default options for `header`, `description`, `footer`, and `expires_at` can be set in the dashboard via the [quote template](https://dashboard.stripe.com/settings/billing/quote). + pub fn send(&self, client: &stripe::Client) -> stripe::Response { + client.send_form("/quotes", self, http_types::Method::Post) + } +} +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdateQuote<'a> { + /// The amount of the application fee (if any) that will be requested to be applied to the payment and transferred to the application owner's Stripe account. + /// There cannot be any line items with recurring prices when using this field. + #[serde(skip_serializing_if = "Option::is_none")] + pub application_fee_amount: Option, + /// A non-negative decimal between 0 and 100, with at most two decimal places. + /// This represents the percentage of the subscription invoice total that will be transferred to the application owner's Stripe account. + /// There must be at least 1 line item with a recurring price to use this field. + #[serde(skip_serializing_if = "Option::is_none")] + pub application_fee_percent: Option, + /// Settings for automatic tax lookup for this quote and resulting invoices and subscriptions. + #[serde(skip_serializing_if = "Option::is_none")] + pub automatic_tax: Option>, + /// Either `charge_automatically`, or `send_invoice`. + /// When charging automatically, Stripe will attempt to pay invoices at the end of the subscription cycle or at invoice finalization using the default payment method attached to the subscription or customer. + /// When sending an invoice, Stripe will email your customer an invoice with payment instructions and mark the subscription as `active`. + /// Defaults to `charge_automatically`. + #[serde(skip_serializing_if = "Option::is_none")] + pub collection_method: Option, + /// The customer for which this quote belongs to. + /// A customer is required before finalizing the quote. + /// Once specified, it cannot be changed. + #[serde(skip_serializing_if = "Option::is_none")] + pub customer: Option<&'a str>, + /// The tax rates that will apply to any line item that does not have `tax_rates` set. + #[serde(skip_serializing_if = "Option::is_none")] + pub default_tax_rates: Option<&'a [&'a str]>, + /// A description that will be displayed on the quote PDF. + #[serde(skip_serializing_if = "Option::is_none")] + pub description: Option<&'a str>, + /// The discounts applied to the quote. You can only set up to one discount. + #[serde(skip_serializing_if = "Option::is_none")] + pub discounts: Option<&'a [DiscountsDataParam<'a>]>, + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, + /// A future timestamp on which the quote will be canceled if in `open` or `draft` status. + /// Measured in seconds since the Unix epoch. + #[serde(skip_serializing_if = "Option::is_none")] + pub expires_at: Option, + /// A footer that will be displayed on the quote PDF. + #[serde(skip_serializing_if = "Option::is_none")] + pub footer: Option<&'a str>, + /// A header that will be displayed on the quote PDF. + #[serde(skip_serializing_if = "Option::is_none")] + pub header: Option<&'a str>, + /// All invoices will be billed using the specified settings. + #[serde(skip_serializing_if = "Option::is_none")] + pub invoice_settings: Option>, + /// A list of line items the customer is being quoted for. + /// Each line item includes information about the product, the quantity, and the resulting cost. + #[serde(skip_serializing_if = "Option::is_none")] + pub line_items: Option<&'a [UpdateQuoteLineItems<'a>]>, + /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. + /// This can be useful for storing additional information about the object in a structured format. + /// Individual keys can be unset by posting an empty value to them. + /// All keys can be unset by posting an empty value to `metadata`. + #[serde(skip_serializing_if = "Option::is_none")] + pub metadata: Option<&'a std::collections::HashMap>, + /// The account on behalf of which to charge. + #[serde(skip_serializing_if = "Option::is_none")] + pub on_behalf_of: Option<&'a str>, + /// When creating a subscription or subscription schedule, the specified configuration data will be used. + /// There must be at least one line item with a recurring price for a subscription or subscription schedule to be created. + /// A subscription schedule is created if `subscription_data[effective_date]` is present and in the future, otherwise a subscription is created. + #[serde(skip_serializing_if = "Option::is_none")] + pub subscription_data: Option>, + /// The data with which to automatically create a Transfer for each of the invoices. + #[serde(skip_serializing_if = "Option::is_none")] + pub transfer_data: Option>, +} +impl<'a> UpdateQuote<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// Settings for automatic tax lookup for this quote and resulting invoices and subscriptions. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct UpdateQuoteAutomaticTax<'a> { + /// Controls whether Stripe will automatically compute tax on the resulting invoices or subscriptions as well as the quote itself. + pub enabled: bool, + /// The account that's liable for tax. + /// If set, the business address and tax registrations required to perform the tax calculation are loaded from this account. + /// The tax transaction is returned in the report of the connected account. + #[serde(skip_serializing_if = "Option::is_none")] + pub liability: Option>, +} +impl<'a> UpdateQuoteAutomaticTax<'a> { + pub fn new(enabled: bool) -> Self { + Self { enabled, liability: None } + } +} +/// The account that's liable for tax. +/// If set, the business address and tax registrations required to perform the tax calculation are loaded from this account. +/// The tax transaction is returned in the report of the connected account. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct UpdateQuoteAutomaticTaxLiability<'a> { + /// The connected account being referenced when `type` is `account`. + #[serde(skip_serializing_if = "Option::is_none")] + pub account: Option<&'a str>, + /// Type of the account referenced in the request. + #[serde(rename = "type")] + pub type_: UpdateQuoteAutomaticTaxLiabilityType, +} +impl<'a> UpdateQuoteAutomaticTaxLiability<'a> { + pub fn new(type_: UpdateQuoteAutomaticTaxLiabilityType) -> Self { + Self { account: None, type_ } + } +} +/// Type of the account referenced in the request. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum UpdateQuoteAutomaticTaxLiabilityType { + Account, + Self_, +} +impl UpdateQuoteAutomaticTaxLiabilityType { + pub fn as_str(self) -> &'static str { + use UpdateQuoteAutomaticTaxLiabilityType::*; + match self { + Account => "account", + Self_ => "self", + } + } +} + +impl std::str::FromStr for UpdateQuoteAutomaticTaxLiabilityType { + type Err = (); + fn from_str(s: &str) -> Result { + use UpdateQuoteAutomaticTaxLiabilityType::*; + match s { + "account" => Ok(Account), + "self" => Ok(Self_), + _ => Err(()), + } + } +} +impl std::fmt::Display for UpdateQuoteAutomaticTaxLiabilityType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for UpdateQuoteAutomaticTaxLiabilityType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for UpdateQuoteAutomaticTaxLiabilityType { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// All invoices will be billed using the specified settings. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdateQuoteInvoiceSettings<'a> { + /// Number of days within which a customer must pay the invoice generated by this quote. + /// This value will be `null` for quotes where `collection_method=charge_automatically`. + #[serde(skip_serializing_if = "Option::is_none")] + pub days_until_due: Option, + /// The connected account that issues the invoice. + /// The invoice is presented with the branding and support information of the specified account. + #[serde(skip_serializing_if = "Option::is_none")] + pub issuer: Option>, +} +impl<'a> UpdateQuoteInvoiceSettings<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// The connected account that issues the invoice. +/// The invoice is presented with the branding and support information of the specified account. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct UpdateQuoteInvoiceSettingsIssuer<'a> { + /// The connected account being referenced when `type` is `account`. + #[serde(skip_serializing_if = "Option::is_none")] + pub account: Option<&'a str>, + /// Type of the account referenced in the request. + #[serde(rename = "type")] + pub type_: UpdateQuoteInvoiceSettingsIssuerType, +} +impl<'a> UpdateQuoteInvoiceSettingsIssuer<'a> { + pub fn new(type_: UpdateQuoteInvoiceSettingsIssuerType) -> Self { + Self { account: None, type_ } + } +} +/// Type of the account referenced in the request. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum UpdateQuoteInvoiceSettingsIssuerType { + Account, + Self_, +} +impl UpdateQuoteInvoiceSettingsIssuerType { + pub fn as_str(self) -> &'static str { + use UpdateQuoteInvoiceSettingsIssuerType::*; + match self { + Account => "account", + Self_ => "self", + } + } +} + +impl std::str::FromStr for UpdateQuoteInvoiceSettingsIssuerType { + type Err = (); + fn from_str(s: &str) -> Result { + use UpdateQuoteInvoiceSettingsIssuerType::*; + match s { + "account" => Ok(Account), + "self" => Ok(Self_), + _ => Err(()), + } + } +} +impl std::fmt::Display for UpdateQuoteInvoiceSettingsIssuerType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for UpdateQuoteInvoiceSettingsIssuerType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for UpdateQuoteInvoiceSettingsIssuerType { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// A list of line items the customer is being quoted for. +/// Each line item includes information about the product, the quantity, and the resulting cost. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdateQuoteLineItems<'a> { + /// The ID of an existing line item on the quote. + #[serde(skip_serializing_if = "Option::is_none")] + pub id: Option<&'a str>, + /// The ID of the price object. One of `price` or `price_data` is required. + #[serde(skip_serializing_if = "Option::is_none")] + pub price: Option<&'a str>, + /// Data used to generate a new [Price](https://stripe.com/docs/api/prices) object inline. + /// One of `price` or `price_data` is required. + #[serde(skip_serializing_if = "Option::is_none")] + pub price_data: Option>, + /// The quantity of the line item. + #[serde(skip_serializing_if = "Option::is_none")] + pub quantity: Option, + /// The tax rates which apply to the line item. + /// When set, the `default_tax_rates` on the quote do not apply to this line item. + #[serde(skip_serializing_if = "Option::is_none")] + pub tax_rates: Option<&'a [&'a str]>, +} +impl<'a> UpdateQuoteLineItems<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// Data used to generate a new [Price](https://stripe.com/docs/api/prices) object inline. +/// One of `price` or `price_data` is required. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct UpdateQuoteLineItemsPriceData<'a> { + /// Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. + /// Must be a [supported currency](https://stripe.com/docs/currencies). + pub currency: stripe_types::Currency, + /// The ID of the product that this price will belong to. + pub product: &'a str, + /// The recurring components of a price such as `interval` and `interval_count`. + #[serde(skip_serializing_if = "Option::is_none")] + pub recurring: Option, + /// Only required if a [default tax behavior](https://stripe.com/docs/tax/products-prices-tax-categories-tax-behavior#setting-a-default-tax-behavior-(recommended)) was not provided in the Stripe Tax settings. + /// Specifies whether the price is considered inclusive of taxes or exclusive of taxes. + /// One of `inclusive`, `exclusive`, or `unspecified`. + /// Once specified as either `inclusive` or `exclusive`, it cannot be changed. + #[serde(skip_serializing_if = "Option::is_none")] + pub tax_behavior: Option, + /// A positive integer in cents (or local equivalent) (or 0 for a free price) representing how much to charge. + #[serde(skip_serializing_if = "Option::is_none")] + pub unit_amount: Option, + /// Same as `unit_amount`, but accepts a decimal value in cents (or local equivalent) with at most 12 decimal places. + /// Only one of `unit_amount` and `unit_amount_decimal` can be set. + #[serde(skip_serializing_if = "Option::is_none")] + pub unit_amount_decimal: Option<&'a str>, +} +impl<'a> UpdateQuoteLineItemsPriceData<'a> { + pub fn new(currency: stripe_types::Currency, product: &'a str) -> Self { + Self { + currency, + product, + recurring: None, + tax_behavior: None, + unit_amount: None, + unit_amount_decimal: None, + } + } +} +/// The recurring components of a price such as `interval` and `interval_count`. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct UpdateQuoteLineItemsPriceDataRecurring { + /// Specifies billing frequency. Either `day`, `week`, `month` or `year`. + pub interval: UpdateQuoteLineItemsPriceDataRecurringInterval, + /// The number of intervals between subscription billings. + /// For example, `interval=month` and `interval_count=3` bills every 3 months. + /// Maximum of three years interval allowed (3 years, 36 months, or 156 weeks). + #[serde(skip_serializing_if = "Option::is_none")] + pub interval_count: Option, +} +impl UpdateQuoteLineItemsPriceDataRecurring { + pub fn new(interval: UpdateQuoteLineItemsPriceDataRecurringInterval) -> Self { + Self { interval, interval_count: None } + } +} +/// Specifies billing frequency. Either `day`, `week`, `month` or `year`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum UpdateQuoteLineItemsPriceDataRecurringInterval { + Day, + Month, + Week, + Year, +} +impl UpdateQuoteLineItemsPriceDataRecurringInterval { + pub fn as_str(self) -> &'static str { + use UpdateQuoteLineItemsPriceDataRecurringInterval::*; + match self { + Day => "day", + Month => "month", + Week => "week", + Year => "year", + } + } +} + +impl std::str::FromStr for UpdateQuoteLineItemsPriceDataRecurringInterval { + type Err = (); + fn from_str(s: &str) -> Result { + use UpdateQuoteLineItemsPriceDataRecurringInterval::*; + match s { + "day" => Ok(Day), + "month" => Ok(Month), + "week" => Ok(Week), + "year" => Ok(Year), + _ => Err(()), + } + } +} +impl std::fmt::Display for UpdateQuoteLineItemsPriceDataRecurringInterval { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for UpdateQuoteLineItemsPriceDataRecurringInterval { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for UpdateQuoteLineItemsPriceDataRecurringInterval { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Only required if a [default tax behavior](https://stripe.com/docs/tax/products-prices-tax-categories-tax-behavior#setting-a-default-tax-behavior-(recommended)) was not provided in the Stripe Tax settings. +/// Specifies whether the price is considered inclusive of taxes or exclusive of taxes. +/// One of `inclusive`, `exclusive`, or `unspecified`. +/// Once specified as either `inclusive` or `exclusive`, it cannot be changed. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum UpdateQuoteLineItemsPriceDataTaxBehavior { + Exclusive, + Inclusive, + Unspecified, +} +impl UpdateQuoteLineItemsPriceDataTaxBehavior { + pub fn as_str(self) -> &'static str { + use UpdateQuoteLineItemsPriceDataTaxBehavior::*; + match self { + Exclusive => "exclusive", + Inclusive => "inclusive", + Unspecified => "unspecified", + } + } +} + +impl std::str::FromStr for UpdateQuoteLineItemsPriceDataTaxBehavior { + type Err = (); + fn from_str(s: &str) -> Result { + use UpdateQuoteLineItemsPriceDataTaxBehavior::*; + match s { + "exclusive" => Ok(Exclusive), + "inclusive" => Ok(Inclusive), + "unspecified" => Ok(Unspecified), + _ => Err(()), + } + } +} +impl std::fmt::Display for UpdateQuoteLineItemsPriceDataTaxBehavior { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for UpdateQuoteLineItemsPriceDataTaxBehavior { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for UpdateQuoteLineItemsPriceDataTaxBehavior { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// When creating a subscription or subscription schedule, the specified configuration data will be used. +/// There must be at least one line item with a recurring price for a subscription or subscription schedule to be created. +/// A subscription schedule is created if `subscription_data[effective_date]` is present and in the future, otherwise a subscription is created. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdateQuoteSubscriptionData<'a> { + /// The subscription's description, meant to be displayable to the customer. + /// Use this field to optionally store an explanation of the subscription for rendering in Stripe surfaces and certain local payment methods UIs. + #[serde(skip_serializing_if = "Option::is_none")] + pub description: Option<&'a str>, + /// When creating a new subscription, the date of which the subscription schedule will start after the quote is accepted. + /// When updating a subscription, the date of which the subscription will be updated using a subscription schedule. + /// The special value `current_period_end` can be provided to update a subscription at the end of its current period. + /// The `effective_date` is ignored if it is in the past when the quote is accepted. + #[serde(skip_serializing_if = "Option::is_none")] + pub effective_date: Option, + /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that will set metadata on the subscription or subscription schedule when the quote is accepted. + /// If a recurring price is included in `line_items`, this field will be passed to the resulting subscription's `metadata` field. + /// If `subscription_data.effective_date` is used, this field will be passed to the resulting subscription schedule's `phases.metadata` field. + /// Unlike object-level metadata, this field is declarative. + /// Updates will clear prior values. + #[serde(skip_serializing_if = "Option::is_none")] + pub metadata: Option<&'a std::collections::HashMap>, + /// Integer representing the number of trial period days before the customer is charged for the first time. + #[serde(skip_serializing_if = "Option::is_none")] + pub trial_period_days: Option, +} +impl<'a> UpdateQuoteSubscriptionData<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// When creating a new subscription, the date of which the subscription schedule will start after the quote is accepted. +/// When updating a subscription, the date of which the subscription will be updated using a subscription schedule. +/// The special value `current_period_end` can be provided to update a subscription at the end of its current period. +/// The `effective_date` is ignored if it is in the past when the quote is accepted. +#[derive(Copy, Clone, Debug, serde::Serialize)] +#[serde(untagged)] +pub enum UpdateQuoteSubscriptionDataEffectiveDate { + CurrentPeriodEnd, + Timestamp(stripe_types::Timestamp), +} +impl<'a> UpdateQuote<'a> { + /// A quote models prices and services for a customer. + pub fn send( + &self, + client: &stripe::Client, + quote: &stripe_shared::QuoteId, + ) -> stripe::Response { + client.send_form(&format!("/quotes/{quote}"), self, http_types::Method::Post) + } +} +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct AcceptQuote<'a> { + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, +} +impl<'a> AcceptQuote<'a> { + pub fn new() -> Self { + Self::default() + } +} +impl<'a> AcceptQuote<'a> { + /// Accepts the specified quote. + pub fn send( + &self, + client: &stripe::Client, + quote: &stripe_shared::QuoteId, + ) -> stripe::Response { + client.send_form(&format!("/quotes/{quote}/accept"), self, http_types::Method::Post) + } +} +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CancelQuote<'a> { + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, +} +impl<'a> CancelQuote<'a> { + pub fn new() -> Self { + Self::default() + } +} +impl<'a> CancelQuote<'a> { + /// Cancels the quote. + pub fn send( + &self, + client: &stripe::Client, + quote: &stripe_shared::QuoteId, + ) -> stripe::Response { + client.send_form(&format!("/quotes/{quote}/cancel"), self, http_types::Method::Post) + } +} +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct FinalizeQuoteQuote<'a> { + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, + /// A future timestamp on which the quote will be canceled if in `open` or `draft` status. + /// Measured in seconds since the Unix epoch. + #[serde(skip_serializing_if = "Option::is_none")] + pub expires_at: Option, +} +impl<'a> FinalizeQuoteQuote<'a> { + pub fn new() -> Self { + Self::default() + } +} +impl<'a> FinalizeQuoteQuote<'a> { + /// Finalizes the quote. + pub fn send( + &self, + client: &stripe::Client, + quote: &stripe_shared::QuoteId, + ) -> stripe::Response { + client.send_form(&format!("/quotes/{quote}/finalize"), self, http_types::Method::Post) + } +} +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct DiscountsDataParam<'a> { + /// ID of the coupon to create a new discount for. + #[serde(skip_serializing_if = "Option::is_none")] + pub coupon: Option<&'a str>, + /// ID of an existing discount on the object (or one of its ancestors) to reuse. + #[serde(skip_serializing_if = "Option::is_none")] + pub discount: Option<&'a str>, +} +impl<'a> DiscountsDataParam<'a> { + pub fn new() -> Self { + Self::default() + } +} +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct TransferDataSpecs<'a> { + /// The amount that will be transferred automatically when the invoice is paid. + /// If no amount is set, the full amount is transferred. + /// There cannot be any line items with recurring prices when using this field. + #[serde(skip_serializing_if = "Option::is_none")] + pub amount: Option, + /// A non-negative decimal between 0 and 100, with at most two decimal places. + /// This represents the percentage of the subscription invoice total that will be transferred to the destination account. + /// By default, the entire amount is transferred to the destination. + /// There must be at least 1 line item with a recurring price to use this field. + #[serde(skip_serializing_if = "Option::is_none")] + pub amount_percent: Option, + /// ID of an existing, connected Stripe account. + pub destination: &'a str, +} +impl<'a> TransferDataSpecs<'a> { + pub fn new(destination: &'a str) -> Self { + Self { amount: None, amount_percent: None, destination } + } +} diff --git a/generated/stripe_billing/src/subscription/mod.rs b/generated/stripe_billing/src/subscription/mod.rs new file mode 100644 index 000000000..1849ece43 --- /dev/null +++ b/generated/stripe_billing/src/subscription/mod.rs @@ -0,0 +1,4 @@ +#[cfg(feature = "subscription")] +mod requests; +#[cfg(feature = "subscription")] +pub use requests::*; diff --git a/generated/stripe_billing/src/subscription/requests.rs b/generated/stripe_billing/src/subscription/requests.rs new file mode 100644 index 000000000..42f686a8a --- /dev/null +++ b/generated/stripe_billing/src/subscription/requests.rs @@ -0,0 +1,4436 @@ +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CancelSubscription<'a> { + /// Details about why this subscription was cancelled + #[serde(skip_serializing_if = "Option::is_none")] + pub cancellation_details: Option>, + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, + /// Will generate a final invoice that invoices for any un-invoiced metered usage and new/pending proration invoice items. + #[serde(skip_serializing_if = "Option::is_none")] + pub invoice_now: Option, + /// Will generate a proration invoice item that credits remaining unused time until the subscription period end. + #[serde(skip_serializing_if = "Option::is_none")] + pub prorate: Option, +} +impl<'a> CancelSubscription<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// Details about why this subscription was cancelled +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CancelSubscriptionCancellationDetails<'a> { + /// Additional comments about why the user canceled the subscription, if the subscription was canceled explicitly by the user. + #[serde(skip_serializing_if = "Option::is_none")] + pub comment: Option<&'a str>, + /// The customer submitted reason for why they canceled, if the subscription was canceled explicitly by the user. + #[serde(skip_serializing_if = "Option::is_none")] + pub feedback: Option, +} +impl<'a> CancelSubscriptionCancellationDetails<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// The customer submitted reason for why they canceled, if the subscription was canceled explicitly by the user. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CancelSubscriptionCancellationDetailsFeedback { + CustomerService, + LowQuality, + MissingFeatures, + Other, + SwitchedService, + TooComplex, + TooExpensive, + Unused, +} +impl CancelSubscriptionCancellationDetailsFeedback { + pub fn as_str(self) -> &'static str { + use CancelSubscriptionCancellationDetailsFeedback::*; + match self { + CustomerService => "customer_service", + LowQuality => "low_quality", + MissingFeatures => "missing_features", + Other => "other", + SwitchedService => "switched_service", + TooComplex => "too_complex", + TooExpensive => "too_expensive", + Unused => "unused", + } + } +} + +impl std::str::FromStr for CancelSubscriptionCancellationDetailsFeedback { + type Err = (); + fn from_str(s: &str) -> Result { + use CancelSubscriptionCancellationDetailsFeedback::*; + match s { + "customer_service" => Ok(CustomerService), + "low_quality" => Ok(LowQuality), + "missing_features" => Ok(MissingFeatures), + "other" => Ok(Other), + "switched_service" => Ok(SwitchedService), + "too_complex" => Ok(TooComplex), + "too_expensive" => Ok(TooExpensive), + "unused" => Ok(Unused), + _ => Err(()), + } + } +} +impl std::fmt::Display for CancelSubscriptionCancellationDetailsFeedback { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CancelSubscriptionCancellationDetailsFeedback { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CancelSubscriptionCancellationDetailsFeedback { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'a> CancelSubscription<'a> { + /// Cancels a customer’s subscription immediately. + /// The customer will not be charged again for the subscription. + /// + /// Note, however, that any pending invoice items that you’ve created will still be charged for at the end of the period, unless manually [deleted](https://stripe.com/docs/api#delete_invoiceitem). + /// If you’ve set the subscription to cancel at the end of the period, any pending prorations will also be left in place and collected at the end of the period. + /// But if the subscription is set to cancel immediately, pending prorations will be removed. + /// + /// By default, upon subscription cancellation, Stripe will stop automatic collection of all finalized invoices for the customer. + /// This is intended to prevent unexpected payment attempts after the customer has canceled a subscription. + /// However, you can resume automatic collection of the invoices manually after subscription cancellation to have us proceed. + /// Or, you could check for unpaid invoices before allowing the customer to cancel the subscription at all. + pub fn send( + &self, + client: &stripe::Client, + subscription_exposed_id: &stripe_shared::SubscriptionId, + ) -> stripe::Response { + client.send_form( + &format!("/subscriptions/{subscription_exposed_id}"), + self, + http_types::Method::Delete, + ) + } +} +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct DeleteDiscountSubscription {} +impl DeleteDiscountSubscription { + pub fn new() -> Self { + Self::default() + } +} +impl DeleteDiscountSubscription { + /// Removes the currently applied discount on a subscription. + pub fn send( + &self, + client: &stripe::Client, + subscription_exposed_id: &stripe_shared::SubscriptionId, + ) -> stripe::Response { + client.send_form( + &format!("/subscriptions/{subscription_exposed_id}/discount"), + self, + http_types::Method::Delete, + ) + } +} +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct ListSubscription<'a> { + /// Filter subscriptions by their automatic tax settings. + #[serde(skip_serializing_if = "Option::is_none")] + pub automatic_tax: Option, + /// The collection method of the subscriptions to retrieve. + /// Either `charge_automatically` or `send_invoice`. + #[serde(skip_serializing_if = "Option::is_none")] + pub collection_method: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub created: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub current_period_end: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub current_period_start: Option, + /// The ID of the customer whose subscriptions will be retrieved. + #[serde(skip_serializing_if = "Option::is_none")] + pub customer: Option<&'a str>, + /// A cursor for use in pagination. + /// `ending_before` is an object ID that defines your place in the list. + /// For instance, if you make a list request and receive 100 objects, starting with `obj_bar`, your subsequent call can include `ending_before=obj_bar` in order to fetch the previous page of the list. + #[serde(skip_serializing_if = "Option::is_none")] + pub ending_before: Option<&'a str>, + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, + /// A limit on the number of objects to be returned. + /// Limit can range between 1 and 100, and the default is 10. + #[serde(skip_serializing_if = "Option::is_none")] + pub limit: Option, + /// The ID of the plan whose subscriptions will be retrieved. + #[serde(skip_serializing_if = "Option::is_none")] + pub plan: Option<&'a str>, + /// Filter for subscriptions that contain this recurring price ID. + #[serde(skip_serializing_if = "Option::is_none")] + pub price: Option<&'a str>, + /// A cursor for use in pagination. + /// `starting_after` is an object ID that defines your place in the list. + /// For instance, if you make a list request and receive 100 objects, ending with `obj_foo`, your subsequent call can include `starting_after=obj_foo` in order to fetch the next page of the list. + #[serde(skip_serializing_if = "Option::is_none")] + pub starting_after: Option<&'a str>, + /// The status of the subscriptions to retrieve. + /// Passing in a value of `canceled` will return all canceled subscriptions, including those belonging to deleted customers. + /// Pass `ended` to find subscriptions that are canceled and subscriptions that are expired due to [incomplete payment](https://stripe.com/docs/billing/subscriptions/overview#subscription-statuses). + /// Passing in a value of `all` will return subscriptions of all statuses. + /// If no value is supplied, all subscriptions that have not been canceled are returned. + #[serde(skip_serializing_if = "Option::is_none")] + pub status: Option, + /// Filter for subscriptions that are associated with the specified test clock. + /// The response will not include subscriptions with test clocks if this and the customer parameter is not set. + #[serde(skip_serializing_if = "Option::is_none")] + pub test_clock: Option<&'a str>, +} +impl<'a> ListSubscription<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// Filter subscriptions by their automatic tax settings. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct ListSubscriptionAutomaticTax { + /// Enabled automatic tax calculation which will automatically compute tax rates on all invoices generated by the subscription. + pub enabled: bool, +} +impl ListSubscriptionAutomaticTax { + pub fn new(enabled: bool) -> Self { + Self { enabled } + } +} +/// The status of the subscriptions to retrieve. +/// Passing in a value of `canceled` will return all canceled subscriptions, including those belonging to deleted customers. +/// Pass `ended` to find subscriptions that are canceled and subscriptions that are expired due to [incomplete payment](https://stripe.com/docs/billing/subscriptions/overview#subscription-statuses). +/// Passing in a value of `all` will return subscriptions of all statuses. +/// If no value is supplied, all subscriptions that have not been canceled are returned. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum ListSubscriptionStatus { + Active, + All, + Canceled, + Ended, + Incomplete, + IncompleteExpired, + PastDue, + Paused, + Trialing, + Unpaid, +} +impl ListSubscriptionStatus { + pub fn as_str(self) -> &'static str { + use ListSubscriptionStatus::*; + match self { + Active => "active", + All => "all", + Canceled => "canceled", + Ended => "ended", + Incomplete => "incomplete", + IncompleteExpired => "incomplete_expired", + PastDue => "past_due", + Paused => "paused", + Trialing => "trialing", + Unpaid => "unpaid", + } + } +} + +impl std::str::FromStr for ListSubscriptionStatus { + type Err = (); + fn from_str(s: &str) -> Result { + use ListSubscriptionStatus::*; + match s { + "active" => Ok(Active), + "all" => Ok(All), + "canceled" => Ok(Canceled), + "ended" => Ok(Ended), + "incomplete" => Ok(Incomplete), + "incomplete_expired" => Ok(IncompleteExpired), + "past_due" => Ok(PastDue), + "paused" => Ok(Paused), + "trialing" => Ok(Trialing), + "unpaid" => Ok(Unpaid), + _ => Err(()), + } + } +} +impl std::fmt::Display for ListSubscriptionStatus { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for ListSubscriptionStatus { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for ListSubscriptionStatus { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'a> ListSubscription<'a> { + /// By default, returns a list of subscriptions that have not been canceled. + /// In order to list canceled subscriptions, specify `status=canceled`. + pub fn send( + &self, + client: &stripe::Client, + ) -> stripe::Response> { + client.get_query("/subscriptions", self) + } + pub fn paginate( + self, + ) -> stripe::ListPaginator> { + stripe::ListPaginator::from_list_params("/subscriptions", self) + } +} +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct RetrieveSubscription<'a> { + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, +} +impl<'a> RetrieveSubscription<'a> { + pub fn new() -> Self { + Self::default() + } +} +impl<'a> RetrieveSubscription<'a> { + /// Retrieves the subscription with the given ID. + pub fn send( + &self, + client: &stripe::Client, + subscription_exposed_id: &stripe_shared::SubscriptionId, + ) -> stripe::Response { + client.get_query(&format!("/subscriptions/{subscription_exposed_id}"), self) + } +} +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct SearchSubscription<'a> { + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, + /// A limit on the number of objects to be returned. + /// Limit can range between 1 and 100, and the default is 10. + #[serde(skip_serializing_if = "Option::is_none")] + pub limit: Option, + /// A cursor for pagination across multiple pages of results. + /// Don't include this parameter on the first call. + /// Use the next_page value returned in a previous response to request subsequent results. + #[serde(skip_serializing_if = "Option::is_none")] + pub page: Option<&'a str>, + /// The search query string. + /// See [search query language](https://stripe.com/docs/search#search-query-language) and the list of supported [query fields for subscriptions](https://stripe.com/docs/search#query-fields-for-subscriptions). + pub query: &'a str, +} +impl<'a> SearchSubscription<'a> { + pub fn new(query: &'a str) -> Self { + Self { expand: None, limit: None, page: None, query } + } +} +impl<'a> SearchSubscription<'a> { + /// Search for subscriptions you’ve previously created using Stripe’s [Search Query Language](https://stripe.com/docs/search#search-query-language). + /// Don’t use search in read-after-write flows where strict consistency is necessary. + /// Under normal operating. + /// conditions, data is searchable in less than a minute. + /// Occasionally, propagation of new or updated data can be up. + /// to an hour behind during outages. Search functionality is not available to merchants in India. + pub fn send( + &self, + client: &stripe::Client, + ) -> stripe::Response> { + client.get_query("/subscriptions/search", self) + } + pub fn paginate( + self, + ) -> stripe::ListPaginator> { + stripe::ListPaginator::from_search_params("/subscriptions/search", self) + } +} +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreateSubscription<'a> { + /// A list of prices and quantities that will generate invoice items appended to the next invoice for this subscription. + /// You may pass up to 20 items. + #[serde(skip_serializing_if = "Option::is_none")] + pub add_invoice_items: Option<&'a [CreateSubscriptionAddInvoiceItems<'a>]>, + /// A non-negative decimal between 0 and 100, with at most two decimal places. + /// This represents the percentage of the subscription invoice total that will be transferred to the application owner's Stripe account. + /// The request must be made by a platform account on a connected account in order to set an application fee percentage. + /// For more information, see the application fees [documentation](https://stripe.com/docs/connect/subscriptions#collecting-fees-on-subscriptions). + #[serde(skip_serializing_if = "Option::is_none")] + pub application_fee_percent: Option, + /// Automatic tax settings for this subscription. + /// We recommend you only include this parameter when the existing value is being changed. + #[serde(skip_serializing_if = "Option::is_none")] + pub automatic_tax: Option>, + /// For new subscriptions, a past timestamp to backdate the subscription's start date to. + /// If set, the first invoice will contain a proration for the timespan between the start date and the current time. + /// Can be combined with trials and the billing cycle anchor. + #[serde(skip_serializing_if = "Option::is_none")] + pub backdate_start_date: Option, + /// A future timestamp in UTC format to anchor the subscription's [billing cycle](https://stripe.com/docs/subscriptions/billing-cycle). + /// The anchor is the reference point that aligns future billing cycle dates. + /// It sets the day of week for `week` intervals, the day of month for `month` and `year` intervals, and the month of year for `year` intervals. + #[serde(skip_serializing_if = "Option::is_none")] + pub billing_cycle_anchor: Option, + /// Mutually exclusive with billing_cycle_anchor and only valid with monthly and yearly price intervals. + /// When provided, the billing_cycle_anchor is set to the next occurence of the day_of_month at the hour, minute, and second UTC. + #[serde(skip_serializing_if = "Option::is_none")] + pub billing_cycle_anchor_config: Option, + /// Define thresholds at which an invoice will be sent, and the subscription advanced to a new billing period. + /// Pass an empty string to remove previously-defined thresholds. + #[serde(skip_serializing_if = "Option::is_none")] + pub billing_thresholds: Option, + /// A timestamp at which the subscription should cancel. + /// If set to a date before the current period ends, this will cause a proration if prorations have been enabled using `proration_behavior`. + /// If set during a future period, this will always cause a proration for that period. + #[serde(skip_serializing_if = "Option::is_none")] + pub cancel_at: Option, + /// Boolean indicating whether this subscription should cancel at the end of the current period. + #[serde(skip_serializing_if = "Option::is_none")] + pub cancel_at_period_end: Option, + /// Either `charge_automatically`, or `send_invoice`. + /// When charging automatically, Stripe will attempt to pay this subscription at the end of the cycle using the default source attached to the customer. + /// When sending an invoice, Stripe will email your customer an invoice with payment instructions and mark the subscription as `active`. + /// Defaults to `charge_automatically`. + #[serde(skip_serializing_if = "Option::is_none")] + pub collection_method: Option, + /// The ID of the coupon to apply to this subscription. + /// A coupon applied to a subscription will only affect invoices created for that particular subscription. + #[serde(skip_serializing_if = "Option::is_none")] + pub coupon: Option<&'a str>, + /// Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. + /// Must be a [supported currency](https://stripe.com/docs/currencies). + #[serde(skip_serializing_if = "Option::is_none")] + pub currency: Option, + /// The identifier of the customer to subscribe. + pub customer: &'a str, + /// Number of days a customer has to pay invoices generated by this subscription. + /// Valid only for subscriptions where `collection_method` is set to `send_invoice`. + #[serde(skip_serializing_if = "Option::is_none")] + pub days_until_due: Option, + /// ID of the default payment method for the subscription. + /// It must belong to the customer associated with the subscription. + /// This takes precedence over `default_source`. + /// If neither are set, invoices will use the customer's [invoice_settings.default_payment_method](https://stripe.com/docs/api/customers/object#customer_object-invoice_settings-default_payment_method) or [default_source](https://stripe.com/docs/api/customers/object#customer_object-default_source). + #[serde(skip_serializing_if = "Option::is_none")] + pub default_payment_method: Option<&'a str>, + /// ID of the default payment source for the subscription. + /// It must belong to the customer associated with the subscription and be in a chargeable state. + /// If `default_payment_method` is also set, `default_payment_method` will take precedence. + /// If neither are set, invoices will use the customer's [invoice_settings.default_payment_method](https://stripe.com/docs/api/customers/object#customer_object-invoice_settings-default_payment_method) or [default_source](https://stripe.com/docs/api/customers/object#customer_object-default_source). + #[serde(skip_serializing_if = "Option::is_none")] + pub default_source: Option<&'a str>, + /// The tax rates that will apply to any subscription item that does not have `tax_rates` set. + /// Invoices created will have their `default_tax_rates` populated from the subscription. + #[serde(skip_serializing_if = "Option::is_none")] + pub default_tax_rates: Option<&'a [&'a str]>, + /// The subscription's description, meant to be displayable to the customer. + /// Use this field to optionally store an explanation of the subscription for rendering in Stripe surfaces and certain local payment methods UIs. + #[serde(skip_serializing_if = "Option::is_none")] + pub description: Option<&'a str>, + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, + /// All invoices will be billed using the specified settings. + #[serde(skip_serializing_if = "Option::is_none")] + pub invoice_settings: Option>, + /// A list of up to 20 subscription items, each with an attached price. + #[serde(skip_serializing_if = "Option::is_none")] + pub items: Option<&'a [CreateSubscriptionItems<'a>]>, + /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. + /// This can be useful for storing additional information about the object in a structured format. + /// Individual keys can be unset by posting an empty value to them. + /// All keys can be unset by posting an empty value to `metadata`. + #[serde(skip_serializing_if = "Option::is_none")] + pub metadata: Option<&'a std::collections::HashMap>, + /// Indicates if a customer is on or off-session while an invoice payment is attempted. + #[serde(skip_serializing_if = "Option::is_none")] + pub off_session: Option, + /// The account on behalf of which to charge, for each of the subscription's invoices. + #[serde(skip_serializing_if = "Option::is_none")] + pub on_behalf_of: Option<&'a str>, + /// Only applies to subscriptions with `collection_method=charge_automatically`. + /// + /// Use `allow_incomplete` to create subscriptions with `status=incomplete` if the first invoice cannot be paid. + /// Creating subscriptions with this status allows you to manage scenarios where additional user actions are needed to pay a subscription's invoice. + /// For example, SCA regulation may require 3DS authentication to complete payment. + /// See the [SCA Migration Guide](https://stripe.com/docs/billing/migration/strong-customer-authentication) for Billing to learn more. + /// This is the default behavior. + /// + /// Use `default_incomplete` to create Subscriptions with `status=incomplete` when the first invoice requires payment, otherwise start as active. + /// Subscriptions transition to `status=active` when successfully confirming the payment intent on the first invoice. + /// This allows simpler management of scenarios where additional user actions are needed to pay a subscription’s invoice. + /// Such as failed payments, [SCA regulation](https://stripe.com/docs/billing/migration/strong-customer-authentication), or collecting a mandate for a bank debit payment method. + /// If the payment intent is not confirmed within 23 hours subscriptions transition to `status=incomplete_expired`, which is a terminal state. + /// + /// Use `error_if_incomplete` if you want Stripe to return an HTTP 402 status code if a subscription's first invoice cannot be paid. + /// For example, if a payment method requires 3DS authentication due to SCA regulation and further user action is needed, this parameter does not create a subscription and returns an error instead. + /// This was the default behavior for API versions prior to 2019-03-14. + /// See the [changelog](https://stripe.com/docs/upgrades#2019-03-14) to learn more. + /// + /// `pending_if_incomplete` is only used with updates and cannot be passed when creating a subscription. + /// + /// Subscriptions with `collection_method=send_invoice` are automatically activated regardless of the first invoice status. + #[serde(skip_serializing_if = "Option::is_none")] + pub payment_behavior: Option, + /// Payment settings to pass to invoices created by the subscription. + #[serde(skip_serializing_if = "Option::is_none")] + pub payment_settings: Option>, + /// Specifies an interval for how often to bill for any pending invoice items. + /// It is analogous to calling [Create an invoice](https://stripe.com/docs/api#create_invoice) for the given subscription at the specified interval. + #[serde(skip_serializing_if = "Option::is_none")] + pub pending_invoice_item_interval: Option, + /// The API ID of a promotion code to apply to this subscription. + /// A promotion code applied to a subscription will only affect invoices created for that particular subscription. + #[serde(skip_serializing_if = "Option::is_none")] + pub promotion_code: Option<&'a str>, + /// Determines how to handle [prorations](https://stripe.com/docs/subscriptions/billing-cycle#prorations) resulting from the `billing_cycle_anchor`. + /// If no value is passed, the default is `create_prorations`. + #[serde(skip_serializing_if = "Option::is_none")] + pub proration_behavior: Option, + /// If specified, the funds from the subscription's invoices will be transferred to the destination and the ID of the resulting transfers will be found on the resulting charges. + #[serde(skip_serializing_if = "Option::is_none")] + pub transfer_data: Option>, + /// Unix timestamp representing the end of the trial period the customer will get before being charged for the first time. + /// If set, trial_end will override the default trial period of the plan the customer is being subscribed to. + /// The special value `now` can be provided to end the customer's trial immediately. + /// Can be at most two years from `billing_cycle_anchor`. + /// See [Using trial periods on subscriptions](https://stripe.com/docs/billing/subscriptions/trials) to learn more. + #[serde(skip_serializing_if = "Option::is_none")] + pub trial_end: Option, + /// Indicates if a plan's `trial_period_days` should be applied to the subscription. + /// Setting `trial_end` per subscription is preferred, and this defaults to `false`. + /// Setting this flag to `true` together with `trial_end` is not allowed. + /// See [Using trial periods on subscriptions](https://stripe.com/docs/billing/subscriptions/trials) to learn more. + #[serde(skip_serializing_if = "Option::is_none")] + pub trial_from_plan: Option, + /// Integer representing the number of trial period days before the customer is charged for the first time. + /// This will always overwrite any trials that might apply via a subscribed plan. + /// See [Using trial periods on subscriptions](https://stripe.com/docs/billing/subscriptions/trials) to learn more. + #[serde(skip_serializing_if = "Option::is_none")] + pub trial_period_days: Option, + /// Settings related to subscription trials. + #[serde(skip_serializing_if = "Option::is_none")] + pub trial_settings: Option, +} +impl<'a> CreateSubscription<'a> { + pub fn new(customer: &'a str) -> Self { + Self { + add_invoice_items: None, + application_fee_percent: None, + automatic_tax: None, + backdate_start_date: None, + billing_cycle_anchor: None, + billing_cycle_anchor_config: None, + billing_thresholds: None, + cancel_at: None, + cancel_at_period_end: None, + collection_method: None, + coupon: None, + currency: None, + customer, + days_until_due: None, + default_payment_method: None, + default_source: None, + default_tax_rates: None, + description: None, + expand: None, + invoice_settings: None, + items: None, + metadata: None, + off_session: None, + on_behalf_of: None, + payment_behavior: None, + payment_settings: None, + pending_invoice_item_interval: None, + promotion_code: None, + proration_behavior: None, + transfer_data: None, + trial_end: None, + trial_from_plan: None, + trial_period_days: None, + trial_settings: None, + } + } +} +/// A list of prices and quantities that will generate invoice items appended to the next invoice for this subscription. +/// You may pass up to 20 items. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreateSubscriptionAddInvoiceItems<'a> { + /// The ID of the price object. + #[serde(skip_serializing_if = "Option::is_none")] + pub price: Option<&'a str>, + /// Data used to generate a new [Price](https://stripe.com/docs/api/prices) object inline. + #[serde(skip_serializing_if = "Option::is_none")] + pub price_data: Option>, + /// Quantity for this item. Defaults to 1. + #[serde(skip_serializing_if = "Option::is_none")] + pub quantity: Option, + /// The tax rates which apply to the item. When set, the `default_tax_rates` do not apply to this item. + #[serde(skip_serializing_if = "Option::is_none")] + pub tax_rates: Option<&'a [&'a str]>, +} +impl<'a> CreateSubscriptionAddInvoiceItems<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// Data used to generate a new [Price](https://stripe.com/docs/api/prices) object inline. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreateSubscriptionAddInvoiceItemsPriceData<'a> { + /// Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. + /// Must be a [supported currency](https://stripe.com/docs/currencies). + pub currency: stripe_types::Currency, + /// The ID of the product that this price will belong to. + pub product: &'a str, + /// Only required if a [default tax behavior](https://stripe.com/docs/tax/products-prices-tax-categories-tax-behavior#setting-a-default-tax-behavior-(recommended)) was not provided in the Stripe Tax settings. + /// Specifies whether the price is considered inclusive of taxes or exclusive of taxes. + /// One of `inclusive`, `exclusive`, or `unspecified`. + /// Once specified as either `inclusive` or `exclusive`, it cannot be changed. + #[serde(skip_serializing_if = "Option::is_none")] + pub tax_behavior: Option, + /// A positive integer in cents (or local equivalent) (or 0 for a free price) representing how much to charge. + #[serde(skip_serializing_if = "Option::is_none")] + pub unit_amount: Option, + /// Same as `unit_amount`, but accepts a decimal value in cents (or local equivalent) with at most 12 decimal places. + /// Only one of `unit_amount` and `unit_amount_decimal` can be set. + #[serde(skip_serializing_if = "Option::is_none")] + pub unit_amount_decimal: Option<&'a str>, +} +impl<'a> CreateSubscriptionAddInvoiceItemsPriceData<'a> { + pub fn new(currency: stripe_types::Currency, product: &'a str) -> Self { + Self { currency, product, tax_behavior: None, unit_amount: None, unit_amount_decimal: None } + } +} +/// Only required if a [default tax behavior](https://stripe.com/docs/tax/products-prices-tax-categories-tax-behavior#setting-a-default-tax-behavior-(recommended)) was not provided in the Stripe Tax settings. +/// Specifies whether the price is considered inclusive of taxes or exclusive of taxes. +/// One of `inclusive`, `exclusive`, or `unspecified`. +/// Once specified as either `inclusive` or `exclusive`, it cannot be changed. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreateSubscriptionAddInvoiceItemsPriceDataTaxBehavior { + Exclusive, + Inclusive, + Unspecified, +} +impl CreateSubscriptionAddInvoiceItemsPriceDataTaxBehavior { + pub fn as_str(self) -> &'static str { + use CreateSubscriptionAddInvoiceItemsPriceDataTaxBehavior::*; + match self { + Exclusive => "exclusive", + Inclusive => "inclusive", + Unspecified => "unspecified", + } + } +} + +impl std::str::FromStr for CreateSubscriptionAddInvoiceItemsPriceDataTaxBehavior { + type Err = (); + fn from_str(s: &str) -> Result { + use CreateSubscriptionAddInvoiceItemsPriceDataTaxBehavior::*; + match s { + "exclusive" => Ok(Exclusive), + "inclusive" => Ok(Inclusive), + "unspecified" => Ok(Unspecified), + _ => Err(()), + } + } +} +impl std::fmt::Display for CreateSubscriptionAddInvoiceItemsPriceDataTaxBehavior { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreateSubscriptionAddInvoiceItemsPriceDataTaxBehavior { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreateSubscriptionAddInvoiceItemsPriceDataTaxBehavior { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Automatic tax settings for this subscription. +/// We recommend you only include this parameter when the existing value is being changed. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreateSubscriptionAutomaticTax<'a> { + /// Enabled automatic tax calculation which will automatically compute tax rates on all invoices generated by the subscription. + pub enabled: bool, + /// The account that's liable for tax. + /// If set, the business address and tax registrations required to perform the tax calculation are loaded from this account. + /// The tax transaction is returned in the report of the connected account. + #[serde(skip_serializing_if = "Option::is_none")] + pub liability: Option>, +} +impl<'a> CreateSubscriptionAutomaticTax<'a> { + pub fn new(enabled: bool) -> Self { + Self { enabled, liability: None } + } +} +/// The account that's liable for tax. +/// If set, the business address and tax registrations required to perform the tax calculation are loaded from this account. +/// The tax transaction is returned in the report of the connected account. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreateSubscriptionAutomaticTaxLiability<'a> { + /// The connected account being referenced when `type` is `account`. + #[serde(skip_serializing_if = "Option::is_none")] + pub account: Option<&'a str>, + /// Type of the account referenced in the request. + #[serde(rename = "type")] + pub type_: CreateSubscriptionAutomaticTaxLiabilityType, +} +impl<'a> CreateSubscriptionAutomaticTaxLiability<'a> { + pub fn new(type_: CreateSubscriptionAutomaticTaxLiabilityType) -> Self { + Self { account: None, type_ } + } +} +/// Type of the account referenced in the request. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreateSubscriptionAutomaticTaxLiabilityType { + Account, + Self_, +} +impl CreateSubscriptionAutomaticTaxLiabilityType { + pub fn as_str(self) -> &'static str { + use CreateSubscriptionAutomaticTaxLiabilityType::*; + match self { + Account => "account", + Self_ => "self", + } + } +} + +impl std::str::FromStr for CreateSubscriptionAutomaticTaxLiabilityType { + type Err = (); + fn from_str(s: &str) -> Result { + use CreateSubscriptionAutomaticTaxLiabilityType::*; + match s { + "account" => Ok(Account), + "self" => Ok(Self_), + _ => Err(()), + } + } +} +impl std::fmt::Display for CreateSubscriptionAutomaticTaxLiabilityType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreateSubscriptionAutomaticTaxLiabilityType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreateSubscriptionAutomaticTaxLiabilityType { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Mutually exclusive with billing_cycle_anchor and only valid with monthly and yearly price intervals. +/// When provided, the billing_cycle_anchor is set to the next occurence of the day_of_month at the hour, minute, and second UTC. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreateSubscriptionBillingCycleAnchorConfig { + /// The day of the month the billing_cycle_anchor should be. Ranges from 1 to 31. + pub day_of_month: i64, + /// The hour of the day the billing_cycle_anchor should be. Ranges from 0 to 23. + #[serde(skip_serializing_if = "Option::is_none")] + pub hour: Option, + /// The minute of the hour the billing_cycle_anchor should be. Ranges from 0 to 59. + #[serde(skip_serializing_if = "Option::is_none")] + pub minute: Option, + /// The month to start full cycle billing periods. Ranges from 1 to 12. + #[serde(skip_serializing_if = "Option::is_none")] + pub month: Option, + /// The second of the minute the billing_cycle_anchor should be. Ranges from 0 to 59. + #[serde(skip_serializing_if = "Option::is_none")] + pub second: Option, +} +impl CreateSubscriptionBillingCycleAnchorConfig { + pub fn new(day_of_month: i64) -> Self { + Self { day_of_month, hour: None, minute: None, month: None, second: None } + } +} +/// All invoices will be billed using the specified settings. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreateSubscriptionInvoiceSettings<'a> { + /// The account tax IDs associated with the subscription. + /// Will be set on invoices generated by the subscription. + #[serde(skip_serializing_if = "Option::is_none")] + pub account_tax_ids: Option<&'a [&'a str]>, + /// The connected account that issues the invoice. + /// The invoice is presented with the branding and support information of the specified account. + #[serde(skip_serializing_if = "Option::is_none")] + pub issuer: Option>, +} +impl<'a> CreateSubscriptionInvoiceSettings<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// The connected account that issues the invoice. +/// The invoice is presented with the branding and support information of the specified account. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreateSubscriptionInvoiceSettingsIssuer<'a> { + /// The connected account being referenced when `type` is `account`. + #[serde(skip_serializing_if = "Option::is_none")] + pub account: Option<&'a str>, + /// Type of the account referenced in the request. + #[serde(rename = "type")] + pub type_: CreateSubscriptionInvoiceSettingsIssuerType, +} +impl<'a> CreateSubscriptionInvoiceSettingsIssuer<'a> { + pub fn new(type_: CreateSubscriptionInvoiceSettingsIssuerType) -> Self { + Self { account: None, type_ } + } +} +/// Type of the account referenced in the request. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreateSubscriptionInvoiceSettingsIssuerType { + Account, + Self_, +} +impl CreateSubscriptionInvoiceSettingsIssuerType { + pub fn as_str(self) -> &'static str { + use CreateSubscriptionInvoiceSettingsIssuerType::*; + match self { + Account => "account", + Self_ => "self", + } + } +} + +impl std::str::FromStr for CreateSubscriptionInvoiceSettingsIssuerType { + type Err = (); + fn from_str(s: &str) -> Result { + use CreateSubscriptionInvoiceSettingsIssuerType::*; + match s { + "account" => Ok(Account), + "self" => Ok(Self_), + _ => Err(()), + } + } +} +impl std::fmt::Display for CreateSubscriptionInvoiceSettingsIssuerType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreateSubscriptionInvoiceSettingsIssuerType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreateSubscriptionInvoiceSettingsIssuerType { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// A list of up to 20 subscription items, each with an attached price. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreateSubscriptionItems<'a> { + /// Define thresholds at which an invoice will be sent, and the subscription advanced to a new billing period. + /// When updating, pass an empty string to remove previously-defined thresholds. + #[serde(skip_serializing_if = "Option::is_none")] + pub billing_thresholds: Option, + /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. + /// This can be useful for storing additional information about the object in a structured format. + /// Individual keys can be unset by posting an empty value to them. + /// All keys can be unset by posting an empty value to `metadata`. + #[serde(skip_serializing_if = "Option::is_none")] + pub metadata: Option<&'a std::collections::HashMap>, + /// Plan ID for this item, as a string. + #[serde(skip_serializing_if = "Option::is_none")] + pub plan: Option<&'a str>, + /// The ID of the price object. + #[serde(skip_serializing_if = "Option::is_none")] + pub price: Option<&'a str>, + /// Data used to generate a new [Price](https://stripe.com/docs/api/prices) object inline. + #[serde(skip_serializing_if = "Option::is_none")] + pub price_data: Option>, + /// Quantity for this item. + #[serde(skip_serializing_if = "Option::is_none")] + pub quantity: Option, + /// A list of [Tax Rate](https://stripe.com/docs/api/tax_rates) ids. + /// These Tax Rates will override the [`default_tax_rates`](https://stripe.com/docs/api/subscriptions/create#create_subscription-default_tax_rates) on the Subscription. + /// When updating, pass an empty string to remove previously-defined tax rates. + #[serde(skip_serializing_if = "Option::is_none")] + pub tax_rates: Option<&'a [&'a str]>, +} +impl<'a> CreateSubscriptionItems<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// Data used to generate a new [Price](https://stripe.com/docs/api/prices) object inline. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreateSubscriptionItemsPriceData<'a> { + /// Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. + /// Must be a [supported currency](https://stripe.com/docs/currencies). + pub currency: stripe_types::Currency, + /// The ID of the product that this price will belong to. + pub product: &'a str, + /// The recurring components of a price such as `interval` and `interval_count`. + pub recurring: CreateSubscriptionItemsPriceDataRecurring, + /// Only required if a [default tax behavior](https://stripe.com/docs/tax/products-prices-tax-categories-tax-behavior#setting-a-default-tax-behavior-(recommended)) was not provided in the Stripe Tax settings. + /// Specifies whether the price is considered inclusive of taxes or exclusive of taxes. + /// One of `inclusive`, `exclusive`, or `unspecified`. + /// Once specified as either `inclusive` or `exclusive`, it cannot be changed. + #[serde(skip_serializing_if = "Option::is_none")] + pub tax_behavior: Option, + /// A positive integer in cents (or local equivalent) (or 0 for a free price) representing how much to charge. + #[serde(skip_serializing_if = "Option::is_none")] + pub unit_amount: Option, + /// Same as `unit_amount`, but accepts a decimal value in cents (or local equivalent) with at most 12 decimal places. + /// Only one of `unit_amount` and `unit_amount_decimal` can be set. + #[serde(skip_serializing_if = "Option::is_none")] + pub unit_amount_decimal: Option<&'a str>, +} +impl<'a> CreateSubscriptionItemsPriceData<'a> { + pub fn new( + currency: stripe_types::Currency, + product: &'a str, + recurring: CreateSubscriptionItemsPriceDataRecurring, + ) -> Self { + Self { + currency, + product, + recurring, + tax_behavior: None, + unit_amount: None, + unit_amount_decimal: None, + } + } +} +/// The recurring components of a price such as `interval` and `interval_count`. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreateSubscriptionItemsPriceDataRecurring { + /// Specifies billing frequency. Either `day`, `week`, `month` or `year`. + pub interval: CreateSubscriptionItemsPriceDataRecurringInterval, + /// The number of intervals between subscription billings. + /// For example, `interval=month` and `interval_count=3` bills every 3 months. + /// Maximum of three years interval allowed (3 years, 36 months, or 156 weeks). + #[serde(skip_serializing_if = "Option::is_none")] + pub interval_count: Option, +} +impl CreateSubscriptionItemsPriceDataRecurring { + pub fn new(interval: CreateSubscriptionItemsPriceDataRecurringInterval) -> Self { + Self { interval, interval_count: None } + } +} +/// Specifies billing frequency. Either `day`, `week`, `month` or `year`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreateSubscriptionItemsPriceDataRecurringInterval { + Day, + Month, + Week, + Year, +} +impl CreateSubscriptionItemsPriceDataRecurringInterval { + pub fn as_str(self) -> &'static str { + use CreateSubscriptionItemsPriceDataRecurringInterval::*; + match self { + Day => "day", + Month => "month", + Week => "week", + Year => "year", + } + } +} + +impl std::str::FromStr for CreateSubscriptionItemsPriceDataRecurringInterval { + type Err = (); + fn from_str(s: &str) -> Result { + use CreateSubscriptionItemsPriceDataRecurringInterval::*; + match s { + "day" => Ok(Day), + "month" => Ok(Month), + "week" => Ok(Week), + "year" => Ok(Year), + _ => Err(()), + } + } +} +impl std::fmt::Display for CreateSubscriptionItemsPriceDataRecurringInterval { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreateSubscriptionItemsPriceDataRecurringInterval { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreateSubscriptionItemsPriceDataRecurringInterval { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Only required if a [default tax behavior](https://stripe.com/docs/tax/products-prices-tax-categories-tax-behavior#setting-a-default-tax-behavior-(recommended)) was not provided in the Stripe Tax settings. +/// Specifies whether the price is considered inclusive of taxes or exclusive of taxes. +/// One of `inclusive`, `exclusive`, or `unspecified`. +/// Once specified as either `inclusive` or `exclusive`, it cannot be changed. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreateSubscriptionItemsPriceDataTaxBehavior { + Exclusive, + Inclusive, + Unspecified, +} +impl CreateSubscriptionItemsPriceDataTaxBehavior { + pub fn as_str(self) -> &'static str { + use CreateSubscriptionItemsPriceDataTaxBehavior::*; + match self { + Exclusive => "exclusive", + Inclusive => "inclusive", + Unspecified => "unspecified", + } + } +} + +impl std::str::FromStr for CreateSubscriptionItemsPriceDataTaxBehavior { + type Err = (); + fn from_str(s: &str) -> Result { + use CreateSubscriptionItemsPriceDataTaxBehavior::*; + match s { + "exclusive" => Ok(Exclusive), + "inclusive" => Ok(Inclusive), + "unspecified" => Ok(Unspecified), + _ => Err(()), + } + } +} +impl std::fmt::Display for CreateSubscriptionItemsPriceDataTaxBehavior { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreateSubscriptionItemsPriceDataTaxBehavior { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreateSubscriptionItemsPriceDataTaxBehavior { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Only applies to subscriptions with `collection_method=charge_automatically`. +/// +/// Use `allow_incomplete` to create subscriptions with `status=incomplete` if the first invoice cannot be paid. +/// Creating subscriptions with this status allows you to manage scenarios where additional user actions are needed to pay a subscription's invoice. +/// For example, SCA regulation may require 3DS authentication to complete payment. +/// See the [SCA Migration Guide](https://stripe.com/docs/billing/migration/strong-customer-authentication) for Billing to learn more. +/// This is the default behavior. +/// +/// Use `default_incomplete` to create Subscriptions with `status=incomplete` when the first invoice requires payment, otherwise start as active. +/// Subscriptions transition to `status=active` when successfully confirming the payment intent on the first invoice. +/// This allows simpler management of scenarios where additional user actions are needed to pay a subscription’s invoice. +/// Such as failed payments, [SCA regulation](https://stripe.com/docs/billing/migration/strong-customer-authentication), or collecting a mandate for a bank debit payment method. +/// If the payment intent is not confirmed within 23 hours subscriptions transition to `status=incomplete_expired`, which is a terminal state. +/// +/// Use `error_if_incomplete` if you want Stripe to return an HTTP 402 status code if a subscription's first invoice cannot be paid. +/// For example, if a payment method requires 3DS authentication due to SCA regulation and further user action is needed, this parameter does not create a subscription and returns an error instead. +/// This was the default behavior for API versions prior to 2019-03-14. +/// See the [changelog](https://stripe.com/docs/upgrades#2019-03-14) to learn more. +/// +/// `pending_if_incomplete` is only used with updates and cannot be passed when creating a subscription. +/// +/// Subscriptions with `collection_method=send_invoice` are automatically activated regardless of the first invoice status. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreateSubscriptionPaymentBehavior { + AllowIncomplete, + DefaultIncomplete, + ErrorIfIncomplete, + PendingIfIncomplete, +} +impl CreateSubscriptionPaymentBehavior { + pub fn as_str(self) -> &'static str { + use CreateSubscriptionPaymentBehavior::*; + match self { + AllowIncomplete => "allow_incomplete", + DefaultIncomplete => "default_incomplete", + ErrorIfIncomplete => "error_if_incomplete", + PendingIfIncomplete => "pending_if_incomplete", + } + } +} + +impl std::str::FromStr for CreateSubscriptionPaymentBehavior { + type Err = (); + fn from_str(s: &str) -> Result { + use CreateSubscriptionPaymentBehavior::*; + match s { + "allow_incomplete" => Ok(AllowIncomplete), + "default_incomplete" => Ok(DefaultIncomplete), + "error_if_incomplete" => Ok(ErrorIfIncomplete), + "pending_if_incomplete" => Ok(PendingIfIncomplete), + _ => Err(()), + } + } +} +impl std::fmt::Display for CreateSubscriptionPaymentBehavior { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreateSubscriptionPaymentBehavior { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreateSubscriptionPaymentBehavior { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Payment settings to pass to invoices created by the subscription. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreateSubscriptionPaymentSettings<'a> { + /// Payment-method-specific configuration to provide to invoices created by the subscription. + #[serde(skip_serializing_if = "Option::is_none")] + pub payment_method_options: Option>, + /// The list of payment method types (e.g. + /// card) to provide to the invoice’s PaymentIntent. + /// If not set, Stripe attempts to automatically determine the types to use by looking at the invoice’s default payment method, the subscription’s default payment method, the customer’s default payment method, and your [invoice template settings](https://dashboard.stripe.com/settings/billing/invoice). + #[serde(skip_serializing_if = "Option::is_none")] + pub payment_method_types: Option<&'a [CreateSubscriptionPaymentSettingsPaymentMethodTypes]>, + /// Either `off`, or `on_subscription`. + /// With `on_subscription` Stripe updates `subscription.default_payment_method` when a subscription payment succeeds. + #[serde(skip_serializing_if = "Option::is_none")] + pub save_default_payment_method: + Option, +} +impl<'a> CreateSubscriptionPaymentSettings<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// Payment-method-specific configuration to provide to invoices created by the subscription. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreateSubscriptionPaymentSettingsPaymentMethodOptions<'a> { + /// This sub-hash contains details about the Canadian pre-authorized debit payment method options to pass to the invoice’s PaymentIntent. + #[serde(skip_serializing_if = "Option::is_none")] + pub acss_debit: Option, + /// This sub-hash contains details about the Bancontact payment method options to pass to the invoice’s PaymentIntent. + #[serde(skip_serializing_if = "Option::is_none")] + pub bancontact: Option, + /// This sub-hash contains details about the Card payment method options to pass to the invoice’s PaymentIntent. + #[serde(skip_serializing_if = "Option::is_none")] + pub card: Option>, + /// This sub-hash contains details about the Bank transfer payment method options to pass to the invoice’s PaymentIntent. + #[serde(skip_serializing_if = "Option::is_none")] + pub customer_balance: Option>, + /// This sub-hash contains details about the Konbini payment method options to pass to the invoice’s PaymentIntent. + #[serde(skip_serializing_if = "Option::is_none")] + pub konbini: Option<&'a serde_json::Value>, + /// This sub-hash contains details about the ACH direct debit payment method options to pass to the invoice’s PaymentIntent. + #[serde(skip_serializing_if = "Option::is_none")] + pub us_bank_account: + Option>, +} +impl<'a> CreateSubscriptionPaymentSettingsPaymentMethodOptions<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// This sub-hash contains details about the Canadian pre-authorized debit payment method options to pass to the invoice’s PaymentIntent. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreateSubscriptionPaymentSettingsPaymentMethodOptionsAcssDebit { + /// Additional fields for Mandate creation + #[serde(skip_serializing_if = "Option::is_none")] + pub mandate_options: + Option, + /// Verification method for the intent + #[serde(skip_serializing_if = "Option::is_none")] + pub verification_method: + Option, +} +impl CreateSubscriptionPaymentSettingsPaymentMethodOptionsAcssDebit { + pub fn new() -> Self { + Self::default() + } +} +/// Additional fields for Mandate creation +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreateSubscriptionPaymentSettingsPaymentMethodOptionsAcssDebitMandateOptions { + /// Transaction type of the mandate. + #[serde(skip_serializing_if = "Option::is_none")] + pub transaction_type: Option< + CreateSubscriptionPaymentSettingsPaymentMethodOptionsAcssDebitMandateOptionsTransactionType, + >, +} +impl CreateSubscriptionPaymentSettingsPaymentMethodOptionsAcssDebitMandateOptions { + pub fn new() -> Self { + Self::default() + } +} +/// Transaction type of the mandate. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreateSubscriptionPaymentSettingsPaymentMethodOptionsAcssDebitMandateOptionsTransactionType +{ + Business, + Personal, +} +impl CreateSubscriptionPaymentSettingsPaymentMethodOptionsAcssDebitMandateOptionsTransactionType { + pub fn as_str(self) -> &'static str { + use CreateSubscriptionPaymentSettingsPaymentMethodOptionsAcssDebitMandateOptionsTransactionType::*; + match self { + Business => "business", + Personal => "personal", + } + } +} + +impl std::str::FromStr + for CreateSubscriptionPaymentSettingsPaymentMethodOptionsAcssDebitMandateOptionsTransactionType +{ + type Err = (); + fn from_str(s: &str) -> Result { + use CreateSubscriptionPaymentSettingsPaymentMethodOptionsAcssDebitMandateOptionsTransactionType::*; + match s { + "business" => Ok(Business), + "personal" => Ok(Personal), + _ => Err(()), + } + } +} +impl std::fmt::Display + for CreateSubscriptionPaymentSettingsPaymentMethodOptionsAcssDebitMandateOptionsTransactionType +{ + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug + for CreateSubscriptionPaymentSettingsPaymentMethodOptionsAcssDebitMandateOptionsTransactionType +{ + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize + for CreateSubscriptionPaymentSettingsPaymentMethodOptionsAcssDebitMandateOptionsTransactionType +{ + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Verification method for the intent +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreateSubscriptionPaymentSettingsPaymentMethodOptionsAcssDebitVerificationMethod { + Automatic, + Instant, + Microdeposits, +} +impl CreateSubscriptionPaymentSettingsPaymentMethodOptionsAcssDebitVerificationMethod { + pub fn as_str(self) -> &'static str { + use CreateSubscriptionPaymentSettingsPaymentMethodOptionsAcssDebitVerificationMethod::*; + match self { + Automatic => "automatic", + Instant => "instant", + Microdeposits => "microdeposits", + } + } +} + +impl std::str::FromStr + for CreateSubscriptionPaymentSettingsPaymentMethodOptionsAcssDebitVerificationMethod +{ + type Err = (); + fn from_str(s: &str) -> Result { + use CreateSubscriptionPaymentSettingsPaymentMethodOptionsAcssDebitVerificationMethod::*; + match s { + "automatic" => Ok(Automatic), + "instant" => Ok(Instant), + "microdeposits" => Ok(Microdeposits), + _ => Err(()), + } + } +} +impl std::fmt::Display + for CreateSubscriptionPaymentSettingsPaymentMethodOptionsAcssDebitVerificationMethod +{ + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug + for CreateSubscriptionPaymentSettingsPaymentMethodOptionsAcssDebitVerificationMethod +{ + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize + for CreateSubscriptionPaymentSettingsPaymentMethodOptionsAcssDebitVerificationMethod +{ + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// This sub-hash contains details about the Bancontact payment method options to pass to the invoice’s PaymentIntent. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreateSubscriptionPaymentSettingsPaymentMethodOptionsBancontact { + /// Preferred language of the Bancontact authorization page that the customer is redirected to. + #[serde(skip_serializing_if = "Option::is_none")] + pub preferred_language: + Option, +} +impl CreateSubscriptionPaymentSettingsPaymentMethodOptionsBancontact { + pub fn new() -> Self { + Self::default() + } +} +/// Preferred language of the Bancontact authorization page that the customer is redirected to. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreateSubscriptionPaymentSettingsPaymentMethodOptionsBancontactPreferredLanguage { + De, + En, + Fr, + Nl, +} +impl CreateSubscriptionPaymentSettingsPaymentMethodOptionsBancontactPreferredLanguage { + pub fn as_str(self) -> &'static str { + use CreateSubscriptionPaymentSettingsPaymentMethodOptionsBancontactPreferredLanguage::*; + match self { + De => "de", + En => "en", + Fr => "fr", + Nl => "nl", + } + } +} + +impl std::str::FromStr + for CreateSubscriptionPaymentSettingsPaymentMethodOptionsBancontactPreferredLanguage +{ + type Err = (); + fn from_str(s: &str) -> Result { + use CreateSubscriptionPaymentSettingsPaymentMethodOptionsBancontactPreferredLanguage::*; + match s { + "de" => Ok(De), + "en" => Ok(En), + "fr" => Ok(Fr), + "nl" => Ok(Nl), + _ => Err(()), + } + } +} +impl std::fmt::Display + for CreateSubscriptionPaymentSettingsPaymentMethodOptionsBancontactPreferredLanguage +{ + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug + for CreateSubscriptionPaymentSettingsPaymentMethodOptionsBancontactPreferredLanguage +{ + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize + for CreateSubscriptionPaymentSettingsPaymentMethodOptionsBancontactPreferredLanguage +{ + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// This sub-hash contains details about the Card payment method options to pass to the invoice’s PaymentIntent. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreateSubscriptionPaymentSettingsPaymentMethodOptionsCard<'a> { + /// Configuration options for setting up an eMandate for cards issued in India. + #[serde(skip_serializing_if = "Option::is_none")] + pub mandate_options: + Option>, + /// Selected network to process this Subscription on. + /// Depends on the available networks of the card attached to the Subscription. + /// Can be only set confirm-time. + #[serde(skip_serializing_if = "Option::is_none")] + pub network: Option, + /// We strongly recommend that you rely on our SCA Engine to automatically prompt your customers for authentication based on risk level and [other requirements](https://stripe.com/docs/strong-customer-authentication). + /// However, if you wish to request 3D Secure based on logic from your own fraud engine, provide this option. + /// Read our guide on [manually requesting 3D Secure](https://stripe.com/docs/payments/3d-secure#manual-three-ds) for more information on how this configuration interacts with Radar and our SCA Engine. + #[serde(skip_serializing_if = "Option::is_none")] + pub request_three_d_secure: + Option, +} +impl<'a> CreateSubscriptionPaymentSettingsPaymentMethodOptionsCard<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// Configuration options for setting up an eMandate for cards issued in India. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreateSubscriptionPaymentSettingsPaymentMethodOptionsCardMandateOptions<'a> { + /// Amount to be charged for future payments. + #[serde(skip_serializing_if = "Option::is_none")] + pub amount: Option, + /// One of `fixed` or `maximum`. + /// If `fixed`, the `amount` param refers to the exact amount to be charged in future payments. + /// If `maximum`, the amount charged can be up to the value passed for the `amount` param. + #[serde(skip_serializing_if = "Option::is_none")] + pub amount_type: + Option, + /// A description of the mandate or subscription that is meant to be displayed to the customer. + #[serde(skip_serializing_if = "Option::is_none")] + pub description: Option<&'a str>, +} +impl<'a> CreateSubscriptionPaymentSettingsPaymentMethodOptionsCardMandateOptions<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// One of `fixed` or `maximum`. +/// If `fixed`, the `amount` param refers to the exact amount to be charged in future payments. +/// If `maximum`, the amount charged can be up to the value passed for the `amount` param. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreateSubscriptionPaymentSettingsPaymentMethodOptionsCardMandateOptionsAmountType { + Fixed, + Maximum, +} +impl CreateSubscriptionPaymentSettingsPaymentMethodOptionsCardMandateOptionsAmountType { + pub fn as_str(self) -> &'static str { + use CreateSubscriptionPaymentSettingsPaymentMethodOptionsCardMandateOptionsAmountType::*; + match self { + Fixed => "fixed", + Maximum => "maximum", + } + } +} + +impl std::str::FromStr + for CreateSubscriptionPaymentSettingsPaymentMethodOptionsCardMandateOptionsAmountType +{ + type Err = (); + fn from_str(s: &str) -> Result { + use CreateSubscriptionPaymentSettingsPaymentMethodOptionsCardMandateOptionsAmountType::*; + match s { + "fixed" => Ok(Fixed), + "maximum" => Ok(Maximum), + _ => Err(()), + } + } +} +impl std::fmt::Display + for CreateSubscriptionPaymentSettingsPaymentMethodOptionsCardMandateOptionsAmountType +{ + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug + for CreateSubscriptionPaymentSettingsPaymentMethodOptionsCardMandateOptionsAmountType +{ + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize + for CreateSubscriptionPaymentSettingsPaymentMethodOptionsCardMandateOptionsAmountType +{ + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Selected network to process this Subscription on. +/// Depends on the available networks of the card attached to the Subscription. +/// Can be only set confirm-time. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreateSubscriptionPaymentSettingsPaymentMethodOptionsCardNetwork { + Amex, + CartesBancaires, + Diners, + Discover, + EftposAu, + Interac, + Jcb, + Mastercard, + Unionpay, + Unknown, + Visa, +} +impl CreateSubscriptionPaymentSettingsPaymentMethodOptionsCardNetwork { + pub fn as_str(self) -> &'static str { + use CreateSubscriptionPaymentSettingsPaymentMethodOptionsCardNetwork::*; + match self { + Amex => "amex", + CartesBancaires => "cartes_bancaires", + Diners => "diners", + Discover => "discover", + EftposAu => "eftpos_au", + Interac => "interac", + Jcb => "jcb", + Mastercard => "mastercard", + Unionpay => "unionpay", + Unknown => "unknown", + Visa => "visa", + } + } +} + +impl std::str::FromStr for CreateSubscriptionPaymentSettingsPaymentMethodOptionsCardNetwork { + type Err = (); + fn from_str(s: &str) -> Result { + use CreateSubscriptionPaymentSettingsPaymentMethodOptionsCardNetwork::*; + match s { + "amex" => Ok(Amex), + "cartes_bancaires" => Ok(CartesBancaires), + "diners" => Ok(Diners), + "discover" => Ok(Discover), + "eftpos_au" => Ok(EftposAu), + "interac" => Ok(Interac), + "jcb" => Ok(Jcb), + "mastercard" => Ok(Mastercard), + "unionpay" => Ok(Unionpay), + "unknown" => Ok(Unknown), + "visa" => Ok(Visa), + _ => Err(()), + } + } +} +impl std::fmt::Display for CreateSubscriptionPaymentSettingsPaymentMethodOptionsCardNetwork { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreateSubscriptionPaymentSettingsPaymentMethodOptionsCardNetwork { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreateSubscriptionPaymentSettingsPaymentMethodOptionsCardNetwork { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// We strongly recommend that you rely on our SCA Engine to automatically prompt your customers for authentication based on risk level and [other requirements](https://stripe.com/docs/strong-customer-authentication). +/// However, if you wish to request 3D Secure based on logic from your own fraud engine, provide this option. +/// Read our guide on [manually requesting 3D Secure](https://stripe.com/docs/payments/3d-secure#manual-three-ds) for more information on how this configuration interacts with Radar and our SCA Engine. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreateSubscriptionPaymentSettingsPaymentMethodOptionsCardRequestThreeDSecure { + Any, + Automatic, + Challenge, +} +impl CreateSubscriptionPaymentSettingsPaymentMethodOptionsCardRequestThreeDSecure { + pub fn as_str(self) -> &'static str { + use CreateSubscriptionPaymentSettingsPaymentMethodOptionsCardRequestThreeDSecure::*; + match self { + Any => "any", + Automatic => "automatic", + Challenge => "challenge", + } + } +} + +impl std::str::FromStr + for CreateSubscriptionPaymentSettingsPaymentMethodOptionsCardRequestThreeDSecure +{ + type Err = (); + fn from_str(s: &str) -> Result { + use CreateSubscriptionPaymentSettingsPaymentMethodOptionsCardRequestThreeDSecure::*; + match s { + "any" => Ok(Any), + "automatic" => Ok(Automatic), + "challenge" => Ok(Challenge), + _ => Err(()), + } + } +} +impl std::fmt::Display + for CreateSubscriptionPaymentSettingsPaymentMethodOptionsCardRequestThreeDSecure +{ + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug + for CreateSubscriptionPaymentSettingsPaymentMethodOptionsCardRequestThreeDSecure +{ + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize + for CreateSubscriptionPaymentSettingsPaymentMethodOptionsCardRequestThreeDSecure +{ + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// This sub-hash contains details about the ACH direct debit payment method options to pass to the invoice’s PaymentIntent. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreateSubscriptionPaymentSettingsPaymentMethodOptionsUsBankAccount<'a> { + /// Additional fields for Financial Connections Session creation + #[serde(skip_serializing_if = "Option::is_none")] + pub financial_connections: Option< + CreateSubscriptionPaymentSettingsPaymentMethodOptionsUsBankAccountFinancialConnections<'a>, + >, + /// Verification method for the intent + #[serde(skip_serializing_if = "Option::is_none")] + pub verification_method: Option< + CreateSubscriptionPaymentSettingsPaymentMethodOptionsUsBankAccountVerificationMethod, + >, +} +impl<'a> CreateSubscriptionPaymentSettingsPaymentMethodOptionsUsBankAccount<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// Additional fields for Financial Connections Session creation +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreateSubscriptionPaymentSettingsPaymentMethodOptionsUsBankAccountFinancialConnections<'a> { + /// The list of permissions to request. + /// If this parameter is passed, the `payment_method` permission must be included. + /// Valid permissions include: `balances`, `ownership`, `payment_method`, and `transactions`. +#[serde(skip_serializing_if = "Option::is_none")] +pub permissions: Option<&'a [CreateSubscriptionPaymentSettingsPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions]>, + /// List of data features that you would like to retrieve upon account creation. +#[serde(skip_serializing_if = "Option::is_none")] +pub prefetch: Option<&'a [CreateSubscriptionPaymentSettingsPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch]>, + +} +impl<'a> + CreateSubscriptionPaymentSettingsPaymentMethodOptionsUsBankAccountFinancialConnections<'a> +{ + pub fn new() -> Self { + Self::default() + } +} +/// The list of permissions to request. +/// If this parameter is passed, the `payment_method` permission must be included. +/// Valid permissions include: `balances`, `ownership`, `payment_method`, and `transactions`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreateSubscriptionPaymentSettingsPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions +{ + Balances, + Ownership, + PaymentMethod, + Transactions, +} +impl CreateSubscriptionPaymentSettingsPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions { + pub fn as_str(self) -> &'static str { + use CreateSubscriptionPaymentSettingsPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions::*; + match self { +Balances => "balances", +Ownership => "ownership", +PaymentMethod => "payment_method", +Transactions => "transactions", + + } + } +} + +impl std::str::FromStr for CreateSubscriptionPaymentSettingsPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions { + type Err = (); + fn from_str(s: &str) -> Result { + use CreateSubscriptionPaymentSettingsPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions::*; + match s { + "balances" => Ok(Balances), +"ownership" => Ok(Ownership), +"payment_method" => Ok(PaymentMethod), +"transactions" => Ok(Transactions), +_ => Err(()) + + } + } +} +impl std::fmt::Display for CreateSubscriptionPaymentSettingsPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreateSubscriptionPaymentSettingsPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreateSubscriptionPaymentSettingsPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions { + fn serialize(&self, serializer: S) -> Result where S: serde::Serializer { + serializer.serialize_str(self.as_str()) + } +} +/// List of data features that you would like to retrieve upon account creation. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreateSubscriptionPaymentSettingsPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch +{ + Balances, + Transactions, +} +impl + CreateSubscriptionPaymentSettingsPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch +{ + pub fn as_str(self) -> &'static str { + use CreateSubscriptionPaymentSettingsPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch::*; + match self { + Balances => "balances", + Transactions => "transactions", + } + } +} + +impl std::str::FromStr for CreateSubscriptionPaymentSettingsPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch { + type Err = (); + fn from_str(s: &str) -> Result { + use CreateSubscriptionPaymentSettingsPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch::*; + match s { + "balances" => Ok(Balances), +"transactions" => Ok(Transactions), +_ => Err(()) + + } + } +} +impl std::fmt::Display for CreateSubscriptionPaymentSettingsPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreateSubscriptionPaymentSettingsPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreateSubscriptionPaymentSettingsPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch { + fn serialize(&self, serializer: S) -> Result where S: serde::Serializer { + serializer.serialize_str(self.as_str()) + } +} +/// Verification method for the intent +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreateSubscriptionPaymentSettingsPaymentMethodOptionsUsBankAccountVerificationMethod { + Automatic, + Instant, + Microdeposits, +} +impl CreateSubscriptionPaymentSettingsPaymentMethodOptionsUsBankAccountVerificationMethod { + pub fn as_str(self) -> &'static str { + use CreateSubscriptionPaymentSettingsPaymentMethodOptionsUsBankAccountVerificationMethod::*; + match self { + Automatic => "automatic", + Instant => "instant", + Microdeposits => "microdeposits", + } + } +} + +impl std::str::FromStr + for CreateSubscriptionPaymentSettingsPaymentMethodOptionsUsBankAccountVerificationMethod +{ + type Err = (); + fn from_str(s: &str) -> Result { + use CreateSubscriptionPaymentSettingsPaymentMethodOptionsUsBankAccountVerificationMethod::*; + match s { + "automatic" => Ok(Automatic), + "instant" => Ok(Instant), + "microdeposits" => Ok(Microdeposits), + _ => Err(()), + } + } +} +impl std::fmt::Display + for CreateSubscriptionPaymentSettingsPaymentMethodOptionsUsBankAccountVerificationMethod +{ + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug + for CreateSubscriptionPaymentSettingsPaymentMethodOptionsUsBankAccountVerificationMethod +{ + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize + for CreateSubscriptionPaymentSettingsPaymentMethodOptionsUsBankAccountVerificationMethod +{ + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// The list of payment method types (e.g. +/// card) to provide to the invoice’s PaymentIntent. +/// If not set, Stripe attempts to automatically determine the types to use by looking at the invoice’s default payment method, the subscription’s default payment method, the customer’s default payment method, and your [invoice template settings](https://dashboard.stripe.com/settings/billing/invoice). +#[derive(Copy, Clone, Eq, PartialEq)] +#[non_exhaustive] +pub enum CreateSubscriptionPaymentSettingsPaymentMethodTypes { + AchCreditTransfer, + AchDebit, + AcssDebit, + AuBecsDebit, + BacsDebit, + Bancontact, + Boleto, + Card, + Cashapp, + CustomerBalance, + Eps, + Fpx, + Giropay, + Grabpay, + Ideal, + Konbini, + Link, + P24, + Paynow, + Paypal, + Promptpay, + SepaCreditTransfer, + SepaDebit, + Sofort, + UsBankAccount, + WechatPay, + /// An unrecognized value from Stripe. Should not be used as a request parameter. + Unknown, +} +impl CreateSubscriptionPaymentSettingsPaymentMethodTypes { + pub fn as_str(self) -> &'static str { + use CreateSubscriptionPaymentSettingsPaymentMethodTypes::*; + match self { + AchCreditTransfer => "ach_credit_transfer", + AchDebit => "ach_debit", + AcssDebit => "acss_debit", + AuBecsDebit => "au_becs_debit", + BacsDebit => "bacs_debit", + Bancontact => "bancontact", + Boleto => "boleto", + Card => "card", + Cashapp => "cashapp", + CustomerBalance => "customer_balance", + Eps => "eps", + Fpx => "fpx", + Giropay => "giropay", + Grabpay => "grabpay", + Ideal => "ideal", + Konbini => "konbini", + Link => "link", + P24 => "p24", + Paynow => "paynow", + Paypal => "paypal", + Promptpay => "promptpay", + SepaCreditTransfer => "sepa_credit_transfer", + SepaDebit => "sepa_debit", + Sofort => "sofort", + UsBankAccount => "us_bank_account", + WechatPay => "wechat_pay", + Unknown => "unknown", + } + } +} + +impl std::str::FromStr for CreateSubscriptionPaymentSettingsPaymentMethodTypes { + type Err = (); + fn from_str(s: &str) -> Result { + use CreateSubscriptionPaymentSettingsPaymentMethodTypes::*; + match s { + "ach_credit_transfer" => Ok(AchCreditTransfer), + "ach_debit" => Ok(AchDebit), + "acss_debit" => Ok(AcssDebit), + "au_becs_debit" => Ok(AuBecsDebit), + "bacs_debit" => Ok(BacsDebit), + "bancontact" => Ok(Bancontact), + "boleto" => Ok(Boleto), + "card" => Ok(Card), + "cashapp" => Ok(Cashapp), + "customer_balance" => Ok(CustomerBalance), + "eps" => Ok(Eps), + "fpx" => Ok(Fpx), + "giropay" => Ok(Giropay), + "grabpay" => Ok(Grabpay), + "ideal" => Ok(Ideal), + "konbini" => Ok(Konbini), + "link" => Ok(Link), + "p24" => Ok(P24), + "paynow" => Ok(Paynow), + "paypal" => Ok(Paypal), + "promptpay" => Ok(Promptpay), + "sepa_credit_transfer" => Ok(SepaCreditTransfer), + "sepa_debit" => Ok(SepaDebit), + "sofort" => Ok(Sofort), + "us_bank_account" => Ok(UsBankAccount), + "wechat_pay" => Ok(WechatPay), + _ => Err(()), + } + } +} +impl std::fmt::Display for CreateSubscriptionPaymentSettingsPaymentMethodTypes { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreateSubscriptionPaymentSettingsPaymentMethodTypes { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreateSubscriptionPaymentSettingsPaymentMethodTypes { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Either `off`, or `on_subscription`. +/// With `on_subscription` Stripe updates `subscription.default_payment_method` when a subscription payment succeeds. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreateSubscriptionPaymentSettingsSaveDefaultPaymentMethod { + Off, + OnSubscription, +} +impl CreateSubscriptionPaymentSettingsSaveDefaultPaymentMethod { + pub fn as_str(self) -> &'static str { + use CreateSubscriptionPaymentSettingsSaveDefaultPaymentMethod::*; + match self { + Off => "off", + OnSubscription => "on_subscription", + } + } +} + +impl std::str::FromStr for CreateSubscriptionPaymentSettingsSaveDefaultPaymentMethod { + type Err = (); + fn from_str(s: &str) -> Result { + use CreateSubscriptionPaymentSettingsSaveDefaultPaymentMethod::*; + match s { + "off" => Ok(Off), + "on_subscription" => Ok(OnSubscription), + _ => Err(()), + } + } +} +impl std::fmt::Display for CreateSubscriptionPaymentSettingsSaveDefaultPaymentMethod { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreateSubscriptionPaymentSettingsSaveDefaultPaymentMethod { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreateSubscriptionPaymentSettingsSaveDefaultPaymentMethod { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Specifies an interval for how often to bill for any pending invoice items. +/// It is analogous to calling [Create an invoice](https://stripe.com/docs/api#create_invoice) for the given subscription at the specified interval. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreateSubscriptionPendingInvoiceItemInterval { + /// Specifies invoicing frequency. Either `day`, `week`, `month` or `year`. + pub interval: CreateSubscriptionPendingInvoiceItemIntervalInterval, + /// The number of intervals between invoices. + /// For example, `interval=month` and `interval_count=3` bills every 3 months. + /// Maximum of one year interval allowed (1 year, 12 months, or 52 weeks). + #[serde(skip_serializing_if = "Option::is_none")] + pub interval_count: Option, +} +impl CreateSubscriptionPendingInvoiceItemInterval { + pub fn new(interval: CreateSubscriptionPendingInvoiceItemIntervalInterval) -> Self { + Self { interval, interval_count: None } + } +} +/// Specifies invoicing frequency. Either `day`, `week`, `month` or `year`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreateSubscriptionPendingInvoiceItemIntervalInterval { + Day, + Month, + Week, + Year, +} +impl CreateSubscriptionPendingInvoiceItemIntervalInterval { + pub fn as_str(self) -> &'static str { + use CreateSubscriptionPendingInvoiceItemIntervalInterval::*; + match self { + Day => "day", + Month => "month", + Week => "week", + Year => "year", + } + } +} + +impl std::str::FromStr for CreateSubscriptionPendingInvoiceItemIntervalInterval { + type Err = (); + fn from_str(s: &str) -> Result { + use CreateSubscriptionPendingInvoiceItemIntervalInterval::*; + match s { + "day" => Ok(Day), + "month" => Ok(Month), + "week" => Ok(Week), + "year" => Ok(Year), + _ => Err(()), + } + } +} +impl std::fmt::Display for CreateSubscriptionPendingInvoiceItemIntervalInterval { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreateSubscriptionPendingInvoiceItemIntervalInterval { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreateSubscriptionPendingInvoiceItemIntervalInterval { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Determines how to handle [prorations](https://stripe.com/docs/subscriptions/billing-cycle#prorations) resulting from the `billing_cycle_anchor`. +/// If no value is passed, the default is `create_prorations`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreateSubscriptionProrationBehavior { + AlwaysInvoice, + CreateProrations, + None, +} +impl CreateSubscriptionProrationBehavior { + pub fn as_str(self) -> &'static str { + use CreateSubscriptionProrationBehavior::*; + match self { + AlwaysInvoice => "always_invoice", + CreateProrations => "create_prorations", + None => "none", + } + } +} + +impl std::str::FromStr for CreateSubscriptionProrationBehavior { + type Err = (); + fn from_str(s: &str) -> Result { + use CreateSubscriptionProrationBehavior::*; + match s { + "always_invoice" => Ok(AlwaysInvoice), + "create_prorations" => Ok(CreateProrations), + "none" => Ok(None), + _ => Err(()), + } + } +} +impl std::fmt::Display for CreateSubscriptionProrationBehavior { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreateSubscriptionProrationBehavior { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreateSubscriptionProrationBehavior { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Unix timestamp representing the end of the trial period the customer will get before being charged for the first time. +/// If set, trial_end will override the default trial period of the plan the customer is being subscribed to. +/// The special value `now` can be provided to end the customer's trial immediately. +/// Can be at most two years from `billing_cycle_anchor`. +/// See [Using trial periods on subscriptions](https://stripe.com/docs/billing/subscriptions/trials) to learn more. +#[derive(Copy, Clone, Debug, serde::Serialize)] +#[serde(untagged)] +pub enum CreateSubscriptionTrialEnd { + Now, + Timestamp(stripe_types::Timestamp), +} +/// Settings related to subscription trials. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreateSubscriptionTrialSettings { + /// Defines how the subscription should behave when the user's free trial ends. + pub end_behavior: CreateSubscriptionTrialSettingsEndBehavior, +} +impl CreateSubscriptionTrialSettings { + pub fn new(end_behavior: CreateSubscriptionTrialSettingsEndBehavior) -> Self { + Self { end_behavior } + } +} +/// Defines how the subscription should behave when the user's free trial ends. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreateSubscriptionTrialSettingsEndBehavior { + /// Indicates how the subscription should change when the trial ends if the user did not provide a payment method. + pub missing_payment_method: CreateSubscriptionTrialSettingsEndBehaviorMissingPaymentMethod, +} +impl CreateSubscriptionTrialSettingsEndBehavior { + pub fn new( + missing_payment_method: CreateSubscriptionTrialSettingsEndBehaviorMissingPaymentMethod, + ) -> Self { + Self { missing_payment_method } + } +} +/// Indicates how the subscription should change when the trial ends if the user did not provide a payment method. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreateSubscriptionTrialSettingsEndBehaviorMissingPaymentMethod { + Cancel, + CreateInvoice, + Pause, +} +impl CreateSubscriptionTrialSettingsEndBehaviorMissingPaymentMethod { + pub fn as_str(self) -> &'static str { + use CreateSubscriptionTrialSettingsEndBehaviorMissingPaymentMethod::*; + match self { + Cancel => "cancel", + CreateInvoice => "create_invoice", + Pause => "pause", + } + } +} + +impl std::str::FromStr for CreateSubscriptionTrialSettingsEndBehaviorMissingPaymentMethod { + type Err = (); + fn from_str(s: &str) -> Result { + use CreateSubscriptionTrialSettingsEndBehaviorMissingPaymentMethod::*; + match s { + "cancel" => Ok(Cancel), + "create_invoice" => Ok(CreateInvoice), + "pause" => Ok(Pause), + _ => Err(()), + } + } +} +impl std::fmt::Display for CreateSubscriptionTrialSettingsEndBehaviorMissingPaymentMethod { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreateSubscriptionTrialSettingsEndBehaviorMissingPaymentMethod { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreateSubscriptionTrialSettingsEndBehaviorMissingPaymentMethod { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'a> CreateSubscription<'a> { + /// Creates a new subscription on an existing customer. + /// Each customer can have up to 500 active or scheduled subscriptions. + /// + /// When you create a subscription with `collection_method=charge_automatically`, the first invoice is finalized as part of the request. + /// The `payment_behavior` parameter determines the exact behavior of the initial payment. + /// + /// To start subscriptions where the first invoice always begins in a `draft` status, use [subscription schedules](https://stripe.com/docs/billing/subscriptions/subscription-schedules#managing) instead. + /// Schedules provide the flexibility to model more complex billing configurations that change over time. + pub fn send(&self, client: &stripe::Client) -> stripe::Response { + client.send_form("/subscriptions", self, http_types::Method::Post) + } +} +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct ResumeSubscription<'a> { + /// Either `now` or `unchanged`. + /// Setting the value to `now` resets the subscription's billing cycle anchor to the current time (in UTC). + /// Setting the value to `unchanged` advances the subscription's billing cycle anchor to the period that surrounds the current time. + /// For more information, see the billing cycle [documentation](https://stripe.com/docs/billing/subscriptions/billing-cycle). + #[serde(skip_serializing_if = "Option::is_none")] + pub billing_cycle_anchor: Option, + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, + /// Determines how to handle [prorations](https://stripe.com/docs/subscriptions/billing-cycle#prorations) when the billing cycle changes (e.g., when switching plans, resetting `billing_cycle_anchor=now`, or starting a trial), or if an item's `quantity` changes. + /// The default value is `create_prorations`. + #[serde(skip_serializing_if = "Option::is_none")] + pub proration_behavior: Option, + /// If set, the proration will be calculated as though the subscription was resumed at the given time. + /// This can be used to apply exactly the same proration that was previewed with [upcoming invoice](https://stripe.com/docs/api#retrieve_customer_invoice) endpoint. + #[serde(skip_serializing_if = "Option::is_none")] + pub proration_date: Option, +} +impl<'a> ResumeSubscription<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// Either `now` or `unchanged`. +/// Setting the value to `now` resets the subscription's billing cycle anchor to the current time (in UTC). +/// Setting the value to `unchanged` advances the subscription's billing cycle anchor to the period that surrounds the current time. +/// For more information, see the billing cycle [documentation](https://stripe.com/docs/billing/subscriptions/billing-cycle). +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum ResumeSubscriptionBillingCycleAnchor { + Now, + Unchanged, +} +impl ResumeSubscriptionBillingCycleAnchor { + pub fn as_str(self) -> &'static str { + use ResumeSubscriptionBillingCycleAnchor::*; + match self { + Now => "now", + Unchanged => "unchanged", + } + } +} + +impl std::str::FromStr for ResumeSubscriptionBillingCycleAnchor { + type Err = (); + fn from_str(s: &str) -> Result { + use ResumeSubscriptionBillingCycleAnchor::*; + match s { + "now" => Ok(Now), + "unchanged" => Ok(Unchanged), + _ => Err(()), + } + } +} +impl std::fmt::Display for ResumeSubscriptionBillingCycleAnchor { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for ResumeSubscriptionBillingCycleAnchor { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for ResumeSubscriptionBillingCycleAnchor { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Determines how to handle [prorations](https://stripe.com/docs/subscriptions/billing-cycle#prorations) when the billing cycle changes (e.g., when switching plans, resetting `billing_cycle_anchor=now`, or starting a trial), or if an item's `quantity` changes. +/// The default value is `create_prorations`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum ResumeSubscriptionProrationBehavior { + AlwaysInvoice, + CreateProrations, + None, +} +impl ResumeSubscriptionProrationBehavior { + pub fn as_str(self) -> &'static str { + use ResumeSubscriptionProrationBehavior::*; + match self { + AlwaysInvoice => "always_invoice", + CreateProrations => "create_prorations", + None => "none", + } + } +} + +impl std::str::FromStr for ResumeSubscriptionProrationBehavior { + type Err = (); + fn from_str(s: &str) -> Result { + use ResumeSubscriptionProrationBehavior::*; + match s { + "always_invoice" => Ok(AlwaysInvoice), + "create_prorations" => Ok(CreateProrations), + "none" => Ok(None), + _ => Err(()), + } + } +} +impl std::fmt::Display for ResumeSubscriptionProrationBehavior { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for ResumeSubscriptionProrationBehavior { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for ResumeSubscriptionProrationBehavior { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'a> ResumeSubscription<'a> { + /// Initiates resumption of a paused subscription, optionally resetting the billing cycle anchor and creating prorations. + /// If a resumption invoice is generated, it must be paid or marked uncollectible before the subscription will be unpaused. + /// If payment succeeds the subscription will become `active`, and if payment fails the subscription will be `past_due`. + /// The resumption invoice will void automatically if not paid by the expiration date. + pub fn send( + &self, + client: &stripe::Client, + subscription: &stripe_shared::SubscriptionId, + ) -> stripe::Response { + client.send_form( + &format!("/subscriptions/{subscription}/resume"), + self, + http_types::Method::Post, + ) + } +} +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdateSubscription<'a> { + /// A list of prices and quantities that will generate invoice items appended to the next invoice for this subscription. + /// You may pass up to 20 items. + #[serde(skip_serializing_if = "Option::is_none")] + pub add_invoice_items: Option<&'a [UpdateSubscriptionAddInvoiceItems<'a>]>, + /// A non-negative decimal between 0 and 100, with at most two decimal places. + /// This represents the percentage of the subscription invoice total that will be transferred to the application owner's Stripe account. + /// The request must be made by a platform account on a connected account in order to set an application fee percentage. + /// For more information, see the application fees [documentation](https://stripe.com/docs/connect/subscriptions#collecting-fees-on-subscriptions). + #[serde(skip_serializing_if = "Option::is_none")] + pub application_fee_percent: Option, + /// Automatic tax settings for this subscription. + /// We recommend you only include this parameter when the existing value is being changed. + #[serde(skip_serializing_if = "Option::is_none")] + pub automatic_tax: Option>, + /// Either `now` or `unchanged`. + /// Setting the value to `now` resets the subscription's billing cycle anchor to the current time (in UTC). + /// For more information, see the billing cycle [documentation](https://stripe.com/docs/billing/subscriptions/billing-cycle). + #[serde(skip_serializing_if = "Option::is_none")] + pub billing_cycle_anchor: Option, + /// Define thresholds at which an invoice will be sent, and the subscription advanced to a new billing period. + /// Pass an empty string to remove previously-defined thresholds. + #[serde(skip_serializing_if = "Option::is_none")] + pub billing_thresholds: Option, + /// A timestamp at which the subscription should cancel. + /// If set to a date before the current period ends, this will cause a proration if prorations have been enabled using `proration_behavior`. + /// If set during a future period, this will always cause a proration for that period. + #[serde(skip_serializing_if = "Option::is_none")] + pub cancel_at: Option, + /// Boolean indicating whether this subscription should cancel at the end of the current period. + #[serde(skip_serializing_if = "Option::is_none")] + pub cancel_at_period_end: Option, + /// Details about why this subscription was cancelled + #[serde(skip_serializing_if = "Option::is_none")] + pub cancellation_details: Option>, + /// Either `charge_automatically`, or `send_invoice`. + /// When charging automatically, Stripe will attempt to pay this subscription at the end of the cycle using the default source attached to the customer. + /// When sending an invoice, Stripe will email your customer an invoice with payment instructions and mark the subscription as `active`. + /// Defaults to `charge_automatically`. + #[serde(skip_serializing_if = "Option::is_none")] + pub collection_method: Option, + /// The ID of the coupon to apply to this subscription. + /// A coupon applied to a subscription will only affect invoices created for that particular subscription. + #[serde(skip_serializing_if = "Option::is_none")] + pub coupon: Option<&'a str>, + /// Number of days a customer has to pay invoices generated by this subscription. + /// Valid only for subscriptions where `collection_method` is set to `send_invoice`. + #[serde(skip_serializing_if = "Option::is_none")] + pub days_until_due: Option, + /// ID of the default payment method for the subscription. + /// It must belong to the customer associated with the subscription. + /// This takes precedence over `default_source`. + /// If neither are set, invoices will use the customer's [invoice_settings.default_payment_method](https://stripe.com/docs/api/customers/object#customer_object-invoice_settings-default_payment_method) or [default_source](https://stripe.com/docs/api/customers/object#customer_object-default_source). + #[serde(skip_serializing_if = "Option::is_none")] + pub default_payment_method: Option<&'a str>, + /// ID of the default payment source for the subscription. + /// It must belong to the customer associated with the subscription and be in a chargeable state. + /// If `default_payment_method` is also set, `default_payment_method` will take precedence. + /// If neither are set, invoices will use the customer's [invoice_settings.default_payment_method](https://stripe.com/docs/api/customers/object#customer_object-invoice_settings-default_payment_method) or [default_source](https://stripe.com/docs/api/customers/object#customer_object-default_source). + #[serde(skip_serializing_if = "Option::is_none")] + pub default_source: Option<&'a str>, + /// The tax rates that will apply to any subscription item that does not have `tax_rates` set. + /// Invoices created will have their `default_tax_rates` populated from the subscription. + /// Pass an empty string to remove previously-defined tax rates. + #[serde(skip_serializing_if = "Option::is_none")] + pub default_tax_rates: Option<&'a [&'a str]>, + /// The subscription's description, meant to be displayable to the customer. + /// Use this field to optionally store an explanation of the subscription for rendering in Stripe surfaces and certain local payment methods UIs. + #[serde(skip_serializing_if = "Option::is_none")] + pub description: Option<&'a str>, + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, + /// All invoices will be billed using the specified settings. + #[serde(skip_serializing_if = "Option::is_none")] + pub invoice_settings: Option>, + /// A list of up to 20 subscription items, each with an attached price. + #[serde(skip_serializing_if = "Option::is_none")] + pub items: Option<&'a [UpdateSubscriptionItems<'a>]>, + /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. + /// This can be useful for storing additional information about the object in a structured format. + /// Individual keys can be unset by posting an empty value to them. + /// All keys can be unset by posting an empty value to `metadata`. + #[serde(skip_serializing_if = "Option::is_none")] + pub metadata: Option<&'a std::collections::HashMap>, + /// Indicates if a customer is on or off-session while an invoice payment is attempted. + #[serde(skip_serializing_if = "Option::is_none")] + pub off_session: Option, + /// The account on behalf of which to charge, for each of the subscription's invoices. + #[serde(skip_serializing_if = "Option::is_none")] + pub on_behalf_of: Option<&'a str>, + /// If specified, payment collection for this subscription will be paused. + #[serde(skip_serializing_if = "Option::is_none")] + pub pause_collection: Option, + /// Use `allow_incomplete` to transition the subscription to `status=past_due` if a payment is required but cannot be paid. + /// This allows you to manage scenarios where additional user actions are needed to pay a subscription's invoice. + /// For example, SCA regulation may require 3DS authentication to complete payment. + /// See the [SCA Migration Guide](https://stripe.com/docs/billing/migration/strong-customer-authentication) for Billing to learn more. + /// This is the default behavior. + /// + /// Use `default_incomplete` to transition the subscription to `status=past_due` when payment is required and await explicit confirmation of the invoice's payment intent. + /// This allows simpler management of scenarios where additional user actions are needed to pay a subscription’s invoice. + /// Such as failed payments, [SCA regulation](https://stripe.com/docs/billing/migration/strong-customer-authentication), or collecting a mandate for a bank debit payment method. + /// + /// Use `pending_if_incomplete` to update the subscription using [pending updates](https://stripe.com/docs/billing/subscriptions/pending-updates). + /// When you use `pending_if_incomplete` you can only pass the parameters [supported by pending updates](https://stripe.com/docs/billing/pending-updates-reference#supported-attributes). + /// + /// Use `error_if_incomplete` if you want Stripe to return an HTTP 402 status code if a subscription's invoice cannot be paid. + /// For example, if a payment method requires 3DS authentication due to SCA regulation and further user action is needed, this parameter does not update the subscription and returns an error instead. + /// This was the default behavior for API versions prior to 2019-03-14. + /// See the [changelog](https://stripe.com/docs/upgrades#2019-03-14) to learn more. + #[serde(skip_serializing_if = "Option::is_none")] + pub payment_behavior: Option, + /// Payment settings to pass to invoices created by the subscription. + #[serde(skip_serializing_if = "Option::is_none")] + pub payment_settings: Option>, + /// Specifies an interval for how often to bill for any pending invoice items. + /// It is analogous to calling [Create an invoice](https://stripe.com/docs/api#create_invoice) for the given subscription at the specified interval. + #[serde(skip_serializing_if = "Option::is_none")] + pub pending_invoice_item_interval: Option, + /// The promotion code to apply to this subscription. + /// A promotion code applied to a subscription will only affect invoices created for that particular subscription. + #[serde(skip_serializing_if = "Option::is_none")] + pub promotion_code: Option<&'a str>, + /// Determines how to handle [prorations](https://stripe.com/docs/subscriptions/billing-cycle#prorations) when the billing cycle changes (e.g., when switching plans, resetting `billing_cycle_anchor=now`, or starting a trial), or if an item's `quantity` changes. + /// The default value is `create_prorations`. + #[serde(skip_serializing_if = "Option::is_none")] + pub proration_behavior: Option, + /// If set, the proration will be calculated as though the subscription was updated at the given time. + /// This can be used to apply exactly the same proration that was previewed with [upcoming invoice](https://stripe.com/docs/api#upcoming_invoice) endpoint. + /// It can also be used to implement custom proration logic, such as prorating by day instead of by second, by providing the time that you wish to use for proration calculations. + #[serde(skip_serializing_if = "Option::is_none")] + pub proration_date: Option, + /// If specified, the funds from the subscription's invoices will be transferred to the destination and the ID of the resulting transfers will be found on the resulting charges. + /// This will be unset if you POST an empty value. + #[serde(skip_serializing_if = "Option::is_none")] + pub transfer_data: Option>, + /// Unix timestamp representing the end of the trial period the customer will get before being charged for the first time. + /// This will always overwrite any trials that might apply via a subscribed plan. + /// If set, trial_end will override the default trial period of the plan the customer is being subscribed to. + /// The special value `now` can be provided to end the customer's trial immediately. + /// Can be at most two years from `billing_cycle_anchor`. + #[serde(skip_serializing_if = "Option::is_none")] + pub trial_end: Option, + /// Indicates if a plan's `trial_period_days` should be applied to the subscription. + /// Setting `trial_end` per subscription is preferred, and this defaults to `false`. + /// Setting this flag to `true` together with `trial_end` is not allowed. + /// See [Using trial periods on subscriptions](https://stripe.com/docs/billing/subscriptions/trials) to learn more. + #[serde(skip_serializing_if = "Option::is_none")] + pub trial_from_plan: Option, + /// Settings related to subscription trials. + #[serde(skip_serializing_if = "Option::is_none")] + pub trial_settings: Option, +} +impl<'a> UpdateSubscription<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// A list of prices and quantities that will generate invoice items appended to the next invoice for this subscription. +/// You may pass up to 20 items. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdateSubscriptionAddInvoiceItems<'a> { + /// The ID of the price object. + #[serde(skip_serializing_if = "Option::is_none")] + pub price: Option<&'a str>, + /// Data used to generate a new [Price](https://stripe.com/docs/api/prices) object inline. + #[serde(skip_serializing_if = "Option::is_none")] + pub price_data: Option>, + /// Quantity for this item. Defaults to 1. + #[serde(skip_serializing_if = "Option::is_none")] + pub quantity: Option, + /// The tax rates which apply to the item. When set, the `default_tax_rates` do not apply to this item. + #[serde(skip_serializing_if = "Option::is_none")] + pub tax_rates: Option<&'a [&'a str]>, +} +impl<'a> UpdateSubscriptionAddInvoiceItems<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// Data used to generate a new [Price](https://stripe.com/docs/api/prices) object inline. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct UpdateSubscriptionAddInvoiceItemsPriceData<'a> { + /// Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. + /// Must be a [supported currency](https://stripe.com/docs/currencies). + pub currency: stripe_types::Currency, + /// The ID of the product that this price will belong to. + pub product: &'a str, + /// Only required if a [default tax behavior](https://stripe.com/docs/tax/products-prices-tax-categories-tax-behavior#setting-a-default-tax-behavior-(recommended)) was not provided in the Stripe Tax settings. + /// Specifies whether the price is considered inclusive of taxes or exclusive of taxes. + /// One of `inclusive`, `exclusive`, or `unspecified`. + /// Once specified as either `inclusive` or `exclusive`, it cannot be changed. + #[serde(skip_serializing_if = "Option::is_none")] + pub tax_behavior: Option, + /// A positive integer in cents (or local equivalent) (or 0 for a free price) representing how much to charge. + #[serde(skip_serializing_if = "Option::is_none")] + pub unit_amount: Option, + /// Same as `unit_amount`, but accepts a decimal value in cents (or local equivalent) with at most 12 decimal places. + /// Only one of `unit_amount` and `unit_amount_decimal` can be set. + #[serde(skip_serializing_if = "Option::is_none")] + pub unit_amount_decimal: Option<&'a str>, +} +impl<'a> UpdateSubscriptionAddInvoiceItemsPriceData<'a> { + pub fn new(currency: stripe_types::Currency, product: &'a str) -> Self { + Self { currency, product, tax_behavior: None, unit_amount: None, unit_amount_decimal: None } + } +} +/// Only required if a [default tax behavior](https://stripe.com/docs/tax/products-prices-tax-categories-tax-behavior#setting-a-default-tax-behavior-(recommended)) was not provided in the Stripe Tax settings. +/// Specifies whether the price is considered inclusive of taxes or exclusive of taxes. +/// One of `inclusive`, `exclusive`, or `unspecified`. +/// Once specified as either `inclusive` or `exclusive`, it cannot be changed. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum UpdateSubscriptionAddInvoiceItemsPriceDataTaxBehavior { + Exclusive, + Inclusive, + Unspecified, +} +impl UpdateSubscriptionAddInvoiceItemsPriceDataTaxBehavior { + pub fn as_str(self) -> &'static str { + use UpdateSubscriptionAddInvoiceItemsPriceDataTaxBehavior::*; + match self { + Exclusive => "exclusive", + Inclusive => "inclusive", + Unspecified => "unspecified", + } + } +} + +impl std::str::FromStr for UpdateSubscriptionAddInvoiceItemsPriceDataTaxBehavior { + type Err = (); + fn from_str(s: &str) -> Result { + use UpdateSubscriptionAddInvoiceItemsPriceDataTaxBehavior::*; + match s { + "exclusive" => Ok(Exclusive), + "inclusive" => Ok(Inclusive), + "unspecified" => Ok(Unspecified), + _ => Err(()), + } + } +} +impl std::fmt::Display for UpdateSubscriptionAddInvoiceItemsPriceDataTaxBehavior { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for UpdateSubscriptionAddInvoiceItemsPriceDataTaxBehavior { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for UpdateSubscriptionAddInvoiceItemsPriceDataTaxBehavior { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Automatic tax settings for this subscription. +/// We recommend you only include this parameter when the existing value is being changed. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct UpdateSubscriptionAutomaticTax<'a> { + /// Enabled automatic tax calculation which will automatically compute tax rates on all invoices generated by the subscription. + pub enabled: bool, + /// The account that's liable for tax. + /// If set, the business address and tax registrations required to perform the tax calculation are loaded from this account. + /// The tax transaction is returned in the report of the connected account. + #[serde(skip_serializing_if = "Option::is_none")] + pub liability: Option>, +} +impl<'a> UpdateSubscriptionAutomaticTax<'a> { + pub fn new(enabled: bool) -> Self { + Self { enabled, liability: None } + } +} +/// The account that's liable for tax. +/// If set, the business address and tax registrations required to perform the tax calculation are loaded from this account. +/// The tax transaction is returned in the report of the connected account. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct UpdateSubscriptionAutomaticTaxLiability<'a> { + /// The connected account being referenced when `type` is `account`. + #[serde(skip_serializing_if = "Option::is_none")] + pub account: Option<&'a str>, + /// Type of the account referenced in the request. + #[serde(rename = "type")] + pub type_: UpdateSubscriptionAutomaticTaxLiabilityType, +} +impl<'a> UpdateSubscriptionAutomaticTaxLiability<'a> { + pub fn new(type_: UpdateSubscriptionAutomaticTaxLiabilityType) -> Self { + Self { account: None, type_ } + } +} +/// Type of the account referenced in the request. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum UpdateSubscriptionAutomaticTaxLiabilityType { + Account, + Self_, +} +impl UpdateSubscriptionAutomaticTaxLiabilityType { + pub fn as_str(self) -> &'static str { + use UpdateSubscriptionAutomaticTaxLiabilityType::*; + match self { + Account => "account", + Self_ => "self", + } + } +} + +impl std::str::FromStr for UpdateSubscriptionAutomaticTaxLiabilityType { + type Err = (); + fn from_str(s: &str) -> Result { + use UpdateSubscriptionAutomaticTaxLiabilityType::*; + match s { + "account" => Ok(Account), + "self" => Ok(Self_), + _ => Err(()), + } + } +} +impl std::fmt::Display for UpdateSubscriptionAutomaticTaxLiabilityType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for UpdateSubscriptionAutomaticTaxLiabilityType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for UpdateSubscriptionAutomaticTaxLiabilityType { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Either `now` or `unchanged`. +/// Setting the value to `now` resets the subscription's billing cycle anchor to the current time (in UTC). +/// For more information, see the billing cycle [documentation](https://stripe.com/docs/billing/subscriptions/billing-cycle). +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum UpdateSubscriptionBillingCycleAnchor { + Now, + Unchanged, +} +impl UpdateSubscriptionBillingCycleAnchor { + pub fn as_str(self) -> &'static str { + use UpdateSubscriptionBillingCycleAnchor::*; + match self { + Now => "now", + Unchanged => "unchanged", + } + } +} + +impl std::str::FromStr for UpdateSubscriptionBillingCycleAnchor { + type Err = (); + fn from_str(s: &str) -> Result { + use UpdateSubscriptionBillingCycleAnchor::*; + match s { + "now" => Ok(Now), + "unchanged" => Ok(Unchanged), + _ => Err(()), + } + } +} +impl std::fmt::Display for UpdateSubscriptionBillingCycleAnchor { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for UpdateSubscriptionBillingCycleAnchor { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for UpdateSubscriptionBillingCycleAnchor { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Details about why this subscription was cancelled +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdateSubscriptionCancellationDetails<'a> { + /// Additional comments about why the user canceled the subscription, if the subscription was canceled explicitly by the user. + #[serde(skip_serializing_if = "Option::is_none")] + pub comment: Option<&'a str>, + /// The customer submitted reason for why they canceled, if the subscription was canceled explicitly by the user. + #[serde(skip_serializing_if = "Option::is_none")] + pub feedback: Option, +} +impl<'a> UpdateSubscriptionCancellationDetails<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// The customer submitted reason for why they canceled, if the subscription was canceled explicitly by the user. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum UpdateSubscriptionCancellationDetailsFeedback { + CustomerService, + LowQuality, + MissingFeatures, + Other, + SwitchedService, + TooComplex, + TooExpensive, + Unused, +} +impl UpdateSubscriptionCancellationDetailsFeedback { + pub fn as_str(self) -> &'static str { + use UpdateSubscriptionCancellationDetailsFeedback::*; + match self { + CustomerService => "customer_service", + LowQuality => "low_quality", + MissingFeatures => "missing_features", + Other => "other", + SwitchedService => "switched_service", + TooComplex => "too_complex", + TooExpensive => "too_expensive", + Unused => "unused", + } + } +} + +impl std::str::FromStr for UpdateSubscriptionCancellationDetailsFeedback { + type Err = (); + fn from_str(s: &str) -> Result { + use UpdateSubscriptionCancellationDetailsFeedback::*; + match s { + "customer_service" => Ok(CustomerService), + "low_quality" => Ok(LowQuality), + "missing_features" => Ok(MissingFeatures), + "other" => Ok(Other), + "switched_service" => Ok(SwitchedService), + "too_complex" => Ok(TooComplex), + "too_expensive" => Ok(TooExpensive), + "unused" => Ok(Unused), + _ => Err(()), + } + } +} +impl std::fmt::Display for UpdateSubscriptionCancellationDetailsFeedback { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for UpdateSubscriptionCancellationDetailsFeedback { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for UpdateSubscriptionCancellationDetailsFeedback { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// All invoices will be billed using the specified settings. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdateSubscriptionInvoiceSettings<'a> { + /// The account tax IDs associated with the subscription. + /// Will be set on invoices generated by the subscription. + #[serde(skip_serializing_if = "Option::is_none")] + pub account_tax_ids: Option<&'a [&'a str]>, + /// The connected account that issues the invoice. + /// The invoice is presented with the branding and support information of the specified account. + #[serde(skip_serializing_if = "Option::is_none")] + pub issuer: Option>, +} +impl<'a> UpdateSubscriptionInvoiceSettings<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// The connected account that issues the invoice. +/// The invoice is presented with the branding and support information of the specified account. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct UpdateSubscriptionInvoiceSettingsIssuer<'a> { + /// The connected account being referenced when `type` is `account`. + #[serde(skip_serializing_if = "Option::is_none")] + pub account: Option<&'a str>, + /// Type of the account referenced in the request. + #[serde(rename = "type")] + pub type_: UpdateSubscriptionInvoiceSettingsIssuerType, +} +impl<'a> UpdateSubscriptionInvoiceSettingsIssuer<'a> { + pub fn new(type_: UpdateSubscriptionInvoiceSettingsIssuerType) -> Self { + Self { account: None, type_ } + } +} +/// Type of the account referenced in the request. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum UpdateSubscriptionInvoiceSettingsIssuerType { + Account, + Self_, +} +impl UpdateSubscriptionInvoiceSettingsIssuerType { + pub fn as_str(self) -> &'static str { + use UpdateSubscriptionInvoiceSettingsIssuerType::*; + match self { + Account => "account", + Self_ => "self", + } + } +} + +impl std::str::FromStr for UpdateSubscriptionInvoiceSettingsIssuerType { + type Err = (); + fn from_str(s: &str) -> Result { + use UpdateSubscriptionInvoiceSettingsIssuerType::*; + match s { + "account" => Ok(Account), + "self" => Ok(Self_), + _ => Err(()), + } + } +} +impl std::fmt::Display for UpdateSubscriptionInvoiceSettingsIssuerType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for UpdateSubscriptionInvoiceSettingsIssuerType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for UpdateSubscriptionInvoiceSettingsIssuerType { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// A list of up to 20 subscription items, each with an attached price. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdateSubscriptionItems<'a> { + /// Define thresholds at which an invoice will be sent, and the subscription advanced to a new billing period. + /// When updating, pass an empty string to remove previously-defined thresholds. + #[serde(skip_serializing_if = "Option::is_none")] + pub billing_thresholds: Option, + /// Delete all usage for a given subscription item. + /// Allowed only when `deleted` is set to `true` and the current plan's `usage_type` is `metered`. + #[serde(skip_serializing_if = "Option::is_none")] + pub clear_usage: Option, + /// A flag that, if set to `true`, will delete the specified item. + #[serde(skip_serializing_if = "Option::is_none")] + pub deleted: Option, + /// Subscription item to update. + #[serde(skip_serializing_if = "Option::is_none")] + pub id: Option<&'a str>, + /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. + /// This can be useful for storing additional information about the object in a structured format. + /// Individual keys can be unset by posting an empty value to them. + /// All keys can be unset by posting an empty value to `metadata`. + #[serde(skip_serializing_if = "Option::is_none")] + pub metadata: Option<&'a std::collections::HashMap>, + /// Plan ID for this item, as a string. + #[serde(skip_serializing_if = "Option::is_none")] + pub plan: Option<&'a str>, + /// The ID of the price object. + /// When changing a subscription item's price, `quantity` is set to 1 unless a `quantity` parameter is provided. + #[serde(skip_serializing_if = "Option::is_none")] + pub price: Option<&'a str>, + /// Data used to generate a new [Price](https://stripe.com/docs/api/prices) object inline. + #[serde(skip_serializing_if = "Option::is_none")] + pub price_data: Option>, + /// Quantity for this item. + #[serde(skip_serializing_if = "Option::is_none")] + pub quantity: Option, + /// A list of [Tax Rate](https://stripe.com/docs/api/tax_rates) ids. + /// These Tax Rates will override the [`default_tax_rates`](https://stripe.com/docs/api/subscriptions/create#create_subscription-default_tax_rates) on the Subscription. + /// When updating, pass an empty string to remove previously-defined tax rates. + #[serde(skip_serializing_if = "Option::is_none")] + pub tax_rates: Option<&'a [&'a str]>, +} +impl<'a> UpdateSubscriptionItems<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// Data used to generate a new [Price](https://stripe.com/docs/api/prices) object inline. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct UpdateSubscriptionItemsPriceData<'a> { + /// Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. + /// Must be a [supported currency](https://stripe.com/docs/currencies). + pub currency: stripe_types::Currency, + /// The ID of the product that this price will belong to. + pub product: &'a str, + /// The recurring components of a price such as `interval` and `interval_count`. + pub recurring: UpdateSubscriptionItemsPriceDataRecurring, + /// Only required if a [default tax behavior](https://stripe.com/docs/tax/products-prices-tax-categories-tax-behavior#setting-a-default-tax-behavior-(recommended)) was not provided in the Stripe Tax settings. + /// Specifies whether the price is considered inclusive of taxes or exclusive of taxes. + /// One of `inclusive`, `exclusive`, or `unspecified`. + /// Once specified as either `inclusive` or `exclusive`, it cannot be changed. + #[serde(skip_serializing_if = "Option::is_none")] + pub tax_behavior: Option, + /// A positive integer in cents (or local equivalent) (or 0 for a free price) representing how much to charge. + #[serde(skip_serializing_if = "Option::is_none")] + pub unit_amount: Option, + /// Same as `unit_amount`, but accepts a decimal value in cents (or local equivalent) with at most 12 decimal places. + /// Only one of `unit_amount` and `unit_amount_decimal` can be set. + #[serde(skip_serializing_if = "Option::is_none")] + pub unit_amount_decimal: Option<&'a str>, +} +impl<'a> UpdateSubscriptionItemsPriceData<'a> { + pub fn new( + currency: stripe_types::Currency, + product: &'a str, + recurring: UpdateSubscriptionItemsPriceDataRecurring, + ) -> Self { + Self { + currency, + product, + recurring, + tax_behavior: None, + unit_amount: None, + unit_amount_decimal: None, + } + } +} +/// The recurring components of a price such as `interval` and `interval_count`. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct UpdateSubscriptionItemsPriceDataRecurring { + /// Specifies billing frequency. Either `day`, `week`, `month` or `year`. + pub interval: UpdateSubscriptionItemsPriceDataRecurringInterval, + /// The number of intervals between subscription billings. + /// For example, `interval=month` and `interval_count=3` bills every 3 months. + /// Maximum of three years interval allowed (3 years, 36 months, or 156 weeks). + #[serde(skip_serializing_if = "Option::is_none")] + pub interval_count: Option, +} +impl UpdateSubscriptionItemsPriceDataRecurring { + pub fn new(interval: UpdateSubscriptionItemsPriceDataRecurringInterval) -> Self { + Self { interval, interval_count: None } + } +} +/// Specifies billing frequency. Either `day`, `week`, `month` or `year`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum UpdateSubscriptionItemsPriceDataRecurringInterval { + Day, + Month, + Week, + Year, +} +impl UpdateSubscriptionItemsPriceDataRecurringInterval { + pub fn as_str(self) -> &'static str { + use UpdateSubscriptionItemsPriceDataRecurringInterval::*; + match self { + Day => "day", + Month => "month", + Week => "week", + Year => "year", + } + } +} + +impl std::str::FromStr for UpdateSubscriptionItemsPriceDataRecurringInterval { + type Err = (); + fn from_str(s: &str) -> Result { + use UpdateSubscriptionItemsPriceDataRecurringInterval::*; + match s { + "day" => Ok(Day), + "month" => Ok(Month), + "week" => Ok(Week), + "year" => Ok(Year), + _ => Err(()), + } + } +} +impl std::fmt::Display for UpdateSubscriptionItemsPriceDataRecurringInterval { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for UpdateSubscriptionItemsPriceDataRecurringInterval { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for UpdateSubscriptionItemsPriceDataRecurringInterval { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Only required if a [default tax behavior](https://stripe.com/docs/tax/products-prices-tax-categories-tax-behavior#setting-a-default-tax-behavior-(recommended)) was not provided in the Stripe Tax settings. +/// Specifies whether the price is considered inclusive of taxes or exclusive of taxes. +/// One of `inclusive`, `exclusive`, or `unspecified`. +/// Once specified as either `inclusive` or `exclusive`, it cannot be changed. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum UpdateSubscriptionItemsPriceDataTaxBehavior { + Exclusive, + Inclusive, + Unspecified, +} +impl UpdateSubscriptionItemsPriceDataTaxBehavior { + pub fn as_str(self) -> &'static str { + use UpdateSubscriptionItemsPriceDataTaxBehavior::*; + match self { + Exclusive => "exclusive", + Inclusive => "inclusive", + Unspecified => "unspecified", + } + } +} + +impl std::str::FromStr for UpdateSubscriptionItemsPriceDataTaxBehavior { + type Err = (); + fn from_str(s: &str) -> Result { + use UpdateSubscriptionItemsPriceDataTaxBehavior::*; + match s { + "exclusive" => Ok(Exclusive), + "inclusive" => Ok(Inclusive), + "unspecified" => Ok(Unspecified), + _ => Err(()), + } + } +} +impl std::fmt::Display for UpdateSubscriptionItemsPriceDataTaxBehavior { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for UpdateSubscriptionItemsPriceDataTaxBehavior { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for UpdateSubscriptionItemsPriceDataTaxBehavior { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// If specified, payment collection for this subscription will be paused. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct UpdateSubscriptionPauseCollection { + /// The payment collection behavior for this subscription while paused. + /// One of `keep_as_draft`, `mark_uncollectible`, or `void`. + pub behavior: UpdateSubscriptionPauseCollectionBehavior, + /// The time after which the subscription will resume collecting payments. + #[serde(skip_serializing_if = "Option::is_none")] + pub resumes_at: Option, +} +impl UpdateSubscriptionPauseCollection { + pub fn new(behavior: UpdateSubscriptionPauseCollectionBehavior) -> Self { + Self { behavior, resumes_at: None } + } +} +/// The payment collection behavior for this subscription while paused. +/// One of `keep_as_draft`, `mark_uncollectible`, or `void`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum UpdateSubscriptionPauseCollectionBehavior { + KeepAsDraft, + MarkUncollectible, + Void, +} +impl UpdateSubscriptionPauseCollectionBehavior { + pub fn as_str(self) -> &'static str { + use UpdateSubscriptionPauseCollectionBehavior::*; + match self { + KeepAsDraft => "keep_as_draft", + MarkUncollectible => "mark_uncollectible", + Void => "void", + } + } +} + +impl std::str::FromStr for UpdateSubscriptionPauseCollectionBehavior { + type Err = (); + fn from_str(s: &str) -> Result { + use UpdateSubscriptionPauseCollectionBehavior::*; + match s { + "keep_as_draft" => Ok(KeepAsDraft), + "mark_uncollectible" => Ok(MarkUncollectible), + "void" => Ok(Void), + _ => Err(()), + } + } +} +impl std::fmt::Display for UpdateSubscriptionPauseCollectionBehavior { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for UpdateSubscriptionPauseCollectionBehavior { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for UpdateSubscriptionPauseCollectionBehavior { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Use `allow_incomplete` to transition the subscription to `status=past_due` if a payment is required but cannot be paid. +/// This allows you to manage scenarios where additional user actions are needed to pay a subscription's invoice. +/// For example, SCA regulation may require 3DS authentication to complete payment. +/// See the [SCA Migration Guide](https://stripe.com/docs/billing/migration/strong-customer-authentication) for Billing to learn more. +/// This is the default behavior. +/// +/// Use `default_incomplete` to transition the subscription to `status=past_due` when payment is required and await explicit confirmation of the invoice's payment intent. +/// This allows simpler management of scenarios where additional user actions are needed to pay a subscription’s invoice. +/// Such as failed payments, [SCA regulation](https://stripe.com/docs/billing/migration/strong-customer-authentication), or collecting a mandate for a bank debit payment method. +/// +/// Use `pending_if_incomplete` to update the subscription using [pending updates](https://stripe.com/docs/billing/subscriptions/pending-updates). +/// When you use `pending_if_incomplete` you can only pass the parameters [supported by pending updates](https://stripe.com/docs/billing/pending-updates-reference#supported-attributes). +/// +/// Use `error_if_incomplete` if you want Stripe to return an HTTP 402 status code if a subscription's invoice cannot be paid. +/// For example, if a payment method requires 3DS authentication due to SCA regulation and further user action is needed, this parameter does not update the subscription and returns an error instead. +/// This was the default behavior for API versions prior to 2019-03-14. +/// See the [changelog](https://stripe.com/docs/upgrades#2019-03-14) to learn more. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum UpdateSubscriptionPaymentBehavior { + AllowIncomplete, + DefaultIncomplete, + ErrorIfIncomplete, + PendingIfIncomplete, +} +impl UpdateSubscriptionPaymentBehavior { + pub fn as_str(self) -> &'static str { + use UpdateSubscriptionPaymentBehavior::*; + match self { + AllowIncomplete => "allow_incomplete", + DefaultIncomplete => "default_incomplete", + ErrorIfIncomplete => "error_if_incomplete", + PendingIfIncomplete => "pending_if_incomplete", + } + } +} + +impl std::str::FromStr for UpdateSubscriptionPaymentBehavior { + type Err = (); + fn from_str(s: &str) -> Result { + use UpdateSubscriptionPaymentBehavior::*; + match s { + "allow_incomplete" => Ok(AllowIncomplete), + "default_incomplete" => Ok(DefaultIncomplete), + "error_if_incomplete" => Ok(ErrorIfIncomplete), + "pending_if_incomplete" => Ok(PendingIfIncomplete), + _ => Err(()), + } + } +} +impl std::fmt::Display for UpdateSubscriptionPaymentBehavior { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for UpdateSubscriptionPaymentBehavior { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for UpdateSubscriptionPaymentBehavior { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Payment settings to pass to invoices created by the subscription. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdateSubscriptionPaymentSettings<'a> { + /// Payment-method-specific configuration to provide to invoices created by the subscription. + #[serde(skip_serializing_if = "Option::is_none")] + pub payment_method_options: Option>, + /// The list of payment method types (e.g. + /// card) to provide to the invoice’s PaymentIntent. + /// If not set, Stripe attempts to automatically determine the types to use by looking at the invoice’s default payment method, the subscription’s default payment method, the customer’s default payment method, and your [invoice template settings](https://dashboard.stripe.com/settings/billing/invoice). + #[serde(skip_serializing_if = "Option::is_none")] + pub payment_method_types: Option<&'a [UpdateSubscriptionPaymentSettingsPaymentMethodTypes]>, + /// Either `off`, or `on_subscription`. + /// With `on_subscription` Stripe updates `subscription.default_payment_method` when a subscription payment succeeds. + #[serde(skip_serializing_if = "Option::is_none")] + pub save_default_payment_method: + Option, +} +impl<'a> UpdateSubscriptionPaymentSettings<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// Payment-method-specific configuration to provide to invoices created by the subscription. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdateSubscriptionPaymentSettingsPaymentMethodOptions<'a> { + /// This sub-hash contains details about the Canadian pre-authorized debit payment method options to pass to the invoice’s PaymentIntent. + #[serde(skip_serializing_if = "Option::is_none")] + pub acss_debit: Option, + /// This sub-hash contains details about the Bancontact payment method options to pass to the invoice’s PaymentIntent. + #[serde(skip_serializing_if = "Option::is_none")] + pub bancontact: Option, + /// This sub-hash contains details about the Card payment method options to pass to the invoice’s PaymentIntent. + #[serde(skip_serializing_if = "Option::is_none")] + pub card: Option>, + /// This sub-hash contains details about the Bank transfer payment method options to pass to the invoice’s PaymentIntent. + #[serde(skip_serializing_if = "Option::is_none")] + pub customer_balance: Option>, + /// This sub-hash contains details about the Konbini payment method options to pass to the invoice’s PaymentIntent. + #[serde(skip_serializing_if = "Option::is_none")] + pub konbini: Option<&'a serde_json::Value>, + /// This sub-hash contains details about the ACH direct debit payment method options to pass to the invoice’s PaymentIntent. + #[serde(skip_serializing_if = "Option::is_none")] + pub us_bank_account: + Option>, +} +impl<'a> UpdateSubscriptionPaymentSettingsPaymentMethodOptions<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// This sub-hash contains details about the Canadian pre-authorized debit payment method options to pass to the invoice’s PaymentIntent. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdateSubscriptionPaymentSettingsPaymentMethodOptionsAcssDebit { + /// Additional fields for Mandate creation + #[serde(skip_serializing_if = "Option::is_none")] + pub mandate_options: + Option, + /// Verification method for the intent + #[serde(skip_serializing_if = "Option::is_none")] + pub verification_method: + Option, +} +impl UpdateSubscriptionPaymentSettingsPaymentMethodOptionsAcssDebit { + pub fn new() -> Self { + Self::default() + } +} +/// Additional fields for Mandate creation +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdateSubscriptionPaymentSettingsPaymentMethodOptionsAcssDebitMandateOptions { + /// Transaction type of the mandate. + #[serde(skip_serializing_if = "Option::is_none")] + pub transaction_type: Option< + UpdateSubscriptionPaymentSettingsPaymentMethodOptionsAcssDebitMandateOptionsTransactionType, + >, +} +impl UpdateSubscriptionPaymentSettingsPaymentMethodOptionsAcssDebitMandateOptions { + pub fn new() -> Self { + Self::default() + } +} +/// Transaction type of the mandate. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum UpdateSubscriptionPaymentSettingsPaymentMethodOptionsAcssDebitMandateOptionsTransactionType +{ + Business, + Personal, +} +impl UpdateSubscriptionPaymentSettingsPaymentMethodOptionsAcssDebitMandateOptionsTransactionType { + pub fn as_str(self) -> &'static str { + use UpdateSubscriptionPaymentSettingsPaymentMethodOptionsAcssDebitMandateOptionsTransactionType::*; + match self { + Business => "business", + Personal => "personal", + } + } +} + +impl std::str::FromStr + for UpdateSubscriptionPaymentSettingsPaymentMethodOptionsAcssDebitMandateOptionsTransactionType +{ + type Err = (); + fn from_str(s: &str) -> Result { + use UpdateSubscriptionPaymentSettingsPaymentMethodOptionsAcssDebitMandateOptionsTransactionType::*; + match s { + "business" => Ok(Business), + "personal" => Ok(Personal), + _ => Err(()), + } + } +} +impl std::fmt::Display + for UpdateSubscriptionPaymentSettingsPaymentMethodOptionsAcssDebitMandateOptionsTransactionType +{ + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug + for UpdateSubscriptionPaymentSettingsPaymentMethodOptionsAcssDebitMandateOptionsTransactionType +{ + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize + for UpdateSubscriptionPaymentSettingsPaymentMethodOptionsAcssDebitMandateOptionsTransactionType +{ + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Verification method for the intent +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum UpdateSubscriptionPaymentSettingsPaymentMethodOptionsAcssDebitVerificationMethod { + Automatic, + Instant, + Microdeposits, +} +impl UpdateSubscriptionPaymentSettingsPaymentMethodOptionsAcssDebitVerificationMethod { + pub fn as_str(self) -> &'static str { + use UpdateSubscriptionPaymentSettingsPaymentMethodOptionsAcssDebitVerificationMethod::*; + match self { + Automatic => "automatic", + Instant => "instant", + Microdeposits => "microdeposits", + } + } +} + +impl std::str::FromStr + for UpdateSubscriptionPaymentSettingsPaymentMethodOptionsAcssDebitVerificationMethod +{ + type Err = (); + fn from_str(s: &str) -> Result { + use UpdateSubscriptionPaymentSettingsPaymentMethodOptionsAcssDebitVerificationMethod::*; + match s { + "automatic" => Ok(Automatic), + "instant" => Ok(Instant), + "microdeposits" => Ok(Microdeposits), + _ => Err(()), + } + } +} +impl std::fmt::Display + for UpdateSubscriptionPaymentSettingsPaymentMethodOptionsAcssDebitVerificationMethod +{ + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug + for UpdateSubscriptionPaymentSettingsPaymentMethodOptionsAcssDebitVerificationMethod +{ + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize + for UpdateSubscriptionPaymentSettingsPaymentMethodOptionsAcssDebitVerificationMethod +{ + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// This sub-hash contains details about the Bancontact payment method options to pass to the invoice’s PaymentIntent. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdateSubscriptionPaymentSettingsPaymentMethodOptionsBancontact { + /// Preferred language of the Bancontact authorization page that the customer is redirected to. + #[serde(skip_serializing_if = "Option::is_none")] + pub preferred_language: + Option, +} +impl UpdateSubscriptionPaymentSettingsPaymentMethodOptionsBancontact { + pub fn new() -> Self { + Self::default() + } +} +/// Preferred language of the Bancontact authorization page that the customer is redirected to. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum UpdateSubscriptionPaymentSettingsPaymentMethodOptionsBancontactPreferredLanguage { + De, + En, + Fr, + Nl, +} +impl UpdateSubscriptionPaymentSettingsPaymentMethodOptionsBancontactPreferredLanguage { + pub fn as_str(self) -> &'static str { + use UpdateSubscriptionPaymentSettingsPaymentMethodOptionsBancontactPreferredLanguage::*; + match self { + De => "de", + En => "en", + Fr => "fr", + Nl => "nl", + } + } +} + +impl std::str::FromStr + for UpdateSubscriptionPaymentSettingsPaymentMethodOptionsBancontactPreferredLanguage +{ + type Err = (); + fn from_str(s: &str) -> Result { + use UpdateSubscriptionPaymentSettingsPaymentMethodOptionsBancontactPreferredLanguage::*; + match s { + "de" => Ok(De), + "en" => Ok(En), + "fr" => Ok(Fr), + "nl" => Ok(Nl), + _ => Err(()), + } + } +} +impl std::fmt::Display + for UpdateSubscriptionPaymentSettingsPaymentMethodOptionsBancontactPreferredLanguage +{ + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug + for UpdateSubscriptionPaymentSettingsPaymentMethodOptionsBancontactPreferredLanguage +{ + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize + for UpdateSubscriptionPaymentSettingsPaymentMethodOptionsBancontactPreferredLanguage +{ + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// This sub-hash contains details about the Card payment method options to pass to the invoice’s PaymentIntent. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdateSubscriptionPaymentSettingsPaymentMethodOptionsCard<'a> { + /// Configuration options for setting up an eMandate for cards issued in India. + #[serde(skip_serializing_if = "Option::is_none")] + pub mandate_options: + Option>, + /// Selected network to process this Subscription on. + /// Depends on the available networks of the card attached to the Subscription. + /// Can be only set confirm-time. + #[serde(skip_serializing_if = "Option::is_none")] + pub network: Option, + /// We strongly recommend that you rely on our SCA Engine to automatically prompt your customers for authentication based on risk level and [other requirements](https://stripe.com/docs/strong-customer-authentication). + /// However, if you wish to request 3D Secure based on logic from your own fraud engine, provide this option. + /// Read our guide on [manually requesting 3D Secure](https://stripe.com/docs/payments/3d-secure#manual-three-ds) for more information on how this configuration interacts with Radar and our SCA Engine. + #[serde(skip_serializing_if = "Option::is_none")] + pub request_three_d_secure: + Option, +} +impl<'a> UpdateSubscriptionPaymentSettingsPaymentMethodOptionsCard<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// Configuration options for setting up an eMandate for cards issued in India. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdateSubscriptionPaymentSettingsPaymentMethodOptionsCardMandateOptions<'a> { + /// Amount to be charged for future payments. + #[serde(skip_serializing_if = "Option::is_none")] + pub amount: Option, + /// One of `fixed` or `maximum`. + /// If `fixed`, the `amount` param refers to the exact amount to be charged in future payments. + /// If `maximum`, the amount charged can be up to the value passed for the `amount` param. + #[serde(skip_serializing_if = "Option::is_none")] + pub amount_type: + Option, + /// A description of the mandate or subscription that is meant to be displayed to the customer. + #[serde(skip_serializing_if = "Option::is_none")] + pub description: Option<&'a str>, +} +impl<'a> UpdateSubscriptionPaymentSettingsPaymentMethodOptionsCardMandateOptions<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// One of `fixed` or `maximum`. +/// If `fixed`, the `amount` param refers to the exact amount to be charged in future payments. +/// If `maximum`, the amount charged can be up to the value passed for the `amount` param. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum UpdateSubscriptionPaymentSettingsPaymentMethodOptionsCardMandateOptionsAmountType { + Fixed, + Maximum, +} +impl UpdateSubscriptionPaymentSettingsPaymentMethodOptionsCardMandateOptionsAmountType { + pub fn as_str(self) -> &'static str { + use UpdateSubscriptionPaymentSettingsPaymentMethodOptionsCardMandateOptionsAmountType::*; + match self { + Fixed => "fixed", + Maximum => "maximum", + } + } +} + +impl std::str::FromStr + for UpdateSubscriptionPaymentSettingsPaymentMethodOptionsCardMandateOptionsAmountType +{ + type Err = (); + fn from_str(s: &str) -> Result { + use UpdateSubscriptionPaymentSettingsPaymentMethodOptionsCardMandateOptionsAmountType::*; + match s { + "fixed" => Ok(Fixed), + "maximum" => Ok(Maximum), + _ => Err(()), + } + } +} +impl std::fmt::Display + for UpdateSubscriptionPaymentSettingsPaymentMethodOptionsCardMandateOptionsAmountType +{ + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug + for UpdateSubscriptionPaymentSettingsPaymentMethodOptionsCardMandateOptionsAmountType +{ + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize + for UpdateSubscriptionPaymentSettingsPaymentMethodOptionsCardMandateOptionsAmountType +{ + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Selected network to process this Subscription on. +/// Depends on the available networks of the card attached to the Subscription. +/// Can be only set confirm-time. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum UpdateSubscriptionPaymentSettingsPaymentMethodOptionsCardNetwork { + Amex, + CartesBancaires, + Diners, + Discover, + EftposAu, + Interac, + Jcb, + Mastercard, + Unionpay, + Unknown, + Visa, +} +impl UpdateSubscriptionPaymentSettingsPaymentMethodOptionsCardNetwork { + pub fn as_str(self) -> &'static str { + use UpdateSubscriptionPaymentSettingsPaymentMethodOptionsCardNetwork::*; + match self { + Amex => "amex", + CartesBancaires => "cartes_bancaires", + Diners => "diners", + Discover => "discover", + EftposAu => "eftpos_au", + Interac => "interac", + Jcb => "jcb", + Mastercard => "mastercard", + Unionpay => "unionpay", + Unknown => "unknown", + Visa => "visa", + } + } +} + +impl std::str::FromStr for UpdateSubscriptionPaymentSettingsPaymentMethodOptionsCardNetwork { + type Err = (); + fn from_str(s: &str) -> Result { + use UpdateSubscriptionPaymentSettingsPaymentMethodOptionsCardNetwork::*; + match s { + "amex" => Ok(Amex), + "cartes_bancaires" => Ok(CartesBancaires), + "diners" => Ok(Diners), + "discover" => Ok(Discover), + "eftpos_au" => Ok(EftposAu), + "interac" => Ok(Interac), + "jcb" => Ok(Jcb), + "mastercard" => Ok(Mastercard), + "unionpay" => Ok(Unionpay), + "unknown" => Ok(Unknown), + "visa" => Ok(Visa), + _ => Err(()), + } + } +} +impl std::fmt::Display for UpdateSubscriptionPaymentSettingsPaymentMethodOptionsCardNetwork { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for UpdateSubscriptionPaymentSettingsPaymentMethodOptionsCardNetwork { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for UpdateSubscriptionPaymentSettingsPaymentMethodOptionsCardNetwork { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// We strongly recommend that you rely on our SCA Engine to automatically prompt your customers for authentication based on risk level and [other requirements](https://stripe.com/docs/strong-customer-authentication). +/// However, if you wish to request 3D Secure based on logic from your own fraud engine, provide this option. +/// Read our guide on [manually requesting 3D Secure](https://stripe.com/docs/payments/3d-secure#manual-three-ds) for more information on how this configuration interacts with Radar and our SCA Engine. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum UpdateSubscriptionPaymentSettingsPaymentMethodOptionsCardRequestThreeDSecure { + Any, + Automatic, + Challenge, +} +impl UpdateSubscriptionPaymentSettingsPaymentMethodOptionsCardRequestThreeDSecure { + pub fn as_str(self) -> &'static str { + use UpdateSubscriptionPaymentSettingsPaymentMethodOptionsCardRequestThreeDSecure::*; + match self { + Any => "any", + Automatic => "automatic", + Challenge => "challenge", + } + } +} + +impl std::str::FromStr + for UpdateSubscriptionPaymentSettingsPaymentMethodOptionsCardRequestThreeDSecure +{ + type Err = (); + fn from_str(s: &str) -> Result { + use UpdateSubscriptionPaymentSettingsPaymentMethodOptionsCardRequestThreeDSecure::*; + match s { + "any" => Ok(Any), + "automatic" => Ok(Automatic), + "challenge" => Ok(Challenge), + _ => Err(()), + } + } +} +impl std::fmt::Display + for UpdateSubscriptionPaymentSettingsPaymentMethodOptionsCardRequestThreeDSecure +{ + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug + for UpdateSubscriptionPaymentSettingsPaymentMethodOptionsCardRequestThreeDSecure +{ + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize + for UpdateSubscriptionPaymentSettingsPaymentMethodOptionsCardRequestThreeDSecure +{ + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// This sub-hash contains details about the ACH direct debit payment method options to pass to the invoice’s PaymentIntent. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdateSubscriptionPaymentSettingsPaymentMethodOptionsUsBankAccount<'a> { + /// Additional fields for Financial Connections Session creation + #[serde(skip_serializing_if = "Option::is_none")] + pub financial_connections: Option< + UpdateSubscriptionPaymentSettingsPaymentMethodOptionsUsBankAccountFinancialConnections<'a>, + >, + /// Verification method for the intent + #[serde(skip_serializing_if = "Option::is_none")] + pub verification_method: Option< + UpdateSubscriptionPaymentSettingsPaymentMethodOptionsUsBankAccountVerificationMethod, + >, +} +impl<'a> UpdateSubscriptionPaymentSettingsPaymentMethodOptionsUsBankAccount<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// Additional fields for Financial Connections Session creation +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdateSubscriptionPaymentSettingsPaymentMethodOptionsUsBankAccountFinancialConnections<'a> { + /// The list of permissions to request. + /// If this parameter is passed, the `payment_method` permission must be included. + /// Valid permissions include: `balances`, `ownership`, `payment_method`, and `transactions`. +#[serde(skip_serializing_if = "Option::is_none")] +pub permissions: Option<&'a [UpdateSubscriptionPaymentSettingsPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions]>, + /// List of data features that you would like to retrieve upon account creation. +#[serde(skip_serializing_if = "Option::is_none")] +pub prefetch: Option<&'a [UpdateSubscriptionPaymentSettingsPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch]>, + +} +impl<'a> + UpdateSubscriptionPaymentSettingsPaymentMethodOptionsUsBankAccountFinancialConnections<'a> +{ + pub fn new() -> Self { + Self::default() + } +} +/// The list of permissions to request. +/// If this parameter is passed, the `payment_method` permission must be included. +/// Valid permissions include: `balances`, `ownership`, `payment_method`, and `transactions`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum UpdateSubscriptionPaymentSettingsPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions +{ + Balances, + Ownership, + PaymentMethod, + Transactions, +} +impl UpdateSubscriptionPaymentSettingsPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions { + pub fn as_str(self) -> &'static str { + use UpdateSubscriptionPaymentSettingsPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions::*; + match self { +Balances => "balances", +Ownership => "ownership", +PaymentMethod => "payment_method", +Transactions => "transactions", + + } + } +} + +impl std::str::FromStr for UpdateSubscriptionPaymentSettingsPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions { + type Err = (); + fn from_str(s: &str) -> Result { + use UpdateSubscriptionPaymentSettingsPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions::*; + match s { + "balances" => Ok(Balances), +"ownership" => Ok(Ownership), +"payment_method" => Ok(PaymentMethod), +"transactions" => Ok(Transactions), +_ => Err(()) + + } + } +} +impl std::fmt::Display for UpdateSubscriptionPaymentSettingsPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for UpdateSubscriptionPaymentSettingsPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for UpdateSubscriptionPaymentSettingsPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions { + fn serialize(&self, serializer: S) -> Result where S: serde::Serializer { + serializer.serialize_str(self.as_str()) + } +} +/// List of data features that you would like to retrieve upon account creation. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum UpdateSubscriptionPaymentSettingsPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch +{ + Balances, + Transactions, +} +impl + UpdateSubscriptionPaymentSettingsPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch +{ + pub fn as_str(self) -> &'static str { + use UpdateSubscriptionPaymentSettingsPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch::*; + match self { + Balances => "balances", + Transactions => "transactions", + } + } +} + +impl std::str::FromStr for UpdateSubscriptionPaymentSettingsPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch { + type Err = (); + fn from_str(s: &str) -> Result { + use UpdateSubscriptionPaymentSettingsPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch::*; + match s { + "balances" => Ok(Balances), +"transactions" => Ok(Transactions), +_ => Err(()) + + } + } +} +impl std::fmt::Display for UpdateSubscriptionPaymentSettingsPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for UpdateSubscriptionPaymentSettingsPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for UpdateSubscriptionPaymentSettingsPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch { + fn serialize(&self, serializer: S) -> Result where S: serde::Serializer { + serializer.serialize_str(self.as_str()) + } +} +/// Verification method for the intent +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum UpdateSubscriptionPaymentSettingsPaymentMethodOptionsUsBankAccountVerificationMethod { + Automatic, + Instant, + Microdeposits, +} +impl UpdateSubscriptionPaymentSettingsPaymentMethodOptionsUsBankAccountVerificationMethod { + pub fn as_str(self) -> &'static str { + use UpdateSubscriptionPaymentSettingsPaymentMethodOptionsUsBankAccountVerificationMethod::*; + match self { + Automatic => "automatic", + Instant => "instant", + Microdeposits => "microdeposits", + } + } +} + +impl std::str::FromStr + for UpdateSubscriptionPaymentSettingsPaymentMethodOptionsUsBankAccountVerificationMethod +{ + type Err = (); + fn from_str(s: &str) -> Result { + use UpdateSubscriptionPaymentSettingsPaymentMethodOptionsUsBankAccountVerificationMethod::*; + match s { + "automatic" => Ok(Automatic), + "instant" => Ok(Instant), + "microdeposits" => Ok(Microdeposits), + _ => Err(()), + } + } +} +impl std::fmt::Display + for UpdateSubscriptionPaymentSettingsPaymentMethodOptionsUsBankAccountVerificationMethod +{ + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug + for UpdateSubscriptionPaymentSettingsPaymentMethodOptionsUsBankAccountVerificationMethod +{ + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize + for UpdateSubscriptionPaymentSettingsPaymentMethodOptionsUsBankAccountVerificationMethod +{ + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// The list of payment method types (e.g. +/// card) to provide to the invoice’s PaymentIntent. +/// If not set, Stripe attempts to automatically determine the types to use by looking at the invoice’s default payment method, the subscription’s default payment method, the customer’s default payment method, and your [invoice template settings](https://dashboard.stripe.com/settings/billing/invoice). +#[derive(Copy, Clone, Eq, PartialEq)] +#[non_exhaustive] +pub enum UpdateSubscriptionPaymentSettingsPaymentMethodTypes { + AchCreditTransfer, + AchDebit, + AcssDebit, + AuBecsDebit, + BacsDebit, + Bancontact, + Boleto, + Card, + Cashapp, + CustomerBalance, + Eps, + Fpx, + Giropay, + Grabpay, + Ideal, + Konbini, + Link, + P24, + Paynow, + Paypal, + Promptpay, + SepaCreditTransfer, + SepaDebit, + Sofort, + UsBankAccount, + WechatPay, + /// An unrecognized value from Stripe. Should not be used as a request parameter. + Unknown, +} +impl UpdateSubscriptionPaymentSettingsPaymentMethodTypes { + pub fn as_str(self) -> &'static str { + use UpdateSubscriptionPaymentSettingsPaymentMethodTypes::*; + match self { + AchCreditTransfer => "ach_credit_transfer", + AchDebit => "ach_debit", + AcssDebit => "acss_debit", + AuBecsDebit => "au_becs_debit", + BacsDebit => "bacs_debit", + Bancontact => "bancontact", + Boleto => "boleto", + Card => "card", + Cashapp => "cashapp", + CustomerBalance => "customer_balance", + Eps => "eps", + Fpx => "fpx", + Giropay => "giropay", + Grabpay => "grabpay", + Ideal => "ideal", + Konbini => "konbini", + Link => "link", + P24 => "p24", + Paynow => "paynow", + Paypal => "paypal", + Promptpay => "promptpay", + SepaCreditTransfer => "sepa_credit_transfer", + SepaDebit => "sepa_debit", + Sofort => "sofort", + UsBankAccount => "us_bank_account", + WechatPay => "wechat_pay", + Unknown => "unknown", + } + } +} + +impl std::str::FromStr for UpdateSubscriptionPaymentSettingsPaymentMethodTypes { + type Err = (); + fn from_str(s: &str) -> Result { + use UpdateSubscriptionPaymentSettingsPaymentMethodTypes::*; + match s { + "ach_credit_transfer" => Ok(AchCreditTransfer), + "ach_debit" => Ok(AchDebit), + "acss_debit" => Ok(AcssDebit), + "au_becs_debit" => Ok(AuBecsDebit), + "bacs_debit" => Ok(BacsDebit), + "bancontact" => Ok(Bancontact), + "boleto" => Ok(Boleto), + "card" => Ok(Card), + "cashapp" => Ok(Cashapp), + "customer_balance" => Ok(CustomerBalance), + "eps" => Ok(Eps), + "fpx" => Ok(Fpx), + "giropay" => Ok(Giropay), + "grabpay" => Ok(Grabpay), + "ideal" => Ok(Ideal), + "konbini" => Ok(Konbini), + "link" => Ok(Link), + "p24" => Ok(P24), + "paynow" => Ok(Paynow), + "paypal" => Ok(Paypal), + "promptpay" => Ok(Promptpay), + "sepa_credit_transfer" => Ok(SepaCreditTransfer), + "sepa_debit" => Ok(SepaDebit), + "sofort" => Ok(Sofort), + "us_bank_account" => Ok(UsBankAccount), + "wechat_pay" => Ok(WechatPay), + _ => Err(()), + } + } +} +impl std::fmt::Display for UpdateSubscriptionPaymentSettingsPaymentMethodTypes { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for UpdateSubscriptionPaymentSettingsPaymentMethodTypes { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for UpdateSubscriptionPaymentSettingsPaymentMethodTypes { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Either `off`, or `on_subscription`. +/// With `on_subscription` Stripe updates `subscription.default_payment_method` when a subscription payment succeeds. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum UpdateSubscriptionPaymentSettingsSaveDefaultPaymentMethod { + Off, + OnSubscription, +} +impl UpdateSubscriptionPaymentSettingsSaveDefaultPaymentMethod { + pub fn as_str(self) -> &'static str { + use UpdateSubscriptionPaymentSettingsSaveDefaultPaymentMethod::*; + match self { + Off => "off", + OnSubscription => "on_subscription", + } + } +} + +impl std::str::FromStr for UpdateSubscriptionPaymentSettingsSaveDefaultPaymentMethod { + type Err = (); + fn from_str(s: &str) -> Result { + use UpdateSubscriptionPaymentSettingsSaveDefaultPaymentMethod::*; + match s { + "off" => Ok(Off), + "on_subscription" => Ok(OnSubscription), + _ => Err(()), + } + } +} +impl std::fmt::Display for UpdateSubscriptionPaymentSettingsSaveDefaultPaymentMethod { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for UpdateSubscriptionPaymentSettingsSaveDefaultPaymentMethod { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for UpdateSubscriptionPaymentSettingsSaveDefaultPaymentMethod { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Specifies an interval for how often to bill for any pending invoice items. +/// It is analogous to calling [Create an invoice](https://stripe.com/docs/api#create_invoice) for the given subscription at the specified interval. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct UpdateSubscriptionPendingInvoiceItemInterval { + /// Specifies invoicing frequency. Either `day`, `week`, `month` or `year`. + pub interval: UpdateSubscriptionPendingInvoiceItemIntervalInterval, + /// The number of intervals between invoices. + /// For example, `interval=month` and `interval_count=3` bills every 3 months. + /// Maximum of one year interval allowed (1 year, 12 months, or 52 weeks). + #[serde(skip_serializing_if = "Option::is_none")] + pub interval_count: Option, +} +impl UpdateSubscriptionPendingInvoiceItemInterval { + pub fn new(interval: UpdateSubscriptionPendingInvoiceItemIntervalInterval) -> Self { + Self { interval, interval_count: None } + } +} +/// Specifies invoicing frequency. Either `day`, `week`, `month` or `year`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum UpdateSubscriptionPendingInvoiceItemIntervalInterval { + Day, + Month, + Week, + Year, +} +impl UpdateSubscriptionPendingInvoiceItemIntervalInterval { + pub fn as_str(self) -> &'static str { + use UpdateSubscriptionPendingInvoiceItemIntervalInterval::*; + match self { + Day => "day", + Month => "month", + Week => "week", + Year => "year", + } + } +} + +impl std::str::FromStr for UpdateSubscriptionPendingInvoiceItemIntervalInterval { + type Err = (); + fn from_str(s: &str) -> Result { + use UpdateSubscriptionPendingInvoiceItemIntervalInterval::*; + match s { + "day" => Ok(Day), + "month" => Ok(Month), + "week" => Ok(Week), + "year" => Ok(Year), + _ => Err(()), + } + } +} +impl std::fmt::Display for UpdateSubscriptionPendingInvoiceItemIntervalInterval { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for UpdateSubscriptionPendingInvoiceItemIntervalInterval { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for UpdateSubscriptionPendingInvoiceItemIntervalInterval { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Determines how to handle [prorations](https://stripe.com/docs/subscriptions/billing-cycle#prorations) when the billing cycle changes (e.g., when switching plans, resetting `billing_cycle_anchor=now`, or starting a trial), or if an item's `quantity` changes. +/// The default value is `create_prorations`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum UpdateSubscriptionProrationBehavior { + AlwaysInvoice, + CreateProrations, + None, +} +impl UpdateSubscriptionProrationBehavior { + pub fn as_str(self) -> &'static str { + use UpdateSubscriptionProrationBehavior::*; + match self { + AlwaysInvoice => "always_invoice", + CreateProrations => "create_prorations", + None => "none", + } + } +} + +impl std::str::FromStr for UpdateSubscriptionProrationBehavior { + type Err = (); + fn from_str(s: &str) -> Result { + use UpdateSubscriptionProrationBehavior::*; + match s { + "always_invoice" => Ok(AlwaysInvoice), + "create_prorations" => Ok(CreateProrations), + "none" => Ok(None), + _ => Err(()), + } + } +} +impl std::fmt::Display for UpdateSubscriptionProrationBehavior { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for UpdateSubscriptionProrationBehavior { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for UpdateSubscriptionProrationBehavior { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Unix timestamp representing the end of the trial period the customer will get before being charged for the first time. +/// This will always overwrite any trials that might apply via a subscribed plan. +/// If set, trial_end will override the default trial period of the plan the customer is being subscribed to. +/// The special value `now` can be provided to end the customer's trial immediately. +/// Can be at most two years from `billing_cycle_anchor`. +#[derive(Copy, Clone, Debug, serde::Serialize)] +#[serde(untagged)] +pub enum UpdateSubscriptionTrialEnd { + Now, + Timestamp(stripe_types::Timestamp), +} +/// Settings related to subscription trials. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct UpdateSubscriptionTrialSettings { + /// Defines how the subscription should behave when the user's free trial ends. + pub end_behavior: UpdateSubscriptionTrialSettingsEndBehavior, +} +impl UpdateSubscriptionTrialSettings { + pub fn new(end_behavior: UpdateSubscriptionTrialSettingsEndBehavior) -> Self { + Self { end_behavior } + } +} +/// Defines how the subscription should behave when the user's free trial ends. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct UpdateSubscriptionTrialSettingsEndBehavior { + /// Indicates how the subscription should change when the trial ends if the user did not provide a payment method. + pub missing_payment_method: UpdateSubscriptionTrialSettingsEndBehaviorMissingPaymentMethod, +} +impl UpdateSubscriptionTrialSettingsEndBehavior { + pub fn new( + missing_payment_method: UpdateSubscriptionTrialSettingsEndBehaviorMissingPaymentMethod, + ) -> Self { + Self { missing_payment_method } + } +} +/// Indicates how the subscription should change when the trial ends if the user did not provide a payment method. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum UpdateSubscriptionTrialSettingsEndBehaviorMissingPaymentMethod { + Cancel, + CreateInvoice, + Pause, +} +impl UpdateSubscriptionTrialSettingsEndBehaviorMissingPaymentMethod { + pub fn as_str(self) -> &'static str { + use UpdateSubscriptionTrialSettingsEndBehaviorMissingPaymentMethod::*; + match self { + Cancel => "cancel", + CreateInvoice => "create_invoice", + Pause => "pause", + } + } +} + +impl std::str::FromStr for UpdateSubscriptionTrialSettingsEndBehaviorMissingPaymentMethod { + type Err = (); + fn from_str(s: &str) -> Result { + use UpdateSubscriptionTrialSettingsEndBehaviorMissingPaymentMethod::*; + match s { + "cancel" => Ok(Cancel), + "create_invoice" => Ok(CreateInvoice), + "pause" => Ok(Pause), + _ => Err(()), + } + } +} +impl std::fmt::Display for UpdateSubscriptionTrialSettingsEndBehaviorMissingPaymentMethod { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for UpdateSubscriptionTrialSettingsEndBehaviorMissingPaymentMethod { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for UpdateSubscriptionTrialSettingsEndBehaviorMissingPaymentMethod { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'a> UpdateSubscription<'a> { + /// Updates an existing subscription to match the specified parameters. + /// When changing prices or quantities, we optionally prorate the price we charge next month to make up for any price changes. + /// To preview how the proration is calculated, use the [upcoming invoice](https://stripe.com/docs/api/invoices/upcoming) endpoint. + /// + /// By default, we prorate subscription changes. + /// For example, if a customer signs up on May 1 for a $100 price, they’ll be billed $100 immediately. + /// If on May 15 they switch to a $200 price, then on June 1 they’ll be billed $250 ($200 for a renewal of her subscription, plus a $50 prorating adjustment for half of the previous month’s $100 difference). + /// Similarly, a downgrade generates a credit that is applied to the next invoice. + /// We also prorate when you make quantity changes. + /// + /// Switching prices does not normally change the billing date or generate an immediate charge unless: + /// + ///
    + ///
  • The billing interval is changed (for example, from monthly to yearly).
  • + ///
  • The subscription moves from free to paid, or paid to free.
  • + ///
  • A trial starts or ends.
  • + ///
+ /// + /// In these cases, we apply a credit for the unused time on the previous price, immediately charge the customer using the new price, and reset the billing date. + /// + /// If you want to charge for an upgrade immediately, pass `proration_behavior` as `always_invoice` to create prorations, automatically invoice the customer for those proration adjustments, and attempt to collect payment. + /// If you pass `create_prorations`, the prorations are created but not automatically invoiced. + /// If you want to bill the customer for the prorations before the subscription’s renewal date, you need to manually [invoice the customer](https://stripe.com/docs/api/invoices/create). + /// + /// If you don’t want to prorate, set the `proration_behavior` option to `none`. + /// With this option, the customer is billed $100 on May 1 and $200 on June 1. + /// Similarly, if you set `proration_behavior` to `none` when switching between different billing intervals (for example, from monthly to yearly), we don’t generate any credits for the old subscription’s unused time. + /// We still reset the billing date and bill immediately for the new subscription. + /// + /// Updating the quantity on a subscription many times in an hour may result in [rate limiting](https://stripe.com/docs/rate-limits). + /// If you need to bill for a frequently changing quantity, consider integrating [usage-based billing](https://stripe.com/docs/billing/subscriptions/usage-based) instead. + pub fn send( + &self, + client: &stripe::Client, + subscription_exposed_id: &stripe_shared::SubscriptionId, + ) -> stripe::Response { + client.send_form( + &format!("/subscriptions/{subscription_exposed_id}"), + self, + http_types::Method::Post, + ) + } +} +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct BillingThresholdsParam { + /// Monetary threshold that triggers the subscription to advance to a new billing period + #[serde(skip_serializing_if = "Option::is_none")] + pub amount_gte: Option, + /// Indicates if the `billing_cycle_anchor` should be reset when a threshold is reached. + /// If true, `billing_cycle_anchor` will be updated to the date/time the threshold was last reached; otherwise, the value will remain unchanged. + #[serde(skip_serializing_if = "Option::is_none")] + pub reset_billing_cycle_anchor: Option, +} +impl BillingThresholdsParam { + pub fn new() -> Self { + Self::default() + } +} +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct ItemBillingThresholdsParam { + /// Number of units that meets the billing threshold to advance the subscription to a new billing period (e.g., it takes 10 $5 units to meet a $50 [monetary threshold](https://stripe.com/docs/api/subscriptions/update#update_subscription-billing_thresholds-amount_gte)). + pub usage_gte: i64, +} +impl ItemBillingThresholdsParam { + pub fn new(usage_gte: i64) -> Self { + Self { usage_gte } + } +} +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct EuBankTransferParam<'a> { + /// The desired country code of the bank account information. + /// Permitted values include: `BE`, `DE`, `ES`, `FR`, `IE`, or `NL`. + pub country: &'a str, +} +impl<'a> EuBankTransferParam<'a> { + pub fn new(country: &'a str) -> Self { + Self { country } + } +} +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct TransferDataSpecs<'a> { + /// A non-negative decimal between 0 and 100, with at most two decimal places. + /// This represents the percentage of the subscription invoice total that will be transferred to the destination account. + /// By default, the entire amount is transferred to the destination. + #[serde(skip_serializing_if = "Option::is_none")] + pub amount_percent: Option, + /// ID of an existing, connected Stripe account. + pub destination: &'a str, +} +impl<'a> TransferDataSpecs<'a> { + pub fn new(destination: &'a str) -> Self { + Self { amount_percent: None, destination } + } +} +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct BankTransferParam<'a> { + /// Configuration for eu_bank_transfer funding type. + #[serde(skip_serializing_if = "Option::is_none")] + pub eu_bank_transfer: Option>, + /// The bank transfer type that can be used for funding. + /// Permitted values include: `eu_bank_transfer`, `gb_bank_transfer`, `jp_bank_transfer`, `mx_bank_transfer`, or `us_bank_transfer`. + #[serde(rename = "type")] + #[serde(skip_serializing_if = "Option::is_none")] + pub type_: Option<&'a str>, +} +impl<'a> BankTransferParam<'a> { + pub fn new() -> Self { + Self::default() + } +} +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct InvoicePaymentMethodOptionsParam<'a> { + /// Configuration for the bank transfer funding type, if the `funding_type` is set to `bank_transfer`. + #[serde(skip_serializing_if = "Option::is_none")] + pub bank_transfer: Option>, + /// The funding method type to be used when there are not enough funds in the customer balance. + /// Permitted values include: `bank_transfer`. + #[serde(skip_serializing_if = "Option::is_none")] + pub funding_type: Option<&'a str>, +} +impl<'a> InvoicePaymentMethodOptionsParam<'a> { + pub fn new() -> Self { + Self::default() + } +} diff --git a/generated/stripe_billing/src/subscription_item/mod.rs b/generated/stripe_billing/src/subscription_item/mod.rs new file mode 100644 index 000000000..22dae1b1c --- /dev/null +++ b/generated/stripe_billing/src/subscription_item/mod.rs @@ -0,0 +1,4 @@ +#[cfg(feature = "subscription_item")] +mod requests; +#[cfg(feature = "subscription_item")] +pub use requests::*; diff --git a/generated/stripe_billing/src/subscription_item/requests.rs b/generated/stripe_billing/src/subscription_item/requests.rs new file mode 100644 index 000000000..e56045b5e --- /dev/null +++ b/generated/stripe_billing/src/subscription_item/requests.rs @@ -0,0 +1,929 @@ +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct DeleteSubscriptionItem { + /// Delete all usage for the given subscription item. + /// Allowed only when the current plan's `usage_type` is `metered`. + #[serde(skip_serializing_if = "Option::is_none")] + pub clear_usage: Option, + /// Determines how to handle [prorations](https://stripe.com/docs/subscriptions/billing-cycle#prorations) when the billing cycle changes (e.g., when switching plans, resetting `billing_cycle_anchor=now`, or starting a trial), or if an item's `quantity` changes. + /// The default value is `create_prorations`. + #[serde(skip_serializing_if = "Option::is_none")] + pub proration_behavior: Option, + /// If set, the proration will be calculated as though the subscription was updated at the given time. + /// This can be used to apply the same proration that was previewed with the [upcoming invoice](https://stripe.com/docs/api#retrieve_customer_invoice) endpoint. + #[serde(skip_serializing_if = "Option::is_none")] + pub proration_date: Option, +} +impl DeleteSubscriptionItem { + pub fn new() -> Self { + Self::default() + } +} +/// Determines how to handle [prorations](https://stripe.com/docs/subscriptions/billing-cycle#prorations) when the billing cycle changes (e.g., when switching plans, resetting `billing_cycle_anchor=now`, or starting a trial), or if an item's `quantity` changes. +/// The default value is `create_prorations`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum DeleteSubscriptionItemProrationBehavior { + AlwaysInvoice, + CreateProrations, + None, +} +impl DeleteSubscriptionItemProrationBehavior { + pub fn as_str(self) -> &'static str { + use DeleteSubscriptionItemProrationBehavior::*; + match self { + AlwaysInvoice => "always_invoice", + CreateProrations => "create_prorations", + None => "none", + } + } +} + +impl std::str::FromStr for DeleteSubscriptionItemProrationBehavior { + type Err = (); + fn from_str(s: &str) -> Result { + use DeleteSubscriptionItemProrationBehavior::*; + match s { + "always_invoice" => Ok(AlwaysInvoice), + "create_prorations" => Ok(CreateProrations), + "none" => Ok(None), + _ => Err(()), + } + } +} +impl std::fmt::Display for DeleteSubscriptionItemProrationBehavior { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for DeleteSubscriptionItemProrationBehavior { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for DeleteSubscriptionItemProrationBehavior { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl DeleteSubscriptionItem { + /// Deletes an item from the subscription. + /// Removing a subscription item from a subscription will not cancel the subscription. + pub fn send( + &self, + client: &stripe::Client, + item: &stripe_shared::SubscriptionItemId, + ) -> stripe::Response { + client.send_form(&format!("/subscription_items/{item}"), self, http_types::Method::Delete) + } +} +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct ListSubscriptionItem<'a> { + /// A cursor for use in pagination. + /// `ending_before` is an object ID that defines your place in the list. + /// For instance, if you make a list request and receive 100 objects, starting with `obj_bar`, your subsequent call can include `ending_before=obj_bar` in order to fetch the previous page of the list. + #[serde(skip_serializing_if = "Option::is_none")] + pub ending_before: Option<&'a str>, + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, + /// A limit on the number of objects to be returned. + /// Limit can range between 1 and 100, and the default is 10. + #[serde(skip_serializing_if = "Option::is_none")] + pub limit: Option, + /// A cursor for use in pagination. + /// `starting_after` is an object ID that defines your place in the list. + /// For instance, if you make a list request and receive 100 objects, ending with `obj_foo`, your subsequent call can include `starting_after=obj_foo` in order to fetch the next page of the list. + #[serde(skip_serializing_if = "Option::is_none")] + pub starting_after: Option<&'a str>, + /// The ID of the subscription whose items will be retrieved. + pub subscription: &'a str, +} +impl<'a> ListSubscriptionItem<'a> { + pub fn new(subscription: &'a str) -> Self { + Self { ending_before: None, expand: None, limit: None, starting_after: None, subscription } + } +} +impl<'a> ListSubscriptionItem<'a> { + /// Returns a list of your subscription items for a given subscription. + pub fn send( + &self, + client: &stripe::Client, + ) -> stripe::Response> { + client.get_query("/subscription_items", self) + } + pub fn paginate( + self, + ) -> stripe::ListPaginator> { + stripe::ListPaginator::from_list_params("/subscription_items", self) + } +} +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct RetrieveSubscriptionItem<'a> { + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, +} +impl<'a> RetrieveSubscriptionItem<'a> { + pub fn new() -> Self { + Self::default() + } +} +impl<'a> RetrieveSubscriptionItem<'a> { + /// Retrieves the subscription item with the given ID. + pub fn send( + &self, + client: &stripe::Client, + item: &stripe_shared::SubscriptionItemId, + ) -> stripe::Response { + client.get_query(&format!("/subscription_items/{item}"), self) + } +} +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UsageRecordSummariesSubscriptionItem<'a> { + /// A cursor for use in pagination. + /// `ending_before` is an object ID that defines your place in the list. + /// For instance, if you make a list request and receive 100 objects, starting with `obj_bar`, your subsequent call can include `ending_before=obj_bar` in order to fetch the previous page of the list. + #[serde(skip_serializing_if = "Option::is_none")] + pub ending_before: Option<&'a str>, + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, + /// A limit on the number of objects to be returned. + /// Limit can range between 1 and 100, and the default is 10. + #[serde(skip_serializing_if = "Option::is_none")] + pub limit: Option, + /// A cursor for use in pagination. + /// `starting_after` is an object ID that defines your place in the list. + /// For instance, if you make a list request and receive 100 objects, ending with `obj_foo`, your subsequent call can include `starting_after=obj_foo` in order to fetch the next page of the list. + #[serde(skip_serializing_if = "Option::is_none")] + pub starting_after: Option<&'a str>, +} +impl<'a> UsageRecordSummariesSubscriptionItem<'a> { + pub fn new() -> Self { + Self::default() + } +} +impl<'a> UsageRecordSummariesSubscriptionItem<'a> { + /// For the specified subscription item, returns a list of summary objects. + /// Each object in the list provides usage information that’s been summarized from multiple usage records and over a subscription billing period (e.g., 15 usage records in the month of September). + /// + /// The list is sorted in reverse-chronological order (newest first). + /// The first list item represents the most current usage period that hasn’t ended yet. + /// Since new usage records can still be added, the returned summary information for the subscription item’s ID should be seen as unstable until the subscription billing period ends. + pub fn send( + &self, + client: &stripe::Client, + subscription_item: &stripe_shared::SubscriptionItemId, + ) -> stripe::Response> { + client.get_query( + &format!("/subscription_items/{subscription_item}/usage_record_summaries"), + self, + ) + } + pub fn paginate( + self, + subscription_item: &stripe_shared::SubscriptionItemId, + ) -> stripe::ListPaginator> { + stripe::ListPaginator::from_list_params( + &format!("/subscription_items/{subscription_item}/usage_record_summaries"), + self, + ) + } +} +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreateSubscriptionItem<'a> { + /// Define thresholds at which an invoice will be sent, and the subscription advanced to a new billing period. + /// When updating, pass an empty string to remove previously-defined thresholds. + #[serde(skip_serializing_if = "Option::is_none")] + pub billing_thresholds: Option, + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, + /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. + /// This can be useful for storing additional information about the object in a structured format. + /// Individual keys can be unset by posting an empty value to them. + /// All keys can be unset by posting an empty value to `metadata`. + #[serde(skip_serializing_if = "Option::is_none")] + pub metadata: Option<&'a std::collections::HashMap>, + /// Use `allow_incomplete` to transition the subscription to `status=past_due` if a payment is required but cannot be paid. + /// This allows you to manage scenarios where additional user actions are needed to pay a subscription's invoice. + /// For example, SCA regulation may require 3DS authentication to complete payment. + /// See the [SCA Migration Guide](https://stripe.com/docs/billing/migration/strong-customer-authentication) for Billing to learn more. + /// This is the default behavior. + /// + /// Use `default_incomplete` to transition the subscription to `status=past_due` when payment is required and await explicit confirmation of the invoice's payment intent. + /// This allows simpler management of scenarios where additional user actions are needed to pay a subscription’s invoice. + /// Such as failed payments, [SCA regulation](https://stripe.com/docs/billing/migration/strong-customer-authentication), or collecting a mandate for a bank debit payment method. + /// + /// Use `pending_if_incomplete` to update the subscription using [pending updates](https://stripe.com/docs/billing/subscriptions/pending-updates). + /// When you use `pending_if_incomplete` you can only pass the parameters [supported by pending updates](https://stripe.com/docs/billing/pending-updates-reference#supported-attributes). + /// + /// Use `error_if_incomplete` if you want Stripe to return an HTTP 402 status code if a subscription's invoice cannot be paid. + /// For example, if a payment method requires 3DS authentication due to SCA regulation and further user action is needed, this parameter does not update the subscription and returns an error instead. + /// This was the default behavior for API versions prior to 2019-03-14. + /// See the [changelog](https://stripe.com/docs/upgrades#2019-03-14) to learn more. + #[serde(skip_serializing_if = "Option::is_none")] + pub payment_behavior: Option, + /// The identifier of the plan to add to the subscription. + #[serde(skip_serializing_if = "Option::is_none")] + pub plan: Option<&'a str>, + /// The ID of the price object. + #[serde(skip_serializing_if = "Option::is_none")] + pub price: Option<&'a str>, + /// Data used to generate a new [Price](https://stripe.com/docs/api/prices) object inline. + #[serde(skip_serializing_if = "Option::is_none")] + pub price_data: Option>, + /// Determines how to handle [prorations](https://stripe.com/docs/subscriptions/billing-cycle#prorations) when the billing cycle changes (e.g., when switching plans, resetting `billing_cycle_anchor=now`, or starting a trial), or if an item's `quantity` changes. + /// The default value is `create_prorations`. + #[serde(skip_serializing_if = "Option::is_none")] + pub proration_behavior: Option, + /// If set, the proration will be calculated as though the subscription was updated at the given time. + /// This can be used to apply the same proration that was previewed with the [upcoming invoice](https://stripe.com/docs/api#retrieve_customer_invoice) endpoint. + #[serde(skip_serializing_if = "Option::is_none")] + pub proration_date: Option, + /// The quantity you'd like to apply to the subscription item you're creating. + #[serde(skip_serializing_if = "Option::is_none")] + pub quantity: Option, + /// The identifier of the subscription to modify. + pub subscription: &'a str, + /// A list of [Tax Rate](https://stripe.com/docs/api/tax_rates) ids. + /// These Tax Rates will override the [`default_tax_rates`](https://stripe.com/docs/api/subscriptions/create#create_subscription-default_tax_rates) on the Subscription. + /// When updating, pass an empty string to remove previously-defined tax rates. + #[serde(skip_serializing_if = "Option::is_none")] + pub tax_rates: Option<&'a [&'a str]>, +} +impl<'a> CreateSubscriptionItem<'a> { + pub fn new(subscription: &'a str) -> Self { + Self { + billing_thresholds: None, + expand: None, + metadata: None, + payment_behavior: None, + plan: None, + price: None, + price_data: None, + proration_behavior: None, + proration_date: None, + quantity: None, + subscription, + tax_rates: None, + } + } +} +/// Use `allow_incomplete` to transition the subscription to `status=past_due` if a payment is required but cannot be paid. +/// This allows you to manage scenarios where additional user actions are needed to pay a subscription's invoice. +/// For example, SCA regulation may require 3DS authentication to complete payment. +/// See the [SCA Migration Guide](https://stripe.com/docs/billing/migration/strong-customer-authentication) for Billing to learn more. +/// This is the default behavior. +/// +/// Use `default_incomplete` to transition the subscription to `status=past_due` when payment is required and await explicit confirmation of the invoice's payment intent. +/// This allows simpler management of scenarios where additional user actions are needed to pay a subscription’s invoice. +/// Such as failed payments, [SCA regulation](https://stripe.com/docs/billing/migration/strong-customer-authentication), or collecting a mandate for a bank debit payment method. +/// +/// Use `pending_if_incomplete` to update the subscription using [pending updates](https://stripe.com/docs/billing/subscriptions/pending-updates). +/// When you use `pending_if_incomplete` you can only pass the parameters [supported by pending updates](https://stripe.com/docs/billing/pending-updates-reference#supported-attributes). +/// +/// Use `error_if_incomplete` if you want Stripe to return an HTTP 402 status code if a subscription's invoice cannot be paid. +/// For example, if a payment method requires 3DS authentication due to SCA regulation and further user action is needed, this parameter does not update the subscription and returns an error instead. +/// This was the default behavior for API versions prior to 2019-03-14. +/// See the [changelog](https://stripe.com/docs/upgrades#2019-03-14) to learn more. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreateSubscriptionItemPaymentBehavior { + AllowIncomplete, + DefaultIncomplete, + ErrorIfIncomplete, + PendingIfIncomplete, +} +impl CreateSubscriptionItemPaymentBehavior { + pub fn as_str(self) -> &'static str { + use CreateSubscriptionItemPaymentBehavior::*; + match self { + AllowIncomplete => "allow_incomplete", + DefaultIncomplete => "default_incomplete", + ErrorIfIncomplete => "error_if_incomplete", + PendingIfIncomplete => "pending_if_incomplete", + } + } +} + +impl std::str::FromStr for CreateSubscriptionItemPaymentBehavior { + type Err = (); + fn from_str(s: &str) -> Result { + use CreateSubscriptionItemPaymentBehavior::*; + match s { + "allow_incomplete" => Ok(AllowIncomplete), + "default_incomplete" => Ok(DefaultIncomplete), + "error_if_incomplete" => Ok(ErrorIfIncomplete), + "pending_if_incomplete" => Ok(PendingIfIncomplete), + _ => Err(()), + } + } +} +impl std::fmt::Display for CreateSubscriptionItemPaymentBehavior { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreateSubscriptionItemPaymentBehavior { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreateSubscriptionItemPaymentBehavior { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Data used to generate a new [Price](https://stripe.com/docs/api/prices) object inline. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreateSubscriptionItemPriceData<'a> { + /// Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. + /// Must be a [supported currency](https://stripe.com/docs/currencies). + pub currency: stripe_types::Currency, + /// The ID of the product that this price will belong to. + pub product: &'a str, + /// The recurring components of a price such as `interval` and `interval_count`. + pub recurring: CreateSubscriptionItemPriceDataRecurring, + /// Only required if a [default tax behavior](https://stripe.com/docs/tax/products-prices-tax-categories-tax-behavior#setting-a-default-tax-behavior-(recommended)) was not provided in the Stripe Tax settings. + /// Specifies whether the price is considered inclusive of taxes or exclusive of taxes. + /// One of `inclusive`, `exclusive`, or `unspecified`. + /// Once specified as either `inclusive` or `exclusive`, it cannot be changed. + #[serde(skip_serializing_if = "Option::is_none")] + pub tax_behavior: Option, + /// A positive integer in cents (or local equivalent) (or 0 for a free price) representing how much to charge. + #[serde(skip_serializing_if = "Option::is_none")] + pub unit_amount: Option, + /// Same as `unit_amount`, but accepts a decimal value in cents (or local equivalent) with at most 12 decimal places. + /// Only one of `unit_amount` and `unit_amount_decimal` can be set. + #[serde(skip_serializing_if = "Option::is_none")] + pub unit_amount_decimal: Option<&'a str>, +} +impl<'a> CreateSubscriptionItemPriceData<'a> { + pub fn new( + currency: stripe_types::Currency, + product: &'a str, + recurring: CreateSubscriptionItemPriceDataRecurring, + ) -> Self { + Self { + currency, + product, + recurring, + tax_behavior: None, + unit_amount: None, + unit_amount_decimal: None, + } + } +} +/// The recurring components of a price such as `interval` and `interval_count`. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreateSubscriptionItemPriceDataRecurring { + /// Specifies billing frequency. Either `day`, `week`, `month` or `year`. + pub interval: CreateSubscriptionItemPriceDataRecurringInterval, + /// The number of intervals between subscription billings. + /// For example, `interval=month` and `interval_count=3` bills every 3 months. + /// Maximum of three years interval allowed (3 years, 36 months, or 156 weeks). + #[serde(skip_serializing_if = "Option::is_none")] + pub interval_count: Option, +} +impl CreateSubscriptionItemPriceDataRecurring { + pub fn new(interval: CreateSubscriptionItemPriceDataRecurringInterval) -> Self { + Self { interval, interval_count: None } + } +} +/// Specifies billing frequency. Either `day`, `week`, `month` or `year`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreateSubscriptionItemPriceDataRecurringInterval { + Day, + Month, + Week, + Year, +} +impl CreateSubscriptionItemPriceDataRecurringInterval { + pub fn as_str(self) -> &'static str { + use CreateSubscriptionItemPriceDataRecurringInterval::*; + match self { + Day => "day", + Month => "month", + Week => "week", + Year => "year", + } + } +} + +impl std::str::FromStr for CreateSubscriptionItemPriceDataRecurringInterval { + type Err = (); + fn from_str(s: &str) -> Result { + use CreateSubscriptionItemPriceDataRecurringInterval::*; + match s { + "day" => Ok(Day), + "month" => Ok(Month), + "week" => Ok(Week), + "year" => Ok(Year), + _ => Err(()), + } + } +} +impl std::fmt::Display for CreateSubscriptionItemPriceDataRecurringInterval { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreateSubscriptionItemPriceDataRecurringInterval { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreateSubscriptionItemPriceDataRecurringInterval { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Only required if a [default tax behavior](https://stripe.com/docs/tax/products-prices-tax-categories-tax-behavior#setting-a-default-tax-behavior-(recommended)) was not provided in the Stripe Tax settings. +/// Specifies whether the price is considered inclusive of taxes or exclusive of taxes. +/// One of `inclusive`, `exclusive`, or `unspecified`. +/// Once specified as either `inclusive` or `exclusive`, it cannot be changed. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreateSubscriptionItemPriceDataTaxBehavior { + Exclusive, + Inclusive, + Unspecified, +} +impl CreateSubscriptionItemPriceDataTaxBehavior { + pub fn as_str(self) -> &'static str { + use CreateSubscriptionItemPriceDataTaxBehavior::*; + match self { + Exclusive => "exclusive", + Inclusive => "inclusive", + Unspecified => "unspecified", + } + } +} + +impl std::str::FromStr for CreateSubscriptionItemPriceDataTaxBehavior { + type Err = (); + fn from_str(s: &str) -> Result { + use CreateSubscriptionItemPriceDataTaxBehavior::*; + match s { + "exclusive" => Ok(Exclusive), + "inclusive" => Ok(Inclusive), + "unspecified" => Ok(Unspecified), + _ => Err(()), + } + } +} +impl std::fmt::Display for CreateSubscriptionItemPriceDataTaxBehavior { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreateSubscriptionItemPriceDataTaxBehavior { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreateSubscriptionItemPriceDataTaxBehavior { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Determines how to handle [prorations](https://stripe.com/docs/subscriptions/billing-cycle#prorations) when the billing cycle changes (e.g., when switching plans, resetting `billing_cycle_anchor=now`, or starting a trial), or if an item's `quantity` changes. +/// The default value is `create_prorations`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreateSubscriptionItemProrationBehavior { + AlwaysInvoice, + CreateProrations, + None, +} +impl CreateSubscriptionItemProrationBehavior { + pub fn as_str(self) -> &'static str { + use CreateSubscriptionItemProrationBehavior::*; + match self { + AlwaysInvoice => "always_invoice", + CreateProrations => "create_prorations", + None => "none", + } + } +} + +impl std::str::FromStr for CreateSubscriptionItemProrationBehavior { + type Err = (); + fn from_str(s: &str) -> Result { + use CreateSubscriptionItemProrationBehavior::*; + match s { + "always_invoice" => Ok(AlwaysInvoice), + "create_prorations" => Ok(CreateProrations), + "none" => Ok(None), + _ => Err(()), + } + } +} +impl std::fmt::Display for CreateSubscriptionItemProrationBehavior { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreateSubscriptionItemProrationBehavior { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreateSubscriptionItemProrationBehavior { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'a> CreateSubscriptionItem<'a> { + /// Adds a new item to an existing subscription. No existing items will be changed or replaced. + pub fn send( + &self, + client: &stripe::Client, + ) -> stripe::Response { + client.send_form("/subscription_items", self, http_types::Method::Post) + } +} +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdateSubscriptionItem<'a> { + /// Define thresholds at which an invoice will be sent, and the subscription advanced to a new billing period. + /// When updating, pass an empty string to remove previously-defined thresholds. + #[serde(skip_serializing_if = "Option::is_none")] + pub billing_thresholds: Option, + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, + /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. + /// This can be useful for storing additional information about the object in a structured format. + /// Individual keys can be unset by posting an empty value to them. + /// All keys can be unset by posting an empty value to `metadata`. + #[serde(skip_serializing_if = "Option::is_none")] + pub metadata: Option<&'a std::collections::HashMap>, + /// Indicates if a customer is on or off-session while an invoice payment is attempted. + #[serde(skip_serializing_if = "Option::is_none")] + pub off_session: Option, + /// Use `allow_incomplete` to transition the subscription to `status=past_due` if a payment is required but cannot be paid. + /// This allows you to manage scenarios where additional user actions are needed to pay a subscription's invoice. + /// For example, SCA regulation may require 3DS authentication to complete payment. + /// See the [SCA Migration Guide](https://stripe.com/docs/billing/migration/strong-customer-authentication) for Billing to learn more. + /// This is the default behavior. + /// + /// Use `default_incomplete` to transition the subscription to `status=past_due` when payment is required and await explicit confirmation of the invoice's payment intent. + /// This allows simpler management of scenarios where additional user actions are needed to pay a subscription’s invoice. + /// Such as failed payments, [SCA regulation](https://stripe.com/docs/billing/migration/strong-customer-authentication), or collecting a mandate for a bank debit payment method. + /// + /// Use `pending_if_incomplete` to update the subscription using [pending updates](https://stripe.com/docs/billing/subscriptions/pending-updates). + /// When you use `pending_if_incomplete` you can only pass the parameters [supported by pending updates](https://stripe.com/docs/billing/pending-updates-reference#supported-attributes). + /// + /// Use `error_if_incomplete` if you want Stripe to return an HTTP 402 status code if a subscription's invoice cannot be paid. + /// For example, if a payment method requires 3DS authentication due to SCA regulation and further user action is needed, this parameter does not update the subscription and returns an error instead. + /// This was the default behavior for API versions prior to 2019-03-14. + /// See the [changelog](https://stripe.com/docs/upgrades#2019-03-14) to learn more. + #[serde(skip_serializing_if = "Option::is_none")] + pub payment_behavior: Option, + /// The identifier of the new plan for this subscription item. + #[serde(skip_serializing_if = "Option::is_none")] + pub plan: Option<&'a str>, + /// The ID of the price object. + /// When changing a subscription item's price, `quantity` is set to 1 unless a `quantity` parameter is provided. + #[serde(skip_serializing_if = "Option::is_none")] + pub price: Option<&'a str>, + /// Data used to generate a new [Price](https://stripe.com/docs/api/prices) object inline. + #[serde(skip_serializing_if = "Option::is_none")] + pub price_data: Option>, + /// Determines how to handle [prorations](https://stripe.com/docs/subscriptions/billing-cycle#prorations) when the billing cycle changes (e.g., when switching plans, resetting `billing_cycle_anchor=now`, or starting a trial), or if an item's `quantity` changes. + /// The default value is `create_prorations`. + #[serde(skip_serializing_if = "Option::is_none")] + pub proration_behavior: Option, + /// If set, the proration will be calculated as though the subscription was updated at the given time. + /// This can be used to apply the same proration that was previewed with the [upcoming invoice](https://stripe.com/docs/api#retrieve_customer_invoice) endpoint. + #[serde(skip_serializing_if = "Option::is_none")] + pub proration_date: Option, + /// The quantity you'd like to apply to the subscription item you're creating. + #[serde(skip_serializing_if = "Option::is_none")] + pub quantity: Option, + /// A list of [Tax Rate](https://stripe.com/docs/api/tax_rates) ids. + /// These Tax Rates will override the [`default_tax_rates`](https://stripe.com/docs/api/subscriptions/create#create_subscription-default_tax_rates) on the Subscription. + /// When updating, pass an empty string to remove previously-defined tax rates. + #[serde(skip_serializing_if = "Option::is_none")] + pub tax_rates: Option<&'a [&'a str]>, +} +impl<'a> UpdateSubscriptionItem<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// Use `allow_incomplete` to transition the subscription to `status=past_due` if a payment is required but cannot be paid. +/// This allows you to manage scenarios where additional user actions are needed to pay a subscription's invoice. +/// For example, SCA regulation may require 3DS authentication to complete payment. +/// See the [SCA Migration Guide](https://stripe.com/docs/billing/migration/strong-customer-authentication) for Billing to learn more. +/// This is the default behavior. +/// +/// Use `default_incomplete` to transition the subscription to `status=past_due` when payment is required and await explicit confirmation of the invoice's payment intent. +/// This allows simpler management of scenarios where additional user actions are needed to pay a subscription’s invoice. +/// Such as failed payments, [SCA regulation](https://stripe.com/docs/billing/migration/strong-customer-authentication), or collecting a mandate for a bank debit payment method. +/// +/// Use `pending_if_incomplete` to update the subscription using [pending updates](https://stripe.com/docs/billing/subscriptions/pending-updates). +/// When you use `pending_if_incomplete` you can only pass the parameters [supported by pending updates](https://stripe.com/docs/billing/pending-updates-reference#supported-attributes). +/// +/// Use `error_if_incomplete` if you want Stripe to return an HTTP 402 status code if a subscription's invoice cannot be paid. +/// For example, if a payment method requires 3DS authentication due to SCA regulation and further user action is needed, this parameter does not update the subscription and returns an error instead. +/// This was the default behavior for API versions prior to 2019-03-14. +/// See the [changelog](https://stripe.com/docs/upgrades#2019-03-14) to learn more. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum UpdateSubscriptionItemPaymentBehavior { + AllowIncomplete, + DefaultIncomplete, + ErrorIfIncomplete, + PendingIfIncomplete, +} +impl UpdateSubscriptionItemPaymentBehavior { + pub fn as_str(self) -> &'static str { + use UpdateSubscriptionItemPaymentBehavior::*; + match self { + AllowIncomplete => "allow_incomplete", + DefaultIncomplete => "default_incomplete", + ErrorIfIncomplete => "error_if_incomplete", + PendingIfIncomplete => "pending_if_incomplete", + } + } +} + +impl std::str::FromStr for UpdateSubscriptionItemPaymentBehavior { + type Err = (); + fn from_str(s: &str) -> Result { + use UpdateSubscriptionItemPaymentBehavior::*; + match s { + "allow_incomplete" => Ok(AllowIncomplete), + "default_incomplete" => Ok(DefaultIncomplete), + "error_if_incomplete" => Ok(ErrorIfIncomplete), + "pending_if_incomplete" => Ok(PendingIfIncomplete), + _ => Err(()), + } + } +} +impl std::fmt::Display for UpdateSubscriptionItemPaymentBehavior { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for UpdateSubscriptionItemPaymentBehavior { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for UpdateSubscriptionItemPaymentBehavior { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Data used to generate a new [Price](https://stripe.com/docs/api/prices) object inline. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct UpdateSubscriptionItemPriceData<'a> { + /// Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. + /// Must be a [supported currency](https://stripe.com/docs/currencies). + pub currency: stripe_types::Currency, + /// The ID of the product that this price will belong to. + pub product: &'a str, + /// The recurring components of a price such as `interval` and `interval_count`. + pub recurring: UpdateSubscriptionItemPriceDataRecurring, + /// Only required if a [default tax behavior](https://stripe.com/docs/tax/products-prices-tax-categories-tax-behavior#setting-a-default-tax-behavior-(recommended)) was not provided in the Stripe Tax settings. + /// Specifies whether the price is considered inclusive of taxes or exclusive of taxes. + /// One of `inclusive`, `exclusive`, or `unspecified`. + /// Once specified as either `inclusive` or `exclusive`, it cannot be changed. + #[serde(skip_serializing_if = "Option::is_none")] + pub tax_behavior: Option, + /// A positive integer in cents (or local equivalent) (or 0 for a free price) representing how much to charge. + #[serde(skip_serializing_if = "Option::is_none")] + pub unit_amount: Option, + /// Same as `unit_amount`, but accepts a decimal value in cents (or local equivalent) with at most 12 decimal places. + /// Only one of `unit_amount` and `unit_amount_decimal` can be set. + #[serde(skip_serializing_if = "Option::is_none")] + pub unit_amount_decimal: Option<&'a str>, +} +impl<'a> UpdateSubscriptionItemPriceData<'a> { + pub fn new( + currency: stripe_types::Currency, + product: &'a str, + recurring: UpdateSubscriptionItemPriceDataRecurring, + ) -> Self { + Self { + currency, + product, + recurring, + tax_behavior: None, + unit_amount: None, + unit_amount_decimal: None, + } + } +} +/// The recurring components of a price such as `interval` and `interval_count`. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct UpdateSubscriptionItemPriceDataRecurring { + /// Specifies billing frequency. Either `day`, `week`, `month` or `year`. + pub interval: UpdateSubscriptionItemPriceDataRecurringInterval, + /// The number of intervals between subscription billings. + /// For example, `interval=month` and `interval_count=3` bills every 3 months. + /// Maximum of three years interval allowed (3 years, 36 months, or 156 weeks). + #[serde(skip_serializing_if = "Option::is_none")] + pub interval_count: Option, +} +impl UpdateSubscriptionItemPriceDataRecurring { + pub fn new(interval: UpdateSubscriptionItemPriceDataRecurringInterval) -> Self { + Self { interval, interval_count: None } + } +} +/// Specifies billing frequency. Either `day`, `week`, `month` or `year`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum UpdateSubscriptionItemPriceDataRecurringInterval { + Day, + Month, + Week, + Year, +} +impl UpdateSubscriptionItemPriceDataRecurringInterval { + pub fn as_str(self) -> &'static str { + use UpdateSubscriptionItemPriceDataRecurringInterval::*; + match self { + Day => "day", + Month => "month", + Week => "week", + Year => "year", + } + } +} + +impl std::str::FromStr for UpdateSubscriptionItemPriceDataRecurringInterval { + type Err = (); + fn from_str(s: &str) -> Result { + use UpdateSubscriptionItemPriceDataRecurringInterval::*; + match s { + "day" => Ok(Day), + "month" => Ok(Month), + "week" => Ok(Week), + "year" => Ok(Year), + _ => Err(()), + } + } +} +impl std::fmt::Display for UpdateSubscriptionItemPriceDataRecurringInterval { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for UpdateSubscriptionItemPriceDataRecurringInterval { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for UpdateSubscriptionItemPriceDataRecurringInterval { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Only required if a [default tax behavior](https://stripe.com/docs/tax/products-prices-tax-categories-tax-behavior#setting-a-default-tax-behavior-(recommended)) was not provided in the Stripe Tax settings. +/// Specifies whether the price is considered inclusive of taxes or exclusive of taxes. +/// One of `inclusive`, `exclusive`, or `unspecified`. +/// Once specified as either `inclusive` or `exclusive`, it cannot be changed. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum UpdateSubscriptionItemPriceDataTaxBehavior { + Exclusive, + Inclusive, + Unspecified, +} +impl UpdateSubscriptionItemPriceDataTaxBehavior { + pub fn as_str(self) -> &'static str { + use UpdateSubscriptionItemPriceDataTaxBehavior::*; + match self { + Exclusive => "exclusive", + Inclusive => "inclusive", + Unspecified => "unspecified", + } + } +} + +impl std::str::FromStr for UpdateSubscriptionItemPriceDataTaxBehavior { + type Err = (); + fn from_str(s: &str) -> Result { + use UpdateSubscriptionItemPriceDataTaxBehavior::*; + match s { + "exclusive" => Ok(Exclusive), + "inclusive" => Ok(Inclusive), + "unspecified" => Ok(Unspecified), + _ => Err(()), + } + } +} +impl std::fmt::Display for UpdateSubscriptionItemPriceDataTaxBehavior { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for UpdateSubscriptionItemPriceDataTaxBehavior { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for UpdateSubscriptionItemPriceDataTaxBehavior { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Determines how to handle [prorations](https://stripe.com/docs/subscriptions/billing-cycle#prorations) when the billing cycle changes (e.g., when switching plans, resetting `billing_cycle_anchor=now`, or starting a trial), or if an item's `quantity` changes. +/// The default value is `create_prorations`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum UpdateSubscriptionItemProrationBehavior { + AlwaysInvoice, + CreateProrations, + None, +} +impl UpdateSubscriptionItemProrationBehavior { + pub fn as_str(self) -> &'static str { + use UpdateSubscriptionItemProrationBehavior::*; + match self { + AlwaysInvoice => "always_invoice", + CreateProrations => "create_prorations", + None => "none", + } + } +} + +impl std::str::FromStr for UpdateSubscriptionItemProrationBehavior { + type Err = (); + fn from_str(s: &str) -> Result { + use UpdateSubscriptionItemProrationBehavior::*; + match s { + "always_invoice" => Ok(AlwaysInvoice), + "create_prorations" => Ok(CreateProrations), + "none" => Ok(None), + _ => Err(()), + } + } +} +impl std::fmt::Display for UpdateSubscriptionItemProrationBehavior { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for UpdateSubscriptionItemProrationBehavior { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for UpdateSubscriptionItemProrationBehavior { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'a> UpdateSubscriptionItem<'a> { + /// Updates the plan or quantity of an item on a current subscription. + pub fn send( + &self, + client: &stripe::Client, + item: &stripe_shared::SubscriptionItemId, + ) -> stripe::Response { + client.send_form(&format!("/subscription_items/{item}"), self, http_types::Method::Post) + } +} +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct ItemBillingThresholdsParam { + /// Number of units that meets the billing threshold to advance the subscription to a new billing period (e.g., it takes 10 $5 units to meet a $50 [monetary threshold](https://stripe.com/docs/api/subscriptions/update#update_subscription-billing_thresholds-amount_gte)). + pub usage_gte: i64, +} +impl ItemBillingThresholdsParam { + pub fn new(usage_gte: i64) -> Self { + Self { usage_gte } + } +} diff --git a/generated/stripe_billing/src/subscription_schedule/mod.rs b/generated/stripe_billing/src/subscription_schedule/mod.rs new file mode 100644 index 000000000..c4651f913 --- /dev/null +++ b/generated/stripe_billing/src/subscription_schedule/mod.rs @@ -0,0 +1,4 @@ +#[cfg(feature = "subscription_schedule")] +mod requests; +#[cfg(feature = "subscription_schedule")] +pub use requests::*; diff --git a/generated/stripe_billing/src/subscription_schedule/requests.rs b/generated/stripe_billing/src/subscription_schedule/requests.rs new file mode 100644 index 000000000..a3e60f65e --- /dev/null +++ b/generated/stripe_billing/src/subscription_schedule/requests.rs @@ -0,0 +1,2455 @@ +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct ListSubscriptionSchedule<'a> { + /// Only return subscription schedules that were created canceled the given date interval. + #[serde(skip_serializing_if = "Option::is_none")] + pub canceled_at: Option, + /// Only return subscription schedules that completed during the given date interval. + #[serde(skip_serializing_if = "Option::is_none")] + pub completed_at: Option, + /// Only return subscription schedules that were created during the given date interval. + #[serde(skip_serializing_if = "Option::is_none")] + pub created: Option, + /// Only return subscription schedules for the given customer. + #[serde(skip_serializing_if = "Option::is_none")] + pub customer: Option<&'a str>, + /// A cursor for use in pagination. + /// `ending_before` is an object ID that defines your place in the list. + /// For instance, if you make a list request and receive 100 objects, starting with `obj_bar`, your subsequent call can include `ending_before=obj_bar` in order to fetch the previous page of the list. + #[serde(skip_serializing_if = "Option::is_none")] + pub ending_before: Option<&'a str>, + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, + /// A limit on the number of objects to be returned. + /// Limit can range between 1 and 100, and the default is 10. + #[serde(skip_serializing_if = "Option::is_none")] + pub limit: Option, + /// Only return subscription schedules that were released during the given date interval. + #[serde(skip_serializing_if = "Option::is_none")] + pub released_at: Option, + /// Only return subscription schedules that have not started yet. + #[serde(skip_serializing_if = "Option::is_none")] + pub scheduled: Option, + /// A cursor for use in pagination. + /// `starting_after` is an object ID that defines your place in the list. + /// For instance, if you make a list request and receive 100 objects, ending with `obj_foo`, your subsequent call can include `starting_after=obj_foo` in order to fetch the next page of the list. + #[serde(skip_serializing_if = "Option::is_none")] + pub starting_after: Option<&'a str>, +} +impl<'a> ListSubscriptionSchedule<'a> { + pub fn new() -> Self { + Self::default() + } +} +impl<'a> ListSubscriptionSchedule<'a> { + /// Retrieves the list of your subscription schedules. + pub fn send( + &self, + client: &stripe::Client, + ) -> stripe::Response> { + client.get_query("/subscription_schedules", self) + } + pub fn paginate( + self, + ) -> stripe::ListPaginator> { + stripe::ListPaginator::from_list_params("/subscription_schedules", self) + } +} +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct RetrieveSubscriptionSchedule<'a> { + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, +} +impl<'a> RetrieveSubscriptionSchedule<'a> { + pub fn new() -> Self { + Self::default() + } +} +impl<'a> RetrieveSubscriptionSchedule<'a> { + /// Retrieves the details of an existing subscription schedule. + /// You only need to supply the unique subscription schedule identifier that was returned upon subscription schedule creation. + pub fn send( + &self, + client: &stripe::Client, + schedule: &stripe_shared::SubscriptionScheduleId, + ) -> stripe::Response { + client.get_query(&format!("/subscription_schedules/{schedule}"), self) + } +} +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreateSubscriptionSchedule<'a> { + /// The identifier of the customer to create the subscription schedule for. + #[serde(skip_serializing_if = "Option::is_none")] + pub customer: Option<&'a str>, + /// Object representing the subscription schedule's default settings. + #[serde(skip_serializing_if = "Option::is_none")] + pub default_settings: Option>, + /// Behavior of the subscription schedule and underlying subscription when it ends. + /// Possible values are `release` or `cancel` with the default being `release`. + /// `release` will end the subscription schedule and keep the underlying subscription running. + /// `cancel` will end the subscription schedule and cancel the underlying subscription. + #[serde(skip_serializing_if = "Option::is_none")] + pub end_behavior: Option, + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, + /// Migrate an existing subscription to be managed by a subscription schedule. + /// If this parameter is set, a subscription schedule will be created using the subscription's item(s), set to auto-renew using the subscription's interval. + /// When using this parameter, other parameters (such as phase values) cannot be set. + /// To create a subscription schedule with other modifications, we recommend making two separate API calls. + #[serde(skip_serializing_if = "Option::is_none")] + pub from_subscription: Option<&'a str>, + /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. + /// This can be useful for storing additional information about the object in a structured format. + /// Individual keys can be unset by posting an empty value to them. + /// All keys can be unset by posting an empty value to `metadata`. + #[serde(skip_serializing_if = "Option::is_none")] + pub metadata: Option<&'a std::collections::HashMap>, + /// List representing phases of the subscription schedule. + /// Each phase can be customized to have different durations, plans, and coupons. + /// If there are multiple phases, the `end_date` of one phase will always equal the `start_date` of the next phase. + #[serde(skip_serializing_if = "Option::is_none")] + pub phases: Option<&'a [CreateSubscriptionSchedulePhases<'a>]>, + /// When the subscription schedule starts. + /// We recommend using `now` so that it starts the subscription immediately. + /// You can also use a Unix timestamp to backdate the subscription so that it starts on a past date, or set a future date for the subscription to start on. + #[serde(skip_serializing_if = "Option::is_none")] + pub start_date: Option, +} +impl<'a> CreateSubscriptionSchedule<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// Object representing the subscription schedule's default settings. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreateSubscriptionScheduleDefaultSettings<'a> { + /// A non-negative decimal between 0 and 100, with at most two decimal places. + /// This represents the percentage of the subscription invoice total that will be transferred to the application owner's Stripe account. + /// The request must be made by a platform account on a connected account in order to set an application fee percentage. + /// For more information, see the application fees [documentation](https://stripe.com/docs/connect/subscriptions#collecting-fees-on-subscriptions). + #[serde(skip_serializing_if = "Option::is_none")] + pub application_fee_percent: Option, + /// Default settings for automatic tax computation. + #[serde(skip_serializing_if = "Option::is_none")] + pub automatic_tax: Option>, + /// Can be set to `phase_start` to set the anchor to the start of the phase or `automatic` to automatically change it if needed. + /// Cannot be set to `phase_start` if this phase specifies a trial. + /// For more information, see the billing cycle [documentation](https://stripe.com/docs/billing/subscriptions/billing-cycle). + #[serde(skip_serializing_if = "Option::is_none")] + pub billing_cycle_anchor: Option, + /// Define thresholds at which an invoice will be sent, and the subscription advanced to a new billing period. + /// Pass an empty string to remove previously-defined thresholds. + #[serde(skip_serializing_if = "Option::is_none")] + pub billing_thresholds: Option, + /// Either `charge_automatically`, or `send_invoice`. + /// When charging automatically, Stripe will attempt to pay the underlying subscription at the end of each billing cycle using the default source attached to the customer. + /// When sending an invoice, Stripe will email your customer an invoice with payment instructions and mark the subscription as `active`. + /// Defaults to `charge_automatically` on creation. + #[serde(skip_serializing_if = "Option::is_none")] + pub collection_method: Option, + /// ID of the default payment method for the subscription schedule. + /// It must belong to the customer associated with the subscription schedule. + /// If not set, invoices will use the default payment method in the customer's invoice settings. + #[serde(skip_serializing_if = "Option::is_none")] + pub default_payment_method: Option<&'a str>, + /// Subscription description, meant to be displayable to the customer. + /// Use this field to optionally store an explanation of the subscription for rendering in Stripe surfaces and certain local payment methods UIs. + #[serde(skip_serializing_if = "Option::is_none")] + pub description: Option<&'a str>, + /// All invoices will be billed using the specified settings. + #[serde(skip_serializing_if = "Option::is_none")] + pub invoice_settings: Option>, + /// The account on behalf of which to charge, for each of the associated subscription's invoices. + #[serde(skip_serializing_if = "Option::is_none")] + pub on_behalf_of: Option<&'a str>, + /// The data with which to automatically create a Transfer for each of the associated subscription's invoices. + #[serde(skip_serializing_if = "Option::is_none")] + pub transfer_data: Option>, +} +impl<'a> CreateSubscriptionScheduleDefaultSettings<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// Default settings for automatic tax computation. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreateSubscriptionScheduleDefaultSettingsAutomaticTax<'a> { + /// Enabled automatic tax calculation which will automatically compute tax rates on all invoices generated by the subscription. + pub enabled: bool, + /// The account that's liable for tax. + /// If set, the business address and tax registrations required to perform the tax calculation are loaded from this account. + /// The tax transaction is returned in the report of the connected account. + #[serde(skip_serializing_if = "Option::is_none")] + pub liability: Option>, +} +impl<'a> CreateSubscriptionScheduleDefaultSettingsAutomaticTax<'a> { + pub fn new(enabled: bool) -> Self { + Self { enabled, liability: None } + } +} +/// The account that's liable for tax. +/// If set, the business address and tax registrations required to perform the tax calculation are loaded from this account. +/// The tax transaction is returned in the report of the connected account. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreateSubscriptionScheduleDefaultSettingsAutomaticTaxLiability<'a> { + /// The connected account being referenced when `type` is `account`. + #[serde(skip_serializing_if = "Option::is_none")] + pub account: Option<&'a str>, + /// Type of the account referenced in the request. + #[serde(rename = "type")] + pub type_: CreateSubscriptionScheduleDefaultSettingsAutomaticTaxLiabilityType, +} +impl<'a> CreateSubscriptionScheduleDefaultSettingsAutomaticTaxLiability<'a> { + pub fn new(type_: CreateSubscriptionScheduleDefaultSettingsAutomaticTaxLiabilityType) -> Self { + Self { account: None, type_ } + } +} +/// Type of the account referenced in the request. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreateSubscriptionScheduleDefaultSettingsAutomaticTaxLiabilityType { + Account, + Self_, +} +impl CreateSubscriptionScheduleDefaultSettingsAutomaticTaxLiabilityType { + pub fn as_str(self) -> &'static str { + use CreateSubscriptionScheduleDefaultSettingsAutomaticTaxLiabilityType::*; + match self { + Account => "account", + Self_ => "self", + } + } +} + +impl std::str::FromStr for CreateSubscriptionScheduleDefaultSettingsAutomaticTaxLiabilityType { + type Err = (); + fn from_str(s: &str) -> Result { + use CreateSubscriptionScheduleDefaultSettingsAutomaticTaxLiabilityType::*; + match s { + "account" => Ok(Account), + "self" => Ok(Self_), + _ => Err(()), + } + } +} +impl std::fmt::Display for CreateSubscriptionScheduleDefaultSettingsAutomaticTaxLiabilityType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreateSubscriptionScheduleDefaultSettingsAutomaticTaxLiabilityType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreateSubscriptionScheduleDefaultSettingsAutomaticTaxLiabilityType { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Can be set to `phase_start` to set the anchor to the start of the phase or `automatic` to automatically change it if needed. +/// Cannot be set to `phase_start` if this phase specifies a trial. +/// For more information, see the billing cycle [documentation](https://stripe.com/docs/billing/subscriptions/billing-cycle). +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreateSubscriptionScheduleDefaultSettingsBillingCycleAnchor { + Automatic, + PhaseStart, +} +impl CreateSubscriptionScheduleDefaultSettingsBillingCycleAnchor { + pub fn as_str(self) -> &'static str { + use CreateSubscriptionScheduleDefaultSettingsBillingCycleAnchor::*; + match self { + Automatic => "automatic", + PhaseStart => "phase_start", + } + } +} + +impl std::str::FromStr for CreateSubscriptionScheduleDefaultSettingsBillingCycleAnchor { + type Err = (); + fn from_str(s: &str) -> Result { + use CreateSubscriptionScheduleDefaultSettingsBillingCycleAnchor::*; + match s { + "automatic" => Ok(Automatic), + "phase_start" => Ok(PhaseStart), + _ => Err(()), + } + } +} +impl std::fmt::Display for CreateSubscriptionScheduleDefaultSettingsBillingCycleAnchor { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreateSubscriptionScheduleDefaultSettingsBillingCycleAnchor { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreateSubscriptionScheduleDefaultSettingsBillingCycleAnchor { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Either `charge_automatically`, or `send_invoice`. +/// When charging automatically, Stripe will attempt to pay the underlying subscription at the end of each billing cycle using the default source attached to the customer. +/// When sending an invoice, Stripe will email your customer an invoice with payment instructions and mark the subscription as `active`. +/// Defaults to `charge_automatically` on creation. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreateSubscriptionScheduleDefaultSettingsCollectionMethod { + ChargeAutomatically, + SendInvoice, +} +impl CreateSubscriptionScheduleDefaultSettingsCollectionMethod { + pub fn as_str(self) -> &'static str { + use CreateSubscriptionScheduleDefaultSettingsCollectionMethod::*; + match self { + ChargeAutomatically => "charge_automatically", + SendInvoice => "send_invoice", + } + } +} + +impl std::str::FromStr for CreateSubscriptionScheduleDefaultSettingsCollectionMethod { + type Err = (); + fn from_str(s: &str) -> Result { + use CreateSubscriptionScheduleDefaultSettingsCollectionMethod::*; + match s { + "charge_automatically" => Ok(ChargeAutomatically), + "send_invoice" => Ok(SendInvoice), + _ => Err(()), + } + } +} +impl std::fmt::Display for CreateSubscriptionScheduleDefaultSettingsCollectionMethod { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreateSubscriptionScheduleDefaultSettingsCollectionMethod { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreateSubscriptionScheduleDefaultSettingsCollectionMethod { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// All invoices will be billed using the specified settings. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreateSubscriptionScheduleDefaultSettingsInvoiceSettings<'a> { + /// The account tax IDs associated with the subscription schedule. + /// Will be set on invoices generated by the subscription schedule. + #[serde(skip_serializing_if = "Option::is_none")] + pub account_tax_ids: Option<&'a [&'a str]>, + /// Number of days within which a customer must pay invoices generated by this subscription schedule. + /// This value will be `null` for subscription schedules where `collection_method=charge_automatically`. + #[serde(skip_serializing_if = "Option::is_none")] + pub days_until_due: Option, + /// The connected account that issues the invoice. + /// The invoice is presented with the branding and support information of the specified account. + #[serde(skip_serializing_if = "Option::is_none")] + pub issuer: Option>, +} +impl<'a> CreateSubscriptionScheduleDefaultSettingsInvoiceSettings<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// The connected account that issues the invoice. +/// The invoice is presented with the branding and support information of the specified account. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreateSubscriptionScheduleDefaultSettingsInvoiceSettingsIssuer<'a> { + /// The connected account being referenced when `type` is `account`. + #[serde(skip_serializing_if = "Option::is_none")] + pub account: Option<&'a str>, + /// Type of the account referenced in the request. + #[serde(rename = "type")] + pub type_: CreateSubscriptionScheduleDefaultSettingsInvoiceSettingsIssuerType, +} +impl<'a> CreateSubscriptionScheduleDefaultSettingsInvoiceSettingsIssuer<'a> { + pub fn new(type_: CreateSubscriptionScheduleDefaultSettingsInvoiceSettingsIssuerType) -> Self { + Self { account: None, type_ } + } +} +/// Type of the account referenced in the request. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreateSubscriptionScheduleDefaultSettingsInvoiceSettingsIssuerType { + Account, + Self_, +} +impl CreateSubscriptionScheduleDefaultSettingsInvoiceSettingsIssuerType { + pub fn as_str(self) -> &'static str { + use CreateSubscriptionScheduleDefaultSettingsInvoiceSettingsIssuerType::*; + match self { + Account => "account", + Self_ => "self", + } + } +} + +impl std::str::FromStr for CreateSubscriptionScheduleDefaultSettingsInvoiceSettingsIssuerType { + type Err = (); + fn from_str(s: &str) -> Result { + use CreateSubscriptionScheduleDefaultSettingsInvoiceSettingsIssuerType::*; + match s { + "account" => Ok(Account), + "self" => Ok(Self_), + _ => Err(()), + } + } +} +impl std::fmt::Display for CreateSubscriptionScheduleDefaultSettingsInvoiceSettingsIssuerType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreateSubscriptionScheduleDefaultSettingsInvoiceSettingsIssuerType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreateSubscriptionScheduleDefaultSettingsInvoiceSettingsIssuerType { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// List representing phases of the subscription schedule. +/// Each phase can be customized to have different durations, plans, and coupons. +/// If there are multiple phases, the `end_date` of one phase will always equal the `start_date` of the next phase. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreateSubscriptionSchedulePhases<'a> { + /// A list of prices and quantities that will generate invoice items appended to the next invoice for this phase. + /// You may pass up to 20 items. + #[serde(skip_serializing_if = "Option::is_none")] + pub add_invoice_items: Option<&'a [CreateSubscriptionSchedulePhasesAddInvoiceItems<'a>]>, + /// A non-negative decimal between 0 and 100, with at most two decimal places. + /// This represents the percentage of the subscription invoice total that will be transferred to the application owner's Stripe account. + /// The request must be made by a platform account on a connected account in order to set an application fee percentage. + /// For more information, see the application fees [documentation](https://stripe.com/docs/connect/subscriptions#collecting-fees-on-subscriptions). + #[serde(skip_serializing_if = "Option::is_none")] + pub application_fee_percent: Option, + /// Automatic tax settings for this phase. + #[serde(skip_serializing_if = "Option::is_none")] + pub automatic_tax: Option>, + /// Can be set to `phase_start` to set the anchor to the start of the phase or `automatic` to automatically change it if needed. + /// Cannot be set to `phase_start` if this phase specifies a trial. + /// For more information, see the billing cycle [documentation](https://stripe.com/docs/billing/subscriptions/billing-cycle). + #[serde(skip_serializing_if = "Option::is_none")] + pub billing_cycle_anchor: Option, + /// Define thresholds at which an invoice will be sent, and the subscription advanced to a new billing period. + /// Pass an empty string to remove previously-defined thresholds. + #[serde(skip_serializing_if = "Option::is_none")] + pub billing_thresholds: Option, + /// Either `charge_automatically`, or `send_invoice`. + /// When charging automatically, Stripe will attempt to pay the underlying subscription at the end of each billing cycle using the default source attached to the customer. + /// When sending an invoice, Stripe will email your customer an invoice with payment instructions and mark the subscription as `active`. + /// Defaults to `charge_automatically` on creation. + #[serde(skip_serializing_if = "Option::is_none")] + pub collection_method: Option, + /// The identifier of the coupon to apply to this phase of the subscription schedule. + #[serde(skip_serializing_if = "Option::is_none")] + pub coupon: Option<&'a str>, + /// Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. + /// Must be a [supported currency](https://stripe.com/docs/currencies). + #[serde(skip_serializing_if = "Option::is_none")] + pub currency: Option, + /// ID of the default payment method for the subscription schedule. + /// It must belong to the customer associated with the subscription schedule. + /// If not set, invoices will use the default payment method in the customer's invoice settings. + #[serde(skip_serializing_if = "Option::is_none")] + pub default_payment_method: Option<&'a str>, + /// A list of [Tax Rate](https://stripe.com/docs/api/tax_rates) ids. + /// These Tax Rates will set the Subscription's [`default_tax_rates`](https://stripe.com/docs/api/subscriptions/create#create_subscription-default_tax_rates), which means they will be the Invoice's [`default_tax_rates`](https://stripe.com/docs/api/invoices/create#create_invoice-default_tax_rates) for any Invoices issued by the Subscription during this Phase. + #[serde(skip_serializing_if = "Option::is_none")] + pub default_tax_rates: Option<&'a [&'a str]>, + /// Subscription description, meant to be displayable to the customer. + /// Use this field to optionally store an explanation of the subscription for rendering in Stripe surfaces and certain local payment methods UIs. + #[serde(skip_serializing_if = "Option::is_none")] + pub description: Option<&'a str>, + /// The date at which this phase of the subscription schedule ends. + /// If set, `iterations` must not be set. + #[serde(skip_serializing_if = "Option::is_none")] + pub end_date: Option, + /// All invoices will be billed using the specified settings. + #[serde(skip_serializing_if = "Option::is_none")] + pub invoice_settings: Option>, + /// List of configuration items, each with an attached price, to apply during this phase of the subscription schedule. + pub items: &'a [CreateSubscriptionSchedulePhasesItems<'a>], + /// Integer representing the multiplier applied to the price interval. + /// For example, `iterations=2` applied to a price with `interval=month` and `interval_count=3` results in a phase of duration `2 * 3 months = 6 months`. + /// If set, `end_date` must not be set. + #[serde(skip_serializing_if = "Option::is_none")] + pub iterations: Option, + /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to a phase. + /// Metadata on a schedule's phase will update the underlying subscription's `metadata` when the phase is entered, adding new keys and replacing existing keys in the subscription's `metadata`. + /// Individual keys in the subscription's `metadata` can be unset by posting an empty value to them in the phase's `metadata`. + /// To unset all keys in the subscription's `metadata`, update the subscription directly or unset every key individually from the phase's `metadata`. + #[serde(skip_serializing_if = "Option::is_none")] + pub metadata: Option<&'a std::collections::HashMap>, + /// The account on behalf of which to charge, for each of the associated subscription's invoices. + #[serde(skip_serializing_if = "Option::is_none")] + pub on_behalf_of: Option<&'a str>, + /// Whether the subscription schedule will create [prorations](https://stripe.com/docs/billing/subscriptions/prorations) when transitioning to this phase. + /// The default value is `create_prorations`. + /// This setting controls prorations when a phase is started asynchronously and it is persisted as a field on the phase. + /// It's different from the request-level [proration_behavior](https://stripe.com/docs/api/subscription_schedules/update#update_subscription_schedule-proration_behavior) parameter which controls what happens if the update request affects the billing configuration of the current phase. + #[serde(skip_serializing_if = "Option::is_none")] + pub proration_behavior: Option, + /// The data with which to automatically create a Transfer for each of the associated subscription's invoices. + #[serde(skip_serializing_if = "Option::is_none")] + pub transfer_data: Option>, + /// If set to true the entire phase is counted as a trial and the customer will not be charged for any fees. + #[serde(skip_serializing_if = "Option::is_none")] + pub trial: Option, + /// Sets the phase to trialing from the start date to this date. + /// Must be before the phase end date, can not be combined with `trial`. + #[serde(skip_serializing_if = "Option::is_none")] + pub trial_end: Option, +} +impl<'a> CreateSubscriptionSchedulePhases<'a> { + pub fn new(items: &'a [CreateSubscriptionSchedulePhasesItems<'a>]) -> Self { + Self { + add_invoice_items: None, + application_fee_percent: None, + automatic_tax: None, + billing_cycle_anchor: None, + billing_thresholds: None, + collection_method: None, + coupon: None, + currency: None, + default_payment_method: None, + default_tax_rates: None, + description: None, + end_date: None, + invoice_settings: None, + items, + iterations: None, + metadata: None, + on_behalf_of: None, + proration_behavior: None, + transfer_data: None, + trial: None, + trial_end: None, + } + } +} +/// A list of prices and quantities that will generate invoice items appended to the next invoice for this phase. +/// You may pass up to 20 items. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreateSubscriptionSchedulePhasesAddInvoiceItems<'a> { + /// The ID of the price object. + #[serde(skip_serializing_if = "Option::is_none")] + pub price: Option<&'a str>, + /// Data used to generate a new [Price](https://stripe.com/docs/api/prices) object inline. + #[serde(skip_serializing_if = "Option::is_none")] + pub price_data: Option>, + /// Quantity for this item. Defaults to 1. + #[serde(skip_serializing_if = "Option::is_none")] + pub quantity: Option, + /// The tax rates which apply to the item. When set, the `default_tax_rates` do not apply to this item. + #[serde(skip_serializing_if = "Option::is_none")] + pub tax_rates: Option<&'a [&'a str]>, +} +impl<'a> CreateSubscriptionSchedulePhasesAddInvoiceItems<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// Data used to generate a new [Price](https://stripe.com/docs/api/prices) object inline. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreateSubscriptionSchedulePhasesAddInvoiceItemsPriceData<'a> { + /// Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. + /// Must be a [supported currency](https://stripe.com/docs/currencies). + pub currency: stripe_types::Currency, + /// The ID of the product that this price will belong to. + pub product: &'a str, + /// Only required if a [default tax behavior](https://stripe.com/docs/tax/products-prices-tax-categories-tax-behavior#setting-a-default-tax-behavior-(recommended)) was not provided in the Stripe Tax settings. + /// Specifies whether the price is considered inclusive of taxes or exclusive of taxes. + /// One of `inclusive`, `exclusive`, or `unspecified`. + /// Once specified as either `inclusive` or `exclusive`, it cannot be changed. + #[serde(skip_serializing_if = "Option::is_none")] + pub tax_behavior: Option, + /// A positive integer in cents (or local equivalent) (or 0 for a free price) representing how much to charge. + #[serde(skip_serializing_if = "Option::is_none")] + pub unit_amount: Option, + /// Same as `unit_amount`, but accepts a decimal value in cents (or local equivalent) with at most 12 decimal places. + /// Only one of `unit_amount` and `unit_amount_decimal` can be set. + #[serde(skip_serializing_if = "Option::is_none")] + pub unit_amount_decimal: Option<&'a str>, +} +impl<'a> CreateSubscriptionSchedulePhasesAddInvoiceItemsPriceData<'a> { + pub fn new(currency: stripe_types::Currency, product: &'a str) -> Self { + Self { currency, product, tax_behavior: None, unit_amount: None, unit_amount_decimal: None } + } +} +/// Only required if a [default tax behavior](https://stripe.com/docs/tax/products-prices-tax-categories-tax-behavior#setting-a-default-tax-behavior-(recommended)) was not provided in the Stripe Tax settings. +/// Specifies whether the price is considered inclusive of taxes or exclusive of taxes. +/// One of `inclusive`, `exclusive`, or `unspecified`. +/// Once specified as either `inclusive` or `exclusive`, it cannot be changed. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreateSubscriptionSchedulePhasesAddInvoiceItemsPriceDataTaxBehavior { + Exclusive, + Inclusive, + Unspecified, +} +impl CreateSubscriptionSchedulePhasesAddInvoiceItemsPriceDataTaxBehavior { + pub fn as_str(self) -> &'static str { + use CreateSubscriptionSchedulePhasesAddInvoiceItemsPriceDataTaxBehavior::*; + match self { + Exclusive => "exclusive", + Inclusive => "inclusive", + Unspecified => "unspecified", + } + } +} + +impl std::str::FromStr for CreateSubscriptionSchedulePhasesAddInvoiceItemsPriceDataTaxBehavior { + type Err = (); + fn from_str(s: &str) -> Result { + use CreateSubscriptionSchedulePhasesAddInvoiceItemsPriceDataTaxBehavior::*; + match s { + "exclusive" => Ok(Exclusive), + "inclusive" => Ok(Inclusive), + "unspecified" => Ok(Unspecified), + _ => Err(()), + } + } +} +impl std::fmt::Display for CreateSubscriptionSchedulePhasesAddInvoiceItemsPriceDataTaxBehavior { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreateSubscriptionSchedulePhasesAddInvoiceItemsPriceDataTaxBehavior { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreateSubscriptionSchedulePhasesAddInvoiceItemsPriceDataTaxBehavior { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Automatic tax settings for this phase. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreateSubscriptionSchedulePhasesAutomaticTax<'a> { + /// Enabled automatic tax calculation which will automatically compute tax rates on all invoices generated by the subscription. + pub enabled: bool, + /// The account that's liable for tax. + /// If set, the business address and tax registrations required to perform the tax calculation are loaded from this account. + /// The tax transaction is returned in the report of the connected account. + #[serde(skip_serializing_if = "Option::is_none")] + pub liability: Option>, +} +impl<'a> CreateSubscriptionSchedulePhasesAutomaticTax<'a> { + pub fn new(enabled: bool) -> Self { + Self { enabled, liability: None } + } +} +/// The account that's liable for tax. +/// If set, the business address and tax registrations required to perform the tax calculation are loaded from this account. +/// The tax transaction is returned in the report of the connected account. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreateSubscriptionSchedulePhasesAutomaticTaxLiability<'a> { + /// The connected account being referenced when `type` is `account`. + #[serde(skip_serializing_if = "Option::is_none")] + pub account: Option<&'a str>, + /// Type of the account referenced in the request. + #[serde(rename = "type")] + pub type_: CreateSubscriptionSchedulePhasesAutomaticTaxLiabilityType, +} +impl<'a> CreateSubscriptionSchedulePhasesAutomaticTaxLiability<'a> { + pub fn new(type_: CreateSubscriptionSchedulePhasesAutomaticTaxLiabilityType) -> Self { + Self { account: None, type_ } + } +} +/// Type of the account referenced in the request. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreateSubscriptionSchedulePhasesAutomaticTaxLiabilityType { + Account, + Self_, +} +impl CreateSubscriptionSchedulePhasesAutomaticTaxLiabilityType { + pub fn as_str(self) -> &'static str { + use CreateSubscriptionSchedulePhasesAutomaticTaxLiabilityType::*; + match self { + Account => "account", + Self_ => "self", + } + } +} + +impl std::str::FromStr for CreateSubscriptionSchedulePhasesAutomaticTaxLiabilityType { + type Err = (); + fn from_str(s: &str) -> Result { + use CreateSubscriptionSchedulePhasesAutomaticTaxLiabilityType::*; + match s { + "account" => Ok(Account), + "self" => Ok(Self_), + _ => Err(()), + } + } +} +impl std::fmt::Display for CreateSubscriptionSchedulePhasesAutomaticTaxLiabilityType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreateSubscriptionSchedulePhasesAutomaticTaxLiabilityType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreateSubscriptionSchedulePhasesAutomaticTaxLiabilityType { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Can be set to `phase_start` to set the anchor to the start of the phase or `automatic` to automatically change it if needed. +/// Cannot be set to `phase_start` if this phase specifies a trial. +/// For more information, see the billing cycle [documentation](https://stripe.com/docs/billing/subscriptions/billing-cycle). +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreateSubscriptionSchedulePhasesBillingCycleAnchor { + Automatic, + PhaseStart, +} +impl CreateSubscriptionSchedulePhasesBillingCycleAnchor { + pub fn as_str(self) -> &'static str { + use CreateSubscriptionSchedulePhasesBillingCycleAnchor::*; + match self { + Automatic => "automatic", + PhaseStart => "phase_start", + } + } +} + +impl std::str::FromStr for CreateSubscriptionSchedulePhasesBillingCycleAnchor { + type Err = (); + fn from_str(s: &str) -> Result { + use CreateSubscriptionSchedulePhasesBillingCycleAnchor::*; + match s { + "automatic" => Ok(Automatic), + "phase_start" => Ok(PhaseStart), + _ => Err(()), + } + } +} +impl std::fmt::Display for CreateSubscriptionSchedulePhasesBillingCycleAnchor { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreateSubscriptionSchedulePhasesBillingCycleAnchor { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreateSubscriptionSchedulePhasesBillingCycleAnchor { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Either `charge_automatically`, or `send_invoice`. +/// When charging automatically, Stripe will attempt to pay the underlying subscription at the end of each billing cycle using the default source attached to the customer. +/// When sending an invoice, Stripe will email your customer an invoice with payment instructions and mark the subscription as `active`. +/// Defaults to `charge_automatically` on creation. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreateSubscriptionSchedulePhasesCollectionMethod { + ChargeAutomatically, + SendInvoice, +} +impl CreateSubscriptionSchedulePhasesCollectionMethod { + pub fn as_str(self) -> &'static str { + use CreateSubscriptionSchedulePhasesCollectionMethod::*; + match self { + ChargeAutomatically => "charge_automatically", + SendInvoice => "send_invoice", + } + } +} + +impl std::str::FromStr for CreateSubscriptionSchedulePhasesCollectionMethod { + type Err = (); + fn from_str(s: &str) -> Result { + use CreateSubscriptionSchedulePhasesCollectionMethod::*; + match s { + "charge_automatically" => Ok(ChargeAutomatically), + "send_invoice" => Ok(SendInvoice), + _ => Err(()), + } + } +} +impl std::fmt::Display for CreateSubscriptionSchedulePhasesCollectionMethod { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreateSubscriptionSchedulePhasesCollectionMethod { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreateSubscriptionSchedulePhasesCollectionMethod { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// All invoices will be billed using the specified settings. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreateSubscriptionSchedulePhasesInvoiceSettings<'a> { + /// The account tax IDs associated with this phase of the subscription schedule. + /// Will be set on invoices generated by this phase of the subscription schedule. + #[serde(skip_serializing_if = "Option::is_none")] + pub account_tax_ids: Option<&'a [&'a str]>, + /// Number of days within which a customer must pay invoices generated by this subscription schedule. + /// This value will be `null` for subscription schedules where `billing=charge_automatically`. + #[serde(skip_serializing_if = "Option::is_none")] + pub days_until_due: Option, + /// The connected account that issues the invoice. + /// The invoice is presented with the branding and support information of the specified account. + #[serde(skip_serializing_if = "Option::is_none")] + pub issuer: Option>, +} +impl<'a> CreateSubscriptionSchedulePhasesInvoiceSettings<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// The connected account that issues the invoice. +/// The invoice is presented with the branding and support information of the specified account. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreateSubscriptionSchedulePhasesInvoiceSettingsIssuer<'a> { + /// The connected account being referenced when `type` is `account`. + #[serde(skip_serializing_if = "Option::is_none")] + pub account: Option<&'a str>, + /// Type of the account referenced in the request. + #[serde(rename = "type")] + pub type_: CreateSubscriptionSchedulePhasesInvoiceSettingsIssuerType, +} +impl<'a> CreateSubscriptionSchedulePhasesInvoiceSettingsIssuer<'a> { + pub fn new(type_: CreateSubscriptionSchedulePhasesInvoiceSettingsIssuerType) -> Self { + Self { account: None, type_ } + } +} +/// Type of the account referenced in the request. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreateSubscriptionSchedulePhasesInvoiceSettingsIssuerType { + Account, + Self_, +} +impl CreateSubscriptionSchedulePhasesInvoiceSettingsIssuerType { + pub fn as_str(self) -> &'static str { + use CreateSubscriptionSchedulePhasesInvoiceSettingsIssuerType::*; + match self { + Account => "account", + Self_ => "self", + } + } +} + +impl std::str::FromStr for CreateSubscriptionSchedulePhasesInvoiceSettingsIssuerType { + type Err = (); + fn from_str(s: &str) -> Result { + use CreateSubscriptionSchedulePhasesInvoiceSettingsIssuerType::*; + match s { + "account" => Ok(Account), + "self" => Ok(Self_), + _ => Err(()), + } + } +} +impl std::fmt::Display for CreateSubscriptionSchedulePhasesInvoiceSettingsIssuerType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreateSubscriptionSchedulePhasesInvoiceSettingsIssuerType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreateSubscriptionSchedulePhasesInvoiceSettingsIssuerType { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// List of configuration items, each with an attached price, to apply during this phase of the subscription schedule. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreateSubscriptionSchedulePhasesItems<'a> { + /// Define thresholds at which an invoice will be sent, and the subscription advanced to a new billing period. + /// When updating, pass an empty string to remove previously-defined thresholds. + #[serde(skip_serializing_if = "Option::is_none")] + pub billing_thresholds: Option, + /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to a configuration item. + /// Metadata on a configuration item will update the underlying subscription item's `metadata` when the phase is entered, adding new keys and replacing existing keys. + /// Individual keys in the subscription item's `metadata` can be unset by posting an empty value to them in the configuration item's `metadata`. + /// To unset all keys in the subscription item's `metadata`, update the subscription item directly or unset every key individually from the configuration item's `metadata`. + #[serde(skip_serializing_if = "Option::is_none")] + pub metadata: Option<&'a std::collections::HashMap>, + /// The plan ID to subscribe to. You may specify the same ID in `plan` and `price`. + #[serde(skip_serializing_if = "Option::is_none")] + pub plan: Option<&'a str>, + /// The ID of the price object. + #[serde(skip_serializing_if = "Option::is_none")] + pub price: Option<&'a str>, + /// Data used to generate a new [Price](https://stripe.com/docs/api/prices) object inline. + #[serde(skip_serializing_if = "Option::is_none")] + pub price_data: Option>, + /// Quantity for the given price. + /// Can be set only if the price's `usage_type` is `licensed` and not `metered`. + #[serde(skip_serializing_if = "Option::is_none")] + pub quantity: Option, + /// A list of [Tax Rate](https://stripe.com/docs/api/tax_rates) ids. + /// These Tax Rates will override the [`default_tax_rates`](https://stripe.com/docs/api/subscriptions/create#create_subscription-default_tax_rates) on the Subscription. + /// When updating, pass an empty string to remove previously-defined tax rates. + #[serde(skip_serializing_if = "Option::is_none")] + pub tax_rates: Option<&'a [&'a str]>, +} +impl<'a> CreateSubscriptionSchedulePhasesItems<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// Data used to generate a new [Price](https://stripe.com/docs/api/prices) object inline. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreateSubscriptionSchedulePhasesItemsPriceData<'a> { + /// Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. + /// Must be a [supported currency](https://stripe.com/docs/currencies). + pub currency: stripe_types::Currency, + /// The ID of the product that this price will belong to. + pub product: &'a str, + /// The recurring components of a price such as `interval` and `interval_count`. + pub recurring: CreateSubscriptionSchedulePhasesItemsPriceDataRecurring, + /// Only required if a [default tax behavior](https://stripe.com/docs/tax/products-prices-tax-categories-tax-behavior#setting-a-default-tax-behavior-(recommended)) was not provided in the Stripe Tax settings. + /// Specifies whether the price is considered inclusive of taxes or exclusive of taxes. + /// One of `inclusive`, `exclusive`, or `unspecified`. + /// Once specified as either `inclusive` or `exclusive`, it cannot be changed. + #[serde(skip_serializing_if = "Option::is_none")] + pub tax_behavior: Option, + /// A positive integer in cents (or local equivalent) (or 0 for a free price) representing how much to charge. + #[serde(skip_serializing_if = "Option::is_none")] + pub unit_amount: Option, + /// Same as `unit_amount`, but accepts a decimal value in cents (or local equivalent) with at most 12 decimal places. + /// Only one of `unit_amount` and `unit_amount_decimal` can be set. + #[serde(skip_serializing_if = "Option::is_none")] + pub unit_amount_decimal: Option<&'a str>, +} +impl<'a> CreateSubscriptionSchedulePhasesItemsPriceData<'a> { + pub fn new( + currency: stripe_types::Currency, + product: &'a str, + recurring: CreateSubscriptionSchedulePhasesItemsPriceDataRecurring, + ) -> Self { + Self { + currency, + product, + recurring, + tax_behavior: None, + unit_amount: None, + unit_amount_decimal: None, + } + } +} +/// The recurring components of a price such as `interval` and `interval_count`. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreateSubscriptionSchedulePhasesItemsPriceDataRecurring { + /// Specifies billing frequency. Either `day`, `week`, `month` or `year`. + pub interval: CreateSubscriptionSchedulePhasesItemsPriceDataRecurringInterval, + /// The number of intervals between subscription billings. + /// For example, `interval=month` and `interval_count=3` bills every 3 months. + /// Maximum of three years interval allowed (3 years, 36 months, or 156 weeks). + #[serde(skip_serializing_if = "Option::is_none")] + pub interval_count: Option, +} +impl CreateSubscriptionSchedulePhasesItemsPriceDataRecurring { + pub fn new(interval: CreateSubscriptionSchedulePhasesItemsPriceDataRecurringInterval) -> Self { + Self { interval, interval_count: None } + } +} +/// Specifies billing frequency. Either `day`, `week`, `month` or `year`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreateSubscriptionSchedulePhasesItemsPriceDataRecurringInterval { + Day, + Month, + Week, + Year, +} +impl CreateSubscriptionSchedulePhasesItemsPriceDataRecurringInterval { + pub fn as_str(self) -> &'static str { + use CreateSubscriptionSchedulePhasesItemsPriceDataRecurringInterval::*; + match self { + Day => "day", + Month => "month", + Week => "week", + Year => "year", + } + } +} + +impl std::str::FromStr for CreateSubscriptionSchedulePhasesItemsPriceDataRecurringInterval { + type Err = (); + fn from_str(s: &str) -> Result { + use CreateSubscriptionSchedulePhasesItemsPriceDataRecurringInterval::*; + match s { + "day" => Ok(Day), + "month" => Ok(Month), + "week" => Ok(Week), + "year" => Ok(Year), + _ => Err(()), + } + } +} +impl std::fmt::Display for CreateSubscriptionSchedulePhasesItemsPriceDataRecurringInterval { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreateSubscriptionSchedulePhasesItemsPriceDataRecurringInterval { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreateSubscriptionSchedulePhasesItemsPriceDataRecurringInterval { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Only required if a [default tax behavior](https://stripe.com/docs/tax/products-prices-tax-categories-tax-behavior#setting-a-default-tax-behavior-(recommended)) was not provided in the Stripe Tax settings. +/// Specifies whether the price is considered inclusive of taxes or exclusive of taxes. +/// One of `inclusive`, `exclusive`, or `unspecified`. +/// Once specified as either `inclusive` or `exclusive`, it cannot be changed. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreateSubscriptionSchedulePhasesItemsPriceDataTaxBehavior { + Exclusive, + Inclusive, + Unspecified, +} +impl CreateSubscriptionSchedulePhasesItemsPriceDataTaxBehavior { + pub fn as_str(self) -> &'static str { + use CreateSubscriptionSchedulePhasesItemsPriceDataTaxBehavior::*; + match self { + Exclusive => "exclusive", + Inclusive => "inclusive", + Unspecified => "unspecified", + } + } +} + +impl std::str::FromStr for CreateSubscriptionSchedulePhasesItemsPriceDataTaxBehavior { + type Err = (); + fn from_str(s: &str) -> Result { + use CreateSubscriptionSchedulePhasesItemsPriceDataTaxBehavior::*; + match s { + "exclusive" => Ok(Exclusive), + "inclusive" => Ok(Inclusive), + "unspecified" => Ok(Unspecified), + _ => Err(()), + } + } +} +impl std::fmt::Display for CreateSubscriptionSchedulePhasesItemsPriceDataTaxBehavior { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreateSubscriptionSchedulePhasesItemsPriceDataTaxBehavior { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreateSubscriptionSchedulePhasesItemsPriceDataTaxBehavior { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Whether the subscription schedule will create [prorations](https://stripe.com/docs/billing/subscriptions/prorations) when transitioning to this phase. +/// The default value is `create_prorations`. +/// This setting controls prorations when a phase is started asynchronously and it is persisted as a field on the phase. +/// It's different from the request-level [proration_behavior](https://stripe.com/docs/api/subscription_schedules/update#update_subscription_schedule-proration_behavior) parameter which controls what happens if the update request affects the billing configuration of the current phase. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreateSubscriptionSchedulePhasesProrationBehavior { + AlwaysInvoice, + CreateProrations, + None, +} +impl CreateSubscriptionSchedulePhasesProrationBehavior { + pub fn as_str(self) -> &'static str { + use CreateSubscriptionSchedulePhasesProrationBehavior::*; + match self { + AlwaysInvoice => "always_invoice", + CreateProrations => "create_prorations", + None => "none", + } + } +} + +impl std::str::FromStr for CreateSubscriptionSchedulePhasesProrationBehavior { + type Err = (); + fn from_str(s: &str) -> Result { + use CreateSubscriptionSchedulePhasesProrationBehavior::*; + match s { + "always_invoice" => Ok(AlwaysInvoice), + "create_prorations" => Ok(CreateProrations), + "none" => Ok(None), + _ => Err(()), + } + } +} +impl std::fmt::Display for CreateSubscriptionSchedulePhasesProrationBehavior { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreateSubscriptionSchedulePhasesProrationBehavior { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreateSubscriptionSchedulePhasesProrationBehavior { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// When the subscription schedule starts. +/// We recommend using `now` so that it starts the subscription immediately. +/// You can also use a Unix timestamp to backdate the subscription so that it starts on a past date, or set a future date for the subscription to start on. +#[derive(Copy, Clone, Debug, serde::Serialize)] +#[serde(untagged)] +pub enum CreateSubscriptionScheduleStartDate { + Timestamp(stripe_types::Timestamp), + Now, +} +impl<'a> CreateSubscriptionSchedule<'a> { + /// Creates a new subscription schedule object. + /// Each customer can have up to 500 active or scheduled subscriptions. + pub fn send( + &self, + client: &stripe::Client, + ) -> stripe::Response { + client.send_form("/subscription_schedules", self, http_types::Method::Post) + } +} +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdateSubscriptionSchedule<'a> { + /// Object representing the subscription schedule's default settings. + #[serde(skip_serializing_if = "Option::is_none")] + pub default_settings: Option>, + /// Behavior of the subscription schedule and underlying subscription when it ends. + /// Possible values are `release` or `cancel` with the default being `release`. + /// `release` will end the subscription schedule and keep the underlying subscription running. + /// `cancel` will end the subscription schedule and cancel the underlying subscription. + #[serde(skip_serializing_if = "Option::is_none")] + pub end_behavior: Option, + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, + /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. + /// This can be useful for storing additional information about the object in a structured format. + /// Individual keys can be unset by posting an empty value to them. + /// All keys can be unset by posting an empty value to `metadata`. + #[serde(skip_serializing_if = "Option::is_none")] + pub metadata: Option<&'a std::collections::HashMap>, + /// List representing phases of the subscription schedule. + /// Each phase can be customized to have different durations, plans, and coupons. + /// If there are multiple phases, the `end_date` of one phase will always equal the `start_date` of the next phase. + /// Note that past phases can be omitted. + #[serde(skip_serializing_if = "Option::is_none")] + pub phases: Option<&'a [UpdateSubscriptionSchedulePhases<'a>]>, + /// If the update changes the current phase, indicates whether the changes should be prorated. + /// The default value is `create_prorations`. + #[serde(skip_serializing_if = "Option::is_none")] + pub proration_behavior: Option, +} +impl<'a> UpdateSubscriptionSchedule<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// Object representing the subscription schedule's default settings. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdateSubscriptionScheduleDefaultSettings<'a> { + /// A non-negative decimal between 0 and 100, with at most two decimal places. + /// This represents the percentage of the subscription invoice total that will be transferred to the application owner's Stripe account. + /// The request must be made by a platform account on a connected account in order to set an application fee percentage. + /// For more information, see the application fees [documentation](https://stripe.com/docs/connect/subscriptions#collecting-fees-on-subscriptions). + #[serde(skip_serializing_if = "Option::is_none")] + pub application_fee_percent: Option, + /// Default settings for automatic tax computation. + #[serde(skip_serializing_if = "Option::is_none")] + pub automatic_tax: Option>, + /// Can be set to `phase_start` to set the anchor to the start of the phase or `automatic` to automatically change it if needed. + /// Cannot be set to `phase_start` if this phase specifies a trial. + /// For more information, see the billing cycle [documentation](https://stripe.com/docs/billing/subscriptions/billing-cycle). + #[serde(skip_serializing_if = "Option::is_none")] + pub billing_cycle_anchor: Option, + /// Define thresholds at which an invoice will be sent, and the subscription advanced to a new billing period. + /// Pass an empty string to remove previously-defined thresholds. + #[serde(skip_serializing_if = "Option::is_none")] + pub billing_thresholds: Option, + /// Either `charge_automatically`, or `send_invoice`. + /// When charging automatically, Stripe will attempt to pay the underlying subscription at the end of each billing cycle using the default source attached to the customer. + /// When sending an invoice, Stripe will email your customer an invoice with payment instructions and mark the subscription as `active`. + /// Defaults to `charge_automatically` on creation. + #[serde(skip_serializing_if = "Option::is_none")] + pub collection_method: Option, + /// ID of the default payment method for the subscription schedule. + /// It must belong to the customer associated with the subscription schedule. + /// If not set, invoices will use the default payment method in the customer's invoice settings. + #[serde(skip_serializing_if = "Option::is_none")] + pub default_payment_method: Option<&'a str>, + /// Subscription description, meant to be displayable to the customer. + /// Use this field to optionally store an explanation of the subscription for rendering in Stripe surfaces and certain local payment methods UIs. + #[serde(skip_serializing_if = "Option::is_none")] + pub description: Option<&'a str>, + /// All invoices will be billed using the specified settings. + #[serde(skip_serializing_if = "Option::is_none")] + pub invoice_settings: Option>, + /// The account on behalf of which to charge, for each of the associated subscription's invoices. + #[serde(skip_serializing_if = "Option::is_none")] + pub on_behalf_of: Option<&'a str>, + /// The data with which to automatically create a Transfer for each of the associated subscription's invoices. + #[serde(skip_serializing_if = "Option::is_none")] + pub transfer_data: Option>, +} +impl<'a> UpdateSubscriptionScheduleDefaultSettings<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// Default settings for automatic tax computation. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct UpdateSubscriptionScheduleDefaultSettingsAutomaticTax<'a> { + /// Enabled automatic tax calculation which will automatically compute tax rates on all invoices generated by the subscription. + pub enabled: bool, + /// The account that's liable for tax. + /// If set, the business address and tax registrations required to perform the tax calculation are loaded from this account. + /// The tax transaction is returned in the report of the connected account. + #[serde(skip_serializing_if = "Option::is_none")] + pub liability: Option>, +} +impl<'a> UpdateSubscriptionScheduleDefaultSettingsAutomaticTax<'a> { + pub fn new(enabled: bool) -> Self { + Self { enabled, liability: None } + } +} +/// The account that's liable for tax. +/// If set, the business address and tax registrations required to perform the tax calculation are loaded from this account. +/// The tax transaction is returned in the report of the connected account. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct UpdateSubscriptionScheduleDefaultSettingsAutomaticTaxLiability<'a> { + /// The connected account being referenced when `type` is `account`. + #[serde(skip_serializing_if = "Option::is_none")] + pub account: Option<&'a str>, + /// Type of the account referenced in the request. + #[serde(rename = "type")] + pub type_: UpdateSubscriptionScheduleDefaultSettingsAutomaticTaxLiabilityType, +} +impl<'a> UpdateSubscriptionScheduleDefaultSettingsAutomaticTaxLiability<'a> { + pub fn new(type_: UpdateSubscriptionScheduleDefaultSettingsAutomaticTaxLiabilityType) -> Self { + Self { account: None, type_ } + } +} +/// Type of the account referenced in the request. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum UpdateSubscriptionScheduleDefaultSettingsAutomaticTaxLiabilityType { + Account, + Self_, +} +impl UpdateSubscriptionScheduleDefaultSettingsAutomaticTaxLiabilityType { + pub fn as_str(self) -> &'static str { + use UpdateSubscriptionScheduleDefaultSettingsAutomaticTaxLiabilityType::*; + match self { + Account => "account", + Self_ => "self", + } + } +} + +impl std::str::FromStr for UpdateSubscriptionScheduleDefaultSettingsAutomaticTaxLiabilityType { + type Err = (); + fn from_str(s: &str) -> Result { + use UpdateSubscriptionScheduleDefaultSettingsAutomaticTaxLiabilityType::*; + match s { + "account" => Ok(Account), + "self" => Ok(Self_), + _ => Err(()), + } + } +} +impl std::fmt::Display for UpdateSubscriptionScheduleDefaultSettingsAutomaticTaxLiabilityType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for UpdateSubscriptionScheduleDefaultSettingsAutomaticTaxLiabilityType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for UpdateSubscriptionScheduleDefaultSettingsAutomaticTaxLiabilityType { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Can be set to `phase_start` to set the anchor to the start of the phase or `automatic` to automatically change it if needed. +/// Cannot be set to `phase_start` if this phase specifies a trial. +/// For more information, see the billing cycle [documentation](https://stripe.com/docs/billing/subscriptions/billing-cycle). +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum UpdateSubscriptionScheduleDefaultSettingsBillingCycleAnchor { + Automatic, + PhaseStart, +} +impl UpdateSubscriptionScheduleDefaultSettingsBillingCycleAnchor { + pub fn as_str(self) -> &'static str { + use UpdateSubscriptionScheduleDefaultSettingsBillingCycleAnchor::*; + match self { + Automatic => "automatic", + PhaseStart => "phase_start", + } + } +} + +impl std::str::FromStr for UpdateSubscriptionScheduleDefaultSettingsBillingCycleAnchor { + type Err = (); + fn from_str(s: &str) -> Result { + use UpdateSubscriptionScheduleDefaultSettingsBillingCycleAnchor::*; + match s { + "automatic" => Ok(Automatic), + "phase_start" => Ok(PhaseStart), + _ => Err(()), + } + } +} +impl std::fmt::Display for UpdateSubscriptionScheduleDefaultSettingsBillingCycleAnchor { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for UpdateSubscriptionScheduleDefaultSettingsBillingCycleAnchor { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for UpdateSubscriptionScheduleDefaultSettingsBillingCycleAnchor { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Either `charge_automatically`, or `send_invoice`. +/// When charging automatically, Stripe will attempt to pay the underlying subscription at the end of each billing cycle using the default source attached to the customer. +/// When sending an invoice, Stripe will email your customer an invoice with payment instructions and mark the subscription as `active`. +/// Defaults to `charge_automatically` on creation. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum UpdateSubscriptionScheduleDefaultSettingsCollectionMethod { + ChargeAutomatically, + SendInvoice, +} +impl UpdateSubscriptionScheduleDefaultSettingsCollectionMethod { + pub fn as_str(self) -> &'static str { + use UpdateSubscriptionScheduleDefaultSettingsCollectionMethod::*; + match self { + ChargeAutomatically => "charge_automatically", + SendInvoice => "send_invoice", + } + } +} + +impl std::str::FromStr for UpdateSubscriptionScheduleDefaultSettingsCollectionMethod { + type Err = (); + fn from_str(s: &str) -> Result { + use UpdateSubscriptionScheduleDefaultSettingsCollectionMethod::*; + match s { + "charge_automatically" => Ok(ChargeAutomatically), + "send_invoice" => Ok(SendInvoice), + _ => Err(()), + } + } +} +impl std::fmt::Display for UpdateSubscriptionScheduleDefaultSettingsCollectionMethod { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for UpdateSubscriptionScheduleDefaultSettingsCollectionMethod { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for UpdateSubscriptionScheduleDefaultSettingsCollectionMethod { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// All invoices will be billed using the specified settings. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdateSubscriptionScheduleDefaultSettingsInvoiceSettings<'a> { + /// The account tax IDs associated with the subscription schedule. + /// Will be set on invoices generated by the subscription schedule. + #[serde(skip_serializing_if = "Option::is_none")] + pub account_tax_ids: Option<&'a [&'a str]>, + /// Number of days within which a customer must pay invoices generated by this subscription schedule. + /// This value will be `null` for subscription schedules where `collection_method=charge_automatically`. + #[serde(skip_serializing_if = "Option::is_none")] + pub days_until_due: Option, + /// The connected account that issues the invoice. + /// The invoice is presented with the branding and support information of the specified account. + #[serde(skip_serializing_if = "Option::is_none")] + pub issuer: Option>, +} +impl<'a> UpdateSubscriptionScheduleDefaultSettingsInvoiceSettings<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// The connected account that issues the invoice. +/// The invoice is presented with the branding and support information of the specified account. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct UpdateSubscriptionScheduleDefaultSettingsInvoiceSettingsIssuer<'a> { + /// The connected account being referenced when `type` is `account`. + #[serde(skip_serializing_if = "Option::is_none")] + pub account: Option<&'a str>, + /// Type of the account referenced in the request. + #[serde(rename = "type")] + pub type_: UpdateSubscriptionScheduleDefaultSettingsInvoiceSettingsIssuerType, +} +impl<'a> UpdateSubscriptionScheduleDefaultSettingsInvoiceSettingsIssuer<'a> { + pub fn new(type_: UpdateSubscriptionScheduleDefaultSettingsInvoiceSettingsIssuerType) -> Self { + Self { account: None, type_ } + } +} +/// Type of the account referenced in the request. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum UpdateSubscriptionScheduleDefaultSettingsInvoiceSettingsIssuerType { + Account, + Self_, +} +impl UpdateSubscriptionScheduleDefaultSettingsInvoiceSettingsIssuerType { + pub fn as_str(self) -> &'static str { + use UpdateSubscriptionScheduleDefaultSettingsInvoiceSettingsIssuerType::*; + match self { + Account => "account", + Self_ => "self", + } + } +} + +impl std::str::FromStr for UpdateSubscriptionScheduleDefaultSettingsInvoiceSettingsIssuerType { + type Err = (); + fn from_str(s: &str) -> Result { + use UpdateSubscriptionScheduleDefaultSettingsInvoiceSettingsIssuerType::*; + match s { + "account" => Ok(Account), + "self" => Ok(Self_), + _ => Err(()), + } + } +} +impl std::fmt::Display for UpdateSubscriptionScheduleDefaultSettingsInvoiceSettingsIssuerType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for UpdateSubscriptionScheduleDefaultSettingsInvoiceSettingsIssuerType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for UpdateSubscriptionScheduleDefaultSettingsInvoiceSettingsIssuerType { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// List representing phases of the subscription schedule. +/// Each phase can be customized to have different durations, plans, and coupons. +/// If there are multiple phases, the `end_date` of one phase will always equal the `start_date` of the next phase. +/// Note that past phases can be omitted. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct UpdateSubscriptionSchedulePhases<'a> { + /// A list of prices and quantities that will generate invoice items appended to the next invoice for this phase. + /// You may pass up to 20 items. + #[serde(skip_serializing_if = "Option::is_none")] + pub add_invoice_items: Option<&'a [UpdateSubscriptionSchedulePhasesAddInvoiceItems<'a>]>, + /// A non-negative decimal between 0 and 100, with at most two decimal places. + /// This represents the percentage of the subscription invoice total that will be transferred to the application owner's Stripe account. + /// The request must be made by a platform account on a connected account in order to set an application fee percentage. + /// For more information, see the application fees [documentation](https://stripe.com/docs/connect/subscriptions#collecting-fees-on-subscriptions). + #[serde(skip_serializing_if = "Option::is_none")] + pub application_fee_percent: Option, + /// Automatic tax settings for this phase. + #[serde(skip_serializing_if = "Option::is_none")] + pub automatic_tax: Option>, + /// Can be set to `phase_start` to set the anchor to the start of the phase or `automatic` to automatically change it if needed. + /// Cannot be set to `phase_start` if this phase specifies a trial. + /// For more information, see the billing cycle [documentation](https://stripe.com/docs/billing/subscriptions/billing-cycle). + #[serde(skip_serializing_if = "Option::is_none")] + pub billing_cycle_anchor: Option, + /// Define thresholds at which an invoice will be sent, and the subscription advanced to a new billing period. + /// Pass an empty string to remove previously-defined thresholds. + #[serde(skip_serializing_if = "Option::is_none")] + pub billing_thresholds: Option, + /// Either `charge_automatically`, or `send_invoice`. + /// When charging automatically, Stripe will attempt to pay the underlying subscription at the end of each billing cycle using the default source attached to the customer. + /// When sending an invoice, Stripe will email your customer an invoice with payment instructions and mark the subscription as `active`. + /// Defaults to `charge_automatically` on creation. + #[serde(skip_serializing_if = "Option::is_none")] + pub collection_method: Option, + /// The identifier of the coupon to apply to this phase of the subscription schedule. + #[serde(skip_serializing_if = "Option::is_none")] + pub coupon: Option<&'a str>, + /// Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. + /// Must be a [supported currency](https://stripe.com/docs/currencies). + #[serde(skip_serializing_if = "Option::is_none")] + pub currency: Option, + /// ID of the default payment method for the subscription schedule. + /// It must belong to the customer associated with the subscription schedule. + /// If not set, invoices will use the default payment method in the customer's invoice settings. + #[serde(skip_serializing_if = "Option::is_none")] + pub default_payment_method: Option<&'a str>, + /// A list of [Tax Rate](https://stripe.com/docs/api/tax_rates) ids. + /// These Tax Rates will set the Subscription's [`default_tax_rates`](https://stripe.com/docs/api/subscriptions/create#create_subscription-default_tax_rates), which means they will be the Invoice's [`default_tax_rates`](https://stripe.com/docs/api/invoices/create#create_invoice-default_tax_rates) for any Invoices issued by the Subscription during this Phase. + #[serde(skip_serializing_if = "Option::is_none")] + pub default_tax_rates: Option<&'a [&'a str]>, + /// Subscription description, meant to be displayable to the customer. + /// Use this field to optionally store an explanation of the subscription for rendering in Stripe surfaces and certain local payment methods UIs. + #[serde(skip_serializing_if = "Option::is_none")] + pub description: Option<&'a str>, + /// The date at which this phase of the subscription schedule ends. + /// If set, `iterations` must not be set. + #[serde(skip_serializing_if = "Option::is_none")] + pub end_date: Option, + /// All invoices will be billed using the specified settings. + #[serde(skip_serializing_if = "Option::is_none")] + pub invoice_settings: Option>, + /// List of configuration items, each with an attached price, to apply during this phase of the subscription schedule. + pub items: &'a [UpdateSubscriptionSchedulePhasesItems<'a>], + /// Integer representing the multiplier applied to the price interval. + /// For example, `iterations=2` applied to a price with `interval=month` and `interval_count=3` results in a phase of duration `2 * 3 months = 6 months`. + /// If set, `end_date` must not be set. + #[serde(skip_serializing_if = "Option::is_none")] + pub iterations: Option, + /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to a phase. + /// Metadata on a schedule's phase will update the underlying subscription's `metadata` when the phase is entered, adding new keys and replacing existing keys in the subscription's `metadata`. + /// Individual keys in the subscription's `metadata` can be unset by posting an empty value to them in the phase's `metadata`. + /// To unset all keys in the subscription's `metadata`, update the subscription directly or unset every key individually from the phase's `metadata`. + #[serde(skip_serializing_if = "Option::is_none")] + pub metadata: Option<&'a std::collections::HashMap>, + /// The account on behalf of which to charge, for each of the associated subscription's invoices. + #[serde(skip_serializing_if = "Option::is_none")] + pub on_behalf_of: Option<&'a str>, + /// Whether the subscription schedule will create [prorations](https://stripe.com/docs/billing/subscriptions/prorations) when transitioning to this phase. + /// The default value is `create_prorations`. + /// This setting controls prorations when a phase is started asynchronously and it is persisted as a field on the phase. + /// It's different from the request-level [proration_behavior](https://stripe.com/docs/api/subscription_schedules/update#update_subscription_schedule-proration_behavior) parameter which controls what happens if the update request affects the billing configuration of the current phase. + #[serde(skip_serializing_if = "Option::is_none")] + pub proration_behavior: Option, + /// The date at which this phase of the subscription schedule starts or `now`. + /// Must be set on the first phase. + #[serde(skip_serializing_if = "Option::is_none")] + pub start_date: Option, + /// The data with which to automatically create a Transfer for each of the associated subscription's invoices. + #[serde(skip_serializing_if = "Option::is_none")] + pub transfer_data: Option>, + /// If set to true the entire phase is counted as a trial and the customer will not be charged for any fees. + #[serde(skip_serializing_if = "Option::is_none")] + pub trial: Option, + /// Sets the phase to trialing from the start date to this date. + /// Must be before the phase end date, can not be combined with `trial`. + #[serde(skip_serializing_if = "Option::is_none")] + pub trial_end: Option, +} +impl<'a> UpdateSubscriptionSchedulePhases<'a> { + pub fn new(items: &'a [UpdateSubscriptionSchedulePhasesItems<'a>]) -> Self { + Self { + add_invoice_items: None, + application_fee_percent: None, + automatic_tax: None, + billing_cycle_anchor: None, + billing_thresholds: None, + collection_method: None, + coupon: None, + currency: None, + default_payment_method: None, + default_tax_rates: None, + description: None, + end_date: None, + invoice_settings: None, + items, + iterations: None, + metadata: None, + on_behalf_of: None, + proration_behavior: None, + start_date: None, + transfer_data: None, + trial: None, + trial_end: None, + } + } +} +/// A list of prices and quantities that will generate invoice items appended to the next invoice for this phase. +/// You may pass up to 20 items. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdateSubscriptionSchedulePhasesAddInvoiceItems<'a> { + /// The ID of the price object. + #[serde(skip_serializing_if = "Option::is_none")] + pub price: Option<&'a str>, + /// Data used to generate a new [Price](https://stripe.com/docs/api/prices) object inline. + #[serde(skip_serializing_if = "Option::is_none")] + pub price_data: Option>, + /// Quantity for this item. Defaults to 1. + #[serde(skip_serializing_if = "Option::is_none")] + pub quantity: Option, + /// The tax rates which apply to the item. When set, the `default_tax_rates` do not apply to this item. + #[serde(skip_serializing_if = "Option::is_none")] + pub tax_rates: Option<&'a [&'a str]>, +} +impl<'a> UpdateSubscriptionSchedulePhasesAddInvoiceItems<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// Data used to generate a new [Price](https://stripe.com/docs/api/prices) object inline. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct UpdateSubscriptionSchedulePhasesAddInvoiceItemsPriceData<'a> { + /// Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. + /// Must be a [supported currency](https://stripe.com/docs/currencies). + pub currency: stripe_types::Currency, + /// The ID of the product that this price will belong to. + pub product: &'a str, + /// Only required if a [default tax behavior](https://stripe.com/docs/tax/products-prices-tax-categories-tax-behavior#setting-a-default-tax-behavior-(recommended)) was not provided in the Stripe Tax settings. + /// Specifies whether the price is considered inclusive of taxes or exclusive of taxes. + /// One of `inclusive`, `exclusive`, or `unspecified`. + /// Once specified as either `inclusive` or `exclusive`, it cannot be changed. + #[serde(skip_serializing_if = "Option::is_none")] + pub tax_behavior: Option, + /// A positive integer in cents (or local equivalent) (or 0 for a free price) representing how much to charge. + #[serde(skip_serializing_if = "Option::is_none")] + pub unit_amount: Option, + /// Same as `unit_amount`, but accepts a decimal value in cents (or local equivalent) with at most 12 decimal places. + /// Only one of `unit_amount` and `unit_amount_decimal` can be set. + #[serde(skip_serializing_if = "Option::is_none")] + pub unit_amount_decimal: Option<&'a str>, +} +impl<'a> UpdateSubscriptionSchedulePhasesAddInvoiceItemsPriceData<'a> { + pub fn new(currency: stripe_types::Currency, product: &'a str) -> Self { + Self { currency, product, tax_behavior: None, unit_amount: None, unit_amount_decimal: None } + } +} +/// Only required if a [default tax behavior](https://stripe.com/docs/tax/products-prices-tax-categories-tax-behavior#setting-a-default-tax-behavior-(recommended)) was not provided in the Stripe Tax settings. +/// Specifies whether the price is considered inclusive of taxes or exclusive of taxes. +/// One of `inclusive`, `exclusive`, or `unspecified`. +/// Once specified as either `inclusive` or `exclusive`, it cannot be changed. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum UpdateSubscriptionSchedulePhasesAddInvoiceItemsPriceDataTaxBehavior { + Exclusive, + Inclusive, + Unspecified, +} +impl UpdateSubscriptionSchedulePhasesAddInvoiceItemsPriceDataTaxBehavior { + pub fn as_str(self) -> &'static str { + use UpdateSubscriptionSchedulePhasesAddInvoiceItemsPriceDataTaxBehavior::*; + match self { + Exclusive => "exclusive", + Inclusive => "inclusive", + Unspecified => "unspecified", + } + } +} + +impl std::str::FromStr for UpdateSubscriptionSchedulePhasesAddInvoiceItemsPriceDataTaxBehavior { + type Err = (); + fn from_str(s: &str) -> Result { + use UpdateSubscriptionSchedulePhasesAddInvoiceItemsPriceDataTaxBehavior::*; + match s { + "exclusive" => Ok(Exclusive), + "inclusive" => Ok(Inclusive), + "unspecified" => Ok(Unspecified), + _ => Err(()), + } + } +} +impl std::fmt::Display for UpdateSubscriptionSchedulePhasesAddInvoiceItemsPriceDataTaxBehavior { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for UpdateSubscriptionSchedulePhasesAddInvoiceItemsPriceDataTaxBehavior { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for UpdateSubscriptionSchedulePhasesAddInvoiceItemsPriceDataTaxBehavior { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Automatic tax settings for this phase. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct UpdateSubscriptionSchedulePhasesAutomaticTax<'a> { + /// Enabled automatic tax calculation which will automatically compute tax rates on all invoices generated by the subscription. + pub enabled: bool, + /// The account that's liable for tax. + /// If set, the business address and tax registrations required to perform the tax calculation are loaded from this account. + /// The tax transaction is returned in the report of the connected account. + #[serde(skip_serializing_if = "Option::is_none")] + pub liability: Option>, +} +impl<'a> UpdateSubscriptionSchedulePhasesAutomaticTax<'a> { + pub fn new(enabled: bool) -> Self { + Self { enabled, liability: None } + } +} +/// The account that's liable for tax. +/// If set, the business address and tax registrations required to perform the tax calculation are loaded from this account. +/// The tax transaction is returned in the report of the connected account. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct UpdateSubscriptionSchedulePhasesAutomaticTaxLiability<'a> { + /// The connected account being referenced when `type` is `account`. + #[serde(skip_serializing_if = "Option::is_none")] + pub account: Option<&'a str>, + /// Type of the account referenced in the request. + #[serde(rename = "type")] + pub type_: UpdateSubscriptionSchedulePhasesAutomaticTaxLiabilityType, +} +impl<'a> UpdateSubscriptionSchedulePhasesAutomaticTaxLiability<'a> { + pub fn new(type_: UpdateSubscriptionSchedulePhasesAutomaticTaxLiabilityType) -> Self { + Self { account: None, type_ } + } +} +/// Type of the account referenced in the request. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum UpdateSubscriptionSchedulePhasesAutomaticTaxLiabilityType { + Account, + Self_, +} +impl UpdateSubscriptionSchedulePhasesAutomaticTaxLiabilityType { + pub fn as_str(self) -> &'static str { + use UpdateSubscriptionSchedulePhasesAutomaticTaxLiabilityType::*; + match self { + Account => "account", + Self_ => "self", + } + } +} + +impl std::str::FromStr for UpdateSubscriptionSchedulePhasesAutomaticTaxLiabilityType { + type Err = (); + fn from_str(s: &str) -> Result { + use UpdateSubscriptionSchedulePhasesAutomaticTaxLiabilityType::*; + match s { + "account" => Ok(Account), + "self" => Ok(Self_), + _ => Err(()), + } + } +} +impl std::fmt::Display for UpdateSubscriptionSchedulePhasesAutomaticTaxLiabilityType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for UpdateSubscriptionSchedulePhasesAutomaticTaxLiabilityType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for UpdateSubscriptionSchedulePhasesAutomaticTaxLiabilityType { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Can be set to `phase_start` to set the anchor to the start of the phase or `automatic` to automatically change it if needed. +/// Cannot be set to `phase_start` if this phase specifies a trial. +/// For more information, see the billing cycle [documentation](https://stripe.com/docs/billing/subscriptions/billing-cycle). +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum UpdateSubscriptionSchedulePhasesBillingCycleAnchor { + Automatic, + PhaseStart, +} +impl UpdateSubscriptionSchedulePhasesBillingCycleAnchor { + pub fn as_str(self) -> &'static str { + use UpdateSubscriptionSchedulePhasesBillingCycleAnchor::*; + match self { + Automatic => "automatic", + PhaseStart => "phase_start", + } + } +} + +impl std::str::FromStr for UpdateSubscriptionSchedulePhasesBillingCycleAnchor { + type Err = (); + fn from_str(s: &str) -> Result { + use UpdateSubscriptionSchedulePhasesBillingCycleAnchor::*; + match s { + "automatic" => Ok(Automatic), + "phase_start" => Ok(PhaseStart), + _ => Err(()), + } + } +} +impl std::fmt::Display for UpdateSubscriptionSchedulePhasesBillingCycleAnchor { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for UpdateSubscriptionSchedulePhasesBillingCycleAnchor { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for UpdateSubscriptionSchedulePhasesBillingCycleAnchor { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Either `charge_automatically`, or `send_invoice`. +/// When charging automatically, Stripe will attempt to pay the underlying subscription at the end of each billing cycle using the default source attached to the customer. +/// When sending an invoice, Stripe will email your customer an invoice with payment instructions and mark the subscription as `active`. +/// Defaults to `charge_automatically` on creation. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum UpdateSubscriptionSchedulePhasesCollectionMethod { + ChargeAutomatically, + SendInvoice, +} +impl UpdateSubscriptionSchedulePhasesCollectionMethod { + pub fn as_str(self) -> &'static str { + use UpdateSubscriptionSchedulePhasesCollectionMethod::*; + match self { + ChargeAutomatically => "charge_automatically", + SendInvoice => "send_invoice", + } + } +} + +impl std::str::FromStr for UpdateSubscriptionSchedulePhasesCollectionMethod { + type Err = (); + fn from_str(s: &str) -> Result { + use UpdateSubscriptionSchedulePhasesCollectionMethod::*; + match s { + "charge_automatically" => Ok(ChargeAutomatically), + "send_invoice" => Ok(SendInvoice), + _ => Err(()), + } + } +} +impl std::fmt::Display for UpdateSubscriptionSchedulePhasesCollectionMethod { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for UpdateSubscriptionSchedulePhasesCollectionMethod { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for UpdateSubscriptionSchedulePhasesCollectionMethod { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// The date at which this phase of the subscription schedule ends. +/// If set, `iterations` must not be set. +#[derive(Copy, Clone, Debug, serde::Serialize)] +#[serde(untagged)] +pub enum UpdateSubscriptionSchedulePhasesEndDate { + Timestamp(stripe_types::Timestamp), + Now, +} +/// All invoices will be billed using the specified settings. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdateSubscriptionSchedulePhasesInvoiceSettings<'a> { + /// The account tax IDs associated with this phase of the subscription schedule. + /// Will be set on invoices generated by this phase of the subscription schedule. + #[serde(skip_serializing_if = "Option::is_none")] + pub account_tax_ids: Option<&'a [&'a str]>, + /// Number of days within which a customer must pay invoices generated by this subscription schedule. + /// This value will be `null` for subscription schedules where `billing=charge_automatically`. + #[serde(skip_serializing_if = "Option::is_none")] + pub days_until_due: Option, + /// The connected account that issues the invoice. + /// The invoice is presented with the branding and support information of the specified account. + #[serde(skip_serializing_if = "Option::is_none")] + pub issuer: Option>, +} +impl<'a> UpdateSubscriptionSchedulePhasesInvoiceSettings<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// The connected account that issues the invoice. +/// The invoice is presented with the branding and support information of the specified account. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct UpdateSubscriptionSchedulePhasesInvoiceSettingsIssuer<'a> { + /// The connected account being referenced when `type` is `account`. + #[serde(skip_serializing_if = "Option::is_none")] + pub account: Option<&'a str>, + /// Type of the account referenced in the request. + #[serde(rename = "type")] + pub type_: UpdateSubscriptionSchedulePhasesInvoiceSettingsIssuerType, +} +impl<'a> UpdateSubscriptionSchedulePhasesInvoiceSettingsIssuer<'a> { + pub fn new(type_: UpdateSubscriptionSchedulePhasesInvoiceSettingsIssuerType) -> Self { + Self { account: None, type_ } + } +} +/// Type of the account referenced in the request. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum UpdateSubscriptionSchedulePhasesInvoiceSettingsIssuerType { + Account, + Self_, +} +impl UpdateSubscriptionSchedulePhasesInvoiceSettingsIssuerType { + pub fn as_str(self) -> &'static str { + use UpdateSubscriptionSchedulePhasesInvoiceSettingsIssuerType::*; + match self { + Account => "account", + Self_ => "self", + } + } +} + +impl std::str::FromStr for UpdateSubscriptionSchedulePhasesInvoiceSettingsIssuerType { + type Err = (); + fn from_str(s: &str) -> Result { + use UpdateSubscriptionSchedulePhasesInvoiceSettingsIssuerType::*; + match s { + "account" => Ok(Account), + "self" => Ok(Self_), + _ => Err(()), + } + } +} +impl std::fmt::Display for UpdateSubscriptionSchedulePhasesInvoiceSettingsIssuerType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for UpdateSubscriptionSchedulePhasesInvoiceSettingsIssuerType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for UpdateSubscriptionSchedulePhasesInvoiceSettingsIssuerType { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// List of configuration items, each with an attached price, to apply during this phase of the subscription schedule. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdateSubscriptionSchedulePhasesItems<'a> { + /// Define thresholds at which an invoice will be sent, and the subscription advanced to a new billing period. + /// When updating, pass an empty string to remove previously-defined thresholds. + #[serde(skip_serializing_if = "Option::is_none")] + pub billing_thresholds: Option, + /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to a configuration item. + /// Metadata on a configuration item will update the underlying subscription item's `metadata` when the phase is entered, adding new keys and replacing existing keys. + /// Individual keys in the subscription item's `metadata` can be unset by posting an empty value to them in the configuration item's `metadata`. + /// To unset all keys in the subscription item's `metadata`, update the subscription item directly or unset every key individually from the configuration item's `metadata`. + #[serde(skip_serializing_if = "Option::is_none")] + pub metadata: Option<&'a std::collections::HashMap>, + /// The plan ID to subscribe to. You may specify the same ID in `plan` and `price`. + #[serde(skip_serializing_if = "Option::is_none")] + pub plan: Option<&'a str>, + /// The ID of the price object. + #[serde(skip_serializing_if = "Option::is_none")] + pub price: Option<&'a str>, + /// Data used to generate a new [Price](https://stripe.com/docs/api/prices) object inline. + #[serde(skip_serializing_if = "Option::is_none")] + pub price_data: Option>, + /// Quantity for the given price. + /// Can be set only if the price's `usage_type` is `licensed` and not `metered`. + #[serde(skip_serializing_if = "Option::is_none")] + pub quantity: Option, + /// A list of [Tax Rate](https://stripe.com/docs/api/tax_rates) ids. + /// These Tax Rates will override the [`default_tax_rates`](https://stripe.com/docs/api/subscriptions/create#create_subscription-default_tax_rates) on the Subscription. + /// When updating, pass an empty string to remove previously-defined tax rates. + #[serde(skip_serializing_if = "Option::is_none")] + pub tax_rates: Option<&'a [&'a str]>, +} +impl<'a> UpdateSubscriptionSchedulePhasesItems<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// Data used to generate a new [Price](https://stripe.com/docs/api/prices) object inline. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct UpdateSubscriptionSchedulePhasesItemsPriceData<'a> { + /// Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. + /// Must be a [supported currency](https://stripe.com/docs/currencies). + pub currency: stripe_types::Currency, + /// The ID of the product that this price will belong to. + pub product: &'a str, + /// The recurring components of a price such as `interval` and `interval_count`. + pub recurring: UpdateSubscriptionSchedulePhasesItemsPriceDataRecurring, + /// Only required if a [default tax behavior](https://stripe.com/docs/tax/products-prices-tax-categories-tax-behavior#setting-a-default-tax-behavior-(recommended)) was not provided in the Stripe Tax settings. + /// Specifies whether the price is considered inclusive of taxes or exclusive of taxes. + /// One of `inclusive`, `exclusive`, or `unspecified`. + /// Once specified as either `inclusive` or `exclusive`, it cannot be changed. + #[serde(skip_serializing_if = "Option::is_none")] + pub tax_behavior: Option, + /// A positive integer in cents (or local equivalent) (or 0 for a free price) representing how much to charge. + #[serde(skip_serializing_if = "Option::is_none")] + pub unit_amount: Option, + /// Same as `unit_amount`, but accepts a decimal value in cents (or local equivalent) with at most 12 decimal places. + /// Only one of `unit_amount` and `unit_amount_decimal` can be set. + #[serde(skip_serializing_if = "Option::is_none")] + pub unit_amount_decimal: Option<&'a str>, +} +impl<'a> UpdateSubscriptionSchedulePhasesItemsPriceData<'a> { + pub fn new( + currency: stripe_types::Currency, + product: &'a str, + recurring: UpdateSubscriptionSchedulePhasesItemsPriceDataRecurring, + ) -> Self { + Self { + currency, + product, + recurring, + tax_behavior: None, + unit_amount: None, + unit_amount_decimal: None, + } + } +} +/// The recurring components of a price such as `interval` and `interval_count`. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct UpdateSubscriptionSchedulePhasesItemsPriceDataRecurring { + /// Specifies billing frequency. Either `day`, `week`, `month` or `year`. + pub interval: UpdateSubscriptionSchedulePhasesItemsPriceDataRecurringInterval, + /// The number of intervals between subscription billings. + /// For example, `interval=month` and `interval_count=3` bills every 3 months. + /// Maximum of three years interval allowed (3 years, 36 months, or 156 weeks). + #[serde(skip_serializing_if = "Option::is_none")] + pub interval_count: Option, +} +impl UpdateSubscriptionSchedulePhasesItemsPriceDataRecurring { + pub fn new(interval: UpdateSubscriptionSchedulePhasesItemsPriceDataRecurringInterval) -> Self { + Self { interval, interval_count: None } + } +} +/// Specifies billing frequency. Either `day`, `week`, `month` or `year`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum UpdateSubscriptionSchedulePhasesItemsPriceDataRecurringInterval { + Day, + Month, + Week, + Year, +} +impl UpdateSubscriptionSchedulePhasesItemsPriceDataRecurringInterval { + pub fn as_str(self) -> &'static str { + use UpdateSubscriptionSchedulePhasesItemsPriceDataRecurringInterval::*; + match self { + Day => "day", + Month => "month", + Week => "week", + Year => "year", + } + } +} + +impl std::str::FromStr for UpdateSubscriptionSchedulePhasesItemsPriceDataRecurringInterval { + type Err = (); + fn from_str(s: &str) -> Result { + use UpdateSubscriptionSchedulePhasesItemsPriceDataRecurringInterval::*; + match s { + "day" => Ok(Day), + "month" => Ok(Month), + "week" => Ok(Week), + "year" => Ok(Year), + _ => Err(()), + } + } +} +impl std::fmt::Display for UpdateSubscriptionSchedulePhasesItemsPriceDataRecurringInterval { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for UpdateSubscriptionSchedulePhasesItemsPriceDataRecurringInterval { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for UpdateSubscriptionSchedulePhasesItemsPriceDataRecurringInterval { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Only required if a [default tax behavior](https://stripe.com/docs/tax/products-prices-tax-categories-tax-behavior#setting-a-default-tax-behavior-(recommended)) was not provided in the Stripe Tax settings. +/// Specifies whether the price is considered inclusive of taxes or exclusive of taxes. +/// One of `inclusive`, `exclusive`, or `unspecified`. +/// Once specified as either `inclusive` or `exclusive`, it cannot be changed. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum UpdateSubscriptionSchedulePhasesItemsPriceDataTaxBehavior { + Exclusive, + Inclusive, + Unspecified, +} +impl UpdateSubscriptionSchedulePhasesItemsPriceDataTaxBehavior { + pub fn as_str(self) -> &'static str { + use UpdateSubscriptionSchedulePhasesItemsPriceDataTaxBehavior::*; + match self { + Exclusive => "exclusive", + Inclusive => "inclusive", + Unspecified => "unspecified", + } + } +} + +impl std::str::FromStr for UpdateSubscriptionSchedulePhasesItemsPriceDataTaxBehavior { + type Err = (); + fn from_str(s: &str) -> Result { + use UpdateSubscriptionSchedulePhasesItemsPriceDataTaxBehavior::*; + match s { + "exclusive" => Ok(Exclusive), + "inclusive" => Ok(Inclusive), + "unspecified" => Ok(Unspecified), + _ => Err(()), + } + } +} +impl std::fmt::Display for UpdateSubscriptionSchedulePhasesItemsPriceDataTaxBehavior { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for UpdateSubscriptionSchedulePhasesItemsPriceDataTaxBehavior { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for UpdateSubscriptionSchedulePhasesItemsPriceDataTaxBehavior { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Whether the subscription schedule will create [prorations](https://stripe.com/docs/billing/subscriptions/prorations) when transitioning to this phase. +/// The default value is `create_prorations`. +/// This setting controls prorations when a phase is started asynchronously and it is persisted as a field on the phase. +/// It's different from the request-level [proration_behavior](https://stripe.com/docs/api/subscription_schedules/update#update_subscription_schedule-proration_behavior) parameter which controls what happens if the update request affects the billing configuration of the current phase. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum UpdateSubscriptionSchedulePhasesProrationBehavior { + AlwaysInvoice, + CreateProrations, + None, +} +impl UpdateSubscriptionSchedulePhasesProrationBehavior { + pub fn as_str(self) -> &'static str { + use UpdateSubscriptionSchedulePhasesProrationBehavior::*; + match self { + AlwaysInvoice => "always_invoice", + CreateProrations => "create_prorations", + None => "none", + } + } +} + +impl std::str::FromStr for UpdateSubscriptionSchedulePhasesProrationBehavior { + type Err = (); + fn from_str(s: &str) -> Result { + use UpdateSubscriptionSchedulePhasesProrationBehavior::*; + match s { + "always_invoice" => Ok(AlwaysInvoice), + "create_prorations" => Ok(CreateProrations), + "none" => Ok(None), + _ => Err(()), + } + } +} +impl std::fmt::Display for UpdateSubscriptionSchedulePhasesProrationBehavior { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for UpdateSubscriptionSchedulePhasesProrationBehavior { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for UpdateSubscriptionSchedulePhasesProrationBehavior { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// The date at which this phase of the subscription schedule starts or `now`. +/// Must be set on the first phase. +#[derive(Copy, Clone, Debug, serde::Serialize)] +#[serde(untagged)] +pub enum UpdateSubscriptionSchedulePhasesStartDate { + Timestamp(stripe_types::Timestamp), + Now, +} +/// Sets the phase to trialing from the start date to this date. +/// Must be before the phase end date, can not be combined with `trial`. +#[derive(Copy, Clone, Debug, serde::Serialize)] +#[serde(untagged)] +pub enum UpdateSubscriptionSchedulePhasesTrialEnd { + Timestamp(stripe_types::Timestamp), + Now, +} +/// If the update changes the current phase, indicates whether the changes should be prorated. +/// The default value is `create_prorations`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum UpdateSubscriptionScheduleProrationBehavior { + AlwaysInvoice, + CreateProrations, + None, +} +impl UpdateSubscriptionScheduleProrationBehavior { + pub fn as_str(self) -> &'static str { + use UpdateSubscriptionScheduleProrationBehavior::*; + match self { + AlwaysInvoice => "always_invoice", + CreateProrations => "create_prorations", + None => "none", + } + } +} + +impl std::str::FromStr for UpdateSubscriptionScheduleProrationBehavior { + type Err = (); + fn from_str(s: &str) -> Result { + use UpdateSubscriptionScheduleProrationBehavior::*; + match s { + "always_invoice" => Ok(AlwaysInvoice), + "create_prorations" => Ok(CreateProrations), + "none" => Ok(None), + _ => Err(()), + } + } +} +impl std::fmt::Display for UpdateSubscriptionScheduleProrationBehavior { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for UpdateSubscriptionScheduleProrationBehavior { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for UpdateSubscriptionScheduleProrationBehavior { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'a> UpdateSubscriptionSchedule<'a> { + /// Updates an existing subscription schedule. + pub fn send( + &self, + client: &stripe::Client, + schedule: &stripe_shared::SubscriptionScheduleId, + ) -> stripe::Response { + client.send_form( + &format!("/subscription_schedules/{schedule}"), + self, + http_types::Method::Post, + ) + } +} +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CancelSubscriptionSchedule<'a> { + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, + /// If the subscription schedule is `active`, indicates if a final invoice will be generated that contains any un-invoiced metered usage and new/pending proration invoice items. + /// Defaults to `true`. + #[serde(skip_serializing_if = "Option::is_none")] + pub invoice_now: Option, + /// If the subscription schedule is `active`, indicates if the cancellation should be prorated. + /// Defaults to `true`. + #[serde(skip_serializing_if = "Option::is_none")] + pub prorate: Option, +} +impl<'a> CancelSubscriptionSchedule<'a> { + pub fn new() -> Self { + Self::default() + } +} +impl<'a> CancelSubscriptionSchedule<'a> { + /// Cancels a subscription schedule and its associated subscription immediately (if the subscription schedule has an active subscription). + /// A subscription schedule can only be canceled if its status is `not_started` or `active`. + pub fn send( + &self, + client: &stripe::Client, + schedule: &stripe_shared::SubscriptionScheduleId, + ) -> stripe::Response { + client.send_form( + &format!("/subscription_schedules/{schedule}/cancel"), + self, + http_types::Method::Post, + ) + } +} +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct ReleaseSubscriptionSchedule<'a> { + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, + /// Keep any cancellation on the subscription that the schedule has set + #[serde(skip_serializing_if = "Option::is_none")] + pub preserve_cancel_date: Option, +} +impl<'a> ReleaseSubscriptionSchedule<'a> { + pub fn new() -> Self { + Self::default() + } +} +impl<'a> ReleaseSubscriptionSchedule<'a> { + /// Releases the subscription schedule immediately, which will stop scheduling of its phases, but leave any existing subscription in place. + /// A schedule can only be released if its status is `not_started` or `active`. + /// If the subscription schedule is currently associated with a subscription, releasing it will remove its `subscription` property and set the subscription’s ID to the `released_subscription` property. + pub fn send( + &self, + client: &stripe::Client, + schedule: &stripe_shared::SubscriptionScheduleId, + ) -> stripe::Response { + client.send_form( + &format!("/subscription_schedules/{schedule}/release"), + self, + http_types::Method::Post, + ) + } +} +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct BillingThresholdsParam { + /// Monetary threshold that triggers the subscription to advance to a new billing period + #[serde(skip_serializing_if = "Option::is_none")] + pub amount_gte: Option, + /// Indicates if the `billing_cycle_anchor` should be reset when a threshold is reached. + /// If true, `billing_cycle_anchor` will be updated to the date/time the threshold was last reached; otherwise, the value will remain unchanged. + #[serde(skip_serializing_if = "Option::is_none")] + pub reset_billing_cycle_anchor: Option, +} +impl BillingThresholdsParam { + pub fn new() -> Self { + Self::default() + } +} +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct TransferDataSpecs<'a> { + /// A non-negative decimal between 0 and 100, with at most two decimal places. + /// This represents the percentage of the subscription invoice total that will be transferred to the destination account. + /// By default, the entire amount is transferred to the destination. + #[serde(skip_serializing_if = "Option::is_none")] + pub amount_percent: Option, + /// ID of an existing, connected Stripe account. + pub destination: &'a str, +} +impl<'a> TransferDataSpecs<'a> { + pub fn new(destination: &'a str) -> Self { + Self { amount_percent: None, destination } + } +} +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct ItemBillingThresholdsParam { + /// Number of units that meets the billing threshold to advance the subscription to a new billing period (e.g., it takes 10 $5 units to meet a $50 [monetary threshold](https://stripe.com/docs/api/subscriptions/update#update_subscription-billing_thresholds-amount_gte)). + pub usage_gte: i64, +} +impl ItemBillingThresholdsParam { + pub fn new(usage_gte: i64) -> Self { + Self { usage_gte } + } +} diff --git a/generated/stripe_billing/src/tax_id/mod.rs b/generated/stripe_billing/src/tax_id/mod.rs new file mode 100644 index 000000000..901a54bcd --- /dev/null +++ b/generated/stripe_billing/src/tax_id/mod.rs @@ -0,0 +1,4 @@ +#[cfg(feature = "tax_id")] +mod requests; +#[cfg(feature = "tax_id")] +pub use requests::*; diff --git a/generated/stripe_billing/src/tax_id/requests.rs b/generated/stripe_billing/src/tax_id/requests.rs new file mode 100644 index 000000000..89de3b060 --- /dev/null +++ b/generated/stripe_billing/src/tax_id/requests.rs @@ -0,0 +1,838 @@ +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct DeleteCustomerTaxId {} +impl DeleteCustomerTaxId { + pub fn new() -> Self { + Self::default() + } +} +impl DeleteCustomerTaxId { + /// Deletes an existing `tax_id` object. + pub fn send( + &self, + client: &stripe::Client, + customer: &stripe_shared::CustomerId, + id: &str, + ) -> stripe::Response { + client.send_form( + &format!("/customers/{customer}/tax_ids/{id}"), + self, + http_types::Method::Delete, + ) + } +} +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct DeleteIdTaxId {} +impl DeleteIdTaxId { + pub fn new() -> Self { + Self::default() + } +} +impl DeleteIdTaxId { + /// Deletes an existing account or customer `tax_id` object. + pub fn send( + &self, + client: &stripe::Client, + id: &stripe_shared::TaxIdId, + ) -> stripe::Response { + client.send_form(&format!("/tax_ids/{id}"), self, http_types::Method::Delete) + } +} +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct ListCustomerTaxId<'a> { + /// A cursor for use in pagination. + /// `ending_before` is an object ID that defines your place in the list. + /// For instance, if you make a list request and receive 100 objects, starting with `obj_bar`, your subsequent call can include `ending_before=obj_bar` in order to fetch the previous page of the list. + #[serde(skip_serializing_if = "Option::is_none")] + pub ending_before: Option<&'a str>, + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, + /// A limit on the number of objects to be returned. + /// Limit can range between 1 and 100, and the default is 10. + #[serde(skip_serializing_if = "Option::is_none")] + pub limit: Option, + /// A cursor for use in pagination. + /// `starting_after` is an object ID that defines your place in the list. + /// For instance, if you make a list request and receive 100 objects, ending with `obj_foo`, your subsequent call can include `starting_after=obj_foo` in order to fetch the next page of the list. + #[serde(skip_serializing_if = "Option::is_none")] + pub starting_after: Option<&'a str>, +} +impl<'a> ListCustomerTaxId<'a> { + pub fn new() -> Self { + Self::default() + } +} +impl<'a> ListCustomerTaxId<'a> { + /// Returns a list of tax IDs for a customer. + pub fn send( + &self, + client: &stripe::Client, + customer: &stripe_shared::CustomerId, + ) -> stripe::Response> { + client.get_query(&format!("/customers/{customer}/tax_ids"), self) + } + pub fn paginate( + self, + customer: &stripe_shared::CustomerId, + ) -> stripe::ListPaginator> { + stripe::ListPaginator::from_list_params(&format!("/customers/{customer}/tax_ids"), self) + } +} +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct RetrieveCustomerTaxId<'a> { + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, +} +impl<'a> RetrieveCustomerTaxId<'a> { + pub fn new() -> Self { + Self::default() + } +} +impl<'a> RetrieveCustomerTaxId<'a> { + /// Retrieves the `tax_id` object with the given identifier. + pub fn send( + &self, + client: &stripe::Client, + customer: &stripe_shared::CustomerId, + id: &str, + ) -> stripe::Response { + client.get_query(&format!("/customers/{customer}/tax_ids/{id}"), self) + } +} +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct ListTaxId<'a> { + /// A cursor for use in pagination. + /// `ending_before` is an object ID that defines your place in the list. + /// For instance, if you make a list request and receive 100 objects, starting with `obj_bar`, your subsequent call can include `ending_before=obj_bar` in order to fetch the previous page of the list. + #[serde(skip_serializing_if = "Option::is_none")] + pub ending_before: Option<&'a str>, + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, + /// A limit on the number of objects to be returned. + /// Limit can range between 1 and 100, and the default is 10. + #[serde(skip_serializing_if = "Option::is_none")] + pub limit: Option, + /// The account or customer the tax ID belongs to. Defaults to `owner[type]=self`. + #[serde(skip_serializing_if = "Option::is_none")] + pub owner: Option>, + /// A cursor for use in pagination. + /// `starting_after` is an object ID that defines your place in the list. + /// For instance, if you make a list request and receive 100 objects, ending with `obj_foo`, your subsequent call can include `starting_after=obj_foo` in order to fetch the next page of the list. + #[serde(skip_serializing_if = "Option::is_none")] + pub starting_after: Option<&'a str>, +} +impl<'a> ListTaxId<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// The account or customer the tax ID belongs to. Defaults to `owner[type]=self`. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct ListTaxIdOwner<'a> { + /// Account the tax ID belongs to. Required when `type=account` + #[serde(skip_serializing_if = "Option::is_none")] + pub account: Option<&'a str>, + /// Customer the tax ID belongs to. Required when `type=customer` + #[serde(skip_serializing_if = "Option::is_none")] + pub customer: Option<&'a str>, + /// Type of owner referenced. + #[serde(rename = "type")] + pub type_: ListTaxIdOwnerType, +} +impl<'a> ListTaxIdOwner<'a> { + pub fn new(type_: ListTaxIdOwnerType) -> Self { + Self { account: None, customer: None, type_ } + } +} +/// Type of owner referenced. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum ListTaxIdOwnerType { + Account, + Application, + Customer, + Self_, +} +impl ListTaxIdOwnerType { + pub fn as_str(self) -> &'static str { + use ListTaxIdOwnerType::*; + match self { + Account => "account", + Application => "application", + Customer => "customer", + Self_ => "self", + } + } +} + +impl std::str::FromStr for ListTaxIdOwnerType { + type Err = (); + fn from_str(s: &str) -> Result { + use ListTaxIdOwnerType::*; + match s { + "account" => Ok(Account), + "application" => Ok(Application), + "customer" => Ok(Customer), + "self" => Ok(Self_), + _ => Err(()), + } + } +} +impl std::fmt::Display for ListTaxIdOwnerType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for ListTaxIdOwnerType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for ListTaxIdOwnerType { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'a> ListTaxId<'a> { + /// Returns a list of tax IDs. + pub fn send( + &self, + client: &stripe::Client, + ) -> stripe::Response> { + client.get_query("/tax_ids", self) + } + pub fn paginate(self) -> stripe::ListPaginator> { + stripe::ListPaginator::from_list_params("/tax_ids", self) + } +} +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct RetrieveIdTaxId<'a> { + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, +} +impl<'a> RetrieveIdTaxId<'a> { + pub fn new() -> Self { + Self::default() + } +} +impl<'a> RetrieveIdTaxId<'a> { + /// Retrieves an account or customer `tax_id` object. + pub fn send( + &self, + client: &stripe::Client, + id: &stripe_shared::TaxIdId, + ) -> stripe::Response { + client.get_query(&format!("/tax_ids/{id}"), self) + } +} +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreateCustomerTaxId<'a> { + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, + /// Type of the tax ID, one of `ad_nrt`, `ae_trn`, `ar_cuit`, `au_abn`, `au_arn`, `bg_uic`, `bo_tin`, `br_cnpj`, `br_cpf`, `ca_bn`, `ca_gst_hst`, `ca_pst_bc`, `ca_pst_mb`, `ca_pst_sk`, `ca_qst`, `ch_vat`, `cl_tin`, `cn_tin`, `co_nit`, `cr_tin`, `do_rcn`, `ec_ruc`, `eg_tin`, `es_cif`, `eu_oss_vat`, `eu_vat`, `gb_vat`, `ge_vat`, `hk_br`, `hu_tin`, `id_npwp`, `il_vat`, `in_gst`, `is_vat`, `jp_cn`, `jp_rn`, `jp_trn`, `ke_pin`, `kr_brn`, `li_uid`, `mx_rfc`, `my_frp`, `my_itn`, `my_sst`, `no_vat`, `nz_gst`, `pe_ruc`, `ph_tin`, `ro_tin`, `rs_pib`, `ru_inn`, `ru_kpp`, `sa_vat`, `sg_gst`, `sg_uen`, `si_tin`, `sv_nit`, `th_vat`, `tr_tin`, `tw_vat`, `ua_vat`, `us_ein`, `uy_ruc`, `ve_rif`, `vn_tin`, or `za_vat`. + #[serde(rename = "type")] + pub type_: CreateCustomerTaxIdType, + /// Value of the tax ID. + pub value: &'a str, +} +impl<'a> CreateCustomerTaxId<'a> { + pub fn new(type_: CreateCustomerTaxIdType, value: &'a str) -> Self { + Self { expand: None, type_, value } + } +} +/// Type of the tax ID, one of `ad_nrt`, `ae_trn`, `ar_cuit`, `au_abn`, `au_arn`, `bg_uic`, `bo_tin`, `br_cnpj`, `br_cpf`, `ca_bn`, `ca_gst_hst`, `ca_pst_bc`, `ca_pst_mb`, `ca_pst_sk`, `ca_qst`, `ch_vat`, `cl_tin`, `cn_tin`, `co_nit`, `cr_tin`, `do_rcn`, `ec_ruc`, `eg_tin`, `es_cif`, `eu_oss_vat`, `eu_vat`, `gb_vat`, `ge_vat`, `hk_br`, `hu_tin`, `id_npwp`, `il_vat`, `in_gst`, `is_vat`, `jp_cn`, `jp_rn`, `jp_trn`, `ke_pin`, `kr_brn`, `li_uid`, `mx_rfc`, `my_frp`, `my_itn`, `my_sst`, `no_vat`, `nz_gst`, `pe_ruc`, `ph_tin`, `ro_tin`, `rs_pib`, `ru_inn`, `ru_kpp`, `sa_vat`, `sg_gst`, `sg_uen`, `si_tin`, `sv_nit`, `th_vat`, `tr_tin`, `tw_vat`, `ua_vat`, `us_ein`, `uy_ruc`, `ve_rif`, `vn_tin`, or `za_vat`. +#[derive(Copy, Clone, Eq, PartialEq)] +#[non_exhaustive] +pub enum CreateCustomerTaxIdType { + AdNrt, + AeTrn, + ArCuit, + AuAbn, + AuArn, + BgUic, + BoTin, + BrCnpj, + BrCpf, + CaBn, + CaGstHst, + CaPstBc, + CaPstMb, + CaPstSk, + CaQst, + ChVat, + ClTin, + CnTin, + CoNit, + CrTin, + DoRcn, + EcRuc, + EgTin, + EsCif, + EuOssVat, + EuVat, + GbVat, + GeVat, + HkBr, + HuTin, + IdNpwp, + IlVat, + InGst, + IsVat, + JpCn, + JpRn, + JpTrn, + KePin, + KrBrn, + LiUid, + MxRfc, + MyFrp, + MyItn, + MySst, + NoVat, + NzGst, + PeRuc, + PhTin, + RoTin, + RsPib, + RuInn, + RuKpp, + SaVat, + SgGst, + SgUen, + SiTin, + SvNit, + ThVat, + TrTin, + TwVat, + UaVat, + UsEin, + UyRuc, + VeRif, + VnTin, + ZaVat, + /// An unrecognized value from Stripe. Should not be used as a request parameter. + Unknown, +} +impl CreateCustomerTaxIdType { + pub fn as_str(self) -> &'static str { + use CreateCustomerTaxIdType::*; + match self { + AdNrt => "ad_nrt", + AeTrn => "ae_trn", + ArCuit => "ar_cuit", + AuAbn => "au_abn", + AuArn => "au_arn", + BgUic => "bg_uic", + BoTin => "bo_tin", + BrCnpj => "br_cnpj", + BrCpf => "br_cpf", + CaBn => "ca_bn", + CaGstHst => "ca_gst_hst", + CaPstBc => "ca_pst_bc", + CaPstMb => "ca_pst_mb", + CaPstSk => "ca_pst_sk", + CaQst => "ca_qst", + ChVat => "ch_vat", + ClTin => "cl_tin", + CnTin => "cn_tin", + CoNit => "co_nit", + CrTin => "cr_tin", + DoRcn => "do_rcn", + EcRuc => "ec_ruc", + EgTin => "eg_tin", + EsCif => "es_cif", + EuOssVat => "eu_oss_vat", + EuVat => "eu_vat", + GbVat => "gb_vat", + GeVat => "ge_vat", + HkBr => "hk_br", + HuTin => "hu_tin", + IdNpwp => "id_npwp", + IlVat => "il_vat", + InGst => "in_gst", + IsVat => "is_vat", + JpCn => "jp_cn", + JpRn => "jp_rn", + JpTrn => "jp_trn", + KePin => "ke_pin", + KrBrn => "kr_brn", + LiUid => "li_uid", + MxRfc => "mx_rfc", + MyFrp => "my_frp", + MyItn => "my_itn", + MySst => "my_sst", + NoVat => "no_vat", + NzGst => "nz_gst", + PeRuc => "pe_ruc", + PhTin => "ph_tin", + RoTin => "ro_tin", + RsPib => "rs_pib", + RuInn => "ru_inn", + RuKpp => "ru_kpp", + SaVat => "sa_vat", + SgGst => "sg_gst", + SgUen => "sg_uen", + SiTin => "si_tin", + SvNit => "sv_nit", + ThVat => "th_vat", + TrTin => "tr_tin", + TwVat => "tw_vat", + UaVat => "ua_vat", + UsEin => "us_ein", + UyRuc => "uy_ruc", + VeRif => "ve_rif", + VnTin => "vn_tin", + ZaVat => "za_vat", + Unknown => "unknown", + } + } +} + +impl std::str::FromStr for CreateCustomerTaxIdType { + type Err = (); + fn from_str(s: &str) -> Result { + use CreateCustomerTaxIdType::*; + match s { + "ad_nrt" => Ok(AdNrt), + "ae_trn" => Ok(AeTrn), + "ar_cuit" => Ok(ArCuit), + "au_abn" => Ok(AuAbn), + "au_arn" => Ok(AuArn), + "bg_uic" => Ok(BgUic), + "bo_tin" => Ok(BoTin), + "br_cnpj" => Ok(BrCnpj), + "br_cpf" => Ok(BrCpf), + "ca_bn" => Ok(CaBn), + "ca_gst_hst" => Ok(CaGstHst), + "ca_pst_bc" => Ok(CaPstBc), + "ca_pst_mb" => Ok(CaPstMb), + "ca_pst_sk" => Ok(CaPstSk), + "ca_qst" => Ok(CaQst), + "ch_vat" => Ok(ChVat), + "cl_tin" => Ok(ClTin), + "cn_tin" => Ok(CnTin), + "co_nit" => Ok(CoNit), + "cr_tin" => Ok(CrTin), + "do_rcn" => Ok(DoRcn), + "ec_ruc" => Ok(EcRuc), + "eg_tin" => Ok(EgTin), + "es_cif" => Ok(EsCif), + "eu_oss_vat" => Ok(EuOssVat), + "eu_vat" => Ok(EuVat), + "gb_vat" => Ok(GbVat), + "ge_vat" => Ok(GeVat), + "hk_br" => Ok(HkBr), + "hu_tin" => Ok(HuTin), + "id_npwp" => Ok(IdNpwp), + "il_vat" => Ok(IlVat), + "in_gst" => Ok(InGst), + "is_vat" => Ok(IsVat), + "jp_cn" => Ok(JpCn), + "jp_rn" => Ok(JpRn), + "jp_trn" => Ok(JpTrn), + "ke_pin" => Ok(KePin), + "kr_brn" => Ok(KrBrn), + "li_uid" => Ok(LiUid), + "mx_rfc" => Ok(MxRfc), + "my_frp" => Ok(MyFrp), + "my_itn" => Ok(MyItn), + "my_sst" => Ok(MySst), + "no_vat" => Ok(NoVat), + "nz_gst" => Ok(NzGst), + "pe_ruc" => Ok(PeRuc), + "ph_tin" => Ok(PhTin), + "ro_tin" => Ok(RoTin), + "rs_pib" => Ok(RsPib), + "ru_inn" => Ok(RuInn), + "ru_kpp" => Ok(RuKpp), + "sa_vat" => Ok(SaVat), + "sg_gst" => Ok(SgGst), + "sg_uen" => Ok(SgUen), + "si_tin" => Ok(SiTin), + "sv_nit" => Ok(SvNit), + "th_vat" => Ok(ThVat), + "tr_tin" => Ok(TrTin), + "tw_vat" => Ok(TwVat), + "ua_vat" => Ok(UaVat), + "us_ein" => Ok(UsEin), + "uy_ruc" => Ok(UyRuc), + "ve_rif" => Ok(VeRif), + "vn_tin" => Ok(VnTin), + "za_vat" => Ok(ZaVat), + _ => Err(()), + } + } +} +impl std::fmt::Display for CreateCustomerTaxIdType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreateCustomerTaxIdType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreateCustomerTaxIdType { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'a> CreateCustomerTaxId<'a> { + /// Creates a new `tax_id` object for a customer. + pub fn send( + &self, + client: &stripe::Client, + customer: &stripe_shared::CustomerId, + ) -> stripe::Response { + client.send_form(&format!("/customers/{customer}/tax_ids"), self, http_types::Method::Post) + } +} +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreateTaxId<'a> { + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, + /// The account or customer the tax ID belongs to. Defaults to `owner[type]=self`. + #[serde(skip_serializing_if = "Option::is_none")] + pub owner: Option>, + /// Type of the tax ID, one of `ad_nrt`, `ae_trn`, `ar_cuit`, `au_abn`, `au_arn`, `bg_uic`, `bo_tin`, `br_cnpj`, `br_cpf`, `ca_bn`, `ca_gst_hst`, `ca_pst_bc`, `ca_pst_mb`, `ca_pst_sk`, `ca_qst`, `ch_vat`, `cl_tin`, `cn_tin`, `co_nit`, `cr_tin`, `do_rcn`, `ec_ruc`, `eg_tin`, `es_cif`, `eu_oss_vat`, `eu_vat`, `gb_vat`, `ge_vat`, `hk_br`, `hu_tin`, `id_npwp`, `il_vat`, `in_gst`, `is_vat`, `jp_cn`, `jp_rn`, `jp_trn`, `ke_pin`, `kr_brn`, `li_uid`, `mx_rfc`, `my_frp`, `my_itn`, `my_sst`, `no_vat`, `nz_gst`, `pe_ruc`, `ph_tin`, `ro_tin`, `rs_pib`, `ru_inn`, `ru_kpp`, `sa_vat`, `sg_gst`, `sg_uen`, `si_tin`, `sv_nit`, `th_vat`, `tr_tin`, `tw_vat`, `ua_vat`, `us_ein`, `uy_ruc`, `ve_rif`, `vn_tin`, or `za_vat`. + #[serde(rename = "type")] + pub type_: CreateTaxIdType, + /// Value of the tax ID. + pub value: &'a str, +} +impl<'a> CreateTaxId<'a> { + pub fn new(type_: CreateTaxIdType, value: &'a str) -> Self { + Self { expand: None, owner: None, type_, value } + } +} +/// The account or customer the tax ID belongs to. Defaults to `owner[type]=self`. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreateTaxIdOwner<'a> { + /// Account the tax ID belongs to. Required when `type=account` + #[serde(skip_serializing_if = "Option::is_none")] + pub account: Option<&'a str>, + /// Customer the tax ID belongs to. Required when `type=customer` + #[serde(skip_serializing_if = "Option::is_none")] + pub customer: Option<&'a str>, + /// Type of owner referenced. + #[serde(rename = "type")] + pub type_: CreateTaxIdOwnerType, +} +impl<'a> CreateTaxIdOwner<'a> { + pub fn new(type_: CreateTaxIdOwnerType) -> Self { + Self { account: None, customer: None, type_ } + } +} +/// Type of owner referenced. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreateTaxIdOwnerType { + Account, + Application, + Customer, + Self_, +} +impl CreateTaxIdOwnerType { + pub fn as_str(self) -> &'static str { + use CreateTaxIdOwnerType::*; + match self { + Account => "account", + Application => "application", + Customer => "customer", + Self_ => "self", + } + } +} + +impl std::str::FromStr for CreateTaxIdOwnerType { + type Err = (); + fn from_str(s: &str) -> Result { + use CreateTaxIdOwnerType::*; + match s { + "account" => Ok(Account), + "application" => Ok(Application), + "customer" => Ok(Customer), + "self" => Ok(Self_), + _ => Err(()), + } + } +} +impl std::fmt::Display for CreateTaxIdOwnerType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreateTaxIdOwnerType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreateTaxIdOwnerType { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Type of the tax ID, one of `ad_nrt`, `ae_trn`, `ar_cuit`, `au_abn`, `au_arn`, `bg_uic`, `bo_tin`, `br_cnpj`, `br_cpf`, `ca_bn`, `ca_gst_hst`, `ca_pst_bc`, `ca_pst_mb`, `ca_pst_sk`, `ca_qst`, `ch_vat`, `cl_tin`, `cn_tin`, `co_nit`, `cr_tin`, `do_rcn`, `ec_ruc`, `eg_tin`, `es_cif`, `eu_oss_vat`, `eu_vat`, `gb_vat`, `ge_vat`, `hk_br`, `hu_tin`, `id_npwp`, `il_vat`, `in_gst`, `is_vat`, `jp_cn`, `jp_rn`, `jp_trn`, `ke_pin`, `kr_brn`, `li_uid`, `mx_rfc`, `my_frp`, `my_itn`, `my_sst`, `no_vat`, `nz_gst`, `pe_ruc`, `ph_tin`, `ro_tin`, `rs_pib`, `ru_inn`, `ru_kpp`, `sa_vat`, `sg_gst`, `sg_uen`, `si_tin`, `sv_nit`, `th_vat`, `tr_tin`, `tw_vat`, `ua_vat`, `us_ein`, `uy_ruc`, `ve_rif`, `vn_tin`, or `za_vat`. +#[derive(Copy, Clone, Eq, PartialEq)] +#[non_exhaustive] +pub enum CreateTaxIdType { + AdNrt, + AeTrn, + ArCuit, + AuAbn, + AuArn, + BgUic, + BoTin, + BrCnpj, + BrCpf, + CaBn, + CaGstHst, + CaPstBc, + CaPstMb, + CaPstSk, + CaQst, + ChVat, + ClTin, + CnTin, + CoNit, + CrTin, + DoRcn, + EcRuc, + EgTin, + EsCif, + EuOssVat, + EuVat, + GbVat, + GeVat, + HkBr, + HuTin, + IdNpwp, + IlVat, + InGst, + IsVat, + JpCn, + JpRn, + JpTrn, + KePin, + KrBrn, + LiUid, + MxRfc, + MyFrp, + MyItn, + MySst, + NoVat, + NzGst, + PeRuc, + PhTin, + RoTin, + RsPib, + RuInn, + RuKpp, + SaVat, + SgGst, + SgUen, + SiTin, + SvNit, + ThVat, + TrTin, + TwVat, + UaVat, + UsEin, + UyRuc, + VeRif, + VnTin, + ZaVat, + /// An unrecognized value from Stripe. Should not be used as a request parameter. + Unknown, +} +impl CreateTaxIdType { + pub fn as_str(self) -> &'static str { + use CreateTaxIdType::*; + match self { + AdNrt => "ad_nrt", + AeTrn => "ae_trn", + ArCuit => "ar_cuit", + AuAbn => "au_abn", + AuArn => "au_arn", + BgUic => "bg_uic", + BoTin => "bo_tin", + BrCnpj => "br_cnpj", + BrCpf => "br_cpf", + CaBn => "ca_bn", + CaGstHst => "ca_gst_hst", + CaPstBc => "ca_pst_bc", + CaPstMb => "ca_pst_mb", + CaPstSk => "ca_pst_sk", + CaQst => "ca_qst", + ChVat => "ch_vat", + ClTin => "cl_tin", + CnTin => "cn_tin", + CoNit => "co_nit", + CrTin => "cr_tin", + DoRcn => "do_rcn", + EcRuc => "ec_ruc", + EgTin => "eg_tin", + EsCif => "es_cif", + EuOssVat => "eu_oss_vat", + EuVat => "eu_vat", + GbVat => "gb_vat", + GeVat => "ge_vat", + HkBr => "hk_br", + HuTin => "hu_tin", + IdNpwp => "id_npwp", + IlVat => "il_vat", + InGst => "in_gst", + IsVat => "is_vat", + JpCn => "jp_cn", + JpRn => "jp_rn", + JpTrn => "jp_trn", + KePin => "ke_pin", + KrBrn => "kr_brn", + LiUid => "li_uid", + MxRfc => "mx_rfc", + MyFrp => "my_frp", + MyItn => "my_itn", + MySst => "my_sst", + NoVat => "no_vat", + NzGst => "nz_gst", + PeRuc => "pe_ruc", + PhTin => "ph_tin", + RoTin => "ro_tin", + RsPib => "rs_pib", + RuInn => "ru_inn", + RuKpp => "ru_kpp", + SaVat => "sa_vat", + SgGst => "sg_gst", + SgUen => "sg_uen", + SiTin => "si_tin", + SvNit => "sv_nit", + ThVat => "th_vat", + TrTin => "tr_tin", + TwVat => "tw_vat", + UaVat => "ua_vat", + UsEin => "us_ein", + UyRuc => "uy_ruc", + VeRif => "ve_rif", + VnTin => "vn_tin", + ZaVat => "za_vat", + Unknown => "unknown", + } + } +} + +impl std::str::FromStr for CreateTaxIdType { + type Err = (); + fn from_str(s: &str) -> Result { + use CreateTaxIdType::*; + match s { + "ad_nrt" => Ok(AdNrt), + "ae_trn" => Ok(AeTrn), + "ar_cuit" => Ok(ArCuit), + "au_abn" => Ok(AuAbn), + "au_arn" => Ok(AuArn), + "bg_uic" => Ok(BgUic), + "bo_tin" => Ok(BoTin), + "br_cnpj" => Ok(BrCnpj), + "br_cpf" => Ok(BrCpf), + "ca_bn" => Ok(CaBn), + "ca_gst_hst" => Ok(CaGstHst), + "ca_pst_bc" => Ok(CaPstBc), + "ca_pst_mb" => Ok(CaPstMb), + "ca_pst_sk" => Ok(CaPstSk), + "ca_qst" => Ok(CaQst), + "ch_vat" => Ok(ChVat), + "cl_tin" => Ok(ClTin), + "cn_tin" => Ok(CnTin), + "co_nit" => Ok(CoNit), + "cr_tin" => Ok(CrTin), + "do_rcn" => Ok(DoRcn), + "ec_ruc" => Ok(EcRuc), + "eg_tin" => Ok(EgTin), + "es_cif" => Ok(EsCif), + "eu_oss_vat" => Ok(EuOssVat), + "eu_vat" => Ok(EuVat), + "gb_vat" => Ok(GbVat), + "ge_vat" => Ok(GeVat), + "hk_br" => Ok(HkBr), + "hu_tin" => Ok(HuTin), + "id_npwp" => Ok(IdNpwp), + "il_vat" => Ok(IlVat), + "in_gst" => Ok(InGst), + "is_vat" => Ok(IsVat), + "jp_cn" => Ok(JpCn), + "jp_rn" => Ok(JpRn), + "jp_trn" => Ok(JpTrn), + "ke_pin" => Ok(KePin), + "kr_brn" => Ok(KrBrn), + "li_uid" => Ok(LiUid), + "mx_rfc" => Ok(MxRfc), + "my_frp" => Ok(MyFrp), + "my_itn" => Ok(MyItn), + "my_sst" => Ok(MySst), + "no_vat" => Ok(NoVat), + "nz_gst" => Ok(NzGst), + "pe_ruc" => Ok(PeRuc), + "ph_tin" => Ok(PhTin), + "ro_tin" => Ok(RoTin), + "rs_pib" => Ok(RsPib), + "ru_inn" => Ok(RuInn), + "ru_kpp" => Ok(RuKpp), + "sa_vat" => Ok(SaVat), + "sg_gst" => Ok(SgGst), + "sg_uen" => Ok(SgUen), + "si_tin" => Ok(SiTin), + "sv_nit" => Ok(SvNit), + "th_vat" => Ok(ThVat), + "tr_tin" => Ok(TrTin), + "tw_vat" => Ok(TwVat), + "ua_vat" => Ok(UaVat), + "us_ein" => Ok(UsEin), + "uy_ruc" => Ok(UyRuc), + "ve_rif" => Ok(VeRif), + "vn_tin" => Ok(VnTin), + "za_vat" => Ok(ZaVat), + _ => Err(()), + } + } +} +impl std::fmt::Display for CreateTaxIdType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreateTaxIdType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreateTaxIdType { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'a> CreateTaxId<'a> { + /// Creates a new account or customer `tax_id` object. + pub fn send(&self, client: &stripe::Client) -> stripe::Response { + client.send_form("/tax_ids", self, http_types::Method::Post) + } +} diff --git a/generated/stripe_billing/src/test_helpers_test_clock/mod.rs b/generated/stripe_billing/src/test_helpers_test_clock/mod.rs new file mode 100644 index 000000000..d5851953c --- /dev/null +++ b/generated/stripe_billing/src/test_helpers_test_clock/mod.rs @@ -0,0 +1,4 @@ +#[cfg(feature = "test_helpers_test_clock")] +mod requests; +#[cfg(feature = "test_helpers_test_clock")] +pub use requests::*; diff --git a/generated/stripe_billing/src/test_helpers_test_clock/requests.rs b/generated/stripe_billing/src/test_helpers_test_clock/requests.rs new file mode 100644 index 000000000..5afa16c10 --- /dev/null +++ b/generated/stripe_billing/src/test_helpers_test_clock/requests.rs @@ -0,0 +1,137 @@ +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct DeleteTestHelpersTestClock {} +impl DeleteTestHelpersTestClock { + pub fn new() -> Self { + Self::default() + } +} +impl DeleteTestHelpersTestClock { + /// Deletes a test clock. + pub fn send( + &self, + client: &stripe::Client, + test_clock: &stripe_shared::TestHelpersTestClockId, + ) -> stripe::Response { + client.send_form( + &format!("/test_helpers/test_clocks/{test_clock}"), + self, + http_types::Method::Delete, + ) + } +} +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct ListTestHelpersTestClock<'a> { + /// A cursor for use in pagination. + /// `ending_before` is an object ID that defines your place in the list. + /// For instance, if you make a list request and receive 100 objects, starting with `obj_bar`, your subsequent call can include `ending_before=obj_bar` in order to fetch the previous page of the list. + #[serde(skip_serializing_if = "Option::is_none")] + pub ending_before: Option<&'a str>, + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, + /// A limit on the number of objects to be returned. + /// Limit can range between 1 and 100, and the default is 10. + #[serde(skip_serializing_if = "Option::is_none")] + pub limit: Option, + /// A cursor for use in pagination. + /// `starting_after` is an object ID that defines your place in the list. + /// For instance, if you make a list request and receive 100 objects, ending with `obj_foo`, your subsequent call can include `starting_after=obj_foo` in order to fetch the next page of the list. + #[serde(skip_serializing_if = "Option::is_none")] + pub starting_after: Option<&'a str>, +} +impl<'a> ListTestHelpersTestClock<'a> { + pub fn new() -> Self { + Self::default() + } +} +impl<'a> ListTestHelpersTestClock<'a> { + /// Returns a list of your test clocks. + pub fn send( + &self, + client: &stripe::Client, + ) -> stripe::Response> { + client.get_query("/test_helpers/test_clocks", self) + } + pub fn paginate( + self, + ) -> stripe::ListPaginator> { + stripe::ListPaginator::from_list_params("/test_helpers/test_clocks", self) + } +} +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct RetrieveTestHelpersTestClock<'a> { + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, +} +impl<'a> RetrieveTestHelpersTestClock<'a> { + pub fn new() -> Self { + Self::default() + } +} +impl<'a> RetrieveTestHelpersTestClock<'a> { + /// Retrieves a test clock. + pub fn send( + &self, + client: &stripe::Client, + test_clock: &stripe_shared::TestHelpersTestClockId, + ) -> stripe::Response { + client.get_query(&format!("/test_helpers/test_clocks/{test_clock}"), self) + } +} +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreateTestHelpersTestClock<'a> { + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, + /// The initial frozen time for this test clock. + pub frozen_time: stripe_types::Timestamp, + /// The name for this test clock. + #[serde(skip_serializing_if = "Option::is_none")] + pub name: Option<&'a str>, +} +impl<'a> CreateTestHelpersTestClock<'a> { + pub fn new(frozen_time: stripe_types::Timestamp) -> Self { + Self { expand: None, frozen_time, name: None } + } +} +impl<'a> CreateTestHelpersTestClock<'a> { + /// Creates a new test clock that can be attached to new customers and quotes. + pub fn send( + &self, + client: &stripe::Client, + ) -> stripe::Response { + client.send_form("/test_helpers/test_clocks", self, http_types::Method::Post) + } +} +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct AdvanceTestHelpersTestClock<'a> { + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, + /// The time to advance the test clock. + /// Must be after the test clock's current frozen time. + /// Cannot be more than two intervals in the future from the shortest subscription in this test clock. + /// If there are no subscriptions in this test clock, it cannot be more than two years in the future. + pub frozen_time: stripe_types::Timestamp, +} +impl<'a> AdvanceTestHelpersTestClock<'a> { + pub fn new(frozen_time: stripe_types::Timestamp) -> Self { + Self { expand: None, frozen_time } + } +} +impl<'a> AdvanceTestHelpersTestClock<'a> { + /// Starts advancing a test clock to a specified time in the future. + /// Advancement is done when status changes to `Ready`. + pub fn send( + &self, + client: &stripe::Client, + test_clock: &stripe_shared::TestHelpersTestClockId, + ) -> stripe::Response { + client.send_form( + &format!("/test_helpers/test_clocks/{test_clock}/advance"), + self, + http_types::Method::Post, + ) + } +} diff --git a/generated/stripe_billing/src/usage_record/mod.rs b/generated/stripe_billing/src/usage_record/mod.rs new file mode 100644 index 000000000..be4a55360 --- /dev/null +++ b/generated/stripe_billing/src/usage_record/mod.rs @@ -0,0 +1,5 @@ +#[cfg(feature = "usage_record")] +mod requests; +pub(crate) mod types; +#[cfg(feature = "usage_record")] +pub use requests::*; diff --git a/generated/stripe_billing/src/usage_record/requests.rs b/generated/stripe_billing/src/usage_record/requests.rs new file mode 100644 index 000000000..f684d93eb --- /dev/null +++ b/generated/stripe_billing/src/usage_record/requests.rs @@ -0,0 +1,109 @@ +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreateSubscriptionItemUsageRecord<'a> { + /// Valid values are `increment` (default) or `set`. + /// When using `increment` the specified `quantity` will be added to the usage at the specified timestamp. + /// The `set` action will overwrite the usage quantity at that timestamp. + /// If the subscription has [billing thresholds](https://stripe.com/docs/api/subscriptions/object#subscription_object-billing_thresholds), `increment` is the only allowed value. + #[serde(skip_serializing_if = "Option::is_none")] + pub action: Option, + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, + /// The usage quantity for the specified timestamp. + pub quantity: u64, + /// The timestamp for the usage event. + /// This timestamp must be within the current billing period of the subscription of the provided `subscription_item`, and must not be in the future. + /// When passing `"now"`, Stripe records usage for the current time. + /// Default is `"now"` if a value is not provided. + #[serde(skip_serializing_if = "Option::is_none")] + pub timestamp: Option, +} +impl<'a> CreateSubscriptionItemUsageRecord<'a> { + pub fn new(quantity: u64) -> Self { + Self { action: None, expand: None, quantity, timestamp: None } + } +} +/// Valid values are `increment` (default) or `set`. +/// When using `increment` the specified `quantity` will be added to the usage at the specified timestamp. +/// The `set` action will overwrite the usage quantity at that timestamp. +/// If the subscription has [billing thresholds](https://stripe.com/docs/api/subscriptions/object#subscription_object-billing_thresholds), `increment` is the only allowed value. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreateSubscriptionItemUsageRecordAction { + Increment, + Set, +} +impl CreateSubscriptionItemUsageRecordAction { + pub fn as_str(self) -> &'static str { + use CreateSubscriptionItemUsageRecordAction::*; + match self { + Increment => "increment", + Set => "set", + } + } +} + +impl std::str::FromStr for CreateSubscriptionItemUsageRecordAction { + type Err = (); + fn from_str(s: &str) -> Result { + use CreateSubscriptionItemUsageRecordAction::*; + match s { + "increment" => Ok(Increment), + "set" => Ok(Set), + _ => Err(()), + } + } +} +impl std::fmt::Display for CreateSubscriptionItemUsageRecordAction { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreateSubscriptionItemUsageRecordAction { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreateSubscriptionItemUsageRecordAction { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// The timestamp for the usage event. +/// This timestamp must be within the current billing period of the subscription of the provided `subscription_item`, and must not be in the future. +/// When passing `"now"`, Stripe records usage for the current time. +/// Default is `"now"` if a value is not provided. +#[derive(Copy, Clone, Debug, serde::Serialize)] +#[serde(untagged)] +pub enum CreateSubscriptionItemUsageRecordTimestamp { + Now, + Timestamp(stripe_types::Timestamp), +} +impl<'a> CreateSubscriptionItemUsageRecord<'a> { + /// Creates a usage record for a specified subscription item and date, and fills it with a quantity. + /// + /// Usage records provide `quantity` information that Stripe uses to track how much a customer is using your service. + /// With usage information and the pricing model set up by the [metered billing](https://stripe.com/docs/billing/subscriptions/metered-billing) plan, Stripe helps you send accurate invoices to your customers. + /// + /// The default calculation for usage is to add up all the `quantity` values of the usage records within a billing period. + /// You can change this default behavior with the billing plan’s `aggregate_usage` [parameter](https://stripe.com/docs/api/plans/create#create_plan-aggregate_usage). + /// When there is more than one usage record with the same timestamp, Stripe adds the `quantity` values together. + /// In most cases, this is the desired resolution, however, you can change this behavior with the `action` parameter. + /// + /// The default pricing model for metered billing is [per-unit pricing](https://stripe.com/docs/api/plans/object#plan_object-billing_scheme). + /// For finer granularity, you can configure metered billing to have a [tiered pricing](https://stripe.com/docs/billing/subscriptions/tiers) model. + pub fn send( + &self, + client: &stripe::Client, + subscription_item: &stripe_shared::SubscriptionItemId, + ) -> stripe::Response { + client.send_form( + &format!("/subscription_items/{subscription_item}/usage_records"), + self, + http_types::Method::Post, + ) + } +} diff --git a/generated/stripe_billing/src/usage_record/types.rs b/generated/stripe_billing/src/usage_record/types.rs new file mode 100644 index 000000000..92c7a9fae --- /dev/null +++ b/generated/stripe_billing/src/usage_record/types.rs @@ -0,0 +1,26 @@ +/// Usage records allow you to report customer usage and metrics to Stripe for +/// metered billing of subscription prices. +/// +/// Related guide: [Metered billing](https://stripe.com/docs/billing/subscriptions/metered-billing) +/// +/// For more details see <>. +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct UsageRecord { + /// Unique identifier for the object. + pub id: stripe_billing::UsageRecordId, + /// Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + pub livemode: bool, + /// The usage quantity for the specified date. + pub quantity: u64, + /// The ID of the subscription item this usage record contains data for. + pub subscription_item: String, + /// The timestamp when this usage occurred. + pub timestamp: stripe_types::Timestamp, +} +impl stripe_types::Object for UsageRecord { + type Id = stripe_billing::UsageRecordId; + fn id(&self) -> &Self::Id { + &self.id + } +} +stripe_types::def_id!(UsageRecordId, "mbur_"); diff --git a/generated/stripe_billing/src/usage_record_summary/mod.rs b/generated/stripe_billing/src/usage_record_summary/mod.rs new file mode 100644 index 000000000..528189659 --- /dev/null +++ b/generated/stripe_billing/src/usage_record_summary/mod.rs @@ -0,0 +1,4 @@ +#[cfg(feature = "usage_record_summary")] +mod requests; +#[cfg(feature = "usage_record_summary")] +pub use requests::*; diff --git a/generated/stripe_billing/src/usage_record_summary/requests.rs b/generated/stripe_billing/src/usage_record_summary/requests.rs new file mode 100644 index 000000000..af87b912b --- /dev/null +++ b/generated/stripe_billing/src/usage_record_summary/requests.rs @@ -0,0 +1,52 @@ +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct ListSubscriptionItemUsageRecordSummary<'a> { + /// A cursor for use in pagination. + /// `ending_before` is an object ID that defines your place in the list. + /// For instance, if you make a list request and receive 100 objects, starting with `obj_bar`, your subsequent call can include `ending_before=obj_bar` in order to fetch the previous page of the list. + #[serde(skip_serializing_if = "Option::is_none")] + pub ending_before: Option<&'a str>, + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, + /// A limit on the number of objects to be returned. + /// Limit can range between 1 and 100, and the default is 10. + #[serde(skip_serializing_if = "Option::is_none")] + pub limit: Option, + /// A cursor for use in pagination. + /// `starting_after` is an object ID that defines your place in the list. + /// For instance, if you make a list request and receive 100 objects, ending with `obj_foo`, your subsequent call can include `starting_after=obj_foo` in order to fetch the next page of the list. + #[serde(skip_serializing_if = "Option::is_none")] + pub starting_after: Option<&'a str>, +} +impl<'a> ListSubscriptionItemUsageRecordSummary<'a> { + pub fn new() -> Self { + Self::default() + } +} +impl<'a> ListSubscriptionItemUsageRecordSummary<'a> { + /// For the specified subscription item, returns a list of summary objects. + /// Each object in the list provides usage information that’s been summarized from multiple usage records and over a subscription billing period (e.g., 15 usage records in the month of September). + /// + /// The list is sorted in reverse-chronological order (newest first). + /// The first list item represents the most current usage period that hasn’t ended yet. + /// Since new usage records can still be added, the returned summary information for the subscription item’s ID should be seen as unstable until the subscription billing period ends. + pub fn send( + &self, + client: &stripe::Client, + subscription_item: &stripe_shared::SubscriptionItemId, + ) -> stripe::Response> { + client.get_query( + &format!("/subscription_items/{subscription_item}/usage_record_summaries"), + self, + ) + } + pub fn paginate( + self, + subscription_item: &stripe_shared::SubscriptionItemId, + ) -> stripe::ListPaginator> { + stripe::ListPaginator::from_list_params( + &format!("/subscription_items/{subscription_item}/usage_record_summaries"), + self, + ) + } +} diff --git a/generated/stripe_checkout/Cargo.toml b/generated/stripe_checkout/Cargo.toml new file mode 100644 index 000000000..11ffe804b --- /dev/null +++ b/generated/stripe_checkout/Cargo.toml @@ -0,0 +1,46 @@ +[package] +name = "stripe_checkout" +version.workspace = true +description.workspace = true +edition.workspace = true +rust-version.workspace = true +authors.workspace = true +license.workspace = true +homepage.workspace = true +repository.workspace = true +keywords.workspace = true +categories.workspace = true + +[lib] +path = "src/mod.rs" + +[dependencies] +serde.workspace = true +smol_str.workspace = true +serde_json.workspace = true +stripe_types = {path = "../../stripe_types"} + +http-types.workspace = true +async-stripe = {path = "../../async-stripe"} + + +stripe_shared = {path = "../../generated/stripe_shared"} + + +[features] +runtime-tokio-hyper = ["async-stripe/runtime-tokio-hyper"] +runtime-tokio-hyper-rustls = ["async-stripe/runtime-tokio-hyper-rustls"] +runtime-tokio-hyper-rustls-webpki = ["async-stripe/runtime-tokio-hyper-rustls-webpki"] +runtime-blocking = ["async-stripe/runtime-blocking"] +runtime-blocking-rustls = ["async-stripe/runtime-blocking-rustls"] +runtime-blocking-rustls-webpki = ["async-stripe/runtime-blocking-rustls-webpki"] +runtime-async-std-surf = ["async-stripe/runtime-async-std-surf"] + +checkout_session = [] + +full = ["checkout_session"] + + +[package.metadata.docs.rs] +features = ["runtime-tokio-hyper", "full"] + diff --git a/generated/stripe_checkout/src/checkout_acss_debit_mandate_options.rs b/generated/stripe_checkout/src/checkout_acss_debit_mandate_options.rs new file mode 100644 index 000000000..59a1eee71 --- /dev/null +++ b/generated/stripe_checkout/src/checkout_acss_debit_mandate_options.rs @@ -0,0 +1,190 @@ +#[derive(Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct CheckoutAcssDebitMandateOptions { + /// A URL for custom mandate text + #[serde(skip_serializing_if = "Option::is_none")] + pub custom_mandate_url: Option, + /// List of Stripe products where this mandate can be selected automatically. + /// Returned when the Session is in `setup` mode. + #[serde(skip_serializing_if = "Option::is_none")] + pub default_for: Option>, + /// Description of the interval. + /// Only required if the 'payment_schedule' parameter is 'interval' or 'combined'. + pub interval_description: Option, + /// Payment schedule for the mandate. + pub payment_schedule: Option, + /// Transaction type of the mandate. + pub transaction_type: Option, +} +/// List of Stripe products where this mandate can be selected automatically. +/// Returned when the Session is in `setup` mode. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CheckoutAcssDebitMandateOptionsDefaultFor { + Invoice, + Subscription, +} +impl CheckoutAcssDebitMandateOptionsDefaultFor { + pub fn as_str(self) -> &'static str { + use CheckoutAcssDebitMandateOptionsDefaultFor::*; + match self { + Invoice => "invoice", + Subscription => "subscription", + } + } +} + +impl std::str::FromStr for CheckoutAcssDebitMandateOptionsDefaultFor { + type Err = (); + fn from_str(s: &str) -> Result { + use CheckoutAcssDebitMandateOptionsDefaultFor::*; + match s { + "invoice" => Ok(Invoice), + "subscription" => Ok(Subscription), + _ => Err(()), + } + } +} +impl std::fmt::Display for CheckoutAcssDebitMandateOptionsDefaultFor { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CheckoutAcssDebitMandateOptionsDefaultFor { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CheckoutAcssDebitMandateOptionsDefaultFor { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for CheckoutAcssDebitMandateOptionsDefaultFor { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| { + serde::de::Error::custom("Unknown value for CheckoutAcssDebitMandateOptionsDefaultFor") + }) + } +} +/// Payment schedule for the mandate. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CheckoutAcssDebitMandateOptionsPaymentSchedule { + Combined, + Interval, + Sporadic, +} +impl CheckoutAcssDebitMandateOptionsPaymentSchedule { + pub fn as_str(self) -> &'static str { + use CheckoutAcssDebitMandateOptionsPaymentSchedule::*; + match self { + Combined => "combined", + Interval => "interval", + Sporadic => "sporadic", + } + } +} + +impl std::str::FromStr for CheckoutAcssDebitMandateOptionsPaymentSchedule { + type Err = (); + fn from_str(s: &str) -> Result { + use CheckoutAcssDebitMandateOptionsPaymentSchedule::*; + match s { + "combined" => Ok(Combined), + "interval" => Ok(Interval), + "sporadic" => Ok(Sporadic), + _ => Err(()), + } + } +} +impl std::fmt::Display for CheckoutAcssDebitMandateOptionsPaymentSchedule { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CheckoutAcssDebitMandateOptionsPaymentSchedule { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CheckoutAcssDebitMandateOptionsPaymentSchedule { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for CheckoutAcssDebitMandateOptionsPaymentSchedule { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| { + serde::de::Error::custom( + "Unknown value for CheckoutAcssDebitMandateOptionsPaymentSchedule", + ) + }) + } +} +/// Transaction type of the mandate. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CheckoutAcssDebitMandateOptionsTransactionType { + Business, + Personal, +} +impl CheckoutAcssDebitMandateOptionsTransactionType { + pub fn as_str(self) -> &'static str { + use CheckoutAcssDebitMandateOptionsTransactionType::*; + match self { + Business => "business", + Personal => "personal", + } + } +} + +impl std::str::FromStr for CheckoutAcssDebitMandateOptionsTransactionType { + type Err = (); + fn from_str(s: &str) -> Result { + use CheckoutAcssDebitMandateOptionsTransactionType::*; + match s { + "business" => Ok(Business), + "personal" => Ok(Personal), + _ => Err(()), + } + } +} +impl std::fmt::Display for CheckoutAcssDebitMandateOptionsTransactionType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CheckoutAcssDebitMandateOptionsTransactionType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CheckoutAcssDebitMandateOptionsTransactionType { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for CheckoutAcssDebitMandateOptionsTransactionType { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| { + serde::de::Error::custom( + "Unknown value for CheckoutAcssDebitMandateOptionsTransactionType", + ) + }) + } +} diff --git a/generated/stripe_checkout/src/checkout_acss_debit_payment_method_options.rs b/generated/stripe_checkout/src/checkout_acss_debit_payment_method_options.rs new file mode 100644 index 000000000..68061a1ca --- /dev/null +++ b/generated/stripe_checkout/src/checkout_acss_debit_payment_method_options.rs @@ -0,0 +1,201 @@ +#[derive(Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct CheckoutAcssDebitPaymentMethodOptions { + /// Currency supported by the bank account. Returned when the Session is in `setup` mode. + #[serde(skip_serializing_if = "Option::is_none")] + pub currency: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub mandate_options: Option, + /// Indicates that you intend to make future payments with this PaymentIntent's payment method. + /// + /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. + /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + /// + /// When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + #[serde(skip_serializing_if = "Option::is_none")] + pub setup_future_usage: Option, + /// Bank account verification method. + #[serde(skip_serializing_if = "Option::is_none")] + pub verification_method: Option, +} +/// Currency supported by the bank account. Returned when the Session is in `setup` mode. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CheckoutAcssDebitPaymentMethodOptionsCurrency { + Cad, + Usd, +} +impl CheckoutAcssDebitPaymentMethodOptionsCurrency { + pub fn as_str(self) -> &'static str { + use CheckoutAcssDebitPaymentMethodOptionsCurrency::*; + match self { + Cad => "cad", + Usd => "usd", + } + } +} + +impl std::str::FromStr for CheckoutAcssDebitPaymentMethodOptionsCurrency { + type Err = (); + fn from_str(s: &str) -> Result { + use CheckoutAcssDebitPaymentMethodOptionsCurrency::*; + match s { + "cad" => Ok(Cad), + "usd" => Ok(Usd), + _ => Err(()), + } + } +} +impl std::fmt::Display for CheckoutAcssDebitPaymentMethodOptionsCurrency { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CheckoutAcssDebitPaymentMethodOptionsCurrency { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CheckoutAcssDebitPaymentMethodOptionsCurrency { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for CheckoutAcssDebitPaymentMethodOptionsCurrency { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| { + serde::de::Error::custom( + "Unknown value for CheckoutAcssDebitPaymentMethodOptionsCurrency", + ) + }) + } +} +/// Indicates that you intend to make future payments with this PaymentIntent's payment method. +/// +/// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. +/// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. +/// +/// When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CheckoutAcssDebitPaymentMethodOptionsSetupFutureUsage { + None, + OffSession, + OnSession, +} +impl CheckoutAcssDebitPaymentMethodOptionsSetupFutureUsage { + pub fn as_str(self) -> &'static str { + use CheckoutAcssDebitPaymentMethodOptionsSetupFutureUsage::*; + match self { + None => "none", + OffSession => "off_session", + OnSession => "on_session", + } + } +} + +impl std::str::FromStr for CheckoutAcssDebitPaymentMethodOptionsSetupFutureUsage { + type Err = (); + fn from_str(s: &str) -> Result { + use CheckoutAcssDebitPaymentMethodOptionsSetupFutureUsage::*; + match s { + "none" => Ok(None), + "off_session" => Ok(OffSession), + "on_session" => Ok(OnSession), + _ => Err(()), + } + } +} +impl std::fmt::Display for CheckoutAcssDebitPaymentMethodOptionsSetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CheckoutAcssDebitPaymentMethodOptionsSetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CheckoutAcssDebitPaymentMethodOptionsSetupFutureUsage { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for CheckoutAcssDebitPaymentMethodOptionsSetupFutureUsage { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| { + serde::de::Error::custom( + "Unknown value for CheckoutAcssDebitPaymentMethodOptionsSetupFutureUsage", + ) + }) + } +} +/// Bank account verification method. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CheckoutAcssDebitPaymentMethodOptionsVerificationMethod { + Automatic, + Instant, + Microdeposits, +} +impl CheckoutAcssDebitPaymentMethodOptionsVerificationMethod { + pub fn as_str(self) -> &'static str { + use CheckoutAcssDebitPaymentMethodOptionsVerificationMethod::*; + match self { + Automatic => "automatic", + Instant => "instant", + Microdeposits => "microdeposits", + } + } +} + +impl std::str::FromStr for CheckoutAcssDebitPaymentMethodOptionsVerificationMethod { + type Err = (); + fn from_str(s: &str) -> Result { + use CheckoutAcssDebitPaymentMethodOptionsVerificationMethod::*; + match s { + "automatic" => Ok(Automatic), + "instant" => Ok(Instant), + "microdeposits" => Ok(Microdeposits), + _ => Err(()), + } + } +} +impl std::fmt::Display for CheckoutAcssDebitPaymentMethodOptionsVerificationMethod { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CheckoutAcssDebitPaymentMethodOptionsVerificationMethod { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CheckoutAcssDebitPaymentMethodOptionsVerificationMethod { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for CheckoutAcssDebitPaymentMethodOptionsVerificationMethod { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| { + serde::de::Error::custom( + "Unknown value for CheckoutAcssDebitPaymentMethodOptionsVerificationMethod", + ) + }) + } +} diff --git a/generated/stripe_checkout/src/checkout_affirm_payment_method_options.rs b/generated/stripe_checkout/src/checkout_affirm_payment_method_options.rs new file mode 100644 index 000000000..80604c1c6 --- /dev/null +++ b/generated/stripe_checkout/src/checkout_affirm_payment_method_options.rs @@ -0,0 +1,70 @@ +#[derive(Copy, Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct CheckoutAffirmPaymentMethodOptions { + /// Indicates that you intend to make future payments with this PaymentIntent's payment method. + /// + /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. + /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + /// + /// When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + #[serde(skip_serializing_if = "Option::is_none")] + pub setup_future_usage: Option, +} +/// Indicates that you intend to make future payments with this PaymentIntent's payment method. +/// +/// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. +/// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. +/// +/// When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CheckoutAffirmPaymentMethodOptionsSetupFutureUsage { + None, +} +impl CheckoutAffirmPaymentMethodOptionsSetupFutureUsage { + pub fn as_str(self) -> &'static str { + use CheckoutAffirmPaymentMethodOptionsSetupFutureUsage::*; + match self { + None => "none", + } + } +} + +impl std::str::FromStr for CheckoutAffirmPaymentMethodOptionsSetupFutureUsage { + type Err = (); + fn from_str(s: &str) -> Result { + use CheckoutAffirmPaymentMethodOptionsSetupFutureUsage::*; + match s { + "none" => Ok(None), + _ => Err(()), + } + } +} +impl std::fmt::Display for CheckoutAffirmPaymentMethodOptionsSetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CheckoutAffirmPaymentMethodOptionsSetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CheckoutAffirmPaymentMethodOptionsSetupFutureUsage { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for CheckoutAffirmPaymentMethodOptionsSetupFutureUsage { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| { + serde::de::Error::custom( + "Unknown value for CheckoutAffirmPaymentMethodOptionsSetupFutureUsage", + ) + }) + } +} diff --git a/generated/stripe_checkout/src/checkout_afterpay_clearpay_payment_method_options.rs b/generated/stripe_checkout/src/checkout_afterpay_clearpay_payment_method_options.rs new file mode 100644 index 000000000..c61d395ef --- /dev/null +++ b/generated/stripe_checkout/src/checkout_afterpay_clearpay_payment_method_options.rs @@ -0,0 +1,70 @@ +#[derive(Copy, Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct CheckoutAfterpayClearpayPaymentMethodOptions { + /// Indicates that you intend to make future payments with this PaymentIntent's payment method. + /// + /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. + /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + /// + /// When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + #[serde(skip_serializing_if = "Option::is_none")] + pub setup_future_usage: Option, +} +/// Indicates that you intend to make future payments with this PaymentIntent's payment method. +/// +/// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. +/// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. +/// +/// When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CheckoutAfterpayClearpayPaymentMethodOptionsSetupFutureUsage { + None, +} +impl CheckoutAfterpayClearpayPaymentMethodOptionsSetupFutureUsage { + pub fn as_str(self) -> &'static str { + use CheckoutAfterpayClearpayPaymentMethodOptionsSetupFutureUsage::*; + match self { + None => "none", + } + } +} + +impl std::str::FromStr for CheckoutAfterpayClearpayPaymentMethodOptionsSetupFutureUsage { + type Err = (); + fn from_str(s: &str) -> Result { + use CheckoutAfterpayClearpayPaymentMethodOptionsSetupFutureUsage::*; + match s { + "none" => Ok(None), + _ => Err(()), + } + } +} +impl std::fmt::Display for CheckoutAfterpayClearpayPaymentMethodOptionsSetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CheckoutAfterpayClearpayPaymentMethodOptionsSetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CheckoutAfterpayClearpayPaymentMethodOptionsSetupFutureUsage { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for CheckoutAfterpayClearpayPaymentMethodOptionsSetupFutureUsage { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| { + serde::de::Error::custom( + "Unknown value for CheckoutAfterpayClearpayPaymentMethodOptionsSetupFutureUsage", + ) + }) + } +} diff --git a/generated/stripe_checkout/src/checkout_alipay_payment_method_options.rs b/generated/stripe_checkout/src/checkout_alipay_payment_method_options.rs new file mode 100644 index 000000000..6d3b2d22f --- /dev/null +++ b/generated/stripe_checkout/src/checkout_alipay_payment_method_options.rs @@ -0,0 +1,70 @@ +#[derive(Copy, Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct CheckoutAlipayPaymentMethodOptions { + /// Indicates that you intend to make future payments with this PaymentIntent's payment method. + /// + /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. + /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + /// + /// When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + #[serde(skip_serializing_if = "Option::is_none")] + pub setup_future_usage: Option, +} +/// Indicates that you intend to make future payments with this PaymentIntent's payment method. +/// +/// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. +/// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. +/// +/// When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CheckoutAlipayPaymentMethodOptionsSetupFutureUsage { + None, +} +impl CheckoutAlipayPaymentMethodOptionsSetupFutureUsage { + pub fn as_str(self) -> &'static str { + use CheckoutAlipayPaymentMethodOptionsSetupFutureUsage::*; + match self { + None => "none", + } + } +} + +impl std::str::FromStr for CheckoutAlipayPaymentMethodOptionsSetupFutureUsage { + type Err = (); + fn from_str(s: &str) -> Result { + use CheckoutAlipayPaymentMethodOptionsSetupFutureUsage::*; + match s { + "none" => Ok(None), + _ => Err(()), + } + } +} +impl std::fmt::Display for CheckoutAlipayPaymentMethodOptionsSetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CheckoutAlipayPaymentMethodOptionsSetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CheckoutAlipayPaymentMethodOptionsSetupFutureUsage { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for CheckoutAlipayPaymentMethodOptionsSetupFutureUsage { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| { + serde::de::Error::custom( + "Unknown value for CheckoutAlipayPaymentMethodOptionsSetupFutureUsage", + ) + }) + } +} diff --git a/generated/stripe_checkout/src/checkout_au_becs_debit_payment_method_options.rs b/generated/stripe_checkout/src/checkout_au_becs_debit_payment_method_options.rs new file mode 100644 index 000000000..4f9c61203 --- /dev/null +++ b/generated/stripe_checkout/src/checkout_au_becs_debit_payment_method_options.rs @@ -0,0 +1,70 @@ +#[derive(Copy, Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct CheckoutAuBecsDebitPaymentMethodOptions { + /// Indicates that you intend to make future payments with this PaymentIntent's payment method. + /// + /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. + /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + /// + /// When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + #[serde(skip_serializing_if = "Option::is_none")] + pub setup_future_usage: Option, +} +/// Indicates that you intend to make future payments with this PaymentIntent's payment method. +/// +/// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. +/// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. +/// +/// When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CheckoutAuBecsDebitPaymentMethodOptionsSetupFutureUsage { + None, +} +impl CheckoutAuBecsDebitPaymentMethodOptionsSetupFutureUsage { + pub fn as_str(self) -> &'static str { + use CheckoutAuBecsDebitPaymentMethodOptionsSetupFutureUsage::*; + match self { + None => "none", + } + } +} + +impl std::str::FromStr for CheckoutAuBecsDebitPaymentMethodOptionsSetupFutureUsage { + type Err = (); + fn from_str(s: &str) -> Result { + use CheckoutAuBecsDebitPaymentMethodOptionsSetupFutureUsage::*; + match s { + "none" => Ok(None), + _ => Err(()), + } + } +} +impl std::fmt::Display for CheckoutAuBecsDebitPaymentMethodOptionsSetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CheckoutAuBecsDebitPaymentMethodOptionsSetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CheckoutAuBecsDebitPaymentMethodOptionsSetupFutureUsage { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for CheckoutAuBecsDebitPaymentMethodOptionsSetupFutureUsage { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| { + serde::de::Error::custom( + "Unknown value for CheckoutAuBecsDebitPaymentMethodOptionsSetupFutureUsage", + ) + }) + } +} diff --git a/generated/stripe_checkout/src/checkout_bacs_debit_payment_method_options.rs b/generated/stripe_checkout/src/checkout_bacs_debit_payment_method_options.rs new file mode 100644 index 000000000..b0f75f13d --- /dev/null +++ b/generated/stripe_checkout/src/checkout_bacs_debit_payment_method_options.rs @@ -0,0 +1,76 @@ +#[derive(Copy, Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct CheckoutBacsDebitPaymentMethodOptions { + /// Indicates that you intend to make future payments with this PaymentIntent's payment method. + /// + /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. + /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + /// + /// When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + #[serde(skip_serializing_if = "Option::is_none")] + pub setup_future_usage: Option, +} +/// Indicates that you intend to make future payments with this PaymentIntent's payment method. +/// +/// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. +/// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. +/// +/// When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CheckoutBacsDebitPaymentMethodOptionsSetupFutureUsage { + None, + OffSession, + OnSession, +} +impl CheckoutBacsDebitPaymentMethodOptionsSetupFutureUsage { + pub fn as_str(self) -> &'static str { + use CheckoutBacsDebitPaymentMethodOptionsSetupFutureUsage::*; + match self { + None => "none", + OffSession => "off_session", + OnSession => "on_session", + } + } +} + +impl std::str::FromStr for CheckoutBacsDebitPaymentMethodOptionsSetupFutureUsage { + type Err = (); + fn from_str(s: &str) -> Result { + use CheckoutBacsDebitPaymentMethodOptionsSetupFutureUsage::*; + match s { + "none" => Ok(None), + "off_session" => Ok(OffSession), + "on_session" => Ok(OnSession), + _ => Err(()), + } + } +} +impl std::fmt::Display for CheckoutBacsDebitPaymentMethodOptionsSetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CheckoutBacsDebitPaymentMethodOptionsSetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CheckoutBacsDebitPaymentMethodOptionsSetupFutureUsage { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for CheckoutBacsDebitPaymentMethodOptionsSetupFutureUsage { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| { + serde::de::Error::custom( + "Unknown value for CheckoutBacsDebitPaymentMethodOptionsSetupFutureUsage", + ) + }) + } +} diff --git a/generated/stripe_checkout/src/checkout_bancontact_payment_method_options.rs b/generated/stripe_checkout/src/checkout_bancontact_payment_method_options.rs new file mode 100644 index 000000000..314fae8b3 --- /dev/null +++ b/generated/stripe_checkout/src/checkout_bancontact_payment_method_options.rs @@ -0,0 +1,70 @@ +#[derive(Copy, Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct CheckoutBancontactPaymentMethodOptions { + /// Indicates that you intend to make future payments with this PaymentIntent's payment method. + /// + /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. + /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + /// + /// When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + #[serde(skip_serializing_if = "Option::is_none")] + pub setup_future_usage: Option, +} +/// Indicates that you intend to make future payments with this PaymentIntent's payment method. +/// +/// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. +/// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. +/// +/// When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CheckoutBancontactPaymentMethodOptionsSetupFutureUsage { + None, +} +impl CheckoutBancontactPaymentMethodOptionsSetupFutureUsage { + pub fn as_str(self) -> &'static str { + use CheckoutBancontactPaymentMethodOptionsSetupFutureUsage::*; + match self { + None => "none", + } + } +} + +impl std::str::FromStr for CheckoutBancontactPaymentMethodOptionsSetupFutureUsage { + type Err = (); + fn from_str(s: &str) -> Result { + use CheckoutBancontactPaymentMethodOptionsSetupFutureUsage::*; + match s { + "none" => Ok(None), + _ => Err(()), + } + } +} +impl std::fmt::Display for CheckoutBancontactPaymentMethodOptionsSetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CheckoutBancontactPaymentMethodOptionsSetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CheckoutBancontactPaymentMethodOptionsSetupFutureUsage { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for CheckoutBancontactPaymentMethodOptionsSetupFutureUsage { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| { + serde::de::Error::custom( + "Unknown value for CheckoutBancontactPaymentMethodOptionsSetupFutureUsage", + ) + }) + } +} diff --git a/generated/stripe_checkout/src/checkout_boleto_payment_method_options.rs b/generated/stripe_checkout/src/checkout_boleto_payment_method_options.rs new file mode 100644 index 000000000..ae3822b76 --- /dev/null +++ b/generated/stripe_checkout/src/checkout_boleto_payment_method_options.rs @@ -0,0 +1,79 @@ +#[derive(Copy, Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct CheckoutBoletoPaymentMethodOptions { + /// The number of calendar days before a Boleto voucher expires. + /// For example, if you create a Boleto voucher on Monday and you set expires_after_days to 2, the Boleto voucher will expire on Wednesday at 23:59 America/Sao_Paulo time. + pub expires_after_days: u32, + /// Indicates that you intend to make future payments with this PaymentIntent's payment method. + /// + /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. + /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + /// + /// When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + #[serde(skip_serializing_if = "Option::is_none")] + pub setup_future_usage: Option, +} +/// Indicates that you intend to make future payments with this PaymentIntent's payment method. +/// +/// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. +/// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. +/// +/// When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CheckoutBoletoPaymentMethodOptionsSetupFutureUsage { + None, + OffSession, + OnSession, +} +impl CheckoutBoletoPaymentMethodOptionsSetupFutureUsage { + pub fn as_str(self) -> &'static str { + use CheckoutBoletoPaymentMethodOptionsSetupFutureUsage::*; + match self { + None => "none", + OffSession => "off_session", + OnSession => "on_session", + } + } +} + +impl std::str::FromStr for CheckoutBoletoPaymentMethodOptionsSetupFutureUsage { + type Err = (); + fn from_str(s: &str) -> Result { + use CheckoutBoletoPaymentMethodOptionsSetupFutureUsage::*; + match s { + "none" => Ok(None), + "off_session" => Ok(OffSession), + "on_session" => Ok(OnSession), + _ => Err(()), + } + } +} +impl std::fmt::Display for CheckoutBoletoPaymentMethodOptionsSetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CheckoutBoletoPaymentMethodOptionsSetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CheckoutBoletoPaymentMethodOptionsSetupFutureUsage { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for CheckoutBoletoPaymentMethodOptionsSetupFutureUsage { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| { + serde::de::Error::custom( + "Unknown value for CheckoutBoletoPaymentMethodOptionsSetupFutureUsage", + ) + }) + } +} diff --git a/generated/stripe_checkout/src/checkout_card_installments_options.rs b/generated/stripe_checkout/src/checkout_card_installments_options.rs new file mode 100644 index 000000000..369b58057 --- /dev/null +++ b/generated/stripe_checkout/src/checkout_card_installments_options.rs @@ -0,0 +1,6 @@ +#[derive(Copy, Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct CheckoutCardInstallmentsOptions { + /// Indicates if installments are enabled + #[serde(skip_serializing_if = "Option::is_none")] + pub enabled: Option, +} diff --git a/generated/stripe_checkout/src/checkout_card_payment_method_options.rs b/generated/stripe_checkout/src/checkout_card_payment_method_options.rs new file mode 100644 index 000000000..9ffb49170 --- /dev/null +++ b/generated/stripe_checkout/src/checkout_card_payment_method_options.rs @@ -0,0 +1,90 @@ +#[derive(Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct CheckoutCardPaymentMethodOptions { + #[serde(skip_serializing_if = "Option::is_none")] + pub installments: Option, + /// Indicates that you intend to make future payments with this PaymentIntent's payment method. + /// + /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. + /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + /// + /// When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + #[serde(skip_serializing_if = "Option::is_none")] + pub setup_future_usage: Option, + /// Provides information about a card payment that customers see on their statements. + /// Concatenated with the Kana prefix (shortened Kana descriptor) or Kana statement descriptor that’s set on the account to form the complete statement descriptor. + /// Maximum 22 characters. + /// On card statements, the *concatenation* of both prefix and suffix (including separators) will appear truncated to 22 characters. + #[serde(skip_serializing_if = "Option::is_none")] + pub statement_descriptor_suffix_kana: Option, + /// Provides information about a card payment that customers see on their statements. + /// Concatenated with the Kanji prefix (shortened Kanji descriptor) or Kanji statement descriptor that’s set on the account to form the complete statement descriptor. + /// Maximum 17 characters. + /// On card statements, the *concatenation* of both prefix and suffix (including separators) will appear truncated to 17 characters. + #[serde(skip_serializing_if = "Option::is_none")] + pub statement_descriptor_suffix_kanji: Option, +} +/// Indicates that you intend to make future payments with this PaymentIntent's payment method. +/// +/// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. +/// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. +/// +/// When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CheckoutCardPaymentMethodOptionsSetupFutureUsage { + None, + OffSession, + OnSession, +} +impl CheckoutCardPaymentMethodOptionsSetupFutureUsage { + pub fn as_str(self) -> &'static str { + use CheckoutCardPaymentMethodOptionsSetupFutureUsage::*; + match self { + None => "none", + OffSession => "off_session", + OnSession => "on_session", + } + } +} + +impl std::str::FromStr for CheckoutCardPaymentMethodOptionsSetupFutureUsage { + type Err = (); + fn from_str(s: &str) -> Result { + use CheckoutCardPaymentMethodOptionsSetupFutureUsage::*; + match s { + "none" => Ok(None), + "off_session" => Ok(OffSession), + "on_session" => Ok(OnSession), + _ => Err(()), + } + } +} +impl std::fmt::Display for CheckoutCardPaymentMethodOptionsSetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CheckoutCardPaymentMethodOptionsSetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CheckoutCardPaymentMethodOptionsSetupFutureUsage { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for CheckoutCardPaymentMethodOptionsSetupFutureUsage { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| { + serde::de::Error::custom( + "Unknown value for CheckoutCardPaymentMethodOptionsSetupFutureUsage", + ) + }) + } +} diff --git a/generated/stripe_checkout/src/checkout_cashapp_payment_method_options.rs b/generated/stripe_checkout/src/checkout_cashapp_payment_method_options.rs new file mode 100644 index 000000000..46f388cf5 --- /dev/null +++ b/generated/stripe_checkout/src/checkout_cashapp_payment_method_options.rs @@ -0,0 +1,70 @@ +#[derive(Copy, Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct CheckoutCashappPaymentMethodOptions { + /// Indicates that you intend to make future payments with this PaymentIntent's payment method. + /// + /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. + /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + /// + /// When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + #[serde(skip_serializing_if = "Option::is_none")] + pub setup_future_usage: Option, +} +/// Indicates that you intend to make future payments with this PaymentIntent's payment method. +/// +/// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. +/// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. +/// +/// When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CheckoutCashappPaymentMethodOptionsSetupFutureUsage { + None, +} +impl CheckoutCashappPaymentMethodOptionsSetupFutureUsage { + pub fn as_str(self) -> &'static str { + use CheckoutCashappPaymentMethodOptionsSetupFutureUsage::*; + match self { + None => "none", + } + } +} + +impl std::str::FromStr for CheckoutCashappPaymentMethodOptionsSetupFutureUsage { + type Err = (); + fn from_str(s: &str) -> Result { + use CheckoutCashappPaymentMethodOptionsSetupFutureUsage::*; + match s { + "none" => Ok(None), + _ => Err(()), + } + } +} +impl std::fmt::Display for CheckoutCashappPaymentMethodOptionsSetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CheckoutCashappPaymentMethodOptionsSetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CheckoutCashappPaymentMethodOptionsSetupFutureUsage { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for CheckoutCashappPaymentMethodOptionsSetupFutureUsage { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| { + serde::de::Error::custom( + "Unknown value for CheckoutCashappPaymentMethodOptionsSetupFutureUsage", + ) + }) + } +} diff --git a/generated/stripe_checkout/src/checkout_customer_balance_bank_transfer_payment_method_options.rs b/generated/stripe_checkout/src/checkout_customer_balance_bank_transfer_payment_method_options.rs new file mode 100644 index 000000000..3641e961b --- /dev/null +++ b/generated/stripe_checkout/src/checkout_customer_balance_bank_transfer_payment_method_options.rs @@ -0,0 +1,162 @@ +#[derive(Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct CheckoutCustomerBalanceBankTransferPaymentMethodOptions { + #[serde(skip_serializing_if = "Option::is_none")] + pub eu_bank_transfer: Option, + /// List of address types that should be returned in the financial_addresses response. + /// If not specified, all valid types will be returned. + /// + /// Permitted values include: `sort_code`, `zengin`, `iban`, or `spei`. + #[serde(skip_serializing_if = "Option::is_none")] + pub requested_address_types: + Option>, + /// The bank transfer type that this PaymentIntent is allowed to use for funding Permitted values include: `eu_bank_transfer`, `gb_bank_transfer`, `jp_bank_transfer`, `mx_bank_transfer`, or `us_bank_transfer`. + #[serde(rename = "type")] + pub type_: Option, +} +/// List of address types that should be returned in the financial_addresses response. +/// If not specified, all valid types will be returned. +/// +/// Permitted values include: `sort_code`, `zengin`, `iban`, or `spei`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CheckoutCustomerBalanceBankTransferPaymentMethodOptionsRequestedAddressTypes { + Aba, + Iban, + Sepa, + SortCode, + Spei, + Swift, + Zengin, +} +impl CheckoutCustomerBalanceBankTransferPaymentMethodOptionsRequestedAddressTypes { + pub fn as_str(self) -> &'static str { + use CheckoutCustomerBalanceBankTransferPaymentMethodOptionsRequestedAddressTypes::*; + match self { + Aba => "aba", + Iban => "iban", + Sepa => "sepa", + SortCode => "sort_code", + Spei => "spei", + Swift => "swift", + Zengin => "zengin", + } + } +} + +impl std::str::FromStr + for CheckoutCustomerBalanceBankTransferPaymentMethodOptionsRequestedAddressTypes +{ + type Err = (); + fn from_str(s: &str) -> Result { + use CheckoutCustomerBalanceBankTransferPaymentMethodOptionsRequestedAddressTypes::*; + match s { + "aba" => Ok(Aba), + "iban" => Ok(Iban), + "sepa" => Ok(Sepa), + "sort_code" => Ok(SortCode), + "spei" => Ok(Spei), + "swift" => Ok(Swift), + "zengin" => Ok(Zengin), + _ => Err(()), + } + } +} +impl std::fmt::Display + for CheckoutCustomerBalanceBankTransferPaymentMethodOptionsRequestedAddressTypes +{ + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug + for CheckoutCustomerBalanceBankTransferPaymentMethodOptionsRequestedAddressTypes +{ + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize + for CheckoutCustomerBalanceBankTransferPaymentMethodOptionsRequestedAddressTypes +{ + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> + for CheckoutCustomerBalanceBankTransferPaymentMethodOptionsRequestedAddressTypes +{ + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for CheckoutCustomerBalanceBankTransferPaymentMethodOptionsRequestedAddressTypes")) + } +} +/// The bank transfer type that this PaymentIntent is allowed to use for funding Permitted values include: `eu_bank_transfer`, `gb_bank_transfer`, `jp_bank_transfer`, `mx_bank_transfer`, or `us_bank_transfer`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CheckoutCustomerBalanceBankTransferPaymentMethodOptionsType { + EuBankTransfer, + GbBankTransfer, + JpBankTransfer, + MxBankTransfer, + UsBankTransfer, +} +impl CheckoutCustomerBalanceBankTransferPaymentMethodOptionsType { + pub fn as_str(self) -> &'static str { + use CheckoutCustomerBalanceBankTransferPaymentMethodOptionsType::*; + match self { + EuBankTransfer => "eu_bank_transfer", + GbBankTransfer => "gb_bank_transfer", + JpBankTransfer => "jp_bank_transfer", + MxBankTransfer => "mx_bank_transfer", + UsBankTransfer => "us_bank_transfer", + } + } +} + +impl std::str::FromStr for CheckoutCustomerBalanceBankTransferPaymentMethodOptionsType { + type Err = (); + fn from_str(s: &str) -> Result { + use CheckoutCustomerBalanceBankTransferPaymentMethodOptionsType::*; + match s { + "eu_bank_transfer" => Ok(EuBankTransfer), + "gb_bank_transfer" => Ok(GbBankTransfer), + "jp_bank_transfer" => Ok(JpBankTransfer), + "mx_bank_transfer" => Ok(MxBankTransfer), + "us_bank_transfer" => Ok(UsBankTransfer), + _ => Err(()), + } + } +} +impl std::fmt::Display for CheckoutCustomerBalanceBankTransferPaymentMethodOptionsType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CheckoutCustomerBalanceBankTransferPaymentMethodOptionsType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CheckoutCustomerBalanceBankTransferPaymentMethodOptionsType { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for CheckoutCustomerBalanceBankTransferPaymentMethodOptionsType { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| { + serde::de::Error::custom( + "Unknown value for CheckoutCustomerBalanceBankTransferPaymentMethodOptionsType", + ) + }) + } +} diff --git a/generated/stripe_checkout/src/checkout_customer_balance_payment_method_options.rs b/generated/stripe_checkout/src/checkout_customer_balance_payment_method_options.rs new file mode 100644 index 000000000..19bab27af --- /dev/null +++ b/generated/stripe_checkout/src/checkout_customer_balance_payment_method_options.rs @@ -0,0 +1,131 @@ +#[derive(Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct CheckoutCustomerBalancePaymentMethodOptions { + #[serde(skip_serializing_if = "Option::is_none")] + pub bank_transfer: + Option, + /// The funding method type to be used when there are not enough funds in the customer balance. + /// Permitted values include: `bank_transfer`. + pub funding_type: Option, + /// Indicates that you intend to make future payments with this PaymentIntent's payment method. + /// + /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. + /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + /// + /// When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + #[serde(skip_serializing_if = "Option::is_none")] + pub setup_future_usage: Option, +} +/// The funding method type to be used when there are not enough funds in the customer balance. +/// Permitted values include: `bank_transfer`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CheckoutCustomerBalancePaymentMethodOptionsFundingType { + BankTransfer, +} +impl CheckoutCustomerBalancePaymentMethodOptionsFundingType { + pub fn as_str(self) -> &'static str { + use CheckoutCustomerBalancePaymentMethodOptionsFundingType::*; + match self { + BankTransfer => "bank_transfer", + } + } +} + +impl std::str::FromStr for CheckoutCustomerBalancePaymentMethodOptionsFundingType { + type Err = (); + fn from_str(s: &str) -> Result { + use CheckoutCustomerBalancePaymentMethodOptionsFundingType::*; + match s { + "bank_transfer" => Ok(BankTransfer), + _ => Err(()), + } + } +} +impl std::fmt::Display for CheckoutCustomerBalancePaymentMethodOptionsFundingType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CheckoutCustomerBalancePaymentMethodOptionsFundingType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CheckoutCustomerBalancePaymentMethodOptionsFundingType { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for CheckoutCustomerBalancePaymentMethodOptionsFundingType { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| { + serde::de::Error::custom( + "Unknown value for CheckoutCustomerBalancePaymentMethodOptionsFundingType", + ) + }) + } +} +/// Indicates that you intend to make future payments with this PaymentIntent's payment method. +/// +/// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. +/// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. +/// +/// When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CheckoutCustomerBalancePaymentMethodOptionsSetupFutureUsage { + None, +} +impl CheckoutCustomerBalancePaymentMethodOptionsSetupFutureUsage { + pub fn as_str(self) -> &'static str { + use CheckoutCustomerBalancePaymentMethodOptionsSetupFutureUsage::*; + match self { + None => "none", + } + } +} + +impl std::str::FromStr for CheckoutCustomerBalancePaymentMethodOptionsSetupFutureUsage { + type Err = (); + fn from_str(s: &str) -> Result { + use CheckoutCustomerBalancePaymentMethodOptionsSetupFutureUsage::*; + match s { + "none" => Ok(None), + _ => Err(()), + } + } +} +impl std::fmt::Display for CheckoutCustomerBalancePaymentMethodOptionsSetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CheckoutCustomerBalancePaymentMethodOptionsSetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CheckoutCustomerBalancePaymentMethodOptionsSetupFutureUsage { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for CheckoutCustomerBalancePaymentMethodOptionsSetupFutureUsage { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| { + serde::de::Error::custom( + "Unknown value for CheckoutCustomerBalancePaymentMethodOptionsSetupFutureUsage", + ) + }) + } +} diff --git a/generated/stripe_checkout/src/checkout_eps_payment_method_options.rs b/generated/stripe_checkout/src/checkout_eps_payment_method_options.rs new file mode 100644 index 000000000..41fe0654f --- /dev/null +++ b/generated/stripe_checkout/src/checkout_eps_payment_method_options.rs @@ -0,0 +1,70 @@ +#[derive(Copy, Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct CheckoutEpsPaymentMethodOptions { + /// Indicates that you intend to make future payments with this PaymentIntent's payment method. + /// + /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. + /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + /// + /// When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + #[serde(skip_serializing_if = "Option::is_none")] + pub setup_future_usage: Option, +} +/// Indicates that you intend to make future payments with this PaymentIntent's payment method. +/// +/// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. +/// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. +/// +/// When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CheckoutEpsPaymentMethodOptionsSetupFutureUsage { + None, +} +impl CheckoutEpsPaymentMethodOptionsSetupFutureUsage { + pub fn as_str(self) -> &'static str { + use CheckoutEpsPaymentMethodOptionsSetupFutureUsage::*; + match self { + None => "none", + } + } +} + +impl std::str::FromStr for CheckoutEpsPaymentMethodOptionsSetupFutureUsage { + type Err = (); + fn from_str(s: &str) -> Result { + use CheckoutEpsPaymentMethodOptionsSetupFutureUsage::*; + match s { + "none" => Ok(None), + _ => Err(()), + } + } +} +impl std::fmt::Display for CheckoutEpsPaymentMethodOptionsSetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CheckoutEpsPaymentMethodOptionsSetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CheckoutEpsPaymentMethodOptionsSetupFutureUsage { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for CheckoutEpsPaymentMethodOptionsSetupFutureUsage { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| { + serde::de::Error::custom( + "Unknown value for CheckoutEpsPaymentMethodOptionsSetupFutureUsage", + ) + }) + } +} diff --git a/generated/stripe_checkout/src/checkout_fpx_payment_method_options.rs b/generated/stripe_checkout/src/checkout_fpx_payment_method_options.rs new file mode 100644 index 000000000..62c72842b --- /dev/null +++ b/generated/stripe_checkout/src/checkout_fpx_payment_method_options.rs @@ -0,0 +1,70 @@ +#[derive(Copy, Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct CheckoutFpxPaymentMethodOptions { + /// Indicates that you intend to make future payments with this PaymentIntent's payment method. + /// + /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. + /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + /// + /// When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + #[serde(skip_serializing_if = "Option::is_none")] + pub setup_future_usage: Option, +} +/// Indicates that you intend to make future payments with this PaymentIntent's payment method. +/// +/// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. +/// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. +/// +/// When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CheckoutFpxPaymentMethodOptionsSetupFutureUsage { + None, +} +impl CheckoutFpxPaymentMethodOptionsSetupFutureUsage { + pub fn as_str(self) -> &'static str { + use CheckoutFpxPaymentMethodOptionsSetupFutureUsage::*; + match self { + None => "none", + } + } +} + +impl std::str::FromStr for CheckoutFpxPaymentMethodOptionsSetupFutureUsage { + type Err = (); + fn from_str(s: &str) -> Result { + use CheckoutFpxPaymentMethodOptionsSetupFutureUsage::*; + match s { + "none" => Ok(None), + _ => Err(()), + } + } +} +impl std::fmt::Display for CheckoutFpxPaymentMethodOptionsSetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CheckoutFpxPaymentMethodOptionsSetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CheckoutFpxPaymentMethodOptionsSetupFutureUsage { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for CheckoutFpxPaymentMethodOptionsSetupFutureUsage { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| { + serde::de::Error::custom( + "Unknown value for CheckoutFpxPaymentMethodOptionsSetupFutureUsage", + ) + }) + } +} diff --git a/generated/stripe_checkout/src/checkout_giropay_payment_method_options.rs b/generated/stripe_checkout/src/checkout_giropay_payment_method_options.rs new file mode 100644 index 000000000..be0f793b1 --- /dev/null +++ b/generated/stripe_checkout/src/checkout_giropay_payment_method_options.rs @@ -0,0 +1,70 @@ +#[derive(Copy, Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct CheckoutGiropayPaymentMethodOptions { + /// Indicates that you intend to make future payments with this PaymentIntent's payment method. + /// + /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. + /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + /// + /// When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + #[serde(skip_serializing_if = "Option::is_none")] + pub setup_future_usage: Option, +} +/// Indicates that you intend to make future payments with this PaymentIntent's payment method. +/// +/// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. +/// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. +/// +/// When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CheckoutGiropayPaymentMethodOptionsSetupFutureUsage { + None, +} +impl CheckoutGiropayPaymentMethodOptionsSetupFutureUsage { + pub fn as_str(self) -> &'static str { + use CheckoutGiropayPaymentMethodOptionsSetupFutureUsage::*; + match self { + None => "none", + } + } +} + +impl std::str::FromStr for CheckoutGiropayPaymentMethodOptionsSetupFutureUsage { + type Err = (); + fn from_str(s: &str) -> Result { + use CheckoutGiropayPaymentMethodOptionsSetupFutureUsage::*; + match s { + "none" => Ok(None), + _ => Err(()), + } + } +} +impl std::fmt::Display for CheckoutGiropayPaymentMethodOptionsSetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CheckoutGiropayPaymentMethodOptionsSetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CheckoutGiropayPaymentMethodOptionsSetupFutureUsage { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for CheckoutGiropayPaymentMethodOptionsSetupFutureUsage { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| { + serde::de::Error::custom( + "Unknown value for CheckoutGiropayPaymentMethodOptionsSetupFutureUsage", + ) + }) + } +} diff --git a/generated/stripe_checkout/src/checkout_grab_pay_payment_method_options.rs b/generated/stripe_checkout/src/checkout_grab_pay_payment_method_options.rs new file mode 100644 index 000000000..45c3689b4 --- /dev/null +++ b/generated/stripe_checkout/src/checkout_grab_pay_payment_method_options.rs @@ -0,0 +1,70 @@ +#[derive(Copy, Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct CheckoutGrabPayPaymentMethodOptions { + /// Indicates that you intend to make future payments with this PaymentIntent's payment method. + /// + /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. + /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + /// + /// When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + #[serde(skip_serializing_if = "Option::is_none")] + pub setup_future_usage: Option, +} +/// Indicates that you intend to make future payments with this PaymentIntent's payment method. +/// +/// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. +/// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. +/// +/// When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CheckoutGrabPayPaymentMethodOptionsSetupFutureUsage { + None, +} +impl CheckoutGrabPayPaymentMethodOptionsSetupFutureUsage { + pub fn as_str(self) -> &'static str { + use CheckoutGrabPayPaymentMethodOptionsSetupFutureUsage::*; + match self { + None => "none", + } + } +} + +impl std::str::FromStr for CheckoutGrabPayPaymentMethodOptionsSetupFutureUsage { + type Err = (); + fn from_str(s: &str) -> Result { + use CheckoutGrabPayPaymentMethodOptionsSetupFutureUsage::*; + match s { + "none" => Ok(None), + _ => Err(()), + } + } +} +impl std::fmt::Display for CheckoutGrabPayPaymentMethodOptionsSetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CheckoutGrabPayPaymentMethodOptionsSetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CheckoutGrabPayPaymentMethodOptionsSetupFutureUsage { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for CheckoutGrabPayPaymentMethodOptionsSetupFutureUsage { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| { + serde::de::Error::custom( + "Unknown value for CheckoutGrabPayPaymentMethodOptionsSetupFutureUsage", + ) + }) + } +} diff --git a/generated/stripe_checkout/src/checkout_ideal_payment_method_options.rs b/generated/stripe_checkout/src/checkout_ideal_payment_method_options.rs new file mode 100644 index 000000000..e65a3ade5 --- /dev/null +++ b/generated/stripe_checkout/src/checkout_ideal_payment_method_options.rs @@ -0,0 +1,70 @@ +#[derive(Copy, Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct CheckoutIdealPaymentMethodOptions { + /// Indicates that you intend to make future payments with this PaymentIntent's payment method. + /// + /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. + /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + /// + /// When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + #[serde(skip_serializing_if = "Option::is_none")] + pub setup_future_usage: Option, +} +/// Indicates that you intend to make future payments with this PaymentIntent's payment method. +/// +/// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. +/// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. +/// +/// When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CheckoutIdealPaymentMethodOptionsSetupFutureUsage { + None, +} +impl CheckoutIdealPaymentMethodOptionsSetupFutureUsage { + pub fn as_str(self) -> &'static str { + use CheckoutIdealPaymentMethodOptionsSetupFutureUsage::*; + match self { + None => "none", + } + } +} + +impl std::str::FromStr for CheckoutIdealPaymentMethodOptionsSetupFutureUsage { + type Err = (); + fn from_str(s: &str) -> Result { + use CheckoutIdealPaymentMethodOptionsSetupFutureUsage::*; + match s { + "none" => Ok(None), + _ => Err(()), + } + } +} +impl std::fmt::Display for CheckoutIdealPaymentMethodOptionsSetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CheckoutIdealPaymentMethodOptionsSetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CheckoutIdealPaymentMethodOptionsSetupFutureUsage { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for CheckoutIdealPaymentMethodOptionsSetupFutureUsage { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| { + serde::de::Error::custom( + "Unknown value for CheckoutIdealPaymentMethodOptionsSetupFutureUsage", + ) + }) + } +} diff --git a/generated/stripe_checkout/src/checkout_klarna_payment_method_options.rs b/generated/stripe_checkout/src/checkout_klarna_payment_method_options.rs new file mode 100644 index 000000000..9b679b237 --- /dev/null +++ b/generated/stripe_checkout/src/checkout_klarna_payment_method_options.rs @@ -0,0 +1,76 @@ +#[derive(Copy, Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct CheckoutKlarnaPaymentMethodOptions { + /// Indicates that you intend to make future payments with this PaymentIntent's payment method. + /// + /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. + /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + /// + /// When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + #[serde(skip_serializing_if = "Option::is_none")] + pub setup_future_usage: Option, +} +/// Indicates that you intend to make future payments with this PaymentIntent's payment method. +/// +/// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. +/// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. +/// +/// When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CheckoutKlarnaPaymentMethodOptionsSetupFutureUsage { + None, + OffSession, + OnSession, +} +impl CheckoutKlarnaPaymentMethodOptionsSetupFutureUsage { + pub fn as_str(self) -> &'static str { + use CheckoutKlarnaPaymentMethodOptionsSetupFutureUsage::*; + match self { + None => "none", + OffSession => "off_session", + OnSession => "on_session", + } + } +} + +impl std::str::FromStr for CheckoutKlarnaPaymentMethodOptionsSetupFutureUsage { + type Err = (); + fn from_str(s: &str) -> Result { + use CheckoutKlarnaPaymentMethodOptionsSetupFutureUsage::*; + match s { + "none" => Ok(None), + "off_session" => Ok(OffSession), + "on_session" => Ok(OnSession), + _ => Err(()), + } + } +} +impl std::fmt::Display for CheckoutKlarnaPaymentMethodOptionsSetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CheckoutKlarnaPaymentMethodOptionsSetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CheckoutKlarnaPaymentMethodOptionsSetupFutureUsage { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for CheckoutKlarnaPaymentMethodOptionsSetupFutureUsage { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| { + serde::de::Error::custom( + "Unknown value for CheckoutKlarnaPaymentMethodOptionsSetupFutureUsage", + ) + }) + } +} diff --git a/generated/stripe_checkout/src/checkout_konbini_payment_method_options.rs b/generated/stripe_checkout/src/checkout_konbini_payment_method_options.rs new file mode 100644 index 000000000..987398a44 --- /dev/null +++ b/generated/stripe_checkout/src/checkout_konbini_payment_method_options.rs @@ -0,0 +1,73 @@ +#[derive(Copy, Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct CheckoutKonbiniPaymentMethodOptions { + /// The number of calendar days (between 1 and 60) after which Konbini payment instructions will expire. + /// For example, if a PaymentIntent is confirmed with Konbini and `expires_after_days` set to 2 on Monday JST, the instructions will expire on Wednesday 23:59:59 JST. + pub expires_after_days: Option, + /// Indicates that you intend to make future payments with this PaymentIntent's payment method. + /// + /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. + /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + /// + /// When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + #[serde(skip_serializing_if = "Option::is_none")] + pub setup_future_usage: Option, +} +/// Indicates that you intend to make future payments with this PaymentIntent's payment method. +/// +/// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. +/// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. +/// +/// When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CheckoutKonbiniPaymentMethodOptionsSetupFutureUsage { + None, +} +impl CheckoutKonbiniPaymentMethodOptionsSetupFutureUsage { + pub fn as_str(self) -> &'static str { + use CheckoutKonbiniPaymentMethodOptionsSetupFutureUsage::*; + match self { + None => "none", + } + } +} + +impl std::str::FromStr for CheckoutKonbiniPaymentMethodOptionsSetupFutureUsage { + type Err = (); + fn from_str(s: &str) -> Result { + use CheckoutKonbiniPaymentMethodOptionsSetupFutureUsage::*; + match s { + "none" => Ok(None), + _ => Err(()), + } + } +} +impl std::fmt::Display for CheckoutKonbiniPaymentMethodOptionsSetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CheckoutKonbiniPaymentMethodOptionsSetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CheckoutKonbiniPaymentMethodOptionsSetupFutureUsage { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for CheckoutKonbiniPaymentMethodOptionsSetupFutureUsage { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| { + serde::de::Error::custom( + "Unknown value for CheckoutKonbiniPaymentMethodOptionsSetupFutureUsage", + ) + }) + } +} diff --git a/generated/stripe_checkout/src/checkout_link_payment_method_options.rs b/generated/stripe_checkout/src/checkout_link_payment_method_options.rs new file mode 100644 index 000000000..f10f8db36 --- /dev/null +++ b/generated/stripe_checkout/src/checkout_link_payment_method_options.rs @@ -0,0 +1,73 @@ +#[derive(Copy, Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct CheckoutLinkPaymentMethodOptions { + /// Indicates that you intend to make future payments with this PaymentIntent's payment method. + /// + /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. + /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + /// + /// When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + #[serde(skip_serializing_if = "Option::is_none")] + pub setup_future_usage: Option, +} +/// Indicates that you intend to make future payments with this PaymentIntent's payment method. +/// +/// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. +/// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. +/// +/// When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CheckoutLinkPaymentMethodOptionsSetupFutureUsage { + None, + OffSession, +} +impl CheckoutLinkPaymentMethodOptionsSetupFutureUsage { + pub fn as_str(self) -> &'static str { + use CheckoutLinkPaymentMethodOptionsSetupFutureUsage::*; + match self { + None => "none", + OffSession => "off_session", + } + } +} + +impl std::str::FromStr for CheckoutLinkPaymentMethodOptionsSetupFutureUsage { + type Err = (); + fn from_str(s: &str) -> Result { + use CheckoutLinkPaymentMethodOptionsSetupFutureUsage::*; + match s { + "none" => Ok(None), + "off_session" => Ok(OffSession), + _ => Err(()), + } + } +} +impl std::fmt::Display for CheckoutLinkPaymentMethodOptionsSetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CheckoutLinkPaymentMethodOptionsSetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CheckoutLinkPaymentMethodOptionsSetupFutureUsage { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for CheckoutLinkPaymentMethodOptionsSetupFutureUsage { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| { + serde::de::Error::custom( + "Unknown value for CheckoutLinkPaymentMethodOptionsSetupFutureUsage", + ) + }) + } +} diff --git a/generated/stripe_checkout/src/checkout_oxxo_payment_method_options.rs b/generated/stripe_checkout/src/checkout_oxxo_payment_method_options.rs new file mode 100644 index 000000000..c0d72ab60 --- /dev/null +++ b/generated/stripe_checkout/src/checkout_oxxo_payment_method_options.rs @@ -0,0 +1,73 @@ +#[derive(Copy, Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct CheckoutOxxoPaymentMethodOptions { + /// The number of calendar days before an OXXO invoice expires. + /// For example, if you create an OXXO invoice on Monday and you set expires_after_days to 2, the OXXO invoice will expire on Wednesday at 23:59 America/Mexico_City time. + pub expires_after_days: u32, + /// Indicates that you intend to make future payments with this PaymentIntent's payment method. + /// + /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. + /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + /// + /// When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + #[serde(skip_serializing_if = "Option::is_none")] + pub setup_future_usage: Option, +} +/// Indicates that you intend to make future payments with this PaymentIntent's payment method. +/// +/// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. +/// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. +/// +/// When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CheckoutOxxoPaymentMethodOptionsSetupFutureUsage { + None, +} +impl CheckoutOxxoPaymentMethodOptionsSetupFutureUsage { + pub fn as_str(self) -> &'static str { + use CheckoutOxxoPaymentMethodOptionsSetupFutureUsage::*; + match self { + None => "none", + } + } +} + +impl std::str::FromStr for CheckoutOxxoPaymentMethodOptionsSetupFutureUsage { + type Err = (); + fn from_str(s: &str) -> Result { + use CheckoutOxxoPaymentMethodOptionsSetupFutureUsage::*; + match s { + "none" => Ok(None), + _ => Err(()), + } + } +} +impl std::fmt::Display for CheckoutOxxoPaymentMethodOptionsSetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CheckoutOxxoPaymentMethodOptionsSetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CheckoutOxxoPaymentMethodOptionsSetupFutureUsage { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for CheckoutOxxoPaymentMethodOptionsSetupFutureUsage { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| { + serde::de::Error::custom( + "Unknown value for CheckoutOxxoPaymentMethodOptionsSetupFutureUsage", + ) + }) + } +} diff --git a/generated/stripe_checkout/src/checkout_p24_payment_method_options.rs b/generated/stripe_checkout/src/checkout_p24_payment_method_options.rs new file mode 100644 index 000000000..b981d386d --- /dev/null +++ b/generated/stripe_checkout/src/checkout_p24_payment_method_options.rs @@ -0,0 +1,70 @@ +#[derive(Copy, Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct CheckoutP24PaymentMethodOptions { + /// Indicates that you intend to make future payments with this PaymentIntent's payment method. + /// + /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. + /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + /// + /// When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + #[serde(skip_serializing_if = "Option::is_none")] + pub setup_future_usage: Option, +} +/// Indicates that you intend to make future payments with this PaymentIntent's payment method. +/// +/// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. +/// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. +/// +/// When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CheckoutP24PaymentMethodOptionsSetupFutureUsage { + None, +} +impl CheckoutP24PaymentMethodOptionsSetupFutureUsage { + pub fn as_str(self) -> &'static str { + use CheckoutP24PaymentMethodOptionsSetupFutureUsage::*; + match self { + None => "none", + } + } +} + +impl std::str::FromStr for CheckoutP24PaymentMethodOptionsSetupFutureUsage { + type Err = (); + fn from_str(s: &str) -> Result { + use CheckoutP24PaymentMethodOptionsSetupFutureUsage::*; + match s { + "none" => Ok(None), + _ => Err(()), + } + } +} +impl std::fmt::Display for CheckoutP24PaymentMethodOptionsSetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CheckoutP24PaymentMethodOptionsSetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CheckoutP24PaymentMethodOptionsSetupFutureUsage { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for CheckoutP24PaymentMethodOptionsSetupFutureUsage { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| { + serde::de::Error::custom( + "Unknown value for CheckoutP24PaymentMethodOptionsSetupFutureUsage", + ) + }) + } +} diff --git a/generated/stripe_checkout/src/checkout_paynow_payment_method_options.rs b/generated/stripe_checkout/src/checkout_paynow_payment_method_options.rs new file mode 100644 index 000000000..ec18d8378 --- /dev/null +++ b/generated/stripe_checkout/src/checkout_paynow_payment_method_options.rs @@ -0,0 +1,70 @@ +#[derive(Copy, Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct CheckoutPaynowPaymentMethodOptions { + /// Indicates that you intend to make future payments with this PaymentIntent's payment method. + /// + /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. + /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + /// + /// When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + #[serde(skip_serializing_if = "Option::is_none")] + pub setup_future_usage: Option, +} +/// Indicates that you intend to make future payments with this PaymentIntent's payment method. +/// +/// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. +/// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. +/// +/// When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CheckoutPaynowPaymentMethodOptionsSetupFutureUsage { + None, +} +impl CheckoutPaynowPaymentMethodOptionsSetupFutureUsage { + pub fn as_str(self) -> &'static str { + use CheckoutPaynowPaymentMethodOptionsSetupFutureUsage::*; + match self { + None => "none", + } + } +} + +impl std::str::FromStr for CheckoutPaynowPaymentMethodOptionsSetupFutureUsage { + type Err = (); + fn from_str(s: &str) -> Result { + use CheckoutPaynowPaymentMethodOptionsSetupFutureUsage::*; + match s { + "none" => Ok(None), + _ => Err(()), + } + } +} +impl std::fmt::Display for CheckoutPaynowPaymentMethodOptionsSetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CheckoutPaynowPaymentMethodOptionsSetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CheckoutPaynowPaymentMethodOptionsSetupFutureUsage { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for CheckoutPaynowPaymentMethodOptionsSetupFutureUsage { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| { + serde::de::Error::custom( + "Unknown value for CheckoutPaynowPaymentMethodOptionsSetupFutureUsage", + ) + }) + } +} diff --git a/generated/stripe_checkout/src/checkout_paypal_payment_method_options.rs b/generated/stripe_checkout/src/checkout_paypal_payment_method_options.rs new file mode 100644 index 000000000..38778a97b --- /dev/null +++ b/generated/stripe_checkout/src/checkout_paypal_payment_method_options.rs @@ -0,0 +1,135 @@ +#[derive(Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct CheckoutPaypalPaymentMethodOptions { + /// Controls when the funds will be captured from the customer's account. + #[serde(skip_serializing_if = "Option::is_none")] + pub capture_method: Option, + /// Preferred locale of the PayPal checkout page that the customer is redirected to. + pub preferred_locale: Option, + /// A reference of the PayPal transaction visible to customer which is mapped to PayPal's invoice ID. + /// This must be a globally unique ID if you have configured in your PayPal settings to block multiple payments per invoice ID. + pub reference: Option, + /// Indicates that you intend to make future payments with this PaymentIntent's payment method. + /// + /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. + /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + /// + /// When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + #[serde(skip_serializing_if = "Option::is_none")] + pub setup_future_usage: Option, +} +/// Controls when the funds will be captured from the customer's account. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CheckoutPaypalPaymentMethodOptionsCaptureMethod { + Manual, +} +impl CheckoutPaypalPaymentMethodOptionsCaptureMethod { + pub fn as_str(self) -> &'static str { + use CheckoutPaypalPaymentMethodOptionsCaptureMethod::*; + match self { + Manual => "manual", + } + } +} + +impl std::str::FromStr for CheckoutPaypalPaymentMethodOptionsCaptureMethod { + type Err = (); + fn from_str(s: &str) -> Result { + use CheckoutPaypalPaymentMethodOptionsCaptureMethod::*; + match s { + "manual" => Ok(Manual), + _ => Err(()), + } + } +} +impl std::fmt::Display for CheckoutPaypalPaymentMethodOptionsCaptureMethod { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CheckoutPaypalPaymentMethodOptionsCaptureMethod { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CheckoutPaypalPaymentMethodOptionsCaptureMethod { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for CheckoutPaypalPaymentMethodOptionsCaptureMethod { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| { + serde::de::Error::custom( + "Unknown value for CheckoutPaypalPaymentMethodOptionsCaptureMethod", + ) + }) + } +} +/// Indicates that you intend to make future payments with this PaymentIntent's payment method. +/// +/// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. +/// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. +/// +/// When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CheckoutPaypalPaymentMethodOptionsSetupFutureUsage { + None, + OffSession, +} +impl CheckoutPaypalPaymentMethodOptionsSetupFutureUsage { + pub fn as_str(self) -> &'static str { + use CheckoutPaypalPaymentMethodOptionsSetupFutureUsage::*; + match self { + None => "none", + OffSession => "off_session", + } + } +} + +impl std::str::FromStr for CheckoutPaypalPaymentMethodOptionsSetupFutureUsage { + type Err = (); + fn from_str(s: &str) -> Result { + use CheckoutPaypalPaymentMethodOptionsSetupFutureUsage::*; + match s { + "none" => Ok(None), + "off_session" => Ok(OffSession), + _ => Err(()), + } + } +} +impl std::fmt::Display for CheckoutPaypalPaymentMethodOptionsSetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CheckoutPaypalPaymentMethodOptionsSetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CheckoutPaypalPaymentMethodOptionsSetupFutureUsage { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for CheckoutPaypalPaymentMethodOptionsSetupFutureUsage { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| { + serde::de::Error::custom( + "Unknown value for CheckoutPaypalPaymentMethodOptionsSetupFutureUsage", + ) + }) + } +} diff --git a/generated/stripe_checkout/src/checkout_pix_payment_method_options.rs b/generated/stripe_checkout/src/checkout_pix_payment_method_options.rs new file mode 100644 index 000000000..e36949e64 --- /dev/null +++ b/generated/stripe_checkout/src/checkout_pix_payment_method_options.rs @@ -0,0 +1,5 @@ +#[derive(Copy, Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct CheckoutPixPaymentMethodOptions { + /// The number of seconds after which Pix payment will expire. + pub expires_after_seconds: Option, +} diff --git a/generated/stripe_checkout/src/checkout_revolut_pay_payment_method_options.rs b/generated/stripe_checkout/src/checkout_revolut_pay_payment_method_options.rs new file mode 100644 index 000000000..a780a71df --- /dev/null +++ b/generated/stripe_checkout/src/checkout_revolut_pay_payment_method_options.rs @@ -0,0 +1,2 @@ +#[derive(Copy, Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct CheckoutRevolutPayPaymentMethodOptions {} diff --git a/generated/stripe_checkout/src/checkout_sepa_debit_payment_method_options.rs b/generated/stripe_checkout/src/checkout_sepa_debit_payment_method_options.rs new file mode 100644 index 000000000..363e0f3a6 --- /dev/null +++ b/generated/stripe_checkout/src/checkout_sepa_debit_payment_method_options.rs @@ -0,0 +1,76 @@ +#[derive(Copy, Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct CheckoutSepaDebitPaymentMethodOptions { + /// Indicates that you intend to make future payments with this PaymentIntent's payment method. + /// + /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. + /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + /// + /// When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + #[serde(skip_serializing_if = "Option::is_none")] + pub setup_future_usage: Option, +} +/// Indicates that you intend to make future payments with this PaymentIntent's payment method. +/// +/// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. +/// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. +/// +/// When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CheckoutSepaDebitPaymentMethodOptionsSetupFutureUsage { + None, + OffSession, + OnSession, +} +impl CheckoutSepaDebitPaymentMethodOptionsSetupFutureUsage { + pub fn as_str(self) -> &'static str { + use CheckoutSepaDebitPaymentMethodOptionsSetupFutureUsage::*; + match self { + None => "none", + OffSession => "off_session", + OnSession => "on_session", + } + } +} + +impl std::str::FromStr for CheckoutSepaDebitPaymentMethodOptionsSetupFutureUsage { + type Err = (); + fn from_str(s: &str) -> Result { + use CheckoutSepaDebitPaymentMethodOptionsSetupFutureUsage::*; + match s { + "none" => Ok(None), + "off_session" => Ok(OffSession), + "on_session" => Ok(OnSession), + _ => Err(()), + } + } +} +impl std::fmt::Display for CheckoutSepaDebitPaymentMethodOptionsSetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CheckoutSepaDebitPaymentMethodOptionsSetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CheckoutSepaDebitPaymentMethodOptionsSetupFutureUsage { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for CheckoutSepaDebitPaymentMethodOptionsSetupFutureUsage { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| { + serde::de::Error::custom( + "Unknown value for CheckoutSepaDebitPaymentMethodOptionsSetupFutureUsage", + ) + }) + } +} diff --git a/generated/stripe_checkout/src/checkout_session/mod.rs b/generated/stripe_checkout/src/checkout_session/mod.rs new file mode 100644 index 000000000..3765382b8 --- /dev/null +++ b/generated/stripe_checkout/src/checkout_session/mod.rs @@ -0,0 +1,5 @@ +#[cfg(feature = "checkout_session")] +mod requests; +pub(crate) mod types; +#[cfg(feature = "checkout_session")] +pub use requests::*; diff --git a/generated/stripe_checkout/src/checkout_session/requests.rs b/generated/stripe_checkout/src/checkout_session/requests.rs new file mode 100644 index 000000000..d7bcb4a45 --- /dev/null +++ b/generated/stripe_checkout/src/checkout_session/requests.rs @@ -0,0 +1,6570 @@ +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct ListCheckoutSession<'a> { + /// Only return the Checkout Sessions that were created during the given date interval. + #[serde(skip_serializing_if = "Option::is_none")] + pub created: Option, + /// Only return the Checkout Sessions for the Customer specified. + #[serde(skip_serializing_if = "Option::is_none")] + pub customer: Option<&'a str>, + /// Only return the Checkout Sessions for the Customer details specified. + #[serde(skip_serializing_if = "Option::is_none")] + pub customer_details: Option>, + /// A cursor for use in pagination. + /// `ending_before` is an object ID that defines your place in the list. + /// For instance, if you make a list request and receive 100 objects, starting with `obj_bar`, your subsequent call can include `ending_before=obj_bar` in order to fetch the previous page of the list. + #[serde(skip_serializing_if = "Option::is_none")] + pub ending_before: Option<&'a str>, + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, + /// A limit on the number of objects to be returned. + /// Limit can range between 1 and 100, and the default is 10. + #[serde(skip_serializing_if = "Option::is_none")] + pub limit: Option, + /// Only return the Checkout Session for the PaymentIntent specified. + #[serde(skip_serializing_if = "Option::is_none")] + pub payment_intent: Option<&'a str>, + /// Only return the Checkout Sessions for the Payment Link specified. + #[serde(skip_serializing_if = "Option::is_none")] + pub payment_link: Option<&'a str>, + /// A cursor for use in pagination. + /// `starting_after` is an object ID that defines your place in the list. + /// For instance, if you make a list request and receive 100 objects, ending with `obj_foo`, your subsequent call can include `starting_after=obj_foo` in order to fetch the next page of the list. + #[serde(skip_serializing_if = "Option::is_none")] + pub starting_after: Option<&'a str>, + /// Only return the Checkout Sessions matching the given status. + #[serde(skip_serializing_if = "Option::is_none")] + pub status: Option, + /// Only return the Checkout Session for the subscription specified. + #[serde(skip_serializing_if = "Option::is_none")] + pub subscription: Option<&'a str>, +} +impl<'a> ListCheckoutSession<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// Only return the Checkout Sessions for the Customer details specified. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct ListCheckoutSessionCustomerDetails<'a> { + /// Customer's email address. + pub email: &'a str, +} +impl<'a> ListCheckoutSessionCustomerDetails<'a> { + pub fn new(email: &'a str) -> Self { + Self { email } + } +} +impl<'a> ListCheckoutSession<'a> { + /// Returns a list of Checkout Sessions. + pub fn send( + &self, + client: &stripe::Client, + ) -> stripe::Response> { + client.get_query("/checkout/sessions", self) + } + pub fn paginate( + self, + ) -> stripe::ListPaginator> { + stripe::ListPaginator::from_list_params("/checkout/sessions", self) + } +} +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct RetrieveCheckoutSession<'a> { + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, +} +impl<'a> RetrieveCheckoutSession<'a> { + pub fn new() -> Self { + Self::default() + } +} +impl<'a> RetrieveCheckoutSession<'a> { + /// Retrieves a Session object. + pub fn send( + &self, + client: &stripe::Client, + session: &stripe_checkout::CheckoutSessionId, + ) -> stripe::Response { + client.get_query(&format!("/checkout/sessions/{session}"), self) + } +} +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct ListLineItemsCheckoutSession<'a> { + /// A cursor for use in pagination. + /// `ending_before` is an object ID that defines your place in the list. + /// For instance, if you make a list request and receive 100 objects, starting with `obj_bar`, your subsequent call can include `ending_before=obj_bar` in order to fetch the previous page of the list. + #[serde(skip_serializing_if = "Option::is_none")] + pub ending_before: Option<&'a str>, + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, + /// A limit on the number of objects to be returned. + /// Limit can range between 1 and 100, and the default is 10. + #[serde(skip_serializing_if = "Option::is_none")] + pub limit: Option, + /// A cursor for use in pagination. + /// `starting_after` is an object ID that defines your place in the list. + /// For instance, if you make a list request and receive 100 objects, ending with `obj_foo`, your subsequent call can include `starting_after=obj_foo` in order to fetch the next page of the list. + #[serde(skip_serializing_if = "Option::is_none")] + pub starting_after: Option<&'a str>, +} +impl<'a> ListLineItemsCheckoutSession<'a> { + pub fn new() -> Self { + Self::default() + } +} +impl<'a> ListLineItemsCheckoutSession<'a> { + /// When retrieving a Checkout Session, there is an includable **line_items** property containing the first handful of those items. + /// There is also a URL where you can retrieve the full (paginated) list of line items. + pub fn send( + &self, + client: &stripe::Client, + session: &stripe_checkout::CheckoutSessionId, + ) -> stripe::Response> { + client.get_query(&format!("/checkout/sessions/{session}/line_items"), self) + } + pub fn paginate( + self, + session: &stripe_checkout::CheckoutSessionId, + ) -> stripe::ListPaginator> { + stripe::ListPaginator::from_list_params( + &format!("/checkout/sessions/{session}/line_items"), + self, + ) + } +} +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreateCheckoutSession<'a> { + /// Configure actions after a Checkout Session has expired. + #[serde(skip_serializing_if = "Option::is_none")] + pub after_expiration: Option, + /// Enables user redeemable promotion codes. + #[serde(skip_serializing_if = "Option::is_none")] + pub allow_promotion_codes: Option, + /// Settings for automatic tax lookup for this session and resulting payments, invoices, and subscriptions. + #[serde(skip_serializing_if = "Option::is_none")] + pub automatic_tax: Option>, + /// Specify whether Checkout should collect the customer's billing address. + #[serde(skip_serializing_if = "Option::is_none")] + pub billing_address_collection: + Option, + /// If set, Checkout displays a back button and customers will be directed to this URL if they decide to cancel payment and return to your website. + #[serde(skip_serializing_if = "Option::is_none")] + pub cancel_url: Option<&'a str>, + /// A unique string to reference the Checkout Session. This can be a + /// customer ID, a cart ID, or similar, and can be used to reconcile the + /// session with your internal systems. + #[serde(skip_serializing_if = "Option::is_none")] + pub client_reference_id: Option<&'a str>, + /// Configure fields for the Checkout Session to gather active consent from customers. + #[serde(skip_serializing_if = "Option::is_none")] + pub consent_collection: Option, + /// Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. + /// Must be a [supported currency](https://stripe.com/docs/currencies). + /// Required in `setup` mode when `payment_method_types` is not set. + #[serde(skip_serializing_if = "Option::is_none")] + pub currency: Option, + /// Collect additional information from your customer using custom fields. + /// Up to 3 fields are supported. + #[serde(skip_serializing_if = "Option::is_none")] + pub custom_fields: Option<&'a [CreateCheckoutSessionCustomFields<'a>]>, + /// Display additional text for your customers using custom text. + #[serde(skip_serializing_if = "Option::is_none")] + pub custom_text: Option>, + /// ID of an existing Customer, if one exists. + /// In `payment` mode, the customer’s most recently saved card. + /// payment method will be used to prefill the email, name, card details, and billing address + /// on the Checkout page. + /// In `subscription` mode, the customer’s [default payment method](https://stripe.com/docs/api/customers/update#update_customer-invoice_settings-default_payment_method). + /// will be used if it’s a card, otherwise the most recently saved card will be used. + /// A valid billing address, billing name and billing email are required on the payment method for Checkout to prefill the customer's card details. + /// + /// If the Customer already has a valid [email](https://stripe.com/docs/api/customers/object#customer_object-email) set, the email will be prefilled and not editable in Checkout. + /// If the Customer does not have a valid `email`, Checkout will set the email entered during the session on the Customer. + /// + /// If blank for Checkout Sessions in `subscription` mode or with `customer_creation` set as `always` in `payment` mode, Checkout will create a new Customer object based on information provided during the payment flow. + /// + /// You can set [`payment_intent_data.setup_future_usage`](https://stripe.com/docs/api/checkout/sessions/create#create_checkout_session-payment_intent_data-setup_future_usage) to have Checkout automatically attach the payment method to the Customer you pass in for future reuse. + #[serde(skip_serializing_if = "Option::is_none")] + pub customer: Option<&'a str>, + /// Configure whether a Checkout Session creates a [Customer](https://stripe.com/docs/api/customers) during Session confirmation. + /// + /// When a Customer is not created, you can still retrieve email, address, and other customer data entered in Checkout. + /// with [customer_details](https://stripe.com/docs/api/checkout/sessions/object#checkout_session_object-customer_details). + /// + /// Sessions that don't create Customers instead are grouped by [guest customers](https://stripe.com/docs/payments/checkout/guest-customers). + /// in the Dashboard. + /// Promotion codes limited to first time customers will return invalid for these Sessions. + /// + /// Can only be set in `payment` and `setup` mode. + #[serde(skip_serializing_if = "Option::is_none")] + pub customer_creation: Option, + /// If provided, this value will be used when the Customer object is created. + /// If not provided, customers will be asked to enter their email address. + /// Use this parameter to prefill customer data if you already have an email + /// on file. To access information about the customer once a session is + /// complete, use the `customer` field. + #[serde(skip_serializing_if = "Option::is_none")] + pub customer_email: Option<&'a str>, + /// Controls what fields on Customer can be updated by the Checkout Session. + /// Can only be provided when `customer` is provided. + #[serde(skip_serializing_if = "Option::is_none")] + pub customer_update: Option, + /// The coupon or promotion code to apply to this Session. Currently, only up to one may be specified. + #[serde(skip_serializing_if = "Option::is_none")] + pub discounts: Option<&'a [CreateCheckoutSessionDiscounts<'a>]>, + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, + /// The Epoch time in seconds at which the Checkout Session will expire. + /// It can be anywhere from 30 minutes to 24 hours after Checkout Session creation. + /// By default, this value is 24 hours from creation. + #[serde(skip_serializing_if = "Option::is_none")] + pub expires_at: Option, + /// Generate a post-purchase Invoice for one-time payments. + #[serde(skip_serializing_if = "Option::is_none")] + pub invoice_creation: Option>, + /// A list of items the customer is purchasing. + /// Use this parameter to pass one-time or recurring [Prices](https://stripe.com/docs/api/prices). + /// + /// For `payment` mode, there is a maximum of 100 line items, however it is recommended to consolidate line items if there are more than a few dozen. + /// + /// For `subscription` mode, there is a maximum of 20 line items with recurring Prices and 20 line items with one-time Prices. + /// Line items with one-time Prices will be on the initial invoice only. + #[serde(skip_serializing_if = "Option::is_none")] + pub line_items: Option<&'a [CreateCheckoutSessionLineItems<'a>]>, + /// The IETF language tag of the locale Checkout is displayed in. + /// If blank or `auto`, the browser's locale is used. + #[serde(skip_serializing_if = "Option::is_none")] + pub locale: Option, + /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. + /// This can be useful for storing additional information about the object in a structured format. + /// Individual keys can be unset by posting an empty value to them. + /// All keys can be unset by posting an empty value to `metadata`. + #[serde(skip_serializing_if = "Option::is_none")] + pub metadata: Option<&'a std::collections::HashMap>, + /// The mode of the Checkout Session. + /// Pass `subscription` if the Checkout Session includes at least one recurring item. + #[serde(skip_serializing_if = "Option::is_none")] + pub mode: Option, + /// A subset of parameters to be passed to PaymentIntent creation for Checkout Sessions in `payment` mode. + #[serde(skip_serializing_if = "Option::is_none")] + pub payment_intent_data: Option>, + /// Specify whether Checkout should collect a payment method. + /// When set to `if_required`, Checkout will not collect a payment method when the total due for the session is 0. + /// This may occur if the Checkout Session includes a free trial or a discount. + /// + /// Can only be set in `subscription` mode. + /// + /// If you'd like information on how to collect a payment method outside of Checkout, read the guide on configuring [subscriptions with a free trial](https://stripe.com/docs/payments/checkout/free-trials). + #[serde(skip_serializing_if = "Option::is_none")] + pub payment_method_collection: Option, + /// The ID of the payment method configuration to use with this Checkout session. + #[serde(skip_serializing_if = "Option::is_none")] + pub payment_method_configuration: Option<&'a str>, + /// Payment-method-specific configuration. + #[serde(skip_serializing_if = "Option::is_none")] + pub payment_method_options: Option>, + /// A list of the types of payment methods (e.g., `card`) this Checkout Session can accept. + /// + /// You can omit this attribute to manage your payment methods from the [Stripe Dashboard](https://dashboard.stripe.com/settings/payment_methods). + /// See [Dynamic Payment Methods](https://stripe.com/docs/payments/payment-methods/integration-options#using-dynamic-payment-methods) for more details. + /// + /// Read more about the supported payment methods and their requirements in our [payment + /// method details guide](/docs/payments/checkout/payment-methods). + /// + /// If multiple payment methods are passed, Checkout will dynamically reorder them to + /// prioritize the most relevant payment methods based on the customer's location and + /// other characteristics. + #[serde(skip_serializing_if = "Option::is_none")] + pub payment_method_types: Option<&'a [CreateCheckoutSessionPaymentMethodTypes]>, + /// Controls phone number collection settings for the session. + /// + /// We recommend that you review your privacy policy and check with your legal contacts + /// before using this feature. + /// Learn more about [collecting phone numbers with Checkout](https://stripe.com/docs/payments/checkout/phone-numbers). + #[serde(skip_serializing_if = "Option::is_none")] + pub phone_number_collection: Option, + /// This parameter applies to `ui_mode: embedded`. + /// By default, Stripe will always redirect to your return_url after a successful confirmation. + /// If you set `redirect_on_completion: 'if_required'`, then we will only redirect if your user chooses a redirect-based payment method. + #[serde(skip_serializing_if = "Option::is_none")] + pub redirect_on_completion: Option, + /// The URL to redirect your customer back to after they authenticate or cancel their payment on the + /// payment method's app or site. This parameter is required if ui_mode is `embedded` + /// and redirect-based payment methods are enabled on the session. + #[serde(skip_serializing_if = "Option::is_none")] + pub return_url: Option<&'a str>, + /// A subset of parameters to be passed to SetupIntent creation for Checkout Sessions in `setup` mode. + #[serde(skip_serializing_if = "Option::is_none")] + pub setup_intent_data: Option>, + /// When set, provides configuration for Checkout to collect a shipping address from a customer. + #[serde(skip_serializing_if = "Option::is_none")] + pub shipping_address_collection: Option>, + /// The shipping rate options to apply to this Session. Up to a maximum of 5. + #[serde(skip_serializing_if = "Option::is_none")] + pub shipping_options: Option<&'a [CreateCheckoutSessionShippingOptions<'a>]>, + /// Describes the type of transaction being performed by Checkout in order to customize + /// relevant text on the page, such as the submit button. `submit_type` can only be + /// specified on Checkout Sessions in `payment` mode. If blank or `auto`, `pay` is used. + #[serde(skip_serializing_if = "Option::is_none")] + pub submit_type: Option, + /// A subset of parameters to be passed to subscription creation for Checkout Sessions in `subscription` mode. + #[serde(skip_serializing_if = "Option::is_none")] + pub subscription_data: Option>, + /// The URL to which Stripe should send customers when payment or setup + /// is complete. + /// This parameter is not allowed if ui_mode is `embedded`. If you’d like to use + /// information from the successful Checkout Session on your page, read the + /// guide on [customizing your success page](https://stripe.com/docs/payments/checkout/custom-success-page). + #[serde(skip_serializing_if = "Option::is_none")] + pub success_url: Option<&'a str>, + /// Controls tax ID collection settings for the session. + #[serde(skip_serializing_if = "Option::is_none")] + pub tax_id_collection: Option, + /// `ui_mode` can be `hosted` or `embedded`. The default is `hosted`. + #[serde(skip_serializing_if = "Option::is_none")] + pub ui_mode: Option, +} +impl<'a> CreateCheckoutSession<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// Configure actions after a Checkout Session has expired. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreateCheckoutSessionAfterExpiration { + /// Configure a Checkout Session that can be used to recover an expired session. + #[serde(skip_serializing_if = "Option::is_none")] + pub recovery: Option, +} +impl CreateCheckoutSessionAfterExpiration { + pub fn new() -> Self { + Self::default() + } +} +/// Configure a Checkout Session that can be used to recover an expired session. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreateCheckoutSessionAfterExpirationRecovery { + /// Enables user redeemable promotion codes on the recovered Checkout Sessions. Defaults to `false` + #[serde(skip_serializing_if = "Option::is_none")] + pub allow_promotion_codes: Option, + /// If `true`, a recovery URL will be generated to recover this Checkout Session if it + /// expires before a successful transaction is completed. It will be attached to the + /// Checkout Session object upon expiration. + pub enabled: bool, +} +impl CreateCheckoutSessionAfterExpirationRecovery { + pub fn new(enabled: bool) -> Self { + Self { allow_promotion_codes: None, enabled } + } +} +/// Settings for automatic tax lookup for this session and resulting payments, invoices, and subscriptions. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreateCheckoutSessionAutomaticTax<'a> { + /// Set to true to enable automatic taxes. + pub enabled: bool, + /// The account that's liable for tax. + /// If set, the business address and tax registrations required to perform the tax calculation are loaded from this account. + /// The tax transaction is returned in the report of the connected account. + #[serde(skip_serializing_if = "Option::is_none")] + pub liability: Option>, +} +impl<'a> CreateCheckoutSessionAutomaticTax<'a> { + pub fn new(enabled: bool) -> Self { + Self { enabled, liability: None } + } +} +/// The account that's liable for tax. +/// If set, the business address and tax registrations required to perform the tax calculation are loaded from this account. +/// The tax transaction is returned in the report of the connected account. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreateCheckoutSessionAutomaticTaxLiability<'a> { + /// The connected account being referenced when `type` is `account`. + #[serde(skip_serializing_if = "Option::is_none")] + pub account: Option<&'a str>, + /// Type of the account referenced in the request. + #[serde(rename = "type")] + pub type_: CreateCheckoutSessionAutomaticTaxLiabilityType, +} +impl<'a> CreateCheckoutSessionAutomaticTaxLiability<'a> { + pub fn new(type_: CreateCheckoutSessionAutomaticTaxLiabilityType) -> Self { + Self { account: None, type_ } + } +} +/// Type of the account referenced in the request. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreateCheckoutSessionAutomaticTaxLiabilityType { + Account, + Self_, +} +impl CreateCheckoutSessionAutomaticTaxLiabilityType { + pub fn as_str(self) -> &'static str { + use CreateCheckoutSessionAutomaticTaxLiabilityType::*; + match self { + Account => "account", + Self_ => "self", + } + } +} + +impl std::str::FromStr for CreateCheckoutSessionAutomaticTaxLiabilityType { + type Err = (); + fn from_str(s: &str) -> Result { + use CreateCheckoutSessionAutomaticTaxLiabilityType::*; + match s { + "account" => Ok(Account), + "self" => Ok(Self_), + _ => Err(()), + } + } +} +impl std::fmt::Display for CreateCheckoutSessionAutomaticTaxLiabilityType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreateCheckoutSessionAutomaticTaxLiabilityType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreateCheckoutSessionAutomaticTaxLiabilityType { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Configure fields for the Checkout Session to gather active consent from customers. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreateCheckoutSessionConsentCollection { + /// Determines the display of payment method reuse agreement text in the UI. + /// If set to `hidden`, it will hide legal text related to the reuse of a payment method. + #[serde(skip_serializing_if = "Option::is_none")] + pub payment_method_reuse_agreement: + Option, + /// If set to `auto`, enables the collection of customer consent for promotional communications. + /// The Checkout. + /// Session will determine whether to display an option to opt into promotional communication + /// from the merchant depending on the customer's locale. Only available to US merchants. + #[serde(skip_serializing_if = "Option::is_none")] + pub promotions: Option, + /// If set to `required`, it requires customers to check a terms of service checkbox before being able to pay. + /// There must be a valid terms of service URL set in your [Dashboard settings](https://dashboard.stripe.com/settings/public). + #[serde(skip_serializing_if = "Option::is_none")] + pub terms_of_service: Option, +} +impl CreateCheckoutSessionConsentCollection { + pub fn new() -> Self { + Self::default() + } +} +/// Determines the display of payment method reuse agreement text in the UI. +/// If set to `hidden`, it will hide legal text related to the reuse of a payment method. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreateCheckoutSessionConsentCollectionPaymentMethodReuseAgreement { + /// Determines the position and visibility of the payment method reuse agreement in the UI. + /// When set to `auto`, Stripe's. + /// defaults will be used. + /// When set to `hidden`, the payment method reuse agreement text will always be hidden in the UI. + pub position: CreateCheckoutSessionConsentCollectionPaymentMethodReuseAgreementPosition, +} +impl CreateCheckoutSessionConsentCollectionPaymentMethodReuseAgreement { + pub fn new( + position: CreateCheckoutSessionConsentCollectionPaymentMethodReuseAgreementPosition, + ) -> Self { + Self { position } + } +} +/// Determines the position and visibility of the payment method reuse agreement in the UI. +/// When set to `auto`, Stripe's. +/// defaults will be used. +/// When set to `hidden`, the payment method reuse agreement text will always be hidden in the UI. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreateCheckoutSessionConsentCollectionPaymentMethodReuseAgreementPosition { + Auto, + Hidden, +} +impl CreateCheckoutSessionConsentCollectionPaymentMethodReuseAgreementPosition { + pub fn as_str(self) -> &'static str { + use CreateCheckoutSessionConsentCollectionPaymentMethodReuseAgreementPosition::*; + match self { + Auto => "auto", + Hidden => "hidden", + } + } +} + +impl std::str::FromStr + for CreateCheckoutSessionConsentCollectionPaymentMethodReuseAgreementPosition +{ + type Err = (); + fn from_str(s: &str) -> Result { + use CreateCheckoutSessionConsentCollectionPaymentMethodReuseAgreementPosition::*; + match s { + "auto" => Ok(Auto), + "hidden" => Ok(Hidden), + _ => Err(()), + } + } +} +impl std::fmt::Display + for CreateCheckoutSessionConsentCollectionPaymentMethodReuseAgreementPosition +{ + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreateCheckoutSessionConsentCollectionPaymentMethodReuseAgreementPosition { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize + for CreateCheckoutSessionConsentCollectionPaymentMethodReuseAgreementPosition +{ + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// If set to `auto`, enables the collection of customer consent for promotional communications. +/// The Checkout. +/// Session will determine whether to display an option to opt into promotional communication +/// from the merchant depending on the customer's locale. Only available to US merchants. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreateCheckoutSessionConsentCollectionPromotions { + Auto, + None, +} +impl CreateCheckoutSessionConsentCollectionPromotions { + pub fn as_str(self) -> &'static str { + use CreateCheckoutSessionConsentCollectionPromotions::*; + match self { + Auto => "auto", + None => "none", + } + } +} + +impl std::str::FromStr for CreateCheckoutSessionConsentCollectionPromotions { + type Err = (); + fn from_str(s: &str) -> Result { + use CreateCheckoutSessionConsentCollectionPromotions::*; + match s { + "auto" => Ok(Auto), + "none" => Ok(None), + _ => Err(()), + } + } +} +impl std::fmt::Display for CreateCheckoutSessionConsentCollectionPromotions { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreateCheckoutSessionConsentCollectionPromotions { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreateCheckoutSessionConsentCollectionPromotions { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// If set to `required`, it requires customers to check a terms of service checkbox before being able to pay. +/// There must be a valid terms of service URL set in your [Dashboard settings](https://dashboard.stripe.com/settings/public). +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreateCheckoutSessionConsentCollectionTermsOfService { + None, + Required, +} +impl CreateCheckoutSessionConsentCollectionTermsOfService { + pub fn as_str(self) -> &'static str { + use CreateCheckoutSessionConsentCollectionTermsOfService::*; + match self { + None => "none", + Required => "required", + } + } +} + +impl std::str::FromStr for CreateCheckoutSessionConsentCollectionTermsOfService { + type Err = (); + fn from_str(s: &str) -> Result { + use CreateCheckoutSessionConsentCollectionTermsOfService::*; + match s { + "none" => Ok(None), + "required" => Ok(Required), + _ => Err(()), + } + } +} +impl std::fmt::Display for CreateCheckoutSessionConsentCollectionTermsOfService { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreateCheckoutSessionConsentCollectionTermsOfService { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreateCheckoutSessionConsentCollectionTermsOfService { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Collect additional information from your customer using custom fields. +/// Up to 3 fields are supported. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreateCheckoutSessionCustomFields<'a> { + /// Configuration for `type=dropdown` fields. + #[serde(skip_serializing_if = "Option::is_none")] + pub dropdown: Option>, + /// String of your choice that your integration can use to reconcile this field. + /// Must be unique to this field, alphanumeric, and up to 200 characters. + pub key: &'a str, + /// The label for the field, displayed to the customer. + pub label: CreateCheckoutSessionCustomFieldsLabel<'a>, + /// Configuration for `type=numeric` fields. + #[serde(skip_serializing_if = "Option::is_none")] + pub numeric: Option, + /// Whether the customer is required to complete the field before completing the Checkout Session. + /// Defaults to `false`. + #[serde(skip_serializing_if = "Option::is_none")] + pub optional: Option, + /// Configuration for `type=text` fields. + #[serde(skip_serializing_if = "Option::is_none")] + pub text: Option, + /// The type of the field. + #[serde(rename = "type")] + pub type_: CreateCheckoutSessionCustomFieldsType, +} +impl<'a> CreateCheckoutSessionCustomFields<'a> { + pub fn new( + key: &'a str, + label: CreateCheckoutSessionCustomFieldsLabel<'a>, + type_: CreateCheckoutSessionCustomFieldsType, + ) -> Self { + Self { dropdown: None, key, label, numeric: None, optional: None, text: None, type_ } + } +} +/// Configuration for `type=dropdown` fields. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreateCheckoutSessionCustomFieldsDropdown<'a> { + /// The options available for the customer to select. Up to 200 options allowed. + pub options: &'a [CreateCheckoutSessionCustomFieldsDropdownOptions<'a>], +} +impl<'a> CreateCheckoutSessionCustomFieldsDropdown<'a> { + pub fn new(options: &'a [CreateCheckoutSessionCustomFieldsDropdownOptions<'a>]) -> Self { + Self { options } + } +} +/// The options available for the customer to select. Up to 200 options allowed. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreateCheckoutSessionCustomFieldsDropdownOptions<'a> { + /// The label for the option, displayed to the customer. Up to 100 characters. + pub label: &'a str, + /// The value for this option, not displayed to the customer, used by your integration to reconcile the option selected by the customer. + /// Must be unique to this option, alphanumeric, and up to 100 characters. + pub value: &'a str, +} +impl<'a> CreateCheckoutSessionCustomFieldsDropdownOptions<'a> { + pub fn new(label: &'a str, value: &'a str) -> Self { + Self { label, value } + } +} +/// The label for the field, displayed to the customer. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreateCheckoutSessionCustomFieldsLabel<'a> { + /// Custom text for the label, displayed to the customer. Up to 50 characters. + pub custom: &'a str, + /// The type of the label. + #[serde(rename = "type")] + pub type_: CreateCheckoutSessionCustomFieldsLabelType, +} +impl<'a> CreateCheckoutSessionCustomFieldsLabel<'a> { + pub fn new(custom: &'a str, type_: CreateCheckoutSessionCustomFieldsLabelType) -> Self { + Self { custom, type_ } + } +} +/// The type of the label. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreateCheckoutSessionCustomFieldsLabelType { + Custom, +} +impl CreateCheckoutSessionCustomFieldsLabelType { + pub fn as_str(self) -> &'static str { + use CreateCheckoutSessionCustomFieldsLabelType::*; + match self { + Custom => "custom", + } + } +} + +impl std::str::FromStr for CreateCheckoutSessionCustomFieldsLabelType { + type Err = (); + fn from_str(s: &str) -> Result { + use CreateCheckoutSessionCustomFieldsLabelType::*; + match s { + "custom" => Ok(Custom), + _ => Err(()), + } + } +} +impl std::fmt::Display for CreateCheckoutSessionCustomFieldsLabelType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreateCheckoutSessionCustomFieldsLabelType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreateCheckoutSessionCustomFieldsLabelType { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Configuration for `type=numeric` fields. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreateCheckoutSessionCustomFieldsNumeric { + /// The maximum character length constraint for the customer's input. + #[serde(skip_serializing_if = "Option::is_none")] + pub maximum_length: Option, + /// The minimum character length requirement for the customer's input. + #[serde(skip_serializing_if = "Option::is_none")] + pub minimum_length: Option, +} +impl CreateCheckoutSessionCustomFieldsNumeric { + pub fn new() -> Self { + Self::default() + } +} +/// Configuration for `type=text` fields. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreateCheckoutSessionCustomFieldsText { + /// The maximum character length constraint for the customer's input. + #[serde(skip_serializing_if = "Option::is_none")] + pub maximum_length: Option, + /// The minimum character length requirement for the customer's input. + #[serde(skip_serializing_if = "Option::is_none")] + pub minimum_length: Option, +} +impl CreateCheckoutSessionCustomFieldsText { + pub fn new() -> Self { + Self::default() + } +} +/// The type of the field. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreateCheckoutSessionCustomFieldsType { + Dropdown, + Numeric, + Text, +} +impl CreateCheckoutSessionCustomFieldsType { + pub fn as_str(self) -> &'static str { + use CreateCheckoutSessionCustomFieldsType::*; + match self { + Dropdown => "dropdown", + Numeric => "numeric", + Text => "text", + } + } +} + +impl std::str::FromStr for CreateCheckoutSessionCustomFieldsType { + type Err = (); + fn from_str(s: &str) -> Result { + use CreateCheckoutSessionCustomFieldsType::*; + match s { + "dropdown" => Ok(Dropdown), + "numeric" => Ok(Numeric), + "text" => Ok(Text), + _ => Err(()), + } + } +} +impl std::fmt::Display for CreateCheckoutSessionCustomFieldsType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreateCheckoutSessionCustomFieldsType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreateCheckoutSessionCustomFieldsType { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Display additional text for your customers using custom text. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreateCheckoutSessionCustomText<'a> { + /// Custom text that should be displayed after the payment confirmation button. + #[serde(skip_serializing_if = "Option::is_none")] + pub after_submit: Option>, + /// Custom text that should be displayed alongside shipping address collection. + #[serde(skip_serializing_if = "Option::is_none")] + pub shipping_address: Option>, + /// Custom text that should be displayed alongside the payment confirmation button. + #[serde(skip_serializing_if = "Option::is_none")] + pub submit: Option>, + /// Custom text that should be displayed in place of the default terms of service agreement text. + #[serde(skip_serializing_if = "Option::is_none")] + pub terms_of_service_acceptance: Option>, +} +impl<'a> CreateCheckoutSessionCustomText<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// Configure whether a Checkout Session creates a [Customer](https://stripe.com/docs/api/customers) during Session confirmation. +/// +/// When a Customer is not created, you can still retrieve email, address, and other customer data entered in Checkout. +/// with [customer_details](https://stripe.com/docs/api/checkout/sessions/object#checkout_session_object-customer_details). +/// +/// Sessions that don't create Customers instead are grouped by [guest customers](https://stripe.com/docs/payments/checkout/guest-customers). +/// in the Dashboard. +/// Promotion codes limited to first time customers will return invalid for these Sessions. +/// +/// Can only be set in `payment` and `setup` mode. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreateCheckoutSessionCustomerCreation { + Always, + IfRequired, +} +impl CreateCheckoutSessionCustomerCreation { + pub fn as_str(self) -> &'static str { + use CreateCheckoutSessionCustomerCreation::*; + match self { + Always => "always", + IfRequired => "if_required", + } + } +} + +impl std::str::FromStr for CreateCheckoutSessionCustomerCreation { + type Err = (); + fn from_str(s: &str) -> Result { + use CreateCheckoutSessionCustomerCreation::*; + match s { + "always" => Ok(Always), + "if_required" => Ok(IfRequired), + _ => Err(()), + } + } +} +impl std::fmt::Display for CreateCheckoutSessionCustomerCreation { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreateCheckoutSessionCustomerCreation { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreateCheckoutSessionCustomerCreation { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Controls what fields on Customer can be updated by the Checkout Session. +/// Can only be provided when `customer` is provided. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreateCheckoutSessionCustomerUpdate { + /// Describes whether Checkout saves the billing address onto `customer.address`. + /// To always collect a full billing address, use `billing_address_collection`. Defaults to `never`. + #[serde(skip_serializing_if = "Option::is_none")] + pub address: Option, + /// Describes whether Checkout saves the name onto `customer.name`. Defaults to `never`. + #[serde(skip_serializing_if = "Option::is_none")] + pub name: Option, + /// Describes whether Checkout saves shipping information onto `customer.shipping`. + /// To collect shipping information, use `shipping_address_collection`. Defaults to `never`. + #[serde(skip_serializing_if = "Option::is_none")] + pub shipping: Option, +} +impl CreateCheckoutSessionCustomerUpdate { + pub fn new() -> Self { + Self::default() + } +} +/// Describes whether Checkout saves the billing address onto `customer.address`. +/// To always collect a full billing address, use `billing_address_collection`. Defaults to `never`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreateCheckoutSessionCustomerUpdateAddress { + Auto, + Never, +} +impl CreateCheckoutSessionCustomerUpdateAddress { + pub fn as_str(self) -> &'static str { + use CreateCheckoutSessionCustomerUpdateAddress::*; + match self { + Auto => "auto", + Never => "never", + } + } +} + +impl std::str::FromStr for CreateCheckoutSessionCustomerUpdateAddress { + type Err = (); + fn from_str(s: &str) -> Result { + use CreateCheckoutSessionCustomerUpdateAddress::*; + match s { + "auto" => Ok(Auto), + "never" => Ok(Never), + _ => Err(()), + } + } +} +impl std::fmt::Display for CreateCheckoutSessionCustomerUpdateAddress { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreateCheckoutSessionCustomerUpdateAddress { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreateCheckoutSessionCustomerUpdateAddress { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Describes whether Checkout saves the name onto `customer.name`. Defaults to `never`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreateCheckoutSessionCustomerUpdateName { + Auto, + Never, +} +impl CreateCheckoutSessionCustomerUpdateName { + pub fn as_str(self) -> &'static str { + use CreateCheckoutSessionCustomerUpdateName::*; + match self { + Auto => "auto", + Never => "never", + } + } +} + +impl std::str::FromStr for CreateCheckoutSessionCustomerUpdateName { + type Err = (); + fn from_str(s: &str) -> Result { + use CreateCheckoutSessionCustomerUpdateName::*; + match s { + "auto" => Ok(Auto), + "never" => Ok(Never), + _ => Err(()), + } + } +} +impl std::fmt::Display for CreateCheckoutSessionCustomerUpdateName { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreateCheckoutSessionCustomerUpdateName { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreateCheckoutSessionCustomerUpdateName { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Describes whether Checkout saves shipping information onto `customer.shipping`. +/// To collect shipping information, use `shipping_address_collection`. Defaults to `never`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreateCheckoutSessionCustomerUpdateShipping { + Auto, + Never, +} +impl CreateCheckoutSessionCustomerUpdateShipping { + pub fn as_str(self) -> &'static str { + use CreateCheckoutSessionCustomerUpdateShipping::*; + match self { + Auto => "auto", + Never => "never", + } + } +} + +impl std::str::FromStr for CreateCheckoutSessionCustomerUpdateShipping { + type Err = (); + fn from_str(s: &str) -> Result { + use CreateCheckoutSessionCustomerUpdateShipping::*; + match s { + "auto" => Ok(Auto), + "never" => Ok(Never), + _ => Err(()), + } + } +} +impl std::fmt::Display for CreateCheckoutSessionCustomerUpdateShipping { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreateCheckoutSessionCustomerUpdateShipping { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreateCheckoutSessionCustomerUpdateShipping { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// The coupon or promotion code to apply to this Session. Currently, only up to one may be specified. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreateCheckoutSessionDiscounts<'a> { + /// The ID of the coupon to apply to this Session. + #[serde(skip_serializing_if = "Option::is_none")] + pub coupon: Option<&'a str>, + /// The ID of a promotion code to apply to this Session. + #[serde(skip_serializing_if = "Option::is_none")] + pub promotion_code: Option<&'a str>, +} +impl<'a> CreateCheckoutSessionDiscounts<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// Generate a post-purchase Invoice for one-time payments. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreateCheckoutSessionInvoiceCreation<'a> { + /// Set to `true` to enable invoice creation. + pub enabled: bool, + /// Parameters passed when creating invoices for payment-mode Checkout Sessions. + #[serde(skip_serializing_if = "Option::is_none")] + pub invoice_data: Option>, +} +impl<'a> CreateCheckoutSessionInvoiceCreation<'a> { + pub fn new(enabled: bool) -> Self { + Self { enabled, invoice_data: None } + } +} +/// Parameters passed when creating invoices for payment-mode Checkout Sessions. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreateCheckoutSessionInvoiceCreationInvoiceData<'a> { + /// The account tax IDs associated with the invoice. + #[serde(skip_serializing_if = "Option::is_none")] + pub account_tax_ids: Option<&'a [&'a str]>, + /// Default custom fields to be displayed on invoices for this customer. + #[serde(skip_serializing_if = "Option::is_none")] + pub custom_fields: + Option<&'a [CreateCheckoutSessionInvoiceCreationInvoiceDataCustomFields<'a>]>, + /// An arbitrary string attached to the object. Often useful for displaying to users. + #[serde(skip_serializing_if = "Option::is_none")] + pub description: Option<&'a str>, + /// Default footer to be displayed on invoices for this customer. + #[serde(skip_serializing_if = "Option::is_none")] + pub footer: Option<&'a str>, + /// The connected account that issues the invoice. + /// The invoice is presented with the branding and support information of the specified account. + #[serde(skip_serializing_if = "Option::is_none")] + pub issuer: Option>, + /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. + /// This can be useful for storing additional information about the object in a structured format. + /// Individual keys can be unset by posting an empty value to them. + /// All keys can be unset by posting an empty value to `metadata`. + #[serde(skip_serializing_if = "Option::is_none")] + pub metadata: Option<&'a std::collections::HashMap>, + /// Default options for invoice PDF rendering for this customer. + #[serde(skip_serializing_if = "Option::is_none")] + pub rendering_options: Option, +} +impl<'a> CreateCheckoutSessionInvoiceCreationInvoiceData<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// Default custom fields to be displayed on invoices for this customer. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreateCheckoutSessionInvoiceCreationInvoiceDataCustomFields<'a> { + /// The name of the custom field. This may be up to 30 characters. + pub name: &'a str, + /// The value of the custom field. This may be up to 30 characters. + pub value: &'a str, +} +impl<'a> CreateCheckoutSessionInvoiceCreationInvoiceDataCustomFields<'a> { + pub fn new(name: &'a str, value: &'a str) -> Self { + Self { name, value } + } +} +/// The connected account that issues the invoice. +/// The invoice is presented with the branding and support information of the specified account. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreateCheckoutSessionInvoiceCreationInvoiceDataIssuer<'a> { + /// The connected account being referenced when `type` is `account`. + #[serde(skip_serializing_if = "Option::is_none")] + pub account: Option<&'a str>, + /// Type of the account referenced in the request. + #[serde(rename = "type")] + pub type_: CreateCheckoutSessionInvoiceCreationInvoiceDataIssuerType, +} +impl<'a> CreateCheckoutSessionInvoiceCreationInvoiceDataIssuer<'a> { + pub fn new(type_: CreateCheckoutSessionInvoiceCreationInvoiceDataIssuerType) -> Self { + Self { account: None, type_ } + } +} +/// Type of the account referenced in the request. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreateCheckoutSessionInvoiceCreationInvoiceDataIssuerType { + Account, + Self_, +} +impl CreateCheckoutSessionInvoiceCreationInvoiceDataIssuerType { + pub fn as_str(self) -> &'static str { + use CreateCheckoutSessionInvoiceCreationInvoiceDataIssuerType::*; + match self { + Account => "account", + Self_ => "self", + } + } +} + +impl std::str::FromStr for CreateCheckoutSessionInvoiceCreationInvoiceDataIssuerType { + type Err = (); + fn from_str(s: &str) -> Result { + use CreateCheckoutSessionInvoiceCreationInvoiceDataIssuerType::*; + match s { + "account" => Ok(Account), + "self" => Ok(Self_), + _ => Err(()), + } + } +} +impl std::fmt::Display for CreateCheckoutSessionInvoiceCreationInvoiceDataIssuerType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreateCheckoutSessionInvoiceCreationInvoiceDataIssuerType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreateCheckoutSessionInvoiceCreationInvoiceDataIssuerType { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Default options for invoice PDF rendering for this customer. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreateCheckoutSessionInvoiceCreationInvoiceDataRenderingOptions { + /// How line-item prices and amounts will be displayed with respect to tax on invoice PDFs. + /// One of `exclude_tax` or `include_inclusive_tax`. + /// `include_inclusive_tax` will include inclusive tax (and exclude exclusive tax) in invoice PDF amounts. + /// `exclude_tax` will exclude all tax (inclusive and exclusive alike) from invoice PDF amounts. + #[serde(skip_serializing_if = "Option::is_none")] + pub amount_tax_display: + Option, +} +impl CreateCheckoutSessionInvoiceCreationInvoiceDataRenderingOptions { + pub fn new() -> Self { + Self::default() + } +} +/// How line-item prices and amounts will be displayed with respect to tax on invoice PDFs. +/// One of `exclude_tax` or `include_inclusive_tax`. +/// `include_inclusive_tax` will include inclusive tax (and exclude exclusive tax) in invoice PDF amounts. +/// `exclude_tax` will exclude all tax (inclusive and exclusive alike) from invoice PDF amounts. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreateCheckoutSessionInvoiceCreationInvoiceDataRenderingOptionsAmountTaxDisplay { + ExcludeTax, + IncludeInclusiveTax, +} +impl CreateCheckoutSessionInvoiceCreationInvoiceDataRenderingOptionsAmountTaxDisplay { + pub fn as_str(self) -> &'static str { + use CreateCheckoutSessionInvoiceCreationInvoiceDataRenderingOptionsAmountTaxDisplay::*; + match self { + ExcludeTax => "exclude_tax", + IncludeInclusiveTax => "include_inclusive_tax", + } + } +} + +impl std::str::FromStr + for CreateCheckoutSessionInvoiceCreationInvoiceDataRenderingOptionsAmountTaxDisplay +{ + type Err = (); + fn from_str(s: &str) -> Result { + use CreateCheckoutSessionInvoiceCreationInvoiceDataRenderingOptionsAmountTaxDisplay::*; + match s { + "exclude_tax" => Ok(ExcludeTax), + "include_inclusive_tax" => Ok(IncludeInclusiveTax), + _ => Err(()), + } + } +} +impl std::fmt::Display + for CreateCheckoutSessionInvoiceCreationInvoiceDataRenderingOptionsAmountTaxDisplay +{ + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug + for CreateCheckoutSessionInvoiceCreationInvoiceDataRenderingOptionsAmountTaxDisplay +{ + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize + for CreateCheckoutSessionInvoiceCreationInvoiceDataRenderingOptionsAmountTaxDisplay +{ + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// A list of items the customer is purchasing. +/// Use this parameter to pass one-time or recurring [Prices](https://stripe.com/docs/api/prices). +/// +/// For `payment` mode, there is a maximum of 100 line items, however it is recommended to consolidate line items if there are more than a few dozen. +/// +/// For `subscription` mode, there is a maximum of 20 line items with recurring Prices and 20 line items with one-time Prices. +/// Line items with one-time Prices will be on the initial invoice only. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreateCheckoutSessionLineItems<'a> { + /// When set, provides configuration for this item’s quantity to be adjusted by the customer during Checkout. + #[serde(skip_serializing_if = "Option::is_none")] + pub adjustable_quantity: Option, + /// The [tax rates](https://stripe.com/docs/api/tax_rates) that will be applied to this line item depending on the customer's billing/shipping address. + /// We currently support the following countries: US, GB, AU, and all countries in the EU. + #[serde(skip_serializing_if = "Option::is_none")] + pub dynamic_tax_rates: Option<&'a [&'a str]>, + /// The ID of the [Price](https://stripe.com/docs/api/prices) or [Plan](https://stripe.com/docs/api/plans) object. + /// One of `price` or `price_data` is required. + #[serde(skip_serializing_if = "Option::is_none")] + pub price: Option<&'a str>, + /// Data used to generate a new [Price](https://stripe.com/docs/api/prices) object inline. + /// One of `price` or `price_data` is required. + #[serde(skip_serializing_if = "Option::is_none")] + pub price_data: Option>, + /// The quantity of the line item being purchased. + /// Quantity should not be defined when `recurring.usage_type=metered`. + #[serde(skip_serializing_if = "Option::is_none")] + pub quantity: Option, + /// The [tax rates](https://stripe.com/docs/api/tax_rates) which apply to this line item. + #[serde(skip_serializing_if = "Option::is_none")] + pub tax_rates: Option<&'a [&'a str]>, +} +impl<'a> CreateCheckoutSessionLineItems<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// When set, provides configuration for this item’s quantity to be adjusted by the customer during Checkout. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreateCheckoutSessionLineItemsAdjustableQuantity { + /// Set to true if the quantity can be adjusted to any non-negative integer. + /// By default customers will be able to remove the line item by setting the quantity to 0. + pub enabled: bool, + /// The maximum quantity the customer can purchase for the Checkout Session. + /// By default this value is 99. + /// You can specify a value up to 999999. + #[serde(skip_serializing_if = "Option::is_none")] + pub maximum: Option, + /// The minimum quantity the customer must purchase for the Checkout Session. + /// By default this value is 0. + #[serde(skip_serializing_if = "Option::is_none")] + pub minimum: Option, +} +impl CreateCheckoutSessionLineItemsAdjustableQuantity { + pub fn new(enabled: bool) -> Self { + Self { enabled, maximum: None, minimum: None } + } +} +/// Data used to generate a new [Price](https://stripe.com/docs/api/prices) object inline. +/// One of `price` or `price_data` is required. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreateCheckoutSessionLineItemsPriceData<'a> { + /// Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. + /// Must be a [supported currency](https://stripe.com/docs/currencies). + pub currency: stripe_types::Currency, + /// The ID of the product that this price will belong to. + /// One of `product` or `product_data` is required. + #[serde(skip_serializing_if = "Option::is_none")] + pub product: Option<&'a str>, + /// Data used to generate a new product object inline. One of `product` or `product_data` is required. + #[serde(skip_serializing_if = "Option::is_none")] + pub product_data: Option>, + /// The recurring components of a price such as `interval` and `interval_count`. + #[serde(skip_serializing_if = "Option::is_none")] + pub recurring: Option, + /// Only required if a [default tax behavior](https://stripe.com/docs/tax/products-prices-tax-categories-tax-behavior#setting-a-default-tax-behavior-(recommended)) was not provided in the Stripe Tax settings. + /// Specifies whether the price is considered inclusive of taxes or exclusive of taxes. + /// One of `inclusive`, `exclusive`, or `unspecified`. + /// Once specified as either `inclusive` or `exclusive`, it cannot be changed. + #[serde(skip_serializing_if = "Option::is_none")] + pub tax_behavior: Option, + /// A non-negative integer in cents (or local equivalent) representing how much to charge. + /// One of `unit_amount` or `unit_amount_decimal` is required. + #[serde(skip_serializing_if = "Option::is_none")] + pub unit_amount: Option, + /// Same as `unit_amount`, but accepts a decimal value in cents (or local equivalent) with at most 12 decimal places. + /// Only one of `unit_amount` and `unit_amount_decimal` can be set. + #[serde(skip_serializing_if = "Option::is_none")] + pub unit_amount_decimal: Option<&'a str>, +} +impl<'a> CreateCheckoutSessionLineItemsPriceData<'a> { + pub fn new(currency: stripe_types::Currency) -> Self { + Self { + currency, + product: None, + product_data: None, + recurring: None, + tax_behavior: None, + unit_amount: None, + unit_amount_decimal: None, + } + } +} +/// Data used to generate a new product object inline. One of `product` or `product_data` is required. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreateCheckoutSessionLineItemsPriceDataProductData<'a> { + /// The product's description, meant to be displayable to the customer. + /// Use this field to optionally store a long form explanation of the product being sold for your own rendering purposes. + #[serde(skip_serializing_if = "Option::is_none")] + pub description: Option<&'a str>, + /// A list of up to 8 URLs of images for this product, meant to be displayable to the customer. + #[serde(skip_serializing_if = "Option::is_none")] + pub images: Option<&'a [&'a str]>, + /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. + /// This can be useful for storing additional information about the object in a structured format. + /// Individual keys can be unset by posting an empty value to them. + /// All keys can be unset by posting an empty value to `metadata`. + #[serde(skip_serializing_if = "Option::is_none")] + pub metadata: Option<&'a std::collections::HashMap>, + /// The product's name, meant to be displayable to the customer. + pub name: &'a str, + /// A [tax code](https://stripe.com/docs/tax/tax-categories) ID. + #[serde(skip_serializing_if = "Option::is_none")] + pub tax_code: Option<&'a str>, +} +impl<'a> CreateCheckoutSessionLineItemsPriceDataProductData<'a> { + pub fn new(name: &'a str) -> Self { + Self { description: None, images: None, metadata: None, name, tax_code: None } + } +} +/// The recurring components of a price such as `interval` and `interval_count`. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreateCheckoutSessionLineItemsPriceDataRecurring { + /// Specifies billing frequency. Either `day`, `week`, `month` or `year`. + pub interval: CreateCheckoutSessionLineItemsPriceDataRecurringInterval, + /// The number of intervals between subscription billings. + /// For example, `interval=month` and `interval_count=3` bills every 3 months. + /// Maximum of three years interval allowed (3 years, 36 months, or 156 weeks). + #[serde(skip_serializing_if = "Option::is_none")] + pub interval_count: Option, +} +impl CreateCheckoutSessionLineItemsPriceDataRecurring { + pub fn new(interval: CreateCheckoutSessionLineItemsPriceDataRecurringInterval) -> Self { + Self { interval, interval_count: None } + } +} +/// Specifies billing frequency. Either `day`, `week`, `month` or `year`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreateCheckoutSessionLineItemsPriceDataRecurringInterval { + Day, + Month, + Week, + Year, +} +impl CreateCheckoutSessionLineItemsPriceDataRecurringInterval { + pub fn as_str(self) -> &'static str { + use CreateCheckoutSessionLineItemsPriceDataRecurringInterval::*; + match self { + Day => "day", + Month => "month", + Week => "week", + Year => "year", + } + } +} + +impl std::str::FromStr for CreateCheckoutSessionLineItemsPriceDataRecurringInterval { + type Err = (); + fn from_str(s: &str) -> Result { + use CreateCheckoutSessionLineItemsPriceDataRecurringInterval::*; + match s { + "day" => Ok(Day), + "month" => Ok(Month), + "week" => Ok(Week), + "year" => Ok(Year), + _ => Err(()), + } + } +} +impl std::fmt::Display for CreateCheckoutSessionLineItemsPriceDataRecurringInterval { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreateCheckoutSessionLineItemsPriceDataRecurringInterval { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreateCheckoutSessionLineItemsPriceDataRecurringInterval { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Only required if a [default tax behavior](https://stripe.com/docs/tax/products-prices-tax-categories-tax-behavior#setting-a-default-tax-behavior-(recommended)) was not provided in the Stripe Tax settings. +/// Specifies whether the price is considered inclusive of taxes or exclusive of taxes. +/// One of `inclusive`, `exclusive`, or `unspecified`. +/// Once specified as either `inclusive` or `exclusive`, it cannot be changed. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreateCheckoutSessionLineItemsPriceDataTaxBehavior { + Exclusive, + Inclusive, + Unspecified, +} +impl CreateCheckoutSessionLineItemsPriceDataTaxBehavior { + pub fn as_str(self) -> &'static str { + use CreateCheckoutSessionLineItemsPriceDataTaxBehavior::*; + match self { + Exclusive => "exclusive", + Inclusive => "inclusive", + Unspecified => "unspecified", + } + } +} + +impl std::str::FromStr for CreateCheckoutSessionLineItemsPriceDataTaxBehavior { + type Err = (); + fn from_str(s: &str) -> Result { + use CreateCheckoutSessionLineItemsPriceDataTaxBehavior::*; + match s { + "exclusive" => Ok(Exclusive), + "inclusive" => Ok(Inclusive), + "unspecified" => Ok(Unspecified), + _ => Err(()), + } + } +} +impl std::fmt::Display for CreateCheckoutSessionLineItemsPriceDataTaxBehavior { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreateCheckoutSessionLineItemsPriceDataTaxBehavior { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreateCheckoutSessionLineItemsPriceDataTaxBehavior { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// A subset of parameters to be passed to PaymentIntent creation for Checkout Sessions in `payment` mode. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreateCheckoutSessionPaymentIntentData<'a> { + /// The amount of the application fee (if any) that will be requested to be applied to the payment and transferred to the application owner's Stripe account. + /// The amount of the application fee collected will be capped at the total payment amount. + /// For more information, see the PaymentIntents [use case for connected accounts](https://stripe.com/docs/payments/connected-accounts). + #[serde(skip_serializing_if = "Option::is_none")] + pub application_fee_amount: Option, + /// Controls when the funds will be captured from the customer's account. + #[serde(skip_serializing_if = "Option::is_none")] + pub capture_method: Option, + /// An arbitrary string attached to the object. Often useful for displaying to users. + #[serde(skip_serializing_if = "Option::is_none")] + pub description: Option<&'a str>, + /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. + /// This can be useful for storing additional information about the object in a structured format. + /// Individual keys can be unset by posting an empty value to them. + /// All keys can be unset by posting an empty value to `metadata`. + #[serde(skip_serializing_if = "Option::is_none")] + pub metadata: Option<&'a std::collections::HashMap>, + /// The Stripe account ID for which these funds are intended. For details, + /// see the PaymentIntents [use case for connected + /// accounts](/docs/payments/connected-accounts). + #[serde(skip_serializing_if = "Option::is_none")] + pub on_behalf_of: Option<&'a str>, + /// Email address that the receipt for the resulting payment will be sent to. + /// If `receipt_email` is specified for a payment in live mode, a receipt will be sent regardless of your [email settings](https://dashboard.stripe.com/account/emails). + #[serde(skip_serializing_if = "Option::is_none")] + pub receipt_email: Option<&'a str>, + /// Indicates that you intend to [make future payments](https://stripe.com/docs/payments/payment-intents#future-usage) with the payment. + /// method collected by this Checkout Session. + /// + /// When setting this to `on_session`, Checkout will show a notice to the + /// customer that their payment details will be saved. + /// + /// When setting this to `off_session`, Checkout will show a notice to the + /// customer that their payment details will be saved and used for future + /// payments. + /// + /// If a Customer has been provided or Checkout creates a new Customer, + /// Checkout will attach the payment method to the Customer. + /// + /// If Checkout does not create a Customer, the payment method is not attached + /// to a Customer. To reuse the payment method, you can retrieve it from the + /// Checkout Session's PaymentIntent. + /// + /// When processing card payments, Checkout also uses `setup_future_usage` + /// to dynamically optimize your payment flow and comply with regional + /// legislation and network rules, such as SCA. + #[serde(skip_serializing_if = "Option::is_none")] + pub setup_future_usage: Option, + /// Shipping information for this payment. + #[serde(skip_serializing_if = "Option::is_none")] + pub shipping: Option>, + /// Extra information about the payment. This will appear on your + /// customer's statement when this payment succeeds in creating a charge. + #[serde(skip_serializing_if = "Option::is_none")] + pub statement_descriptor: Option<&'a str>, + /// Provides information about the charge that customers see on their statements. Concatenated with the + /// prefix (shortened descriptor) or statement descriptor that’s set on the account to form the complete. + /// statement descriptor. Maximum 22 characters for the concatenated descriptor. + #[serde(skip_serializing_if = "Option::is_none")] + pub statement_descriptor_suffix: Option<&'a str>, + /// The parameters used to automatically create a Transfer when the payment succeeds. + /// For more information, see the PaymentIntents [use case for connected accounts](https://stripe.com/docs/payments/connected-accounts). + #[serde(skip_serializing_if = "Option::is_none")] + pub transfer_data: Option>, + /// A string that identifies the resulting payment as part of a group. + /// See the PaymentIntents [use case for connected accounts](https://stripe.com/docs/connect/separate-charges-and-transfers) for details. + #[serde(skip_serializing_if = "Option::is_none")] + pub transfer_group: Option<&'a str>, +} +impl<'a> CreateCheckoutSessionPaymentIntentData<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// Controls when the funds will be captured from the customer's account. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreateCheckoutSessionPaymentIntentDataCaptureMethod { + Automatic, + AutomaticAsync, + Manual, +} +impl CreateCheckoutSessionPaymentIntentDataCaptureMethod { + pub fn as_str(self) -> &'static str { + use CreateCheckoutSessionPaymentIntentDataCaptureMethod::*; + match self { + Automatic => "automatic", + AutomaticAsync => "automatic_async", + Manual => "manual", + } + } +} + +impl std::str::FromStr for CreateCheckoutSessionPaymentIntentDataCaptureMethod { + type Err = (); + fn from_str(s: &str) -> Result { + use CreateCheckoutSessionPaymentIntentDataCaptureMethod::*; + match s { + "automatic" => Ok(Automatic), + "automatic_async" => Ok(AutomaticAsync), + "manual" => Ok(Manual), + _ => Err(()), + } + } +} +impl std::fmt::Display for CreateCheckoutSessionPaymentIntentDataCaptureMethod { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreateCheckoutSessionPaymentIntentDataCaptureMethod { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreateCheckoutSessionPaymentIntentDataCaptureMethod { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Indicates that you intend to [make future payments](https://stripe.com/docs/payments/payment-intents#future-usage) with the payment. +/// method collected by this Checkout Session. +/// +/// When setting this to `on_session`, Checkout will show a notice to the +/// customer that their payment details will be saved. +/// +/// When setting this to `off_session`, Checkout will show a notice to the +/// customer that their payment details will be saved and used for future +/// payments. +/// +/// If a Customer has been provided or Checkout creates a new Customer, +/// Checkout will attach the payment method to the Customer. +/// +/// If Checkout does not create a Customer, the payment method is not attached +/// to a Customer. To reuse the payment method, you can retrieve it from the +/// Checkout Session's PaymentIntent. +/// +/// When processing card payments, Checkout also uses `setup_future_usage` +/// to dynamically optimize your payment flow and comply with regional +/// legislation and network rules, such as SCA. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreateCheckoutSessionPaymentIntentDataSetupFutureUsage { + OffSession, + OnSession, +} +impl CreateCheckoutSessionPaymentIntentDataSetupFutureUsage { + pub fn as_str(self) -> &'static str { + use CreateCheckoutSessionPaymentIntentDataSetupFutureUsage::*; + match self { + OffSession => "off_session", + OnSession => "on_session", + } + } +} + +impl std::str::FromStr for CreateCheckoutSessionPaymentIntentDataSetupFutureUsage { + type Err = (); + fn from_str(s: &str) -> Result { + use CreateCheckoutSessionPaymentIntentDataSetupFutureUsage::*; + match s { + "off_session" => Ok(OffSession), + "on_session" => Ok(OnSession), + _ => Err(()), + } + } +} +impl std::fmt::Display for CreateCheckoutSessionPaymentIntentDataSetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreateCheckoutSessionPaymentIntentDataSetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreateCheckoutSessionPaymentIntentDataSetupFutureUsage { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Shipping information for this payment. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreateCheckoutSessionPaymentIntentDataShipping<'a> { + /// Shipping address. + pub address: CreateCheckoutSessionPaymentIntentDataShippingAddress<'a>, + /// The delivery service that shipped a physical product, such as Fedex, UPS, USPS, etc. + #[serde(skip_serializing_if = "Option::is_none")] + pub carrier: Option<&'a str>, + /// Recipient name. + pub name: &'a str, + /// Recipient phone (including extension). + #[serde(skip_serializing_if = "Option::is_none")] + pub phone: Option<&'a str>, + /// The tracking number for a physical product, obtained from the delivery service. + /// If multiple tracking numbers were generated for this purchase, please separate them with commas. + #[serde(skip_serializing_if = "Option::is_none")] + pub tracking_number: Option<&'a str>, +} +impl<'a> CreateCheckoutSessionPaymentIntentDataShipping<'a> { + pub fn new( + address: CreateCheckoutSessionPaymentIntentDataShippingAddress<'a>, + name: &'a str, + ) -> Self { + Self { address, carrier: None, name, phone: None, tracking_number: None } + } +} +/// Shipping address. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreateCheckoutSessionPaymentIntentDataShippingAddress<'a> { + /// City, district, suburb, town, or village. + #[serde(skip_serializing_if = "Option::is_none")] + pub city: Option<&'a str>, + /// Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). + #[serde(skip_serializing_if = "Option::is_none")] + pub country: Option<&'a str>, + /// Address line 1 (e.g., street, PO Box, or company name). + pub line1: &'a str, + /// Address line 2 (e.g., apartment, suite, unit, or building). + #[serde(skip_serializing_if = "Option::is_none")] + pub line2: Option<&'a str>, + /// ZIP or postal code. + #[serde(skip_serializing_if = "Option::is_none")] + pub postal_code: Option<&'a str>, + /// State, county, province, or region. + #[serde(skip_serializing_if = "Option::is_none")] + pub state: Option<&'a str>, +} +impl<'a> CreateCheckoutSessionPaymentIntentDataShippingAddress<'a> { + pub fn new(line1: &'a str) -> Self { + Self { city: None, country: None, line1, line2: None, postal_code: None, state: None } + } +} +/// The parameters used to automatically create a Transfer when the payment succeeds. +/// For more information, see the PaymentIntents [use case for connected accounts](https://stripe.com/docs/payments/connected-accounts). +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreateCheckoutSessionPaymentIntentDataTransferData<'a> { + /// The amount that will be transferred automatically when a charge succeeds. + #[serde(skip_serializing_if = "Option::is_none")] + pub amount: Option, + /// If specified, successful charges will be attributed to the destination + /// account for tax reporting, and the funds from charges will be transferred + /// to the destination account. The ID of the resulting transfer will be + /// returned on the successful charge's `transfer` field. + pub destination: &'a str, +} +impl<'a> CreateCheckoutSessionPaymentIntentDataTransferData<'a> { + pub fn new(destination: &'a str) -> Self { + Self { amount: None, destination } + } +} +/// Specify whether Checkout should collect a payment method. +/// When set to `if_required`, Checkout will not collect a payment method when the total due for the session is 0. +/// This may occur if the Checkout Session includes a free trial or a discount. +/// +/// Can only be set in `subscription` mode. +/// +/// If you'd like information on how to collect a payment method outside of Checkout, read the guide on configuring [subscriptions with a free trial](https://stripe.com/docs/payments/checkout/free-trials). +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreateCheckoutSessionPaymentMethodCollection { + Always, + IfRequired, +} +impl CreateCheckoutSessionPaymentMethodCollection { + pub fn as_str(self) -> &'static str { + use CreateCheckoutSessionPaymentMethodCollection::*; + match self { + Always => "always", + IfRequired => "if_required", + } + } +} + +impl std::str::FromStr for CreateCheckoutSessionPaymentMethodCollection { + type Err = (); + fn from_str(s: &str) -> Result { + use CreateCheckoutSessionPaymentMethodCollection::*; + match s { + "always" => Ok(Always), + "if_required" => Ok(IfRequired), + _ => Err(()), + } + } +} +impl std::fmt::Display for CreateCheckoutSessionPaymentMethodCollection { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreateCheckoutSessionPaymentMethodCollection { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreateCheckoutSessionPaymentMethodCollection { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Payment-method-specific configuration. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreateCheckoutSessionPaymentMethodOptions<'a> { + /// contains details about the ACSS Debit payment method options. + #[serde(skip_serializing_if = "Option::is_none")] + pub acss_debit: Option>, + /// contains details about the Affirm payment method options. + #[serde(skip_serializing_if = "Option::is_none")] + pub affirm: Option, + /// contains details about the Afterpay Clearpay payment method options. + #[serde(skip_serializing_if = "Option::is_none")] + pub afterpay_clearpay: Option, + /// contains details about the Alipay payment method options. + #[serde(skip_serializing_if = "Option::is_none")] + pub alipay: Option, + /// contains details about the AU Becs Debit payment method options. + #[serde(skip_serializing_if = "Option::is_none")] + pub au_becs_debit: Option, + /// contains details about the Bacs Debit payment method options. + #[serde(skip_serializing_if = "Option::is_none")] + pub bacs_debit: Option, + /// contains details about the Bancontact payment method options. + #[serde(skip_serializing_if = "Option::is_none")] + pub bancontact: Option, + /// contains details about the Boleto payment method options. + #[serde(skip_serializing_if = "Option::is_none")] + pub boleto: Option, + /// contains details about the Card payment method options. + #[serde(skip_serializing_if = "Option::is_none")] + pub card: Option>, + /// contains details about the Cashapp Pay payment method options. + #[serde(skip_serializing_if = "Option::is_none")] + pub cashapp: Option, + /// contains details about the Customer Balance payment method options. + #[serde(skip_serializing_if = "Option::is_none")] + pub customer_balance: Option>, + /// contains details about the EPS payment method options. + #[serde(skip_serializing_if = "Option::is_none")] + pub eps: Option, + /// contains details about the FPX payment method options. + #[serde(skip_serializing_if = "Option::is_none")] + pub fpx: Option, + /// contains details about the Giropay payment method options. + #[serde(skip_serializing_if = "Option::is_none")] + pub giropay: Option, + /// contains details about the Grabpay payment method options. + #[serde(skip_serializing_if = "Option::is_none")] + pub grabpay: Option, + /// contains details about the Ideal payment method options. + #[serde(skip_serializing_if = "Option::is_none")] + pub ideal: Option, + /// contains details about the Klarna payment method options. + #[serde(skip_serializing_if = "Option::is_none")] + pub klarna: Option, + /// contains details about the Konbini payment method options. + #[serde(skip_serializing_if = "Option::is_none")] + pub konbini: Option, + /// contains details about the Link payment method options. + #[serde(skip_serializing_if = "Option::is_none")] + pub link: Option, + /// contains details about the OXXO payment method options. + #[serde(skip_serializing_if = "Option::is_none")] + pub oxxo: Option, + /// contains details about the P24 payment method options. + #[serde(skip_serializing_if = "Option::is_none")] + pub p24: Option, + /// contains details about the PayNow payment method options. + #[serde(skip_serializing_if = "Option::is_none")] + pub paynow: Option, + /// contains details about the PayPal payment method options. + #[serde(skip_serializing_if = "Option::is_none")] + pub paypal: Option>, + /// contains details about the Pix payment method options. + #[serde(skip_serializing_if = "Option::is_none")] + pub pix: Option, + /// contains details about the RevolutPay payment method options. + #[serde(skip_serializing_if = "Option::is_none")] + pub revolut_pay: Option, + /// contains details about the Sepa Debit payment method options. + #[serde(skip_serializing_if = "Option::is_none")] + pub sepa_debit: Option, + /// contains details about the Sofort payment method options. + #[serde(skip_serializing_if = "Option::is_none")] + pub sofort: Option, + /// contains details about the Swish payment method options. + #[serde(skip_serializing_if = "Option::is_none")] + pub swish: Option>, + /// contains details about the Us Bank Account payment method options. + #[serde(skip_serializing_if = "Option::is_none")] + pub us_bank_account: Option>, + /// contains details about the WeChat Pay payment method options. + #[serde(skip_serializing_if = "Option::is_none")] + pub wechat_pay: Option>, +} +impl<'a> CreateCheckoutSessionPaymentMethodOptions<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// contains details about the ACSS Debit payment method options. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreateCheckoutSessionPaymentMethodOptionsAcssDebit<'a> { + /// Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. + /// Must be a [supported currency](https://stripe.com/docs/currencies). + /// This is only accepted for Checkout Sessions in `setup` mode. + #[serde(skip_serializing_if = "Option::is_none")] + pub currency: Option, + /// Additional fields for Mandate creation + #[serde(skip_serializing_if = "Option::is_none")] + pub mandate_options: + Option>, + /// Indicates that you intend to make future payments with this PaymentIntent's payment method. + /// + /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. + /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + /// + /// When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + #[serde(skip_serializing_if = "Option::is_none")] + pub setup_future_usage: + Option, + /// Verification method for the intent + #[serde(skip_serializing_if = "Option::is_none")] + pub verification_method: + Option, +} +impl<'a> CreateCheckoutSessionPaymentMethodOptionsAcssDebit<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. +/// Must be a [supported currency](https://stripe.com/docs/currencies). +/// This is only accepted for Checkout Sessions in `setup` mode. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreateCheckoutSessionPaymentMethodOptionsAcssDebitCurrency { + Cad, + Usd, +} +impl CreateCheckoutSessionPaymentMethodOptionsAcssDebitCurrency { + pub fn as_str(self) -> &'static str { + use CreateCheckoutSessionPaymentMethodOptionsAcssDebitCurrency::*; + match self { + Cad => "cad", + Usd => "usd", + } + } +} + +impl std::str::FromStr for CreateCheckoutSessionPaymentMethodOptionsAcssDebitCurrency { + type Err = (); + fn from_str(s: &str) -> Result { + use CreateCheckoutSessionPaymentMethodOptionsAcssDebitCurrency::*; + match s { + "cad" => Ok(Cad), + "usd" => Ok(Usd), + _ => Err(()), + } + } +} +impl std::fmt::Display for CreateCheckoutSessionPaymentMethodOptionsAcssDebitCurrency { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreateCheckoutSessionPaymentMethodOptionsAcssDebitCurrency { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreateCheckoutSessionPaymentMethodOptionsAcssDebitCurrency { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Additional fields for Mandate creation +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreateCheckoutSessionPaymentMethodOptionsAcssDebitMandateOptions<'a> { + /// A URL for custom mandate text to render during confirmation step. + /// The URL will be rendered with additional GET parameters `payment_intent` and `payment_intent_client_secret` when confirming a Payment Intent,. + /// or `setup_intent` and `setup_intent_client_secret` when confirming a Setup Intent. + #[serde(skip_serializing_if = "Option::is_none")] + pub custom_mandate_url: Option<&'a str>, + /// List of Stripe products where this mandate can be selected automatically. + /// Only usable in `setup` mode. + #[serde(skip_serializing_if = "Option::is_none")] + pub default_for: + Option<&'a [CreateCheckoutSessionPaymentMethodOptionsAcssDebitMandateOptionsDefaultFor]>, + /// Description of the mandate interval. + /// Only required if 'payment_schedule' parameter is 'interval' or 'combined'. + #[serde(skip_serializing_if = "Option::is_none")] + pub interval_description: Option<&'a str>, + /// Payment schedule for the mandate. + #[serde(skip_serializing_if = "Option::is_none")] + pub payment_schedule: + Option, + /// Transaction type of the mandate. + #[serde(skip_serializing_if = "Option::is_none")] + pub transaction_type: + Option, +} +impl<'a> CreateCheckoutSessionPaymentMethodOptionsAcssDebitMandateOptions<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// List of Stripe products where this mandate can be selected automatically. +/// Only usable in `setup` mode. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreateCheckoutSessionPaymentMethodOptionsAcssDebitMandateOptionsDefaultFor { + Invoice, + Subscription, +} +impl CreateCheckoutSessionPaymentMethodOptionsAcssDebitMandateOptionsDefaultFor { + pub fn as_str(self) -> &'static str { + use CreateCheckoutSessionPaymentMethodOptionsAcssDebitMandateOptionsDefaultFor::*; + match self { + Invoice => "invoice", + Subscription => "subscription", + } + } +} + +impl std::str::FromStr + for CreateCheckoutSessionPaymentMethodOptionsAcssDebitMandateOptionsDefaultFor +{ + type Err = (); + fn from_str(s: &str) -> Result { + use CreateCheckoutSessionPaymentMethodOptionsAcssDebitMandateOptionsDefaultFor::*; + match s { + "invoice" => Ok(Invoice), + "subscription" => Ok(Subscription), + _ => Err(()), + } + } +} +impl std::fmt::Display + for CreateCheckoutSessionPaymentMethodOptionsAcssDebitMandateOptionsDefaultFor +{ + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug + for CreateCheckoutSessionPaymentMethodOptionsAcssDebitMandateOptionsDefaultFor +{ + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize + for CreateCheckoutSessionPaymentMethodOptionsAcssDebitMandateOptionsDefaultFor +{ + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Payment schedule for the mandate. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreateCheckoutSessionPaymentMethodOptionsAcssDebitMandateOptionsPaymentSchedule { + Combined, + Interval, + Sporadic, +} +impl CreateCheckoutSessionPaymentMethodOptionsAcssDebitMandateOptionsPaymentSchedule { + pub fn as_str(self) -> &'static str { + use CreateCheckoutSessionPaymentMethodOptionsAcssDebitMandateOptionsPaymentSchedule::*; + match self { + Combined => "combined", + Interval => "interval", + Sporadic => "sporadic", + } + } +} + +impl std::str::FromStr + for CreateCheckoutSessionPaymentMethodOptionsAcssDebitMandateOptionsPaymentSchedule +{ + type Err = (); + fn from_str(s: &str) -> Result { + use CreateCheckoutSessionPaymentMethodOptionsAcssDebitMandateOptionsPaymentSchedule::*; + match s { + "combined" => Ok(Combined), + "interval" => Ok(Interval), + "sporadic" => Ok(Sporadic), + _ => Err(()), + } + } +} +impl std::fmt::Display + for CreateCheckoutSessionPaymentMethodOptionsAcssDebitMandateOptionsPaymentSchedule +{ + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug + for CreateCheckoutSessionPaymentMethodOptionsAcssDebitMandateOptionsPaymentSchedule +{ + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize + for CreateCheckoutSessionPaymentMethodOptionsAcssDebitMandateOptionsPaymentSchedule +{ + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Transaction type of the mandate. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreateCheckoutSessionPaymentMethodOptionsAcssDebitMandateOptionsTransactionType { + Business, + Personal, +} +impl CreateCheckoutSessionPaymentMethodOptionsAcssDebitMandateOptionsTransactionType { + pub fn as_str(self) -> &'static str { + use CreateCheckoutSessionPaymentMethodOptionsAcssDebitMandateOptionsTransactionType::*; + match self { + Business => "business", + Personal => "personal", + } + } +} + +impl std::str::FromStr + for CreateCheckoutSessionPaymentMethodOptionsAcssDebitMandateOptionsTransactionType +{ + type Err = (); + fn from_str(s: &str) -> Result { + use CreateCheckoutSessionPaymentMethodOptionsAcssDebitMandateOptionsTransactionType::*; + match s { + "business" => Ok(Business), + "personal" => Ok(Personal), + _ => Err(()), + } + } +} +impl std::fmt::Display + for CreateCheckoutSessionPaymentMethodOptionsAcssDebitMandateOptionsTransactionType +{ + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug + for CreateCheckoutSessionPaymentMethodOptionsAcssDebitMandateOptionsTransactionType +{ + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize + for CreateCheckoutSessionPaymentMethodOptionsAcssDebitMandateOptionsTransactionType +{ + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Indicates that you intend to make future payments with this PaymentIntent's payment method. +/// +/// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. +/// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. +/// +/// When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreateCheckoutSessionPaymentMethodOptionsAcssDebitSetupFutureUsage { + None, + OffSession, + OnSession, +} +impl CreateCheckoutSessionPaymentMethodOptionsAcssDebitSetupFutureUsage { + pub fn as_str(self) -> &'static str { + use CreateCheckoutSessionPaymentMethodOptionsAcssDebitSetupFutureUsage::*; + match self { + None => "none", + OffSession => "off_session", + OnSession => "on_session", + } + } +} + +impl std::str::FromStr for CreateCheckoutSessionPaymentMethodOptionsAcssDebitSetupFutureUsage { + type Err = (); + fn from_str(s: &str) -> Result { + use CreateCheckoutSessionPaymentMethodOptionsAcssDebitSetupFutureUsage::*; + match s { + "none" => Ok(None), + "off_session" => Ok(OffSession), + "on_session" => Ok(OnSession), + _ => Err(()), + } + } +} +impl std::fmt::Display for CreateCheckoutSessionPaymentMethodOptionsAcssDebitSetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreateCheckoutSessionPaymentMethodOptionsAcssDebitSetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreateCheckoutSessionPaymentMethodOptionsAcssDebitSetupFutureUsage { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Verification method for the intent +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreateCheckoutSessionPaymentMethodOptionsAcssDebitVerificationMethod { + Automatic, + Instant, + Microdeposits, +} +impl CreateCheckoutSessionPaymentMethodOptionsAcssDebitVerificationMethod { + pub fn as_str(self) -> &'static str { + use CreateCheckoutSessionPaymentMethodOptionsAcssDebitVerificationMethod::*; + match self { + Automatic => "automatic", + Instant => "instant", + Microdeposits => "microdeposits", + } + } +} + +impl std::str::FromStr for CreateCheckoutSessionPaymentMethodOptionsAcssDebitVerificationMethod { + type Err = (); + fn from_str(s: &str) -> Result { + use CreateCheckoutSessionPaymentMethodOptionsAcssDebitVerificationMethod::*; + match s { + "automatic" => Ok(Automatic), + "instant" => Ok(Instant), + "microdeposits" => Ok(Microdeposits), + _ => Err(()), + } + } +} +impl std::fmt::Display for CreateCheckoutSessionPaymentMethodOptionsAcssDebitVerificationMethod { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreateCheckoutSessionPaymentMethodOptionsAcssDebitVerificationMethod { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreateCheckoutSessionPaymentMethodOptionsAcssDebitVerificationMethod { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// contains details about the Affirm payment method options. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreateCheckoutSessionPaymentMethodOptionsAffirm { + /// Indicates that you intend to make future payments with this PaymentIntent's payment method. + /// + /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. + /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + /// + /// When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + #[serde(skip_serializing_if = "Option::is_none")] + pub setup_future_usage: Option, +} +impl CreateCheckoutSessionPaymentMethodOptionsAffirm { + pub fn new() -> Self { + Self::default() + } +} +/// Indicates that you intend to make future payments with this PaymentIntent's payment method. +/// +/// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. +/// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. +/// +/// When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreateCheckoutSessionPaymentMethodOptionsAffirmSetupFutureUsage { + None, +} +impl CreateCheckoutSessionPaymentMethodOptionsAffirmSetupFutureUsage { + pub fn as_str(self) -> &'static str { + use CreateCheckoutSessionPaymentMethodOptionsAffirmSetupFutureUsage::*; + match self { + None => "none", + } + } +} + +impl std::str::FromStr for CreateCheckoutSessionPaymentMethodOptionsAffirmSetupFutureUsage { + type Err = (); + fn from_str(s: &str) -> Result { + use CreateCheckoutSessionPaymentMethodOptionsAffirmSetupFutureUsage::*; + match s { + "none" => Ok(None), + _ => Err(()), + } + } +} +impl std::fmt::Display for CreateCheckoutSessionPaymentMethodOptionsAffirmSetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreateCheckoutSessionPaymentMethodOptionsAffirmSetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreateCheckoutSessionPaymentMethodOptionsAffirmSetupFutureUsage { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// contains details about the Afterpay Clearpay payment method options. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreateCheckoutSessionPaymentMethodOptionsAfterpayClearpay { + /// Indicates that you intend to make future payments with this PaymentIntent's payment method. + /// + /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. + /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + /// + /// When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + #[serde(skip_serializing_if = "Option::is_none")] + pub setup_future_usage: + Option, +} +impl CreateCheckoutSessionPaymentMethodOptionsAfterpayClearpay { + pub fn new() -> Self { + Self::default() + } +} +/// Indicates that you intend to make future payments with this PaymentIntent's payment method. +/// +/// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. +/// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. +/// +/// When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreateCheckoutSessionPaymentMethodOptionsAfterpayClearpaySetupFutureUsage { + None, +} +impl CreateCheckoutSessionPaymentMethodOptionsAfterpayClearpaySetupFutureUsage { + pub fn as_str(self) -> &'static str { + use CreateCheckoutSessionPaymentMethodOptionsAfterpayClearpaySetupFutureUsage::*; + match self { + None => "none", + } + } +} + +impl std::str::FromStr + for CreateCheckoutSessionPaymentMethodOptionsAfterpayClearpaySetupFutureUsage +{ + type Err = (); + fn from_str(s: &str) -> Result { + use CreateCheckoutSessionPaymentMethodOptionsAfterpayClearpaySetupFutureUsage::*; + match s { + "none" => Ok(None), + _ => Err(()), + } + } +} +impl std::fmt::Display + for CreateCheckoutSessionPaymentMethodOptionsAfterpayClearpaySetupFutureUsage +{ + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreateCheckoutSessionPaymentMethodOptionsAfterpayClearpaySetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize + for CreateCheckoutSessionPaymentMethodOptionsAfterpayClearpaySetupFutureUsage +{ + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// contains details about the Alipay payment method options. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreateCheckoutSessionPaymentMethodOptionsAlipay { + /// Indicates that you intend to make future payments with this PaymentIntent's payment method. + /// + /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. + /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + /// + /// When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + #[serde(skip_serializing_if = "Option::is_none")] + pub setup_future_usage: Option, +} +impl CreateCheckoutSessionPaymentMethodOptionsAlipay { + pub fn new() -> Self { + Self::default() + } +} +/// Indicates that you intend to make future payments with this PaymentIntent's payment method. +/// +/// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. +/// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. +/// +/// When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreateCheckoutSessionPaymentMethodOptionsAlipaySetupFutureUsage { + None, +} +impl CreateCheckoutSessionPaymentMethodOptionsAlipaySetupFutureUsage { + pub fn as_str(self) -> &'static str { + use CreateCheckoutSessionPaymentMethodOptionsAlipaySetupFutureUsage::*; + match self { + None => "none", + } + } +} + +impl std::str::FromStr for CreateCheckoutSessionPaymentMethodOptionsAlipaySetupFutureUsage { + type Err = (); + fn from_str(s: &str) -> Result { + use CreateCheckoutSessionPaymentMethodOptionsAlipaySetupFutureUsage::*; + match s { + "none" => Ok(None), + _ => Err(()), + } + } +} +impl std::fmt::Display for CreateCheckoutSessionPaymentMethodOptionsAlipaySetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreateCheckoutSessionPaymentMethodOptionsAlipaySetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreateCheckoutSessionPaymentMethodOptionsAlipaySetupFutureUsage { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// contains details about the AU Becs Debit payment method options. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreateCheckoutSessionPaymentMethodOptionsAuBecsDebit { + /// Indicates that you intend to make future payments with this PaymentIntent's payment method. + /// + /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. + /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + /// + /// When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + #[serde(skip_serializing_if = "Option::is_none")] + pub setup_future_usage: + Option, +} +impl CreateCheckoutSessionPaymentMethodOptionsAuBecsDebit { + pub fn new() -> Self { + Self::default() + } +} +/// Indicates that you intend to make future payments with this PaymentIntent's payment method. +/// +/// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. +/// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. +/// +/// When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreateCheckoutSessionPaymentMethodOptionsAuBecsDebitSetupFutureUsage { + None, +} +impl CreateCheckoutSessionPaymentMethodOptionsAuBecsDebitSetupFutureUsage { + pub fn as_str(self) -> &'static str { + use CreateCheckoutSessionPaymentMethodOptionsAuBecsDebitSetupFutureUsage::*; + match self { + None => "none", + } + } +} + +impl std::str::FromStr for CreateCheckoutSessionPaymentMethodOptionsAuBecsDebitSetupFutureUsage { + type Err = (); + fn from_str(s: &str) -> Result { + use CreateCheckoutSessionPaymentMethodOptionsAuBecsDebitSetupFutureUsage::*; + match s { + "none" => Ok(None), + _ => Err(()), + } + } +} +impl std::fmt::Display for CreateCheckoutSessionPaymentMethodOptionsAuBecsDebitSetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreateCheckoutSessionPaymentMethodOptionsAuBecsDebitSetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreateCheckoutSessionPaymentMethodOptionsAuBecsDebitSetupFutureUsage { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// contains details about the Bacs Debit payment method options. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreateCheckoutSessionPaymentMethodOptionsBacsDebit { + /// Indicates that you intend to make future payments with this PaymentIntent's payment method. + /// + /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. + /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + /// + /// When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + #[serde(skip_serializing_if = "Option::is_none")] + pub setup_future_usage: + Option, +} +impl CreateCheckoutSessionPaymentMethodOptionsBacsDebit { + pub fn new() -> Self { + Self::default() + } +} +/// Indicates that you intend to make future payments with this PaymentIntent's payment method. +/// +/// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. +/// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. +/// +/// When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreateCheckoutSessionPaymentMethodOptionsBacsDebitSetupFutureUsage { + None, + OffSession, + OnSession, +} +impl CreateCheckoutSessionPaymentMethodOptionsBacsDebitSetupFutureUsage { + pub fn as_str(self) -> &'static str { + use CreateCheckoutSessionPaymentMethodOptionsBacsDebitSetupFutureUsage::*; + match self { + None => "none", + OffSession => "off_session", + OnSession => "on_session", + } + } +} + +impl std::str::FromStr for CreateCheckoutSessionPaymentMethodOptionsBacsDebitSetupFutureUsage { + type Err = (); + fn from_str(s: &str) -> Result { + use CreateCheckoutSessionPaymentMethodOptionsBacsDebitSetupFutureUsage::*; + match s { + "none" => Ok(None), + "off_session" => Ok(OffSession), + "on_session" => Ok(OnSession), + _ => Err(()), + } + } +} +impl std::fmt::Display for CreateCheckoutSessionPaymentMethodOptionsBacsDebitSetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreateCheckoutSessionPaymentMethodOptionsBacsDebitSetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreateCheckoutSessionPaymentMethodOptionsBacsDebitSetupFutureUsage { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// contains details about the Bancontact payment method options. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreateCheckoutSessionPaymentMethodOptionsBancontact { + /// Indicates that you intend to make future payments with this PaymentIntent's payment method. + /// + /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. + /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + /// + /// When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + #[serde(skip_serializing_if = "Option::is_none")] + pub setup_future_usage: + Option, +} +impl CreateCheckoutSessionPaymentMethodOptionsBancontact { + pub fn new() -> Self { + Self::default() + } +} +/// Indicates that you intend to make future payments with this PaymentIntent's payment method. +/// +/// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. +/// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. +/// +/// When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreateCheckoutSessionPaymentMethodOptionsBancontactSetupFutureUsage { + None, +} +impl CreateCheckoutSessionPaymentMethodOptionsBancontactSetupFutureUsage { + pub fn as_str(self) -> &'static str { + use CreateCheckoutSessionPaymentMethodOptionsBancontactSetupFutureUsage::*; + match self { + None => "none", + } + } +} + +impl std::str::FromStr for CreateCheckoutSessionPaymentMethodOptionsBancontactSetupFutureUsage { + type Err = (); + fn from_str(s: &str) -> Result { + use CreateCheckoutSessionPaymentMethodOptionsBancontactSetupFutureUsage::*; + match s { + "none" => Ok(None), + _ => Err(()), + } + } +} +impl std::fmt::Display for CreateCheckoutSessionPaymentMethodOptionsBancontactSetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreateCheckoutSessionPaymentMethodOptionsBancontactSetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreateCheckoutSessionPaymentMethodOptionsBancontactSetupFutureUsage { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// contains details about the Boleto payment method options. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreateCheckoutSessionPaymentMethodOptionsBoleto { + /// The number of calendar days before a Boleto voucher expires. + /// For example, if you create a Boleto voucher on Monday and you set expires_after_days to 2, the Boleto invoice will expire on Wednesday at 23:59 America/Sao_Paulo time. + #[serde(skip_serializing_if = "Option::is_none")] + pub expires_after_days: Option, + /// Indicates that you intend to make future payments with this PaymentIntent's payment method. + /// + /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. + /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + /// + /// When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + #[serde(skip_serializing_if = "Option::is_none")] + pub setup_future_usage: Option, +} +impl CreateCheckoutSessionPaymentMethodOptionsBoleto { + pub fn new() -> Self { + Self::default() + } +} +/// Indicates that you intend to make future payments with this PaymentIntent's payment method. +/// +/// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. +/// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. +/// +/// When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreateCheckoutSessionPaymentMethodOptionsBoletoSetupFutureUsage { + None, + OffSession, + OnSession, +} +impl CreateCheckoutSessionPaymentMethodOptionsBoletoSetupFutureUsage { + pub fn as_str(self) -> &'static str { + use CreateCheckoutSessionPaymentMethodOptionsBoletoSetupFutureUsage::*; + match self { + None => "none", + OffSession => "off_session", + OnSession => "on_session", + } + } +} + +impl std::str::FromStr for CreateCheckoutSessionPaymentMethodOptionsBoletoSetupFutureUsage { + type Err = (); + fn from_str(s: &str) -> Result { + use CreateCheckoutSessionPaymentMethodOptionsBoletoSetupFutureUsage::*; + match s { + "none" => Ok(None), + "off_session" => Ok(OffSession), + "on_session" => Ok(OnSession), + _ => Err(()), + } + } +} +impl std::fmt::Display for CreateCheckoutSessionPaymentMethodOptionsBoletoSetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreateCheckoutSessionPaymentMethodOptionsBoletoSetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreateCheckoutSessionPaymentMethodOptionsBoletoSetupFutureUsage { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// contains details about the Card payment method options. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreateCheckoutSessionPaymentMethodOptionsCard<'a> { + /// Installment options for card payments + #[serde(skip_serializing_if = "Option::is_none")] + pub installments: Option, + /// Indicates that you intend to make future payments with this PaymentIntent's payment method. + /// + /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. + /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + /// + /// When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + #[serde(skip_serializing_if = "Option::is_none")] + pub setup_future_usage: Option, + /// Provides information about a card payment that customers see on their statements. + /// Concatenated with the Kana prefix (shortened Kana descriptor) or Kana statement descriptor that’s set on the account to form the complete statement descriptor. + /// Maximum 22 characters. + /// On card statements, the *concatenation* of both prefix and suffix (including separators) will appear truncated to 22 characters. + #[serde(skip_serializing_if = "Option::is_none")] + pub statement_descriptor_suffix_kana: Option<&'a str>, + /// Provides information about a card payment that customers see on their statements. + /// Concatenated with the Kanji prefix (shortened Kanji descriptor) or Kanji statement descriptor that’s set on the account to form the complete statement descriptor. + /// Maximum 17 characters. + /// On card statements, the *concatenation* of both prefix and suffix (including separators) will appear truncated to 17 characters. + #[serde(skip_serializing_if = "Option::is_none")] + pub statement_descriptor_suffix_kanji: Option<&'a str>, +} +impl<'a> CreateCheckoutSessionPaymentMethodOptionsCard<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// Installment options for card payments +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreateCheckoutSessionPaymentMethodOptionsCardInstallments { + /// Setting to true enables installments for this Checkout Session. + /// Setting to false will prevent any installment plan from applying to a payment. + #[serde(skip_serializing_if = "Option::is_none")] + pub enabled: Option, +} +impl CreateCheckoutSessionPaymentMethodOptionsCardInstallments { + pub fn new() -> Self { + Self::default() + } +} +/// Indicates that you intend to make future payments with this PaymentIntent's payment method. +/// +/// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. +/// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. +/// +/// When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreateCheckoutSessionPaymentMethodOptionsCardSetupFutureUsage { + OffSession, + OnSession, +} +impl CreateCheckoutSessionPaymentMethodOptionsCardSetupFutureUsage { + pub fn as_str(self) -> &'static str { + use CreateCheckoutSessionPaymentMethodOptionsCardSetupFutureUsage::*; + match self { + OffSession => "off_session", + OnSession => "on_session", + } + } +} + +impl std::str::FromStr for CreateCheckoutSessionPaymentMethodOptionsCardSetupFutureUsage { + type Err = (); + fn from_str(s: &str) -> Result { + use CreateCheckoutSessionPaymentMethodOptionsCardSetupFutureUsage::*; + match s { + "off_session" => Ok(OffSession), + "on_session" => Ok(OnSession), + _ => Err(()), + } + } +} +impl std::fmt::Display for CreateCheckoutSessionPaymentMethodOptionsCardSetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreateCheckoutSessionPaymentMethodOptionsCardSetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreateCheckoutSessionPaymentMethodOptionsCardSetupFutureUsage { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// contains details about the Cashapp Pay payment method options. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreateCheckoutSessionPaymentMethodOptionsCashapp { + /// Indicates that you intend to make future payments with this PaymentIntent's payment method. + /// + /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. + /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + /// + /// When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + #[serde(skip_serializing_if = "Option::is_none")] + pub setup_future_usage: + Option, +} +impl CreateCheckoutSessionPaymentMethodOptionsCashapp { + pub fn new() -> Self { + Self::default() + } +} +/// Indicates that you intend to make future payments with this PaymentIntent's payment method. +/// +/// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. +/// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. +/// +/// When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreateCheckoutSessionPaymentMethodOptionsCashappSetupFutureUsage { + None, + OffSession, + OnSession, +} +impl CreateCheckoutSessionPaymentMethodOptionsCashappSetupFutureUsage { + pub fn as_str(self) -> &'static str { + use CreateCheckoutSessionPaymentMethodOptionsCashappSetupFutureUsage::*; + match self { + None => "none", + OffSession => "off_session", + OnSession => "on_session", + } + } +} + +impl std::str::FromStr for CreateCheckoutSessionPaymentMethodOptionsCashappSetupFutureUsage { + type Err = (); + fn from_str(s: &str) -> Result { + use CreateCheckoutSessionPaymentMethodOptionsCashappSetupFutureUsage::*; + match s { + "none" => Ok(None), + "off_session" => Ok(OffSession), + "on_session" => Ok(OnSession), + _ => Err(()), + } + } +} +impl std::fmt::Display for CreateCheckoutSessionPaymentMethodOptionsCashappSetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreateCheckoutSessionPaymentMethodOptionsCashappSetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreateCheckoutSessionPaymentMethodOptionsCashappSetupFutureUsage { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// contains details about the Customer Balance payment method options. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreateCheckoutSessionPaymentMethodOptionsCustomerBalance<'a> { + /// Configuration for the bank transfer funding type, if the `funding_type` is set to `bank_transfer`. + #[serde(skip_serializing_if = "Option::is_none")] + pub bank_transfer: + Option>, + /// The funding method type to be used when there are not enough funds in the customer balance. + /// Permitted values include: `bank_transfer`. + #[serde(skip_serializing_if = "Option::is_none")] + pub funding_type: Option, + /// Indicates that you intend to make future payments with this PaymentIntent's payment method. + /// + /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. + /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + /// + /// When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + #[serde(skip_serializing_if = "Option::is_none")] + pub setup_future_usage: + Option, +} +impl<'a> CreateCheckoutSessionPaymentMethodOptionsCustomerBalance<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// Configuration for the bank transfer funding type, if the `funding_type` is set to `bank_transfer`. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreateCheckoutSessionPaymentMethodOptionsCustomerBalanceBankTransfer<'a> { + /// Configuration for eu_bank_transfer funding type. +#[serde(skip_serializing_if = "Option::is_none")] +pub eu_bank_transfer: Option>, + /// List of address types that should be returned in the financial_addresses response. + /// If not specified, all valid types will be returned. + /// + /// Permitted values include: `sort_code`, `zengin`, `iban`, or `spei`. +#[serde(skip_serializing_if = "Option::is_none")] +pub requested_address_types: Option<&'a [CreateCheckoutSessionPaymentMethodOptionsCustomerBalanceBankTransferRequestedAddressTypes]>, + /// The list of bank transfer types that this PaymentIntent is allowed to use for funding. +#[serde(rename = "type")] +pub type_: CreateCheckoutSessionPaymentMethodOptionsCustomerBalanceBankTransferType, + +} +impl<'a> CreateCheckoutSessionPaymentMethodOptionsCustomerBalanceBankTransfer<'a> { + pub fn new( + type_: CreateCheckoutSessionPaymentMethodOptionsCustomerBalanceBankTransferType, + ) -> Self { + Self { eu_bank_transfer: None, requested_address_types: None, type_ } + } +} +/// Configuration for eu_bank_transfer funding type. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreateCheckoutSessionPaymentMethodOptionsCustomerBalanceBankTransferEuBankTransfer<'a> { + /// The desired country code of the bank account information. + /// Permitted values include: `BE`, `DE`, `ES`, `FR`, `IE`, or `NL`. + pub country: &'a str, +} +impl<'a> CreateCheckoutSessionPaymentMethodOptionsCustomerBalanceBankTransferEuBankTransfer<'a> { + pub fn new(country: &'a str) -> Self { + Self { country } + } +} +/// List of address types that should be returned in the financial_addresses response. +/// If not specified, all valid types will be returned. +/// +/// Permitted values include: `sort_code`, `zengin`, `iban`, or `spei`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreateCheckoutSessionPaymentMethodOptionsCustomerBalanceBankTransferRequestedAddressTypes { + Aba, + Iban, + Sepa, + SortCode, + Spei, + Swift, + Zengin, +} +impl CreateCheckoutSessionPaymentMethodOptionsCustomerBalanceBankTransferRequestedAddressTypes { + pub fn as_str(self) -> &'static str { + use CreateCheckoutSessionPaymentMethodOptionsCustomerBalanceBankTransferRequestedAddressTypes::*; + match self { + Aba => "aba", + Iban => "iban", + Sepa => "sepa", + SortCode => "sort_code", + Spei => "spei", + Swift => "swift", + Zengin => "zengin", + } + } +} + +impl std::str::FromStr + for CreateCheckoutSessionPaymentMethodOptionsCustomerBalanceBankTransferRequestedAddressTypes +{ + type Err = (); + fn from_str(s: &str) -> Result { + use CreateCheckoutSessionPaymentMethodOptionsCustomerBalanceBankTransferRequestedAddressTypes::*; + match s { + "aba" => Ok(Aba), + "iban" => Ok(Iban), + "sepa" => Ok(Sepa), + "sort_code" => Ok(SortCode), + "spei" => Ok(Spei), + "swift" => Ok(Swift), + "zengin" => Ok(Zengin), + _ => Err(()), + } + } +} +impl std::fmt::Display + for CreateCheckoutSessionPaymentMethodOptionsCustomerBalanceBankTransferRequestedAddressTypes +{ + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug + for CreateCheckoutSessionPaymentMethodOptionsCustomerBalanceBankTransferRequestedAddressTypes +{ + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize + for CreateCheckoutSessionPaymentMethodOptionsCustomerBalanceBankTransferRequestedAddressTypes +{ + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// The list of bank transfer types that this PaymentIntent is allowed to use for funding. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreateCheckoutSessionPaymentMethodOptionsCustomerBalanceBankTransferType { + EuBankTransfer, + GbBankTransfer, + JpBankTransfer, + MxBankTransfer, + UsBankTransfer, +} +impl CreateCheckoutSessionPaymentMethodOptionsCustomerBalanceBankTransferType { + pub fn as_str(self) -> &'static str { + use CreateCheckoutSessionPaymentMethodOptionsCustomerBalanceBankTransferType::*; + match self { + EuBankTransfer => "eu_bank_transfer", + GbBankTransfer => "gb_bank_transfer", + JpBankTransfer => "jp_bank_transfer", + MxBankTransfer => "mx_bank_transfer", + UsBankTransfer => "us_bank_transfer", + } + } +} + +impl std::str::FromStr + for CreateCheckoutSessionPaymentMethodOptionsCustomerBalanceBankTransferType +{ + type Err = (); + fn from_str(s: &str) -> Result { + use CreateCheckoutSessionPaymentMethodOptionsCustomerBalanceBankTransferType::*; + match s { + "eu_bank_transfer" => Ok(EuBankTransfer), + "gb_bank_transfer" => Ok(GbBankTransfer), + "jp_bank_transfer" => Ok(JpBankTransfer), + "mx_bank_transfer" => Ok(MxBankTransfer), + "us_bank_transfer" => Ok(UsBankTransfer), + _ => Err(()), + } + } +} +impl std::fmt::Display + for CreateCheckoutSessionPaymentMethodOptionsCustomerBalanceBankTransferType +{ + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreateCheckoutSessionPaymentMethodOptionsCustomerBalanceBankTransferType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreateCheckoutSessionPaymentMethodOptionsCustomerBalanceBankTransferType { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// The funding method type to be used when there are not enough funds in the customer balance. +/// Permitted values include: `bank_transfer`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreateCheckoutSessionPaymentMethodOptionsCustomerBalanceFundingType { + BankTransfer, +} +impl CreateCheckoutSessionPaymentMethodOptionsCustomerBalanceFundingType { + pub fn as_str(self) -> &'static str { + use CreateCheckoutSessionPaymentMethodOptionsCustomerBalanceFundingType::*; + match self { + BankTransfer => "bank_transfer", + } + } +} + +impl std::str::FromStr for CreateCheckoutSessionPaymentMethodOptionsCustomerBalanceFundingType { + type Err = (); + fn from_str(s: &str) -> Result { + use CreateCheckoutSessionPaymentMethodOptionsCustomerBalanceFundingType::*; + match s { + "bank_transfer" => Ok(BankTransfer), + _ => Err(()), + } + } +} +impl std::fmt::Display for CreateCheckoutSessionPaymentMethodOptionsCustomerBalanceFundingType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreateCheckoutSessionPaymentMethodOptionsCustomerBalanceFundingType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreateCheckoutSessionPaymentMethodOptionsCustomerBalanceFundingType { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Indicates that you intend to make future payments with this PaymentIntent's payment method. +/// +/// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. +/// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. +/// +/// When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreateCheckoutSessionPaymentMethodOptionsCustomerBalanceSetupFutureUsage { + None, +} +impl CreateCheckoutSessionPaymentMethodOptionsCustomerBalanceSetupFutureUsage { + pub fn as_str(self) -> &'static str { + use CreateCheckoutSessionPaymentMethodOptionsCustomerBalanceSetupFutureUsage::*; + match self { + None => "none", + } + } +} + +impl std::str::FromStr + for CreateCheckoutSessionPaymentMethodOptionsCustomerBalanceSetupFutureUsage +{ + type Err = (); + fn from_str(s: &str) -> Result { + use CreateCheckoutSessionPaymentMethodOptionsCustomerBalanceSetupFutureUsage::*; + match s { + "none" => Ok(None), + _ => Err(()), + } + } +} +impl std::fmt::Display + for CreateCheckoutSessionPaymentMethodOptionsCustomerBalanceSetupFutureUsage +{ + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreateCheckoutSessionPaymentMethodOptionsCustomerBalanceSetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreateCheckoutSessionPaymentMethodOptionsCustomerBalanceSetupFutureUsage { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// contains details about the EPS payment method options. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreateCheckoutSessionPaymentMethodOptionsEps { + /// Indicates that you intend to make future payments with this PaymentIntent's payment method. + /// + /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. + /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + /// + /// When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + #[serde(skip_serializing_if = "Option::is_none")] + pub setup_future_usage: Option, +} +impl CreateCheckoutSessionPaymentMethodOptionsEps { + pub fn new() -> Self { + Self::default() + } +} +/// Indicates that you intend to make future payments with this PaymentIntent's payment method. +/// +/// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. +/// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. +/// +/// When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreateCheckoutSessionPaymentMethodOptionsEpsSetupFutureUsage { + None, +} +impl CreateCheckoutSessionPaymentMethodOptionsEpsSetupFutureUsage { + pub fn as_str(self) -> &'static str { + use CreateCheckoutSessionPaymentMethodOptionsEpsSetupFutureUsage::*; + match self { + None => "none", + } + } +} + +impl std::str::FromStr for CreateCheckoutSessionPaymentMethodOptionsEpsSetupFutureUsage { + type Err = (); + fn from_str(s: &str) -> Result { + use CreateCheckoutSessionPaymentMethodOptionsEpsSetupFutureUsage::*; + match s { + "none" => Ok(None), + _ => Err(()), + } + } +} +impl std::fmt::Display for CreateCheckoutSessionPaymentMethodOptionsEpsSetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreateCheckoutSessionPaymentMethodOptionsEpsSetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreateCheckoutSessionPaymentMethodOptionsEpsSetupFutureUsage { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// contains details about the FPX payment method options. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreateCheckoutSessionPaymentMethodOptionsFpx { + /// Indicates that you intend to make future payments with this PaymentIntent's payment method. + /// + /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. + /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + /// + /// When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + #[serde(skip_serializing_if = "Option::is_none")] + pub setup_future_usage: Option, +} +impl CreateCheckoutSessionPaymentMethodOptionsFpx { + pub fn new() -> Self { + Self::default() + } +} +/// Indicates that you intend to make future payments with this PaymentIntent's payment method. +/// +/// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. +/// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. +/// +/// When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreateCheckoutSessionPaymentMethodOptionsFpxSetupFutureUsage { + None, +} +impl CreateCheckoutSessionPaymentMethodOptionsFpxSetupFutureUsage { + pub fn as_str(self) -> &'static str { + use CreateCheckoutSessionPaymentMethodOptionsFpxSetupFutureUsage::*; + match self { + None => "none", + } + } +} + +impl std::str::FromStr for CreateCheckoutSessionPaymentMethodOptionsFpxSetupFutureUsage { + type Err = (); + fn from_str(s: &str) -> Result { + use CreateCheckoutSessionPaymentMethodOptionsFpxSetupFutureUsage::*; + match s { + "none" => Ok(None), + _ => Err(()), + } + } +} +impl std::fmt::Display for CreateCheckoutSessionPaymentMethodOptionsFpxSetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreateCheckoutSessionPaymentMethodOptionsFpxSetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreateCheckoutSessionPaymentMethodOptionsFpxSetupFutureUsage { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// contains details about the Giropay payment method options. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreateCheckoutSessionPaymentMethodOptionsGiropay { + /// Indicates that you intend to make future payments with this PaymentIntent's payment method. + /// + /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. + /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + /// + /// When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + #[serde(skip_serializing_if = "Option::is_none")] + pub setup_future_usage: + Option, +} +impl CreateCheckoutSessionPaymentMethodOptionsGiropay { + pub fn new() -> Self { + Self::default() + } +} +/// Indicates that you intend to make future payments with this PaymentIntent's payment method. +/// +/// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. +/// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. +/// +/// When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreateCheckoutSessionPaymentMethodOptionsGiropaySetupFutureUsage { + None, +} +impl CreateCheckoutSessionPaymentMethodOptionsGiropaySetupFutureUsage { + pub fn as_str(self) -> &'static str { + use CreateCheckoutSessionPaymentMethodOptionsGiropaySetupFutureUsage::*; + match self { + None => "none", + } + } +} + +impl std::str::FromStr for CreateCheckoutSessionPaymentMethodOptionsGiropaySetupFutureUsage { + type Err = (); + fn from_str(s: &str) -> Result { + use CreateCheckoutSessionPaymentMethodOptionsGiropaySetupFutureUsage::*; + match s { + "none" => Ok(None), + _ => Err(()), + } + } +} +impl std::fmt::Display for CreateCheckoutSessionPaymentMethodOptionsGiropaySetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreateCheckoutSessionPaymentMethodOptionsGiropaySetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreateCheckoutSessionPaymentMethodOptionsGiropaySetupFutureUsage { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// contains details about the Grabpay payment method options. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreateCheckoutSessionPaymentMethodOptionsGrabpay { + /// Indicates that you intend to make future payments with this PaymentIntent's payment method. + /// + /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. + /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + /// + /// When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + #[serde(skip_serializing_if = "Option::is_none")] + pub setup_future_usage: + Option, +} +impl CreateCheckoutSessionPaymentMethodOptionsGrabpay { + pub fn new() -> Self { + Self::default() + } +} +/// Indicates that you intend to make future payments with this PaymentIntent's payment method. +/// +/// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. +/// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. +/// +/// When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreateCheckoutSessionPaymentMethodOptionsGrabpaySetupFutureUsage { + None, +} +impl CreateCheckoutSessionPaymentMethodOptionsGrabpaySetupFutureUsage { + pub fn as_str(self) -> &'static str { + use CreateCheckoutSessionPaymentMethodOptionsGrabpaySetupFutureUsage::*; + match self { + None => "none", + } + } +} + +impl std::str::FromStr for CreateCheckoutSessionPaymentMethodOptionsGrabpaySetupFutureUsage { + type Err = (); + fn from_str(s: &str) -> Result { + use CreateCheckoutSessionPaymentMethodOptionsGrabpaySetupFutureUsage::*; + match s { + "none" => Ok(None), + _ => Err(()), + } + } +} +impl std::fmt::Display for CreateCheckoutSessionPaymentMethodOptionsGrabpaySetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreateCheckoutSessionPaymentMethodOptionsGrabpaySetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreateCheckoutSessionPaymentMethodOptionsGrabpaySetupFutureUsage { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// contains details about the Ideal payment method options. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreateCheckoutSessionPaymentMethodOptionsIdeal { + /// Indicates that you intend to make future payments with this PaymentIntent's payment method. + /// + /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. + /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + /// + /// When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + #[serde(skip_serializing_if = "Option::is_none")] + pub setup_future_usage: Option, +} +impl CreateCheckoutSessionPaymentMethodOptionsIdeal { + pub fn new() -> Self { + Self::default() + } +} +/// Indicates that you intend to make future payments with this PaymentIntent's payment method. +/// +/// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. +/// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. +/// +/// When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreateCheckoutSessionPaymentMethodOptionsIdealSetupFutureUsage { + None, +} +impl CreateCheckoutSessionPaymentMethodOptionsIdealSetupFutureUsage { + pub fn as_str(self) -> &'static str { + use CreateCheckoutSessionPaymentMethodOptionsIdealSetupFutureUsage::*; + match self { + None => "none", + } + } +} + +impl std::str::FromStr for CreateCheckoutSessionPaymentMethodOptionsIdealSetupFutureUsage { + type Err = (); + fn from_str(s: &str) -> Result { + use CreateCheckoutSessionPaymentMethodOptionsIdealSetupFutureUsage::*; + match s { + "none" => Ok(None), + _ => Err(()), + } + } +} +impl std::fmt::Display for CreateCheckoutSessionPaymentMethodOptionsIdealSetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreateCheckoutSessionPaymentMethodOptionsIdealSetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreateCheckoutSessionPaymentMethodOptionsIdealSetupFutureUsage { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// contains details about the Klarna payment method options. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreateCheckoutSessionPaymentMethodOptionsKlarna { + /// Indicates that you intend to make future payments with this PaymentIntent's payment method. + /// + /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. + /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + /// + /// When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + #[serde(skip_serializing_if = "Option::is_none")] + pub setup_future_usage: Option, +} +impl CreateCheckoutSessionPaymentMethodOptionsKlarna { + pub fn new() -> Self { + Self::default() + } +} +/// Indicates that you intend to make future payments with this PaymentIntent's payment method. +/// +/// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. +/// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. +/// +/// When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreateCheckoutSessionPaymentMethodOptionsKlarnaSetupFutureUsage { + None, +} +impl CreateCheckoutSessionPaymentMethodOptionsKlarnaSetupFutureUsage { + pub fn as_str(self) -> &'static str { + use CreateCheckoutSessionPaymentMethodOptionsKlarnaSetupFutureUsage::*; + match self { + None => "none", + } + } +} + +impl std::str::FromStr for CreateCheckoutSessionPaymentMethodOptionsKlarnaSetupFutureUsage { + type Err = (); + fn from_str(s: &str) -> Result { + use CreateCheckoutSessionPaymentMethodOptionsKlarnaSetupFutureUsage::*; + match s { + "none" => Ok(None), + _ => Err(()), + } + } +} +impl std::fmt::Display for CreateCheckoutSessionPaymentMethodOptionsKlarnaSetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreateCheckoutSessionPaymentMethodOptionsKlarnaSetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreateCheckoutSessionPaymentMethodOptionsKlarnaSetupFutureUsage { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// contains details about the Konbini payment method options. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreateCheckoutSessionPaymentMethodOptionsKonbini { + /// The number of calendar days (between 1 and 60) after which Konbini payment instructions will expire. + /// For example, if a PaymentIntent is confirmed with Konbini and `expires_after_days` set to 2 on Monday JST, the instructions will expire on Wednesday 23:59:59 JST. + /// Defaults to 3 days. + #[serde(skip_serializing_if = "Option::is_none")] + pub expires_after_days: Option, + /// Indicates that you intend to make future payments with this PaymentIntent's payment method. + /// + /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. + /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + /// + /// When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + #[serde(skip_serializing_if = "Option::is_none")] + pub setup_future_usage: + Option, +} +impl CreateCheckoutSessionPaymentMethodOptionsKonbini { + pub fn new() -> Self { + Self::default() + } +} +/// Indicates that you intend to make future payments with this PaymentIntent's payment method. +/// +/// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. +/// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. +/// +/// When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreateCheckoutSessionPaymentMethodOptionsKonbiniSetupFutureUsage { + None, +} +impl CreateCheckoutSessionPaymentMethodOptionsKonbiniSetupFutureUsage { + pub fn as_str(self) -> &'static str { + use CreateCheckoutSessionPaymentMethodOptionsKonbiniSetupFutureUsage::*; + match self { + None => "none", + } + } +} + +impl std::str::FromStr for CreateCheckoutSessionPaymentMethodOptionsKonbiniSetupFutureUsage { + type Err = (); + fn from_str(s: &str) -> Result { + use CreateCheckoutSessionPaymentMethodOptionsKonbiniSetupFutureUsage::*; + match s { + "none" => Ok(None), + _ => Err(()), + } + } +} +impl std::fmt::Display for CreateCheckoutSessionPaymentMethodOptionsKonbiniSetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreateCheckoutSessionPaymentMethodOptionsKonbiniSetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreateCheckoutSessionPaymentMethodOptionsKonbiniSetupFutureUsage { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// contains details about the Link payment method options. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreateCheckoutSessionPaymentMethodOptionsLink { + /// Indicates that you intend to make future payments with this PaymentIntent's payment method. + /// + /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. + /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + /// + /// When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + #[serde(skip_serializing_if = "Option::is_none")] + pub setup_future_usage: Option, +} +impl CreateCheckoutSessionPaymentMethodOptionsLink { + pub fn new() -> Self { + Self::default() + } +} +/// Indicates that you intend to make future payments with this PaymentIntent's payment method. +/// +/// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. +/// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. +/// +/// When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreateCheckoutSessionPaymentMethodOptionsLinkSetupFutureUsage { + None, + OffSession, +} +impl CreateCheckoutSessionPaymentMethodOptionsLinkSetupFutureUsage { + pub fn as_str(self) -> &'static str { + use CreateCheckoutSessionPaymentMethodOptionsLinkSetupFutureUsage::*; + match self { + None => "none", + OffSession => "off_session", + } + } +} + +impl std::str::FromStr for CreateCheckoutSessionPaymentMethodOptionsLinkSetupFutureUsage { + type Err = (); + fn from_str(s: &str) -> Result { + use CreateCheckoutSessionPaymentMethodOptionsLinkSetupFutureUsage::*; + match s { + "none" => Ok(None), + "off_session" => Ok(OffSession), + _ => Err(()), + } + } +} +impl std::fmt::Display for CreateCheckoutSessionPaymentMethodOptionsLinkSetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreateCheckoutSessionPaymentMethodOptionsLinkSetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreateCheckoutSessionPaymentMethodOptionsLinkSetupFutureUsage { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// contains details about the OXXO payment method options. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreateCheckoutSessionPaymentMethodOptionsOxxo { + /// The number of calendar days before an OXXO voucher expires. + /// For example, if you create an OXXO voucher on Monday and you set expires_after_days to 2, the OXXO invoice will expire on Wednesday at 23:59 America/Mexico_City time. + #[serde(skip_serializing_if = "Option::is_none")] + pub expires_after_days: Option, + /// Indicates that you intend to make future payments with this PaymentIntent's payment method. + /// + /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. + /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + /// + /// When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + #[serde(skip_serializing_if = "Option::is_none")] + pub setup_future_usage: Option, +} +impl CreateCheckoutSessionPaymentMethodOptionsOxxo { + pub fn new() -> Self { + Self::default() + } +} +/// Indicates that you intend to make future payments with this PaymentIntent's payment method. +/// +/// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. +/// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. +/// +/// When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreateCheckoutSessionPaymentMethodOptionsOxxoSetupFutureUsage { + None, +} +impl CreateCheckoutSessionPaymentMethodOptionsOxxoSetupFutureUsage { + pub fn as_str(self) -> &'static str { + use CreateCheckoutSessionPaymentMethodOptionsOxxoSetupFutureUsage::*; + match self { + None => "none", + } + } +} + +impl std::str::FromStr for CreateCheckoutSessionPaymentMethodOptionsOxxoSetupFutureUsage { + type Err = (); + fn from_str(s: &str) -> Result { + use CreateCheckoutSessionPaymentMethodOptionsOxxoSetupFutureUsage::*; + match s { + "none" => Ok(None), + _ => Err(()), + } + } +} +impl std::fmt::Display for CreateCheckoutSessionPaymentMethodOptionsOxxoSetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreateCheckoutSessionPaymentMethodOptionsOxxoSetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreateCheckoutSessionPaymentMethodOptionsOxxoSetupFutureUsage { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// contains details about the P24 payment method options. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreateCheckoutSessionPaymentMethodOptionsP24 { + /// Indicates that you intend to make future payments with this PaymentIntent's payment method. + /// + /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. + /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + /// + /// When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + #[serde(skip_serializing_if = "Option::is_none")] + pub setup_future_usage: Option, + /// Confirm that the payer has accepted the P24 terms and conditions. + #[serde(skip_serializing_if = "Option::is_none")] + pub tos_shown_and_accepted: Option, +} +impl CreateCheckoutSessionPaymentMethodOptionsP24 { + pub fn new() -> Self { + Self::default() + } +} +/// Indicates that you intend to make future payments with this PaymentIntent's payment method. +/// +/// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. +/// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. +/// +/// When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreateCheckoutSessionPaymentMethodOptionsP24SetupFutureUsage { + None, +} +impl CreateCheckoutSessionPaymentMethodOptionsP24SetupFutureUsage { + pub fn as_str(self) -> &'static str { + use CreateCheckoutSessionPaymentMethodOptionsP24SetupFutureUsage::*; + match self { + None => "none", + } + } +} + +impl std::str::FromStr for CreateCheckoutSessionPaymentMethodOptionsP24SetupFutureUsage { + type Err = (); + fn from_str(s: &str) -> Result { + use CreateCheckoutSessionPaymentMethodOptionsP24SetupFutureUsage::*; + match s { + "none" => Ok(None), + _ => Err(()), + } + } +} +impl std::fmt::Display for CreateCheckoutSessionPaymentMethodOptionsP24SetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreateCheckoutSessionPaymentMethodOptionsP24SetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreateCheckoutSessionPaymentMethodOptionsP24SetupFutureUsage { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// contains details about the PayNow payment method options. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreateCheckoutSessionPaymentMethodOptionsPaynow { + /// Indicates that you intend to make future payments with this PaymentIntent's payment method. + /// + /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. + /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + /// + /// When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + #[serde(skip_serializing_if = "Option::is_none")] + pub setup_future_usage: Option, +} +impl CreateCheckoutSessionPaymentMethodOptionsPaynow { + pub fn new() -> Self { + Self::default() + } +} +/// Indicates that you intend to make future payments with this PaymentIntent's payment method. +/// +/// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. +/// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. +/// +/// When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreateCheckoutSessionPaymentMethodOptionsPaynowSetupFutureUsage { + None, +} +impl CreateCheckoutSessionPaymentMethodOptionsPaynowSetupFutureUsage { + pub fn as_str(self) -> &'static str { + use CreateCheckoutSessionPaymentMethodOptionsPaynowSetupFutureUsage::*; + match self { + None => "none", + } + } +} + +impl std::str::FromStr for CreateCheckoutSessionPaymentMethodOptionsPaynowSetupFutureUsage { + type Err = (); + fn from_str(s: &str) -> Result { + use CreateCheckoutSessionPaymentMethodOptionsPaynowSetupFutureUsage::*; + match s { + "none" => Ok(None), + _ => Err(()), + } + } +} +impl std::fmt::Display for CreateCheckoutSessionPaymentMethodOptionsPaynowSetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreateCheckoutSessionPaymentMethodOptionsPaynowSetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreateCheckoutSessionPaymentMethodOptionsPaynowSetupFutureUsage { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// contains details about the PayPal payment method options. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreateCheckoutSessionPaymentMethodOptionsPaypal<'a> { + /// Controls when the funds will be captured from the customer's account. + #[serde(skip_serializing_if = "Option::is_none")] + pub capture_method: Option, + /// [Preferred locale](https://stripe.com/docs/payments/paypal/supported-locales) of the PayPal checkout page that the customer is redirected to. + #[serde(skip_serializing_if = "Option::is_none")] + pub preferred_locale: Option, + /// A reference of the PayPal transaction visible to customer which is mapped to PayPal's invoice ID. + /// This must be a globally unique ID if you have configured in your PayPal settings to block multiple payments per invoice ID. + #[serde(skip_serializing_if = "Option::is_none")] + pub reference: Option<&'a str>, + /// The risk correlation ID for an on-session payment using a saved PayPal payment method. + #[serde(skip_serializing_if = "Option::is_none")] + pub risk_correlation_id: Option<&'a str>, + /// Indicates that you intend to make future payments with this PaymentIntent's payment method. + /// + /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. + /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + /// + /// When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + /// + /// If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. + #[serde(skip_serializing_if = "Option::is_none")] + pub setup_future_usage: Option, +} +impl<'a> CreateCheckoutSessionPaymentMethodOptionsPaypal<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// Controls when the funds will be captured from the customer's account. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreateCheckoutSessionPaymentMethodOptionsPaypalCaptureMethod { + Manual, +} +impl CreateCheckoutSessionPaymentMethodOptionsPaypalCaptureMethod { + pub fn as_str(self) -> &'static str { + use CreateCheckoutSessionPaymentMethodOptionsPaypalCaptureMethod::*; + match self { + Manual => "manual", + } + } +} + +impl std::str::FromStr for CreateCheckoutSessionPaymentMethodOptionsPaypalCaptureMethod { + type Err = (); + fn from_str(s: &str) -> Result { + use CreateCheckoutSessionPaymentMethodOptionsPaypalCaptureMethod::*; + match s { + "manual" => Ok(Manual), + _ => Err(()), + } + } +} +impl std::fmt::Display for CreateCheckoutSessionPaymentMethodOptionsPaypalCaptureMethod { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreateCheckoutSessionPaymentMethodOptionsPaypalCaptureMethod { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreateCheckoutSessionPaymentMethodOptionsPaypalCaptureMethod { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// [Preferred locale](https://stripe.com/docs/payments/paypal/supported-locales) of the PayPal checkout page that the customer is redirected to. +#[derive(Copy, Clone, Eq, PartialEq)] +#[non_exhaustive] +pub enum CreateCheckoutSessionPaymentMethodOptionsPaypalPreferredLocale { + CsMinusCz, + DaMinusDk, + DeMinusAt, + DeMinusDe, + DeMinusLu, + ElMinusGr, + EnMinusGb, + EnMinusUs, + EsMinusEs, + FiMinusFi, + FrMinusBe, + FrMinusFr, + FrMinusLu, + HuMinusHu, + ItMinusIt, + NlMinusBe, + NlMinusNl, + PlMinusPl, + PtMinusPt, + SkMinusSk, + SvMinusSe, + /// An unrecognized value from Stripe. Should not be used as a request parameter. + Unknown, +} +impl CreateCheckoutSessionPaymentMethodOptionsPaypalPreferredLocale { + pub fn as_str(self) -> &'static str { + use CreateCheckoutSessionPaymentMethodOptionsPaypalPreferredLocale::*; + match self { + CsMinusCz => "cs-CZ", + DaMinusDk => "da-DK", + DeMinusAt => "de-AT", + DeMinusDe => "de-DE", + DeMinusLu => "de-LU", + ElMinusGr => "el-GR", + EnMinusGb => "en-GB", + EnMinusUs => "en-US", + EsMinusEs => "es-ES", + FiMinusFi => "fi-FI", + FrMinusBe => "fr-BE", + FrMinusFr => "fr-FR", + FrMinusLu => "fr-LU", + HuMinusHu => "hu-HU", + ItMinusIt => "it-IT", + NlMinusBe => "nl-BE", + NlMinusNl => "nl-NL", + PlMinusPl => "pl-PL", + PtMinusPt => "pt-PT", + SkMinusSk => "sk-SK", + SvMinusSe => "sv-SE", + Unknown => "unknown", + } + } +} + +impl std::str::FromStr for CreateCheckoutSessionPaymentMethodOptionsPaypalPreferredLocale { + type Err = (); + fn from_str(s: &str) -> Result { + use CreateCheckoutSessionPaymentMethodOptionsPaypalPreferredLocale::*; + match s { + "cs-CZ" => Ok(CsMinusCz), + "da-DK" => Ok(DaMinusDk), + "de-AT" => Ok(DeMinusAt), + "de-DE" => Ok(DeMinusDe), + "de-LU" => Ok(DeMinusLu), + "el-GR" => Ok(ElMinusGr), + "en-GB" => Ok(EnMinusGb), + "en-US" => Ok(EnMinusUs), + "es-ES" => Ok(EsMinusEs), + "fi-FI" => Ok(FiMinusFi), + "fr-BE" => Ok(FrMinusBe), + "fr-FR" => Ok(FrMinusFr), + "fr-LU" => Ok(FrMinusLu), + "hu-HU" => Ok(HuMinusHu), + "it-IT" => Ok(ItMinusIt), + "nl-BE" => Ok(NlMinusBe), + "nl-NL" => Ok(NlMinusNl), + "pl-PL" => Ok(PlMinusPl), + "pt-PT" => Ok(PtMinusPt), + "sk-SK" => Ok(SkMinusSk), + "sv-SE" => Ok(SvMinusSe), + _ => Err(()), + } + } +} +impl std::fmt::Display for CreateCheckoutSessionPaymentMethodOptionsPaypalPreferredLocale { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreateCheckoutSessionPaymentMethodOptionsPaypalPreferredLocale { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreateCheckoutSessionPaymentMethodOptionsPaypalPreferredLocale { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Indicates that you intend to make future payments with this PaymentIntent's payment method. +/// +/// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. +/// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. +/// +/// When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). +/// +/// If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreateCheckoutSessionPaymentMethodOptionsPaypalSetupFutureUsage { + None, + OffSession, +} +impl CreateCheckoutSessionPaymentMethodOptionsPaypalSetupFutureUsage { + pub fn as_str(self) -> &'static str { + use CreateCheckoutSessionPaymentMethodOptionsPaypalSetupFutureUsage::*; + match self { + None => "none", + OffSession => "off_session", + } + } +} + +impl std::str::FromStr for CreateCheckoutSessionPaymentMethodOptionsPaypalSetupFutureUsage { + type Err = (); + fn from_str(s: &str) -> Result { + use CreateCheckoutSessionPaymentMethodOptionsPaypalSetupFutureUsage::*; + match s { + "none" => Ok(None), + "off_session" => Ok(OffSession), + _ => Err(()), + } + } +} +impl std::fmt::Display for CreateCheckoutSessionPaymentMethodOptionsPaypalSetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreateCheckoutSessionPaymentMethodOptionsPaypalSetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreateCheckoutSessionPaymentMethodOptionsPaypalSetupFutureUsage { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// contains details about the Pix payment method options. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreateCheckoutSessionPaymentMethodOptionsPix { + /// The number of seconds (between 10 and 1209600) after which Pix payment will expire. + /// Defaults to 86400 seconds. + #[serde(skip_serializing_if = "Option::is_none")] + pub expires_after_seconds: Option, +} +impl CreateCheckoutSessionPaymentMethodOptionsPix { + pub fn new() -> Self { + Self::default() + } +} +/// contains details about the RevolutPay payment method options. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreateCheckoutSessionPaymentMethodOptionsRevolutPay { + /// Indicates that you intend to make future payments with this PaymentIntent's payment method. + /// + /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. + /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + /// + /// When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + #[serde(skip_serializing_if = "Option::is_none")] + pub setup_future_usage: + Option, +} +impl CreateCheckoutSessionPaymentMethodOptionsRevolutPay { + pub fn new() -> Self { + Self::default() + } +} +/// Indicates that you intend to make future payments with this PaymentIntent's payment method. +/// +/// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. +/// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. +/// +/// When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreateCheckoutSessionPaymentMethodOptionsRevolutPaySetupFutureUsage { + None, + OffSession, +} +impl CreateCheckoutSessionPaymentMethodOptionsRevolutPaySetupFutureUsage { + pub fn as_str(self) -> &'static str { + use CreateCheckoutSessionPaymentMethodOptionsRevolutPaySetupFutureUsage::*; + match self { + None => "none", + OffSession => "off_session", + } + } +} + +impl std::str::FromStr for CreateCheckoutSessionPaymentMethodOptionsRevolutPaySetupFutureUsage { + type Err = (); + fn from_str(s: &str) -> Result { + use CreateCheckoutSessionPaymentMethodOptionsRevolutPaySetupFutureUsage::*; + match s { + "none" => Ok(None), + "off_session" => Ok(OffSession), + _ => Err(()), + } + } +} +impl std::fmt::Display for CreateCheckoutSessionPaymentMethodOptionsRevolutPaySetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreateCheckoutSessionPaymentMethodOptionsRevolutPaySetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreateCheckoutSessionPaymentMethodOptionsRevolutPaySetupFutureUsage { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// contains details about the Sepa Debit payment method options. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreateCheckoutSessionPaymentMethodOptionsSepaDebit { + /// Indicates that you intend to make future payments with this PaymentIntent's payment method. + /// + /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. + /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + /// + /// When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + #[serde(skip_serializing_if = "Option::is_none")] + pub setup_future_usage: + Option, +} +impl CreateCheckoutSessionPaymentMethodOptionsSepaDebit { + pub fn new() -> Self { + Self::default() + } +} +/// Indicates that you intend to make future payments with this PaymentIntent's payment method. +/// +/// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. +/// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. +/// +/// When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreateCheckoutSessionPaymentMethodOptionsSepaDebitSetupFutureUsage { + None, + OffSession, + OnSession, +} +impl CreateCheckoutSessionPaymentMethodOptionsSepaDebitSetupFutureUsage { + pub fn as_str(self) -> &'static str { + use CreateCheckoutSessionPaymentMethodOptionsSepaDebitSetupFutureUsage::*; + match self { + None => "none", + OffSession => "off_session", + OnSession => "on_session", + } + } +} + +impl std::str::FromStr for CreateCheckoutSessionPaymentMethodOptionsSepaDebitSetupFutureUsage { + type Err = (); + fn from_str(s: &str) -> Result { + use CreateCheckoutSessionPaymentMethodOptionsSepaDebitSetupFutureUsage::*; + match s { + "none" => Ok(None), + "off_session" => Ok(OffSession), + "on_session" => Ok(OnSession), + _ => Err(()), + } + } +} +impl std::fmt::Display for CreateCheckoutSessionPaymentMethodOptionsSepaDebitSetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreateCheckoutSessionPaymentMethodOptionsSepaDebitSetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreateCheckoutSessionPaymentMethodOptionsSepaDebitSetupFutureUsage { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// contains details about the Sofort payment method options. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreateCheckoutSessionPaymentMethodOptionsSofort { + /// Indicates that you intend to make future payments with this PaymentIntent's payment method. + /// + /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. + /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + /// + /// When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + #[serde(skip_serializing_if = "Option::is_none")] + pub setup_future_usage: Option, +} +impl CreateCheckoutSessionPaymentMethodOptionsSofort { + pub fn new() -> Self { + Self::default() + } +} +/// Indicates that you intend to make future payments with this PaymentIntent's payment method. +/// +/// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. +/// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. +/// +/// When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreateCheckoutSessionPaymentMethodOptionsSofortSetupFutureUsage { + None, +} +impl CreateCheckoutSessionPaymentMethodOptionsSofortSetupFutureUsage { + pub fn as_str(self) -> &'static str { + use CreateCheckoutSessionPaymentMethodOptionsSofortSetupFutureUsage::*; + match self { + None => "none", + } + } +} + +impl std::str::FromStr for CreateCheckoutSessionPaymentMethodOptionsSofortSetupFutureUsage { + type Err = (); + fn from_str(s: &str) -> Result { + use CreateCheckoutSessionPaymentMethodOptionsSofortSetupFutureUsage::*; + match s { + "none" => Ok(None), + _ => Err(()), + } + } +} +impl std::fmt::Display for CreateCheckoutSessionPaymentMethodOptionsSofortSetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreateCheckoutSessionPaymentMethodOptionsSofortSetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreateCheckoutSessionPaymentMethodOptionsSofortSetupFutureUsage { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// contains details about the Swish payment method options. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreateCheckoutSessionPaymentMethodOptionsSwish<'a> { + /// The order reference that will be displayed to customers in the Swish application. + /// Defaults to the `id` of the Payment Intent. + #[serde(skip_serializing_if = "Option::is_none")] + pub reference: Option<&'a str>, +} +impl<'a> CreateCheckoutSessionPaymentMethodOptionsSwish<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// contains details about the Us Bank Account payment method options. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreateCheckoutSessionPaymentMethodOptionsUsBankAccount<'a> { + /// Additional fields for Financial Connections Session creation + #[serde(skip_serializing_if = "Option::is_none")] + pub financial_connections: + Option>, + /// Indicates that you intend to make future payments with this PaymentIntent's payment method. + /// + /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. + /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + /// + /// When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + #[serde(skip_serializing_if = "Option::is_none")] + pub setup_future_usage: + Option, + /// Verification method for the intent + #[serde(skip_serializing_if = "Option::is_none")] + pub verification_method: + Option, +} +impl<'a> CreateCheckoutSessionPaymentMethodOptionsUsBankAccount<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// Additional fields for Financial Connections Session creation +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreateCheckoutSessionPaymentMethodOptionsUsBankAccountFinancialConnections<'a> { + /// The list of permissions to request. + /// If this parameter is passed, the `payment_method` permission must be included. + /// Valid permissions include: `balances`, `ownership`, `payment_method`, and `transactions`. +#[serde(skip_serializing_if = "Option::is_none")] +pub permissions: Option<&'a [CreateCheckoutSessionPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions]>, + /// List of data features that you would like to retrieve upon account creation. +#[serde(skip_serializing_if = "Option::is_none")] +pub prefetch: Option<&'a [CreateCheckoutSessionPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch]>, + +} +impl<'a> CreateCheckoutSessionPaymentMethodOptionsUsBankAccountFinancialConnections<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// The list of permissions to request. +/// If this parameter is passed, the `payment_method` permission must be included. +/// Valid permissions include: `balances`, `ownership`, `payment_method`, and `transactions`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreateCheckoutSessionPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions { + Balances, + Ownership, + PaymentMethod, + Transactions, +} +impl CreateCheckoutSessionPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions { + pub fn as_str(self) -> &'static str { + use CreateCheckoutSessionPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions::*; + match self { + Balances => "balances", + Ownership => "ownership", + PaymentMethod => "payment_method", + Transactions => "transactions", + } + } +} + +impl std::str::FromStr + for CreateCheckoutSessionPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions +{ + type Err = (); + fn from_str(s: &str) -> Result { + use CreateCheckoutSessionPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions::*; + match s { + "balances" => Ok(Balances), + "ownership" => Ok(Ownership), + "payment_method" => Ok(PaymentMethod), + "transactions" => Ok(Transactions), + _ => Err(()), + } + } +} +impl std::fmt::Display + for CreateCheckoutSessionPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions +{ + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug + for CreateCheckoutSessionPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions +{ + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize + for CreateCheckoutSessionPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions +{ + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// List of data features that you would like to retrieve upon account creation. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreateCheckoutSessionPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch { + Balances, + Transactions, +} +impl CreateCheckoutSessionPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch { + pub fn as_str(self) -> &'static str { + use CreateCheckoutSessionPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch::*; + match self { + Balances => "balances", + Transactions => "transactions", + } + } +} + +impl std::str::FromStr + for CreateCheckoutSessionPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch +{ + type Err = (); + fn from_str(s: &str) -> Result { + use CreateCheckoutSessionPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch::*; + match s { + "balances" => Ok(Balances), + "transactions" => Ok(Transactions), + _ => Err(()), + } + } +} +impl std::fmt::Display + for CreateCheckoutSessionPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch +{ + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug + for CreateCheckoutSessionPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch +{ + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize + for CreateCheckoutSessionPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch +{ + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Indicates that you intend to make future payments with this PaymentIntent's payment method. +/// +/// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. +/// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. +/// +/// When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreateCheckoutSessionPaymentMethodOptionsUsBankAccountSetupFutureUsage { + None, + OffSession, + OnSession, +} +impl CreateCheckoutSessionPaymentMethodOptionsUsBankAccountSetupFutureUsage { + pub fn as_str(self) -> &'static str { + use CreateCheckoutSessionPaymentMethodOptionsUsBankAccountSetupFutureUsage::*; + match self { + None => "none", + OffSession => "off_session", + OnSession => "on_session", + } + } +} + +impl std::str::FromStr for CreateCheckoutSessionPaymentMethodOptionsUsBankAccountSetupFutureUsage { + type Err = (); + fn from_str(s: &str) -> Result { + use CreateCheckoutSessionPaymentMethodOptionsUsBankAccountSetupFutureUsage::*; + match s { + "none" => Ok(None), + "off_session" => Ok(OffSession), + "on_session" => Ok(OnSession), + _ => Err(()), + } + } +} +impl std::fmt::Display for CreateCheckoutSessionPaymentMethodOptionsUsBankAccountSetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreateCheckoutSessionPaymentMethodOptionsUsBankAccountSetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreateCheckoutSessionPaymentMethodOptionsUsBankAccountSetupFutureUsage { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Verification method for the intent +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreateCheckoutSessionPaymentMethodOptionsUsBankAccountVerificationMethod { + Automatic, + Instant, +} +impl CreateCheckoutSessionPaymentMethodOptionsUsBankAccountVerificationMethod { + pub fn as_str(self) -> &'static str { + use CreateCheckoutSessionPaymentMethodOptionsUsBankAccountVerificationMethod::*; + match self { + Automatic => "automatic", + Instant => "instant", + } + } +} + +impl std::str::FromStr + for CreateCheckoutSessionPaymentMethodOptionsUsBankAccountVerificationMethod +{ + type Err = (); + fn from_str(s: &str) -> Result { + use CreateCheckoutSessionPaymentMethodOptionsUsBankAccountVerificationMethod::*; + match s { + "automatic" => Ok(Automatic), + "instant" => Ok(Instant), + _ => Err(()), + } + } +} +impl std::fmt::Display + for CreateCheckoutSessionPaymentMethodOptionsUsBankAccountVerificationMethod +{ + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreateCheckoutSessionPaymentMethodOptionsUsBankAccountVerificationMethod { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreateCheckoutSessionPaymentMethodOptionsUsBankAccountVerificationMethod { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// contains details about the WeChat Pay payment method options. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreateCheckoutSessionPaymentMethodOptionsWechatPay<'a> { + /// The app ID registered with WeChat Pay. Only required when client is ios or android. + #[serde(skip_serializing_if = "Option::is_none")] + pub app_id: Option<&'a str>, + /// The client type that the end customer will pay from + pub client: CreateCheckoutSessionPaymentMethodOptionsWechatPayClient, + /// Indicates that you intend to make future payments with this PaymentIntent's payment method. + /// + /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. + /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + /// + /// When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + #[serde(skip_serializing_if = "Option::is_none")] + pub setup_future_usage: + Option, +} +impl<'a> CreateCheckoutSessionPaymentMethodOptionsWechatPay<'a> { + pub fn new(client: CreateCheckoutSessionPaymentMethodOptionsWechatPayClient) -> Self { + Self { app_id: None, client, setup_future_usage: None } + } +} +/// The client type that the end customer will pay from +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreateCheckoutSessionPaymentMethodOptionsWechatPayClient { + Android, + Ios, + Web, +} +impl CreateCheckoutSessionPaymentMethodOptionsWechatPayClient { + pub fn as_str(self) -> &'static str { + use CreateCheckoutSessionPaymentMethodOptionsWechatPayClient::*; + match self { + Android => "android", + Ios => "ios", + Web => "web", + } + } +} + +impl std::str::FromStr for CreateCheckoutSessionPaymentMethodOptionsWechatPayClient { + type Err = (); + fn from_str(s: &str) -> Result { + use CreateCheckoutSessionPaymentMethodOptionsWechatPayClient::*; + match s { + "android" => Ok(Android), + "ios" => Ok(Ios), + "web" => Ok(Web), + _ => Err(()), + } + } +} +impl std::fmt::Display for CreateCheckoutSessionPaymentMethodOptionsWechatPayClient { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreateCheckoutSessionPaymentMethodOptionsWechatPayClient { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreateCheckoutSessionPaymentMethodOptionsWechatPayClient { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Indicates that you intend to make future payments with this PaymentIntent's payment method. +/// +/// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. +/// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. +/// +/// When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreateCheckoutSessionPaymentMethodOptionsWechatPaySetupFutureUsage { + None, +} +impl CreateCheckoutSessionPaymentMethodOptionsWechatPaySetupFutureUsage { + pub fn as_str(self) -> &'static str { + use CreateCheckoutSessionPaymentMethodOptionsWechatPaySetupFutureUsage::*; + match self { + None => "none", + } + } +} + +impl std::str::FromStr for CreateCheckoutSessionPaymentMethodOptionsWechatPaySetupFutureUsage { + type Err = (); + fn from_str(s: &str) -> Result { + use CreateCheckoutSessionPaymentMethodOptionsWechatPaySetupFutureUsage::*; + match s { + "none" => Ok(None), + _ => Err(()), + } + } +} +impl std::fmt::Display for CreateCheckoutSessionPaymentMethodOptionsWechatPaySetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreateCheckoutSessionPaymentMethodOptionsWechatPaySetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreateCheckoutSessionPaymentMethodOptionsWechatPaySetupFutureUsage { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// A list of the types of payment methods (e.g., `card`) this Checkout Session can accept. +/// +/// You can omit this attribute to manage your payment methods from the [Stripe Dashboard](https://dashboard.stripe.com/settings/payment_methods). +/// See [Dynamic Payment Methods](https://stripe.com/docs/payments/payment-methods/integration-options#using-dynamic-payment-methods) for more details. +/// +/// Read more about the supported payment methods and their requirements in our [payment +/// method details guide](/docs/payments/checkout/payment-methods). +/// +/// If multiple payment methods are passed, Checkout will dynamically reorder them to +/// prioritize the most relevant payment methods based on the customer's location and +/// other characteristics. +#[derive(Copy, Clone, Eq, PartialEq)] +#[non_exhaustive] +pub enum CreateCheckoutSessionPaymentMethodTypes { + AcssDebit, + Affirm, + AfterpayClearpay, + Alipay, + AuBecsDebit, + BacsDebit, + Bancontact, + Blik, + Boleto, + Card, + Cashapp, + CustomerBalance, + Eps, + Fpx, + Giropay, + Grabpay, + Ideal, + Klarna, + Konbini, + Link, + Oxxo, + P24, + Paynow, + Paypal, + Pix, + Promptpay, + RevolutPay, + SepaDebit, + Sofort, + Swish, + UsBankAccount, + WechatPay, + Zip, + /// An unrecognized value from Stripe. Should not be used as a request parameter. + Unknown, +} +impl CreateCheckoutSessionPaymentMethodTypes { + pub fn as_str(self) -> &'static str { + use CreateCheckoutSessionPaymentMethodTypes::*; + match self { + AcssDebit => "acss_debit", + Affirm => "affirm", + AfterpayClearpay => "afterpay_clearpay", + Alipay => "alipay", + AuBecsDebit => "au_becs_debit", + BacsDebit => "bacs_debit", + Bancontact => "bancontact", + Blik => "blik", + Boleto => "boleto", + Card => "card", + Cashapp => "cashapp", + CustomerBalance => "customer_balance", + Eps => "eps", + Fpx => "fpx", + Giropay => "giropay", + Grabpay => "grabpay", + Ideal => "ideal", + Klarna => "klarna", + Konbini => "konbini", + Link => "link", + Oxxo => "oxxo", + P24 => "p24", + Paynow => "paynow", + Paypal => "paypal", + Pix => "pix", + Promptpay => "promptpay", + RevolutPay => "revolut_pay", + SepaDebit => "sepa_debit", + Sofort => "sofort", + Swish => "swish", + UsBankAccount => "us_bank_account", + WechatPay => "wechat_pay", + Zip => "zip", + Unknown => "unknown", + } + } +} + +impl std::str::FromStr for CreateCheckoutSessionPaymentMethodTypes { + type Err = (); + fn from_str(s: &str) -> Result { + use CreateCheckoutSessionPaymentMethodTypes::*; + match s { + "acss_debit" => Ok(AcssDebit), + "affirm" => Ok(Affirm), + "afterpay_clearpay" => Ok(AfterpayClearpay), + "alipay" => Ok(Alipay), + "au_becs_debit" => Ok(AuBecsDebit), + "bacs_debit" => Ok(BacsDebit), + "bancontact" => Ok(Bancontact), + "blik" => Ok(Blik), + "boleto" => Ok(Boleto), + "card" => Ok(Card), + "cashapp" => Ok(Cashapp), + "customer_balance" => Ok(CustomerBalance), + "eps" => Ok(Eps), + "fpx" => Ok(Fpx), + "giropay" => Ok(Giropay), + "grabpay" => Ok(Grabpay), + "ideal" => Ok(Ideal), + "klarna" => Ok(Klarna), + "konbini" => Ok(Konbini), + "link" => Ok(Link), + "oxxo" => Ok(Oxxo), + "p24" => Ok(P24), + "paynow" => Ok(Paynow), + "paypal" => Ok(Paypal), + "pix" => Ok(Pix), + "promptpay" => Ok(Promptpay), + "revolut_pay" => Ok(RevolutPay), + "sepa_debit" => Ok(SepaDebit), + "sofort" => Ok(Sofort), + "swish" => Ok(Swish), + "us_bank_account" => Ok(UsBankAccount), + "wechat_pay" => Ok(WechatPay), + "zip" => Ok(Zip), + _ => Err(()), + } + } +} +impl std::fmt::Display for CreateCheckoutSessionPaymentMethodTypes { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreateCheckoutSessionPaymentMethodTypes { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreateCheckoutSessionPaymentMethodTypes { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Controls phone number collection settings for the session. +/// +/// We recommend that you review your privacy policy and check with your legal contacts +/// before using this feature. +/// Learn more about [collecting phone numbers with Checkout](https://stripe.com/docs/payments/checkout/phone-numbers). +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreateCheckoutSessionPhoneNumberCollection { + /// Set to `true` to enable phone number collection. + pub enabled: bool, +} +impl CreateCheckoutSessionPhoneNumberCollection { + pub fn new(enabled: bool) -> Self { + Self { enabled } + } +} +/// A subset of parameters to be passed to SetupIntent creation for Checkout Sessions in `setup` mode. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreateCheckoutSessionSetupIntentData<'a> { + /// An arbitrary string attached to the object. Often useful for displaying to users. + #[serde(skip_serializing_if = "Option::is_none")] + pub description: Option<&'a str>, + /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. + /// This can be useful for storing additional information about the object in a structured format. + /// Individual keys can be unset by posting an empty value to them. + /// All keys can be unset by posting an empty value to `metadata`. + #[serde(skip_serializing_if = "Option::is_none")] + pub metadata: Option<&'a std::collections::HashMap>, + /// The Stripe account for which the setup is intended. + #[serde(skip_serializing_if = "Option::is_none")] + pub on_behalf_of: Option<&'a str>, +} +impl<'a> CreateCheckoutSessionSetupIntentData<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// When set, provides configuration for Checkout to collect a shipping address from a customer. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreateCheckoutSessionShippingAddressCollection<'a> { + /// An array of two-letter ISO country codes representing which countries Checkout should provide as options for. + /// shipping locations. + /// Unsupported country codes: `AS, CX, CC, CU, HM, IR, KP, MH, FM, NF, MP, PW, SD, SY, UM, VI`. + pub allowed_countries: &'a [CreateCheckoutSessionShippingAddressCollectionAllowedCountries], +} +impl<'a> CreateCheckoutSessionShippingAddressCollection<'a> { + pub fn new( + allowed_countries: &'a [CreateCheckoutSessionShippingAddressCollectionAllowedCountries], + ) -> Self { + Self { allowed_countries } + } +} +/// An array of two-letter ISO country codes representing which countries Checkout should provide as options for. +/// shipping locations. +/// Unsupported country codes: `AS, CX, CC, CU, HM, IR, KP, MH, FM, NF, MP, PW, SD, SY, UM, VI`. +#[derive(Copy, Clone, Eq, PartialEq)] +#[non_exhaustive] +pub enum CreateCheckoutSessionShippingAddressCollectionAllowedCountries { + Ac, + Ad, + Ae, + Af, + Ag, + Ai, + Al, + Am, + Ao, + Aq, + Ar, + At, + Au, + Aw, + Ax, + Az, + Ba, + Bb, + Bd, + Be, + Bf, + Bg, + Bh, + Bi, + Bj, + Bl, + Bm, + Bn, + Bo, + Bq, + Br, + Bs, + Bt, + Bv, + Bw, + By, + Bz, + Ca, + Cd, + Cf, + Cg, + Ch, + Ci, + Ck, + Cl, + Cm, + Cn, + Co, + Cr, + Cv, + Cw, + Cy, + Cz, + De, + Dj, + Dk, + Dm, + Do, + Dz, + Ec, + Ee, + Eg, + Eh, + Er, + Es, + Et, + Fi, + Fj, + Fk, + Fo, + Fr, + Ga, + Gb, + Gd, + Ge, + Gf, + Gg, + Gh, + Gi, + Gl, + Gm, + Gn, + Gp, + Gq, + Gr, + Gs, + Gt, + Gu, + Gw, + Gy, + Hk, + Hn, + Hr, + Ht, + Hu, + Id, + Ie, + Il, + Im, + In, + Io, + Iq, + Is, + It, + Je, + Jm, + Jo, + Jp, + Ke, + Kg, + Kh, + Ki, + Km, + Kn, + Kr, + Kw, + Ky, + Kz, + La, + Lb, + Lc, + Li, + Lk, + Lr, + Ls, + Lt, + Lu, + Lv, + Ly, + Ma, + Mc, + Md, + Me, + Mf, + Mg, + Mk, + Ml, + Mm, + Mn, + Mo, + Mq, + Mr, + Ms, + Mt, + Mu, + Mv, + Mw, + Mx, + My, + Mz, + Na, + Nc, + Ne, + Ng, + Ni, + Nl, + No, + Np, + Nr, + Nu, + Nz, + Om, + Pa, + Pe, + Pf, + Pg, + Ph, + Pk, + Pl, + Pm, + Pn, + Pr, + Ps, + Pt, + Py, + Qa, + Re, + Ro, + Rs, + Ru, + Rw, + Sa, + Sb, + Sc, + Se, + Sg, + Sh, + Si, + Sj, + Sk, + Sl, + Sm, + Sn, + So, + Sr, + Ss, + St, + Sv, + Sx, + Sz, + Ta, + Tc, + Td, + Tf, + Tg, + Th, + Tj, + Tk, + Tl, + Tm, + Tn, + To, + Tr, + Tt, + Tv, + Tw, + Tz, + Ua, + Ug, + Us, + Uy, + Uz, + Va, + Vc, + Ve, + Vg, + Vn, + Vu, + Wf, + Ws, + Xk, + Ye, + Yt, + Za, + Zm, + Zw, + Zz, + /// An unrecognized value from Stripe. Should not be used as a request parameter. + Unknown, +} +impl CreateCheckoutSessionShippingAddressCollectionAllowedCountries { + pub fn as_str(self) -> &'static str { + use CreateCheckoutSessionShippingAddressCollectionAllowedCountries::*; + match self { + Ac => "AC", + Ad => "AD", + Ae => "AE", + Af => "AF", + Ag => "AG", + Ai => "AI", + Al => "AL", + Am => "AM", + Ao => "AO", + Aq => "AQ", + Ar => "AR", + At => "AT", + Au => "AU", + Aw => "AW", + Ax => "AX", + Az => "AZ", + Ba => "BA", + Bb => "BB", + Bd => "BD", + Be => "BE", + Bf => "BF", + Bg => "BG", + Bh => "BH", + Bi => "BI", + Bj => "BJ", + Bl => "BL", + Bm => "BM", + Bn => "BN", + Bo => "BO", + Bq => "BQ", + Br => "BR", + Bs => "BS", + Bt => "BT", + Bv => "BV", + Bw => "BW", + By => "BY", + Bz => "BZ", + Ca => "CA", + Cd => "CD", + Cf => "CF", + Cg => "CG", + Ch => "CH", + Ci => "CI", + Ck => "CK", + Cl => "CL", + Cm => "CM", + Cn => "CN", + Co => "CO", + Cr => "CR", + Cv => "CV", + Cw => "CW", + Cy => "CY", + Cz => "CZ", + De => "DE", + Dj => "DJ", + Dk => "DK", + Dm => "DM", + Do => "DO", + Dz => "DZ", + Ec => "EC", + Ee => "EE", + Eg => "EG", + Eh => "EH", + Er => "ER", + Es => "ES", + Et => "ET", + Fi => "FI", + Fj => "FJ", + Fk => "FK", + Fo => "FO", + Fr => "FR", + Ga => "GA", + Gb => "GB", + Gd => "GD", + Ge => "GE", + Gf => "GF", + Gg => "GG", + Gh => "GH", + Gi => "GI", + Gl => "GL", + Gm => "GM", + Gn => "GN", + Gp => "GP", + Gq => "GQ", + Gr => "GR", + Gs => "GS", + Gt => "GT", + Gu => "GU", + Gw => "GW", + Gy => "GY", + Hk => "HK", + Hn => "HN", + Hr => "HR", + Ht => "HT", + Hu => "HU", + Id => "ID", + Ie => "IE", + Il => "IL", + Im => "IM", + In => "IN", + Io => "IO", + Iq => "IQ", + Is => "IS", + It => "IT", + Je => "JE", + Jm => "JM", + Jo => "JO", + Jp => "JP", + Ke => "KE", + Kg => "KG", + Kh => "KH", + Ki => "KI", + Km => "KM", + Kn => "KN", + Kr => "KR", + Kw => "KW", + Ky => "KY", + Kz => "KZ", + La => "LA", + Lb => "LB", + Lc => "LC", + Li => "LI", + Lk => "LK", + Lr => "LR", + Ls => "LS", + Lt => "LT", + Lu => "LU", + Lv => "LV", + Ly => "LY", + Ma => "MA", + Mc => "MC", + Md => "MD", + Me => "ME", + Mf => "MF", + Mg => "MG", + Mk => "MK", + Ml => "ML", + Mm => "MM", + Mn => "MN", + Mo => "MO", + Mq => "MQ", + Mr => "MR", + Ms => "MS", + Mt => "MT", + Mu => "MU", + Mv => "MV", + Mw => "MW", + Mx => "MX", + My => "MY", + Mz => "MZ", + Na => "NA", + Nc => "NC", + Ne => "NE", + Ng => "NG", + Ni => "NI", + Nl => "NL", + No => "NO", + Np => "NP", + Nr => "NR", + Nu => "NU", + Nz => "NZ", + Om => "OM", + Pa => "PA", + Pe => "PE", + Pf => "PF", + Pg => "PG", + Ph => "PH", + Pk => "PK", + Pl => "PL", + Pm => "PM", + Pn => "PN", + Pr => "PR", + Ps => "PS", + Pt => "PT", + Py => "PY", + Qa => "QA", + Re => "RE", + Ro => "RO", + Rs => "RS", + Ru => "RU", + Rw => "RW", + Sa => "SA", + Sb => "SB", + Sc => "SC", + Se => "SE", + Sg => "SG", + Sh => "SH", + Si => "SI", + Sj => "SJ", + Sk => "SK", + Sl => "SL", + Sm => "SM", + Sn => "SN", + So => "SO", + Sr => "SR", + Ss => "SS", + St => "ST", + Sv => "SV", + Sx => "SX", + Sz => "SZ", + Ta => "TA", + Tc => "TC", + Td => "TD", + Tf => "TF", + Tg => "TG", + Th => "TH", + Tj => "TJ", + Tk => "TK", + Tl => "TL", + Tm => "TM", + Tn => "TN", + To => "TO", + Tr => "TR", + Tt => "TT", + Tv => "TV", + Tw => "TW", + Tz => "TZ", + Ua => "UA", + Ug => "UG", + Us => "US", + Uy => "UY", + Uz => "UZ", + Va => "VA", + Vc => "VC", + Ve => "VE", + Vg => "VG", + Vn => "VN", + Vu => "VU", + Wf => "WF", + Ws => "WS", + Xk => "XK", + Ye => "YE", + Yt => "YT", + Za => "ZA", + Zm => "ZM", + Zw => "ZW", + Zz => "ZZ", + Unknown => "unknown", + } + } +} + +impl std::str::FromStr for CreateCheckoutSessionShippingAddressCollectionAllowedCountries { + type Err = (); + fn from_str(s: &str) -> Result { + use CreateCheckoutSessionShippingAddressCollectionAllowedCountries::*; + match s { + "AC" => Ok(Ac), + "AD" => Ok(Ad), + "AE" => Ok(Ae), + "AF" => Ok(Af), + "AG" => Ok(Ag), + "AI" => Ok(Ai), + "AL" => Ok(Al), + "AM" => Ok(Am), + "AO" => Ok(Ao), + "AQ" => Ok(Aq), + "AR" => Ok(Ar), + "AT" => Ok(At), + "AU" => Ok(Au), + "AW" => Ok(Aw), + "AX" => Ok(Ax), + "AZ" => Ok(Az), + "BA" => Ok(Ba), + "BB" => Ok(Bb), + "BD" => Ok(Bd), + "BE" => Ok(Be), + "BF" => Ok(Bf), + "BG" => Ok(Bg), + "BH" => Ok(Bh), + "BI" => Ok(Bi), + "BJ" => Ok(Bj), + "BL" => Ok(Bl), + "BM" => Ok(Bm), + "BN" => Ok(Bn), + "BO" => Ok(Bo), + "BQ" => Ok(Bq), + "BR" => Ok(Br), + "BS" => Ok(Bs), + "BT" => Ok(Bt), + "BV" => Ok(Bv), + "BW" => Ok(Bw), + "BY" => Ok(By), + "BZ" => Ok(Bz), + "CA" => Ok(Ca), + "CD" => Ok(Cd), + "CF" => Ok(Cf), + "CG" => Ok(Cg), + "CH" => Ok(Ch), + "CI" => Ok(Ci), + "CK" => Ok(Ck), + "CL" => Ok(Cl), + "CM" => Ok(Cm), + "CN" => Ok(Cn), + "CO" => Ok(Co), + "CR" => Ok(Cr), + "CV" => Ok(Cv), + "CW" => Ok(Cw), + "CY" => Ok(Cy), + "CZ" => Ok(Cz), + "DE" => Ok(De), + "DJ" => Ok(Dj), + "DK" => Ok(Dk), + "DM" => Ok(Dm), + "DO" => Ok(Do), + "DZ" => Ok(Dz), + "EC" => Ok(Ec), + "EE" => Ok(Ee), + "EG" => Ok(Eg), + "EH" => Ok(Eh), + "ER" => Ok(Er), + "ES" => Ok(Es), + "ET" => Ok(Et), + "FI" => Ok(Fi), + "FJ" => Ok(Fj), + "FK" => Ok(Fk), + "FO" => Ok(Fo), + "FR" => Ok(Fr), + "GA" => Ok(Ga), + "GB" => Ok(Gb), + "GD" => Ok(Gd), + "GE" => Ok(Ge), + "GF" => Ok(Gf), + "GG" => Ok(Gg), + "GH" => Ok(Gh), + "GI" => Ok(Gi), + "GL" => Ok(Gl), + "GM" => Ok(Gm), + "GN" => Ok(Gn), + "GP" => Ok(Gp), + "GQ" => Ok(Gq), + "GR" => Ok(Gr), + "GS" => Ok(Gs), + "GT" => Ok(Gt), + "GU" => Ok(Gu), + "GW" => Ok(Gw), + "GY" => Ok(Gy), + "HK" => Ok(Hk), + "HN" => Ok(Hn), + "HR" => Ok(Hr), + "HT" => Ok(Ht), + "HU" => Ok(Hu), + "ID" => Ok(Id), + "IE" => Ok(Ie), + "IL" => Ok(Il), + "IM" => Ok(Im), + "IN" => Ok(In), + "IO" => Ok(Io), + "IQ" => Ok(Iq), + "IS" => Ok(Is), + "IT" => Ok(It), + "JE" => Ok(Je), + "JM" => Ok(Jm), + "JO" => Ok(Jo), + "JP" => Ok(Jp), + "KE" => Ok(Ke), + "KG" => Ok(Kg), + "KH" => Ok(Kh), + "KI" => Ok(Ki), + "KM" => Ok(Km), + "KN" => Ok(Kn), + "KR" => Ok(Kr), + "KW" => Ok(Kw), + "KY" => Ok(Ky), + "KZ" => Ok(Kz), + "LA" => Ok(La), + "LB" => Ok(Lb), + "LC" => Ok(Lc), + "LI" => Ok(Li), + "LK" => Ok(Lk), + "LR" => Ok(Lr), + "LS" => Ok(Ls), + "LT" => Ok(Lt), + "LU" => Ok(Lu), + "LV" => Ok(Lv), + "LY" => Ok(Ly), + "MA" => Ok(Ma), + "MC" => Ok(Mc), + "MD" => Ok(Md), + "ME" => Ok(Me), + "MF" => Ok(Mf), + "MG" => Ok(Mg), + "MK" => Ok(Mk), + "ML" => Ok(Ml), + "MM" => Ok(Mm), + "MN" => Ok(Mn), + "MO" => Ok(Mo), + "MQ" => Ok(Mq), + "MR" => Ok(Mr), + "MS" => Ok(Ms), + "MT" => Ok(Mt), + "MU" => Ok(Mu), + "MV" => Ok(Mv), + "MW" => Ok(Mw), + "MX" => Ok(Mx), + "MY" => Ok(My), + "MZ" => Ok(Mz), + "NA" => Ok(Na), + "NC" => Ok(Nc), + "NE" => Ok(Ne), + "NG" => Ok(Ng), + "NI" => Ok(Ni), + "NL" => Ok(Nl), + "NO" => Ok(No), + "NP" => Ok(Np), + "NR" => Ok(Nr), + "NU" => Ok(Nu), + "NZ" => Ok(Nz), + "OM" => Ok(Om), + "PA" => Ok(Pa), + "PE" => Ok(Pe), + "PF" => Ok(Pf), + "PG" => Ok(Pg), + "PH" => Ok(Ph), + "PK" => Ok(Pk), + "PL" => Ok(Pl), + "PM" => Ok(Pm), + "PN" => Ok(Pn), + "PR" => Ok(Pr), + "PS" => Ok(Ps), + "PT" => Ok(Pt), + "PY" => Ok(Py), + "QA" => Ok(Qa), + "RE" => Ok(Re), + "RO" => Ok(Ro), + "RS" => Ok(Rs), + "RU" => Ok(Ru), + "RW" => Ok(Rw), + "SA" => Ok(Sa), + "SB" => Ok(Sb), + "SC" => Ok(Sc), + "SE" => Ok(Se), + "SG" => Ok(Sg), + "SH" => Ok(Sh), + "SI" => Ok(Si), + "SJ" => Ok(Sj), + "SK" => Ok(Sk), + "SL" => Ok(Sl), + "SM" => Ok(Sm), + "SN" => Ok(Sn), + "SO" => Ok(So), + "SR" => Ok(Sr), + "SS" => Ok(Ss), + "ST" => Ok(St), + "SV" => Ok(Sv), + "SX" => Ok(Sx), + "SZ" => Ok(Sz), + "TA" => Ok(Ta), + "TC" => Ok(Tc), + "TD" => Ok(Td), + "TF" => Ok(Tf), + "TG" => Ok(Tg), + "TH" => Ok(Th), + "TJ" => Ok(Tj), + "TK" => Ok(Tk), + "TL" => Ok(Tl), + "TM" => Ok(Tm), + "TN" => Ok(Tn), + "TO" => Ok(To), + "TR" => Ok(Tr), + "TT" => Ok(Tt), + "TV" => Ok(Tv), + "TW" => Ok(Tw), + "TZ" => Ok(Tz), + "UA" => Ok(Ua), + "UG" => Ok(Ug), + "US" => Ok(Us), + "UY" => Ok(Uy), + "UZ" => Ok(Uz), + "VA" => Ok(Va), + "VC" => Ok(Vc), + "VE" => Ok(Ve), + "VG" => Ok(Vg), + "VN" => Ok(Vn), + "VU" => Ok(Vu), + "WF" => Ok(Wf), + "WS" => Ok(Ws), + "XK" => Ok(Xk), + "YE" => Ok(Ye), + "YT" => Ok(Yt), + "ZA" => Ok(Za), + "ZM" => Ok(Zm), + "ZW" => Ok(Zw), + "ZZ" => Ok(Zz), + _ => Err(()), + } + } +} +impl std::fmt::Display for CreateCheckoutSessionShippingAddressCollectionAllowedCountries { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreateCheckoutSessionShippingAddressCollectionAllowedCountries { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreateCheckoutSessionShippingAddressCollectionAllowedCountries { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// The shipping rate options to apply to this Session. Up to a maximum of 5. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreateCheckoutSessionShippingOptions<'a> { + /// The ID of the Shipping Rate to use for this shipping option. + #[serde(skip_serializing_if = "Option::is_none")] + pub shipping_rate: Option<&'a str>, + /// Parameters to be passed to Shipping Rate creation for this shipping option + #[serde(skip_serializing_if = "Option::is_none")] + pub shipping_rate_data: Option>, +} +impl<'a> CreateCheckoutSessionShippingOptions<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// Parameters to be passed to Shipping Rate creation for this shipping option +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreateCheckoutSessionShippingOptionsShippingRateData<'a> { + /// The estimated range for how long shipping will take, meant to be displayable to the customer. + /// This will appear on CheckoutSessions. + #[serde(skip_serializing_if = "Option::is_none")] + pub delivery_estimate: + Option, + /// The name of the shipping rate, meant to be displayable to the customer. + /// This will appear on CheckoutSessions. + pub display_name: &'a str, + /// Describes a fixed amount to charge for shipping. Must be present if type is `fixed_amount`. + #[serde(skip_serializing_if = "Option::is_none")] + pub fixed_amount: Option>, + /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. + /// This can be useful for storing additional information about the object in a structured format. + /// Individual keys can be unset by posting an empty value to them. + /// All keys can be unset by posting an empty value to `metadata`. + #[serde(skip_serializing_if = "Option::is_none")] + pub metadata: Option<&'a std::collections::HashMap>, + /// Specifies whether the rate is considered inclusive of taxes or exclusive of taxes. + /// One of `inclusive`, `exclusive`, or `unspecified`. + #[serde(skip_serializing_if = "Option::is_none")] + pub tax_behavior: Option, + /// A [tax code](https://stripe.com/docs/tax/tax-categories) ID. + /// The Shipping tax code is `txcd_92010001`. + #[serde(skip_serializing_if = "Option::is_none")] + pub tax_code: Option<&'a str>, + /// The type of calculation to use on the shipping rate. Can only be `fixed_amount` for now. + #[serde(rename = "type")] + #[serde(skip_serializing_if = "Option::is_none")] + pub type_: Option, +} +impl<'a> CreateCheckoutSessionShippingOptionsShippingRateData<'a> { + pub fn new(display_name: &'a str) -> Self { + Self { + delivery_estimate: None, + display_name, + fixed_amount: None, + metadata: None, + tax_behavior: None, + tax_code: None, + type_: None, + } + } +} +/// The estimated range for how long shipping will take, meant to be displayable to the customer. +/// This will appear on CheckoutSessions. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreateCheckoutSessionShippingOptionsShippingRateDataDeliveryEstimate { + /// The upper bound of the estimated range. If empty, represents no upper bound i.e., infinite. + #[serde(skip_serializing_if = "Option::is_none")] + pub maximum: + Option, + /// The lower bound of the estimated range. If empty, represents no lower bound. + #[serde(skip_serializing_if = "Option::is_none")] + pub minimum: + Option, +} +impl CreateCheckoutSessionShippingOptionsShippingRateDataDeliveryEstimate { + pub fn new() -> Self { + Self::default() + } +} +/// The upper bound of the estimated range. If empty, represents no upper bound i.e., infinite. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreateCheckoutSessionShippingOptionsShippingRateDataDeliveryEstimateMaximum { + /// A unit of time. + pub unit: CreateCheckoutSessionShippingOptionsShippingRateDataDeliveryEstimateMaximumUnit, + /// Must be greater than 0. + pub value: i64, +} +impl CreateCheckoutSessionShippingOptionsShippingRateDataDeliveryEstimateMaximum { + pub fn new( + unit: CreateCheckoutSessionShippingOptionsShippingRateDataDeliveryEstimateMaximumUnit, + value: i64, + ) -> Self { + Self { unit, value } + } +} +/// A unit of time. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreateCheckoutSessionShippingOptionsShippingRateDataDeliveryEstimateMaximumUnit { + BusinessDay, + Day, + Hour, + Month, + Week, +} +impl CreateCheckoutSessionShippingOptionsShippingRateDataDeliveryEstimateMaximumUnit { + pub fn as_str(self) -> &'static str { + use CreateCheckoutSessionShippingOptionsShippingRateDataDeliveryEstimateMaximumUnit::*; + match self { + BusinessDay => "business_day", + Day => "day", + Hour => "hour", + Month => "month", + Week => "week", + } + } +} + +impl std::str::FromStr + for CreateCheckoutSessionShippingOptionsShippingRateDataDeliveryEstimateMaximumUnit +{ + type Err = (); + fn from_str(s: &str) -> Result { + use CreateCheckoutSessionShippingOptionsShippingRateDataDeliveryEstimateMaximumUnit::*; + match s { + "business_day" => Ok(BusinessDay), + "day" => Ok(Day), + "hour" => Ok(Hour), + "month" => Ok(Month), + "week" => Ok(Week), + _ => Err(()), + } + } +} +impl std::fmt::Display + for CreateCheckoutSessionShippingOptionsShippingRateDataDeliveryEstimateMaximumUnit +{ + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug + for CreateCheckoutSessionShippingOptionsShippingRateDataDeliveryEstimateMaximumUnit +{ + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize + for CreateCheckoutSessionShippingOptionsShippingRateDataDeliveryEstimateMaximumUnit +{ + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// The lower bound of the estimated range. If empty, represents no lower bound. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreateCheckoutSessionShippingOptionsShippingRateDataDeliveryEstimateMinimum { + /// A unit of time. + pub unit: CreateCheckoutSessionShippingOptionsShippingRateDataDeliveryEstimateMinimumUnit, + /// Must be greater than 0. + pub value: i64, +} +impl CreateCheckoutSessionShippingOptionsShippingRateDataDeliveryEstimateMinimum { + pub fn new( + unit: CreateCheckoutSessionShippingOptionsShippingRateDataDeliveryEstimateMinimumUnit, + value: i64, + ) -> Self { + Self { unit, value } + } +} +/// A unit of time. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreateCheckoutSessionShippingOptionsShippingRateDataDeliveryEstimateMinimumUnit { + BusinessDay, + Day, + Hour, + Month, + Week, +} +impl CreateCheckoutSessionShippingOptionsShippingRateDataDeliveryEstimateMinimumUnit { + pub fn as_str(self) -> &'static str { + use CreateCheckoutSessionShippingOptionsShippingRateDataDeliveryEstimateMinimumUnit::*; + match self { + BusinessDay => "business_day", + Day => "day", + Hour => "hour", + Month => "month", + Week => "week", + } + } +} + +impl std::str::FromStr + for CreateCheckoutSessionShippingOptionsShippingRateDataDeliveryEstimateMinimumUnit +{ + type Err = (); + fn from_str(s: &str) -> Result { + use CreateCheckoutSessionShippingOptionsShippingRateDataDeliveryEstimateMinimumUnit::*; + match s { + "business_day" => Ok(BusinessDay), + "day" => Ok(Day), + "hour" => Ok(Hour), + "month" => Ok(Month), + "week" => Ok(Week), + _ => Err(()), + } + } +} +impl std::fmt::Display + for CreateCheckoutSessionShippingOptionsShippingRateDataDeliveryEstimateMinimumUnit +{ + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug + for CreateCheckoutSessionShippingOptionsShippingRateDataDeliveryEstimateMinimumUnit +{ + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize + for CreateCheckoutSessionShippingOptionsShippingRateDataDeliveryEstimateMinimumUnit +{ + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Describes a fixed amount to charge for shipping. Must be present if type is `fixed_amount`. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreateCheckoutSessionShippingOptionsShippingRateDataFixedAmount<'a> { + /// A non-negative integer in cents representing how much to charge. + pub amount: i64, + /// Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. + /// Must be a [supported currency](https://stripe.com/docs/currencies). + pub currency: stripe_types::Currency, + /// Shipping rates defined in each available currency option. + /// Each key must be a three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html) and a [supported currency](https://stripe.com/docs/currencies). + #[serde(skip_serializing_if = "Option::is_none")] + pub currency_options: Option< + &'a std::collections::HashMap< + stripe_types::Currency, + CreateCheckoutSessionShippingOptionsShippingRateDataFixedAmountCurrencyOptions, + >, + >, +} +impl<'a> CreateCheckoutSessionShippingOptionsShippingRateDataFixedAmount<'a> { + pub fn new(amount: i64, currency: stripe_types::Currency) -> Self { + Self { amount, currency, currency_options: None } + } +} +/// Shipping rates defined in each available currency option. +/// Each key must be a three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html) and a [supported currency](https://stripe.com/docs/currencies). +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreateCheckoutSessionShippingOptionsShippingRateDataFixedAmountCurrencyOptions { + /// A non-negative integer in cents representing how much to charge. + pub amount: i64, + /// Specifies whether the rate is considered inclusive of taxes or exclusive of taxes. + /// One of `inclusive`, `exclusive`, or `unspecified`. + #[serde(skip_serializing_if = "Option::is_none")] + pub tax_behavior: Option< + CreateCheckoutSessionShippingOptionsShippingRateDataFixedAmountCurrencyOptionsTaxBehavior, + >, +} +impl CreateCheckoutSessionShippingOptionsShippingRateDataFixedAmountCurrencyOptions { + pub fn new(amount: i64) -> Self { + Self { amount, tax_behavior: None } + } +} +/// Specifies whether the rate is considered inclusive of taxes or exclusive of taxes. +/// One of `inclusive`, `exclusive`, or `unspecified`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreateCheckoutSessionShippingOptionsShippingRateDataFixedAmountCurrencyOptionsTaxBehavior { + Exclusive, + Inclusive, + Unspecified, +} +impl CreateCheckoutSessionShippingOptionsShippingRateDataFixedAmountCurrencyOptionsTaxBehavior { + pub fn as_str(self) -> &'static str { + use CreateCheckoutSessionShippingOptionsShippingRateDataFixedAmountCurrencyOptionsTaxBehavior::*; + match self { + Exclusive => "exclusive", + Inclusive => "inclusive", + Unspecified => "unspecified", + } + } +} + +impl std::str::FromStr + for CreateCheckoutSessionShippingOptionsShippingRateDataFixedAmountCurrencyOptionsTaxBehavior +{ + type Err = (); + fn from_str(s: &str) -> Result { + use CreateCheckoutSessionShippingOptionsShippingRateDataFixedAmountCurrencyOptionsTaxBehavior::*; + match s { + "exclusive" => Ok(Exclusive), + "inclusive" => Ok(Inclusive), + "unspecified" => Ok(Unspecified), + _ => Err(()), + } + } +} +impl std::fmt::Display + for CreateCheckoutSessionShippingOptionsShippingRateDataFixedAmountCurrencyOptionsTaxBehavior +{ + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug + for CreateCheckoutSessionShippingOptionsShippingRateDataFixedAmountCurrencyOptionsTaxBehavior +{ + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize + for CreateCheckoutSessionShippingOptionsShippingRateDataFixedAmountCurrencyOptionsTaxBehavior +{ + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Specifies whether the rate is considered inclusive of taxes or exclusive of taxes. +/// One of `inclusive`, `exclusive`, or `unspecified`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreateCheckoutSessionShippingOptionsShippingRateDataTaxBehavior { + Exclusive, + Inclusive, + Unspecified, +} +impl CreateCheckoutSessionShippingOptionsShippingRateDataTaxBehavior { + pub fn as_str(self) -> &'static str { + use CreateCheckoutSessionShippingOptionsShippingRateDataTaxBehavior::*; + match self { + Exclusive => "exclusive", + Inclusive => "inclusive", + Unspecified => "unspecified", + } + } +} + +impl std::str::FromStr for CreateCheckoutSessionShippingOptionsShippingRateDataTaxBehavior { + type Err = (); + fn from_str(s: &str) -> Result { + use CreateCheckoutSessionShippingOptionsShippingRateDataTaxBehavior::*; + match s { + "exclusive" => Ok(Exclusive), + "inclusive" => Ok(Inclusive), + "unspecified" => Ok(Unspecified), + _ => Err(()), + } + } +} +impl std::fmt::Display for CreateCheckoutSessionShippingOptionsShippingRateDataTaxBehavior { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreateCheckoutSessionShippingOptionsShippingRateDataTaxBehavior { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreateCheckoutSessionShippingOptionsShippingRateDataTaxBehavior { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// The type of calculation to use on the shipping rate. Can only be `fixed_amount` for now. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreateCheckoutSessionShippingOptionsShippingRateDataType { + FixedAmount, +} +impl CreateCheckoutSessionShippingOptionsShippingRateDataType { + pub fn as_str(self) -> &'static str { + use CreateCheckoutSessionShippingOptionsShippingRateDataType::*; + match self { + FixedAmount => "fixed_amount", + } + } +} + +impl std::str::FromStr for CreateCheckoutSessionShippingOptionsShippingRateDataType { + type Err = (); + fn from_str(s: &str) -> Result { + use CreateCheckoutSessionShippingOptionsShippingRateDataType::*; + match s { + "fixed_amount" => Ok(FixedAmount), + _ => Err(()), + } + } +} +impl std::fmt::Display for CreateCheckoutSessionShippingOptionsShippingRateDataType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreateCheckoutSessionShippingOptionsShippingRateDataType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreateCheckoutSessionShippingOptionsShippingRateDataType { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// A subset of parameters to be passed to subscription creation for Checkout Sessions in `subscription` mode. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreateCheckoutSessionSubscriptionData<'a> { + /// A non-negative decimal between 0 and 100, with at most two decimal places. + /// This represents the percentage of the subscription invoice total that will be transferred to the application owner's Stripe account. + /// To use an application fee percent, the request must be made on behalf of another account, using the `Stripe-Account` header or an OAuth key. + /// For more information, see the application fees [documentation](https://stripe.com/docs/connect/subscriptions#collecting-fees-on-subscriptions). + #[serde(skip_serializing_if = "Option::is_none")] + pub application_fee_percent: Option, + /// A future timestamp to anchor the subscription's billing cycle for new subscriptions. + #[serde(skip_serializing_if = "Option::is_none")] + pub billing_cycle_anchor: Option, + /// The tax rates that will apply to any subscription item that does not have + /// `tax_rates` set. Invoices created will have their `default_tax_rates` populated + /// from the subscription. + #[serde(skip_serializing_if = "Option::is_none")] + pub default_tax_rates: Option<&'a [&'a str]>, + /// The subscription's description, meant to be displayable to the customer. + /// Use this field to optionally store an explanation of the subscription + /// for rendering in the [customer portal](https://stripe.com/docs/customer-management). + #[serde(skip_serializing_if = "Option::is_none")] + pub description: Option<&'a str>, + /// All invoices will be billed using the specified settings. + #[serde(skip_serializing_if = "Option::is_none")] + pub invoice_settings: Option>, + /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. + /// This can be useful for storing additional information about the object in a structured format. + /// Individual keys can be unset by posting an empty value to them. + /// All keys can be unset by posting an empty value to `metadata`. + #[serde(skip_serializing_if = "Option::is_none")] + pub metadata: Option<&'a std::collections::HashMap>, + /// The account on behalf of which to charge, for each of the subscription's invoices. + #[serde(skip_serializing_if = "Option::is_none")] + pub on_behalf_of: Option<&'a str>, + /// Determines how to handle prorations resulting from the `billing_cycle_anchor`. + /// If no value is passed, the default is `create_prorations`. + #[serde(skip_serializing_if = "Option::is_none")] + pub proration_behavior: Option, + /// If specified, the funds from the subscription's invoices will be transferred to the destination and the ID of the resulting transfers will be found on the resulting charges. + #[serde(skip_serializing_if = "Option::is_none")] + pub transfer_data: Option>, + /// Unix timestamp representing the end of the trial period the customer + /// will get before being charged for the first time. Has to be at least + /// 48 hours in the future. + #[serde(skip_serializing_if = "Option::is_none")] + pub trial_end: Option, + /// Integer representing the number of trial period days before the + /// customer is charged for the first time. Has to be at least 1. + #[serde(skip_serializing_if = "Option::is_none")] + pub trial_period_days: Option, + /// Settings related to subscription trials. + #[serde(skip_serializing_if = "Option::is_none")] + pub trial_settings: Option, +} +impl<'a> CreateCheckoutSessionSubscriptionData<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// All invoices will be billed using the specified settings. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreateCheckoutSessionSubscriptionDataInvoiceSettings<'a> { + /// The connected account that issues the invoice. + /// The invoice is presented with the branding and support information of the specified account. + #[serde(skip_serializing_if = "Option::is_none")] + pub issuer: Option>, +} +impl<'a> CreateCheckoutSessionSubscriptionDataInvoiceSettings<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// The connected account that issues the invoice. +/// The invoice is presented with the branding and support information of the specified account. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreateCheckoutSessionSubscriptionDataInvoiceSettingsIssuer<'a> { + /// The connected account being referenced when `type` is `account`. + #[serde(skip_serializing_if = "Option::is_none")] + pub account: Option<&'a str>, + /// Type of the account referenced in the request. + #[serde(rename = "type")] + pub type_: CreateCheckoutSessionSubscriptionDataInvoiceSettingsIssuerType, +} +impl<'a> CreateCheckoutSessionSubscriptionDataInvoiceSettingsIssuer<'a> { + pub fn new(type_: CreateCheckoutSessionSubscriptionDataInvoiceSettingsIssuerType) -> Self { + Self { account: None, type_ } + } +} +/// Type of the account referenced in the request. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreateCheckoutSessionSubscriptionDataInvoiceSettingsIssuerType { + Account, + Self_, +} +impl CreateCheckoutSessionSubscriptionDataInvoiceSettingsIssuerType { + pub fn as_str(self) -> &'static str { + use CreateCheckoutSessionSubscriptionDataInvoiceSettingsIssuerType::*; + match self { + Account => "account", + Self_ => "self", + } + } +} + +impl std::str::FromStr for CreateCheckoutSessionSubscriptionDataInvoiceSettingsIssuerType { + type Err = (); + fn from_str(s: &str) -> Result { + use CreateCheckoutSessionSubscriptionDataInvoiceSettingsIssuerType::*; + match s { + "account" => Ok(Account), + "self" => Ok(Self_), + _ => Err(()), + } + } +} +impl std::fmt::Display for CreateCheckoutSessionSubscriptionDataInvoiceSettingsIssuerType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreateCheckoutSessionSubscriptionDataInvoiceSettingsIssuerType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreateCheckoutSessionSubscriptionDataInvoiceSettingsIssuerType { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Determines how to handle prorations resulting from the `billing_cycle_anchor`. +/// If no value is passed, the default is `create_prorations`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreateCheckoutSessionSubscriptionDataProrationBehavior { + CreateProrations, + None, +} +impl CreateCheckoutSessionSubscriptionDataProrationBehavior { + pub fn as_str(self) -> &'static str { + use CreateCheckoutSessionSubscriptionDataProrationBehavior::*; + match self { + CreateProrations => "create_prorations", + None => "none", + } + } +} + +impl std::str::FromStr for CreateCheckoutSessionSubscriptionDataProrationBehavior { + type Err = (); + fn from_str(s: &str) -> Result { + use CreateCheckoutSessionSubscriptionDataProrationBehavior::*; + match s { + "create_prorations" => Ok(CreateProrations), + "none" => Ok(None), + _ => Err(()), + } + } +} +impl std::fmt::Display for CreateCheckoutSessionSubscriptionDataProrationBehavior { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreateCheckoutSessionSubscriptionDataProrationBehavior { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreateCheckoutSessionSubscriptionDataProrationBehavior { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// If specified, the funds from the subscription's invoices will be transferred to the destination and the ID of the resulting transfers will be found on the resulting charges. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreateCheckoutSessionSubscriptionDataTransferData<'a> { + /// A non-negative decimal between 0 and 100, with at most two decimal places. + /// This represents the percentage of the subscription invoice total that will be transferred to the destination account. + /// By default, the entire amount is transferred to the destination. + #[serde(skip_serializing_if = "Option::is_none")] + pub amount_percent: Option, + /// ID of an existing, connected Stripe account. + pub destination: &'a str, +} +impl<'a> CreateCheckoutSessionSubscriptionDataTransferData<'a> { + pub fn new(destination: &'a str) -> Self { + Self { amount_percent: None, destination } + } +} +/// Settings related to subscription trials. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreateCheckoutSessionSubscriptionDataTrialSettings { + /// Defines how the subscription should behave when the user's free trial ends. + pub end_behavior: CreateCheckoutSessionSubscriptionDataTrialSettingsEndBehavior, +} +impl CreateCheckoutSessionSubscriptionDataTrialSettings { + pub fn new( + end_behavior: CreateCheckoutSessionSubscriptionDataTrialSettingsEndBehavior, + ) -> Self { + Self { end_behavior } + } +} +/// Defines how the subscription should behave when the user's free trial ends. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreateCheckoutSessionSubscriptionDataTrialSettingsEndBehavior { + /// Indicates how the subscription should change when the trial ends if the user did not provide a payment method. + pub missing_payment_method: + CreateCheckoutSessionSubscriptionDataTrialSettingsEndBehaviorMissingPaymentMethod, +} +impl CreateCheckoutSessionSubscriptionDataTrialSettingsEndBehavior { + pub fn new( + missing_payment_method: CreateCheckoutSessionSubscriptionDataTrialSettingsEndBehaviorMissingPaymentMethod, + ) -> Self { + Self { missing_payment_method } + } +} +/// Indicates how the subscription should change when the trial ends if the user did not provide a payment method. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreateCheckoutSessionSubscriptionDataTrialSettingsEndBehaviorMissingPaymentMethod { + Cancel, + CreateInvoice, + Pause, +} +impl CreateCheckoutSessionSubscriptionDataTrialSettingsEndBehaviorMissingPaymentMethod { + pub fn as_str(self) -> &'static str { + use CreateCheckoutSessionSubscriptionDataTrialSettingsEndBehaviorMissingPaymentMethod::*; + match self { + Cancel => "cancel", + CreateInvoice => "create_invoice", + Pause => "pause", + } + } +} + +impl std::str::FromStr + for CreateCheckoutSessionSubscriptionDataTrialSettingsEndBehaviorMissingPaymentMethod +{ + type Err = (); + fn from_str(s: &str) -> Result { + use CreateCheckoutSessionSubscriptionDataTrialSettingsEndBehaviorMissingPaymentMethod::*; + match s { + "cancel" => Ok(Cancel), + "create_invoice" => Ok(CreateInvoice), + "pause" => Ok(Pause), + _ => Err(()), + } + } +} +impl std::fmt::Display + for CreateCheckoutSessionSubscriptionDataTrialSettingsEndBehaviorMissingPaymentMethod +{ + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug + for CreateCheckoutSessionSubscriptionDataTrialSettingsEndBehaviorMissingPaymentMethod +{ + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize + for CreateCheckoutSessionSubscriptionDataTrialSettingsEndBehaviorMissingPaymentMethod +{ + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Controls tax ID collection settings for the session. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreateCheckoutSessionTaxIdCollection { + /// Set to true to enable Tax ID collection. + pub enabled: bool, +} +impl CreateCheckoutSessionTaxIdCollection { + pub fn new(enabled: bool) -> Self { + Self { enabled } + } +} +impl<'a> CreateCheckoutSession<'a> { + /// Creates a Session object. + pub fn send( + &self, + client: &stripe::Client, + ) -> stripe::Response { + client.send_form("/checkout/sessions", self, http_types::Method::Post) + } +} +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct ExpireCheckoutSession<'a> { + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, +} +impl<'a> ExpireCheckoutSession<'a> { + pub fn new() -> Self { + Self::default() + } +} +impl<'a> ExpireCheckoutSession<'a> { + /// A Session can be expired when it is in one of these statuses: `open` + /// + /// After it expires, a customer can’t complete a Session and customers loading the Session see a message saying the Session is expired. + pub fn send( + &self, + client: &stripe::Client, + session: &stripe_checkout::CheckoutSessionId, + ) -> stripe::Response { + client.send_form( + &format!("/checkout/sessions/{session}/expire"), + self, + http_types::Method::Post, + ) + } +} +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CustomTextPositionParam<'a> { + /// Text may be up to 1200 characters in length. + pub message: &'a str, +} +impl<'a> CustomTextPositionParam<'a> { + pub fn new(message: &'a str) -> Self { + Self { message } + } +} diff --git a/generated/stripe_checkout/src/checkout_session/types.rs b/generated/stripe_checkout/src/checkout_session/types.rs new file mode 100644 index 000000000..c3a08e6f4 --- /dev/null +++ b/generated/stripe_checkout/src/checkout_session/types.rs @@ -0,0 +1,840 @@ +/// A Checkout Session represents your customer's session as they pay for +/// one-time purchases or subscriptions through [Checkout](https://stripe.com/docs/payments/checkout) +/// or [Payment Links](https://stripe.com/docs/payments/payment-links). We recommend creating a +/// new Session each time your customer attempts to pay. +/// +/// Once payment is successful, the Checkout Session will contain a reference +/// to the [Customer](https://stripe.com/docs/api/customers), and either the successful +/// [PaymentIntent](https://stripe.com/docs/api/payment_intents) or an active +/// [Subscription](https://stripe.com/docs/api/subscriptions). +/// +/// You can create a Checkout Session on your server and redirect to its URL +/// to begin Checkout. +/// +/// Related guide: [Checkout quickstart](https://stripe.com/docs/checkout/quickstart) +/// +/// For more details see <>. +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct CheckoutSession { + /// When set, provides configuration for actions to take if this Checkout Session expires. + pub after_expiration: Option, + /// Enables user redeemable promotion codes. + pub allow_promotion_codes: Option, + /// Total of all items before discounts or taxes are applied. + pub amount_subtotal: Option, + /// Total of all items after discounts and taxes are applied. + pub amount_total: Option, + pub automatic_tax: stripe_checkout::PaymentPagesCheckoutSessionAutomaticTax, + /// Describes whether Checkout should collect the customer's billing address. + pub billing_address_collection: + Option, + /// If set, Checkout displays a back button and customers will be directed to this URL if they decide to cancel payment and return to your website. + pub cancel_url: Option, + /// A unique string to reference the Checkout Session. This can be a + /// customer ID, a cart ID, or similar, and can be used to reconcile the + /// Session with your internal systems. + pub client_reference_id: Option, + /// Client secret to be used when initializing Stripe.js embedded checkout. + pub client_secret: Option, + /// Results of `consent_collection` for this session. + pub consent: Option, + /// When set, provides configuration for the Checkout Session to gather active consent from customers. + pub consent_collection: Option, + /// Time at which the object was created. Measured in seconds since the Unix epoch. + pub created: stripe_types::Timestamp, + /// Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. + /// Must be a [supported currency](https://stripe.com/docs/currencies). + pub currency: Option, + /// Currency conversion details for automatic currency conversion sessions + pub currency_conversion: Option, + /// Collect additional information from your customer using custom fields. + /// Up to 3 fields are supported. + pub custom_fields: Vec, + pub custom_text: stripe_checkout::PaymentPagesCheckoutSessionCustomText, + /// The ID of the customer for this Session. + /// For Checkout Sessions in `subscription` mode or Checkout Sessions with `customer_creation` set as `always` in `payment` mode, Checkout. + /// will create a new customer object based on information provided + /// during the payment flow unless an existing customer was provided when + /// the Session was created. + pub customer: Option>, + /// Configure whether a Checkout Session creates a Customer when the Checkout Session completes. + pub customer_creation: Option, + /// The customer details including the customer's tax exempt status and the customer's tax IDs. + /// Only the customer's email is present on Sessions in `setup` mode. + pub customer_details: Option, + /// If provided, this value will be used when the Customer object is created. + /// If not provided, customers will be asked to enter their email address. + /// Use this parameter to prefill customer data if you already have an email + /// on file. To access information about the customer once the payment flow is + /// complete, use the `customer` attribute. + pub customer_email: Option, + /// The timestamp at which the Checkout Session will expire. + pub expires_at: stripe_types::Timestamp, + /// Unique identifier for the object. + pub id: stripe_checkout::CheckoutSessionId, + /// ID of the invoice created by the Checkout Session, if it exists. + pub invoice: Option>, + /// Details on the state of invoice creation for the Checkout Session. + pub invoice_creation: Option, + /// The line items purchased by the customer. + #[serde(skip_serializing_if = "Option::is_none")] + pub line_items: Option>, + /// Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + pub livemode: bool, + /// The IETF language tag of the locale Checkout is displayed in. + /// If blank or `auto`, the browser's locale is used. + pub locale: Option, + /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. + /// This can be useful for storing additional information about the object in a structured format. + pub metadata: Option>, + /// The mode of the Checkout Session. + pub mode: stripe_checkout::CheckoutSessionMode, + /// The ID of the PaymentIntent for Checkout Sessions in `payment` mode. + pub payment_intent: Option>, + /// The ID of the Payment Link that created this Session. + pub payment_link: Option>, + /// Configure whether a Checkout Session should collect a payment method. + pub payment_method_collection: Option, + /// Information about the payment method configuration used for this Checkout session if using dynamic payment methods. + pub payment_method_configuration_details: + Option, + /// Payment-method-specific configuration for the PaymentIntent or SetupIntent of this CheckoutSession. + pub payment_method_options: Option, + /// A list of the types of payment methods (e.g. card) this Checkout + /// Session is allowed to accept. + pub payment_method_types: Vec, + /// The payment status of the Checkout Session, one of `paid`, `unpaid`, or `no_payment_required`. + /// You can use this value to decide when to fulfill your customer's order. + pub payment_status: CheckoutSessionPaymentStatus, + #[serde(skip_serializing_if = "Option::is_none")] + pub phone_number_collection: + Option, + /// The ID of the original expired Checkout Session that triggered the recovery flow. + pub recovered_from: Option, + /// Applies to Checkout Sessions with `ui_mode: embedded`. + /// By default, Stripe will always redirect to your return_url after a successful confirmation. + /// If you set `redirect_on_completion: 'if_required'`, then we will only redirect if your user chooses a redirect-based payment method. + #[serde(skip_serializing_if = "Option::is_none")] + pub redirect_on_completion: Option, + /// Applies to Checkout Sessions with `ui_mode: embedded`. + /// The URL to redirect your customer back to after they authenticate or cancel their payment on the payment method's app or site. + #[serde(skip_serializing_if = "Option::is_none")] + pub return_url: Option, + /// The ID of the SetupIntent for Checkout Sessions in `setup` mode. + pub setup_intent: Option>, + /// When set, provides configuration for Checkout to collect a shipping address from a customer. + pub shipping_address_collection: + Option, + /// The details of the customer cost of shipping, including the customer chosen ShippingRate. + pub shipping_cost: Option, + /// Shipping information for this Checkout Session. + pub shipping_details: Option, + /// The shipping rate options applied to this Session. + pub shipping_options: Vec, + /// The status of the Checkout Session, one of `open`, `complete`, or `expired`. + pub status: Option, + /// Describes the type of transaction being performed by Checkout in order to customize + /// relevant text on the page, such as the submit button. `submit_type` can only be + /// specified on Checkout Sessions in `payment` mode. If blank or `auto`, `pay` is used. + pub submit_type: Option, + /// The ID of the subscription for Checkout Sessions in `subscription` mode. + pub subscription: Option>, + /// The URL the customer will be directed to after the payment or + /// subscription creation is successful. + pub success_url: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub tax_id_collection: Option, + /// Tax and discount details for the computed total amount. + pub total_details: Option, + /// The UI mode of the Session. Can be `hosted` (default) or `embedded`. + pub ui_mode: Option, + /// The URL to the Checkout Session. + /// Redirect customers to this URL to take them to Checkout. + /// If you’re using [Custom Domains](https://stripe.com/docs/payments/checkout/custom-domains), the URL will use your subdomain. + /// Otherwise, it’ll use `checkout.stripe.com.`. + /// This value is only present when the session is active. + pub url: Option, +} +/// Configure whether a Checkout Session creates a Customer when the Checkout Session completes. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CheckoutSessionCustomerCreation { + Always, + IfRequired, +} +impl CheckoutSessionCustomerCreation { + pub fn as_str(self) -> &'static str { + use CheckoutSessionCustomerCreation::*; + match self { + Always => "always", + IfRequired => "if_required", + } + } +} + +impl std::str::FromStr for CheckoutSessionCustomerCreation { + type Err = (); + fn from_str(s: &str) -> Result { + use CheckoutSessionCustomerCreation::*; + match s { + "always" => Ok(Always), + "if_required" => Ok(IfRequired), + _ => Err(()), + } + } +} +impl std::fmt::Display for CheckoutSessionCustomerCreation { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CheckoutSessionCustomerCreation { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CheckoutSessionCustomerCreation { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for CheckoutSessionCustomerCreation { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| { + serde::de::Error::custom("Unknown value for CheckoutSessionCustomerCreation") + }) + } +} +/// Configure whether a Checkout Session should collect a payment method. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CheckoutSessionPaymentMethodCollection { + Always, + IfRequired, +} +impl CheckoutSessionPaymentMethodCollection { + pub fn as_str(self) -> &'static str { + use CheckoutSessionPaymentMethodCollection::*; + match self { + Always => "always", + IfRequired => "if_required", + } + } +} + +impl std::str::FromStr for CheckoutSessionPaymentMethodCollection { + type Err = (); + fn from_str(s: &str) -> Result { + use CheckoutSessionPaymentMethodCollection::*; + match s { + "always" => Ok(Always), + "if_required" => Ok(IfRequired), + _ => Err(()), + } + } +} +impl std::fmt::Display for CheckoutSessionPaymentMethodCollection { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CheckoutSessionPaymentMethodCollection { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CheckoutSessionPaymentMethodCollection { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for CheckoutSessionPaymentMethodCollection { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| { + serde::de::Error::custom("Unknown value for CheckoutSessionPaymentMethodCollection") + }) + } +} +/// The payment status of the Checkout Session, one of `paid`, `unpaid`, or `no_payment_required`. +/// You can use this value to decide when to fulfill your customer's order. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CheckoutSessionPaymentStatus { + NoPaymentRequired, + Paid, + Unpaid, +} +impl CheckoutSessionPaymentStatus { + pub fn as_str(self) -> &'static str { + use CheckoutSessionPaymentStatus::*; + match self { + NoPaymentRequired => "no_payment_required", + Paid => "paid", + Unpaid => "unpaid", + } + } +} + +impl std::str::FromStr for CheckoutSessionPaymentStatus { + type Err = (); + fn from_str(s: &str) -> Result { + use CheckoutSessionPaymentStatus::*; + match s { + "no_payment_required" => Ok(NoPaymentRequired), + "paid" => Ok(Paid), + "unpaid" => Ok(Unpaid), + _ => Err(()), + } + } +} +impl std::fmt::Display for CheckoutSessionPaymentStatus { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CheckoutSessionPaymentStatus { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CheckoutSessionPaymentStatus { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for CheckoutSessionPaymentStatus { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s) + .map_err(|_| serde::de::Error::custom("Unknown value for CheckoutSessionPaymentStatus")) + } +} +impl stripe_types::Object for CheckoutSession { + type Id = stripe_checkout::CheckoutSessionId; + fn id(&self) -> &Self::Id { + &self.id + } +} +stripe_types::def_id!(CheckoutSessionId, "cs_"); +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CheckoutSessionBillingAddressCollection { + Auto, + Required, +} +impl CheckoutSessionBillingAddressCollection { + pub fn as_str(self) -> &'static str { + use CheckoutSessionBillingAddressCollection::*; + match self { + Auto => "auto", + Required => "required", + } + } +} + +impl std::str::FromStr for CheckoutSessionBillingAddressCollection { + type Err = (); + fn from_str(s: &str) -> Result { + use CheckoutSessionBillingAddressCollection::*; + match s { + "auto" => Ok(Auto), + "required" => Ok(Required), + _ => Err(()), + } + } +} +impl std::fmt::Display for CheckoutSessionBillingAddressCollection { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CheckoutSessionBillingAddressCollection { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CheckoutSessionBillingAddressCollection { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for CheckoutSessionBillingAddressCollection { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| { + serde::de::Error::custom("Unknown value for CheckoutSessionBillingAddressCollection") + }) + } +} +#[derive(Copy, Clone, Eq, PartialEq)] +#[non_exhaustive] +pub enum CheckoutSessionLocale { + Auto, + Bg, + Cs, + Da, + De, + El, + En, + EnMinusGb, + Es, + EsMinus419, + Et, + Fi, + Fil, + Fr, + FrMinusCa, + Hr, + Hu, + Id, + It, + Ja, + Ko, + Lt, + Lv, + Ms, + Mt, + Nb, + Nl, + Pl, + Pt, + PtMinusBr, + Ro, + Ru, + Sk, + Sl, + Sv, + Th, + Tr, + Vi, + Zh, + ZhMinusHk, + ZhMinusTw, + /// An unrecognized value from Stripe. Should not be used as a request parameter. + Unknown, +} +impl CheckoutSessionLocale { + pub fn as_str(self) -> &'static str { + use CheckoutSessionLocale::*; + match self { + Auto => "auto", + Bg => "bg", + Cs => "cs", + Da => "da", + De => "de", + El => "el", + En => "en", + EnMinusGb => "en-GB", + Es => "es", + EsMinus419 => "es-419", + Et => "et", + Fi => "fi", + Fil => "fil", + Fr => "fr", + FrMinusCa => "fr-CA", + Hr => "hr", + Hu => "hu", + Id => "id", + It => "it", + Ja => "ja", + Ko => "ko", + Lt => "lt", + Lv => "lv", + Ms => "ms", + Mt => "mt", + Nb => "nb", + Nl => "nl", + Pl => "pl", + Pt => "pt", + PtMinusBr => "pt-BR", + Ro => "ro", + Ru => "ru", + Sk => "sk", + Sl => "sl", + Sv => "sv", + Th => "th", + Tr => "tr", + Vi => "vi", + Zh => "zh", + ZhMinusHk => "zh-HK", + ZhMinusTw => "zh-TW", + Unknown => "unknown", + } + } +} + +impl std::str::FromStr for CheckoutSessionLocale { + type Err = (); + fn from_str(s: &str) -> Result { + use CheckoutSessionLocale::*; + match s { + "auto" => Ok(Auto), + "bg" => Ok(Bg), + "cs" => Ok(Cs), + "da" => Ok(Da), + "de" => Ok(De), + "el" => Ok(El), + "en" => Ok(En), + "en-GB" => Ok(EnMinusGb), + "es" => Ok(Es), + "es-419" => Ok(EsMinus419), + "et" => Ok(Et), + "fi" => Ok(Fi), + "fil" => Ok(Fil), + "fr" => Ok(Fr), + "fr-CA" => Ok(FrMinusCa), + "hr" => Ok(Hr), + "hu" => Ok(Hu), + "id" => Ok(Id), + "it" => Ok(It), + "ja" => Ok(Ja), + "ko" => Ok(Ko), + "lt" => Ok(Lt), + "lv" => Ok(Lv), + "ms" => Ok(Ms), + "mt" => Ok(Mt), + "nb" => Ok(Nb), + "nl" => Ok(Nl), + "pl" => Ok(Pl), + "pt" => Ok(Pt), + "pt-BR" => Ok(PtMinusBr), + "ro" => Ok(Ro), + "ru" => Ok(Ru), + "sk" => Ok(Sk), + "sl" => Ok(Sl), + "sv" => Ok(Sv), + "th" => Ok(Th), + "tr" => Ok(Tr), + "vi" => Ok(Vi), + "zh" => Ok(Zh), + "zh-HK" => Ok(ZhMinusHk), + "zh-TW" => Ok(ZhMinusTw), + _ => Err(()), + } + } +} +impl std::fmt::Display for CheckoutSessionLocale { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CheckoutSessionLocale { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CheckoutSessionLocale { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for CheckoutSessionLocale { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Ok(Self::from_str(&s).unwrap_or(CheckoutSessionLocale::Unknown)) + } +} +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CheckoutSessionMode { + Payment, + Setup, + Subscription, +} +impl CheckoutSessionMode { + pub fn as_str(self) -> &'static str { + use CheckoutSessionMode::*; + match self { + Payment => "payment", + Setup => "setup", + Subscription => "subscription", + } + } +} + +impl std::str::FromStr for CheckoutSessionMode { + type Err = (); + fn from_str(s: &str) -> Result { + use CheckoutSessionMode::*; + match s { + "payment" => Ok(Payment), + "setup" => Ok(Setup), + "subscription" => Ok(Subscription), + _ => Err(()), + } + } +} +impl std::fmt::Display for CheckoutSessionMode { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CheckoutSessionMode { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CheckoutSessionMode { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for CheckoutSessionMode { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s) + .map_err(|_| serde::de::Error::custom("Unknown value for CheckoutSessionMode")) + } +} +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CheckoutSessionRedirectOnCompletion { + Always, + IfRequired, + Never, +} +impl CheckoutSessionRedirectOnCompletion { + pub fn as_str(self) -> &'static str { + use CheckoutSessionRedirectOnCompletion::*; + match self { + Always => "always", + IfRequired => "if_required", + Never => "never", + } + } +} + +impl std::str::FromStr for CheckoutSessionRedirectOnCompletion { + type Err = (); + fn from_str(s: &str) -> Result { + use CheckoutSessionRedirectOnCompletion::*; + match s { + "always" => Ok(Always), + "if_required" => Ok(IfRequired), + "never" => Ok(Never), + _ => Err(()), + } + } +} +impl std::fmt::Display for CheckoutSessionRedirectOnCompletion { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CheckoutSessionRedirectOnCompletion { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CheckoutSessionRedirectOnCompletion { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for CheckoutSessionRedirectOnCompletion { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| { + serde::de::Error::custom("Unknown value for CheckoutSessionRedirectOnCompletion") + }) + } +} +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CheckoutSessionStatus { + Complete, + Expired, + Open, +} +impl CheckoutSessionStatus { + pub fn as_str(self) -> &'static str { + use CheckoutSessionStatus::*; + match self { + Complete => "complete", + Expired => "expired", + Open => "open", + } + } +} + +impl std::str::FromStr for CheckoutSessionStatus { + type Err = (); + fn from_str(s: &str) -> Result { + use CheckoutSessionStatus::*; + match s { + "complete" => Ok(Complete), + "expired" => Ok(Expired), + "open" => Ok(Open), + _ => Err(()), + } + } +} +impl std::fmt::Display for CheckoutSessionStatus { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CheckoutSessionStatus { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CheckoutSessionStatus { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for CheckoutSessionStatus { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s) + .map_err(|_| serde::de::Error::custom("Unknown value for CheckoutSessionStatus")) + } +} +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CheckoutSessionSubmitType { + Auto, + Book, + Donate, + Pay, +} +impl CheckoutSessionSubmitType { + pub fn as_str(self) -> &'static str { + use CheckoutSessionSubmitType::*; + match self { + Auto => "auto", + Book => "book", + Donate => "donate", + Pay => "pay", + } + } +} + +impl std::str::FromStr for CheckoutSessionSubmitType { + type Err = (); + fn from_str(s: &str) -> Result { + use CheckoutSessionSubmitType::*; + match s { + "auto" => Ok(Auto), + "book" => Ok(Book), + "donate" => Ok(Donate), + "pay" => Ok(Pay), + _ => Err(()), + } + } +} +impl std::fmt::Display for CheckoutSessionSubmitType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CheckoutSessionSubmitType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CheckoutSessionSubmitType { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for CheckoutSessionSubmitType { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s) + .map_err(|_| serde::de::Error::custom("Unknown value for CheckoutSessionSubmitType")) + } +} +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CheckoutSessionUiMode { + Embedded, + Hosted, +} +impl CheckoutSessionUiMode { + pub fn as_str(self) -> &'static str { + use CheckoutSessionUiMode::*; + match self { + Embedded => "embedded", + Hosted => "hosted", + } + } +} + +impl std::str::FromStr for CheckoutSessionUiMode { + type Err = (); + fn from_str(s: &str) -> Result { + use CheckoutSessionUiMode::*; + match s { + "embedded" => Ok(Embedded), + "hosted" => Ok(Hosted), + _ => Err(()), + } + } +} +impl std::fmt::Display for CheckoutSessionUiMode { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CheckoutSessionUiMode { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CheckoutSessionUiMode { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for CheckoutSessionUiMode { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s) + .map_err(|_| serde::de::Error::custom("Unknown value for CheckoutSessionUiMode")) + } +} diff --git a/generated/stripe_checkout/src/checkout_session_payment_method_options.rs b/generated/stripe_checkout/src/checkout_session_payment_method_options.rs new file mode 100644 index 000000000..60296debe --- /dev/null +++ b/generated/stripe_checkout/src/checkout_session_payment_method_options.rs @@ -0,0 +1,61 @@ +#[derive(Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct CheckoutSessionPaymentMethodOptions { + #[serde(skip_serializing_if = "Option::is_none")] + pub acss_debit: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub affirm: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub afterpay_clearpay: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub alipay: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub au_becs_debit: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub bacs_debit: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub bancontact: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub boleto: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub card: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub cashapp: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub customer_balance: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub eps: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub fpx: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub giropay: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub grabpay: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub ideal: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub klarna: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub konbini: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub link: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub oxxo: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub p24: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub paynow: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub paypal: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub pix: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub revolut_pay: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub sepa_debit: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub sofort: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub swish: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub us_bank_account: Option, +} diff --git a/generated/stripe_checkout/src/checkout_sofort_payment_method_options.rs b/generated/stripe_checkout/src/checkout_sofort_payment_method_options.rs new file mode 100644 index 000000000..c8a6453f7 --- /dev/null +++ b/generated/stripe_checkout/src/checkout_sofort_payment_method_options.rs @@ -0,0 +1,70 @@ +#[derive(Copy, Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct CheckoutSofortPaymentMethodOptions { + /// Indicates that you intend to make future payments with this PaymentIntent's payment method. + /// + /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. + /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + /// + /// When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + #[serde(skip_serializing_if = "Option::is_none")] + pub setup_future_usage: Option, +} +/// Indicates that you intend to make future payments with this PaymentIntent's payment method. +/// +/// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. +/// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. +/// +/// When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CheckoutSofortPaymentMethodOptionsSetupFutureUsage { + None, +} +impl CheckoutSofortPaymentMethodOptionsSetupFutureUsage { + pub fn as_str(self) -> &'static str { + use CheckoutSofortPaymentMethodOptionsSetupFutureUsage::*; + match self { + None => "none", + } + } +} + +impl std::str::FromStr for CheckoutSofortPaymentMethodOptionsSetupFutureUsage { + type Err = (); + fn from_str(s: &str) -> Result { + use CheckoutSofortPaymentMethodOptionsSetupFutureUsage::*; + match s { + "none" => Ok(None), + _ => Err(()), + } + } +} +impl std::fmt::Display for CheckoutSofortPaymentMethodOptionsSetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CheckoutSofortPaymentMethodOptionsSetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CheckoutSofortPaymentMethodOptionsSetupFutureUsage { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for CheckoutSofortPaymentMethodOptionsSetupFutureUsage { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| { + serde::de::Error::custom( + "Unknown value for CheckoutSofortPaymentMethodOptionsSetupFutureUsage", + ) + }) + } +} diff --git a/generated/stripe_checkout/src/checkout_swish_payment_method_options.rs b/generated/stripe_checkout/src/checkout_swish_payment_method_options.rs new file mode 100644 index 000000000..8e5b54650 --- /dev/null +++ b/generated/stripe_checkout/src/checkout_swish_payment_method_options.rs @@ -0,0 +1,6 @@ +#[derive(Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct CheckoutSwishPaymentMethodOptions { + /// The order reference that will be displayed to customers in the Swish application. + /// Defaults to the `id` of the Payment Intent. + pub reference: Option, +} diff --git a/generated/stripe_checkout/src/checkout_us_bank_account_payment_method_options.rs b/generated/stripe_checkout/src/checkout_us_bank_account_payment_method_options.rs new file mode 100644 index 000000000..8c7dec25b --- /dev/null +++ b/generated/stripe_checkout/src/checkout_us_bank_account_payment_method_options.rs @@ -0,0 +1,138 @@ +#[derive(Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct CheckoutUsBankAccountPaymentMethodOptions { + #[serde(skip_serializing_if = "Option::is_none")] + pub financial_connections: Option, + /// Indicates that you intend to make future payments with this PaymentIntent's payment method. + /// + /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. + /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + /// + /// When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + #[serde(skip_serializing_if = "Option::is_none")] + pub setup_future_usage: Option, + /// Bank account verification method. + #[serde(skip_serializing_if = "Option::is_none")] + pub verification_method: Option, +} +/// Indicates that you intend to make future payments with this PaymentIntent's payment method. +/// +/// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. +/// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. +/// +/// When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CheckoutUsBankAccountPaymentMethodOptionsSetupFutureUsage { + None, + OffSession, + OnSession, +} +impl CheckoutUsBankAccountPaymentMethodOptionsSetupFutureUsage { + pub fn as_str(self) -> &'static str { + use CheckoutUsBankAccountPaymentMethodOptionsSetupFutureUsage::*; + match self { + None => "none", + OffSession => "off_session", + OnSession => "on_session", + } + } +} + +impl std::str::FromStr for CheckoutUsBankAccountPaymentMethodOptionsSetupFutureUsage { + type Err = (); + fn from_str(s: &str) -> Result { + use CheckoutUsBankAccountPaymentMethodOptionsSetupFutureUsage::*; + match s { + "none" => Ok(None), + "off_session" => Ok(OffSession), + "on_session" => Ok(OnSession), + _ => Err(()), + } + } +} +impl std::fmt::Display for CheckoutUsBankAccountPaymentMethodOptionsSetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CheckoutUsBankAccountPaymentMethodOptionsSetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CheckoutUsBankAccountPaymentMethodOptionsSetupFutureUsage { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for CheckoutUsBankAccountPaymentMethodOptionsSetupFutureUsage { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| { + serde::de::Error::custom( + "Unknown value for CheckoutUsBankAccountPaymentMethodOptionsSetupFutureUsage", + ) + }) + } +} +/// Bank account verification method. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CheckoutUsBankAccountPaymentMethodOptionsVerificationMethod { + Automatic, + Instant, +} +impl CheckoutUsBankAccountPaymentMethodOptionsVerificationMethod { + pub fn as_str(self) -> &'static str { + use CheckoutUsBankAccountPaymentMethodOptionsVerificationMethod::*; + match self { + Automatic => "automatic", + Instant => "instant", + } + } +} + +impl std::str::FromStr for CheckoutUsBankAccountPaymentMethodOptionsVerificationMethod { + type Err = (); + fn from_str(s: &str) -> Result { + use CheckoutUsBankAccountPaymentMethodOptionsVerificationMethod::*; + match s { + "automatic" => Ok(Automatic), + "instant" => Ok(Instant), + _ => Err(()), + } + } +} +impl std::fmt::Display for CheckoutUsBankAccountPaymentMethodOptionsVerificationMethod { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CheckoutUsBankAccountPaymentMethodOptionsVerificationMethod { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CheckoutUsBankAccountPaymentMethodOptionsVerificationMethod { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for CheckoutUsBankAccountPaymentMethodOptionsVerificationMethod { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| { + serde::de::Error::custom( + "Unknown value for CheckoutUsBankAccountPaymentMethodOptionsVerificationMethod", + ) + }) + } +} diff --git a/generated/stripe_checkout/src/mod.rs b/generated/stripe_checkout/src/mod.rs new file mode 100644 index 000000000..4c6859829 --- /dev/null +++ b/generated/stripe_checkout/src/mod.rs @@ -0,0 +1,247 @@ +#![recursion_limit = "256"] +#![allow(clippy::large_enum_variant)] +#![allow(rustdoc::broken_intra_doc_links)] +#![allow(rustdoc::invalid_html_tags)] + +//! This crate provides Rust bindings to the Stripe HTTP API, +//! centered around [Checkout Sessions](https://stripe.com/docs/api/checkout/sessions). + +extern crate self as stripe_checkout; +pub use checkout_session::types::*; +#[doc(hidden)] +pub mod checkout_acss_debit_mandate_options; +pub mod checkout_session; +#[doc(inline)] +pub use checkout_acss_debit_mandate_options::*; +#[doc(hidden)] +pub mod checkout_acss_debit_payment_method_options; +#[doc(inline)] +pub use checkout_acss_debit_payment_method_options::*; +#[doc(hidden)] +pub mod checkout_affirm_payment_method_options; +#[doc(inline)] +pub use checkout_affirm_payment_method_options::*; +#[doc(hidden)] +pub mod checkout_afterpay_clearpay_payment_method_options; +#[doc(inline)] +pub use checkout_afterpay_clearpay_payment_method_options::*; +#[doc(hidden)] +pub mod checkout_alipay_payment_method_options; +#[doc(inline)] +pub use checkout_alipay_payment_method_options::*; +#[doc(hidden)] +pub mod checkout_au_becs_debit_payment_method_options; +#[doc(inline)] +pub use checkout_au_becs_debit_payment_method_options::*; +#[doc(hidden)] +pub mod checkout_bacs_debit_payment_method_options; +#[doc(inline)] +pub use checkout_bacs_debit_payment_method_options::*; +#[doc(hidden)] +pub mod checkout_bancontact_payment_method_options; +#[doc(inline)] +pub use checkout_bancontact_payment_method_options::*; +#[doc(hidden)] +pub mod checkout_boleto_payment_method_options; +#[doc(inline)] +pub use checkout_boleto_payment_method_options::*; +#[doc(hidden)] +pub mod checkout_card_installments_options; +#[doc(inline)] +pub use checkout_card_installments_options::*; +#[doc(hidden)] +pub mod checkout_card_payment_method_options; +#[doc(inline)] +pub use checkout_card_payment_method_options::*; +#[doc(hidden)] +pub mod checkout_cashapp_payment_method_options; +#[doc(inline)] +pub use checkout_cashapp_payment_method_options::*; +#[doc(hidden)] +pub mod checkout_customer_balance_bank_transfer_payment_method_options; +#[doc(inline)] +pub use checkout_customer_balance_bank_transfer_payment_method_options::*; +#[doc(hidden)] +pub mod checkout_customer_balance_payment_method_options; +#[doc(inline)] +pub use checkout_customer_balance_payment_method_options::*; +#[doc(hidden)] +pub mod checkout_eps_payment_method_options; +#[doc(inline)] +pub use checkout_eps_payment_method_options::*; +#[doc(hidden)] +pub mod checkout_fpx_payment_method_options; +#[doc(inline)] +pub use checkout_fpx_payment_method_options::*; +#[doc(hidden)] +pub mod checkout_giropay_payment_method_options; +#[doc(inline)] +pub use checkout_giropay_payment_method_options::*; +#[doc(hidden)] +pub mod checkout_grab_pay_payment_method_options; +#[doc(inline)] +pub use checkout_grab_pay_payment_method_options::*; +#[doc(hidden)] +pub mod checkout_ideal_payment_method_options; +#[doc(inline)] +pub use checkout_ideal_payment_method_options::*; +#[doc(hidden)] +pub mod checkout_klarna_payment_method_options; +#[doc(inline)] +pub use checkout_klarna_payment_method_options::*; +#[doc(hidden)] +pub mod checkout_konbini_payment_method_options; +#[doc(inline)] +pub use checkout_konbini_payment_method_options::*; +#[doc(hidden)] +pub mod checkout_link_payment_method_options; +#[doc(inline)] +pub use checkout_link_payment_method_options::*; +#[doc(hidden)] +pub mod checkout_oxxo_payment_method_options; +#[doc(inline)] +pub use checkout_oxxo_payment_method_options::*; +#[doc(hidden)] +pub mod checkout_p24_payment_method_options; +#[doc(inline)] +pub use checkout_p24_payment_method_options::*; +#[doc(hidden)] +pub mod checkout_paynow_payment_method_options; +#[doc(inline)] +pub use checkout_paynow_payment_method_options::*; +#[doc(hidden)] +pub mod checkout_paypal_payment_method_options; +#[doc(inline)] +pub use checkout_paypal_payment_method_options::*; +#[doc(hidden)] +pub mod checkout_pix_payment_method_options; +#[doc(inline)] +pub use checkout_pix_payment_method_options::*; +#[doc(hidden)] +pub mod checkout_revolut_pay_payment_method_options; +#[doc(inline)] +pub use checkout_revolut_pay_payment_method_options::*; +#[doc(hidden)] +pub mod checkout_sepa_debit_payment_method_options; +#[doc(inline)] +pub use checkout_sepa_debit_payment_method_options::*; +#[doc(hidden)] +pub mod checkout_session_payment_method_options; +#[doc(inline)] +pub use checkout_session_payment_method_options::*; +#[doc(hidden)] +pub mod checkout_sofort_payment_method_options; +#[doc(inline)] +pub use checkout_sofort_payment_method_options::*; +#[doc(hidden)] +pub mod checkout_swish_payment_method_options; +#[doc(inline)] +pub use checkout_swish_payment_method_options::*; +#[doc(hidden)] +pub mod checkout_us_bank_account_payment_method_options; +#[doc(inline)] +pub use checkout_us_bank_account_payment_method_options::*; +#[doc(hidden)] +pub mod payment_pages_checkout_session_after_expiration; +#[doc(inline)] +pub use payment_pages_checkout_session_after_expiration::*; +#[doc(hidden)] +pub mod payment_pages_checkout_session_after_expiration_recovery; +#[doc(inline)] +pub use payment_pages_checkout_session_after_expiration_recovery::*; +#[doc(hidden)] +pub mod payment_pages_checkout_session_automatic_tax; +#[doc(inline)] +pub use payment_pages_checkout_session_automatic_tax::*; +#[doc(hidden)] +pub mod payment_pages_checkout_session_consent; +#[doc(inline)] +pub use payment_pages_checkout_session_consent::*; +#[doc(hidden)] +pub mod payment_pages_checkout_session_consent_collection; +#[doc(inline)] +pub use payment_pages_checkout_session_consent_collection::*; +#[doc(hidden)] +pub mod payment_pages_checkout_session_currency_conversion; +#[doc(inline)] +pub use payment_pages_checkout_session_currency_conversion::*; +#[doc(hidden)] +pub mod payment_pages_checkout_session_custom_fields; +#[doc(inline)] +pub use payment_pages_checkout_session_custom_fields::*; +#[doc(hidden)] +pub mod payment_pages_checkout_session_custom_fields_dropdown; +#[doc(inline)] +pub use payment_pages_checkout_session_custom_fields_dropdown::*; +#[doc(hidden)] +pub mod payment_pages_checkout_session_custom_fields_label; +#[doc(inline)] +pub use payment_pages_checkout_session_custom_fields_label::*; +#[doc(hidden)] +pub mod payment_pages_checkout_session_custom_fields_numeric; +#[doc(inline)] +pub use payment_pages_checkout_session_custom_fields_numeric::*; +#[doc(hidden)] +pub mod payment_pages_checkout_session_custom_fields_option; +#[doc(inline)] +pub use payment_pages_checkout_session_custom_fields_option::*; +#[doc(hidden)] +pub mod payment_pages_checkout_session_custom_fields_text; +#[doc(inline)] +pub use payment_pages_checkout_session_custom_fields_text::*; +#[doc(hidden)] +pub mod payment_pages_checkout_session_custom_text; +#[doc(inline)] +pub use payment_pages_checkout_session_custom_text::*; +#[doc(hidden)] +pub mod payment_pages_checkout_session_custom_text_position; +#[doc(inline)] +pub use payment_pages_checkout_session_custom_text_position::*; +#[doc(hidden)] +pub mod payment_pages_checkout_session_customer_details; +#[doc(inline)] +pub use payment_pages_checkout_session_customer_details::*; +#[doc(hidden)] +pub mod payment_pages_checkout_session_invoice_creation; +#[doc(inline)] +pub use payment_pages_checkout_session_invoice_creation::*; +#[doc(hidden)] +pub mod payment_pages_checkout_session_invoice_settings; +#[doc(inline)] +pub use payment_pages_checkout_session_invoice_settings::*; +#[doc(hidden)] +pub mod payment_pages_checkout_session_payment_method_reuse_agreement; +#[doc(inline)] +pub use payment_pages_checkout_session_payment_method_reuse_agreement::*; +#[doc(hidden)] +pub mod payment_pages_checkout_session_phone_number_collection; +#[doc(inline)] +pub use payment_pages_checkout_session_phone_number_collection::*; +#[doc(hidden)] +pub mod payment_pages_checkout_session_shipping_address_collection; +#[doc(inline)] +pub use payment_pages_checkout_session_shipping_address_collection::*; +#[doc(hidden)] +pub mod payment_pages_checkout_session_shipping_cost; +#[doc(inline)] +pub use payment_pages_checkout_session_shipping_cost::*; +#[doc(hidden)] +pub mod payment_pages_checkout_session_shipping_option; +#[doc(inline)] +pub use payment_pages_checkout_session_shipping_option::*; +#[doc(hidden)] +pub mod payment_pages_checkout_session_tax_id; +#[doc(inline)] +pub use payment_pages_checkout_session_tax_id::*; +#[doc(hidden)] +pub mod payment_pages_checkout_session_tax_id_collection; +#[doc(inline)] +pub use payment_pages_checkout_session_tax_id_collection::*; +#[doc(hidden)] +pub mod payment_pages_checkout_session_total_details; +#[doc(inline)] +pub use payment_pages_checkout_session_total_details::*; +#[doc(hidden)] +pub mod payment_pages_checkout_session_total_details_resource_breakdown; +#[doc(inline)] +pub use payment_pages_checkout_session_total_details_resource_breakdown::*; diff --git a/generated/stripe_checkout/src/payment_pages_checkout_session_after_expiration.rs b/generated/stripe_checkout/src/payment_pages_checkout_session_after_expiration.rs new file mode 100644 index 000000000..8556d7c03 --- /dev/null +++ b/generated/stripe_checkout/src/payment_pages_checkout_session_after_expiration.rs @@ -0,0 +1,5 @@ +#[derive(Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct PaymentPagesCheckoutSessionAfterExpiration { + /// When set, configuration used to recover the Checkout Session on expiry. + pub recovery: Option, +} diff --git a/generated/stripe_checkout/src/payment_pages_checkout_session_after_expiration_recovery.rs b/generated/stripe_checkout/src/payment_pages_checkout_session_after_expiration_recovery.rs new file mode 100644 index 000000000..383eac4a6 --- /dev/null +++ b/generated/stripe_checkout/src/payment_pages_checkout_session_after_expiration_recovery.rs @@ -0,0 +1,13 @@ +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct PaymentPagesCheckoutSessionAfterExpirationRecovery { + /// Enables user redeemable promotion codes on the recovered Checkout Sessions. Defaults to `false` + pub allow_promotion_codes: bool, + /// If `true`, a recovery url will be generated to recover this Checkout Session if it + /// expires before a transaction is completed. It will be attached to the + /// Checkout Session object upon expiration. + pub enabled: bool, + /// The timestamp at which the recovery URL will expire. + pub expires_at: Option, + /// URL that creates a new Checkout Session when clicked that is a copy of this expired Checkout Session. + pub url: Option, +} diff --git a/generated/stripe_checkout/src/payment_pages_checkout_session_automatic_tax.rs b/generated/stripe_checkout/src/payment_pages_checkout_session_automatic_tax.rs new file mode 100644 index 000000000..ca13dfeb7 --- /dev/null +++ b/generated/stripe_checkout/src/payment_pages_checkout_session_automatic_tax.rs @@ -0,0 +1,71 @@ +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct PaymentPagesCheckoutSessionAutomaticTax { + /// Indicates whether automatic tax is enabled for the session + pub enabled: bool, + /// The account that's liable for tax. + /// If set, the business address and tax registrations required to perform the tax calculation are loaded from this account. + /// The tax transaction is returned in the report of the connected account. + pub liability: Option, + /// The status of the most recent automated tax calculation for this session. + pub status: Option, +} +/// The status of the most recent automated tax calculation for this session. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum PaymentPagesCheckoutSessionAutomaticTaxStatus { + Complete, + Failed, + RequiresLocationInputs, +} +impl PaymentPagesCheckoutSessionAutomaticTaxStatus { + pub fn as_str(self) -> &'static str { + use PaymentPagesCheckoutSessionAutomaticTaxStatus::*; + match self { + Complete => "complete", + Failed => "failed", + RequiresLocationInputs => "requires_location_inputs", + } + } +} + +impl std::str::FromStr for PaymentPagesCheckoutSessionAutomaticTaxStatus { + type Err = (); + fn from_str(s: &str) -> Result { + use PaymentPagesCheckoutSessionAutomaticTaxStatus::*; + match s { + "complete" => Ok(Complete), + "failed" => Ok(Failed), + "requires_location_inputs" => Ok(RequiresLocationInputs), + _ => Err(()), + } + } +} +impl std::fmt::Display for PaymentPagesCheckoutSessionAutomaticTaxStatus { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for PaymentPagesCheckoutSessionAutomaticTaxStatus { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for PaymentPagesCheckoutSessionAutomaticTaxStatus { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for PaymentPagesCheckoutSessionAutomaticTaxStatus { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| { + serde::de::Error::custom( + "Unknown value for PaymentPagesCheckoutSessionAutomaticTaxStatus", + ) + }) + } +} diff --git a/generated/stripe_checkout/src/payment_pages_checkout_session_consent.rs b/generated/stripe_checkout/src/payment_pages_checkout_session_consent.rs new file mode 100644 index 000000000..2f784f268 --- /dev/null +++ b/generated/stripe_checkout/src/payment_pages_checkout_session_consent.rs @@ -0,0 +1,120 @@ +#[derive(Copy, Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct PaymentPagesCheckoutSessionConsent { + /// If `opt_in`, the customer consents to receiving promotional communications + /// from the merchant about this Checkout Session. + pub promotions: Option, + /// If `accepted`, the customer in this Checkout Session has agreed to the merchant's terms of service. + pub terms_of_service: Option, +} +/// If `opt_in`, the customer consents to receiving promotional communications +/// from the merchant about this Checkout Session. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum PaymentPagesCheckoutSessionConsentPromotions { + OptIn, + OptOut, +} +impl PaymentPagesCheckoutSessionConsentPromotions { + pub fn as_str(self) -> &'static str { + use PaymentPagesCheckoutSessionConsentPromotions::*; + match self { + OptIn => "opt_in", + OptOut => "opt_out", + } + } +} + +impl std::str::FromStr for PaymentPagesCheckoutSessionConsentPromotions { + type Err = (); + fn from_str(s: &str) -> Result { + use PaymentPagesCheckoutSessionConsentPromotions::*; + match s { + "opt_in" => Ok(OptIn), + "opt_out" => Ok(OptOut), + _ => Err(()), + } + } +} +impl std::fmt::Display for PaymentPagesCheckoutSessionConsentPromotions { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for PaymentPagesCheckoutSessionConsentPromotions { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for PaymentPagesCheckoutSessionConsentPromotions { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for PaymentPagesCheckoutSessionConsentPromotions { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| { + serde::de::Error::custom( + "Unknown value for PaymentPagesCheckoutSessionConsentPromotions", + ) + }) + } +} +/// If `accepted`, the customer in this Checkout Session has agreed to the merchant's terms of service. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum PaymentPagesCheckoutSessionConsentTermsOfService { + Accepted, +} +impl PaymentPagesCheckoutSessionConsentTermsOfService { + pub fn as_str(self) -> &'static str { + use PaymentPagesCheckoutSessionConsentTermsOfService::*; + match self { + Accepted => "accepted", + } + } +} + +impl std::str::FromStr for PaymentPagesCheckoutSessionConsentTermsOfService { + type Err = (); + fn from_str(s: &str) -> Result { + use PaymentPagesCheckoutSessionConsentTermsOfService::*; + match s { + "accepted" => Ok(Accepted), + _ => Err(()), + } + } +} +impl std::fmt::Display for PaymentPagesCheckoutSessionConsentTermsOfService { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for PaymentPagesCheckoutSessionConsentTermsOfService { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for PaymentPagesCheckoutSessionConsentTermsOfService { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for PaymentPagesCheckoutSessionConsentTermsOfService { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| { + serde::de::Error::custom( + "Unknown value for PaymentPagesCheckoutSessionConsentTermsOfService", + ) + }) + } +} diff --git a/generated/stripe_checkout/src/payment_pages_checkout_session_consent_collection.rs b/generated/stripe_checkout/src/payment_pages_checkout_session_consent_collection.rs new file mode 100644 index 000000000..74b3cb0ff --- /dev/null +++ b/generated/stripe_checkout/src/payment_pages_checkout_session_consent_collection.rs @@ -0,0 +1,130 @@ +#[derive(Copy, Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct PaymentPagesCheckoutSessionConsentCollection { + /// If set to `hidden`, it will hide legal text related to the reuse of a payment method. + pub payment_method_reuse_agreement: + Option, + /// If set to `auto`, enables the collection of customer consent for promotional communications. + /// The Checkout. + /// Session will determine whether to display an option to opt into promotional communication + /// from the merchant depending on the customer's locale. Only available to US merchants. + pub promotions: Option, + /// If set to `required`, it requires customers to accept the terms of service before being able to pay. + pub terms_of_service: Option, +} +/// If set to `auto`, enables the collection of customer consent for promotional communications. +/// The Checkout. +/// Session will determine whether to display an option to opt into promotional communication +/// from the merchant depending on the customer's locale. Only available to US merchants. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum PaymentPagesCheckoutSessionConsentCollectionPromotions { + Auto, + None, +} +impl PaymentPagesCheckoutSessionConsentCollectionPromotions { + pub fn as_str(self) -> &'static str { + use PaymentPagesCheckoutSessionConsentCollectionPromotions::*; + match self { + Auto => "auto", + None => "none", + } + } +} + +impl std::str::FromStr for PaymentPagesCheckoutSessionConsentCollectionPromotions { + type Err = (); + fn from_str(s: &str) -> Result { + use PaymentPagesCheckoutSessionConsentCollectionPromotions::*; + match s { + "auto" => Ok(Auto), + "none" => Ok(None), + _ => Err(()), + } + } +} +impl std::fmt::Display for PaymentPagesCheckoutSessionConsentCollectionPromotions { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for PaymentPagesCheckoutSessionConsentCollectionPromotions { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for PaymentPagesCheckoutSessionConsentCollectionPromotions { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for PaymentPagesCheckoutSessionConsentCollectionPromotions { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| { + serde::de::Error::custom( + "Unknown value for PaymentPagesCheckoutSessionConsentCollectionPromotions", + ) + }) + } +} +/// If set to `required`, it requires customers to accept the terms of service before being able to pay. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum PaymentPagesCheckoutSessionConsentCollectionTermsOfService { + None, + Required, +} +impl PaymentPagesCheckoutSessionConsentCollectionTermsOfService { + pub fn as_str(self) -> &'static str { + use PaymentPagesCheckoutSessionConsentCollectionTermsOfService::*; + match self { + None => "none", + Required => "required", + } + } +} + +impl std::str::FromStr for PaymentPagesCheckoutSessionConsentCollectionTermsOfService { + type Err = (); + fn from_str(s: &str) -> Result { + use PaymentPagesCheckoutSessionConsentCollectionTermsOfService::*; + match s { + "none" => Ok(None), + "required" => Ok(Required), + _ => Err(()), + } + } +} +impl std::fmt::Display for PaymentPagesCheckoutSessionConsentCollectionTermsOfService { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for PaymentPagesCheckoutSessionConsentCollectionTermsOfService { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for PaymentPagesCheckoutSessionConsentCollectionTermsOfService { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for PaymentPagesCheckoutSessionConsentCollectionTermsOfService { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| { + serde::de::Error::custom( + "Unknown value for PaymentPagesCheckoutSessionConsentCollectionTermsOfService", + ) + }) + } +} diff --git a/generated/stripe_checkout/src/payment_pages_checkout_session_currency_conversion.rs b/generated/stripe_checkout/src/payment_pages_checkout_session_currency_conversion.rs new file mode 100644 index 000000000..9e2c3fee0 --- /dev/null +++ b/generated/stripe_checkout/src/payment_pages_checkout_session_currency_conversion.rs @@ -0,0 +1,11 @@ +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct PaymentPagesCheckoutSessionCurrencyConversion { + /// Total of all items in source currency before discounts or taxes are applied. + pub amount_subtotal: i64, + /// Total of all items in source currency after discounts and taxes are applied. + pub amount_total: i64, + /// Exchange rate used to convert source currency amounts to customer currency amounts + pub fx_rate: String, + /// Creation currency of the CheckoutSession before localization + pub source_currency: stripe_types::Currency, +} diff --git a/generated/stripe_checkout/src/payment_pages_checkout_session_custom_fields.rs b/generated/stripe_checkout/src/payment_pages_checkout_session_custom_fields.rs new file mode 100644 index 000000000..c801270df --- /dev/null +++ b/generated/stripe_checkout/src/payment_pages_checkout_session_custom_fields.rs @@ -0,0 +1,79 @@ +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct PaymentPagesCheckoutSessionCustomFields { + #[serde(skip_serializing_if = "Option::is_none")] + pub dropdown: Option, + /// String of your choice that your integration can use to reconcile this field. + /// Must be unique to this field, alphanumeric, and up to 200 characters. + pub key: String, + pub label: stripe_checkout::PaymentPagesCheckoutSessionCustomFieldsLabel, + #[serde(skip_serializing_if = "Option::is_none")] + pub numeric: Option, + /// Whether the customer is required to complete the field before completing the Checkout Session. + /// Defaults to `false`. + pub optional: bool, + #[serde(skip_serializing_if = "Option::is_none")] + pub text: Option, + /// The type of the field. + #[serde(rename = "type")] + pub type_: PaymentPagesCheckoutSessionCustomFieldsType, +} +/// The type of the field. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum PaymentPagesCheckoutSessionCustomFieldsType { + Dropdown, + Numeric, + Text, +} +impl PaymentPagesCheckoutSessionCustomFieldsType { + pub fn as_str(self) -> &'static str { + use PaymentPagesCheckoutSessionCustomFieldsType::*; + match self { + Dropdown => "dropdown", + Numeric => "numeric", + Text => "text", + } + } +} + +impl std::str::FromStr for PaymentPagesCheckoutSessionCustomFieldsType { + type Err = (); + fn from_str(s: &str) -> Result { + use PaymentPagesCheckoutSessionCustomFieldsType::*; + match s { + "dropdown" => Ok(Dropdown), + "numeric" => Ok(Numeric), + "text" => Ok(Text), + _ => Err(()), + } + } +} +impl std::fmt::Display for PaymentPagesCheckoutSessionCustomFieldsType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for PaymentPagesCheckoutSessionCustomFieldsType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for PaymentPagesCheckoutSessionCustomFieldsType { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for PaymentPagesCheckoutSessionCustomFieldsType { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| { + serde::de::Error::custom( + "Unknown value for PaymentPagesCheckoutSessionCustomFieldsType", + ) + }) + } +} diff --git a/generated/stripe_checkout/src/payment_pages_checkout_session_custom_fields_dropdown.rs b/generated/stripe_checkout/src/payment_pages_checkout_session_custom_fields_dropdown.rs new file mode 100644 index 000000000..696c54d6a --- /dev/null +++ b/generated/stripe_checkout/src/payment_pages_checkout_session_custom_fields_dropdown.rs @@ -0,0 +1,7 @@ +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct PaymentPagesCheckoutSessionCustomFieldsDropdown { + /// The options available for the customer to select. Up to 200 options allowed. + pub options: Vec, + /// The option selected by the customer. This will be the `value` for the option. + pub value: Option, +} diff --git a/generated/stripe_checkout/src/payment_pages_checkout_session_custom_fields_label.rs b/generated/stripe_checkout/src/payment_pages_checkout_session_custom_fields_label.rs new file mode 100644 index 000000000..0b1f20bf6 --- /dev/null +++ b/generated/stripe_checkout/src/payment_pages_checkout_session_custom_fields_label.rs @@ -0,0 +1,62 @@ +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct PaymentPagesCheckoutSessionCustomFieldsLabel { + /// Custom text for the label, displayed to the customer. Up to 50 characters. + pub custom: Option, + /// The type of the label. + #[serde(rename = "type")] + pub type_: PaymentPagesCheckoutSessionCustomFieldsLabelType, +} +/// The type of the label. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum PaymentPagesCheckoutSessionCustomFieldsLabelType { + Custom, +} +impl PaymentPagesCheckoutSessionCustomFieldsLabelType { + pub fn as_str(self) -> &'static str { + use PaymentPagesCheckoutSessionCustomFieldsLabelType::*; + match self { + Custom => "custom", + } + } +} + +impl std::str::FromStr for PaymentPagesCheckoutSessionCustomFieldsLabelType { + type Err = (); + fn from_str(s: &str) -> Result { + use PaymentPagesCheckoutSessionCustomFieldsLabelType::*; + match s { + "custom" => Ok(Custom), + _ => Err(()), + } + } +} +impl std::fmt::Display for PaymentPagesCheckoutSessionCustomFieldsLabelType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for PaymentPagesCheckoutSessionCustomFieldsLabelType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for PaymentPagesCheckoutSessionCustomFieldsLabelType { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for PaymentPagesCheckoutSessionCustomFieldsLabelType { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| { + serde::de::Error::custom( + "Unknown value for PaymentPagesCheckoutSessionCustomFieldsLabelType", + ) + }) + } +} diff --git a/generated/stripe_checkout/src/payment_pages_checkout_session_custom_fields_numeric.rs b/generated/stripe_checkout/src/payment_pages_checkout_session_custom_fields_numeric.rs new file mode 100644 index 000000000..74e41bf6e --- /dev/null +++ b/generated/stripe_checkout/src/payment_pages_checkout_session_custom_fields_numeric.rs @@ -0,0 +1,9 @@ +#[derive(Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct PaymentPagesCheckoutSessionCustomFieldsNumeric { + /// The maximum character length constraint for the customer's input. + pub maximum_length: Option, + /// The minimum character length requirement for the customer's input. + pub minimum_length: Option, + /// The value entered by the customer, containing only digits. + pub value: Option, +} diff --git a/generated/stripe_checkout/src/payment_pages_checkout_session_custom_fields_option.rs b/generated/stripe_checkout/src/payment_pages_checkout_session_custom_fields_option.rs new file mode 100644 index 000000000..86c9c3a0d --- /dev/null +++ b/generated/stripe_checkout/src/payment_pages_checkout_session_custom_fields_option.rs @@ -0,0 +1,8 @@ +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct PaymentPagesCheckoutSessionCustomFieldsOption { + /// The label for the option, displayed to the customer. Up to 100 characters. + pub label: String, + /// The value for this option, not displayed to the customer, used by your integration to reconcile the option selected by the customer. + /// Must be unique to this option, alphanumeric, and up to 100 characters. + pub value: String, +} diff --git a/generated/stripe_checkout/src/payment_pages_checkout_session_custom_fields_text.rs b/generated/stripe_checkout/src/payment_pages_checkout_session_custom_fields_text.rs new file mode 100644 index 000000000..48f5a6e6c --- /dev/null +++ b/generated/stripe_checkout/src/payment_pages_checkout_session_custom_fields_text.rs @@ -0,0 +1,9 @@ +#[derive(Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct PaymentPagesCheckoutSessionCustomFieldsText { + /// The maximum character length constraint for the customer's input. + pub maximum_length: Option, + /// The minimum character length requirement for the customer's input. + pub minimum_length: Option, + /// The value entered by the customer. + pub value: Option, +} diff --git a/generated/stripe_checkout/src/payment_pages_checkout_session_custom_text.rs b/generated/stripe_checkout/src/payment_pages_checkout_session_custom_text.rs new file mode 100644 index 000000000..7f0ccbfe8 --- /dev/null +++ b/generated/stripe_checkout/src/payment_pages_checkout_session_custom_text.rs @@ -0,0 +1,12 @@ +#[derive(Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct PaymentPagesCheckoutSessionCustomText { + /// Custom text that should be displayed after the payment confirmation button. + pub after_submit: Option, + /// Custom text that should be displayed alongside shipping address collection. + pub shipping_address: Option, + /// Custom text that should be displayed alongside the payment confirmation button. + pub submit: Option, + /// Custom text that should be displayed in place of the default terms of service agreement text. + pub terms_of_service_acceptance: + Option, +} diff --git a/generated/stripe_checkout/src/payment_pages_checkout_session_custom_text_position.rs b/generated/stripe_checkout/src/payment_pages_checkout_session_custom_text_position.rs new file mode 100644 index 000000000..513e59422 --- /dev/null +++ b/generated/stripe_checkout/src/payment_pages_checkout_session_custom_text_position.rs @@ -0,0 +1,5 @@ +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct PaymentPagesCheckoutSessionCustomTextPosition { + /// Text may be up to 1200 characters in length. + pub message: String, +} diff --git a/generated/stripe_checkout/src/payment_pages_checkout_session_customer_details.rs b/generated/stripe_checkout/src/payment_pages_checkout_session_customer_details.rs new file mode 100644 index 000000000..de0be4e3c --- /dev/null +++ b/generated/stripe_checkout/src/payment_pages_checkout_session_customer_details.rs @@ -0,0 +1,78 @@ +#[derive(Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct PaymentPagesCheckoutSessionCustomerDetails { + /// The customer's address after a completed Checkout Session. + /// Note: This property is populated only for sessions on or after March 30, 2022. + pub address: Option, + /// The email associated with the Customer, if one exists, on the Checkout Session after a completed Checkout Session or at time of session expiry. + /// Otherwise, if the customer has consented to promotional content, this value is the most recent valid email provided by the customer on the Checkout form. + pub email: Option, + /// The customer's name after a completed Checkout Session. + /// Note: This property is populated only for sessions on or after March 30, 2022. + pub name: Option, + /// The customer's phone number after a completed Checkout Session. + pub phone: Option, + /// The customer’s tax exempt status after a completed Checkout Session. + pub tax_exempt: Option, + /// The customer’s tax IDs after a completed Checkout Session. + pub tax_ids: Option>, +} +/// The customer’s tax exempt status after a completed Checkout Session. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum PaymentPagesCheckoutSessionCustomerDetailsTaxExempt { + Exempt, + None, + Reverse, +} +impl PaymentPagesCheckoutSessionCustomerDetailsTaxExempt { + pub fn as_str(self) -> &'static str { + use PaymentPagesCheckoutSessionCustomerDetailsTaxExempt::*; + match self { + Exempt => "exempt", + None => "none", + Reverse => "reverse", + } + } +} + +impl std::str::FromStr for PaymentPagesCheckoutSessionCustomerDetailsTaxExempt { + type Err = (); + fn from_str(s: &str) -> Result { + use PaymentPagesCheckoutSessionCustomerDetailsTaxExempt::*; + match s { + "exempt" => Ok(Exempt), + "none" => Ok(None), + "reverse" => Ok(Reverse), + _ => Err(()), + } + } +} +impl std::fmt::Display for PaymentPagesCheckoutSessionCustomerDetailsTaxExempt { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for PaymentPagesCheckoutSessionCustomerDetailsTaxExempt { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for PaymentPagesCheckoutSessionCustomerDetailsTaxExempt { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for PaymentPagesCheckoutSessionCustomerDetailsTaxExempt { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| { + serde::de::Error::custom( + "Unknown value for PaymentPagesCheckoutSessionCustomerDetailsTaxExempt", + ) + }) + } +} diff --git a/generated/stripe_checkout/src/payment_pages_checkout_session_invoice_creation.rs b/generated/stripe_checkout/src/payment_pages_checkout_session_invoice_creation.rs new file mode 100644 index 000000000..4fe0bf5be --- /dev/null +++ b/generated/stripe_checkout/src/payment_pages_checkout_session_invoice_creation.rs @@ -0,0 +1,6 @@ +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct PaymentPagesCheckoutSessionInvoiceCreation { + /// Indicates whether invoice creation is enabled for the Checkout Session. + pub enabled: bool, + pub invoice_data: stripe_checkout::PaymentPagesCheckoutSessionInvoiceSettings, +} diff --git a/generated/stripe_checkout/src/payment_pages_checkout_session_invoice_settings.rs b/generated/stripe_checkout/src/payment_pages_checkout_session_invoice_settings.rs new file mode 100644 index 000000000..677233882 --- /dev/null +++ b/generated/stripe_checkout/src/payment_pages_checkout_session_invoice_settings.rs @@ -0,0 +1,19 @@ +#[derive(Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct PaymentPagesCheckoutSessionInvoiceSettings { + /// The account tax IDs associated with the invoice. + pub account_tax_ids: Option>>, + /// Custom fields displayed on the invoice. + pub custom_fields: Option>, + /// An arbitrary string attached to the object. Often useful for displaying to users. + pub description: Option, + /// Footer displayed on the invoice. + pub footer: Option, + /// The connected account that issues the invoice. + /// The invoice is presented with the branding and support information of the specified account. + pub issuer: Option, + /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. + /// This can be useful for storing additional information about the object in a structured format. + pub metadata: Option>, + /// Options for invoice PDF rendering. + pub rendering_options: Option, +} diff --git a/generated/stripe_checkout/src/payment_pages_checkout_session_payment_method_reuse_agreement.rs b/generated/stripe_checkout/src/payment_pages_checkout_session_payment_method_reuse_agreement.rs new file mode 100644 index 000000000..67c8b855a --- /dev/null +++ b/generated/stripe_checkout/src/payment_pages_checkout_session_payment_method_reuse_agreement.rs @@ -0,0 +1,70 @@ +#[derive(Copy, Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct PaymentPagesCheckoutSessionPaymentMethodReuseAgreement { + /// Determines the position and visibility of the payment method reuse agreement in the UI. + /// When set to `auto`, Stripe's defaults will be used. + /// + /// When set to `hidden`, the payment method reuse agreement text will always be hidden in the UI. + pub position: PaymentPagesCheckoutSessionPaymentMethodReuseAgreementPosition, +} +/// Determines the position and visibility of the payment method reuse agreement in the UI. +/// When set to `auto`, Stripe's defaults will be used. +/// +/// When set to `hidden`, the payment method reuse agreement text will always be hidden in the UI. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum PaymentPagesCheckoutSessionPaymentMethodReuseAgreementPosition { + Auto, + Hidden, +} +impl PaymentPagesCheckoutSessionPaymentMethodReuseAgreementPosition { + pub fn as_str(self) -> &'static str { + use PaymentPagesCheckoutSessionPaymentMethodReuseAgreementPosition::*; + match self { + Auto => "auto", + Hidden => "hidden", + } + } +} + +impl std::str::FromStr for PaymentPagesCheckoutSessionPaymentMethodReuseAgreementPosition { + type Err = (); + fn from_str(s: &str) -> Result { + use PaymentPagesCheckoutSessionPaymentMethodReuseAgreementPosition::*; + match s { + "auto" => Ok(Auto), + "hidden" => Ok(Hidden), + _ => Err(()), + } + } +} +impl std::fmt::Display for PaymentPagesCheckoutSessionPaymentMethodReuseAgreementPosition { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for PaymentPagesCheckoutSessionPaymentMethodReuseAgreementPosition { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for PaymentPagesCheckoutSessionPaymentMethodReuseAgreementPosition { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> + for PaymentPagesCheckoutSessionPaymentMethodReuseAgreementPosition +{ + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| { + serde::de::Error::custom( + "Unknown value for PaymentPagesCheckoutSessionPaymentMethodReuseAgreementPosition", + ) + }) + } +} diff --git a/generated/stripe_checkout/src/payment_pages_checkout_session_phone_number_collection.rs b/generated/stripe_checkout/src/payment_pages_checkout_session_phone_number_collection.rs new file mode 100644 index 000000000..956b63542 --- /dev/null +++ b/generated/stripe_checkout/src/payment_pages_checkout_session_phone_number_collection.rs @@ -0,0 +1,5 @@ +#[derive(Copy, Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct PaymentPagesCheckoutSessionPhoneNumberCollection { + /// Indicates whether phone number collection is enabled for the session + pub enabled: bool, +} diff --git a/generated/stripe_checkout/src/payment_pages_checkout_session_shipping_address_collection.rs b/generated/stripe_checkout/src/payment_pages_checkout_session_shipping_address_collection.rs new file mode 100644 index 000000000..29133a8ad --- /dev/null +++ b/generated/stripe_checkout/src/payment_pages_checkout_session_shipping_address_collection.rs @@ -0,0 +1,776 @@ +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct PaymentPagesCheckoutSessionShippingAddressCollection { + /// An array of two-letter ISO country codes representing which countries Checkout should provide as options for. + /// shipping locations. + /// Unsupported country codes: `AS, CX, CC, CU, HM, IR, KP, MH, FM, NF, MP, PW, SD, SY, UM, VI`. + pub allowed_countries: + Vec, +} +/// An array of two-letter ISO country codes representing which countries Checkout should provide as options for. +/// shipping locations. +/// Unsupported country codes: `AS, CX, CC, CU, HM, IR, KP, MH, FM, NF, MP, PW, SD, SY, UM, VI`. +#[derive(Copy, Clone, Eq, PartialEq)] +#[non_exhaustive] +pub enum PaymentPagesCheckoutSessionShippingAddressCollectionAllowedCountries { + Ac, + Ad, + Ae, + Af, + Ag, + Ai, + Al, + Am, + Ao, + Aq, + Ar, + At, + Au, + Aw, + Ax, + Az, + Ba, + Bb, + Bd, + Be, + Bf, + Bg, + Bh, + Bi, + Bj, + Bl, + Bm, + Bn, + Bo, + Bq, + Br, + Bs, + Bt, + Bv, + Bw, + By, + Bz, + Ca, + Cd, + Cf, + Cg, + Ch, + Ci, + Ck, + Cl, + Cm, + Cn, + Co, + Cr, + Cv, + Cw, + Cy, + Cz, + De, + Dj, + Dk, + Dm, + Do, + Dz, + Ec, + Ee, + Eg, + Eh, + Er, + Es, + Et, + Fi, + Fj, + Fk, + Fo, + Fr, + Ga, + Gb, + Gd, + Ge, + Gf, + Gg, + Gh, + Gi, + Gl, + Gm, + Gn, + Gp, + Gq, + Gr, + Gs, + Gt, + Gu, + Gw, + Gy, + Hk, + Hn, + Hr, + Ht, + Hu, + Id, + Ie, + Il, + Im, + In, + Io, + Iq, + Is, + It, + Je, + Jm, + Jo, + Jp, + Ke, + Kg, + Kh, + Ki, + Km, + Kn, + Kr, + Kw, + Ky, + Kz, + La, + Lb, + Lc, + Li, + Lk, + Lr, + Ls, + Lt, + Lu, + Lv, + Ly, + Ma, + Mc, + Md, + Me, + Mf, + Mg, + Mk, + Ml, + Mm, + Mn, + Mo, + Mq, + Mr, + Ms, + Mt, + Mu, + Mv, + Mw, + Mx, + My, + Mz, + Na, + Nc, + Ne, + Ng, + Ni, + Nl, + No, + Np, + Nr, + Nu, + Nz, + Om, + Pa, + Pe, + Pf, + Pg, + Ph, + Pk, + Pl, + Pm, + Pn, + Pr, + Ps, + Pt, + Py, + Qa, + Re, + Ro, + Rs, + Ru, + Rw, + Sa, + Sb, + Sc, + Se, + Sg, + Sh, + Si, + Sj, + Sk, + Sl, + Sm, + Sn, + So, + Sr, + Ss, + St, + Sv, + Sx, + Sz, + Ta, + Tc, + Td, + Tf, + Tg, + Th, + Tj, + Tk, + Tl, + Tm, + Tn, + To, + Tr, + Tt, + Tv, + Tw, + Tz, + Ua, + Ug, + Us, + Uy, + Uz, + Va, + Vc, + Ve, + Vg, + Vn, + Vu, + Wf, + Ws, + Xk, + Ye, + Yt, + Za, + Zm, + Zw, + Zz, + /// An unrecognized value from Stripe. Should not be used as a request parameter. + Unknown, +} +impl PaymentPagesCheckoutSessionShippingAddressCollectionAllowedCountries { + pub fn as_str(self) -> &'static str { + use PaymentPagesCheckoutSessionShippingAddressCollectionAllowedCountries::*; + match self { + Ac => "AC", + Ad => "AD", + Ae => "AE", + Af => "AF", + Ag => "AG", + Ai => "AI", + Al => "AL", + Am => "AM", + Ao => "AO", + Aq => "AQ", + Ar => "AR", + At => "AT", + Au => "AU", + Aw => "AW", + Ax => "AX", + Az => "AZ", + Ba => "BA", + Bb => "BB", + Bd => "BD", + Be => "BE", + Bf => "BF", + Bg => "BG", + Bh => "BH", + Bi => "BI", + Bj => "BJ", + Bl => "BL", + Bm => "BM", + Bn => "BN", + Bo => "BO", + Bq => "BQ", + Br => "BR", + Bs => "BS", + Bt => "BT", + Bv => "BV", + Bw => "BW", + By => "BY", + Bz => "BZ", + Ca => "CA", + Cd => "CD", + Cf => "CF", + Cg => "CG", + Ch => "CH", + Ci => "CI", + Ck => "CK", + Cl => "CL", + Cm => "CM", + Cn => "CN", + Co => "CO", + Cr => "CR", + Cv => "CV", + Cw => "CW", + Cy => "CY", + Cz => "CZ", + De => "DE", + Dj => "DJ", + Dk => "DK", + Dm => "DM", + Do => "DO", + Dz => "DZ", + Ec => "EC", + Ee => "EE", + Eg => "EG", + Eh => "EH", + Er => "ER", + Es => "ES", + Et => "ET", + Fi => "FI", + Fj => "FJ", + Fk => "FK", + Fo => "FO", + Fr => "FR", + Ga => "GA", + Gb => "GB", + Gd => "GD", + Ge => "GE", + Gf => "GF", + Gg => "GG", + Gh => "GH", + Gi => "GI", + Gl => "GL", + Gm => "GM", + Gn => "GN", + Gp => "GP", + Gq => "GQ", + Gr => "GR", + Gs => "GS", + Gt => "GT", + Gu => "GU", + Gw => "GW", + Gy => "GY", + Hk => "HK", + Hn => "HN", + Hr => "HR", + Ht => "HT", + Hu => "HU", + Id => "ID", + Ie => "IE", + Il => "IL", + Im => "IM", + In => "IN", + Io => "IO", + Iq => "IQ", + Is => "IS", + It => "IT", + Je => "JE", + Jm => "JM", + Jo => "JO", + Jp => "JP", + Ke => "KE", + Kg => "KG", + Kh => "KH", + Ki => "KI", + Km => "KM", + Kn => "KN", + Kr => "KR", + Kw => "KW", + Ky => "KY", + Kz => "KZ", + La => "LA", + Lb => "LB", + Lc => "LC", + Li => "LI", + Lk => "LK", + Lr => "LR", + Ls => "LS", + Lt => "LT", + Lu => "LU", + Lv => "LV", + Ly => "LY", + Ma => "MA", + Mc => "MC", + Md => "MD", + Me => "ME", + Mf => "MF", + Mg => "MG", + Mk => "MK", + Ml => "ML", + Mm => "MM", + Mn => "MN", + Mo => "MO", + Mq => "MQ", + Mr => "MR", + Ms => "MS", + Mt => "MT", + Mu => "MU", + Mv => "MV", + Mw => "MW", + Mx => "MX", + My => "MY", + Mz => "MZ", + Na => "NA", + Nc => "NC", + Ne => "NE", + Ng => "NG", + Ni => "NI", + Nl => "NL", + No => "NO", + Np => "NP", + Nr => "NR", + Nu => "NU", + Nz => "NZ", + Om => "OM", + Pa => "PA", + Pe => "PE", + Pf => "PF", + Pg => "PG", + Ph => "PH", + Pk => "PK", + Pl => "PL", + Pm => "PM", + Pn => "PN", + Pr => "PR", + Ps => "PS", + Pt => "PT", + Py => "PY", + Qa => "QA", + Re => "RE", + Ro => "RO", + Rs => "RS", + Ru => "RU", + Rw => "RW", + Sa => "SA", + Sb => "SB", + Sc => "SC", + Se => "SE", + Sg => "SG", + Sh => "SH", + Si => "SI", + Sj => "SJ", + Sk => "SK", + Sl => "SL", + Sm => "SM", + Sn => "SN", + So => "SO", + Sr => "SR", + Ss => "SS", + St => "ST", + Sv => "SV", + Sx => "SX", + Sz => "SZ", + Ta => "TA", + Tc => "TC", + Td => "TD", + Tf => "TF", + Tg => "TG", + Th => "TH", + Tj => "TJ", + Tk => "TK", + Tl => "TL", + Tm => "TM", + Tn => "TN", + To => "TO", + Tr => "TR", + Tt => "TT", + Tv => "TV", + Tw => "TW", + Tz => "TZ", + Ua => "UA", + Ug => "UG", + Us => "US", + Uy => "UY", + Uz => "UZ", + Va => "VA", + Vc => "VC", + Ve => "VE", + Vg => "VG", + Vn => "VN", + Vu => "VU", + Wf => "WF", + Ws => "WS", + Xk => "XK", + Ye => "YE", + Yt => "YT", + Za => "ZA", + Zm => "ZM", + Zw => "ZW", + Zz => "ZZ", + Unknown => "unknown", + } + } +} + +impl std::str::FromStr for PaymentPagesCheckoutSessionShippingAddressCollectionAllowedCountries { + type Err = (); + fn from_str(s: &str) -> Result { + use PaymentPagesCheckoutSessionShippingAddressCollectionAllowedCountries::*; + match s { + "AC" => Ok(Ac), + "AD" => Ok(Ad), + "AE" => Ok(Ae), + "AF" => Ok(Af), + "AG" => Ok(Ag), + "AI" => Ok(Ai), + "AL" => Ok(Al), + "AM" => Ok(Am), + "AO" => Ok(Ao), + "AQ" => Ok(Aq), + "AR" => Ok(Ar), + "AT" => Ok(At), + "AU" => Ok(Au), + "AW" => Ok(Aw), + "AX" => Ok(Ax), + "AZ" => Ok(Az), + "BA" => Ok(Ba), + "BB" => Ok(Bb), + "BD" => Ok(Bd), + "BE" => Ok(Be), + "BF" => Ok(Bf), + "BG" => Ok(Bg), + "BH" => Ok(Bh), + "BI" => Ok(Bi), + "BJ" => Ok(Bj), + "BL" => Ok(Bl), + "BM" => Ok(Bm), + "BN" => Ok(Bn), + "BO" => Ok(Bo), + "BQ" => Ok(Bq), + "BR" => Ok(Br), + "BS" => Ok(Bs), + "BT" => Ok(Bt), + "BV" => Ok(Bv), + "BW" => Ok(Bw), + "BY" => Ok(By), + "BZ" => Ok(Bz), + "CA" => Ok(Ca), + "CD" => Ok(Cd), + "CF" => Ok(Cf), + "CG" => Ok(Cg), + "CH" => Ok(Ch), + "CI" => Ok(Ci), + "CK" => Ok(Ck), + "CL" => Ok(Cl), + "CM" => Ok(Cm), + "CN" => Ok(Cn), + "CO" => Ok(Co), + "CR" => Ok(Cr), + "CV" => Ok(Cv), + "CW" => Ok(Cw), + "CY" => Ok(Cy), + "CZ" => Ok(Cz), + "DE" => Ok(De), + "DJ" => Ok(Dj), + "DK" => Ok(Dk), + "DM" => Ok(Dm), + "DO" => Ok(Do), + "DZ" => Ok(Dz), + "EC" => Ok(Ec), + "EE" => Ok(Ee), + "EG" => Ok(Eg), + "EH" => Ok(Eh), + "ER" => Ok(Er), + "ES" => Ok(Es), + "ET" => Ok(Et), + "FI" => Ok(Fi), + "FJ" => Ok(Fj), + "FK" => Ok(Fk), + "FO" => Ok(Fo), + "FR" => Ok(Fr), + "GA" => Ok(Ga), + "GB" => Ok(Gb), + "GD" => Ok(Gd), + "GE" => Ok(Ge), + "GF" => Ok(Gf), + "GG" => Ok(Gg), + "GH" => Ok(Gh), + "GI" => Ok(Gi), + "GL" => Ok(Gl), + "GM" => Ok(Gm), + "GN" => Ok(Gn), + "GP" => Ok(Gp), + "GQ" => Ok(Gq), + "GR" => Ok(Gr), + "GS" => Ok(Gs), + "GT" => Ok(Gt), + "GU" => Ok(Gu), + "GW" => Ok(Gw), + "GY" => Ok(Gy), + "HK" => Ok(Hk), + "HN" => Ok(Hn), + "HR" => Ok(Hr), + "HT" => Ok(Ht), + "HU" => Ok(Hu), + "ID" => Ok(Id), + "IE" => Ok(Ie), + "IL" => Ok(Il), + "IM" => Ok(Im), + "IN" => Ok(In), + "IO" => Ok(Io), + "IQ" => Ok(Iq), + "IS" => Ok(Is), + "IT" => Ok(It), + "JE" => Ok(Je), + "JM" => Ok(Jm), + "JO" => Ok(Jo), + "JP" => Ok(Jp), + "KE" => Ok(Ke), + "KG" => Ok(Kg), + "KH" => Ok(Kh), + "KI" => Ok(Ki), + "KM" => Ok(Km), + "KN" => Ok(Kn), + "KR" => Ok(Kr), + "KW" => Ok(Kw), + "KY" => Ok(Ky), + "KZ" => Ok(Kz), + "LA" => Ok(La), + "LB" => Ok(Lb), + "LC" => Ok(Lc), + "LI" => Ok(Li), + "LK" => Ok(Lk), + "LR" => Ok(Lr), + "LS" => Ok(Ls), + "LT" => Ok(Lt), + "LU" => Ok(Lu), + "LV" => Ok(Lv), + "LY" => Ok(Ly), + "MA" => Ok(Ma), + "MC" => Ok(Mc), + "MD" => Ok(Md), + "ME" => Ok(Me), + "MF" => Ok(Mf), + "MG" => Ok(Mg), + "MK" => Ok(Mk), + "ML" => Ok(Ml), + "MM" => Ok(Mm), + "MN" => Ok(Mn), + "MO" => Ok(Mo), + "MQ" => Ok(Mq), + "MR" => Ok(Mr), + "MS" => Ok(Ms), + "MT" => Ok(Mt), + "MU" => Ok(Mu), + "MV" => Ok(Mv), + "MW" => Ok(Mw), + "MX" => Ok(Mx), + "MY" => Ok(My), + "MZ" => Ok(Mz), + "NA" => Ok(Na), + "NC" => Ok(Nc), + "NE" => Ok(Ne), + "NG" => Ok(Ng), + "NI" => Ok(Ni), + "NL" => Ok(Nl), + "NO" => Ok(No), + "NP" => Ok(Np), + "NR" => Ok(Nr), + "NU" => Ok(Nu), + "NZ" => Ok(Nz), + "OM" => Ok(Om), + "PA" => Ok(Pa), + "PE" => Ok(Pe), + "PF" => Ok(Pf), + "PG" => Ok(Pg), + "PH" => Ok(Ph), + "PK" => Ok(Pk), + "PL" => Ok(Pl), + "PM" => Ok(Pm), + "PN" => Ok(Pn), + "PR" => Ok(Pr), + "PS" => Ok(Ps), + "PT" => Ok(Pt), + "PY" => Ok(Py), + "QA" => Ok(Qa), + "RE" => Ok(Re), + "RO" => Ok(Ro), + "RS" => Ok(Rs), + "RU" => Ok(Ru), + "RW" => Ok(Rw), + "SA" => Ok(Sa), + "SB" => Ok(Sb), + "SC" => Ok(Sc), + "SE" => Ok(Se), + "SG" => Ok(Sg), + "SH" => Ok(Sh), + "SI" => Ok(Si), + "SJ" => Ok(Sj), + "SK" => Ok(Sk), + "SL" => Ok(Sl), + "SM" => Ok(Sm), + "SN" => Ok(Sn), + "SO" => Ok(So), + "SR" => Ok(Sr), + "SS" => Ok(Ss), + "ST" => Ok(St), + "SV" => Ok(Sv), + "SX" => Ok(Sx), + "SZ" => Ok(Sz), + "TA" => Ok(Ta), + "TC" => Ok(Tc), + "TD" => Ok(Td), + "TF" => Ok(Tf), + "TG" => Ok(Tg), + "TH" => Ok(Th), + "TJ" => Ok(Tj), + "TK" => Ok(Tk), + "TL" => Ok(Tl), + "TM" => Ok(Tm), + "TN" => Ok(Tn), + "TO" => Ok(To), + "TR" => Ok(Tr), + "TT" => Ok(Tt), + "TV" => Ok(Tv), + "TW" => Ok(Tw), + "TZ" => Ok(Tz), + "UA" => Ok(Ua), + "UG" => Ok(Ug), + "US" => Ok(Us), + "UY" => Ok(Uy), + "UZ" => Ok(Uz), + "VA" => Ok(Va), + "VC" => Ok(Vc), + "VE" => Ok(Ve), + "VG" => Ok(Vg), + "VN" => Ok(Vn), + "VU" => Ok(Vu), + "WF" => Ok(Wf), + "WS" => Ok(Ws), + "XK" => Ok(Xk), + "YE" => Ok(Ye), + "YT" => Ok(Yt), + "ZA" => Ok(Za), + "ZM" => Ok(Zm), + "ZW" => Ok(Zw), + "ZZ" => Ok(Zz), + _ => Err(()), + } + } +} +impl std::fmt::Display for PaymentPagesCheckoutSessionShippingAddressCollectionAllowedCountries { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for PaymentPagesCheckoutSessionShippingAddressCollectionAllowedCountries { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for PaymentPagesCheckoutSessionShippingAddressCollectionAllowedCountries { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> + for PaymentPagesCheckoutSessionShippingAddressCollectionAllowedCountries +{ + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Ok(Self::from_str(&s).unwrap_or( + PaymentPagesCheckoutSessionShippingAddressCollectionAllowedCountries::Unknown, + )) + } +} diff --git a/generated/stripe_checkout/src/payment_pages_checkout_session_shipping_cost.rs b/generated/stripe_checkout/src/payment_pages_checkout_session_shipping_cost.rs new file mode 100644 index 000000000..4ad97b8b7 --- /dev/null +++ b/generated/stripe_checkout/src/payment_pages_checkout_session_shipping_cost.rs @@ -0,0 +1,14 @@ +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct PaymentPagesCheckoutSessionShippingCost { + /// Total shipping cost before any discounts or taxes are applied. + pub amount_subtotal: i64, + /// Total tax amount applied due to shipping costs. If no tax was applied, defaults to 0. + pub amount_tax: i64, + /// Total shipping cost after discounts and taxes are applied. + pub amount_total: i64, + /// The ID of the ShippingRate for this order. + pub shipping_rate: Option>, + /// The taxes applied to the shipping rate. + #[serde(skip_serializing_if = "Option::is_none")] + pub taxes: Option>, +} diff --git a/generated/stripe_checkout/src/payment_pages_checkout_session_shipping_option.rs b/generated/stripe_checkout/src/payment_pages_checkout_session_shipping_option.rs new file mode 100644 index 000000000..c7147247d --- /dev/null +++ b/generated/stripe_checkout/src/payment_pages_checkout_session_shipping_option.rs @@ -0,0 +1,7 @@ +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct PaymentPagesCheckoutSessionShippingOption { + /// A non-negative integer in cents representing how much to charge. + pub shipping_amount: i64, + /// The shipping rate. + pub shipping_rate: stripe_types::Expandable, +} diff --git a/generated/stripe_checkout/src/payment_pages_checkout_session_tax_id.rs b/generated/stripe_checkout/src/payment_pages_checkout_session_tax_id.rs new file mode 100644 index 000000000..9baf50795 --- /dev/null +++ b/generated/stripe_checkout/src/payment_pages_checkout_session_tax_id.rs @@ -0,0 +1,258 @@ +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct PaymentPagesCheckoutSessionTaxId { + /// The type of the tax ID, one of `ad_nrt`, `ar_cuit`, `eu_vat`, `bo_tin`, `br_cnpj`, `br_cpf`, `cn_tin`, `co_nit`, `cr_tin`, `do_rcn`, `ec_ruc`, `eu_oss_vat`, `pe_ruc`, `ro_tin`, `rs_pib`, `sv_nit`, `uy_ruc`, `ve_rif`, `vn_tin`, `gb_vat`, `nz_gst`, `au_abn`, `au_arn`, `in_gst`, `no_vat`, `za_vat`, `ch_vat`, `mx_rfc`, `sg_uen`, `ru_inn`, `ru_kpp`, `ca_bn`, `hk_br`, `es_cif`, `tw_vat`, `th_vat`, `jp_cn`, `jp_rn`, `jp_trn`, `li_uid`, `my_itn`, `us_ein`, `kr_brn`, `ca_qst`, `ca_gst_hst`, `ca_pst_bc`, `ca_pst_mb`, `ca_pst_sk`, `my_sst`, `sg_gst`, `ae_trn`, `cl_tin`, `sa_vat`, `id_npwp`, `my_frp`, `il_vat`, `ge_vat`, `ua_vat`, `is_vat`, `bg_uic`, `hu_tin`, `si_tin`, `ke_pin`, `tr_tin`, `eg_tin`, `ph_tin`, or `unknown`. + #[serde(rename = "type")] + pub type_: PaymentPagesCheckoutSessionTaxIdType, + /// The value of the tax ID. + pub value: Option, +} +/// The type of the tax ID, one of `ad_nrt`, `ar_cuit`, `eu_vat`, `bo_tin`, `br_cnpj`, `br_cpf`, `cn_tin`, `co_nit`, `cr_tin`, `do_rcn`, `ec_ruc`, `eu_oss_vat`, `pe_ruc`, `ro_tin`, `rs_pib`, `sv_nit`, `uy_ruc`, `ve_rif`, `vn_tin`, `gb_vat`, `nz_gst`, `au_abn`, `au_arn`, `in_gst`, `no_vat`, `za_vat`, `ch_vat`, `mx_rfc`, `sg_uen`, `ru_inn`, `ru_kpp`, `ca_bn`, `hk_br`, `es_cif`, `tw_vat`, `th_vat`, `jp_cn`, `jp_rn`, `jp_trn`, `li_uid`, `my_itn`, `us_ein`, `kr_brn`, `ca_qst`, `ca_gst_hst`, `ca_pst_bc`, `ca_pst_mb`, `ca_pst_sk`, `my_sst`, `sg_gst`, `ae_trn`, `cl_tin`, `sa_vat`, `id_npwp`, `my_frp`, `il_vat`, `ge_vat`, `ua_vat`, `is_vat`, `bg_uic`, `hu_tin`, `si_tin`, `ke_pin`, `tr_tin`, `eg_tin`, `ph_tin`, or `unknown`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum PaymentPagesCheckoutSessionTaxIdType { + AdNrt, + AeTrn, + ArCuit, + AuAbn, + AuArn, + BgUic, + BoTin, + BrCnpj, + BrCpf, + CaBn, + CaGstHst, + CaPstBc, + CaPstMb, + CaPstSk, + CaQst, + ChVat, + ClTin, + CnTin, + CoNit, + CrTin, + DoRcn, + EcRuc, + EgTin, + EsCif, + EuOssVat, + EuVat, + GbVat, + GeVat, + HkBr, + HuTin, + IdNpwp, + IlVat, + InGst, + IsVat, + JpCn, + JpRn, + JpTrn, + KePin, + KrBrn, + LiUid, + MxRfc, + MyFrp, + MyItn, + MySst, + NoVat, + NzGst, + PeRuc, + PhTin, + RoTin, + RsPib, + RuInn, + RuKpp, + SaVat, + SgGst, + SgUen, + SiTin, + SvNit, + ThVat, + TrTin, + TwVat, + UaVat, + Unknown, + UsEin, + UyRuc, + VeRif, + VnTin, + ZaVat, +} +impl PaymentPagesCheckoutSessionTaxIdType { + pub fn as_str(self) -> &'static str { + use PaymentPagesCheckoutSessionTaxIdType::*; + match self { + AdNrt => "ad_nrt", + AeTrn => "ae_trn", + ArCuit => "ar_cuit", + AuAbn => "au_abn", + AuArn => "au_arn", + BgUic => "bg_uic", + BoTin => "bo_tin", + BrCnpj => "br_cnpj", + BrCpf => "br_cpf", + CaBn => "ca_bn", + CaGstHst => "ca_gst_hst", + CaPstBc => "ca_pst_bc", + CaPstMb => "ca_pst_mb", + CaPstSk => "ca_pst_sk", + CaQst => "ca_qst", + ChVat => "ch_vat", + ClTin => "cl_tin", + CnTin => "cn_tin", + CoNit => "co_nit", + CrTin => "cr_tin", + DoRcn => "do_rcn", + EcRuc => "ec_ruc", + EgTin => "eg_tin", + EsCif => "es_cif", + EuOssVat => "eu_oss_vat", + EuVat => "eu_vat", + GbVat => "gb_vat", + GeVat => "ge_vat", + HkBr => "hk_br", + HuTin => "hu_tin", + IdNpwp => "id_npwp", + IlVat => "il_vat", + InGst => "in_gst", + IsVat => "is_vat", + JpCn => "jp_cn", + JpRn => "jp_rn", + JpTrn => "jp_trn", + KePin => "ke_pin", + KrBrn => "kr_brn", + LiUid => "li_uid", + MxRfc => "mx_rfc", + MyFrp => "my_frp", + MyItn => "my_itn", + MySst => "my_sst", + NoVat => "no_vat", + NzGst => "nz_gst", + PeRuc => "pe_ruc", + PhTin => "ph_tin", + RoTin => "ro_tin", + RsPib => "rs_pib", + RuInn => "ru_inn", + RuKpp => "ru_kpp", + SaVat => "sa_vat", + SgGst => "sg_gst", + SgUen => "sg_uen", + SiTin => "si_tin", + SvNit => "sv_nit", + ThVat => "th_vat", + TrTin => "tr_tin", + TwVat => "tw_vat", + UaVat => "ua_vat", + Unknown => "unknown", + UsEin => "us_ein", + UyRuc => "uy_ruc", + VeRif => "ve_rif", + VnTin => "vn_tin", + ZaVat => "za_vat", + } + } +} + +impl std::str::FromStr for PaymentPagesCheckoutSessionTaxIdType { + type Err = (); + fn from_str(s: &str) -> Result { + use PaymentPagesCheckoutSessionTaxIdType::*; + match s { + "ad_nrt" => Ok(AdNrt), + "ae_trn" => Ok(AeTrn), + "ar_cuit" => Ok(ArCuit), + "au_abn" => Ok(AuAbn), + "au_arn" => Ok(AuArn), + "bg_uic" => Ok(BgUic), + "bo_tin" => Ok(BoTin), + "br_cnpj" => Ok(BrCnpj), + "br_cpf" => Ok(BrCpf), + "ca_bn" => Ok(CaBn), + "ca_gst_hst" => Ok(CaGstHst), + "ca_pst_bc" => Ok(CaPstBc), + "ca_pst_mb" => Ok(CaPstMb), + "ca_pst_sk" => Ok(CaPstSk), + "ca_qst" => Ok(CaQst), + "ch_vat" => Ok(ChVat), + "cl_tin" => Ok(ClTin), + "cn_tin" => Ok(CnTin), + "co_nit" => Ok(CoNit), + "cr_tin" => Ok(CrTin), + "do_rcn" => Ok(DoRcn), + "ec_ruc" => Ok(EcRuc), + "eg_tin" => Ok(EgTin), + "es_cif" => Ok(EsCif), + "eu_oss_vat" => Ok(EuOssVat), + "eu_vat" => Ok(EuVat), + "gb_vat" => Ok(GbVat), + "ge_vat" => Ok(GeVat), + "hk_br" => Ok(HkBr), + "hu_tin" => Ok(HuTin), + "id_npwp" => Ok(IdNpwp), + "il_vat" => Ok(IlVat), + "in_gst" => Ok(InGst), + "is_vat" => Ok(IsVat), + "jp_cn" => Ok(JpCn), + "jp_rn" => Ok(JpRn), + "jp_trn" => Ok(JpTrn), + "ke_pin" => Ok(KePin), + "kr_brn" => Ok(KrBrn), + "li_uid" => Ok(LiUid), + "mx_rfc" => Ok(MxRfc), + "my_frp" => Ok(MyFrp), + "my_itn" => Ok(MyItn), + "my_sst" => Ok(MySst), + "no_vat" => Ok(NoVat), + "nz_gst" => Ok(NzGst), + "pe_ruc" => Ok(PeRuc), + "ph_tin" => Ok(PhTin), + "ro_tin" => Ok(RoTin), + "rs_pib" => Ok(RsPib), + "ru_inn" => Ok(RuInn), + "ru_kpp" => Ok(RuKpp), + "sa_vat" => Ok(SaVat), + "sg_gst" => Ok(SgGst), + "sg_uen" => Ok(SgUen), + "si_tin" => Ok(SiTin), + "sv_nit" => Ok(SvNit), + "th_vat" => Ok(ThVat), + "tr_tin" => Ok(TrTin), + "tw_vat" => Ok(TwVat), + "ua_vat" => Ok(UaVat), + "unknown" => Ok(Unknown), + "us_ein" => Ok(UsEin), + "uy_ruc" => Ok(UyRuc), + "ve_rif" => Ok(VeRif), + "vn_tin" => Ok(VnTin), + "za_vat" => Ok(ZaVat), + _ => Err(()), + } + } +} +impl std::fmt::Display for PaymentPagesCheckoutSessionTaxIdType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for PaymentPagesCheckoutSessionTaxIdType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for PaymentPagesCheckoutSessionTaxIdType { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for PaymentPagesCheckoutSessionTaxIdType { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| { + serde::de::Error::custom("Unknown value for PaymentPagesCheckoutSessionTaxIdType") + }) + } +} diff --git a/generated/stripe_checkout/src/payment_pages_checkout_session_tax_id_collection.rs b/generated/stripe_checkout/src/payment_pages_checkout_session_tax_id_collection.rs new file mode 100644 index 000000000..8049e91fb --- /dev/null +++ b/generated/stripe_checkout/src/payment_pages_checkout_session_tax_id_collection.rs @@ -0,0 +1,5 @@ +#[derive(Copy, Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct PaymentPagesCheckoutSessionTaxIdCollection { + /// Indicates whether tax ID collection is enabled for the session + pub enabled: bool, +} diff --git a/generated/stripe_checkout/src/payment_pages_checkout_session_total_details.rs b/generated/stripe_checkout/src/payment_pages_checkout_session_total_details.rs new file mode 100644 index 000000000..14888f396 --- /dev/null +++ b/generated/stripe_checkout/src/payment_pages_checkout_session_total_details.rs @@ -0,0 +1,12 @@ +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct PaymentPagesCheckoutSessionTotalDetails { + /// This is the sum of all the discounts. + pub amount_discount: i64, + /// This is the sum of all the shipping amounts. + pub amount_shipping: Option, + /// This is the sum of all the tax amounts. + pub amount_tax: i64, + #[serde(skip_serializing_if = "Option::is_none")] + pub breakdown: + Option, +} diff --git a/generated/stripe_checkout/src/payment_pages_checkout_session_total_details_resource_breakdown.rs b/generated/stripe_checkout/src/payment_pages_checkout_session_total_details_resource_breakdown.rs new file mode 100644 index 000000000..ff1083411 --- /dev/null +++ b/generated/stripe_checkout/src/payment_pages_checkout_session_total_details_resource_breakdown.rs @@ -0,0 +1,7 @@ +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct PaymentPagesCheckoutSessionTotalDetailsResourceBreakdown { + /// The aggregated discounts. + pub discounts: Vec, + /// The aggregated tax amounts by rate. + pub taxes: Vec, +} diff --git a/generated/stripe_connect/Cargo.toml b/generated/stripe_connect/Cargo.toml new file mode 100644 index 000000000..095e49cd5 --- /dev/null +++ b/generated/stripe_connect/Cargo.toml @@ -0,0 +1,72 @@ +[package] +name = "stripe_connect" +version.workspace = true +description.workspace = true +edition.workspace = true +rust-version.workspace = true +authors.workspace = true +license.workspace = true +homepage.workspace = true +repository.workspace = true +keywords.workspace = true +categories.workspace = true + +[lib] +path = "src/mod.rs" + +[dependencies] +serde.workspace = true +smol_str.workspace = true +serde_json.workspace = true +stripe_types = {path = "../../stripe_types"} + +http-types.workspace = true +async-stripe = {path = "../../async-stripe"} + + +stripe_shared = {path = "../../generated/stripe_shared"} + + +[features] +runtime-tokio-hyper = ["async-stripe/runtime-tokio-hyper"] +runtime-tokio-hyper-rustls = ["async-stripe/runtime-tokio-hyper-rustls"] +runtime-tokio-hyper-rustls-webpki = ["async-stripe/runtime-tokio-hyper-rustls-webpki"] +runtime-blocking = ["async-stripe/runtime-blocking"] +runtime-blocking-rustls = ["async-stripe/runtime-blocking-rustls"] +runtime-blocking-rustls-webpki = ["async-stripe/runtime-blocking-rustls-webpki"] +runtime-async-std-surf = ["async-stripe/runtime-async-std-surf"] + +account = [] +account_link = [] +account_session = [] +application_fee = [] +application_fee_refund = [] +apps_secret = [] +capability = [] +country_spec = [] +external_account = [] +login_link = [] +person = [] +topup = [] +transfer = [] +transfer_reversal = [] + +full = ["account", +"account_link", +"account_session", +"application_fee", +"application_fee_refund", +"apps_secret", +"capability", +"country_spec", +"external_account", +"login_link", +"person", +"topup", +"transfer", +"transfer_reversal"] + + +[package.metadata.docs.rs] +features = ["runtime-tokio-hyper", "full"] + diff --git a/generated/stripe_connect/src/account/mod.rs b/generated/stripe_connect/src/account/mod.rs new file mode 100644 index 000000000..cd95e36b9 --- /dev/null +++ b/generated/stripe_connect/src/account/mod.rs @@ -0,0 +1,4 @@ +#[cfg(feature = "account")] +mod requests; +#[cfg(feature = "account")] +pub use requests::*; diff --git a/generated/stripe_connect/src/account/requests.rs b/generated/stripe_connect/src/account/requests.rs new file mode 100644 index 000000000..728713933 --- /dev/null +++ b/generated/stripe_connect/src/account/requests.rs @@ -0,0 +1,2275 @@ +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct DeleteAccount {} +impl DeleteAccount { + pub fn new() -> Self { + Self::default() + } +} +impl DeleteAccount { + /// With [Connect](https://stripe.com/docs/connect), you can delete accounts you manage. + /// + /// Accounts created using test-mode keys can be deleted at any time. + /// Standard accounts created using live-mode keys cannot be deleted. + /// Custom or Express accounts created using live-mode keys can only be deleted once all balances are zero. + /// + /// If you want to delete your own account, use the [account information tab in your account settings](https://dashboard.stripe.com/settings/account) instead. + pub fn send( + &self, + client: &stripe::Client, + account: &stripe_shared::AccountId, + ) -> stripe::Response { + client.send_form(&format!("/accounts/{account}"), self, http_types::Method::Delete) + } +} +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct RetrieveForMyAccountAccount<'a> { + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, +} +impl<'a> RetrieveForMyAccountAccount<'a> { + pub fn new() -> Self { + Self::default() + } +} +impl<'a> RetrieveForMyAccountAccount<'a> { + /// Retrieves the details of an account. + pub fn send(&self, client: &stripe::Client) -> stripe::Response { + client.get_query("/account", self) + } +} +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct ListAccount<'a> { + #[serde(skip_serializing_if = "Option::is_none")] + pub created: Option, + /// A cursor for use in pagination. + /// `ending_before` is an object ID that defines your place in the list. + /// For instance, if you make a list request and receive 100 objects, starting with `obj_bar`, your subsequent call can include `ending_before=obj_bar` in order to fetch the previous page of the list. + #[serde(skip_serializing_if = "Option::is_none")] + pub ending_before: Option<&'a str>, + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, + /// A limit on the number of objects to be returned. + /// Limit can range between 1 and 100, and the default is 10. + #[serde(skip_serializing_if = "Option::is_none")] + pub limit: Option, + /// A cursor for use in pagination. + /// `starting_after` is an object ID that defines your place in the list. + /// For instance, if you make a list request and receive 100 objects, ending with `obj_foo`, your subsequent call can include `starting_after=obj_foo` in order to fetch the next page of the list. + #[serde(skip_serializing_if = "Option::is_none")] + pub starting_after: Option<&'a str>, +} +impl<'a> ListAccount<'a> { + pub fn new() -> Self { + Self::default() + } +} +impl<'a> ListAccount<'a> { + /// Returns a list of accounts connected to your platform via [Connect](https://stripe.com/docs/connect). + /// If you’re not a platform, the list is empty. + pub fn send( + &self, + client: &stripe::Client, + ) -> stripe::Response> { + client.get_query("/accounts", self) + } + pub fn paginate(self) -> stripe::ListPaginator> { + stripe::ListPaginator::from_list_params("/accounts", self) + } +} +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct RetrieveAccount<'a> { + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, +} +impl<'a> RetrieveAccount<'a> { + pub fn new() -> Self { + Self::default() + } +} +impl<'a> RetrieveAccount<'a> { + /// Retrieves the details of an account. + pub fn send( + &self, + client: &stripe::Client, + account: &stripe_shared::AccountId, + ) -> stripe::Response { + client.get_query(&format!("/accounts/{account}"), self) + } +} +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CapabilitiesAccount<'a> { + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, +} +impl<'a> CapabilitiesAccount<'a> { + pub fn new() -> Self { + Self::default() + } +} +impl<'a> CapabilitiesAccount<'a> { + /// Returns a list of capabilities associated with the account. + /// The capabilities are returned sorted by creation date, with the most recent capability appearing first. + pub fn send( + &self, + client: &stripe::Client, + account: &stripe_shared::AccountId, + ) -> stripe::Response> { + client.get_query(&format!("/accounts/{account}/capabilities"), self) + } + pub fn paginate( + self, + account: &stripe_shared::AccountId, + ) -> stripe::ListPaginator> { + stripe::ListPaginator::from_list_params(&format!("/accounts/{account}/capabilities"), self) + } +} +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct PersonsAccount<'a> { + /// A cursor for use in pagination. + /// `ending_before` is an object ID that defines your place in the list. + /// For instance, if you make a list request and receive 100 objects, starting with `obj_bar`, your subsequent call can include `ending_before=obj_bar` in order to fetch the previous page of the list. + #[serde(skip_serializing_if = "Option::is_none")] + pub ending_before: Option<&'a str>, + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, + /// A limit on the number of objects to be returned. + /// Limit can range between 1 and 100, and the default is 10. + #[serde(skip_serializing_if = "Option::is_none")] + pub limit: Option, + /// Filters on the list of people returned based on the person's relationship to the account's company. + #[serde(skip_serializing_if = "Option::is_none")] + pub relationship: Option, + /// A cursor for use in pagination. + /// `starting_after` is an object ID that defines your place in the list. + /// For instance, if you make a list request and receive 100 objects, ending with `obj_foo`, your subsequent call can include `starting_after=obj_foo` in order to fetch the next page of the list. + #[serde(skip_serializing_if = "Option::is_none")] + pub starting_after: Option<&'a str>, +} +impl<'a> PersonsAccount<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// Filters on the list of people returned based on the person's relationship to the account's company. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct PersonsAccountRelationship { + /// A filter on the list of people returned based on whether these people are directors of the account's company. + #[serde(skip_serializing_if = "Option::is_none")] + pub director: Option, + /// A filter on the list of people returned based on whether these people are executives of the account's company. + #[serde(skip_serializing_if = "Option::is_none")] + pub executive: Option, + /// A filter on the list of people returned based on whether these people are legal guardians of the account's representative. + #[serde(skip_serializing_if = "Option::is_none")] + pub legal_guardian: Option, + /// A filter on the list of people returned based on whether these people are owners of the account's company. + #[serde(skip_serializing_if = "Option::is_none")] + pub owner: Option, + /// A filter on the list of people returned based on whether these people are the representative of the account's company. + #[serde(skip_serializing_if = "Option::is_none")] + pub representative: Option, +} +impl PersonsAccountRelationship { + pub fn new() -> Self { + Self::default() + } +} +impl<'a> PersonsAccount<'a> { + /// Returns a list of people associated with the account’s legal entity. + /// The people are returned sorted by creation date, with the most recent people appearing first. + pub fn send( + &self, + client: &stripe::Client, + account: &stripe_shared::AccountId, + ) -> stripe::Response> { + client.get_query(&format!("/accounts/{account}/persons"), self) + } + pub fn paginate( + self, + account: &stripe_shared::AccountId, + ) -> stripe::ListPaginator> { + stripe::ListPaginator::from_list_params(&format!("/accounts/{account}/persons"), self) + } +} +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreateAccount<'a> { + /// An [account token](https://stripe.com/docs/api#create_account_token), used to securely provide details to the account. + #[serde(skip_serializing_if = "Option::is_none")] + pub account_token: Option<&'a str>, + /// Business information about the account. + #[serde(skip_serializing_if = "Option::is_none")] + pub business_profile: Option>, + /// The business type. + /// Once you create an [Account Link](https://stripe.com/docs/api/account_links) or [Account Session](https://stripe.com/docs/api/account_sessions), this property can only be updated for Custom accounts. + #[serde(skip_serializing_if = "Option::is_none")] + pub business_type: Option, + /// Each key of the dictionary represents a capability, and each capability maps to its settings (e.g. + /// whether it has been requested or not). + /// Each capability will be inactive until you have provided its specific requirements and Stripe has verified them. + /// An account may have some of its requested capabilities be active and some be inactive. + #[serde(skip_serializing_if = "Option::is_none")] + pub capabilities: Option, + /// Information about the company or business. + /// This field is available for any `business_type`. + /// Once you create an [Account Link](https://stripe.com/docs/api/account_links) or [Account Session](https://stripe.com/docs/api/account_sessions), this property can only be updated for Custom accounts. + #[serde(skip_serializing_if = "Option::is_none")] + pub company: Option>, + /// The country in which the account holder resides, or in which the business is legally established. + /// This should be an ISO 3166-1 alpha-2 country code. + /// For example, if you are in the United States and the business for which you're creating an account is legally represented in Canada, you would use `CA` as the country for the account being created. + /// Available countries include [Stripe's global markets](https://stripe.com/global) as well as countries where [cross-border payouts](https://stripe.com/docs/connect/cross-border-payouts) are supported. + #[serde(skip_serializing_if = "Option::is_none")] + pub country: Option<&'a str>, + /// Three-letter ISO currency code representing the default currency for the account. + /// This must be a currency that [Stripe supports in the account's country](https://stripe.com/docs/payouts). + #[serde(skip_serializing_if = "Option::is_none")] + pub default_currency: Option, + /// Documents that may be submitted to satisfy various informational requests. + #[serde(skip_serializing_if = "Option::is_none")] + pub documents: Option>, + /// The email address of the account holder. + /// This is only to make the account easier to identify to you. + /// Stripe only emails Custom accounts with your consent. + #[serde(skip_serializing_if = "Option::is_none")] + pub email: Option<&'a str>, + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, + /// A card or bank account to attach to the account for receiving [payouts](https://stripe.com/docs/connect/bank-debit-card-payouts) (you won’t be able to use it for top-ups). + /// You can provide either a token, like the ones returned by [Stripe.js](https://stripe.com/docs/js), or a dictionary, as documented in the `external_account` parameter for [bank account](https://stripe.com/docs/api#account_create_bank_account) creation. + /// + /// + /// By default, providing an external account sets it as the new default external account for its currency, and deletes the old default if one exists. + /// To add additional external accounts without replacing the existing default for the currency, use the [bank account](https://stripe.com/docs/api#account_create_bank_account) or [card creation](https://stripe.com/docs/api#account_create_card) APIs. + /// After you create an [Account Link](https://stripe.com/docs/api/account_links) or [Account Session](https://stripe.com/docs/api/account_sessions), this property can only be updated for Custom accounts. + #[serde(skip_serializing_if = "Option::is_none")] + pub external_account: Option<&'a str>, + /// Information about the person represented by the account. + /// This field is null unless `business_type` is set to `individual`. + /// Once you create an [Account Link](https://stripe.com/docs/api/account_links) or [Account Session](https://stripe.com/docs/api/account_sessions), this property can only be updated for Custom accounts. + #[serde(skip_serializing_if = "Option::is_none")] + pub individual: Option>, + /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. + /// This can be useful for storing additional information about the object in a structured format. + /// Individual keys can be unset by posting an empty value to them. + /// All keys can be unset by posting an empty value to `metadata`. + #[serde(skip_serializing_if = "Option::is_none")] + pub metadata: Option<&'a std::collections::HashMap>, + /// Options for customizing how the account functions within Stripe. + #[serde(skip_serializing_if = "Option::is_none")] + pub settings: Option>, + /// Details on the account's acceptance of the [Stripe Services Agreement](https://stripe.com/docs/connect/updating-accounts#tos-acceptance) This property can only be updated for Custom accounts. + #[serde(skip_serializing_if = "Option::is_none")] + pub tos_acceptance: Option>, + /// The type of Stripe account to create. May be one of `custom`, `express` or `standard`. + #[serde(rename = "type")] + #[serde(skip_serializing_if = "Option::is_none")] + pub type_: Option, +} +impl<'a> CreateAccount<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// Information about the company or business. +/// This field is available for any `business_type`. +/// Once you create an [Account Link](https://stripe.com/docs/api/account_links) or [Account Session](https://stripe.com/docs/api/account_sessions), this property can only be updated for Custom accounts. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreateAccountCompany<'a> { + /// The company's primary address. + #[serde(skip_serializing_if = "Option::is_none")] + pub address: Option>, + /// The Kana variation of the company's primary address (Japan only). + #[serde(skip_serializing_if = "Option::is_none")] + pub address_kana: Option>, + /// The Kanji variation of the company's primary address (Japan only). + #[serde(skip_serializing_if = "Option::is_none")] + pub address_kanji: Option>, + /// Whether the company's directors have been provided. + /// Set this Boolean to `true` after creating all the company's directors with [the Persons API](https://stripe.com/docs/api/persons) for accounts with a `relationship.director` requirement. + /// This value is not automatically set to `true` after creating directors, so it needs to be updated to indicate all directors have been provided. + #[serde(skip_serializing_if = "Option::is_none")] + pub directors_provided: Option, + /// Whether the company's executives have been provided. + /// Set this Boolean to `true` after creating all the company's executives with [the Persons API](https://stripe.com/docs/api/persons) for accounts with a `relationship.executive` requirement. + #[serde(skip_serializing_if = "Option::is_none")] + pub executives_provided: Option, + /// The export license ID number of the company, also referred as Import Export Code (India only). + #[serde(skip_serializing_if = "Option::is_none")] + pub export_license_id: Option<&'a str>, + /// The purpose code to use for export transactions (India only). + #[serde(skip_serializing_if = "Option::is_none")] + pub export_purpose_code: Option<&'a str>, + /// The company's legal name. + #[serde(skip_serializing_if = "Option::is_none")] + pub name: Option<&'a str>, + /// The Kana variation of the company's legal name (Japan only). + #[serde(skip_serializing_if = "Option::is_none")] + pub name_kana: Option<&'a str>, + /// The Kanji variation of the company's legal name (Japan only). + #[serde(skip_serializing_if = "Option::is_none")] + pub name_kanji: Option<&'a str>, + /// Whether the company's owners have been provided. + /// Set this Boolean to `true` after creating all the company's owners with [the Persons API](https://stripe.com/docs/api/persons) for accounts with a `relationship.owner` requirement. + #[serde(skip_serializing_if = "Option::is_none")] + pub owners_provided: Option, + /// This hash is used to attest that the beneficial owner information provided to Stripe is both current and correct. + #[serde(skip_serializing_if = "Option::is_none")] + pub ownership_declaration: Option>, + /// The company's phone number (used for verification). + #[serde(skip_serializing_if = "Option::is_none")] + pub phone: Option<&'a str>, + /// The identification number given to a company when it is registered or incorporated, if distinct from the identification number used for filing taxes. + /// (Examples are the CIN for companies and LLP IN for partnerships in India, and the Company Registration Number in Hong Kong). + #[serde(skip_serializing_if = "Option::is_none")] + pub registration_number: Option<&'a str>, + /// The category identifying the legal structure of the company or legal entity. + /// See [Business structure](https://stripe.com/docs/connect/identity-verification#business-structure) for more details. + /// Pass an empty string to unset this value. + #[serde(skip_serializing_if = "Option::is_none")] + pub structure: Option, + /// The business ID number of the company, as appropriate for the company’s country. + /// (Examples are an Employer ID Number in the U.S., a Business Number in Canada, or a Company Number in the UK.). + #[serde(skip_serializing_if = "Option::is_none")] + pub tax_id: Option<&'a str>, + /// The jurisdiction in which the `tax_id` is registered (Germany-based companies only). + #[serde(skip_serializing_if = "Option::is_none")] + pub tax_id_registrar: Option<&'a str>, + /// The VAT number of the company. + #[serde(skip_serializing_if = "Option::is_none")] + pub vat_id: Option<&'a str>, + /// Information on the verification state of the company. + #[serde(skip_serializing_if = "Option::is_none")] + pub verification: Option>, +} +impl<'a> CreateAccountCompany<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// The Kana variation of the company's primary address (Japan only). +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreateAccountCompanyAddressKana<'a> { + /// City or ward. + #[serde(skip_serializing_if = "Option::is_none")] + pub city: Option<&'a str>, + /// Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). + #[serde(skip_serializing_if = "Option::is_none")] + pub country: Option<&'a str>, + /// Block or building number. + #[serde(skip_serializing_if = "Option::is_none")] + pub line1: Option<&'a str>, + /// Building details. + #[serde(skip_serializing_if = "Option::is_none")] + pub line2: Option<&'a str>, + /// Postal code. + #[serde(skip_serializing_if = "Option::is_none")] + pub postal_code: Option<&'a str>, + /// Prefecture. + #[serde(skip_serializing_if = "Option::is_none")] + pub state: Option<&'a str>, + /// Town or cho-me. + #[serde(skip_serializing_if = "Option::is_none")] + pub town: Option<&'a str>, +} +impl<'a> CreateAccountCompanyAddressKana<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// The Kanji variation of the company's primary address (Japan only). +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreateAccountCompanyAddressKanji<'a> { + /// City or ward. + #[serde(skip_serializing_if = "Option::is_none")] + pub city: Option<&'a str>, + /// Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). + #[serde(skip_serializing_if = "Option::is_none")] + pub country: Option<&'a str>, + /// Block or building number. + #[serde(skip_serializing_if = "Option::is_none")] + pub line1: Option<&'a str>, + /// Building details. + #[serde(skip_serializing_if = "Option::is_none")] + pub line2: Option<&'a str>, + /// Postal code. + #[serde(skip_serializing_if = "Option::is_none")] + pub postal_code: Option<&'a str>, + /// Prefecture. + #[serde(skip_serializing_if = "Option::is_none")] + pub state: Option<&'a str>, + /// Town or cho-me. + #[serde(skip_serializing_if = "Option::is_none")] + pub town: Option<&'a str>, +} +impl<'a> CreateAccountCompanyAddressKanji<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// The category identifying the legal structure of the company or legal entity. +/// See [Business structure](https://stripe.com/docs/connect/identity-verification#business-structure) for more details. +/// Pass an empty string to unset this value. +#[derive(Copy, Clone, Eq, PartialEq)] +#[non_exhaustive] +pub enum CreateAccountCompanyStructure { + FreeZoneEstablishment, + FreeZoneLlc, + GovernmentInstrumentality, + GovernmentalUnit, + IncorporatedNonProfit, + IncorporatedPartnership, + LimitedLiabilityPartnership, + Llc, + MultiMemberLlc, + PrivateCompany, + PrivateCorporation, + PrivatePartnership, + PublicCompany, + PublicCorporation, + PublicPartnership, + RegisteredCharity, + SingleMemberLlc, + SoleEstablishment, + SoleProprietorship, + TaxExemptGovernmentInstrumentality, + UnincorporatedAssociation, + UnincorporatedNonProfit, + UnincorporatedPartnership, + /// An unrecognized value from Stripe. Should not be used as a request parameter. + Unknown, +} +impl CreateAccountCompanyStructure { + pub fn as_str(self) -> &'static str { + use CreateAccountCompanyStructure::*; + match self { + FreeZoneEstablishment => "free_zone_establishment", + FreeZoneLlc => "free_zone_llc", + GovernmentInstrumentality => "government_instrumentality", + GovernmentalUnit => "governmental_unit", + IncorporatedNonProfit => "incorporated_non_profit", + IncorporatedPartnership => "incorporated_partnership", + LimitedLiabilityPartnership => "limited_liability_partnership", + Llc => "llc", + MultiMemberLlc => "multi_member_llc", + PrivateCompany => "private_company", + PrivateCorporation => "private_corporation", + PrivatePartnership => "private_partnership", + PublicCompany => "public_company", + PublicCorporation => "public_corporation", + PublicPartnership => "public_partnership", + RegisteredCharity => "registered_charity", + SingleMemberLlc => "single_member_llc", + SoleEstablishment => "sole_establishment", + SoleProprietorship => "sole_proprietorship", + TaxExemptGovernmentInstrumentality => "tax_exempt_government_instrumentality", + UnincorporatedAssociation => "unincorporated_association", + UnincorporatedNonProfit => "unincorporated_non_profit", + UnincorporatedPartnership => "unincorporated_partnership", + Unknown => "unknown", + } + } +} + +impl std::str::FromStr for CreateAccountCompanyStructure { + type Err = (); + fn from_str(s: &str) -> Result { + use CreateAccountCompanyStructure::*; + match s { + "free_zone_establishment" => Ok(FreeZoneEstablishment), + "free_zone_llc" => Ok(FreeZoneLlc), + "government_instrumentality" => Ok(GovernmentInstrumentality), + "governmental_unit" => Ok(GovernmentalUnit), + "incorporated_non_profit" => Ok(IncorporatedNonProfit), + "incorporated_partnership" => Ok(IncorporatedPartnership), + "limited_liability_partnership" => Ok(LimitedLiabilityPartnership), + "llc" => Ok(Llc), + "multi_member_llc" => Ok(MultiMemberLlc), + "private_company" => Ok(PrivateCompany), + "private_corporation" => Ok(PrivateCorporation), + "private_partnership" => Ok(PrivatePartnership), + "public_company" => Ok(PublicCompany), + "public_corporation" => Ok(PublicCorporation), + "public_partnership" => Ok(PublicPartnership), + "registered_charity" => Ok(RegisteredCharity), + "single_member_llc" => Ok(SingleMemberLlc), + "sole_establishment" => Ok(SoleEstablishment), + "sole_proprietorship" => Ok(SoleProprietorship), + "tax_exempt_government_instrumentality" => Ok(TaxExemptGovernmentInstrumentality), + "unincorporated_association" => Ok(UnincorporatedAssociation), + "unincorporated_non_profit" => Ok(UnincorporatedNonProfit), + "unincorporated_partnership" => Ok(UnincorporatedPartnership), + _ => Err(()), + } + } +} +impl std::fmt::Display for CreateAccountCompanyStructure { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreateAccountCompanyStructure { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreateAccountCompanyStructure { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Information about the person represented by the account. +/// This field is null unless `business_type` is set to `individual`. +/// Once you create an [Account Link](https://stripe.com/docs/api/account_links) or [Account Session](https://stripe.com/docs/api/account_sessions), this property can only be updated for Custom accounts. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreateAccountIndividual<'a> { + /// The individual's primary address. + #[serde(skip_serializing_if = "Option::is_none")] + pub address: Option>, + /// The Kana variation of the the individual's primary address (Japan only). + #[serde(skip_serializing_if = "Option::is_none")] + pub address_kana: Option>, + /// The Kanji variation of the the individual's primary address (Japan only). + #[serde(skip_serializing_if = "Option::is_none")] + pub address_kanji: Option>, + /// The individual's date of birth. + #[serde(skip_serializing_if = "Option::is_none")] + pub dob: Option, + /// The individual's email address. + #[serde(skip_serializing_if = "Option::is_none")] + pub email: Option<&'a str>, + /// The individual's first name. + #[serde(skip_serializing_if = "Option::is_none")] + pub first_name: Option<&'a str>, + /// The Kana variation of the the individual's first name (Japan only). + #[serde(skip_serializing_if = "Option::is_none")] + pub first_name_kana: Option<&'a str>, + /// The Kanji variation of the individual's first name (Japan only). + #[serde(skip_serializing_if = "Option::is_none")] + pub first_name_kanji: Option<&'a str>, + /// A list of alternate names or aliases that the individual is known by. + #[serde(skip_serializing_if = "Option::is_none")] + pub full_name_aliases: Option<&'a [&'a str]>, + /// The individual's gender (International regulations require either "male" or "female"). + #[serde(skip_serializing_if = "Option::is_none")] + pub gender: Option<&'a str>, + /// The government-issued ID number of the individual, as appropriate for the representative's country. + /// (Examples are a Social Security Number in the U.S., or a Social Insurance Number in Canada). + /// Instead of the number itself, you can also provide a [PII token created with Stripe.js](https://stripe.com/docs/js/tokens/create_token?type=pii). + #[serde(skip_serializing_if = "Option::is_none")] + pub id_number: Option<&'a str>, + /// The government-issued secondary ID number of the individual, as appropriate for the representative's country, will be used for enhanced verification checks. + /// In Thailand, this would be the laser code found on the back of an ID card. + /// Instead of the number itself, you can also provide a [PII token created with Stripe.js](https://stripe.com/docs/js/tokens/create_token?type=pii). + #[serde(skip_serializing_if = "Option::is_none")] + pub id_number_secondary: Option<&'a str>, + /// The individual's last name. + #[serde(skip_serializing_if = "Option::is_none")] + pub last_name: Option<&'a str>, + /// The Kana variation of the individual's last name (Japan only). + #[serde(skip_serializing_if = "Option::is_none")] + pub last_name_kana: Option<&'a str>, + /// The Kanji variation of the individual's last name (Japan only). + #[serde(skip_serializing_if = "Option::is_none")] + pub last_name_kanji: Option<&'a str>, + /// The individual's maiden name. + #[serde(skip_serializing_if = "Option::is_none")] + pub maiden_name: Option<&'a str>, + /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. + /// This can be useful for storing additional information about the object in a structured format. + /// Individual keys can be unset by posting an empty value to them. + /// All keys can be unset by posting an empty value to `metadata`. + #[serde(skip_serializing_if = "Option::is_none")] + pub metadata: Option<&'a std::collections::HashMap>, + /// The individual's phone number. + #[serde(skip_serializing_if = "Option::is_none")] + pub phone: Option<&'a str>, + /// Indicates if the person or any of their representatives, family members, or other closely related persons, declares that they hold or have held an important public job or function, in any jurisdiction. + #[serde(skip_serializing_if = "Option::is_none")] + pub political_exposure: Option, + /// The individual's registered address. + #[serde(skip_serializing_if = "Option::is_none")] + pub registered_address: Option>, + /// Describes the person’s relationship to the account. + #[serde(skip_serializing_if = "Option::is_none")] + pub relationship: Option>, + /// The last four digits of the individual's Social Security Number (U.S. only). + #[serde(skip_serializing_if = "Option::is_none")] + pub ssn_last_4: Option<&'a str>, + /// The individual's verification document information. + #[serde(skip_serializing_if = "Option::is_none")] + pub verification: Option>, +} +impl<'a> CreateAccountIndividual<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// The Kana variation of the the individual's primary address (Japan only). +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreateAccountIndividualAddressKana<'a> { + /// City or ward. + #[serde(skip_serializing_if = "Option::is_none")] + pub city: Option<&'a str>, + /// Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). + #[serde(skip_serializing_if = "Option::is_none")] + pub country: Option<&'a str>, + /// Block or building number. + #[serde(skip_serializing_if = "Option::is_none")] + pub line1: Option<&'a str>, + /// Building details. + #[serde(skip_serializing_if = "Option::is_none")] + pub line2: Option<&'a str>, + /// Postal code. + #[serde(skip_serializing_if = "Option::is_none")] + pub postal_code: Option<&'a str>, + /// Prefecture. + #[serde(skip_serializing_if = "Option::is_none")] + pub state: Option<&'a str>, + /// Town or cho-me. + #[serde(skip_serializing_if = "Option::is_none")] + pub town: Option<&'a str>, +} +impl<'a> CreateAccountIndividualAddressKana<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// The Kanji variation of the the individual's primary address (Japan only). +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreateAccountIndividualAddressKanji<'a> { + /// City or ward. + #[serde(skip_serializing_if = "Option::is_none")] + pub city: Option<&'a str>, + /// Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). + #[serde(skip_serializing_if = "Option::is_none")] + pub country: Option<&'a str>, + /// Block or building number. + #[serde(skip_serializing_if = "Option::is_none")] + pub line1: Option<&'a str>, + /// Building details. + #[serde(skip_serializing_if = "Option::is_none")] + pub line2: Option<&'a str>, + /// Postal code. + #[serde(skip_serializing_if = "Option::is_none")] + pub postal_code: Option<&'a str>, + /// Prefecture. + #[serde(skip_serializing_if = "Option::is_none")] + pub state: Option<&'a str>, + /// Town or cho-me. + #[serde(skip_serializing_if = "Option::is_none")] + pub town: Option<&'a str>, +} +impl<'a> CreateAccountIndividualAddressKanji<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// Indicates if the person or any of their representatives, family members, or other closely related persons, declares that they hold or have held an important public job or function, in any jurisdiction. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreateAccountIndividualPoliticalExposure { + Existing, + None, +} +impl CreateAccountIndividualPoliticalExposure { + pub fn as_str(self) -> &'static str { + use CreateAccountIndividualPoliticalExposure::*; + match self { + Existing => "existing", + None => "none", + } + } +} + +impl std::str::FromStr for CreateAccountIndividualPoliticalExposure { + type Err = (); + fn from_str(s: &str) -> Result { + use CreateAccountIndividualPoliticalExposure::*; + match s { + "existing" => Ok(Existing), + "none" => Ok(None), + _ => Err(()), + } + } +} +impl std::fmt::Display for CreateAccountIndividualPoliticalExposure { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreateAccountIndividualPoliticalExposure { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreateAccountIndividualPoliticalExposure { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Options for customizing how the account functions within Stripe. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreateAccountSettings<'a> { + /// Settings specific to Bacs Direct Debit. + #[serde(skip_serializing_if = "Option::is_none")] + pub bacs_debit_payments: Option>, + /// Settings used to apply the account's branding to email receipts, invoices, Checkout, and other products. + #[serde(skip_serializing_if = "Option::is_none")] + pub branding: Option>, + /// Settings specific to the account's use of the Card Issuing product. + #[serde(skip_serializing_if = "Option::is_none")] + pub card_issuing: Option>, + /// Settings specific to card charging on the account. + #[serde(skip_serializing_if = "Option::is_none")] + pub card_payments: Option>, + /// Settings that apply across payment methods for charging on the account. + #[serde(skip_serializing_if = "Option::is_none")] + pub payments: Option>, + /// Settings specific to the account's payouts. + #[serde(skip_serializing_if = "Option::is_none")] + pub payouts: Option>, + /// Settings specific to the account's Treasury FinancialAccounts. + #[serde(skip_serializing_if = "Option::is_none")] + pub treasury: Option>, +} +impl<'a> CreateAccountSettings<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// Settings specific to the account's payouts. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreateAccountSettingsPayouts<'a> { + /// A Boolean indicating whether Stripe should try to reclaim negative balances from an attached bank account. + /// For details, see [Understanding Connect Account Balances](https://stripe.com/docs/connect/account-balances). + #[serde(skip_serializing_if = "Option::is_none")] + pub debit_negative_balances: Option, + /// Details on when funds from charges are available, and when they are paid out to an external account. + /// For details, see our [Setting Bank and Debit Card Payouts](https://stripe.com/docs/connect/bank-transfers#payout-information) documentation. + #[serde(skip_serializing_if = "Option::is_none")] + pub schedule: Option, + /// The text that appears on the bank account statement for payouts. + /// If not set, this defaults to the platform's bank descriptor as set in the Dashboard. + #[serde(skip_serializing_if = "Option::is_none")] + pub statement_descriptor: Option<&'a str>, +} +impl<'a> CreateAccountSettingsPayouts<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// Details on when funds from charges are available, and when they are paid out to an external account. +/// For details, see our [Setting Bank and Debit Card Payouts](https://stripe.com/docs/connect/bank-transfers#payout-information) documentation. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreateAccountSettingsPayoutsSchedule { + /// The number of days charge funds are held before being paid out. + /// May also be set to `minimum`, representing the lowest available value for the account country. + /// Default is `minimum`. + /// The `delay_days` parameter remains at the last configured value if `interval` is `manual`. + /// [Learn more about controlling payout delay days](https://stripe.com/docs/connect/manage-payout-schedule). + #[serde(skip_serializing_if = "Option::is_none")] + pub delay_days: Option, + /// How frequently available funds are paid out. + /// One of: `daily`, `manual`, `weekly`, or `monthly`. + /// Default is `daily`. + #[serde(skip_serializing_if = "Option::is_none")] + pub interval: Option, + /// The day of the month when available funds are paid out, specified as a number between 1--31. + /// Payouts nominally scheduled between the 29th and 31st of the month are instead sent on the last day of a shorter month. + /// Required and applicable only if `interval` is `monthly`. + #[serde(skip_serializing_if = "Option::is_none")] + pub monthly_anchor: Option, + /// The day of the week when available funds are paid out, specified as `monday`, `tuesday`, etc. + /// (required and applicable only if `interval` is `weekly`.). + #[serde(skip_serializing_if = "Option::is_none")] + pub weekly_anchor: Option, +} +impl CreateAccountSettingsPayoutsSchedule { + pub fn new() -> Self { + Self::default() + } +} +/// The number of days charge funds are held before being paid out. +/// May also be set to `minimum`, representing the lowest available value for the account country. +/// Default is `minimum`. +/// The `delay_days` parameter remains at the last configured value if `interval` is `manual`. +/// [Learn more about controlling payout delay days](https://stripe.com/docs/connect/manage-payout-schedule). +#[derive(Copy, Clone, Debug, serde::Serialize)] +#[serde(untagged)] +pub enum CreateAccountSettingsPayoutsScheduleDelayDays { + Minimum, + U32(u32), +} +/// How frequently available funds are paid out. +/// One of: `daily`, `manual`, `weekly`, or `monthly`. +/// Default is `daily`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreateAccountSettingsPayoutsScheduleInterval { + Daily, + Manual, + Monthly, + Weekly, +} +impl CreateAccountSettingsPayoutsScheduleInterval { + pub fn as_str(self) -> &'static str { + use CreateAccountSettingsPayoutsScheduleInterval::*; + match self { + Daily => "daily", + Manual => "manual", + Monthly => "monthly", + Weekly => "weekly", + } + } +} + +impl std::str::FromStr for CreateAccountSettingsPayoutsScheduleInterval { + type Err = (); + fn from_str(s: &str) -> Result { + use CreateAccountSettingsPayoutsScheduleInterval::*; + match s { + "daily" => Ok(Daily), + "manual" => Ok(Manual), + "monthly" => Ok(Monthly), + "weekly" => Ok(Weekly), + _ => Err(()), + } + } +} +impl std::fmt::Display for CreateAccountSettingsPayoutsScheduleInterval { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreateAccountSettingsPayoutsScheduleInterval { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreateAccountSettingsPayoutsScheduleInterval { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// The day of the week when available funds are paid out, specified as `monday`, `tuesday`, etc. +/// (required and applicable only if `interval` is `weekly`.). +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreateAccountSettingsPayoutsScheduleWeeklyAnchor { + Friday, + Monday, + Saturday, + Sunday, + Thursday, + Tuesday, + Wednesday, +} +impl CreateAccountSettingsPayoutsScheduleWeeklyAnchor { + pub fn as_str(self) -> &'static str { + use CreateAccountSettingsPayoutsScheduleWeeklyAnchor::*; + match self { + Friday => "friday", + Monday => "monday", + Saturday => "saturday", + Sunday => "sunday", + Thursday => "thursday", + Tuesday => "tuesday", + Wednesday => "wednesday", + } + } +} + +impl std::str::FromStr for CreateAccountSettingsPayoutsScheduleWeeklyAnchor { + type Err = (); + fn from_str(s: &str) -> Result { + use CreateAccountSettingsPayoutsScheduleWeeklyAnchor::*; + match s { + "friday" => Ok(Friday), + "monday" => Ok(Monday), + "saturday" => Ok(Saturday), + "sunday" => Ok(Sunday), + "thursday" => Ok(Thursday), + "tuesday" => Ok(Tuesday), + "wednesday" => Ok(Wednesday), + _ => Err(()), + } + } +} +impl std::fmt::Display for CreateAccountSettingsPayoutsScheduleWeeklyAnchor { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreateAccountSettingsPayoutsScheduleWeeklyAnchor { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreateAccountSettingsPayoutsScheduleWeeklyAnchor { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'a> CreateAccount<'a> { + /// With [Connect](https://stripe.com/docs/connect), you can create Stripe accounts for your users. + /// To do this, you’ll first need to [register your platform](https://dashboard.stripe.com/account/applications/settings). + /// + /// If you’ve already collected information for your connected accounts, you [can prefill that information](https://stripe.com/docs/connect/best-practices#onboarding) when. + /// creating the account. + /// Connect Onboarding won’t ask for the prefilled information during account onboarding. + /// You can prefill any information on the account. + pub fn send(&self, client: &stripe::Client) -> stripe::Response { + client.send_form("/accounts", self, http_types::Method::Post) + } +} +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdateAccount<'a> { + /// An [account token](https://stripe.com/docs/api#create_account_token), used to securely provide details to the account. + #[serde(skip_serializing_if = "Option::is_none")] + pub account_token: Option<&'a str>, + /// Business information about the account. + #[serde(skip_serializing_if = "Option::is_none")] + pub business_profile: Option>, + /// The business type. + /// Once you create an [Account Link](https://stripe.com/docs/api/account_links) or [Account Session](https://stripe.com/docs/api/account_sessions), this property can only be updated for Custom accounts. + #[serde(skip_serializing_if = "Option::is_none")] + pub business_type: Option, + /// Each key of the dictionary represents a capability, and each capability maps to its settings (e.g. + /// whether it has been requested or not). + /// Each capability will be inactive until you have provided its specific requirements and Stripe has verified them. + /// An account may have some of its requested capabilities be active and some be inactive. + #[serde(skip_serializing_if = "Option::is_none")] + pub capabilities: Option, + /// Information about the company or business. + /// This field is available for any `business_type`. + /// Once you create an [Account Link](https://stripe.com/docs/api/account_links) or [Account Session](https://stripe.com/docs/api/account_sessions), this property can only be updated for Custom accounts. + #[serde(skip_serializing_if = "Option::is_none")] + pub company: Option>, + /// Three-letter ISO currency code representing the default currency for the account. + /// This must be a currency that [Stripe supports in the account's country](https://stripe.com/docs/payouts). + #[serde(skip_serializing_if = "Option::is_none")] + pub default_currency: Option, + /// Documents that may be submitted to satisfy various informational requests. + #[serde(skip_serializing_if = "Option::is_none")] + pub documents: Option>, + /// The email address of the account holder. + /// This is only to make the account easier to identify to you. + /// Stripe only emails Custom accounts with your consent. + #[serde(skip_serializing_if = "Option::is_none")] + pub email: Option<&'a str>, + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, + /// A card or bank account to attach to the account for receiving [payouts](https://stripe.com/docs/connect/bank-debit-card-payouts) (you won’t be able to use it for top-ups). + /// You can provide either a token, like the ones returned by [Stripe.js](https://stripe.com/docs/js), or a dictionary, as documented in the `external_account` parameter for [bank account](https://stripe.com/docs/api#account_create_bank_account) creation. + /// + /// + /// By default, providing an external account sets it as the new default external account for its currency, and deletes the old default if one exists. + /// To add additional external accounts without replacing the existing default for the currency, use the [bank account](https://stripe.com/docs/api#account_create_bank_account) or [card creation](https://stripe.com/docs/api#account_create_card) APIs. + /// After you create an [Account Link](https://stripe.com/docs/api/account_links) or [Account Session](https://stripe.com/docs/api/account_sessions), this property can only be updated for Custom accounts. + #[serde(skip_serializing_if = "Option::is_none")] + pub external_account: Option<&'a str>, + /// Information about the person represented by the account. + /// This field is null unless `business_type` is set to `individual`. + /// Once you create an [Account Link](https://stripe.com/docs/api/account_links) or [Account Session](https://stripe.com/docs/api/account_sessions), this property can only be updated for Custom accounts. + #[serde(skip_serializing_if = "Option::is_none")] + pub individual: Option>, + /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. + /// This can be useful for storing additional information about the object in a structured format. + /// Individual keys can be unset by posting an empty value to them. + /// All keys can be unset by posting an empty value to `metadata`. + #[serde(skip_serializing_if = "Option::is_none")] + pub metadata: Option<&'a std::collections::HashMap>, + /// Options for customizing how the account functions within Stripe. + #[serde(skip_serializing_if = "Option::is_none")] + pub settings: Option>, + /// Details on the account's acceptance of the [Stripe Services Agreement](https://stripe.com/docs/connect/updating-accounts#tos-acceptance) This property can only be updated for Custom accounts. + #[serde(skip_serializing_if = "Option::is_none")] + pub tos_acceptance: Option>, +} +impl<'a> UpdateAccount<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// Information about the company or business. +/// This field is available for any `business_type`. +/// Once you create an [Account Link](https://stripe.com/docs/api/account_links) or [Account Session](https://stripe.com/docs/api/account_sessions), this property can only be updated for Custom accounts. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdateAccountCompany<'a> { + /// The company's primary address. + #[serde(skip_serializing_if = "Option::is_none")] + pub address: Option>, + /// The Kana variation of the company's primary address (Japan only). + #[serde(skip_serializing_if = "Option::is_none")] + pub address_kana: Option>, + /// The Kanji variation of the company's primary address (Japan only). + #[serde(skip_serializing_if = "Option::is_none")] + pub address_kanji: Option>, + /// Whether the company's directors have been provided. + /// Set this Boolean to `true` after creating all the company's directors with [the Persons API](https://stripe.com/docs/api/persons) for accounts with a `relationship.director` requirement. + /// This value is not automatically set to `true` after creating directors, so it needs to be updated to indicate all directors have been provided. + #[serde(skip_serializing_if = "Option::is_none")] + pub directors_provided: Option, + /// Whether the company's executives have been provided. + /// Set this Boolean to `true` after creating all the company's executives with [the Persons API](https://stripe.com/docs/api/persons) for accounts with a `relationship.executive` requirement. + #[serde(skip_serializing_if = "Option::is_none")] + pub executives_provided: Option, + /// The export license ID number of the company, also referred as Import Export Code (India only). + #[serde(skip_serializing_if = "Option::is_none")] + pub export_license_id: Option<&'a str>, + /// The purpose code to use for export transactions (India only). + #[serde(skip_serializing_if = "Option::is_none")] + pub export_purpose_code: Option<&'a str>, + /// The company's legal name. + #[serde(skip_serializing_if = "Option::is_none")] + pub name: Option<&'a str>, + /// The Kana variation of the company's legal name (Japan only). + #[serde(skip_serializing_if = "Option::is_none")] + pub name_kana: Option<&'a str>, + /// The Kanji variation of the company's legal name (Japan only). + #[serde(skip_serializing_if = "Option::is_none")] + pub name_kanji: Option<&'a str>, + /// Whether the company's owners have been provided. + /// Set this Boolean to `true` after creating all the company's owners with [the Persons API](https://stripe.com/docs/api/persons) for accounts with a `relationship.owner` requirement. + #[serde(skip_serializing_if = "Option::is_none")] + pub owners_provided: Option, + /// This hash is used to attest that the beneficial owner information provided to Stripe is both current and correct. + #[serde(skip_serializing_if = "Option::is_none")] + pub ownership_declaration: Option>, + /// The company's phone number (used for verification). + #[serde(skip_serializing_if = "Option::is_none")] + pub phone: Option<&'a str>, + /// The identification number given to a company when it is registered or incorporated, if distinct from the identification number used for filing taxes. + /// (Examples are the CIN for companies and LLP IN for partnerships in India, and the Company Registration Number in Hong Kong). + #[serde(skip_serializing_if = "Option::is_none")] + pub registration_number: Option<&'a str>, + /// The category identifying the legal structure of the company or legal entity. + /// See [Business structure](https://stripe.com/docs/connect/identity-verification#business-structure) for more details. + /// Pass an empty string to unset this value. + #[serde(skip_serializing_if = "Option::is_none")] + pub structure: Option, + /// The business ID number of the company, as appropriate for the company’s country. + /// (Examples are an Employer ID Number in the U.S., a Business Number in Canada, or a Company Number in the UK.). + #[serde(skip_serializing_if = "Option::is_none")] + pub tax_id: Option<&'a str>, + /// The jurisdiction in which the `tax_id` is registered (Germany-based companies only). + #[serde(skip_serializing_if = "Option::is_none")] + pub tax_id_registrar: Option<&'a str>, + /// The VAT number of the company. + #[serde(skip_serializing_if = "Option::is_none")] + pub vat_id: Option<&'a str>, + /// Information on the verification state of the company. + #[serde(skip_serializing_if = "Option::is_none")] + pub verification: Option>, +} +impl<'a> UpdateAccountCompany<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// The Kana variation of the company's primary address (Japan only). +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdateAccountCompanyAddressKana<'a> { + /// City or ward. + #[serde(skip_serializing_if = "Option::is_none")] + pub city: Option<&'a str>, + /// Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). + #[serde(skip_serializing_if = "Option::is_none")] + pub country: Option<&'a str>, + /// Block or building number. + #[serde(skip_serializing_if = "Option::is_none")] + pub line1: Option<&'a str>, + /// Building details. + #[serde(skip_serializing_if = "Option::is_none")] + pub line2: Option<&'a str>, + /// Postal code. + #[serde(skip_serializing_if = "Option::is_none")] + pub postal_code: Option<&'a str>, + /// Prefecture. + #[serde(skip_serializing_if = "Option::is_none")] + pub state: Option<&'a str>, + /// Town or cho-me. + #[serde(skip_serializing_if = "Option::is_none")] + pub town: Option<&'a str>, +} +impl<'a> UpdateAccountCompanyAddressKana<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// The Kanji variation of the company's primary address (Japan only). +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdateAccountCompanyAddressKanji<'a> { + /// City or ward. + #[serde(skip_serializing_if = "Option::is_none")] + pub city: Option<&'a str>, + /// Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). + #[serde(skip_serializing_if = "Option::is_none")] + pub country: Option<&'a str>, + /// Block or building number. + #[serde(skip_serializing_if = "Option::is_none")] + pub line1: Option<&'a str>, + /// Building details. + #[serde(skip_serializing_if = "Option::is_none")] + pub line2: Option<&'a str>, + /// Postal code. + #[serde(skip_serializing_if = "Option::is_none")] + pub postal_code: Option<&'a str>, + /// Prefecture. + #[serde(skip_serializing_if = "Option::is_none")] + pub state: Option<&'a str>, + /// Town or cho-me. + #[serde(skip_serializing_if = "Option::is_none")] + pub town: Option<&'a str>, +} +impl<'a> UpdateAccountCompanyAddressKanji<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// The category identifying the legal structure of the company or legal entity. +/// See [Business structure](https://stripe.com/docs/connect/identity-verification#business-structure) for more details. +/// Pass an empty string to unset this value. +#[derive(Copy, Clone, Eq, PartialEq)] +#[non_exhaustive] +pub enum UpdateAccountCompanyStructure { + FreeZoneEstablishment, + FreeZoneLlc, + GovernmentInstrumentality, + GovernmentalUnit, + IncorporatedNonProfit, + IncorporatedPartnership, + LimitedLiabilityPartnership, + Llc, + MultiMemberLlc, + PrivateCompany, + PrivateCorporation, + PrivatePartnership, + PublicCompany, + PublicCorporation, + PublicPartnership, + RegisteredCharity, + SingleMemberLlc, + SoleEstablishment, + SoleProprietorship, + TaxExemptGovernmentInstrumentality, + UnincorporatedAssociation, + UnincorporatedNonProfit, + UnincorporatedPartnership, + /// An unrecognized value from Stripe. Should not be used as a request parameter. + Unknown, +} +impl UpdateAccountCompanyStructure { + pub fn as_str(self) -> &'static str { + use UpdateAccountCompanyStructure::*; + match self { + FreeZoneEstablishment => "free_zone_establishment", + FreeZoneLlc => "free_zone_llc", + GovernmentInstrumentality => "government_instrumentality", + GovernmentalUnit => "governmental_unit", + IncorporatedNonProfit => "incorporated_non_profit", + IncorporatedPartnership => "incorporated_partnership", + LimitedLiabilityPartnership => "limited_liability_partnership", + Llc => "llc", + MultiMemberLlc => "multi_member_llc", + PrivateCompany => "private_company", + PrivateCorporation => "private_corporation", + PrivatePartnership => "private_partnership", + PublicCompany => "public_company", + PublicCorporation => "public_corporation", + PublicPartnership => "public_partnership", + RegisteredCharity => "registered_charity", + SingleMemberLlc => "single_member_llc", + SoleEstablishment => "sole_establishment", + SoleProprietorship => "sole_proprietorship", + TaxExemptGovernmentInstrumentality => "tax_exempt_government_instrumentality", + UnincorporatedAssociation => "unincorporated_association", + UnincorporatedNonProfit => "unincorporated_non_profit", + UnincorporatedPartnership => "unincorporated_partnership", + Unknown => "unknown", + } + } +} + +impl std::str::FromStr for UpdateAccountCompanyStructure { + type Err = (); + fn from_str(s: &str) -> Result { + use UpdateAccountCompanyStructure::*; + match s { + "free_zone_establishment" => Ok(FreeZoneEstablishment), + "free_zone_llc" => Ok(FreeZoneLlc), + "government_instrumentality" => Ok(GovernmentInstrumentality), + "governmental_unit" => Ok(GovernmentalUnit), + "incorporated_non_profit" => Ok(IncorporatedNonProfit), + "incorporated_partnership" => Ok(IncorporatedPartnership), + "limited_liability_partnership" => Ok(LimitedLiabilityPartnership), + "llc" => Ok(Llc), + "multi_member_llc" => Ok(MultiMemberLlc), + "private_company" => Ok(PrivateCompany), + "private_corporation" => Ok(PrivateCorporation), + "private_partnership" => Ok(PrivatePartnership), + "public_company" => Ok(PublicCompany), + "public_corporation" => Ok(PublicCorporation), + "public_partnership" => Ok(PublicPartnership), + "registered_charity" => Ok(RegisteredCharity), + "single_member_llc" => Ok(SingleMemberLlc), + "sole_establishment" => Ok(SoleEstablishment), + "sole_proprietorship" => Ok(SoleProprietorship), + "tax_exempt_government_instrumentality" => Ok(TaxExemptGovernmentInstrumentality), + "unincorporated_association" => Ok(UnincorporatedAssociation), + "unincorporated_non_profit" => Ok(UnincorporatedNonProfit), + "unincorporated_partnership" => Ok(UnincorporatedPartnership), + _ => Err(()), + } + } +} +impl std::fmt::Display for UpdateAccountCompanyStructure { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for UpdateAccountCompanyStructure { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for UpdateAccountCompanyStructure { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Information about the person represented by the account. +/// This field is null unless `business_type` is set to `individual`. +/// Once you create an [Account Link](https://stripe.com/docs/api/account_links) or [Account Session](https://stripe.com/docs/api/account_sessions), this property can only be updated for Custom accounts. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdateAccountIndividual<'a> { + /// The individual's primary address. + #[serde(skip_serializing_if = "Option::is_none")] + pub address: Option>, + /// The Kana variation of the the individual's primary address (Japan only). + #[serde(skip_serializing_if = "Option::is_none")] + pub address_kana: Option>, + /// The Kanji variation of the the individual's primary address (Japan only). + #[serde(skip_serializing_if = "Option::is_none")] + pub address_kanji: Option>, + /// The individual's date of birth. + #[serde(skip_serializing_if = "Option::is_none")] + pub dob: Option, + /// The individual's email address. + #[serde(skip_serializing_if = "Option::is_none")] + pub email: Option<&'a str>, + /// The individual's first name. + #[serde(skip_serializing_if = "Option::is_none")] + pub first_name: Option<&'a str>, + /// The Kana variation of the the individual's first name (Japan only). + #[serde(skip_serializing_if = "Option::is_none")] + pub first_name_kana: Option<&'a str>, + /// The Kanji variation of the individual's first name (Japan only). + #[serde(skip_serializing_if = "Option::is_none")] + pub first_name_kanji: Option<&'a str>, + /// A list of alternate names or aliases that the individual is known by. + #[serde(skip_serializing_if = "Option::is_none")] + pub full_name_aliases: Option<&'a [&'a str]>, + /// The individual's gender (International regulations require either "male" or "female"). + #[serde(skip_serializing_if = "Option::is_none")] + pub gender: Option<&'a str>, + /// The government-issued ID number of the individual, as appropriate for the representative's country. + /// (Examples are a Social Security Number in the U.S., or a Social Insurance Number in Canada). + /// Instead of the number itself, you can also provide a [PII token created with Stripe.js](https://stripe.com/docs/js/tokens/create_token?type=pii). + #[serde(skip_serializing_if = "Option::is_none")] + pub id_number: Option<&'a str>, + /// The government-issued secondary ID number of the individual, as appropriate for the representative's country, will be used for enhanced verification checks. + /// In Thailand, this would be the laser code found on the back of an ID card. + /// Instead of the number itself, you can also provide a [PII token created with Stripe.js](https://stripe.com/docs/js/tokens/create_token?type=pii). + #[serde(skip_serializing_if = "Option::is_none")] + pub id_number_secondary: Option<&'a str>, + /// The individual's last name. + #[serde(skip_serializing_if = "Option::is_none")] + pub last_name: Option<&'a str>, + /// The Kana variation of the individual's last name (Japan only). + #[serde(skip_serializing_if = "Option::is_none")] + pub last_name_kana: Option<&'a str>, + /// The Kanji variation of the individual's last name (Japan only). + #[serde(skip_serializing_if = "Option::is_none")] + pub last_name_kanji: Option<&'a str>, + /// The individual's maiden name. + #[serde(skip_serializing_if = "Option::is_none")] + pub maiden_name: Option<&'a str>, + /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. + /// This can be useful for storing additional information about the object in a structured format. + /// Individual keys can be unset by posting an empty value to them. + /// All keys can be unset by posting an empty value to `metadata`. + #[serde(skip_serializing_if = "Option::is_none")] + pub metadata: Option<&'a std::collections::HashMap>, + /// The individual's phone number. + #[serde(skip_serializing_if = "Option::is_none")] + pub phone: Option<&'a str>, + /// Indicates if the person or any of their representatives, family members, or other closely related persons, declares that they hold or have held an important public job or function, in any jurisdiction. + #[serde(skip_serializing_if = "Option::is_none")] + pub political_exposure: Option, + /// The individual's registered address. + #[serde(skip_serializing_if = "Option::is_none")] + pub registered_address: Option>, + /// Describes the person’s relationship to the account. + #[serde(skip_serializing_if = "Option::is_none")] + pub relationship: Option>, + /// The last four digits of the individual's Social Security Number (U.S. only). + #[serde(skip_serializing_if = "Option::is_none")] + pub ssn_last_4: Option<&'a str>, + /// The individual's verification document information. + #[serde(skip_serializing_if = "Option::is_none")] + pub verification: Option>, +} +impl<'a> UpdateAccountIndividual<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// The Kana variation of the the individual's primary address (Japan only). +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdateAccountIndividualAddressKana<'a> { + /// City or ward. + #[serde(skip_serializing_if = "Option::is_none")] + pub city: Option<&'a str>, + /// Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). + #[serde(skip_serializing_if = "Option::is_none")] + pub country: Option<&'a str>, + /// Block or building number. + #[serde(skip_serializing_if = "Option::is_none")] + pub line1: Option<&'a str>, + /// Building details. + #[serde(skip_serializing_if = "Option::is_none")] + pub line2: Option<&'a str>, + /// Postal code. + #[serde(skip_serializing_if = "Option::is_none")] + pub postal_code: Option<&'a str>, + /// Prefecture. + #[serde(skip_serializing_if = "Option::is_none")] + pub state: Option<&'a str>, + /// Town or cho-me. + #[serde(skip_serializing_if = "Option::is_none")] + pub town: Option<&'a str>, +} +impl<'a> UpdateAccountIndividualAddressKana<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// The Kanji variation of the the individual's primary address (Japan only). +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdateAccountIndividualAddressKanji<'a> { + /// City or ward. + #[serde(skip_serializing_if = "Option::is_none")] + pub city: Option<&'a str>, + /// Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). + #[serde(skip_serializing_if = "Option::is_none")] + pub country: Option<&'a str>, + /// Block or building number. + #[serde(skip_serializing_if = "Option::is_none")] + pub line1: Option<&'a str>, + /// Building details. + #[serde(skip_serializing_if = "Option::is_none")] + pub line2: Option<&'a str>, + /// Postal code. + #[serde(skip_serializing_if = "Option::is_none")] + pub postal_code: Option<&'a str>, + /// Prefecture. + #[serde(skip_serializing_if = "Option::is_none")] + pub state: Option<&'a str>, + /// Town or cho-me. + #[serde(skip_serializing_if = "Option::is_none")] + pub town: Option<&'a str>, +} +impl<'a> UpdateAccountIndividualAddressKanji<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// Indicates if the person or any of their representatives, family members, or other closely related persons, declares that they hold or have held an important public job or function, in any jurisdiction. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum UpdateAccountIndividualPoliticalExposure { + Existing, + None, +} +impl UpdateAccountIndividualPoliticalExposure { + pub fn as_str(self) -> &'static str { + use UpdateAccountIndividualPoliticalExposure::*; + match self { + Existing => "existing", + None => "none", + } + } +} + +impl std::str::FromStr for UpdateAccountIndividualPoliticalExposure { + type Err = (); + fn from_str(s: &str) -> Result { + use UpdateAccountIndividualPoliticalExposure::*; + match s { + "existing" => Ok(Existing), + "none" => Ok(None), + _ => Err(()), + } + } +} +impl std::fmt::Display for UpdateAccountIndividualPoliticalExposure { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for UpdateAccountIndividualPoliticalExposure { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for UpdateAccountIndividualPoliticalExposure { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Options for customizing how the account functions within Stripe. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdateAccountSettings<'a> { + /// Settings specific to Bacs Direct Debit payments. + #[serde(skip_serializing_if = "Option::is_none")] + pub bacs_debit_payments: Option>, + /// Settings used to apply the account's branding to email receipts, invoices, Checkout, and other products. + #[serde(skip_serializing_if = "Option::is_none")] + pub branding: Option>, + /// Settings specific to the account's use of the Card Issuing product. + #[serde(skip_serializing_if = "Option::is_none")] + pub card_issuing: Option>, + /// Settings specific to card charging on the account. + #[serde(skip_serializing_if = "Option::is_none")] + pub card_payments: Option>, + /// Settings specific to the account's use of Invoices. + #[serde(skip_serializing_if = "Option::is_none")] + pub invoices: Option>, + /// Settings that apply across payment methods for charging on the account. + #[serde(skip_serializing_if = "Option::is_none")] + pub payments: Option>, + /// Settings specific to the account's payouts. + #[serde(skip_serializing_if = "Option::is_none")] + pub payouts: Option>, + /// Settings specific to the account's Treasury FinancialAccounts. + #[serde(skip_serializing_if = "Option::is_none")] + pub treasury: Option>, +} +impl<'a> UpdateAccountSettings<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// Settings specific to the account's use of Invoices. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdateAccountSettingsInvoices<'a> { + /// The list of default Account Tax IDs to automatically include on invoices. + /// Account Tax IDs get added when an invoice is finalized. + #[serde(skip_serializing_if = "Option::is_none")] + pub default_account_tax_ids: Option<&'a [&'a str]>, +} +impl<'a> UpdateAccountSettingsInvoices<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// Settings specific to the account's payouts. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdateAccountSettingsPayouts<'a> { + /// A Boolean indicating whether Stripe should try to reclaim negative balances from an attached bank account. + /// For details, see [Understanding Connect Account Balances](https://stripe.com/docs/connect/account-balances). + #[serde(skip_serializing_if = "Option::is_none")] + pub debit_negative_balances: Option, + /// Details on when funds from charges are available, and when they are paid out to an external account. + /// For details, see our [Setting Bank and Debit Card Payouts](https://stripe.com/docs/connect/bank-transfers#payout-information) documentation. + #[serde(skip_serializing_if = "Option::is_none")] + pub schedule: Option, + /// The text that appears on the bank account statement for payouts. + /// If not set, this defaults to the platform's bank descriptor as set in the Dashboard. + #[serde(skip_serializing_if = "Option::is_none")] + pub statement_descriptor: Option<&'a str>, +} +impl<'a> UpdateAccountSettingsPayouts<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// Details on when funds from charges are available, and when they are paid out to an external account. +/// For details, see our [Setting Bank and Debit Card Payouts](https://stripe.com/docs/connect/bank-transfers#payout-information) documentation. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdateAccountSettingsPayoutsSchedule { + /// The number of days charge funds are held before being paid out. + /// May also be set to `minimum`, representing the lowest available value for the account country. + /// Default is `minimum`. + /// The `delay_days` parameter remains at the last configured value if `interval` is `manual`. + /// [Learn more about controlling payout delay days](https://stripe.com/docs/connect/manage-payout-schedule). + #[serde(skip_serializing_if = "Option::is_none")] + pub delay_days: Option, + /// How frequently available funds are paid out. + /// One of: `daily`, `manual`, `weekly`, or `monthly`. + /// Default is `daily`. + #[serde(skip_serializing_if = "Option::is_none")] + pub interval: Option, + /// The day of the month when available funds are paid out, specified as a number between 1--31. + /// Payouts nominally scheduled between the 29th and 31st of the month are instead sent on the last day of a shorter month. + /// Required and applicable only if `interval` is `monthly`. + #[serde(skip_serializing_if = "Option::is_none")] + pub monthly_anchor: Option, + /// The day of the week when available funds are paid out, specified as `monday`, `tuesday`, etc. + /// (required and applicable only if `interval` is `weekly`.). + #[serde(skip_serializing_if = "Option::is_none")] + pub weekly_anchor: Option, +} +impl UpdateAccountSettingsPayoutsSchedule { + pub fn new() -> Self { + Self::default() + } +} +/// The number of days charge funds are held before being paid out. +/// May also be set to `minimum`, representing the lowest available value for the account country. +/// Default is `minimum`. +/// The `delay_days` parameter remains at the last configured value if `interval` is `manual`. +/// [Learn more about controlling payout delay days](https://stripe.com/docs/connect/manage-payout-schedule). +#[derive(Copy, Clone, Debug, serde::Serialize)] +#[serde(untagged)] +pub enum UpdateAccountSettingsPayoutsScheduleDelayDays { + Minimum, + U32(u32), +} +/// How frequently available funds are paid out. +/// One of: `daily`, `manual`, `weekly`, or `monthly`. +/// Default is `daily`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum UpdateAccountSettingsPayoutsScheduleInterval { + Daily, + Manual, + Monthly, + Weekly, +} +impl UpdateAccountSettingsPayoutsScheduleInterval { + pub fn as_str(self) -> &'static str { + use UpdateAccountSettingsPayoutsScheduleInterval::*; + match self { + Daily => "daily", + Manual => "manual", + Monthly => "monthly", + Weekly => "weekly", + } + } +} + +impl std::str::FromStr for UpdateAccountSettingsPayoutsScheduleInterval { + type Err = (); + fn from_str(s: &str) -> Result { + use UpdateAccountSettingsPayoutsScheduleInterval::*; + match s { + "daily" => Ok(Daily), + "manual" => Ok(Manual), + "monthly" => Ok(Monthly), + "weekly" => Ok(Weekly), + _ => Err(()), + } + } +} +impl std::fmt::Display for UpdateAccountSettingsPayoutsScheduleInterval { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for UpdateAccountSettingsPayoutsScheduleInterval { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for UpdateAccountSettingsPayoutsScheduleInterval { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// The day of the week when available funds are paid out, specified as `monday`, `tuesday`, etc. +/// (required and applicable only if `interval` is `weekly`.). +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum UpdateAccountSettingsPayoutsScheduleWeeklyAnchor { + Friday, + Monday, + Saturday, + Sunday, + Thursday, + Tuesday, + Wednesday, +} +impl UpdateAccountSettingsPayoutsScheduleWeeklyAnchor { + pub fn as_str(self) -> &'static str { + use UpdateAccountSettingsPayoutsScheduleWeeklyAnchor::*; + match self { + Friday => "friday", + Monday => "monday", + Saturday => "saturday", + Sunday => "sunday", + Thursday => "thursday", + Tuesday => "tuesday", + Wednesday => "wednesday", + } + } +} + +impl std::str::FromStr for UpdateAccountSettingsPayoutsScheduleWeeklyAnchor { + type Err = (); + fn from_str(s: &str) -> Result { + use UpdateAccountSettingsPayoutsScheduleWeeklyAnchor::*; + match s { + "friday" => Ok(Friday), + "monday" => Ok(Monday), + "saturday" => Ok(Saturday), + "sunday" => Ok(Sunday), + "thursday" => Ok(Thursday), + "tuesday" => Ok(Tuesday), + "wednesday" => Ok(Wednesday), + _ => Err(()), + } + } +} +impl std::fmt::Display for UpdateAccountSettingsPayoutsScheduleWeeklyAnchor { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for UpdateAccountSettingsPayoutsScheduleWeeklyAnchor { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for UpdateAccountSettingsPayoutsScheduleWeeklyAnchor { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'a> UpdateAccount<'a> { + /// Updates a [connected account](https://stripe.com/docs/connect/accounts) by setting the values of the parameters passed. + /// Any parameters not provided are. + /// left unchanged. + /// + /// For Custom accounts, you can update any information on the account. + /// For other accounts, you can update all information until that. + /// account has started to go through Connect Onboarding. + /// Once you create an [Account Link](https://stripe.com/docs/api/account_links) or [Account Session](https://stripe.com/docs/api/account_sessions),. + /// some properties can only be changed or updated for Custom accounts. + /// + /// To update your own account, use the [Dashboard](https://dashboard.stripe.com/settings/account). + /// Refer to our. + /// [Connect](https://stripe.com/docs/connect/updating-accounts) documentation to learn more about updating accounts. + pub fn send( + &self, + client: &stripe::Client, + account: &stripe_shared::AccountId, + ) -> stripe::Response { + client.send_form(&format!("/accounts/{account}"), self, http_types::Method::Post) + } +} +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct RejectAccount<'a> { + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, + /// The reason for rejecting the account. Can be `fraud`, `terms_of_service`, or `other`. + pub reason: &'a str, +} +impl<'a> RejectAccount<'a> { + pub fn new(reason: &'a str) -> Self { + Self { expand: None, reason } + } +} +impl<'a> RejectAccount<'a> { + /// With [Connect](https://stripe.com/docs/connect), you may flag accounts as suspicious. + /// + /// Test-mode Custom and Express accounts can be rejected at any time. + /// Accounts created using live-mode keys may only be rejected once all balances are zero. + pub fn send( + &self, + client: &stripe::Client, + account: &stripe_shared::AccountId, + ) -> stripe::Response { + client.send_form(&format!("/accounts/{account}/reject"), self, http_types::Method::Post) + } +} +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct AnnualRevenueSpecs<'a> { + /// A non-negative integer representing the amount in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal). + pub amount: i64, + /// Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. + /// Must be a [supported currency](https://stripe.com/docs/currencies). + pub currency: stripe_types::Currency, + /// The close-out date of the preceding fiscal year in ISO 8601 format. + /// E.g. + /// 2023-12-31 for the 31st of December, 2023. + pub fiscal_year_end: &'a str, +} +impl<'a> AnnualRevenueSpecs<'a> { + pub fn new(amount: i64, currency: stripe_types::Currency, fiscal_year_end: &'a str) -> Self { + Self { amount, currency, fiscal_year_end } + } +} +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct MonthlyEstimatedRevenueSpecs { + /// A non-negative integer representing how much to charge in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal). + pub amount: i64, + /// Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. + /// Must be a [supported currency](https://stripe.com/docs/currencies). + pub currency: stripe_types::Currency, +} +impl MonthlyEstimatedRevenueSpecs { + pub fn new(amount: i64, currency: stripe_types::Currency) -> Self { + Self { amount, currency } + } +} +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct AddressSpecs<'a> { + /// City, district, suburb, town, or village. + #[serde(skip_serializing_if = "Option::is_none")] + pub city: Option<&'a str>, + /// Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). + #[serde(skip_serializing_if = "Option::is_none")] + pub country: Option<&'a str>, + /// Address line 1 (e.g., street, PO Box, or company name). + #[serde(skip_serializing_if = "Option::is_none")] + pub line1: Option<&'a str>, + /// Address line 2 (e.g., apartment, suite, unit, or building). + #[serde(skip_serializing_if = "Option::is_none")] + pub line2: Option<&'a str>, + /// ZIP or postal code. + #[serde(skip_serializing_if = "Option::is_none")] + pub postal_code: Option<&'a str>, + /// State, county, province, or region. + #[serde(skip_serializing_if = "Option::is_none")] + pub state: Option<&'a str>, +} +impl<'a> AddressSpecs<'a> { + pub fn new() -> Self { + Self::default() + } +} +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CapabilityParam { + /// Passing true requests the capability for the account, if it is not already requested. + /// A requested capability may not immediately become active. + /// Any requirements to activate the capability are returned in the `requirements` arrays. + #[serde(skip_serializing_if = "Option::is_none")] + pub requested: Option, +} +impl CapabilityParam { + pub fn new() -> Self { + Self::default() + } +} +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CompanyOwnershipDeclaration<'a> { + /// The Unix timestamp marking when the beneficial owner attestation was made. + #[serde(skip_serializing_if = "Option::is_none")] + pub date: Option, + /// The IP address from which the beneficial owner attestation was made. + #[serde(skip_serializing_if = "Option::is_none")] + pub ip: Option<&'a str>, + /// The user agent of the browser from which the beneficial owner attestation was made. + #[serde(skip_serializing_if = "Option::is_none")] + pub user_agent: Option<&'a str>, +} +impl<'a> CompanyOwnershipDeclaration<'a> { + pub fn new() -> Self { + Self::default() + } +} +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct VerificationDocumentSpecs<'a> { + /// The back of a document returned by a [file upload](https://stripe.com/docs/api#create_file) with a `purpose` value of `additional_verification`. + /// The uploaded file needs to be a color image (smaller than 8,000px by 8,000px), in JPG, PNG, or PDF format, and less than 10 MB in size. + #[serde(skip_serializing_if = "Option::is_none")] + pub back: Option<&'a str>, + /// The front of a document returned by a [file upload](https://stripe.com/docs/api#create_file) with a `purpose` value of `additional_verification`. + /// The uploaded file needs to be a color image (smaller than 8,000px by 8,000px), in JPG, PNG, or PDF format, and less than 10 MB in size. + #[serde(skip_serializing_if = "Option::is_none")] + pub front: Option<&'a str>, +} +impl<'a> VerificationDocumentSpecs<'a> { + pub fn new() -> Self { + Self::default() + } +} +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct DocumentsParam<'a> { + /// One or more document ids returned by a [file upload](https://stripe.com/docs/api#create_file) with a `purpose` value of `account_requirement`. + #[serde(skip_serializing_if = "Option::is_none")] + pub files: Option<&'a [&'a str]>, +} +impl<'a> DocumentsParam<'a> { + pub fn new() -> Self { + Self::default() + } +} +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct DateOfBirthSpecs { + /// The day of birth, between 1 and 31. + pub day: i64, + /// The month of birth, between 1 and 12. + pub month: i64, + /// The four-digit year of birth. + pub year: i64, +} +impl DateOfBirthSpecs { + pub fn new(day: i64, month: i64, year: i64) -> Self { + Self { day, month, year } + } +} +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct IndividualRelationshipSpecs<'a> { + /// Whether the person is a director of the account's legal entity. + /// Directors are typically members of the governing board of the company, or responsible for ensuring the company meets its regulatory obligations. + #[serde(skip_serializing_if = "Option::is_none")] + pub director: Option, + /// Whether the person has significant responsibility to control, manage, or direct the organization. + #[serde(skip_serializing_if = "Option::is_none")] + pub executive: Option, + /// Whether the person is an owner of the account’s legal entity. + #[serde(skip_serializing_if = "Option::is_none")] + pub owner: Option, + /// The percent owned by the person of the account's legal entity. + #[serde(skip_serializing_if = "Option::is_none")] + pub percent_ownership: Option, + /// The person's title (e.g., CEO, Support Engineer). + #[serde(skip_serializing_if = "Option::is_none")] + pub title: Option<&'a str>, +} +impl<'a> IndividualRelationshipSpecs<'a> { + pub fn new() -> Self { + Self::default() + } +} +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct PersonVerificationDocumentSpecs<'a> { + /// The back of an ID returned by a [file upload](https://stripe.com/docs/api#create_file) with a `purpose` value of `identity_document`. + /// The uploaded file needs to be a color image (smaller than 8,000px by 8,000px), in JPG, PNG, or PDF format, and less than 10 MB in size. + #[serde(skip_serializing_if = "Option::is_none")] + pub back: Option<&'a str>, + /// The front of an ID returned by a [file upload](https://stripe.com/docs/api#create_file) with a `purpose` value of `identity_document`. + /// The uploaded file needs to be a color image (smaller than 8,000px by 8,000px), in JPG, PNG, or PDF format, and less than 10 MB in size. + #[serde(skip_serializing_if = "Option::is_none")] + pub front: Option<&'a str>, +} +impl<'a> PersonVerificationDocumentSpecs<'a> { + pub fn new() -> Self { + Self::default() + } +} +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct BacsDebitPaymentsSpecs<'a> { + /// The Bacs Direct Debit Display Name for this account. + /// For payments made with Bacs Direct Debit, this name appears on the mandate as the statement descriptor. + /// Mobile banking apps display it as the name of the business. + /// To use custom branding, set the Bacs Direct Debit Display Name during or right after creation. + /// Custom branding incurs an additional monthly fee for the platform. + /// If you don't set the display name before requesting Bacs capability, it's automatically set as "Stripe" and the account is onboarded to Stripe branding, which is free. + #[serde(skip_serializing_if = "Option::is_none")] + pub display_name: Option<&'a str>, +} +impl<'a> BacsDebitPaymentsSpecs<'a> { + pub fn new() -> Self { + Self::default() + } +} +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct BrandingSettingsSpecs<'a> { + /// (ID of a [file upload](https://stripe.com/docs/guides/file-upload)) An icon for the account. + /// Must be square and at least 128px x 128px. + #[serde(skip_serializing_if = "Option::is_none")] + pub icon: Option<&'a str>, + /// (ID of a [file upload](https://stripe.com/docs/guides/file-upload)) A logo for the account that will be used in Checkout instead of the icon and without the account's name next to it if provided. + /// Must be at least 128px x 128px. + #[serde(skip_serializing_if = "Option::is_none")] + pub logo: Option<&'a str>, + /// A CSS hex color value representing the primary branding color for this account. + #[serde(skip_serializing_if = "Option::is_none")] + pub primary_color: Option<&'a str>, + /// A CSS hex color value representing the secondary branding color for this account. + #[serde(skip_serializing_if = "Option::is_none")] + pub secondary_color: Option<&'a str>, +} +impl<'a> BrandingSettingsSpecs<'a> { + pub fn new() -> Self { + Self::default() + } +} +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct SettingsTermsOfServiceSpecs<'a> { + /// The Unix timestamp marking when the account representative accepted the service agreement. + #[serde(skip_serializing_if = "Option::is_none")] + pub date: Option, + /// The IP address from which the account representative accepted the service agreement. + #[serde(skip_serializing_if = "Option::is_none")] + pub ip: Option<&'a str>, + /// The user agent of the browser from which the account representative accepted the service agreement. + #[serde(skip_serializing_if = "Option::is_none")] + pub user_agent: Option<&'a str>, +} +impl<'a> SettingsTermsOfServiceSpecs<'a> { + pub fn new() -> Self { + Self::default() + } +} +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct DeclineChargeOnSpecs { + /// Whether Stripe automatically declines charges with an incorrect ZIP or postal code. + /// This setting only applies when a ZIP or postal code is provided and they fail bank verification. + #[serde(skip_serializing_if = "Option::is_none")] + pub avs_failure: Option, + /// Whether Stripe automatically declines charges with an incorrect CVC. + /// This setting only applies when a CVC is provided and it fails bank verification. + #[serde(skip_serializing_if = "Option::is_none")] + pub cvc_failure: Option, +} +impl DeclineChargeOnSpecs { + pub fn new() -> Self { + Self::default() + } +} +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct PaymentsSettingsSpecs<'a> { + /// The default text that appears on credit card statements when a charge is made. + /// This field prefixes any dynamic `statement_descriptor` specified on the charge. + #[serde(skip_serializing_if = "Option::is_none")] + pub statement_descriptor: Option<&'a str>, + /// The Kana variation of the default text that appears on credit card statements when a charge is made (Japan only). + #[serde(skip_serializing_if = "Option::is_none")] + pub statement_descriptor_kana: Option<&'a str>, + /// The Kanji variation of the default text that appears on credit card statements when a charge is made (Japan only). + #[serde(skip_serializing_if = "Option::is_none")] + pub statement_descriptor_kanji: Option<&'a str>, +} +impl<'a> PaymentsSettingsSpecs<'a> { + pub fn new() -> Self { + Self::default() + } +} +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct TosAcceptanceSpecs<'a> { + /// The Unix timestamp marking when the account representative accepted their service agreement. + #[serde(skip_serializing_if = "Option::is_none")] + pub date: Option, + /// The IP address from which the account representative accepted their service agreement. + #[serde(skip_serializing_if = "Option::is_none")] + pub ip: Option<&'a str>, + /// The user's service agreement type. + #[serde(skip_serializing_if = "Option::is_none")] + pub service_agreement: Option<&'a str>, + /// The user agent of the browser from which the account representative accepted their service agreement. + #[serde(skip_serializing_if = "Option::is_none")] + pub user_agent: Option<&'a str>, +} +impl<'a> TosAcceptanceSpecs<'a> { + pub fn new() -> Self { + Self::default() + } +} +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct BusinessProfileSpecs<'a> { + /// The applicant's gross annual revenue for its preceding fiscal year. + #[serde(skip_serializing_if = "Option::is_none")] + pub annual_revenue: Option>, + /// An estimated upper bound of employees, contractors, vendors, etc. + /// currently working for the business. + #[serde(skip_serializing_if = "Option::is_none")] + pub estimated_worker_count: Option, + /// [The merchant category code for the account](https://stripe.com/docs/connect/setting-mcc). + /// MCCs are used to classify businesses based on the goods or services they provide. + #[serde(skip_serializing_if = "Option::is_none")] + pub mcc: Option<&'a str>, + /// An estimate of the monthly revenue of the business. Only accepted for accounts in Brazil and India. + #[serde(skip_serializing_if = "Option::is_none")] + pub monthly_estimated_revenue: Option, + /// The customer-facing business name. + #[serde(skip_serializing_if = "Option::is_none")] + pub name: Option<&'a str>, + /// Internal-only description of the product sold by, or service provided by, the business. + /// Used by Stripe for risk and underwriting purposes. + #[serde(skip_serializing_if = "Option::is_none")] + pub product_description: Option<&'a str>, + /// A publicly available mailing address for sending support issues to. + #[serde(skip_serializing_if = "Option::is_none")] + pub support_address: Option>, + /// A publicly available email address for sending support issues to. + #[serde(skip_serializing_if = "Option::is_none")] + pub support_email: Option<&'a str>, + /// A publicly available phone number to call with support issues. + #[serde(skip_serializing_if = "Option::is_none")] + pub support_phone: Option<&'a str>, + /// A publicly available website for handling support issues. + #[serde(skip_serializing_if = "Option::is_none")] + pub support_url: Option<&'a str>, + /// The business's publicly available website. + #[serde(skip_serializing_if = "Option::is_none")] + pub url: Option<&'a str>, +} +impl<'a> BusinessProfileSpecs<'a> { + pub fn new() -> Self { + Self::default() + } +} +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CapabilitiesParam { + /// The acss_debit_payments capability. + #[serde(skip_serializing_if = "Option::is_none")] + pub acss_debit_payments: Option, + /// The affirm_payments capability. + #[serde(skip_serializing_if = "Option::is_none")] + pub affirm_payments: Option, + /// The afterpay_clearpay_payments capability. + #[serde(skip_serializing_if = "Option::is_none")] + pub afterpay_clearpay_payments: Option, + /// The au_becs_debit_payments capability. + #[serde(skip_serializing_if = "Option::is_none")] + pub au_becs_debit_payments: Option, + /// The bacs_debit_payments capability. + #[serde(skip_serializing_if = "Option::is_none")] + pub bacs_debit_payments: Option, + /// The bancontact_payments capability. + #[serde(skip_serializing_if = "Option::is_none")] + pub bancontact_payments: Option, + /// The bank_transfer_payments capability. + #[serde(skip_serializing_if = "Option::is_none")] + pub bank_transfer_payments: Option, + /// The blik_payments capability. + #[serde(skip_serializing_if = "Option::is_none")] + pub blik_payments: Option, + /// The boleto_payments capability. + #[serde(skip_serializing_if = "Option::is_none")] + pub boleto_payments: Option, + /// The card_issuing capability. + #[serde(skip_serializing_if = "Option::is_none")] + pub card_issuing: Option, + /// The card_payments capability. + #[serde(skip_serializing_if = "Option::is_none")] + pub card_payments: Option, + /// The cartes_bancaires_payments capability. + #[serde(skip_serializing_if = "Option::is_none")] + pub cartes_bancaires_payments: Option, + /// The cashapp_payments capability. + #[serde(skip_serializing_if = "Option::is_none")] + pub cashapp_payments: Option, + /// The eps_payments capability. + #[serde(skip_serializing_if = "Option::is_none")] + pub eps_payments: Option, + /// The fpx_payments capability. + #[serde(skip_serializing_if = "Option::is_none")] + pub fpx_payments: Option, + /// The giropay_payments capability. + #[serde(skip_serializing_if = "Option::is_none")] + pub giropay_payments: Option, + /// The grabpay_payments capability. + #[serde(skip_serializing_if = "Option::is_none")] + pub grabpay_payments: Option, + /// The ideal_payments capability. + #[serde(skip_serializing_if = "Option::is_none")] + pub ideal_payments: Option, + /// The india_international_payments capability. + #[serde(skip_serializing_if = "Option::is_none")] + pub india_international_payments: Option, + /// The jcb_payments capability. + #[serde(skip_serializing_if = "Option::is_none")] + pub jcb_payments: Option, + /// The klarna_payments capability. + #[serde(skip_serializing_if = "Option::is_none")] + pub klarna_payments: Option, + /// The konbini_payments capability. + #[serde(skip_serializing_if = "Option::is_none")] + pub konbini_payments: Option, + /// The legacy_payments capability. + #[serde(skip_serializing_if = "Option::is_none")] + pub legacy_payments: Option, + /// The link_payments capability. + #[serde(skip_serializing_if = "Option::is_none")] + pub link_payments: Option, + /// The oxxo_payments capability. + #[serde(skip_serializing_if = "Option::is_none")] + pub oxxo_payments: Option, + /// The p24_payments capability. + #[serde(skip_serializing_if = "Option::is_none")] + pub p24_payments: Option, + /// The paynow_payments capability. + #[serde(skip_serializing_if = "Option::is_none")] + pub paynow_payments: Option, + /// The promptpay_payments capability. + #[serde(skip_serializing_if = "Option::is_none")] + pub promptpay_payments: Option, + /// The revolut_pay_payments capability. + #[serde(skip_serializing_if = "Option::is_none")] + pub revolut_pay_payments: Option, + /// The sepa_debit_payments capability. + #[serde(skip_serializing_if = "Option::is_none")] + pub sepa_debit_payments: Option, + /// The sofort_payments capability. + #[serde(skip_serializing_if = "Option::is_none")] + pub sofort_payments: Option, + /// The swish_payments capability. + #[serde(skip_serializing_if = "Option::is_none")] + pub swish_payments: Option, + /// The tax_reporting_us_1099_k capability. + #[serde(skip_serializing_if = "Option::is_none")] + pub tax_reporting_us_1099_k: Option, + /// The tax_reporting_us_1099_misc capability. + #[serde(skip_serializing_if = "Option::is_none")] + pub tax_reporting_us_1099_misc: Option, + /// The transfers capability. + #[serde(skip_serializing_if = "Option::is_none")] + pub transfers: Option, + /// The treasury capability. + #[serde(skip_serializing_if = "Option::is_none")] + pub treasury: Option, + /// The us_bank_account_ach_payments capability. + #[serde(skip_serializing_if = "Option::is_none")] + pub us_bank_account_ach_payments: Option, + /// The zip_payments capability. + #[serde(skip_serializing_if = "Option::is_none")] + pub zip_payments: Option, +} +impl CapabilitiesParam { + pub fn new() -> Self { + Self::default() + } +} +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct VerificationSpecs<'a> { + /// A document verifying the business. + #[serde(skip_serializing_if = "Option::is_none")] + pub document: Option>, +} +impl<'a> VerificationSpecs<'a> { + pub fn new() -> Self { + Self::default() + } +} +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct DocumentsSpecs<'a> { + /// One or more documents that support the [Bank account ownership verification](https://support.stripe.com/questions/bank-account-ownership-verification) requirement. + /// Must be a document associated with the account’s primary active bank account that displays the last 4 digits of the account number, either a statement or a voided check. + #[serde(skip_serializing_if = "Option::is_none")] + pub bank_account_ownership_verification: Option>, + /// One or more documents that demonstrate proof of a company's license to operate. + #[serde(skip_serializing_if = "Option::is_none")] + pub company_license: Option>, + /// One or more documents showing the company's Memorandum of Association. + #[serde(skip_serializing_if = "Option::is_none")] + pub company_memorandum_of_association: Option>, + /// (Certain countries only) One or more documents showing the ministerial decree legalizing the company's establishment. + #[serde(skip_serializing_if = "Option::is_none")] + pub company_ministerial_decree: Option>, + /// One or more documents that demonstrate proof of a company's registration with the appropriate local authorities. + #[serde(skip_serializing_if = "Option::is_none")] + pub company_registration_verification: Option>, + /// One or more documents that demonstrate proof of a company's tax ID. + #[serde(skip_serializing_if = "Option::is_none")] + pub company_tax_id_verification: Option>, + /// One or more documents showing the company’s proof of registration with the national business registry. + #[serde(skip_serializing_if = "Option::is_none")] + pub proof_of_registration: Option>, +} +impl<'a> DocumentsSpecs<'a> { + pub fn new() -> Self { + Self::default() + } +} +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct PersonVerificationSpecs<'a> { + /// A document showing address, either a passport, local ID card, or utility bill from a well-known utility company. + #[serde(skip_serializing_if = "Option::is_none")] + pub additional_document: Option>, + /// An identifying document, either a passport or local ID card. + #[serde(skip_serializing_if = "Option::is_none")] + pub document: Option>, +} +impl<'a> PersonVerificationSpecs<'a> { + pub fn new() -> Self { + Self::default() + } +} +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CardIssuingSettingsSpecs<'a> { + /// Details on the account's acceptance of the [Stripe Issuing Terms and Disclosures](https://stripe.com/docs/issuing/connect/tos_acceptance). + #[serde(skip_serializing_if = "Option::is_none")] + pub tos_acceptance: Option>, +} +impl<'a> CardIssuingSettingsSpecs<'a> { + pub fn new() -> Self { + Self::default() + } +} +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CardPaymentsSettingsSpecs<'a> { + /// Automatically declines certain charge types regardless of whether the card issuer accepted or declined the charge. + #[serde(skip_serializing_if = "Option::is_none")] + pub decline_on: Option, + /// The default text that appears on credit card statements when a charge is made. + /// This field prefixes any dynamic `statement_descriptor` specified on the charge. + /// `statement_descriptor_prefix` is useful for maximizing descriptor space for the dynamic portion. + #[serde(skip_serializing_if = "Option::is_none")] + pub statement_descriptor_prefix: Option<&'a str>, + /// The Kana variation of the default text that appears on credit card statements when a charge is made (Japan only). + /// This field prefixes any dynamic `statement_descriptor_suffix_kana` specified on the charge. + /// `statement_descriptor_prefix_kana` is useful for maximizing descriptor space for the dynamic portion. + #[serde(skip_serializing_if = "Option::is_none")] + pub statement_descriptor_prefix_kana: Option<&'a str>, + /// The Kanji variation of the default text that appears on credit card statements when a charge is made (Japan only). + /// This field prefixes any dynamic `statement_descriptor_suffix_kanji` specified on the charge. + /// `statement_descriptor_prefix_kanji` is useful for maximizing descriptor space for the dynamic portion. + #[serde(skip_serializing_if = "Option::is_none")] + pub statement_descriptor_prefix_kanji: Option<&'a str>, +} +impl<'a> CardPaymentsSettingsSpecs<'a> { + pub fn new() -> Self { + Self::default() + } +} +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct TreasurySettingsSpecs<'a> { + /// Details on the account's acceptance of the Stripe Treasury Services Agreement. + #[serde(skip_serializing_if = "Option::is_none")] + pub tos_acceptance: Option>, +} +impl<'a> TreasurySettingsSpecs<'a> { + pub fn new() -> Self { + Self::default() + } +} diff --git a/generated/stripe_connect/src/account_link/mod.rs b/generated/stripe_connect/src/account_link/mod.rs new file mode 100644 index 000000000..2b5904d69 --- /dev/null +++ b/generated/stripe_connect/src/account_link/mod.rs @@ -0,0 +1,5 @@ +#[cfg(feature = "account_link")] +mod requests; +pub(crate) mod types; +#[cfg(feature = "account_link")] +pub use requests::*; diff --git a/generated/stripe_connect/src/account_link/requests.rs b/generated/stripe_connect/src/account_link/requests.rs new file mode 100644 index 000000000..3491c04a2 --- /dev/null +++ b/generated/stripe_connect/src/account_link/requests.rs @@ -0,0 +1,248 @@ +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreateAccountLink<'a> { + /// The identifier of the account to create an account link for. + pub account: &'a str, + /// The collect parameter is deprecated. Use `collection_options` instead. + #[serde(skip_serializing_if = "Option::is_none")] + pub collect: Option, + /// Specifies the requirements that Stripe collects from connected accounts in the Connect Onboarding flow. + #[serde(skip_serializing_if = "Option::is_none")] + pub collection_options: Option, + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, + /// The URL the user will be redirected to if the account link is expired, has been previously-visited, or is otherwise invalid. + /// The URL you specify should attempt to generate a new account link with the same parameters used to create the original account link, then redirect the user to the new account link's URL so they can continue with Connect Onboarding. + /// If a new account link cannot be generated or the redirect fails you should display a useful error to the user. + #[serde(skip_serializing_if = "Option::is_none")] + pub refresh_url: Option<&'a str>, + /// The URL that the user will be redirected to upon leaving or completing the linked flow. + #[serde(skip_serializing_if = "Option::is_none")] + pub return_url: Option<&'a str>, + /// The type of account link the user is requesting. + /// Possible values are `account_onboarding` or `account_update`. + #[serde(rename = "type")] + pub type_: CreateAccountLinkType, +} +impl<'a> CreateAccountLink<'a> { + pub fn new(account: &'a str, type_: CreateAccountLinkType) -> Self { + Self { + account, + collect: None, + collection_options: None, + expand: None, + refresh_url: None, + return_url: None, + type_, + } + } +} +/// The collect parameter is deprecated. Use `collection_options` instead. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreateAccountLinkCollect { + CurrentlyDue, + EventuallyDue, +} +impl CreateAccountLinkCollect { + pub fn as_str(self) -> &'static str { + use CreateAccountLinkCollect::*; + match self { + CurrentlyDue => "currently_due", + EventuallyDue => "eventually_due", + } + } +} + +impl std::str::FromStr for CreateAccountLinkCollect { + type Err = (); + fn from_str(s: &str) -> Result { + use CreateAccountLinkCollect::*; + match s { + "currently_due" => Ok(CurrentlyDue), + "eventually_due" => Ok(EventuallyDue), + _ => Err(()), + } + } +} +impl std::fmt::Display for CreateAccountLinkCollect { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreateAccountLinkCollect { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreateAccountLinkCollect { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Specifies the requirements that Stripe collects from connected accounts in the Connect Onboarding flow. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreateAccountLinkCollectionOptions { + /// Specifies whether the platform collects only currently_due requirements (`currently_due`) or both currently_due and eventually_due requirements (`eventually_due`). + /// If you don't specify `collection_options`, the default value is `currently_due`. + pub fields: CreateAccountLinkCollectionOptionsFields, + /// Specifies whether the platform collects future_requirements in addition to requirements in Connect Onboarding. + /// The default value is `omit`. + #[serde(skip_serializing_if = "Option::is_none")] + pub future_requirements: Option, +} +impl CreateAccountLinkCollectionOptions { + pub fn new(fields: CreateAccountLinkCollectionOptionsFields) -> Self { + Self { fields, future_requirements: None } + } +} +/// Specifies whether the platform collects only currently_due requirements (`currently_due`) or both currently_due and eventually_due requirements (`eventually_due`). +/// If you don't specify `collection_options`, the default value is `currently_due`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreateAccountLinkCollectionOptionsFields { + CurrentlyDue, + EventuallyDue, +} +impl CreateAccountLinkCollectionOptionsFields { + pub fn as_str(self) -> &'static str { + use CreateAccountLinkCollectionOptionsFields::*; + match self { + CurrentlyDue => "currently_due", + EventuallyDue => "eventually_due", + } + } +} + +impl std::str::FromStr for CreateAccountLinkCollectionOptionsFields { + type Err = (); + fn from_str(s: &str) -> Result { + use CreateAccountLinkCollectionOptionsFields::*; + match s { + "currently_due" => Ok(CurrentlyDue), + "eventually_due" => Ok(EventuallyDue), + _ => Err(()), + } + } +} +impl std::fmt::Display for CreateAccountLinkCollectionOptionsFields { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreateAccountLinkCollectionOptionsFields { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreateAccountLinkCollectionOptionsFields { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Specifies whether the platform collects future_requirements in addition to requirements in Connect Onboarding. +/// The default value is `omit`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreateAccountLinkCollectionOptionsFutureRequirements { + Include, + Omit, +} +impl CreateAccountLinkCollectionOptionsFutureRequirements { + pub fn as_str(self) -> &'static str { + use CreateAccountLinkCollectionOptionsFutureRequirements::*; + match self { + Include => "include", + Omit => "omit", + } + } +} + +impl std::str::FromStr for CreateAccountLinkCollectionOptionsFutureRequirements { + type Err = (); + fn from_str(s: &str) -> Result { + use CreateAccountLinkCollectionOptionsFutureRequirements::*; + match s { + "include" => Ok(Include), + "omit" => Ok(Omit), + _ => Err(()), + } + } +} +impl std::fmt::Display for CreateAccountLinkCollectionOptionsFutureRequirements { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreateAccountLinkCollectionOptionsFutureRequirements { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreateAccountLinkCollectionOptionsFutureRequirements { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// The type of account link the user is requesting. +/// Possible values are `account_onboarding` or `account_update`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreateAccountLinkType { + AccountOnboarding, + AccountUpdate, +} +impl CreateAccountLinkType { + pub fn as_str(self) -> &'static str { + use CreateAccountLinkType::*; + match self { + AccountOnboarding => "account_onboarding", + AccountUpdate => "account_update", + } + } +} + +impl std::str::FromStr for CreateAccountLinkType { + type Err = (); + fn from_str(s: &str) -> Result { + use CreateAccountLinkType::*; + match s { + "account_onboarding" => Ok(AccountOnboarding), + "account_update" => Ok(AccountUpdate), + _ => Err(()), + } + } +} +impl std::fmt::Display for CreateAccountLinkType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreateAccountLinkType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreateAccountLinkType { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'a> CreateAccountLink<'a> { + /// Creates an AccountLink object that includes a single-use Stripe URL that the platform can redirect their user to in order to take them through the Connect Onboarding flow. + pub fn send(&self, client: &stripe::Client) -> stripe::Response { + client.send_form("/account_links", self, http_types::Method::Post) + } +} diff --git a/generated/stripe_connect/src/account_link/types.rs b/generated/stripe_connect/src/account_link/types.rs new file mode 100644 index 000000000..1ffdeab70 --- /dev/null +++ b/generated/stripe_connect/src/account_link/types.rs @@ -0,0 +1,15 @@ +/// Account Links are the means by which a Connect platform grants a connected account permission to access. +/// Stripe-hosted applications, such as Connect Onboarding. +/// +/// Related guide: [Connect Onboarding](https://stripe.com/docs/connect/custom/hosted-onboarding) +/// +/// For more details see <>. +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct AccountLink { + /// Time at which the object was created. Measured in seconds since the Unix epoch. + pub created: stripe_types::Timestamp, + /// The timestamp at which this account link will expire. + pub expires_at: stripe_types::Timestamp, + /// The URL for the account link. + pub url: String, +} diff --git a/generated/stripe_connect/src/account_session/mod.rs b/generated/stripe_connect/src/account_session/mod.rs new file mode 100644 index 000000000..423ac7ac5 --- /dev/null +++ b/generated/stripe_connect/src/account_session/mod.rs @@ -0,0 +1,5 @@ +#[cfg(feature = "account_session")] +mod requests; +pub(crate) mod types; +#[cfg(feature = "account_session")] +pub use requests::*; diff --git a/generated/stripe_connect/src/account_session/requests.rs b/generated/stripe_connect/src/account_session/requests.rs new file mode 100644 index 000000000..1cee91316 --- /dev/null +++ b/generated/stripe_connect/src/account_session/requests.rs @@ -0,0 +1,127 @@ +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreateAccountSession<'a> { + /// The identifier of the account to create an Account Session for. + pub account: &'a str, + /// Each key of the dictionary represents an embedded component, and each embedded component maps to its configuration (e.g. + /// whether it has been enabled or not). + pub components: CreateAccountSessionComponents<'a>, + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, +} +impl<'a> CreateAccountSession<'a> { + pub fn new(account: &'a str, components: CreateAccountSessionComponents<'a>) -> Self { + Self { account, components, expand: None } + } +} +/// Each key of the dictionary represents an embedded component, and each embedded component maps to its configuration (e.g. +/// whether it has been enabled or not). +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreateAccountSessionComponents<'a> { + /// Configuration for the account onboarding embedded component. + #[serde(skip_serializing_if = "Option::is_none")] + pub account_onboarding: Option>, + /// Configuration for the payment details embedded component. + #[serde(skip_serializing_if = "Option::is_none")] + pub payment_details: Option, + /// Configuration for the payments embedded component. + #[serde(skip_serializing_if = "Option::is_none")] + pub payments: Option, + /// Configuration for the payouts embedded component. + #[serde(skip_serializing_if = "Option::is_none")] + pub payouts: Option, +} +impl<'a> CreateAccountSessionComponents<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// Configuration for the account onboarding embedded component. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreateAccountSessionComponentsAccountOnboarding<'a> { + /// Whether the embedded component is enabled. + pub enabled: bool, + /// The list of features enabled in the embedded component. + #[serde(skip_serializing_if = "Option::is_none")] + pub features: Option<&'a serde_json::Value>, +} +impl<'a> CreateAccountSessionComponentsAccountOnboarding<'a> { + pub fn new(enabled: bool) -> Self { + Self { enabled, features: None } + } +} +/// Configuration for the payouts embedded component. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreateAccountSessionComponentsPayouts { + /// Whether the embedded component is enabled. + pub enabled: bool, + /// The list of features enabled in the embedded component. + #[serde(skip_serializing_if = "Option::is_none")] + pub features: Option, +} +impl CreateAccountSessionComponentsPayouts { + pub fn new(enabled: bool) -> Self { + Self { enabled, features: None } + } +} +/// The list of features enabled in the embedded component. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreateAccountSessionComponentsPayoutsFeatures { + /// Whether to allow payout schedule to be changed. + /// Default `true` when Stripe owns Loss Liability, default `false` otherwise. + #[serde(skip_serializing_if = "Option::is_none")] + pub edit_payout_schedule: Option, + /// Whether to allow creation of instant payouts. + /// Default `true` when Stripe owns Loss Liability, default `false` otherwise. + #[serde(skip_serializing_if = "Option::is_none")] + pub instant_payouts: Option, + /// Whether to allow creation of standard payouts. + /// Default `true` when Stripe owns Loss Liability, default `false` otherwise. + #[serde(skip_serializing_if = "Option::is_none")] + pub standard_payouts: Option, +} +impl CreateAccountSessionComponentsPayoutsFeatures { + pub fn new() -> Self { + Self::default() + } +} +impl<'a> CreateAccountSession<'a> { + /// Creates a AccountSession object that includes a single-use token that the platform can use on their front-end to grant client-side API access. + pub fn send( + &self, + client: &stripe::Client, + ) -> stripe::Response { + client.send_form("/account_sessions", self, http_types::Method::Post) + } +} +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct PaymentsFeaturesParam { + /// Whether to allow capturing and cancelling payment intents. This is `true` by default. + #[serde(skip_serializing_if = "Option::is_none")] + pub capture_payments: Option, + /// Whether to allow responding to disputes, including submitting evidence and accepting disputes. + /// This is `true` by default. + #[serde(skip_serializing_if = "Option::is_none")] + pub dispute_management: Option, + /// Whether to allow sending refunds. This is `true` by default. + #[serde(skip_serializing_if = "Option::is_none")] + pub refund_management: Option, +} +impl PaymentsFeaturesParam { + pub fn new() -> Self { + Self::default() + } +} +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct PaymentsConfigParam { + /// Whether the embedded component is enabled. + pub enabled: bool, + /// The list of features enabled in the embedded component. + #[serde(skip_serializing_if = "Option::is_none")] + pub features: Option, +} +impl PaymentsConfigParam { + pub fn new(enabled: bool) -> Self { + Self { enabled, features: None } + } +} diff --git a/generated/stripe_connect/src/account_session/types.rs b/generated/stripe_connect/src/account_session/types.rs new file mode 100644 index 000000000..d52d57633 --- /dev/null +++ b/generated/stripe_connect/src/account_session/types.rs @@ -0,0 +1,28 @@ +/// An AccountSession allows a Connect platform to grant access to a connected account in Connect embedded components. +/// +/// We recommend that you create an AccountSession each time you need to display an embedded component +/// to your user. Do not save AccountSessions to your database as they expire relatively +/// quickly, and cannot be used more than once. +/// +/// Related guide: [Connect embedded components](https://stripe.com/docs/connect/get-started-connect-embedded-components). +/// +/// For more details see <>. +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct AccountSession { + /// The ID of the account the AccountSession was created for + pub account: String, + /// The client secret of this AccountSession. + /// Used on the client to set up secure access to the given `account`. + /// + /// The client secret can be used to provide access to `account` from your frontend. + /// It should not be stored, logged, or exposed to anyone other than the connected account. + /// Make sure that you have TLS enabled on any page that includes the client secret. + /// + /// Refer to our docs to [setup Connect embedded components](https://stripe.com/docs/connect/get-started-connect-embedded-components) and learn about how `client_secret` should be handled. + pub client_secret: String, + pub components: stripe_connect::ConnectEmbeddedAccountSessionCreateComponents, + /// The timestamp at which this AccountSession will expire. + pub expires_at: stripe_types::Timestamp, + /// Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + pub livemode: bool, +} diff --git a/generated/stripe_connect/src/application_fee/mod.rs b/generated/stripe_connect/src/application_fee/mod.rs new file mode 100644 index 000000000..7d45b6cd3 --- /dev/null +++ b/generated/stripe_connect/src/application_fee/mod.rs @@ -0,0 +1,4 @@ +#[cfg(feature = "application_fee")] +mod requests; +#[cfg(feature = "application_fee")] +pub use requests::*; diff --git a/generated/stripe_connect/src/application_fee/requests.rs b/generated/stripe_connect/src/application_fee/requests.rs new file mode 100644 index 000000000..fd0430123 --- /dev/null +++ b/generated/stripe_connect/src/application_fee/requests.rs @@ -0,0 +1,67 @@ +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct ListApplicationFee<'a> { + /// Only return application fees for the charge specified by this charge ID. + #[serde(skip_serializing_if = "Option::is_none")] + pub charge: Option<&'a str>, + #[serde(skip_serializing_if = "Option::is_none")] + pub created: Option, + /// A cursor for use in pagination. + /// `ending_before` is an object ID that defines your place in the list. + /// For instance, if you make a list request and receive 100 objects, starting with `obj_bar`, your subsequent call can include `ending_before=obj_bar` in order to fetch the previous page of the list. + #[serde(skip_serializing_if = "Option::is_none")] + pub ending_before: Option<&'a str>, + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, + /// A limit on the number of objects to be returned. + /// Limit can range between 1 and 100, and the default is 10. + #[serde(skip_serializing_if = "Option::is_none")] + pub limit: Option, + /// A cursor for use in pagination. + /// `starting_after` is an object ID that defines your place in the list. + /// For instance, if you make a list request and receive 100 objects, ending with `obj_foo`, your subsequent call can include `starting_after=obj_foo` in order to fetch the next page of the list. + #[serde(skip_serializing_if = "Option::is_none")] + pub starting_after: Option<&'a str>, +} +impl<'a> ListApplicationFee<'a> { + pub fn new() -> Self { + Self::default() + } +} +impl<'a> ListApplicationFee<'a> { + /// Returns a list of application fees you’ve previously collected. + /// The application fees are returned in sorted order, with the most recent fees appearing first. + pub fn send( + &self, + client: &stripe::Client, + ) -> stripe::Response> { + client.get_query("/application_fees", self) + } + pub fn paginate( + self, + ) -> stripe::ListPaginator> { + stripe::ListPaginator::from_list_params("/application_fees", self) + } +} +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct RetrieveApplicationFee<'a> { + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, +} +impl<'a> RetrieveApplicationFee<'a> { + pub fn new() -> Self { + Self::default() + } +} +impl<'a> RetrieveApplicationFee<'a> { + /// Retrieves the details of an application fee that your account has collected. + /// The same information is returned when refunding the application fee. + pub fn send( + &self, + client: &stripe::Client, + id: &stripe_shared::ApplicationFeeId, + ) -> stripe::Response { + client.get_query(&format!("/application_fees/{id}"), self) + } +} diff --git a/generated/stripe_connect/src/application_fee_refund/mod.rs b/generated/stripe_connect/src/application_fee_refund/mod.rs new file mode 100644 index 000000000..04554686a --- /dev/null +++ b/generated/stripe_connect/src/application_fee_refund/mod.rs @@ -0,0 +1,4 @@ +#[cfg(feature = "application_fee_refund")] +mod requests; +#[cfg(feature = "application_fee_refund")] +pub use requests::*; diff --git a/generated/stripe_connect/src/application_fee_refund/requests.rs b/generated/stripe_connect/src/application_fee_refund/requests.rs new file mode 100644 index 000000000..116188b58 --- /dev/null +++ b/generated/stripe_connect/src/application_fee_refund/requests.rs @@ -0,0 +1,139 @@ +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct RetrieveApplicationFeeRefund<'a> { + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, +} +impl<'a> RetrieveApplicationFeeRefund<'a> { + pub fn new() -> Self { + Self::default() + } +} +impl<'a> RetrieveApplicationFeeRefund<'a> { + /// By default, you can see the 10 most recent refunds stored directly on the application fee object, but you can also retrieve details about a specific refund stored on the application fee. + pub fn send( + &self, + client: &stripe::Client, + fee: &stripe_shared::ApplicationFeeId, + id: &str, + ) -> stripe::Response { + client.get_query(&format!("/application_fees/{fee}/refunds/{id}"), self) + } +} +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct ListIdApplicationFeeRefund<'a> { + /// A cursor for use in pagination. + /// `ending_before` is an object ID that defines your place in the list. + /// For instance, if you make a list request and receive 100 objects, starting with `obj_bar`, your subsequent call can include `ending_before=obj_bar` in order to fetch the previous page of the list. + #[serde(skip_serializing_if = "Option::is_none")] + pub ending_before: Option<&'a str>, + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, + /// A limit on the number of objects to be returned. + /// Limit can range between 1 and 100, and the default is 10. + #[serde(skip_serializing_if = "Option::is_none")] + pub limit: Option, + /// A cursor for use in pagination. + /// `starting_after` is an object ID that defines your place in the list. + /// For instance, if you make a list request and receive 100 objects, ending with `obj_foo`, your subsequent call can include `starting_after=obj_foo` in order to fetch the next page of the list. + #[serde(skip_serializing_if = "Option::is_none")] + pub starting_after: Option<&'a str>, +} +impl<'a> ListIdApplicationFeeRefund<'a> { + pub fn new() -> Self { + Self::default() + } +} +impl<'a> ListIdApplicationFeeRefund<'a> { + /// You can see a list of the refunds belonging to a specific application fee. + /// Note that the 10 most recent refunds are always available by default on the application fee object. + /// If you need more than those 10, you can use this API method and the `limit` and `starting_after` parameters to page through additional refunds. + pub fn send( + &self, + client: &stripe::Client, + id: &stripe_shared::ApplicationFeeId, + ) -> stripe::Response> { + client.get_query(&format!("/application_fees/{id}/refunds"), self) + } + pub fn paginate( + self, + id: &stripe_shared::ApplicationFeeId, + ) -> stripe::ListPaginator> { + stripe::ListPaginator::from_list_params(&format!("/application_fees/{id}/refunds"), self) + } +} +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdateApplicationFeeRefund<'a> { + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, + /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. + /// This can be useful for storing additional information about the object in a structured format. + /// Individual keys can be unset by posting an empty value to them. + /// All keys can be unset by posting an empty value to `metadata`. + #[serde(skip_serializing_if = "Option::is_none")] + pub metadata: Option<&'a std::collections::HashMap>, +} +impl<'a> UpdateApplicationFeeRefund<'a> { + pub fn new() -> Self { + Self::default() + } +} +impl<'a> UpdateApplicationFeeRefund<'a> { + /// Updates the specified application fee refund by setting the values of the parameters passed. + /// Any parameters not provided will be left unchanged. + /// + /// This request only accepts metadata as an argument. + pub fn send( + &self, + client: &stripe::Client, + fee: &stripe_shared::ApplicationFeeId, + id: &str, + ) -> stripe::Response { + client.send_form( + &format!("/application_fees/{fee}/refunds/{id}"), + self, + http_types::Method::Post, + ) + } +} +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreateIdApplicationFeeRefund<'a> { + /// A positive integer, in _cents (or local equivalent)_, representing how much of this fee to refund. + /// Can refund only up to the remaining unrefunded amount of the fee. + #[serde(skip_serializing_if = "Option::is_none")] + pub amount: Option, + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, + /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. + /// This can be useful for storing additional information about the object in a structured format. + /// Individual keys can be unset by posting an empty value to them. + /// All keys can be unset by posting an empty value to `metadata`. + #[serde(skip_serializing_if = "Option::is_none")] + pub metadata: Option<&'a std::collections::HashMap>, +} +impl<'a> CreateIdApplicationFeeRefund<'a> { + pub fn new() -> Self { + Self::default() + } +} +impl<'a> CreateIdApplicationFeeRefund<'a> { + /// Refunds an application fee that has previously been collected but not yet refunded. + /// Funds will be refunded to the Stripe account from which the fee was originally collected. + /// + /// You can optionally refund only part of an application fee. + /// You can do so multiple times, until the entire fee has been refunded. + /// + /// Once entirely refunded, an application fee can’t be refunded again. + /// This method will raise an error when called on an already-refunded application fee, + /// or when trying to refund more money than is left on an application fee. + pub fn send( + &self, + client: &stripe::Client, + id: &stripe_shared::ApplicationFeeId, + ) -> stripe::Response { + client.send_form(&format!("/application_fees/{id}/refunds"), self, http_types::Method::Post) + } +} diff --git a/generated/stripe_connect/src/apps_secret/mod.rs b/generated/stripe_connect/src/apps_secret/mod.rs new file mode 100644 index 000000000..ba72ddd80 --- /dev/null +++ b/generated/stripe_connect/src/apps_secret/mod.rs @@ -0,0 +1,5 @@ +#[cfg(feature = "apps_secret")] +mod requests; +pub(crate) mod types; +#[cfg(feature = "apps_secret")] +pub use requests::*; diff --git a/generated/stripe_connect/src/apps_secret/requests.rs b/generated/stripe_connect/src/apps_secret/requests.rs new file mode 100644 index 000000000..b07f8cc58 --- /dev/null +++ b/generated/stripe_connect/src/apps_secret/requests.rs @@ -0,0 +1,363 @@ +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct ListAppsSecret<'a> { + /// A cursor for use in pagination. + /// `ending_before` is an object ID that defines your place in the list. + /// For instance, if you make a list request and receive 100 objects, starting with `obj_bar`, your subsequent call can include `ending_before=obj_bar` in order to fetch the previous page of the list. + #[serde(skip_serializing_if = "Option::is_none")] + pub ending_before: Option<&'a str>, + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, + /// A limit on the number of objects to be returned. + /// Limit can range between 1 and 100, and the default is 10. + #[serde(skip_serializing_if = "Option::is_none")] + pub limit: Option, + /// Specifies the scoping of the secret. + /// Requests originating from UI extensions can only access account-scoped secrets or secrets scoped to their own user. + pub scope: ListAppsSecretScope<'a>, + /// A cursor for use in pagination. + /// `starting_after` is an object ID that defines your place in the list. + /// For instance, if you make a list request and receive 100 objects, ending with `obj_foo`, your subsequent call can include `starting_after=obj_foo` in order to fetch the next page of the list. + #[serde(skip_serializing_if = "Option::is_none")] + pub starting_after: Option<&'a str>, +} +impl<'a> ListAppsSecret<'a> { + pub fn new(scope: ListAppsSecretScope<'a>) -> Self { + Self { ending_before: None, expand: None, limit: None, scope, starting_after: None } + } +} +/// Specifies the scoping of the secret. +/// Requests originating from UI extensions can only access account-scoped secrets or secrets scoped to their own user. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct ListAppsSecretScope<'a> { + /// The secret scope type. + #[serde(rename = "type")] + pub type_: ListAppsSecretScopeType, + /// The user ID. + /// This field is required if `type` is set to `user`, and should not be provided if `type` is set to `account`. + #[serde(skip_serializing_if = "Option::is_none")] + pub user: Option<&'a str>, +} +impl<'a> ListAppsSecretScope<'a> { + pub fn new(type_: ListAppsSecretScopeType) -> Self { + Self { type_, user: None } + } +} +/// The secret scope type. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum ListAppsSecretScopeType { + Account, + User, +} +impl ListAppsSecretScopeType { + pub fn as_str(self) -> &'static str { + use ListAppsSecretScopeType::*; + match self { + Account => "account", + User => "user", + } + } +} + +impl std::str::FromStr for ListAppsSecretScopeType { + type Err = (); + fn from_str(s: &str) -> Result { + use ListAppsSecretScopeType::*; + match s { + "account" => Ok(Account), + "user" => Ok(User), + _ => Err(()), + } + } +} +impl std::fmt::Display for ListAppsSecretScopeType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for ListAppsSecretScopeType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for ListAppsSecretScopeType { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'a> ListAppsSecret<'a> { + /// List all secrets stored on the given scope. + pub fn send( + &self, + client: &stripe::Client, + ) -> stripe::Response> { + client.get_query("/apps/secrets", self) + } + pub fn paginate(self) -> stripe::ListPaginator> { + stripe::ListPaginator::from_list_params("/apps/secrets", self) + } +} +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct FindAppsSecret<'a> { + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, + /// A name for the secret that's unique within the scope. + pub name: &'a str, + /// Specifies the scoping of the secret. + /// Requests originating from UI extensions can only access account-scoped secrets or secrets scoped to their own user. + pub scope: FindAppsSecretScope<'a>, +} +impl<'a> FindAppsSecret<'a> { + pub fn new(name: &'a str, scope: FindAppsSecretScope<'a>) -> Self { + Self { expand: None, name, scope } + } +} +/// Specifies the scoping of the secret. +/// Requests originating from UI extensions can only access account-scoped secrets or secrets scoped to their own user. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct FindAppsSecretScope<'a> { + /// The secret scope type. + #[serde(rename = "type")] + pub type_: FindAppsSecretScopeType, + /// The user ID. + /// This field is required if `type` is set to `user`, and should not be provided if `type` is set to `account`. + #[serde(skip_serializing_if = "Option::is_none")] + pub user: Option<&'a str>, +} +impl<'a> FindAppsSecretScope<'a> { + pub fn new(type_: FindAppsSecretScopeType) -> Self { + Self { type_, user: None } + } +} +/// The secret scope type. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum FindAppsSecretScopeType { + Account, + User, +} +impl FindAppsSecretScopeType { + pub fn as_str(self) -> &'static str { + use FindAppsSecretScopeType::*; + match self { + Account => "account", + User => "user", + } + } +} + +impl std::str::FromStr for FindAppsSecretScopeType { + type Err = (); + fn from_str(s: &str) -> Result { + use FindAppsSecretScopeType::*; + match s { + "account" => Ok(Account), + "user" => Ok(User), + _ => Err(()), + } + } +} +impl std::fmt::Display for FindAppsSecretScopeType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for FindAppsSecretScopeType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for FindAppsSecretScopeType { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'a> FindAppsSecret<'a> { + /// Finds a secret in the secret store by name and scope. + pub fn send(&self, client: &stripe::Client) -> stripe::Response { + client.get_query("/apps/secrets/find", self) + } +} +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreateAppsSecret<'a> { + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, + /// The Unix timestamp for the expiry time of the secret, after which the secret deletes. + #[serde(skip_serializing_if = "Option::is_none")] + pub expires_at: Option, + /// A name for the secret that's unique within the scope. + pub name: &'a str, + /// The plaintext secret value to be stored. + pub payload: &'a str, + /// Specifies the scoping of the secret. + /// Requests originating from UI extensions can only access account-scoped secrets or secrets scoped to their own user. + pub scope: CreateAppsSecretScope<'a>, +} +impl<'a> CreateAppsSecret<'a> { + pub fn new(name: &'a str, payload: &'a str, scope: CreateAppsSecretScope<'a>) -> Self { + Self { expand: None, expires_at: None, name, payload, scope } + } +} +/// Specifies the scoping of the secret. +/// Requests originating from UI extensions can only access account-scoped secrets or secrets scoped to their own user. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreateAppsSecretScope<'a> { + /// The secret scope type. + #[serde(rename = "type")] + pub type_: CreateAppsSecretScopeType, + /// The user ID. + /// This field is required if `type` is set to `user`, and should not be provided if `type` is set to `account`. + #[serde(skip_serializing_if = "Option::is_none")] + pub user: Option<&'a str>, +} +impl<'a> CreateAppsSecretScope<'a> { + pub fn new(type_: CreateAppsSecretScopeType) -> Self { + Self { type_, user: None } + } +} +/// The secret scope type. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreateAppsSecretScopeType { + Account, + User, +} +impl CreateAppsSecretScopeType { + pub fn as_str(self) -> &'static str { + use CreateAppsSecretScopeType::*; + match self { + Account => "account", + User => "user", + } + } +} + +impl std::str::FromStr for CreateAppsSecretScopeType { + type Err = (); + fn from_str(s: &str) -> Result { + use CreateAppsSecretScopeType::*; + match s { + "account" => Ok(Account), + "user" => Ok(User), + _ => Err(()), + } + } +} +impl std::fmt::Display for CreateAppsSecretScopeType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreateAppsSecretScopeType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreateAppsSecretScopeType { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'a> CreateAppsSecret<'a> { + /// Create or replace a secret in the secret store. + pub fn send(&self, client: &stripe::Client) -> stripe::Response { + client.send_form("/apps/secrets", self, http_types::Method::Post) + } +} +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct DeleteWhereAppsSecret<'a> { + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, + /// A name for the secret that's unique within the scope. + pub name: &'a str, + /// Specifies the scoping of the secret. + /// Requests originating from UI extensions can only access account-scoped secrets or secrets scoped to their own user. + pub scope: DeleteWhereAppsSecretScope<'a>, +} +impl<'a> DeleteWhereAppsSecret<'a> { + pub fn new(name: &'a str, scope: DeleteWhereAppsSecretScope<'a>) -> Self { + Self { expand: None, name, scope } + } +} +/// Specifies the scoping of the secret. +/// Requests originating from UI extensions can only access account-scoped secrets or secrets scoped to their own user. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct DeleteWhereAppsSecretScope<'a> { + /// The secret scope type. + #[serde(rename = "type")] + pub type_: DeleteWhereAppsSecretScopeType, + /// The user ID. + /// This field is required if `type` is set to `user`, and should not be provided if `type` is set to `account`. + #[serde(skip_serializing_if = "Option::is_none")] + pub user: Option<&'a str>, +} +impl<'a> DeleteWhereAppsSecretScope<'a> { + pub fn new(type_: DeleteWhereAppsSecretScopeType) -> Self { + Self { type_, user: None } + } +} +/// The secret scope type. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum DeleteWhereAppsSecretScopeType { + Account, + User, +} +impl DeleteWhereAppsSecretScopeType { + pub fn as_str(self) -> &'static str { + use DeleteWhereAppsSecretScopeType::*; + match self { + Account => "account", + User => "user", + } + } +} + +impl std::str::FromStr for DeleteWhereAppsSecretScopeType { + type Err = (); + fn from_str(s: &str) -> Result { + use DeleteWhereAppsSecretScopeType::*; + match s { + "account" => Ok(Account), + "user" => Ok(User), + _ => Err(()), + } + } +} +impl std::fmt::Display for DeleteWhereAppsSecretScopeType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for DeleteWhereAppsSecretScopeType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for DeleteWhereAppsSecretScopeType { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'a> DeleteWhereAppsSecret<'a> { + /// Deletes a secret from the secret store by name and scope. + pub fn send(&self, client: &stripe::Client) -> stripe::Response { + client.send_form("/apps/secrets/delete", self, http_types::Method::Post) + } +} diff --git a/generated/stripe_connect/src/apps_secret/types.rs b/generated/stripe_connect/src/apps_secret/types.rs new file mode 100644 index 000000000..968c90e49 --- /dev/null +++ b/generated/stripe_connect/src/apps_secret/types.rs @@ -0,0 +1,39 @@ +/// Secret Store is an API that allows Stripe Apps developers to securely persist secrets for use by UI Extensions and app backends. +/// +/// The primary resource in Secret Store is a `secret`. +/// Other apps can't view secrets created by an app. +/// Additionally, secrets are scoped to provide further permission control. +/// +/// All Dashboard users and the app backend share `account` scoped secrets. +/// Use the `account` scope for secrets that don't change per-user, like a third-party API key. +/// +/// A `user` scoped secret is accessible by the app backend and one specific Dashboard user. +/// Use the `user` scope for per-user secrets like per-user OAuth tokens, where different users might have different permissions. +/// +/// Related guide: [Store data between page reloads](https://stripe.com/docs/stripe-apps/store-auth-data-custom-objects). +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct AppsSecret { + /// Time at which the object was created. Measured in seconds since the Unix epoch. + pub created: stripe_types::Timestamp, + /// If true, indicates that this secret has been deleted + #[serde(skip_serializing_if = "Option::is_none")] + pub deleted: Option, + /// The Unix timestamp for the expiry time of the secret, after which the secret deletes. + pub expires_at: Option, + /// Unique identifier for the object. + pub id: stripe_connect::AppsSecretId, + /// Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + pub livemode: bool, + /// A name for the secret that's unique within the scope. + pub name: String, + /// The plaintext secret value to be stored. + pub payload: Option, + pub scope: stripe_connect::SecretServiceResourceScope, +} +impl stripe_types::Object for AppsSecret { + type Id = stripe_connect::AppsSecretId; + fn id(&self) -> &Self::Id { + &self.id + } +} +stripe_types::def_id!(AppsSecretId); diff --git a/generated/stripe_connect/src/capability/mod.rs b/generated/stripe_connect/src/capability/mod.rs new file mode 100644 index 000000000..855d09e3d --- /dev/null +++ b/generated/stripe_connect/src/capability/mod.rs @@ -0,0 +1,4 @@ +#[cfg(feature = "capability")] +mod requests; +#[cfg(feature = "capability")] +pub use requests::*; diff --git a/generated/stripe_connect/src/capability/requests.rs b/generated/stripe_connect/src/capability/requests.rs new file mode 100644 index 000000000..f7e1496d2 --- /dev/null +++ b/generated/stripe_connect/src/capability/requests.rs @@ -0,0 +1,86 @@ +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct ListAccountCapability<'a> { + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, +} +impl<'a> ListAccountCapability<'a> { + pub fn new() -> Self { + Self::default() + } +} +impl<'a> ListAccountCapability<'a> { + /// Returns a list of capabilities associated with the account. + /// The capabilities are returned sorted by creation date, with the most recent capability appearing first. + pub fn send( + &self, + client: &stripe::Client, + account: &stripe_shared::AccountId, + ) -> stripe::Response> { + client.get_query(&format!("/accounts/{account}/capabilities"), self) + } + pub fn paginate( + self, + account: &stripe_shared::AccountId, + ) -> stripe::ListPaginator> { + stripe::ListPaginator::from_list_params(&format!("/accounts/{account}/capabilities"), self) + } +} +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct RetrieveCapability<'a> { + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, +} +impl<'a> RetrieveCapability<'a> { + pub fn new() -> Self { + Self::default() + } +} +impl<'a> RetrieveCapability<'a> { + /// Retrieves information about the specified Account Capability. + pub fn send( + &self, + client: &stripe::Client, + account: &stripe_shared::AccountId, + capability: &str, + ) -> stripe::Response { + client.get_query(&format!("/accounts/{account}/capabilities/{capability}"), self) + } +} +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdateCapability<'a> { + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, + /// To request a new capability for an account, pass true. + /// There can be a delay before the requested capability becomes active. + /// If the capability has any activation requirements, the response includes them in the `requirements` arrays. + /// + /// If a capability isn't permanent, you can remove it from the account by passing false. + /// Most capabilities are permanent after they've been requested. + /// Attempting to remove a permanent capability returns an error. + #[serde(skip_serializing_if = "Option::is_none")] + pub requested: Option, +} +impl<'a> UpdateCapability<'a> { + pub fn new() -> Self { + Self::default() + } +} +impl<'a> UpdateCapability<'a> { + /// Updates an existing Account Capability. + /// Request or remove a capability by updating its `requested` parameter. + pub fn send( + &self, + client: &stripe::Client, + account: &stripe_shared::AccountId, + capability: &str, + ) -> stripe::Response { + client.send_form( + &format!("/accounts/{account}/capabilities/{capability}"), + self, + http_types::Method::Post, + ) + } +} diff --git a/generated/stripe_connect/src/connect_embedded_account_session_create_components.rs b/generated/stripe_connect/src/connect_embedded_account_session_create_components.rs new file mode 100644 index 000000000..ff3f3181d --- /dev/null +++ b/generated/stripe_connect/src/connect_embedded_account_session_create_components.rs @@ -0,0 +1,7 @@ +#[derive(Copy, Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct ConnectEmbeddedAccountSessionCreateComponents { + pub account_onboarding: stripe_connect::ConnectEmbeddedBaseConfigClaim, + pub payment_details: stripe_connect::ConnectEmbeddedPaymentsConfig, + pub payments: stripe_connect::ConnectEmbeddedPaymentsConfig, + pub payouts: stripe_connect::ConnectEmbeddedPayoutsConfig, +} diff --git a/generated/stripe_connect/src/connect_embedded_base_config_claim.rs b/generated/stripe_connect/src/connect_embedded_base_config_claim.rs new file mode 100644 index 000000000..19818fc01 --- /dev/null +++ b/generated/stripe_connect/src/connect_embedded_base_config_claim.rs @@ -0,0 +1,6 @@ +#[derive(Copy, Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct ConnectEmbeddedBaseConfigClaim { + /// Whether the embedded component is enabled. + pub enabled: bool, + pub features: stripe_connect::ConnectEmbeddedBaseFeatures, +} diff --git a/generated/stripe_connect/src/connect_embedded_base_features.rs b/generated/stripe_connect/src/connect_embedded_base_features.rs new file mode 100644 index 000000000..ed9dae237 --- /dev/null +++ b/generated/stripe_connect/src/connect_embedded_base_features.rs @@ -0,0 +1,2 @@ +#[derive(Copy, Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct ConnectEmbeddedBaseFeatures {} diff --git a/generated/stripe_connect/src/connect_embedded_payments_config.rs b/generated/stripe_connect/src/connect_embedded_payments_config.rs new file mode 100644 index 000000000..9279b697d --- /dev/null +++ b/generated/stripe_connect/src/connect_embedded_payments_config.rs @@ -0,0 +1,6 @@ +#[derive(Copy, Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct ConnectEmbeddedPaymentsConfig { + /// Whether the embedded component is enabled. + pub enabled: bool, + pub features: stripe_connect::ConnectEmbeddedPaymentsFeatures, +} diff --git a/generated/stripe_connect/src/connect_embedded_payments_features.rs b/generated/stripe_connect/src/connect_embedded_payments_features.rs new file mode 100644 index 000000000..7f5bc6721 --- /dev/null +++ b/generated/stripe_connect/src/connect_embedded_payments_features.rs @@ -0,0 +1,10 @@ +#[derive(Copy, Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct ConnectEmbeddedPaymentsFeatures { + /// Whether to allow capturing and cancelling payment intents. This is `true` by default. + pub capture_payments: bool, + /// Whether to allow responding to disputes, including submitting evidence and accepting disputes. + /// This is `true` by default. + pub dispute_management: bool, + /// Whether to allow sending refunds. This is `true` by default. + pub refund_management: bool, +} diff --git a/generated/stripe_connect/src/connect_embedded_payouts_config.rs b/generated/stripe_connect/src/connect_embedded_payouts_config.rs new file mode 100644 index 000000000..7d4856264 --- /dev/null +++ b/generated/stripe_connect/src/connect_embedded_payouts_config.rs @@ -0,0 +1,6 @@ +#[derive(Copy, Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct ConnectEmbeddedPayoutsConfig { + /// Whether the embedded component is enabled. + pub enabled: bool, + pub features: stripe_connect::ConnectEmbeddedPayoutsFeatures, +} diff --git a/generated/stripe_connect/src/connect_embedded_payouts_features.rs b/generated/stripe_connect/src/connect_embedded_payouts_features.rs new file mode 100644 index 000000000..0384aa102 --- /dev/null +++ b/generated/stripe_connect/src/connect_embedded_payouts_features.rs @@ -0,0 +1,12 @@ +#[derive(Copy, Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct ConnectEmbeddedPayoutsFeatures { + /// Whether to allow payout schedule to be changed. + /// Default `true` when Stripe owns Loss Liability, default `false` otherwise. + pub edit_payout_schedule: bool, + /// Whether to allow creation of instant payouts. + /// Default `true` when Stripe owns Loss Liability, default `false` otherwise. + pub instant_payouts: bool, + /// Whether to allow creation of standard payouts. + /// Default `true` when Stripe owns Loss Liability, default `false` otherwise. + pub standard_payouts: bool, +} diff --git a/generated/stripe_connect/src/country_spec/mod.rs b/generated/stripe_connect/src/country_spec/mod.rs new file mode 100644 index 000000000..3724e257d --- /dev/null +++ b/generated/stripe_connect/src/country_spec/mod.rs @@ -0,0 +1,5 @@ +#[cfg(feature = "country_spec")] +mod requests; +pub(crate) mod types; +#[cfg(feature = "country_spec")] +pub use requests::*; diff --git a/generated/stripe_connect/src/country_spec/requests.rs b/generated/stripe_connect/src/country_spec/requests.rs new file mode 100644 index 000000000..2bf2b8251 --- /dev/null +++ b/generated/stripe_connect/src/country_spec/requests.rs @@ -0,0 +1,60 @@ +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct ListCountrySpec<'a> { + /// A cursor for use in pagination. + /// `ending_before` is an object ID that defines your place in the list. + /// For instance, if you make a list request and receive 100 objects, starting with `obj_bar`, your subsequent call can include `ending_before=obj_bar` in order to fetch the previous page of the list. + #[serde(skip_serializing_if = "Option::is_none")] + pub ending_before: Option<&'a str>, + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, + /// A limit on the number of objects to be returned. + /// Limit can range between 1 and 100, and the default is 10. + #[serde(skip_serializing_if = "Option::is_none")] + pub limit: Option, + /// A cursor for use in pagination. + /// `starting_after` is an object ID that defines your place in the list. + /// For instance, if you make a list request and receive 100 objects, ending with `obj_foo`, your subsequent call can include `starting_after=obj_foo` in order to fetch the next page of the list. + #[serde(skip_serializing_if = "Option::is_none")] + pub starting_after: Option<&'a str>, +} +impl<'a> ListCountrySpec<'a> { + pub fn new() -> Self { + Self::default() + } +} +impl<'a> ListCountrySpec<'a> { + /// Lists all Country Spec objects available in the API. + pub fn send( + &self, + client: &stripe::Client, + ) -> stripe::Response> { + client.get_query("/country_specs", self) + } + pub fn paginate( + self, + ) -> stripe::ListPaginator> { + stripe::ListPaginator::from_list_params("/country_specs", self) + } +} +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct RetrieveCountrySpec<'a> { + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, +} +impl<'a> RetrieveCountrySpec<'a> { + pub fn new() -> Self { + Self::default() + } +} +impl<'a> RetrieveCountrySpec<'a> { + /// Returns a Country Spec for a given Country code. + pub fn send( + &self, + client: &stripe::Client, + country: &stripe_connect::CountrySpecId, + ) -> stripe::Response { + client.get_query(&format!("/country_specs/{country}"), self) + } +} diff --git a/generated/stripe_connect/src/country_spec/types.rs b/generated/stripe_connect/src/country_spec/types.rs new file mode 100644 index 000000000..fb37dd7fa --- /dev/null +++ b/generated/stripe_connect/src/country_spec/types.rs @@ -0,0 +1,33 @@ +/// Stripe needs to collect certain pieces of information about each account +/// created. These requirements can differ depending on the account's country. The +/// Country Specs API makes these rules available to your integration. +/// +/// You can also view the information from this API call as [an online +/// guide](/docs/connect/required-verification-information). +/// +/// For more details see <>. +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct CountrySpec { + /// The default currency for this country. This applies to both payment methods and bank accounts. + pub default_currency: stripe_types::Currency, + /// Unique identifier for the object. Represented as the ISO country code for this country. + pub id: stripe_connect::CountrySpecId, + /// Currencies that can be accepted in the specific country (for transfers). + pub supported_bank_account_currencies: std::collections::HashMap>, + /// Currencies that can be accepted in the specified country (for payments). + pub supported_payment_currencies: Vec, + /// Payment methods available in the specified country. + /// You may need to enable some payment methods (e.g., [ACH](https://stripe.com/docs/ach)) on your account before they appear in this list. + /// The `stripe` payment method refers to [charging through your platform](https://stripe.com/docs/connect/destination-charges). + pub supported_payment_methods: Vec, + /// Countries that can accept transfers from the specified country. + pub supported_transfer_countries: Vec, + pub verification_fields: stripe_connect::CountrySpecVerificationFields, +} +impl stripe_types::Object for CountrySpec { + type Id = stripe_connect::CountrySpecId; + fn id(&self) -> &Self::Id { + &self.id + } +} +stripe_types::def_id!(CountrySpecId); diff --git a/generated/stripe_connect/src/country_spec_verification_field_details.rs b/generated/stripe_connect/src/country_spec_verification_field_details.rs new file mode 100644 index 000000000..1f0195531 --- /dev/null +++ b/generated/stripe_connect/src/country_spec_verification_field_details.rs @@ -0,0 +1,7 @@ +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct CountrySpecVerificationFieldDetails { + /// Additional fields which are only required for some users. + pub additional: Vec, + /// Fields which every account must eventually provide. + pub minimum: Vec, +} diff --git a/generated/stripe_connect/src/country_spec_verification_fields.rs b/generated/stripe_connect/src/country_spec_verification_fields.rs new file mode 100644 index 000000000..4fd589811 --- /dev/null +++ b/generated/stripe_connect/src/country_spec_verification_fields.rs @@ -0,0 +1,5 @@ +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct CountrySpecVerificationFields { + pub company: stripe_connect::CountrySpecVerificationFieldDetails, + pub individual: stripe_connect::CountrySpecVerificationFieldDetails, +} diff --git a/generated/stripe_connect/src/external_account/mod.rs b/generated/stripe_connect/src/external_account/mod.rs new file mode 100644 index 000000000..18e5e885d --- /dev/null +++ b/generated/stripe_connect/src/external_account/mod.rs @@ -0,0 +1,4 @@ +#[cfg(feature = "external_account")] +mod requests; +#[cfg(feature = "external_account")] +pub use requests::*; diff --git a/generated/stripe_connect/src/external_account/requests.rs b/generated/stripe_connect/src/external_account/requests.rs new file mode 100644 index 000000000..b11194fdd --- /dev/null +++ b/generated/stripe_connect/src/external_account/requests.rs @@ -0,0 +1,379 @@ +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct DeleteExternalAccount {} +impl DeleteExternalAccount { + pub fn new() -> Self { + Self::default() + } +} +impl DeleteExternalAccount { + /// Delete a specified external account for a given account. + pub fn send( + &self, + client: &stripe::Client, + account: &stripe_shared::AccountId, + id: &str, + ) -> stripe::Response { + client.send_form( + &format!("/accounts/{account}/external_accounts/{id}"), + self, + http_types::Method::Delete, + ) + } +} +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct ListAccountExternalAccount<'a> { + /// A cursor for use in pagination. + /// `ending_before` is an object ID that defines your place in the list. + /// For instance, if you make a list request and receive 100 objects, starting with `obj_bar`, your subsequent call can include `ending_before=obj_bar` in order to fetch the previous page of the list. + #[serde(skip_serializing_if = "Option::is_none")] + pub ending_before: Option<&'a str>, + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, + /// A limit on the number of objects to be returned. + /// Limit can range between 1 and 100, and the default is 10. + #[serde(skip_serializing_if = "Option::is_none")] + pub limit: Option, + /// Filter external accounts according to a particular object type. + #[serde(skip_serializing_if = "Option::is_none")] + pub object: Option, + /// A cursor for use in pagination. + /// `starting_after` is an object ID that defines your place in the list. + /// For instance, if you make a list request and receive 100 objects, ending with `obj_foo`, your subsequent call can include `starting_after=obj_foo` in order to fetch the next page of the list. + #[serde(skip_serializing_if = "Option::is_none")] + pub starting_after: Option<&'a str>, +} +impl<'a> ListAccountExternalAccount<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// Filter external accounts according to a particular object type. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum ListAccountExternalAccountObject { + BankAccount, + Card, +} +impl ListAccountExternalAccountObject { + pub fn as_str(self) -> &'static str { + use ListAccountExternalAccountObject::*; + match self { + BankAccount => "bank_account", + Card => "card", + } + } +} + +impl std::str::FromStr for ListAccountExternalAccountObject { + type Err = (); + fn from_str(s: &str) -> Result { + use ListAccountExternalAccountObject::*; + match s { + "bank_account" => Ok(BankAccount), + "card" => Ok(Card), + _ => Err(()), + } + } +} +impl std::fmt::Display for ListAccountExternalAccountObject { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for ListAccountExternalAccountObject { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for ListAccountExternalAccountObject { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'a> ListAccountExternalAccount<'a> { + /// List external accounts for an account. + pub fn send( + &self, + client: &stripe::Client, + account: &stripe_shared::AccountId, + ) -> stripe::Response> { + client.get_query(&format!("/accounts/{account}/external_accounts"), self) + } + pub fn paginate( + self, + account: &stripe_shared::AccountId, + ) -> stripe::ListPaginator> { + stripe::ListPaginator::from_list_params( + &format!("/accounts/{account}/external_accounts"), + self, + ) + } +} +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct RetrieveExternalAccount<'a> { + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, +} +impl<'a> RetrieveExternalAccount<'a> { + pub fn new() -> Self { + Self::default() + } +} +impl<'a> RetrieveExternalAccount<'a> { + /// Retrieve a specified external account for a given account. + pub fn send( + &self, + client: &stripe::Client, + account: &stripe_shared::AccountId, + id: &str, + ) -> stripe::Response { + client.get_query(&format!("/accounts/{account}/external_accounts/{id}"), self) + } +} +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreateAccountExternalAccount<'a> { + /// When set to true, or if this is the first external account added in this currency, this account becomes the default external account for its currency. + #[serde(skip_serializing_if = "Option::is_none")] + pub default_for_currency: Option, + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, + /// Please refer to full [documentation](https://stripe.com/docs/api) instead. + pub external_account: &'a str, + /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. + /// This can be useful for storing additional information about the object in a structured format. + /// Individual keys can be unset by posting an empty value to them. + /// All keys can be unset by posting an empty value to `metadata`. + #[serde(skip_serializing_if = "Option::is_none")] + pub metadata: Option<&'a std::collections::HashMap>, +} +impl<'a> CreateAccountExternalAccount<'a> { + pub fn new(external_account: &'a str) -> Self { + Self { default_for_currency: None, expand: None, external_account, metadata: None } + } +} +impl<'a> CreateAccountExternalAccount<'a> { + /// Create an external account for a given account. + pub fn send( + &self, + client: &stripe::Client, + account: &stripe_shared::AccountId, + ) -> stripe::Response { + client.send_form( + &format!("/accounts/{account}/external_accounts"), + self, + http_types::Method::Post, + ) + } +} +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdateExternalAccount<'a> { + /// The name of the person or business that owns the bank account. + #[serde(skip_serializing_if = "Option::is_none")] + pub account_holder_name: Option<&'a str>, + /// The type of entity that holds the account. This can be either `individual` or `company`. + #[serde(skip_serializing_if = "Option::is_none")] + pub account_holder_type: Option, + /// The bank account type. + /// This can only be `checking` or `savings` in most countries. + /// In Japan, this can only be `futsu` or `toza`. + #[serde(skip_serializing_if = "Option::is_none")] + pub account_type: Option, + /// City/District/Suburb/Town/Village. + #[serde(skip_serializing_if = "Option::is_none")] + pub address_city: Option<&'a str>, + /// Billing address country, if provided when creating card. + #[serde(skip_serializing_if = "Option::is_none")] + pub address_country: Option<&'a str>, + /// Address line 1 (Street address/PO Box/Company name). + #[serde(skip_serializing_if = "Option::is_none")] + pub address_line1: Option<&'a str>, + /// Address line 2 (Apartment/Suite/Unit/Building). + #[serde(skip_serializing_if = "Option::is_none")] + pub address_line2: Option<&'a str>, + /// State/County/Province/Region. + #[serde(skip_serializing_if = "Option::is_none")] + pub address_state: Option<&'a str>, + /// ZIP or postal code. + #[serde(skip_serializing_if = "Option::is_none")] + pub address_zip: Option<&'a str>, + /// When set to true, this becomes the default external account for its currency. + #[serde(skip_serializing_if = "Option::is_none")] + pub default_for_currency: Option, + /// Documents that may be submitted to satisfy various informational requests. + #[serde(skip_serializing_if = "Option::is_none")] + pub documents: Option>, + /// Two digit number representing the card’s expiration month. + #[serde(skip_serializing_if = "Option::is_none")] + pub exp_month: Option<&'a str>, + /// Four digit number representing the card’s expiration year. + #[serde(skip_serializing_if = "Option::is_none")] + pub exp_year: Option<&'a str>, + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, + /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. + /// This can be useful for storing additional information about the object in a structured format. + /// Individual keys can be unset by posting an empty value to them. + /// All keys can be unset by posting an empty value to `metadata`. + #[serde(skip_serializing_if = "Option::is_none")] + pub metadata: Option<&'a std::collections::HashMap>, + /// Cardholder name. + #[serde(skip_serializing_if = "Option::is_none")] + pub name: Option<&'a str>, +} +impl<'a> UpdateExternalAccount<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// The type of entity that holds the account. This can be either `individual` or `company`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum UpdateExternalAccountAccountHolderType { + Company, + Individual, +} +impl UpdateExternalAccountAccountHolderType { + pub fn as_str(self) -> &'static str { + use UpdateExternalAccountAccountHolderType::*; + match self { + Company => "company", + Individual => "individual", + } + } +} + +impl std::str::FromStr for UpdateExternalAccountAccountHolderType { + type Err = (); + fn from_str(s: &str) -> Result { + use UpdateExternalAccountAccountHolderType::*; + match s { + "company" => Ok(Company), + "individual" => Ok(Individual), + _ => Err(()), + } + } +} +impl std::fmt::Display for UpdateExternalAccountAccountHolderType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for UpdateExternalAccountAccountHolderType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for UpdateExternalAccountAccountHolderType { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// The bank account type. +/// This can only be `checking` or `savings` in most countries. +/// In Japan, this can only be `futsu` or `toza`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum UpdateExternalAccountAccountType { + Checking, + Futsu, + Savings, + Toza, +} +impl UpdateExternalAccountAccountType { + pub fn as_str(self) -> &'static str { + use UpdateExternalAccountAccountType::*; + match self { + Checking => "checking", + Futsu => "futsu", + Savings => "savings", + Toza => "toza", + } + } +} + +impl std::str::FromStr for UpdateExternalAccountAccountType { + type Err = (); + fn from_str(s: &str) -> Result { + use UpdateExternalAccountAccountType::*; + match s { + "checking" => Ok(Checking), + "futsu" => Ok(Futsu), + "savings" => Ok(Savings), + "toza" => Ok(Toza), + _ => Err(()), + } + } +} +impl std::fmt::Display for UpdateExternalAccountAccountType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for UpdateExternalAccountAccountType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for UpdateExternalAccountAccountType { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Documents that may be submitted to satisfy various informational requests. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdateExternalAccountDocuments<'a> { + /// One or more documents that support the [Bank account ownership verification](https://support.stripe.com/questions/bank-account-ownership-verification) requirement. + /// Must be a document associated with the bank account that displays the last 4 digits of the account number, either a statement or a voided check. + #[serde(skip_serializing_if = "Option::is_none")] + pub bank_account_ownership_verification: + Option>, +} +impl<'a> UpdateExternalAccountDocuments<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// One or more documents that support the [Bank account ownership verification](https://support.stripe.com/questions/bank-account-ownership-verification) requirement. +/// Must be a document associated with the bank account that displays the last 4 digits of the account number, either a statement or a voided check. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdateExternalAccountDocumentsBankAccountOwnershipVerification<'a> { + /// One or more document ids returned by a [file upload](https://stripe.com/docs/api#create_file) with a `purpose` value of `account_requirement`. + #[serde(skip_serializing_if = "Option::is_none")] + pub files: Option<&'a [&'a str]>, +} +impl<'a> UpdateExternalAccountDocumentsBankAccountOwnershipVerification<'a> { + pub fn new() -> Self { + Self::default() + } +} +impl<'a> UpdateExternalAccount<'a> { + /// Updates the metadata, account holder name, account holder type of a bank account belonging to a [Custom account](https://stripe.com/docs/connect/custom-accounts), and optionally sets it as the default for its currency. + /// Other bank account details are not editable by design. + /// + /// You can re-enable a disabled bank account by performing an update call without providing any arguments or changes. + pub fn send( + &self, + client: &stripe::Client, + account: &stripe_shared::AccountId, + id: &str, + ) -> stripe::Response { + client.send_form( + &format!("/accounts/{account}/external_accounts/{id}"), + self, + http_types::Method::Post, + ) + } +} diff --git a/generated/stripe_connect/src/login_link/mod.rs b/generated/stripe_connect/src/login_link/mod.rs new file mode 100644 index 000000000..d808f3335 --- /dev/null +++ b/generated/stripe_connect/src/login_link/mod.rs @@ -0,0 +1,5 @@ +#[cfg(feature = "login_link")] +mod requests; +pub(crate) mod types; +#[cfg(feature = "login_link")] +pub use requests::*; diff --git a/generated/stripe_connect/src/login_link/requests.rs b/generated/stripe_connect/src/login_link/requests.rs new file mode 100644 index 000000000..25eb26fac --- /dev/null +++ b/generated/stripe_connect/src/login_link/requests.rs @@ -0,0 +1,27 @@ +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreateAccountLoginLink<'a> { + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, +} +impl<'a> CreateAccountLoginLink<'a> { + pub fn new() -> Self { + Self::default() + } +} +impl<'a> CreateAccountLoginLink<'a> { + /// Creates a single-use login link for an Express account to access their Stripe dashboard. + /// + /// **You may only create login links for [Express accounts](https://stripe.com/docs/connect/express-accounts) connected to your platform**. + pub fn send( + &self, + client: &stripe::Client, + account: &stripe_shared::AccountId, + ) -> stripe::Response { + client.send_form( + &format!("/accounts/{account}/login_links"), + self, + http_types::Method::Post, + ) + } +} diff --git a/generated/stripe_connect/src/login_link/types.rs b/generated/stripe_connect/src/login_link/types.rs new file mode 100644 index 000000000..6ee359ce8 --- /dev/null +++ b/generated/stripe_connect/src/login_link/types.rs @@ -0,0 +1,10 @@ +/// Login Links are single-use login link for an Express account to access their Stripe dashboard. +/// +/// For more details see <>. +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct LoginLink { + /// Time at which the object was created. Measured in seconds since the Unix epoch. + pub created: stripe_types::Timestamp, + /// The URL for the login link. + pub url: String, +} diff --git a/generated/stripe_connect/src/mod.rs b/generated/stripe_connect/src/mod.rs new file mode 100644 index 000000000..0a0cc93b8 --- /dev/null +++ b/generated/stripe_connect/src/mod.rs @@ -0,0 +1,121 @@ +#![recursion_limit = "256"] +#![allow(clippy::large_enum_variant)] +#![allow(rustdoc::broken_intra_doc_links)] +#![allow(rustdoc::invalid_html_tags)] + +//! This crate provides Rust bindings to the Stripe HTTP API, specifically +//! for requests mentioned in the `Connect` section of the [Stripe API docs](https://stripe.com/docs/api) + +extern crate self as stripe_connect; +pub mod account; +pub use account_link::types::*; +pub use stripe_shared::account::*; +pub use stripe_shared::account_annual_revenue::*; +pub use stripe_shared::account_bacs_debit_payments_settings::*; +pub use stripe_shared::account_branding_settings::*; +pub use stripe_shared::account_business_profile::*; +pub use stripe_shared::account_capabilities::*; +pub use stripe_shared::account_capability_future_requirements::*; +pub use stripe_shared::account_capability_requirements::*; +pub use stripe_shared::account_card_issuing_settings::*; +pub use stripe_shared::account_card_payments_settings::*; +pub use stripe_shared::account_dashboard_settings::*; +pub use stripe_shared::account_decline_charge_on::*; +pub use stripe_shared::account_future_requirements::*; +pub use stripe_shared::account_invoices_settings::*; +pub mod account_link; +pub use account_session::types::*; +pub use stripe_shared::account_monthly_estimated_revenue::*; +pub use stripe_shared::account_payments_settings::*; +pub use stripe_shared::account_payout_settings::*; +pub use stripe_shared::account_requirements::*; +pub use stripe_shared::account_requirements_alternative::*; +pub use stripe_shared::account_requirements_error::*; +pub use stripe_shared::account_sepa_debit_payments_settings::*; +pub mod account_session; +pub use stripe_shared::account_settings::*; +pub use stripe_shared::account_terms_of_service::*; +pub use stripe_shared::account_tos_acceptance::*; +pub use stripe_shared::account_treasury_settings::*; +pub use stripe_shared::account_unification_account_controller::*; +pub use stripe_shared::application::*; +pub mod application_fee; +pub use apps_secret::types::*; +pub use stripe_shared::application_fee::*; +pub mod apps_secret; +pub mod capability; +pub use stripe_shared::capability::*; +pub use stripe_shared::connect_account_reference::*; +#[doc(hidden)] +pub mod connect_embedded_account_session_create_components; +#[doc(inline)] +pub use connect_embedded_account_session_create_components::*; +#[doc(hidden)] +pub mod connect_embedded_base_config_claim; +#[doc(inline)] +pub use connect_embedded_base_config_claim::*; +#[doc(hidden)] +pub mod connect_embedded_base_features; +#[doc(inline)] +pub use connect_embedded_base_features::*; +#[doc(hidden)] +pub mod connect_embedded_payments_config; +#[doc(inline)] +pub use connect_embedded_payments_config::*; +#[doc(hidden)] +pub mod connect_embedded_payments_features; +#[doc(inline)] +pub use connect_embedded_payments_features::*; +#[doc(hidden)] +pub mod connect_embedded_payouts_config; +#[doc(inline)] +pub use connect_embedded_payouts_config::*; +#[doc(hidden)] +pub mod connect_embedded_payouts_features; +#[doc(inline)] +pub use connect_embedded_payouts_features::*; +pub use country_spec::types::*; +pub mod country_spec; +#[doc(hidden)] +pub mod country_spec_verification_field_details; +#[doc(inline)] +pub use country_spec_verification_field_details::*; +#[doc(hidden)] +pub mod country_spec_verification_fields; +#[doc(inline)] +pub use country_spec_verification_fields::*; +pub use stripe_shared::deleted_account::*; +pub use stripe_shared::deleted_person::*; +pub mod external_account; +pub use stripe_shared::external_account::*; +pub mod application_fee_refund; +pub use login_link::types::*; +pub use stripe_shared::application_fee_refund::*; +pub use stripe_shared::legal_entity_company::*; +pub use stripe_shared::legal_entity_company_verification::*; +pub use stripe_shared::legal_entity_company_verification_document::*; +pub use stripe_shared::legal_entity_dob::*; +pub use stripe_shared::legal_entity_japan_address::*; +pub use stripe_shared::legal_entity_person_verification::*; +pub use stripe_shared::legal_entity_person_verification_document::*; +pub use stripe_shared::legal_entity_ubo_declaration::*; +pub mod login_link; +pub mod person; +pub use stripe_shared::person::*; +pub use stripe_shared::person_additional_tos_acceptance::*; +pub use stripe_shared::person_additional_tos_acceptances::*; +pub use stripe_shared::person_future_requirements::*; +pub use stripe_shared::person_relationship::*; +pub use stripe_shared::person_requirements::*; +#[doc(hidden)] +pub mod secret_service_resource_scope; +#[doc(inline)] +pub use secret_service_resource_scope::*; +pub mod topup; +pub use stripe_shared::topup::*; +pub mod transfer; +pub use stripe_shared::transfer::*; +pub use stripe_shared::transfer_data::*; +pub mod transfer_reversal; +pub use stripe_shared::transfer_reversal::*; +pub use stripe_shared::transfer_schedule::*; diff --git a/generated/stripe_connect/src/person/mod.rs b/generated/stripe_connect/src/person/mod.rs new file mode 100644 index 000000000..eef5c844c --- /dev/null +++ b/generated/stripe_connect/src/person/mod.rs @@ -0,0 +1,4 @@ +#[cfg(feature = "person")] +mod requests; +#[cfg(feature = "person")] +pub use requests::*; diff --git a/generated/stripe_connect/src/person/requests.rs b/generated/stripe_connect/src/person/requests.rs new file mode 100644 index 000000000..a55101d6e --- /dev/null +++ b/generated/stripe_connect/src/person/requests.rs @@ -0,0 +1,619 @@ +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct DeletePerson {} +impl DeletePerson { + pub fn new() -> Self { + Self::default() + } +} +impl DeletePerson { + /// Deletes an existing person’s relationship to the account’s legal entity. + /// Any person with a relationship for an account can be deleted through the API, except if the person is the `account_opener`. + /// If your integration is using the `executive` parameter, you cannot delete the only verified `executive` on file. + pub fn send( + &self, + client: &stripe::Client, + account: &stripe_shared::AccountId, + person: &str, + ) -> stripe::Response { + client.send_form( + &format!("/accounts/{account}/persons/{person}"), + self, + http_types::Method::Delete, + ) + } +} +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct ListAccountPerson<'a> { + /// A cursor for use in pagination. + /// `ending_before` is an object ID that defines your place in the list. + /// For instance, if you make a list request and receive 100 objects, starting with `obj_bar`, your subsequent call can include `ending_before=obj_bar` in order to fetch the previous page of the list. + #[serde(skip_serializing_if = "Option::is_none")] + pub ending_before: Option<&'a str>, + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, + /// A limit on the number of objects to be returned. + /// Limit can range between 1 and 100, and the default is 10. + #[serde(skip_serializing_if = "Option::is_none")] + pub limit: Option, + /// Filters on the list of people returned based on the person's relationship to the account's company. + #[serde(skip_serializing_if = "Option::is_none")] + pub relationship: Option, + /// A cursor for use in pagination. + /// `starting_after` is an object ID that defines your place in the list. + /// For instance, if you make a list request and receive 100 objects, ending with `obj_foo`, your subsequent call can include `starting_after=obj_foo` in order to fetch the next page of the list. + #[serde(skip_serializing_if = "Option::is_none")] + pub starting_after: Option<&'a str>, +} +impl<'a> ListAccountPerson<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// Filters on the list of people returned based on the person's relationship to the account's company. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct ListAccountPersonRelationship { + /// A filter on the list of people returned based on whether these people are directors of the account's company. + #[serde(skip_serializing_if = "Option::is_none")] + pub director: Option, + /// A filter on the list of people returned based on whether these people are executives of the account's company. + #[serde(skip_serializing_if = "Option::is_none")] + pub executive: Option, + /// A filter on the list of people returned based on whether these people are legal guardians of the account's representative. + #[serde(skip_serializing_if = "Option::is_none")] + pub legal_guardian: Option, + /// A filter on the list of people returned based on whether these people are owners of the account's company. + #[serde(skip_serializing_if = "Option::is_none")] + pub owner: Option, + /// A filter on the list of people returned based on whether these people are the representative of the account's company. + #[serde(skip_serializing_if = "Option::is_none")] + pub representative: Option, +} +impl ListAccountPersonRelationship { + pub fn new() -> Self { + Self::default() + } +} +impl<'a> ListAccountPerson<'a> { + /// Returns a list of people associated with the account’s legal entity. + /// The people are returned sorted by creation date, with the most recent people appearing first. + pub fn send( + &self, + client: &stripe::Client, + account: &stripe_shared::AccountId, + ) -> stripe::Response> { + client.get_query(&format!("/accounts/{account}/persons"), self) + } + pub fn paginate( + self, + account: &stripe_shared::AccountId, + ) -> stripe::ListPaginator> { + stripe::ListPaginator::from_list_params(&format!("/accounts/{account}/persons"), self) + } +} +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct RetrievePerson<'a> { + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, +} +impl<'a> RetrievePerson<'a> { + pub fn new() -> Self { + Self::default() + } +} +impl<'a> RetrievePerson<'a> { + /// Retrieves an existing person. + pub fn send( + &self, + client: &stripe::Client, + account: &stripe_shared::AccountId, + person: &str, + ) -> stripe::Response { + client.get_query(&format!("/accounts/{account}/persons/{person}"), self) + } +} +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreateAccountPerson<'a> { + /// Details on the legal guardian's acceptance of the required Stripe agreements. + #[serde(skip_serializing_if = "Option::is_none")] + pub additional_tos_acceptances: Option>, + /// The person's address. + #[serde(skip_serializing_if = "Option::is_none")] + pub address: Option>, + /// The Kana variation of the person's address (Japan only). + #[serde(skip_serializing_if = "Option::is_none")] + pub address_kana: Option>, + /// The Kanji variation of the person's address (Japan only). + #[serde(skip_serializing_if = "Option::is_none")] + pub address_kanji: Option>, + /// The person's date of birth. + #[serde(skip_serializing_if = "Option::is_none")] + pub dob: Option, + /// Documents that may be submitted to satisfy various informational requests. + #[serde(skip_serializing_if = "Option::is_none")] + pub documents: Option>, + /// The person's email address. + #[serde(skip_serializing_if = "Option::is_none")] + pub email: Option<&'a str>, + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, + /// The person's first name. + #[serde(skip_serializing_if = "Option::is_none")] + pub first_name: Option<&'a str>, + /// The Kana variation of the person's first name (Japan only). + #[serde(skip_serializing_if = "Option::is_none")] + pub first_name_kana: Option<&'a str>, + /// The Kanji variation of the person's first name (Japan only). + #[serde(skip_serializing_if = "Option::is_none")] + pub first_name_kanji: Option<&'a str>, + /// A list of alternate names or aliases that the person is known by. + #[serde(skip_serializing_if = "Option::is_none")] + pub full_name_aliases: Option<&'a [&'a str]>, + /// The person's gender (International regulations require either "male" or "female"). + #[serde(skip_serializing_if = "Option::is_none")] + pub gender: Option<&'a str>, + /// The person's ID number, as appropriate for their country. + /// For example, a social security number in the U.S., social insurance number in Canada, etc. + /// Instead of the number itself, you can also provide a [PII token provided by Stripe.js](https://stripe.com/docs/js/tokens/create_token?type=pii). + #[serde(skip_serializing_if = "Option::is_none")] + pub id_number: Option<&'a str>, + /// The person's secondary ID number, as appropriate for their country, will be used for enhanced verification checks. + /// In Thailand, this would be the laser code found on the back of an ID card. + /// Instead of the number itself, you can also provide a [PII token provided by Stripe.js](https://stripe.com/docs/js/tokens/create_token?type=pii). + #[serde(skip_serializing_if = "Option::is_none")] + pub id_number_secondary: Option<&'a str>, + /// The person's last name. + #[serde(skip_serializing_if = "Option::is_none")] + pub last_name: Option<&'a str>, + /// The Kana variation of the person's last name (Japan only). + #[serde(skip_serializing_if = "Option::is_none")] + pub last_name_kana: Option<&'a str>, + /// The Kanji variation of the person's last name (Japan only). + #[serde(skip_serializing_if = "Option::is_none")] + pub last_name_kanji: Option<&'a str>, + /// The person's maiden name. + #[serde(skip_serializing_if = "Option::is_none")] + pub maiden_name: Option<&'a str>, + /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. + /// This can be useful for storing additional information about the object in a structured format. + /// Individual keys can be unset by posting an empty value to them. + /// All keys can be unset by posting an empty value to `metadata`. + #[serde(skip_serializing_if = "Option::is_none")] + pub metadata: Option<&'a std::collections::HashMap>, + /// The country where the person is a national. + /// Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)), or "XX" if unavailable. + #[serde(skip_serializing_if = "Option::is_none")] + pub nationality: Option<&'a str>, + /// A [person token](https://stripe.com/docs/connect/account-tokens), used to securely provide details to the person. + #[serde(skip_serializing_if = "Option::is_none")] + pub person_token: Option<&'a str>, + /// The person's phone number. + #[serde(skip_serializing_if = "Option::is_none")] + pub phone: Option<&'a str>, + /// Indicates if the person or any of their representatives, family members, or other closely related persons, declares that they hold or have held an important public job or function, in any jurisdiction. + #[serde(skip_serializing_if = "Option::is_none")] + pub political_exposure: Option<&'a str>, + /// The person's registered address. + #[serde(skip_serializing_if = "Option::is_none")] + pub registered_address: Option>, + /// The relationship that this person has with the account's legal entity. + #[serde(skip_serializing_if = "Option::is_none")] + pub relationship: Option>, + /// The last four digits of the person's Social Security number (U.S. only). + #[serde(skip_serializing_if = "Option::is_none")] + pub ssn_last_4: Option<&'a str>, + /// The person's verification status. + #[serde(skip_serializing_if = "Option::is_none")] + pub verification: Option>, +} +impl<'a> CreateAccountPerson<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// The Kana variation of the person's address (Japan only). +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreateAccountPersonAddressKana<'a> { + /// City or ward. + #[serde(skip_serializing_if = "Option::is_none")] + pub city: Option<&'a str>, + /// Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). + #[serde(skip_serializing_if = "Option::is_none")] + pub country: Option<&'a str>, + /// Block or building number. + #[serde(skip_serializing_if = "Option::is_none")] + pub line1: Option<&'a str>, + /// Building details. + #[serde(skip_serializing_if = "Option::is_none")] + pub line2: Option<&'a str>, + /// Postal code. + #[serde(skip_serializing_if = "Option::is_none")] + pub postal_code: Option<&'a str>, + /// Prefecture. + #[serde(skip_serializing_if = "Option::is_none")] + pub state: Option<&'a str>, + /// Town or cho-me. + #[serde(skip_serializing_if = "Option::is_none")] + pub town: Option<&'a str>, +} +impl<'a> CreateAccountPersonAddressKana<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// The Kanji variation of the person's address (Japan only). +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreateAccountPersonAddressKanji<'a> { + /// City or ward. + #[serde(skip_serializing_if = "Option::is_none")] + pub city: Option<&'a str>, + /// Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). + #[serde(skip_serializing_if = "Option::is_none")] + pub country: Option<&'a str>, + /// Block or building number. + #[serde(skip_serializing_if = "Option::is_none")] + pub line1: Option<&'a str>, + /// Building details. + #[serde(skip_serializing_if = "Option::is_none")] + pub line2: Option<&'a str>, + /// Postal code. + #[serde(skip_serializing_if = "Option::is_none")] + pub postal_code: Option<&'a str>, + /// Prefecture. + #[serde(skip_serializing_if = "Option::is_none")] + pub state: Option<&'a str>, + /// Town or cho-me. + #[serde(skip_serializing_if = "Option::is_none")] + pub town: Option<&'a str>, +} +impl<'a> CreateAccountPersonAddressKanji<'a> { + pub fn new() -> Self { + Self::default() + } +} +impl<'a> CreateAccountPerson<'a> { + /// Creates a new person. + pub fn send( + &self, + client: &stripe::Client, + account: &stripe_shared::AccountId, + ) -> stripe::Response { + client.send_form(&format!("/accounts/{account}/persons"), self, http_types::Method::Post) + } +} +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdatePerson<'a> { + /// Details on the legal guardian's acceptance of the required Stripe agreements. + #[serde(skip_serializing_if = "Option::is_none")] + pub additional_tos_acceptances: Option>, + /// The person's address. + #[serde(skip_serializing_if = "Option::is_none")] + pub address: Option>, + /// The Kana variation of the person's address (Japan only). + #[serde(skip_serializing_if = "Option::is_none")] + pub address_kana: Option>, + /// The Kanji variation of the person's address (Japan only). + #[serde(skip_serializing_if = "Option::is_none")] + pub address_kanji: Option>, + /// The person's date of birth. + #[serde(skip_serializing_if = "Option::is_none")] + pub dob: Option, + /// Documents that may be submitted to satisfy various informational requests. + #[serde(skip_serializing_if = "Option::is_none")] + pub documents: Option>, + /// The person's email address. + #[serde(skip_serializing_if = "Option::is_none")] + pub email: Option<&'a str>, + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, + /// The person's first name. + #[serde(skip_serializing_if = "Option::is_none")] + pub first_name: Option<&'a str>, + /// The Kana variation of the person's first name (Japan only). + #[serde(skip_serializing_if = "Option::is_none")] + pub first_name_kana: Option<&'a str>, + /// The Kanji variation of the person's first name (Japan only). + #[serde(skip_serializing_if = "Option::is_none")] + pub first_name_kanji: Option<&'a str>, + /// A list of alternate names or aliases that the person is known by. + #[serde(skip_serializing_if = "Option::is_none")] + pub full_name_aliases: Option<&'a [&'a str]>, + /// The person's gender (International regulations require either "male" or "female"). + #[serde(skip_serializing_if = "Option::is_none")] + pub gender: Option<&'a str>, + /// The person's ID number, as appropriate for their country. + /// For example, a social security number in the U.S., social insurance number in Canada, etc. + /// Instead of the number itself, you can also provide a [PII token provided by Stripe.js](https://stripe.com/docs/js/tokens/create_token?type=pii). + #[serde(skip_serializing_if = "Option::is_none")] + pub id_number: Option<&'a str>, + /// The person's secondary ID number, as appropriate for their country, will be used for enhanced verification checks. + /// In Thailand, this would be the laser code found on the back of an ID card. + /// Instead of the number itself, you can also provide a [PII token provided by Stripe.js](https://stripe.com/docs/js/tokens/create_token?type=pii). + #[serde(skip_serializing_if = "Option::is_none")] + pub id_number_secondary: Option<&'a str>, + /// The person's last name. + #[serde(skip_serializing_if = "Option::is_none")] + pub last_name: Option<&'a str>, + /// The Kana variation of the person's last name (Japan only). + #[serde(skip_serializing_if = "Option::is_none")] + pub last_name_kana: Option<&'a str>, + /// The Kanji variation of the person's last name (Japan only). + #[serde(skip_serializing_if = "Option::is_none")] + pub last_name_kanji: Option<&'a str>, + /// The person's maiden name. + #[serde(skip_serializing_if = "Option::is_none")] + pub maiden_name: Option<&'a str>, + /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. + /// This can be useful for storing additional information about the object in a structured format. + /// Individual keys can be unset by posting an empty value to them. + /// All keys can be unset by posting an empty value to `metadata`. + #[serde(skip_serializing_if = "Option::is_none")] + pub metadata: Option<&'a std::collections::HashMap>, + /// The country where the person is a national. + /// Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)), or "XX" if unavailable. + #[serde(skip_serializing_if = "Option::is_none")] + pub nationality: Option<&'a str>, + /// A [person token](https://stripe.com/docs/connect/account-tokens), used to securely provide details to the person. + #[serde(skip_serializing_if = "Option::is_none")] + pub person_token: Option<&'a str>, + /// The person's phone number. + #[serde(skip_serializing_if = "Option::is_none")] + pub phone: Option<&'a str>, + /// Indicates if the person or any of their representatives, family members, or other closely related persons, declares that they hold or have held an important public job or function, in any jurisdiction. + #[serde(skip_serializing_if = "Option::is_none")] + pub political_exposure: Option<&'a str>, + /// The person's registered address. + #[serde(skip_serializing_if = "Option::is_none")] + pub registered_address: Option>, + /// The relationship that this person has with the account's legal entity. + #[serde(skip_serializing_if = "Option::is_none")] + pub relationship: Option>, + /// The last four digits of the person's Social Security number (U.S. only). + #[serde(skip_serializing_if = "Option::is_none")] + pub ssn_last_4: Option<&'a str>, + /// The person's verification status. + #[serde(skip_serializing_if = "Option::is_none")] + pub verification: Option>, +} +impl<'a> UpdatePerson<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// The Kana variation of the person's address (Japan only). +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdatePersonAddressKana<'a> { + /// City or ward. + #[serde(skip_serializing_if = "Option::is_none")] + pub city: Option<&'a str>, + /// Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). + #[serde(skip_serializing_if = "Option::is_none")] + pub country: Option<&'a str>, + /// Block or building number. + #[serde(skip_serializing_if = "Option::is_none")] + pub line1: Option<&'a str>, + /// Building details. + #[serde(skip_serializing_if = "Option::is_none")] + pub line2: Option<&'a str>, + /// Postal code. + #[serde(skip_serializing_if = "Option::is_none")] + pub postal_code: Option<&'a str>, + /// Prefecture. + #[serde(skip_serializing_if = "Option::is_none")] + pub state: Option<&'a str>, + /// Town or cho-me. + #[serde(skip_serializing_if = "Option::is_none")] + pub town: Option<&'a str>, +} +impl<'a> UpdatePersonAddressKana<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// The Kanji variation of the person's address (Japan only). +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdatePersonAddressKanji<'a> { + /// City or ward. + #[serde(skip_serializing_if = "Option::is_none")] + pub city: Option<&'a str>, + /// Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). + #[serde(skip_serializing_if = "Option::is_none")] + pub country: Option<&'a str>, + /// Block or building number. + #[serde(skip_serializing_if = "Option::is_none")] + pub line1: Option<&'a str>, + /// Building details. + #[serde(skip_serializing_if = "Option::is_none")] + pub line2: Option<&'a str>, + /// Postal code. + #[serde(skip_serializing_if = "Option::is_none")] + pub postal_code: Option<&'a str>, + /// Prefecture. + #[serde(skip_serializing_if = "Option::is_none")] + pub state: Option<&'a str>, + /// Town or cho-me. + #[serde(skip_serializing_if = "Option::is_none")] + pub town: Option<&'a str>, +} +impl<'a> UpdatePersonAddressKanji<'a> { + pub fn new() -> Self { + Self::default() + } +} +impl<'a> UpdatePerson<'a> { + /// Updates an existing person. + pub fn send( + &self, + client: &stripe::Client, + account: &stripe_shared::AccountId, + person: &str, + ) -> stripe::Response { + client.send_form( + &format!("/accounts/{account}/persons/{person}"), + self, + http_types::Method::Post, + ) + } +} +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct SettingsTermsOfServiceSpecs<'a> { + /// The Unix timestamp marking when the account representative accepted the service agreement. + #[serde(skip_serializing_if = "Option::is_none")] + pub date: Option, + /// The IP address from which the account representative accepted the service agreement. + #[serde(skip_serializing_if = "Option::is_none")] + pub ip: Option<&'a str>, + /// The user agent of the browser from which the account representative accepted the service agreement. + #[serde(skip_serializing_if = "Option::is_none")] + pub user_agent: Option<&'a str>, +} +impl<'a> SettingsTermsOfServiceSpecs<'a> { + pub fn new() -> Self { + Self::default() + } +} +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct AddressSpecs<'a> { + /// City, district, suburb, town, or village. + #[serde(skip_serializing_if = "Option::is_none")] + pub city: Option<&'a str>, + /// Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). + #[serde(skip_serializing_if = "Option::is_none")] + pub country: Option<&'a str>, + /// Address line 1 (e.g., street, PO Box, or company name). + #[serde(skip_serializing_if = "Option::is_none")] + pub line1: Option<&'a str>, + /// Address line 2 (e.g., apartment, suite, unit, or building). + #[serde(skip_serializing_if = "Option::is_none")] + pub line2: Option<&'a str>, + /// ZIP or postal code. + #[serde(skip_serializing_if = "Option::is_none")] + pub postal_code: Option<&'a str>, + /// State, county, province, or region. + #[serde(skip_serializing_if = "Option::is_none")] + pub state: Option<&'a str>, +} +impl<'a> AddressSpecs<'a> { + pub fn new() -> Self { + Self::default() + } +} +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct DateOfBirthSpecs { + /// The day of birth, between 1 and 31. + pub day: i64, + /// The month of birth, between 1 and 12. + pub month: i64, + /// The four-digit year of birth. + pub year: i64, +} +impl DateOfBirthSpecs { + pub fn new(day: i64, month: i64, year: i64) -> Self { + Self { day, month, year } + } +} +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct DocumentsParam<'a> { + /// One or more document ids returned by a [file upload](https://stripe.com/docs/api#create_file) with a `purpose` value of `account_requirement`. + #[serde(skip_serializing_if = "Option::is_none")] + pub files: Option<&'a [&'a str]>, +} +impl<'a> DocumentsParam<'a> { + pub fn new() -> Self { + Self::default() + } +} +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct RelationshipSpecs<'a> { + /// Whether the person is a director of the account's legal entity. + /// Directors are typically members of the governing board of the company, or responsible for ensuring the company meets its regulatory obligations. + #[serde(skip_serializing_if = "Option::is_none")] + pub director: Option, + /// Whether the person has significant responsibility to control, manage, or direct the organization. + #[serde(skip_serializing_if = "Option::is_none")] + pub executive: Option, + /// Whether the person is the legal guardian of the account's representative. + #[serde(skip_serializing_if = "Option::is_none")] + pub legal_guardian: Option, + /// Whether the person is an owner of the account’s legal entity. + #[serde(skip_serializing_if = "Option::is_none")] + pub owner: Option, + /// The percent owned by the person of the account's legal entity. + #[serde(skip_serializing_if = "Option::is_none")] + pub percent_ownership: Option, + /// Whether the person is authorized as the primary representative of the account. + /// This is the person nominated by the business to provide information about themselves, and general information about the account. + /// There can only be one representative at any given time. + /// At the time the account is created, this person should be set to the person responsible for opening the account. + #[serde(skip_serializing_if = "Option::is_none")] + pub representative: Option, + /// The person's title (e.g., CEO, Support Engineer). + #[serde(skip_serializing_if = "Option::is_none")] + pub title: Option<&'a str>, +} +impl<'a> RelationshipSpecs<'a> { + pub fn new() -> Self { + Self::default() + } +} +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct PersonVerificationDocumentSpecs<'a> { + /// The back of an ID returned by a [file upload](https://stripe.com/docs/api#create_file) with a `purpose` value of `identity_document`. + /// The uploaded file needs to be a color image (smaller than 8,000px by 8,000px), in JPG, PNG, or PDF format, and less than 10 MB in size. + #[serde(skip_serializing_if = "Option::is_none")] + pub back: Option<&'a str>, + /// The front of an ID returned by a [file upload](https://stripe.com/docs/api#create_file) with a `purpose` value of `identity_document`. + /// The uploaded file needs to be a color image (smaller than 8,000px by 8,000px), in JPG, PNG, or PDF format, and less than 10 MB in size. + #[serde(skip_serializing_if = "Option::is_none")] + pub front: Option<&'a str>, +} +impl<'a> PersonVerificationDocumentSpecs<'a> { + pub fn new() -> Self { + Self::default() + } +} +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct PersonAdditionalTosAcceptancesSpecs<'a> { + /// Details on the legal guardian's acceptance of the main Stripe service agreement. + #[serde(skip_serializing_if = "Option::is_none")] + pub account: Option>, +} +impl<'a> PersonAdditionalTosAcceptancesSpecs<'a> { + pub fn new() -> Self { + Self::default() + } +} +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct PersonDocumentsSpecs<'a> { + /// One or more documents that demonstrate proof that this person is authorized to represent the company. + #[serde(skip_serializing_if = "Option::is_none")] + pub company_authorization: Option>, + /// One or more documents showing the person's passport page with photo and personal data. + #[serde(skip_serializing_if = "Option::is_none")] + pub passport: Option>, + /// One or more documents showing the person's visa required for living in the country where they are residing. + #[serde(skip_serializing_if = "Option::is_none")] + pub visa: Option>, +} +impl<'a> PersonDocumentsSpecs<'a> { + pub fn new() -> Self { + Self::default() + } +} +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct PersonVerificationSpecs<'a> { + /// A document showing address, either a passport, local ID card, or utility bill from a well-known utility company. + #[serde(skip_serializing_if = "Option::is_none")] + pub additional_document: Option>, + /// An identifying document, either a passport or local ID card. + #[serde(skip_serializing_if = "Option::is_none")] + pub document: Option>, +} +impl<'a> PersonVerificationSpecs<'a> { + pub fn new() -> Self { + Self::default() + } +} diff --git a/generated/stripe_connect/src/secret_service_resource_scope.rs b/generated/stripe_connect/src/secret_service_resource_scope.rs new file mode 100644 index 000000000..406d9c7de --- /dev/null +++ b/generated/stripe_connect/src/secret_service_resource_scope.rs @@ -0,0 +1,64 @@ +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct SecretServiceResourceScope { + /// The secret scope type. + #[serde(rename = "type")] + pub type_: SecretServiceResourceScopeType, + /// The user ID, if type is set to "user" + #[serde(skip_serializing_if = "Option::is_none")] + pub user: Option, +} +/// The secret scope type. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum SecretServiceResourceScopeType { + Account, + User, +} +impl SecretServiceResourceScopeType { + pub fn as_str(self) -> &'static str { + use SecretServiceResourceScopeType::*; + match self { + Account => "account", + User => "user", + } + } +} + +impl std::str::FromStr for SecretServiceResourceScopeType { + type Err = (); + fn from_str(s: &str) -> Result { + use SecretServiceResourceScopeType::*; + match s { + "account" => Ok(Account), + "user" => Ok(User), + _ => Err(()), + } + } +} +impl std::fmt::Display for SecretServiceResourceScopeType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for SecretServiceResourceScopeType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for SecretServiceResourceScopeType { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for SecretServiceResourceScopeType { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| { + serde::de::Error::custom("Unknown value for SecretServiceResourceScopeType") + }) + } +} diff --git a/generated/stripe_connect/src/topup/mod.rs b/generated/stripe_connect/src/topup/mod.rs new file mode 100644 index 000000000..d7d17342f --- /dev/null +++ b/generated/stripe_connect/src/topup/mod.rs @@ -0,0 +1,4 @@ +#[cfg(feature = "topup")] +mod requests; +#[cfg(feature = "topup")] +pub use requests::*; diff --git a/generated/stripe_connect/src/topup/requests.rs b/generated/stripe_connect/src/topup/requests.rs new file mode 100644 index 000000000..03f9763fc --- /dev/null +++ b/generated/stripe_connect/src/topup/requests.rs @@ -0,0 +1,225 @@ +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct ListTopup<'a> { + /// A positive integer representing how much to transfer. + #[serde(skip_serializing_if = "Option::is_none")] + pub amount: Option, + /// A filter on the list, based on the object `created` field. + /// The value can be a string with an integer Unix timestamp, or it can be a dictionary with a number of different query options. + #[serde(skip_serializing_if = "Option::is_none")] + pub created: Option, + /// A cursor for use in pagination. + /// `ending_before` is an object ID that defines your place in the list. + /// For instance, if you make a list request and receive 100 objects, starting with `obj_bar`, your subsequent call can include `ending_before=obj_bar` in order to fetch the previous page of the list. + #[serde(skip_serializing_if = "Option::is_none")] + pub ending_before: Option<&'a str>, + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, + /// A limit on the number of objects to be returned. + /// Limit can range between 1 and 100, and the default is 10. + #[serde(skip_serializing_if = "Option::is_none")] + pub limit: Option, + /// A cursor for use in pagination. + /// `starting_after` is an object ID that defines your place in the list. + /// For instance, if you make a list request and receive 100 objects, ending with `obj_foo`, your subsequent call can include `starting_after=obj_foo` in order to fetch the next page of the list. + #[serde(skip_serializing_if = "Option::is_none")] + pub starting_after: Option<&'a str>, + /// Only return top-ups that have the given status. + /// One of `canceled`, `failed`, `pending` or `succeeded`. + #[serde(skip_serializing_if = "Option::is_none")] + pub status: Option, +} +impl<'a> ListTopup<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// Only return top-ups that have the given status. +/// One of `canceled`, `failed`, `pending` or `succeeded`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum ListTopupStatus { + Canceled, + Failed, + Pending, + Succeeded, +} +impl ListTopupStatus { + pub fn as_str(self) -> &'static str { + use ListTopupStatus::*; + match self { + Canceled => "canceled", + Failed => "failed", + Pending => "pending", + Succeeded => "succeeded", + } + } +} + +impl std::str::FromStr for ListTopupStatus { + type Err = (); + fn from_str(s: &str) -> Result { + use ListTopupStatus::*; + match s { + "canceled" => Ok(Canceled), + "failed" => Ok(Failed), + "pending" => Ok(Pending), + "succeeded" => Ok(Succeeded), + _ => Err(()), + } + } +} +impl std::fmt::Display for ListTopupStatus { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for ListTopupStatus { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for ListTopupStatus { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'a> ListTopup<'a> { + /// Returns a list of top-ups. + pub fn send( + &self, + client: &stripe::Client, + ) -> stripe::Response> { + client.get_query("/topups", self) + } + pub fn paginate(self) -> stripe::ListPaginator> { + stripe::ListPaginator::from_list_params("/topups", self) + } +} +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct RetrieveTopup<'a> { + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, +} +impl<'a> RetrieveTopup<'a> { + pub fn new() -> Self { + Self::default() + } +} +impl<'a> RetrieveTopup<'a> { + /// Retrieves the details of a top-up that has previously been created. + /// Supply the unique top-up ID that was returned from your previous request, and Stripe will return the corresponding top-up information. + pub fn send( + &self, + client: &stripe::Client, + topup: &stripe_shared::TopupId, + ) -> stripe::Response { + client.get_query(&format!("/topups/{topup}"), self) + } +} +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreateTopup<'a> { + /// A positive integer representing how much to transfer. + pub amount: i64, + /// Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. + /// Must be a [supported currency](https://stripe.com/docs/currencies). + pub currency: stripe_types::Currency, + /// An arbitrary string attached to the object. Often useful for displaying to users. + #[serde(skip_serializing_if = "Option::is_none")] + pub description: Option<&'a str>, + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, + /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. + /// This can be useful for storing additional information about the object in a structured format. + /// Individual keys can be unset by posting an empty value to them. + /// All keys can be unset by posting an empty value to `metadata`. + #[serde(skip_serializing_if = "Option::is_none")] + pub metadata: Option<&'a std::collections::HashMap>, + /// The ID of a source to transfer funds from. + /// For most users, this should be left unspecified which will use the bank account that was set up in the dashboard for the specified currency. + /// In test mode, this can be a test bank token (see [Testing Top-ups](https://stripe.com/docs/connect/testing#testing-top-ups)). + #[serde(skip_serializing_if = "Option::is_none")] + pub source: Option<&'a str>, + /// Extra information about a top-up for the source's bank statement. Limited to 15 ASCII characters. + #[serde(skip_serializing_if = "Option::is_none")] + pub statement_descriptor: Option<&'a str>, + /// A string that identifies this top-up as part of a group. + #[serde(skip_serializing_if = "Option::is_none")] + pub transfer_group: Option<&'a str>, +} +impl<'a> CreateTopup<'a> { + pub fn new(amount: i64, currency: stripe_types::Currency) -> Self { + Self { + amount, + currency, + description: None, + expand: None, + metadata: None, + source: None, + statement_descriptor: None, + transfer_group: None, + } + } +} +impl<'a> CreateTopup<'a> { + /// Top up the balance of an account + pub fn send(&self, client: &stripe::Client) -> stripe::Response { + client.send_form("/topups", self, http_types::Method::Post) + } +} +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdateTopup<'a> { + /// An arbitrary string attached to the object. Often useful for displaying to users. + #[serde(skip_serializing_if = "Option::is_none")] + pub description: Option<&'a str>, + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, + /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. + /// This can be useful for storing additional information about the object in a structured format. + /// Individual keys can be unset by posting an empty value to them. + /// All keys can be unset by posting an empty value to `metadata`. + #[serde(skip_serializing_if = "Option::is_none")] + pub metadata: Option<&'a std::collections::HashMap>, +} +impl<'a> UpdateTopup<'a> { + pub fn new() -> Self { + Self::default() + } +} +impl<'a> UpdateTopup<'a> { + /// Updates the metadata of a top-up. Other top-up details are not editable by design. + pub fn send( + &self, + client: &stripe::Client, + topup: &stripe_shared::TopupId, + ) -> stripe::Response { + client.send_form(&format!("/topups/{topup}"), self, http_types::Method::Post) + } +} +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CancelTopup<'a> { + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, +} +impl<'a> CancelTopup<'a> { + pub fn new() -> Self { + Self::default() + } +} +impl<'a> CancelTopup<'a> { + /// Cancels a top-up. Only pending top-ups can be canceled. + pub fn send( + &self, + client: &stripe::Client, + topup: &stripe_shared::TopupId, + ) -> stripe::Response { + client.send_form(&format!("/topups/{topup}/cancel"), self, http_types::Method::Post) + } +} diff --git a/generated/stripe_connect/src/transfer/mod.rs b/generated/stripe_connect/src/transfer/mod.rs new file mode 100644 index 000000000..bccbae523 --- /dev/null +++ b/generated/stripe_connect/src/transfer/mod.rs @@ -0,0 +1,4 @@ +#[cfg(feature = "transfer")] +mod requests; +#[cfg(feature = "transfer")] +pub use requests::*; diff --git a/generated/stripe_connect/src/transfer/requests.rs b/generated/stripe_connect/src/transfer/requests.rs new file mode 100644 index 000000000..876c3fb8c --- /dev/null +++ b/generated/stripe_connect/src/transfer/requests.rs @@ -0,0 +1,211 @@ +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct ListTransfer<'a> { + #[serde(skip_serializing_if = "Option::is_none")] + pub created: Option, + /// Only return transfers for the destination specified by this account ID. + #[serde(skip_serializing_if = "Option::is_none")] + pub destination: Option<&'a str>, + /// A cursor for use in pagination. + /// `ending_before` is an object ID that defines your place in the list. + /// For instance, if you make a list request and receive 100 objects, starting with `obj_bar`, your subsequent call can include `ending_before=obj_bar` in order to fetch the previous page of the list. + #[serde(skip_serializing_if = "Option::is_none")] + pub ending_before: Option<&'a str>, + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, + /// A limit on the number of objects to be returned. + /// Limit can range between 1 and 100, and the default is 10. + #[serde(skip_serializing_if = "Option::is_none")] + pub limit: Option, + /// A cursor for use in pagination. + /// `starting_after` is an object ID that defines your place in the list. + /// For instance, if you make a list request and receive 100 objects, ending with `obj_foo`, your subsequent call can include `starting_after=obj_foo` in order to fetch the next page of the list. + #[serde(skip_serializing_if = "Option::is_none")] + pub starting_after: Option<&'a str>, + /// Only return transfers with the specified transfer group. + #[serde(skip_serializing_if = "Option::is_none")] + pub transfer_group: Option<&'a str>, +} +impl<'a> ListTransfer<'a> { + pub fn new() -> Self { + Self::default() + } +} +impl<'a> ListTransfer<'a> { + /// Returns a list of existing transfers sent to connected accounts. + /// The transfers are returned in sorted order, with the most recently created transfers appearing first. + pub fn send( + &self, + client: &stripe::Client, + ) -> stripe::Response> { + client.get_query("/transfers", self) + } + pub fn paginate(self) -> stripe::ListPaginator> { + stripe::ListPaginator::from_list_params("/transfers", self) + } +} +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct RetrieveTransfer<'a> { + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, +} +impl<'a> RetrieveTransfer<'a> { + pub fn new() -> Self { + Self::default() + } +} +impl<'a> RetrieveTransfer<'a> { + /// Retrieves the details of an existing transfer. + /// Supply the unique transfer ID from either a transfer creation request or the transfer list, and Stripe will return the corresponding transfer information. + pub fn send( + &self, + client: &stripe::Client, + transfer: &stripe_shared::TransferId, + ) -> stripe::Response { + client.get_query(&format!("/transfers/{transfer}"), self) + } +} +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreateTransfer<'a> { + /// A positive integer in cents (or local equivalent) representing how much to transfer. + #[serde(skip_serializing_if = "Option::is_none")] + pub amount: Option, + /// 3-letter [ISO code for currency](https://stripe.com/docs/payouts). + pub currency: stripe_types::Currency, + /// An arbitrary string attached to the object. Often useful for displaying to users. + #[serde(skip_serializing_if = "Option::is_none")] + pub description: Option<&'a str>, + /// The ID of a connected Stripe account. + /// [See the Connect documentation](https://stripe.com/docs/connect/separate-charges-and-transfers) for details. + pub destination: &'a str, + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, + /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. + /// This can be useful for storing additional information about the object in a structured format. + /// Individual keys can be unset by posting an empty value to them. + /// All keys can be unset by posting an empty value to `metadata`. + #[serde(skip_serializing_if = "Option::is_none")] + pub metadata: Option<&'a std::collections::HashMap>, + /// You can use this parameter to transfer funds from a charge before they are added to your available balance. + /// A pending balance will transfer immediately but the funds will not become available until the original charge becomes available. + /// [See the Connect documentation](https://stripe.com/docs/connect/separate-charges-and-transfers#transfer-availability) for details. + #[serde(skip_serializing_if = "Option::is_none")] + pub source_transaction: Option<&'a str>, + /// The source balance to use for this transfer. + /// One of `bank_account`, `card`, or `fpx`. + /// For most users, this will default to `card`. + #[serde(skip_serializing_if = "Option::is_none")] + pub source_type: Option, + /// A string that identifies this transaction as part of a group. + /// See the [Connect documentation](https://stripe.com/docs/connect/separate-charges-and-transfers#transfer-options) for details. + #[serde(skip_serializing_if = "Option::is_none")] + pub transfer_group: Option<&'a str>, +} +impl<'a> CreateTransfer<'a> { + pub fn new(currency: stripe_types::Currency, destination: &'a str) -> Self { + Self { + amount: None, + currency, + description: None, + destination, + expand: None, + metadata: None, + source_transaction: None, + source_type: None, + transfer_group: None, + } + } +} +/// The source balance to use for this transfer. +/// One of `bank_account`, `card`, or `fpx`. +/// For most users, this will default to `card`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreateTransferSourceType { + BankAccount, + Card, + Fpx, +} +impl CreateTransferSourceType { + pub fn as_str(self) -> &'static str { + use CreateTransferSourceType::*; + match self { + BankAccount => "bank_account", + Card => "card", + Fpx => "fpx", + } + } +} + +impl std::str::FromStr for CreateTransferSourceType { + type Err = (); + fn from_str(s: &str) -> Result { + use CreateTransferSourceType::*; + match s { + "bank_account" => Ok(BankAccount), + "card" => Ok(Card), + "fpx" => Ok(Fpx), + _ => Err(()), + } + } +} +impl std::fmt::Display for CreateTransferSourceType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreateTransferSourceType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreateTransferSourceType { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'a> CreateTransfer<'a> { + /// To send funds from your Stripe account to a connected account, you create a new transfer object. + /// Your [Stripe balance](https://stripe.com/docs/api#balance) must be able to cover the transfer amount, or you’ll receive an “Insufficient Funds” error. + pub fn send(&self, client: &stripe::Client) -> stripe::Response { + client.send_form("/transfers", self, http_types::Method::Post) + } +} +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdateTransfer<'a> { + /// An arbitrary string attached to the object. Often useful for displaying to users. + #[serde(skip_serializing_if = "Option::is_none")] + pub description: Option<&'a str>, + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, + /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. + /// This can be useful for storing additional information about the object in a structured format. + /// Individual keys can be unset by posting an empty value to them. + /// All keys can be unset by posting an empty value to `metadata`. + #[serde(skip_serializing_if = "Option::is_none")] + pub metadata: Option<&'a std::collections::HashMap>, +} +impl<'a> UpdateTransfer<'a> { + pub fn new() -> Self { + Self::default() + } +} +impl<'a> UpdateTransfer<'a> { + /// Updates the specified transfer by setting the values of the parameters passed. + /// Any parameters not provided will be left unchanged. + /// + /// This request accepts only metadata as an argument. + pub fn send( + &self, + client: &stripe::Client, + transfer: &stripe_shared::TransferId, + ) -> stripe::Response { + client.send_form(&format!("/transfers/{transfer}"), self, http_types::Method::Post) + } +} diff --git a/generated/stripe_connect/src/transfer_reversal/mod.rs b/generated/stripe_connect/src/transfer_reversal/mod.rs new file mode 100644 index 000000000..0eb286976 --- /dev/null +++ b/generated/stripe_connect/src/transfer_reversal/mod.rs @@ -0,0 +1,4 @@ +#[cfg(feature = "transfer_reversal")] +mod requests; +#[cfg(feature = "transfer_reversal")] +pub use requests::*; diff --git a/generated/stripe_connect/src/transfer_reversal/requests.rs b/generated/stripe_connect/src/transfer_reversal/requests.rs new file mode 100644 index 000000000..66e84e731 --- /dev/null +++ b/generated/stripe_connect/src/transfer_reversal/requests.rs @@ -0,0 +1,149 @@ +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct ListIdTransferReversal<'a> { + /// A cursor for use in pagination. + /// `ending_before` is an object ID that defines your place in the list. + /// For instance, if you make a list request and receive 100 objects, starting with `obj_bar`, your subsequent call can include `ending_before=obj_bar` in order to fetch the previous page of the list. + #[serde(skip_serializing_if = "Option::is_none")] + pub ending_before: Option<&'a str>, + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, + /// A limit on the number of objects to be returned. + /// Limit can range between 1 and 100, and the default is 10. + #[serde(skip_serializing_if = "Option::is_none")] + pub limit: Option, + /// A cursor for use in pagination. + /// `starting_after` is an object ID that defines your place in the list. + /// For instance, if you make a list request and receive 100 objects, ending with `obj_foo`, your subsequent call can include `starting_after=obj_foo` in order to fetch the next page of the list. + #[serde(skip_serializing_if = "Option::is_none")] + pub starting_after: Option<&'a str>, +} +impl<'a> ListIdTransferReversal<'a> { + pub fn new() -> Self { + Self::default() + } +} +impl<'a> ListIdTransferReversal<'a> { + /// You can see a list of the reversals belonging to a specific transfer. + /// Note that the 10 most recent reversals are always available by default on the transfer object. + /// If you need more than those 10, you can use this API method and the `limit` and `starting_after` parameters to page through additional reversals. + pub fn send( + &self, + client: &stripe::Client, + id: &stripe_shared::TransferId, + ) -> stripe::Response> { + client.get_query(&format!("/transfers/{id}/reversals"), self) + } + pub fn paginate( + self, + id: &stripe_shared::TransferId, + ) -> stripe::ListPaginator> { + stripe::ListPaginator::from_list_params(&format!("/transfers/{id}/reversals"), self) + } +} +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct RetrieveTransferReversal<'a> { + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, +} +impl<'a> RetrieveTransferReversal<'a> { + pub fn new() -> Self { + Self::default() + } +} +impl<'a> RetrieveTransferReversal<'a> { + /// By default, you can see the 10 most recent reversals stored directly on the transfer object, but you can also retrieve details about a specific reversal stored on the transfer. + pub fn send( + &self, + client: &stripe::Client, + id: &str, + transfer: &stripe_shared::TransferId, + ) -> stripe::Response { + client.get_query(&format!("/transfers/{transfer}/reversals/{id}"), self) + } +} +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreateIdTransferReversal<'a> { + /// A positive integer in cents (or local equivalent) representing how much of this transfer to reverse. + /// Can only reverse up to the unreversed amount remaining of the transfer. + /// Partial transfer reversals are only allowed for transfers to Stripe Accounts. + /// Defaults to the entire transfer amount. + #[serde(skip_serializing_if = "Option::is_none")] + pub amount: Option, + /// An arbitrary string which you can attach to a reversal object. + /// It is displayed alongside the reversal in the Dashboard. + /// This will be unset if you POST an empty value. + #[serde(skip_serializing_if = "Option::is_none")] + pub description: Option<&'a str>, + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, + /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. + /// This can be useful for storing additional information about the object in a structured format. + /// Individual keys can be unset by posting an empty value to them. + /// All keys can be unset by posting an empty value to `metadata`. + #[serde(skip_serializing_if = "Option::is_none")] + pub metadata: Option<&'a std::collections::HashMap>, + /// Boolean indicating whether the application fee should be refunded when reversing this transfer. + /// If a full transfer reversal is given, the full application fee will be refunded. + /// Otherwise, the application fee will be refunded with an amount proportional to the amount of the transfer reversed. + #[serde(skip_serializing_if = "Option::is_none")] + pub refund_application_fee: Option, +} +impl<'a> CreateIdTransferReversal<'a> { + pub fn new() -> Self { + Self::default() + } +} +impl<'a> CreateIdTransferReversal<'a> { + /// When you create a new reversal, you must specify a transfer to create it on. + /// + /// When reversing transfers, you can optionally reverse part of the transfer. + /// You can do so as many times as you wish until the entire transfer has been reversed. + /// + /// Once entirely reversed, a transfer can’t be reversed again. + /// This method will return an error when called on an already-reversed transfer, or when trying to reverse more money than is left on a transfer. + pub fn send( + &self, + client: &stripe::Client, + id: &stripe_shared::TransferId, + ) -> stripe::Response { + client.send_form(&format!("/transfers/{id}/reversals"), self, http_types::Method::Post) + } +} +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdateTransferReversal<'a> { + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, + /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. + /// This can be useful for storing additional information about the object in a structured format. + /// Individual keys can be unset by posting an empty value to them. + /// All keys can be unset by posting an empty value to `metadata`. + #[serde(skip_serializing_if = "Option::is_none")] + pub metadata: Option<&'a std::collections::HashMap>, +} +impl<'a> UpdateTransferReversal<'a> { + pub fn new() -> Self { + Self::default() + } +} +impl<'a> UpdateTransferReversal<'a> { + /// Updates the specified reversal by setting the values of the parameters passed. + /// Any parameters not provided will be left unchanged. + /// + /// This request only accepts metadata and description as arguments. + pub fn send( + &self, + client: &stripe::Client, + id: &str, + transfer: &stripe_shared::TransferId, + ) -> stripe::Response { + client.send_form( + &format!("/transfers/{transfer}/reversals/{id}"), + self, + http_types::Method::Post, + ) + } +} diff --git a/generated/stripe_core/Cargo.toml b/generated/stripe_core/Cargo.toml new file mode 100644 index 000000000..0a810ddff --- /dev/null +++ b/generated/stripe_core/Cargo.toml @@ -0,0 +1,84 @@ +[package] +name = "stripe_core" +version.workspace = true +description.workspace = true +edition.workspace = true +rust-version.workspace = true +authors.workspace = true +license.workspace = true +homepage.workspace = true +repository.workspace = true +keywords.workspace = true +categories.workspace = true + +[lib] +path = "src/mod.rs" + +[dependencies] +serde.workspace = true +smol_str.workspace = true +serde_json.workspace = true +stripe_types = {path = "../../stripe_types"} + +http-types.workspace = true +async-stripe = {path = "../../async-stripe"} + + +stripe_shared = {path = "../../generated/stripe_shared"} + + +[features] +runtime-tokio-hyper = ["async-stripe/runtime-tokio-hyper"] +runtime-tokio-hyper-rustls = ["async-stripe/runtime-tokio-hyper-rustls"] +runtime-tokio-hyper-rustls-webpki = ["async-stripe/runtime-tokio-hyper-rustls-webpki"] +runtime-blocking = ["async-stripe/runtime-blocking"] +runtime-blocking-rustls = ["async-stripe/runtime-blocking-rustls"] +runtime-blocking-rustls-webpki = ["async-stripe/runtime-blocking-rustls-webpki"] +runtime-async-std-surf = ["async-stripe/runtime-async-std-surf"] + +balance = [] +balance_transaction = [] +cash_balance = [] +charge = [] +customer = [] +customer_balance_transaction = [] +customer_cash_balance_transaction = [] +customer_session = [] +dispute = [] +event = [] +file = [] +file_link = [] +mandate = [] +payment_intent = [] +payment_source = [] +payout = [] +refund = [] +setup_attempt = [] +setup_intent = [] +token = [] + +full = ["balance", +"balance_transaction", +"cash_balance", +"charge", +"customer", +"customer_balance_transaction", +"customer_cash_balance_transaction", +"customer_session", +"dispute", +"event", +"file", +"file_link", +"mandate", +"payment_intent", +"payment_source", +"payout", +"refund", +"setup_attempt", +"setup_intent", +"token"] + + +[package.metadata.docs.rs] +features = ["runtime-tokio-hyper", "full"] + diff --git a/generated/stripe_core/src/balance/mod.rs b/generated/stripe_core/src/balance/mod.rs new file mode 100644 index 000000000..34433cf63 --- /dev/null +++ b/generated/stripe_core/src/balance/mod.rs @@ -0,0 +1,5 @@ +#[cfg(feature = "balance")] +mod requests; +pub(crate) mod types; +#[cfg(feature = "balance")] +pub use requests::*; diff --git a/generated/stripe_core/src/balance/requests.rs b/generated/stripe_core/src/balance/requests.rs new file mode 100644 index 000000000..8b355f04a --- /dev/null +++ b/generated/stripe_core/src/balance/requests.rs @@ -0,0 +1,18 @@ +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct RetrieveForMyAccountBalance<'a> { + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, +} +impl<'a> RetrieveForMyAccountBalance<'a> { + pub fn new() -> Self { + Self::default() + } +} +impl<'a> RetrieveForMyAccountBalance<'a> { + /// Retrieves the current account balance, based on the authentication that was used to make the request. + /// For a sample request, see [Accounting for negative balances](https://stripe.com/docs/connect/account-balances#accounting-for-negative-balances). + pub fn send(&self, client: &stripe::Client) -> stripe::Response { + client.get_query("/balance", self) + } +} diff --git a/generated/stripe_core/src/balance/types.rs b/generated/stripe_core/src/balance/types.rs new file mode 100644 index 000000000..8fda3090d --- /dev/null +++ b/generated/stripe_core/src/balance/types.rs @@ -0,0 +1,33 @@ +/// This is an object representing your Stripe balance. You can retrieve it to see +/// the balance currently on your Stripe account. +/// +/// You can also retrieve the balance history, which contains a list of +/// [transactions](https://stripe.com/docs/reporting/balance-transaction-types) that contributed to the balance. +/// (charges, payouts, and so forth). +/// +/// The available and pending amounts for each currency are broken down further by +/// payment source types. +/// +/// Related guide: [Understanding Connect account balances](https://stripe.com/docs/connect/account-balances). +/// +/// For more details see <>. +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct Balance { + /// Available funds that you can transfer or pay out automatically by Stripe or explicitly through the [Transfers API](https://stripe.com/docs/api#transfers) or [Payouts API](https://stripe.com/docs/api#payouts). + /// You can find the available balance for each currency and payment type in the `source_types` property. + pub available: Vec, + /// Funds held due to negative balances on connected Custom accounts. + /// You can find the connect reserve balance for each currency and payment type in the `source_types` property. + #[serde(skip_serializing_if = "Option::is_none")] + pub connect_reserved: Option>, + /// Funds that you can pay out using Instant Payouts. + #[serde(skip_serializing_if = "Option::is_none")] + pub instant_available: Option>, + #[serde(skip_serializing_if = "Option::is_none")] + pub issuing: Option, + /// Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + pub livemode: bool, + /// Funds that aren't available in the balance yet. + /// You can find the pending balance for each currency and each payment type in the `source_types` property. + pub pending: Vec, +} diff --git a/generated/stripe_core/src/balance_amount.rs b/generated/stripe_core/src/balance_amount.rs new file mode 100644 index 000000000..4ced136aa --- /dev/null +++ b/generated/stripe_core/src/balance_amount.rs @@ -0,0 +1,10 @@ +#[derive(Copy, Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct BalanceAmount { + /// Balance amount. + pub amount: i64, + /// Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. + /// Must be a [supported currency](https://stripe.com/docs/currencies). + pub currency: stripe_types::Currency, + #[serde(skip_serializing_if = "Option::is_none")] + pub source_types: Option, +} diff --git a/src/resources/generated/balance_amount_by_source_type.rs b/generated/stripe_core/src/balance_amount_by_source_type.rs similarity index 56% rename from src/resources/generated/balance_amount_by_source_type.rs rename to generated/stripe_core/src/balance_amount_by_source_type.rs index c83859bf5..6fbb1b6eb 100644 --- a/src/resources/generated/balance_amount_by_source_type.rs +++ b/generated/stripe_core/src/balance_amount_by_source_type.rs @@ -1,20 +1,11 @@ -// ====================================== -// This file was automatically generated. -// ====================================== - -use serde::{Deserialize, Serialize}; - -/// The resource representing a Stripe "BalanceAmountBySourceType". -#[derive(Clone, Debug, Default, Deserialize, Serialize)] +#[derive(Copy, Clone, Debug, Default, serde::Serialize, serde::Deserialize)] pub struct BalanceAmountBySourceType { /// Amount for bank account. #[serde(skip_serializing_if = "Option::is_none")] pub bank_account: Option, - /// Amount for card. #[serde(skip_serializing_if = "Option::is_none")] pub card: Option, - /// Amount for FPX. #[serde(skip_serializing_if = "Option::is_none")] pub fpx: Option, diff --git a/generated/stripe_core/src/balance_amount_net.rs b/generated/stripe_core/src/balance_amount_net.rs new file mode 100644 index 000000000..a8fe12a30 --- /dev/null +++ b/generated/stripe_core/src/balance_amount_net.rs @@ -0,0 +1,10 @@ +#[derive(Copy, Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct BalanceAmountNet { + /// Balance amount. + pub amount: i64, + /// Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. + /// Must be a [supported currency](https://stripe.com/docs/currencies). + pub currency: stripe_types::Currency, + #[serde(skip_serializing_if = "Option::is_none")] + pub source_types: Option, +} diff --git a/generated/stripe_core/src/balance_detail.rs b/generated/stripe_core/src/balance_detail.rs new file mode 100644 index 000000000..c7cdd9af8 --- /dev/null +++ b/generated/stripe_core/src/balance_detail.rs @@ -0,0 +1,5 @@ +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct BalanceDetail { + /// Funds that are available for use. + pub available: Vec, +} diff --git a/generated/stripe_core/src/balance_transaction/mod.rs b/generated/stripe_core/src/balance_transaction/mod.rs new file mode 100644 index 000000000..b8468ac27 --- /dev/null +++ b/generated/stripe_core/src/balance_transaction/mod.rs @@ -0,0 +1,4 @@ +#[cfg(feature = "balance_transaction")] +mod requests; +#[cfg(feature = "balance_transaction")] +pub use requests::*; diff --git a/generated/stripe_core/src/balance_transaction/requests.rs b/generated/stripe_core/src/balance_transaction/requests.rs new file mode 100644 index 000000000..ecdda4709 --- /dev/null +++ b/generated/stripe_core/src/balance_transaction/requests.rs @@ -0,0 +1,83 @@ +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct ListBalanceTransaction<'a> { + #[serde(skip_serializing_if = "Option::is_none")] + pub created: Option, + /// Only return transactions in a certain currency. + /// Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. + /// Must be a [supported currency](https://stripe.com/docs/currencies). + #[serde(skip_serializing_if = "Option::is_none")] + pub currency: Option, + /// A cursor for use in pagination. + /// `ending_before` is an object ID that defines your place in the list. + /// For instance, if you make a list request and receive 100 objects, starting with `obj_bar`, your subsequent call can include `ending_before=obj_bar` in order to fetch the previous page of the list. + #[serde(skip_serializing_if = "Option::is_none")] + pub ending_before: Option<&'a str>, + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, + /// A limit on the number of objects to be returned. + /// Limit can range between 1 and 100, and the default is 10. + #[serde(skip_serializing_if = "Option::is_none")] + pub limit: Option, + /// For automatic Stripe payouts only, only returns transactions that were paid out on the specified payout ID. + #[serde(skip_serializing_if = "Option::is_none")] + pub payout: Option<&'a str>, + /// Only returns the original transaction. + #[serde(skip_serializing_if = "Option::is_none")] + pub source: Option<&'a str>, + /// A cursor for use in pagination. + /// `starting_after` is an object ID that defines your place in the list. + /// For instance, if you make a list request and receive 100 objects, ending with `obj_foo`, your subsequent call can include `starting_after=obj_foo` in order to fetch the next page of the list. + #[serde(skip_serializing_if = "Option::is_none")] + pub starting_after: Option<&'a str>, + /// Only returns transactions of the given type. + /// One of: `adjustment`, `advance`, `advance_funding`, `anticipation_repayment`, `application_fee`, `application_fee_refund`, `charge`, `climate_order_purchase`, `climate_order_refund`, `connect_collection_transfer`, `contribution`, `issuing_authorization_hold`, `issuing_authorization_release`, `issuing_dispute`, `issuing_transaction`, `obligation_outbound`, `obligation_reversal_inbound`, `payment`, `payment_failure_refund`, `payment_network_reserve_hold`, `payment_network_reserve_release`, `payment_refund`, `payment_reversal`, `payment_unreconciled`, `payout`, `payout_cancel`, `payout_failure`, `refund`, `refund_failure`, `reserve_transaction`, `reserved_funds`, `stripe_fee`, `stripe_fx_fee`, `tax_fee`, `topup`, `topup_reversal`, `transfer`, `transfer_cancel`, `transfer_failure`, or `transfer_refund`. + #[serde(rename = "type")] + #[serde(skip_serializing_if = "Option::is_none")] + pub type_: Option<&'a str>, +} +impl<'a> ListBalanceTransaction<'a> { + pub fn new() -> Self { + Self::default() + } +} +impl<'a> ListBalanceTransaction<'a> { + /// Returns a list of transactions that have contributed to the Stripe account balance (e.g., charges, transfers, and so forth). + /// The transactions are returned in sorted order, with the most recent transactions appearing first. + /// + /// Note that this endpoint was previously called “Balance history” and used the path `/v1/balance/history`. + pub fn send( + &self, + client: &stripe::Client, + ) -> stripe::Response> { + client.get_query("/balance_transactions", self) + } + pub fn paginate( + self, + ) -> stripe::ListPaginator> { + stripe::ListPaginator::from_list_params("/balance_transactions", self) + } +} +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct RetrieveBalanceTransaction<'a> { + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, +} +impl<'a> RetrieveBalanceTransaction<'a> { + pub fn new() -> Self { + Self::default() + } +} +impl<'a> RetrieveBalanceTransaction<'a> { + /// Retrieves the balance transaction with the given ID. + /// + /// Note that this endpoint previously used the path `/v1/balance/history/:id`. + pub fn send( + &self, + client: &stripe::Client, + id: &stripe_shared::BalanceTransactionId, + ) -> stripe::Response { + client.get_query(&format!("/balance_transactions/{id}"), self) + } +} diff --git a/generated/stripe_core/src/cash_balance/mod.rs b/generated/stripe_core/src/cash_balance/mod.rs new file mode 100644 index 000000000..270325f0b --- /dev/null +++ b/generated/stripe_core/src/cash_balance/mod.rs @@ -0,0 +1,4 @@ +#[cfg(feature = "cash_balance")] +mod requests; +#[cfg(feature = "cash_balance")] +pub use requests::*; diff --git a/generated/stripe_core/src/cash_balance/requests.rs b/generated/stripe_core/src/cash_balance/requests.rs new file mode 100644 index 000000000..48acee1ca --- /dev/null +++ b/generated/stripe_core/src/cash_balance/requests.rs @@ -0,0 +1,114 @@ +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct RetrieveCashBalance<'a> { + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, +} +impl<'a> RetrieveCashBalance<'a> { + pub fn new() -> Self { + Self::default() + } +} +impl<'a> RetrieveCashBalance<'a> { + /// Retrieves a customer’s cash balance. + pub fn send( + &self, + client: &stripe::Client, + customer: &stripe_shared::CustomerId, + ) -> stripe::Response { + client.get_query(&format!("/customers/{customer}/cash_balance"), self) + } +} +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdateCashBalance<'a> { + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, + /// A hash of settings for this cash balance. + #[serde(skip_serializing_if = "Option::is_none")] + pub settings: Option, +} +impl<'a> UpdateCashBalance<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// A hash of settings for this cash balance. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdateCashBalanceSettings { + /// Controls how funds transferred by the customer are applied to payment intents and invoices. + /// Valid options are `automatic`, `manual`, or `merchant_default`. + /// For more information about these reconciliation modes, see [Reconciliation](https://stripe.com/docs/payments/customer-balance/reconciliation). + #[serde(skip_serializing_if = "Option::is_none")] + pub reconciliation_mode: Option, +} +impl UpdateCashBalanceSettings { + pub fn new() -> Self { + Self::default() + } +} +/// Controls how funds transferred by the customer are applied to payment intents and invoices. +/// Valid options are `automatic`, `manual`, or `merchant_default`. +/// For more information about these reconciliation modes, see [Reconciliation](https://stripe.com/docs/payments/customer-balance/reconciliation). +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum UpdateCashBalanceSettingsReconciliationMode { + Automatic, + Manual, + MerchantDefault, +} +impl UpdateCashBalanceSettingsReconciliationMode { + pub fn as_str(self) -> &'static str { + use UpdateCashBalanceSettingsReconciliationMode::*; + match self { + Automatic => "automatic", + Manual => "manual", + MerchantDefault => "merchant_default", + } + } +} + +impl std::str::FromStr for UpdateCashBalanceSettingsReconciliationMode { + type Err = (); + fn from_str(s: &str) -> Result { + use UpdateCashBalanceSettingsReconciliationMode::*; + match s { + "automatic" => Ok(Automatic), + "manual" => Ok(Manual), + "merchant_default" => Ok(MerchantDefault), + _ => Err(()), + } + } +} +impl std::fmt::Display for UpdateCashBalanceSettingsReconciliationMode { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for UpdateCashBalanceSettingsReconciliationMode { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for UpdateCashBalanceSettingsReconciliationMode { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'a> UpdateCashBalance<'a> { + /// Changes the settings on a customer’s cash balance. + pub fn send( + &self, + client: &stripe::Client, + customer: &stripe_shared::CustomerId, + ) -> stripe::Response { + client.send_form( + &format!("/customers/{customer}/cash_balance"), + self, + http_types::Method::Post, + ) + } +} diff --git a/generated/stripe_core/src/charge/mod.rs b/generated/stripe_core/src/charge/mod.rs new file mode 100644 index 000000000..33969fd0a --- /dev/null +++ b/generated/stripe_core/src/charge/mod.rs @@ -0,0 +1,4 @@ +#[cfg(feature = "charge")] +mod requests; +#[cfg(feature = "charge")] +pub use requests::*; diff --git a/generated/stripe_core/src/charge/requests.rs b/generated/stripe_core/src/charge/requests.rs new file mode 100644 index 000000000..cf495c77b --- /dev/null +++ b/generated/stripe_core/src/charge/requests.rs @@ -0,0 +1,495 @@ +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct ListCharge<'a> { + #[serde(skip_serializing_if = "Option::is_none")] + pub created: Option, + /// Only return charges for the customer specified by this customer ID. + #[serde(skip_serializing_if = "Option::is_none")] + pub customer: Option<&'a str>, + /// A cursor for use in pagination. + /// `ending_before` is an object ID that defines your place in the list. + /// For instance, if you make a list request and receive 100 objects, starting with `obj_bar`, your subsequent call can include `ending_before=obj_bar` in order to fetch the previous page of the list. + #[serde(skip_serializing_if = "Option::is_none")] + pub ending_before: Option<&'a str>, + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, + /// A limit on the number of objects to be returned. + /// Limit can range between 1 and 100, and the default is 10. + #[serde(skip_serializing_if = "Option::is_none")] + pub limit: Option, + /// Only return charges that were created by the PaymentIntent specified by this PaymentIntent ID. + #[serde(skip_serializing_if = "Option::is_none")] + pub payment_intent: Option<&'a str>, + /// A cursor for use in pagination. + /// `starting_after` is an object ID that defines your place in the list. + /// For instance, if you make a list request and receive 100 objects, ending with `obj_foo`, your subsequent call can include `starting_after=obj_foo` in order to fetch the next page of the list. + #[serde(skip_serializing_if = "Option::is_none")] + pub starting_after: Option<&'a str>, + /// Only return charges for this transfer group. + #[serde(skip_serializing_if = "Option::is_none")] + pub transfer_group: Option<&'a str>, +} +impl<'a> ListCharge<'a> { + pub fn new() -> Self { + Self::default() + } +} +impl<'a> ListCharge<'a> { + /// Returns a list of charges you’ve previously created. + /// The charges are returned in sorted order, with the most recent charges appearing first. + pub fn send( + &self, + client: &stripe::Client, + ) -> stripe::Response> { + client.get_query("/charges", self) + } + pub fn paginate(self) -> stripe::ListPaginator> { + stripe::ListPaginator::from_list_params("/charges", self) + } +} +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct RetrieveCharge<'a> { + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, +} +impl<'a> RetrieveCharge<'a> { + pub fn new() -> Self { + Self::default() + } +} +impl<'a> RetrieveCharge<'a> { + /// Retrieves the details of a charge that has previously been created. + /// Supply the unique charge ID that was returned from your previous request, and Stripe will return the corresponding charge information. + /// The same information is returned when creating or refunding the charge. + pub fn send( + &self, + client: &stripe::Client, + charge: &stripe_shared::ChargeId, + ) -> stripe::Response { + client.get_query(&format!("/charges/{charge}"), self) + } +} +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct SearchCharge<'a> { + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, + /// A limit on the number of objects to be returned. + /// Limit can range between 1 and 100, and the default is 10. + #[serde(skip_serializing_if = "Option::is_none")] + pub limit: Option, + /// A cursor for pagination across multiple pages of results. + /// Don't include this parameter on the first call. + /// Use the next_page value returned in a previous response to request subsequent results. + #[serde(skip_serializing_if = "Option::is_none")] + pub page: Option<&'a str>, + /// The search query string. + /// See [search query language](https://stripe.com/docs/search#search-query-language) and the list of supported [query fields for charges](https://stripe.com/docs/search#query-fields-for-charges). + pub query: &'a str, +} +impl<'a> SearchCharge<'a> { + pub fn new(query: &'a str) -> Self { + Self { expand: None, limit: None, page: None, query } + } +} +impl<'a> SearchCharge<'a> { + /// Search for charges you’ve previously created using Stripe’s [Search Query Language](https://stripe.com/docs/search#search-query-language). + /// Don’t use search in read-after-write flows where strict consistency is necessary. + /// Under normal operating. + /// conditions, data is searchable in less than a minute. + /// Occasionally, propagation of new or updated data can be up. + /// to an hour behind during outages. Search functionality is not available to merchants in India. + pub fn send( + &self, + client: &stripe::Client, + ) -> stripe::Response> { + client.get_query("/charges/search", self) + } + pub fn paginate( + self, + ) -> stripe::ListPaginator> { + stripe::ListPaginator::from_search_params("/charges/search", self) + } +} +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreateCharge<'a> { + /// Amount intended to be collected by this payment. + /// A positive integer representing how much to charge in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal) (e.g., 100 cents to charge $1.00 or 100 to charge ¥100, a zero-decimal currency). + /// The minimum amount is $0.50 US or [equivalent in charge currency](https://stripe.com/docs/currencies#minimum-and-maximum-charge-amounts). + /// The amount value supports up to eight digits (e.g., a value of 99999999 for a USD charge of $999,999.99). + #[serde(skip_serializing_if = "Option::is_none")] + pub amount: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub application_fee: Option, + /// A fee in cents (or local equivalent) that will be applied to the charge and transferred to the application owner's Stripe account. + /// The request must be made with an OAuth key or the `Stripe-Account` header in order to take an application fee. + /// For more information, see the application fees [documentation](https://stripe.com/docs/connect/direct-charges#collecting-fees). + #[serde(skip_serializing_if = "Option::is_none")] + pub application_fee_amount: Option, + /// Whether to immediately capture the charge. + /// Defaults to `true`. + /// When `false`, the charge issues an authorization (or pre-authorization), and will need to be [captured](https://stripe.com/docs/api#capture_charge) later. + /// Uncaptured charges expire after a set number of days (7 by default). + /// For more information, see the [authorizing charges and settling later](https://stripe.com/docs/charges/placing-a-hold) documentation. + #[serde(skip_serializing_if = "Option::is_none")] + pub capture: Option, + /// Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. + /// Must be a [supported currency](https://stripe.com/docs/currencies). + #[serde(skip_serializing_if = "Option::is_none")] + pub currency: Option, + /// The ID of an existing customer that will be charged in this request. + #[serde(skip_serializing_if = "Option::is_none")] + pub customer: Option<&'a str>, + /// An arbitrary string which you can attach to a `Charge` object. + /// It is displayed when in the web interface alongside the charge. + /// Note that if you use Stripe to send automatic email receipts to your customers, your receipt emails will include the `description` of the charge(s) that they are describing. + #[serde(skip_serializing_if = "Option::is_none")] + pub description: Option<&'a str>, + #[serde(skip_serializing_if = "Option::is_none")] + pub destination: Option>, + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, + /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. + /// This can be useful for storing additional information about the object in a structured format. + /// Individual keys can be unset by posting an empty value to them. + /// All keys can be unset by posting an empty value to `metadata`. + #[serde(skip_serializing_if = "Option::is_none")] + pub metadata: Option<&'a std::collections::HashMap>, + /// The Stripe account ID for which these funds are intended. + /// Automatically set if you use the `destination` parameter. + /// For details, see [Creating Separate Charges and Transfers](https://stripe.com/docs/connect/separate-charges-and-transfers#on-behalf-of). + #[serde(skip_serializing_if = "Option::is_none")] + pub on_behalf_of: Option<&'a str>, + /// Options to configure Radar. + /// See [Radar Session](https://stripe.com/docs/radar/radar-session) for more information. + #[serde(skip_serializing_if = "Option::is_none")] + pub radar_options: Option>, + /// The email address to which this charge's [receipt](https://stripe.com/docs/dashboard/receipts) will be sent. + /// The receipt will not be sent until the charge is paid, and no receipts will be sent for test mode charges. + /// If this charge is for a [Customer](https://stripe.com/docs/api/customers/object), the email address specified here will override the customer's email address. + /// If `receipt_email` is specified for a charge in live mode, a receipt will be sent regardless of your [email settings](https://dashboard.stripe.com/account/emails). + #[serde(skip_serializing_if = "Option::is_none")] + pub receipt_email: Option<&'a str>, + /// Shipping information for the charge. Helps prevent fraud on charges for physical goods. + #[serde(skip_serializing_if = "Option::is_none")] + pub shipping: Option>, + /// A payment source to be charged. + /// This can be the ID of a [card](https://stripe.com/docs/api#cards) (i.e., credit or debit card), a [bank account](https://stripe.com/docs/api#bank_accounts), a [source](https://stripe.com/docs/api#sources), a [token](https://stripe.com/docs/api#tokens), or a [connected account](https://stripe.com/docs/connect/account-debits#charging-a-connected-account). + /// For certain sources---namely, [cards](https://stripe.com/docs/api#cards), [bank accounts](https://stripe.com/docs/api#bank_accounts), and attached [sources](https://stripe.com/docs/api#sources)---you must also pass the ID of the associated customer. + #[serde(skip_serializing_if = "Option::is_none")] + pub source: Option<&'a str>, + /// For card charges, use `statement_descriptor_suffix` instead. + /// Otherwise, you can use this value as the complete description of a charge on your customers’ statements. + /// Must contain at least one letter, maximum 22 characters. + #[serde(skip_serializing_if = "Option::is_none")] + pub statement_descriptor: Option<&'a str>, + /// Provides information about the charge that customers see on their statements. + /// Concatenated with the prefix (shortened descriptor) or statement descriptor that’s set on the account to form the complete statement descriptor. + /// Maximum 22 characters for the concatenated descriptor. + #[serde(skip_serializing_if = "Option::is_none")] + pub statement_descriptor_suffix: Option<&'a str>, + /// An optional dictionary including the account to automatically transfer to as part of a destination charge. + /// [See the Connect documentation](https://stripe.com/docs/connect/destination-charges) for details. + #[serde(skip_serializing_if = "Option::is_none")] + pub transfer_data: Option>, + /// A string that identifies this transaction as part of a group. + /// For details, see [Grouping transactions](https://stripe.com/docs/connect/separate-charges-and-transfers#transfer-options). + #[serde(skip_serializing_if = "Option::is_none")] + pub transfer_group: Option<&'a str>, +} +impl<'a> CreateCharge<'a> { + pub fn new() -> Self { + Self::default() + } +} +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreateChargeDestination<'a> { + /// ID of an existing, connected Stripe account. + pub account: &'a str, + /// The amount to transfer to the destination account without creating an `Application Fee` object. + /// Cannot be combined with the `application_fee` parameter. + /// Must be less than or equal to the charge amount. + #[serde(skip_serializing_if = "Option::is_none")] + pub amount: Option, +} +impl<'a> CreateChargeDestination<'a> { + pub fn new(account: &'a str) -> Self { + Self { account, amount: None } + } +} +/// Options to configure Radar. +/// See [Radar Session](https://stripe.com/docs/radar/radar-session) for more information. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreateChargeRadarOptions<'a> { + /// A [Radar Session](https://stripe.com/docs/radar/radar-session) is a snapshot of the browser metadata and device details that help Radar make more accurate predictions on your payments. + #[serde(skip_serializing_if = "Option::is_none")] + pub session: Option<&'a str>, +} +impl<'a> CreateChargeRadarOptions<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// An optional dictionary including the account to automatically transfer to as part of a destination charge. +/// [See the Connect documentation](https://stripe.com/docs/connect/destination-charges) for details. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreateChargeTransferData<'a> { + /// The amount transferred to the destination account, if specified. + /// By default, the entire charge amount is transferred to the destination account. + #[serde(skip_serializing_if = "Option::is_none")] + pub amount: Option, + /// ID of an existing, connected Stripe account. + pub destination: &'a str, +} +impl<'a> CreateChargeTransferData<'a> { + pub fn new(destination: &'a str) -> Self { + Self { amount: None, destination } + } +} +impl<'a> CreateCharge<'a> { + /// This method is no longer recommended—use the [Payment Intents API](https://stripe.com/docs/api/payment_intents). + /// to initiate a new payment instead. Confirmation of the PaymentIntent creates the `Charge` + /// object used to request payment. + pub fn send(&self, client: &stripe::Client) -> stripe::Response { + client.send_form("/charges", self, http_types::Method::Post) + } +} +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdateCharge<'a> { + /// The ID of an existing customer that will be associated with this request. + /// This field may only be updated if there is no existing associated customer with this charge. + #[serde(skip_serializing_if = "Option::is_none")] + pub customer: Option<&'a str>, + /// An arbitrary string which you can attach to a charge object. + /// It is displayed when in the web interface alongside the charge. + /// Note that if you use Stripe to send automatic email receipts to your customers, your receipt emails will include the `description` of the charge(s) that they are describing. + #[serde(skip_serializing_if = "Option::is_none")] + pub description: Option<&'a str>, + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, + /// A set of key-value pairs you can attach to a charge giving information about its riskiness. + /// If you believe a charge is fraudulent, include a `user_report` key with a value of `fraudulent`. + /// If you believe a charge is safe, include a `user_report` key with a value of `safe`. + /// Stripe will use the information you send to improve our fraud detection algorithms. + #[serde(skip_serializing_if = "Option::is_none")] + pub fraud_details: Option, + /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. + /// This can be useful for storing additional information about the object in a structured format. + /// Individual keys can be unset by posting an empty value to them. + /// All keys can be unset by posting an empty value to `metadata`. + #[serde(skip_serializing_if = "Option::is_none")] + pub metadata: Option<&'a std::collections::HashMap>, + /// This is the email address that the receipt for this charge will be sent to. + /// If this field is updated, then a new email receipt will be sent to the updated address. + #[serde(skip_serializing_if = "Option::is_none")] + pub receipt_email: Option<&'a str>, + /// Shipping information for the charge. Helps prevent fraud on charges for physical goods. + #[serde(skip_serializing_if = "Option::is_none")] + pub shipping: Option>, + /// A string that identifies this transaction as part of a group. + /// `transfer_group` may only be provided if it has not been set. + /// See the [Connect documentation](https://stripe.com/docs/connect/separate-charges-and-transfers#transfer-options) for details. + #[serde(skip_serializing_if = "Option::is_none")] + pub transfer_group: Option<&'a str>, +} +impl<'a> UpdateCharge<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// A set of key-value pairs you can attach to a charge giving information about its riskiness. +/// If you believe a charge is fraudulent, include a `user_report` key with a value of `fraudulent`. +/// If you believe a charge is safe, include a `user_report` key with a value of `safe`. +/// Stripe will use the information you send to improve our fraud detection algorithms. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct UpdateChargeFraudDetails { + /// Either `safe` or `fraudulent`. + pub user_report: UpdateChargeFraudDetailsUserReport, +} +impl UpdateChargeFraudDetails { + pub fn new(user_report: UpdateChargeFraudDetailsUserReport) -> Self { + Self { user_report } + } +} +/// Either `safe` or `fraudulent`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum UpdateChargeFraudDetailsUserReport { + Fraudulent, + Safe, +} +impl UpdateChargeFraudDetailsUserReport { + pub fn as_str(self) -> &'static str { + use UpdateChargeFraudDetailsUserReport::*; + match self { + Fraudulent => "fraudulent", + Safe => "safe", + } + } +} + +impl std::str::FromStr for UpdateChargeFraudDetailsUserReport { + type Err = (); + fn from_str(s: &str) -> Result { + use UpdateChargeFraudDetailsUserReport::*; + match s { + "fraudulent" => Ok(Fraudulent), + "safe" => Ok(Safe), + _ => Err(()), + } + } +} +impl std::fmt::Display for UpdateChargeFraudDetailsUserReport { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for UpdateChargeFraudDetailsUserReport { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for UpdateChargeFraudDetailsUserReport { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'a> UpdateCharge<'a> { + /// Updates the specified charge by setting the values of the parameters passed. + /// Any parameters not provided will be left unchanged. + pub fn send( + &self, + client: &stripe::Client, + charge: &stripe_shared::ChargeId, + ) -> stripe::Response { + client.send_form(&format!("/charges/{charge}"), self, http_types::Method::Post) + } +} +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CaptureCharge<'a> { + /// The amount to capture, which must be less than or equal to the original amount. + /// Any additional amount will be automatically refunded. + #[serde(skip_serializing_if = "Option::is_none")] + pub amount: Option, + /// An application fee to add on to this charge. + #[serde(skip_serializing_if = "Option::is_none")] + pub application_fee: Option, + /// An application fee amount to add on to this charge, which must be less than or equal to the original amount. + #[serde(skip_serializing_if = "Option::is_none")] + pub application_fee_amount: Option, + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, + /// The email address to send this charge's receipt to. + /// This will override the previously-specified email address for this charge, if one was set. + /// Receipts will not be sent in test mode. + #[serde(skip_serializing_if = "Option::is_none")] + pub receipt_email: Option<&'a str>, + /// For card charges, use `statement_descriptor_suffix` instead. + /// Otherwise, you can use this value as the complete description of a charge on your customers’ statements. + /// Must contain at least one letter, maximum 22 characters. + #[serde(skip_serializing_if = "Option::is_none")] + pub statement_descriptor: Option<&'a str>, + /// Provides information about the charge that customers see on their statements. + /// Concatenated with the prefix (shortened descriptor) or statement descriptor that’s set on the account to form the complete statement descriptor. + /// Maximum 22 characters for the concatenated descriptor. + #[serde(skip_serializing_if = "Option::is_none")] + pub statement_descriptor_suffix: Option<&'a str>, + /// An optional dictionary including the account to automatically transfer to as part of a destination charge. + /// [See the Connect documentation](https://stripe.com/docs/connect/destination-charges) for details. + #[serde(skip_serializing_if = "Option::is_none")] + pub transfer_data: Option, + /// A string that identifies this transaction as part of a group. + /// `transfer_group` may only be provided if it has not been set. + /// See the [Connect documentation](https://stripe.com/docs/connect/separate-charges-and-transfers#transfer-options) for details. + #[serde(skip_serializing_if = "Option::is_none")] + pub transfer_group: Option<&'a str>, +} +impl<'a> CaptureCharge<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// An optional dictionary including the account to automatically transfer to as part of a destination charge. +/// [See the Connect documentation](https://stripe.com/docs/connect/destination-charges) for details. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CaptureChargeTransferData { + /// The amount transferred to the destination account, if specified. + /// By default, the entire charge amount is transferred to the destination account. + #[serde(skip_serializing_if = "Option::is_none")] + pub amount: Option, +} +impl CaptureChargeTransferData { + pub fn new() -> Self { + Self::default() + } +} +impl<'a> CaptureCharge<'a> { + /// Capture the payment of an existing, uncaptured charge that was created with the `capture` option set to false. + /// + /// Uncaptured payments expire a set number of days after they are created ([7 by default](https://stripe.com/docs/charges/placing-a-hold)), after which they are marked as refunded and capture attempts will fail. + /// + /// Don’t use this method to capture a PaymentIntent-initiated charge. + /// Use [Capture a PaymentIntent](https://stripe.com/docs/api/payment_intents/capture). + pub fn send( + &self, + client: &stripe::Client, + charge: &stripe_shared::ChargeId, + ) -> stripe::Response { + client.send_form(&format!("/charges/{charge}/capture"), self, http_types::Method::Post) + } +} +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct OptionalFieldsAddress<'a> { + /// City, district, suburb, town, or village. + #[serde(skip_serializing_if = "Option::is_none")] + pub city: Option<&'a str>, + /// Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). + #[serde(skip_serializing_if = "Option::is_none")] + pub country: Option<&'a str>, + /// Address line 1 (e.g., street, PO Box, or company name). + #[serde(skip_serializing_if = "Option::is_none")] + pub line1: Option<&'a str>, + /// Address line 2 (e.g., apartment, suite, unit, or building). + #[serde(skip_serializing_if = "Option::is_none")] + pub line2: Option<&'a str>, + /// ZIP or postal code. + #[serde(skip_serializing_if = "Option::is_none")] + pub postal_code: Option<&'a str>, + /// State, county, province, or region. + #[serde(skip_serializing_if = "Option::is_none")] + pub state: Option<&'a str>, +} +impl<'a> OptionalFieldsAddress<'a> { + pub fn new() -> Self { + Self::default() + } +} +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct OptionalFieldsShipping<'a> { + /// Shipping address. + pub address: OptionalFieldsAddress<'a>, + /// The delivery service that shipped a physical product, such as Fedex, UPS, USPS, etc. + #[serde(skip_serializing_if = "Option::is_none")] + pub carrier: Option<&'a str>, + /// Recipient name. + pub name: &'a str, + /// Recipient phone (including extension). + #[serde(skip_serializing_if = "Option::is_none")] + pub phone: Option<&'a str>, + /// The tracking number for a physical product, obtained from the delivery service. + /// If multiple tracking numbers were generated for this purchase, please separate them with commas. + #[serde(skip_serializing_if = "Option::is_none")] + pub tracking_number: Option<&'a str>, +} +impl<'a> OptionalFieldsShipping<'a> { + pub fn new(address: OptionalFieldsAddress<'a>, name: &'a str) -> Self { + Self { address, carrier: None, name, phone: None, tracking_number: None } + } +} diff --git a/generated/stripe_core/src/customer/mod.rs b/generated/stripe_core/src/customer/mod.rs new file mode 100644 index 000000000..5e6dc745b --- /dev/null +++ b/generated/stripe_core/src/customer/mod.rs @@ -0,0 +1,4 @@ +#[cfg(feature = "customer")] +mod requests; +#[cfg(feature = "customer")] +pub use requests::*; diff --git a/generated/stripe_core/src/customer/requests.rs b/generated/stripe_core/src/customer/requests.rs new file mode 100644 index 000000000..f6917085a --- /dev/null +++ b/generated/stripe_core/src/customer/requests.rs @@ -0,0 +1,1639 @@ +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct DeleteCustomer {} +impl DeleteCustomer { + pub fn new() -> Self { + Self::default() + } +} +impl DeleteCustomer { + /// Permanently deletes a customer. + /// It cannot be undone. + /// Also immediately cancels any active subscriptions on the customer. + pub fn send( + &self, + client: &stripe::Client, + customer: &stripe_shared::CustomerId, + ) -> stripe::Response { + client.send_form(&format!("/customers/{customer}"), self, http_types::Method::Delete) + } +} +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct DeleteDiscountCustomer {} +impl DeleteDiscountCustomer { + pub fn new() -> Self { + Self::default() + } +} +impl DeleteDiscountCustomer { + /// Removes the currently applied discount on a customer. + pub fn send( + &self, + client: &stripe::Client, + customer: &stripe_shared::CustomerId, + ) -> stripe::Response { + client.send_form( + &format!("/customers/{customer}/discount"), + self, + http_types::Method::Delete, + ) + } +} +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct ListCustomer<'a> { + #[serde(skip_serializing_if = "Option::is_none")] + pub created: Option, + /// A case-sensitive filter on the list based on the customer's `email` field. + /// The value must be a string. + #[serde(skip_serializing_if = "Option::is_none")] + pub email: Option<&'a str>, + /// A cursor for use in pagination. + /// `ending_before` is an object ID that defines your place in the list. + /// For instance, if you make a list request and receive 100 objects, starting with `obj_bar`, your subsequent call can include `ending_before=obj_bar` in order to fetch the previous page of the list. + #[serde(skip_serializing_if = "Option::is_none")] + pub ending_before: Option<&'a str>, + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, + /// A limit on the number of objects to be returned. + /// Limit can range between 1 and 100, and the default is 10. + #[serde(skip_serializing_if = "Option::is_none")] + pub limit: Option, + /// A cursor for use in pagination. + /// `starting_after` is an object ID that defines your place in the list. + /// For instance, if you make a list request and receive 100 objects, ending with `obj_foo`, your subsequent call can include `starting_after=obj_foo` in order to fetch the next page of the list. + #[serde(skip_serializing_if = "Option::is_none")] + pub starting_after: Option<&'a str>, + /// Provides a list of customers that are associated with the specified test clock. + /// The response will not include customers with test clocks if this parameter is not set. + #[serde(skip_serializing_if = "Option::is_none")] + pub test_clock: Option<&'a str>, +} +impl<'a> ListCustomer<'a> { + pub fn new() -> Self { + Self::default() + } +} +impl<'a> ListCustomer<'a> { + /// Returns a list of your customers. + /// The customers are returned sorted by creation date, with the most recent customers appearing first. + pub fn send( + &self, + client: &stripe::Client, + ) -> stripe::Response> { + client.get_query("/customers", self) + } + pub fn paginate(self) -> stripe::ListPaginator> { + stripe::ListPaginator::from_list_params("/customers", self) + } +} +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct RetrieveCustomer<'a> { + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, +} +impl<'a> RetrieveCustomer<'a> { + pub fn new() -> Self { + Self::default() + } +} +impl<'a> RetrieveCustomer<'a> { + /// Retrieves a Customer object. + pub fn send( + &self, + client: &stripe::Client, + customer: &stripe_shared::CustomerId, + ) -> stripe::Response { + client.get_query(&format!("/customers/{customer}"), self) + } +} +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +#[serde(untagged)] +pub enum RetrieveCustomerReturned { + Customer(stripe_shared::Customer), + DeletedCustomer(stripe_shared::DeletedCustomer), +} +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct BalanceTransactionsCustomer<'a> { + /// A cursor for use in pagination. + /// `ending_before` is an object ID that defines your place in the list. + /// For instance, if you make a list request and receive 100 objects, starting with `obj_bar`, your subsequent call can include `ending_before=obj_bar` in order to fetch the previous page of the list. + #[serde(skip_serializing_if = "Option::is_none")] + pub ending_before: Option<&'a str>, + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, + /// A limit on the number of objects to be returned. + /// Limit can range between 1 and 100, and the default is 10. + #[serde(skip_serializing_if = "Option::is_none")] + pub limit: Option, + /// A cursor for use in pagination. + /// `starting_after` is an object ID that defines your place in the list. + /// For instance, if you make a list request and receive 100 objects, ending with `obj_foo`, your subsequent call can include `starting_after=obj_foo` in order to fetch the next page of the list. + #[serde(skip_serializing_if = "Option::is_none")] + pub starting_after: Option<&'a str>, +} +impl<'a> BalanceTransactionsCustomer<'a> { + pub fn new() -> Self { + Self::default() + } +} +impl<'a> BalanceTransactionsCustomer<'a> { + /// Returns a list of transactions that updated the customer’s [balances](https://stripe.com/docs/billing/customer/balance). + pub fn send( + &self, + client: &stripe::Client, + customer: &stripe_shared::CustomerId, + ) -> stripe::Response> { + client.get_query(&format!("/customers/{customer}/balance_transactions"), self) + } + pub fn paginate( + self, + customer: &stripe_shared::CustomerId, + ) -> stripe::ListPaginator> { + stripe::ListPaginator::from_list_params( + &format!("/customers/{customer}/balance_transactions"), + self, + ) + } +} +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct ListPaymentMethodsCustomer<'a> { + /// A cursor for use in pagination. + /// `ending_before` is an object ID that defines your place in the list. + /// For instance, if you make a list request and receive 100 objects, starting with `obj_bar`, your subsequent call can include `ending_before=obj_bar` in order to fetch the previous page of the list. + #[serde(skip_serializing_if = "Option::is_none")] + pub ending_before: Option<&'a str>, + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, + /// A limit on the number of objects to be returned. + /// Limit can range between 1 and 100, and the default is 10. + #[serde(skip_serializing_if = "Option::is_none")] + pub limit: Option, + /// A cursor for use in pagination. + /// `starting_after` is an object ID that defines your place in the list. + /// For instance, if you make a list request and receive 100 objects, ending with `obj_foo`, your subsequent call can include `starting_after=obj_foo` in order to fetch the next page of the list. + #[serde(skip_serializing_if = "Option::is_none")] + pub starting_after: Option<&'a str>, + /// An optional filter on the list, based on the object `type` field. + /// Without the filter, the list includes all current and future payment method types. + /// If your integration expects only one type of payment method in the response, make sure to provide a type value in the request. + #[serde(rename = "type")] + #[serde(skip_serializing_if = "Option::is_none")] + pub type_: Option, +} +impl<'a> ListPaymentMethodsCustomer<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// An optional filter on the list, based on the object `type` field. +/// Without the filter, the list includes all current and future payment method types. +/// If your integration expects only one type of payment method in the response, make sure to provide a type value in the request. +#[derive(Copy, Clone, Eq, PartialEq)] +#[non_exhaustive] +pub enum ListPaymentMethodsCustomerType { + AcssDebit, + Affirm, + AfterpayClearpay, + Alipay, + AuBecsDebit, + BacsDebit, + Bancontact, + Blik, + Boleto, + Card, + Cashapp, + CustomerBalance, + Eps, + Fpx, + Giropay, + Grabpay, + Ideal, + Klarna, + Konbini, + Link, + Oxxo, + P24, + Paynow, + Paypal, + Pix, + Promptpay, + RevolutPay, + SepaDebit, + Sofort, + Swish, + UsBankAccount, + WechatPay, + Zip, + /// An unrecognized value from Stripe. Should not be used as a request parameter. + Unknown, +} +impl ListPaymentMethodsCustomerType { + pub fn as_str(self) -> &'static str { + use ListPaymentMethodsCustomerType::*; + match self { + AcssDebit => "acss_debit", + Affirm => "affirm", + AfterpayClearpay => "afterpay_clearpay", + Alipay => "alipay", + AuBecsDebit => "au_becs_debit", + BacsDebit => "bacs_debit", + Bancontact => "bancontact", + Blik => "blik", + Boleto => "boleto", + Card => "card", + Cashapp => "cashapp", + CustomerBalance => "customer_balance", + Eps => "eps", + Fpx => "fpx", + Giropay => "giropay", + Grabpay => "grabpay", + Ideal => "ideal", + Klarna => "klarna", + Konbini => "konbini", + Link => "link", + Oxxo => "oxxo", + P24 => "p24", + Paynow => "paynow", + Paypal => "paypal", + Pix => "pix", + Promptpay => "promptpay", + RevolutPay => "revolut_pay", + SepaDebit => "sepa_debit", + Sofort => "sofort", + Swish => "swish", + UsBankAccount => "us_bank_account", + WechatPay => "wechat_pay", + Zip => "zip", + Unknown => "unknown", + } + } +} + +impl std::str::FromStr for ListPaymentMethodsCustomerType { + type Err = (); + fn from_str(s: &str) -> Result { + use ListPaymentMethodsCustomerType::*; + match s { + "acss_debit" => Ok(AcssDebit), + "affirm" => Ok(Affirm), + "afterpay_clearpay" => Ok(AfterpayClearpay), + "alipay" => Ok(Alipay), + "au_becs_debit" => Ok(AuBecsDebit), + "bacs_debit" => Ok(BacsDebit), + "bancontact" => Ok(Bancontact), + "blik" => Ok(Blik), + "boleto" => Ok(Boleto), + "card" => Ok(Card), + "cashapp" => Ok(Cashapp), + "customer_balance" => Ok(CustomerBalance), + "eps" => Ok(Eps), + "fpx" => Ok(Fpx), + "giropay" => Ok(Giropay), + "grabpay" => Ok(Grabpay), + "ideal" => Ok(Ideal), + "klarna" => Ok(Klarna), + "konbini" => Ok(Konbini), + "link" => Ok(Link), + "oxxo" => Ok(Oxxo), + "p24" => Ok(P24), + "paynow" => Ok(Paynow), + "paypal" => Ok(Paypal), + "pix" => Ok(Pix), + "promptpay" => Ok(Promptpay), + "revolut_pay" => Ok(RevolutPay), + "sepa_debit" => Ok(SepaDebit), + "sofort" => Ok(Sofort), + "swish" => Ok(Swish), + "us_bank_account" => Ok(UsBankAccount), + "wechat_pay" => Ok(WechatPay), + "zip" => Ok(Zip), + _ => Err(()), + } + } +} +impl std::fmt::Display for ListPaymentMethodsCustomerType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for ListPaymentMethodsCustomerType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for ListPaymentMethodsCustomerType { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'a> ListPaymentMethodsCustomer<'a> { + /// Returns a list of PaymentMethods for a given Customer + pub fn send( + &self, + client: &stripe::Client, + customer: &stripe_shared::CustomerId, + ) -> stripe::Response> { + client.get_query(&format!("/customers/{customer}/payment_methods"), self) + } + pub fn paginate( + self, + customer: &stripe_shared::CustomerId, + ) -> stripe::ListPaginator> { + stripe::ListPaginator::from_list_params( + &format!("/customers/{customer}/payment_methods"), + self, + ) + } +} +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct RetrievePaymentMethodCustomer<'a> { + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, +} +impl<'a> RetrievePaymentMethodCustomer<'a> { + pub fn new() -> Self { + Self::default() + } +} +impl<'a> RetrievePaymentMethodCustomer<'a> { + /// Retrieves a PaymentMethod object for a given Customer. + pub fn send( + &self, + client: &stripe::Client, + customer: &stripe_shared::CustomerId, + payment_method: &str, + ) -> stripe::Response { + client.get_query(&format!("/customers/{customer}/payment_methods/{payment_method}"), self) + } +} +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct SearchCustomer<'a> { + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, + /// A limit on the number of objects to be returned. + /// Limit can range between 1 and 100, and the default is 10. + #[serde(skip_serializing_if = "Option::is_none")] + pub limit: Option, + /// A cursor for pagination across multiple pages of results. + /// Don't include this parameter on the first call. + /// Use the next_page value returned in a previous response to request subsequent results. + #[serde(skip_serializing_if = "Option::is_none")] + pub page: Option<&'a str>, + /// The search query string. + /// See [search query language](https://stripe.com/docs/search#search-query-language) and the list of supported [query fields for customers](https://stripe.com/docs/search#query-fields-for-customers). + pub query: &'a str, +} +impl<'a> SearchCustomer<'a> { + pub fn new(query: &'a str) -> Self { + Self { expand: None, limit: None, page: None, query } + } +} +impl<'a> SearchCustomer<'a> { + /// Search for customers you’ve previously created using Stripe’s [Search Query Language](https://stripe.com/docs/search#search-query-language). + /// Don’t use search in read-after-write flows where strict consistency is necessary. + /// Under normal operating. + /// conditions, data is searchable in less than a minute. + /// Occasionally, propagation of new or updated data can be up. + /// to an hour behind during outages. Search functionality is not available to merchants in India. + pub fn send( + &self, + client: &stripe::Client, + ) -> stripe::Response> { + client.get_query("/customers/search", self) + } + pub fn paginate( + self, + ) -> stripe::ListPaginator> { + stripe::ListPaginator::from_search_params("/customers/search", self) + } +} +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreateCustomer<'a> { + /// The customer's address. + #[serde(skip_serializing_if = "Option::is_none")] + pub address: Option>, + /// An integer amount in cents (or local equivalent) that represents the customer's current balance, which affect the customer's future invoices. + /// A negative amount represents a credit that decreases the amount due on an invoice; a positive amount increases the amount due on an invoice. + #[serde(skip_serializing_if = "Option::is_none")] + pub balance: Option, + /// Balance information and default balance settings for this customer. + #[serde(skip_serializing_if = "Option::is_none")] + pub cash_balance: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub coupon: Option<&'a str>, + /// An arbitrary string that you can attach to a customer object. + /// It is displayed alongside the customer in the dashboard. + #[serde(skip_serializing_if = "Option::is_none")] + pub description: Option<&'a str>, + /// Customer's email address. + /// It's displayed alongside the customer in your dashboard and can be useful for searching and tracking. + /// This may be up to *512 characters*. + #[serde(skip_serializing_if = "Option::is_none")] + pub email: Option<&'a str>, + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, + /// The prefix for the customer used to generate unique invoice numbers. + /// Must be 3–12 uppercase letters or numbers. + #[serde(skip_serializing_if = "Option::is_none")] + pub invoice_prefix: Option<&'a str>, + /// Default invoice settings for this customer. + #[serde(skip_serializing_if = "Option::is_none")] + pub invoice_settings: Option>, + /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. + /// This can be useful for storing additional information about the object in a structured format. + /// Individual keys can be unset by posting an empty value to them. + /// All keys can be unset by posting an empty value to `metadata`. + #[serde(skip_serializing_if = "Option::is_none")] + pub metadata: Option<&'a std::collections::HashMap>, + /// The customer's full name or business name. + #[serde(skip_serializing_if = "Option::is_none")] + pub name: Option<&'a str>, + /// The sequence to be used on the customer's next invoice. Defaults to 1. + #[serde(skip_serializing_if = "Option::is_none")] + pub next_invoice_sequence: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub payment_method: Option<&'a str>, + /// The customer's phone number. + #[serde(skip_serializing_if = "Option::is_none")] + pub phone: Option<&'a str>, + /// Customer's preferred languages, ordered by preference. + #[serde(skip_serializing_if = "Option::is_none")] + pub preferred_locales: Option<&'a [&'a str]>, + /// The API ID of a promotion code to apply to the customer. + /// The customer will have a discount applied on all recurring payments. + /// Charges you create through the API will not have the discount. + #[serde(skip_serializing_if = "Option::is_none")] + pub promotion_code: Option<&'a str>, + /// The customer's shipping information. Appears on invoices emailed to this customer. + #[serde(skip_serializing_if = "Option::is_none")] + pub shipping: Option>, + #[serde(skip_serializing_if = "Option::is_none")] + pub source: Option<&'a str>, + /// Tax details about the customer. + #[serde(skip_serializing_if = "Option::is_none")] + pub tax: Option>, + /// The customer's tax exemption. One of `none`, `exempt`, or `reverse`. + #[serde(skip_serializing_if = "Option::is_none")] + pub tax_exempt: Option, + /// The customer's tax IDs. + #[serde(skip_serializing_if = "Option::is_none")] + pub tax_id_data: Option<&'a [CreateCustomerTaxIdData<'a>]>, + /// ID of the test clock to attach to the customer. + #[serde(skip_serializing_if = "Option::is_none")] + pub test_clock: Option<&'a str>, + #[serde(skip_serializing_if = "Option::is_none")] + pub validate: Option, +} +impl<'a> CreateCustomer<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// Balance information and default balance settings for this customer. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreateCustomerCashBalance { + /// Settings controlling the behavior of the customer's cash balance, + /// such as reconciliation of funds received. + #[serde(skip_serializing_if = "Option::is_none")] + pub settings: Option, +} +impl CreateCustomerCashBalance { + pub fn new() -> Self { + Self::default() + } +} +/// Settings controlling the behavior of the customer's cash balance, +/// such as reconciliation of funds received. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreateCustomerCashBalanceSettings { + /// Controls how funds transferred by the customer are applied to payment intents and invoices. + /// Valid options are `automatic`, `manual`, or `merchant_default`. + /// For more information about these reconciliation modes, see [Reconciliation](https://stripe.com/docs/payments/customer-balance/reconciliation). + #[serde(skip_serializing_if = "Option::is_none")] + pub reconciliation_mode: Option, +} +impl CreateCustomerCashBalanceSettings { + pub fn new() -> Self { + Self::default() + } +} +/// Controls how funds transferred by the customer are applied to payment intents and invoices. +/// Valid options are `automatic`, `manual`, or `merchant_default`. +/// For more information about these reconciliation modes, see [Reconciliation](https://stripe.com/docs/payments/customer-balance/reconciliation). +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreateCustomerCashBalanceSettingsReconciliationMode { + Automatic, + Manual, + MerchantDefault, +} +impl CreateCustomerCashBalanceSettingsReconciliationMode { + pub fn as_str(self) -> &'static str { + use CreateCustomerCashBalanceSettingsReconciliationMode::*; + match self { + Automatic => "automatic", + Manual => "manual", + MerchantDefault => "merchant_default", + } + } +} + +impl std::str::FromStr for CreateCustomerCashBalanceSettingsReconciliationMode { + type Err = (); + fn from_str(s: &str) -> Result { + use CreateCustomerCashBalanceSettingsReconciliationMode::*; + match s { + "automatic" => Ok(Automatic), + "manual" => Ok(Manual), + "merchant_default" => Ok(MerchantDefault), + _ => Err(()), + } + } +} +impl std::fmt::Display for CreateCustomerCashBalanceSettingsReconciliationMode { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreateCustomerCashBalanceSettingsReconciliationMode { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreateCustomerCashBalanceSettingsReconciliationMode { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Default invoice settings for this customer. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreateCustomerInvoiceSettings<'a> { + /// The list of up to 4 default custom fields to be displayed on invoices for this customer. + /// When updating, pass an empty string to remove previously-defined fields. + #[serde(skip_serializing_if = "Option::is_none")] + pub custom_fields: Option<&'a [CustomFieldParams<'a>]>, + /// ID of a payment method that's attached to the customer, to be used as the customer's default payment method for subscriptions and invoices. + #[serde(skip_serializing_if = "Option::is_none")] + pub default_payment_method: Option<&'a str>, + /// Default footer to be displayed on invoices for this customer. + #[serde(skip_serializing_if = "Option::is_none")] + pub footer: Option<&'a str>, + /// Default options for invoice PDF rendering for this customer. + #[serde(skip_serializing_if = "Option::is_none")] + pub rendering_options: Option, +} +impl<'a> CreateCustomerInvoiceSettings<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// Default options for invoice PDF rendering for this customer. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreateCustomerInvoiceSettingsRenderingOptions { + /// How line-item prices and amounts will be displayed with respect to tax on invoice PDFs. + /// One of `exclude_tax` or `include_inclusive_tax`. + /// `include_inclusive_tax` will include inclusive tax (and exclude exclusive tax) in invoice PDF amounts. + /// `exclude_tax` will exclude all tax (inclusive and exclusive alike) from invoice PDF amounts. + #[serde(skip_serializing_if = "Option::is_none")] + pub amount_tax_display: Option, +} +impl CreateCustomerInvoiceSettingsRenderingOptions { + pub fn new() -> Self { + Self::default() + } +} +/// How line-item prices and amounts will be displayed with respect to tax on invoice PDFs. +/// One of `exclude_tax` or `include_inclusive_tax`. +/// `include_inclusive_tax` will include inclusive tax (and exclude exclusive tax) in invoice PDF amounts. +/// `exclude_tax` will exclude all tax (inclusive and exclusive alike) from invoice PDF amounts. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreateCustomerInvoiceSettingsRenderingOptionsAmountTaxDisplay { + ExcludeTax, + IncludeInclusiveTax, +} +impl CreateCustomerInvoiceSettingsRenderingOptionsAmountTaxDisplay { + pub fn as_str(self) -> &'static str { + use CreateCustomerInvoiceSettingsRenderingOptionsAmountTaxDisplay::*; + match self { + ExcludeTax => "exclude_tax", + IncludeInclusiveTax => "include_inclusive_tax", + } + } +} + +impl std::str::FromStr for CreateCustomerInvoiceSettingsRenderingOptionsAmountTaxDisplay { + type Err = (); + fn from_str(s: &str) -> Result { + use CreateCustomerInvoiceSettingsRenderingOptionsAmountTaxDisplay::*; + match s { + "exclude_tax" => Ok(ExcludeTax), + "include_inclusive_tax" => Ok(IncludeInclusiveTax), + _ => Err(()), + } + } +} +impl std::fmt::Display for CreateCustomerInvoiceSettingsRenderingOptionsAmountTaxDisplay { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreateCustomerInvoiceSettingsRenderingOptionsAmountTaxDisplay { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreateCustomerInvoiceSettingsRenderingOptionsAmountTaxDisplay { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Tax details about the customer. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreateCustomerTax<'a> { + /// A recent IP address of the customer used for tax reporting and tax location inference. + /// Stripe recommends updating the IP address when a new PaymentMethod is attached or the address field on the customer is updated. + /// We recommend against updating this field more frequently since it could result in unexpected tax location/reporting outcomes. + #[serde(skip_serializing_if = "Option::is_none")] + pub ip_address: Option<&'a str>, + /// A flag that indicates when Stripe should validate the customer tax location. + /// Defaults to `deferred`. + #[serde(skip_serializing_if = "Option::is_none")] + pub validate_location: Option, +} +impl<'a> CreateCustomerTax<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// A flag that indicates when Stripe should validate the customer tax location. +/// Defaults to `deferred`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreateCustomerTaxValidateLocation { + Deferred, + Immediately, +} +impl CreateCustomerTaxValidateLocation { + pub fn as_str(self) -> &'static str { + use CreateCustomerTaxValidateLocation::*; + match self { + Deferred => "deferred", + Immediately => "immediately", + } + } +} + +impl std::str::FromStr for CreateCustomerTaxValidateLocation { + type Err = (); + fn from_str(s: &str) -> Result { + use CreateCustomerTaxValidateLocation::*; + match s { + "deferred" => Ok(Deferred), + "immediately" => Ok(Immediately), + _ => Err(()), + } + } +} +impl std::fmt::Display for CreateCustomerTaxValidateLocation { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreateCustomerTaxValidateLocation { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreateCustomerTaxValidateLocation { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// The customer's tax IDs. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreateCustomerTaxIdData<'a> { + /// Type of the tax ID, one of `ad_nrt`, `ae_trn`, `ar_cuit`, `au_abn`, `au_arn`, `bg_uic`, `bo_tin`, `br_cnpj`, `br_cpf`, `ca_bn`, `ca_gst_hst`, `ca_pst_bc`, `ca_pst_mb`, `ca_pst_sk`, `ca_qst`, `ch_vat`, `cl_tin`, `cn_tin`, `co_nit`, `cr_tin`, `do_rcn`, `ec_ruc`, `eg_tin`, `es_cif`, `eu_oss_vat`, `eu_vat`, `gb_vat`, `ge_vat`, `hk_br`, `hu_tin`, `id_npwp`, `il_vat`, `in_gst`, `is_vat`, `jp_cn`, `jp_rn`, `jp_trn`, `ke_pin`, `kr_brn`, `li_uid`, `mx_rfc`, `my_frp`, `my_itn`, `my_sst`, `no_vat`, `nz_gst`, `pe_ruc`, `ph_tin`, `ro_tin`, `rs_pib`, `ru_inn`, `ru_kpp`, `sa_vat`, `sg_gst`, `sg_uen`, `si_tin`, `sv_nit`, `th_vat`, `tr_tin`, `tw_vat`, `ua_vat`, `us_ein`, `uy_ruc`, `ve_rif`, `vn_tin`, or `za_vat`. + #[serde(rename = "type")] + pub type_: CreateCustomerTaxIdDataType, + /// Value of the tax ID. + pub value: &'a str, +} +impl<'a> CreateCustomerTaxIdData<'a> { + pub fn new(type_: CreateCustomerTaxIdDataType, value: &'a str) -> Self { + Self { type_, value } + } +} +/// Type of the tax ID, one of `ad_nrt`, `ae_trn`, `ar_cuit`, `au_abn`, `au_arn`, `bg_uic`, `bo_tin`, `br_cnpj`, `br_cpf`, `ca_bn`, `ca_gst_hst`, `ca_pst_bc`, `ca_pst_mb`, `ca_pst_sk`, `ca_qst`, `ch_vat`, `cl_tin`, `cn_tin`, `co_nit`, `cr_tin`, `do_rcn`, `ec_ruc`, `eg_tin`, `es_cif`, `eu_oss_vat`, `eu_vat`, `gb_vat`, `ge_vat`, `hk_br`, `hu_tin`, `id_npwp`, `il_vat`, `in_gst`, `is_vat`, `jp_cn`, `jp_rn`, `jp_trn`, `ke_pin`, `kr_brn`, `li_uid`, `mx_rfc`, `my_frp`, `my_itn`, `my_sst`, `no_vat`, `nz_gst`, `pe_ruc`, `ph_tin`, `ro_tin`, `rs_pib`, `ru_inn`, `ru_kpp`, `sa_vat`, `sg_gst`, `sg_uen`, `si_tin`, `sv_nit`, `th_vat`, `tr_tin`, `tw_vat`, `ua_vat`, `us_ein`, `uy_ruc`, `ve_rif`, `vn_tin`, or `za_vat`. +#[derive(Copy, Clone, Eq, PartialEq)] +#[non_exhaustive] +pub enum CreateCustomerTaxIdDataType { + AdNrt, + AeTrn, + ArCuit, + AuAbn, + AuArn, + BgUic, + BoTin, + BrCnpj, + BrCpf, + CaBn, + CaGstHst, + CaPstBc, + CaPstMb, + CaPstSk, + CaQst, + ChVat, + ClTin, + CnTin, + CoNit, + CrTin, + DoRcn, + EcRuc, + EgTin, + EsCif, + EuOssVat, + EuVat, + GbVat, + GeVat, + HkBr, + HuTin, + IdNpwp, + IlVat, + InGst, + IsVat, + JpCn, + JpRn, + JpTrn, + KePin, + KrBrn, + LiUid, + MxRfc, + MyFrp, + MyItn, + MySst, + NoVat, + NzGst, + PeRuc, + PhTin, + RoTin, + RsPib, + RuInn, + RuKpp, + SaVat, + SgGst, + SgUen, + SiTin, + SvNit, + ThVat, + TrTin, + TwVat, + UaVat, + UsEin, + UyRuc, + VeRif, + VnTin, + ZaVat, + /// An unrecognized value from Stripe. Should not be used as a request parameter. + Unknown, +} +impl CreateCustomerTaxIdDataType { + pub fn as_str(self) -> &'static str { + use CreateCustomerTaxIdDataType::*; + match self { + AdNrt => "ad_nrt", + AeTrn => "ae_trn", + ArCuit => "ar_cuit", + AuAbn => "au_abn", + AuArn => "au_arn", + BgUic => "bg_uic", + BoTin => "bo_tin", + BrCnpj => "br_cnpj", + BrCpf => "br_cpf", + CaBn => "ca_bn", + CaGstHst => "ca_gst_hst", + CaPstBc => "ca_pst_bc", + CaPstMb => "ca_pst_mb", + CaPstSk => "ca_pst_sk", + CaQst => "ca_qst", + ChVat => "ch_vat", + ClTin => "cl_tin", + CnTin => "cn_tin", + CoNit => "co_nit", + CrTin => "cr_tin", + DoRcn => "do_rcn", + EcRuc => "ec_ruc", + EgTin => "eg_tin", + EsCif => "es_cif", + EuOssVat => "eu_oss_vat", + EuVat => "eu_vat", + GbVat => "gb_vat", + GeVat => "ge_vat", + HkBr => "hk_br", + HuTin => "hu_tin", + IdNpwp => "id_npwp", + IlVat => "il_vat", + InGst => "in_gst", + IsVat => "is_vat", + JpCn => "jp_cn", + JpRn => "jp_rn", + JpTrn => "jp_trn", + KePin => "ke_pin", + KrBrn => "kr_brn", + LiUid => "li_uid", + MxRfc => "mx_rfc", + MyFrp => "my_frp", + MyItn => "my_itn", + MySst => "my_sst", + NoVat => "no_vat", + NzGst => "nz_gst", + PeRuc => "pe_ruc", + PhTin => "ph_tin", + RoTin => "ro_tin", + RsPib => "rs_pib", + RuInn => "ru_inn", + RuKpp => "ru_kpp", + SaVat => "sa_vat", + SgGst => "sg_gst", + SgUen => "sg_uen", + SiTin => "si_tin", + SvNit => "sv_nit", + ThVat => "th_vat", + TrTin => "tr_tin", + TwVat => "tw_vat", + UaVat => "ua_vat", + UsEin => "us_ein", + UyRuc => "uy_ruc", + VeRif => "ve_rif", + VnTin => "vn_tin", + ZaVat => "za_vat", + Unknown => "unknown", + } + } +} + +impl std::str::FromStr for CreateCustomerTaxIdDataType { + type Err = (); + fn from_str(s: &str) -> Result { + use CreateCustomerTaxIdDataType::*; + match s { + "ad_nrt" => Ok(AdNrt), + "ae_trn" => Ok(AeTrn), + "ar_cuit" => Ok(ArCuit), + "au_abn" => Ok(AuAbn), + "au_arn" => Ok(AuArn), + "bg_uic" => Ok(BgUic), + "bo_tin" => Ok(BoTin), + "br_cnpj" => Ok(BrCnpj), + "br_cpf" => Ok(BrCpf), + "ca_bn" => Ok(CaBn), + "ca_gst_hst" => Ok(CaGstHst), + "ca_pst_bc" => Ok(CaPstBc), + "ca_pst_mb" => Ok(CaPstMb), + "ca_pst_sk" => Ok(CaPstSk), + "ca_qst" => Ok(CaQst), + "ch_vat" => Ok(ChVat), + "cl_tin" => Ok(ClTin), + "cn_tin" => Ok(CnTin), + "co_nit" => Ok(CoNit), + "cr_tin" => Ok(CrTin), + "do_rcn" => Ok(DoRcn), + "ec_ruc" => Ok(EcRuc), + "eg_tin" => Ok(EgTin), + "es_cif" => Ok(EsCif), + "eu_oss_vat" => Ok(EuOssVat), + "eu_vat" => Ok(EuVat), + "gb_vat" => Ok(GbVat), + "ge_vat" => Ok(GeVat), + "hk_br" => Ok(HkBr), + "hu_tin" => Ok(HuTin), + "id_npwp" => Ok(IdNpwp), + "il_vat" => Ok(IlVat), + "in_gst" => Ok(InGst), + "is_vat" => Ok(IsVat), + "jp_cn" => Ok(JpCn), + "jp_rn" => Ok(JpRn), + "jp_trn" => Ok(JpTrn), + "ke_pin" => Ok(KePin), + "kr_brn" => Ok(KrBrn), + "li_uid" => Ok(LiUid), + "mx_rfc" => Ok(MxRfc), + "my_frp" => Ok(MyFrp), + "my_itn" => Ok(MyItn), + "my_sst" => Ok(MySst), + "no_vat" => Ok(NoVat), + "nz_gst" => Ok(NzGst), + "pe_ruc" => Ok(PeRuc), + "ph_tin" => Ok(PhTin), + "ro_tin" => Ok(RoTin), + "rs_pib" => Ok(RsPib), + "ru_inn" => Ok(RuInn), + "ru_kpp" => Ok(RuKpp), + "sa_vat" => Ok(SaVat), + "sg_gst" => Ok(SgGst), + "sg_uen" => Ok(SgUen), + "si_tin" => Ok(SiTin), + "sv_nit" => Ok(SvNit), + "th_vat" => Ok(ThVat), + "tr_tin" => Ok(TrTin), + "tw_vat" => Ok(TwVat), + "ua_vat" => Ok(UaVat), + "us_ein" => Ok(UsEin), + "uy_ruc" => Ok(UyRuc), + "ve_rif" => Ok(VeRif), + "vn_tin" => Ok(VnTin), + "za_vat" => Ok(ZaVat), + _ => Err(()), + } + } +} +impl std::fmt::Display for CreateCustomerTaxIdDataType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreateCustomerTaxIdDataType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreateCustomerTaxIdDataType { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'a> CreateCustomer<'a> { + /// Creates a new customer object. + pub fn send(&self, client: &stripe::Client) -> stripe::Response { + client.send_form("/customers", self, http_types::Method::Post) + } +} +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdateCustomer<'a> { + /// The customer's address. + #[serde(skip_serializing_if = "Option::is_none")] + pub address: Option>, + /// An integer amount in cents (or local equivalent) that represents the customer's current balance, which affect the customer's future invoices. + /// A negative amount represents a credit that decreases the amount due on an invoice; a positive amount increases the amount due on an invoice. + #[serde(skip_serializing_if = "Option::is_none")] + pub balance: Option, + /// Balance information and default balance settings for this customer. + #[serde(skip_serializing_if = "Option::is_none")] + pub cash_balance: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub coupon: Option<&'a str>, + /// If you are using payment methods created via the PaymentMethods API, see the [invoice_settings.default_payment_method](https://stripe.com/docs/api/customers/update#update_customer-invoice_settings-default_payment_method) parameter. + /// + /// Provide the ID of a payment source already attached to this customer to make it this customer's default payment source. + /// + /// If you want to add a new payment source and make it the default, see the [source](https://stripe.com/docs/api/customers/update#update_customer-source) property. + #[serde(skip_serializing_if = "Option::is_none")] + pub default_source: Option<&'a str>, + /// An arbitrary string that you can attach to a customer object. + /// It is displayed alongside the customer in the dashboard. + #[serde(skip_serializing_if = "Option::is_none")] + pub description: Option<&'a str>, + /// Customer's email address. + /// It's displayed alongside the customer in your dashboard and can be useful for searching and tracking. + /// This may be up to *512 characters*. + #[serde(skip_serializing_if = "Option::is_none")] + pub email: Option<&'a str>, + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, + /// The prefix for the customer used to generate unique invoice numbers. + /// Must be 3–12 uppercase letters or numbers. + #[serde(skip_serializing_if = "Option::is_none")] + pub invoice_prefix: Option<&'a str>, + /// Default invoice settings for this customer. + #[serde(skip_serializing_if = "Option::is_none")] + pub invoice_settings: Option>, + /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. + /// This can be useful for storing additional information about the object in a structured format. + /// Individual keys can be unset by posting an empty value to them. + /// All keys can be unset by posting an empty value to `metadata`. + #[serde(skip_serializing_if = "Option::is_none")] + pub metadata: Option<&'a std::collections::HashMap>, + /// The customer's full name or business name. + #[serde(skip_serializing_if = "Option::is_none")] + pub name: Option<&'a str>, + /// The sequence to be used on the customer's next invoice. Defaults to 1. + #[serde(skip_serializing_if = "Option::is_none")] + pub next_invoice_sequence: Option, + /// The customer's phone number. + #[serde(skip_serializing_if = "Option::is_none")] + pub phone: Option<&'a str>, + /// Customer's preferred languages, ordered by preference. + #[serde(skip_serializing_if = "Option::is_none")] + pub preferred_locales: Option<&'a [&'a str]>, + /// The API ID of a promotion code to apply to the customer. + /// The customer will have a discount applied on all recurring payments. + /// Charges you create through the API will not have the discount. + #[serde(skip_serializing_if = "Option::is_none")] + pub promotion_code: Option<&'a str>, + /// The customer's shipping information. Appears on invoices emailed to this customer. + #[serde(skip_serializing_if = "Option::is_none")] + pub shipping: Option>, + #[serde(skip_serializing_if = "Option::is_none")] + pub source: Option<&'a str>, + /// Tax details about the customer. + #[serde(skip_serializing_if = "Option::is_none")] + pub tax: Option>, + /// The customer's tax exemption. One of `none`, `exempt`, or `reverse`. + #[serde(skip_serializing_if = "Option::is_none")] + pub tax_exempt: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub validate: Option, +} +impl<'a> UpdateCustomer<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// Balance information and default balance settings for this customer. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdateCustomerCashBalance { + /// Settings controlling the behavior of the customer's cash balance, + /// such as reconciliation of funds received. + #[serde(skip_serializing_if = "Option::is_none")] + pub settings: Option, +} +impl UpdateCustomerCashBalance { + pub fn new() -> Self { + Self::default() + } +} +/// Settings controlling the behavior of the customer's cash balance, +/// such as reconciliation of funds received. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdateCustomerCashBalanceSettings { + /// Controls how funds transferred by the customer are applied to payment intents and invoices. + /// Valid options are `automatic`, `manual`, or `merchant_default`. + /// For more information about these reconciliation modes, see [Reconciliation](https://stripe.com/docs/payments/customer-balance/reconciliation). + #[serde(skip_serializing_if = "Option::is_none")] + pub reconciliation_mode: Option, +} +impl UpdateCustomerCashBalanceSettings { + pub fn new() -> Self { + Self::default() + } +} +/// Controls how funds transferred by the customer are applied to payment intents and invoices. +/// Valid options are `automatic`, `manual`, or `merchant_default`. +/// For more information about these reconciliation modes, see [Reconciliation](https://stripe.com/docs/payments/customer-balance/reconciliation). +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum UpdateCustomerCashBalanceSettingsReconciliationMode { + Automatic, + Manual, + MerchantDefault, +} +impl UpdateCustomerCashBalanceSettingsReconciliationMode { + pub fn as_str(self) -> &'static str { + use UpdateCustomerCashBalanceSettingsReconciliationMode::*; + match self { + Automatic => "automatic", + Manual => "manual", + MerchantDefault => "merchant_default", + } + } +} + +impl std::str::FromStr for UpdateCustomerCashBalanceSettingsReconciliationMode { + type Err = (); + fn from_str(s: &str) -> Result { + use UpdateCustomerCashBalanceSettingsReconciliationMode::*; + match s { + "automatic" => Ok(Automatic), + "manual" => Ok(Manual), + "merchant_default" => Ok(MerchantDefault), + _ => Err(()), + } + } +} +impl std::fmt::Display for UpdateCustomerCashBalanceSettingsReconciliationMode { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for UpdateCustomerCashBalanceSettingsReconciliationMode { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for UpdateCustomerCashBalanceSettingsReconciliationMode { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Default invoice settings for this customer. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdateCustomerInvoiceSettings<'a> { + /// The list of up to 4 default custom fields to be displayed on invoices for this customer. + /// When updating, pass an empty string to remove previously-defined fields. + #[serde(skip_serializing_if = "Option::is_none")] + pub custom_fields: Option<&'a [CustomFieldParams<'a>]>, + /// ID of a payment method that's attached to the customer, to be used as the customer's default payment method for subscriptions and invoices. + #[serde(skip_serializing_if = "Option::is_none")] + pub default_payment_method: Option<&'a str>, + /// Default footer to be displayed on invoices for this customer. + #[serde(skip_serializing_if = "Option::is_none")] + pub footer: Option<&'a str>, + /// Default options for invoice PDF rendering for this customer. + #[serde(skip_serializing_if = "Option::is_none")] + pub rendering_options: Option, +} +impl<'a> UpdateCustomerInvoiceSettings<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// Default options for invoice PDF rendering for this customer. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdateCustomerInvoiceSettingsRenderingOptions { + /// How line-item prices and amounts will be displayed with respect to tax on invoice PDFs. + /// One of `exclude_tax` or `include_inclusive_tax`. + /// `include_inclusive_tax` will include inclusive tax (and exclude exclusive tax) in invoice PDF amounts. + /// `exclude_tax` will exclude all tax (inclusive and exclusive alike) from invoice PDF amounts. + #[serde(skip_serializing_if = "Option::is_none")] + pub amount_tax_display: Option, +} +impl UpdateCustomerInvoiceSettingsRenderingOptions { + pub fn new() -> Self { + Self::default() + } +} +/// How line-item prices and amounts will be displayed with respect to tax on invoice PDFs. +/// One of `exclude_tax` or `include_inclusive_tax`. +/// `include_inclusive_tax` will include inclusive tax (and exclude exclusive tax) in invoice PDF amounts. +/// `exclude_tax` will exclude all tax (inclusive and exclusive alike) from invoice PDF amounts. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum UpdateCustomerInvoiceSettingsRenderingOptionsAmountTaxDisplay { + ExcludeTax, + IncludeInclusiveTax, +} +impl UpdateCustomerInvoiceSettingsRenderingOptionsAmountTaxDisplay { + pub fn as_str(self) -> &'static str { + use UpdateCustomerInvoiceSettingsRenderingOptionsAmountTaxDisplay::*; + match self { + ExcludeTax => "exclude_tax", + IncludeInclusiveTax => "include_inclusive_tax", + } + } +} + +impl std::str::FromStr for UpdateCustomerInvoiceSettingsRenderingOptionsAmountTaxDisplay { + type Err = (); + fn from_str(s: &str) -> Result { + use UpdateCustomerInvoiceSettingsRenderingOptionsAmountTaxDisplay::*; + match s { + "exclude_tax" => Ok(ExcludeTax), + "include_inclusive_tax" => Ok(IncludeInclusiveTax), + _ => Err(()), + } + } +} +impl std::fmt::Display for UpdateCustomerInvoiceSettingsRenderingOptionsAmountTaxDisplay { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for UpdateCustomerInvoiceSettingsRenderingOptionsAmountTaxDisplay { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for UpdateCustomerInvoiceSettingsRenderingOptionsAmountTaxDisplay { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Tax details about the customer. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdateCustomerTax<'a> { + /// A recent IP address of the customer used for tax reporting and tax location inference. + /// Stripe recommends updating the IP address when a new PaymentMethod is attached or the address field on the customer is updated. + /// We recommend against updating this field more frequently since it could result in unexpected tax location/reporting outcomes. + #[serde(skip_serializing_if = "Option::is_none")] + pub ip_address: Option<&'a str>, + /// A flag that indicates when Stripe should validate the customer tax location. + /// Defaults to `deferred`. + #[serde(skip_serializing_if = "Option::is_none")] + pub validate_location: Option, +} +impl<'a> UpdateCustomerTax<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// A flag that indicates when Stripe should validate the customer tax location. +/// Defaults to `deferred`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum UpdateCustomerTaxValidateLocation { + Deferred, + Immediately, +} +impl UpdateCustomerTaxValidateLocation { + pub fn as_str(self) -> &'static str { + use UpdateCustomerTaxValidateLocation::*; + match self { + Deferred => "deferred", + Immediately => "immediately", + } + } +} + +impl std::str::FromStr for UpdateCustomerTaxValidateLocation { + type Err = (); + fn from_str(s: &str) -> Result { + use UpdateCustomerTaxValidateLocation::*; + match s { + "deferred" => Ok(Deferred), + "immediately" => Ok(Immediately), + _ => Err(()), + } + } +} +impl std::fmt::Display for UpdateCustomerTaxValidateLocation { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for UpdateCustomerTaxValidateLocation { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for UpdateCustomerTaxValidateLocation { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'a> UpdateCustomer<'a> { + /// Updates the specified customer by setting the values of the parameters passed. + /// Any parameters not provided will be left unchanged. + /// For example, if you pass the **source** parameter, that becomes the customer’s active source (e.g., a card) to be used for all charges in the future. + /// When you update a customer to a new valid card source by passing the **source** parameter: for each of the customer’s current subscriptions, if the subscription bills automatically and is in the `past_due` state, then the latest open invoice for the subscription with automatic collection enabled will be retried. + /// This retry will not count as an automatic retry, and will not affect the next regularly scheduled payment for the invoice. + /// Changing the **default_source** for a customer will not trigger this behavior. + /// + /// This request accepts mostly the same arguments as the customer creation call. + pub fn send( + &self, + client: &stripe::Client, + customer: &stripe_shared::CustomerId, + ) -> stripe::Response { + client.send_form(&format!("/customers/{customer}"), self, http_types::Method::Post) + } +} +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreateFundingInstructionsCustomer<'a> { + /// Additional parameters for `bank_transfer` funding types + pub bank_transfer: CreateFundingInstructionsCustomerBankTransfer<'a>, + /// Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. + /// Must be a [supported currency](https://stripe.com/docs/currencies). + pub currency: stripe_types::Currency, + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, + /// The `funding_type` to get the instructions for. + pub funding_type: CreateFundingInstructionsCustomerFundingType, +} +impl<'a> CreateFundingInstructionsCustomer<'a> { + pub fn new( + bank_transfer: CreateFundingInstructionsCustomerBankTransfer<'a>, + currency: stripe_types::Currency, + funding_type: CreateFundingInstructionsCustomerFundingType, + ) -> Self { + Self { bank_transfer, currency, expand: None, funding_type } + } +} +/// Additional parameters for `bank_transfer` funding types +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreateFundingInstructionsCustomerBankTransfer<'a> { + /// Configuration for eu_bank_transfer funding type. + #[serde(skip_serializing_if = "Option::is_none")] + pub eu_bank_transfer: Option>, + /// List of address types that should be returned in the financial_addresses response. + /// If not specified, all valid types will be returned. + /// + /// Permitted values include: `sort_code`, `zengin`, `iban`, or `spei`. + #[serde(skip_serializing_if = "Option::is_none")] + pub requested_address_types: + Option<&'a [CreateFundingInstructionsCustomerBankTransferRequestedAddressTypes]>, + /// The type of the `bank_transfer` + #[serde(rename = "type")] + pub type_: CreateFundingInstructionsCustomerBankTransferType, +} +impl<'a> CreateFundingInstructionsCustomerBankTransfer<'a> { + pub fn new(type_: CreateFundingInstructionsCustomerBankTransferType) -> Self { + Self { eu_bank_transfer: None, requested_address_types: None, type_ } + } +} +/// Configuration for eu_bank_transfer funding type. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreateFundingInstructionsCustomerBankTransferEuBankTransfer<'a> { + /// The desired country code of the bank account information. + /// Permitted values include: `BE`, `DE`, `ES`, `FR`, `IE`, or `NL`. + pub country: &'a str, +} +impl<'a> CreateFundingInstructionsCustomerBankTransferEuBankTransfer<'a> { + pub fn new(country: &'a str) -> Self { + Self { country } + } +} +/// List of address types that should be returned in the financial_addresses response. +/// If not specified, all valid types will be returned. +/// +/// Permitted values include: `sort_code`, `zengin`, `iban`, or `spei`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreateFundingInstructionsCustomerBankTransferRequestedAddressTypes { + Iban, + SortCode, + Spei, + Zengin, +} +impl CreateFundingInstructionsCustomerBankTransferRequestedAddressTypes { + pub fn as_str(self) -> &'static str { + use CreateFundingInstructionsCustomerBankTransferRequestedAddressTypes::*; + match self { + Iban => "iban", + SortCode => "sort_code", + Spei => "spei", + Zengin => "zengin", + } + } +} + +impl std::str::FromStr for CreateFundingInstructionsCustomerBankTransferRequestedAddressTypes { + type Err = (); + fn from_str(s: &str) -> Result { + use CreateFundingInstructionsCustomerBankTransferRequestedAddressTypes::*; + match s { + "iban" => Ok(Iban), + "sort_code" => Ok(SortCode), + "spei" => Ok(Spei), + "zengin" => Ok(Zengin), + _ => Err(()), + } + } +} +impl std::fmt::Display for CreateFundingInstructionsCustomerBankTransferRequestedAddressTypes { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreateFundingInstructionsCustomerBankTransferRequestedAddressTypes { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreateFundingInstructionsCustomerBankTransferRequestedAddressTypes { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// The type of the `bank_transfer` +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreateFundingInstructionsCustomerBankTransferType { + EuBankTransfer, + GbBankTransfer, + JpBankTransfer, + MxBankTransfer, + UsBankTransfer, +} +impl CreateFundingInstructionsCustomerBankTransferType { + pub fn as_str(self) -> &'static str { + use CreateFundingInstructionsCustomerBankTransferType::*; + match self { + EuBankTransfer => "eu_bank_transfer", + GbBankTransfer => "gb_bank_transfer", + JpBankTransfer => "jp_bank_transfer", + MxBankTransfer => "mx_bank_transfer", + UsBankTransfer => "us_bank_transfer", + } + } +} + +impl std::str::FromStr for CreateFundingInstructionsCustomerBankTransferType { + type Err = (); + fn from_str(s: &str) -> Result { + use CreateFundingInstructionsCustomerBankTransferType::*; + match s { + "eu_bank_transfer" => Ok(EuBankTransfer), + "gb_bank_transfer" => Ok(GbBankTransfer), + "jp_bank_transfer" => Ok(JpBankTransfer), + "mx_bank_transfer" => Ok(MxBankTransfer), + "us_bank_transfer" => Ok(UsBankTransfer), + _ => Err(()), + } + } +} +impl std::fmt::Display for CreateFundingInstructionsCustomerBankTransferType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreateFundingInstructionsCustomerBankTransferType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreateFundingInstructionsCustomerBankTransferType { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// The `funding_type` to get the instructions for. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreateFundingInstructionsCustomerFundingType { + BankTransfer, +} +impl CreateFundingInstructionsCustomerFundingType { + pub fn as_str(self) -> &'static str { + use CreateFundingInstructionsCustomerFundingType::*; + match self { + BankTransfer => "bank_transfer", + } + } +} + +impl std::str::FromStr for CreateFundingInstructionsCustomerFundingType { + type Err = (); + fn from_str(s: &str) -> Result { + use CreateFundingInstructionsCustomerFundingType::*; + match s { + "bank_transfer" => Ok(BankTransfer), + _ => Err(()), + } + } +} +impl std::fmt::Display for CreateFundingInstructionsCustomerFundingType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreateFundingInstructionsCustomerFundingType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreateFundingInstructionsCustomerFundingType { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'a> CreateFundingInstructionsCustomer<'a> { + /// Retrieve funding instructions for a customer cash balance. + /// If funding instructions do not yet exist for the customer, new. + /// funding instructions will be created. + /// If funding instructions have already been created for a given customer, the same. + /// funding instructions will be retrieved. + /// In other words, we will return the same funding instructions each time. + pub fn send( + &self, + client: &stripe::Client, + customer: &stripe_shared::CustomerId, + ) -> stripe::Response { + client.send_form( + &format!("/customers/{customer}/funding_instructions"), + self, + http_types::Method::Post, + ) + } +} +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct FundCashBalanceCustomer<'a> { + /// Amount to be used for this test cash balance transaction. + /// A positive integer representing how much to fund in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal) (e.g., 100 cents to fund $1.00 or 100 to fund ¥100, a zero-decimal currency). + pub amount: i64, + /// Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. + /// Must be a [supported currency](https://stripe.com/docs/currencies). + pub currency: stripe_types::Currency, + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, + /// A description of the test funding. + /// This simulates free-text references supplied by customers when making bank transfers to their cash balance. + /// You can use this to test how Stripe's [reconciliation algorithm](https://stripe.com/docs/payments/customer-balance/reconciliation) applies to different user inputs. + #[serde(skip_serializing_if = "Option::is_none")] + pub reference: Option<&'a str>, +} +impl<'a> FundCashBalanceCustomer<'a> { + pub fn new(amount: i64, currency: stripe_types::Currency) -> Self { + Self { amount, currency, expand: None, reference: None } + } +} +impl<'a> FundCashBalanceCustomer<'a> { + /// Create an incoming testmode bank transfer + pub fn send( + &self, + client: &stripe::Client, + customer: &str, + ) -> stripe::Response { + client.send_form( + &format!("/test_helpers/customers/{customer}/fund_cash_balance"), + self, + http_types::Method::Post, + ) + } +} +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct OptionalFieldsAddress<'a> { + /// City, district, suburb, town, or village. + #[serde(skip_serializing_if = "Option::is_none")] + pub city: Option<&'a str>, + /// Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). + #[serde(skip_serializing_if = "Option::is_none")] + pub country: Option<&'a str>, + /// Address line 1 (e.g., street, PO Box, or company name). + #[serde(skip_serializing_if = "Option::is_none")] + pub line1: Option<&'a str>, + /// Address line 2 (e.g., apartment, suite, unit, or building). + #[serde(skip_serializing_if = "Option::is_none")] + pub line2: Option<&'a str>, + /// ZIP or postal code. + #[serde(skip_serializing_if = "Option::is_none")] + pub postal_code: Option<&'a str>, + /// State, county, province, or region. + #[serde(skip_serializing_if = "Option::is_none")] + pub state: Option<&'a str>, +} +impl<'a> OptionalFieldsAddress<'a> { + pub fn new() -> Self { + Self::default() + } +} +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CustomFieldParams<'a> { + /// The name of the custom field. This may be up to 30 characters. + pub name: &'a str, + /// The value of the custom field. This may be up to 30 characters. + pub value: &'a str, +} +impl<'a> CustomFieldParams<'a> { + pub fn new(name: &'a str, value: &'a str) -> Self { + Self { name, value } + } +} +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CustomerShipping<'a> { + /// Customer shipping address. + pub address: OptionalFieldsAddress<'a>, + /// Customer name. + pub name: &'a str, + /// Customer phone (including extension). + #[serde(skip_serializing_if = "Option::is_none")] + pub phone: Option<&'a str>, +} +impl<'a> CustomerShipping<'a> { + pub fn new(address: OptionalFieldsAddress<'a>, name: &'a str) -> Self { + Self { address, name, phone: None } + } +} diff --git a/generated/stripe_core/src/customer_balance_transaction/mod.rs b/generated/stripe_core/src/customer_balance_transaction/mod.rs new file mode 100644 index 000000000..05adc7718 --- /dev/null +++ b/generated/stripe_core/src/customer_balance_transaction/mod.rs @@ -0,0 +1,4 @@ +#[cfg(feature = "customer_balance_transaction")] +mod requests; +#[cfg(feature = "customer_balance_transaction")] +pub use requests::*; diff --git a/generated/stripe_core/src/customer_balance_transaction/requests.rs b/generated/stripe_core/src/customer_balance_transaction/requests.rs new file mode 100644 index 000000000..b9e868401 --- /dev/null +++ b/generated/stripe_core/src/customer_balance_transaction/requests.rs @@ -0,0 +1,142 @@ +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct ListCustomerCustomerBalanceTransaction<'a> { + /// A cursor for use in pagination. + /// `ending_before` is an object ID that defines your place in the list. + /// For instance, if you make a list request and receive 100 objects, starting with `obj_bar`, your subsequent call can include `ending_before=obj_bar` in order to fetch the previous page of the list. + #[serde(skip_serializing_if = "Option::is_none")] + pub ending_before: Option<&'a str>, + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, + /// A limit on the number of objects to be returned. + /// Limit can range between 1 and 100, and the default is 10. + #[serde(skip_serializing_if = "Option::is_none")] + pub limit: Option, + /// A cursor for use in pagination. + /// `starting_after` is an object ID that defines your place in the list. + /// For instance, if you make a list request and receive 100 objects, ending with `obj_foo`, your subsequent call can include `starting_after=obj_foo` in order to fetch the next page of the list. + #[serde(skip_serializing_if = "Option::is_none")] + pub starting_after: Option<&'a str>, +} +impl<'a> ListCustomerCustomerBalanceTransaction<'a> { + pub fn new() -> Self { + Self::default() + } +} +impl<'a> ListCustomerCustomerBalanceTransaction<'a> { + /// Returns a list of transactions that updated the customer’s [balances](https://stripe.com/docs/billing/customer/balance). + pub fn send( + &self, + client: &stripe::Client, + customer: &stripe_shared::CustomerId, + ) -> stripe::Response> { + client.get_query(&format!("/customers/{customer}/balance_transactions"), self) + } + pub fn paginate( + self, + customer: &stripe_shared::CustomerId, + ) -> stripe::ListPaginator> { + stripe::ListPaginator::from_list_params( + &format!("/customers/{customer}/balance_transactions"), + self, + ) + } +} +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct RetrieveCustomerBalanceTransaction<'a> { + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, +} +impl<'a> RetrieveCustomerBalanceTransaction<'a> { + pub fn new() -> Self { + Self::default() + } +} +impl<'a> RetrieveCustomerBalanceTransaction<'a> { + /// Retrieves a specific customer balance transaction that updated the customer’s [balances](https://stripe.com/docs/billing/customer/balance). + pub fn send( + &self, + client: &stripe::Client, + customer: &stripe_shared::CustomerId, + transaction: &str, + ) -> stripe::Response { + client.get_query(&format!("/customers/{customer}/balance_transactions/{transaction}"), self) + } +} +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreateCustomerCustomerBalanceTransaction<'a> { + /// The integer amount in **cents (or local equivalent)** to apply to the customer's credit balance. + pub amount: i64, + /// Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. + /// Must be a [supported currency](https://stripe.com/docs/currencies). + /// Specifies the [`invoice_credit_balance`](https://stripe.com/docs/api/customers/object#customer_object-invoice_credit_balance) that this transaction will apply to. + /// If the customer's `currency` is not set, it will be updated to this value. + pub currency: stripe_types::Currency, + /// An arbitrary string attached to the object. Often useful for displaying to users. + #[serde(skip_serializing_if = "Option::is_none")] + pub description: Option<&'a str>, + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, + /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. + /// This can be useful for storing additional information about the object in a structured format. + /// Individual keys can be unset by posting an empty value to them. + /// All keys can be unset by posting an empty value to `metadata`. + #[serde(skip_serializing_if = "Option::is_none")] + pub metadata: Option<&'a std::collections::HashMap>, +} +impl<'a> CreateCustomerCustomerBalanceTransaction<'a> { + pub fn new(amount: i64, currency: stripe_types::Currency) -> Self { + Self { amount, currency, description: None, expand: None, metadata: None } + } +} +impl<'a> CreateCustomerCustomerBalanceTransaction<'a> { + /// Creates an immutable transaction that updates the customer’s credit [balance](https://stripe.com/docs/billing/customer/balance). + pub fn send( + &self, + client: &stripe::Client, + customer: &stripe_shared::CustomerId, + ) -> stripe::Response { + client.send_form( + &format!("/customers/{customer}/balance_transactions"), + self, + http_types::Method::Post, + ) + } +} +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdateCustomerBalanceTransaction<'a> { + /// An arbitrary string attached to the object. Often useful for displaying to users. + #[serde(skip_serializing_if = "Option::is_none")] + pub description: Option<&'a str>, + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, + /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. + /// This can be useful for storing additional information about the object in a structured format. + /// Individual keys can be unset by posting an empty value to them. + /// All keys can be unset by posting an empty value to `metadata`. + #[serde(skip_serializing_if = "Option::is_none")] + pub metadata: Option<&'a std::collections::HashMap>, +} +impl<'a> UpdateCustomerBalanceTransaction<'a> { + pub fn new() -> Self { + Self::default() + } +} +impl<'a> UpdateCustomerBalanceTransaction<'a> { + /// Most credit balance transaction fields are immutable, but you may update its `description` and `metadata`. + pub fn send( + &self, + client: &stripe::Client, + customer: &stripe_shared::CustomerId, + transaction: &str, + ) -> stripe::Response { + client.send_form( + &format!("/customers/{customer}/balance_transactions/{transaction}"), + self, + http_types::Method::Post, + ) + } +} diff --git a/generated/stripe_core/src/customer_cash_balance_transaction/mod.rs b/generated/stripe_core/src/customer_cash_balance_transaction/mod.rs new file mode 100644 index 000000000..e7051f16e --- /dev/null +++ b/generated/stripe_core/src/customer_cash_balance_transaction/mod.rs @@ -0,0 +1,4 @@ +#[cfg(feature = "customer_cash_balance_transaction")] +mod requests; +#[cfg(feature = "customer_cash_balance_transaction")] +pub use requests::*; diff --git a/generated/stripe_core/src/customer_cash_balance_transaction/requests.rs b/generated/stripe_core/src/customer_cash_balance_transaction/requests.rs new file mode 100644 index 000000000..7ffb1c3aa --- /dev/null +++ b/generated/stripe_core/src/customer_cash_balance_transaction/requests.rs @@ -0,0 +1,70 @@ +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct ListCustomerCustomerCashBalanceTransaction<'a> { + /// A cursor for use in pagination. + /// `ending_before` is an object ID that defines your place in the list. + /// For instance, if you make a list request and receive 100 objects, starting with `obj_bar`, your subsequent call can include `ending_before=obj_bar` in order to fetch the previous page of the list. + #[serde(skip_serializing_if = "Option::is_none")] + pub ending_before: Option<&'a str>, + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, + /// A limit on the number of objects to be returned. + /// Limit can range between 1 and 100, and the default is 10. + #[serde(skip_serializing_if = "Option::is_none")] + pub limit: Option, + /// A cursor for use in pagination. + /// `starting_after` is an object ID that defines your place in the list. + /// For instance, if you make a list request and receive 100 objects, ending with `obj_foo`, your subsequent call can include `starting_after=obj_foo` in order to fetch the next page of the list. + #[serde(skip_serializing_if = "Option::is_none")] + pub starting_after: Option<&'a str>, +} +impl<'a> ListCustomerCustomerCashBalanceTransaction<'a> { + pub fn new() -> Self { + Self::default() + } +} +impl<'a> ListCustomerCustomerCashBalanceTransaction<'a> { + /// Returns a list of transactions that modified the customer’s [cash balance](https://stripe.com/docs/payments/customer-balance). + pub fn send( + &self, + client: &stripe::Client, + customer: &stripe_shared::CustomerId, + ) -> stripe::Response> { + client.get_query(&format!("/customers/{customer}/cash_balance_transactions"), self) + } + pub fn paginate( + self, + customer: &stripe_shared::CustomerId, + ) -> stripe::ListPaginator> + { + stripe::ListPaginator::from_list_params( + &format!("/customers/{customer}/cash_balance_transactions"), + self, + ) + } +} +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct RetrieveCustomerCashBalanceTransaction<'a> { + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, +} +impl<'a> RetrieveCustomerCashBalanceTransaction<'a> { + pub fn new() -> Self { + Self::default() + } +} +impl<'a> RetrieveCustomerCashBalanceTransaction<'a> { + /// Retrieves a specific cash balance transaction, which updated the customer’s [cash balance](https://stripe.com/docs/payments/customer-balance). + pub fn send( + &self, + client: &stripe::Client, + customer: &stripe_shared::CustomerId, + transaction: &str, + ) -> stripe::Response { + client.get_query( + &format!("/customers/{customer}/cash_balance_transactions/{transaction}"), + self, + ) + } +} diff --git a/generated/stripe_core/src/customer_session/mod.rs b/generated/stripe_core/src/customer_session/mod.rs new file mode 100644 index 000000000..2228c469b --- /dev/null +++ b/generated/stripe_core/src/customer_session/mod.rs @@ -0,0 +1,5 @@ +#[cfg(feature = "customer_session")] +mod requests; +pub(crate) mod types; +#[cfg(feature = "customer_session")] +pub use requests::*; diff --git a/generated/stripe_core/src/customer_session/requests.rs b/generated/stripe_core/src/customer_session/requests.rs new file mode 100644 index 000000000..958250f84 --- /dev/null +++ b/generated/stripe_core/src/customer_session/requests.rs @@ -0,0 +1,58 @@ +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreateCustomerSession<'a> { + /// Configuration for each component. Exactly 1 component must be enabled. + pub components: CreateCustomerSessionComponents, + /// The ID of an existing customer for which to create the customer session. + pub customer: &'a str, + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, +} +impl<'a> CreateCustomerSession<'a> { + pub fn new(components: CreateCustomerSessionComponents, customer: &'a str) -> Self { + Self { components, customer, expand: None } + } +} +/// Configuration for each component. Exactly 1 component must be enabled. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreateCustomerSessionComponents { + /// Configuration for buy button. + #[serde(skip_serializing_if = "Option::is_none")] + pub buy_button: Option, + /// Configuration for the pricing table. + #[serde(skip_serializing_if = "Option::is_none")] + pub pricing_table: Option, +} +impl CreateCustomerSessionComponents { + pub fn new() -> Self { + Self::default() + } +} +/// Configuration for buy button. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreateCustomerSessionComponentsBuyButton { + /// Whether the buy button is enabled. + pub enabled: bool, +} +impl CreateCustomerSessionComponentsBuyButton { + pub fn new(enabled: bool) -> Self { + Self { enabled } + } +} +/// Configuration for the pricing table. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreateCustomerSessionComponentsPricingTable { + /// Whether the pricing table is enabled. + pub enabled: bool, +} +impl CreateCustomerSessionComponentsPricingTable { + pub fn new(enabled: bool) -> Self { + Self { enabled } + } +} +impl<'a> CreateCustomerSession<'a> { + /// Creates a customer session object that includes a single-use client secret that you can use on your front-end to grant client-side API access for certain customer resources. + pub fn send(&self, client: &stripe::Client) -> stripe::Response { + client.send_form("/customer_sessions", self, http_types::Method::Post) + } +} diff --git a/generated/stripe_core/src/customer_session/types.rs b/generated/stripe_core/src/customer_session/types.rs new file mode 100644 index 000000000..cbd2e4bb5 --- /dev/null +++ b/generated/stripe_core/src/customer_session/types.rs @@ -0,0 +1,22 @@ +/// A customer session allows you to grant client access to Stripe's frontend SDKs (like StripeJs) +/// control over a customer. +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct CustomerSession { + /// The client secret of this customer session. + /// Used on the client to set up secure access to the given `customer`. + /// + /// The client secret can be used to provide access to `customer` from your frontend. + /// It should not be stored, logged, or exposed to anyone other than the relevant customer. + /// Make sure that you have TLS enabled on any page that includes the client secret. + pub client_secret: String, + #[serde(skip_serializing_if = "Option::is_none")] + pub components: Option, + /// Time at which the object was created. Measured in seconds since the Unix epoch. + pub created: stripe_types::Timestamp, + /// The customer the customer session was created for. + pub customer: stripe_types::Expandable, + /// The timestamp at which this customer session will expire. + pub expires_at: stripe_types::Timestamp, + /// Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + pub livemode: bool, +} diff --git a/generated/stripe_core/src/customer_session_resource_components.rs b/generated/stripe_core/src/customer_session_resource_components.rs new file mode 100644 index 000000000..2539e1437 --- /dev/null +++ b/generated/stripe_core/src/customer_session_resource_components.rs @@ -0,0 +1,6 @@ +/// Configuration for the components supported by this customer session. +#[derive(Copy, Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct CustomerSessionResourceComponents { + pub buy_button: stripe_core::CustomerSessionResourceComponentsResourceBuyButton, + pub pricing_table: stripe_core::CustomerSessionResourceComponentsResourcePricingTable, +} diff --git a/generated/stripe_core/src/customer_session_resource_components_resource_buy_button.rs b/generated/stripe_core/src/customer_session_resource_components_resource_buy_button.rs new file mode 100644 index 000000000..748cb2ded --- /dev/null +++ b/generated/stripe_core/src/customer_session_resource_components_resource_buy_button.rs @@ -0,0 +1,6 @@ +/// This hash contains whether the buy button is enabled. +#[derive(Copy, Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct CustomerSessionResourceComponentsResourceBuyButton { + /// Whether the buy button is enabled. + pub enabled: bool, +} diff --git a/generated/stripe_core/src/customer_session_resource_components_resource_pricing_table.rs b/generated/stripe_core/src/customer_session_resource_components_resource_pricing_table.rs new file mode 100644 index 000000000..6f8dbc4ed --- /dev/null +++ b/generated/stripe_core/src/customer_session_resource_components_resource_pricing_table.rs @@ -0,0 +1,6 @@ +/// This hash contains whether the pricing table is enabled. +#[derive(Copy, Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct CustomerSessionResourceComponentsResourcePricingTable { + /// Whether the pricing table is enabled. + pub enabled: bool, +} diff --git a/generated/stripe_core/src/dispute/mod.rs b/generated/stripe_core/src/dispute/mod.rs new file mode 100644 index 000000000..fe2880766 --- /dev/null +++ b/generated/stripe_core/src/dispute/mod.rs @@ -0,0 +1,4 @@ +#[cfg(feature = "dispute")] +mod requests; +#[cfg(feature = "dispute")] +pub use requests::*; diff --git a/generated/stripe_core/src/dispute/requests.rs b/generated/stripe_core/src/dispute/requests.rs new file mode 100644 index 000000000..510a361ef --- /dev/null +++ b/generated/stripe_core/src/dispute/requests.rs @@ -0,0 +1,239 @@ +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct ListDispute<'a> { + /// Only return disputes associated to the charge specified by this charge ID. + #[serde(skip_serializing_if = "Option::is_none")] + pub charge: Option<&'a str>, + #[serde(skip_serializing_if = "Option::is_none")] + pub created: Option, + /// A cursor for use in pagination. + /// `ending_before` is an object ID that defines your place in the list. + /// For instance, if you make a list request and receive 100 objects, starting with `obj_bar`, your subsequent call can include `ending_before=obj_bar` in order to fetch the previous page of the list. + #[serde(skip_serializing_if = "Option::is_none")] + pub ending_before: Option<&'a str>, + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, + /// A limit on the number of objects to be returned. + /// Limit can range between 1 and 100, and the default is 10. + #[serde(skip_serializing_if = "Option::is_none")] + pub limit: Option, + /// Only return disputes associated to the PaymentIntent specified by this PaymentIntent ID. + #[serde(skip_serializing_if = "Option::is_none")] + pub payment_intent: Option<&'a str>, + /// A cursor for use in pagination. + /// `starting_after` is an object ID that defines your place in the list. + /// For instance, if you make a list request and receive 100 objects, ending with `obj_foo`, your subsequent call can include `starting_after=obj_foo` in order to fetch the next page of the list. + #[serde(skip_serializing_if = "Option::is_none")] + pub starting_after: Option<&'a str>, +} +impl<'a> ListDispute<'a> { + pub fn new() -> Self { + Self::default() + } +} +impl<'a> ListDispute<'a> { + /// Returns a list of your disputes. + pub fn send( + &self, + client: &stripe::Client, + ) -> stripe::Response> { + client.get_query("/disputes", self) + } + pub fn paginate(self) -> stripe::ListPaginator> { + stripe::ListPaginator::from_list_params("/disputes", self) + } +} +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct RetrieveDispute<'a> { + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, +} +impl<'a> RetrieveDispute<'a> { + pub fn new() -> Self { + Self::default() + } +} +impl<'a> RetrieveDispute<'a> { + /// Retrieves the dispute with the given ID. + pub fn send( + &self, + client: &stripe::Client, + dispute: &stripe_shared::DisputeId, + ) -> stripe::Response { + client.get_query(&format!("/disputes/{dispute}"), self) + } +} +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdateDispute<'a> { + /// Evidence to upload, to respond to a dispute. + /// Updating any field in the hash will submit all fields in the hash for review. + /// The combined character count of all fields is limited to 150,000. + #[serde(skip_serializing_if = "Option::is_none")] + pub evidence: Option>, + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, + /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. + /// This can be useful for storing additional information about the object in a structured format. + /// Individual keys can be unset by posting an empty value to them. + /// All keys can be unset by posting an empty value to `metadata`. + #[serde(skip_serializing_if = "Option::is_none")] + pub metadata: Option<&'a std::collections::HashMap>, + /// Whether to immediately submit evidence to the bank. + /// If `false`, evidence is staged on the dispute. + /// Staged evidence is visible in the API and Dashboard, and can be submitted to the bank by making another request with this attribute set to `true` (the default). + #[serde(skip_serializing_if = "Option::is_none")] + pub submit: Option, +} +impl<'a> UpdateDispute<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// Evidence to upload, to respond to a dispute. +/// Updating any field in the hash will submit all fields in the hash for review. +/// The combined character count of all fields is limited to 150,000. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdateDisputeEvidence<'a> { + /// Any server or activity logs showing proof that the customer accessed or downloaded the purchased digital product. + /// This information should include IP addresses, corresponding timestamps, and any detailed recorded activity. + /// Has a maximum character count of 20,000. + #[serde(skip_serializing_if = "Option::is_none")] + pub access_activity_log: Option<&'a str>, + /// The billing address provided by the customer. + #[serde(skip_serializing_if = "Option::is_none")] + pub billing_address: Option<&'a str>, + /// (ID of a [file upload](https://stripe.com/docs/guides/file-upload)) Your subscription cancellation policy, as shown to the customer. + #[serde(skip_serializing_if = "Option::is_none")] + pub cancellation_policy: Option<&'a str>, + /// An explanation of how and when the customer was shown your refund policy prior to purchase. + /// Has a maximum character count of 20,000. + #[serde(skip_serializing_if = "Option::is_none")] + pub cancellation_policy_disclosure: Option<&'a str>, + /// A justification for why the customer's subscription was not canceled. + /// Has a maximum character count of 20,000. + #[serde(skip_serializing_if = "Option::is_none")] + pub cancellation_rebuttal: Option<&'a str>, + /// (ID of a [file upload](https://stripe.com/docs/guides/file-upload)) Any communication with the customer that you feel is relevant to your case. + /// Examples include emails proving that the customer received the product or service, or demonstrating their use of or satisfaction with the product or service. + #[serde(skip_serializing_if = "Option::is_none")] + pub customer_communication: Option<&'a str>, + /// The email address of the customer. + #[serde(skip_serializing_if = "Option::is_none")] + pub customer_email_address: Option<&'a str>, + /// The name of the customer. + #[serde(skip_serializing_if = "Option::is_none")] + pub customer_name: Option<&'a str>, + /// The IP address that the customer used when making the purchase. + #[serde(skip_serializing_if = "Option::is_none")] + pub customer_purchase_ip: Option<&'a str>, + /// (ID of a [file upload](https://stripe.com/docs/guides/file-upload)) A relevant document or contract showing the customer's signature. + #[serde(skip_serializing_if = "Option::is_none")] + pub customer_signature: Option<&'a str>, + /// (ID of a [file upload](https://stripe.com/docs/guides/file-upload)) Documentation for the prior charge that can uniquely identify the charge, such as a receipt, shipping label, work order, etc. + /// This document should be paired with a similar document from the disputed payment that proves the two payments are separate. + #[serde(skip_serializing_if = "Option::is_none")] + pub duplicate_charge_documentation: Option<&'a str>, + /// An explanation of the difference between the disputed charge versus the prior charge that appears to be a duplicate. + /// Has a maximum character count of 20,000. + #[serde(skip_serializing_if = "Option::is_none")] + pub duplicate_charge_explanation: Option<&'a str>, + /// The Stripe ID for the prior charge which appears to be a duplicate of the disputed charge. + #[serde(skip_serializing_if = "Option::is_none")] + pub duplicate_charge_id: Option<&'a str>, + /// A description of the product or service that was sold. Has a maximum character count of 20,000. + #[serde(skip_serializing_if = "Option::is_none")] + pub product_description: Option<&'a str>, + /// (ID of a [file upload](https://stripe.com/docs/guides/file-upload)) Any receipt or message sent to the customer notifying them of the charge. + #[serde(skip_serializing_if = "Option::is_none")] + pub receipt: Option<&'a str>, + /// (ID of a [file upload](https://stripe.com/docs/guides/file-upload)) Your refund policy, as shown to the customer. + #[serde(skip_serializing_if = "Option::is_none")] + pub refund_policy: Option<&'a str>, + /// Documentation demonstrating that the customer was shown your refund policy prior to purchase. + /// Has a maximum character count of 20,000. + #[serde(skip_serializing_if = "Option::is_none")] + pub refund_policy_disclosure: Option<&'a str>, + /// A justification for why the customer is not entitled to a refund. + /// Has a maximum character count of 20,000. + #[serde(skip_serializing_if = "Option::is_none")] + pub refund_refusal_explanation: Option<&'a str>, + /// The date on which the customer received or began receiving the purchased service, in a clear human-readable format. + #[serde(skip_serializing_if = "Option::is_none")] + pub service_date: Option<&'a str>, + /// (ID of a [file upload](https://stripe.com/docs/guides/file-upload)) Documentation showing proof that a service was provided to the customer. + /// This could include a copy of a signed contract, work order, or other form of written agreement. + #[serde(skip_serializing_if = "Option::is_none")] + pub service_documentation: Option<&'a str>, + /// The address to which a physical product was shipped. + /// You should try to include as complete address information as possible. + #[serde(skip_serializing_if = "Option::is_none")] + pub shipping_address: Option<&'a str>, + /// The delivery service that shipped a physical product, such as Fedex, UPS, USPS, etc. + /// If multiple carriers were used for this purchase, please separate them with commas. + #[serde(skip_serializing_if = "Option::is_none")] + pub shipping_carrier: Option<&'a str>, + /// The date on which a physical product began its route to the shipping address, in a clear human-readable format. + #[serde(skip_serializing_if = "Option::is_none")] + pub shipping_date: Option<&'a str>, + /// (ID of a [file upload](https://stripe.com/docs/guides/file-upload)) Documentation showing proof that a product was shipped to the customer at the same address the customer provided to you. + /// This could include a copy of the shipment receipt, shipping label, etc. + /// It should show the customer's full shipping address, if possible. + #[serde(skip_serializing_if = "Option::is_none")] + pub shipping_documentation: Option<&'a str>, + /// The tracking number for a physical product, obtained from the delivery service. + /// If multiple tracking numbers were generated for this purchase, please separate them with commas. + #[serde(skip_serializing_if = "Option::is_none")] + pub shipping_tracking_number: Option<&'a str>, + /// (ID of a [file upload](https://stripe.com/docs/guides/file-upload)) Any additional evidence or statements. + #[serde(skip_serializing_if = "Option::is_none")] + pub uncategorized_file: Option<&'a str>, + /// Any additional evidence or statements. Has a maximum character count of 20,000. + #[serde(skip_serializing_if = "Option::is_none")] + pub uncategorized_text: Option<&'a str>, +} +impl<'a> UpdateDisputeEvidence<'a> { + pub fn new() -> Self { + Self::default() + } +} +impl<'a> UpdateDispute<'a> { + /// When you get a dispute, contacting your customer is always the best first step. + /// If that doesn’t work, you can submit evidence to help us resolve the dispute in your favor. + /// You can do this in your [dashboard](https://dashboard.stripe.com/disputes), but if you prefer, you can use the API to submit evidence programmatically. + /// + /// Depending on your dispute type, different evidence fields will give you a better chance of winning your dispute. + /// To figure out which evidence fields to provide, see our [guide to dispute types](https://stripe.com/docs/disputes/categories). + pub fn send( + &self, + client: &stripe::Client, + dispute: &stripe_shared::DisputeId, + ) -> stripe::Response { + client.send_form(&format!("/disputes/{dispute}"), self, http_types::Method::Post) + } +} +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CloseDispute<'a> { + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, +} +impl<'a> CloseDispute<'a> { + pub fn new() -> Self { + Self::default() + } +} +impl<'a> CloseDispute<'a> { + /// Closing the dispute for a charge indicates that you do not have any evidence to submit and are essentially dismissing the dispute, acknowledging it as lost. + /// + /// The status of the dispute will change from `needs_response` to `lost`. + /// _Closing a dispute is irreversible_. + pub fn send( + &self, + client: &stripe::Client, + dispute: &stripe_shared::DisputeId, + ) -> stripe::Response { + client.send_form(&format!("/disputes/{dispute}/close"), self, http_types::Method::Post) + } +} diff --git a/generated/stripe_core/src/event/mod.rs b/generated/stripe_core/src/event/mod.rs new file mode 100644 index 000000000..a3465c2e9 --- /dev/null +++ b/generated/stripe_core/src/event/mod.rs @@ -0,0 +1,4 @@ +#[cfg(feature = "event")] +mod requests; +#[cfg(feature = "event")] +pub use requests::*; diff --git a/generated/stripe_core/src/event/requests.rs b/generated/stripe_core/src/event/requests.rs new file mode 100644 index 000000000..e8b871e15 --- /dev/null +++ b/generated/stripe_core/src/event/requests.rs @@ -0,0 +1,76 @@ +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct ListEvent<'a> { + #[serde(skip_serializing_if = "Option::is_none")] + pub created: Option, + /// Filter events by whether all webhooks were successfully delivered. + /// If false, events which are still pending or have failed all delivery attempts to a webhook endpoint will be returned. + #[serde(skip_serializing_if = "Option::is_none")] + pub delivery_success: Option, + /// A cursor for use in pagination. + /// `ending_before` is an object ID that defines your place in the list. + /// For instance, if you make a list request and receive 100 objects, starting with `obj_bar`, your subsequent call can include `ending_before=obj_bar` in order to fetch the previous page of the list. + #[serde(skip_serializing_if = "Option::is_none")] + pub ending_before: Option<&'a str>, + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, + /// A limit on the number of objects to be returned. + /// Limit can range between 1 and 100, and the default is 10. + #[serde(skip_serializing_if = "Option::is_none")] + pub limit: Option, + /// A cursor for use in pagination. + /// `starting_after` is an object ID that defines your place in the list. + /// For instance, if you make a list request and receive 100 objects, ending with `obj_foo`, your subsequent call can include `starting_after=obj_foo` in order to fetch the next page of the list. + #[serde(skip_serializing_if = "Option::is_none")] + pub starting_after: Option<&'a str>, + /// A string containing a specific event name, or group of events using * as a wildcard. + /// The list will be filtered to include only events with a matching event property. + #[serde(rename = "type")] + #[serde(skip_serializing_if = "Option::is_none")] + pub type_: Option<&'a str>, + /// An array of up to 20 strings containing specific event names. + /// The list will be filtered to include only events with a matching event property. + /// You may pass either `type` or `types`, but not both. + #[serde(skip_serializing_if = "Option::is_none")] + pub types: Option<&'a [&'a str]>, +} +impl<'a> ListEvent<'a> { + pub fn new() -> Self { + Self::default() + } +} +impl<'a> ListEvent<'a> { + /// List events, going back up to 30 days. + /// Each event data is rendered according to Stripe API version at its creation time, specified in [event object](https://stripe.com/docs/api/events/object) `api_version` attribute (not according to your current Stripe API version or `Stripe-Version` header). + pub fn send( + &self, + client: &stripe::Client, + ) -> stripe::Response> { + client.get_query("/events", self) + } + pub fn paginate(self) -> stripe::ListPaginator> { + stripe::ListPaginator::from_list_params("/events", self) + } +} +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct RetrieveEvent<'a> { + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, +} +impl<'a> RetrieveEvent<'a> { + pub fn new() -> Self { + Self::default() + } +} +impl<'a> RetrieveEvent<'a> { + /// Retrieves the details of an event. + /// Supply the unique identifier of the event, which you might have received in a webhook. + pub fn send( + &self, + client: &stripe::Client, + id: &stripe_shared::EventId, + ) -> stripe::Response { + client.get_query(&format!("/events/{id}"), self) + } +} diff --git a/generated/stripe_core/src/file/mod.rs b/generated/stripe_core/src/file/mod.rs new file mode 100644 index 000000000..df1d80d0b --- /dev/null +++ b/generated/stripe_core/src/file/mod.rs @@ -0,0 +1,4 @@ +#[cfg(feature = "file")] +mod requests; +#[cfg(feature = "file")] +pub use requests::*; diff --git a/generated/stripe_core/src/file/requests.rs b/generated/stripe_core/src/file/requests.rs new file mode 100644 index 000000000..f456ef8e6 --- /dev/null +++ b/generated/stripe_core/src/file/requests.rs @@ -0,0 +1,67 @@ +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct ListFile<'a> { + #[serde(skip_serializing_if = "Option::is_none")] + pub created: Option, + /// A cursor for use in pagination. + /// `ending_before` is an object ID that defines your place in the list. + /// For instance, if you make a list request and receive 100 objects, starting with `obj_bar`, your subsequent call can include `ending_before=obj_bar` in order to fetch the previous page of the list. + #[serde(skip_serializing_if = "Option::is_none")] + pub ending_before: Option<&'a str>, + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, + /// A limit on the number of objects to be returned. + /// Limit can range between 1 and 100, and the default is 10. + #[serde(skip_serializing_if = "Option::is_none")] + pub limit: Option, + /// Filter queries by the file purpose. + /// If you don't provide a purpose, the queries return unfiltered files. + #[serde(skip_serializing_if = "Option::is_none")] + pub purpose: Option, + /// A cursor for use in pagination. + /// `starting_after` is an object ID that defines your place in the list. + /// For instance, if you make a list request and receive 100 objects, ending with `obj_foo`, your subsequent call can include `starting_after=obj_foo` in order to fetch the next page of the list. + #[serde(skip_serializing_if = "Option::is_none")] + pub starting_after: Option<&'a str>, +} +impl<'a> ListFile<'a> { + pub fn new() -> Self { + Self::default() + } +} +impl<'a> ListFile<'a> { + /// Returns a list of the files that your account has access to. + /// Stripe sorts and returns the files by their creation dates, placing the most recently created files at the top. + pub fn send( + &self, + client: &stripe::Client, + ) -> stripe::Response> { + client.get_query("/files", self) + } + pub fn paginate(self) -> stripe::ListPaginator> { + stripe::ListPaginator::from_list_params("/files", self) + } +} +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct RetrieveFile<'a> { + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, +} +impl<'a> RetrieveFile<'a> { + pub fn new() -> Self { + Self::default() + } +} +impl<'a> RetrieveFile<'a> { + /// Retrieves the details of an existing file object. + /// After you supply a unique file ID, Stripe returns the corresponding file object. + /// Learn how to [access file contents](https://stripe.com/docs/file-upload#download-file-contents). + pub fn send( + &self, + client: &stripe::Client, + file: &stripe_shared::FileId, + ) -> stripe::Response { + client.get_query(&format!("/files/{file}"), self) + } +} diff --git a/generated/stripe_core/src/file_link/mod.rs b/generated/stripe_core/src/file_link/mod.rs new file mode 100644 index 000000000..266ee7b17 --- /dev/null +++ b/generated/stripe_core/src/file_link/mod.rs @@ -0,0 +1,4 @@ +#[cfg(feature = "file_link")] +mod requests; +#[cfg(feature = "file_link")] +pub use requests::*; diff --git a/generated/stripe_core/src/file_link/requests.rs b/generated/stripe_core/src/file_link/requests.rs new file mode 100644 index 000000000..dbc96f3ff --- /dev/null +++ b/generated/stripe_core/src/file_link/requests.rs @@ -0,0 +1,132 @@ +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct ListFileLink<'a> { + #[serde(skip_serializing_if = "Option::is_none")] + pub created: Option, + /// A cursor for use in pagination. + /// `ending_before` is an object ID that defines your place in the list. + /// For instance, if you make a list request and receive 100 objects, starting with `obj_bar`, your subsequent call can include `ending_before=obj_bar` in order to fetch the previous page of the list. + #[serde(skip_serializing_if = "Option::is_none")] + pub ending_before: Option<&'a str>, + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, + /// Filter links by their expiration status. By default, Stripe returns all links. + #[serde(skip_serializing_if = "Option::is_none")] + pub expired: Option, + /// Only return links for the given file. + #[serde(skip_serializing_if = "Option::is_none")] + pub file: Option<&'a str>, + /// A limit on the number of objects to be returned. + /// Limit can range between 1 and 100, and the default is 10. + #[serde(skip_serializing_if = "Option::is_none")] + pub limit: Option, + /// A cursor for use in pagination. + /// `starting_after` is an object ID that defines your place in the list. + /// For instance, if you make a list request and receive 100 objects, ending with `obj_foo`, your subsequent call can include `starting_after=obj_foo` in order to fetch the next page of the list. + #[serde(skip_serializing_if = "Option::is_none")] + pub starting_after: Option<&'a str>, +} +impl<'a> ListFileLink<'a> { + pub fn new() -> Self { + Self::default() + } +} +impl<'a> ListFileLink<'a> { + /// Returns a list of file links. + pub fn send( + &self, + client: &stripe::Client, + ) -> stripe::Response> { + client.get_query("/file_links", self) + } + pub fn paginate(self) -> stripe::ListPaginator> { + stripe::ListPaginator::from_list_params("/file_links", self) + } +} +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct RetrieveFileLink<'a> { + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, +} +impl<'a> RetrieveFileLink<'a> { + pub fn new() -> Self { + Self::default() + } +} +impl<'a> RetrieveFileLink<'a> { + /// Retrieves the file link with the given ID. + pub fn send( + &self, + client: &stripe::Client, + link: &stripe_shared::FileLinkId, + ) -> stripe::Response { + client.get_query(&format!("/file_links/{link}"), self) + } +} +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreateFileLink<'a> { + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, + /// The link isn't usable after this future timestamp. + #[serde(skip_serializing_if = "Option::is_none")] + pub expires_at: Option, + /// The ID of the file. + /// The file's `purpose` must be one of the following: `business_icon`, `business_logo`, `customer_signature`, `dispute_evidence`, `finance_report_run`, `identity_document_downloadable`, `pci_document`, `selfie`, `sigma_scheduled_query`, `tax_document_user_upload`, or `terminal_reader_splashscreen`. + pub file: &'a str, + /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. + /// This can be useful for storing additional information about the object in a structured format. + /// Individual keys can be unset by posting an empty value to them. + /// All keys can be unset by posting an empty value to `metadata`. + #[serde(skip_serializing_if = "Option::is_none")] + pub metadata: Option<&'a std::collections::HashMap>, +} +impl<'a> CreateFileLink<'a> { + pub fn new(file: &'a str) -> Self { + Self { expand: None, expires_at: None, file, metadata: None } + } +} +impl<'a> CreateFileLink<'a> { + /// Creates a new file link object. + pub fn send(&self, client: &stripe::Client) -> stripe::Response { + client.send_form("/file_links", self, http_types::Method::Post) + } +} +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdateFileLink<'a> { + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, + /// A future timestamp after which the link will no longer be usable, or `now` to expire the link immediately. + #[serde(skip_serializing_if = "Option::is_none")] + pub expires_at: Option, + /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. + /// This can be useful for storing additional information about the object in a structured format. + /// Individual keys can be unset by posting an empty value to them. + /// All keys can be unset by posting an empty value to `metadata`. + #[serde(skip_serializing_if = "Option::is_none")] + pub metadata: Option<&'a std::collections::HashMap>, +} +impl<'a> UpdateFileLink<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// A future timestamp after which the link will no longer be usable, or `now` to expire the link immediately. +#[derive(Copy, Clone, Debug, serde::Serialize)] +#[serde(untagged)] +pub enum UpdateFileLinkExpiresAt { + Now, + Timestamp(stripe_types::Timestamp), +} +impl<'a> UpdateFileLink<'a> { + /// Updates an existing file link object. Expired links can no longer be updated. + pub fn send( + &self, + client: &stripe::Client, + link: &stripe_shared::FileLinkId, + ) -> stripe::Response { + client.send_form(&format!("/file_links/{link}"), self, http_types::Method::Post) + } +} diff --git a/generated/stripe_core/src/mandate/mod.rs b/generated/stripe_core/src/mandate/mod.rs new file mode 100644 index 000000000..9ddbae645 --- /dev/null +++ b/generated/stripe_core/src/mandate/mod.rs @@ -0,0 +1,4 @@ +#[cfg(feature = "mandate")] +mod requests; +#[cfg(feature = "mandate")] +pub use requests::*; diff --git a/generated/stripe_core/src/mandate/requests.rs b/generated/stripe_core/src/mandate/requests.rs new file mode 100644 index 000000000..d244fe515 --- /dev/null +++ b/generated/stripe_core/src/mandate/requests.rs @@ -0,0 +1,21 @@ +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct RetrieveMandate<'a> { + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, +} +impl<'a> RetrieveMandate<'a> { + pub fn new() -> Self { + Self::default() + } +} +impl<'a> RetrieveMandate<'a> { + /// Retrieves a Mandate object. + pub fn send( + &self, + client: &stripe::Client, + mandate: &stripe_shared::MandateId, + ) -> stripe::Response { + client.get_query(&format!("/mandates/{mandate}"), self) + } +} diff --git a/generated/stripe_core/src/mod.rs b/generated/stripe_core/src/mod.rs new file mode 100644 index 000000000..45b93a5eb --- /dev/null +++ b/generated/stripe_core/src/mod.rs @@ -0,0 +1,192 @@ +#![recursion_limit = "256"] +#![allow(clippy::large_enum_variant)] +#![allow(rustdoc::broken_intra_doc_links)] +#![allow(rustdoc::invalid_html_tags)] + +//! This crate provides Rust bindings to the Stripe HTTP API, specifically +//! for requests mentioned in the `Core Resources` section of the [Stripe API docs](https://stripe.com/docs/api) + +extern crate self as stripe_core; +pub use balance::types::*; +pub mod balance; +#[doc(hidden)] +pub mod balance_amount; +#[doc(inline)] +pub use balance_amount::*; +#[doc(hidden)] +pub mod balance_amount_by_source_type; +#[doc(inline)] +pub use balance_amount_by_source_type::*; +#[doc(hidden)] +pub mod balance_amount_net; +#[doc(inline)] +pub use balance_amount_net::*; +#[doc(hidden)] +pub mod balance_detail; +#[doc(inline)] +pub use balance_detail::*; +pub mod balance_transaction; +pub use stripe_shared::balance_transaction::*; +pub use stripe_shared::balance_transaction_source::*; +pub mod cash_balance; +pub use stripe_shared::cash_balance::*; +pub mod charge; +pub use stripe_shared::charge::*; +pub use stripe_shared::charge_fraud_details::*; +pub use stripe_shared::charge_outcome::*; +pub use stripe_shared::charge_transfer_data::*; +pub use stripe_shared::connect_collection_transfer::*; +pub mod customer; +pub use stripe_shared::customer::*;pub use stripe_shared::customer_acceptance::*;pub use stripe_shared::customer_balance_customer_balance_settings::*;pub use stripe_shared::customer_balance_resource_cash_balance_transaction_resource_adjusted_for_overdraft::*;pub use stripe_shared::customer_balance_resource_cash_balance_transaction_resource_applied_to_payment_transaction::*;pub use stripe_shared::customer_balance_resource_cash_balance_transaction_resource_funded_transaction::*;pub use stripe_shared::customer_balance_resource_cash_balance_transaction_resource_funded_transaction_resource_bank_transfer::*;pub use stripe_shared::customer_balance_resource_cash_balance_transaction_resource_funded_transaction_resource_bank_transfer_resource_eu_bank_transfer::*;pub use stripe_shared::customer_balance_resource_cash_balance_transaction_resource_funded_transaction_resource_bank_transfer_resource_gb_bank_transfer::*;pub use stripe_shared::customer_balance_resource_cash_balance_transaction_resource_funded_transaction_resource_bank_transfer_resource_jp_bank_transfer::*;pub use stripe_shared::customer_balance_resource_cash_balance_transaction_resource_funded_transaction_resource_bank_transfer_resource_us_bank_transfer::*;pub use stripe_shared::customer_balance_resource_cash_balance_transaction_resource_refunded_from_payment_transaction::*;pub use stripe_shared::customer_balance_resource_cash_balance_transaction_resource_transferred_to_balance::*;pub use stripe_shared::customer_balance_resource_cash_balance_transaction_resource_unapplied_from_payment_transaction::*; +pub mod customer_balance_transaction; +pub use stripe_shared::customer_balance_transaction::*; +pub mod customer_cash_balance_transaction; +pub use customer_session::types::*; +pub use stripe_shared::customer_cash_balance_transaction::*; +pub mod customer_session; +#[doc(hidden)] +pub mod customer_session_resource_components; +#[doc(inline)] +pub use customer_session_resource_components::*; +#[doc(hidden)] +pub mod customer_session_resource_components_resource_buy_button; +#[doc(inline)] +pub use customer_session_resource_components_resource_buy_button::*; +#[doc(hidden)] +pub mod customer_session_resource_components_resource_pricing_table; +#[doc(inline)] +pub use customer_session_resource_components_resource_pricing_table::*; +pub use stripe_shared::customer_tax::*; +pub use stripe_shared::customer_tax_location::*; +pub use stripe_shared::deleted_customer::*; +pub use stripe_shared::destination_details_unimplemented::*; +pub mod dispute; +pub use stripe_shared::dispute::*; +pub use stripe_shared::dispute_evidence::*; +pub use stripe_shared::dispute_evidence_details::*; +pub use stripe_shared::dispute_payment_method_details::*; +pub use stripe_shared::dispute_payment_method_details_card::*; +pub use stripe_shared::email_sent::*; +pub mod event; +pub use stripe_shared::event::*; +pub use stripe_shared::fee::*; +pub mod file; +pub use stripe_shared::file::*; +pub mod file_link; +pub use stripe_shared::file_link::*; +pub use stripe_shared::level3::*; +pub use stripe_shared::level3_line_items::*; +pub mod mandate; +pub use stripe_shared::mandate::*; +pub use stripe_shared::mandate_acss_debit::*; +pub use stripe_shared::mandate_au_becs_debit::*; +pub use stripe_shared::mandate_bacs_debit::*; +pub use stripe_shared::mandate_cashapp::*; +pub use stripe_shared::mandate_link::*; +pub use stripe_shared::mandate_multi_use::*; +pub use stripe_shared::mandate_payment_method_details::*; +pub use stripe_shared::mandate_paypal::*; +pub use stripe_shared::mandate_sepa_debit::*; +pub use stripe_shared::mandate_single_use::*; +pub use stripe_shared::mandate_us_bank_account::*; +pub use stripe_shared::notification_event_data::*; +pub use stripe_shared::notification_event_request::*; +pub use stripe_shared::offline_acceptance::*; +pub use stripe_shared::online_acceptance::*; +pub use stripe_shared::payment_flows_amount_details::*; +pub use stripe_shared::payment_flows_amount_details_resource_tip::*; +pub use stripe_shared::payment_flows_automatic_payment_methods_payment_intent::*; +pub use stripe_shared::payment_flows_automatic_payment_methods_setup_intent::*; +pub mod payment_intent; +pub use stripe_shared::payment_intent::*; +pub use stripe_shared::payment_intent_card_processing::*; +pub use stripe_shared::payment_intent_next_action::*; +pub use stripe_shared::payment_intent_next_action_alipay_handle_redirect::*; +pub use stripe_shared::payment_intent_next_action_boleto::*; +pub use stripe_shared::payment_intent_next_action_card_await_notification::*; +pub use stripe_shared::payment_intent_next_action_cashapp_handle_redirect_or_display_qr_code::*; +pub use stripe_shared::payment_intent_next_action_cashapp_qr_code::*; +pub use stripe_shared::payment_intent_next_action_display_bank_transfer_instructions::*; +pub use stripe_shared::payment_intent_next_action_display_oxxo_details::*; +pub use stripe_shared::payment_intent_next_action_konbini::*; +pub use stripe_shared::payment_intent_next_action_konbini_familymart::*; +pub use stripe_shared::payment_intent_next_action_konbini_lawson::*; +pub use stripe_shared::payment_intent_next_action_konbini_ministop::*; +pub use stripe_shared::payment_intent_next_action_konbini_seicomart::*; +pub use stripe_shared::payment_intent_next_action_konbini_stores::*; +pub use stripe_shared::payment_intent_next_action_paynow_display_qr_code::*; +pub use stripe_shared::payment_intent_next_action_pix_display_qr_code::*; +pub use stripe_shared::payment_intent_next_action_promptpay_display_qr_code::*; +pub use stripe_shared::payment_intent_next_action_redirect_to_url::*; +pub use stripe_shared::payment_intent_next_action_swish_handle_redirect_or_display_qr_code::*; +pub use stripe_shared::payment_intent_next_action_swish_qr_code::*; +pub use stripe_shared::payment_intent_next_action_verify_with_microdeposits::*; +pub use stripe_shared::payment_intent_next_action_wechat_pay_display_qr_code::*; +pub use stripe_shared::payment_intent_next_action_wechat_pay_redirect_to_android_app::*; +pub use stripe_shared::payment_intent_next_action_wechat_pay_redirect_to_ios_app::*; +pub use stripe_shared::payment_intent_payment_method_options::*; +pub use stripe_shared::payment_intent_payment_method_options_acss_debit::*; +pub use stripe_shared::payment_intent_payment_method_options_au_becs_debit::*; +pub use stripe_shared::payment_intent_payment_method_options_blik::*; +pub use stripe_shared::payment_intent_payment_method_options_card::*; +pub use stripe_shared::payment_intent_payment_method_options_eps::*; +pub use stripe_shared::payment_intent_payment_method_options_link::*; +pub use stripe_shared::payment_intent_payment_method_options_mandate_options_acss_debit::*; +pub use stripe_shared::payment_intent_payment_method_options_mandate_options_sepa_debit::*; +pub use stripe_shared::payment_intent_payment_method_options_sepa_debit::*; +pub use stripe_shared::payment_intent_payment_method_options_swish::*; +pub use stripe_shared::payment_intent_payment_method_options_us_bank_account::*; +pub use stripe_shared::payment_intent_processing::*; +pub use stripe_shared::payment_intent_processing_customer_notification::*; +pub mod payment_source; +pub use stripe_shared::payment_source::*; +pub mod payout; +pub use stripe_shared::payout::*; +pub use stripe_shared::platform_tax_fee::*; +pub mod refund; +pub use stripe_shared::refund::*; +pub use stripe_shared::refund_destination_details::*; +pub use stripe_shared::refund_destination_details_card::*; +pub use stripe_shared::refund_destination_details_generic::*; +pub use stripe_shared::refund_next_action::*; +pub use stripe_shared::refund_next_action_display_details::*; +pub use stripe_shared::reserve_transaction::*; +pub mod setup_attempt; +pub use stripe_shared::setup_attempt::*; +pub use stripe_shared::setup_attempt_payment_method_details::*; +pub use stripe_shared::setup_attempt_payment_method_details_acss_debit::*; +pub use stripe_shared::setup_attempt_payment_method_details_au_becs_debit::*; +pub use stripe_shared::setup_attempt_payment_method_details_bacs_debit::*; +pub use stripe_shared::setup_attempt_payment_method_details_bancontact::*; +pub use stripe_shared::setup_attempt_payment_method_details_boleto::*; +pub use stripe_shared::setup_attempt_payment_method_details_card::*; +pub use stripe_shared::setup_attempt_payment_method_details_card_checks::*; +pub use stripe_shared::setup_attempt_payment_method_details_card_present::*; +pub use stripe_shared::setup_attempt_payment_method_details_card_wallet::*; +pub use stripe_shared::setup_attempt_payment_method_details_cashapp::*; +pub use stripe_shared::setup_attempt_payment_method_details_ideal::*; +pub use stripe_shared::setup_attempt_payment_method_details_klarna::*; +pub use stripe_shared::setup_attempt_payment_method_details_link::*; +pub use stripe_shared::setup_attempt_payment_method_details_paypal::*; +pub use stripe_shared::setup_attempt_payment_method_details_sepa_debit::*; +pub use stripe_shared::setup_attempt_payment_method_details_sofort::*; +pub use stripe_shared::setup_attempt_payment_method_details_us_bank_account::*; +pub mod setup_intent; +pub use stripe_shared::setup_intent::*; +pub use stripe_shared::setup_intent_next_action::*; +pub use stripe_shared::setup_intent_next_action_redirect_to_url::*; +pub use stripe_shared::setup_intent_next_action_verify_with_microdeposits::*; +pub use stripe_shared::setup_intent_payment_method_options::*; +pub use stripe_shared::setup_intent_payment_method_options_acss_debit::*; +pub use stripe_shared::setup_intent_payment_method_options_card::*; +pub use stripe_shared::setup_intent_payment_method_options_card_mandate_options::*; +pub use stripe_shared::setup_intent_payment_method_options_link::*; +pub use stripe_shared::setup_intent_payment_method_options_mandate_options_acss_debit::*; +pub use stripe_shared::setup_intent_payment_method_options_mandate_options_sepa_debit::*; +pub use stripe_shared::setup_intent_payment_method_options_paypal::*; +pub use stripe_shared::setup_intent_payment_method_options_sepa_debit::*; +pub use stripe_shared::setup_intent_payment_method_options_us_bank_account::*; +pub use stripe_shared::tax_deducted_at_source::*; +pub use stripe_shared::three_d_secure_details::*; +pub use token::types::*; +pub mod token; diff --git a/generated/stripe_core/src/payment_intent/mod.rs b/generated/stripe_core/src/payment_intent/mod.rs new file mode 100644 index 000000000..9d0d032a2 --- /dev/null +++ b/generated/stripe_core/src/payment_intent/mod.rs @@ -0,0 +1,4 @@ +#[cfg(feature = "payment_intent")] +mod requests; +#[cfg(feature = "payment_intent")] +pub use requests::*; diff --git a/generated/stripe_core/src/payment_intent/requests.rs b/generated/stripe_core/src/payment_intent/requests.rs new file mode 100644 index 000000000..c56754f87 --- /dev/null +++ b/generated/stripe_core/src/payment_intent/requests.rs @@ -0,0 +1,20712 @@ +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct ListPaymentIntent<'a> { + /// A filter on the list, based on the object `created` field. + /// The value can be a string with an integer Unix timestamp or a dictionary with a number of different query options. + #[serde(skip_serializing_if = "Option::is_none")] + pub created: Option, + /// Only return PaymentIntents for the customer that this customer ID specifies. + #[serde(skip_serializing_if = "Option::is_none")] + pub customer: Option<&'a str>, + /// A cursor for use in pagination. + /// `ending_before` is an object ID that defines your place in the list. + /// For instance, if you make a list request and receive 100 objects, starting with `obj_bar`, your subsequent call can include `ending_before=obj_bar` in order to fetch the previous page of the list. + #[serde(skip_serializing_if = "Option::is_none")] + pub ending_before: Option<&'a str>, + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, + /// A limit on the number of objects to be returned. + /// Limit can range between 1 and 100, and the default is 10. + #[serde(skip_serializing_if = "Option::is_none")] + pub limit: Option, + /// A cursor for use in pagination. + /// `starting_after` is an object ID that defines your place in the list. + /// For instance, if you make a list request and receive 100 objects, ending with `obj_foo`, your subsequent call can include `starting_after=obj_foo` in order to fetch the next page of the list. + #[serde(skip_serializing_if = "Option::is_none")] + pub starting_after: Option<&'a str>, +} +impl<'a> ListPaymentIntent<'a> { + pub fn new() -> Self { + Self::default() + } +} +impl<'a> ListPaymentIntent<'a> { + /// Returns a list of PaymentIntents. + pub fn send( + &self, + client: &stripe::Client, + ) -> stripe::Response> { + client.get_query("/payment_intents", self) + } + pub fn paginate( + self, + ) -> stripe::ListPaginator> { + stripe::ListPaginator::from_list_params("/payment_intents", self) + } +} +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct RetrievePaymentIntent<'a> { + /// The client secret of the PaymentIntent. + /// We require it if you use a publishable key to retrieve the source. + #[serde(skip_serializing_if = "Option::is_none")] + pub client_secret: Option<&'a str>, + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, +} +impl<'a> RetrievePaymentIntent<'a> { + pub fn new() -> Self { + Self::default() + } +} +impl<'a> RetrievePaymentIntent<'a> { + /// Retrieves the details of a PaymentIntent that has previously been created. + /// + /// You can retrieve a PaymentIntent client-side using a publishable key when the `client_secret` is in the query string. + /// + /// + /// If you retrieve a PaymentIntent with a publishable key, it only returns a subset of properties. + /// Refer to the [payment intent](https://stripe.com/docs/api#payment_intent_object) object reference for more details. + pub fn send( + &self, + client: &stripe::Client, + intent: &stripe_shared::PaymentIntentId, + ) -> stripe::Response { + client.get_query(&format!("/payment_intents/{intent}"), self) + } +} +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct SearchPaymentIntent<'a> { + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, + /// A limit on the number of objects to be returned. + /// Limit can range between 1 and 100, and the default is 10. + #[serde(skip_serializing_if = "Option::is_none")] + pub limit: Option, + /// A cursor for pagination across multiple pages of results. + /// Don't include this parameter on the first call. + /// Use the next_page value returned in a previous response to request subsequent results. + #[serde(skip_serializing_if = "Option::is_none")] + pub page: Option<&'a str>, + /// The search query string. + /// See [search query language](https://stripe.com/docs/search#search-query-language) and the list of supported [query fields for payment intents](https://stripe.com/docs/search#query-fields-for-payment-intents). + pub query: &'a str, +} +impl<'a> SearchPaymentIntent<'a> { + pub fn new(query: &'a str) -> Self { + Self { expand: None, limit: None, page: None, query } + } +} +impl<'a> SearchPaymentIntent<'a> { + /// Search for PaymentIntents you’ve previously created using Stripe’s [Search Query Language](https://stripe.com/docs/search#search-query-language). + /// Don’t use search in read-after-write flows where strict consistency is necessary. + /// Under normal operating. + /// conditions, data is searchable in less than a minute. + /// Occasionally, propagation of new or updated data can be up. + /// to an hour behind during outages. Search functionality is not available to merchants in India. + pub fn send( + &self, + client: &stripe::Client, + ) -> stripe::Response> { + client.get_query("/payment_intents/search", self) + } + pub fn paginate( + self, + ) -> stripe::ListPaginator> { + stripe::ListPaginator::from_search_params("/payment_intents/search", self) + } +} +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreatePaymentIntent<'a> { + /// Amount intended to be collected by this PaymentIntent. + /// A positive integer representing how much to charge in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal) (e.g., 100 cents to charge $1.00 or 100 to charge ¥100, a zero-decimal currency). + /// The minimum amount is $0.50 US or [equivalent in charge currency](https://stripe.com/docs/currencies#minimum-and-maximum-charge-amounts). + /// The amount value supports up to eight digits (e.g., a value of 99999999 for a USD charge of $999,999.99). + pub amount: i64, + /// The amount of the application fee (if any) that will be requested to be applied to the payment and transferred to the application owner's Stripe account. + /// The amount of the application fee collected will be capped at the total payment amount. + /// For more information, see the PaymentIntents [use case for connected accounts](https://stripe.com/docs/payments/connected-accounts). + #[serde(skip_serializing_if = "Option::is_none")] + pub application_fee_amount: Option, + /// When you enable this parameter, this PaymentIntent accepts payment methods that you enable in the Dashboard and that are compatible with this PaymentIntent's other parameters. + #[serde(skip_serializing_if = "Option::is_none")] + pub automatic_payment_methods: Option, + /// Controls when the funds will be captured from the customer's account. + #[serde(skip_serializing_if = "Option::is_none")] + pub capture_method: Option, + /// Set to `true` to attempt to [confirm this PaymentIntent](https://stripe.com/docs/api/payment_intents/confirm) this PaymentIntent immediately. + /// This parameter defaults to `false`. + /// When creating and confirming a PaymentIntent at the same time, you can also provide the parameters available in the [Confirm API](https://stripe.com/docs/api/payment_intents/confirm). + #[serde(skip_serializing_if = "Option::is_none")] + pub confirm: Option, + /// Describes whether we can confirm this PaymentIntent automatically, or if it requires customer action to confirm the payment. + #[serde(skip_serializing_if = "Option::is_none")] + pub confirmation_method: Option, + /// Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. + /// Must be a [supported currency](https://stripe.com/docs/currencies). + pub currency: stripe_types::Currency, + /// ID of the Customer this PaymentIntent belongs to, if one exists. + /// + /// Payment methods attached to other Customers cannot be used with this PaymentIntent. + /// + /// If present in combination with [setup_future_usage](https://stripe.com/docs/api#payment_intent_object-setup_future_usage), this PaymentIntent's payment method will be attached to the Customer after the PaymentIntent has been confirmed and any required actions from the user are complete. + #[serde(skip_serializing_if = "Option::is_none")] + pub customer: Option<&'a str>, + /// An arbitrary string attached to the object. Often useful for displaying to users. + #[serde(skip_serializing_if = "Option::is_none")] + pub description: Option<&'a str>, + /// Set to `true` to fail the payment attempt if the PaymentIntent transitions into `requires_action`. + /// Use this parameter for simpler integrations that don't handle customer actions, such as [saving cards without authentication](https://stripe.com/docs/payments/save-card-without-authentication). + /// This parameter can only be used with [`confirm=true`](https://stripe.com/docs/api/payment_intents/create#create_payment_intent-confirm). + #[serde(skip_serializing_if = "Option::is_none")] + pub error_on_requires_action: Option, + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, + /// ID of the mandate that's used for this payment. + /// This parameter can only be used with [`confirm=true`](https://stripe.com/docs/api/payment_intents/create#create_payment_intent-confirm). + #[serde(skip_serializing_if = "Option::is_none")] + pub mandate: Option<&'a str>, + /// This hash contains details about the Mandate to create. + /// This parameter can only be used with [`confirm=true`](https://stripe.com/docs/api/payment_intents/create#create_payment_intent-confirm). + #[serde(skip_serializing_if = "Option::is_none")] + pub mandate_data: Option>, + /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. + /// This can be useful for storing additional information about the object in a structured format. + /// Individual keys can be unset by posting an empty value to them. + /// All keys can be unset by posting an empty value to `metadata`. + #[serde(skip_serializing_if = "Option::is_none")] + pub metadata: Option<&'a std::collections::HashMap>, + /// Set to `true` to indicate that the customer isn't in your checkout flow during this payment attempt and can't authenticate. + /// Use this parameter in scenarios where you collect card details and [charge them later](https://stripe.com/docs/payments/cards/charging-saved-cards). + /// This parameter can only be used with [`confirm=true`](https://stripe.com/docs/api/payment_intents/create#create_payment_intent-confirm). + #[serde(skip_serializing_if = "Option::is_none")] + pub off_session: Option, + /// The Stripe account ID that these funds are intended for. + /// Learn more about the [use case for connected accounts](https://stripe.com/docs/payments/connected-accounts). + #[serde(skip_serializing_if = "Option::is_none")] + pub on_behalf_of: Option<&'a str>, + /// ID of the payment method (a PaymentMethod, Card, or [compatible Source](https://stripe.com/docs/payments/payment-methods#compatibility) object) to attach to this PaymentIntent. + /// + /// If you don't provide the `payment_method` parameter or the `source` parameter with `confirm=true`, `source` automatically populates with `customer.default_source` to improve migration for users of the Charges API. + /// We recommend that you explicitly provide the `payment_method` moving forward. + #[serde(skip_serializing_if = "Option::is_none")] + pub payment_method: Option<&'a str>, + /// The ID of the payment method configuration to use with this PaymentIntent. + #[serde(skip_serializing_if = "Option::is_none")] + pub payment_method_configuration: Option<&'a str>, + /// If provided, this hash will be used to create a PaymentMethod. The new PaymentMethod will appear + /// in the [payment_method](https://stripe.com/docs/api/payment_intents/object#payment_intent_object-payment_method). + /// property on the PaymentIntent. + #[serde(skip_serializing_if = "Option::is_none")] + pub payment_method_data: Option>, + /// Payment method-specific configuration for this PaymentIntent. + #[serde(skip_serializing_if = "Option::is_none")] + pub payment_method_options: Option>, + /// The list of payment method types (for example, a card) that this PaymentIntent can use. + /// If you don't provide this, it defaults to ["card"]. + /// Use `automatic_payment_methods` to manage payment methods from the [Stripe Dashboard](https://dashboard.stripe.com/settings/payment_methods). + #[serde(skip_serializing_if = "Option::is_none")] + pub payment_method_types: Option<&'a [&'a str]>, + /// Options to configure Radar. + /// Learn more about [Radar Sessions](https://stripe.com/docs/radar/radar-session). + #[serde(skip_serializing_if = "Option::is_none")] + pub radar_options: Option>, + /// Email address to send the receipt to. + /// If you specify `receipt_email` for a payment in live mode, you send a receipt regardless of your [email settings](https://dashboard.stripe.com/account/emails). + #[serde(skip_serializing_if = "Option::is_none")] + pub receipt_email: Option<&'a str>, + /// The URL to redirect your customer back to after they authenticate or cancel their payment on the payment method's app or site. + /// If you'd prefer to redirect to a mobile application, you can alternatively supply an application URI scheme. + /// This parameter can only be used with [`confirm=true`](https://stripe.com/docs/api/payment_intents/create#create_payment_intent-confirm). + #[serde(skip_serializing_if = "Option::is_none")] + pub return_url: Option<&'a str>, + /// Indicates that you intend to make future payments with this PaymentIntent's payment method. + /// + /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. + /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + /// + /// When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + #[serde(skip_serializing_if = "Option::is_none")] + pub setup_future_usage: Option, + /// Shipping information for this PaymentIntent. + #[serde(skip_serializing_if = "Option::is_none")] + pub shipping: Option>, + /// For card charges, use [statement_descriptor_suffix](https://stripe.com/docs/payments/account/statement-descriptors#dynamic). + /// Otherwise, you can use this value as the complete description of a charge on your customers' statements. + /// It must contain at least one letter and be 1–22 characters long. + #[serde(skip_serializing_if = "Option::is_none")] + pub statement_descriptor: Option<&'a str>, + /// Provides information about a card payment that customers see on their statements. + /// Concatenated with the prefix (shortened descriptor) or statement descriptor that’s set on the account to form the complete statement descriptor. + /// The concatenated descriptor must contain 1-22 characters. + #[serde(skip_serializing_if = "Option::is_none")] + pub statement_descriptor_suffix: Option<&'a str>, + /// The parameters that you can use to automatically create a Transfer. + /// Learn more about the [use case for connected accounts](https://stripe.com/docs/payments/connected-accounts). + #[serde(skip_serializing_if = "Option::is_none")] + pub transfer_data: Option>, + /// A string that identifies the resulting payment as part of a group. + /// Learn more about the [use case for connected accounts](https://stripe.com/docs/connect/separate-charges-and-transfers). + #[serde(skip_serializing_if = "Option::is_none")] + pub transfer_group: Option<&'a str>, + /// Set to `true` when confirming server-side and using Stripe.js, iOS, or Android client-side SDKs to handle the next actions. + #[serde(skip_serializing_if = "Option::is_none")] + pub use_stripe_sdk: Option, +} +impl<'a> CreatePaymentIntent<'a> { + pub fn new(amount: i64, currency: stripe_types::Currency) -> Self { + Self { + amount, + application_fee_amount: None, + automatic_payment_methods: None, + capture_method: None, + confirm: None, + confirmation_method: None, + currency, + customer: None, + description: None, + error_on_requires_action: None, + expand: None, + mandate: None, + mandate_data: None, + metadata: None, + off_session: None, + on_behalf_of: None, + payment_method: None, + payment_method_configuration: None, + payment_method_data: None, + payment_method_options: None, + payment_method_types: None, + radar_options: None, + receipt_email: None, + return_url: None, + setup_future_usage: None, + shipping: None, + statement_descriptor: None, + statement_descriptor_suffix: None, + transfer_data: None, + transfer_group: None, + use_stripe_sdk: None, + } + } +} +/// When you enable this parameter, this PaymentIntent accepts payment methods that you enable in the Dashboard and that are compatible with this PaymentIntent's other parameters. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreatePaymentIntentAutomaticPaymentMethods { + /// Controls whether this PaymentIntent will accept redirect-based payment methods. + /// + /// Redirect-based payment methods may require your customer to be redirected to a payment method's app or site for authentication or additional steps. + /// To [confirm](https://stripe.com/docs/api/payment_intents/confirm) this PaymentIntent, you may be required to provide a `return_url` to redirect customers back to your site after they authenticate or complete the payment. + #[serde(skip_serializing_if = "Option::is_none")] + pub allow_redirects: Option, + /// Whether this feature is enabled. + pub enabled: bool, +} +impl CreatePaymentIntentAutomaticPaymentMethods { + pub fn new(enabled: bool) -> Self { + Self { allow_redirects: None, enabled } + } +} +/// Controls whether this PaymentIntent will accept redirect-based payment methods. +/// +/// Redirect-based payment methods may require your customer to be redirected to a payment method's app or site for authentication or additional steps. +/// To [confirm](https://stripe.com/docs/api/payment_intents/confirm) this PaymentIntent, you may be required to provide a `return_url` to redirect customers back to your site after they authenticate or complete the payment. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreatePaymentIntentAutomaticPaymentMethodsAllowRedirects { + Always, + Never, +} +impl CreatePaymentIntentAutomaticPaymentMethodsAllowRedirects { + pub fn as_str(self) -> &'static str { + use CreatePaymentIntentAutomaticPaymentMethodsAllowRedirects::*; + match self { + Always => "always", + Never => "never", + } + } +} + +impl std::str::FromStr for CreatePaymentIntentAutomaticPaymentMethodsAllowRedirects { + type Err = (); + fn from_str(s: &str) -> Result { + use CreatePaymentIntentAutomaticPaymentMethodsAllowRedirects::*; + match s { + "always" => Ok(Always), + "never" => Ok(Never), + _ => Err(()), + } + } +} +impl std::fmt::Display for CreatePaymentIntentAutomaticPaymentMethodsAllowRedirects { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreatePaymentIntentAutomaticPaymentMethodsAllowRedirects { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreatePaymentIntentAutomaticPaymentMethodsAllowRedirects { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// This hash contains details about the Mandate to create. +/// This parameter can only be used with [`confirm=true`](https://stripe.com/docs/api/payment_intents/create#create_payment_intent-confirm). +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreatePaymentIntentMandateData<'a> { + /// This hash contains details about the customer acceptance of the Mandate. + pub customer_acceptance: CreatePaymentIntentMandateDataCustomerAcceptance<'a>, +} +impl<'a> CreatePaymentIntentMandateData<'a> { + pub fn new(customer_acceptance: CreatePaymentIntentMandateDataCustomerAcceptance<'a>) -> Self { + Self { customer_acceptance } + } +} +/// This hash contains details about the customer acceptance of the Mandate. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreatePaymentIntentMandateDataCustomerAcceptance<'a> { + /// The time at which the customer accepted the Mandate. + #[serde(skip_serializing_if = "Option::is_none")] + pub accepted_at: Option, + /// If this is a Mandate accepted offline, this hash contains details about the offline acceptance. + #[serde(skip_serializing_if = "Option::is_none")] + pub offline: Option<&'a serde_json::Value>, + /// If this is a Mandate accepted online, this hash contains details about the online acceptance. + #[serde(skip_serializing_if = "Option::is_none")] + pub online: Option>, + /// The type of customer acceptance information included with the Mandate. + /// One of `online` or `offline`. + #[serde(rename = "type")] + pub type_: CreatePaymentIntentMandateDataCustomerAcceptanceType, +} +impl<'a> CreatePaymentIntentMandateDataCustomerAcceptance<'a> { + pub fn new(type_: CreatePaymentIntentMandateDataCustomerAcceptanceType) -> Self { + Self { accepted_at: None, offline: None, online: None, type_ } + } +} +/// The type of customer acceptance information included with the Mandate. +/// One of `online` or `offline`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreatePaymentIntentMandateDataCustomerAcceptanceType { + Offline, + Online, +} +impl CreatePaymentIntentMandateDataCustomerAcceptanceType { + pub fn as_str(self) -> &'static str { + use CreatePaymentIntentMandateDataCustomerAcceptanceType::*; + match self { + Offline => "offline", + Online => "online", + } + } +} + +impl std::str::FromStr for CreatePaymentIntentMandateDataCustomerAcceptanceType { + type Err = (); + fn from_str(s: &str) -> Result { + use CreatePaymentIntentMandateDataCustomerAcceptanceType::*; + match s { + "offline" => Ok(Offline), + "online" => Ok(Online), + _ => Err(()), + } + } +} +impl std::fmt::Display for CreatePaymentIntentMandateDataCustomerAcceptanceType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreatePaymentIntentMandateDataCustomerAcceptanceType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreatePaymentIntentMandateDataCustomerAcceptanceType { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Set to `true` to indicate that the customer isn't in your checkout flow during this payment attempt and can't authenticate. +/// Use this parameter in scenarios where you collect card details and [charge them later](https://stripe.com/docs/payments/cards/charging-saved-cards). +/// This parameter can only be used with [`confirm=true`](https://stripe.com/docs/api/payment_intents/create#create_payment_intent-confirm). +#[derive(Copy, Clone, Debug, serde::Serialize)] +#[serde(untagged)] +pub enum CreatePaymentIntentOffSession { + Bool(bool), + OneOff, + Recurring, +} +/// If provided, this hash will be used to create a PaymentMethod. The new PaymentMethod will appear +/// in the [payment_method](https://stripe.com/docs/api/payment_intents/object#payment_intent_object-payment_method). +/// property on the PaymentIntent. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreatePaymentIntentPaymentMethodData<'a> { + /// If this is an `acss_debit` PaymentMethod, this hash contains details about the ACSS Debit payment method. + #[serde(skip_serializing_if = "Option::is_none")] + pub acss_debit: Option>, + /// If this is an `affirm` PaymentMethod, this hash contains details about the Affirm payment method. + #[serde(skip_serializing_if = "Option::is_none")] + pub affirm: Option<&'a serde_json::Value>, + /// If this is an `AfterpayClearpay` PaymentMethod, this hash contains details about the AfterpayClearpay payment method. + #[serde(skip_serializing_if = "Option::is_none")] + pub afterpay_clearpay: Option<&'a serde_json::Value>, + /// If this is an `Alipay` PaymentMethod, this hash contains details about the Alipay payment method. + #[serde(skip_serializing_if = "Option::is_none")] + pub alipay: Option<&'a serde_json::Value>, + /// If this is an `au_becs_debit` PaymentMethod, this hash contains details about the bank account. + #[serde(skip_serializing_if = "Option::is_none")] + pub au_becs_debit: Option>, + /// If this is a `bacs_debit` PaymentMethod, this hash contains details about the Bacs Direct Debit bank account. + #[serde(skip_serializing_if = "Option::is_none")] + pub bacs_debit: Option>, + /// If this is a `bancontact` PaymentMethod, this hash contains details about the Bancontact payment method. + #[serde(skip_serializing_if = "Option::is_none")] + pub bancontact: Option<&'a serde_json::Value>, + /// Billing information associated with the PaymentMethod that may be used or required by particular types of payment methods. + #[serde(skip_serializing_if = "Option::is_none")] + pub billing_details: Option>, + /// If this is a `blik` PaymentMethod, this hash contains details about the BLIK payment method. + #[serde(skip_serializing_if = "Option::is_none")] + pub blik: Option<&'a serde_json::Value>, + /// If this is a `boleto` PaymentMethod, this hash contains details about the Boleto payment method. + #[serde(skip_serializing_if = "Option::is_none")] + pub boleto: Option>, + /// If this is a `cashapp` PaymentMethod, this hash contains details about the Cash App Pay payment method. + #[serde(skip_serializing_if = "Option::is_none")] + pub cashapp: Option<&'a serde_json::Value>, + /// If this is a `customer_balance` PaymentMethod, this hash contains details about the CustomerBalance payment method. + #[serde(skip_serializing_if = "Option::is_none")] + pub customer_balance: Option<&'a serde_json::Value>, + /// If this is an `eps` PaymentMethod, this hash contains details about the EPS payment method. + #[serde(skip_serializing_if = "Option::is_none")] + pub eps: Option, + /// If this is an `fpx` PaymentMethod, this hash contains details about the FPX payment method. + #[serde(skip_serializing_if = "Option::is_none")] + pub fpx: Option, + /// If this is a `giropay` PaymentMethod, this hash contains details about the Giropay payment method. + #[serde(skip_serializing_if = "Option::is_none")] + pub giropay: Option<&'a serde_json::Value>, + /// If this is a `grabpay` PaymentMethod, this hash contains details about the GrabPay payment method. + #[serde(skip_serializing_if = "Option::is_none")] + pub grabpay: Option<&'a serde_json::Value>, + /// If this is an `ideal` PaymentMethod, this hash contains details about the iDEAL payment method. + #[serde(skip_serializing_if = "Option::is_none")] + pub ideal: Option, + /// If this is an `interac_present` PaymentMethod, this hash contains details about the Interac Present payment method. + #[serde(skip_serializing_if = "Option::is_none")] + pub interac_present: Option<&'a serde_json::Value>, + /// If this is a `klarna` PaymentMethod, this hash contains details about the Klarna payment method. + #[serde(skip_serializing_if = "Option::is_none")] + pub klarna: Option, + /// If this is a `konbini` PaymentMethod, this hash contains details about the Konbini payment method. + #[serde(skip_serializing_if = "Option::is_none")] + pub konbini: Option<&'a serde_json::Value>, + /// If this is an `Link` PaymentMethod, this hash contains details about the Link payment method. + #[serde(skip_serializing_if = "Option::is_none")] + pub link: Option<&'a serde_json::Value>, + /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. + /// This can be useful for storing additional information about the object in a structured format. + /// Individual keys can be unset by posting an empty value to them. + /// All keys can be unset by posting an empty value to `metadata`. + #[serde(skip_serializing_if = "Option::is_none")] + pub metadata: Option<&'a std::collections::HashMap>, + /// If this is an `oxxo` PaymentMethod, this hash contains details about the OXXO payment method. + #[serde(skip_serializing_if = "Option::is_none")] + pub oxxo: Option<&'a serde_json::Value>, + /// If this is a `p24` PaymentMethod, this hash contains details about the P24 payment method. + #[serde(skip_serializing_if = "Option::is_none")] + pub p24: Option, + /// If this is a `paynow` PaymentMethod, this hash contains details about the PayNow payment method. + #[serde(skip_serializing_if = "Option::is_none")] + pub paynow: Option<&'a serde_json::Value>, + /// If this is a `paypal` PaymentMethod, this hash contains details about the PayPal payment method. + #[serde(skip_serializing_if = "Option::is_none")] + pub paypal: Option<&'a serde_json::Value>, + /// If this is a `pix` PaymentMethod, this hash contains details about the Pix payment method. + #[serde(skip_serializing_if = "Option::is_none")] + pub pix: Option<&'a serde_json::Value>, + /// If this is a `promptpay` PaymentMethod, this hash contains details about the PromptPay payment method. + #[serde(skip_serializing_if = "Option::is_none")] + pub promptpay: Option<&'a serde_json::Value>, + /// Options to configure Radar. + /// See [Radar Session](https://stripe.com/docs/radar/radar-session) for more information. + #[serde(skip_serializing_if = "Option::is_none")] + pub radar_options: Option>, + /// If this is a `Revolut Pay` PaymentMethod, this hash contains details about the Revolut Pay payment method. + #[serde(skip_serializing_if = "Option::is_none")] + pub revolut_pay: Option<&'a serde_json::Value>, + /// If this is a `sepa_debit` PaymentMethod, this hash contains details about the SEPA debit bank account. + #[serde(skip_serializing_if = "Option::is_none")] + pub sepa_debit: Option>, + /// If this is a `sofort` PaymentMethod, this hash contains details about the SOFORT payment method. + #[serde(skip_serializing_if = "Option::is_none")] + pub sofort: Option, + /// If this is a `swish` PaymentMethod, this hash contains details about the Swish payment method. + #[serde(skip_serializing_if = "Option::is_none")] + pub swish: Option<&'a serde_json::Value>, + /// The type of the PaymentMethod. + /// An additional hash is included on the PaymentMethod with a name matching this value. + /// It contains additional information specific to the PaymentMethod type. + #[serde(rename = "type")] + pub type_: CreatePaymentIntentPaymentMethodDataType, + /// If this is an `us_bank_account` PaymentMethod, this hash contains details about the US bank account payment method. + #[serde(skip_serializing_if = "Option::is_none")] + pub us_bank_account: Option>, + /// If this is an `wechat_pay` PaymentMethod, this hash contains details about the wechat_pay payment method. + #[serde(skip_serializing_if = "Option::is_none")] + pub wechat_pay: Option<&'a serde_json::Value>, + /// If this is a `zip` PaymentMethod, this hash contains details about the Zip payment method. + #[serde(skip_serializing_if = "Option::is_none")] + pub zip: Option<&'a serde_json::Value>, +} +impl<'a> CreatePaymentIntentPaymentMethodData<'a> { + pub fn new(type_: CreatePaymentIntentPaymentMethodDataType) -> Self { + Self { + acss_debit: None, + affirm: None, + afterpay_clearpay: None, + alipay: None, + au_becs_debit: None, + bacs_debit: None, + bancontact: None, + billing_details: None, + blik: None, + boleto: None, + cashapp: None, + customer_balance: None, + eps: None, + fpx: None, + giropay: None, + grabpay: None, + ideal: None, + interac_present: None, + klarna: None, + konbini: None, + link: None, + metadata: None, + oxxo: None, + p24: None, + paynow: None, + paypal: None, + pix: None, + promptpay: None, + radar_options: None, + revolut_pay: None, + sepa_debit: None, + sofort: None, + swish: None, + type_, + us_bank_account: None, + wechat_pay: None, + zip: None, + } + } +} +/// If this is an `au_becs_debit` PaymentMethod, this hash contains details about the bank account. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreatePaymentIntentPaymentMethodDataAuBecsDebit<'a> { + /// The account number for the bank account. + pub account_number: &'a str, + /// Bank-State-Branch number of the bank account. + pub bsb_number: &'a str, +} +impl<'a> CreatePaymentIntentPaymentMethodDataAuBecsDebit<'a> { + pub fn new(account_number: &'a str, bsb_number: &'a str) -> Self { + Self { account_number, bsb_number } + } +} +/// If this is a `bacs_debit` PaymentMethod, this hash contains details about the Bacs Direct Debit bank account. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreatePaymentIntentPaymentMethodDataBacsDebit<'a> { + /// Account number of the bank account that the funds will be debited from. + #[serde(skip_serializing_if = "Option::is_none")] + pub account_number: Option<&'a str>, + /// Sort code of the bank account. (e.g., `10-20-30`) + #[serde(skip_serializing_if = "Option::is_none")] + pub sort_code: Option<&'a str>, +} +impl<'a> CreatePaymentIntentPaymentMethodDataBacsDebit<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// Billing information associated with the PaymentMethod that may be used or required by particular types of payment methods. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreatePaymentIntentPaymentMethodDataBillingDetails<'a> { + /// Billing address. + #[serde(skip_serializing_if = "Option::is_none")] + pub address: Option>, + /// Email address. + #[serde(skip_serializing_if = "Option::is_none")] + pub email: Option<&'a str>, + /// Full name. + #[serde(skip_serializing_if = "Option::is_none")] + pub name: Option<&'a str>, + /// Billing phone number (including extension). + #[serde(skip_serializing_if = "Option::is_none")] + pub phone: Option<&'a str>, +} +impl<'a> CreatePaymentIntentPaymentMethodDataBillingDetails<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// Billing address. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreatePaymentIntentPaymentMethodDataBillingDetailsAddress<'a> { + /// City, district, suburb, town, or village. + #[serde(skip_serializing_if = "Option::is_none")] + pub city: Option<&'a str>, + /// Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). + #[serde(skip_serializing_if = "Option::is_none")] + pub country: Option<&'a str>, + /// Address line 1 (e.g., street, PO Box, or company name). + #[serde(skip_serializing_if = "Option::is_none")] + pub line1: Option<&'a str>, + /// Address line 2 (e.g., apartment, suite, unit, or building). + #[serde(skip_serializing_if = "Option::is_none")] + pub line2: Option<&'a str>, + /// ZIP or postal code. + #[serde(skip_serializing_if = "Option::is_none")] + pub postal_code: Option<&'a str>, + /// State, county, province, or region. + #[serde(skip_serializing_if = "Option::is_none")] + pub state: Option<&'a str>, +} +impl<'a> CreatePaymentIntentPaymentMethodDataBillingDetailsAddress<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// If this is a `boleto` PaymentMethod, this hash contains details about the Boleto payment method. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreatePaymentIntentPaymentMethodDataBoleto<'a> { + /// The tax ID of the customer (CPF for individual consumers or CNPJ for businesses consumers) + pub tax_id: &'a str, +} +impl<'a> CreatePaymentIntentPaymentMethodDataBoleto<'a> { + pub fn new(tax_id: &'a str) -> Self { + Self { tax_id } + } +} +/// If this is an `eps` PaymentMethod, this hash contains details about the EPS payment method. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreatePaymentIntentPaymentMethodDataEps { + /// The customer's bank. + #[serde(skip_serializing_if = "Option::is_none")] + pub bank: Option, +} +impl CreatePaymentIntentPaymentMethodDataEps { + pub fn new() -> Self { + Self::default() + } +} +/// The customer's bank. +#[derive(Copy, Clone, Eq, PartialEq)] +#[non_exhaustive] +pub enum CreatePaymentIntentPaymentMethodDataEpsBank { + ArzteUndApothekerBank, + AustrianAnadiBankAg, + BankAustria, + BankhausCarlSpangler, + BankhausSchelhammerUndSchatteraAg, + BawagPskAg, + BksBankAg, + BrullKallmusBankAg, + BtvVierLanderBank, + CapitalBankGraweGruppeAg, + DeutscheBankAg, + Dolomitenbank, + EasybankAg, + ErsteBankUndSparkassen, + HypoAlpeadriabankInternationalAg, + HypoBankBurgenlandAktiengesellschaft, + HypoNoeLbFurNiederosterreichUWien, + HypoOberosterreichSalzburgSteiermark, + HypoTirolBankAg, + HypoVorarlbergBankAg, + MarchfelderBank, + OberbankAg, + RaiffeisenBankengruppeOsterreich, + SchoellerbankAg, + SpardaBankWien, + VolksbankGruppe, + VolkskreditbankAg, + VrBankBraunau, + /// An unrecognized value from Stripe. Should not be used as a request parameter. + Unknown, +} +impl CreatePaymentIntentPaymentMethodDataEpsBank { + pub fn as_str(self) -> &'static str { + use CreatePaymentIntentPaymentMethodDataEpsBank::*; + match self { + ArzteUndApothekerBank => "arzte_und_apotheker_bank", + AustrianAnadiBankAg => "austrian_anadi_bank_ag", + BankAustria => "bank_austria", + BankhausCarlSpangler => "bankhaus_carl_spangler", + BankhausSchelhammerUndSchatteraAg => "bankhaus_schelhammer_und_schattera_ag", + BawagPskAg => "bawag_psk_ag", + BksBankAg => "bks_bank_ag", + BrullKallmusBankAg => "brull_kallmus_bank_ag", + BtvVierLanderBank => "btv_vier_lander_bank", + CapitalBankGraweGruppeAg => "capital_bank_grawe_gruppe_ag", + DeutscheBankAg => "deutsche_bank_ag", + Dolomitenbank => "dolomitenbank", + EasybankAg => "easybank_ag", + ErsteBankUndSparkassen => "erste_bank_und_sparkassen", + HypoAlpeadriabankInternationalAg => "hypo_alpeadriabank_international_ag", + HypoBankBurgenlandAktiengesellschaft => "hypo_bank_burgenland_aktiengesellschaft", + HypoNoeLbFurNiederosterreichUWien => "hypo_noe_lb_fur_niederosterreich_u_wien", + HypoOberosterreichSalzburgSteiermark => "hypo_oberosterreich_salzburg_steiermark", + HypoTirolBankAg => "hypo_tirol_bank_ag", + HypoVorarlbergBankAg => "hypo_vorarlberg_bank_ag", + MarchfelderBank => "marchfelder_bank", + OberbankAg => "oberbank_ag", + RaiffeisenBankengruppeOsterreich => "raiffeisen_bankengruppe_osterreich", + SchoellerbankAg => "schoellerbank_ag", + SpardaBankWien => "sparda_bank_wien", + VolksbankGruppe => "volksbank_gruppe", + VolkskreditbankAg => "volkskreditbank_ag", + VrBankBraunau => "vr_bank_braunau", + Unknown => "unknown", + } + } +} + +impl std::str::FromStr for CreatePaymentIntentPaymentMethodDataEpsBank { + type Err = (); + fn from_str(s: &str) -> Result { + use CreatePaymentIntentPaymentMethodDataEpsBank::*; + match s { + "arzte_und_apotheker_bank" => Ok(ArzteUndApothekerBank), + "austrian_anadi_bank_ag" => Ok(AustrianAnadiBankAg), + "bank_austria" => Ok(BankAustria), + "bankhaus_carl_spangler" => Ok(BankhausCarlSpangler), + "bankhaus_schelhammer_und_schattera_ag" => Ok(BankhausSchelhammerUndSchatteraAg), + "bawag_psk_ag" => Ok(BawagPskAg), + "bks_bank_ag" => Ok(BksBankAg), + "brull_kallmus_bank_ag" => Ok(BrullKallmusBankAg), + "btv_vier_lander_bank" => Ok(BtvVierLanderBank), + "capital_bank_grawe_gruppe_ag" => Ok(CapitalBankGraweGruppeAg), + "deutsche_bank_ag" => Ok(DeutscheBankAg), + "dolomitenbank" => Ok(Dolomitenbank), + "easybank_ag" => Ok(EasybankAg), + "erste_bank_und_sparkassen" => Ok(ErsteBankUndSparkassen), + "hypo_alpeadriabank_international_ag" => Ok(HypoAlpeadriabankInternationalAg), + "hypo_bank_burgenland_aktiengesellschaft" => Ok(HypoBankBurgenlandAktiengesellschaft), + "hypo_noe_lb_fur_niederosterreich_u_wien" => Ok(HypoNoeLbFurNiederosterreichUWien), + "hypo_oberosterreich_salzburg_steiermark" => Ok(HypoOberosterreichSalzburgSteiermark), + "hypo_tirol_bank_ag" => Ok(HypoTirolBankAg), + "hypo_vorarlberg_bank_ag" => Ok(HypoVorarlbergBankAg), + "marchfelder_bank" => Ok(MarchfelderBank), + "oberbank_ag" => Ok(OberbankAg), + "raiffeisen_bankengruppe_osterreich" => Ok(RaiffeisenBankengruppeOsterreich), + "schoellerbank_ag" => Ok(SchoellerbankAg), + "sparda_bank_wien" => Ok(SpardaBankWien), + "volksbank_gruppe" => Ok(VolksbankGruppe), + "volkskreditbank_ag" => Ok(VolkskreditbankAg), + "vr_bank_braunau" => Ok(VrBankBraunau), + _ => Err(()), + } + } +} +impl std::fmt::Display for CreatePaymentIntentPaymentMethodDataEpsBank { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreatePaymentIntentPaymentMethodDataEpsBank { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreatePaymentIntentPaymentMethodDataEpsBank { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// If this is an `fpx` PaymentMethod, this hash contains details about the FPX payment method. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreatePaymentIntentPaymentMethodDataFpx { + /// Account holder type for FPX transaction + #[serde(skip_serializing_if = "Option::is_none")] + pub account_holder_type: Option, + /// The customer's bank. + pub bank: CreatePaymentIntentPaymentMethodDataFpxBank, +} +impl CreatePaymentIntentPaymentMethodDataFpx { + pub fn new(bank: CreatePaymentIntentPaymentMethodDataFpxBank) -> Self { + Self { account_holder_type: None, bank } + } +} +/// Account holder type for FPX transaction +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreatePaymentIntentPaymentMethodDataFpxAccountHolderType { + Company, + Individual, +} +impl CreatePaymentIntentPaymentMethodDataFpxAccountHolderType { + pub fn as_str(self) -> &'static str { + use CreatePaymentIntentPaymentMethodDataFpxAccountHolderType::*; + match self { + Company => "company", + Individual => "individual", + } + } +} + +impl std::str::FromStr for CreatePaymentIntentPaymentMethodDataFpxAccountHolderType { + type Err = (); + fn from_str(s: &str) -> Result { + use CreatePaymentIntentPaymentMethodDataFpxAccountHolderType::*; + match s { + "company" => Ok(Company), + "individual" => Ok(Individual), + _ => Err(()), + } + } +} +impl std::fmt::Display for CreatePaymentIntentPaymentMethodDataFpxAccountHolderType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreatePaymentIntentPaymentMethodDataFpxAccountHolderType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreatePaymentIntentPaymentMethodDataFpxAccountHolderType { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// The customer's bank. +#[derive(Copy, Clone, Eq, PartialEq)] +#[non_exhaustive] +pub enum CreatePaymentIntentPaymentMethodDataFpxBank { + AffinBank, + Agrobank, + AllianceBank, + Ambank, + BankIslam, + BankMuamalat, + BankOfChina, + BankRakyat, + Bsn, + Cimb, + DeutscheBank, + HongLeongBank, + Hsbc, + Kfh, + Maybank2e, + Maybank2u, + Ocbc, + PbEnterprise, + PublicBank, + Rhb, + StandardChartered, + Uob, + /// An unrecognized value from Stripe. Should not be used as a request parameter. + Unknown, +} +impl CreatePaymentIntentPaymentMethodDataFpxBank { + pub fn as_str(self) -> &'static str { + use CreatePaymentIntentPaymentMethodDataFpxBank::*; + match self { + AffinBank => "affin_bank", + Agrobank => "agrobank", + AllianceBank => "alliance_bank", + Ambank => "ambank", + BankIslam => "bank_islam", + BankMuamalat => "bank_muamalat", + BankOfChina => "bank_of_china", + BankRakyat => "bank_rakyat", + Bsn => "bsn", + Cimb => "cimb", + DeutscheBank => "deutsche_bank", + HongLeongBank => "hong_leong_bank", + Hsbc => "hsbc", + Kfh => "kfh", + Maybank2e => "maybank2e", + Maybank2u => "maybank2u", + Ocbc => "ocbc", + PbEnterprise => "pb_enterprise", + PublicBank => "public_bank", + Rhb => "rhb", + StandardChartered => "standard_chartered", + Uob => "uob", + Unknown => "unknown", + } + } +} + +impl std::str::FromStr for CreatePaymentIntentPaymentMethodDataFpxBank { + type Err = (); + fn from_str(s: &str) -> Result { + use CreatePaymentIntentPaymentMethodDataFpxBank::*; + match s { + "affin_bank" => Ok(AffinBank), + "agrobank" => Ok(Agrobank), + "alliance_bank" => Ok(AllianceBank), + "ambank" => Ok(Ambank), + "bank_islam" => Ok(BankIslam), + "bank_muamalat" => Ok(BankMuamalat), + "bank_of_china" => Ok(BankOfChina), + "bank_rakyat" => Ok(BankRakyat), + "bsn" => Ok(Bsn), + "cimb" => Ok(Cimb), + "deutsche_bank" => Ok(DeutscheBank), + "hong_leong_bank" => Ok(HongLeongBank), + "hsbc" => Ok(Hsbc), + "kfh" => Ok(Kfh), + "maybank2e" => Ok(Maybank2e), + "maybank2u" => Ok(Maybank2u), + "ocbc" => Ok(Ocbc), + "pb_enterprise" => Ok(PbEnterprise), + "public_bank" => Ok(PublicBank), + "rhb" => Ok(Rhb), + "standard_chartered" => Ok(StandardChartered), + "uob" => Ok(Uob), + _ => Err(()), + } + } +} +impl std::fmt::Display for CreatePaymentIntentPaymentMethodDataFpxBank { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreatePaymentIntentPaymentMethodDataFpxBank { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreatePaymentIntentPaymentMethodDataFpxBank { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// If this is an `ideal` PaymentMethod, this hash contains details about the iDEAL payment method. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreatePaymentIntentPaymentMethodDataIdeal { + /// The customer's bank. + #[serde(skip_serializing_if = "Option::is_none")] + pub bank: Option, +} +impl CreatePaymentIntentPaymentMethodDataIdeal { + pub fn new() -> Self { + Self::default() + } +} +/// The customer's bank. +#[derive(Copy, Clone, Eq, PartialEq)] +#[non_exhaustive] +pub enum CreatePaymentIntentPaymentMethodDataIdealBank { + AbnAmro, + AsnBank, + Bunq, + Handelsbanken, + Ing, + Knab, + Moneyou, + N26, + Nn, + Rabobank, + Regiobank, + Revolut, + SnsBank, + TriodosBank, + VanLanschot, + Yoursafe, + /// An unrecognized value from Stripe. Should not be used as a request parameter. + Unknown, +} +impl CreatePaymentIntentPaymentMethodDataIdealBank { + pub fn as_str(self) -> &'static str { + use CreatePaymentIntentPaymentMethodDataIdealBank::*; + match self { + AbnAmro => "abn_amro", + AsnBank => "asn_bank", + Bunq => "bunq", + Handelsbanken => "handelsbanken", + Ing => "ing", + Knab => "knab", + Moneyou => "moneyou", + N26 => "n26", + Nn => "nn", + Rabobank => "rabobank", + Regiobank => "regiobank", + Revolut => "revolut", + SnsBank => "sns_bank", + TriodosBank => "triodos_bank", + VanLanschot => "van_lanschot", + Yoursafe => "yoursafe", + Unknown => "unknown", + } + } +} + +impl std::str::FromStr for CreatePaymentIntentPaymentMethodDataIdealBank { + type Err = (); + fn from_str(s: &str) -> Result { + use CreatePaymentIntentPaymentMethodDataIdealBank::*; + match s { + "abn_amro" => Ok(AbnAmro), + "asn_bank" => Ok(AsnBank), + "bunq" => Ok(Bunq), + "handelsbanken" => Ok(Handelsbanken), + "ing" => Ok(Ing), + "knab" => Ok(Knab), + "moneyou" => Ok(Moneyou), + "n26" => Ok(N26), + "nn" => Ok(Nn), + "rabobank" => Ok(Rabobank), + "regiobank" => Ok(Regiobank), + "revolut" => Ok(Revolut), + "sns_bank" => Ok(SnsBank), + "triodos_bank" => Ok(TriodosBank), + "van_lanschot" => Ok(VanLanschot), + "yoursafe" => Ok(Yoursafe), + _ => Err(()), + } + } +} +impl std::fmt::Display for CreatePaymentIntentPaymentMethodDataIdealBank { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreatePaymentIntentPaymentMethodDataIdealBank { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreatePaymentIntentPaymentMethodDataIdealBank { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// If this is a `klarna` PaymentMethod, this hash contains details about the Klarna payment method. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreatePaymentIntentPaymentMethodDataKlarna { + /// Customer's date of birth + #[serde(skip_serializing_if = "Option::is_none")] + pub dob: Option, +} +impl CreatePaymentIntentPaymentMethodDataKlarna { + pub fn new() -> Self { + Self::default() + } +} +/// If this is a `p24` PaymentMethod, this hash contains details about the P24 payment method. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreatePaymentIntentPaymentMethodDataP24 { + /// The customer's bank. + #[serde(skip_serializing_if = "Option::is_none")] + pub bank: Option, +} +impl CreatePaymentIntentPaymentMethodDataP24 { + pub fn new() -> Self { + Self::default() + } +} +/// The customer's bank. +#[derive(Copy, Clone, Eq, PartialEq)] +#[non_exhaustive] +pub enum CreatePaymentIntentPaymentMethodDataP24Bank { + AliorBank, + BankMillennium, + BankNowyBfgSa, + BankPekaoSa, + BankiSpbdzielcze, + Blik, + BnpParibas, + Boz, + CitiHandlowy, + CreditAgricole, + Envelobank, + EtransferPocztowy24, + GetinBank, + Ideabank, + Ing, + Inteligo, + MbankMtransfer, + NestPrzelew, + NoblePay, + PbacZIpko, + PlusBank, + SantanderPrzelew24, + TmobileUsbugiBankowe, + ToyotaBank, + Velobank, + VolkswagenBank, + /// An unrecognized value from Stripe. Should not be used as a request parameter. + Unknown, +} +impl CreatePaymentIntentPaymentMethodDataP24Bank { + pub fn as_str(self) -> &'static str { + use CreatePaymentIntentPaymentMethodDataP24Bank::*; + match self { + AliorBank => "alior_bank", + BankMillennium => "bank_millennium", + BankNowyBfgSa => "bank_nowy_bfg_sa", + BankPekaoSa => "bank_pekao_sa", + BankiSpbdzielcze => "banki_spbdzielcze", + Blik => "blik", + BnpParibas => "bnp_paribas", + Boz => "boz", + CitiHandlowy => "citi_handlowy", + CreditAgricole => "credit_agricole", + Envelobank => "envelobank", + EtransferPocztowy24 => "etransfer_pocztowy24", + GetinBank => "getin_bank", + Ideabank => "ideabank", + Ing => "ing", + Inteligo => "inteligo", + MbankMtransfer => "mbank_mtransfer", + NestPrzelew => "nest_przelew", + NoblePay => "noble_pay", + PbacZIpko => "pbac_z_ipko", + PlusBank => "plus_bank", + SantanderPrzelew24 => "santander_przelew24", + TmobileUsbugiBankowe => "tmobile_usbugi_bankowe", + ToyotaBank => "toyota_bank", + Velobank => "velobank", + VolkswagenBank => "volkswagen_bank", + Unknown => "unknown", + } + } +} + +impl std::str::FromStr for CreatePaymentIntentPaymentMethodDataP24Bank { + type Err = (); + fn from_str(s: &str) -> Result { + use CreatePaymentIntentPaymentMethodDataP24Bank::*; + match s { + "alior_bank" => Ok(AliorBank), + "bank_millennium" => Ok(BankMillennium), + "bank_nowy_bfg_sa" => Ok(BankNowyBfgSa), + "bank_pekao_sa" => Ok(BankPekaoSa), + "banki_spbdzielcze" => Ok(BankiSpbdzielcze), + "blik" => Ok(Blik), + "bnp_paribas" => Ok(BnpParibas), + "boz" => Ok(Boz), + "citi_handlowy" => Ok(CitiHandlowy), + "credit_agricole" => Ok(CreditAgricole), + "envelobank" => Ok(Envelobank), + "etransfer_pocztowy24" => Ok(EtransferPocztowy24), + "getin_bank" => Ok(GetinBank), + "ideabank" => Ok(Ideabank), + "ing" => Ok(Ing), + "inteligo" => Ok(Inteligo), + "mbank_mtransfer" => Ok(MbankMtransfer), + "nest_przelew" => Ok(NestPrzelew), + "noble_pay" => Ok(NoblePay), + "pbac_z_ipko" => Ok(PbacZIpko), + "plus_bank" => Ok(PlusBank), + "santander_przelew24" => Ok(SantanderPrzelew24), + "tmobile_usbugi_bankowe" => Ok(TmobileUsbugiBankowe), + "toyota_bank" => Ok(ToyotaBank), + "velobank" => Ok(Velobank), + "volkswagen_bank" => Ok(VolkswagenBank), + _ => Err(()), + } + } +} +impl std::fmt::Display for CreatePaymentIntentPaymentMethodDataP24Bank { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreatePaymentIntentPaymentMethodDataP24Bank { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreatePaymentIntentPaymentMethodDataP24Bank { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Options to configure Radar. +/// See [Radar Session](https://stripe.com/docs/radar/radar-session) for more information. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreatePaymentIntentPaymentMethodDataRadarOptions<'a> { + /// A [Radar Session](https://stripe.com/docs/radar/radar-session) is a snapshot of the browser metadata and device details that help Radar make more accurate predictions on your payments. + #[serde(skip_serializing_if = "Option::is_none")] + pub session: Option<&'a str>, +} +impl<'a> CreatePaymentIntentPaymentMethodDataRadarOptions<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// If this is a `sepa_debit` PaymentMethod, this hash contains details about the SEPA debit bank account. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreatePaymentIntentPaymentMethodDataSepaDebit<'a> { + /// IBAN of the bank account. + pub iban: &'a str, +} +impl<'a> CreatePaymentIntentPaymentMethodDataSepaDebit<'a> { + pub fn new(iban: &'a str) -> Self { + Self { iban } + } +} +/// If this is a `sofort` PaymentMethod, this hash contains details about the SOFORT payment method. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreatePaymentIntentPaymentMethodDataSofort { + /// Two-letter ISO code representing the country the bank account is located in. + pub country: CreatePaymentIntentPaymentMethodDataSofortCountry, +} +impl CreatePaymentIntentPaymentMethodDataSofort { + pub fn new(country: CreatePaymentIntentPaymentMethodDataSofortCountry) -> Self { + Self { country } + } +} +/// Two-letter ISO code representing the country the bank account is located in. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreatePaymentIntentPaymentMethodDataSofortCountry { + At, + Be, + De, + Es, + It, + Nl, +} +impl CreatePaymentIntentPaymentMethodDataSofortCountry { + pub fn as_str(self) -> &'static str { + use CreatePaymentIntentPaymentMethodDataSofortCountry::*; + match self { + At => "AT", + Be => "BE", + De => "DE", + Es => "ES", + It => "IT", + Nl => "NL", + } + } +} + +impl std::str::FromStr for CreatePaymentIntentPaymentMethodDataSofortCountry { + type Err = (); + fn from_str(s: &str) -> Result { + use CreatePaymentIntentPaymentMethodDataSofortCountry::*; + match s { + "AT" => Ok(At), + "BE" => Ok(Be), + "DE" => Ok(De), + "ES" => Ok(Es), + "IT" => Ok(It), + "NL" => Ok(Nl), + _ => Err(()), + } + } +} +impl std::fmt::Display for CreatePaymentIntentPaymentMethodDataSofortCountry { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreatePaymentIntentPaymentMethodDataSofortCountry { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreatePaymentIntentPaymentMethodDataSofortCountry { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// The type of the PaymentMethod. +/// An additional hash is included on the PaymentMethod with a name matching this value. +/// It contains additional information specific to the PaymentMethod type. +#[derive(Copy, Clone, Eq, PartialEq)] +#[non_exhaustive] +pub enum CreatePaymentIntentPaymentMethodDataType { + AcssDebit, + Affirm, + AfterpayClearpay, + Alipay, + AuBecsDebit, + BacsDebit, + Bancontact, + Blik, + Boleto, + Cashapp, + CustomerBalance, + Eps, + Fpx, + Giropay, + Grabpay, + Ideal, + Klarna, + Konbini, + Link, + Oxxo, + P24, + Paynow, + Paypal, + Pix, + Promptpay, + RevolutPay, + SepaDebit, + Sofort, + Swish, + UsBankAccount, + WechatPay, + Zip, + /// An unrecognized value from Stripe. Should not be used as a request parameter. + Unknown, +} +impl CreatePaymentIntentPaymentMethodDataType { + pub fn as_str(self) -> &'static str { + use CreatePaymentIntentPaymentMethodDataType::*; + match self { + AcssDebit => "acss_debit", + Affirm => "affirm", + AfterpayClearpay => "afterpay_clearpay", + Alipay => "alipay", + AuBecsDebit => "au_becs_debit", + BacsDebit => "bacs_debit", + Bancontact => "bancontact", + Blik => "blik", + Boleto => "boleto", + Cashapp => "cashapp", + CustomerBalance => "customer_balance", + Eps => "eps", + Fpx => "fpx", + Giropay => "giropay", + Grabpay => "grabpay", + Ideal => "ideal", + Klarna => "klarna", + Konbini => "konbini", + Link => "link", + Oxxo => "oxxo", + P24 => "p24", + Paynow => "paynow", + Paypal => "paypal", + Pix => "pix", + Promptpay => "promptpay", + RevolutPay => "revolut_pay", + SepaDebit => "sepa_debit", + Sofort => "sofort", + Swish => "swish", + UsBankAccount => "us_bank_account", + WechatPay => "wechat_pay", + Zip => "zip", + Unknown => "unknown", + } + } +} + +impl std::str::FromStr for CreatePaymentIntentPaymentMethodDataType { + type Err = (); + fn from_str(s: &str) -> Result { + use CreatePaymentIntentPaymentMethodDataType::*; + match s { + "acss_debit" => Ok(AcssDebit), + "affirm" => Ok(Affirm), + "afterpay_clearpay" => Ok(AfterpayClearpay), + "alipay" => Ok(Alipay), + "au_becs_debit" => Ok(AuBecsDebit), + "bacs_debit" => Ok(BacsDebit), + "bancontact" => Ok(Bancontact), + "blik" => Ok(Blik), + "boleto" => Ok(Boleto), + "cashapp" => Ok(Cashapp), + "customer_balance" => Ok(CustomerBalance), + "eps" => Ok(Eps), + "fpx" => Ok(Fpx), + "giropay" => Ok(Giropay), + "grabpay" => Ok(Grabpay), + "ideal" => Ok(Ideal), + "klarna" => Ok(Klarna), + "konbini" => Ok(Konbini), + "link" => Ok(Link), + "oxxo" => Ok(Oxxo), + "p24" => Ok(P24), + "paynow" => Ok(Paynow), + "paypal" => Ok(Paypal), + "pix" => Ok(Pix), + "promptpay" => Ok(Promptpay), + "revolut_pay" => Ok(RevolutPay), + "sepa_debit" => Ok(SepaDebit), + "sofort" => Ok(Sofort), + "swish" => Ok(Swish), + "us_bank_account" => Ok(UsBankAccount), + "wechat_pay" => Ok(WechatPay), + "zip" => Ok(Zip), + _ => Err(()), + } + } +} +impl std::fmt::Display for CreatePaymentIntentPaymentMethodDataType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreatePaymentIntentPaymentMethodDataType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreatePaymentIntentPaymentMethodDataType { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// If this is an `us_bank_account` PaymentMethod, this hash contains details about the US bank account payment method. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreatePaymentIntentPaymentMethodDataUsBankAccount<'a> { + /// Account holder type: individual or company. + #[serde(skip_serializing_if = "Option::is_none")] + pub account_holder_type: + Option, + /// Account number of the bank account. + #[serde(skip_serializing_if = "Option::is_none")] + pub account_number: Option<&'a str>, + /// Account type: checkings or savings. Defaults to checking if omitted. + #[serde(skip_serializing_if = "Option::is_none")] + pub account_type: Option, + /// The ID of a Financial Connections Account to use as a payment method. + #[serde(skip_serializing_if = "Option::is_none")] + pub financial_connections_account: Option<&'a str>, + /// Routing number of the bank account. + #[serde(skip_serializing_if = "Option::is_none")] + pub routing_number: Option<&'a str>, +} +impl<'a> CreatePaymentIntentPaymentMethodDataUsBankAccount<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// Account holder type: individual or company. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreatePaymentIntentPaymentMethodDataUsBankAccountAccountHolderType { + Company, + Individual, +} +impl CreatePaymentIntentPaymentMethodDataUsBankAccountAccountHolderType { + pub fn as_str(self) -> &'static str { + use CreatePaymentIntentPaymentMethodDataUsBankAccountAccountHolderType::*; + match self { + Company => "company", + Individual => "individual", + } + } +} + +impl std::str::FromStr for CreatePaymentIntentPaymentMethodDataUsBankAccountAccountHolderType { + type Err = (); + fn from_str(s: &str) -> Result { + use CreatePaymentIntentPaymentMethodDataUsBankAccountAccountHolderType::*; + match s { + "company" => Ok(Company), + "individual" => Ok(Individual), + _ => Err(()), + } + } +} +impl std::fmt::Display for CreatePaymentIntentPaymentMethodDataUsBankAccountAccountHolderType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreatePaymentIntentPaymentMethodDataUsBankAccountAccountHolderType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreatePaymentIntentPaymentMethodDataUsBankAccountAccountHolderType { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Account type: checkings or savings. Defaults to checking if omitted. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreatePaymentIntentPaymentMethodDataUsBankAccountAccountType { + Checking, + Savings, +} +impl CreatePaymentIntentPaymentMethodDataUsBankAccountAccountType { + pub fn as_str(self) -> &'static str { + use CreatePaymentIntentPaymentMethodDataUsBankAccountAccountType::*; + match self { + Checking => "checking", + Savings => "savings", + } + } +} + +impl std::str::FromStr for CreatePaymentIntentPaymentMethodDataUsBankAccountAccountType { + type Err = (); + fn from_str(s: &str) -> Result { + use CreatePaymentIntentPaymentMethodDataUsBankAccountAccountType::*; + match s { + "checking" => Ok(Checking), + "savings" => Ok(Savings), + _ => Err(()), + } + } +} +impl std::fmt::Display for CreatePaymentIntentPaymentMethodDataUsBankAccountAccountType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreatePaymentIntentPaymentMethodDataUsBankAccountAccountType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreatePaymentIntentPaymentMethodDataUsBankAccountAccountType { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Payment method-specific configuration for this PaymentIntent. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreatePaymentIntentPaymentMethodOptions<'a> { + /// If this is a `acss_debit` PaymentMethod, this sub-hash contains details about the ACSS Debit payment method options. + #[serde(skip_serializing_if = "Option::is_none")] + pub acss_debit: Option>, + /// If this is an `affirm` PaymentMethod, this sub-hash contains details about the Affirm payment method options. + #[serde(skip_serializing_if = "Option::is_none")] + pub affirm: Option>, + /// If this is a `afterpay_clearpay` PaymentMethod, this sub-hash contains details about the Afterpay Clearpay payment method options. + #[serde(skip_serializing_if = "Option::is_none")] + pub afterpay_clearpay: Option>, + /// If this is a `alipay` PaymentMethod, this sub-hash contains details about the Alipay payment method options. + #[serde(skip_serializing_if = "Option::is_none")] + pub alipay: Option, + /// If this is a `au_becs_debit` PaymentMethod, this sub-hash contains details about the AU BECS Direct Debit payment method options. + #[serde(skip_serializing_if = "Option::is_none")] + pub au_becs_debit: Option, + /// If this is a `bacs_debit` PaymentMethod, this sub-hash contains details about the BACS Debit payment method options. + #[serde(skip_serializing_if = "Option::is_none")] + pub bacs_debit: Option, + /// If this is a `bancontact` PaymentMethod, this sub-hash contains details about the Bancontact payment method options. + #[serde(skip_serializing_if = "Option::is_none")] + pub bancontact: Option, + /// If this is a `blik` PaymentMethod, this sub-hash contains details about the BLIK payment method options. + #[serde(skip_serializing_if = "Option::is_none")] + pub blik: Option>, + /// If this is a `boleto` PaymentMethod, this sub-hash contains details about the Boleto payment method options. + #[serde(skip_serializing_if = "Option::is_none")] + pub boleto: Option, + /// Configuration for any card payments attempted on this PaymentIntent. + #[serde(skip_serializing_if = "Option::is_none")] + pub card: Option>, + /// If this is a `card_present` PaymentMethod, this sub-hash contains details about the Card Present payment method options. + #[serde(skip_serializing_if = "Option::is_none")] + pub card_present: Option, + /// If this is a `cashapp` PaymentMethod, this sub-hash contains details about the Cash App Pay payment method options. + #[serde(skip_serializing_if = "Option::is_none")] + pub cashapp: Option, + /// If this is a `customer balance` PaymentMethod, this sub-hash contains details about the customer balance payment method options. + #[serde(skip_serializing_if = "Option::is_none")] + pub customer_balance: Option>, + /// If this is a `eps` PaymentMethod, this sub-hash contains details about the EPS payment method options. + #[serde(skip_serializing_if = "Option::is_none")] + pub eps: Option, + /// If this is a `fpx` PaymentMethod, this sub-hash contains details about the FPX payment method options. + #[serde(skip_serializing_if = "Option::is_none")] + pub fpx: Option, + /// If this is a `giropay` PaymentMethod, this sub-hash contains details about the Giropay payment method options. + #[serde(skip_serializing_if = "Option::is_none")] + pub giropay: Option, + /// If this is a `grabpay` PaymentMethod, this sub-hash contains details about the Grabpay payment method options. + #[serde(skip_serializing_if = "Option::is_none")] + pub grabpay: Option, + /// If this is a `ideal` PaymentMethod, this sub-hash contains details about the Ideal payment method options. + #[serde(skip_serializing_if = "Option::is_none")] + pub ideal: Option, + /// If this is a `interac_present` PaymentMethod, this sub-hash contains details about the Card Present payment method options. + #[serde(skip_serializing_if = "Option::is_none")] + pub interac_present: Option<&'a serde_json::Value>, + /// If this is a `klarna` PaymentMethod, this sub-hash contains details about the Klarna payment method options. + #[serde(skip_serializing_if = "Option::is_none")] + pub klarna: Option, + /// If this is a `konbini` PaymentMethod, this sub-hash contains details about the Konbini payment method options. + #[serde(skip_serializing_if = "Option::is_none")] + pub konbini: Option>, + /// If this is a `link` PaymentMethod, this sub-hash contains details about the Link payment method options. + #[serde(skip_serializing_if = "Option::is_none")] + pub link: Option>, + /// If this is a `oxxo` PaymentMethod, this sub-hash contains details about the OXXO payment method options. + #[serde(skip_serializing_if = "Option::is_none")] + pub oxxo: Option, + /// If this is a `p24` PaymentMethod, this sub-hash contains details about the Przelewy24 payment method options. + #[serde(skip_serializing_if = "Option::is_none")] + pub p24: Option, + /// If this is a `paynow` PaymentMethod, this sub-hash contains details about the PayNow payment method options. + #[serde(skip_serializing_if = "Option::is_none")] + pub paynow: Option, + /// If this is a `paypal` PaymentMethod, this sub-hash contains details about the PayPal payment method options. + #[serde(skip_serializing_if = "Option::is_none")] + pub paypal: Option>, + /// If this is a `pix` PaymentMethod, this sub-hash contains details about the Pix payment method options. + #[serde(skip_serializing_if = "Option::is_none")] + pub pix: Option, + /// If this is a `promptpay` PaymentMethod, this sub-hash contains details about the PromptPay payment method options. + #[serde(skip_serializing_if = "Option::is_none")] + pub promptpay: Option, + /// If this is a `revolut_pay` PaymentMethod, this sub-hash contains details about the Revolut Pay payment method options. + #[serde(skip_serializing_if = "Option::is_none")] + pub revolut_pay: Option, + /// If this is a `sepa_debit` PaymentIntent, this sub-hash contains details about the SEPA Debit payment method options. + #[serde(skip_serializing_if = "Option::is_none")] + pub sepa_debit: Option>, + /// If this is a `sofort` PaymentMethod, this sub-hash contains details about the SOFORT payment method options. + #[serde(skip_serializing_if = "Option::is_none")] + pub sofort: Option, + /// If this is a `Swish` PaymentMethod, this sub-hash contains details about the Swish payment method options. + #[serde(skip_serializing_if = "Option::is_none")] + pub swish: Option>, + /// If this is a `us_bank_account` PaymentMethod, this sub-hash contains details about the US bank account payment method options. + #[serde(skip_serializing_if = "Option::is_none")] + pub us_bank_account: Option>, + /// If this is a `wechat_pay` PaymentMethod, this sub-hash contains details about the WeChat Pay payment method options. + #[serde(skip_serializing_if = "Option::is_none")] + pub wechat_pay: Option>, + /// If this is a `zip` PaymentMethod, this sub-hash contains details about the Zip payment method options. + #[serde(skip_serializing_if = "Option::is_none")] + pub zip: Option, +} +impl<'a> CreatePaymentIntentPaymentMethodOptions<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// If this is a `acss_debit` PaymentMethod, this sub-hash contains details about the ACSS Debit payment method options. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreatePaymentIntentPaymentMethodOptionsAcssDebit<'a> { + /// Additional fields for Mandate creation + #[serde(skip_serializing_if = "Option::is_none")] + pub mandate_options: Option>, + /// Indicates that you intend to make future payments with this PaymentIntent's payment method. + /// + /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. + /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + /// + /// When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + /// + /// If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. + #[serde(skip_serializing_if = "Option::is_none")] + pub setup_future_usage: + Option, + /// Bank account verification method. + #[serde(skip_serializing_if = "Option::is_none")] + pub verification_method: + Option, +} +impl<'a> CreatePaymentIntentPaymentMethodOptionsAcssDebit<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// Additional fields for Mandate creation +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreatePaymentIntentPaymentMethodOptionsAcssDebitMandateOptions<'a> { + /// A URL for custom mandate text to render during confirmation step. + /// The URL will be rendered with additional GET parameters `payment_intent` and `payment_intent_client_secret` when confirming a Payment Intent,. + /// or `setup_intent` and `setup_intent_client_secret` when confirming a Setup Intent. + #[serde(skip_serializing_if = "Option::is_none")] + pub custom_mandate_url: Option<&'a str>, + /// Description of the mandate interval. + /// Only required if 'payment_schedule' parameter is 'interval' or 'combined'. + #[serde(skip_serializing_if = "Option::is_none")] + pub interval_description: Option<&'a str>, + /// Payment schedule for the mandate. + #[serde(skip_serializing_if = "Option::is_none")] + pub payment_schedule: + Option, + /// Transaction type of the mandate. + #[serde(skip_serializing_if = "Option::is_none")] + pub transaction_type: + Option, +} +impl<'a> CreatePaymentIntentPaymentMethodOptionsAcssDebitMandateOptions<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// Payment schedule for the mandate. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreatePaymentIntentPaymentMethodOptionsAcssDebitMandateOptionsPaymentSchedule { + Combined, + Interval, + Sporadic, +} +impl CreatePaymentIntentPaymentMethodOptionsAcssDebitMandateOptionsPaymentSchedule { + pub fn as_str(self) -> &'static str { + use CreatePaymentIntentPaymentMethodOptionsAcssDebitMandateOptionsPaymentSchedule::*; + match self { + Combined => "combined", + Interval => "interval", + Sporadic => "sporadic", + } + } +} + +impl std::str::FromStr + for CreatePaymentIntentPaymentMethodOptionsAcssDebitMandateOptionsPaymentSchedule +{ + type Err = (); + fn from_str(s: &str) -> Result { + use CreatePaymentIntentPaymentMethodOptionsAcssDebitMandateOptionsPaymentSchedule::*; + match s { + "combined" => Ok(Combined), + "interval" => Ok(Interval), + "sporadic" => Ok(Sporadic), + _ => Err(()), + } + } +} +impl std::fmt::Display + for CreatePaymentIntentPaymentMethodOptionsAcssDebitMandateOptionsPaymentSchedule +{ + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug + for CreatePaymentIntentPaymentMethodOptionsAcssDebitMandateOptionsPaymentSchedule +{ + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize + for CreatePaymentIntentPaymentMethodOptionsAcssDebitMandateOptionsPaymentSchedule +{ + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Transaction type of the mandate. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreatePaymentIntentPaymentMethodOptionsAcssDebitMandateOptionsTransactionType { + Business, + Personal, +} +impl CreatePaymentIntentPaymentMethodOptionsAcssDebitMandateOptionsTransactionType { + pub fn as_str(self) -> &'static str { + use CreatePaymentIntentPaymentMethodOptionsAcssDebitMandateOptionsTransactionType::*; + match self { + Business => "business", + Personal => "personal", + } + } +} + +impl std::str::FromStr + for CreatePaymentIntentPaymentMethodOptionsAcssDebitMandateOptionsTransactionType +{ + type Err = (); + fn from_str(s: &str) -> Result { + use CreatePaymentIntentPaymentMethodOptionsAcssDebitMandateOptionsTransactionType::*; + match s { + "business" => Ok(Business), + "personal" => Ok(Personal), + _ => Err(()), + } + } +} +impl std::fmt::Display + for CreatePaymentIntentPaymentMethodOptionsAcssDebitMandateOptionsTransactionType +{ + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug + for CreatePaymentIntentPaymentMethodOptionsAcssDebitMandateOptionsTransactionType +{ + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize + for CreatePaymentIntentPaymentMethodOptionsAcssDebitMandateOptionsTransactionType +{ + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Indicates that you intend to make future payments with this PaymentIntent's payment method. +/// +/// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. +/// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. +/// +/// When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). +/// +/// If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreatePaymentIntentPaymentMethodOptionsAcssDebitSetupFutureUsage { + None, + OffSession, + OnSession, +} +impl CreatePaymentIntentPaymentMethodOptionsAcssDebitSetupFutureUsage { + pub fn as_str(self) -> &'static str { + use CreatePaymentIntentPaymentMethodOptionsAcssDebitSetupFutureUsage::*; + match self { + None => "none", + OffSession => "off_session", + OnSession => "on_session", + } + } +} + +impl std::str::FromStr for CreatePaymentIntentPaymentMethodOptionsAcssDebitSetupFutureUsage { + type Err = (); + fn from_str(s: &str) -> Result { + use CreatePaymentIntentPaymentMethodOptionsAcssDebitSetupFutureUsage::*; + match s { + "none" => Ok(None), + "off_session" => Ok(OffSession), + "on_session" => Ok(OnSession), + _ => Err(()), + } + } +} +impl std::fmt::Display for CreatePaymentIntentPaymentMethodOptionsAcssDebitSetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreatePaymentIntentPaymentMethodOptionsAcssDebitSetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreatePaymentIntentPaymentMethodOptionsAcssDebitSetupFutureUsage { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Bank account verification method. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreatePaymentIntentPaymentMethodOptionsAcssDebitVerificationMethod { + Automatic, + Instant, + Microdeposits, +} +impl CreatePaymentIntentPaymentMethodOptionsAcssDebitVerificationMethod { + pub fn as_str(self) -> &'static str { + use CreatePaymentIntentPaymentMethodOptionsAcssDebitVerificationMethod::*; + match self { + Automatic => "automatic", + Instant => "instant", + Microdeposits => "microdeposits", + } + } +} + +impl std::str::FromStr for CreatePaymentIntentPaymentMethodOptionsAcssDebitVerificationMethod { + type Err = (); + fn from_str(s: &str) -> Result { + use CreatePaymentIntentPaymentMethodOptionsAcssDebitVerificationMethod::*; + match s { + "automatic" => Ok(Automatic), + "instant" => Ok(Instant), + "microdeposits" => Ok(Microdeposits), + _ => Err(()), + } + } +} +impl std::fmt::Display for CreatePaymentIntentPaymentMethodOptionsAcssDebitVerificationMethod { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreatePaymentIntentPaymentMethodOptionsAcssDebitVerificationMethod { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreatePaymentIntentPaymentMethodOptionsAcssDebitVerificationMethod { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// If this is an `affirm` PaymentMethod, this sub-hash contains details about the Affirm payment method options. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreatePaymentIntentPaymentMethodOptionsAffirm<'a> { + /// Controls when the funds will be captured from the customer's account. + /// + /// If provided, this parameter will override the top-level `capture_method` when finalizing the payment with this payment method type. + /// + /// If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter will unset the stored value for this payment method type. + #[serde(skip_serializing_if = "Option::is_none")] + pub capture_method: Option, + /// Preferred language of the Affirm authorization page that the customer is redirected to. + #[serde(skip_serializing_if = "Option::is_none")] + pub preferred_locale: Option<&'a str>, + /// Indicates that you intend to make future payments with this PaymentIntent's payment method. + /// + /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. + /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + /// + /// When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + /// + /// If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. + #[serde(skip_serializing_if = "Option::is_none")] + pub setup_future_usage: Option, +} +impl<'a> CreatePaymentIntentPaymentMethodOptionsAffirm<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// Controls when the funds will be captured from the customer's account. +/// +/// If provided, this parameter will override the top-level `capture_method` when finalizing the payment with this payment method type. +/// +/// If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter will unset the stored value for this payment method type. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreatePaymentIntentPaymentMethodOptionsAffirmCaptureMethod { + Manual, +} +impl CreatePaymentIntentPaymentMethodOptionsAffirmCaptureMethod { + pub fn as_str(self) -> &'static str { + use CreatePaymentIntentPaymentMethodOptionsAffirmCaptureMethod::*; + match self { + Manual => "manual", + } + } +} + +impl std::str::FromStr for CreatePaymentIntentPaymentMethodOptionsAffirmCaptureMethod { + type Err = (); + fn from_str(s: &str) -> Result { + use CreatePaymentIntentPaymentMethodOptionsAffirmCaptureMethod::*; + match s { + "manual" => Ok(Manual), + _ => Err(()), + } + } +} +impl std::fmt::Display for CreatePaymentIntentPaymentMethodOptionsAffirmCaptureMethod { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreatePaymentIntentPaymentMethodOptionsAffirmCaptureMethod { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreatePaymentIntentPaymentMethodOptionsAffirmCaptureMethod { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Indicates that you intend to make future payments with this PaymentIntent's payment method. +/// +/// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. +/// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. +/// +/// When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). +/// +/// If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreatePaymentIntentPaymentMethodOptionsAffirmSetupFutureUsage { + None, +} +impl CreatePaymentIntentPaymentMethodOptionsAffirmSetupFutureUsage { + pub fn as_str(self) -> &'static str { + use CreatePaymentIntentPaymentMethodOptionsAffirmSetupFutureUsage::*; + match self { + None => "none", + } + } +} + +impl std::str::FromStr for CreatePaymentIntentPaymentMethodOptionsAffirmSetupFutureUsage { + type Err = (); + fn from_str(s: &str) -> Result { + use CreatePaymentIntentPaymentMethodOptionsAffirmSetupFutureUsage::*; + match s { + "none" => Ok(None), + _ => Err(()), + } + } +} +impl std::fmt::Display for CreatePaymentIntentPaymentMethodOptionsAffirmSetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreatePaymentIntentPaymentMethodOptionsAffirmSetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreatePaymentIntentPaymentMethodOptionsAffirmSetupFutureUsage { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// If this is a `afterpay_clearpay` PaymentMethod, this sub-hash contains details about the Afterpay Clearpay payment method options. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreatePaymentIntentPaymentMethodOptionsAfterpayClearpay<'a> { + /// Controls when the funds will be captured from the customer's account. + /// + /// If provided, this parameter will override the top-level `capture_method` when finalizing the payment with this payment method type. + /// + /// If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter will unset the stored value for this payment method type. + #[serde(skip_serializing_if = "Option::is_none")] + pub capture_method: + Option, + /// An internal identifier or reference that this payment corresponds to. + /// You must limit the identifier to 128 characters, and it can only contain letters, numbers, underscores, backslashes, and dashes. + /// This field differs from the statement descriptor and item name. + #[serde(skip_serializing_if = "Option::is_none")] + pub reference: Option<&'a str>, + /// Indicates that you intend to make future payments with this PaymentIntent's payment method. + /// + /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. + /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + /// + /// When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + /// + /// If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. + #[serde(skip_serializing_if = "Option::is_none")] + pub setup_future_usage: + Option, +} +impl<'a> CreatePaymentIntentPaymentMethodOptionsAfterpayClearpay<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// Controls when the funds will be captured from the customer's account. +/// +/// If provided, this parameter will override the top-level `capture_method` when finalizing the payment with this payment method type. +/// +/// If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter will unset the stored value for this payment method type. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreatePaymentIntentPaymentMethodOptionsAfterpayClearpayCaptureMethod { + Manual, +} +impl CreatePaymentIntentPaymentMethodOptionsAfterpayClearpayCaptureMethod { + pub fn as_str(self) -> &'static str { + use CreatePaymentIntentPaymentMethodOptionsAfterpayClearpayCaptureMethod::*; + match self { + Manual => "manual", + } + } +} + +impl std::str::FromStr for CreatePaymentIntentPaymentMethodOptionsAfterpayClearpayCaptureMethod { + type Err = (); + fn from_str(s: &str) -> Result { + use CreatePaymentIntentPaymentMethodOptionsAfterpayClearpayCaptureMethod::*; + match s { + "manual" => Ok(Manual), + _ => Err(()), + } + } +} +impl std::fmt::Display for CreatePaymentIntentPaymentMethodOptionsAfterpayClearpayCaptureMethod { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreatePaymentIntentPaymentMethodOptionsAfterpayClearpayCaptureMethod { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreatePaymentIntentPaymentMethodOptionsAfterpayClearpayCaptureMethod { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Indicates that you intend to make future payments with this PaymentIntent's payment method. +/// +/// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. +/// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. +/// +/// When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). +/// +/// If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreatePaymentIntentPaymentMethodOptionsAfterpayClearpaySetupFutureUsage { + None, +} +impl CreatePaymentIntentPaymentMethodOptionsAfterpayClearpaySetupFutureUsage { + pub fn as_str(self) -> &'static str { + use CreatePaymentIntentPaymentMethodOptionsAfterpayClearpaySetupFutureUsage::*; + match self { + None => "none", + } + } +} + +impl std::str::FromStr for CreatePaymentIntentPaymentMethodOptionsAfterpayClearpaySetupFutureUsage { + type Err = (); + fn from_str(s: &str) -> Result { + use CreatePaymentIntentPaymentMethodOptionsAfterpayClearpaySetupFutureUsage::*; + match s { + "none" => Ok(None), + _ => Err(()), + } + } +} +impl std::fmt::Display for CreatePaymentIntentPaymentMethodOptionsAfterpayClearpaySetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreatePaymentIntentPaymentMethodOptionsAfterpayClearpaySetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreatePaymentIntentPaymentMethodOptionsAfterpayClearpaySetupFutureUsage { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// If this is a `alipay` PaymentMethod, this sub-hash contains details about the Alipay payment method options. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreatePaymentIntentPaymentMethodOptionsAlipay { + /// Indicates that you intend to make future payments with this PaymentIntent's payment method. + /// + /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. + /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + /// + /// When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + /// + /// If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. + #[serde(skip_serializing_if = "Option::is_none")] + pub setup_future_usage: Option, +} +impl CreatePaymentIntentPaymentMethodOptionsAlipay { + pub fn new() -> Self { + Self::default() + } +} +/// Indicates that you intend to make future payments with this PaymentIntent's payment method. +/// +/// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. +/// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. +/// +/// When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). +/// +/// If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreatePaymentIntentPaymentMethodOptionsAlipaySetupFutureUsage { + None, + OffSession, +} +impl CreatePaymentIntentPaymentMethodOptionsAlipaySetupFutureUsage { + pub fn as_str(self) -> &'static str { + use CreatePaymentIntentPaymentMethodOptionsAlipaySetupFutureUsage::*; + match self { + None => "none", + OffSession => "off_session", + } + } +} + +impl std::str::FromStr for CreatePaymentIntentPaymentMethodOptionsAlipaySetupFutureUsage { + type Err = (); + fn from_str(s: &str) -> Result { + use CreatePaymentIntentPaymentMethodOptionsAlipaySetupFutureUsage::*; + match s { + "none" => Ok(None), + "off_session" => Ok(OffSession), + _ => Err(()), + } + } +} +impl std::fmt::Display for CreatePaymentIntentPaymentMethodOptionsAlipaySetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreatePaymentIntentPaymentMethodOptionsAlipaySetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreatePaymentIntentPaymentMethodOptionsAlipaySetupFutureUsage { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// If this is a `au_becs_debit` PaymentMethod, this sub-hash contains details about the AU BECS Direct Debit payment method options. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreatePaymentIntentPaymentMethodOptionsAuBecsDebit { + /// Indicates that you intend to make future payments with this PaymentIntent's payment method. + /// + /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. + /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + /// + /// When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + /// + /// If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. + #[serde(skip_serializing_if = "Option::is_none")] + pub setup_future_usage: + Option, +} +impl CreatePaymentIntentPaymentMethodOptionsAuBecsDebit { + pub fn new() -> Self { + Self::default() + } +} +/// Indicates that you intend to make future payments with this PaymentIntent's payment method. +/// +/// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. +/// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. +/// +/// When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). +/// +/// If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreatePaymentIntentPaymentMethodOptionsAuBecsDebitSetupFutureUsage { + None, + OffSession, + OnSession, +} +impl CreatePaymentIntentPaymentMethodOptionsAuBecsDebitSetupFutureUsage { + pub fn as_str(self) -> &'static str { + use CreatePaymentIntentPaymentMethodOptionsAuBecsDebitSetupFutureUsage::*; + match self { + None => "none", + OffSession => "off_session", + OnSession => "on_session", + } + } +} + +impl std::str::FromStr for CreatePaymentIntentPaymentMethodOptionsAuBecsDebitSetupFutureUsage { + type Err = (); + fn from_str(s: &str) -> Result { + use CreatePaymentIntentPaymentMethodOptionsAuBecsDebitSetupFutureUsage::*; + match s { + "none" => Ok(None), + "off_session" => Ok(OffSession), + "on_session" => Ok(OnSession), + _ => Err(()), + } + } +} +impl std::fmt::Display for CreatePaymentIntentPaymentMethodOptionsAuBecsDebitSetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreatePaymentIntentPaymentMethodOptionsAuBecsDebitSetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreatePaymentIntentPaymentMethodOptionsAuBecsDebitSetupFutureUsage { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// If this is a `bacs_debit` PaymentMethod, this sub-hash contains details about the BACS Debit payment method options. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreatePaymentIntentPaymentMethodOptionsBacsDebit { + /// Indicates that you intend to make future payments with this PaymentIntent's payment method. + /// + /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. + /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + /// + /// When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + /// + /// If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. + #[serde(skip_serializing_if = "Option::is_none")] + pub setup_future_usage: + Option, +} +impl CreatePaymentIntentPaymentMethodOptionsBacsDebit { + pub fn new() -> Self { + Self::default() + } +} +/// Indicates that you intend to make future payments with this PaymentIntent's payment method. +/// +/// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. +/// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. +/// +/// When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). +/// +/// If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreatePaymentIntentPaymentMethodOptionsBacsDebitSetupFutureUsage { + None, + OffSession, + OnSession, +} +impl CreatePaymentIntentPaymentMethodOptionsBacsDebitSetupFutureUsage { + pub fn as_str(self) -> &'static str { + use CreatePaymentIntentPaymentMethodOptionsBacsDebitSetupFutureUsage::*; + match self { + None => "none", + OffSession => "off_session", + OnSession => "on_session", + } + } +} + +impl std::str::FromStr for CreatePaymentIntentPaymentMethodOptionsBacsDebitSetupFutureUsage { + type Err = (); + fn from_str(s: &str) -> Result { + use CreatePaymentIntentPaymentMethodOptionsBacsDebitSetupFutureUsage::*; + match s { + "none" => Ok(None), + "off_session" => Ok(OffSession), + "on_session" => Ok(OnSession), + _ => Err(()), + } + } +} +impl std::fmt::Display for CreatePaymentIntentPaymentMethodOptionsBacsDebitSetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreatePaymentIntentPaymentMethodOptionsBacsDebitSetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreatePaymentIntentPaymentMethodOptionsBacsDebitSetupFutureUsage { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// If this is a `bancontact` PaymentMethod, this sub-hash contains details about the Bancontact payment method options. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreatePaymentIntentPaymentMethodOptionsBancontact { + /// Preferred language of the Bancontact authorization page that the customer is redirected to. + #[serde(skip_serializing_if = "Option::is_none")] + pub preferred_language: + Option, + /// Indicates that you intend to make future payments with this PaymentIntent's payment method. + /// + /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. + /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + /// + /// When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + /// + /// If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. + #[serde(skip_serializing_if = "Option::is_none")] + pub setup_future_usage: + Option, +} +impl CreatePaymentIntentPaymentMethodOptionsBancontact { + pub fn new() -> Self { + Self::default() + } +} +/// Preferred language of the Bancontact authorization page that the customer is redirected to. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreatePaymentIntentPaymentMethodOptionsBancontactPreferredLanguage { + De, + En, + Fr, + Nl, +} +impl CreatePaymentIntentPaymentMethodOptionsBancontactPreferredLanguage { + pub fn as_str(self) -> &'static str { + use CreatePaymentIntentPaymentMethodOptionsBancontactPreferredLanguage::*; + match self { + De => "de", + En => "en", + Fr => "fr", + Nl => "nl", + } + } +} + +impl std::str::FromStr for CreatePaymentIntentPaymentMethodOptionsBancontactPreferredLanguage { + type Err = (); + fn from_str(s: &str) -> Result { + use CreatePaymentIntentPaymentMethodOptionsBancontactPreferredLanguage::*; + match s { + "de" => Ok(De), + "en" => Ok(En), + "fr" => Ok(Fr), + "nl" => Ok(Nl), + _ => Err(()), + } + } +} +impl std::fmt::Display for CreatePaymentIntentPaymentMethodOptionsBancontactPreferredLanguage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreatePaymentIntentPaymentMethodOptionsBancontactPreferredLanguage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreatePaymentIntentPaymentMethodOptionsBancontactPreferredLanguage { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Indicates that you intend to make future payments with this PaymentIntent's payment method. +/// +/// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. +/// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. +/// +/// When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). +/// +/// If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreatePaymentIntentPaymentMethodOptionsBancontactSetupFutureUsage { + None, + OffSession, +} +impl CreatePaymentIntentPaymentMethodOptionsBancontactSetupFutureUsage { + pub fn as_str(self) -> &'static str { + use CreatePaymentIntentPaymentMethodOptionsBancontactSetupFutureUsage::*; + match self { + None => "none", + OffSession => "off_session", + } + } +} + +impl std::str::FromStr for CreatePaymentIntentPaymentMethodOptionsBancontactSetupFutureUsage { + type Err = (); + fn from_str(s: &str) -> Result { + use CreatePaymentIntentPaymentMethodOptionsBancontactSetupFutureUsage::*; + match s { + "none" => Ok(None), + "off_session" => Ok(OffSession), + _ => Err(()), + } + } +} +impl std::fmt::Display for CreatePaymentIntentPaymentMethodOptionsBancontactSetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreatePaymentIntentPaymentMethodOptionsBancontactSetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreatePaymentIntentPaymentMethodOptionsBancontactSetupFutureUsage { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// If this is a `blik` PaymentMethod, this sub-hash contains details about the BLIK payment method options. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreatePaymentIntentPaymentMethodOptionsBlik<'a> { + /// The 6-digit BLIK code that a customer has generated using their banking application. + /// Can only be set on confirmation. + #[serde(skip_serializing_if = "Option::is_none")] + pub code: Option<&'a str>, + /// Indicates that you intend to make future payments with this PaymentIntent's payment method. + /// + /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. + /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + /// + /// When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + /// + /// If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. + #[serde(skip_serializing_if = "Option::is_none")] + pub setup_future_usage: Option, +} +impl<'a> CreatePaymentIntentPaymentMethodOptionsBlik<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// Indicates that you intend to make future payments with this PaymentIntent's payment method. +/// +/// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. +/// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. +/// +/// When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). +/// +/// If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreatePaymentIntentPaymentMethodOptionsBlikSetupFutureUsage { + None, +} +impl CreatePaymentIntentPaymentMethodOptionsBlikSetupFutureUsage { + pub fn as_str(self) -> &'static str { + use CreatePaymentIntentPaymentMethodOptionsBlikSetupFutureUsage::*; + match self { + None => "none", + } + } +} + +impl std::str::FromStr for CreatePaymentIntentPaymentMethodOptionsBlikSetupFutureUsage { + type Err = (); + fn from_str(s: &str) -> Result { + use CreatePaymentIntentPaymentMethodOptionsBlikSetupFutureUsage::*; + match s { + "none" => Ok(None), + _ => Err(()), + } + } +} +impl std::fmt::Display for CreatePaymentIntentPaymentMethodOptionsBlikSetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreatePaymentIntentPaymentMethodOptionsBlikSetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreatePaymentIntentPaymentMethodOptionsBlikSetupFutureUsage { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// If this is a `boleto` PaymentMethod, this sub-hash contains details about the Boleto payment method options. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreatePaymentIntentPaymentMethodOptionsBoleto { + /// The number of calendar days before a Boleto voucher expires. + /// For example, if you create a Boleto voucher on Monday and you set expires_after_days to 2, the Boleto invoice will expire on Wednesday at 23:59 America/Sao_Paulo time. + #[serde(skip_serializing_if = "Option::is_none")] + pub expires_after_days: Option, + /// Indicates that you intend to make future payments with this PaymentIntent's payment method. + /// + /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. + /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + /// + /// When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + /// + /// If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. + #[serde(skip_serializing_if = "Option::is_none")] + pub setup_future_usage: Option, +} +impl CreatePaymentIntentPaymentMethodOptionsBoleto { + pub fn new() -> Self { + Self::default() + } +} +/// Indicates that you intend to make future payments with this PaymentIntent's payment method. +/// +/// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. +/// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. +/// +/// When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). +/// +/// If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreatePaymentIntentPaymentMethodOptionsBoletoSetupFutureUsage { + None, + OffSession, + OnSession, +} +impl CreatePaymentIntentPaymentMethodOptionsBoletoSetupFutureUsage { + pub fn as_str(self) -> &'static str { + use CreatePaymentIntentPaymentMethodOptionsBoletoSetupFutureUsage::*; + match self { + None => "none", + OffSession => "off_session", + OnSession => "on_session", + } + } +} + +impl std::str::FromStr for CreatePaymentIntentPaymentMethodOptionsBoletoSetupFutureUsage { + type Err = (); + fn from_str(s: &str) -> Result { + use CreatePaymentIntentPaymentMethodOptionsBoletoSetupFutureUsage::*; + match s { + "none" => Ok(None), + "off_session" => Ok(OffSession), + "on_session" => Ok(OnSession), + _ => Err(()), + } + } +} +impl std::fmt::Display for CreatePaymentIntentPaymentMethodOptionsBoletoSetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreatePaymentIntentPaymentMethodOptionsBoletoSetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreatePaymentIntentPaymentMethodOptionsBoletoSetupFutureUsage { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Configuration for any card payments attempted on this PaymentIntent. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreatePaymentIntentPaymentMethodOptionsCard<'a> { + /// Controls when the funds will be captured from the customer's account. + /// + /// If provided, this parameter will override the top-level `capture_method` when finalizing the payment with this payment method type. + /// + /// If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter will unset the stored value for this payment method type. + #[serde(skip_serializing_if = "Option::is_none")] + pub capture_method: Option, + /// A single-use `cvc_update` Token that represents a card CVC value. + /// When provided, the CVC value will be verified during the card payment attempt. + /// This parameter can only be provided during confirmation. + #[serde(skip_serializing_if = "Option::is_none")] + pub cvc_token: Option<&'a str>, + /// Installment configuration for payments attempted on this PaymentIntent (Mexico Only). + /// + /// For more information, see the [installments integration guide](https://stripe.com/docs/payments/installments). + #[serde(skip_serializing_if = "Option::is_none")] + pub installments: Option, + /// Configuration options for setting up an eMandate for cards issued in India. + #[serde(skip_serializing_if = "Option::is_none")] + pub mandate_options: Option>, + /// When specified, this parameter indicates that a transaction will be marked + /// as MOTO (Mail Order Telephone Order) and thus out of scope for SCA. This + /// parameter can only be provided during confirmation. + #[serde(skip_serializing_if = "Option::is_none")] + pub moto: Option, + /// Selected network to process this PaymentIntent on. + /// Depends on the available networks of the card attached to the PaymentIntent. + /// Can be only set confirm-time. + #[serde(skip_serializing_if = "Option::is_none")] + pub network: Option, + /// Request ability to [capture beyond the standard authorization validity window](https://stripe.com/docs/payments/extended-authorization) for this PaymentIntent. + #[serde(skip_serializing_if = "Option::is_none")] + pub request_extended_authorization: + Option, + /// Request ability to [increment the authorization](https://stripe.com/docs/payments/incremental-authorization) for this PaymentIntent. + #[serde(skip_serializing_if = "Option::is_none")] + pub request_incremental_authorization: + Option, + /// Request ability to make [multiple captures](https://stripe.com/docs/payments/multicapture) for this PaymentIntent. + #[serde(skip_serializing_if = "Option::is_none")] + pub request_multicapture: + Option, + /// Request ability to [overcapture](https://stripe.com/docs/payments/overcapture) for this PaymentIntent. + #[serde(skip_serializing_if = "Option::is_none")] + pub request_overcapture: Option, + /// We strongly recommend that you rely on our SCA Engine to automatically prompt your customers for authentication based on risk level and [other requirements](https://stripe.com/docs/strong-customer-authentication). + /// However, if you wish to request 3D Secure based on logic from your own fraud engine, provide this option. + /// If not provided, this value defaults to `automatic`. + /// Read our guide on [manually requesting 3D Secure](https://stripe.com/docs/payments/3d-secure#manual-three-ds) for more information on how this configuration interacts with Radar and our SCA Engine. + #[serde(skip_serializing_if = "Option::is_none")] + pub request_three_d_secure: + Option, + /// When enabled, using a card that is attached to a customer will require the CVC to be provided again (i.e. + /// using the cvc_token parameter). + #[serde(skip_serializing_if = "Option::is_none")] + pub require_cvc_recollection: Option, + /// Indicates that you intend to make future payments with this PaymentIntent's payment method. + /// + /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. + /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + /// + /// When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + /// + /// If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. + #[serde(skip_serializing_if = "Option::is_none")] + pub setup_future_usage: Option, + /// Provides information about a card payment that customers see on their statements. + /// Concatenated with the Kana prefix (shortened Kana descriptor) or Kana statement descriptor that’s set on the account to form the complete statement descriptor. + /// Maximum 22 characters. + /// On card statements, the *concatenation* of both prefix and suffix (including separators) will appear truncated to 22 characters. + #[serde(skip_serializing_if = "Option::is_none")] + pub statement_descriptor_suffix_kana: Option<&'a str>, + /// Provides information about a card payment that customers see on their statements. + /// Concatenated with the Kanji prefix (shortened Kanji descriptor) or Kanji statement descriptor that’s set on the account to form the complete statement descriptor. + /// Maximum 17 characters. + /// On card statements, the *concatenation* of both prefix and suffix (including separators) will appear truncated to 17 characters. + #[serde(skip_serializing_if = "Option::is_none")] + pub statement_descriptor_suffix_kanji: Option<&'a str>, + /// If 3D Secure authentication was performed with a third-party provider, + /// the authentication details to use for this payment. + #[serde(skip_serializing_if = "Option::is_none")] + pub three_d_secure: Option>, +} +impl<'a> CreatePaymentIntentPaymentMethodOptionsCard<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// Controls when the funds will be captured from the customer's account. +/// +/// If provided, this parameter will override the top-level `capture_method` when finalizing the payment with this payment method type. +/// +/// If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter will unset the stored value for this payment method type. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreatePaymentIntentPaymentMethodOptionsCardCaptureMethod { + Manual, +} +impl CreatePaymentIntentPaymentMethodOptionsCardCaptureMethod { + pub fn as_str(self) -> &'static str { + use CreatePaymentIntentPaymentMethodOptionsCardCaptureMethod::*; + match self { + Manual => "manual", + } + } +} + +impl std::str::FromStr for CreatePaymentIntentPaymentMethodOptionsCardCaptureMethod { + type Err = (); + fn from_str(s: &str) -> Result { + use CreatePaymentIntentPaymentMethodOptionsCardCaptureMethod::*; + match s { + "manual" => Ok(Manual), + _ => Err(()), + } + } +} +impl std::fmt::Display for CreatePaymentIntentPaymentMethodOptionsCardCaptureMethod { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreatePaymentIntentPaymentMethodOptionsCardCaptureMethod { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreatePaymentIntentPaymentMethodOptionsCardCaptureMethod { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Installment configuration for payments attempted on this PaymentIntent (Mexico Only). +/// +/// For more information, see the [installments integration guide](https://stripe.com/docs/payments/installments). +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreatePaymentIntentPaymentMethodOptionsCardInstallments { + /// Setting to true enables installments for this PaymentIntent. + /// This will cause the response to contain a list of available installment plans. + /// Setting to false will prevent any selected plan from applying to a charge. + #[serde(skip_serializing_if = "Option::is_none")] + pub enabled: Option, + /// The selected installment plan to use for this payment attempt. + /// This parameter can only be provided during confirmation. + #[serde(skip_serializing_if = "Option::is_none")] + pub plan: Option, +} +impl CreatePaymentIntentPaymentMethodOptionsCardInstallments { + pub fn new() -> Self { + Self::default() + } +} +/// The selected installment plan to use for this payment attempt. +/// This parameter can only be provided during confirmation. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreatePaymentIntentPaymentMethodOptionsCardInstallmentsPlan { + /// For `fixed_count` installment plans, this is the number of installment payments your customer will make to their credit card. + pub count: u64, + /// For `fixed_count` installment plans, this is the interval between installment payments your customer will make to their credit card. + /// One of `month`. + pub interval: CreatePaymentIntentPaymentMethodOptionsCardInstallmentsPlanInterval, + /// Type of installment plan, one of `fixed_count`. + #[serde(rename = "type")] + pub type_: CreatePaymentIntentPaymentMethodOptionsCardInstallmentsPlanType, +} +impl CreatePaymentIntentPaymentMethodOptionsCardInstallmentsPlan { + pub fn new( + count: u64, + interval: CreatePaymentIntentPaymentMethodOptionsCardInstallmentsPlanInterval, + type_: CreatePaymentIntentPaymentMethodOptionsCardInstallmentsPlanType, + ) -> Self { + Self { count, interval, type_ } + } +} +/// For `fixed_count` installment plans, this is the interval between installment payments your customer will make to their credit card. +/// One of `month`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreatePaymentIntentPaymentMethodOptionsCardInstallmentsPlanInterval { + Month, +} +impl CreatePaymentIntentPaymentMethodOptionsCardInstallmentsPlanInterval { + pub fn as_str(self) -> &'static str { + use CreatePaymentIntentPaymentMethodOptionsCardInstallmentsPlanInterval::*; + match self { + Month => "month", + } + } +} + +impl std::str::FromStr for CreatePaymentIntentPaymentMethodOptionsCardInstallmentsPlanInterval { + type Err = (); + fn from_str(s: &str) -> Result { + use CreatePaymentIntentPaymentMethodOptionsCardInstallmentsPlanInterval::*; + match s { + "month" => Ok(Month), + _ => Err(()), + } + } +} +impl std::fmt::Display for CreatePaymentIntentPaymentMethodOptionsCardInstallmentsPlanInterval { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreatePaymentIntentPaymentMethodOptionsCardInstallmentsPlanInterval { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreatePaymentIntentPaymentMethodOptionsCardInstallmentsPlanInterval { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Type of installment plan, one of `fixed_count`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreatePaymentIntentPaymentMethodOptionsCardInstallmentsPlanType { + FixedCount, +} +impl CreatePaymentIntentPaymentMethodOptionsCardInstallmentsPlanType { + pub fn as_str(self) -> &'static str { + use CreatePaymentIntentPaymentMethodOptionsCardInstallmentsPlanType::*; + match self { + FixedCount => "fixed_count", + } + } +} + +impl std::str::FromStr for CreatePaymentIntentPaymentMethodOptionsCardInstallmentsPlanType { + type Err = (); + fn from_str(s: &str) -> Result { + use CreatePaymentIntentPaymentMethodOptionsCardInstallmentsPlanType::*; + match s { + "fixed_count" => Ok(FixedCount), + _ => Err(()), + } + } +} +impl std::fmt::Display for CreatePaymentIntentPaymentMethodOptionsCardInstallmentsPlanType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreatePaymentIntentPaymentMethodOptionsCardInstallmentsPlanType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreatePaymentIntentPaymentMethodOptionsCardInstallmentsPlanType { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Configuration options for setting up an eMandate for cards issued in India. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreatePaymentIntentPaymentMethodOptionsCardMandateOptions<'a> { + /// Amount to be charged for future payments. + pub amount: i64, + /// One of `fixed` or `maximum`. + /// If `fixed`, the `amount` param refers to the exact amount to be charged in future payments. + /// If `maximum`, the amount charged can be up to the value passed for the `amount` param. + pub amount_type: CreatePaymentIntentPaymentMethodOptionsCardMandateOptionsAmountType, + /// A description of the mandate or subscription that is meant to be displayed to the customer. + #[serde(skip_serializing_if = "Option::is_none")] + pub description: Option<&'a str>, + /// End date of the mandate or subscription. + /// If not provided, the mandate will be active until canceled. + /// If provided, end date should be after start date. + #[serde(skip_serializing_if = "Option::is_none")] + pub end_date: Option, + /// Specifies payment frequency. One of `day`, `week`, `month`, `year`, or `sporadic`. + pub interval: CreatePaymentIntentPaymentMethodOptionsCardMandateOptionsInterval, + /// The number of intervals between payments. + /// For example, `interval=month` and `interval_count=3` indicates one payment every three months. + /// Maximum of one year interval allowed (1 year, 12 months, or 52 weeks). + /// This parameter is optional when `interval=sporadic`. + #[serde(skip_serializing_if = "Option::is_none")] + pub interval_count: Option, + /// Unique identifier for the mandate or subscription. + pub reference: &'a str, + /// Start date of the mandate or subscription. Start date should not be lesser than yesterday. + pub start_date: stripe_types::Timestamp, + /// Specifies the type of mandates supported. Possible values are `india`. + #[serde(skip_serializing_if = "Option::is_none")] + pub supported_types: + Option<&'a [CreatePaymentIntentPaymentMethodOptionsCardMandateOptionsSupportedTypes]>, +} +impl<'a> CreatePaymentIntentPaymentMethodOptionsCardMandateOptions<'a> { + pub fn new( + amount: i64, + amount_type: CreatePaymentIntentPaymentMethodOptionsCardMandateOptionsAmountType, + interval: CreatePaymentIntentPaymentMethodOptionsCardMandateOptionsInterval, + reference: &'a str, + start_date: stripe_types::Timestamp, + ) -> Self { + Self { + amount, + amount_type, + description: None, + end_date: None, + interval, + interval_count: None, + reference, + start_date, + supported_types: None, + } + } +} +/// One of `fixed` or `maximum`. +/// If `fixed`, the `amount` param refers to the exact amount to be charged in future payments. +/// If `maximum`, the amount charged can be up to the value passed for the `amount` param. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreatePaymentIntentPaymentMethodOptionsCardMandateOptionsAmountType { + Fixed, + Maximum, +} +impl CreatePaymentIntentPaymentMethodOptionsCardMandateOptionsAmountType { + pub fn as_str(self) -> &'static str { + use CreatePaymentIntentPaymentMethodOptionsCardMandateOptionsAmountType::*; + match self { + Fixed => "fixed", + Maximum => "maximum", + } + } +} + +impl std::str::FromStr for CreatePaymentIntentPaymentMethodOptionsCardMandateOptionsAmountType { + type Err = (); + fn from_str(s: &str) -> Result { + use CreatePaymentIntentPaymentMethodOptionsCardMandateOptionsAmountType::*; + match s { + "fixed" => Ok(Fixed), + "maximum" => Ok(Maximum), + _ => Err(()), + } + } +} +impl std::fmt::Display for CreatePaymentIntentPaymentMethodOptionsCardMandateOptionsAmountType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreatePaymentIntentPaymentMethodOptionsCardMandateOptionsAmountType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreatePaymentIntentPaymentMethodOptionsCardMandateOptionsAmountType { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Specifies payment frequency. One of `day`, `week`, `month`, `year`, or `sporadic`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreatePaymentIntentPaymentMethodOptionsCardMandateOptionsInterval { + Day, + Month, + Sporadic, + Week, + Year, +} +impl CreatePaymentIntentPaymentMethodOptionsCardMandateOptionsInterval { + pub fn as_str(self) -> &'static str { + use CreatePaymentIntentPaymentMethodOptionsCardMandateOptionsInterval::*; + match self { + Day => "day", + Month => "month", + Sporadic => "sporadic", + Week => "week", + Year => "year", + } + } +} + +impl std::str::FromStr for CreatePaymentIntentPaymentMethodOptionsCardMandateOptionsInterval { + type Err = (); + fn from_str(s: &str) -> Result { + use CreatePaymentIntentPaymentMethodOptionsCardMandateOptionsInterval::*; + match s { + "day" => Ok(Day), + "month" => Ok(Month), + "sporadic" => Ok(Sporadic), + "week" => Ok(Week), + "year" => Ok(Year), + _ => Err(()), + } + } +} +impl std::fmt::Display for CreatePaymentIntentPaymentMethodOptionsCardMandateOptionsInterval { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreatePaymentIntentPaymentMethodOptionsCardMandateOptionsInterval { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreatePaymentIntentPaymentMethodOptionsCardMandateOptionsInterval { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Specifies the type of mandates supported. Possible values are `india`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreatePaymentIntentPaymentMethodOptionsCardMandateOptionsSupportedTypes { + India, +} +impl CreatePaymentIntentPaymentMethodOptionsCardMandateOptionsSupportedTypes { + pub fn as_str(self) -> &'static str { + use CreatePaymentIntentPaymentMethodOptionsCardMandateOptionsSupportedTypes::*; + match self { + India => "india", + } + } +} + +impl std::str::FromStr for CreatePaymentIntentPaymentMethodOptionsCardMandateOptionsSupportedTypes { + type Err = (); + fn from_str(s: &str) -> Result { + use CreatePaymentIntentPaymentMethodOptionsCardMandateOptionsSupportedTypes::*; + match s { + "india" => Ok(India), + _ => Err(()), + } + } +} +impl std::fmt::Display for CreatePaymentIntentPaymentMethodOptionsCardMandateOptionsSupportedTypes { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreatePaymentIntentPaymentMethodOptionsCardMandateOptionsSupportedTypes { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreatePaymentIntentPaymentMethodOptionsCardMandateOptionsSupportedTypes { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Selected network to process this PaymentIntent on. +/// Depends on the available networks of the card attached to the PaymentIntent. +/// Can be only set confirm-time. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreatePaymentIntentPaymentMethodOptionsCardNetwork { + Amex, + CartesBancaires, + Diners, + Discover, + EftposAu, + Interac, + Jcb, + Mastercard, + Unionpay, + Unknown, + Visa, +} +impl CreatePaymentIntentPaymentMethodOptionsCardNetwork { + pub fn as_str(self) -> &'static str { + use CreatePaymentIntentPaymentMethodOptionsCardNetwork::*; + match self { + Amex => "amex", + CartesBancaires => "cartes_bancaires", + Diners => "diners", + Discover => "discover", + EftposAu => "eftpos_au", + Interac => "interac", + Jcb => "jcb", + Mastercard => "mastercard", + Unionpay => "unionpay", + Unknown => "unknown", + Visa => "visa", + } + } +} + +impl std::str::FromStr for CreatePaymentIntentPaymentMethodOptionsCardNetwork { + type Err = (); + fn from_str(s: &str) -> Result { + use CreatePaymentIntentPaymentMethodOptionsCardNetwork::*; + match s { + "amex" => Ok(Amex), + "cartes_bancaires" => Ok(CartesBancaires), + "diners" => Ok(Diners), + "discover" => Ok(Discover), + "eftpos_au" => Ok(EftposAu), + "interac" => Ok(Interac), + "jcb" => Ok(Jcb), + "mastercard" => Ok(Mastercard), + "unionpay" => Ok(Unionpay), + "unknown" => Ok(Unknown), + "visa" => Ok(Visa), + _ => Err(()), + } + } +} +impl std::fmt::Display for CreatePaymentIntentPaymentMethodOptionsCardNetwork { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreatePaymentIntentPaymentMethodOptionsCardNetwork { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreatePaymentIntentPaymentMethodOptionsCardNetwork { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Request ability to [capture beyond the standard authorization validity window](https://stripe.com/docs/payments/extended-authorization) for this PaymentIntent. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreatePaymentIntentPaymentMethodOptionsCardRequestExtendedAuthorization { + IfAvailable, + Never, +} +impl CreatePaymentIntentPaymentMethodOptionsCardRequestExtendedAuthorization { + pub fn as_str(self) -> &'static str { + use CreatePaymentIntentPaymentMethodOptionsCardRequestExtendedAuthorization::*; + match self { + IfAvailable => "if_available", + Never => "never", + } + } +} + +impl std::str::FromStr for CreatePaymentIntentPaymentMethodOptionsCardRequestExtendedAuthorization { + type Err = (); + fn from_str(s: &str) -> Result { + use CreatePaymentIntentPaymentMethodOptionsCardRequestExtendedAuthorization::*; + match s { + "if_available" => Ok(IfAvailable), + "never" => Ok(Never), + _ => Err(()), + } + } +} +impl std::fmt::Display for CreatePaymentIntentPaymentMethodOptionsCardRequestExtendedAuthorization { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreatePaymentIntentPaymentMethodOptionsCardRequestExtendedAuthorization { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreatePaymentIntentPaymentMethodOptionsCardRequestExtendedAuthorization { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Request ability to [increment the authorization](https://stripe.com/docs/payments/incremental-authorization) for this PaymentIntent. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreatePaymentIntentPaymentMethodOptionsCardRequestIncrementalAuthorization { + IfAvailable, + Never, +} +impl CreatePaymentIntentPaymentMethodOptionsCardRequestIncrementalAuthorization { + pub fn as_str(self) -> &'static str { + use CreatePaymentIntentPaymentMethodOptionsCardRequestIncrementalAuthorization::*; + match self { + IfAvailable => "if_available", + Never => "never", + } + } +} + +impl std::str::FromStr + for CreatePaymentIntentPaymentMethodOptionsCardRequestIncrementalAuthorization +{ + type Err = (); + fn from_str(s: &str) -> Result { + use CreatePaymentIntentPaymentMethodOptionsCardRequestIncrementalAuthorization::*; + match s { + "if_available" => Ok(IfAvailable), + "never" => Ok(Never), + _ => Err(()), + } + } +} +impl std::fmt::Display + for CreatePaymentIntentPaymentMethodOptionsCardRequestIncrementalAuthorization +{ + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug + for CreatePaymentIntentPaymentMethodOptionsCardRequestIncrementalAuthorization +{ + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize + for CreatePaymentIntentPaymentMethodOptionsCardRequestIncrementalAuthorization +{ + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Request ability to make [multiple captures](https://stripe.com/docs/payments/multicapture) for this PaymentIntent. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreatePaymentIntentPaymentMethodOptionsCardRequestMulticapture { + IfAvailable, + Never, +} +impl CreatePaymentIntentPaymentMethodOptionsCardRequestMulticapture { + pub fn as_str(self) -> &'static str { + use CreatePaymentIntentPaymentMethodOptionsCardRequestMulticapture::*; + match self { + IfAvailable => "if_available", + Never => "never", + } + } +} + +impl std::str::FromStr for CreatePaymentIntentPaymentMethodOptionsCardRequestMulticapture { + type Err = (); + fn from_str(s: &str) -> Result { + use CreatePaymentIntentPaymentMethodOptionsCardRequestMulticapture::*; + match s { + "if_available" => Ok(IfAvailable), + "never" => Ok(Never), + _ => Err(()), + } + } +} +impl std::fmt::Display for CreatePaymentIntentPaymentMethodOptionsCardRequestMulticapture { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreatePaymentIntentPaymentMethodOptionsCardRequestMulticapture { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreatePaymentIntentPaymentMethodOptionsCardRequestMulticapture { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Request ability to [overcapture](https://stripe.com/docs/payments/overcapture) for this PaymentIntent. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreatePaymentIntentPaymentMethodOptionsCardRequestOvercapture { + IfAvailable, + Never, +} +impl CreatePaymentIntentPaymentMethodOptionsCardRequestOvercapture { + pub fn as_str(self) -> &'static str { + use CreatePaymentIntentPaymentMethodOptionsCardRequestOvercapture::*; + match self { + IfAvailable => "if_available", + Never => "never", + } + } +} + +impl std::str::FromStr for CreatePaymentIntentPaymentMethodOptionsCardRequestOvercapture { + type Err = (); + fn from_str(s: &str) -> Result { + use CreatePaymentIntentPaymentMethodOptionsCardRequestOvercapture::*; + match s { + "if_available" => Ok(IfAvailable), + "never" => Ok(Never), + _ => Err(()), + } + } +} +impl std::fmt::Display for CreatePaymentIntentPaymentMethodOptionsCardRequestOvercapture { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreatePaymentIntentPaymentMethodOptionsCardRequestOvercapture { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreatePaymentIntentPaymentMethodOptionsCardRequestOvercapture { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// We strongly recommend that you rely on our SCA Engine to automatically prompt your customers for authentication based on risk level and [other requirements](https://stripe.com/docs/strong-customer-authentication). +/// However, if you wish to request 3D Secure based on logic from your own fraud engine, provide this option. +/// If not provided, this value defaults to `automatic`. +/// Read our guide on [manually requesting 3D Secure](https://stripe.com/docs/payments/3d-secure#manual-three-ds) for more information on how this configuration interacts with Radar and our SCA Engine. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreatePaymentIntentPaymentMethodOptionsCardRequestThreeDSecure { + Any, + Automatic, + Challenge, +} +impl CreatePaymentIntentPaymentMethodOptionsCardRequestThreeDSecure { + pub fn as_str(self) -> &'static str { + use CreatePaymentIntentPaymentMethodOptionsCardRequestThreeDSecure::*; + match self { + Any => "any", + Automatic => "automatic", + Challenge => "challenge", + } + } +} + +impl std::str::FromStr for CreatePaymentIntentPaymentMethodOptionsCardRequestThreeDSecure { + type Err = (); + fn from_str(s: &str) -> Result { + use CreatePaymentIntentPaymentMethodOptionsCardRequestThreeDSecure::*; + match s { + "any" => Ok(Any), + "automatic" => Ok(Automatic), + "challenge" => Ok(Challenge), + _ => Err(()), + } + } +} +impl std::fmt::Display for CreatePaymentIntentPaymentMethodOptionsCardRequestThreeDSecure { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreatePaymentIntentPaymentMethodOptionsCardRequestThreeDSecure { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreatePaymentIntentPaymentMethodOptionsCardRequestThreeDSecure { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Indicates that you intend to make future payments with this PaymentIntent's payment method. +/// +/// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. +/// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. +/// +/// When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). +/// +/// If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreatePaymentIntentPaymentMethodOptionsCardSetupFutureUsage { + None, + OffSession, + OnSession, +} +impl CreatePaymentIntentPaymentMethodOptionsCardSetupFutureUsage { + pub fn as_str(self) -> &'static str { + use CreatePaymentIntentPaymentMethodOptionsCardSetupFutureUsage::*; + match self { + None => "none", + OffSession => "off_session", + OnSession => "on_session", + } + } +} + +impl std::str::FromStr for CreatePaymentIntentPaymentMethodOptionsCardSetupFutureUsage { + type Err = (); + fn from_str(s: &str) -> Result { + use CreatePaymentIntentPaymentMethodOptionsCardSetupFutureUsage::*; + match s { + "none" => Ok(None), + "off_session" => Ok(OffSession), + "on_session" => Ok(OnSession), + _ => Err(()), + } + } +} +impl std::fmt::Display for CreatePaymentIntentPaymentMethodOptionsCardSetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreatePaymentIntentPaymentMethodOptionsCardSetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreatePaymentIntentPaymentMethodOptionsCardSetupFutureUsage { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// If 3D Secure authentication was performed with a third-party provider, +/// the authentication details to use for this payment. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreatePaymentIntentPaymentMethodOptionsCardThreeDSecure<'a> { + /// The `transStatus` returned from the card Issuer’s ACS in the ARes. + #[serde(skip_serializing_if = "Option::is_none")] + pub ares_trans_status: + Option, + /// The cryptogram, also known as the "authentication value" (AAV, CAVV or + /// AEVV). This value is 20 bytes, base64-encoded into a 28-character string. + /// (Most 3D Secure providers will return the base64-encoded version, which + /// is what you should specify here.) + pub cryptogram: &'a str, + /// The Electronic Commerce Indicator (ECI) is returned by your 3D Secure + /// provider and indicates what degree of authentication was performed. + #[serde(skip_serializing_if = "Option::is_none")] + pub electronic_commerce_indicator: + Option, + /// The exemption requested via 3DS and accepted by the issuer at authentication time. + #[serde(skip_serializing_if = "Option::is_none")] + pub exemption_indicator: + Option, + /// Network specific 3DS fields. Network specific arguments require an + /// explicit card brand choice. The parameter `payment_method_options.card.network`` + /// must be populated accordingly + #[serde(skip_serializing_if = "Option::is_none")] + pub network_options: + Option>, + /// The challenge indicator (`threeDSRequestorChallengeInd`) which was requested in the + /// AReq sent to the card Issuer's ACS. A string containing 2 digits from 01-99. + #[serde(skip_serializing_if = "Option::is_none")] + pub requestor_challenge_indicator: Option<&'a str>, + /// For 3D Secure 1, the XID. For 3D Secure 2, the Directory Server + /// Transaction ID (dsTransID). + pub transaction_id: &'a str, + /// The version of 3D Secure that was performed. + pub version: CreatePaymentIntentPaymentMethodOptionsCardThreeDSecureVersion, +} +impl<'a> CreatePaymentIntentPaymentMethodOptionsCardThreeDSecure<'a> { + pub fn new( + cryptogram: &'a str, + transaction_id: &'a str, + version: CreatePaymentIntentPaymentMethodOptionsCardThreeDSecureVersion, + ) -> Self { + Self { + ares_trans_status: None, + cryptogram, + electronic_commerce_indicator: None, + exemption_indicator: None, + network_options: None, + requestor_challenge_indicator: None, + transaction_id, + version, + } + } +} +/// The `transStatus` returned from the card Issuer’s ACS in the ARes. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreatePaymentIntentPaymentMethodOptionsCardThreeDSecureAresTransStatus { + A, + C, + I, + N, + R, + U, + Y, +} +impl CreatePaymentIntentPaymentMethodOptionsCardThreeDSecureAresTransStatus { + pub fn as_str(self) -> &'static str { + use CreatePaymentIntentPaymentMethodOptionsCardThreeDSecureAresTransStatus::*; + match self { + A => "A", + C => "C", + I => "I", + N => "N", + R => "R", + U => "U", + Y => "Y", + } + } +} + +impl std::str::FromStr for CreatePaymentIntentPaymentMethodOptionsCardThreeDSecureAresTransStatus { + type Err = (); + fn from_str(s: &str) -> Result { + use CreatePaymentIntentPaymentMethodOptionsCardThreeDSecureAresTransStatus::*; + match s { + "A" => Ok(A), + "C" => Ok(C), + "I" => Ok(I), + "N" => Ok(N), + "R" => Ok(R), + "U" => Ok(U), + "Y" => Ok(Y), + _ => Err(()), + } + } +} +impl std::fmt::Display for CreatePaymentIntentPaymentMethodOptionsCardThreeDSecureAresTransStatus { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreatePaymentIntentPaymentMethodOptionsCardThreeDSecureAresTransStatus { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreatePaymentIntentPaymentMethodOptionsCardThreeDSecureAresTransStatus { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// The Electronic Commerce Indicator (ECI) is returned by your 3D Secure +/// provider and indicates what degree of authentication was performed. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreatePaymentIntentPaymentMethodOptionsCardThreeDSecureElectronicCommerceIndicator { + V01, + V02, + V05, + V06, + V07, +} +impl CreatePaymentIntentPaymentMethodOptionsCardThreeDSecureElectronicCommerceIndicator { + pub fn as_str(self) -> &'static str { + use CreatePaymentIntentPaymentMethodOptionsCardThreeDSecureElectronicCommerceIndicator::*; + match self { + V01 => "01", + V02 => "02", + V05 => "05", + V06 => "06", + V07 => "07", + } + } +} + +impl std::str::FromStr + for CreatePaymentIntentPaymentMethodOptionsCardThreeDSecureElectronicCommerceIndicator +{ + type Err = (); + fn from_str(s: &str) -> Result { + use CreatePaymentIntentPaymentMethodOptionsCardThreeDSecureElectronicCommerceIndicator::*; + match s { + "01" => Ok(V01), + "02" => Ok(V02), + "05" => Ok(V05), + "06" => Ok(V06), + "07" => Ok(V07), + _ => Err(()), + } + } +} +impl std::fmt::Display + for CreatePaymentIntentPaymentMethodOptionsCardThreeDSecureElectronicCommerceIndicator +{ + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug + for CreatePaymentIntentPaymentMethodOptionsCardThreeDSecureElectronicCommerceIndicator +{ + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize + for CreatePaymentIntentPaymentMethodOptionsCardThreeDSecureElectronicCommerceIndicator +{ + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// The exemption requested via 3DS and accepted by the issuer at authentication time. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreatePaymentIntentPaymentMethodOptionsCardThreeDSecureExemptionIndicator { + LowRisk, + None, +} +impl CreatePaymentIntentPaymentMethodOptionsCardThreeDSecureExemptionIndicator { + pub fn as_str(self) -> &'static str { + use CreatePaymentIntentPaymentMethodOptionsCardThreeDSecureExemptionIndicator::*; + match self { + LowRisk => "low_risk", + None => "none", + } + } +} + +impl std::str::FromStr + for CreatePaymentIntentPaymentMethodOptionsCardThreeDSecureExemptionIndicator +{ + type Err = (); + fn from_str(s: &str) -> Result { + use CreatePaymentIntentPaymentMethodOptionsCardThreeDSecureExemptionIndicator::*; + match s { + "low_risk" => Ok(LowRisk), + "none" => Ok(None), + _ => Err(()), + } + } +} +impl std::fmt::Display + for CreatePaymentIntentPaymentMethodOptionsCardThreeDSecureExemptionIndicator +{ + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreatePaymentIntentPaymentMethodOptionsCardThreeDSecureExemptionIndicator { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize + for CreatePaymentIntentPaymentMethodOptionsCardThreeDSecureExemptionIndicator +{ + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Network specific 3DS fields. Network specific arguments require an +/// explicit card brand choice. The parameter `payment_method_options.card.network`` +/// must be populated accordingly +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreatePaymentIntentPaymentMethodOptionsCardThreeDSecureNetworkOptions<'a> { + /// Cartes Bancaires-specific 3DS fields. + #[serde(skip_serializing_if = "Option::is_none")] + pub cartes_bancaires: Option< + CreatePaymentIntentPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancaires<'a>, + >, +} +impl<'a> CreatePaymentIntentPaymentMethodOptionsCardThreeDSecureNetworkOptions<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// Cartes Bancaires-specific 3DS fields. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreatePaymentIntentPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancaires<'a> { + /// The cryptogram calculation algorithm used by the card Issuer's ACS + /// to calculate the Authentication cryptogram. Also known as `cavvAlgorithm`. + /// messageExtension: CB-AVALGO +pub cb_avalgo: CreatePaymentIntentPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancairesCbAvalgo, + /// The exemption indicator returned from Cartes Bancaires in the ARes. + /// message extension: CB-EXEMPTION; string (4 characters) + /// This is a 3 byte bitmap (low significant byte first and most significant + /// bit first) that has been Base64 encoded +#[serde(skip_serializing_if = "Option::is_none")] +pub cb_exemption: Option<&'a str>, + /// The risk score returned from Cartes Bancaires in the ARes. + /// message extension: CB-SCORE; numeric value 0-99 +#[serde(skip_serializing_if = "Option::is_none")] +pub cb_score: Option, + +} +impl<'a> CreatePaymentIntentPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancaires<'a> { + pub fn new( + cb_avalgo: CreatePaymentIntentPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancairesCbAvalgo, + ) -> Self { + Self { cb_avalgo, cb_exemption: None, cb_score: None } + } +} +/// The cryptogram calculation algorithm used by the card Issuer's ACS +/// to calculate the Authentication cryptogram. Also known as `cavvAlgorithm`. +/// messageExtension: CB-AVALGO +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreatePaymentIntentPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancairesCbAvalgo +{ + V0, + V1, + V2, + V3, + V4, + A, +} +impl CreatePaymentIntentPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancairesCbAvalgo { + pub fn as_str(self) -> &'static str { + use CreatePaymentIntentPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancairesCbAvalgo::*; + match self { + V0 => "0", + V1 => "1", + V2 => "2", + V3 => "3", + V4 => "4", + A => "A", + } + } +} + +impl std::str::FromStr + for CreatePaymentIntentPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancairesCbAvalgo +{ + type Err = (); + fn from_str(s: &str) -> Result { + use CreatePaymentIntentPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancairesCbAvalgo::*; + match s { + "0" => Ok(V0), + "1" => Ok(V1), + "2" => Ok(V2), + "3" => Ok(V3), + "4" => Ok(V4), + "A" => Ok(A), + _ => Err(()), + } + } +} +impl std::fmt::Display + for CreatePaymentIntentPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancairesCbAvalgo +{ + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug + for CreatePaymentIntentPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancairesCbAvalgo +{ + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize + for CreatePaymentIntentPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancairesCbAvalgo +{ + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// The version of 3D Secure that was performed. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreatePaymentIntentPaymentMethodOptionsCardThreeDSecureVersion { + V1_0_2, + V2_1_0, + V2_2_0, +} +impl CreatePaymentIntentPaymentMethodOptionsCardThreeDSecureVersion { + pub fn as_str(self) -> &'static str { + use CreatePaymentIntentPaymentMethodOptionsCardThreeDSecureVersion::*; + match self { + V1_0_2 => "1.0.2", + V2_1_0 => "2.1.0", + V2_2_0 => "2.2.0", + } + } +} + +impl std::str::FromStr for CreatePaymentIntentPaymentMethodOptionsCardThreeDSecureVersion { + type Err = (); + fn from_str(s: &str) -> Result { + use CreatePaymentIntentPaymentMethodOptionsCardThreeDSecureVersion::*; + match s { + "1.0.2" => Ok(V1_0_2), + "2.1.0" => Ok(V2_1_0), + "2.2.0" => Ok(V2_2_0), + _ => Err(()), + } + } +} +impl std::fmt::Display for CreatePaymentIntentPaymentMethodOptionsCardThreeDSecureVersion { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreatePaymentIntentPaymentMethodOptionsCardThreeDSecureVersion { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreatePaymentIntentPaymentMethodOptionsCardThreeDSecureVersion { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// If this is a `cashapp` PaymentMethod, this sub-hash contains details about the Cash App Pay payment method options. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreatePaymentIntentPaymentMethodOptionsCashapp { + /// Controls when the funds will be captured from the customer's account. + /// + /// If provided, this parameter will override the top-level `capture_method` when finalizing the payment with this payment method type. + /// + /// If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter will unset the stored value for this payment method type. + #[serde(skip_serializing_if = "Option::is_none")] + pub capture_method: Option, + /// Indicates that you intend to make future payments with this PaymentIntent's payment method. + /// + /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. + /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + /// + /// When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + /// + /// If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. + #[serde(skip_serializing_if = "Option::is_none")] + pub setup_future_usage: Option, +} +impl CreatePaymentIntentPaymentMethodOptionsCashapp { + pub fn new() -> Self { + Self::default() + } +} +/// Controls when the funds will be captured from the customer's account. +/// +/// If provided, this parameter will override the top-level `capture_method` when finalizing the payment with this payment method type. +/// +/// If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter will unset the stored value for this payment method type. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreatePaymentIntentPaymentMethodOptionsCashappCaptureMethod { + Manual, +} +impl CreatePaymentIntentPaymentMethodOptionsCashappCaptureMethod { + pub fn as_str(self) -> &'static str { + use CreatePaymentIntentPaymentMethodOptionsCashappCaptureMethod::*; + match self { + Manual => "manual", + } + } +} + +impl std::str::FromStr for CreatePaymentIntentPaymentMethodOptionsCashappCaptureMethod { + type Err = (); + fn from_str(s: &str) -> Result { + use CreatePaymentIntentPaymentMethodOptionsCashappCaptureMethod::*; + match s { + "manual" => Ok(Manual), + _ => Err(()), + } + } +} +impl std::fmt::Display for CreatePaymentIntentPaymentMethodOptionsCashappCaptureMethod { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreatePaymentIntentPaymentMethodOptionsCashappCaptureMethod { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreatePaymentIntentPaymentMethodOptionsCashappCaptureMethod { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Indicates that you intend to make future payments with this PaymentIntent's payment method. +/// +/// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. +/// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. +/// +/// When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). +/// +/// If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreatePaymentIntentPaymentMethodOptionsCashappSetupFutureUsage { + None, + OffSession, + OnSession, +} +impl CreatePaymentIntentPaymentMethodOptionsCashappSetupFutureUsage { + pub fn as_str(self) -> &'static str { + use CreatePaymentIntentPaymentMethodOptionsCashappSetupFutureUsage::*; + match self { + None => "none", + OffSession => "off_session", + OnSession => "on_session", + } + } +} + +impl std::str::FromStr for CreatePaymentIntentPaymentMethodOptionsCashappSetupFutureUsage { + type Err = (); + fn from_str(s: &str) -> Result { + use CreatePaymentIntentPaymentMethodOptionsCashappSetupFutureUsage::*; + match s { + "none" => Ok(None), + "off_session" => Ok(OffSession), + "on_session" => Ok(OnSession), + _ => Err(()), + } + } +} +impl std::fmt::Display for CreatePaymentIntentPaymentMethodOptionsCashappSetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreatePaymentIntentPaymentMethodOptionsCashappSetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreatePaymentIntentPaymentMethodOptionsCashappSetupFutureUsage { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// If this is a `customer balance` PaymentMethod, this sub-hash contains details about the customer balance payment method options. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreatePaymentIntentPaymentMethodOptionsCustomerBalance<'a> { + /// Configuration for the bank transfer funding type, if the `funding_type` is set to `bank_transfer`. + #[serde(skip_serializing_if = "Option::is_none")] + pub bank_transfer: + Option>, + /// The funding method type to be used when there are not enough funds in the customer balance. + /// Permitted values include: `bank_transfer`. + #[serde(skip_serializing_if = "Option::is_none")] + pub funding_type: Option, + /// Indicates that you intend to make future payments with this PaymentIntent's payment method. + /// + /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. + /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + /// + /// When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + /// + /// If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. + #[serde(skip_serializing_if = "Option::is_none")] + pub setup_future_usage: + Option, +} +impl<'a> CreatePaymentIntentPaymentMethodOptionsCustomerBalance<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// Configuration for the bank transfer funding type, if the `funding_type` is set to `bank_transfer`. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreatePaymentIntentPaymentMethodOptionsCustomerBalanceBankTransfer<'a> { + /// Configuration for the eu_bank_transfer funding type. +#[serde(skip_serializing_if = "Option::is_none")] +pub eu_bank_transfer: Option>, + /// List of address types that should be returned in the financial_addresses response. + /// If not specified, all valid types will be returned. + /// + /// Permitted values include: `sort_code`, `zengin`, `iban`, or `spei`. +#[serde(skip_serializing_if = "Option::is_none")] +pub requested_address_types: Option<&'a [CreatePaymentIntentPaymentMethodOptionsCustomerBalanceBankTransferRequestedAddressTypes]>, + /// The list of bank transfer types that this PaymentIntent is allowed to use for funding Permitted values include: `eu_bank_transfer`, `gb_bank_transfer`, `jp_bank_transfer`, `mx_bank_transfer`, or `us_bank_transfer`. +#[serde(rename = "type")] +pub type_: CreatePaymentIntentPaymentMethodOptionsCustomerBalanceBankTransferType, + +} +impl<'a> CreatePaymentIntentPaymentMethodOptionsCustomerBalanceBankTransfer<'a> { + pub fn new( + type_: CreatePaymentIntentPaymentMethodOptionsCustomerBalanceBankTransferType, + ) -> Self { + Self { eu_bank_transfer: None, requested_address_types: None, type_ } + } +} +/// List of address types that should be returned in the financial_addresses response. +/// If not specified, all valid types will be returned. +/// +/// Permitted values include: `sort_code`, `zengin`, `iban`, or `spei`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreatePaymentIntentPaymentMethodOptionsCustomerBalanceBankTransferRequestedAddressTypes { + Aba, + Iban, + Sepa, + SortCode, + Spei, + Swift, + Zengin, +} +impl CreatePaymentIntentPaymentMethodOptionsCustomerBalanceBankTransferRequestedAddressTypes { + pub fn as_str(self) -> &'static str { + use CreatePaymentIntentPaymentMethodOptionsCustomerBalanceBankTransferRequestedAddressTypes::*; + match self { + Aba => "aba", + Iban => "iban", + Sepa => "sepa", + SortCode => "sort_code", + Spei => "spei", + Swift => "swift", + Zengin => "zengin", + } + } +} + +impl std::str::FromStr + for CreatePaymentIntentPaymentMethodOptionsCustomerBalanceBankTransferRequestedAddressTypes +{ + type Err = (); + fn from_str(s: &str) -> Result { + use CreatePaymentIntentPaymentMethodOptionsCustomerBalanceBankTransferRequestedAddressTypes::*; + match s { + "aba" => Ok(Aba), + "iban" => Ok(Iban), + "sepa" => Ok(Sepa), + "sort_code" => Ok(SortCode), + "spei" => Ok(Spei), + "swift" => Ok(Swift), + "zengin" => Ok(Zengin), + _ => Err(()), + } + } +} +impl std::fmt::Display + for CreatePaymentIntentPaymentMethodOptionsCustomerBalanceBankTransferRequestedAddressTypes +{ + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug + for CreatePaymentIntentPaymentMethodOptionsCustomerBalanceBankTransferRequestedAddressTypes +{ + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize + for CreatePaymentIntentPaymentMethodOptionsCustomerBalanceBankTransferRequestedAddressTypes +{ + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// The list of bank transfer types that this PaymentIntent is allowed to use for funding Permitted values include: `eu_bank_transfer`, `gb_bank_transfer`, `jp_bank_transfer`, `mx_bank_transfer`, or `us_bank_transfer`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreatePaymentIntentPaymentMethodOptionsCustomerBalanceBankTransferType { + EuBankTransfer, + GbBankTransfer, + JpBankTransfer, + MxBankTransfer, + UsBankTransfer, +} +impl CreatePaymentIntentPaymentMethodOptionsCustomerBalanceBankTransferType { + pub fn as_str(self) -> &'static str { + use CreatePaymentIntentPaymentMethodOptionsCustomerBalanceBankTransferType::*; + match self { + EuBankTransfer => "eu_bank_transfer", + GbBankTransfer => "gb_bank_transfer", + JpBankTransfer => "jp_bank_transfer", + MxBankTransfer => "mx_bank_transfer", + UsBankTransfer => "us_bank_transfer", + } + } +} + +impl std::str::FromStr for CreatePaymentIntentPaymentMethodOptionsCustomerBalanceBankTransferType { + type Err = (); + fn from_str(s: &str) -> Result { + use CreatePaymentIntentPaymentMethodOptionsCustomerBalanceBankTransferType::*; + match s { + "eu_bank_transfer" => Ok(EuBankTransfer), + "gb_bank_transfer" => Ok(GbBankTransfer), + "jp_bank_transfer" => Ok(JpBankTransfer), + "mx_bank_transfer" => Ok(MxBankTransfer), + "us_bank_transfer" => Ok(UsBankTransfer), + _ => Err(()), + } + } +} +impl std::fmt::Display for CreatePaymentIntentPaymentMethodOptionsCustomerBalanceBankTransferType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreatePaymentIntentPaymentMethodOptionsCustomerBalanceBankTransferType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreatePaymentIntentPaymentMethodOptionsCustomerBalanceBankTransferType { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// The funding method type to be used when there are not enough funds in the customer balance. +/// Permitted values include: `bank_transfer`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreatePaymentIntentPaymentMethodOptionsCustomerBalanceFundingType { + BankTransfer, +} +impl CreatePaymentIntentPaymentMethodOptionsCustomerBalanceFundingType { + pub fn as_str(self) -> &'static str { + use CreatePaymentIntentPaymentMethodOptionsCustomerBalanceFundingType::*; + match self { + BankTransfer => "bank_transfer", + } + } +} + +impl std::str::FromStr for CreatePaymentIntentPaymentMethodOptionsCustomerBalanceFundingType { + type Err = (); + fn from_str(s: &str) -> Result { + use CreatePaymentIntentPaymentMethodOptionsCustomerBalanceFundingType::*; + match s { + "bank_transfer" => Ok(BankTransfer), + _ => Err(()), + } + } +} +impl std::fmt::Display for CreatePaymentIntentPaymentMethodOptionsCustomerBalanceFundingType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreatePaymentIntentPaymentMethodOptionsCustomerBalanceFundingType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreatePaymentIntentPaymentMethodOptionsCustomerBalanceFundingType { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Indicates that you intend to make future payments with this PaymentIntent's payment method. +/// +/// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. +/// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. +/// +/// When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). +/// +/// If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreatePaymentIntentPaymentMethodOptionsCustomerBalanceSetupFutureUsage { + None, +} +impl CreatePaymentIntentPaymentMethodOptionsCustomerBalanceSetupFutureUsage { + pub fn as_str(self) -> &'static str { + use CreatePaymentIntentPaymentMethodOptionsCustomerBalanceSetupFutureUsage::*; + match self { + None => "none", + } + } +} + +impl std::str::FromStr for CreatePaymentIntentPaymentMethodOptionsCustomerBalanceSetupFutureUsage { + type Err = (); + fn from_str(s: &str) -> Result { + use CreatePaymentIntentPaymentMethodOptionsCustomerBalanceSetupFutureUsage::*; + match s { + "none" => Ok(None), + _ => Err(()), + } + } +} +impl std::fmt::Display for CreatePaymentIntentPaymentMethodOptionsCustomerBalanceSetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreatePaymentIntentPaymentMethodOptionsCustomerBalanceSetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreatePaymentIntentPaymentMethodOptionsCustomerBalanceSetupFutureUsage { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// If this is a `eps` PaymentMethod, this sub-hash contains details about the EPS payment method options. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreatePaymentIntentPaymentMethodOptionsEps { + /// Indicates that you intend to make future payments with this PaymentIntent's payment method. + /// + /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. + /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + /// + /// When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + /// + /// If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. + #[serde(skip_serializing_if = "Option::is_none")] + pub setup_future_usage: Option, +} +impl CreatePaymentIntentPaymentMethodOptionsEps { + pub fn new() -> Self { + Self::default() + } +} +/// Indicates that you intend to make future payments with this PaymentIntent's payment method. +/// +/// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. +/// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. +/// +/// When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). +/// +/// If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreatePaymentIntentPaymentMethodOptionsEpsSetupFutureUsage { + None, +} +impl CreatePaymentIntentPaymentMethodOptionsEpsSetupFutureUsage { + pub fn as_str(self) -> &'static str { + use CreatePaymentIntentPaymentMethodOptionsEpsSetupFutureUsage::*; + match self { + None => "none", + } + } +} + +impl std::str::FromStr for CreatePaymentIntentPaymentMethodOptionsEpsSetupFutureUsage { + type Err = (); + fn from_str(s: &str) -> Result { + use CreatePaymentIntentPaymentMethodOptionsEpsSetupFutureUsage::*; + match s { + "none" => Ok(None), + _ => Err(()), + } + } +} +impl std::fmt::Display for CreatePaymentIntentPaymentMethodOptionsEpsSetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreatePaymentIntentPaymentMethodOptionsEpsSetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreatePaymentIntentPaymentMethodOptionsEpsSetupFutureUsage { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// If this is a `fpx` PaymentMethod, this sub-hash contains details about the FPX payment method options. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreatePaymentIntentPaymentMethodOptionsFpx { + /// Indicates that you intend to make future payments with this PaymentIntent's payment method. + /// + /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. + /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + /// + /// When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + /// + /// If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. + #[serde(skip_serializing_if = "Option::is_none")] + pub setup_future_usage: Option, +} +impl CreatePaymentIntentPaymentMethodOptionsFpx { + pub fn new() -> Self { + Self::default() + } +} +/// Indicates that you intend to make future payments with this PaymentIntent's payment method. +/// +/// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. +/// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. +/// +/// When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). +/// +/// If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreatePaymentIntentPaymentMethodOptionsFpxSetupFutureUsage { + None, +} +impl CreatePaymentIntentPaymentMethodOptionsFpxSetupFutureUsage { + pub fn as_str(self) -> &'static str { + use CreatePaymentIntentPaymentMethodOptionsFpxSetupFutureUsage::*; + match self { + None => "none", + } + } +} + +impl std::str::FromStr for CreatePaymentIntentPaymentMethodOptionsFpxSetupFutureUsage { + type Err = (); + fn from_str(s: &str) -> Result { + use CreatePaymentIntentPaymentMethodOptionsFpxSetupFutureUsage::*; + match s { + "none" => Ok(None), + _ => Err(()), + } + } +} +impl std::fmt::Display for CreatePaymentIntentPaymentMethodOptionsFpxSetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreatePaymentIntentPaymentMethodOptionsFpxSetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreatePaymentIntentPaymentMethodOptionsFpxSetupFutureUsage { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// If this is a `giropay` PaymentMethod, this sub-hash contains details about the Giropay payment method options. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreatePaymentIntentPaymentMethodOptionsGiropay { + /// Indicates that you intend to make future payments with this PaymentIntent's payment method. + /// + /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. + /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + /// + /// When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + /// + /// If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. + #[serde(skip_serializing_if = "Option::is_none")] + pub setup_future_usage: Option, +} +impl CreatePaymentIntentPaymentMethodOptionsGiropay { + pub fn new() -> Self { + Self::default() + } +} +/// Indicates that you intend to make future payments with this PaymentIntent's payment method. +/// +/// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. +/// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. +/// +/// When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). +/// +/// If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreatePaymentIntentPaymentMethodOptionsGiropaySetupFutureUsage { + None, +} +impl CreatePaymentIntentPaymentMethodOptionsGiropaySetupFutureUsage { + pub fn as_str(self) -> &'static str { + use CreatePaymentIntentPaymentMethodOptionsGiropaySetupFutureUsage::*; + match self { + None => "none", + } + } +} + +impl std::str::FromStr for CreatePaymentIntentPaymentMethodOptionsGiropaySetupFutureUsage { + type Err = (); + fn from_str(s: &str) -> Result { + use CreatePaymentIntentPaymentMethodOptionsGiropaySetupFutureUsage::*; + match s { + "none" => Ok(None), + _ => Err(()), + } + } +} +impl std::fmt::Display for CreatePaymentIntentPaymentMethodOptionsGiropaySetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreatePaymentIntentPaymentMethodOptionsGiropaySetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreatePaymentIntentPaymentMethodOptionsGiropaySetupFutureUsage { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// If this is a `grabpay` PaymentMethod, this sub-hash contains details about the Grabpay payment method options. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreatePaymentIntentPaymentMethodOptionsGrabpay { + /// Indicates that you intend to make future payments with this PaymentIntent's payment method. + /// + /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. + /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + /// + /// When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + /// + /// If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. + #[serde(skip_serializing_if = "Option::is_none")] + pub setup_future_usage: Option, +} +impl CreatePaymentIntentPaymentMethodOptionsGrabpay { + pub fn new() -> Self { + Self::default() + } +} +/// Indicates that you intend to make future payments with this PaymentIntent's payment method. +/// +/// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. +/// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. +/// +/// When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). +/// +/// If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreatePaymentIntentPaymentMethodOptionsGrabpaySetupFutureUsage { + None, +} +impl CreatePaymentIntentPaymentMethodOptionsGrabpaySetupFutureUsage { + pub fn as_str(self) -> &'static str { + use CreatePaymentIntentPaymentMethodOptionsGrabpaySetupFutureUsage::*; + match self { + None => "none", + } + } +} + +impl std::str::FromStr for CreatePaymentIntentPaymentMethodOptionsGrabpaySetupFutureUsage { + type Err = (); + fn from_str(s: &str) -> Result { + use CreatePaymentIntentPaymentMethodOptionsGrabpaySetupFutureUsage::*; + match s { + "none" => Ok(None), + _ => Err(()), + } + } +} +impl std::fmt::Display for CreatePaymentIntentPaymentMethodOptionsGrabpaySetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreatePaymentIntentPaymentMethodOptionsGrabpaySetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreatePaymentIntentPaymentMethodOptionsGrabpaySetupFutureUsage { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// If this is a `ideal` PaymentMethod, this sub-hash contains details about the Ideal payment method options. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreatePaymentIntentPaymentMethodOptionsIdeal { + /// Indicates that you intend to make future payments with this PaymentIntent's payment method. + /// + /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. + /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + /// + /// When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + /// + /// If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. + #[serde(skip_serializing_if = "Option::is_none")] + pub setup_future_usage: Option, +} +impl CreatePaymentIntentPaymentMethodOptionsIdeal { + pub fn new() -> Self { + Self::default() + } +} +/// Indicates that you intend to make future payments with this PaymentIntent's payment method. +/// +/// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. +/// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. +/// +/// When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). +/// +/// If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreatePaymentIntentPaymentMethodOptionsIdealSetupFutureUsage { + None, + OffSession, +} +impl CreatePaymentIntentPaymentMethodOptionsIdealSetupFutureUsage { + pub fn as_str(self) -> &'static str { + use CreatePaymentIntentPaymentMethodOptionsIdealSetupFutureUsage::*; + match self { + None => "none", + OffSession => "off_session", + } + } +} + +impl std::str::FromStr for CreatePaymentIntentPaymentMethodOptionsIdealSetupFutureUsage { + type Err = (); + fn from_str(s: &str) -> Result { + use CreatePaymentIntentPaymentMethodOptionsIdealSetupFutureUsage::*; + match s { + "none" => Ok(None), + "off_session" => Ok(OffSession), + _ => Err(()), + } + } +} +impl std::fmt::Display for CreatePaymentIntentPaymentMethodOptionsIdealSetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreatePaymentIntentPaymentMethodOptionsIdealSetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreatePaymentIntentPaymentMethodOptionsIdealSetupFutureUsage { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// If this is a `klarna` PaymentMethod, this sub-hash contains details about the Klarna payment method options. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreatePaymentIntentPaymentMethodOptionsKlarna { + /// Controls when the funds will be captured from the customer's account. + /// + /// If provided, this parameter will override the top-level `capture_method` when finalizing the payment with this payment method type. + /// + /// If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter will unset the stored value for this payment method type. + #[serde(skip_serializing_if = "Option::is_none")] + pub capture_method: Option, + /// Preferred language of the Klarna authorization page that the customer is redirected to + #[serde(skip_serializing_if = "Option::is_none")] + pub preferred_locale: Option, + /// Indicates that you intend to make future payments with this PaymentIntent's payment method. + /// + /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. + /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + /// + /// When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + /// + /// If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. + #[serde(skip_serializing_if = "Option::is_none")] + pub setup_future_usage: Option, +} +impl CreatePaymentIntentPaymentMethodOptionsKlarna { + pub fn new() -> Self { + Self::default() + } +} +/// Controls when the funds will be captured from the customer's account. +/// +/// If provided, this parameter will override the top-level `capture_method` when finalizing the payment with this payment method type. +/// +/// If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter will unset the stored value for this payment method type. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreatePaymentIntentPaymentMethodOptionsKlarnaCaptureMethod { + Manual, +} +impl CreatePaymentIntentPaymentMethodOptionsKlarnaCaptureMethod { + pub fn as_str(self) -> &'static str { + use CreatePaymentIntentPaymentMethodOptionsKlarnaCaptureMethod::*; + match self { + Manual => "manual", + } + } +} + +impl std::str::FromStr for CreatePaymentIntentPaymentMethodOptionsKlarnaCaptureMethod { + type Err = (); + fn from_str(s: &str) -> Result { + use CreatePaymentIntentPaymentMethodOptionsKlarnaCaptureMethod::*; + match s { + "manual" => Ok(Manual), + _ => Err(()), + } + } +} +impl std::fmt::Display for CreatePaymentIntentPaymentMethodOptionsKlarnaCaptureMethod { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreatePaymentIntentPaymentMethodOptionsKlarnaCaptureMethod { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreatePaymentIntentPaymentMethodOptionsKlarnaCaptureMethod { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Preferred language of the Klarna authorization page that the customer is redirected to +#[derive(Copy, Clone, Eq, PartialEq)] +#[non_exhaustive] +pub enum CreatePaymentIntentPaymentMethodOptionsKlarnaPreferredLocale { + CsMinusCz, + DaMinusDk, + DeMinusAt, + DeMinusCh, + DeMinusDe, + ElMinusGr, + EnMinusAt, + EnMinusAu, + EnMinusBe, + EnMinusCa, + EnMinusCh, + EnMinusCz, + EnMinusDe, + EnMinusDk, + EnMinusEs, + EnMinusFi, + EnMinusFr, + EnMinusGb, + EnMinusGr, + EnMinusIe, + EnMinusIt, + EnMinusNl, + EnMinusNo, + EnMinusNz, + EnMinusPl, + EnMinusPt, + EnMinusSe, + EnMinusUs, + EsMinusEs, + EsMinusUs, + FiMinusFi, + FrMinusBe, + FrMinusCa, + FrMinusCh, + FrMinusFr, + ItMinusCh, + ItMinusIt, + NbMinusNo, + NlMinusBe, + NlMinusNl, + PlMinusPl, + PtMinusPt, + SvMinusFi, + SvMinusSe, + /// An unrecognized value from Stripe. Should not be used as a request parameter. + Unknown, +} +impl CreatePaymentIntentPaymentMethodOptionsKlarnaPreferredLocale { + pub fn as_str(self) -> &'static str { + use CreatePaymentIntentPaymentMethodOptionsKlarnaPreferredLocale::*; + match self { + CsMinusCz => "cs-CZ", + DaMinusDk => "da-DK", + DeMinusAt => "de-AT", + DeMinusCh => "de-CH", + DeMinusDe => "de-DE", + ElMinusGr => "el-GR", + EnMinusAt => "en-AT", + EnMinusAu => "en-AU", + EnMinusBe => "en-BE", + EnMinusCa => "en-CA", + EnMinusCh => "en-CH", + EnMinusCz => "en-CZ", + EnMinusDe => "en-DE", + EnMinusDk => "en-DK", + EnMinusEs => "en-ES", + EnMinusFi => "en-FI", + EnMinusFr => "en-FR", + EnMinusGb => "en-GB", + EnMinusGr => "en-GR", + EnMinusIe => "en-IE", + EnMinusIt => "en-IT", + EnMinusNl => "en-NL", + EnMinusNo => "en-NO", + EnMinusNz => "en-NZ", + EnMinusPl => "en-PL", + EnMinusPt => "en-PT", + EnMinusSe => "en-SE", + EnMinusUs => "en-US", + EsMinusEs => "es-ES", + EsMinusUs => "es-US", + FiMinusFi => "fi-FI", + FrMinusBe => "fr-BE", + FrMinusCa => "fr-CA", + FrMinusCh => "fr-CH", + FrMinusFr => "fr-FR", + ItMinusCh => "it-CH", + ItMinusIt => "it-IT", + NbMinusNo => "nb-NO", + NlMinusBe => "nl-BE", + NlMinusNl => "nl-NL", + PlMinusPl => "pl-PL", + PtMinusPt => "pt-PT", + SvMinusFi => "sv-FI", + SvMinusSe => "sv-SE", + Unknown => "unknown", + } + } +} + +impl std::str::FromStr for CreatePaymentIntentPaymentMethodOptionsKlarnaPreferredLocale { + type Err = (); + fn from_str(s: &str) -> Result { + use CreatePaymentIntentPaymentMethodOptionsKlarnaPreferredLocale::*; + match s { + "cs-CZ" => Ok(CsMinusCz), + "da-DK" => Ok(DaMinusDk), + "de-AT" => Ok(DeMinusAt), + "de-CH" => Ok(DeMinusCh), + "de-DE" => Ok(DeMinusDe), + "el-GR" => Ok(ElMinusGr), + "en-AT" => Ok(EnMinusAt), + "en-AU" => Ok(EnMinusAu), + "en-BE" => Ok(EnMinusBe), + "en-CA" => Ok(EnMinusCa), + "en-CH" => Ok(EnMinusCh), + "en-CZ" => Ok(EnMinusCz), + "en-DE" => Ok(EnMinusDe), + "en-DK" => Ok(EnMinusDk), + "en-ES" => Ok(EnMinusEs), + "en-FI" => Ok(EnMinusFi), + "en-FR" => Ok(EnMinusFr), + "en-GB" => Ok(EnMinusGb), + "en-GR" => Ok(EnMinusGr), + "en-IE" => Ok(EnMinusIe), + "en-IT" => Ok(EnMinusIt), + "en-NL" => Ok(EnMinusNl), + "en-NO" => Ok(EnMinusNo), + "en-NZ" => Ok(EnMinusNz), + "en-PL" => Ok(EnMinusPl), + "en-PT" => Ok(EnMinusPt), + "en-SE" => Ok(EnMinusSe), + "en-US" => Ok(EnMinusUs), + "es-ES" => Ok(EsMinusEs), + "es-US" => Ok(EsMinusUs), + "fi-FI" => Ok(FiMinusFi), + "fr-BE" => Ok(FrMinusBe), + "fr-CA" => Ok(FrMinusCa), + "fr-CH" => Ok(FrMinusCh), + "fr-FR" => Ok(FrMinusFr), + "it-CH" => Ok(ItMinusCh), + "it-IT" => Ok(ItMinusIt), + "nb-NO" => Ok(NbMinusNo), + "nl-BE" => Ok(NlMinusBe), + "nl-NL" => Ok(NlMinusNl), + "pl-PL" => Ok(PlMinusPl), + "pt-PT" => Ok(PtMinusPt), + "sv-FI" => Ok(SvMinusFi), + "sv-SE" => Ok(SvMinusSe), + _ => Err(()), + } + } +} +impl std::fmt::Display for CreatePaymentIntentPaymentMethodOptionsKlarnaPreferredLocale { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreatePaymentIntentPaymentMethodOptionsKlarnaPreferredLocale { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreatePaymentIntentPaymentMethodOptionsKlarnaPreferredLocale { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Indicates that you intend to make future payments with this PaymentIntent's payment method. +/// +/// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. +/// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. +/// +/// When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). +/// +/// If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreatePaymentIntentPaymentMethodOptionsKlarnaSetupFutureUsage { + None, +} +impl CreatePaymentIntentPaymentMethodOptionsKlarnaSetupFutureUsage { + pub fn as_str(self) -> &'static str { + use CreatePaymentIntentPaymentMethodOptionsKlarnaSetupFutureUsage::*; + match self { + None => "none", + } + } +} + +impl std::str::FromStr for CreatePaymentIntentPaymentMethodOptionsKlarnaSetupFutureUsage { + type Err = (); + fn from_str(s: &str) -> Result { + use CreatePaymentIntentPaymentMethodOptionsKlarnaSetupFutureUsage::*; + match s { + "none" => Ok(None), + _ => Err(()), + } + } +} +impl std::fmt::Display for CreatePaymentIntentPaymentMethodOptionsKlarnaSetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreatePaymentIntentPaymentMethodOptionsKlarnaSetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreatePaymentIntentPaymentMethodOptionsKlarnaSetupFutureUsage { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// If this is a `konbini` PaymentMethod, this sub-hash contains details about the Konbini payment method options. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreatePaymentIntentPaymentMethodOptionsKonbini<'a> { + /// An optional 10 to 11 digit numeric-only string determining the confirmation code at applicable convenience stores. + /// Must not consist of only zeroes and could be rejected in case of insufficient uniqueness. + /// We recommend to use the customer's phone number. + #[serde(skip_serializing_if = "Option::is_none")] + pub confirmation_number: Option<&'a str>, + /// The number of calendar days (between 1 and 60) after which Konbini payment instructions will expire. + /// For example, if a PaymentIntent is confirmed with Konbini and `expires_after_days` set to 2 on Monday JST, the instructions will expire on Wednesday 23:59:59 JST. + /// Defaults to 3 days. + #[serde(skip_serializing_if = "Option::is_none")] + pub expires_after_days: Option, + /// The timestamp at which the Konbini payment instructions will expire. + /// Only one of `expires_after_days` or `expires_at` may be set. + #[serde(skip_serializing_if = "Option::is_none")] + pub expires_at: Option, + /// A product descriptor of up to 22 characters, which will appear to customers at the convenience store. + #[serde(skip_serializing_if = "Option::is_none")] + pub product_description: Option<&'a str>, + /// Indicates that you intend to make future payments with this PaymentIntent's payment method. + /// + /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. + /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + /// + /// When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + /// + /// If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. + #[serde(skip_serializing_if = "Option::is_none")] + pub setup_future_usage: Option, +} +impl<'a> CreatePaymentIntentPaymentMethodOptionsKonbini<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// Indicates that you intend to make future payments with this PaymentIntent's payment method. +/// +/// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. +/// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. +/// +/// When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). +/// +/// If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreatePaymentIntentPaymentMethodOptionsKonbiniSetupFutureUsage { + None, +} +impl CreatePaymentIntentPaymentMethodOptionsKonbiniSetupFutureUsage { + pub fn as_str(self) -> &'static str { + use CreatePaymentIntentPaymentMethodOptionsKonbiniSetupFutureUsage::*; + match self { + None => "none", + } + } +} + +impl std::str::FromStr for CreatePaymentIntentPaymentMethodOptionsKonbiniSetupFutureUsage { + type Err = (); + fn from_str(s: &str) -> Result { + use CreatePaymentIntentPaymentMethodOptionsKonbiniSetupFutureUsage::*; + match s { + "none" => Ok(None), + _ => Err(()), + } + } +} +impl std::fmt::Display for CreatePaymentIntentPaymentMethodOptionsKonbiniSetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreatePaymentIntentPaymentMethodOptionsKonbiniSetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreatePaymentIntentPaymentMethodOptionsKonbiniSetupFutureUsage { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// If this is a `link` PaymentMethod, this sub-hash contains details about the Link payment method options. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreatePaymentIntentPaymentMethodOptionsLink<'a> { + /// Controls when the funds will be captured from the customer's account. + /// + /// If provided, this parameter will override the top-level `capture_method` when finalizing the payment with this payment method type. + /// + /// If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter will unset the stored value for this payment method type. + #[serde(skip_serializing_if = "Option::is_none")] + pub capture_method: Option, + /// \[Deprecated\] This is a legacy parameter that no longer has any function. + #[serde(skip_serializing_if = "Option::is_none")] + pub persistent_token: Option<&'a str>, + /// Indicates that you intend to make future payments with this PaymentIntent's payment method. + /// + /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. + /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + /// + /// When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + /// + /// If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. + #[serde(skip_serializing_if = "Option::is_none")] + pub setup_future_usage: Option, +} +impl<'a> CreatePaymentIntentPaymentMethodOptionsLink<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// Controls when the funds will be captured from the customer's account. +/// +/// If provided, this parameter will override the top-level `capture_method` when finalizing the payment with this payment method type. +/// +/// If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter will unset the stored value for this payment method type. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreatePaymentIntentPaymentMethodOptionsLinkCaptureMethod { + Manual, +} +impl CreatePaymentIntentPaymentMethodOptionsLinkCaptureMethod { + pub fn as_str(self) -> &'static str { + use CreatePaymentIntentPaymentMethodOptionsLinkCaptureMethod::*; + match self { + Manual => "manual", + } + } +} + +impl std::str::FromStr for CreatePaymentIntentPaymentMethodOptionsLinkCaptureMethod { + type Err = (); + fn from_str(s: &str) -> Result { + use CreatePaymentIntentPaymentMethodOptionsLinkCaptureMethod::*; + match s { + "manual" => Ok(Manual), + _ => Err(()), + } + } +} +impl std::fmt::Display for CreatePaymentIntentPaymentMethodOptionsLinkCaptureMethod { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreatePaymentIntentPaymentMethodOptionsLinkCaptureMethod { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreatePaymentIntentPaymentMethodOptionsLinkCaptureMethod { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Indicates that you intend to make future payments with this PaymentIntent's payment method. +/// +/// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. +/// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. +/// +/// When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). +/// +/// If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreatePaymentIntentPaymentMethodOptionsLinkSetupFutureUsage { + None, + OffSession, +} +impl CreatePaymentIntentPaymentMethodOptionsLinkSetupFutureUsage { + pub fn as_str(self) -> &'static str { + use CreatePaymentIntentPaymentMethodOptionsLinkSetupFutureUsage::*; + match self { + None => "none", + OffSession => "off_session", + } + } +} + +impl std::str::FromStr for CreatePaymentIntentPaymentMethodOptionsLinkSetupFutureUsage { + type Err = (); + fn from_str(s: &str) -> Result { + use CreatePaymentIntentPaymentMethodOptionsLinkSetupFutureUsage::*; + match s { + "none" => Ok(None), + "off_session" => Ok(OffSession), + _ => Err(()), + } + } +} +impl std::fmt::Display for CreatePaymentIntentPaymentMethodOptionsLinkSetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreatePaymentIntentPaymentMethodOptionsLinkSetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreatePaymentIntentPaymentMethodOptionsLinkSetupFutureUsage { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// If this is a `oxxo` PaymentMethod, this sub-hash contains details about the OXXO payment method options. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreatePaymentIntentPaymentMethodOptionsOxxo { + /// The number of calendar days before an OXXO voucher expires. + /// For example, if you create an OXXO voucher on Monday and you set expires_after_days to 2, the OXXO invoice will expire on Wednesday at 23:59 America/Mexico_City time. + #[serde(skip_serializing_if = "Option::is_none")] + pub expires_after_days: Option, + /// Indicates that you intend to make future payments with this PaymentIntent's payment method. + /// + /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. + /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + /// + /// When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + /// + /// If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. + #[serde(skip_serializing_if = "Option::is_none")] + pub setup_future_usage: Option, +} +impl CreatePaymentIntentPaymentMethodOptionsOxxo { + pub fn new() -> Self { + Self::default() + } +} +/// Indicates that you intend to make future payments with this PaymentIntent's payment method. +/// +/// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. +/// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. +/// +/// When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). +/// +/// If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreatePaymentIntentPaymentMethodOptionsOxxoSetupFutureUsage { + None, +} +impl CreatePaymentIntentPaymentMethodOptionsOxxoSetupFutureUsage { + pub fn as_str(self) -> &'static str { + use CreatePaymentIntentPaymentMethodOptionsOxxoSetupFutureUsage::*; + match self { + None => "none", + } + } +} + +impl std::str::FromStr for CreatePaymentIntentPaymentMethodOptionsOxxoSetupFutureUsage { + type Err = (); + fn from_str(s: &str) -> Result { + use CreatePaymentIntentPaymentMethodOptionsOxxoSetupFutureUsage::*; + match s { + "none" => Ok(None), + _ => Err(()), + } + } +} +impl std::fmt::Display for CreatePaymentIntentPaymentMethodOptionsOxxoSetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreatePaymentIntentPaymentMethodOptionsOxxoSetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreatePaymentIntentPaymentMethodOptionsOxxoSetupFutureUsage { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// If this is a `p24` PaymentMethod, this sub-hash contains details about the Przelewy24 payment method options. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreatePaymentIntentPaymentMethodOptionsP24 { + /// Indicates that you intend to make future payments with this PaymentIntent's payment method. + /// + /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. + /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + /// + /// When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + /// + /// If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. + #[serde(skip_serializing_if = "Option::is_none")] + pub setup_future_usage: Option, + /// Confirm that the payer has accepted the P24 terms and conditions. + #[serde(skip_serializing_if = "Option::is_none")] + pub tos_shown_and_accepted: Option, +} +impl CreatePaymentIntentPaymentMethodOptionsP24 { + pub fn new() -> Self { + Self::default() + } +} +/// Indicates that you intend to make future payments with this PaymentIntent's payment method. +/// +/// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. +/// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. +/// +/// When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). +/// +/// If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreatePaymentIntentPaymentMethodOptionsP24SetupFutureUsage { + None, +} +impl CreatePaymentIntentPaymentMethodOptionsP24SetupFutureUsage { + pub fn as_str(self) -> &'static str { + use CreatePaymentIntentPaymentMethodOptionsP24SetupFutureUsage::*; + match self { + None => "none", + } + } +} + +impl std::str::FromStr for CreatePaymentIntentPaymentMethodOptionsP24SetupFutureUsage { + type Err = (); + fn from_str(s: &str) -> Result { + use CreatePaymentIntentPaymentMethodOptionsP24SetupFutureUsage::*; + match s { + "none" => Ok(None), + _ => Err(()), + } + } +} +impl std::fmt::Display for CreatePaymentIntentPaymentMethodOptionsP24SetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreatePaymentIntentPaymentMethodOptionsP24SetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreatePaymentIntentPaymentMethodOptionsP24SetupFutureUsage { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// If this is a `paynow` PaymentMethod, this sub-hash contains details about the PayNow payment method options. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreatePaymentIntentPaymentMethodOptionsPaynow { + /// Indicates that you intend to make future payments with this PaymentIntent's payment method. + /// + /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. + /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + /// + /// When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + /// + /// If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. + #[serde(skip_serializing_if = "Option::is_none")] + pub setup_future_usage: Option, +} +impl CreatePaymentIntentPaymentMethodOptionsPaynow { + pub fn new() -> Self { + Self::default() + } +} +/// Indicates that you intend to make future payments with this PaymentIntent's payment method. +/// +/// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. +/// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. +/// +/// When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). +/// +/// If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreatePaymentIntentPaymentMethodOptionsPaynowSetupFutureUsage { + None, +} +impl CreatePaymentIntentPaymentMethodOptionsPaynowSetupFutureUsage { + pub fn as_str(self) -> &'static str { + use CreatePaymentIntentPaymentMethodOptionsPaynowSetupFutureUsage::*; + match self { + None => "none", + } + } +} + +impl std::str::FromStr for CreatePaymentIntentPaymentMethodOptionsPaynowSetupFutureUsage { + type Err = (); + fn from_str(s: &str) -> Result { + use CreatePaymentIntentPaymentMethodOptionsPaynowSetupFutureUsage::*; + match s { + "none" => Ok(None), + _ => Err(()), + } + } +} +impl std::fmt::Display for CreatePaymentIntentPaymentMethodOptionsPaynowSetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreatePaymentIntentPaymentMethodOptionsPaynowSetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreatePaymentIntentPaymentMethodOptionsPaynowSetupFutureUsage { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// If this is a `paypal` PaymentMethod, this sub-hash contains details about the PayPal payment method options. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreatePaymentIntentPaymentMethodOptionsPaypal<'a> { + /// Controls when the funds will be captured from the customer's account. + #[serde(skip_serializing_if = "Option::is_none")] + pub capture_method: Option, + /// [Preferred locale](https://stripe.com/docs/payments/paypal/supported-locales) of the PayPal checkout page that the customer is redirected to. + #[serde(skip_serializing_if = "Option::is_none")] + pub preferred_locale: Option, + /// A reference of the PayPal transaction visible to customer which is mapped to PayPal's invoice ID. + /// This must be a globally unique ID if you have configured in your PayPal settings to block multiple payments per invoice ID. + #[serde(skip_serializing_if = "Option::is_none")] + pub reference: Option<&'a str>, + /// The risk correlation ID for an on-session payment using a saved PayPal payment method. + #[serde(skip_serializing_if = "Option::is_none")] + pub risk_correlation_id: Option<&'a str>, + /// Indicates that you intend to make future payments with this PaymentIntent's payment method. + /// + /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. + /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + /// + /// When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + /// + /// If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. + #[serde(skip_serializing_if = "Option::is_none")] + pub setup_future_usage: Option, +} +impl<'a> CreatePaymentIntentPaymentMethodOptionsPaypal<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// Controls when the funds will be captured from the customer's account. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreatePaymentIntentPaymentMethodOptionsPaypalCaptureMethod { + Manual, +} +impl CreatePaymentIntentPaymentMethodOptionsPaypalCaptureMethod { + pub fn as_str(self) -> &'static str { + use CreatePaymentIntentPaymentMethodOptionsPaypalCaptureMethod::*; + match self { + Manual => "manual", + } + } +} + +impl std::str::FromStr for CreatePaymentIntentPaymentMethodOptionsPaypalCaptureMethod { + type Err = (); + fn from_str(s: &str) -> Result { + use CreatePaymentIntentPaymentMethodOptionsPaypalCaptureMethod::*; + match s { + "manual" => Ok(Manual), + _ => Err(()), + } + } +} +impl std::fmt::Display for CreatePaymentIntentPaymentMethodOptionsPaypalCaptureMethod { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreatePaymentIntentPaymentMethodOptionsPaypalCaptureMethod { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreatePaymentIntentPaymentMethodOptionsPaypalCaptureMethod { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// [Preferred locale](https://stripe.com/docs/payments/paypal/supported-locales) of the PayPal checkout page that the customer is redirected to. +#[derive(Copy, Clone, Eq, PartialEq)] +#[non_exhaustive] +pub enum CreatePaymentIntentPaymentMethodOptionsPaypalPreferredLocale { + CsMinusCz, + DaMinusDk, + DeMinusAt, + DeMinusDe, + DeMinusLu, + ElMinusGr, + EnMinusGb, + EnMinusUs, + EsMinusEs, + FiMinusFi, + FrMinusBe, + FrMinusFr, + FrMinusLu, + HuMinusHu, + ItMinusIt, + NlMinusBe, + NlMinusNl, + PlMinusPl, + PtMinusPt, + SkMinusSk, + SvMinusSe, + /// An unrecognized value from Stripe. Should not be used as a request parameter. + Unknown, +} +impl CreatePaymentIntentPaymentMethodOptionsPaypalPreferredLocale { + pub fn as_str(self) -> &'static str { + use CreatePaymentIntentPaymentMethodOptionsPaypalPreferredLocale::*; + match self { + CsMinusCz => "cs-CZ", + DaMinusDk => "da-DK", + DeMinusAt => "de-AT", + DeMinusDe => "de-DE", + DeMinusLu => "de-LU", + ElMinusGr => "el-GR", + EnMinusGb => "en-GB", + EnMinusUs => "en-US", + EsMinusEs => "es-ES", + FiMinusFi => "fi-FI", + FrMinusBe => "fr-BE", + FrMinusFr => "fr-FR", + FrMinusLu => "fr-LU", + HuMinusHu => "hu-HU", + ItMinusIt => "it-IT", + NlMinusBe => "nl-BE", + NlMinusNl => "nl-NL", + PlMinusPl => "pl-PL", + PtMinusPt => "pt-PT", + SkMinusSk => "sk-SK", + SvMinusSe => "sv-SE", + Unknown => "unknown", + } + } +} + +impl std::str::FromStr for CreatePaymentIntentPaymentMethodOptionsPaypalPreferredLocale { + type Err = (); + fn from_str(s: &str) -> Result { + use CreatePaymentIntentPaymentMethodOptionsPaypalPreferredLocale::*; + match s { + "cs-CZ" => Ok(CsMinusCz), + "da-DK" => Ok(DaMinusDk), + "de-AT" => Ok(DeMinusAt), + "de-DE" => Ok(DeMinusDe), + "de-LU" => Ok(DeMinusLu), + "el-GR" => Ok(ElMinusGr), + "en-GB" => Ok(EnMinusGb), + "en-US" => Ok(EnMinusUs), + "es-ES" => Ok(EsMinusEs), + "fi-FI" => Ok(FiMinusFi), + "fr-BE" => Ok(FrMinusBe), + "fr-FR" => Ok(FrMinusFr), + "fr-LU" => Ok(FrMinusLu), + "hu-HU" => Ok(HuMinusHu), + "it-IT" => Ok(ItMinusIt), + "nl-BE" => Ok(NlMinusBe), + "nl-NL" => Ok(NlMinusNl), + "pl-PL" => Ok(PlMinusPl), + "pt-PT" => Ok(PtMinusPt), + "sk-SK" => Ok(SkMinusSk), + "sv-SE" => Ok(SvMinusSe), + _ => Err(()), + } + } +} +impl std::fmt::Display for CreatePaymentIntentPaymentMethodOptionsPaypalPreferredLocale { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreatePaymentIntentPaymentMethodOptionsPaypalPreferredLocale { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreatePaymentIntentPaymentMethodOptionsPaypalPreferredLocale { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Indicates that you intend to make future payments with this PaymentIntent's payment method. +/// +/// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. +/// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. +/// +/// When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). +/// +/// If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreatePaymentIntentPaymentMethodOptionsPaypalSetupFutureUsage { + None, + OffSession, +} +impl CreatePaymentIntentPaymentMethodOptionsPaypalSetupFutureUsage { + pub fn as_str(self) -> &'static str { + use CreatePaymentIntentPaymentMethodOptionsPaypalSetupFutureUsage::*; + match self { + None => "none", + OffSession => "off_session", + } + } +} + +impl std::str::FromStr for CreatePaymentIntentPaymentMethodOptionsPaypalSetupFutureUsage { + type Err = (); + fn from_str(s: &str) -> Result { + use CreatePaymentIntentPaymentMethodOptionsPaypalSetupFutureUsage::*; + match s { + "none" => Ok(None), + "off_session" => Ok(OffSession), + _ => Err(()), + } + } +} +impl std::fmt::Display for CreatePaymentIntentPaymentMethodOptionsPaypalSetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreatePaymentIntentPaymentMethodOptionsPaypalSetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreatePaymentIntentPaymentMethodOptionsPaypalSetupFutureUsage { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// If this is a `pix` PaymentMethod, this sub-hash contains details about the Pix payment method options. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreatePaymentIntentPaymentMethodOptionsPix { + /// The number of seconds (between 10 and 1209600) after which Pix payment will expire. + /// Defaults to 86400 seconds. + #[serde(skip_serializing_if = "Option::is_none")] + pub expires_after_seconds: Option, + /// The timestamp at which the Pix expires (between 10 and 1209600 seconds in the future). + /// Defaults to 1 day in the future. + #[serde(skip_serializing_if = "Option::is_none")] + pub expires_at: Option, + /// Indicates that you intend to make future payments with this PaymentIntent's payment method. + /// + /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. + /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + /// + /// When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + /// + /// If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. + #[serde(skip_serializing_if = "Option::is_none")] + pub setup_future_usage: Option, +} +impl CreatePaymentIntentPaymentMethodOptionsPix { + pub fn new() -> Self { + Self::default() + } +} +/// Indicates that you intend to make future payments with this PaymentIntent's payment method. +/// +/// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. +/// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. +/// +/// When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). +/// +/// If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreatePaymentIntentPaymentMethodOptionsPixSetupFutureUsage { + None, +} +impl CreatePaymentIntentPaymentMethodOptionsPixSetupFutureUsage { + pub fn as_str(self) -> &'static str { + use CreatePaymentIntentPaymentMethodOptionsPixSetupFutureUsage::*; + match self { + None => "none", + } + } +} + +impl std::str::FromStr for CreatePaymentIntentPaymentMethodOptionsPixSetupFutureUsage { + type Err = (); + fn from_str(s: &str) -> Result { + use CreatePaymentIntentPaymentMethodOptionsPixSetupFutureUsage::*; + match s { + "none" => Ok(None), + _ => Err(()), + } + } +} +impl std::fmt::Display for CreatePaymentIntentPaymentMethodOptionsPixSetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreatePaymentIntentPaymentMethodOptionsPixSetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreatePaymentIntentPaymentMethodOptionsPixSetupFutureUsage { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// If this is a `promptpay` PaymentMethod, this sub-hash contains details about the PromptPay payment method options. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreatePaymentIntentPaymentMethodOptionsPromptpay { + /// Indicates that you intend to make future payments with this PaymentIntent's payment method. + /// + /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. + /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + /// + /// When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + /// + /// If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. + #[serde(skip_serializing_if = "Option::is_none")] + pub setup_future_usage: + Option, +} +impl CreatePaymentIntentPaymentMethodOptionsPromptpay { + pub fn new() -> Self { + Self::default() + } +} +/// Indicates that you intend to make future payments with this PaymentIntent's payment method. +/// +/// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. +/// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. +/// +/// When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). +/// +/// If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreatePaymentIntentPaymentMethodOptionsPromptpaySetupFutureUsage { + None, +} +impl CreatePaymentIntentPaymentMethodOptionsPromptpaySetupFutureUsage { + pub fn as_str(self) -> &'static str { + use CreatePaymentIntentPaymentMethodOptionsPromptpaySetupFutureUsage::*; + match self { + None => "none", + } + } +} + +impl std::str::FromStr for CreatePaymentIntentPaymentMethodOptionsPromptpaySetupFutureUsage { + type Err = (); + fn from_str(s: &str) -> Result { + use CreatePaymentIntentPaymentMethodOptionsPromptpaySetupFutureUsage::*; + match s { + "none" => Ok(None), + _ => Err(()), + } + } +} +impl std::fmt::Display for CreatePaymentIntentPaymentMethodOptionsPromptpaySetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreatePaymentIntentPaymentMethodOptionsPromptpaySetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreatePaymentIntentPaymentMethodOptionsPromptpaySetupFutureUsage { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// If this is a `revolut_pay` PaymentMethod, this sub-hash contains details about the Revolut Pay payment method options. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreatePaymentIntentPaymentMethodOptionsRevolutPay { + /// Indicates that you intend to make future payments with this PaymentIntent's payment method. + /// + /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. + /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + /// + /// When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + #[serde(skip_serializing_if = "Option::is_none")] + pub setup_future_usage: + Option, +} +impl CreatePaymentIntentPaymentMethodOptionsRevolutPay { + pub fn new() -> Self { + Self::default() + } +} +/// Indicates that you intend to make future payments with this PaymentIntent's payment method. +/// +/// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. +/// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. +/// +/// When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreatePaymentIntentPaymentMethodOptionsRevolutPaySetupFutureUsage { + None, + OffSession, +} +impl CreatePaymentIntentPaymentMethodOptionsRevolutPaySetupFutureUsage { + pub fn as_str(self) -> &'static str { + use CreatePaymentIntentPaymentMethodOptionsRevolutPaySetupFutureUsage::*; + match self { + None => "none", + OffSession => "off_session", + } + } +} + +impl std::str::FromStr for CreatePaymentIntentPaymentMethodOptionsRevolutPaySetupFutureUsage { + type Err = (); + fn from_str(s: &str) -> Result { + use CreatePaymentIntentPaymentMethodOptionsRevolutPaySetupFutureUsage::*; + match s { + "none" => Ok(None), + "off_session" => Ok(OffSession), + _ => Err(()), + } + } +} +impl std::fmt::Display for CreatePaymentIntentPaymentMethodOptionsRevolutPaySetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreatePaymentIntentPaymentMethodOptionsRevolutPaySetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreatePaymentIntentPaymentMethodOptionsRevolutPaySetupFutureUsage { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// If this is a `sepa_debit` PaymentIntent, this sub-hash contains details about the SEPA Debit payment method options. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreatePaymentIntentPaymentMethodOptionsSepaDebit<'a> { + /// Additional fields for Mandate creation + #[serde(skip_serializing_if = "Option::is_none")] + pub mandate_options: Option<&'a serde_json::Value>, + /// Indicates that you intend to make future payments with this PaymentIntent's payment method. + /// + /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. + /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + /// + /// When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + /// + /// If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. + #[serde(skip_serializing_if = "Option::is_none")] + pub setup_future_usage: + Option, +} +impl<'a> CreatePaymentIntentPaymentMethodOptionsSepaDebit<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// Indicates that you intend to make future payments with this PaymentIntent's payment method. +/// +/// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. +/// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. +/// +/// When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). +/// +/// If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreatePaymentIntentPaymentMethodOptionsSepaDebitSetupFutureUsage { + None, + OffSession, + OnSession, +} +impl CreatePaymentIntentPaymentMethodOptionsSepaDebitSetupFutureUsage { + pub fn as_str(self) -> &'static str { + use CreatePaymentIntentPaymentMethodOptionsSepaDebitSetupFutureUsage::*; + match self { + None => "none", + OffSession => "off_session", + OnSession => "on_session", + } + } +} + +impl std::str::FromStr for CreatePaymentIntentPaymentMethodOptionsSepaDebitSetupFutureUsage { + type Err = (); + fn from_str(s: &str) -> Result { + use CreatePaymentIntentPaymentMethodOptionsSepaDebitSetupFutureUsage::*; + match s { + "none" => Ok(None), + "off_session" => Ok(OffSession), + "on_session" => Ok(OnSession), + _ => Err(()), + } + } +} +impl std::fmt::Display for CreatePaymentIntentPaymentMethodOptionsSepaDebitSetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreatePaymentIntentPaymentMethodOptionsSepaDebitSetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreatePaymentIntentPaymentMethodOptionsSepaDebitSetupFutureUsage { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// If this is a `sofort` PaymentMethod, this sub-hash contains details about the SOFORT payment method options. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreatePaymentIntentPaymentMethodOptionsSofort { + /// Language shown to the payer on redirect. + #[serde(skip_serializing_if = "Option::is_none")] + pub preferred_language: Option, + /// Indicates that you intend to make future payments with this PaymentIntent's payment method. + /// + /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. + /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + /// + /// When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + /// + /// If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. + #[serde(skip_serializing_if = "Option::is_none")] + pub setup_future_usage: Option, +} +impl CreatePaymentIntentPaymentMethodOptionsSofort { + pub fn new() -> Self { + Self::default() + } +} +/// Language shown to the payer on redirect. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreatePaymentIntentPaymentMethodOptionsSofortPreferredLanguage { + De, + En, + Es, + Fr, + It, + Nl, + Pl, +} +impl CreatePaymentIntentPaymentMethodOptionsSofortPreferredLanguage { + pub fn as_str(self) -> &'static str { + use CreatePaymentIntentPaymentMethodOptionsSofortPreferredLanguage::*; + match self { + De => "de", + En => "en", + Es => "es", + Fr => "fr", + It => "it", + Nl => "nl", + Pl => "pl", + } + } +} + +impl std::str::FromStr for CreatePaymentIntentPaymentMethodOptionsSofortPreferredLanguage { + type Err = (); + fn from_str(s: &str) -> Result { + use CreatePaymentIntentPaymentMethodOptionsSofortPreferredLanguage::*; + match s { + "de" => Ok(De), + "en" => Ok(En), + "es" => Ok(Es), + "fr" => Ok(Fr), + "it" => Ok(It), + "nl" => Ok(Nl), + "pl" => Ok(Pl), + _ => Err(()), + } + } +} +impl std::fmt::Display for CreatePaymentIntentPaymentMethodOptionsSofortPreferredLanguage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreatePaymentIntentPaymentMethodOptionsSofortPreferredLanguage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreatePaymentIntentPaymentMethodOptionsSofortPreferredLanguage { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Indicates that you intend to make future payments with this PaymentIntent's payment method. +/// +/// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. +/// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. +/// +/// When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). +/// +/// If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreatePaymentIntentPaymentMethodOptionsSofortSetupFutureUsage { + None, + OffSession, +} +impl CreatePaymentIntentPaymentMethodOptionsSofortSetupFutureUsage { + pub fn as_str(self) -> &'static str { + use CreatePaymentIntentPaymentMethodOptionsSofortSetupFutureUsage::*; + match self { + None => "none", + OffSession => "off_session", + } + } +} + +impl std::str::FromStr for CreatePaymentIntentPaymentMethodOptionsSofortSetupFutureUsage { + type Err = (); + fn from_str(s: &str) -> Result { + use CreatePaymentIntentPaymentMethodOptionsSofortSetupFutureUsage::*; + match s { + "none" => Ok(None), + "off_session" => Ok(OffSession), + _ => Err(()), + } + } +} +impl std::fmt::Display for CreatePaymentIntentPaymentMethodOptionsSofortSetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreatePaymentIntentPaymentMethodOptionsSofortSetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreatePaymentIntentPaymentMethodOptionsSofortSetupFutureUsage { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// If this is a `Swish` PaymentMethod, this sub-hash contains details about the Swish payment method options. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreatePaymentIntentPaymentMethodOptionsSwish<'a> { + /// The order ID displayed in the Swish app after the payment is authorized. + #[serde(skip_serializing_if = "Option::is_none")] + pub reference: Option<&'a str>, + /// Indicates that you intend to make future payments with this PaymentIntent's payment method. + /// + /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. + /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + /// + /// When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + /// + /// If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. + #[serde(skip_serializing_if = "Option::is_none")] + pub setup_future_usage: Option, +} +impl<'a> CreatePaymentIntentPaymentMethodOptionsSwish<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// Indicates that you intend to make future payments with this PaymentIntent's payment method. +/// +/// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. +/// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. +/// +/// When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). +/// +/// If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreatePaymentIntentPaymentMethodOptionsSwishSetupFutureUsage { + None, +} +impl CreatePaymentIntentPaymentMethodOptionsSwishSetupFutureUsage { + pub fn as_str(self) -> &'static str { + use CreatePaymentIntentPaymentMethodOptionsSwishSetupFutureUsage::*; + match self { + None => "none", + } + } +} + +impl std::str::FromStr for CreatePaymentIntentPaymentMethodOptionsSwishSetupFutureUsage { + type Err = (); + fn from_str(s: &str) -> Result { + use CreatePaymentIntentPaymentMethodOptionsSwishSetupFutureUsage::*; + match s { + "none" => Ok(None), + _ => Err(()), + } + } +} +impl std::fmt::Display for CreatePaymentIntentPaymentMethodOptionsSwishSetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreatePaymentIntentPaymentMethodOptionsSwishSetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreatePaymentIntentPaymentMethodOptionsSwishSetupFutureUsage { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// If this is a `us_bank_account` PaymentMethod, this sub-hash contains details about the US bank account payment method options. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreatePaymentIntentPaymentMethodOptionsUsBankAccount<'a> { + /// Additional fields for Financial Connections Session creation + #[serde(skip_serializing_if = "Option::is_none")] + pub financial_connections: + Option>, + /// Additional fields for Mandate creation + #[serde(skip_serializing_if = "Option::is_none")] + pub mandate_options: Option, + /// Additional fields for network related functions + #[serde(skip_serializing_if = "Option::is_none")] + pub networks: Option>, + /// Preferred transaction settlement speed + #[serde(skip_serializing_if = "Option::is_none")] + pub preferred_settlement_speed: + Option, + /// Indicates that you intend to make future payments with this PaymentIntent's payment method. + /// + /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. + /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + /// + /// When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + /// + /// If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. + #[serde(skip_serializing_if = "Option::is_none")] + pub setup_future_usage: + Option, + /// Bank account verification method. + #[serde(skip_serializing_if = "Option::is_none")] + pub verification_method: + Option, +} +impl<'a> CreatePaymentIntentPaymentMethodOptionsUsBankAccount<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// Additional fields for Financial Connections Session creation +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreatePaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnections<'a> { + /// The list of permissions to request. + /// If this parameter is passed, the `payment_method` permission must be included. + /// Valid permissions include: `balances`, `ownership`, `payment_method`, and `transactions`. + #[serde(skip_serializing_if = "Option::is_none")] + pub permissions: Option< + &'a [CreatePaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions], + >, + /// List of data features that you would like to retrieve upon account creation. + #[serde(skip_serializing_if = "Option::is_none")] + pub prefetch: Option< + &'a [CreatePaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch], + >, + /// For webview integrations only. + /// Upon completing OAuth login in the native browser, the user will be redirected to this URL to return to your app. + #[serde(skip_serializing_if = "Option::is_none")] + pub return_url: Option<&'a str>, +} +impl<'a> CreatePaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnections<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// The list of permissions to request. +/// If this parameter is passed, the `payment_method` permission must be included. +/// Valid permissions include: `balances`, `ownership`, `payment_method`, and `transactions`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreatePaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions { + Balances, + Ownership, + PaymentMethod, + Transactions, +} +impl CreatePaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions { + pub fn as_str(self) -> &'static str { + use CreatePaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions::*; + match self { + Balances => "balances", + Ownership => "ownership", + PaymentMethod => "payment_method", + Transactions => "transactions", + } + } +} + +impl std::str::FromStr + for CreatePaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions +{ + type Err = (); + fn from_str(s: &str) -> Result { + use CreatePaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions::*; + match s { + "balances" => Ok(Balances), + "ownership" => Ok(Ownership), + "payment_method" => Ok(PaymentMethod), + "transactions" => Ok(Transactions), + _ => Err(()), + } + } +} +impl std::fmt::Display + for CreatePaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions +{ + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug + for CreatePaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions +{ + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize + for CreatePaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions +{ + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// List of data features that you would like to retrieve upon account creation. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreatePaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch { + Balances, + Transactions, +} +impl CreatePaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch { + pub fn as_str(self) -> &'static str { + use CreatePaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch::*; + match self { + Balances => "balances", + Transactions => "transactions", + } + } +} + +impl std::str::FromStr + for CreatePaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch +{ + type Err = (); + fn from_str(s: &str) -> Result { + use CreatePaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch::*; + match s { + "balances" => Ok(Balances), + "transactions" => Ok(Transactions), + _ => Err(()), + } + } +} +impl std::fmt::Display + for CreatePaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch +{ + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug + for CreatePaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch +{ + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize + for CreatePaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch +{ + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Additional fields for Mandate creation +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreatePaymentIntentPaymentMethodOptionsUsBankAccountMandateOptions { + /// The method used to collect offline mandate customer acceptance. + #[serde(skip_serializing_if = "Option::is_none")] + pub collection_method: + Option, +} +impl CreatePaymentIntentPaymentMethodOptionsUsBankAccountMandateOptions { + pub fn new() -> Self { + Self::default() + } +} +/// The method used to collect offline mandate customer acceptance. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreatePaymentIntentPaymentMethodOptionsUsBankAccountMandateOptionsCollectionMethod { + Paper, +} +impl CreatePaymentIntentPaymentMethodOptionsUsBankAccountMandateOptionsCollectionMethod { + pub fn as_str(self) -> &'static str { + use CreatePaymentIntentPaymentMethodOptionsUsBankAccountMandateOptionsCollectionMethod::*; + match self { + Paper => "paper", + } + } +} + +impl std::str::FromStr + for CreatePaymentIntentPaymentMethodOptionsUsBankAccountMandateOptionsCollectionMethod +{ + type Err = (); + fn from_str(s: &str) -> Result { + use CreatePaymentIntentPaymentMethodOptionsUsBankAccountMandateOptionsCollectionMethod::*; + match s { + "paper" => Ok(Paper), + _ => Err(()), + } + } +} +impl std::fmt::Display + for CreatePaymentIntentPaymentMethodOptionsUsBankAccountMandateOptionsCollectionMethod +{ + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug + for CreatePaymentIntentPaymentMethodOptionsUsBankAccountMandateOptionsCollectionMethod +{ + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize + for CreatePaymentIntentPaymentMethodOptionsUsBankAccountMandateOptionsCollectionMethod +{ + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Additional fields for network related functions +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreatePaymentIntentPaymentMethodOptionsUsBankAccountNetworks<'a> { + /// Triggers validations to run across the selected networks + #[serde(skip_serializing_if = "Option::is_none")] + pub requested: + Option<&'a [CreatePaymentIntentPaymentMethodOptionsUsBankAccountNetworksRequested]>, +} +impl<'a> CreatePaymentIntentPaymentMethodOptionsUsBankAccountNetworks<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// Triggers validations to run across the selected networks +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreatePaymentIntentPaymentMethodOptionsUsBankAccountNetworksRequested { + Ach, + UsDomesticWire, +} +impl CreatePaymentIntentPaymentMethodOptionsUsBankAccountNetworksRequested { + pub fn as_str(self) -> &'static str { + use CreatePaymentIntentPaymentMethodOptionsUsBankAccountNetworksRequested::*; + match self { + Ach => "ach", + UsDomesticWire => "us_domestic_wire", + } + } +} + +impl std::str::FromStr for CreatePaymentIntentPaymentMethodOptionsUsBankAccountNetworksRequested { + type Err = (); + fn from_str(s: &str) -> Result { + use CreatePaymentIntentPaymentMethodOptionsUsBankAccountNetworksRequested::*; + match s { + "ach" => Ok(Ach), + "us_domestic_wire" => Ok(UsDomesticWire), + _ => Err(()), + } + } +} +impl std::fmt::Display for CreatePaymentIntentPaymentMethodOptionsUsBankAccountNetworksRequested { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreatePaymentIntentPaymentMethodOptionsUsBankAccountNetworksRequested { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreatePaymentIntentPaymentMethodOptionsUsBankAccountNetworksRequested { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Preferred transaction settlement speed +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreatePaymentIntentPaymentMethodOptionsUsBankAccountPreferredSettlementSpeed { + Fastest, + Standard, +} +impl CreatePaymentIntentPaymentMethodOptionsUsBankAccountPreferredSettlementSpeed { + pub fn as_str(self) -> &'static str { + use CreatePaymentIntentPaymentMethodOptionsUsBankAccountPreferredSettlementSpeed::*; + match self { + Fastest => "fastest", + Standard => "standard", + } + } +} + +impl std::str::FromStr + for CreatePaymentIntentPaymentMethodOptionsUsBankAccountPreferredSettlementSpeed +{ + type Err = (); + fn from_str(s: &str) -> Result { + use CreatePaymentIntentPaymentMethodOptionsUsBankAccountPreferredSettlementSpeed::*; + match s { + "fastest" => Ok(Fastest), + "standard" => Ok(Standard), + _ => Err(()), + } + } +} +impl std::fmt::Display + for CreatePaymentIntentPaymentMethodOptionsUsBankAccountPreferredSettlementSpeed +{ + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug + for CreatePaymentIntentPaymentMethodOptionsUsBankAccountPreferredSettlementSpeed +{ + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize + for CreatePaymentIntentPaymentMethodOptionsUsBankAccountPreferredSettlementSpeed +{ + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Indicates that you intend to make future payments with this PaymentIntent's payment method. +/// +/// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. +/// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. +/// +/// When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). +/// +/// If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreatePaymentIntentPaymentMethodOptionsUsBankAccountSetupFutureUsage { + None, + OffSession, + OnSession, +} +impl CreatePaymentIntentPaymentMethodOptionsUsBankAccountSetupFutureUsage { + pub fn as_str(self) -> &'static str { + use CreatePaymentIntentPaymentMethodOptionsUsBankAccountSetupFutureUsage::*; + match self { + None => "none", + OffSession => "off_session", + OnSession => "on_session", + } + } +} + +impl std::str::FromStr for CreatePaymentIntentPaymentMethodOptionsUsBankAccountSetupFutureUsage { + type Err = (); + fn from_str(s: &str) -> Result { + use CreatePaymentIntentPaymentMethodOptionsUsBankAccountSetupFutureUsage::*; + match s { + "none" => Ok(None), + "off_session" => Ok(OffSession), + "on_session" => Ok(OnSession), + _ => Err(()), + } + } +} +impl std::fmt::Display for CreatePaymentIntentPaymentMethodOptionsUsBankAccountSetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreatePaymentIntentPaymentMethodOptionsUsBankAccountSetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreatePaymentIntentPaymentMethodOptionsUsBankAccountSetupFutureUsage { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Bank account verification method. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreatePaymentIntentPaymentMethodOptionsUsBankAccountVerificationMethod { + Automatic, + Instant, + Microdeposits, +} +impl CreatePaymentIntentPaymentMethodOptionsUsBankAccountVerificationMethod { + pub fn as_str(self) -> &'static str { + use CreatePaymentIntentPaymentMethodOptionsUsBankAccountVerificationMethod::*; + match self { + Automatic => "automatic", + Instant => "instant", + Microdeposits => "microdeposits", + } + } +} + +impl std::str::FromStr for CreatePaymentIntentPaymentMethodOptionsUsBankAccountVerificationMethod { + type Err = (); + fn from_str(s: &str) -> Result { + use CreatePaymentIntentPaymentMethodOptionsUsBankAccountVerificationMethod::*; + match s { + "automatic" => Ok(Automatic), + "instant" => Ok(Instant), + "microdeposits" => Ok(Microdeposits), + _ => Err(()), + } + } +} +impl std::fmt::Display for CreatePaymentIntentPaymentMethodOptionsUsBankAccountVerificationMethod { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreatePaymentIntentPaymentMethodOptionsUsBankAccountVerificationMethod { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreatePaymentIntentPaymentMethodOptionsUsBankAccountVerificationMethod { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// If this is a `wechat_pay` PaymentMethod, this sub-hash contains details about the WeChat Pay payment method options. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreatePaymentIntentPaymentMethodOptionsWechatPay<'a> { + /// The app ID registered with WeChat Pay. Only required when client is ios or android. + #[serde(skip_serializing_if = "Option::is_none")] + pub app_id: Option<&'a str>, + /// The client type that the end customer will pay from + pub client: CreatePaymentIntentPaymentMethodOptionsWechatPayClient, + /// Indicates that you intend to make future payments with this PaymentIntent's payment method. + /// + /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. + /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + /// + /// When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + /// + /// If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. + #[serde(skip_serializing_if = "Option::is_none")] + pub setup_future_usage: + Option, +} +impl<'a> CreatePaymentIntentPaymentMethodOptionsWechatPay<'a> { + pub fn new(client: CreatePaymentIntentPaymentMethodOptionsWechatPayClient) -> Self { + Self { app_id: None, client, setup_future_usage: None } + } +} +/// The client type that the end customer will pay from +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreatePaymentIntentPaymentMethodOptionsWechatPayClient { + Android, + Ios, + Web, +} +impl CreatePaymentIntentPaymentMethodOptionsWechatPayClient { + pub fn as_str(self) -> &'static str { + use CreatePaymentIntentPaymentMethodOptionsWechatPayClient::*; + match self { + Android => "android", + Ios => "ios", + Web => "web", + } + } +} + +impl std::str::FromStr for CreatePaymentIntentPaymentMethodOptionsWechatPayClient { + type Err = (); + fn from_str(s: &str) -> Result { + use CreatePaymentIntentPaymentMethodOptionsWechatPayClient::*; + match s { + "android" => Ok(Android), + "ios" => Ok(Ios), + "web" => Ok(Web), + _ => Err(()), + } + } +} +impl std::fmt::Display for CreatePaymentIntentPaymentMethodOptionsWechatPayClient { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreatePaymentIntentPaymentMethodOptionsWechatPayClient { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreatePaymentIntentPaymentMethodOptionsWechatPayClient { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Indicates that you intend to make future payments with this PaymentIntent's payment method. +/// +/// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. +/// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. +/// +/// When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). +/// +/// If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreatePaymentIntentPaymentMethodOptionsWechatPaySetupFutureUsage { + None, +} +impl CreatePaymentIntentPaymentMethodOptionsWechatPaySetupFutureUsage { + pub fn as_str(self) -> &'static str { + use CreatePaymentIntentPaymentMethodOptionsWechatPaySetupFutureUsage::*; + match self { + None => "none", + } + } +} + +impl std::str::FromStr for CreatePaymentIntentPaymentMethodOptionsWechatPaySetupFutureUsage { + type Err = (); + fn from_str(s: &str) -> Result { + use CreatePaymentIntentPaymentMethodOptionsWechatPaySetupFutureUsage::*; + match s { + "none" => Ok(None), + _ => Err(()), + } + } +} +impl std::fmt::Display for CreatePaymentIntentPaymentMethodOptionsWechatPaySetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreatePaymentIntentPaymentMethodOptionsWechatPaySetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreatePaymentIntentPaymentMethodOptionsWechatPaySetupFutureUsage { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// If this is a `zip` PaymentMethod, this sub-hash contains details about the Zip payment method options. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreatePaymentIntentPaymentMethodOptionsZip { + /// Indicates that you intend to make future payments with this PaymentIntent's payment method. + /// + /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. + /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + /// + /// When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + /// + /// If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. + #[serde(skip_serializing_if = "Option::is_none")] + pub setup_future_usage: Option, +} +impl CreatePaymentIntentPaymentMethodOptionsZip { + pub fn new() -> Self { + Self::default() + } +} +/// Indicates that you intend to make future payments with this PaymentIntent's payment method. +/// +/// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. +/// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. +/// +/// When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). +/// +/// If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreatePaymentIntentPaymentMethodOptionsZipSetupFutureUsage { + None, +} +impl CreatePaymentIntentPaymentMethodOptionsZipSetupFutureUsage { + pub fn as_str(self) -> &'static str { + use CreatePaymentIntentPaymentMethodOptionsZipSetupFutureUsage::*; + match self { + None => "none", + } + } +} + +impl std::str::FromStr for CreatePaymentIntentPaymentMethodOptionsZipSetupFutureUsage { + type Err = (); + fn from_str(s: &str) -> Result { + use CreatePaymentIntentPaymentMethodOptionsZipSetupFutureUsage::*; + match s { + "none" => Ok(None), + _ => Err(()), + } + } +} +impl std::fmt::Display for CreatePaymentIntentPaymentMethodOptionsZipSetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreatePaymentIntentPaymentMethodOptionsZipSetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreatePaymentIntentPaymentMethodOptionsZipSetupFutureUsage { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Options to configure Radar. +/// Learn more about [Radar Sessions](https://stripe.com/docs/radar/radar-session). +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreatePaymentIntentRadarOptions<'a> { + /// A [Radar Session](https://stripe.com/docs/radar/radar-session) is a snapshot of the browser metadata and device details that help Radar make more accurate predictions on your payments. + #[serde(skip_serializing_if = "Option::is_none")] + pub session: Option<&'a str>, +} +impl<'a> CreatePaymentIntentRadarOptions<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// Shipping information for this PaymentIntent. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreatePaymentIntentShipping<'a> { + /// Shipping address. + pub address: CreatePaymentIntentShippingAddress<'a>, + /// The delivery service that shipped a physical product, such as Fedex, UPS, USPS, etc. + #[serde(skip_serializing_if = "Option::is_none")] + pub carrier: Option<&'a str>, + /// Recipient name. + pub name: &'a str, + /// Recipient phone (including extension). + #[serde(skip_serializing_if = "Option::is_none")] + pub phone: Option<&'a str>, + /// The tracking number for a physical product, obtained from the delivery service. + /// If multiple tracking numbers were generated for this purchase, please separate them with commas. + #[serde(skip_serializing_if = "Option::is_none")] + pub tracking_number: Option<&'a str>, +} +impl<'a> CreatePaymentIntentShipping<'a> { + pub fn new(address: CreatePaymentIntentShippingAddress<'a>, name: &'a str) -> Self { + Self { address, carrier: None, name, phone: None, tracking_number: None } + } +} +/// Shipping address. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreatePaymentIntentShippingAddress<'a> { + /// City, district, suburb, town, or village. + #[serde(skip_serializing_if = "Option::is_none")] + pub city: Option<&'a str>, + /// Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). + #[serde(skip_serializing_if = "Option::is_none")] + pub country: Option<&'a str>, + /// Address line 1 (e.g., street, PO Box, or company name). + #[serde(skip_serializing_if = "Option::is_none")] + pub line1: Option<&'a str>, + /// Address line 2 (e.g., apartment, suite, unit, or building). + #[serde(skip_serializing_if = "Option::is_none")] + pub line2: Option<&'a str>, + /// ZIP or postal code. + #[serde(skip_serializing_if = "Option::is_none")] + pub postal_code: Option<&'a str>, + /// State, county, province, or region. + #[serde(skip_serializing_if = "Option::is_none")] + pub state: Option<&'a str>, +} +impl<'a> CreatePaymentIntentShippingAddress<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// The parameters that you can use to automatically create a Transfer. +/// Learn more about the [use case for connected accounts](https://stripe.com/docs/payments/connected-accounts). +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreatePaymentIntentTransferData<'a> { + /// The amount that will be transferred automatically when a charge succeeds. + /// The amount is capped at the total transaction amount and if no amount is set, + /// the full amount is transferred. + /// + /// If you intend to collect a fee and you need a more robust reporting experience, using + /// [application_fee_amount](https://stripe.com/docs/api/payment_intents/create#create_payment_intent-application_fee_amount). + /// might be a better fit for your integration. + #[serde(skip_serializing_if = "Option::is_none")] + pub amount: Option, + /// If specified, successful charges will be attributed to the destination + /// account for tax reporting, and the funds from charges will be transferred + /// to the destination account. The ID of the resulting transfer will be + /// returned on the successful charge's `transfer` field. + pub destination: &'a str, +} +impl<'a> CreatePaymentIntentTransferData<'a> { + pub fn new(destination: &'a str) -> Self { + Self { amount: None, destination } + } +} +impl<'a> CreatePaymentIntent<'a> { + /// Creates a PaymentIntent object. + /// + /// After the PaymentIntent is created, attach a payment method and [confirm](https://stripe.com/docs/api/payment_intents/confirm). + /// to continue the payment. Learn more about [the available payment flows + /// with the Payment Intents API](https://stripe.com/docs/payments/payment-intents). + /// + /// When you use `confirm=true` during creation, it’s equivalent to creating + /// and confirming the PaymentIntent in the same call. You can use any parameters + /// available in the [confirm API](https://stripe.com/docs/api/payment_intents/confirm) when you supply + /// `confirm=true`. + pub fn send(&self, client: &stripe::Client) -> stripe::Response { + client.send_form("/payment_intents", self, http_types::Method::Post) + } +} +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdatePaymentIntent<'a> { + /// Amount intended to be collected by this PaymentIntent. + /// A positive integer representing how much to charge in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal) (e.g., 100 cents to charge $1.00 or 100 to charge ¥100, a zero-decimal currency). + /// The minimum amount is $0.50 US or [equivalent in charge currency](https://stripe.com/docs/currencies#minimum-and-maximum-charge-amounts). + /// The amount value supports up to eight digits (e.g., a value of 99999999 for a USD charge of $999,999.99). + #[serde(skip_serializing_if = "Option::is_none")] + pub amount: Option, + /// The amount of the application fee (if any) that will be requested to be applied to the payment and transferred to the application owner's Stripe account. + /// The amount of the application fee collected will be capped at the total payment amount. + /// For more information, see the PaymentIntents [use case for connected accounts](https://stripe.com/docs/payments/connected-accounts). + #[serde(skip_serializing_if = "Option::is_none")] + pub application_fee_amount: Option, + /// Controls when the funds will be captured from the customer's account. + #[serde(skip_serializing_if = "Option::is_none")] + pub capture_method: Option, + /// Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. + /// Must be a [supported currency](https://stripe.com/docs/currencies). + #[serde(skip_serializing_if = "Option::is_none")] + pub currency: Option, + /// ID of the Customer this PaymentIntent belongs to, if one exists. + /// + /// Payment methods attached to other Customers cannot be used with this PaymentIntent. + /// + /// If present in combination with [setup_future_usage](https://stripe.com/docs/api#payment_intent_object-setup_future_usage), this PaymentIntent's payment method will be attached to the Customer after the PaymentIntent has been confirmed and any required actions from the user are complete. + #[serde(skip_serializing_if = "Option::is_none")] + pub customer: Option<&'a str>, + /// An arbitrary string attached to the object. Often useful for displaying to users. + #[serde(skip_serializing_if = "Option::is_none")] + pub description: Option<&'a str>, + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, + /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. + /// This can be useful for storing additional information about the object in a structured format. + /// Individual keys can be unset by posting an empty value to them. + /// All keys can be unset by posting an empty value to `metadata`. + #[serde(skip_serializing_if = "Option::is_none")] + pub metadata: Option<&'a std::collections::HashMap>, + /// ID of the payment method (a PaymentMethod, Card, or [compatible Source](https://stripe.com/docs/payments/payment-methods/transitioning#compatibility) object) to attach to this PaymentIntent. + #[serde(skip_serializing_if = "Option::is_none")] + pub payment_method: Option<&'a str>, + /// The ID of the payment method configuration to use with this PaymentIntent. + #[serde(skip_serializing_if = "Option::is_none")] + pub payment_method_configuration: Option<&'a str>, + /// If provided, this hash will be used to create a PaymentMethod. The new PaymentMethod will appear + /// in the [payment_method](https://stripe.com/docs/api/payment_intents/object#payment_intent_object-payment_method). + /// property on the PaymentIntent. + #[serde(skip_serializing_if = "Option::is_none")] + pub payment_method_data: Option>, + /// Payment-method-specific configuration for this PaymentIntent. + #[serde(skip_serializing_if = "Option::is_none")] + pub payment_method_options: Option>, + /// The list of payment method types (for example, card) that this PaymentIntent can use. + /// Use `automatic_payment_methods` to manage payment methods from the [Stripe Dashboard](https://dashboard.stripe.com/settings/payment_methods). + #[serde(skip_serializing_if = "Option::is_none")] + pub payment_method_types: Option<&'a [&'a str]>, + /// Email address that the receipt for the resulting payment will be sent to. + /// If `receipt_email` is specified for a payment in live mode, a receipt will be sent regardless of your [email settings](https://dashboard.stripe.com/account/emails). + #[serde(skip_serializing_if = "Option::is_none")] + pub receipt_email: Option<&'a str>, + /// Indicates that you intend to make future payments with this PaymentIntent's payment method. + /// + /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. + /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + /// + /// When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + /// + /// If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. + #[serde(skip_serializing_if = "Option::is_none")] + pub setup_future_usage: Option, + /// Shipping information for this PaymentIntent. + #[serde(skip_serializing_if = "Option::is_none")] + pub shipping: Option>, + /// For card charges, use [statement_descriptor_suffix](https://stripe.com/docs/payments/account/statement-descriptors#dynamic). + /// Otherwise, you can use this value as the complete description of a charge on your customers' statements. + /// It must contain at least one letter and be 1–22 characters long. + #[serde(skip_serializing_if = "Option::is_none")] + pub statement_descriptor: Option<&'a str>, + /// Provides information about a card payment that customers see on their statements. + /// Concatenated with the prefix (shortened descriptor) or statement descriptor that’s set on the account to form the complete statement descriptor. + /// Maximum 22 characters for the concatenated descriptor. + #[serde(skip_serializing_if = "Option::is_none")] + pub statement_descriptor_suffix: Option<&'a str>, + /// Use this parameter to automatically create a Transfer when the payment succeeds. + /// Learn more about the [use case for connected accounts](https://stripe.com/docs/payments/connected-accounts). + #[serde(skip_serializing_if = "Option::is_none")] + pub transfer_data: Option, + /// A string that identifies the resulting payment as part of a group. + /// You can only provide `transfer_group` if it hasn't been set. + /// Learn more about the [use case for connected accounts](https://stripe.com/docs/payments/connected-accounts). + #[serde(skip_serializing_if = "Option::is_none")] + pub transfer_group: Option<&'a str>, +} +impl<'a> UpdatePaymentIntent<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// If provided, this hash will be used to create a PaymentMethod. The new PaymentMethod will appear +/// in the [payment_method](https://stripe.com/docs/api/payment_intents/object#payment_intent_object-payment_method). +/// property on the PaymentIntent. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct UpdatePaymentIntentPaymentMethodData<'a> { + /// If this is an `acss_debit` PaymentMethod, this hash contains details about the ACSS Debit payment method. + #[serde(skip_serializing_if = "Option::is_none")] + pub acss_debit: Option>, + /// If this is an `affirm` PaymentMethod, this hash contains details about the Affirm payment method. + #[serde(skip_serializing_if = "Option::is_none")] + pub affirm: Option<&'a serde_json::Value>, + /// If this is an `AfterpayClearpay` PaymentMethod, this hash contains details about the AfterpayClearpay payment method. + #[serde(skip_serializing_if = "Option::is_none")] + pub afterpay_clearpay: Option<&'a serde_json::Value>, + /// If this is an `Alipay` PaymentMethod, this hash contains details about the Alipay payment method. + #[serde(skip_serializing_if = "Option::is_none")] + pub alipay: Option<&'a serde_json::Value>, + /// If this is an `au_becs_debit` PaymentMethod, this hash contains details about the bank account. + #[serde(skip_serializing_if = "Option::is_none")] + pub au_becs_debit: Option>, + /// If this is a `bacs_debit` PaymentMethod, this hash contains details about the Bacs Direct Debit bank account. + #[serde(skip_serializing_if = "Option::is_none")] + pub bacs_debit: Option>, + /// If this is a `bancontact` PaymentMethod, this hash contains details about the Bancontact payment method. + #[serde(skip_serializing_if = "Option::is_none")] + pub bancontact: Option<&'a serde_json::Value>, + /// Billing information associated with the PaymentMethod that may be used or required by particular types of payment methods. + #[serde(skip_serializing_if = "Option::is_none")] + pub billing_details: Option>, + /// If this is a `blik` PaymentMethod, this hash contains details about the BLIK payment method. + #[serde(skip_serializing_if = "Option::is_none")] + pub blik: Option<&'a serde_json::Value>, + /// If this is a `boleto` PaymentMethod, this hash contains details about the Boleto payment method. + #[serde(skip_serializing_if = "Option::is_none")] + pub boleto: Option>, + /// If this is a `cashapp` PaymentMethod, this hash contains details about the Cash App Pay payment method. + #[serde(skip_serializing_if = "Option::is_none")] + pub cashapp: Option<&'a serde_json::Value>, + /// If this is a `customer_balance` PaymentMethod, this hash contains details about the CustomerBalance payment method. + #[serde(skip_serializing_if = "Option::is_none")] + pub customer_balance: Option<&'a serde_json::Value>, + /// If this is an `eps` PaymentMethod, this hash contains details about the EPS payment method. + #[serde(skip_serializing_if = "Option::is_none")] + pub eps: Option, + /// If this is an `fpx` PaymentMethod, this hash contains details about the FPX payment method. + #[serde(skip_serializing_if = "Option::is_none")] + pub fpx: Option, + /// If this is a `giropay` PaymentMethod, this hash contains details about the Giropay payment method. + #[serde(skip_serializing_if = "Option::is_none")] + pub giropay: Option<&'a serde_json::Value>, + /// If this is a `grabpay` PaymentMethod, this hash contains details about the GrabPay payment method. + #[serde(skip_serializing_if = "Option::is_none")] + pub grabpay: Option<&'a serde_json::Value>, + /// If this is an `ideal` PaymentMethod, this hash contains details about the iDEAL payment method. + #[serde(skip_serializing_if = "Option::is_none")] + pub ideal: Option, + /// If this is an `interac_present` PaymentMethod, this hash contains details about the Interac Present payment method. + #[serde(skip_serializing_if = "Option::is_none")] + pub interac_present: Option<&'a serde_json::Value>, + /// If this is a `klarna` PaymentMethod, this hash contains details about the Klarna payment method. + #[serde(skip_serializing_if = "Option::is_none")] + pub klarna: Option, + /// If this is a `konbini` PaymentMethod, this hash contains details about the Konbini payment method. + #[serde(skip_serializing_if = "Option::is_none")] + pub konbini: Option<&'a serde_json::Value>, + /// If this is an `Link` PaymentMethod, this hash contains details about the Link payment method. + #[serde(skip_serializing_if = "Option::is_none")] + pub link: Option<&'a serde_json::Value>, + /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. + /// This can be useful for storing additional information about the object in a structured format. + /// Individual keys can be unset by posting an empty value to them. + /// All keys can be unset by posting an empty value to `metadata`. + #[serde(skip_serializing_if = "Option::is_none")] + pub metadata: Option<&'a std::collections::HashMap>, + /// If this is an `oxxo` PaymentMethod, this hash contains details about the OXXO payment method. + #[serde(skip_serializing_if = "Option::is_none")] + pub oxxo: Option<&'a serde_json::Value>, + /// If this is a `p24` PaymentMethod, this hash contains details about the P24 payment method. + #[serde(skip_serializing_if = "Option::is_none")] + pub p24: Option, + /// If this is a `paynow` PaymentMethod, this hash contains details about the PayNow payment method. + #[serde(skip_serializing_if = "Option::is_none")] + pub paynow: Option<&'a serde_json::Value>, + /// If this is a `paypal` PaymentMethod, this hash contains details about the PayPal payment method. + #[serde(skip_serializing_if = "Option::is_none")] + pub paypal: Option<&'a serde_json::Value>, + /// If this is a `pix` PaymentMethod, this hash contains details about the Pix payment method. + #[serde(skip_serializing_if = "Option::is_none")] + pub pix: Option<&'a serde_json::Value>, + /// If this is a `promptpay` PaymentMethod, this hash contains details about the PromptPay payment method. + #[serde(skip_serializing_if = "Option::is_none")] + pub promptpay: Option<&'a serde_json::Value>, + /// Options to configure Radar. + /// See [Radar Session](https://stripe.com/docs/radar/radar-session) for more information. + #[serde(skip_serializing_if = "Option::is_none")] + pub radar_options: Option>, + /// If this is a `Revolut Pay` PaymentMethod, this hash contains details about the Revolut Pay payment method. + #[serde(skip_serializing_if = "Option::is_none")] + pub revolut_pay: Option<&'a serde_json::Value>, + /// If this is a `sepa_debit` PaymentMethod, this hash contains details about the SEPA debit bank account. + #[serde(skip_serializing_if = "Option::is_none")] + pub sepa_debit: Option>, + /// If this is a `sofort` PaymentMethod, this hash contains details about the SOFORT payment method. + #[serde(skip_serializing_if = "Option::is_none")] + pub sofort: Option, + /// If this is a `swish` PaymentMethod, this hash contains details about the Swish payment method. + #[serde(skip_serializing_if = "Option::is_none")] + pub swish: Option<&'a serde_json::Value>, + /// The type of the PaymentMethod. + /// An additional hash is included on the PaymentMethod with a name matching this value. + /// It contains additional information specific to the PaymentMethod type. + #[serde(rename = "type")] + pub type_: UpdatePaymentIntentPaymentMethodDataType, + /// If this is an `us_bank_account` PaymentMethod, this hash contains details about the US bank account payment method. + #[serde(skip_serializing_if = "Option::is_none")] + pub us_bank_account: Option>, + /// If this is an `wechat_pay` PaymentMethod, this hash contains details about the wechat_pay payment method. + #[serde(skip_serializing_if = "Option::is_none")] + pub wechat_pay: Option<&'a serde_json::Value>, + /// If this is a `zip` PaymentMethod, this hash contains details about the Zip payment method. + #[serde(skip_serializing_if = "Option::is_none")] + pub zip: Option<&'a serde_json::Value>, +} +impl<'a> UpdatePaymentIntentPaymentMethodData<'a> { + pub fn new(type_: UpdatePaymentIntentPaymentMethodDataType) -> Self { + Self { + acss_debit: None, + affirm: None, + afterpay_clearpay: None, + alipay: None, + au_becs_debit: None, + bacs_debit: None, + bancontact: None, + billing_details: None, + blik: None, + boleto: None, + cashapp: None, + customer_balance: None, + eps: None, + fpx: None, + giropay: None, + grabpay: None, + ideal: None, + interac_present: None, + klarna: None, + konbini: None, + link: None, + metadata: None, + oxxo: None, + p24: None, + paynow: None, + paypal: None, + pix: None, + promptpay: None, + radar_options: None, + revolut_pay: None, + sepa_debit: None, + sofort: None, + swish: None, + type_, + us_bank_account: None, + wechat_pay: None, + zip: None, + } + } +} +/// If this is an `au_becs_debit` PaymentMethod, this hash contains details about the bank account. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct UpdatePaymentIntentPaymentMethodDataAuBecsDebit<'a> { + /// The account number for the bank account. + pub account_number: &'a str, + /// Bank-State-Branch number of the bank account. + pub bsb_number: &'a str, +} +impl<'a> UpdatePaymentIntentPaymentMethodDataAuBecsDebit<'a> { + pub fn new(account_number: &'a str, bsb_number: &'a str) -> Self { + Self { account_number, bsb_number } + } +} +/// If this is a `bacs_debit` PaymentMethod, this hash contains details about the Bacs Direct Debit bank account. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdatePaymentIntentPaymentMethodDataBacsDebit<'a> { + /// Account number of the bank account that the funds will be debited from. + #[serde(skip_serializing_if = "Option::is_none")] + pub account_number: Option<&'a str>, + /// Sort code of the bank account. (e.g., `10-20-30`) + #[serde(skip_serializing_if = "Option::is_none")] + pub sort_code: Option<&'a str>, +} +impl<'a> UpdatePaymentIntentPaymentMethodDataBacsDebit<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// Billing information associated with the PaymentMethod that may be used or required by particular types of payment methods. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdatePaymentIntentPaymentMethodDataBillingDetails<'a> { + /// Billing address. + #[serde(skip_serializing_if = "Option::is_none")] + pub address: Option>, + /// Email address. + #[serde(skip_serializing_if = "Option::is_none")] + pub email: Option<&'a str>, + /// Full name. + #[serde(skip_serializing_if = "Option::is_none")] + pub name: Option<&'a str>, + /// Billing phone number (including extension). + #[serde(skip_serializing_if = "Option::is_none")] + pub phone: Option<&'a str>, +} +impl<'a> UpdatePaymentIntentPaymentMethodDataBillingDetails<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// Billing address. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdatePaymentIntentPaymentMethodDataBillingDetailsAddress<'a> { + /// City, district, suburb, town, or village. + #[serde(skip_serializing_if = "Option::is_none")] + pub city: Option<&'a str>, + /// Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). + #[serde(skip_serializing_if = "Option::is_none")] + pub country: Option<&'a str>, + /// Address line 1 (e.g., street, PO Box, or company name). + #[serde(skip_serializing_if = "Option::is_none")] + pub line1: Option<&'a str>, + /// Address line 2 (e.g., apartment, suite, unit, or building). + #[serde(skip_serializing_if = "Option::is_none")] + pub line2: Option<&'a str>, + /// ZIP or postal code. + #[serde(skip_serializing_if = "Option::is_none")] + pub postal_code: Option<&'a str>, + /// State, county, province, or region. + #[serde(skip_serializing_if = "Option::is_none")] + pub state: Option<&'a str>, +} +impl<'a> UpdatePaymentIntentPaymentMethodDataBillingDetailsAddress<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// If this is a `boleto` PaymentMethod, this hash contains details about the Boleto payment method. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct UpdatePaymentIntentPaymentMethodDataBoleto<'a> { + /// The tax ID of the customer (CPF for individual consumers or CNPJ for businesses consumers) + pub tax_id: &'a str, +} +impl<'a> UpdatePaymentIntentPaymentMethodDataBoleto<'a> { + pub fn new(tax_id: &'a str) -> Self { + Self { tax_id } + } +} +/// If this is an `eps` PaymentMethod, this hash contains details about the EPS payment method. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdatePaymentIntentPaymentMethodDataEps { + /// The customer's bank. + #[serde(skip_serializing_if = "Option::is_none")] + pub bank: Option, +} +impl UpdatePaymentIntentPaymentMethodDataEps { + pub fn new() -> Self { + Self::default() + } +} +/// The customer's bank. +#[derive(Copy, Clone, Eq, PartialEq)] +#[non_exhaustive] +pub enum UpdatePaymentIntentPaymentMethodDataEpsBank { + ArzteUndApothekerBank, + AustrianAnadiBankAg, + BankAustria, + BankhausCarlSpangler, + BankhausSchelhammerUndSchatteraAg, + BawagPskAg, + BksBankAg, + BrullKallmusBankAg, + BtvVierLanderBank, + CapitalBankGraweGruppeAg, + DeutscheBankAg, + Dolomitenbank, + EasybankAg, + ErsteBankUndSparkassen, + HypoAlpeadriabankInternationalAg, + HypoBankBurgenlandAktiengesellschaft, + HypoNoeLbFurNiederosterreichUWien, + HypoOberosterreichSalzburgSteiermark, + HypoTirolBankAg, + HypoVorarlbergBankAg, + MarchfelderBank, + OberbankAg, + RaiffeisenBankengruppeOsterreich, + SchoellerbankAg, + SpardaBankWien, + VolksbankGruppe, + VolkskreditbankAg, + VrBankBraunau, + /// An unrecognized value from Stripe. Should not be used as a request parameter. + Unknown, +} +impl UpdatePaymentIntentPaymentMethodDataEpsBank { + pub fn as_str(self) -> &'static str { + use UpdatePaymentIntentPaymentMethodDataEpsBank::*; + match self { + ArzteUndApothekerBank => "arzte_und_apotheker_bank", + AustrianAnadiBankAg => "austrian_anadi_bank_ag", + BankAustria => "bank_austria", + BankhausCarlSpangler => "bankhaus_carl_spangler", + BankhausSchelhammerUndSchatteraAg => "bankhaus_schelhammer_und_schattera_ag", + BawagPskAg => "bawag_psk_ag", + BksBankAg => "bks_bank_ag", + BrullKallmusBankAg => "brull_kallmus_bank_ag", + BtvVierLanderBank => "btv_vier_lander_bank", + CapitalBankGraweGruppeAg => "capital_bank_grawe_gruppe_ag", + DeutscheBankAg => "deutsche_bank_ag", + Dolomitenbank => "dolomitenbank", + EasybankAg => "easybank_ag", + ErsteBankUndSparkassen => "erste_bank_und_sparkassen", + HypoAlpeadriabankInternationalAg => "hypo_alpeadriabank_international_ag", + HypoBankBurgenlandAktiengesellschaft => "hypo_bank_burgenland_aktiengesellschaft", + HypoNoeLbFurNiederosterreichUWien => "hypo_noe_lb_fur_niederosterreich_u_wien", + HypoOberosterreichSalzburgSteiermark => "hypo_oberosterreich_salzburg_steiermark", + HypoTirolBankAg => "hypo_tirol_bank_ag", + HypoVorarlbergBankAg => "hypo_vorarlberg_bank_ag", + MarchfelderBank => "marchfelder_bank", + OberbankAg => "oberbank_ag", + RaiffeisenBankengruppeOsterreich => "raiffeisen_bankengruppe_osterreich", + SchoellerbankAg => "schoellerbank_ag", + SpardaBankWien => "sparda_bank_wien", + VolksbankGruppe => "volksbank_gruppe", + VolkskreditbankAg => "volkskreditbank_ag", + VrBankBraunau => "vr_bank_braunau", + Unknown => "unknown", + } + } +} + +impl std::str::FromStr for UpdatePaymentIntentPaymentMethodDataEpsBank { + type Err = (); + fn from_str(s: &str) -> Result { + use UpdatePaymentIntentPaymentMethodDataEpsBank::*; + match s { + "arzte_und_apotheker_bank" => Ok(ArzteUndApothekerBank), + "austrian_anadi_bank_ag" => Ok(AustrianAnadiBankAg), + "bank_austria" => Ok(BankAustria), + "bankhaus_carl_spangler" => Ok(BankhausCarlSpangler), + "bankhaus_schelhammer_und_schattera_ag" => Ok(BankhausSchelhammerUndSchatteraAg), + "bawag_psk_ag" => Ok(BawagPskAg), + "bks_bank_ag" => Ok(BksBankAg), + "brull_kallmus_bank_ag" => Ok(BrullKallmusBankAg), + "btv_vier_lander_bank" => Ok(BtvVierLanderBank), + "capital_bank_grawe_gruppe_ag" => Ok(CapitalBankGraweGruppeAg), + "deutsche_bank_ag" => Ok(DeutscheBankAg), + "dolomitenbank" => Ok(Dolomitenbank), + "easybank_ag" => Ok(EasybankAg), + "erste_bank_und_sparkassen" => Ok(ErsteBankUndSparkassen), + "hypo_alpeadriabank_international_ag" => Ok(HypoAlpeadriabankInternationalAg), + "hypo_bank_burgenland_aktiengesellschaft" => Ok(HypoBankBurgenlandAktiengesellschaft), + "hypo_noe_lb_fur_niederosterreich_u_wien" => Ok(HypoNoeLbFurNiederosterreichUWien), + "hypo_oberosterreich_salzburg_steiermark" => Ok(HypoOberosterreichSalzburgSteiermark), + "hypo_tirol_bank_ag" => Ok(HypoTirolBankAg), + "hypo_vorarlberg_bank_ag" => Ok(HypoVorarlbergBankAg), + "marchfelder_bank" => Ok(MarchfelderBank), + "oberbank_ag" => Ok(OberbankAg), + "raiffeisen_bankengruppe_osterreich" => Ok(RaiffeisenBankengruppeOsterreich), + "schoellerbank_ag" => Ok(SchoellerbankAg), + "sparda_bank_wien" => Ok(SpardaBankWien), + "volksbank_gruppe" => Ok(VolksbankGruppe), + "volkskreditbank_ag" => Ok(VolkskreditbankAg), + "vr_bank_braunau" => Ok(VrBankBraunau), + _ => Err(()), + } + } +} +impl std::fmt::Display for UpdatePaymentIntentPaymentMethodDataEpsBank { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for UpdatePaymentIntentPaymentMethodDataEpsBank { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for UpdatePaymentIntentPaymentMethodDataEpsBank { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// If this is an `fpx` PaymentMethod, this hash contains details about the FPX payment method. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct UpdatePaymentIntentPaymentMethodDataFpx { + /// Account holder type for FPX transaction + #[serde(skip_serializing_if = "Option::is_none")] + pub account_holder_type: Option, + /// The customer's bank. + pub bank: UpdatePaymentIntentPaymentMethodDataFpxBank, +} +impl UpdatePaymentIntentPaymentMethodDataFpx { + pub fn new(bank: UpdatePaymentIntentPaymentMethodDataFpxBank) -> Self { + Self { account_holder_type: None, bank } + } +} +/// Account holder type for FPX transaction +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum UpdatePaymentIntentPaymentMethodDataFpxAccountHolderType { + Company, + Individual, +} +impl UpdatePaymentIntentPaymentMethodDataFpxAccountHolderType { + pub fn as_str(self) -> &'static str { + use UpdatePaymentIntentPaymentMethodDataFpxAccountHolderType::*; + match self { + Company => "company", + Individual => "individual", + } + } +} + +impl std::str::FromStr for UpdatePaymentIntentPaymentMethodDataFpxAccountHolderType { + type Err = (); + fn from_str(s: &str) -> Result { + use UpdatePaymentIntentPaymentMethodDataFpxAccountHolderType::*; + match s { + "company" => Ok(Company), + "individual" => Ok(Individual), + _ => Err(()), + } + } +} +impl std::fmt::Display for UpdatePaymentIntentPaymentMethodDataFpxAccountHolderType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for UpdatePaymentIntentPaymentMethodDataFpxAccountHolderType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for UpdatePaymentIntentPaymentMethodDataFpxAccountHolderType { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// The customer's bank. +#[derive(Copy, Clone, Eq, PartialEq)] +#[non_exhaustive] +pub enum UpdatePaymentIntentPaymentMethodDataFpxBank { + AffinBank, + Agrobank, + AllianceBank, + Ambank, + BankIslam, + BankMuamalat, + BankOfChina, + BankRakyat, + Bsn, + Cimb, + DeutscheBank, + HongLeongBank, + Hsbc, + Kfh, + Maybank2e, + Maybank2u, + Ocbc, + PbEnterprise, + PublicBank, + Rhb, + StandardChartered, + Uob, + /// An unrecognized value from Stripe. Should not be used as a request parameter. + Unknown, +} +impl UpdatePaymentIntentPaymentMethodDataFpxBank { + pub fn as_str(self) -> &'static str { + use UpdatePaymentIntentPaymentMethodDataFpxBank::*; + match self { + AffinBank => "affin_bank", + Agrobank => "agrobank", + AllianceBank => "alliance_bank", + Ambank => "ambank", + BankIslam => "bank_islam", + BankMuamalat => "bank_muamalat", + BankOfChina => "bank_of_china", + BankRakyat => "bank_rakyat", + Bsn => "bsn", + Cimb => "cimb", + DeutscheBank => "deutsche_bank", + HongLeongBank => "hong_leong_bank", + Hsbc => "hsbc", + Kfh => "kfh", + Maybank2e => "maybank2e", + Maybank2u => "maybank2u", + Ocbc => "ocbc", + PbEnterprise => "pb_enterprise", + PublicBank => "public_bank", + Rhb => "rhb", + StandardChartered => "standard_chartered", + Uob => "uob", + Unknown => "unknown", + } + } +} + +impl std::str::FromStr for UpdatePaymentIntentPaymentMethodDataFpxBank { + type Err = (); + fn from_str(s: &str) -> Result { + use UpdatePaymentIntentPaymentMethodDataFpxBank::*; + match s { + "affin_bank" => Ok(AffinBank), + "agrobank" => Ok(Agrobank), + "alliance_bank" => Ok(AllianceBank), + "ambank" => Ok(Ambank), + "bank_islam" => Ok(BankIslam), + "bank_muamalat" => Ok(BankMuamalat), + "bank_of_china" => Ok(BankOfChina), + "bank_rakyat" => Ok(BankRakyat), + "bsn" => Ok(Bsn), + "cimb" => Ok(Cimb), + "deutsche_bank" => Ok(DeutscheBank), + "hong_leong_bank" => Ok(HongLeongBank), + "hsbc" => Ok(Hsbc), + "kfh" => Ok(Kfh), + "maybank2e" => Ok(Maybank2e), + "maybank2u" => Ok(Maybank2u), + "ocbc" => Ok(Ocbc), + "pb_enterprise" => Ok(PbEnterprise), + "public_bank" => Ok(PublicBank), + "rhb" => Ok(Rhb), + "standard_chartered" => Ok(StandardChartered), + "uob" => Ok(Uob), + _ => Err(()), + } + } +} +impl std::fmt::Display for UpdatePaymentIntentPaymentMethodDataFpxBank { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for UpdatePaymentIntentPaymentMethodDataFpxBank { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for UpdatePaymentIntentPaymentMethodDataFpxBank { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// If this is an `ideal` PaymentMethod, this hash contains details about the iDEAL payment method. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdatePaymentIntentPaymentMethodDataIdeal { + /// The customer's bank. + #[serde(skip_serializing_if = "Option::is_none")] + pub bank: Option, +} +impl UpdatePaymentIntentPaymentMethodDataIdeal { + pub fn new() -> Self { + Self::default() + } +} +/// The customer's bank. +#[derive(Copy, Clone, Eq, PartialEq)] +#[non_exhaustive] +pub enum UpdatePaymentIntentPaymentMethodDataIdealBank { + AbnAmro, + AsnBank, + Bunq, + Handelsbanken, + Ing, + Knab, + Moneyou, + N26, + Nn, + Rabobank, + Regiobank, + Revolut, + SnsBank, + TriodosBank, + VanLanschot, + Yoursafe, + /// An unrecognized value from Stripe. Should not be used as a request parameter. + Unknown, +} +impl UpdatePaymentIntentPaymentMethodDataIdealBank { + pub fn as_str(self) -> &'static str { + use UpdatePaymentIntentPaymentMethodDataIdealBank::*; + match self { + AbnAmro => "abn_amro", + AsnBank => "asn_bank", + Bunq => "bunq", + Handelsbanken => "handelsbanken", + Ing => "ing", + Knab => "knab", + Moneyou => "moneyou", + N26 => "n26", + Nn => "nn", + Rabobank => "rabobank", + Regiobank => "regiobank", + Revolut => "revolut", + SnsBank => "sns_bank", + TriodosBank => "triodos_bank", + VanLanschot => "van_lanschot", + Yoursafe => "yoursafe", + Unknown => "unknown", + } + } +} + +impl std::str::FromStr for UpdatePaymentIntentPaymentMethodDataIdealBank { + type Err = (); + fn from_str(s: &str) -> Result { + use UpdatePaymentIntentPaymentMethodDataIdealBank::*; + match s { + "abn_amro" => Ok(AbnAmro), + "asn_bank" => Ok(AsnBank), + "bunq" => Ok(Bunq), + "handelsbanken" => Ok(Handelsbanken), + "ing" => Ok(Ing), + "knab" => Ok(Knab), + "moneyou" => Ok(Moneyou), + "n26" => Ok(N26), + "nn" => Ok(Nn), + "rabobank" => Ok(Rabobank), + "regiobank" => Ok(Regiobank), + "revolut" => Ok(Revolut), + "sns_bank" => Ok(SnsBank), + "triodos_bank" => Ok(TriodosBank), + "van_lanschot" => Ok(VanLanschot), + "yoursafe" => Ok(Yoursafe), + _ => Err(()), + } + } +} +impl std::fmt::Display for UpdatePaymentIntentPaymentMethodDataIdealBank { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for UpdatePaymentIntentPaymentMethodDataIdealBank { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for UpdatePaymentIntentPaymentMethodDataIdealBank { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// If this is a `klarna` PaymentMethod, this hash contains details about the Klarna payment method. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdatePaymentIntentPaymentMethodDataKlarna { + /// Customer's date of birth + #[serde(skip_serializing_if = "Option::is_none")] + pub dob: Option, +} +impl UpdatePaymentIntentPaymentMethodDataKlarna { + pub fn new() -> Self { + Self::default() + } +} +/// If this is a `p24` PaymentMethod, this hash contains details about the P24 payment method. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdatePaymentIntentPaymentMethodDataP24 { + /// The customer's bank. + #[serde(skip_serializing_if = "Option::is_none")] + pub bank: Option, +} +impl UpdatePaymentIntentPaymentMethodDataP24 { + pub fn new() -> Self { + Self::default() + } +} +/// The customer's bank. +#[derive(Copy, Clone, Eq, PartialEq)] +#[non_exhaustive] +pub enum UpdatePaymentIntentPaymentMethodDataP24Bank { + AliorBank, + BankMillennium, + BankNowyBfgSa, + BankPekaoSa, + BankiSpbdzielcze, + Blik, + BnpParibas, + Boz, + CitiHandlowy, + CreditAgricole, + Envelobank, + EtransferPocztowy24, + GetinBank, + Ideabank, + Ing, + Inteligo, + MbankMtransfer, + NestPrzelew, + NoblePay, + PbacZIpko, + PlusBank, + SantanderPrzelew24, + TmobileUsbugiBankowe, + ToyotaBank, + Velobank, + VolkswagenBank, + /// An unrecognized value from Stripe. Should not be used as a request parameter. + Unknown, +} +impl UpdatePaymentIntentPaymentMethodDataP24Bank { + pub fn as_str(self) -> &'static str { + use UpdatePaymentIntentPaymentMethodDataP24Bank::*; + match self { + AliorBank => "alior_bank", + BankMillennium => "bank_millennium", + BankNowyBfgSa => "bank_nowy_bfg_sa", + BankPekaoSa => "bank_pekao_sa", + BankiSpbdzielcze => "banki_spbdzielcze", + Blik => "blik", + BnpParibas => "bnp_paribas", + Boz => "boz", + CitiHandlowy => "citi_handlowy", + CreditAgricole => "credit_agricole", + Envelobank => "envelobank", + EtransferPocztowy24 => "etransfer_pocztowy24", + GetinBank => "getin_bank", + Ideabank => "ideabank", + Ing => "ing", + Inteligo => "inteligo", + MbankMtransfer => "mbank_mtransfer", + NestPrzelew => "nest_przelew", + NoblePay => "noble_pay", + PbacZIpko => "pbac_z_ipko", + PlusBank => "plus_bank", + SantanderPrzelew24 => "santander_przelew24", + TmobileUsbugiBankowe => "tmobile_usbugi_bankowe", + ToyotaBank => "toyota_bank", + Velobank => "velobank", + VolkswagenBank => "volkswagen_bank", + Unknown => "unknown", + } + } +} + +impl std::str::FromStr for UpdatePaymentIntentPaymentMethodDataP24Bank { + type Err = (); + fn from_str(s: &str) -> Result { + use UpdatePaymentIntentPaymentMethodDataP24Bank::*; + match s { + "alior_bank" => Ok(AliorBank), + "bank_millennium" => Ok(BankMillennium), + "bank_nowy_bfg_sa" => Ok(BankNowyBfgSa), + "bank_pekao_sa" => Ok(BankPekaoSa), + "banki_spbdzielcze" => Ok(BankiSpbdzielcze), + "blik" => Ok(Blik), + "bnp_paribas" => Ok(BnpParibas), + "boz" => Ok(Boz), + "citi_handlowy" => Ok(CitiHandlowy), + "credit_agricole" => Ok(CreditAgricole), + "envelobank" => Ok(Envelobank), + "etransfer_pocztowy24" => Ok(EtransferPocztowy24), + "getin_bank" => Ok(GetinBank), + "ideabank" => Ok(Ideabank), + "ing" => Ok(Ing), + "inteligo" => Ok(Inteligo), + "mbank_mtransfer" => Ok(MbankMtransfer), + "nest_przelew" => Ok(NestPrzelew), + "noble_pay" => Ok(NoblePay), + "pbac_z_ipko" => Ok(PbacZIpko), + "plus_bank" => Ok(PlusBank), + "santander_przelew24" => Ok(SantanderPrzelew24), + "tmobile_usbugi_bankowe" => Ok(TmobileUsbugiBankowe), + "toyota_bank" => Ok(ToyotaBank), + "velobank" => Ok(Velobank), + "volkswagen_bank" => Ok(VolkswagenBank), + _ => Err(()), + } + } +} +impl std::fmt::Display for UpdatePaymentIntentPaymentMethodDataP24Bank { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for UpdatePaymentIntentPaymentMethodDataP24Bank { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for UpdatePaymentIntentPaymentMethodDataP24Bank { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Options to configure Radar. +/// See [Radar Session](https://stripe.com/docs/radar/radar-session) for more information. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdatePaymentIntentPaymentMethodDataRadarOptions<'a> { + /// A [Radar Session](https://stripe.com/docs/radar/radar-session) is a snapshot of the browser metadata and device details that help Radar make more accurate predictions on your payments. + #[serde(skip_serializing_if = "Option::is_none")] + pub session: Option<&'a str>, +} +impl<'a> UpdatePaymentIntentPaymentMethodDataRadarOptions<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// If this is a `sepa_debit` PaymentMethod, this hash contains details about the SEPA debit bank account. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct UpdatePaymentIntentPaymentMethodDataSepaDebit<'a> { + /// IBAN of the bank account. + pub iban: &'a str, +} +impl<'a> UpdatePaymentIntentPaymentMethodDataSepaDebit<'a> { + pub fn new(iban: &'a str) -> Self { + Self { iban } + } +} +/// If this is a `sofort` PaymentMethod, this hash contains details about the SOFORT payment method. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct UpdatePaymentIntentPaymentMethodDataSofort { + /// Two-letter ISO code representing the country the bank account is located in. + pub country: UpdatePaymentIntentPaymentMethodDataSofortCountry, +} +impl UpdatePaymentIntentPaymentMethodDataSofort { + pub fn new(country: UpdatePaymentIntentPaymentMethodDataSofortCountry) -> Self { + Self { country } + } +} +/// Two-letter ISO code representing the country the bank account is located in. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum UpdatePaymentIntentPaymentMethodDataSofortCountry { + At, + Be, + De, + Es, + It, + Nl, +} +impl UpdatePaymentIntentPaymentMethodDataSofortCountry { + pub fn as_str(self) -> &'static str { + use UpdatePaymentIntentPaymentMethodDataSofortCountry::*; + match self { + At => "AT", + Be => "BE", + De => "DE", + Es => "ES", + It => "IT", + Nl => "NL", + } + } +} + +impl std::str::FromStr for UpdatePaymentIntentPaymentMethodDataSofortCountry { + type Err = (); + fn from_str(s: &str) -> Result { + use UpdatePaymentIntentPaymentMethodDataSofortCountry::*; + match s { + "AT" => Ok(At), + "BE" => Ok(Be), + "DE" => Ok(De), + "ES" => Ok(Es), + "IT" => Ok(It), + "NL" => Ok(Nl), + _ => Err(()), + } + } +} +impl std::fmt::Display for UpdatePaymentIntentPaymentMethodDataSofortCountry { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for UpdatePaymentIntentPaymentMethodDataSofortCountry { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for UpdatePaymentIntentPaymentMethodDataSofortCountry { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// The type of the PaymentMethod. +/// An additional hash is included on the PaymentMethod with a name matching this value. +/// It contains additional information specific to the PaymentMethod type. +#[derive(Copy, Clone, Eq, PartialEq)] +#[non_exhaustive] +pub enum UpdatePaymentIntentPaymentMethodDataType { + AcssDebit, + Affirm, + AfterpayClearpay, + Alipay, + AuBecsDebit, + BacsDebit, + Bancontact, + Blik, + Boleto, + Cashapp, + CustomerBalance, + Eps, + Fpx, + Giropay, + Grabpay, + Ideal, + Klarna, + Konbini, + Link, + Oxxo, + P24, + Paynow, + Paypal, + Pix, + Promptpay, + RevolutPay, + SepaDebit, + Sofort, + Swish, + UsBankAccount, + WechatPay, + Zip, + /// An unrecognized value from Stripe. Should not be used as a request parameter. + Unknown, +} +impl UpdatePaymentIntentPaymentMethodDataType { + pub fn as_str(self) -> &'static str { + use UpdatePaymentIntentPaymentMethodDataType::*; + match self { + AcssDebit => "acss_debit", + Affirm => "affirm", + AfterpayClearpay => "afterpay_clearpay", + Alipay => "alipay", + AuBecsDebit => "au_becs_debit", + BacsDebit => "bacs_debit", + Bancontact => "bancontact", + Blik => "blik", + Boleto => "boleto", + Cashapp => "cashapp", + CustomerBalance => "customer_balance", + Eps => "eps", + Fpx => "fpx", + Giropay => "giropay", + Grabpay => "grabpay", + Ideal => "ideal", + Klarna => "klarna", + Konbini => "konbini", + Link => "link", + Oxxo => "oxxo", + P24 => "p24", + Paynow => "paynow", + Paypal => "paypal", + Pix => "pix", + Promptpay => "promptpay", + RevolutPay => "revolut_pay", + SepaDebit => "sepa_debit", + Sofort => "sofort", + Swish => "swish", + UsBankAccount => "us_bank_account", + WechatPay => "wechat_pay", + Zip => "zip", + Unknown => "unknown", + } + } +} + +impl std::str::FromStr for UpdatePaymentIntentPaymentMethodDataType { + type Err = (); + fn from_str(s: &str) -> Result { + use UpdatePaymentIntentPaymentMethodDataType::*; + match s { + "acss_debit" => Ok(AcssDebit), + "affirm" => Ok(Affirm), + "afterpay_clearpay" => Ok(AfterpayClearpay), + "alipay" => Ok(Alipay), + "au_becs_debit" => Ok(AuBecsDebit), + "bacs_debit" => Ok(BacsDebit), + "bancontact" => Ok(Bancontact), + "blik" => Ok(Blik), + "boleto" => Ok(Boleto), + "cashapp" => Ok(Cashapp), + "customer_balance" => Ok(CustomerBalance), + "eps" => Ok(Eps), + "fpx" => Ok(Fpx), + "giropay" => Ok(Giropay), + "grabpay" => Ok(Grabpay), + "ideal" => Ok(Ideal), + "klarna" => Ok(Klarna), + "konbini" => Ok(Konbini), + "link" => Ok(Link), + "oxxo" => Ok(Oxxo), + "p24" => Ok(P24), + "paynow" => Ok(Paynow), + "paypal" => Ok(Paypal), + "pix" => Ok(Pix), + "promptpay" => Ok(Promptpay), + "revolut_pay" => Ok(RevolutPay), + "sepa_debit" => Ok(SepaDebit), + "sofort" => Ok(Sofort), + "swish" => Ok(Swish), + "us_bank_account" => Ok(UsBankAccount), + "wechat_pay" => Ok(WechatPay), + "zip" => Ok(Zip), + _ => Err(()), + } + } +} +impl std::fmt::Display for UpdatePaymentIntentPaymentMethodDataType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for UpdatePaymentIntentPaymentMethodDataType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for UpdatePaymentIntentPaymentMethodDataType { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// If this is an `us_bank_account` PaymentMethod, this hash contains details about the US bank account payment method. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdatePaymentIntentPaymentMethodDataUsBankAccount<'a> { + /// Account holder type: individual or company. + #[serde(skip_serializing_if = "Option::is_none")] + pub account_holder_type: + Option, + /// Account number of the bank account. + #[serde(skip_serializing_if = "Option::is_none")] + pub account_number: Option<&'a str>, + /// Account type: checkings or savings. Defaults to checking if omitted. + #[serde(skip_serializing_if = "Option::is_none")] + pub account_type: Option, + /// The ID of a Financial Connections Account to use as a payment method. + #[serde(skip_serializing_if = "Option::is_none")] + pub financial_connections_account: Option<&'a str>, + /// Routing number of the bank account. + #[serde(skip_serializing_if = "Option::is_none")] + pub routing_number: Option<&'a str>, +} +impl<'a> UpdatePaymentIntentPaymentMethodDataUsBankAccount<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// Account holder type: individual or company. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum UpdatePaymentIntentPaymentMethodDataUsBankAccountAccountHolderType { + Company, + Individual, +} +impl UpdatePaymentIntentPaymentMethodDataUsBankAccountAccountHolderType { + pub fn as_str(self) -> &'static str { + use UpdatePaymentIntentPaymentMethodDataUsBankAccountAccountHolderType::*; + match self { + Company => "company", + Individual => "individual", + } + } +} + +impl std::str::FromStr for UpdatePaymentIntentPaymentMethodDataUsBankAccountAccountHolderType { + type Err = (); + fn from_str(s: &str) -> Result { + use UpdatePaymentIntentPaymentMethodDataUsBankAccountAccountHolderType::*; + match s { + "company" => Ok(Company), + "individual" => Ok(Individual), + _ => Err(()), + } + } +} +impl std::fmt::Display for UpdatePaymentIntentPaymentMethodDataUsBankAccountAccountHolderType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for UpdatePaymentIntentPaymentMethodDataUsBankAccountAccountHolderType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for UpdatePaymentIntentPaymentMethodDataUsBankAccountAccountHolderType { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Account type: checkings or savings. Defaults to checking if omitted. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum UpdatePaymentIntentPaymentMethodDataUsBankAccountAccountType { + Checking, + Savings, +} +impl UpdatePaymentIntentPaymentMethodDataUsBankAccountAccountType { + pub fn as_str(self) -> &'static str { + use UpdatePaymentIntentPaymentMethodDataUsBankAccountAccountType::*; + match self { + Checking => "checking", + Savings => "savings", + } + } +} + +impl std::str::FromStr for UpdatePaymentIntentPaymentMethodDataUsBankAccountAccountType { + type Err = (); + fn from_str(s: &str) -> Result { + use UpdatePaymentIntentPaymentMethodDataUsBankAccountAccountType::*; + match s { + "checking" => Ok(Checking), + "savings" => Ok(Savings), + _ => Err(()), + } + } +} +impl std::fmt::Display for UpdatePaymentIntentPaymentMethodDataUsBankAccountAccountType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for UpdatePaymentIntentPaymentMethodDataUsBankAccountAccountType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for UpdatePaymentIntentPaymentMethodDataUsBankAccountAccountType { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Payment-method-specific configuration for this PaymentIntent. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdatePaymentIntentPaymentMethodOptions<'a> { + /// If this is a `acss_debit` PaymentMethod, this sub-hash contains details about the ACSS Debit payment method options. + #[serde(skip_serializing_if = "Option::is_none")] + pub acss_debit: Option>, + /// If this is an `affirm` PaymentMethod, this sub-hash contains details about the Affirm payment method options. + #[serde(skip_serializing_if = "Option::is_none")] + pub affirm: Option>, + /// If this is a `afterpay_clearpay` PaymentMethod, this sub-hash contains details about the Afterpay Clearpay payment method options. + #[serde(skip_serializing_if = "Option::is_none")] + pub afterpay_clearpay: Option>, + /// If this is a `alipay` PaymentMethod, this sub-hash contains details about the Alipay payment method options. + #[serde(skip_serializing_if = "Option::is_none")] + pub alipay: Option, + /// If this is a `au_becs_debit` PaymentMethod, this sub-hash contains details about the AU BECS Direct Debit payment method options. + #[serde(skip_serializing_if = "Option::is_none")] + pub au_becs_debit: Option, + /// If this is a `bacs_debit` PaymentMethod, this sub-hash contains details about the BACS Debit payment method options. + #[serde(skip_serializing_if = "Option::is_none")] + pub bacs_debit: Option, + /// If this is a `bancontact` PaymentMethod, this sub-hash contains details about the Bancontact payment method options. + #[serde(skip_serializing_if = "Option::is_none")] + pub bancontact: Option, + /// If this is a `blik` PaymentMethod, this sub-hash contains details about the BLIK payment method options. + #[serde(skip_serializing_if = "Option::is_none")] + pub blik: Option>, + /// If this is a `boleto` PaymentMethod, this sub-hash contains details about the Boleto payment method options. + #[serde(skip_serializing_if = "Option::is_none")] + pub boleto: Option, + /// Configuration for any card payments attempted on this PaymentIntent. + #[serde(skip_serializing_if = "Option::is_none")] + pub card: Option>, + /// If this is a `card_present` PaymentMethod, this sub-hash contains details about the Card Present payment method options. + #[serde(skip_serializing_if = "Option::is_none")] + pub card_present: Option, + /// If this is a `cashapp` PaymentMethod, this sub-hash contains details about the Cash App Pay payment method options. + #[serde(skip_serializing_if = "Option::is_none")] + pub cashapp: Option, + /// If this is a `customer balance` PaymentMethod, this sub-hash contains details about the customer balance payment method options. + #[serde(skip_serializing_if = "Option::is_none")] + pub customer_balance: Option>, + /// If this is a `eps` PaymentMethod, this sub-hash contains details about the EPS payment method options. + #[serde(skip_serializing_if = "Option::is_none")] + pub eps: Option, + /// If this is a `fpx` PaymentMethod, this sub-hash contains details about the FPX payment method options. + #[serde(skip_serializing_if = "Option::is_none")] + pub fpx: Option, + /// If this is a `giropay` PaymentMethod, this sub-hash contains details about the Giropay payment method options. + #[serde(skip_serializing_if = "Option::is_none")] + pub giropay: Option, + /// If this is a `grabpay` PaymentMethod, this sub-hash contains details about the Grabpay payment method options. + #[serde(skip_serializing_if = "Option::is_none")] + pub grabpay: Option, + /// If this is a `ideal` PaymentMethod, this sub-hash contains details about the Ideal payment method options. + #[serde(skip_serializing_if = "Option::is_none")] + pub ideal: Option, + /// If this is a `interac_present` PaymentMethod, this sub-hash contains details about the Card Present payment method options. + #[serde(skip_serializing_if = "Option::is_none")] + pub interac_present: Option<&'a serde_json::Value>, + /// If this is a `klarna` PaymentMethod, this sub-hash contains details about the Klarna payment method options. + #[serde(skip_serializing_if = "Option::is_none")] + pub klarna: Option, + /// If this is a `konbini` PaymentMethod, this sub-hash contains details about the Konbini payment method options. + #[serde(skip_serializing_if = "Option::is_none")] + pub konbini: Option>, + /// If this is a `link` PaymentMethod, this sub-hash contains details about the Link payment method options. + #[serde(skip_serializing_if = "Option::is_none")] + pub link: Option>, + /// If this is a `oxxo` PaymentMethod, this sub-hash contains details about the OXXO payment method options. + #[serde(skip_serializing_if = "Option::is_none")] + pub oxxo: Option, + /// If this is a `p24` PaymentMethod, this sub-hash contains details about the Przelewy24 payment method options. + #[serde(skip_serializing_if = "Option::is_none")] + pub p24: Option, + /// If this is a `paynow` PaymentMethod, this sub-hash contains details about the PayNow payment method options. + #[serde(skip_serializing_if = "Option::is_none")] + pub paynow: Option, + /// If this is a `paypal` PaymentMethod, this sub-hash contains details about the PayPal payment method options. + #[serde(skip_serializing_if = "Option::is_none")] + pub paypal: Option>, + /// If this is a `pix` PaymentMethod, this sub-hash contains details about the Pix payment method options. + #[serde(skip_serializing_if = "Option::is_none")] + pub pix: Option, + /// If this is a `promptpay` PaymentMethod, this sub-hash contains details about the PromptPay payment method options. + #[serde(skip_serializing_if = "Option::is_none")] + pub promptpay: Option, + /// If this is a `revolut_pay` PaymentMethod, this sub-hash contains details about the Revolut Pay payment method options. + #[serde(skip_serializing_if = "Option::is_none")] + pub revolut_pay: Option, + /// If this is a `sepa_debit` PaymentIntent, this sub-hash contains details about the SEPA Debit payment method options. + #[serde(skip_serializing_if = "Option::is_none")] + pub sepa_debit: Option>, + /// If this is a `sofort` PaymentMethod, this sub-hash contains details about the SOFORT payment method options. + #[serde(skip_serializing_if = "Option::is_none")] + pub sofort: Option, + /// If this is a `Swish` PaymentMethod, this sub-hash contains details about the Swish payment method options. + #[serde(skip_serializing_if = "Option::is_none")] + pub swish: Option>, + /// If this is a `us_bank_account` PaymentMethod, this sub-hash contains details about the US bank account payment method options. + #[serde(skip_serializing_if = "Option::is_none")] + pub us_bank_account: Option>, + /// If this is a `wechat_pay` PaymentMethod, this sub-hash contains details about the WeChat Pay payment method options. + #[serde(skip_serializing_if = "Option::is_none")] + pub wechat_pay: Option>, + /// If this is a `zip` PaymentMethod, this sub-hash contains details about the Zip payment method options. + #[serde(skip_serializing_if = "Option::is_none")] + pub zip: Option, +} +impl<'a> UpdatePaymentIntentPaymentMethodOptions<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// If this is a `acss_debit` PaymentMethod, this sub-hash contains details about the ACSS Debit payment method options. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdatePaymentIntentPaymentMethodOptionsAcssDebit<'a> { + /// Additional fields for Mandate creation + #[serde(skip_serializing_if = "Option::is_none")] + pub mandate_options: Option>, + /// Indicates that you intend to make future payments with this PaymentIntent's payment method. + /// + /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. + /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + /// + /// When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + /// + /// If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. + #[serde(skip_serializing_if = "Option::is_none")] + pub setup_future_usage: + Option, + /// Bank account verification method. + #[serde(skip_serializing_if = "Option::is_none")] + pub verification_method: + Option, +} +impl<'a> UpdatePaymentIntentPaymentMethodOptionsAcssDebit<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// Additional fields for Mandate creation +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdatePaymentIntentPaymentMethodOptionsAcssDebitMandateOptions<'a> { + /// A URL for custom mandate text to render during confirmation step. + /// The URL will be rendered with additional GET parameters `payment_intent` and `payment_intent_client_secret` when confirming a Payment Intent,. + /// or `setup_intent` and `setup_intent_client_secret` when confirming a Setup Intent. + #[serde(skip_serializing_if = "Option::is_none")] + pub custom_mandate_url: Option<&'a str>, + /// Description of the mandate interval. + /// Only required if 'payment_schedule' parameter is 'interval' or 'combined'. + #[serde(skip_serializing_if = "Option::is_none")] + pub interval_description: Option<&'a str>, + /// Payment schedule for the mandate. + #[serde(skip_serializing_if = "Option::is_none")] + pub payment_schedule: + Option, + /// Transaction type of the mandate. + #[serde(skip_serializing_if = "Option::is_none")] + pub transaction_type: + Option, +} +impl<'a> UpdatePaymentIntentPaymentMethodOptionsAcssDebitMandateOptions<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// Payment schedule for the mandate. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum UpdatePaymentIntentPaymentMethodOptionsAcssDebitMandateOptionsPaymentSchedule { + Combined, + Interval, + Sporadic, +} +impl UpdatePaymentIntentPaymentMethodOptionsAcssDebitMandateOptionsPaymentSchedule { + pub fn as_str(self) -> &'static str { + use UpdatePaymentIntentPaymentMethodOptionsAcssDebitMandateOptionsPaymentSchedule::*; + match self { + Combined => "combined", + Interval => "interval", + Sporadic => "sporadic", + } + } +} + +impl std::str::FromStr + for UpdatePaymentIntentPaymentMethodOptionsAcssDebitMandateOptionsPaymentSchedule +{ + type Err = (); + fn from_str(s: &str) -> Result { + use UpdatePaymentIntentPaymentMethodOptionsAcssDebitMandateOptionsPaymentSchedule::*; + match s { + "combined" => Ok(Combined), + "interval" => Ok(Interval), + "sporadic" => Ok(Sporadic), + _ => Err(()), + } + } +} +impl std::fmt::Display + for UpdatePaymentIntentPaymentMethodOptionsAcssDebitMandateOptionsPaymentSchedule +{ + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug + for UpdatePaymentIntentPaymentMethodOptionsAcssDebitMandateOptionsPaymentSchedule +{ + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize + for UpdatePaymentIntentPaymentMethodOptionsAcssDebitMandateOptionsPaymentSchedule +{ + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Transaction type of the mandate. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum UpdatePaymentIntentPaymentMethodOptionsAcssDebitMandateOptionsTransactionType { + Business, + Personal, +} +impl UpdatePaymentIntentPaymentMethodOptionsAcssDebitMandateOptionsTransactionType { + pub fn as_str(self) -> &'static str { + use UpdatePaymentIntentPaymentMethodOptionsAcssDebitMandateOptionsTransactionType::*; + match self { + Business => "business", + Personal => "personal", + } + } +} + +impl std::str::FromStr + for UpdatePaymentIntentPaymentMethodOptionsAcssDebitMandateOptionsTransactionType +{ + type Err = (); + fn from_str(s: &str) -> Result { + use UpdatePaymentIntentPaymentMethodOptionsAcssDebitMandateOptionsTransactionType::*; + match s { + "business" => Ok(Business), + "personal" => Ok(Personal), + _ => Err(()), + } + } +} +impl std::fmt::Display + for UpdatePaymentIntentPaymentMethodOptionsAcssDebitMandateOptionsTransactionType +{ + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug + for UpdatePaymentIntentPaymentMethodOptionsAcssDebitMandateOptionsTransactionType +{ + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize + for UpdatePaymentIntentPaymentMethodOptionsAcssDebitMandateOptionsTransactionType +{ + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Indicates that you intend to make future payments with this PaymentIntent's payment method. +/// +/// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. +/// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. +/// +/// When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). +/// +/// If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum UpdatePaymentIntentPaymentMethodOptionsAcssDebitSetupFutureUsage { + None, + OffSession, + OnSession, +} +impl UpdatePaymentIntentPaymentMethodOptionsAcssDebitSetupFutureUsage { + pub fn as_str(self) -> &'static str { + use UpdatePaymentIntentPaymentMethodOptionsAcssDebitSetupFutureUsage::*; + match self { + None => "none", + OffSession => "off_session", + OnSession => "on_session", + } + } +} + +impl std::str::FromStr for UpdatePaymentIntentPaymentMethodOptionsAcssDebitSetupFutureUsage { + type Err = (); + fn from_str(s: &str) -> Result { + use UpdatePaymentIntentPaymentMethodOptionsAcssDebitSetupFutureUsage::*; + match s { + "none" => Ok(None), + "off_session" => Ok(OffSession), + "on_session" => Ok(OnSession), + _ => Err(()), + } + } +} +impl std::fmt::Display for UpdatePaymentIntentPaymentMethodOptionsAcssDebitSetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for UpdatePaymentIntentPaymentMethodOptionsAcssDebitSetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for UpdatePaymentIntentPaymentMethodOptionsAcssDebitSetupFutureUsage { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Bank account verification method. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum UpdatePaymentIntentPaymentMethodOptionsAcssDebitVerificationMethod { + Automatic, + Instant, + Microdeposits, +} +impl UpdatePaymentIntentPaymentMethodOptionsAcssDebitVerificationMethod { + pub fn as_str(self) -> &'static str { + use UpdatePaymentIntentPaymentMethodOptionsAcssDebitVerificationMethod::*; + match self { + Automatic => "automatic", + Instant => "instant", + Microdeposits => "microdeposits", + } + } +} + +impl std::str::FromStr for UpdatePaymentIntentPaymentMethodOptionsAcssDebitVerificationMethod { + type Err = (); + fn from_str(s: &str) -> Result { + use UpdatePaymentIntentPaymentMethodOptionsAcssDebitVerificationMethod::*; + match s { + "automatic" => Ok(Automatic), + "instant" => Ok(Instant), + "microdeposits" => Ok(Microdeposits), + _ => Err(()), + } + } +} +impl std::fmt::Display for UpdatePaymentIntentPaymentMethodOptionsAcssDebitVerificationMethod { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for UpdatePaymentIntentPaymentMethodOptionsAcssDebitVerificationMethod { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for UpdatePaymentIntentPaymentMethodOptionsAcssDebitVerificationMethod { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// If this is an `affirm` PaymentMethod, this sub-hash contains details about the Affirm payment method options. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdatePaymentIntentPaymentMethodOptionsAffirm<'a> { + /// Controls when the funds will be captured from the customer's account. + /// + /// If provided, this parameter will override the top-level `capture_method` when finalizing the payment with this payment method type. + /// + /// If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter will unset the stored value for this payment method type. + #[serde(skip_serializing_if = "Option::is_none")] + pub capture_method: Option, + /// Preferred language of the Affirm authorization page that the customer is redirected to. + #[serde(skip_serializing_if = "Option::is_none")] + pub preferred_locale: Option<&'a str>, + /// Indicates that you intend to make future payments with this PaymentIntent's payment method. + /// + /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. + /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + /// + /// When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + /// + /// If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. + #[serde(skip_serializing_if = "Option::is_none")] + pub setup_future_usage: Option, +} +impl<'a> UpdatePaymentIntentPaymentMethodOptionsAffirm<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// Controls when the funds will be captured from the customer's account. +/// +/// If provided, this parameter will override the top-level `capture_method` when finalizing the payment with this payment method type. +/// +/// If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter will unset the stored value for this payment method type. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum UpdatePaymentIntentPaymentMethodOptionsAffirmCaptureMethod { + Manual, +} +impl UpdatePaymentIntentPaymentMethodOptionsAffirmCaptureMethod { + pub fn as_str(self) -> &'static str { + use UpdatePaymentIntentPaymentMethodOptionsAffirmCaptureMethod::*; + match self { + Manual => "manual", + } + } +} + +impl std::str::FromStr for UpdatePaymentIntentPaymentMethodOptionsAffirmCaptureMethod { + type Err = (); + fn from_str(s: &str) -> Result { + use UpdatePaymentIntentPaymentMethodOptionsAffirmCaptureMethod::*; + match s { + "manual" => Ok(Manual), + _ => Err(()), + } + } +} +impl std::fmt::Display for UpdatePaymentIntentPaymentMethodOptionsAffirmCaptureMethod { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for UpdatePaymentIntentPaymentMethodOptionsAffirmCaptureMethod { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for UpdatePaymentIntentPaymentMethodOptionsAffirmCaptureMethod { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Indicates that you intend to make future payments with this PaymentIntent's payment method. +/// +/// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. +/// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. +/// +/// When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). +/// +/// If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum UpdatePaymentIntentPaymentMethodOptionsAffirmSetupFutureUsage { + None, +} +impl UpdatePaymentIntentPaymentMethodOptionsAffirmSetupFutureUsage { + pub fn as_str(self) -> &'static str { + use UpdatePaymentIntentPaymentMethodOptionsAffirmSetupFutureUsage::*; + match self { + None => "none", + } + } +} + +impl std::str::FromStr for UpdatePaymentIntentPaymentMethodOptionsAffirmSetupFutureUsage { + type Err = (); + fn from_str(s: &str) -> Result { + use UpdatePaymentIntentPaymentMethodOptionsAffirmSetupFutureUsage::*; + match s { + "none" => Ok(None), + _ => Err(()), + } + } +} +impl std::fmt::Display for UpdatePaymentIntentPaymentMethodOptionsAffirmSetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for UpdatePaymentIntentPaymentMethodOptionsAffirmSetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for UpdatePaymentIntentPaymentMethodOptionsAffirmSetupFutureUsage { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// If this is a `afterpay_clearpay` PaymentMethod, this sub-hash contains details about the Afterpay Clearpay payment method options. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdatePaymentIntentPaymentMethodOptionsAfterpayClearpay<'a> { + /// Controls when the funds will be captured from the customer's account. + /// + /// If provided, this parameter will override the top-level `capture_method` when finalizing the payment with this payment method type. + /// + /// If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter will unset the stored value for this payment method type. + #[serde(skip_serializing_if = "Option::is_none")] + pub capture_method: + Option, + /// An internal identifier or reference that this payment corresponds to. + /// You must limit the identifier to 128 characters, and it can only contain letters, numbers, underscores, backslashes, and dashes. + /// This field differs from the statement descriptor and item name. + #[serde(skip_serializing_if = "Option::is_none")] + pub reference: Option<&'a str>, + /// Indicates that you intend to make future payments with this PaymentIntent's payment method. + /// + /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. + /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + /// + /// When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + /// + /// If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. + #[serde(skip_serializing_if = "Option::is_none")] + pub setup_future_usage: + Option, +} +impl<'a> UpdatePaymentIntentPaymentMethodOptionsAfterpayClearpay<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// Controls when the funds will be captured from the customer's account. +/// +/// If provided, this parameter will override the top-level `capture_method` when finalizing the payment with this payment method type. +/// +/// If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter will unset the stored value for this payment method type. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum UpdatePaymentIntentPaymentMethodOptionsAfterpayClearpayCaptureMethod { + Manual, +} +impl UpdatePaymentIntentPaymentMethodOptionsAfterpayClearpayCaptureMethod { + pub fn as_str(self) -> &'static str { + use UpdatePaymentIntentPaymentMethodOptionsAfterpayClearpayCaptureMethod::*; + match self { + Manual => "manual", + } + } +} + +impl std::str::FromStr for UpdatePaymentIntentPaymentMethodOptionsAfterpayClearpayCaptureMethod { + type Err = (); + fn from_str(s: &str) -> Result { + use UpdatePaymentIntentPaymentMethodOptionsAfterpayClearpayCaptureMethod::*; + match s { + "manual" => Ok(Manual), + _ => Err(()), + } + } +} +impl std::fmt::Display for UpdatePaymentIntentPaymentMethodOptionsAfterpayClearpayCaptureMethod { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for UpdatePaymentIntentPaymentMethodOptionsAfterpayClearpayCaptureMethod { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for UpdatePaymentIntentPaymentMethodOptionsAfterpayClearpayCaptureMethod { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Indicates that you intend to make future payments with this PaymentIntent's payment method. +/// +/// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. +/// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. +/// +/// When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). +/// +/// If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum UpdatePaymentIntentPaymentMethodOptionsAfterpayClearpaySetupFutureUsage { + None, +} +impl UpdatePaymentIntentPaymentMethodOptionsAfterpayClearpaySetupFutureUsage { + pub fn as_str(self) -> &'static str { + use UpdatePaymentIntentPaymentMethodOptionsAfterpayClearpaySetupFutureUsage::*; + match self { + None => "none", + } + } +} + +impl std::str::FromStr for UpdatePaymentIntentPaymentMethodOptionsAfterpayClearpaySetupFutureUsage { + type Err = (); + fn from_str(s: &str) -> Result { + use UpdatePaymentIntentPaymentMethodOptionsAfterpayClearpaySetupFutureUsage::*; + match s { + "none" => Ok(None), + _ => Err(()), + } + } +} +impl std::fmt::Display for UpdatePaymentIntentPaymentMethodOptionsAfterpayClearpaySetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for UpdatePaymentIntentPaymentMethodOptionsAfterpayClearpaySetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for UpdatePaymentIntentPaymentMethodOptionsAfterpayClearpaySetupFutureUsage { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// If this is a `alipay` PaymentMethod, this sub-hash contains details about the Alipay payment method options. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdatePaymentIntentPaymentMethodOptionsAlipay { + /// Indicates that you intend to make future payments with this PaymentIntent's payment method. + /// + /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. + /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + /// + /// When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + /// + /// If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. + #[serde(skip_serializing_if = "Option::is_none")] + pub setup_future_usage: Option, +} +impl UpdatePaymentIntentPaymentMethodOptionsAlipay { + pub fn new() -> Self { + Self::default() + } +} +/// Indicates that you intend to make future payments with this PaymentIntent's payment method. +/// +/// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. +/// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. +/// +/// When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). +/// +/// If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum UpdatePaymentIntentPaymentMethodOptionsAlipaySetupFutureUsage { + None, + OffSession, +} +impl UpdatePaymentIntentPaymentMethodOptionsAlipaySetupFutureUsage { + pub fn as_str(self) -> &'static str { + use UpdatePaymentIntentPaymentMethodOptionsAlipaySetupFutureUsage::*; + match self { + None => "none", + OffSession => "off_session", + } + } +} + +impl std::str::FromStr for UpdatePaymentIntentPaymentMethodOptionsAlipaySetupFutureUsage { + type Err = (); + fn from_str(s: &str) -> Result { + use UpdatePaymentIntentPaymentMethodOptionsAlipaySetupFutureUsage::*; + match s { + "none" => Ok(None), + "off_session" => Ok(OffSession), + _ => Err(()), + } + } +} +impl std::fmt::Display for UpdatePaymentIntentPaymentMethodOptionsAlipaySetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for UpdatePaymentIntentPaymentMethodOptionsAlipaySetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for UpdatePaymentIntentPaymentMethodOptionsAlipaySetupFutureUsage { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// If this is a `au_becs_debit` PaymentMethod, this sub-hash contains details about the AU BECS Direct Debit payment method options. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdatePaymentIntentPaymentMethodOptionsAuBecsDebit { + /// Indicates that you intend to make future payments with this PaymentIntent's payment method. + /// + /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. + /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + /// + /// When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + /// + /// If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. + #[serde(skip_serializing_if = "Option::is_none")] + pub setup_future_usage: + Option, +} +impl UpdatePaymentIntentPaymentMethodOptionsAuBecsDebit { + pub fn new() -> Self { + Self::default() + } +} +/// Indicates that you intend to make future payments with this PaymentIntent's payment method. +/// +/// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. +/// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. +/// +/// When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). +/// +/// If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum UpdatePaymentIntentPaymentMethodOptionsAuBecsDebitSetupFutureUsage { + None, + OffSession, + OnSession, +} +impl UpdatePaymentIntentPaymentMethodOptionsAuBecsDebitSetupFutureUsage { + pub fn as_str(self) -> &'static str { + use UpdatePaymentIntentPaymentMethodOptionsAuBecsDebitSetupFutureUsage::*; + match self { + None => "none", + OffSession => "off_session", + OnSession => "on_session", + } + } +} + +impl std::str::FromStr for UpdatePaymentIntentPaymentMethodOptionsAuBecsDebitSetupFutureUsage { + type Err = (); + fn from_str(s: &str) -> Result { + use UpdatePaymentIntentPaymentMethodOptionsAuBecsDebitSetupFutureUsage::*; + match s { + "none" => Ok(None), + "off_session" => Ok(OffSession), + "on_session" => Ok(OnSession), + _ => Err(()), + } + } +} +impl std::fmt::Display for UpdatePaymentIntentPaymentMethodOptionsAuBecsDebitSetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for UpdatePaymentIntentPaymentMethodOptionsAuBecsDebitSetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for UpdatePaymentIntentPaymentMethodOptionsAuBecsDebitSetupFutureUsage { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// If this is a `bacs_debit` PaymentMethod, this sub-hash contains details about the BACS Debit payment method options. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdatePaymentIntentPaymentMethodOptionsBacsDebit { + /// Indicates that you intend to make future payments with this PaymentIntent's payment method. + /// + /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. + /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + /// + /// When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + /// + /// If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. + #[serde(skip_serializing_if = "Option::is_none")] + pub setup_future_usage: + Option, +} +impl UpdatePaymentIntentPaymentMethodOptionsBacsDebit { + pub fn new() -> Self { + Self::default() + } +} +/// Indicates that you intend to make future payments with this PaymentIntent's payment method. +/// +/// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. +/// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. +/// +/// When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). +/// +/// If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum UpdatePaymentIntentPaymentMethodOptionsBacsDebitSetupFutureUsage { + None, + OffSession, + OnSession, +} +impl UpdatePaymentIntentPaymentMethodOptionsBacsDebitSetupFutureUsage { + pub fn as_str(self) -> &'static str { + use UpdatePaymentIntentPaymentMethodOptionsBacsDebitSetupFutureUsage::*; + match self { + None => "none", + OffSession => "off_session", + OnSession => "on_session", + } + } +} + +impl std::str::FromStr for UpdatePaymentIntentPaymentMethodOptionsBacsDebitSetupFutureUsage { + type Err = (); + fn from_str(s: &str) -> Result { + use UpdatePaymentIntentPaymentMethodOptionsBacsDebitSetupFutureUsage::*; + match s { + "none" => Ok(None), + "off_session" => Ok(OffSession), + "on_session" => Ok(OnSession), + _ => Err(()), + } + } +} +impl std::fmt::Display for UpdatePaymentIntentPaymentMethodOptionsBacsDebitSetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for UpdatePaymentIntentPaymentMethodOptionsBacsDebitSetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for UpdatePaymentIntentPaymentMethodOptionsBacsDebitSetupFutureUsage { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// If this is a `bancontact` PaymentMethod, this sub-hash contains details about the Bancontact payment method options. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdatePaymentIntentPaymentMethodOptionsBancontact { + /// Preferred language of the Bancontact authorization page that the customer is redirected to. + #[serde(skip_serializing_if = "Option::is_none")] + pub preferred_language: + Option, + /// Indicates that you intend to make future payments with this PaymentIntent's payment method. + /// + /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. + /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + /// + /// When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + /// + /// If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. + #[serde(skip_serializing_if = "Option::is_none")] + pub setup_future_usage: + Option, +} +impl UpdatePaymentIntentPaymentMethodOptionsBancontact { + pub fn new() -> Self { + Self::default() + } +} +/// Preferred language of the Bancontact authorization page that the customer is redirected to. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum UpdatePaymentIntentPaymentMethodOptionsBancontactPreferredLanguage { + De, + En, + Fr, + Nl, +} +impl UpdatePaymentIntentPaymentMethodOptionsBancontactPreferredLanguage { + pub fn as_str(self) -> &'static str { + use UpdatePaymentIntentPaymentMethodOptionsBancontactPreferredLanguage::*; + match self { + De => "de", + En => "en", + Fr => "fr", + Nl => "nl", + } + } +} + +impl std::str::FromStr for UpdatePaymentIntentPaymentMethodOptionsBancontactPreferredLanguage { + type Err = (); + fn from_str(s: &str) -> Result { + use UpdatePaymentIntentPaymentMethodOptionsBancontactPreferredLanguage::*; + match s { + "de" => Ok(De), + "en" => Ok(En), + "fr" => Ok(Fr), + "nl" => Ok(Nl), + _ => Err(()), + } + } +} +impl std::fmt::Display for UpdatePaymentIntentPaymentMethodOptionsBancontactPreferredLanguage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for UpdatePaymentIntentPaymentMethodOptionsBancontactPreferredLanguage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for UpdatePaymentIntentPaymentMethodOptionsBancontactPreferredLanguage { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Indicates that you intend to make future payments with this PaymentIntent's payment method. +/// +/// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. +/// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. +/// +/// When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). +/// +/// If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum UpdatePaymentIntentPaymentMethodOptionsBancontactSetupFutureUsage { + None, + OffSession, +} +impl UpdatePaymentIntentPaymentMethodOptionsBancontactSetupFutureUsage { + pub fn as_str(self) -> &'static str { + use UpdatePaymentIntentPaymentMethodOptionsBancontactSetupFutureUsage::*; + match self { + None => "none", + OffSession => "off_session", + } + } +} + +impl std::str::FromStr for UpdatePaymentIntentPaymentMethodOptionsBancontactSetupFutureUsage { + type Err = (); + fn from_str(s: &str) -> Result { + use UpdatePaymentIntentPaymentMethodOptionsBancontactSetupFutureUsage::*; + match s { + "none" => Ok(None), + "off_session" => Ok(OffSession), + _ => Err(()), + } + } +} +impl std::fmt::Display for UpdatePaymentIntentPaymentMethodOptionsBancontactSetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for UpdatePaymentIntentPaymentMethodOptionsBancontactSetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for UpdatePaymentIntentPaymentMethodOptionsBancontactSetupFutureUsage { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// If this is a `blik` PaymentMethod, this sub-hash contains details about the BLIK payment method options. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdatePaymentIntentPaymentMethodOptionsBlik<'a> { + /// The 6-digit BLIK code that a customer has generated using their banking application. + /// Can only be set on confirmation. + #[serde(skip_serializing_if = "Option::is_none")] + pub code: Option<&'a str>, + /// Indicates that you intend to make future payments with this PaymentIntent's payment method. + /// + /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. + /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + /// + /// When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + /// + /// If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. + #[serde(skip_serializing_if = "Option::is_none")] + pub setup_future_usage: Option, +} +impl<'a> UpdatePaymentIntentPaymentMethodOptionsBlik<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// Indicates that you intend to make future payments with this PaymentIntent's payment method. +/// +/// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. +/// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. +/// +/// When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). +/// +/// If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum UpdatePaymentIntentPaymentMethodOptionsBlikSetupFutureUsage { + None, +} +impl UpdatePaymentIntentPaymentMethodOptionsBlikSetupFutureUsage { + pub fn as_str(self) -> &'static str { + use UpdatePaymentIntentPaymentMethodOptionsBlikSetupFutureUsage::*; + match self { + None => "none", + } + } +} + +impl std::str::FromStr for UpdatePaymentIntentPaymentMethodOptionsBlikSetupFutureUsage { + type Err = (); + fn from_str(s: &str) -> Result { + use UpdatePaymentIntentPaymentMethodOptionsBlikSetupFutureUsage::*; + match s { + "none" => Ok(None), + _ => Err(()), + } + } +} +impl std::fmt::Display for UpdatePaymentIntentPaymentMethodOptionsBlikSetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for UpdatePaymentIntentPaymentMethodOptionsBlikSetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for UpdatePaymentIntentPaymentMethodOptionsBlikSetupFutureUsage { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// If this is a `boleto` PaymentMethod, this sub-hash contains details about the Boleto payment method options. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdatePaymentIntentPaymentMethodOptionsBoleto { + /// The number of calendar days before a Boleto voucher expires. + /// For example, if you create a Boleto voucher on Monday and you set expires_after_days to 2, the Boleto invoice will expire on Wednesday at 23:59 America/Sao_Paulo time. + #[serde(skip_serializing_if = "Option::is_none")] + pub expires_after_days: Option, + /// Indicates that you intend to make future payments with this PaymentIntent's payment method. + /// + /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. + /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + /// + /// When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + /// + /// If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. + #[serde(skip_serializing_if = "Option::is_none")] + pub setup_future_usage: Option, +} +impl UpdatePaymentIntentPaymentMethodOptionsBoleto { + pub fn new() -> Self { + Self::default() + } +} +/// Indicates that you intend to make future payments with this PaymentIntent's payment method. +/// +/// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. +/// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. +/// +/// When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). +/// +/// If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum UpdatePaymentIntentPaymentMethodOptionsBoletoSetupFutureUsage { + None, + OffSession, + OnSession, +} +impl UpdatePaymentIntentPaymentMethodOptionsBoletoSetupFutureUsage { + pub fn as_str(self) -> &'static str { + use UpdatePaymentIntentPaymentMethodOptionsBoletoSetupFutureUsage::*; + match self { + None => "none", + OffSession => "off_session", + OnSession => "on_session", + } + } +} + +impl std::str::FromStr for UpdatePaymentIntentPaymentMethodOptionsBoletoSetupFutureUsage { + type Err = (); + fn from_str(s: &str) -> Result { + use UpdatePaymentIntentPaymentMethodOptionsBoletoSetupFutureUsage::*; + match s { + "none" => Ok(None), + "off_session" => Ok(OffSession), + "on_session" => Ok(OnSession), + _ => Err(()), + } + } +} +impl std::fmt::Display for UpdatePaymentIntentPaymentMethodOptionsBoletoSetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for UpdatePaymentIntentPaymentMethodOptionsBoletoSetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for UpdatePaymentIntentPaymentMethodOptionsBoletoSetupFutureUsage { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Configuration for any card payments attempted on this PaymentIntent. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdatePaymentIntentPaymentMethodOptionsCard<'a> { + /// Controls when the funds will be captured from the customer's account. + /// + /// If provided, this parameter will override the top-level `capture_method` when finalizing the payment with this payment method type. + /// + /// If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter will unset the stored value for this payment method type. + #[serde(skip_serializing_if = "Option::is_none")] + pub capture_method: Option, + /// A single-use `cvc_update` Token that represents a card CVC value. + /// When provided, the CVC value will be verified during the card payment attempt. + /// This parameter can only be provided during confirmation. + #[serde(skip_serializing_if = "Option::is_none")] + pub cvc_token: Option<&'a str>, + /// Installment configuration for payments attempted on this PaymentIntent (Mexico Only). + /// + /// For more information, see the [installments integration guide](https://stripe.com/docs/payments/installments). + #[serde(skip_serializing_if = "Option::is_none")] + pub installments: Option, + /// Configuration options for setting up an eMandate for cards issued in India. + #[serde(skip_serializing_if = "Option::is_none")] + pub mandate_options: Option>, + /// When specified, this parameter indicates that a transaction will be marked + /// as MOTO (Mail Order Telephone Order) and thus out of scope for SCA. This + /// parameter can only be provided during confirmation. + #[serde(skip_serializing_if = "Option::is_none")] + pub moto: Option, + /// Selected network to process this PaymentIntent on. + /// Depends on the available networks of the card attached to the PaymentIntent. + /// Can be only set confirm-time. + #[serde(skip_serializing_if = "Option::is_none")] + pub network: Option, + /// Request ability to [capture beyond the standard authorization validity window](https://stripe.com/docs/payments/extended-authorization) for this PaymentIntent. + #[serde(skip_serializing_if = "Option::is_none")] + pub request_extended_authorization: + Option, + /// Request ability to [increment the authorization](https://stripe.com/docs/payments/incremental-authorization) for this PaymentIntent. + #[serde(skip_serializing_if = "Option::is_none")] + pub request_incremental_authorization: + Option, + /// Request ability to make [multiple captures](https://stripe.com/docs/payments/multicapture) for this PaymentIntent. + #[serde(skip_serializing_if = "Option::is_none")] + pub request_multicapture: + Option, + /// Request ability to [overcapture](https://stripe.com/docs/payments/overcapture) for this PaymentIntent. + #[serde(skip_serializing_if = "Option::is_none")] + pub request_overcapture: Option, + /// We strongly recommend that you rely on our SCA Engine to automatically prompt your customers for authentication based on risk level and [other requirements](https://stripe.com/docs/strong-customer-authentication). + /// However, if you wish to request 3D Secure based on logic from your own fraud engine, provide this option. + /// If not provided, this value defaults to `automatic`. + /// Read our guide on [manually requesting 3D Secure](https://stripe.com/docs/payments/3d-secure#manual-three-ds) for more information on how this configuration interacts with Radar and our SCA Engine. + #[serde(skip_serializing_if = "Option::is_none")] + pub request_three_d_secure: + Option, + /// When enabled, using a card that is attached to a customer will require the CVC to be provided again (i.e. + /// using the cvc_token parameter). + #[serde(skip_serializing_if = "Option::is_none")] + pub require_cvc_recollection: Option, + /// Indicates that you intend to make future payments with this PaymentIntent's payment method. + /// + /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. + /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + /// + /// When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + /// + /// If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. + #[serde(skip_serializing_if = "Option::is_none")] + pub setup_future_usage: Option, + /// Provides information about a card payment that customers see on their statements. + /// Concatenated with the Kana prefix (shortened Kana descriptor) or Kana statement descriptor that’s set on the account to form the complete statement descriptor. + /// Maximum 22 characters. + /// On card statements, the *concatenation* of both prefix and suffix (including separators) will appear truncated to 22 characters. + #[serde(skip_serializing_if = "Option::is_none")] + pub statement_descriptor_suffix_kana: Option<&'a str>, + /// Provides information about a card payment that customers see on their statements. + /// Concatenated with the Kanji prefix (shortened Kanji descriptor) or Kanji statement descriptor that’s set on the account to form the complete statement descriptor. + /// Maximum 17 characters. + /// On card statements, the *concatenation* of both prefix and suffix (including separators) will appear truncated to 17 characters. + #[serde(skip_serializing_if = "Option::is_none")] + pub statement_descriptor_suffix_kanji: Option<&'a str>, + /// If 3D Secure authentication was performed with a third-party provider, + /// the authentication details to use for this payment. + #[serde(skip_serializing_if = "Option::is_none")] + pub three_d_secure: Option>, +} +impl<'a> UpdatePaymentIntentPaymentMethodOptionsCard<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// Controls when the funds will be captured from the customer's account. +/// +/// If provided, this parameter will override the top-level `capture_method` when finalizing the payment with this payment method type. +/// +/// If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter will unset the stored value for this payment method type. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum UpdatePaymentIntentPaymentMethodOptionsCardCaptureMethod { + Manual, +} +impl UpdatePaymentIntentPaymentMethodOptionsCardCaptureMethod { + pub fn as_str(self) -> &'static str { + use UpdatePaymentIntentPaymentMethodOptionsCardCaptureMethod::*; + match self { + Manual => "manual", + } + } +} + +impl std::str::FromStr for UpdatePaymentIntentPaymentMethodOptionsCardCaptureMethod { + type Err = (); + fn from_str(s: &str) -> Result { + use UpdatePaymentIntentPaymentMethodOptionsCardCaptureMethod::*; + match s { + "manual" => Ok(Manual), + _ => Err(()), + } + } +} +impl std::fmt::Display for UpdatePaymentIntentPaymentMethodOptionsCardCaptureMethod { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for UpdatePaymentIntentPaymentMethodOptionsCardCaptureMethod { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for UpdatePaymentIntentPaymentMethodOptionsCardCaptureMethod { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Installment configuration for payments attempted on this PaymentIntent (Mexico Only). +/// +/// For more information, see the [installments integration guide](https://stripe.com/docs/payments/installments). +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdatePaymentIntentPaymentMethodOptionsCardInstallments { + /// Setting to true enables installments for this PaymentIntent. + /// This will cause the response to contain a list of available installment plans. + /// Setting to false will prevent any selected plan from applying to a charge. + #[serde(skip_serializing_if = "Option::is_none")] + pub enabled: Option, + /// The selected installment plan to use for this payment attempt. + /// This parameter can only be provided during confirmation. + #[serde(skip_serializing_if = "Option::is_none")] + pub plan: Option, +} +impl UpdatePaymentIntentPaymentMethodOptionsCardInstallments { + pub fn new() -> Self { + Self::default() + } +} +/// The selected installment plan to use for this payment attempt. +/// This parameter can only be provided during confirmation. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct UpdatePaymentIntentPaymentMethodOptionsCardInstallmentsPlan { + /// For `fixed_count` installment plans, this is the number of installment payments your customer will make to their credit card. + pub count: u64, + /// For `fixed_count` installment plans, this is the interval between installment payments your customer will make to their credit card. + /// One of `month`. + pub interval: UpdatePaymentIntentPaymentMethodOptionsCardInstallmentsPlanInterval, + /// Type of installment plan, one of `fixed_count`. + #[serde(rename = "type")] + pub type_: UpdatePaymentIntentPaymentMethodOptionsCardInstallmentsPlanType, +} +impl UpdatePaymentIntentPaymentMethodOptionsCardInstallmentsPlan { + pub fn new( + count: u64, + interval: UpdatePaymentIntentPaymentMethodOptionsCardInstallmentsPlanInterval, + type_: UpdatePaymentIntentPaymentMethodOptionsCardInstallmentsPlanType, + ) -> Self { + Self { count, interval, type_ } + } +} +/// For `fixed_count` installment plans, this is the interval between installment payments your customer will make to their credit card. +/// One of `month`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum UpdatePaymentIntentPaymentMethodOptionsCardInstallmentsPlanInterval { + Month, +} +impl UpdatePaymentIntentPaymentMethodOptionsCardInstallmentsPlanInterval { + pub fn as_str(self) -> &'static str { + use UpdatePaymentIntentPaymentMethodOptionsCardInstallmentsPlanInterval::*; + match self { + Month => "month", + } + } +} + +impl std::str::FromStr for UpdatePaymentIntentPaymentMethodOptionsCardInstallmentsPlanInterval { + type Err = (); + fn from_str(s: &str) -> Result { + use UpdatePaymentIntentPaymentMethodOptionsCardInstallmentsPlanInterval::*; + match s { + "month" => Ok(Month), + _ => Err(()), + } + } +} +impl std::fmt::Display for UpdatePaymentIntentPaymentMethodOptionsCardInstallmentsPlanInterval { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for UpdatePaymentIntentPaymentMethodOptionsCardInstallmentsPlanInterval { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for UpdatePaymentIntentPaymentMethodOptionsCardInstallmentsPlanInterval { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Type of installment plan, one of `fixed_count`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum UpdatePaymentIntentPaymentMethodOptionsCardInstallmentsPlanType { + FixedCount, +} +impl UpdatePaymentIntentPaymentMethodOptionsCardInstallmentsPlanType { + pub fn as_str(self) -> &'static str { + use UpdatePaymentIntentPaymentMethodOptionsCardInstallmentsPlanType::*; + match self { + FixedCount => "fixed_count", + } + } +} + +impl std::str::FromStr for UpdatePaymentIntentPaymentMethodOptionsCardInstallmentsPlanType { + type Err = (); + fn from_str(s: &str) -> Result { + use UpdatePaymentIntentPaymentMethodOptionsCardInstallmentsPlanType::*; + match s { + "fixed_count" => Ok(FixedCount), + _ => Err(()), + } + } +} +impl std::fmt::Display for UpdatePaymentIntentPaymentMethodOptionsCardInstallmentsPlanType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for UpdatePaymentIntentPaymentMethodOptionsCardInstallmentsPlanType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for UpdatePaymentIntentPaymentMethodOptionsCardInstallmentsPlanType { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Configuration options for setting up an eMandate for cards issued in India. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct UpdatePaymentIntentPaymentMethodOptionsCardMandateOptions<'a> { + /// Amount to be charged for future payments. + pub amount: i64, + /// One of `fixed` or `maximum`. + /// If `fixed`, the `amount` param refers to the exact amount to be charged in future payments. + /// If `maximum`, the amount charged can be up to the value passed for the `amount` param. + pub amount_type: UpdatePaymentIntentPaymentMethodOptionsCardMandateOptionsAmountType, + /// A description of the mandate or subscription that is meant to be displayed to the customer. + #[serde(skip_serializing_if = "Option::is_none")] + pub description: Option<&'a str>, + /// End date of the mandate or subscription. + /// If not provided, the mandate will be active until canceled. + /// If provided, end date should be after start date. + #[serde(skip_serializing_if = "Option::is_none")] + pub end_date: Option, + /// Specifies payment frequency. One of `day`, `week`, `month`, `year`, or `sporadic`. + pub interval: UpdatePaymentIntentPaymentMethodOptionsCardMandateOptionsInterval, + /// The number of intervals between payments. + /// For example, `interval=month` and `interval_count=3` indicates one payment every three months. + /// Maximum of one year interval allowed (1 year, 12 months, or 52 weeks). + /// This parameter is optional when `interval=sporadic`. + #[serde(skip_serializing_if = "Option::is_none")] + pub interval_count: Option, + /// Unique identifier for the mandate or subscription. + pub reference: &'a str, + /// Start date of the mandate or subscription. Start date should not be lesser than yesterday. + pub start_date: stripe_types::Timestamp, + /// Specifies the type of mandates supported. Possible values are `india`. + #[serde(skip_serializing_if = "Option::is_none")] + pub supported_types: + Option<&'a [UpdatePaymentIntentPaymentMethodOptionsCardMandateOptionsSupportedTypes]>, +} +impl<'a> UpdatePaymentIntentPaymentMethodOptionsCardMandateOptions<'a> { + pub fn new( + amount: i64, + amount_type: UpdatePaymentIntentPaymentMethodOptionsCardMandateOptionsAmountType, + interval: UpdatePaymentIntentPaymentMethodOptionsCardMandateOptionsInterval, + reference: &'a str, + start_date: stripe_types::Timestamp, + ) -> Self { + Self { + amount, + amount_type, + description: None, + end_date: None, + interval, + interval_count: None, + reference, + start_date, + supported_types: None, + } + } +} +/// One of `fixed` or `maximum`. +/// If `fixed`, the `amount` param refers to the exact amount to be charged in future payments. +/// If `maximum`, the amount charged can be up to the value passed for the `amount` param. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum UpdatePaymentIntentPaymentMethodOptionsCardMandateOptionsAmountType { + Fixed, + Maximum, +} +impl UpdatePaymentIntentPaymentMethodOptionsCardMandateOptionsAmountType { + pub fn as_str(self) -> &'static str { + use UpdatePaymentIntentPaymentMethodOptionsCardMandateOptionsAmountType::*; + match self { + Fixed => "fixed", + Maximum => "maximum", + } + } +} + +impl std::str::FromStr for UpdatePaymentIntentPaymentMethodOptionsCardMandateOptionsAmountType { + type Err = (); + fn from_str(s: &str) -> Result { + use UpdatePaymentIntentPaymentMethodOptionsCardMandateOptionsAmountType::*; + match s { + "fixed" => Ok(Fixed), + "maximum" => Ok(Maximum), + _ => Err(()), + } + } +} +impl std::fmt::Display for UpdatePaymentIntentPaymentMethodOptionsCardMandateOptionsAmountType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for UpdatePaymentIntentPaymentMethodOptionsCardMandateOptionsAmountType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for UpdatePaymentIntentPaymentMethodOptionsCardMandateOptionsAmountType { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Specifies payment frequency. One of `day`, `week`, `month`, `year`, or `sporadic`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum UpdatePaymentIntentPaymentMethodOptionsCardMandateOptionsInterval { + Day, + Month, + Sporadic, + Week, + Year, +} +impl UpdatePaymentIntentPaymentMethodOptionsCardMandateOptionsInterval { + pub fn as_str(self) -> &'static str { + use UpdatePaymentIntentPaymentMethodOptionsCardMandateOptionsInterval::*; + match self { + Day => "day", + Month => "month", + Sporadic => "sporadic", + Week => "week", + Year => "year", + } + } +} + +impl std::str::FromStr for UpdatePaymentIntentPaymentMethodOptionsCardMandateOptionsInterval { + type Err = (); + fn from_str(s: &str) -> Result { + use UpdatePaymentIntentPaymentMethodOptionsCardMandateOptionsInterval::*; + match s { + "day" => Ok(Day), + "month" => Ok(Month), + "sporadic" => Ok(Sporadic), + "week" => Ok(Week), + "year" => Ok(Year), + _ => Err(()), + } + } +} +impl std::fmt::Display for UpdatePaymentIntentPaymentMethodOptionsCardMandateOptionsInterval { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for UpdatePaymentIntentPaymentMethodOptionsCardMandateOptionsInterval { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for UpdatePaymentIntentPaymentMethodOptionsCardMandateOptionsInterval { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Specifies the type of mandates supported. Possible values are `india`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum UpdatePaymentIntentPaymentMethodOptionsCardMandateOptionsSupportedTypes { + India, +} +impl UpdatePaymentIntentPaymentMethodOptionsCardMandateOptionsSupportedTypes { + pub fn as_str(self) -> &'static str { + use UpdatePaymentIntentPaymentMethodOptionsCardMandateOptionsSupportedTypes::*; + match self { + India => "india", + } + } +} + +impl std::str::FromStr for UpdatePaymentIntentPaymentMethodOptionsCardMandateOptionsSupportedTypes { + type Err = (); + fn from_str(s: &str) -> Result { + use UpdatePaymentIntentPaymentMethodOptionsCardMandateOptionsSupportedTypes::*; + match s { + "india" => Ok(India), + _ => Err(()), + } + } +} +impl std::fmt::Display for UpdatePaymentIntentPaymentMethodOptionsCardMandateOptionsSupportedTypes { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for UpdatePaymentIntentPaymentMethodOptionsCardMandateOptionsSupportedTypes { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for UpdatePaymentIntentPaymentMethodOptionsCardMandateOptionsSupportedTypes { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Selected network to process this PaymentIntent on. +/// Depends on the available networks of the card attached to the PaymentIntent. +/// Can be only set confirm-time. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum UpdatePaymentIntentPaymentMethodOptionsCardNetwork { + Amex, + CartesBancaires, + Diners, + Discover, + EftposAu, + Interac, + Jcb, + Mastercard, + Unionpay, + Unknown, + Visa, +} +impl UpdatePaymentIntentPaymentMethodOptionsCardNetwork { + pub fn as_str(self) -> &'static str { + use UpdatePaymentIntentPaymentMethodOptionsCardNetwork::*; + match self { + Amex => "amex", + CartesBancaires => "cartes_bancaires", + Diners => "diners", + Discover => "discover", + EftposAu => "eftpos_au", + Interac => "interac", + Jcb => "jcb", + Mastercard => "mastercard", + Unionpay => "unionpay", + Unknown => "unknown", + Visa => "visa", + } + } +} + +impl std::str::FromStr for UpdatePaymentIntentPaymentMethodOptionsCardNetwork { + type Err = (); + fn from_str(s: &str) -> Result { + use UpdatePaymentIntentPaymentMethodOptionsCardNetwork::*; + match s { + "amex" => Ok(Amex), + "cartes_bancaires" => Ok(CartesBancaires), + "diners" => Ok(Diners), + "discover" => Ok(Discover), + "eftpos_au" => Ok(EftposAu), + "interac" => Ok(Interac), + "jcb" => Ok(Jcb), + "mastercard" => Ok(Mastercard), + "unionpay" => Ok(Unionpay), + "unknown" => Ok(Unknown), + "visa" => Ok(Visa), + _ => Err(()), + } + } +} +impl std::fmt::Display for UpdatePaymentIntentPaymentMethodOptionsCardNetwork { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for UpdatePaymentIntentPaymentMethodOptionsCardNetwork { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for UpdatePaymentIntentPaymentMethodOptionsCardNetwork { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Request ability to [capture beyond the standard authorization validity window](https://stripe.com/docs/payments/extended-authorization) for this PaymentIntent. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum UpdatePaymentIntentPaymentMethodOptionsCardRequestExtendedAuthorization { + IfAvailable, + Never, +} +impl UpdatePaymentIntentPaymentMethodOptionsCardRequestExtendedAuthorization { + pub fn as_str(self) -> &'static str { + use UpdatePaymentIntentPaymentMethodOptionsCardRequestExtendedAuthorization::*; + match self { + IfAvailable => "if_available", + Never => "never", + } + } +} + +impl std::str::FromStr for UpdatePaymentIntentPaymentMethodOptionsCardRequestExtendedAuthorization { + type Err = (); + fn from_str(s: &str) -> Result { + use UpdatePaymentIntentPaymentMethodOptionsCardRequestExtendedAuthorization::*; + match s { + "if_available" => Ok(IfAvailable), + "never" => Ok(Never), + _ => Err(()), + } + } +} +impl std::fmt::Display for UpdatePaymentIntentPaymentMethodOptionsCardRequestExtendedAuthorization { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for UpdatePaymentIntentPaymentMethodOptionsCardRequestExtendedAuthorization { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for UpdatePaymentIntentPaymentMethodOptionsCardRequestExtendedAuthorization { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Request ability to [increment the authorization](https://stripe.com/docs/payments/incremental-authorization) for this PaymentIntent. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum UpdatePaymentIntentPaymentMethodOptionsCardRequestIncrementalAuthorization { + IfAvailable, + Never, +} +impl UpdatePaymentIntentPaymentMethodOptionsCardRequestIncrementalAuthorization { + pub fn as_str(self) -> &'static str { + use UpdatePaymentIntentPaymentMethodOptionsCardRequestIncrementalAuthorization::*; + match self { + IfAvailable => "if_available", + Never => "never", + } + } +} + +impl std::str::FromStr + for UpdatePaymentIntentPaymentMethodOptionsCardRequestIncrementalAuthorization +{ + type Err = (); + fn from_str(s: &str) -> Result { + use UpdatePaymentIntentPaymentMethodOptionsCardRequestIncrementalAuthorization::*; + match s { + "if_available" => Ok(IfAvailable), + "never" => Ok(Never), + _ => Err(()), + } + } +} +impl std::fmt::Display + for UpdatePaymentIntentPaymentMethodOptionsCardRequestIncrementalAuthorization +{ + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug + for UpdatePaymentIntentPaymentMethodOptionsCardRequestIncrementalAuthorization +{ + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize + for UpdatePaymentIntentPaymentMethodOptionsCardRequestIncrementalAuthorization +{ + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Request ability to make [multiple captures](https://stripe.com/docs/payments/multicapture) for this PaymentIntent. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum UpdatePaymentIntentPaymentMethodOptionsCardRequestMulticapture { + IfAvailable, + Never, +} +impl UpdatePaymentIntentPaymentMethodOptionsCardRequestMulticapture { + pub fn as_str(self) -> &'static str { + use UpdatePaymentIntentPaymentMethodOptionsCardRequestMulticapture::*; + match self { + IfAvailable => "if_available", + Never => "never", + } + } +} + +impl std::str::FromStr for UpdatePaymentIntentPaymentMethodOptionsCardRequestMulticapture { + type Err = (); + fn from_str(s: &str) -> Result { + use UpdatePaymentIntentPaymentMethodOptionsCardRequestMulticapture::*; + match s { + "if_available" => Ok(IfAvailable), + "never" => Ok(Never), + _ => Err(()), + } + } +} +impl std::fmt::Display for UpdatePaymentIntentPaymentMethodOptionsCardRequestMulticapture { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for UpdatePaymentIntentPaymentMethodOptionsCardRequestMulticapture { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for UpdatePaymentIntentPaymentMethodOptionsCardRequestMulticapture { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Request ability to [overcapture](https://stripe.com/docs/payments/overcapture) for this PaymentIntent. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum UpdatePaymentIntentPaymentMethodOptionsCardRequestOvercapture { + IfAvailable, + Never, +} +impl UpdatePaymentIntentPaymentMethodOptionsCardRequestOvercapture { + pub fn as_str(self) -> &'static str { + use UpdatePaymentIntentPaymentMethodOptionsCardRequestOvercapture::*; + match self { + IfAvailable => "if_available", + Never => "never", + } + } +} + +impl std::str::FromStr for UpdatePaymentIntentPaymentMethodOptionsCardRequestOvercapture { + type Err = (); + fn from_str(s: &str) -> Result { + use UpdatePaymentIntentPaymentMethodOptionsCardRequestOvercapture::*; + match s { + "if_available" => Ok(IfAvailable), + "never" => Ok(Never), + _ => Err(()), + } + } +} +impl std::fmt::Display for UpdatePaymentIntentPaymentMethodOptionsCardRequestOvercapture { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for UpdatePaymentIntentPaymentMethodOptionsCardRequestOvercapture { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for UpdatePaymentIntentPaymentMethodOptionsCardRequestOvercapture { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// We strongly recommend that you rely on our SCA Engine to automatically prompt your customers for authentication based on risk level and [other requirements](https://stripe.com/docs/strong-customer-authentication). +/// However, if you wish to request 3D Secure based on logic from your own fraud engine, provide this option. +/// If not provided, this value defaults to `automatic`. +/// Read our guide on [manually requesting 3D Secure](https://stripe.com/docs/payments/3d-secure#manual-three-ds) for more information on how this configuration interacts with Radar and our SCA Engine. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum UpdatePaymentIntentPaymentMethodOptionsCardRequestThreeDSecure { + Any, + Automatic, + Challenge, +} +impl UpdatePaymentIntentPaymentMethodOptionsCardRequestThreeDSecure { + pub fn as_str(self) -> &'static str { + use UpdatePaymentIntentPaymentMethodOptionsCardRequestThreeDSecure::*; + match self { + Any => "any", + Automatic => "automatic", + Challenge => "challenge", + } + } +} + +impl std::str::FromStr for UpdatePaymentIntentPaymentMethodOptionsCardRequestThreeDSecure { + type Err = (); + fn from_str(s: &str) -> Result { + use UpdatePaymentIntentPaymentMethodOptionsCardRequestThreeDSecure::*; + match s { + "any" => Ok(Any), + "automatic" => Ok(Automatic), + "challenge" => Ok(Challenge), + _ => Err(()), + } + } +} +impl std::fmt::Display for UpdatePaymentIntentPaymentMethodOptionsCardRequestThreeDSecure { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for UpdatePaymentIntentPaymentMethodOptionsCardRequestThreeDSecure { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for UpdatePaymentIntentPaymentMethodOptionsCardRequestThreeDSecure { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Indicates that you intend to make future payments with this PaymentIntent's payment method. +/// +/// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. +/// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. +/// +/// When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). +/// +/// If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum UpdatePaymentIntentPaymentMethodOptionsCardSetupFutureUsage { + None, + OffSession, + OnSession, +} +impl UpdatePaymentIntentPaymentMethodOptionsCardSetupFutureUsage { + pub fn as_str(self) -> &'static str { + use UpdatePaymentIntentPaymentMethodOptionsCardSetupFutureUsage::*; + match self { + None => "none", + OffSession => "off_session", + OnSession => "on_session", + } + } +} + +impl std::str::FromStr for UpdatePaymentIntentPaymentMethodOptionsCardSetupFutureUsage { + type Err = (); + fn from_str(s: &str) -> Result { + use UpdatePaymentIntentPaymentMethodOptionsCardSetupFutureUsage::*; + match s { + "none" => Ok(None), + "off_session" => Ok(OffSession), + "on_session" => Ok(OnSession), + _ => Err(()), + } + } +} +impl std::fmt::Display for UpdatePaymentIntentPaymentMethodOptionsCardSetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for UpdatePaymentIntentPaymentMethodOptionsCardSetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for UpdatePaymentIntentPaymentMethodOptionsCardSetupFutureUsage { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// If 3D Secure authentication was performed with a third-party provider, +/// the authentication details to use for this payment. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct UpdatePaymentIntentPaymentMethodOptionsCardThreeDSecure<'a> { + /// The `transStatus` returned from the card Issuer’s ACS in the ARes. + #[serde(skip_serializing_if = "Option::is_none")] + pub ares_trans_status: + Option, + /// The cryptogram, also known as the "authentication value" (AAV, CAVV or + /// AEVV). This value is 20 bytes, base64-encoded into a 28-character string. + /// (Most 3D Secure providers will return the base64-encoded version, which + /// is what you should specify here.) + pub cryptogram: &'a str, + /// The Electronic Commerce Indicator (ECI) is returned by your 3D Secure + /// provider and indicates what degree of authentication was performed. + #[serde(skip_serializing_if = "Option::is_none")] + pub electronic_commerce_indicator: + Option, + /// The exemption requested via 3DS and accepted by the issuer at authentication time. + #[serde(skip_serializing_if = "Option::is_none")] + pub exemption_indicator: + Option, + /// Network specific 3DS fields. Network specific arguments require an + /// explicit card brand choice. The parameter `payment_method_options.card.network`` + /// must be populated accordingly + #[serde(skip_serializing_if = "Option::is_none")] + pub network_options: + Option>, + /// The challenge indicator (`threeDSRequestorChallengeInd`) which was requested in the + /// AReq sent to the card Issuer's ACS. A string containing 2 digits from 01-99. + #[serde(skip_serializing_if = "Option::is_none")] + pub requestor_challenge_indicator: Option<&'a str>, + /// For 3D Secure 1, the XID. For 3D Secure 2, the Directory Server + /// Transaction ID (dsTransID). + pub transaction_id: &'a str, + /// The version of 3D Secure that was performed. + pub version: UpdatePaymentIntentPaymentMethodOptionsCardThreeDSecureVersion, +} +impl<'a> UpdatePaymentIntentPaymentMethodOptionsCardThreeDSecure<'a> { + pub fn new( + cryptogram: &'a str, + transaction_id: &'a str, + version: UpdatePaymentIntentPaymentMethodOptionsCardThreeDSecureVersion, + ) -> Self { + Self { + ares_trans_status: None, + cryptogram, + electronic_commerce_indicator: None, + exemption_indicator: None, + network_options: None, + requestor_challenge_indicator: None, + transaction_id, + version, + } + } +} +/// The `transStatus` returned from the card Issuer’s ACS in the ARes. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum UpdatePaymentIntentPaymentMethodOptionsCardThreeDSecureAresTransStatus { + A, + C, + I, + N, + R, + U, + Y, +} +impl UpdatePaymentIntentPaymentMethodOptionsCardThreeDSecureAresTransStatus { + pub fn as_str(self) -> &'static str { + use UpdatePaymentIntentPaymentMethodOptionsCardThreeDSecureAresTransStatus::*; + match self { + A => "A", + C => "C", + I => "I", + N => "N", + R => "R", + U => "U", + Y => "Y", + } + } +} + +impl std::str::FromStr for UpdatePaymentIntentPaymentMethodOptionsCardThreeDSecureAresTransStatus { + type Err = (); + fn from_str(s: &str) -> Result { + use UpdatePaymentIntentPaymentMethodOptionsCardThreeDSecureAresTransStatus::*; + match s { + "A" => Ok(A), + "C" => Ok(C), + "I" => Ok(I), + "N" => Ok(N), + "R" => Ok(R), + "U" => Ok(U), + "Y" => Ok(Y), + _ => Err(()), + } + } +} +impl std::fmt::Display for UpdatePaymentIntentPaymentMethodOptionsCardThreeDSecureAresTransStatus { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for UpdatePaymentIntentPaymentMethodOptionsCardThreeDSecureAresTransStatus { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for UpdatePaymentIntentPaymentMethodOptionsCardThreeDSecureAresTransStatus { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// The Electronic Commerce Indicator (ECI) is returned by your 3D Secure +/// provider and indicates what degree of authentication was performed. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum UpdatePaymentIntentPaymentMethodOptionsCardThreeDSecureElectronicCommerceIndicator { + V01, + V02, + V05, + V06, + V07, +} +impl UpdatePaymentIntentPaymentMethodOptionsCardThreeDSecureElectronicCommerceIndicator { + pub fn as_str(self) -> &'static str { + use UpdatePaymentIntentPaymentMethodOptionsCardThreeDSecureElectronicCommerceIndicator::*; + match self { + V01 => "01", + V02 => "02", + V05 => "05", + V06 => "06", + V07 => "07", + } + } +} + +impl std::str::FromStr + for UpdatePaymentIntentPaymentMethodOptionsCardThreeDSecureElectronicCommerceIndicator +{ + type Err = (); + fn from_str(s: &str) -> Result { + use UpdatePaymentIntentPaymentMethodOptionsCardThreeDSecureElectronicCommerceIndicator::*; + match s { + "01" => Ok(V01), + "02" => Ok(V02), + "05" => Ok(V05), + "06" => Ok(V06), + "07" => Ok(V07), + _ => Err(()), + } + } +} +impl std::fmt::Display + for UpdatePaymentIntentPaymentMethodOptionsCardThreeDSecureElectronicCommerceIndicator +{ + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug + for UpdatePaymentIntentPaymentMethodOptionsCardThreeDSecureElectronicCommerceIndicator +{ + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize + for UpdatePaymentIntentPaymentMethodOptionsCardThreeDSecureElectronicCommerceIndicator +{ + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// The exemption requested via 3DS and accepted by the issuer at authentication time. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum UpdatePaymentIntentPaymentMethodOptionsCardThreeDSecureExemptionIndicator { + LowRisk, + None, +} +impl UpdatePaymentIntentPaymentMethodOptionsCardThreeDSecureExemptionIndicator { + pub fn as_str(self) -> &'static str { + use UpdatePaymentIntentPaymentMethodOptionsCardThreeDSecureExemptionIndicator::*; + match self { + LowRisk => "low_risk", + None => "none", + } + } +} + +impl std::str::FromStr + for UpdatePaymentIntentPaymentMethodOptionsCardThreeDSecureExemptionIndicator +{ + type Err = (); + fn from_str(s: &str) -> Result { + use UpdatePaymentIntentPaymentMethodOptionsCardThreeDSecureExemptionIndicator::*; + match s { + "low_risk" => Ok(LowRisk), + "none" => Ok(None), + _ => Err(()), + } + } +} +impl std::fmt::Display + for UpdatePaymentIntentPaymentMethodOptionsCardThreeDSecureExemptionIndicator +{ + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for UpdatePaymentIntentPaymentMethodOptionsCardThreeDSecureExemptionIndicator { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize + for UpdatePaymentIntentPaymentMethodOptionsCardThreeDSecureExemptionIndicator +{ + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Network specific 3DS fields. Network specific arguments require an +/// explicit card brand choice. The parameter `payment_method_options.card.network`` +/// must be populated accordingly +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdatePaymentIntentPaymentMethodOptionsCardThreeDSecureNetworkOptions<'a> { + /// Cartes Bancaires-specific 3DS fields. + #[serde(skip_serializing_if = "Option::is_none")] + pub cartes_bancaires: Option< + UpdatePaymentIntentPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancaires<'a>, + >, +} +impl<'a> UpdatePaymentIntentPaymentMethodOptionsCardThreeDSecureNetworkOptions<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// Cartes Bancaires-specific 3DS fields. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct UpdatePaymentIntentPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancaires<'a> { + /// The cryptogram calculation algorithm used by the card Issuer's ACS + /// to calculate the Authentication cryptogram. Also known as `cavvAlgorithm`. + /// messageExtension: CB-AVALGO +pub cb_avalgo: UpdatePaymentIntentPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancairesCbAvalgo, + /// The exemption indicator returned from Cartes Bancaires in the ARes. + /// message extension: CB-EXEMPTION; string (4 characters) + /// This is a 3 byte bitmap (low significant byte first and most significant + /// bit first) that has been Base64 encoded +#[serde(skip_serializing_if = "Option::is_none")] +pub cb_exemption: Option<&'a str>, + /// The risk score returned from Cartes Bancaires in the ARes. + /// message extension: CB-SCORE; numeric value 0-99 +#[serde(skip_serializing_if = "Option::is_none")] +pub cb_score: Option, + +} +impl<'a> UpdatePaymentIntentPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancaires<'a> { + pub fn new( + cb_avalgo: UpdatePaymentIntentPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancairesCbAvalgo, + ) -> Self { + Self { cb_avalgo, cb_exemption: None, cb_score: None } + } +} +/// The cryptogram calculation algorithm used by the card Issuer's ACS +/// to calculate the Authentication cryptogram. Also known as `cavvAlgorithm`. +/// messageExtension: CB-AVALGO +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum UpdatePaymentIntentPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancairesCbAvalgo +{ + V0, + V1, + V2, + V3, + V4, + A, +} +impl UpdatePaymentIntentPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancairesCbAvalgo { + pub fn as_str(self) -> &'static str { + use UpdatePaymentIntentPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancairesCbAvalgo::*; + match self { + V0 => "0", + V1 => "1", + V2 => "2", + V3 => "3", + V4 => "4", + A => "A", + } + } +} + +impl std::str::FromStr + for UpdatePaymentIntentPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancairesCbAvalgo +{ + type Err = (); + fn from_str(s: &str) -> Result { + use UpdatePaymentIntentPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancairesCbAvalgo::*; + match s { + "0" => Ok(V0), + "1" => Ok(V1), + "2" => Ok(V2), + "3" => Ok(V3), + "4" => Ok(V4), + "A" => Ok(A), + _ => Err(()), + } + } +} +impl std::fmt::Display + for UpdatePaymentIntentPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancairesCbAvalgo +{ + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug + for UpdatePaymentIntentPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancairesCbAvalgo +{ + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize + for UpdatePaymentIntentPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancairesCbAvalgo +{ + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// The version of 3D Secure that was performed. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum UpdatePaymentIntentPaymentMethodOptionsCardThreeDSecureVersion { + V1_0_2, + V2_1_0, + V2_2_0, +} +impl UpdatePaymentIntentPaymentMethodOptionsCardThreeDSecureVersion { + pub fn as_str(self) -> &'static str { + use UpdatePaymentIntentPaymentMethodOptionsCardThreeDSecureVersion::*; + match self { + V1_0_2 => "1.0.2", + V2_1_0 => "2.1.0", + V2_2_0 => "2.2.0", + } + } +} + +impl std::str::FromStr for UpdatePaymentIntentPaymentMethodOptionsCardThreeDSecureVersion { + type Err = (); + fn from_str(s: &str) -> Result { + use UpdatePaymentIntentPaymentMethodOptionsCardThreeDSecureVersion::*; + match s { + "1.0.2" => Ok(V1_0_2), + "2.1.0" => Ok(V2_1_0), + "2.2.0" => Ok(V2_2_0), + _ => Err(()), + } + } +} +impl std::fmt::Display for UpdatePaymentIntentPaymentMethodOptionsCardThreeDSecureVersion { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for UpdatePaymentIntentPaymentMethodOptionsCardThreeDSecureVersion { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for UpdatePaymentIntentPaymentMethodOptionsCardThreeDSecureVersion { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// If this is a `cashapp` PaymentMethod, this sub-hash contains details about the Cash App Pay payment method options. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdatePaymentIntentPaymentMethodOptionsCashapp { + /// Controls when the funds will be captured from the customer's account. + /// + /// If provided, this parameter will override the top-level `capture_method` when finalizing the payment with this payment method type. + /// + /// If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter will unset the stored value for this payment method type. + #[serde(skip_serializing_if = "Option::is_none")] + pub capture_method: Option, + /// Indicates that you intend to make future payments with this PaymentIntent's payment method. + /// + /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. + /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + /// + /// When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + /// + /// If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. + #[serde(skip_serializing_if = "Option::is_none")] + pub setup_future_usage: Option, +} +impl UpdatePaymentIntentPaymentMethodOptionsCashapp { + pub fn new() -> Self { + Self::default() + } +} +/// Controls when the funds will be captured from the customer's account. +/// +/// If provided, this parameter will override the top-level `capture_method` when finalizing the payment with this payment method type. +/// +/// If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter will unset the stored value for this payment method type. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum UpdatePaymentIntentPaymentMethodOptionsCashappCaptureMethod { + Manual, +} +impl UpdatePaymentIntentPaymentMethodOptionsCashappCaptureMethod { + pub fn as_str(self) -> &'static str { + use UpdatePaymentIntentPaymentMethodOptionsCashappCaptureMethod::*; + match self { + Manual => "manual", + } + } +} + +impl std::str::FromStr for UpdatePaymentIntentPaymentMethodOptionsCashappCaptureMethod { + type Err = (); + fn from_str(s: &str) -> Result { + use UpdatePaymentIntentPaymentMethodOptionsCashappCaptureMethod::*; + match s { + "manual" => Ok(Manual), + _ => Err(()), + } + } +} +impl std::fmt::Display for UpdatePaymentIntentPaymentMethodOptionsCashappCaptureMethod { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for UpdatePaymentIntentPaymentMethodOptionsCashappCaptureMethod { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for UpdatePaymentIntentPaymentMethodOptionsCashappCaptureMethod { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Indicates that you intend to make future payments with this PaymentIntent's payment method. +/// +/// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. +/// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. +/// +/// When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). +/// +/// If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum UpdatePaymentIntentPaymentMethodOptionsCashappSetupFutureUsage { + None, + OffSession, + OnSession, +} +impl UpdatePaymentIntentPaymentMethodOptionsCashappSetupFutureUsage { + pub fn as_str(self) -> &'static str { + use UpdatePaymentIntentPaymentMethodOptionsCashappSetupFutureUsage::*; + match self { + None => "none", + OffSession => "off_session", + OnSession => "on_session", + } + } +} + +impl std::str::FromStr for UpdatePaymentIntentPaymentMethodOptionsCashappSetupFutureUsage { + type Err = (); + fn from_str(s: &str) -> Result { + use UpdatePaymentIntentPaymentMethodOptionsCashappSetupFutureUsage::*; + match s { + "none" => Ok(None), + "off_session" => Ok(OffSession), + "on_session" => Ok(OnSession), + _ => Err(()), + } + } +} +impl std::fmt::Display for UpdatePaymentIntentPaymentMethodOptionsCashappSetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for UpdatePaymentIntentPaymentMethodOptionsCashappSetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for UpdatePaymentIntentPaymentMethodOptionsCashappSetupFutureUsage { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// If this is a `customer balance` PaymentMethod, this sub-hash contains details about the customer balance payment method options. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdatePaymentIntentPaymentMethodOptionsCustomerBalance<'a> { + /// Configuration for the bank transfer funding type, if the `funding_type` is set to `bank_transfer`. + #[serde(skip_serializing_if = "Option::is_none")] + pub bank_transfer: + Option>, + /// The funding method type to be used when there are not enough funds in the customer balance. + /// Permitted values include: `bank_transfer`. + #[serde(skip_serializing_if = "Option::is_none")] + pub funding_type: Option, + /// Indicates that you intend to make future payments with this PaymentIntent's payment method. + /// + /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. + /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + /// + /// When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + /// + /// If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. + #[serde(skip_serializing_if = "Option::is_none")] + pub setup_future_usage: + Option, +} +impl<'a> UpdatePaymentIntentPaymentMethodOptionsCustomerBalance<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// Configuration for the bank transfer funding type, if the `funding_type` is set to `bank_transfer`. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct UpdatePaymentIntentPaymentMethodOptionsCustomerBalanceBankTransfer<'a> { + /// Configuration for the eu_bank_transfer funding type. +#[serde(skip_serializing_if = "Option::is_none")] +pub eu_bank_transfer: Option>, + /// List of address types that should be returned in the financial_addresses response. + /// If not specified, all valid types will be returned. + /// + /// Permitted values include: `sort_code`, `zengin`, `iban`, or `spei`. +#[serde(skip_serializing_if = "Option::is_none")] +pub requested_address_types: Option<&'a [UpdatePaymentIntentPaymentMethodOptionsCustomerBalanceBankTransferRequestedAddressTypes]>, + /// The list of bank transfer types that this PaymentIntent is allowed to use for funding Permitted values include: `eu_bank_transfer`, `gb_bank_transfer`, `jp_bank_transfer`, `mx_bank_transfer`, or `us_bank_transfer`. +#[serde(rename = "type")] +pub type_: UpdatePaymentIntentPaymentMethodOptionsCustomerBalanceBankTransferType, + +} +impl<'a> UpdatePaymentIntentPaymentMethodOptionsCustomerBalanceBankTransfer<'a> { + pub fn new( + type_: UpdatePaymentIntentPaymentMethodOptionsCustomerBalanceBankTransferType, + ) -> Self { + Self { eu_bank_transfer: None, requested_address_types: None, type_ } + } +} +/// List of address types that should be returned in the financial_addresses response. +/// If not specified, all valid types will be returned. +/// +/// Permitted values include: `sort_code`, `zengin`, `iban`, or `spei`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum UpdatePaymentIntentPaymentMethodOptionsCustomerBalanceBankTransferRequestedAddressTypes { + Aba, + Iban, + Sepa, + SortCode, + Spei, + Swift, + Zengin, +} +impl UpdatePaymentIntentPaymentMethodOptionsCustomerBalanceBankTransferRequestedAddressTypes { + pub fn as_str(self) -> &'static str { + use UpdatePaymentIntentPaymentMethodOptionsCustomerBalanceBankTransferRequestedAddressTypes::*; + match self { + Aba => "aba", + Iban => "iban", + Sepa => "sepa", + SortCode => "sort_code", + Spei => "spei", + Swift => "swift", + Zengin => "zengin", + } + } +} + +impl std::str::FromStr + for UpdatePaymentIntentPaymentMethodOptionsCustomerBalanceBankTransferRequestedAddressTypes +{ + type Err = (); + fn from_str(s: &str) -> Result { + use UpdatePaymentIntentPaymentMethodOptionsCustomerBalanceBankTransferRequestedAddressTypes::*; + match s { + "aba" => Ok(Aba), + "iban" => Ok(Iban), + "sepa" => Ok(Sepa), + "sort_code" => Ok(SortCode), + "spei" => Ok(Spei), + "swift" => Ok(Swift), + "zengin" => Ok(Zengin), + _ => Err(()), + } + } +} +impl std::fmt::Display + for UpdatePaymentIntentPaymentMethodOptionsCustomerBalanceBankTransferRequestedAddressTypes +{ + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug + for UpdatePaymentIntentPaymentMethodOptionsCustomerBalanceBankTransferRequestedAddressTypes +{ + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize + for UpdatePaymentIntentPaymentMethodOptionsCustomerBalanceBankTransferRequestedAddressTypes +{ + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// The list of bank transfer types that this PaymentIntent is allowed to use for funding Permitted values include: `eu_bank_transfer`, `gb_bank_transfer`, `jp_bank_transfer`, `mx_bank_transfer`, or `us_bank_transfer`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum UpdatePaymentIntentPaymentMethodOptionsCustomerBalanceBankTransferType { + EuBankTransfer, + GbBankTransfer, + JpBankTransfer, + MxBankTransfer, + UsBankTransfer, +} +impl UpdatePaymentIntentPaymentMethodOptionsCustomerBalanceBankTransferType { + pub fn as_str(self) -> &'static str { + use UpdatePaymentIntentPaymentMethodOptionsCustomerBalanceBankTransferType::*; + match self { + EuBankTransfer => "eu_bank_transfer", + GbBankTransfer => "gb_bank_transfer", + JpBankTransfer => "jp_bank_transfer", + MxBankTransfer => "mx_bank_transfer", + UsBankTransfer => "us_bank_transfer", + } + } +} + +impl std::str::FromStr for UpdatePaymentIntentPaymentMethodOptionsCustomerBalanceBankTransferType { + type Err = (); + fn from_str(s: &str) -> Result { + use UpdatePaymentIntentPaymentMethodOptionsCustomerBalanceBankTransferType::*; + match s { + "eu_bank_transfer" => Ok(EuBankTransfer), + "gb_bank_transfer" => Ok(GbBankTransfer), + "jp_bank_transfer" => Ok(JpBankTransfer), + "mx_bank_transfer" => Ok(MxBankTransfer), + "us_bank_transfer" => Ok(UsBankTransfer), + _ => Err(()), + } + } +} +impl std::fmt::Display for UpdatePaymentIntentPaymentMethodOptionsCustomerBalanceBankTransferType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for UpdatePaymentIntentPaymentMethodOptionsCustomerBalanceBankTransferType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for UpdatePaymentIntentPaymentMethodOptionsCustomerBalanceBankTransferType { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// The funding method type to be used when there are not enough funds in the customer balance. +/// Permitted values include: `bank_transfer`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum UpdatePaymentIntentPaymentMethodOptionsCustomerBalanceFundingType { + BankTransfer, +} +impl UpdatePaymentIntentPaymentMethodOptionsCustomerBalanceFundingType { + pub fn as_str(self) -> &'static str { + use UpdatePaymentIntentPaymentMethodOptionsCustomerBalanceFundingType::*; + match self { + BankTransfer => "bank_transfer", + } + } +} + +impl std::str::FromStr for UpdatePaymentIntentPaymentMethodOptionsCustomerBalanceFundingType { + type Err = (); + fn from_str(s: &str) -> Result { + use UpdatePaymentIntentPaymentMethodOptionsCustomerBalanceFundingType::*; + match s { + "bank_transfer" => Ok(BankTransfer), + _ => Err(()), + } + } +} +impl std::fmt::Display for UpdatePaymentIntentPaymentMethodOptionsCustomerBalanceFundingType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for UpdatePaymentIntentPaymentMethodOptionsCustomerBalanceFundingType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for UpdatePaymentIntentPaymentMethodOptionsCustomerBalanceFundingType { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Indicates that you intend to make future payments with this PaymentIntent's payment method. +/// +/// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. +/// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. +/// +/// When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). +/// +/// If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum UpdatePaymentIntentPaymentMethodOptionsCustomerBalanceSetupFutureUsage { + None, +} +impl UpdatePaymentIntentPaymentMethodOptionsCustomerBalanceSetupFutureUsage { + pub fn as_str(self) -> &'static str { + use UpdatePaymentIntentPaymentMethodOptionsCustomerBalanceSetupFutureUsage::*; + match self { + None => "none", + } + } +} + +impl std::str::FromStr for UpdatePaymentIntentPaymentMethodOptionsCustomerBalanceSetupFutureUsage { + type Err = (); + fn from_str(s: &str) -> Result { + use UpdatePaymentIntentPaymentMethodOptionsCustomerBalanceSetupFutureUsage::*; + match s { + "none" => Ok(None), + _ => Err(()), + } + } +} +impl std::fmt::Display for UpdatePaymentIntentPaymentMethodOptionsCustomerBalanceSetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for UpdatePaymentIntentPaymentMethodOptionsCustomerBalanceSetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for UpdatePaymentIntentPaymentMethodOptionsCustomerBalanceSetupFutureUsage { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// If this is a `eps` PaymentMethod, this sub-hash contains details about the EPS payment method options. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdatePaymentIntentPaymentMethodOptionsEps { + /// Indicates that you intend to make future payments with this PaymentIntent's payment method. + /// + /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. + /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + /// + /// When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + /// + /// If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. + #[serde(skip_serializing_if = "Option::is_none")] + pub setup_future_usage: Option, +} +impl UpdatePaymentIntentPaymentMethodOptionsEps { + pub fn new() -> Self { + Self::default() + } +} +/// Indicates that you intend to make future payments with this PaymentIntent's payment method. +/// +/// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. +/// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. +/// +/// When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). +/// +/// If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum UpdatePaymentIntentPaymentMethodOptionsEpsSetupFutureUsage { + None, +} +impl UpdatePaymentIntentPaymentMethodOptionsEpsSetupFutureUsage { + pub fn as_str(self) -> &'static str { + use UpdatePaymentIntentPaymentMethodOptionsEpsSetupFutureUsage::*; + match self { + None => "none", + } + } +} + +impl std::str::FromStr for UpdatePaymentIntentPaymentMethodOptionsEpsSetupFutureUsage { + type Err = (); + fn from_str(s: &str) -> Result { + use UpdatePaymentIntentPaymentMethodOptionsEpsSetupFutureUsage::*; + match s { + "none" => Ok(None), + _ => Err(()), + } + } +} +impl std::fmt::Display for UpdatePaymentIntentPaymentMethodOptionsEpsSetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for UpdatePaymentIntentPaymentMethodOptionsEpsSetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for UpdatePaymentIntentPaymentMethodOptionsEpsSetupFutureUsage { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// If this is a `fpx` PaymentMethod, this sub-hash contains details about the FPX payment method options. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdatePaymentIntentPaymentMethodOptionsFpx { + /// Indicates that you intend to make future payments with this PaymentIntent's payment method. + /// + /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. + /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + /// + /// When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + /// + /// If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. + #[serde(skip_serializing_if = "Option::is_none")] + pub setup_future_usage: Option, +} +impl UpdatePaymentIntentPaymentMethodOptionsFpx { + pub fn new() -> Self { + Self::default() + } +} +/// Indicates that you intend to make future payments with this PaymentIntent's payment method. +/// +/// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. +/// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. +/// +/// When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). +/// +/// If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum UpdatePaymentIntentPaymentMethodOptionsFpxSetupFutureUsage { + None, +} +impl UpdatePaymentIntentPaymentMethodOptionsFpxSetupFutureUsage { + pub fn as_str(self) -> &'static str { + use UpdatePaymentIntentPaymentMethodOptionsFpxSetupFutureUsage::*; + match self { + None => "none", + } + } +} + +impl std::str::FromStr for UpdatePaymentIntentPaymentMethodOptionsFpxSetupFutureUsage { + type Err = (); + fn from_str(s: &str) -> Result { + use UpdatePaymentIntentPaymentMethodOptionsFpxSetupFutureUsage::*; + match s { + "none" => Ok(None), + _ => Err(()), + } + } +} +impl std::fmt::Display for UpdatePaymentIntentPaymentMethodOptionsFpxSetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for UpdatePaymentIntentPaymentMethodOptionsFpxSetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for UpdatePaymentIntentPaymentMethodOptionsFpxSetupFutureUsage { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// If this is a `giropay` PaymentMethod, this sub-hash contains details about the Giropay payment method options. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdatePaymentIntentPaymentMethodOptionsGiropay { + /// Indicates that you intend to make future payments with this PaymentIntent's payment method. + /// + /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. + /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + /// + /// When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + /// + /// If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. + #[serde(skip_serializing_if = "Option::is_none")] + pub setup_future_usage: Option, +} +impl UpdatePaymentIntentPaymentMethodOptionsGiropay { + pub fn new() -> Self { + Self::default() + } +} +/// Indicates that you intend to make future payments with this PaymentIntent's payment method. +/// +/// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. +/// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. +/// +/// When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). +/// +/// If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum UpdatePaymentIntentPaymentMethodOptionsGiropaySetupFutureUsage { + None, +} +impl UpdatePaymentIntentPaymentMethodOptionsGiropaySetupFutureUsage { + pub fn as_str(self) -> &'static str { + use UpdatePaymentIntentPaymentMethodOptionsGiropaySetupFutureUsage::*; + match self { + None => "none", + } + } +} + +impl std::str::FromStr for UpdatePaymentIntentPaymentMethodOptionsGiropaySetupFutureUsage { + type Err = (); + fn from_str(s: &str) -> Result { + use UpdatePaymentIntentPaymentMethodOptionsGiropaySetupFutureUsage::*; + match s { + "none" => Ok(None), + _ => Err(()), + } + } +} +impl std::fmt::Display for UpdatePaymentIntentPaymentMethodOptionsGiropaySetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for UpdatePaymentIntentPaymentMethodOptionsGiropaySetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for UpdatePaymentIntentPaymentMethodOptionsGiropaySetupFutureUsage { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// If this is a `grabpay` PaymentMethod, this sub-hash contains details about the Grabpay payment method options. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdatePaymentIntentPaymentMethodOptionsGrabpay { + /// Indicates that you intend to make future payments with this PaymentIntent's payment method. + /// + /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. + /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + /// + /// When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + /// + /// If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. + #[serde(skip_serializing_if = "Option::is_none")] + pub setup_future_usage: Option, +} +impl UpdatePaymentIntentPaymentMethodOptionsGrabpay { + pub fn new() -> Self { + Self::default() + } +} +/// Indicates that you intend to make future payments with this PaymentIntent's payment method. +/// +/// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. +/// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. +/// +/// When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). +/// +/// If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum UpdatePaymentIntentPaymentMethodOptionsGrabpaySetupFutureUsage { + None, +} +impl UpdatePaymentIntentPaymentMethodOptionsGrabpaySetupFutureUsage { + pub fn as_str(self) -> &'static str { + use UpdatePaymentIntentPaymentMethodOptionsGrabpaySetupFutureUsage::*; + match self { + None => "none", + } + } +} + +impl std::str::FromStr for UpdatePaymentIntentPaymentMethodOptionsGrabpaySetupFutureUsage { + type Err = (); + fn from_str(s: &str) -> Result { + use UpdatePaymentIntentPaymentMethodOptionsGrabpaySetupFutureUsage::*; + match s { + "none" => Ok(None), + _ => Err(()), + } + } +} +impl std::fmt::Display for UpdatePaymentIntentPaymentMethodOptionsGrabpaySetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for UpdatePaymentIntentPaymentMethodOptionsGrabpaySetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for UpdatePaymentIntentPaymentMethodOptionsGrabpaySetupFutureUsage { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// If this is a `ideal` PaymentMethod, this sub-hash contains details about the Ideal payment method options. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdatePaymentIntentPaymentMethodOptionsIdeal { + /// Indicates that you intend to make future payments with this PaymentIntent's payment method. + /// + /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. + /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + /// + /// When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + /// + /// If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. + #[serde(skip_serializing_if = "Option::is_none")] + pub setup_future_usage: Option, +} +impl UpdatePaymentIntentPaymentMethodOptionsIdeal { + pub fn new() -> Self { + Self::default() + } +} +/// Indicates that you intend to make future payments with this PaymentIntent's payment method. +/// +/// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. +/// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. +/// +/// When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). +/// +/// If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum UpdatePaymentIntentPaymentMethodOptionsIdealSetupFutureUsage { + None, + OffSession, +} +impl UpdatePaymentIntentPaymentMethodOptionsIdealSetupFutureUsage { + pub fn as_str(self) -> &'static str { + use UpdatePaymentIntentPaymentMethodOptionsIdealSetupFutureUsage::*; + match self { + None => "none", + OffSession => "off_session", + } + } +} + +impl std::str::FromStr for UpdatePaymentIntentPaymentMethodOptionsIdealSetupFutureUsage { + type Err = (); + fn from_str(s: &str) -> Result { + use UpdatePaymentIntentPaymentMethodOptionsIdealSetupFutureUsage::*; + match s { + "none" => Ok(None), + "off_session" => Ok(OffSession), + _ => Err(()), + } + } +} +impl std::fmt::Display for UpdatePaymentIntentPaymentMethodOptionsIdealSetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for UpdatePaymentIntentPaymentMethodOptionsIdealSetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for UpdatePaymentIntentPaymentMethodOptionsIdealSetupFutureUsage { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// If this is a `klarna` PaymentMethod, this sub-hash contains details about the Klarna payment method options. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdatePaymentIntentPaymentMethodOptionsKlarna { + /// Controls when the funds will be captured from the customer's account. + /// + /// If provided, this parameter will override the top-level `capture_method` when finalizing the payment with this payment method type. + /// + /// If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter will unset the stored value for this payment method type. + #[serde(skip_serializing_if = "Option::is_none")] + pub capture_method: Option, + /// Preferred language of the Klarna authorization page that the customer is redirected to + #[serde(skip_serializing_if = "Option::is_none")] + pub preferred_locale: Option, + /// Indicates that you intend to make future payments with this PaymentIntent's payment method. + /// + /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. + /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + /// + /// When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + /// + /// If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. + #[serde(skip_serializing_if = "Option::is_none")] + pub setup_future_usage: Option, +} +impl UpdatePaymentIntentPaymentMethodOptionsKlarna { + pub fn new() -> Self { + Self::default() + } +} +/// Controls when the funds will be captured from the customer's account. +/// +/// If provided, this parameter will override the top-level `capture_method` when finalizing the payment with this payment method type. +/// +/// If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter will unset the stored value for this payment method type. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum UpdatePaymentIntentPaymentMethodOptionsKlarnaCaptureMethod { + Manual, +} +impl UpdatePaymentIntentPaymentMethodOptionsKlarnaCaptureMethod { + pub fn as_str(self) -> &'static str { + use UpdatePaymentIntentPaymentMethodOptionsKlarnaCaptureMethod::*; + match self { + Manual => "manual", + } + } +} + +impl std::str::FromStr for UpdatePaymentIntentPaymentMethodOptionsKlarnaCaptureMethod { + type Err = (); + fn from_str(s: &str) -> Result { + use UpdatePaymentIntentPaymentMethodOptionsKlarnaCaptureMethod::*; + match s { + "manual" => Ok(Manual), + _ => Err(()), + } + } +} +impl std::fmt::Display for UpdatePaymentIntentPaymentMethodOptionsKlarnaCaptureMethod { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for UpdatePaymentIntentPaymentMethodOptionsKlarnaCaptureMethod { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for UpdatePaymentIntentPaymentMethodOptionsKlarnaCaptureMethod { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Preferred language of the Klarna authorization page that the customer is redirected to +#[derive(Copy, Clone, Eq, PartialEq)] +#[non_exhaustive] +pub enum UpdatePaymentIntentPaymentMethodOptionsKlarnaPreferredLocale { + CsMinusCz, + DaMinusDk, + DeMinusAt, + DeMinusCh, + DeMinusDe, + ElMinusGr, + EnMinusAt, + EnMinusAu, + EnMinusBe, + EnMinusCa, + EnMinusCh, + EnMinusCz, + EnMinusDe, + EnMinusDk, + EnMinusEs, + EnMinusFi, + EnMinusFr, + EnMinusGb, + EnMinusGr, + EnMinusIe, + EnMinusIt, + EnMinusNl, + EnMinusNo, + EnMinusNz, + EnMinusPl, + EnMinusPt, + EnMinusSe, + EnMinusUs, + EsMinusEs, + EsMinusUs, + FiMinusFi, + FrMinusBe, + FrMinusCa, + FrMinusCh, + FrMinusFr, + ItMinusCh, + ItMinusIt, + NbMinusNo, + NlMinusBe, + NlMinusNl, + PlMinusPl, + PtMinusPt, + SvMinusFi, + SvMinusSe, + /// An unrecognized value from Stripe. Should not be used as a request parameter. + Unknown, +} +impl UpdatePaymentIntentPaymentMethodOptionsKlarnaPreferredLocale { + pub fn as_str(self) -> &'static str { + use UpdatePaymentIntentPaymentMethodOptionsKlarnaPreferredLocale::*; + match self { + CsMinusCz => "cs-CZ", + DaMinusDk => "da-DK", + DeMinusAt => "de-AT", + DeMinusCh => "de-CH", + DeMinusDe => "de-DE", + ElMinusGr => "el-GR", + EnMinusAt => "en-AT", + EnMinusAu => "en-AU", + EnMinusBe => "en-BE", + EnMinusCa => "en-CA", + EnMinusCh => "en-CH", + EnMinusCz => "en-CZ", + EnMinusDe => "en-DE", + EnMinusDk => "en-DK", + EnMinusEs => "en-ES", + EnMinusFi => "en-FI", + EnMinusFr => "en-FR", + EnMinusGb => "en-GB", + EnMinusGr => "en-GR", + EnMinusIe => "en-IE", + EnMinusIt => "en-IT", + EnMinusNl => "en-NL", + EnMinusNo => "en-NO", + EnMinusNz => "en-NZ", + EnMinusPl => "en-PL", + EnMinusPt => "en-PT", + EnMinusSe => "en-SE", + EnMinusUs => "en-US", + EsMinusEs => "es-ES", + EsMinusUs => "es-US", + FiMinusFi => "fi-FI", + FrMinusBe => "fr-BE", + FrMinusCa => "fr-CA", + FrMinusCh => "fr-CH", + FrMinusFr => "fr-FR", + ItMinusCh => "it-CH", + ItMinusIt => "it-IT", + NbMinusNo => "nb-NO", + NlMinusBe => "nl-BE", + NlMinusNl => "nl-NL", + PlMinusPl => "pl-PL", + PtMinusPt => "pt-PT", + SvMinusFi => "sv-FI", + SvMinusSe => "sv-SE", + Unknown => "unknown", + } + } +} + +impl std::str::FromStr for UpdatePaymentIntentPaymentMethodOptionsKlarnaPreferredLocale { + type Err = (); + fn from_str(s: &str) -> Result { + use UpdatePaymentIntentPaymentMethodOptionsKlarnaPreferredLocale::*; + match s { + "cs-CZ" => Ok(CsMinusCz), + "da-DK" => Ok(DaMinusDk), + "de-AT" => Ok(DeMinusAt), + "de-CH" => Ok(DeMinusCh), + "de-DE" => Ok(DeMinusDe), + "el-GR" => Ok(ElMinusGr), + "en-AT" => Ok(EnMinusAt), + "en-AU" => Ok(EnMinusAu), + "en-BE" => Ok(EnMinusBe), + "en-CA" => Ok(EnMinusCa), + "en-CH" => Ok(EnMinusCh), + "en-CZ" => Ok(EnMinusCz), + "en-DE" => Ok(EnMinusDe), + "en-DK" => Ok(EnMinusDk), + "en-ES" => Ok(EnMinusEs), + "en-FI" => Ok(EnMinusFi), + "en-FR" => Ok(EnMinusFr), + "en-GB" => Ok(EnMinusGb), + "en-GR" => Ok(EnMinusGr), + "en-IE" => Ok(EnMinusIe), + "en-IT" => Ok(EnMinusIt), + "en-NL" => Ok(EnMinusNl), + "en-NO" => Ok(EnMinusNo), + "en-NZ" => Ok(EnMinusNz), + "en-PL" => Ok(EnMinusPl), + "en-PT" => Ok(EnMinusPt), + "en-SE" => Ok(EnMinusSe), + "en-US" => Ok(EnMinusUs), + "es-ES" => Ok(EsMinusEs), + "es-US" => Ok(EsMinusUs), + "fi-FI" => Ok(FiMinusFi), + "fr-BE" => Ok(FrMinusBe), + "fr-CA" => Ok(FrMinusCa), + "fr-CH" => Ok(FrMinusCh), + "fr-FR" => Ok(FrMinusFr), + "it-CH" => Ok(ItMinusCh), + "it-IT" => Ok(ItMinusIt), + "nb-NO" => Ok(NbMinusNo), + "nl-BE" => Ok(NlMinusBe), + "nl-NL" => Ok(NlMinusNl), + "pl-PL" => Ok(PlMinusPl), + "pt-PT" => Ok(PtMinusPt), + "sv-FI" => Ok(SvMinusFi), + "sv-SE" => Ok(SvMinusSe), + _ => Err(()), + } + } +} +impl std::fmt::Display for UpdatePaymentIntentPaymentMethodOptionsKlarnaPreferredLocale { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for UpdatePaymentIntentPaymentMethodOptionsKlarnaPreferredLocale { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for UpdatePaymentIntentPaymentMethodOptionsKlarnaPreferredLocale { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Indicates that you intend to make future payments with this PaymentIntent's payment method. +/// +/// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. +/// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. +/// +/// When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). +/// +/// If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum UpdatePaymentIntentPaymentMethodOptionsKlarnaSetupFutureUsage { + None, +} +impl UpdatePaymentIntentPaymentMethodOptionsKlarnaSetupFutureUsage { + pub fn as_str(self) -> &'static str { + use UpdatePaymentIntentPaymentMethodOptionsKlarnaSetupFutureUsage::*; + match self { + None => "none", + } + } +} + +impl std::str::FromStr for UpdatePaymentIntentPaymentMethodOptionsKlarnaSetupFutureUsage { + type Err = (); + fn from_str(s: &str) -> Result { + use UpdatePaymentIntentPaymentMethodOptionsKlarnaSetupFutureUsage::*; + match s { + "none" => Ok(None), + _ => Err(()), + } + } +} +impl std::fmt::Display for UpdatePaymentIntentPaymentMethodOptionsKlarnaSetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for UpdatePaymentIntentPaymentMethodOptionsKlarnaSetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for UpdatePaymentIntentPaymentMethodOptionsKlarnaSetupFutureUsage { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// If this is a `konbini` PaymentMethod, this sub-hash contains details about the Konbini payment method options. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdatePaymentIntentPaymentMethodOptionsKonbini<'a> { + /// An optional 10 to 11 digit numeric-only string determining the confirmation code at applicable convenience stores. + /// Must not consist of only zeroes and could be rejected in case of insufficient uniqueness. + /// We recommend to use the customer's phone number. + #[serde(skip_serializing_if = "Option::is_none")] + pub confirmation_number: Option<&'a str>, + /// The number of calendar days (between 1 and 60) after which Konbini payment instructions will expire. + /// For example, if a PaymentIntent is confirmed with Konbini and `expires_after_days` set to 2 on Monday JST, the instructions will expire on Wednesday 23:59:59 JST. + /// Defaults to 3 days. + #[serde(skip_serializing_if = "Option::is_none")] + pub expires_after_days: Option, + /// The timestamp at which the Konbini payment instructions will expire. + /// Only one of `expires_after_days` or `expires_at` may be set. + #[serde(skip_serializing_if = "Option::is_none")] + pub expires_at: Option, + /// A product descriptor of up to 22 characters, which will appear to customers at the convenience store. + #[serde(skip_serializing_if = "Option::is_none")] + pub product_description: Option<&'a str>, + /// Indicates that you intend to make future payments with this PaymentIntent's payment method. + /// + /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. + /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + /// + /// When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + /// + /// If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. + #[serde(skip_serializing_if = "Option::is_none")] + pub setup_future_usage: Option, +} +impl<'a> UpdatePaymentIntentPaymentMethodOptionsKonbini<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// Indicates that you intend to make future payments with this PaymentIntent's payment method. +/// +/// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. +/// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. +/// +/// When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). +/// +/// If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum UpdatePaymentIntentPaymentMethodOptionsKonbiniSetupFutureUsage { + None, +} +impl UpdatePaymentIntentPaymentMethodOptionsKonbiniSetupFutureUsage { + pub fn as_str(self) -> &'static str { + use UpdatePaymentIntentPaymentMethodOptionsKonbiniSetupFutureUsage::*; + match self { + None => "none", + } + } +} + +impl std::str::FromStr for UpdatePaymentIntentPaymentMethodOptionsKonbiniSetupFutureUsage { + type Err = (); + fn from_str(s: &str) -> Result { + use UpdatePaymentIntentPaymentMethodOptionsKonbiniSetupFutureUsage::*; + match s { + "none" => Ok(None), + _ => Err(()), + } + } +} +impl std::fmt::Display for UpdatePaymentIntentPaymentMethodOptionsKonbiniSetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for UpdatePaymentIntentPaymentMethodOptionsKonbiniSetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for UpdatePaymentIntentPaymentMethodOptionsKonbiniSetupFutureUsage { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// If this is a `link` PaymentMethod, this sub-hash contains details about the Link payment method options. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdatePaymentIntentPaymentMethodOptionsLink<'a> { + /// Controls when the funds will be captured from the customer's account. + /// + /// If provided, this parameter will override the top-level `capture_method` when finalizing the payment with this payment method type. + /// + /// If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter will unset the stored value for this payment method type. + #[serde(skip_serializing_if = "Option::is_none")] + pub capture_method: Option, + /// \[Deprecated\] This is a legacy parameter that no longer has any function. + #[serde(skip_serializing_if = "Option::is_none")] + pub persistent_token: Option<&'a str>, + /// Indicates that you intend to make future payments with this PaymentIntent's payment method. + /// + /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. + /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + /// + /// When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + /// + /// If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. + #[serde(skip_serializing_if = "Option::is_none")] + pub setup_future_usage: Option, +} +impl<'a> UpdatePaymentIntentPaymentMethodOptionsLink<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// Controls when the funds will be captured from the customer's account. +/// +/// If provided, this parameter will override the top-level `capture_method` when finalizing the payment with this payment method type. +/// +/// If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter will unset the stored value for this payment method type. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum UpdatePaymentIntentPaymentMethodOptionsLinkCaptureMethod { + Manual, +} +impl UpdatePaymentIntentPaymentMethodOptionsLinkCaptureMethod { + pub fn as_str(self) -> &'static str { + use UpdatePaymentIntentPaymentMethodOptionsLinkCaptureMethod::*; + match self { + Manual => "manual", + } + } +} + +impl std::str::FromStr for UpdatePaymentIntentPaymentMethodOptionsLinkCaptureMethod { + type Err = (); + fn from_str(s: &str) -> Result { + use UpdatePaymentIntentPaymentMethodOptionsLinkCaptureMethod::*; + match s { + "manual" => Ok(Manual), + _ => Err(()), + } + } +} +impl std::fmt::Display for UpdatePaymentIntentPaymentMethodOptionsLinkCaptureMethod { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for UpdatePaymentIntentPaymentMethodOptionsLinkCaptureMethod { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for UpdatePaymentIntentPaymentMethodOptionsLinkCaptureMethod { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Indicates that you intend to make future payments with this PaymentIntent's payment method. +/// +/// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. +/// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. +/// +/// When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). +/// +/// If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum UpdatePaymentIntentPaymentMethodOptionsLinkSetupFutureUsage { + None, + OffSession, +} +impl UpdatePaymentIntentPaymentMethodOptionsLinkSetupFutureUsage { + pub fn as_str(self) -> &'static str { + use UpdatePaymentIntentPaymentMethodOptionsLinkSetupFutureUsage::*; + match self { + None => "none", + OffSession => "off_session", + } + } +} + +impl std::str::FromStr for UpdatePaymentIntentPaymentMethodOptionsLinkSetupFutureUsage { + type Err = (); + fn from_str(s: &str) -> Result { + use UpdatePaymentIntentPaymentMethodOptionsLinkSetupFutureUsage::*; + match s { + "none" => Ok(None), + "off_session" => Ok(OffSession), + _ => Err(()), + } + } +} +impl std::fmt::Display for UpdatePaymentIntentPaymentMethodOptionsLinkSetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for UpdatePaymentIntentPaymentMethodOptionsLinkSetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for UpdatePaymentIntentPaymentMethodOptionsLinkSetupFutureUsage { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// If this is a `oxxo` PaymentMethod, this sub-hash contains details about the OXXO payment method options. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdatePaymentIntentPaymentMethodOptionsOxxo { + /// The number of calendar days before an OXXO voucher expires. + /// For example, if you create an OXXO voucher on Monday and you set expires_after_days to 2, the OXXO invoice will expire on Wednesday at 23:59 America/Mexico_City time. + #[serde(skip_serializing_if = "Option::is_none")] + pub expires_after_days: Option, + /// Indicates that you intend to make future payments with this PaymentIntent's payment method. + /// + /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. + /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + /// + /// When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + /// + /// If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. + #[serde(skip_serializing_if = "Option::is_none")] + pub setup_future_usage: Option, +} +impl UpdatePaymentIntentPaymentMethodOptionsOxxo { + pub fn new() -> Self { + Self::default() + } +} +/// Indicates that you intend to make future payments with this PaymentIntent's payment method. +/// +/// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. +/// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. +/// +/// When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). +/// +/// If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum UpdatePaymentIntentPaymentMethodOptionsOxxoSetupFutureUsage { + None, +} +impl UpdatePaymentIntentPaymentMethodOptionsOxxoSetupFutureUsage { + pub fn as_str(self) -> &'static str { + use UpdatePaymentIntentPaymentMethodOptionsOxxoSetupFutureUsage::*; + match self { + None => "none", + } + } +} + +impl std::str::FromStr for UpdatePaymentIntentPaymentMethodOptionsOxxoSetupFutureUsage { + type Err = (); + fn from_str(s: &str) -> Result { + use UpdatePaymentIntentPaymentMethodOptionsOxxoSetupFutureUsage::*; + match s { + "none" => Ok(None), + _ => Err(()), + } + } +} +impl std::fmt::Display for UpdatePaymentIntentPaymentMethodOptionsOxxoSetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for UpdatePaymentIntentPaymentMethodOptionsOxxoSetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for UpdatePaymentIntentPaymentMethodOptionsOxxoSetupFutureUsage { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// If this is a `p24` PaymentMethod, this sub-hash contains details about the Przelewy24 payment method options. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdatePaymentIntentPaymentMethodOptionsP24 { + /// Indicates that you intend to make future payments with this PaymentIntent's payment method. + /// + /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. + /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + /// + /// When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + /// + /// If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. + #[serde(skip_serializing_if = "Option::is_none")] + pub setup_future_usage: Option, + /// Confirm that the payer has accepted the P24 terms and conditions. + #[serde(skip_serializing_if = "Option::is_none")] + pub tos_shown_and_accepted: Option, +} +impl UpdatePaymentIntentPaymentMethodOptionsP24 { + pub fn new() -> Self { + Self::default() + } +} +/// Indicates that you intend to make future payments with this PaymentIntent's payment method. +/// +/// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. +/// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. +/// +/// When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). +/// +/// If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum UpdatePaymentIntentPaymentMethodOptionsP24SetupFutureUsage { + None, +} +impl UpdatePaymentIntentPaymentMethodOptionsP24SetupFutureUsage { + pub fn as_str(self) -> &'static str { + use UpdatePaymentIntentPaymentMethodOptionsP24SetupFutureUsage::*; + match self { + None => "none", + } + } +} + +impl std::str::FromStr for UpdatePaymentIntentPaymentMethodOptionsP24SetupFutureUsage { + type Err = (); + fn from_str(s: &str) -> Result { + use UpdatePaymentIntentPaymentMethodOptionsP24SetupFutureUsage::*; + match s { + "none" => Ok(None), + _ => Err(()), + } + } +} +impl std::fmt::Display for UpdatePaymentIntentPaymentMethodOptionsP24SetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for UpdatePaymentIntentPaymentMethodOptionsP24SetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for UpdatePaymentIntentPaymentMethodOptionsP24SetupFutureUsage { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// If this is a `paynow` PaymentMethod, this sub-hash contains details about the PayNow payment method options. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdatePaymentIntentPaymentMethodOptionsPaynow { + /// Indicates that you intend to make future payments with this PaymentIntent's payment method. + /// + /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. + /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + /// + /// When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + /// + /// If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. + #[serde(skip_serializing_if = "Option::is_none")] + pub setup_future_usage: Option, +} +impl UpdatePaymentIntentPaymentMethodOptionsPaynow { + pub fn new() -> Self { + Self::default() + } +} +/// Indicates that you intend to make future payments with this PaymentIntent's payment method. +/// +/// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. +/// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. +/// +/// When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). +/// +/// If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum UpdatePaymentIntentPaymentMethodOptionsPaynowSetupFutureUsage { + None, +} +impl UpdatePaymentIntentPaymentMethodOptionsPaynowSetupFutureUsage { + pub fn as_str(self) -> &'static str { + use UpdatePaymentIntentPaymentMethodOptionsPaynowSetupFutureUsage::*; + match self { + None => "none", + } + } +} + +impl std::str::FromStr for UpdatePaymentIntentPaymentMethodOptionsPaynowSetupFutureUsage { + type Err = (); + fn from_str(s: &str) -> Result { + use UpdatePaymentIntentPaymentMethodOptionsPaynowSetupFutureUsage::*; + match s { + "none" => Ok(None), + _ => Err(()), + } + } +} +impl std::fmt::Display for UpdatePaymentIntentPaymentMethodOptionsPaynowSetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for UpdatePaymentIntentPaymentMethodOptionsPaynowSetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for UpdatePaymentIntentPaymentMethodOptionsPaynowSetupFutureUsage { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// If this is a `paypal` PaymentMethod, this sub-hash contains details about the PayPal payment method options. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdatePaymentIntentPaymentMethodOptionsPaypal<'a> { + /// Controls when the funds will be captured from the customer's account. + #[serde(skip_serializing_if = "Option::is_none")] + pub capture_method: Option, + /// [Preferred locale](https://stripe.com/docs/payments/paypal/supported-locales) of the PayPal checkout page that the customer is redirected to. + #[serde(skip_serializing_if = "Option::is_none")] + pub preferred_locale: Option, + /// A reference of the PayPal transaction visible to customer which is mapped to PayPal's invoice ID. + /// This must be a globally unique ID if you have configured in your PayPal settings to block multiple payments per invoice ID. + #[serde(skip_serializing_if = "Option::is_none")] + pub reference: Option<&'a str>, + /// The risk correlation ID for an on-session payment using a saved PayPal payment method. + #[serde(skip_serializing_if = "Option::is_none")] + pub risk_correlation_id: Option<&'a str>, + /// Indicates that you intend to make future payments with this PaymentIntent's payment method. + /// + /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. + /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + /// + /// When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + /// + /// If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. + #[serde(skip_serializing_if = "Option::is_none")] + pub setup_future_usage: Option, +} +impl<'a> UpdatePaymentIntentPaymentMethodOptionsPaypal<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// Controls when the funds will be captured from the customer's account. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum UpdatePaymentIntentPaymentMethodOptionsPaypalCaptureMethod { + Manual, +} +impl UpdatePaymentIntentPaymentMethodOptionsPaypalCaptureMethod { + pub fn as_str(self) -> &'static str { + use UpdatePaymentIntentPaymentMethodOptionsPaypalCaptureMethod::*; + match self { + Manual => "manual", + } + } +} + +impl std::str::FromStr for UpdatePaymentIntentPaymentMethodOptionsPaypalCaptureMethod { + type Err = (); + fn from_str(s: &str) -> Result { + use UpdatePaymentIntentPaymentMethodOptionsPaypalCaptureMethod::*; + match s { + "manual" => Ok(Manual), + _ => Err(()), + } + } +} +impl std::fmt::Display for UpdatePaymentIntentPaymentMethodOptionsPaypalCaptureMethod { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for UpdatePaymentIntentPaymentMethodOptionsPaypalCaptureMethod { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for UpdatePaymentIntentPaymentMethodOptionsPaypalCaptureMethod { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// [Preferred locale](https://stripe.com/docs/payments/paypal/supported-locales) of the PayPal checkout page that the customer is redirected to. +#[derive(Copy, Clone, Eq, PartialEq)] +#[non_exhaustive] +pub enum UpdatePaymentIntentPaymentMethodOptionsPaypalPreferredLocale { + CsMinusCz, + DaMinusDk, + DeMinusAt, + DeMinusDe, + DeMinusLu, + ElMinusGr, + EnMinusGb, + EnMinusUs, + EsMinusEs, + FiMinusFi, + FrMinusBe, + FrMinusFr, + FrMinusLu, + HuMinusHu, + ItMinusIt, + NlMinusBe, + NlMinusNl, + PlMinusPl, + PtMinusPt, + SkMinusSk, + SvMinusSe, + /// An unrecognized value from Stripe. Should not be used as a request parameter. + Unknown, +} +impl UpdatePaymentIntentPaymentMethodOptionsPaypalPreferredLocale { + pub fn as_str(self) -> &'static str { + use UpdatePaymentIntentPaymentMethodOptionsPaypalPreferredLocale::*; + match self { + CsMinusCz => "cs-CZ", + DaMinusDk => "da-DK", + DeMinusAt => "de-AT", + DeMinusDe => "de-DE", + DeMinusLu => "de-LU", + ElMinusGr => "el-GR", + EnMinusGb => "en-GB", + EnMinusUs => "en-US", + EsMinusEs => "es-ES", + FiMinusFi => "fi-FI", + FrMinusBe => "fr-BE", + FrMinusFr => "fr-FR", + FrMinusLu => "fr-LU", + HuMinusHu => "hu-HU", + ItMinusIt => "it-IT", + NlMinusBe => "nl-BE", + NlMinusNl => "nl-NL", + PlMinusPl => "pl-PL", + PtMinusPt => "pt-PT", + SkMinusSk => "sk-SK", + SvMinusSe => "sv-SE", + Unknown => "unknown", + } + } +} + +impl std::str::FromStr for UpdatePaymentIntentPaymentMethodOptionsPaypalPreferredLocale { + type Err = (); + fn from_str(s: &str) -> Result { + use UpdatePaymentIntentPaymentMethodOptionsPaypalPreferredLocale::*; + match s { + "cs-CZ" => Ok(CsMinusCz), + "da-DK" => Ok(DaMinusDk), + "de-AT" => Ok(DeMinusAt), + "de-DE" => Ok(DeMinusDe), + "de-LU" => Ok(DeMinusLu), + "el-GR" => Ok(ElMinusGr), + "en-GB" => Ok(EnMinusGb), + "en-US" => Ok(EnMinusUs), + "es-ES" => Ok(EsMinusEs), + "fi-FI" => Ok(FiMinusFi), + "fr-BE" => Ok(FrMinusBe), + "fr-FR" => Ok(FrMinusFr), + "fr-LU" => Ok(FrMinusLu), + "hu-HU" => Ok(HuMinusHu), + "it-IT" => Ok(ItMinusIt), + "nl-BE" => Ok(NlMinusBe), + "nl-NL" => Ok(NlMinusNl), + "pl-PL" => Ok(PlMinusPl), + "pt-PT" => Ok(PtMinusPt), + "sk-SK" => Ok(SkMinusSk), + "sv-SE" => Ok(SvMinusSe), + _ => Err(()), + } + } +} +impl std::fmt::Display for UpdatePaymentIntentPaymentMethodOptionsPaypalPreferredLocale { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for UpdatePaymentIntentPaymentMethodOptionsPaypalPreferredLocale { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for UpdatePaymentIntentPaymentMethodOptionsPaypalPreferredLocale { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Indicates that you intend to make future payments with this PaymentIntent's payment method. +/// +/// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. +/// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. +/// +/// When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). +/// +/// If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum UpdatePaymentIntentPaymentMethodOptionsPaypalSetupFutureUsage { + None, + OffSession, +} +impl UpdatePaymentIntentPaymentMethodOptionsPaypalSetupFutureUsage { + pub fn as_str(self) -> &'static str { + use UpdatePaymentIntentPaymentMethodOptionsPaypalSetupFutureUsage::*; + match self { + None => "none", + OffSession => "off_session", + } + } +} + +impl std::str::FromStr for UpdatePaymentIntentPaymentMethodOptionsPaypalSetupFutureUsage { + type Err = (); + fn from_str(s: &str) -> Result { + use UpdatePaymentIntentPaymentMethodOptionsPaypalSetupFutureUsage::*; + match s { + "none" => Ok(None), + "off_session" => Ok(OffSession), + _ => Err(()), + } + } +} +impl std::fmt::Display for UpdatePaymentIntentPaymentMethodOptionsPaypalSetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for UpdatePaymentIntentPaymentMethodOptionsPaypalSetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for UpdatePaymentIntentPaymentMethodOptionsPaypalSetupFutureUsage { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// If this is a `pix` PaymentMethod, this sub-hash contains details about the Pix payment method options. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdatePaymentIntentPaymentMethodOptionsPix { + /// The number of seconds (between 10 and 1209600) after which Pix payment will expire. + /// Defaults to 86400 seconds. + #[serde(skip_serializing_if = "Option::is_none")] + pub expires_after_seconds: Option, + /// The timestamp at which the Pix expires (between 10 and 1209600 seconds in the future). + /// Defaults to 1 day in the future. + #[serde(skip_serializing_if = "Option::is_none")] + pub expires_at: Option, + /// Indicates that you intend to make future payments with this PaymentIntent's payment method. + /// + /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. + /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + /// + /// When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + /// + /// If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. + #[serde(skip_serializing_if = "Option::is_none")] + pub setup_future_usage: Option, +} +impl UpdatePaymentIntentPaymentMethodOptionsPix { + pub fn new() -> Self { + Self::default() + } +} +/// Indicates that you intend to make future payments with this PaymentIntent's payment method. +/// +/// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. +/// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. +/// +/// When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). +/// +/// If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum UpdatePaymentIntentPaymentMethodOptionsPixSetupFutureUsage { + None, +} +impl UpdatePaymentIntentPaymentMethodOptionsPixSetupFutureUsage { + pub fn as_str(self) -> &'static str { + use UpdatePaymentIntentPaymentMethodOptionsPixSetupFutureUsage::*; + match self { + None => "none", + } + } +} + +impl std::str::FromStr for UpdatePaymentIntentPaymentMethodOptionsPixSetupFutureUsage { + type Err = (); + fn from_str(s: &str) -> Result { + use UpdatePaymentIntentPaymentMethodOptionsPixSetupFutureUsage::*; + match s { + "none" => Ok(None), + _ => Err(()), + } + } +} +impl std::fmt::Display for UpdatePaymentIntentPaymentMethodOptionsPixSetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for UpdatePaymentIntentPaymentMethodOptionsPixSetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for UpdatePaymentIntentPaymentMethodOptionsPixSetupFutureUsage { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// If this is a `promptpay` PaymentMethod, this sub-hash contains details about the PromptPay payment method options. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdatePaymentIntentPaymentMethodOptionsPromptpay { + /// Indicates that you intend to make future payments with this PaymentIntent's payment method. + /// + /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. + /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + /// + /// When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + /// + /// If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. + #[serde(skip_serializing_if = "Option::is_none")] + pub setup_future_usage: + Option, +} +impl UpdatePaymentIntentPaymentMethodOptionsPromptpay { + pub fn new() -> Self { + Self::default() + } +} +/// Indicates that you intend to make future payments with this PaymentIntent's payment method. +/// +/// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. +/// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. +/// +/// When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). +/// +/// If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum UpdatePaymentIntentPaymentMethodOptionsPromptpaySetupFutureUsage { + None, +} +impl UpdatePaymentIntentPaymentMethodOptionsPromptpaySetupFutureUsage { + pub fn as_str(self) -> &'static str { + use UpdatePaymentIntentPaymentMethodOptionsPromptpaySetupFutureUsage::*; + match self { + None => "none", + } + } +} + +impl std::str::FromStr for UpdatePaymentIntentPaymentMethodOptionsPromptpaySetupFutureUsage { + type Err = (); + fn from_str(s: &str) -> Result { + use UpdatePaymentIntentPaymentMethodOptionsPromptpaySetupFutureUsage::*; + match s { + "none" => Ok(None), + _ => Err(()), + } + } +} +impl std::fmt::Display for UpdatePaymentIntentPaymentMethodOptionsPromptpaySetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for UpdatePaymentIntentPaymentMethodOptionsPromptpaySetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for UpdatePaymentIntentPaymentMethodOptionsPromptpaySetupFutureUsage { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// If this is a `revolut_pay` PaymentMethod, this sub-hash contains details about the Revolut Pay payment method options. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdatePaymentIntentPaymentMethodOptionsRevolutPay { + /// Indicates that you intend to make future payments with this PaymentIntent's payment method. + /// + /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. + /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + /// + /// When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + #[serde(skip_serializing_if = "Option::is_none")] + pub setup_future_usage: + Option, +} +impl UpdatePaymentIntentPaymentMethodOptionsRevolutPay { + pub fn new() -> Self { + Self::default() + } +} +/// Indicates that you intend to make future payments with this PaymentIntent's payment method. +/// +/// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. +/// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. +/// +/// When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum UpdatePaymentIntentPaymentMethodOptionsRevolutPaySetupFutureUsage { + None, + OffSession, +} +impl UpdatePaymentIntentPaymentMethodOptionsRevolutPaySetupFutureUsage { + pub fn as_str(self) -> &'static str { + use UpdatePaymentIntentPaymentMethodOptionsRevolutPaySetupFutureUsage::*; + match self { + None => "none", + OffSession => "off_session", + } + } +} + +impl std::str::FromStr for UpdatePaymentIntentPaymentMethodOptionsRevolutPaySetupFutureUsage { + type Err = (); + fn from_str(s: &str) -> Result { + use UpdatePaymentIntentPaymentMethodOptionsRevolutPaySetupFutureUsage::*; + match s { + "none" => Ok(None), + "off_session" => Ok(OffSession), + _ => Err(()), + } + } +} +impl std::fmt::Display for UpdatePaymentIntentPaymentMethodOptionsRevolutPaySetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for UpdatePaymentIntentPaymentMethodOptionsRevolutPaySetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for UpdatePaymentIntentPaymentMethodOptionsRevolutPaySetupFutureUsage { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// If this is a `sepa_debit` PaymentIntent, this sub-hash contains details about the SEPA Debit payment method options. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdatePaymentIntentPaymentMethodOptionsSepaDebit<'a> { + /// Additional fields for Mandate creation + #[serde(skip_serializing_if = "Option::is_none")] + pub mandate_options: Option<&'a serde_json::Value>, + /// Indicates that you intend to make future payments with this PaymentIntent's payment method. + /// + /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. + /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + /// + /// When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + /// + /// If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. + #[serde(skip_serializing_if = "Option::is_none")] + pub setup_future_usage: + Option, +} +impl<'a> UpdatePaymentIntentPaymentMethodOptionsSepaDebit<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// Indicates that you intend to make future payments with this PaymentIntent's payment method. +/// +/// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. +/// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. +/// +/// When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). +/// +/// If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum UpdatePaymentIntentPaymentMethodOptionsSepaDebitSetupFutureUsage { + None, + OffSession, + OnSession, +} +impl UpdatePaymentIntentPaymentMethodOptionsSepaDebitSetupFutureUsage { + pub fn as_str(self) -> &'static str { + use UpdatePaymentIntentPaymentMethodOptionsSepaDebitSetupFutureUsage::*; + match self { + None => "none", + OffSession => "off_session", + OnSession => "on_session", + } + } +} + +impl std::str::FromStr for UpdatePaymentIntentPaymentMethodOptionsSepaDebitSetupFutureUsage { + type Err = (); + fn from_str(s: &str) -> Result { + use UpdatePaymentIntentPaymentMethodOptionsSepaDebitSetupFutureUsage::*; + match s { + "none" => Ok(None), + "off_session" => Ok(OffSession), + "on_session" => Ok(OnSession), + _ => Err(()), + } + } +} +impl std::fmt::Display for UpdatePaymentIntentPaymentMethodOptionsSepaDebitSetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for UpdatePaymentIntentPaymentMethodOptionsSepaDebitSetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for UpdatePaymentIntentPaymentMethodOptionsSepaDebitSetupFutureUsage { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// If this is a `sofort` PaymentMethod, this sub-hash contains details about the SOFORT payment method options. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdatePaymentIntentPaymentMethodOptionsSofort { + /// Language shown to the payer on redirect. + #[serde(skip_serializing_if = "Option::is_none")] + pub preferred_language: Option, + /// Indicates that you intend to make future payments with this PaymentIntent's payment method. + /// + /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. + /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + /// + /// When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + /// + /// If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. + #[serde(skip_serializing_if = "Option::is_none")] + pub setup_future_usage: Option, +} +impl UpdatePaymentIntentPaymentMethodOptionsSofort { + pub fn new() -> Self { + Self::default() + } +} +/// Language shown to the payer on redirect. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum UpdatePaymentIntentPaymentMethodOptionsSofortPreferredLanguage { + De, + En, + Es, + Fr, + It, + Nl, + Pl, +} +impl UpdatePaymentIntentPaymentMethodOptionsSofortPreferredLanguage { + pub fn as_str(self) -> &'static str { + use UpdatePaymentIntentPaymentMethodOptionsSofortPreferredLanguage::*; + match self { + De => "de", + En => "en", + Es => "es", + Fr => "fr", + It => "it", + Nl => "nl", + Pl => "pl", + } + } +} + +impl std::str::FromStr for UpdatePaymentIntentPaymentMethodOptionsSofortPreferredLanguage { + type Err = (); + fn from_str(s: &str) -> Result { + use UpdatePaymentIntentPaymentMethodOptionsSofortPreferredLanguage::*; + match s { + "de" => Ok(De), + "en" => Ok(En), + "es" => Ok(Es), + "fr" => Ok(Fr), + "it" => Ok(It), + "nl" => Ok(Nl), + "pl" => Ok(Pl), + _ => Err(()), + } + } +} +impl std::fmt::Display for UpdatePaymentIntentPaymentMethodOptionsSofortPreferredLanguage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for UpdatePaymentIntentPaymentMethodOptionsSofortPreferredLanguage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for UpdatePaymentIntentPaymentMethodOptionsSofortPreferredLanguage { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Indicates that you intend to make future payments with this PaymentIntent's payment method. +/// +/// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. +/// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. +/// +/// When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). +/// +/// If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum UpdatePaymentIntentPaymentMethodOptionsSofortSetupFutureUsage { + None, + OffSession, +} +impl UpdatePaymentIntentPaymentMethodOptionsSofortSetupFutureUsage { + pub fn as_str(self) -> &'static str { + use UpdatePaymentIntentPaymentMethodOptionsSofortSetupFutureUsage::*; + match self { + None => "none", + OffSession => "off_session", + } + } +} + +impl std::str::FromStr for UpdatePaymentIntentPaymentMethodOptionsSofortSetupFutureUsage { + type Err = (); + fn from_str(s: &str) -> Result { + use UpdatePaymentIntentPaymentMethodOptionsSofortSetupFutureUsage::*; + match s { + "none" => Ok(None), + "off_session" => Ok(OffSession), + _ => Err(()), + } + } +} +impl std::fmt::Display for UpdatePaymentIntentPaymentMethodOptionsSofortSetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for UpdatePaymentIntentPaymentMethodOptionsSofortSetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for UpdatePaymentIntentPaymentMethodOptionsSofortSetupFutureUsage { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// If this is a `Swish` PaymentMethod, this sub-hash contains details about the Swish payment method options. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdatePaymentIntentPaymentMethodOptionsSwish<'a> { + /// The order ID displayed in the Swish app after the payment is authorized. + #[serde(skip_serializing_if = "Option::is_none")] + pub reference: Option<&'a str>, + /// Indicates that you intend to make future payments with this PaymentIntent's payment method. + /// + /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. + /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + /// + /// When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + /// + /// If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. + #[serde(skip_serializing_if = "Option::is_none")] + pub setup_future_usage: Option, +} +impl<'a> UpdatePaymentIntentPaymentMethodOptionsSwish<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// Indicates that you intend to make future payments with this PaymentIntent's payment method. +/// +/// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. +/// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. +/// +/// When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). +/// +/// If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum UpdatePaymentIntentPaymentMethodOptionsSwishSetupFutureUsage { + None, +} +impl UpdatePaymentIntentPaymentMethodOptionsSwishSetupFutureUsage { + pub fn as_str(self) -> &'static str { + use UpdatePaymentIntentPaymentMethodOptionsSwishSetupFutureUsage::*; + match self { + None => "none", + } + } +} + +impl std::str::FromStr for UpdatePaymentIntentPaymentMethodOptionsSwishSetupFutureUsage { + type Err = (); + fn from_str(s: &str) -> Result { + use UpdatePaymentIntentPaymentMethodOptionsSwishSetupFutureUsage::*; + match s { + "none" => Ok(None), + _ => Err(()), + } + } +} +impl std::fmt::Display for UpdatePaymentIntentPaymentMethodOptionsSwishSetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for UpdatePaymentIntentPaymentMethodOptionsSwishSetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for UpdatePaymentIntentPaymentMethodOptionsSwishSetupFutureUsage { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// If this is a `us_bank_account` PaymentMethod, this sub-hash contains details about the US bank account payment method options. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdatePaymentIntentPaymentMethodOptionsUsBankAccount<'a> { + /// Additional fields for Financial Connections Session creation + #[serde(skip_serializing_if = "Option::is_none")] + pub financial_connections: + Option>, + /// Additional fields for Mandate creation + #[serde(skip_serializing_if = "Option::is_none")] + pub mandate_options: Option, + /// Additional fields for network related functions + #[serde(skip_serializing_if = "Option::is_none")] + pub networks: Option>, + /// Preferred transaction settlement speed + #[serde(skip_serializing_if = "Option::is_none")] + pub preferred_settlement_speed: + Option, + /// Indicates that you intend to make future payments with this PaymentIntent's payment method. + /// + /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. + /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + /// + /// When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + /// + /// If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. + #[serde(skip_serializing_if = "Option::is_none")] + pub setup_future_usage: + Option, + /// Bank account verification method. + #[serde(skip_serializing_if = "Option::is_none")] + pub verification_method: + Option, +} +impl<'a> UpdatePaymentIntentPaymentMethodOptionsUsBankAccount<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// Additional fields for Financial Connections Session creation +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdatePaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnections<'a> { + /// The list of permissions to request. + /// If this parameter is passed, the `payment_method` permission must be included. + /// Valid permissions include: `balances`, `ownership`, `payment_method`, and `transactions`. + #[serde(skip_serializing_if = "Option::is_none")] + pub permissions: Option< + &'a [UpdatePaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions], + >, + /// List of data features that you would like to retrieve upon account creation. + #[serde(skip_serializing_if = "Option::is_none")] + pub prefetch: Option< + &'a [UpdatePaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch], + >, + /// For webview integrations only. + /// Upon completing OAuth login in the native browser, the user will be redirected to this URL to return to your app. + #[serde(skip_serializing_if = "Option::is_none")] + pub return_url: Option<&'a str>, +} +impl<'a> UpdatePaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnections<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// The list of permissions to request. +/// If this parameter is passed, the `payment_method` permission must be included. +/// Valid permissions include: `balances`, `ownership`, `payment_method`, and `transactions`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum UpdatePaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions { + Balances, + Ownership, + PaymentMethod, + Transactions, +} +impl UpdatePaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions { + pub fn as_str(self) -> &'static str { + use UpdatePaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions::*; + match self { + Balances => "balances", + Ownership => "ownership", + PaymentMethod => "payment_method", + Transactions => "transactions", + } + } +} + +impl std::str::FromStr + for UpdatePaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions +{ + type Err = (); + fn from_str(s: &str) -> Result { + use UpdatePaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions::*; + match s { + "balances" => Ok(Balances), + "ownership" => Ok(Ownership), + "payment_method" => Ok(PaymentMethod), + "transactions" => Ok(Transactions), + _ => Err(()), + } + } +} +impl std::fmt::Display + for UpdatePaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions +{ + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug + for UpdatePaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions +{ + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize + for UpdatePaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions +{ + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// List of data features that you would like to retrieve upon account creation. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum UpdatePaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch { + Balances, + Transactions, +} +impl UpdatePaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch { + pub fn as_str(self) -> &'static str { + use UpdatePaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch::*; + match self { + Balances => "balances", + Transactions => "transactions", + } + } +} + +impl std::str::FromStr + for UpdatePaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch +{ + type Err = (); + fn from_str(s: &str) -> Result { + use UpdatePaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch::*; + match s { + "balances" => Ok(Balances), + "transactions" => Ok(Transactions), + _ => Err(()), + } + } +} +impl std::fmt::Display + for UpdatePaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch +{ + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug + for UpdatePaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch +{ + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize + for UpdatePaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch +{ + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Additional fields for Mandate creation +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdatePaymentIntentPaymentMethodOptionsUsBankAccountMandateOptions { + /// The method used to collect offline mandate customer acceptance. + #[serde(skip_serializing_if = "Option::is_none")] + pub collection_method: + Option, +} +impl UpdatePaymentIntentPaymentMethodOptionsUsBankAccountMandateOptions { + pub fn new() -> Self { + Self::default() + } +} +/// The method used to collect offline mandate customer acceptance. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum UpdatePaymentIntentPaymentMethodOptionsUsBankAccountMandateOptionsCollectionMethod { + Paper, +} +impl UpdatePaymentIntentPaymentMethodOptionsUsBankAccountMandateOptionsCollectionMethod { + pub fn as_str(self) -> &'static str { + use UpdatePaymentIntentPaymentMethodOptionsUsBankAccountMandateOptionsCollectionMethod::*; + match self { + Paper => "paper", + } + } +} + +impl std::str::FromStr + for UpdatePaymentIntentPaymentMethodOptionsUsBankAccountMandateOptionsCollectionMethod +{ + type Err = (); + fn from_str(s: &str) -> Result { + use UpdatePaymentIntentPaymentMethodOptionsUsBankAccountMandateOptionsCollectionMethod::*; + match s { + "paper" => Ok(Paper), + _ => Err(()), + } + } +} +impl std::fmt::Display + for UpdatePaymentIntentPaymentMethodOptionsUsBankAccountMandateOptionsCollectionMethod +{ + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug + for UpdatePaymentIntentPaymentMethodOptionsUsBankAccountMandateOptionsCollectionMethod +{ + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize + for UpdatePaymentIntentPaymentMethodOptionsUsBankAccountMandateOptionsCollectionMethod +{ + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Additional fields for network related functions +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdatePaymentIntentPaymentMethodOptionsUsBankAccountNetworks<'a> { + /// Triggers validations to run across the selected networks + #[serde(skip_serializing_if = "Option::is_none")] + pub requested: + Option<&'a [UpdatePaymentIntentPaymentMethodOptionsUsBankAccountNetworksRequested]>, +} +impl<'a> UpdatePaymentIntentPaymentMethodOptionsUsBankAccountNetworks<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// Triggers validations to run across the selected networks +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum UpdatePaymentIntentPaymentMethodOptionsUsBankAccountNetworksRequested { + Ach, + UsDomesticWire, +} +impl UpdatePaymentIntentPaymentMethodOptionsUsBankAccountNetworksRequested { + pub fn as_str(self) -> &'static str { + use UpdatePaymentIntentPaymentMethodOptionsUsBankAccountNetworksRequested::*; + match self { + Ach => "ach", + UsDomesticWire => "us_domestic_wire", + } + } +} + +impl std::str::FromStr for UpdatePaymentIntentPaymentMethodOptionsUsBankAccountNetworksRequested { + type Err = (); + fn from_str(s: &str) -> Result { + use UpdatePaymentIntentPaymentMethodOptionsUsBankAccountNetworksRequested::*; + match s { + "ach" => Ok(Ach), + "us_domestic_wire" => Ok(UsDomesticWire), + _ => Err(()), + } + } +} +impl std::fmt::Display for UpdatePaymentIntentPaymentMethodOptionsUsBankAccountNetworksRequested { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for UpdatePaymentIntentPaymentMethodOptionsUsBankAccountNetworksRequested { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for UpdatePaymentIntentPaymentMethodOptionsUsBankAccountNetworksRequested { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Preferred transaction settlement speed +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum UpdatePaymentIntentPaymentMethodOptionsUsBankAccountPreferredSettlementSpeed { + Fastest, + Standard, +} +impl UpdatePaymentIntentPaymentMethodOptionsUsBankAccountPreferredSettlementSpeed { + pub fn as_str(self) -> &'static str { + use UpdatePaymentIntentPaymentMethodOptionsUsBankAccountPreferredSettlementSpeed::*; + match self { + Fastest => "fastest", + Standard => "standard", + } + } +} + +impl std::str::FromStr + for UpdatePaymentIntentPaymentMethodOptionsUsBankAccountPreferredSettlementSpeed +{ + type Err = (); + fn from_str(s: &str) -> Result { + use UpdatePaymentIntentPaymentMethodOptionsUsBankAccountPreferredSettlementSpeed::*; + match s { + "fastest" => Ok(Fastest), + "standard" => Ok(Standard), + _ => Err(()), + } + } +} +impl std::fmt::Display + for UpdatePaymentIntentPaymentMethodOptionsUsBankAccountPreferredSettlementSpeed +{ + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug + for UpdatePaymentIntentPaymentMethodOptionsUsBankAccountPreferredSettlementSpeed +{ + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize + for UpdatePaymentIntentPaymentMethodOptionsUsBankAccountPreferredSettlementSpeed +{ + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Indicates that you intend to make future payments with this PaymentIntent's payment method. +/// +/// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. +/// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. +/// +/// When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). +/// +/// If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum UpdatePaymentIntentPaymentMethodOptionsUsBankAccountSetupFutureUsage { + None, + OffSession, + OnSession, +} +impl UpdatePaymentIntentPaymentMethodOptionsUsBankAccountSetupFutureUsage { + pub fn as_str(self) -> &'static str { + use UpdatePaymentIntentPaymentMethodOptionsUsBankAccountSetupFutureUsage::*; + match self { + None => "none", + OffSession => "off_session", + OnSession => "on_session", + } + } +} + +impl std::str::FromStr for UpdatePaymentIntentPaymentMethodOptionsUsBankAccountSetupFutureUsage { + type Err = (); + fn from_str(s: &str) -> Result { + use UpdatePaymentIntentPaymentMethodOptionsUsBankAccountSetupFutureUsage::*; + match s { + "none" => Ok(None), + "off_session" => Ok(OffSession), + "on_session" => Ok(OnSession), + _ => Err(()), + } + } +} +impl std::fmt::Display for UpdatePaymentIntentPaymentMethodOptionsUsBankAccountSetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for UpdatePaymentIntentPaymentMethodOptionsUsBankAccountSetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for UpdatePaymentIntentPaymentMethodOptionsUsBankAccountSetupFutureUsage { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Bank account verification method. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum UpdatePaymentIntentPaymentMethodOptionsUsBankAccountVerificationMethod { + Automatic, + Instant, + Microdeposits, +} +impl UpdatePaymentIntentPaymentMethodOptionsUsBankAccountVerificationMethod { + pub fn as_str(self) -> &'static str { + use UpdatePaymentIntentPaymentMethodOptionsUsBankAccountVerificationMethod::*; + match self { + Automatic => "automatic", + Instant => "instant", + Microdeposits => "microdeposits", + } + } +} + +impl std::str::FromStr for UpdatePaymentIntentPaymentMethodOptionsUsBankAccountVerificationMethod { + type Err = (); + fn from_str(s: &str) -> Result { + use UpdatePaymentIntentPaymentMethodOptionsUsBankAccountVerificationMethod::*; + match s { + "automatic" => Ok(Automatic), + "instant" => Ok(Instant), + "microdeposits" => Ok(Microdeposits), + _ => Err(()), + } + } +} +impl std::fmt::Display for UpdatePaymentIntentPaymentMethodOptionsUsBankAccountVerificationMethod { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for UpdatePaymentIntentPaymentMethodOptionsUsBankAccountVerificationMethod { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for UpdatePaymentIntentPaymentMethodOptionsUsBankAccountVerificationMethod { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// If this is a `wechat_pay` PaymentMethod, this sub-hash contains details about the WeChat Pay payment method options. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct UpdatePaymentIntentPaymentMethodOptionsWechatPay<'a> { + /// The app ID registered with WeChat Pay. Only required when client is ios or android. + #[serde(skip_serializing_if = "Option::is_none")] + pub app_id: Option<&'a str>, + /// The client type that the end customer will pay from + pub client: UpdatePaymentIntentPaymentMethodOptionsWechatPayClient, + /// Indicates that you intend to make future payments with this PaymentIntent's payment method. + /// + /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. + /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + /// + /// When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + /// + /// If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. + #[serde(skip_serializing_if = "Option::is_none")] + pub setup_future_usage: + Option, +} +impl<'a> UpdatePaymentIntentPaymentMethodOptionsWechatPay<'a> { + pub fn new(client: UpdatePaymentIntentPaymentMethodOptionsWechatPayClient) -> Self { + Self { app_id: None, client, setup_future_usage: None } + } +} +/// The client type that the end customer will pay from +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum UpdatePaymentIntentPaymentMethodOptionsWechatPayClient { + Android, + Ios, + Web, +} +impl UpdatePaymentIntentPaymentMethodOptionsWechatPayClient { + pub fn as_str(self) -> &'static str { + use UpdatePaymentIntentPaymentMethodOptionsWechatPayClient::*; + match self { + Android => "android", + Ios => "ios", + Web => "web", + } + } +} + +impl std::str::FromStr for UpdatePaymentIntentPaymentMethodOptionsWechatPayClient { + type Err = (); + fn from_str(s: &str) -> Result { + use UpdatePaymentIntentPaymentMethodOptionsWechatPayClient::*; + match s { + "android" => Ok(Android), + "ios" => Ok(Ios), + "web" => Ok(Web), + _ => Err(()), + } + } +} +impl std::fmt::Display for UpdatePaymentIntentPaymentMethodOptionsWechatPayClient { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for UpdatePaymentIntentPaymentMethodOptionsWechatPayClient { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for UpdatePaymentIntentPaymentMethodOptionsWechatPayClient { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Indicates that you intend to make future payments with this PaymentIntent's payment method. +/// +/// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. +/// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. +/// +/// When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). +/// +/// If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum UpdatePaymentIntentPaymentMethodOptionsWechatPaySetupFutureUsage { + None, +} +impl UpdatePaymentIntentPaymentMethodOptionsWechatPaySetupFutureUsage { + pub fn as_str(self) -> &'static str { + use UpdatePaymentIntentPaymentMethodOptionsWechatPaySetupFutureUsage::*; + match self { + None => "none", + } + } +} + +impl std::str::FromStr for UpdatePaymentIntentPaymentMethodOptionsWechatPaySetupFutureUsage { + type Err = (); + fn from_str(s: &str) -> Result { + use UpdatePaymentIntentPaymentMethodOptionsWechatPaySetupFutureUsage::*; + match s { + "none" => Ok(None), + _ => Err(()), + } + } +} +impl std::fmt::Display for UpdatePaymentIntentPaymentMethodOptionsWechatPaySetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for UpdatePaymentIntentPaymentMethodOptionsWechatPaySetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for UpdatePaymentIntentPaymentMethodOptionsWechatPaySetupFutureUsage { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// If this is a `zip` PaymentMethod, this sub-hash contains details about the Zip payment method options. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdatePaymentIntentPaymentMethodOptionsZip { + /// Indicates that you intend to make future payments with this PaymentIntent's payment method. + /// + /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. + /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + /// + /// When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + /// + /// If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. + #[serde(skip_serializing_if = "Option::is_none")] + pub setup_future_usage: Option, +} +impl UpdatePaymentIntentPaymentMethodOptionsZip { + pub fn new() -> Self { + Self::default() + } +} +/// Indicates that you intend to make future payments with this PaymentIntent's payment method. +/// +/// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. +/// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. +/// +/// When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). +/// +/// If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum UpdatePaymentIntentPaymentMethodOptionsZipSetupFutureUsage { + None, +} +impl UpdatePaymentIntentPaymentMethodOptionsZipSetupFutureUsage { + pub fn as_str(self) -> &'static str { + use UpdatePaymentIntentPaymentMethodOptionsZipSetupFutureUsage::*; + match self { + None => "none", + } + } +} + +impl std::str::FromStr for UpdatePaymentIntentPaymentMethodOptionsZipSetupFutureUsage { + type Err = (); + fn from_str(s: &str) -> Result { + use UpdatePaymentIntentPaymentMethodOptionsZipSetupFutureUsage::*; + match s { + "none" => Ok(None), + _ => Err(()), + } + } +} +impl std::fmt::Display for UpdatePaymentIntentPaymentMethodOptionsZipSetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for UpdatePaymentIntentPaymentMethodOptionsZipSetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for UpdatePaymentIntentPaymentMethodOptionsZipSetupFutureUsage { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Shipping information for this PaymentIntent. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct UpdatePaymentIntentShipping<'a> { + /// Shipping address. + pub address: UpdatePaymentIntentShippingAddress<'a>, + /// The delivery service that shipped a physical product, such as Fedex, UPS, USPS, etc. + #[serde(skip_serializing_if = "Option::is_none")] + pub carrier: Option<&'a str>, + /// Recipient name. + pub name: &'a str, + /// Recipient phone (including extension). + #[serde(skip_serializing_if = "Option::is_none")] + pub phone: Option<&'a str>, + /// The tracking number for a physical product, obtained from the delivery service. + /// If multiple tracking numbers were generated for this purchase, please separate them with commas. + #[serde(skip_serializing_if = "Option::is_none")] + pub tracking_number: Option<&'a str>, +} +impl<'a> UpdatePaymentIntentShipping<'a> { + pub fn new(address: UpdatePaymentIntentShippingAddress<'a>, name: &'a str) -> Self { + Self { address, carrier: None, name, phone: None, tracking_number: None } + } +} +/// Shipping address. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdatePaymentIntentShippingAddress<'a> { + /// City, district, suburb, town, or village. + #[serde(skip_serializing_if = "Option::is_none")] + pub city: Option<&'a str>, + /// Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). + #[serde(skip_serializing_if = "Option::is_none")] + pub country: Option<&'a str>, + /// Address line 1 (e.g., street, PO Box, or company name). + #[serde(skip_serializing_if = "Option::is_none")] + pub line1: Option<&'a str>, + /// Address line 2 (e.g., apartment, suite, unit, or building). + #[serde(skip_serializing_if = "Option::is_none")] + pub line2: Option<&'a str>, + /// ZIP or postal code. + #[serde(skip_serializing_if = "Option::is_none")] + pub postal_code: Option<&'a str>, + /// State, county, province, or region. + #[serde(skip_serializing_if = "Option::is_none")] + pub state: Option<&'a str>, +} +impl<'a> UpdatePaymentIntentShippingAddress<'a> { + pub fn new() -> Self { + Self::default() + } +} +impl<'a> UpdatePaymentIntent<'a> { + /// Updates properties on a PaymentIntent object without confirming. + /// + /// Depending on which properties you update, you might need to confirm the + /// PaymentIntent again. For example, updating the `payment_method` + /// always requires you to confirm the PaymentIntent again. If you prefer to + /// update and confirm at the same time, we recommend updating properties through + /// the [confirm API](https://stripe.com/docs/api/payment_intents/confirm) instead. + pub fn send( + &self, + client: &stripe::Client, + intent: &stripe_shared::PaymentIntentId, + ) -> stripe::Response { + client.send_form(&format!("/payment_intents/{intent}"), self, http_types::Method::Post) + } +} +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct ApplyCustomerBalancePaymentIntent<'a> { + /// Amount that you intend to apply to this PaymentIntent from the customer’s cash balance. + /// + /// A positive integer representing how much to charge in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal) (for example, 100 cents to charge 1 USD or 100 to charge 100 JPY, a zero-decimal currency). + /// + /// The maximum amount is the amount of the PaymentIntent. + /// + /// When you omit the amount, it defaults to the remaining amount requested on the PaymentIntent. + #[serde(skip_serializing_if = "Option::is_none")] + pub amount: Option, + /// Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. + /// Must be a [supported currency](https://stripe.com/docs/currencies). + #[serde(skip_serializing_if = "Option::is_none")] + pub currency: Option, + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, +} +impl<'a> ApplyCustomerBalancePaymentIntent<'a> { + pub fn new() -> Self { + Self::default() + } +} +impl<'a> ApplyCustomerBalancePaymentIntent<'a> { + /// Manually reconcile the remaining amount for a `customer_balance` PaymentIntent. + pub fn send( + &self, + client: &stripe::Client, + intent: &stripe_shared::PaymentIntentId, + ) -> stripe::Response { + client.send_form( + &format!("/payment_intents/{intent}/apply_customer_balance"), + self, + http_types::Method::Post, + ) + } +} +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CancelPaymentIntent<'a> { + /// Reason for canceling this PaymentIntent. + /// Possible values are: `duplicate`, `fraudulent`, `requested_by_customer`, or `abandoned`. + #[serde(skip_serializing_if = "Option::is_none")] + pub cancellation_reason: Option, + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, +} +impl<'a> CancelPaymentIntent<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// Reason for canceling this PaymentIntent. +/// Possible values are: `duplicate`, `fraudulent`, `requested_by_customer`, or `abandoned`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CancelPaymentIntentCancellationReason { + Abandoned, + Duplicate, + Fraudulent, + RequestedByCustomer, +} +impl CancelPaymentIntentCancellationReason { + pub fn as_str(self) -> &'static str { + use CancelPaymentIntentCancellationReason::*; + match self { + Abandoned => "abandoned", + Duplicate => "duplicate", + Fraudulent => "fraudulent", + RequestedByCustomer => "requested_by_customer", + } + } +} + +impl std::str::FromStr for CancelPaymentIntentCancellationReason { + type Err = (); + fn from_str(s: &str) -> Result { + use CancelPaymentIntentCancellationReason::*; + match s { + "abandoned" => Ok(Abandoned), + "duplicate" => Ok(Duplicate), + "fraudulent" => Ok(Fraudulent), + "requested_by_customer" => Ok(RequestedByCustomer), + _ => Err(()), + } + } +} +impl std::fmt::Display for CancelPaymentIntentCancellationReason { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CancelPaymentIntentCancellationReason { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CancelPaymentIntentCancellationReason { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'a> CancelPaymentIntent<'a> { + /// You can cancel a PaymentIntent object when it’s in one of these statuses: `requires_payment_method`, `requires_capture`, `requires_confirmation`, `requires_action` or, [in rare cases](https://stripe.com/docs/payments/intents), `processing`. + /// + /// + /// After it’s canceled, no additional charges are made by the PaymentIntent and any operations on the PaymentIntent fail with an error. + /// For PaymentIntents with a `status` of `requires_capture`, the remaining `amount_capturable` is automatically refunded. + /// + /// + /// You can’t cancel the PaymentIntent for a Checkout Session. + /// [Expire the Checkout Session](https://stripe.com/docs/api/checkout/sessions/expire) instead. + pub fn send( + &self, + client: &stripe::Client, + intent: &stripe_shared::PaymentIntentId, + ) -> stripe::Response { + client.send_form( + &format!("/payment_intents/{intent}/cancel"), + self, + http_types::Method::Post, + ) + } +} +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CapturePaymentIntent<'a> { + /// The amount to capture from the PaymentIntent, which must be less than or equal to the original amount. + /// Any additional amount is automatically refunded. + /// Defaults to the full `amount_capturable` if it's not provided. + #[serde(skip_serializing_if = "Option::is_none")] + pub amount_to_capture: Option, + /// The amount of the application fee (if any) that will be requested to be applied to the payment and transferred to the application owner's Stripe account. + /// The amount of the application fee collected will be capped at the total payment amount. + /// For more information, see the PaymentIntents [use case for connected accounts](https://stripe.com/docs/payments/connected-accounts). + #[serde(skip_serializing_if = "Option::is_none")] + pub application_fee_amount: Option, + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, + /// Defaults to `true`. + /// When capturing a PaymentIntent, setting `final_capture` to `false` notifies Stripe to not release the remaining uncaptured funds to make sure that they're captured in future requests. + /// You can only use this setting when [multicapture](https://stripe.com/docs/payments/multicapture) is available for PaymentIntents. + #[serde(skip_serializing_if = "Option::is_none")] + pub final_capture: Option, + /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. + /// This can be useful for storing additional information about the object in a structured format. + /// Individual keys can be unset by posting an empty value to them. + /// All keys can be unset by posting an empty value to `metadata`. + #[serde(skip_serializing_if = "Option::is_none")] + pub metadata: Option<&'a std::collections::HashMap>, + /// For card charges, use [statement_descriptor_suffix](https://stripe.com/docs/payments/account/statement-descriptors#dynamic). + /// Otherwise, you can use this value as the complete description of a charge on your customers' statements. + /// It must contain at least one letter and be 1–22 characters long. + #[serde(skip_serializing_if = "Option::is_none")] + pub statement_descriptor: Option<&'a str>, + /// Provides information about a card payment that customers see on their statements. + /// Concatenated with the prefix (shortened descriptor) or statement descriptor that’s set on the account to form the complete statement descriptor. + /// The concatenated descriptor must be 1-22 characters long. + #[serde(skip_serializing_if = "Option::is_none")] + pub statement_descriptor_suffix: Option<&'a str>, + /// The parameters that you can use to automatically create a transfer after the payment + /// is captured. + /// Learn more about the [use case for connected accounts](https://stripe.com/docs/payments/connected-accounts). + #[serde(skip_serializing_if = "Option::is_none")] + pub transfer_data: Option, +} +impl<'a> CapturePaymentIntent<'a> { + pub fn new() -> Self { + Self::default() + } +} +impl<'a> CapturePaymentIntent<'a> { + /// Capture the funds of an existing uncaptured PaymentIntent when its status is `requires_capture`. + /// + /// Uncaptured PaymentIntents are cancelled a set number of days (7 by default) after their creation. + /// + /// Learn more about [separate authorization and capture](https://stripe.com/docs/payments/capture-later). + pub fn send( + &self, + client: &stripe::Client, + intent: &stripe_shared::PaymentIntentId, + ) -> stripe::Response { + client.send_form( + &format!("/payment_intents/{intent}/capture"), + self, + http_types::Method::Post, + ) + } +} +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct ConfirmPaymentIntent<'a> { + /// Controls when the funds will be captured from the customer's account. + #[serde(skip_serializing_if = "Option::is_none")] + pub capture_method: Option, + /// Set to `true` to fail the payment attempt if the PaymentIntent transitions into `requires_action`. + /// This parameter is intended for simpler integrations that do not handle customer actions, like [saving cards without authentication](https://stripe.com/docs/payments/save-card-without-authentication). + #[serde(skip_serializing_if = "Option::is_none")] + pub error_on_requires_action: Option, + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, + /// ID of the mandate that's used for this payment. + #[serde(skip_serializing_if = "Option::is_none")] + pub mandate: Option<&'a str>, + #[serde(skip_serializing_if = "Option::is_none")] + pub mandate_data: Option>, + /// Set to `true` to indicate that the customer isn't in your checkout flow during this payment attempt and can't authenticate. + /// Use this parameter in scenarios where you collect card details and [charge them later](https://stripe.com/docs/payments/cards/charging-saved-cards). + #[serde(skip_serializing_if = "Option::is_none")] + pub off_session: Option, + /// ID of the payment method (a PaymentMethod, Card, or [compatible Source](https://stripe.com/docs/payments/payment-methods/transitioning#compatibility) object) to attach to this PaymentIntent. + #[serde(skip_serializing_if = "Option::is_none")] + pub payment_method: Option<&'a str>, + /// If provided, this hash will be used to create a PaymentMethod. The new PaymentMethod will appear + /// in the [payment_method](https://stripe.com/docs/api/payment_intents/object#payment_intent_object-payment_method). + /// property on the PaymentIntent. + #[serde(skip_serializing_if = "Option::is_none")] + pub payment_method_data: Option>, + /// Payment method-specific configuration for this PaymentIntent. + #[serde(skip_serializing_if = "Option::is_none")] + pub payment_method_options: Option>, + /// Options to configure Radar. + /// Learn more about [Radar Sessions](https://stripe.com/docs/radar/radar-session). + #[serde(skip_serializing_if = "Option::is_none")] + pub radar_options: Option>, + /// Email address that the receipt for the resulting payment will be sent to. + /// If `receipt_email` is specified for a payment in live mode, a receipt will be sent regardless of your [email settings](https://dashboard.stripe.com/account/emails). + #[serde(skip_serializing_if = "Option::is_none")] + pub receipt_email: Option<&'a str>, + /// The URL to redirect your customer back to after they authenticate or cancel their payment on the payment method's app or site. + /// If you'd prefer to redirect to a mobile application, you can alternatively supply an application URI scheme. + /// This parameter is only used for cards and other redirect-based payment methods. + #[serde(skip_serializing_if = "Option::is_none")] + pub return_url: Option<&'a str>, + /// Indicates that you intend to make future payments with this PaymentIntent's payment method. + /// + /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. + /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + /// + /// When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + /// + /// If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. + #[serde(skip_serializing_if = "Option::is_none")] + pub setup_future_usage: Option, + /// Shipping information for this PaymentIntent. + #[serde(skip_serializing_if = "Option::is_none")] + pub shipping: Option>, + /// Set to `true` when confirming server-side and using Stripe.js, iOS, or Android client-side SDKs to handle the next actions. + #[serde(skip_serializing_if = "Option::is_none")] + pub use_stripe_sdk: Option, +} +impl<'a> ConfirmPaymentIntent<'a> { + pub fn new() -> Self { + Self::default() + } +} +#[derive(Copy, Clone, Debug, serde::Serialize)] +#[serde(untagged)] +pub enum ConfirmPaymentIntentMandateData<'a> { + SecretKeyParam(ConfirmPaymentIntentSecretKeyParam<'a>), + ClientKeyParam(ConfirmPaymentIntentClientKeyParam<'a>), +} +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct ConfirmPaymentIntentSecretKeyParam<'a> { + /// This hash contains details about the customer acceptance of the Mandate. + pub customer_acceptance: ConfirmPaymentIntentSecretKeyParamCustomerAcceptance<'a>, +} +impl<'a> ConfirmPaymentIntentSecretKeyParam<'a> { + pub fn new( + customer_acceptance: ConfirmPaymentIntentSecretKeyParamCustomerAcceptance<'a>, + ) -> Self { + Self { customer_acceptance } + } +} +/// This hash contains details about the customer acceptance of the Mandate. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct ConfirmPaymentIntentSecretKeyParamCustomerAcceptance<'a> { + /// The time at which the customer accepted the Mandate. + #[serde(skip_serializing_if = "Option::is_none")] + pub accepted_at: Option, + /// If this is a Mandate accepted offline, this hash contains details about the offline acceptance. + #[serde(skip_serializing_if = "Option::is_none")] + pub offline: Option<&'a serde_json::Value>, + /// If this is a Mandate accepted online, this hash contains details about the online acceptance. + #[serde(skip_serializing_if = "Option::is_none")] + pub online: Option>, + /// The type of customer acceptance information included with the Mandate. + /// One of `online` or `offline`. + #[serde(rename = "type")] + pub type_: ConfirmPaymentIntentSecretKeyParamCustomerAcceptanceType, +} +impl<'a> ConfirmPaymentIntentSecretKeyParamCustomerAcceptance<'a> { + pub fn new(type_: ConfirmPaymentIntentSecretKeyParamCustomerAcceptanceType) -> Self { + Self { accepted_at: None, offline: None, online: None, type_ } + } +} +/// The type of customer acceptance information included with the Mandate. +/// One of `online` or `offline`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum ConfirmPaymentIntentSecretKeyParamCustomerAcceptanceType { + Offline, + Online, +} +impl ConfirmPaymentIntentSecretKeyParamCustomerAcceptanceType { + pub fn as_str(self) -> &'static str { + use ConfirmPaymentIntentSecretKeyParamCustomerAcceptanceType::*; + match self { + Offline => "offline", + Online => "online", + } + } +} + +impl std::str::FromStr for ConfirmPaymentIntentSecretKeyParamCustomerAcceptanceType { + type Err = (); + fn from_str(s: &str) -> Result { + use ConfirmPaymentIntentSecretKeyParamCustomerAcceptanceType::*; + match s { + "offline" => Ok(Offline), + "online" => Ok(Online), + _ => Err(()), + } + } +} +impl std::fmt::Display for ConfirmPaymentIntentSecretKeyParamCustomerAcceptanceType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for ConfirmPaymentIntentSecretKeyParamCustomerAcceptanceType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for ConfirmPaymentIntentSecretKeyParamCustomerAcceptanceType { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct ConfirmPaymentIntentClientKeyParam<'a> { + /// This hash contains details about the customer acceptance of the Mandate. + pub customer_acceptance: ConfirmPaymentIntentClientKeyParamCustomerAcceptance<'a>, +} +impl<'a> ConfirmPaymentIntentClientKeyParam<'a> { + pub fn new( + customer_acceptance: ConfirmPaymentIntentClientKeyParamCustomerAcceptance<'a>, + ) -> Self { + Self { customer_acceptance } + } +} +/// This hash contains details about the customer acceptance of the Mandate. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct ConfirmPaymentIntentClientKeyParamCustomerAcceptance<'a> { + /// If this is a Mandate accepted online, this hash contains details about the online acceptance. + pub online: ConfirmPaymentIntentClientKeyParamCustomerAcceptanceOnline<'a>, + /// The type of customer acceptance information included with the Mandate. + #[serde(rename = "type")] + pub type_: ConfirmPaymentIntentClientKeyParamCustomerAcceptanceType, +} +impl<'a> ConfirmPaymentIntentClientKeyParamCustomerAcceptance<'a> { + pub fn new( + online: ConfirmPaymentIntentClientKeyParamCustomerAcceptanceOnline<'a>, + type_: ConfirmPaymentIntentClientKeyParamCustomerAcceptanceType, + ) -> Self { + Self { online, type_ } + } +} +/// If this is a Mandate accepted online, this hash contains details about the online acceptance. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct ConfirmPaymentIntentClientKeyParamCustomerAcceptanceOnline<'a> { + /// The IP address from which the Mandate was accepted by the customer. + #[serde(skip_serializing_if = "Option::is_none")] + pub ip_address: Option<&'a str>, + /// The user agent of the browser from which the Mandate was accepted by the customer. + #[serde(skip_serializing_if = "Option::is_none")] + pub user_agent: Option<&'a str>, +} +impl<'a> ConfirmPaymentIntentClientKeyParamCustomerAcceptanceOnline<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// The type of customer acceptance information included with the Mandate. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum ConfirmPaymentIntentClientKeyParamCustomerAcceptanceType { + Online, +} +impl ConfirmPaymentIntentClientKeyParamCustomerAcceptanceType { + pub fn as_str(self) -> &'static str { + use ConfirmPaymentIntentClientKeyParamCustomerAcceptanceType::*; + match self { + Online => "online", + } + } +} + +impl std::str::FromStr for ConfirmPaymentIntentClientKeyParamCustomerAcceptanceType { + type Err = (); + fn from_str(s: &str) -> Result { + use ConfirmPaymentIntentClientKeyParamCustomerAcceptanceType::*; + match s { + "online" => Ok(Online), + _ => Err(()), + } + } +} +impl std::fmt::Display for ConfirmPaymentIntentClientKeyParamCustomerAcceptanceType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for ConfirmPaymentIntentClientKeyParamCustomerAcceptanceType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for ConfirmPaymentIntentClientKeyParamCustomerAcceptanceType { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Set to `true` to indicate that the customer isn't in your checkout flow during this payment attempt and can't authenticate. +/// Use this parameter in scenarios where you collect card details and [charge them later](https://stripe.com/docs/payments/cards/charging-saved-cards). +#[derive(Copy, Clone, Debug, serde::Serialize)] +#[serde(untagged)] +pub enum ConfirmPaymentIntentOffSession { + Bool(bool), + OneOff, + Recurring, +} +/// If provided, this hash will be used to create a PaymentMethod. The new PaymentMethod will appear +/// in the [payment_method](https://stripe.com/docs/api/payment_intents/object#payment_intent_object-payment_method). +/// property on the PaymentIntent. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct ConfirmPaymentIntentPaymentMethodData<'a> { + /// If this is an `acss_debit` PaymentMethod, this hash contains details about the ACSS Debit payment method. + #[serde(skip_serializing_if = "Option::is_none")] + pub acss_debit: Option>, + /// If this is an `affirm` PaymentMethod, this hash contains details about the Affirm payment method. + #[serde(skip_serializing_if = "Option::is_none")] + pub affirm: Option<&'a serde_json::Value>, + /// If this is an `AfterpayClearpay` PaymentMethod, this hash contains details about the AfterpayClearpay payment method. + #[serde(skip_serializing_if = "Option::is_none")] + pub afterpay_clearpay: Option<&'a serde_json::Value>, + /// If this is an `Alipay` PaymentMethod, this hash contains details about the Alipay payment method. + #[serde(skip_serializing_if = "Option::is_none")] + pub alipay: Option<&'a serde_json::Value>, + /// If this is an `au_becs_debit` PaymentMethod, this hash contains details about the bank account. + #[serde(skip_serializing_if = "Option::is_none")] + pub au_becs_debit: Option>, + /// If this is a `bacs_debit` PaymentMethod, this hash contains details about the Bacs Direct Debit bank account. + #[serde(skip_serializing_if = "Option::is_none")] + pub bacs_debit: Option>, + /// If this is a `bancontact` PaymentMethod, this hash contains details about the Bancontact payment method. + #[serde(skip_serializing_if = "Option::is_none")] + pub bancontact: Option<&'a serde_json::Value>, + /// Billing information associated with the PaymentMethod that may be used or required by particular types of payment methods. + #[serde(skip_serializing_if = "Option::is_none")] + pub billing_details: Option>, + /// If this is a `blik` PaymentMethod, this hash contains details about the BLIK payment method. + #[serde(skip_serializing_if = "Option::is_none")] + pub blik: Option<&'a serde_json::Value>, + /// If this is a `boleto` PaymentMethod, this hash contains details about the Boleto payment method. + #[serde(skip_serializing_if = "Option::is_none")] + pub boleto: Option>, + /// If this is a `cashapp` PaymentMethod, this hash contains details about the Cash App Pay payment method. + #[serde(skip_serializing_if = "Option::is_none")] + pub cashapp: Option<&'a serde_json::Value>, + /// If this is a `customer_balance` PaymentMethod, this hash contains details about the CustomerBalance payment method. + #[serde(skip_serializing_if = "Option::is_none")] + pub customer_balance: Option<&'a serde_json::Value>, + /// If this is an `eps` PaymentMethod, this hash contains details about the EPS payment method. + #[serde(skip_serializing_if = "Option::is_none")] + pub eps: Option, + /// If this is an `fpx` PaymentMethod, this hash contains details about the FPX payment method. + #[serde(skip_serializing_if = "Option::is_none")] + pub fpx: Option, + /// If this is a `giropay` PaymentMethod, this hash contains details about the Giropay payment method. + #[serde(skip_serializing_if = "Option::is_none")] + pub giropay: Option<&'a serde_json::Value>, + /// If this is a `grabpay` PaymentMethod, this hash contains details about the GrabPay payment method. + #[serde(skip_serializing_if = "Option::is_none")] + pub grabpay: Option<&'a serde_json::Value>, + /// If this is an `ideal` PaymentMethod, this hash contains details about the iDEAL payment method. + #[serde(skip_serializing_if = "Option::is_none")] + pub ideal: Option, + /// If this is an `interac_present` PaymentMethod, this hash contains details about the Interac Present payment method. + #[serde(skip_serializing_if = "Option::is_none")] + pub interac_present: Option<&'a serde_json::Value>, + /// If this is a `klarna` PaymentMethod, this hash contains details about the Klarna payment method. + #[serde(skip_serializing_if = "Option::is_none")] + pub klarna: Option, + /// If this is a `konbini` PaymentMethod, this hash contains details about the Konbini payment method. + #[serde(skip_serializing_if = "Option::is_none")] + pub konbini: Option<&'a serde_json::Value>, + /// If this is an `Link` PaymentMethod, this hash contains details about the Link payment method. + #[serde(skip_serializing_if = "Option::is_none")] + pub link: Option<&'a serde_json::Value>, + /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. + /// This can be useful for storing additional information about the object in a structured format. + /// Individual keys can be unset by posting an empty value to them. + /// All keys can be unset by posting an empty value to `metadata`. + #[serde(skip_serializing_if = "Option::is_none")] + pub metadata: Option<&'a std::collections::HashMap>, + /// If this is an `oxxo` PaymentMethod, this hash contains details about the OXXO payment method. + #[serde(skip_serializing_if = "Option::is_none")] + pub oxxo: Option<&'a serde_json::Value>, + /// If this is a `p24` PaymentMethod, this hash contains details about the P24 payment method. + #[serde(skip_serializing_if = "Option::is_none")] + pub p24: Option, + /// If this is a `paynow` PaymentMethod, this hash contains details about the PayNow payment method. + #[serde(skip_serializing_if = "Option::is_none")] + pub paynow: Option<&'a serde_json::Value>, + /// If this is a `paypal` PaymentMethod, this hash contains details about the PayPal payment method. + #[serde(skip_serializing_if = "Option::is_none")] + pub paypal: Option<&'a serde_json::Value>, + /// If this is a `pix` PaymentMethod, this hash contains details about the Pix payment method. + #[serde(skip_serializing_if = "Option::is_none")] + pub pix: Option<&'a serde_json::Value>, + /// If this is a `promptpay` PaymentMethod, this hash contains details about the PromptPay payment method. + #[serde(skip_serializing_if = "Option::is_none")] + pub promptpay: Option<&'a serde_json::Value>, + /// Options to configure Radar. + /// See [Radar Session](https://stripe.com/docs/radar/radar-session) for more information. + #[serde(skip_serializing_if = "Option::is_none")] + pub radar_options: Option>, + /// If this is a `Revolut Pay` PaymentMethod, this hash contains details about the Revolut Pay payment method. + #[serde(skip_serializing_if = "Option::is_none")] + pub revolut_pay: Option<&'a serde_json::Value>, + /// If this is a `sepa_debit` PaymentMethod, this hash contains details about the SEPA debit bank account. + #[serde(skip_serializing_if = "Option::is_none")] + pub sepa_debit: Option>, + /// If this is a `sofort` PaymentMethod, this hash contains details about the SOFORT payment method. + #[serde(skip_serializing_if = "Option::is_none")] + pub sofort: Option, + /// If this is a `swish` PaymentMethod, this hash contains details about the Swish payment method. + #[serde(skip_serializing_if = "Option::is_none")] + pub swish: Option<&'a serde_json::Value>, + /// The type of the PaymentMethod. + /// An additional hash is included on the PaymentMethod with a name matching this value. + /// It contains additional information specific to the PaymentMethod type. + #[serde(rename = "type")] + pub type_: ConfirmPaymentIntentPaymentMethodDataType, + /// If this is an `us_bank_account` PaymentMethod, this hash contains details about the US bank account payment method. + #[serde(skip_serializing_if = "Option::is_none")] + pub us_bank_account: Option>, + /// If this is an `wechat_pay` PaymentMethod, this hash contains details about the wechat_pay payment method. + #[serde(skip_serializing_if = "Option::is_none")] + pub wechat_pay: Option<&'a serde_json::Value>, + /// If this is a `zip` PaymentMethod, this hash contains details about the Zip payment method. + #[serde(skip_serializing_if = "Option::is_none")] + pub zip: Option<&'a serde_json::Value>, +} +impl<'a> ConfirmPaymentIntentPaymentMethodData<'a> { + pub fn new(type_: ConfirmPaymentIntentPaymentMethodDataType) -> Self { + Self { + acss_debit: None, + affirm: None, + afterpay_clearpay: None, + alipay: None, + au_becs_debit: None, + bacs_debit: None, + bancontact: None, + billing_details: None, + blik: None, + boleto: None, + cashapp: None, + customer_balance: None, + eps: None, + fpx: None, + giropay: None, + grabpay: None, + ideal: None, + interac_present: None, + klarna: None, + konbini: None, + link: None, + metadata: None, + oxxo: None, + p24: None, + paynow: None, + paypal: None, + pix: None, + promptpay: None, + radar_options: None, + revolut_pay: None, + sepa_debit: None, + sofort: None, + swish: None, + type_, + us_bank_account: None, + wechat_pay: None, + zip: None, + } + } +} +/// If this is an `au_becs_debit` PaymentMethod, this hash contains details about the bank account. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct ConfirmPaymentIntentPaymentMethodDataAuBecsDebit<'a> { + /// The account number for the bank account. + pub account_number: &'a str, + /// Bank-State-Branch number of the bank account. + pub bsb_number: &'a str, +} +impl<'a> ConfirmPaymentIntentPaymentMethodDataAuBecsDebit<'a> { + pub fn new(account_number: &'a str, bsb_number: &'a str) -> Self { + Self { account_number, bsb_number } + } +} +/// If this is a `bacs_debit` PaymentMethod, this hash contains details about the Bacs Direct Debit bank account. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct ConfirmPaymentIntentPaymentMethodDataBacsDebit<'a> { + /// Account number of the bank account that the funds will be debited from. + #[serde(skip_serializing_if = "Option::is_none")] + pub account_number: Option<&'a str>, + /// Sort code of the bank account. (e.g., `10-20-30`) + #[serde(skip_serializing_if = "Option::is_none")] + pub sort_code: Option<&'a str>, +} +impl<'a> ConfirmPaymentIntentPaymentMethodDataBacsDebit<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// Billing information associated with the PaymentMethod that may be used or required by particular types of payment methods. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct ConfirmPaymentIntentPaymentMethodDataBillingDetails<'a> { + /// Billing address. + #[serde(skip_serializing_if = "Option::is_none")] + pub address: Option>, + /// Email address. + #[serde(skip_serializing_if = "Option::is_none")] + pub email: Option<&'a str>, + /// Full name. + #[serde(skip_serializing_if = "Option::is_none")] + pub name: Option<&'a str>, + /// Billing phone number (including extension). + #[serde(skip_serializing_if = "Option::is_none")] + pub phone: Option<&'a str>, +} +impl<'a> ConfirmPaymentIntentPaymentMethodDataBillingDetails<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// Billing address. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct ConfirmPaymentIntentPaymentMethodDataBillingDetailsAddress<'a> { + /// City, district, suburb, town, or village. + #[serde(skip_serializing_if = "Option::is_none")] + pub city: Option<&'a str>, + /// Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). + #[serde(skip_serializing_if = "Option::is_none")] + pub country: Option<&'a str>, + /// Address line 1 (e.g., street, PO Box, or company name). + #[serde(skip_serializing_if = "Option::is_none")] + pub line1: Option<&'a str>, + /// Address line 2 (e.g., apartment, suite, unit, or building). + #[serde(skip_serializing_if = "Option::is_none")] + pub line2: Option<&'a str>, + /// ZIP or postal code. + #[serde(skip_serializing_if = "Option::is_none")] + pub postal_code: Option<&'a str>, + /// State, county, province, or region. + #[serde(skip_serializing_if = "Option::is_none")] + pub state: Option<&'a str>, +} +impl<'a> ConfirmPaymentIntentPaymentMethodDataBillingDetailsAddress<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// If this is a `boleto` PaymentMethod, this hash contains details about the Boleto payment method. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct ConfirmPaymentIntentPaymentMethodDataBoleto<'a> { + /// The tax ID of the customer (CPF for individual consumers or CNPJ for businesses consumers) + pub tax_id: &'a str, +} +impl<'a> ConfirmPaymentIntentPaymentMethodDataBoleto<'a> { + pub fn new(tax_id: &'a str) -> Self { + Self { tax_id } + } +} +/// If this is an `eps` PaymentMethod, this hash contains details about the EPS payment method. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct ConfirmPaymentIntentPaymentMethodDataEps { + /// The customer's bank. + #[serde(skip_serializing_if = "Option::is_none")] + pub bank: Option, +} +impl ConfirmPaymentIntentPaymentMethodDataEps { + pub fn new() -> Self { + Self::default() + } +} +/// The customer's bank. +#[derive(Copy, Clone, Eq, PartialEq)] +#[non_exhaustive] +pub enum ConfirmPaymentIntentPaymentMethodDataEpsBank { + ArzteUndApothekerBank, + AustrianAnadiBankAg, + BankAustria, + BankhausCarlSpangler, + BankhausSchelhammerUndSchatteraAg, + BawagPskAg, + BksBankAg, + BrullKallmusBankAg, + BtvVierLanderBank, + CapitalBankGraweGruppeAg, + DeutscheBankAg, + Dolomitenbank, + EasybankAg, + ErsteBankUndSparkassen, + HypoAlpeadriabankInternationalAg, + HypoBankBurgenlandAktiengesellschaft, + HypoNoeLbFurNiederosterreichUWien, + HypoOberosterreichSalzburgSteiermark, + HypoTirolBankAg, + HypoVorarlbergBankAg, + MarchfelderBank, + OberbankAg, + RaiffeisenBankengruppeOsterreich, + SchoellerbankAg, + SpardaBankWien, + VolksbankGruppe, + VolkskreditbankAg, + VrBankBraunau, + /// An unrecognized value from Stripe. Should not be used as a request parameter. + Unknown, +} +impl ConfirmPaymentIntentPaymentMethodDataEpsBank { + pub fn as_str(self) -> &'static str { + use ConfirmPaymentIntentPaymentMethodDataEpsBank::*; + match self { + ArzteUndApothekerBank => "arzte_und_apotheker_bank", + AustrianAnadiBankAg => "austrian_anadi_bank_ag", + BankAustria => "bank_austria", + BankhausCarlSpangler => "bankhaus_carl_spangler", + BankhausSchelhammerUndSchatteraAg => "bankhaus_schelhammer_und_schattera_ag", + BawagPskAg => "bawag_psk_ag", + BksBankAg => "bks_bank_ag", + BrullKallmusBankAg => "brull_kallmus_bank_ag", + BtvVierLanderBank => "btv_vier_lander_bank", + CapitalBankGraweGruppeAg => "capital_bank_grawe_gruppe_ag", + DeutscheBankAg => "deutsche_bank_ag", + Dolomitenbank => "dolomitenbank", + EasybankAg => "easybank_ag", + ErsteBankUndSparkassen => "erste_bank_und_sparkassen", + HypoAlpeadriabankInternationalAg => "hypo_alpeadriabank_international_ag", + HypoBankBurgenlandAktiengesellschaft => "hypo_bank_burgenland_aktiengesellschaft", + HypoNoeLbFurNiederosterreichUWien => "hypo_noe_lb_fur_niederosterreich_u_wien", + HypoOberosterreichSalzburgSteiermark => "hypo_oberosterreich_salzburg_steiermark", + HypoTirolBankAg => "hypo_tirol_bank_ag", + HypoVorarlbergBankAg => "hypo_vorarlberg_bank_ag", + MarchfelderBank => "marchfelder_bank", + OberbankAg => "oberbank_ag", + RaiffeisenBankengruppeOsterreich => "raiffeisen_bankengruppe_osterreich", + SchoellerbankAg => "schoellerbank_ag", + SpardaBankWien => "sparda_bank_wien", + VolksbankGruppe => "volksbank_gruppe", + VolkskreditbankAg => "volkskreditbank_ag", + VrBankBraunau => "vr_bank_braunau", + Unknown => "unknown", + } + } +} + +impl std::str::FromStr for ConfirmPaymentIntentPaymentMethodDataEpsBank { + type Err = (); + fn from_str(s: &str) -> Result { + use ConfirmPaymentIntentPaymentMethodDataEpsBank::*; + match s { + "arzte_und_apotheker_bank" => Ok(ArzteUndApothekerBank), + "austrian_anadi_bank_ag" => Ok(AustrianAnadiBankAg), + "bank_austria" => Ok(BankAustria), + "bankhaus_carl_spangler" => Ok(BankhausCarlSpangler), + "bankhaus_schelhammer_und_schattera_ag" => Ok(BankhausSchelhammerUndSchatteraAg), + "bawag_psk_ag" => Ok(BawagPskAg), + "bks_bank_ag" => Ok(BksBankAg), + "brull_kallmus_bank_ag" => Ok(BrullKallmusBankAg), + "btv_vier_lander_bank" => Ok(BtvVierLanderBank), + "capital_bank_grawe_gruppe_ag" => Ok(CapitalBankGraweGruppeAg), + "deutsche_bank_ag" => Ok(DeutscheBankAg), + "dolomitenbank" => Ok(Dolomitenbank), + "easybank_ag" => Ok(EasybankAg), + "erste_bank_und_sparkassen" => Ok(ErsteBankUndSparkassen), + "hypo_alpeadriabank_international_ag" => Ok(HypoAlpeadriabankInternationalAg), + "hypo_bank_burgenland_aktiengesellschaft" => Ok(HypoBankBurgenlandAktiengesellschaft), + "hypo_noe_lb_fur_niederosterreich_u_wien" => Ok(HypoNoeLbFurNiederosterreichUWien), + "hypo_oberosterreich_salzburg_steiermark" => Ok(HypoOberosterreichSalzburgSteiermark), + "hypo_tirol_bank_ag" => Ok(HypoTirolBankAg), + "hypo_vorarlberg_bank_ag" => Ok(HypoVorarlbergBankAg), + "marchfelder_bank" => Ok(MarchfelderBank), + "oberbank_ag" => Ok(OberbankAg), + "raiffeisen_bankengruppe_osterreich" => Ok(RaiffeisenBankengruppeOsterreich), + "schoellerbank_ag" => Ok(SchoellerbankAg), + "sparda_bank_wien" => Ok(SpardaBankWien), + "volksbank_gruppe" => Ok(VolksbankGruppe), + "volkskreditbank_ag" => Ok(VolkskreditbankAg), + "vr_bank_braunau" => Ok(VrBankBraunau), + _ => Err(()), + } + } +} +impl std::fmt::Display for ConfirmPaymentIntentPaymentMethodDataEpsBank { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for ConfirmPaymentIntentPaymentMethodDataEpsBank { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for ConfirmPaymentIntentPaymentMethodDataEpsBank { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// If this is an `fpx` PaymentMethod, this hash contains details about the FPX payment method. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct ConfirmPaymentIntentPaymentMethodDataFpx { + /// Account holder type for FPX transaction + #[serde(skip_serializing_if = "Option::is_none")] + pub account_holder_type: Option, + /// The customer's bank. + pub bank: ConfirmPaymentIntentPaymentMethodDataFpxBank, +} +impl ConfirmPaymentIntentPaymentMethodDataFpx { + pub fn new(bank: ConfirmPaymentIntentPaymentMethodDataFpxBank) -> Self { + Self { account_holder_type: None, bank } + } +} +/// Account holder type for FPX transaction +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum ConfirmPaymentIntentPaymentMethodDataFpxAccountHolderType { + Company, + Individual, +} +impl ConfirmPaymentIntentPaymentMethodDataFpxAccountHolderType { + pub fn as_str(self) -> &'static str { + use ConfirmPaymentIntentPaymentMethodDataFpxAccountHolderType::*; + match self { + Company => "company", + Individual => "individual", + } + } +} + +impl std::str::FromStr for ConfirmPaymentIntentPaymentMethodDataFpxAccountHolderType { + type Err = (); + fn from_str(s: &str) -> Result { + use ConfirmPaymentIntentPaymentMethodDataFpxAccountHolderType::*; + match s { + "company" => Ok(Company), + "individual" => Ok(Individual), + _ => Err(()), + } + } +} +impl std::fmt::Display for ConfirmPaymentIntentPaymentMethodDataFpxAccountHolderType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for ConfirmPaymentIntentPaymentMethodDataFpxAccountHolderType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for ConfirmPaymentIntentPaymentMethodDataFpxAccountHolderType { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// The customer's bank. +#[derive(Copy, Clone, Eq, PartialEq)] +#[non_exhaustive] +pub enum ConfirmPaymentIntentPaymentMethodDataFpxBank { + AffinBank, + Agrobank, + AllianceBank, + Ambank, + BankIslam, + BankMuamalat, + BankOfChina, + BankRakyat, + Bsn, + Cimb, + DeutscheBank, + HongLeongBank, + Hsbc, + Kfh, + Maybank2e, + Maybank2u, + Ocbc, + PbEnterprise, + PublicBank, + Rhb, + StandardChartered, + Uob, + /// An unrecognized value from Stripe. Should not be used as a request parameter. + Unknown, +} +impl ConfirmPaymentIntentPaymentMethodDataFpxBank { + pub fn as_str(self) -> &'static str { + use ConfirmPaymentIntentPaymentMethodDataFpxBank::*; + match self { + AffinBank => "affin_bank", + Agrobank => "agrobank", + AllianceBank => "alliance_bank", + Ambank => "ambank", + BankIslam => "bank_islam", + BankMuamalat => "bank_muamalat", + BankOfChina => "bank_of_china", + BankRakyat => "bank_rakyat", + Bsn => "bsn", + Cimb => "cimb", + DeutscheBank => "deutsche_bank", + HongLeongBank => "hong_leong_bank", + Hsbc => "hsbc", + Kfh => "kfh", + Maybank2e => "maybank2e", + Maybank2u => "maybank2u", + Ocbc => "ocbc", + PbEnterprise => "pb_enterprise", + PublicBank => "public_bank", + Rhb => "rhb", + StandardChartered => "standard_chartered", + Uob => "uob", + Unknown => "unknown", + } + } +} + +impl std::str::FromStr for ConfirmPaymentIntentPaymentMethodDataFpxBank { + type Err = (); + fn from_str(s: &str) -> Result { + use ConfirmPaymentIntentPaymentMethodDataFpxBank::*; + match s { + "affin_bank" => Ok(AffinBank), + "agrobank" => Ok(Agrobank), + "alliance_bank" => Ok(AllianceBank), + "ambank" => Ok(Ambank), + "bank_islam" => Ok(BankIslam), + "bank_muamalat" => Ok(BankMuamalat), + "bank_of_china" => Ok(BankOfChina), + "bank_rakyat" => Ok(BankRakyat), + "bsn" => Ok(Bsn), + "cimb" => Ok(Cimb), + "deutsche_bank" => Ok(DeutscheBank), + "hong_leong_bank" => Ok(HongLeongBank), + "hsbc" => Ok(Hsbc), + "kfh" => Ok(Kfh), + "maybank2e" => Ok(Maybank2e), + "maybank2u" => Ok(Maybank2u), + "ocbc" => Ok(Ocbc), + "pb_enterprise" => Ok(PbEnterprise), + "public_bank" => Ok(PublicBank), + "rhb" => Ok(Rhb), + "standard_chartered" => Ok(StandardChartered), + "uob" => Ok(Uob), + _ => Err(()), + } + } +} +impl std::fmt::Display for ConfirmPaymentIntentPaymentMethodDataFpxBank { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for ConfirmPaymentIntentPaymentMethodDataFpxBank { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for ConfirmPaymentIntentPaymentMethodDataFpxBank { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// If this is an `ideal` PaymentMethod, this hash contains details about the iDEAL payment method. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct ConfirmPaymentIntentPaymentMethodDataIdeal { + /// The customer's bank. + #[serde(skip_serializing_if = "Option::is_none")] + pub bank: Option, +} +impl ConfirmPaymentIntentPaymentMethodDataIdeal { + pub fn new() -> Self { + Self::default() + } +} +/// The customer's bank. +#[derive(Copy, Clone, Eq, PartialEq)] +#[non_exhaustive] +pub enum ConfirmPaymentIntentPaymentMethodDataIdealBank { + AbnAmro, + AsnBank, + Bunq, + Handelsbanken, + Ing, + Knab, + Moneyou, + N26, + Nn, + Rabobank, + Regiobank, + Revolut, + SnsBank, + TriodosBank, + VanLanschot, + Yoursafe, + /// An unrecognized value from Stripe. Should not be used as a request parameter. + Unknown, +} +impl ConfirmPaymentIntentPaymentMethodDataIdealBank { + pub fn as_str(self) -> &'static str { + use ConfirmPaymentIntentPaymentMethodDataIdealBank::*; + match self { + AbnAmro => "abn_amro", + AsnBank => "asn_bank", + Bunq => "bunq", + Handelsbanken => "handelsbanken", + Ing => "ing", + Knab => "knab", + Moneyou => "moneyou", + N26 => "n26", + Nn => "nn", + Rabobank => "rabobank", + Regiobank => "regiobank", + Revolut => "revolut", + SnsBank => "sns_bank", + TriodosBank => "triodos_bank", + VanLanschot => "van_lanschot", + Yoursafe => "yoursafe", + Unknown => "unknown", + } + } +} + +impl std::str::FromStr for ConfirmPaymentIntentPaymentMethodDataIdealBank { + type Err = (); + fn from_str(s: &str) -> Result { + use ConfirmPaymentIntentPaymentMethodDataIdealBank::*; + match s { + "abn_amro" => Ok(AbnAmro), + "asn_bank" => Ok(AsnBank), + "bunq" => Ok(Bunq), + "handelsbanken" => Ok(Handelsbanken), + "ing" => Ok(Ing), + "knab" => Ok(Knab), + "moneyou" => Ok(Moneyou), + "n26" => Ok(N26), + "nn" => Ok(Nn), + "rabobank" => Ok(Rabobank), + "regiobank" => Ok(Regiobank), + "revolut" => Ok(Revolut), + "sns_bank" => Ok(SnsBank), + "triodos_bank" => Ok(TriodosBank), + "van_lanschot" => Ok(VanLanschot), + "yoursafe" => Ok(Yoursafe), + _ => Err(()), + } + } +} +impl std::fmt::Display for ConfirmPaymentIntentPaymentMethodDataIdealBank { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for ConfirmPaymentIntentPaymentMethodDataIdealBank { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for ConfirmPaymentIntentPaymentMethodDataIdealBank { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// If this is a `klarna` PaymentMethod, this hash contains details about the Klarna payment method. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct ConfirmPaymentIntentPaymentMethodDataKlarna { + /// Customer's date of birth + #[serde(skip_serializing_if = "Option::is_none")] + pub dob: Option, +} +impl ConfirmPaymentIntentPaymentMethodDataKlarna { + pub fn new() -> Self { + Self::default() + } +} +/// If this is a `p24` PaymentMethod, this hash contains details about the P24 payment method. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct ConfirmPaymentIntentPaymentMethodDataP24 { + /// The customer's bank. + #[serde(skip_serializing_if = "Option::is_none")] + pub bank: Option, +} +impl ConfirmPaymentIntentPaymentMethodDataP24 { + pub fn new() -> Self { + Self::default() + } +} +/// The customer's bank. +#[derive(Copy, Clone, Eq, PartialEq)] +#[non_exhaustive] +pub enum ConfirmPaymentIntentPaymentMethodDataP24Bank { + AliorBank, + BankMillennium, + BankNowyBfgSa, + BankPekaoSa, + BankiSpbdzielcze, + Blik, + BnpParibas, + Boz, + CitiHandlowy, + CreditAgricole, + Envelobank, + EtransferPocztowy24, + GetinBank, + Ideabank, + Ing, + Inteligo, + MbankMtransfer, + NestPrzelew, + NoblePay, + PbacZIpko, + PlusBank, + SantanderPrzelew24, + TmobileUsbugiBankowe, + ToyotaBank, + Velobank, + VolkswagenBank, + /// An unrecognized value from Stripe. Should not be used as a request parameter. + Unknown, +} +impl ConfirmPaymentIntentPaymentMethodDataP24Bank { + pub fn as_str(self) -> &'static str { + use ConfirmPaymentIntentPaymentMethodDataP24Bank::*; + match self { + AliorBank => "alior_bank", + BankMillennium => "bank_millennium", + BankNowyBfgSa => "bank_nowy_bfg_sa", + BankPekaoSa => "bank_pekao_sa", + BankiSpbdzielcze => "banki_spbdzielcze", + Blik => "blik", + BnpParibas => "bnp_paribas", + Boz => "boz", + CitiHandlowy => "citi_handlowy", + CreditAgricole => "credit_agricole", + Envelobank => "envelobank", + EtransferPocztowy24 => "etransfer_pocztowy24", + GetinBank => "getin_bank", + Ideabank => "ideabank", + Ing => "ing", + Inteligo => "inteligo", + MbankMtransfer => "mbank_mtransfer", + NestPrzelew => "nest_przelew", + NoblePay => "noble_pay", + PbacZIpko => "pbac_z_ipko", + PlusBank => "plus_bank", + SantanderPrzelew24 => "santander_przelew24", + TmobileUsbugiBankowe => "tmobile_usbugi_bankowe", + ToyotaBank => "toyota_bank", + Velobank => "velobank", + VolkswagenBank => "volkswagen_bank", + Unknown => "unknown", + } + } +} + +impl std::str::FromStr for ConfirmPaymentIntentPaymentMethodDataP24Bank { + type Err = (); + fn from_str(s: &str) -> Result { + use ConfirmPaymentIntentPaymentMethodDataP24Bank::*; + match s { + "alior_bank" => Ok(AliorBank), + "bank_millennium" => Ok(BankMillennium), + "bank_nowy_bfg_sa" => Ok(BankNowyBfgSa), + "bank_pekao_sa" => Ok(BankPekaoSa), + "banki_spbdzielcze" => Ok(BankiSpbdzielcze), + "blik" => Ok(Blik), + "bnp_paribas" => Ok(BnpParibas), + "boz" => Ok(Boz), + "citi_handlowy" => Ok(CitiHandlowy), + "credit_agricole" => Ok(CreditAgricole), + "envelobank" => Ok(Envelobank), + "etransfer_pocztowy24" => Ok(EtransferPocztowy24), + "getin_bank" => Ok(GetinBank), + "ideabank" => Ok(Ideabank), + "ing" => Ok(Ing), + "inteligo" => Ok(Inteligo), + "mbank_mtransfer" => Ok(MbankMtransfer), + "nest_przelew" => Ok(NestPrzelew), + "noble_pay" => Ok(NoblePay), + "pbac_z_ipko" => Ok(PbacZIpko), + "plus_bank" => Ok(PlusBank), + "santander_przelew24" => Ok(SantanderPrzelew24), + "tmobile_usbugi_bankowe" => Ok(TmobileUsbugiBankowe), + "toyota_bank" => Ok(ToyotaBank), + "velobank" => Ok(Velobank), + "volkswagen_bank" => Ok(VolkswagenBank), + _ => Err(()), + } + } +} +impl std::fmt::Display for ConfirmPaymentIntentPaymentMethodDataP24Bank { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for ConfirmPaymentIntentPaymentMethodDataP24Bank { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for ConfirmPaymentIntentPaymentMethodDataP24Bank { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Options to configure Radar. +/// See [Radar Session](https://stripe.com/docs/radar/radar-session) for more information. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct ConfirmPaymentIntentPaymentMethodDataRadarOptions<'a> { + /// A [Radar Session](https://stripe.com/docs/radar/radar-session) is a snapshot of the browser metadata and device details that help Radar make more accurate predictions on your payments. + #[serde(skip_serializing_if = "Option::is_none")] + pub session: Option<&'a str>, +} +impl<'a> ConfirmPaymentIntentPaymentMethodDataRadarOptions<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// If this is a `sepa_debit` PaymentMethod, this hash contains details about the SEPA debit bank account. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct ConfirmPaymentIntentPaymentMethodDataSepaDebit<'a> { + /// IBAN of the bank account. + pub iban: &'a str, +} +impl<'a> ConfirmPaymentIntentPaymentMethodDataSepaDebit<'a> { + pub fn new(iban: &'a str) -> Self { + Self { iban } + } +} +/// If this is a `sofort` PaymentMethod, this hash contains details about the SOFORT payment method. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct ConfirmPaymentIntentPaymentMethodDataSofort { + /// Two-letter ISO code representing the country the bank account is located in. + pub country: ConfirmPaymentIntentPaymentMethodDataSofortCountry, +} +impl ConfirmPaymentIntentPaymentMethodDataSofort { + pub fn new(country: ConfirmPaymentIntentPaymentMethodDataSofortCountry) -> Self { + Self { country } + } +} +/// Two-letter ISO code representing the country the bank account is located in. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum ConfirmPaymentIntentPaymentMethodDataSofortCountry { + At, + Be, + De, + Es, + It, + Nl, +} +impl ConfirmPaymentIntentPaymentMethodDataSofortCountry { + pub fn as_str(self) -> &'static str { + use ConfirmPaymentIntentPaymentMethodDataSofortCountry::*; + match self { + At => "AT", + Be => "BE", + De => "DE", + Es => "ES", + It => "IT", + Nl => "NL", + } + } +} + +impl std::str::FromStr for ConfirmPaymentIntentPaymentMethodDataSofortCountry { + type Err = (); + fn from_str(s: &str) -> Result { + use ConfirmPaymentIntentPaymentMethodDataSofortCountry::*; + match s { + "AT" => Ok(At), + "BE" => Ok(Be), + "DE" => Ok(De), + "ES" => Ok(Es), + "IT" => Ok(It), + "NL" => Ok(Nl), + _ => Err(()), + } + } +} +impl std::fmt::Display for ConfirmPaymentIntentPaymentMethodDataSofortCountry { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for ConfirmPaymentIntentPaymentMethodDataSofortCountry { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for ConfirmPaymentIntentPaymentMethodDataSofortCountry { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// The type of the PaymentMethod. +/// An additional hash is included on the PaymentMethod with a name matching this value. +/// It contains additional information specific to the PaymentMethod type. +#[derive(Copy, Clone, Eq, PartialEq)] +#[non_exhaustive] +pub enum ConfirmPaymentIntentPaymentMethodDataType { + AcssDebit, + Affirm, + AfterpayClearpay, + Alipay, + AuBecsDebit, + BacsDebit, + Bancontact, + Blik, + Boleto, + Cashapp, + CustomerBalance, + Eps, + Fpx, + Giropay, + Grabpay, + Ideal, + Klarna, + Konbini, + Link, + Oxxo, + P24, + Paynow, + Paypal, + Pix, + Promptpay, + RevolutPay, + SepaDebit, + Sofort, + Swish, + UsBankAccount, + WechatPay, + Zip, + /// An unrecognized value from Stripe. Should not be used as a request parameter. + Unknown, +} +impl ConfirmPaymentIntentPaymentMethodDataType { + pub fn as_str(self) -> &'static str { + use ConfirmPaymentIntentPaymentMethodDataType::*; + match self { + AcssDebit => "acss_debit", + Affirm => "affirm", + AfterpayClearpay => "afterpay_clearpay", + Alipay => "alipay", + AuBecsDebit => "au_becs_debit", + BacsDebit => "bacs_debit", + Bancontact => "bancontact", + Blik => "blik", + Boleto => "boleto", + Cashapp => "cashapp", + CustomerBalance => "customer_balance", + Eps => "eps", + Fpx => "fpx", + Giropay => "giropay", + Grabpay => "grabpay", + Ideal => "ideal", + Klarna => "klarna", + Konbini => "konbini", + Link => "link", + Oxxo => "oxxo", + P24 => "p24", + Paynow => "paynow", + Paypal => "paypal", + Pix => "pix", + Promptpay => "promptpay", + RevolutPay => "revolut_pay", + SepaDebit => "sepa_debit", + Sofort => "sofort", + Swish => "swish", + UsBankAccount => "us_bank_account", + WechatPay => "wechat_pay", + Zip => "zip", + Unknown => "unknown", + } + } +} + +impl std::str::FromStr for ConfirmPaymentIntentPaymentMethodDataType { + type Err = (); + fn from_str(s: &str) -> Result { + use ConfirmPaymentIntentPaymentMethodDataType::*; + match s { + "acss_debit" => Ok(AcssDebit), + "affirm" => Ok(Affirm), + "afterpay_clearpay" => Ok(AfterpayClearpay), + "alipay" => Ok(Alipay), + "au_becs_debit" => Ok(AuBecsDebit), + "bacs_debit" => Ok(BacsDebit), + "bancontact" => Ok(Bancontact), + "blik" => Ok(Blik), + "boleto" => Ok(Boleto), + "cashapp" => Ok(Cashapp), + "customer_balance" => Ok(CustomerBalance), + "eps" => Ok(Eps), + "fpx" => Ok(Fpx), + "giropay" => Ok(Giropay), + "grabpay" => Ok(Grabpay), + "ideal" => Ok(Ideal), + "klarna" => Ok(Klarna), + "konbini" => Ok(Konbini), + "link" => Ok(Link), + "oxxo" => Ok(Oxxo), + "p24" => Ok(P24), + "paynow" => Ok(Paynow), + "paypal" => Ok(Paypal), + "pix" => Ok(Pix), + "promptpay" => Ok(Promptpay), + "revolut_pay" => Ok(RevolutPay), + "sepa_debit" => Ok(SepaDebit), + "sofort" => Ok(Sofort), + "swish" => Ok(Swish), + "us_bank_account" => Ok(UsBankAccount), + "wechat_pay" => Ok(WechatPay), + "zip" => Ok(Zip), + _ => Err(()), + } + } +} +impl std::fmt::Display for ConfirmPaymentIntentPaymentMethodDataType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for ConfirmPaymentIntentPaymentMethodDataType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for ConfirmPaymentIntentPaymentMethodDataType { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// If this is an `us_bank_account` PaymentMethod, this hash contains details about the US bank account payment method. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct ConfirmPaymentIntentPaymentMethodDataUsBankAccount<'a> { + /// Account holder type: individual or company. + #[serde(skip_serializing_if = "Option::is_none")] + pub account_holder_type: + Option, + /// Account number of the bank account. + #[serde(skip_serializing_if = "Option::is_none")] + pub account_number: Option<&'a str>, + /// Account type: checkings or savings. Defaults to checking if omitted. + #[serde(skip_serializing_if = "Option::is_none")] + pub account_type: Option, + /// The ID of a Financial Connections Account to use as a payment method. + #[serde(skip_serializing_if = "Option::is_none")] + pub financial_connections_account: Option<&'a str>, + /// Routing number of the bank account. + #[serde(skip_serializing_if = "Option::is_none")] + pub routing_number: Option<&'a str>, +} +impl<'a> ConfirmPaymentIntentPaymentMethodDataUsBankAccount<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// Account holder type: individual or company. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum ConfirmPaymentIntentPaymentMethodDataUsBankAccountAccountHolderType { + Company, + Individual, +} +impl ConfirmPaymentIntentPaymentMethodDataUsBankAccountAccountHolderType { + pub fn as_str(self) -> &'static str { + use ConfirmPaymentIntentPaymentMethodDataUsBankAccountAccountHolderType::*; + match self { + Company => "company", + Individual => "individual", + } + } +} + +impl std::str::FromStr for ConfirmPaymentIntentPaymentMethodDataUsBankAccountAccountHolderType { + type Err = (); + fn from_str(s: &str) -> Result { + use ConfirmPaymentIntentPaymentMethodDataUsBankAccountAccountHolderType::*; + match s { + "company" => Ok(Company), + "individual" => Ok(Individual), + _ => Err(()), + } + } +} +impl std::fmt::Display for ConfirmPaymentIntentPaymentMethodDataUsBankAccountAccountHolderType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for ConfirmPaymentIntentPaymentMethodDataUsBankAccountAccountHolderType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for ConfirmPaymentIntentPaymentMethodDataUsBankAccountAccountHolderType { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Account type: checkings or savings. Defaults to checking if omitted. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum ConfirmPaymentIntentPaymentMethodDataUsBankAccountAccountType { + Checking, + Savings, +} +impl ConfirmPaymentIntentPaymentMethodDataUsBankAccountAccountType { + pub fn as_str(self) -> &'static str { + use ConfirmPaymentIntentPaymentMethodDataUsBankAccountAccountType::*; + match self { + Checking => "checking", + Savings => "savings", + } + } +} + +impl std::str::FromStr for ConfirmPaymentIntentPaymentMethodDataUsBankAccountAccountType { + type Err = (); + fn from_str(s: &str) -> Result { + use ConfirmPaymentIntentPaymentMethodDataUsBankAccountAccountType::*; + match s { + "checking" => Ok(Checking), + "savings" => Ok(Savings), + _ => Err(()), + } + } +} +impl std::fmt::Display for ConfirmPaymentIntentPaymentMethodDataUsBankAccountAccountType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for ConfirmPaymentIntentPaymentMethodDataUsBankAccountAccountType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for ConfirmPaymentIntentPaymentMethodDataUsBankAccountAccountType { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Payment method-specific configuration for this PaymentIntent. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct ConfirmPaymentIntentPaymentMethodOptions<'a> { + /// If this is a `acss_debit` PaymentMethod, this sub-hash contains details about the ACSS Debit payment method options. + #[serde(skip_serializing_if = "Option::is_none")] + pub acss_debit: Option>, + /// If this is an `affirm` PaymentMethod, this sub-hash contains details about the Affirm payment method options. + #[serde(skip_serializing_if = "Option::is_none")] + pub affirm: Option>, + /// If this is a `afterpay_clearpay` PaymentMethod, this sub-hash contains details about the Afterpay Clearpay payment method options. + #[serde(skip_serializing_if = "Option::is_none")] + pub afterpay_clearpay: Option>, + /// If this is a `alipay` PaymentMethod, this sub-hash contains details about the Alipay payment method options. + #[serde(skip_serializing_if = "Option::is_none")] + pub alipay: Option, + /// If this is a `au_becs_debit` PaymentMethod, this sub-hash contains details about the AU BECS Direct Debit payment method options. + #[serde(skip_serializing_if = "Option::is_none")] + pub au_becs_debit: Option, + /// If this is a `bacs_debit` PaymentMethod, this sub-hash contains details about the BACS Debit payment method options. + #[serde(skip_serializing_if = "Option::is_none")] + pub bacs_debit: Option, + /// If this is a `bancontact` PaymentMethod, this sub-hash contains details about the Bancontact payment method options. + #[serde(skip_serializing_if = "Option::is_none")] + pub bancontact: Option, + /// If this is a `blik` PaymentMethod, this sub-hash contains details about the BLIK payment method options. + #[serde(skip_serializing_if = "Option::is_none")] + pub blik: Option>, + /// If this is a `boleto` PaymentMethod, this sub-hash contains details about the Boleto payment method options. + #[serde(skip_serializing_if = "Option::is_none")] + pub boleto: Option, + /// Configuration for any card payments attempted on this PaymentIntent. + #[serde(skip_serializing_if = "Option::is_none")] + pub card: Option>, + /// If this is a `card_present` PaymentMethod, this sub-hash contains details about the Card Present payment method options. + #[serde(skip_serializing_if = "Option::is_none")] + pub card_present: Option, + /// If this is a `cashapp` PaymentMethod, this sub-hash contains details about the Cash App Pay payment method options. + #[serde(skip_serializing_if = "Option::is_none")] + pub cashapp: Option, + /// If this is a `customer balance` PaymentMethod, this sub-hash contains details about the customer balance payment method options. + #[serde(skip_serializing_if = "Option::is_none")] + pub customer_balance: Option>, + /// If this is a `eps` PaymentMethod, this sub-hash contains details about the EPS payment method options. + #[serde(skip_serializing_if = "Option::is_none")] + pub eps: Option, + /// If this is a `fpx` PaymentMethod, this sub-hash contains details about the FPX payment method options. + #[serde(skip_serializing_if = "Option::is_none")] + pub fpx: Option, + /// If this is a `giropay` PaymentMethod, this sub-hash contains details about the Giropay payment method options. + #[serde(skip_serializing_if = "Option::is_none")] + pub giropay: Option, + /// If this is a `grabpay` PaymentMethod, this sub-hash contains details about the Grabpay payment method options. + #[serde(skip_serializing_if = "Option::is_none")] + pub grabpay: Option, + /// If this is a `ideal` PaymentMethod, this sub-hash contains details about the Ideal payment method options. + #[serde(skip_serializing_if = "Option::is_none")] + pub ideal: Option, + /// If this is a `interac_present` PaymentMethod, this sub-hash contains details about the Card Present payment method options. + #[serde(skip_serializing_if = "Option::is_none")] + pub interac_present: Option<&'a serde_json::Value>, + /// If this is a `klarna` PaymentMethod, this sub-hash contains details about the Klarna payment method options. + #[serde(skip_serializing_if = "Option::is_none")] + pub klarna: Option, + /// If this is a `konbini` PaymentMethod, this sub-hash contains details about the Konbini payment method options. + #[serde(skip_serializing_if = "Option::is_none")] + pub konbini: Option>, + /// If this is a `link` PaymentMethod, this sub-hash contains details about the Link payment method options. + #[serde(skip_serializing_if = "Option::is_none")] + pub link: Option>, + /// If this is a `oxxo` PaymentMethod, this sub-hash contains details about the OXXO payment method options. + #[serde(skip_serializing_if = "Option::is_none")] + pub oxxo: Option, + /// If this is a `p24` PaymentMethod, this sub-hash contains details about the Przelewy24 payment method options. + #[serde(skip_serializing_if = "Option::is_none")] + pub p24: Option, + /// If this is a `paynow` PaymentMethod, this sub-hash contains details about the PayNow payment method options. + #[serde(skip_serializing_if = "Option::is_none")] + pub paynow: Option, + /// If this is a `paypal` PaymentMethod, this sub-hash contains details about the PayPal payment method options. + #[serde(skip_serializing_if = "Option::is_none")] + pub paypal: Option>, + /// If this is a `pix` PaymentMethod, this sub-hash contains details about the Pix payment method options. + #[serde(skip_serializing_if = "Option::is_none")] + pub pix: Option, + /// If this is a `promptpay` PaymentMethod, this sub-hash contains details about the PromptPay payment method options. + #[serde(skip_serializing_if = "Option::is_none")] + pub promptpay: Option, + /// If this is a `revolut_pay` PaymentMethod, this sub-hash contains details about the Revolut Pay payment method options. + #[serde(skip_serializing_if = "Option::is_none")] + pub revolut_pay: Option, + /// If this is a `sepa_debit` PaymentIntent, this sub-hash contains details about the SEPA Debit payment method options. + #[serde(skip_serializing_if = "Option::is_none")] + pub sepa_debit: Option>, + /// If this is a `sofort` PaymentMethod, this sub-hash contains details about the SOFORT payment method options. + #[serde(skip_serializing_if = "Option::is_none")] + pub sofort: Option, + /// If this is a `Swish` PaymentMethod, this sub-hash contains details about the Swish payment method options. + #[serde(skip_serializing_if = "Option::is_none")] + pub swish: Option>, + /// If this is a `us_bank_account` PaymentMethod, this sub-hash contains details about the US bank account payment method options. + #[serde(skip_serializing_if = "Option::is_none")] + pub us_bank_account: Option>, + /// If this is a `wechat_pay` PaymentMethod, this sub-hash contains details about the WeChat Pay payment method options. + #[serde(skip_serializing_if = "Option::is_none")] + pub wechat_pay: Option>, + /// If this is a `zip` PaymentMethod, this sub-hash contains details about the Zip payment method options. + #[serde(skip_serializing_if = "Option::is_none")] + pub zip: Option, +} +impl<'a> ConfirmPaymentIntentPaymentMethodOptions<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// If this is a `acss_debit` PaymentMethod, this sub-hash contains details about the ACSS Debit payment method options. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct ConfirmPaymentIntentPaymentMethodOptionsAcssDebit<'a> { + /// Additional fields for Mandate creation + #[serde(skip_serializing_if = "Option::is_none")] + pub mandate_options: + Option>, + /// Indicates that you intend to make future payments with this PaymentIntent's payment method. + /// + /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. + /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + /// + /// When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + /// + /// If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. + #[serde(skip_serializing_if = "Option::is_none")] + pub setup_future_usage: + Option, + /// Bank account verification method. + #[serde(skip_serializing_if = "Option::is_none")] + pub verification_method: + Option, +} +impl<'a> ConfirmPaymentIntentPaymentMethodOptionsAcssDebit<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// Additional fields for Mandate creation +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct ConfirmPaymentIntentPaymentMethodOptionsAcssDebitMandateOptions<'a> { + /// A URL for custom mandate text to render during confirmation step. + /// The URL will be rendered with additional GET parameters `payment_intent` and `payment_intent_client_secret` when confirming a Payment Intent,. + /// or `setup_intent` and `setup_intent_client_secret` when confirming a Setup Intent. + #[serde(skip_serializing_if = "Option::is_none")] + pub custom_mandate_url: Option<&'a str>, + /// Description of the mandate interval. + /// Only required if 'payment_schedule' parameter is 'interval' or 'combined'. + #[serde(skip_serializing_if = "Option::is_none")] + pub interval_description: Option<&'a str>, + /// Payment schedule for the mandate. + #[serde(skip_serializing_if = "Option::is_none")] + pub payment_schedule: + Option, + /// Transaction type of the mandate. + #[serde(skip_serializing_if = "Option::is_none")] + pub transaction_type: + Option, +} +impl<'a> ConfirmPaymentIntentPaymentMethodOptionsAcssDebitMandateOptions<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// Payment schedule for the mandate. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum ConfirmPaymentIntentPaymentMethodOptionsAcssDebitMandateOptionsPaymentSchedule { + Combined, + Interval, + Sporadic, +} +impl ConfirmPaymentIntentPaymentMethodOptionsAcssDebitMandateOptionsPaymentSchedule { + pub fn as_str(self) -> &'static str { + use ConfirmPaymentIntentPaymentMethodOptionsAcssDebitMandateOptionsPaymentSchedule::*; + match self { + Combined => "combined", + Interval => "interval", + Sporadic => "sporadic", + } + } +} + +impl std::str::FromStr + for ConfirmPaymentIntentPaymentMethodOptionsAcssDebitMandateOptionsPaymentSchedule +{ + type Err = (); + fn from_str(s: &str) -> Result { + use ConfirmPaymentIntentPaymentMethodOptionsAcssDebitMandateOptionsPaymentSchedule::*; + match s { + "combined" => Ok(Combined), + "interval" => Ok(Interval), + "sporadic" => Ok(Sporadic), + _ => Err(()), + } + } +} +impl std::fmt::Display + for ConfirmPaymentIntentPaymentMethodOptionsAcssDebitMandateOptionsPaymentSchedule +{ + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug + for ConfirmPaymentIntentPaymentMethodOptionsAcssDebitMandateOptionsPaymentSchedule +{ + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize + for ConfirmPaymentIntentPaymentMethodOptionsAcssDebitMandateOptionsPaymentSchedule +{ + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Transaction type of the mandate. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum ConfirmPaymentIntentPaymentMethodOptionsAcssDebitMandateOptionsTransactionType { + Business, + Personal, +} +impl ConfirmPaymentIntentPaymentMethodOptionsAcssDebitMandateOptionsTransactionType { + pub fn as_str(self) -> &'static str { + use ConfirmPaymentIntentPaymentMethodOptionsAcssDebitMandateOptionsTransactionType::*; + match self { + Business => "business", + Personal => "personal", + } + } +} + +impl std::str::FromStr + for ConfirmPaymentIntentPaymentMethodOptionsAcssDebitMandateOptionsTransactionType +{ + type Err = (); + fn from_str(s: &str) -> Result { + use ConfirmPaymentIntentPaymentMethodOptionsAcssDebitMandateOptionsTransactionType::*; + match s { + "business" => Ok(Business), + "personal" => Ok(Personal), + _ => Err(()), + } + } +} +impl std::fmt::Display + for ConfirmPaymentIntentPaymentMethodOptionsAcssDebitMandateOptionsTransactionType +{ + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug + for ConfirmPaymentIntentPaymentMethodOptionsAcssDebitMandateOptionsTransactionType +{ + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize + for ConfirmPaymentIntentPaymentMethodOptionsAcssDebitMandateOptionsTransactionType +{ + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Indicates that you intend to make future payments with this PaymentIntent's payment method. +/// +/// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. +/// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. +/// +/// When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). +/// +/// If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum ConfirmPaymentIntentPaymentMethodOptionsAcssDebitSetupFutureUsage { + None, + OffSession, + OnSession, +} +impl ConfirmPaymentIntentPaymentMethodOptionsAcssDebitSetupFutureUsage { + pub fn as_str(self) -> &'static str { + use ConfirmPaymentIntentPaymentMethodOptionsAcssDebitSetupFutureUsage::*; + match self { + None => "none", + OffSession => "off_session", + OnSession => "on_session", + } + } +} + +impl std::str::FromStr for ConfirmPaymentIntentPaymentMethodOptionsAcssDebitSetupFutureUsage { + type Err = (); + fn from_str(s: &str) -> Result { + use ConfirmPaymentIntentPaymentMethodOptionsAcssDebitSetupFutureUsage::*; + match s { + "none" => Ok(None), + "off_session" => Ok(OffSession), + "on_session" => Ok(OnSession), + _ => Err(()), + } + } +} +impl std::fmt::Display for ConfirmPaymentIntentPaymentMethodOptionsAcssDebitSetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for ConfirmPaymentIntentPaymentMethodOptionsAcssDebitSetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for ConfirmPaymentIntentPaymentMethodOptionsAcssDebitSetupFutureUsage { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Bank account verification method. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum ConfirmPaymentIntentPaymentMethodOptionsAcssDebitVerificationMethod { + Automatic, + Instant, + Microdeposits, +} +impl ConfirmPaymentIntentPaymentMethodOptionsAcssDebitVerificationMethod { + pub fn as_str(self) -> &'static str { + use ConfirmPaymentIntentPaymentMethodOptionsAcssDebitVerificationMethod::*; + match self { + Automatic => "automatic", + Instant => "instant", + Microdeposits => "microdeposits", + } + } +} + +impl std::str::FromStr for ConfirmPaymentIntentPaymentMethodOptionsAcssDebitVerificationMethod { + type Err = (); + fn from_str(s: &str) -> Result { + use ConfirmPaymentIntentPaymentMethodOptionsAcssDebitVerificationMethod::*; + match s { + "automatic" => Ok(Automatic), + "instant" => Ok(Instant), + "microdeposits" => Ok(Microdeposits), + _ => Err(()), + } + } +} +impl std::fmt::Display for ConfirmPaymentIntentPaymentMethodOptionsAcssDebitVerificationMethod { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for ConfirmPaymentIntentPaymentMethodOptionsAcssDebitVerificationMethod { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for ConfirmPaymentIntentPaymentMethodOptionsAcssDebitVerificationMethod { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// If this is an `affirm` PaymentMethod, this sub-hash contains details about the Affirm payment method options. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct ConfirmPaymentIntentPaymentMethodOptionsAffirm<'a> { + /// Controls when the funds will be captured from the customer's account. + /// + /// If provided, this parameter will override the top-level `capture_method` when finalizing the payment with this payment method type. + /// + /// If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter will unset the stored value for this payment method type. + #[serde(skip_serializing_if = "Option::is_none")] + pub capture_method: Option, + /// Preferred language of the Affirm authorization page that the customer is redirected to. + #[serde(skip_serializing_if = "Option::is_none")] + pub preferred_locale: Option<&'a str>, + /// Indicates that you intend to make future payments with this PaymentIntent's payment method. + /// + /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. + /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + /// + /// When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + /// + /// If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. + #[serde(skip_serializing_if = "Option::is_none")] + pub setup_future_usage: Option, +} +impl<'a> ConfirmPaymentIntentPaymentMethodOptionsAffirm<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// Controls when the funds will be captured from the customer's account. +/// +/// If provided, this parameter will override the top-level `capture_method` when finalizing the payment with this payment method type. +/// +/// If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter will unset the stored value for this payment method type. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum ConfirmPaymentIntentPaymentMethodOptionsAffirmCaptureMethod { + Manual, +} +impl ConfirmPaymentIntentPaymentMethodOptionsAffirmCaptureMethod { + pub fn as_str(self) -> &'static str { + use ConfirmPaymentIntentPaymentMethodOptionsAffirmCaptureMethod::*; + match self { + Manual => "manual", + } + } +} + +impl std::str::FromStr for ConfirmPaymentIntentPaymentMethodOptionsAffirmCaptureMethod { + type Err = (); + fn from_str(s: &str) -> Result { + use ConfirmPaymentIntentPaymentMethodOptionsAffirmCaptureMethod::*; + match s { + "manual" => Ok(Manual), + _ => Err(()), + } + } +} +impl std::fmt::Display for ConfirmPaymentIntentPaymentMethodOptionsAffirmCaptureMethod { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for ConfirmPaymentIntentPaymentMethodOptionsAffirmCaptureMethod { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for ConfirmPaymentIntentPaymentMethodOptionsAffirmCaptureMethod { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Indicates that you intend to make future payments with this PaymentIntent's payment method. +/// +/// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. +/// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. +/// +/// When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). +/// +/// If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum ConfirmPaymentIntentPaymentMethodOptionsAffirmSetupFutureUsage { + None, +} +impl ConfirmPaymentIntentPaymentMethodOptionsAffirmSetupFutureUsage { + pub fn as_str(self) -> &'static str { + use ConfirmPaymentIntentPaymentMethodOptionsAffirmSetupFutureUsage::*; + match self { + None => "none", + } + } +} + +impl std::str::FromStr for ConfirmPaymentIntentPaymentMethodOptionsAffirmSetupFutureUsage { + type Err = (); + fn from_str(s: &str) -> Result { + use ConfirmPaymentIntentPaymentMethodOptionsAffirmSetupFutureUsage::*; + match s { + "none" => Ok(None), + _ => Err(()), + } + } +} +impl std::fmt::Display for ConfirmPaymentIntentPaymentMethodOptionsAffirmSetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for ConfirmPaymentIntentPaymentMethodOptionsAffirmSetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for ConfirmPaymentIntentPaymentMethodOptionsAffirmSetupFutureUsage { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// If this is a `afterpay_clearpay` PaymentMethod, this sub-hash contains details about the Afterpay Clearpay payment method options. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct ConfirmPaymentIntentPaymentMethodOptionsAfterpayClearpay<'a> { + /// Controls when the funds will be captured from the customer's account. + /// + /// If provided, this parameter will override the top-level `capture_method` when finalizing the payment with this payment method type. + /// + /// If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter will unset the stored value for this payment method type. + #[serde(skip_serializing_if = "Option::is_none")] + pub capture_method: + Option, + /// An internal identifier or reference that this payment corresponds to. + /// You must limit the identifier to 128 characters, and it can only contain letters, numbers, underscores, backslashes, and dashes. + /// This field differs from the statement descriptor and item name. + #[serde(skip_serializing_if = "Option::is_none")] + pub reference: Option<&'a str>, + /// Indicates that you intend to make future payments with this PaymentIntent's payment method. + /// + /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. + /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + /// + /// When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + /// + /// If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. + #[serde(skip_serializing_if = "Option::is_none")] + pub setup_future_usage: + Option, +} +impl<'a> ConfirmPaymentIntentPaymentMethodOptionsAfterpayClearpay<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// Controls when the funds will be captured from the customer's account. +/// +/// If provided, this parameter will override the top-level `capture_method` when finalizing the payment with this payment method type. +/// +/// If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter will unset the stored value for this payment method type. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum ConfirmPaymentIntentPaymentMethodOptionsAfterpayClearpayCaptureMethod { + Manual, +} +impl ConfirmPaymentIntentPaymentMethodOptionsAfterpayClearpayCaptureMethod { + pub fn as_str(self) -> &'static str { + use ConfirmPaymentIntentPaymentMethodOptionsAfterpayClearpayCaptureMethod::*; + match self { + Manual => "manual", + } + } +} + +impl std::str::FromStr for ConfirmPaymentIntentPaymentMethodOptionsAfterpayClearpayCaptureMethod { + type Err = (); + fn from_str(s: &str) -> Result { + use ConfirmPaymentIntentPaymentMethodOptionsAfterpayClearpayCaptureMethod::*; + match s { + "manual" => Ok(Manual), + _ => Err(()), + } + } +} +impl std::fmt::Display for ConfirmPaymentIntentPaymentMethodOptionsAfterpayClearpayCaptureMethod { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for ConfirmPaymentIntentPaymentMethodOptionsAfterpayClearpayCaptureMethod { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for ConfirmPaymentIntentPaymentMethodOptionsAfterpayClearpayCaptureMethod { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Indicates that you intend to make future payments with this PaymentIntent's payment method. +/// +/// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. +/// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. +/// +/// When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). +/// +/// If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum ConfirmPaymentIntentPaymentMethodOptionsAfterpayClearpaySetupFutureUsage { + None, +} +impl ConfirmPaymentIntentPaymentMethodOptionsAfterpayClearpaySetupFutureUsage { + pub fn as_str(self) -> &'static str { + use ConfirmPaymentIntentPaymentMethodOptionsAfterpayClearpaySetupFutureUsage::*; + match self { + None => "none", + } + } +} + +impl std::str::FromStr + for ConfirmPaymentIntentPaymentMethodOptionsAfterpayClearpaySetupFutureUsage +{ + type Err = (); + fn from_str(s: &str) -> Result { + use ConfirmPaymentIntentPaymentMethodOptionsAfterpayClearpaySetupFutureUsage::*; + match s { + "none" => Ok(None), + _ => Err(()), + } + } +} +impl std::fmt::Display + for ConfirmPaymentIntentPaymentMethodOptionsAfterpayClearpaySetupFutureUsage +{ + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for ConfirmPaymentIntentPaymentMethodOptionsAfterpayClearpaySetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for ConfirmPaymentIntentPaymentMethodOptionsAfterpayClearpaySetupFutureUsage { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// If this is a `alipay` PaymentMethod, this sub-hash contains details about the Alipay payment method options. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct ConfirmPaymentIntentPaymentMethodOptionsAlipay { + /// Indicates that you intend to make future payments with this PaymentIntent's payment method. + /// + /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. + /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + /// + /// When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + /// + /// If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. + #[serde(skip_serializing_if = "Option::is_none")] + pub setup_future_usage: Option, +} +impl ConfirmPaymentIntentPaymentMethodOptionsAlipay { + pub fn new() -> Self { + Self::default() + } +} +/// Indicates that you intend to make future payments with this PaymentIntent's payment method. +/// +/// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. +/// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. +/// +/// When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). +/// +/// If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum ConfirmPaymentIntentPaymentMethodOptionsAlipaySetupFutureUsage { + None, + OffSession, +} +impl ConfirmPaymentIntentPaymentMethodOptionsAlipaySetupFutureUsage { + pub fn as_str(self) -> &'static str { + use ConfirmPaymentIntentPaymentMethodOptionsAlipaySetupFutureUsage::*; + match self { + None => "none", + OffSession => "off_session", + } + } +} + +impl std::str::FromStr for ConfirmPaymentIntentPaymentMethodOptionsAlipaySetupFutureUsage { + type Err = (); + fn from_str(s: &str) -> Result { + use ConfirmPaymentIntentPaymentMethodOptionsAlipaySetupFutureUsage::*; + match s { + "none" => Ok(None), + "off_session" => Ok(OffSession), + _ => Err(()), + } + } +} +impl std::fmt::Display for ConfirmPaymentIntentPaymentMethodOptionsAlipaySetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for ConfirmPaymentIntentPaymentMethodOptionsAlipaySetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for ConfirmPaymentIntentPaymentMethodOptionsAlipaySetupFutureUsage { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// If this is a `au_becs_debit` PaymentMethod, this sub-hash contains details about the AU BECS Direct Debit payment method options. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct ConfirmPaymentIntentPaymentMethodOptionsAuBecsDebit { + /// Indicates that you intend to make future payments with this PaymentIntent's payment method. + /// + /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. + /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + /// + /// When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + /// + /// If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. + #[serde(skip_serializing_if = "Option::is_none")] + pub setup_future_usage: + Option, +} +impl ConfirmPaymentIntentPaymentMethodOptionsAuBecsDebit { + pub fn new() -> Self { + Self::default() + } +} +/// Indicates that you intend to make future payments with this PaymentIntent's payment method. +/// +/// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. +/// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. +/// +/// When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). +/// +/// If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum ConfirmPaymentIntentPaymentMethodOptionsAuBecsDebitSetupFutureUsage { + None, + OffSession, + OnSession, +} +impl ConfirmPaymentIntentPaymentMethodOptionsAuBecsDebitSetupFutureUsage { + pub fn as_str(self) -> &'static str { + use ConfirmPaymentIntentPaymentMethodOptionsAuBecsDebitSetupFutureUsage::*; + match self { + None => "none", + OffSession => "off_session", + OnSession => "on_session", + } + } +} + +impl std::str::FromStr for ConfirmPaymentIntentPaymentMethodOptionsAuBecsDebitSetupFutureUsage { + type Err = (); + fn from_str(s: &str) -> Result { + use ConfirmPaymentIntentPaymentMethodOptionsAuBecsDebitSetupFutureUsage::*; + match s { + "none" => Ok(None), + "off_session" => Ok(OffSession), + "on_session" => Ok(OnSession), + _ => Err(()), + } + } +} +impl std::fmt::Display for ConfirmPaymentIntentPaymentMethodOptionsAuBecsDebitSetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for ConfirmPaymentIntentPaymentMethodOptionsAuBecsDebitSetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for ConfirmPaymentIntentPaymentMethodOptionsAuBecsDebitSetupFutureUsage { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// If this is a `bacs_debit` PaymentMethod, this sub-hash contains details about the BACS Debit payment method options. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct ConfirmPaymentIntentPaymentMethodOptionsBacsDebit { + /// Indicates that you intend to make future payments with this PaymentIntent's payment method. + /// + /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. + /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + /// + /// When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + /// + /// If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. + #[serde(skip_serializing_if = "Option::is_none")] + pub setup_future_usage: + Option, +} +impl ConfirmPaymentIntentPaymentMethodOptionsBacsDebit { + pub fn new() -> Self { + Self::default() + } +} +/// Indicates that you intend to make future payments with this PaymentIntent's payment method. +/// +/// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. +/// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. +/// +/// When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). +/// +/// If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum ConfirmPaymentIntentPaymentMethodOptionsBacsDebitSetupFutureUsage { + None, + OffSession, + OnSession, +} +impl ConfirmPaymentIntentPaymentMethodOptionsBacsDebitSetupFutureUsage { + pub fn as_str(self) -> &'static str { + use ConfirmPaymentIntentPaymentMethodOptionsBacsDebitSetupFutureUsage::*; + match self { + None => "none", + OffSession => "off_session", + OnSession => "on_session", + } + } +} + +impl std::str::FromStr for ConfirmPaymentIntentPaymentMethodOptionsBacsDebitSetupFutureUsage { + type Err = (); + fn from_str(s: &str) -> Result { + use ConfirmPaymentIntentPaymentMethodOptionsBacsDebitSetupFutureUsage::*; + match s { + "none" => Ok(None), + "off_session" => Ok(OffSession), + "on_session" => Ok(OnSession), + _ => Err(()), + } + } +} +impl std::fmt::Display for ConfirmPaymentIntentPaymentMethodOptionsBacsDebitSetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for ConfirmPaymentIntentPaymentMethodOptionsBacsDebitSetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for ConfirmPaymentIntentPaymentMethodOptionsBacsDebitSetupFutureUsage { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// If this is a `bancontact` PaymentMethod, this sub-hash contains details about the Bancontact payment method options. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct ConfirmPaymentIntentPaymentMethodOptionsBancontact { + /// Preferred language of the Bancontact authorization page that the customer is redirected to. + #[serde(skip_serializing_if = "Option::is_none")] + pub preferred_language: + Option, + /// Indicates that you intend to make future payments with this PaymentIntent's payment method. + /// + /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. + /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + /// + /// When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + /// + /// If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. + #[serde(skip_serializing_if = "Option::is_none")] + pub setup_future_usage: + Option, +} +impl ConfirmPaymentIntentPaymentMethodOptionsBancontact { + pub fn new() -> Self { + Self::default() + } +} +/// Preferred language of the Bancontact authorization page that the customer is redirected to. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum ConfirmPaymentIntentPaymentMethodOptionsBancontactPreferredLanguage { + De, + En, + Fr, + Nl, +} +impl ConfirmPaymentIntentPaymentMethodOptionsBancontactPreferredLanguage { + pub fn as_str(self) -> &'static str { + use ConfirmPaymentIntentPaymentMethodOptionsBancontactPreferredLanguage::*; + match self { + De => "de", + En => "en", + Fr => "fr", + Nl => "nl", + } + } +} + +impl std::str::FromStr for ConfirmPaymentIntentPaymentMethodOptionsBancontactPreferredLanguage { + type Err = (); + fn from_str(s: &str) -> Result { + use ConfirmPaymentIntentPaymentMethodOptionsBancontactPreferredLanguage::*; + match s { + "de" => Ok(De), + "en" => Ok(En), + "fr" => Ok(Fr), + "nl" => Ok(Nl), + _ => Err(()), + } + } +} +impl std::fmt::Display for ConfirmPaymentIntentPaymentMethodOptionsBancontactPreferredLanguage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for ConfirmPaymentIntentPaymentMethodOptionsBancontactPreferredLanguage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for ConfirmPaymentIntentPaymentMethodOptionsBancontactPreferredLanguage { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Indicates that you intend to make future payments with this PaymentIntent's payment method. +/// +/// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. +/// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. +/// +/// When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). +/// +/// If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum ConfirmPaymentIntentPaymentMethodOptionsBancontactSetupFutureUsage { + None, + OffSession, +} +impl ConfirmPaymentIntentPaymentMethodOptionsBancontactSetupFutureUsage { + pub fn as_str(self) -> &'static str { + use ConfirmPaymentIntentPaymentMethodOptionsBancontactSetupFutureUsage::*; + match self { + None => "none", + OffSession => "off_session", + } + } +} + +impl std::str::FromStr for ConfirmPaymentIntentPaymentMethodOptionsBancontactSetupFutureUsage { + type Err = (); + fn from_str(s: &str) -> Result { + use ConfirmPaymentIntentPaymentMethodOptionsBancontactSetupFutureUsage::*; + match s { + "none" => Ok(None), + "off_session" => Ok(OffSession), + _ => Err(()), + } + } +} +impl std::fmt::Display for ConfirmPaymentIntentPaymentMethodOptionsBancontactSetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for ConfirmPaymentIntentPaymentMethodOptionsBancontactSetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for ConfirmPaymentIntentPaymentMethodOptionsBancontactSetupFutureUsage { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// If this is a `blik` PaymentMethod, this sub-hash contains details about the BLIK payment method options. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct ConfirmPaymentIntentPaymentMethodOptionsBlik<'a> { + /// The 6-digit BLIK code that a customer has generated using their banking application. + /// Can only be set on confirmation. + #[serde(skip_serializing_if = "Option::is_none")] + pub code: Option<&'a str>, + /// Indicates that you intend to make future payments with this PaymentIntent's payment method. + /// + /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. + /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + /// + /// When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + /// + /// If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. + #[serde(skip_serializing_if = "Option::is_none")] + pub setup_future_usage: Option, +} +impl<'a> ConfirmPaymentIntentPaymentMethodOptionsBlik<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// Indicates that you intend to make future payments with this PaymentIntent's payment method. +/// +/// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. +/// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. +/// +/// When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). +/// +/// If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum ConfirmPaymentIntentPaymentMethodOptionsBlikSetupFutureUsage { + None, +} +impl ConfirmPaymentIntentPaymentMethodOptionsBlikSetupFutureUsage { + pub fn as_str(self) -> &'static str { + use ConfirmPaymentIntentPaymentMethodOptionsBlikSetupFutureUsage::*; + match self { + None => "none", + } + } +} + +impl std::str::FromStr for ConfirmPaymentIntentPaymentMethodOptionsBlikSetupFutureUsage { + type Err = (); + fn from_str(s: &str) -> Result { + use ConfirmPaymentIntentPaymentMethodOptionsBlikSetupFutureUsage::*; + match s { + "none" => Ok(None), + _ => Err(()), + } + } +} +impl std::fmt::Display for ConfirmPaymentIntentPaymentMethodOptionsBlikSetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for ConfirmPaymentIntentPaymentMethodOptionsBlikSetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for ConfirmPaymentIntentPaymentMethodOptionsBlikSetupFutureUsage { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// If this is a `boleto` PaymentMethod, this sub-hash contains details about the Boleto payment method options. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct ConfirmPaymentIntentPaymentMethodOptionsBoleto { + /// The number of calendar days before a Boleto voucher expires. + /// For example, if you create a Boleto voucher on Monday and you set expires_after_days to 2, the Boleto invoice will expire on Wednesday at 23:59 America/Sao_Paulo time. + #[serde(skip_serializing_if = "Option::is_none")] + pub expires_after_days: Option, + /// Indicates that you intend to make future payments with this PaymentIntent's payment method. + /// + /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. + /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + /// + /// When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + /// + /// If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. + #[serde(skip_serializing_if = "Option::is_none")] + pub setup_future_usage: Option, +} +impl ConfirmPaymentIntentPaymentMethodOptionsBoleto { + pub fn new() -> Self { + Self::default() + } +} +/// Indicates that you intend to make future payments with this PaymentIntent's payment method. +/// +/// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. +/// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. +/// +/// When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). +/// +/// If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum ConfirmPaymentIntentPaymentMethodOptionsBoletoSetupFutureUsage { + None, + OffSession, + OnSession, +} +impl ConfirmPaymentIntentPaymentMethodOptionsBoletoSetupFutureUsage { + pub fn as_str(self) -> &'static str { + use ConfirmPaymentIntentPaymentMethodOptionsBoletoSetupFutureUsage::*; + match self { + None => "none", + OffSession => "off_session", + OnSession => "on_session", + } + } +} + +impl std::str::FromStr for ConfirmPaymentIntentPaymentMethodOptionsBoletoSetupFutureUsage { + type Err = (); + fn from_str(s: &str) -> Result { + use ConfirmPaymentIntentPaymentMethodOptionsBoletoSetupFutureUsage::*; + match s { + "none" => Ok(None), + "off_session" => Ok(OffSession), + "on_session" => Ok(OnSession), + _ => Err(()), + } + } +} +impl std::fmt::Display for ConfirmPaymentIntentPaymentMethodOptionsBoletoSetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for ConfirmPaymentIntentPaymentMethodOptionsBoletoSetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for ConfirmPaymentIntentPaymentMethodOptionsBoletoSetupFutureUsage { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Configuration for any card payments attempted on this PaymentIntent. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct ConfirmPaymentIntentPaymentMethodOptionsCard<'a> { + /// Controls when the funds will be captured from the customer's account. + /// + /// If provided, this parameter will override the top-level `capture_method` when finalizing the payment with this payment method type. + /// + /// If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter will unset the stored value for this payment method type. + #[serde(skip_serializing_if = "Option::is_none")] + pub capture_method: Option, + /// A single-use `cvc_update` Token that represents a card CVC value. + /// When provided, the CVC value will be verified during the card payment attempt. + /// This parameter can only be provided during confirmation. + #[serde(skip_serializing_if = "Option::is_none")] + pub cvc_token: Option<&'a str>, + /// Installment configuration for payments attempted on this PaymentIntent (Mexico Only). + /// + /// For more information, see the [installments integration guide](https://stripe.com/docs/payments/installments). + #[serde(skip_serializing_if = "Option::is_none")] + pub installments: Option, + /// Configuration options for setting up an eMandate for cards issued in India. + #[serde(skip_serializing_if = "Option::is_none")] + pub mandate_options: Option>, + /// When specified, this parameter indicates that a transaction will be marked + /// as MOTO (Mail Order Telephone Order) and thus out of scope for SCA. This + /// parameter can only be provided during confirmation. + #[serde(skip_serializing_if = "Option::is_none")] + pub moto: Option, + /// Selected network to process this PaymentIntent on. + /// Depends on the available networks of the card attached to the PaymentIntent. + /// Can be only set confirm-time. + #[serde(skip_serializing_if = "Option::is_none")] + pub network: Option, + /// Request ability to [capture beyond the standard authorization validity window](https://stripe.com/docs/payments/extended-authorization) for this PaymentIntent. + #[serde(skip_serializing_if = "Option::is_none")] + pub request_extended_authorization: + Option, + /// Request ability to [increment the authorization](https://stripe.com/docs/payments/incremental-authorization) for this PaymentIntent. + #[serde(skip_serializing_if = "Option::is_none")] + pub request_incremental_authorization: + Option, + /// Request ability to make [multiple captures](https://stripe.com/docs/payments/multicapture) for this PaymentIntent. + #[serde(skip_serializing_if = "Option::is_none")] + pub request_multicapture: + Option, + /// Request ability to [overcapture](https://stripe.com/docs/payments/overcapture) for this PaymentIntent. + #[serde(skip_serializing_if = "Option::is_none")] + pub request_overcapture: Option, + /// We strongly recommend that you rely on our SCA Engine to automatically prompt your customers for authentication based on risk level and [other requirements](https://stripe.com/docs/strong-customer-authentication). + /// However, if you wish to request 3D Secure based on logic from your own fraud engine, provide this option. + /// If not provided, this value defaults to `automatic`. + /// Read our guide on [manually requesting 3D Secure](https://stripe.com/docs/payments/3d-secure#manual-three-ds) for more information on how this configuration interacts with Radar and our SCA Engine. + #[serde(skip_serializing_if = "Option::is_none")] + pub request_three_d_secure: + Option, + /// When enabled, using a card that is attached to a customer will require the CVC to be provided again (i.e. + /// using the cvc_token parameter). + #[serde(skip_serializing_if = "Option::is_none")] + pub require_cvc_recollection: Option, + /// Indicates that you intend to make future payments with this PaymentIntent's payment method. + /// + /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. + /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + /// + /// When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + /// + /// If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. + #[serde(skip_serializing_if = "Option::is_none")] + pub setup_future_usage: Option, + /// Provides information about a card payment that customers see on their statements. + /// Concatenated with the Kana prefix (shortened Kana descriptor) or Kana statement descriptor that’s set on the account to form the complete statement descriptor. + /// Maximum 22 characters. + /// On card statements, the *concatenation* of both prefix and suffix (including separators) will appear truncated to 22 characters. + #[serde(skip_serializing_if = "Option::is_none")] + pub statement_descriptor_suffix_kana: Option<&'a str>, + /// Provides information about a card payment that customers see on their statements. + /// Concatenated with the Kanji prefix (shortened Kanji descriptor) or Kanji statement descriptor that’s set on the account to form the complete statement descriptor. + /// Maximum 17 characters. + /// On card statements, the *concatenation* of both prefix and suffix (including separators) will appear truncated to 17 characters. + #[serde(skip_serializing_if = "Option::is_none")] + pub statement_descriptor_suffix_kanji: Option<&'a str>, + /// If 3D Secure authentication was performed with a third-party provider, + /// the authentication details to use for this payment. + #[serde(skip_serializing_if = "Option::is_none")] + pub three_d_secure: Option>, +} +impl<'a> ConfirmPaymentIntentPaymentMethodOptionsCard<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// Controls when the funds will be captured from the customer's account. +/// +/// If provided, this parameter will override the top-level `capture_method` when finalizing the payment with this payment method type. +/// +/// If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter will unset the stored value for this payment method type. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum ConfirmPaymentIntentPaymentMethodOptionsCardCaptureMethod { + Manual, +} +impl ConfirmPaymentIntentPaymentMethodOptionsCardCaptureMethod { + pub fn as_str(self) -> &'static str { + use ConfirmPaymentIntentPaymentMethodOptionsCardCaptureMethod::*; + match self { + Manual => "manual", + } + } +} + +impl std::str::FromStr for ConfirmPaymentIntentPaymentMethodOptionsCardCaptureMethod { + type Err = (); + fn from_str(s: &str) -> Result { + use ConfirmPaymentIntentPaymentMethodOptionsCardCaptureMethod::*; + match s { + "manual" => Ok(Manual), + _ => Err(()), + } + } +} +impl std::fmt::Display for ConfirmPaymentIntentPaymentMethodOptionsCardCaptureMethod { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for ConfirmPaymentIntentPaymentMethodOptionsCardCaptureMethod { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for ConfirmPaymentIntentPaymentMethodOptionsCardCaptureMethod { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Installment configuration for payments attempted on this PaymentIntent (Mexico Only). +/// +/// For more information, see the [installments integration guide](https://stripe.com/docs/payments/installments). +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct ConfirmPaymentIntentPaymentMethodOptionsCardInstallments { + /// Setting to true enables installments for this PaymentIntent. + /// This will cause the response to contain a list of available installment plans. + /// Setting to false will prevent any selected plan from applying to a charge. + #[serde(skip_serializing_if = "Option::is_none")] + pub enabled: Option, + /// The selected installment plan to use for this payment attempt. + /// This parameter can only be provided during confirmation. + #[serde(skip_serializing_if = "Option::is_none")] + pub plan: Option, +} +impl ConfirmPaymentIntentPaymentMethodOptionsCardInstallments { + pub fn new() -> Self { + Self::default() + } +} +/// The selected installment plan to use for this payment attempt. +/// This parameter can only be provided during confirmation. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct ConfirmPaymentIntentPaymentMethodOptionsCardInstallmentsPlan { + /// For `fixed_count` installment plans, this is the number of installment payments your customer will make to their credit card. + pub count: u64, + /// For `fixed_count` installment plans, this is the interval between installment payments your customer will make to their credit card. + /// One of `month`. + pub interval: ConfirmPaymentIntentPaymentMethodOptionsCardInstallmentsPlanInterval, + /// Type of installment plan, one of `fixed_count`. + #[serde(rename = "type")] + pub type_: ConfirmPaymentIntentPaymentMethodOptionsCardInstallmentsPlanType, +} +impl ConfirmPaymentIntentPaymentMethodOptionsCardInstallmentsPlan { + pub fn new( + count: u64, + interval: ConfirmPaymentIntentPaymentMethodOptionsCardInstallmentsPlanInterval, + type_: ConfirmPaymentIntentPaymentMethodOptionsCardInstallmentsPlanType, + ) -> Self { + Self { count, interval, type_ } + } +} +/// For `fixed_count` installment plans, this is the interval between installment payments your customer will make to their credit card. +/// One of `month`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum ConfirmPaymentIntentPaymentMethodOptionsCardInstallmentsPlanInterval { + Month, +} +impl ConfirmPaymentIntentPaymentMethodOptionsCardInstallmentsPlanInterval { + pub fn as_str(self) -> &'static str { + use ConfirmPaymentIntentPaymentMethodOptionsCardInstallmentsPlanInterval::*; + match self { + Month => "month", + } + } +} + +impl std::str::FromStr for ConfirmPaymentIntentPaymentMethodOptionsCardInstallmentsPlanInterval { + type Err = (); + fn from_str(s: &str) -> Result { + use ConfirmPaymentIntentPaymentMethodOptionsCardInstallmentsPlanInterval::*; + match s { + "month" => Ok(Month), + _ => Err(()), + } + } +} +impl std::fmt::Display for ConfirmPaymentIntentPaymentMethodOptionsCardInstallmentsPlanInterval { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for ConfirmPaymentIntentPaymentMethodOptionsCardInstallmentsPlanInterval { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for ConfirmPaymentIntentPaymentMethodOptionsCardInstallmentsPlanInterval { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Type of installment plan, one of `fixed_count`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum ConfirmPaymentIntentPaymentMethodOptionsCardInstallmentsPlanType { + FixedCount, +} +impl ConfirmPaymentIntentPaymentMethodOptionsCardInstallmentsPlanType { + pub fn as_str(self) -> &'static str { + use ConfirmPaymentIntentPaymentMethodOptionsCardInstallmentsPlanType::*; + match self { + FixedCount => "fixed_count", + } + } +} + +impl std::str::FromStr for ConfirmPaymentIntentPaymentMethodOptionsCardInstallmentsPlanType { + type Err = (); + fn from_str(s: &str) -> Result { + use ConfirmPaymentIntentPaymentMethodOptionsCardInstallmentsPlanType::*; + match s { + "fixed_count" => Ok(FixedCount), + _ => Err(()), + } + } +} +impl std::fmt::Display for ConfirmPaymentIntentPaymentMethodOptionsCardInstallmentsPlanType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for ConfirmPaymentIntentPaymentMethodOptionsCardInstallmentsPlanType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for ConfirmPaymentIntentPaymentMethodOptionsCardInstallmentsPlanType { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Configuration options for setting up an eMandate for cards issued in India. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct ConfirmPaymentIntentPaymentMethodOptionsCardMandateOptions<'a> { + /// Amount to be charged for future payments. + pub amount: i64, + /// One of `fixed` or `maximum`. + /// If `fixed`, the `amount` param refers to the exact amount to be charged in future payments. + /// If `maximum`, the amount charged can be up to the value passed for the `amount` param. + pub amount_type: ConfirmPaymentIntentPaymentMethodOptionsCardMandateOptionsAmountType, + /// A description of the mandate or subscription that is meant to be displayed to the customer. + #[serde(skip_serializing_if = "Option::is_none")] + pub description: Option<&'a str>, + /// End date of the mandate or subscription. + /// If not provided, the mandate will be active until canceled. + /// If provided, end date should be after start date. + #[serde(skip_serializing_if = "Option::is_none")] + pub end_date: Option, + /// Specifies payment frequency. One of `day`, `week`, `month`, `year`, or `sporadic`. + pub interval: ConfirmPaymentIntentPaymentMethodOptionsCardMandateOptionsInterval, + /// The number of intervals between payments. + /// For example, `interval=month` and `interval_count=3` indicates one payment every three months. + /// Maximum of one year interval allowed (1 year, 12 months, or 52 weeks). + /// This parameter is optional when `interval=sporadic`. + #[serde(skip_serializing_if = "Option::is_none")] + pub interval_count: Option, + /// Unique identifier for the mandate or subscription. + pub reference: &'a str, + /// Start date of the mandate or subscription. Start date should not be lesser than yesterday. + pub start_date: stripe_types::Timestamp, + /// Specifies the type of mandates supported. Possible values are `india`. + #[serde(skip_serializing_if = "Option::is_none")] + pub supported_types: + Option<&'a [ConfirmPaymentIntentPaymentMethodOptionsCardMandateOptionsSupportedTypes]>, +} +impl<'a> ConfirmPaymentIntentPaymentMethodOptionsCardMandateOptions<'a> { + pub fn new( + amount: i64, + amount_type: ConfirmPaymentIntentPaymentMethodOptionsCardMandateOptionsAmountType, + interval: ConfirmPaymentIntentPaymentMethodOptionsCardMandateOptionsInterval, + reference: &'a str, + start_date: stripe_types::Timestamp, + ) -> Self { + Self { + amount, + amount_type, + description: None, + end_date: None, + interval, + interval_count: None, + reference, + start_date, + supported_types: None, + } + } +} +/// One of `fixed` or `maximum`. +/// If `fixed`, the `amount` param refers to the exact amount to be charged in future payments. +/// If `maximum`, the amount charged can be up to the value passed for the `amount` param. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum ConfirmPaymentIntentPaymentMethodOptionsCardMandateOptionsAmountType { + Fixed, + Maximum, +} +impl ConfirmPaymentIntentPaymentMethodOptionsCardMandateOptionsAmountType { + pub fn as_str(self) -> &'static str { + use ConfirmPaymentIntentPaymentMethodOptionsCardMandateOptionsAmountType::*; + match self { + Fixed => "fixed", + Maximum => "maximum", + } + } +} + +impl std::str::FromStr for ConfirmPaymentIntentPaymentMethodOptionsCardMandateOptionsAmountType { + type Err = (); + fn from_str(s: &str) -> Result { + use ConfirmPaymentIntentPaymentMethodOptionsCardMandateOptionsAmountType::*; + match s { + "fixed" => Ok(Fixed), + "maximum" => Ok(Maximum), + _ => Err(()), + } + } +} +impl std::fmt::Display for ConfirmPaymentIntentPaymentMethodOptionsCardMandateOptionsAmountType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for ConfirmPaymentIntentPaymentMethodOptionsCardMandateOptionsAmountType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for ConfirmPaymentIntentPaymentMethodOptionsCardMandateOptionsAmountType { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Specifies payment frequency. One of `day`, `week`, `month`, `year`, or `sporadic`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum ConfirmPaymentIntentPaymentMethodOptionsCardMandateOptionsInterval { + Day, + Month, + Sporadic, + Week, + Year, +} +impl ConfirmPaymentIntentPaymentMethodOptionsCardMandateOptionsInterval { + pub fn as_str(self) -> &'static str { + use ConfirmPaymentIntentPaymentMethodOptionsCardMandateOptionsInterval::*; + match self { + Day => "day", + Month => "month", + Sporadic => "sporadic", + Week => "week", + Year => "year", + } + } +} + +impl std::str::FromStr for ConfirmPaymentIntentPaymentMethodOptionsCardMandateOptionsInterval { + type Err = (); + fn from_str(s: &str) -> Result { + use ConfirmPaymentIntentPaymentMethodOptionsCardMandateOptionsInterval::*; + match s { + "day" => Ok(Day), + "month" => Ok(Month), + "sporadic" => Ok(Sporadic), + "week" => Ok(Week), + "year" => Ok(Year), + _ => Err(()), + } + } +} +impl std::fmt::Display for ConfirmPaymentIntentPaymentMethodOptionsCardMandateOptionsInterval { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for ConfirmPaymentIntentPaymentMethodOptionsCardMandateOptionsInterval { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for ConfirmPaymentIntentPaymentMethodOptionsCardMandateOptionsInterval { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Specifies the type of mandates supported. Possible values are `india`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum ConfirmPaymentIntentPaymentMethodOptionsCardMandateOptionsSupportedTypes { + India, +} +impl ConfirmPaymentIntentPaymentMethodOptionsCardMandateOptionsSupportedTypes { + pub fn as_str(self) -> &'static str { + use ConfirmPaymentIntentPaymentMethodOptionsCardMandateOptionsSupportedTypes::*; + match self { + India => "india", + } + } +} + +impl std::str::FromStr + for ConfirmPaymentIntentPaymentMethodOptionsCardMandateOptionsSupportedTypes +{ + type Err = (); + fn from_str(s: &str) -> Result { + use ConfirmPaymentIntentPaymentMethodOptionsCardMandateOptionsSupportedTypes::*; + match s { + "india" => Ok(India), + _ => Err(()), + } + } +} +impl std::fmt::Display + for ConfirmPaymentIntentPaymentMethodOptionsCardMandateOptionsSupportedTypes +{ + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for ConfirmPaymentIntentPaymentMethodOptionsCardMandateOptionsSupportedTypes { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for ConfirmPaymentIntentPaymentMethodOptionsCardMandateOptionsSupportedTypes { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Selected network to process this PaymentIntent on. +/// Depends on the available networks of the card attached to the PaymentIntent. +/// Can be only set confirm-time. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum ConfirmPaymentIntentPaymentMethodOptionsCardNetwork { + Amex, + CartesBancaires, + Diners, + Discover, + EftposAu, + Interac, + Jcb, + Mastercard, + Unionpay, + Unknown, + Visa, +} +impl ConfirmPaymentIntentPaymentMethodOptionsCardNetwork { + pub fn as_str(self) -> &'static str { + use ConfirmPaymentIntentPaymentMethodOptionsCardNetwork::*; + match self { + Amex => "amex", + CartesBancaires => "cartes_bancaires", + Diners => "diners", + Discover => "discover", + EftposAu => "eftpos_au", + Interac => "interac", + Jcb => "jcb", + Mastercard => "mastercard", + Unionpay => "unionpay", + Unknown => "unknown", + Visa => "visa", + } + } +} + +impl std::str::FromStr for ConfirmPaymentIntentPaymentMethodOptionsCardNetwork { + type Err = (); + fn from_str(s: &str) -> Result { + use ConfirmPaymentIntentPaymentMethodOptionsCardNetwork::*; + match s { + "amex" => Ok(Amex), + "cartes_bancaires" => Ok(CartesBancaires), + "diners" => Ok(Diners), + "discover" => Ok(Discover), + "eftpos_au" => Ok(EftposAu), + "interac" => Ok(Interac), + "jcb" => Ok(Jcb), + "mastercard" => Ok(Mastercard), + "unionpay" => Ok(Unionpay), + "unknown" => Ok(Unknown), + "visa" => Ok(Visa), + _ => Err(()), + } + } +} +impl std::fmt::Display for ConfirmPaymentIntentPaymentMethodOptionsCardNetwork { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for ConfirmPaymentIntentPaymentMethodOptionsCardNetwork { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for ConfirmPaymentIntentPaymentMethodOptionsCardNetwork { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Request ability to [capture beyond the standard authorization validity window](https://stripe.com/docs/payments/extended-authorization) for this PaymentIntent. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum ConfirmPaymentIntentPaymentMethodOptionsCardRequestExtendedAuthorization { + IfAvailable, + Never, +} +impl ConfirmPaymentIntentPaymentMethodOptionsCardRequestExtendedAuthorization { + pub fn as_str(self) -> &'static str { + use ConfirmPaymentIntentPaymentMethodOptionsCardRequestExtendedAuthorization::*; + match self { + IfAvailable => "if_available", + Never => "never", + } + } +} + +impl std::str::FromStr + for ConfirmPaymentIntentPaymentMethodOptionsCardRequestExtendedAuthorization +{ + type Err = (); + fn from_str(s: &str) -> Result { + use ConfirmPaymentIntentPaymentMethodOptionsCardRequestExtendedAuthorization::*; + match s { + "if_available" => Ok(IfAvailable), + "never" => Ok(Never), + _ => Err(()), + } + } +} +impl std::fmt::Display + for ConfirmPaymentIntentPaymentMethodOptionsCardRequestExtendedAuthorization +{ + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for ConfirmPaymentIntentPaymentMethodOptionsCardRequestExtendedAuthorization { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for ConfirmPaymentIntentPaymentMethodOptionsCardRequestExtendedAuthorization { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Request ability to [increment the authorization](https://stripe.com/docs/payments/incremental-authorization) for this PaymentIntent. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum ConfirmPaymentIntentPaymentMethodOptionsCardRequestIncrementalAuthorization { + IfAvailable, + Never, +} +impl ConfirmPaymentIntentPaymentMethodOptionsCardRequestIncrementalAuthorization { + pub fn as_str(self) -> &'static str { + use ConfirmPaymentIntentPaymentMethodOptionsCardRequestIncrementalAuthorization::*; + match self { + IfAvailable => "if_available", + Never => "never", + } + } +} + +impl std::str::FromStr + for ConfirmPaymentIntentPaymentMethodOptionsCardRequestIncrementalAuthorization +{ + type Err = (); + fn from_str(s: &str) -> Result { + use ConfirmPaymentIntentPaymentMethodOptionsCardRequestIncrementalAuthorization::*; + match s { + "if_available" => Ok(IfAvailable), + "never" => Ok(Never), + _ => Err(()), + } + } +} +impl std::fmt::Display + for ConfirmPaymentIntentPaymentMethodOptionsCardRequestIncrementalAuthorization +{ + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug + for ConfirmPaymentIntentPaymentMethodOptionsCardRequestIncrementalAuthorization +{ + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize + for ConfirmPaymentIntentPaymentMethodOptionsCardRequestIncrementalAuthorization +{ + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Request ability to make [multiple captures](https://stripe.com/docs/payments/multicapture) for this PaymentIntent. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum ConfirmPaymentIntentPaymentMethodOptionsCardRequestMulticapture { + IfAvailable, + Never, +} +impl ConfirmPaymentIntentPaymentMethodOptionsCardRequestMulticapture { + pub fn as_str(self) -> &'static str { + use ConfirmPaymentIntentPaymentMethodOptionsCardRequestMulticapture::*; + match self { + IfAvailable => "if_available", + Never => "never", + } + } +} + +impl std::str::FromStr for ConfirmPaymentIntentPaymentMethodOptionsCardRequestMulticapture { + type Err = (); + fn from_str(s: &str) -> Result { + use ConfirmPaymentIntentPaymentMethodOptionsCardRequestMulticapture::*; + match s { + "if_available" => Ok(IfAvailable), + "never" => Ok(Never), + _ => Err(()), + } + } +} +impl std::fmt::Display for ConfirmPaymentIntentPaymentMethodOptionsCardRequestMulticapture { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for ConfirmPaymentIntentPaymentMethodOptionsCardRequestMulticapture { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for ConfirmPaymentIntentPaymentMethodOptionsCardRequestMulticapture { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Request ability to [overcapture](https://stripe.com/docs/payments/overcapture) for this PaymentIntent. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum ConfirmPaymentIntentPaymentMethodOptionsCardRequestOvercapture { + IfAvailable, + Never, +} +impl ConfirmPaymentIntentPaymentMethodOptionsCardRequestOvercapture { + pub fn as_str(self) -> &'static str { + use ConfirmPaymentIntentPaymentMethodOptionsCardRequestOvercapture::*; + match self { + IfAvailable => "if_available", + Never => "never", + } + } +} + +impl std::str::FromStr for ConfirmPaymentIntentPaymentMethodOptionsCardRequestOvercapture { + type Err = (); + fn from_str(s: &str) -> Result { + use ConfirmPaymentIntentPaymentMethodOptionsCardRequestOvercapture::*; + match s { + "if_available" => Ok(IfAvailable), + "never" => Ok(Never), + _ => Err(()), + } + } +} +impl std::fmt::Display for ConfirmPaymentIntentPaymentMethodOptionsCardRequestOvercapture { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for ConfirmPaymentIntentPaymentMethodOptionsCardRequestOvercapture { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for ConfirmPaymentIntentPaymentMethodOptionsCardRequestOvercapture { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// We strongly recommend that you rely on our SCA Engine to automatically prompt your customers for authentication based on risk level and [other requirements](https://stripe.com/docs/strong-customer-authentication). +/// However, if you wish to request 3D Secure based on logic from your own fraud engine, provide this option. +/// If not provided, this value defaults to `automatic`. +/// Read our guide on [manually requesting 3D Secure](https://stripe.com/docs/payments/3d-secure#manual-three-ds) for more information on how this configuration interacts with Radar and our SCA Engine. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum ConfirmPaymentIntentPaymentMethodOptionsCardRequestThreeDSecure { + Any, + Automatic, + Challenge, +} +impl ConfirmPaymentIntentPaymentMethodOptionsCardRequestThreeDSecure { + pub fn as_str(self) -> &'static str { + use ConfirmPaymentIntentPaymentMethodOptionsCardRequestThreeDSecure::*; + match self { + Any => "any", + Automatic => "automatic", + Challenge => "challenge", + } + } +} + +impl std::str::FromStr for ConfirmPaymentIntentPaymentMethodOptionsCardRequestThreeDSecure { + type Err = (); + fn from_str(s: &str) -> Result { + use ConfirmPaymentIntentPaymentMethodOptionsCardRequestThreeDSecure::*; + match s { + "any" => Ok(Any), + "automatic" => Ok(Automatic), + "challenge" => Ok(Challenge), + _ => Err(()), + } + } +} +impl std::fmt::Display for ConfirmPaymentIntentPaymentMethodOptionsCardRequestThreeDSecure { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for ConfirmPaymentIntentPaymentMethodOptionsCardRequestThreeDSecure { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for ConfirmPaymentIntentPaymentMethodOptionsCardRequestThreeDSecure { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Indicates that you intend to make future payments with this PaymentIntent's payment method. +/// +/// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. +/// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. +/// +/// When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). +/// +/// If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum ConfirmPaymentIntentPaymentMethodOptionsCardSetupFutureUsage { + None, + OffSession, + OnSession, +} +impl ConfirmPaymentIntentPaymentMethodOptionsCardSetupFutureUsage { + pub fn as_str(self) -> &'static str { + use ConfirmPaymentIntentPaymentMethodOptionsCardSetupFutureUsage::*; + match self { + None => "none", + OffSession => "off_session", + OnSession => "on_session", + } + } +} + +impl std::str::FromStr for ConfirmPaymentIntentPaymentMethodOptionsCardSetupFutureUsage { + type Err = (); + fn from_str(s: &str) -> Result { + use ConfirmPaymentIntentPaymentMethodOptionsCardSetupFutureUsage::*; + match s { + "none" => Ok(None), + "off_session" => Ok(OffSession), + "on_session" => Ok(OnSession), + _ => Err(()), + } + } +} +impl std::fmt::Display for ConfirmPaymentIntentPaymentMethodOptionsCardSetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for ConfirmPaymentIntentPaymentMethodOptionsCardSetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for ConfirmPaymentIntentPaymentMethodOptionsCardSetupFutureUsage { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// If 3D Secure authentication was performed with a third-party provider, +/// the authentication details to use for this payment. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct ConfirmPaymentIntentPaymentMethodOptionsCardThreeDSecure<'a> { + /// The `transStatus` returned from the card Issuer’s ACS in the ARes. + #[serde(skip_serializing_if = "Option::is_none")] + pub ares_trans_status: + Option, + /// The cryptogram, also known as the "authentication value" (AAV, CAVV or + /// AEVV). This value is 20 bytes, base64-encoded into a 28-character string. + /// (Most 3D Secure providers will return the base64-encoded version, which + /// is what you should specify here.) + pub cryptogram: &'a str, + /// The Electronic Commerce Indicator (ECI) is returned by your 3D Secure + /// provider and indicates what degree of authentication was performed. + #[serde(skip_serializing_if = "Option::is_none")] + pub electronic_commerce_indicator: + Option, + /// The exemption requested via 3DS and accepted by the issuer at authentication time. + #[serde(skip_serializing_if = "Option::is_none")] + pub exemption_indicator: + Option, + /// Network specific 3DS fields. Network specific arguments require an + /// explicit card brand choice. The parameter `payment_method_options.card.network`` + /// must be populated accordingly + #[serde(skip_serializing_if = "Option::is_none")] + pub network_options: + Option>, + /// The challenge indicator (`threeDSRequestorChallengeInd`) which was requested in the + /// AReq sent to the card Issuer's ACS. A string containing 2 digits from 01-99. + #[serde(skip_serializing_if = "Option::is_none")] + pub requestor_challenge_indicator: Option<&'a str>, + /// For 3D Secure 1, the XID. For 3D Secure 2, the Directory Server + /// Transaction ID (dsTransID). + pub transaction_id: &'a str, + /// The version of 3D Secure that was performed. + pub version: ConfirmPaymentIntentPaymentMethodOptionsCardThreeDSecureVersion, +} +impl<'a> ConfirmPaymentIntentPaymentMethodOptionsCardThreeDSecure<'a> { + pub fn new( + cryptogram: &'a str, + transaction_id: &'a str, + version: ConfirmPaymentIntentPaymentMethodOptionsCardThreeDSecureVersion, + ) -> Self { + Self { + ares_trans_status: None, + cryptogram, + electronic_commerce_indicator: None, + exemption_indicator: None, + network_options: None, + requestor_challenge_indicator: None, + transaction_id, + version, + } + } +} +/// The `transStatus` returned from the card Issuer’s ACS in the ARes. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum ConfirmPaymentIntentPaymentMethodOptionsCardThreeDSecureAresTransStatus { + A, + C, + I, + N, + R, + U, + Y, +} +impl ConfirmPaymentIntentPaymentMethodOptionsCardThreeDSecureAresTransStatus { + pub fn as_str(self) -> &'static str { + use ConfirmPaymentIntentPaymentMethodOptionsCardThreeDSecureAresTransStatus::*; + match self { + A => "A", + C => "C", + I => "I", + N => "N", + R => "R", + U => "U", + Y => "Y", + } + } +} + +impl std::str::FromStr for ConfirmPaymentIntentPaymentMethodOptionsCardThreeDSecureAresTransStatus { + type Err = (); + fn from_str(s: &str) -> Result { + use ConfirmPaymentIntentPaymentMethodOptionsCardThreeDSecureAresTransStatus::*; + match s { + "A" => Ok(A), + "C" => Ok(C), + "I" => Ok(I), + "N" => Ok(N), + "R" => Ok(R), + "U" => Ok(U), + "Y" => Ok(Y), + _ => Err(()), + } + } +} +impl std::fmt::Display for ConfirmPaymentIntentPaymentMethodOptionsCardThreeDSecureAresTransStatus { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for ConfirmPaymentIntentPaymentMethodOptionsCardThreeDSecureAresTransStatus { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for ConfirmPaymentIntentPaymentMethodOptionsCardThreeDSecureAresTransStatus { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// The Electronic Commerce Indicator (ECI) is returned by your 3D Secure +/// provider and indicates what degree of authentication was performed. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum ConfirmPaymentIntentPaymentMethodOptionsCardThreeDSecureElectronicCommerceIndicator { + V01, + V02, + V05, + V06, + V07, +} +impl ConfirmPaymentIntentPaymentMethodOptionsCardThreeDSecureElectronicCommerceIndicator { + pub fn as_str(self) -> &'static str { + use ConfirmPaymentIntentPaymentMethodOptionsCardThreeDSecureElectronicCommerceIndicator::*; + match self { + V01 => "01", + V02 => "02", + V05 => "05", + V06 => "06", + V07 => "07", + } + } +} + +impl std::str::FromStr + for ConfirmPaymentIntentPaymentMethodOptionsCardThreeDSecureElectronicCommerceIndicator +{ + type Err = (); + fn from_str(s: &str) -> Result { + use ConfirmPaymentIntentPaymentMethodOptionsCardThreeDSecureElectronicCommerceIndicator::*; + match s { + "01" => Ok(V01), + "02" => Ok(V02), + "05" => Ok(V05), + "06" => Ok(V06), + "07" => Ok(V07), + _ => Err(()), + } + } +} +impl std::fmt::Display + for ConfirmPaymentIntentPaymentMethodOptionsCardThreeDSecureElectronicCommerceIndicator +{ + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug + for ConfirmPaymentIntentPaymentMethodOptionsCardThreeDSecureElectronicCommerceIndicator +{ + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize + for ConfirmPaymentIntentPaymentMethodOptionsCardThreeDSecureElectronicCommerceIndicator +{ + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// The exemption requested via 3DS and accepted by the issuer at authentication time. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum ConfirmPaymentIntentPaymentMethodOptionsCardThreeDSecureExemptionIndicator { + LowRisk, + None, +} +impl ConfirmPaymentIntentPaymentMethodOptionsCardThreeDSecureExemptionIndicator { + pub fn as_str(self) -> &'static str { + use ConfirmPaymentIntentPaymentMethodOptionsCardThreeDSecureExemptionIndicator::*; + match self { + LowRisk => "low_risk", + None => "none", + } + } +} + +impl std::str::FromStr + for ConfirmPaymentIntentPaymentMethodOptionsCardThreeDSecureExemptionIndicator +{ + type Err = (); + fn from_str(s: &str) -> Result { + use ConfirmPaymentIntentPaymentMethodOptionsCardThreeDSecureExemptionIndicator::*; + match s { + "low_risk" => Ok(LowRisk), + "none" => Ok(None), + _ => Err(()), + } + } +} +impl std::fmt::Display + for ConfirmPaymentIntentPaymentMethodOptionsCardThreeDSecureExemptionIndicator +{ + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug + for ConfirmPaymentIntentPaymentMethodOptionsCardThreeDSecureExemptionIndicator +{ + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize + for ConfirmPaymentIntentPaymentMethodOptionsCardThreeDSecureExemptionIndicator +{ + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Network specific 3DS fields. Network specific arguments require an +/// explicit card brand choice. The parameter `payment_method_options.card.network`` +/// must be populated accordingly +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct ConfirmPaymentIntentPaymentMethodOptionsCardThreeDSecureNetworkOptions<'a> { + /// Cartes Bancaires-specific 3DS fields. + #[serde(skip_serializing_if = "Option::is_none")] + pub cartes_bancaires: Option< + ConfirmPaymentIntentPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancaires<'a>, + >, +} +impl<'a> ConfirmPaymentIntentPaymentMethodOptionsCardThreeDSecureNetworkOptions<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// Cartes Bancaires-specific 3DS fields. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct ConfirmPaymentIntentPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancaires<'a> { + /// The cryptogram calculation algorithm used by the card Issuer's ACS + /// to calculate the Authentication cryptogram. Also known as `cavvAlgorithm`. + /// messageExtension: CB-AVALGO +pub cb_avalgo: ConfirmPaymentIntentPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancairesCbAvalgo, + /// The exemption indicator returned from Cartes Bancaires in the ARes. + /// message extension: CB-EXEMPTION; string (4 characters) + /// This is a 3 byte bitmap (low significant byte first and most significant + /// bit first) that has been Base64 encoded +#[serde(skip_serializing_if = "Option::is_none")] +pub cb_exemption: Option<&'a str>, + /// The risk score returned from Cartes Bancaires in the ARes. + /// message extension: CB-SCORE; numeric value 0-99 +#[serde(skip_serializing_if = "Option::is_none")] +pub cb_score: Option, + +} +impl<'a> ConfirmPaymentIntentPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancaires<'a> { + pub fn new( + cb_avalgo: ConfirmPaymentIntentPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancairesCbAvalgo, + ) -> Self { + Self { cb_avalgo, cb_exemption: None, cb_score: None } + } +} +/// The cryptogram calculation algorithm used by the card Issuer's ACS +/// to calculate the Authentication cryptogram. Also known as `cavvAlgorithm`. +/// messageExtension: CB-AVALGO +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum ConfirmPaymentIntentPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancairesCbAvalgo +{ + V0, + V1, + V2, + V3, + V4, + A, +} +impl ConfirmPaymentIntentPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancairesCbAvalgo { + pub fn as_str(self) -> &'static str { + use ConfirmPaymentIntentPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancairesCbAvalgo::*; + match self { + V0 => "0", + V1 => "1", + V2 => "2", + V3 => "3", + V4 => "4", + A => "A", + } + } +} + +impl std::str::FromStr for ConfirmPaymentIntentPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancairesCbAvalgo { + type Err = (); + fn from_str(s: &str) -> Result { + use ConfirmPaymentIntentPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancairesCbAvalgo::*; + match s { + "0" => Ok(V0), +"1" => Ok(V1), +"2" => Ok(V2), +"3" => Ok(V3), +"4" => Ok(V4), +"A" => Ok(A), +_ => Err(()) + + } + } +} +impl std::fmt::Display for ConfirmPaymentIntentPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancairesCbAvalgo { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for ConfirmPaymentIntentPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancairesCbAvalgo { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for ConfirmPaymentIntentPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancairesCbAvalgo { + fn serialize(&self, serializer: S) -> Result where S: serde::Serializer { + serializer.serialize_str(self.as_str()) + } +} +/// The version of 3D Secure that was performed. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum ConfirmPaymentIntentPaymentMethodOptionsCardThreeDSecureVersion { + V1_0_2, + V2_1_0, + V2_2_0, +} +impl ConfirmPaymentIntentPaymentMethodOptionsCardThreeDSecureVersion { + pub fn as_str(self) -> &'static str { + use ConfirmPaymentIntentPaymentMethodOptionsCardThreeDSecureVersion::*; + match self { + V1_0_2 => "1.0.2", + V2_1_0 => "2.1.0", + V2_2_0 => "2.2.0", + } + } +} + +impl std::str::FromStr for ConfirmPaymentIntentPaymentMethodOptionsCardThreeDSecureVersion { + type Err = (); + fn from_str(s: &str) -> Result { + use ConfirmPaymentIntentPaymentMethodOptionsCardThreeDSecureVersion::*; + match s { + "1.0.2" => Ok(V1_0_2), + "2.1.0" => Ok(V2_1_0), + "2.2.0" => Ok(V2_2_0), + _ => Err(()), + } + } +} +impl std::fmt::Display for ConfirmPaymentIntentPaymentMethodOptionsCardThreeDSecureVersion { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for ConfirmPaymentIntentPaymentMethodOptionsCardThreeDSecureVersion { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for ConfirmPaymentIntentPaymentMethodOptionsCardThreeDSecureVersion { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// If this is a `cashapp` PaymentMethod, this sub-hash contains details about the Cash App Pay payment method options. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct ConfirmPaymentIntentPaymentMethodOptionsCashapp { + /// Controls when the funds will be captured from the customer's account. + /// + /// If provided, this parameter will override the top-level `capture_method` when finalizing the payment with this payment method type. + /// + /// If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter will unset the stored value for this payment method type. + #[serde(skip_serializing_if = "Option::is_none")] + pub capture_method: Option, + /// Indicates that you intend to make future payments with this PaymentIntent's payment method. + /// + /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. + /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + /// + /// When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + /// + /// If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. + #[serde(skip_serializing_if = "Option::is_none")] + pub setup_future_usage: Option, +} +impl ConfirmPaymentIntentPaymentMethodOptionsCashapp { + pub fn new() -> Self { + Self::default() + } +} +/// Controls when the funds will be captured from the customer's account. +/// +/// If provided, this parameter will override the top-level `capture_method` when finalizing the payment with this payment method type. +/// +/// If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter will unset the stored value for this payment method type. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum ConfirmPaymentIntentPaymentMethodOptionsCashappCaptureMethod { + Manual, +} +impl ConfirmPaymentIntentPaymentMethodOptionsCashappCaptureMethod { + pub fn as_str(self) -> &'static str { + use ConfirmPaymentIntentPaymentMethodOptionsCashappCaptureMethod::*; + match self { + Manual => "manual", + } + } +} + +impl std::str::FromStr for ConfirmPaymentIntentPaymentMethodOptionsCashappCaptureMethod { + type Err = (); + fn from_str(s: &str) -> Result { + use ConfirmPaymentIntentPaymentMethodOptionsCashappCaptureMethod::*; + match s { + "manual" => Ok(Manual), + _ => Err(()), + } + } +} +impl std::fmt::Display for ConfirmPaymentIntentPaymentMethodOptionsCashappCaptureMethod { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for ConfirmPaymentIntentPaymentMethodOptionsCashappCaptureMethod { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for ConfirmPaymentIntentPaymentMethodOptionsCashappCaptureMethod { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Indicates that you intend to make future payments with this PaymentIntent's payment method. +/// +/// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. +/// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. +/// +/// When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). +/// +/// If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum ConfirmPaymentIntentPaymentMethodOptionsCashappSetupFutureUsage { + None, + OffSession, + OnSession, +} +impl ConfirmPaymentIntentPaymentMethodOptionsCashappSetupFutureUsage { + pub fn as_str(self) -> &'static str { + use ConfirmPaymentIntentPaymentMethodOptionsCashappSetupFutureUsage::*; + match self { + None => "none", + OffSession => "off_session", + OnSession => "on_session", + } + } +} + +impl std::str::FromStr for ConfirmPaymentIntentPaymentMethodOptionsCashappSetupFutureUsage { + type Err = (); + fn from_str(s: &str) -> Result { + use ConfirmPaymentIntentPaymentMethodOptionsCashappSetupFutureUsage::*; + match s { + "none" => Ok(None), + "off_session" => Ok(OffSession), + "on_session" => Ok(OnSession), + _ => Err(()), + } + } +} +impl std::fmt::Display for ConfirmPaymentIntentPaymentMethodOptionsCashappSetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for ConfirmPaymentIntentPaymentMethodOptionsCashappSetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for ConfirmPaymentIntentPaymentMethodOptionsCashappSetupFutureUsage { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// If this is a `customer balance` PaymentMethod, this sub-hash contains details about the customer balance payment method options. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct ConfirmPaymentIntentPaymentMethodOptionsCustomerBalance<'a> { + /// Configuration for the bank transfer funding type, if the `funding_type` is set to `bank_transfer`. + #[serde(skip_serializing_if = "Option::is_none")] + pub bank_transfer: + Option>, + /// The funding method type to be used when there are not enough funds in the customer balance. + /// Permitted values include: `bank_transfer`. + #[serde(skip_serializing_if = "Option::is_none")] + pub funding_type: Option, + /// Indicates that you intend to make future payments with this PaymentIntent's payment method. + /// + /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. + /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + /// + /// When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + /// + /// If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. + #[serde(skip_serializing_if = "Option::is_none")] + pub setup_future_usage: + Option, +} +impl<'a> ConfirmPaymentIntentPaymentMethodOptionsCustomerBalance<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// Configuration for the bank transfer funding type, if the `funding_type` is set to `bank_transfer`. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct ConfirmPaymentIntentPaymentMethodOptionsCustomerBalanceBankTransfer<'a> { + /// Configuration for the eu_bank_transfer funding type. +#[serde(skip_serializing_if = "Option::is_none")] +pub eu_bank_transfer: Option>, + /// List of address types that should be returned in the financial_addresses response. + /// If not specified, all valid types will be returned. + /// + /// Permitted values include: `sort_code`, `zengin`, `iban`, or `spei`. +#[serde(skip_serializing_if = "Option::is_none")] +pub requested_address_types: Option<&'a [ConfirmPaymentIntentPaymentMethodOptionsCustomerBalanceBankTransferRequestedAddressTypes]>, + /// The list of bank transfer types that this PaymentIntent is allowed to use for funding Permitted values include: `eu_bank_transfer`, `gb_bank_transfer`, `jp_bank_transfer`, `mx_bank_transfer`, or `us_bank_transfer`. +#[serde(rename = "type")] +pub type_: ConfirmPaymentIntentPaymentMethodOptionsCustomerBalanceBankTransferType, + +} +impl<'a> ConfirmPaymentIntentPaymentMethodOptionsCustomerBalanceBankTransfer<'a> { + pub fn new( + type_: ConfirmPaymentIntentPaymentMethodOptionsCustomerBalanceBankTransferType, + ) -> Self { + Self { eu_bank_transfer: None, requested_address_types: None, type_ } + } +} +/// List of address types that should be returned in the financial_addresses response. +/// If not specified, all valid types will be returned. +/// +/// Permitted values include: `sort_code`, `zengin`, `iban`, or `spei`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum ConfirmPaymentIntentPaymentMethodOptionsCustomerBalanceBankTransferRequestedAddressTypes { + Aba, + Iban, + Sepa, + SortCode, + Spei, + Swift, + Zengin, +} +impl ConfirmPaymentIntentPaymentMethodOptionsCustomerBalanceBankTransferRequestedAddressTypes { + pub fn as_str(self) -> &'static str { + use ConfirmPaymentIntentPaymentMethodOptionsCustomerBalanceBankTransferRequestedAddressTypes::*; + match self { + Aba => "aba", + Iban => "iban", + Sepa => "sepa", + SortCode => "sort_code", + Spei => "spei", + Swift => "swift", + Zengin => "zengin", + } + } +} + +impl std::str::FromStr + for ConfirmPaymentIntentPaymentMethodOptionsCustomerBalanceBankTransferRequestedAddressTypes +{ + type Err = (); + fn from_str(s: &str) -> Result { + use ConfirmPaymentIntentPaymentMethodOptionsCustomerBalanceBankTransferRequestedAddressTypes::*; + match s { + "aba" => Ok(Aba), + "iban" => Ok(Iban), + "sepa" => Ok(Sepa), + "sort_code" => Ok(SortCode), + "spei" => Ok(Spei), + "swift" => Ok(Swift), + "zengin" => Ok(Zengin), + _ => Err(()), + } + } +} +impl std::fmt::Display + for ConfirmPaymentIntentPaymentMethodOptionsCustomerBalanceBankTransferRequestedAddressTypes +{ + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug + for ConfirmPaymentIntentPaymentMethodOptionsCustomerBalanceBankTransferRequestedAddressTypes +{ + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize + for ConfirmPaymentIntentPaymentMethodOptionsCustomerBalanceBankTransferRequestedAddressTypes +{ + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// The list of bank transfer types that this PaymentIntent is allowed to use for funding Permitted values include: `eu_bank_transfer`, `gb_bank_transfer`, `jp_bank_transfer`, `mx_bank_transfer`, or `us_bank_transfer`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum ConfirmPaymentIntentPaymentMethodOptionsCustomerBalanceBankTransferType { + EuBankTransfer, + GbBankTransfer, + JpBankTransfer, + MxBankTransfer, + UsBankTransfer, +} +impl ConfirmPaymentIntentPaymentMethodOptionsCustomerBalanceBankTransferType { + pub fn as_str(self) -> &'static str { + use ConfirmPaymentIntentPaymentMethodOptionsCustomerBalanceBankTransferType::*; + match self { + EuBankTransfer => "eu_bank_transfer", + GbBankTransfer => "gb_bank_transfer", + JpBankTransfer => "jp_bank_transfer", + MxBankTransfer => "mx_bank_transfer", + UsBankTransfer => "us_bank_transfer", + } + } +} + +impl std::str::FromStr for ConfirmPaymentIntentPaymentMethodOptionsCustomerBalanceBankTransferType { + type Err = (); + fn from_str(s: &str) -> Result { + use ConfirmPaymentIntentPaymentMethodOptionsCustomerBalanceBankTransferType::*; + match s { + "eu_bank_transfer" => Ok(EuBankTransfer), + "gb_bank_transfer" => Ok(GbBankTransfer), + "jp_bank_transfer" => Ok(JpBankTransfer), + "mx_bank_transfer" => Ok(MxBankTransfer), + "us_bank_transfer" => Ok(UsBankTransfer), + _ => Err(()), + } + } +} +impl std::fmt::Display for ConfirmPaymentIntentPaymentMethodOptionsCustomerBalanceBankTransferType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for ConfirmPaymentIntentPaymentMethodOptionsCustomerBalanceBankTransferType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for ConfirmPaymentIntentPaymentMethodOptionsCustomerBalanceBankTransferType { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// The funding method type to be used when there are not enough funds in the customer balance. +/// Permitted values include: `bank_transfer`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum ConfirmPaymentIntentPaymentMethodOptionsCustomerBalanceFundingType { + BankTransfer, +} +impl ConfirmPaymentIntentPaymentMethodOptionsCustomerBalanceFundingType { + pub fn as_str(self) -> &'static str { + use ConfirmPaymentIntentPaymentMethodOptionsCustomerBalanceFundingType::*; + match self { + BankTransfer => "bank_transfer", + } + } +} + +impl std::str::FromStr for ConfirmPaymentIntentPaymentMethodOptionsCustomerBalanceFundingType { + type Err = (); + fn from_str(s: &str) -> Result { + use ConfirmPaymentIntentPaymentMethodOptionsCustomerBalanceFundingType::*; + match s { + "bank_transfer" => Ok(BankTransfer), + _ => Err(()), + } + } +} +impl std::fmt::Display for ConfirmPaymentIntentPaymentMethodOptionsCustomerBalanceFundingType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for ConfirmPaymentIntentPaymentMethodOptionsCustomerBalanceFundingType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for ConfirmPaymentIntentPaymentMethodOptionsCustomerBalanceFundingType { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Indicates that you intend to make future payments with this PaymentIntent's payment method. +/// +/// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. +/// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. +/// +/// When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). +/// +/// If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum ConfirmPaymentIntentPaymentMethodOptionsCustomerBalanceSetupFutureUsage { + None, +} +impl ConfirmPaymentIntentPaymentMethodOptionsCustomerBalanceSetupFutureUsage { + pub fn as_str(self) -> &'static str { + use ConfirmPaymentIntentPaymentMethodOptionsCustomerBalanceSetupFutureUsage::*; + match self { + None => "none", + } + } +} + +impl std::str::FromStr for ConfirmPaymentIntentPaymentMethodOptionsCustomerBalanceSetupFutureUsage { + type Err = (); + fn from_str(s: &str) -> Result { + use ConfirmPaymentIntentPaymentMethodOptionsCustomerBalanceSetupFutureUsage::*; + match s { + "none" => Ok(None), + _ => Err(()), + } + } +} +impl std::fmt::Display for ConfirmPaymentIntentPaymentMethodOptionsCustomerBalanceSetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for ConfirmPaymentIntentPaymentMethodOptionsCustomerBalanceSetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for ConfirmPaymentIntentPaymentMethodOptionsCustomerBalanceSetupFutureUsage { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// If this is a `eps` PaymentMethod, this sub-hash contains details about the EPS payment method options. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct ConfirmPaymentIntentPaymentMethodOptionsEps { + /// Indicates that you intend to make future payments with this PaymentIntent's payment method. + /// + /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. + /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + /// + /// When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + /// + /// If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. + #[serde(skip_serializing_if = "Option::is_none")] + pub setup_future_usage: Option, +} +impl ConfirmPaymentIntentPaymentMethodOptionsEps { + pub fn new() -> Self { + Self::default() + } +} +/// Indicates that you intend to make future payments with this PaymentIntent's payment method. +/// +/// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. +/// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. +/// +/// When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). +/// +/// If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum ConfirmPaymentIntentPaymentMethodOptionsEpsSetupFutureUsage { + None, +} +impl ConfirmPaymentIntentPaymentMethodOptionsEpsSetupFutureUsage { + pub fn as_str(self) -> &'static str { + use ConfirmPaymentIntentPaymentMethodOptionsEpsSetupFutureUsage::*; + match self { + None => "none", + } + } +} + +impl std::str::FromStr for ConfirmPaymentIntentPaymentMethodOptionsEpsSetupFutureUsage { + type Err = (); + fn from_str(s: &str) -> Result { + use ConfirmPaymentIntentPaymentMethodOptionsEpsSetupFutureUsage::*; + match s { + "none" => Ok(None), + _ => Err(()), + } + } +} +impl std::fmt::Display for ConfirmPaymentIntentPaymentMethodOptionsEpsSetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for ConfirmPaymentIntentPaymentMethodOptionsEpsSetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for ConfirmPaymentIntentPaymentMethodOptionsEpsSetupFutureUsage { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// If this is a `fpx` PaymentMethod, this sub-hash contains details about the FPX payment method options. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct ConfirmPaymentIntentPaymentMethodOptionsFpx { + /// Indicates that you intend to make future payments with this PaymentIntent's payment method. + /// + /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. + /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + /// + /// When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + /// + /// If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. + #[serde(skip_serializing_if = "Option::is_none")] + pub setup_future_usage: Option, +} +impl ConfirmPaymentIntentPaymentMethodOptionsFpx { + pub fn new() -> Self { + Self::default() + } +} +/// Indicates that you intend to make future payments with this PaymentIntent's payment method. +/// +/// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. +/// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. +/// +/// When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). +/// +/// If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum ConfirmPaymentIntentPaymentMethodOptionsFpxSetupFutureUsage { + None, +} +impl ConfirmPaymentIntentPaymentMethodOptionsFpxSetupFutureUsage { + pub fn as_str(self) -> &'static str { + use ConfirmPaymentIntentPaymentMethodOptionsFpxSetupFutureUsage::*; + match self { + None => "none", + } + } +} + +impl std::str::FromStr for ConfirmPaymentIntentPaymentMethodOptionsFpxSetupFutureUsage { + type Err = (); + fn from_str(s: &str) -> Result { + use ConfirmPaymentIntentPaymentMethodOptionsFpxSetupFutureUsage::*; + match s { + "none" => Ok(None), + _ => Err(()), + } + } +} +impl std::fmt::Display for ConfirmPaymentIntentPaymentMethodOptionsFpxSetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for ConfirmPaymentIntentPaymentMethodOptionsFpxSetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for ConfirmPaymentIntentPaymentMethodOptionsFpxSetupFutureUsage { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// If this is a `giropay` PaymentMethod, this sub-hash contains details about the Giropay payment method options. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct ConfirmPaymentIntentPaymentMethodOptionsGiropay { + /// Indicates that you intend to make future payments with this PaymentIntent's payment method. + /// + /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. + /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + /// + /// When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + /// + /// If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. + #[serde(skip_serializing_if = "Option::is_none")] + pub setup_future_usage: Option, +} +impl ConfirmPaymentIntentPaymentMethodOptionsGiropay { + pub fn new() -> Self { + Self::default() + } +} +/// Indicates that you intend to make future payments with this PaymentIntent's payment method. +/// +/// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. +/// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. +/// +/// When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). +/// +/// If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum ConfirmPaymentIntentPaymentMethodOptionsGiropaySetupFutureUsage { + None, +} +impl ConfirmPaymentIntentPaymentMethodOptionsGiropaySetupFutureUsage { + pub fn as_str(self) -> &'static str { + use ConfirmPaymentIntentPaymentMethodOptionsGiropaySetupFutureUsage::*; + match self { + None => "none", + } + } +} + +impl std::str::FromStr for ConfirmPaymentIntentPaymentMethodOptionsGiropaySetupFutureUsage { + type Err = (); + fn from_str(s: &str) -> Result { + use ConfirmPaymentIntentPaymentMethodOptionsGiropaySetupFutureUsage::*; + match s { + "none" => Ok(None), + _ => Err(()), + } + } +} +impl std::fmt::Display for ConfirmPaymentIntentPaymentMethodOptionsGiropaySetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for ConfirmPaymentIntentPaymentMethodOptionsGiropaySetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for ConfirmPaymentIntentPaymentMethodOptionsGiropaySetupFutureUsage { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// If this is a `grabpay` PaymentMethod, this sub-hash contains details about the Grabpay payment method options. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct ConfirmPaymentIntentPaymentMethodOptionsGrabpay { + /// Indicates that you intend to make future payments with this PaymentIntent's payment method. + /// + /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. + /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + /// + /// When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + /// + /// If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. + #[serde(skip_serializing_if = "Option::is_none")] + pub setup_future_usage: Option, +} +impl ConfirmPaymentIntentPaymentMethodOptionsGrabpay { + pub fn new() -> Self { + Self::default() + } +} +/// Indicates that you intend to make future payments with this PaymentIntent's payment method. +/// +/// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. +/// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. +/// +/// When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). +/// +/// If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum ConfirmPaymentIntentPaymentMethodOptionsGrabpaySetupFutureUsage { + None, +} +impl ConfirmPaymentIntentPaymentMethodOptionsGrabpaySetupFutureUsage { + pub fn as_str(self) -> &'static str { + use ConfirmPaymentIntentPaymentMethodOptionsGrabpaySetupFutureUsage::*; + match self { + None => "none", + } + } +} + +impl std::str::FromStr for ConfirmPaymentIntentPaymentMethodOptionsGrabpaySetupFutureUsage { + type Err = (); + fn from_str(s: &str) -> Result { + use ConfirmPaymentIntentPaymentMethodOptionsGrabpaySetupFutureUsage::*; + match s { + "none" => Ok(None), + _ => Err(()), + } + } +} +impl std::fmt::Display for ConfirmPaymentIntentPaymentMethodOptionsGrabpaySetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for ConfirmPaymentIntentPaymentMethodOptionsGrabpaySetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for ConfirmPaymentIntentPaymentMethodOptionsGrabpaySetupFutureUsage { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// If this is a `ideal` PaymentMethod, this sub-hash contains details about the Ideal payment method options. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct ConfirmPaymentIntentPaymentMethodOptionsIdeal { + /// Indicates that you intend to make future payments with this PaymentIntent's payment method. + /// + /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. + /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + /// + /// When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + /// + /// If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. + #[serde(skip_serializing_if = "Option::is_none")] + pub setup_future_usage: Option, +} +impl ConfirmPaymentIntentPaymentMethodOptionsIdeal { + pub fn new() -> Self { + Self::default() + } +} +/// Indicates that you intend to make future payments with this PaymentIntent's payment method. +/// +/// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. +/// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. +/// +/// When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). +/// +/// If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum ConfirmPaymentIntentPaymentMethodOptionsIdealSetupFutureUsage { + None, + OffSession, +} +impl ConfirmPaymentIntentPaymentMethodOptionsIdealSetupFutureUsage { + pub fn as_str(self) -> &'static str { + use ConfirmPaymentIntentPaymentMethodOptionsIdealSetupFutureUsage::*; + match self { + None => "none", + OffSession => "off_session", + } + } +} + +impl std::str::FromStr for ConfirmPaymentIntentPaymentMethodOptionsIdealSetupFutureUsage { + type Err = (); + fn from_str(s: &str) -> Result { + use ConfirmPaymentIntentPaymentMethodOptionsIdealSetupFutureUsage::*; + match s { + "none" => Ok(None), + "off_session" => Ok(OffSession), + _ => Err(()), + } + } +} +impl std::fmt::Display for ConfirmPaymentIntentPaymentMethodOptionsIdealSetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for ConfirmPaymentIntentPaymentMethodOptionsIdealSetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for ConfirmPaymentIntentPaymentMethodOptionsIdealSetupFutureUsage { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// If this is a `klarna` PaymentMethod, this sub-hash contains details about the Klarna payment method options. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct ConfirmPaymentIntentPaymentMethodOptionsKlarna { + /// Controls when the funds will be captured from the customer's account. + /// + /// If provided, this parameter will override the top-level `capture_method` when finalizing the payment with this payment method type. + /// + /// If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter will unset the stored value for this payment method type. + #[serde(skip_serializing_if = "Option::is_none")] + pub capture_method: Option, + /// Preferred language of the Klarna authorization page that the customer is redirected to + #[serde(skip_serializing_if = "Option::is_none")] + pub preferred_locale: Option, + /// Indicates that you intend to make future payments with this PaymentIntent's payment method. + /// + /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. + /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + /// + /// When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + /// + /// If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. + #[serde(skip_serializing_if = "Option::is_none")] + pub setup_future_usage: Option, +} +impl ConfirmPaymentIntentPaymentMethodOptionsKlarna { + pub fn new() -> Self { + Self::default() + } +} +/// Controls when the funds will be captured from the customer's account. +/// +/// If provided, this parameter will override the top-level `capture_method` when finalizing the payment with this payment method type. +/// +/// If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter will unset the stored value for this payment method type. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum ConfirmPaymentIntentPaymentMethodOptionsKlarnaCaptureMethod { + Manual, +} +impl ConfirmPaymentIntentPaymentMethodOptionsKlarnaCaptureMethod { + pub fn as_str(self) -> &'static str { + use ConfirmPaymentIntentPaymentMethodOptionsKlarnaCaptureMethod::*; + match self { + Manual => "manual", + } + } +} + +impl std::str::FromStr for ConfirmPaymentIntentPaymentMethodOptionsKlarnaCaptureMethod { + type Err = (); + fn from_str(s: &str) -> Result { + use ConfirmPaymentIntentPaymentMethodOptionsKlarnaCaptureMethod::*; + match s { + "manual" => Ok(Manual), + _ => Err(()), + } + } +} +impl std::fmt::Display for ConfirmPaymentIntentPaymentMethodOptionsKlarnaCaptureMethod { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for ConfirmPaymentIntentPaymentMethodOptionsKlarnaCaptureMethod { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for ConfirmPaymentIntentPaymentMethodOptionsKlarnaCaptureMethod { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Preferred language of the Klarna authorization page that the customer is redirected to +#[derive(Copy, Clone, Eq, PartialEq)] +#[non_exhaustive] +pub enum ConfirmPaymentIntentPaymentMethodOptionsKlarnaPreferredLocale { + CsMinusCz, + DaMinusDk, + DeMinusAt, + DeMinusCh, + DeMinusDe, + ElMinusGr, + EnMinusAt, + EnMinusAu, + EnMinusBe, + EnMinusCa, + EnMinusCh, + EnMinusCz, + EnMinusDe, + EnMinusDk, + EnMinusEs, + EnMinusFi, + EnMinusFr, + EnMinusGb, + EnMinusGr, + EnMinusIe, + EnMinusIt, + EnMinusNl, + EnMinusNo, + EnMinusNz, + EnMinusPl, + EnMinusPt, + EnMinusSe, + EnMinusUs, + EsMinusEs, + EsMinusUs, + FiMinusFi, + FrMinusBe, + FrMinusCa, + FrMinusCh, + FrMinusFr, + ItMinusCh, + ItMinusIt, + NbMinusNo, + NlMinusBe, + NlMinusNl, + PlMinusPl, + PtMinusPt, + SvMinusFi, + SvMinusSe, + /// An unrecognized value from Stripe. Should not be used as a request parameter. + Unknown, +} +impl ConfirmPaymentIntentPaymentMethodOptionsKlarnaPreferredLocale { + pub fn as_str(self) -> &'static str { + use ConfirmPaymentIntentPaymentMethodOptionsKlarnaPreferredLocale::*; + match self { + CsMinusCz => "cs-CZ", + DaMinusDk => "da-DK", + DeMinusAt => "de-AT", + DeMinusCh => "de-CH", + DeMinusDe => "de-DE", + ElMinusGr => "el-GR", + EnMinusAt => "en-AT", + EnMinusAu => "en-AU", + EnMinusBe => "en-BE", + EnMinusCa => "en-CA", + EnMinusCh => "en-CH", + EnMinusCz => "en-CZ", + EnMinusDe => "en-DE", + EnMinusDk => "en-DK", + EnMinusEs => "en-ES", + EnMinusFi => "en-FI", + EnMinusFr => "en-FR", + EnMinusGb => "en-GB", + EnMinusGr => "en-GR", + EnMinusIe => "en-IE", + EnMinusIt => "en-IT", + EnMinusNl => "en-NL", + EnMinusNo => "en-NO", + EnMinusNz => "en-NZ", + EnMinusPl => "en-PL", + EnMinusPt => "en-PT", + EnMinusSe => "en-SE", + EnMinusUs => "en-US", + EsMinusEs => "es-ES", + EsMinusUs => "es-US", + FiMinusFi => "fi-FI", + FrMinusBe => "fr-BE", + FrMinusCa => "fr-CA", + FrMinusCh => "fr-CH", + FrMinusFr => "fr-FR", + ItMinusCh => "it-CH", + ItMinusIt => "it-IT", + NbMinusNo => "nb-NO", + NlMinusBe => "nl-BE", + NlMinusNl => "nl-NL", + PlMinusPl => "pl-PL", + PtMinusPt => "pt-PT", + SvMinusFi => "sv-FI", + SvMinusSe => "sv-SE", + Unknown => "unknown", + } + } +} + +impl std::str::FromStr for ConfirmPaymentIntentPaymentMethodOptionsKlarnaPreferredLocale { + type Err = (); + fn from_str(s: &str) -> Result { + use ConfirmPaymentIntentPaymentMethodOptionsKlarnaPreferredLocale::*; + match s { + "cs-CZ" => Ok(CsMinusCz), + "da-DK" => Ok(DaMinusDk), + "de-AT" => Ok(DeMinusAt), + "de-CH" => Ok(DeMinusCh), + "de-DE" => Ok(DeMinusDe), + "el-GR" => Ok(ElMinusGr), + "en-AT" => Ok(EnMinusAt), + "en-AU" => Ok(EnMinusAu), + "en-BE" => Ok(EnMinusBe), + "en-CA" => Ok(EnMinusCa), + "en-CH" => Ok(EnMinusCh), + "en-CZ" => Ok(EnMinusCz), + "en-DE" => Ok(EnMinusDe), + "en-DK" => Ok(EnMinusDk), + "en-ES" => Ok(EnMinusEs), + "en-FI" => Ok(EnMinusFi), + "en-FR" => Ok(EnMinusFr), + "en-GB" => Ok(EnMinusGb), + "en-GR" => Ok(EnMinusGr), + "en-IE" => Ok(EnMinusIe), + "en-IT" => Ok(EnMinusIt), + "en-NL" => Ok(EnMinusNl), + "en-NO" => Ok(EnMinusNo), + "en-NZ" => Ok(EnMinusNz), + "en-PL" => Ok(EnMinusPl), + "en-PT" => Ok(EnMinusPt), + "en-SE" => Ok(EnMinusSe), + "en-US" => Ok(EnMinusUs), + "es-ES" => Ok(EsMinusEs), + "es-US" => Ok(EsMinusUs), + "fi-FI" => Ok(FiMinusFi), + "fr-BE" => Ok(FrMinusBe), + "fr-CA" => Ok(FrMinusCa), + "fr-CH" => Ok(FrMinusCh), + "fr-FR" => Ok(FrMinusFr), + "it-CH" => Ok(ItMinusCh), + "it-IT" => Ok(ItMinusIt), + "nb-NO" => Ok(NbMinusNo), + "nl-BE" => Ok(NlMinusBe), + "nl-NL" => Ok(NlMinusNl), + "pl-PL" => Ok(PlMinusPl), + "pt-PT" => Ok(PtMinusPt), + "sv-FI" => Ok(SvMinusFi), + "sv-SE" => Ok(SvMinusSe), + _ => Err(()), + } + } +} +impl std::fmt::Display for ConfirmPaymentIntentPaymentMethodOptionsKlarnaPreferredLocale { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for ConfirmPaymentIntentPaymentMethodOptionsKlarnaPreferredLocale { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for ConfirmPaymentIntentPaymentMethodOptionsKlarnaPreferredLocale { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Indicates that you intend to make future payments with this PaymentIntent's payment method. +/// +/// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. +/// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. +/// +/// When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). +/// +/// If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum ConfirmPaymentIntentPaymentMethodOptionsKlarnaSetupFutureUsage { + None, +} +impl ConfirmPaymentIntentPaymentMethodOptionsKlarnaSetupFutureUsage { + pub fn as_str(self) -> &'static str { + use ConfirmPaymentIntentPaymentMethodOptionsKlarnaSetupFutureUsage::*; + match self { + None => "none", + } + } +} + +impl std::str::FromStr for ConfirmPaymentIntentPaymentMethodOptionsKlarnaSetupFutureUsage { + type Err = (); + fn from_str(s: &str) -> Result { + use ConfirmPaymentIntentPaymentMethodOptionsKlarnaSetupFutureUsage::*; + match s { + "none" => Ok(None), + _ => Err(()), + } + } +} +impl std::fmt::Display for ConfirmPaymentIntentPaymentMethodOptionsKlarnaSetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for ConfirmPaymentIntentPaymentMethodOptionsKlarnaSetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for ConfirmPaymentIntentPaymentMethodOptionsKlarnaSetupFutureUsage { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// If this is a `konbini` PaymentMethod, this sub-hash contains details about the Konbini payment method options. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct ConfirmPaymentIntentPaymentMethodOptionsKonbini<'a> { + /// An optional 10 to 11 digit numeric-only string determining the confirmation code at applicable convenience stores. + /// Must not consist of only zeroes and could be rejected in case of insufficient uniqueness. + /// We recommend to use the customer's phone number. + #[serde(skip_serializing_if = "Option::is_none")] + pub confirmation_number: Option<&'a str>, + /// The number of calendar days (between 1 and 60) after which Konbini payment instructions will expire. + /// For example, if a PaymentIntent is confirmed with Konbini and `expires_after_days` set to 2 on Monday JST, the instructions will expire on Wednesday 23:59:59 JST. + /// Defaults to 3 days. + #[serde(skip_serializing_if = "Option::is_none")] + pub expires_after_days: Option, + /// The timestamp at which the Konbini payment instructions will expire. + /// Only one of `expires_after_days` or `expires_at` may be set. + #[serde(skip_serializing_if = "Option::is_none")] + pub expires_at: Option, + /// A product descriptor of up to 22 characters, which will appear to customers at the convenience store. + #[serde(skip_serializing_if = "Option::is_none")] + pub product_description: Option<&'a str>, + /// Indicates that you intend to make future payments with this PaymentIntent's payment method. + /// + /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. + /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + /// + /// When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + /// + /// If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. + #[serde(skip_serializing_if = "Option::is_none")] + pub setup_future_usage: Option, +} +impl<'a> ConfirmPaymentIntentPaymentMethodOptionsKonbini<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// Indicates that you intend to make future payments with this PaymentIntent's payment method. +/// +/// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. +/// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. +/// +/// When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). +/// +/// If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum ConfirmPaymentIntentPaymentMethodOptionsKonbiniSetupFutureUsage { + None, +} +impl ConfirmPaymentIntentPaymentMethodOptionsKonbiniSetupFutureUsage { + pub fn as_str(self) -> &'static str { + use ConfirmPaymentIntentPaymentMethodOptionsKonbiniSetupFutureUsage::*; + match self { + None => "none", + } + } +} + +impl std::str::FromStr for ConfirmPaymentIntentPaymentMethodOptionsKonbiniSetupFutureUsage { + type Err = (); + fn from_str(s: &str) -> Result { + use ConfirmPaymentIntentPaymentMethodOptionsKonbiniSetupFutureUsage::*; + match s { + "none" => Ok(None), + _ => Err(()), + } + } +} +impl std::fmt::Display for ConfirmPaymentIntentPaymentMethodOptionsKonbiniSetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for ConfirmPaymentIntentPaymentMethodOptionsKonbiniSetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for ConfirmPaymentIntentPaymentMethodOptionsKonbiniSetupFutureUsage { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// If this is a `link` PaymentMethod, this sub-hash contains details about the Link payment method options. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct ConfirmPaymentIntentPaymentMethodOptionsLink<'a> { + /// Controls when the funds will be captured from the customer's account. + /// + /// If provided, this parameter will override the top-level `capture_method` when finalizing the payment with this payment method type. + /// + /// If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter will unset the stored value for this payment method type. + #[serde(skip_serializing_if = "Option::is_none")] + pub capture_method: Option, + /// \[Deprecated\] This is a legacy parameter that no longer has any function. + #[serde(skip_serializing_if = "Option::is_none")] + pub persistent_token: Option<&'a str>, + /// Indicates that you intend to make future payments with this PaymentIntent's payment method. + /// + /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. + /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + /// + /// When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + /// + /// If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. + #[serde(skip_serializing_if = "Option::is_none")] + pub setup_future_usage: Option, +} +impl<'a> ConfirmPaymentIntentPaymentMethodOptionsLink<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// Controls when the funds will be captured from the customer's account. +/// +/// If provided, this parameter will override the top-level `capture_method` when finalizing the payment with this payment method type. +/// +/// If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter will unset the stored value for this payment method type. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum ConfirmPaymentIntentPaymentMethodOptionsLinkCaptureMethod { + Manual, +} +impl ConfirmPaymentIntentPaymentMethodOptionsLinkCaptureMethod { + pub fn as_str(self) -> &'static str { + use ConfirmPaymentIntentPaymentMethodOptionsLinkCaptureMethod::*; + match self { + Manual => "manual", + } + } +} + +impl std::str::FromStr for ConfirmPaymentIntentPaymentMethodOptionsLinkCaptureMethod { + type Err = (); + fn from_str(s: &str) -> Result { + use ConfirmPaymentIntentPaymentMethodOptionsLinkCaptureMethod::*; + match s { + "manual" => Ok(Manual), + _ => Err(()), + } + } +} +impl std::fmt::Display for ConfirmPaymentIntentPaymentMethodOptionsLinkCaptureMethod { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for ConfirmPaymentIntentPaymentMethodOptionsLinkCaptureMethod { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for ConfirmPaymentIntentPaymentMethodOptionsLinkCaptureMethod { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Indicates that you intend to make future payments with this PaymentIntent's payment method. +/// +/// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. +/// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. +/// +/// When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). +/// +/// If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum ConfirmPaymentIntentPaymentMethodOptionsLinkSetupFutureUsage { + None, + OffSession, +} +impl ConfirmPaymentIntentPaymentMethodOptionsLinkSetupFutureUsage { + pub fn as_str(self) -> &'static str { + use ConfirmPaymentIntentPaymentMethodOptionsLinkSetupFutureUsage::*; + match self { + None => "none", + OffSession => "off_session", + } + } +} + +impl std::str::FromStr for ConfirmPaymentIntentPaymentMethodOptionsLinkSetupFutureUsage { + type Err = (); + fn from_str(s: &str) -> Result { + use ConfirmPaymentIntentPaymentMethodOptionsLinkSetupFutureUsage::*; + match s { + "none" => Ok(None), + "off_session" => Ok(OffSession), + _ => Err(()), + } + } +} +impl std::fmt::Display for ConfirmPaymentIntentPaymentMethodOptionsLinkSetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for ConfirmPaymentIntentPaymentMethodOptionsLinkSetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for ConfirmPaymentIntentPaymentMethodOptionsLinkSetupFutureUsage { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// If this is a `oxxo` PaymentMethod, this sub-hash contains details about the OXXO payment method options. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct ConfirmPaymentIntentPaymentMethodOptionsOxxo { + /// The number of calendar days before an OXXO voucher expires. + /// For example, if you create an OXXO voucher on Monday and you set expires_after_days to 2, the OXXO invoice will expire on Wednesday at 23:59 America/Mexico_City time. + #[serde(skip_serializing_if = "Option::is_none")] + pub expires_after_days: Option, + /// Indicates that you intend to make future payments with this PaymentIntent's payment method. + /// + /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. + /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + /// + /// When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + /// + /// If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. + #[serde(skip_serializing_if = "Option::is_none")] + pub setup_future_usage: Option, +} +impl ConfirmPaymentIntentPaymentMethodOptionsOxxo { + pub fn new() -> Self { + Self::default() + } +} +/// Indicates that you intend to make future payments with this PaymentIntent's payment method. +/// +/// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. +/// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. +/// +/// When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). +/// +/// If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum ConfirmPaymentIntentPaymentMethodOptionsOxxoSetupFutureUsage { + None, +} +impl ConfirmPaymentIntentPaymentMethodOptionsOxxoSetupFutureUsage { + pub fn as_str(self) -> &'static str { + use ConfirmPaymentIntentPaymentMethodOptionsOxxoSetupFutureUsage::*; + match self { + None => "none", + } + } +} + +impl std::str::FromStr for ConfirmPaymentIntentPaymentMethodOptionsOxxoSetupFutureUsage { + type Err = (); + fn from_str(s: &str) -> Result { + use ConfirmPaymentIntentPaymentMethodOptionsOxxoSetupFutureUsage::*; + match s { + "none" => Ok(None), + _ => Err(()), + } + } +} +impl std::fmt::Display for ConfirmPaymentIntentPaymentMethodOptionsOxxoSetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for ConfirmPaymentIntentPaymentMethodOptionsOxxoSetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for ConfirmPaymentIntentPaymentMethodOptionsOxxoSetupFutureUsage { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// If this is a `p24` PaymentMethod, this sub-hash contains details about the Przelewy24 payment method options. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct ConfirmPaymentIntentPaymentMethodOptionsP24 { + /// Indicates that you intend to make future payments with this PaymentIntent's payment method. + /// + /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. + /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + /// + /// When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + /// + /// If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. + #[serde(skip_serializing_if = "Option::is_none")] + pub setup_future_usage: Option, + /// Confirm that the payer has accepted the P24 terms and conditions. + #[serde(skip_serializing_if = "Option::is_none")] + pub tos_shown_and_accepted: Option, +} +impl ConfirmPaymentIntentPaymentMethodOptionsP24 { + pub fn new() -> Self { + Self::default() + } +} +/// Indicates that you intend to make future payments with this PaymentIntent's payment method. +/// +/// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. +/// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. +/// +/// When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). +/// +/// If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum ConfirmPaymentIntentPaymentMethodOptionsP24SetupFutureUsage { + None, +} +impl ConfirmPaymentIntentPaymentMethodOptionsP24SetupFutureUsage { + pub fn as_str(self) -> &'static str { + use ConfirmPaymentIntentPaymentMethodOptionsP24SetupFutureUsage::*; + match self { + None => "none", + } + } +} + +impl std::str::FromStr for ConfirmPaymentIntentPaymentMethodOptionsP24SetupFutureUsage { + type Err = (); + fn from_str(s: &str) -> Result { + use ConfirmPaymentIntentPaymentMethodOptionsP24SetupFutureUsage::*; + match s { + "none" => Ok(None), + _ => Err(()), + } + } +} +impl std::fmt::Display for ConfirmPaymentIntentPaymentMethodOptionsP24SetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for ConfirmPaymentIntentPaymentMethodOptionsP24SetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for ConfirmPaymentIntentPaymentMethodOptionsP24SetupFutureUsage { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// If this is a `paynow` PaymentMethod, this sub-hash contains details about the PayNow payment method options. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct ConfirmPaymentIntentPaymentMethodOptionsPaynow { + /// Indicates that you intend to make future payments with this PaymentIntent's payment method. + /// + /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. + /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + /// + /// When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + /// + /// If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. + #[serde(skip_serializing_if = "Option::is_none")] + pub setup_future_usage: Option, +} +impl ConfirmPaymentIntentPaymentMethodOptionsPaynow { + pub fn new() -> Self { + Self::default() + } +} +/// Indicates that you intend to make future payments with this PaymentIntent's payment method. +/// +/// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. +/// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. +/// +/// When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). +/// +/// If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum ConfirmPaymentIntentPaymentMethodOptionsPaynowSetupFutureUsage { + None, +} +impl ConfirmPaymentIntentPaymentMethodOptionsPaynowSetupFutureUsage { + pub fn as_str(self) -> &'static str { + use ConfirmPaymentIntentPaymentMethodOptionsPaynowSetupFutureUsage::*; + match self { + None => "none", + } + } +} + +impl std::str::FromStr for ConfirmPaymentIntentPaymentMethodOptionsPaynowSetupFutureUsage { + type Err = (); + fn from_str(s: &str) -> Result { + use ConfirmPaymentIntentPaymentMethodOptionsPaynowSetupFutureUsage::*; + match s { + "none" => Ok(None), + _ => Err(()), + } + } +} +impl std::fmt::Display for ConfirmPaymentIntentPaymentMethodOptionsPaynowSetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for ConfirmPaymentIntentPaymentMethodOptionsPaynowSetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for ConfirmPaymentIntentPaymentMethodOptionsPaynowSetupFutureUsage { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// If this is a `paypal` PaymentMethod, this sub-hash contains details about the PayPal payment method options. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct ConfirmPaymentIntentPaymentMethodOptionsPaypal<'a> { + /// Controls when the funds will be captured from the customer's account. + #[serde(skip_serializing_if = "Option::is_none")] + pub capture_method: Option, + /// [Preferred locale](https://stripe.com/docs/payments/paypal/supported-locales) of the PayPal checkout page that the customer is redirected to. + #[serde(skip_serializing_if = "Option::is_none")] + pub preferred_locale: Option, + /// A reference of the PayPal transaction visible to customer which is mapped to PayPal's invoice ID. + /// This must be a globally unique ID if you have configured in your PayPal settings to block multiple payments per invoice ID. + #[serde(skip_serializing_if = "Option::is_none")] + pub reference: Option<&'a str>, + /// The risk correlation ID for an on-session payment using a saved PayPal payment method. + #[serde(skip_serializing_if = "Option::is_none")] + pub risk_correlation_id: Option<&'a str>, + /// Indicates that you intend to make future payments with this PaymentIntent's payment method. + /// + /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. + /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + /// + /// When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + /// + /// If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. + #[serde(skip_serializing_if = "Option::is_none")] + pub setup_future_usage: Option, +} +impl<'a> ConfirmPaymentIntentPaymentMethodOptionsPaypal<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// Controls when the funds will be captured from the customer's account. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum ConfirmPaymentIntentPaymentMethodOptionsPaypalCaptureMethod { + Manual, +} +impl ConfirmPaymentIntentPaymentMethodOptionsPaypalCaptureMethod { + pub fn as_str(self) -> &'static str { + use ConfirmPaymentIntentPaymentMethodOptionsPaypalCaptureMethod::*; + match self { + Manual => "manual", + } + } +} + +impl std::str::FromStr for ConfirmPaymentIntentPaymentMethodOptionsPaypalCaptureMethod { + type Err = (); + fn from_str(s: &str) -> Result { + use ConfirmPaymentIntentPaymentMethodOptionsPaypalCaptureMethod::*; + match s { + "manual" => Ok(Manual), + _ => Err(()), + } + } +} +impl std::fmt::Display for ConfirmPaymentIntentPaymentMethodOptionsPaypalCaptureMethod { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for ConfirmPaymentIntentPaymentMethodOptionsPaypalCaptureMethod { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for ConfirmPaymentIntentPaymentMethodOptionsPaypalCaptureMethod { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// [Preferred locale](https://stripe.com/docs/payments/paypal/supported-locales) of the PayPal checkout page that the customer is redirected to. +#[derive(Copy, Clone, Eq, PartialEq)] +#[non_exhaustive] +pub enum ConfirmPaymentIntentPaymentMethodOptionsPaypalPreferredLocale { + CsMinusCz, + DaMinusDk, + DeMinusAt, + DeMinusDe, + DeMinusLu, + ElMinusGr, + EnMinusGb, + EnMinusUs, + EsMinusEs, + FiMinusFi, + FrMinusBe, + FrMinusFr, + FrMinusLu, + HuMinusHu, + ItMinusIt, + NlMinusBe, + NlMinusNl, + PlMinusPl, + PtMinusPt, + SkMinusSk, + SvMinusSe, + /// An unrecognized value from Stripe. Should not be used as a request parameter. + Unknown, +} +impl ConfirmPaymentIntentPaymentMethodOptionsPaypalPreferredLocale { + pub fn as_str(self) -> &'static str { + use ConfirmPaymentIntentPaymentMethodOptionsPaypalPreferredLocale::*; + match self { + CsMinusCz => "cs-CZ", + DaMinusDk => "da-DK", + DeMinusAt => "de-AT", + DeMinusDe => "de-DE", + DeMinusLu => "de-LU", + ElMinusGr => "el-GR", + EnMinusGb => "en-GB", + EnMinusUs => "en-US", + EsMinusEs => "es-ES", + FiMinusFi => "fi-FI", + FrMinusBe => "fr-BE", + FrMinusFr => "fr-FR", + FrMinusLu => "fr-LU", + HuMinusHu => "hu-HU", + ItMinusIt => "it-IT", + NlMinusBe => "nl-BE", + NlMinusNl => "nl-NL", + PlMinusPl => "pl-PL", + PtMinusPt => "pt-PT", + SkMinusSk => "sk-SK", + SvMinusSe => "sv-SE", + Unknown => "unknown", + } + } +} + +impl std::str::FromStr for ConfirmPaymentIntentPaymentMethodOptionsPaypalPreferredLocale { + type Err = (); + fn from_str(s: &str) -> Result { + use ConfirmPaymentIntentPaymentMethodOptionsPaypalPreferredLocale::*; + match s { + "cs-CZ" => Ok(CsMinusCz), + "da-DK" => Ok(DaMinusDk), + "de-AT" => Ok(DeMinusAt), + "de-DE" => Ok(DeMinusDe), + "de-LU" => Ok(DeMinusLu), + "el-GR" => Ok(ElMinusGr), + "en-GB" => Ok(EnMinusGb), + "en-US" => Ok(EnMinusUs), + "es-ES" => Ok(EsMinusEs), + "fi-FI" => Ok(FiMinusFi), + "fr-BE" => Ok(FrMinusBe), + "fr-FR" => Ok(FrMinusFr), + "fr-LU" => Ok(FrMinusLu), + "hu-HU" => Ok(HuMinusHu), + "it-IT" => Ok(ItMinusIt), + "nl-BE" => Ok(NlMinusBe), + "nl-NL" => Ok(NlMinusNl), + "pl-PL" => Ok(PlMinusPl), + "pt-PT" => Ok(PtMinusPt), + "sk-SK" => Ok(SkMinusSk), + "sv-SE" => Ok(SvMinusSe), + _ => Err(()), + } + } +} +impl std::fmt::Display for ConfirmPaymentIntentPaymentMethodOptionsPaypalPreferredLocale { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for ConfirmPaymentIntentPaymentMethodOptionsPaypalPreferredLocale { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for ConfirmPaymentIntentPaymentMethodOptionsPaypalPreferredLocale { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Indicates that you intend to make future payments with this PaymentIntent's payment method. +/// +/// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. +/// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. +/// +/// When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). +/// +/// If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum ConfirmPaymentIntentPaymentMethodOptionsPaypalSetupFutureUsage { + None, + OffSession, +} +impl ConfirmPaymentIntentPaymentMethodOptionsPaypalSetupFutureUsage { + pub fn as_str(self) -> &'static str { + use ConfirmPaymentIntentPaymentMethodOptionsPaypalSetupFutureUsage::*; + match self { + None => "none", + OffSession => "off_session", + } + } +} + +impl std::str::FromStr for ConfirmPaymentIntentPaymentMethodOptionsPaypalSetupFutureUsage { + type Err = (); + fn from_str(s: &str) -> Result { + use ConfirmPaymentIntentPaymentMethodOptionsPaypalSetupFutureUsage::*; + match s { + "none" => Ok(None), + "off_session" => Ok(OffSession), + _ => Err(()), + } + } +} +impl std::fmt::Display for ConfirmPaymentIntentPaymentMethodOptionsPaypalSetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for ConfirmPaymentIntentPaymentMethodOptionsPaypalSetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for ConfirmPaymentIntentPaymentMethodOptionsPaypalSetupFutureUsage { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// If this is a `pix` PaymentMethod, this sub-hash contains details about the Pix payment method options. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct ConfirmPaymentIntentPaymentMethodOptionsPix { + /// The number of seconds (between 10 and 1209600) after which Pix payment will expire. + /// Defaults to 86400 seconds. + #[serde(skip_serializing_if = "Option::is_none")] + pub expires_after_seconds: Option, + /// The timestamp at which the Pix expires (between 10 and 1209600 seconds in the future). + /// Defaults to 1 day in the future. + #[serde(skip_serializing_if = "Option::is_none")] + pub expires_at: Option, + /// Indicates that you intend to make future payments with this PaymentIntent's payment method. + /// + /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. + /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + /// + /// When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + /// + /// If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. + #[serde(skip_serializing_if = "Option::is_none")] + pub setup_future_usage: Option, +} +impl ConfirmPaymentIntentPaymentMethodOptionsPix { + pub fn new() -> Self { + Self::default() + } +} +/// Indicates that you intend to make future payments with this PaymentIntent's payment method. +/// +/// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. +/// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. +/// +/// When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). +/// +/// If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum ConfirmPaymentIntentPaymentMethodOptionsPixSetupFutureUsage { + None, +} +impl ConfirmPaymentIntentPaymentMethodOptionsPixSetupFutureUsage { + pub fn as_str(self) -> &'static str { + use ConfirmPaymentIntentPaymentMethodOptionsPixSetupFutureUsage::*; + match self { + None => "none", + } + } +} + +impl std::str::FromStr for ConfirmPaymentIntentPaymentMethodOptionsPixSetupFutureUsage { + type Err = (); + fn from_str(s: &str) -> Result { + use ConfirmPaymentIntentPaymentMethodOptionsPixSetupFutureUsage::*; + match s { + "none" => Ok(None), + _ => Err(()), + } + } +} +impl std::fmt::Display for ConfirmPaymentIntentPaymentMethodOptionsPixSetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for ConfirmPaymentIntentPaymentMethodOptionsPixSetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for ConfirmPaymentIntentPaymentMethodOptionsPixSetupFutureUsage { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// If this is a `promptpay` PaymentMethod, this sub-hash contains details about the PromptPay payment method options. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct ConfirmPaymentIntentPaymentMethodOptionsPromptpay { + /// Indicates that you intend to make future payments with this PaymentIntent's payment method. + /// + /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. + /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + /// + /// When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + /// + /// If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. + #[serde(skip_serializing_if = "Option::is_none")] + pub setup_future_usage: + Option, +} +impl ConfirmPaymentIntentPaymentMethodOptionsPromptpay { + pub fn new() -> Self { + Self::default() + } +} +/// Indicates that you intend to make future payments with this PaymentIntent's payment method. +/// +/// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. +/// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. +/// +/// When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). +/// +/// If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum ConfirmPaymentIntentPaymentMethodOptionsPromptpaySetupFutureUsage { + None, +} +impl ConfirmPaymentIntentPaymentMethodOptionsPromptpaySetupFutureUsage { + pub fn as_str(self) -> &'static str { + use ConfirmPaymentIntentPaymentMethodOptionsPromptpaySetupFutureUsage::*; + match self { + None => "none", + } + } +} + +impl std::str::FromStr for ConfirmPaymentIntentPaymentMethodOptionsPromptpaySetupFutureUsage { + type Err = (); + fn from_str(s: &str) -> Result { + use ConfirmPaymentIntentPaymentMethodOptionsPromptpaySetupFutureUsage::*; + match s { + "none" => Ok(None), + _ => Err(()), + } + } +} +impl std::fmt::Display for ConfirmPaymentIntentPaymentMethodOptionsPromptpaySetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for ConfirmPaymentIntentPaymentMethodOptionsPromptpaySetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for ConfirmPaymentIntentPaymentMethodOptionsPromptpaySetupFutureUsage { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// If this is a `revolut_pay` PaymentMethod, this sub-hash contains details about the Revolut Pay payment method options. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct ConfirmPaymentIntentPaymentMethodOptionsRevolutPay { + /// Indicates that you intend to make future payments with this PaymentIntent's payment method. + /// + /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. + /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + /// + /// When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + #[serde(skip_serializing_if = "Option::is_none")] + pub setup_future_usage: + Option, +} +impl ConfirmPaymentIntentPaymentMethodOptionsRevolutPay { + pub fn new() -> Self { + Self::default() + } +} +/// Indicates that you intend to make future payments with this PaymentIntent's payment method. +/// +/// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. +/// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. +/// +/// When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum ConfirmPaymentIntentPaymentMethodOptionsRevolutPaySetupFutureUsage { + None, + OffSession, +} +impl ConfirmPaymentIntentPaymentMethodOptionsRevolutPaySetupFutureUsage { + pub fn as_str(self) -> &'static str { + use ConfirmPaymentIntentPaymentMethodOptionsRevolutPaySetupFutureUsage::*; + match self { + None => "none", + OffSession => "off_session", + } + } +} + +impl std::str::FromStr for ConfirmPaymentIntentPaymentMethodOptionsRevolutPaySetupFutureUsage { + type Err = (); + fn from_str(s: &str) -> Result { + use ConfirmPaymentIntentPaymentMethodOptionsRevolutPaySetupFutureUsage::*; + match s { + "none" => Ok(None), + "off_session" => Ok(OffSession), + _ => Err(()), + } + } +} +impl std::fmt::Display for ConfirmPaymentIntentPaymentMethodOptionsRevolutPaySetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for ConfirmPaymentIntentPaymentMethodOptionsRevolutPaySetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for ConfirmPaymentIntentPaymentMethodOptionsRevolutPaySetupFutureUsage { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// If this is a `sepa_debit` PaymentIntent, this sub-hash contains details about the SEPA Debit payment method options. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct ConfirmPaymentIntentPaymentMethodOptionsSepaDebit<'a> { + /// Additional fields for Mandate creation + #[serde(skip_serializing_if = "Option::is_none")] + pub mandate_options: Option<&'a serde_json::Value>, + /// Indicates that you intend to make future payments with this PaymentIntent's payment method. + /// + /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. + /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + /// + /// When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + /// + /// If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. + #[serde(skip_serializing_if = "Option::is_none")] + pub setup_future_usage: + Option, +} +impl<'a> ConfirmPaymentIntentPaymentMethodOptionsSepaDebit<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// Indicates that you intend to make future payments with this PaymentIntent's payment method. +/// +/// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. +/// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. +/// +/// When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). +/// +/// If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum ConfirmPaymentIntentPaymentMethodOptionsSepaDebitSetupFutureUsage { + None, + OffSession, + OnSession, +} +impl ConfirmPaymentIntentPaymentMethodOptionsSepaDebitSetupFutureUsage { + pub fn as_str(self) -> &'static str { + use ConfirmPaymentIntentPaymentMethodOptionsSepaDebitSetupFutureUsage::*; + match self { + None => "none", + OffSession => "off_session", + OnSession => "on_session", + } + } +} + +impl std::str::FromStr for ConfirmPaymentIntentPaymentMethodOptionsSepaDebitSetupFutureUsage { + type Err = (); + fn from_str(s: &str) -> Result { + use ConfirmPaymentIntentPaymentMethodOptionsSepaDebitSetupFutureUsage::*; + match s { + "none" => Ok(None), + "off_session" => Ok(OffSession), + "on_session" => Ok(OnSession), + _ => Err(()), + } + } +} +impl std::fmt::Display for ConfirmPaymentIntentPaymentMethodOptionsSepaDebitSetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for ConfirmPaymentIntentPaymentMethodOptionsSepaDebitSetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for ConfirmPaymentIntentPaymentMethodOptionsSepaDebitSetupFutureUsage { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// If this is a `sofort` PaymentMethod, this sub-hash contains details about the SOFORT payment method options. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct ConfirmPaymentIntentPaymentMethodOptionsSofort { + /// Language shown to the payer on redirect. + #[serde(skip_serializing_if = "Option::is_none")] + pub preferred_language: Option, + /// Indicates that you intend to make future payments with this PaymentIntent's payment method. + /// + /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. + /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + /// + /// When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + /// + /// If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. + #[serde(skip_serializing_if = "Option::is_none")] + pub setup_future_usage: Option, +} +impl ConfirmPaymentIntentPaymentMethodOptionsSofort { + pub fn new() -> Self { + Self::default() + } +} +/// Language shown to the payer on redirect. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum ConfirmPaymentIntentPaymentMethodOptionsSofortPreferredLanguage { + De, + En, + Es, + Fr, + It, + Nl, + Pl, +} +impl ConfirmPaymentIntentPaymentMethodOptionsSofortPreferredLanguage { + pub fn as_str(self) -> &'static str { + use ConfirmPaymentIntentPaymentMethodOptionsSofortPreferredLanguage::*; + match self { + De => "de", + En => "en", + Es => "es", + Fr => "fr", + It => "it", + Nl => "nl", + Pl => "pl", + } + } +} + +impl std::str::FromStr for ConfirmPaymentIntentPaymentMethodOptionsSofortPreferredLanguage { + type Err = (); + fn from_str(s: &str) -> Result { + use ConfirmPaymentIntentPaymentMethodOptionsSofortPreferredLanguage::*; + match s { + "de" => Ok(De), + "en" => Ok(En), + "es" => Ok(Es), + "fr" => Ok(Fr), + "it" => Ok(It), + "nl" => Ok(Nl), + "pl" => Ok(Pl), + _ => Err(()), + } + } +} +impl std::fmt::Display for ConfirmPaymentIntentPaymentMethodOptionsSofortPreferredLanguage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for ConfirmPaymentIntentPaymentMethodOptionsSofortPreferredLanguage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for ConfirmPaymentIntentPaymentMethodOptionsSofortPreferredLanguage { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Indicates that you intend to make future payments with this PaymentIntent's payment method. +/// +/// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. +/// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. +/// +/// When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). +/// +/// If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum ConfirmPaymentIntentPaymentMethodOptionsSofortSetupFutureUsage { + None, + OffSession, +} +impl ConfirmPaymentIntentPaymentMethodOptionsSofortSetupFutureUsage { + pub fn as_str(self) -> &'static str { + use ConfirmPaymentIntentPaymentMethodOptionsSofortSetupFutureUsage::*; + match self { + None => "none", + OffSession => "off_session", + } + } +} + +impl std::str::FromStr for ConfirmPaymentIntentPaymentMethodOptionsSofortSetupFutureUsage { + type Err = (); + fn from_str(s: &str) -> Result { + use ConfirmPaymentIntentPaymentMethodOptionsSofortSetupFutureUsage::*; + match s { + "none" => Ok(None), + "off_session" => Ok(OffSession), + _ => Err(()), + } + } +} +impl std::fmt::Display for ConfirmPaymentIntentPaymentMethodOptionsSofortSetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for ConfirmPaymentIntentPaymentMethodOptionsSofortSetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for ConfirmPaymentIntentPaymentMethodOptionsSofortSetupFutureUsage { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// If this is a `Swish` PaymentMethod, this sub-hash contains details about the Swish payment method options. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct ConfirmPaymentIntentPaymentMethodOptionsSwish<'a> { + /// The order ID displayed in the Swish app after the payment is authorized. + #[serde(skip_serializing_if = "Option::is_none")] + pub reference: Option<&'a str>, + /// Indicates that you intend to make future payments with this PaymentIntent's payment method. + /// + /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. + /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + /// + /// When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + /// + /// If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. + #[serde(skip_serializing_if = "Option::is_none")] + pub setup_future_usage: Option, +} +impl<'a> ConfirmPaymentIntentPaymentMethodOptionsSwish<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// Indicates that you intend to make future payments with this PaymentIntent's payment method. +/// +/// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. +/// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. +/// +/// When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). +/// +/// If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum ConfirmPaymentIntentPaymentMethodOptionsSwishSetupFutureUsage { + None, +} +impl ConfirmPaymentIntentPaymentMethodOptionsSwishSetupFutureUsage { + pub fn as_str(self) -> &'static str { + use ConfirmPaymentIntentPaymentMethodOptionsSwishSetupFutureUsage::*; + match self { + None => "none", + } + } +} + +impl std::str::FromStr for ConfirmPaymentIntentPaymentMethodOptionsSwishSetupFutureUsage { + type Err = (); + fn from_str(s: &str) -> Result { + use ConfirmPaymentIntentPaymentMethodOptionsSwishSetupFutureUsage::*; + match s { + "none" => Ok(None), + _ => Err(()), + } + } +} +impl std::fmt::Display for ConfirmPaymentIntentPaymentMethodOptionsSwishSetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for ConfirmPaymentIntentPaymentMethodOptionsSwishSetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for ConfirmPaymentIntentPaymentMethodOptionsSwishSetupFutureUsage { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// If this is a `us_bank_account` PaymentMethod, this sub-hash contains details about the US bank account payment method options. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct ConfirmPaymentIntentPaymentMethodOptionsUsBankAccount<'a> { + /// Additional fields for Financial Connections Session creation + #[serde(skip_serializing_if = "Option::is_none")] + pub financial_connections: + Option>, + /// Additional fields for Mandate creation + #[serde(skip_serializing_if = "Option::is_none")] + pub mandate_options: + Option, + /// Additional fields for network related functions + #[serde(skip_serializing_if = "Option::is_none")] + pub networks: Option>, + /// Preferred transaction settlement speed + #[serde(skip_serializing_if = "Option::is_none")] + pub preferred_settlement_speed: + Option, + /// Indicates that you intend to make future payments with this PaymentIntent's payment method. + /// + /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. + /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + /// + /// When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + /// + /// If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. + #[serde(skip_serializing_if = "Option::is_none")] + pub setup_future_usage: + Option, + /// Bank account verification method. + #[serde(skip_serializing_if = "Option::is_none")] + pub verification_method: + Option, +} +impl<'a> ConfirmPaymentIntentPaymentMethodOptionsUsBankAccount<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// Additional fields for Financial Connections Session creation +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct ConfirmPaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnections<'a> { + /// The list of permissions to request. + /// If this parameter is passed, the `payment_method` permission must be included. + /// Valid permissions include: `balances`, `ownership`, `payment_method`, and `transactions`. +#[serde(skip_serializing_if = "Option::is_none")] +pub permissions: Option<&'a [ConfirmPaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions]>, + /// List of data features that you would like to retrieve upon account creation. +#[serde(skip_serializing_if = "Option::is_none")] +pub prefetch: Option<&'a [ConfirmPaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch]>, + /// For webview integrations only. + /// Upon completing OAuth login in the native browser, the user will be redirected to this URL to return to your app. +#[serde(skip_serializing_if = "Option::is_none")] +pub return_url: Option<&'a str>, + +} +impl<'a> ConfirmPaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnections<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// The list of permissions to request. +/// If this parameter is passed, the `payment_method` permission must be included. +/// Valid permissions include: `balances`, `ownership`, `payment_method`, and `transactions`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum ConfirmPaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions { + Balances, + Ownership, + PaymentMethod, + Transactions, +} +impl ConfirmPaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions { + pub fn as_str(self) -> &'static str { + use ConfirmPaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions::*; + match self { + Balances => "balances", + Ownership => "ownership", + PaymentMethod => "payment_method", + Transactions => "transactions", + } + } +} + +impl std::str::FromStr + for ConfirmPaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions +{ + type Err = (); + fn from_str(s: &str) -> Result { + use ConfirmPaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions::*; + match s { + "balances" => Ok(Balances), + "ownership" => Ok(Ownership), + "payment_method" => Ok(PaymentMethod), + "transactions" => Ok(Transactions), + _ => Err(()), + } + } +} +impl std::fmt::Display + for ConfirmPaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions +{ + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug + for ConfirmPaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions +{ + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize + for ConfirmPaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions +{ + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// List of data features that you would like to retrieve upon account creation. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum ConfirmPaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch { + Balances, + Transactions, +} +impl ConfirmPaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch { + pub fn as_str(self) -> &'static str { + use ConfirmPaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch::*; + match self { + Balances => "balances", + Transactions => "transactions", + } + } +} + +impl std::str::FromStr + for ConfirmPaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch +{ + type Err = (); + fn from_str(s: &str) -> Result { + use ConfirmPaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch::*; + match s { + "balances" => Ok(Balances), + "transactions" => Ok(Transactions), + _ => Err(()), + } + } +} +impl std::fmt::Display + for ConfirmPaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch +{ + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug + for ConfirmPaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch +{ + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize + for ConfirmPaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch +{ + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Additional fields for Mandate creation +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct ConfirmPaymentIntentPaymentMethodOptionsUsBankAccountMandateOptions { + /// The method used to collect offline mandate customer acceptance. + #[serde(skip_serializing_if = "Option::is_none")] + pub collection_method: + Option, +} +impl ConfirmPaymentIntentPaymentMethodOptionsUsBankAccountMandateOptions { + pub fn new() -> Self { + Self::default() + } +} +/// The method used to collect offline mandate customer acceptance. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum ConfirmPaymentIntentPaymentMethodOptionsUsBankAccountMandateOptionsCollectionMethod { + Paper, +} +impl ConfirmPaymentIntentPaymentMethodOptionsUsBankAccountMandateOptionsCollectionMethod { + pub fn as_str(self) -> &'static str { + use ConfirmPaymentIntentPaymentMethodOptionsUsBankAccountMandateOptionsCollectionMethod::*; + match self { + Paper => "paper", + } + } +} + +impl std::str::FromStr + for ConfirmPaymentIntentPaymentMethodOptionsUsBankAccountMandateOptionsCollectionMethod +{ + type Err = (); + fn from_str(s: &str) -> Result { + use ConfirmPaymentIntentPaymentMethodOptionsUsBankAccountMandateOptionsCollectionMethod::*; + match s { + "paper" => Ok(Paper), + _ => Err(()), + } + } +} +impl std::fmt::Display + for ConfirmPaymentIntentPaymentMethodOptionsUsBankAccountMandateOptionsCollectionMethod +{ + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug + for ConfirmPaymentIntentPaymentMethodOptionsUsBankAccountMandateOptionsCollectionMethod +{ + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize + for ConfirmPaymentIntentPaymentMethodOptionsUsBankAccountMandateOptionsCollectionMethod +{ + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Additional fields for network related functions +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct ConfirmPaymentIntentPaymentMethodOptionsUsBankAccountNetworks<'a> { + /// Triggers validations to run across the selected networks + #[serde(skip_serializing_if = "Option::is_none")] + pub requested: + Option<&'a [ConfirmPaymentIntentPaymentMethodOptionsUsBankAccountNetworksRequested]>, +} +impl<'a> ConfirmPaymentIntentPaymentMethodOptionsUsBankAccountNetworks<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// Triggers validations to run across the selected networks +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum ConfirmPaymentIntentPaymentMethodOptionsUsBankAccountNetworksRequested { + Ach, + UsDomesticWire, +} +impl ConfirmPaymentIntentPaymentMethodOptionsUsBankAccountNetworksRequested { + pub fn as_str(self) -> &'static str { + use ConfirmPaymentIntentPaymentMethodOptionsUsBankAccountNetworksRequested::*; + match self { + Ach => "ach", + UsDomesticWire => "us_domestic_wire", + } + } +} + +impl std::str::FromStr for ConfirmPaymentIntentPaymentMethodOptionsUsBankAccountNetworksRequested { + type Err = (); + fn from_str(s: &str) -> Result { + use ConfirmPaymentIntentPaymentMethodOptionsUsBankAccountNetworksRequested::*; + match s { + "ach" => Ok(Ach), + "us_domestic_wire" => Ok(UsDomesticWire), + _ => Err(()), + } + } +} +impl std::fmt::Display for ConfirmPaymentIntentPaymentMethodOptionsUsBankAccountNetworksRequested { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for ConfirmPaymentIntentPaymentMethodOptionsUsBankAccountNetworksRequested { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for ConfirmPaymentIntentPaymentMethodOptionsUsBankAccountNetworksRequested { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Preferred transaction settlement speed +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum ConfirmPaymentIntentPaymentMethodOptionsUsBankAccountPreferredSettlementSpeed { + Fastest, + Standard, +} +impl ConfirmPaymentIntentPaymentMethodOptionsUsBankAccountPreferredSettlementSpeed { + pub fn as_str(self) -> &'static str { + use ConfirmPaymentIntentPaymentMethodOptionsUsBankAccountPreferredSettlementSpeed::*; + match self { + Fastest => "fastest", + Standard => "standard", + } + } +} + +impl std::str::FromStr + for ConfirmPaymentIntentPaymentMethodOptionsUsBankAccountPreferredSettlementSpeed +{ + type Err = (); + fn from_str(s: &str) -> Result { + use ConfirmPaymentIntentPaymentMethodOptionsUsBankAccountPreferredSettlementSpeed::*; + match s { + "fastest" => Ok(Fastest), + "standard" => Ok(Standard), + _ => Err(()), + } + } +} +impl std::fmt::Display + for ConfirmPaymentIntentPaymentMethodOptionsUsBankAccountPreferredSettlementSpeed +{ + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug + for ConfirmPaymentIntentPaymentMethodOptionsUsBankAccountPreferredSettlementSpeed +{ + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize + for ConfirmPaymentIntentPaymentMethodOptionsUsBankAccountPreferredSettlementSpeed +{ + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Indicates that you intend to make future payments with this PaymentIntent's payment method. +/// +/// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. +/// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. +/// +/// When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). +/// +/// If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum ConfirmPaymentIntentPaymentMethodOptionsUsBankAccountSetupFutureUsage { + None, + OffSession, + OnSession, +} +impl ConfirmPaymentIntentPaymentMethodOptionsUsBankAccountSetupFutureUsage { + pub fn as_str(self) -> &'static str { + use ConfirmPaymentIntentPaymentMethodOptionsUsBankAccountSetupFutureUsage::*; + match self { + None => "none", + OffSession => "off_session", + OnSession => "on_session", + } + } +} + +impl std::str::FromStr for ConfirmPaymentIntentPaymentMethodOptionsUsBankAccountSetupFutureUsage { + type Err = (); + fn from_str(s: &str) -> Result { + use ConfirmPaymentIntentPaymentMethodOptionsUsBankAccountSetupFutureUsage::*; + match s { + "none" => Ok(None), + "off_session" => Ok(OffSession), + "on_session" => Ok(OnSession), + _ => Err(()), + } + } +} +impl std::fmt::Display for ConfirmPaymentIntentPaymentMethodOptionsUsBankAccountSetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for ConfirmPaymentIntentPaymentMethodOptionsUsBankAccountSetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for ConfirmPaymentIntentPaymentMethodOptionsUsBankAccountSetupFutureUsage { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Bank account verification method. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum ConfirmPaymentIntentPaymentMethodOptionsUsBankAccountVerificationMethod { + Automatic, + Instant, + Microdeposits, +} +impl ConfirmPaymentIntentPaymentMethodOptionsUsBankAccountVerificationMethod { + pub fn as_str(self) -> &'static str { + use ConfirmPaymentIntentPaymentMethodOptionsUsBankAccountVerificationMethod::*; + match self { + Automatic => "automatic", + Instant => "instant", + Microdeposits => "microdeposits", + } + } +} + +impl std::str::FromStr for ConfirmPaymentIntentPaymentMethodOptionsUsBankAccountVerificationMethod { + type Err = (); + fn from_str(s: &str) -> Result { + use ConfirmPaymentIntentPaymentMethodOptionsUsBankAccountVerificationMethod::*; + match s { + "automatic" => Ok(Automatic), + "instant" => Ok(Instant), + "microdeposits" => Ok(Microdeposits), + _ => Err(()), + } + } +} +impl std::fmt::Display for ConfirmPaymentIntentPaymentMethodOptionsUsBankAccountVerificationMethod { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for ConfirmPaymentIntentPaymentMethodOptionsUsBankAccountVerificationMethod { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for ConfirmPaymentIntentPaymentMethodOptionsUsBankAccountVerificationMethod { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// If this is a `wechat_pay` PaymentMethod, this sub-hash contains details about the WeChat Pay payment method options. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct ConfirmPaymentIntentPaymentMethodOptionsWechatPay<'a> { + /// The app ID registered with WeChat Pay. Only required when client is ios or android. + #[serde(skip_serializing_if = "Option::is_none")] + pub app_id: Option<&'a str>, + /// The client type that the end customer will pay from + pub client: ConfirmPaymentIntentPaymentMethodOptionsWechatPayClient, + /// Indicates that you intend to make future payments with this PaymentIntent's payment method. + /// + /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. + /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + /// + /// When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + /// + /// If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. + #[serde(skip_serializing_if = "Option::is_none")] + pub setup_future_usage: + Option, +} +impl<'a> ConfirmPaymentIntentPaymentMethodOptionsWechatPay<'a> { + pub fn new(client: ConfirmPaymentIntentPaymentMethodOptionsWechatPayClient) -> Self { + Self { app_id: None, client, setup_future_usage: None } + } +} +/// The client type that the end customer will pay from +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum ConfirmPaymentIntentPaymentMethodOptionsWechatPayClient { + Android, + Ios, + Web, +} +impl ConfirmPaymentIntentPaymentMethodOptionsWechatPayClient { + pub fn as_str(self) -> &'static str { + use ConfirmPaymentIntentPaymentMethodOptionsWechatPayClient::*; + match self { + Android => "android", + Ios => "ios", + Web => "web", + } + } +} + +impl std::str::FromStr for ConfirmPaymentIntentPaymentMethodOptionsWechatPayClient { + type Err = (); + fn from_str(s: &str) -> Result { + use ConfirmPaymentIntentPaymentMethodOptionsWechatPayClient::*; + match s { + "android" => Ok(Android), + "ios" => Ok(Ios), + "web" => Ok(Web), + _ => Err(()), + } + } +} +impl std::fmt::Display for ConfirmPaymentIntentPaymentMethodOptionsWechatPayClient { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for ConfirmPaymentIntentPaymentMethodOptionsWechatPayClient { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for ConfirmPaymentIntentPaymentMethodOptionsWechatPayClient { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Indicates that you intend to make future payments with this PaymentIntent's payment method. +/// +/// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. +/// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. +/// +/// When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). +/// +/// If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum ConfirmPaymentIntentPaymentMethodOptionsWechatPaySetupFutureUsage { + None, +} +impl ConfirmPaymentIntentPaymentMethodOptionsWechatPaySetupFutureUsage { + pub fn as_str(self) -> &'static str { + use ConfirmPaymentIntentPaymentMethodOptionsWechatPaySetupFutureUsage::*; + match self { + None => "none", + } + } +} + +impl std::str::FromStr for ConfirmPaymentIntentPaymentMethodOptionsWechatPaySetupFutureUsage { + type Err = (); + fn from_str(s: &str) -> Result { + use ConfirmPaymentIntentPaymentMethodOptionsWechatPaySetupFutureUsage::*; + match s { + "none" => Ok(None), + _ => Err(()), + } + } +} +impl std::fmt::Display for ConfirmPaymentIntentPaymentMethodOptionsWechatPaySetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for ConfirmPaymentIntentPaymentMethodOptionsWechatPaySetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for ConfirmPaymentIntentPaymentMethodOptionsWechatPaySetupFutureUsage { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// If this is a `zip` PaymentMethod, this sub-hash contains details about the Zip payment method options. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct ConfirmPaymentIntentPaymentMethodOptionsZip { + /// Indicates that you intend to make future payments with this PaymentIntent's payment method. + /// + /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. + /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + /// + /// When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + /// + /// If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. + #[serde(skip_serializing_if = "Option::is_none")] + pub setup_future_usage: Option, +} +impl ConfirmPaymentIntentPaymentMethodOptionsZip { + pub fn new() -> Self { + Self::default() + } +} +/// Indicates that you intend to make future payments with this PaymentIntent's payment method. +/// +/// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. +/// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. +/// +/// When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). +/// +/// If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum ConfirmPaymentIntentPaymentMethodOptionsZipSetupFutureUsage { + None, +} +impl ConfirmPaymentIntentPaymentMethodOptionsZipSetupFutureUsage { + pub fn as_str(self) -> &'static str { + use ConfirmPaymentIntentPaymentMethodOptionsZipSetupFutureUsage::*; + match self { + None => "none", + } + } +} + +impl std::str::FromStr for ConfirmPaymentIntentPaymentMethodOptionsZipSetupFutureUsage { + type Err = (); + fn from_str(s: &str) -> Result { + use ConfirmPaymentIntentPaymentMethodOptionsZipSetupFutureUsage::*; + match s { + "none" => Ok(None), + _ => Err(()), + } + } +} +impl std::fmt::Display for ConfirmPaymentIntentPaymentMethodOptionsZipSetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for ConfirmPaymentIntentPaymentMethodOptionsZipSetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for ConfirmPaymentIntentPaymentMethodOptionsZipSetupFutureUsage { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Options to configure Radar. +/// Learn more about [Radar Sessions](https://stripe.com/docs/radar/radar-session). +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct ConfirmPaymentIntentRadarOptions<'a> { + /// A [Radar Session](https://stripe.com/docs/radar/radar-session) is a snapshot of the browser metadata and device details that help Radar make more accurate predictions on your payments. + #[serde(skip_serializing_if = "Option::is_none")] + pub session: Option<&'a str>, +} +impl<'a> ConfirmPaymentIntentRadarOptions<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// Shipping information for this PaymentIntent. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct ConfirmPaymentIntentShipping<'a> { + /// Shipping address. + pub address: ConfirmPaymentIntentShippingAddress<'a>, + /// The delivery service that shipped a physical product, such as Fedex, UPS, USPS, etc. + #[serde(skip_serializing_if = "Option::is_none")] + pub carrier: Option<&'a str>, + /// Recipient name. + pub name: &'a str, + /// Recipient phone (including extension). + #[serde(skip_serializing_if = "Option::is_none")] + pub phone: Option<&'a str>, + /// The tracking number for a physical product, obtained from the delivery service. + /// If multiple tracking numbers were generated for this purchase, please separate them with commas. + #[serde(skip_serializing_if = "Option::is_none")] + pub tracking_number: Option<&'a str>, +} +impl<'a> ConfirmPaymentIntentShipping<'a> { + pub fn new(address: ConfirmPaymentIntentShippingAddress<'a>, name: &'a str) -> Self { + Self { address, carrier: None, name, phone: None, tracking_number: None } + } +} +/// Shipping address. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct ConfirmPaymentIntentShippingAddress<'a> { + /// City, district, suburb, town, or village. + #[serde(skip_serializing_if = "Option::is_none")] + pub city: Option<&'a str>, + /// Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). + #[serde(skip_serializing_if = "Option::is_none")] + pub country: Option<&'a str>, + /// Address line 1 (e.g., street, PO Box, or company name). + #[serde(skip_serializing_if = "Option::is_none")] + pub line1: Option<&'a str>, + /// Address line 2 (e.g., apartment, suite, unit, or building). + #[serde(skip_serializing_if = "Option::is_none")] + pub line2: Option<&'a str>, + /// ZIP or postal code. + #[serde(skip_serializing_if = "Option::is_none")] + pub postal_code: Option<&'a str>, + /// State, county, province, or region. + #[serde(skip_serializing_if = "Option::is_none")] + pub state: Option<&'a str>, +} +impl<'a> ConfirmPaymentIntentShippingAddress<'a> { + pub fn new() -> Self { + Self::default() + } +} +impl<'a> ConfirmPaymentIntent<'a> { + /// Confirm that your customer intends to pay with current or provided + /// payment method. Upon confirmation, the PaymentIntent will attempt to initiate + /// a payment. + /// If the selected payment method requires additional authentication steps, the + /// PaymentIntent will transition to the `requires_action` status and + /// suggest additional actions via `next_action`. If payment fails, + /// the PaymentIntent transitions to the `requires_payment_method` status or the + /// `canceled` status if the confirmation limit is reached. If + /// payment succeeds, the PaymentIntent will transition to the `succeeded` + /// status (or `requires_capture`, if `capture_method` is set to `manual`). + /// If the `confirmation_method` is `automatic`, payment may be attempted + /// using our [client SDKs](https://stripe.com/docs/stripe-js/reference#stripe-handle-card-payment) + /// and the PaymentIntent’s [client_secret](https://stripe.com/docs/api#payment_intent_object-client_secret). + /// After `next_action`s are handled by the client, no additional + /// confirmation is required to complete the payment. + /// If the `confirmation_method` is `manual`, all payment attempts must be + /// initiated using a secret key. + /// If any actions are required for the payment, the PaymentIntent will + /// return to the `requires_confirmation` state + /// after those actions are completed. Your server needs to then + /// explicitly re-confirm the PaymentIntent to initiate the next payment + /// attempt. + /// Read the [expanded documentation](https://stripe.com/docs/payments/payment-intents/web-manual). + /// to learn more about manual confirmation. + pub fn send( + &self, + client: &stripe::Client, + intent: &stripe_shared::PaymentIntentId, + ) -> stripe::Response { + client.send_form( + &format!("/payment_intents/{intent}/confirm"), + self, + http_types::Method::Post, + ) + } +} +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct IncrementAuthorizationPaymentIntent<'a> { + /// The updated total amount that you intend to collect from the cardholder. + /// This amount must be greater than the currently authorized amount. + pub amount: i64, + /// The amount of the application fee (if any) that will be requested to be applied to the payment and transferred to the application owner's Stripe account. + /// The amount of the application fee collected will be capped at the total payment amount. + /// For more information, see the PaymentIntents [use case for connected accounts](https://stripe.com/docs/payments/connected-accounts). + #[serde(skip_serializing_if = "Option::is_none")] + pub application_fee_amount: Option, + /// An arbitrary string attached to the object. Often useful for displaying to users. + #[serde(skip_serializing_if = "Option::is_none")] + pub description: Option<&'a str>, + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, + /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. + /// This can be useful for storing additional information about the object in a structured format. + /// Individual keys can be unset by posting an empty value to them. + /// All keys can be unset by posting an empty value to `metadata`. + #[serde(skip_serializing_if = "Option::is_none")] + pub metadata: Option<&'a std::collections::HashMap>, + /// For card charges, use [statement_descriptor_suffix](https://stripe.com/docs/payments/account/statement-descriptors#dynamic). + /// Otherwise, you can use this value as the complete description of a charge on your customers' statements. + /// It must contain at least one letter and be 1–22 characters long. + #[serde(skip_serializing_if = "Option::is_none")] + pub statement_descriptor: Option<&'a str>, + /// The parameters used to automatically create a transfer after the payment is captured. + /// Learn more about the [use case for connected accounts](https://stripe.com/docs/payments/connected-accounts). + #[serde(skip_serializing_if = "Option::is_none")] + pub transfer_data: Option, +} +impl<'a> IncrementAuthorizationPaymentIntent<'a> { + pub fn new(amount: i64) -> Self { + Self { + amount, + application_fee_amount: None, + description: None, + expand: None, + metadata: None, + statement_descriptor: None, + transfer_data: None, + } + } +} +impl<'a> IncrementAuthorizationPaymentIntent<'a> { + /// Perform an incremental authorization on an eligible + /// [PaymentIntent](https://stripe.com/docs/api/payment_intents/object). To be eligible, the + /// PaymentIntent’s status must be `requires_capture` and + /// [incremental_authorization_supported](https://stripe.com/docs/api/charges/object#charge_object-payment_method_details-card_present-incremental_authorization_supported). + /// must be `true`. + /// + /// Incremental authorizations attempt to increase the authorized amount on + /// your customer’s card to the new, higher `amount` provided. Similar to the + /// initial authorization, incremental authorizations can be declined. A + /// single PaymentIntent can call this endpoint multiple times to further + /// increase the authorized amount. + /// + /// If the incremental authorization succeeds, the PaymentIntent object + /// returns with the updated + /// [amount](https://stripe.com/docs/api/payment_intents/object#payment_intent_object-amount). + /// If the incremental authorization fails, a + /// [card_declined](https://stripe.com/docs/error-codes#card-declined) error returns, and no other + /// fields on the PaymentIntent or Charge update. The PaymentIntent + /// object remains capturable for the previously authorized amount. + /// + /// Each PaymentIntent can have a maximum of 10 incremental authorization attempts, including declines. + /// After it’s captured, a PaymentIntent can no longer be incremented. + /// + /// Learn more about [incremental authorizations](https://stripe.com/docs/terminal/features/incremental-authorizations). + pub fn send( + &self, + client: &stripe::Client, + intent: &stripe_shared::PaymentIntentId, + ) -> stripe::Response { + client.send_form( + &format!("/payment_intents/{intent}/increment_authorization"), + self, + http_types::Method::Post, + ) + } +} +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct VerifyMicrodepositsPaymentIntent<'a> { + /// Two positive integers, in *cents*, equal to the values of the microdeposits sent to the bank account. + #[serde(skip_serializing_if = "Option::is_none")] + pub amounts: Option<&'a [i64]>, + /// A six-character code starting with SM present in the microdeposit sent to the bank account. + #[serde(skip_serializing_if = "Option::is_none")] + pub descriptor_code: Option<&'a str>, + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, +} +impl<'a> VerifyMicrodepositsPaymentIntent<'a> { + pub fn new() -> Self { + Self::default() + } +} +impl<'a> VerifyMicrodepositsPaymentIntent<'a> { + /// Verifies microdeposits on a PaymentIntent object. + pub fn send( + &self, + client: &stripe::Client, + intent: &stripe_shared::PaymentIntentId, + ) -> stripe::Response { + client.send_form( + &format!("/payment_intents/{intent}/verify_microdeposits"), + self, + http_types::Method::Post, + ) + } +} +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct OnlineParam<'a> { + /// The IP address from which the Mandate was accepted by the customer. + pub ip_address: &'a str, + /// The user agent of the browser from which the Mandate was accepted by the customer. + pub user_agent: &'a str, +} +impl<'a> OnlineParam<'a> { + pub fn new(ip_address: &'a str, user_agent: &'a str) -> Self { + Self { ip_address, user_agent } + } +} +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct PaymentMethodParam<'a> { + /// Customer's bank account number. + pub account_number: &'a str, + /// Institution number of the customer's bank. + pub institution_number: &'a str, + /// Transit number of the customer's bank. + pub transit_number: &'a str, +} +impl<'a> PaymentMethodParam<'a> { + pub fn new( + account_number: &'a str, + institution_number: &'a str, + transit_number: &'a str, + ) -> Self { + Self { account_number, institution_number, transit_number } + } +} +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct DateOfBirth { + /// The day of birth, between 1 and 31. + pub day: i64, + /// The month of birth, between 1 and 12. + pub month: i64, + /// The four-digit year of birth. + pub year: i64, +} +impl DateOfBirth { + pub fn new(day: i64, month: i64, year: i64) -> Self { + Self { day, month, year } + } +} +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct PaymentMethodOptionsParam { + /// Request ability to capture this payment beyond the standard [authorization validity window](https://stripe.com/docs/terminal/features/extended-authorizations#authorization-validity). + #[serde(skip_serializing_if = "Option::is_none")] + pub request_extended_authorization: Option, + /// Request ability to [increment](https://stripe.com/docs/terminal/features/incremental-authorizations) this PaymentIntent if the combination of MCC and card brand is eligible. + /// Check [incremental_authorization_supported](https://stripe.com/docs/api/charges/object#charge_object-payment_method_details-card_present-incremental_authorization_supported) in the [Confirm](https://stripe.com/docs/api/payment_intents/confirm) response to verify support. + #[serde(skip_serializing_if = "Option::is_none")] + pub request_incremental_authorization_support: Option, +} +impl PaymentMethodOptionsParam { + pub fn new() -> Self { + Self::default() + } +} +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct EuBankTransferParams<'a> { + /// The desired country code of the bank account information. + /// Permitted values include: `BE`, `DE`, `ES`, `FR`, `IE`, or `NL`. + pub country: &'a str, +} +impl<'a> EuBankTransferParams<'a> { + pub fn new(country: &'a str) -> Self { + Self { country } + } +} +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct TransferDataUpdateParams { + /// The amount that will be transferred automatically when a charge succeeds. + #[serde(skip_serializing_if = "Option::is_none")] + pub amount: Option, +} +impl TransferDataUpdateParams { + pub fn new() -> Self { + Self::default() + } +} diff --git a/generated/stripe_core/src/payment_source/mod.rs b/generated/stripe_core/src/payment_source/mod.rs new file mode 100644 index 000000000..b1be84a14 --- /dev/null +++ b/generated/stripe_core/src/payment_source/mod.rs @@ -0,0 +1,4 @@ +#[cfg(feature = "payment_source")] +mod requests; +#[cfg(feature = "payment_source")] +pub use requests::*; diff --git a/generated/stripe_core/src/payment_source/requests.rs b/generated/stripe_core/src/payment_source/requests.rs new file mode 100644 index 000000000..40402f3e8 --- /dev/null +++ b/generated/stripe_core/src/payment_source/requests.rs @@ -0,0 +1,101 @@ +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct ListCustomerPaymentSource<'a> { + /// A cursor for use in pagination. + /// `ending_before` is an object ID that defines your place in the list. + /// For instance, if you make a list request and receive 100 objects, starting with `obj_bar`, your subsequent call can include `ending_before=obj_bar` in order to fetch the previous page of the list. + #[serde(skip_serializing_if = "Option::is_none")] + pub ending_before: Option<&'a str>, + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, + /// A limit on the number of objects to be returned. + /// Limit can range between 1 and 100, and the default is 10. + #[serde(skip_serializing_if = "Option::is_none")] + pub limit: Option, + /// Filter sources according to a particular object type. + #[serde(skip_serializing_if = "Option::is_none")] + pub object: Option<&'a str>, + /// A cursor for use in pagination. + /// `starting_after` is an object ID that defines your place in the list. + /// For instance, if you make a list request and receive 100 objects, ending with `obj_foo`, your subsequent call can include `starting_after=obj_foo` in order to fetch the next page of the list. + #[serde(skip_serializing_if = "Option::is_none")] + pub starting_after: Option<&'a str>, +} +impl<'a> ListCustomerPaymentSource<'a> { + pub fn new() -> Self { + Self::default() + } +} +impl<'a> ListCustomerPaymentSource<'a> { + /// List sources for a specified customer. + pub fn send( + &self, + client: &stripe::Client, + customer: &stripe_shared::CustomerId, + ) -> stripe::Response> { + client.get_query(&format!("/customers/{customer}/sources"), self) + } + pub fn paginate( + self, + customer: &stripe_shared::CustomerId, + ) -> stripe::ListPaginator> { + stripe::ListPaginator::from_list_params(&format!("/customers/{customer}/sources"), self) + } +} +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct RetrievePaymentSource<'a> { + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, +} +impl<'a> RetrievePaymentSource<'a> { + pub fn new() -> Self { + Self::default() + } +} +impl<'a> RetrievePaymentSource<'a> { + /// Retrieve a specified source for a given customer. + pub fn send( + &self, + client: &stripe::Client, + customer: &stripe_shared::CustomerId, + id: &str, + ) -> stripe::Response { + client.get_query(&format!("/customers/{customer}/sources/{id}"), self) + } +} +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreateCustomerPaymentSource<'a> { + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, + /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. + /// This can be useful for storing additional information about the object in a structured format. + /// Individual keys can be unset by posting an empty value to them. + /// All keys can be unset by posting an empty value to `metadata`. + #[serde(skip_serializing_if = "Option::is_none")] + pub metadata: Option<&'a std::collections::HashMap>, + /// Please refer to full [documentation](https://stripe.com/docs/api) instead. + pub source: &'a str, + #[serde(skip_serializing_if = "Option::is_none")] + pub validate: Option, +} +impl<'a> CreateCustomerPaymentSource<'a> { + pub fn new(source: &'a str) -> Self { + Self { expand: None, metadata: None, source, validate: None } + } +} +impl<'a> CreateCustomerPaymentSource<'a> { + /// When you create a new credit card, you must specify a customer or recipient on which to create it. + /// + /// If the card’s owner has no default card, then the new card will become the default. + /// However, if the owner already has a default, then it will not change. + /// To change the default, you should [update the customer](https://stripe.com/docs/api#update_customer) to have a new `default_source`. + pub fn send( + &self, + client: &stripe::Client, + customer: &stripe_shared::CustomerId, + ) -> stripe::Response { + client.send_form(&format!("/customers/{customer}/sources"), self, http_types::Method::Post) + } +} diff --git a/generated/stripe_core/src/payout/mod.rs b/generated/stripe_core/src/payout/mod.rs new file mode 100644 index 000000000..9d5e3f05e --- /dev/null +++ b/generated/stripe_core/src/payout/mod.rs @@ -0,0 +1,4 @@ +#[cfg(feature = "payout")] +mod requests; +#[cfg(feature = "payout")] +pub use requests::*; diff --git a/generated/stripe_core/src/payout/requests.rs b/generated/stripe_core/src/payout/requests.rs new file mode 100644 index 000000000..48cad35dd --- /dev/null +++ b/generated/stripe_core/src/payout/requests.rs @@ -0,0 +1,323 @@ +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct ListPayout<'a> { + #[serde(skip_serializing_if = "Option::is_none")] + pub arrival_date: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub created: Option, + /// The ID of an external account - only return payouts sent to this external account. + #[serde(skip_serializing_if = "Option::is_none")] + pub destination: Option<&'a str>, + /// A cursor for use in pagination. + /// `ending_before` is an object ID that defines your place in the list. + /// For instance, if you make a list request and receive 100 objects, starting with `obj_bar`, your subsequent call can include `ending_before=obj_bar` in order to fetch the previous page of the list. + #[serde(skip_serializing_if = "Option::is_none")] + pub ending_before: Option<&'a str>, + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, + /// A limit on the number of objects to be returned. + /// Limit can range between 1 and 100, and the default is 10. + #[serde(skip_serializing_if = "Option::is_none")] + pub limit: Option, + /// A cursor for use in pagination. + /// `starting_after` is an object ID that defines your place in the list. + /// For instance, if you make a list request and receive 100 objects, ending with `obj_foo`, your subsequent call can include `starting_after=obj_foo` in order to fetch the next page of the list. + #[serde(skip_serializing_if = "Option::is_none")] + pub starting_after: Option<&'a str>, + /// Only return payouts that have the given status: `pending`, `paid`, `failed`, or `canceled`. + #[serde(skip_serializing_if = "Option::is_none")] + pub status: Option<&'a str>, +} +impl<'a> ListPayout<'a> { + pub fn new() -> Self { + Self::default() + } +} +impl<'a> ListPayout<'a> { + /// Returns a list of existing payouts sent to third-party bank accounts or payouts that Stripe sent to you. + /// The payouts return in sorted order, with the most recently created payouts appearing first. + pub fn send( + &self, + client: &stripe::Client, + ) -> stripe::Response> { + client.get_query("/payouts", self) + } + pub fn paginate(self) -> stripe::ListPaginator> { + stripe::ListPaginator::from_list_params("/payouts", self) + } +} +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct RetrievePayout<'a> { + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, +} +impl<'a> RetrievePayout<'a> { + pub fn new() -> Self { + Self::default() + } +} +impl<'a> RetrievePayout<'a> { + /// Retrieves the details of an existing payout. + /// Supply the unique payout ID from either a payout creation request or the payout list. + /// Stripe returns the corresponding payout information. + pub fn send( + &self, + client: &stripe::Client, + payout: &stripe_shared::PayoutId, + ) -> stripe::Response { + client.get_query(&format!("/payouts/{payout}"), self) + } +} +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreatePayout<'a> { + /// A positive integer in cents representing how much to payout. + pub amount: i64, + /// Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. + /// Must be a [supported currency](https://stripe.com/docs/currencies). + pub currency: stripe_types::Currency, + /// An arbitrary string attached to the object. Often useful for displaying to users. + #[serde(skip_serializing_if = "Option::is_none")] + pub description: Option<&'a str>, + /// The ID of a bank account or a card to send the payout to. + /// If you don't provide a destination, we use the default external account for the specified currency. + #[serde(skip_serializing_if = "Option::is_none")] + pub destination: Option<&'a str>, + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, + /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. + /// This can be useful for storing additional information about the object in a structured format. + /// Individual keys can be unset by posting an empty value to them. + /// All keys can be unset by posting an empty value to `metadata`. + #[serde(skip_serializing_if = "Option::is_none")] + pub metadata: Option<&'a std::collections::HashMap>, + /// The method used to send this payout, which is `standard` or `instant`. + /// We support `instant` for payouts to debit cards and bank accounts in certain countries. + /// Learn more about [bank support for Instant Payouts](https://stripe.com/docs/payouts/instant-payouts-banks). + #[serde(skip_serializing_if = "Option::is_none")] + pub method: Option, + /// The balance type of your Stripe balance to draw this payout from. + /// Balances for different payment sources are kept separately. + /// You can find the amounts with the Balances API. + /// One of `bank_account`, `card`, or `fpx`. + #[serde(skip_serializing_if = "Option::is_none")] + pub source_type: Option, + /// A string that displays on the recipient's bank or card statement (up to 22 characters). + /// A `statement_descriptor` that's longer than 22 characters return an error. + /// Most banks truncate this information and display it inconsistently. + /// Some banks might not display it at all. + #[serde(skip_serializing_if = "Option::is_none")] + pub statement_descriptor: Option<&'a str>, +} +impl<'a> CreatePayout<'a> { + pub fn new(amount: i64, currency: stripe_types::Currency) -> Self { + Self { + amount, + currency, + description: None, + destination: None, + expand: None, + metadata: None, + method: None, + source_type: None, + statement_descriptor: None, + } + } +} +/// The method used to send this payout, which is `standard` or `instant`. +/// We support `instant` for payouts to debit cards and bank accounts in certain countries. +/// Learn more about [bank support for Instant Payouts](https://stripe.com/docs/payouts/instant-payouts-banks). +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreatePayoutMethod { + Instant, + Standard, +} +impl CreatePayoutMethod { + pub fn as_str(self) -> &'static str { + use CreatePayoutMethod::*; + match self { + Instant => "instant", + Standard => "standard", + } + } +} + +impl std::str::FromStr for CreatePayoutMethod { + type Err = (); + fn from_str(s: &str) -> Result { + use CreatePayoutMethod::*; + match s { + "instant" => Ok(Instant), + "standard" => Ok(Standard), + _ => Err(()), + } + } +} +impl std::fmt::Display for CreatePayoutMethod { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreatePayoutMethod { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreatePayoutMethod { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// The balance type of your Stripe balance to draw this payout from. +/// Balances for different payment sources are kept separately. +/// You can find the amounts with the Balances API. +/// One of `bank_account`, `card`, or `fpx`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreatePayoutSourceType { + BankAccount, + Card, + Fpx, +} +impl CreatePayoutSourceType { + pub fn as_str(self) -> &'static str { + use CreatePayoutSourceType::*; + match self { + BankAccount => "bank_account", + Card => "card", + Fpx => "fpx", + } + } +} + +impl std::str::FromStr for CreatePayoutSourceType { + type Err = (); + fn from_str(s: &str) -> Result { + use CreatePayoutSourceType::*; + match s { + "bank_account" => Ok(BankAccount), + "card" => Ok(Card), + "fpx" => Ok(Fpx), + _ => Err(()), + } + } +} +impl std::fmt::Display for CreatePayoutSourceType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreatePayoutSourceType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreatePayoutSourceType { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'a> CreatePayout<'a> { + /// To send funds to your own bank account, create a new payout object. + /// Your [Stripe balance](https://stripe.com/docs/api#balance) must cover the payout amount. + /// If it doesn’t, you receive an “Insufficient Funds” error. + /// + /// If your API key is in test mode, money won’t actually be sent, though every other action occurs as if you’re in live mode. + /// + /// If you create a manual payout on a Stripe account that uses multiple payment source types, you need to specify the source type balance that the payout draws from. + /// The [balance object](https://stripe.com/docs/api#balance_object) details available and pending amounts by source type. + pub fn send(&self, client: &stripe::Client) -> stripe::Response { + client.send_form("/payouts", self, http_types::Method::Post) + } +} +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdatePayout<'a> { + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, + /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. + /// This can be useful for storing additional information about the object in a structured format. + /// Individual keys can be unset by posting an empty value to them. + /// All keys can be unset by posting an empty value to `metadata`. + #[serde(skip_serializing_if = "Option::is_none")] + pub metadata: Option<&'a std::collections::HashMap>, +} +impl<'a> UpdatePayout<'a> { + pub fn new() -> Self { + Self::default() + } +} +impl<'a> UpdatePayout<'a> { + /// Updates the specified payout by setting the values of the parameters you pass. + /// We don’t change parameters that you don’t provide. + /// This request only accepts the metadata as arguments. + pub fn send( + &self, + client: &stripe::Client, + payout: &stripe_shared::PayoutId, + ) -> stripe::Response { + client.send_form(&format!("/payouts/{payout}"), self, http_types::Method::Post) + } +} +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CancelPayout<'a> { + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, +} +impl<'a> CancelPayout<'a> { + pub fn new() -> Self { + Self::default() + } +} +impl<'a> CancelPayout<'a> { + /// You can cancel a previously created payout if its status is `pending`. + /// Stripe refunds the funds to your available balance. + /// You can’t cancel automatic Stripe payouts. + pub fn send( + &self, + client: &stripe::Client, + payout: &stripe_shared::PayoutId, + ) -> stripe::Response { + client.send_form(&format!("/payouts/{payout}/cancel"), self, http_types::Method::Post) + } +} +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct ReversePayout<'a> { + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, + /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. + /// This can be useful for storing additional information about the object in a structured format. + /// Individual keys can be unset by posting an empty value to them. + /// All keys can be unset by posting an empty value to `metadata`. + #[serde(skip_serializing_if = "Option::is_none")] + pub metadata: Option<&'a std::collections::HashMap>, +} +impl<'a> ReversePayout<'a> { + pub fn new() -> Self { + Self::default() + } +} +impl<'a> ReversePayout<'a> { + /// Reverses a payout by debiting the destination bank account. + /// At this time, you can only reverse payouts for connected accounts to US bank accounts. + /// If the payout is manual and in the `pending` status, use `/v1/payouts/:id/cancel` instead. + /// + /// By requesting a reversal through `/v1/payouts/:id/reverse`, you confirm that the authorized signatory of the selected bank account authorizes the debit on the bank account and that no other authorization is required. + pub fn send( + &self, + client: &stripe::Client, + payout: &stripe_shared::PayoutId, + ) -> stripe::Response { + client.send_form(&format!("/payouts/{payout}/reverse"), self, http_types::Method::Post) + } +} diff --git a/generated/stripe_core/src/refund/mod.rs b/generated/stripe_core/src/refund/mod.rs new file mode 100644 index 000000000..3f6d79058 --- /dev/null +++ b/generated/stripe_core/src/refund/mod.rs @@ -0,0 +1,4 @@ +#[cfg(feature = "refund")] +mod requests; +#[cfg(feature = "refund")] +pub use requests::*; diff --git a/generated/stripe_core/src/refund/requests.rs b/generated/stripe_core/src/refund/requests.rs new file mode 100644 index 000000000..da81c81d0 --- /dev/null +++ b/generated/stripe_core/src/refund/requests.rs @@ -0,0 +1,311 @@ +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct ListRefund<'a> { + /// Only return refunds for the charge specified by this charge ID. + #[serde(skip_serializing_if = "Option::is_none")] + pub charge: Option<&'a str>, + #[serde(skip_serializing_if = "Option::is_none")] + pub created: Option, + /// A cursor for use in pagination. + /// `ending_before` is an object ID that defines your place in the list. + /// For instance, if you make a list request and receive 100 objects, starting with `obj_bar`, your subsequent call can include `ending_before=obj_bar` in order to fetch the previous page of the list. + #[serde(skip_serializing_if = "Option::is_none")] + pub ending_before: Option<&'a str>, + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, + /// A limit on the number of objects to be returned. + /// Limit can range between 1 and 100, and the default is 10. + #[serde(skip_serializing_if = "Option::is_none")] + pub limit: Option, + /// Only return refunds for the PaymentIntent specified by this ID. + #[serde(skip_serializing_if = "Option::is_none")] + pub payment_intent: Option<&'a str>, + /// A cursor for use in pagination. + /// `starting_after` is an object ID that defines your place in the list. + /// For instance, if you make a list request and receive 100 objects, ending with `obj_foo`, your subsequent call can include `starting_after=obj_foo` in order to fetch the next page of the list. + #[serde(skip_serializing_if = "Option::is_none")] + pub starting_after: Option<&'a str>, +} +impl<'a> ListRefund<'a> { + pub fn new() -> Self { + Self::default() + } +} +impl<'a> ListRefund<'a> { + /// Returns a list of all refunds you created. + /// We return the refunds in sorted order, with the most recent refunds appearing first The 10 most recent refunds are always available by default on the Charge object. + pub fn send( + &self, + client: &stripe::Client, + ) -> stripe::Response> { + client.get_query("/refunds", self) + } + pub fn paginate(self) -> stripe::ListPaginator> { + stripe::ListPaginator::from_list_params("/refunds", self) + } +} +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct RetrieveRefund<'a> { + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, +} +impl<'a> RetrieveRefund<'a> { + pub fn new() -> Self { + Self::default() + } +} +impl<'a> RetrieveRefund<'a> { + /// Retrieves the details of an existing refund. + pub fn send( + &self, + client: &stripe::Client, + refund: &stripe_shared::RefundId, + ) -> stripe::Response { + client.get_query(&format!("/refunds/{refund}"), self) + } +} +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreateRefund<'a> { + #[serde(skip_serializing_if = "Option::is_none")] + pub amount: Option, + /// The identifier of the charge to refund. + #[serde(skip_serializing_if = "Option::is_none")] + pub charge: Option<&'a str>, + /// Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. + /// Must be a [supported currency](https://stripe.com/docs/currencies). + #[serde(skip_serializing_if = "Option::is_none")] + pub currency: Option, + /// Customer whose customer balance to refund from. + #[serde(skip_serializing_if = "Option::is_none")] + pub customer: Option<&'a str>, + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, + /// For payment methods without native refund support (e.g., Konbini, PromptPay), use this email from the customer to receive refund instructions. + #[serde(skip_serializing_if = "Option::is_none")] + pub instructions_email: Option<&'a str>, + /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. + /// This can be useful for storing additional information about the object in a structured format. + /// Individual keys can be unset by posting an empty value to them. + /// All keys can be unset by posting an empty value to `metadata`. + #[serde(skip_serializing_if = "Option::is_none")] + pub metadata: Option<&'a std::collections::HashMap>, + /// Origin of the refund + #[serde(skip_serializing_if = "Option::is_none")] + pub origin: Option, + /// The identifier of the PaymentIntent to refund. + #[serde(skip_serializing_if = "Option::is_none")] + pub payment_intent: Option<&'a str>, + /// String indicating the reason for the refund. + /// If set, possible values are `duplicate`, `fraudulent`, and `requested_by_customer`. + /// If you believe the charge to be fraudulent, specifying `fraudulent` as the reason will add the associated card and email to your [block lists](https://stripe.com/docs/radar/lists), and will also help us improve our fraud detection algorithms. + #[serde(skip_serializing_if = "Option::is_none")] + pub reason: Option, + /// Boolean indicating whether the application fee should be refunded when refunding this charge. + /// If a full charge refund is given, the full application fee will be refunded. + /// Otherwise, the application fee will be refunded in an amount proportional to the amount of the charge refunded. + /// An application fee can be refunded only by the application that created the charge. + #[serde(skip_serializing_if = "Option::is_none")] + pub refund_application_fee: Option, + /// Boolean indicating whether the transfer should be reversed when refunding this charge. + /// The transfer will be reversed proportionally to the amount being refunded (either the entire or partial amount). + /// + /// A transfer can be reversed only by the application that created the charge. + #[serde(skip_serializing_if = "Option::is_none")] + pub reverse_transfer: Option, +} +impl<'a> CreateRefund<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// Origin of the refund +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreateRefundOrigin { + CustomerBalance, +} +impl CreateRefundOrigin { + pub fn as_str(self) -> &'static str { + use CreateRefundOrigin::*; + match self { + CustomerBalance => "customer_balance", + } + } +} + +impl std::str::FromStr for CreateRefundOrigin { + type Err = (); + fn from_str(s: &str) -> Result { + use CreateRefundOrigin::*; + match s { + "customer_balance" => Ok(CustomerBalance), + _ => Err(()), + } + } +} +impl std::fmt::Display for CreateRefundOrigin { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreateRefundOrigin { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreateRefundOrigin { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// String indicating the reason for the refund. +/// If set, possible values are `duplicate`, `fraudulent`, and `requested_by_customer`. +/// If you believe the charge to be fraudulent, specifying `fraudulent` as the reason will add the associated card and email to your [block lists](https://stripe.com/docs/radar/lists), and will also help us improve our fraud detection algorithms. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreateRefundReason { + Duplicate, + Fraudulent, + RequestedByCustomer, +} +impl CreateRefundReason { + pub fn as_str(self) -> &'static str { + use CreateRefundReason::*; + match self { + Duplicate => "duplicate", + Fraudulent => "fraudulent", + RequestedByCustomer => "requested_by_customer", + } + } +} + +impl std::str::FromStr for CreateRefundReason { + type Err = (); + fn from_str(s: &str) -> Result { + use CreateRefundReason::*; + match s { + "duplicate" => Ok(Duplicate), + "fraudulent" => Ok(Fraudulent), + "requested_by_customer" => Ok(RequestedByCustomer), + _ => Err(()), + } + } +} +impl std::fmt::Display for CreateRefundReason { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreateRefundReason { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreateRefundReason { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'a> CreateRefund<'a> { + /// When you create a new refund, you must specify a Charge or a PaymentIntent object on which to create it. + /// + /// Creating a new refund will refund a charge that has previously been created but not yet refunded. + /// Funds will be refunded to the credit or debit card that was originally charged. + /// + /// You can optionally refund only part of a charge. + /// You can do so multiple times, until the entire charge has been refunded. + /// + /// Once entirely refunded, a charge can’t be refunded again. + /// This method will raise an error when called on an already-refunded charge, + /// or when trying to refund more money than is left on a charge. + pub fn send(&self, client: &stripe::Client) -> stripe::Response { + client.send_form("/refunds", self, http_types::Method::Post) + } +} +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdateRefund<'a> { + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, + /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. + /// This can be useful for storing additional information about the object in a structured format. + /// Individual keys can be unset by posting an empty value to them. + /// All keys can be unset by posting an empty value to `metadata`. + #[serde(skip_serializing_if = "Option::is_none")] + pub metadata: Option<&'a std::collections::HashMap>, +} +impl<'a> UpdateRefund<'a> { + pub fn new() -> Self { + Self::default() + } +} +impl<'a> UpdateRefund<'a> { + /// Updates the refund that you specify by setting the values of the passed parameters. + /// Any parameters that you don’t provide remain unchanged. + /// + /// This request only accepts `metadata` as an argument. + pub fn send( + &self, + client: &stripe::Client, + refund: &stripe_shared::RefundId, + ) -> stripe::Response { + client.send_form(&format!("/refunds/{refund}"), self, http_types::Method::Post) + } +} +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CancelRefund<'a> { + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, +} +impl<'a> CancelRefund<'a> { + pub fn new() -> Self { + Self::default() + } +} +impl<'a> CancelRefund<'a> { + /// Cancels a refund with a status of `requires_action`. + /// + /// You can’t cancel refunds in other states. + /// Only refunds for payment methods that require customer action can enter the `requires_action` state. + pub fn send( + &self, + client: &stripe::Client, + refund: &stripe_shared::RefundId, + ) -> stripe::Response { + client.send_form(&format!("/refunds/{refund}/cancel"), self, http_types::Method::Post) + } +} +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct ExpireRefund<'a> { + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, +} +impl<'a> ExpireRefund<'a> { + pub fn new() -> Self { + Self::default() + } +} +impl<'a> ExpireRefund<'a> { + /// Expire a refund with a status of `requires_action`. + pub fn send( + &self, + client: &stripe::Client, + refund: &str, + ) -> stripe::Response { + client.send_form( + &format!("/test_helpers/refunds/{refund}/expire"), + self, + http_types::Method::Post, + ) + } +} diff --git a/generated/stripe_core/src/setup_attempt/mod.rs b/generated/stripe_core/src/setup_attempt/mod.rs new file mode 100644 index 000000000..0b9791ced --- /dev/null +++ b/generated/stripe_core/src/setup_attempt/mod.rs @@ -0,0 +1,4 @@ +#[cfg(feature = "setup_attempt")] +mod requests; +#[cfg(feature = "setup_attempt")] +pub use requests::*; diff --git a/generated/stripe_core/src/setup_attempt/requests.rs b/generated/stripe_core/src/setup_attempt/requests.rs new file mode 100644 index 000000000..e570c255a --- /dev/null +++ b/generated/stripe_core/src/setup_attempt/requests.rs @@ -0,0 +1,54 @@ +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct ListSetupAttempt<'a> { + /// A filter on the list, based on the object `created` field. The value + /// can be a string with an integer Unix timestamp or a + /// dictionary with a number of different query options. + #[serde(skip_serializing_if = "Option::is_none")] + pub created: Option, + /// A cursor for use in pagination. + /// `ending_before` is an object ID that defines your place in the list. + /// For instance, if you make a list request and receive 100 objects, starting with `obj_bar`, your subsequent call can include `ending_before=obj_bar` in order to fetch the previous page of the list. + #[serde(skip_serializing_if = "Option::is_none")] + pub ending_before: Option<&'a str>, + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, + /// A limit on the number of objects to be returned. + /// Limit can range between 1 and 100, and the default is 10. + #[serde(skip_serializing_if = "Option::is_none")] + pub limit: Option, + /// Only return SetupAttempts created by the SetupIntent specified by + /// this ID. + pub setup_intent: &'a str, + /// A cursor for use in pagination. + /// `starting_after` is an object ID that defines your place in the list. + /// For instance, if you make a list request and receive 100 objects, ending with `obj_foo`, your subsequent call can include `starting_after=obj_foo` in order to fetch the next page of the list. + #[serde(skip_serializing_if = "Option::is_none")] + pub starting_after: Option<&'a str>, +} +impl<'a> ListSetupAttempt<'a> { + pub fn new(setup_intent: &'a str) -> Self { + Self { + created: None, + ending_before: None, + expand: None, + limit: None, + setup_intent, + starting_after: None, + } + } +} +impl<'a> ListSetupAttempt<'a> { + /// Returns a list of SetupAttempts that associate with a provided SetupIntent. + pub fn send( + &self, + client: &stripe::Client, + ) -> stripe::Response> { + client.get_query("/setup_attempts", self) + } + pub fn paginate( + self, + ) -> stripe::ListPaginator> { + stripe::ListPaginator::from_list_params("/setup_attempts", self) + } +} diff --git a/generated/stripe_core/src/setup_intent/mod.rs b/generated/stripe_core/src/setup_intent/mod.rs new file mode 100644 index 000000000..b13f3469d --- /dev/null +++ b/generated/stripe_core/src/setup_intent/mod.rs @@ -0,0 +1,4 @@ +#[cfg(feature = "setup_intent")] +mod requests; +#[cfg(feature = "setup_intent")] +pub use requests::*; diff --git a/generated/stripe_core/src/setup_intent/requests.rs b/generated/stripe_core/src/setup_intent/requests.rs new file mode 100644 index 000000000..c1a6a0d16 --- /dev/null +++ b/generated/stripe_core/src/setup_intent/requests.rs @@ -0,0 +1,8296 @@ +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct ListSetupIntent<'a> { + /// If present, the SetupIntent's payment method will be attached to the in-context Stripe Account. + /// + /// It can only be used for this Stripe Account’s own money movement flows like InboundTransfer and OutboundTransfers. + /// It cannot be set to true when setting up a PaymentMethod for a Customer, and defaults to false when attaching a PaymentMethod to a Customer. + #[serde(skip_serializing_if = "Option::is_none")] + pub attach_to_self: Option, + /// A filter on the list, based on the object `created` field. + /// The value can be a string with an integer Unix timestamp, or it can be a dictionary with a number of different query options. + #[serde(skip_serializing_if = "Option::is_none")] + pub created: Option, + /// Only return SetupIntents for the customer specified by this customer ID. + #[serde(skip_serializing_if = "Option::is_none")] + pub customer: Option<&'a str>, + /// A cursor for use in pagination. + /// `ending_before` is an object ID that defines your place in the list. + /// For instance, if you make a list request and receive 100 objects, starting with `obj_bar`, your subsequent call can include `ending_before=obj_bar` in order to fetch the previous page of the list. + #[serde(skip_serializing_if = "Option::is_none")] + pub ending_before: Option<&'a str>, + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, + /// A limit on the number of objects to be returned. + /// Limit can range between 1 and 100, and the default is 10. + #[serde(skip_serializing_if = "Option::is_none")] + pub limit: Option, + /// Only return SetupIntents that associate with the specified payment method. + #[serde(skip_serializing_if = "Option::is_none")] + pub payment_method: Option<&'a str>, + /// A cursor for use in pagination. + /// `starting_after` is an object ID that defines your place in the list. + /// For instance, if you make a list request and receive 100 objects, ending with `obj_foo`, your subsequent call can include `starting_after=obj_foo` in order to fetch the next page of the list. + #[serde(skip_serializing_if = "Option::is_none")] + pub starting_after: Option<&'a str>, +} +impl<'a> ListSetupIntent<'a> { + pub fn new() -> Self { + Self::default() + } +} +impl<'a> ListSetupIntent<'a> { + /// Returns a list of SetupIntents. + pub fn send( + &self, + client: &stripe::Client, + ) -> stripe::Response> { + client.get_query("/setup_intents", self) + } + pub fn paginate(self) -> stripe::ListPaginator> { + stripe::ListPaginator::from_list_params("/setup_intents", self) + } +} +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct RetrieveSetupIntent<'a> { + /// The client secret of the SetupIntent. + /// We require this string if you use a publishable key to retrieve the SetupIntent. + #[serde(skip_serializing_if = "Option::is_none")] + pub client_secret: Option<&'a str>, + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, +} +impl<'a> RetrieveSetupIntent<'a> { + pub fn new() -> Self { + Self::default() + } +} +impl<'a> RetrieveSetupIntent<'a> { + /// Retrieves the details of a SetupIntent that has previously been created. + /// + /// Client-side retrieval using a publishable key is allowed when the `client_secret` is provided in the query string. + /// + /// + /// When retrieved with a publishable key, only a subset of properties will be returned. + /// Please refer to the [SetupIntent](https://stripe.com/docs/api#setup_intent_object) object reference for more details. + pub fn send( + &self, + client: &stripe::Client, + intent: &stripe_shared::SetupIntentId, + ) -> stripe::Response { + client.get_query(&format!("/setup_intents/{intent}"), self) + } +} +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreateSetupIntent<'a> { + /// If present, the SetupIntent's payment method will be attached to the in-context Stripe Account. + /// + /// It can only be used for this Stripe Account’s own money movement flows like InboundTransfer and OutboundTransfers. + /// It cannot be set to true when setting up a PaymentMethod for a Customer, and defaults to false when attaching a PaymentMethod to a Customer. + #[serde(skip_serializing_if = "Option::is_none")] + pub attach_to_self: Option, + /// When you enable this parameter, this SetupIntent accepts payment methods that you enable in the Dashboard and that are compatible with its other parameters. + #[serde(skip_serializing_if = "Option::is_none")] + pub automatic_payment_methods: Option, + /// Set to `true` to attempt to confirm this SetupIntent immediately. + /// This parameter defaults to `false`. + /// If a card is the attached payment method, you can provide a `return_url` in case further authentication is necessary. + #[serde(skip_serializing_if = "Option::is_none")] + pub confirm: Option, + /// ID of the Customer this SetupIntent belongs to, if one exists. + /// + /// If present, the SetupIntent's payment method will be attached to the Customer on successful setup. + /// Payment methods attached to other Customers cannot be used with this SetupIntent. + #[serde(skip_serializing_if = "Option::is_none")] + pub customer: Option<&'a str>, + /// An arbitrary string attached to the object. Often useful for displaying to users. + #[serde(skip_serializing_if = "Option::is_none")] + pub description: Option<&'a str>, + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, + /// Indicates the directions of money movement for which this payment method is intended to be used. + /// + /// Include `inbound` if you intend to use the payment method as the origin to pull funds from. + /// Include `outbound` if you intend to use the payment method as the destination to send funds to. + /// You can include both if you intend to use the payment method for both purposes. + #[serde(skip_serializing_if = "Option::is_none")] + pub flow_directions: Option<&'a [stripe_shared::SetupIntentFlowDirections]>, + /// This hash contains details about the mandate to create. + /// This parameter can only be used with [`confirm=true`](https://stripe.com/docs/api/setup_intents/create#create_setup_intent-confirm). + #[serde(skip_serializing_if = "Option::is_none")] + pub mandate_data: Option>, + /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. + /// This can be useful for storing additional information about the object in a structured format. + /// Individual keys can be unset by posting an empty value to them. + /// All keys can be unset by posting an empty value to `metadata`. + #[serde(skip_serializing_if = "Option::is_none")] + pub metadata: Option<&'a std::collections::HashMap>, + /// The Stripe account ID created for this SetupIntent. + #[serde(skip_serializing_if = "Option::is_none")] + pub on_behalf_of: Option<&'a str>, + /// ID of the payment method (a PaymentMethod, Card, or saved Source object) to attach to this SetupIntent. + #[serde(skip_serializing_if = "Option::is_none")] + pub payment_method: Option<&'a str>, + /// The ID of the payment method configuration to use with this SetupIntent. + #[serde(skip_serializing_if = "Option::is_none")] + pub payment_method_configuration: Option<&'a str>, + /// When included, this hash creates a PaymentMethod that is set as the [`payment_method`](https://stripe.com/docs/api/setup_intents/object#setup_intent_object-payment_method). + /// value in the SetupIntent. + #[serde(skip_serializing_if = "Option::is_none")] + pub payment_method_data: Option>, + /// Payment method-specific configuration for this SetupIntent. + #[serde(skip_serializing_if = "Option::is_none")] + pub payment_method_options: Option>, + /// The list of payment method types (for example, card) that this SetupIntent can use. + /// If you don't provide this, it defaults to ["card"]. + #[serde(skip_serializing_if = "Option::is_none")] + pub payment_method_types: Option<&'a [&'a str]>, + /// The URL to redirect your customer back to after they authenticate or cancel their payment on the payment method's app or site. + /// To redirect to a mobile application, you can alternatively supply an application URI scheme. + /// This parameter can only be used with [`confirm=true`](https://stripe.com/docs/api/setup_intents/create#create_setup_intent-confirm). + #[serde(skip_serializing_if = "Option::is_none")] + pub return_url: Option<&'a str>, + /// If you populate this hash, this SetupIntent generates a `single_use` mandate after successful completion. + #[serde(skip_serializing_if = "Option::is_none")] + pub single_use: Option, + /// Indicates how the payment method is intended to be used in the future. + /// If not provided, this value defaults to `off_session`. + #[serde(skip_serializing_if = "Option::is_none")] + pub usage: Option, + /// Set to `true` when confirming server-side and using Stripe.js, iOS, or Android client-side SDKs to handle the next actions. + #[serde(skip_serializing_if = "Option::is_none")] + pub use_stripe_sdk: Option, +} +impl<'a> CreateSetupIntent<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// When you enable this parameter, this SetupIntent accepts payment methods that you enable in the Dashboard and that are compatible with its other parameters. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreateSetupIntentAutomaticPaymentMethods { + /// Controls whether this SetupIntent will accept redirect-based payment methods. + /// + /// Redirect-based payment methods may require your customer to be redirected to a payment method's app or site for authentication or additional steps. + /// To [confirm](https://stripe.com/docs/api/setup_intents/confirm) this SetupIntent, you may be required to provide a `return_url` to redirect customers back to your site after they authenticate or complete the setup. + #[serde(skip_serializing_if = "Option::is_none")] + pub allow_redirects: Option, + /// Whether this feature is enabled. + pub enabled: bool, +} +impl CreateSetupIntentAutomaticPaymentMethods { + pub fn new(enabled: bool) -> Self { + Self { allow_redirects: None, enabled } + } +} +/// Controls whether this SetupIntent will accept redirect-based payment methods. +/// +/// Redirect-based payment methods may require your customer to be redirected to a payment method's app or site for authentication or additional steps. +/// To [confirm](https://stripe.com/docs/api/setup_intents/confirm) this SetupIntent, you may be required to provide a `return_url` to redirect customers back to your site after they authenticate or complete the setup. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreateSetupIntentAutomaticPaymentMethodsAllowRedirects { + Always, + Never, +} +impl CreateSetupIntentAutomaticPaymentMethodsAllowRedirects { + pub fn as_str(self) -> &'static str { + use CreateSetupIntentAutomaticPaymentMethodsAllowRedirects::*; + match self { + Always => "always", + Never => "never", + } + } +} + +impl std::str::FromStr for CreateSetupIntentAutomaticPaymentMethodsAllowRedirects { + type Err = (); + fn from_str(s: &str) -> Result { + use CreateSetupIntentAutomaticPaymentMethodsAllowRedirects::*; + match s { + "always" => Ok(Always), + "never" => Ok(Never), + _ => Err(()), + } + } +} +impl std::fmt::Display for CreateSetupIntentAutomaticPaymentMethodsAllowRedirects { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreateSetupIntentAutomaticPaymentMethodsAllowRedirects { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreateSetupIntentAutomaticPaymentMethodsAllowRedirects { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// This hash contains details about the mandate to create. +/// This parameter can only be used with [`confirm=true`](https://stripe.com/docs/api/setup_intents/create#create_setup_intent-confirm). +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreateSetupIntentMandateData<'a> { + /// This hash contains details about the customer acceptance of the Mandate. + pub customer_acceptance: CreateSetupIntentMandateDataCustomerAcceptance<'a>, +} +impl<'a> CreateSetupIntentMandateData<'a> { + pub fn new(customer_acceptance: CreateSetupIntentMandateDataCustomerAcceptance<'a>) -> Self { + Self { customer_acceptance } + } +} +/// This hash contains details about the customer acceptance of the Mandate. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreateSetupIntentMandateDataCustomerAcceptance<'a> { + /// The time at which the customer accepted the Mandate. + #[serde(skip_serializing_if = "Option::is_none")] + pub accepted_at: Option, + /// If this is a Mandate accepted offline, this hash contains details about the offline acceptance. + #[serde(skip_serializing_if = "Option::is_none")] + pub offline: Option<&'a serde_json::Value>, + /// If this is a Mandate accepted online, this hash contains details about the online acceptance. + #[serde(skip_serializing_if = "Option::is_none")] + pub online: Option>, + /// The type of customer acceptance information included with the Mandate. + /// One of `online` or `offline`. + #[serde(rename = "type")] + pub type_: CreateSetupIntentMandateDataCustomerAcceptanceType, +} +impl<'a> CreateSetupIntentMandateDataCustomerAcceptance<'a> { + pub fn new(type_: CreateSetupIntentMandateDataCustomerAcceptanceType) -> Self { + Self { accepted_at: None, offline: None, online: None, type_ } + } +} +/// The type of customer acceptance information included with the Mandate. +/// One of `online` or `offline`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreateSetupIntentMandateDataCustomerAcceptanceType { + Offline, + Online, +} +impl CreateSetupIntentMandateDataCustomerAcceptanceType { + pub fn as_str(self) -> &'static str { + use CreateSetupIntentMandateDataCustomerAcceptanceType::*; + match self { + Offline => "offline", + Online => "online", + } + } +} + +impl std::str::FromStr for CreateSetupIntentMandateDataCustomerAcceptanceType { + type Err = (); + fn from_str(s: &str) -> Result { + use CreateSetupIntentMandateDataCustomerAcceptanceType::*; + match s { + "offline" => Ok(Offline), + "online" => Ok(Online), + _ => Err(()), + } + } +} +impl std::fmt::Display for CreateSetupIntentMandateDataCustomerAcceptanceType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreateSetupIntentMandateDataCustomerAcceptanceType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreateSetupIntentMandateDataCustomerAcceptanceType { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// When included, this hash creates a PaymentMethod that is set as the [`payment_method`](https://stripe.com/docs/api/setup_intents/object#setup_intent_object-payment_method). +/// value in the SetupIntent. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreateSetupIntentPaymentMethodData<'a> { + /// If this is an `acss_debit` PaymentMethod, this hash contains details about the ACSS Debit payment method. + #[serde(skip_serializing_if = "Option::is_none")] + pub acss_debit: Option>, + /// If this is an `affirm` PaymentMethod, this hash contains details about the Affirm payment method. + #[serde(skip_serializing_if = "Option::is_none")] + pub affirm: Option<&'a serde_json::Value>, + /// If this is an `AfterpayClearpay` PaymentMethod, this hash contains details about the AfterpayClearpay payment method. + #[serde(skip_serializing_if = "Option::is_none")] + pub afterpay_clearpay: Option<&'a serde_json::Value>, + /// If this is an `Alipay` PaymentMethod, this hash contains details about the Alipay payment method. + #[serde(skip_serializing_if = "Option::is_none")] + pub alipay: Option<&'a serde_json::Value>, + /// If this is an `au_becs_debit` PaymentMethod, this hash contains details about the bank account. + #[serde(skip_serializing_if = "Option::is_none")] + pub au_becs_debit: Option>, + /// If this is a `bacs_debit` PaymentMethod, this hash contains details about the Bacs Direct Debit bank account. + #[serde(skip_serializing_if = "Option::is_none")] + pub bacs_debit: Option>, + /// If this is a `bancontact` PaymentMethod, this hash contains details about the Bancontact payment method. + #[serde(skip_serializing_if = "Option::is_none")] + pub bancontact: Option<&'a serde_json::Value>, + /// Billing information associated with the PaymentMethod that may be used or required by particular types of payment methods. + #[serde(skip_serializing_if = "Option::is_none")] + pub billing_details: Option>, + /// If this is a `blik` PaymentMethod, this hash contains details about the BLIK payment method. + #[serde(skip_serializing_if = "Option::is_none")] + pub blik: Option<&'a serde_json::Value>, + /// If this is a `boleto` PaymentMethod, this hash contains details about the Boleto payment method. + #[serde(skip_serializing_if = "Option::is_none")] + pub boleto: Option>, + /// If this is a `cashapp` PaymentMethod, this hash contains details about the Cash App Pay payment method. + #[serde(skip_serializing_if = "Option::is_none")] + pub cashapp: Option<&'a serde_json::Value>, + /// If this is a `customer_balance` PaymentMethod, this hash contains details about the CustomerBalance payment method. + #[serde(skip_serializing_if = "Option::is_none")] + pub customer_balance: Option<&'a serde_json::Value>, + /// If this is an `eps` PaymentMethod, this hash contains details about the EPS payment method. + #[serde(skip_serializing_if = "Option::is_none")] + pub eps: Option, + /// If this is an `fpx` PaymentMethod, this hash contains details about the FPX payment method. + #[serde(skip_serializing_if = "Option::is_none")] + pub fpx: Option, + /// If this is a `giropay` PaymentMethod, this hash contains details about the Giropay payment method. + #[serde(skip_serializing_if = "Option::is_none")] + pub giropay: Option<&'a serde_json::Value>, + /// If this is a `grabpay` PaymentMethod, this hash contains details about the GrabPay payment method. + #[serde(skip_serializing_if = "Option::is_none")] + pub grabpay: Option<&'a serde_json::Value>, + /// If this is an `ideal` PaymentMethod, this hash contains details about the iDEAL payment method. + #[serde(skip_serializing_if = "Option::is_none")] + pub ideal: Option, + /// If this is an `interac_present` PaymentMethod, this hash contains details about the Interac Present payment method. + #[serde(skip_serializing_if = "Option::is_none")] + pub interac_present: Option<&'a serde_json::Value>, + /// If this is a `klarna` PaymentMethod, this hash contains details about the Klarna payment method. + #[serde(skip_serializing_if = "Option::is_none")] + pub klarna: Option, + /// If this is a `konbini` PaymentMethod, this hash contains details about the Konbini payment method. + #[serde(skip_serializing_if = "Option::is_none")] + pub konbini: Option<&'a serde_json::Value>, + /// If this is an `Link` PaymentMethod, this hash contains details about the Link payment method. + #[serde(skip_serializing_if = "Option::is_none")] + pub link: Option<&'a serde_json::Value>, + /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. + /// This can be useful for storing additional information about the object in a structured format. + /// Individual keys can be unset by posting an empty value to them. + /// All keys can be unset by posting an empty value to `metadata`. + #[serde(skip_serializing_if = "Option::is_none")] + pub metadata: Option<&'a std::collections::HashMap>, + /// If this is an `oxxo` PaymentMethod, this hash contains details about the OXXO payment method. + #[serde(skip_serializing_if = "Option::is_none")] + pub oxxo: Option<&'a serde_json::Value>, + /// If this is a `p24` PaymentMethod, this hash contains details about the P24 payment method. + #[serde(skip_serializing_if = "Option::is_none")] + pub p24: Option, + /// If this is a `paynow` PaymentMethod, this hash contains details about the PayNow payment method. + #[serde(skip_serializing_if = "Option::is_none")] + pub paynow: Option<&'a serde_json::Value>, + /// If this is a `paypal` PaymentMethod, this hash contains details about the PayPal payment method. + #[serde(skip_serializing_if = "Option::is_none")] + pub paypal: Option<&'a serde_json::Value>, + /// If this is a `pix` PaymentMethod, this hash contains details about the Pix payment method. + #[serde(skip_serializing_if = "Option::is_none")] + pub pix: Option<&'a serde_json::Value>, + /// If this is a `promptpay` PaymentMethod, this hash contains details about the PromptPay payment method. + #[serde(skip_serializing_if = "Option::is_none")] + pub promptpay: Option<&'a serde_json::Value>, + /// Options to configure Radar. + /// See [Radar Session](https://stripe.com/docs/radar/radar-session) for more information. + #[serde(skip_serializing_if = "Option::is_none")] + pub radar_options: Option>, + /// If this is a `Revolut Pay` PaymentMethod, this hash contains details about the Revolut Pay payment method. + #[serde(skip_serializing_if = "Option::is_none")] + pub revolut_pay: Option<&'a serde_json::Value>, + /// If this is a `sepa_debit` PaymentMethod, this hash contains details about the SEPA debit bank account. + #[serde(skip_serializing_if = "Option::is_none")] + pub sepa_debit: Option>, + /// If this is a `sofort` PaymentMethod, this hash contains details about the SOFORT payment method. + #[serde(skip_serializing_if = "Option::is_none")] + pub sofort: Option, + /// If this is a `swish` PaymentMethod, this hash contains details about the Swish payment method. + #[serde(skip_serializing_if = "Option::is_none")] + pub swish: Option<&'a serde_json::Value>, + /// The type of the PaymentMethod. + /// An additional hash is included on the PaymentMethod with a name matching this value. + /// It contains additional information specific to the PaymentMethod type. + #[serde(rename = "type")] + pub type_: CreateSetupIntentPaymentMethodDataType, + /// If this is an `us_bank_account` PaymentMethod, this hash contains details about the US bank account payment method. + #[serde(skip_serializing_if = "Option::is_none")] + pub us_bank_account: Option>, + /// If this is an `wechat_pay` PaymentMethod, this hash contains details about the wechat_pay payment method. + #[serde(skip_serializing_if = "Option::is_none")] + pub wechat_pay: Option<&'a serde_json::Value>, + /// If this is a `zip` PaymentMethod, this hash contains details about the Zip payment method. + #[serde(skip_serializing_if = "Option::is_none")] + pub zip: Option<&'a serde_json::Value>, +} +impl<'a> CreateSetupIntentPaymentMethodData<'a> { + pub fn new(type_: CreateSetupIntentPaymentMethodDataType) -> Self { + Self { + acss_debit: None, + affirm: None, + afterpay_clearpay: None, + alipay: None, + au_becs_debit: None, + bacs_debit: None, + bancontact: None, + billing_details: None, + blik: None, + boleto: None, + cashapp: None, + customer_balance: None, + eps: None, + fpx: None, + giropay: None, + grabpay: None, + ideal: None, + interac_present: None, + klarna: None, + konbini: None, + link: None, + metadata: None, + oxxo: None, + p24: None, + paynow: None, + paypal: None, + pix: None, + promptpay: None, + radar_options: None, + revolut_pay: None, + sepa_debit: None, + sofort: None, + swish: None, + type_, + us_bank_account: None, + wechat_pay: None, + zip: None, + } + } +} +/// If this is an `au_becs_debit` PaymentMethod, this hash contains details about the bank account. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreateSetupIntentPaymentMethodDataAuBecsDebit<'a> { + /// The account number for the bank account. + pub account_number: &'a str, + /// Bank-State-Branch number of the bank account. + pub bsb_number: &'a str, +} +impl<'a> CreateSetupIntentPaymentMethodDataAuBecsDebit<'a> { + pub fn new(account_number: &'a str, bsb_number: &'a str) -> Self { + Self { account_number, bsb_number } + } +} +/// If this is a `bacs_debit` PaymentMethod, this hash contains details about the Bacs Direct Debit bank account. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreateSetupIntentPaymentMethodDataBacsDebit<'a> { + /// Account number of the bank account that the funds will be debited from. + #[serde(skip_serializing_if = "Option::is_none")] + pub account_number: Option<&'a str>, + /// Sort code of the bank account. (e.g., `10-20-30`) + #[serde(skip_serializing_if = "Option::is_none")] + pub sort_code: Option<&'a str>, +} +impl<'a> CreateSetupIntentPaymentMethodDataBacsDebit<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// If this is a `boleto` PaymentMethod, this hash contains details about the Boleto payment method. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreateSetupIntentPaymentMethodDataBoleto<'a> { + /// The tax ID of the customer (CPF for individual consumers or CNPJ for businesses consumers) + pub tax_id: &'a str, +} +impl<'a> CreateSetupIntentPaymentMethodDataBoleto<'a> { + pub fn new(tax_id: &'a str) -> Self { + Self { tax_id } + } +} +/// If this is an `eps` PaymentMethod, this hash contains details about the EPS payment method. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreateSetupIntentPaymentMethodDataEps { + /// The customer's bank. + #[serde(skip_serializing_if = "Option::is_none")] + pub bank: Option, +} +impl CreateSetupIntentPaymentMethodDataEps { + pub fn new() -> Self { + Self::default() + } +} +/// The customer's bank. +#[derive(Copy, Clone, Eq, PartialEq)] +#[non_exhaustive] +pub enum CreateSetupIntentPaymentMethodDataEpsBank { + ArzteUndApothekerBank, + AustrianAnadiBankAg, + BankAustria, + BankhausCarlSpangler, + BankhausSchelhammerUndSchatteraAg, + BawagPskAg, + BksBankAg, + BrullKallmusBankAg, + BtvVierLanderBank, + CapitalBankGraweGruppeAg, + DeutscheBankAg, + Dolomitenbank, + EasybankAg, + ErsteBankUndSparkassen, + HypoAlpeadriabankInternationalAg, + HypoBankBurgenlandAktiengesellschaft, + HypoNoeLbFurNiederosterreichUWien, + HypoOberosterreichSalzburgSteiermark, + HypoTirolBankAg, + HypoVorarlbergBankAg, + MarchfelderBank, + OberbankAg, + RaiffeisenBankengruppeOsterreich, + SchoellerbankAg, + SpardaBankWien, + VolksbankGruppe, + VolkskreditbankAg, + VrBankBraunau, + /// An unrecognized value from Stripe. Should not be used as a request parameter. + Unknown, +} +impl CreateSetupIntentPaymentMethodDataEpsBank { + pub fn as_str(self) -> &'static str { + use CreateSetupIntentPaymentMethodDataEpsBank::*; + match self { + ArzteUndApothekerBank => "arzte_und_apotheker_bank", + AustrianAnadiBankAg => "austrian_anadi_bank_ag", + BankAustria => "bank_austria", + BankhausCarlSpangler => "bankhaus_carl_spangler", + BankhausSchelhammerUndSchatteraAg => "bankhaus_schelhammer_und_schattera_ag", + BawagPskAg => "bawag_psk_ag", + BksBankAg => "bks_bank_ag", + BrullKallmusBankAg => "brull_kallmus_bank_ag", + BtvVierLanderBank => "btv_vier_lander_bank", + CapitalBankGraweGruppeAg => "capital_bank_grawe_gruppe_ag", + DeutscheBankAg => "deutsche_bank_ag", + Dolomitenbank => "dolomitenbank", + EasybankAg => "easybank_ag", + ErsteBankUndSparkassen => "erste_bank_und_sparkassen", + HypoAlpeadriabankInternationalAg => "hypo_alpeadriabank_international_ag", + HypoBankBurgenlandAktiengesellschaft => "hypo_bank_burgenland_aktiengesellschaft", + HypoNoeLbFurNiederosterreichUWien => "hypo_noe_lb_fur_niederosterreich_u_wien", + HypoOberosterreichSalzburgSteiermark => "hypo_oberosterreich_salzburg_steiermark", + HypoTirolBankAg => "hypo_tirol_bank_ag", + HypoVorarlbergBankAg => "hypo_vorarlberg_bank_ag", + MarchfelderBank => "marchfelder_bank", + OberbankAg => "oberbank_ag", + RaiffeisenBankengruppeOsterreich => "raiffeisen_bankengruppe_osterreich", + SchoellerbankAg => "schoellerbank_ag", + SpardaBankWien => "sparda_bank_wien", + VolksbankGruppe => "volksbank_gruppe", + VolkskreditbankAg => "volkskreditbank_ag", + VrBankBraunau => "vr_bank_braunau", + Unknown => "unknown", + } + } +} + +impl std::str::FromStr for CreateSetupIntentPaymentMethodDataEpsBank { + type Err = (); + fn from_str(s: &str) -> Result { + use CreateSetupIntentPaymentMethodDataEpsBank::*; + match s { + "arzte_und_apotheker_bank" => Ok(ArzteUndApothekerBank), + "austrian_anadi_bank_ag" => Ok(AustrianAnadiBankAg), + "bank_austria" => Ok(BankAustria), + "bankhaus_carl_spangler" => Ok(BankhausCarlSpangler), + "bankhaus_schelhammer_und_schattera_ag" => Ok(BankhausSchelhammerUndSchatteraAg), + "bawag_psk_ag" => Ok(BawagPskAg), + "bks_bank_ag" => Ok(BksBankAg), + "brull_kallmus_bank_ag" => Ok(BrullKallmusBankAg), + "btv_vier_lander_bank" => Ok(BtvVierLanderBank), + "capital_bank_grawe_gruppe_ag" => Ok(CapitalBankGraweGruppeAg), + "deutsche_bank_ag" => Ok(DeutscheBankAg), + "dolomitenbank" => Ok(Dolomitenbank), + "easybank_ag" => Ok(EasybankAg), + "erste_bank_und_sparkassen" => Ok(ErsteBankUndSparkassen), + "hypo_alpeadriabank_international_ag" => Ok(HypoAlpeadriabankInternationalAg), + "hypo_bank_burgenland_aktiengesellschaft" => Ok(HypoBankBurgenlandAktiengesellschaft), + "hypo_noe_lb_fur_niederosterreich_u_wien" => Ok(HypoNoeLbFurNiederosterreichUWien), + "hypo_oberosterreich_salzburg_steiermark" => Ok(HypoOberosterreichSalzburgSteiermark), + "hypo_tirol_bank_ag" => Ok(HypoTirolBankAg), + "hypo_vorarlberg_bank_ag" => Ok(HypoVorarlbergBankAg), + "marchfelder_bank" => Ok(MarchfelderBank), + "oberbank_ag" => Ok(OberbankAg), + "raiffeisen_bankengruppe_osterreich" => Ok(RaiffeisenBankengruppeOsterreich), + "schoellerbank_ag" => Ok(SchoellerbankAg), + "sparda_bank_wien" => Ok(SpardaBankWien), + "volksbank_gruppe" => Ok(VolksbankGruppe), + "volkskreditbank_ag" => Ok(VolkskreditbankAg), + "vr_bank_braunau" => Ok(VrBankBraunau), + _ => Err(()), + } + } +} +impl std::fmt::Display for CreateSetupIntentPaymentMethodDataEpsBank { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreateSetupIntentPaymentMethodDataEpsBank { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreateSetupIntentPaymentMethodDataEpsBank { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// If this is an `fpx` PaymentMethod, this hash contains details about the FPX payment method. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreateSetupIntentPaymentMethodDataFpx { + /// Account holder type for FPX transaction + #[serde(skip_serializing_if = "Option::is_none")] + pub account_holder_type: Option, + /// The customer's bank. + pub bank: CreateSetupIntentPaymentMethodDataFpxBank, +} +impl CreateSetupIntentPaymentMethodDataFpx { + pub fn new(bank: CreateSetupIntentPaymentMethodDataFpxBank) -> Self { + Self { account_holder_type: None, bank } + } +} +/// Account holder type for FPX transaction +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreateSetupIntentPaymentMethodDataFpxAccountHolderType { + Company, + Individual, +} +impl CreateSetupIntentPaymentMethodDataFpxAccountHolderType { + pub fn as_str(self) -> &'static str { + use CreateSetupIntentPaymentMethodDataFpxAccountHolderType::*; + match self { + Company => "company", + Individual => "individual", + } + } +} + +impl std::str::FromStr for CreateSetupIntentPaymentMethodDataFpxAccountHolderType { + type Err = (); + fn from_str(s: &str) -> Result { + use CreateSetupIntentPaymentMethodDataFpxAccountHolderType::*; + match s { + "company" => Ok(Company), + "individual" => Ok(Individual), + _ => Err(()), + } + } +} +impl std::fmt::Display for CreateSetupIntentPaymentMethodDataFpxAccountHolderType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreateSetupIntentPaymentMethodDataFpxAccountHolderType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreateSetupIntentPaymentMethodDataFpxAccountHolderType { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// The customer's bank. +#[derive(Copy, Clone, Eq, PartialEq)] +#[non_exhaustive] +pub enum CreateSetupIntentPaymentMethodDataFpxBank { + AffinBank, + Agrobank, + AllianceBank, + Ambank, + BankIslam, + BankMuamalat, + BankOfChina, + BankRakyat, + Bsn, + Cimb, + DeutscheBank, + HongLeongBank, + Hsbc, + Kfh, + Maybank2e, + Maybank2u, + Ocbc, + PbEnterprise, + PublicBank, + Rhb, + StandardChartered, + Uob, + /// An unrecognized value from Stripe. Should not be used as a request parameter. + Unknown, +} +impl CreateSetupIntentPaymentMethodDataFpxBank { + pub fn as_str(self) -> &'static str { + use CreateSetupIntentPaymentMethodDataFpxBank::*; + match self { + AffinBank => "affin_bank", + Agrobank => "agrobank", + AllianceBank => "alliance_bank", + Ambank => "ambank", + BankIslam => "bank_islam", + BankMuamalat => "bank_muamalat", + BankOfChina => "bank_of_china", + BankRakyat => "bank_rakyat", + Bsn => "bsn", + Cimb => "cimb", + DeutscheBank => "deutsche_bank", + HongLeongBank => "hong_leong_bank", + Hsbc => "hsbc", + Kfh => "kfh", + Maybank2e => "maybank2e", + Maybank2u => "maybank2u", + Ocbc => "ocbc", + PbEnterprise => "pb_enterprise", + PublicBank => "public_bank", + Rhb => "rhb", + StandardChartered => "standard_chartered", + Uob => "uob", + Unknown => "unknown", + } + } +} + +impl std::str::FromStr for CreateSetupIntentPaymentMethodDataFpxBank { + type Err = (); + fn from_str(s: &str) -> Result { + use CreateSetupIntentPaymentMethodDataFpxBank::*; + match s { + "affin_bank" => Ok(AffinBank), + "agrobank" => Ok(Agrobank), + "alliance_bank" => Ok(AllianceBank), + "ambank" => Ok(Ambank), + "bank_islam" => Ok(BankIslam), + "bank_muamalat" => Ok(BankMuamalat), + "bank_of_china" => Ok(BankOfChina), + "bank_rakyat" => Ok(BankRakyat), + "bsn" => Ok(Bsn), + "cimb" => Ok(Cimb), + "deutsche_bank" => Ok(DeutscheBank), + "hong_leong_bank" => Ok(HongLeongBank), + "hsbc" => Ok(Hsbc), + "kfh" => Ok(Kfh), + "maybank2e" => Ok(Maybank2e), + "maybank2u" => Ok(Maybank2u), + "ocbc" => Ok(Ocbc), + "pb_enterprise" => Ok(PbEnterprise), + "public_bank" => Ok(PublicBank), + "rhb" => Ok(Rhb), + "standard_chartered" => Ok(StandardChartered), + "uob" => Ok(Uob), + _ => Err(()), + } + } +} +impl std::fmt::Display for CreateSetupIntentPaymentMethodDataFpxBank { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreateSetupIntentPaymentMethodDataFpxBank { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreateSetupIntentPaymentMethodDataFpxBank { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// If this is an `ideal` PaymentMethod, this hash contains details about the iDEAL payment method. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreateSetupIntentPaymentMethodDataIdeal { + /// The customer's bank. + #[serde(skip_serializing_if = "Option::is_none")] + pub bank: Option, +} +impl CreateSetupIntentPaymentMethodDataIdeal { + pub fn new() -> Self { + Self::default() + } +} +/// The customer's bank. +#[derive(Copy, Clone, Eq, PartialEq)] +#[non_exhaustive] +pub enum CreateSetupIntentPaymentMethodDataIdealBank { + AbnAmro, + AsnBank, + Bunq, + Handelsbanken, + Ing, + Knab, + Moneyou, + N26, + Nn, + Rabobank, + Regiobank, + Revolut, + SnsBank, + TriodosBank, + VanLanschot, + Yoursafe, + /// An unrecognized value from Stripe. Should not be used as a request parameter. + Unknown, +} +impl CreateSetupIntentPaymentMethodDataIdealBank { + pub fn as_str(self) -> &'static str { + use CreateSetupIntentPaymentMethodDataIdealBank::*; + match self { + AbnAmro => "abn_amro", + AsnBank => "asn_bank", + Bunq => "bunq", + Handelsbanken => "handelsbanken", + Ing => "ing", + Knab => "knab", + Moneyou => "moneyou", + N26 => "n26", + Nn => "nn", + Rabobank => "rabobank", + Regiobank => "regiobank", + Revolut => "revolut", + SnsBank => "sns_bank", + TriodosBank => "triodos_bank", + VanLanschot => "van_lanschot", + Yoursafe => "yoursafe", + Unknown => "unknown", + } + } +} + +impl std::str::FromStr for CreateSetupIntentPaymentMethodDataIdealBank { + type Err = (); + fn from_str(s: &str) -> Result { + use CreateSetupIntentPaymentMethodDataIdealBank::*; + match s { + "abn_amro" => Ok(AbnAmro), + "asn_bank" => Ok(AsnBank), + "bunq" => Ok(Bunq), + "handelsbanken" => Ok(Handelsbanken), + "ing" => Ok(Ing), + "knab" => Ok(Knab), + "moneyou" => Ok(Moneyou), + "n26" => Ok(N26), + "nn" => Ok(Nn), + "rabobank" => Ok(Rabobank), + "regiobank" => Ok(Regiobank), + "revolut" => Ok(Revolut), + "sns_bank" => Ok(SnsBank), + "triodos_bank" => Ok(TriodosBank), + "van_lanschot" => Ok(VanLanschot), + "yoursafe" => Ok(Yoursafe), + _ => Err(()), + } + } +} +impl std::fmt::Display for CreateSetupIntentPaymentMethodDataIdealBank { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreateSetupIntentPaymentMethodDataIdealBank { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreateSetupIntentPaymentMethodDataIdealBank { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// If this is a `klarna` PaymentMethod, this hash contains details about the Klarna payment method. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreateSetupIntentPaymentMethodDataKlarna { + /// Customer's date of birth + #[serde(skip_serializing_if = "Option::is_none")] + pub dob: Option, +} +impl CreateSetupIntentPaymentMethodDataKlarna { + pub fn new() -> Self { + Self::default() + } +} +/// If this is a `p24` PaymentMethod, this hash contains details about the P24 payment method. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreateSetupIntentPaymentMethodDataP24 { + /// The customer's bank. + #[serde(skip_serializing_if = "Option::is_none")] + pub bank: Option, +} +impl CreateSetupIntentPaymentMethodDataP24 { + pub fn new() -> Self { + Self::default() + } +} +/// The customer's bank. +#[derive(Copy, Clone, Eq, PartialEq)] +#[non_exhaustive] +pub enum CreateSetupIntentPaymentMethodDataP24Bank { + AliorBank, + BankMillennium, + BankNowyBfgSa, + BankPekaoSa, + BankiSpbdzielcze, + Blik, + BnpParibas, + Boz, + CitiHandlowy, + CreditAgricole, + Envelobank, + EtransferPocztowy24, + GetinBank, + Ideabank, + Ing, + Inteligo, + MbankMtransfer, + NestPrzelew, + NoblePay, + PbacZIpko, + PlusBank, + SantanderPrzelew24, + TmobileUsbugiBankowe, + ToyotaBank, + Velobank, + VolkswagenBank, + /// An unrecognized value from Stripe. Should not be used as a request parameter. + Unknown, +} +impl CreateSetupIntentPaymentMethodDataP24Bank { + pub fn as_str(self) -> &'static str { + use CreateSetupIntentPaymentMethodDataP24Bank::*; + match self { + AliorBank => "alior_bank", + BankMillennium => "bank_millennium", + BankNowyBfgSa => "bank_nowy_bfg_sa", + BankPekaoSa => "bank_pekao_sa", + BankiSpbdzielcze => "banki_spbdzielcze", + Blik => "blik", + BnpParibas => "bnp_paribas", + Boz => "boz", + CitiHandlowy => "citi_handlowy", + CreditAgricole => "credit_agricole", + Envelobank => "envelobank", + EtransferPocztowy24 => "etransfer_pocztowy24", + GetinBank => "getin_bank", + Ideabank => "ideabank", + Ing => "ing", + Inteligo => "inteligo", + MbankMtransfer => "mbank_mtransfer", + NestPrzelew => "nest_przelew", + NoblePay => "noble_pay", + PbacZIpko => "pbac_z_ipko", + PlusBank => "plus_bank", + SantanderPrzelew24 => "santander_przelew24", + TmobileUsbugiBankowe => "tmobile_usbugi_bankowe", + ToyotaBank => "toyota_bank", + Velobank => "velobank", + VolkswagenBank => "volkswagen_bank", + Unknown => "unknown", + } + } +} + +impl std::str::FromStr for CreateSetupIntentPaymentMethodDataP24Bank { + type Err = (); + fn from_str(s: &str) -> Result { + use CreateSetupIntentPaymentMethodDataP24Bank::*; + match s { + "alior_bank" => Ok(AliorBank), + "bank_millennium" => Ok(BankMillennium), + "bank_nowy_bfg_sa" => Ok(BankNowyBfgSa), + "bank_pekao_sa" => Ok(BankPekaoSa), + "banki_spbdzielcze" => Ok(BankiSpbdzielcze), + "blik" => Ok(Blik), + "bnp_paribas" => Ok(BnpParibas), + "boz" => Ok(Boz), + "citi_handlowy" => Ok(CitiHandlowy), + "credit_agricole" => Ok(CreditAgricole), + "envelobank" => Ok(Envelobank), + "etransfer_pocztowy24" => Ok(EtransferPocztowy24), + "getin_bank" => Ok(GetinBank), + "ideabank" => Ok(Ideabank), + "ing" => Ok(Ing), + "inteligo" => Ok(Inteligo), + "mbank_mtransfer" => Ok(MbankMtransfer), + "nest_przelew" => Ok(NestPrzelew), + "noble_pay" => Ok(NoblePay), + "pbac_z_ipko" => Ok(PbacZIpko), + "plus_bank" => Ok(PlusBank), + "santander_przelew24" => Ok(SantanderPrzelew24), + "tmobile_usbugi_bankowe" => Ok(TmobileUsbugiBankowe), + "toyota_bank" => Ok(ToyotaBank), + "velobank" => Ok(Velobank), + "volkswagen_bank" => Ok(VolkswagenBank), + _ => Err(()), + } + } +} +impl std::fmt::Display for CreateSetupIntentPaymentMethodDataP24Bank { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreateSetupIntentPaymentMethodDataP24Bank { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreateSetupIntentPaymentMethodDataP24Bank { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// If this is a `sepa_debit` PaymentMethod, this hash contains details about the SEPA debit bank account. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreateSetupIntentPaymentMethodDataSepaDebit<'a> { + /// IBAN of the bank account. + pub iban: &'a str, +} +impl<'a> CreateSetupIntentPaymentMethodDataSepaDebit<'a> { + pub fn new(iban: &'a str) -> Self { + Self { iban } + } +} +/// If this is a `sofort` PaymentMethod, this hash contains details about the SOFORT payment method. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreateSetupIntentPaymentMethodDataSofort { + /// Two-letter ISO code representing the country the bank account is located in. + pub country: CreateSetupIntentPaymentMethodDataSofortCountry, +} +impl CreateSetupIntentPaymentMethodDataSofort { + pub fn new(country: CreateSetupIntentPaymentMethodDataSofortCountry) -> Self { + Self { country } + } +} +/// Two-letter ISO code representing the country the bank account is located in. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreateSetupIntentPaymentMethodDataSofortCountry { + At, + Be, + De, + Es, + It, + Nl, +} +impl CreateSetupIntentPaymentMethodDataSofortCountry { + pub fn as_str(self) -> &'static str { + use CreateSetupIntentPaymentMethodDataSofortCountry::*; + match self { + At => "AT", + Be => "BE", + De => "DE", + Es => "ES", + It => "IT", + Nl => "NL", + } + } +} + +impl std::str::FromStr for CreateSetupIntentPaymentMethodDataSofortCountry { + type Err = (); + fn from_str(s: &str) -> Result { + use CreateSetupIntentPaymentMethodDataSofortCountry::*; + match s { + "AT" => Ok(At), + "BE" => Ok(Be), + "DE" => Ok(De), + "ES" => Ok(Es), + "IT" => Ok(It), + "NL" => Ok(Nl), + _ => Err(()), + } + } +} +impl std::fmt::Display for CreateSetupIntentPaymentMethodDataSofortCountry { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreateSetupIntentPaymentMethodDataSofortCountry { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreateSetupIntentPaymentMethodDataSofortCountry { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// The type of the PaymentMethod. +/// An additional hash is included on the PaymentMethod with a name matching this value. +/// It contains additional information specific to the PaymentMethod type. +#[derive(Copy, Clone, Eq, PartialEq)] +#[non_exhaustive] +pub enum CreateSetupIntentPaymentMethodDataType { + AcssDebit, + Affirm, + AfterpayClearpay, + Alipay, + AuBecsDebit, + BacsDebit, + Bancontact, + Blik, + Boleto, + Cashapp, + CustomerBalance, + Eps, + Fpx, + Giropay, + Grabpay, + Ideal, + Klarna, + Konbini, + Link, + Oxxo, + P24, + Paynow, + Paypal, + Pix, + Promptpay, + RevolutPay, + SepaDebit, + Sofort, + Swish, + UsBankAccount, + WechatPay, + Zip, + /// An unrecognized value from Stripe. Should not be used as a request parameter. + Unknown, +} +impl CreateSetupIntentPaymentMethodDataType { + pub fn as_str(self) -> &'static str { + use CreateSetupIntentPaymentMethodDataType::*; + match self { + AcssDebit => "acss_debit", + Affirm => "affirm", + AfterpayClearpay => "afterpay_clearpay", + Alipay => "alipay", + AuBecsDebit => "au_becs_debit", + BacsDebit => "bacs_debit", + Bancontact => "bancontact", + Blik => "blik", + Boleto => "boleto", + Cashapp => "cashapp", + CustomerBalance => "customer_balance", + Eps => "eps", + Fpx => "fpx", + Giropay => "giropay", + Grabpay => "grabpay", + Ideal => "ideal", + Klarna => "klarna", + Konbini => "konbini", + Link => "link", + Oxxo => "oxxo", + P24 => "p24", + Paynow => "paynow", + Paypal => "paypal", + Pix => "pix", + Promptpay => "promptpay", + RevolutPay => "revolut_pay", + SepaDebit => "sepa_debit", + Sofort => "sofort", + Swish => "swish", + UsBankAccount => "us_bank_account", + WechatPay => "wechat_pay", + Zip => "zip", + Unknown => "unknown", + } + } +} + +impl std::str::FromStr for CreateSetupIntentPaymentMethodDataType { + type Err = (); + fn from_str(s: &str) -> Result { + use CreateSetupIntentPaymentMethodDataType::*; + match s { + "acss_debit" => Ok(AcssDebit), + "affirm" => Ok(Affirm), + "afterpay_clearpay" => Ok(AfterpayClearpay), + "alipay" => Ok(Alipay), + "au_becs_debit" => Ok(AuBecsDebit), + "bacs_debit" => Ok(BacsDebit), + "bancontact" => Ok(Bancontact), + "blik" => Ok(Blik), + "boleto" => Ok(Boleto), + "cashapp" => Ok(Cashapp), + "customer_balance" => Ok(CustomerBalance), + "eps" => Ok(Eps), + "fpx" => Ok(Fpx), + "giropay" => Ok(Giropay), + "grabpay" => Ok(Grabpay), + "ideal" => Ok(Ideal), + "klarna" => Ok(Klarna), + "konbini" => Ok(Konbini), + "link" => Ok(Link), + "oxxo" => Ok(Oxxo), + "p24" => Ok(P24), + "paynow" => Ok(Paynow), + "paypal" => Ok(Paypal), + "pix" => Ok(Pix), + "promptpay" => Ok(Promptpay), + "revolut_pay" => Ok(RevolutPay), + "sepa_debit" => Ok(SepaDebit), + "sofort" => Ok(Sofort), + "swish" => Ok(Swish), + "us_bank_account" => Ok(UsBankAccount), + "wechat_pay" => Ok(WechatPay), + "zip" => Ok(Zip), + _ => Err(()), + } + } +} +impl std::fmt::Display for CreateSetupIntentPaymentMethodDataType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreateSetupIntentPaymentMethodDataType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreateSetupIntentPaymentMethodDataType { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// If this is an `us_bank_account` PaymentMethod, this hash contains details about the US bank account payment method. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreateSetupIntentPaymentMethodDataUsBankAccount<'a> { + /// Account holder type: individual or company. + #[serde(skip_serializing_if = "Option::is_none")] + pub account_holder_type: + Option, + /// Account number of the bank account. + #[serde(skip_serializing_if = "Option::is_none")] + pub account_number: Option<&'a str>, + /// Account type: checkings or savings. Defaults to checking if omitted. + #[serde(skip_serializing_if = "Option::is_none")] + pub account_type: Option, + /// The ID of a Financial Connections Account to use as a payment method. + #[serde(skip_serializing_if = "Option::is_none")] + pub financial_connections_account: Option<&'a str>, + /// Routing number of the bank account. + #[serde(skip_serializing_if = "Option::is_none")] + pub routing_number: Option<&'a str>, +} +impl<'a> CreateSetupIntentPaymentMethodDataUsBankAccount<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// Account holder type: individual or company. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreateSetupIntentPaymentMethodDataUsBankAccountAccountHolderType { + Company, + Individual, +} +impl CreateSetupIntentPaymentMethodDataUsBankAccountAccountHolderType { + pub fn as_str(self) -> &'static str { + use CreateSetupIntentPaymentMethodDataUsBankAccountAccountHolderType::*; + match self { + Company => "company", + Individual => "individual", + } + } +} + +impl std::str::FromStr for CreateSetupIntentPaymentMethodDataUsBankAccountAccountHolderType { + type Err = (); + fn from_str(s: &str) -> Result { + use CreateSetupIntentPaymentMethodDataUsBankAccountAccountHolderType::*; + match s { + "company" => Ok(Company), + "individual" => Ok(Individual), + _ => Err(()), + } + } +} +impl std::fmt::Display for CreateSetupIntentPaymentMethodDataUsBankAccountAccountHolderType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreateSetupIntentPaymentMethodDataUsBankAccountAccountHolderType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreateSetupIntentPaymentMethodDataUsBankAccountAccountHolderType { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Account type: checkings or savings. Defaults to checking if omitted. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreateSetupIntentPaymentMethodDataUsBankAccountAccountType { + Checking, + Savings, +} +impl CreateSetupIntentPaymentMethodDataUsBankAccountAccountType { + pub fn as_str(self) -> &'static str { + use CreateSetupIntentPaymentMethodDataUsBankAccountAccountType::*; + match self { + Checking => "checking", + Savings => "savings", + } + } +} + +impl std::str::FromStr for CreateSetupIntentPaymentMethodDataUsBankAccountAccountType { + type Err = (); + fn from_str(s: &str) -> Result { + use CreateSetupIntentPaymentMethodDataUsBankAccountAccountType::*; + match s { + "checking" => Ok(Checking), + "savings" => Ok(Savings), + _ => Err(()), + } + } +} +impl std::fmt::Display for CreateSetupIntentPaymentMethodDataUsBankAccountAccountType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreateSetupIntentPaymentMethodDataUsBankAccountAccountType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreateSetupIntentPaymentMethodDataUsBankAccountAccountType { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Payment method-specific configuration for this SetupIntent. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreateSetupIntentPaymentMethodOptions<'a> { + /// If this is a `acss_debit` SetupIntent, this sub-hash contains details about the ACSS Debit payment method options. + #[serde(skip_serializing_if = "Option::is_none")] + pub acss_debit: Option>, + /// Configuration for any card setup attempted on this SetupIntent. + #[serde(skip_serializing_if = "Option::is_none")] + pub card: Option>, + /// If this is a `link` PaymentMethod, this sub-hash contains details about the Link payment method options. + #[serde(skip_serializing_if = "Option::is_none")] + pub link: Option>, + /// If this is a `paypal` PaymentMethod, this sub-hash contains details about the PayPal payment method options. + #[serde(skip_serializing_if = "Option::is_none")] + pub paypal: Option>, + /// If this is a `sepa_debit` SetupIntent, this sub-hash contains details about the SEPA Debit payment method options. + #[serde(skip_serializing_if = "Option::is_none")] + pub sepa_debit: Option>, + /// If this is a `us_bank_account` SetupIntent, this sub-hash contains details about the US bank account payment method options. + #[serde(skip_serializing_if = "Option::is_none")] + pub us_bank_account: Option>, +} +impl<'a> CreateSetupIntentPaymentMethodOptions<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// If this is a `acss_debit` SetupIntent, this sub-hash contains details about the ACSS Debit payment method options. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreateSetupIntentPaymentMethodOptionsAcssDebit<'a> { + /// Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. + /// Must be a [supported currency](https://stripe.com/docs/currencies). + #[serde(skip_serializing_if = "Option::is_none")] + pub currency: Option, + /// Additional fields for Mandate creation + #[serde(skip_serializing_if = "Option::is_none")] + pub mandate_options: Option>, + /// Bank account verification method. + #[serde(skip_serializing_if = "Option::is_none")] + pub verification_method: + Option, +} +impl<'a> CreateSetupIntentPaymentMethodOptionsAcssDebit<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. +/// Must be a [supported currency](https://stripe.com/docs/currencies). +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreateSetupIntentPaymentMethodOptionsAcssDebitCurrency { + Cad, + Usd, +} +impl CreateSetupIntentPaymentMethodOptionsAcssDebitCurrency { + pub fn as_str(self) -> &'static str { + use CreateSetupIntentPaymentMethodOptionsAcssDebitCurrency::*; + match self { + Cad => "cad", + Usd => "usd", + } + } +} + +impl std::str::FromStr for CreateSetupIntentPaymentMethodOptionsAcssDebitCurrency { + type Err = (); + fn from_str(s: &str) -> Result { + use CreateSetupIntentPaymentMethodOptionsAcssDebitCurrency::*; + match s { + "cad" => Ok(Cad), + "usd" => Ok(Usd), + _ => Err(()), + } + } +} +impl std::fmt::Display for CreateSetupIntentPaymentMethodOptionsAcssDebitCurrency { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreateSetupIntentPaymentMethodOptionsAcssDebitCurrency { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreateSetupIntentPaymentMethodOptionsAcssDebitCurrency { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Additional fields for Mandate creation +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreateSetupIntentPaymentMethodOptionsAcssDebitMandateOptions<'a> { + /// A URL for custom mandate text to render during confirmation step. + /// The URL will be rendered with additional GET parameters `payment_intent` and `payment_intent_client_secret` when confirming a Payment Intent,. + /// or `setup_intent` and `setup_intent_client_secret` when confirming a Setup Intent. + #[serde(skip_serializing_if = "Option::is_none")] + pub custom_mandate_url: Option<&'a str>, + /// List of Stripe products where this mandate can be selected automatically. + #[serde(skip_serializing_if = "Option::is_none")] + pub default_for: + Option<&'a [CreateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsDefaultFor]>, + /// Description of the mandate interval. + /// Only required if 'payment_schedule' parameter is 'interval' or 'combined'. + #[serde(skip_serializing_if = "Option::is_none")] + pub interval_description: Option<&'a str>, + /// Payment schedule for the mandate. + #[serde(skip_serializing_if = "Option::is_none")] + pub payment_schedule: + Option, + /// Transaction type of the mandate. + #[serde(skip_serializing_if = "Option::is_none")] + pub transaction_type: + Option, +} +impl<'a> CreateSetupIntentPaymentMethodOptionsAcssDebitMandateOptions<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// List of Stripe products where this mandate can be selected automatically. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsDefaultFor { + Invoice, + Subscription, +} +impl CreateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsDefaultFor { + pub fn as_str(self) -> &'static str { + use CreateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsDefaultFor::*; + match self { + Invoice => "invoice", + Subscription => "subscription", + } + } +} + +impl std::str::FromStr for CreateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsDefaultFor { + type Err = (); + fn from_str(s: &str) -> Result { + use CreateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsDefaultFor::*; + match s { + "invoice" => Ok(Invoice), + "subscription" => Ok(Subscription), + _ => Err(()), + } + } +} +impl std::fmt::Display for CreateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsDefaultFor { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsDefaultFor { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsDefaultFor { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Payment schedule for the mandate. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsPaymentSchedule { + Combined, + Interval, + Sporadic, +} +impl CreateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsPaymentSchedule { + pub fn as_str(self) -> &'static str { + use CreateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsPaymentSchedule::*; + match self { + Combined => "combined", + Interval => "interval", + Sporadic => "sporadic", + } + } +} + +impl std::str::FromStr + for CreateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsPaymentSchedule +{ + type Err = (); + fn from_str(s: &str) -> Result { + use CreateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsPaymentSchedule::*; + match s { + "combined" => Ok(Combined), + "interval" => Ok(Interval), + "sporadic" => Ok(Sporadic), + _ => Err(()), + } + } +} +impl std::fmt::Display + for CreateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsPaymentSchedule +{ + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug + for CreateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsPaymentSchedule +{ + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize + for CreateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsPaymentSchedule +{ + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Transaction type of the mandate. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsTransactionType { + Business, + Personal, +} +impl CreateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsTransactionType { + pub fn as_str(self) -> &'static str { + use CreateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsTransactionType::*; + match self { + Business => "business", + Personal => "personal", + } + } +} + +impl std::str::FromStr + for CreateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsTransactionType +{ + type Err = (); + fn from_str(s: &str) -> Result { + use CreateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsTransactionType::*; + match s { + "business" => Ok(Business), + "personal" => Ok(Personal), + _ => Err(()), + } + } +} +impl std::fmt::Display + for CreateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsTransactionType +{ + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug + for CreateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsTransactionType +{ + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize + for CreateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsTransactionType +{ + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Bank account verification method. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreateSetupIntentPaymentMethodOptionsAcssDebitVerificationMethod { + Automatic, + Instant, + Microdeposits, +} +impl CreateSetupIntentPaymentMethodOptionsAcssDebitVerificationMethod { + pub fn as_str(self) -> &'static str { + use CreateSetupIntentPaymentMethodOptionsAcssDebitVerificationMethod::*; + match self { + Automatic => "automatic", + Instant => "instant", + Microdeposits => "microdeposits", + } + } +} + +impl std::str::FromStr for CreateSetupIntentPaymentMethodOptionsAcssDebitVerificationMethod { + type Err = (); + fn from_str(s: &str) -> Result { + use CreateSetupIntentPaymentMethodOptionsAcssDebitVerificationMethod::*; + match s { + "automatic" => Ok(Automatic), + "instant" => Ok(Instant), + "microdeposits" => Ok(Microdeposits), + _ => Err(()), + } + } +} +impl std::fmt::Display for CreateSetupIntentPaymentMethodOptionsAcssDebitVerificationMethod { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreateSetupIntentPaymentMethodOptionsAcssDebitVerificationMethod { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreateSetupIntentPaymentMethodOptionsAcssDebitVerificationMethod { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Configuration for any card setup attempted on this SetupIntent. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreateSetupIntentPaymentMethodOptionsCard<'a> { + /// Configuration options for setting up an eMandate for cards issued in India. + #[serde(skip_serializing_if = "Option::is_none")] + pub mandate_options: Option>, + /// When specified, this parameter signals that a card has been collected + /// as MOTO (Mail Order Telephone Order) and thus out of scope for SCA. This + /// parameter can only be provided during confirmation. + #[serde(skip_serializing_if = "Option::is_none")] + pub moto: Option, + /// Selected network to process this SetupIntent on. + /// Depends on the available networks of the card attached to the SetupIntent. + /// Can be only set confirm-time. + #[serde(skip_serializing_if = "Option::is_none")] + pub network: Option, + /// We strongly recommend that you rely on our SCA Engine to automatically prompt your customers for authentication based on risk level and [other requirements](https://stripe.com/docs/strong-customer-authentication). + /// However, if you wish to request 3D Secure based on logic from your own fraud engine, provide this option. + /// If not provided, this value defaults to `automatic`. + /// Read our guide on [manually requesting 3D Secure](https://stripe.com/docs/payments/3d-secure#manual-three-ds) for more information on how this configuration interacts with Radar and our SCA Engine. + #[serde(skip_serializing_if = "Option::is_none")] + pub request_three_d_secure: + Option, + /// If 3D Secure authentication was performed with a third-party provider, + /// the authentication details to use for this setup. + #[serde(skip_serializing_if = "Option::is_none")] + pub three_d_secure: Option>, +} +impl<'a> CreateSetupIntentPaymentMethodOptionsCard<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// Configuration options for setting up an eMandate for cards issued in India. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreateSetupIntentPaymentMethodOptionsCardMandateOptions<'a> { + /// Amount to be charged for future payments. + pub amount: i64, + /// One of `fixed` or `maximum`. + /// If `fixed`, the `amount` param refers to the exact amount to be charged in future payments. + /// If `maximum`, the amount charged can be up to the value passed for the `amount` param. + pub amount_type: CreateSetupIntentPaymentMethodOptionsCardMandateOptionsAmountType, + /// Currency in which future payments will be charged. + /// Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. + /// Must be a [supported currency](https://stripe.com/docs/currencies). + pub currency: stripe_types::Currency, + /// A description of the mandate or subscription that is meant to be displayed to the customer. + #[serde(skip_serializing_if = "Option::is_none")] + pub description: Option<&'a str>, + /// End date of the mandate or subscription. + /// If not provided, the mandate will be active until canceled. + /// If provided, end date should be after start date. + #[serde(skip_serializing_if = "Option::is_none")] + pub end_date: Option, + /// Specifies payment frequency. One of `day`, `week`, `month`, `year`, or `sporadic`. + pub interval: CreateSetupIntentPaymentMethodOptionsCardMandateOptionsInterval, + /// The number of intervals between payments. + /// For example, `interval=month` and `interval_count=3` indicates one payment every three months. + /// Maximum of one year interval allowed (1 year, 12 months, or 52 weeks). + /// This parameter is optional when `interval=sporadic`. + #[serde(skip_serializing_if = "Option::is_none")] + pub interval_count: Option, + /// Unique identifier for the mandate or subscription. + pub reference: &'a str, + /// Start date of the mandate or subscription. Start date should not be lesser than yesterday. + pub start_date: stripe_types::Timestamp, + /// Specifies the type of mandates supported. Possible values are `india`. + #[serde(skip_serializing_if = "Option::is_none")] + pub supported_types: + Option<&'a [CreateSetupIntentPaymentMethodOptionsCardMandateOptionsSupportedTypes]>, +} +impl<'a> CreateSetupIntentPaymentMethodOptionsCardMandateOptions<'a> { + pub fn new( + amount: i64, + amount_type: CreateSetupIntentPaymentMethodOptionsCardMandateOptionsAmountType, + currency: stripe_types::Currency, + interval: CreateSetupIntentPaymentMethodOptionsCardMandateOptionsInterval, + reference: &'a str, + start_date: stripe_types::Timestamp, + ) -> Self { + Self { + amount, + amount_type, + currency, + description: None, + end_date: None, + interval, + interval_count: None, + reference, + start_date, + supported_types: None, + } + } +} +/// One of `fixed` or `maximum`. +/// If `fixed`, the `amount` param refers to the exact amount to be charged in future payments. +/// If `maximum`, the amount charged can be up to the value passed for the `amount` param. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreateSetupIntentPaymentMethodOptionsCardMandateOptionsAmountType { + Fixed, + Maximum, +} +impl CreateSetupIntentPaymentMethodOptionsCardMandateOptionsAmountType { + pub fn as_str(self) -> &'static str { + use CreateSetupIntentPaymentMethodOptionsCardMandateOptionsAmountType::*; + match self { + Fixed => "fixed", + Maximum => "maximum", + } + } +} + +impl std::str::FromStr for CreateSetupIntentPaymentMethodOptionsCardMandateOptionsAmountType { + type Err = (); + fn from_str(s: &str) -> Result { + use CreateSetupIntentPaymentMethodOptionsCardMandateOptionsAmountType::*; + match s { + "fixed" => Ok(Fixed), + "maximum" => Ok(Maximum), + _ => Err(()), + } + } +} +impl std::fmt::Display for CreateSetupIntentPaymentMethodOptionsCardMandateOptionsAmountType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreateSetupIntentPaymentMethodOptionsCardMandateOptionsAmountType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreateSetupIntentPaymentMethodOptionsCardMandateOptionsAmountType { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Specifies payment frequency. One of `day`, `week`, `month`, `year`, or `sporadic`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreateSetupIntentPaymentMethodOptionsCardMandateOptionsInterval { + Day, + Month, + Sporadic, + Week, + Year, +} +impl CreateSetupIntentPaymentMethodOptionsCardMandateOptionsInterval { + pub fn as_str(self) -> &'static str { + use CreateSetupIntentPaymentMethodOptionsCardMandateOptionsInterval::*; + match self { + Day => "day", + Month => "month", + Sporadic => "sporadic", + Week => "week", + Year => "year", + } + } +} + +impl std::str::FromStr for CreateSetupIntentPaymentMethodOptionsCardMandateOptionsInterval { + type Err = (); + fn from_str(s: &str) -> Result { + use CreateSetupIntentPaymentMethodOptionsCardMandateOptionsInterval::*; + match s { + "day" => Ok(Day), + "month" => Ok(Month), + "sporadic" => Ok(Sporadic), + "week" => Ok(Week), + "year" => Ok(Year), + _ => Err(()), + } + } +} +impl std::fmt::Display for CreateSetupIntentPaymentMethodOptionsCardMandateOptionsInterval { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreateSetupIntentPaymentMethodOptionsCardMandateOptionsInterval { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreateSetupIntentPaymentMethodOptionsCardMandateOptionsInterval { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Specifies the type of mandates supported. Possible values are `india`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreateSetupIntentPaymentMethodOptionsCardMandateOptionsSupportedTypes { + India, +} +impl CreateSetupIntentPaymentMethodOptionsCardMandateOptionsSupportedTypes { + pub fn as_str(self) -> &'static str { + use CreateSetupIntentPaymentMethodOptionsCardMandateOptionsSupportedTypes::*; + match self { + India => "india", + } + } +} + +impl std::str::FromStr for CreateSetupIntentPaymentMethodOptionsCardMandateOptionsSupportedTypes { + type Err = (); + fn from_str(s: &str) -> Result { + use CreateSetupIntentPaymentMethodOptionsCardMandateOptionsSupportedTypes::*; + match s { + "india" => Ok(India), + _ => Err(()), + } + } +} +impl std::fmt::Display for CreateSetupIntentPaymentMethodOptionsCardMandateOptionsSupportedTypes { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreateSetupIntentPaymentMethodOptionsCardMandateOptionsSupportedTypes { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreateSetupIntentPaymentMethodOptionsCardMandateOptionsSupportedTypes { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Selected network to process this SetupIntent on. +/// Depends on the available networks of the card attached to the SetupIntent. +/// Can be only set confirm-time. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreateSetupIntentPaymentMethodOptionsCardNetwork { + Amex, + CartesBancaires, + Diners, + Discover, + EftposAu, + Interac, + Jcb, + Mastercard, + Unionpay, + Unknown, + Visa, +} +impl CreateSetupIntentPaymentMethodOptionsCardNetwork { + pub fn as_str(self) -> &'static str { + use CreateSetupIntentPaymentMethodOptionsCardNetwork::*; + match self { + Amex => "amex", + CartesBancaires => "cartes_bancaires", + Diners => "diners", + Discover => "discover", + EftposAu => "eftpos_au", + Interac => "interac", + Jcb => "jcb", + Mastercard => "mastercard", + Unionpay => "unionpay", + Unknown => "unknown", + Visa => "visa", + } + } +} + +impl std::str::FromStr for CreateSetupIntentPaymentMethodOptionsCardNetwork { + type Err = (); + fn from_str(s: &str) -> Result { + use CreateSetupIntentPaymentMethodOptionsCardNetwork::*; + match s { + "amex" => Ok(Amex), + "cartes_bancaires" => Ok(CartesBancaires), + "diners" => Ok(Diners), + "discover" => Ok(Discover), + "eftpos_au" => Ok(EftposAu), + "interac" => Ok(Interac), + "jcb" => Ok(Jcb), + "mastercard" => Ok(Mastercard), + "unionpay" => Ok(Unionpay), + "unknown" => Ok(Unknown), + "visa" => Ok(Visa), + _ => Err(()), + } + } +} +impl std::fmt::Display for CreateSetupIntentPaymentMethodOptionsCardNetwork { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreateSetupIntentPaymentMethodOptionsCardNetwork { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreateSetupIntentPaymentMethodOptionsCardNetwork { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// We strongly recommend that you rely on our SCA Engine to automatically prompt your customers for authentication based on risk level and [other requirements](https://stripe.com/docs/strong-customer-authentication). +/// However, if you wish to request 3D Secure based on logic from your own fraud engine, provide this option. +/// If not provided, this value defaults to `automatic`. +/// Read our guide on [manually requesting 3D Secure](https://stripe.com/docs/payments/3d-secure#manual-three-ds) for more information on how this configuration interacts with Radar and our SCA Engine. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreateSetupIntentPaymentMethodOptionsCardRequestThreeDSecure { + Any, + Automatic, + Challenge, +} +impl CreateSetupIntentPaymentMethodOptionsCardRequestThreeDSecure { + pub fn as_str(self) -> &'static str { + use CreateSetupIntentPaymentMethodOptionsCardRequestThreeDSecure::*; + match self { + Any => "any", + Automatic => "automatic", + Challenge => "challenge", + } + } +} + +impl std::str::FromStr for CreateSetupIntentPaymentMethodOptionsCardRequestThreeDSecure { + type Err = (); + fn from_str(s: &str) -> Result { + use CreateSetupIntentPaymentMethodOptionsCardRequestThreeDSecure::*; + match s { + "any" => Ok(Any), + "automatic" => Ok(Automatic), + "challenge" => Ok(Challenge), + _ => Err(()), + } + } +} +impl std::fmt::Display for CreateSetupIntentPaymentMethodOptionsCardRequestThreeDSecure { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreateSetupIntentPaymentMethodOptionsCardRequestThreeDSecure { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreateSetupIntentPaymentMethodOptionsCardRequestThreeDSecure { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// If 3D Secure authentication was performed with a third-party provider, +/// the authentication details to use for this setup. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreateSetupIntentPaymentMethodOptionsCardThreeDSecure<'a> { + /// The `transStatus` returned from the card Issuer’s ACS in the ARes. + #[serde(skip_serializing_if = "Option::is_none")] + pub ares_trans_status: + Option, + /// The cryptogram, also known as the "authentication value" (AAV, CAVV or + /// AEVV). This value is 20 bytes, base64-encoded into a 28-character string. + /// (Most 3D Secure providers will return the base64-encoded version, which + /// is what you should specify here.) + #[serde(skip_serializing_if = "Option::is_none")] + pub cryptogram: Option<&'a str>, + /// The Electronic Commerce Indicator (ECI) is returned by your 3D Secure + /// provider and indicates what degree of authentication was performed. + #[serde(skip_serializing_if = "Option::is_none")] + pub electronic_commerce_indicator: + Option, + /// Network specific 3DS fields. Network specific arguments require an + /// explicit card brand choice. The parameter `payment_method_options.card.network`` + /// must be populated accordingly + #[serde(skip_serializing_if = "Option::is_none")] + pub network_options: + Option>, + /// The challenge indicator (`threeDSRequestorChallengeInd`) which was requested in the + /// AReq sent to the card Issuer's ACS. A string containing 2 digits from 01-99. + #[serde(skip_serializing_if = "Option::is_none")] + pub requestor_challenge_indicator: Option<&'a str>, + /// For 3D Secure 1, the XID. For 3D Secure 2, the Directory Server + /// Transaction ID (dsTransID). + #[serde(skip_serializing_if = "Option::is_none")] + pub transaction_id: Option<&'a str>, + /// The version of 3D Secure that was performed. + #[serde(skip_serializing_if = "Option::is_none")] + pub version: Option, +} +impl<'a> CreateSetupIntentPaymentMethodOptionsCardThreeDSecure<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// The `transStatus` returned from the card Issuer’s ACS in the ARes. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreateSetupIntentPaymentMethodOptionsCardThreeDSecureAresTransStatus { + A, + C, + I, + N, + R, + U, + Y, +} +impl CreateSetupIntentPaymentMethodOptionsCardThreeDSecureAresTransStatus { + pub fn as_str(self) -> &'static str { + use CreateSetupIntentPaymentMethodOptionsCardThreeDSecureAresTransStatus::*; + match self { + A => "A", + C => "C", + I => "I", + N => "N", + R => "R", + U => "U", + Y => "Y", + } + } +} + +impl std::str::FromStr for CreateSetupIntentPaymentMethodOptionsCardThreeDSecureAresTransStatus { + type Err = (); + fn from_str(s: &str) -> Result { + use CreateSetupIntentPaymentMethodOptionsCardThreeDSecureAresTransStatus::*; + match s { + "A" => Ok(A), + "C" => Ok(C), + "I" => Ok(I), + "N" => Ok(N), + "R" => Ok(R), + "U" => Ok(U), + "Y" => Ok(Y), + _ => Err(()), + } + } +} +impl std::fmt::Display for CreateSetupIntentPaymentMethodOptionsCardThreeDSecureAresTransStatus { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreateSetupIntentPaymentMethodOptionsCardThreeDSecureAresTransStatus { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreateSetupIntentPaymentMethodOptionsCardThreeDSecureAresTransStatus { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// The Electronic Commerce Indicator (ECI) is returned by your 3D Secure +/// provider and indicates what degree of authentication was performed. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreateSetupIntentPaymentMethodOptionsCardThreeDSecureElectronicCommerceIndicator { + V01, + V02, + V05, + V06, + V07, +} +impl CreateSetupIntentPaymentMethodOptionsCardThreeDSecureElectronicCommerceIndicator { + pub fn as_str(self) -> &'static str { + use CreateSetupIntentPaymentMethodOptionsCardThreeDSecureElectronicCommerceIndicator::*; + match self { + V01 => "01", + V02 => "02", + V05 => "05", + V06 => "06", + V07 => "07", + } + } +} + +impl std::str::FromStr + for CreateSetupIntentPaymentMethodOptionsCardThreeDSecureElectronicCommerceIndicator +{ + type Err = (); + fn from_str(s: &str) -> Result { + use CreateSetupIntentPaymentMethodOptionsCardThreeDSecureElectronicCommerceIndicator::*; + match s { + "01" => Ok(V01), + "02" => Ok(V02), + "05" => Ok(V05), + "06" => Ok(V06), + "07" => Ok(V07), + _ => Err(()), + } + } +} +impl std::fmt::Display + for CreateSetupIntentPaymentMethodOptionsCardThreeDSecureElectronicCommerceIndicator +{ + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug + for CreateSetupIntentPaymentMethodOptionsCardThreeDSecureElectronicCommerceIndicator +{ + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize + for CreateSetupIntentPaymentMethodOptionsCardThreeDSecureElectronicCommerceIndicator +{ + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Network specific 3DS fields. Network specific arguments require an +/// explicit card brand choice. The parameter `payment_method_options.card.network`` +/// must be populated accordingly +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreateSetupIntentPaymentMethodOptionsCardThreeDSecureNetworkOptions<'a> { + /// Cartes Bancaires-specific 3DS fields. + #[serde(skip_serializing_if = "Option::is_none")] + pub cartes_bancaires: Option< + CreateSetupIntentPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancaires<'a>, + >, +} +impl<'a> CreateSetupIntentPaymentMethodOptionsCardThreeDSecureNetworkOptions<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// Cartes Bancaires-specific 3DS fields. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreateSetupIntentPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancaires<'a> { + /// The cryptogram calculation algorithm used by the card Issuer's ACS + /// to calculate the Authentication cryptogram. Also known as `cavvAlgorithm`. + /// messageExtension: CB-AVALGO + pub cb_avalgo: + CreateSetupIntentPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancairesCbAvalgo, + /// The exemption indicator returned from Cartes Bancaires in the ARes. + /// message extension: CB-EXEMPTION; string (4 characters) + /// This is a 3 byte bitmap (low significant byte first and most significant + /// bit first) that has been Base64 encoded + #[serde(skip_serializing_if = "Option::is_none")] + pub cb_exemption: Option<&'a str>, + /// The risk score returned from Cartes Bancaires in the ARes. + /// message extension: CB-SCORE; numeric value 0-99 + #[serde(skip_serializing_if = "Option::is_none")] + pub cb_score: Option, +} +impl<'a> CreateSetupIntentPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancaires<'a> { + pub fn new( + cb_avalgo: CreateSetupIntentPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancairesCbAvalgo, + ) -> Self { + Self { cb_avalgo, cb_exemption: None, cb_score: None } + } +} +/// The cryptogram calculation algorithm used by the card Issuer's ACS +/// to calculate the Authentication cryptogram. Also known as `cavvAlgorithm`. +/// messageExtension: CB-AVALGO +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreateSetupIntentPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancairesCbAvalgo +{ + V0, + V1, + V2, + V3, + V4, + A, +} +impl CreateSetupIntentPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancairesCbAvalgo { + pub fn as_str(self) -> &'static str { + use CreateSetupIntentPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancairesCbAvalgo::*; + match self { + V0 => "0", + V1 => "1", + V2 => "2", + V3 => "3", + V4 => "4", + A => "A", + } + } +} + +impl std::str::FromStr + for CreateSetupIntentPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancairesCbAvalgo +{ + type Err = (); + fn from_str(s: &str) -> Result { + use CreateSetupIntentPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancairesCbAvalgo::*; + match s { + "0" => Ok(V0), + "1" => Ok(V1), + "2" => Ok(V2), + "3" => Ok(V3), + "4" => Ok(V4), + "A" => Ok(A), + _ => Err(()), + } + } +} +impl std::fmt::Display + for CreateSetupIntentPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancairesCbAvalgo +{ + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug + for CreateSetupIntentPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancairesCbAvalgo +{ + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize + for CreateSetupIntentPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancairesCbAvalgo +{ + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// The version of 3D Secure that was performed. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreateSetupIntentPaymentMethodOptionsCardThreeDSecureVersion { + V1_0_2, + V2_1_0, + V2_2_0, +} +impl CreateSetupIntentPaymentMethodOptionsCardThreeDSecureVersion { + pub fn as_str(self) -> &'static str { + use CreateSetupIntentPaymentMethodOptionsCardThreeDSecureVersion::*; + match self { + V1_0_2 => "1.0.2", + V2_1_0 => "2.1.0", + V2_2_0 => "2.2.0", + } + } +} + +impl std::str::FromStr for CreateSetupIntentPaymentMethodOptionsCardThreeDSecureVersion { + type Err = (); + fn from_str(s: &str) -> Result { + use CreateSetupIntentPaymentMethodOptionsCardThreeDSecureVersion::*; + match s { + "1.0.2" => Ok(V1_0_2), + "2.1.0" => Ok(V2_1_0), + "2.2.0" => Ok(V2_2_0), + _ => Err(()), + } + } +} +impl std::fmt::Display for CreateSetupIntentPaymentMethodOptionsCardThreeDSecureVersion { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreateSetupIntentPaymentMethodOptionsCardThreeDSecureVersion { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreateSetupIntentPaymentMethodOptionsCardThreeDSecureVersion { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// If this is a `sepa_debit` SetupIntent, this sub-hash contains details about the SEPA Debit payment method options. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreateSetupIntentPaymentMethodOptionsSepaDebit<'a> { + /// Additional fields for Mandate creation + #[serde(skip_serializing_if = "Option::is_none")] + pub mandate_options: Option<&'a serde_json::Value>, +} +impl<'a> CreateSetupIntentPaymentMethodOptionsSepaDebit<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// If this is a `us_bank_account` SetupIntent, this sub-hash contains details about the US bank account payment method options. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreateSetupIntentPaymentMethodOptionsUsBankAccount<'a> { + /// Additional fields for Financial Connections Session creation + #[serde(skip_serializing_if = "Option::is_none")] + pub financial_connections: + Option>, + /// Additional fields for Mandate creation + #[serde(skip_serializing_if = "Option::is_none")] + pub mandate_options: Option, + /// Additional fields for network related functions + #[serde(skip_serializing_if = "Option::is_none")] + pub networks: Option>, + /// Bank account verification method. + #[serde(skip_serializing_if = "Option::is_none")] + pub verification_method: + Option, +} +impl<'a> CreateSetupIntentPaymentMethodOptionsUsBankAccount<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// Additional fields for Financial Connections Session creation +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnections<'a> { + /// The list of permissions to request. + /// If this parameter is passed, the `payment_method` permission must be included. + /// Valid permissions include: `balances`, `ownership`, `payment_method`, and `transactions`. + #[serde(skip_serializing_if = "Option::is_none")] + pub permissions: Option< + &'a [CreateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions], + >, + /// List of data features that you would like to retrieve upon account creation. + #[serde(skip_serializing_if = "Option::is_none")] + pub prefetch: Option< + &'a [CreateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch], + >, + /// For webview integrations only. + /// Upon completing OAuth login in the native browser, the user will be redirected to this URL to return to your app. + #[serde(skip_serializing_if = "Option::is_none")] + pub return_url: Option<&'a str>, +} +impl<'a> CreateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnections<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// The list of permissions to request. +/// If this parameter is passed, the `payment_method` permission must be included. +/// Valid permissions include: `balances`, `ownership`, `payment_method`, and `transactions`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions { + Balances, + Ownership, + PaymentMethod, + Transactions, +} +impl CreateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions { + pub fn as_str(self) -> &'static str { + use CreateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions::*; + match self { + Balances => "balances", + Ownership => "ownership", + PaymentMethod => "payment_method", + Transactions => "transactions", + } + } +} + +impl std::str::FromStr + for CreateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions +{ + type Err = (); + fn from_str(s: &str) -> Result { + use CreateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions::*; + match s { + "balances" => Ok(Balances), + "ownership" => Ok(Ownership), + "payment_method" => Ok(PaymentMethod), + "transactions" => Ok(Transactions), + _ => Err(()), + } + } +} +impl std::fmt::Display + for CreateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions +{ + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug + for CreateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions +{ + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize + for CreateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions +{ + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// List of data features that you would like to retrieve upon account creation. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch { + Balances, + Transactions, +} +impl CreateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch { + pub fn as_str(self) -> &'static str { + use CreateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch::*; + match self { + Balances => "balances", + Transactions => "transactions", + } + } +} + +impl std::str::FromStr + for CreateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch +{ + type Err = (); + fn from_str(s: &str) -> Result { + use CreateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch::*; + match s { + "balances" => Ok(Balances), + "transactions" => Ok(Transactions), + _ => Err(()), + } + } +} +impl std::fmt::Display + for CreateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch +{ + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug + for CreateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch +{ + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize + for CreateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch +{ + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Additional fields for Mandate creation +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreateSetupIntentPaymentMethodOptionsUsBankAccountMandateOptions { + /// The method used to collect offline mandate customer acceptance. + #[serde(skip_serializing_if = "Option::is_none")] + pub collection_method: + Option, +} +impl CreateSetupIntentPaymentMethodOptionsUsBankAccountMandateOptions { + pub fn new() -> Self { + Self::default() + } +} +/// The method used to collect offline mandate customer acceptance. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreateSetupIntentPaymentMethodOptionsUsBankAccountMandateOptionsCollectionMethod { + Paper, +} +impl CreateSetupIntentPaymentMethodOptionsUsBankAccountMandateOptionsCollectionMethod { + pub fn as_str(self) -> &'static str { + use CreateSetupIntentPaymentMethodOptionsUsBankAccountMandateOptionsCollectionMethod::*; + match self { + Paper => "paper", + } + } +} + +impl std::str::FromStr + for CreateSetupIntentPaymentMethodOptionsUsBankAccountMandateOptionsCollectionMethod +{ + type Err = (); + fn from_str(s: &str) -> Result { + use CreateSetupIntentPaymentMethodOptionsUsBankAccountMandateOptionsCollectionMethod::*; + match s { + "paper" => Ok(Paper), + _ => Err(()), + } + } +} +impl std::fmt::Display + for CreateSetupIntentPaymentMethodOptionsUsBankAccountMandateOptionsCollectionMethod +{ + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug + for CreateSetupIntentPaymentMethodOptionsUsBankAccountMandateOptionsCollectionMethod +{ + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize + for CreateSetupIntentPaymentMethodOptionsUsBankAccountMandateOptionsCollectionMethod +{ + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Additional fields for network related functions +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreateSetupIntentPaymentMethodOptionsUsBankAccountNetworks<'a> { + /// Triggers validations to run across the selected networks + #[serde(skip_serializing_if = "Option::is_none")] + pub requested: + Option<&'a [CreateSetupIntentPaymentMethodOptionsUsBankAccountNetworksRequested]>, +} +impl<'a> CreateSetupIntentPaymentMethodOptionsUsBankAccountNetworks<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// Triggers validations to run across the selected networks +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreateSetupIntentPaymentMethodOptionsUsBankAccountNetworksRequested { + Ach, + UsDomesticWire, +} +impl CreateSetupIntentPaymentMethodOptionsUsBankAccountNetworksRequested { + pub fn as_str(self) -> &'static str { + use CreateSetupIntentPaymentMethodOptionsUsBankAccountNetworksRequested::*; + match self { + Ach => "ach", + UsDomesticWire => "us_domestic_wire", + } + } +} + +impl std::str::FromStr for CreateSetupIntentPaymentMethodOptionsUsBankAccountNetworksRequested { + type Err = (); + fn from_str(s: &str) -> Result { + use CreateSetupIntentPaymentMethodOptionsUsBankAccountNetworksRequested::*; + match s { + "ach" => Ok(Ach), + "us_domestic_wire" => Ok(UsDomesticWire), + _ => Err(()), + } + } +} +impl std::fmt::Display for CreateSetupIntentPaymentMethodOptionsUsBankAccountNetworksRequested { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreateSetupIntentPaymentMethodOptionsUsBankAccountNetworksRequested { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreateSetupIntentPaymentMethodOptionsUsBankAccountNetworksRequested { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Bank account verification method. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreateSetupIntentPaymentMethodOptionsUsBankAccountVerificationMethod { + Automatic, + Instant, + Microdeposits, +} +impl CreateSetupIntentPaymentMethodOptionsUsBankAccountVerificationMethod { + pub fn as_str(self) -> &'static str { + use CreateSetupIntentPaymentMethodOptionsUsBankAccountVerificationMethod::*; + match self { + Automatic => "automatic", + Instant => "instant", + Microdeposits => "microdeposits", + } + } +} + +impl std::str::FromStr for CreateSetupIntentPaymentMethodOptionsUsBankAccountVerificationMethod { + type Err = (); + fn from_str(s: &str) -> Result { + use CreateSetupIntentPaymentMethodOptionsUsBankAccountVerificationMethod::*; + match s { + "automatic" => Ok(Automatic), + "instant" => Ok(Instant), + "microdeposits" => Ok(Microdeposits), + _ => Err(()), + } + } +} +impl std::fmt::Display for CreateSetupIntentPaymentMethodOptionsUsBankAccountVerificationMethod { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreateSetupIntentPaymentMethodOptionsUsBankAccountVerificationMethod { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreateSetupIntentPaymentMethodOptionsUsBankAccountVerificationMethod { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// If you populate this hash, this SetupIntent generates a `single_use` mandate after successful completion. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreateSetupIntentSingleUse { + /// Amount the customer is granting permission to collect later. + /// A positive integer representing how much to charge in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal) (e.g., 100 cents to charge $1.00 or 100 to charge ¥100, a zero-decimal currency). + /// The minimum amount is $0.50 US or [equivalent in charge currency](https://stripe.com/docs/currencies#minimum-and-maximum-charge-amounts). + /// The amount value supports up to eight digits (e.g., a value of 99999999 for a USD charge of $999,999.99). + pub amount: i64, + /// Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. + /// Must be a [supported currency](https://stripe.com/docs/currencies). + pub currency: stripe_types::Currency, +} +impl CreateSetupIntentSingleUse { + pub fn new(amount: i64, currency: stripe_types::Currency) -> Self { + Self { amount, currency } + } +} +/// Indicates how the payment method is intended to be used in the future. +/// If not provided, this value defaults to `off_session`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreateSetupIntentUsage { + OffSession, + OnSession, +} +impl CreateSetupIntentUsage { + pub fn as_str(self) -> &'static str { + use CreateSetupIntentUsage::*; + match self { + OffSession => "off_session", + OnSession => "on_session", + } + } +} + +impl std::str::FromStr for CreateSetupIntentUsage { + type Err = (); + fn from_str(s: &str) -> Result { + use CreateSetupIntentUsage::*; + match s { + "off_session" => Ok(OffSession), + "on_session" => Ok(OnSession), + _ => Err(()), + } + } +} +impl std::fmt::Display for CreateSetupIntentUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreateSetupIntentUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreateSetupIntentUsage { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'a> CreateSetupIntent<'a> { + /// Creates a SetupIntent object. + /// + /// After you create the SetupIntent, attach a payment method and [confirm](https://stripe.com/docs/api/setup_intents/confirm). + /// it to collect any required permissions to charge the payment method later. + pub fn send(&self, client: &stripe::Client) -> stripe::Response { + client.send_form("/setup_intents", self, http_types::Method::Post) + } +} +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdateSetupIntent<'a> { + /// If present, the SetupIntent's payment method will be attached to the in-context Stripe Account. + /// + /// It can only be used for this Stripe Account’s own money movement flows like InboundTransfer and OutboundTransfers. + /// It cannot be set to true when setting up a PaymentMethod for a Customer, and defaults to false when attaching a PaymentMethod to a Customer. + #[serde(skip_serializing_if = "Option::is_none")] + pub attach_to_self: Option, + /// ID of the Customer this SetupIntent belongs to, if one exists. + /// + /// If present, the SetupIntent's payment method will be attached to the Customer on successful setup. + /// Payment methods attached to other Customers cannot be used with this SetupIntent. + #[serde(skip_serializing_if = "Option::is_none")] + pub customer: Option<&'a str>, + /// An arbitrary string attached to the object. Often useful for displaying to users. + #[serde(skip_serializing_if = "Option::is_none")] + pub description: Option<&'a str>, + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, + /// Indicates the directions of money movement for which this payment method is intended to be used. + /// + /// Include `inbound` if you intend to use the payment method as the origin to pull funds from. + /// Include `outbound` if you intend to use the payment method as the destination to send funds to. + /// You can include both if you intend to use the payment method for both purposes. + #[serde(skip_serializing_if = "Option::is_none")] + pub flow_directions: Option<&'a [stripe_shared::SetupIntentFlowDirections]>, + /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. + /// This can be useful for storing additional information about the object in a structured format. + /// Individual keys can be unset by posting an empty value to them. + /// All keys can be unset by posting an empty value to `metadata`. + #[serde(skip_serializing_if = "Option::is_none")] + pub metadata: Option<&'a std::collections::HashMap>, + /// ID of the payment method (a PaymentMethod, Card, or saved Source object) to attach to this SetupIntent. + #[serde(skip_serializing_if = "Option::is_none")] + pub payment_method: Option<&'a str>, + /// The ID of the payment method configuration to use with this SetupIntent. + #[serde(skip_serializing_if = "Option::is_none")] + pub payment_method_configuration: Option<&'a str>, + /// When included, this hash creates a PaymentMethod that is set as the [`payment_method`](https://stripe.com/docs/api/setup_intents/object#setup_intent_object-payment_method). + /// value in the SetupIntent. + #[serde(skip_serializing_if = "Option::is_none")] + pub payment_method_data: Option>, + /// Payment method-specific configuration for this SetupIntent. + #[serde(skip_serializing_if = "Option::is_none")] + pub payment_method_options: Option>, + /// The list of payment method types (for example, card) that this SetupIntent can set up. + /// If you don't provide this array, it defaults to ["card"]. + #[serde(skip_serializing_if = "Option::is_none")] + pub payment_method_types: Option<&'a [&'a str]>, +} +impl<'a> UpdateSetupIntent<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// When included, this hash creates a PaymentMethod that is set as the [`payment_method`](https://stripe.com/docs/api/setup_intents/object#setup_intent_object-payment_method). +/// value in the SetupIntent. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct UpdateSetupIntentPaymentMethodData<'a> { + /// If this is an `acss_debit` PaymentMethod, this hash contains details about the ACSS Debit payment method. + #[serde(skip_serializing_if = "Option::is_none")] + pub acss_debit: Option>, + /// If this is an `affirm` PaymentMethod, this hash contains details about the Affirm payment method. + #[serde(skip_serializing_if = "Option::is_none")] + pub affirm: Option<&'a serde_json::Value>, + /// If this is an `AfterpayClearpay` PaymentMethod, this hash contains details about the AfterpayClearpay payment method. + #[serde(skip_serializing_if = "Option::is_none")] + pub afterpay_clearpay: Option<&'a serde_json::Value>, + /// If this is an `Alipay` PaymentMethod, this hash contains details about the Alipay payment method. + #[serde(skip_serializing_if = "Option::is_none")] + pub alipay: Option<&'a serde_json::Value>, + /// If this is an `au_becs_debit` PaymentMethod, this hash contains details about the bank account. + #[serde(skip_serializing_if = "Option::is_none")] + pub au_becs_debit: Option>, + /// If this is a `bacs_debit` PaymentMethod, this hash contains details about the Bacs Direct Debit bank account. + #[serde(skip_serializing_if = "Option::is_none")] + pub bacs_debit: Option>, + /// If this is a `bancontact` PaymentMethod, this hash contains details about the Bancontact payment method. + #[serde(skip_serializing_if = "Option::is_none")] + pub bancontact: Option<&'a serde_json::Value>, + /// Billing information associated with the PaymentMethod that may be used or required by particular types of payment methods. + #[serde(skip_serializing_if = "Option::is_none")] + pub billing_details: Option>, + /// If this is a `blik` PaymentMethod, this hash contains details about the BLIK payment method. + #[serde(skip_serializing_if = "Option::is_none")] + pub blik: Option<&'a serde_json::Value>, + /// If this is a `boleto` PaymentMethod, this hash contains details about the Boleto payment method. + #[serde(skip_serializing_if = "Option::is_none")] + pub boleto: Option>, + /// If this is a `cashapp` PaymentMethod, this hash contains details about the Cash App Pay payment method. + #[serde(skip_serializing_if = "Option::is_none")] + pub cashapp: Option<&'a serde_json::Value>, + /// If this is a `customer_balance` PaymentMethod, this hash contains details about the CustomerBalance payment method. + #[serde(skip_serializing_if = "Option::is_none")] + pub customer_balance: Option<&'a serde_json::Value>, + /// If this is an `eps` PaymentMethod, this hash contains details about the EPS payment method. + #[serde(skip_serializing_if = "Option::is_none")] + pub eps: Option, + /// If this is an `fpx` PaymentMethod, this hash contains details about the FPX payment method. + #[serde(skip_serializing_if = "Option::is_none")] + pub fpx: Option, + /// If this is a `giropay` PaymentMethod, this hash contains details about the Giropay payment method. + #[serde(skip_serializing_if = "Option::is_none")] + pub giropay: Option<&'a serde_json::Value>, + /// If this is a `grabpay` PaymentMethod, this hash contains details about the GrabPay payment method. + #[serde(skip_serializing_if = "Option::is_none")] + pub grabpay: Option<&'a serde_json::Value>, + /// If this is an `ideal` PaymentMethod, this hash contains details about the iDEAL payment method. + #[serde(skip_serializing_if = "Option::is_none")] + pub ideal: Option, + /// If this is an `interac_present` PaymentMethod, this hash contains details about the Interac Present payment method. + #[serde(skip_serializing_if = "Option::is_none")] + pub interac_present: Option<&'a serde_json::Value>, + /// If this is a `klarna` PaymentMethod, this hash contains details about the Klarna payment method. + #[serde(skip_serializing_if = "Option::is_none")] + pub klarna: Option, + /// If this is a `konbini` PaymentMethod, this hash contains details about the Konbini payment method. + #[serde(skip_serializing_if = "Option::is_none")] + pub konbini: Option<&'a serde_json::Value>, + /// If this is an `Link` PaymentMethod, this hash contains details about the Link payment method. + #[serde(skip_serializing_if = "Option::is_none")] + pub link: Option<&'a serde_json::Value>, + /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. + /// This can be useful for storing additional information about the object in a structured format. + /// Individual keys can be unset by posting an empty value to them. + /// All keys can be unset by posting an empty value to `metadata`. + #[serde(skip_serializing_if = "Option::is_none")] + pub metadata: Option<&'a std::collections::HashMap>, + /// If this is an `oxxo` PaymentMethod, this hash contains details about the OXXO payment method. + #[serde(skip_serializing_if = "Option::is_none")] + pub oxxo: Option<&'a serde_json::Value>, + /// If this is a `p24` PaymentMethod, this hash contains details about the P24 payment method. + #[serde(skip_serializing_if = "Option::is_none")] + pub p24: Option, + /// If this is a `paynow` PaymentMethod, this hash contains details about the PayNow payment method. + #[serde(skip_serializing_if = "Option::is_none")] + pub paynow: Option<&'a serde_json::Value>, + /// If this is a `paypal` PaymentMethod, this hash contains details about the PayPal payment method. + #[serde(skip_serializing_if = "Option::is_none")] + pub paypal: Option<&'a serde_json::Value>, + /// If this is a `pix` PaymentMethod, this hash contains details about the Pix payment method. + #[serde(skip_serializing_if = "Option::is_none")] + pub pix: Option<&'a serde_json::Value>, + /// If this is a `promptpay` PaymentMethod, this hash contains details about the PromptPay payment method. + #[serde(skip_serializing_if = "Option::is_none")] + pub promptpay: Option<&'a serde_json::Value>, + /// Options to configure Radar. + /// See [Radar Session](https://stripe.com/docs/radar/radar-session) for more information. + #[serde(skip_serializing_if = "Option::is_none")] + pub radar_options: Option>, + /// If this is a `Revolut Pay` PaymentMethod, this hash contains details about the Revolut Pay payment method. + #[serde(skip_serializing_if = "Option::is_none")] + pub revolut_pay: Option<&'a serde_json::Value>, + /// If this is a `sepa_debit` PaymentMethod, this hash contains details about the SEPA debit bank account. + #[serde(skip_serializing_if = "Option::is_none")] + pub sepa_debit: Option>, + /// If this is a `sofort` PaymentMethod, this hash contains details about the SOFORT payment method. + #[serde(skip_serializing_if = "Option::is_none")] + pub sofort: Option, + /// If this is a `swish` PaymentMethod, this hash contains details about the Swish payment method. + #[serde(skip_serializing_if = "Option::is_none")] + pub swish: Option<&'a serde_json::Value>, + /// The type of the PaymentMethod. + /// An additional hash is included on the PaymentMethod with a name matching this value. + /// It contains additional information specific to the PaymentMethod type. + #[serde(rename = "type")] + pub type_: UpdateSetupIntentPaymentMethodDataType, + /// If this is an `us_bank_account` PaymentMethod, this hash contains details about the US bank account payment method. + #[serde(skip_serializing_if = "Option::is_none")] + pub us_bank_account: Option>, + /// If this is an `wechat_pay` PaymentMethod, this hash contains details about the wechat_pay payment method. + #[serde(skip_serializing_if = "Option::is_none")] + pub wechat_pay: Option<&'a serde_json::Value>, + /// If this is a `zip` PaymentMethod, this hash contains details about the Zip payment method. + #[serde(skip_serializing_if = "Option::is_none")] + pub zip: Option<&'a serde_json::Value>, +} +impl<'a> UpdateSetupIntentPaymentMethodData<'a> { + pub fn new(type_: UpdateSetupIntentPaymentMethodDataType) -> Self { + Self { + acss_debit: None, + affirm: None, + afterpay_clearpay: None, + alipay: None, + au_becs_debit: None, + bacs_debit: None, + bancontact: None, + billing_details: None, + blik: None, + boleto: None, + cashapp: None, + customer_balance: None, + eps: None, + fpx: None, + giropay: None, + grabpay: None, + ideal: None, + interac_present: None, + klarna: None, + konbini: None, + link: None, + metadata: None, + oxxo: None, + p24: None, + paynow: None, + paypal: None, + pix: None, + promptpay: None, + radar_options: None, + revolut_pay: None, + sepa_debit: None, + sofort: None, + swish: None, + type_, + us_bank_account: None, + wechat_pay: None, + zip: None, + } + } +} +/// If this is an `au_becs_debit` PaymentMethod, this hash contains details about the bank account. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct UpdateSetupIntentPaymentMethodDataAuBecsDebit<'a> { + /// The account number for the bank account. + pub account_number: &'a str, + /// Bank-State-Branch number of the bank account. + pub bsb_number: &'a str, +} +impl<'a> UpdateSetupIntentPaymentMethodDataAuBecsDebit<'a> { + pub fn new(account_number: &'a str, bsb_number: &'a str) -> Self { + Self { account_number, bsb_number } + } +} +/// If this is a `bacs_debit` PaymentMethod, this hash contains details about the Bacs Direct Debit bank account. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdateSetupIntentPaymentMethodDataBacsDebit<'a> { + /// Account number of the bank account that the funds will be debited from. + #[serde(skip_serializing_if = "Option::is_none")] + pub account_number: Option<&'a str>, + /// Sort code of the bank account. (e.g., `10-20-30`) + #[serde(skip_serializing_if = "Option::is_none")] + pub sort_code: Option<&'a str>, +} +impl<'a> UpdateSetupIntentPaymentMethodDataBacsDebit<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// If this is a `boleto` PaymentMethod, this hash contains details about the Boleto payment method. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct UpdateSetupIntentPaymentMethodDataBoleto<'a> { + /// The tax ID of the customer (CPF for individual consumers or CNPJ for businesses consumers) + pub tax_id: &'a str, +} +impl<'a> UpdateSetupIntentPaymentMethodDataBoleto<'a> { + pub fn new(tax_id: &'a str) -> Self { + Self { tax_id } + } +} +/// If this is an `eps` PaymentMethod, this hash contains details about the EPS payment method. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdateSetupIntentPaymentMethodDataEps { + /// The customer's bank. + #[serde(skip_serializing_if = "Option::is_none")] + pub bank: Option, +} +impl UpdateSetupIntentPaymentMethodDataEps { + pub fn new() -> Self { + Self::default() + } +} +/// The customer's bank. +#[derive(Copy, Clone, Eq, PartialEq)] +#[non_exhaustive] +pub enum UpdateSetupIntentPaymentMethodDataEpsBank { + ArzteUndApothekerBank, + AustrianAnadiBankAg, + BankAustria, + BankhausCarlSpangler, + BankhausSchelhammerUndSchatteraAg, + BawagPskAg, + BksBankAg, + BrullKallmusBankAg, + BtvVierLanderBank, + CapitalBankGraweGruppeAg, + DeutscheBankAg, + Dolomitenbank, + EasybankAg, + ErsteBankUndSparkassen, + HypoAlpeadriabankInternationalAg, + HypoBankBurgenlandAktiengesellschaft, + HypoNoeLbFurNiederosterreichUWien, + HypoOberosterreichSalzburgSteiermark, + HypoTirolBankAg, + HypoVorarlbergBankAg, + MarchfelderBank, + OberbankAg, + RaiffeisenBankengruppeOsterreich, + SchoellerbankAg, + SpardaBankWien, + VolksbankGruppe, + VolkskreditbankAg, + VrBankBraunau, + /// An unrecognized value from Stripe. Should not be used as a request parameter. + Unknown, +} +impl UpdateSetupIntentPaymentMethodDataEpsBank { + pub fn as_str(self) -> &'static str { + use UpdateSetupIntentPaymentMethodDataEpsBank::*; + match self { + ArzteUndApothekerBank => "arzte_und_apotheker_bank", + AustrianAnadiBankAg => "austrian_anadi_bank_ag", + BankAustria => "bank_austria", + BankhausCarlSpangler => "bankhaus_carl_spangler", + BankhausSchelhammerUndSchatteraAg => "bankhaus_schelhammer_und_schattera_ag", + BawagPskAg => "bawag_psk_ag", + BksBankAg => "bks_bank_ag", + BrullKallmusBankAg => "brull_kallmus_bank_ag", + BtvVierLanderBank => "btv_vier_lander_bank", + CapitalBankGraweGruppeAg => "capital_bank_grawe_gruppe_ag", + DeutscheBankAg => "deutsche_bank_ag", + Dolomitenbank => "dolomitenbank", + EasybankAg => "easybank_ag", + ErsteBankUndSparkassen => "erste_bank_und_sparkassen", + HypoAlpeadriabankInternationalAg => "hypo_alpeadriabank_international_ag", + HypoBankBurgenlandAktiengesellschaft => "hypo_bank_burgenland_aktiengesellschaft", + HypoNoeLbFurNiederosterreichUWien => "hypo_noe_lb_fur_niederosterreich_u_wien", + HypoOberosterreichSalzburgSteiermark => "hypo_oberosterreich_salzburg_steiermark", + HypoTirolBankAg => "hypo_tirol_bank_ag", + HypoVorarlbergBankAg => "hypo_vorarlberg_bank_ag", + MarchfelderBank => "marchfelder_bank", + OberbankAg => "oberbank_ag", + RaiffeisenBankengruppeOsterreich => "raiffeisen_bankengruppe_osterreich", + SchoellerbankAg => "schoellerbank_ag", + SpardaBankWien => "sparda_bank_wien", + VolksbankGruppe => "volksbank_gruppe", + VolkskreditbankAg => "volkskreditbank_ag", + VrBankBraunau => "vr_bank_braunau", + Unknown => "unknown", + } + } +} + +impl std::str::FromStr for UpdateSetupIntentPaymentMethodDataEpsBank { + type Err = (); + fn from_str(s: &str) -> Result { + use UpdateSetupIntentPaymentMethodDataEpsBank::*; + match s { + "arzte_und_apotheker_bank" => Ok(ArzteUndApothekerBank), + "austrian_anadi_bank_ag" => Ok(AustrianAnadiBankAg), + "bank_austria" => Ok(BankAustria), + "bankhaus_carl_spangler" => Ok(BankhausCarlSpangler), + "bankhaus_schelhammer_und_schattera_ag" => Ok(BankhausSchelhammerUndSchatteraAg), + "bawag_psk_ag" => Ok(BawagPskAg), + "bks_bank_ag" => Ok(BksBankAg), + "brull_kallmus_bank_ag" => Ok(BrullKallmusBankAg), + "btv_vier_lander_bank" => Ok(BtvVierLanderBank), + "capital_bank_grawe_gruppe_ag" => Ok(CapitalBankGraweGruppeAg), + "deutsche_bank_ag" => Ok(DeutscheBankAg), + "dolomitenbank" => Ok(Dolomitenbank), + "easybank_ag" => Ok(EasybankAg), + "erste_bank_und_sparkassen" => Ok(ErsteBankUndSparkassen), + "hypo_alpeadriabank_international_ag" => Ok(HypoAlpeadriabankInternationalAg), + "hypo_bank_burgenland_aktiengesellschaft" => Ok(HypoBankBurgenlandAktiengesellschaft), + "hypo_noe_lb_fur_niederosterreich_u_wien" => Ok(HypoNoeLbFurNiederosterreichUWien), + "hypo_oberosterreich_salzburg_steiermark" => Ok(HypoOberosterreichSalzburgSteiermark), + "hypo_tirol_bank_ag" => Ok(HypoTirolBankAg), + "hypo_vorarlberg_bank_ag" => Ok(HypoVorarlbergBankAg), + "marchfelder_bank" => Ok(MarchfelderBank), + "oberbank_ag" => Ok(OberbankAg), + "raiffeisen_bankengruppe_osterreich" => Ok(RaiffeisenBankengruppeOsterreich), + "schoellerbank_ag" => Ok(SchoellerbankAg), + "sparda_bank_wien" => Ok(SpardaBankWien), + "volksbank_gruppe" => Ok(VolksbankGruppe), + "volkskreditbank_ag" => Ok(VolkskreditbankAg), + "vr_bank_braunau" => Ok(VrBankBraunau), + _ => Err(()), + } + } +} +impl std::fmt::Display for UpdateSetupIntentPaymentMethodDataEpsBank { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for UpdateSetupIntentPaymentMethodDataEpsBank { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for UpdateSetupIntentPaymentMethodDataEpsBank { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// If this is an `fpx` PaymentMethod, this hash contains details about the FPX payment method. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct UpdateSetupIntentPaymentMethodDataFpx { + /// Account holder type for FPX transaction + #[serde(skip_serializing_if = "Option::is_none")] + pub account_holder_type: Option, + /// The customer's bank. + pub bank: UpdateSetupIntentPaymentMethodDataFpxBank, +} +impl UpdateSetupIntentPaymentMethodDataFpx { + pub fn new(bank: UpdateSetupIntentPaymentMethodDataFpxBank) -> Self { + Self { account_holder_type: None, bank } + } +} +/// Account holder type for FPX transaction +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum UpdateSetupIntentPaymentMethodDataFpxAccountHolderType { + Company, + Individual, +} +impl UpdateSetupIntentPaymentMethodDataFpxAccountHolderType { + pub fn as_str(self) -> &'static str { + use UpdateSetupIntentPaymentMethodDataFpxAccountHolderType::*; + match self { + Company => "company", + Individual => "individual", + } + } +} + +impl std::str::FromStr for UpdateSetupIntentPaymentMethodDataFpxAccountHolderType { + type Err = (); + fn from_str(s: &str) -> Result { + use UpdateSetupIntentPaymentMethodDataFpxAccountHolderType::*; + match s { + "company" => Ok(Company), + "individual" => Ok(Individual), + _ => Err(()), + } + } +} +impl std::fmt::Display for UpdateSetupIntentPaymentMethodDataFpxAccountHolderType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for UpdateSetupIntentPaymentMethodDataFpxAccountHolderType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for UpdateSetupIntentPaymentMethodDataFpxAccountHolderType { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// The customer's bank. +#[derive(Copy, Clone, Eq, PartialEq)] +#[non_exhaustive] +pub enum UpdateSetupIntentPaymentMethodDataFpxBank { + AffinBank, + Agrobank, + AllianceBank, + Ambank, + BankIslam, + BankMuamalat, + BankOfChina, + BankRakyat, + Bsn, + Cimb, + DeutscheBank, + HongLeongBank, + Hsbc, + Kfh, + Maybank2e, + Maybank2u, + Ocbc, + PbEnterprise, + PublicBank, + Rhb, + StandardChartered, + Uob, + /// An unrecognized value from Stripe. Should not be used as a request parameter. + Unknown, +} +impl UpdateSetupIntentPaymentMethodDataFpxBank { + pub fn as_str(self) -> &'static str { + use UpdateSetupIntentPaymentMethodDataFpxBank::*; + match self { + AffinBank => "affin_bank", + Agrobank => "agrobank", + AllianceBank => "alliance_bank", + Ambank => "ambank", + BankIslam => "bank_islam", + BankMuamalat => "bank_muamalat", + BankOfChina => "bank_of_china", + BankRakyat => "bank_rakyat", + Bsn => "bsn", + Cimb => "cimb", + DeutscheBank => "deutsche_bank", + HongLeongBank => "hong_leong_bank", + Hsbc => "hsbc", + Kfh => "kfh", + Maybank2e => "maybank2e", + Maybank2u => "maybank2u", + Ocbc => "ocbc", + PbEnterprise => "pb_enterprise", + PublicBank => "public_bank", + Rhb => "rhb", + StandardChartered => "standard_chartered", + Uob => "uob", + Unknown => "unknown", + } + } +} + +impl std::str::FromStr for UpdateSetupIntentPaymentMethodDataFpxBank { + type Err = (); + fn from_str(s: &str) -> Result { + use UpdateSetupIntentPaymentMethodDataFpxBank::*; + match s { + "affin_bank" => Ok(AffinBank), + "agrobank" => Ok(Agrobank), + "alliance_bank" => Ok(AllianceBank), + "ambank" => Ok(Ambank), + "bank_islam" => Ok(BankIslam), + "bank_muamalat" => Ok(BankMuamalat), + "bank_of_china" => Ok(BankOfChina), + "bank_rakyat" => Ok(BankRakyat), + "bsn" => Ok(Bsn), + "cimb" => Ok(Cimb), + "deutsche_bank" => Ok(DeutscheBank), + "hong_leong_bank" => Ok(HongLeongBank), + "hsbc" => Ok(Hsbc), + "kfh" => Ok(Kfh), + "maybank2e" => Ok(Maybank2e), + "maybank2u" => Ok(Maybank2u), + "ocbc" => Ok(Ocbc), + "pb_enterprise" => Ok(PbEnterprise), + "public_bank" => Ok(PublicBank), + "rhb" => Ok(Rhb), + "standard_chartered" => Ok(StandardChartered), + "uob" => Ok(Uob), + _ => Err(()), + } + } +} +impl std::fmt::Display for UpdateSetupIntentPaymentMethodDataFpxBank { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for UpdateSetupIntentPaymentMethodDataFpxBank { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for UpdateSetupIntentPaymentMethodDataFpxBank { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// If this is an `ideal` PaymentMethod, this hash contains details about the iDEAL payment method. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdateSetupIntentPaymentMethodDataIdeal { + /// The customer's bank. + #[serde(skip_serializing_if = "Option::is_none")] + pub bank: Option, +} +impl UpdateSetupIntentPaymentMethodDataIdeal { + pub fn new() -> Self { + Self::default() + } +} +/// The customer's bank. +#[derive(Copy, Clone, Eq, PartialEq)] +#[non_exhaustive] +pub enum UpdateSetupIntentPaymentMethodDataIdealBank { + AbnAmro, + AsnBank, + Bunq, + Handelsbanken, + Ing, + Knab, + Moneyou, + N26, + Nn, + Rabobank, + Regiobank, + Revolut, + SnsBank, + TriodosBank, + VanLanschot, + Yoursafe, + /// An unrecognized value from Stripe. Should not be used as a request parameter. + Unknown, +} +impl UpdateSetupIntentPaymentMethodDataIdealBank { + pub fn as_str(self) -> &'static str { + use UpdateSetupIntentPaymentMethodDataIdealBank::*; + match self { + AbnAmro => "abn_amro", + AsnBank => "asn_bank", + Bunq => "bunq", + Handelsbanken => "handelsbanken", + Ing => "ing", + Knab => "knab", + Moneyou => "moneyou", + N26 => "n26", + Nn => "nn", + Rabobank => "rabobank", + Regiobank => "regiobank", + Revolut => "revolut", + SnsBank => "sns_bank", + TriodosBank => "triodos_bank", + VanLanschot => "van_lanschot", + Yoursafe => "yoursafe", + Unknown => "unknown", + } + } +} + +impl std::str::FromStr for UpdateSetupIntentPaymentMethodDataIdealBank { + type Err = (); + fn from_str(s: &str) -> Result { + use UpdateSetupIntentPaymentMethodDataIdealBank::*; + match s { + "abn_amro" => Ok(AbnAmro), + "asn_bank" => Ok(AsnBank), + "bunq" => Ok(Bunq), + "handelsbanken" => Ok(Handelsbanken), + "ing" => Ok(Ing), + "knab" => Ok(Knab), + "moneyou" => Ok(Moneyou), + "n26" => Ok(N26), + "nn" => Ok(Nn), + "rabobank" => Ok(Rabobank), + "regiobank" => Ok(Regiobank), + "revolut" => Ok(Revolut), + "sns_bank" => Ok(SnsBank), + "triodos_bank" => Ok(TriodosBank), + "van_lanschot" => Ok(VanLanschot), + "yoursafe" => Ok(Yoursafe), + _ => Err(()), + } + } +} +impl std::fmt::Display for UpdateSetupIntentPaymentMethodDataIdealBank { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for UpdateSetupIntentPaymentMethodDataIdealBank { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for UpdateSetupIntentPaymentMethodDataIdealBank { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// If this is a `klarna` PaymentMethod, this hash contains details about the Klarna payment method. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdateSetupIntentPaymentMethodDataKlarna { + /// Customer's date of birth + #[serde(skip_serializing_if = "Option::is_none")] + pub dob: Option, +} +impl UpdateSetupIntentPaymentMethodDataKlarna { + pub fn new() -> Self { + Self::default() + } +} +/// If this is a `p24` PaymentMethod, this hash contains details about the P24 payment method. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdateSetupIntentPaymentMethodDataP24 { + /// The customer's bank. + #[serde(skip_serializing_if = "Option::is_none")] + pub bank: Option, +} +impl UpdateSetupIntentPaymentMethodDataP24 { + pub fn new() -> Self { + Self::default() + } +} +/// The customer's bank. +#[derive(Copy, Clone, Eq, PartialEq)] +#[non_exhaustive] +pub enum UpdateSetupIntentPaymentMethodDataP24Bank { + AliorBank, + BankMillennium, + BankNowyBfgSa, + BankPekaoSa, + BankiSpbdzielcze, + Blik, + BnpParibas, + Boz, + CitiHandlowy, + CreditAgricole, + Envelobank, + EtransferPocztowy24, + GetinBank, + Ideabank, + Ing, + Inteligo, + MbankMtransfer, + NestPrzelew, + NoblePay, + PbacZIpko, + PlusBank, + SantanderPrzelew24, + TmobileUsbugiBankowe, + ToyotaBank, + Velobank, + VolkswagenBank, + /// An unrecognized value from Stripe. Should not be used as a request parameter. + Unknown, +} +impl UpdateSetupIntentPaymentMethodDataP24Bank { + pub fn as_str(self) -> &'static str { + use UpdateSetupIntentPaymentMethodDataP24Bank::*; + match self { + AliorBank => "alior_bank", + BankMillennium => "bank_millennium", + BankNowyBfgSa => "bank_nowy_bfg_sa", + BankPekaoSa => "bank_pekao_sa", + BankiSpbdzielcze => "banki_spbdzielcze", + Blik => "blik", + BnpParibas => "bnp_paribas", + Boz => "boz", + CitiHandlowy => "citi_handlowy", + CreditAgricole => "credit_agricole", + Envelobank => "envelobank", + EtransferPocztowy24 => "etransfer_pocztowy24", + GetinBank => "getin_bank", + Ideabank => "ideabank", + Ing => "ing", + Inteligo => "inteligo", + MbankMtransfer => "mbank_mtransfer", + NestPrzelew => "nest_przelew", + NoblePay => "noble_pay", + PbacZIpko => "pbac_z_ipko", + PlusBank => "plus_bank", + SantanderPrzelew24 => "santander_przelew24", + TmobileUsbugiBankowe => "tmobile_usbugi_bankowe", + ToyotaBank => "toyota_bank", + Velobank => "velobank", + VolkswagenBank => "volkswagen_bank", + Unknown => "unknown", + } + } +} + +impl std::str::FromStr for UpdateSetupIntentPaymentMethodDataP24Bank { + type Err = (); + fn from_str(s: &str) -> Result { + use UpdateSetupIntentPaymentMethodDataP24Bank::*; + match s { + "alior_bank" => Ok(AliorBank), + "bank_millennium" => Ok(BankMillennium), + "bank_nowy_bfg_sa" => Ok(BankNowyBfgSa), + "bank_pekao_sa" => Ok(BankPekaoSa), + "banki_spbdzielcze" => Ok(BankiSpbdzielcze), + "blik" => Ok(Blik), + "bnp_paribas" => Ok(BnpParibas), + "boz" => Ok(Boz), + "citi_handlowy" => Ok(CitiHandlowy), + "credit_agricole" => Ok(CreditAgricole), + "envelobank" => Ok(Envelobank), + "etransfer_pocztowy24" => Ok(EtransferPocztowy24), + "getin_bank" => Ok(GetinBank), + "ideabank" => Ok(Ideabank), + "ing" => Ok(Ing), + "inteligo" => Ok(Inteligo), + "mbank_mtransfer" => Ok(MbankMtransfer), + "nest_przelew" => Ok(NestPrzelew), + "noble_pay" => Ok(NoblePay), + "pbac_z_ipko" => Ok(PbacZIpko), + "plus_bank" => Ok(PlusBank), + "santander_przelew24" => Ok(SantanderPrzelew24), + "tmobile_usbugi_bankowe" => Ok(TmobileUsbugiBankowe), + "toyota_bank" => Ok(ToyotaBank), + "velobank" => Ok(Velobank), + "volkswagen_bank" => Ok(VolkswagenBank), + _ => Err(()), + } + } +} +impl std::fmt::Display for UpdateSetupIntentPaymentMethodDataP24Bank { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for UpdateSetupIntentPaymentMethodDataP24Bank { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for UpdateSetupIntentPaymentMethodDataP24Bank { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// If this is a `sepa_debit` PaymentMethod, this hash contains details about the SEPA debit bank account. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct UpdateSetupIntentPaymentMethodDataSepaDebit<'a> { + /// IBAN of the bank account. + pub iban: &'a str, +} +impl<'a> UpdateSetupIntentPaymentMethodDataSepaDebit<'a> { + pub fn new(iban: &'a str) -> Self { + Self { iban } + } +} +/// If this is a `sofort` PaymentMethod, this hash contains details about the SOFORT payment method. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct UpdateSetupIntentPaymentMethodDataSofort { + /// Two-letter ISO code representing the country the bank account is located in. + pub country: UpdateSetupIntentPaymentMethodDataSofortCountry, +} +impl UpdateSetupIntentPaymentMethodDataSofort { + pub fn new(country: UpdateSetupIntentPaymentMethodDataSofortCountry) -> Self { + Self { country } + } +} +/// Two-letter ISO code representing the country the bank account is located in. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum UpdateSetupIntentPaymentMethodDataSofortCountry { + At, + Be, + De, + Es, + It, + Nl, +} +impl UpdateSetupIntentPaymentMethodDataSofortCountry { + pub fn as_str(self) -> &'static str { + use UpdateSetupIntentPaymentMethodDataSofortCountry::*; + match self { + At => "AT", + Be => "BE", + De => "DE", + Es => "ES", + It => "IT", + Nl => "NL", + } + } +} + +impl std::str::FromStr for UpdateSetupIntentPaymentMethodDataSofortCountry { + type Err = (); + fn from_str(s: &str) -> Result { + use UpdateSetupIntentPaymentMethodDataSofortCountry::*; + match s { + "AT" => Ok(At), + "BE" => Ok(Be), + "DE" => Ok(De), + "ES" => Ok(Es), + "IT" => Ok(It), + "NL" => Ok(Nl), + _ => Err(()), + } + } +} +impl std::fmt::Display for UpdateSetupIntentPaymentMethodDataSofortCountry { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for UpdateSetupIntentPaymentMethodDataSofortCountry { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for UpdateSetupIntentPaymentMethodDataSofortCountry { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// The type of the PaymentMethod. +/// An additional hash is included on the PaymentMethod with a name matching this value. +/// It contains additional information specific to the PaymentMethod type. +#[derive(Copy, Clone, Eq, PartialEq)] +#[non_exhaustive] +pub enum UpdateSetupIntentPaymentMethodDataType { + AcssDebit, + Affirm, + AfterpayClearpay, + Alipay, + AuBecsDebit, + BacsDebit, + Bancontact, + Blik, + Boleto, + Cashapp, + CustomerBalance, + Eps, + Fpx, + Giropay, + Grabpay, + Ideal, + Klarna, + Konbini, + Link, + Oxxo, + P24, + Paynow, + Paypal, + Pix, + Promptpay, + RevolutPay, + SepaDebit, + Sofort, + Swish, + UsBankAccount, + WechatPay, + Zip, + /// An unrecognized value from Stripe. Should not be used as a request parameter. + Unknown, +} +impl UpdateSetupIntentPaymentMethodDataType { + pub fn as_str(self) -> &'static str { + use UpdateSetupIntentPaymentMethodDataType::*; + match self { + AcssDebit => "acss_debit", + Affirm => "affirm", + AfterpayClearpay => "afterpay_clearpay", + Alipay => "alipay", + AuBecsDebit => "au_becs_debit", + BacsDebit => "bacs_debit", + Bancontact => "bancontact", + Blik => "blik", + Boleto => "boleto", + Cashapp => "cashapp", + CustomerBalance => "customer_balance", + Eps => "eps", + Fpx => "fpx", + Giropay => "giropay", + Grabpay => "grabpay", + Ideal => "ideal", + Klarna => "klarna", + Konbini => "konbini", + Link => "link", + Oxxo => "oxxo", + P24 => "p24", + Paynow => "paynow", + Paypal => "paypal", + Pix => "pix", + Promptpay => "promptpay", + RevolutPay => "revolut_pay", + SepaDebit => "sepa_debit", + Sofort => "sofort", + Swish => "swish", + UsBankAccount => "us_bank_account", + WechatPay => "wechat_pay", + Zip => "zip", + Unknown => "unknown", + } + } +} + +impl std::str::FromStr for UpdateSetupIntentPaymentMethodDataType { + type Err = (); + fn from_str(s: &str) -> Result { + use UpdateSetupIntentPaymentMethodDataType::*; + match s { + "acss_debit" => Ok(AcssDebit), + "affirm" => Ok(Affirm), + "afterpay_clearpay" => Ok(AfterpayClearpay), + "alipay" => Ok(Alipay), + "au_becs_debit" => Ok(AuBecsDebit), + "bacs_debit" => Ok(BacsDebit), + "bancontact" => Ok(Bancontact), + "blik" => Ok(Blik), + "boleto" => Ok(Boleto), + "cashapp" => Ok(Cashapp), + "customer_balance" => Ok(CustomerBalance), + "eps" => Ok(Eps), + "fpx" => Ok(Fpx), + "giropay" => Ok(Giropay), + "grabpay" => Ok(Grabpay), + "ideal" => Ok(Ideal), + "klarna" => Ok(Klarna), + "konbini" => Ok(Konbini), + "link" => Ok(Link), + "oxxo" => Ok(Oxxo), + "p24" => Ok(P24), + "paynow" => Ok(Paynow), + "paypal" => Ok(Paypal), + "pix" => Ok(Pix), + "promptpay" => Ok(Promptpay), + "revolut_pay" => Ok(RevolutPay), + "sepa_debit" => Ok(SepaDebit), + "sofort" => Ok(Sofort), + "swish" => Ok(Swish), + "us_bank_account" => Ok(UsBankAccount), + "wechat_pay" => Ok(WechatPay), + "zip" => Ok(Zip), + _ => Err(()), + } + } +} +impl std::fmt::Display for UpdateSetupIntentPaymentMethodDataType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for UpdateSetupIntentPaymentMethodDataType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for UpdateSetupIntentPaymentMethodDataType { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// If this is an `us_bank_account` PaymentMethod, this hash contains details about the US bank account payment method. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdateSetupIntentPaymentMethodDataUsBankAccount<'a> { + /// Account holder type: individual or company. + #[serde(skip_serializing_if = "Option::is_none")] + pub account_holder_type: + Option, + /// Account number of the bank account. + #[serde(skip_serializing_if = "Option::is_none")] + pub account_number: Option<&'a str>, + /// Account type: checkings or savings. Defaults to checking if omitted. + #[serde(skip_serializing_if = "Option::is_none")] + pub account_type: Option, + /// The ID of a Financial Connections Account to use as a payment method. + #[serde(skip_serializing_if = "Option::is_none")] + pub financial_connections_account: Option<&'a str>, + /// Routing number of the bank account. + #[serde(skip_serializing_if = "Option::is_none")] + pub routing_number: Option<&'a str>, +} +impl<'a> UpdateSetupIntentPaymentMethodDataUsBankAccount<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// Account holder type: individual or company. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum UpdateSetupIntentPaymentMethodDataUsBankAccountAccountHolderType { + Company, + Individual, +} +impl UpdateSetupIntentPaymentMethodDataUsBankAccountAccountHolderType { + pub fn as_str(self) -> &'static str { + use UpdateSetupIntentPaymentMethodDataUsBankAccountAccountHolderType::*; + match self { + Company => "company", + Individual => "individual", + } + } +} + +impl std::str::FromStr for UpdateSetupIntentPaymentMethodDataUsBankAccountAccountHolderType { + type Err = (); + fn from_str(s: &str) -> Result { + use UpdateSetupIntentPaymentMethodDataUsBankAccountAccountHolderType::*; + match s { + "company" => Ok(Company), + "individual" => Ok(Individual), + _ => Err(()), + } + } +} +impl std::fmt::Display for UpdateSetupIntentPaymentMethodDataUsBankAccountAccountHolderType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for UpdateSetupIntentPaymentMethodDataUsBankAccountAccountHolderType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for UpdateSetupIntentPaymentMethodDataUsBankAccountAccountHolderType { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Account type: checkings or savings. Defaults to checking if omitted. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum UpdateSetupIntentPaymentMethodDataUsBankAccountAccountType { + Checking, + Savings, +} +impl UpdateSetupIntentPaymentMethodDataUsBankAccountAccountType { + pub fn as_str(self) -> &'static str { + use UpdateSetupIntentPaymentMethodDataUsBankAccountAccountType::*; + match self { + Checking => "checking", + Savings => "savings", + } + } +} + +impl std::str::FromStr for UpdateSetupIntentPaymentMethodDataUsBankAccountAccountType { + type Err = (); + fn from_str(s: &str) -> Result { + use UpdateSetupIntentPaymentMethodDataUsBankAccountAccountType::*; + match s { + "checking" => Ok(Checking), + "savings" => Ok(Savings), + _ => Err(()), + } + } +} +impl std::fmt::Display for UpdateSetupIntentPaymentMethodDataUsBankAccountAccountType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for UpdateSetupIntentPaymentMethodDataUsBankAccountAccountType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for UpdateSetupIntentPaymentMethodDataUsBankAccountAccountType { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Payment method-specific configuration for this SetupIntent. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdateSetupIntentPaymentMethodOptions<'a> { + /// If this is a `acss_debit` SetupIntent, this sub-hash contains details about the ACSS Debit payment method options. + #[serde(skip_serializing_if = "Option::is_none")] + pub acss_debit: Option>, + /// Configuration for any card setup attempted on this SetupIntent. + #[serde(skip_serializing_if = "Option::is_none")] + pub card: Option>, + /// If this is a `link` PaymentMethod, this sub-hash contains details about the Link payment method options. + #[serde(skip_serializing_if = "Option::is_none")] + pub link: Option>, + /// If this is a `paypal` PaymentMethod, this sub-hash contains details about the PayPal payment method options. + #[serde(skip_serializing_if = "Option::is_none")] + pub paypal: Option>, + /// If this is a `sepa_debit` SetupIntent, this sub-hash contains details about the SEPA Debit payment method options. + #[serde(skip_serializing_if = "Option::is_none")] + pub sepa_debit: Option>, + /// If this is a `us_bank_account` SetupIntent, this sub-hash contains details about the US bank account payment method options. + #[serde(skip_serializing_if = "Option::is_none")] + pub us_bank_account: Option>, +} +impl<'a> UpdateSetupIntentPaymentMethodOptions<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// If this is a `acss_debit` SetupIntent, this sub-hash contains details about the ACSS Debit payment method options. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdateSetupIntentPaymentMethodOptionsAcssDebit<'a> { + /// Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. + /// Must be a [supported currency](https://stripe.com/docs/currencies). + #[serde(skip_serializing_if = "Option::is_none")] + pub currency: Option, + /// Additional fields for Mandate creation + #[serde(skip_serializing_if = "Option::is_none")] + pub mandate_options: Option>, + /// Bank account verification method. + #[serde(skip_serializing_if = "Option::is_none")] + pub verification_method: + Option, +} +impl<'a> UpdateSetupIntentPaymentMethodOptionsAcssDebit<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. +/// Must be a [supported currency](https://stripe.com/docs/currencies). +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum UpdateSetupIntentPaymentMethodOptionsAcssDebitCurrency { + Cad, + Usd, +} +impl UpdateSetupIntentPaymentMethodOptionsAcssDebitCurrency { + pub fn as_str(self) -> &'static str { + use UpdateSetupIntentPaymentMethodOptionsAcssDebitCurrency::*; + match self { + Cad => "cad", + Usd => "usd", + } + } +} + +impl std::str::FromStr for UpdateSetupIntentPaymentMethodOptionsAcssDebitCurrency { + type Err = (); + fn from_str(s: &str) -> Result { + use UpdateSetupIntentPaymentMethodOptionsAcssDebitCurrency::*; + match s { + "cad" => Ok(Cad), + "usd" => Ok(Usd), + _ => Err(()), + } + } +} +impl std::fmt::Display for UpdateSetupIntentPaymentMethodOptionsAcssDebitCurrency { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for UpdateSetupIntentPaymentMethodOptionsAcssDebitCurrency { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for UpdateSetupIntentPaymentMethodOptionsAcssDebitCurrency { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Additional fields for Mandate creation +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdateSetupIntentPaymentMethodOptionsAcssDebitMandateOptions<'a> { + /// A URL for custom mandate text to render during confirmation step. + /// The URL will be rendered with additional GET parameters `payment_intent` and `payment_intent_client_secret` when confirming a Payment Intent,. + /// or `setup_intent` and `setup_intent_client_secret` when confirming a Setup Intent. + #[serde(skip_serializing_if = "Option::is_none")] + pub custom_mandate_url: Option<&'a str>, + /// List of Stripe products where this mandate can be selected automatically. + #[serde(skip_serializing_if = "Option::is_none")] + pub default_for: + Option<&'a [UpdateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsDefaultFor]>, + /// Description of the mandate interval. + /// Only required if 'payment_schedule' parameter is 'interval' or 'combined'. + #[serde(skip_serializing_if = "Option::is_none")] + pub interval_description: Option<&'a str>, + /// Payment schedule for the mandate. + #[serde(skip_serializing_if = "Option::is_none")] + pub payment_schedule: + Option, + /// Transaction type of the mandate. + #[serde(skip_serializing_if = "Option::is_none")] + pub transaction_type: + Option, +} +impl<'a> UpdateSetupIntentPaymentMethodOptionsAcssDebitMandateOptions<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// List of Stripe products where this mandate can be selected automatically. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum UpdateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsDefaultFor { + Invoice, + Subscription, +} +impl UpdateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsDefaultFor { + pub fn as_str(self) -> &'static str { + use UpdateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsDefaultFor::*; + match self { + Invoice => "invoice", + Subscription => "subscription", + } + } +} + +impl std::str::FromStr for UpdateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsDefaultFor { + type Err = (); + fn from_str(s: &str) -> Result { + use UpdateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsDefaultFor::*; + match s { + "invoice" => Ok(Invoice), + "subscription" => Ok(Subscription), + _ => Err(()), + } + } +} +impl std::fmt::Display for UpdateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsDefaultFor { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for UpdateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsDefaultFor { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for UpdateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsDefaultFor { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Payment schedule for the mandate. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum UpdateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsPaymentSchedule { + Combined, + Interval, + Sporadic, +} +impl UpdateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsPaymentSchedule { + pub fn as_str(self) -> &'static str { + use UpdateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsPaymentSchedule::*; + match self { + Combined => "combined", + Interval => "interval", + Sporadic => "sporadic", + } + } +} + +impl std::str::FromStr + for UpdateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsPaymentSchedule +{ + type Err = (); + fn from_str(s: &str) -> Result { + use UpdateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsPaymentSchedule::*; + match s { + "combined" => Ok(Combined), + "interval" => Ok(Interval), + "sporadic" => Ok(Sporadic), + _ => Err(()), + } + } +} +impl std::fmt::Display + for UpdateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsPaymentSchedule +{ + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug + for UpdateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsPaymentSchedule +{ + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize + for UpdateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsPaymentSchedule +{ + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Transaction type of the mandate. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum UpdateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsTransactionType { + Business, + Personal, +} +impl UpdateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsTransactionType { + pub fn as_str(self) -> &'static str { + use UpdateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsTransactionType::*; + match self { + Business => "business", + Personal => "personal", + } + } +} + +impl std::str::FromStr + for UpdateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsTransactionType +{ + type Err = (); + fn from_str(s: &str) -> Result { + use UpdateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsTransactionType::*; + match s { + "business" => Ok(Business), + "personal" => Ok(Personal), + _ => Err(()), + } + } +} +impl std::fmt::Display + for UpdateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsTransactionType +{ + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug + for UpdateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsTransactionType +{ + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize + for UpdateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsTransactionType +{ + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Bank account verification method. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum UpdateSetupIntentPaymentMethodOptionsAcssDebitVerificationMethod { + Automatic, + Instant, + Microdeposits, +} +impl UpdateSetupIntentPaymentMethodOptionsAcssDebitVerificationMethod { + pub fn as_str(self) -> &'static str { + use UpdateSetupIntentPaymentMethodOptionsAcssDebitVerificationMethod::*; + match self { + Automatic => "automatic", + Instant => "instant", + Microdeposits => "microdeposits", + } + } +} + +impl std::str::FromStr for UpdateSetupIntentPaymentMethodOptionsAcssDebitVerificationMethod { + type Err = (); + fn from_str(s: &str) -> Result { + use UpdateSetupIntentPaymentMethodOptionsAcssDebitVerificationMethod::*; + match s { + "automatic" => Ok(Automatic), + "instant" => Ok(Instant), + "microdeposits" => Ok(Microdeposits), + _ => Err(()), + } + } +} +impl std::fmt::Display for UpdateSetupIntentPaymentMethodOptionsAcssDebitVerificationMethod { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for UpdateSetupIntentPaymentMethodOptionsAcssDebitVerificationMethod { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for UpdateSetupIntentPaymentMethodOptionsAcssDebitVerificationMethod { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Configuration for any card setup attempted on this SetupIntent. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdateSetupIntentPaymentMethodOptionsCard<'a> { + /// Configuration options for setting up an eMandate for cards issued in India. + #[serde(skip_serializing_if = "Option::is_none")] + pub mandate_options: Option>, + /// When specified, this parameter signals that a card has been collected + /// as MOTO (Mail Order Telephone Order) and thus out of scope for SCA. This + /// parameter can only be provided during confirmation. + #[serde(skip_serializing_if = "Option::is_none")] + pub moto: Option, + /// Selected network to process this SetupIntent on. + /// Depends on the available networks of the card attached to the SetupIntent. + /// Can be only set confirm-time. + #[serde(skip_serializing_if = "Option::is_none")] + pub network: Option, + /// We strongly recommend that you rely on our SCA Engine to automatically prompt your customers for authentication based on risk level and [other requirements](https://stripe.com/docs/strong-customer-authentication). + /// However, if you wish to request 3D Secure based on logic from your own fraud engine, provide this option. + /// If not provided, this value defaults to `automatic`. + /// Read our guide on [manually requesting 3D Secure](https://stripe.com/docs/payments/3d-secure#manual-three-ds) for more information on how this configuration interacts with Radar and our SCA Engine. + #[serde(skip_serializing_if = "Option::is_none")] + pub request_three_d_secure: + Option, + /// If 3D Secure authentication was performed with a third-party provider, + /// the authentication details to use for this setup. + #[serde(skip_serializing_if = "Option::is_none")] + pub three_d_secure: Option>, +} +impl<'a> UpdateSetupIntentPaymentMethodOptionsCard<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// Configuration options for setting up an eMandate for cards issued in India. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct UpdateSetupIntentPaymentMethodOptionsCardMandateOptions<'a> { + /// Amount to be charged for future payments. + pub amount: i64, + /// One of `fixed` or `maximum`. + /// If `fixed`, the `amount` param refers to the exact amount to be charged in future payments. + /// If `maximum`, the amount charged can be up to the value passed for the `amount` param. + pub amount_type: UpdateSetupIntentPaymentMethodOptionsCardMandateOptionsAmountType, + /// Currency in which future payments will be charged. + /// Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. + /// Must be a [supported currency](https://stripe.com/docs/currencies). + pub currency: stripe_types::Currency, + /// A description of the mandate or subscription that is meant to be displayed to the customer. + #[serde(skip_serializing_if = "Option::is_none")] + pub description: Option<&'a str>, + /// End date of the mandate or subscription. + /// If not provided, the mandate will be active until canceled. + /// If provided, end date should be after start date. + #[serde(skip_serializing_if = "Option::is_none")] + pub end_date: Option, + /// Specifies payment frequency. One of `day`, `week`, `month`, `year`, or `sporadic`. + pub interval: UpdateSetupIntentPaymentMethodOptionsCardMandateOptionsInterval, + /// The number of intervals between payments. + /// For example, `interval=month` and `interval_count=3` indicates one payment every three months. + /// Maximum of one year interval allowed (1 year, 12 months, or 52 weeks). + /// This parameter is optional when `interval=sporadic`. + #[serde(skip_serializing_if = "Option::is_none")] + pub interval_count: Option, + /// Unique identifier for the mandate or subscription. + pub reference: &'a str, + /// Start date of the mandate or subscription. Start date should not be lesser than yesterday. + pub start_date: stripe_types::Timestamp, + /// Specifies the type of mandates supported. Possible values are `india`. + #[serde(skip_serializing_if = "Option::is_none")] + pub supported_types: + Option<&'a [UpdateSetupIntentPaymentMethodOptionsCardMandateOptionsSupportedTypes]>, +} +impl<'a> UpdateSetupIntentPaymentMethodOptionsCardMandateOptions<'a> { + pub fn new( + amount: i64, + amount_type: UpdateSetupIntentPaymentMethodOptionsCardMandateOptionsAmountType, + currency: stripe_types::Currency, + interval: UpdateSetupIntentPaymentMethodOptionsCardMandateOptionsInterval, + reference: &'a str, + start_date: stripe_types::Timestamp, + ) -> Self { + Self { + amount, + amount_type, + currency, + description: None, + end_date: None, + interval, + interval_count: None, + reference, + start_date, + supported_types: None, + } + } +} +/// One of `fixed` or `maximum`. +/// If `fixed`, the `amount` param refers to the exact amount to be charged in future payments. +/// If `maximum`, the amount charged can be up to the value passed for the `amount` param. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum UpdateSetupIntentPaymentMethodOptionsCardMandateOptionsAmountType { + Fixed, + Maximum, +} +impl UpdateSetupIntentPaymentMethodOptionsCardMandateOptionsAmountType { + pub fn as_str(self) -> &'static str { + use UpdateSetupIntentPaymentMethodOptionsCardMandateOptionsAmountType::*; + match self { + Fixed => "fixed", + Maximum => "maximum", + } + } +} + +impl std::str::FromStr for UpdateSetupIntentPaymentMethodOptionsCardMandateOptionsAmountType { + type Err = (); + fn from_str(s: &str) -> Result { + use UpdateSetupIntentPaymentMethodOptionsCardMandateOptionsAmountType::*; + match s { + "fixed" => Ok(Fixed), + "maximum" => Ok(Maximum), + _ => Err(()), + } + } +} +impl std::fmt::Display for UpdateSetupIntentPaymentMethodOptionsCardMandateOptionsAmountType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for UpdateSetupIntentPaymentMethodOptionsCardMandateOptionsAmountType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for UpdateSetupIntentPaymentMethodOptionsCardMandateOptionsAmountType { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Specifies payment frequency. One of `day`, `week`, `month`, `year`, or `sporadic`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum UpdateSetupIntentPaymentMethodOptionsCardMandateOptionsInterval { + Day, + Month, + Sporadic, + Week, + Year, +} +impl UpdateSetupIntentPaymentMethodOptionsCardMandateOptionsInterval { + pub fn as_str(self) -> &'static str { + use UpdateSetupIntentPaymentMethodOptionsCardMandateOptionsInterval::*; + match self { + Day => "day", + Month => "month", + Sporadic => "sporadic", + Week => "week", + Year => "year", + } + } +} + +impl std::str::FromStr for UpdateSetupIntentPaymentMethodOptionsCardMandateOptionsInterval { + type Err = (); + fn from_str(s: &str) -> Result { + use UpdateSetupIntentPaymentMethodOptionsCardMandateOptionsInterval::*; + match s { + "day" => Ok(Day), + "month" => Ok(Month), + "sporadic" => Ok(Sporadic), + "week" => Ok(Week), + "year" => Ok(Year), + _ => Err(()), + } + } +} +impl std::fmt::Display for UpdateSetupIntentPaymentMethodOptionsCardMandateOptionsInterval { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for UpdateSetupIntentPaymentMethodOptionsCardMandateOptionsInterval { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for UpdateSetupIntentPaymentMethodOptionsCardMandateOptionsInterval { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Specifies the type of mandates supported. Possible values are `india`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum UpdateSetupIntentPaymentMethodOptionsCardMandateOptionsSupportedTypes { + India, +} +impl UpdateSetupIntentPaymentMethodOptionsCardMandateOptionsSupportedTypes { + pub fn as_str(self) -> &'static str { + use UpdateSetupIntentPaymentMethodOptionsCardMandateOptionsSupportedTypes::*; + match self { + India => "india", + } + } +} + +impl std::str::FromStr for UpdateSetupIntentPaymentMethodOptionsCardMandateOptionsSupportedTypes { + type Err = (); + fn from_str(s: &str) -> Result { + use UpdateSetupIntentPaymentMethodOptionsCardMandateOptionsSupportedTypes::*; + match s { + "india" => Ok(India), + _ => Err(()), + } + } +} +impl std::fmt::Display for UpdateSetupIntentPaymentMethodOptionsCardMandateOptionsSupportedTypes { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for UpdateSetupIntentPaymentMethodOptionsCardMandateOptionsSupportedTypes { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for UpdateSetupIntentPaymentMethodOptionsCardMandateOptionsSupportedTypes { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Selected network to process this SetupIntent on. +/// Depends on the available networks of the card attached to the SetupIntent. +/// Can be only set confirm-time. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum UpdateSetupIntentPaymentMethodOptionsCardNetwork { + Amex, + CartesBancaires, + Diners, + Discover, + EftposAu, + Interac, + Jcb, + Mastercard, + Unionpay, + Unknown, + Visa, +} +impl UpdateSetupIntentPaymentMethodOptionsCardNetwork { + pub fn as_str(self) -> &'static str { + use UpdateSetupIntentPaymentMethodOptionsCardNetwork::*; + match self { + Amex => "amex", + CartesBancaires => "cartes_bancaires", + Diners => "diners", + Discover => "discover", + EftposAu => "eftpos_au", + Interac => "interac", + Jcb => "jcb", + Mastercard => "mastercard", + Unionpay => "unionpay", + Unknown => "unknown", + Visa => "visa", + } + } +} + +impl std::str::FromStr for UpdateSetupIntentPaymentMethodOptionsCardNetwork { + type Err = (); + fn from_str(s: &str) -> Result { + use UpdateSetupIntentPaymentMethodOptionsCardNetwork::*; + match s { + "amex" => Ok(Amex), + "cartes_bancaires" => Ok(CartesBancaires), + "diners" => Ok(Diners), + "discover" => Ok(Discover), + "eftpos_au" => Ok(EftposAu), + "interac" => Ok(Interac), + "jcb" => Ok(Jcb), + "mastercard" => Ok(Mastercard), + "unionpay" => Ok(Unionpay), + "unknown" => Ok(Unknown), + "visa" => Ok(Visa), + _ => Err(()), + } + } +} +impl std::fmt::Display for UpdateSetupIntentPaymentMethodOptionsCardNetwork { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for UpdateSetupIntentPaymentMethodOptionsCardNetwork { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for UpdateSetupIntentPaymentMethodOptionsCardNetwork { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// We strongly recommend that you rely on our SCA Engine to automatically prompt your customers for authentication based on risk level and [other requirements](https://stripe.com/docs/strong-customer-authentication). +/// However, if you wish to request 3D Secure based on logic from your own fraud engine, provide this option. +/// If not provided, this value defaults to `automatic`. +/// Read our guide on [manually requesting 3D Secure](https://stripe.com/docs/payments/3d-secure#manual-three-ds) for more information on how this configuration interacts with Radar and our SCA Engine. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum UpdateSetupIntentPaymentMethodOptionsCardRequestThreeDSecure { + Any, + Automatic, + Challenge, +} +impl UpdateSetupIntentPaymentMethodOptionsCardRequestThreeDSecure { + pub fn as_str(self) -> &'static str { + use UpdateSetupIntentPaymentMethodOptionsCardRequestThreeDSecure::*; + match self { + Any => "any", + Automatic => "automatic", + Challenge => "challenge", + } + } +} + +impl std::str::FromStr for UpdateSetupIntentPaymentMethodOptionsCardRequestThreeDSecure { + type Err = (); + fn from_str(s: &str) -> Result { + use UpdateSetupIntentPaymentMethodOptionsCardRequestThreeDSecure::*; + match s { + "any" => Ok(Any), + "automatic" => Ok(Automatic), + "challenge" => Ok(Challenge), + _ => Err(()), + } + } +} +impl std::fmt::Display for UpdateSetupIntentPaymentMethodOptionsCardRequestThreeDSecure { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for UpdateSetupIntentPaymentMethodOptionsCardRequestThreeDSecure { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for UpdateSetupIntentPaymentMethodOptionsCardRequestThreeDSecure { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// If 3D Secure authentication was performed with a third-party provider, +/// the authentication details to use for this setup. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdateSetupIntentPaymentMethodOptionsCardThreeDSecure<'a> { + /// The `transStatus` returned from the card Issuer’s ACS in the ARes. + #[serde(skip_serializing_if = "Option::is_none")] + pub ares_trans_status: + Option, + /// The cryptogram, also known as the "authentication value" (AAV, CAVV or + /// AEVV). This value is 20 bytes, base64-encoded into a 28-character string. + /// (Most 3D Secure providers will return the base64-encoded version, which + /// is what you should specify here.) + #[serde(skip_serializing_if = "Option::is_none")] + pub cryptogram: Option<&'a str>, + /// The Electronic Commerce Indicator (ECI) is returned by your 3D Secure + /// provider and indicates what degree of authentication was performed. + #[serde(skip_serializing_if = "Option::is_none")] + pub electronic_commerce_indicator: + Option, + /// Network specific 3DS fields. Network specific arguments require an + /// explicit card brand choice. The parameter `payment_method_options.card.network`` + /// must be populated accordingly + #[serde(skip_serializing_if = "Option::is_none")] + pub network_options: + Option>, + /// The challenge indicator (`threeDSRequestorChallengeInd`) which was requested in the + /// AReq sent to the card Issuer's ACS. A string containing 2 digits from 01-99. + #[serde(skip_serializing_if = "Option::is_none")] + pub requestor_challenge_indicator: Option<&'a str>, + /// For 3D Secure 1, the XID. For 3D Secure 2, the Directory Server + /// Transaction ID (dsTransID). + #[serde(skip_serializing_if = "Option::is_none")] + pub transaction_id: Option<&'a str>, + /// The version of 3D Secure that was performed. + #[serde(skip_serializing_if = "Option::is_none")] + pub version: Option, +} +impl<'a> UpdateSetupIntentPaymentMethodOptionsCardThreeDSecure<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// The `transStatus` returned from the card Issuer’s ACS in the ARes. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum UpdateSetupIntentPaymentMethodOptionsCardThreeDSecureAresTransStatus { + A, + C, + I, + N, + R, + U, + Y, +} +impl UpdateSetupIntentPaymentMethodOptionsCardThreeDSecureAresTransStatus { + pub fn as_str(self) -> &'static str { + use UpdateSetupIntentPaymentMethodOptionsCardThreeDSecureAresTransStatus::*; + match self { + A => "A", + C => "C", + I => "I", + N => "N", + R => "R", + U => "U", + Y => "Y", + } + } +} + +impl std::str::FromStr for UpdateSetupIntentPaymentMethodOptionsCardThreeDSecureAresTransStatus { + type Err = (); + fn from_str(s: &str) -> Result { + use UpdateSetupIntentPaymentMethodOptionsCardThreeDSecureAresTransStatus::*; + match s { + "A" => Ok(A), + "C" => Ok(C), + "I" => Ok(I), + "N" => Ok(N), + "R" => Ok(R), + "U" => Ok(U), + "Y" => Ok(Y), + _ => Err(()), + } + } +} +impl std::fmt::Display for UpdateSetupIntentPaymentMethodOptionsCardThreeDSecureAresTransStatus { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for UpdateSetupIntentPaymentMethodOptionsCardThreeDSecureAresTransStatus { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for UpdateSetupIntentPaymentMethodOptionsCardThreeDSecureAresTransStatus { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// The Electronic Commerce Indicator (ECI) is returned by your 3D Secure +/// provider and indicates what degree of authentication was performed. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum UpdateSetupIntentPaymentMethodOptionsCardThreeDSecureElectronicCommerceIndicator { + V01, + V02, + V05, + V06, + V07, +} +impl UpdateSetupIntentPaymentMethodOptionsCardThreeDSecureElectronicCommerceIndicator { + pub fn as_str(self) -> &'static str { + use UpdateSetupIntentPaymentMethodOptionsCardThreeDSecureElectronicCommerceIndicator::*; + match self { + V01 => "01", + V02 => "02", + V05 => "05", + V06 => "06", + V07 => "07", + } + } +} + +impl std::str::FromStr + for UpdateSetupIntentPaymentMethodOptionsCardThreeDSecureElectronicCommerceIndicator +{ + type Err = (); + fn from_str(s: &str) -> Result { + use UpdateSetupIntentPaymentMethodOptionsCardThreeDSecureElectronicCommerceIndicator::*; + match s { + "01" => Ok(V01), + "02" => Ok(V02), + "05" => Ok(V05), + "06" => Ok(V06), + "07" => Ok(V07), + _ => Err(()), + } + } +} +impl std::fmt::Display + for UpdateSetupIntentPaymentMethodOptionsCardThreeDSecureElectronicCommerceIndicator +{ + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug + for UpdateSetupIntentPaymentMethodOptionsCardThreeDSecureElectronicCommerceIndicator +{ + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize + for UpdateSetupIntentPaymentMethodOptionsCardThreeDSecureElectronicCommerceIndicator +{ + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Network specific 3DS fields. Network specific arguments require an +/// explicit card brand choice. The parameter `payment_method_options.card.network`` +/// must be populated accordingly +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdateSetupIntentPaymentMethodOptionsCardThreeDSecureNetworkOptions<'a> { + /// Cartes Bancaires-specific 3DS fields. + #[serde(skip_serializing_if = "Option::is_none")] + pub cartes_bancaires: Option< + UpdateSetupIntentPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancaires<'a>, + >, +} +impl<'a> UpdateSetupIntentPaymentMethodOptionsCardThreeDSecureNetworkOptions<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// Cartes Bancaires-specific 3DS fields. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct UpdateSetupIntentPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancaires<'a> { + /// The cryptogram calculation algorithm used by the card Issuer's ACS + /// to calculate the Authentication cryptogram. Also known as `cavvAlgorithm`. + /// messageExtension: CB-AVALGO + pub cb_avalgo: + UpdateSetupIntentPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancairesCbAvalgo, + /// The exemption indicator returned from Cartes Bancaires in the ARes. + /// message extension: CB-EXEMPTION; string (4 characters) + /// This is a 3 byte bitmap (low significant byte first and most significant + /// bit first) that has been Base64 encoded + #[serde(skip_serializing_if = "Option::is_none")] + pub cb_exemption: Option<&'a str>, + /// The risk score returned from Cartes Bancaires in the ARes. + /// message extension: CB-SCORE; numeric value 0-99 + #[serde(skip_serializing_if = "Option::is_none")] + pub cb_score: Option, +} +impl<'a> UpdateSetupIntentPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancaires<'a> { + pub fn new( + cb_avalgo: UpdateSetupIntentPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancairesCbAvalgo, + ) -> Self { + Self { cb_avalgo, cb_exemption: None, cb_score: None } + } +} +/// The cryptogram calculation algorithm used by the card Issuer's ACS +/// to calculate the Authentication cryptogram. Also known as `cavvAlgorithm`. +/// messageExtension: CB-AVALGO +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum UpdateSetupIntentPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancairesCbAvalgo +{ + V0, + V1, + V2, + V3, + V4, + A, +} +impl UpdateSetupIntentPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancairesCbAvalgo { + pub fn as_str(self) -> &'static str { + use UpdateSetupIntentPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancairesCbAvalgo::*; + match self { + V0 => "0", + V1 => "1", + V2 => "2", + V3 => "3", + V4 => "4", + A => "A", + } + } +} + +impl std::str::FromStr + for UpdateSetupIntentPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancairesCbAvalgo +{ + type Err = (); + fn from_str(s: &str) -> Result { + use UpdateSetupIntentPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancairesCbAvalgo::*; + match s { + "0" => Ok(V0), + "1" => Ok(V1), + "2" => Ok(V2), + "3" => Ok(V3), + "4" => Ok(V4), + "A" => Ok(A), + _ => Err(()), + } + } +} +impl std::fmt::Display + for UpdateSetupIntentPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancairesCbAvalgo +{ + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug + for UpdateSetupIntentPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancairesCbAvalgo +{ + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize + for UpdateSetupIntentPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancairesCbAvalgo +{ + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// The version of 3D Secure that was performed. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum UpdateSetupIntentPaymentMethodOptionsCardThreeDSecureVersion { + V1_0_2, + V2_1_0, + V2_2_0, +} +impl UpdateSetupIntentPaymentMethodOptionsCardThreeDSecureVersion { + pub fn as_str(self) -> &'static str { + use UpdateSetupIntentPaymentMethodOptionsCardThreeDSecureVersion::*; + match self { + V1_0_2 => "1.0.2", + V2_1_0 => "2.1.0", + V2_2_0 => "2.2.0", + } + } +} + +impl std::str::FromStr for UpdateSetupIntentPaymentMethodOptionsCardThreeDSecureVersion { + type Err = (); + fn from_str(s: &str) -> Result { + use UpdateSetupIntentPaymentMethodOptionsCardThreeDSecureVersion::*; + match s { + "1.0.2" => Ok(V1_0_2), + "2.1.0" => Ok(V2_1_0), + "2.2.0" => Ok(V2_2_0), + _ => Err(()), + } + } +} +impl std::fmt::Display for UpdateSetupIntentPaymentMethodOptionsCardThreeDSecureVersion { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for UpdateSetupIntentPaymentMethodOptionsCardThreeDSecureVersion { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for UpdateSetupIntentPaymentMethodOptionsCardThreeDSecureVersion { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// If this is a `sepa_debit` SetupIntent, this sub-hash contains details about the SEPA Debit payment method options. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdateSetupIntentPaymentMethodOptionsSepaDebit<'a> { + /// Additional fields for Mandate creation + #[serde(skip_serializing_if = "Option::is_none")] + pub mandate_options: Option<&'a serde_json::Value>, +} +impl<'a> UpdateSetupIntentPaymentMethodOptionsSepaDebit<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// If this is a `us_bank_account` SetupIntent, this sub-hash contains details about the US bank account payment method options. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdateSetupIntentPaymentMethodOptionsUsBankAccount<'a> { + /// Additional fields for Financial Connections Session creation + #[serde(skip_serializing_if = "Option::is_none")] + pub financial_connections: + Option>, + /// Additional fields for Mandate creation + #[serde(skip_serializing_if = "Option::is_none")] + pub mandate_options: Option, + /// Additional fields for network related functions + #[serde(skip_serializing_if = "Option::is_none")] + pub networks: Option>, + /// Bank account verification method. + #[serde(skip_serializing_if = "Option::is_none")] + pub verification_method: + Option, +} +impl<'a> UpdateSetupIntentPaymentMethodOptionsUsBankAccount<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// Additional fields for Financial Connections Session creation +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnections<'a> { + /// The list of permissions to request. + /// If this parameter is passed, the `payment_method` permission must be included. + /// Valid permissions include: `balances`, `ownership`, `payment_method`, and `transactions`. + #[serde(skip_serializing_if = "Option::is_none")] + pub permissions: Option< + &'a [UpdateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions], + >, + /// List of data features that you would like to retrieve upon account creation. + #[serde(skip_serializing_if = "Option::is_none")] + pub prefetch: Option< + &'a [UpdateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch], + >, + /// For webview integrations only. + /// Upon completing OAuth login in the native browser, the user will be redirected to this URL to return to your app. + #[serde(skip_serializing_if = "Option::is_none")] + pub return_url: Option<&'a str>, +} +impl<'a> UpdateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnections<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// The list of permissions to request. +/// If this parameter is passed, the `payment_method` permission must be included. +/// Valid permissions include: `balances`, `ownership`, `payment_method`, and `transactions`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum UpdateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions { + Balances, + Ownership, + PaymentMethod, + Transactions, +} +impl UpdateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions { + pub fn as_str(self) -> &'static str { + use UpdateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions::*; + match self { + Balances => "balances", + Ownership => "ownership", + PaymentMethod => "payment_method", + Transactions => "transactions", + } + } +} + +impl std::str::FromStr + for UpdateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions +{ + type Err = (); + fn from_str(s: &str) -> Result { + use UpdateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions::*; + match s { + "balances" => Ok(Balances), + "ownership" => Ok(Ownership), + "payment_method" => Ok(PaymentMethod), + "transactions" => Ok(Transactions), + _ => Err(()), + } + } +} +impl std::fmt::Display + for UpdateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions +{ + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug + for UpdateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions +{ + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize + for UpdateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions +{ + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// List of data features that you would like to retrieve upon account creation. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum UpdateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch { + Balances, + Transactions, +} +impl UpdateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch { + pub fn as_str(self) -> &'static str { + use UpdateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch::*; + match self { + Balances => "balances", + Transactions => "transactions", + } + } +} + +impl std::str::FromStr + for UpdateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch +{ + type Err = (); + fn from_str(s: &str) -> Result { + use UpdateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch::*; + match s { + "balances" => Ok(Balances), + "transactions" => Ok(Transactions), + _ => Err(()), + } + } +} +impl std::fmt::Display + for UpdateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch +{ + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug + for UpdateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch +{ + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize + for UpdateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch +{ + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Additional fields for Mandate creation +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdateSetupIntentPaymentMethodOptionsUsBankAccountMandateOptions { + /// The method used to collect offline mandate customer acceptance. + #[serde(skip_serializing_if = "Option::is_none")] + pub collection_method: + Option, +} +impl UpdateSetupIntentPaymentMethodOptionsUsBankAccountMandateOptions { + pub fn new() -> Self { + Self::default() + } +} +/// The method used to collect offline mandate customer acceptance. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum UpdateSetupIntentPaymentMethodOptionsUsBankAccountMandateOptionsCollectionMethod { + Paper, +} +impl UpdateSetupIntentPaymentMethodOptionsUsBankAccountMandateOptionsCollectionMethod { + pub fn as_str(self) -> &'static str { + use UpdateSetupIntentPaymentMethodOptionsUsBankAccountMandateOptionsCollectionMethod::*; + match self { + Paper => "paper", + } + } +} + +impl std::str::FromStr + for UpdateSetupIntentPaymentMethodOptionsUsBankAccountMandateOptionsCollectionMethod +{ + type Err = (); + fn from_str(s: &str) -> Result { + use UpdateSetupIntentPaymentMethodOptionsUsBankAccountMandateOptionsCollectionMethod::*; + match s { + "paper" => Ok(Paper), + _ => Err(()), + } + } +} +impl std::fmt::Display + for UpdateSetupIntentPaymentMethodOptionsUsBankAccountMandateOptionsCollectionMethod +{ + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug + for UpdateSetupIntentPaymentMethodOptionsUsBankAccountMandateOptionsCollectionMethod +{ + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize + for UpdateSetupIntentPaymentMethodOptionsUsBankAccountMandateOptionsCollectionMethod +{ + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Additional fields for network related functions +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdateSetupIntentPaymentMethodOptionsUsBankAccountNetworks<'a> { + /// Triggers validations to run across the selected networks + #[serde(skip_serializing_if = "Option::is_none")] + pub requested: + Option<&'a [UpdateSetupIntentPaymentMethodOptionsUsBankAccountNetworksRequested]>, +} +impl<'a> UpdateSetupIntentPaymentMethodOptionsUsBankAccountNetworks<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// Triggers validations to run across the selected networks +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum UpdateSetupIntentPaymentMethodOptionsUsBankAccountNetworksRequested { + Ach, + UsDomesticWire, +} +impl UpdateSetupIntentPaymentMethodOptionsUsBankAccountNetworksRequested { + pub fn as_str(self) -> &'static str { + use UpdateSetupIntentPaymentMethodOptionsUsBankAccountNetworksRequested::*; + match self { + Ach => "ach", + UsDomesticWire => "us_domestic_wire", + } + } +} + +impl std::str::FromStr for UpdateSetupIntentPaymentMethodOptionsUsBankAccountNetworksRequested { + type Err = (); + fn from_str(s: &str) -> Result { + use UpdateSetupIntentPaymentMethodOptionsUsBankAccountNetworksRequested::*; + match s { + "ach" => Ok(Ach), + "us_domestic_wire" => Ok(UsDomesticWire), + _ => Err(()), + } + } +} +impl std::fmt::Display for UpdateSetupIntentPaymentMethodOptionsUsBankAccountNetworksRequested { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for UpdateSetupIntentPaymentMethodOptionsUsBankAccountNetworksRequested { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for UpdateSetupIntentPaymentMethodOptionsUsBankAccountNetworksRequested { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Bank account verification method. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum UpdateSetupIntentPaymentMethodOptionsUsBankAccountVerificationMethod { + Automatic, + Instant, + Microdeposits, +} +impl UpdateSetupIntentPaymentMethodOptionsUsBankAccountVerificationMethod { + pub fn as_str(self) -> &'static str { + use UpdateSetupIntentPaymentMethodOptionsUsBankAccountVerificationMethod::*; + match self { + Automatic => "automatic", + Instant => "instant", + Microdeposits => "microdeposits", + } + } +} + +impl std::str::FromStr for UpdateSetupIntentPaymentMethodOptionsUsBankAccountVerificationMethod { + type Err = (); + fn from_str(s: &str) -> Result { + use UpdateSetupIntentPaymentMethodOptionsUsBankAccountVerificationMethod::*; + match s { + "automatic" => Ok(Automatic), + "instant" => Ok(Instant), + "microdeposits" => Ok(Microdeposits), + _ => Err(()), + } + } +} +impl std::fmt::Display for UpdateSetupIntentPaymentMethodOptionsUsBankAccountVerificationMethod { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for UpdateSetupIntentPaymentMethodOptionsUsBankAccountVerificationMethod { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for UpdateSetupIntentPaymentMethodOptionsUsBankAccountVerificationMethod { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'a> UpdateSetupIntent<'a> { + /// Updates a SetupIntent object. + pub fn send( + &self, + client: &stripe::Client, + intent: &stripe_shared::SetupIntentId, + ) -> stripe::Response { + client.send_form(&format!("/setup_intents/{intent}"), self, http_types::Method::Post) + } +} +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CancelSetupIntent<'a> { + /// Reason for canceling this SetupIntent. + /// Possible values are: `abandoned`, `requested_by_customer`, or `duplicate`. + #[serde(skip_serializing_if = "Option::is_none")] + pub cancellation_reason: Option, + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, +} +impl<'a> CancelSetupIntent<'a> { + pub fn new() -> Self { + Self::default() + } +} +impl<'a> CancelSetupIntent<'a> { + /// You can cancel a SetupIntent object when it’s in one of these statuses: `requires_payment_method`, `requires_confirmation`, or `requires_action`. + /// + /// + /// After you cancel it, setup is abandoned and any operations on the SetupIntent fail with an error. + pub fn send( + &self, + client: &stripe::Client, + intent: &stripe_shared::SetupIntentId, + ) -> stripe::Response { + client.send_form(&format!("/setup_intents/{intent}/cancel"), self, http_types::Method::Post) + } +} +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct ConfirmSetupIntent<'a> { + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, + #[serde(skip_serializing_if = "Option::is_none")] + pub mandate_data: Option>, + /// ID of the payment method (a PaymentMethod, Card, or saved Source object) to attach to this SetupIntent. + #[serde(skip_serializing_if = "Option::is_none")] + pub payment_method: Option<&'a str>, + /// When included, this hash creates a PaymentMethod that is set as the [`payment_method`](https://stripe.com/docs/api/setup_intents/object#setup_intent_object-payment_method). + /// value in the SetupIntent. + #[serde(skip_serializing_if = "Option::is_none")] + pub payment_method_data: Option>, + /// Payment method-specific configuration for this SetupIntent. + #[serde(skip_serializing_if = "Option::is_none")] + pub payment_method_options: Option>, + /// The URL to redirect your customer back to after they authenticate on the payment method's app or site. + /// If you'd prefer to redirect to a mobile application, you can alternatively supply an application URI scheme. + /// This parameter is only used for cards and other redirect-based payment methods. + #[serde(skip_serializing_if = "Option::is_none")] + pub return_url: Option<&'a str>, + /// Set to `true` when confirming server-side and using Stripe.js, iOS, or Android client-side SDKs to handle the next actions. + #[serde(skip_serializing_if = "Option::is_none")] + pub use_stripe_sdk: Option, +} +impl<'a> ConfirmSetupIntent<'a> { + pub fn new() -> Self { + Self::default() + } +} +#[derive(Copy, Clone, Debug, serde::Serialize)] +#[serde(untagged)] +pub enum ConfirmSetupIntentMandateData<'a> { + SecretKeyParam(ConfirmSetupIntentSecretKeyParam<'a>), + ClientKeyParam(ConfirmSetupIntentClientKeyParam<'a>), +} +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct ConfirmSetupIntentSecretKeyParam<'a> { + /// This hash contains details about the customer acceptance of the Mandate. + pub customer_acceptance: ConfirmSetupIntentSecretKeyParamCustomerAcceptance<'a>, +} +impl<'a> ConfirmSetupIntentSecretKeyParam<'a> { + pub fn new( + customer_acceptance: ConfirmSetupIntentSecretKeyParamCustomerAcceptance<'a>, + ) -> Self { + Self { customer_acceptance } + } +} +/// This hash contains details about the customer acceptance of the Mandate. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct ConfirmSetupIntentSecretKeyParamCustomerAcceptance<'a> { + /// The time at which the customer accepted the Mandate. + #[serde(skip_serializing_if = "Option::is_none")] + pub accepted_at: Option, + /// If this is a Mandate accepted offline, this hash contains details about the offline acceptance. + #[serde(skip_serializing_if = "Option::is_none")] + pub offline: Option<&'a serde_json::Value>, + /// If this is a Mandate accepted online, this hash contains details about the online acceptance. + #[serde(skip_serializing_if = "Option::is_none")] + pub online: Option>, + /// The type of customer acceptance information included with the Mandate. + /// One of `online` or `offline`. + #[serde(rename = "type")] + pub type_: ConfirmSetupIntentSecretKeyParamCustomerAcceptanceType, +} +impl<'a> ConfirmSetupIntentSecretKeyParamCustomerAcceptance<'a> { + pub fn new(type_: ConfirmSetupIntentSecretKeyParamCustomerAcceptanceType) -> Self { + Self { accepted_at: None, offline: None, online: None, type_ } + } +} +/// The type of customer acceptance information included with the Mandate. +/// One of `online` or `offline`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum ConfirmSetupIntentSecretKeyParamCustomerAcceptanceType { + Offline, + Online, +} +impl ConfirmSetupIntentSecretKeyParamCustomerAcceptanceType { + pub fn as_str(self) -> &'static str { + use ConfirmSetupIntentSecretKeyParamCustomerAcceptanceType::*; + match self { + Offline => "offline", + Online => "online", + } + } +} + +impl std::str::FromStr for ConfirmSetupIntentSecretKeyParamCustomerAcceptanceType { + type Err = (); + fn from_str(s: &str) -> Result { + use ConfirmSetupIntentSecretKeyParamCustomerAcceptanceType::*; + match s { + "offline" => Ok(Offline), + "online" => Ok(Online), + _ => Err(()), + } + } +} +impl std::fmt::Display for ConfirmSetupIntentSecretKeyParamCustomerAcceptanceType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for ConfirmSetupIntentSecretKeyParamCustomerAcceptanceType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for ConfirmSetupIntentSecretKeyParamCustomerAcceptanceType { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct ConfirmSetupIntentClientKeyParam<'a> { + /// This hash contains details about the customer acceptance of the Mandate. + pub customer_acceptance: ConfirmSetupIntentClientKeyParamCustomerAcceptance<'a>, +} +impl<'a> ConfirmSetupIntentClientKeyParam<'a> { + pub fn new( + customer_acceptance: ConfirmSetupIntentClientKeyParamCustomerAcceptance<'a>, + ) -> Self { + Self { customer_acceptance } + } +} +/// This hash contains details about the customer acceptance of the Mandate. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct ConfirmSetupIntentClientKeyParamCustomerAcceptance<'a> { + /// If this is a Mandate accepted online, this hash contains details about the online acceptance. + pub online: ConfirmSetupIntentClientKeyParamCustomerAcceptanceOnline<'a>, + /// The type of customer acceptance information included with the Mandate. + #[serde(rename = "type")] + pub type_: ConfirmSetupIntentClientKeyParamCustomerAcceptanceType, +} +impl<'a> ConfirmSetupIntentClientKeyParamCustomerAcceptance<'a> { + pub fn new( + online: ConfirmSetupIntentClientKeyParamCustomerAcceptanceOnline<'a>, + type_: ConfirmSetupIntentClientKeyParamCustomerAcceptanceType, + ) -> Self { + Self { online, type_ } + } +} +/// If this is a Mandate accepted online, this hash contains details about the online acceptance. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct ConfirmSetupIntentClientKeyParamCustomerAcceptanceOnline<'a> { + /// The IP address from which the Mandate was accepted by the customer. + #[serde(skip_serializing_if = "Option::is_none")] + pub ip_address: Option<&'a str>, + /// The user agent of the browser from which the Mandate was accepted by the customer. + #[serde(skip_serializing_if = "Option::is_none")] + pub user_agent: Option<&'a str>, +} +impl<'a> ConfirmSetupIntentClientKeyParamCustomerAcceptanceOnline<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// The type of customer acceptance information included with the Mandate. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum ConfirmSetupIntentClientKeyParamCustomerAcceptanceType { + Online, +} +impl ConfirmSetupIntentClientKeyParamCustomerAcceptanceType { + pub fn as_str(self) -> &'static str { + use ConfirmSetupIntentClientKeyParamCustomerAcceptanceType::*; + match self { + Online => "online", + } + } +} + +impl std::str::FromStr for ConfirmSetupIntentClientKeyParamCustomerAcceptanceType { + type Err = (); + fn from_str(s: &str) -> Result { + use ConfirmSetupIntentClientKeyParamCustomerAcceptanceType::*; + match s { + "online" => Ok(Online), + _ => Err(()), + } + } +} +impl std::fmt::Display for ConfirmSetupIntentClientKeyParamCustomerAcceptanceType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for ConfirmSetupIntentClientKeyParamCustomerAcceptanceType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for ConfirmSetupIntentClientKeyParamCustomerAcceptanceType { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// When included, this hash creates a PaymentMethod that is set as the [`payment_method`](https://stripe.com/docs/api/setup_intents/object#setup_intent_object-payment_method). +/// value in the SetupIntent. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct ConfirmSetupIntentPaymentMethodData<'a> { + /// If this is an `acss_debit` PaymentMethod, this hash contains details about the ACSS Debit payment method. + #[serde(skip_serializing_if = "Option::is_none")] + pub acss_debit: Option>, + /// If this is an `affirm` PaymentMethod, this hash contains details about the Affirm payment method. + #[serde(skip_serializing_if = "Option::is_none")] + pub affirm: Option<&'a serde_json::Value>, + /// If this is an `AfterpayClearpay` PaymentMethod, this hash contains details about the AfterpayClearpay payment method. + #[serde(skip_serializing_if = "Option::is_none")] + pub afterpay_clearpay: Option<&'a serde_json::Value>, + /// If this is an `Alipay` PaymentMethod, this hash contains details about the Alipay payment method. + #[serde(skip_serializing_if = "Option::is_none")] + pub alipay: Option<&'a serde_json::Value>, + /// If this is an `au_becs_debit` PaymentMethod, this hash contains details about the bank account. + #[serde(skip_serializing_if = "Option::is_none")] + pub au_becs_debit: Option>, + /// If this is a `bacs_debit` PaymentMethod, this hash contains details about the Bacs Direct Debit bank account. + #[serde(skip_serializing_if = "Option::is_none")] + pub bacs_debit: Option>, + /// If this is a `bancontact` PaymentMethod, this hash contains details about the Bancontact payment method. + #[serde(skip_serializing_if = "Option::is_none")] + pub bancontact: Option<&'a serde_json::Value>, + /// Billing information associated with the PaymentMethod that may be used or required by particular types of payment methods. + #[serde(skip_serializing_if = "Option::is_none")] + pub billing_details: Option>, + /// If this is a `blik` PaymentMethod, this hash contains details about the BLIK payment method. + #[serde(skip_serializing_if = "Option::is_none")] + pub blik: Option<&'a serde_json::Value>, + /// If this is a `boleto` PaymentMethod, this hash contains details about the Boleto payment method. + #[serde(skip_serializing_if = "Option::is_none")] + pub boleto: Option>, + /// If this is a `cashapp` PaymentMethod, this hash contains details about the Cash App Pay payment method. + #[serde(skip_serializing_if = "Option::is_none")] + pub cashapp: Option<&'a serde_json::Value>, + /// If this is a `customer_balance` PaymentMethod, this hash contains details about the CustomerBalance payment method. + #[serde(skip_serializing_if = "Option::is_none")] + pub customer_balance: Option<&'a serde_json::Value>, + /// If this is an `eps` PaymentMethod, this hash contains details about the EPS payment method. + #[serde(skip_serializing_if = "Option::is_none")] + pub eps: Option, + /// If this is an `fpx` PaymentMethod, this hash contains details about the FPX payment method. + #[serde(skip_serializing_if = "Option::is_none")] + pub fpx: Option, + /// If this is a `giropay` PaymentMethod, this hash contains details about the Giropay payment method. + #[serde(skip_serializing_if = "Option::is_none")] + pub giropay: Option<&'a serde_json::Value>, + /// If this is a `grabpay` PaymentMethod, this hash contains details about the GrabPay payment method. + #[serde(skip_serializing_if = "Option::is_none")] + pub grabpay: Option<&'a serde_json::Value>, + /// If this is an `ideal` PaymentMethod, this hash contains details about the iDEAL payment method. + #[serde(skip_serializing_if = "Option::is_none")] + pub ideal: Option, + /// If this is an `interac_present` PaymentMethod, this hash contains details about the Interac Present payment method. + #[serde(skip_serializing_if = "Option::is_none")] + pub interac_present: Option<&'a serde_json::Value>, + /// If this is a `klarna` PaymentMethod, this hash contains details about the Klarna payment method. + #[serde(skip_serializing_if = "Option::is_none")] + pub klarna: Option, + /// If this is a `konbini` PaymentMethod, this hash contains details about the Konbini payment method. + #[serde(skip_serializing_if = "Option::is_none")] + pub konbini: Option<&'a serde_json::Value>, + /// If this is an `Link` PaymentMethod, this hash contains details about the Link payment method. + #[serde(skip_serializing_if = "Option::is_none")] + pub link: Option<&'a serde_json::Value>, + /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. + /// This can be useful for storing additional information about the object in a structured format. + /// Individual keys can be unset by posting an empty value to them. + /// All keys can be unset by posting an empty value to `metadata`. + #[serde(skip_serializing_if = "Option::is_none")] + pub metadata: Option<&'a std::collections::HashMap>, + /// If this is an `oxxo` PaymentMethod, this hash contains details about the OXXO payment method. + #[serde(skip_serializing_if = "Option::is_none")] + pub oxxo: Option<&'a serde_json::Value>, + /// If this is a `p24` PaymentMethod, this hash contains details about the P24 payment method. + #[serde(skip_serializing_if = "Option::is_none")] + pub p24: Option, + /// If this is a `paynow` PaymentMethod, this hash contains details about the PayNow payment method. + #[serde(skip_serializing_if = "Option::is_none")] + pub paynow: Option<&'a serde_json::Value>, + /// If this is a `paypal` PaymentMethod, this hash contains details about the PayPal payment method. + #[serde(skip_serializing_if = "Option::is_none")] + pub paypal: Option<&'a serde_json::Value>, + /// If this is a `pix` PaymentMethod, this hash contains details about the Pix payment method. + #[serde(skip_serializing_if = "Option::is_none")] + pub pix: Option<&'a serde_json::Value>, + /// If this is a `promptpay` PaymentMethod, this hash contains details about the PromptPay payment method. + #[serde(skip_serializing_if = "Option::is_none")] + pub promptpay: Option<&'a serde_json::Value>, + /// Options to configure Radar. + /// See [Radar Session](https://stripe.com/docs/radar/radar-session) for more information. + #[serde(skip_serializing_if = "Option::is_none")] + pub radar_options: Option>, + /// If this is a `Revolut Pay` PaymentMethod, this hash contains details about the Revolut Pay payment method. + #[serde(skip_serializing_if = "Option::is_none")] + pub revolut_pay: Option<&'a serde_json::Value>, + /// If this is a `sepa_debit` PaymentMethod, this hash contains details about the SEPA debit bank account. + #[serde(skip_serializing_if = "Option::is_none")] + pub sepa_debit: Option>, + /// If this is a `sofort` PaymentMethod, this hash contains details about the SOFORT payment method. + #[serde(skip_serializing_if = "Option::is_none")] + pub sofort: Option, + /// If this is a `swish` PaymentMethod, this hash contains details about the Swish payment method. + #[serde(skip_serializing_if = "Option::is_none")] + pub swish: Option<&'a serde_json::Value>, + /// The type of the PaymentMethod. + /// An additional hash is included on the PaymentMethod with a name matching this value. + /// It contains additional information specific to the PaymentMethod type. + #[serde(rename = "type")] + pub type_: ConfirmSetupIntentPaymentMethodDataType, + /// If this is an `us_bank_account` PaymentMethod, this hash contains details about the US bank account payment method. + #[serde(skip_serializing_if = "Option::is_none")] + pub us_bank_account: Option>, + /// If this is an `wechat_pay` PaymentMethod, this hash contains details about the wechat_pay payment method. + #[serde(skip_serializing_if = "Option::is_none")] + pub wechat_pay: Option<&'a serde_json::Value>, + /// If this is a `zip` PaymentMethod, this hash contains details about the Zip payment method. + #[serde(skip_serializing_if = "Option::is_none")] + pub zip: Option<&'a serde_json::Value>, +} +impl<'a> ConfirmSetupIntentPaymentMethodData<'a> { + pub fn new(type_: ConfirmSetupIntentPaymentMethodDataType) -> Self { + Self { + acss_debit: None, + affirm: None, + afterpay_clearpay: None, + alipay: None, + au_becs_debit: None, + bacs_debit: None, + bancontact: None, + billing_details: None, + blik: None, + boleto: None, + cashapp: None, + customer_balance: None, + eps: None, + fpx: None, + giropay: None, + grabpay: None, + ideal: None, + interac_present: None, + klarna: None, + konbini: None, + link: None, + metadata: None, + oxxo: None, + p24: None, + paynow: None, + paypal: None, + pix: None, + promptpay: None, + radar_options: None, + revolut_pay: None, + sepa_debit: None, + sofort: None, + swish: None, + type_, + us_bank_account: None, + wechat_pay: None, + zip: None, + } + } +} +/// If this is an `au_becs_debit` PaymentMethod, this hash contains details about the bank account. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct ConfirmSetupIntentPaymentMethodDataAuBecsDebit<'a> { + /// The account number for the bank account. + pub account_number: &'a str, + /// Bank-State-Branch number of the bank account. + pub bsb_number: &'a str, +} +impl<'a> ConfirmSetupIntentPaymentMethodDataAuBecsDebit<'a> { + pub fn new(account_number: &'a str, bsb_number: &'a str) -> Self { + Self { account_number, bsb_number } + } +} +/// If this is a `bacs_debit` PaymentMethod, this hash contains details about the Bacs Direct Debit bank account. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct ConfirmSetupIntentPaymentMethodDataBacsDebit<'a> { + /// Account number of the bank account that the funds will be debited from. + #[serde(skip_serializing_if = "Option::is_none")] + pub account_number: Option<&'a str>, + /// Sort code of the bank account. (e.g., `10-20-30`) + #[serde(skip_serializing_if = "Option::is_none")] + pub sort_code: Option<&'a str>, +} +impl<'a> ConfirmSetupIntentPaymentMethodDataBacsDebit<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// If this is a `boleto` PaymentMethod, this hash contains details about the Boleto payment method. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct ConfirmSetupIntentPaymentMethodDataBoleto<'a> { + /// The tax ID of the customer (CPF for individual consumers or CNPJ for businesses consumers) + pub tax_id: &'a str, +} +impl<'a> ConfirmSetupIntentPaymentMethodDataBoleto<'a> { + pub fn new(tax_id: &'a str) -> Self { + Self { tax_id } + } +} +/// If this is an `eps` PaymentMethod, this hash contains details about the EPS payment method. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct ConfirmSetupIntentPaymentMethodDataEps { + /// The customer's bank. + #[serde(skip_serializing_if = "Option::is_none")] + pub bank: Option, +} +impl ConfirmSetupIntentPaymentMethodDataEps { + pub fn new() -> Self { + Self::default() + } +} +/// The customer's bank. +#[derive(Copy, Clone, Eq, PartialEq)] +#[non_exhaustive] +pub enum ConfirmSetupIntentPaymentMethodDataEpsBank { + ArzteUndApothekerBank, + AustrianAnadiBankAg, + BankAustria, + BankhausCarlSpangler, + BankhausSchelhammerUndSchatteraAg, + BawagPskAg, + BksBankAg, + BrullKallmusBankAg, + BtvVierLanderBank, + CapitalBankGraweGruppeAg, + DeutscheBankAg, + Dolomitenbank, + EasybankAg, + ErsteBankUndSparkassen, + HypoAlpeadriabankInternationalAg, + HypoBankBurgenlandAktiengesellschaft, + HypoNoeLbFurNiederosterreichUWien, + HypoOberosterreichSalzburgSteiermark, + HypoTirolBankAg, + HypoVorarlbergBankAg, + MarchfelderBank, + OberbankAg, + RaiffeisenBankengruppeOsterreich, + SchoellerbankAg, + SpardaBankWien, + VolksbankGruppe, + VolkskreditbankAg, + VrBankBraunau, + /// An unrecognized value from Stripe. Should not be used as a request parameter. + Unknown, +} +impl ConfirmSetupIntentPaymentMethodDataEpsBank { + pub fn as_str(self) -> &'static str { + use ConfirmSetupIntentPaymentMethodDataEpsBank::*; + match self { + ArzteUndApothekerBank => "arzte_und_apotheker_bank", + AustrianAnadiBankAg => "austrian_anadi_bank_ag", + BankAustria => "bank_austria", + BankhausCarlSpangler => "bankhaus_carl_spangler", + BankhausSchelhammerUndSchatteraAg => "bankhaus_schelhammer_und_schattera_ag", + BawagPskAg => "bawag_psk_ag", + BksBankAg => "bks_bank_ag", + BrullKallmusBankAg => "brull_kallmus_bank_ag", + BtvVierLanderBank => "btv_vier_lander_bank", + CapitalBankGraweGruppeAg => "capital_bank_grawe_gruppe_ag", + DeutscheBankAg => "deutsche_bank_ag", + Dolomitenbank => "dolomitenbank", + EasybankAg => "easybank_ag", + ErsteBankUndSparkassen => "erste_bank_und_sparkassen", + HypoAlpeadriabankInternationalAg => "hypo_alpeadriabank_international_ag", + HypoBankBurgenlandAktiengesellschaft => "hypo_bank_burgenland_aktiengesellschaft", + HypoNoeLbFurNiederosterreichUWien => "hypo_noe_lb_fur_niederosterreich_u_wien", + HypoOberosterreichSalzburgSteiermark => "hypo_oberosterreich_salzburg_steiermark", + HypoTirolBankAg => "hypo_tirol_bank_ag", + HypoVorarlbergBankAg => "hypo_vorarlberg_bank_ag", + MarchfelderBank => "marchfelder_bank", + OberbankAg => "oberbank_ag", + RaiffeisenBankengruppeOsterreich => "raiffeisen_bankengruppe_osterreich", + SchoellerbankAg => "schoellerbank_ag", + SpardaBankWien => "sparda_bank_wien", + VolksbankGruppe => "volksbank_gruppe", + VolkskreditbankAg => "volkskreditbank_ag", + VrBankBraunau => "vr_bank_braunau", + Unknown => "unknown", + } + } +} + +impl std::str::FromStr for ConfirmSetupIntentPaymentMethodDataEpsBank { + type Err = (); + fn from_str(s: &str) -> Result { + use ConfirmSetupIntentPaymentMethodDataEpsBank::*; + match s { + "arzte_und_apotheker_bank" => Ok(ArzteUndApothekerBank), + "austrian_anadi_bank_ag" => Ok(AustrianAnadiBankAg), + "bank_austria" => Ok(BankAustria), + "bankhaus_carl_spangler" => Ok(BankhausCarlSpangler), + "bankhaus_schelhammer_und_schattera_ag" => Ok(BankhausSchelhammerUndSchatteraAg), + "bawag_psk_ag" => Ok(BawagPskAg), + "bks_bank_ag" => Ok(BksBankAg), + "brull_kallmus_bank_ag" => Ok(BrullKallmusBankAg), + "btv_vier_lander_bank" => Ok(BtvVierLanderBank), + "capital_bank_grawe_gruppe_ag" => Ok(CapitalBankGraweGruppeAg), + "deutsche_bank_ag" => Ok(DeutscheBankAg), + "dolomitenbank" => Ok(Dolomitenbank), + "easybank_ag" => Ok(EasybankAg), + "erste_bank_und_sparkassen" => Ok(ErsteBankUndSparkassen), + "hypo_alpeadriabank_international_ag" => Ok(HypoAlpeadriabankInternationalAg), + "hypo_bank_burgenland_aktiengesellschaft" => Ok(HypoBankBurgenlandAktiengesellschaft), + "hypo_noe_lb_fur_niederosterreich_u_wien" => Ok(HypoNoeLbFurNiederosterreichUWien), + "hypo_oberosterreich_salzburg_steiermark" => Ok(HypoOberosterreichSalzburgSteiermark), + "hypo_tirol_bank_ag" => Ok(HypoTirolBankAg), + "hypo_vorarlberg_bank_ag" => Ok(HypoVorarlbergBankAg), + "marchfelder_bank" => Ok(MarchfelderBank), + "oberbank_ag" => Ok(OberbankAg), + "raiffeisen_bankengruppe_osterreich" => Ok(RaiffeisenBankengruppeOsterreich), + "schoellerbank_ag" => Ok(SchoellerbankAg), + "sparda_bank_wien" => Ok(SpardaBankWien), + "volksbank_gruppe" => Ok(VolksbankGruppe), + "volkskreditbank_ag" => Ok(VolkskreditbankAg), + "vr_bank_braunau" => Ok(VrBankBraunau), + _ => Err(()), + } + } +} +impl std::fmt::Display for ConfirmSetupIntentPaymentMethodDataEpsBank { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for ConfirmSetupIntentPaymentMethodDataEpsBank { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for ConfirmSetupIntentPaymentMethodDataEpsBank { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// If this is an `fpx` PaymentMethod, this hash contains details about the FPX payment method. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct ConfirmSetupIntentPaymentMethodDataFpx { + /// Account holder type for FPX transaction + #[serde(skip_serializing_if = "Option::is_none")] + pub account_holder_type: Option, + /// The customer's bank. + pub bank: ConfirmSetupIntentPaymentMethodDataFpxBank, +} +impl ConfirmSetupIntentPaymentMethodDataFpx { + pub fn new(bank: ConfirmSetupIntentPaymentMethodDataFpxBank) -> Self { + Self { account_holder_type: None, bank } + } +} +/// Account holder type for FPX transaction +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum ConfirmSetupIntentPaymentMethodDataFpxAccountHolderType { + Company, + Individual, +} +impl ConfirmSetupIntentPaymentMethodDataFpxAccountHolderType { + pub fn as_str(self) -> &'static str { + use ConfirmSetupIntentPaymentMethodDataFpxAccountHolderType::*; + match self { + Company => "company", + Individual => "individual", + } + } +} + +impl std::str::FromStr for ConfirmSetupIntentPaymentMethodDataFpxAccountHolderType { + type Err = (); + fn from_str(s: &str) -> Result { + use ConfirmSetupIntentPaymentMethodDataFpxAccountHolderType::*; + match s { + "company" => Ok(Company), + "individual" => Ok(Individual), + _ => Err(()), + } + } +} +impl std::fmt::Display for ConfirmSetupIntentPaymentMethodDataFpxAccountHolderType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for ConfirmSetupIntentPaymentMethodDataFpxAccountHolderType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for ConfirmSetupIntentPaymentMethodDataFpxAccountHolderType { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// The customer's bank. +#[derive(Copy, Clone, Eq, PartialEq)] +#[non_exhaustive] +pub enum ConfirmSetupIntentPaymentMethodDataFpxBank { + AffinBank, + Agrobank, + AllianceBank, + Ambank, + BankIslam, + BankMuamalat, + BankOfChina, + BankRakyat, + Bsn, + Cimb, + DeutscheBank, + HongLeongBank, + Hsbc, + Kfh, + Maybank2e, + Maybank2u, + Ocbc, + PbEnterprise, + PublicBank, + Rhb, + StandardChartered, + Uob, + /// An unrecognized value from Stripe. Should not be used as a request parameter. + Unknown, +} +impl ConfirmSetupIntentPaymentMethodDataFpxBank { + pub fn as_str(self) -> &'static str { + use ConfirmSetupIntentPaymentMethodDataFpxBank::*; + match self { + AffinBank => "affin_bank", + Agrobank => "agrobank", + AllianceBank => "alliance_bank", + Ambank => "ambank", + BankIslam => "bank_islam", + BankMuamalat => "bank_muamalat", + BankOfChina => "bank_of_china", + BankRakyat => "bank_rakyat", + Bsn => "bsn", + Cimb => "cimb", + DeutscheBank => "deutsche_bank", + HongLeongBank => "hong_leong_bank", + Hsbc => "hsbc", + Kfh => "kfh", + Maybank2e => "maybank2e", + Maybank2u => "maybank2u", + Ocbc => "ocbc", + PbEnterprise => "pb_enterprise", + PublicBank => "public_bank", + Rhb => "rhb", + StandardChartered => "standard_chartered", + Uob => "uob", + Unknown => "unknown", + } + } +} + +impl std::str::FromStr for ConfirmSetupIntentPaymentMethodDataFpxBank { + type Err = (); + fn from_str(s: &str) -> Result { + use ConfirmSetupIntentPaymentMethodDataFpxBank::*; + match s { + "affin_bank" => Ok(AffinBank), + "agrobank" => Ok(Agrobank), + "alliance_bank" => Ok(AllianceBank), + "ambank" => Ok(Ambank), + "bank_islam" => Ok(BankIslam), + "bank_muamalat" => Ok(BankMuamalat), + "bank_of_china" => Ok(BankOfChina), + "bank_rakyat" => Ok(BankRakyat), + "bsn" => Ok(Bsn), + "cimb" => Ok(Cimb), + "deutsche_bank" => Ok(DeutscheBank), + "hong_leong_bank" => Ok(HongLeongBank), + "hsbc" => Ok(Hsbc), + "kfh" => Ok(Kfh), + "maybank2e" => Ok(Maybank2e), + "maybank2u" => Ok(Maybank2u), + "ocbc" => Ok(Ocbc), + "pb_enterprise" => Ok(PbEnterprise), + "public_bank" => Ok(PublicBank), + "rhb" => Ok(Rhb), + "standard_chartered" => Ok(StandardChartered), + "uob" => Ok(Uob), + _ => Err(()), + } + } +} +impl std::fmt::Display for ConfirmSetupIntentPaymentMethodDataFpxBank { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for ConfirmSetupIntentPaymentMethodDataFpxBank { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for ConfirmSetupIntentPaymentMethodDataFpxBank { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// If this is an `ideal` PaymentMethod, this hash contains details about the iDEAL payment method. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct ConfirmSetupIntentPaymentMethodDataIdeal { + /// The customer's bank. + #[serde(skip_serializing_if = "Option::is_none")] + pub bank: Option, +} +impl ConfirmSetupIntentPaymentMethodDataIdeal { + pub fn new() -> Self { + Self::default() + } +} +/// The customer's bank. +#[derive(Copy, Clone, Eq, PartialEq)] +#[non_exhaustive] +pub enum ConfirmSetupIntentPaymentMethodDataIdealBank { + AbnAmro, + AsnBank, + Bunq, + Handelsbanken, + Ing, + Knab, + Moneyou, + N26, + Nn, + Rabobank, + Regiobank, + Revolut, + SnsBank, + TriodosBank, + VanLanschot, + Yoursafe, + /// An unrecognized value from Stripe. Should not be used as a request parameter. + Unknown, +} +impl ConfirmSetupIntentPaymentMethodDataIdealBank { + pub fn as_str(self) -> &'static str { + use ConfirmSetupIntentPaymentMethodDataIdealBank::*; + match self { + AbnAmro => "abn_amro", + AsnBank => "asn_bank", + Bunq => "bunq", + Handelsbanken => "handelsbanken", + Ing => "ing", + Knab => "knab", + Moneyou => "moneyou", + N26 => "n26", + Nn => "nn", + Rabobank => "rabobank", + Regiobank => "regiobank", + Revolut => "revolut", + SnsBank => "sns_bank", + TriodosBank => "triodos_bank", + VanLanschot => "van_lanschot", + Yoursafe => "yoursafe", + Unknown => "unknown", + } + } +} + +impl std::str::FromStr for ConfirmSetupIntentPaymentMethodDataIdealBank { + type Err = (); + fn from_str(s: &str) -> Result { + use ConfirmSetupIntentPaymentMethodDataIdealBank::*; + match s { + "abn_amro" => Ok(AbnAmro), + "asn_bank" => Ok(AsnBank), + "bunq" => Ok(Bunq), + "handelsbanken" => Ok(Handelsbanken), + "ing" => Ok(Ing), + "knab" => Ok(Knab), + "moneyou" => Ok(Moneyou), + "n26" => Ok(N26), + "nn" => Ok(Nn), + "rabobank" => Ok(Rabobank), + "regiobank" => Ok(Regiobank), + "revolut" => Ok(Revolut), + "sns_bank" => Ok(SnsBank), + "triodos_bank" => Ok(TriodosBank), + "van_lanschot" => Ok(VanLanschot), + "yoursafe" => Ok(Yoursafe), + _ => Err(()), + } + } +} +impl std::fmt::Display for ConfirmSetupIntentPaymentMethodDataIdealBank { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for ConfirmSetupIntentPaymentMethodDataIdealBank { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for ConfirmSetupIntentPaymentMethodDataIdealBank { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// If this is a `klarna` PaymentMethod, this hash contains details about the Klarna payment method. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct ConfirmSetupIntentPaymentMethodDataKlarna { + /// Customer's date of birth + #[serde(skip_serializing_if = "Option::is_none")] + pub dob: Option, +} +impl ConfirmSetupIntentPaymentMethodDataKlarna { + pub fn new() -> Self { + Self::default() + } +} +/// If this is a `p24` PaymentMethod, this hash contains details about the P24 payment method. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct ConfirmSetupIntentPaymentMethodDataP24 { + /// The customer's bank. + #[serde(skip_serializing_if = "Option::is_none")] + pub bank: Option, +} +impl ConfirmSetupIntentPaymentMethodDataP24 { + pub fn new() -> Self { + Self::default() + } +} +/// The customer's bank. +#[derive(Copy, Clone, Eq, PartialEq)] +#[non_exhaustive] +pub enum ConfirmSetupIntentPaymentMethodDataP24Bank { + AliorBank, + BankMillennium, + BankNowyBfgSa, + BankPekaoSa, + BankiSpbdzielcze, + Blik, + BnpParibas, + Boz, + CitiHandlowy, + CreditAgricole, + Envelobank, + EtransferPocztowy24, + GetinBank, + Ideabank, + Ing, + Inteligo, + MbankMtransfer, + NestPrzelew, + NoblePay, + PbacZIpko, + PlusBank, + SantanderPrzelew24, + TmobileUsbugiBankowe, + ToyotaBank, + Velobank, + VolkswagenBank, + /// An unrecognized value from Stripe. Should not be used as a request parameter. + Unknown, +} +impl ConfirmSetupIntentPaymentMethodDataP24Bank { + pub fn as_str(self) -> &'static str { + use ConfirmSetupIntentPaymentMethodDataP24Bank::*; + match self { + AliorBank => "alior_bank", + BankMillennium => "bank_millennium", + BankNowyBfgSa => "bank_nowy_bfg_sa", + BankPekaoSa => "bank_pekao_sa", + BankiSpbdzielcze => "banki_spbdzielcze", + Blik => "blik", + BnpParibas => "bnp_paribas", + Boz => "boz", + CitiHandlowy => "citi_handlowy", + CreditAgricole => "credit_agricole", + Envelobank => "envelobank", + EtransferPocztowy24 => "etransfer_pocztowy24", + GetinBank => "getin_bank", + Ideabank => "ideabank", + Ing => "ing", + Inteligo => "inteligo", + MbankMtransfer => "mbank_mtransfer", + NestPrzelew => "nest_przelew", + NoblePay => "noble_pay", + PbacZIpko => "pbac_z_ipko", + PlusBank => "plus_bank", + SantanderPrzelew24 => "santander_przelew24", + TmobileUsbugiBankowe => "tmobile_usbugi_bankowe", + ToyotaBank => "toyota_bank", + Velobank => "velobank", + VolkswagenBank => "volkswagen_bank", + Unknown => "unknown", + } + } +} + +impl std::str::FromStr for ConfirmSetupIntentPaymentMethodDataP24Bank { + type Err = (); + fn from_str(s: &str) -> Result { + use ConfirmSetupIntentPaymentMethodDataP24Bank::*; + match s { + "alior_bank" => Ok(AliorBank), + "bank_millennium" => Ok(BankMillennium), + "bank_nowy_bfg_sa" => Ok(BankNowyBfgSa), + "bank_pekao_sa" => Ok(BankPekaoSa), + "banki_spbdzielcze" => Ok(BankiSpbdzielcze), + "blik" => Ok(Blik), + "bnp_paribas" => Ok(BnpParibas), + "boz" => Ok(Boz), + "citi_handlowy" => Ok(CitiHandlowy), + "credit_agricole" => Ok(CreditAgricole), + "envelobank" => Ok(Envelobank), + "etransfer_pocztowy24" => Ok(EtransferPocztowy24), + "getin_bank" => Ok(GetinBank), + "ideabank" => Ok(Ideabank), + "ing" => Ok(Ing), + "inteligo" => Ok(Inteligo), + "mbank_mtransfer" => Ok(MbankMtransfer), + "nest_przelew" => Ok(NestPrzelew), + "noble_pay" => Ok(NoblePay), + "pbac_z_ipko" => Ok(PbacZIpko), + "plus_bank" => Ok(PlusBank), + "santander_przelew24" => Ok(SantanderPrzelew24), + "tmobile_usbugi_bankowe" => Ok(TmobileUsbugiBankowe), + "toyota_bank" => Ok(ToyotaBank), + "velobank" => Ok(Velobank), + "volkswagen_bank" => Ok(VolkswagenBank), + _ => Err(()), + } + } +} +impl std::fmt::Display for ConfirmSetupIntentPaymentMethodDataP24Bank { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for ConfirmSetupIntentPaymentMethodDataP24Bank { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for ConfirmSetupIntentPaymentMethodDataP24Bank { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// If this is a `sepa_debit` PaymentMethod, this hash contains details about the SEPA debit bank account. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct ConfirmSetupIntentPaymentMethodDataSepaDebit<'a> { + /// IBAN of the bank account. + pub iban: &'a str, +} +impl<'a> ConfirmSetupIntentPaymentMethodDataSepaDebit<'a> { + pub fn new(iban: &'a str) -> Self { + Self { iban } + } +} +/// If this is a `sofort` PaymentMethod, this hash contains details about the SOFORT payment method. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct ConfirmSetupIntentPaymentMethodDataSofort { + /// Two-letter ISO code representing the country the bank account is located in. + pub country: ConfirmSetupIntentPaymentMethodDataSofortCountry, +} +impl ConfirmSetupIntentPaymentMethodDataSofort { + pub fn new(country: ConfirmSetupIntentPaymentMethodDataSofortCountry) -> Self { + Self { country } + } +} +/// Two-letter ISO code representing the country the bank account is located in. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum ConfirmSetupIntentPaymentMethodDataSofortCountry { + At, + Be, + De, + Es, + It, + Nl, +} +impl ConfirmSetupIntentPaymentMethodDataSofortCountry { + pub fn as_str(self) -> &'static str { + use ConfirmSetupIntentPaymentMethodDataSofortCountry::*; + match self { + At => "AT", + Be => "BE", + De => "DE", + Es => "ES", + It => "IT", + Nl => "NL", + } + } +} + +impl std::str::FromStr for ConfirmSetupIntentPaymentMethodDataSofortCountry { + type Err = (); + fn from_str(s: &str) -> Result { + use ConfirmSetupIntentPaymentMethodDataSofortCountry::*; + match s { + "AT" => Ok(At), + "BE" => Ok(Be), + "DE" => Ok(De), + "ES" => Ok(Es), + "IT" => Ok(It), + "NL" => Ok(Nl), + _ => Err(()), + } + } +} +impl std::fmt::Display for ConfirmSetupIntentPaymentMethodDataSofortCountry { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for ConfirmSetupIntentPaymentMethodDataSofortCountry { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for ConfirmSetupIntentPaymentMethodDataSofortCountry { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// The type of the PaymentMethod. +/// An additional hash is included on the PaymentMethod with a name matching this value. +/// It contains additional information specific to the PaymentMethod type. +#[derive(Copy, Clone, Eq, PartialEq)] +#[non_exhaustive] +pub enum ConfirmSetupIntentPaymentMethodDataType { + AcssDebit, + Affirm, + AfterpayClearpay, + Alipay, + AuBecsDebit, + BacsDebit, + Bancontact, + Blik, + Boleto, + Cashapp, + CustomerBalance, + Eps, + Fpx, + Giropay, + Grabpay, + Ideal, + Klarna, + Konbini, + Link, + Oxxo, + P24, + Paynow, + Paypal, + Pix, + Promptpay, + RevolutPay, + SepaDebit, + Sofort, + Swish, + UsBankAccount, + WechatPay, + Zip, + /// An unrecognized value from Stripe. Should not be used as a request parameter. + Unknown, +} +impl ConfirmSetupIntentPaymentMethodDataType { + pub fn as_str(self) -> &'static str { + use ConfirmSetupIntentPaymentMethodDataType::*; + match self { + AcssDebit => "acss_debit", + Affirm => "affirm", + AfterpayClearpay => "afterpay_clearpay", + Alipay => "alipay", + AuBecsDebit => "au_becs_debit", + BacsDebit => "bacs_debit", + Bancontact => "bancontact", + Blik => "blik", + Boleto => "boleto", + Cashapp => "cashapp", + CustomerBalance => "customer_balance", + Eps => "eps", + Fpx => "fpx", + Giropay => "giropay", + Grabpay => "grabpay", + Ideal => "ideal", + Klarna => "klarna", + Konbini => "konbini", + Link => "link", + Oxxo => "oxxo", + P24 => "p24", + Paynow => "paynow", + Paypal => "paypal", + Pix => "pix", + Promptpay => "promptpay", + RevolutPay => "revolut_pay", + SepaDebit => "sepa_debit", + Sofort => "sofort", + Swish => "swish", + UsBankAccount => "us_bank_account", + WechatPay => "wechat_pay", + Zip => "zip", + Unknown => "unknown", + } + } +} + +impl std::str::FromStr for ConfirmSetupIntentPaymentMethodDataType { + type Err = (); + fn from_str(s: &str) -> Result { + use ConfirmSetupIntentPaymentMethodDataType::*; + match s { + "acss_debit" => Ok(AcssDebit), + "affirm" => Ok(Affirm), + "afterpay_clearpay" => Ok(AfterpayClearpay), + "alipay" => Ok(Alipay), + "au_becs_debit" => Ok(AuBecsDebit), + "bacs_debit" => Ok(BacsDebit), + "bancontact" => Ok(Bancontact), + "blik" => Ok(Blik), + "boleto" => Ok(Boleto), + "cashapp" => Ok(Cashapp), + "customer_balance" => Ok(CustomerBalance), + "eps" => Ok(Eps), + "fpx" => Ok(Fpx), + "giropay" => Ok(Giropay), + "grabpay" => Ok(Grabpay), + "ideal" => Ok(Ideal), + "klarna" => Ok(Klarna), + "konbini" => Ok(Konbini), + "link" => Ok(Link), + "oxxo" => Ok(Oxxo), + "p24" => Ok(P24), + "paynow" => Ok(Paynow), + "paypal" => Ok(Paypal), + "pix" => Ok(Pix), + "promptpay" => Ok(Promptpay), + "revolut_pay" => Ok(RevolutPay), + "sepa_debit" => Ok(SepaDebit), + "sofort" => Ok(Sofort), + "swish" => Ok(Swish), + "us_bank_account" => Ok(UsBankAccount), + "wechat_pay" => Ok(WechatPay), + "zip" => Ok(Zip), + _ => Err(()), + } + } +} +impl std::fmt::Display for ConfirmSetupIntentPaymentMethodDataType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for ConfirmSetupIntentPaymentMethodDataType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for ConfirmSetupIntentPaymentMethodDataType { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// If this is an `us_bank_account` PaymentMethod, this hash contains details about the US bank account payment method. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct ConfirmSetupIntentPaymentMethodDataUsBankAccount<'a> { + /// Account holder type: individual or company. + #[serde(skip_serializing_if = "Option::is_none")] + pub account_holder_type: + Option, + /// Account number of the bank account. + #[serde(skip_serializing_if = "Option::is_none")] + pub account_number: Option<&'a str>, + /// Account type: checkings or savings. Defaults to checking if omitted. + #[serde(skip_serializing_if = "Option::is_none")] + pub account_type: Option, + /// The ID of a Financial Connections Account to use as a payment method. + #[serde(skip_serializing_if = "Option::is_none")] + pub financial_connections_account: Option<&'a str>, + /// Routing number of the bank account. + #[serde(skip_serializing_if = "Option::is_none")] + pub routing_number: Option<&'a str>, +} +impl<'a> ConfirmSetupIntentPaymentMethodDataUsBankAccount<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// Account holder type: individual or company. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum ConfirmSetupIntentPaymentMethodDataUsBankAccountAccountHolderType { + Company, + Individual, +} +impl ConfirmSetupIntentPaymentMethodDataUsBankAccountAccountHolderType { + pub fn as_str(self) -> &'static str { + use ConfirmSetupIntentPaymentMethodDataUsBankAccountAccountHolderType::*; + match self { + Company => "company", + Individual => "individual", + } + } +} + +impl std::str::FromStr for ConfirmSetupIntentPaymentMethodDataUsBankAccountAccountHolderType { + type Err = (); + fn from_str(s: &str) -> Result { + use ConfirmSetupIntentPaymentMethodDataUsBankAccountAccountHolderType::*; + match s { + "company" => Ok(Company), + "individual" => Ok(Individual), + _ => Err(()), + } + } +} +impl std::fmt::Display for ConfirmSetupIntentPaymentMethodDataUsBankAccountAccountHolderType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for ConfirmSetupIntentPaymentMethodDataUsBankAccountAccountHolderType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for ConfirmSetupIntentPaymentMethodDataUsBankAccountAccountHolderType { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Account type: checkings or savings. Defaults to checking if omitted. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum ConfirmSetupIntentPaymentMethodDataUsBankAccountAccountType { + Checking, + Savings, +} +impl ConfirmSetupIntentPaymentMethodDataUsBankAccountAccountType { + pub fn as_str(self) -> &'static str { + use ConfirmSetupIntentPaymentMethodDataUsBankAccountAccountType::*; + match self { + Checking => "checking", + Savings => "savings", + } + } +} + +impl std::str::FromStr for ConfirmSetupIntentPaymentMethodDataUsBankAccountAccountType { + type Err = (); + fn from_str(s: &str) -> Result { + use ConfirmSetupIntentPaymentMethodDataUsBankAccountAccountType::*; + match s { + "checking" => Ok(Checking), + "savings" => Ok(Savings), + _ => Err(()), + } + } +} +impl std::fmt::Display for ConfirmSetupIntentPaymentMethodDataUsBankAccountAccountType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for ConfirmSetupIntentPaymentMethodDataUsBankAccountAccountType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for ConfirmSetupIntentPaymentMethodDataUsBankAccountAccountType { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Payment method-specific configuration for this SetupIntent. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct ConfirmSetupIntentPaymentMethodOptions<'a> { + /// If this is a `acss_debit` SetupIntent, this sub-hash contains details about the ACSS Debit payment method options. + #[serde(skip_serializing_if = "Option::is_none")] + pub acss_debit: Option>, + /// Configuration for any card setup attempted on this SetupIntent. + #[serde(skip_serializing_if = "Option::is_none")] + pub card: Option>, + /// If this is a `link` PaymentMethod, this sub-hash contains details about the Link payment method options. + #[serde(skip_serializing_if = "Option::is_none")] + pub link: Option>, + /// If this is a `paypal` PaymentMethod, this sub-hash contains details about the PayPal payment method options. + #[serde(skip_serializing_if = "Option::is_none")] + pub paypal: Option>, + /// If this is a `sepa_debit` SetupIntent, this sub-hash contains details about the SEPA Debit payment method options. + #[serde(skip_serializing_if = "Option::is_none")] + pub sepa_debit: Option>, + /// If this is a `us_bank_account` SetupIntent, this sub-hash contains details about the US bank account payment method options. + #[serde(skip_serializing_if = "Option::is_none")] + pub us_bank_account: Option>, +} +impl<'a> ConfirmSetupIntentPaymentMethodOptions<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// If this is a `acss_debit` SetupIntent, this sub-hash contains details about the ACSS Debit payment method options. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct ConfirmSetupIntentPaymentMethodOptionsAcssDebit<'a> { + /// Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. + /// Must be a [supported currency](https://stripe.com/docs/currencies). + #[serde(skip_serializing_if = "Option::is_none")] + pub currency: Option, + /// Additional fields for Mandate creation + #[serde(skip_serializing_if = "Option::is_none")] + pub mandate_options: Option>, + /// Bank account verification method. + #[serde(skip_serializing_if = "Option::is_none")] + pub verification_method: + Option, +} +impl<'a> ConfirmSetupIntentPaymentMethodOptionsAcssDebit<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. +/// Must be a [supported currency](https://stripe.com/docs/currencies). +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum ConfirmSetupIntentPaymentMethodOptionsAcssDebitCurrency { + Cad, + Usd, +} +impl ConfirmSetupIntentPaymentMethodOptionsAcssDebitCurrency { + pub fn as_str(self) -> &'static str { + use ConfirmSetupIntentPaymentMethodOptionsAcssDebitCurrency::*; + match self { + Cad => "cad", + Usd => "usd", + } + } +} + +impl std::str::FromStr for ConfirmSetupIntentPaymentMethodOptionsAcssDebitCurrency { + type Err = (); + fn from_str(s: &str) -> Result { + use ConfirmSetupIntentPaymentMethodOptionsAcssDebitCurrency::*; + match s { + "cad" => Ok(Cad), + "usd" => Ok(Usd), + _ => Err(()), + } + } +} +impl std::fmt::Display for ConfirmSetupIntentPaymentMethodOptionsAcssDebitCurrency { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for ConfirmSetupIntentPaymentMethodOptionsAcssDebitCurrency { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for ConfirmSetupIntentPaymentMethodOptionsAcssDebitCurrency { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Additional fields for Mandate creation +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct ConfirmSetupIntentPaymentMethodOptionsAcssDebitMandateOptions<'a> { + /// A URL for custom mandate text to render during confirmation step. + /// The URL will be rendered with additional GET parameters `payment_intent` and `payment_intent_client_secret` when confirming a Payment Intent,. + /// or `setup_intent` and `setup_intent_client_secret` when confirming a Setup Intent. + #[serde(skip_serializing_if = "Option::is_none")] + pub custom_mandate_url: Option<&'a str>, + /// List of Stripe products where this mandate can be selected automatically. + #[serde(skip_serializing_if = "Option::is_none")] + pub default_for: + Option<&'a [ConfirmSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsDefaultFor]>, + /// Description of the mandate interval. + /// Only required if 'payment_schedule' parameter is 'interval' or 'combined'. + #[serde(skip_serializing_if = "Option::is_none")] + pub interval_description: Option<&'a str>, + /// Payment schedule for the mandate. + #[serde(skip_serializing_if = "Option::is_none")] + pub payment_schedule: + Option, + /// Transaction type of the mandate. + #[serde(skip_serializing_if = "Option::is_none")] + pub transaction_type: + Option, +} +impl<'a> ConfirmSetupIntentPaymentMethodOptionsAcssDebitMandateOptions<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// List of Stripe products where this mandate can be selected automatically. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum ConfirmSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsDefaultFor { + Invoice, + Subscription, +} +impl ConfirmSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsDefaultFor { + pub fn as_str(self) -> &'static str { + use ConfirmSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsDefaultFor::*; + match self { + Invoice => "invoice", + Subscription => "subscription", + } + } +} + +impl std::str::FromStr for ConfirmSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsDefaultFor { + type Err = (); + fn from_str(s: &str) -> Result { + use ConfirmSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsDefaultFor::*; + match s { + "invoice" => Ok(Invoice), + "subscription" => Ok(Subscription), + _ => Err(()), + } + } +} +impl std::fmt::Display for ConfirmSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsDefaultFor { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for ConfirmSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsDefaultFor { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for ConfirmSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsDefaultFor { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Payment schedule for the mandate. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum ConfirmSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsPaymentSchedule { + Combined, + Interval, + Sporadic, +} +impl ConfirmSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsPaymentSchedule { + pub fn as_str(self) -> &'static str { + use ConfirmSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsPaymentSchedule::*; + match self { + Combined => "combined", + Interval => "interval", + Sporadic => "sporadic", + } + } +} + +impl std::str::FromStr + for ConfirmSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsPaymentSchedule +{ + type Err = (); + fn from_str(s: &str) -> Result { + use ConfirmSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsPaymentSchedule::*; + match s { + "combined" => Ok(Combined), + "interval" => Ok(Interval), + "sporadic" => Ok(Sporadic), + _ => Err(()), + } + } +} +impl std::fmt::Display + for ConfirmSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsPaymentSchedule +{ + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug + for ConfirmSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsPaymentSchedule +{ + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize + for ConfirmSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsPaymentSchedule +{ + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Transaction type of the mandate. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum ConfirmSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsTransactionType { + Business, + Personal, +} +impl ConfirmSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsTransactionType { + pub fn as_str(self) -> &'static str { + use ConfirmSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsTransactionType::*; + match self { + Business => "business", + Personal => "personal", + } + } +} + +impl std::str::FromStr + for ConfirmSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsTransactionType +{ + type Err = (); + fn from_str(s: &str) -> Result { + use ConfirmSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsTransactionType::*; + match s { + "business" => Ok(Business), + "personal" => Ok(Personal), + _ => Err(()), + } + } +} +impl std::fmt::Display + for ConfirmSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsTransactionType +{ + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug + for ConfirmSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsTransactionType +{ + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize + for ConfirmSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsTransactionType +{ + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Bank account verification method. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum ConfirmSetupIntentPaymentMethodOptionsAcssDebitVerificationMethod { + Automatic, + Instant, + Microdeposits, +} +impl ConfirmSetupIntentPaymentMethodOptionsAcssDebitVerificationMethod { + pub fn as_str(self) -> &'static str { + use ConfirmSetupIntentPaymentMethodOptionsAcssDebitVerificationMethod::*; + match self { + Automatic => "automatic", + Instant => "instant", + Microdeposits => "microdeposits", + } + } +} + +impl std::str::FromStr for ConfirmSetupIntentPaymentMethodOptionsAcssDebitVerificationMethod { + type Err = (); + fn from_str(s: &str) -> Result { + use ConfirmSetupIntentPaymentMethodOptionsAcssDebitVerificationMethod::*; + match s { + "automatic" => Ok(Automatic), + "instant" => Ok(Instant), + "microdeposits" => Ok(Microdeposits), + _ => Err(()), + } + } +} +impl std::fmt::Display for ConfirmSetupIntentPaymentMethodOptionsAcssDebitVerificationMethod { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for ConfirmSetupIntentPaymentMethodOptionsAcssDebitVerificationMethod { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for ConfirmSetupIntentPaymentMethodOptionsAcssDebitVerificationMethod { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Configuration for any card setup attempted on this SetupIntent. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct ConfirmSetupIntentPaymentMethodOptionsCard<'a> { + /// Configuration options for setting up an eMandate for cards issued in India. + #[serde(skip_serializing_if = "Option::is_none")] + pub mandate_options: Option>, + /// When specified, this parameter signals that a card has been collected + /// as MOTO (Mail Order Telephone Order) and thus out of scope for SCA. This + /// parameter can only be provided during confirmation. + #[serde(skip_serializing_if = "Option::is_none")] + pub moto: Option, + /// Selected network to process this SetupIntent on. + /// Depends on the available networks of the card attached to the SetupIntent. + /// Can be only set confirm-time. + #[serde(skip_serializing_if = "Option::is_none")] + pub network: Option, + /// We strongly recommend that you rely on our SCA Engine to automatically prompt your customers for authentication based on risk level and [other requirements](https://stripe.com/docs/strong-customer-authentication). + /// However, if you wish to request 3D Secure based on logic from your own fraud engine, provide this option. + /// If not provided, this value defaults to `automatic`. + /// Read our guide on [manually requesting 3D Secure](https://stripe.com/docs/payments/3d-secure#manual-three-ds) for more information on how this configuration interacts with Radar and our SCA Engine. + #[serde(skip_serializing_if = "Option::is_none")] + pub request_three_d_secure: + Option, + /// If 3D Secure authentication was performed with a third-party provider, + /// the authentication details to use for this setup. + #[serde(skip_serializing_if = "Option::is_none")] + pub three_d_secure: Option>, +} +impl<'a> ConfirmSetupIntentPaymentMethodOptionsCard<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// Configuration options for setting up an eMandate for cards issued in India. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct ConfirmSetupIntentPaymentMethodOptionsCardMandateOptions<'a> { + /// Amount to be charged for future payments. + pub amount: i64, + /// One of `fixed` or `maximum`. + /// If `fixed`, the `amount` param refers to the exact amount to be charged in future payments. + /// If `maximum`, the amount charged can be up to the value passed for the `amount` param. + pub amount_type: ConfirmSetupIntentPaymentMethodOptionsCardMandateOptionsAmountType, + /// Currency in which future payments will be charged. + /// Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. + /// Must be a [supported currency](https://stripe.com/docs/currencies). + pub currency: stripe_types::Currency, + /// A description of the mandate or subscription that is meant to be displayed to the customer. + #[serde(skip_serializing_if = "Option::is_none")] + pub description: Option<&'a str>, + /// End date of the mandate or subscription. + /// If not provided, the mandate will be active until canceled. + /// If provided, end date should be after start date. + #[serde(skip_serializing_if = "Option::is_none")] + pub end_date: Option, + /// Specifies payment frequency. One of `day`, `week`, `month`, `year`, or `sporadic`. + pub interval: ConfirmSetupIntentPaymentMethodOptionsCardMandateOptionsInterval, + /// The number of intervals between payments. + /// For example, `interval=month` and `interval_count=3` indicates one payment every three months. + /// Maximum of one year interval allowed (1 year, 12 months, or 52 weeks). + /// This parameter is optional when `interval=sporadic`. + #[serde(skip_serializing_if = "Option::is_none")] + pub interval_count: Option, + /// Unique identifier for the mandate or subscription. + pub reference: &'a str, + /// Start date of the mandate or subscription. Start date should not be lesser than yesterday. + pub start_date: stripe_types::Timestamp, + /// Specifies the type of mandates supported. Possible values are `india`. + #[serde(skip_serializing_if = "Option::is_none")] + pub supported_types: + Option<&'a [ConfirmSetupIntentPaymentMethodOptionsCardMandateOptionsSupportedTypes]>, +} +impl<'a> ConfirmSetupIntentPaymentMethodOptionsCardMandateOptions<'a> { + pub fn new( + amount: i64, + amount_type: ConfirmSetupIntentPaymentMethodOptionsCardMandateOptionsAmountType, + currency: stripe_types::Currency, + interval: ConfirmSetupIntentPaymentMethodOptionsCardMandateOptionsInterval, + reference: &'a str, + start_date: stripe_types::Timestamp, + ) -> Self { + Self { + amount, + amount_type, + currency, + description: None, + end_date: None, + interval, + interval_count: None, + reference, + start_date, + supported_types: None, + } + } +} +/// One of `fixed` or `maximum`. +/// If `fixed`, the `amount` param refers to the exact amount to be charged in future payments. +/// If `maximum`, the amount charged can be up to the value passed for the `amount` param. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum ConfirmSetupIntentPaymentMethodOptionsCardMandateOptionsAmountType { + Fixed, + Maximum, +} +impl ConfirmSetupIntentPaymentMethodOptionsCardMandateOptionsAmountType { + pub fn as_str(self) -> &'static str { + use ConfirmSetupIntentPaymentMethodOptionsCardMandateOptionsAmountType::*; + match self { + Fixed => "fixed", + Maximum => "maximum", + } + } +} + +impl std::str::FromStr for ConfirmSetupIntentPaymentMethodOptionsCardMandateOptionsAmountType { + type Err = (); + fn from_str(s: &str) -> Result { + use ConfirmSetupIntentPaymentMethodOptionsCardMandateOptionsAmountType::*; + match s { + "fixed" => Ok(Fixed), + "maximum" => Ok(Maximum), + _ => Err(()), + } + } +} +impl std::fmt::Display for ConfirmSetupIntentPaymentMethodOptionsCardMandateOptionsAmountType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for ConfirmSetupIntentPaymentMethodOptionsCardMandateOptionsAmountType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for ConfirmSetupIntentPaymentMethodOptionsCardMandateOptionsAmountType { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Specifies payment frequency. One of `day`, `week`, `month`, `year`, or `sporadic`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum ConfirmSetupIntentPaymentMethodOptionsCardMandateOptionsInterval { + Day, + Month, + Sporadic, + Week, + Year, +} +impl ConfirmSetupIntentPaymentMethodOptionsCardMandateOptionsInterval { + pub fn as_str(self) -> &'static str { + use ConfirmSetupIntentPaymentMethodOptionsCardMandateOptionsInterval::*; + match self { + Day => "day", + Month => "month", + Sporadic => "sporadic", + Week => "week", + Year => "year", + } + } +} + +impl std::str::FromStr for ConfirmSetupIntentPaymentMethodOptionsCardMandateOptionsInterval { + type Err = (); + fn from_str(s: &str) -> Result { + use ConfirmSetupIntentPaymentMethodOptionsCardMandateOptionsInterval::*; + match s { + "day" => Ok(Day), + "month" => Ok(Month), + "sporadic" => Ok(Sporadic), + "week" => Ok(Week), + "year" => Ok(Year), + _ => Err(()), + } + } +} +impl std::fmt::Display for ConfirmSetupIntentPaymentMethodOptionsCardMandateOptionsInterval { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for ConfirmSetupIntentPaymentMethodOptionsCardMandateOptionsInterval { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for ConfirmSetupIntentPaymentMethodOptionsCardMandateOptionsInterval { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Specifies the type of mandates supported. Possible values are `india`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum ConfirmSetupIntentPaymentMethodOptionsCardMandateOptionsSupportedTypes { + India, +} +impl ConfirmSetupIntentPaymentMethodOptionsCardMandateOptionsSupportedTypes { + pub fn as_str(self) -> &'static str { + use ConfirmSetupIntentPaymentMethodOptionsCardMandateOptionsSupportedTypes::*; + match self { + India => "india", + } + } +} + +impl std::str::FromStr for ConfirmSetupIntentPaymentMethodOptionsCardMandateOptionsSupportedTypes { + type Err = (); + fn from_str(s: &str) -> Result { + use ConfirmSetupIntentPaymentMethodOptionsCardMandateOptionsSupportedTypes::*; + match s { + "india" => Ok(India), + _ => Err(()), + } + } +} +impl std::fmt::Display for ConfirmSetupIntentPaymentMethodOptionsCardMandateOptionsSupportedTypes { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for ConfirmSetupIntentPaymentMethodOptionsCardMandateOptionsSupportedTypes { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for ConfirmSetupIntentPaymentMethodOptionsCardMandateOptionsSupportedTypes { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Selected network to process this SetupIntent on. +/// Depends on the available networks of the card attached to the SetupIntent. +/// Can be only set confirm-time. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum ConfirmSetupIntentPaymentMethodOptionsCardNetwork { + Amex, + CartesBancaires, + Diners, + Discover, + EftposAu, + Interac, + Jcb, + Mastercard, + Unionpay, + Unknown, + Visa, +} +impl ConfirmSetupIntentPaymentMethodOptionsCardNetwork { + pub fn as_str(self) -> &'static str { + use ConfirmSetupIntentPaymentMethodOptionsCardNetwork::*; + match self { + Amex => "amex", + CartesBancaires => "cartes_bancaires", + Diners => "diners", + Discover => "discover", + EftposAu => "eftpos_au", + Interac => "interac", + Jcb => "jcb", + Mastercard => "mastercard", + Unionpay => "unionpay", + Unknown => "unknown", + Visa => "visa", + } + } +} + +impl std::str::FromStr for ConfirmSetupIntentPaymentMethodOptionsCardNetwork { + type Err = (); + fn from_str(s: &str) -> Result { + use ConfirmSetupIntentPaymentMethodOptionsCardNetwork::*; + match s { + "amex" => Ok(Amex), + "cartes_bancaires" => Ok(CartesBancaires), + "diners" => Ok(Diners), + "discover" => Ok(Discover), + "eftpos_au" => Ok(EftposAu), + "interac" => Ok(Interac), + "jcb" => Ok(Jcb), + "mastercard" => Ok(Mastercard), + "unionpay" => Ok(Unionpay), + "unknown" => Ok(Unknown), + "visa" => Ok(Visa), + _ => Err(()), + } + } +} +impl std::fmt::Display for ConfirmSetupIntentPaymentMethodOptionsCardNetwork { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for ConfirmSetupIntentPaymentMethodOptionsCardNetwork { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for ConfirmSetupIntentPaymentMethodOptionsCardNetwork { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// We strongly recommend that you rely on our SCA Engine to automatically prompt your customers for authentication based on risk level and [other requirements](https://stripe.com/docs/strong-customer-authentication). +/// However, if you wish to request 3D Secure based on logic from your own fraud engine, provide this option. +/// If not provided, this value defaults to `automatic`. +/// Read our guide on [manually requesting 3D Secure](https://stripe.com/docs/payments/3d-secure#manual-three-ds) for more information on how this configuration interacts with Radar and our SCA Engine. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum ConfirmSetupIntentPaymentMethodOptionsCardRequestThreeDSecure { + Any, + Automatic, + Challenge, +} +impl ConfirmSetupIntentPaymentMethodOptionsCardRequestThreeDSecure { + pub fn as_str(self) -> &'static str { + use ConfirmSetupIntentPaymentMethodOptionsCardRequestThreeDSecure::*; + match self { + Any => "any", + Automatic => "automatic", + Challenge => "challenge", + } + } +} + +impl std::str::FromStr for ConfirmSetupIntentPaymentMethodOptionsCardRequestThreeDSecure { + type Err = (); + fn from_str(s: &str) -> Result { + use ConfirmSetupIntentPaymentMethodOptionsCardRequestThreeDSecure::*; + match s { + "any" => Ok(Any), + "automatic" => Ok(Automatic), + "challenge" => Ok(Challenge), + _ => Err(()), + } + } +} +impl std::fmt::Display for ConfirmSetupIntentPaymentMethodOptionsCardRequestThreeDSecure { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for ConfirmSetupIntentPaymentMethodOptionsCardRequestThreeDSecure { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for ConfirmSetupIntentPaymentMethodOptionsCardRequestThreeDSecure { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// If 3D Secure authentication was performed with a third-party provider, +/// the authentication details to use for this setup. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct ConfirmSetupIntentPaymentMethodOptionsCardThreeDSecure<'a> { + /// The `transStatus` returned from the card Issuer’s ACS in the ARes. + #[serde(skip_serializing_if = "Option::is_none")] + pub ares_trans_status: + Option, + /// The cryptogram, also known as the "authentication value" (AAV, CAVV or + /// AEVV). This value is 20 bytes, base64-encoded into a 28-character string. + /// (Most 3D Secure providers will return the base64-encoded version, which + /// is what you should specify here.) + #[serde(skip_serializing_if = "Option::is_none")] + pub cryptogram: Option<&'a str>, + /// The Electronic Commerce Indicator (ECI) is returned by your 3D Secure + /// provider and indicates what degree of authentication was performed. + #[serde(skip_serializing_if = "Option::is_none")] + pub electronic_commerce_indicator: + Option, + /// Network specific 3DS fields. Network specific arguments require an + /// explicit card brand choice. The parameter `payment_method_options.card.network`` + /// must be populated accordingly + #[serde(skip_serializing_if = "Option::is_none")] + pub network_options: + Option>, + /// The challenge indicator (`threeDSRequestorChallengeInd`) which was requested in the + /// AReq sent to the card Issuer's ACS. A string containing 2 digits from 01-99. + #[serde(skip_serializing_if = "Option::is_none")] + pub requestor_challenge_indicator: Option<&'a str>, + /// For 3D Secure 1, the XID. For 3D Secure 2, the Directory Server + /// Transaction ID (dsTransID). + #[serde(skip_serializing_if = "Option::is_none")] + pub transaction_id: Option<&'a str>, + /// The version of 3D Secure that was performed. + #[serde(skip_serializing_if = "Option::is_none")] + pub version: Option, +} +impl<'a> ConfirmSetupIntentPaymentMethodOptionsCardThreeDSecure<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// The `transStatus` returned from the card Issuer’s ACS in the ARes. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum ConfirmSetupIntentPaymentMethodOptionsCardThreeDSecureAresTransStatus { + A, + C, + I, + N, + R, + U, + Y, +} +impl ConfirmSetupIntentPaymentMethodOptionsCardThreeDSecureAresTransStatus { + pub fn as_str(self) -> &'static str { + use ConfirmSetupIntentPaymentMethodOptionsCardThreeDSecureAresTransStatus::*; + match self { + A => "A", + C => "C", + I => "I", + N => "N", + R => "R", + U => "U", + Y => "Y", + } + } +} + +impl std::str::FromStr for ConfirmSetupIntentPaymentMethodOptionsCardThreeDSecureAresTransStatus { + type Err = (); + fn from_str(s: &str) -> Result { + use ConfirmSetupIntentPaymentMethodOptionsCardThreeDSecureAresTransStatus::*; + match s { + "A" => Ok(A), + "C" => Ok(C), + "I" => Ok(I), + "N" => Ok(N), + "R" => Ok(R), + "U" => Ok(U), + "Y" => Ok(Y), + _ => Err(()), + } + } +} +impl std::fmt::Display for ConfirmSetupIntentPaymentMethodOptionsCardThreeDSecureAresTransStatus { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for ConfirmSetupIntentPaymentMethodOptionsCardThreeDSecureAresTransStatus { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for ConfirmSetupIntentPaymentMethodOptionsCardThreeDSecureAresTransStatus { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// The Electronic Commerce Indicator (ECI) is returned by your 3D Secure +/// provider and indicates what degree of authentication was performed. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum ConfirmSetupIntentPaymentMethodOptionsCardThreeDSecureElectronicCommerceIndicator { + V01, + V02, + V05, + V06, + V07, +} +impl ConfirmSetupIntentPaymentMethodOptionsCardThreeDSecureElectronicCommerceIndicator { + pub fn as_str(self) -> &'static str { + use ConfirmSetupIntentPaymentMethodOptionsCardThreeDSecureElectronicCommerceIndicator::*; + match self { + V01 => "01", + V02 => "02", + V05 => "05", + V06 => "06", + V07 => "07", + } + } +} + +impl std::str::FromStr + for ConfirmSetupIntentPaymentMethodOptionsCardThreeDSecureElectronicCommerceIndicator +{ + type Err = (); + fn from_str(s: &str) -> Result { + use ConfirmSetupIntentPaymentMethodOptionsCardThreeDSecureElectronicCommerceIndicator::*; + match s { + "01" => Ok(V01), + "02" => Ok(V02), + "05" => Ok(V05), + "06" => Ok(V06), + "07" => Ok(V07), + _ => Err(()), + } + } +} +impl std::fmt::Display + for ConfirmSetupIntentPaymentMethodOptionsCardThreeDSecureElectronicCommerceIndicator +{ + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug + for ConfirmSetupIntentPaymentMethodOptionsCardThreeDSecureElectronicCommerceIndicator +{ + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize + for ConfirmSetupIntentPaymentMethodOptionsCardThreeDSecureElectronicCommerceIndicator +{ + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Network specific 3DS fields. Network specific arguments require an +/// explicit card brand choice. The parameter `payment_method_options.card.network`` +/// must be populated accordingly +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct ConfirmSetupIntentPaymentMethodOptionsCardThreeDSecureNetworkOptions<'a> { + /// Cartes Bancaires-specific 3DS fields. + #[serde(skip_serializing_if = "Option::is_none")] + pub cartes_bancaires: Option< + ConfirmSetupIntentPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancaires<'a>, + >, +} +impl<'a> ConfirmSetupIntentPaymentMethodOptionsCardThreeDSecureNetworkOptions<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// Cartes Bancaires-specific 3DS fields. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct ConfirmSetupIntentPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancaires<'a> { + /// The cryptogram calculation algorithm used by the card Issuer's ACS + /// to calculate the Authentication cryptogram. Also known as `cavvAlgorithm`. + /// messageExtension: CB-AVALGO + pub cb_avalgo: + ConfirmSetupIntentPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancairesCbAvalgo, + /// The exemption indicator returned from Cartes Bancaires in the ARes. + /// message extension: CB-EXEMPTION; string (4 characters) + /// This is a 3 byte bitmap (low significant byte first and most significant + /// bit first) that has been Base64 encoded + #[serde(skip_serializing_if = "Option::is_none")] + pub cb_exemption: Option<&'a str>, + /// The risk score returned from Cartes Bancaires in the ARes. + /// message extension: CB-SCORE; numeric value 0-99 + #[serde(skip_serializing_if = "Option::is_none")] + pub cb_score: Option, +} +impl<'a> ConfirmSetupIntentPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancaires<'a> { + pub fn new( + cb_avalgo: ConfirmSetupIntentPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancairesCbAvalgo, + ) -> Self { + Self { cb_avalgo, cb_exemption: None, cb_score: None } + } +} +/// The cryptogram calculation algorithm used by the card Issuer's ACS +/// to calculate the Authentication cryptogram. Also known as `cavvAlgorithm`. +/// messageExtension: CB-AVALGO +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum ConfirmSetupIntentPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancairesCbAvalgo +{ + V0, + V1, + V2, + V3, + V4, + A, +} +impl ConfirmSetupIntentPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancairesCbAvalgo { + pub fn as_str(self) -> &'static str { + use ConfirmSetupIntentPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancairesCbAvalgo::*; + match self { + V0 => "0", + V1 => "1", + V2 => "2", + V3 => "3", + V4 => "4", + A => "A", + } + } +} + +impl std::str::FromStr + for ConfirmSetupIntentPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancairesCbAvalgo +{ + type Err = (); + fn from_str(s: &str) -> Result { + use ConfirmSetupIntentPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancairesCbAvalgo::*; + match s { + "0" => Ok(V0), + "1" => Ok(V1), + "2" => Ok(V2), + "3" => Ok(V3), + "4" => Ok(V4), + "A" => Ok(A), + _ => Err(()), + } + } +} +impl std::fmt::Display + for ConfirmSetupIntentPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancairesCbAvalgo +{ + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug + for ConfirmSetupIntentPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancairesCbAvalgo +{ + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize + for ConfirmSetupIntentPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancairesCbAvalgo +{ + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// The version of 3D Secure that was performed. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum ConfirmSetupIntentPaymentMethodOptionsCardThreeDSecureVersion { + V1_0_2, + V2_1_0, + V2_2_0, +} +impl ConfirmSetupIntentPaymentMethodOptionsCardThreeDSecureVersion { + pub fn as_str(self) -> &'static str { + use ConfirmSetupIntentPaymentMethodOptionsCardThreeDSecureVersion::*; + match self { + V1_0_2 => "1.0.2", + V2_1_0 => "2.1.0", + V2_2_0 => "2.2.0", + } + } +} + +impl std::str::FromStr for ConfirmSetupIntentPaymentMethodOptionsCardThreeDSecureVersion { + type Err = (); + fn from_str(s: &str) -> Result { + use ConfirmSetupIntentPaymentMethodOptionsCardThreeDSecureVersion::*; + match s { + "1.0.2" => Ok(V1_0_2), + "2.1.0" => Ok(V2_1_0), + "2.2.0" => Ok(V2_2_0), + _ => Err(()), + } + } +} +impl std::fmt::Display for ConfirmSetupIntentPaymentMethodOptionsCardThreeDSecureVersion { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for ConfirmSetupIntentPaymentMethodOptionsCardThreeDSecureVersion { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for ConfirmSetupIntentPaymentMethodOptionsCardThreeDSecureVersion { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// If this is a `sepa_debit` SetupIntent, this sub-hash contains details about the SEPA Debit payment method options. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct ConfirmSetupIntentPaymentMethodOptionsSepaDebit<'a> { + /// Additional fields for Mandate creation + #[serde(skip_serializing_if = "Option::is_none")] + pub mandate_options: Option<&'a serde_json::Value>, +} +impl<'a> ConfirmSetupIntentPaymentMethodOptionsSepaDebit<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// If this is a `us_bank_account` SetupIntent, this sub-hash contains details about the US bank account payment method options. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct ConfirmSetupIntentPaymentMethodOptionsUsBankAccount<'a> { + /// Additional fields for Financial Connections Session creation + #[serde(skip_serializing_if = "Option::is_none")] + pub financial_connections: + Option>, + /// Additional fields for Mandate creation + #[serde(skip_serializing_if = "Option::is_none")] + pub mandate_options: Option, + /// Additional fields for network related functions + #[serde(skip_serializing_if = "Option::is_none")] + pub networks: Option>, + /// Bank account verification method. + #[serde(skip_serializing_if = "Option::is_none")] + pub verification_method: + Option, +} +impl<'a> ConfirmSetupIntentPaymentMethodOptionsUsBankAccount<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// Additional fields for Financial Connections Session creation +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct ConfirmSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnections<'a> { + /// The list of permissions to request. + /// If this parameter is passed, the `payment_method` permission must be included. + /// Valid permissions include: `balances`, `ownership`, `payment_method`, and `transactions`. + #[serde(skip_serializing_if = "Option::is_none")] + pub permissions: Option< + &'a [ConfirmSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions], + >, + /// List of data features that you would like to retrieve upon account creation. + #[serde(skip_serializing_if = "Option::is_none")] + pub prefetch: Option< + &'a [ConfirmSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch], + >, + /// For webview integrations only. + /// Upon completing OAuth login in the native browser, the user will be redirected to this URL to return to your app. + #[serde(skip_serializing_if = "Option::is_none")] + pub return_url: Option<&'a str>, +} +impl<'a> ConfirmSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnections<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// The list of permissions to request. +/// If this parameter is passed, the `payment_method` permission must be included. +/// Valid permissions include: `balances`, `ownership`, `payment_method`, and `transactions`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum ConfirmSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions { + Balances, + Ownership, + PaymentMethod, + Transactions, +} +impl ConfirmSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions { + pub fn as_str(self) -> &'static str { + use ConfirmSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions::*; + match self { + Balances => "balances", + Ownership => "ownership", + PaymentMethod => "payment_method", + Transactions => "transactions", + } + } +} + +impl std::str::FromStr + for ConfirmSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions +{ + type Err = (); + fn from_str(s: &str) -> Result { + use ConfirmSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions::*; + match s { + "balances" => Ok(Balances), + "ownership" => Ok(Ownership), + "payment_method" => Ok(PaymentMethod), + "transactions" => Ok(Transactions), + _ => Err(()), + } + } +} +impl std::fmt::Display + for ConfirmSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions +{ + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug + for ConfirmSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions +{ + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize + for ConfirmSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions +{ + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// List of data features that you would like to retrieve upon account creation. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum ConfirmSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch { + Balances, + Transactions, +} +impl ConfirmSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch { + pub fn as_str(self) -> &'static str { + use ConfirmSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch::*; + match self { + Balances => "balances", + Transactions => "transactions", + } + } +} + +impl std::str::FromStr + for ConfirmSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch +{ + type Err = (); + fn from_str(s: &str) -> Result { + use ConfirmSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch::*; + match s { + "balances" => Ok(Balances), + "transactions" => Ok(Transactions), + _ => Err(()), + } + } +} +impl std::fmt::Display + for ConfirmSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch +{ + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug + for ConfirmSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch +{ + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize + for ConfirmSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch +{ + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Additional fields for Mandate creation +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct ConfirmSetupIntentPaymentMethodOptionsUsBankAccountMandateOptions { + /// The method used to collect offline mandate customer acceptance. + #[serde(skip_serializing_if = "Option::is_none")] + pub collection_method: + Option, +} +impl ConfirmSetupIntentPaymentMethodOptionsUsBankAccountMandateOptions { + pub fn new() -> Self { + Self::default() + } +} +/// The method used to collect offline mandate customer acceptance. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum ConfirmSetupIntentPaymentMethodOptionsUsBankAccountMandateOptionsCollectionMethod { + Paper, +} +impl ConfirmSetupIntentPaymentMethodOptionsUsBankAccountMandateOptionsCollectionMethod { + pub fn as_str(self) -> &'static str { + use ConfirmSetupIntentPaymentMethodOptionsUsBankAccountMandateOptionsCollectionMethod::*; + match self { + Paper => "paper", + } + } +} + +impl std::str::FromStr + for ConfirmSetupIntentPaymentMethodOptionsUsBankAccountMandateOptionsCollectionMethod +{ + type Err = (); + fn from_str(s: &str) -> Result { + use ConfirmSetupIntentPaymentMethodOptionsUsBankAccountMandateOptionsCollectionMethod::*; + match s { + "paper" => Ok(Paper), + _ => Err(()), + } + } +} +impl std::fmt::Display + for ConfirmSetupIntentPaymentMethodOptionsUsBankAccountMandateOptionsCollectionMethod +{ + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug + for ConfirmSetupIntentPaymentMethodOptionsUsBankAccountMandateOptionsCollectionMethod +{ + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize + for ConfirmSetupIntentPaymentMethodOptionsUsBankAccountMandateOptionsCollectionMethod +{ + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Additional fields for network related functions +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct ConfirmSetupIntentPaymentMethodOptionsUsBankAccountNetworks<'a> { + /// Triggers validations to run across the selected networks + #[serde(skip_serializing_if = "Option::is_none")] + pub requested: + Option<&'a [ConfirmSetupIntentPaymentMethodOptionsUsBankAccountNetworksRequested]>, +} +impl<'a> ConfirmSetupIntentPaymentMethodOptionsUsBankAccountNetworks<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// Triggers validations to run across the selected networks +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum ConfirmSetupIntentPaymentMethodOptionsUsBankAccountNetworksRequested { + Ach, + UsDomesticWire, +} +impl ConfirmSetupIntentPaymentMethodOptionsUsBankAccountNetworksRequested { + pub fn as_str(self) -> &'static str { + use ConfirmSetupIntentPaymentMethodOptionsUsBankAccountNetworksRequested::*; + match self { + Ach => "ach", + UsDomesticWire => "us_domestic_wire", + } + } +} + +impl std::str::FromStr for ConfirmSetupIntentPaymentMethodOptionsUsBankAccountNetworksRequested { + type Err = (); + fn from_str(s: &str) -> Result { + use ConfirmSetupIntentPaymentMethodOptionsUsBankAccountNetworksRequested::*; + match s { + "ach" => Ok(Ach), + "us_domestic_wire" => Ok(UsDomesticWire), + _ => Err(()), + } + } +} +impl std::fmt::Display for ConfirmSetupIntentPaymentMethodOptionsUsBankAccountNetworksRequested { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for ConfirmSetupIntentPaymentMethodOptionsUsBankAccountNetworksRequested { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for ConfirmSetupIntentPaymentMethodOptionsUsBankAccountNetworksRequested { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Bank account verification method. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum ConfirmSetupIntentPaymentMethodOptionsUsBankAccountVerificationMethod { + Automatic, + Instant, + Microdeposits, +} +impl ConfirmSetupIntentPaymentMethodOptionsUsBankAccountVerificationMethod { + pub fn as_str(self) -> &'static str { + use ConfirmSetupIntentPaymentMethodOptionsUsBankAccountVerificationMethod::*; + match self { + Automatic => "automatic", + Instant => "instant", + Microdeposits => "microdeposits", + } + } +} + +impl std::str::FromStr for ConfirmSetupIntentPaymentMethodOptionsUsBankAccountVerificationMethod { + type Err = (); + fn from_str(s: &str) -> Result { + use ConfirmSetupIntentPaymentMethodOptionsUsBankAccountVerificationMethod::*; + match s { + "automatic" => Ok(Automatic), + "instant" => Ok(Instant), + "microdeposits" => Ok(Microdeposits), + _ => Err(()), + } + } +} +impl std::fmt::Display for ConfirmSetupIntentPaymentMethodOptionsUsBankAccountVerificationMethod { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for ConfirmSetupIntentPaymentMethodOptionsUsBankAccountVerificationMethod { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for ConfirmSetupIntentPaymentMethodOptionsUsBankAccountVerificationMethod { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'a> ConfirmSetupIntent<'a> { + /// Confirm that your customer intends to set up the current or + /// provided payment method. For example, you would confirm a SetupIntent + /// when a customer hits the “Save” button on a payment method management + /// page on your website. + /// + /// If the selected payment method does not require any additional + /// steps from the customer, the SetupIntent will transition to the + /// `succeeded` status. + /// + /// Otherwise, it will transition to the `requires_action` status and + /// suggest additional actions via `next_action`. If setup fails, + /// the SetupIntent will transition to the + /// `requires_payment_method` status or the `canceled` status if the + /// confirmation limit is reached. + pub fn send( + &self, + client: &stripe::Client, + intent: &stripe_shared::SetupIntentId, + ) -> stripe::Response { + client.send_form( + &format!("/setup_intents/{intent}/confirm"), + self, + http_types::Method::Post, + ) + } +} +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct VerifyMicrodepositsSetupIntent<'a> { + /// Two positive integers, in *cents*, equal to the values of the microdeposits sent to the bank account. + #[serde(skip_serializing_if = "Option::is_none")] + pub amounts: Option<&'a [i64]>, + /// A six-character code starting with SM present in the microdeposit sent to the bank account. + #[serde(skip_serializing_if = "Option::is_none")] + pub descriptor_code: Option<&'a str>, + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, +} +impl<'a> VerifyMicrodepositsSetupIntent<'a> { + pub fn new() -> Self { + Self::default() + } +} +impl<'a> VerifyMicrodepositsSetupIntent<'a> { + /// Verifies microdeposits on a SetupIntent object. + pub fn send( + &self, + client: &stripe::Client, + intent: &stripe_shared::SetupIntentId, + ) -> stripe::Response { + client.send_form( + &format!("/setup_intents/{intent}/verify_microdeposits"), + self, + http_types::Method::Post, + ) + } +} +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct OnlineParam<'a> { + /// The IP address from which the Mandate was accepted by the customer. + pub ip_address: &'a str, + /// The user agent of the browser from which the Mandate was accepted by the customer. + pub user_agent: &'a str, +} +impl<'a> OnlineParam<'a> { + pub fn new(ip_address: &'a str, user_agent: &'a str) -> Self { + Self { ip_address, user_agent } + } +} +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct PaymentMethodParam<'a> { + /// Customer's bank account number. + pub account_number: &'a str, + /// Institution number of the customer's bank. + pub institution_number: &'a str, + /// Transit number of the customer's bank. + pub transit_number: &'a str, +} +impl<'a> PaymentMethodParam<'a> { + pub fn new( + account_number: &'a str, + institution_number: &'a str, + transit_number: &'a str, + ) -> Self { + Self { account_number, institution_number, transit_number } + } +} +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct BillingDetailsAddress<'a> { + /// City, district, suburb, town, or village. + #[serde(skip_serializing_if = "Option::is_none")] + pub city: Option<&'a str>, + /// Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). + #[serde(skip_serializing_if = "Option::is_none")] + pub country: Option<&'a str>, + /// Address line 1 (e.g., street, PO Box, or company name). + #[serde(skip_serializing_if = "Option::is_none")] + pub line1: Option<&'a str>, + /// Address line 2 (e.g., apartment, suite, unit, or building). + #[serde(skip_serializing_if = "Option::is_none")] + pub line2: Option<&'a str>, + /// ZIP or postal code. + #[serde(skip_serializing_if = "Option::is_none")] + pub postal_code: Option<&'a str>, + /// State, county, province, or region. + #[serde(skip_serializing_if = "Option::is_none")] + pub state: Option<&'a str>, +} +impl<'a> BillingDetailsAddress<'a> { + pub fn new() -> Self { + Self::default() + } +} +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct DateOfBirth { + /// The day of birth, between 1 and 31. + pub day: i64, + /// The month of birth, between 1 and 12. + pub month: i64, + /// The four-digit year of birth. + pub year: i64, +} +impl DateOfBirth { + pub fn new(day: i64, month: i64, year: i64) -> Self { + Self { day, month, year } + } +} +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct RadarOptions<'a> { + /// A [Radar Session](https://stripe.com/docs/radar/radar-session) is a snapshot of the browser metadata and device details that help Radar make more accurate predictions on your payments. + #[serde(skip_serializing_if = "Option::is_none")] + pub session: Option<&'a str>, +} +impl<'a> RadarOptions<'a> { + pub fn new() -> Self { + Self::default() + } +} +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct SetupIntentPaymentMethodOptionsParam<'a> { + /// \[Deprecated\] This is a legacy parameter that no longer has any function. + #[serde(skip_serializing_if = "Option::is_none")] + pub persistent_token: Option<&'a str>, +} +impl<'a> SetupIntentPaymentMethodOptionsParam<'a> { + pub fn new() -> Self { + Self::default() + } +} +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct PaymentMethodOptionsParam<'a> { + /// The PayPal Billing Agreement ID (BAID). + /// This is an ID generated by PayPal which represents the mandate between the merchant and the customer. + #[serde(skip_serializing_if = "Option::is_none")] + pub billing_agreement_id: Option<&'a str>, +} +impl<'a> PaymentMethodOptionsParam<'a> { + pub fn new() -> Self { + Self::default() + } +} +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct BillingDetailsInnerParams<'a> { + /// Billing address. + #[serde(skip_serializing_if = "Option::is_none")] + pub address: Option>, + /// Email address. + #[serde(skip_serializing_if = "Option::is_none")] + pub email: Option<&'a str>, + /// Full name. + #[serde(skip_serializing_if = "Option::is_none")] + pub name: Option<&'a str>, + /// Billing phone number (including extension). + #[serde(skip_serializing_if = "Option::is_none")] + pub phone: Option<&'a str>, +} +impl<'a> BillingDetailsInnerParams<'a> { + pub fn new() -> Self { + Self::default() + } +} diff --git a/generated/stripe_core/src/token/mod.rs b/generated/stripe_core/src/token/mod.rs new file mode 100644 index 000000000..4cd25a0ce --- /dev/null +++ b/generated/stripe_core/src/token/mod.rs @@ -0,0 +1,5 @@ +#[cfg(feature = "token")] +mod requests; +pub(crate) mod types; +#[cfg(feature = "token")] +pub use requests::*; diff --git a/generated/stripe_core/src/token/requests.rs b/generated/stripe_core/src/token/requests.rs new file mode 100644 index 000000000..6271ce0f9 --- /dev/null +++ b/generated/stripe_core/src/token/requests.rs @@ -0,0 +1,1208 @@ +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct RetrieveToken<'a> { + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, +} +impl<'a> RetrieveToken<'a> { + pub fn new() -> Self { + Self::default() + } +} +impl<'a> RetrieveToken<'a> { + /// Retrieves the token with the given ID. + pub fn send( + &self, + client: &stripe::Client, + token: &stripe_core::TokenId, + ) -> stripe::Response { + client.get_query(&format!("/tokens/{token}"), self) + } +} +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreateToken<'a> { + /// Information for the account this token represents. + #[serde(skip_serializing_if = "Option::is_none")] + pub account: Option>, + /// The bank account this token will represent. + #[serde(skip_serializing_if = "Option::is_none")] + pub bank_account: Option>, + /// The card this token will represent. + /// If you also pass in a customer, the card must be the ID of a card belonging to the customer. + /// Otherwise, if you do not pass in a customer, this is a dictionary containing a user's credit card details, with the options described below. + #[serde(skip_serializing_if = "Option::is_none")] + pub card: Option>, + /// Create a token for the customer, which is owned by the application's account. + /// You can only use this with an [OAuth access token](https://stripe.com/docs/connect/standard-accounts) or [Stripe-Account header](https://stripe.com/docs/connect/authentication). + /// Learn more about [cloning saved payment methods](https://stripe.com/docs/connect/cloning-saved-payment-methods). + #[serde(skip_serializing_if = "Option::is_none")] + pub customer: Option<&'a str>, + /// The updated CVC value this token represents. + #[serde(skip_serializing_if = "Option::is_none")] + pub cvc_update: Option>, + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, + /// Information for the person this token represents. + #[serde(skip_serializing_if = "Option::is_none")] + pub person: Option>, + /// The PII this token represents. + #[serde(skip_serializing_if = "Option::is_none")] + pub pii: Option>, +} +impl<'a> CreateToken<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// Information for the account this token represents. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreateTokenAccount<'a> { + /// The business type. + #[serde(skip_serializing_if = "Option::is_none")] + pub business_type: Option, + /// Information about the company or business. + #[serde(skip_serializing_if = "Option::is_none")] + pub company: Option>, + /// Information about the person represented by the account. + #[serde(skip_serializing_if = "Option::is_none")] + pub individual: Option>, + /// Whether the user described by the data in the token has been shown [the Stripe Connected Account Agreement](https://stripe.com/docs/connect/account-tokens#stripe-connected-account-agreement). + /// When creating an account token to create a new Connect account, this value must be `true`. + #[serde(skip_serializing_if = "Option::is_none")] + pub tos_shown_and_accepted: Option, +} +impl<'a> CreateTokenAccount<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// The business type. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreateTokenAccountBusinessType { + Company, + GovernmentEntity, + Individual, + NonProfit, +} +impl CreateTokenAccountBusinessType { + pub fn as_str(self) -> &'static str { + use CreateTokenAccountBusinessType::*; + match self { + Company => "company", + GovernmentEntity => "government_entity", + Individual => "individual", + NonProfit => "non_profit", + } + } +} + +impl std::str::FromStr for CreateTokenAccountBusinessType { + type Err = (); + fn from_str(s: &str) -> Result { + use CreateTokenAccountBusinessType::*; + match s { + "company" => Ok(Company), + "government_entity" => Ok(GovernmentEntity), + "individual" => Ok(Individual), + "non_profit" => Ok(NonProfit), + _ => Err(()), + } + } +} +impl std::fmt::Display for CreateTokenAccountBusinessType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreateTokenAccountBusinessType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreateTokenAccountBusinessType { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Information about the company or business. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreateTokenAccountCompany<'a> { + /// The company's primary address. + #[serde(skip_serializing_if = "Option::is_none")] + pub address: Option>, + /// The Kana variation of the company's primary address (Japan only). + #[serde(skip_serializing_if = "Option::is_none")] + pub address_kana: Option>, + /// The Kanji variation of the company's primary address (Japan only). + #[serde(skip_serializing_if = "Option::is_none")] + pub address_kanji: Option>, + /// Whether the company's directors have been provided. + /// Set this Boolean to `true` after creating all the company's directors with [the Persons API](https://stripe.com/docs/api/persons) for accounts with a `relationship.director` requirement. + /// This value is not automatically set to `true` after creating directors, so it needs to be updated to indicate all directors have been provided. + #[serde(skip_serializing_if = "Option::is_none")] + pub directors_provided: Option, + /// Whether the company's executives have been provided. + /// Set this Boolean to `true` after creating all the company's executives with [the Persons API](https://stripe.com/docs/api/persons) for accounts with a `relationship.executive` requirement. + #[serde(skip_serializing_if = "Option::is_none")] + pub executives_provided: Option, + /// The export license ID number of the company, also referred as Import Export Code (India only). + #[serde(skip_serializing_if = "Option::is_none")] + pub export_license_id: Option<&'a str>, + /// The purpose code to use for export transactions (India only). + #[serde(skip_serializing_if = "Option::is_none")] + pub export_purpose_code: Option<&'a str>, + /// The company's legal name. + #[serde(skip_serializing_if = "Option::is_none")] + pub name: Option<&'a str>, + /// The Kana variation of the company's legal name (Japan only). + #[serde(skip_serializing_if = "Option::is_none")] + pub name_kana: Option<&'a str>, + /// The Kanji variation of the company's legal name (Japan only). + #[serde(skip_serializing_if = "Option::is_none")] + pub name_kanji: Option<&'a str>, + /// Whether the company's owners have been provided. + /// Set this Boolean to `true` after creating all the company's owners with [the Persons API](https://stripe.com/docs/api/persons) for accounts with a `relationship.owner` requirement. + #[serde(skip_serializing_if = "Option::is_none")] + pub owners_provided: Option, + /// This hash is used to attest that the beneficial owner information provided to Stripe is both current and correct. + #[serde(skip_serializing_if = "Option::is_none")] + pub ownership_declaration: Option>, + /// Whether the user described by the data in the token has been shown the Ownership Declaration and indicated that it is correct. + #[serde(skip_serializing_if = "Option::is_none")] + pub ownership_declaration_shown_and_signed: Option, + /// The company's phone number (used for verification). + #[serde(skip_serializing_if = "Option::is_none")] + pub phone: Option<&'a str>, + /// The identification number given to a company when it is registered or incorporated, if distinct from the identification number used for filing taxes. + /// (Examples are the CIN for companies and LLP IN for partnerships in India, and the Company Registration Number in Hong Kong). + #[serde(skip_serializing_if = "Option::is_none")] + pub registration_number: Option<&'a str>, + /// The category identifying the legal structure of the company or legal entity. + /// See [Business structure](https://stripe.com/docs/connect/identity-verification#business-structure) for more details. + /// Pass an empty string to unset this value. + #[serde(skip_serializing_if = "Option::is_none")] + pub structure: Option, + /// The business ID number of the company, as appropriate for the company’s country. + /// (Examples are an Employer ID Number in the U.S., a Business Number in Canada, or a Company Number in the UK.). + #[serde(skip_serializing_if = "Option::is_none")] + pub tax_id: Option<&'a str>, + /// The jurisdiction in which the `tax_id` is registered (Germany-based companies only). + #[serde(skip_serializing_if = "Option::is_none")] + pub tax_id_registrar: Option<&'a str>, + /// The VAT number of the company. + #[serde(skip_serializing_if = "Option::is_none")] + pub vat_id: Option<&'a str>, + /// Information on the verification state of the company. + #[serde(skip_serializing_if = "Option::is_none")] + pub verification: Option>, +} +impl<'a> CreateTokenAccountCompany<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// The Kana variation of the company's primary address (Japan only). +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreateTokenAccountCompanyAddressKana<'a> { + /// City or ward. + #[serde(skip_serializing_if = "Option::is_none")] + pub city: Option<&'a str>, + /// Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). + #[serde(skip_serializing_if = "Option::is_none")] + pub country: Option<&'a str>, + /// Block or building number. + #[serde(skip_serializing_if = "Option::is_none")] + pub line1: Option<&'a str>, + /// Building details. + #[serde(skip_serializing_if = "Option::is_none")] + pub line2: Option<&'a str>, + /// Postal code. + #[serde(skip_serializing_if = "Option::is_none")] + pub postal_code: Option<&'a str>, + /// Prefecture. + #[serde(skip_serializing_if = "Option::is_none")] + pub state: Option<&'a str>, + /// Town or cho-me. + #[serde(skip_serializing_if = "Option::is_none")] + pub town: Option<&'a str>, +} +impl<'a> CreateTokenAccountCompanyAddressKana<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// The Kanji variation of the company's primary address (Japan only). +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreateTokenAccountCompanyAddressKanji<'a> { + /// City or ward. + #[serde(skip_serializing_if = "Option::is_none")] + pub city: Option<&'a str>, + /// Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). + #[serde(skip_serializing_if = "Option::is_none")] + pub country: Option<&'a str>, + /// Block or building number. + #[serde(skip_serializing_if = "Option::is_none")] + pub line1: Option<&'a str>, + /// Building details. + #[serde(skip_serializing_if = "Option::is_none")] + pub line2: Option<&'a str>, + /// Postal code. + #[serde(skip_serializing_if = "Option::is_none")] + pub postal_code: Option<&'a str>, + /// Prefecture. + #[serde(skip_serializing_if = "Option::is_none")] + pub state: Option<&'a str>, + /// Town or cho-me. + #[serde(skip_serializing_if = "Option::is_none")] + pub town: Option<&'a str>, +} +impl<'a> CreateTokenAccountCompanyAddressKanji<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// This hash is used to attest that the beneficial owner information provided to Stripe is both current and correct. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreateTokenAccountCompanyOwnershipDeclaration<'a> { + /// The Unix timestamp marking when the beneficial owner attestation was made. + #[serde(skip_serializing_if = "Option::is_none")] + pub date: Option, + /// The IP address from which the beneficial owner attestation was made. + #[serde(skip_serializing_if = "Option::is_none")] + pub ip: Option<&'a str>, + /// The user agent of the browser from which the beneficial owner attestation was made. + #[serde(skip_serializing_if = "Option::is_none")] + pub user_agent: Option<&'a str>, +} +impl<'a> CreateTokenAccountCompanyOwnershipDeclaration<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// The category identifying the legal structure of the company or legal entity. +/// See [Business structure](https://stripe.com/docs/connect/identity-verification#business-structure) for more details. +/// Pass an empty string to unset this value. +#[derive(Copy, Clone, Eq, PartialEq)] +#[non_exhaustive] +pub enum CreateTokenAccountCompanyStructure { + FreeZoneEstablishment, + FreeZoneLlc, + GovernmentInstrumentality, + GovernmentalUnit, + IncorporatedNonProfit, + IncorporatedPartnership, + LimitedLiabilityPartnership, + Llc, + MultiMemberLlc, + PrivateCompany, + PrivateCorporation, + PrivatePartnership, + PublicCompany, + PublicCorporation, + PublicPartnership, + RegisteredCharity, + SingleMemberLlc, + SoleEstablishment, + SoleProprietorship, + TaxExemptGovernmentInstrumentality, + UnincorporatedAssociation, + UnincorporatedNonProfit, + UnincorporatedPartnership, + /// An unrecognized value from Stripe. Should not be used as a request parameter. + Unknown, +} +impl CreateTokenAccountCompanyStructure { + pub fn as_str(self) -> &'static str { + use CreateTokenAccountCompanyStructure::*; + match self { + FreeZoneEstablishment => "free_zone_establishment", + FreeZoneLlc => "free_zone_llc", + GovernmentInstrumentality => "government_instrumentality", + GovernmentalUnit => "governmental_unit", + IncorporatedNonProfit => "incorporated_non_profit", + IncorporatedPartnership => "incorporated_partnership", + LimitedLiabilityPartnership => "limited_liability_partnership", + Llc => "llc", + MultiMemberLlc => "multi_member_llc", + PrivateCompany => "private_company", + PrivateCorporation => "private_corporation", + PrivatePartnership => "private_partnership", + PublicCompany => "public_company", + PublicCorporation => "public_corporation", + PublicPartnership => "public_partnership", + RegisteredCharity => "registered_charity", + SingleMemberLlc => "single_member_llc", + SoleEstablishment => "sole_establishment", + SoleProprietorship => "sole_proprietorship", + TaxExemptGovernmentInstrumentality => "tax_exempt_government_instrumentality", + UnincorporatedAssociation => "unincorporated_association", + UnincorporatedNonProfit => "unincorporated_non_profit", + UnincorporatedPartnership => "unincorporated_partnership", + Unknown => "unknown", + } + } +} + +impl std::str::FromStr for CreateTokenAccountCompanyStructure { + type Err = (); + fn from_str(s: &str) -> Result { + use CreateTokenAccountCompanyStructure::*; + match s { + "free_zone_establishment" => Ok(FreeZoneEstablishment), + "free_zone_llc" => Ok(FreeZoneLlc), + "government_instrumentality" => Ok(GovernmentInstrumentality), + "governmental_unit" => Ok(GovernmentalUnit), + "incorporated_non_profit" => Ok(IncorporatedNonProfit), + "incorporated_partnership" => Ok(IncorporatedPartnership), + "limited_liability_partnership" => Ok(LimitedLiabilityPartnership), + "llc" => Ok(Llc), + "multi_member_llc" => Ok(MultiMemberLlc), + "private_company" => Ok(PrivateCompany), + "private_corporation" => Ok(PrivateCorporation), + "private_partnership" => Ok(PrivatePartnership), + "public_company" => Ok(PublicCompany), + "public_corporation" => Ok(PublicCorporation), + "public_partnership" => Ok(PublicPartnership), + "registered_charity" => Ok(RegisteredCharity), + "single_member_llc" => Ok(SingleMemberLlc), + "sole_establishment" => Ok(SoleEstablishment), + "sole_proprietorship" => Ok(SoleProprietorship), + "tax_exempt_government_instrumentality" => Ok(TaxExemptGovernmentInstrumentality), + "unincorporated_association" => Ok(UnincorporatedAssociation), + "unincorporated_non_profit" => Ok(UnincorporatedNonProfit), + "unincorporated_partnership" => Ok(UnincorporatedPartnership), + _ => Err(()), + } + } +} +impl std::fmt::Display for CreateTokenAccountCompanyStructure { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreateTokenAccountCompanyStructure { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreateTokenAccountCompanyStructure { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Information on the verification state of the company. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreateTokenAccountCompanyVerification<'a> { + /// A document verifying the business. + #[serde(skip_serializing_if = "Option::is_none")] + pub document: Option>, +} +impl<'a> CreateTokenAccountCompanyVerification<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// A document verifying the business. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreateTokenAccountCompanyVerificationDocument<'a> { + /// The back of a document returned by a [file upload](https://stripe.com/docs/api#create_file) with a `purpose` value of `additional_verification`. + /// The uploaded file needs to be a color image (smaller than 8,000px by 8,000px), in JPG, PNG, or PDF format, and less than 10 MB in size. + #[serde(skip_serializing_if = "Option::is_none")] + pub back: Option<&'a str>, + /// The front of a document returned by a [file upload](https://stripe.com/docs/api#create_file) with a `purpose` value of `additional_verification`. + /// The uploaded file needs to be a color image (smaller than 8,000px by 8,000px), in JPG, PNG, or PDF format, and less than 10 MB in size. + #[serde(skip_serializing_if = "Option::is_none")] + pub front: Option<&'a str>, +} +impl<'a> CreateTokenAccountCompanyVerificationDocument<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// Information about the person represented by the account. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreateTokenAccountIndividual<'a> { + /// The individual's primary address. + #[serde(skip_serializing_if = "Option::is_none")] + pub address: Option>, + /// The Kana variation of the the individual's primary address (Japan only). + #[serde(skip_serializing_if = "Option::is_none")] + pub address_kana: Option>, + /// The Kanji variation of the the individual's primary address (Japan only). + #[serde(skip_serializing_if = "Option::is_none")] + pub address_kanji: Option>, + /// The individual's date of birth. + #[serde(skip_serializing_if = "Option::is_none")] + pub dob: Option, + /// The individual's email address. + #[serde(skip_serializing_if = "Option::is_none")] + pub email: Option<&'a str>, + /// The individual's first name. + #[serde(skip_serializing_if = "Option::is_none")] + pub first_name: Option<&'a str>, + /// The Kana variation of the the individual's first name (Japan only). + #[serde(skip_serializing_if = "Option::is_none")] + pub first_name_kana: Option<&'a str>, + /// The Kanji variation of the individual's first name (Japan only). + #[serde(skip_serializing_if = "Option::is_none")] + pub first_name_kanji: Option<&'a str>, + /// A list of alternate names or aliases that the individual is known by. + #[serde(skip_serializing_if = "Option::is_none")] + pub full_name_aliases: Option<&'a [&'a str]>, + /// The individual's gender (International regulations require either "male" or "female"). + #[serde(skip_serializing_if = "Option::is_none")] + pub gender: Option<&'a str>, + /// The government-issued ID number of the individual, as appropriate for the representative's country. + /// (Examples are a Social Security Number in the U.S., or a Social Insurance Number in Canada). + /// Instead of the number itself, you can also provide a [PII token created with Stripe.js](https://stripe.com/docs/js/tokens/create_token?type=pii). + #[serde(skip_serializing_if = "Option::is_none")] + pub id_number: Option<&'a str>, + /// The government-issued secondary ID number of the individual, as appropriate for the representative's country, will be used for enhanced verification checks. + /// In Thailand, this would be the laser code found on the back of an ID card. + /// Instead of the number itself, you can also provide a [PII token created with Stripe.js](https://stripe.com/docs/js/tokens/create_token?type=pii). + #[serde(skip_serializing_if = "Option::is_none")] + pub id_number_secondary: Option<&'a str>, + /// The individual's last name. + #[serde(skip_serializing_if = "Option::is_none")] + pub last_name: Option<&'a str>, + /// The Kana variation of the individual's last name (Japan only). + #[serde(skip_serializing_if = "Option::is_none")] + pub last_name_kana: Option<&'a str>, + /// The Kanji variation of the individual's last name (Japan only). + #[serde(skip_serializing_if = "Option::is_none")] + pub last_name_kanji: Option<&'a str>, + /// The individual's maiden name. + #[serde(skip_serializing_if = "Option::is_none")] + pub maiden_name: Option<&'a str>, + /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. + /// This can be useful for storing additional information about the object in a structured format. + /// Individual keys can be unset by posting an empty value to them. + /// All keys can be unset by posting an empty value to `metadata`. + #[serde(skip_serializing_if = "Option::is_none")] + pub metadata: Option<&'a std::collections::HashMap>, + /// The individual's phone number. + #[serde(skip_serializing_if = "Option::is_none")] + pub phone: Option<&'a str>, + /// Indicates if the person or any of their representatives, family members, or other closely related persons, declares that they hold or have held an important public job or function, in any jurisdiction. + #[serde(skip_serializing_if = "Option::is_none")] + pub political_exposure: Option, + /// The individual's registered address. + #[serde(skip_serializing_if = "Option::is_none")] + pub registered_address: Option>, + /// Describes the person’s relationship to the account. + #[serde(skip_serializing_if = "Option::is_none")] + pub relationship: Option>, + /// The last four digits of the individual's Social Security Number (U.S. only). + #[serde(skip_serializing_if = "Option::is_none")] + pub ssn_last_4: Option<&'a str>, + /// The individual's verification document information. + #[serde(skip_serializing_if = "Option::is_none")] + pub verification: Option>, +} +impl<'a> CreateTokenAccountIndividual<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// The Kana variation of the the individual's primary address (Japan only). +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreateTokenAccountIndividualAddressKana<'a> { + /// City or ward. + #[serde(skip_serializing_if = "Option::is_none")] + pub city: Option<&'a str>, + /// Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). + #[serde(skip_serializing_if = "Option::is_none")] + pub country: Option<&'a str>, + /// Block or building number. + #[serde(skip_serializing_if = "Option::is_none")] + pub line1: Option<&'a str>, + /// Building details. + #[serde(skip_serializing_if = "Option::is_none")] + pub line2: Option<&'a str>, + /// Postal code. + #[serde(skip_serializing_if = "Option::is_none")] + pub postal_code: Option<&'a str>, + /// Prefecture. + #[serde(skip_serializing_if = "Option::is_none")] + pub state: Option<&'a str>, + /// Town or cho-me. + #[serde(skip_serializing_if = "Option::is_none")] + pub town: Option<&'a str>, +} +impl<'a> CreateTokenAccountIndividualAddressKana<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// The Kanji variation of the the individual's primary address (Japan only). +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreateTokenAccountIndividualAddressKanji<'a> { + /// City or ward. + #[serde(skip_serializing_if = "Option::is_none")] + pub city: Option<&'a str>, + /// Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). + #[serde(skip_serializing_if = "Option::is_none")] + pub country: Option<&'a str>, + /// Block or building number. + #[serde(skip_serializing_if = "Option::is_none")] + pub line1: Option<&'a str>, + /// Building details. + #[serde(skip_serializing_if = "Option::is_none")] + pub line2: Option<&'a str>, + /// Postal code. + #[serde(skip_serializing_if = "Option::is_none")] + pub postal_code: Option<&'a str>, + /// Prefecture. + #[serde(skip_serializing_if = "Option::is_none")] + pub state: Option<&'a str>, + /// Town or cho-me. + #[serde(skip_serializing_if = "Option::is_none")] + pub town: Option<&'a str>, +} +impl<'a> CreateTokenAccountIndividualAddressKanji<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// Indicates if the person or any of their representatives, family members, or other closely related persons, declares that they hold or have held an important public job or function, in any jurisdiction. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreateTokenAccountIndividualPoliticalExposure { + Existing, + None, +} +impl CreateTokenAccountIndividualPoliticalExposure { + pub fn as_str(self) -> &'static str { + use CreateTokenAccountIndividualPoliticalExposure::*; + match self { + Existing => "existing", + None => "none", + } + } +} + +impl std::str::FromStr for CreateTokenAccountIndividualPoliticalExposure { + type Err = (); + fn from_str(s: &str) -> Result { + use CreateTokenAccountIndividualPoliticalExposure::*; + match s { + "existing" => Ok(Existing), + "none" => Ok(None), + _ => Err(()), + } + } +} +impl std::fmt::Display for CreateTokenAccountIndividualPoliticalExposure { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreateTokenAccountIndividualPoliticalExposure { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreateTokenAccountIndividualPoliticalExposure { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Describes the person’s relationship to the account. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreateTokenAccountIndividualRelationship<'a> { + /// Whether the person is a director of the account's legal entity. + /// Directors are typically members of the governing board of the company, or responsible for ensuring the company meets its regulatory obligations. + #[serde(skip_serializing_if = "Option::is_none")] + pub director: Option, + /// Whether the person has significant responsibility to control, manage, or direct the organization. + #[serde(skip_serializing_if = "Option::is_none")] + pub executive: Option, + /// Whether the person is an owner of the account’s legal entity. + #[serde(skip_serializing_if = "Option::is_none")] + pub owner: Option, + /// The percent owned by the person of the account's legal entity. + #[serde(skip_serializing_if = "Option::is_none")] + pub percent_ownership: Option, + /// The person's title (e.g., CEO, Support Engineer). + #[serde(skip_serializing_if = "Option::is_none")] + pub title: Option<&'a str>, +} +impl<'a> CreateTokenAccountIndividualRelationship<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// The bank account this token will represent. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreateTokenBankAccount<'a> { + /// The name of the person or business that owns the bank account.This field is required when attaching the bank account to a `Customer` object. + #[serde(skip_serializing_if = "Option::is_none")] + pub account_holder_name: Option<&'a str>, + /// The type of entity that holds the account. + /// It can be `company` or `individual`. + /// This field is required when attaching the bank account to a `Customer` object. + #[serde(skip_serializing_if = "Option::is_none")] + pub account_holder_type: Option, + /// The account number for the bank account, in string form. Must be a checking account. + pub account_number: &'a str, + /// The bank account type. + /// This can only be `checking` or `savings` in most countries. + /// In Japan, this can only be `futsu` or `toza`. + #[serde(skip_serializing_if = "Option::is_none")] + pub account_type: Option, + /// The country in which the bank account is located. + pub country: &'a str, + /// The currency the bank account is in. + /// This must be a country/currency pairing that [Stripe supports.](https://stripe.com/docs/payouts). + #[serde(skip_serializing_if = "Option::is_none")] + pub currency: Option, + /// The routing number, sort code, or other country-appropriateinstitution number for the bank account. + /// For US bank accounts, this is required and should bethe ACH routing number, not the wire routing number. + /// If you are providing an IBAN for`account_number`, this field is not required. + #[serde(skip_serializing_if = "Option::is_none")] + pub routing_number: Option<&'a str>, +} +impl<'a> CreateTokenBankAccount<'a> { + pub fn new(account_number: &'a str, country: &'a str) -> Self { + Self { + account_holder_name: None, + account_holder_type: None, + account_number, + account_type: None, + country, + currency: None, + routing_number: None, + } + } +} +/// The type of entity that holds the account. +/// It can be `company` or `individual`. +/// This field is required when attaching the bank account to a `Customer` object. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreateTokenBankAccountAccountHolderType { + Company, + Individual, +} +impl CreateTokenBankAccountAccountHolderType { + pub fn as_str(self) -> &'static str { + use CreateTokenBankAccountAccountHolderType::*; + match self { + Company => "company", + Individual => "individual", + } + } +} + +impl std::str::FromStr for CreateTokenBankAccountAccountHolderType { + type Err = (); + fn from_str(s: &str) -> Result { + use CreateTokenBankAccountAccountHolderType::*; + match s { + "company" => Ok(Company), + "individual" => Ok(Individual), + _ => Err(()), + } + } +} +impl std::fmt::Display for CreateTokenBankAccountAccountHolderType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreateTokenBankAccountAccountHolderType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreateTokenBankAccountAccountHolderType { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// The bank account type. +/// This can only be `checking` or `savings` in most countries. +/// In Japan, this can only be `futsu` or `toza`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreateTokenBankAccountAccountType { + Checking, + Futsu, + Savings, + Toza, +} +impl CreateTokenBankAccountAccountType { + pub fn as_str(self) -> &'static str { + use CreateTokenBankAccountAccountType::*; + match self { + Checking => "checking", + Futsu => "futsu", + Savings => "savings", + Toza => "toza", + } + } +} + +impl std::str::FromStr for CreateTokenBankAccountAccountType { + type Err = (); + fn from_str(s: &str) -> Result { + use CreateTokenBankAccountAccountType::*; + match s { + "checking" => Ok(Checking), + "futsu" => Ok(Futsu), + "savings" => Ok(Savings), + "toza" => Ok(Toza), + _ => Err(()), + } + } +} +impl std::fmt::Display for CreateTokenBankAccountAccountType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreateTokenBankAccountAccountType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreateTokenBankAccountAccountType { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// The card this token will represent. +/// If you also pass in a customer, the card must be the ID of a card belonging to the customer. +/// Otherwise, if you do not pass in a customer, this is a dictionary containing a user's credit card details, with the options described below. +#[derive(Copy, Clone, Debug, serde::Serialize)] +#[serde(untagged)] +pub enum CreateTokenCard<'a> { + CreditCardSpecs(CreateTokenCreditCardSpecs<'a>), + Str(&'a str), +} +/// The card this token will represent. +/// If you also pass in a customer, the card must be the ID of a card belonging to the customer. +/// Otherwise, if you do not pass in a customer, this is a dictionary containing a user's credit card details, with the options described below. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreateTokenCreditCardSpecs<'a> { + /// City / District / Suburb / Town / Village. + #[serde(skip_serializing_if = "Option::is_none")] + pub address_city: Option<&'a str>, + /// Billing address country, if provided. + #[serde(skip_serializing_if = "Option::is_none")] + pub address_country: Option<&'a str>, + /// Address line 1 (Street address / PO Box / Company name). + #[serde(skip_serializing_if = "Option::is_none")] + pub address_line1: Option<&'a str>, + /// Address line 2 (Apartment / Suite / Unit / Building). + #[serde(skip_serializing_if = "Option::is_none")] + pub address_line2: Option<&'a str>, + /// State / County / Province / Region. + #[serde(skip_serializing_if = "Option::is_none")] + pub address_state: Option<&'a str>, + /// ZIP or postal code. + #[serde(skip_serializing_if = "Option::is_none")] + pub address_zip: Option<&'a str>, + /// Required in order to add the card to an account; in all other cases, this parameter is not used. + /// When added to an account, the card (which must be a debit card) can be used as a transfer destination for funds in this currency. + #[serde(skip_serializing_if = "Option::is_none")] + pub currency: Option, + /// Card security code. Highly recommended to always include this value. + #[serde(skip_serializing_if = "Option::is_none")] + pub cvc: Option<&'a str>, + /// Two-digit number representing the card's expiration month. + pub exp_month: &'a str, + /// Two- or four-digit number representing the card's expiration year. + pub exp_year: &'a str, + /// Cardholder's full name. + #[serde(skip_serializing_if = "Option::is_none")] + pub name: Option<&'a str>, + /// The card number, as a string without any separators. + pub number: &'a str, +} +impl<'a> CreateTokenCreditCardSpecs<'a> { + pub fn new(exp_month: &'a str, exp_year: &'a str, number: &'a str) -> Self { + Self { + address_city: None, + address_country: None, + address_line1: None, + address_line2: None, + address_state: None, + address_zip: None, + currency: None, + cvc: None, + exp_month, + exp_year, + name: None, + number, + } + } +} +/// The updated CVC value this token represents. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreateTokenCvcUpdate<'a> { + /// The CVC value, in string form. + pub cvc: &'a str, +} +impl<'a> CreateTokenCvcUpdate<'a> { + pub fn new(cvc: &'a str) -> Self { + Self { cvc } + } +} +/// Information for the person this token represents. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreateTokenPerson<'a> { + /// Details on the legal guardian's acceptance of the required Stripe agreements. + #[serde(skip_serializing_if = "Option::is_none")] + pub additional_tos_acceptances: Option>, + /// The person's address. + #[serde(skip_serializing_if = "Option::is_none")] + pub address: Option>, + /// The Kana variation of the person's address (Japan only). + #[serde(skip_serializing_if = "Option::is_none")] + pub address_kana: Option>, + /// The Kanji variation of the person's address (Japan only). + #[serde(skip_serializing_if = "Option::is_none")] + pub address_kanji: Option>, + /// The person's date of birth. + #[serde(skip_serializing_if = "Option::is_none")] + pub dob: Option, + /// Documents that may be submitted to satisfy various informational requests. + #[serde(skip_serializing_if = "Option::is_none")] + pub documents: Option>, + /// The person's email address. + #[serde(skip_serializing_if = "Option::is_none")] + pub email: Option<&'a str>, + /// The person's first name. + #[serde(skip_serializing_if = "Option::is_none")] + pub first_name: Option<&'a str>, + /// The Kana variation of the person's first name (Japan only). + #[serde(skip_serializing_if = "Option::is_none")] + pub first_name_kana: Option<&'a str>, + /// The Kanji variation of the person's first name (Japan only). + #[serde(skip_serializing_if = "Option::is_none")] + pub first_name_kanji: Option<&'a str>, + /// A list of alternate names or aliases that the person is known by. + #[serde(skip_serializing_if = "Option::is_none")] + pub full_name_aliases: Option<&'a [&'a str]>, + /// The person's gender (International regulations require either "male" or "female"). + #[serde(skip_serializing_if = "Option::is_none")] + pub gender: Option<&'a str>, + /// The person's ID number, as appropriate for their country. + /// For example, a social security number in the U.S., social insurance number in Canada, etc. + /// Instead of the number itself, you can also provide a [PII token provided by Stripe.js](https://stripe.com/docs/js/tokens/create_token?type=pii). + #[serde(skip_serializing_if = "Option::is_none")] + pub id_number: Option<&'a str>, + /// The person's secondary ID number, as appropriate for their country, will be used for enhanced verification checks. + /// In Thailand, this would be the laser code found on the back of an ID card. + /// Instead of the number itself, you can also provide a [PII token provided by Stripe.js](https://stripe.com/docs/js/tokens/create_token?type=pii). + #[serde(skip_serializing_if = "Option::is_none")] + pub id_number_secondary: Option<&'a str>, + /// The person's last name. + #[serde(skip_serializing_if = "Option::is_none")] + pub last_name: Option<&'a str>, + /// The Kana variation of the person's last name (Japan only). + #[serde(skip_serializing_if = "Option::is_none")] + pub last_name_kana: Option<&'a str>, + /// The Kanji variation of the person's last name (Japan only). + #[serde(skip_serializing_if = "Option::is_none")] + pub last_name_kanji: Option<&'a str>, + /// The person's maiden name. + #[serde(skip_serializing_if = "Option::is_none")] + pub maiden_name: Option<&'a str>, + /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. + /// This can be useful for storing additional information about the object in a structured format. + /// Individual keys can be unset by posting an empty value to them. + /// All keys can be unset by posting an empty value to `metadata`. + #[serde(skip_serializing_if = "Option::is_none")] + pub metadata: Option<&'a std::collections::HashMap>, + /// The country where the person is a national. + /// Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)), or "XX" if unavailable. + #[serde(skip_serializing_if = "Option::is_none")] + pub nationality: Option<&'a str>, + /// The person's phone number. + #[serde(skip_serializing_if = "Option::is_none")] + pub phone: Option<&'a str>, + /// Indicates if the person or any of their representatives, family members, or other closely related persons, declares that they hold or have held an important public job or function, in any jurisdiction. + #[serde(skip_serializing_if = "Option::is_none")] + pub political_exposure: Option<&'a str>, + /// The person's registered address. + #[serde(skip_serializing_if = "Option::is_none")] + pub registered_address: Option>, + /// The relationship that this person has with the account's legal entity. + #[serde(skip_serializing_if = "Option::is_none")] + pub relationship: Option>, + /// The last four digits of the person's Social Security number (U.S. only). + #[serde(skip_serializing_if = "Option::is_none")] + pub ssn_last_4: Option<&'a str>, + /// The person's verification status. + #[serde(skip_serializing_if = "Option::is_none")] + pub verification: Option>, +} +impl<'a> CreateTokenPerson<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// Details on the legal guardian's acceptance of the required Stripe agreements. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreateTokenPersonAdditionalTosAcceptances<'a> { + /// Details on the legal guardian's acceptance of the main Stripe service agreement. + #[serde(skip_serializing_if = "Option::is_none")] + pub account: Option>, +} +impl<'a> CreateTokenPersonAdditionalTosAcceptances<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// Details on the legal guardian's acceptance of the main Stripe service agreement. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreateTokenPersonAdditionalTosAcceptancesAccount<'a> { + /// The Unix timestamp marking when the account representative accepted the service agreement. + #[serde(skip_serializing_if = "Option::is_none")] + pub date: Option, + /// The IP address from which the account representative accepted the service agreement. + #[serde(skip_serializing_if = "Option::is_none")] + pub ip: Option<&'a str>, + /// The user agent of the browser from which the account representative accepted the service agreement. + #[serde(skip_serializing_if = "Option::is_none")] + pub user_agent: Option<&'a str>, +} +impl<'a> CreateTokenPersonAdditionalTosAcceptancesAccount<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// The Kana variation of the person's address (Japan only). +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreateTokenPersonAddressKana<'a> { + /// City or ward. + #[serde(skip_serializing_if = "Option::is_none")] + pub city: Option<&'a str>, + /// Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). + #[serde(skip_serializing_if = "Option::is_none")] + pub country: Option<&'a str>, + /// Block or building number. + #[serde(skip_serializing_if = "Option::is_none")] + pub line1: Option<&'a str>, + /// Building details. + #[serde(skip_serializing_if = "Option::is_none")] + pub line2: Option<&'a str>, + /// Postal code. + #[serde(skip_serializing_if = "Option::is_none")] + pub postal_code: Option<&'a str>, + /// Prefecture. + #[serde(skip_serializing_if = "Option::is_none")] + pub state: Option<&'a str>, + /// Town or cho-me. + #[serde(skip_serializing_if = "Option::is_none")] + pub town: Option<&'a str>, +} +impl<'a> CreateTokenPersonAddressKana<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// The Kanji variation of the person's address (Japan only). +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreateTokenPersonAddressKanji<'a> { + /// City or ward. + #[serde(skip_serializing_if = "Option::is_none")] + pub city: Option<&'a str>, + /// Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). + #[serde(skip_serializing_if = "Option::is_none")] + pub country: Option<&'a str>, + /// Block or building number. + #[serde(skip_serializing_if = "Option::is_none")] + pub line1: Option<&'a str>, + /// Building details. + #[serde(skip_serializing_if = "Option::is_none")] + pub line2: Option<&'a str>, + /// Postal code. + #[serde(skip_serializing_if = "Option::is_none")] + pub postal_code: Option<&'a str>, + /// Prefecture. + #[serde(skip_serializing_if = "Option::is_none")] + pub state: Option<&'a str>, + /// Town or cho-me. + #[serde(skip_serializing_if = "Option::is_none")] + pub town: Option<&'a str>, +} +impl<'a> CreateTokenPersonAddressKanji<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// Documents that may be submitted to satisfy various informational requests. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreateTokenPersonDocuments<'a> { + /// One or more documents that demonstrate proof that this person is authorized to represent the company. + #[serde(skip_serializing_if = "Option::is_none")] + pub company_authorization: Option>, + /// One or more documents showing the person's passport page with photo and personal data. + #[serde(skip_serializing_if = "Option::is_none")] + pub passport: Option>, + /// One or more documents showing the person's visa required for living in the country where they are residing. + #[serde(skip_serializing_if = "Option::is_none")] + pub visa: Option>, +} +impl<'a> CreateTokenPersonDocuments<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// The relationship that this person has with the account's legal entity. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreateTokenPersonRelationship<'a> { + /// Whether the person is a director of the account's legal entity. + /// Directors are typically members of the governing board of the company, or responsible for ensuring the company meets its regulatory obligations. + #[serde(skip_serializing_if = "Option::is_none")] + pub director: Option, + /// Whether the person has significant responsibility to control, manage, or direct the organization. + #[serde(skip_serializing_if = "Option::is_none")] + pub executive: Option, + /// Whether the person is the legal guardian of the account's representative. + #[serde(skip_serializing_if = "Option::is_none")] + pub legal_guardian: Option, + /// Whether the person is an owner of the account’s legal entity. + #[serde(skip_serializing_if = "Option::is_none")] + pub owner: Option, + /// The percent owned by the person of the account's legal entity. + #[serde(skip_serializing_if = "Option::is_none")] + pub percent_ownership: Option, + /// Whether the person is authorized as the primary representative of the account. + /// This is the person nominated by the business to provide information about themselves, and general information about the account. + /// There can only be one representative at any given time. + /// At the time the account is created, this person should be set to the person responsible for opening the account. + #[serde(skip_serializing_if = "Option::is_none")] + pub representative: Option, + /// The person's title (e.g., CEO, Support Engineer). + #[serde(skip_serializing_if = "Option::is_none")] + pub title: Option<&'a str>, +} +impl<'a> CreateTokenPersonRelationship<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// The PII this token represents. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreateTokenPii<'a> { + /// The `id_number` for the PII, in string form. + #[serde(skip_serializing_if = "Option::is_none")] + pub id_number: Option<&'a str>, +} +impl<'a> CreateTokenPii<'a> { + pub fn new() -> Self { + Self::default() + } +} +impl<'a> CreateToken<'a> { + /// Creates a single-use token that represents a bank account’s details. + /// You can use this token with any API method in place of a bank account dictionary. + /// You can only use this token once. + /// To do so, attach it to a [Custom account](https://stripe.com/docs/api#accounts). + pub fn send(&self, client: &stripe::Client) -> stripe::Response { + client.send_form("/tokens", self, http_types::Method::Post) + } +} +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct AddressSpecs<'a> { + /// City, district, suburb, town, or village. + #[serde(skip_serializing_if = "Option::is_none")] + pub city: Option<&'a str>, + /// Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). + #[serde(skip_serializing_if = "Option::is_none")] + pub country: Option<&'a str>, + /// Address line 1 (e.g., street, PO Box, or company name). + #[serde(skip_serializing_if = "Option::is_none")] + pub line1: Option<&'a str>, + /// Address line 2 (e.g., apartment, suite, unit, or building). + #[serde(skip_serializing_if = "Option::is_none")] + pub line2: Option<&'a str>, + /// ZIP or postal code. + #[serde(skip_serializing_if = "Option::is_none")] + pub postal_code: Option<&'a str>, + /// State, county, province, or region. + #[serde(skip_serializing_if = "Option::is_none")] + pub state: Option<&'a str>, +} +impl<'a> AddressSpecs<'a> { + pub fn new() -> Self { + Self::default() + } +} +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct DateOfBirthSpecs { + /// The day of birth, between 1 and 31. + pub day: i64, + /// The month of birth, between 1 and 12. + pub month: i64, + /// The four-digit year of birth. + pub year: i64, +} +impl DateOfBirthSpecs { + pub fn new(day: i64, month: i64, year: i64) -> Self { + Self { day, month, year } + } +} +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct PersonVerificationDocumentSpecs<'a> { + /// The back of an ID returned by a [file upload](https://stripe.com/docs/api#create_file) with a `purpose` value of `identity_document`. + /// The uploaded file needs to be a color image (smaller than 8,000px by 8,000px), in JPG, PNG, or PDF format, and less than 10 MB in size. + #[serde(skip_serializing_if = "Option::is_none")] + pub back: Option<&'a str>, + /// The front of an ID returned by a [file upload](https://stripe.com/docs/api#create_file) with a `purpose` value of `identity_document`. + /// The uploaded file needs to be a color image (smaller than 8,000px by 8,000px), in JPG, PNG, or PDF format, and less than 10 MB in size. + #[serde(skip_serializing_if = "Option::is_none")] + pub front: Option<&'a str>, +} +impl<'a> PersonVerificationDocumentSpecs<'a> { + pub fn new() -> Self { + Self::default() + } +} +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct DocumentsParam<'a> { + /// One or more document ids returned by a [file upload](https://stripe.com/docs/api#create_file) with a `purpose` value of `account_requirement`. + #[serde(skip_serializing_if = "Option::is_none")] + pub files: Option<&'a [&'a str]>, +} +impl<'a> DocumentsParam<'a> { + pub fn new() -> Self { + Self::default() + } +} +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct PersonVerificationSpecs<'a> { + /// A document showing address, either a passport, local ID card, or utility bill from a well-known utility company. + #[serde(skip_serializing_if = "Option::is_none")] + pub additional_document: Option>, + /// An identifying document, either a passport or local ID card. + #[serde(skip_serializing_if = "Option::is_none")] + pub document: Option>, +} +impl<'a> PersonVerificationSpecs<'a> { + pub fn new() -> Self { + Self::default() + } +} diff --git a/generated/stripe_core/src/token/types.rs b/generated/stripe_core/src/token/types.rs new file mode 100644 index 000000000..384f47e6c --- /dev/null +++ b/generated/stripe_core/src/token/types.rs @@ -0,0 +1,49 @@ +/// Tokenization is the process Stripe uses to collect sensitive card or bank +/// account details, or personally identifiable information (PII), directly from +/// your customers in a secure manner. A token representing this information is +/// returned to your server to use. Use our +/// [recommended payments integrations](https://stripe.com/docs/payments) to perform this process +/// on the client-side. This guarantees that no sensitive card data touches your server, +/// and allows your integration to operate in a PCI-compliant way. +/// +/// If you can't use client-side tokenization, you can also create tokens using +/// the API with either your publishable or secret API key. If +/// your integration uses this method, you're responsible for any PCI compliance +/// that it might require, and you must keep your secret API key safe. Unlike with +/// client-side tokenization, your customer's information isn't sent directly to +/// Stripe, so we can't determine how it's handled or stored. +/// +/// You can't store or use tokens more than once. To store card or bank account +/// information for later use, create [Customer](https://stripe.com/docs/api#customers) +/// objects or [Custom accounts](https://stripe.com/docs/api#external_accounts). +/// [Radar](https://stripe.com/docs/radar), our integrated solution for automatic fraud protection, +/// performs best with integrations that use client-side tokenization. +/// +/// For more details see <>. +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct Token { + #[serde(skip_serializing_if = "Option::is_none")] + pub bank_account: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub card: Option, + /// IP address of the client that generates the token. + pub client_ip: Option, + /// Time at which the object was created. Measured in seconds since the Unix epoch. + pub created: stripe_types::Timestamp, + /// Unique identifier for the object. + pub id: stripe_core::TokenId, + /// Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + pub livemode: bool, + /// Type of the token: `account`, `bank_account`, `card`, or `pii`. + #[serde(rename = "type")] + pub type_: String, + /// Determines if you have already used this token (you can only use tokens once). + pub used: bool, +} +impl stripe_types::Object for Token { + type Id = stripe_core::TokenId; + fn id(&self) -> &Self::Id { + &self.id + } +} +stripe_types::def_id!(TokenId); diff --git a/generated/stripe_fraud/Cargo.toml b/generated/stripe_fraud/Cargo.toml new file mode 100644 index 000000000..98787509d --- /dev/null +++ b/generated/stripe_fraud/Cargo.toml @@ -0,0 +1,52 @@ +[package] +name = "stripe_fraud" +version.workspace = true +description.workspace = true +edition.workspace = true +rust-version.workspace = true +authors.workspace = true +license.workspace = true +homepage.workspace = true +repository.workspace = true +keywords.workspace = true +categories.workspace = true + +[lib] +path = "src/mod.rs" + +[dependencies] +serde.workspace = true +smol_str.workspace = true +serde_json.workspace = true +stripe_types = {path = "../../stripe_types"} + +http-types.workspace = true +async-stripe = {path = "../../async-stripe"} + + +stripe_shared = {path = "../../generated/stripe_shared"} + + +[features] +runtime-tokio-hyper = ["async-stripe/runtime-tokio-hyper"] +runtime-tokio-hyper-rustls = ["async-stripe/runtime-tokio-hyper-rustls"] +runtime-tokio-hyper-rustls-webpki = ["async-stripe/runtime-tokio-hyper-rustls-webpki"] +runtime-blocking = ["async-stripe/runtime-blocking"] +runtime-blocking-rustls = ["async-stripe/runtime-blocking-rustls"] +runtime-blocking-rustls-webpki = ["async-stripe/runtime-blocking-rustls-webpki"] +runtime-async-std-surf = ["async-stripe/runtime-async-std-surf"] + +radar_early_fraud_warning = [] +radar_value_list = [] +radar_value_list_item = [] +review = [] + +full = ["radar_early_fraud_warning", +"radar_value_list", +"radar_value_list_item", +"review"] + + +[package.metadata.docs.rs] +features = ["runtime-tokio-hyper", "full"] + diff --git a/generated/stripe_fraud/src/deleted_radar_value_list.rs b/generated/stripe_fraud/src/deleted_radar_value_list.rs new file mode 100644 index 000000000..ea2008599 --- /dev/null +++ b/generated/stripe_fraud/src/deleted_radar_value_list.rs @@ -0,0 +1,13 @@ +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct DeletedRadarValueList { + /// Always true for a deleted object + deleted: stripe_types::AlwaysTrue, + /// Unique identifier for the object. + pub id: stripe_fraud::RadarValueListId, +} +impl stripe_types::Object for DeletedRadarValueList { + type Id = stripe_fraud::RadarValueListId; + fn id(&self) -> &Self::Id { + &self.id + } +} diff --git a/generated/stripe_fraud/src/deleted_radar_value_list_item.rs b/generated/stripe_fraud/src/deleted_radar_value_list_item.rs new file mode 100644 index 000000000..970a1e13a --- /dev/null +++ b/generated/stripe_fraud/src/deleted_radar_value_list_item.rs @@ -0,0 +1,13 @@ +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct DeletedRadarValueListItem { + /// Always true for a deleted object + deleted: stripe_types::AlwaysTrue, + /// Unique identifier for the object. + pub id: stripe_fraud::RadarValueListItemId, +} +impl stripe_types::Object for DeletedRadarValueListItem { + type Id = stripe_fraud::RadarValueListItemId; + fn id(&self) -> &Self::Id { + &self.id + } +} diff --git a/generated/stripe_fraud/src/mod.rs b/generated/stripe_fraud/src/mod.rs new file mode 100644 index 000000000..a578f3a4e --- /dev/null +++ b/generated/stripe_fraud/src/mod.rs @@ -0,0 +1,28 @@ +#![recursion_limit = "256"] +#![allow(clippy::large_enum_variant)] +#![allow(rustdoc::broken_intra_doc_links)] +#![allow(rustdoc::invalid_html_tags)] + +//! This crate provides Rust bindings to the Stripe HTTP API, specifically +//! for requests mentioned in the `Fraud` section of the [Stripe API docs](https://stripe.com/docs/api) + +extern crate self as stripe_fraud; +#[doc(hidden)] +pub mod deleted_radar_value_list; +#[doc(inline)] +pub use deleted_radar_value_list::*; +#[doc(hidden)] +pub mod deleted_radar_value_list_item; +#[doc(inline)] +pub use deleted_radar_value_list_item::*; +pub use radar_early_fraud_warning::types::*; +pub mod radar_early_fraud_warning; +pub use radar_value_list::types::*; +pub mod radar_value_list; +pub use radar_value_list_item::types::*; +pub mod radar_value_list_item; +pub use stripe_shared::radar_review_resource_location::*; +pub use stripe_shared::radar_review_resource_session::*; +pub mod review; +pub use stripe_shared::review::*; +pub use stripe_shared::rule::*; diff --git a/generated/stripe_fraud/src/radar_early_fraud_warning/mod.rs b/generated/stripe_fraud/src/radar_early_fraud_warning/mod.rs new file mode 100644 index 000000000..e66f30b0b --- /dev/null +++ b/generated/stripe_fraud/src/radar_early_fraud_warning/mod.rs @@ -0,0 +1,5 @@ +#[cfg(feature = "radar_early_fraud_warning")] +mod requests; +pub(crate) mod types; +#[cfg(feature = "radar_early_fraud_warning")] +pub use requests::*; diff --git a/generated/stripe_fraud/src/radar_early_fraud_warning/requests.rs b/generated/stripe_fraud/src/radar_early_fraud_warning/requests.rs new file mode 100644 index 000000000..c98fb6961 --- /dev/null +++ b/generated/stripe_fraud/src/radar_early_fraud_warning/requests.rs @@ -0,0 +1,71 @@ +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct ListRadarEarlyFraudWarning<'a> { + /// Only return early fraud warnings for the charge specified by this charge ID. + #[serde(skip_serializing_if = "Option::is_none")] + pub charge: Option<&'a str>, + /// Only return early fraud warnings that were created during the given date interval. + #[serde(skip_serializing_if = "Option::is_none")] + pub created: Option, + /// A cursor for use in pagination. + /// `ending_before` is an object ID that defines your place in the list. + /// For instance, if you make a list request and receive 100 objects, starting with `obj_bar`, your subsequent call can include `ending_before=obj_bar` in order to fetch the previous page of the list. + #[serde(skip_serializing_if = "Option::is_none")] + pub ending_before: Option<&'a str>, + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, + /// A limit on the number of objects to be returned. + /// Limit can range between 1 and 100, and the default is 10. + #[serde(skip_serializing_if = "Option::is_none")] + pub limit: Option, + /// Only return early fraud warnings for charges that were created by the PaymentIntent specified by this PaymentIntent ID. + #[serde(skip_serializing_if = "Option::is_none")] + pub payment_intent: Option<&'a str>, + /// A cursor for use in pagination. + /// `starting_after` is an object ID that defines your place in the list. + /// For instance, if you make a list request and receive 100 objects, ending with `obj_foo`, your subsequent call can include `starting_after=obj_foo` in order to fetch the next page of the list. + #[serde(skip_serializing_if = "Option::is_none")] + pub starting_after: Option<&'a str>, +} +impl<'a> ListRadarEarlyFraudWarning<'a> { + pub fn new() -> Self { + Self::default() + } +} +impl<'a> ListRadarEarlyFraudWarning<'a> { + /// Returns a list of early fraud warnings. + pub fn send( + &self, + client: &stripe::Client, + ) -> stripe::Response> { + client.get_query("/radar/early_fraud_warnings", self) + } + pub fn paginate( + self, + ) -> stripe::ListPaginator> { + stripe::ListPaginator::from_list_params("/radar/early_fraud_warnings", self) + } +} +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct RetrieveRadarEarlyFraudWarning<'a> { + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, +} +impl<'a> RetrieveRadarEarlyFraudWarning<'a> { + pub fn new() -> Self { + Self::default() + } +} +impl<'a> RetrieveRadarEarlyFraudWarning<'a> { + /// Retrieves the details of an early fraud warning that has previously been created. + /// + /// Please refer to the [early fraud warning](https://stripe.com/docs/api#early_fraud_warning_object) object reference for more details. + pub fn send( + &self, + client: &stripe::Client, + early_fraud_warning: &stripe_fraud::RadarEarlyFraudWarningId, + ) -> stripe::Response { + client.get_query(&format!("/radar/early_fraud_warnings/{early_fraud_warning}"), self) + } +} diff --git a/src/resources/generated/radar_early_fraud_warning.rs b/generated/stripe_fraud/src/radar_early_fraud_warning/types.rs similarity index 50% rename from src/resources/generated/radar_early_fraud_warning.rs rename to generated/stripe_fraud/src/radar_early_fraud_warning/types.rs index 2818d0c4d..2c4a2aac7 100644 --- a/src/resources/generated/radar_early_fraud_warning.rs +++ b/generated/stripe_fraud/src/radar_early_fraud_warning/types.rs @@ -1,50 +1,31 @@ -// ====================================== -// This file was automatically generated. -// ====================================== - -use crate::ids::{RadarEarlyFraudWarningId}; -use crate::params::{Expandable, Object, Timestamp}; -use crate::resources::{Charge, PaymentIntent}; -use serde::{Deserialize, Serialize}; - -/// The resource representing a Stripe "RadarEarlyFraudWarning". -#[derive(Clone, Debug, Default, Deserialize, Serialize)] +/// An early fraud warning indicates that the card issuer has notified us that a +/// charge may be fraudulent. +/// +/// Related guide: [Early fraud warnings](https://stripe.com/docs/disputes/measuring#early-fraud-warnings). +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] pub struct RadarEarlyFraudWarning { - /// Unique identifier for the object. - pub id: RadarEarlyFraudWarningId, - /// An EFW is actionable if it has not received a dispute and has not been fully refunded. - /// /// You may wish to proactively refund a charge that receives an EFW, in order to avoid receiving a dispute later. pub actionable: bool, - /// ID of the charge this early fraud warning is for, optionally expanded. - pub charge: Expandable, - - /// Time at which the object was created. - /// - /// Measured in seconds since the Unix epoch. - pub created: Timestamp, - + pub charge: stripe_types::Expandable, + /// Time at which the object was created. Measured in seconds since the Unix epoch. + pub created: stripe_types::Timestamp, /// The type of fraud labelled by the issuer. - /// /// One of `card_never_received`, `fraudulent_card_application`, `made_with_counterfeit_card`, `made_with_lost_card`, `made_with_stolen_card`, `misc`, `unauthorized_use_of_card`. pub fraud_type: String, - + /// Unique identifier for the object. + pub id: stripe_fraud::RadarEarlyFraudWarningId, /// Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. pub livemode: bool, - /// ID of the Payment Intent this early fraud warning is for, optionally expanded. #[serde(skip_serializing_if = "Option::is_none")] - pub payment_intent: Option>, + pub payment_intent: Option>, } - -impl Object for RadarEarlyFraudWarning { - type Id = RadarEarlyFraudWarningId; - fn id(&self) -> Self::Id { - self.id.clone() - } - fn object(&self) -> &'static str { - "radar.early_fraud_warning" +impl stripe_types::Object for RadarEarlyFraudWarning { + type Id = stripe_fraud::RadarEarlyFraudWarningId; + fn id(&self) -> &Self::Id { + &self.id } } +stripe_types::def_id!(RadarEarlyFraudWarningId); diff --git a/generated/stripe_fraud/src/radar_value_list/mod.rs b/generated/stripe_fraud/src/radar_value_list/mod.rs new file mode 100644 index 000000000..f2a314150 --- /dev/null +++ b/generated/stripe_fraud/src/radar_value_list/mod.rs @@ -0,0 +1,5 @@ +#[cfg(feature = "radar_value_list")] +mod requests; +pub(crate) mod types; +#[cfg(feature = "radar_value_list")] +pub use requests::*; diff --git a/generated/stripe_fraud/src/radar_value_list/requests.rs b/generated/stripe_fraud/src/radar_value_list/requests.rs new file mode 100644 index 000000000..a6655f0d3 --- /dev/null +++ b/generated/stripe_fraud/src/radar_value_list/requests.rs @@ -0,0 +1,162 @@ +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct DeleteRadarValueList {} +impl DeleteRadarValueList { + pub fn new() -> Self { + Self::default() + } +} +impl DeleteRadarValueList { + /// Deletes a `ValueList` object, also deleting any items contained within the value list. + /// To be deleted, a value list must not be referenced in any rules. + pub fn send( + &self, + client: &stripe::Client, + value_list: &stripe_fraud::RadarValueListId, + ) -> stripe::Response { + client.send_form( + &format!("/radar/value_lists/{value_list}"), + self, + http_types::Method::Delete, + ) + } +} +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct ListRadarValueList<'a> { + /// The alias used to reference the value list when writing rules. + #[serde(skip_serializing_if = "Option::is_none")] + pub alias: Option<&'a str>, + /// A value contained within a value list - returns all value lists containing this value. + #[serde(skip_serializing_if = "Option::is_none")] + pub contains: Option<&'a str>, + #[serde(skip_serializing_if = "Option::is_none")] + pub created: Option, + /// A cursor for use in pagination. + /// `ending_before` is an object ID that defines your place in the list. + /// For instance, if you make a list request and receive 100 objects, starting with `obj_bar`, your subsequent call can include `ending_before=obj_bar` in order to fetch the previous page of the list. + #[serde(skip_serializing_if = "Option::is_none")] + pub ending_before: Option<&'a str>, + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, + /// A limit on the number of objects to be returned. + /// Limit can range between 1 and 100, and the default is 10. + #[serde(skip_serializing_if = "Option::is_none")] + pub limit: Option, + /// A cursor for use in pagination. + /// `starting_after` is an object ID that defines your place in the list. + /// For instance, if you make a list request and receive 100 objects, ending with `obj_foo`, your subsequent call can include `starting_after=obj_foo` in order to fetch the next page of the list. + #[serde(skip_serializing_if = "Option::is_none")] + pub starting_after: Option<&'a str>, +} +impl<'a> ListRadarValueList<'a> { + pub fn new() -> Self { + Self::default() + } +} +impl<'a> ListRadarValueList<'a> { + /// Returns a list of `ValueList` objects. + /// The objects are sorted in descending order by creation date, with the most recently created object appearing first. + pub fn send( + &self, + client: &stripe::Client, + ) -> stripe::Response> { + client.get_query("/radar/value_lists", self) + } + pub fn paginate( + self, + ) -> stripe::ListPaginator> { + stripe::ListPaginator::from_list_params("/radar/value_lists", self) + } +} +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct RetrieveRadarValueList<'a> { + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, +} +impl<'a> RetrieveRadarValueList<'a> { + pub fn new() -> Self { + Self::default() + } +} +impl<'a> RetrieveRadarValueList<'a> { + /// Retrieves a `ValueList` object. + pub fn send( + &self, + client: &stripe::Client, + value_list: &stripe_fraud::RadarValueListId, + ) -> stripe::Response { + client.get_query(&format!("/radar/value_lists/{value_list}"), self) + } +} +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreateRadarValueList<'a> { + /// The name of the value list for use in rules. + pub alias: &'a str, + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, + /// Type of the items in the value list. + /// One of `card_fingerprint`, `us_bank_account_fingerprint`, `sepa_debit_fingerprint`, `card_bin`, `email`, `ip_address`, `country`, `string`, `case_sensitive_string`, or `customer_id`. + /// Use `string` if the item type is unknown or mixed. + #[serde(skip_serializing_if = "Option::is_none")] + pub item_type: Option, + /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. + /// This can be useful for storing additional information about the object in a structured format. + /// Individual keys can be unset by posting an empty value to them. + /// All keys can be unset by posting an empty value to `metadata`. + #[serde(skip_serializing_if = "Option::is_none")] + pub metadata: Option<&'a std::collections::HashMap>, + /// The human-readable name of the value list. + pub name: &'a str, +} +impl<'a> CreateRadarValueList<'a> { + pub fn new(alias: &'a str, name: &'a str) -> Self { + Self { alias, expand: None, item_type: None, metadata: None, name } + } +} +impl<'a> CreateRadarValueList<'a> { + /// Creates a new `ValueList` object, which can then be referenced in rules. + pub fn send(&self, client: &stripe::Client) -> stripe::Response { + client.send_form("/radar/value_lists", self, http_types::Method::Post) + } +} +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdateRadarValueList<'a> { + /// The name of the value list for use in rules. + #[serde(skip_serializing_if = "Option::is_none")] + pub alias: Option<&'a str>, + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, + /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. + /// This can be useful for storing additional information about the object in a structured format. + /// Individual keys can be unset by posting an empty value to them. + /// All keys can be unset by posting an empty value to `metadata`. + #[serde(skip_serializing_if = "Option::is_none")] + pub metadata: Option<&'a std::collections::HashMap>, + /// The human-readable name of the value list. + #[serde(skip_serializing_if = "Option::is_none")] + pub name: Option<&'a str>, +} +impl<'a> UpdateRadarValueList<'a> { + pub fn new() -> Self { + Self::default() + } +} +impl<'a> UpdateRadarValueList<'a> { + /// Updates a `ValueList` object by setting the values of the parameters passed. + /// Any parameters not provided will be left unchanged. + /// Note that `item_type` is immutable. + pub fn send( + &self, + client: &stripe::Client, + value_list: &stripe_fraud::RadarValueListId, + ) -> stripe::Response { + client.send_form( + &format!("/radar/value_lists/{value_list}"), + self, + http_types::Method::Post, + ) + } +} diff --git a/generated/stripe_fraud/src/radar_value_list/types.rs b/generated/stripe_fraud/src/radar_value_list/types.rs new file mode 100644 index 000000000..0039ce9cf --- /dev/null +++ b/generated/stripe_fraud/src/radar_value_list/types.rs @@ -0,0 +1,112 @@ +/// Value lists allow you to group values together which can then be referenced in rules. +/// +/// Related guide: [Default Stripe lists](https://stripe.com/docs/radar/lists#managing-list-items) +/// +/// For more details see <>. +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct RadarValueList { + /// The name of the value list for use in rules. + pub alias: String, + /// Time at which the object was created. Measured in seconds since the Unix epoch. + pub created: stripe_types::Timestamp, + /// The name or email address of the user who created this value list. + pub created_by: String, + /// Unique identifier for the object. + pub id: stripe_fraud::RadarValueListId, + /// The type of items in the value list. + /// One of `card_fingerprint`, `us_bank_account_fingerprint`, `sepa_debit_fingerprint`, `card_bin`, `email`, `ip_address`, `country`, `string`, `case_sensitive_string`, or `customer_id`. + pub item_type: stripe_fraud::RadarValueListItemType, + /// List of items contained within this value list. + pub list_items: stripe_types::List, + /// Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + pub livemode: bool, + /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. + /// This can be useful for storing additional information about the object in a structured format. + pub metadata: std::collections::HashMap, + /// The name of the value list. + pub name: String, +} +impl stripe_types::Object for RadarValueList { + type Id = stripe_fraud::RadarValueListId; + fn id(&self) -> &Self::Id { + &self.id + } +} +stripe_types::def_id!(RadarValueListId); +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum RadarValueListItemType { + CardBin, + CardFingerprint, + CaseSensitiveString, + Country, + CustomerId, + Email, + IpAddress, + SepaDebitFingerprint, + String, + UsBankAccountFingerprint, +} +impl RadarValueListItemType { + pub fn as_str(self) -> &'static str { + use RadarValueListItemType::*; + match self { + CardBin => "card_bin", + CardFingerprint => "card_fingerprint", + CaseSensitiveString => "case_sensitive_string", + Country => "country", + CustomerId => "customer_id", + Email => "email", + IpAddress => "ip_address", + SepaDebitFingerprint => "sepa_debit_fingerprint", + String => "string", + UsBankAccountFingerprint => "us_bank_account_fingerprint", + } + } +} + +impl std::str::FromStr for RadarValueListItemType { + type Err = (); + fn from_str(s: &str) -> Result { + use RadarValueListItemType::*; + match s { + "card_bin" => Ok(CardBin), + "card_fingerprint" => Ok(CardFingerprint), + "case_sensitive_string" => Ok(CaseSensitiveString), + "country" => Ok(Country), + "customer_id" => Ok(CustomerId), + "email" => Ok(Email), + "ip_address" => Ok(IpAddress), + "sepa_debit_fingerprint" => Ok(SepaDebitFingerprint), + "string" => Ok(String), + "us_bank_account_fingerprint" => Ok(UsBankAccountFingerprint), + _ => Err(()), + } + } +} +impl std::fmt::Display for RadarValueListItemType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for RadarValueListItemType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for RadarValueListItemType { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for RadarValueListItemType { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s) + .map_err(|_| serde::de::Error::custom("Unknown value for RadarValueListItemType")) + } +} diff --git a/generated/stripe_fraud/src/radar_value_list_item/mod.rs b/generated/stripe_fraud/src/radar_value_list_item/mod.rs new file mode 100644 index 000000000..3e00aa627 --- /dev/null +++ b/generated/stripe_fraud/src/radar_value_list_item/mod.rs @@ -0,0 +1,5 @@ +#[cfg(feature = "radar_value_list_item")] +mod requests; +pub(crate) mod types; +#[cfg(feature = "radar_value_list_item")] +pub use requests::*; diff --git a/generated/stripe_fraud/src/radar_value_list_item/requests.rs b/generated/stripe_fraud/src/radar_value_list_item/requests.rs new file mode 100644 index 000000000..d422febbb --- /dev/null +++ b/generated/stripe_fraud/src/radar_value_list_item/requests.rs @@ -0,0 +1,121 @@ +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct DeleteRadarValueListItem {} +impl DeleteRadarValueListItem { + pub fn new() -> Self { + Self::default() + } +} +impl DeleteRadarValueListItem { + /// Deletes a `ValueListItem` object, removing it from its parent value list. + pub fn send( + &self, + client: &stripe::Client, + item: &stripe_fraud::RadarValueListItemId, + ) -> stripe::Response { + client.send_form( + &format!("/radar/value_list_items/{item}"), + self, + http_types::Method::Delete, + ) + } +} +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct ListRadarValueListItem<'a> { + #[serde(skip_serializing_if = "Option::is_none")] + pub created: Option, + /// A cursor for use in pagination. + /// `ending_before` is an object ID that defines your place in the list. + /// For instance, if you make a list request and receive 100 objects, starting with `obj_bar`, your subsequent call can include `ending_before=obj_bar` in order to fetch the previous page of the list. + #[serde(skip_serializing_if = "Option::is_none")] + pub ending_before: Option<&'a str>, + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, + /// A limit on the number of objects to be returned. + /// Limit can range between 1 and 100, and the default is 10. + #[serde(skip_serializing_if = "Option::is_none")] + pub limit: Option, + /// A cursor for use in pagination. + /// `starting_after` is an object ID that defines your place in the list. + /// For instance, if you make a list request and receive 100 objects, ending with `obj_foo`, your subsequent call can include `starting_after=obj_foo` in order to fetch the next page of the list. + #[serde(skip_serializing_if = "Option::is_none")] + pub starting_after: Option<&'a str>, + /// Return items belonging to the parent list whose value matches the specified value (using an "is like" match). + #[serde(skip_serializing_if = "Option::is_none")] + pub value: Option<&'a str>, + /// Identifier for the parent value list this item belongs to. + pub value_list: &'a str, +} +impl<'a> ListRadarValueListItem<'a> { + pub fn new(value_list: &'a str) -> Self { + Self { + created: None, + ending_before: None, + expand: None, + limit: None, + starting_after: None, + value: None, + value_list, + } + } +} +impl<'a> ListRadarValueListItem<'a> { + /// Returns a list of `ValueListItem` objects. + /// The objects are sorted in descending order by creation date, with the most recently created object appearing first. + pub fn send( + &self, + client: &stripe::Client, + ) -> stripe::Response> { + client.get_query("/radar/value_list_items", self) + } + pub fn paginate( + self, + ) -> stripe::ListPaginator> { + stripe::ListPaginator::from_list_params("/radar/value_list_items", self) + } +} +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct RetrieveRadarValueListItem<'a> { + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, +} +impl<'a> RetrieveRadarValueListItem<'a> { + pub fn new() -> Self { + Self::default() + } +} +impl<'a> RetrieveRadarValueListItem<'a> { + /// Retrieves a `ValueListItem` object. + pub fn send( + &self, + client: &stripe::Client, + item: &stripe_fraud::RadarValueListItemId, + ) -> stripe::Response { + client.get_query(&format!("/radar/value_list_items/{item}"), self) + } +} +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreateRadarValueListItem<'a> { + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, + /// The value of the item (whose type must match the type of the parent value list). + pub value: &'a str, + /// The identifier of the value list which the created item will be added to. + pub value_list: &'a str, +} +impl<'a> CreateRadarValueListItem<'a> { + pub fn new(value: &'a str, value_list: &'a str) -> Self { + Self { expand: None, value, value_list } + } +} +impl<'a> CreateRadarValueListItem<'a> { + /// Creates a new `ValueListItem` object, which is added to the specified parent value list. + pub fn send( + &self, + client: &stripe::Client, + ) -> stripe::Response { + client.send_form("/radar/value_list_items", self, http_types::Method::Post) + } +} diff --git a/generated/stripe_fraud/src/radar_value_list_item/types.rs b/generated/stripe_fraud/src/radar_value_list_item/types.rs new file mode 100644 index 000000000..e8bcb6533 --- /dev/null +++ b/generated/stripe_fraud/src/radar_value_list_item/types.rs @@ -0,0 +1,27 @@ +/// Value list items allow you to add specific values to a given Radar value list, which can then be used in rules. +/// +/// Related guide: [Managing list items](https://stripe.com/docs/radar/lists#managing-list-items) +/// +/// For more details see <>. +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct RadarValueListItem { + /// Time at which the object was created. Measured in seconds since the Unix epoch. + pub created: stripe_types::Timestamp, + /// The name or email address of the user who added this item to the value list. + pub created_by: String, + /// Unique identifier for the object. + pub id: stripe_fraud::RadarValueListItemId, + /// Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + pub livemode: bool, + /// The value of the item. + pub value: String, + /// The identifier of the value list this item belongs to. + pub value_list: String, +} +impl stripe_types::Object for RadarValueListItem { + type Id = stripe_fraud::RadarValueListItemId; + fn id(&self) -> &Self::Id { + &self.id + } +} +stripe_types::def_id!(RadarValueListItemId); diff --git a/generated/stripe_fraud/src/review/mod.rs b/generated/stripe_fraud/src/review/mod.rs new file mode 100644 index 000000000..aac113588 --- /dev/null +++ b/generated/stripe_fraud/src/review/mod.rs @@ -0,0 +1,4 @@ +#[cfg(feature = "review")] +mod requests; +#[cfg(feature = "review")] +pub use requests::*; diff --git a/generated/stripe_fraud/src/review/requests.rs b/generated/stripe_fraud/src/review/requests.rs new file mode 100644 index 000000000..310572897 --- /dev/null +++ b/generated/stripe_fraud/src/review/requests.rs @@ -0,0 +1,82 @@ +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct ListReview<'a> { + #[serde(skip_serializing_if = "Option::is_none")] + pub created: Option, + /// A cursor for use in pagination. + /// `ending_before` is an object ID that defines your place in the list. + /// For instance, if you make a list request and receive 100 objects, starting with `obj_bar`, your subsequent call can include `ending_before=obj_bar` in order to fetch the previous page of the list. + #[serde(skip_serializing_if = "Option::is_none")] + pub ending_before: Option<&'a str>, + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, + /// A limit on the number of objects to be returned. + /// Limit can range between 1 and 100, and the default is 10. + #[serde(skip_serializing_if = "Option::is_none")] + pub limit: Option, + /// A cursor for use in pagination. + /// `starting_after` is an object ID that defines your place in the list. + /// For instance, if you make a list request and receive 100 objects, ending with `obj_foo`, your subsequent call can include `starting_after=obj_foo` in order to fetch the next page of the list. + #[serde(skip_serializing_if = "Option::is_none")] + pub starting_after: Option<&'a str>, +} +impl<'a> ListReview<'a> { + pub fn new() -> Self { + Self::default() + } +} +impl<'a> ListReview<'a> { + /// Returns a list of `Review` objects that have `open` set to `true`. + /// The objects are sorted in descending order by creation date, with the most recently created object appearing first. + pub fn send( + &self, + client: &stripe::Client, + ) -> stripe::Response> { + client.get_query("/reviews", self) + } + pub fn paginate(self) -> stripe::ListPaginator> { + stripe::ListPaginator::from_list_params("/reviews", self) + } +} +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct RetrieveReview<'a> { + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, +} +impl<'a> RetrieveReview<'a> { + pub fn new() -> Self { + Self::default() + } +} +impl<'a> RetrieveReview<'a> { + /// Retrieves a `Review` object. + pub fn send( + &self, + client: &stripe::Client, + review: &stripe_shared::ReviewId, + ) -> stripe::Response { + client.get_query(&format!("/reviews/{review}"), self) + } +} +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct ApproveReview<'a> { + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, +} +impl<'a> ApproveReview<'a> { + pub fn new() -> Self { + Self::default() + } +} +impl<'a> ApproveReview<'a> { + /// Approves a `Review` object, closing it and removing it from the list of reviews. + pub fn send( + &self, + client: &stripe::Client, + review: &stripe_shared::ReviewId, + ) -> stripe::Response { + client.send_form(&format!("/reviews/{review}/approve"), self, http_types::Method::Post) + } +} diff --git a/generated/stripe_issuing/Cargo.toml b/generated/stripe_issuing/Cargo.toml new file mode 100644 index 000000000..30e00b043 --- /dev/null +++ b/generated/stripe_issuing/Cargo.toml @@ -0,0 +1,56 @@ +[package] +name = "stripe_issuing" +version.workspace = true +description.workspace = true +edition.workspace = true +rust-version.workspace = true +authors.workspace = true +license.workspace = true +homepage.workspace = true +repository.workspace = true +keywords.workspace = true +categories.workspace = true + +[lib] +path = "src/mod.rs" + +[dependencies] +serde.workspace = true +smol_str.workspace = true +serde_json.workspace = true +stripe_types = {path = "../../stripe_types"} + +http-types.workspace = true +async-stripe = {path = "../../async-stripe"} + + +stripe_shared = {path = "../../generated/stripe_shared"} + + +[features] +runtime-tokio-hyper = ["async-stripe/runtime-tokio-hyper"] +runtime-tokio-hyper-rustls = ["async-stripe/runtime-tokio-hyper-rustls"] +runtime-tokio-hyper-rustls-webpki = ["async-stripe/runtime-tokio-hyper-rustls-webpki"] +runtime-blocking = ["async-stripe/runtime-blocking"] +runtime-blocking-rustls = ["async-stripe/runtime-blocking-rustls"] +runtime-blocking-rustls-webpki = ["async-stripe/runtime-blocking-rustls-webpki"] +runtime-async-std-surf = ["async-stripe/runtime-async-std-surf"] + +issuing_authorization = [] +issuing_card = [] +issuing_cardholder = [] +issuing_dispute = [] +issuing_token = [] +issuing_transaction = [] + +full = ["issuing_authorization", +"issuing_card", +"issuing_cardholder", +"issuing_dispute", +"issuing_token", +"issuing_transaction"] + + +[package.metadata.docs.rs] +features = ["runtime-tokio-hyper", "full"] + diff --git a/generated/stripe_issuing/src/issuing_authorization/mod.rs b/generated/stripe_issuing/src/issuing_authorization/mod.rs new file mode 100644 index 000000000..994757301 --- /dev/null +++ b/generated/stripe_issuing/src/issuing_authorization/mod.rs @@ -0,0 +1,4 @@ +#[cfg(feature = "issuing_authorization")] +mod requests; +#[cfg(feature = "issuing_authorization")] +pub use requests::*; diff --git a/generated/stripe_issuing/src/issuing_authorization/requests.rs b/generated/stripe_issuing/src/issuing_authorization/requests.rs new file mode 100644 index 000000000..8e7337656 --- /dev/null +++ b/generated/stripe_issuing/src/issuing_authorization/requests.rs @@ -0,0 +1,2145 @@ +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct ListIssuingAuthorization<'a> { + /// Only return authorizations that belong to the given card. + #[serde(skip_serializing_if = "Option::is_none")] + pub card: Option<&'a str>, + /// Only return authorizations that belong to the given cardholder. + #[serde(skip_serializing_if = "Option::is_none")] + pub cardholder: Option<&'a str>, + /// Only return authorizations that were created during the given date interval. + #[serde(skip_serializing_if = "Option::is_none")] + pub created: Option, + /// A cursor for use in pagination. + /// `ending_before` is an object ID that defines your place in the list. + /// For instance, if you make a list request and receive 100 objects, starting with `obj_bar`, your subsequent call can include `ending_before=obj_bar` in order to fetch the previous page of the list. + #[serde(skip_serializing_if = "Option::is_none")] + pub ending_before: Option<&'a str>, + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, + /// A limit on the number of objects to be returned. + /// Limit can range between 1 and 100, and the default is 10. + #[serde(skip_serializing_if = "Option::is_none")] + pub limit: Option, + /// A cursor for use in pagination. + /// `starting_after` is an object ID that defines your place in the list. + /// For instance, if you make a list request and receive 100 objects, ending with `obj_foo`, your subsequent call can include `starting_after=obj_foo` in order to fetch the next page of the list. + #[serde(skip_serializing_if = "Option::is_none")] + pub starting_after: Option<&'a str>, + /// Only return authorizations with the given status. One of `pending`, `closed`, or `reversed`. + #[serde(skip_serializing_if = "Option::is_none")] + pub status: Option, +} +impl<'a> ListIssuingAuthorization<'a> { + pub fn new() -> Self { + Self::default() + } +} +impl<'a> ListIssuingAuthorization<'a> { + /// Returns a list of Issuing `Authorization` objects. + /// The objects are sorted in descending order by creation date, with the most recently created object appearing first. + pub fn send( + &self, + client: &stripe::Client, + ) -> stripe::Response> { + client.get_query("/issuing/authorizations", self) + } + pub fn paginate( + self, + ) -> stripe::ListPaginator> { + stripe::ListPaginator::from_list_params("/issuing/authorizations", self) + } +} +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct RetrieveIssuingAuthorization<'a> { + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, +} +impl<'a> RetrieveIssuingAuthorization<'a> { + pub fn new() -> Self { + Self::default() + } +} +impl<'a> RetrieveIssuingAuthorization<'a> { + /// Retrieves an Issuing `Authorization` object. + pub fn send( + &self, + client: &stripe::Client, + authorization: &stripe_shared::IssuingAuthorizationId, + ) -> stripe::Response { + client.get_query(&format!("/issuing/authorizations/{authorization}"), self) + } +} +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdateIssuingAuthorization<'a> { + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, + /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. + /// This can be useful for storing additional information about the object in a structured format. + /// Individual keys can be unset by posting an empty value to them. + /// All keys can be unset by posting an empty value to `metadata`. + #[serde(skip_serializing_if = "Option::is_none")] + pub metadata: Option<&'a std::collections::HashMap>, +} +impl<'a> UpdateIssuingAuthorization<'a> { + pub fn new() -> Self { + Self::default() + } +} +impl<'a> UpdateIssuingAuthorization<'a> { + /// Updates the specified Issuing `Authorization` object by setting the values of the parameters passed. + /// Any parameters not provided will be left unchanged. + pub fn send( + &self, + client: &stripe::Client, + authorization: &stripe_shared::IssuingAuthorizationId, + ) -> stripe::Response { + client.send_form( + &format!("/issuing/authorizations/{authorization}"), + self, + http_types::Method::Post, + ) + } +} +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct ApproveIssuingAuthorization<'a> { + /// If the authorization's `pending_request.is_amount_controllable` property is `true`, you may provide this value to control how much to hold for the authorization. + /// Must be positive (use [`decline`](https://stripe.com/docs/api/issuing/authorizations/decline) to decline an authorization request). + #[serde(skip_serializing_if = "Option::is_none")] + pub amount: Option, + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, + /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. + /// This can be useful for storing additional information about the object in a structured format. + /// Individual keys can be unset by posting an empty value to them. + /// All keys can be unset by posting an empty value to `metadata`. + #[serde(skip_serializing_if = "Option::is_none")] + pub metadata: Option<&'a std::collections::HashMap>, +} +impl<'a> ApproveIssuingAuthorization<'a> { + pub fn new() -> Self { + Self::default() + } +} +impl<'a> ApproveIssuingAuthorization<'a> { + /// \[Deprecated\] Approves a pending Issuing `Authorization` object. + /// This request should be made within the timeout window of the [real-time authorization](https://stripe.com/docs/issuing/controls/real-time-authorizations) flow. + /// + /// This method is deprecated. + /// Instead, [respond directly to the webhook request to approve an authorization](https://stripe.com/docs/issuing/controls/real-time-authorizations#authorization-handling). + pub fn send( + &self, + client: &stripe::Client, + authorization: &stripe_shared::IssuingAuthorizationId, + ) -> stripe::Response { + client.send_form( + &format!("/issuing/authorizations/{authorization}/approve"), + self, + http_types::Method::Post, + ) + } +} +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct DeclineIssuingAuthorization<'a> { + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, + /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. + /// This can be useful for storing additional information about the object in a structured format. + /// Individual keys can be unset by posting an empty value to them. + /// All keys can be unset by posting an empty value to `metadata`. + #[serde(skip_serializing_if = "Option::is_none")] + pub metadata: Option<&'a std::collections::HashMap>, +} +impl<'a> DeclineIssuingAuthorization<'a> { + pub fn new() -> Self { + Self::default() + } +} +impl<'a> DeclineIssuingAuthorization<'a> { + /// \[Deprecated\] Declines a pending Issuing `Authorization` object. + /// This request should be made within the timeout window of the [real time authorization](https://stripe.com/docs/issuing/controls/real-time-authorizations) flow. + /// This method is deprecated. + /// Instead, [respond directly to the webhook request to decline an authorization](https://stripe.com/docs/issuing/controls/real-time-authorizations#authorization-handling). + pub fn send( + &self, + client: &stripe::Client, + authorization: &stripe_shared::IssuingAuthorizationId, + ) -> stripe::Response { + client.send_form( + &format!("/issuing/authorizations/{authorization}/decline"), + self, + http_types::Method::Post, + ) + } +} +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreateIssuingAuthorization<'a> { + /// The total amount to attempt to authorize. + /// This amount is in the provided currency, or defaults to the card's currency, and in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal). + pub amount: i64, + /// Detailed breakdown of amount components. + /// These amounts are denominated in `currency` and in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal). + #[serde(skip_serializing_if = "Option::is_none")] + pub amount_details: Option, + /// How the card details were provided. Defaults to online. + #[serde(skip_serializing_if = "Option::is_none")] + pub authorization_method: Option, + /// Card associated with this authorization. + pub card: &'a str, + /// The currency of the authorization. + /// If not provided, defaults to the currency of the card. + /// Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. + /// Must be a [supported currency](https://stripe.com/docs/currencies). + #[serde(skip_serializing_if = "Option::is_none")] + pub currency: Option, + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, + /// If set `true`, you may provide [amount](https://stripe.com/docs/api/issuing/authorizations/approve#approve_issuing_authorization-amount) to control how much to hold for the authorization. + #[serde(skip_serializing_if = "Option::is_none")] + pub is_amount_controllable: Option, + /// Details about the seller (grocery store, e-commerce website, etc.) where the card authorization happened. + #[serde(skip_serializing_if = "Option::is_none")] + pub merchant_data: Option>, + /// Details about the authorization, such as identifiers, set by the card network. + #[serde(skip_serializing_if = "Option::is_none")] + pub network_data: Option>, + /// Verifications that Stripe performed on information that the cardholder provided to the merchant. + #[serde(skip_serializing_if = "Option::is_none")] + pub verification_data: Option, + /// The digital wallet used for this transaction. + /// One of `apple_pay`, `google_pay`, or `samsung_pay`. + /// Will populate as `null` when no digital wallet was utilized. + #[serde(skip_serializing_if = "Option::is_none")] + pub wallet: Option, +} +impl<'a> CreateIssuingAuthorization<'a> { + pub fn new(amount: i64, card: &'a str) -> Self { + Self { + amount, + amount_details: None, + authorization_method: None, + card, + currency: None, + expand: None, + is_amount_controllable: None, + merchant_data: None, + network_data: None, + verification_data: None, + wallet: None, + } + } +} +/// Detailed breakdown of amount components. +/// These amounts are denominated in `currency` and in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal). +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreateIssuingAuthorizationAmountDetails { + /// The ATM withdrawal fee. + #[serde(skip_serializing_if = "Option::is_none")] + pub atm_fee: Option, + /// The amount of cash requested by the cardholder. + #[serde(skip_serializing_if = "Option::is_none")] + pub cashback_amount: Option, +} +impl CreateIssuingAuthorizationAmountDetails { + pub fn new() -> Self { + Self::default() + } +} +/// Details about the seller (grocery store, e-commerce website, etc.) where the card authorization happened. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreateIssuingAuthorizationMerchantData<'a> { + /// A categorization of the seller's type of business. + /// See our [merchant categories guide](https://stripe.com/docs/issuing/merchant-categories) for a list of possible values. + #[serde(skip_serializing_if = "Option::is_none")] + pub category: Option, + /// City where the seller is located + #[serde(skip_serializing_if = "Option::is_none")] + pub city: Option<&'a str>, + /// Country where the seller is located + #[serde(skip_serializing_if = "Option::is_none")] + pub country: Option<&'a str>, + /// Name of the seller + #[serde(skip_serializing_if = "Option::is_none")] + pub name: Option<&'a str>, + /// Identifier assigned to the seller by the card network. + /// Different card networks may assign different network_id fields to the same merchant. + #[serde(skip_serializing_if = "Option::is_none")] + pub network_id: Option<&'a str>, + /// Postal code where the seller is located + #[serde(skip_serializing_if = "Option::is_none")] + pub postal_code: Option<&'a str>, + /// State where the seller is located + #[serde(skip_serializing_if = "Option::is_none")] + pub state: Option<&'a str>, + /// An ID assigned by the seller to the location of the sale. + #[serde(skip_serializing_if = "Option::is_none")] + pub terminal_id: Option<&'a str>, + /// URL provided by the merchant on a 3DS request + #[serde(skip_serializing_if = "Option::is_none")] + pub url: Option<&'a str>, +} +impl<'a> CreateIssuingAuthorizationMerchantData<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// A categorization of the seller's type of business. +/// See our [merchant categories guide](https://stripe.com/docs/issuing/merchant-categories) for a list of possible values. +#[derive(Copy, Clone, Eq, PartialEq)] +#[non_exhaustive] +pub enum CreateIssuingAuthorizationMerchantDataCategory { + AcRefrigerationRepair, + AccountingBookkeepingServices, + AdvertisingServices, + AgriculturalCooperative, + AirlinesAirCarriers, + AirportsFlyingFields, + AmbulanceServices, + AmusementParksCarnivals, + AntiqueReproductions, + AntiqueShops, + Aquariums, + ArchitecturalSurveyingServices, + ArtDealersAndGalleries, + ArtistsSupplyAndCraftShops, + AutoAndHomeSupplyStores, + AutoBodyRepairShops, + AutoPaintShops, + AutoServiceShops, + AutomatedCashDisburse, + AutomatedFuelDispensers, + AutomobileAssociations, + AutomotivePartsAndAccessoriesStores, + AutomotiveTireStores, + BailAndBondPayments, + Bakeries, + BandsOrchestras, + BarberAndBeautyShops, + BettingCasinoGambling, + BicycleShops, + BilliardPoolEstablishments, + BoatDealers, + BoatRentalsAndLeases, + BookStores, + BooksPeriodicalsAndNewspapers, + BowlingAlleys, + BusLines, + BusinessSecretarialSchools, + BuyingShoppingServices, + CableSatelliteAndOtherPayTelevisionAndRadio, + CameraAndPhotographicSupplyStores, + CandyNutAndConfectioneryStores, + CarAndTruckDealersNewUsed, + CarAndTruckDealersUsedOnly, + CarRentalAgencies, + CarWashes, + CarpentryServices, + CarpetUpholsteryCleaning, + Caterers, + CharitableAndSocialServiceOrganizationsFundraising, + ChemicalsAndAlliedProducts, + ChildCareServices, + ChildrensAndInfantsWearStores, + ChiropodistsPodiatrists, + Chiropractors, + CigarStoresAndStands, + CivicSocialFraternalAssociations, + CleaningAndMaintenance, + ClothingRental, + CollegesUniversities, + CommercialEquipment, + CommercialFootwear, + CommercialPhotographyArtAndGraphics, + CommuterTransportAndFerries, + ComputerNetworkServices, + ComputerProgramming, + ComputerRepair, + ComputerSoftwareStores, + ComputersPeripheralsAndSoftware, + ConcreteWorkServices, + ConstructionMaterials, + ConsultingPublicRelations, + CorrespondenceSchools, + CosmeticStores, + CounselingServices, + CountryClubs, + CourierServices, + CourtCosts, + CreditReportingAgencies, + CruiseLines, + DairyProductsStores, + DanceHallStudiosSchools, + DatingEscortServices, + DentistsOrthodontists, + DepartmentStores, + DetectiveAgencies, + DigitalGoodsApplications, + DigitalGoodsGames, + DigitalGoodsLargeVolume, + DigitalGoodsMedia, + DirectMarketingCatalogMerchant, + DirectMarketingCombinationCatalogAndRetailMerchant, + DirectMarketingInboundTelemarketing, + DirectMarketingInsuranceServices, + DirectMarketingOther, + DirectMarketingOutboundTelemarketing, + DirectMarketingSubscription, + DirectMarketingTravel, + DiscountStores, + Doctors, + DoorToDoorSales, + DraperyWindowCoveringAndUpholsteryStores, + DrinkingPlaces, + DrugStoresAndPharmacies, + DrugsDrugProprietariesAndDruggistSundries, + DryCleaners, + DurableGoods, + DutyFreeStores, + EatingPlacesRestaurants, + EducationalServices, + ElectricRazorStores, + ElectricVehicleCharging, + ElectricalPartsAndEquipment, + ElectricalServices, + ElectronicsRepairShops, + ElectronicsStores, + ElementarySecondarySchools, + EmergencyServicesGcasVisaUseOnly, + EmploymentTempAgencies, + EquipmentRental, + ExterminatingServices, + FamilyClothingStores, + FastFoodRestaurants, + FinancialInstitutions, + FinesGovernmentAdministrativeEntities, + FireplaceFireplaceScreensAndAccessoriesStores, + FloorCoveringStores, + Florists, + FloristsSuppliesNurseryStockAndFlowers, + FreezerAndLockerMeatProvisioners, + FuelDealersNonAutomotive, + FuneralServicesCrematories, + FurnitureHomeFurnishingsAndEquipmentStoresExceptAppliances, + FurnitureRepairRefinishing, + FurriersAndFurShops, + GeneralServices, + GiftCardNoveltyAndSouvenirShops, + GlassPaintAndWallpaperStores, + GlasswareCrystalStores, + GolfCoursesPublic, + GovernmentLicensedHorseDogRacingUsRegionOnly, + GovernmentLicensedOnlineCasionsOnlineGamblingUsRegionOnly, + GovernmentOwnedLotteriesNonUsRegion, + GovernmentOwnedLotteriesUsRegionOnly, + GovernmentServices, + GroceryStoresSupermarkets, + HardwareEquipmentAndSupplies, + HardwareStores, + HealthAndBeautySpas, + HearingAidsSalesAndSupplies, + HeatingPlumbingAC, + HobbyToyAndGameShops, + HomeSupplyWarehouseStores, + Hospitals, + HotelsMotelsAndResorts, + HouseholdApplianceStores, + IndustrialSupplies, + InformationRetrievalServices, + InsuranceDefault, + InsuranceUnderwritingPremiums, + IntraCompanyPurchases, + JewelryStoresWatchesClocksAndSilverwareStores, + LandscapingServices, + Laundries, + LaundryCleaningServices, + LegalServicesAttorneys, + LuggageAndLeatherGoodsStores, + LumberBuildingMaterialsStores, + ManualCashDisburse, + MarinasServiceAndSupplies, + Marketplaces, + MasonryStoneworkAndPlaster, + MassageParlors, + MedicalAndDentalLabs, + MedicalDentalOphthalmicAndHospitalEquipmentAndSupplies, + MedicalServices, + MembershipOrganizations, + MensAndBoysClothingAndAccessoriesStores, + MensWomensClothingStores, + MetalServiceCenters, + MiscellaneousApparelAndAccessoryShops, + MiscellaneousAutoDealers, + MiscellaneousBusinessServices, + MiscellaneousFoodStores, + MiscellaneousGeneralMerchandise, + MiscellaneousGeneralServices, + MiscellaneousHomeFurnishingSpecialtyStores, + MiscellaneousPublishingAndPrinting, + MiscellaneousRecreationServices, + MiscellaneousRepairShops, + MiscellaneousSpecialtyRetail, + MobileHomeDealers, + MotionPictureTheaters, + MotorFreightCarriersAndTrucking, + MotorHomesDealers, + MotorVehicleSuppliesAndNewParts, + MotorcycleShopsAndDealers, + MotorcycleShopsDealers, + MusicStoresMusicalInstrumentsPianosAndSheetMusic, + NewsDealersAndNewsstands, + NonFiMoneyOrders, + NonFiStoredValueCardPurchaseLoad, + NondurableGoods, + NurseriesLawnAndGardenSupplyStores, + NursingPersonalCare, + OfficeAndCommercialFurniture, + OpticiansEyeglasses, + OptometristsOphthalmologist, + OrthopedicGoodsProstheticDevices, + Osteopaths, + PackageStoresBeerWineAndLiquor, + PaintsVarnishesAndSupplies, + ParkingLotsGarages, + PassengerRailways, + PawnShops, + PetShopsPetFoodAndSupplies, + PetroleumAndPetroleumProducts, + PhotoDeveloping, + PhotographicPhotocopyMicrofilmEquipmentAndSupplies, + PhotographicStudios, + PictureVideoProduction, + PieceGoodsNotionsAndOtherDryGoods, + PlumbingHeatingEquipmentAndSupplies, + PoliticalOrganizations, + PostalServicesGovernmentOnly, + PreciousStonesAndMetalsWatchesAndJewelry, + ProfessionalServices, + PublicWarehousingAndStorage, + QuickCopyReproAndBlueprint, + Railroads, + RealEstateAgentsAndManagersRentals, + RecordStores, + RecreationalVehicleRentals, + ReligiousGoodsStores, + ReligiousOrganizations, + RoofingSidingSheetMetal, + SecretarialSupportServices, + SecurityBrokersDealers, + ServiceStations, + SewingNeedleworkFabricAndPieceGoodsStores, + ShoeRepairHatCleaning, + ShoeStores, + SmallApplianceRepair, + SnowmobileDealers, + SpecialTradeServices, + SpecialtyCleaning, + SportingGoodsStores, + SportingRecreationCamps, + SportsAndRidingApparelStores, + SportsClubsFields, + StampAndCoinStores, + StationaryOfficeSuppliesPrintingAndWritingPaper, + StationeryStoresOfficeAndSchoolSupplyStores, + SwimmingPoolsSales, + TUiTravelGermany, + TailorsAlterations, + TaxPaymentsGovernmentAgencies, + TaxPreparationServices, + TaxicabsLimousines, + TelecommunicationEquipmentAndTelephoneSales, + TelecommunicationServices, + TelegraphServices, + TentAndAwningShops, + TestingLaboratories, + TheatricalTicketAgencies, + Timeshares, + TireRetreadingAndRepair, + TollsBridgeFees, + TouristAttractionsAndExhibits, + TowingServices, + TrailerParksCampgrounds, + TransportationServices, + TravelAgenciesTourOperators, + TruckStopIteration, + TruckUtilityTrailerRentals, + TypesettingPlateMakingAndRelatedServices, + TypewriterStores, + USFederalGovernmentAgenciesOrDepartments, + UniformsCommercialClothing, + UsedMerchandiseAndSecondhandStores, + Utilities, + VarietyStores, + VeterinaryServices, + VideoAmusementGameSupplies, + VideoGameArcades, + VideoTapeRentalStores, + VocationalTradeSchools, + WatchJewelryRepair, + WeldingRepair, + WholesaleClubs, + WigAndToupeeStores, + WiresMoneyOrders, + WomensAccessoryAndSpecialtyShops, + WomensReadyToWearStores, + WreckingAndSalvageYards, + /// An unrecognized value from Stripe. Should not be used as a request parameter. + Unknown, +} +impl CreateIssuingAuthorizationMerchantDataCategory { + pub fn as_str(self) -> &'static str { + use CreateIssuingAuthorizationMerchantDataCategory::*; + match self { + AcRefrigerationRepair => "ac_refrigeration_repair", + AccountingBookkeepingServices => "accounting_bookkeeping_services", + AdvertisingServices => "advertising_services", + AgriculturalCooperative => "agricultural_cooperative", + AirlinesAirCarriers => "airlines_air_carriers", + AirportsFlyingFields => "airports_flying_fields", + AmbulanceServices => "ambulance_services", + AmusementParksCarnivals => "amusement_parks_carnivals", + AntiqueReproductions => "antique_reproductions", + AntiqueShops => "antique_shops", + Aquariums => "aquariums", + ArchitecturalSurveyingServices => "architectural_surveying_services", + ArtDealersAndGalleries => "art_dealers_and_galleries", + ArtistsSupplyAndCraftShops => "artists_supply_and_craft_shops", + AutoAndHomeSupplyStores => "auto_and_home_supply_stores", + AutoBodyRepairShops => "auto_body_repair_shops", + AutoPaintShops => "auto_paint_shops", + AutoServiceShops => "auto_service_shops", + AutomatedCashDisburse => "automated_cash_disburse", + AutomatedFuelDispensers => "automated_fuel_dispensers", + AutomobileAssociations => "automobile_associations", + AutomotivePartsAndAccessoriesStores => "automotive_parts_and_accessories_stores", + AutomotiveTireStores => "automotive_tire_stores", + BailAndBondPayments => "bail_and_bond_payments", + Bakeries => "bakeries", + BandsOrchestras => "bands_orchestras", + BarberAndBeautyShops => "barber_and_beauty_shops", + BettingCasinoGambling => "betting_casino_gambling", + BicycleShops => "bicycle_shops", + BilliardPoolEstablishments => "billiard_pool_establishments", + BoatDealers => "boat_dealers", + BoatRentalsAndLeases => "boat_rentals_and_leases", + BookStores => "book_stores", + BooksPeriodicalsAndNewspapers => "books_periodicals_and_newspapers", + BowlingAlleys => "bowling_alleys", + BusLines => "bus_lines", + BusinessSecretarialSchools => "business_secretarial_schools", + BuyingShoppingServices => "buying_shopping_services", + CableSatelliteAndOtherPayTelevisionAndRadio => { + "cable_satellite_and_other_pay_television_and_radio" + } + CameraAndPhotographicSupplyStores => "camera_and_photographic_supply_stores", + CandyNutAndConfectioneryStores => "candy_nut_and_confectionery_stores", + CarAndTruckDealersNewUsed => "car_and_truck_dealers_new_used", + CarAndTruckDealersUsedOnly => "car_and_truck_dealers_used_only", + CarRentalAgencies => "car_rental_agencies", + CarWashes => "car_washes", + CarpentryServices => "carpentry_services", + CarpetUpholsteryCleaning => "carpet_upholstery_cleaning", + Caterers => "caterers", + CharitableAndSocialServiceOrganizationsFundraising => { + "charitable_and_social_service_organizations_fundraising" + } + ChemicalsAndAlliedProducts => "chemicals_and_allied_products", + ChildCareServices => "child_care_services", + ChildrensAndInfantsWearStores => "childrens_and_infants_wear_stores", + ChiropodistsPodiatrists => "chiropodists_podiatrists", + Chiropractors => "chiropractors", + CigarStoresAndStands => "cigar_stores_and_stands", + CivicSocialFraternalAssociations => "civic_social_fraternal_associations", + CleaningAndMaintenance => "cleaning_and_maintenance", + ClothingRental => "clothing_rental", + CollegesUniversities => "colleges_universities", + CommercialEquipment => "commercial_equipment", + CommercialFootwear => "commercial_footwear", + CommercialPhotographyArtAndGraphics => "commercial_photography_art_and_graphics", + CommuterTransportAndFerries => "commuter_transport_and_ferries", + ComputerNetworkServices => "computer_network_services", + ComputerProgramming => "computer_programming", + ComputerRepair => "computer_repair", + ComputerSoftwareStores => "computer_software_stores", + ComputersPeripheralsAndSoftware => "computers_peripherals_and_software", + ConcreteWorkServices => "concrete_work_services", + ConstructionMaterials => "construction_materials", + ConsultingPublicRelations => "consulting_public_relations", + CorrespondenceSchools => "correspondence_schools", + CosmeticStores => "cosmetic_stores", + CounselingServices => "counseling_services", + CountryClubs => "country_clubs", + CourierServices => "courier_services", + CourtCosts => "court_costs", + CreditReportingAgencies => "credit_reporting_agencies", + CruiseLines => "cruise_lines", + DairyProductsStores => "dairy_products_stores", + DanceHallStudiosSchools => "dance_hall_studios_schools", + DatingEscortServices => "dating_escort_services", + DentistsOrthodontists => "dentists_orthodontists", + DepartmentStores => "department_stores", + DetectiveAgencies => "detective_agencies", + DigitalGoodsApplications => "digital_goods_applications", + DigitalGoodsGames => "digital_goods_games", + DigitalGoodsLargeVolume => "digital_goods_large_volume", + DigitalGoodsMedia => "digital_goods_media", + DirectMarketingCatalogMerchant => "direct_marketing_catalog_merchant", + DirectMarketingCombinationCatalogAndRetailMerchant => { + "direct_marketing_combination_catalog_and_retail_merchant" + } + DirectMarketingInboundTelemarketing => "direct_marketing_inbound_telemarketing", + DirectMarketingInsuranceServices => "direct_marketing_insurance_services", + DirectMarketingOther => "direct_marketing_other", + DirectMarketingOutboundTelemarketing => "direct_marketing_outbound_telemarketing", + DirectMarketingSubscription => "direct_marketing_subscription", + DirectMarketingTravel => "direct_marketing_travel", + DiscountStores => "discount_stores", + Doctors => "doctors", + DoorToDoorSales => "door_to_door_sales", + DraperyWindowCoveringAndUpholsteryStores => { + "drapery_window_covering_and_upholstery_stores" + } + DrinkingPlaces => "drinking_places", + DrugStoresAndPharmacies => "drug_stores_and_pharmacies", + DrugsDrugProprietariesAndDruggistSundries => { + "drugs_drug_proprietaries_and_druggist_sundries" + } + DryCleaners => "dry_cleaners", + DurableGoods => "durable_goods", + DutyFreeStores => "duty_free_stores", + EatingPlacesRestaurants => "eating_places_restaurants", + EducationalServices => "educational_services", + ElectricRazorStores => "electric_razor_stores", + ElectricVehicleCharging => "electric_vehicle_charging", + ElectricalPartsAndEquipment => "electrical_parts_and_equipment", + ElectricalServices => "electrical_services", + ElectronicsRepairShops => "electronics_repair_shops", + ElectronicsStores => "electronics_stores", + ElementarySecondarySchools => "elementary_secondary_schools", + EmergencyServicesGcasVisaUseOnly => "emergency_services_gcas_visa_use_only", + EmploymentTempAgencies => "employment_temp_agencies", + EquipmentRental => "equipment_rental", + ExterminatingServices => "exterminating_services", + FamilyClothingStores => "family_clothing_stores", + FastFoodRestaurants => "fast_food_restaurants", + FinancialInstitutions => "financial_institutions", + FinesGovernmentAdministrativeEntities => "fines_government_administrative_entities", + FireplaceFireplaceScreensAndAccessoriesStores => { + "fireplace_fireplace_screens_and_accessories_stores" + } + FloorCoveringStores => "floor_covering_stores", + Florists => "florists", + FloristsSuppliesNurseryStockAndFlowers => "florists_supplies_nursery_stock_and_flowers", + FreezerAndLockerMeatProvisioners => "freezer_and_locker_meat_provisioners", + FuelDealersNonAutomotive => "fuel_dealers_non_automotive", + FuneralServicesCrematories => "funeral_services_crematories", + FurnitureHomeFurnishingsAndEquipmentStoresExceptAppliances => { + "furniture_home_furnishings_and_equipment_stores_except_appliances" + } + FurnitureRepairRefinishing => "furniture_repair_refinishing", + FurriersAndFurShops => "furriers_and_fur_shops", + GeneralServices => "general_services", + GiftCardNoveltyAndSouvenirShops => "gift_card_novelty_and_souvenir_shops", + GlassPaintAndWallpaperStores => "glass_paint_and_wallpaper_stores", + GlasswareCrystalStores => "glassware_crystal_stores", + GolfCoursesPublic => "golf_courses_public", + GovernmentLicensedHorseDogRacingUsRegionOnly => { + "government_licensed_horse_dog_racing_us_region_only" + } + GovernmentLicensedOnlineCasionsOnlineGamblingUsRegionOnly => { + "government_licensed_online_casions_online_gambling_us_region_only" + } + GovernmentOwnedLotteriesNonUsRegion => "government_owned_lotteries_non_us_region", + GovernmentOwnedLotteriesUsRegionOnly => "government_owned_lotteries_us_region_only", + GovernmentServices => "government_services", + GroceryStoresSupermarkets => "grocery_stores_supermarkets", + HardwareEquipmentAndSupplies => "hardware_equipment_and_supplies", + HardwareStores => "hardware_stores", + HealthAndBeautySpas => "health_and_beauty_spas", + HearingAidsSalesAndSupplies => "hearing_aids_sales_and_supplies", + HeatingPlumbingAC => "heating_plumbing_a_c", + HobbyToyAndGameShops => "hobby_toy_and_game_shops", + HomeSupplyWarehouseStores => "home_supply_warehouse_stores", + Hospitals => "hospitals", + HotelsMotelsAndResorts => "hotels_motels_and_resorts", + HouseholdApplianceStores => "household_appliance_stores", + IndustrialSupplies => "industrial_supplies", + InformationRetrievalServices => "information_retrieval_services", + InsuranceDefault => "insurance_default", + InsuranceUnderwritingPremiums => "insurance_underwriting_premiums", + IntraCompanyPurchases => "intra_company_purchases", + JewelryStoresWatchesClocksAndSilverwareStores => { + "jewelry_stores_watches_clocks_and_silverware_stores" + } + LandscapingServices => "landscaping_services", + Laundries => "laundries", + LaundryCleaningServices => "laundry_cleaning_services", + LegalServicesAttorneys => "legal_services_attorneys", + LuggageAndLeatherGoodsStores => "luggage_and_leather_goods_stores", + LumberBuildingMaterialsStores => "lumber_building_materials_stores", + ManualCashDisburse => "manual_cash_disburse", + MarinasServiceAndSupplies => "marinas_service_and_supplies", + Marketplaces => "marketplaces", + MasonryStoneworkAndPlaster => "masonry_stonework_and_plaster", + MassageParlors => "massage_parlors", + MedicalAndDentalLabs => "medical_and_dental_labs", + MedicalDentalOphthalmicAndHospitalEquipmentAndSupplies => { + "medical_dental_ophthalmic_and_hospital_equipment_and_supplies" + } + MedicalServices => "medical_services", + MembershipOrganizations => "membership_organizations", + MensAndBoysClothingAndAccessoriesStores => { + "mens_and_boys_clothing_and_accessories_stores" + } + MensWomensClothingStores => "mens_womens_clothing_stores", + MetalServiceCenters => "metal_service_centers", + MiscellaneousApparelAndAccessoryShops => "miscellaneous_apparel_and_accessory_shops", + MiscellaneousAutoDealers => "miscellaneous_auto_dealers", + MiscellaneousBusinessServices => "miscellaneous_business_services", + MiscellaneousFoodStores => "miscellaneous_food_stores", + MiscellaneousGeneralMerchandise => "miscellaneous_general_merchandise", + MiscellaneousGeneralServices => "miscellaneous_general_services", + MiscellaneousHomeFurnishingSpecialtyStores => { + "miscellaneous_home_furnishing_specialty_stores" + } + MiscellaneousPublishingAndPrinting => "miscellaneous_publishing_and_printing", + MiscellaneousRecreationServices => "miscellaneous_recreation_services", + MiscellaneousRepairShops => "miscellaneous_repair_shops", + MiscellaneousSpecialtyRetail => "miscellaneous_specialty_retail", + MobileHomeDealers => "mobile_home_dealers", + MotionPictureTheaters => "motion_picture_theaters", + MotorFreightCarriersAndTrucking => "motor_freight_carriers_and_trucking", + MotorHomesDealers => "motor_homes_dealers", + MotorVehicleSuppliesAndNewParts => "motor_vehicle_supplies_and_new_parts", + MotorcycleShopsAndDealers => "motorcycle_shops_and_dealers", + MotorcycleShopsDealers => "motorcycle_shops_dealers", + MusicStoresMusicalInstrumentsPianosAndSheetMusic => { + "music_stores_musical_instruments_pianos_and_sheet_music" + } + NewsDealersAndNewsstands => "news_dealers_and_newsstands", + NonFiMoneyOrders => "non_fi_money_orders", + NonFiStoredValueCardPurchaseLoad => "non_fi_stored_value_card_purchase_load", + NondurableGoods => "nondurable_goods", + NurseriesLawnAndGardenSupplyStores => "nurseries_lawn_and_garden_supply_stores", + NursingPersonalCare => "nursing_personal_care", + OfficeAndCommercialFurniture => "office_and_commercial_furniture", + OpticiansEyeglasses => "opticians_eyeglasses", + OptometristsOphthalmologist => "optometrists_ophthalmologist", + OrthopedicGoodsProstheticDevices => "orthopedic_goods_prosthetic_devices", + Osteopaths => "osteopaths", + PackageStoresBeerWineAndLiquor => "package_stores_beer_wine_and_liquor", + PaintsVarnishesAndSupplies => "paints_varnishes_and_supplies", + ParkingLotsGarages => "parking_lots_garages", + PassengerRailways => "passenger_railways", + PawnShops => "pawn_shops", + PetShopsPetFoodAndSupplies => "pet_shops_pet_food_and_supplies", + PetroleumAndPetroleumProducts => "petroleum_and_petroleum_products", + PhotoDeveloping => "photo_developing", + PhotographicPhotocopyMicrofilmEquipmentAndSupplies => { + "photographic_photocopy_microfilm_equipment_and_supplies" + } + PhotographicStudios => "photographic_studios", + PictureVideoProduction => "picture_video_production", + PieceGoodsNotionsAndOtherDryGoods => "piece_goods_notions_and_other_dry_goods", + PlumbingHeatingEquipmentAndSupplies => "plumbing_heating_equipment_and_supplies", + PoliticalOrganizations => "political_organizations", + PostalServicesGovernmentOnly => "postal_services_government_only", + PreciousStonesAndMetalsWatchesAndJewelry => { + "precious_stones_and_metals_watches_and_jewelry" + } + ProfessionalServices => "professional_services", + PublicWarehousingAndStorage => "public_warehousing_and_storage", + QuickCopyReproAndBlueprint => "quick_copy_repro_and_blueprint", + Railroads => "railroads", + RealEstateAgentsAndManagersRentals => "real_estate_agents_and_managers_rentals", + RecordStores => "record_stores", + RecreationalVehicleRentals => "recreational_vehicle_rentals", + ReligiousGoodsStores => "religious_goods_stores", + ReligiousOrganizations => "religious_organizations", + RoofingSidingSheetMetal => "roofing_siding_sheet_metal", + SecretarialSupportServices => "secretarial_support_services", + SecurityBrokersDealers => "security_brokers_dealers", + ServiceStations => "service_stations", + SewingNeedleworkFabricAndPieceGoodsStores => { + "sewing_needlework_fabric_and_piece_goods_stores" + } + ShoeRepairHatCleaning => "shoe_repair_hat_cleaning", + ShoeStores => "shoe_stores", + SmallApplianceRepair => "small_appliance_repair", + SnowmobileDealers => "snowmobile_dealers", + SpecialTradeServices => "special_trade_services", + SpecialtyCleaning => "specialty_cleaning", + SportingGoodsStores => "sporting_goods_stores", + SportingRecreationCamps => "sporting_recreation_camps", + SportsAndRidingApparelStores => "sports_and_riding_apparel_stores", + SportsClubsFields => "sports_clubs_fields", + StampAndCoinStores => "stamp_and_coin_stores", + StationaryOfficeSuppliesPrintingAndWritingPaper => { + "stationary_office_supplies_printing_and_writing_paper" + } + StationeryStoresOfficeAndSchoolSupplyStores => { + "stationery_stores_office_and_school_supply_stores" + } + SwimmingPoolsSales => "swimming_pools_sales", + TUiTravelGermany => "t_ui_travel_germany", + TailorsAlterations => "tailors_alterations", + TaxPaymentsGovernmentAgencies => "tax_payments_government_agencies", + TaxPreparationServices => "tax_preparation_services", + TaxicabsLimousines => "taxicabs_limousines", + TelecommunicationEquipmentAndTelephoneSales => { + "telecommunication_equipment_and_telephone_sales" + } + TelecommunicationServices => "telecommunication_services", + TelegraphServices => "telegraph_services", + TentAndAwningShops => "tent_and_awning_shops", + TestingLaboratories => "testing_laboratories", + TheatricalTicketAgencies => "theatrical_ticket_agencies", + Timeshares => "timeshares", + TireRetreadingAndRepair => "tire_retreading_and_repair", + TollsBridgeFees => "tolls_bridge_fees", + TouristAttractionsAndExhibits => "tourist_attractions_and_exhibits", + TowingServices => "towing_services", + TrailerParksCampgrounds => "trailer_parks_campgrounds", + TransportationServices => "transportation_services", + TravelAgenciesTourOperators => "travel_agencies_tour_operators", + TruckStopIteration => "truck_stop_iteration", + TruckUtilityTrailerRentals => "truck_utility_trailer_rentals", + TypesettingPlateMakingAndRelatedServices => { + "typesetting_plate_making_and_related_services" + } + TypewriterStores => "typewriter_stores", + USFederalGovernmentAgenciesOrDepartments => { + "u_s_federal_government_agencies_or_departments" + } + UniformsCommercialClothing => "uniforms_commercial_clothing", + UsedMerchandiseAndSecondhandStores => "used_merchandise_and_secondhand_stores", + Utilities => "utilities", + VarietyStores => "variety_stores", + VeterinaryServices => "veterinary_services", + VideoAmusementGameSupplies => "video_amusement_game_supplies", + VideoGameArcades => "video_game_arcades", + VideoTapeRentalStores => "video_tape_rental_stores", + VocationalTradeSchools => "vocational_trade_schools", + WatchJewelryRepair => "watch_jewelry_repair", + WeldingRepair => "welding_repair", + WholesaleClubs => "wholesale_clubs", + WigAndToupeeStores => "wig_and_toupee_stores", + WiresMoneyOrders => "wires_money_orders", + WomensAccessoryAndSpecialtyShops => "womens_accessory_and_specialty_shops", + WomensReadyToWearStores => "womens_ready_to_wear_stores", + WreckingAndSalvageYards => "wrecking_and_salvage_yards", + Unknown => "unknown", + } + } +} + +impl std::str::FromStr for CreateIssuingAuthorizationMerchantDataCategory { + type Err = (); + fn from_str(s: &str) -> Result { + use CreateIssuingAuthorizationMerchantDataCategory::*; + match s { + "ac_refrigeration_repair" => Ok(AcRefrigerationRepair), + "accounting_bookkeeping_services" => Ok(AccountingBookkeepingServices), + "advertising_services" => Ok(AdvertisingServices), + "agricultural_cooperative" => Ok(AgriculturalCooperative), + "airlines_air_carriers" => Ok(AirlinesAirCarriers), + "airports_flying_fields" => Ok(AirportsFlyingFields), + "ambulance_services" => Ok(AmbulanceServices), + "amusement_parks_carnivals" => Ok(AmusementParksCarnivals), + "antique_reproductions" => Ok(AntiqueReproductions), + "antique_shops" => Ok(AntiqueShops), + "aquariums" => Ok(Aquariums), + "architectural_surveying_services" => Ok(ArchitecturalSurveyingServices), + "art_dealers_and_galleries" => Ok(ArtDealersAndGalleries), + "artists_supply_and_craft_shops" => Ok(ArtistsSupplyAndCraftShops), + "auto_and_home_supply_stores" => Ok(AutoAndHomeSupplyStores), + "auto_body_repair_shops" => Ok(AutoBodyRepairShops), + "auto_paint_shops" => Ok(AutoPaintShops), + "auto_service_shops" => Ok(AutoServiceShops), + "automated_cash_disburse" => Ok(AutomatedCashDisburse), + "automated_fuel_dispensers" => Ok(AutomatedFuelDispensers), + "automobile_associations" => Ok(AutomobileAssociations), + "automotive_parts_and_accessories_stores" => Ok(AutomotivePartsAndAccessoriesStores), + "automotive_tire_stores" => Ok(AutomotiveTireStores), + "bail_and_bond_payments" => Ok(BailAndBondPayments), + "bakeries" => Ok(Bakeries), + "bands_orchestras" => Ok(BandsOrchestras), + "barber_and_beauty_shops" => Ok(BarberAndBeautyShops), + "betting_casino_gambling" => Ok(BettingCasinoGambling), + "bicycle_shops" => Ok(BicycleShops), + "billiard_pool_establishments" => Ok(BilliardPoolEstablishments), + "boat_dealers" => Ok(BoatDealers), + "boat_rentals_and_leases" => Ok(BoatRentalsAndLeases), + "book_stores" => Ok(BookStores), + "books_periodicals_and_newspapers" => Ok(BooksPeriodicalsAndNewspapers), + "bowling_alleys" => Ok(BowlingAlleys), + "bus_lines" => Ok(BusLines), + "business_secretarial_schools" => Ok(BusinessSecretarialSchools), + "buying_shopping_services" => Ok(BuyingShoppingServices), + "cable_satellite_and_other_pay_television_and_radio" => { + Ok(CableSatelliteAndOtherPayTelevisionAndRadio) + } + "camera_and_photographic_supply_stores" => Ok(CameraAndPhotographicSupplyStores), + "candy_nut_and_confectionery_stores" => Ok(CandyNutAndConfectioneryStores), + "car_and_truck_dealers_new_used" => Ok(CarAndTruckDealersNewUsed), + "car_and_truck_dealers_used_only" => Ok(CarAndTruckDealersUsedOnly), + "car_rental_agencies" => Ok(CarRentalAgencies), + "car_washes" => Ok(CarWashes), + "carpentry_services" => Ok(CarpentryServices), + "carpet_upholstery_cleaning" => Ok(CarpetUpholsteryCleaning), + "caterers" => Ok(Caterers), + "charitable_and_social_service_organizations_fundraising" => { + Ok(CharitableAndSocialServiceOrganizationsFundraising) + } + "chemicals_and_allied_products" => Ok(ChemicalsAndAlliedProducts), + "child_care_services" => Ok(ChildCareServices), + "childrens_and_infants_wear_stores" => Ok(ChildrensAndInfantsWearStores), + "chiropodists_podiatrists" => Ok(ChiropodistsPodiatrists), + "chiropractors" => Ok(Chiropractors), + "cigar_stores_and_stands" => Ok(CigarStoresAndStands), + "civic_social_fraternal_associations" => Ok(CivicSocialFraternalAssociations), + "cleaning_and_maintenance" => Ok(CleaningAndMaintenance), + "clothing_rental" => Ok(ClothingRental), + "colleges_universities" => Ok(CollegesUniversities), + "commercial_equipment" => Ok(CommercialEquipment), + "commercial_footwear" => Ok(CommercialFootwear), + "commercial_photography_art_and_graphics" => Ok(CommercialPhotographyArtAndGraphics), + "commuter_transport_and_ferries" => Ok(CommuterTransportAndFerries), + "computer_network_services" => Ok(ComputerNetworkServices), + "computer_programming" => Ok(ComputerProgramming), + "computer_repair" => Ok(ComputerRepair), + "computer_software_stores" => Ok(ComputerSoftwareStores), + "computers_peripherals_and_software" => Ok(ComputersPeripheralsAndSoftware), + "concrete_work_services" => Ok(ConcreteWorkServices), + "construction_materials" => Ok(ConstructionMaterials), + "consulting_public_relations" => Ok(ConsultingPublicRelations), + "correspondence_schools" => Ok(CorrespondenceSchools), + "cosmetic_stores" => Ok(CosmeticStores), + "counseling_services" => Ok(CounselingServices), + "country_clubs" => Ok(CountryClubs), + "courier_services" => Ok(CourierServices), + "court_costs" => Ok(CourtCosts), + "credit_reporting_agencies" => Ok(CreditReportingAgencies), + "cruise_lines" => Ok(CruiseLines), + "dairy_products_stores" => Ok(DairyProductsStores), + "dance_hall_studios_schools" => Ok(DanceHallStudiosSchools), + "dating_escort_services" => Ok(DatingEscortServices), + "dentists_orthodontists" => Ok(DentistsOrthodontists), + "department_stores" => Ok(DepartmentStores), + "detective_agencies" => Ok(DetectiveAgencies), + "digital_goods_applications" => Ok(DigitalGoodsApplications), + "digital_goods_games" => Ok(DigitalGoodsGames), + "digital_goods_large_volume" => Ok(DigitalGoodsLargeVolume), + "digital_goods_media" => Ok(DigitalGoodsMedia), + "direct_marketing_catalog_merchant" => Ok(DirectMarketingCatalogMerchant), + "direct_marketing_combination_catalog_and_retail_merchant" => { + Ok(DirectMarketingCombinationCatalogAndRetailMerchant) + } + "direct_marketing_inbound_telemarketing" => Ok(DirectMarketingInboundTelemarketing), + "direct_marketing_insurance_services" => Ok(DirectMarketingInsuranceServices), + "direct_marketing_other" => Ok(DirectMarketingOther), + "direct_marketing_outbound_telemarketing" => Ok(DirectMarketingOutboundTelemarketing), + "direct_marketing_subscription" => Ok(DirectMarketingSubscription), + "direct_marketing_travel" => Ok(DirectMarketingTravel), + "discount_stores" => Ok(DiscountStores), + "doctors" => Ok(Doctors), + "door_to_door_sales" => Ok(DoorToDoorSales), + "drapery_window_covering_and_upholstery_stores" => { + Ok(DraperyWindowCoveringAndUpholsteryStores) + } + "drinking_places" => Ok(DrinkingPlaces), + "drug_stores_and_pharmacies" => Ok(DrugStoresAndPharmacies), + "drugs_drug_proprietaries_and_druggist_sundries" => { + Ok(DrugsDrugProprietariesAndDruggistSundries) + } + "dry_cleaners" => Ok(DryCleaners), + "durable_goods" => Ok(DurableGoods), + "duty_free_stores" => Ok(DutyFreeStores), + "eating_places_restaurants" => Ok(EatingPlacesRestaurants), + "educational_services" => Ok(EducationalServices), + "electric_razor_stores" => Ok(ElectricRazorStores), + "electric_vehicle_charging" => Ok(ElectricVehicleCharging), + "electrical_parts_and_equipment" => Ok(ElectricalPartsAndEquipment), + "electrical_services" => Ok(ElectricalServices), + "electronics_repair_shops" => Ok(ElectronicsRepairShops), + "electronics_stores" => Ok(ElectronicsStores), + "elementary_secondary_schools" => Ok(ElementarySecondarySchools), + "emergency_services_gcas_visa_use_only" => Ok(EmergencyServicesGcasVisaUseOnly), + "employment_temp_agencies" => Ok(EmploymentTempAgencies), + "equipment_rental" => Ok(EquipmentRental), + "exterminating_services" => Ok(ExterminatingServices), + "family_clothing_stores" => Ok(FamilyClothingStores), + "fast_food_restaurants" => Ok(FastFoodRestaurants), + "financial_institutions" => Ok(FinancialInstitutions), + "fines_government_administrative_entities" => Ok(FinesGovernmentAdministrativeEntities), + "fireplace_fireplace_screens_and_accessories_stores" => { + Ok(FireplaceFireplaceScreensAndAccessoriesStores) + } + "floor_covering_stores" => Ok(FloorCoveringStores), + "florists" => Ok(Florists), + "florists_supplies_nursery_stock_and_flowers" => { + Ok(FloristsSuppliesNurseryStockAndFlowers) + } + "freezer_and_locker_meat_provisioners" => Ok(FreezerAndLockerMeatProvisioners), + "fuel_dealers_non_automotive" => Ok(FuelDealersNonAutomotive), + "funeral_services_crematories" => Ok(FuneralServicesCrematories), + "furniture_home_furnishings_and_equipment_stores_except_appliances" => { + Ok(FurnitureHomeFurnishingsAndEquipmentStoresExceptAppliances) + } + "furniture_repair_refinishing" => Ok(FurnitureRepairRefinishing), + "furriers_and_fur_shops" => Ok(FurriersAndFurShops), + "general_services" => Ok(GeneralServices), + "gift_card_novelty_and_souvenir_shops" => Ok(GiftCardNoveltyAndSouvenirShops), + "glass_paint_and_wallpaper_stores" => Ok(GlassPaintAndWallpaperStores), + "glassware_crystal_stores" => Ok(GlasswareCrystalStores), + "golf_courses_public" => Ok(GolfCoursesPublic), + "government_licensed_horse_dog_racing_us_region_only" => { + Ok(GovernmentLicensedHorseDogRacingUsRegionOnly) + } + "government_licensed_online_casions_online_gambling_us_region_only" => { + Ok(GovernmentLicensedOnlineCasionsOnlineGamblingUsRegionOnly) + } + "government_owned_lotteries_non_us_region" => Ok(GovernmentOwnedLotteriesNonUsRegion), + "government_owned_lotteries_us_region_only" => Ok(GovernmentOwnedLotteriesUsRegionOnly), + "government_services" => Ok(GovernmentServices), + "grocery_stores_supermarkets" => Ok(GroceryStoresSupermarkets), + "hardware_equipment_and_supplies" => Ok(HardwareEquipmentAndSupplies), + "hardware_stores" => Ok(HardwareStores), + "health_and_beauty_spas" => Ok(HealthAndBeautySpas), + "hearing_aids_sales_and_supplies" => Ok(HearingAidsSalesAndSupplies), + "heating_plumbing_a_c" => Ok(HeatingPlumbingAC), + "hobby_toy_and_game_shops" => Ok(HobbyToyAndGameShops), + "home_supply_warehouse_stores" => Ok(HomeSupplyWarehouseStores), + "hospitals" => Ok(Hospitals), + "hotels_motels_and_resorts" => Ok(HotelsMotelsAndResorts), + "household_appliance_stores" => Ok(HouseholdApplianceStores), + "industrial_supplies" => Ok(IndustrialSupplies), + "information_retrieval_services" => Ok(InformationRetrievalServices), + "insurance_default" => Ok(InsuranceDefault), + "insurance_underwriting_premiums" => Ok(InsuranceUnderwritingPremiums), + "intra_company_purchases" => Ok(IntraCompanyPurchases), + "jewelry_stores_watches_clocks_and_silverware_stores" => { + Ok(JewelryStoresWatchesClocksAndSilverwareStores) + } + "landscaping_services" => Ok(LandscapingServices), + "laundries" => Ok(Laundries), + "laundry_cleaning_services" => Ok(LaundryCleaningServices), + "legal_services_attorneys" => Ok(LegalServicesAttorneys), + "luggage_and_leather_goods_stores" => Ok(LuggageAndLeatherGoodsStores), + "lumber_building_materials_stores" => Ok(LumberBuildingMaterialsStores), + "manual_cash_disburse" => Ok(ManualCashDisburse), + "marinas_service_and_supplies" => Ok(MarinasServiceAndSupplies), + "marketplaces" => Ok(Marketplaces), + "masonry_stonework_and_plaster" => Ok(MasonryStoneworkAndPlaster), + "massage_parlors" => Ok(MassageParlors), + "medical_and_dental_labs" => Ok(MedicalAndDentalLabs), + "medical_dental_ophthalmic_and_hospital_equipment_and_supplies" => { + Ok(MedicalDentalOphthalmicAndHospitalEquipmentAndSupplies) + } + "medical_services" => Ok(MedicalServices), + "membership_organizations" => Ok(MembershipOrganizations), + "mens_and_boys_clothing_and_accessories_stores" => { + Ok(MensAndBoysClothingAndAccessoriesStores) + } + "mens_womens_clothing_stores" => Ok(MensWomensClothingStores), + "metal_service_centers" => Ok(MetalServiceCenters), + "miscellaneous_apparel_and_accessory_shops" => { + Ok(MiscellaneousApparelAndAccessoryShops) + } + "miscellaneous_auto_dealers" => Ok(MiscellaneousAutoDealers), + "miscellaneous_business_services" => Ok(MiscellaneousBusinessServices), + "miscellaneous_food_stores" => Ok(MiscellaneousFoodStores), + "miscellaneous_general_merchandise" => Ok(MiscellaneousGeneralMerchandise), + "miscellaneous_general_services" => Ok(MiscellaneousGeneralServices), + "miscellaneous_home_furnishing_specialty_stores" => { + Ok(MiscellaneousHomeFurnishingSpecialtyStores) + } + "miscellaneous_publishing_and_printing" => Ok(MiscellaneousPublishingAndPrinting), + "miscellaneous_recreation_services" => Ok(MiscellaneousRecreationServices), + "miscellaneous_repair_shops" => Ok(MiscellaneousRepairShops), + "miscellaneous_specialty_retail" => Ok(MiscellaneousSpecialtyRetail), + "mobile_home_dealers" => Ok(MobileHomeDealers), + "motion_picture_theaters" => Ok(MotionPictureTheaters), + "motor_freight_carriers_and_trucking" => Ok(MotorFreightCarriersAndTrucking), + "motor_homes_dealers" => Ok(MotorHomesDealers), + "motor_vehicle_supplies_and_new_parts" => Ok(MotorVehicleSuppliesAndNewParts), + "motorcycle_shops_and_dealers" => Ok(MotorcycleShopsAndDealers), + "motorcycle_shops_dealers" => Ok(MotorcycleShopsDealers), + "music_stores_musical_instruments_pianos_and_sheet_music" => { + Ok(MusicStoresMusicalInstrumentsPianosAndSheetMusic) + } + "news_dealers_and_newsstands" => Ok(NewsDealersAndNewsstands), + "non_fi_money_orders" => Ok(NonFiMoneyOrders), + "non_fi_stored_value_card_purchase_load" => Ok(NonFiStoredValueCardPurchaseLoad), + "nondurable_goods" => Ok(NondurableGoods), + "nurseries_lawn_and_garden_supply_stores" => Ok(NurseriesLawnAndGardenSupplyStores), + "nursing_personal_care" => Ok(NursingPersonalCare), + "office_and_commercial_furniture" => Ok(OfficeAndCommercialFurniture), + "opticians_eyeglasses" => Ok(OpticiansEyeglasses), + "optometrists_ophthalmologist" => Ok(OptometristsOphthalmologist), + "orthopedic_goods_prosthetic_devices" => Ok(OrthopedicGoodsProstheticDevices), + "osteopaths" => Ok(Osteopaths), + "package_stores_beer_wine_and_liquor" => Ok(PackageStoresBeerWineAndLiquor), + "paints_varnishes_and_supplies" => Ok(PaintsVarnishesAndSupplies), + "parking_lots_garages" => Ok(ParkingLotsGarages), + "passenger_railways" => Ok(PassengerRailways), + "pawn_shops" => Ok(PawnShops), + "pet_shops_pet_food_and_supplies" => Ok(PetShopsPetFoodAndSupplies), + "petroleum_and_petroleum_products" => Ok(PetroleumAndPetroleumProducts), + "photo_developing" => Ok(PhotoDeveloping), + "photographic_photocopy_microfilm_equipment_and_supplies" => { + Ok(PhotographicPhotocopyMicrofilmEquipmentAndSupplies) + } + "photographic_studios" => Ok(PhotographicStudios), + "picture_video_production" => Ok(PictureVideoProduction), + "piece_goods_notions_and_other_dry_goods" => Ok(PieceGoodsNotionsAndOtherDryGoods), + "plumbing_heating_equipment_and_supplies" => Ok(PlumbingHeatingEquipmentAndSupplies), + "political_organizations" => Ok(PoliticalOrganizations), + "postal_services_government_only" => Ok(PostalServicesGovernmentOnly), + "precious_stones_and_metals_watches_and_jewelry" => { + Ok(PreciousStonesAndMetalsWatchesAndJewelry) + } + "professional_services" => Ok(ProfessionalServices), + "public_warehousing_and_storage" => Ok(PublicWarehousingAndStorage), + "quick_copy_repro_and_blueprint" => Ok(QuickCopyReproAndBlueprint), + "railroads" => Ok(Railroads), + "real_estate_agents_and_managers_rentals" => Ok(RealEstateAgentsAndManagersRentals), + "record_stores" => Ok(RecordStores), + "recreational_vehicle_rentals" => Ok(RecreationalVehicleRentals), + "religious_goods_stores" => Ok(ReligiousGoodsStores), + "religious_organizations" => Ok(ReligiousOrganizations), + "roofing_siding_sheet_metal" => Ok(RoofingSidingSheetMetal), + "secretarial_support_services" => Ok(SecretarialSupportServices), + "security_brokers_dealers" => Ok(SecurityBrokersDealers), + "service_stations" => Ok(ServiceStations), + "sewing_needlework_fabric_and_piece_goods_stores" => { + Ok(SewingNeedleworkFabricAndPieceGoodsStores) + } + "shoe_repair_hat_cleaning" => Ok(ShoeRepairHatCleaning), + "shoe_stores" => Ok(ShoeStores), + "small_appliance_repair" => Ok(SmallApplianceRepair), + "snowmobile_dealers" => Ok(SnowmobileDealers), + "special_trade_services" => Ok(SpecialTradeServices), + "specialty_cleaning" => Ok(SpecialtyCleaning), + "sporting_goods_stores" => Ok(SportingGoodsStores), + "sporting_recreation_camps" => Ok(SportingRecreationCamps), + "sports_and_riding_apparel_stores" => Ok(SportsAndRidingApparelStores), + "sports_clubs_fields" => Ok(SportsClubsFields), + "stamp_and_coin_stores" => Ok(StampAndCoinStores), + "stationary_office_supplies_printing_and_writing_paper" => { + Ok(StationaryOfficeSuppliesPrintingAndWritingPaper) + } + "stationery_stores_office_and_school_supply_stores" => { + Ok(StationeryStoresOfficeAndSchoolSupplyStores) + } + "swimming_pools_sales" => Ok(SwimmingPoolsSales), + "t_ui_travel_germany" => Ok(TUiTravelGermany), + "tailors_alterations" => Ok(TailorsAlterations), + "tax_payments_government_agencies" => Ok(TaxPaymentsGovernmentAgencies), + "tax_preparation_services" => Ok(TaxPreparationServices), + "taxicabs_limousines" => Ok(TaxicabsLimousines), + "telecommunication_equipment_and_telephone_sales" => { + Ok(TelecommunicationEquipmentAndTelephoneSales) + } + "telecommunication_services" => Ok(TelecommunicationServices), + "telegraph_services" => Ok(TelegraphServices), + "tent_and_awning_shops" => Ok(TentAndAwningShops), + "testing_laboratories" => Ok(TestingLaboratories), + "theatrical_ticket_agencies" => Ok(TheatricalTicketAgencies), + "timeshares" => Ok(Timeshares), + "tire_retreading_and_repair" => Ok(TireRetreadingAndRepair), + "tolls_bridge_fees" => Ok(TollsBridgeFees), + "tourist_attractions_and_exhibits" => Ok(TouristAttractionsAndExhibits), + "towing_services" => Ok(TowingServices), + "trailer_parks_campgrounds" => Ok(TrailerParksCampgrounds), + "transportation_services" => Ok(TransportationServices), + "travel_agencies_tour_operators" => Ok(TravelAgenciesTourOperators), + "truck_stop_iteration" => Ok(TruckStopIteration), + "truck_utility_trailer_rentals" => Ok(TruckUtilityTrailerRentals), + "typesetting_plate_making_and_related_services" => { + Ok(TypesettingPlateMakingAndRelatedServices) + } + "typewriter_stores" => Ok(TypewriterStores), + "u_s_federal_government_agencies_or_departments" => { + Ok(USFederalGovernmentAgenciesOrDepartments) + } + "uniforms_commercial_clothing" => Ok(UniformsCommercialClothing), + "used_merchandise_and_secondhand_stores" => Ok(UsedMerchandiseAndSecondhandStores), + "utilities" => Ok(Utilities), + "variety_stores" => Ok(VarietyStores), + "veterinary_services" => Ok(VeterinaryServices), + "video_amusement_game_supplies" => Ok(VideoAmusementGameSupplies), + "video_game_arcades" => Ok(VideoGameArcades), + "video_tape_rental_stores" => Ok(VideoTapeRentalStores), + "vocational_trade_schools" => Ok(VocationalTradeSchools), + "watch_jewelry_repair" => Ok(WatchJewelryRepair), + "welding_repair" => Ok(WeldingRepair), + "wholesale_clubs" => Ok(WholesaleClubs), + "wig_and_toupee_stores" => Ok(WigAndToupeeStores), + "wires_money_orders" => Ok(WiresMoneyOrders), + "womens_accessory_and_specialty_shops" => Ok(WomensAccessoryAndSpecialtyShops), + "womens_ready_to_wear_stores" => Ok(WomensReadyToWearStores), + "wrecking_and_salvage_yards" => Ok(WreckingAndSalvageYards), + _ => Err(()), + } + } +} +impl std::fmt::Display for CreateIssuingAuthorizationMerchantDataCategory { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreateIssuingAuthorizationMerchantDataCategory { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreateIssuingAuthorizationMerchantDataCategory { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Details about the authorization, such as identifiers, set by the card network. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreateIssuingAuthorizationNetworkData<'a> { + /// Identifier assigned to the acquirer by the card network. + #[serde(skip_serializing_if = "Option::is_none")] + pub acquiring_institution_id: Option<&'a str>, +} +impl<'a> CreateIssuingAuthorizationNetworkData<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// Verifications that Stripe performed on information that the cardholder provided to the merchant. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreateIssuingAuthorizationVerificationData { + /// Whether the cardholder provided an address first line and if it matched the cardholder’s `billing.address.line1`. + #[serde(skip_serializing_if = "Option::is_none")] + pub address_line1_check: Option, + /// Whether the cardholder provided a postal code and if it matched the cardholder’s `billing.address.postal_code`. + #[serde(skip_serializing_if = "Option::is_none")] + pub address_postal_code_check: + Option, + /// The exemption applied to this authorization. + #[serde(skip_serializing_if = "Option::is_none")] + pub authentication_exemption: + Option, + /// Whether the cardholder provided a CVC and if it matched Stripe’s record. + #[serde(skip_serializing_if = "Option::is_none")] + pub cvc_check: Option, + /// Whether the cardholder provided an expiry date and if it matched Stripe’s record. + #[serde(skip_serializing_if = "Option::is_none")] + pub expiry_check: Option, + /// 3D Secure details. + #[serde(skip_serializing_if = "Option::is_none")] + pub three_d_secure: Option, +} +impl CreateIssuingAuthorizationVerificationData { + pub fn new() -> Self { + Self::default() + } +} +/// Whether the cardholder provided an address first line and if it matched the cardholder’s `billing.address.line1`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreateIssuingAuthorizationVerificationDataAddressLine1Check { + Match, + Mismatch, + NotProvided, +} +impl CreateIssuingAuthorizationVerificationDataAddressLine1Check { + pub fn as_str(self) -> &'static str { + use CreateIssuingAuthorizationVerificationDataAddressLine1Check::*; + match self { + Match => "match", + Mismatch => "mismatch", + NotProvided => "not_provided", + } + } +} + +impl std::str::FromStr for CreateIssuingAuthorizationVerificationDataAddressLine1Check { + type Err = (); + fn from_str(s: &str) -> Result { + use CreateIssuingAuthorizationVerificationDataAddressLine1Check::*; + match s { + "match" => Ok(Match), + "mismatch" => Ok(Mismatch), + "not_provided" => Ok(NotProvided), + _ => Err(()), + } + } +} +impl std::fmt::Display for CreateIssuingAuthorizationVerificationDataAddressLine1Check { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreateIssuingAuthorizationVerificationDataAddressLine1Check { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreateIssuingAuthorizationVerificationDataAddressLine1Check { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Whether the cardholder provided a postal code and if it matched the cardholder’s `billing.address.postal_code`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreateIssuingAuthorizationVerificationDataAddressPostalCodeCheck { + Match, + Mismatch, + NotProvided, +} +impl CreateIssuingAuthorizationVerificationDataAddressPostalCodeCheck { + pub fn as_str(self) -> &'static str { + use CreateIssuingAuthorizationVerificationDataAddressPostalCodeCheck::*; + match self { + Match => "match", + Mismatch => "mismatch", + NotProvided => "not_provided", + } + } +} + +impl std::str::FromStr for CreateIssuingAuthorizationVerificationDataAddressPostalCodeCheck { + type Err = (); + fn from_str(s: &str) -> Result { + use CreateIssuingAuthorizationVerificationDataAddressPostalCodeCheck::*; + match s { + "match" => Ok(Match), + "mismatch" => Ok(Mismatch), + "not_provided" => Ok(NotProvided), + _ => Err(()), + } + } +} +impl std::fmt::Display for CreateIssuingAuthorizationVerificationDataAddressPostalCodeCheck { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreateIssuingAuthorizationVerificationDataAddressPostalCodeCheck { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreateIssuingAuthorizationVerificationDataAddressPostalCodeCheck { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// The exemption applied to this authorization. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreateIssuingAuthorizationVerificationDataAuthenticationExemption { + /// The entity that requested the exemption, either the acquiring merchant or the Issuing user. + pub claimed_by: CreateIssuingAuthorizationVerificationDataAuthenticationExemptionClaimedBy, + /// The specific exemption claimed for this authorization. + #[serde(rename = "type")] + pub type_: CreateIssuingAuthorizationVerificationDataAuthenticationExemptionType, +} +impl CreateIssuingAuthorizationVerificationDataAuthenticationExemption { + pub fn new( + claimed_by: CreateIssuingAuthorizationVerificationDataAuthenticationExemptionClaimedBy, + type_: CreateIssuingAuthorizationVerificationDataAuthenticationExemptionType, + ) -> Self { + Self { claimed_by, type_ } + } +} +/// The entity that requested the exemption, either the acquiring merchant or the Issuing user. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreateIssuingAuthorizationVerificationDataAuthenticationExemptionClaimedBy { + Acquirer, + Issuer, +} +impl CreateIssuingAuthorizationVerificationDataAuthenticationExemptionClaimedBy { + pub fn as_str(self) -> &'static str { + use CreateIssuingAuthorizationVerificationDataAuthenticationExemptionClaimedBy::*; + match self { + Acquirer => "acquirer", + Issuer => "issuer", + } + } +} + +impl std::str::FromStr + for CreateIssuingAuthorizationVerificationDataAuthenticationExemptionClaimedBy +{ + type Err = (); + fn from_str(s: &str) -> Result { + use CreateIssuingAuthorizationVerificationDataAuthenticationExemptionClaimedBy::*; + match s { + "acquirer" => Ok(Acquirer), + "issuer" => Ok(Issuer), + _ => Err(()), + } + } +} +impl std::fmt::Display + for CreateIssuingAuthorizationVerificationDataAuthenticationExemptionClaimedBy +{ + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug + for CreateIssuingAuthorizationVerificationDataAuthenticationExemptionClaimedBy +{ + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize + for CreateIssuingAuthorizationVerificationDataAuthenticationExemptionClaimedBy +{ + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// The specific exemption claimed for this authorization. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreateIssuingAuthorizationVerificationDataAuthenticationExemptionType { + LowValueTransaction, + TransactionRiskAnalysis, + Unknown, +} +impl CreateIssuingAuthorizationVerificationDataAuthenticationExemptionType { + pub fn as_str(self) -> &'static str { + use CreateIssuingAuthorizationVerificationDataAuthenticationExemptionType::*; + match self { + LowValueTransaction => "low_value_transaction", + TransactionRiskAnalysis => "transaction_risk_analysis", + Unknown => "unknown", + } + } +} + +impl std::str::FromStr for CreateIssuingAuthorizationVerificationDataAuthenticationExemptionType { + type Err = (); + fn from_str(s: &str) -> Result { + use CreateIssuingAuthorizationVerificationDataAuthenticationExemptionType::*; + match s { + "low_value_transaction" => Ok(LowValueTransaction), + "transaction_risk_analysis" => Ok(TransactionRiskAnalysis), + "unknown" => Ok(Unknown), + _ => Err(()), + } + } +} +impl std::fmt::Display for CreateIssuingAuthorizationVerificationDataAuthenticationExemptionType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreateIssuingAuthorizationVerificationDataAuthenticationExemptionType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreateIssuingAuthorizationVerificationDataAuthenticationExemptionType { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Whether the cardholder provided a CVC and if it matched Stripe’s record. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreateIssuingAuthorizationVerificationDataCvcCheck { + Match, + Mismatch, + NotProvided, +} +impl CreateIssuingAuthorizationVerificationDataCvcCheck { + pub fn as_str(self) -> &'static str { + use CreateIssuingAuthorizationVerificationDataCvcCheck::*; + match self { + Match => "match", + Mismatch => "mismatch", + NotProvided => "not_provided", + } + } +} + +impl std::str::FromStr for CreateIssuingAuthorizationVerificationDataCvcCheck { + type Err = (); + fn from_str(s: &str) -> Result { + use CreateIssuingAuthorizationVerificationDataCvcCheck::*; + match s { + "match" => Ok(Match), + "mismatch" => Ok(Mismatch), + "not_provided" => Ok(NotProvided), + _ => Err(()), + } + } +} +impl std::fmt::Display for CreateIssuingAuthorizationVerificationDataCvcCheck { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreateIssuingAuthorizationVerificationDataCvcCheck { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreateIssuingAuthorizationVerificationDataCvcCheck { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Whether the cardholder provided an expiry date and if it matched Stripe’s record. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreateIssuingAuthorizationVerificationDataExpiryCheck { + Match, + Mismatch, + NotProvided, +} +impl CreateIssuingAuthorizationVerificationDataExpiryCheck { + pub fn as_str(self) -> &'static str { + use CreateIssuingAuthorizationVerificationDataExpiryCheck::*; + match self { + Match => "match", + Mismatch => "mismatch", + NotProvided => "not_provided", + } + } +} + +impl std::str::FromStr for CreateIssuingAuthorizationVerificationDataExpiryCheck { + type Err = (); + fn from_str(s: &str) -> Result { + use CreateIssuingAuthorizationVerificationDataExpiryCheck::*; + match s { + "match" => Ok(Match), + "mismatch" => Ok(Mismatch), + "not_provided" => Ok(NotProvided), + _ => Err(()), + } + } +} +impl std::fmt::Display for CreateIssuingAuthorizationVerificationDataExpiryCheck { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreateIssuingAuthorizationVerificationDataExpiryCheck { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreateIssuingAuthorizationVerificationDataExpiryCheck { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// 3D Secure details. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreateIssuingAuthorizationVerificationDataThreeDSecure { + /// The outcome of the 3D Secure authentication request. + pub result: CreateIssuingAuthorizationVerificationDataThreeDSecureResult, +} +impl CreateIssuingAuthorizationVerificationDataThreeDSecure { + pub fn new(result: CreateIssuingAuthorizationVerificationDataThreeDSecureResult) -> Self { + Self { result } + } +} +/// The outcome of the 3D Secure authentication request. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreateIssuingAuthorizationVerificationDataThreeDSecureResult { + AttemptAcknowledged, + Authenticated, + Failed, + Required, +} +impl CreateIssuingAuthorizationVerificationDataThreeDSecureResult { + pub fn as_str(self) -> &'static str { + use CreateIssuingAuthorizationVerificationDataThreeDSecureResult::*; + match self { + AttemptAcknowledged => "attempt_acknowledged", + Authenticated => "authenticated", + Failed => "failed", + Required => "required", + } + } +} + +impl std::str::FromStr for CreateIssuingAuthorizationVerificationDataThreeDSecureResult { + type Err = (); + fn from_str(s: &str) -> Result { + use CreateIssuingAuthorizationVerificationDataThreeDSecureResult::*; + match s { + "attempt_acknowledged" => Ok(AttemptAcknowledged), + "authenticated" => Ok(Authenticated), + "failed" => Ok(Failed), + "required" => Ok(Required), + _ => Err(()), + } + } +} +impl std::fmt::Display for CreateIssuingAuthorizationVerificationDataThreeDSecureResult { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreateIssuingAuthorizationVerificationDataThreeDSecureResult { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreateIssuingAuthorizationVerificationDataThreeDSecureResult { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// The digital wallet used for this transaction. +/// One of `apple_pay`, `google_pay`, or `samsung_pay`. +/// Will populate as `null` when no digital wallet was utilized. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreateIssuingAuthorizationWallet { + ApplePay, + GooglePay, + SamsungPay, +} +impl CreateIssuingAuthorizationWallet { + pub fn as_str(self) -> &'static str { + use CreateIssuingAuthorizationWallet::*; + match self { + ApplePay => "apple_pay", + GooglePay => "google_pay", + SamsungPay => "samsung_pay", + } + } +} + +impl std::str::FromStr for CreateIssuingAuthorizationWallet { + type Err = (); + fn from_str(s: &str) -> Result { + use CreateIssuingAuthorizationWallet::*; + match s { + "apple_pay" => Ok(ApplePay), + "google_pay" => Ok(GooglePay), + "samsung_pay" => Ok(SamsungPay), + _ => Err(()), + } + } +} +impl std::fmt::Display for CreateIssuingAuthorizationWallet { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreateIssuingAuthorizationWallet { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreateIssuingAuthorizationWallet { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'a> CreateIssuingAuthorization<'a> { + /// Create a test-mode authorization. + pub fn send( + &self, + client: &stripe::Client, + ) -> stripe::Response { + client.send_form("/test_helpers/issuing/authorizations", self, http_types::Method::Post) + } +} +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CaptureIssuingAuthorization<'a> { + /// The amount to capture from the authorization. + /// If not provided, the full amount of the authorization will be captured. + /// This amount is in the authorization currency and in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal). + #[serde(skip_serializing_if = "Option::is_none")] + pub capture_amount: Option, + /// Whether to close the authorization after capture. + /// Defaults to true. + /// Set to false to enable multi-capture flows. + #[serde(skip_serializing_if = "Option::is_none")] + pub close_authorization: Option, + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, + /// Additional purchase information that is optionally provided by the merchant. + #[serde(skip_serializing_if = "Option::is_none")] + pub purchase_details: Option>, +} +impl<'a> CaptureIssuingAuthorization<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// Additional purchase information that is optionally provided by the merchant. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CaptureIssuingAuthorizationPurchaseDetails<'a> { + /// Information about the flight that was purchased with this transaction. + #[serde(skip_serializing_if = "Option::is_none")] + pub flight: Option>, + /// Information about fuel that was purchased with this transaction. + #[serde(skip_serializing_if = "Option::is_none")] + pub fuel: Option>, + /// Information about lodging that was purchased with this transaction. + #[serde(skip_serializing_if = "Option::is_none")] + pub lodging: Option, + /// The line items in the purchase. + #[serde(skip_serializing_if = "Option::is_none")] + pub receipt: Option<&'a [CaptureIssuingAuthorizationPurchaseDetailsReceipt<'a>]>, + /// A merchant-specific order number. + #[serde(skip_serializing_if = "Option::is_none")] + pub reference: Option<&'a str>, +} +impl<'a> CaptureIssuingAuthorizationPurchaseDetails<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// Information about the flight that was purchased with this transaction. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CaptureIssuingAuthorizationPurchaseDetailsFlight<'a> { + /// The time that the flight departed. + #[serde(skip_serializing_if = "Option::is_none")] + pub departure_at: Option, + /// The name of the passenger. + #[serde(skip_serializing_if = "Option::is_none")] + pub passenger_name: Option<&'a str>, + /// Whether the ticket is refundable. + #[serde(skip_serializing_if = "Option::is_none")] + pub refundable: Option, + /// The legs of the trip. + #[serde(skip_serializing_if = "Option::is_none")] + pub segments: Option<&'a [CaptureIssuingAuthorizationPurchaseDetailsFlightSegments<'a>]>, + /// The travel agency that issued the ticket. + #[serde(skip_serializing_if = "Option::is_none")] + pub travel_agency: Option<&'a str>, +} +impl<'a> CaptureIssuingAuthorizationPurchaseDetailsFlight<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// The legs of the trip. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CaptureIssuingAuthorizationPurchaseDetailsFlightSegments<'a> { + /// The three-letter IATA airport code of the flight's destination. + #[serde(skip_serializing_if = "Option::is_none")] + pub arrival_airport_code: Option<&'a str>, + /// The airline carrier code. + #[serde(skip_serializing_if = "Option::is_none")] + pub carrier: Option<&'a str>, + /// The three-letter IATA airport code that the flight departed from. + #[serde(skip_serializing_if = "Option::is_none")] + pub departure_airport_code: Option<&'a str>, + /// The flight number. + #[serde(skip_serializing_if = "Option::is_none")] + pub flight_number: Option<&'a str>, + /// The flight's service class. + #[serde(skip_serializing_if = "Option::is_none")] + pub service_class: Option<&'a str>, + /// Whether a stopover is allowed on this flight. + #[serde(skip_serializing_if = "Option::is_none")] + pub stopover_allowed: Option, +} +impl<'a> CaptureIssuingAuthorizationPurchaseDetailsFlightSegments<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// Information about fuel that was purchased with this transaction. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CaptureIssuingAuthorizationPurchaseDetailsFuel<'a> { + /// The type of fuel that was purchased. + /// One of `diesel`, `unleaded_plus`, `unleaded_regular`, `unleaded_super`, or `other`. + #[serde(rename = "type")] + #[serde(skip_serializing_if = "Option::is_none")] + pub type_: Option, + /// The units for `volume_decimal`. One of `us_gallon` or `liter`. + #[serde(skip_serializing_if = "Option::is_none")] + pub unit: Option, + /// The cost in cents per each unit of fuel, represented as a decimal string with at most 12 decimal places. + #[serde(skip_serializing_if = "Option::is_none")] + pub unit_cost_decimal: Option<&'a str>, + /// The volume of the fuel that was pumped, represented as a decimal string with at most 12 decimal places. + #[serde(skip_serializing_if = "Option::is_none")] + pub volume_decimal: Option<&'a str>, +} +impl<'a> CaptureIssuingAuthorizationPurchaseDetailsFuel<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// The type of fuel that was purchased. +/// One of `diesel`, `unleaded_plus`, `unleaded_regular`, `unleaded_super`, or `other`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CaptureIssuingAuthorizationPurchaseDetailsFuelType { + Diesel, + Other, + UnleadedPlus, + UnleadedRegular, + UnleadedSuper, +} +impl CaptureIssuingAuthorizationPurchaseDetailsFuelType { + pub fn as_str(self) -> &'static str { + use CaptureIssuingAuthorizationPurchaseDetailsFuelType::*; + match self { + Diesel => "diesel", + Other => "other", + UnleadedPlus => "unleaded_plus", + UnleadedRegular => "unleaded_regular", + UnleadedSuper => "unleaded_super", + } + } +} + +impl std::str::FromStr for CaptureIssuingAuthorizationPurchaseDetailsFuelType { + type Err = (); + fn from_str(s: &str) -> Result { + use CaptureIssuingAuthorizationPurchaseDetailsFuelType::*; + match s { + "diesel" => Ok(Diesel), + "other" => Ok(Other), + "unleaded_plus" => Ok(UnleadedPlus), + "unleaded_regular" => Ok(UnleadedRegular), + "unleaded_super" => Ok(UnleadedSuper), + _ => Err(()), + } + } +} +impl std::fmt::Display for CaptureIssuingAuthorizationPurchaseDetailsFuelType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CaptureIssuingAuthorizationPurchaseDetailsFuelType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CaptureIssuingAuthorizationPurchaseDetailsFuelType { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// The units for `volume_decimal`. One of `us_gallon` or `liter`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CaptureIssuingAuthorizationPurchaseDetailsFuelUnit { + Liter, + UsGallon, +} +impl CaptureIssuingAuthorizationPurchaseDetailsFuelUnit { + pub fn as_str(self) -> &'static str { + use CaptureIssuingAuthorizationPurchaseDetailsFuelUnit::*; + match self { + Liter => "liter", + UsGallon => "us_gallon", + } + } +} + +impl std::str::FromStr for CaptureIssuingAuthorizationPurchaseDetailsFuelUnit { + type Err = (); + fn from_str(s: &str) -> Result { + use CaptureIssuingAuthorizationPurchaseDetailsFuelUnit::*; + match s { + "liter" => Ok(Liter), + "us_gallon" => Ok(UsGallon), + _ => Err(()), + } + } +} +impl std::fmt::Display for CaptureIssuingAuthorizationPurchaseDetailsFuelUnit { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CaptureIssuingAuthorizationPurchaseDetailsFuelUnit { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CaptureIssuingAuthorizationPurchaseDetailsFuelUnit { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Information about lodging that was purchased with this transaction. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CaptureIssuingAuthorizationPurchaseDetailsLodging { + /// The time of checking into the lodging. + #[serde(skip_serializing_if = "Option::is_none")] + pub check_in_at: Option, + /// The number of nights stayed at the lodging. + #[serde(skip_serializing_if = "Option::is_none")] + pub nights: Option, +} +impl CaptureIssuingAuthorizationPurchaseDetailsLodging { + pub fn new() -> Self { + Self::default() + } +} +/// The line items in the purchase. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CaptureIssuingAuthorizationPurchaseDetailsReceipt<'a> { + #[serde(skip_serializing_if = "Option::is_none")] + pub description: Option<&'a str>, + #[serde(skip_serializing_if = "Option::is_none")] + pub quantity: Option<&'a str>, + #[serde(skip_serializing_if = "Option::is_none")] + pub total: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub unit_cost: Option, +} +impl<'a> CaptureIssuingAuthorizationPurchaseDetailsReceipt<'a> { + pub fn new() -> Self { + Self::default() + } +} +impl<'a> CaptureIssuingAuthorization<'a> { + /// Capture a test-mode authorization. + pub fn send( + &self, + client: &stripe::Client, + authorization: &str, + ) -> stripe::Response { + client.send_form( + &format!("/test_helpers/issuing/authorizations/{authorization}/capture"), + self, + http_types::Method::Post, + ) + } +} +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct ExpireIssuingAuthorization<'a> { + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, +} +impl<'a> ExpireIssuingAuthorization<'a> { + pub fn new() -> Self { + Self::default() + } +} +impl<'a> ExpireIssuingAuthorization<'a> { + /// Expire a test-mode Authorization. + pub fn send( + &self, + client: &stripe::Client, + authorization: &str, + ) -> stripe::Response { + client.send_form( + &format!("/test_helpers/issuing/authorizations/{authorization}/expire"), + self, + http_types::Method::Post, + ) + } +} +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct IncrementIssuingAuthorization<'a> { + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, + /// The amount to increment the authorization by. + /// This amount is in the authorization currency and in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal). + pub increment_amount: i64, + /// If set `true`, you may provide [amount](https://stripe.com/docs/api/issuing/authorizations/approve#approve_issuing_authorization-amount) to control how much to hold for the authorization. + #[serde(skip_serializing_if = "Option::is_none")] + pub is_amount_controllable: Option, +} +impl<'a> IncrementIssuingAuthorization<'a> { + pub fn new(increment_amount: i64) -> Self { + Self { expand: None, increment_amount, is_amount_controllable: None } + } +} +impl<'a> IncrementIssuingAuthorization<'a> { + /// Increment a test-mode Authorization. + pub fn send( + &self, + client: &stripe::Client, + authorization: &str, + ) -> stripe::Response { + client.send_form( + &format!("/test_helpers/issuing/authorizations/{authorization}/increment"), + self, + http_types::Method::Post, + ) + } +} +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct ReverseIssuingAuthorization<'a> { + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, + /// The amount to reverse from the authorization. + /// If not provided, the full amount of the authorization will be reversed. + /// This amount is in the authorization currency and in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal). + #[serde(skip_serializing_if = "Option::is_none")] + pub reverse_amount: Option, +} +impl<'a> ReverseIssuingAuthorization<'a> { + pub fn new() -> Self { + Self::default() + } +} +impl<'a> ReverseIssuingAuthorization<'a> { + /// Reverse a test-mode Authorization. + pub fn send( + &self, + client: &stripe::Client, + authorization: &str, + ) -> stripe::Response { + client.send_form( + &format!("/test_helpers/issuing/authorizations/{authorization}/reverse"), + self, + http_types::Method::Post, + ) + } +} diff --git a/generated/stripe_issuing/src/issuing_card/mod.rs b/generated/stripe_issuing/src/issuing_card/mod.rs new file mode 100644 index 000000000..4318c5aa4 --- /dev/null +++ b/generated/stripe_issuing/src/issuing_card/mod.rs @@ -0,0 +1,4 @@ +#[cfg(feature = "issuing_card")] +mod requests; +#[cfg(feature = "issuing_card")] +pub use requests::*; diff --git a/generated/stripe_issuing/src/issuing_card/requests.rs b/generated/stripe_issuing/src/issuing_card/requests.rs new file mode 100644 index 000000000..fc21ffa15 --- /dev/null +++ b/generated/stripe_issuing/src/issuing_card/requests.rs @@ -0,0 +1,6903 @@ +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct ListIssuingCard<'a> { + /// Only return cards belonging to the Cardholder with the provided ID. + #[serde(skip_serializing_if = "Option::is_none")] + pub cardholder: Option<&'a str>, + /// Only return cards that were issued during the given date interval. + #[serde(skip_serializing_if = "Option::is_none")] + pub created: Option, + /// A cursor for use in pagination. + /// `ending_before` is an object ID that defines your place in the list. + /// For instance, if you make a list request and receive 100 objects, starting with `obj_bar`, your subsequent call can include `ending_before=obj_bar` in order to fetch the previous page of the list. + #[serde(skip_serializing_if = "Option::is_none")] + pub ending_before: Option<&'a str>, + /// Only return cards that have the given expiration month. + #[serde(skip_serializing_if = "Option::is_none")] + pub exp_month: Option, + /// Only return cards that have the given expiration year. + #[serde(skip_serializing_if = "Option::is_none")] + pub exp_year: Option, + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, + /// Only return cards that have the given last four digits. + #[serde(skip_serializing_if = "Option::is_none")] + pub last4: Option<&'a str>, + /// A limit on the number of objects to be returned. + /// Limit can range between 1 and 100, and the default is 10. + #[serde(skip_serializing_if = "Option::is_none")] + pub limit: Option, + /// A cursor for use in pagination. + /// `starting_after` is an object ID that defines your place in the list. + /// For instance, if you make a list request and receive 100 objects, ending with `obj_foo`, your subsequent call can include `starting_after=obj_foo` in order to fetch the next page of the list. + #[serde(skip_serializing_if = "Option::is_none")] + pub starting_after: Option<&'a str>, + /// Only return cards that have the given status. One of `active`, `inactive`, or `canceled`. + #[serde(skip_serializing_if = "Option::is_none")] + pub status: Option, + /// Only return cards that have the given type. One of `virtual` or `physical`. + #[serde(rename = "type")] + #[serde(skip_serializing_if = "Option::is_none")] + pub type_: Option, +} +impl<'a> ListIssuingCard<'a> { + pub fn new() -> Self { + Self::default() + } +} +impl<'a> ListIssuingCard<'a> { + /// Returns a list of Issuing `Card` objects. + /// The objects are sorted in descending order by creation date, with the most recently created object appearing first. + pub fn send( + &self, + client: &stripe::Client, + ) -> stripe::Response> { + client.get_query("/issuing/cards", self) + } + pub fn paginate(self) -> stripe::ListPaginator> { + stripe::ListPaginator::from_list_params("/issuing/cards", self) + } +} +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct RetrieveIssuingCard<'a> { + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, +} +impl<'a> RetrieveIssuingCard<'a> { + pub fn new() -> Self { + Self::default() + } +} +impl<'a> RetrieveIssuingCard<'a> { + /// Retrieves an Issuing `Card` object. + pub fn send( + &self, + client: &stripe::Client, + card: &stripe_shared::IssuingCardId, + ) -> stripe::Response { + client.get_query(&format!("/issuing/cards/{card}"), self) + } +} +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreateIssuingCard<'a> { + /// The [Cardholder](https://stripe.com/docs/api#issuing_cardholder_object) object with which the card will be associated. + #[serde(skip_serializing_if = "Option::is_none")] + pub cardholder: Option<&'a str>, + /// The currency for the card. + pub currency: stripe_types::Currency, + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, + #[serde(skip_serializing_if = "Option::is_none")] + pub financial_account: Option<&'a str>, + /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. + /// This can be useful for storing additional information about the object in a structured format. + /// Individual keys can be unset by posting an empty value to them. + /// All keys can be unset by posting an empty value to `metadata`. + #[serde(skip_serializing_if = "Option::is_none")] + pub metadata: Option<&'a std::collections::HashMap>, + /// The desired PIN for this card. + #[serde(skip_serializing_if = "Option::is_none")] + pub pin: Option>, + /// The card this is meant to be a replacement for (if any). + #[serde(skip_serializing_if = "Option::is_none")] + pub replacement_for: Option<&'a str>, + /// If `replacement_for` is specified, this should indicate why that card is being replaced. + #[serde(skip_serializing_if = "Option::is_none")] + pub replacement_reason: Option, + /// The address where the card will be shipped. + #[serde(skip_serializing_if = "Option::is_none")] + pub shipping: Option>, + /// Rules that control spending for this card. + /// Refer to our [documentation](https://stripe.com/docs/issuing/controls/spending-controls) for more details. + #[serde(skip_serializing_if = "Option::is_none")] + pub spending_controls: Option>, + /// Whether authorizations can be approved on this card. + /// May be blocked from activating cards depending on past-due Cardholder requirements. + /// Defaults to `inactive`. + #[serde(skip_serializing_if = "Option::is_none")] + pub status: Option, + /// The type of card to issue. Possible values are `physical` or `virtual`. + #[serde(rename = "type")] + pub type_: stripe_shared::IssuingCardType, +} +impl<'a> CreateIssuingCard<'a> { + pub fn new(currency: stripe_types::Currency, type_: stripe_shared::IssuingCardType) -> Self { + Self { + cardholder: None, + currency, + expand: None, + financial_account: None, + metadata: None, + pin: None, + replacement_for: None, + replacement_reason: None, + shipping: None, + spending_controls: None, + status: None, + type_, + } + } +} +/// The address where the card will be shipped. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreateIssuingCardShipping<'a> { + /// The address that the card is shipped to. + pub address: CreateIssuingCardShippingAddress<'a>, + /// Customs information for the shipment. + #[serde(skip_serializing_if = "Option::is_none")] + pub customs: Option>, + /// The name printed on the shipping label when shipping the card. + pub name: &'a str, + /// Phone number of the recipient of the shipment. + #[serde(skip_serializing_if = "Option::is_none")] + pub phone_number: Option<&'a str>, + /// Whether a signature is required for card delivery. + #[serde(skip_serializing_if = "Option::is_none")] + pub require_signature: Option, + /// Shipment service. + #[serde(skip_serializing_if = "Option::is_none")] + pub service: Option, + /// Packaging options. + #[serde(rename = "type")] + #[serde(skip_serializing_if = "Option::is_none")] + pub type_: Option, +} +impl<'a> CreateIssuingCardShipping<'a> { + pub fn new(address: CreateIssuingCardShippingAddress<'a>, name: &'a str) -> Self { + Self { + address, + customs: None, + name, + phone_number: None, + require_signature: None, + service: None, + type_: None, + } + } +} +/// The address that the card is shipped to. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreateIssuingCardShippingAddress<'a> { + /// City, district, suburb, town, or village. + pub city: &'a str, + /// Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). + pub country: &'a str, + /// Address line 1 (e.g., street, PO Box, or company name). + pub line1: &'a str, + /// Address line 2 (e.g., apartment, suite, unit, or building). + #[serde(skip_serializing_if = "Option::is_none")] + pub line2: Option<&'a str>, + /// ZIP or postal code. + pub postal_code: &'a str, + /// State, county, province, or region. + #[serde(skip_serializing_if = "Option::is_none")] + pub state: Option<&'a str>, +} +impl<'a> CreateIssuingCardShippingAddress<'a> { + pub fn new(city: &'a str, country: &'a str, line1: &'a str, postal_code: &'a str) -> Self { + Self { city, country, line1, line2: None, postal_code, state: None } + } +} +/// Customs information for the shipment. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreateIssuingCardShippingCustoms<'a> { + /// The Economic Operators Registration and Identification (EORI) number to use for Customs. + /// Required for bulk shipments to Europe. + #[serde(skip_serializing_if = "Option::is_none")] + pub eori_number: Option<&'a str>, +} +impl<'a> CreateIssuingCardShippingCustoms<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// Shipment service. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreateIssuingCardShippingService { + Express, + Priority, + Standard, +} +impl CreateIssuingCardShippingService { + pub fn as_str(self) -> &'static str { + use CreateIssuingCardShippingService::*; + match self { + Express => "express", + Priority => "priority", + Standard => "standard", + } + } +} + +impl std::str::FromStr for CreateIssuingCardShippingService { + type Err = (); + fn from_str(s: &str) -> Result { + use CreateIssuingCardShippingService::*; + match s { + "express" => Ok(Express), + "priority" => Ok(Priority), + "standard" => Ok(Standard), + _ => Err(()), + } + } +} +impl std::fmt::Display for CreateIssuingCardShippingService { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreateIssuingCardShippingService { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreateIssuingCardShippingService { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Packaging options. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreateIssuingCardShippingType { + Bulk, + Individual, +} +impl CreateIssuingCardShippingType { + pub fn as_str(self) -> &'static str { + use CreateIssuingCardShippingType::*; + match self { + Bulk => "bulk", + Individual => "individual", + } + } +} + +impl std::str::FromStr for CreateIssuingCardShippingType { + type Err = (); + fn from_str(s: &str) -> Result { + use CreateIssuingCardShippingType::*; + match s { + "bulk" => Ok(Bulk), + "individual" => Ok(Individual), + _ => Err(()), + } + } +} +impl std::fmt::Display for CreateIssuingCardShippingType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreateIssuingCardShippingType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreateIssuingCardShippingType { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Rules that control spending for this card. +/// Refer to our [documentation](https://stripe.com/docs/issuing/controls/spending-controls) for more details. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreateIssuingCardSpendingControls<'a> { + /// Array of strings containing [categories](https://stripe.com/docs/api#issuing_authorization_object-merchant_data-category) of authorizations to allow. + /// All other categories will be blocked. + /// Cannot be set with `blocked_categories`. + #[serde(skip_serializing_if = "Option::is_none")] + pub allowed_categories: Option<&'a [CreateIssuingCardSpendingControlsAllowedCategories]>, + /// Array of strings containing [categories](https://stripe.com/docs/api#issuing_authorization_object-merchant_data-category) of authorizations to decline. + /// All other categories will be allowed. + /// Cannot be set with `allowed_categories`. + #[serde(skip_serializing_if = "Option::is_none")] + pub blocked_categories: Option<&'a [CreateIssuingCardSpendingControlsBlockedCategories]>, + /// Limit spending with amount-based rules that apply across any cards this card replaced (i.e., its `replacement_for` card and _that_ card's `replacement_for` card, up the chain). + #[serde(skip_serializing_if = "Option::is_none")] + pub spending_limits: Option<&'a [CreateIssuingCardSpendingControlsSpendingLimits<'a>]>, +} +impl<'a> CreateIssuingCardSpendingControls<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// Array of strings containing [categories](https://stripe.com/docs/api#issuing_authorization_object-merchant_data-category) of authorizations to allow. +/// All other categories will be blocked. +/// Cannot be set with `blocked_categories`. +#[derive(Copy, Clone, Eq, PartialEq)] +#[non_exhaustive] +pub enum CreateIssuingCardSpendingControlsAllowedCategories { + AcRefrigerationRepair, + AccountingBookkeepingServices, + AdvertisingServices, + AgriculturalCooperative, + AirlinesAirCarriers, + AirportsFlyingFields, + AmbulanceServices, + AmusementParksCarnivals, + AntiqueReproductions, + AntiqueShops, + Aquariums, + ArchitecturalSurveyingServices, + ArtDealersAndGalleries, + ArtistsSupplyAndCraftShops, + AutoAndHomeSupplyStores, + AutoBodyRepairShops, + AutoPaintShops, + AutoServiceShops, + AutomatedCashDisburse, + AutomatedFuelDispensers, + AutomobileAssociations, + AutomotivePartsAndAccessoriesStores, + AutomotiveTireStores, + BailAndBondPayments, + Bakeries, + BandsOrchestras, + BarberAndBeautyShops, + BettingCasinoGambling, + BicycleShops, + BilliardPoolEstablishments, + BoatDealers, + BoatRentalsAndLeases, + BookStores, + BooksPeriodicalsAndNewspapers, + BowlingAlleys, + BusLines, + BusinessSecretarialSchools, + BuyingShoppingServices, + CableSatelliteAndOtherPayTelevisionAndRadio, + CameraAndPhotographicSupplyStores, + CandyNutAndConfectioneryStores, + CarAndTruckDealersNewUsed, + CarAndTruckDealersUsedOnly, + CarRentalAgencies, + CarWashes, + CarpentryServices, + CarpetUpholsteryCleaning, + Caterers, + CharitableAndSocialServiceOrganizationsFundraising, + ChemicalsAndAlliedProducts, + ChildCareServices, + ChildrensAndInfantsWearStores, + ChiropodistsPodiatrists, + Chiropractors, + CigarStoresAndStands, + CivicSocialFraternalAssociations, + CleaningAndMaintenance, + ClothingRental, + CollegesUniversities, + CommercialEquipment, + CommercialFootwear, + CommercialPhotographyArtAndGraphics, + CommuterTransportAndFerries, + ComputerNetworkServices, + ComputerProgramming, + ComputerRepair, + ComputerSoftwareStores, + ComputersPeripheralsAndSoftware, + ConcreteWorkServices, + ConstructionMaterials, + ConsultingPublicRelations, + CorrespondenceSchools, + CosmeticStores, + CounselingServices, + CountryClubs, + CourierServices, + CourtCosts, + CreditReportingAgencies, + CruiseLines, + DairyProductsStores, + DanceHallStudiosSchools, + DatingEscortServices, + DentistsOrthodontists, + DepartmentStores, + DetectiveAgencies, + DigitalGoodsApplications, + DigitalGoodsGames, + DigitalGoodsLargeVolume, + DigitalGoodsMedia, + DirectMarketingCatalogMerchant, + DirectMarketingCombinationCatalogAndRetailMerchant, + DirectMarketingInboundTelemarketing, + DirectMarketingInsuranceServices, + DirectMarketingOther, + DirectMarketingOutboundTelemarketing, + DirectMarketingSubscription, + DirectMarketingTravel, + DiscountStores, + Doctors, + DoorToDoorSales, + DraperyWindowCoveringAndUpholsteryStores, + DrinkingPlaces, + DrugStoresAndPharmacies, + DrugsDrugProprietariesAndDruggistSundries, + DryCleaners, + DurableGoods, + DutyFreeStores, + EatingPlacesRestaurants, + EducationalServices, + ElectricRazorStores, + ElectricVehicleCharging, + ElectricalPartsAndEquipment, + ElectricalServices, + ElectronicsRepairShops, + ElectronicsStores, + ElementarySecondarySchools, + EmergencyServicesGcasVisaUseOnly, + EmploymentTempAgencies, + EquipmentRental, + ExterminatingServices, + FamilyClothingStores, + FastFoodRestaurants, + FinancialInstitutions, + FinesGovernmentAdministrativeEntities, + FireplaceFireplaceScreensAndAccessoriesStores, + FloorCoveringStores, + Florists, + FloristsSuppliesNurseryStockAndFlowers, + FreezerAndLockerMeatProvisioners, + FuelDealersNonAutomotive, + FuneralServicesCrematories, + FurnitureHomeFurnishingsAndEquipmentStoresExceptAppliances, + FurnitureRepairRefinishing, + FurriersAndFurShops, + GeneralServices, + GiftCardNoveltyAndSouvenirShops, + GlassPaintAndWallpaperStores, + GlasswareCrystalStores, + GolfCoursesPublic, + GovernmentLicensedHorseDogRacingUsRegionOnly, + GovernmentLicensedOnlineCasionsOnlineGamblingUsRegionOnly, + GovernmentOwnedLotteriesNonUsRegion, + GovernmentOwnedLotteriesUsRegionOnly, + GovernmentServices, + GroceryStoresSupermarkets, + HardwareEquipmentAndSupplies, + HardwareStores, + HealthAndBeautySpas, + HearingAidsSalesAndSupplies, + HeatingPlumbingAC, + HobbyToyAndGameShops, + HomeSupplyWarehouseStores, + Hospitals, + HotelsMotelsAndResorts, + HouseholdApplianceStores, + IndustrialSupplies, + InformationRetrievalServices, + InsuranceDefault, + InsuranceUnderwritingPremiums, + IntraCompanyPurchases, + JewelryStoresWatchesClocksAndSilverwareStores, + LandscapingServices, + Laundries, + LaundryCleaningServices, + LegalServicesAttorneys, + LuggageAndLeatherGoodsStores, + LumberBuildingMaterialsStores, + ManualCashDisburse, + MarinasServiceAndSupplies, + Marketplaces, + MasonryStoneworkAndPlaster, + MassageParlors, + MedicalAndDentalLabs, + MedicalDentalOphthalmicAndHospitalEquipmentAndSupplies, + MedicalServices, + MembershipOrganizations, + MensAndBoysClothingAndAccessoriesStores, + MensWomensClothingStores, + MetalServiceCenters, + Miscellaneous, + MiscellaneousApparelAndAccessoryShops, + MiscellaneousAutoDealers, + MiscellaneousBusinessServices, + MiscellaneousFoodStores, + MiscellaneousGeneralMerchandise, + MiscellaneousGeneralServices, + MiscellaneousHomeFurnishingSpecialtyStores, + MiscellaneousPublishingAndPrinting, + MiscellaneousRecreationServices, + MiscellaneousRepairShops, + MiscellaneousSpecialtyRetail, + MobileHomeDealers, + MotionPictureTheaters, + MotorFreightCarriersAndTrucking, + MotorHomesDealers, + MotorVehicleSuppliesAndNewParts, + MotorcycleShopsAndDealers, + MotorcycleShopsDealers, + MusicStoresMusicalInstrumentsPianosAndSheetMusic, + NewsDealersAndNewsstands, + NonFiMoneyOrders, + NonFiStoredValueCardPurchaseLoad, + NondurableGoods, + NurseriesLawnAndGardenSupplyStores, + NursingPersonalCare, + OfficeAndCommercialFurniture, + OpticiansEyeglasses, + OptometristsOphthalmologist, + OrthopedicGoodsProstheticDevices, + Osteopaths, + PackageStoresBeerWineAndLiquor, + PaintsVarnishesAndSupplies, + ParkingLotsGarages, + PassengerRailways, + PawnShops, + PetShopsPetFoodAndSupplies, + PetroleumAndPetroleumProducts, + PhotoDeveloping, + PhotographicPhotocopyMicrofilmEquipmentAndSupplies, + PhotographicStudios, + PictureVideoProduction, + PieceGoodsNotionsAndOtherDryGoods, + PlumbingHeatingEquipmentAndSupplies, + PoliticalOrganizations, + PostalServicesGovernmentOnly, + PreciousStonesAndMetalsWatchesAndJewelry, + ProfessionalServices, + PublicWarehousingAndStorage, + QuickCopyReproAndBlueprint, + Railroads, + RealEstateAgentsAndManagersRentals, + RecordStores, + RecreationalVehicleRentals, + ReligiousGoodsStores, + ReligiousOrganizations, + RoofingSidingSheetMetal, + SecretarialSupportServices, + SecurityBrokersDealers, + ServiceStations, + SewingNeedleworkFabricAndPieceGoodsStores, + ShoeRepairHatCleaning, + ShoeStores, + SmallApplianceRepair, + SnowmobileDealers, + SpecialTradeServices, + SpecialtyCleaning, + SportingGoodsStores, + SportingRecreationCamps, + SportsAndRidingApparelStores, + SportsClubsFields, + StampAndCoinStores, + StationaryOfficeSuppliesPrintingAndWritingPaper, + StationeryStoresOfficeAndSchoolSupplyStores, + SwimmingPoolsSales, + TUiTravelGermany, + TailorsAlterations, + TaxPaymentsGovernmentAgencies, + TaxPreparationServices, + TaxicabsLimousines, + TelecommunicationEquipmentAndTelephoneSales, + TelecommunicationServices, + TelegraphServices, + TentAndAwningShops, + TestingLaboratories, + TheatricalTicketAgencies, + Timeshares, + TireRetreadingAndRepair, + TollsBridgeFees, + TouristAttractionsAndExhibits, + TowingServices, + TrailerParksCampgrounds, + TransportationServices, + TravelAgenciesTourOperators, + TruckStopIteration, + TruckUtilityTrailerRentals, + TypesettingPlateMakingAndRelatedServices, + TypewriterStores, + USFederalGovernmentAgenciesOrDepartments, + UniformsCommercialClothing, + UsedMerchandiseAndSecondhandStores, + Utilities, + VarietyStores, + VeterinaryServices, + VideoAmusementGameSupplies, + VideoGameArcades, + VideoTapeRentalStores, + VocationalTradeSchools, + WatchJewelryRepair, + WeldingRepair, + WholesaleClubs, + WigAndToupeeStores, + WiresMoneyOrders, + WomensAccessoryAndSpecialtyShops, + WomensReadyToWearStores, + WreckingAndSalvageYards, + /// An unrecognized value from Stripe. Should not be used as a request parameter. + Unknown, +} +impl CreateIssuingCardSpendingControlsAllowedCategories { + pub fn as_str(self) -> &'static str { + use CreateIssuingCardSpendingControlsAllowedCategories::*; + match self { + AcRefrigerationRepair => "ac_refrigeration_repair", + AccountingBookkeepingServices => "accounting_bookkeeping_services", + AdvertisingServices => "advertising_services", + AgriculturalCooperative => "agricultural_cooperative", + AirlinesAirCarriers => "airlines_air_carriers", + AirportsFlyingFields => "airports_flying_fields", + AmbulanceServices => "ambulance_services", + AmusementParksCarnivals => "amusement_parks_carnivals", + AntiqueReproductions => "antique_reproductions", + AntiqueShops => "antique_shops", + Aquariums => "aquariums", + ArchitecturalSurveyingServices => "architectural_surveying_services", + ArtDealersAndGalleries => "art_dealers_and_galleries", + ArtistsSupplyAndCraftShops => "artists_supply_and_craft_shops", + AutoAndHomeSupplyStores => "auto_and_home_supply_stores", + AutoBodyRepairShops => "auto_body_repair_shops", + AutoPaintShops => "auto_paint_shops", + AutoServiceShops => "auto_service_shops", + AutomatedCashDisburse => "automated_cash_disburse", + AutomatedFuelDispensers => "automated_fuel_dispensers", + AutomobileAssociations => "automobile_associations", + AutomotivePartsAndAccessoriesStores => "automotive_parts_and_accessories_stores", + AutomotiveTireStores => "automotive_tire_stores", + BailAndBondPayments => "bail_and_bond_payments", + Bakeries => "bakeries", + BandsOrchestras => "bands_orchestras", + BarberAndBeautyShops => "barber_and_beauty_shops", + BettingCasinoGambling => "betting_casino_gambling", + BicycleShops => "bicycle_shops", + BilliardPoolEstablishments => "billiard_pool_establishments", + BoatDealers => "boat_dealers", + BoatRentalsAndLeases => "boat_rentals_and_leases", + BookStores => "book_stores", + BooksPeriodicalsAndNewspapers => "books_periodicals_and_newspapers", + BowlingAlleys => "bowling_alleys", + BusLines => "bus_lines", + BusinessSecretarialSchools => "business_secretarial_schools", + BuyingShoppingServices => "buying_shopping_services", + CableSatelliteAndOtherPayTelevisionAndRadio => { + "cable_satellite_and_other_pay_television_and_radio" + } + CameraAndPhotographicSupplyStores => "camera_and_photographic_supply_stores", + CandyNutAndConfectioneryStores => "candy_nut_and_confectionery_stores", + CarAndTruckDealersNewUsed => "car_and_truck_dealers_new_used", + CarAndTruckDealersUsedOnly => "car_and_truck_dealers_used_only", + CarRentalAgencies => "car_rental_agencies", + CarWashes => "car_washes", + CarpentryServices => "carpentry_services", + CarpetUpholsteryCleaning => "carpet_upholstery_cleaning", + Caterers => "caterers", + CharitableAndSocialServiceOrganizationsFundraising => { + "charitable_and_social_service_organizations_fundraising" + } + ChemicalsAndAlliedProducts => "chemicals_and_allied_products", + ChildCareServices => "child_care_services", + ChildrensAndInfantsWearStores => "childrens_and_infants_wear_stores", + ChiropodistsPodiatrists => "chiropodists_podiatrists", + Chiropractors => "chiropractors", + CigarStoresAndStands => "cigar_stores_and_stands", + CivicSocialFraternalAssociations => "civic_social_fraternal_associations", + CleaningAndMaintenance => "cleaning_and_maintenance", + ClothingRental => "clothing_rental", + CollegesUniversities => "colleges_universities", + CommercialEquipment => "commercial_equipment", + CommercialFootwear => "commercial_footwear", + CommercialPhotographyArtAndGraphics => "commercial_photography_art_and_graphics", + CommuterTransportAndFerries => "commuter_transport_and_ferries", + ComputerNetworkServices => "computer_network_services", + ComputerProgramming => "computer_programming", + ComputerRepair => "computer_repair", + ComputerSoftwareStores => "computer_software_stores", + ComputersPeripheralsAndSoftware => "computers_peripherals_and_software", + ConcreteWorkServices => "concrete_work_services", + ConstructionMaterials => "construction_materials", + ConsultingPublicRelations => "consulting_public_relations", + CorrespondenceSchools => "correspondence_schools", + CosmeticStores => "cosmetic_stores", + CounselingServices => "counseling_services", + CountryClubs => "country_clubs", + CourierServices => "courier_services", + CourtCosts => "court_costs", + CreditReportingAgencies => "credit_reporting_agencies", + CruiseLines => "cruise_lines", + DairyProductsStores => "dairy_products_stores", + DanceHallStudiosSchools => "dance_hall_studios_schools", + DatingEscortServices => "dating_escort_services", + DentistsOrthodontists => "dentists_orthodontists", + DepartmentStores => "department_stores", + DetectiveAgencies => "detective_agencies", + DigitalGoodsApplications => "digital_goods_applications", + DigitalGoodsGames => "digital_goods_games", + DigitalGoodsLargeVolume => "digital_goods_large_volume", + DigitalGoodsMedia => "digital_goods_media", + DirectMarketingCatalogMerchant => "direct_marketing_catalog_merchant", + DirectMarketingCombinationCatalogAndRetailMerchant => { + "direct_marketing_combination_catalog_and_retail_merchant" + } + DirectMarketingInboundTelemarketing => "direct_marketing_inbound_telemarketing", + DirectMarketingInsuranceServices => "direct_marketing_insurance_services", + DirectMarketingOther => "direct_marketing_other", + DirectMarketingOutboundTelemarketing => "direct_marketing_outbound_telemarketing", + DirectMarketingSubscription => "direct_marketing_subscription", + DirectMarketingTravel => "direct_marketing_travel", + DiscountStores => "discount_stores", + Doctors => "doctors", + DoorToDoorSales => "door_to_door_sales", + DraperyWindowCoveringAndUpholsteryStores => { + "drapery_window_covering_and_upholstery_stores" + } + DrinkingPlaces => "drinking_places", + DrugStoresAndPharmacies => "drug_stores_and_pharmacies", + DrugsDrugProprietariesAndDruggistSundries => { + "drugs_drug_proprietaries_and_druggist_sundries" + } + DryCleaners => "dry_cleaners", + DurableGoods => "durable_goods", + DutyFreeStores => "duty_free_stores", + EatingPlacesRestaurants => "eating_places_restaurants", + EducationalServices => "educational_services", + ElectricRazorStores => "electric_razor_stores", + ElectricVehicleCharging => "electric_vehicle_charging", + ElectricalPartsAndEquipment => "electrical_parts_and_equipment", + ElectricalServices => "electrical_services", + ElectronicsRepairShops => "electronics_repair_shops", + ElectronicsStores => "electronics_stores", + ElementarySecondarySchools => "elementary_secondary_schools", + EmergencyServicesGcasVisaUseOnly => "emergency_services_gcas_visa_use_only", + EmploymentTempAgencies => "employment_temp_agencies", + EquipmentRental => "equipment_rental", + ExterminatingServices => "exterminating_services", + FamilyClothingStores => "family_clothing_stores", + FastFoodRestaurants => "fast_food_restaurants", + FinancialInstitutions => "financial_institutions", + FinesGovernmentAdministrativeEntities => "fines_government_administrative_entities", + FireplaceFireplaceScreensAndAccessoriesStores => { + "fireplace_fireplace_screens_and_accessories_stores" + } + FloorCoveringStores => "floor_covering_stores", + Florists => "florists", + FloristsSuppliesNurseryStockAndFlowers => "florists_supplies_nursery_stock_and_flowers", + FreezerAndLockerMeatProvisioners => "freezer_and_locker_meat_provisioners", + FuelDealersNonAutomotive => "fuel_dealers_non_automotive", + FuneralServicesCrematories => "funeral_services_crematories", + FurnitureHomeFurnishingsAndEquipmentStoresExceptAppliances => { + "furniture_home_furnishings_and_equipment_stores_except_appliances" + } + FurnitureRepairRefinishing => "furniture_repair_refinishing", + FurriersAndFurShops => "furriers_and_fur_shops", + GeneralServices => "general_services", + GiftCardNoveltyAndSouvenirShops => "gift_card_novelty_and_souvenir_shops", + GlassPaintAndWallpaperStores => "glass_paint_and_wallpaper_stores", + GlasswareCrystalStores => "glassware_crystal_stores", + GolfCoursesPublic => "golf_courses_public", + GovernmentLicensedHorseDogRacingUsRegionOnly => { + "government_licensed_horse_dog_racing_us_region_only" + } + GovernmentLicensedOnlineCasionsOnlineGamblingUsRegionOnly => { + "government_licensed_online_casions_online_gambling_us_region_only" + } + GovernmentOwnedLotteriesNonUsRegion => "government_owned_lotteries_non_us_region", + GovernmentOwnedLotteriesUsRegionOnly => "government_owned_lotteries_us_region_only", + GovernmentServices => "government_services", + GroceryStoresSupermarkets => "grocery_stores_supermarkets", + HardwareEquipmentAndSupplies => "hardware_equipment_and_supplies", + HardwareStores => "hardware_stores", + HealthAndBeautySpas => "health_and_beauty_spas", + HearingAidsSalesAndSupplies => "hearing_aids_sales_and_supplies", + HeatingPlumbingAC => "heating_plumbing_a_c", + HobbyToyAndGameShops => "hobby_toy_and_game_shops", + HomeSupplyWarehouseStores => "home_supply_warehouse_stores", + Hospitals => "hospitals", + HotelsMotelsAndResorts => "hotels_motels_and_resorts", + HouseholdApplianceStores => "household_appliance_stores", + IndustrialSupplies => "industrial_supplies", + InformationRetrievalServices => "information_retrieval_services", + InsuranceDefault => "insurance_default", + InsuranceUnderwritingPremiums => "insurance_underwriting_premiums", + IntraCompanyPurchases => "intra_company_purchases", + JewelryStoresWatchesClocksAndSilverwareStores => { + "jewelry_stores_watches_clocks_and_silverware_stores" + } + LandscapingServices => "landscaping_services", + Laundries => "laundries", + LaundryCleaningServices => "laundry_cleaning_services", + LegalServicesAttorneys => "legal_services_attorneys", + LuggageAndLeatherGoodsStores => "luggage_and_leather_goods_stores", + LumberBuildingMaterialsStores => "lumber_building_materials_stores", + ManualCashDisburse => "manual_cash_disburse", + MarinasServiceAndSupplies => "marinas_service_and_supplies", + Marketplaces => "marketplaces", + MasonryStoneworkAndPlaster => "masonry_stonework_and_plaster", + MassageParlors => "massage_parlors", + MedicalAndDentalLabs => "medical_and_dental_labs", + MedicalDentalOphthalmicAndHospitalEquipmentAndSupplies => { + "medical_dental_ophthalmic_and_hospital_equipment_and_supplies" + } + MedicalServices => "medical_services", + MembershipOrganizations => "membership_organizations", + MensAndBoysClothingAndAccessoriesStores => { + "mens_and_boys_clothing_and_accessories_stores" + } + MensWomensClothingStores => "mens_womens_clothing_stores", + MetalServiceCenters => "metal_service_centers", + Miscellaneous => "miscellaneous", + MiscellaneousApparelAndAccessoryShops => "miscellaneous_apparel_and_accessory_shops", + MiscellaneousAutoDealers => "miscellaneous_auto_dealers", + MiscellaneousBusinessServices => "miscellaneous_business_services", + MiscellaneousFoodStores => "miscellaneous_food_stores", + MiscellaneousGeneralMerchandise => "miscellaneous_general_merchandise", + MiscellaneousGeneralServices => "miscellaneous_general_services", + MiscellaneousHomeFurnishingSpecialtyStores => { + "miscellaneous_home_furnishing_specialty_stores" + } + MiscellaneousPublishingAndPrinting => "miscellaneous_publishing_and_printing", + MiscellaneousRecreationServices => "miscellaneous_recreation_services", + MiscellaneousRepairShops => "miscellaneous_repair_shops", + MiscellaneousSpecialtyRetail => "miscellaneous_specialty_retail", + MobileHomeDealers => "mobile_home_dealers", + MotionPictureTheaters => "motion_picture_theaters", + MotorFreightCarriersAndTrucking => "motor_freight_carriers_and_trucking", + MotorHomesDealers => "motor_homes_dealers", + MotorVehicleSuppliesAndNewParts => "motor_vehicle_supplies_and_new_parts", + MotorcycleShopsAndDealers => "motorcycle_shops_and_dealers", + MotorcycleShopsDealers => "motorcycle_shops_dealers", + MusicStoresMusicalInstrumentsPianosAndSheetMusic => { + "music_stores_musical_instruments_pianos_and_sheet_music" + } + NewsDealersAndNewsstands => "news_dealers_and_newsstands", + NonFiMoneyOrders => "non_fi_money_orders", + NonFiStoredValueCardPurchaseLoad => "non_fi_stored_value_card_purchase_load", + NondurableGoods => "nondurable_goods", + NurseriesLawnAndGardenSupplyStores => "nurseries_lawn_and_garden_supply_stores", + NursingPersonalCare => "nursing_personal_care", + OfficeAndCommercialFurniture => "office_and_commercial_furniture", + OpticiansEyeglasses => "opticians_eyeglasses", + OptometristsOphthalmologist => "optometrists_ophthalmologist", + OrthopedicGoodsProstheticDevices => "orthopedic_goods_prosthetic_devices", + Osteopaths => "osteopaths", + PackageStoresBeerWineAndLiquor => "package_stores_beer_wine_and_liquor", + PaintsVarnishesAndSupplies => "paints_varnishes_and_supplies", + ParkingLotsGarages => "parking_lots_garages", + PassengerRailways => "passenger_railways", + PawnShops => "pawn_shops", + PetShopsPetFoodAndSupplies => "pet_shops_pet_food_and_supplies", + PetroleumAndPetroleumProducts => "petroleum_and_petroleum_products", + PhotoDeveloping => "photo_developing", + PhotographicPhotocopyMicrofilmEquipmentAndSupplies => { + "photographic_photocopy_microfilm_equipment_and_supplies" + } + PhotographicStudios => "photographic_studios", + PictureVideoProduction => "picture_video_production", + PieceGoodsNotionsAndOtherDryGoods => "piece_goods_notions_and_other_dry_goods", + PlumbingHeatingEquipmentAndSupplies => "plumbing_heating_equipment_and_supplies", + PoliticalOrganizations => "political_organizations", + PostalServicesGovernmentOnly => "postal_services_government_only", + PreciousStonesAndMetalsWatchesAndJewelry => { + "precious_stones_and_metals_watches_and_jewelry" + } + ProfessionalServices => "professional_services", + PublicWarehousingAndStorage => "public_warehousing_and_storage", + QuickCopyReproAndBlueprint => "quick_copy_repro_and_blueprint", + Railroads => "railroads", + RealEstateAgentsAndManagersRentals => "real_estate_agents_and_managers_rentals", + RecordStores => "record_stores", + RecreationalVehicleRentals => "recreational_vehicle_rentals", + ReligiousGoodsStores => "religious_goods_stores", + ReligiousOrganizations => "religious_organizations", + RoofingSidingSheetMetal => "roofing_siding_sheet_metal", + SecretarialSupportServices => "secretarial_support_services", + SecurityBrokersDealers => "security_brokers_dealers", + ServiceStations => "service_stations", + SewingNeedleworkFabricAndPieceGoodsStores => { + "sewing_needlework_fabric_and_piece_goods_stores" + } + ShoeRepairHatCleaning => "shoe_repair_hat_cleaning", + ShoeStores => "shoe_stores", + SmallApplianceRepair => "small_appliance_repair", + SnowmobileDealers => "snowmobile_dealers", + SpecialTradeServices => "special_trade_services", + SpecialtyCleaning => "specialty_cleaning", + SportingGoodsStores => "sporting_goods_stores", + SportingRecreationCamps => "sporting_recreation_camps", + SportsAndRidingApparelStores => "sports_and_riding_apparel_stores", + SportsClubsFields => "sports_clubs_fields", + StampAndCoinStores => "stamp_and_coin_stores", + StationaryOfficeSuppliesPrintingAndWritingPaper => { + "stationary_office_supplies_printing_and_writing_paper" + } + StationeryStoresOfficeAndSchoolSupplyStores => { + "stationery_stores_office_and_school_supply_stores" + } + SwimmingPoolsSales => "swimming_pools_sales", + TUiTravelGermany => "t_ui_travel_germany", + TailorsAlterations => "tailors_alterations", + TaxPaymentsGovernmentAgencies => "tax_payments_government_agencies", + TaxPreparationServices => "tax_preparation_services", + TaxicabsLimousines => "taxicabs_limousines", + TelecommunicationEquipmentAndTelephoneSales => { + "telecommunication_equipment_and_telephone_sales" + } + TelecommunicationServices => "telecommunication_services", + TelegraphServices => "telegraph_services", + TentAndAwningShops => "tent_and_awning_shops", + TestingLaboratories => "testing_laboratories", + TheatricalTicketAgencies => "theatrical_ticket_agencies", + Timeshares => "timeshares", + TireRetreadingAndRepair => "tire_retreading_and_repair", + TollsBridgeFees => "tolls_bridge_fees", + TouristAttractionsAndExhibits => "tourist_attractions_and_exhibits", + TowingServices => "towing_services", + TrailerParksCampgrounds => "trailer_parks_campgrounds", + TransportationServices => "transportation_services", + TravelAgenciesTourOperators => "travel_agencies_tour_operators", + TruckStopIteration => "truck_stop_iteration", + TruckUtilityTrailerRentals => "truck_utility_trailer_rentals", + TypesettingPlateMakingAndRelatedServices => { + "typesetting_plate_making_and_related_services" + } + TypewriterStores => "typewriter_stores", + USFederalGovernmentAgenciesOrDepartments => { + "u_s_federal_government_agencies_or_departments" + } + UniformsCommercialClothing => "uniforms_commercial_clothing", + UsedMerchandiseAndSecondhandStores => "used_merchandise_and_secondhand_stores", + Utilities => "utilities", + VarietyStores => "variety_stores", + VeterinaryServices => "veterinary_services", + VideoAmusementGameSupplies => "video_amusement_game_supplies", + VideoGameArcades => "video_game_arcades", + VideoTapeRentalStores => "video_tape_rental_stores", + VocationalTradeSchools => "vocational_trade_schools", + WatchJewelryRepair => "watch_jewelry_repair", + WeldingRepair => "welding_repair", + WholesaleClubs => "wholesale_clubs", + WigAndToupeeStores => "wig_and_toupee_stores", + WiresMoneyOrders => "wires_money_orders", + WomensAccessoryAndSpecialtyShops => "womens_accessory_and_specialty_shops", + WomensReadyToWearStores => "womens_ready_to_wear_stores", + WreckingAndSalvageYards => "wrecking_and_salvage_yards", + Unknown => "unknown", + } + } +} + +impl std::str::FromStr for CreateIssuingCardSpendingControlsAllowedCategories { + type Err = (); + fn from_str(s: &str) -> Result { + use CreateIssuingCardSpendingControlsAllowedCategories::*; + match s { + "ac_refrigeration_repair" => Ok(AcRefrigerationRepair), + "accounting_bookkeeping_services" => Ok(AccountingBookkeepingServices), + "advertising_services" => Ok(AdvertisingServices), + "agricultural_cooperative" => Ok(AgriculturalCooperative), + "airlines_air_carriers" => Ok(AirlinesAirCarriers), + "airports_flying_fields" => Ok(AirportsFlyingFields), + "ambulance_services" => Ok(AmbulanceServices), + "amusement_parks_carnivals" => Ok(AmusementParksCarnivals), + "antique_reproductions" => Ok(AntiqueReproductions), + "antique_shops" => Ok(AntiqueShops), + "aquariums" => Ok(Aquariums), + "architectural_surveying_services" => Ok(ArchitecturalSurveyingServices), + "art_dealers_and_galleries" => Ok(ArtDealersAndGalleries), + "artists_supply_and_craft_shops" => Ok(ArtistsSupplyAndCraftShops), + "auto_and_home_supply_stores" => Ok(AutoAndHomeSupplyStores), + "auto_body_repair_shops" => Ok(AutoBodyRepairShops), + "auto_paint_shops" => Ok(AutoPaintShops), + "auto_service_shops" => Ok(AutoServiceShops), + "automated_cash_disburse" => Ok(AutomatedCashDisburse), + "automated_fuel_dispensers" => Ok(AutomatedFuelDispensers), + "automobile_associations" => Ok(AutomobileAssociations), + "automotive_parts_and_accessories_stores" => Ok(AutomotivePartsAndAccessoriesStores), + "automotive_tire_stores" => Ok(AutomotiveTireStores), + "bail_and_bond_payments" => Ok(BailAndBondPayments), + "bakeries" => Ok(Bakeries), + "bands_orchestras" => Ok(BandsOrchestras), + "barber_and_beauty_shops" => Ok(BarberAndBeautyShops), + "betting_casino_gambling" => Ok(BettingCasinoGambling), + "bicycle_shops" => Ok(BicycleShops), + "billiard_pool_establishments" => Ok(BilliardPoolEstablishments), + "boat_dealers" => Ok(BoatDealers), + "boat_rentals_and_leases" => Ok(BoatRentalsAndLeases), + "book_stores" => Ok(BookStores), + "books_periodicals_and_newspapers" => Ok(BooksPeriodicalsAndNewspapers), + "bowling_alleys" => Ok(BowlingAlleys), + "bus_lines" => Ok(BusLines), + "business_secretarial_schools" => Ok(BusinessSecretarialSchools), + "buying_shopping_services" => Ok(BuyingShoppingServices), + "cable_satellite_and_other_pay_television_and_radio" => { + Ok(CableSatelliteAndOtherPayTelevisionAndRadio) + } + "camera_and_photographic_supply_stores" => Ok(CameraAndPhotographicSupplyStores), + "candy_nut_and_confectionery_stores" => Ok(CandyNutAndConfectioneryStores), + "car_and_truck_dealers_new_used" => Ok(CarAndTruckDealersNewUsed), + "car_and_truck_dealers_used_only" => Ok(CarAndTruckDealersUsedOnly), + "car_rental_agencies" => Ok(CarRentalAgencies), + "car_washes" => Ok(CarWashes), + "carpentry_services" => Ok(CarpentryServices), + "carpet_upholstery_cleaning" => Ok(CarpetUpholsteryCleaning), + "caterers" => Ok(Caterers), + "charitable_and_social_service_organizations_fundraising" => { + Ok(CharitableAndSocialServiceOrganizationsFundraising) + } + "chemicals_and_allied_products" => Ok(ChemicalsAndAlliedProducts), + "child_care_services" => Ok(ChildCareServices), + "childrens_and_infants_wear_stores" => Ok(ChildrensAndInfantsWearStores), + "chiropodists_podiatrists" => Ok(ChiropodistsPodiatrists), + "chiropractors" => Ok(Chiropractors), + "cigar_stores_and_stands" => Ok(CigarStoresAndStands), + "civic_social_fraternal_associations" => Ok(CivicSocialFraternalAssociations), + "cleaning_and_maintenance" => Ok(CleaningAndMaintenance), + "clothing_rental" => Ok(ClothingRental), + "colleges_universities" => Ok(CollegesUniversities), + "commercial_equipment" => Ok(CommercialEquipment), + "commercial_footwear" => Ok(CommercialFootwear), + "commercial_photography_art_and_graphics" => Ok(CommercialPhotographyArtAndGraphics), + "commuter_transport_and_ferries" => Ok(CommuterTransportAndFerries), + "computer_network_services" => Ok(ComputerNetworkServices), + "computer_programming" => Ok(ComputerProgramming), + "computer_repair" => Ok(ComputerRepair), + "computer_software_stores" => Ok(ComputerSoftwareStores), + "computers_peripherals_and_software" => Ok(ComputersPeripheralsAndSoftware), + "concrete_work_services" => Ok(ConcreteWorkServices), + "construction_materials" => Ok(ConstructionMaterials), + "consulting_public_relations" => Ok(ConsultingPublicRelations), + "correspondence_schools" => Ok(CorrespondenceSchools), + "cosmetic_stores" => Ok(CosmeticStores), + "counseling_services" => Ok(CounselingServices), + "country_clubs" => Ok(CountryClubs), + "courier_services" => Ok(CourierServices), + "court_costs" => Ok(CourtCosts), + "credit_reporting_agencies" => Ok(CreditReportingAgencies), + "cruise_lines" => Ok(CruiseLines), + "dairy_products_stores" => Ok(DairyProductsStores), + "dance_hall_studios_schools" => Ok(DanceHallStudiosSchools), + "dating_escort_services" => Ok(DatingEscortServices), + "dentists_orthodontists" => Ok(DentistsOrthodontists), + "department_stores" => Ok(DepartmentStores), + "detective_agencies" => Ok(DetectiveAgencies), + "digital_goods_applications" => Ok(DigitalGoodsApplications), + "digital_goods_games" => Ok(DigitalGoodsGames), + "digital_goods_large_volume" => Ok(DigitalGoodsLargeVolume), + "digital_goods_media" => Ok(DigitalGoodsMedia), + "direct_marketing_catalog_merchant" => Ok(DirectMarketingCatalogMerchant), + "direct_marketing_combination_catalog_and_retail_merchant" => { + Ok(DirectMarketingCombinationCatalogAndRetailMerchant) + } + "direct_marketing_inbound_telemarketing" => Ok(DirectMarketingInboundTelemarketing), + "direct_marketing_insurance_services" => Ok(DirectMarketingInsuranceServices), + "direct_marketing_other" => Ok(DirectMarketingOther), + "direct_marketing_outbound_telemarketing" => Ok(DirectMarketingOutboundTelemarketing), + "direct_marketing_subscription" => Ok(DirectMarketingSubscription), + "direct_marketing_travel" => Ok(DirectMarketingTravel), + "discount_stores" => Ok(DiscountStores), + "doctors" => Ok(Doctors), + "door_to_door_sales" => Ok(DoorToDoorSales), + "drapery_window_covering_and_upholstery_stores" => { + Ok(DraperyWindowCoveringAndUpholsteryStores) + } + "drinking_places" => Ok(DrinkingPlaces), + "drug_stores_and_pharmacies" => Ok(DrugStoresAndPharmacies), + "drugs_drug_proprietaries_and_druggist_sundries" => { + Ok(DrugsDrugProprietariesAndDruggistSundries) + } + "dry_cleaners" => Ok(DryCleaners), + "durable_goods" => Ok(DurableGoods), + "duty_free_stores" => Ok(DutyFreeStores), + "eating_places_restaurants" => Ok(EatingPlacesRestaurants), + "educational_services" => Ok(EducationalServices), + "electric_razor_stores" => Ok(ElectricRazorStores), + "electric_vehicle_charging" => Ok(ElectricVehicleCharging), + "electrical_parts_and_equipment" => Ok(ElectricalPartsAndEquipment), + "electrical_services" => Ok(ElectricalServices), + "electronics_repair_shops" => Ok(ElectronicsRepairShops), + "electronics_stores" => Ok(ElectronicsStores), + "elementary_secondary_schools" => Ok(ElementarySecondarySchools), + "emergency_services_gcas_visa_use_only" => Ok(EmergencyServicesGcasVisaUseOnly), + "employment_temp_agencies" => Ok(EmploymentTempAgencies), + "equipment_rental" => Ok(EquipmentRental), + "exterminating_services" => Ok(ExterminatingServices), + "family_clothing_stores" => Ok(FamilyClothingStores), + "fast_food_restaurants" => Ok(FastFoodRestaurants), + "financial_institutions" => Ok(FinancialInstitutions), + "fines_government_administrative_entities" => Ok(FinesGovernmentAdministrativeEntities), + "fireplace_fireplace_screens_and_accessories_stores" => { + Ok(FireplaceFireplaceScreensAndAccessoriesStores) + } + "floor_covering_stores" => Ok(FloorCoveringStores), + "florists" => Ok(Florists), + "florists_supplies_nursery_stock_and_flowers" => { + Ok(FloristsSuppliesNurseryStockAndFlowers) + } + "freezer_and_locker_meat_provisioners" => Ok(FreezerAndLockerMeatProvisioners), + "fuel_dealers_non_automotive" => Ok(FuelDealersNonAutomotive), + "funeral_services_crematories" => Ok(FuneralServicesCrematories), + "furniture_home_furnishings_and_equipment_stores_except_appliances" => { + Ok(FurnitureHomeFurnishingsAndEquipmentStoresExceptAppliances) + } + "furniture_repair_refinishing" => Ok(FurnitureRepairRefinishing), + "furriers_and_fur_shops" => Ok(FurriersAndFurShops), + "general_services" => Ok(GeneralServices), + "gift_card_novelty_and_souvenir_shops" => Ok(GiftCardNoveltyAndSouvenirShops), + "glass_paint_and_wallpaper_stores" => Ok(GlassPaintAndWallpaperStores), + "glassware_crystal_stores" => Ok(GlasswareCrystalStores), + "golf_courses_public" => Ok(GolfCoursesPublic), + "government_licensed_horse_dog_racing_us_region_only" => { + Ok(GovernmentLicensedHorseDogRacingUsRegionOnly) + } + "government_licensed_online_casions_online_gambling_us_region_only" => { + Ok(GovernmentLicensedOnlineCasionsOnlineGamblingUsRegionOnly) + } + "government_owned_lotteries_non_us_region" => Ok(GovernmentOwnedLotteriesNonUsRegion), + "government_owned_lotteries_us_region_only" => Ok(GovernmentOwnedLotteriesUsRegionOnly), + "government_services" => Ok(GovernmentServices), + "grocery_stores_supermarkets" => Ok(GroceryStoresSupermarkets), + "hardware_equipment_and_supplies" => Ok(HardwareEquipmentAndSupplies), + "hardware_stores" => Ok(HardwareStores), + "health_and_beauty_spas" => Ok(HealthAndBeautySpas), + "hearing_aids_sales_and_supplies" => Ok(HearingAidsSalesAndSupplies), + "heating_plumbing_a_c" => Ok(HeatingPlumbingAC), + "hobby_toy_and_game_shops" => Ok(HobbyToyAndGameShops), + "home_supply_warehouse_stores" => Ok(HomeSupplyWarehouseStores), + "hospitals" => Ok(Hospitals), + "hotels_motels_and_resorts" => Ok(HotelsMotelsAndResorts), + "household_appliance_stores" => Ok(HouseholdApplianceStores), + "industrial_supplies" => Ok(IndustrialSupplies), + "information_retrieval_services" => Ok(InformationRetrievalServices), + "insurance_default" => Ok(InsuranceDefault), + "insurance_underwriting_premiums" => Ok(InsuranceUnderwritingPremiums), + "intra_company_purchases" => Ok(IntraCompanyPurchases), + "jewelry_stores_watches_clocks_and_silverware_stores" => { + Ok(JewelryStoresWatchesClocksAndSilverwareStores) + } + "landscaping_services" => Ok(LandscapingServices), + "laundries" => Ok(Laundries), + "laundry_cleaning_services" => Ok(LaundryCleaningServices), + "legal_services_attorneys" => Ok(LegalServicesAttorneys), + "luggage_and_leather_goods_stores" => Ok(LuggageAndLeatherGoodsStores), + "lumber_building_materials_stores" => Ok(LumberBuildingMaterialsStores), + "manual_cash_disburse" => Ok(ManualCashDisburse), + "marinas_service_and_supplies" => Ok(MarinasServiceAndSupplies), + "marketplaces" => Ok(Marketplaces), + "masonry_stonework_and_plaster" => Ok(MasonryStoneworkAndPlaster), + "massage_parlors" => Ok(MassageParlors), + "medical_and_dental_labs" => Ok(MedicalAndDentalLabs), + "medical_dental_ophthalmic_and_hospital_equipment_and_supplies" => { + Ok(MedicalDentalOphthalmicAndHospitalEquipmentAndSupplies) + } + "medical_services" => Ok(MedicalServices), + "membership_organizations" => Ok(MembershipOrganizations), + "mens_and_boys_clothing_and_accessories_stores" => { + Ok(MensAndBoysClothingAndAccessoriesStores) + } + "mens_womens_clothing_stores" => Ok(MensWomensClothingStores), + "metal_service_centers" => Ok(MetalServiceCenters), + "miscellaneous" => Ok(Miscellaneous), + "miscellaneous_apparel_and_accessory_shops" => { + Ok(MiscellaneousApparelAndAccessoryShops) + } + "miscellaneous_auto_dealers" => Ok(MiscellaneousAutoDealers), + "miscellaneous_business_services" => Ok(MiscellaneousBusinessServices), + "miscellaneous_food_stores" => Ok(MiscellaneousFoodStores), + "miscellaneous_general_merchandise" => Ok(MiscellaneousGeneralMerchandise), + "miscellaneous_general_services" => Ok(MiscellaneousGeneralServices), + "miscellaneous_home_furnishing_specialty_stores" => { + Ok(MiscellaneousHomeFurnishingSpecialtyStores) + } + "miscellaneous_publishing_and_printing" => Ok(MiscellaneousPublishingAndPrinting), + "miscellaneous_recreation_services" => Ok(MiscellaneousRecreationServices), + "miscellaneous_repair_shops" => Ok(MiscellaneousRepairShops), + "miscellaneous_specialty_retail" => Ok(MiscellaneousSpecialtyRetail), + "mobile_home_dealers" => Ok(MobileHomeDealers), + "motion_picture_theaters" => Ok(MotionPictureTheaters), + "motor_freight_carriers_and_trucking" => Ok(MotorFreightCarriersAndTrucking), + "motor_homes_dealers" => Ok(MotorHomesDealers), + "motor_vehicle_supplies_and_new_parts" => Ok(MotorVehicleSuppliesAndNewParts), + "motorcycle_shops_and_dealers" => Ok(MotorcycleShopsAndDealers), + "motorcycle_shops_dealers" => Ok(MotorcycleShopsDealers), + "music_stores_musical_instruments_pianos_and_sheet_music" => { + Ok(MusicStoresMusicalInstrumentsPianosAndSheetMusic) + } + "news_dealers_and_newsstands" => Ok(NewsDealersAndNewsstands), + "non_fi_money_orders" => Ok(NonFiMoneyOrders), + "non_fi_stored_value_card_purchase_load" => Ok(NonFiStoredValueCardPurchaseLoad), + "nondurable_goods" => Ok(NondurableGoods), + "nurseries_lawn_and_garden_supply_stores" => Ok(NurseriesLawnAndGardenSupplyStores), + "nursing_personal_care" => Ok(NursingPersonalCare), + "office_and_commercial_furniture" => Ok(OfficeAndCommercialFurniture), + "opticians_eyeglasses" => Ok(OpticiansEyeglasses), + "optometrists_ophthalmologist" => Ok(OptometristsOphthalmologist), + "orthopedic_goods_prosthetic_devices" => Ok(OrthopedicGoodsProstheticDevices), + "osteopaths" => Ok(Osteopaths), + "package_stores_beer_wine_and_liquor" => Ok(PackageStoresBeerWineAndLiquor), + "paints_varnishes_and_supplies" => Ok(PaintsVarnishesAndSupplies), + "parking_lots_garages" => Ok(ParkingLotsGarages), + "passenger_railways" => Ok(PassengerRailways), + "pawn_shops" => Ok(PawnShops), + "pet_shops_pet_food_and_supplies" => Ok(PetShopsPetFoodAndSupplies), + "petroleum_and_petroleum_products" => Ok(PetroleumAndPetroleumProducts), + "photo_developing" => Ok(PhotoDeveloping), + "photographic_photocopy_microfilm_equipment_and_supplies" => { + Ok(PhotographicPhotocopyMicrofilmEquipmentAndSupplies) + } + "photographic_studios" => Ok(PhotographicStudios), + "picture_video_production" => Ok(PictureVideoProduction), + "piece_goods_notions_and_other_dry_goods" => Ok(PieceGoodsNotionsAndOtherDryGoods), + "plumbing_heating_equipment_and_supplies" => Ok(PlumbingHeatingEquipmentAndSupplies), + "political_organizations" => Ok(PoliticalOrganizations), + "postal_services_government_only" => Ok(PostalServicesGovernmentOnly), + "precious_stones_and_metals_watches_and_jewelry" => { + Ok(PreciousStonesAndMetalsWatchesAndJewelry) + } + "professional_services" => Ok(ProfessionalServices), + "public_warehousing_and_storage" => Ok(PublicWarehousingAndStorage), + "quick_copy_repro_and_blueprint" => Ok(QuickCopyReproAndBlueprint), + "railroads" => Ok(Railroads), + "real_estate_agents_and_managers_rentals" => Ok(RealEstateAgentsAndManagersRentals), + "record_stores" => Ok(RecordStores), + "recreational_vehicle_rentals" => Ok(RecreationalVehicleRentals), + "religious_goods_stores" => Ok(ReligiousGoodsStores), + "religious_organizations" => Ok(ReligiousOrganizations), + "roofing_siding_sheet_metal" => Ok(RoofingSidingSheetMetal), + "secretarial_support_services" => Ok(SecretarialSupportServices), + "security_brokers_dealers" => Ok(SecurityBrokersDealers), + "service_stations" => Ok(ServiceStations), + "sewing_needlework_fabric_and_piece_goods_stores" => { + Ok(SewingNeedleworkFabricAndPieceGoodsStores) + } + "shoe_repair_hat_cleaning" => Ok(ShoeRepairHatCleaning), + "shoe_stores" => Ok(ShoeStores), + "small_appliance_repair" => Ok(SmallApplianceRepair), + "snowmobile_dealers" => Ok(SnowmobileDealers), + "special_trade_services" => Ok(SpecialTradeServices), + "specialty_cleaning" => Ok(SpecialtyCleaning), + "sporting_goods_stores" => Ok(SportingGoodsStores), + "sporting_recreation_camps" => Ok(SportingRecreationCamps), + "sports_and_riding_apparel_stores" => Ok(SportsAndRidingApparelStores), + "sports_clubs_fields" => Ok(SportsClubsFields), + "stamp_and_coin_stores" => Ok(StampAndCoinStores), + "stationary_office_supplies_printing_and_writing_paper" => { + Ok(StationaryOfficeSuppliesPrintingAndWritingPaper) + } + "stationery_stores_office_and_school_supply_stores" => { + Ok(StationeryStoresOfficeAndSchoolSupplyStores) + } + "swimming_pools_sales" => Ok(SwimmingPoolsSales), + "t_ui_travel_germany" => Ok(TUiTravelGermany), + "tailors_alterations" => Ok(TailorsAlterations), + "tax_payments_government_agencies" => Ok(TaxPaymentsGovernmentAgencies), + "tax_preparation_services" => Ok(TaxPreparationServices), + "taxicabs_limousines" => Ok(TaxicabsLimousines), + "telecommunication_equipment_and_telephone_sales" => { + Ok(TelecommunicationEquipmentAndTelephoneSales) + } + "telecommunication_services" => Ok(TelecommunicationServices), + "telegraph_services" => Ok(TelegraphServices), + "tent_and_awning_shops" => Ok(TentAndAwningShops), + "testing_laboratories" => Ok(TestingLaboratories), + "theatrical_ticket_agencies" => Ok(TheatricalTicketAgencies), + "timeshares" => Ok(Timeshares), + "tire_retreading_and_repair" => Ok(TireRetreadingAndRepair), + "tolls_bridge_fees" => Ok(TollsBridgeFees), + "tourist_attractions_and_exhibits" => Ok(TouristAttractionsAndExhibits), + "towing_services" => Ok(TowingServices), + "trailer_parks_campgrounds" => Ok(TrailerParksCampgrounds), + "transportation_services" => Ok(TransportationServices), + "travel_agencies_tour_operators" => Ok(TravelAgenciesTourOperators), + "truck_stop_iteration" => Ok(TruckStopIteration), + "truck_utility_trailer_rentals" => Ok(TruckUtilityTrailerRentals), + "typesetting_plate_making_and_related_services" => { + Ok(TypesettingPlateMakingAndRelatedServices) + } + "typewriter_stores" => Ok(TypewriterStores), + "u_s_federal_government_agencies_or_departments" => { + Ok(USFederalGovernmentAgenciesOrDepartments) + } + "uniforms_commercial_clothing" => Ok(UniformsCommercialClothing), + "used_merchandise_and_secondhand_stores" => Ok(UsedMerchandiseAndSecondhandStores), + "utilities" => Ok(Utilities), + "variety_stores" => Ok(VarietyStores), + "veterinary_services" => Ok(VeterinaryServices), + "video_amusement_game_supplies" => Ok(VideoAmusementGameSupplies), + "video_game_arcades" => Ok(VideoGameArcades), + "video_tape_rental_stores" => Ok(VideoTapeRentalStores), + "vocational_trade_schools" => Ok(VocationalTradeSchools), + "watch_jewelry_repair" => Ok(WatchJewelryRepair), + "welding_repair" => Ok(WeldingRepair), + "wholesale_clubs" => Ok(WholesaleClubs), + "wig_and_toupee_stores" => Ok(WigAndToupeeStores), + "wires_money_orders" => Ok(WiresMoneyOrders), + "womens_accessory_and_specialty_shops" => Ok(WomensAccessoryAndSpecialtyShops), + "womens_ready_to_wear_stores" => Ok(WomensReadyToWearStores), + "wrecking_and_salvage_yards" => Ok(WreckingAndSalvageYards), + _ => Err(()), + } + } +} +impl std::fmt::Display for CreateIssuingCardSpendingControlsAllowedCategories { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreateIssuingCardSpendingControlsAllowedCategories { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreateIssuingCardSpendingControlsAllowedCategories { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Array of strings containing [categories](https://stripe.com/docs/api#issuing_authorization_object-merchant_data-category) of authorizations to decline. +/// All other categories will be allowed. +/// Cannot be set with `allowed_categories`. +#[derive(Copy, Clone, Eq, PartialEq)] +#[non_exhaustive] +pub enum CreateIssuingCardSpendingControlsBlockedCategories { + AcRefrigerationRepair, + AccountingBookkeepingServices, + AdvertisingServices, + AgriculturalCooperative, + AirlinesAirCarriers, + AirportsFlyingFields, + AmbulanceServices, + AmusementParksCarnivals, + AntiqueReproductions, + AntiqueShops, + Aquariums, + ArchitecturalSurveyingServices, + ArtDealersAndGalleries, + ArtistsSupplyAndCraftShops, + AutoAndHomeSupplyStores, + AutoBodyRepairShops, + AutoPaintShops, + AutoServiceShops, + AutomatedCashDisburse, + AutomatedFuelDispensers, + AutomobileAssociations, + AutomotivePartsAndAccessoriesStores, + AutomotiveTireStores, + BailAndBondPayments, + Bakeries, + BandsOrchestras, + BarberAndBeautyShops, + BettingCasinoGambling, + BicycleShops, + BilliardPoolEstablishments, + BoatDealers, + BoatRentalsAndLeases, + BookStores, + BooksPeriodicalsAndNewspapers, + BowlingAlleys, + BusLines, + BusinessSecretarialSchools, + BuyingShoppingServices, + CableSatelliteAndOtherPayTelevisionAndRadio, + CameraAndPhotographicSupplyStores, + CandyNutAndConfectioneryStores, + CarAndTruckDealersNewUsed, + CarAndTruckDealersUsedOnly, + CarRentalAgencies, + CarWashes, + CarpentryServices, + CarpetUpholsteryCleaning, + Caterers, + CharitableAndSocialServiceOrganizationsFundraising, + ChemicalsAndAlliedProducts, + ChildCareServices, + ChildrensAndInfantsWearStores, + ChiropodistsPodiatrists, + Chiropractors, + CigarStoresAndStands, + CivicSocialFraternalAssociations, + CleaningAndMaintenance, + ClothingRental, + CollegesUniversities, + CommercialEquipment, + CommercialFootwear, + CommercialPhotographyArtAndGraphics, + CommuterTransportAndFerries, + ComputerNetworkServices, + ComputerProgramming, + ComputerRepair, + ComputerSoftwareStores, + ComputersPeripheralsAndSoftware, + ConcreteWorkServices, + ConstructionMaterials, + ConsultingPublicRelations, + CorrespondenceSchools, + CosmeticStores, + CounselingServices, + CountryClubs, + CourierServices, + CourtCosts, + CreditReportingAgencies, + CruiseLines, + DairyProductsStores, + DanceHallStudiosSchools, + DatingEscortServices, + DentistsOrthodontists, + DepartmentStores, + DetectiveAgencies, + DigitalGoodsApplications, + DigitalGoodsGames, + DigitalGoodsLargeVolume, + DigitalGoodsMedia, + DirectMarketingCatalogMerchant, + DirectMarketingCombinationCatalogAndRetailMerchant, + DirectMarketingInboundTelemarketing, + DirectMarketingInsuranceServices, + DirectMarketingOther, + DirectMarketingOutboundTelemarketing, + DirectMarketingSubscription, + DirectMarketingTravel, + DiscountStores, + Doctors, + DoorToDoorSales, + DraperyWindowCoveringAndUpholsteryStores, + DrinkingPlaces, + DrugStoresAndPharmacies, + DrugsDrugProprietariesAndDruggistSundries, + DryCleaners, + DurableGoods, + DutyFreeStores, + EatingPlacesRestaurants, + EducationalServices, + ElectricRazorStores, + ElectricVehicleCharging, + ElectricalPartsAndEquipment, + ElectricalServices, + ElectronicsRepairShops, + ElectronicsStores, + ElementarySecondarySchools, + EmergencyServicesGcasVisaUseOnly, + EmploymentTempAgencies, + EquipmentRental, + ExterminatingServices, + FamilyClothingStores, + FastFoodRestaurants, + FinancialInstitutions, + FinesGovernmentAdministrativeEntities, + FireplaceFireplaceScreensAndAccessoriesStores, + FloorCoveringStores, + Florists, + FloristsSuppliesNurseryStockAndFlowers, + FreezerAndLockerMeatProvisioners, + FuelDealersNonAutomotive, + FuneralServicesCrematories, + FurnitureHomeFurnishingsAndEquipmentStoresExceptAppliances, + FurnitureRepairRefinishing, + FurriersAndFurShops, + GeneralServices, + GiftCardNoveltyAndSouvenirShops, + GlassPaintAndWallpaperStores, + GlasswareCrystalStores, + GolfCoursesPublic, + GovernmentLicensedHorseDogRacingUsRegionOnly, + GovernmentLicensedOnlineCasionsOnlineGamblingUsRegionOnly, + GovernmentOwnedLotteriesNonUsRegion, + GovernmentOwnedLotteriesUsRegionOnly, + GovernmentServices, + GroceryStoresSupermarkets, + HardwareEquipmentAndSupplies, + HardwareStores, + HealthAndBeautySpas, + HearingAidsSalesAndSupplies, + HeatingPlumbingAC, + HobbyToyAndGameShops, + HomeSupplyWarehouseStores, + Hospitals, + HotelsMotelsAndResorts, + HouseholdApplianceStores, + IndustrialSupplies, + InformationRetrievalServices, + InsuranceDefault, + InsuranceUnderwritingPremiums, + IntraCompanyPurchases, + JewelryStoresWatchesClocksAndSilverwareStores, + LandscapingServices, + Laundries, + LaundryCleaningServices, + LegalServicesAttorneys, + LuggageAndLeatherGoodsStores, + LumberBuildingMaterialsStores, + ManualCashDisburse, + MarinasServiceAndSupplies, + Marketplaces, + MasonryStoneworkAndPlaster, + MassageParlors, + MedicalAndDentalLabs, + MedicalDentalOphthalmicAndHospitalEquipmentAndSupplies, + MedicalServices, + MembershipOrganizations, + MensAndBoysClothingAndAccessoriesStores, + MensWomensClothingStores, + MetalServiceCenters, + Miscellaneous, + MiscellaneousApparelAndAccessoryShops, + MiscellaneousAutoDealers, + MiscellaneousBusinessServices, + MiscellaneousFoodStores, + MiscellaneousGeneralMerchandise, + MiscellaneousGeneralServices, + MiscellaneousHomeFurnishingSpecialtyStores, + MiscellaneousPublishingAndPrinting, + MiscellaneousRecreationServices, + MiscellaneousRepairShops, + MiscellaneousSpecialtyRetail, + MobileHomeDealers, + MotionPictureTheaters, + MotorFreightCarriersAndTrucking, + MotorHomesDealers, + MotorVehicleSuppliesAndNewParts, + MotorcycleShopsAndDealers, + MotorcycleShopsDealers, + MusicStoresMusicalInstrumentsPianosAndSheetMusic, + NewsDealersAndNewsstands, + NonFiMoneyOrders, + NonFiStoredValueCardPurchaseLoad, + NondurableGoods, + NurseriesLawnAndGardenSupplyStores, + NursingPersonalCare, + OfficeAndCommercialFurniture, + OpticiansEyeglasses, + OptometristsOphthalmologist, + OrthopedicGoodsProstheticDevices, + Osteopaths, + PackageStoresBeerWineAndLiquor, + PaintsVarnishesAndSupplies, + ParkingLotsGarages, + PassengerRailways, + PawnShops, + PetShopsPetFoodAndSupplies, + PetroleumAndPetroleumProducts, + PhotoDeveloping, + PhotographicPhotocopyMicrofilmEquipmentAndSupplies, + PhotographicStudios, + PictureVideoProduction, + PieceGoodsNotionsAndOtherDryGoods, + PlumbingHeatingEquipmentAndSupplies, + PoliticalOrganizations, + PostalServicesGovernmentOnly, + PreciousStonesAndMetalsWatchesAndJewelry, + ProfessionalServices, + PublicWarehousingAndStorage, + QuickCopyReproAndBlueprint, + Railroads, + RealEstateAgentsAndManagersRentals, + RecordStores, + RecreationalVehicleRentals, + ReligiousGoodsStores, + ReligiousOrganizations, + RoofingSidingSheetMetal, + SecretarialSupportServices, + SecurityBrokersDealers, + ServiceStations, + SewingNeedleworkFabricAndPieceGoodsStores, + ShoeRepairHatCleaning, + ShoeStores, + SmallApplianceRepair, + SnowmobileDealers, + SpecialTradeServices, + SpecialtyCleaning, + SportingGoodsStores, + SportingRecreationCamps, + SportsAndRidingApparelStores, + SportsClubsFields, + StampAndCoinStores, + StationaryOfficeSuppliesPrintingAndWritingPaper, + StationeryStoresOfficeAndSchoolSupplyStores, + SwimmingPoolsSales, + TUiTravelGermany, + TailorsAlterations, + TaxPaymentsGovernmentAgencies, + TaxPreparationServices, + TaxicabsLimousines, + TelecommunicationEquipmentAndTelephoneSales, + TelecommunicationServices, + TelegraphServices, + TentAndAwningShops, + TestingLaboratories, + TheatricalTicketAgencies, + Timeshares, + TireRetreadingAndRepair, + TollsBridgeFees, + TouristAttractionsAndExhibits, + TowingServices, + TrailerParksCampgrounds, + TransportationServices, + TravelAgenciesTourOperators, + TruckStopIteration, + TruckUtilityTrailerRentals, + TypesettingPlateMakingAndRelatedServices, + TypewriterStores, + USFederalGovernmentAgenciesOrDepartments, + UniformsCommercialClothing, + UsedMerchandiseAndSecondhandStores, + Utilities, + VarietyStores, + VeterinaryServices, + VideoAmusementGameSupplies, + VideoGameArcades, + VideoTapeRentalStores, + VocationalTradeSchools, + WatchJewelryRepair, + WeldingRepair, + WholesaleClubs, + WigAndToupeeStores, + WiresMoneyOrders, + WomensAccessoryAndSpecialtyShops, + WomensReadyToWearStores, + WreckingAndSalvageYards, + /// An unrecognized value from Stripe. Should not be used as a request parameter. + Unknown, +} +impl CreateIssuingCardSpendingControlsBlockedCategories { + pub fn as_str(self) -> &'static str { + use CreateIssuingCardSpendingControlsBlockedCategories::*; + match self { + AcRefrigerationRepair => "ac_refrigeration_repair", + AccountingBookkeepingServices => "accounting_bookkeeping_services", + AdvertisingServices => "advertising_services", + AgriculturalCooperative => "agricultural_cooperative", + AirlinesAirCarriers => "airlines_air_carriers", + AirportsFlyingFields => "airports_flying_fields", + AmbulanceServices => "ambulance_services", + AmusementParksCarnivals => "amusement_parks_carnivals", + AntiqueReproductions => "antique_reproductions", + AntiqueShops => "antique_shops", + Aquariums => "aquariums", + ArchitecturalSurveyingServices => "architectural_surveying_services", + ArtDealersAndGalleries => "art_dealers_and_galleries", + ArtistsSupplyAndCraftShops => "artists_supply_and_craft_shops", + AutoAndHomeSupplyStores => "auto_and_home_supply_stores", + AutoBodyRepairShops => "auto_body_repair_shops", + AutoPaintShops => "auto_paint_shops", + AutoServiceShops => "auto_service_shops", + AutomatedCashDisburse => "automated_cash_disburse", + AutomatedFuelDispensers => "automated_fuel_dispensers", + AutomobileAssociations => "automobile_associations", + AutomotivePartsAndAccessoriesStores => "automotive_parts_and_accessories_stores", + AutomotiveTireStores => "automotive_tire_stores", + BailAndBondPayments => "bail_and_bond_payments", + Bakeries => "bakeries", + BandsOrchestras => "bands_orchestras", + BarberAndBeautyShops => "barber_and_beauty_shops", + BettingCasinoGambling => "betting_casino_gambling", + BicycleShops => "bicycle_shops", + BilliardPoolEstablishments => "billiard_pool_establishments", + BoatDealers => "boat_dealers", + BoatRentalsAndLeases => "boat_rentals_and_leases", + BookStores => "book_stores", + BooksPeriodicalsAndNewspapers => "books_periodicals_and_newspapers", + BowlingAlleys => "bowling_alleys", + BusLines => "bus_lines", + BusinessSecretarialSchools => "business_secretarial_schools", + BuyingShoppingServices => "buying_shopping_services", + CableSatelliteAndOtherPayTelevisionAndRadio => { + "cable_satellite_and_other_pay_television_and_radio" + } + CameraAndPhotographicSupplyStores => "camera_and_photographic_supply_stores", + CandyNutAndConfectioneryStores => "candy_nut_and_confectionery_stores", + CarAndTruckDealersNewUsed => "car_and_truck_dealers_new_used", + CarAndTruckDealersUsedOnly => "car_and_truck_dealers_used_only", + CarRentalAgencies => "car_rental_agencies", + CarWashes => "car_washes", + CarpentryServices => "carpentry_services", + CarpetUpholsteryCleaning => "carpet_upholstery_cleaning", + Caterers => "caterers", + CharitableAndSocialServiceOrganizationsFundraising => { + "charitable_and_social_service_organizations_fundraising" + } + ChemicalsAndAlliedProducts => "chemicals_and_allied_products", + ChildCareServices => "child_care_services", + ChildrensAndInfantsWearStores => "childrens_and_infants_wear_stores", + ChiropodistsPodiatrists => "chiropodists_podiatrists", + Chiropractors => "chiropractors", + CigarStoresAndStands => "cigar_stores_and_stands", + CivicSocialFraternalAssociations => "civic_social_fraternal_associations", + CleaningAndMaintenance => "cleaning_and_maintenance", + ClothingRental => "clothing_rental", + CollegesUniversities => "colleges_universities", + CommercialEquipment => "commercial_equipment", + CommercialFootwear => "commercial_footwear", + CommercialPhotographyArtAndGraphics => "commercial_photography_art_and_graphics", + CommuterTransportAndFerries => "commuter_transport_and_ferries", + ComputerNetworkServices => "computer_network_services", + ComputerProgramming => "computer_programming", + ComputerRepair => "computer_repair", + ComputerSoftwareStores => "computer_software_stores", + ComputersPeripheralsAndSoftware => "computers_peripherals_and_software", + ConcreteWorkServices => "concrete_work_services", + ConstructionMaterials => "construction_materials", + ConsultingPublicRelations => "consulting_public_relations", + CorrespondenceSchools => "correspondence_schools", + CosmeticStores => "cosmetic_stores", + CounselingServices => "counseling_services", + CountryClubs => "country_clubs", + CourierServices => "courier_services", + CourtCosts => "court_costs", + CreditReportingAgencies => "credit_reporting_agencies", + CruiseLines => "cruise_lines", + DairyProductsStores => "dairy_products_stores", + DanceHallStudiosSchools => "dance_hall_studios_schools", + DatingEscortServices => "dating_escort_services", + DentistsOrthodontists => "dentists_orthodontists", + DepartmentStores => "department_stores", + DetectiveAgencies => "detective_agencies", + DigitalGoodsApplications => "digital_goods_applications", + DigitalGoodsGames => "digital_goods_games", + DigitalGoodsLargeVolume => "digital_goods_large_volume", + DigitalGoodsMedia => "digital_goods_media", + DirectMarketingCatalogMerchant => "direct_marketing_catalog_merchant", + DirectMarketingCombinationCatalogAndRetailMerchant => { + "direct_marketing_combination_catalog_and_retail_merchant" + } + DirectMarketingInboundTelemarketing => "direct_marketing_inbound_telemarketing", + DirectMarketingInsuranceServices => "direct_marketing_insurance_services", + DirectMarketingOther => "direct_marketing_other", + DirectMarketingOutboundTelemarketing => "direct_marketing_outbound_telemarketing", + DirectMarketingSubscription => "direct_marketing_subscription", + DirectMarketingTravel => "direct_marketing_travel", + DiscountStores => "discount_stores", + Doctors => "doctors", + DoorToDoorSales => "door_to_door_sales", + DraperyWindowCoveringAndUpholsteryStores => { + "drapery_window_covering_and_upholstery_stores" + } + DrinkingPlaces => "drinking_places", + DrugStoresAndPharmacies => "drug_stores_and_pharmacies", + DrugsDrugProprietariesAndDruggistSundries => { + "drugs_drug_proprietaries_and_druggist_sundries" + } + DryCleaners => "dry_cleaners", + DurableGoods => "durable_goods", + DutyFreeStores => "duty_free_stores", + EatingPlacesRestaurants => "eating_places_restaurants", + EducationalServices => "educational_services", + ElectricRazorStores => "electric_razor_stores", + ElectricVehicleCharging => "electric_vehicle_charging", + ElectricalPartsAndEquipment => "electrical_parts_and_equipment", + ElectricalServices => "electrical_services", + ElectronicsRepairShops => "electronics_repair_shops", + ElectronicsStores => "electronics_stores", + ElementarySecondarySchools => "elementary_secondary_schools", + EmergencyServicesGcasVisaUseOnly => "emergency_services_gcas_visa_use_only", + EmploymentTempAgencies => "employment_temp_agencies", + EquipmentRental => "equipment_rental", + ExterminatingServices => "exterminating_services", + FamilyClothingStores => "family_clothing_stores", + FastFoodRestaurants => "fast_food_restaurants", + FinancialInstitutions => "financial_institutions", + FinesGovernmentAdministrativeEntities => "fines_government_administrative_entities", + FireplaceFireplaceScreensAndAccessoriesStores => { + "fireplace_fireplace_screens_and_accessories_stores" + } + FloorCoveringStores => "floor_covering_stores", + Florists => "florists", + FloristsSuppliesNurseryStockAndFlowers => "florists_supplies_nursery_stock_and_flowers", + FreezerAndLockerMeatProvisioners => "freezer_and_locker_meat_provisioners", + FuelDealersNonAutomotive => "fuel_dealers_non_automotive", + FuneralServicesCrematories => "funeral_services_crematories", + FurnitureHomeFurnishingsAndEquipmentStoresExceptAppliances => { + "furniture_home_furnishings_and_equipment_stores_except_appliances" + } + FurnitureRepairRefinishing => "furniture_repair_refinishing", + FurriersAndFurShops => "furriers_and_fur_shops", + GeneralServices => "general_services", + GiftCardNoveltyAndSouvenirShops => "gift_card_novelty_and_souvenir_shops", + GlassPaintAndWallpaperStores => "glass_paint_and_wallpaper_stores", + GlasswareCrystalStores => "glassware_crystal_stores", + GolfCoursesPublic => "golf_courses_public", + GovernmentLicensedHorseDogRacingUsRegionOnly => { + "government_licensed_horse_dog_racing_us_region_only" + } + GovernmentLicensedOnlineCasionsOnlineGamblingUsRegionOnly => { + "government_licensed_online_casions_online_gambling_us_region_only" + } + GovernmentOwnedLotteriesNonUsRegion => "government_owned_lotteries_non_us_region", + GovernmentOwnedLotteriesUsRegionOnly => "government_owned_lotteries_us_region_only", + GovernmentServices => "government_services", + GroceryStoresSupermarkets => "grocery_stores_supermarkets", + HardwareEquipmentAndSupplies => "hardware_equipment_and_supplies", + HardwareStores => "hardware_stores", + HealthAndBeautySpas => "health_and_beauty_spas", + HearingAidsSalesAndSupplies => "hearing_aids_sales_and_supplies", + HeatingPlumbingAC => "heating_plumbing_a_c", + HobbyToyAndGameShops => "hobby_toy_and_game_shops", + HomeSupplyWarehouseStores => "home_supply_warehouse_stores", + Hospitals => "hospitals", + HotelsMotelsAndResorts => "hotels_motels_and_resorts", + HouseholdApplianceStores => "household_appliance_stores", + IndustrialSupplies => "industrial_supplies", + InformationRetrievalServices => "information_retrieval_services", + InsuranceDefault => "insurance_default", + InsuranceUnderwritingPremiums => "insurance_underwriting_premiums", + IntraCompanyPurchases => "intra_company_purchases", + JewelryStoresWatchesClocksAndSilverwareStores => { + "jewelry_stores_watches_clocks_and_silverware_stores" + } + LandscapingServices => "landscaping_services", + Laundries => "laundries", + LaundryCleaningServices => "laundry_cleaning_services", + LegalServicesAttorneys => "legal_services_attorneys", + LuggageAndLeatherGoodsStores => "luggage_and_leather_goods_stores", + LumberBuildingMaterialsStores => "lumber_building_materials_stores", + ManualCashDisburse => "manual_cash_disburse", + MarinasServiceAndSupplies => "marinas_service_and_supplies", + Marketplaces => "marketplaces", + MasonryStoneworkAndPlaster => "masonry_stonework_and_plaster", + MassageParlors => "massage_parlors", + MedicalAndDentalLabs => "medical_and_dental_labs", + MedicalDentalOphthalmicAndHospitalEquipmentAndSupplies => { + "medical_dental_ophthalmic_and_hospital_equipment_and_supplies" + } + MedicalServices => "medical_services", + MembershipOrganizations => "membership_organizations", + MensAndBoysClothingAndAccessoriesStores => { + "mens_and_boys_clothing_and_accessories_stores" + } + MensWomensClothingStores => "mens_womens_clothing_stores", + MetalServiceCenters => "metal_service_centers", + Miscellaneous => "miscellaneous", + MiscellaneousApparelAndAccessoryShops => "miscellaneous_apparel_and_accessory_shops", + MiscellaneousAutoDealers => "miscellaneous_auto_dealers", + MiscellaneousBusinessServices => "miscellaneous_business_services", + MiscellaneousFoodStores => "miscellaneous_food_stores", + MiscellaneousGeneralMerchandise => "miscellaneous_general_merchandise", + MiscellaneousGeneralServices => "miscellaneous_general_services", + MiscellaneousHomeFurnishingSpecialtyStores => { + "miscellaneous_home_furnishing_specialty_stores" + } + MiscellaneousPublishingAndPrinting => "miscellaneous_publishing_and_printing", + MiscellaneousRecreationServices => "miscellaneous_recreation_services", + MiscellaneousRepairShops => "miscellaneous_repair_shops", + MiscellaneousSpecialtyRetail => "miscellaneous_specialty_retail", + MobileHomeDealers => "mobile_home_dealers", + MotionPictureTheaters => "motion_picture_theaters", + MotorFreightCarriersAndTrucking => "motor_freight_carriers_and_trucking", + MotorHomesDealers => "motor_homes_dealers", + MotorVehicleSuppliesAndNewParts => "motor_vehicle_supplies_and_new_parts", + MotorcycleShopsAndDealers => "motorcycle_shops_and_dealers", + MotorcycleShopsDealers => "motorcycle_shops_dealers", + MusicStoresMusicalInstrumentsPianosAndSheetMusic => { + "music_stores_musical_instruments_pianos_and_sheet_music" + } + NewsDealersAndNewsstands => "news_dealers_and_newsstands", + NonFiMoneyOrders => "non_fi_money_orders", + NonFiStoredValueCardPurchaseLoad => "non_fi_stored_value_card_purchase_load", + NondurableGoods => "nondurable_goods", + NurseriesLawnAndGardenSupplyStores => "nurseries_lawn_and_garden_supply_stores", + NursingPersonalCare => "nursing_personal_care", + OfficeAndCommercialFurniture => "office_and_commercial_furniture", + OpticiansEyeglasses => "opticians_eyeglasses", + OptometristsOphthalmologist => "optometrists_ophthalmologist", + OrthopedicGoodsProstheticDevices => "orthopedic_goods_prosthetic_devices", + Osteopaths => "osteopaths", + PackageStoresBeerWineAndLiquor => "package_stores_beer_wine_and_liquor", + PaintsVarnishesAndSupplies => "paints_varnishes_and_supplies", + ParkingLotsGarages => "parking_lots_garages", + PassengerRailways => "passenger_railways", + PawnShops => "pawn_shops", + PetShopsPetFoodAndSupplies => "pet_shops_pet_food_and_supplies", + PetroleumAndPetroleumProducts => "petroleum_and_petroleum_products", + PhotoDeveloping => "photo_developing", + PhotographicPhotocopyMicrofilmEquipmentAndSupplies => { + "photographic_photocopy_microfilm_equipment_and_supplies" + } + PhotographicStudios => "photographic_studios", + PictureVideoProduction => "picture_video_production", + PieceGoodsNotionsAndOtherDryGoods => "piece_goods_notions_and_other_dry_goods", + PlumbingHeatingEquipmentAndSupplies => "plumbing_heating_equipment_and_supplies", + PoliticalOrganizations => "political_organizations", + PostalServicesGovernmentOnly => "postal_services_government_only", + PreciousStonesAndMetalsWatchesAndJewelry => { + "precious_stones_and_metals_watches_and_jewelry" + } + ProfessionalServices => "professional_services", + PublicWarehousingAndStorage => "public_warehousing_and_storage", + QuickCopyReproAndBlueprint => "quick_copy_repro_and_blueprint", + Railroads => "railroads", + RealEstateAgentsAndManagersRentals => "real_estate_agents_and_managers_rentals", + RecordStores => "record_stores", + RecreationalVehicleRentals => "recreational_vehicle_rentals", + ReligiousGoodsStores => "religious_goods_stores", + ReligiousOrganizations => "religious_organizations", + RoofingSidingSheetMetal => "roofing_siding_sheet_metal", + SecretarialSupportServices => "secretarial_support_services", + SecurityBrokersDealers => "security_brokers_dealers", + ServiceStations => "service_stations", + SewingNeedleworkFabricAndPieceGoodsStores => { + "sewing_needlework_fabric_and_piece_goods_stores" + } + ShoeRepairHatCleaning => "shoe_repair_hat_cleaning", + ShoeStores => "shoe_stores", + SmallApplianceRepair => "small_appliance_repair", + SnowmobileDealers => "snowmobile_dealers", + SpecialTradeServices => "special_trade_services", + SpecialtyCleaning => "specialty_cleaning", + SportingGoodsStores => "sporting_goods_stores", + SportingRecreationCamps => "sporting_recreation_camps", + SportsAndRidingApparelStores => "sports_and_riding_apparel_stores", + SportsClubsFields => "sports_clubs_fields", + StampAndCoinStores => "stamp_and_coin_stores", + StationaryOfficeSuppliesPrintingAndWritingPaper => { + "stationary_office_supplies_printing_and_writing_paper" + } + StationeryStoresOfficeAndSchoolSupplyStores => { + "stationery_stores_office_and_school_supply_stores" + } + SwimmingPoolsSales => "swimming_pools_sales", + TUiTravelGermany => "t_ui_travel_germany", + TailorsAlterations => "tailors_alterations", + TaxPaymentsGovernmentAgencies => "tax_payments_government_agencies", + TaxPreparationServices => "tax_preparation_services", + TaxicabsLimousines => "taxicabs_limousines", + TelecommunicationEquipmentAndTelephoneSales => { + "telecommunication_equipment_and_telephone_sales" + } + TelecommunicationServices => "telecommunication_services", + TelegraphServices => "telegraph_services", + TentAndAwningShops => "tent_and_awning_shops", + TestingLaboratories => "testing_laboratories", + TheatricalTicketAgencies => "theatrical_ticket_agencies", + Timeshares => "timeshares", + TireRetreadingAndRepair => "tire_retreading_and_repair", + TollsBridgeFees => "tolls_bridge_fees", + TouristAttractionsAndExhibits => "tourist_attractions_and_exhibits", + TowingServices => "towing_services", + TrailerParksCampgrounds => "trailer_parks_campgrounds", + TransportationServices => "transportation_services", + TravelAgenciesTourOperators => "travel_agencies_tour_operators", + TruckStopIteration => "truck_stop_iteration", + TruckUtilityTrailerRentals => "truck_utility_trailer_rentals", + TypesettingPlateMakingAndRelatedServices => { + "typesetting_plate_making_and_related_services" + } + TypewriterStores => "typewriter_stores", + USFederalGovernmentAgenciesOrDepartments => { + "u_s_federal_government_agencies_or_departments" + } + UniformsCommercialClothing => "uniforms_commercial_clothing", + UsedMerchandiseAndSecondhandStores => "used_merchandise_and_secondhand_stores", + Utilities => "utilities", + VarietyStores => "variety_stores", + VeterinaryServices => "veterinary_services", + VideoAmusementGameSupplies => "video_amusement_game_supplies", + VideoGameArcades => "video_game_arcades", + VideoTapeRentalStores => "video_tape_rental_stores", + VocationalTradeSchools => "vocational_trade_schools", + WatchJewelryRepair => "watch_jewelry_repair", + WeldingRepair => "welding_repair", + WholesaleClubs => "wholesale_clubs", + WigAndToupeeStores => "wig_and_toupee_stores", + WiresMoneyOrders => "wires_money_orders", + WomensAccessoryAndSpecialtyShops => "womens_accessory_and_specialty_shops", + WomensReadyToWearStores => "womens_ready_to_wear_stores", + WreckingAndSalvageYards => "wrecking_and_salvage_yards", + Unknown => "unknown", + } + } +} + +impl std::str::FromStr for CreateIssuingCardSpendingControlsBlockedCategories { + type Err = (); + fn from_str(s: &str) -> Result { + use CreateIssuingCardSpendingControlsBlockedCategories::*; + match s { + "ac_refrigeration_repair" => Ok(AcRefrigerationRepair), + "accounting_bookkeeping_services" => Ok(AccountingBookkeepingServices), + "advertising_services" => Ok(AdvertisingServices), + "agricultural_cooperative" => Ok(AgriculturalCooperative), + "airlines_air_carriers" => Ok(AirlinesAirCarriers), + "airports_flying_fields" => Ok(AirportsFlyingFields), + "ambulance_services" => Ok(AmbulanceServices), + "amusement_parks_carnivals" => Ok(AmusementParksCarnivals), + "antique_reproductions" => Ok(AntiqueReproductions), + "antique_shops" => Ok(AntiqueShops), + "aquariums" => Ok(Aquariums), + "architectural_surveying_services" => Ok(ArchitecturalSurveyingServices), + "art_dealers_and_galleries" => Ok(ArtDealersAndGalleries), + "artists_supply_and_craft_shops" => Ok(ArtistsSupplyAndCraftShops), + "auto_and_home_supply_stores" => Ok(AutoAndHomeSupplyStores), + "auto_body_repair_shops" => Ok(AutoBodyRepairShops), + "auto_paint_shops" => Ok(AutoPaintShops), + "auto_service_shops" => Ok(AutoServiceShops), + "automated_cash_disburse" => Ok(AutomatedCashDisburse), + "automated_fuel_dispensers" => Ok(AutomatedFuelDispensers), + "automobile_associations" => Ok(AutomobileAssociations), + "automotive_parts_and_accessories_stores" => Ok(AutomotivePartsAndAccessoriesStores), + "automotive_tire_stores" => Ok(AutomotiveTireStores), + "bail_and_bond_payments" => Ok(BailAndBondPayments), + "bakeries" => Ok(Bakeries), + "bands_orchestras" => Ok(BandsOrchestras), + "barber_and_beauty_shops" => Ok(BarberAndBeautyShops), + "betting_casino_gambling" => Ok(BettingCasinoGambling), + "bicycle_shops" => Ok(BicycleShops), + "billiard_pool_establishments" => Ok(BilliardPoolEstablishments), + "boat_dealers" => Ok(BoatDealers), + "boat_rentals_and_leases" => Ok(BoatRentalsAndLeases), + "book_stores" => Ok(BookStores), + "books_periodicals_and_newspapers" => Ok(BooksPeriodicalsAndNewspapers), + "bowling_alleys" => Ok(BowlingAlleys), + "bus_lines" => Ok(BusLines), + "business_secretarial_schools" => Ok(BusinessSecretarialSchools), + "buying_shopping_services" => Ok(BuyingShoppingServices), + "cable_satellite_and_other_pay_television_and_radio" => { + Ok(CableSatelliteAndOtherPayTelevisionAndRadio) + } + "camera_and_photographic_supply_stores" => Ok(CameraAndPhotographicSupplyStores), + "candy_nut_and_confectionery_stores" => Ok(CandyNutAndConfectioneryStores), + "car_and_truck_dealers_new_used" => Ok(CarAndTruckDealersNewUsed), + "car_and_truck_dealers_used_only" => Ok(CarAndTruckDealersUsedOnly), + "car_rental_agencies" => Ok(CarRentalAgencies), + "car_washes" => Ok(CarWashes), + "carpentry_services" => Ok(CarpentryServices), + "carpet_upholstery_cleaning" => Ok(CarpetUpholsteryCleaning), + "caterers" => Ok(Caterers), + "charitable_and_social_service_organizations_fundraising" => { + Ok(CharitableAndSocialServiceOrganizationsFundraising) + } + "chemicals_and_allied_products" => Ok(ChemicalsAndAlliedProducts), + "child_care_services" => Ok(ChildCareServices), + "childrens_and_infants_wear_stores" => Ok(ChildrensAndInfantsWearStores), + "chiropodists_podiatrists" => Ok(ChiropodistsPodiatrists), + "chiropractors" => Ok(Chiropractors), + "cigar_stores_and_stands" => Ok(CigarStoresAndStands), + "civic_social_fraternal_associations" => Ok(CivicSocialFraternalAssociations), + "cleaning_and_maintenance" => Ok(CleaningAndMaintenance), + "clothing_rental" => Ok(ClothingRental), + "colleges_universities" => Ok(CollegesUniversities), + "commercial_equipment" => Ok(CommercialEquipment), + "commercial_footwear" => Ok(CommercialFootwear), + "commercial_photography_art_and_graphics" => Ok(CommercialPhotographyArtAndGraphics), + "commuter_transport_and_ferries" => Ok(CommuterTransportAndFerries), + "computer_network_services" => Ok(ComputerNetworkServices), + "computer_programming" => Ok(ComputerProgramming), + "computer_repair" => Ok(ComputerRepair), + "computer_software_stores" => Ok(ComputerSoftwareStores), + "computers_peripherals_and_software" => Ok(ComputersPeripheralsAndSoftware), + "concrete_work_services" => Ok(ConcreteWorkServices), + "construction_materials" => Ok(ConstructionMaterials), + "consulting_public_relations" => Ok(ConsultingPublicRelations), + "correspondence_schools" => Ok(CorrespondenceSchools), + "cosmetic_stores" => Ok(CosmeticStores), + "counseling_services" => Ok(CounselingServices), + "country_clubs" => Ok(CountryClubs), + "courier_services" => Ok(CourierServices), + "court_costs" => Ok(CourtCosts), + "credit_reporting_agencies" => Ok(CreditReportingAgencies), + "cruise_lines" => Ok(CruiseLines), + "dairy_products_stores" => Ok(DairyProductsStores), + "dance_hall_studios_schools" => Ok(DanceHallStudiosSchools), + "dating_escort_services" => Ok(DatingEscortServices), + "dentists_orthodontists" => Ok(DentistsOrthodontists), + "department_stores" => Ok(DepartmentStores), + "detective_agencies" => Ok(DetectiveAgencies), + "digital_goods_applications" => Ok(DigitalGoodsApplications), + "digital_goods_games" => Ok(DigitalGoodsGames), + "digital_goods_large_volume" => Ok(DigitalGoodsLargeVolume), + "digital_goods_media" => Ok(DigitalGoodsMedia), + "direct_marketing_catalog_merchant" => Ok(DirectMarketingCatalogMerchant), + "direct_marketing_combination_catalog_and_retail_merchant" => { + Ok(DirectMarketingCombinationCatalogAndRetailMerchant) + } + "direct_marketing_inbound_telemarketing" => Ok(DirectMarketingInboundTelemarketing), + "direct_marketing_insurance_services" => Ok(DirectMarketingInsuranceServices), + "direct_marketing_other" => Ok(DirectMarketingOther), + "direct_marketing_outbound_telemarketing" => Ok(DirectMarketingOutboundTelemarketing), + "direct_marketing_subscription" => Ok(DirectMarketingSubscription), + "direct_marketing_travel" => Ok(DirectMarketingTravel), + "discount_stores" => Ok(DiscountStores), + "doctors" => Ok(Doctors), + "door_to_door_sales" => Ok(DoorToDoorSales), + "drapery_window_covering_and_upholstery_stores" => { + Ok(DraperyWindowCoveringAndUpholsteryStores) + } + "drinking_places" => Ok(DrinkingPlaces), + "drug_stores_and_pharmacies" => Ok(DrugStoresAndPharmacies), + "drugs_drug_proprietaries_and_druggist_sundries" => { + Ok(DrugsDrugProprietariesAndDruggistSundries) + } + "dry_cleaners" => Ok(DryCleaners), + "durable_goods" => Ok(DurableGoods), + "duty_free_stores" => Ok(DutyFreeStores), + "eating_places_restaurants" => Ok(EatingPlacesRestaurants), + "educational_services" => Ok(EducationalServices), + "electric_razor_stores" => Ok(ElectricRazorStores), + "electric_vehicle_charging" => Ok(ElectricVehicleCharging), + "electrical_parts_and_equipment" => Ok(ElectricalPartsAndEquipment), + "electrical_services" => Ok(ElectricalServices), + "electronics_repair_shops" => Ok(ElectronicsRepairShops), + "electronics_stores" => Ok(ElectronicsStores), + "elementary_secondary_schools" => Ok(ElementarySecondarySchools), + "emergency_services_gcas_visa_use_only" => Ok(EmergencyServicesGcasVisaUseOnly), + "employment_temp_agencies" => Ok(EmploymentTempAgencies), + "equipment_rental" => Ok(EquipmentRental), + "exterminating_services" => Ok(ExterminatingServices), + "family_clothing_stores" => Ok(FamilyClothingStores), + "fast_food_restaurants" => Ok(FastFoodRestaurants), + "financial_institutions" => Ok(FinancialInstitutions), + "fines_government_administrative_entities" => Ok(FinesGovernmentAdministrativeEntities), + "fireplace_fireplace_screens_and_accessories_stores" => { + Ok(FireplaceFireplaceScreensAndAccessoriesStores) + } + "floor_covering_stores" => Ok(FloorCoveringStores), + "florists" => Ok(Florists), + "florists_supplies_nursery_stock_and_flowers" => { + Ok(FloristsSuppliesNurseryStockAndFlowers) + } + "freezer_and_locker_meat_provisioners" => Ok(FreezerAndLockerMeatProvisioners), + "fuel_dealers_non_automotive" => Ok(FuelDealersNonAutomotive), + "funeral_services_crematories" => Ok(FuneralServicesCrematories), + "furniture_home_furnishings_and_equipment_stores_except_appliances" => { + Ok(FurnitureHomeFurnishingsAndEquipmentStoresExceptAppliances) + } + "furniture_repair_refinishing" => Ok(FurnitureRepairRefinishing), + "furriers_and_fur_shops" => Ok(FurriersAndFurShops), + "general_services" => Ok(GeneralServices), + "gift_card_novelty_and_souvenir_shops" => Ok(GiftCardNoveltyAndSouvenirShops), + "glass_paint_and_wallpaper_stores" => Ok(GlassPaintAndWallpaperStores), + "glassware_crystal_stores" => Ok(GlasswareCrystalStores), + "golf_courses_public" => Ok(GolfCoursesPublic), + "government_licensed_horse_dog_racing_us_region_only" => { + Ok(GovernmentLicensedHorseDogRacingUsRegionOnly) + } + "government_licensed_online_casions_online_gambling_us_region_only" => { + Ok(GovernmentLicensedOnlineCasionsOnlineGamblingUsRegionOnly) + } + "government_owned_lotteries_non_us_region" => Ok(GovernmentOwnedLotteriesNonUsRegion), + "government_owned_lotteries_us_region_only" => Ok(GovernmentOwnedLotteriesUsRegionOnly), + "government_services" => Ok(GovernmentServices), + "grocery_stores_supermarkets" => Ok(GroceryStoresSupermarkets), + "hardware_equipment_and_supplies" => Ok(HardwareEquipmentAndSupplies), + "hardware_stores" => Ok(HardwareStores), + "health_and_beauty_spas" => Ok(HealthAndBeautySpas), + "hearing_aids_sales_and_supplies" => Ok(HearingAidsSalesAndSupplies), + "heating_plumbing_a_c" => Ok(HeatingPlumbingAC), + "hobby_toy_and_game_shops" => Ok(HobbyToyAndGameShops), + "home_supply_warehouse_stores" => Ok(HomeSupplyWarehouseStores), + "hospitals" => Ok(Hospitals), + "hotels_motels_and_resorts" => Ok(HotelsMotelsAndResorts), + "household_appliance_stores" => Ok(HouseholdApplianceStores), + "industrial_supplies" => Ok(IndustrialSupplies), + "information_retrieval_services" => Ok(InformationRetrievalServices), + "insurance_default" => Ok(InsuranceDefault), + "insurance_underwriting_premiums" => Ok(InsuranceUnderwritingPremiums), + "intra_company_purchases" => Ok(IntraCompanyPurchases), + "jewelry_stores_watches_clocks_and_silverware_stores" => { + Ok(JewelryStoresWatchesClocksAndSilverwareStores) + } + "landscaping_services" => Ok(LandscapingServices), + "laundries" => Ok(Laundries), + "laundry_cleaning_services" => Ok(LaundryCleaningServices), + "legal_services_attorneys" => Ok(LegalServicesAttorneys), + "luggage_and_leather_goods_stores" => Ok(LuggageAndLeatherGoodsStores), + "lumber_building_materials_stores" => Ok(LumberBuildingMaterialsStores), + "manual_cash_disburse" => Ok(ManualCashDisburse), + "marinas_service_and_supplies" => Ok(MarinasServiceAndSupplies), + "marketplaces" => Ok(Marketplaces), + "masonry_stonework_and_plaster" => Ok(MasonryStoneworkAndPlaster), + "massage_parlors" => Ok(MassageParlors), + "medical_and_dental_labs" => Ok(MedicalAndDentalLabs), + "medical_dental_ophthalmic_and_hospital_equipment_and_supplies" => { + Ok(MedicalDentalOphthalmicAndHospitalEquipmentAndSupplies) + } + "medical_services" => Ok(MedicalServices), + "membership_organizations" => Ok(MembershipOrganizations), + "mens_and_boys_clothing_and_accessories_stores" => { + Ok(MensAndBoysClothingAndAccessoriesStores) + } + "mens_womens_clothing_stores" => Ok(MensWomensClothingStores), + "metal_service_centers" => Ok(MetalServiceCenters), + "miscellaneous" => Ok(Miscellaneous), + "miscellaneous_apparel_and_accessory_shops" => { + Ok(MiscellaneousApparelAndAccessoryShops) + } + "miscellaneous_auto_dealers" => Ok(MiscellaneousAutoDealers), + "miscellaneous_business_services" => Ok(MiscellaneousBusinessServices), + "miscellaneous_food_stores" => Ok(MiscellaneousFoodStores), + "miscellaneous_general_merchandise" => Ok(MiscellaneousGeneralMerchandise), + "miscellaneous_general_services" => Ok(MiscellaneousGeneralServices), + "miscellaneous_home_furnishing_specialty_stores" => { + Ok(MiscellaneousHomeFurnishingSpecialtyStores) + } + "miscellaneous_publishing_and_printing" => Ok(MiscellaneousPublishingAndPrinting), + "miscellaneous_recreation_services" => Ok(MiscellaneousRecreationServices), + "miscellaneous_repair_shops" => Ok(MiscellaneousRepairShops), + "miscellaneous_specialty_retail" => Ok(MiscellaneousSpecialtyRetail), + "mobile_home_dealers" => Ok(MobileHomeDealers), + "motion_picture_theaters" => Ok(MotionPictureTheaters), + "motor_freight_carriers_and_trucking" => Ok(MotorFreightCarriersAndTrucking), + "motor_homes_dealers" => Ok(MotorHomesDealers), + "motor_vehicle_supplies_and_new_parts" => Ok(MotorVehicleSuppliesAndNewParts), + "motorcycle_shops_and_dealers" => Ok(MotorcycleShopsAndDealers), + "motorcycle_shops_dealers" => Ok(MotorcycleShopsDealers), + "music_stores_musical_instruments_pianos_and_sheet_music" => { + Ok(MusicStoresMusicalInstrumentsPianosAndSheetMusic) + } + "news_dealers_and_newsstands" => Ok(NewsDealersAndNewsstands), + "non_fi_money_orders" => Ok(NonFiMoneyOrders), + "non_fi_stored_value_card_purchase_load" => Ok(NonFiStoredValueCardPurchaseLoad), + "nondurable_goods" => Ok(NondurableGoods), + "nurseries_lawn_and_garden_supply_stores" => Ok(NurseriesLawnAndGardenSupplyStores), + "nursing_personal_care" => Ok(NursingPersonalCare), + "office_and_commercial_furniture" => Ok(OfficeAndCommercialFurniture), + "opticians_eyeglasses" => Ok(OpticiansEyeglasses), + "optometrists_ophthalmologist" => Ok(OptometristsOphthalmologist), + "orthopedic_goods_prosthetic_devices" => Ok(OrthopedicGoodsProstheticDevices), + "osteopaths" => Ok(Osteopaths), + "package_stores_beer_wine_and_liquor" => Ok(PackageStoresBeerWineAndLiquor), + "paints_varnishes_and_supplies" => Ok(PaintsVarnishesAndSupplies), + "parking_lots_garages" => Ok(ParkingLotsGarages), + "passenger_railways" => Ok(PassengerRailways), + "pawn_shops" => Ok(PawnShops), + "pet_shops_pet_food_and_supplies" => Ok(PetShopsPetFoodAndSupplies), + "petroleum_and_petroleum_products" => Ok(PetroleumAndPetroleumProducts), + "photo_developing" => Ok(PhotoDeveloping), + "photographic_photocopy_microfilm_equipment_and_supplies" => { + Ok(PhotographicPhotocopyMicrofilmEquipmentAndSupplies) + } + "photographic_studios" => Ok(PhotographicStudios), + "picture_video_production" => Ok(PictureVideoProduction), + "piece_goods_notions_and_other_dry_goods" => Ok(PieceGoodsNotionsAndOtherDryGoods), + "plumbing_heating_equipment_and_supplies" => Ok(PlumbingHeatingEquipmentAndSupplies), + "political_organizations" => Ok(PoliticalOrganizations), + "postal_services_government_only" => Ok(PostalServicesGovernmentOnly), + "precious_stones_and_metals_watches_and_jewelry" => { + Ok(PreciousStonesAndMetalsWatchesAndJewelry) + } + "professional_services" => Ok(ProfessionalServices), + "public_warehousing_and_storage" => Ok(PublicWarehousingAndStorage), + "quick_copy_repro_and_blueprint" => Ok(QuickCopyReproAndBlueprint), + "railroads" => Ok(Railroads), + "real_estate_agents_and_managers_rentals" => Ok(RealEstateAgentsAndManagersRentals), + "record_stores" => Ok(RecordStores), + "recreational_vehicle_rentals" => Ok(RecreationalVehicleRentals), + "religious_goods_stores" => Ok(ReligiousGoodsStores), + "religious_organizations" => Ok(ReligiousOrganizations), + "roofing_siding_sheet_metal" => Ok(RoofingSidingSheetMetal), + "secretarial_support_services" => Ok(SecretarialSupportServices), + "security_brokers_dealers" => Ok(SecurityBrokersDealers), + "service_stations" => Ok(ServiceStations), + "sewing_needlework_fabric_and_piece_goods_stores" => { + Ok(SewingNeedleworkFabricAndPieceGoodsStores) + } + "shoe_repair_hat_cleaning" => Ok(ShoeRepairHatCleaning), + "shoe_stores" => Ok(ShoeStores), + "small_appliance_repair" => Ok(SmallApplianceRepair), + "snowmobile_dealers" => Ok(SnowmobileDealers), + "special_trade_services" => Ok(SpecialTradeServices), + "specialty_cleaning" => Ok(SpecialtyCleaning), + "sporting_goods_stores" => Ok(SportingGoodsStores), + "sporting_recreation_camps" => Ok(SportingRecreationCamps), + "sports_and_riding_apparel_stores" => Ok(SportsAndRidingApparelStores), + "sports_clubs_fields" => Ok(SportsClubsFields), + "stamp_and_coin_stores" => Ok(StampAndCoinStores), + "stationary_office_supplies_printing_and_writing_paper" => { + Ok(StationaryOfficeSuppliesPrintingAndWritingPaper) + } + "stationery_stores_office_and_school_supply_stores" => { + Ok(StationeryStoresOfficeAndSchoolSupplyStores) + } + "swimming_pools_sales" => Ok(SwimmingPoolsSales), + "t_ui_travel_germany" => Ok(TUiTravelGermany), + "tailors_alterations" => Ok(TailorsAlterations), + "tax_payments_government_agencies" => Ok(TaxPaymentsGovernmentAgencies), + "tax_preparation_services" => Ok(TaxPreparationServices), + "taxicabs_limousines" => Ok(TaxicabsLimousines), + "telecommunication_equipment_and_telephone_sales" => { + Ok(TelecommunicationEquipmentAndTelephoneSales) + } + "telecommunication_services" => Ok(TelecommunicationServices), + "telegraph_services" => Ok(TelegraphServices), + "tent_and_awning_shops" => Ok(TentAndAwningShops), + "testing_laboratories" => Ok(TestingLaboratories), + "theatrical_ticket_agencies" => Ok(TheatricalTicketAgencies), + "timeshares" => Ok(Timeshares), + "tire_retreading_and_repair" => Ok(TireRetreadingAndRepair), + "tolls_bridge_fees" => Ok(TollsBridgeFees), + "tourist_attractions_and_exhibits" => Ok(TouristAttractionsAndExhibits), + "towing_services" => Ok(TowingServices), + "trailer_parks_campgrounds" => Ok(TrailerParksCampgrounds), + "transportation_services" => Ok(TransportationServices), + "travel_agencies_tour_operators" => Ok(TravelAgenciesTourOperators), + "truck_stop_iteration" => Ok(TruckStopIteration), + "truck_utility_trailer_rentals" => Ok(TruckUtilityTrailerRentals), + "typesetting_plate_making_and_related_services" => { + Ok(TypesettingPlateMakingAndRelatedServices) + } + "typewriter_stores" => Ok(TypewriterStores), + "u_s_federal_government_agencies_or_departments" => { + Ok(USFederalGovernmentAgenciesOrDepartments) + } + "uniforms_commercial_clothing" => Ok(UniformsCommercialClothing), + "used_merchandise_and_secondhand_stores" => Ok(UsedMerchandiseAndSecondhandStores), + "utilities" => Ok(Utilities), + "variety_stores" => Ok(VarietyStores), + "veterinary_services" => Ok(VeterinaryServices), + "video_amusement_game_supplies" => Ok(VideoAmusementGameSupplies), + "video_game_arcades" => Ok(VideoGameArcades), + "video_tape_rental_stores" => Ok(VideoTapeRentalStores), + "vocational_trade_schools" => Ok(VocationalTradeSchools), + "watch_jewelry_repair" => Ok(WatchJewelryRepair), + "welding_repair" => Ok(WeldingRepair), + "wholesale_clubs" => Ok(WholesaleClubs), + "wig_and_toupee_stores" => Ok(WigAndToupeeStores), + "wires_money_orders" => Ok(WiresMoneyOrders), + "womens_accessory_and_specialty_shops" => Ok(WomensAccessoryAndSpecialtyShops), + "womens_ready_to_wear_stores" => Ok(WomensReadyToWearStores), + "wrecking_and_salvage_yards" => Ok(WreckingAndSalvageYards), + _ => Err(()), + } + } +} +impl std::fmt::Display for CreateIssuingCardSpendingControlsBlockedCategories { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreateIssuingCardSpendingControlsBlockedCategories { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreateIssuingCardSpendingControlsBlockedCategories { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Limit spending with amount-based rules that apply across any cards this card replaced (i.e., its `replacement_for` card and _that_ card's `replacement_for` card, up the chain). +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreateIssuingCardSpendingControlsSpendingLimits<'a> { + /// Maximum amount allowed to spend per interval. + pub amount: i64, + /// Array of strings containing [categories](https://stripe.com/docs/api#issuing_authorization_object-merchant_data-category) this limit applies to. + /// Omitting this field will apply the limit to all categories. + #[serde(skip_serializing_if = "Option::is_none")] + pub categories: Option<&'a [CreateIssuingCardSpendingControlsSpendingLimitsCategories]>, + /// Interval (or event) to which the amount applies. + pub interval: CreateIssuingCardSpendingControlsSpendingLimitsInterval, +} +impl<'a> CreateIssuingCardSpendingControlsSpendingLimits<'a> { + pub fn new( + amount: i64, + interval: CreateIssuingCardSpendingControlsSpendingLimitsInterval, + ) -> Self { + Self { amount, categories: None, interval } + } +} +/// Array of strings containing [categories](https://stripe.com/docs/api#issuing_authorization_object-merchant_data-category) this limit applies to. +/// Omitting this field will apply the limit to all categories. +#[derive(Copy, Clone, Eq, PartialEq)] +#[non_exhaustive] +pub enum CreateIssuingCardSpendingControlsSpendingLimitsCategories { + AcRefrigerationRepair, + AccountingBookkeepingServices, + AdvertisingServices, + AgriculturalCooperative, + AirlinesAirCarriers, + AirportsFlyingFields, + AmbulanceServices, + AmusementParksCarnivals, + AntiqueReproductions, + AntiqueShops, + Aquariums, + ArchitecturalSurveyingServices, + ArtDealersAndGalleries, + ArtistsSupplyAndCraftShops, + AutoAndHomeSupplyStores, + AutoBodyRepairShops, + AutoPaintShops, + AutoServiceShops, + AutomatedCashDisburse, + AutomatedFuelDispensers, + AutomobileAssociations, + AutomotivePartsAndAccessoriesStores, + AutomotiveTireStores, + BailAndBondPayments, + Bakeries, + BandsOrchestras, + BarberAndBeautyShops, + BettingCasinoGambling, + BicycleShops, + BilliardPoolEstablishments, + BoatDealers, + BoatRentalsAndLeases, + BookStores, + BooksPeriodicalsAndNewspapers, + BowlingAlleys, + BusLines, + BusinessSecretarialSchools, + BuyingShoppingServices, + CableSatelliteAndOtherPayTelevisionAndRadio, + CameraAndPhotographicSupplyStores, + CandyNutAndConfectioneryStores, + CarAndTruckDealersNewUsed, + CarAndTruckDealersUsedOnly, + CarRentalAgencies, + CarWashes, + CarpentryServices, + CarpetUpholsteryCleaning, + Caterers, + CharitableAndSocialServiceOrganizationsFundraising, + ChemicalsAndAlliedProducts, + ChildCareServices, + ChildrensAndInfantsWearStores, + ChiropodistsPodiatrists, + Chiropractors, + CigarStoresAndStands, + CivicSocialFraternalAssociations, + CleaningAndMaintenance, + ClothingRental, + CollegesUniversities, + CommercialEquipment, + CommercialFootwear, + CommercialPhotographyArtAndGraphics, + CommuterTransportAndFerries, + ComputerNetworkServices, + ComputerProgramming, + ComputerRepair, + ComputerSoftwareStores, + ComputersPeripheralsAndSoftware, + ConcreteWorkServices, + ConstructionMaterials, + ConsultingPublicRelations, + CorrespondenceSchools, + CosmeticStores, + CounselingServices, + CountryClubs, + CourierServices, + CourtCosts, + CreditReportingAgencies, + CruiseLines, + DairyProductsStores, + DanceHallStudiosSchools, + DatingEscortServices, + DentistsOrthodontists, + DepartmentStores, + DetectiveAgencies, + DigitalGoodsApplications, + DigitalGoodsGames, + DigitalGoodsLargeVolume, + DigitalGoodsMedia, + DirectMarketingCatalogMerchant, + DirectMarketingCombinationCatalogAndRetailMerchant, + DirectMarketingInboundTelemarketing, + DirectMarketingInsuranceServices, + DirectMarketingOther, + DirectMarketingOutboundTelemarketing, + DirectMarketingSubscription, + DirectMarketingTravel, + DiscountStores, + Doctors, + DoorToDoorSales, + DraperyWindowCoveringAndUpholsteryStores, + DrinkingPlaces, + DrugStoresAndPharmacies, + DrugsDrugProprietariesAndDruggistSundries, + DryCleaners, + DurableGoods, + DutyFreeStores, + EatingPlacesRestaurants, + EducationalServices, + ElectricRazorStores, + ElectricVehicleCharging, + ElectricalPartsAndEquipment, + ElectricalServices, + ElectronicsRepairShops, + ElectronicsStores, + ElementarySecondarySchools, + EmergencyServicesGcasVisaUseOnly, + EmploymentTempAgencies, + EquipmentRental, + ExterminatingServices, + FamilyClothingStores, + FastFoodRestaurants, + FinancialInstitutions, + FinesGovernmentAdministrativeEntities, + FireplaceFireplaceScreensAndAccessoriesStores, + FloorCoveringStores, + Florists, + FloristsSuppliesNurseryStockAndFlowers, + FreezerAndLockerMeatProvisioners, + FuelDealersNonAutomotive, + FuneralServicesCrematories, + FurnitureHomeFurnishingsAndEquipmentStoresExceptAppliances, + FurnitureRepairRefinishing, + FurriersAndFurShops, + GeneralServices, + GiftCardNoveltyAndSouvenirShops, + GlassPaintAndWallpaperStores, + GlasswareCrystalStores, + GolfCoursesPublic, + GovernmentLicensedHorseDogRacingUsRegionOnly, + GovernmentLicensedOnlineCasionsOnlineGamblingUsRegionOnly, + GovernmentOwnedLotteriesNonUsRegion, + GovernmentOwnedLotteriesUsRegionOnly, + GovernmentServices, + GroceryStoresSupermarkets, + HardwareEquipmentAndSupplies, + HardwareStores, + HealthAndBeautySpas, + HearingAidsSalesAndSupplies, + HeatingPlumbingAC, + HobbyToyAndGameShops, + HomeSupplyWarehouseStores, + Hospitals, + HotelsMotelsAndResorts, + HouseholdApplianceStores, + IndustrialSupplies, + InformationRetrievalServices, + InsuranceDefault, + InsuranceUnderwritingPremiums, + IntraCompanyPurchases, + JewelryStoresWatchesClocksAndSilverwareStores, + LandscapingServices, + Laundries, + LaundryCleaningServices, + LegalServicesAttorneys, + LuggageAndLeatherGoodsStores, + LumberBuildingMaterialsStores, + ManualCashDisburse, + MarinasServiceAndSupplies, + Marketplaces, + MasonryStoneworkAndPlaster, + MassageParlors, + MedicalAndDentalLabs, + MedicalDentalOphthalmicAndHospitalEquipmentAndSupplies, + MedicalServices, + MembershipOrganizations, + MensAndBoysClothingAndAccessoriesStores, + MensWomensClothingStores, + MetalServiceCenters, + Miscellaneous, + MiscellaneousApparelAndAccessoryShops, + MiscellaneousAutoDealers, + MiscellaneousBusinessServices, + MiscellaneousFoodStores, + MiscellaneousGeneralMerchandise, + MiscellaneousGeneralServices, + MiscellaneousHomeFurnishingSpecialtyStores, + MiscellaneousPublishingAndPrinting, + MiscellaneousRecreationServices, + MiscellaneousRepairShops, + MiscellaneousSpecialtyRetail, + MobileHomeDealers, + MotionPictureTheaters, + MotorFreightCarriersAndTrucking, + MotorHomesDealers, + MotorVehicleSuppliesAndNewParts, + MotorcycleShopsAndDealers, + MotorcycleShopsDealers, + MusicStoresMusicalInstrumentsPianosAndSheetMusic, + NewsDealersAndNewsstands, + NonFiMoneyOrders, + NonFiStoredValueCardPurchaseLoad, + NondurableGoods, + NurseriesLawnAndGardenSupplyStores, + NursingPersonalCare, + OfficeAndCommercialFurniture, + OpticiansEyeglasses, + OptometristsOphthalmologist, + OrthopedicGoodsProstheticDevices, + Osteopaths, + PackageStoresBeerWineAndLiquor, + PaintsVarnishesAndSupplies, + ParkingLotsGarages, + PassengerRailways, + PawnShops, + PetShopsPetFoodAndSupplies, + PetroleumAndPetroleumProducts, + PhotoDeveloping, + PhotographicPhotocopyMicrofilmEquipmentAndSupplies, + PhotographicStudios, + PictureVideoProduction, + PieceGoodsNotionsAndOtherDryGoods, + PlumbingHeatingEquipmentAndSupplies, + PoliticalOrganizations, + PostalServicesGovernmentOnly, + PreciousStonesAndMetalsWatchesAndJewelry, + ProfessionalServices, + PublicWarehousingAndStorage, + QuickCopyReproAndBlueprint, + Railroads, + RealEstateAgentsAndManagersRentals, + RecordStores, + RecreationalVehicleRentals, + ReligiousGoodsStores, + ReligiousOrganizations, + RoofingSidingSheetMetal, + SecretarialSupportServices, + SecurityBrokersDealers, + ServiceStations, + SewingNeedleworkFabricAndPieceGoodsStores, + ShoeRepairHatCleaning, + ShoeStores, + SmallApplianceRepair, + SnowmobileDealers, + SpecialTradeServices, + SpecialtyCleaning, + SportingGoodsStores, + SportingRecreationCamps, + SportsAndRidingApparelStores, + SportsClubsFields, + StampAndCoinStores, + StationaryOfficeSuppliesPrintingAndWritingPaper, + StationeryStoresOfficeAndSchoolSupplyStores, + SwimmingPoolsSales, + TUiTravelGermany, + TailorsAlterations, + TaxPaymentsGovernmentAgencies, + TaxPreparationServices, + TaxicabsLimousines, + TelecommunicationEquipmentAndTelephoneSales, + TelecommunicationServices, + TelegraphServices, + TentAndAwningShops, + TestingLaboratories, + TheatricalTicketAgencies, + Timeshares, + TireRetreadingAndRepair, + TollsBridgeFees, + TouristAttractionsAndExhibits, + TowingServices, + TrailerParksCampgrounds, + TransportationServices, + TravelAgenciesTourOperators, + TruckStopIteration, + TruckUtilityTrailerRentals, + TypesettingPlateMakingAndRelatedServices, + TypewriterStores, + USFederalGovernmentAgenciesOrDepartments, + UniformsCommercialClothing, + UsedMerchandiseAndSecondhandStores, + Utilities, + VarietyStores, + VeterinaryServices, + VideoAmusementGameSupplies, + VideoGameArcades, + VideoTapeRentalStores, + VocationalTradeSchools, + WatchJewelryRepair, + WeldingRepair, + WholesaleClubs, + WigAndToupeeStores, + WiresMoneyOrders, + WomensAccessoryAndSpecialtyShops, + WomensReadyToWearStores, + WreckingAndSalvageYards, + /// An unrecognized value from Stripe. Should not be used as a request parameter. + Unknown, +} +impl CreateIssuingCardSpendingControlsSpendingLimitsCategories { + pub fn as_str(self) -> &'static str { + use CreateIssuingCardSpendingControlsSpendingLimitsCategories::*; + match self { + AcRefrigerationRepair => "ac_refrigeration_repair", + AccountingBookkeepingServices => "accounting_bookkeeping_services", + AdvertisingServices => "advertising_services", + AgriculturalCooperative => "agricultural_cooperative", + AirlinesAirCarriers => "airlines_air_carriers", + AirportsFlyingFields => "airports_flying_fields", + AmbulanceServices => "ambulance_services", + AmusementParksCarnivals => "amusement_parks_carnivals", + AntiqueReproductions => "antique_reproductions", + AntiqueShops => "antique_shops", + Aquariums => "aquariums", + ArchitecturalSurveyingServices => "architectural_surveying_services", + ArtDealersAndGalleries => "art_dealers_and_galleries", + ArtistsSupplyAndCraftShops => "artists_supply_and_craft_shops", + AutoAndHomeSupplyStores => "auto_and_home_supply_stores", + AutoBodyRepairShops => "auto_body_repair_shops", + AutoPaintShops => "auto_paint_shops", + AutoServiceShops => "auto_service_shops", + AutomatedCashDisburse => "automated_cash_disburse", + AutomatedFuelDispensers => "automated_fuel_dispensers", + AutomobileAssociations => "automobile_associations", + AutomotivePartsAndAccessoriesStores => "automotive_parts_and_accessories_stores", + AutomotiveTireStores => "automotive_tire_stores", + BailAndBondPayments => "bail_and_bond_payments", + Bakeries => "bakeries", + BandsOrchestras => "bands_orchestras", + BarberAndBeautyShops => "barber_and_beauty_shops", + BettingCasinoGambling => "betting_casino_gambling", + BicycleShops => "bicycle_shops", + BilliardPoolEstablishments => "billiard_pool_establishments", + BoatDealers => "boat_dealers", + BoatRentalsAndLeases => "boat_rentals_and_leases", + BookStores => "book_stores", + BooksPeriodicalsAndNewspapers => "books_periodicals_and_newspapers", + BowlingAlleys => "bowling_alleys", + BusLines => "bus_lines", + BusinessSecretarialSchools => "business_secretarial_schools", + BuyingShoppingServices => "buying_shopping_services", + CableSatelliteAndOtherPayTelevisionAndRadio => { + "cable_satellite_and_other_pay_television_and_radio" + } + CameraAndPhotographicSupplyStores => "camera_and_photographic_supply_stores", + CandyNutAndConfectioneryStores => "candy_nut_and_confectionery_stores", + CarAndTruckDealersNewUsed => "car_and_truck_dealers_new_used", + CarAndTruckDealersUsedOnly => "car_and_truck_dealers_used_only", + CarRentalAgencies => "car_rental_agencies", + CarWashes => "car_washes", + CarpentryServices => "carpentry_services", + CarpetUpholsteryCleaning => "carpet_upholstery_cleaning", + Caterers => "caterers", + CharitableAndSocialServiceOrganizationsFundraising => { + "charitable_and_social_service_organizations_fundraising" + } + ChemicalsAndAlliedProducts => "chemicals_and_allied_products", + ChildCareServices => "child_care_services", + ChildrensAndInfantsWearStores => "childrens_and_infants_wear_stores", + ChiropodistsPodiatrists => "chiropodists_podiatrists", + Chiropractors => "chiropractors", + CigarStoresAndStands => "cigar_stores_and_stands", + CivicSocialFraternalAssociations => "civic_social_fraternal_associations", + CleaningAndMaintenance => "cleaning_and_maintenance", + ClothingRental => "clothing_rental", + CollegesUniversities => "colleges_universities", + CommercialEquipment => "commercial_equipment", + CommercialFootwear => "commercial_footwear", + CommercialPhotographyArtAndGraphics => "commercial_photography_art_and_graphics", + CommuterTransportAndFerries => "commuter_transport_and_ferries", + ComputerNetworkServices => "computer_network_services", + ComputerProgramming => "computer_programming", + ComputerRepair => "computer_repair", + ComputerSoftwareStores => "computer_software_stores", + ComputersPeripheralsAndSoftware => "computers_peripherals_and_software", + ConcreteWorkServices => "concrete_work_services", + ConstructionMaterials => "construction_materials", + ConsultingPublicRelations => "consulting_public_relations", + CorrespondenceSchools => "correspondence_schools", + CosmeticStores => "cosmetic_stores", + CounselingServices => "counseling_services", + CountryClubs => "country_clubs", + CourierServices => "courier_services", + CourtCosts => "court_costs", + CreditReportingAgencies => "credit_reporting_agencies", + CruiseLines => "cruise_lines", + DairyProductsStores => "dairy_products_stores", + DanceHallStudiosSchools => "dance_hall_studios_schools", + DatingEscortServices => "dating_escort_services", + DentistsOrthodontists => "dentists_orthodontists", + DepartmentStores => "department_stores", + DetectiveAgencies => "detective_agencies", + DigitalGoodsApplications => "digital_goods_applications", + DigitalGoodsGames => "digital_goods_games", + DigitalGoodsLargeVolume => "digital_goods_large_volume", + DigitalGoodsMedia => "digital_goods_media", + DirectMarketingCatalogMerchant => "direct_marketing_catalog_merchant", + DirectMarketingCombinationCatalogAndRetailMerchant => { + "direct_marketing_combination_catalog_and_retail_merchant" + } + DirectMarketingInboundTelemarketing => "direct_marketing_inbound_telemarketing", + DirectMarketingInsuranceServices => "direct_marketing_insurance_services", + DirectMarketingOther => "direct_marketing_other", + DirectMarketingOutboundTelemarketing => "direct_marketing_outbound_telemarketing", + DirectMarketingSubscription => "direct_marketing_subscription", + DirectMarketingTravel => "direct_marketing_travel", + DiscountStores => "discount_stores", + Doctors => "doctors", + DoorToDoorSales => "door_to_door_sales", + DraperyWindowCoveringAndUpholsteryStores => { + "drapery_window_covering_and_upholstery_stores" + } + DrinkingPlaces => "drinking_places", + DrugStoresAndPharmacies => "drug_stores_and_pharmacies", + DrugsDrugProprietariesAndDruggistSundries => { + "drugs_drug_proprietaries_and_druggist_sundries" + } + DryCleaners => "dry_cleaners", + DurableGoods => "durable_goods", + DutyFreeStores => "duty_free_stores", + EatingPlacesRestaurants => "eating_places_restaurants", + EducationalServices => "educational_services", + ElectricRazorStores => "electric_razor_stores", + ElectricVehicleCharging => "electric_vehicle_charging", + ElectricalPartsAndEquipment => "electrical_parts_and_equipment", + ElectricalServices => "electrical_services", + ElectronicsRepairShops => "electronics_repair_shops", + ElectronicsStores => "electronics_stores", + ElementarySecondarySchools => "elementary_secondary_schools", + EmergencyServicesGcasVisaUseOnly => "emergency_services_gcas_visa_use_only", + EmploymentTempAgencies => "employment_temp_agencies", + EquipmentRental => "equipment_rental", + ExterminatingServices => "exterminating_services", + FamilyClothingStores => "family_clothing_stores", + FastFoodRestaurants => "fast_food_restaurants", + FinancialInstitutions => "financial_institutions", + FinesGovernmentAdministrativeEntities => "fines_government_administrative_entities", + FireplaceFireplaceScreensAndAccessoriesStores => { + "fireplace_fireplace_screens_and_accessories_stores" + } + FloorCoveringStores => "floor_covering_stores", + Florists => "florists", + FloristsSuppliesNurseryStockAndFlowers => "florists_supplies_nursery_stock_and_flowers", + FreezerAndLockerMeatProvisioners => "freezer_and_locker_meat_provisioners", + FuelDealersNonAutomotive => "fuel_dealers_non_automotive", + FuneralServicesCrematories => "funeral_services_crematories", + FurnitureHomeFurnishingsAndEquipmentStoresExceptAppliances => { + "furniture_home_furnishings_and_equipment_stores_except_appliances" + } + FurnitureRepairRefinishing => "furniture_repair_refinishing", + FurriersAndFurShops => "furriers_and_fur_shops", + GeneralServices => "general_services", + GiftCardNoveltyAndSouvenirShops => "gift_card_novelty_and_souvenir_shops", + GlassPaintAndWallpaperStores => "glass_paint_and_wallpaper_stores", + GlasswareCrystalStores => "glassware_crystal_stores", + GolfCoursesPublic => "golf_courses_public", + GovernmentLicensedHorseDogRacingUsRegionOnly => { + "government_licensed_horse_dog_racing_us_region_only" + } + GovernmentLicensedOnlineCasionsOnlineGamblingUsRegionOnly => { + "government_licensed_online_casions_online_gambling_us_region_only" + } + GovernmentOwnedLotteriesNonUsRegion => "government_owned_lotteries_non_us_region", + GovernmentOwnedLotteriesUsRegionOnly => "government_owned_lotteries_us_region_only", + GovernmentServices => "government_services", + GroceryStoresSupermarkets => "grocery_stores_supermarkets", + HardwareEquipmentAndSupplies => "hardware_equipment_and_supplies", + HardwareStores => "hardware_stores", + HealthAndBeautySpas => "health_and_beauty_spas", + HearingAidsSalesAndSupplies => "hearing_aids_sales_and_supplies", + HeatingPlumbingAC => "heating_plumbing_a_c", + HobbyToyAndGameShops => "hobby_toy_and_game_shops", + HomeSupplyWarehouseStores => "home_supply_warehouse_stores", + Hospitals => "hospitals", + HotelsMotelsAndResorts => "hotels_motels_and_resorts", + HouseholdApplianceStores => "household_appliance_stores", + IndustrialSupplies => "industrial_supplies", + InformationRetrievalServices => "information_retrieval_services", + InsuranceDefault => "insurance_default", + InsuranceUnderwritingPremiums => "insurance_underwriting_premiums", + IntraCompanyPurchases => "intra_company_purchases", + JewelryStoresWatchesClocksAndSilverwareStores => { + "jewelry_stores_watches_clocks_and_silverware_stores" + } + LandscapingServices => "landscaping_services", + Laundries => "laundries", + LaundryCleaningServices => "laundry_cleaning_services", + LegalServicesAttorneys => "legal_services_attorneys", + LuggageAndLeatherGoodsStores => "luggage_and_leather_goods_stores", + LumberBuildingMaterialsStores => "lumber_building_materials_stores", + ManualCashDisburse => "manual_cash_disburse", + MarinasServiceAndSupplies => "marinas_service_and_supplies", + Marketplaces => "marketplaces", + MasonryStoneworkAndPlaster => "masonry_stonework_and_plaster", + MassageParlors => "massage_parlors", + MedicalAndDentalLabs => "medical_and_dental_labs", + MedicalDentalOphthalmicAndHospitalEquipmentAndSupplies => { + "medical_dental_ophthalmic_and_hospital_equipment_and_supplies" + } + MedicalServices => "medical_services", + MembershipOrganizations => "membership_organizations", + MensAndBoysClothingAndAccessoriesStores => { + "mens_and_boys_clothing_and_accessories_stores" + } + MensWomensClothingStores => "mens_womens_clothing_stores", + MetalServiceCenters => "metal_service_centers", + Miscellaneous => "miscellaneous", + MiscellaneousApparelAndAccessoryShops => "miscellaneous_apparel_and_accessory_shops", + MiscellaneousAutoDealers => "miscellaneous_auto_dealers", + MiscellaneousBusinessServices => "miscellaneous_business_services", + MiscellaneousFoodStores => "miscellaneous_food_stores", + MiscellaneousGeneralMerchandise => "miscellaneous_general_merchandise", + MiscellaneousGeneralServices => "miscellaneous_general_services", + MiscellaneousHomeFurnishingSpecialtyStores => { + "miscellaneous_home_furnishing_specialty_stores" + } + MiscellaneousPublishingAndPrinting => "miscellaneous_publishing_and_printing", + MiscellaneousRecreationServices => "miscellaneous_recreation_services", + MiscellaneousRepairShops => "miscellaneous_repair_shops", + MiscellaneousSpecialtyRetail => "miscellaneous_specialty_retail", + MobileHomeDealers => "mobile_home_dealers", + MotionPictureTheaters => "motion_picture_theaters", + MotorFreightCarriersAndTrucking => "motor_freight_carriers_and_trucking", + MotorHomesDealers => "motor_homes_dealers", + MotorVehicleSuppliesAndNewParts => "motor_vehicle_supplies_and_new_parts", + MotorcycleShopsAndDealers => "motorcycle_shops_and_dealers", + MotorcycleShopsDealers => "motorcycle_shops_dealers", + MusicStoresMusicalInstrumentsPianosAndSheetMusic => { + "music_stores_musical_instruments_pianos_and_sheet_music" + } + NewsDealersAndNewsstands => "news_dealers_and_newsstands", + NonFiMoneyOrders => "non_fi_money_orders", + NonFiStoredValueCardPurchaseLoad => "non_fi_stored_value_card_purchase_load", + NondurableGoods => "nondurable_goods", + NurseriesLawnAndGardenSupplyStores => "nurseries_lawn_and_garden_supply_stores", + NursingPersonalCare => "nursing_personal_care", + OfficeAndCommercialFurniture => "office_and_commercial_furniture", + OpticiansEyeglasses => "opticians_eyeglasses", + OptometristsOphthalmologist => "optometrists_ophthalmologist", + OrthopedicGoodsProstheticDevices => "orthopedic_goods_prosthetic_devices", + Osteopaths => "osteopaths", + PackageStoresBeerWineAndLiquor => "package_stores_beer_wine_and_liquor", + PaintsVarnishesAndSupplies => "paints_varnishes_and_supplies", + ParkingLotsGarages => "parking_lots_garages", + PassengerRailways => "passenger_railways", + PawnShops => "pawn_shops", + PetShopsPetFoodAndSupplies => "pet_shops_pet_food_and_supplies", + PetroleumAndPetroleumProducts => "petroleum_and_petroleum_products", + PhotoDeveloping => "photo_developing", + PhotographicPhotocopyMicrofilmEquipmentAndSupplies => { + "photographic_photocopy_microfilm_equipment_and_supplies" + } + PhotographicStudios => "photographic_studios", + PictureVideoProduction => "picture_video_production", + PieceGoodsNotionsAndOtherDryGoods => "piece_goods_notions_and_other_dry_goods", + PlumbingHeatingEquipmentAndSupplies => "plumbing_heating_equipment_and_supplies", + PoliticalOrganizations => "political_organizations", + PostalServicesGovernmentOnly => "postal_services_government_only", + PreciousStonesAndMetalsWatchesAndJewelry => { + "precious_stones_and_metals_watches_and_jewelry" + } + ProfessionalServices => "professional_services", + PublicWarehousingAndStorage => "public_warehousing_and_storage", + QuickCopyReproAndBlueprint => "quick_copy_repro_and_blueprint", + Railroads => "railroads", + RealEstateAgentsAndManagersRentals => "real_estate_agents_and_managers_rentals", + RecordStores => "record_stores", + RecreationalVehicleRentals => "recreational_vehicle_rentals", + ReligiousGoodsStores => "religious_goods_stores", + ReligiousOrganizations => "religious_organizations", + RoofingSidingSheetMetal => "roofing_siding_sheet_metal", + SecretarialSupportServices => "secretarial_support_services", + SecurityBrokersDealers => "security_brokers_dealers", + ServiceStations => "service_stations", + SewingNeedleworkFabricAndPieceGoodsStores => { + "sewing_needlework_fabric_and_piece_goods_stores" + } + ShoeRepairHatCleaning => "shoe_repair_hat_cleaning", + ShoeStores => "shoe_stores", + SmallApplianceRepair => "small_appliance_repair", + SnowmobileDealers => "snowmobile_dealers", + SpecialTradeServices => "special_trade_services", + SpecialtyCleaning => "specialty_cleaning", + SportingGoodsStores => "sporting_goods_stores", + SportingRecreationCamps => "sporting_recreation_camps", + SportsAndRidingApparelStores => "sports_and_riding_apparel_stores", + SportsClubsFields => "sports_clubs_fields", + StampAndCoinStores => "stamp_and_coin_stores", + StationaryOfficeSuppliesPrintingAndWritingPaper => { + "stationary_office_supplies_printing_and_writing_paper" + } + StationeryStoresOfficeAndSchoolSupplyStores => { + "stationery_stores_office_and_school_supply_stores" + } + SwimmingPoolsSales => "swimming_pools_sales", + TUiTravelGermany => "t_ui_travel_germany", + TailorsAlterations => "tailors_alterations", + TaxPaymentsGovernmentAgencies => "tax_payments_government_agencies", + TaxPreparationServices => "tax_preparation_services", + TaxicabsLimousines => "taxicabs_limousines", + TelecommunicationEquipmentAndTelephoneSales => { + "telecommunication_equipment_and_telephone_sales" + } + TelecommunicationServices => "telecommunication_services", + TelegraphServices => "telegraph_services", + TentAndAwningShops => "tent_and_awning_shops", + TestingLaboratories => "testing_laboratories", + TheatricalTicketAgencies => "theatrical_ticket_agencies", + Timeshares => "timeshares", + TireRetreadingAndRepair => "tire_retreading_and_repair", + TollsBridgeFees => "tolls_bridge_fees", + TouristAttractionsAndExhibits => "tourist_attractions_and_exhibits", + TowingServices => "towing_services", + TrailerParksCampgrounds => "trailer_parks_campgrounds", + TransportationServices => "transportation_services", + TravelAgenciesTourOperators => "travel_agencies_tour_operators", + TruckStopIteration => "truck_stop_iteration", + TruckUtilityTrailerRentals => "truck_utility_trailer_rentals", + TypesettingPlateMakingAndRelatedServices => { + "typesetting_plate_making_and_related_services" + } + TypewriterStores => "typewriter_stores", + USFederalGovernmentAgenciesOrDepartments => { + "u_s_federal_government_agencies_or_departments" + } + UniformsCommercialClothing => "uniforms_commercial_clothing", + UsedMerchandiseAndSecondhandStores => "used_merchandise_and_secondhand_stores", + Utilities => "utilities", + VarietyStores => "variety_stores", + VeterinaryServices => "veterinary_services", + VideoAmusementGameSupplies => "video_amusement_game_supplies", + VideoGameArcades => "video_game_arcades", + VideoTapeRentalStores => "video_tape_rental_stores", + VocationalTradeSchools => "vocational_trade_schools", + WatchJewelryRepair => "watch_jewelry_repair", + WeldingRepair => "welding_repair", + WholesaleClubs => "wholesale_clubs", + WigAndToupeeStores => "wig_and_toupee_stores", + WiresMoneyOrders => "wires_money_orders", + WomensAccessoryAndSpecialtyShops => "womens_accessory_and_specialty_shops", + WomensReadyToWearStores => "womens_ready_to_wear_stores", + WreckingAndSalvageYards => "wrecking_and_salvage_yards", + Unknown => "unknown", + } + } +} + +impl std::str::FromStr for CreateIssuingCardSpendingControlsSpendingLimitsCategories { + type Err = (); + fn from_str(s: &str) -> Result { + use CreateIssuingCardSpendingControlsSpendingLimitsCategories::*; + match s { + "ac_refrigeration_repair" => Ok(AcRefrigerationRepair), + "accounting_bookkeeping_services" => Ok(AccountingBookkeepingServices), + "advertising_services" => Ok(AdvertisingServices), + "agricultural_cooperative" => Ok(AgriculturalCooperative), + "airlines_air_carriers" => Ok(AirlinesAirCarriers), + "airports_flying_fields" => Ok(AirportsFlyingFields), + "ambulance_services" => Ok(AmbulanceServices), + "amusement_parks_carnivals" => Ok(AmusementParksCarnivals), + "antique_reproductions" => Ok(AntiqueReproductions), + "antique_shops" => Ok(AntiqueShops), + "aquariums" => Ok(Aquariums), + "architectural_surveying_services" => Ok(ArchitecturalSurveyingServices), + "art_dealers_and_galleries" => Ok(ArtDealersAndGalleries), + "artists_supply_and_craft_shops" => Ok(ArtistsSupplyAndCraftShops), + "auto_and_home_supply_stores" => Ok(AutoAndHomeSupplyStores), + "auto_body_repair_shops" => Ok(AutoBodyRepairShops), + "auto_paint_shops" => Ok(AutoPaintShops), + "auto_service_shops" => Ok(AutoServiceShops), + "automated_cash_disburse" => Ok(AutomatedCashDisburse), + "automated_fuel_dispensers" => Ok(AutomatedFuelDispensers), + "automobile_associations" => Ok(AutomobileAssociations), + "automotive_parts_and_accessories_stores" => Ok(AutomotivePartsAndAccessoriesStores), + "automotive_tire_stores" => Ok(AutomotiveTireStores), + "bail_and_bond_payments" => Ok(BailAndBondPayments), + "bakeries" => Ok(Bakeries), + "bands_orchestras" => Ok(BandsOrchestras), + "barber_and_beauty_shops" => Ok(BarberAndBeautyShops), + "betting_casino_gambling" => Ok(BettingCasinoGambling), + "bicycle_shops" => Ok(BicycleShops), + "billiard_pool_establishments" => Ok(BilliardPoolEstablishments), + "boat_dealers" => Ok(BoatDealers), + "boat_rentals_and_leases" => Ok(BoatRentalsAndLeases), + "book_stores" => Ok(BookStores), + "books_periodicals_and_newspapers" => Ok(BooksPeriodicalsAndNewspapers), + "bowling_alleys" => Ok(BowlingAlleys), + "bus_lines" => Ok(BusLines), + "business_secretarial_schools" => Ok(BusinessSecretarialSchools), + "buying_shopping_services" => Ok(BuyingShoppingServices), + "cable_satellite_and_other_pay_television_and_radio" => { + Ok(CableSatelliteAndOtherPayTelevisionAndRadio) + } + "camera_and_photographic_supply_stores" => Ok(CameraAndPhotographicSupplyStores), + "candy_nut_and_confectionery_stores" => Ok(CandyNutAndConfectioneryStores), + "car_and_truck_dealers_new_used" => Ok(CarAndTruckDealersNewUsed), + "car_and_truck_dealers_used_only" => Ok(CarAndTruckDealersUsedOnly), + "car_rental_agencies" => Ok(CarRentalAgencies), + "car_washes" => Ok(CarWashes), + "carpentry_services" => Ok(CarpentryServices), + "carpet_upholstery_cleaning" => Ok(CarpetUpholsteryCleaning), + "caterers" => Ok(Caterers), + "charitable_and_social_service_organizations_fundraising" => { + Ok(CharitableAndSocialServiceOrganizationsFundraising) + } + "chemicals_and_allied_products" => Ok(ChemicalsAndAlliedProducts), + "child_care_services" => Ok(ChildCareServices), + "childrens_and_infants_wear_stores" => Ok(ChildrensAndInfantsWearStores), + "chiropodists_podiatrists" => Ok(ChiropodistsPodiatrists), + "chiropractors" => Ok(Chiropractors), + "cigar_stores_and_stands" => Ok(CigarStoresAndStands), + "civic_social_fraternal_associations" => Ok(CivicSocialFraternalAssociations), + "cleaning_and_maintenance" => Ok(CleaningAndMaintenance), + "clothing_rental" => Ok(ClothingRental), + "colleges_universities" => Ok(CollegesUniversities), + "commercial_equipment" => Ok(CommercialEquipment), + "commercial_footwear" => Ok(CommercialFootwear), + "commercial_photography_art_and_graphics" => Ok(CommercialPhotographyArtAndGraphics), + "commuter_transport_and_ferries" => Ok(CommuterTransportAndFerries), + "computer_network_services" => Ok(ComputerNetworkServices), + "computer_programming" => Ok(ComputerProgramming), + "computer_repair" => Ok(ComputerRepair), + "computer_software_stores" => Ok(ComputerSoftwareStores), + "computers_peripherals_and_software" => Ok(ComputersPeripheralsAndSoftware), + "concrete_work_services" => Ok(ConcreteWorkServices), + "construction_materials" => Ok(ConstructionMaterials), + "consulting_public_relations" => Ok(ConsultingPublicRelations), + "correspondence_schools" => Ok(CorrespondenceSchools), + "cosmetic_stores" => Ok(CosmeticStores), + "counseling_services" => Ok(CounselingServices), + "country_clubs" => Ok(CountryClubs), + "courier_services" => Ok(CourierServices), + "court_costs" => Ok(CourtCosts), + "credit_reporting_agencies" => Ok(CreditReportingAgencies), + "cruise_lines" => Ok(CruiseLines), + "dairy_products_stores" => Ok(DairyProductsStores), + "dance_hall_studios_schools" => Ok(DanceHallStudiosSchools), + "dating_escort_services" => Ok(DatingEscortServices), + "dentists_orthodontists" => Ok(DentistsOrthodontists), + "department_stores" => Ok(DepartmentStores), + "detective_agencies" => Ok(DetectiveAgencies), + "digital_goods_applications" => Ok(DigitalGoodsApplications), + "digital_goods_games" => Ok(DigitalGoodsGames), + "digital_goods_large_volume" => Ok(DigitalGoodsLargeVolume), + "digital_goods_media" => Ok(DigitalGoodsMedia), + "direct_marketing_catalog_merchant" => Ok(DirectMarketingCatalogMerchant), + "direct_marketing_combination_catalog_and_retail_merchant" => { + Ok(DirectMarketingCombinationCatalogAndRetailMerchant) + } + "direct_marketing_inbound_telemarketing" => Ok(DirectMarketingInboundTelemarketing), + "direct_marketing_insurance_services" => Ok(DirectMarketingInsuranceServices), + "direct_marketing_other" => Ok(DirectMarketingOther), + "direct_marketing_outbound_telemarketing" => Ok(DirectMarketingOutboundTelemarketing), + "direct_marketing_subscription" => Ok(DirectMarketingSubscription), + "direct_marketing_travel" => Ok(DirectMarketingTravel), + "discount_stores" => Ok(DiscountStores), + "doctors" => Ok(Doctors), + "door_to_door_sales" => Ok(DoorToDoorSales), + "drapery_window_covering_and_upholstery_stores" => { + Ok(DraperyWindowCoveringAndUpholsteryStores) + } + "drinking_places" => Ok(DrinkingPlaces), + "drug_stores_and_pharmacies" => Ok(DrugStoresAndPharmacies), + "drugs_drug_proprietaries_and_druggist_sundries" => { + Ok(DrugsDrugProprietariesAndDruggistSundries) + } + "dry_cleaners" => Ok(DryCleaners), + "durable_goods" => Ok(DurableGoods), + "duty_free_stores" => Ok(DutyFreeStores), + "eating_places_restaurants" => Ok(EatingPlacesRestaurants), + "educational_services" => Ok(EducationalServices), + "electric_razor_stores" => Ok(ElectricRazorStores), + "electric_vehicle_charging" => Ok(ElectricVehicleCharging), + "electrical_parts_and_equipment" => Ok(ElectricalPartsAndEquipment), + "electrical_services" => Ok(ElectricalServices), + "electronics_repair_shops" => Ok(ElectronicsRepairShops), + "electronics_stores" => Ok(ElectronicsStores), + "elementary_secondary_schools" => Ok(ElementarySecondarySchools), + "emergency_services_gcas_visa_use_only" => Ok(EmergencyServicesGcasVisaUseOnly), + "employment_temp_agencies" => Ok(EmploymentTempAgencies), + "equipment_rental" => Ok(EquipmentRental), + "exterminating_services" => Ok(ExterminatingServices), + "family_clothing_stores" => Ok(FamilyClothingStores), + "fast_food_restaurants" => Ok(FastFoodRestaurants), + "financial_institutions" => Ok(FinancialInstitutions), + "fines_government_administrative_entities" => Ok(FinesGovernmentAdministrativeEntities), + "fireplace_fireplace_screens_and_accessories_stores" => { + Ok(FireplaceFireplaceScreensAndAccessoriesStores) + } + "floor_covering_stores" => Ok(FloorCoveringStores), + "florists" => Ok(Florists), + "florists_supplies_nursery_stock_and_flowers" => { + Ok(FloristsSuppliesNurseryStockAndFlowers) + } + "freezer_and_locker_meat_provisioners" => Ok(FreezerAndLockerMeatProvisioners), + "fuel_dealers_non_automotive" => Ok(FuelDealersNonAutomotive), + "funeral_services_crematories" => Ok(FuneralServicesCrematories), + "furniture_home_furnishings_and_equipment_stores_except_appliances" => { + Ok(FurnitureHomeFurnishingsAndEquipmentStoresExceptAppliances) + } + "furniture_repair_refinishing" => Ok(FurnitureRepairRefinishing), + "furriers_and_fur_shops" => Ok(FurriersAndFurShops), + "general_services" => Ok(GeneralServices), + "gift_card_novelty_and_souvenir_shops" => Ok(GiftCardNoveltyAndSouvenirShops), + "glass_paint_and_wallpaper_stores" => Ok(GlassPaintAndWallpaperStores), + "glassware_crystal_stores" => Ok(GlasswareCrystalStores), + "golf_courses_public" => Ok(GolfCoursesPublic), + "government_licensed_horse_dog_racing_us_region_only" => { + Ok(GovernmentLicensedHorseDogRacingUsRegionOnly) + } + "government_licensed_online_casions_online_gambling_us_region_only" => { + Ok(GovernmentLicensedOnlineCasionsOnlineGamblingUsRegionOnly) + } + "government_owned_lotteries_non_us_region" => Ok(GovernmentOwnedLotteriesNonUsRegion), + "government_owned_lotteries_us_region_only" => Ok(GovernmentOwnedLotteriesUsRegionOnly), + "government_services" => Ok(GovernmentServices), + "grocery_stores_supermarkets" => Ok(GroceryStoresSupermarkets), + "hardware_equipment_and_supplies" => Ok(HardwareEquipmentAndSupplies), + "hardware_stores" => Ok(HardwareStores), + "health_and_beauty_spas" => Ok(HealthAndBeautySpas), + "hearing_aids_sales_and_supplies" => Ok(HearingAidsSalesAndSupplies), + "heating_plumbing_a_c" => Ok(HeatingPlumbingAC), + "hobby_toy_and_game_shops" => Ok(HobbyToyAndGameShops), + "home_supply_warehouse_stores" => Ok(HomeSupplyWarehouseStores), + "hospitals" => Ok(Hospitals), + "hotels_motels_and_resorts" => Ok(HotelsMotelsAndResorts), + "household_appliance_stores" => Ok(HouseholdApplianceStores), + "industrial_supplies" => Ok(IndustrialSupplies), + "information_retrieval_services" => Ok(InformationRetrievalServices), + "insurance_default" => Ok(InsuranceDefault), + "insurance_underwriting_premiums" => Ok(InsuranceUnderwritingPremiums), + "intra_company_purchases" => Ok(IntraCompanyPurchases), + "jewelry_stores_watches_clocks_and_silverware_stores" => { + Ok(JewelryStoresWatchesClocksAndSilverwareStores) + } + "landscaping_services" => Ok(LandscapingServices), + "laundries" => Ok(Laundries), + "laundry_cleaning_services" => Ok(LaundryCleaningServices), + "legal_services_attorneys" => Ok(LegalServicesAttorneys), + "luggage_and_leather_goods_stores" => Ok(LuggageAndLeatherGoodsStores), + "lumber_building_materials_stores" => Ok(LumberBuildingMaterialsStores), + "manual_cash_disburse" => Ok(ManualCashDisburse), + "marinas_service_and_supplies" => Ok(MarinasServiceAndSupplies), + "marketplaces" => Ok(Marketplaces), + "masonry_stonework_and_plaster" => Ok(MasonryStoneworkAndPlaster), + "massage_parlors" => Ok(MassageParlors), + "medical_and_dental_labs" => Ok(MedicalAndDentalLabs), + "medical_dental_ophthalmic_and_hospital_equipment_and_supplies" => { + Ok(MedicalDentalOphthalmicAndHospitalEquipmentAndSupplies) + } + "medical_services" => Ok(MedicalServices), + "membership_organizations" => Ok(MembershipOrganizations), + "mens_and_boys_clothing_and_accessories_stores" => { + Ok(MensAndBoysClothingAndAccessoriesStores) + } + "mens_womens_clothing_stores" => Ok(MensWomensClothingStores), + "metal_service_centers" => Ok(MetalServiceCenters), + "miscellaneous" => Ok(Miscellaneous), + "miscellaneous_apparel_and_accessory_shops" => { + Ok(MiscellaneousApparelAndAccessoryShops) + } + "miscellaneous_auto_dealers" => Ok(MiscellaneousAutoDealers), + "miscellaneous_business_services" => Ok(MiscellaneousBusinessServices), + "miscellaneous_food_stores" => Ok(MiscellaneousFoodStores), + "miscellaneous_general_merchandise" => Ok(MiscellaneousGeneralMerchandise), + "miscellaneous_general_services" => Ok(MiscellaneousGeneralServices), + "miscellaneous_home_furnishing_specialty_stores" => { + Ok(MiscellaneousHomeFurnishingSpecialtyStores) + } + "miscellaneous_publishing_and_printing" => Ok(MiscellaneousPublishingAndPrinting), + "miscellaneous_recreation_services" => Ok(MiscellaneousRecreationServices), + "miscellaneous_repair_shops" => Ok(MiscellaneousRepairShops), + "miscellaneous_specialty_retail" => Ok(MiscellaneousSpecialtyRetail), + "mobile_home_dealers" => Ok(MobileHomeDealers), + "motion_picture_theaters" => Ok(MotionPictureTheaters), + "motor_freight_carriers_and_trucking" => Ok(MotorFreightCarriersAndTrucking), + "motor_homes_dealers" => Ok(MotorHomesDealers), + "motor_vehicle_supplies_and_new_parts" => Ok(MotorVehicleSuppliesAndNewParts), + "motorcycle_shops_and_dealers" => Ok(MotorcycleShopsAndDealers), + "motorcycle_shops_dealers" => Ok(MotorcycleShopsDealers), + "music_stores_musical_instruments_pianos_and_sheet_music" => { + Ok(MusicStoresMusicalInstrumentsPianosAndSheetMusic) + } + "news_dealers_and_newsstands" => Ok(NewsDealersAndNewsstands), + "non_fi_money_orders" => Ok(NonFiMoneyOrders), + "non_fi_stored_value_card_purchase_load" => Ok(NonFiStoredValueCardPurchaseLoad), + "nondurable_goods" => Ok(NondurableGoods), + "nurseries_lawn_and_garden_supply_stores" => Ok(NurseriesLawnAndGardenSupplyStores), + "nursing_personal_care" => Ok(NursingPersonalCare), + "office_and_commercial_furniture" => Ok(OfficeAndCommercialFurniture), + "opticians_eyeglasses" => Ok(OpticiansEyeglasses), + "optometrists_ophthalmologist" => Ok(OptometristsOphthalmologist), + "orthopedic_goods_prosthetic_devices" => Ok(OrthopedicGoodsProstheticDevices), + "osteopaths" => Ok(Osteopaths), + "package_stores_beer_wine_and_liquor" => Ok(PackageStoresBeerWineAndLiquor), + "paints_varnishes_and_supplies" => Ok(PaintsVarnishesAndSupplies), + "parking_lots_garages" => Ok(ParkingLotsGarages), + "passenger_railways" => Ok(PassengerRailways), + "pawn_shops" => Ok(PawnShops), + "pet_shops_pet_food_and_supplies" => Ok(PetShopsPetFoodAndSupplies), + "petroleum_and_petroleum_products" => Ok(PetroleumAndPetroleumProducts), + "photo_developing" => Ok(PhotoDeveloping), + "photographic_photocopy_microfilm_equipment_and_supplies" => { + Ok(PhotographicPhotocopyMicrofilmEquipmentAndSupplies) + } + "photographic_studios" => Ok(PhotographicStudios), + "picture_video_production" => Ok(PictureVideoProduction), + "piece_goods_notions_and_other_dry_goods" => Ok(PieceGoodsNotionsAndOtherDryGoods), + "plumbing_heating_equipment_and_supplies" => Ok(PlumbingHeatingEquipmentAndSupplies), + "political_organizations" => Ok(PoliticalOrganizations), + "postal_services_government_only" => Ok(PostalServicesGovernmentOnly), + "precious_stones_and_metals_watches_and_jewelry" => { + Ok(PreciousStonesAndMetalsWatchesAndJewelry) + } + "professional_services" => Ok(ProfessionalServices), + "public_warehousing_and_storage" => Ok(PublicWarehousingAndStorage), + "quick_copy_repro_and_blueprint" => Ok(QuickCopyReproAndBlueprint), + "railroads" => Ok(Railroads), + "real_estate_agents_and_managers_rentals" => Ok(RealEstateAgentsAndManagersRentals), + "record_stores" => Ok(RecordStores), + "recreational_vehicle_rentals" => Ok(RecreationalVehicleRentals), + "religious_goods_stores" => Ok(ReligiousGoodsStores), + "religious_organizations" => Ok(ReligiousOrganizations), + "roofing_siding_sheet_metal" => Ok(RoofingSidingSheetMetal), + "secretarial_support_services" => Ok(SecretarialSupportServices), + "security_brokers_dealers" => Ok(SecurityBrokersDealers), + "service_stations" => Ok(ServiceStations), + "sewing_needlework_fabric_and_piece_goods_stores" => { + Ok(SewingNeedleworkFabricAndPieceGoodsStores) + } + "shoe_repair_hat_cleaning" => Ok(ShoeRepairHatCleaning), + "shoe_stores" => Ok(ShoeStores), + "small_appliance_repair" => Ok(SmallApplianceRepair), + "snowmobile_dealers" => Ok(SnowmobileDealers), + "special_trade_services" => Ok(SpecialTradeServices), + "specialty_cleaning" => Ok(SpecialtyCleaning), + "sporting_goods_stores" => Ok(SportingGoodsStores), + "sporting_recreation_camps" => Ok(SportingRecreationCamps), + "sports_and_riding_apparel_stores" => Ok(SportsAndRidingApparelStores), + "sports_clubs_fields" => Ok(SportsClubsFields), + "stamp_and_coin_stores" => Ok(StampAndCoinStores), + "stationary_office_supplies_printing_and_writing_paper" => { + Ok(StationaryOfficeSuppliesPrintingAndWritingPaper) + } + "stationery_stores_office_and_school_supply_stores" => { + Ok(StationeryStoresOfficeAndSchoolSupplyStores) + } + "swimming_pools_sales" => Ok(SwimmingPoolsSales), + "t_ui_travel_germany" => Ok(TUiTravelGermany), + "tailors_alterations" => Ok(TailorsAlterations), + "tax_payments_government_agencies" => Ok(TaxPaymentsGovernmentAgencies), + "tax_preparation_services" => Ok(TaxPreparationServices), + "taxicabs_limousines" => Ok(TaxicabsLimousines), + "telecommunication_equipment_and_telephone_sales" => { + Ok(TelecommunicationEquipmentAndTelephoneSales) + } + "telecommunication_services" => Ok(TelecommunicationServices), + "telegraph_services" => Ok(TelegraphServices), + "tent_and_awning_shops" => Ok(TentAndAwningShops), + "testing_laboratories" => Ok(TestingLaboratories), + "theatrical_ticket_agencies" => Ok(TheatricalTicketAgencies), + "timeshares" => Ok(Timeshares), + "tire_retreading_and_repair" => Ok(TireRetreadingAndRepair), + "tolls_bridge_fees" => Ok(TollsBridgeFees), + "tourist_attractions_and_exhibits" => Ok(TouristAttractionsAndExhibits), + "towing_services" => Ok(TowingServices), + "trailer_parks_campgrounds" => Ok(TrailerParksCampgrounds), + "transportation_services" => Ok(TransportationServices), + "travel_agencies_tour_operators" => Ok(TravelAgenciesTourOperators), + "truck_stop_iteration" => Ok(TruckStopIteration), + "truck_utility_trailer_rentals" => Ok(TruckUtilityTrailerRentals), + "typesetting_plate_making_and_related_services" => { + Ok(TypesettingPlateMakingAndRelatedServices) + } + "typewriter_stores" => Ok(TypewriterStores), + "u_s_federal_government_agencies_or_departments" => { + Ok(USFederalGovernmentAgenciesOrDepartments) + } + "uniforms_commercial_clothing" => Ok(UniformsCommercialClothing), + "used_merchandise_and_secondhand_stores" => Ok(UsedMerchandiseAndSecondhandStores), + "utilities" => Ok(Utilities), + "variety_stores" => Ok(VarietyStores), + "veterinary_services" => Ok(VeterinaryServices), + "video_amusement_game_supplies" => Ok(VideoAmusementGameSupplies), + "video_game_arcades" => Ok(VideoGameArcades), + "video_tape_rental_stores" => Ok(VideoTapeRentalStores), + "vocational_trade_schools" => Ok(VocationalTradeSchools), + "watch_jewelry_repair" => Ok(WatchJewelryRepair), + "welding_repair" => Ok(WeldingRepair), + "wholesale_clubs" => Ok(WholesaleClubs), + "wig_and_toupee_stores" => Ok(WigAndToupeeStores), + "wires_money_orders" => Ok(WiresMoneyOrders), + "womens_accessory_and_specialty_shops" => Ok(WomensAccessoryAndSpecialtyShops), + "womens_ready_to_wear_stores" => Ok(WomensReadyToWearStores), + "wrecking_and_salvage_yards" => Ok(WreckingAndSalvageYards), + _ => Err(()), + } + } +} +impl std::fmt::Display for CreateIssuingCardSpendingControlsSpendingLimitsCategories { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreateIssuingCardSpendingControlsSpendingLimitsCategories { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreateIssuingCardSpendingControlsSpendingLimitsCategories { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Interval (or event) to which the amount applies. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreateIssuingCardSpendingControlsSpendingLimitsInterval { + AllTime, + Daily, + Monthly, + PerAuthorization, + Weekly, + Yearly, +} +impl CreateIssuingCardSpendingControlsSpendingLimitsInterval { + pub fn as_str(self) -> &'static str { + use CreateIssuingCardSpendingControlsSpendingLimitsInterval::*; + match self { + AllTime => "all_time", + Daily => "daily", + Monthly => "monthly", + PerAuthorization => "per_authorization", + Weekly => "weekly", + Yearly => "yearly", + } + } +} + +impl std::str::FromStr for CreateIssuingCardSpendingControlsSpendingLimitsInterval { + type Err = (); + fn from_str(s: &str) -> Result { + use CreateIssuingCardSpendingControlsSpendingLimitsInterval::*; + match s { + "all_time" => Ok(AllTime), + "daily" => Ok(Daily), + "monthly" => Ok(Monthly), + "per_authorization" => Ok(PerAuthorization), + "weekly" => Ok(Weekly), + "yearly" => Ok(Yearly), + _ => Err(()), + } + } +} +impl std::fmt::Display for CreateIssuingCardSpendingControlsSpendingLimitsInterval { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreateIssuingCardSpendingControlsSpendingLimitsInterval { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreateIssuingCardSpendingControlsSpendingLimitsInterval { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Whether authorizations can be approved on this card. +/// May be blocked from activating cards depending on past-due Cardholder requirements. +/// Defaults to `inactive`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreateIssuingCardStatus { + Active, + Inactive, +} +impl CreateIssuingCardStatus { + pub fn as_str(self) -> &'static str { + use CreateIssuingCardStatus::*; + match self { + Active => "active", + Inactive => "inactive", + } + } +} + +impl std::str::FromStr for CreateIssuingCardStatus { + type Err = (); + fn from_str(s: &str) -> Result { + use CreateIssuingCardStatus::*; + match s { + "active" => Ok(Active), + "inactive" => Ok(Inactive), + _ => Err(()), + } + } +} +impl std::fmt::Display for CreateIssuingCardStatus { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreateIssuingCardStatus { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreateIssuingCardStatus { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'a> CreateIssuingCard<'a> { + /// Creates an Issuing `Card` object. + pub fn send(&self, client: &stripe::Client) -> stripe::Response { + client.send_form("/issuing/cards", self, http_types::Method::Post) + } +} +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdateIssuingCard<'a> { + /// Reason why the `status` of this card is `canceled`. + #[serde(skip_serializing_if = "Option::is_none")] + pub cancellation_reason: Option, + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, + /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. + /// This can be useful for storing additional information about the object in a structured format. + /// Individual keys can be unset by posting an empty value to them. + /// All keys can be unset by posting an empty value to `metadata`. + #[serde(skip_serializing_if = "Option::is_none")] + pub metadata: Option<&'a std::collections::HashMap>, + /// The desired new PIN for this card. + #[serde(skip_serializing_if = "Option::is_none")] + pub pin: Option>, + /// Rules that control spending for this card. + /// Refer to our [documentation](https://stripe.com/docs/issuing/controls/spending-controls) for more details. + #[serde(skip_serializing_if = "Option::is_none")] + pub spending_controls: Option>, + /// Dictates whether authorizations can be approved on this card. + /// May be blocked from activating cards depending on past-due Cardholder requirements. + /// Defaults to `inactive`. + /// If this card is being canceled because it was lost or stolen, this information should be provided as `cancellation_reason`. + #[serde(skip_serializing_if = "Option::is_none")] + pub status: Option, +} +impl<'a> UpdateIssuingCard<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// Reason why the `status` of this card is `canceled`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum UpdateIssuingCardCancellationReason { + Lost, + Stolen, +} +impl UpdateIssuingCardCancellationReason { + pub fn as_str(self) -> &'static str { + use UpdateIssuingCardCancellationReason::*; + match self { + Lost => "lost", + Stolen => "stolen", + } + } +} + +impl std::str::FromStr for UpdateIssuingCardCancellationReason { + type Err = (); + fn from_str(s: &str) -> Result { + use UpdateIssuingCardCancellationReason::*; + match s { + "lost" => Ok(Lost), + "stolen" => Ok(Stolen), + _ => Err(()), + } + } +} +impl std::fmt::Display for UpdateIssuingCardCancellationReason { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for UpdateIssuingCardCancellationReason { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for UpdateIssuingCardCancellationReason { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Rules that control spending for this card. +/// Refer to our [documentation](https://stripe.com/docs/issuing/controls/spending-controls) for more details. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdateIssuingCardSpendingControls<'a> { + /// Array of strings containing [categories](https://stripe.com/docs/api#issuing_authorization_object-merchant_data-category) of authorizations to allow. + /// All other categories will be blocked. + /// Cannot be set with `blocked_categories`. + #[serde(skip_serializing_if = "Option::is_none")] + pub allowed_categories: Option<&'a [UpdateIssuingCardSpendingControlsAllowedCategories]>, + /// Array of strings containing [categories](https://stripe.com/docs/api#issuing_authorization_object-merchant_data-category) of authorizations to decline. + /// All other categories will be allowed. + /// Cannot be set with `allowed_categories`. + #[serde(skip_serializing_if = "Option::is_none")] + pub blocked_categories: Option<&'a [UpdateIssuingCardSpendingControlsBlockedCategories]>, + /// Limit spending with amount-based rules that apply across any cards this card replaced (i.e., its `replacement_for` card and _that_ card's `replacement_for` card, up the chain). + #[serde(skip_serializing_if = "Option::is_none")] + pub spending_limits: Option<&'a [UpdateIssuingCardSpendingControlsSpendingLimits<'a>]>, +} +impl<'a> UpdateIssuingCardSpendingControls<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// Array of strings containing [categories](https://stripe.com/docs/api#issuing_authorization_object-merchant_data-category) of authorizations to allow. +/// All other categories will be blocked. +/// Cannot be set with `blocked_categories`. +#[derive(Copy, Clone, Eq, PartialEq)] +#[non_exhaustive] +pub enum UpdateIssuingCardSpendingControlsAllowedCategories { + AcRefrigerationRepair, + AccountingBookkeepingServices, + AdvertisingServices, + AgriculturalCooperative, + AirlinesAirCarriers, + AirportsFlyingFields, + AmbulanceServices, + AmusementParksCarnivals, + AntiqueReproductions, + AntiqueShops, + Aquariums, + ArchitecturalSurveyingServices, + ArtDealersAndGalleries, + ArtistsSupplyAndCraftShops, + AutoAndHomeSupplyStores, + AutoBodyRepairShops, + AutoPaintShops, + AutoServiceShops, + AutomatedCashDisburse, + AutomatedFuelDispensers, + AutomobileAssociations, + AutomotivePartsAndAccessoriesStores, + AutomotiveTireStores, + BailAndBondPayments, + Bakeries, + BandsOrchestras, + BarberAndBeautyShops, + BettingCasinoGambling, + BicycleShops, + BilliardPoolEstablishments, + BoatDealers, + BoatRentalsAndLeases, + BookStores, + BooksPeriodicalsAndNewspapers, + BowlingAlleys, + BusLines, + BusinessSecretarialSchools, + BuyingShoppingServices, + CableSatelliteAndOtherPayTelevisionAndRadio, + CameraAndPhotographicSupplyStores, + CandyNutAndConfectioneryStores, + CarAndTruckDealersNewUsed, + CarAndTruckDealersUsedOnly, + CarRentalAgencies, + CarWashes, + CarpentryServices, + CarpetUpholsteryCleaning, + Caterers, + CharitableAndSocialServiceOrganizationsFundraising, + ChemicalsAndAlliedProducts, + ChildCareServices, + ChildrensAndInfantsWearStores, + ChiropodistsPodiatrists, + Chiropractors, + CigarStoresAndStands, + CivicSocialFraternalAssociations, + CleaningAndMaintenance, + ClothingRental, + CollegesUniversities, + CommercialEquipment, + CommercialFootwear, + CommercialPhotographyArtAndGraphics, + CommuterTransportAndFerries, + ComputerNetworkServices, + ComputerProgramming, + ComputerRepair, + ComputerSoftwareStores, + ComputersPeripheralsAndSoftware, + ConcreteWorkServices, + ConstructionMaterials, + ConsultingPublicRelations, + CorrespondenceSchools, + CosmeticStores, + CounselingServices, + CountryClubs, + CourierServices, + CourtCosts, + CreditReportingAgencies, + CruiseLines, + DairyProductsStores, + DanceHallStudiosSchools, + DatingEscortServices, + DentistsOrthodontists, + DepartmentStores, + DetectiveAgencies, + DigitalGoodsApplications, + DigitalGoodsGames, + DigitalGoodsLargeVolume, + DigitalGoodsMedia, + DirectMarketingCatalogMerchant, + DirectMarketingCombinationCatalogAndRetailMerchant, + DirectMarketingInboundTelemarketing, + DirectMarketingInsuranceServices, + DirectMarketingOther, + DirectMarketingOutboundTelemarketing, + DirectMarketingSubscription, + DirectMarketingTravel, + DiscountStores, + Doctors, + DoorToDoorSales, + DraperyWindowCoveringAndUpholsteryStores, + DrinkingPlaces, + DrugStoresAndPharmacies, + DrugsDrugProprietariesAndDruggistSundries, + DryCleaners, + DurableGoods, + DutyFreeStores, + EatingPlacesRestaurants, + EducationalServices, + ElectricRazorStores, + ElectricVehicleCharging, + ElectricalPartsAndEquipment, + ElectricalServices, + ElectronicsRepairShops, + ElectronicsStores, + ElementarySecondarySchools, + EmergencyServicesGcasVisaUseOnly, + EmploymentTempAgencies, + EquipmentRental, + ExterminatingServices, + FamilyClothingStores, + FastFoodRestaurants, + FinancialInstitutions, + FinesGovernmentAdministrativeEntities, + FireplaceFireplaceScreensAndAccessoriesStores, + FloorCoveringStores, + Florists, + FloristsSuppliesNurseryStockAndFlowers, + FreezerAndLockerMeatProvisioners, + FuelDealersNonAutomotive, + FuneralServicesCrematories, + FurnitureHomeFurnishingsAndEquipmentStoresExceptAppliances, + FurnitureRepairRefinishing, + FurriersAndFurShops, + GeneralServices, + GiftCardNoveltyAndSouvenirShops, + GlassPaintAndWallpaperStores, + GlasswareCrystalStores, + GolfCoursesPublic, + GovernmentLicensedHorseDogRacingUsRegionOnly, + GovernmentLicensedOnlineCasionsOnlineGamblingUsRegionOnly, + GovernmentOwnedLotteriesNonUsRegion, + GovernmentOwnedLotteriesUsRegionOnly, + GovernmentServices, + GroceryStoresSupermarkets, + HardwareEquipmentAndSupplies, + HardwareStores, + HealthAndBeautySpas, + HearingAidsSalesAndSupplies, + HeatingPlumbingAC, + HobbyToyAndGameShops, + HomeSupplyWarehouseStores, + Hospitals, + HotelsMotelsAndResorts, + HouseholdApplianceStores, + IndustrialSupplies, + InformationRetrievalServices, + InsuranceDefault, + InsuranceUnderwritingPremiums, + IntraCompanyPurchases, + JewelryStoresWatchesClocksAndSilverwareStores, + LandscapingServices, + Laundries, + LaundryCleaningServices, + LegalServicesAttorneys, + LuggageAndLeatherGoodsStores, + LumberBuildingMaterialsStores, + ManualCashDisburse, + MarinasServiceAndSupplies, + Marketplaces, + MasonryStoneworkAndPlaster, + MassageParlors, + MedicalAndDentalLabs, + MedicalDentalOphthalmicAndHospitalEquipmentAndSupplies, + MedicalServices, + MembershipOrganizations, + MensAndBoysClothingAndAccessoriesStores, + MensWomensClothingStores, + MetalServiceCenters, + Miscellaneous, + MiscellaneousApparelAndAccessoryShops, + MiscellaneousAutoDealers, + MiscellaneousBusinessServices, + MiscellaneousFoodStores, + MiscellaneousGeneralMerchandise, + MiscellaneousGeneralServices, + MiscellaneousHomeFurnishingSpecialtyStores, + MiscellaneousPublishingAndPrinting, + MiscellaneousRecreationServices, + MiscellaneousRepairShops, + MiscellaneousSpecialtyRetail, + MobileHomeDealers, + MotionPictureTheaters, + MotorFreightCarriersAndTrucking, + MotorHomesDealers, + MotorVehicleSuppliesAndNewParts, + MotorcycleShopsAndDealers, + MotorcycleShopsDealers, + MusicStoresMusicalInstrumentsPianosAndSheetMusic, + NewsDealersAndNewsstands, + NonFiMoneyOrders, + NonFiStoredValueCardPurchaseLoad, + NondurableGoods, + NurseriesLawnAndGardenSupplyStores, + NursingPersonalCare, + OfficeAndCommercialFurniture, + OpticiansEyeglasses, + OptometristsOphthalmologist, + OrthopedicGoodsProstheticDevices, + Osteopaths, + PackageStoresBeerWineAndLiquor, + PaintsVarnishesAndSupplies, + ParkingLotsGarages, + PassengerRailways, + PawnShops, + PetShopsPetFoodAndSupplies, + PetroleumAndPetroleumProducts, + PhotoDeveloping, + PhotographicPhotocopyMicrofilmEquipmentAndSupplies, + PhotographicStudios, + PictureVideoProduction, + PieceGoodsNotionsAndOtherDryGoods, + PlumbingHeatingEquipmentAndSupplies, + PoliticalOrganizations, + PostalServicesGovernmentOnly, + PreciousStonesAndMetalsWatchesAndJewelry, + ProfessionalServices, + PublicWarehousingAndStorage, + QuickCopyReproAndBlueprint, + Railroads, + RealEstateAgentsAndManagersRentals, + RecordStores, + RecreationalVehicleRentals, + ReligiousGoodsStores, + ReligiousOrganizations, + RoofingSidingSheetMetal, + SecretarialSupportServices, + SecurityBrokersDealers, + ServiceStations, + SewingNeedleworkFabricAndPieceGoodsStores, + ShoeRepairHatCleaning, + ShoeStores, + SmallApplianceRepair, + SnowmobileDealers, + SpecialTradeServices, + SpecialtyCleaning, + SportingGoodsStores, + SportingRecreationCamps, + SportsAndRidingApparelStores, + SportsClubsFields, + StampAndCoinStores, + StationaryOfficeSuppliesPrintingAndWritingPaper, + StationeryStoresOfficeAndSchoolSupplyStores, + SwimmingPoolsSales, + TUiTravelGermany, + TailorsAlterations, + TaxPaymentsGovernmentAgencies, + TaxPreparationServices, + TaxicabsLimousines, + TelecommunicationEquipmentAndTelephoneSales, + TelecommunicationServices, + TelegraphServices, + TentAndAwningShops, + TestingLaboratories, + TheatricalTicketAgencies, + Timeshares, + TireRetreadingAndRepair, + TollsBridgeFees, + TouristAttractionsAndExhibits, + TowingServices, + TrailerParksCampgrounds, + TransportationServices, + TravelAgenciesTourOperators, + TruckStopIteration, + TruckUtilityTrailerRentals, + TypesettingPlateMakingAndRelatedServices, + TypewriterStores, + USFederalGovernmentAgenciesOrDepartments, + UniformsCommercialClothing, + UsedMerchandiseAndSecondhandStores, + Utilities, + VarietyStores, + VeterinaryServices, + VideoAmusementGameSupplies, + VideoGameArcades, + VideoTapeRentalStores, + VocationalTradeSchools, + WatchJewelryRepair, + WeldingRepair, + WholesaleClubs, + WigAndToupeeStores, + WiresMoneyOrders, + WomensAccessoryAndSpecialtyShops, + WomensReadyToWearStores, + WreckingAndSalvageYards, + /// An unrecognized value from Stripe. Should not be used as a request parameter. + Unknown, +} +impl UpdateIssuingCardSpendingControlsAllowedCategories { + pub fn as_str(self) -> &'static str { + use UpdateIssuingCardSpendingControlsAllowedCategories::*; + match self { + AcRefrigerationRepair => "ac_refrigeration_repair", + AccountingBookkeepingServices => "accounting_bookkeeping_services", + AdvertisingServices => "advertising_services", + AgriculturalCooperative => "agricultural_cooperative", + AirlinesAirCarriers => "airlines_air_carriers", + AirportsFlyingFields => "airports_flying_fields", + AmbulanceServices => "ambulance_services", + AmusementParksCarnivals => "amusement_parks_carnivals", + AntiqueReproductions => "antique_reproductions", + AntiqueShops => "antique_shops", + Aquariums => "aquariums", + ArchitecturalSurveyingServices => "architectural_surveying_services", + ArtDealersAndGalleries => "art_dealers_and_galleries", + ArtistsSupplyAndCraftShops => "artists_supply_and_craft_shops", + AutoAndHomeSupplyStores => "auto_and_home_supply_stores", + AutoBodyRepairShops => "auto_body_repair_shops", + AutoPaintShops => "auto_paint_shops", + AutoServiceShops => "auto_service_shops", + AutomatedCashDisburse => "automated_cash_disburse", + AutomatedFuelDispensers => "automated_fuel_dispensers", + AutomobileAssociations => "automobile_associations", + AutomotivePartsAndAccessoriesStores => "automotive_parts_and_accessories_stores", + AutomotiveTireStores => "automotive_tire_stores", + BailAndBondPayments => "bail_and_bond_payments", + Bakeries => "bakeries", + BandsOrchestras => "bands_orchestras", + BarberAndBeautyShops => "barber_and_beauty_shops", + BettingCasinoGambling => "betting_casino_gambling", + BicycleShops => "bicycle_shops", + BilliardPoolEstablishments => "billiard_pool_establishments", + BoatDealers => "boat_dealers", + BoatRentalsAndLeases => "boat_rentals_and_leases", + BookStores => "book_stores", + BooksPeriodicalsAndNewspapers => "books_periodicals_and_newspapers", + BowlingAlleys => "bowling_alleys", + BusLines => "bus_lines", + BusinessSecretarialSchools => "business_secretarial_schools", + BuyingShoppingServices => "buying_shopping_services", + CableSatelliteAndOtherPayTelevisionAndRadio => { + "cable_satellite_and_other_pay_television_and_radio" + } + CameraAndPhotographicSupplyStores => "camera_and_photographic_supply_stores", + CandyNutAndConfectioneryStores => "candy_nut_and_confectionery_stores", + CarAndTruckDealersNewUsed => "car_and_truck_dealers_new_used", + CarAndTruckDealersUsedOnly => "car_and_truck_dealers_used_only", + CarRentalAgencies => "car_rental_agencies", + CarWashes => "car_washes", + CarpentryServices => "carpentry_services", + CarpetUpholsteryCleaning => "carpet_upholstery_cleaning", + Caterers => "caterers", + CharitableAndSocialServiceOrganizationsFundraising => { + "charitable_and_social_service_organizations_fundraising" + } + ChemicalsAndAlliedProducts => "chemicals_and_allied_products", + ChildCareServices => "child_care_services", + ChildrensAndInfantsWearStores => "childrens_and_infants_wear_stores", + ChiropodistsPodiatrists => "chiropodists_podiatrists", + Chiropractors => "chiropractors", + CigarStoresAndStands => "cigar_stores_and_stands", + CivicSocialFraternalAssociations => "civic_social_fraternal_associations", + CleaningAndMaintenance => "cleaning_and_maintenance", + ClothingRental => "clothing_rental", + CollegesUniversities => "colleges_universities", + CommercialEquipment => "commercial_equipment", + CommercialFootwear => "commercial_footwear", + CommercialPhotographyArtAndGraphics => "commercial_photography_art_and_graphics", + CommuterTransportAndFerries => "commuter_transport_and_ferries", + ComputerNetworkServices => "computer_network_services", + ComputerProgramming => "computer_programming", + ComputerRepair => "computer_repair", + ComputerSoftwareStores => "computer_software_stores", + ComputersPeripheralsAndSoftware => "computers_peripherals_and_software", + ConcreteWorkServices => "concrete_work_services", + ConstructionMaterials => "construction_materials", + ConsultingPublicRelations => "consulting_public_relations", + CorrespondenceSchools => "correspondence_schools", + CosmeticStores => "cosmetic_stores", + CounselingServices => "counseling_services", + CountryClubs => "country_clubs", + CourierServices => "courier_services", + CourtCosts => "court_costs", + CreditReportingAgencies => "credit_reporting_agencies", + CruiseLines => "cruise_lines", + DairyProductsStores => "dairy_products_stores", + DanceHallStudiosSchools => "dance_hall_studios_schools", + DatingEscortServices => "dating_escort_services", + DentistsOrthodontists => "dentists_orthodontists", + DepartmentStores => "department_stores", + DetectiveAgencies => "detective_agencies", + DigitalGoodsApplications => "digital_goods_applications", + DigitalGoodsGames => "digital_goods_games", + DigitalGoodsLargeVolume => "digital_goods_large_volume", + DigitalGoodsMedia => "digital_goods_media", + DirectMarketingCatalogMerchant => "direct_marketing_catalog_merchant", + DirectMarketingCombinationCatalogAndRetailMerchant => { + "direct_marketing_combination_catalog_and_retail_merchant" + } + DirectMarketingInboundTelemarketing => "direct_marketing_inbound_telemarketing", + DirectMarketingInsuranceServices => "direct_marketing_insurance_services", + DirectMarketingOther => "direct_marketing_other", + DirectMarketingOutboundTelemarketing => "direct_marketing_outbound_telemarketing", + DirectMarketingSubscription => "direct_marketing_subscription", + DirectMarketingTravel => "direct_marketing_travel", + DiscountStores => "discount_stores", + Doctors => "doctors", + DoorToDoorSales => "door_to_door_sales", + DraperyWindowCoveringAndUpholsteryStores => { + "drapery_window_covering_and_upholstery_stores" + } + DrinkingPlaces => "drinking_places", + DrugStoresAndPharmacies => "drug_stores_and_pharmacies", + DrugsDrugProprietariesAndDruggistSundries => { + "drugs_drug_proprietaries_and_druggist_sundries" + } + DryCleaners => "dry_cleaners", + DurableGoods => "durable_goods", + DutyFreeStores => "duty_free_stores", + EatingPlacesRestaurants => "eating_places_restaurants", + EducationalServices => "educational_services", + ElectricRazorStores => "electric_razor_stores", + ElectricVehicleCharging => "electric_vehicle_charging", + ElectricalPartsAndEquipment => "electrical_parts_and_equipment", + ElectricalServices => "electrical_services", + ElectronicsRepairShops => "electronics_repair_shops", + ElectronicsStores => "electronics_stores", + ElementarySecondarySchools => "elementary_secondary_schools", + EmergencyServicesGcasVisaUseOnly => "emergency_services_gcas_visa_use_only", + EmploymentTempAgencies => "employment_temp_agencies", + EquipmentRental => "equipment_rental", + ExterminatingServices => "exterminating_services", + FamilyClothingStores => "family_clothing_stores", + FastFoodRestaurants => "fast_food_restaurants", + FinancialInstitutions => "financial_institutions", + FinesGovernmentAdministrativeEntities => "fines_government_administrative_entities", + FireplaceFireplaceScreensAndAccessoriesStores => { + "fireplace_fireplace_screens_and_accessories_stores" + } + FloorCoveringStores => "floor_covering_stores", + Florists => "florists", + FloristsSuppliesNurseryStockAndFlowers => "florists_supplies_nursery_stock_and_flowers", + FreezerAndLockerMeatProvisioners => "freezer_and_locker_meat_provisioners", + FuelDealersNonAutomotive => "fuel_dealers_non_automotive", + FuneralServicesCrematories => "funeral_services_crematories", + FurnitureHomeFurnishingsAndEquipmentStoresExceptAppliances => { + "furniture_home_furnishings_and_equipment_stores_except_appliances" + } + FurnitureRepairRefinishing => "furniture_repair_refinishing", + FurriersAndFurShops => "furriers_and_fur_shops", + GeneralServices => "general_services", + GiftCardNoveltyAndSouvenirShops => "gift_card_novelty_and_souvenir_shops", + GlassPaintAndWallpaperStores => "glass_paint_and_wallpaper_stores", + GlasswareCrystalStores => "glassware_crystal_stores", + GolfCoursesPublic => "golf_courses_public", + GovernmentLicensedHorseDogRacingUsRegionOnly => { + "government_licensed_horse_dog_racing_us_region_only" + } + GovernmentLicensedOnlineCasionsOnlineGamblingUsRegionOnly => { + "government_licensed_online_casions_online_gambling_us_region_only" + } + GovernmentOwnedLotteriesNonUsRegion => "government_owned_lotteries_non_us_region", + GovernmentOwnedLotteriesUsRegionOnly => "government_owned_lotteries_us_region_only", + GovernmentServices => "government_services", + GroceryStoresSupermarkets => "grocery_stores_supermarkets", + HardwareEquipmentAndSupplies => "hardware_equipment_and_supplies", + HardwareStores => "hardware_stores", + HealthAndBeautySpas => "health_and_beauty_spas", + HearingAidsSalesAndSupplies => "hearing_aids_sales_and_supplies", + HeatingPlumbingAC => "heating_plumbing_a_c", + HobbyToyAndGameShops => "hobby_toy_and_game_shops", + HomeSupplyWarehouseStores => "home_supply_warehouse_stores", + Hospitals => "hospitals", + HotelsMotelsAndResorts => "hotels_motels_and_resorts", + HouseholdApplianceStores => "household_appliance_stores", + IndustrialSupplies => "industrial_supplies", + InformationRetrievalServices => "information_retrieval_services", + InsuranceDefault => "insurance_default", + InsuranceUnderwritingPremiums => "insurance_underwriting_premiums", + IntraCompanyPurchases => "intra_company_purchases", + JewelryStoresWatchesClocksAndSilverwareStores => { + "jewelry_stores_watches_clocks_and_silverware_stores" + } + LandscapingServices => "landscaping_services", + Laundries => "laundries", + LaundryCleaningServices => "laundry_cleaning_services", + LegalServicesAttorneys => "legal_services_attorneys", + LuggageAndLeatherGoodsStores => "luggage_and_leather_goods_stores", + LumberBuildingMaterialsStores => "lumber_building_materials_stores", + ManualCashDisburse => "manual_cash_disburse", + MarinasServiceAndSupplies => "marinas_service_and_supplies", + Marketplaces => "marketplaces", + MasonryStoneworkAndPlaster => "masonry_stonework_and_plaster", + MassageParlors => "massage_parlors", + MedicalAndDentalLabs => "medical_and_dental_labs", + MedicalDentalOphthalmicAndHospitalEquipmentAndSupplies => { + "medical_dental_ophthalmic_and_hospital_equipment_and_supplies" + } + MedicalServices => "medical_services", + MembershipOrganizations => "membership_organizations", + MensAndBoysClothingAndAccessoriesStores => { + "mens_and_boys_clothing_and_accessories_stores" + } + MensWomensClothingStores => "mens_womens_clothing_stores", + MetalServiceCenters => "metal_service_centers", + Miscellaneous => "miscellaneous", + MiscellaneousApparelAndAccessoryShops => "miscellaneous_apparel_and_accessory_shops", + MiscellaneousAutoDealers => "miscellaneous_auto_dealers", + MiscellaneousBusinessServices => "miscellaneous_business_services", + MiscellaneousFoodStores => "miscellaneous_food_stores", + MiscellaneousGeneralMerchandise => "miscellaneous_general_merchandise", + MiscellaneousGeneralServices => "miscellaneous_general_services", + MiscellaneousHomeFurnishingSpecialtyStores => { + "miscellaneous_home_furnishing_specialty_stores" + } + MiscellaneousPublishingAndPrinting => "miscellaneous_publishing_and_printing", + MiscellaneousRecreationServices => "miscellaneous_recreation_services", + MiscellaneousRepairShops => "miscellaneous_repair_shops", + MiscellaneousSpecialtyRetail => "miscellaneous_specialty_retail", + MobileHomeDealers => "mobile_home_dealers", + MotionPictureTheaters => "motion_picture_theaters", + MotorFreightCarriersAndTrucking => "motor_freight_carriers_and_trucking", + MotorHomesDealers => "motor_homes_dealers", + MotorVehicleSuppliesAndNewParts => "motor_vehicle_supplies_and_new_parts", + MotorcycleShopsAndDealers => "motorcycle_shops_and_dealers", + MotorcycleShopsDealers => "motorcycle_shops_dealers", + MusicStoresMusicalInstrumentsPianosAndSheetMusic => { + "music_stores_musical_instruments_pianos_and_sheet_music" + } + NewsDealersAndNewsstands => "news_dealers_and_newsstands", + NonFiMoneyOrders => "non_fi_money_orders", + NonFiStoredValueCardPurchaseLoad => "non_fi_stored_value_card_purchase_load", + NondurableGoods => "nondurable_goods", + NurseriesLawnAndGardenSupplyStores => "nurseries_lawn_and_garden_supply_stores", + NursingPersonalCare => "nursing_personal_care", + OfficeAndCommercialFurniture => "office_and_commercial_furniture", + OpticiansEyeglasses => "opticians_eyeglasses", + OptometristsOphthalmologist => "optometrists_ophthalmologist", + OrthopedicGoodsProstheticDevices => "orthopedic_goods_prosthetic_devices", + Osteopaths => "osteopaths", + PackageStoresBeerWineAndLiquor => "package_stores_beer_wine_and_liquor", + PaintsVarnishesAndSupplies => "paints_varnishes_and_supplies", + ParkingLotsGarages => "parking_lots_garages", + PassengerRailways => "passenger_railways", + PawnShops => "pawn_shops", + PetShopsPetFoodAndSupplies => "pet_shops_pet_food_and_supplies", + PetroleumAndPetroleumProducts => "petroleum_and_petroleum_products", + PhotoDeveloping => "photo_developing", + PhotographicPhotocopyMicrofilmEquipmentAndSupplies => { + "photographic_photocopy_microfilm_equipment_and_supplies" + } + PhotographicStudios => "photographic_studios", + PictureVideoProduction => "picture_video_production", + PieceGoodsNotionsAndOtherDryGoods => "piece_goods_notions_and_other_dry_goods", + PlumbingHeatingEquipmentAndSupplies => "plumbing_heating_equipment_and_supplies", + PoliticalOrganizations => "political_organizations", + PostalServicesGovernmentOnly => "postal_services_government_only", + PreciousStonesAndMetalsWatchesAndJewelry => { + "precious_stones_and_metals_watches_and_jewelry" + } + ProfessionalServices => "professional_services", + PublicWarehousingAndStorage => "public_warehousing_and_storage", + QuickCopyReproAndBlueprint => "quick_copy_repro_and_blueprint", + Railroads => "railroads", + RealEstateAgentsAndManagersRentals => "real_estate_agents_and_managers_rentals", + RecordStores => "record_stores", + RecreationalVehicleRentals => "recreational_vehicle_rentals", + ReligiousGoodsStores => "religious_goods_stores", + ReligiousOrganizations => "religious_organizations", + RoofingSidingSheetMetal => "roofing_siding_sheet_metal", + SecretarialSupportServices => "secretarial_support_services", + SecurityBrokersDealers => "security_brokers_dealers", + ServiceStations => "service_stations", + SewingNeedleworkFabricAndPieceGoodsStores => { + "sewing_needlework_fabric_and_piece_goods_stores" + } + ShoeRepairHatCleaning => "shoe_repair_hat_cleaning", + ShoeStores => "shoe_stores", + SmallApplianceRepair => "small_appliance_repair", + SnowmobileDealers => "snowmobile_dealers", + SpecialTradeServices => "special_trade_services", + SpecialtyCleaning => "specialty_cleaning", + SportingGoodsStores => "sporting_goods_stores", + SportingRecreationCamps => "sporting_recreation_camps", + SportsAndRidingApparelStores => "sports_and_riding_apparel_stores", + SportsClubsFields => "sports_clubs_fields", + StampAndCoinStores => "stamp_and_coin_stores", + StationaryOfficeSuppliesPrintingAndWritingPaper => { + "stationary_office_supplies_printing_and_writing_paper" + } + StationeryStoresOfficeAndSchoolSupplyStores => { + "stationery_stores_office_and_school_supply_stores" + } + SwimmingPoolsSales => "swimming_pools_sales", + TUiTravelGermany => "t_ui_travel_germany", + TailorsAlterations => "tailors_alterations", + TaxPaymentsGovernmentAgencies => "tax_payments_government_agencies", + TaxPreparationServices => "tax_preparation_services", + TaxicabsLimousines => "taxicabs_limousines", + TelecommunicationEquipmentAndTelephoneSales => { + "telecommunication_equipment_and_telephone_sales" + } + TelecommunicationServices => "telecommunication_services", + TelegraphServices => "telegraph_services", + TentAndAwningShops => "tent_and_awning_shops", + TestingLaboratories => "testing_laboratories", + TheatricalTicketAgencies => "theatrical_ticket_agencies", + Timeshares => "timeshares", + TireRetreadingAndRepair => "tire_retreading_and_repair", + TollsBridgeFees => "tolls_bridge_fees", + TouristAttractionsAndExhibits => "tourist_attractions_and_exhibits", + TowingServices => "towing_services", + TrailerParksCampgrounds => "trailer_parks_campgrounds", + TransportationServices => "transportation_services", + TravelAgenciesTourOperators => "travel_agencies_tour_operators", + TruckStopIteration => "truck_stop_iteration", + TruckUtilityTrailerRentals => "truck_utility_trailer_rentals", + TypesettingPlateMakingAndRelatedServices => { + "typesetting_plate_making_and_related_services" + } + TypewriterStores => "typewriter_stores", + USFederalGovernmentAgenciesOrDepartments => { + "u_s_federal_government_agencies_or_departments" + } + UniformsCommercialClothing => "uniforms_commercial_clothing", + UsedMerchandiseAndSecondhandStores => "used_merchandise_and_secondhand_stores", + Utilities => "utilities", + VarietyStores => "variety_stores", + VeterinaryServices => "veterinary_services", + VideoAmusementGameSupplies => "video_amusement_game_supplies", + VideoGameArcades => "video_game_arcades", + VideoTapeRentalStores => "video_tape_rental_stores", + VocationalTradeSchools => "vocational_trade_schools", + WatchJewelryRepair => "watch_jewelry_repair", + WeldingRepair => "welding_repair", + WholesaleClubs => "wholesale_clubs", + WigAndToupeeStores => "wig_and_toupee_stores", + WiresMoneyOrders => "wires_money_orders", + WomensAccessoryAndSpecialtyShops => "womens_accessory_and_specialty_shops", + WomensReadyToWearStores => "womens_ready_to_wear_stores", + WreckingAndSalvageYards => "wrecking_and_salvage_yards", + Unknown => "unknown", + } + } +} + +impl std::str::FromStr for UpdateIssuingCardSpendingControlsAllowedCategories { + type Err = (); + fn from_str(s: &str) -> Result { + use UpdateIssuingCardSpendingControlsAllowedCategories::*; + match s { + "ac_refrigeration_repair" => Ok(AcRefrigerationRepair), + "accounting_bookkeeping_services" => Ok(AccountingBookkeepingServices), + "advertising_services" => Ok(AdvertisingServices), + "agricultural_cooperative" => Ok(AgriculturalCooperative), + "airlines_air_carriers" => Ok(AirlinesAirCarriers), + "airports_flying_fields" => Ok(AirportsFlyingFields), + "ambulance_services" => Ok(AmbulanceServices), + "amusement_parks_carnivals" => Ok(AmusementParksCarnivals), + "antique_reproductions" => Ok(AntiqueReproductions), + "antique_shops" => Ok(AntiqueShops), + "aquariums" => Ok(Aquariums), + "architectural_surveying_services" => Ok(ArchitecturalSurveyingServices), + "art_dealers_and_galleries" => Ok(ArtDealersAndGalleries), + "artists_supply_and_craft_shops" => Ok(ArtistsSupplyAndCraftShops), + "auto_and_home_supply_stores" => Ok(AutoAndHomeSupplyStores), + "auto_body_repair_shops" => Ok(AutoBodyRepairShops), + "auto_paint_shops" => Ok(AutoPaintShops), + "auto_service_shops" => Ok(AutoServiceShops), + "automated_cash_disburse" => Ok(AutomatedCashDisburse), + "automated_fuel_dispensers" => Ok(AutomatedFuelDispensers), + "automobile_associations" => Ok(AutomobileAssociations), + "automotive_parts_and_accessories_stores" => Ok(AutomotivePartsAndAccessoriesStores), + "automotive_tire_stores" => Ok(AutomotiveTireStores), + "bail_and_bond_payments" => Ok(BailAndBondPayments), + "bakeries" => Ok(Bakeries), + "bands_orchestras" => Ok(BandsOrchestras), + "barber_and_beauty_shops" => Ok(BarberAndBeautyShops), + "betting_casino_gambling" => Ok(BettingCasinoGambling), + "bicycle_shops" => Ok(BicycleShops), + "billiard_pool_establishments" => Ok(BilliardPoolEstablishments), + "boat_dealers" => Ok(BoatDealers), + "boat_rentals_and_leases" => Ok(BoatRentalsAndLeases), + "book_stores" => Ok(BookStores), + "books_periodicals_and_newspapers" => Ok(BooksPeriodicalsAndNewspapers), + "bowling_alleys" => Ok(BowlingAlleys), + "bus_lines" => Ok(BusLines), + "business_secretarial_schools" => Ok(BusinessSecretarialSchools), + "buying_shopping_services" => Ok(BuyingShoppingServices), + "cable_satellite_and_other_pay_television_and_radio" => { + Ok(CableSatelliteAndOtherPayTelevisionAndRadio) + } + "camera_and_photographic_supply_stores" => Ok(CameraAndPhotographicSupplyStores), + "candy_nut_and_confectionery_stores" => Ok(CandyNutAndConfectioneryStores), + "car_and_truck_dealers_new_used" => Ok(CarAndTruckDealersNewUsed), + "car_and_truck_dealers_used_only" => Ok(CarAndTruckDealersUsedOnly), + "car_rental_agencies" => Ok(CarRentalAgencies), + "car_washes" => Ok(CarWashes), + "carpentry_services" => Ok(CarpentryServices), + "carpet_upholstery_cleaning" => Ok(CarpetUpholsteryCleaning), + "caterers" => Ok(Caterers), + "charitable_and_social_service_organizations_fundraising" => { + Ok(CharitableAndSocialServiceOrganizationsFundraising) + } + "chemicals_and_allied_products" => Ok(ChemicalsAndAlliedProducts), + "child_care_services" => Ok(ChildCareServices), + "childrens_and_infants_wear_stores" => Ok(ChildrensAndInfantsWearStores), + "chiropodists_podiatrists" => Ok(ChiropodistsPodiatrists), + "chiropractors" => Ok(Chiropractors), + "cigar_stores_and_stands" => Ok(CigarStoresAndStands), + "civic_social_fraternal_associations" => Ok(CivicSocialFraternalAssociations), + "cleaning_and_maintenance" => Ok(CleaningAndMaintenance), + "clothing_rental" => Ok(ClothingRental), + "colleges_universities" => Ok(CollegesUniversities), + "commercial_equipment" => Ok(CommercialEquipment), + "commercial_footwear" => Ok(CommercialFootwear), + "commercial_photography_art_and_graphics" => Ok(CommercialPhotographyArtAndGraphics), + "commuter_transport_and_ferries" => Ok(CommuterTransportAndFerries), + "computer_network_services" => Ok(ComputerNetworkServices), + "computer_programming" => Ok(ComputerProgramming), + "computer_repair" => Ok(ComputerRepair), + "computer_software_stores" => Ok(ComputerSoftwareStores), + "computers_peripherals_and_software" => Ok(ComputersPeripheralsAndSoftware), + "concrete_work_services" => Ok(ConcreteWorkServices), + "construction_materials" => Ok(ConstructionMaterials), + "consulting_public_relations" => Ok(ConsultingPublicRelations), + "correspondence_schools" => Ok(CorrespondenceSchools), + "cosmetic_stores" => Ok(CosmeticStores), + "counseling_services" => Ok(CounselingServices), + "country_clubs" => Ok(CountryClubs), + "courier_services" => Ok(CourierServices), + "court_costs" => Ok(CourtCosts), + "credit_reporting_agencies" => Ok(CreditReportingAgencies), + "cruise_lines" => Ok(CruiseLines), + "dairy_products_stores" => Ok(DairyProductsStores), + "dance_hall_studios_schools" => Ok(DanceHallStudiosSchools), + "dating_escort_services" => Ok(DatingEscortServices), + "dentists_orthodontists" => Ok(DentistsOrthodontists), + "department_stores" => Ok(DepartmentStores), + "detective_agencies" => Ok(DetectiveAgencies), + "digital_goods_applications" => Ok(DigitalGoodsApplications), + "digital_goods_games" => Ok(DigitalGoodsGames), + "digital_goods_large_volume" => Ok(DigitalGoodsLargeVolume), + "digital_goods_media" => Ok(DigitalGoodsMedia), + "direct_marketing_catalog_merchant" => Ok(DirectMarketingCatalogMerchant), + "direct_marketing_combination_catalog_and_retail_merchant" => { + Ok(DirectMarketingCombinationCatalogAndRetailMerchant) + } + "direct_marketing_inbound_telemarketing" => Ok(DirectMarketingInboundTelemarketing), + "direct_marketing_insurance_services" => Ok(DirectMarketingInsuranceServices), + "direct_marketing_other" => Ok(DirectMarketingOther), + "direct_marketing_outbound_telemarketing" => Ok(DirectMarketingOutboundTelemarketing), + "direct_marketing_subscription" => Ok(DirectMarketingSubscription), + "direct_marketing_travel" => Ok(DirectMarketingTravel), + "discount_stores" => Ok(DiscountStores), + "doctors" => Ok(Doctors), + "door_to_door_sales" => Ok(DoorToDoorSales), + "drapery_window_covering_and_upholstery_stores" => { + Ok(DraperyWindowCoveringAndUpholsteryStores) + } + "drinking_places" => Ok(DrinkingPlaces), + "drug_stores_and_pharmacies" => Ok(DrugStoresAndPharmacies), + "drugs_drug_proprietaries_and_druggist_sundries" => { + Ok(DrugsDrugProprietariesAndDruggistSundries) + } + "dry_cleaners" => Ok(DryCleaners), + "durable_goods" => Ok(DurableGoods), + "duty_free_stores" => Ok(DutyFreeStores), + "eating_places_restaurants" => Ok(EatingPlacesRestaurants), + "educational_services" => Ok(EducationalServices), + "electric_razor_stores" => Ok(ElectricRazorStores), + "electric_vehicle_charging" => Ok(ElectricVehicleCharging), + "electrical_parts_and_equipment" => Ok(ElectricalPartsAndEquipment), + "electrical_services" => Ok(ElectricalServices), + "electronics_repair_shops" => Ok(ElectronicsRepairShops), + "electronics_stores" => Ok(ElectronicsStores), + "elementary_secondary_schools" => Ok(ElementarySecondarySchools), + "emergency_services_gcas_visa_use_only" => Ok(EmergencyServicesGcasVisaUseOnly), + "employment_temp_agencies" => Ok(EmploymentTempAgencies), + "equipment_rental" => Ok(EquipmentRental), + "exterminating_services" => Ok(ExterminatingServices), + "family_clothing_stores" => Ok(FamilyClothingStores), + "fast_food_restaurants" => Ok(FastFoodRestaurants), + "financial_institutions" => Ok(FinancialInstitutions), + "fines_government_administrative_entities" => Ok(FinesGovernmentAdministrativeEntities), + "fireplace_fireplace_screens_and_accessories_stores" => { + Ok(FireplaceFireplaceScreensAndAccessoriesStores) + } + "floor_covering_stores" => Ok(FloorCoveringStores), + "florists" => Ok(Florists), + "florists_supplies_nursery_stock_and_flowers" => { + Ok(FloristsSuppliesNurseryStockAndFlowers) + } + "freezer_and_locker_meat_provisioners" => Ok(FreezerAndLockerMeatProvisioners), + "fuel_dealers_non_automotive" => Ok(FuelDealersNonAutomotive), + "funeral_services_crematories" => Ok(FuneralServicesCrematories), + "furniture_home_furnishings_and_equipment_stores_except_appliances" => { + Ok(FurnitureHomeFurnishingsAndEquipmentStoresExceptAppliances) + } + "furniture_repair_refinishing" => Ok(FurnitureRepairRefinishing), + "furriers_and_fur_shops" => Ok(FurriersAndFurShops), + "general_services" => Ok(GeneralServices), + "gift_card_novelty_and_souvenir_shops" => Ok(GiftCardNoveltyAndSouvenirShops), + "glass_paint_and_wallpaper_stores" => Ok(GlassPaintAndWallpaperStores), + "glassware_crystal_stores" => Ok(GlasswareCrystalStores), + "golf_courses_public" => Ok(GolfCoursesPublic), + "government_licensed_horse_dog_racing_us_region_only" => { + Ok(GovernmentLicensedHorseDogRacingUsRegionOnly) + } + "government_licensed_online_casions_online_gambling_us_region_only" => { + Ok(GovernmentLicensedOnlineCasionsOnlineGamblingUsRegionOnly) + } + "government_owned_lotteries_non_us_region" => Ok(GovernmentOwnedLotteriesNonUsRegion), + "government_owned_lotteries_us_region_only" => Ok(GovernmentOwnedLotteriesUsRegionOnly), + "government_services" => Ok(GovernmentServices), + "grocery_stores_supermarkets" => Ok(GroceryStoresSupermarkets), + "hardware_equipment_and_supplies" => Ok(HardwareEquipmentAndSupplies), + "hardware_stores" => Ok(HardwareStores), + "health_and_beauty_spas" => Ok(HealthAndBeautySpas), + "hearing_aids_sales_and_supplies" => Ok(HearingAidsSalesAndSupplies), + "heating_plumbing_a_c" => Ok(HeatingPlumbingAC), + "hobby_toy_and_game_shops" => Ok(HobbyToyAndGameShops), + "home_supply_warehouse_stores" => Ok(HomeSupplyWarehouseStores), + "hospitals" => Ok(Hospitals), + "hotels_motels_and_resorts" => Ok(HotelsMotelsAndResorts), + "household_appliance_stores" => Ok(HouseholdApplianceStores), + "industrial_supplies" => Ok(IndustrialSupplies), + "information_retrieval_services" => Ok(InformationRetrievalServices), + "insurance_default" => Ok(InsuranceDefault), + "insurance_underwriting_premiums" => Ok(InsuranceUnderwritingPremiums), + "intra_company_purchases" => Ok(IntraCompanyPurchases), + "jewelry_stores_watches_clocks_and_silverware_stores" => { + Ok(JewelryStoresWatchesClocksAndSilverwareStores) + } + "landscaping_services" => Ok(LandscapingServices), + "laundries" => Ok(Laundries), + "laundry_cleaning_services" => Ok(LaundryCleaningServices), + "legal_services_attorneys" => Ok(LegalServicesAttorneys), + "luggage_and_leather_goods_stores" => Ok(LuggageAndLeatherGoodsStores), + "lumber_building_materials_stores" => Ok(LumberBuildingMaterialsStores), + "manual_cash_disburse" => Ok(ManualCashDisburse), + "marinas_service_and_supplies" => Ok(MarinasServiceAndSupplies), + "marketplaces" => Ok(Marketplaces), + "masonry_stonework_and_plaster" => Ok(MasonryStoneworkAndPlaster), + "massage_parlors" => Ok(MassageParlors), + "medical_and_dental_labs" => Ok(MedicalAndDentalLabs), + "medical_dental_ophthalmic_and_hospital_equipment_and_supplies" => { + Ok(MedicalDentalOphthalmicAndHospitalEquipmentAndSupplies) + } + "medical_services" => Ok(MedicalServices), + "membership_organizations" => Ok(MembershipOrganizations), + "mens_and_boys_clothing_and_accessories_stores" => { + Ok(MensAndBoysClothingAndAccessoriesStores) + } + "mens_womens_clothing_stores" => Ok(MensWomensClothingStores), + "metal_service_centers" => Ok(MetalServiceCenters), + "miscellaneous" => Ok(Miscellaneous), + "miscellaneous_apparel_and_accessory_shops" => { + Ok(MiscellaneousApparelAndAccessoryShops) + } + "miscellaneous_auto_dealers" => Ok(MiscellaneousAutoDealers), + "miscellaneous_business_services" => Ok(MiscellaneousBusinessServices), + "miscellaneous_food_stores" => Ok(MiscellaneousFoodStores), + "miscellaneous_general_merchandise" => Ok(MiscellaneousGeneralMerchandise), + "miscellaneous_general_services" => Ok(MiscellaneousGeneralServices), + "miscellaneous_home_furnishing_specialty_stores" => { + Ok(MiscellaneousHomeFurnishingSpecialtyStores) + } + "miscellaneous_publishing_and_printing" => Ok(MiscellaneousPublishingAndPrinting), + "miscellaneous_recreation_services" => Ok(MiscellaneousRecreationServices), + "miscellaneous_repair_shops" => Ok(MiscellaneousRepairShops), + "miscellaneous_specialty_retail" => Ok(MiscellaneousSpecialtyRetail), + "mobile_home_dealers" => Ok(MobileHomeDealers), + "motion_picture_theaters" => Ok(MotionPictureTheaters), + "motor_freight_carriers_and_trucking" => Ok(MotorFreightCarriersAndTrucking), + "motor_homes_dealers" => Ok(MotorHomesDealers), + "motor_vehicle_supplies_and_new_parts" => Ok(MotorVehicleSuppliesAndNewParts), + "motorcycle_shops_and_dealers" => Ok(MotorcycleShopsAndDealers), + "motorcycle_shops_dealers" => Ok(MotorcycleShopsDealers), + "music_stores_musical_instruments_pianos_and_sheet_music" => { + Ok(MusicStoresMusicalInstrumentsPianosAndSheetMusic) + } + "news_dealers_and_newsstands" => Ok(NewsDealersAndNewsstands), + "non_fi_money_orders" => Ok(NonFiMoneyOrders), + "non_fi_stored_value_card_purchase_load" => Ok(NonFiStoredValueCardPurchaseLoad), + "nondurable_goods" => Ok(NondurableGoods), + "nurseries_lawn_and_garden_supply_stores" => Ok(NurseriesLawnAndGardenSupplyStores), + "nursing_personal_care" => Ok(NursingPersonalCare), + "office_and_commercial_furniture" => Ok(OfficeAndCommercialFurniture), + "opticians_eyeglasses" => Ok(OpticiansEyeglasses), + "optometrists_ophthalmologist" => Ok(OptometristsOphthalmologist), + "orthopedic_goods_prosthetic_devices" => Ok(OrthopedicGoodsProstheticDevices), + "osteopaths" => Ok(Osteopaths), + "package_stores_beer_wine_and_liquor" => Ok(PackageStoresBeerWineAndLiquor), + "paints_varnishes_and_supplies" => Ok(PaintsVarnishesAndSupplies), + "parking_lots_garages" => Ok(ParkingLotsGarages), + "passenger_railways" => Ok(PassengerRailways), + "pawn_shops" => Ok(PawnShops), + "pet_shops_pet_food_and_supplies" => Ok(PetShopsPetFoodAndSupplies), + "petroleum_and_petroleum_products" => Ok(PetroleumAndPetroleumProducts), + "photo_developing" => Ok(PhotoDeveloping), + "photographic_photocopy_microfilm_equipment_and_supplies" => { + Ok(PhotographicPhotocopyMicrofilmEquipmentAndSupplies) + } + "photographic_studios" => Ok(PhotographicStudios), + "picture_video_production" => Ok(PictureVideoProduction), + "piece_goods_notions_and_other_dry_goods" => Ok(PieceGoodsNotionsAndOtherDryGoods), + "plumbing_heating_equipment_and_supplies" => Ok(PlumbingHeatingEquipmentAndSupplies), + "political_organizations" => Ok(PoliticalOrganizations), + "postal_services_government_only" => Ok(PostalServicesGovernmentOnly), + "precious_stones_and_metals_watches_and_jewelry" => { + Ok(PreciousStonesAndMetalsWatchesAndJewelry) + } + "professional_services" => Ok(ProfessionalServices), + "public_warehousing_and_storage" => Ok(PublicWarehousingAndStorage), + "quick_copy_repro_and_blueprint" => Ok(QuickCopyReproAndBlueprint), + "railroads" => Ok(Railroads), + "real_estate_agents_and_managers_rentals" => Ok(RealEstateAgentsAndManagersRentals), + "record_stores" => Ok(RecordStores), + "recreational_vehicle_rentals" => Ok(RecreationalVehicleRentals), + "religious_goods_stores" => Ok(ReligiousGoodsStores), + "religious_organizations" => Ok(ReligiousOrganizations), + "roofing_siding_sheet_metal" => Ok(RoofingSidingSheetMetal), + "secretarial_support_services" => Ok(SecretarialSupportServices), + "security_brokers_dealers" => Ok(SecurityBrokersDealers), + "service_stations" => Ok(ServiceStations), + "sewing_needlework_fabric_and_piece_goods_stores" => { + Ok(SewingNeedleworkFabricAndPieceGoodsStores) + } + "shoe_repair_hat_cleaning" => Ok(ShoeRepairHatCleaning), + "shoe_stores" => Ok(ShoeStores), + "small_appliance_repair" => Ok(SmallApplianceRepair), + "snowmobile_dealers" => Ok(SnowmobileDealers), + "special_trade_services" => Ok(SpecialTradeServices), + "specialty_cleaning" => Ok(SpecialtyCleaning), + "sporting_goods_stores" => Ok(SportingGoodsStores), + "sporting_recreation_camps" => Ok(SportingRecreationCamps), + "sports_and_riding_apparel_stores" => Ok(SportsAndRidingApparelStores), + "sports_clubs_fields" => Ok(SportsClubsFields), + "stamp_and_coin_stores" => Ok(StampAndCoinStores), + "stationary_office_supplies_printing_and_writing_paper" => { + Ok(StationaryOfficeSuppliesPrintingAndWritingPaper) + } + "stationery_stores_office_and_school_supply_stores" => { + Ok(StationeryStoresOfficeAndSchoolSupplyStores) + } + "swimming_pools_sales" => Ok(SwimmingPoolsSales), + "t_ui_travel_germany" => Ok(TUiTravelGermany), + "tailors_alterations" => Ok(TailorsAlterations), + "tax_payments_government_agencies" => Ok(TaxPaymentsGovernmentAgencies), + "tax_preparation_services" => Ok(TaxPreparationServices), + "taxicabs_limousines" => Ok(TaxicabsLimousines), + "telecommunication_equipment_and_telephone_sales" => { + Ok(TelecommunicationEquipmentAndTelephoneSales) + } + "telecommunication_services" => Ok(TelecommunicationServices), + "telegraph_services" => Ok(TelegraphServices), + "tent_and_awning_shops" => Ok(TentAndAwningShops), + "testing_laboratories" => Ok(TestingLaboratories), + "theatrical_ticket_agencies" => Ok(TheatricalTicketAgencies), + "timeshares" => Ok(Timeshares), + "tire_retreading_and_repair" => Ok(TireRetreadingAndRepair), + "tolls_bridge_fees" => Ok(TollsBridgeFees), + "tourist_attractions_and_exhibits" => Ok(TouristAttractionsAndExhibits), + "towing_services" => Ok(TowingServices), + "trailer_parks_campgrounds" => Ok(TrailerParksCampgrounds), + "transportation_services" => Ok(TransportationServices), + "travel_agencies_tour_operators" => Ok(TravelAgenciesTourOperators), + "truck_stop_iteration" => Ok(TruckStopIteration), + "truck_utility_trailer_rentals" => Ok(TruckUtilityTrailerRentals), + "typesetting_plate_making_and_related_services" => { + Ok(TypesettingPlateMakingAndRelatedServices) + } + "typewriter_stores" => Ok(TypewriterStores), + "u_s_federal_government_agencies_or_departments" => { + Ok(USFederalGovernmentAgenciesOrDepartments) + } + "uniforms_commercial_clothing" => Ok(UniformsCommercialClothing), + "used_merchandise_and_secondhand_stores" => Ok(UsedMerchandiseAndSecondhandStores), + "utilities" => Ok(Utilities), + "variety_stores" => Ok(VarietyStores), + "veterinary_services" => Ok(VeterinaryServices), + "video_amusement_game_supplies" => Ok(VideoAmusementGameSupplies), + "video_game_arcades" => Ok(VideoGameArcades), + "video_tape_rental_stores" => Ok(VideoTapeRentalStores), + "vocational_trade_schools" => Ok(VocationalTradeSchools), + "watch_jewelry_repair" => Ok(WatchJewelryRepair), + "welding_repair" => Ok(WeldingRepair), + "wholesale_clubs" => Ok(WholesaleClubs), + "wig_and_toupee_stores" => Ok(WigAndToupeeStores), + "wires_money_orders" => Ok(WiresMoneyOrders), + "womens_accessory_and_specialty_shops" => Ok(WomensAccessoryAndSpecialtyShops), + "womens_ready_to_wear_stores" => Ok(WomensReadyToWearStores), + "wrecking_and_salvage_yards" => Ok(WreckingAndSalvageYards), + _ => Err(()), + } + } +} +impl std::fmt::Display for UpdateIssuingCardSpendingControlsAllowedCategories { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for UpdateIssuingCardSpendingControlsAllowedCategories { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for UpdateIssuingCardSpendingControlsAllowedCategories { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Array of strings containing [categories](https://stripe.com/docs/api#issuing_authorization_object-merchant_data-category) of authorizations to decline. +/// All other categories will be allowed. +/// Cannot be set with `allowed_categories`. +#[derive(Copy, Clone, Eq, PartialEq)] +#[non_exhaustive] +pub enum UpdateIssuingCardSpendingControlsBlockedCategories { + AcRefrigerationRepair, + AccountingBookkeepingServices, + AdvertisingServices, + AgriculturalCooperative, + AirlinesAirCarriers, + AirportsFlyingFields, + AmbulanceServices, + AmusementParksCarnivals, + AntiqueReproductions, + AntiqueShops, + Aquariums, + ArchitecturalSurveyingServices, + ArtDealersAndGalleries, + ArtistsSupplyAndCraftShops, + AutoAndHomeSupplyStores, + AutoBodyRepairShops, + AutoPaintShops, + AutoServiceShops, + AutomatedCashDisburse, + AutomatedFuelDispensers, + AutomobileAssociations, + AutomotivePartsAndAccessoriesStores, + AutomotiveTireStores, + BailAndBondPayments, + Bakeries, + BandsOrchestras, + BarberAndBeautyShops, + BettingCasinoGambling, + BicycleShops, + BilliardPoolEstablishments, + BoatDealers, + BoatRentalsAndLeases, + BookStores, + BooksPeriodicalsAndNewspapers, + BowlingAlleys, + BusLines, + BusinessSecretarialSchools, + BuyingShoppingServices, + CableSatelliteAndOtherPayTelevisionAndRadio, + CameraAndPhotographicSupplyStores, + CandyNutAndConfectioneryStores, + CarAndTruckDealersNewUsed, + CarAndTruckDealersUsedOnly, + CarRentalAgencies, + CarWashes, + CarpentryServices, + CarpetUpholsteryCleaning, + Caterers, + CharitableAndSocialServiceOrganizationsFundraising, + ChemicalsAndAlliedProducts, + ChildCareServices, + ChildrensAndInfantsWearStores, + ChiropodistsPodiatrists, + Chiropractors, + CigarStoresAndStands, + CivicSocialFraternalAssociations, + CleaningAndMaintenance, + ClothingRental, + CollegesUniversities, + CommercialEquipment, + CommercialFootwear, + CommercialPhotographyArtAndGraphics, + CommuterTransportAndFerries, + ComputerNetworkServices, + ComputerProgramming, + ComputerRepair, + ComputerSoftwareStores, + ComputersPeripheralsAndSoftware, + ConcreteWorkServices, + ConstructionMaterials, + ConsultingPublicRelations, + CorrespondenceSchools, + CosmeticStores, + CounselingServices, + CountryClubs, + CourierServices, + CourtCosts, + CreditReportingAgencies, + CruiseLines, + DairyProductsStores, + DanceHallStudiosSchools, + DatingEscortServices, + DentistsOrthodontists, + DepartmentStores, + DetectiveAgencies, + DigitalGoodsApplications, + DigitalGoodsGames, + DigitalGoodsLargeVolume, + DigitalGoodsMedia, + DirectMarketingCatalogMerchant, + DirectMarketingCombinationCatalogAndRetailMerchant, + DirectMarketingInboundTelemarketing, + DirectMarketingInsuranceServices, + DirectMarketingOther, + DirectMarketingOutboundTelemarketing, + DirectMarketingSubscription, + DirectMarketingTravel, + DiscountStores, + Doctors, + DoorToDoorSales, + DraperyWindowCoveringAndUpholsteryStores, + DrinkingPlaces, + DrugStoresAndPharmacies, + DrugsDrugProprietariesAndDruggistSundries, + DryCleaners, + DurableGoods, + DutyFreeStores, + EatingPlacesRestaurants, + EducationalServices, + ElectricRazorStores, + ElectricVehicleCharging, + ElectricalPartsAndEquipment, + ElectricalServices, + ElectronicsRepairShops, + ElectronicsStores, + ElementarySecondarySchools, + EmergencyServicesGcasVisaUseOnly, + EmploymentTempAgencies, + EquipmentRental, + ExterminatingServices, + FamilyClothingStores, + FastFoodRestaurants, + FinancialInstitutions, + FinesGovernmentAdministrativeEntities, + FireplaceFireplaceScreensAndAccessoriesStores, + FloorCoveringStores, + Florists, + FloristsSuppliesNurseryStockAndFlowers, + FreezerAndLockerMeatProvisioners, + FuelDealersNonAutomotive, + FuneralServicesCrematories, + FurnitureHomeFurnishingsAndEquipmentStoresExceptAppliances, + FurnitureRepairRefinishing, + FurriersAndFurShops, + GeneralServices, + GiftCardNoveltyAndSouvenirShops, + GlassPaintAndWallpaperStores, + GlasswareCrystalStores, + GolfCoursesPublic, + GovernmentLicensedHorseDogRacingUsRegionOnly, + GovernmentLicensedOnlineCasionsOnlineGamblingUsRegionOnly, + GovernmentOwnedLotteriesNonUsRegion, + GovernmentOwnedLotteriesUsRegionOnly, + GovernmentServices, + GroceryStoresSupermarkets, + HardwareEquipmentAndSupplies, + HardwareStores, + HealthAndBeautySpas, + HearingAidsSalesAndSupplies, + HeatingPlumbingAC, + HobbyToyAndGameShops, + HomeSupplyWarehouseStores, + Hospitals, + HotelsMotelsAndResorts, + HouseholdApplianceStores, + IndustrialSupplies, + InformationRetrievalServices, + InsuranceDefault, + InsuranceUnderwritingPremiums, + IntraCompanyPurchases, + JewelryStoresWatchesClocksAndSilverwareStores, + LandscapingServices, + Laundries, + LaundryCleaningServices, + LegalServicesAttorneys, + LuggageAndLeatherGoodsStores, + LumberBuildingMaterialsStores, + ManualCashDisburse, + MarinasServiceAndSupplies, + Marketplaces, + MasonryStoneworkAndPlaster, + MassageParlors, + MedicalAndDentalLabs, + MedicalDentalOphthalmicAndHospitalEquipmentAndSupplies, + MedicalServices, + MembershipOrganizations, + MensAndBoysClothingAndAccessoriesStores, + MensWomensClothingStores, + MetalServiceCenters, + Miscellaneous, + MiscellaneousApparelAndAccessoryShops, + MiscellaneousAutoDealers, + MiscellaneousBusinessServices, + MiscellaneousFoodStores, + MiscellaneousGeneralMerchandise, + MiscellaneousGeneralServices, + MiscellaneousHomeFurnishingSpecialtyStores, + MiscellaneousPublishingAndPrinting, + MiscellaneousRecreationServices, + MiscellaneousRepairShops, + MiscellaneousSpecialtyRetail, + MobileHomeDealers, + MotionPictureTheaters, + MotorFreightCarriersAndTrucking, + MotorHomesDealers, + MotorVehicleSuppliesAndNewParts, + MotorcycleShopsAndDealers, + MotorcycleShopsDealers, + MusicStoresMusicalInstrumentsPianosAndSheetMusic, + NewsDealersAndNewsstands, + NonFiMoneyOrders, + NonFiStoredValueCardPurchaseLoad, + NondurableGoods, + NurseriesLawnAndGardenSupplyStores, + NursingPersonalCare, + OfficeAndCommercialFurniture, + OpticiansEyeglasses, + OptometristsOphthalmologist, + OrthopedicGoodsProstheticDevices, + Osteopaths, + PackageStoresBeerWineAndLiquor, + PaintsVarnishesAndSupplies, + ParkingLotsGarages, + PassengerRailways, + PawnShops, + PetShopsPetFoodAndSupplies, + PetroleumAndPetroleumProducts, + PhotoDeveloping, + PhotographicPhotocopyMicrofilmEquipmentAndSupplies, + PhotographicStudios, + PictureVideoProduction, + PieceGoodsNotionsAndOtherDryGoods, + PlumbingHeatingEquipmentAndSupplies, + PoliticalOrganizations, + PostalServicesGovernmentOnly, + PreciousStonesAndMetalsWatchesAndJewelry, + ProfessionalServices, + PublicWarehousingAndStorage, + QuickCopyReproAndBlueprint, + Railroads, + RealEstateAgentsAndManagersRentals, + RecordStores, + RecreationalVehicleRentals, + ReligiousGoodsStores, + ReligiousOrganizations, + RoofingSidingSheetMetal, + SecretarialSupportServices, + SecurityBrokersDealers, + ServiceStations, + SewingNeedleworkFabricAndPieceGoodsStores, + ShoeRepairHatCleaning, + ShoeStores, + SmallApplianceRepair, + SnowmobileDealers, + SpecialTradeServices, + SpecialtyCleaning, + SportingGoodsStores, + SportingRecreationCamps, + SportsAndRidingApparelStores, + SportsClubsFields, + StampAndCoinStores, + StationaryOfficeSuppliesPrintingAndWritingPaper, + StationeryStoresOfficeAndSchoolSupplyStores, + SwimmingPoolsSales, + TUiTravelGermany, + TailorsAlterations, + TaxPaymentsGovernmentAgencies, + TaxPreparationServices, + TaxicabsLimousines, + TelecommunicationEquipmentAndTelephoneSales, + TelecommunicationServices, + TelegraphServices, + TentAndAwningShops, + TestingLaboratories, + TheatricalTicketAgencies, + Timeshares, + TireRetreadingAndRepair, + TollsBridgeFees, + TouristAttractionsAndExhibits, + TowingServices, + TrailerParksCampgrounds, + TransportationServices, + TravelAgenciesTourOperators, + TruckStopIteration, + TruckUtilityTrailerRentals, + TypesettingPlateMakingAndRelatedServices, + TypewriterStores, + USFederalGovernmentAgenciesOrDepartments, + UniformsCommercialClothing, + UsedMerchandiseAndSecondhandStores, + Utilities, + VarietyStores, + VeterinaryServices, + VideoAmusementGameSupplies, + VideoGameArcades, + VideoTapeRentalStores, + VocationalTradeSchools, + WatchJewelryRepair, + WeldingRepair, + WholesaleClubs, + WigAndToupeeStores, + WiresMoneyOrders, + WomensAccessoryAndSpecialtyShops, + WomensReadyToWearStores, + WreckingAndSalvageYards, + /// An unrecognized value from Stripe. Should not be used as a request parameter. + Unknown, +} +impl UpdateIssuingCardSpendingControlsBlockedCategories { + pub fn as_str(self) -> &'static str { + use UpdateIssuingCardSpendingControlsBlockedCategories::*; + match self { + AcRefrigerationRepair => "ac_refrigeration_repair", + AccountingBookkeepingServices => "accounting_bookkeeping_services", + AdvertisingServices => "advertising_services", + AgriculturalCooperative => "agricultural_cooperative", + AirlinesAirCarriers => "airlines_air_carriers", + AirportsFlyingFields => "airports_flying_fields", + AmbulanceServices => "ambulance_services", + AmusementParksCarnivals => "amusement_parks_carnivals", + AntiqueReproductions => "antique_reproductions", + AntiqueShops => "antique_shops", + Aquariums => "aquariums", + ArchitecturalSurveyingServices => "architectural_surveying_services", + ArtDealersAndGalleries => "art_dealers_and_galleries", + ArtistsSupplyAndCraftShops => "artists_supply_and_craft_shops", + AutoAndHomeSupplyStores => "auto_and_home_supply_stores", + AutoBodyRepairShops => "auto_body_repair_shops", + AutoPaintShops => "auto_paint_shops", + AutoServiceShops => "auto_service_shops", + AutomatedCashDisburse => "automated_cash_disburse", + AutomatedFuelDispensers => "automated_fuel_dispensers", + AutomobileAssociations => "automobile_associations", + AutomotivePartsAndAccessoriesStores => "automotive_parts_and_accessories_stores", + AutomotiveTireStores => "automotive_tire_stores", + BailAndBondPayments => "bail_and_bond_payments", + Bakeries => "bakeries", + BandsOrchestras => "bands_orchestras", + BarberAndBeautyShops => "barber_and_beauty_shops", + BettingCasinoGambling => "betting_casino_gambling", + BicycleShops => "bicycle_shops", + BilliardPoolEstablishments => "billiard_pool_establishments", + BoatDealers => "boat_dealers", + BoatRentalsAndLeases => "boat_rentals_and_leases", + BookStores => "book_stores", + BooksPeriodicalsAndNewspapers => "books_periodicals_and_newspapers", + BowlingAlleys => "bowling_alleys", + BusLines => "bus_lines", + BusinessSecretarialSchools => "business_secretarial_schools", + BuyingShoppingServices => "buying_shopping_services", + CableSatelliteAndOtherPayTelevisionAndRadio => { + "cable_satellite_and_other_pay_television_and_radio" + } + CameraAndPhotographicSupplyStores => "camera_and_photographic_supply_stores", + CandyNutAndConfectioneryStores => "candy_nut_and_confectionery_stores", + CarAndTruckDealersNewUsed => "car_and_truck_dealers_new_used", + CarAndTruckDealersUsedOnly => "car_and_truck_dealers_used_only", + CarRentalAgencies => "car_rental_agencies", + CarWashes => "car_washes", + CarpentryServices => "carpentry_services", + CarpetUpholsteryCleaning => "carpet_upholstery_cleaning", + Caterers => "caterers", + CharitableAndSocialServiceOrganizationsFundraising => { + "charitable_and_social_service_organizations_fundraising" + } + ChemicalsAndAlliedProducts => "chemicals_and_allied_products", + ChildCareServices => "child_care_services", + ChildrensAndInfantsWearStores => "childrens_and_infants_wear_stores", + ChiropodistsPodiatrists => "chiropodists_podiatrists", + Chiropractors => "chiropractors", + CigarStoresAndStands => "cigar_stores_and_stands", + CivicSocialFraternalAssociations => "civic_social_fraternal_associations", + CleaningAndMaintenance => "cleaning_and_maintenance", + ClothingRental => "clothing_rental", + CollegesUniversities => "colleges_universities", + CommercialEquipment => "commercial_equipment", + CommercialFootwear => "commercial_footwear", + CommercialPhotographyArtAndGraphics => "commercial_photography_art_and_graphics", + CommuterTransportAndFerries => "commuter_transport_and_ferries", + ComputerNetworkServices => "computer_network_services", + ComputerProgramming => "computer_programming", + ComputerRepair => "computer_repair", + ComputerSoftwareStores => "computer_software_stores", + ComputersPeripheralsAndSoftware => "computers_peripherals_and_software", + ConcreteWorkServices => "concrete_work_services", + ConstructionMaterials => "construction_materials", + ConsultingPublicRelations => "consulting_public_relations", + CorrespondenceSchools => "correspondence_schools", + CosmeticStores => "cosmetic_stores", + CounselingServices => "counseling_services", + CountryClubs => "country_clubs", + CourierServices => "courier_services", + CourtCosts => "court_costs", + CreditReportingAgencies => "credit_reporting_agencies", + CruiseLines => "cruise_lines", + DairyProductsStores => "dairy_products_stores", + DanceHallStudiosSchools => "dance_hall_studios_schools", + DatingEscortServices => "dating_escort_services", + DentistsOrthodontists => "dentists_orthodontists", + DepartmentStores => "department_stores", + DetectiveAgencies => "detective_agencies", + DigitalGoodsApplications => "digital_goods_applications", + DigitalGoodsGames => "digital_goods_games", + DigitalGoodsLargeVolume => "digital_goods_large_volume", + DigitalGoodsMedia => "digital_goods_media", + DirectMarketingCatalogMerchant => "direct_marketing_catalog_merchant", + DirectMarketingCombinationCatalogAndRetailMerchant => { + "direct_marketing_combination_catalog_and_retail_merchant" + } + DirectMarketingInboundTelemarketing => "direct_marketing_inbound_telemarketing", + DirectMarketingInsuranceServices => "direct_marketing_insurance_services", + DirectMarketingOther => "direct_marketing_other", + DirectMarketingOutboundTelemarketing => "direct_marketing_outbound_telemarketing", + DirectMarketingSubscription => "direct_marketing_subscription", + DirectMarketingTravel => "direct_marketing_travel", + DiscountStores => "discount_stores", + Doctors => "doctors", + DoorToDoorSales => "door_to_door_sales", + DraperyWindowCoveringAndUpholsteryStores => { + "drapery_window_covering_and_upholstery_stores" + } + DrinkingPlaces => "drinking_places", + DrugStoresAndPharmacies => "drug_stores_and_pharmacies", + DrugsDrugProprietariesAndDruggistSundries => { + "drugs_drug_proprietaries_and_druggist_sundries" + } + DryCleaners => "dry_cleaners", + DurableGoods => "durable_goods", + DutyFreeStores => "duty_free_stores", + EatingPlacesRestaurants => "eating_places_restaurants", + EducationalServices => "educational_services", + ElectricRazorStores => "electric_razor_stores", + ElectricVehicleCharging => "electric_vehicle_charging", + ElectricalPartsAndEquipment => "electrical_parts_and_equipment", + ElectricalServices => "electrical_services", + ElectronicsRepairShops => "electronics_repair_shops", + ElectronicsStores => "electronics_stores", + ElementarySecondarySchools => "elementary_secondary_schools", + EmergencyServicesGcasVisaUseOnly => "emergency_services_gcas_visa_use_only", + EmploymentTempAgencies => "employment_temp_agencies", + EquipmentRental => "equipment_rental", + ExterminatingServices => "exterminating_services", + FamilyClothingStores => "family_clothing_stores", + FastFoodRestaurants => "fast_food_restaurants", + FinancialInstitutions => "financial_institutions", + FinesGovernmentAdministrativeEntities => "fines_government_administrative_entities", + FireplaceFireplaceScreensAndAccessoriesStores => { + "fireplace_fireplace_screens_and_accessories_stores" + } + FloorCoveringStores => "floor_covering_stores", + Florists => "florists", + FloristsSuppliesNurseryStockAndFlowers => "florists_supplies_nursery_stock_and_flowers", + FreezerAndLockerMeatProvisioners => "freezer_and_locker_meat_provisioners", + FuelDealersNonAutomotive => "fuel_dealers_non_automotive", + FuneralServicesCrematories => "funeral_services_crematories", + FurnitureHomeFurnishingsAndEquipmentStoresExceptAppliances => { + "furniture_home_furnishings_and_equipment_stores_except_appliances" + } + FurnitureRepairRefinishing => "furniture_repair_refinishing", + FurriersAndFurShops => "furriers_and_fur_shops", + GeneralServices => "general_services", + GiftCardNoveltyAndSouvenirShops => "gift_card_novelty_and_souvenir_shops", + GlassPaintAndWallpaperStores => "glass_paint_and_wallpaper_stores", + GlasswareCrystalStores => "glassware_crystal_stores", + GolfCoursesPublic => "golf_courses_public", + GovernmentLicensedHorseDogRacingUsRegionOnly => { + "government_licensed_horse_dog_racing_us_region_only" + } + GovernmentLicensedOnlineCasionsOnlineGamblingUsRegionOnly => { + "government_licensed_online_casions_online_gambling_us_region_only" + } + GovernmentOwnedLotteriesNonUsRegion => "government_owned_lotteries_non_us_region", + GovernmentOwnedLotteriesUsRegionOnly => "government_owned_lotteries_us_region_only", + GovernmentServices => "government_services", + GroceryStoresSupermarkets => "grocery_stores_supermarkets", + HardwareEquipmentAndSupplies => "hardware_equipment_and_supplies", + HardwareStores => "hardware_stores", + HealthAndBeautySpas => "health_and_beauty_spas", + HearingAidsSalesAndSupplies => "hearing_aids_sales_and_supplies", + HeatingPlumbingAC => "heating_plumbing_a_c", + HobbyToyAndGameShops => "hobby_toy_and_game_shops", + HomeSupplyWarehouseStores => "home_supply_warehouse_stores", + Hospitals => "hospitals", + HotelsMotelsAndResorts => "hotels_motels_and_resorts", + HouseholdApplianceStores => "household_appliance_stores", + IndustrialSupplies => "industrial_supplies", + InformationRetrievalServices => "information_retrieval_services", + InsuranceDefault => "insurance_default", + InsuranceUnderwritingPremiums => "insurance_underwriting_premiums", + IntraCompanyPurchases => "intra_company_purchases", + JewelryStoresWatchesClocksAndSilverwareStores => { + "jewelry_stores_watches_clocks_and_silverware_stores" + } + LandscapingServices => "landscaping_services", + Laundries => "laundries", + LaundryCleaningServices => "laundry_cleaning_services", + LegalServicesAttorneys => "legal_services_attorneys", + LuggageAndLeatherGoodsStores => "luggage_and_leather_goods_stores", + LumberBuildingMaterialsStores => "lumber_building_materials_stores", + ManualCashDisburse => "manual_cash_disburse", + MarinasServiceAndSupplies => "marinas_service_and_supplies", + Marketplaces => "marketplaces", + MasonryStoneworkAndPlaster => "masonry_stonework_and_plaster", + MassageParlors => "massage_parlors", + MedicalAndDentalLabs => "medical_and_dental_labs", + MedicalDentalOphthalmicAndHospitalEquipmentAndSupplies => { + "medical_dental_ophthalmic_and_hospital_equipment_and_supplies" + } + MedicalServices => "medical_services", + MembershipOrganizations => "membership_organizations", + MensAndBoysClothingAndAccessoriesStores => { + "mens_and_boys_clothing_and_accessories_stores" + } + MensWomensClothingStores => "mens_womens_clothing_stores", + MetalServiceCenters => "metal_service_centers", + Miscellaneous => "miscellaneous", + MiscellaneousApparelAndAccessoryShops => "miscellaneous_apparel_and_accessory_shops", + MiscellaneousAutoDealers => "miscellaneous_auto_dealers", + MiscellaneousBusinessServices => "miscellaneous_business_services", + MiscellaneousFoodStores => "miscellaneous_food_stores", + MiscellaneousGeneralMerchandise => "miscellaneous_general_merchandise", + MiscellaneousGeneralServices => "miscellaneous_general_services", + MiscellaneousHomeFurnishingSpecialtyStores => { + "miscellaneous_home_furnishing_specialty_stores" + } + MiscellaneousPublishingAndPrinting => "miscellaneous_publishing_and_printing", + MiscellaneousRecreationServices => "miscellaneous_recreation_services", + MiscellaneousRepairShops => "miscellaneous_repair_shops", + MiscellaneousSpecialtyRetail => "miscellaneous_specialty_retail", + MobileHomeDealers => "mobile_home_dealers", + MotionPictureTheaters => "motion_picture_theaters", + MotorFreightCarriersAndTrucking => "motor_freight_carriers_and_trucking", + MotorHomesDealers => "motor_homes_dealers", + MotorVehicleSuppliesAndNewParts => "motor_vehicle_supplies_and_new_parts", + MotorcycleShopsAndDealers => "motorcycle_shops_and_dealers", + MotorcycleShopsDealers => "motorcycle_shops_dealers", + MusicStoresMusicalInstrumentsPianosAndSheetMusic => { + "music_stores_musical_instruments_pianos_and_sheet_music" + } + NewsDealersAndNewsstands => "news_dealers_and_newsstands", + NonFiMoneyOrders => "non_fi_money_orders", + NonFiStoredValueCardPurchaseLoad => "non_fi_stored_value_card_purchase_load", + NondurableGoods => "nondurable_goods", + NurseriesLawnAndGardenSupplyStores => "nurseries_lawn_and_garden_supply_stores", + NursingPersonalCare => "nursing_personal_care", + OfficeAndCommercialFurniture => "office_and_commercial_furniture", + OpticiansEyeglasses => "opticians_eyeglasses", + OptometristsOphthalmologist => "optometrists_ophthalmologist", + OrthopedicGoodsProstheticDevices => "orthopedic_goods_prosthetic_devices", + Osteopaths => "osteopaths", + PackageStoresBeerWineAndLiquor => "package_stores_beer_wine_and_liquor", + PaintsVarnishesAndSupplies => "paints_varnishes_and_supplies", + ParkingLotsGarages => "parking_lots_garages", + PassengerRailways => "passenger_railways", + PawnShops => "pawn_shops", + PetShopsPetFoodAndSupplies => "pet_shops_pet_food_and_supplies", + PetroleumAndPetroleumProducts => "petroleum_and_petroleum_products", + PhotoDeveloping => "photo_developing", + PhotographicPhotocopyMicrofilmEquipmentAndSupplies => { + "photographic_photocopy_microfilm_equipment_and_supplies" + } + PhotographicStudios => "photographic_studios", + PictureVideoProduction => "picture_video_production", + PieceGoodsNotionsAndOtherDryGoods => "piece_goods_notions_and_other_dry_goods", + PlumbingHeatingEquipmentAndSupplies => "plumbing_heating_equipment_and_supplies", + PoliticalOrganizations => "political_organizations", + PostalServicesGovernmentOnly => "postal_services_government_only", + PreciousStonesAndMetalsWatchesAndJewelry => { + "precious_stones_and_metals_watches_and_jewelry" + } + ProfessionalServices => "professional_services", + PublicWarehousingAndStorage => "public_warehousing_and_storage", + QuickCopyReproAndBlueprint => "quick_copy_repro_and_blueprint", + Railroads => "railroads", + RealEstateAgentsAndManagersRentals => "real_estate_agents_and_managers_rentals", + RecordStores => "record_stores", + RecreationalVehicleRentals => "recreational_vehicle_rentals", + ReligiousGoodsStores => "religious_goods_stores", + ReligiousOrganizations => "religious_organizations", + RoofingSidingSheetMetal => "roofing_siding_sheet_metal", + SecretarialSupportServices => "secretarial_support_services", + SecurityBrokersDealers => "security_brokers_dealers", + ServiceStations => "service_stations", + SewingNeedleworkFabricAndPieceGoodsStores => { + "sewing_needlework_fabric_and_piece_goods_stores" + } + ShoeRepairHatCleaning => "shoe_repair_hat_cleaning", + ShoeStores => "shoe_stores", + SmallApplianceRepair => "small_appliance_repair", + SnowmobileDealers => "snowmobile_dealers", + SpecialTradeServices => "special_trade_services", + SpecialtyCleaning => "specialty_cleaning", + SportingGoodsStores => "sporting_goods_stores", + SportingRecreationCamps => "sporting_recreation_camps", + SportsAndRidingApparelStores => "sports_and_riding_apparel_stores", + SportsClubsFields => "sports_clubs_fields", + StampAndCoinStores => "stamp_and_coin_stores", + StationaryOfficeSuppliesPrintingAndWritingPaper => { + "stationary_office_supplies_printing_and_writing_paper" + } + StationeryStoresOfficeAndSchoolSupplyStores => { + "stationery_stores_office_and_school_supply_stores" + } + SwimmingPoolsSales => "swimming_pools_sales", + TUiTravelGermany => "t_ui_travel_germany", + TailorsAlterations => "tailors_alterations", + TaxPaymentsGovernmentAgencies => "tax_payments_government_agencies", + TaxPreparationServices => "tax_preparation_services", + TaxicabsLimousines => "taxicabs_limousines", + TelecommunicationEquipmentAndTelephoneSales => { + "telecommunication_equipment_and_telephone_sales" + } + TelecommunicationServices => "telecommunication_services", + TelegraphServices => "telegraph_services", + TentAndAwningShops => "tent_and_awning_shops", + TestingLaboratories => "testing_laboratories", + TheatricalTicketAgencies => "theatrical_ticket_agencies", + Timeshares => "timeshares", + TireRetreadingAndRepair => "tire_retreading_and_repair", + TollsBridgeFees => "tolls_bridge_fees", + TouristAttractionsAndExhibits => "tourist_attractions_and_exhibits", + TowingServices => "towing_services", + TrailerParksCampgrounds => "trailer_parks_campgrounds", + TransportationServices => "transportation_services", + TravelAgenciesTourOperators => "travel_agencies_tour_operators", + TruckStopIteration => "truck_stop_iteration", + TruckUtilityTrailerRentals => "truck_utility_trailer_rentals", + TypesettingPlateMakingAndRelatedServices => { + "typesetting_plate_making_and_related_services" + } + TypewriterStores => "typewriter_stores", + USFederalGovernmentAgenciesOrDepartments => { + "u_s_federal_government_agencies_or_departments" + } + UniformsCommercialClothing => "uniforms_commercial_clothing", + UsedMerchandiseAndSecondhandStores => "used_merchandise_and_secondhand_stores", + Utilities => "utilities", + VarietyStores => "variety_stores", + VeterinaryServices => "veterinary_services", + VideoAmusementGameSupplies => "video_amusement_game_supplies", + VideoGameArcades => "video_game_arcades", + VideoTapeRentalStores => "video_tape_rental_stores", + VocationalTradeSchools => "vocational_trade_schools", + WatchJewelryRepair => "watch_jewelry_repair", + WeldingRepair => "welding_repair", + WholesaleClubs => "wholesale_clubs", + WigAndToupeeStores => "wig_and_toupee_stores", + WiresMoneyOrders => "wires_money_orders", + WomensAccessoryAndSpecialtyShops => "womens_accessory_and_specialty_shops", + WomensReadyToWearStores => "womens_ready_to_wear_stores", + WreckingAndSalvageYards => "wrecking_and_salvage_yards", + Unknown => "unknown", + } + } +} + +impl std::str::FromStr for UpdateIssuingCardSpendingControlsBlockedCategories { + type Err = (); + fn from_str(s: &str) -> Result { + use UpdateIssuingCardSpendingControlsBlockedCategories::*; + match s { + "ac_refrigeration_repair" => Ok(AcRefrigerationRepair), + "accounting_bookkeeping_services" => Ok(AccountingBookkeepingServices), + "advertising_services" => Ok(AdvertisingServices), + "agricultural_cooperative" => Ok(AgriculturalCooperative), + "airlines_air_carriers" => Ok(AirlinesAirCarriers), + "airports_flying_fields" => Ok(AirportsFlyingFields), + "ambulance_services" => Ok(AmbulanceServices), + "amusement_parks_carnivals" => Ok(AmusementParksCarnivals), + "antique_reproductions" => Ok(AntiqueReproductions), + "antique_shops" => Ok(AntiqueShops), + "aquariums" => Ok(Aquariums), + "architectural_surveying_services" => Ok(ArchitecturalSurveyingServices), + "art_dealers_and_galleries" => Ok(ArtDealersAndGalleries), + "artists_supply_and_craft_shops" => Ok(ArtistsSupplyAndCraftShops), + "auto_and_home_supply_stores" => Ok(AutoAndHomeSupplyStores), + "auto_body_repair_shops" => Ok(AutoBodyRepairShops), + "auto_paint_shops" => Ok(AutoPaintShops), + "auto_service_shops" => Ok(AutoServiceShops), + "automated_cash_disburse" => Ok(AutomatedCashDisburse), + "automated_fuel_dispensers" => Ok(AutomatedFuelDispensers), + "automobile_associations" => Ok(AutomobileAssociations), + "automotive_parts_and_accessories_stores" => Ok(AutomotivePartsAndAccessoriesStores), + "automotive_tire_stores" => Ok(AutomotiveTireStores), + "bail_and_bond_payments" => Ok(BailAndBondPayments), + "bakeries" => Ok(Bakeries), + "bands_orchestras" => Ok(BandsOrchestras), + "barber_and_beauty_shops" => Ok(BarberAndBeautyShops), + "betting_casino_gambling" => Ok(BettingCasinoGambling), + "bicycle_shops" => Ok(BicycleShops), + "billiard_pool_establishments" => Ok(BilliardPoolEstablishments), + "boat_dealers" => Ok(BoatDealers), + "boat_rentals_and_leases" => Ok(BoatRentalsAndLeases), + "book_stores" => Ok(BookStores), + "books_periodicals_and_newspapers" => Ok(BooksPeriodicalsAndNewspapers), + "bowling_alleys" => Ok(BowlingAlleys), + "bus_lines" => Ok(BusLines), + "business_secretarial_schools" => Ok(BusinessSecretarialSchools), + "buying_shopping_services" => Ok(BuyingShoppingServices), + "cable_satellite_and_other_pay_television_and_radio" => { + Ok(CableSatelliteAndOtherPayTelevisionAndRadio) + } + "camera_and_photographic_supply_stores" => Ok(CameraAndPhotographicSupplyStores), + "candy_nut_and_confectionery_stores" => Ok(CandyNutAndConfectioneryStores), + "car_and_truck_dealers_new_used" => Ok(CarAndTruckDealersNewUsed), + "car_and_truck_dealers_used_only" => Ok(CarAndTruckDealersUsedOnly), + "car_rental_agencies" => Ok(CarRentalAgencies), + "car_washes" => Ok(CarWashes), + "carpentry_services" => Ok(CarpentryServices), + "carpet_upholstery_cleaning" => Ok(CarpetUpholsteryCleaning), + "caterers" => Ok(Caterers), + "charitable_and_social_service_organizations_fundraising" => { + Ok(CharitableAndSocialServiceOrganizationsFundraising) + } + "chemicals_and_allied_products" => Ok(ChemicalsAndAlliedProducts), + "child_care_services" => Ok(ChildCareServices), + "childrens_and_infants_wear_stores" => Ok(ChildrensAndInfantsWearStores), + "chiropodists_podiatrists" => Ok(ChiropodistsPodiatrists), + "chiropractors" => Ok(Chiropractors), + "cigar_stores_and_stands" => Ok(CigarStoresAndStands), + "civic_social_fraternal_associations" => Ok(CivicSocialFraternalAssociations), + "cleaning_and_maintenance" => Ok(CleaningAndMaintenance), + "clothing_rental" => Ok(ClothingRental), + "colleges_universities" => Ok(CollegesUniversities), + "commercial_equipment" => Ok(CommercialEquipment), + "commercial_footwear" => Ok(CommercialFootwear), + "commercial_photography_art_and_graphics" => Ok(CommercialPhotographyArtAndGraphics), + "commuter_transport_and_ferries" => Ok(CommuterTransportAndFerries), + "computer_network_services" => Ok(ComputerNetworkServices), + "computer_programming" => Ok(ComputerProgramming), + "computer_repair" => Ok(ComputerRepair), + "computer_software_stores" => Ok(ComputerSoftwareStores), + "computers_peripherals_and_software" => Ok(ComputersPeripheralsAndSoftware), + "concrete_work_services" => Ok(ConcreteWorkServices), + "construction_materials" => Ok(ConstructionMaterials), + "consulting_public_relations" => Ok(ConsultingPublicRelations), + "correspondence_schools" => Ok(CorrespondenceSchools), + "cosmetic_stores" => Ok(CosmeticStores), + "counseling_services" => Ok(CounselingServices), + "country_clubs" => Ok(CountryClubs), + "courier_services" => Ok(CourierServices), + "court_costs" => Ok(CourtCosts), + "credit_reporting_agencies" => Ok(CreditReportingAgencies), + "cruise_lines" => Ok(CruiseLines), + "dairy_products_stores" => Ok(DairyProductsStores), + "dance_hall_studios_schools" => Ok(DanceHallStudiosSchools), + "dating_escort_services" => Ok(DatingEscortServices), + "dentists_orthodontists" => Ok(DentistsOrthodontists), + "department_stores" => Ok(DepartmentStores), + "detective_agencies" => Ok(DetectiveAgencies), + "digital_goods_applications" => Ok(DigitalGoodsApplications), + "digital_goods_games" => Ok(DigitalGoodsGames), + "digital_goods_large_volume" => Ok(DigitalGoodsLargeVolume), + "digital_goods_media" => Ok(DigitalGoodsMedia), + "direct_marketing_catalog_merchant" => Ok(DirectMarketingCatalogMerchant), + "direct_marketing_combination_catalog_and_retail_merchant" => { + Ok(DirectMarketingCombinationCatalogAndRetailMerchant) + } + "direct_marketing_inbound_telemarketing" => Ok(DirectMarketingInboundTelemarketing), + "direct_marketing_insurance_services" => Ok(DirectMarketingInsuranceServices), + "direct_marketing_other" => Ok(DirectMarketingOther), + "direct_marketing_outbound_telemarketing" => Ok(DirectMarketingOutboundTelemarketing), + "direct_marketing_subscription" => Ok(DirectMarketingSubscription), + "direct_marketing_travel" => Ok(DirectMarketingTravel), + "discount_stores" => Ok(DiscountStores), + "doctors" => Ok(Doctors), + "door_to_door_sales" => Ok(DoorToDoorSales), + "drapery_window_covering_and_upholstery_stores" => { + Ok(DraperyWindowCoveringAndUpholsteryStores) + } + "drinking_places" => Ok(DrinkingPlaces), + "drug_stores_and_pharmacies" => Ok(DrugStoresAndPharmacies), + "drugs_drug_proprietaries_and_druggist_sundries" => { + Ok(DrugsDrugProprietariesAndDruggistSundries) + } + "dry_cleaners" => Ok(DryCleaners), + "durable_goods" => Ok(DurableGoods), + "duty_free_stores" => Ok(DutyFreeStores), + "eating_places_restaurants" => Ok(EatingPlacesRestaurants), + "educational_services" => Ok(EducationalServices), + "electric_razor_stores" => Ok(ElectricRazorStores), + "electric_vehicle_charging" => Ok(ElectricVehicleCharging), + "electrical_parts_and_equipment" => Ok(ElectricalPartsAndEquipment), + "electrical_services" => Ok(ElectricalServices), + "electronics_repair_shops" => Ok(ElectronicsRepairShops), + "electronics_stores" => Ok(ElectronicsStores), + "elementary_secondary_schools" => Ok(ElementarySecondarySchools), + "emergency_services_gcas_visa_use_only" => Ok(EmergencyServicesGcasVisaUseOnly), + "employment_temp_agencies" => Ok(EmploymentTempAgencies), + "equipment_rental" => Ok(EquipmentRental), + "exterminating_services" => Ok(ExterminatingServices), + "family_clothing_stores" => Ok(FamilyClothingStores), + "fast_food_restaurants" => Ok(FastFoodRestaurants), + "financial_institutions" => Ok(FinancialInstitutions), + "fines_government_administrative_entities" => Ok(FinesGovernmentAdministrativeEntities), + "fireplace_fireplace_screens_and_accessories_stores" => { + Ok(FireplaceFireplaceScreensAndAccessoriesStores) + } + "floor_covering_stores" => Ok(FloorCoveringStores), + "florists" => Ok(Florists), + "florists_supplies_nursery_stock_and_flowers" => { + Ok(FloristsSuppliesNurseryStockAndFlowers) + } + "freezer_and_locker_meat_provisioners" => Ok(FreezerAndLockerMeatProvisioners), + "fuel_dealers_non_automotive" => Ok(FuelDealersNonAutomotive), + "funeral_services_crematories" => Ok(FuneralServicesCrematories), + "furniture_home_furnishings_and_equipment_stores_except_appliances" => { + Ok(FurnitureHomeFurnishingsAndEquipmentStoresExceptAppliances) + } + "furniture_repair_refinishing" => Ok(FurnitureRepairRefinishing), + "furriers_and_fur_shops" => Ok(FurriersAndFurShops), + "general_services" => Ok(GeneralServices), + "gift_card_novelty_and_souvenir_shops" => Ok(GiftCardNoveltyAndSouvenirShops), + "glass_paint_and_wallpaper_stores" => Ok(GlassPaintAndWallpaperStores), + "glassware_crystal_stores" => Ok(GlasswareCrystalStores), + "golf_courses_public" => Ok(GolfCoursesPublic), + "government_licensed_horse_dog_racing_us_region_only" => { + Ok(GovernmentLicensedHorseDogRacingUsRegionOnly) + } + "government_licensed_online_casions_online_gambling_us_region_only" => { + Ok(GovernmentLicensedOnlineCasionsOnlineGamblingUsRegionOnly) + } + "government_owned_lotteries_non_us_region" => Ok(GovernmentOwnedLotteriesNonUsRegion), + "government_owned_lotteries_us_region_only" => Ok(GovernmentOwnedLotteriesUsRegionOnly), + "government_services" => Ok(GovernmentServices), + "grocery_stores_supermarkets" => Ok(GroceryStoresSupermarkets), + "hardware_equipment_and_supplies" => Ok(HardwareEquipmentAndSupplies), + "hardware_stores" => Ok(HardwareStores), + "health_and_beauty_spas" => Ok(HealthAndBeautySpas), + "hearing_aids_sales_and_supplies" => Ok(HearingAidsSalesAndSupplies), + "heating_plumbing_a_c" => Ok(HeatingPlumbingAC), + "hobby_toy_and_game_shops" => Ok(HobbyToyAndGameShops), + "home_supply_warehouse_stores" => Ok(HomeSupplyWarehouseStores), + "hospitals" => Ok(Hospitals), + "hotels_motels_and_resorts" => Ok(HotelsMotelsAndResorts), + "household_appliance_stores" => Ok(HouseholdApplianceStores), + "industrial_supplies" => Ok(IndustrialSupplies), + "information_retrieval_services" => Ok(InformationRetrievalServices), + "insurance_default" => Ok(InsuranceDefault), + "insurance_underwriting_premiums" => Ok(InsuranceUnderwritingPremiums), + "intra_company_purchases" => Ok(IntraCompanyPurchases), + "jewelry_stores_watches_clocks_and_silverware_stores" => { + Ok(JewelryStoresWatchesClocksAndSilverwareStores) + } + "landscaping_services" => Ok(LandscapingServices), + "laundries" => Ok(Laundries), + "laundry_cleaning_services" => Ok(LaundryCleaningServices), + "legal_services_attorneys" => Ok(LegalServicesAttorneys), + "luggage_and_leather_goods_stores" => Ok(LuggageAndLeatherGoodsStores), + "lumber_building_materials_stores" => Ok(LumberBuildingMaterialsStores), + "manual_cash_disburse" => Ok(ManualCashDisburse), + "marinas_service_and_supplies" => Ok(MarinasServiceAndSupplies), + "marketplaces" => Ok(Marketplaces), + "masonry_stonework_and_plaster" => Ok(MasonryStoneworkAndPlaster), + "massage_parlors" => Ok(MassageParlors), + "medical_and_dental_labs" => Ok(MedicalAndDentalLabs), + "medical_dental_ophthalmic_and_hospital_equipment_and_supplies" => { + Ok(MedicalDentalOphthalmicAndHospitalEquipmentAndSupplies) + } + "medical_services" => Ok(MedicalServices), + "membership_organizations" => Ok(MembershipOrganizations), + "mens_and_boys_clothing_and_accessories_stores" => { + Ok(MensAndBoysClothingAndAccessoriesStores) + } + "mens_womens_clothing_stores" => Ok(MensWomensClothingStores), + "metal_service_centers" => Ok(MetalServiceCenters), + "miscellaneous" => Ok(Miscellaneous), + "miscellaneous_apparel_and_accessory_shops" => { + Ok(MiscellaneousApparelAndAccessoryShops) + } + "miscellaneous_auto_dealers" => Ok(MiscellaneousAutoDealers), + "miscellaneous_business_services" => Ok(MiscellaneousBusinessServices), + "miscellaneous_food_stores" => Ok(MiscellaneousFoodStores), + "miscellaneous_general_merchandise" => Ok(MiscellaneousGeneralMerchandise), + "miscellaneous_general_services" => Ok(MiscellaneousGeneralServices), + "miscellaneous_home_furnishing_specialty_stores" => { + Ok(MiscellaneousHomeFurnishingSpecialtyStores) + } + "miscellaneous_publishing_and_printing" => Ok(MiscellaneousPublishingAndPrinting), + "miscellaneous_recreation_services" => Ok(MiscellaneousRecreationServices), + "miscellaneous_repair_shops" => Ok(MiscellaneousRepairShops), + "miscellaneous_specialty_retail" => Ok(MiscellaneousSpecialtyRetail), + "mobile_home_dealers" => Ok(MobileHomeDealers), + "motion_picture_theaters" => Ok(MotionPictureTheaters), + "motor_freight_carriers_and_trucking" => Ok(MotorFreightCarriersAndTrucking), + "motor_homes_dealers" => Ok(MotorHomesDealers), + "motor_vehicle_supplies_and_new_parts" => Ok(MotorVehicleSuppliesAndNewParts), + "motorcycle_shops_and_dealers" => Ok(MotorcycleShopsAndDealers), + "motorcycle_shops_dealers" => Ok(MotorcycleShopsDealers), + "music_stores_musical_instruments_pianos_and_sheet_music" => { + Ok(MusicStoresMusicalInstrumentsPianosAndSheetMusic) + } + "news_dealers_and_newsstands" => Ok(NewsDealersAndNewsstands), + "non_fi_money_orders" => Ok(NonFiMoneyOrders), + "non_fi_stored_value_card_purchase_load" => Ok(NonFiStoredValueCardPurchaseLoad), + "nondurable_goods" => Ok(NondurableGoods), + "nurseries_lawn_and_garden_supply_stores" => Ok(NurseriesLawnAndGardenSupplyStores), + "nursing_personal_care" => Ok(NursingPersonalCare), + "office_and_commercial_furniture" => Ok(OfficeAndCommercialFurniture), + "opticians_eyeglasses" => Ok(OpticiansEyeglasses), + "optometrists_ophthalmologist" => Ok(OptometristsOphthalmologist), + "orthopedic_goods_prosthetic_devices" => Ok(OrthopedicGoodsProstheticDevices), + "osteopaths" => Ok(Osteopaths), + "package_stores_beer_wine_and_liquor" => Ok(PackageStoresBeerWineAndLiquor), + "paints_varnishes_and_supplies" => Ok(PaintsVarnishesAndSupplies), + "parking_lots_garages" => Ok(ParkingLotsGarages), + "passenger_railways" => Ok(PassengerRailways), + "pawn_shops" => Ok(PawnShops), + "pet_shops_pet_food_and_supplies" => Ok(PetShopsPetFoodAndSupplies), + "petroleum_and_petroleum_products" => Ok(PetroleumAndPetroleumProducts), + "photo_developing" => Ok(PhotoDeveloping), + "photographic_photocopy_microfilm_equipment_and_supplies" => { + Ok(PhotographicPhotocopyMicrofilmEquipmentAndSupplies) + } + "photographic_studios" => Ok(PhotographicStudios), + "picture_video_production" => Ok(PictureVideoProduction), + "piece_goods_notions_and_other_dry_goods" => Ok(PieceGoodsNotionsAndOtherDryGoods), + "plumbing_heating_equipment_and_supplies" => Ok(PlumbingHeatingEquipmentAndSupplies), + "political_organizations" => Ok(PoliticalOrganizations), + "postal_services_government_only" => Ok(PostalServicesGovernmentOnly), + "precious_stones_and_metals_watches_and_jewelry" => { + Ok(PreciousStonesAndMetalsWatchesAndJewelry) + } + "professional_services" => Ok(ProfessionalServices), + "public_warehousing_and_storage" => Ok(PublicWarehousingAndStorage), + "quick_copy_repro_and_blueprint" => Ok(QuickCopyReproAndBlueprint), + "railroads" => Ok(Railroads), + "real_estate_agents_and_managers_rentals" => Ok(RealEstateAgentsAndManagersRentals), + "record_stores" => Ok(RecordStores), + "recreational_vehicle_rentals" => Ok(RecreationalVehicleRentals), + "religious_goods_stores" => Ok(ReligiousGoodsStores), + "religious_organizations" => Ok(ReligiousOrganizations), + "roofing_siding_sheet_metal" => Ok(RoofingSidingSheetMetal), + "secretarial_support_services" => Ok(SecretarialSupportServices), + "security_brokers_dealers" => Ok(SecurityBrokersDealers), + "service_stations" => Ok(ServiceStations), + "sewing_needlework_fabric_and_piece_goods_stores" => { + Ok(SewingNeedleworkFabricAndPieceGoodsStores) + } + "shoe_repair_hat_cleaning" => Ok(ShoeRepairHatCleaning), + "shoe_stores" => Ok(ShoeStores), + "small_appliance_repair" => Ok(SmallApplianceRepair), + "snowmobile_dealers" => Ok(SnowmobileDealers), + "special_trade_services" => Ok(SpecialTradeServices), + "specialty_cleaning" => Ok(SpecialtyCleaning), + "sporting_goods_stores" => Ok(SportingGoodsStores), + "sporting_recreation_camps" => Ok(SportingRecreationCamps), + "sports_and_riding_apparel_stores" => Ok(SportsAndRidingApparelStores), + "sports_clubs_fields" => Ok(SportsClubsFields), + "stamp_and_coin_stores" => Ok(StampAndCoinStores), + "stationary_office_supplies_printing_and_writing_paper" => { + Ok(StationaryOfficeSuppliesPrintingAndWritingPaper) + } + "stationery_stores_office_and_school_supply_stores" => { + Ok(StationeryStoresOfficeAndSchoolSupplyStores) + } + "swimming_pools_sales" => Ok(SwimmingPoolsSales), + "t_ui_travel_germany" => Ok(TUiTravelGermany), + "tailors_alterations" => Ok(TailorsAlterations), + "tax_payments_government_agencies" => Ok(TaxPaymentsGovernmentAgencies), + "tax_preparation_services" => Ok(TaxPreparationServices), + "taxicabs_limousines" => Ok(TaxicabsLimousines), + "telecommunication_equipment_and_telephone_sales" => { + Ok(TelecommunicationEquipmentAndTelephoneSales) + } + "telecommunication_services" => Ok(TelecommunicationServices), + "telegraph_services" => Ok(TelegraphServices), + "tent_and_awning_shops" => Ok(TentAndAwningShops), + "testing_laboratories" => Ok(TestingLaboratories), + "theatrical_ticket_agencies" => Ok(TheatricalTicketAgencies), + "timeshares" => Ok(Timeshares), + "tire_retreading_and_repair" => Ok(TireRetreadingAndRepair), + "tolls_bridge_fees" => Ok(TollsBridgeFees), + "tourist_attractions_and_exhibits" => Ok(TouristAttractionsAndExhibits), + "towing_services" => Ok(TowingServices), + "trailer_parks_campgrounds" => Ok(TrailerParksCampgrounds), + "transportation_services" => Ok(TransportationServices), + "travel_agencies_tour_operators" => Ok(TravelAgenciesTourOperators), + "truck_stop_iteration" => Ok(TruckStopIteration), + "truck_utility_trailer_rentals" => Ok(TruckUtilityTrailerRentals), + "typesetting_plate_making_and_related_services" => { + Ok(TypesettingPlateMakingAndRelatedServices) + } + "typewriter_stores" => Ok(TypewriterStores), + "u_s_federal_government_agencies_or_departments" => { + Ok(USFederalGovernmentAgenciesOrDepartments) + } + "uniforms_commercial_clothing" => Ok(UniformsCommercialClothing), + "used_merchandise_and_secondhand_stores" => Ok(UsedMerchandiseAndSecondhandStores), + "utilities" => Ok(Utilities), + "variety_stores" => Ok(VarietyStores), + "veterinary_services" => Ok(VeterinaryServices), + "video_amusement_game_supplies" => Ok(VideoAmusementGameSupplies), + "video_game_arcades" => Ok(VideoGameArcades), + "video_tape_rental_stores" => Ok(VideoTapeRentalStores), + "vocational_trade_schools" => Ok(VocationalTradeSchools), + "watch_jewelry_repair" => Ok(WatchJewelryRepair), + "welding_repair" => Ok(WeldingRepair), + "wholesale_clubs" => Ok(WholesaleClubs), + "wig_and_toupee_stores" => Ok(WigAndToupeeStores), + "wires_money_orders" => Ok(WiresMoneyOrders), + "womens_accessory_and_specialty_shops" => Ok(WomensAccessoryAndSpecialtyShops), + "womens_ready_to_wear_stores" => Ok(WomensReadyToWearStores), + "wrecking_and_salvage_yards" => Ok(WreckingAndSalvageYards), + _ => Err(()), + } + } +} +impl std::fmt::Display for UpdateIssuingCardSpendingControlsBlockedCategories { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for UpdateIssuingCardSpendingControlsBlockedCategories { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for UpdateIssuingCardSpendingControlsBlockedCategories { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Limit spending with amount-based rules that apply across any cards this card replaced (i.e., its `replacement_for` card and _that_ card's `replacement_for` card, up the chain). +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct UpdateIssuingCardSpendingControlsSpendingLimits<'a> { + /// Maximum amount allowed to spend per interval. + pub amount: i64, + /// Array of strings containing [categories](https://stripe.com/docs/api#issuing_authorization_object-merchant_data-category) this limit applies to. + /// Omitting this field will apply the limit to all categories. + #[serde(skip_serializing_if = "Option::is_none")] + pub categories: Option<&'a [UpdateIssuingCardSpendingControlsSpendingLimitsCategories]>, + /// Interval (or event) to which the amount applies. + pub interval: UpdateIssuingCardSpendingControlsSpendingLimitsInterval, +} +impl<'a> UpdateIssuingCardSpendingControlsSpendingLimits<'a> { + pub fn new( + amount: i64, + interval: UpdateIssuingCardSpendingControlsSpendingLimitsInterval, + ) -> Self { + Self { amount, categories: None, interval } + } +} +/// Array of strings containing [categories](https://stripe.com/docs/api#issuing_authorization_object-merchant_data-category) this limit applies to. +/// Omitting this field will apply the limit to all categories. +#[derive(Copy, Clone, Eq, PartialEq)] +#[non_exhaustive] +pub enum UpdateIssuingCardSpendingControlsSpendingLimitsCategories { + AcRefrigerationRepair, + AccountingBookkeepingServices, + AdvertisingServices, + AgriculturalCooperative, + AirlinesAirCarriers, + AirportsFlyingFields, + AmbulanceServices, + AmusementParksCarnivals, + AntiqueReproductions, + AntiqueShops, + Aquariums, + ArchitecturalSurveyingServices, + ArtDealersAndGalleries, + ArtistsSupplyAndCraftShops, + AutoAndHomeSupplyStores, + AutoBodyRepairShops, + AutoPaintShops, + AutoServiceShops, + AutomatedCashDisburse, + AutomatedFuelDispensers, + AutomobileAssociations, + AutomotivePartsAndAccessoriesStores, + AutomotiveTireStores, + BailAndBondPayments, + Bakeries, + BandsOrchestras, + BarberAndBeautyShops, + BettingCasinoGambling, + BicycleShops, + BilliardPoolEstablishments, + BoatDealers, + BoatRentalsAndLeases, + BookStores, + BooksPeriodicalsAndNewspapers, + BowlingAlleys, + BusLines, + BusinessSecretarialSchools, + BuyingShoppingServices, + CableSatelliteAndOtherPayTelevisionAndRadio, + CameraAndPhotographicSupplyStores, + CandyNutAndConfectioneryStores, + CarAndTruckDealersNewUsed, + CarAndTruckDealersUsedOnly, + CarRentalAgencies, + CarWashes, + CarpentryServices, + CarpetUpholsteryCleaning, + Caterers, + CharitableAndSocialServiceOrganizationsFundraising, + ChemicalsAndAlliedProducts, + ChildCareServices, + ChildrensAndInfantsWearStores, + ChiropodistsPodiatrists, + Chiropractors, + CigarStoresAndStands, + CivicSocialFraternalAssociations, + CleaningAndMaintenance, + ClothingRental, + CollegesUniversities, + CommercialEquipment, + CommercialFootwear, + CommercialPhotographyArtAndGraphics, + CommuterTransportAndFerries, + ComputerNetworkServices, + ComputerProgramming, + ComputerRepair, + ComputerSoftwareStores, + ComputersPeripheralsAndSoftware, + ConcreteWorkServices, + ConstructionMaterials, + ConsultingPublicRelations, + CorrespondenceSchools, + CosmeticStores, + CounselingServices, + CountryClubs, + CourierServices, + CourtCosts, + CreditReportingAgencies, + CruiseLines, + DairyProductsStores, + DanceHallStudiosSchools, + DatingEscortServices, + DentistsOrthodontists, + DepartmentStores, + DetectiveAgencies, + DigitalGoodsApplications, + DigitalGoodsGames, + DigitalGoodsLargeVolume, + DigitalGoodsMedia, + DirectMarketingCatalogMerchant, + DirectMarketingCombinationCatalogAndRetailMerchant, + DirectMarketingInboundTelemarketing, + DirectMarketingInsuranceServices, + DirectMarketingOther, + DirectMarketingOutboundTelemarketing, + DirectMarketingSubscription, + DirectMarketingTravel, + DiscountStores, + Doctors, + DoorToDoorSales, + DraperyWindowCoveringAndUpholsteryStores, + DrinkingPlaces, + DrugStoresAndPharmacies, + DrugsDrugProprietariesAndDruggistSundries, + DryCleaners, + DurableGoods, + DutyFreeStores, + EatingPlacesRestaurants, + EducationalServices, + ElectricRazorStores, + ElectricVehicleCharging, + ElectricalPartsAndEquipment, + ElectricalServices, + ElectronicsRepairShops, + ElectronicsStores, + ElementarySecondarySchools, + EmergencyServicesGcasVisaUseOnly, + EmploymentTempAgencies, + EquipmentRental, + ExterminatingServices, + FamilyClothingStores, + FastFoodRestaurants, + FinancialInstitutions, + FinesGovernmentAdministrativeEntities, + FireplaceFireplaceScreensAndAccessoriesStores, + FloorCoveringStores, + Florists, + FloristsSuppliesNurseryStockAndFlowers, + FreezerAndLockerMeatProvisioners, + FuelDealersNonAutomotive, + FuneralServicesCrematories, + FurnitureHomeFurnishingsAndEquipmentStoresExceptAppliances, + FurnitureRepairRefinishing, + FurriersAndFurShops, + GeneralServices, + GiftCardNoveltyAndSouvenirShops, + GlassPaintAndWallpaperStores, + GlasswareCrystalStores, + GolfCoursesPublic, + GovernmentLicensedHorseDogRacingUsRegionOnly, + GovernmentLicensedOnlineCasionsOnlineGamblingUsRegionOnly, + GovernmentOwnedLotteriesNonUsRegion, + GovernmentOwnedLotteriesUsRegionOnly, + GovernmentServices, + GroceryStoresSupermarkets, + HardwareEquipmentAndSupplies, + HardwareStores, + HealthAndBeautySpas, + HearingAidsSalesAndSupplies, + HeatingPlumbingAC, + HobbyToyAndGameShops, + HomeSupplyWarehouseStores, + Hospitals, + HotelsMotelsAndResorts, + HouseholdApplianceStores, + IndustrialSupplies, + InformationRetrievalServices, + InsuranceDefault, + InsuranceUnderwritingPremiums, + IntraCompanyPurchases, + JewelryStoresWatchesClocksAndSilverwareStores, + LandscapingServices, + Laundries, + LaundryCleaningServices, + LegalServicesAttorneys, + LuggageAndLeatherGoodsStores, + LumberBuildingMaterialsStores, + ManualCashDisburse, + MarinasServiceAndSupplies, + Marketplaces, + MasonryStoneworkAndPlaster, + MassageParlors, + MedicalAndDentalLabs, + MedicalDentalOphthalmicAndHospitalEquipmentAndSupplies, + MedicalServices, + MembershipOrganizations, + MensAndBoysClothingAndAccessoriesStores, + MensWomensClothingStores, + MetalServiceCenters, + Miscellaneous, + MiscellaneousApparelAndAccessoryShops, + MiscellaneousAutoDealers, + MiscellaneousBusinessServices, + MiscellaneousFoodStores, + MiscellaneousGeneralMerchandise, + MiscellaneousGeneralServices, + MiscellaneousHomeFurnishingSpecialtyStores, + MiscellaneousPublishingAndPrinting, + MiscellaneousRecreationServices, + MiscellaneousRepairShops, + MiscellaneousSpecialtyRetail, + MobileHomeDealers, + MotionPictureTheaters, + MotorFreightCarriersAndTrucking, + MotorHomesDealers, + MotorVehicleSuppliesAndNewParts, + MotorcycleShopsAndDealers, + MotorcycleShopsDealers, + MusicStoresMusicalInstrumentsPianosAndSheetMusic, + NewsDealersAndNewsstands, + NonFiMoneyOrders, + NonFiStoredValueCardPurchaseLoad, + NondurableGoods, + NurseriesLawnAndGardenSupplyStores, + NursingPersonalCare, + OfficeAndCommercialFurniture, + OpticiansEyeglasses, + OptometristsOphthalmologist, + OrthopedicGoodsProstheticDevices, + Osteopaths, + PackageStoresBeerWineAndLiquor, + PaintsVarnishesAndSupplies, + ParkingLotsGarages, + PassengerRailways, + PawnShops, + PetShopsPetFoodAndSupplies, + PetroleumAndPetroleumProducts, + PhotoDeveloping, + PhotographicPhotocopyMicrofilmEquipmentAndSupplies, + PhotographicStudios, + PictureVideoProduction, + PieceGoodsNotionsAndOtherDryGoods, + PlumbingHeatingEquipmentAndSupplies, + PoliticalOrganizations, + PostalServicesGovernmentOnly, + PreciousStonesAndMetalsWatchesAndJewelry, + ProfessionalServices, + PublicWarehousingAndStorage, + QuickCopyReproAndBlueprint, + Railroads, + RealEstateAgentsAndManagersRentals, + RecordStores, + RecreationalVehicleRentals, + ReligiousGoodsStores, + ReligiousOrganizations, + RoofingSidingSheetMetal, + SecretarialSupportServices, + SecurityBrokersDealers, + ServiceStations, + SewingNeedleworkFabricAndPieceGoodsStores, + ShoeRepairHatCleaning, + ShoeStores, + SmallApplianceRepair, + SnowmobileDealers, + SpecialTradeServices, + SpecialtyCleaning, + SportingGoodsStores, + SportingRecreationCamps, + SportsAndRidingApparelStores, + SportsClubsFields, + StampAndCoinStores, + StationaryOfficeSuppliesPrintingAndWritingPaper, + StationeryStoresOfficeAndSchoolSupplyStores, + SwimmingPoolsSales, + TUiTravelGermany, + TailorsAlterations, + TaxPaymentsGovernmentAgencies, + TaxPreparationServices, + TaxicabsLimousines, + TelecommunicationEquipmentAndTelephoneSales, + TelecommunicationServices, + TelegraphServices, + TentAndAwningShops, + TestingLaboratories, + TheatricalTicketAgencies, + Timeshares, + TireRetreadingAndRepair, + TollsBridgeFees, + TouristAttractionsAndExhibits, + TowingServices, + TrailerParksCampgrounds, + TransportationServices, + TravelAgenciesTourOperators, + TruckStopIteration, + TruckUtilityTrailerRentals, + TypesettingPlateMakingAndRelatedServices, + TypewriterStores, + USFederalGovernmentAgenciesOrDepartments, + UniformsCommercialClothing, + UsedMerchandiseAndSecondhandStores, + Utilities, + VarietyStores, + VeterinaryServices, + VideoAmusementGameSupplies, + VideoGameArcades, + VideoTapeRentalStores, + VocationalTradeSchools, + WatchJewelryRepair, + WeldingRepair, + WholesaleClubs, + WigAndToupeeStores, + WiresMoneyOrders, + WomensAccessoryAndSpecialtyShops, + WomensReadyToWearStores, + WreckingAndSalvageYards, + /// An unrecognized value from Stripe. Should not be used as a request parameter. + Unknown, +} +impl UpdateIssuingCardSpendingControlsSpendingLimitsCategories { + pub fn as_str(self) -> &'static str { + use UpdateIssuingCardSpendingControlsSpendingLimitsCategories::*; + match self { + AcRefrigerationRepair => "ac_refrigeration_repair", + AccountingBookkeepingServices => "accounting_bookkeeping_services", + AdvertisingServices => "advertising_services", + AgriculturalCooperative => "agricultural_cooperative", + AirlinesAirCarriers => "airlines_air_carriers", + AirportsFlyingFields => "airports_flying_fields", + AmbulanceServices => "ambulance_services", + AmusementParksCarnivals => "amusement_parks_carnivals", + AntiqueReproductions => "antique_reproductions", + AntiqueShops => "antique_shops", + Aquariums => "aquariums", + ArchitecturalSurveyingServices => "architectural_surveying_services", + ArtDealersAndGalleries => "art_dealers_and_galleries", + ArtistsSupplyAndCraftShops => "artists_supply_and_craft_shops", + AutoAndHomeSupplyStores => "auto_and_home_supply_stores", + AutoBodyRepairShops => "auto_body_repair_shops", + AutoPaintShops => "auto_paint_shops", + AutoServiceShops => "auto_service_shops", + AutomatedCashDisburse => "automated_cash_disburse", + AutomatedFuelDispensers => "automated_fuel_dispensers", + AutomobileAssociations => "automobile_associations", + AutomotivePartsAndAccessoriesStores => "automotive_parts_and_accessories_stores", + AutomotiveTireStores => "automotive_tire_stores", + BailAndBondPayments => "bail_and_bond_payments", + Bakeries => "bakeries", + BandsOrchestras => "bands_orchestras", + BarberAndBeautyShops => "barber_and_beauty_shops", + BettingCasinoGambling => "betting_casino_gambling", + BicycleShops => "bicycle_shops", + BilliardPoolEstablishments => "billiard_pool_establishments", + BoatDealers => "boat_dealers", + BoatRentalsAndLeases => "boat_rentals_and_leases", + BookStores => "book_stores", + BooksPeriodicalsAndNewspapers => "books_periodicals_and_newspapers", + BowlingAlleys => "bowling_alleys", + BusLines => "bus_lines", + BusinessSecretarialSchools => "business_secretarial_schools", + BuyingShoppingServices => "buying_shopping_services", + CableSatelliteAndOtherPayTelevisionAndRadio => { + "cable_satellite_and_other_pay_television_and_radio" + } + CameraAndPhotographicSupplyStores => "camera_and_photographic_supply_stores", + CandyNutAndConfectioneryStores => "candy_nut_and_confectionery_stores", + CarAndTruckDealersNewUsed => "car_and_truck_dealers_new_used", + CarAndTruckDealersUsedOnly => "car_and_truck_dealers_used_only", + CarRentalAgencies => "car_rental_agencies", + CarWashes => "car_washes", + CarpentryServices => "carpentry_services", + CarpetUpholsteryCleaning => "carpet_upholstery_cleaning", + Caterers => "caterers", + CharitableAndSocialServiceOrganizationsFundraising => { + "charitable_and_social_service_organizations_fundraising" + } + ChemicalsAndAlliedProducts => "chemicals_and_allied_products", + ChildCareServices => "child_care_services", + ChildrensAndInfantsWearStores => "childrens_and_infants_wear_stores", + ChiropodistsPodiatrists => "chiropodists_podiatrists", + Chiropractors => "chiropractors", + CigarStoresAndStands => "cigar_stores_and_stands", + CivicSocialFraternalAssociations => "civic_social_fraternal_associations", + CleaningAndMaintenance => "cleaning_and_maintenance", + ClothingRental => "clothing_rental", + CollegesUniversities => "colleges_universities", + CommercialEquipment => "commercial_equipment", + CommercialFootwear => "commercial_footwear", + CommercialPhotographyArtAndGraphics => "commercial_photography_art_and_graphics", + CommuterTransportAndFerries => "commuter_transport_and_ferries", + ComputerNetworkServices => "computer_network_services", + ComputerProgramming => "computer_programming", + ComputerRepair => "computer_repair", + ComputerSoftwareStores => "computer_software_stores", + ComputersPeripheralsAndSoftware => "computers_peripherals_and_software", + ConcreteWorkServices => "concrete_work_services", + ConstructionMaterials => "construction_materials", + ConsultingPublicRelations => "consulting_public_relations", + CorrespondenceSchools => "correspondence_schools", + CosmeticStores => "cosmetic_stores", + CounselingServices => "counseling_services", + CountryClubs => "country_clubs", + CourierServices => "courier_services", + CourtCosts => "court_costs", + CreditReportingAgencies => "credit_reporting_agencies", + CruiseLines => "cruise_lines", + DairyProductsStores => "dairy_products_stores", + DanceHallStudiosSchools => "dance_hall_studios_schools", + DatingEscortServices => "dating_escort_services", + DentistsOrthodontists => "dentists_orthodontists", + DepartmentStores => "department_stores", + DetectiveAgencies => "detective_agencies", + DigitalGoodsApplications => "digital_goods_applications", + DigitalGoodsGames => "digital_goods_games", + DigitalGoodsLargeVolume => "digital_goods_large_volume", + DigitalGoodsMedia => "digital_goods_media", + DirectMarketingCatalogMerchant => "direct_marketing_catalog_merchant", + DirectMarketingCombinationCatalogAndRetailMerchant => { + "direct_marketing_combination_catalog_and_retail_merchant" + } + DirectMarketingInboundTelemarketing => "direct_marketing_inbound_telemarketing", + DirectMarketingInsuranceServices => "direct_marketing_insurance_services", + DirectMarketingOther => "direct_marketing_other", + DirectMarketingOutboundTelemarketing => "direct_marketing_outbound_telemarketing", + DirectMarketingSubscription => "direct_marketing_subscription", + DirectMarketingTravel => "direct_marketing_travel", + DiscountStores => "discount_stores", + Doctors => "doctors", + DoorToDoorSales => "door_to_door_sales", + DraperyWindowCoveringAndUpholsteryStores => { + "drapery_window_covering_and_upholstery_stores" + } + DrinkingPlaces => "drinking_places", + DrugStoresAndPharmacies => "drug_stores_and_pharmacies", + DrugsDrugProprietariesAndDruggistSundries => { + "drugs_drug_proprietaries_and_druggist_sundries" + } + DryCleaners => "dry_cleaners", + DurableGoods => "durable_goods", + DutyFreeStores => "duty_free_stores", + EatingPlacesRestaurants => "eating_places_restaurants", + EducationalServices => "educational_services", + ElectricRazorStores => "electric_razor_stores", + ElectricVehicleCharging => "electric_vehicle_charging", + ElectricalPartsAndEquipment => "electrical_parts_and_equipment", + ElectricalServices => "electrical_services", + ElectronicsRepairShops => "electronics_repair_shops", + ElectronicsStores => "electronics_stores", + ElementarySecondarySchools => "elementary_secondary_schools", + EmergencyServicesGcasVisaUseOnly => "emergency_services_gcas_visa_use_only", + EmploymentTempAgencies => "employment_temp_agencies", + EquipmentRental => "equipment_rental", + ExterminatingServices => "exterminating_services", + FamilyClothingStores => "family_clothing_stores", + FastFoodRestaurants => "fast_food_restaurants", + FinancialInstitutions => "financial_institutions", + FinesGovernmentAdministrativeEntities => "fines_government_administrative_entities", + FireplaceFireplaceScreensAndAccessoriesStores => { + "fireplace_fireplace_screens_and_accessories_stores" + } + FloorCoveringStores => "floor_covering_stores", + Florists => "florists", + FloristsSuppliesNurseryStockAndFlowers => "florists_supplies_nursery_stock_and_flowers", + FreezerAndLockerMeatProvisioners => "freezer_and_locker_meat_provisioners", + FuelDealersNonAutomotive => "fuel_dealers_non_automotive", + FuneralServicesCrematories => "funeral_services_crematories", + FurnitureHomeFurnishingsAndEquipmentStoresExceptAppliances => { + "furniture_home_furnishings_and_equipment_stores_except_appliances" + } + FurnitureRepairRefinishing => "furniture_repair_refinishing", + FurriersAndFurShops => "furriers_and_fur_shops", + GeneralServices => "general_services", + GiftCardNoveltyAndSouvenirShops => "gift_card_novelty_and_souvenir_shops", + GlassPaintAndWallpaperStores => "glass_paint_and_wallpaper_stores", + GlasswareCrystalStores => "glassware_crystal_stores", + GolfCoursesPublic => "golf_courses_public", + GovernmentLicensedHorseDogRacingUsRegionOnly => { + "government_licensed_horse_dog_racing_us_region_only" + } + GovernmentLicensedOnlineCasionsOnlineGamblingUsRegionOnly => { + "government_licensed_online_casions_online_gambling_us_region_only" + } + GovernmentOwnedLotteriesNonUsRegion => "government_owned_lotteries_non_us_region", + GovernmentOwnedLotteriesUsRegionOnly => "government_owned_lotteries_us_region_only", + GovernmentServices => "government_services", + GroceryStoresSupermarkets => "grocery_stores_supermarkets", + HardwareEquipmentAndSupplies => "hardware_equipment_and_supplies", + HardwareStores => "hardware_stores", + HealthAndBeautySpas => "health_and_beauty_spas", + HearingAidsSalesAndSupplies => "hearing_aids_sales_and_supplies", + HeatingPlumbingAC => "heating_plumbing_a_c", + HobbyToyAndGameShops => "hobby_toy_and_game_shops", + HomeSupplyWarehouseStores => "home_supply_warehouse_stores", + Hospitals => "hospitals", + HotelsMotelsAndResorts => "hotels_motels_and_resorts", + HouseholdApplianceStores => "household_appliance_stores", + IndustrialSupplies => "industrial_supplies", + InformationRetrievalServices => "information_retrieval_services", + InsuranceDefault => "insurance_default", + InsuranceUnderwritingPremiums => "insurance_underwriting_premiums", + IntraCompanyPurchases => "intra_company_purchases", + JewelryStoresWatchesClocksAndSilverwareStores => { + "jewelry_stores_watches_clocks_and_silverware_stores" + } + LandscapingServices => "landscaping_services", + Laundries => "laundries", + LaundryCleaningServices => "laundry_cleaning_services", + LegalServicesAttorneys => "legal_services_attorneys", + LuggageAndLeatherGoodsStores => "luggage_and_leather_goods_stores", + LumberBuildingMaterialsStores => "lumber_building_materials_stores", + ManualCashDisburse => "manual_cash_disburse", + MarinasServiceAndSupplies => "marinas_service_and_supplies", + Marketplaces => "marketplaces", + MasonryStoneworkAndPlaster => "masonry_stonework_and_plaster", + MassageParlors => "massage_parlors", + MedicalAndDentalLabs => "medical_and_dental_labs", + MedicalDentalOphthalmicAndHospitalEquipmentAndSupplies => { + "medical_dental_ophthalmic_and_hospital_equipment_and_supplies" + } + MedicalServices => "medical_services", + MembershipOrganizations => "membership_organizations", + MensAndBoysClothingAndAccessoriesStores => { + "mens_and_boys_clothing_and_accessories_stores" + } + MensWomensClothingStores => "mens_womens_clothing_stores", + MetalServiceCenters => "metal_service_centers", + Miscellaneous => "miscellaneous", + MiscellaneousApparelAndAccessoryShops => "miscellaneous_apparel_and_accessory_shops", + MiscellaneousAutoDealers => "miscellaneous_auto_dealers", + MiscellaneousBusinessServices => "miscellaneous_business_services", + MiscellaneousFoodStores => "miscellaneous_food_stores", + MiscellaneousGeneralMerchandise => "miscellaneous_general_merchandise", + MiscellaneousGeneralServices => "miscellaneous_general_services", + MiscellaneousHomeFurnishingSpecialtyStores => { + "miscellaneous_home_furnishing_specialty_stores" + } + MiscellaneousPublishingAndPrinting => "miscellaneous_publishing_and_printing", + MiscellaneousRecreationServices => "miscellaneous_recreation_services", + MiscellaneousRepairShops => "miscellaneous_repair_shops", + MiscellaneousSpecialtyRetail => "miscellaneous_specialty_retail", + MobileHomeDealers => "mobile_home_dealers", + MotionPictureTheaters => "motion_picture_theaters", + MotorFreightCarriersAndTrucking => "motor_freight_carriers_and_trucking", + MotorHomesDealers => "motor_homes_dealers", + MotorVehicleSuppliesAndNewParts => "motor_vehicle_supplies_and_new_parts", + MotorcycleShopsAndDealers => "motorcycle_shops_and_dealers", + MotorcycleShopsDealers => "motorcycle_shops_dealers", + MusicStoresMusicalInstrumentsPianosAndSheetMusic => { + "music_stores_musical_instruments_pianos_and_sheet_music" + } + NewsDealersAndNewsstands => "news_dealers_and_newsstands", + NonFiMoneyOrders => "non_fi_money_orders", + NonFiStoredValueCardPurchaseLoad => "non_fi_stored_value_card_purchase_load", + NondurableGoods => "nondurable_goods", + NurseriesLawnAndGardenSupplyStores => "nurseries_lawn_and_garden_supply_stores", + NursingPersonalCare => "nursing_personal_care", + OfficeAndCommercialFurniture => "office_and_commercial_furniture", + OpticiansEyeglasses => "opticians_eyeglasses", + OptometristsOphthalmologist => "optometrists_ophthalmologist", + OrthopedicGoodsProstheticDevices => "orthopedic_goods_prosthetic_devices", + Osteopaths => "osteopaths", + PackageStoresBeerWineAndLiquor => "package_stores_beer_wine_and_liquor", + PaintsVarnishesAndSupplies => "paints_varnishes_and_supplies", + ParkingLotsGarages => "parking_lots_garages", + PassengerRailways => "passenger_railways", + PawnShops => "pawn_shops", + PetShopsPetFoodAndSupplies => "pet_shops_pet_food_and_supplies", + PetroleumAndPetroleumProducts => "petroleum_and_petroleum_products", + PhotoDeveloping => "photo_developing", + PhotographicPhotocopyMicrofilmEquipmentAndSupplies => { + "photographic_photocopy_microfilm_equipment_and_supplies" + } + PhotographicStudios => "photographic_studios", + PictureVideoProduction => "picture_video_production", + PieceGoodsNotionsAndOtherDryGoods => "piece_goods_notions_and_other_dry_goods", + PlumbingHeatingEquipmentAndSupplies => "plumbing_heating_equipment_and_supplies", + PoliticalOrganizations => "political_organizations", + PostalServicesGovernmentOnly => "postal_services_government_only", + PreciousStonesAndMetalsWatchesAndJewelry => { + "precious_stones_and_metals_watches_and_jewelry" + } + ProfessionalServices => "professional_services", + PublicWarehousingAndStorage => "public_warehousing_and_storage", + QuickCopyReproAndBlueprint => "quick_copy_repro_and_blueprint", + Railroads => "railroads", + RealEstateAgentsAndManagersRentals => "real_estate_agents_and_managers_rentals", + RecordStores => "record_stores", + RecreationalVehicleRentals => "recreational_vehicle_rentals", + ReligiousGoodsStores => "religious_goods_stores", + ReligiousOrganizations => "religious_organizations", + RoofingSidingSheetMetal => "roofing_siding_sheet_metal", + SecretarialSupportServices => "secretarial_support_services", + SecurityBrokersDealers => "security_brokers_dealers", + ServiceStations => "service_stations", + SewingNeedleworkFabricAndPieceGoodsStores => { + "sewing_needlework_fabric_and_piece_goods_stores" + } + ShoeRepairHatCleaning => "shoe_repair_hat_cleaning", + ShoeStores => "shoe_stores", + SmallApplianceRepair => "small_appliance_repair", + SnowmobileDealers => "snowmobile_dealers", + SpecialTradeServices => "special_trade_services", + SpecialtyCleaning => "specialty_cleaning", + SportingGoodsStores => "sporting_goods_stores", + SportingRecreationCamps => "sporting_recreation_camps", + SportsAndRidingApparelStores => "sports_and_riding_apparel_stores", + SportsClubsFields => "sports_clubs_fields", + StampAndCoinStores => "stamp_and_coin_stores", + StationaryOfficeSuppliesPrintingAndWritingPaper => { + "stationary_office_supplies_printing_and_writing_paper" + } + StationeryStoresOfficeAndSchoolSupplyStores => { + "stationery_stores_office_and_school_supply_stores" + } + SwimmingPoolsSales => "swimming_pools_sales", + TUiTravelGermany => "t_ui_travel_germany", + TailorsAlterations => "tailors_alterations", + TaxPaymentsGovernmentAgencies => "tax_payments_government_agencies", + TaxPreparationServices => "tax_preparation_services", + TaxicabsLimousines => "taxicabs_limousines", + TelecommunicationEquipmentAndTelephoneSales => { + "telecommunication_equipment_and_telephone_sales" + } + TelecommunicationServices => "telecommunication_services", + TelegraphServices => "telegraph_services", + TentAndAwningShops => "tent_and_awning_shops", + TestingLaboratories => "testing_laboratories", + TheatricalTicketAgencies => "theatrical_ticket_agencies", + Timeshares => "timeshares", + TireRetreadingAndRepair => "tire_retreading_and_repair", + TollsBridgeFees => "tolls_bridge_fees", + TouristAttractionsAndExhibits => "tourist_attractions_and_exhibits", + TowingServices => "towing_services", + TrailerParksCampgrounds => "trailer_parks_campgrounds", + TransportationServices => "transportation_services", + TravelAgenciesTourOperators => "travel_agencies_tour_operators", + TruckStopIteration => "truck_stop_iteration", + TruckUtilityTrailerRentals => "truck_utility_trailer_rentals", + TypesettingPlateMakingAndRelatedServices => { + "typesetting_plate_making_and_related_services" + } + TypewriterStores => "typewriter_stores", + USFederalGovernmentAgenciesOrDepartments => { + "u_s_federal_government_agencies_or_departments" + } + UniformsCommercialClothing => "uniforms_commercial_clothing", + UsedMerchandiseAndSecondhandStores => "used_merchandise_and_secondhand_stores", + Utilities => "utilities", + VarietyStores => "variety_stores", + VeterinaryServices => "veterinary_services", + VideoAmusementGameSupplies => "video_amusement_game_supplies", + VideoGameArcades => "video_game_arcades", + VideoTapeRentalStores => "video_tape_rental_stores", + VocationalTradeSchools => "vocational_trade_schools", + WatchJewelryRepair => "watch_jewelry_repair", + WeldingRepair => "welding_repair", + WholesaleClubs => "wholesale_clubs", + WigAndToupeeStores => "wig_and_toupee_stores", + WiresMoneyOrders => "wires_money_orders", + WomensAccessoryAndSpecialtyShops => "womens_accessory_and_specialty_shops", + WomensReadyToWearStores => "womens_ready_to_wear_stores", + WreckingAndSalvageYards => "wrecking_and_salvage_yards", + Unknown => "unknown", + } + } +} + +impl std::str::FromStr for UpdateIssuingCardSpendingControlsSpendingLimitsCategories { + type Err = (); + fn from_str(s: &str) -> Result { + use UpdateIssuingCardSpendingControlsSpendingLimitsCategories::*; + match s { + "ac_refrigeration_repair" => Ok(AcRefrigerationRepair), + "accounting_bookkeeping_services" => Ok(AccountingBookkeepingServices), + "advertising_services" => Ok(AdvertisingServices), + "agricultural_cooperative" => Ok(AgriculturalCooperative), + "airlines_air_carriers" => Ok(AirlinesAirCarriers), + "airports_flying_fields" => Ok(AirportsFlyingFields), + "ambulance_services" => Ok(AmbulanceServices), + "amusement_parks_carnivals" => Ok(AmusementParksCarnivals), + "antique_reproductions" => Ok(AntiqueReproductions), + "antique_shops" => Ok(AntiqueShops), + "aquariums" => Ok(Aquariums), + "architectural_surveying_services" => Ok(ArchitecturalSurveyingServices), + "art_dealers_and_galleries" => Ok(ArtDealersAndGalleries), + "artists_supply_and_craft_shops" => Ok(ArtistsSupplyAndCraftShops), + "auto_and_home_supply_stores" => Ok(AutoAndHomeSupplyStores), + "auto_body_repair_shops" => Ok(AutoBodyRepairShops), + "auto_paint_shops" => Ok(AutoPaintShops), + "auto_service_shops" => Ok(AutoServiceShops), + "automated_cash_disburse" => Ok(AutomatedCashDisburse), + "automated_fuel_dispensers" => Ok(AutomatedFuelDispensers), + "automobile_associations" => Ok(AutomobileAssociations), + "automotive_parts_and_accessories_stores" => Ok(AutomotivePartsAndAccessoriesStores), + "automotive_tire_stores" => Ok(AutomotiveTireStores), + "bail_and_bond_payments" => Ok(BailAndBondPayments), + "bakeries" => Ok(Bakeries), + "bands_orchestras" => Ok(BandsOrchestras), + "barber_and_beauty_shops" => Ok(BarberAndBeautyShops), + "betting_casino_gambling" => Ok(BettingCasinoGambling), + "bicycle_shops" => Ok(BicycleShops), + "billiard_pool_establishments" => Ok(BilliardPoolEstablishments), + "boat_dealers" => Ok(BoatDealers), + "boat_rentals_and_leases" => Ok(BoatRentalsAndLeases), + "book_stores" => Ok(BookStores), + "books_periodicals_and_newspapers" => Ok(BooksPeriodicalsAndNewspapers), + "bowling_alleys" => Ok(BowlingAlleys), + "bus_lines" => Ok(BusLines), + "business_secretarial_schools" => Ok(BusinessSecretarialSchools), + "buying_shopping_services" => Ok(BuyingShoppingServices), + "cable_satellite_and_other_pay_television_and_radio" => { + Ok(CableSatelliteAndOtherPayTelevisionAndRadio) + } + "camera_and_photographic_supply_stores" => Ok(CameraAndPhotographicSupplyStores), + "candy_nut_and_confectionery_stores" => Ok(CandyNutAndConfectioneryStores), + "car_and_truck_dealers_new_used" => Ok(CarAndTruckDealersNewUsed), + "car_and_truck_dealers_used_only" => Ok(CarAndTruckDealersUsedOnly), + "car_rental_agencies" => Ok(CarRentalAgencies), + "car_washes" => Ok(CarWashes), + "carpentry_services" => Ok(CarpentryServices), + "carpet_upholstery_cleaning" => Ok(CarpetUpholsteryCleaning), + "caterers" => Ok(Caterers), + "charitable_and_social_service_organizations_fundraising" => { + Ok(CharitableAndSocialServiceOrganizationsFundraising) + } + "chemicals_and_allied_products" => Ok(ChemicalsAndAlliedProducts), + "child_care_services" => Ok(ChildCareServices), + "childrens_and_infants_wear_stores" => Ok(ChildrensAndInfantsWearStores), + "chiropodists_podiatrists" => Ok(ChiropodistsPodiatrists), + "chiropractors" => Ok(Chiropractors), + "cigar_stores_and_stands" => Ok(CigarStoresAndStands), + "civic_social_fraternal_associations" => Ok(CivicSocialFraternalAssociations), + "cleaning_and_maintenance" => Ok(CleaningAndMaintenance), + "clothing_rental" => Ok(ClothingRental), + "colleges_universities" => Ok(CollegesUniversities), + "commercial_equipment" => Ok(CommercialEquipment), + "commercial_footwear" => Ok(CommercialFootwear), + "commercial_photography_art_and_graphics" => Ok(CommercialPhotographyArtAndGraphics), + "commuter_transport_and_ferries" => Ok(CommuterTransportAndFerries), + "computer_network_services" => Ok(ComputerNetworkServices), + "computer_programming" => Ok(ComputerProgramming), + "computer_repair" => Ok(ComputerRepair), + "computer_software_stores" => Ok(ComputerSoftwareStores), + "computers_peripherals_and_software" => Ok(ComputersPeripheralsAndSoftware), + "concrete_work_services" => Ok(ConcreteWorkServices), + "construction_materials" => Ok(ConstructionMaterials), + "consulting_public_relations" => Ok(ConsultingPublicRelations), + "correspondence_schools" => Ok(CorrespondenceSchools), + "cosmetic_stores" => Ok(CosmeticStores), + "counseling_services" => Ok(CounselingServices), + "country_clubs" => Ok(CountryClubs), + "courier_services" => Ok(CourierServices), + "court_costs" => Ok(CourtCosts), + "credit_reporting_agencies" => Ok(CreditReportingAgencies), + "cruise_lines" => Ok(CruiseLines), + "dairy_products_stores" => Ok(DairyProductsStores), + "dance_hall_studios_schools" => Ok(DanceHallStudiosSchools), + "dating_escort_services" => Ok(DatingEscortServices), + "dentists_orthodontists" => Ok(DentistsOrthodontists), + "department_stores" => Ok(DepartmentStores), + "detective_agencies" => Ok(DetectiveAgencies), + "digital_goods_applications" => Ok(DigitalGoodsApplications), + "digital_goods_games" => Ok(DigitalGoodsGames), + "digital_goods_large_volume" => Ok(DigitalGoodsLargeVolume), + "digital_goods_media" => Ok(DigitalGoodsMedia), + "direct_marketing_catalog_merchant" => Ok(DirectMarketingCatalogMerchant), + "direct_marketing_combination_catalog_and_retail_merchant" => { + Ok(DirectMarketingCombinationCatalogAndRetailMerchant) + } + "direct_marketing_inbound_telemarketing" => Ok(DirectMarketingInboundTelemarketing), + "direct_marketing_insurance_services" => Ok(DirectMarketingInsuranceServices), + "direct_marketing_other" => Ok(DirectMarketingOther), + "direct_marketing_outbound_telemarketing" => Ok(DirectMarketingOutboundTelemarketing), + "direct_marketing_subscription" => Ok(DirectMarketingSubscription), + "direct_marketing_travel" => Ok(DirectMarketingTravel), + "discount_stores" => Ok(DiscountStores), + "doctors" => Ok(Doctors), + "door_to_door_sales" => Ok(DoorToDoorSales), + "drapery_window_covering_and_upholstery_stores" => { + Ok(DraperyWindowCoveringAndUpholsteryStores) + } + "drinking_places" => Ok(DrinkingPlaces), + "drug_stores_and_pharmacies" => Ok(DrugStoresAndPharmacies), + "drugs_drug_proprietaries_and_druggist_sundries" => { + Ok(DrugsDrugProprietariesAndDruggistSundries) + } + "dry_cleaners" => Ok(DryCleaners), + "durable_goods" => Ok(DurableGoods), + "duty_free_stores" => Ok(DutyFreeStores), + "eating_places_restaurants" => Ok(EatingPlacesRestaurants), + "educational_services" => Ok(EducationalServices), + "electric_razor_stores" => Ok(ElectricRazorStores), + "electric_vehicle_charging" => Ok(ElectricVehicleCharging), + "electrical_parts_and_equipment" => Ok(ElectricalPartsAndEquipment), + "electrical_services" => Ok(ElectricalServices), + "electronics_repair_shops" => Ok(ElectronicsRepairShops), + "electronics_stores" => Ok(ElectronicsStores), + "elementary_secondary_schools" => Ok(ElementarySecondarySchools), + "emergency_services_gcas_visa_use_only" => Ok(EmergencyServicesGcasVisaUseOnly), + "employment_temp_agencies" => Ok(EmploymentTempAgencies), + "equipment_rental" => Ok(EquipmentRental), + "exterminating_services" => Ok(ExterminatingServices), + "family_clothing_stores" => Ok(FamilyClothingStores), + "fast_food_restaurants" => Ok(FastFoodRestaurants), + "financial_institutions" => Ok(FinancialInstitutions), + "fines_government_administrative_entities" => Ok(FinesGovernmentAdministrativeEntities), + "fireplace_fireplace_screens_and_accessories_stores" => { + Ok(FireplaceFireplaceScreensAndAccessoriesStores) + } + "floor_covering_stores" => Ok(FloorCoveringStores), + "florists" => Ok(Florists), + "florists_supplies_nursery_stock_and_flowers" => { + Ok(FloristsSuppliesNurseryStockAndFlowers) + } + "freezer_and_locker_meat_provisioners" => Ok(FreezerAndLockerMeatProvisioners), + "fuel_dealers_non_automotive" => Ok(FuelDealersNonAutomotive), + "funeral_services_crematories" => Ok(FuneralServicesCrematories), + "furniture_home_furnishings_and_equipment_stores_except_appliances" => { + Ok(FurnitureHomeFurnishingsAndEquipmentStoresExceptAppliances) + } + "furniture_repair_refinishing" => Ok(FurnitureRepairRefinishing), + "furriers_and_fur_shops" => Ok(FurriersAndFurShops), + "general_services" => Ok(GeneralServices), + "gift_card_novelty_and_souvenir_shops" => Ok(GiftCardNoveltyAndSouvenirShops), + "glass_paint_and_wallpaper_stores" => Ok(GlassPaintAndWallpaperStores), + "glassware_crystal_stores" => Ok(GlasswareCrystalStores), + "golf_courses_public" => Ok(GolfCoursesPublic), + "government_licensed_horse_dog_racing_us_region_only" => { + Ok(GovernmentLicensedHorseDogRacingUsRegionOnly) + } + "government_licensed_online_casions_online_gambling_us_region_only" => { + Ok(GovernmentLicensedOnlineCasionsOnlineGamblingUsRegionOnly) + } + "government_owned_lotteries_non_us_region" => Ok(GovernmentOwnedLotteriesNonUsRegion), + "government_owned_lotteries_us_region_only" => Ok(GovernmentOwnedLotteriesUsRegionOnly), + "government_services" => Ok(GovernmentServices), + "grocery_stores_supermarkets" => Ok(GroceryStoresSupermarkets), + "hardware_equipment_and_supplies" => Ok(HardwareEquipmentAndSupplies), + "hardware_stores" => Ok(HardwareStores), + "health_and_beauty_spas" => Ok(HealthAndBeautySpas), + "hearing_aids_sales_and_supplies" => Ok(HearingAidsSalesAndSupplies), + "heating_plumbing_a_c" => Ok(HeatingPlumbingAC), + "hobby_toy_and_game_shops" => Ok(HobbyToyAndGameShops), + "home_supply_warehouse_stores" => Ok(HomeSupplyWarehouseStores), + "hospitals" => Ok(Hospitals), + "hotels_motels_and_resorts" => Ok(HotelsMotelsAndResorts), + "household_appliance_stores" => Ok(HouseholdApplianceStores), + "industrial_supplies" => Ok(IndustrialSupplies), + "information_retrieval_services" => Ok(InformationRetrievalServices), + "insurance_default" => Ok(InsuranceDefault), + "insurance_underwriting_premiums" => Ok(InsuranceUnderwritingPremiums), + "intra_company_purchases" => Ok(IntraCompanyPurchases), + "jewelry_stores_watches_clocks_and_silverware_stores" => { + Ok(JewelryStoresWatchesClocksAndSilverwareStores) + } + "landscaping_services" => Ok(LandscapingServices), + "laundries" => Ok(Laundries), + "laundry_cleaning_services" => Ok(LaundryCleaningServices), + "legal_services_attorneys" => Ok(LegalServicesAttorneys), + "luggage_and_leather_goods_stores" => Ok(LuggageAndLeatherGoodsStores), + "lumber_building_materials_stores" => Ok(LumberBuildingMaterialsStores), + "manual_cash_disburse" => Ok(ManualCashDisburse), + "marinas_service_and_supplies" => Ok(MarinasServiceAndSupplies), + "marketplaces" => Ok(Marketplaces), + "masonry_stonework_and_plaster" => Ok(MasonryStoneworkAndPlaster), + "massage_parlors" => Ok(MassageParlors), + "medical_and_dental_labs" => Ok(MedicalAndDentalLabs), + "medical_dental_ophthalmic_and_hospital_equipment_and_supplies" => { + Ok(MedicalDentalOphthalmicAndHospitalEquipmentAndSupplies) + } + "medical_services" => Ok(MedicalServices), + "membership_organizations" => Ok(MembershipOrganizations), + "mens_and_boys_clothing_and_accessories_stores" => { + Ok(MensAndBoysClothingAndAccessoriesStores) + } + "mens_womens_clothing_stores" => Ok(MensWomensClothingStores), + "metal_service_centers" => Ok(MetalServiceCenters), + "miscellaneous" => Ok(Miscellaneous), + "miscellaneous_apparel_and_accessory_shops" => { + Ok(MiscellaneousApparelAndAccessoryShops) + } + "miscellaneous_auto_dealers" => Ok(MiscellaneousAutoDealers), + "miscellaneous_business_services" => Ok(MiscellaneousBusinessServices), + "miscellaneous_food_stores" => Ok(MiscellaneousFoodStores), + "miscellaneous_general_merchandise" => Ok(MiscellaneousGeneralMerchandise), + "miscellaneous_general_services" => Ok(MiscellaneousGeneralServices), + "miscellaneous_home_furnishing_specialty_stores" => { + Ok(MiscellaneousHomeFurnishingSpecialtyStores) + } + "miscellaneous_publishing_and_printing" => Ok(MiscellaneousPublishingAndPrinting), + "miscellaneous_recreation_services" => Ok(MiscellaneousRecreationServices), + "miscellaneous_repair_shops" => Ok(MiscellaneousRepairShops), + "miscellaneous_specialty_retail" => Ok(MiscellaneousSpecialtyRetail), + "mobile_home_dealers" => Ok(MobileHomeDealers), + "motion_picture_theaters" => Ok(MotionPictureTheaters), + "motor_freight_carriers_and_trucking" => Ok(MotorFreightCarriersAndTrucking), + "motor_homes_dealers" => Ok(MotorHomesDealers), + "motor_vehicle_supplies_and_new_parts" => Ok(MotorVehicleSuppliesAndNewParts), + "motorcycle_shops_and_dealers" => Ok(MotorcycleShopsAndDealers), + "motorcycle_shops_dealers" => Ok(MotorcycleShopsDealers), + "music_stores_musical_instruments_pianos_and_sheet_music" => { + Ok(MusicStoresMusicalInstrumentsPianosAndSheetMusic) + } + "news_dealers_and_newsstands" => Ok(NewsDealersAndNewsstands), + "non_fi_money_orders" => Ok(NonFiMoneyOrders), + "non_fi_stored_value_card_purchase_load" => Ok(NonFiStoredValueCardPurchaseLoad), + "nondurable_goods" => Ok(NondurableGoods), + "nurseries_lawn_and_garden_supply_stores" => Ok(NurseriesLawnAndGardenSupplyStores), + "nursing_personal_care" => Ok(NursingPersonalCare), + "office_and_commercial_furniture" => Ok(OfficeAndCommercialFurniture), + "opticians_eyeglasses" => Ok(OpticiansEyeglasses), + "optometrists_ophthalmologist" => Ok(OptometristsOphthalmologist), + "orthopedic_goods_prosthetic_devices" => Ok(OrthopedicGoodsProstheticDevices), + "osteopaths" => Ok(Osteopaths), + "package_stores_beer_wine_and_liquor" => Ok(PackageStoresBeerWineAndLiquor), + "paints_varnishes_and_supplies" => Ok(PaintsVarnishesAndSupplies), + "parking_lots_garages" => Ok(ParkingLotsGarages), + "passenger_railways" => Ok(PassengerRailways), + "pawn_shops" => Ok(PawnShops), + "pet_shops_pet_food_and_supplies" => Ok(PetShopsPetFoodAndSupplies), + "petroleum_and_petroleum_products" => Ok(PetroleumAndPetroleumProducts), + "photo_developing" => Ok(PhotoDeveloping), + "photographic_photocopy_microfilm_equipment_and_supplies" => { + Ok(PhotographicPhotocopyMicrofilmEquipmentAndSupplies) + } + "photographic_studios" => Ok(PhotographicStudios), + "picture_video_production" => Ok(PictureVideoProduction), + "piece_goods_notions_and_other_dry_goods" => Ok(PieceGoodsNotionsAndOtherDryGoods), + "plumbing_heating_equipment_and_supplies" => Ok(PlumbingHeatingEquipmentAndSupplies), + "political_organizations" => Ok(PoliticalOrganizations), + "postal_services_government_only" => Ok(PostalServicesGovernmentOnly), + "precious_stones_and_metals_watches_and_jewelry" => { + Ok(PreciousStonesAndMetalsWatchesAndJewelry) + } + "professional_services" => Ok(ProfessionalServices), + "public_warehousing_and_storage" => Ok(PublicWarehousingAndStorage), + "quick_copy_repro_and_blueprint" => Ok(QuickCopyReproAndBlueprint), + "railroads" => Ok(Railroads), + "real_estate_agents_and_managers_rentals" => Ok(RealEstateAgentsAndManagersRentals), + "record_stores" => Ok(RecordStores), + "recreational_vehicle_rentals" => Ok(RecreationalVehicleRentals), + "religious_goods_stores" => Ok(ReligiousGoodsStores), + "religious_organizations" => Ok(ReligiousOrganizations), + "roofing_siding_sheet_metal" => Ok(RoofingSidingSheetMetal), + "secretarial_support_services" => Ok(SecretarialSupportServices), + "security_brokers_dealers" => Ok(SecurityBrokersDealers), + "service_stations" => Ok(ServiceStations), + "sewing_needlework_fabric_and_piece_goods_stores" => { + Ok(SewingNeedleworkFabricAndPieceGoodsStores) + } + "shoe_repair_hat_cleaning" => Ok(ShoeRepairHatCleaning), + "shoe_stores" => Ok(ShoeStores), + "small_appliance_repair" => Ok(SmallApplianceRepair), + "snowmobile_dealers" => Ok(SnowmobileDealers), + "special_trade_services" => Ok(SpecialTradeServices), + "specialty_cleaning" => Ok(SpecialtyCleaning), + "sporting_goods_stores" => Ok(SportingGoodsStores), + "sporting_recreation_camps" => Ok(SportingRecreationCamps), + "sports_and_riding_apparel_stores" => Ok(SportsAndRidingApparelStores), + "sports_clubs_fields" => Ok(SportsClubsFields), + "stamp_and_coin_stores" => Ok(StampAndCoinStores), + "stationary_office_supplies_printing_and_writing_paper" => { + Ok(StationaryOfficeSuppliesPrintingAndWritingPaper) + } + "stationery_stores_office_and_school_supply_stores" => { + Ok(StationeryStoresOfficeAndSchoolSupplyStores) + } + "swimming_pools_sales" => Ok(SwimmingPoolsSales), + "t_ui_travel_germany" => Ok(TUiTravelGermany), + "tailors_alterations" => Ok(TailorsAlterations), + "tax_payments_government_agencies" => Ok(TaxPaymentsGovernmentAgencies), + "tax_preparation_services" => Ok(TaxPreparationServices), + "taxicabs_limousines" => Ok(TaxicabsLimousines), + "telecommunication_equipment_and_telephone_sales" => { + Ok(TelecommunicationEquipmentAndTelephoneSales) + } + "telecommunication_services" => Ok(TelecommunicationServices), + "telegraph_services" => Ok(TelegraphServices), + "tent_and_awning_shops" => Ok(TentAndAwningShops), + "testing_laboratories" => Ok(TestingLaboratories), + "theatrical_ticket_agencies" => Ok(TheatricalTicketAgencies), + "timeshares" => Ok(Timeshares), + "tire_retreading_and_repair" => Ok(TireRetreadingAndRepair), + "tolls_bridge_fees" => Ok(TollsBridgeFees), + "tourist_attractions_and_exhibits" => Ok(TouristAttractionsAndExhibits), + "towing_services" => Ok(TowingServices), + "trailer_parks_campgrounds" => Ok(TrailerParksCampgrounds), + "transportation_services" => Ok(TransportationServices), + "travel_agencies_tour_operators" => Ok(TravelAgenciesTourOperators), + "truck_stop_iteration" => Ok(TruckStopIteration), + "truck_utility_trailer_rentals" => Ok(TruckUtilityTrailerRentals), + "typesetting_plate_making_and_related_services" => { + Ok(TypesettingPlateMakingAndRelatedServices) + } + "typewriter_stores" => Ok(TypewriterStores), + "u_s_federal_government_agencies_or_departments" => { + Ok(USFederalGovernmentAgenciesOrDepartments) + } + "uniforms_commercial_clothing" => Ok(UniformsCommercialClothing), + "used_merchandise_and_secondhand_stores" => Ok(UsedMerchandiseAndSecondhandStores), + "utilities" => Ok(Utilities), + "variety_stores" => Ok(VarietyStores), + "veterinary_services" => Ok(VeterinaryServices), + "video_amusement_game_supplies" => Ok(VideoAmusementGameSupplies), + "video_game_arcades" => Ok(VideoGameArcades), + "video_tape_rental_stores" => Ok(VideoTapeRentalStores), + "vocational_trade_schools" => Ok(VocationalTradeSchools), + "watch_jewelry_repair" => Ok(WatchJewelryRepair), + "welding_repair" => Ok(WeldingRepair), + "wholesale_clubs" => Ok(WholesaleClubs), + "wig_and_toupee_stores" => Ok(WigAndToupeeStores), + "wires_money_orders" => Ok(WiresMoneyOrders), + "womens_accessory_and_specialty_shops" => Ok(WomensAccessoryAndSpecialtyShops), + "womens_ready_to_wear_stores" => Ok(WomensReadyToWearStores), + "wrecking_and_salvage_yards" => Ok(WreckingAndSalvageYards), + _ => Err(()), + } + } +} +impl std::fmt::Display for UpdateIssuingCardSpendingControlsSpendingLimitsCategories { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for UpdateIssuingCardSpendingControlsSpendingLimitsCategories { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for UpdateIssuingCardSpendingControlsSpendingLimitsCategories { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Interval (or event) to which the amount applies. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum UpdateIssuingCardSpendingControlsSpendingLimitsInterval { + AllTime, + Daily, + Monthly, + PerAuthorization, + Weekly, + Yearly, +} +impl UpdateIssuingCardSpendingControlsSpendingLimitsInterval { + pub fn as_str(self) -> &'static str { + use UpdateIssuingCardSpendingControlsSpendingLimitsInterval::*; + match self { + AllTime => "all_time", + Daily => "daily", + Monthly => "monthly", + PerAuthorization => "per_authorization", + Weekly => "weekly", + Yearly => "yearly", + } + } +} + +impl std::str::FromStr for UpdateIssuingCardSpendingControlsSpendingLimitsInterval { + type Err = (); + fn from_str(s: &str) -> Result { + use UpdateIssuingCardSpendingControlsSpendingLimitsInterval::*; + match s { + "all_time" => Ok(AllTime), + "daily" => Ok(Daily), + "monthly" => Ok(Monthly), + "per_authorization" => Ok(PerAuthorization), + "weekly" => Ok(Weekly), + "yearly" => Ok(Yearly), + _ => Err(()), + } + } +} +impl std::fmt::Display for UpdateIssuingCardSpendingControlsSpendingLimitsInterval { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for UpdateIssuingCardSpendingControlsSpendingLimitsInterval { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for UpdateIssuingCardSpendingControlsSpendingLimitsInterval { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'a> UpdateIssuingCard<'a> { + /// Updates the specified Issuing `Card` object by setting the values of the parameters passed. + /// Any parameters not provided will be left unchanged. + pub fn send( + &self, + client: &stripe::Client, + card: &stripe_shared::IssuingCardId, + ) -> stripe::Response { + client.send_form(&format!("/issuing/cards/{card}"), self, http_types::Method::Post) + } +} +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct DeliverCardIssuingCard<'a> { + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, +} +impl<'a> DeliverCardIssuingCard<'a> { + pub fn new() -> Self { + Self::default() + } +} +impl<'a> DeliverCardIssuingCard<'a> { + /// Updates the shipping status of the specified Issuing `Card` object to `delivered`. + pub fn send( + &self, + client: &stripe::Client, + card: &str, + ) -> stripe::Response { + client.send_form( + &format!("/test_helpers/issuing/cards/{card}/shipping/deliver"), + self, + http_types::Method::Post, + ) + } +} +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct FailCardIssuingCard<'a> { + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, +} +impl<'a> FailCardIssuingCard<'a> { + pub fn new() -> Self { + Self::default() + } +} +impl<'a> FailCardIssuingCard<'a> { + /// Updates the shipping status of the specified Issuing `Card` object to `failure`. + pub fn send( + &self, + client: &stripe::Client, + card: &str, + ) -> stripe::Response { + client.send_form( + &format!("/test_helpers/issuing/cards/{card}/shipping/fail"), + self, + http_types::Method::Post, + ) + } +} +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct ReturnCardIssuingCard<'a> { + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, +} +impl<'a> ReturnCardIssuingCard<'a> { + pub fn new() -> Self { + Self::default() + } +} +impl<'a> ReturnCardIssuingCard<'a> { + /// Updates the shipping status of the specified Issuing `Card` object to `returned`. + pub fn send( + &self, + client: &stripe::Client, + card: &str, + ) -> stripe::Response { + client.send_form( + &format!("/test_helpers/issuing/cards/{card}/shipping/return"), + self, + http_types::Method::Post, + ) + } +} +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct ShipCardIssuingCard<'a> { + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, +} +impl<'a> ShipCardIssuingCard<'a> { + pub fn new() -> Self { + Self::default() + } +} +impl<'a> ShipCardIssuingCard<'a> { + /// Updates the shipping status of the specified Issuing `Card` object to `shipped`. + pub fn send( + &self, + client: &stripe::Client, + card: &str, + ) -> stripe::Response { + client.send_form( + &format!("/test_helpers/issuing/cards/{card}/shipping/ship"), + self, + http_types::Method::Post, + ) + } +} +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct EncryptedPinParam<'a> { + /// The card's desired new PIN, encrypted under Stripe's public key. + #[serde(skip_serializing_if = "Option::is_none")] + pub encrypted_number: Option<&'a str>, +} +impl<'a> EncryptedPinParam<'a> { + pub fn new() -> Self { + Self::default() + } +} diff --git a/generated/stripe_issuing/src/issuing_cardholder/mod.rs b/generated/stripe_issuing/src/issuing_cardholder/mod.rs new file mode 100644 index 000000000..76d10ba23 --- /dev/null +++ b/generated/stripe_issuing/src/issuing_cardholder/mod.rs @@ -0,0 +1,4 @@ +#[cfg(feature = "issuing_cardholder")] +mod requests; +#[cfg(feature = "issuing_cardholder")] +pub use requests::*; diff --git a/generated/stripe_issuing/src/issuing_cardholder/requests.rs b/generated/stripe_issuing/src/issuing_cardholder/requests.rs new file mode 100644 index 000000000..fe09025bd --- /dev/null +++ b/generated/stripe_issuing/src/issuing_cardholder/requests.rs @@ -0,0 +1,6792 @@ +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct ListIssuingCardholder<'a> { + /// Only return cardholders that were created during the given date interval. + #[serde(skip_serializing_if = "Option::is_none")] + pub created: Option, + /// Only return cardholders that have the given email address. + #[serde(skip_serializing_if = "Option::is_none")] + pub email: Option<&'a str>, + /// A cursor for use in pagination. + /// `ending_before` is an object ID that defines your place in the list. + /// For instance, if you make a list request and receive 100 objects, starting with `obj_bar`, your subsequent call can include `ending_before=obj_bar` in order to fetch the previous page of the list. + #[serde(skip_serializing_if = "Option::is_none")] + pub ending_before: Option<&'a str>, + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, + /// A limit on the number of objects to be returned. + /// Limit can range between 1 and 100, and the default is 10. + #[serde(skip_serializing_if = "Option::is_none")] + pub limit: Option, + /// Only return cardholders that have the given phone number. + #[serde(skip_serializing_if = "Option::is_none")] + pub phone_number: Option<&'a str>, + /// A cursor for use in pagination. + /// `starting_after` is an object ID that defines your place in the list. + /// For instance, if you make a list request and receive 100 objects, ending with `obj_foo`, your subsequent call can include `starting_after=obj_foo` in order to fetch the next page of the list. + #[serde(skip_serializing_if = "Option::is_none")] + pub starting_after: Option<&'a str>, + /// Only return cardholders that have the given status. One of `active`, `inactive`, or `blocked`. + #[serde(skip_serializing_if = "Option::is_none")] + pub status: Option, + /// Only return cardholders that have the given type. One of `individual` or `company`. + #[serde(rename = "type")] + #[serde(skip_serializing_if = "Option::is_none")] + pub type_: Option, +} +impl<'a> ListIssuingCardholder<'a> { + pub fn new() -> Self { + Self::default() + } +} +impl<'a> ListIssuingCardholder<'a> { + /// Returns a list of Issuing `Cardholder` objects. + /// The objects are sorted in descending order by creation date, with the most recently created object appearing first. + pub fn send( + &self, + client: &stripe::Client, + ) -> stripe::Response> { + client.get_query("/issuing/cardholders", self) + } + pub fn paginate( + self, + ) -> stripe::ListPaginator> { + stripe::ListPaginator::from_list_params("/issuing/cardholders", self) + } +} +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct RetrieveIssuingCardholder<'a> { + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, +} +impl<'a> RetrieveIssuingCardholder<'a> { + pub fn new() -> Self { + Self::default() + } +} +impl<'a> RetrieveIssuingCardholder<'a> { + /// Retrieves an Issuing `Cardholder` object. + pub fn send( + &self, + client: &stripe::Client, + cardholder: &stripe_shared::IssuingCardholderId, + ) -> stripe::Response { + client.get_query(&format!("/issuing/cardholders/{cardholder}"), self) + } +} +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreateIssuingCardholder<'a> { + /// The cardholder's billing address. + pub billing: BillingSpecs<'a>, + /// Additional information about a `company` cardholder. + #[serde(skip_serializing_if = "Option::is_none")] + pub company: Option>, + /// The cardholder's email address. + #[serde(skip_serializing_if = "Option::is_none")] + pub email: Option<&'a str>, + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, + /// Additional information about an `individual` cardholder. + #[serde(skip_serializing_if = "Option::is_none")] + pub individual: Option>, + /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. + /// This can be useful for storing additional information about the object in a structured format. + /// Individual keys can be unset by posting an empty value to them. + /// All keys can be unset by posting an empty value to `metadata`. + #[serde(skip_serializing_if = "Option::is_none")] + pub metadata: Option<&'a std::collections::HashMap>, + /// The cardholder's name. + /// This will be printed on cards issued to them. + /// The maximum length of this field is 24 characters. + /// This field cannot contain any special characters or numbers. + pub name: &'a str, + /// The cardholder's phone number. + /// This will be transformed to [E.164](https://en.wikipedia.org/wiki/E.164) if it is not provided in that format already. + /// This is required for all cardholders who will be creating EU cards. + /// See the [3D Secure documentation](https://stripe.com/docs/issuing/3d-secure#when-is-3d-secure-applied) for more details. + #[serde(skip_serializing_if = "Option::is_none")] + pub phone_number: Option<&'a str>, + /// The cardholder’s preferred locales (languages), ordered by preference. + /// Locales can be `de`, `en`, `es`, `fr`, or `it`. + /// This changes the language of the [3D Secure flow](https://stripe.com/docs/issuing/3d-secure) and one-time password messages sent to the cardholder. + #[serde(skip_serializing_if = "Option::is_none")] + pub preferred_locales: Option<&'a [stripe_shared::IssuingCardholderPreferredLocales]>, + /// Rules that control spending across this cardholder's cards. + /// Refer to our [documentation](https://stripe.com/docs/issuing/controls/spending-controls) for more details. + #[serde(skip_serializing_if = "Option::is_none")] + pub spending_controls: Option>, + /// Specifies whether to permit authorizations on this cardholder's cards. Defaults to `active`. + #[serde(skip_serializing_if = "Option::is_none")] + pub status: Option, + /// One of `individual` or `company`. + /// See [Choose a cardholder type](https://stripe.com/docs/issuing/other/choose-cardholder) for more details. + #[serde(rename = "type")] + #[serde(skip_serializing_if = "Option::is_none")] + pub type_: Option, +} +impl<'a> CreateIssuingCardholder<'a> { + pub fn new(billing: BillingSpecs<'a>, name: &'a str) -> Self { + Self { + billing, + company: None, + email: None, + expand: None, + individual: None, + metadata: None, + name, + phone_number: None, + preferred_locales: None, + spending_controls: None, + status: None, + type_: None, + } + } +} +/// Rules that control spending across this cardholder's cards. +/// Refer to our [documentation](https://stripe.com/docs/issuing/controls/spending-controls) for more details. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreateIssuingCardholderSpendingControls<'a> { + /// Array of strings containing [categories](https://stripe.com/docs/api#issuing_authorization_object-merchant_data-category) of authorizations to allow. + /// All other categories will be blocked. + /// Cannot be set with `blocked_categories`. + #[serde(skip_serializing_if = "Option::is_none")] + pub allowed_categories: Option<&'a [CreateIssuingCardholderSpendingControlsAllowedCategories]>, + /// Array of strings containing [categories](https://stripe.com/docs/api#issuing_authorization_object-merchant_data-category) of authorizations to decline. + /// All other categories will be allowed. + /// Cannot be set with `allowed_categories`. + #[serde(skip_serializing_if = "Option::is_none")] + pub blocked_categories: Option<&'a [CreateIssuingCardholderSpendingControlsBlockedCategories]>, + /// Limit spending with amount-based rules that apply across this cardholder's cards. + #[serde(skip_serializing_if = "Option::is_none")] + pub spending_limits: Option<&'a [CreateIssuingCardholderSpendingControlsSpendingLimits<'a>]>, + /// Currency of amounts within `spending_limits`. Defaults to your merchant country's currency. + #[serde(skip_serializing_if = "Option::is_none")] + pub spending_limits_currency: Option, +} +impl<'a> CreateIssuingCardholderSpendingControls<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// Array of strings containing [categories](https://stripe.com/docs/api#issuing_authorization_object-merchant_data-category) of authorizations to allow. +/// All other categories will be blocked. +/// Cannot be set with `blocked_categories`. +#[derive(Copy, Clone, Eq, PartialEq)] +#[non_exhaustive] +pub enum CreateIssuingCardholderSpendingControlsAllowedCategories { + AcRefrigerationRepair, + AccountingBookkeepingServices, + AdvertisingServices, + AgriculturalCooperative, + AirlinesAirCarriers, + AirportsFlyingFields, + AmbulanceServices, + AmusementParksCarnivals, + AntiqueReproductions, + AntiqueShops, + Aquariums, + ArchitecturalSurveyingServices, + ArtDealersAndGalleries, + ArtistsSupplyAndCraftShops, + AutoAndHomeSupplyStores, + AutoBodyRepairShops, + AutoPaintShops, + AutoServiceShops, + AutomatedCashDisburse, + AutomatedFuelDispensers, + AutomobileAssociations, + AutomotivePartsAndAccessoriesStores, + AutomotiveTireStores, + BailAndBondPayments, + Bakeries, + BandsOrchestras, + BarberAndBeautyShops, + BettingCasinoGambling, + BicycleShops, + BilliardPoolEstablishments, + BoatDealers, + BoatRentalsAndLeases, + BookStores, + BooksPeriodicalsAndNewspapers, + BowlingAlleys, + BusLines, + BusinessSecretarialSchools, + BuyingShoppingServices, + CableSatelliteAndOtherPayTelevisionAndRadio, + CameraAndPhotographicSupplyStores, + CandyNutAndConfectioneryStores, + CarAndTruckDealersNewUsed, + CarAndTruckDealersUsedOnly, + CarRentalAgencies, + CarWashes, + CarpentryServices, + CarpetUpholsteryCleaning, + Caterers, + CharitableAndSocialServiceOrganizationsFundraising, + ChemicalsAndAlliedProducts, + ChildCareServices, + ChildrensAndInfantsWearStores, + ChiropodistsPodiatrists, + Chiropractors, + CigarStoresAndStands, + CivicSocialFraternalAssociations, + CleaningAndMaintenance, + ClothingRental, + CollegesUniversities, + CommercialEquipment, + CommercialFootwear, + CommercialPhotographyArtAndGraphics, + CommuterTransportAndFerries, + ComputerNetworkServices, + ComputerProgramming, + ComputerRepair, + ComputerSoftwareStores, + ComputersPeripheralsAndSoftware, + ConcreteWorkServices, + ConstructionMaterials, + ConsultingPublicRelations, + CorrespondenceSchools, + CosmeticStores, + CounselingServices, + CountryClubs, + CourierServices, + CourtCosts, + CreditReportingAgencies, + CruiseLines, + DairyProductsStores, + DanceHallStudiosSchools, + DatingEscortServices, + DentistsOrthodontists, + DepartmentStores, + DetectiveAgencies, + DigitalGoodsApplications, + DigitalGoodsGames, + DigitalGoodsLargeVolume, + DigitalGoodsMedia, + DirectMarketingCatalogMerchant, + DirectMarketingCombinationCatalogAndRetailMerchant, + DirectMarketingInboundTelemarketing, + DirectMarketingInsuranceServices, + DirectMarketingOther, + DirectMarketingOutboundTelemarketing, + DirectMarketingSubscription, + DirectMarketingTravel, + DiscountStores, + Doctors, + DoorToDoorSales, + DraperyWindowCoveringAndUpholsteryStores, + DrinkingPlaces, + DrugStoresAndPharmacies, + DrugsDrugProprietariesAndDruggistSundries, + DryCleaners, + DurableGoods, + DutyFreeStores, + EatingPlacesRestaurants, + EducationalServices, + ElectricRazorStores, + ElectricVehicleCharging, + ElectricalPartsAndEquipment, + ElectricalServices, + ElectronicsRepairShops, + ElectronicsStores, + ElementarySecondarySchools, + EmergencyServicesGcasVisaUseOnly, + EmploymentTempAgencies, + EquipmentRental, + ExterminatingServices, + FamilyClothingStores, + FastFoodRestaurants, + FinancialInstitutions, + FinesGovernmentAdministrativeEntities, + FireplaceFireplaceScreensAndAccessoriesStores, + FloorCoveringStores, + Florists, + FloristsSuppliesNurseryStockAndFlowers, + FreezerAndLockerMeatProvisioners, + FuelDealersNonAutomotive, + FuneralServicesCrematories, + FurnitureHomeFurnishingsAndEquipmentStoresExceptAppliances, + FurnitureRepairRefinishing, + FurriersAndFurShops, + GeneralServices, + GiftCardNoveltyAndSouvenirShops, + GlassPaintAndWallpaperStores, + GlasswareCrystalStores, + GolfCoursesPublic, + GovernmentLicensedHorseDogRacingUsRegionOnly, + GovernmentLicensedOnlineCasionsOnlineGamblingUsRegionOnly, + GovernmentOwnedLotteriesNonUsRegion, + GovernmentOwnedLotteriesUsRegionOnly, + GovernmentServices, + GroceryStoresSupermarkets, + HardwareEquipmentAndSupplies, + HardwareStores, + HealthAndBeautySpas, + HearingAidsSalesAndSupplies, + HeatingPlumbingAC, + HobbyToyAndGameShops, + HomeSupplyWarehouseStores, + Hospitals, + HotelsMotelsAndResorts, + HouseholdApplianceStores, + IndustrialSupplies, + InformationRetrievalServices, + InsuranceDefault, + InsuranceUnderwritingPremiums, + IntraCompanyPurchases, + JewelryStoresWatchesClocksAndSilverwareStores, + LandscapingServices, + Laundries, + LaundryCleaningServices, + LegalServicesAttorneys, + LuggageAndLeatherGoodsStores, + LumberBuildingMaterialsStores, + ManualCashDisburse, + MarinasServiceAndSupplies, + Marketplaces, + MasonryStoneworkAndPlaster, + MassageParlors, + MedicalAndDentalLabs, + MedicalDentalOphthalmicAndHospitalEquipmentAndSupplies, + MedicalServices, + MembershipOrganizations, + MensAndBoysClothingAndAccessoriesStores, + MensWomensClothingStores, + MetalServiceCenters, + Miscellaneous, + MiscellaneousApparelAndAccessoryShops, + MiscellaneousAutoDealers, + MiscellaneousBusinessServices, + MiscellaneousFoodStores, + MiscellaneousGeneralMerchandise, + MiscellaneousGeneralServices, + MiscellaneousHomeFurnishingSpecialtyStores, + MiscellaneousPublishingAndPrinting, + MiscellaneousRecreationServices, + MiscellaneousRepairShops, + MiscellaneousSpecialtyRetail, + MobileHomeDealers, + MotionPictureTheaters, + MotorFreightCarriersAndTrucking, + MotorHomesDealers, + MotorVehicleSuppliesAndNewParts, + MotorcycleShopsAndDealers, + MotorcycleShopsDealers, + MusicStoresMusicalInstrumentsPianosAndSheetMusic, + NewsDealersAndNewsstands, + NonFiMoneyOrders, + NonFiStoredValueCardPurchaseLoad, + NondurableGoods, + NurseriesLawnAndGardenSupplyStores, + NursingPersonalCare, + OfficeAndCommercialFurniture, + OpticiansEyeglasses, + OptometristsOphthalmologist, + OrthopedicGoodsProstheticDevices, + Osteopaths, + PackageStoresBeerWineAndLiquor, + PaintsVarnishesAndSupplies, + ParkingLotsGarages, + PassengerRailways, + PawnShops, + PetShopsPetFoodAndSupplies, + PetroleumAndPetroleumProducts, + PhotoDeveloping, + PhotographicPhotocopyMicrofilmEquipmentAndSupplies, + PhotographicStudios, + PictureVideoProduction, + PieceGoodsNotionsAndOtherDryGoods, + PlumbingHeatingEquipmentAndSupplies, + PoliticalOrganizations, + PostalServicesGovernmentOnly, + PreciousStonesAndMetalsWatchesAndJewelry, + ProfessionalServices, + PublicWarehousingAndStorage, + QuickCopyReproAndBlueprint, + Railroads, + RealEstateAgentsAndManagersRentals, + RecordStores, + RecreationalVehicleRentals, + ReligiousGoodsStores, + ReligiousOrganizations, + RoofingSidingSheetMetal, + SecretarialSupportServices, + SecurityBrokersDealers, + ServiceStations, + SewingNeedleworkFabricAndPieceGoodsStores, + ShoeRepairHatCleaning, + ShoeStores, + SmallApplianceRepair, + SnowmobileDealers, + SpecialTradeServices, + SpecialtyCleaning, + SportingGoodsStores, + SportingRecreationCamps, + SportsAndRidingApparelStores, + SportsClubsFields, + StampAndCoinStores, + StationaryOfficeSuppliesPrintingAndWritingPaper, + StationeryStoresOfficeAndSchoolSupplyStores, + SwimmingPoolsSales, + TUiTravelGermany, + TailorsAlterations, + TaxPaymentsGovernmentAgencies, + TaxPreparationServices, + TaxicabsLimousines, + TelecommunicationEquipmentAndTelephoneSales, + TelecommunicationServices, + TelegraphServices, + TentAndAwningShops, + TestingLaboratories, + TheatricalTicketAgencies, + Timeshares, + TireRetreadingAndRepair, + TollsBridgeFees, + TouristAttractionsAndExhibits, + TowingServices, + TrailerParksCampgrounds, + TransportationServices, + TravelAgenciesTourOperators, + TruckStopIteration, + TruckUtilityTrailerRentals, + TypesettingPlateMakingAndRelatedServices, + TypewriterStores, + USFederalGovernmentAgenciesOrDepartments, + UniformsCommercialClothing, + UsedMerchandiseAndSecondhandStores, + Utilities, + VarietyStores, + VeterinaryServices, + VideoAmusementGameSupplies, + VideoGameArcades, + VideoTapeRentalStores, + VocationalTradeSchools, + WatchJewelryRepair, + WeldingRepair, + WholesaleClubs, + WigAndToupeeStores, + WiresMoneyOrders, + WomensAccessoryAndSpecialtyShops, + WomensReadyToWearStores, + WreckingAndSalvageYards, + /// An unrecognized value from Stripe. Should not be used as a request parameter. + Unknown, +} +impl CreateIssuingCardholderSpendingControlsAllowedCategories { + pub fn as_str(self) -> &'static str { + use CreateIssuingCardholderSpendingControlsAllowedCategories::*; + match self { + AcRefrigerationRepair => "ac_refrigeration_repair", + AccountingBookkeepingServices => "accounting_bookkeeping_services", + AdvertisingServices => "advertising_services", + AgriculturalCooperative => "agricultural_cooperative", + AirlinesAirCarriers => "airlines_air_carriers", + AirportsFlyingFields => "airports_flying_fields", + AmbulanceServices => "ambulance_services", + AmusementParksCarnivals => "amusement_parks_carnivals", + AntiqueReproductions => "antique_reproductions", + AntiqueShops => "antique_shops", + Aquariums => "aquariums", + ArchitecturalSurveyingServices => "architectural_surveying_services", + ArtDealersAndGalleries => "art_dealers_and_galleries", + ArtistsSupplyAndCraftShops => "artists_supply_and_craft_shops", + AutoAndHomeSupplyStores => "auto_and_home_supply_stores", + AutoBodyRepairShops => "auto_body_repair_shops", + AutoPaintShops => "auto_paint_shops", + AutoServiceShops => "auto_service_shops", + AutomatedCashDisburse => "automated_cash_disburse", + AutomatedFuelDispensers => "automated_fuel_dispensers", + AutomobileAssociations => "automobile_associations", + AutomotivePartsAndAccessoriesStores => "automotive_parts_and_accessories_stores", + AutomotiveTireStores => "automotive_tire_stores", + BailAndBondPayments => "bail_and_bond_payments", + Bakeries => "bakeries", + BandsOrchestras => "bands_orchestras", + BarberAndBeautyShops => "barber_and_beauty_shops", + BettingCasinoGambling => "betting_casino_gambling", + BicycleShops => "bicycle_shops", + BilliardPoolEstablishments => "billiard_pool_establishments", + BoatDealers => "boat_dealers", + BoatRentalsAndLeases => "boat_rentals_and_leases", + BookStores => "book_stores", + BooksPeriodicalsAndNewspapers => "books_periodicals_and_newspapers", + BowlingAlleys => "bowling_alleys", + BusLines => "bus_lines", + BusinessSecretarialSchools => "business_secretarial_schools", + BuyingShoppingServices => "buying_shopping_services", + CableSatelliteAndOtherPayTelevisionAndRadio => { + "cable_satellite_and_other_pay_television_and_radio" + } + CameraAndPhotographicSupplyStores => "camera_and_photographic_supply_stores", + CandyNutAndConfectioneryStores => "candy_nut_and_confectionery_stores", + CarAndTruckDealersNewUsed => "car_and_truck_dealers_new_used", + CarAndTruckDealersUsedOnly => "car_and_truck_dealers_used_only", + CarRentalAgencies => "car_rental_agencies", + CarWashes => "car_washes", + CarpentryServices => "carpentry_services", + CarpetUpholsteryCleaning => "carpet_upholstery_cleaning", + Caterers => "caterers", + CharitableAndSocialServiceOrganizationsFundraising => { + "charitable_and_social_service_organizations_fundraising" + } + ChemicalsAndAlliedProducts => "chemicals_and_allied_products", + ChildCareServices => "child_care_services", + ChildrensAndInfantsWearStores => "childrens_and_infants_wear_stores", + ChiropodistsPodiatrists => "chiropodists_podiatrists", + Chiropractors => "chiropractors", + CigarStoresAndStands => "cigar_stores_and_stands", + CivicSocialFraternalAssociations => "civic_social_fraternal_associations", + CleaningAndMaintenance => "cleaning_and_maintenance", + ClothingRental => "clothing_rental", + CollegesUniversities => "colleges_universities", + CommercialEquipment => "commercial_equipment", + CommercialFootwear => "commercial_footwear", + CommercialPhotographyArtAndGraphics => "commercial_photography_art_and_graphics", + CommuterTransportAndFerries => "commuter_transport_and_ferries", + ComputerNetworkServices => "computer_network_services", + ComputerProgramming => "computer_programming", + ComputerRepair => "computer_repair", + ComputerSoftwareStores => "computer_software_stores", + ComputersPeripheralsAndSoftware => "computers_peripherals_and_software", + ConcreteWorkServices => "concrete_work_services", + ConstructionMaterials => "construction_materials", + ConsultingPublicRelations => "consulting_public_relations", + CorrespondenceSchools => "correspondence_schools", + CosmeticStores => "cosmetic_stores", + CounselingServices => "counseling_services", + CountryClubs => "country_clubs", + CourierServices => "courier_services", + CourtCosts => "court_costs", + CreditReportingAgencies => "credit_reporting_agencies", + CruiseLines => "cruise_lines", + DairyProductsStores => "dairy_products_stores", + DanceHallStudiosSchools => "dance_hall_studios_schools", + DatingEscortServices => "dating_escort_services", + DentistsOrthodontists => "dentists_orthodontists", + DepartmentStores => "department_stores", + DetectiveAgencies => "detective_agencies", + DigitalGoodsApplications => "digital_goods_applications", + DigitalGoodsGames => "digital_goods_games", + DigitalGoodsLargeVolume => "digital_goods_large_volume", + DigitalGoodsMedia => "digital_goods_media", + DirectMarketingCatalogMerchant => "direct_marketing_catalog_merchant", + DirectMarketingCombinationCatalogAndRetailMerchant => { + "direct_marketing_combination_catalog_and_retail_merchant" + } + DirectMarketingInboundTelemarketing => "direct_marketing_inbound_telemarketing", + DirectMarketingInsuranceServices => "direct_marketing_insurance_services", + DirectMarketingOther => "direct_marketing_other", + DirectMarketingOutboundTelemarketing => "direct_marketing_outbound_telemarketing", + DirectMarketingSubscription => "direct_marketing_subscription", + DirectMarketingTravel => "direct_marketing_travel", + DiscountStores => "discount_stores", + Doctors => "doctors", + DoorToDoorSales => "door_to_door_sales", + DraperyWindowCoveringAndUpholsteryStores => { + "drapery_window_covering_and_upholstery_stores" + } + DrinkingPlaces => "drinking_places", + DrugStoresAndPharmacies => "drug_stores_and_pharmacies", + DrugsDrugProprietariesAndDruggistSundries => { + "drugs_drug_proprietaries_and_druggist_sundries" + } + DryCleaners => "dry_cleaners", + DurableGoods => "durable_goods", + DutyFreeStores => "duty_free_stores", + EatingPlacesRestaurants => "eating_places_restaurants", + EducationalServices => "educational_services", + ElectricRazorStores => "electric_razor_stores", + ElectricVehicleCharging => "electric_vehicle_charging", + ElectricalPartsAndEquipment => "electrical_parts_and_equipment", + ElectricalServices => "electrical_services", + ElectronicsRepairShops => "electronics_repair_shops", + ElectronicsStores => "electronics_stores", + ElementarySecondarySchools => "elementary_secondary_schools", + EmergencyServicesGcasVisaUseOnly => "emergency_services_gcas_visa_use_only", + EmploymentTempAgencies => "employment_temp_agencies", + EquipmentRental => "equipment_rental", + ExterminatingServices => "exterminating_services", + FamilyClothingStores => "family_clothing_stores", + FastFoodRestaurants => "fast_food_restaurants", + FinancialInstitutions => "financial_institutions", + FinesGovernmentAdministrativeEntities => "fines_government_administrative_entities", + FireplaceFireplaceScreensAndAccessoriesStores => { + "fireplace_fireplace_screens_and_accessories_stores" + } + FloorCoveringStores => "floor_covering_stores", + Florists => "florists", + FloristsSuppliesNurseryStockAndFlowers => "florists_supplies_nursery_stock_and_flowers", + FreezerAndLockerMeatProvisioners => "freezer_and_locker_meat_provisioners", + FuelDealersNonAutomotive => "fuel_dealers_non_automotive", + FuneralServicesCrematories => "funeral_services_crematories", + FurnitureHomeFurnishingsAndEquipmentStoresExceptAppliances => { + "furniture_home_furnishings_and_equipment_stores_except_appliances" + } + FurnitureRepairRefinishing => "furniture_repair_refinishing", + FurriersAndFurShops => "furriers_and_fur_shops", + GeneralServices => "general_services", + GiftCardNoveltyAndSouvenirShops => "gift_card_novelty_and_souvenir_shops", + GlassPaintAndWallpaperStores => "glass_paint_and_wallpaper_stores", + GlasswareCrystalStores => "glassware_crystal_stores", + GolfCoursesPublic => "golf_courses_public", + GovernmentLicensedHorseDogRacingUsRegionOnly => { + "government_licensed_horse_dog_racing_us_region_only" + } + GovernmentLicensedOnlineCasionsOnlineGamblingUsRegionOnly => { + "government_licensed_online_casions_online_gambling_us_region_only" + } + GovernmentOwnedLotteriesNonUsRegion => "government_owned_lotteries_non_us_region", + GovernmentOwnedLotteriesUsRegionOnly => "government_owned_lotteries_us_region_only", + GovernmentServices => "government_services", + GroceryStoresSupermarkets => "grocery_stores_supermarkets", + HardwareEquipmentAndSupplies => "hardware_equipment_and_supplies", + HardwareStores => "hardware_stores", + HealthAndBeautySpas => "health_and_beauty_spas", + HearingAidsSalesAndSupplies => "hearing_aids_sales_and_supplies", + HeatingPlumbingAC => "heating_plumbing_a_c", + HobbyToyAndGameShops => "hobby_toy_and_game_shops", + HomeSupplyWarehouseStores => "home_supply_warehouse_stores", + Hospitals => "hospitals", + HotelsMotelsAndResorts => "hotels_motels_and_resorts", + HouseholdApplianceStores => "household_appliance_stores", + IndustrialSupplies => "industrial_supplies", + InformationRetrievalServices => "information_retrieval_services", + InsuranceDefault => "insurance_default", + InsuranceUnderwritingPremiums => "insurance_underwriting_premiums", + IntraCompanyPurchases => "intra_company_purchases", + JewelryStoresWatchesClocksAndSilverwareStores => { + "jewelry_stores_watches_clocks_and_silverware_stores" + } + LandscapingServices => "landscaping_services", + Laundries => "laundries", + LaundryCleaningServices => "laundry_cleaning_services", + LegalServicesAttorneys => "legal_services_attorneys", + LuggageAndLeatherGoodsStores => "luggage_and_leather_goods_stores", + LumberBuildingMaterialsStores => "lumber_building_materials_stores", + ManualCashDisburse => "manual_cash_disburse", + MarinasServiceAndSupplies => "marinas_service_and_supplies", + Marketplaces => "marketplaces", + MasonryStoneworkAndPlaster => "masonry_stonework_and_plaster", + MassageParlors => "massage_parlors", + MedicalAndDentalLabs => "medical_and_dental_labs", + MedicalDentalOphthalmicAndHospitalEquipmentAndSupplies => { + "medical_dental_ophthalmic_and_hospital_equipment_and_supplies" + } + MedicalServices => "medical_services", + MembershipOrganizations => "membership_organizations", + MensAndBoysClothingAndAccessoriesStores => { + "mens_and_boys_clothing_and_accessories_stores" + } + MensWomensClothingStores => "mens_womens_clothing_stores", + MetalServiceCenters => "metal_service_centers", + Miscellaneous => "miscellaneous", + MiscellaneousApparelAndAccessoryShops => "miscellaneous_apparel_and_accessory_shops", + MiscellaneousAutoDealers => "miscellaneous_auto_dealers", + MiscellaneousBusinessServices => "miscellaneous_business_services", + MiscellaneousFoodStores => "miscellaneous_food_stores", + MiscellaneousGeneralMerchandise => "miscellaneous_general_merchandise", + MiscellaneousGeneralServices => "miscellaneous_general_services", + MiscellaneousHomeFurnishingSpecialtyStores => { + "miscellaneous_home_furnishing_specialty_stores" + } + MiscellaneousPublishingAndPrinting => "miscellaneous_publishing_and_printing", + MiscellaneousRecreationServices => "miscellaneous_recreation_services", + MiscellaneousRepairShops => "miscellaneous_repair_shops", + MiscellaneousSpecialtyRetail => "miscellaneous_specialty_retail", + MobileHomeDealers => "mobile_home_dealers", + MotionPictureTheaters => "motion_picture_theaters", + MotorFreightCarriersAndTrucking => "motor_freight_carriers_and_trucking", + MotorHomesDealers => "motor_homes_dealers", + MotorVehicleSuppliesAndNewParts => "motor_vehicle_supplies_and_new_parts", + MotorcycleShopsAndDealers => "motorcycle_shops_and_dealers", + MotorcycleShopsDealers => "motorcycle_shops_dealers", + MusicStoresMusicalInstrumentsPianosAndSheetMusic => { + "music_stores_musical_instruments_pianos_and_sheet_music" + } + NewsDealersAndNewsstands => "news_dealers_and_newsstands", + NonFiMoneyOrders => "non_fi_money_orders", + NonFiStoredValueCardPurchaseLoad => "non_fi_stored_value_card_purchase_load", + NondurableGoods => "nondurable_goods", + NurseriesLawnAndGardenSupplyStores => "nurseries_lawn_and_garden_supply_stores", + NursingPersonalCare => "nursing_personal_care", + OfficeAndCommercialFurniture => "office_and_commercial_furniture", + OpticiansEyeglasses => "opticians_eyeglasses", + OptometristsOphthalmologist => "optometrists_ophthalmologist", + OrthopedicGoodsProstheticDevices => "orthopedic_goods_prosthetic_devices", + Osteopaths => "osteopaths", + PackageStoresBeerWineAndLiquor => "package_stores_beer_wine_and_liquor", + PaintsVarnishesAndSupplies => "paints_varnishes_and_supplies", + ParkingLotsGarages => "parking_lots_garages", + PassengerRailways => "passenger_railways", + PawnShops => "pawn_shops", + PetShopsPetFoodAndSupplies => "pet_shops_pet_food_and_supplies", + PetroleumAndPetroleumProducts => "petroleum_and_petroleum_products", + PhotoDeveloping => "photo_developing", + PhotographicPhotocopyMicrofilmEquipmentAndSupplies => { + "photographic_photocopy_microfilm_equipment_and_supplies" + } + PhotographicStudios => "photographic_studios", + PictureVideoProduction => "picture_video_production", + PieceGoodsNotionsAndOtherDryGoods => "piece_goods_notions_and_other_dry_goods", + PlumbingHeatingEquipmentAndSupplies => "plumbing_heating_equipment_and_supplies", + PoliticalOrganizations => "political_organizations", + PostalServicesGovernmentOnly => "postal_services_government_only", + PreciousStonesAndMetalsWatchesAndJewelry => { + "precious_stones_and_metals_watches_and_jewelry" + } + ProfessionalServices => "professional_services", + PublicWarehousingAndStorage => "public_warehousing_and_storage", + QuickCopyReproAndBlueprint => "quick_copy_repro_and_blueprint", + Railroads => "railroads", + RealEstateAgentsAndManagersRentals => "real_estate_agents_and_managers_rentals", + RecordStores => "record_stores", + RecreationalVehicleRentals => "recreational_vehicle_rentals", + ReligiousGoodsStores => "religious_goods_stores", + ReligiousOrganizations => "religious_organizations", + RoofingSidingSheetMetal => "roofing_siding_sheet_metal", + SecretarialSupportServices => "secretarial_support_services", + SecurityBrokersDealers => "security_brokers_dealers", + ServiceStations => "service_stations", + SewingNeedleworkFabricAndPieceGoodsStores => { + "sewing_needlework_fabric_and_piece_goods_stores" + } + ShoeRepairHatCleaning => "shoe_repair_hat_cleaning", + ShoeStores => "shoe_stores", + SmallApplianceRepair => "small_appliance_repair", + SnowmobileDealers => "snowmobile_dealers", + SpecialTradeServices => "special_trade_services", + SpecialtyCleaning => "specialty_cleaning", + SportingGoodsStores => "sporting_goods_stores", + SportingRecreationCamps => "sporting_recreation_camps", + SportsAndRidingApparelStores => "sports_and_riding_apparel_stores", + SportsClubsFields => "sports_clubs_fields", + StampAndCoinStores => "stamp_and_coin_stores", + StationaryOfficeSuppliesPrintingAndWritingPaper => { + "stationary_office_supplies_printing_and_writing_paper" + } + StationeryStoresOfficeAndSchoolSupplyStores => { + "stationery_stores_office_and_school_supply_stores" + } + SwimmingPoolsSales => "swimming_pools_sales", + TUiTravelGermany => "t_ui_travel_germany", + TailorsAlterations => "tailors_alterations", + TaxPaymentsGovernmentAgencies => "tax_payments_government_agencies", + TaxPreparationServices => "tax_preparation_services", + TaxicabsLimousines => "taxicabs_limousines", + TelecommunicationEquipmentAndTelephoneSales => { + "telecommunication_equipment_and_telephone_sales" + } + TelecommunicationServices => "telecommunication_services", + TelegraphServices => "telegraph_services", + TentAndAwningShops => "tent_and_awning_shops", + TestingLaboratories => "testing_laboratories", + TheatricalTicketAgencies => "theatrical_ticket_agencies", + Timeshares => "timeshares", + TireRetreadingAndRepair => "tire_retreading_and_repair", + TollsBridgeFees => "tolls_bridge_fees", + TouristAttractionsAndExhibits => "tourist_attractions_and_exhibits", + TowingServices => "towing_services", + TrailerParksCampgrounds => "trailer_parks_campgrounds", + TransportationServices => "transportation_services", + TravelAgenciesTourOperators => "travel_agencies_tour_operators", + TruckStopIteration => "truck_stop_iteration", + TruckUtilityTrailerRentals => "truck_utility_trailer_rentals", + TypesettingPlateMakingAndRelatedServices => { + "typesetting_plate_making_and_related_services" + } + TypewriterStores => "typewriter_stores", + USFederalGovernmentAgenciesOrDepartments => { + "u_s_federal_government_agencies_or_departments" + } + UniformsCommercialClothing => "uniforms_commercial_clothing", + UsedMerchandiseAndSecondhandStores => "used_merchandise_and_secondhand_stores", + Utilities => "utilities", + VarietyStores => "variety_stores", + VeterinaryServices => "veterinary_services", + VideoAmusementGameSupplies => "video_amusement_game_supplies", + VideoGameArcades => "video_game_arcades", + VideoTapeRentalStores => "video_tape_rental_stores", + VocationalTradeSchools => "vocational_trade_schools", + WatchJewelryRepair => "watch_jewelry_repair", + WeldingRepair => "welding_repair", + WholesaleClubs => "wholesale_clubs", + WigAndToupeeStores => "wig_and_toupee_stores", + WiresMoneyOrders => "wires_money_orders", + WomensAccessoryAndSpecialtyShops => "womens_accessory_and_specialty_shops", + WomensReadyToWearStores => "womens_ready_to_wear_stores", + WreckingAndSalvageYards => "wrecking_and_salvage_yards", + Unknown => "unknown", + } + } +} + +impl std::str::FromStr for CreateIssuingCardholderSpendingControlsAllowedCategories { + type Err = (); + fn from_str(s: &str) -> Result { + use CreateIssuingCardholderSpendingControlsAllowedCategories::*; + match s { + "ac_refrigeration_repair" => Ok(AcRefrigerationRepair), + "accounting_bookkeeping_services" => Ok(AccountingBookkeepingServices), + "advertising_services" => Ok(AdvertisingServices), + "agricultural_cooperative" => Ok(AgriculturalCooperative), + "airlines_air_carriers" => Ok(AirlinesAirCarriers), + "airports_flying_fields" => Ok(AirportsFlyingFields), + "ambulance_services" => Ok(AmbulanceServices), + "amusement_parks_carnivals" => Ok(AmusementParksCarnivals), + "antique_reproductions" => Ok(AntiqueReproductions), + "antique_shops" => Ok(AntiqueShops), + "aquariums" => Ok(Aquariums), + "architectural_surveying_services" => Ok(ArchitecturalSurveyingServices), + "art_dealers_and_galleries" => Ok(ArtDealersAndGalleries), + "artists_supply_and_craft_shops" => Ok(ArtistsSupplyAndCraftShops), + "auto_and_home_supply_stores" => Ok(AutoAndHomeSupplyStores), + "auto_body_repair_shops" => Ok(AutoBodyRepairShops), + "auto_paint_shops" => Ok(AutoPaintShops), + "auto_service_shops" => Ok(AutoServiceShops), + "automated_cash_disburse" => Ok(AutomatedCashDisburse), + "automated_fuel_dispensers" => Ok(AutomatedFuelDispensers), + "automobile_associations" => Ok(AutomobileAssociations), + "automotive_parts_and_accessories_stores" => Ok(AutomotivePartsAndAccessoriesStores), + "automotive_tire_stores" => Ok(AutomotiveTireStores), + "bail_and_bond_payments" => Ok(BailAndBondPayments), + "bakeries" => Ok(Bakeries), + "bands_orchestras" => Ok(BandsOrchestras), + "barber_and_beauty_shops" => Ok(BarberAndBeautyShops), + "betting_casino_gambling" => Ok(BettingCasinoGambling), + "bicycle_shops" => Ok(BicycleShops), + "billiard_pool_establishments" => Ok(BilliardPoolEstablishments), + "boat_dealers" => Ok(BoatDealers), + "boat_rentals_and_leases" => Ok(BoatRentalsAndLeases), + "book_stores" => Ok(BookStores), + "books_periodicals_and_newspapers" => Ok(BooksPeriodicalsAndNewspapers), + "bowling_alleys" => Ok(BowlingAlleys), + "bus_lines" => Ok(BusLines), + "business_secretarial_schools" => Ok(BusinessSecretarialSchools), + "buying_shopping_services" => Ok(BuyingShoppingServices), + "cable_satellite_and_other_pay_television_and_radio" => { + Ok(CableSatelliteAndOtherPayTelevisionAndRadio) + } + "camera_and_photographic_supply_stores" => Ok(CameraAndPhotographicSupplyStores), + "candy_nut_and_confectionery_stores" => Ok(CandyNutAndConfectioneryStores), + "car_and_truck_dealers_new_used" => Ok(CarAndTruckDealersNewUsed), + "car_and_truck_dealers_used_only" => Ok(CarAndTruckDealersUsedOnly), + "car_rental_agencies" => Ok(CarRentalAgencies), + "car_washes" => Ok(CarWashes), + "carpentry_services" => Ok(CarpentryServices), + "carpet_upholstery_cleaning" => Ok(CarpetUpholsteryCleaning), + "caterers" => Ok(Caterers), + "charitable_and_social_service_organizations_fundraising" => { + Ok(CharitableAndSocialServiceOrganizationsFundraising) + } + "chemicals_and_allied_products" => Ok(ChemicalsAndAlliedProducts), + "child_care_services" => Ok(ChildCareServices), + "childrens_and_infants_wear_stores" => Ok(ChildrensAndInfantsWearStores), + "chiropodists_podiatrists" => Ok(ChiropodistsPodiatrists), + "chiropractors" => Ok(Chiropractors), + "cigar_stores_and_stands" => Ok(CigarStoresAndStands), + "civic_social_fraternal_associations" => Ok(CivicSocialFraternalAssociations), + "cleaning_and_maintenance" => Ok(CleaningAndMaintenance), + "clothing_rental" => Ok(ClothingRental), + "colleges_universities" => Ok(CollegesUniversities), + "commercial_equipment" => Ok(CommercialEquipment), + "commercial_footwear" => Ok(CommercialFootwear), + "commercial_photography_art_and_graphics" => Ok(CommercialPhotographyArtAndGraphics), + "commuter_transport_and_ferries" => Ok(CommuterTransportAndFerries), + "computer_network_services" => Ok(ComputerNetworkServices), + "computer_programming" => Ok(ComputerProgramming), + "computer_repair" => Ok(ComputerRepair), + "computer_software_stores" => Ok(ComputerSoftwareStores), + "computers_peripherals_and_software" => Ok(ComputersPeripheralsAndSoftware), + "concrete_work_services" => Ok(ConcreteWorkServices), + "construction_materials" => Ok(ConstructionMaterials), + "consulting_public_relations" => Ok(ConsultingPublicRelations), + "correspondence_schools" => Ok(CorrespondenceSchools), + "cosmetic_stores" => Ok(CosmeticStores), + "counseling_services" => Ok(CounselingServices), + "country_clubs" => Ok(CountryClubs), + "courier_services" => Ok(CourierServices), + "court_costs" => Ok(CourtCosts), + "credit_reporting_agencies" => Ok(CreditReportingAgencies), + "cruise_lines" => Ok(CruiseLines), + "dairy_products_stores" => Ok(DairyProductsStores), + "dance_hall_studios_schools" => Ok(DanceHallStudiosSchools), + "dating_escort_services" => Ok(DatingEscortServices), + "dentists_orthodontists" => Ok(DentistsOrthodontists), + "department_stores" => Ok(DepartmentStores), + "detective_agencies" => Ok(DetectiveAgencies), + "digital_goods_applications" => Ok(DigitalGoodsApplications), + "digital_goods_games" => Ok(DigitalGoodsGames), + "digital_goods_large_volume" => Ok(DigitalGoodsLargeVolume), + "digital_goods_media" => Ok(DigitalGoodsMedia), + "direct_marketing_catalog_merchant" => Ok(DirectMarketingCatalogMerchant), + "direct_marketing_combination_catalog_and_retail_merchant" => { + Ok(DirectMarketingCombinationCatalogAndRetailMerchant) + } + "direct_marketing_inbound_telemarketing" => Ok(DirectMarketingInboundTelemarketing), + "direct_marketing_insurance_services" => Ok(DirectMarketingInsuranceServices), + "direct_marketing_other" => Ok(DirectMarketingOther), + "direct_marketing_outbound_telemarketing" => Ok(DirectMarketingOutboundTelemarketing), + "direct_marketing_subscription" => Ok(DirectMarketingSubscription), + "direct_marketing_travel" => Ok(DirectMarketingTravel), + "discount_stores" => Ok(DiscountStores), + "doctors" => Ok(Doctors), + "door_to_door_sales" => Ok(DoorToDoorSales), + "drapery_window_covering_and_upholstery_stores" => { + Ok(DraperyWindowCoveringAndUpholsteryStores) + } + "drinking_places" => Ok(DrinkingPlaces), + "drug_stores_and_pharmacies" => Ok(DrugStoresAndPharmacies), + "drugs_drug_proprietaries_and_druggist_sundries" => { + Ok(DrugsDrugProprietariesAndDruggistSundries) + } + "dry_cleaners" => Ok(DryCleaners), + "durable_goods" => Ok(DurableGoods), + "duty_free_stores" => Ok(DutyFreeStores), + "eating_places_restaurants" => Ok(EatingPlacesRestaurants), + "educational_services" => Ok(EducationalServices), + "electric_razor_stores" => Ok(ElectricRazorStores), + "electric_vehicle_charging" => Ok(ElectricVehicleCharging), + "electrical_parts_and_equipment" => Ok(ElectricalPartsAndEquipment), + "electrical_services" => Ok(ElectricalServices), + "electronics_repair_shops" => Ok(ElectronicsRepairShops), + "electronics_stores" => Ok(ElectronicsStores), + "elementary_secondary_schools" => Ok(ElementarySecondarySchools), + "emergency_services_gcas_visa_use_only" => Ok(EmergencyServicesGcasVisaUseOnly), + "employment_temp_agencies" => Ok(EmploymentTempAgencies), + "equipment_rental" => Ok(EquipmentRental), + "exterminating_services" => Ok(ExterminatingServices), + "family_clothing_stores" => Ok(FamilyClothingStores), + "fast_food_restaurants" => Ok(FastFoodRestaurants), + "financial_institutions" => Ok(FinancialInstitutions), + "fines_government_administrative_entities" => Ok(FinesGovernmentAdministrativeEntities), + "fireplace_fireplace_screens_and_accessories_stores" => { + Ok(FireplaceFireplaceScreensAndAccessoriesStores) + } + "floor_covering_stores" => Ok(FloorCoveringStores), + "florists" => Ok(Florists), + "florists_supplies_nursery_stock_and_flowers" => { + Ok(FloristsSuppliesNurseryStockAndFlowers) + } + "freezer_and_locker_meat_provisioners" => Ok(FreezerAndLockerMeatProvisioners), + "fuel_dealers_non_automotive" => Ok(FuelDealersNonAutomotive), + "funeral_services_crematories" => Ok(FuneralServicesCrematories), + "furniture_home_furnishings_and_equipment_stores_except_appliances" => { + Ok(FurnitureHomeFurnishingsAndEquipmentStoresExceptAppliances) + } + "furniture_repair_refinishing" => Ok(FurnitureRepairRefinishing), + "furriers_and_fur_shops" => Ok(FurriersAndFurShops), + "general_services" => Ok(GeneralServices), + "gift_card_novelty_and_souvenir_shops" => Ok(GiftCardNoveltyAndSouvenirShops), + "glass_paint_and_wallpaper_stores" => Ok(GlassPaintAndWallpaperStores), + "glassware_crystal_stores" => Ok(GlasswareCrystalStores), + "golf_courses_public" => Ok(GolfCoursesPublic), + "government_licensed_horse_dog_racing_us_region_only" => { + Ok(GovernmentLicensedHorseDogRacingUsRegionOnly) + } + "government_licensed_online_casions_online_gambling_us_region_only" => { + Ok(GovernmentLicensedOnlineCasionsOnlineGamblingUsRegionOnly) + } + "government_owned_lotteries_non_us_region" => Ok(GovernmentOwnedLotteriesNonUsRegion), + "government_owned_lotteries_us_region_only" => Ok(GovernmentOwnedLotteriesUsRegionOnly), + "government_services" => Ok(GovernmentServices), + "grocery_stores_supermarkets" => Ok(GroceryStoresSupermarkets), + "hardware_equipment_and_supplies" => Ok(HardwareEquipmentAndSupplies), + "hardware_stores" => Ok(HardwareStores), + "health_and_beauty_spas" => Ok(HealthAndBeautySpas), + "hearing_aids_sales_and_supplies" => Ok(HearingAidsSalesAndSupplies), + "heating_plumbing_a_c" => Ok(HeatingPlumbingAC), + "hobby_toy_and_game_shops" => Ok(HobbyToyAndGameShops), + "home_supply_warehouse_stores" => Ok(HomeSupplyWarehouseStores), + "hospitals" => Ok(Hospitals), + "hotels_motels_and_resorts" => Ok(HotelsMotelsAndResorts), + "household_appliance_stores" => Ok(HouseholdApplianceStores), + "industrial_supplies" => Ok(IndustrialSupplies), + "information_retrieval_services" => Ok(InformationRetrievalServices), + "insurance_default" => Ok(InsuranceDefault), + "insurance_underwriting_premiums" => Ok(InsuranceUnderwritingPremiums), + "intra_company_purchases" => Ok(IntraCompanyPurchases), + "jewelry_stores_watches_clocks_and_silverware_stores" => { + Ok(JewelryStoresWatchesClocksAndSilverwareStores) + } + "landscaping_services" => Ok(LandscapingServices), + "laundries" => Ok(Laundries), + "laundry_cleaning_services" => Ok(LaundryCleaningServices), + "legal_services_attorneys" => Ok(LegalServicesAttorneys), + "luggage_and_leather_goods_stores" => Ok(LuggageAndLeatherGoodsStores), + "lumber_building_materials_stores" => Ok(LumberBuildingMaterialsStores), + "manual_cash_disburse" => Ok(ManualCashDisburse), + "marinas_service_and_supplies" => Ok(MarinasServiceAndSupplies), + "marketplaces" => Ok(Marketplaces), + "masonry_stonework_and_plaster" => Ok(MasonryStoneworkAndPlaster), + "massage_parlors" => Ok(MassageParlors), + "medical_and_dental_labs" => Ok(MedicalAndDentalLabs), + "medical_dental_ophthalmic_and_hospital_equipment_and_supplies" => { + Ok(MedicalDentalOphthalmicAndHospitalEquipmentAndSupplies) + } + "medical_services" => Ok(MedicalServices), + "membership_organizations" => Ok(MembershipOrganizations), + "mens_and_boys_clothing_and_accessories_stores" => { + Ok(MensAndBoysClothingAndAccessoriesStores) + } + "mens_womens_clothing_stores" => Ok(MensWomensClothingStores), + "metal_service_centers" => Ok(MetalServiceCenters), + "miscellaneous" => Ok(Miscellaneous), + "miscellaneous_apparel_and_accessory_shops" => { + Ok(MiscellaneousApparelAndAccessoryShops) + } + "miscellaneous_auto_dealers" => Ok(MiscellaneousAutoDealers), + "miscellaneous_business_services" => Ok(MiscellaneousBusinessServices), + "miscellaneous_food_stores" => Ok(MiscellaneousFoodStores), + "miscellaneous_general_merchandise" => Ok(MiscellaneousGeneralMerchandise), + "miscellaneous_general_services" => Ok(MiscellaneousGeneralServices), + "miscellaneous_home_furnishing_specialty_stores" => { + Ok(MiscellaneousHomeFurnishingSpecialtyStores) + } + "miscellaneous_publishing_and_printing" => Ok(MiscellaneousPublishingAndPrinting), + "miscellaneous_recreation_services" => Ok(MiscellaneousRecreationServices), + "miscellaneous_repair_shops" => Ok(MiscellaneousRepairShops), + "miscellaneous_specialty_retail" => Ok(MiscellaneousSpecialtyRetail), + "mobile_home_dealers" => Ok(MobileHomeDealers), + "motion_picture_theaters" => Ok(MotionPictureTheaters), + "motor_freight_carriers_and_trucking" => Ok(MotorFreightCarriersAndTrucking), + "motor_homes_dealers" => Ok(MotorHomesDealers), + "motor_vehicle_supplies_and_new_parts" => Ok(MotorVehicleSuppliesAndNewParts), + "motorcycle_shops_and_dealers" => Ok(MotorcycleShopsAndDealers), + "motorcycle_shops_dealers" => Ok(MotorcycleShopsDealers), + "music_stores_musical_instruments_pianos_and_sheet_music" => { + Ok(MusicStoresMusicalInstrumentsPianosAndSheetMusic) + } + "news_dealers_and_newsstands" => Ok(NewsDealersAndNewsstands), + "non_fi_money_orders" => Ok(NonFiMoneyOrders), + "non_fi_stored_value_card_purchase_load" => Ok(NonFiStoredValueCardPurchaseLoad), + "nondurable_goods" => Ok(NondurableGoods), + "nurseries_lawn_and_garden_supply_stores" => Ok(NurseriesLawnAndGardenSupplyStores), + "nursing_personal_care" => Ok(NursingPersonalCare), + "office_and_commercial_furniture" => Ok(OfficeAndCommercialFurniture), + "opticians_eyeglasses" => Ok(OpticiansEyeglasses), + "optometrists_ophthalmologist" => Ok(OptometristsOphthalmologist), + "orthopedic_goods_prosthetic_devices" => Ok(OrthopedicGoodsProstheticDevices), + "osteopaths" => Ok(Osteopaths), + "package_stores_beer_wine_and_liquor" => Ok(PackageStoresBeerWineAndLiquor), + "paints_varnishes_and_supplies" => Ok(PaintsVarnishesAndSupplies), + "parking_lots_garages" => Ok(ParkingLotsGarages), + "passenger_railways" => Ok(PassengerRailways), + "pawn_shops" => Ok(PawnShops), + "pet_shops_pet_food_and_supplies" => Ok(PetShopsPetFoodAndSupplies), + "petroleum_and_petroleum_products" => Ok(PetroleumAndPetroleumProducts), + "photo_developing" => Ok(PhotoDeveloping), + "photographic_photocopy_microfilm_equipment_and_supplies" => { + Ok(PhotographicPhotocopyMicrofilmEquipmentAndSupplies) + } + "photographic_studios" => Ok(PhotographicStudios), + "picture_video_production" => Ok(PictureVideoProduction), + "piece_goods_notions_and_other_dry_goods" => Ok(PieceGoodsNotionsAndOtherDryGoods), + "plumbing_heating_equipment_and_supplies" => Ok(PlumbingHeatingEquipmentAndSupplies), + "political_organizations" => Ok(PoliticalOrganizations), + "postal_services_government_only" => Ok(PostalServicesGovernmentOnly), + "precious_stones_and_metals_watches_and_jewelry" => { + Ok(PreciousStonesAndMetalsWatchesAndJewelry) + } + "professional_services" => Ok(ProfessionalServices), + "public_warehousing_and_storage" => Ok(PublicWarehousingAndStorage), + "quick_copy_repro_and_blueprint" => Ok(QuickCopyReproAndBlueprint), + "railroads" => Ok(Railroads), + "real_estate_agents_and_managers_rentals" => Ok(RealEstateAgentsAndManagersRentals), + "record_stores" => Ok(RecordStores), + "recreational_vehicle_rentals" => Ok(RecreationalVehicleRentals), + "religious_goods_stores" => Ok(ReligiousGoodsStores), + "religious_organizations" => Ok(ReligiousOrganizations), + "roofing_siding_sheet_metal" => Ok(RoofingSidingSheetMetal), + "secretarial_support_services" => Ok(SecretarialSupportServices), + "security_brokers_dealers" => Ok(SecurityBrokersDealers), + "service_stations" => Ok(ServiceStations), + "sewing_needlework_fabric_and_piece_goods_stores" => { + Ok(SewingNeedleworkFabricAndPieceGoodsStores) + } + "shoe_repair_hat_cleaning" => Ok(ShoeRepairHatCleaning), + "shoe_stores" => Ok(ShoeStores), + "small_appliance_repair" => Ok(SmallApplianceRepair), + "snowmobile_dealers" => Ok(SnowmobileDealers), + "special_trade_services" => Ok(SpecialTradeServices), + "specialty_cleaning" => Ok(SpecialtyCleaning), + "sporting_goods_stores" => Ok(SportingGoodsStores), + "sporting_recreation_camps" => Ok(SportingRecreationCamps), + "sports_and_riding_apparel_stores" => Ok(SportsAndRidingApparelStores), + "sports_clubs_fields" => Ok(SportsClubsFields), + "stamp_and_coin_stores" => Ok(StampAndCoinStores), + "stationary_office_supplies_printing_and_writing_paper" => { + Ok(StationaryOfficeSuppliesPrintingAndWritingPaper) + } + "stationery_stores_office_and_school_supply_stores" => { + Ok(StationeryStoresOfficeAndSchoolSupplyStores) + } + "swimming_pools_sales" => Ok(SwimmingPoolsSales), + "t_ui_travel_germany" => Ok(TUiTravelGermany), + "tailors_alterations" => Ok(TailorsAlterations), + "tax_payments_government_agencies" => Ok(TaxPaymentsGovernmentAgencies), + "tax_preparation_services" => Ok(TaxPreparationServices), + "taxicabs_limousines" => Ok(TaxicabsLimousines), + "telecommunication_equipment_and_telephone_sales" => { + Ok(TelecommunicationEquipmentAndTelephoneSales) + } + "telecommunication_services" => Ok(TelecommunicationServices), + "telegraph_services" => Ok(TelegraphServices), + "tent_and_awning_shops" => Ok(TentAndAwningShops), + "testing_laboratories" => Ok(TestingLaboratories), + "theatrical_ticket_agencies" => Ok(TheatricalTicketAgencies), + "timeshares" => Ok(Timeshares), + "tire_retreading_and_repair" => Ok(TireRetreadingAndRepair), + "tolls_bridge_fees" => Ok(TollsBridgeFees), + "tourist_attractions_and_exhibits" => Ok(TouristAttractionsAndExhibits), + "towing_services" => Ok(TowingServices), + "trailer_parks_campgrounds" => Ok(TrailerParksCampgrounds), + "transportation_services" => Ok(TransportationServices), + "travel_agencies_tour_operators" => Ok(TravelAgenciesTourOperators), + "truck_stop_iteration" => Ok(TruckStopIteration), + "truck_utility_trailer_rentals" => Ok(TruckUtilityTrailerRentals), + "typesetting_plate_making_and_related_services" => { + Ok(TypesettingPlateMakingAndRelatedServices) + } + "typewriter_stores" => Ok(TypewriterStores), + "u_s_federal_government_agencies_or_departments" => { + Ok(USFederalGovernmentAgenciesOrDepartments) + } + "uniforms_commercial_clothing" => Ok(UniformsCommercialClothing), + "used_merchandise_and_secondhand_stores" => Ok(UsedMerchandiseAndSecondhandStores), + "utilities" => Ok(Utilities), + "variety_stores" => Ok(VarietyStores), + "veterinary_services" => Ok(VeterinaryServices), + "video_amusement_game_supplies" => Ok(VideoAmusementGameSupplies), + "video_game_arcades" => Ok(VideoGameArcades), + "video_tape_rental_stores" => Ok(VideoTapeRentalStores), + "vocational_trade_schools" => Ok(VocationalTradeSchools), + "watch_jewelry_repair" => Ok(WatchJewelryRepair), + "welding_repair" => Ok(WeldingRepair), + "wholesale_clubs" => Ok(WholesaleClubs), + "wig_and_toupee_stores" => Ok(WigAndToupeeStores), + "wires_money_orders" => Ok(WiresMoneyOrders), + "womens_accessory_and_specialty_shops" => Ok(WomensAccessoryAndSpecialtyShops), + "womens_ready_to_wear_stores" => Ok(WomensReadyToWearStores), + "wrecking_and_salvage_yards" => Ok(WreckingAndSalvageYards), + _ => Err(()), + } + } +} +impl std::fmt::Display for CreateIssuingCardholderSpendingControlsAllowedCategories { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreateIssuingCardholderSpendingControlsAllowedCategories { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreateIssuingCardholderSpendingControlsAllowedCategories { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Array of strings containing [categories](https://stripe.com/docs/api#issuing_authorization_object-merchant_data-category) of authorizations to decline. +/// All other categories will be allowed. +/// Cannot be set with `allowed_categories`. +#[derive(Copy, Clone, Eq, PartialEq)] +#[non_exhaustive] +pub enum CreateIssuingCardholderSpendingControlsBlockedCategories { + AcRefrigerationRepair, + AccountingBookkeepingServices, + AdvertisingServices, + AgriculturalCooperative, + AirlinesAirCarriers, + AirportsFlyingFields, + AmbulanceServices, + AmusementParksCarnivals, + AntiqueReproductions, + AntiqueShops, + Aquariums, + ArchitecturalSurveyingServices, + ArtDealersAndGalleries, + ArtistsSupplyAndCraftShops, + AutoAndHomeSupplyStores, + AutoBodyRepairShops, + AutoPaintShops, + AutoServiceShops, + AutomatedCashDisburse, + AutomatedFuelDispensers, + AutomobileAssociations, + AutomotivePartsAndAccessoriesStores, + AutomotiveTireStores, + BailAndBondPayments, + Bakeries, + BandsOrchestras, + BarberAndBeautyShops, + BettingCasinoGambling, + BicycleShops, + BilliardPoolEstablishments, + BoatDealers, + BoatRentalsAndLeases, + BookStores, + BooksPeriodicalsAndNewspapers, + BowlingAlleys, + BusLines, + BusinessSecretarialSchools, + BuyingShoppingServices, + CableSatelliteAndOtherPayTelevisionAndRadio, + CameraAndPhotographicSupplyStores, + CandyNutAndConfectioneryStores, + CarAndTruckDealersNewUsed, + CarAndTruckDealersUsedOnly, + CarRentalAgencies, + CarWashes, + CarpentryServices, + CarpetUpholsteryCleaning, + Caterers, + CharitableAndSocialServiceOrganizationsFundraising, + ChemicalsAndAlliedProducts, + ChildCareServices, + ChildrensAndInfantsWearStores, + ChiropodistsPodiatrists, + Chiropractors, + CigarStoresAndStands, + CivicSocialFraternalAssociations, + CleaningAndMaintenance, + ClothingRental, + CollegesUniversities, + CommercialEquipment, + CommercialFootwear, + CommercialPhotographyArtAndGraphics, + CommuterTransportAndFerries, + ComputerNetworkServices, + ComputerProgramming, + ComputerRepair, + ComputerSoftwareStores, + ComputersPeripheralsAndSoftware, + ConcreteWorkServices, + ConstructionMaterials, + ConsultingPublicRelations, + CorrespondenceSchools, + CosmeticStores, + CounselingServices, + CountryClubs, + CourierServices, + CourtCosts, + CreditReportingAgencies, + CruiseLines, + DairyProductsStores, + DanceHallStudiosSchools, + DatingEscortServices, + DentistsOrthodontists, + DepartmentStores, + DetectiveAgencies, + DigitalGoodsApplications, + DigitalGoodsGames, + DigitalGoodsLargeVolume, + DigitalGoodsMedia, + DirectMarketingCatalogMerchant, + DirectMarketingCombinationCatalogAndRetailMerchant, + DirectMarketingInboundTelemarketing, + DirectMarketingInsuranceServices, + DirectMarketingOther, + DirectMarketingOutboundTelemarketing, + DirectMarketingSubscription, + DirectMarketingTravel, + DiscountStores, + Doctors, + DoorToDoorSales, + DraperyWindowCoveringAndUpholsteryStores, + DrinkingPlaces, + DrugStoresAndPharmacies, + DrugsDrugProprietariesAndDruggistSundries, + DryCleaners, + DurableGoods, + DutyFreeStores, + EatingPlacesRestaurants, + EducationalServices, + ElectricRazorStores, + ElectricVehicleCharging, + ElectricalPartsAndEquipment, + ElectricalServices, + ElectronicsRepairShops, + ElectronicsStores, + ElementarySecondarySchools, + EmergencyServicesGcasVisaUseOnly, + EmploymentTempAgencies, + EquipmentRental, + ExterminatingServices, + FamilyClothingStores, + FastFoodRestaurants, + FinancialInstitutions, + FinesGovernmentAdministrativeEntities, + FireplaceFireplaceScreensAndAccessoriesStores, + FloorCoveringStores, + Florists, + FloristsSuppliesNurseryStockAndFlowers, + FreezerAndLockerMeatProvisioners, + FuelDealersNonAutomotive, + FuneralServicesCrematories, + FurnitureHomeFurnishingsAndEquipmentStoresExceptAppliances, + FurnitureRepairRefinishing, + FurriersAndFurShops, + GeneralServices, + GiftCardNoveltyAndSouvenirShops, + GlassPaintAndWallpaperStores, + GlasswareCrystalStores, + GolfCoursesPublic, + GovernmentLicensedHorseDogRacingUsRegionOnly, + GovernmentLicensedOnlineCasionsOnlineGamblingUsRegionOnly, + GovernmentOwnedLotteriesNonUsRegion, + GovernmentOwnedLotteriesUsRegionOnly, + GovernmentServices, + GroceryStoresSupermarkets, + HardwareEquipmentAndSupplies, + HardwareStores, + HealthAndBeautySpas, + HearingAidsSalesAndSupplies, + HeatingPlumbingAC, + HobbyToyAndGameShops, + HomeSupplyWarehouseStores, + Hospitals, + HotelsMotelsAndResorts, + HouseholdApplianceStores, + IndustrialSupplies, + InformationRetrievalServices, + InsuranceDefault, + InsuranceUnderwritingPremiums, + IntraCompanyPurchases, + JewelryStoresWatchesClocksAndSilverwareStores, + LandscapingServices, + Laundries, + LaundryCleaningServices, + LegalServicesAttorneys, + LuggageAndLeatherGoodsStores, + LumberBuildingMaterialsStores, + ManualCashDisburse, + MarinasServiceAndSupplies, + Marketplaces, + MasonryStoneworkAndPlaster, + MassageParlors, + MedicalAndDentalLabs, + MedicalDentalOphthalmicAndHospitalEquipmentAndSupplies, + MedicalServices, + MembershipOrganizations, + MensAndBoysClothingAndAccessoriesStores, + MensWomensClothingStores, + MetalServiceCenters, + Miscellaneous, + MiscellaneousApparelAndAccessoryShops, + MiscellaneousAutoDealers, + MiscellaneousBusinessServices, + MiscellaneousFoodStores, + MiscellaneousGeneralMerchandise, + MiscellaneousGeneralServices, + MiscellaneousHomeFurnishingSpecialtyStores, + MiscellaneousPublishingAndPrinting, + MiscellaneousRecreationServices, + MiscellaneousRepairShops, + MiscellaneousSpecialtyRetail, + MobileHomeDealers, + MotionPictureTheaters, + MotorFreightCarriersAndTrucking, + MotorHomesDealers, + MotorVehicleSuppliesAndNewParts, + MotorcycleShopsAndDealers, + MotorcycleShopsDealers, + MusicStoresMusicalInstrumentsPianosAndSheetMusic, + NewsDealersAndNewsstands, + NonFiMoneyOrders, + NonFiStoredValueCardPurchaseLoad, + NondurableGoods, + NurseriesLawnAndGardenSupplyStores, + NursingPersonalCare, + OfficeAndCommercialFurniture, + OpticiansEyeglasses, + OptometristsOphthalmologist, + OrthopedicGoodsProstheticDevices, + Osteopaths, + PackageStoresBeerWineAndLiquor, + PaintsVarnishesAndSupplies, + ParkingLotsGarages, + PassengerRailways, + PawnShops, + PetShopsPetFoodAndSupplies, + PetroleumAndPetroleumProducts, + PhotoDeveloping, + PhotographicPhotocopyMicrofilmEquipmentAndSupplies, + PhotographicStudios, + PictureVideoProduction, + PieceGoodsNotionsAndOtherDryGoods, + PlumbingHeatingEquipmentAndSupplies, + PoliticalOrganizations, + PostalServicesGovernmentOnly, + PreciousStonesAndMetalsWatchesAndJewelry, + ProfessionalServices, + PublicWarehousingAndStorage, + QuickCopyReproAndBlueprint, + Railroads, + RealEstateAgentsAndManagersRentals, + RecordStores, + RecreationalVehicleRentals, + ReligiousGoodsStores, + ReligiousOrganizations, + RoofingSidingSheetMetal, + SecretarialSupportServices, + SecurityBrokersDealers, + ServiceStations, + SewingNeedleworkFabricAndPieceGoodsStores, + ShoeRepairHatCleaning, + ShoeStores, + SmallApplianceRepair, + SnowmobileDealers, + SpecialTradeServices, + SpecialtyCleaning, + SportingGoodsStores, + SportingRecreationCamps, + SportsAndRidingApparelStores, + SportsClubsFields, + StampAndCoinStores, + StationaryOfficeSuppliesPrintingAndWritingPaper, + StationeryStoresOfficeAndSchoolSupplyStores, + SwimmingPoolsSales, + TUiTravelGermany, + TailorsAlterations, + TaxPaymentsGovernmentAgencies, + TaxPreparationServices, + TaxicabsLimousines, + TelecommunicationEquipmentAndTelephoneSales, + TelecommunicationServices, + TelegraphServices, + TentAndAwningShops, + TestingLaboratories, + TheatricalTicketAgencies, + Timeshares, + TireRetreadingAndRepair, + TollsBridgeFees, + TouristAttractionsAndExhibits, + TowingServices, + TrailerParksCampgrounds, + TransportationServices, + TravelAgenciesTourOperators, + TruckStopIteration, + TruckUtilityTrailerRentals, + TypesettingPlateMakingAndRelatedServices, + TypewriterStores, + USFederalGovernmentAgenciesOrDepartments, + UniformsCommercialClothing, + UsedMerchandiseAndSecondhandStores, + Utilities, + VarietyStores, + VeterinaryServices, + VideoAmusementGameSupplies, + VideoGameArcades, + VideoTapeRentalStores, + VocationalTradeSchools, + WatchJewelryRepair, + WeldingRepair, + WholesaleClubs, + WigAndToupeeStores, + WiresMoneyOrders, + WomensAccessoryAndSpecialtyShops, + WomensReadyToWearStores, + WreckingAndSalvageYards, + /// An unrecognized value from Stripe. Should not be used as a request parameter. + Unknown, +} +impl CreateIssuingCardholderSpendingControlsBlockedCategories { + pub fn as_str(self) -> &'static str { + use CreateIssuingCardholderSpendingControlsBlockedCategories::*; + match self { + AcRefrigerationRepair => "ac_refrigeration_repair", + AccountingBookkeepingServices => "accounting_bookkeeping_services", + AdvertisingServices => "advertising_services", + AgriculturalCooperative => "agricultural_cooperative", + AirlinesAirCarriers => "airlines_air_carriers", + AirportsFlyingFields => "airports_flying_fields", + AmbulanceServices => "ambulance_services", + AmusementParksCarnivals => "amusement_parks_carnivals", + AntiqueReproductions => "antique_reproductions", + AntiqueShops => "antique_shops", + Aquariums => "aquariums", + ArchitecturalSurveyingServices => "architectural_surveying_services", + ArtDealersAndGalleries => "art_dealers_and_galleries", + ArtistsSupplyAndCraftShops => "artists_supply_and_craft_shops", + AutoAndHomeSupplyStores => "auto_and_home_supply_stores", + AutoBodyRepairShops => "auto_body_repair_shops", + AutoPaintShops => "auto_paint_shops", + AutoServiceShops => "auto_service_shops", + AutomatedCashDisburse => "automated_cash_disburse", + AutomatedFuelDispensers => "automated_fuel_dispensers", + AutomobileAssociations => "automobile_associations", + AutomotivePartsAndAccessoriesStores => "automotive_parts_and_accessories_stores", + AutomotiveTireStores => "automotive_tire_stores", + BailAndBondPayments => "bail_and_bond_payments", + Bakeries => "bakeries", + BandsOrchestras => "bands_orchestras", + BarberAndBeautyShops => "barber_and_beauty_shops", + BettingCasinoGambling => "betting_casino_gambling", + BicycleShops => "bicycle_shops", + BilliardPoolEstablishments => "billiard_pool_establishments", + BoatDealers => "boat_dealers", + BoatRentalsAndLeases => "boat_rentals_and_leases", + BookStores => "book_stores", + BooksPeriodicalsAndNewspapers => "books_periodicals_and_newspapers", + BowlingAlleys => "bowling_alleys", + BusLines => "bus_lines", + BusinessSecretarialSchools => "business_secretarial_schools", + BuyingShoppingServices => "buying_shopping_services", + CableSatelliteAndOtherPayTelevisionAndRadio => { + "cable_satellite_and_other_pay_television_and_radio" + } + CameraAndPhotographicSupplyStores => "camera_and_photographic_supply_stores", + CandyNutAndConfectioneryStores => "candy_nut_and_confectionery_stores", + CarAndTruckDealersNewUsed => "car_and_truck_dealers_new_used", + CarAndTruckDealersUsedOnly => "car_and_truck_dealers_used_only", + CarRentalAgencies => "car_rental_agencies", + CarWashes => "car_washes", + CarpentryServices => "carpentry_services", + CarpetUpholsteryCleaning => "carpet_upholstery_cleaning", + Caterers => "caterers", + CharitableAndSocialServiceOrganizationsFundraising => { + "charitable_and_social_service_organizations_fundraising" + } + ChemicalsAndAlliedProducts => "chemicals_and_allied_products", + ChildCareServices => "child_care_services", + ChildrensAndInfantsWearStores => "childrens_and_infants_wear_stores", + ChiropodistsPodiatrists => "chiropodists_podiatrists", + Chiropractors => "chiropractors", + CigarStoresAndStands => "cigar_stores_and_stands", + CivicSocialFraternalAssociations => "civic_social_fraternal_associations", + CleaningAndMaintenance => "cleaning_and_maintenance", + ClothingRental => "clothing_rental", + CollegesUniversities => "colleges_universities", + CommercialEquipment => "commercial_equipment", + CommercialFootwear => "commercial_footwear", + CommercialPhotographyArtAndGraphics => "commercial_photography_art_and_graphics", + CommuterTransportAndFerries => "commuter_transport_and_ferries", + ComputerNetworkServices => "computer_network_services", + ComputerProgramming => "computer_programming", + ComputerRepair => "computer_repair", + ComputerSoftwareStores => "computer_software_stores", + ComputersPeripheralsAndSoftware => "computers_peripherals_and_software", + ConcreteWorkServices => "concrete_work_services", + ConstructionMaterials => "construction_materials", + ConsultingPublicRelations => "consulting_public_relations", + CorrespondenceSchools => "correspondence_schools", + CosmeticStores => "cosmetic_stores", + CounselingServices => "counseling_services", + CountryClubs => "country_clubs", + CourierServices => "courier_services", + CourtCosts => "court_costs", + CreditReportingAgencies => "credit_reporting_agencies", + CruiseLines => "cruise_lines", + DairyProductsStores => "dairy_products_stores", + DanceHallStudiosSchools => "dance_hall_studios_schools", + DatingEscortServices => "dating_escort_services", + DentistsOrthodontists => "dentists_orthodontists", + DepartmentStores => "department_stores", + DetectiveAgencies => "detective_agencies", + DigitalGoodsApplications => "digital_goods_applications", + DigitalGoodsGames => "digital_goods_games", + DigitalGoodsLargeVolume => "digital_goods_large_volume", + DigitalGoodsMedia => "digital_goods_media", + DirectMarketingCatalogMerchant => "direct_marketing_catalog_merchant", + DirectMarketingCombinationCatalogAndRetailMerchant => { + "direct_marketing_combination_catalog_and_retail_merchant" + } + DirectMarketingInboundTelemarketing => "direct_marketing_inbound_telemarketing", + DirectMarketingInsuranceServices => "direct_marketing_insurance_services", + DirectMarketingOther => "direct_marketing_other", + DirectMarketingOutboundTelemarketing => "direct_marketing_outbound_telemarketing", + DirectMarketingSubscription => "direct_marketing_subscription", + DirectMarketingTravel => "direct_marketing_travel", + DiscountStores => "discount_stores", + Doctors => "doctors", + DoorToDoorSales => "door_to_door_sales", + DraperyWindowCoveringAndUpholsteryStores => { + "drapery_window_covering_and_upholstery_stores" + } + DrinkingPlaces => "drinking_places", + DrugStoresAndPharmacies => "drug_stores_and_pharmacies", + DrugsDrugProprietariesAndDruggistSundries => { + "drugs_drug_proprietaries_and_druggist_sundries" + } + DryCleaners => "dry_cleaners", + DurableGoods => "durable_goods", + DutyFreeStores => "duty_free_stores", + EatingPlacesRestaurants => "eating_places_restaurants", + EducationalServices => "educational_services", + ElectricRazorStores => "electric_razor_stores", + ElectricVehicleCharging => "electric_vehicle_charging", + ElectricalPartsAndEquipment => "electrical_parts_and_equipment", + ElectricalServices => "electrical_services", + ElectronicsRepairShops => "electronics_repair_shops", + ElectronicsStores => "electronics_stores", + ElementarySecondarySchools => "elementary_secondary_schools", + EmergencyServicesGcasVisaUseOnly => "emergency_services_gcas_visa_use_only", + EmploymentTempAgencies => "employment_temp_agencies", + EquipmentRental => "equipment_rental", + ExterminatingServices => "exterminating_services", + FamilyClothingStores => "family_clothing_stores", + FastFoodRestaurants => "fast_food_restaurants", + FinancialInstitutions => "financial_institutions", + FinesGovernmentAdministrativeEntities => "fines_government_administrative_entities", + FireplaceFireplaceScreensAndAccessoriesStores => { + "fireplace_fireplace_screens_and_accessories_stores" + } + FloorCoveringStores => "floor_covering_stores", + Florists => "florists", + FloristsSuppliesNurseryStockAndFlowers => "florists_supplies_nursery_stock_and_flowers", + FreezerAndLockerMeatProvisioners => "freezer_and_locker_meat_provisioners", + FuelDealersNonAutomotive => "fuel_dealers_non_automotive", + FuneralServicesCrematories => "funeral_services_crematories", + FurnitureHomeFurnishingsAndEquipmentStoresExceptAppliances => { + "furniture_home_furnishings_and_equipment_stores_except_appliances" + } + FurnitureRepairRefinishing => "furniture_repair_refinishing", + FurriersAndFurShops => "furriers_and_fur_shops", + GeneralServices => "general_services", + GiftCardNoveltyAndSouvenirShops => "gift_card_novelty_and_souvenir_shops", + GlassPaintAndWallpaperStores => "glass_paint_and_wallpaper_stores", + GlasswareCrystalStores => "glassware_crystal_stores", + GolfCoursesPublic => "golf_courses_public", + GovernmentLicensedHorseDogRacingUsRegionOnly => { + "government_licensed_horse_dog_racing_us_region_only" + } + GovernmentLicensedOnlineCasionsOnlineGamblingUsRegionOnly => { + "government_licensed_online_casions_online_gambling_us_region_only" + } + GovernmentOwnedLotteriesNonUsRegion => "government_owned_lotteries_non_us_region", + GovernmentOwnedLotteriesUsRegionOnly => "government_owned_lotteries_us_region_only", + GovernmentServices => "government_services", + GroceryStoresSupermarkets => "grocery_stores_supermarkets", + HardwareEquipmentAndSupplies => "hardware_equipment_and_supplies", + HardwareStores => "hardware_stores", + HealthAndBeautySpas => "health_and_beauty_spas", + HearingAidsSalesAndSupplies => "hearing_aids_sales_and_supplies", + HeatingPlumbingAC => "heating_plumbing_a_c", + HobbyToyAndGameShops => "hobby_toy_and_game_shops", + HomeSupplyWarehouseStores => "home_supply_warehouse_stores", + Hospitals => "hospitals", + HotelsMotelsAndResorts => "hotels_motels_and_resorts", + HouseholdApplianceStores => "household_appliance_stores", + IndustrialSupplies => "industrial_supplies", + InformationRetrievalServices => "information_retrieval_services", + InsuranceDefault => "insurance_default", + InsuranceUnderwritingPremiums => "insurance_underwriting_premiums", + IntraCompanyPurchases => "intra_company_purchases", + JewelryStoresWatchesClocksAndSilverwareStores => { + "jewelry_stores_watches_clocks_and_silverware_stores" + } + LandscapingServices => "landscaping_services", + Laundries => "laundries", + LaundryCleaningServices => "laundry_cleaning_services", + LegalServicesAttorneys => "legal_services_attorneys", + LuggageAndLeatherGoodsStores => "luggage_and_leather_goods_stores", + LumberBuildingMaterialsStores => "lumber_building_materials_stores", + ManualCashDisburse => "manual_cash_disburse", + MarinasServiceAndSupplies => "marinas_service_and_supplies", + Marketplaces => "marketplaces", + MasonryStoneworkAndPlaster => "masonry_stonework_and_plaster", + MassageParlors => "massage_parlors", + MedicalAndDentalLabs => "medical_and_dental_labs", + MedicalDentalOphthalmicAndHospitalEquipmentAndSupplies => { + "medical_dental_ophthalmic_and_hospital_equipment_and_supplies" + } + MedicalServices => "medical_services", + MembershipOrganizations => "membership_organizations", + MensAndBoysClothingAndAccessoriesStores => { + "mens_and_boys_clothing_and_accessories_stores" + } + MensWomensClothingStores => "mens_womens_clothing_stores", + MetalServiceCenters => "metal_service_centers", + Miscellaneous => "miscellaneous", + MiscellaneousApparelAndAccessoryShops => "miscellaneous_apparel_and_accessory_shops", + MiscellaneousAutoDealers => "miscellaneous_auto_dealers", + MiscellaneousBusinessServices => "miscellaneous_business_services", + MiscellaneousFoodStores => "miscellaneous_food_stores", + MiscellaneousGeneralMerchandise => "miscellaneous_general_merchandise", + MiscellaneousGeneralServices => "miscellaneous_general_services", + MiscellaneousHomeFurnishingSpecialtyStores => { + "miscellaneous_home_furnishing_specialty_stores" + } + MiscellaneousPublishingAndPrinting => "miscellaneous_publishing_and_printing", + MiscellaneousRecreationServices => "miscellaneous_recreation_services", + MiscellaneousRepairShops => "miscellaneous_repair_shops", + MiscellaneousSpecialtyRetail => "miscellaneous_specialty_retail", + MobileHomeDealers => "mobile_home_dealers", + MotionPictureTheaters => "motion_picture_theaters", + MotorFreightCarriersAndTrucking => "motor_freight_carriers_and_trucking", + MotorHomesDealers => "motor_homes_dealers", + MotorVehicleSuppliesAndNewParts => "motor_vehicle_supplies_and_new_parts", + MotorcycleShopsAndDealers => "motorcycle_shops_and_dealers", + MotorcycleShopsDealers => "motorcycle_shops_dealers", + MusicStoresMusicalInstrumentsPianosAndSheetMusic => { + "music_stores_musical_instruments_pianos_and_sheet_music" + } + NewsDealersAndNewsstands => "news_dealers_and_newsstands", + NonFiMoneyOrders => "non_fi_money_orders", + NonFiStoredValueCardPurchaseLoad => "non_fi_stored_value_card_purchase_load", + NondurableGoods => "nondurable_goods", + NurseriesLawnAndGardenSupplyStores => "nurseries_lawn_and_garden_supply_stores", + NursingPersonalCare => "nursing_personal_care", + OfficeAndCommercialFurniture => "office_and_commercial_furniture", + OpticiansEyeglasses => "opticians_eyeglasses", + OptometristsOphthalmologist => "optometrists_ophthalmologist", + OrthopedicGoodsProstheticDevices => "orthopedic_goods_prosthetic_devices", + Osteopaths => "osteopaths", + PackageStoresBeerWineAndLiquor => "package_stores_beer_wine_and_liquor", + PaintsVarnishesAndSupplies => "paints_varnishes_and_supplies", + ParkingLotsGarages => "parking_lots_garages", + PassengerRailways => "passenger_railways", + PawnShops => "pawn_shops", + PetShopsPetFoodAndSupplies => "pet_shops_pet_food_and_supplies", + PetroleumAndPetroleumProducts => "petroleum_and_petroleum_products", + PhotoDeveloping => "photo_developing", + PhotographicPhotocopyMicrofilmEquipmentAndSupplies => { + "photographic_photocopy_microfilm_equipment_and_supplies" + } + PhotographicStudios => "photographic_studios", + PictureVideoProduction => "picture_video_production", + PieceGoodsNotionsAndOtherDryGoods => "piece_goods_notions_and_other_dry_goods", + PlumbingHeatingEquipmentAndSupplies => "plumbing_heating_equipment_and_supplies", + PoliticalOrganizations => "political_organizations", + PostalServicesGovernmentOnly => "postal_services_government_only", + PreciousStonesAndMetalsWatchesAndJewelry => { + "precious_stones_and_metals_watches_and_jewelry" + } + ProfessionalServices => "professional_services", + PublicWarehousingAndStorage => "public_warehousing_and_storage", + QuickCopyReproAndBlueprint => "quick_copy_repro_and_blueprint", + Railroads => "railroads", + RealEstateAgentsAndManagersRentals => "real_estate_agents_and_managers_rentals", + RecordStores => "record_stores", + RecreationalVehicleRentals => "recreational_vehicle_rentals", + ReligiousGoodsStores => "religious_goods_stores", + ReligiousOrganizations => "religious_organizations", + RoofingSidingSheetMetal => "roofing_siding_sheet_metal", + SecretarialSupportServices => "secretarial_support_services", + SecurityBrokersDealers => "security_brokers_dealers", + ServiceStations => "service_stations", + SewingNeedleworkFabricAndPieceGoodsStores => { + "sewing_needlework_fabric_and_piece_goods_stores" + } + ShoeRepairHatCleaning => "shoe_repair_hat_cleaning", + ShoeStores => "shoe_stores", + SmallApplianceRepair => "small_appliance_repair", + SnowmobileDealers => "snowmobile_dealers", + SpecialTradeServices => "special_trade_services", + SpecialtyCleaning => "specialty_cleaning", + SportingGoodsStores => "sporting_goods_stores", + SportingRecreationCamps => "sporting_recreation_camps", + SportsAndRidingApparelStores => "sports_and_riding_apparel_stores", + SportsClubsFields => "sports_clubs_fields", + StampAndCoinStores => "stamp_and_coin_stores", + StationaryOfficeSuppliesPrintingAndWritingPaper => { + "stationary_office_supplies_printing_and_writing_paper" + } + StationeryStoresOfficeAndSchoolSupplyStores => { + "stationery_stores_office_and_school_supply_stores" + } + SwimmingPoolsSales => "swimming_pools_sales", + TUiTravelGermany => "t_ui_travel_germany", + TailorsAlterations => "tailors_alterations", + TaxPaymentsGovernmentAgencies => "tax_payments_government_agencies", + TaxPreparationServices => "tax_preparation_services", + TaxicabsLimousines => "taxicabs_limousines", + TelecommunicationEquipmentAndTelephoneSales => { + "telecommunication_equipment_and_telephone_sales" + } + TelecommunicationServices => "telecommunication_services", + TelegraphServices => "telegraph_services", + TentAndAwningShops => "tent_and_awning_shops", + TestingLaboratories => "testing_laboratories", + TheatricalTicketAgencies => "theatrical_ticket_agencies", + Timeshares => "timeshares", + TireRetreadingAndRepair => "tire_retreading_and_repair", + TollsBridgeFees => "tolls_bridge_fees", + TouristAttractionsAndExhibits => "tourist_attractions_and_exhibits", + TowingServices => "towing_services", + TrailerParksCampgrounds => "trailer_parks_campgrounds", + TransportationServices => "transportation_services", + TravelAgenciesTourOperators => "travel_agencies_tour_operators", + TruckStopIteration => "truck_stop_iteration", + TruckUtilityTrailerRentals => "truck_utility_trailer_rentals", + TypesettingPlateMakingAndRelatedServices => { + "typesetting_plate_making_and_related_services" + } + TypewriterStores => "typewriter_stores", + USFederalGovernmentAgenciesOrDepartments => { + "u_s_federal_government_agencies_or_departments" + } + UniformsCommercialClothing => "uniforms_commercial_clothing", + UsedMerchandiseAndSecondhandStores => "used_merchandise_and_secondhand_stores", + Utilities => "utilities", + VarietyStores => "variety_stores", + VeterinaryServices => "veterinary_services", + VideoAmusementGameSupplies => "video_amusement_game_supplies", + VideoGameArcades => "video_game_arcades", + VideoTapeRentalStores => "video_tape_rental_stores", + VocationalTradeSchools => "vocational_trade_schools", + WatchJewelryRepair => "watch_jewelry_repair", + WeldingRepair => "welding_repair", + WholesaleClubs => "wholesale_clubs", + WigAndToupeeStores => "wig_and_toupee_stores", + WiresMoneyOrders => "wires_money_orders", + WomensAccessoryAndSpecialtyShops => "womens_accessory_and_specialty_shops", + WomensReadyToWearStores => "womens_ready_to_wear_stores", + WreckingAndSalvageYards => "wrecking_and_salvage_yards", + Unknown => "unknown", + } + } +} + +impl std::str::FromStr for CreateIssuingCardholderSpendingControlsBlockedCategories { + type Err = (); + fn from_str(s: &str) -> Result { + use CreateIssuingCardholderSpendingControlsBlockedCategories::*; + match s { + "ac_refrigeration_repair" => Ok(AcRefrigerationRepair), + "accounting_bookkeeping_services" => Ok(AccountingBookkeepingServices), + "advertising_services" => Ok(AdvertisingServices), + "agricultural_cooperative" => Ok(AgriculturalCooperative), + "airlines_air_carriers" => Ok(AirlinesAirCarriers), + "airports_flying_fields" => Ok(AirportsFlyingFields), + "ambulance_services" => Ok(AmbulanceServices), + "amusement_parks_carnivals" => Ok(AmusementParksCarnivals), + "antique_reproductions" => Ok(AntiqueReproductions), + "antique_shops" => Ok(AntiqueShops), + "aquariums" => Ok(Aquariums), + "architectural_surveying_services" => Ok(ArchitecturalSurveyingServices), + "art_dealers_and_galleries" => Ok(ArtDealersAndGalleries), + "artists_supply_and_craft_shops" => Ok(ArtistsSupplyAndCraftShops), + "auto_and_home_supply_stores" => Ok(AutoAndHomeSupplyStores), + "auto_body_repair_shops" => Ok(AutoBodyRepairShops), + "auto_paint_shops" => Ok(AutoPaintShops), + "auto_service_shops" => Ok(AutoServiceShops), + "automated_cash_disburse" => Ok(AutomatedCashDisburse), + "automated_fuel_dispensers" => Ok(AutomatedFuelDispensers), + "automobile_associations" => Ok(AutomobileAssociations), + "automotive_parts_and_accessories_stores" => Ok(AutomotivePartsAndAccessoriesStores), + "automotive_tire_stores" => Ok(AutomotiveTireStores), + "bail_and_bond_payments" => Ok(BailAndBondPayments), + "bakeries" => Ok(Bakeries), + "bands_orchestras" => Ok(BandsOrchestras), + "barber_and_beauty_shops" => Ok(BarberAndBeautyShops), + "betting_casino_gambling" => Ok(BettingCasinoGambling), + "bicycle_shops" => Ok(BicycleShops), + "billiard_pool_establishments" => Ok(BilliardPoolEstablishments), + "boat_dealers" => Ok(BoatDealers), + "boat_rentals_and_leases" => Ok(BoatRentalsAndLeases), + "book_stores" => Ok(BookStores), + "books_periodicals_and_newspapers" => Ok(BooksPeriodicalsAndNewspapers), + "bowling_alleys" => Ok(BowlingAlleys), + "bus_lines" => Ok(BusLines), + "business_secretarial_schools" => Ok(BusinessSecretarialSchools), + "buying_shopping_services" => Ok(BuyingShoppingServices), + "cable_satellite_and_other_pay_television_and_radio" => { + Ok(CableSatelliteAndOtherPayTelevisionAndRadio) + } + "camera_and_photographic_supply_stores" => Ok(CameraAndPhotographicSupplyStores), + "candy_nut_and_confectionery_stores" => Ok(CandyNutAndConfectioneryStores), + "car_and_truck_dealers_new_used" => Ok(CarAndTruckDealersNewUsed), + "car_and_truck_dealers_used_only" => Ok(CarAndTruckDealersUsedOnly), + "car_rental_agencies" => Ok(CarRentalAgencies), + "car_washes" => Ok(CarWashes), + "carpentry_services" => Ok(CarpentryServices), + "carpet_upholstery_cleaning" => Ok(CarpetUpholsteryCleaning), + "caterers" => Ok(Caterers), + "charitable_and_social_service_organizations_fundraising" => { + Ok(CharitableAndSocialServiceOrganizationsFundraising) + } + "chemicals_and_allied_products" => Ok(ChemicalsAndAlliedProducts), + "child_care_services" => Ok(ChildCareServices), + "childrens_and_infants_wear_stores" => Ok(ChildrensAndInfantsWearStores), + "chiropodists_podiatrists" => Ok(ChiropodistsPodiatrists), + "chiropractors" => Ok(Chiropractors), + "cigar_stores_and_stands" => Ok(CigarStoresAndStands), + "civic_social_fraternal_associations" => Ok(CivicSocialFraternalAssociations), + "cleaning_and_maintenance" => Ok(CleaningAndMaintenance), + "clothing_rental" => Ok(ClothingRental), + "colleges_universities" => Ok(CollegesUniversities), + "commercial_equipment" => Ok(CommercialEquipment), + "commercial_footwear" => Ok(CommercialFootwear), + "commercial_photography_art_and_graphics" => Ok(CommercialPhotographyArtAndGraphics), + "commuter_transport_and_ferries" => Ok(CommuterTransportAndFerries), + "computer_network_services" => Ok(ComputerNetworkServices), + "computer_programming" => Ok(ComputerProgramming), + "computer_repair" => Ok(ComputerRepair), + "computer_software_stores" => Ok(ComputerSoftwareStores), + "computers_peripherals_and_software" => Ok(ComputersPeripheralsAndSoftware), + "concrete_work_services" => Ok(ConcreteWorkServices), + "construction_materials" => Ok(ConstructionMaterials), + "consulting_public_relations" => Ok(ConsultingPublicRelations), + "correspondence_schools" => Ok(CorrespondenceSchools), + "cosmetic_stores" => Ok(CosmeticStores), + "counseling_services" => Ok(CounselingServices), + "country_clubs" => Ok(CountryClubs), + "courier_services" => Ok(CourierServices), + "court_costs" => Ok(CourtCosts), + "credit_reporting_agencies" => Ok(CreditReportingAgencies), + "cruise_lines" => Ok(CruiseLines), + "dairy_products_stores" => Ok(DairyProductsStores), + "dance_hall_studios_schools" => Ok(DanceHallStudiosSchools), + "dating_escort_services" => Ok(DatingEscortServices), + "dentists_orthodontists" => Ok(DentistsOrthodontists), + "department_stores" => Ok(DepartmentStores), + "detective_agencies" => Ok(DetectiveAgencies), + "digital_goods_applications" => Ok(DigitalGoodsApplications), + "digital_goods_games" => Ok(DigitalGoodsGames), + "digital_goods_large_volume" => Ok(DigitalGoodsLargeVolume), + "digital_goods_media" => Ok(DigitalGoodsMedia), + "direct_marketing_catalog_merchant" => Ok(DirectMarketingCatalogMerchant), + "direct_marketing_combination_catalog_and_retail_merchant" => { + Ok(DirectMarketingCombinationCatalogAndRetailMerchant) + } + "direct_marketing_inbound_telemarketing" => Ok(DirectMarketingInboundTelemarketing), + "direct_marketing_insurance_services" => Ok(DirectMarketingInsuranceServices), + "direct_marketing_other" => Ok(DirectMarketingOther), + "direct_marketing_outbound_telemarketing" => Ok(DirectMarketingOutboundTelemarketing), + "direct_marketing_subscription" => Ok(DirectMarketingSubscription), + "direct_marketing_travel" => Ok(DirectMarketingTravel), + "discount_stores" => Ok(DiscountStores), + "doctors" => Ok(Doctors), + "door_to_door_sales" => Ok(DoorToDoorSales), + "drapery_window_covering_and_upholstery_stores" => { + Ok(DraperyWindowCoveringAndUpholsteryStores) + } + "drinking_places" => Ok(DrinkingPlaces), + "drug_stores_and_pharmacies" => Ok(DrugStoresAndPharmacies), + "drugs_drug_proprietaries_and_druggist_sundries" => { + Ok(DrugsDrugProprietariesAndDruggistSundries) + } + "dry_cleaners" => Ok(DryCleaners), + "durable_goods" => Ok(DurableGoods), + "duty_free_stores" => Ok(DutyFreeStores), + "eating_places_restaurants" => Ok(EatingPlacesRestaurants), + "educational_services" => Ok(EducationalServices), + "electric_razor_stores" => Ok(ElectricRazorStores), + "electric_vehicle_charging" => Ok(ElectricVehicleCharging), + "electrical_parts_and_equipment" => Ok(ElectricalPartsAndEquipment), + "electrical_services" => Ok(ElectricalServices), + "electronics_repair_shops" => Ok(ElectronicsRepairShops), + "electronics_stores" => Ok(ElectronicsStores), + "elementary_secondary_schools" => Ok(ElementarySecondarySchools), + "emergency_services_gcas_visa_use_only" => Ok(EmergencyServicesGcasVisaUseOnly), + "employment_temp_agencies" => Ok(EmploymentTempAgencies), + "equipment_rental" => Ok(EquipmentRental), + "exterminating_services" => Ok(ExterminatingServices), + "family_clothing_stores" => Ok(FamilyClothingStores), + "fast_food_restaurants" => Ok(FastFoodRestaurants), + "financial_institutions" => Ok(FinancialInstitutions), + "fines_government_administrative_entities" => Ok(FinesGovernmentAdministrativeEntities), + "fireplace_fireplace_screens_and_accessories_stores" => { + Ok(FireplaceFireplaceScreensAndAccessoriesStores) + } + "floor_covering_stores" => Ok(FloorCoveringStores), + "florists" => Ok(Florists), + "florists_supplies_nursery_stock_and_flowers" => { + Ok(FloristsSuppliesNurseryStockAndFlowers) + } + "freezer_and_locker_meat_provisioners" => Ok(FreezerAndLockerMeatProvisioners), + "fuel_dealers_non_automotive" => Ok(FuelDealersNonAutomotive), + "funeral_services_crematories" => Ok(FuneralServicesCrematories), + "furniture_home_furnishings_and_equipment_stores_except_appliances" => { + Ok(FurnitureHomeFurnishingsAndEquipmentStoresExceptAppliances) + } + "furniture_repair_refinishing" => Ok(FurnitureRepairRefinishing), + "furriers_and_fur_shops" => Ok(FurriersAndFurShops), + "general_services" => Ok(GeneralServices), + "gift_card_novelty_and_souvenir_shops" => Ok(GiftCardNoveltyAndSouvenirShops), + "glass_paint_and_wallpaper_stores" => Ok(GlassPaintAndWallpaperStores), + "glassware_crystal_stores" => Ok(GlasswareCrystalStores), + "golf_courses_public" => Ok(GolfCoursesPublic), + "government_licensed_horse_dog_racing_us_region_only" => { + Ok(GovernmentLicensedHorseDogRacingUsRegionOnly) + } + "government_licensed_online_casions_online_gambling_us_region_only" => { + Ok(GovernmentLicensedOnlineCasionsOnlineGamblingUsRegionOnly) + } + "government_owned_lotteries_non_us_region" => Ok(GovernmentOwnedLotteriesNonUsRegion), + "government_owned_lotteries_us_region_only" => Ok(GovernmentOwnedLotteriesUsRegionOnly), + "government_services" => Ok(GovernmentServices), + "grocery_stores_supermarkets" => Ok(GroceryStoresSupermarkets), + "hardware_equipment_and_supplies" => Ok(HardwareEquipmentAndSupplies), + "hardware_stores" => Ok(HardwareStores), + "health_and_beauty_spas" => Ok(HealthAndBeautySpas), + "hearing_aids_sales_and_supplies" => Ok(HearingAidsSalesAndSupplies), + "heating_plumbing_a_c" => Ok(HeatingPlumbingAC), + "hobby_toy_and_game_shops" => Ok(HobbyToyAndGameShops), + "home_supply_warehouse_stores" => Ok(HomeSupplyWarehouseStores), + "hospitals" => Ok(Hospitals), + "hotels_motels_and_resorts" => Ok(HotelsMotelsAndResorts), + "household_appliance_stores" => Ok(HouseholdApplianceStores), + "industrial_supplies" => Ok(IndustrialSupplies), + "information_retrieval_services" => Ok(InformationRetrievalServices), + "insurance_default" => Ok(InsuranceDefault), + "insurance_underwriting_premiums" => Ok(InsuranceUnderwritingPremiums), + "intra_company_purchases" => Ok(IntraCompanyPurchases), + "jewelry_stores_watches_clocks_and_silverware_stores" => { + Ok(JewelryStoresWatchesClocksAndSilverwareStores) + } + "landscaping_services" => Ok(LandscapingServices), + "laundries" => Ok(Laundries), + "laundry_cleaning_services" => Ok(LaundryCleaningServices), + "legal_services_attorneys" => Ok(LegalServicesAttorneys), + "luggage_and_leather_goods_stores" => Ok(LuggageAndLeatherGoodsStores), + "lumber_building_materials_stores" => Ok(LumberBuildingMaterialsStores), + "manual_cash_disburse" => Ok(ManualCashDisburse), + "marinas_service_and_supplies" => Ok(MarinasServiceAndSupplies), + "marketplaces" => Ok(Marketplaces), + "masonry_stonework_and_plaster" => Ok(MasonryStoneworkAndPlaster), + "massage_parlors" => Ok(MassageParlors), + "medical_and_dental_labs" => Ok(MedicalAndDentalLabs), + "medical_dental_ophthalmic_and_hospital_equipment_and_supplies" => { + Ok(MedicalDentalOphthalmicAndHospitalEquipmentAndSupplies) + } + "medical_services" => Ok(MedicalServices), + "membership_organizations" => Ok(MembershipOrganizations), + "mens_and_boys_clothing_and_accessories_stores" => { + Ok(MensAndBoysClothingAndAccessoriesStores) + } + "mens_womens_clothing_stores" => Ok(MensWomensClothingStores), + "metal_service_centers" => Ok(MetalServiceCenters), + "miscellaneous" => Ok(Miscellaneous), + "miscellaneous_apparel_and_accessory_shops" => { + Ok(MiscellaneousApparelAndAccessoryShops) + } + "miscellaneous_auto_dealers" => Ok(MiscellaneousAutoDealers), + "miscellaneous_business_services" => Ok(MiscellaneousBusinessServices), + "miscellaneous_food_stores" => Ok(MiscellaneousFoodStores), + "miscellaneous_general_merchandise" => Ok(MiscellaneousGeneralMerchandise), + "miscellaneous_general_services" => Ok(MiscellaneousGeneralServices), + "miscellaneous_home_furnishing_specialty_stores" => { + Ok(MiscellaneousHomeFurnishingSpecialtyStores) + } + "miscellaneous_publishing_and_printing" => Ok(MiscellaneousPublishingAndPrinting), + "miscellaneous_recreation_services" => Ok(MiscellaneousRecreationServices), + "miscellaneous_repair_shops" => Ok(MiscellaneousRepairShops), + "miscellaneous_specialty_retail" => Ok(MiscellaneousSpecialtyRetail), + "mobile_home_dealers" => Ok(MobileHomeDealers), + "motion_picture_theaters" => Ok(MotionPictureTheaters), + "motor_freight_carriers_and_trucking" => Ok(MotorFreightCarriersAndTrucking), + "motor_homes_dealers" => Ok(MotorHomesDealers), + "motor_vehicle_supplies_and_new_parts" => Ok(MotorVehicleSuppliesAndNewParts), + "motorcycle_shops_and_dealers" => Ok(MotorcycleShopsAndDealers), + "motorcycle_shops_dealers" => Ok(MotorcycleShopsDealers), + "music_stores_musical_instruments_pianos_and_sheet_music" => { + Ok(MusicStoresMusicalInstrumentsPianosAndSheetMusic) + } + "news_dealers_and_newsstands" => Ok(NewsDealersAndNewsstands), + "non_fi_money_orders" => Ok(NonFiMoneyOrders), + "non_fi_stored_value_card_purchase_load" => Ok(NonFiStoredValueCardPurchaseLoad), + "nondurable_goods" => Ok(NondurableGoods), + "nurseries_lawn_and_garden_supply_stores" => Ok(NurseriesLawnAndGardenSupplyStores), + "nursing_personal_care" => Ok(NursingPersonalCare), + "office_and_commercial_furniture" => Ok(OfficeAndCommercialFurniture), + "opticians_eyeglasses" => Ok(OpticiansEyeglasses), + "optometrists_ophthalmologist" => Ok(OptometristsOphthalmologist), + "orthopedic_goods_prosthetic_devices" => Ok(OrthopedicGoodsProstheticDevices), + "osteopaths" => Ok(Osteopaths), + "package_stores_beer_wine_and_liquor" => Ok(PackageStoresBeerWineAndLiquor), + "paints_varnishes_and_supplies" => Ok(PaintsVarnishesAndSupplies), + "parking_lots_garages" => Ok(ParkingLotsGarages), + "passenger_railways" => Ok(PassengerRailways), + "pawn_shops" => Ok(PawnShops), + "pet_shops_pet_food_and_supplies" => Ok(PetShopsPetFoodAndSupplies), + "petroleum_and_petroleum_products" => Ok(PetroleumAndPetroleumProducts), + "photo_developing" => Ok(PhotoDeveloping), + "photographic_photocopy_microfilm_equipment_and_supplies" => { + Ok(PhotographicPhotocopyMicrofilmEquipmentAndSupplies) + } + "photographic_studios" => Ok(PhotographicStudios), + "picture_video_production" => Ok(PictureVideoProduction), + "piece_goods_notions_and_other_dry_goods" => Ok(PieceGoodsNotionsAndOtherDryGoods), + "plumbing_heating_equipment_and_supplies" => Ok(PlumbingHeatingEquipmentAndSupplies), + "political_organizations" => Ok(PoliticalOrganizations), + "postal_services_government_only" => Ok(PostalServicesGovernmentOnly), + "precious_stones_and_metals_watches_and_jewelry" => { + Ok(PreciousStonesAndMetalsWatchesAndJewelry) + } + "professional_services" => Ok(ProfessionalServices), + "public_warehousing_and_storage" => Ok(PublicWarehousingAndStorage), + "quick_copy_repro_and_blueprint" => Ok(QuickCopyReproAndBlueprint), + "railroads" => Ok(Railroads), + "real_estate_agents_and_managers_rentals" => Ok(RealEstateAgentsAndManagersRentals), + "record_stores" => Ok(RecordStores), + "recreational_vehicle_rentals" => Ok(RecreationalVehicleRentals), + "religious_goods_stores" => Ok(ReligiousGoodsStores), + "religious_organizations" => Ok(ReligiousOrganizations), + "roofing_siding_sheet_metal" => Ok(RoofingSidingSheetMetal), + "secretarial_support_services" => Ok(SecretarialSupportServices), + "security_brokers_dealers" => Ok(SecurityBrokersDealers), + "service_stations" => Ok(ServiceStations), + "sewing_needlework_fabric_and_piece_goods_stores" => { + Ok(SewingNeedleworkFabricAndPieceGoodsStores) + } + "shoe_repair_hat_cleaning" => Ok(ShoeRepairHatCleaning), + "shoe_stores" => Ok(ShoeStores), + "small_appliance_repair" => Ok(SmallApplianceRepair), + "snowmobile_dealers" => Ok(SnowmobileDealers), + "special_trade_services" => Ok(SpecialTradeServices), + "specialty_cleaning" => Ok(SpecialtyCleaning), + "sporting_goods_stores" => Ok(SportingGoodsStores), + "sporting_recreation_camps" => Ok(SportingRecreationCamps), + "sports_and_riding_apparel_stores" => Ok(SportsAndRidingApparelStores), + "sports_clubs_fields" => Ok(SportsClubsFields), + "stamp_and_coin_stores" => Ok(StampAndCoinStores), + "stationary_office_supplies_printing_and_writing_paper" => { + Ok(StationaryOfficeSuppliesPrintingAndWritingPaper) + } + "stationery_stores_office_and_school_supply_stores" => { + Ok(StationeryStoresOfficeAndSchoolSupplyStores) + } + "swimming_pools_sales" => Ok(SwimmingPoolsSales), + "t_ui_travel_germany" => Ok(TUiTravelGermany), + "tailors_alterations" => Ok(TailorsAlterations), + "tax_payments_government_agencies" => Ok(TaxPaymentsGovernmentAgencies), + "tax_preparation_services" => Ok(TaxPreparationServices), + "taxicabs_limousines" => Ok(TaxicabsLimousines), + "telecommunication_equipment_and_telephone_sales" => { + Ok(TelecommunicationEquipmentAndTelephoneSales) + } + "telecommunication_services" => Ok(TelecommunicationServices), + "telegraph_services" => Ok(TelegraphServices), + "tent_and_awning_shops" => Ok(TentAndAwningShops), + "testing_laboratories" => Ok(TestingLaboratories), + "theatrical_ticket_agencies" => Ok(TheatricalTicketAgencies), + "timeshares" => Ok(Timeshares), + "tire_retreading_and_repair" => Ok(TireRetreadingAndRepair), + "tolls_bridge_fees" => Ok(TollsBridgeFees), + "tourist_attractions_and_exhibits" => Ok(TouristAttractionsAndExhibits), + "towing_services" => Ok(TowingServices), + "trailer_parks_campgrounds" => Ok(TrailerParksCampgrounds), + "transportation_services" => Ok(TransportationServices), + "travel_agencies_tour_operators" => Ok(TravelAgenciesTourOperators), + "truck_stop_iteration" => Ok(TruckStopIteration), + "truck_utility_trailer_rentals" => Ok(TruckUtilityTrailerRentals), + "typesetting_plate_making_and_related_services" => { + Ok(TypesettingPlateMakingAndRelatedServices) + } + "typewriter_stores" => Ok(TypewriterStores), + "u_s_federal_government_agencies_or_departments" => { + Ok(USFederalGovernmentAgenciesOrDepartments) + } + "uniforms_commercial_clothing" => Ok(UniformsCommercialClothing), + "used_merchandise_and_secondhand_stores" => Ok(UsedMerchandiseAndSecondhandStores), + "utilities" => Ok(Utilities), + "variety_stores" => Ok(VarietyStores), + "veterinary_services" => Ok(VeterinaryServices), + "video_amusement_game_supplies" => Ok(VideoAmusementGameSupplies), + "video_game_arcades" => Ok(VideoGameArcades), + "video_tape_rental_stores" => Ok(VideoTapeRentalStores), + "vocational_trade_schools" => Ok(VocationalTradeSchools), + "watch_jewelry_repair" => Ok(WatchJewelryRepair), + "welding_repair" => Ok(WeldingRepair), + "wholesale_clubs" => Ok(WholesaleClubs), + "wig_and_toupee_stores" => Ok(WigAndToupeeStores), + "wires_money_orders" => Ok(WiresMoneyOrders), + "womens_accessory_and_specialty_shops" => Ok(WomensAccessoryAndSpecialtyShops), + "womens_ready_to_wear_stores" => Ok(WomensReadyToWearStores), + "wrecking_and_salvage_yards" => Ok(WreckingAndSalvageYards), + _ => Err(()), + } + } +} +impl std::fmt::Display for CreateIssuingCardholderSpendingControlsBlockedCategories { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreateIssuingCardholderSpendingControlsBlockedCategories { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreateIssuingCardholderSpendingControlsBlockedCategories { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Limit spending with amount-based rules that apply across this cardholder's cards. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreateIssuingCardholderSpendingControlsSpendingLimits<'a> { + /// Maximum amount allowed to spend per interval. + pub amount: i64, + /// Array of strings containing [categories](https://stripe.com/docs/api#issuing_authorization_object-merchant_data-category) this limit applies to. + /// Omitting this field will apply the limit to all categories. + #[serde(skip_serializing_if = "Option::is_none")] + pub categories: Option<&'a [CreateIssuingCardholderSpendingControlsSpendingLimitsCategories]>, + /// Interval (or event) to which the amount applies. + pub interval: CreateIssuingCardholderSpendingControlsSpendingLimitsInterval, +} +impl<'a> CreateIssuingCardholderSpendingControlsSpendingLimits<'a> { + pub fn new( + amount: i64, + interval: CreateIssuingCardholderSpendingControlsSpendingLimitsInterval, + ) -> Self { + Self { amount, categories: None, interval } + } +} +/// Array of strings containing [categories](https://stripe.com/docs/api#issuing_authorization_object-merchant_data-category) this limit applies to. +/// Omitting this field will apply the limit to all categories. +#[derive(Copy, Clone, Eq, PartialEq)] +#[non_exhaustive] +pub enum CreateIssuingCardholderSpendingControlsSpendingLimitsCategories { + AcRefrigerationRepair, + AccountingBookkeepingServices, + AdvertisingServices, + AgriculturalCooperative, + AirlinesAirCarriers, + AirportsFlyingFields, + AmbulanceServices, + AmusementParksCarnivals, + AntiqueReproductions, + AntiqueShops, + Aquariums, + ArchitecturalSurveyingServices, + ArtDealersAndGalleries, + ArtistsSupplyAndCraftShops, + AutoAndHomeSupplyStores, + AutoBodyRepairShops, + AutoPaintShops, + AutoServiceShops, + AutomatedCashDisburse, + AutomatedFuelDispensers, + AutomobileAssociations, + AutomotivePartsAndAccessoriesStores, + AutomotiveTireStores, + BailAndBondPayments, + Bakeries, + BandsOrchestras, + BarberAndBeautyShops, + BettingCasinoGambling, + BicycleShops, + BilliardPoolEstablishments, + BoatDealers, + BoatRentalsAndLeases, + BookStores, + BooksPeriodicalsAndNewspapers, + BowlingAlleys, + BusLines, + BusinessSecretarialSchools, + BuyingShoppingServices, + CableSatelliteAndOtherPayTelevisionAndRadio, + CameraAndPhotographicSupplyStores, + CandyNutAndConfectioneryStores, + CarAndTruckDealersNewUsed, + CarAndTruckDealersUsedOnly, + CarRentalAgencies, + CarWashes, + CarpentryServices, + CarpetUpholsteryCleaning, + Caterers, + CharitableAndSocialServiceOrganizationsFundraising, + ChemicalsAndAlliedProducts, + ChildCareServices, + ChildrensAndInfantsWearStores, + ChiropodistsPodiatrists, + Chiropractors, + CigarStoresAndStands, + CivicSocialFraternalAssociations, + CleaningAndMaintenance, + ClothingRental, + CollegesUniversities, + CommercialEquipment, + CommercialFootwear, + CommercialPhotographyArtAndGraphics, + CommuterTransportAndFerries, + ComputerNetworkServices, + ComputerProgramming, + ComputerRepair, + ComputerSoftwareStores, + ComputersPeripheralsAndSoftware, + ConcreteWorkServices, + ConstructionMaterials, + ConsultingPublicRelations, + CorrespondenceSchools, + CosmeticStores, + CounselingServices, + CountryClubs, + CourierServices, + CourtCosts, + CreditReportingAgencies, + CruiseLines, + DairyProductsStores, + DanceHallStudiosSchools, + DatingEscortServices, + DentistsOrthodontists, + DepartmentStores, + DetectiveAgencies, + DigitalGoodsApplications, + DigitalGoodsGames, + DigitalGoodsLargeVolume, + DigitalGoodsMedia, + DirectMarketingCatalogMerchant, + DirectMarketingCombinationCatalogAndRetailMerchant, + DirectMarketingInboundTelemarketing, + DirectMarketingInsuranceServices, + DirectMarketingOther, + DirectMarketingOutboundTelemarketing, + DirectMarketingSubscription, + DirectMarketingTravel, + DiscountStores, + Doctors, + DoorToDoorSales, + DraperyWindowCoveringAndUpholsteryStores, + DrinkingPlaces, + DrugStoresAndPharmacies, + DrugsDrugProprietariesAndDruggistSundries, + DryCleaners, + DurableGoods, + DutyFreeStores, + EatingPlacesRestaurants, + EducationalServices, + ElectricRazorStores, + ElectricVehicleCharging, + ElectricalPartsAndEquipment, + ElectricalServices, + ElectronicsRepairShops, + ElectronicsStores, + ElementarySecondarySchools, + EmergencyServicesGcasVisaUseOnly, + EmploymentTempAgencies, + EquipmentRental, + ExterminatingServices, + FamilyClothingStores, + FastFoodRestaurants, + FinancialInstitutions, + FinesGovernmentAdministrativeEntities, + FireplaceFireplaceScreensAndAccessoriesStores, + FloorCoveringStores, + Florists, + FloristsSuppliesNurseryStockAndFlowers, + FreezerAndLockerMeatProvisioners, + FuelDealersNonAutomotive, + FuneralServicesCrematories, + FurnitureHomeFurnishingsAndEquipmentStoresExceptAppliances, + FurnitureRepairRefinishing, + FurriersAndFurShops, + GeneralServices, + GiftCardNoveltyAndSouvenirShops, + GlassPaintAndWallpaperStores, + GlasswareCrystalStores, + GolfCoursesPublic, + GovernmentLicensedHorseDogRacingUsRegionOnly, + GovernmentLicensedOnlineCasionsOnlineGamblingUsRegionOnly, + GovernmentOwnedLotteriesNonUsRegion, + GovernmentOwnedLotteriesUsRegionOnly, + GovernmentServices, + GroceryStoresSupermarkets, + HardwareEquipmentAndSupplies, + HardwareStores, + HealthAndBeautySpas, + HearingAidsSalesAndSupplies, + HeatingPlumbingAC, + HobbyToyAndGameShops, + HomeSupplyWarehouseStores, + Hospitals, + HotelsMotelsAndResorts, + HouseholdApplianceStores, + IndustrialSupplies, + InformationRetrievalServices, + InsuranceDefault, + InsuranceUnderwritingPremiums, + IntraCompanyPurchases, + JewelryStoresWatchesClocksAndSilverwareStores, + LandscapingServices, + Laundries, + LaundryCleaningServices, + LegalServicesAttorneys, + LuggageAndLeatherGoodsStores, + LumberBuildingMaterialsStores, + ManualCashDisburse, + MarinasServiceAndSupplies, + Marketplaces, + MasonryStoneworkAndPlaster, + MassageParlors, + MedicalAndDentalLabs, + MedicalDentalOphthalmicAndHospitalEquipmentAndSupplies, + MedicalServices, + MembershipOrganizations, + MensAndBoysClothingAndAccessoriesStores, + MensWomensClothingStores, + MetalServiceCenters, + Miscellaneous, + MiscellaneousApparelAndAccessoryShops, + MiscellaneousAutoDealers, + MiscellaneousBusinessServices, + MiscellaneousFoodStores, + MiscellaneousGeneralMerchandise, + MiscellaneousGeneralServices, + MiscellaneousHomeFurnishingSpecialtyStores, + MiscellaneousPublishingAndPrinting, + MiscellaneousRecreationServices, + MiscellaneousRepairShops, + MiscellaneousSpecialtyRetail, + MobileHomeDealers, + MotionPictureTheaters, + MotorFreightCarriersAndTrucking, + MotorHomesDealers, + MotorVehicleSuppliesAndNewParts, + MotorcycleShopsAndDealers, + MotorcycleShopsDealers, + MusicStoresMusicalInstrumentsPianosAndSheetMusic, + NewsDealersAndNewsstands, + NonFiMoneyOrders, + NonFiStoredValueCardPurchaseLoad, + NondurableGoods, + NurseriesLawnAndGardenSupplyStores, + NursingPersonalCare, + OfficeAndCommercialFurniture, + OpticiansEyeglasses, + OptometristsOphthalmologist, + OrthopedicGoodsProstheticDevices, + Osteopaths, + PackageStoresBeerWineAndLiquor, + PaintsVarnishesAndSupplies, + ParkingLotsGarages, + PassengerRailways, + PawnShops, + PetShopsPetFoodAndSupplies, + PetroleumAndPetroleumProducts, + PhotoDeveloping, + PhotographicPhotocopyMicrofilmEquipmentAndSupplies, + PhotographicStudios, + PictureVideoProduction, + PieceGoodsNotionsAndOtherDryGoods, + PlumbingHeatingEquipmentAndSupplies, + PoliticalOrganizations, + PostalServicesGovernmentOnly, + PreciousStonesAndMetalsWatchesAndJewelry, + ProfessionalServices, + PublicWarehousingAndStorage, + QuickCopyReproAndBlueprint, + Railroads, + RealEstateAgentsAndManagersRentals, + RecordStores, + RecreationalVehicleRentals, + ReligiousGoodsStores, + ReligiousOrganizations, + RoofingSidingSheetMetal, + SecretarialSupportServices, + SecurityBrokersDealers, + ServiceStations, + SewingNeedleworkFabricAndPieceGoodsStores, + ShoeRepairHatCleaning, + ShoeStores, + SmallApplianceRepair, + SnowmobileDealers, + SpecialTradeServices, + SpecialtyCleaning, + SportingGoodsStores, + SportingRecreationCamps, + SportsAndRidingApparelStores, + SportsClubsFields, + StampAndCoinStores, + StationaryOfficeSuppliesPrintingAndWritingPaper, + StationeryStoresOfficeAndSchoolSupplyStores, + SwimmingPoolsSales, + TUiTravelGermany, + TailorsAlterations, + TaxPaymentsGovernmentAgencies, + TaxPreparationServices, + TaxicabsLimousines, + TelecommunicationEquipmentAndTelephoneSales, + TelecommunicationServices, + TelegraphServices, + TentAndAwningShops, + TestingLaboratories, + TheatricalTicketAgencies, + Timeshares, + TireRetreadingAndRepair, + TollsBridgeFees, + TouristAttractionsAndExhibits, + TowingServices, + TrailerParksCampgrounds, + TransportationServices, + TravelAgenciesTourOperators, + TruckStopIteration, + TruckUtilityTrailerRentals, + TypesettingPlateMakingAndRelatedServices, + TypewriterStores, + USFederalGovernmentAgenciesOrDepartments, + UniformsCommercialClothing, + UsedMerchandiseAndSecondhandStores, + Utilities, + VarietyStores, + VeterinaryServices, + VideoAmusementGameSupplies, + VideoGameArcades, + VideoTapeRentalStores, + VocationalTradeSchools, + WatchJewelryRepair, + WeldingRepair, + WholesaleClubs, + WigAndToupeeStores, + WiresMoneyOrders, + WomensAccessoryAndSpecialtyShops, + WomensReadyToWearStores, + WreckingAndSalvageYards, + /// An unrecognized value from Stripe. Should not be used as a request parameter. + Unknown, +} +impl CreateIssuingCardholderSpendingControlsSpendingLimitsCategories { + pub fn as_str(self) -> &'static str { + use CreateIssuingCardholderSpendingControlsSpendingLimitsCategories::*; + match self { + AcRefrigerationRepair => "ac_refrigeration_repair", + AccountingBookkeepingServices => "accounting_bookkeeping_services", + AdvertisingServices => "advertising_services", + AgriculturalCooperative => "agricultural_cooperative", + AirlinesAirCarriers => "airlines_air_carriers", + AirportsFlyingFields => "airports_flying_fields", + AmbulanceServices => "ambulance_services", + AmusementParksCarnivals => "amusement_parks_carnivals", + AntiqueReproductions => "antique_reproductions", + AntiqueShops => "antique_shops", + Aquariums => "aquariums", + ArchitecturalSurveyingServices => "architectural_surveying_services", + ArtDealersAndGalleries => "art_dealers_and_galleries", + ArtistsSupplyAndCraftShops => "artists_supply_and_craft_shops", + AutoAndHomeSupplyStores => "auto_and_home_supply_stores", + AutoBodyRepairShops => "auto_body_repair_shops", + AutoPaintShops => "auto_paint_shops", + AutoServiceShops => "auto_service_shops", + AutomatedCashDisburse => "automated_cash_disburse", + AutomatedFuelDispensers => "automated_fuel_dispensers", + AutomobileAssociations => "automobile_associations", + AutomotivePartsAndAccessoriesStores => "automotive_parts_and_accessories_stores", + AutomotiveTireStores => "automotive_tire_stores", + BailAndBondPayments => "bail_and_bond_payments", + Bakeries => "bakeries", + BandsOrchestras => "bands_orchestras", + BarberAndBeautyShops => "barber_and_beauty_shops", + BettingCasinoGambling => "betting_casino_gambling", + BicycleShops => "bicycle_shops", + BilliardPoolEstablishments => "billiard_pool_establishments", + BoatDealers => "boat_dealers", + BoatRentalsAndLeases => "boat_rentals_and_leases", + BookStores => "book_stores", + BooksPeriodicalsAndNewspapers => "books_periodicals_and_newspapers", + BowlingAlleys => "bowling_alleys", + BusLines => "bus_lines", + BusinessSecretarialSchools => "business_secretarial_schools", + BuyingShoppingServices => "buying_shopping_services", + CableSatelliteAndOtherPayTelevisionAndRadio => { + "cable_satellite_and_other_pay_television_and_radio" + } + CameraAndPhotographicSupplyStores => "camera_and_photographic_supply_stores", + CandyNutAndConfectioneryStores => "candy_nut_and_confectionery_stores", + CarAndTruckDealersNewUsed => "car_and_truck_dealers_new_used", + CarAndTruckDealersUsedOnly => "car_and_truck_dealers_used_only", + CarRentalAgencies => "car_rental_agencies", + CarWashes => "car_washes", + CarpentryServices => "carpentry_services", + CarpetUpholsteryCleaning => "carpet_upholstery_cleaning", + Caterers => "caterers", + CharitableAndSocialServiceOrganizationsFundraising => { + "charitable_and_social_service_organizations_fundraising" + } + ChemicalsAndAlliedProducts => "chemicals_and_allied_products", + ChildCareServices => "child_care_services", + ChildrensAndInfantsWearStores => "childrens_and_infants_wear_stores", + ChiropodistsPodiatrists => "chiropodists_podiatrists", + Chiropractors => "chiropractors", + CigarStoresAndStands => "cigar_stores_and_stands", + CivicSocialFraternalAssociations => "civic_social_fraternal_associations", + CleaningAndMaintenance => "cleaning_and_maintenance", + ClothingRental => "clothing_rental", + CollegesUniversities => "colleges_universities", + CommercialEquipment => "commercial_equipment", + CommercialFootwear => "commercial_footwear", + CommercialPhotographyArtAndGraphics => "commercial_photography_art_and_graphics", + CommuterTransportAndFerries => "commuter_transport_and_ferries", + ComputerNetworkServices => "computer_network_services", + ComputerProgramming => "computer_programming", + ComputerRepair => "computer_repair", + ComputerSoftwareStores => "computer_software_stores", + ComputersPeripheralsAndSoftware => "computers_peripherals_and_software", + ConcreteWorkServices => "concrete_work_services", + ConstructionMaterials => "construction_materials", + ConsultingPublicRelations => "consulting_public_relations", + CorrespondenceSchools => "correspondence_schools", + CosmeticStores => "cosmetic_stores", + CounselingServices => "counseling_services", + CountryClubs => "country_clubs", + CourierServices => "courier_services", + CourtCosts => "court_costs", + CreditReportingAgencies => "credit_reporting_agencies", + CruiseLines => "cruise_lines", + DairyProductsStores => "dairy_products_stores", + DanceHallStudiosSchools => "dance_hall_studios_schools", + DatingEscortServices => "dating_escort_services", + DentistsOrthodontists => "dentists_orthodontists", + DepartmentStores => "department_stores", + DetectiveAgencies => "detective_agencies", + DigitalGoodsApplications => "digital_goods_applications", + DigitalGoodsGames => "digital_goods_games", + DigitalGoodsLargeVolume => "digital_goods_large_volume", + DigitalGoodsMedia => "digital_goods_media", + DirectMarketingCatalogMerchant => "direct_marketing_catalog_merchant", + DirectMarketingCombinationCatalogAndRetailMerchant => { + "direct_marketing_combination_catalog_and_retail_merchant" + } + DirectMarketingInboundTelemarketing => "direct_marketing_inbound_telemarketing", + DirectMarketingInsuranceServices => "direct_marketing_insurance_services", + DirectMarketingOther => "direct_marketing_other", + DirectMarketingOutboundTelemarketing => "direct_marketing_outbound_telemarketing", + DirectMarketingSubscription => "direct_marketing_subscription", + DirectMarketingTravel => "direct_marketing_travel", + DiscountStores => "discount_stores", + Doctors => "doctors", + DoorToDoorSales => "door_to_door_sales", + DraperyWindowCoveringAndUpholsteryStores => { + "drapery_window_covering_and_upholstery_stores" + } + DrinkingPlaces => "drinking_places", + DrugStoresAndPharmacies => "drug_stores_and_pharmacies", + DrugsDrugProprietariesAndDruggistSundries => { + "drugs_drug_proprietaries_and_druggist_sundries" + } + DryCleaners => "dry_cleaners", + DurableGoods => "durable_goods", + DutyFreeStores => "duty_free_stores", + EatingPlacesRestaurants => "eating_places_restaurants", + EducationalServices => "educational_services", + ElectricRazorStores => "electric_razor_stores", + ElectricVehicleCharging => "electric_vehicle_charging", + ElectricalPartsAndEquipment => "electrical_parts_and_equipment", + ElectricalServices => "electrical_services", + ElectronicsRepairShops => "electronics_repair_shops", + ElectronicsStores => "electronics_stores", + ElementarySecondarySchools => "elementary_secondary_schools", + EmergencyServicesGcasVisaUseOnly => "emergency_services_gcas_visa_use_only", + EmploymentTempAgencies => "employment_temp_agencies", + EquipmentRental => "equipment_rental", + ExterminatingServices => "exterminating_services", + FamilyClothingStores => "family_clothing_stores", + FastFoodRestaurants => "fast_food_restaurants", + FinancialInstitutions => "financial_institutions", + FinesGovernmentAdministrativeEntities => "fines_government_administrative_entities", + FireplaceFireplaceScreensAndAccessoriesStores => { + "fireplace_fireplace_screens_and_accessories_stores" + } + FloorCoveringStores => "floor_covering_stores", + Florists => "florists", + FloristsSuppliesNurseryStockAndFlowers => "florists_supplies_nursery_stock_and_flowers", + FreezerAndLockerMeatProvisioners => "freezer_and_locker_meat_provisioners", + FuelDealersNonAutomotive => "fuel_dealers_non_automotive", + FuneralServicesCrematories => "funeral_services_crematories", + FurnitureHomeFurnishingsAndEquipmentStoresExceptAppliances => { + "furniture_home_furnishings_and_equipment_stores_except_appliances" + } + FurnitureRepairRefinishing => "furniture_repair_refinishing", + FurriersAndFurShops => "furriers_and_fur_shops", + GeneralServices => "general_services", + GiftCardNoveltyAndSouvenirShops => "gift_card_novelty_and_souvenir_shops", + GlassPaintAndWallpaperStores => "glass_paint_and_wallpaper_stores", + GlasswareCrystalStores => "glassware_crystal_stores", + GolfCoursesPublic => "golf_courses_public", + GovernmentLicensedHorseDogRacingUsRegionOnly => { + "government_licensed_horse_dog_racing_us_region_only" + } + GovernmentLicensedOnlineCasionsOnlineGamblingUsRegionOnly => { + "government_licensed_online_casions_online_gambling_us_region_only" + } + GovernmentOwnedLotteriesNonUsRegion => "government_owned_lotteries_non_us_region", + GovernmentOwnedLotteriesUsRegionOnly => "government_owned_lotteries_us_region_only", + GovernmentServices => "government_services", + GroceryStoresSupermarkets => "grocery_stores_supermarkets", + HardwareEquipmentAndSupplies => "hardware_equipment_and_supplies", + HardwareStores => "hardware_stores", + HealthAndBeautySpas => "health_and_beauty_spas", + HearingAidsSalesAndSupplies => "hearing_aids_sales_and_supplies", + HeatingPlumbingAC => "heating_plumbing_a_c", + HobbyToyAndGameShops => "hobby_toy_and_game_shops", + HomeSupplyWarehouseStores => "home_supply_warehouse_stores", + Hospitals => "hospitals", + HotelsMotelsAndResorts => "hotels_motels_and_resorts", + HouseholdApplianceStores => "household_appliance_stores", + IndustrialSupplies => "industrial_supplies", + InformationRetrievalServices => "information_retrieval_services", + InsuranceDefault => "insurance_default", + InsuranceUnderwritingPremiums => "insurance_underwriting_premiums", + IntraCompanyPurchases => "intra_company_purchases", + JewelryStoresWatchesClocksAndSilverwareStores => { + "jewelry_stores_watches_clocks_and_silverware_stores" + } + LandscapingServices => "landscaping_services", + Laundries => "laundries", + LaundryCleaningServices => "laundry_cleaning_services", + LegalServicesAttorneys => "legal_services_attorneys", + LuggageAndLeatherGoodsStores => "luggage_and_leather_goods_stores", + LumberBuildingMaterialsStores => "lumber_building_materials_stores", + ManualCashDisburse => "manual_cash_disburse", + MarinasServiceAndSupplies => "marinas_service_and_supplies", + Marketplaces => "marketplaces", + MasonryStoneworkAndPlaster => "masonry_stonework_and_plaster", + MassageParlors => "massage_parlors", + MedicalAndDentalLabs => "medical_and_dental_labs", + MedicalDentalOphthalmicAndHospitalEquipmentAndSupplies => { + "medical_dental_ophthalmic_and_hospital_equipment_and_supplies" + } + MedicalServices => "medical_services", + MembershipOrganizations => "membership_organizations", + MensAndBoysClothingAndAccessoriesStores => { + "mens_and_boys_clothing_and_accessories_stores" + } + MensWomensClothingStores => "mens_womens_clothing_stores", + MetalServiceCenters => "metal_service_centers", + Miscellaneous => "miscellaneous", + MiscellaneousApparelAndAccessoryShops => "miscellaneous_apparel_and_accessory_shops", + MiscellaneousAutoDealers => "miscellaneous_auto_dealers", + MiscellaneousBusinessServices => "miscellaneous_business_services", + MiscellaneousFoodStores => "miscellaneous_food_stores", + MiscellaneousGeneralMerchandise => "miscellaneous_general_merchandise", + MiscellaneousGeneralServices => "miscellaneous_general_services", + MiscellaneousHomeFurnishingSpecialtyStores => { + "miscellaneous_home_furnishing_specialty_stores" + } + MiscellaneousPublishingAndPrinting => "miscellaneous_publishing_and_printing", + MiscellaneousRecreationServices => "miscellaneous_recreation_services", + MiscellaneousRepairShops => "miscellaneous_repair_shops", + MiscellaneousSpecialtyRetail => "miscellaneous_specialty_retail", + MobileHomeDealers => "mobile_home_dealers", + MotionPictureTheaters => "motion_picture_theaters", + MotorFreightCarriersAndTrucking => "motor_freight_carriers_and_trucking", + MotorHomesDealers => "motor_homes_dealers", + MotorVehicleSuppliesAndNewParts => "motor_vehicle_supplies_and_new_parts", + MotorcycleShopsAndDealers => "motorcycle_shops_and_dealers", + MotorcycleShopsDealers => "motorcycle_shops_dealers", + MusicStoresMusicalInstrumentsPianosAndSheetMusic => { + "music_stores_musical_instruments_pianos_and_sheet_music" + } + NewsDealersAndNewsstands => "news_dealers_and_newsstands", + NonFiMoneyOrders => "non_fi_money_orders", + NonFiStoredValueCardPurchaseLoad => "non_fi_stored_value_card_purchase_load", + NondurableGoods => "nondurable_goods", + NurseriesLawnAndGardenSupplyStores => "nurseries_lawn_and_garden_supply_stores", + NursingPersonalCare => "nursing_personal_care", + OfficeAndCommercialFurniture => "office_and_commercial_furniture", + OpticiansEyeglasses => "opticians_eyeglasses", + OptometristsOphthalmologist => "optometrists_ophthalmologist", + OrthopedicGoodsProstheticDevices => "orthopedic_goods_prosthetic_devices", + Osteopaths => "osteopaths", + PackageStoresBeerWineAndLiquor => "package_stores_beer_wine_and_liquor", + PaintsVarnishesAndSupplies => "paints_varnishes_and_supplies", + ParkingLotsGarages => "parking_lots_garages", + PassengerRailways => "passenger_railways", + PawnShops => "pawn_shops", + PetShopsPetFoodAndSupplies => "pet_shops_pet_food_and_supplies", + PetroleumAndPetroleumProducts => "petroleum_and_petroleum_products", + PhotoDeveloping => "photo_developing", + PhotographicPhotocopyMicrofilmEquipmentAndSupplies => { + "photographic_photocopy_microfilm_equipment_and_supplies" + } + PhotographicStudios => "photographic_studios", + PictureVideoProduction => "picture_video_production", + PieceGoodsNotionsAndOtherDryGoods => "piece_goods_notions_and_other_dry_goods", + PlumbingHeatingEquipmentAndSupplies => "plumbing_heating_equipment_and_supplies", + PoliticalOrganizations => "political_organizations", + PostalServicesGovernmentOnly => "postal_services_government_only", + PreciousStonesAndMetalsWatchesAndJewelry => { + "precious_stones_and_metals_watches_and_jewelry" + } + ProfessionalServices => "professional_services", + PublicWarehousingAndStorage => "public_warehousing_and_storage", + QuickCopyReproAndBlueprint => "quick_copy_repro_and_blueprint", + Railroads => "railroads", + RealEstateAgentsAndManagersRentals => "real_estate_agents_and_managers_rentals", + RecordStores => "record_stores", + RecreationalVehicleRentals => "recreational_vehicle_rentals", + ReligiousGoodsStores => "religious_goods_stores", + ReligiousOrganizations => "religious_organizations", + RoofingSidingSheetMetal => "roofing_siding_sheet_metal", + SecretarialSupportServices => "secretarial_support_services", + SecurityBrokersDealers => "security_brokers_dealers", + ServiceStations => "service_stations", + SewingNeedleworkFabricAndPieceGoodsStores => { + "sewing_needlework_fabric_and_piece_goods_stores" + } + ShoeRepairHatCleaning => "shoe_repair_hat_cleaning", + ShoeStores => "shoe_stores", + SmallApplianceRepair => "small_appliance_repair", + SnowmobileDealers => "snowmobile_dealers", + SpecialTradeServices => "special_trade_services", + SpecialtyCleaning => "specialty_cleaning", + SportingGoodsStores => "sporting_goods_stores", + SportingRecreationCamps => "sporting_recreation_camps", + SportsAndRidingApparelStores => "sports_and_riding_apparel_stores", + SportsClubsFields => "sports_clubs_fields", + StampAndCoinStores => "stamp_and_coin_stores", + StationaryOfficeSuppliesPrintingAndWritingPaper => { + "stationary_office_supplies_printing_and_writing_paper" + } + StationeryStoresOfficeAndSchoolSupplyStores => { + "stationery_stores_office_and_school_supply_stores" + } + SwimmingPoolsSales => "swimming_pools_sales", + TUiTravelGermany => "t_ui_travel_germany", + TailorsAlterations => "tailors_alterations", + TaxPaymentsGovernmentAgencies => "tax_payments_government_agencies", + TaxPreparationServices => "tax_preparation_services", + TaxicabsLimousines => "taxicabs_limousines", + TelecommunicationEquipmentAndTelephoneSales => { + "telecommunication_equipment_and_telephone_sales" + } + TelecommunicationServices => "telecommunication_services", + TelegraphServices => "telegraph_services", + TentAndAwningShops => "tent_and_awning_shops", + TestingLaboratories => "testing_laboratories", + TheatricalTicketAgencies => "theatrical_ticket_agencies", + Timeshares => "timeshares", + TireRetreadingAndRepair => "tire_retreading_and_repair", + TollsBridgeFees => "tolls_bridge_fees", + TouristAttractionsAndExhibits => "tourist_attractions_and_exhibits", + TowingServices => "towing_services", + TrailerParksCampgrounds => "trailer_parks_campgrounds", + TransportationServices => "transportation_services", + TravelAgenciesTourOperators => "travel_agencies_tour_operators", + TruckStopIteration => "truck_stop_iteration", + TruckUtilityTrailerRentals => "truck_utility_trailer_rentals", + TypesettingPlateMakingAndRelatedServices => { + "typesetting_plate_making_and_related_services" + } + TypewriterStores => "typewriter_stores", + USFederalGovernmentAgenciesOrDepartments => { + "u_s_federal_government_agencies_or_departments" + } + UniformsCommercialClothing => "uniforms_commercial_clothing", + UsedMerchandiseAndSecondhandStores => "used_merchandise_and_secondhand_stores", + Utilities => "utilities", + VarietyStores => "variety_stores", + VeterinaryServices => "veterinary_services", + VideoAmusementGameSupplies => "video_amusement_game_supplies", + VideoGameArcades => "video_game_arcades", + VideoTapeRentalStores => "video_tape_rental_stores", + VocationalTradeSchools => "vocational_trade_schools", + WatchJewelryRepair => "watch_jewelry_repair", + WeldingRepair => "welding_repair", + WholesaleClubs => "wholesale_clubs", + WigAndToupeeStores => "wig_and_toupee_stores", + WiresMoneyOrders => "wires_money_orders", + WomensAccessoryAndSpecialtyShops => "womens_accessory_and_specialty_shops", + WomensReadyToWearStores => "womens_ready_to_wear_stores", + WreckingAndSalvageYards => "wrecking_and_salvage_yards", + Unknown => "unknown", + } + } +} + +impl std::str::FromStr for CreateIssuingCardholderSpendingControlsSpendingLimitsCategories { + type Err = (); + fn from_str(s: &str) -> Result { + use CreateIssuingCardholderSpendingControlsSpendingLimitsCategories::*; + match s { + "ac_refrigeration_repair" => Ok(AcRefrigerationRepair), + "accounting_bookkeeping_services" => Ok(AccountingBookkeepingServices), + "advertising_services" => Ok(AdvertisingServices), + "agricultural_cooperative" => Ok(AgriculturalCooperative), + "airlines_air_carriers" => Ok(AirlinesAirCarriers), + "airports_flying_fields" => Ok(AirportsFlyingFields), + "ambulance_services" => Ok(AmbulanceServices), + "amusement_parks_carnivals" => Ok(AmusementParksCarnivals), + "antique_reproductions" => Ok(AntiqueReproductions), + "antique_shops" => Ok(AntiqueShops), + "aquariums" => Ok(Aquariums), + "architectural_surveying_services" => Ok(ArchitecturalSurveyingServices), + "art_dealers_and_galleries" => Ok(ArtDealersAndGalleries), + "artists_supply_and_craft_shops" => Ok(ArtistsSupplyAndCraftShops), + "auto_and_home_supply_stores" => Ok(AutoAndHomeSupplyStores), + "auto_body_repair_shops" => Ok(AutoBodyRepairShops), + "auto_paint_shops" => Ok(AutoPaintShops), + "auto_service_shops" => Ok(AutoServiceShops), + "automated_cash_disburse" => Ok(AutomatedCashDisburse), + "automated_fuel_dispensers" => Ok(AutomatedFuelDispensers), + "automobile_associations" => Ok(AutomobileAssociations), + "automotive_parts_and_accessories_stores" => Ok(AutomotivePartsAndAccessoriesStores), + "automotive_tire_stores" => Ok(AutomotiveTireStores), + "bail_and_bond_payments" => Ok(BailAndBondPayments), + "bakeries" => Ok(Bakeries), + "bands_orchestras" => Ok(BandsOrchestras), + "barber_and_beauty_shops" => Ok(BarberAndBeautyShops), + "betting_casino_gambling" => Ok(BettingCasinoGambling), + "bicycle_shops" => Ok(BicycleShops), + "billiard_pool_establishments" => Ok(BilliardPoolEstablishments), + "boat_dealers" => Ok(BoatDealers), + "boat_rentals_and_leases" => Ok(BoatRentalsAndLeases), + "book_stores" => Ok(BookStores), + "books_periodicals_and_newspapers" => Ok(BooksPeriodicalsAndNewspapers), + "bowling_alleys" => Ok(BowlingAlleys), + "bus_lines" => Ok(BusLines), + "business_secretarial_schools" => Ok(BusinessSecretarialSchools), + "buying_shopping_services" => Ok(BuyingShoppingServices), + "cable_satellite_and_other_pay_television_and_radio" => { + Ok(CableSatelliteAndOtherPayTelevisionAndRadio) + } + "camera_and_photographic_supply_stores" => Ok(CameraAndPhotographicSupplyStores), + "candy_nut_and_confectionery_stores" => Ok(CandyNutAndConfectioneryStores), + "car_and_truck_dealers_new_used" => Ok(CarAndTruckDealersNewUsed), + "car_and_truck_dealers_used_only" => Ok(CarAndTruckDealersUsedOnly), + "car_rental_agencies" => Ok(CarRentalAgencies), + "car_washes" => Ok(CarWashes), + "carpentry_services" => Ok(CarpentryServices), + "carpet_upholstery_cleaning" => Ok(CarpetUpholsteryCleaning), + "caterers" => Ok(Caterers), + "charitable_and_social_service_organizations_fundraising" => { + Ok(CharitableAndSocialServiceOrganizationsFundraising) + } + "chemicals_and_allied_products" => Ok(ChemicalsAndAlliedProducts), + "child_care_services" => Ok(ChildCareServices), + "childrens_and_infants_wear_stores" => Ok(ChildrensAndInfantsWearStores), + "chiropodists_podiatrists" => Ok(ChiropodistsPodiatrists), + "chiropractors" => Ok(Chiropractors), + "cigar_stores_and_stands" => Ok(CigarStoresAndStands), + "civic_social_fraternal_associations" => Ok(CivicSocialFraternalAssociations), + "cleaning_and_maintenance" => Ok(CleaningAndMaintenance), + "clothing_rental" => Ok(ClothingRental), + "colleges_universities" => Ok(CollegesUniversities), + "commercial_equipment" => Ok(CommercialEquipment), + "commercial_footwear" => Ok(CommercialFootwear), + "commercial_photography_art_and_graphics" => Ok(CommercialPhotographyArtAndGraphics), + "commuter_transport_and_ferries" => Ok(CommuterTransportAndFerries), + "computer_network_services" => Ok(ComputerNetworkServices), + "computer_programming" => Ok(ComputerProgramming), + "computer_repair" => Ok(ComputerRepair), + "computer_software_stores" => Ok(ComputerSoftwareStores), + "computers_peripherals_and_software" => Ok(ComputersPeripheralsAndSoftware), + "concrete_work_services" => Ok(ConcreteWorkServices), + "construction_materials" => Ok(ConstructionMaterials), + "consulting_public_relations" => Ok(ConsultingPublicRelations), + "correspondence_schools" => Ok(CorrespondenceSchools), + "cosmetic_stores" => Ok(CosmeticStores), + "counseling_services" => Ok(CounselingServices), + "country_clubs" => Ok(CountryClubs), + "courier_services" => Ok(CourierServices), + "court_costs" => Ok(CourtCosts), + "credit_reporting_agencies" => Ok(CreditReportingAgencies), + "cruise_lines" => Ok(CruiseLines), + "dairy_products_stores" => Ok(DairyProductsStores), + "dance_hall_studios_schools" => Ok(DanceHallStudiosSchools), + "dating_escort_services" => Ok(DatingEscortServices), + "dentists_orthodontists" => Ok(DentistsOrthodontists), + "department_stores" => Ok(DepartmentStores), + "detective_agencies" => Ok(DetectiveAgencies), + "digital_goods_applications" => Ok(DigitalGoodsApplications), + "digital_goods_games" => Ok(DigitalGoodsGames), + "digital_goods_large_volume" => Ok(DigitalGoodsLargeVolume), + "digital_goods_media" => Ok(DigitalGoodsMedia), + "direct_marketing_catalog_merchant" => Ok(DirectMarketingCatalogMerchant), + "direct_marketing_combination_catalog_and_retail_merchant" => { + Ok(DirectMarketingCombinationCatalogAndRetailMerchant) + } + "direct_marketing_inbound_telemarketing" => Ok(DirectMarketingInboundTelemarketing), + "direct_marketing_insurance_services" => Ok(DirectMarketingInsuranceServices), + "direct_marketing_other" => Ok(DirectMarketingOther), + "direct_marketing_outbound_telemarketing" => Ok(DirectMarketingOutboundTelemarketing), + "direct_marketing_subscription" => Ok(DirectMarketingSubscription), + "direct_marketing_travel" => Ok(DirectMarketingTravel), + "discount_stores" => Ok(DiscountStores), + "doctors" => Ok(Doctors), + "door_to_door_sales" => Ok(DoorToDoorSales), + "drapery_window_covering_and_upholstery_stores" => { + Ok(DraperyWindowCoveringAndUpholsteryStores) + } + "drinking_places" => Ok(DrinkingPlaces), + "drug_stores_and_pharmacies" => Ok(DrugStoresAndPharmacies), + "drugs_drug_proprietaries_and_druggist_sundries" => { + Ok(DrugsDrugProprietariesAndDruggistSundries) + } + "dry_cleaners" => Ok(DryCleaners), + "durable_goods" => Ok(DurableGoods), + "duty_free_stores" => Ok(DutyFreeStores), + "eating_places_restaurants" => Ok(EatingPlacesRestaurants), + "educational_services" => Ok(EducationalServices), + "electric_razor_stores" => Ok(ElectricRazorStores), + "electric_vehicle_charging" => Ok(ElectricVehicleCharging), + "electrical_parts_and_equipment" => Ok(ElectricalPartsAndEquipment), + "electrical_services" => Ok(ElectricalServices), + "electronics_repair_shops" => Ok(ElectronicsRepairShops), + "electronics_stores" => Ok(ElectronicsStores), + "elementary_secondary_schools" => Ok(ElementarySecondarySchools), + "emergency_services_gcas_visa_use_only" => Ok(EmergencyServicesGcasVisaUseOnly), + "employment_temp_agencies" => Ok(EmploymentTempAgencies), + "equipment_rental" => Ok(EquipmentRental), + "exterminating_services" => Ok(ExterminatingServices), + "family_clothing_stores" => Ok(FamilyClothingStores), + "fast_food_restaurants" => Ok(FastFoodRestaurants), + "financial_institutions" => Ok(FinancialInstitutions), + "fines_government_administrative_entities" => Ok(FinesGovernmentAdministrativeEntities), + "fireplace_fireplace_screens_and_accessories_stores" => { + Ok(FireplaceFireplaceScreensAndAccessoriesStores) + } + "floor_covering_stores" => Ok(FloorCoveringStores), + "florists" => Ok(Florists), + "florists_supplies_nursery_stock_and_flowers" => { + Ok(FloristsSuppliesNurseryStockAndFlowers) + } + "freezer_and_locker_meat_provisioners" => Ok(FreezerAndLockerMeatProvisioners), + "fuel_dealers_non_automotive" => Ok(FuelDealersNonAutomotive), + "funeral_services_crematories" => Ok(FuneralServicesCrematories), + "furniture_home_furnishings_and_equipment_stores_except_appliances" => { + Ok(FurnitureHomeFurnishingsAndEquipmentStoresExceptAppliances) + } + "furniture_repair_refinishing" => Ok(FurnitureRepairRefinishing), + "furriers_and_fur_shops" => Ok(FurriersAndFurShops), + "general_services" => Ok(GeneralServices), + "gift_card_novelty_and_souvenir_shops" => Ok(GiftCardNoveltyAndSouvenirShops), + "glass_paint_and_wallpaper_stores" => Ok(GlassPaintAndWallpaperStores), + "glassware_crystal_stores" => Ok(GlasswareCrystalStores), + "golf_courses_public" => Ok(GolfCoursesPublic), + "government_licensed_horse_dog_racing_us_region_only" => { + Ok(GovernmentLicensedHorseDogRacingUsRegionOnly) + } + "government_licensed_online_casions_online_gambling_us_region_only" => { + Ok(GovernmentLicensedOnlineCasionsOnlineGamblingUsRegionOnly) + } + "government_owned_lotteries_non_us_region" => Ok(GovernmentOwnedLotteriesNonUsRegion), + "government_owned_lotteries_us_region_only" => Ok(GovernmentOwnedLotteriesUsRegionOnly), + "government_services" => Ok(GovernmentServices), + "grocery_stores_supermarkets" => Ok(GroceryStoresSupermarkets), + "hardware_equipment_and_supplies" => Ok(HardwareEquipmentAndSupplies), + "hardware_stores" => Ok(HardwareStores), + "health_and_beauty_spas" => Ok(HealthAndBeautySpas), + "hearing_aids_sales_and_supplies" => Ok(HearingAidsSalesAndSupplies), + "heating_plumbing_a_c" => Ok(HeatingPlumbingAC), + "hobby_toy_and_game_shops" => Ok(HobbyToyAndGameShops), + "home_supply_warehouse_stores" => Ok(HomeSupplyWarehouseStores), + "hospitals" => Ok(Hospitals), + "hotels_motels_and_resorts" => Ok(HotelsMotelsAndResorts), + "household_appliance_stores" => Ok(HouseholdApplianceStores), + "industrial_supplies" => Ok(IndustrialSupplies), + "information_retrieval_services" => Ok(InformationRetrievalServices), + "insurance_default" => Ok(InsuranceDefault), + "insurance_underwriting_premiums" => Ok(InsuranceUnderwritingPremiums), + "intra_company_purchases" => Ok(IntraCompanyPurchases), + "jewelry_stores_watches_clocks_and_silverware_stores" => { + Ok(JewelryStoresWatchesClocksAndSilverwareStores) + } + "landscaping_services" => Ok(LandscapingServices), + "laundries" => Ok(Laundries), + "laundry_cleaning_services" => Ok(LaundryCleaningServices), + "legal_services_attorneys" => Ok(LegalServicesAttorneys), + "luggage_and_leather_goods_stores" => Ok(LuggageAndLeatherGoodsStores), + "lumber_building_materials_stores" => Ok(LumberBuildingMaterialsStores), + "manual_cash_disburse" => Ok(ManualCashDisburse), + "marinas_service_and_supplies" => Ok(MarinasServiceAndSupplies), + "marketplaces" => Ok(Marketplaces), + "masonry_stonework_and_plaster" => Ok(MasonryStoneworkAndPlaster), + "massage_parlors" => Ok(MassageParlors), + "medical_and_dental_labs" => Ok(MedicalAndDentalLabs), + "medical_dental_ophthalmic_and_hospital_equipment_and_supplies" => { + Ok(MedicalDentalOphthalmicAndHospitalEquipmentAndSupplies) + } + "medical_services" => Ok(MedicalServices), + "membership_organizations" => Ok(MembershipOrganizations), + "mens_and_boys_clothing_and_accessories_stores" => { + Ok(MensAndBoysClothingAndAccessoriesStores) + } + "mens_womens_clothing_stores" => Ok(MensWomensClothingStores), + "metal_service_centers" => Ok(MetalServiceCenters), + "miscellaneous" => Ok(Miscellaneous), + "miscellaneous_apparel_and_accessory_shops" => { + Ok(MiscellaneousApparelAndAccessoryShops) + } + "miscellaneous_auto_dealers" => Ok(MiscellaneousAutoDealers), + "miscellaneous_business_services" => Ok(MiscellaneousBusinessServices), + "miscellaneous_food_stores" => Ok(MiscellaneousFoodStores), + "miscellaneous_general_merchandise" => Ok(MiscellaneousGeneralMerchandise), + "miscellaneous_general_services" => Ok(MiscellaneousGeneralServices), + "miscellaneous_home_furnishing_specialty_stores" => { + Ok(MiscellaneousHomeFurnishingSpecialtyStores) + } + "miscellaneous_publishing_and_printing" => Ok(MiscellaneousPublishingAndPrinting), + "miscellaneous_recreation_services" => Ok(MiscellaneousRecreationServices), + "miscellaneous_repair_shops" => Ok(MiscellaneousRepairShops), + "miscellaneous_specialty_retail" => Ok(MiscellaneousSpecialtyRetail), + "mobile_home_dealers" => Ok(MobileHomeDealers), + "motion_picture_theaters" => Ok(MotionPictureTheaters), + "motor_freight_carriers_and_trucking" => Ok(MotorFreightCarriersAndTrucking), + "motor_homes_dealers" => Ok(MotorHomesDealers), + "motor_vehicle_supplies_and_new_parts" => Ok(MotorVehicleSuppliesAndNewParts), + "motorcycle_shops_and_dealers" => Ok(MotorcycleShopsAndDealers), + "motorcycle_shops_dealers" => Ok(MotorcycleShopsDealers), + "music_stores_musical_instruments_pianos_and_sheet_music" => { + Ok(MusicStoresMusicalInstrumentsPianosAndSheetMusic) + } + "news_dealers_and_newsstands" => Ok(NewsDealersAndNewsstands), + "non_fi_money_orders" => Ok(NonFiMoneyOrders), + "non_fi_stored_value_card_purchase_load" => Ok(NonFiStoredValueCardPurchaseLoad), + "nondurable_goods" => Ok(NondurableGoods), + "nurseries_lawn_and_garden_supply_stores" => Ok(NurseriesLawnAndGardenSupplyStores), + "nursing_personal_care" => Ok(NursingPersonalCare), + "office_and_commercial_furniture" => Ok(OfficeAndCommercialFurniture), + "opticians_eyeglasses" => Ok(OpticiansEyeglasses), + "optometrists_ophthalmologist" => Ok(OptometristsOphthalmologist), + "orthopedic_goods_prosthetic_devices" => Ok(OrthopedicGoodsProstheticDevices), + "osteopaths" => Ok(Osteopaths), + "package_stores_beer_wine_and_liquor" => Ok(PackageStoresBeerWineAndLiquor), + "paints_varnishes_and_supplies" => Ok(PaintsVarnishesAndSupplies), + "parking_lots_garages" => Ok(ParkingLotsGarages), + "passenger_railways" => Ok(PassengerRailways), + "pawn_shops" => Ok(PawnShops), + "pet_shops_pet_food_and_supplies" => Ok(PetShopsPetFoodAndSupplies), + "petroleum_and_petroleum_products" => Ok(PetroleumAndPetroleumProducts), + "photo_developing" => Ok(PhotoDeveloping), + "photographic_photocopy_microfilm_equipment_and_supplies" => { + Ok(PhotographicPhotocopyMicrofilmEquipmentAndSupplies) + } + "photographic_studios" => Ok(PhotographicStudios), + "picture_video_production" => Ok(PictureVideoProduction), + "piece_goods_notions_and_other_dry_goods" => Ok(PieceGoodsNotionsAndOtherDryGoods), + "plumbing_heating_equipment_and_supplies" => Ok(PlumbingHeatingEquipmentAndSupplies), + "political_organizations" => Ok(PoliticalOrganizations), + "postal_services_government_only" => Ok(PostalServicesGovernmentOnly), + "precious_stones_and_metals_watches_and_jewelry" => { + Ok(PreciousStonesAndMetalsWatchesAndJewelry) + } + "professional_services" => Ok(ProfessionalServices), + "public_warehousing_and_storage" => Ok(PublicWarehousingAndStorage), + "quick_copy_repro_and_blueprint" => Ok(QuickCopyReproAndBlueprint), + "railroads" => Ok(Railroads), + "real_estate_agents_and_managers_rentals" => Ok(RealEstateAgentsAndManagersRentals), + "record_stores" => Ok(RecordStores), + "recreational_vehicle_rentals" => Ok(RecreationalVehicleRentals), + "religious_goods_stores" => Ok(ReligiousGoodsStores), + "religious_organizations" => Ok(ReligiousOrganizations), + "roofing_siding_sheet_metal" => Ok(RoofingSidingSheetMetal), + "secretarial_support_services" => Ok(SecretarialSupportServices), + "security_brokers_dealers" => Ok(SecurityBrokersDealers), + "service_stations" => Ok(ServiceStations), + "sewing_needlework_fabric_and_piece_goods_stores" => { + Ok(SewingNeedleworkFabricAndPieceGoodsStores) + } + "shoe_repair_hat_cleaning" => Ok(ShoeRepairHatCleaning), + "shoe_stores" => Ok(ShoeStores), + "small_appliance_repair" => Ok(SmallApplianceRepair), + "snowmobile_dealers" => Ok(SnowmobileDealers), + "special_trade_services" => Ok(SpecialTradeServices), + "specialty_cleaning" => Ok(SpecialtyCleaning), + "sporting_goods_stores" => Ok(SportingGoodsStores), + "sporting_recreation_camps" => Ok(SportingRecreationCamps), + "sports_and_riding_apparel_stores" => Ok(SportsAndRidingApparelStores), + "sports_clubs_fields" => Ok(SportsClubsFields), + "stamp_and_coin_stores" => Ok(StampAndCoinStores), + "stationary_office_supplies_printing_and_writing_paper" => { + Ok(StationaryOfficeSuppliesPrintingAndWritingPaper) + } + "stationery_stores_office_and_school_supply_stores" => { + Ok(StationeryStoresOfficeAndSchoolSupplyStores) + } + "swimming_pools_sales" => Ok(SwimmingPoolsSales), + "t_ui_travel_germany" => Ok(TUiTravelGermany), + "tailors_alterations" => Ok(TailorsAlterations), + "tax_payments_government_agencies" => Ok(TaxPaymentsGovernmentAgencies), + "tax_preparation_services" => Ok(TaxPreparationServices), + "taxicabs_limousines" => Ok(TaxicabsLimousines), + "telecommunication_equipment_and_telephone_sales" => { + Ok(TelecommunicationEquipmentAndTelephoneSales) + } + "telecommunication_services" => Ok(TelecommunicationServices), + "telegraph_services" => Ok(TelegraphServices), + "tent_and_awning_shops" => Ok(TentAndAwningShops), + "testing_laboratories" => Ok(TestingLaboratories), + "theatrical_ticket_agencies" => Ok(TheatricalTicketAgencies), + "timeshares" => Ok(Timeshares), + "tire_retreading_and_repair" => Ok(TireRetreadingAndRepair), + "tolls_bridge_fees" => Ok(TollsBridgeFees), + "tourist_attractions_and_exhibits" => Ok(TouristAttractionsAndExhibits), + "towing_services" => Ok(TowingServices), + "trailer_parks_campgrounds" => Ok(TrailerParksCampgrounds), + "transportation_services" => Ok(TransportationServices), + "travel_agencies_tour_operators" => Ok(TravelAgenciesTourOperators), + "truck_stop_iteration" => Ok(TruckStopIteration), + "truck_utility_trailer_rentals" => Ok(TruckUtilityTrailerRentals), + "typesetting_plate_making_and_related_services" => { + Ok(TypesettingPlateMakingAndRelatedServices) + } + "typewriter_stores" => Ok(TypewriterStores), + "u_s_federal_government_agencies_or_departments" => { + Ok(USFederalGovernmentAgenciesOrDepartments) + } + "uniforms_commercial_clothing" => Ok(UniformsCommercialClothing), + "used_merchandise_and_secondhand_stores" => Ok(UsedMerchandiseAndSecondhandStores), + "utilities" => Ok(Utilities), + "variety_stores" => Ok(VarietyStores), + "veterinary_services" => Ok(VeterinaryServices), + "video_amusement_game_supplies" => Ok(VideoAmusementGameSupplies), + "video_game_arcades" => Ok(VideoGameArcades), + "video_tape_rental_stores" => Ok(VideoTapeRentalStores), + "vocational_trade_schools" => Ok(VocationalTradeSchools), + "watch_jewelry_repair" => Ok(WatchJewelryRepair), + "welding_repair" => Ok(WeldingRepair), + "wholesale_clubs" => Ok(WholesaleClubs), + "wig_and_toupee_stores" => Ok(WigAndToupeeStores), + "wires_money_orders" => Ok(WiresMoneyOrders), + "womens_accessory_and_specialty_shops" => Ok(WomensAccessoryAndSpecialtyShops), + "womens_ready_to_wear_stores" => Ok(WomensReadyToWearStores), + "wrecking_and_salvage_yards" => Ok(WreckingAndSalvageYards), + _ => Err(()), + } + } +} +impl std::fmt::Display for CreateIssuingCardholderSpendingControlsSpendingLimitsCategories { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreateIssuingCardholderSpendingControlsSpendingLimitsCategories { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreateIssuingCardholderSpendingControlsSpendingLimitsCategories { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Interval (or event) to which the amount applies. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreateIssuingCardholderSpendingControlsSpendingLimitsInterval { + AllTime, + Daily, + Monthly, + PerAuthorization, + Weekly, + Yearly, +} +impl CreateIssuingCardholderSpendingControlsSpendingLimitsInterval { + pub fn as_str(self) -> &'static str { + use CreateIssuingCardholderSpendingControlsSpendingLimitsInterval::*; + match self { + AllTime => "all_time", + Daily => "daily", + Monthly => "monthly", + PerAuthorization => "per_authorization", + Weekly => "weekly", + Yearly => "yearly", + } + } +} + +impl std::str::FromStr for CreateIssuingCardholderSpendingControlsSpendingLimitsInterval { + type Err = (); + fn from_str(s: &str) -> Result { + use CreateIssuingCardholderSpendingControlsSpendingLimitsInterval::*; + match s { + "all_time" => Ok(AllTime), + "daily" => Ok(Daily), + "monthly" => Ok(Monthly), + "per_authorization" => Ok(PerAuthorization), + "weekly" => Ok(Weekly), + "yearly" => Ok(Yearly), + _ => Err(()), + } + } +} +impl std::fmt::Display for CreateIssuingCardholderSpendingControlsSpendingLimitsInterval { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreateIssuingCardholderSpendingControlsSpendingLimitsInterval { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreateIssuingCardholderSpendingControlsSpendingLimitsInterval { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Specifies whether to permit authorizations on this cardholder's cards. Defaults to `active`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreateIssuingCardholderStatus { + Active, + Inactive, +} +impl CreateIssuingCardholderStatus { + pub fn as_str(self) -> &'static str { + use CreateIssuingCardholderStatus::*; + match self { + Active => "active", + Inactive => "inactive", + } + } +} + +impl std::str::FromStr for CreateIssuingCardholderStatus { + type Err = (); + fn from_str(s: &str) -> Result { + use CreateIssuingCardholderStatus::*; + match s { + "active" => Ok(Active), + "inactive" => Ok(Inactive), + _ => Err(()), + } + } +} +impl std::fmt::Display for CreateIssuingCardholderStatus { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreateIssuingCardholderStatus { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreateIssuingCardholderStatus { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'a> CreateIssuingCardholder<'a> { + /// Creates a new Issuing `Cardholder` object that can be issued cards. + pub fn send( + &self, + client: &stripe::Client, + ) -> stripe::Response { + client.send_form("/issuing/cardholders", self, http_types::Method::Post) + } +} +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdateIssuingCardholder<'a> { + /// The cardholder's billing address. + #[serde(skip_serializing_if = "Option::is_none")] + pub billing: Option>, + /// Additional information about a `company` cardholder. + #[serde(skip_serializing_if = "Option::is_none")] + pub company: Option>, + /// The cardholder's email address. + #[serde(skip_serializing_if = "Option::is_none")] + pub email: Option<&'a str>, + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, + /// Additional information about an `individual` cardholder. + #[serde(skip_serializing_if = "Option::is_none")] + pub individual: Option>, + /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. + /// This can be useful for storing additional information about the object in a structured format. + /// Individual keys can be unset by posting an empty value to them. + /// All keys can be unset by posting an empty value to `metadata`. + #[serde(skip_serializing_if = "Option::is_none")] + pub metadata: Option<&'a std::collections::HashMap>, + /// The cardholder's phone number. + /// This is required for all cardholders who will be creating EU cards. + /// See the [3D Secure documentation](https://stripe.com/docs/issuing/3d-secure) for more details. + #[serde(skip_serializing_if = "Option::is_none")] + pub phone_number: Option<&'a str>, + /// The cardholder’s preferred locales (languages), ordered by preference. + /// Locales can be `de`, `en`, `es`, `fr`, or `it`. + /// This changes the language of the [3D Secure flow](https://stripe.com/docs/issuing/3d-secure) and one-time password messages sent to the cardholder. + #[serde(skip_serializing_if = "Option::is_none")] + pub preferred_locales: Option<&'a [stripe_shared::IssuingCardholderPreferredLocales]>, + /// Rules that control spending across this cardholder's cards. + /// Refer to our [documentation](https://stripe.com/docs/issuing/controls/spending-controls) for more details. + #[serde(skip_serializing_if = "Option::is_none")] + pub spending_controls: Option>, + /// Specifies whether to permit authorizations on this cardholder's cards. + #[serde(skip_serializing_if = "Option::is_none")] + pub status: Option, +} +impl<'a> UpdateIssuingCardholder<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// Rules that control spending across this cardholder's cards. +/// Refer to our [documentation](https://stripe.com/docs/issuing/controls/spending-controls) for more details. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdateIssuingCardholderSpendingControls<'a> { + /// Array of strings containing [categories](https://stripe.com/docs/api#issuing_authorization_object-merchant_data-category) of authorizations to allow. + /// All other categories will be blocked. + /// Cannot be set with `blocked_categories`. + #[serde(skip_serializing_if = "Option::is_none")] + pub allowed_categories: Option<&'a [UpdateIssuingCardholderSpendingControlsAllowedCategories]>, + /// Array of strings containing [categories](https://stripe.com/docs/api#issuing_authorization_object-merchant_data-category) of authorizations to decline. + /// All other categories will be allowed. + /// Cannot be set with `allowed_categories`. + #[serde(skip_serializing_if = "Option::is_none")] + pub blocked_categories: Option<&'a [UpdateIssuingCardholderSpendingControlsBlockedCategories]>, + /// Limit spending with amount-based rules that apply across this cardholder's cards. + #[serde(skip_serializing_if = "Option::is_none")] + pub spending_limits: Option<&'a [UpdateIssuingCardholderSpendingControlsSpendingLimits<'a>]>, + /// Currency of amounts within `spending_limits`. Defaults to your merchant country's currency. + #[serde(skip_serializing_if = "Option::is_none")] + pub spending_limits_currency: Option, +} +impl<'a> UpdateIssuingCardholderSpendingControls<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// Array of strings containing [categories](https://stripe.com/docs/api#issuing_authorization_object-merchant_data-category) of authorizations to allow. +/// All other categories will be blocked. +/// Cannot be set with `blocked_categories`. +#[derive(Copy, Clone, Eq, PartialEq)] +#[non_exhaustive] +pub enum UpdateIssuingCardholderSpendingControlsAllowedCategories { + AcRefrigerationRepair, + AccountingBookkeepingServices, + AdvertisingServices, + AgriculturalCooperative, + AirlinesAirCarriers, + AirportsFlyingFields, + AmbulanceServices, + AmusementParksCarnivals, + AntiqueReproductions, + AntiqueShops, + Aquariums, + ArchitecturalSurveyingServices, + ArtDealersAndGalleries, + ArtistsSupplyAndCraftShops, + AutoAndHomeSupplyStores, + AutoBodyRepairShops, + AutoPaintShops, + AutoServiceShops, + AutomatedCashDisburse, + AutomatedFuelDispensers, + AutomobileAssociations, + AutomotivePartsAndAccessoriesStores, + AutomotiveTireStores, + BailAndBondPayments, + Bakeries, + BandsOrchestras, + BarberAndBeautyShops, + BettingCasinoGambling, + BicycleShops, + BilliardPoolEstablishments, + BoatDealers, + BoatRentalsAndLeases, + BookStores, + BooksPeriodicalsAndNewspapers, + BowlingAlleys, + BusLines, + BusinessSecretarialSchools, + BuyingShoppingServices, + CableSatelliteAndOtherPayTelevisionAndRadio, + CameraAndPhotographicSupplyStores, + CandyNutAndConfectioneryStores, + CarAndTruckDealersNewUsed, + CarAndTruckDealersUsedOnly, + CarRentalAgencies, + CarWashes, + CarpentryServices, + CarpetUpholsteryCleaning, + Caterers, + CharitableAndSocialServiceOrganizationsFundraising, + ChemicalsAndAlliedProducts, + ChildCareServices, + ChildrensAndInfantsWearStores, + ChiropodistsPodiatrists, + Chiropractors, + CigarStoresAndStands, + CivicSocialFraternalAssociations, + CleaningAndMaintenance, + ClothingRental, + CollegesUniversities, + CommercialEquipment, + CommercialFootwear, + CommercialPhotographyArtAndGraphics, + CommuterTransportAndFerries, + ComputerNetworkServices, + ComputerProgramming, + ComputerRepair, + ComputerSoftwareStores, + ComputersPeripheralsAndSoftware, + ConcreteWorkServices, + ConstructionMaterials, + ConsultingPublicRelations, + CorrespondenceSchools, + CosmeticStores, + CounselingServices, + CountryClubs, + CourierServices, + CourtCosts, + CreditReportingAgencies, + CruiseLines, + DairyProductsStores, + DanceHallStudiosSchools, + DatingEscortServices, + DentistsOrthodontists, + DepartmentStores, + DetectiveAgencies, + DigitalGoodsApplications, + DigitalGoodsGames, + DigitalGoodsLargeVolume, + DigitalGoodsMedia, + DirectMarketingCatalogMerchant, + DirectMarketingCombinationCatalogAndRetailMerchant, + DirectMarketingInboundTelemarketing, + DirectMarketingInsuranceServices, + DirectMarketingOther, + DirectMarketingOutboundTelemarketing, + DirectMarketingSubscription, + DirectMarketingTravel, + DiscountStores, + Doctors, + DoorToDoorSales, + DraperyWindowCoveringAndUpholsteryStores, + DrinkingPlaces, + DrugStoresAndPharmacies, + DrugsDrugProprietariesAndDruggistSundries, + DryCleaners, + DurableGoods, + DutyFreeStores, + EatingPlacesRestaurants, + EducationalServices, + ElectricRazorStores, + ElectricVehicleCharging, + ElectricalPartsAndEquipment, + ElectricalServices, + ElectronicsRepairShops, + ElectronicsStores, + ElementarySecondarySchools, + EmergencyServicesGcasVisaUseOnly, + EmploymentTempAgencies, + EquipmentRental, + ExterminatingServices, + FamilyClothingStores, + FastFoodRestaurants, + FinancialInstitutions, + FinesGovernmentAdministrativeEntities, + FireplaceFireplaceScreensAndAccessoriesStores, + FloorCoveringStores, + Florists, + FloristsSuppliesNurseryStockAndFlowers, + FreezerAndLockerMeatProvisioners, + FuelDealersNonAutomotive, + FuneralServicesCrematories, + FurnitureHomeFurnishingsAndEquipmentStoresExceptAppliances, + FurnitureRepairRefinishing, + FurriersAndFurShops, + GeneralServices, + GiftCardNoveltyAndSouvenirShops, + GlassPaintAndWallpaperStores, + GlasswareCrystalStores, + GolfCoursesPublic, + GovernmentLicensedHorseDogRacingUsRegionOnly, + GovernmentLicensedOnlineCasionsOnlineGamblingUsRegionOnly, + GovernmentOwnedLotteriesNonUsRegion, + GovernmentOwnedLotteriesUsRegionOnly, + GovernmentServices, + GroceryStoresSupermarkets, + HardwareEquipmentAndSupplies, + HardwareStores, + HealthAndBeautySpas, + HearingAidsSalesAndSupplies, + HeatingPlumbingAC, + HobbyToyAndGameShops, + HomeSupplyWarehouseStores, + Hospitals, + HotelsMotelsAndResorts, + HouseholdApplianceStores, + IndustrialSupplies, + InformationRetrievalServices, + InsuranceDefault, + InsuranceUnderwritingPremiums, + IntraCompanyPurchases, + JewelryStoresWatchesClocksAndSilverwareStores, + LandscapingServices, + Laundries, + LaundryCleaningServices, + LegalServicesAttorneys, + LuggageAndLeatherGoodsStores, + LumberBuildingMaterialsStores, + ManualCashDisburse, + MarinasServiceAndSupplies, + Marketplaces, + MasonryStoneworkAndPlaster, + MassageParlors, + MedicalAndDentalLabs, + MedicalDentalOphthalmicAndHospitalEquipmentAndSupplies, + MedicalServices, + MembershipOrganizations, + MensAndBoysClothingAndAccessoriesStores, + MensWomensClothingStores, + MetalServiceCenters, + Miscellaneous, + MiscellaneousApparelAndAccessoryShops, + MiscellaneousAutoDealers, + MiscellaneousBusinessServices, + MiscellaneousFoodStores, + MiscellaneousGeneralMerchandise, + MiscellaneousGeneralServices, + MiscellaneousHomeFurnishingSpecialtyStores, + MiscellaneousPublishingAndPrinting, + MiscellaneousRecreationServices, + MiscellaneousRepairShops, + MiscellaneousSpecialtyRetail, + MobileHomeDealers, + MotionPictureTheaters, + MotorFreightCarriersAndTrucking, + MotorHomesDealers, + MotorVehicleSuppliesAndNewParts, + MotorcycleShopsAndDealers, + MotorcycleShopsDealers, + MusicStoresMusicalInstrumentsPianosAndSheetMusic, + NewsDealersAndNewsstands, + NonFiMoneyOrders, + NonFiStoredValueCardPurchaseLoad, + NondurableGoods, + NurseriesLawnAndGardenSupplyStores, + NursingPersonalCare, + OfficeAndCommercialFurniture, + OpticiansEyeglasses, + OptometristsOphthalmologist, + OrthopedicGoodsProstheticDevices, + Osteopaths, + PackageStoresBeerWineAndLiquor, + PaintsVarnishesAndSupplies, + ParkingLotsGarages, + PassengerRailways, + PawnShops, + PetShopsPetFoodAndSupplies, + PetroleumAndPetroleumProducts, + PhotoDeveloping, + PhotographicPhotocopyMicrofilmEquipmentAndSupplies, + PhotographicStudios, + PictureVideoProduction, + PieceGoodsNotionsAndOtherDryGoods, + PlumbingHeatingEquipmentAndSupplies, + PoliticalOrganizations, + PostalServicesGovernmentOnly, + PreciousStonesAndMetalsWatchesAndJewelry, + ProfessionalServices, + PublicWarehousingAndStorage, + QuickCopyReproAndBlueprint, + Railroads, + RealEstateAgentsAndManagersRentals, + RecordStores, + RecreationalVehicleRentals, + ReligiousGoodsStores, + ReligiousOrganizations, + RoofingSidingSheetMetal, + SecretarialSupportServices, + SecurityBrokersDealers, + ServiceStations, + SewingNeedleworkFabricAndPieceGoodsStores, + ShoeRepairHatCleaning, + ShoeStores, + SmallApplianceRepair, + SnowmobileDealers, + SpecialTradeServices, + SpecialtyCleaning, + SportingGoodsStores, + SportingRecreationCamps, + SportsAndRidingApparelStores, + SportsClubsFields, + StampAndCoinStores, + StationaryOfficeSuppliesPrintingAndWritingPaper, + StationeryStoresOfficeAndSchoolSupplyStores, + SwimmingPoolsSales, + TUiTravelGermany, + TailorsAlterations, + TaxPaymentsGovernmentAgencies, + TaxPreparationServices, + TaxicabsLimousines, + TelecommunicationEquipmentAndTelephoneSales, + TelecommunicationServices, + TelegraphServices, + TentAndAwningShops, + TestingLaboratories, + TheatricalTicketAgencies, + Timeshares, + TireRetreadingAndRepair, + TollsBridgeFees, + TouristAttractionsAndExhibits, + TowingServices, + TrailerParksCampgrounds, + TransportationServices, + TravelAgenciesTourOperators, + TruckStopIteration, + TruckUtilityTrailerRentals, + TypesettingPlateMakingAndRelatedServices, + TypewriterStores, + USFederalGovernmentAgenciesOrDepartments, + UniformsCommercialClothing, + UsedMerchandiseAndSecondhandStores, + Utilities, + VarietyStores, + VeterinaryServices, + VideoAmusementGameSupplies, + VideoGameArcades, + VideoTapeRentalStores, + VocationalTradeSchools, + WatchJewelryRepair, + WeldingRepair, + WholesaleClubs, + WigAndToupeeStores, + WiresMoneyOrders, + WomensAccessoryAndSpecialtyShops, + WomensReadyToWearStores, + WreckingAndSalvageYards, + /// An unrecognized value from Stripe. Should not be used as a request parameter. + Unknown, +} +impl UpdateIssuingCardholderSpendingControlsAllowedCategories { + pub fn as_str(self) -> &'static str { + use UpdateIssuingCardholderSpendingControlsAllowedCategories::*; + match self { + AcRefrigerationRepair => "ac_refrigeration_repair", + AccountingBookkeepingServices => "accounting_bookkeeping_services", + AdvertisingServices => "advertising_services", + AgriculturalCooperative => "agricultural_cooperative", + AirlinesAirCarriers => "airlines_air_carriers", + AirportsFlyingFields => "airports_flying_fields", + AmbulanceServices => "ambulance_services", + AmusementParksCarnivals => "amusement_parks_carnivals", + AntiqueReproductions => "antique_reproductions", + AntiqueShops => "antique_shops", + Aquariums => "aquariums", + ArchitecturalSurveyingServices => "architectural_surveying_services", + ArtDealersAndGalleries => "art_dealers_and_galleries", + ArtistsSupplyAndCraftShops => "artists_supply_and_craft_shops", + AutoAndHomeSupplyStores => "auto_and_home_supply_stores", + AutoBodyRepairShops => "auto_body_repair_shops", + AutoPaintShops => "auto_paint_shops", + AutoServiceShops => "auto_service_shops", + AutomatedCashDisburse => "automated_cash_disburse", + AutomatedFuelDispensers => "automated_fuel_dispensers", + AutomobileAssociations => "automobile_associations", + AutomotivePartsAndAccessoriesStores => "automotive_parts_and_accessories_stores", + AutomotiveTireStores => "automotive_tire_stores", + BailAndBondPayments => "bail_and_bond_payments", + Bakeries => "bakeries", + BandsOrchestras => "bands_orchestras", + BarberAndBeautyShops => "barber_and_beauty_shops", + BettingCasinoGambling => "betting_casino_gambling", + BicycleShops => "bicycle_shops", + BilliardPoolEstablishments => "billiard_pool_establishments", + BoatDealers => "boat_dealers", + BoatRentalsAndLeases => "boat_rentals_and_leases", + BookStores => "book_stores", + BooksPeriodicalsAndNewspapers => "books_periodicals_and_newspapers", + BowlingAlleys => "bowling_alleys", + BusLines => "bus_lines", + BusinessSecretarialSchools => "business_secretarial_schools", + BuyingShoppingServices => "buying_shopping_services", + CableSatelliteAndOtherPayTelevisionAndRadio => { + "cable_satellite_and_other_pay_television_and_radio" + } + CameraAndPhotographicSupplyStores => "camera_and_photographic_supply_stores", + CandyNutAndConfectioneryStores => "candy_nut_and_confectionery_stores", + CarAndTruckDealersNewUsed => "car_and_truck_dealers_new_used", + CarAndTruckDealersUsedOnly => "car_and_truck_dealers_used_only", + CarRentalAgencies => "car_rental_agencies", + CarWashes => "car_washes", + CarpentryServices => "carpentry_services", + CarpetUpholsteryCleaning => "carpet_upholstery_cleaning", + Caterers => "caterers", + CharitableAndSocialServiceOrganizationsFundraising => { + "charitable_and_social_service_organizations_fundraising" + } + ChemicalsAndAlliedProducts => "chemicals_and_allied_products", + ChildCareServices => "child_care_services", + ChildrensAndInfantsWearStores => "childrens_and_infants_wear_stores", + ChiropodistsPodiatrists => "chiropodists_podiatrists", + Chiropractors => "chiropractors", + CigarStoresAndStands => "cigar_stores_and_stands", + CivicSocialFraternalAssociations => "civic_social_fraternal_associations", + CleaningAndMaintenance => "cleaning_and_maintenance", + ClothingRental => "clothing_rental", + CollegesUniversities => "colleges_universities", + CommercialEquipment => "commercial_equipment", + CommercialFootwear => "commercial_footwear", + CommercialPhotographyArtAndGraphics => "commercial_photography_art_and_graphics", + CommuterTransportAndFerries => "commuter_transport_and_ferries", + ComputerNetworkServices => "computer_network_services", + ComputerProgramming => "computer_programming", + ComputerRepair => "computer_repair", + ComputerSoftwareStores => "computer_software_stores", + ComputersPeripheralsAndSoftware => "computers_peripherals_and_software", + ConcreteWorkServices => "concrete_work_services", + ConstructionMaterials => "construction_materials", + ConsultingPublicRelations => "consulting_public_relations", + CorrespondenceSchools => "correspondence_schools", + CosmeticStores => "cosmetic_stores", + CounselingServices => "counseling_services", + CountryClubs => "country_clubs", + CourierServices => "courier_services", + CourtCosts => "court_costs", + CreditReportingAgencies => "credit_reporting_agencies", + CruiseLines => "cruise_lines", + DairyProductsStores => "dairy_products_stores", + DanceHallStudiosSchools => "dance_hall_studios_schools", + DatingEscortServices => "dating_escort_services", + DentistsOrthodontists => "dentists_orthodontists", + DepartmentStores => "department_stores", + DetectiveAgencies => "detective_agencies", + DigitalGoodsApplications => "digital_goods_applications", + DigitalGoodsGames => "digital_goods_games", + DigitalGoodsLargeVolume => "digital_goods_large_volume", + DigitalGoodsMedia => "digital_goods_media", + DirectMarketingCatalogMerchant => "direct_marketing_catalog_merchant", + DirectMarketingCombinationCatalogAndRetailMerchant => { + "direct_marketing_combination_catalog_and_retail_merchant" + } + DirectMarketingInboundTelemarketing => "direct_marketing_inbound_telemarketing", + DirectMarketingInsuranceServices => "direct_marketing_insurance_services", + DirectMarketingOther => "direct_marketing_other", + DirectMarketingOutboundTelemarketing => "direct_marketing_outbound_telemarketing", + DirectMarketingSubscription => "direct_marketing_subscription", + DirectMarketingTravel => "direct_marketing_travel", + DiscountStores => "discount_stores", + Doctors => "doctors", + DoorToDoorSales => "door_to_door_sales", + DraperyWindowCoveringAndUpholsteryStores => { + "drapery_window_covering_and_upholstery_stores" + } + DrinkingPlaces => "drinking_places", + DrugStoresAndPharmacies => "drug_stores_and_pharmacies", + DrugsDrugProprietariesAndDruggistSundries => { + "drugs_drug_proprietaries_and_druggist_sundries" + } + DryCleaners => "dry_cleaners", + DurableGoods => "durable_goods", + DutyFreeStores => "duty_free_stores", + EatingPlacesRestaurants => "eating_places_restaurants", + EducationalServices => "educational_services", + ElectricRazorStores => "electric_razor_stores", + ElectricVehicleCharging => "electric_vehicle_charging", + ElectricalPartsAndEquipment => "electrical_parts_and_equipment", + ElectricalServices => "electrical_services", + ElectronicsRepairShops => "electronics_repair_shops", + ElectronicsStores => "electronics_stores", + ElementarySecondarySchools => "elementary_secondary_schools", + EmergencyServicesGcasVisaUseOnly => "emergency_services_gcas_visa_use_only", + EmploymentTempAgencies => "employment_temp_agencies", + EquipmentRental => "equipment_rental", + ExterminatingServices => "exterminating_services", + FamilyClothingStores => "family_clothing_stores", + FastFoodRestaurants => "fast_food_restaurants", + FinancialInstitutions => "financial_institutions", + FinesGovernmentAdministrativeEntities => "fines_government_administrative_entities", + FireplaceFireplaceScreensAndAccessoriesStores => { + "fireplace_fireplace_screens_and_accessories_stores" + } + FloorCoveringStores => "floor_covering_stores", + Florists => "florists", + FloristsSuppliesNurseryStockAndFlowers => "florists_supplies_nursery_stock_and_flowers", + FreezerAndLockerMeatProvisioners => "freezer_and_locker_meat_provisioners", + FuelDealersNonAutomotive => "fuel_dealers_non_automotive", + FuneralServicesCrematories => "funeral_services_crematories", + FurnitureHomeFurnishingsAndEquipmentStoresExceptAppliances => { + "furniture_home_furnishings_and_equipment_stores_except_appliances" + } + FurnitureRepairRefinishing => "furniture_repair_refinishing", + FurriersAndFurShops => "furriers_and_fur_shops", + GeneralServices => "general_services", + GiftCardNoveltyAndSouvenirShops => "gift_card_novelty_and_souvenir_shops", + GlassPaintAndWallpaperStores => "glass_paint_and_wallpaper_stores", + GlasswareCrystalStores => "glassware_crystal_stores", + GolfCoursesPublic => "golf_courses_public", + GovernmentLicensedHorseDogRacingUsRegionOnly => { + "government_licensed_horse_dog_racing_us_region_only" + } + GovernmentLicensedOnlineCasionsOnlineGamblingUsRegionOnly => { + "government_licensed_online_casions_online_gambling_us_region_only" + } + GovernmentOwnedLotteriesNonUsRegion => "government_owned_lotteries_non_us_region", + GovernmentOwnedLotteriesUsRegionOnly => "government_owned_lotteries_us_region_only", + GovernmentServices => "government_services", + GroceryStoresSupermarkets => "grocery_stores_supermarkets", + HardwareEquipmentAndSupplies => "hardware_equipment_and_supplies", + HardwareStores => "hardware_stores", + HealthAndBeautySpas => "health_and_beauty_spas", + HearingAidsSalesAndSupplies => "hearing_aids_sales_and_supplies", + HeatingPlumbingAC => "heating_plumbing_a_c", + HobbyToyAndGameShops => "hobby_toy_and_game_shops", + HomeSupplyWarehouseStores => "home_supply_warehouse_stores", + Hospitals => "hospitals", + HotelsMotelsAndResorts => "hotels_motels_and_resorts", + HouseholdApplianceStores => "household_appliance_stores", + IndustrialSupplies => "industrial_supplies", + InformationRetrievalServices => "information_retrieval_services", + InsuranceDefault => "insurance_default", + InsuranceUnderwritingPremiums => "insurance_underwriting_premiums", + IntraCompanyPurchases => "intra_company_purchases", + JewelryStoresWatchesClocksAndSilverwareStores => { + "jewelry_stores_watches_clocks_and_silverware_stores" + } + LandscapingServices => "landscaping_services", + Laundries => "laundries", + LaundryCleaningServices => "laundry_cleaning_services", + LegalServicesAttorneys => "legal_services_attorneys", + LuggageAndLeatherGoodsStores => "luggage_and_leather_goods_stores", + LumberBuildingMaterialsStores => "lumber_building_materials_stores", + ManualCashDisburse => "manual_cash_disburse", + MarinasServiceAndSupplies => "marinas_service_and_supplies", + Marketplaces => "marketplaces", + MasonryStoneworkAndPlaster => "masonry_stonework_and_plaster", + MassageParlors => "massage_parlors", + MedicalAndDentalLabs => "medical_and_dental_labs", + MedicalDentalOphthalmicAndHospitalEquipmentAndSupplies => { + "medical_dental_ophthalmic_and_hospital_equipment_and_supplies" + } + MedicalServices => "medical_services", + MembershipOrganizations => "membership_organizations", + MensAndBoysClothingAndAccessoriesStores => { + "mens_and_boys_clothing_and_accessories_stores" + } + MensWomensClothingStores => "mens_womens_clothing_stores", + MetalServiceCenters => "metal_service_centers", + Miscellaneous => "miscellaneous", + MiscellaneousApparelAndAccessoryShops => "miscellaneous_apparel_and_accessory_shops", + MiscellaneousAutoDealers => "miscellaneous_auto_dealers", + MiscellaneousBusinessServices => "miscellaneous_business_services", + MiscellaneousFoodStores => "miscellaneous_food_stores", + MiscellaneousGeneralMerchandise => "miscellaneous_general_merchandise", + MiscellaneousGeneralServices => "miscellaneous_general_services", + MiscellaneousHomeFurnishingSpecialtyStores => { + "miscellaneous_home_furnishing_specialty_stores" + } + MiscellaneousPublishingAndPrinting => "miscellaneous_publishing_and_printing", + MiscellaneousRecreationServices => "miscellaneous_recreation_services", + MiscellaneousRepairShops => "miscellaneous_repair_shops", + MiscellaneousSpecialtyRetail => "miscellaneous_specialty_retail", + MobileHomeDealers => "mobile_home_dealers", + MotionPictureTheaters => "motion_picture_theaters", + MotorFreightCarriersAndTrucking => "motor_freight_carriers_and_trucking", + MotorHomesDealers => "motor_homes_dealers", + MotorVehicleSuppliesAndNewParts => "motor_vehicle_supplies_and_new_parts", + MotorcycleShopsAndDealers => "motorcycle_shops_and_dealers", + MotorcycleShopsDealers => "motorcycle_shops_dealers", + MusicStoresMusicalInstrumentsPianosAndSheetMusic => { + "music_stores_musical_instruments_pianos_and_sheet_music" + } + NewsDealersAndNewsstands => "news_dealers_and_newsstands", + NonFiMoneyOrders => "non_fi_money_orders", + NonFiStoredValueCardPurchaseLoad => "non_fi_stored_value_card_purchase_load", + NondurableGoods => "nondurable_goods", + NurseriesLawnAndGardenSupplyStores => "nurseries_lawn_and_garden_supply_stores", + NursingPersonalCare => "nursing_personal_care", + OfficeAndCommercialFurniture => "office_and_commercial_furniture", + OpticiansEyeglasses => "opticians_eyeglasses", + OptometristsOphthalmologist => "optometrists_ophthalmologist", + OrthopedicGoodsProstheticDevices => "orthopedic_goods_prosthetic_devices", + Osteopaths => "osteopaths", + PackageStoresBeerWineAndLiquor => "package_stores_beer_wine_and_liquor", + PaintsVarnishesAndSupplies => "paints_varnishes_and_supplies", + ParkingLotsGarages => "parking_lots_garages", + PassengerRailways => "passenger_railways", + PawnShops => "pawn_shops", + PetShopsPetFoodAndSupplies => "pet_shops_pet_food_and_supplies", + PetroleumAndPetroleumProducts => "petroleum_and_petroleum_products", + PhotoDeveloping => "photo_developing", + PhotographicPhotocopyMicrofilmEquipmentAndSupplies => { + "photographic_photocopy_microfilm_equipment_and_supplies" + } + PhotographicStudios => "photographic_studios", + PictureVideoProduction => "picture_video_production", + PieceGoodsNotionsAndOtherDryGoods => "piece_goods_notions_and_other_dry_goods", + PlumbingHeatingEquipmentAndSupplies => "plumbing_heating_equipment_and_supplies", + PoliticalOrganizations => "political_organizations", + PostalServicesGovernmentOnly => "postal_services_government_only", + PreciousStonesAndMetalsWatchesAndJewelry => { + "precious_stones_and_metals_watches_and_jewelry" + } + ProfessionalServices => "professional_services", + PublicWarehousingAndStorage => "public_warehousing_and_storage", + QuickCopyReproAndBlueprint => "quick_copy_repro_and_blueprint", + Railroads => "railroads", + RealEstateAgentsAndManagersRentals => "real_estate_agents_and_managers_rentals", + RecordStores => "record_stores", + RecreationalVehicleRentals => "recreational_vehicle_rentals", + ReligiousGoodsStores => "religious_goods_stores", + ReligiousOrganizations => "religious_organizations", + RoofingSidingSheetMetal => "roofing_siding_sheet_metal", + SecretarialSupportServices => "secretarial_support_services", + SecurityBrokersDealers => "security_brokers_dealers", + ServiceStations => "service_stations", + SewingNeedleworkFabricAndPieceGoodsStores => { + "sewing_needlework_fabric_and_piece_goods_stores" + } + ShoeRepairHatCleaning => "shoe_repair_hat_cleaning", + ShoeStores => "shoe_stores", + SmallApplianceRepair => "small_appliance_repair", + SnowmobileDealers => "snowmobile_dealers", + SpecialTradeServices => "special_trade_services", + SpecialtyCleaning => "specialty_cleaning", + SportingGoodsStores => "sporting_goods_stores", + SportingRecreationCamps => "sporting_recreation_camps", + SportsAndRidingApparelStores => "sports_and_riding_apparel_stores", + SportsClubsFields => "sports_clubs_fields", + StampAndCoinStores => "stamp_and_coin_stores", + StationaryOfficeSuppliesPrintingAndWritingPaper => { + "stationary_office_supplies_printing_and_writing_paper" + } + StationeryStoresOfficeAndSchoolSupplyStores => { + "stationery_stores_office_and_school_supply_stores" + } + SwimmingPoolsSales => "swimming_pools_sales", + TUiTravelGermany => "t_ui_travel_germany", + TailorsAlterations => "tailors_alterations", + TaxPaymentsGovernmentAgencies => "tax_payments_government_agencies", + TaxPreparationServices => "tax_preparation_services", + TaxicabsLimousines => "taxicabs_limousines", + TelecommunicationEquipmentAndTelephoneSales => { + "telecommunication_equipment_and_telephone_sales" + } + TelecommunicationServices => "telecommunication_services", + TelegraphServices => "telegraph_services", + TentAndAwningShops => "tent_and_awning_shops", + TestingLaboratories => "testing_laboratories", + TheatricalTicketAgencies => "theatrical_ticket_agencies", + Timeshares => "timeshares", + TireRetreadingAndRepair => "tire_retreading_and_repair", + TollsBridgeFees => "tolls_bridge_fees", + TouristAttractionsAndExhibits => "tourist_attractions_and_exhibits", + TowingServices => "towing_services", + TrailerParksCampgrounds => "trailer_parks_campgrounds", + TransportationServices => "transportation_services", + TravelAgenciesTourOperators => "travel_agencies_tour_operators", + TruckStopIteration => "truck_stop_iteration", + TruckUtilityTrailerRentals => "truck_utility_trailer_rentals", + TypesettingPlateMakingAndRelatedServices => { + "typesetting_plate_making_and_related_services" + } + TypewriterStores => "typewriter_stores", + USFederalGovernmentAgenciesOrDepartments => { + "u_s_federal_government_agencies_or_departments" + } + UniformsCommercialClothing => "uniforms_commercial_clothing", + UsedMerchandiseAndSecondhandStores => "used_merchandise_and_secondhand_stores", + Utilities => "utilities", + VarietyStores => "variety_stores", + VeterinaryServices => "veterinary_services", + VideoAmusementGameSupplies => "video_amusement_game_supplies", + VideoGameArcades => "video_game_arcades", + VideoTapeRentalStores => "video_tape_rental_stores", + VocationalTradeSchools => "vocational_trade_schools", + WatchJewelryRepair => "watch_jewelry_repair", + WeldingRepair => "welding_repair", + WholesaleClubs => "wholesale_clubs", + WigAndToupeeStores => "wig_and_toupee_stores", + WiresMoneyOrders => "wires_money_orders", + WomensAccessoryAndSpecialtyShops => "womens_accessory_and_specialty_shops", + WomensReadyToWearStores => "womens_ready_to_wear_stores", + WreckingAndSalvageYards => "wrecking_and_salvage_yards", + Unknown => "unknown", + } + } +} + +impl std::str::FromStr for UpdateIssuingCardholderSpendingControlsAllowedCategories { + type Err = (); + fn from_str(s: &str) -> Result { + use UpdateIssuingCardholderSpendingControlsAllowedCategories::*; + match s { + "ac_refrigeration_repair" => Ok(AcRefrigerationRepair), + "accounting_bookkeeping_services" => Ok(AccountingBookkeepingServices), + "advertising_services" => Ok(AdvertisingServices), + "agricultural_cooperative" => Ok(AgriculturalCooperative), + "airlines_air_carriers" => Ok(AirlinesAirCarriers), + "airports_flying_fields" => Ok(AirportsFlyingFields), + "ambulance_services" => Ok(AmbulanceServices), + "amusement_parks_carnivals" => Ok(AmusementParksCarnivals), + "antique_reproductions" => Ok(AntiqueReproductions), + "antique_shops" => Ok(AntiqueShops), + "aquariums" => Ok(Aquariums), + "architectural_surveying_services" => Ok(ArchitecturalSurveyingServices), + "art_dealers_and_galleries" => Ok(ArtDealersAndGalleries), + "artists_supply_and_craft_shops" => Ok(ArtistsSupplyAndCraftShops), + "auto_and_home_supply_stores" => Ok(AutoAndHomeSupplyStores), + "auto_body_repair_shops" => Ok(AutoBodyRepairShops), + "auto_paint_shops" => Ok(AutoPaintShops), + "auto_service_shops" => Ok(AutoServiceShops), + "automated_cash_disburse" => Ok(AutomatedCashDisburse), + "automated_fuel_dispensers" => Ok(AutomatedFuelDispensers), + "automobile_associations" => Ok(AutomobileAssociations), + "automotive_parts_and_accessories_stores" => Ok(AutomotivePartsAndAccessoriesStores), + "automotive_tire_stores" => Ok(AutomotiveTireStores), + "bail_and_bond_payments" => Ok(BailAndBondPayments), + "bakeries" => Ok(Bakeries), + "bands_orchestras" => Ok(BandsOrchestras), + "barber_and_beauty_shops" => Ok(BarberAndBeautyShops), + "betting_casino_gambling" => Ok(BettingCasinoGambling), + "bicycle_shops" => Ok(BicycleShops), + "billiard_pool_establishments" => Ok(BilliardPoolEstablishments), + "boat_dealers" => Ok(BoatDealers), + "boat_rentals_and_leases" => Ok(BoatRentalsAndLeases), + "book_stores" => Ok(BookStores), + "books_periodicals_and_newspapers" => Ok(BooksPeriodicalsAndNewspapers), + "bowling_alleys" => Ok(BowlingAlleys), + "bus_lines" => Ok(BusLines), + "business_secretarial_schools" => Ok(BusinessSecretarialSchools), + "buying_shopping_services" => Ok(BuyingShoppingServices), + "cable_satellite_and_other_pay_television_and_radio" => { + Ok(CableSatelliteAndOtherPayTelevisionAndRadio) + } + "camera_and_photographic_supply_stores" => Ok(CameraAndPhotographicSupplyStores), + "candy_nut_and_confectionery_stores" => Ok(CandyNutAndConfectioneryStores), + "car_and_truck_dealers_new_used" => Ok(CarAndTruckDealersNewUsed), + "car_and_truck_dealers_used_only" => Ok(CarAndTruckDealersUsedOnly), + "car_rental_agencies" => Ok(CarRentalAgencies), + "car_washes" => Ok(CarWashes), + "carpentry_services" => Ok(CarpentryServices), + "carpet_upholstery_cleaning" => Ok(CarpetUpholsteryCleaning), + "caterers" => Ok(Caterers), + "charitable_and_social_service_organizations_fundraising" => { + Ok(CharitableAndSocialServiceOrganizationsFundraising) + } + "chemicals_and_allied_products" => Ok(ChemicalsAndAlliedProducts), + "child_care_services" => Ok(ChildCareServices), + "childrens_and_infants_wear_stores" => Ok(ChildrensAndInfantsWearStores), + "chiropodists_podiatrists" => Ok(ChiropodistsPodiatrists), + "chiropractors" => Ok(Chiropractors), + "cigar_stores_and_stands" => Ok(CigarStoresAndStands), + "civic_social_fraternal_associations" => Ok(CivicSocialFraternalAssociations), + "cleaning_and_maintenance" => Ok(CleaningAndMaintenance), + "clothing_rental" => Ok(ClothingRental), + "colleges_universities" => Ok(CollegesUniversities), + "commercial_equipment" => Ok(CommercialEquipment), + "commercial_footwear" => Ok(CommercialFootwear), + "commercial_photography_art_and_graphics" => Ok(CommercialPhotographyArtAndGraphics), + "commuter_transport_and_ferries" => Ok(CommuterTransportAndFerries), + "computer_network_services" => Ok(ComputerNetworkServices), + "computer_programming" => Ok(ComputerProgramming), + "computer_repair" => Ok(ComputerRepair), + "computer_software_stores" => Ok(ComputerSoftwareStores), + "computers_peripherals_and_software" => Ok(ComputersPeripheralsAndSoftware), + "concrete_work_services" => Ok(ConcreteWorkServices), + "construction_materials" => Ok(ConstructionMaterials), + "consulting_public_relations" => Ok(ConsultingPublicRelations), + "correspondence_schools" => Ok(CorrespondenceSchools), + "cosmetic_stores" => Ok(CosmeticStores), + "counseling_services" => Ok(CounselingServices), + "country_clubs" => Ok(CountryClubs), + "courier_services" => Ok(CourierServices), + "court_costs" => Ok(CourtCosts), + "credit_reporting_agencies" => Ok(CreditReportingAgencies), + "cruise_lines" => Ok(CruiseLines), + "dairy_products_stores" => Ok(DairyProductsStores), + "dance_hall_studios_schools" => Ok(DanceHallStudiosSchools), + "dating_escort_services" => Ok(DatingEscortServices), + "dentists_orthodontists" => Ok(DentistsOrthodontists), + "department_stores" => Ok(DepartmentStores), + "detective_agencies" => Ok(DetectiveAgencies), + "digital_goods_applications" => Ok(DigitalGoodsApplications), + "digital_goods_games" => Ok(DigitalGoodsGames), + "digital_goods_large_volume" => Ok(DigitalGoodsLargeVolume), + "digital_goods_media" => Ok(DigitalGoodsMedia), + "direct_marketing_catalog_merchant" => Ok(DirectMarketingCatalogMerchant), + "direct_marketing_combination_catalog_and_retail_merchant" => { + Ok(DirectMarketingCombinationCatalogAndRetailMerchant) + } + "direct_marketing_inbound_telemarketing" => Ok(DirectMarketingInboundTelemarketing), + "direct_marketing_insurance_services" => Ok(DirectMarketingInsuranceServices), + "direct_marketing_other" => Ok(DirectMarketingOther), + "direct_marketing_outbound_telemarketing" => Ok(DirectMarketingOutboundTelemarketing), + "direct_marketing_subscription" => Ok(DirectMarketingSubscription), + "direct_marketing_travel" => Ok(DirectMarketingTravel), + "discount_stores" => Ok(DiscountStores), + "doctors" => Ok(Doctors), + "door_to_door_sales" => Ok(DoorToDoorSales), + "drapery_window_covering_and_upholstery_stores" => { + Ok(DraperyWindowCoveringAndUpholsteryStores) + } + "drinking_places" => Ok(DrinkingPlaces), + "drug_stores_and_pharmacies" => Ok(DrugStoresAndPharmacies), + "drugs_drug_proprietaries_and_druggist_sundries" => { + Ok(DrugsDrugProprietariesAndDruggistSundries) + } + "dry_cleaners" => Ok(DryCleaners), + "durable_goods" => Ok(DurableGoods), + "duty_free_stores" => Ok(DutyFreeStores), + "eating_places_restaurants" => Ok(EatingPlacesRestaurants), + "educational_services" => Ok(EducationalServices), + "electric_razor_stores" => Ok(ElectricRazorStores), + "electric_vehicle_charging" => Ok(ElectricVehicleCharging), + "electrical_parts_and_equipment" => Ok(ElectricalPartsAndEquipment), + "electrical_services" => Ok(ElectricalServices), + "electronics_repair_shops" => Ok(ElectronicsRepairShops), + "electronics_stores" => Ok(ElectronicsStores), + "elementary_secondary_schools" => Ok(ElementarySecondarySchools), + "emergency_services_gcas_visa_use_only" => Ok(EmergencyServicesGcasVisaUseOnly), + "employment_temp_agencies" => Ok(EmploymentTempAgencies), + "equipment_rental" => Ok(EquipmentRental), + "exterminating_services" => Ok(ExterminatingServices), + "family_clothing_stores" => Ok(FamilyClothingStores), + "fast_food_restaurants" => Ok(FastFoodRestaurants), + "financial_institutions" => Ok(FinancialInstitutions), + "fines_government_administrative_entities" => Ok(FinesGovernmentAdministrativeEntities), + "fireplace_fireplace_screens_and_accessories_stores" => { + Ok(FireplaceFireplaceScreensAndAccessoriesStores) + } + "floor_covering_stores" => Ok(FloorCoveringStores), + "florists" => Ok(Florists), + "florists_supplies_nursery_stock_and_flowers" => { + Ok(FloristsSuppliesNurseryStockAndFlowers) + } + "freezer_and_locker_meat_provisioners" => Ok(FreezerAndLockerMeatProvisioners), + "fuel_dealers_non_automotive" => Ok(FuelDealersNonAutomotive), + "funeral_services_crematories" => Ok(FuneralServicesCrematories), + "furniture_home_furnishings_and_equipment_stores_except_appliances" => { + Ok(FurnitureHomeFurnishingsAndEquipmentStoresExceptAppliances) + } + "furniture_repair_refinishing" => Ok(FurnitureRepairRefinishing), + "furriers_and_fur_shops" => Ok(FurriersAndFurShops), + "general_services" => Ok(GeneralServices), + "gift_card_novelty_and_souvenir_shops" => Ok(GiftCardNoveltyAndSouvenirShops), + "glass_paint_and_wallpaper_stores" => Ok(GlassPaintAndWallpaperStores), + "glassware_crystal_stores" => Ok(GlasswareCrystalStores), + "golf_courses_public" => Ok(GolfCoursesPublic), + "government_licensed_horse_dog_racing_us_region_only" => { + Ok(GovernmentLicensedHorseDogRacingUsRegionOnly) + } + "government_licensed_online_casions_online_gambling_us_region_only" => { + Ok(GovernmentLicensedOnlineCasionsOnlineGamblingUsRegionOnly) + } + "government_owned_lotteries_non_us_region" => Ok(GovernmentOwnedLotteriesNonUsRegion), + "government_owned_lotteries_us_region_only" => Ok(GovernmentOwnedLotteriesUsRegionOnly), + "government_services" => Ok(GovernmentServices), + "grocery_stores_supermarkets" => Ok(GroceryStoresSupermarkets), + "hardware_equipment_and_supplies" => Ok(HardwareEquipmentAndSupplies), + "hardware_stores" => Ok(HardwareStores), + "health_and_beauty_spas" => Ok(HealthAndBeautySpas), + "hearing_aids_sales_and_supplies" => Ok(HearingAidsSalesAndSupplies), + "heating_plumbing_a_c" => Ok(HeatingPlumbingAC), + "hobby_toy_and_game_shops" => Ok(HobbyToyAndGameShops), + "home_supply_warehouse_stores" => Ok(HomeSupplyWarehouseStores), + "hospitals" => Ok(Hospitals), + "hotels_motels_and_resorts" => Ok(HotelsMotelsAndResorts), + "household_appliance_stores" => Ok(HouseholdApplianceStores), + "industrial_supplies" => Ok(IndustrialSupplies), + "information_retrieval_services" => Ok(InformationRetrievalServices), + "insurance_default" => Ok(InsuranceDefault), + "insurance_underwriting_premiums" => Ok(InsuranceUnderwritingPremiums), + "intra_company_purchases" => Ok(IntraCompanyPurchases), + "jewelry_stores_watches_clocks_and_silverware_stores" => { + Ok(JewelryStoresWatchesClocksAndSilverwareStores) + } + "landscaping_services" => Ok(LandscapingServices), + "laundries" => Ok(Laundries), + "laundry_cleaning_services" => Ok(LaundryCleaningServices), + "legal_services_attorneys" => Ok(LegalServicesAttorneys), + "luggage_and_leather_goods_stores" => Ok(LuggageAndLeatherGoodsStores), + "lumber_building_materials_stores" => Ok(LumberBuildingMaterialsStores), + "manual_cash_disburse" => Ok(ManualCashDisburse), + "marinas_service_and_supplies" => Ok(MarinasServiceAndSupplies), + "marketplaces" => Ok(Marketplaces), + "masonry_stonework_and_plaster" => Ok(MasonryStoneworkAndPlaster), + "massage_parlors" => Ok(MassageParlors), + "medical_and_dental_labs" => Ok(MedicalAndDentalLabs), + "medical_dental_ophthalmic_and_hospital_equipment_and_supplies" => { + Ok(MedicalDentalOphthalmicAndHospitalEquipmentAndSupplies) + } + "medical_services" => Ok(MedicalServices), + "membership_organizations" => Ok(MembershipOrganizations), + "mens_and_boys_clothing_and_accessories_stores" => { + Ok(MensAndBoysClothingAndAccessoriesStores) + } + "mens_womens_clothing_stores" => Ok(MensWomensClothingStores), + "metal_service_centers" => Ok(MetalServiceCenters), + "miscellaneous" => Ok(Miscellaneous), + "miscellaneous_apparel_and_accessory_shops" => { + Ok(MiscellaneousApparelAndAccessoryShops) + } + "miscellaneous_auto_dealers" => Ok(MiscellaneousAutoDealers), + "miscellaneous_business_services" => Ok(MiscellaneousBusinessServices), + "miscellaneous_food_stores" => Ok(MiscellaneousFoodStores), + "miscellaneous_general_merchandise" => Ok(MiscellaneousGeneralMerchandise), + "miscellaneous_general_services" => Ok(MiscellaneousGeneralServices), + "miscellaneous_home_furnishing_specialty_stores" => { + Ok(MiscellaneousHomeFurnishingSpecialtyStores) + } + "miscellaneous_publishing_and_printing" => Ok(MiscellaneousPublishingAndPrinting), + "miscellaneous_recreation_services" => Ok(MiscellaneousRecreationServices), + "miscellaneous_repair_shops" => Ok(MiscellaneousRepairShops), + "miscellaneous_specialty_retail" => Ok(MiscellaneousSpecialtyRetail), + "mobile_home_dealers" => Ok(MobileHomeDealers), + "motion_picture_theaters" => Ok(MotionPictureTheaters), + "motor_freight_carriers_and_trucking" => Ok(MotorFreightCarriersAndTrucking), + "motor_homes_dealers" => Ok(MotorHomesDealers), + "motor_vehicle_supplies_and_new_parts" => Ok(MotorVehicleSuppliesAndNewParts), + "motorcycle_shops_and_dealers" => Ok(MotorcycleShopsAndDealers), + "motorcycle_shops_dealers" => Ok(MotorcycleShopsDealers), + "music_stores_musical_instruments_pianos_and_sheet_music" => { + Ok(MusicStoresMusicalInstrumentsPianosAndSheetMusic) + } + "news_dealers_and_newsstands" => Ok(NewsDealersAndNewsstands), + "non_fi_money_orders" => Ok(NonFiMoneyOrders), + "non_fi_stored_value_card_purchase_load" => Ok(NonFiStoredValueCardPurchaseLoad), + "nondurable_goods" => Ok(NondurableGoods), + "nurseries_lawn_and_garden_supply_stores" => Ok(NurseriesLawnAndGardenSupplyStores), + "nursing_personal_care" => Ok(NursingPersonalCare), + "office_and_commercial_furniture" => Ok(OfficeAndCommercialFurniture), + "opticians_eyeglasses" => Ok(OpticiansEyeglasses), + "optometrists_ophthalmologist" => Ok(OptometristsOphthalmologist), + "orthopedic_goods_prosthetic_devices" => Ok(OrthopedicGoodsProstheticDevices), + "osteopaths" => Ok(Osteopaths), + "package_stores_beer_wine_and_liquor" => Ok(PackageStoresBeerWineAndLiquor), + "paints_varnishes_and_supplies" => Ok(PaintsVarnishesAndSupplies), + "parking_lots_garages" => Ok(ParkingLotsGarages), + "passenger_railways" => Ok(PassengerRailways), + "pawn_shops" => Ok(PawnShops), + "pet_shops_pet_food_and_supplies" => Ok(PetShopsPetFoodAndSupplies), + "petroleum_and_petroleum_products" => Ok(PetroleumAndPetroleumProducts), + "photo_developing" => Ok(PhotoDeveloping), + "photographic_photocopy_microfilm_equipment_and_supplies" => { + Ok(PhotographicPhotocopyMicrofilmEquipmentAndSupplies) + } + "photographic_studios" => Ok(PhotographicStudios), + "picture_video_production" => Ok(PictureVideoProduction), + "piece_goods_notions_and_other_dry_goods" => Ok(PieceGoodsNotionsAndOtherDryGoods), + "plumbing_heating_equipment_and_supplies" => Ok(PlumbingHeatingEquipmentAndSupplies), + "political_organizations" => Ok(PoliticalOrganizations), + "postal_services_government_only" => Ok(PostalServicesGovernmentOnly), + "precious_stones_and_metals_watches_and_jewelry" => { + Ok(PreciousStonesAndMetalsWatchesAndJewelry) + } + "professional_services" => Ok(ProfessionalServices), + "public_warehousing_and_storage" => Ok(PublicWarehousingAndStorage), + "quick_copy_repro_and_blueprint" => Ok(QuickCopyReproAndBlueprint), + "railroads" => Ok(Railroads), + "real_estate_agents_and_managers_rentals" => Ok(RealEstateAgentsAndManagersRentals), + "record_stores" => Ok(RecordStores), + "recreational_vehicle_rentals" => Ok(RecreationalVehicleRentals), + "religious_goods_stores" => Ok(ReligiousGoodsStores), + "religious_organizations" => Ok(ReligiousOrganizations), + "roofing_siding_sheet_metal" => Ok(RoofingSidingSheetMetal), + "secretarial_support_services" => Ok(SecretarialSupportServices), + "security_brokers_dealers" => Ok(SecurityBrokersDealers), + "service_stations" => Ok(ServiceStations), + "sewing_needlework_fabric_and_piece_goods_stores" => { + Ok(SewingNeedleworkFabricAndPieceGoodsStores) + } + "shoe_repair_hat_cleaning" => Ok(ShoeRepairHatCleaning), + "shoe_stores" => Ok(ShoeStores), + "small_appliance_repair" => Ok(SmallApplianceRepair), + "snowmobile_dealers" => Ok(SnowmobileDealers), + "special_trade_services" => Ok(SpecialTradeServices), + "specialty_cleaning" => Ok(SpecialtyCleaning), + "sporting_goods_stores" => Ok(SportingGoodsStores), + "sporting_recreation_camps" => Ok(SportingRecreationCamps), + "sports_and_riding_apparel_stores" => Ok(SportsAndRidingApparelStores), + "sports_clubs_fields" => Ok(SportsClubsFields), + "stamp_and_coin_stores" => Ok(StampAndCoinStores), + "stationary_office_supplies_printing_and_writing_paper" => { + Ok(StationaryOfficeSuppliesPrintingAndWritingPaper) + } + "stationery_stores_office_and_school_supply_stores" => { + Ok(StationeryStoresOfficeAndSchoolSupplyStores) + } + "swimming_pools_sales" => Ok(SwimmingPoolsSales), + "t_ui_travel_germany" => Ok(TUiTravelGermany), + "tailors_alterations" => Ok(TailorsAlterations), + "tax_payments_government_agencies" => Ok(TaxPaymentsGovernmentAgencies), + "tax_preparation_services" => Ok(TaxPreparationServices), + "taxicabs_limousines" => Ok(TaxicabsLimousines), + "telecommunication_equipment_and_telephone_sales" => { + Ok(TelecommunicationEquipmentAndTelephoneSales) + } + "telecommunication_services" => Ok(TelecommunicationServices), + "telegraph_services" => Ok(TelegraphServices), + "tent_and_awning_shops" => Ok(TentAndAwningShops), + "testing_laboratories" => Ok(TestingLaboratories), + "theatrical_ticket_agencies" => Ok(TheatricalTicketAgencies), + "timeshares" => Ok(Timeshares), + "tire_retreading_and_repair" => Ok(TireRetreadingAndRepair), + "tolls_bridge_fees" => Ok(TollsBridgeFees), + "tourist_attractions_and_exhibits" => Ok(TouristAttractionsAndExhibits), + "towing_services" => Ok(TowingServices), + "trailer_parks_campgrounds" => Ok(TrailerParksCampgrounds), + "transportation_services" => Ok(TransportationServices), + "travel_agencies_tour_operators" => Ok(TravelAgenciesTourOperators), + "truck_stop_iteration" => Ok(TruckStopIteration), + "truck_utility_trailer_rentals" => Ok(TruckUtilityTrailerRentals), + "typesetting_plate_making_and_related_services" => { + Ok(TypesettingPlateMakingAndRelatedServices) + } + "typewriter_stores" => Ok(TypewriterStores), + "u_s_federal_government_agencies_or_departments" => { + Ok(USFederalGovernmentAgenciesOrDepartments) + } + "uniforms_commercial_clothing" => Ok(UniformsCommercialClothing), + "used_merchandise_and_secondhand_stores" => Ok(UsedMerchandiseAndSecondhandStores), + "utilities" => Ok(Utilities), + "variety_stores" => Ok(VarietyStores), + "veterinary_services" => Ok(VeterinaryServices), + "video_amusement_game_supplies" => Ok(VideoAmusementGameSupplies), + "video_game_arcades" => Ok(VideoGameArcades), + "video_tape_rental_stores" => Ok(VideoTapeRentalStores), + "vocational_trade_schools" => Ok(VocationalTradeSchools), + "watch_jewelry_repair" => Ok(WatchJewelryRepair), + "welding_repair" => Ok(WeldingRepair), + "wholesale_clubs" => Ok(WholesaleClubs), + "wig_and_toupee_stores" => Ok(WigAndToupeeStores), + "wires_money_orders" => Ok(WiresMoneyOrders), + "womens_accessory_and_specialty_shops" => Ok(WomensAccessoryAndSpecialtyShops), + "womens_ready_to_wear_stores" => Ok(WomensReadyToWearStores), + "wrecking_and_salvage_yards" => Ok(WreckingAndSalvageYards), + _ => Err(()), + } + } +} +impl std::fmt::Display for UpdateIssuingCardholderSpendingControlsAllowedCategories { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for UpdateIssuingCardholderSpendingControlsAllowedCategories { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for UpdateIssuingCardholderSpendingControlsAllowedCategories { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Array of strings containing [categories](https://stripe.com/docs/api#issuing_authorization_object-merchant_data-category) of authorizations to decline. +/// All other categories will be allowed. +/// Cannot be set with `allowed_categories`. +#[derive(Copy, Clone, Eq, PartialEq)] +#[non_exhaustive] +pub enum UpdateIssuingCardholderSpendingControlsBlockedCategories { + AcRefrigerationRepair, + AccountingBookkeepingServices, + AdvertisingServices, + AgriculturalCooperative, + AirlinesAirCarriers, + AirportsFlyingFields, + AmbulanceServices, + AmusementParksCarnivals, + AntiqueReproductions, + AntiqueShops, + Aquariums, + ArchitecturalSurveyingServices, + ArtDealersAndGalleries, + ArtistsSupplyAndCraftShops, + AutoAndHomeSupplyStores, + AutoBodyRepairShops, + AutoPaintShops, + AutoServiceShops, + AutomatedCashDisburse, + AutomatedFuelDispensers, + AutomobileAssociations, + AutomotivePartsAndAccessoriesStores, + AutomotiveTireStores, + BailAndBondPayments, + Bakeries, + BandsOrchestras, + BarberAndBeautyShops, + BettingCasinoGambling, + BicycleShops, + BilliardPoolEstablishments, + BoatDealers, + BoatRentalsAndLeases, + BookStores, + BooksPeriodicalsAndNewspapers, + BowlingAlleys, + BusLines, + BusinessSecretarialSchools, + BuyingShoppingServices, + CableSatelliteAndOtherPayTelevisionAndRadio, + CameraAndPhotographicSupplyStores, + CandyNutAndConfectioneryStores, + CarAndTruckDealersNewUsed, + CarAndTruckDealersUsedOnly, + CarRentalAgencies, + CarWashes, + CarpentryServices, + CarpetUpholsteryCleaning, + Caterers, + CharitableAndSocialServiceOrganizationsFundraising, + ChemicalsAndAlliedProducts, + ChildCareServices, + ChildrensAndInfantsWearStores, + ChiropodistsPodiatrists, + Chiropractors, + CigarStoresAndStands, + CivicSocialFraternalAssociations, + CleaningAndMaintenance, + ClothingRental, + CollegesUniversities, + CommercialEquipment, + CommercialFootwear, + CommercialPhotographyArtAndGraphics, + CommuterTransportAndFerries, + ComputerNetworkServices, + ComputerProgramming, + ComputerRepair, + ComputerSoftwareStores, + ComputersPeripheralsAndSoftware, + ConcreteWorkServices, + ConstructionMaterials, + ConsultingPublicRelations, + CorrespondenceSchools, + CosmeticStores, + CounselingServices, + CountryClubs, + CourierServices, + CourtCosts, + CreditReportingAgencies, + CruiseLines, + DairyProductsStores, + DanceHallStudiosSchools, + DatingEscortServices, + DentistsOrthodontists, + DepartmentStores, + DetectiveAgencies, + DigitalGoodsApplications, + DigitalGoodsGames, + DigitalGoodsLargeVolume, + DigitalGoodsMedia, + DirectMarketingCatalogMerchant, + DirectMarketingCombinationCatalogAndRetailMerchant, + DirectMarketingInboundTelemarketing, + DirectMarketingInsuranceServices, + DirectMarketingOther, + DirectMarketingOutboundTelemarketing, + DirectMarketingSubscription, + DirectMarketingTravel, + DiscountStores, + Doctors, + DoorToDoorSales, + DraperyWindowCoveringAndUpholsteryStores, + DrinkingPlaces, + DrugStoresAndPharmacies, + DrugsDrugProprietariesAndDruggistSundries, + DryCleaners, + DurableGoods, + DutyFreeStores, + EatingPlacesRestaurants, + EducationalServices, + ElectricRazorStores, + ElectricVehicleCharging, + ElectricalPartsAndEquipment, + ElectricalServices, + ElectronicsRepairShops, + ElectronicsStores, + ElementarySecondarySchools, + EmergencyServicesGcasVisaUseOnly, + EmploymentTempAgencies, + EquipmentRental, + ExterminatingServices, + FamilyClothingStores, + FastFoodRestaurants, + FinancialInstitutions, + FinesGovernmentAdministrativeEntities, + FireplaceFireplaceScreensAndAccessoriesStores, + FloorCoveringStores, + Florists, + FloristsSuppliesNurseryStockAndFlowers, + FreezerAndLockerMeatProvisioners, + FuelDealersNonAutomotive, + FuneralServicesCrematories, + FurnitureHomeFurnishingsAndEquipmentStoresExceptAppliances, + FurnitureRepairRefinishing, + FurriersAndFurShops, + GeneralServices, + GiftCardNoveltyAndSouvenirShops, + GlassPaintAndWallpaperStores, + GlasswareCrystalStores, + GolfCoursesPublic, + GovernmentLicensedHorseDogRacingUsRegionOnly, + GovernmentLicensedOnlineCasionsOnlineGamblingUsRegionOnly, + GovernmentOwnedLotteriesNonUsRegion, + GovernmentOwnedLotteriesUsRegionOnly, + GovernmentServices, + GroceryStoresSupermarkets, + HardwareEquipmentAndSupplies, + HardwareStores, + HealthAndBeautySpas, + HearingAidsSalesAndSupplies, + HeatingPlumbingAC, + HobbyToyAndGameShops, + HomeSupplyWarehouseStores, + Hospitals, + HotelsMotelsAndResorts, + HouseholdApplianceStores, + IndustrialSupplies, + InformationRetrievalServices, + InsuranceDefault, + InsuranceUnderwritingPremiums, + IntraCompanyPurchases, + JewelryStoresWatchesClocksAndSilverwareStores, + LandscapingServices, + Laundries, + LaundryCleaningServices, + LegalServicesAttorneys, + LuggageAndLeatherGoodsStores, + LumberBuildingMaterialsStores, + ManualCashDisburse, + MarinasServiceAndSupplies, + Marketplaces, + MasonryStoneworkAndPlaster, + MassageParlors, + MedicalAndDentalLabs, + MedicalDentalOphthalmicAndHospitalEquipmentAndSupplies, + MedicalServices, + MembershipOrganizations, + MensAndBoysClothingAndAccessoriesStores, + MensWomensClothingStores, + MetalServiceCenters, + Miscellaneous, + MiscellaneousApparelAndAccessoryShops, + MiscellaneousAutoDealers, + MiscellaneousBusinessServices, + MiscellaneousFoodStores, + MiscellaneousGeneralMerchandise, + MiscellaneousGeneralServices, + MiscellaneousHomeFurnishingSpecialtyStores, + MiscellaneousPublishingAndPrinting, + MiscellaneousRecreationServices, + MiscellaneousRepairShops, + MiscellaneousSpecialtyRetail, + MobileHomeDealers, + MotionPictureTheaters, + MotorFreightCarriersAndTrucking, + MotorHomesDealers, + MotorVehicleSuppliesAndNewParts, + MotorcycleShopsAndDealers, + MotorcycleShopsDealers, + MusicStoresMusicalInstrumentsPianosAndSheetMusic, + NewsDealersAndNewsstands, + NonFiMoneyOrders, + NonFiStoredValueCardPurchaseLoad, + NondurableGoods, + NurseriesLawnAndGardenSupplyStores, + NursingPersonalCare, + OfficeAndCommercialFurniture, + OpticiansEyeglasses, + OptometristsOphthalmologist, + OrthopedicGoodsProstheticDevices, + Osteopaths, + PackageStoresBeerWineAndLiquor, + PaintsVarnishesAndSupplies, + ParkingLotsGarages, + PassengerRailways, + PawnShops, + PetShopsPetFoodAndSupplies, + PetroleumAndPetroleumProducts, + PhotoDeveloping, + PhotographicPhotocopyMicrofilmEquipmentAndSupplies, + PhotographicStudios, + PictureVideoProduction, + PieceGoodsNotionsAndOtherDryGoods, + PlumbingHeatingEquipmentAndSupplies, + PoliticalOrganizations, + PostalServicesGovernmentOnly, + PreciousStonesAndMetalsWatchesAndJewelry, + ProfessionalServices, + PublicWarehousingAndStorage, + QuickCopyReproAndBlueprint, + Railroads, + RealEstateAgentsAndManagersRentals, + RecordStores, + RecreationalVehicleRentals, + ReligiousGoodsStores, + ReligiousOrganizations, + RoofingSidingSheetMetal, + SecretarialSupportServices, + SecurityBrokersDealers, + ServiceStations, + SewingNeedleworkFabricAndPieceGoodsStores, + ShoeRepairHatCleaning, + ShoeStores, + SmallApplianceRepair, + SnowmobileDealers, + SpecialTradeServices, + SpecialtyCleaning, + SportingGoodsStores, + SportingRecreationCamps, + SportsAndRidingApparelStores, + SportsClubsFields, + StampAndCoinStores, + StationaryOfficeSuppliesPrintingAndWritingPaper, + StationeryStoresOfficeAndSchoolSupplyStores, + SwimmingPoolsSales, + TUiTravelGermany, + TailorsAlterations, + TaxPaymentsGovernmentAgencies, + TaxPreparationServices, + TaxicabsLimousines, + TelecommunicationEquipmentAndTelephoneSales, + TelecommunicationServices, + TelegraphServices, + TentAndAwningShops, + TestingLaboratories, + TheatricalTicketAgencies, + Timeshares, + TireRetreadingAndRepair, + TollsBridgeFees, + TouristAttractionsAndExhibits, + TowingServices, + TrailerParksCampgrounds, + TransportationServices, + TravelAgenciesTourOperators, + TruckStopIteration, + TruckUtilityTrailerRentals, + TypesettingPlateMakingAndRelatedServices, + TypewriterStores, + USFederalGovernmentAgenciesOrDepartments, + UniformsCommercialClothing, + UsedMerchandiseAndSecondhandStores, + Utilities, + VarietyStores, + VeterinaryServices, + VideoAmusementGameSupplies, + VideoGameArcades, + VideoTapeRentalStores, + VocationalTradeSchools, + WatchJewelryRepair, + WeldingRepair, + WholesaleClubs, + WigAndToupeeStores, + WiresMoneyOrders, + WomensAccessoryAndSpecialtyShops, + WomensReadyToWearStores, + WreckingAndSalvageYards, + /// An unrecognized value from Stripe. Should not be used as a request parameter. + Unknown, +} +impl UpdateIssuingCardholderSpendingControlsBlockedCategories { + pub fn as_str(self) -> &'static str { + use UpdateIssuingCardholderSpendingControlsBlockedCategories::*; + match self { + AcRefrigerationRepair => "ac_refrigeration_repair", + AccountingBookkeepingServices => "accounting_bookkeeping_services", + AdvertisingServices => "advertising_services", + AgriculturalCooperative => "agricultural_cooperative", + AirlinesAirCarriers => "airlines_air_carriers", + AirportsFlyingFields => "airports_flying_fields", + AmbulanceServices => "ambulance_services", + AmusementParksCarnivals => "amusement_parks_carnivals", + AntiqueReproductions => "antique_reproductions", + AntiqueShops => "antique_shops", + Aquariums => "aquariums", + ArchitecturalSurveyingServices => "architectural_surveying_services", + ArtDealersAndGalleries => "art_dealers_and_galleries", + ArtistsSupplyAndCraftShops => "artists_supply_and_craft_shops", + AutoAndHomeSupplyStores => "auto_and_home_supply_stores", + AutoBodyRepairShops => "auto_body_repair_shops", + AutoPaintShops => "auto_paint_shops", + AutoServiceShops => "auto_service_shops", + AutomatedCashDisburse => "automated_cash_disburse", + AutomatedFuelDispensers => "automated_fuel_dispensers", + AutomobileAssociations => "automobile_associations", + AutomotivePartsAndAccessoriesStores => "automotive_parts_and_accessories_stores", + AutomotiveTireStores => "automotive_tire_stores", + BailAndBondPayments => "bail_and_bond_payments", + Bakeries => "bakeries", + BandsOrchestras => "bands_orchestras", + BarberAndBeautyShops => "barber_and_beauty_shops", + BettingCasinoGambling => "betting_casino_gambling", + BicycleShops => "bicycle_shops", + BilliardPoolEstablishments => "billiard_pool_establishments", + BoatDealers => "boat_dealers", + BoatRentalsAndLeases => "boat_rentals_and_leases", + BookStores => "book_stores", + BooksPeriodicalsAndNewspapers => "books_periodicals_and_newspapers", + BowlingAlleys => "bowling_alleys", + BusLines => "bus_lines", + BusinessSecretarialSchools => "business_secretarial_schools", + BuyingShoppingServices => "buying_shopping_services", + CableSatelliteAndOtherPayTelevisionAndRadio => { + "cable_satellite_and_other_pay_television_and_radio" + } + CameraAndPhotographicSupplyStores => "camera_and_photographic_supply_stores", + CandyNutAndConfectioneryStores => "candy_nut_and_confectionery_stores", + CarAndTruckDealersNewUsed => "car_and_truck_dealers_new_used", + CarAndTruckDealersUsedOnly => "car_and_truck_dealers_used_only", + CarRentalAgencies => "car_rental_agencies", + CarWashes => "car_washes", + CarpentryServices => "carpentry_services", + CarpetUpholsteryCleaning => "carpet_upholstery_cleaning", + Caterers => "caterers", + CharitableAndSocialServiceOrganizationsFundraising => { + "charitable_and_social_service_organizations_fundraising" + } + ChemicalsAndAlliedProducts => "chemicals_and_allied_products", + ChildCareServices => "child_care_services", + ChildrensAndInfantsWearStores => "childrens_and_infants_wear_stores", + ChiropodistsPodiatrists => "chiropodists_podiatrists", + Chiropractors => "chiropractors", + CigarStoresAndStands => "cigar_stores_and_stands", + CivicSocialFraternalAssociations => "civic_social_fraternal_associations", + CleaningAndMaintenance => "cleaning_and_maintenance", + ClothingRental => "clothing_rental", + CollegesUniversities => "colleges_universities", + CommercialEquipment => "commercial_equipment", + CommercialFootwear => "commercial_footwear", + CommercialPhotographyArtAndGraphics => "commercial_photography_art_and_graphics", + CommuterTransportAndFerries => "commuter_transport_and_ferries", + ComputerNetworkServices => "computer_network_services", + ComputerProgramming => "computer_programming", + ComputerRepair => "computer_repair", + ComputerSoftwareStores => "computer_software_stores", + ComputersPeripheralsAndSoftware => "computers_peripherals_and_software", + ConcreteWorkServices => "concrete_work_services", + ConstructionMaterials => "construction_materials", + ConsultingPublicRelations => "consulting_public_relations", + CorrespondenceSchools => "correspondence_schools", + CosmeticStores => "cosmetic_stores", + CounselingServices => "counseling_services", + CountryClubs => "country_clubs", + CourierServices => "courier_services", + CourtCosts => "court_costs", + CreditReportingAgencies => "credit_reporting_agencies", + CruiseLines => "cruise_lines", + DairyProductsStores => "dairy_products_stores", + DanceHallStudiosSchools => "dance_hall_studios_schools", + DatingEscortServices => "dating_escort_services", + DentistsOrthodontists => "dentists_orthodontists", + DepartmentStores => "department_stores", + DetectiveAgencies => "detective_agencies", + DigitalGoodsApplications => "digital_goods_applications", + DigitalGoodsGames => "digital_goods_games", + DigitalGoodsLargeVolume => "digital_goods_large_volume", + DigitalGoodsMedia => "digital_goods_media", + DirectMarketingCatalogMerchant => "direct_marketing_catalog_merchant", + DirectMarketingCombinationCatalogAndRetailMerchant => { + "direct_marketing_combination_catalog_and_retail_merchant" + } + DirectMarketingInboundTelemarketing => "direct_marketing_inbound_telemarketing", + DirectMarketingInsuranceServices => "direct_marketing_insurance_services", + DirectMarketingOther => "direct_marketing_other", + DirectMarketingOutboundTelemarketing => "direct_marketing_outbound_telemarketing", + DirectMarketingSubscription => "direct_marketing_subscription", + DirectMarketingTravel => "direct_marketing_travel", + DiscountStores => "discount_stores", + Doctors => "doctors", + DoorToDoorSales => "door_to_door_sales", + DraperyWindowCoveringAndUpholsteryStores => { + "drapery_window_covering_and_upholstery_stores" + } + DrinkingPlaces => "drinking_places", + DrugStoresAndPharmacies => "drug_stores_and_pharmacies", + DrugsDrugProprietariesAndDruggistSundries => { + "drugs_drug_proprietaries_and_druggist_sundries" + } + DryCleaners => "dry_cleaners", + DurableGoods => "durable_goods", + DutyFreeStores => "duty_free_stores", + EatingPlacesRestaurants => "eating_places_restaurants", + EducationalServices => "educational_services", + ElectricRazorStores => "electric_razor_stores", + ElectricVehicleCharging => "electric_vehicle_charging", + ElectricalPartsAndEquipment => "electrical_parts_and_equipment", + ElectricalServices => "electrical_services", + ElectronicsRepairShops => "electronics_repair_shops", + ElectronicsStores => "electronics_stores", + ElementarySecondarySchools => "elementary_secondary_schools", + EmergencyServicesGcasVisaUseOnly => "emergency_services_gcas_visa_use_only", + EmploymentTempAgencies => "employment_temp_agencies", + EquipmentRental => "equipment_rental", + ExterminatingServices => "exterminating_services", + FamilyClothingStores => "family_clothing_stores", + FastFoodRestaurants => "fast_food_restaurants", + FinancialInstitutions => "financial_institutions", + FinesGovernmentAdministrativeEntities => "fines_government_administrative_entities", + FireplaceFireplaceScreensAndAccessoriesStores => { + "fireplace_fireplace_screens_and_accessories_stores" + } + FloorCoveringStores => "floor_covering_stores", + Florists => "florists", + FloristsSuppliesNurseryStockAndFlowers => "florists_supplies_nursery_stock_and_flowers", + FreezerAndLockerMeatProvisioners => "freezer_and_locker_meat_provisioners", + FuelDealersNonAutomotive => "fuel_dealers_non_automotive", + FuneralServicesCrematories => "funeral_services_crematories", + FurnitureHomeFurnishingsAndEquipmentStoresExceptAppliances => { + "furniture_home_furnishings_and_equipment_stores_except_appliances" + } + FurnitureRepairRefinishing => "furniture_repair_refinishing", + FurriersAndFurShops => "furriers_and_fur_shops", + GeneralServices => "general_services", + GiftCardNoveltyAndSouvenirShops => "gift_card_novelty_and_souvenir_shops", + GlassPaintAndWallpaperStores => "glass_paint_and_wallpaper_stores", + GlasswareCrystalStores => "glassware_crystal_stores", + GolfCoursesPublic => "golf_courses_public", + GovernmentLicensedHorseDogRacingUsRegionOnly => { + "government_licensed_horse_dog_racing_us_region_only" + } + GovernmentLicensedOnlineCasionsOnlineGamblingUsRegionOnly => { + "government_licensed_online_casions_online_gambling_us_region_only" + } + GovernmentOwnedLotteriesNonUsRegion => "government_owned_lotteries_non_us_region", + GovernmentOwnedLotteriesUsRegionOnly => "government_owned_lotteries_us_region_only", + GovernmentServices => "government_services", + GroceryStoresSupermarkets => "grocery_stores_supermarkets", + HardwareEquipmentAndSupplies => "hardware_equipment_and_supplies", + HardwareStores => "hardware_stores", + HealthAndBeautySpas => "health_and_beauty_spas", + HearingAidsSalesAndSupplies => "hearing_aids_sales_and_supplies", + HeatingPlumbingAC => "heating_plumbing_a_c", + HobbyToyAndGameShops => "hobby_toy_and_game_shops", + HomeSupplyWarehouseStores => "home_supply_warehouse_stores", + Hospitals => "hospitals", + HotelsMotelsAndResorts => "hotels_motels_and_resorts", + HouseholdApplianceStores => "household_appliance_stores", + IndustrialSupplies => "industrial_supplies", + InformationRetrievalServices => "information_retrieval_services", + InsuranceDefault => "insurance_default", + InsuranceUnderwritingPremiums => "insurance_underwriting_premiums", + IntraCompanyPurchases => "intra_company_purchases", + JewelryStoresWatchesClocksAndSilverwareStores => { + "jewelry_stores_watches_clocks_and_silverware_stores" + } + LandscapingServices => "landscaping_services", + Laundries => "laundries", + LaundryCleaningServices => "laundry_cleaning_services", + LegalServicesAttorneys => "legal_services_attorneys", + LuggageAndLeatherGoodsStores => "luggage_and_leather_goods_stores", + LumberBuildingMaterialsStores => "lumber_building_materials_stores", + ManualCashDisburse => "manual_cash_disburse", + MarinasServiceAndSupplies => "marinas_service_and_supplies", + Marketplaces => "marketplaces", + MasonryStoneworkAndPlaster => "masonry_stonework_and_plaster", + MassageParlors => "massage_parlors", + MedicalAndDentalLabs => "medical_and_dental_labs", + MedicalDentalOphthalmicAndHospitalEquipmentAndSupplies => { + "medical_dental_ophthalmic_and_hospital_equipment_and_supplies" + } + MedicalServices => "medical_services", + MembershipOrganizations => "membership_organizations", + MensAndBoysClothingAndAccessoriesStores => { + "mens_and_boys_clothing_and_accessories_stores" + } + MensWomensClothingStores => "mens_womens_clothing_stores", + MetalServiceCenters => "metal_service_centers", + Miscellaneous => "miscellaneous", + MiscellaneousApparelAndAccessoryShops => "miscellaneous_apparel_and_accessory_shops", + MiscellaneousAutoDealers => "miscellaneous_auto_dealers", + MiscellaneousBusinessServices => "miscellaneous_business_services", + MiscellaneousFoodStores => "miscellaneous_food_stores", + MiscellaneousGeneralMerchandise => "miscellaneous_general_merchandise", + MiscellaneousGeneralServices => "miscellaneous_general_services", + MiscellaneousHomeFurnishingSpecialtyStores => { + "miscellaneous_home_furnishing_specialty_stores" + } + MiscellaneousPublishingAndPrinting => "miscellaneous_publishing_and_printing", + MiscellaneousRecreationServices => "miscellaneous_recreation_services", + MiscellaneousRepairShops => "miscellaneous_repair_shops", + MiscellaneousSpecialtyRetail => "miscellaneous_specialty_retail", + MobileHomeDealers => "mobile_home_dealers", + MotionPictureTheaters => "motion_picture_theaters", + MotorFreightCarriersAndTrucking => "motor_freight_carriers_and_trucking", + MotorHomesDealers => "motor_homes_dealers", + MotorVehicleSuppliesAndNewParts => "motor_vehicle_supplies_and_new_parts", + MotorcycleShopsAndDealers => "motorcycle_shops_and_dealers", + MotorcycleShopsDealers => "motorcycle_shops_dealers", + MusicStoresMusicalInstrumentsPianosAndSheetMusic => { + "music_stores_musical_instruments_pianos_and_sheet_music" + } + NewsDealersAndNewsstands => "news_dealers_and_newsstands", + NonFiMoneyOrders => "non_fi_money_orders", + NonFiStoredValueCardPurchaseLoad => "non_fi_stored_value_card_purchase_load", + NondurableGoods => "nondurable_goods", + NurseriesLawnAndGardenSupplyStores => "nurseries_lawn_and_garden_supply_stores", + NursingPersonalCare => "nursing_personal_care", + OfficeAndCommercialFurniture => "office_and_commercial_furniture", + OpticiansEyeglasses => "opticians_eyeglasses", + OptometristsOphthalmologist => "optometrists_ophthalmologist", + OrthopedicGoodsProstheticDevices => "orthopedic_goods_prosthetic_devices", + Osteopaths => "osteopaths", + PackageStoresBeerWineAndLiquor => "package_stores_beer_wine_and_liquor", + PaintsVarnishesAndSupplies => "paints_varnishes_and_supplies", + ParkingLotsGarages => "parking_lots_garages", + PassengerRailways => "passenger_railways", + PawnShops => "pawn_shops", + PetShopsPetFoodAndSupplies => "pet_shops_pet_food_and_supplies", + PetroleumAndPetroleumProducts => "petroleum_and_petroleum_products", + PhotoDeveloping => "photo_developing", + PhotographicPhotocopyMicrofilmEquipmentAndSupplies => { + "photographic_photocopy_microfilm_equipment_and_supplies" + } + PhotographicStudios => "photographic_studios", + PictureVideoProduction => "picture_video_production", + PieceGoodsNotionsAndOtherDryGoods => "piece_goods_notions_and_other_dry_goods", + PlumbingHeatingEquipmentAndSupplies => "plumbing_heating_equipment_and_supplies", + PoliticalOrganizations => "political_organizations", + PostalServicesGovernmentOnly => "postal_services_government_only", + PreciousStonesAndMetalsWatchesAndJewelry => { + "precious_stones_and_metals_watches_and_jewelry" + } + ProfessionalServices => "professional_services", + PublicWarehousingAndStorage => "public_warehousing_and_storage", + QuickCopyReproAndBlueprint => "quick_copy_repro_and_blueprint", + Railroads => "railroads", + RealEstateAgentsAndManagersRentals => "real_estate_agents_and_managers_rentals", + RecordStores => "record_stores", + RecreationalVehicleRentals => "recreational_vehicle_rentals", + ReligiousGoodsStores => "religious_goods_stores", + ReligiousOrganizations => "religious_organizations", + RoofingSidingSheetMetal => "roofing_siding_sheet_metal", + SecretarialSupportServices => "secretarial_support_services", + SecurityBrokersDealers => "security_brokers_dealers", + ServiceStations => "service_stations", + SewingNeedleworkFabricAndPieceGoodsStores => { + "sewing_needlework_fabric_and_piece_goods_stores" + } + ShoeRepairHatCleaning => "shoe_repair_hat_cleaning", + ShoeStores => "shoe_stores", + SmallApplianceRepair => "small_appliance_repair", + SnowmobileDealers => "snowmobile_dealers", + SpecialTradeServices => "special_trade_services", + SpecialtyCleaning => "specialty_cleaning", + SportingGoodsStores => "sporting_goods_stores", + SportingRecreationCamps => "sporting_recreation_camps", + SportsAndRidingApparelStores => "sports_and_riding_apparel_stores", + SportsClubsFields => "sports_clubs_fields", + StampAndCoinStores => "stamp_and_coin_stores", + StationaryOfficeSuppliesPrintingAndWritingPaper => { + "stationary_office_supplies_printing_and_writing_paper" + } + StationeryStoresOfficeAndSchoolSupplyStores => { + "stationery_stores_office_and_school_supply_stores" + } + SwimmingPoolsSales => "swimming_pools_sales", + TUiTravelGermany => "t_ui_travel_germany", + TailorsAlterations => "tailors_alterations", + TaxPaymentsGovernmentAgencies => "tax_payments_government_agencies", + TaxPreparationServices => "tax_preparation_services", + TaxicabsLimousines => "taxicabs_limousines", + TelecommunicationEquipmentAndTelephoneSales => { + "telecommunication_equipment_and_telephone_sales" + } + TelecommunicationServices => "telecommunication_services", + TelegraphServices => "telegraph_services", + TentAndAwningShops => "tent_and_awning_shops", + TestingLaboratories => "testing_laboratories", + TheatricalTicketAgencies => "theatrical_ticket_agencies", + Timeshares => "timeshares", + TireRetreadingAndRepair => "tire_retreading_and_repair", + TollsBridgeFees => "tolls_bridge_fees", + TouristAttractionsAndExhibits => "tourist_attractions_and_exhibits", + TowingServices => "towing_services", + TrailerParksCampgrounds => "trailer_parks_campgrounds", + TransportationServices => "transportation_services", + TravelAgenciesTourOperators => "travel_agencies_tour_operators", + TruckStopIteration => "truck_stop_iteration", + TruckUtilityTrailerRentals => "truck_utility_trailer_rentals", + TypesettingPlateMakingAndRelatedServices => { + "typesetting_plate_making_and_related_services" + } + TypewriterStores => "typewriter_stores", + USFederalGovernmentAgenciesOrDepartments => { + "u_s_federal_government_agencies_or_departments" + } + UniformsCommercialClothing => "uniforms_commercial_clothing", + UsedMerchandiseAndSecondhandStores => "used_merchandise_and_secondhand_stores", + Utilities => "utilities", + VarietyStores => "variety_stores", + VeterinaryServices => "veterinary_services", + VideoAmusementGameSupplies => "video_amusement_game_supplies", + VideoGameArcades => "video_game_arcades", + VideoTapeRentalStores => "video_tape_rental_stores", + VocationalTradeSchools => "vocational_trade_schools", + WatchJewelryRepair => "watch_jewelry_repair", + WeldingRepair => "welding_repair", + WholesaleClubs => "wholesale_clubs", + WigAndToupeeStores => "wig_and_toupee_stores", + WiresMoneyOrders => "wires_money_orders", + WomensAccessoryAndSpecialtyShops => "womens_accessory_and_specialty_shops", + WomensReadyToWearStores => "womens_ready_to_wear_stores", + WreckingAndSalvageYards => "wrecking_and_salvage_yards", + Unknown => "unknown", + } + } +} + +impl std::str::FromStr for UpdateIssuingCardholderSpendingControlsBlockedCategories { + type Err = (); + fn from_str(s: &str) -> Result { + use UpdateIssuingCardholderSpendingControlsBlockedCategories::*; + match s { + "ac_refrigeration_repair" => Ok(AcRefrigerationRepair), + "accounting_bookkeeping_services" => Ok(AccountingBookkeepingServices), + "advertising_services" => Ok(AdvertisingServices), + "agricultural_cooperative" => Ok(AgriculturalCooperative), + "airlines_air_carriers" => Ok(AirlinesAirCarriers), + "airports_flying_fields" => Ok(AirportsFlyingFields), + "ambulance_services" => Ok(AmbulanceServices), + "amusement_parks_carnivals" => Ok(AmusementParksCarnivals), + "antique_reproductions" => Ok(AntiqueReproductions), + "antique_shops" => Ok(AntiqueShops), + "aquariums" => Ok(Aquariums), + "architectural_surveying_services" => Ok(ArchitecturalSurveyingServices), + "art_dealers_and_galleries" => Ok(ArtDealersAndGalleries), + "artists_supply_and_craft_shops" => Ok(ArtistsSupplyAndCraftShops), + "auto_and_home_supply_stores" => Ok(AutoAndHomeSupplyStores), + "auto_body_repair_shops" => Ok(AutoBodyRepairShops), + "auto_paint_shops" => Ok(AutoPaintShops), + "auto_service_shops" => Ok(AutoServiceShops), + "automated_cash_disburse" => Ok(AutomatedCashDisburse), + "automated_fuel_dispensers" => Ok(AutomatedFuelDispensers), + "automobile_associations" => Ok(AutomobileAssociations), + "automotive_parts_and_accessories_stores" => Ok(AutomotivePartsAndAccessoriesStores), + "automotive_tire_stores" => Ok(AutomotiveTireStores), + "bail_and_bond_payments" => Ok(BailAndBondPayments), + "bakeries" => Ok(Bakeries), + "bands_orchestras" => Ok(BandsOrchestras), + "barber_and_beauty_shops" => Ok(BarberAndBeautyShops), + "betting_casino_gambling" => Ok(BettingCasinoGambling), + "bicycle_shops" => Ok(BicycleShops), + "billiard_pool_establishments" => Ok(BilliardPoolEstablishments), + "boat_dealers" => Ok(BoatDealers), + "boat_rentals_and_leases" => Ok(BoatRentalsAndLeases), + "book_stores" => Ok(BookStores), + "books_periodicals_and_newspapers" => Ok(BooksPeriodicalsAndNewspapers), + "bowling_alleys" => Ok(BowlingAlleys), + "bus_lines" => Ok(BusLines), + "business_secretarial_schools" => Ok(BusinessSecretarialSchools), + "buying_shopping_services" => Ok(BuyingShoppingServices), + "cable_satellite_and_other_pay_television_and_radio" => { + Ok(CableSatelliteAndOtherPayTelevisionAndRadio) + } + "camera_and_photographic_supply_stores" => Ok(CameraAndPhotographicSupplyStores), + "candy_nut_and_confectionery_stores" => Ok(CandyNutAndConfectioneryStores), + "car_and_truck_dealers_new_used" => Ok(CarAndTruckDealersNewUsed), + "car_and_truck_dealers_used_only" => Ok(CarAndTruckDealersUsedOnly), + "car_rental_agencies" => Ok(CarRentalAgencies), + "car_washes" => Ok(CarWashes), + "carpentry_services" => Ok(CarpentryServices), + "carpet_upholstery_cleaning" => Ok(CarpetUpholsteryCleaning), + "caterers" => Ok(Caterers), + "charitable_and_social_service_organizations_fundraising" => { + Ok(CharitableAndSocialServiceOrganizationsFundraising) + } + "chemicals_and_allied_products" => Ok(ChemicalsAndAlliedProducts), + "child_care_services" => Ok(ChildCareServices), + "childrens_and_infants_wear_stores" => Ok(ChildrensAndInfantsWearStores), + "chiropodists_podiatrists" => Ok(ChiropodistsPodiatrists), + "chiropractors" => Ok(Chiropractors), + "cigar_stores_and_stands" => Ok(CigarStoresAndStands), + "civic_social_fraternal_associations" => Ok(CivicSocialFraternalAssociations), + "cleaning_and_maintenance" => Ok(CleaningAndMaintenance), + "clothing_rental" => Ok(ClothingRental), + "colleges_universities" => Ok(CollegesUniversities), + "commercial_equipment" => Ok(CommercialEquipment), + "commercial_footwear" => Ok(CommercialFootwear), + "commercial_photography_art_and_graphics" => Ok(CommercialPhotographyArtAndGraphics), + "commuter_transport_and_ferries" => Ok(CommuterTransportAndFerries), + "computer_network_services" => Ok(ComputerNetworkServices), + "computer_programming" => Ok(ComputerProgramming), + "computer_repair" => Ok(ComputerRepair), + "computer_software_stores" => Ok(ComputerSoftwareStores), + "computers_peripherals_and_software" => Ok(ComputersPeripheralsAndSoftware), + "concrete_work_services" => Ok(ConcreteWorkServices), + "construction_materials" => Ok(ConstructionMaterials), + "consulting_public_relations" => Ok(ConsultingPublicRelations), + "correspondence_schools" => Ok(CorrespondenceSchools), + "cosmetic_stores" => Ok(CosmeticStores), + "counseling_services" => Ok(CounselingServices), + "country_clubs" => Ok(CountryClubs), + "courier_services" => Ok(CourierServices), + "court_costs" => Ok(CourtCosts), + "credit_reporting_agencies" => Ok(CreditReportingAgencies), + "cruise_lines" => Ok(CruiseLines), + "dairy_products_stores" => Ok(DairyProductsStores), + "dance_hall_studios_schools" => Ok(DanceHallStudiosSchools), + "dating_escort_services" => Ok(DatingEscortServices), + "dentists_orthodontists" => Ok(DentistsOrthodontists), + "department_stores" => Ok(DepartmentStores), + "detective_agencies" => Ok(DetectiveAgencies), + "digital_goods_applications" => Ok(DigitalGoodsApplications), + "digital_goods_games" => Ok(DigitalGoodsGames), + "digital_goods_large_volume" => Ok(DigitalGoodsLargeVolume), + "digital_goods_media" => Ok(DigitalGoodsMedia), + "direct_marketing_catalog_merchant" => Ok(DirectMarketingCatalogMerchant), + "direct_marketing_combination_catalog_and_retail_merchant" => { + Ok(DirectMarketingCombinationCatalogAndRetailMerchant) + } + "direct_marketing_inbound_telemarketing" => Ok(DirectMarketingInboundTelemarketing), + "direct_marketing_insurance_services" => Ok(DirectMarketingInsuranceServices), + "direct_marketing_other" => Ok(DirectMarketingOther), + "direct_marketing_outbound_telemarketing" => Ok(DirectMarketingOutboundTelemarketing), + "direct_marketing_subscription" => Ok(DirectMarketingSubscription), + "direct_marketing_travel" => Ok(DirectMarketingTravel), + "discount_stores" => Ok(DiscountStores), + "doctors" => Ok(Doctors), + "door_to_door_sales" => Ok(DoorToDoorSales), + "drapery_window_covering_and_upholstery_stores" => { + Ok(DraperyWindowCoveringAndUpholsteryStores) + } + "drinking_places" => Ok(DrinkingPlaces), + "drug_stores_and_pharmacies" => Ok(DrugStoresAndPharmacies), + "drugs_drug_proprietaries_and_druggist_sundries" => { + Ok(DrugsDrugProprietariesAndDruggistSundries) + } + "dry_cleaners" => Ok(DryCleaners), + "durable_goods" => Ok(DurableGoods), + "duty_free_stores" => Ok(DutyFreeStores), + "eating_places_restaurants" => Ok(EatingPlacesRestaurants), + "educational_services" => Ok(EducationalServices), + "electric_razor_stores" => Ok(ElectricRazorStores), + "electric_vehicle_charging" => Ok(ElectricVehicleCharging), + "electrical_parts_and_equipment" => Ok(ElectricalPartsAndEquipment), + "electrical_services" => Ok(ElectricalServices), + "electronics_repair_shops" => Ok(ElectronicsRepairShops), + "electronics_stores" => Ok(ElectronicsStores), + "elementary_secondary_schools" => Ok(ElementarySecondarySchools), + "emergency_services_gcas_visa_use_only" => Ok(EmergencyServicesGcasVisaUseOnly), + "employment_temp_agencies" => Ok(EmploymentTempAgencies), + "equipment_rental" => Ok(EquipmentRental), + "exterminating_services" => Ok(ExterminatingServices), + "family_clothing_stores" => Ok(FamilyClothingStores), + "fast_food_restaurants" => Ok(FastFoodRestaurants), + "financial_institutions" => Ok(FinancialInstitutions), + "fines_government_administrative_entities" => Ok(FinesGovernmentAdministrativeEntities), + "fireplace_fireplace_screens_and_accessories_stores" => { + Ok(FireplaceFireplaceScreensAndAccessoriesStores) + } + "floor_covering_stores" => Ok(FloorCoveringStores), + "florists" => Ok(Florists), + "florists_supplies_nursery_stock_and_flowers" => { + Ok(FloristsSuppliesNurseryStockAndFlowers) + } + "freezer_and_locker_meat_provisioners" => Ok(FreezerAndLockerMeatProvisioners), + "fuel_dealers_non_automotive" => Ok(FuelDealersNonAutomotive), + "funeral_services_crematories" => Ok(FuneralServicesCrematories), + "furniture_home_furnishings_and_equipment_stores_except_appliances" => { + Ok(FurnitureHomeFurnishingsAndEquipmentStoresExceptAppliances) + } + "furniture_repair_refinishing" => Ok(FurnitureRepairRefinishing), + "furriers_and_fur_shops" => Ok(FurriersAndFurShops), + "general_services" => Ok(GeneralServices), + "gift_card_novelty_and_souvenir_shops" => Ok(GiftCardNoveltyAndSouvenirShops), + "glass_paint_and_wallpaper_stores" => Ok(GlassPaintAndWallpaperStores), + "glassware_crystal_stores" => Ok(GlasswareCrystalStores), + "golf_courses_public" => Ok(GolfCoursesPublic), + "government_licensed_horse_dog_racing_us_region_only" => { + Ok(GovernmentLicensedHorseDogRacingUsRegionOnly) + } + "government_licensed_online_casions_online_gambling_us_region_only" => { + Ok(GovernmentLicensedOnlineCasionsOnlineGamblingUsRegionOnly) + } + "government_owned_lotteries_non_us_region" => Ok(GovernmentOwnedLotteriesNonUsRegion), + "government_owned_lotteries_us_region_only" => Ok(GovernmentOwnedLotteriesUsRegionOnly), + "government_services" => Ok(GovernmentServices), + "grocery_stores_supermarkets" => Ok(GroceryStoresSupermarkets), + "hardware_equipment_and_supplies" => Ok(HardwareEquipmentAndSupplies), + "hardware_stores" => Ok(HardwareStores), + "health_and_beauty_spas" => Ok(HealthAndBeautySpas), + "hearing_aids_sales_and_supplies" => Ok(HearingAidsSalesAndSupplies), + "heating_plumbing_a_c" => Ok(HeatingPlumbingAC), + "hobby_toy_and_game_shops" => Ok(HobbyToyAndGameShops), + "home_supply_warehouse_stores" => Ok(HomeSupplyWarehouseStores), + "hospitals" => Ok(Hospitals), + "hotels_motels_and_resorts" => Ok(HotelsMotelsAndResorts), + "household_appliance_stores" => Ok(HouseholdApplianceStores), + "industrial_supplies" => Ok(IndustrialSupplies), + "information_retrieval_services" => Ok(InformationRetrievalServices), + "insurance_default" => Ok(InsuranceDefault), + "insurance_underwriting_premiums" => Ok(InsuranceUnderwritingPremiums), + "intra_company_purchases" => Ok(IntraCompanyPurchases), + "jewelry_stores_watches_clocks_and_silverware_stores" => { + Ok(JewelryStoresWatchesClocksAndSilverwareStores) + } + "landscaping_services" => Ok(LandscapingServices), + "laundries" => Ok(Laundries), + "laundry_cleaning_services" => Ok(LaundryCleaningServices), + "legal_services_attorneys" => Ok(LegalServicesAttorneys), + "luggage_and_leather_goods_stores" => Ok(LuggageAndLeatherGoodsStores), + "lumber_building_materials_stores" => Ok(LumberBuildingMaterialsStores), + "manual_cash_disburse" => Ok(ManualCashDisburse), + "marinas_service_and_supplies" => Ok(MarinasServiceAndSupplies), + "marketplaces" => Ok(Marketplaces), + "masonry_stonework_and_plaster" => Ok(MasonryStoneworkAndPlaster), + "massage_parlors" => Ok(MassageParlors), + "medical_and_dental_labs" => Ok(MedicalAndDentalLabs), + "medical_dental_ophthalmic_and_hospital_equipment_and_supplies" => { + Ok(MedicalDentalOphthalmicAndHospitalEquipmentAndSupplies) + } + "medical_services" => Ok(MedicalServices), + "membership_organizations" => Ok(MembershipOrganizations), + "mens_and_boys_clothing_and_accessories_stores" => { + Ok(MensAndBoysClothingAndAccessoriesStores) + } + "mens_womens_clothing_stores" => Ok(MensWomensClothingStores), + "metal_service_centers" => Ok(MetalServiceCenters), + "miscellaneous" => Ok(Miscellaneous), + "miscellaneous_apparel_and_accessory_shops" => { + Ok(MiscellaneousApparelAndAccessoryShops) + } + "miscellaneous_auto_dealers" => Ok(MiscellaneousAutoDealers), + "miscellaneous_business_services" => Ok(MiscellaneousBusinessServices), + "miscellaneous_food_stores" => Ok(MiscellaneousFoodStores), + "miscellaneous_general_merchandise" => Ok(MiscellaneousGeneralMerchandise), + "miscellaneous_general_services" => Ok(MiscellaneousGeneralServices), + "miscellaneous_home_furnishing_specialty_stores" => { + Ok(MiscellaneousHomeFurnishingSpecialtyStores) + } + "miscellaneous_publishing_and_printing" => Ok(MiscellaneousPublishingAndPrinting), + "miscellaneous_recreation_services" => Ok(MiscellaneousRecreationServices), + "miscellaneous_repair_shops" => Ok(MiscellaneousRepairShops), + "miscellaneous_specialty_retail" => Ok(MiscellaneousSpecialtyRetail), + "mobile_home_dealers" => Ok(MobileHomeDealers), + "motion_picture_theaters" => Ok(MotionPictureTheaters), + "motor_freight_carriers_and_trucking" => Ok(MotorFreightCarriersAndTrucking), + "motor_homes_dealers" => Ok(MotorHomesDealers), + "motor_vehicle_supplies_and_new_parts" => Ok(MotorVehicleSuppliesAndNewParts), + "motorcycle_shops_and_dealers" => Ok(MotorcycleShopsAndDealers), + "motorcycle_shops_dealers" => Ok(MotorcycleShopsDealers), + "music_stores_musical_instruments_pianos_and_sheet_music" => { + Ok(MusicStoresMusicalInstrumentsPianosAndSheetMusic) + } + "news_dealers_and_newsstands" => Ok(NewsDealersAndNewsstands), + "non_fi_money_orders" => Ok(NonFiMoneyOrders), + "non_fi_stored_value_card_purchase_load" => Ok(NonFiStoredValueCardPurchaseLoad), + "nondurable_goods" => Ok(NondurableGoods), + "nurseries_lawn_and_garden_supply_stores" => Ok(NurseriesLawnAndGardenSupplyStores), + "nursing_personal_care" => Ok(NursingPersonalCare), + "office_and_commercial_furniture" => Ok(OfficeAndCommercialFurniture), + "opticians_eyeglasses" => Ok(OpticiansEyeglasses), + "optometrists_ophthalmologist" => Ok(OptometristsOphthalmologist), + "orthopedic_goods_prosthetic_devices" => Ok(OrthopedicGoodsProstheticDevices), + "osteopaths" => Ok(Osteopaths), + "package_stores_beer_wine_and_liquor" => Ok(PackageStoresBeerWineAndLiquor), + "paints_varnishes_and_supplies" => Ok(PaintsVarnishesAndSupplies), + "parking_lots_garages" => Ok(ParkingLotsGarages), + "passenger_railways" => Ok(PassengerRailways), + "pawn_shops" => Ok(PawnShops), + "pet_shops_pet_food_and_supplies" => Ok(PetShopsPetFoodAndSupplies), + "petroleum_and_petroleum_products" => Ok(PetroleumAndPetroleumProducts), + "photo_developing" => Ok(PhotoDeveloping), + "photographic_photocopy_microfilm_equipment_and_supplies" => { + Ok(PhotographicPhotocopyMicrofilmEquipmentAndSupplies) + } + "photographic_studios" => Ok(PhotographicStudios), + "picture_video_production" => Ok(PictureVideoProduction), + "piece_goods_notions_and_other_dry_goods" => Ok(PieceGoodsNotionsAndOtherDryGoods), + "plumbing_heating_equipment_and_supplies" => Ok(PlumbingHeatingEquipmentAndSupplies), + "political_organizations" => Ok(PoliticalOrganizations), + "postal_services_government_only" => Ok(PostalServicesGovernmentOnly), + "precious_stones_and_metals_watches_and_jewelry" => { + Ok(PreciousStonesAndMetalsWatchesAndJewelry) + } + "professional_services" => Ok(ProfessionalServices), + "public_warehousing_and_storage" => Ok(PublicWarehousingAndStorage), + "quick_copy_repro_and_blueprint" => Ok(QuickCopyReproAndBlueprint), + "railroads" => Ok(Railroads), + "real_estate_agents_and_managers_rentals" => Ok(RealEstateAgentsAndManagersRentals), + "record_stores" => Ok(RecordStores), + "recreational_vehicle_rentals" => Ok(RecreationalVehicleRentals), + "religious_goods_stores" => Ok(ReligiousGoodsStores), + "religious_organizations" => Ok(ReligiousOrganizations), + "roofing_siding_sheet_metal" => Ok(RoofingSidingSheetMetal), + "secretarial_support_services" => Ok(SecretarialSupportServices), + "security_brokers_dealers" => Ok(SecurityBrokersDealers), + "service_stations" => Ok(ServiceStations), + "sewing_needlework_fabric_and_piece_goods_stores" => { + Ok(SewingNeedleworkFabricAndPieceGoodsStores) + } + "shoe_repair_hat_cleaning" => Ok(ShoeRepairHatCleaning), + "shoe_stores" => Ok(ShoeStores), + "small_appliance_repair" => Ok(SmallApplianceRepair), + "snowmobile_dealers" => Ok(SnowmobileDealers), + "special_trade_services" => Ok(SpecialTradeServices), + "specialty_cleaning" => Ok(SpecialtyCleaning), + "sporting_goods_stores" => Ok(SportingGoodsStores), + "sporting_recreation_camps" => Ok(SportingRecreationCamps), + "sports_and_riding_apparel_stores" => Ok(SportsAndRidingApparelStores), + "sports_clubs_fields" => Ok(SportsClubsFields), + "stamp_and_coin_stores" => Ok(StampAndCoinStores), + "stationary_office_supplies_printing_and_writing_paper" => { + Ok(StationaryOfficeSuppliesPrintingAndWritingPaper) + } + "stationery_stores_office_and_school_supply_stores" => { + Ok(StationeryStoresOfficeAndSchoolSupplyStores) + } + "swimming_pools_sales" => Ok(SwimmingPoolsSales), + "t_ui_travel_germany" => Ok(TUiTravelGermany), + "tailors_alterations" => Ok(TailorsAlterations), + "tax_payments_government_agencies" => Ok(TaxPaymentsGovernmentAgencies), + "tax_preparation_services" => Ok(TaxPreparationServices), + "taxicabs_limousines" => Ok(TaxicabsLimousines), + "telecommunication_equipment_and_telephone_sales" => { + Ok(TelecommunicationEquipmentAndTelephoneSales) + } + "telecommunication_services" => Ok(TelecommunicationServices), + "telegraph_services" => Ok(TelegraphServices), + "tent_and_awning_shops" => Ok(TentAndAwningShops), + "testing_laboratories" => Ok(TestingLaboratories), + "theatrical_ticket_agencies" => Ok(TheatricalTicketAgencies), + "timeshares" => Ok(Timeshares), + "tire_retreading_and_repair" => Ok(TireRetreadingAndRepair), + "tolls_bridge_fees" => Ok(TollsBridgeFees), + "tourist_attractions_and_exhibits" => Ok(TouristAttractionsAndExhibits), + "towing_services" => Ok(TowingServices), + "trailer_parks_campgrounds" => Ok(TrailerParksCampgrounds), + "transportation_services" => Ok(TransportationServices), + "travel_agencies_tour_operators" => Ok(TravelAgenciesTourOperators), + "truck_stop_iteration" => Ok(TruckStopIteration), + "truck_utility_trailer_rentals" => Ok(TruckUtilityTrailerRentals), + "typesetting_plate_making_and_related_services" => { + Ok(TypesettingPlateMakingAndRelatedServices) + } + "typewriter_stores" => Ok(TypewriterStores), + "u_s_federal_government_agencies_or_departments" => { + Ok(USFederalGovernmentAgenciesOrDepartments) + } + "uniforms_commercial_clothing" => Ok(UniformsCommercialClothing), + "used_merchandise_and_secondhand_stores" => Ok(UsedMerchandiseAndSecondhandStores), + "utilities" => Ok(Utilities), + "variety_stores" => Ok(VarietyStores), + "veterinary_services" => Ok(VeterinaryServices), + "video_amusement_game_supplies" => Ok(VideoAmusementGameSupplies), + "video_game_arcades" => Ok(VideoGameArcades), + "video_tape_rental_stores" => Ok(VideoTapeRentalStores), + "vocational_trade_schools" => Ok(VocationalTradeSchools), + "watch_jewelry_repair" => Ok(WatchJewelryRepair), + "welding_repair" => Ok(WeldingRepair), + "wholesale_clubs" => Ok(WholesaleClubs), + "wig_and_toupee_stores" => Ok(WigAndToupeeStores), + "wires_money_orders" => Ok(WiresMoneyOrders), + "womens_accessory_and_specialty_shops" => Ok(WomensAccessoryAndSpecialtyShops), + "womens_ready_to_wear_stores" => Ok(WomensReadyToWearStores), + "wrecking_and_salvage_yards" => Ok(WreckingAndSalvageYards), + _ => Err(()), + } + } +} +impl std::fmt::Display for UpdateIssuingCardholderSpendingControlsBlockedCategories { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for UpdateIssuingCardholderSpendingControlsBlockedCategories { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for UpdateIssuingCardholderSpendingControlsBlockedCategories { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Limit spending with amount-based rules that apply across this cardholder's cards. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct UpdateIssuingCardholderSpendingControlsSpendingLimits<'a> { + /// Maximum amount allowed to spend per interval. + pub amount: i64, + /// Array of strings containing [categories](https://stripe.com/docs/api#issuing_authorization_object-merchant_data-category) this limit applies to. + /// Omitting this field will apply the limit to all categories. + #[serde(skip_serializing_if = "Option::is_none")] + pub categories: Option<&'a [UpdateIssuingCardholderSpendingControlsSpendingLimitsCategories]>, + /// Interval (or event) to which the amount applies. + pub interval: UpdateIssuingCardholderSpendingControlsSpendingLimitsInterval, +} +impl<'a> UpdateIssuingCardholderSpendingControlsSpendingLimits<'a> { + pub fn new( + amount: i64, + interval: UpdateIssuingCardholderSpendingControlsSpendingLimitsInterval, + ) -> Self { + Self { amount, categories: None, interval } + } +} +/// Array of strings containing [categories](https://stripe.com/docs/api#issuing_authorization_object-merchant_data-category) this limit applies to. +/// Omitting this field will apply the limit to all categories. +#[derive(Copy, Clone, Eq, PartialEq)] +#[non_exhaustive] +pub enum UpdateIssuingCardholderSpendingControlsSpendingLimitsCategories { + AcRefrigerationRepair, + AccountingBookkeepingServices, + AdvertisingServices, + AgriculturalCooperative, + AirlinesAirCarriers, + AirportsFlyingFields, + AmbulanceServices, + AmusementParksCarnivals, + AntiqueReproductions, + AntiqueShops, + Aquariums, + ArchitecturalSurveyingServices, + ArtDealersAndGalleries, + ArtistsSupplyAndCraftShops, + AutoAndHomeSupplyStores, + AutoBodyRepairShops, + AutoPaintShops, + AutoServiceShops, + AutomatedCashDisburse, + AutomatedFuelDispensers, + AutomobileAssociations, + AutomotivePartsAndAccessoriesStores, + AutomotiveTireStores, + BailAndBondPayments, + Bakeries, + BandsOrchestras, + BarberAndBeautyShops, + BettingCasinoGambling, + BicycleShops, + BilliardPoolEstablishments, + BoatDealers, + BoatRentalsAndLeases, + BookStores, + BooksPeriodicalsAndNewspapers, + BowlingAlleys, + BusLines, + BusinessSecretarialSchools, + BuyingShoppingServices, + CableSatelliteAndOtherPayTelevisionAndRadio, + CameraAndPhotographicSupplyStores, + CandyNutAndConfectioneryStores, + CarAndTruckDealersNewUsed, + CarAndTruckDealersUsedOnly, + CarRentalAgencies, + CarWashes, + CarpentryServices, + CarpetUpholsteryCleaning, + Caterers, + CharitableAndSocialServiceOrganizationsFundraising, + ChemicalsAndAlliedProducts, + ChildCareServices, + ChildrensAndInfantsWearStores, + ChiropodistsPodiatrists, + Chiropractors, + CigarStoresAndStands, + CivicSocialFraternalAssociations, + CleaningAndMaintenance, + ClothingRental, + CollegesUniversities, + CommercialEquipment, + CommercialFootwear, + CommercialPhotographyArtAndGraphics, + CommuterTransportAndFerries, + ComputerNetworkServices, + ComputerProgramming, + ComputerRepair, + ComputerSoftwareStores, + ComputersPeripheralsAndSoftware, + ConcreteWorkServices, + ConstructionMaterials, + ConsultingPublicRelations, + CorrespondenceSchools, + CosmeticStores, + CounselingServices, + CountryClubs, + CourierServices, + CourtCosts, + CreditReportingAgencies, + CruiseLines, + DairyProductsStores, + DanceHallStudiosSchools, + DatingEscortServices, + DentistsOrthodontists, + DepartmentStores, + DetectiveAgencies, + DigitalGoodsApplications, + DigitalGoodsGames, + DigitalGoodsLargeVolume, + DigitalGoodsMedia, + DirectMarketingCatalogMerchant, + DirectMarketingCombinationCatalogAndRetailMerchant, + DirectMarketingInboundTelemarketing, + DirectMarketingInsuranceServices, + DirectMarketingOther, + DirectMarketingOutboundTelemarketing, + DirectMarketingSubscription, + DirectMarketingTravel, + DiscountStores, + Doctors, + DoorToDoorSales, + DraperyWindowCoveringAndUpholsteryStores, + DrinkingPlaces, + DrugStoresAndPharmacies, + DrugsDrugProprietariesAndDruggistSundries, + DryCleaners, + DurableGoods, + DutyFreeStores, + EatingPlacesRestaurants, + EducationalServices, + ElectricRazorStores, + ElectricVehicleCharging, + ElectricalPartsAndEquipment, + ElectricalServices, + ElectronicsRepairShops, + ElectronicsStores, + ElementarySecondarySchools, + EmergencyServicesGcasVisaUseOnly, + EmploymentTempAgencies, + EquipmentRental, + ExterminatingServices, + FamilyClothingStores, + FastFoodRestaurants, + FinancialInstitutions, + FinesGovernmentAdministrativeEntities, + FireplaceFireplaceScreensAndAccessoriesStores, + FloorCoveringStores, + Florists, + FloristsSuppliesNurseryStockAndFlowers, + FreezerAndLockerMeatProvisioners, + FuelDealersNonAutomotive, + FuneralServicesCrematories, + FurnitureHomeFurnishingsAndEquipmentStoresExceptAppliances, + FurnitureRepairRefinishing, + FurriersAndFurShops, + GeneralServices, + GiftCardNoveltyAndSouvenirShops, + GlassPaintAndWallpaperStores, + GlasswareCrystalStores, + GolfCoursesPublic, + GovernmentLicensedHorseDogRacingUsRegionOnly, + GovernmentLicensedOnlineCasionsOnlineGamblingUsRegionOnly, + GovernmentOwnedLotteriesNonUsRegion, + GovernmentOwnedLotteriesUsRegionOnly, + GovernmentServices, + GroceryStoresSupermarkets, + HardwareEquipmentAndSupplies, + HardwareStores, + HealthAndBeautySpas, + HearingAidsSalesAndSupplies, + HeatingPlumbingAC, + HobbyToyAndGameShops, + HomeSupplyWarehouseStores, + Hospitals, + HotelsMotelsAndResorts, + HouseholdApplianceStores, + IndustrialSupplies, + InformationRetrievalServices, + InsuranceDefault, + InsuranceUnderwritingPremiums, + IntraCompanyPurchases, + JewelryStoresWatchesClocksAndSilverwareStores, + LandscapingServices, + Laundries, + LaundryCleaningServices, + LegalServicesAttorneys, + LuggageAndLeatherGoodsStores, + LumberBuildingMaterialsStores, + ManualCashDisburse, + MarinasServiceAndSupplies, + Marketplaces, + MasonryStoneworkAndPlaster, + MassageParlors, + MedicalAndDentalLabs, + MedicalDentalOphthalmicAndHospitalEquipmentAndSupplies, + MedicalServices, + MembershipOrganizations, + MensAndBoysClothingAndAccessoriesStores, + MensWomensClothingStores, + MetalServiceCenters, + Miscellaneous, + MiscellaneousApparelAndAccessoryShops, + MiscellaneousAutoDealers, + MiscellaneousBusinessServices, + MiscellaneousFoodStores, + MiscellaneousGeneralMerchandise, + MiscellaneousGeneralServices, + MiscellaneousHomeFurnishingSpecialtyStores, + MiscellaneousPublishingAndPrinting, + MiscellaneousRecreationServices, + MiscellaneousRepairShops, + MiscellaneousSpecialtyRetail, + MobileHomeDealers, + MotionPictureTheaters, + MotorFreightCarriersAndTrucking, + MotorHomesDealers, + MotorVehicleSuppliesAndNewParts, + MotorcycleShopsAndDealers, + MotorcycleShopsDealers, + MusicStoresMusicalInstrumentsPianosAndSheetMusic, + NewsDealersAndNewsstands, + NonFiMoneyOrders, + NonFiStoredValueCardPurchaseLoad, + NondurableGoods, + NurseriesLawnAndGardenSupplyStores, + NursingPersonalCare, + OfficeAndCommercialFurniture, + OpticiansEyeglasses, + OptometristsOphthalmologist, + OrthopedicGoodsProstheticDevices, + Osteopaths, + PackageStoresBeerWineAndLiquor, + PaintsVarnishesAndSupplies, + ParkingLotsGarages, + PassengerRailways, + PawnShops, + PetShopsPetFoodAndSupplies, + PetroleumAndPetroleumProducts, + PhotoDeveloping, + PhotographicPhotocopyMicrofilmEquipmentAndSupplies, + PhotographicStudios, + PictureVideoProduction, + PieceGoodsNotionsAndOtherDryGoods, + PlumbingHeatingEquipmentAndSupplies, + PoliticalOrganizations, + PostalServicesGovernmentOnly, + PreciousStonesAndMetalsWatchesAndJewelry, + ProfessionalServices, + PublicWarehousingAndStorage, + QuickCopyReproAndBlueprint, + Railroads, + RealEstateAgentsAndManagersRentals, + RecordStores, + RecreationalVehicleRentals, + ReligiousGoodsStores, + ReligiousOrganizations, + RoofingSidingSheetMetal, + SecretarialSupportServices, + SecurityBrokersDealers, + ServiceStations, + SewingNeedleworkFabricAndPieceGoodsStores, + ShoeRepairHatCleaning, + ShoeStores, + SmallApplianceRepair, + SnowmobileDealers, + SpecialTradeServices, + SpecialtyCleaning, + SportingGoodsStores, + SportingRecreationCamps, + SportsAndRidingApparelStores, + SportsClubsFields, + StampAndCoinStores, + StationaryOfficeSuppliesPrintingAndWritingPaper, + StationeryStoresOfficeAndSchoolSupplyStores, + SwimmingPoolsSales, + TUiTravelGermany, + TailorsAlterations, + TaxPaymentsGovernmentAgencies, + TaxPreparationServices, + TaxicabsLimousines, + TelecommunicationEquipmentAndTelephoneSales, + TelecommunicationServices, + TelegraphServices, + TentAndAwningShops, + TestingLaboratories, + TheatricalTicketAgencies, + Timeshares, + TireRetreadingAndRepair, + TollsBridgeFees, + TouristAttractionsAndExhibits, + TowingServices, + TrailerParksCampgrounds, + TransportationServices, + TravelAgenciesTourOperators, + TruckStopIteration, + TruckUtilityTrailerRentals, + TypesettingPlateMakingAndRelatedServices, + TypewriterStores, + USFederalGovernmentAgenciesOrDepartments, + UniformsCommercialClothing, + UsedMerchandiseAndSecondhandStores, + Utilities, + VarietyStores, + VeterinaryServices, + VideoAmusementGameSupplies, + VideoGameArcades, + VideoTapeRentalStores, + VocationalTradeSchools, + WatchJewelryRepair, + WeldingRepair, + WholesaleClubs, + WigAndToupeeStores, + WiresMoneyOrders, + WomensAccessoryAndSpecialtyShops, + WomensReadyToWearStores, + WreckingAndSalvageYards, + /// An unrecognized value from Stripe. Should not be used as a request parameter. + Unknown, +} +impl UpdateIssuingCardholderSpendingControlsSpendingLimitsCategories { + pub fn as_str(self) -> &'static str { + use UpdateIssuingCardholderSpendingControlsSpendingLimitsCategories::*; + match self { + AcRefrigerationRepair => "ac_refrigeration_repair", + AccountingBookkeepingServices => "accounting_bookkeeping_services", + AdvertisingServices => "advertising_services", + AgriculturalCooperative => "agricultural_cooperative", + AirlinesAirCarriers => "airlines_air_carriers", + AirportsFlyingFields => "airports_flying_fields", + AmbulanceServices => "ambulance_services", + AmusementParksCarnivals => "amusement_parks_carnivals", + AntiqueReproductions => "antique_reproductions", + AntiqueShops => "antique_shops", + Aquariums => "aquariums", + ArchitecturalSurveyingServices => "architectural_surveying_services", + ArtDealersAndGalleries => "art_dealers_and_galleries", + ArtistsSupplyAndCraftShops => "artists_supply_and_craft_shops", + AutoAndHomeSupplyStores => "auto_and_home_supply_stores", + AutoBodyRepairShops => "auto_body_repair_shops", + AutoPaintShops => "auto_paint_shops", + AutoServiceShops => "auto_service_shops", + AutomatedCashDisburse => "automated_cash_disburse", + AutomatedFuelDispensers => "automated_fuel_dispensers", + AutomobileAssociations => "automobile_associations", + AutomotivePartsAndAccessoriesStores => "automotive_parts_and_accessories_stores", + AutomotiveTireStores => "automotive_tire_stores", + BailAndBondPayments => "bail_and_bond_payments", + Bakeries => "bakeries", + BandsOrchestras => "bands_orchestras", + BarberAndBeautyShops => "barber_and_beauty_shops", + BettingCasinoGambling => "betting_casino_gambling", + BicycleShops => "bicycle_shops", + BilliardPoolEstablishments => "billiard_pool_establishments", + BoatDealers => "boat_dealers", + BoatRentalsAndLeases => "boat_rentals_and_leases", + BookStores => "book_stores", + BooksPeriodicalsAndNewspapers => "books_periodicals_and_newspapers", + BowlingAlleys => "bowling_alleys", + BusLines => "bus_lines", + BusinessSecretarialSchools => "business_secretarial_schools", + BuyingShoppingServices => "buying_shopping_services", + CableSatelliteAndOtherPayTelevisionAndRadio => { + "cable_satellite_and_other_pay_television_and_radio" + } + CameraAndPhotographicSupplyStores => "camera_and_photographic_supply_stores", + CandyNutAndConfectioneryStores => "candy_nut_and_confectionery_stores", + CarAndTruckDealersNewUsed => "car_and_truck_dealers_new_used", + CarAndTruckDealersUsedOnly => "car_and_truck_dealers_used_only", + CarRentalAgencies => "car_rental_agencies", + CarWashes => "car_washes", + CarpentryServices => "carpentry_services", + CarpetUpholsteryCleaning => "carpet_upholstery_cleaning", + Caterers => "caterers", + CharitableAndSocialServiceOrganizationsFundraising => { + "charitable_and_social_service_organizations_fundraising" + } + ChemicalsAndAlliedProducts => "chemicals_and_allied_products", + ChildCareServices => "child_care_services", + ChildrensAndInfantsWearStores => "childrens_and_infants_wear_stores", + ChiropodistsPodiatrists => "chiropodists_podiatrists", + Chiropractors => "chiropractors", + CigarStoresAndStands => "cigar_stores_and_stands", + CivicSocialFraternalAssociations => "civic_social_fraternal_associations", + CleaningAndMaintenance => "cleaning_and_maintenance", + ClothingRental => "clothing_rental", + CollegesUniversities => "colleges_universities", + CommercialEquipment => "commercial_equipment", + CommercialFootwear => "commercial_footwear", + CommercialPhotographyArtAndGraphics => "commercial_photography_art_and_graphics", + CommuterTransportAndFerries => "commuter_transport_and_ferries", + ComputerNetworkServices => "computer_network_services", + ComputerProgramming => "computer_programming", + ComputerRepair => "computer_repair", + ComputerSoftwareStores => "computer_software_stores", + ComputersPeripheralsAndSoftware => "computers_peripherals_and_software", + ConcreteWorkServices => "concrete_work_services", + ConstructionMaterials => "construction_materials", + ConsultingPublicRelations => "consulting_public_relations", + CorrespondenceSchools => "correspondence_schools", + CosmeticStores => "cosmetic_stores", + CounselingServices => "counseling_services", + CountryClubs => "country_clubs", + CourierServices => "courier_services", + CourtCosts => "court_costs", + CreditReportingAgencies => "credit_reporting_agencies", + CruiseLines => "cruise_lines", + DairyProductsStores => "dairy_products_stores", + DanceHallStudiosSchools => "dance_hall_studios_schools", + DatingEscortServices => "dating_escort_services", + DentistsOrthodontists => "dentists_orthodontists", + DepartmentStores => "department_stores", + DetectiveAgencies => "detective_agencies", + DigitalGoodsApplications => "digital_goods_applications", + DigitalGoodsGames => "digital_goods_games", + DigitalGoodsLargeVolume => "digital_goods_large_volume", + DigitalGoodsMedia => "digital_goods_media", + DirectMarketingCatalogMerchant => "direct_marketing_catalog_merchant", + DirectMarketingCombinationCatalogAndRetailMerchant => { + "direct_marketing_combination_catalog_and_retail_merchant" + } + DirectMarketingInboundTelemarketing => "direct_marketing_inbound_telemarketing", + DirectMarketingInsuranceServices => "direct_marketing_insurance_services", + DirectMarketingOther => "direct_marketing_other", + DirectMarketingOutboundTelemarketing => "direct_marketing_outbound_telemarketing", + DirectMarketingSubscription => "direct_marketing_subscription", + DirectMarketingTravel => "direct_marketing_travel", + DiscountStores => "discount_stores", + Doctors => "doctors", + DoorToDoorSales => "door_to_door_sales", + DraperyWindowCoveringAndUpholsteryStores => { + "drapery_window_covering_and_upholstery_stores" + } + DrinkingPlaces => "drinking_places", + DrugStoresAndPharmacies => "drug_stores_and_pharmacies", + DrugsDrugProprietariesAndDruggistSundries => { + "drugs_drug_proprietaries_and_druggist_sundries" + } + DryCleaners => "dry_cleaners", + DurableGoods => "durable_goods", + DutyFreeStores => "duty_free_stores", + EatingPlacesRestaurants => "eating_places_restaurants", + EducationalServices => "educational_services", + ElectricRazorStores => "electric_razor_stores", + ElectricVehicleCharging => "electric_vehicle_charging", + ElectricalPartsAndEquipment => "electrical_parts_and_equipment", + ElectricalServices => "electrical_services", + ElectronicsRepairShops => "electronics_repair_shops", + ElectronicsStores => "electronics_stores", + ElementarySecondarySchools => "elementary_secondary_schools", + EmergencyServicesGcasVisaUseOnly => "emergency_services_gcas_visa_use_only", + EmploymentTempAgencies => "employment_temp_agencies", + EquipmentRental => "equipment_rental", + ExterminatingServices => "exterminating_services", + FamilyClothingStores => "family_clothing_stores", + FastFoodRestaurants => "fast_food_restaurants", + FinancialInstitutions => "financial_institutions", + FinesGovernmentAdministrativeEntities => "fines_government_administrative_entities", + FireplaceFireplaceScreensAndAccessoriesStores => { + "fireplace_fireplace_screens_and_accessories_stores" + } + FloorCoveringStores => "floor_covering_stores", + Florists => "florists", + FloristsSuppliesNurseryStockAndFlowers => "florists_supplies_nursery_stock_and_flowers", + FreezerAndLockerMeatProvisioners => "freezer_and_locker_meat_provisioners", + FuelDealersNonAutomotive => "fuel_dealers_non_automotive", + FuneralServicesCrematories => "funeral_services_crematories", + FurnitureHomeFurnishingsAndEquipmentStoresExceptAppliances => { + "furniture_home_furnishings_and_equipment_stores_except_appliances" + } + FurnitureRepairRefinishing => "furniture_repair_refinishing", + FurriersAndFurShops => "furriers_and_fur_shops", + GeneralServices => "general_services", + GiftCardNoveltyAndSouvenirShops => "gift_card_novelty_and_souvenir_shops", + GlassPaintAndWallpaperStores => "glass_paint_and_wallpaper_stores", + GlasswareCrystalStores => "glassware_crystal_stores", + GolfCoursesPublic => "golf_courses_public", + GovernmentLicensedHorseDogRacingUsRegionOnly => { + "government_licensed_horse_dog_racing_us_region_only" + } + GovernmentLicensedOnlineCasionsOnlineGamblingUsRegionOnly => { + "government_licensed_online_casions_online_gambling_us_region_only" + } + GovernmentOwnedLotteriesNonUsRegion => "government_owned_lotteries_non_us_region", + GovernmentOwnedLotteriesUsRegionOnly => "government_owned_lotteries_us_region_only", + GovernmentServices => "government_services", + GroceryStoresSupermarkets => "grocery_stores_supermarkets", + HardwareEquipmentAndSupplies => "hardware_equipment_and_supplies", + HardwareStores => "hardware_stores", + HealthAndBeautySpas => "health_and_beauty_spas", + HearingAidsSalesAndSupplies => "hearing_aids_sales_and_supplies", + HeatingPlumbingAC => "heating_plumbing_a_c", + HobbyToyAndGameShops => "hobby_toy_and_game_shops", + HomeSupplyWarehouseStores => "home_supply_warehouse_stores", + Hospitals => "hospitals", + HotelsMotelsAndResorts => "hotels_motels_and_resorts", + HouseholdApplianceStores => "household_appliance_stores", + IndustrialSupplies => "industrial_supplies", + InformationRetrievalServices => "information_retrieval_services", + InsuranceDefault => "insurance_default", + InsuranceUnderwritingPremiums => "insurance_underwriting_premiums", + IntraCompanyPurchases => "intra_company_purchases", + JewelryStoresWatchesClocksAndSilverwareStores => { + "jewelry_stores_watches_clocks_and_silverware_stores" + } + LandscapingServices => "landscaping_services", + Laundries => "laundries", + LaundryCleaningServices => "laundry_cleaning_services", + LegalServicesAttorneys => "legal_services_attorneys", + LuggageAndLeatherGoodsStores => "luggage_and_leather_goods_stores", + LumberBuildingMaterialsStores => "lumber_building_materials_stores", + ManualCashDisburse => "manual_cash_disburse", + MarinasServiceAndSupplies => "marinas_service_and_supplies", + Marketplaces => "marketplaces", + MasonryStoneworkAndPlaster => "masonry_stonework_and_plaster", + MassageParlors => "massage_parlors", + MedicalAndDentalLabs => "medical_and_dental_labs", + MedicalDentalOphthalmicAndHospitalEquipmentAndSupplies => { + "medical_dental_ophthalmic_and_hospital_equipment_and_supplies" + } + MedicalServices => "medical_services", + MembershipOrganizations => "membership_organizations", + MensAndBoysClothingAndAccessoriesStores => { + "mens_and_boys_clothing_and_accessories_stores" + } + MensWomensClothingStores => "mens_womens_clothing_stores", + MetalServiceCenters => "metal_service_centers", + Miscellaneous => "miscellaneous", + MiscellaneousApparelAndAccessoryShops => "miscellaneous_apparel_and_accessory_shops", + MiscellaneousAutoDealers => "miscellaneous_auto_dealers", + MiscellaneousBusinessServices => "miscellaneous_business_services", + MiscellaneousFoodStores => "miscellaneous_food_stores", + MiscellaneousGeneralMerchandise => "miscellaneous_general_merchandise", + MiscellaneousGeneralServices => "miscellaneous_general_services", + MiscellaneousHomeFurnishingSpecialtyStores => { + "miscellaneous_home_furnishing_specialty_stores" + } + MiscellaneousPublishingAndPrinting => "miscellaneous_publishing_and_printing", + MiscellaneousRecreationServices => "miscellaneous_recreation_services", + MiscellaneousRepairShops => "miscellaneous_repair_shops", + MiscellaneousSpecialtyRetail => "miscellaneous_specialty_retail", + MobileHomeDealers => "mobile_home_dealers", + MotionPictureTheaters => "motion_picture_theaters", + MotorFreightCarriersAndTrucking => "motor_freight_carriers_and_trucking", + MotorHomesDealers => "motor_homes_dealers", + MotorVehicleSuppliesAndNewParts => "motor_vehicle_supplies_and_new_parts", + MotorcycleShopsAndDealers => "motorcycle_shops_and_dealers", + MotorcycleShopsDealers => "motorcycle_shops_dealers", + MusicStoresMusicalInstrumentsPianosAndSheetMusic => { + "music_stores_musical_instruments_pianos_and_sheet_music" + } + NewsDealersAndNewsstands => "news_dealers_and_newsstands", + NonFiMoneyOrders => "non_fi_money_orders", + NonFiStoredValueCardPurchaseLoad => "non_fi_stored_value_card_purchase_load", + NondurableGoods => "nondurable_goods", + NurseriesLawnAndGardenSupplyStores => "nurseries_lawn_and_garden_supply_stores", + NursingPersonalCare => "nursing_personal_care", + OfficeAndCommercialFurniture => "office_and_commercial_furniture", + OpticiansEyeglasses => "opticians_eyeglasses", + OptometristsOphthalmologist => "optometrists_ophthalmologist", + OrthopedicGoodsProstheticDevices => "orthopedic_goods_prosthetic_devices", + Osteopaths => "osteopaths", + PackageStoresBeerWineAndLiquor => "package_stores_beer_wine_and_liquor", + PaintsVarnishesAndSupplies => "paints_varnishes_and_supplies", + ParkingLotsGarages => "parking_lots_garages", + PassengerRailways => "passenger_railways", + PawnShops => "pawn_shops", + PetShopsPetFoodAndSupplies => "pet_shops_pet_food_and_supplies", + PetroleumAndPetroleumProducts => "petroleum_and_petroleum_products", + PhotoDeveloping => "photo_developing", + PhotographicPhotocopyMicrofilmEquipmentAndSupplies => { + "photographic_photocopy_microfilm_equipment_and_supplies" + } + PhotographicStudios => "photographic_studios", + PictureVideoProduction => "picture_video_production", + PieceGoodsNotionsAndOtherDryGoods => "piece_goods_notions_and_other_dry_goods", + PlumbingHeatingEquipmentAndSupplies => "plumbing_heating_equipment_and_supplies", + PoliticalOrganizations => "political_organizations", + PostalServicesGovernmentOnly => "postal_services_government_only", + PreciousStonesAndMetalsWatchesAndJewelry => { + "precious_stones_and_metals_watches_and_jewelry" + } + ProfessionalServices => "professional_services", + PublicWarehousingAndStorage => "public_warehousing_and_storage", + QuickCopyReproAndBlueprint => "quick_copy_repro_and_blueprint", + Railroads => "railroads", + RealEstateAgentsAndManagersRentals => "real_estate_agents_and_managers_rentals", + RecordStores => "record_stores", + RecreationalVehicleRentals => "recreational_vehicle_rentals", + ReligiousGoodsStores => "religious_goods_stores", + ReligiousOrganizations => "religious_organizations", + RoofingSidingSheetMetal => "roofing_siding_sheet_metal", + SecretarialSupportServices => "secretarial_support_services", + SecurityBrokersDealers => "security_brokers_dealers", + ServiceStations => "service_stations", + SewingNeedleworkFabricAndPieceGoodsStores => { + "sewing_needlework_fabric_and_piece_goods_stores" + } + ShoeRepairHatCleaning => "shoe_repair_hat_cleaning", + ShoeStores => "shoe_stores", + SmallApplianceRepair => "small_appliance_repair", + SnowmobileDealers => "snowmobile_dealers", + SpecialTradeServices => "special_trade_services", + SpecialtyCleaning => "specialty_cleaning", + SportingGoodsStores => "sporting_goods_stores", + SportingRecreationCamps => "sporting_recreation_camps", + SportsAndRidingApparelStores => "sports_and_riding_apparel_stores", + SportsClubsFields => "sports_clubs_fields", + StampAndCoinStores => "stamp_and_coin_stores", + StationaryOfficeSuppliesPrintingAndWritingPaper => { + "stationary_office_supplies_printing_and_writing_paper" + } + StationeryStoresOfficeAndSchoolSupplyStores => { + "stationery_stores_office_and_school_supply_stores" + } + SwimmingPoolsSales => "swimming_pools_sales", + TUiTravelGermany => "t_ui_travel_germany", + TailorsAlterations => "tailors_alterations", + TaxPaymentsGovernmentAgencies => "tax_payments_government_agencies", + TaxPreparationServices => "tax_preparation_services", + TaxicabsLimousines => "taxicabs_limousines", + TelecommunicationEquipmentAndTelephoneSales => { + "telecommunication_equipment_and_telephone_sales" + } + TelecommunicationServices => "telecommunication_services", + TelegraphServices => "telegraph_services", + TentAndAwningShops => "tent_and_awning_shops", + TestingLaboratories => "testing_laboratories", + TheatricalTicketAgencies => "theatrical_ticket_agencies", + Timeshares => "timeshares", + TireRetreadingAndRepair => "tire_retreading_and_repair", + TollsBridgeFees => "tolls_bridge_fees", + TouristAttractionsAndExhibits => "tourist_attractions_and_exhibits", + TowingServices => "towing_services", + TrailerParksCampgrounds => "trailer_parks_campgrounds", + TransportationServices => "transportation_services", + TravelAgenciesTourOperators => "travel_agencies_tour_operators", + TruckStopIteration => "truck_stop_iteration", + TruckUtilityTrailerRentals => "truck_utility_trailer_rentals", + TypesettingPlateMakingAndRelatedServices => { + "typesetting_plate_making_and_related_services" + } + TypewriterStores => "typewriter_stores", + USFederalGovernmentAgenciesOrDepartments => { + "u_s_federal_government_agencies_or_departments" + } + UniformsCommercialClothing => "uniforms_commercial_clothing", + UsedMerchandiseAndSecondhandStores => "used_merchandise_and_secondhand_stores", + Utilities => "utilities", + VarietyStores => "variety_stores", + VeterinaryServices => "veterinary_services", + VideoAmusementGameSupplies => "video_amusement_game_supplies", + VideoGameArcades => "video_game_arcades", + VideoTapeRentalStores => "video_tape_rental_stores", + VocationalTradeSchools => "vocational_trade_schools", + WatchJewelryRepair => "watch_jewelry_repair", + WeldingRepair => "welding_repair", + WholesaleClubs => "wholesale_clubs", + WigAndToupeeStores => "wig_and_toupee_stores", + WiresMoneyOrders => "wires_money_orders", + WomensAccessoryAndSpecialtyShops => "womens_accessory_and_specialty_shops", + WomensReadyToWearStores => "womens_ready_to_wear_stores", + WreckingAndSalvageYards => "wrecking_and_salvage_yards", + Unknown => "unknown", + } + } +} + +impl std::str::FromStr for UpdateIssuingCardholderSpendingControlsSpendingLimitsCategories { + type Err = (); + fn from_str(s: &str) -> Result { + use UpdateIssuingCardholderSpendingControlsSpendingLimitsCategories::*; + match s { + "ac_refrigeration_repair" => Ok(AcRefrigerationRepair), + "accounting_bookkeeping_services" => Ok(AccountingBookkeepingServices), + "advertising_services" => Ok(AdvertisingServices), + "agricultural_cooperative" => Ok(AgriculturalCooperative), + "airlines_air_carriers" => Ok(AirlinesAirCarriers), + "airports_flying_fields" => Ok(AirportsFlyingFields), + "ambulance_services" => Ok(AmbulanceServices), + "amusement_parks_carnivals" => Ok(AmusementParksCarnivals), + "antique_reproductions" => Ok(AntiqueReproductions), + "antique_shops" => Ok(AntiqueShops), + "aquariums" => Ok(Aquariums), + "architectural_surveying_services" => Ok(ArchitecturalSurveyingServices), + "art_dealers_and_galleries" => Ok(ArtDealersAndGalleries), + "artists_supply_and_craft_shops" => Ok(ArtistsSupplyAndCraftShops), + "auto_and_home_supply_stores" => Ok(AutoAndHomeSupplyStores), + "auto_body_repair_shops" => Ok(AutoBodyRepairShops), + "auto_paint_shops" => Ok(AutoPaintShops), + "auto_service_shops" => Ok(AutoServiceShops), + "automated_cash_disburse" => Ok(AutomatedCashDisburse), + "automated_fuel_dispensers" => Ok(AutomatedFuelDispensers), + "automobile_associations" => Ok(AutomobileAssociations), + "automotive_parts_and_accessories_stores" => Ok(AutomotivePartsAndAccessoriesStores), + "automotive_tire_stores" => Ok(AutomotiveTireStores), + "bail_and_bond_payments" => Ok(BailAndBondPayments), + "bakeries" => Ok(Bakeries), + "bands_orchestras" => Ok(BandsOrchestras), + "barber_and_beauty_shops" => Ok(BarberAndBeautyShops), + "betting_casino_gambling" => Ok(BettingCasinoGambling), + "bicycle_shops" => Ok(BicycleShops), + "billiard_pool_establishments" => Ok(BilliardPoolEstablishments), + "boat_dealers" => Ok(BoatDealers), + "boat_rentals_and_leases" => Ok(BoatRentalsAndLeases), + "book_stores" => Ok(BookStores), + "books_periodicals_and_newspapers" => Ok(BooksPeriodicalsAndNewspapers), + "bowling_alleys" => Ok(BowlingAlleys), + "bus_lines" => Ok(BusLines), + "business_secretarial_schools" => Ok(BusinessSecretarialSchools), + "buying_shopping_services" => Ok(BuyingShoppingServices), + "cable_satellite_and_other_pay_television_and_radio" => { + Ok(CableSatelliteAndOtherPayTelevisionAndRadio) + } + "camera_and_photographic_supply_stores" => Ok(CameraAndPhotographicSupplyStores), + "candy_nut_and_confectionery_stores" => Ok(CandyNutAndConfectioneryStores), + "car_and_truck_dealers_new_used" => Ok(CarAndTruckDealersNewUsed), + "car_and_truck_dealers_used_only" => Ok(CarAndTruckDealersUsedOnly), + "car_rental_agencies" => Ok(CarRentalAgencies), + "car_washes" => Ok(CarWashes), + "carpentry_services" => Ok(CarpentryServices), + "carpet_upholstery_cleaning" => Ok(CarpetUpholsteryCleaning), + "caterers" => Ok(Caterers), + "charitable_and_social_service_organizations_fundraising" => { + Ok(CharitableAndSocialServiceOrganizationsFundraising) + } + "chemicals_and_allied_products" => Ok(ChemicalsAndAlliedProducts), + "child_care_services" => Ok(ChildCareServices), + "childrens_and_infants_wear_stores" => Ok(ChildrensAndInfantsWearStores), + "chiropodists_podiatrists" => Ok(ChiropodistsPodiatrists), + "chiropractors" => Ok(Chiropractors), + "cigar_stores_and_stands" => Ok(CigarStoresAndStands), + "civic_social_fraternal_associations" => Ok(CivicSocialFraternalAssociations), + "cleaning_and_maintenance" => Ok(CleaningAndMaintenance), + "clothing_rental" => Ok(ClothingRental), + "colleges_universities" => Ok(CollegesUniversities), + "commercial_equipment" => Ok(CommercialEquipment), + "commercial_footwear" => Ok(CommercialFootwear), + "commercial_photography_art_and_graphics" => Ok(CommercialPhotographyArtAndGraphics), + "commuter_transport_and_ferries" => Ok(CommuterTransportAndFerries), + "computer_network_services" => Ok(ComputerNetworkServices), + "computer_programming" => Ok(ComputerProgramming), + "computer_repair" => Ok(ComputerRepair), + "computer_software_stores" => Ok(ComputerSoftwareStores), + "computers_peripherals_and_software" => Ok(ComputersPeripheralsAndSoftware), + "concrete_work_services" => Ok(ConcreteWorkServices), + "construction_materials" => Ok(ConstructionMaterials), + "consulting_public_relations" => Ok(ConsultingPublicRelations), + "correspondence_schools" => Ok(CorrespondenceSchools), + "cosmetic_stores" => Ok(CosmeticStores), + "counseling_services" => Ok(CounselingServices), + "country_clubs" => Ok(CountryClubs), + "courier_services" => Ok(CourierServices), + "court_costs" => Ok(CourtCosts), + "credit_reporting_agencies" => Ok(CreditReportingAgencies), + "cruise_lines" => Ok(CruiseLines), + "dairy_products_stores" => Ok(DairyProductsStores), + "dance_hall_studios_schools" => Ok(DanceHallStudiosSchools), + "dating_escort_services" => Ok(DatingEscortServices), + "dentists_orthodontists" => Ok(DentistsOrthodontists), + "department_stores" => Ok(DepartmentStores), + "detective_agencies" => Ok(DetectiveAgencies), + "digital_goods_applications" => Ok(DigitalGoodsApplications), + "digital_goods_games" => Ok(DigitalGoodsGames), + "digital_goods_large_volume" => Ok(DigitalGoodsLargeVolume), + "digital_goods_media" => Ok(DigitalGoodsMedia), + "direct_marketing_catalog_merchant" => Ok(DirectMarketingCatalogMerchant), + "direct_marketing_combination_catalog_and_retail_merchant" => { + Ok(DirectMarketingCombinationCatalogAndRetailMerchant) + } + "direct_marketing_inbound_telemarketing" => Ok(DirectMarketingInboundTelemarketing), + "direct_marketing_insurance_services" => Ok(DirectMarketingInsuranceServices), + "direct_marketing_other" => Ok(DirectMarketingOther), + "direct_marketing_outbound_telemarketing" => Ok(DirectMarketingOutboundTelemarketing), + "direct_marketing_subscription" => Ok(DirectMarketingSubscription), + "direct_marketing_travel" => Ok(DirectMarketingTravel), + "discount_stores" => Ok(DiscountStores), + "doctors" => Ok(Doctors), + "door_to_door_sales" => Ok(DoorToDoorSales), + "drapery_window_covering_and_upholstery_stores" => { + Ok(DraperyWindowCoveringAndUpholsteryStores) + } + "drinking_places" => Ok(DrinkingPlaces), + "drug_stores_and_pharmacies" => Ok(DrugStoresAndPharmacies), + "drugs_drug_proprietaries_and_druggist_sundries" => { + Ok(DrugsDrugProprietariesAndDruggistSundries) + } + "dry_cleaners" => Ok(DryCleaners), + "durable_goods" => Ok(DurableGoods), + "duty_free_stores" => Ok(DutyFreeStores), + "eating_places_restaurants" => Ok(EatingPlacesRestaurants), + "educational_services" => Ok(EducationalServices), + "electric_razor_stores" => Ok(ElectricRazorStores), + "electric_vehicle_charging" => Ok(ElectricVehicleCharging), + "electrical_parts_and_equipment" => Ok(ElectricalPartsAndEquipment), + "electrical_services" => Ok(ElectricalServices), + "electronics_repair_shops" => Ok(ElectronicsRepairShops), + "electronics_stores" => Ok(ElectronicsStores), + "elementary_secondary_schools" => Ok(ElementarySecondarySchools), + "emergency_services_gcas_visa_use_only" => Ok(EmergencyServicesGcasVisaUseOnly), + "employment_temp_agencies" => Ok(EmploymentTempAgencies), + "equipment_rental" => Ok(EquipmentRental), + "exterminating_services" => Ok(ExterminatingServices), + "family_clothing_stores" => Ok(FamilyClothingStores), + "fast_food_restaurants" => Ok(FastFoodRestaurants), + "financial_institutions" => Ok(FinancialInstitutions), + "fines_government_administrative_entities" => Ok(FinesGovernmentAdministrativeEntities), + "fireplace_fireplace_screens_and_accessories_stores" => { + Ok(FireplaceFireplaceScreensAndAccessoriesStores) + } + "floor_covering_stores" => Ok(FloorCoveringStores), + "florists" => Ok(Florists), + "florists_supplies_nursery_stock_and_flowers" => { + Ok(FloristsSuppliesNurseryStockAndFlowers) + } + "freezer_and_locker_meat_provisioners" => Ok(FreezerAndLockerMeatProvisioners), + "fuel_dealers_non_automotive" => Ok(FuelDealersNonAutomotive), + "funeral_services_crematories" => Ok(FuneralServicesCrematories), + "furniture_home_furnishings_and_equipment_stores_except_appliances" => { + Ok(FurnitureHomeFurnishingsAndEquipmentStoresExceptAppliances) + } + "furniture_repair_refinishing" => Ok(FurnitureRepairRefinishing), + "furriers_and_fur_shops" => Ok(FurriersAndFurShops), + "general_services" => Ok(GeneralServices), + "gift_card_novelty_and_souvenir_shops" => Ok(GiftCardNoveltyAndSouvenirShops), + "glass_paint_and_wallpaper_stores" => Ok(GlassPaintAndWallpaperStores), + "glassware_crystal_stores" => Ok(GlasswareCrystalStores), + "golf_courses_public" => Ok(GolfCoursesPublic), + "government_licensed_horse_dog_racing_us_region_only" => { + Ok(GovernmentLicensedHorseDogRacingUsRegionOnly) + } + "government_licensed_online_casions_online_gambling_us_region_only" => { + Ok(GovernmentLicensedOnlineCasionsOnlineGamblingUsRegionOnly) + } + "government_owned_lotteries_non_us_region" => Ok(GovernmentOwnedLotteriesNonUsRegion), + "government_owned_lotteries_us_region_only" => Ok(GovernmentOwnedLotteriesUsRegionOnly), + "government_services" => Ok(GovernmentServices), + "grocery_stores_supermarkets" => Ok(GroceryStoresSupermarkets), + "hardware_equipment_and_supplies" => Ok(HardwareEquipmentAndSupplies), + "hardware_stores" => Ok(HardwareStores), + "health_and_beauty_spas" => Ok(HealthAndBeautySpas), + "hearing_aids_sales_and_supplies" => Ok(HearingAidsSalesAndSupplies), + "heating_plumbing_a_c" => Ok(HeatingPlumbingAC), + "hobby_toy_and_game_shops" => Ok(HobbyToyAndGameShops), + "home_supply_warehouse_stores" => Ok(HomeSupplyWarehouseStores), + "hospitals" => Ok(Hospitals), + "hotels_motels_and_resorts" => Ok(HotelsMotelsAndResorts), + "household_appliance_stores" => Ok(HouseholdApplianceStores), + "industrial_supplies" => Ok(IndustrialSupplies), + "information_retrieval_services" => Ok(InformationRetrievalServices), + "insurance_default" => Ok(InsuranceDefault), + "insurance_underwriting_premiums" => Ok(InsuranceUnderwritingPremiums), + "intra_company_purchases" => Ok(IntraCompanyPurchases), + "jewelry_stores_watches_clocks_and_silverware_stores" => { + Ok(JewelryStoresWatchesClocksAndSilverwareStores) + } + "landscaping_services" => Ok(LandscapingServices), + "laundries" => Ok(Laundries), + "laundry_cleaning_services" => Ok(LaundryCleaningServices), + "legal_services_attorneys" => Ok(LegalServicesAttorneys), + "luggage_and_leather_goods_stores" => Ok(LuggageAndLeatherGoodsStores), + "lumber_building_materials_stores" => Ok(LumberBuildingMaterialsStores), + "manual_cash_disburse" => Ok(ManualCashDisburse), + "marinas_service_and_supplies" => Ok(MarinasServiceAndSupplies), + "marketplaces" => Ok(Marketplaces), + "masonry_stonework_and_plaster" => Ok(MasonryStoneworkAndPlaster), + "massage_parlors" => Ok(MassageParlors), + "medical_and_dental_labs" => Ok(MedicalAndDentalLabs), + "medical_dental_ophthalmic_and_hospital_equipment_and_supplies" => { + Ok(MedicalDentalOphthalmicAndHospitalEquipmentAndSupplies) + } + "medical_services" => Ok(MedicalServices), + "membership_organizations" => Ok(MembershipOrganizations), + "mens_and_boys_clothing_and_accessories_stores" => { + Ok(MensAndBoysClothingAndAccessoriesStores) + } + "mens_womens_clothing_stores" => Ok(MensWomensClothingStores), + "metal_service_centers" => Ok(MetalServiceCenters), + "miscellaneous" => Ok(Miscellaneous), + "miscellaneous_apparel_and_accessory_shops" => { + Ok(MiscellaneousApparelAndAccessoryShops) + } + "miscellaneous_auto_dealers" => Ok(MiscellaneousAutoDealers), + "miscellaneous_business_services" => Ok(MiscellaneousBusinessServices), + "miscellaneous_food_stores" => Ok(MiscellaneousFoodStores), + "miscellaneous_general_merchandise" => Ok(MiscellaneousGeneralMerchandise), + "miscellaneous_general_services" => Ok(MiscellaneousGeneralServices), + "miscellaneous_home_furnishing_specialty_stores" => { + Ok(MiscellaneousHomeFurnishingSpecialtyStores) + } + "miscellaneous_publishing_and_printing" => Ok(MiscellaneousPublishingAndPrinting), + "miscellaneous_recreation_services" => Ok(MiscellaneousRecreationServices), + "miscellaneous_repair_shops" => Ok(MiscellaneousRepairShops), + "miscellaneous_specialty_retail" => Ok(MiscellaneousSpecialtyRetail), + "mobile_home_dealers" => Ok(MobileHomeDealers), + "motion_picture_theaters" => Ok(MotionPictureTheaters), + "motor_freight_carriers_and_trucking" => Ok(MotorFreightCarriersAndTrucking), + "motor_homes_dealers" => Ok(MotorHomesDealers), + "motor_vehicle_supplies_and_new_parts" => Ok(MotorVehicleSuppliesAndNewParts), + "motorcycle_shops_and_dealers" => Ok(MotorcycleShopsAndDealers), + "motorcycle_shops_dealers" => Ok(MotorcycleShopsDealers), + "music_stores_musical_instruments_pianos_and_sheet_music" => { + Ok(MusicStoresMusicalInstrumentsPianosAndSheetMusic) + } + "news_dealers_and_newsstands" => Ok(NewsDealersAndNewsstands), + "non_fi_money_orders" => Ok(NonFiMoneyOrders), + "non_fi_stored_value_card_purchase_load" => Ok(NonFiStoredValueCardPurchaseLoad), + "nondurable_goods" => Ok(NondurableGoods), + "nurseries_lawn_and_garden_supply_stores" => Ok(NurseriesLawnAndGardenSupplyStores), + "nursing_personal_care" => Ok(NursingPersonalCare), + "office_and_commercial_furniture" => Ok(OfficeAndCommercialFurniture), + "opticians_eyeglasses" => Ok(OpticiansEyeglasses), + "optometrists_ophthalmologist" => Ok(OptometristsOphthalmologist), + "orthopedic_goods_prosthetic_devices" => Ok(OrthopedicGoodsProstheticDevices), + "osteopaths" => Ok(Osteopaths), + "package_stores_beer_wine_and_liquor" => Ok(PackageStoresBeerWineAndLiquor), + "paints_varnishes_and_supplies" => Ok(PaintsVarnishesAndSupplies), + "parking_lots_garages" => Ok(ParkingLotsGarages), + "passenger_railways" => Ok(PassengerRailways), + "pawn_shops" => Ok(PawnShops), + "pet_shops_pet_food_and_supplies" => Ok(PetShopsPetFoodAndSupplies), + "petroleum_and_petroleum_products" => Ok(PetroleumAndPetroleumProducts), + "photo_developing" => Ok(PhotoDeveloping), + "photographic_photocopy_microfilm_equipment_and_supplies" => { + Ok(PhotographicPhotocopyMicrofilmEquipmentAndSupplies) + } + "photographic_studios" => Ok(PhotographicStudios), + "picture_video_production" => Ok(PictureVideoProduction), + "piece_goods_notions_and_other_dry_goods" => Ok(PieceGoodsNotionsAndOtherDryGoods), + "plumbing_heating_equipment_and_supplies" => Ok(PlumbingHeatingEquipmentAndSupplies), + "political_organizations" => Ok(PoliticalOrganizations), + "postal_services_government_only" => Ok(PostalServicesGovernmentOnly), + "precious_stones_and_metals_watches_and_jewelry" => { + Ok(PreciousStonesAndMetalsWatchesAndJewelry) + } + "professional_services" => Ok(ProfessionalServices), + "public_warehousing_and_storage" => Ok(PublicWarehousingAndStorage), + "quick_copy_repro_and_blueprint" => Ok(QuickCopyReproAndBlueprint), + "railroads" => Ok(Railroads), + "real_estate_agents_and_managers_rentals" => Ok(RealEstateAgentsAndManagersRentals), + "record_stores" => Ok(RecordStores), + "recreational_vehicle_rentals" => Ok(RecreationalVehicleRentals), + "religious_goods_stores" => Ok(ReligiousGoodsStores), + "religious_organizations" => Ok(ReligiousOrganizations), + "roofing_siding_sheet_metal" => Ok(RoofingSidingSheetMetal), + "secretarial_support_services" => Ok(SecretarialSupportServices), + "security_brokers_dealers" => Ok(SecurityBrokersDealers), + "service_stations" => Ok(ServiceStations), + "sewing_needlework_fabric_and_piece_goods_stores" => { + Ok(SewingNeedleworkFabricAndPieceGoodsStores) + } + "shoe_repair_hat_cleaning" => Ok(ShoeRepairHatCleaning), + "shoe_stores" => Ok(ShoeStores), + "small_appliance_repair" => Ok(SmallApplianceRepair), + "snowmobile_dealers" => Ok(SnowmobileDealers), + "special_trade_services" => Ok(SpecialTradeServices), + "specialty_cleaning" => Ok(SpecialtyCleaning), + "sporting_goods_stores" => Ok(SportingGoodsStores), + "sporting_recreation_camps" => Ok(SportingRecreationCamps), + "sports_and_riding_apparel_stores" => Ok(SportsAndRidingApparelStores), + "sports_clubs_fields" => Ok(SportsClubsFields), + "stamp_and_coin_stores" => Ok(StampAndCoinStores), + "stationary_office_supplies_printing_and_writing_paper" => { + Ok(StationaryOfficeSuppliesPrintingAndWritingPaper) + } + "stationery_stores_office_and_school_supply_stores" => { + Ok(StationeryStoresOfficeAndSchoolSupplyStores) + } + "swimming_pools_sales" => Ok(SwimmingPoolsSales), + "t_ui_travel_germany" => Ok(TUiTravelGermany), + "tailors_alterations" => Ok(TailorsAlterations), + "tax_payments_government_agencies" => Ok(TaxPaymentsGovernmentAgencies), + "tax_preparation_services" => Ok(TaxPreparationServices), + "taxicabs_limousines" => Ok(TaxicabsLimousines), + "telecommunication_equipment_and_telephone_sales" => { + Ok(TelecommunicationEquipmentAndTelephoneSales) + } + "telecommunication_services" => Ok(TelecommunicationServices), + "telegraph_services" => Ok(TelegraphServices), + "tent_and_awning_shops" => Ok(TentAndAwningShops), + "testing_laboratories" => Ok(TestingLaboratories), + "theatrical_ticket_agencies" => Ok(TheatricalTicketAgencies), + "timeshares" => Ok(Timeshares), + "tire_retreading_and_repair" => Ok(TireRetreadingAndRepair), + "tolls_bridge_fees" => Ok(TollsBridgeFees), + "tourist_attractions_and_exhibits" => Ok(TouristAttractionsAndExhibits), + "towing_services" => Ok(TowingServices), + "trailer_parks_campgrounds" => Ok(TrailerParksCampgrounds), + "transportation_services" => Ok(TransportationServices), + "travel_agencies_tour_operators" => Ok(TravelAgenciesTourOperators), + "truck_stop_iteration" => Ok(TruckStopIteration), + "truck_utility_trailer_rentals" => Ok(TruckUtilityTrailerRentals), + "typesetting_plate_making_and_related_services" => { + Ok(TypesettingPlateMakingAndRelatedServices) + } + "typewriter_stores" => Ok(TypewriterStores), + "u_s_federal_government_agencies_or_departments" => { + Ok(USFederalGovernmentAgenciesOrDepartments) + } + "uniforms_commercial_clothing" => Ok(UniformsCommercialClothing), + "used_merchandise_and_secondhand_stores" => Ok(UsedMerchandiseAndSecondhandStores), + "utilities" => Ok(Utilities), + "variety_stores" => Ok(VarietyStores), + "veterinary_services" => Ok(VeterinaryServices), + "video_amusement_game_supplies" => Ok(VideoAmusementGameSupplies), + "video_game_arcades" => Ok(VideoGameArcades), + "video_tape_rental_stores" => Ok(VideoTapeRentalStores), + "vocational_trade_schools" => Ok(VocationalTradeSchools), + "watch_jewelry_repair" => Ok(WatchJewelryRepair), + "welding_repair" => Ok(WeldingRepair), + "wholesale_clubs" => Ok(WholesaleClubs), + "wig_and_toupee_stores" => Ok(WigAndToupeeStores), + "wires_money_orders" => Ok(WiresMoneyOrders), + "womens_accessory_and_specialty_shops" => Ok(WomensAccessoryAndSpecialtyShops), + "womens_ready_to_wear_stores" => Ok(WomensReadyToWearStores), + "wrecking_and_salvage_yards" => Ok(WreckingAndSalvageYards), + _ => Err(()), + } + } +} +impl std::fmt::Display for UpdateIssuingCardholderSpendingControlsSpendingLimitsCategories { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for UpdateIssuingCardholderSpendingControlsSpendingLimitsCategories { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for UpdateIssuingCardholderSpendingControlsSpendingLimitsCategories { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Interval (or event) to which the amount applies. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum UpdateIssuingCardholderSpendingControlsSpendingLimitsInterval { + AllTime, + Daily, + Monthly, + PerAuthorization, + Weekly, + Yearly, +} +impl UpdateIssuingCardholderSpendingControlsSpendingLimitsInterval { + pub fn as_str(self) -> &'static str { + use UpdateIssuingCardholderSpendingControlsSpendingLimitsInterval::*; + match self { + AllTime => "all_time", + Daily => "daily", + Monthly => "monthly", + PerAuthorization => "per_authorization", + Weekly => "weekly", + Yearly => "yearly", + } + } +} + +impl std::str::FromStr for UpdateIssuingCardholderSpendingControlsSpendingLimitsInterval { + type Err = (); + fn from_str(s: &str) -> Result { + use UpdateIssuingCardholderSpendingControlsSpendingLimitsInterval::*; + match s { + "all_time" => Ok(AllTime), + "daily" => Ok(Daily), + "monthly" => Ok(Monthly), + "per_authorization" => Ok(PerAuthorization), + "weekly" => Ok(Weekly), + "yearly" => Ok(Yearly), + _ => Err(()), + } + } +} +impl std::fmt::Display for UpdateIssuingCardholderSpendingControlsSpendingLimitsInterval { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for UpdateIssuingCardholderSpendingControlsSpendingLimitsInterval { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for UpdateIssuingCardholderSpendingControlsSpendingLimitsInterval { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Specifies whether to permit authorizations on this cardholder's cards. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum UpdateIssuingCardholderStatus { + Active, + Inactive, +} +impl UpdateIssuingCardholderStatus { + pub fn as_str(self) -> &'static str { + use UpdateIssuingCardholderStatus::*; + match self { + Active => "active", + Inactive => "inactive", + } + } +} + +impl std::str::FromStr for UpdateIssuingCardholderStatus { + type Err = (); + fn from_str(s: &str) -> Result { + use UpdateIssuingCardholderStatus::*; + match s { + "active" => Ok(Active), + "inactive" => Ok(Inactive), + _ => Err(()), + } + } +} +impl std::fmt::Display for UpdateIssuingCardholderStatus { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for UpdateIssuingCardholderStatus { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for UpdateIssuingCardholderStatus { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'a> UpdateIssuingCardholder<'a> { + /// Updates the specified Issuing `Cardholder` object by setting the values of the parameters passed. + /// Any parameters not provided will be left unchanged. + pub fn send( + &self, + client: &stripe::Client, + cardholder: &stripe_shared::IssuingCardholderId, + ) -> stripe::Response { + client.send_form( + &format!("/issuing/cardholders/{cardholder}"), + self, + http_types::Method::Post, + ) + } +} +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct RequiredAddress<'a> { + /// City, district, suburb, town, or village. + pub city: &'a str, + /// Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). + pub country: &'a str, + /// Address line 1 (e.g., street, PO Box, or company name). + pub line1: &'a str, + /// Address line 2 (e.g., apartment, suite, unit, or building). + #[serde(skip_serializing_if = "Option::is_none")] + pub line2: Option<&'a str>, + /// ZIP or postal code. + pub postal_code: &'a str, + /// State, county, province, or region. + #[serde(skip_serializing_if = "Option::is_none")] + pub state: Option<&'a str>, +} +impl<'a> RequiredAddress<'a> { + pub fn new(city: &'a str, country: &'a str, line1: &'a str, postal_code: &'a str) -> Self { + Self { city, country, line1, line2: None, postal_code, state: None } + } +} +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CompanyParam<'a> { + /// The entity's business ID number. + #[serde(skip_serializing_if = "Option::is_none")] + pub tax_id: Option<&'a str>, +} +impl<'a> CompanyParam<'a> { + pub fn new() -> Self { + Self::default() + } +} +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct TermsAcceptanceParam<'a> { + /// The Unix timestamp marking when the cardholder accepted the Authorized User Terms. + /// Required for Celtic Spend Card users. + #[serde(skip_serializing_if = "Option::is_none")] + pub date: Option, + /// The IP address from which the cardholder accepted the Authorized User Terms. + /// Required for Celtic Spend Card users. + #[serde(skip_serializing_if = "Option::is_none")] + pub ip: Option<&'a str>, + /// The user agent of the browser from which the cardholder accepted the Authorized User Terms. + #[serde(skip_serializing_if = "Option::is_none")] + pub user_agent: Option<&'a str>, +} +impl<'a> TermsAcceptanceParam<'a> { + pub fn new() -> Self { + Self::default() + } +} +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct DateOfBirthSpecs { + /// The day of birth, between 1 and 31. + pub day: i64, + /// The month of birth, between 1 and 12. + pub month: i64, + /// The four-digit year of birth. + pub year: i64, +} +impl DateOfBirthSpecs { + pub fn new(day: i64, month: i64, year: i64) -> Self { + Self { day, month, year } + } +} +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct PersonVerificationDocumentParam<'a> { + /// The back of an ID returned by a [file upload](https://stripe.com/docs/api#create_file) with a `purpose` value of `identity_document`. + #[serde(skip_serializing_if = "Option::is_none")] + pub back: Option<&'a str>, + /// The front of an ID returned by a [file upload](https://stripe.com/docs/api#create_file) with a `purpose` value of `identity_document`. + #[serde(skip_serializing_if = "Option::is_none")] + pub front: Option<&'a str>, +} +impl<'a> PersonVerificationDocumentParam<'a> { + pub fn new() -> Self { + Self::default() + } +} +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct BillingSpecs<'a> { + /// The cardholder’s billing address. + pub address: RequiredAddress<'a>, +} +impl<'a> BillingSpecs<'a> { + pub fn new(address: RequiredAddress<'a>) -> Self { + Self { address } + } +} +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CardIssuingParam<'a> { + /// Information about cardholder acceptance of Celtic [Authorized User Terms](https://stripe.com/docs/issuing/cards#accept-authorized-user-terms). + /// Required for cards backed by a Celtic program. + #[serde(skip_serializing_if = "Option::is_none")] + pub user_terms_acceptance: Option>, +} +impl<'a> CardIssuingParam<'a> { + pub fn new() -> Self { + Self::default() + } +} +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct PersonVerificationParam<'a> { + /// An identifying document, either a passport or local ID card. + #[serde(skip_serializing_if = "Option::is_none")] + pub document: Option>, +} +impl<'a> PersonVerificationParam<'a> { + pub fn new() -> Self { + Self::default() + } +} +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct IndividualParam<'a> { + /// Information related to the card_issuing program for this cardholder. + #[serde(skip_serializing_if = "Option::is_none")] + pub card_issuing: Option>, + /// The date of birth of this cardholder. Cardholders must be older than 13 years old. + #[serde(skip_serializing_if = "Option::is_none")] + pub dob: Option, + /// The first name of this cardholder. + /// Required before activating Cards. + /// This field cannot contain any numbers, special characters (except periods, commas, hyphens, spaces and apostrophes) or non-latin letters. + #[serde(skip_serializing_if = "Option::is_none")] + pub first_name: Option<&'a str>, + /// The last name of this cardholder. + /// Required before activating Cards. + /// This field cannot contain any numbers, special characters (except periods, commas, hyphens, spaces and apostrophes) or non-latin letters. + #[serde(skip_serializing_if = "Option::is_none")] + pub last_name: Option<&'a str>, + /// Government-issued ID document for this cardholder. + #[serde(skip_serializing_if = "Option::is_none")] + pub verification: Option>, +} +impl<'a> IndividualParam<'a> { + pub fn new() -> Self { + Self::default() + } +} diff --git a/generated/stripe_issuing/src/issuing_dispute/mod.rs b/generated/stripe_issuing/src/issuing_dispute/mod.rs new file mode 100644 index 000000000..2dd4affb4 --- /dev/null +++ b/generated/stripe_issuing/src/issuing_dispute/mod.rs @@ -0,0 +1,4 @@ +#[cfg(feature = "issuing_dispute")] +mod requests; +#[cfg(feature = "issuing_dispute")] +pub use requests::*; diff --git a/generated/stripe_issuing/src/issuing_dispute/requests.rs b/generated/stripe_issuing/src/issuing_dispute/requests.rs new file mode 100644 index 000000000..7d993bcb9 --- /dev/null +++ b/generated/stripe_issuing/src/issuing_dispute/requests.rs @@ -0,0 +1,1125 @@ +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct ListIssuingDispute<'a> { + /// Select Issuing disputes that were created during the given date interval. + #[serde(skip_serializing_if = "Option::is_none")] + pub created: Option, + /// A cursor for use in pagination. + /// `ending_before` is an object ID that defines your place in the list. + /// For instance, if you make a list request and receive 100 objects, starting with `obj_bar`, your subsequent call can include `ending_before=obj_bar` in order to fetch the previous page of the list. + #[serde(skip_serializing_if = "Option::is_none")] + pub ending_before: Option<&'a str>, + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, + /// A limit on the number of objects to be returned. + /// Limit can range between 1 and 100, and the default is 10. + #[serde(skip_serializing_if = "Option::is_none")] + pub limit: Option, + /// A cursor for use in pagination. + /// `starting_after` is an object ID that defines your place in the list. + /// For instance, if you make a list request and receive 100 objects, ending with `obj_foo`, your subsequent call can include `starting_after=obj_foo` in order to fetch the next page of the list. + #[serde(skip_serializing_if = "Option::is_none")] + pub starting_after: Option<&'a str>, + /// Select Issuing disputes with the given status. + #[serde(skip_serializing_if = "Option::is_none")] + pub status: Option, + /// Select the Issuing dispute for the given transaction. + #[serde(skip_serializing_if = "Option::is_none")] + pub transaction: Option<&'a str>, +} +impl<'a> ListIssuingDispute<'a> { + pub fn new() -> Self { + Self::default() + } +} +impl<'a> ListIssuingDispute<'a> { + /// Returns a list of Issuing `Dispute` objects. + /// The objects are sorted in descending order by creation date, with the most recently created object appearing first. + pub fn send( + &self, + client: &stripe::Client, + ) -> stripe::Response> { + client.get_query("/issuing/disputes", self) + } + pub fn paginate( + self, + ) -> stripe::ListPaginator> { + stripe::ListPaginator::from_list_params("/issuing/disputes", self) + } +} +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct RetrieveIssuingDispute<'a> { + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, +} +impl<'a> RetrieveIssuingDispute<'a> { + pub fn new() -> Self { + Self::default() + } +} +impl<'a> RetrieveIssuingDispute<'a> { + /// Retrieves an Issuing `Dispute` object. + pub fn send( + &self, + client: &stripe::Client, + dispute: &stripe_shared::IssuingDisputeId, + ) -> stripe::Response { + client.get_query(&format!("/issuing/disputes/{dispute}"), self) + } +} +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreateIssuingDispute<'a> { + /// The dispute amount in the card's currency and in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal). + /// If not set, defaults to the full transaction amount. + #[serde(skip_serializing_if = "Option::is_none")] + pub amount: Option, + /// Evidence provided for the dispute. + #[serde(skip_serializing_if = "Option::is_none")] + pub evidence: Option>, + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, + /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. + /// This can be useful for storing additional information about the object in a structured format. + /// Individual keys can be unset by posting an empty value to them. + /// All keys can be unset by posting an empty value to `metadata`. + #[serde(skip_serializing_if = "Option::is_none")] + pub metadata: Option<&'a std::collections::HashMap>, + /// The ID of the issuing transaction to create a dispute for. + /// For transaction on Treasury FinancialAccounts, use `treasury.received_debit`. + #[serde(skip_serializing_if = "Option::is_none")] + pub transaction: Option<&'a str>, + /// Params for disputes related to Treasury FinancialAccounts + #[serde(skip_serializing_if = "Option::is_none")] + pub treasury: Option>, +} +impl<'a> CreateIssuingDispute<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// Evidence provided for the dispute. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreateIssuingDisputeEvidence<'a> { + /// Evidence provided when `reason` is 'canceled'. + #[serde(skip_serializing_if = "Option::is_none")] + pub canceled: Option>, + /// Evidence provided when `reason` is 'duplicate'. + #[serde(skip_serializing_if = "Option::is_none")] + pub duplicate: Option>, + /// Evidence provided when `reason` is 'fraudulent'. + #[serde(skip_serializing_if = "Option::is_none")] + pub fraudulent: Option>, + /// Evidence provided when `reason` is 'merchandise_not_as_described'. + #[serde(skip_serializing_if = "Option::is_none")] + pub merchandise_not_as_described: + Option>, + /// Evidence provided when `reason` is 'not_received'. + #[serde(skip_serializing_if = "Option::is_none")] + pub not_received: Option>, + /// Evidence provided when `reason` is 'other'. + #[serde(skip_serializing_if = "Option::is_none")] + pub other: Option>, + /// The reason for filing the dispute. The evidence should be submitted in the field of the same name. + #[serde(skip_serializing_if = "Option::is_none")] + pub reason: Option, + /// Evidence provided when `reason` is 'service_not_as_described'. + #[serde(skip_serializing_if = "Option::is_none")] + pub service_not_as_described: Option>, +} +impl<'a> CreateIssuingDisputeEvidence<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// Evidence provided when `reason` is 'canceled'. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreateIssuingDisputeEvidenceCanceled<'a> { + /// (ID of a [file upload](https://stripe.com/docs/guides/file-upload)) Additional documentation supporting the dispute. + #[serde(skip_serializing_if = "Option::is_none")] + pub additional_documentation: Option<&'a str>, + /// Date when order was canceled. + #[serde(skip_serializing_if = "Option::is_none")] + pub canceled_at: Option, + /// Whether the cardholder was provided with a cancellation policy. + #[serde(skip_serializing_if = "Option::is_none")] + pub cancellation_policy_provided: Option, + /// Reason for canceling the order. + #[serde(skip_serializing_if = "Option::is_none")] + pub cancellation_reason: Option<&'a str>, + /// Date when the cardholder expected to receive the product. + #[serde(skip_serializing_if = "Option::is_none")] + pub expected_at: Option, + /// Explanation of why the cardholder is disputing this transaction. + #[serde(skip_serializing_if = "Option::is_none")] + pub explanation: Option<&'a str>, + /// Description of the merchandise or service that was purchased. + #[serde(skip_serializing_if = "Option::is_none")] + pub product_description: Option<&'a str>, + /// Whether the product was a merchandise or service. + #[serde(skip_serializing_if = "Option::is_none")] + pub product_type: Option, + /// Result of cardholder's attempt to return the product. + #[serde(skip_serializing_if = "Option::is_none")] + pub return_status: Option, + /// Date when the product was returned or attempted to be returned. + #[serde(skip_serializing_if = "Option::is_none")] + pub returned_at: Option, +} +impl<'a> CreateIssuingDisputeEvidenceCanceled<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// Whether the product was a merchandise or service. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreateIssuingDisputeEvidenceCanceledProductType { + Merchandise, + Service, +} +impl CreateIssuingDisputeEvidenceCanceledProductType { + pub fn as_str(self) -> &'static str { + use CreateIssuingDisputeEvidenceCanceledProductType::*; + match self { + Merchandise => "merchandise", + Service => "service", + } + } +} + +impl std::str::FromStr for CreateIssuingDisputeEvidenceCanceledProductType { + type Err = (); + fn from_str(s: &str) -> Result { + use CreateIssuingDisputeEvidenceCanceledProductType::*; + match s { + "merchandise" => Ok(Merchandise), + "service" => Ok(Service), + _ => Err(()), + } + } +} +impl std::fmt::Display for CreateIssuingDisputeEvidenceCanceledProductType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreateIssuingDisputeEvidenceCanceledProductType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreateIssuingDisputeEvidenceCanceledProductType { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Result of cardholder's attempt to return the product. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreateIssuingDisputeEvidenceCanceledReturnStatus { + MerchantRejected, + Successful, +} +impl CreateIssuingDisputeEvidenceCanceledReturnStatus { + pub fn as_str(self) -> &'static str { + use CreateIssuingDisputeEvidenceCanceledReturnStatus::*; + match self { + MerchantRejected => "merchant_rejected", + Successful => "successful", + } + } +} + +impl std::str::FromStr for CreateIssuingDisputeEvidenceCanceledReturnStatus { + type Err = (); + fn from_str(s: &str) -> Result { + use CreateIssuingDisputeEvidenceCanceledReturnStatus::*; + match s { + "merchant_rejected" => Ok(MerchantRejected), + "successful" => Ok(Successful), + _ => Err(()), + } + } +} +impl std::fmt::Display for CreateIssuingDisputeEvidenceCanceledReturnStatus { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreateIssuingDisputeEvidenceCanceledReturnStatus { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreateIssuingDisputeEvidenceCanceledReturnStatus { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Evidence provided when `reason` is 'merchandise_not_as_described'. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreateIssuingDisputeEvidenceMerchandiseNotAsDescribed<'a> { + /// (ID of a [file upload](https://stripe.com/docs/guides/file-upload)) Additional documentation supporting the dispute. + #[serde(skip_serializing_if = "Option::is_none")] + pub additional_documentation: Option<&'a str>, + /// Explanation of why the cardholder is disputing this transaction. + #[serde(skip_serializing_if = "Option::is_none")] + pub explanation: Option<&'a str>, + /// Date when the product was received. + #[serde(skip_serializing_if = "Option::is_none")] + pub received_at: Option, + /// Description of the cardholder's attempt to return the product. + #[serde(skip_serializing_if = "Option::is_none")] + pub return_description: Option<&'a str>, + /// Result of cardholder's attempt to return the product. + #[serde(skip_serializing_if = "Option::is_none")] + pub return_status: Option, + /// Date when the product was returned or attempted to be returned. + #[serde(skip_serializing_if = "Option::is_none")] + pub returned_at: Option, +} +impl<'a> CreateIssuingDisputeEvidenceMerchandiseNotAsDescribed<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// Result of cardholder's attempt to return the product. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreateIssuingDisputeEvidenceMerchandiseNotAsDescribedReturnStatus { + MerchantRejected, + Successful, +} +impl CreateIssuingDisputeEvidenceMerchandiseNotAsDescribedReturnStatus { + pub fn as_str(self) -> &'static str { + use CreateIssuingDisputeEvidenceMerchandiseNotAsDescribedReturnStatus::*; + match self { + MerchantRejected => "merchant_rejected", + Successful => "successful", + } + } +} + +impl std::str::FromStr for CreateIssuingDisputeEvidenceMerchandiseNotAsDescribedReturnStatus { + type Err = (); + fn from_str(s: &str) -> Result { + use CreateIssuingDisputeEvidenceMerchandiseNotAsDescribedReturnStatus::*; + match s { + "merchant_rejected" => Ok(MerchantRejected), + "successful" => Ok(Successful), + _ => Err(()), + } + } +} +impl std::fmt::Display for CreateIssuingDisputeEvidenceMerchandiseNotAsDescribedReturnStatus { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreateIssuingDisputeEvidenceMerchandiseNotAsDescribedReturnStatus { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreateIssuingDisputeEvidenceMerchandiseNotAsDescribedReturnStatus { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Evidence provided when `reason` is 'not_received'. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreateIssuingDisputeEvidenceNotReceived<'a> { + /// (ID of a [file upload](https://stripe.com/docs/guides/file-upload)) Additional documentation supporting the dispute. + #[serde(skip_serializing_if = "Option::is_none")] + pub additional_documentation: Option<&'a str>, + /// Date when the cardholder expected to receive the product. + #[serde(skip_serializing_if = "Option::is_none")] + pub expected_at: Option, + /// Explanation of why the cardholder is disputing this transaction. + #[serde(skip_serializing_if = "Option::is_none")] + pub explanation: Option<&'a str>, + /// Description of the merchandise or service that was purchased. + #[serde(skip_serializing_if = "Option::is_none")] + pub product_description: Option<&'a str>, + /// Whether the product was a merchandise or service. + #[serde(skip_serializing_if = "Option::is_none")] + pub product_type: Option, +} +impl<'a> CreateIssuingDisputeEvidenceNotReceived<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// Whether the product was a merchandise or service. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreateIssuingDisputeEvidenceNotReceivedProductType { + Merchandise, + Service, +} +impl CreateIssuingDisputeEvidenceNotReceivedProductType { + pub fn as_str(self) -> &'static str { + use CreateIssuingDisputeEvidenceNotReceivedProductType::*; + match self { + Merchandise => "merchandise", + Service => "service", + } + } +} + +impl std::str::FromStr for CreateIssuingDisputeEvidenceNotReceivedProductType { + type Err = (); + fn from_str(s: &str) -> Result { + use CreateIssuingDisputeEvidenceNotReceivedProductType::*; + match s { + "merchandise" => Ok(Merchandise), + "service" => Ok(Service), + _ => Err(()), + } + } +} +impl std::fmt::Display for CreateIssuingDisputeEvidenceNotReceivedProductType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreateIssuingDisputeEvidenceNotReceivedProductType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreateIssuingDisputeEvidenceNotReceivedProductType { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Evidence provided when `reason` is 'other'. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreateIssuingDisputeEvidenceOther<'a> { + /// (ID of a [file upload](https://stripe.com/docs/guides/file-upload)) Additional documentation supporting the dispute. + #[serde(skip_serializing_if = "Option::is_none")] + pub additional_documentation: Option<&'a str>, + /// Explanation of why the cardholder is disputing this transaction. + #[serde(skip_serializing_if = "Option::is_none")] + pub explanation: Option<&'a str>, + /// Description of the merchandise or service that was purchased. + #[serde(skip_serializing_if = "Option::is_none")] + pub product_description: Option<&'a str>, + /// Whether the product was a merchandise or service. + #[serde(skip_serializing_if = "Option::is_none")] + pub product_type: Option, +} +impl<'a> CreateIssuingDisputeEvidenceOther<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// Whether the product was a merchandise or service. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreateIssuingDisputeEvidenceOtherProductType { + Merchandise, + Service, +} +impl CreateIssuingDisputeEvidenceOtherProductType { + pub fn as_str(self) -> &'static str { + use CreateIssuingDisputeEvidenceOtherProductType::*; + match self { + Merchandise => "merchandise", + Service => "service", + } + } +} + +impl std::str::FromStr for CreateIssuingDisputeEvidenceOtherProductType { + type Err = (); + fn from_str(s: &str) -> Result { + use CreateIssuingDisputeEvidenceOtherProductType::*; + match s { + "merchandise" => Ok(Merchandise), + "service" => Ok(Service), + _ => Err(()), + } + } +} +impl std::fmt::Display for CreateIssuingDisputeEvidenceOtherProductType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreateIssuingDisputeEvidenceOtherProductType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreateIssuingDisputeEvidenceOtherProductType { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// The reason for filing the dispute. The evidence should be submitted in the field of the same name. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreateIssuingDisputeEvidenceReason { + Canceled, + Duplicate, + Fraudulent, + MerchandiseNotAsDescribed, + NotReceived, + Other, + ServiceNotAsDescribed, +} +impl CreateIssuingDisputeEvidenceReason { + pub fn as_str(self) -> &'static str { + use CreateIssuingDisputeEvidenceReason::*; + match self { + Canceled => "canceled", + Duplicate => "duplicate", + Fraudulent => "fraudulent", + MerchandiseNotAsDescribed => "merchandise_not_as_described", + NotReceived => "not_received", + Other => "other", + ServiceNotAsDescribed => "service_not_as_described", + } + } +} + +impl std::str::FromStr for CreateIssuingDisputeEvidenceReason { + type Err = (); + fn from_str(s: &str) -> Result { + use CreateIssuingDisputeEvidenceReason::*; + match s { + "canceled" => Ok(Canceled), + "duplicate" => Ok(Duplicate), + "fraudulent" => Ok(Fraudulent), + "merchandise_not_as_described" => Ok(MerchandiseNotAsDescribed), + "not_received" => Ok(NotReceived), + "other" => Ok(Other), + "service_not_as_described" => Ok(ServiceNotAsDescribed), + _ => Err(()), + } + } +} +impl std::fmt::Display for CreateIssuingDisputeEvidenceReason { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreateIssuingDisputeEvidenceReason { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreateIssuingDisputeEvidenceReason { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Params for disputes related to Treasury FinancialAccounts +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreateIssuingDisputeTreasury<'a> { + /// The ID of the ReceivedDebit to initiate an Issuings dispute for. + pub received_debit: &'a str, +} +impl<'a> CreateIssuingDisputeTreasury<'a> { + pub fn new(received_debit: &'a str) -> Self { + Self { received_debit } + } +} +impl<'a> CreateIssuingDispute<'a> { + /// Creates an Issuing `Dispute` object. + /// Individual pieces of evidence within the `evidence` object are optional at this point. + /// Stripe only validates that required evidence is present during submission. + /// Refer to [Dispute reasons and evidence](https://stripe.com/docs/issuing/purchases/disputes#dispute-reasons-and-evidence) for more details about evidence requirements. + pub fn send(&self, client: &stripe::Client) -> stripe::Response { + client.send_form("/issuing/disputes", self, http_types::Method::Post) + } +} +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdateIssuingDispute<'a> { + /// The dispute amount in the card's currency and in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal). + #[serde(skip_serializing_if = "Option::is_none")] + pub amount: Option, + /// Evidence provided for the dispute. + #[serde(skip_serializing_if = "Option::is_none")] + pub evidence: Option>, + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, + /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. + /// This can be useful for storing additional information about the object in a structured format. + /// Individual keys can be unset by posting an empty value to them. + /// All keys can be unset by posting an empty value to `metadata`. + #[serde(skip_serializing_if = "Option::is_none")] + pub metadata: Option<&'a std::collections::HashMap>, +} +impl<'a> UpdateIssuingDispute<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// Evidence provided for the dispute. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdateIssuingDisputeEvidence<'a> { + /// Evidence provided when `reason` is 'canceled'. + #[serde(skip_serializing_if = "Option::is_none")] + pub canceled: Option>, + /// Evidence provided when `reason` is 'duplicate'. + #[serde(skip_serializing_if = "Option::is_none")] + pub duplicate: Option>, + /// Evidence provided when `reason` is 'fraudulent'. + #[serde(skip_serializing_if = "Option::is_none")] + pub fraudulent: Option>, + /// Evidence provided when `reason` is 'merchandise_not_as_described'. + #[serde(skip_serializing_if = "Option::is_none")] + pub merchandise_not_as_described: + Option>, + /// Evidence provided when `reason` is 'not_received'. + #[serde(skip_serializing_if = "Option::is_none")] + pub not_received: Option>, + /// Evidence provided when `reason` is 'other'. + #[serde(skip_serializing_if = "Option::is_none")] + pub other: Option>, + /// The reason for filing the dispute. The evidence should be submitted in the field of the same name. + #[serde(skip_serializing_if = "Option::is_none")] + pub reason: Option, + /// Evidence provided when `reason` is 'service_not_as_described'. + #[serde(skip_serializing_if = "Option::is_none")] + pub service_not_as_described: Option>, +} +impl<'a> UpdateIssuingDisputeEvidence<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// Evidence provided when `reason` is 'canceled'. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdateIssuingDisputeEvidenceCanceled<'a> { + /// (ID of a [file upload](https://stripe.com/docs/guides/file-upload)) Additional documentation supporting the dispute. + #[serde(skip_serializing_if = "Option::is_none")] + pub additional_documentation: Option<&'a str>, + /// Date when order was canceled. + #[serde(skip_serializing_if = "Option::is_none")] + pub canceled_at: Option, + /// Whether the cardholder was provided with a cancellation policy. + #[serde(skip_serializing_if = "Option::is_none")] + pub cancellation_policy_provided: Option, + /// Reason for canceling the order. + #[serde(skip_serializing_if = "Option::is_none")] + pub cancellation_reason: Option<&'a str>, + /// Date when the cardholder expected to receive the product. + #[serde(skip_serializing_if = "Option::is_none")] + pub expected_at: Option, + /// Explanation of why the cardholder is disputing this transaction. + #[serde(skip_serializing_if = "Option::is_none")] + pub explanation: Option<&'a str>, + /// Description of the merchandise or service that was purchased. + #[serde(skip_serializing_if = "Option::is_none")] + pub product_description: Option<&'a str>, + /// Whether the product was a merchandise or service. + #[serde(skip_serializing_if = "Option::is_none")] + pub product_type: Option, + /// Result of cardholder's attempt to return the product. + #[serde(skip_serializing_if = "Option::is_none")] + pub return_status: Option, + /// Date when the product was returned or attempted to be returned. + #[serde(skip_serializing_if = "Option::is_none")] + pub returned_at: Option, +} +impl<'a> UpdateIssuingDisputeEvidenceCanceled<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// Whether the product was a merchandise or service. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum UpdateIssuingDisputeEvidenceCanceledProductType { + Merchandise, + Service, +} +impl UpdateIssuingDisputeEvidenceCanceledProductType { + pub fn as_str(self) -> &'static str { + use UpdateIssuingDisputeEvidenceCanceledProductType::*; + match self { + Merchandise => "merchandise", + Service => "service", + } + } +} + +impl std::str::FromStr for UpdateIssuingDisputeEvidenceCanceledProductType { + type Err = (); + fn from_str(s: &str) -> Result { + use UpdateIssuingDisputeEvidenceCanceledProductType::*; + match s { + "merchandise" => Ok(Merchandise), + "service" => Ok(Service), + _ => Err(()), + } + } +} +impl std::fmt::Display for UpdateIssuingDisputeEvidenceCanceledProductType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for UpdateIssuingDisputeEvidenceCanceledProductType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for UpdateIssuingDisputeEvidenceCanceledProductType { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Result of cardholder's attempt to return the product. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum UpdateIssuingDisputeEvidenceCanceledReturnStatus { + MerchantRejected, + Successful, +} +impl UpdateIssuingDisputeEvidenceCanceledReturnStatus { + pub fn as_str(self) -> &'static str { + use UpdateIssuingDisputeEvidenceCanceledReturnStatus::*; + match self { + MerchantRejected => "merchant_rejected", + Successful => "successful", + } + } +} + +impl std::str::FromStr for UpdateIssuingDisputeEvidenceCanceledReturnStatus { + type Err = (); + fn from_str(s: &str) -> Result { + use UpdateIssuingDisputeEvidenceCanceledReturnStatus::*; + match s { + "merchant_rejected" => Ok(MerchantRejected), + "successful" => Ok(Successful), + _ => Err(()), + } + } +} +impl std::fmt::Display for UpdateIssuingDisputeEvidenceCanceledReturnStatus { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for UpdateIssuingDisputeEvidenceCanceledReturnStatus { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for UpdateIssuingDisputeEvidenceCanceledReturnStatus { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Evidence provided when `reason` is 'merchandise_not_as_described'. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdateIssuingDisputeEvidenceMerchandiseNotAsDescribed<'a> { + /// (ID of a [file upload](https://stripe.com/docs/guides/file-upload)) Additional documentation supporting the dispute. + #[serde(skip_serializing_if = "Option::is_none")] + pub additional_documentation: Option<&'a str>, + /// Explanation of why the cardholder is disputing this transaction. + #[serde(skip_serializing_if = "Option::is_none")] + pub explanation: Option<&'a str>, + /// Date when the product was received. + #[serde(skip_serializing_if = "Option::is_none")] + pub received_at: Option, + /// Description of the cardholder's attempt to return the product. + #[serde(skip_serializing_if = "Option::is_none")] + pub return_description: Option<&'a str>, + /// Result of cardholder's attempt to return the product. + #[serde(skip_serializing_if = "Option::is_none")] + pub return_status: Option, + /// Date when the product was returned or attempted to be returned. + #[serde(skip_serializing_if = "Option::is_none")] + pub returned_at: Option, +} +impl<'a> UpdateIssuingDisputeEvidenceMerchandiseNotAsDescribed<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// Result of cardholder's attempt to return the product. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum UpdateIssuingDisputeEvidenceMerchandiseNotAsDescribedReturnStatus { + MerchantRejected, + Successful, +} +impl UpdateIssuingDisputeEvidenceMerchandiseNotAsDescribedReturnStatus { + pub fn as_str(self) -> &'static str { + use UpdateIssuingDisputeEvidenceMerchandiseNotAsDescribedReturnStatus::*; + match self { + MerchantRejected => "merchant_rejected", + Successful => "successful", + } + } +} + +impl std::str::FromStr for UpdateIssuingDisputeEvidenceMerchandiseNotAsDescribedReturnStatus { + type Err = (); + fn from_str(s: &str) -> Result { + use UpdateIssuingDisputeEvidenceMerchandiseNotAsDescribedReturnStatus::*; + match s { + "merchant_rejected" => Ok(MerchantRejected), + "successful" => Ok(Successful), + _ => Err(()), + } + } +} +impl std::fmt::Display for UpdateIssuingDisputeEvidenceMerchandiseNotAsDescribedReturnStatus { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for UpdateIssuingDisputeEvidenceMerchandiseNotAsDescribedReturnStatus { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for UpdateIssuingDisputeEvidenceMerchandiseNotAsDescribedReturnStatus { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Evidence provided when `reason` is 'not_received'. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdateIssuingDisputeEvidenceNotReceived<'a> { + /// (ID of a [file upload](https://stripe.com/docs/guides/file-upload)) Additional documentation supporting the dispute. + #[serde(skip_serializing_if = "Option::is_none")] + pub additional_documentation: Option<&'a str>, + /// Date when the cardholder expected to receive the product. + #[serde(skip_serializing_if = "Option::is_none")] + pub expected_at: Option, + /// Explanation of why the cardholder is disputing this transaction. + #[serde(skip_serializing_if = "Option::is_none")] + pub explanation: Option<&'a str>, + /// Description of the merchandise or service that was purchased. + #[serde(skip_serializing_if = "Option::is_none")] + pub product_description: Option<&'a str>, + /// Whether the product was a merchandise or service. + #[serde(skip_serializing_if = "Option::is_none")] + pub product_type: Option, +} +impl<'a> UpdateIssuingDisputeEvidenceNotReceived<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// Whether the product was a merchandise or service. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum UpdateIssuingDisputeEvidenceNotReceivedProductType { + Merchandise, + Service, +} +impl UpdateIssuingDisputeEvidenceNotReceivedProductType { + pub fn as_str(self) -> &'static str { + use UpdateIssuingDisputeEvidenceNotReceivedProductType::*; + match self { + Merchandise => "merchandise", + Service => "service", + } + } +} + +impl std::str::FromStr for UpdateIssuingDisputeEvidenceNotReceivedProductType { + type Err = (); + fn from_str(s: &str) -> Result { + use UpdateIssuingDisputeEvidenceNotReceivedProductType::*; + match s { + "merchandise" => Ok(Merchandise), + "service" => Ok(Service), + _ => Err(()), + } + } +} +impl std::fmt::Display for UpdateIssuingDisputeEvidenceNotReceivedProductType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for UpdateIssuingDisputeEvidenceNotReceivedProductType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for UpdateIssuingDisputeEvidenceNotReceivedProductType { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Evidence provided when `reason` is 'other'. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdateIssuingDisputeEvidenceOther<'a> { + /// (ID of a [file upload](https://stripe.com/docs/guides/file-upload)) Additional documentation supporting the dispute. + #[serde(skip_serializing_if = "Option::is_none")] + pub additional_documentation: Option<&'a str>, + /// Explanation of why the cardholder is disputing this transaction. + #[serde(skip_serializing_if = "Option::is_none")] + pub explanation: Option<&'a str>, + /// Description of the merchandise or service that was purchased. + #[serde(skip_serializing_if = "Option::is_none")] + pub product_description: Option<&'a str>, + /// Whether the product was a merchandise or service. + #[serde(skip_serializing_if = "Option::is_none")] + pub product_type: Option, +} +impl<'a> UpdateIssuingDisputeEvidenceOther<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// Whether the product was a merchandise or service. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum UpdateIssuingDisputeEvidenceOtherProductType { + Merchandise, + Service, +} +impl UpdateIssuingDisputeEvidenceOtherProductType { + pub fn as_str(self) -> &'static str { + use UpdateIssuingDisputeEvidenceOtherProductType::*; + match self { + Merchandise => "merchandise", + Service => "service", + } + } +} + +impl std::str::FromStr for UpdateIssuingDisputeEvidenceOtherProductType { + type Err = (); + fn from_str(s: &str) -> Result { + use UpdateIssuingDisputeEvidenceOtherProductType::*; + match s { + "merchandise" => Ok(Merchandise), + "service" => Ok(Service), + _ => Err(()), + } + } +} +impl std::fmt::Display for UpdateIssuingDisputeEvidenceOtherProductType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for UpdateIssuingDisputeEvidenceOtherProductType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for UpdateIssuingDisputeEvidenceOtherProductType { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// The reason for filing the dispute. The evidence should be submitted in the field of the same name. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum UpdateIssuingDisputeEvidenceReason { + Canceled, + Duplicate, + Fraudulent, + MerchandiseNotAsDescribed, + NotReceived, + Other, + ServiceNotAsDescribed, +} +impl UpdateIssuingDisputeEvidenceReason { + pub fn as_str(self) -> &'static str { + use UpdateIssuingDisputeEvidenceReason::*; + match self { + Canceled => "canceled", + Duplicate => "duplicate", + Fraudulent => "fraudulent", + MerchandiseNotAsDescribed => "merchandise_not_as_described", + NotReceived => "not_received", + Other => "other", + ServiceNotAsDescribed => "service_not_as_described", + } + } +} + +impl std::str::FromStr for UpdateIssuingDisputeEvidenceReason { + type Err = (); + fn from_str(s: &str) -> Result { + use UpdateIssuingDisputeEvidenceReason::*; + match s { + "canceled" => Ok(Canceled), + "duplicate" => Ok(Duplicate), + "fraudulent" => Ok(Fraudulent), + "merchandise_not_as_described" => Ok(MerchandiseNotAsDescribed), + "not_received" => Ok(NotReceived), + "other" => Ok(Other), + "service_not_as_described" => Ok(ServiceNotAsDescribed), + _ => Err(()), + } + } +} +impl std::fmt::Display for UpdateIssuingDisputeEvidenceReason { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for UpdateIssuingDisputeEvidenceReason { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for UpdateIssuingDisputeEvidenceReason { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'a> UpdateIssuingDispute<'a> { + /// Updates the specified Issuing `Dispute` object by setting the values of the parameters passed. + /// Any parameters not provided will be left unchanged. + /// Properties on the `evidence` object can be unset by passing in an empty string. + pub fn send( + &self, + client: &stripe::Client, + dispute: &stripe_shared::IssuingDisputeId, + ) -> stripe::Response { + client.send_form(&format!("/issuing/disputes/{dispute}"), self, http_types::Method::Post) + } +} +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct SubmitIssuingDispute<'a> { + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, + /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. + /// This can be useful for storing additional information about the object in a structured format. + /// Individual keys can be unset by posting an empty value to them. + /// All keys can be unset by posting an empty value to `metadata`. + #[serde(skip_serializing_if = "Option::is_none")] + pub metadata: Option<&'a std::collections::HashMap>, +} +impl<'a> SubmitIssuingDispute<'a> { + pub fn new() -> Self { + Self::default() + } +} +impl<'a> SubmitIssuingDispute<'a> { + /// Submits an Issuing `Dispute` to the card network. + /// Stripe validates that all evidence fields required for the dispute’s reason are present. + /// For more details, see [Dispute reasons and evidence](https://stripe.com/docs/issuing/purchases/disputes#dispute-reasons-and-evidence). + pub fn send( + &self, + client: &stripe::Client, + dispute: &stripe_shared::IssuingDisputeId, + ) -> stripe::Response { + client.send_form( + &format!("/issuing/disputes/{dispute}/submit"), + self, + http_types::Method::Post, + ) + } +} +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct Duplicate<'a> { + /// (ID of a [file upload](https://stripe.com/docs/guides/file-upload)) Additional documentation supporting the dispute. + #[serde(skip_serializing_if = "Option::is_none")] + pub additional_documentation: Option<&'a str>, + /// (ID of a [file upload](https://stripe.com/docs/guides/file-upload)) Copy of the card statement showing that the product had already been paid for. + #[serde(skip_serializing_if = "Option::is_none")] + pub card_statement: Option<&'a str>, + /// (ID of a [file upload](https://stripe.com/docs/guides/file-upload)) Copy of the receipt showing that the product had been paid for in cash. + #[serde(skip_serializing_if = "Option::is_none")] + pub cash_receipt: Option<&'a str>, + /// (ID of a [file upload](https://stripe.com/docs/guides/file-upload)) Image of the front and back of the check that was used to pay for the product. + #[serde(skip_serializing_if = "Option::is_none")] + pub check_image: Option<&'a str>, + /// Explanation of why the cardholder is disputing this transaction. + #[serde(skip_serializing_if = "Option::is_none")] + pub explanation: Option<&'a str>, + /// Transaction (e.g., ipi_...) that the disputed transaction is a duplicate of. + /// Of the two or more transactions that are copies of each other, this is original undisputed one. + #[serde(skip_serializing_if = "Option::is_none")] + pub original_transaction: Option<&'a str>, +} +impl<'a> Duplicate<'a> { + pub fn new() -> Self { + Self::default() + } +} +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct Fraudulent<'a> { + /// (ID of a [file upload](https://stripe.com/docs/guides/file-upload)) Additional documentation supporting the dispute. + #[serde(skip_serializing_if = "Option::is_none")] + pub additional_documentation: Option<&'a str>, + /// Explanation of why the cardholder is disputing this transaction. + #[serde(skip_serializing_if = "Option::is_none")] + pub explanation: Option<&'a str>, +} +impl<'a> Fraudulent<'a> { + pub fn new() -> Self { + Self::default() + } +} +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct ServiceNotAsDescribed<'a> { + /// (ID of a [file upload](https://stripe.com/docs/guides/file-upload)) Additional documentation supporting the dispute. + #[serde(skip_serializing_if = "Option::is_none")] + pub additional_documentation: Option<&'a str>, + /// Date when order was canceled. + #[serde(skip_serializing_if = "Option::is_none")] + pub canceled_at: Option, + /// Reason for canceling the order. + #[serde(skip_serializing_if = "Option::is_none")] + pub cancellation_reason: Option<&'a str>, + /// Explanation of why the cardholder is disputing this transaction. + #[serde(skip_serializing_if = "Option::is_none")] + pub explanation: Option<&'a str>, + /// Date when the product was received. + #[serde(skip_serializing_if = "Option::is_none")] + pub received_at: Option, +} +impl<'a> ServiceNotAsDescribed<'a> { + pub fn new() -> Self { + Self::default() + } +} diff --git a/generated/stripe_issuing/src/issuing_token/mod.rs b/generated/stripe_issuing/src/issuing_token/mod.rs new file mode 100644 index 000000000..4c02ba431 --- /dev/null +++ b/generated/stripe_issuing/src/issuing_token/mod.rs @@ -0,0 +1,4 @@ +#[cfg(feature = "issuing_token")] +mod requests; +#[cfg(feature = "issuing_token")] +pub use requests::*; diff --git a/generated/stripe_issuing/src/issuing_token/requests.rs b/generated/stripe_issuing/src/issuing_token/requests.rs new file mode 100644 index 000000000..cb01672aa --- /dev/null +++ b/generated/stripe_issuing/src/issuing_token/requests.rs @@ -0,0 +1,148 @@ +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct ListIssuingToken<'a> { + /// The Issuing card identifier to list tokens for. + pub card: &'a str, + /// Select Issuing tokens that were created during the given date interval. + #[serde(skip_serializing_if = "Option::is_none")] + pub created: Option, + /// A cursor for use in pagination. + /// `ending_before` is an object ID that defines your place in the list. + /// For instance, if you make a list request and receive 100 objects, starting with `obj_bar`, your subsequent call can include `ending_before=obj_bar` in order to fetch the previous page of the list. + #[serde(skip_serializing_if = "Option::is_none")] + pub ending_before: Option<&'a str>, + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, + /// A limit on the number of objects to be returned. + /// Limit can range between 1 and 100, and the default is 10. + #[serde(skip_serializing_if = "Option::is_none")] + pub limit: Option, + /// A cursor for use in pagination. + /// `starting_after` is an object ID that defines your place in the list. + /// For instance, if you make a list request and receive 100 objects, ending with `obj_foo`, your subsequent call can include `starting_after=obj_foo` in order to fetch the next page of the list. + #[serde(skip_serializing_if = "Option::is_none")] + pub starting_after: Option<&'a str>, + /// Select Issuing tokens with the given status. + #[serde(skip_serializing_if = "Option::is_none")] + pub status: Option, +} +impl<'a> ListIssuingToken<'a> { + pub fn new(card: &'a str) -> Self { + Self { + card, + created: None, + ending_before: None, + expand: None, + limit: None, + starting_after: None, + status: None, + } + } +} +impl<'a> ListIssuingToken<'a> { + /// Lists all Issuing `Token` objects for a given card. + pub fn send( + &self, + client: &stripe::Client, + ) -> stripe::Response> { + client.get_query("/issuing/tokens", self) + } + pub fn paginate( + self, + ) -> stripe::ListPaginator> { + stripe::ListPaginator::from_list_params("/issuing/tokens", self) + } +} +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct RetrieveIssuingToken<'a> { + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, +} +impl<'a> RetrieveIssuingToken<'a> { + pub fn new() -> Self { + Self::default() + } +} +impl<'a> RetrieveIssuingToken<'a> { + /// Retrieves an Issuing `Token` object. + pub fn send( + &self, + client: &stripe::Client, + token: &stripe_shared::IssuingTokenId, + ) -> stripe::Response { + client.get_query(&format!("/issuing/tokens/{token}"), self) + } +} +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct UpdateIssuingToken<'a> { + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, + /// Specifies which status the token should be updated to. + pub status: UpdateIssuingTokenStatus, +} +impl<'a> UpdateIssuingToken<'a> { + pub fn new(status: UpdateIssuingTokenStatus) -> Self { + Self { expand: None, status } + } +} +/// Specifies which status the token should be updated to. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum UpdateIssuingTokenStatus { + Active, + Deleted, + Suspended, +} +impl UpdateIssuingTokenStatus { + pub fn as_str(self) -> &'static str { + use UpdateIssuingTokenStatus::*; + match self { + Active => "active", + Deleted => "deleted", + Suspended => "suspended", + } + } +} + +impl std::str::FromStr for UpdateIssuingTokenStatus { + type Err = (); + fn from_str(s: &str) -> Result { + use UpdateIssuingTokenStatus::*; + match s { + "active" => Ok(Active), + "deleted" => Ok(Deleted), + "suspended" => Ok(Suspended), + _ => Err(()), + } + } +} +impl std::fmt::Display for UpdateIssuingTokenStatus { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for UpdateIssuingTokenStatus { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for UpdateIssuingTokenStatus { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'a> UpdateIssuingToken<'a> { + /// Attempts to update the specified Issuing `Token` object to the status specified. + pub fn send( + &self, + client: &stripe::Client, + token: &stripe_shared::IssuingTokenId, + ) -> stripe::Response { + client.send_form(&format!("/issuing/tokens/{token}"), self, http_types::Method::Post) + } +} diff --git a/generated/stripe_issuing/src/issuing_transaction/mod.rs b/generated/stripe_issuing/src/issuing_transaction/mod.rs new file mode 100644 index 000000000..6f45b81b9 --- /dev/null +++ b/generated/stripe_issuing/src/issuing_transaction/mod.rs @@ -0,0 +1,4 @@ +#[cfg(feature = "issuing_transaction")] +mod requests; +#[cfg(feature = "issuing_transaction")] +pub use requests::*; diff --git a/generated/stripe_issuing/src/issuing_transaction/requests.rs b/generated/stripe_issuing/src/issuing_transaction/requests.rs new file mode 100644 index 000000000..d4381d15b --- /dev/null +++ b/generated/stripe_issuing/src/issuing_transaction/requests.rs @@ -0,0 +1,2722 @@ +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct ListIssuingTransaction<'a> { + /// Only return transactions that belong to the given card. + #[serde(skip_serializing_if = "Option::is_none")] + pub card: Option<&'a str>, + /// Only return transactions that belong to the given cardholder. + #[serde(skip_serializing_if = "Option::is_none")] + pub cardholder: Option<&'a str>, + /// Only return transactions that were created during the given date interval. + #[serde(skip_serializing_if = "Option::is_none")] + pub created: Option, + /// A cursor for use in pagination. + /// `ending_before` is an object ID that defines your place in the list. + /// For instance, if you make a list request and receive 100 objects, starting with `obj_bar`, your subsequent call can include `ending_before=obj_bar` in order to fetch the previous page of the list. + #[serde(skip_serializing_if = "Option::is_none")] + pub ending_before: Option<&'a str>, + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, + /// A limit on the number of objects to be returned. + /// Limit can range between 1 and 100, and the default is 10. + #[serde(skip_serializing_if = "Option::is_none")] + pub limit: Option, + /// A cursor for use in pagination. + /// `starting_after` is an object ID that defines your place in the list. + /// For instance, if you make a list request and receive 100 objects, ending with `obj_foo`, your subsequent call can include `starting_after=obj_foo` in order to fetch the next page of the list. + #[serde(skip_serializing_if = "Option::is_none")] + pub starting_after: Option<&'a str>, + /// Only return transactions that have the given type. One of `capture` or `refund`. + #[serde(rename = "type")] + #[serde(skip_serializing_if = "Option::is_none")] + pub type_: Option, +} +impl<'a> ListIssuingTransaction<'a> { + pub fn new() -> Self { + Self::default() + } +} +impl<'a> ListIssuingTransaction<'a> { + /// Returns a list of Issuing `Transaction` objects. + /// The objects are sorted in descending order by creation date, with the most recently created object appearing first. + pub fn send( + &self, + client: &stripe::Client, + ) -> stripe::Response> { + client.get_query("/issuing/transactions", self) + } + pub fn paginate( + self, + ) -> stripe::ListPaginator> { + stripe::ListPaginator::from_list_params("/issuing/transactions", self) + } +} +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct RetrieveIssuingTransaction<'a> { + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, +} +impl<'a> RetrieveIssuingTransaction<'a> { + pub fn new() -> Self { + Self::default() + } +} +impl<'a> RetrieveIssuingTransaction<'a> { + /// Retrieves an Issuing `Transaction` object. + pub fn send( + &self, + client: &stripe::Client, + transaction: &stripe_shared::IssuingTransactionId, + ) -> stripe::Response { + client.get_query(&format!("/issuing/transactions/{transaction}"), self) + } +} +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdateIssuingTransaction<'a> { + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, + /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. + /// This can be useful for storing additional information about the object in a structured format. + /// Individual keys can be unset by posting an empty value to them. + /// All keys can be unset by posting an empty value to `metadata`. + #[serde(skip_serializing_if = "Option::is_none")] + pub metadata: Option<&'a std::collections::HashMap>, +} +impl<'a> UpdateIssuingTransaction<'a> { + pub fn new() -> Self { + Self::default() + } +} +impl<'a> UpdateIssuingTransaction<'a> { + /// Updates the specified Issuing `Transaction` object by setting the values of the parameters passed. + /// Any parameters not provided will be left unchanged. + pub fn send( + &self, + client: &stripe::Client, + transaction: &stripe_shared::IssuingTransactionId, + ) -> stripe::Response { + client.send_form( + &format!("/issuing/transactions/{transaction}"), + self, + http_types::Method::Post, + ) + } +} +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct RefundIssuingTransaction<'a> { + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, + /// The total amount to attempt to refund. + /// This amount is in the provided currency, or defaults to the cards currency, and in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal). + #[serde(skip_serializing_if = "Option::is_none")] + pub refund_amount: Option, +} +impl<'a> RefundIssuingTransaction<'a> { + pub fn new() -> Self { + Self::default() + } +} +impl<'a> RefundIssuingTransaction<'a> { + /// Refund a test-mode Transaction. + pub fn send( + &self, + client: &stripe::Client, + transaction: &str, + ) -> stripe::Response { + client.send_form( + &format!("/test_helpers/issuing/transactions/{transaction}/refund"), + self, + http_types::Method::Post, + ) + } +} +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreateForceCaptureIssuingTransaction<'a> { + /// The total amount to attempt to capture. + /// This amount is in the provided currency, or defaults to the cards currency, and in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal). + pub amount: i64, + /// Card associated with this transaction. + pub card: &'a str, + /// The currency of the capture. + /// If not provided, defaults to the currency of the card. + /// Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. + /// Must be a [supported currency](https://stripe.com/docs/currencies). + #[serde(skip_serializing_if = "Option::is_none")] + pub currency: Option, + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, + /// Details about the seller (grocery store, e-commerce website, etc.) where the card authorization happened. + #[serde(skip_serializing_if = "Option::is_none")] + pub merchant_data: Option>, + /// Additional purchase information that is optionally provided by the merchant. + #[serde(skip_serializing_if = "Option::is_none")] + pub purchase_details: Option>, +} +impl<'a> CreateForceCaptureIssuingTransaction<'a> { + pub fn new(amount: i64, card: &'a str) -> Self { + Self { + amount, + card, + currency: None, + expand: None, + merchant_data: None, + purchase_details: None, + } + } +} +/// Details about the seller (grocery store, e-commerce website, etc.) where the card authorization happened. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreateForceCaptureIssuingTransactionMerchantData<'a> { + /// A categorization of the seller's type of business. + /// See our [merchant categories guide](https://stripe.com/docs/issuing/merchant-categories) for a list of possible values. + #[serde(skip_serializing_if = "Option::is_none")] + pub category: Option, + /// City where the seller is located + #[serde(skip_serializing_if = "Option::is_none")] + pub city: Option<&'a str>, + /// Country where the seller is located + #[serde(skip_serializing_if = "Option::is_none")] + pub country: Option<&'a str>, + /// Name of the seller + #[serde(skip_serializing_if = "Option::is_none")] + pub name: Option<&'a str>, + /// Identifier assigned to the seller by the card network. + /// Different card networks may assign different network_id fields to the same merchant. + #[serde(skip_serializing_if = "Option::is_none")] + pub network_id: Option<&'a str>, + /// Postal code where the seller is located + #[serde(skip_serializing_if = "Option::is_none")] + pub postal_code: Option<&'a str>, + /// State where the seller is located + #[serde(skip_serializing_if = "Option::is_none")] + pub state: Option<&'a str>, + /// An ID assigned by the seller to the location of the sale. + #[serde(skip_serializing_if = "Option::is_none")] + pub terminal_id: Option<&'a str>, + /// URL provided by the merchant on a 3DS request + #[serde(skip_serializing_if = "Option::is_none")] + pub url: Option<&'a str>, +} +impl<'a> CreateForceCaptureIssuingTransactionMerchantData<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// A categorization of the seller's type of business. +/// See our [merchant categories guide](https://stripe.com/docs/issuing/merchant-categories) for a list of possible values. +#[derive(Copy, Clone, Eq, PartialEq)] +#[non_exhaustive] +pub enum CreateForceCaptureIssuingTransactionMerchantDataCategory { + AcRefrigerationRepair, + AccountingBookkeepingServices, + AdvertisingServices, + AgriculturalCooperative, + AirlinesAirCarriers, + AirportsFlyingFields, + AmbulanceServices, + AmusementParksCarnivals, + AntiqueReproductions, + AntiqueShops, + Aquariums, + ArchitecturalSurveyingServices, + ArtDealersAndGalleries, + ArtistsSupplyAndCraftShops, + AutoAndHomeSupplyStores, + AutoBodyRepairShops, + AutoPaintShops, + AutoServiceShops, + AutomatedCashDisburse, + AutomatedFuelDispensers, + AutomobileAssociations, + AutomotivePartsAndAccessoriesStores, + AutomotiveTireStores, + BailAndBondPayments, + Bakeries, + BandsOrchestras, + BarberAndBeautyShops, + BettingCasinoGambling, + BicycleShops, + BilliardPoolEstablishments, + BoatDealers, + BoatRentalsAndLeases, + BookStores, + BooksPeriodicalsAndNewspapers, + BowlingAlleys, + BusLines, + BusinessSecretarialSchools, + BuyingShoppingServices, + CableSatelliteAndOtherPayTelevisionAndRadio, + CameraAndPhotographicSupplyStores, + CandyNutAndConfectioneryStores, + CarAndTruckDealersNewUsed, + CarAndTruckDealersUsedOnly, + CarRentalAgencies, + CarWashes, + CarpentryServices, + CarpetUpholsteryCleaning, + Caterers, + CharitableAndSocialServiceOrganizationsFundraising, + ChemicalsAndAlliedProducts, + ChildCareServices, + ChildrensAndInfantsWearStores, + ChiropodistsPodiatrists, + Chiropractors, + CigarStoresAndStands, + CivicSocialFraternalAssociations, + CleaningAndMaintenance, + ClothingRental, + CollegesUniversities, + CommercialEquipment, + CommercialFootwear, + CommercialPhotographyArtAndGraphics, + CommuterTransportAndFerries, + ComputerNetworkServices, + ComputerProgramming, + ComputerRepair, + ComputerSoftwareStores, + ComputersPeripheralsAndSoftware, + ConcreteWorkServices, + ConstructionMaterials, + ConsultingPublicRelations, + CorrespondenceSchools, + CosmeticStores, + CounselingServices, + CountryClubs, + CourierServices, + CourtCosts, + CreditReportingAgencies, + CruiseLines, + DairyProductsStores, + DanceHallStudiosSchools, + DatingEscortServices, + DentistsOrthodontists, + DepartmentStores, + DetectiveAgencies, + DigitalGoodsApplications, + DigitalGoodsGames, + DigitalGoodsLargeVolume, + DigitalGoodsMedia, + DirectMarketingCatalogMerchant, + DirectMarketingCombinationCatalogAndRetailMerchant, + DirectMarketingInboundTelemarketing, + DirectMarketingInsuranceServices, + DirectMarketingOther, + DirectMarketingOutboundTelemarketing, + DirectMarketingSubscription, + DirectMarketingTravel, + DiscountStores, + Doctors, + DoorToDoorSales, + DraperyWindowCoveringAndUpholsteryStores, + DrinkingPlaces, + DrugStoresAndPharmacies, + DrugsDrugProprietariesAndDruggistSundries, + DryCleaners, + DurableGoods, + DutyFreeStores, + EatingPlacesRestaurants, + EducationalServices, + ElectricRazorStores, + ElectricVehicleCharging, + ElectricalPartsAndEquipment, + ElectricalServices, + ElectronicsRepairShops, + ElectronicsStores, + ElementarySecondarySchools, + EmergencyServicesGcasVisaUseOnly, + EmploymentTempAgencies, + EquipmentRental, + ExterminatingServices, + FamilyClothingStores, + FastFoodRestaurants, + FinancialInstitutions, + FinesGovernmentAdministrativeEntities, + FireplaceFireplaceScreensAndAccessoriesStores, + FloorCoveringStores, + Florists, + FloristsSuppliesNurseryStockAndFlowers, + FreezerAndLockerMeatProvisioners, + FuelDealersNonAutomotive, + FuneralServicesCrematories, + FurnitureHomeFurnishingsAndEquipmentStoresExceptAppliances, + FurnitureRepairRefinishing, + FurriersAndFurShops, + GeneralServices, + GiftCardNoveltyAndSouvenirShops, + GlassPaintAndWallpaperStores, + GlasswareCrystalStores, + GolfCoursesPublic, + GovernmentLicensedHorseDogRacingUsRegionOnly, + GovernmentLicensedOnlineCasionsOnlineGamblingUsRegionOnly, + GovernmentOwnedLotteriesNonUsRegion, + GovernmentOwnedLotteriesUsRegionOnly, + GovernmentServices, + GroceryStoresSupermarkets, + HardwareEquipmentAndSupplies, + HardwareStores, + HealthAndBeautySpas, + HearingAidsSalesAndSupplies, + HeatingPlumbingAC, + HobbyToyAndGameShops, + HomeSupplyWarehouseStores, + Hospitals, + HotelsMotelsAndResorts, + HouseholdApplianceStores, + IndustrialSupplies, + InformationRetrievalServices, + InsuranceDefault, + InsuranceUnderwritingPremiums, + IntraCompanyPurchases, + JewelryStoresWatchesClocksAndSilverwareStores, + LandscapingServices, + Laundries, + LaundryCleaningServices, + LegalServicesAttorneys, + LuggageAndLeatherGoodsStores, + LumberBuildingMaterialsStores, + ManualCashDisburse, + MarinasServiceAndSupplies, + Marketplaces, + MasonryStoneworkAndPlaster, + MassageParlors, + MedicalAndDentalLabs, + MedicalDentalOphthalmicAndHospitalEquipmentAndSupplies, + MedicalServices, + MembershipOrganizations, + MensAndBoysClothingAndAccessoriesStores, + MensWomensClothingStores, + MetalServiceCenters, + MiscellaneousApparelAndAccessoryShops, + MiscellaneousAutoDealers, + MiscellaneousBusinessServices, + MiscellaneousFoodStores, + MiscellaneousGeneralMerchandise, + MiscellaneousGeneralServices, + MiscellaneousHomeFurnishingSpecialtyStores, + MiscellaneousPublishingAndPrinting, + MiscellaneousRecreationServices, + MiscellaneousRepairShops, + MiscellaneousSpecialtyRetail, + MobileHomeDealers, + MotionPictureTheaters, + MotorFreightCarriersAndTrucking, + MotorHomesDealers, + MotorVehicleSuppliesAndNewParts, + MotorcycleShopsAndDealers, + MotorcycleShopsDealers, + MusicStoresMusicalInstrumentsPianosAndSheetMusic, + NewsDealersAndNewsstands, + NonFiMoneyOrders, + NonFiStoredValueCardPurchaseLoad, + NondurableGoods, + NurseriesLawnAndGardenSupplyStores, + NursingPersonalCare, + OfficeAndCommercialFurniture, + OpticiansEyeglasses, + OptometristsOphthalmologist, + OrthopedicGoodsProstheticDevices, + Osteopaths, + PackageStoresBeerWineAndLiquor, + PaintsVarnishesAndSupplies, + ParkingLotsGarages, + PassengerRailways, + PawnShops, + PetShopsPetFoodAndSupplies, + PetroleumAndPetroleumProducts, + PhotoDeveloping, + PhotographicPhotocopyMicrofilmEquipmentAndSupplies, + PhotographicStudios, + PictureVideoProduction, + PieceGoodsNotionsAndOtherDryGoods, + PlumbingHeatingEquipmentAndSupplies, + PoliticalOrganizations, + PostalServicesGovernmentOnly, + PreciousStonesAndMetalsWatchesAndJewelry, + ProfessionalServices, + PublicWarehousingAndStorage, + QuickCopyReproAndBlueprint, + Railroads, + RealEstateAgentsAndManagersRentals, + RecordStores, + RecreationalVehicleRentals, + ReligiousGoodsStores, + ReligiousOrganizations, + RoofingSidingSheetMetal, + SecretarialSupportServices, + SecurityBrokersDealers, + ServiceStations, + SewingNeedleworkFabricAndPieceGoodsStores, + ShoeRepairHatCleaning, + ShoeStores, + SmallApplianceRepair, + SnowmobileDealers, + SpecialTradeServices, + SpecialtyCleaning, + SportingGoodsStores, + SportingRecreationCamps, + SportsAndRidingApparelStores, + SportsClubsFields, + StampAndCoinStores, + StationaryOfficeSuppliesPrintingAndWritingPaper, + StationeryStoresOfficeAndSchoolSupplyStores, + SwimmingPoolsSales, + TUiTravelGermany, + TailorsAlterations, + TaxPaymentsGovernmentAgencies, + TaxPreparationServices, + TaxicabsLimousines, + TelecommunicationEquipmentAndTelephoneSales, + TelecommunicationServices, + TelegraphServices, + TentAndAwningShops, + TestingLaboratories, + TheatricalTicketAgencies, + Timeshares, + TireRetreadingAndRepair, + TollsBridgeFees, + TouristAttractionsAndExhibits, + TowingServices, + TrailerParksCampgrounds, + TransportationServices, + TravelAgenciesTourOperators, + TruckStopIteration, + TruckUtilityTrailerRentals, + TypesettingPlateMakingAndRelatedServices, + TypewriterStores, + USFederalGovernmentAgenciesOrDepartments, + UniformsCommercialClothing, + UsedMerchandiseAndSecondhandStores, + Utilities, + VarietyStores, + VeterinaryServices, + VideoAmusementGameSupplies, + VideoGameArcades, + VideoTapeRentalStores, + VocationalTradeSchools, + WatchJewelryRepair, + WeldingRepair, + WholesaleClubs, + WigAndToupeeStores, + WiresMoneyOrders, + WomensAccessoryAndSpecialtyShops, + WomensReadyToWearStores, + WreckingAndSalvageYards, + /// An unrecognized value from Stripe. Should not be used as a request parameter. + Unknown, +} +impl CreateForceCaptureIssuingTransactionMerchantDataCategory { + pub fn as_str(self) -> &'static str { + use CreateForceCaptureIssuingTransactionMerchantDataCategory::*; + match self { + AcRefrigerationRepair => "ac_refrigeration_repair", + AccountingBookkeepingServices => "accounting_bookkeeping_services", + AdvertisingServices => "advertising_services", + AgriculturalCooperative => "agricultural_cooperative", + AirlinesAirCarriers => "airlines_air_carriers", + AirportsFlyingFields => "airports_flying_fields", + AmbulanceServices => "ambulance_services", + AmusementParksCarnivals => "amusement_parks_carnivals", + AntiqueReproductions => "antique_reproductions", + AntiqueShops => "antique_shops", + Aquariums => "aquariums", + ArchitecturalSurveyingServices => "architectural_surveying_services", + ArtDealersAndGalleries => "art_dealers_and_galleries", + ArtistsSupplyAndCraftShops => "artists_supply_and_craft_shops", + AutoAndHomeSupplyStores => "auto_and_home_supply_stores", + AutoBodyRepairShops => "auto_body_repair_shops", + AutoPaintShops => "auto_paint_shops", + AutoServiceShops => "auto_service_shops", + AutomatedCashDisburse => "automated_cash_disburse", + AutomatedFuelDispensers => "automated_fuel_dispensers", + AutomobileAssociations => "automobile_associations", + AutomotivePartsAndAccessoriesStores => "automotive_parts_and_accessories_stores", + AutomotiveTireStores => "automotive_tire_stores", + BailAndBondPayments => "bail_and_bond_payments", + Bakeries => "bakeries", + BandsOrchestras => "bands_orchestras", + BarberAndBeautyShops => "barber_and_beauty_shops", + BettingCasinoGambling => "betting_casino_gambling", + BicycleShops => "bicycle_shops", + BilliardPoolEstablishments => "billiard_pool_establishments", + BoatDealers => "boat_dealers", + BoatRentalsAndLeases => "boat_rentals_and_leases", + BookStores => "book_stores", + BooksPeriodicalsAndNewspapers => "books_periodicals_and_newspapers", + BowlingAlleys => "bowling_alleys", + BusLines => "bus_lines", + BusinessSecretarialSchools => "business_secretarial_schools", + BuyingShoppingServices => "buying_shopping_services", + CableSatelliteAndOtherPayTelevisionAndRadio => { + "cable_satellite_and_other_pay_television_and_radio" + } + CameraAndPhotographicSupplyStores => "camera_and_photographic_supply_stores", + CandyNutAndConfectioneryStores => "candy_nut_and_confectionery_stores", + CarAndTruckDealersNewUsed => "car_and_truck_dealers_new_used", + CarAndTruckDealersUsedOnly => "car_and_truck_dealers_used_only", + CarRentalAgencies => "car_rental_agencies", + CarWashes => "car_washes", + CarpentryServices => "carpentry_services", + CarpetUpholsteryCleaning => "carpet_upholstery_cleaning", + Caterers => "caterers", + CharitableAndSocialServiceOrganizationsFundraising => { + "charitable_and_social_service_organizations_fundraising" + } + ChemicalsAndAlliedProducts => "chemicals_and_allied_products", + ChildCareServices => "child_care_services", + ChildrensAndInfantsWearStores => "childrens_and_infants_wear_stores", + ChiropodistsPodiatrists => "chiropodists_podiatrists", + Chiropractors => "chiropractors", + CigarStoresAndStands => "cigar_stores_and_stands", + CivicSocialFraternalAssociations => "civic_social_fraternal_associations", + CleaningAndMaintenance => "cleaning_and_maintenance", + ClothingRental => "clothing_rental", + CollegesUniversities => "colleges_universities", + CommercialEquipment => "commercial_equipment", + CommercialFootwear => "commercial_footwear", + CommercialPhotographyArtAndGraphics => "commercial_photography_art_and_graphics", + CommuterTransportAndFerries => "commuter_transport_and_ferries", + ComputerNetworkServices => "computer_network_services", + ComputerProgramming => "computer_programming", + ComputerRepair => "computer_repair", + ComputerSoftwareStores => "computer_software_stores", + ComputersPeripheralsAndSoftware => "computers_peripherals_and_software", + ConcreteWorkServices => "concrete_work_services", + ConstructionMaterials => "construction_materials", + ConsultingPublicRelations => "consulting_public_relations", + CorrespondenceSchools => "correspondence_schools", + CosmeticStores => "cosmetic_stores", + CounselingServices => "counseling_services", + CountryClubs => "country_clubs", + CourierServices => "courier_services", + CourtCosts => "court_costs", + CreditReportingAgencies => "credit_reporting_agencies", + CruiseLines => "cruise_lines", + DairyProductsStores => "dairy_products_stores", + DanceHallStudiosSchools => "dance_hall_studios_schools", + DatingEscortServices => "dating_escort_services", + DentistsOrthodontists => "dentists_orthodontists", + DepartmentStores => "department_stores", + DetectiveAgencies => "detective_agencies", + DigitalGoodsApplications => "digital_goods_applications", + DigitalGoodsGames => "digital_goods_games", + DigitalGoodsLargeVolume => "digital_goods_large_volume", + DigitalGoodsMedia => "digital_goods_media", + DirectMarketingCatalogMerchant => "direct_marketing_catalog_merchant", + DirectMarketingCombinationCatalogAndRetailMerchant => { + "direct_marketing_combination_catalog_and_retail_merchant" + } + DirectMarketingInboundTelemarketing => "direct_marketing_inbound_telemarketing", + DirectMarketingInsuranceServices => "direct_marketing_insurance_services", + DirectMarketingOther => "direct_marketing_other", + DirectMarketingOutboundTelemarketing => "direct_marketing_outbound_telemarketing", + DirectMarketingSubscription => "direct_marketing_subscription", + DirectMarketingTravel => "direct_marketing_travel", + DiscountStores => "discount_stores", + Doctors => "doctors", + DoorToDoorSales => "door_to_door_sales", + DraperyWindowCoveringAndUpholsteryStores => { + "drapery_window_covering_and_upholstery_stores" + } + DrinkingPlaces => "drinking_places", + DrugStoresAndPharmacies => "drug_stores_and_pharmacies", + DrugsDrugProprietariesAndDruggistSundries => { + "drugs_drug_proprietaries_and_druggist_sundries" + } + DryCleaners => "dry_cleaners", + DurableGoods => "durable_goods", + DutyFreeStores => "duty_free_stores", + EatingPlacesRestaurants => "eating_places_restaurants", + EducationalServices => "educational_services", + ElectricRazorStores => "electric_razor_stores", + ElectricVehicleCharging => "electric_vehicle_charging", + ElectricalPartsAndEquipment => "electrical_parts_and_equipment", + ElectricalServices => "electrical_services", + ElectronicsRepairShops => "electronics_repair_shops", + ElectronicsStores => "electronics_stores", + ElementarySecondarySchools => "elementary_secondary_schools", + EmergencyServicesGcasVisaUseOnly => "emergency_services_gcas_visa_use_only", + EmploymentTempAgencies => "employment_temp_agencies", + EquipmentRental => "equipment_rental", + ExterminatingServices => "exterminating_services", + FamilyClothingStores => "family_clothing_stores", + FastFoodRestaurants => "fast_food_restaurants", + FinancialInstitutions => "financial_institutions", + FinesGovernmentAdministrativeEntities => "fines_government_administrative_entities", + FireplaceFireplaceScreensAndAccessoriesStores => { + "fireplace_fireplace_screens_and_accessories_stores" + } + FloorCoveringStores => "floor_covering_stores", + Florists => "florists", + FloristsSuppliesNurseryStockAndFlowers => "florists_supplies_nursery_stock_and_flowers", + FreezerAndLockerMeatProvisioners => "freezer_and_locker_meat_provisioners", + FuelDealersNonAutomotive => "fuel_dealers_non_automotive", + FuneralServicesCrematories => "funeral_services_crematories", + FurnitureHomeFurnishingsAndEquipmentStoresExceptAppliances => { + "furniture_home_furnishings_and_equipment_stores_except_appliances" + } + FurnitureRepairRefinishing => "furniture_repair_refinishing", + FurriersAndFurShops => "furriers_and_fur_shops", + GeneralServices => "general_services", + GiftCardNoveltyAndSouvenirShops => "gift_card_novelty_and_souvenir_shops", + GlassPaintAndWallpaperStores => "glass_paint_and_wallpaper_stores", + GlasswareCrystalStores => "glassware_crystal_stores", + GolfCoursesPublic => "golf_courses_public", + GovernmentLicensedHorseDogRacingUsRegionOnly => { + "government_licensed_horse_dog_racing_us_region_only" + } + GovernmentLicensedOnlineCasionsOnlineGamblingUsRegionOnly => { + "government_licensed_online_casions_online_gambling_us_region_only" + } + GovernmentOwnedLotteriesNonUsRegion => "government_owned_lotteries_non_us_region", + GovernmentOwnedLotteriesUsRegionOnly => "government_owned_lotteries_us_region_only", + GovernmentServices => "government_services", + GroceryStoresSupermarkets => "grocery_stores_supermarkets", + HardwareEquipmentAndSupplies => "hardware_equipment_and_supplies", + HardwareStores => "hardware_stores", + HealthAndBeautySpas => "health_and_beauty_spas", + HearingAidsSalesAndSupplies => "hearing_aids_sales_and_supplies", + HeatingPlumbingAC => "heating_plumbing_a_c", + HobbyToyAndGameShops => "hobby_toy_and_game_shops", + HomeSupplyWarehouseStores => "home_supply_warehouse_stores", + Hospitals => "hospitals", + HotelsMotelsAndResorts => "hotels_motels_and_resorts", + HouseholdApplianceStores => "household_appliance_stores", + IndustrialSupplies => "industrial_supplies", + InformationRetrievalServices => "information_retrieval_services", + InsuranceDefault => "insurance_default", + InsuranceUnderwritingPremiums => "insurance_underwriting_premiums", + IntraCompanyPurchases => "intra_company_purchases", + JewelryStoresWatchesClocksAndSilverwareStores => { + "jewelry_stores_watches_clocks_and_silverware_stores" + } + LandscapingServices => "landscaping_services", + Laundries => "laundries", + LaundryCleaningServices => "laundry_cleaning_services", + LegalServicesAttorneys => "legal_services_attorneys", + LuggageAndLeatherGoodsStores => "luggage_and_leather_goods_stores", + LumberBuildingMaterialsStores => "lumber_building_materials_stores", + ManualCashDisburse => "manual_cash_disburse", + MarinasServiceAndSupplies => "marinas_service_and_supplies", + Marketplaces => "marketplaces", + MasonryStoneworkAndPlaster => "masonry_stonework_and_plaster", + MassageParlors => "massage_parlors", + MedicalAndDentalLabs => "medical_and_dental_labs", + MedicalDentalOphthalmicAndHospitalEquipmentAndSupplies => { + "medical_dental_ophthalmic_and_hospital_equipment_and_supplies" + } + MedicalServices => "medical_services", + MembershipOrganizations => "membership_organizations", + MensAndBoysClothingAndAccessoriesStores => { + "mens_and_boys_clothing_and_accessories_stores" + } + MensWomensClothingStores => "mens_womens_clothing_stores", + MetalServiceCenters => "metal_service_centers", + MiscellaneousApparelAndAccessoryShops => "miscellaneous_apparel_and_accessory_shops", + MiscellaneousAutoDealers => "miscellaneous_auto_dealers", + MiscellaneousBusinessServices => "miscellaneous_business_services", + MiscellaneousFoodStores => "miscellaneous_food_stores", + MiscellaneousGeneralMerchandise => "miscellaneous_general_merchandise", + MiscellaneousGeneralServices => "miscellaneous_general_services", + MiscellaneousHomeFurnishingSpecialtyStores => { + "miscellaneous_home_furnishing_specialty_stores" + } + MiscellaneousPublishingAndPrinting => "miscellaneous_publishing_and_printing", + MiscellaneousRecreationServices => "miscellaneous_recreation_services", + MiscellaneousRepairShops => "miscellaneous_repair_shops", + MiscellaneousSpecialtyRetail => "miscellaneous_specialty_retail", + MobileHomeDealers => "mobile_home_dealers", + MotionPictureTheaters => "motion_picture_theaters", + MotorFreightCarriersAndTrucking => "motor_freight_carriers_and_trucking", + MotorHomesDealers => "motor_homes_dealers", + MotorVehicleSuppliesAndNewParts => "motor_vehicle_supplies_and_new_parts", + MotorcycleShopsAndDealers => "motorcycle_shops_and_dealers", + MotorcycleShopsDealers => "motorcycle_shops_dealers", + MusicStoresMusicalInstrumentsPianosAndSheetMusic => { + "music_stores_musical_instruments_pianos_and_sheet_music" + } + NewsDealersAndNewsstands => "news_dealers_and_newsstands", + NonFiMoneyOrders => "non_fi_money_orders", + NonFiStoredValueCardPurchaseLoad => "non_fi_stored_value_card_purchase_load", + NondurableGoods => "nondurable_goods", + NurseriesLawnAndGardenSupplyStores => "nurseries_lawn_and_garden_supply_stores", + NursingPersonalCare => "nursing_personal_care", + OfficeAndCommercialFurniture => "office_and_commercial_furniture", + OpticiansEyeglasses => "opticians_eyeglasses", + OptometristsOphthalmologist => "optometrists_ophthalmologist", + OrthopedicGoodsProstheticDevices => "orthopedic_goods_prosthetic_devices", + Osteopaths => "osteopaths", + PackageStoresBeerWineAndLiquor => "package_stores_beer_wine_and_liquor", + PaintsVarnishesAndSupplies => "paints_varnishes_and_supplies", + ParkingLotsGarages => "parking_lots_garages", + PassengerRailways => "passenger_railways", + PawnShops => "pawn_shops", + PetShopsPetFoodAndSupplies => "pet_shops_pet_food_and_supplies", + PetroleumAndPetroleumProducts => "petroleum_and_petroleum_products", + PhotoDeveloping => "photo_developing", + PhotographicPhotocopyMicrofilmEquipmentAndSupplies => { + "photographic_photocopy_microfilm_equipment_and_supplies" + } + PhotographicStudios => "photographic_studios", + PictureVideoProduction => "picture_video_production", + PieceGoodsNotionsAndOtherDryGoods => "piece_goods_notions_and_other_dry_goods", + PlumbingHeatingEquipmentAndSupplies => "plumbing_heating_equipment_and_supplies", + PoliticalOrganizations => "political_organizations", + PostalServicesGovernmentOnly => "postal_services_government_only", + PreciousStonesAndMetalsWatchesAndJewelry => { + "precious_stones_and_metals_watches_and_jewelry" + } + ProfessionalServices => "professional_services", + PublicWarehousingAndStorage => "public_warehousing_and_storage", + QuickCopyReproAndBlueprint => "quick_copy_repro_and_blueprint", + Railroads => "railroads", + RealEstateAgentsAndManagersRentals => "real_estate_agents_and_managers_rentals", + RecordStores => "record_stores", + RecreationalVehicleRentals => "recreational_vehicle_rentals", + ReligiousGoodsStores => "religious_goods_stores", + ReligiousOrganizations => "religious_organizations", + RoofingSidingSheetMetal => "roofing_siding_sheet_metal", + SecretarialSupportServices => "secretarial_support_services", + SecurityBrokersDealers => "security_brokers_dealers", + ServiceStations => "service_stations", + SewingNeedleworkFabricAndPieceGoodsStores => { + "sewing_needlework_fabric_and_piece_goods_stores" + } + ShoeRepairHatCleaning => "shoe_repair_hat_cleaning", + ShoeStores => "shoe_stores", + SmallApplianceRepair => "small_appliance_repair", + SnowmobileDealers => "snowmobile_dealers", + SpecialTradeServices => "special_trade_services", + SpecialtyCleaning => "specialty_cleaning", + SportingGoodsStores => "sporting_goods_stores", + SportingRecreationCamps => "sporting_recreation_camps", + SportsAndRidingApparelStores => "sports_and_riding_apparel_stores", + SportsClubsFields => "sports_clubs_fields", + StampAndCoinStores => "stamp_and_coin_stores", + StationaryOfficeSuppliesPrintingAndWritingPaper => { + "stationary_office_supplies_printing_and_writing_paper" + } + StationeryStoresOfficeAndSchoolSupplyStores => { + "stationery_stores_office_and_school_supply_stores" + } + SwimmingPoolsSales => "swimming_pools_sales", + TUiTravelGermany => "t_ui_travel_germany", + TailorsAlterations => "tailors_alterations", + TaxPaymentsGovernmentAgencies => "tax_payments_government_agencies", + TaxPreparationServices => "tax_preparation_services", + TaxicabsLimousines => "taxicabs_limousines", + TelecommunicationEquipmentAndTelephoneSales => { + "telecommunication_equipment_and_telephone_sales" + } + TelecommunicationServices => "telecommunication_services", + TelegraphServices => "telegraph_services", + TentAndAwningShops => "tent_and_awning_shops", + TestingLaboratories => "testing_laboratories", + TheatricalTicketAgencies => "theatrical_ticket_agencies", + Timeshares => "timeshares", + TireRetreadingAndRepair => "tire_retreading_and_repair", + TollsBridgeFees => "tolls_bridge_fees", + TouristAttractionsAndExhibits => "tourist_attractions_and_exhibits", + TowingServices => "towing_services", + TrailerParksCampgrounds => "trailer_parks_campgrounds", + TransportationServices => "transportation_services", + TravelAgenciesTourOperators => "travel_agencies_tour_operators", + TruckStopIteration => "truck_stop_iteration", + TruckUtilityTrailerRentals => "truck_utility_trailer_rentals", + TypesettingPlateMakingAndRelatedServices => { + "typesetting_plate_making_and_related_services" + } + TypewriterStores => "typewriter_stores", + USFederalGovernmentAgenciesOrDepartments => { + "u_s_federal_government_agencies_or_departments" + } + UniformsCommercialClothing => "uniforms_commercial_clothing", + UsedMerchandiseAndSecondhandStores => "used_merchandise_and_secondhand_stores", + Utilities => "utilities", + VarietyStores => "variety_stores", + VeterinaryServices => "veterinary_services", + VideoAmusementGameSupplies => "video_amusement_game_supplies", + VideoGameArcades => "video_game_arcades", + VideoTapeRentalStores => "video_tape_rental_stores", + VocationalTradeSchools => "vocational_trade_schools", + WatchJewelryRepair => "watch_jewelry_repair", + WeldingRepair => "welding_repair", + WholesaleClubs => "wholesale_clubs", + WigAndToupeeStores => "wig_and_toupee_stores", + WiresMoneyOrders => "wires_money_orders", + WomensAccessoryAndSpecialtyShops => "womens_accessory_and_specialty_shops", + WomensReadyToWearStores => "womens_ready_to_wear_stores", + WreckingAndSalvageYards => "wrecking_and_salvage_yards", + Unknown => "unknown", + } + } +} + +impl std::str::FromStr for CreateForceCaptureIssuingTransactionMerchantDataCategory { + type Err = (); + fn from_str(s: &str) -> Result { + use CreateForceCaptureIssuingTransactionMerchantDataCategory::*; + match s { + "ac_refrigeration_repair" => Ok(AcRefrigerationRepair), + "accounting_bookkeeping_services" => Ok(AccountingBookkeepingServices), + "advertising_services" => Ok(AdvertisingServices), + "agricultural_cooperative" => Ok(AgriculturalCooperative), + "airlines_air_carriers" => Ok(AirlinesAirCarriers), + "airports_flying_fields" => Ok(AirportsFlyingFields), + "ambulance_services" => Ok(AmbulanceServices), + "amusement_parks_carnivals" => Ok(AmusementParksCarnivals), + "antique_reproductions" => Ok(AntiqueReproductions), + "antique_shops" => Ok(AntiqueShops), + "aquariums" => Ok(Aquariums), + "architectural_surveying_services" => Ok(ArchitecturalSurveyingServices), + "art_dealers_and_galleries" => Ok(ArtDealersAndGalleries), + "artists_supply_and_craft_shops" => Ok(ArtistsSupplyAndCraftShops), + "auto_and_home_supply_stores" => Ok(AutoAndHomeSupplyStores), + "auto_body_repair_shops" => Ok(AutoBodyRepairShops), + "auto_paint_shops" => Ok(AutoPaintShops), + "auto_service_shops" => Ok(AutoServiceShops), + "automated_cash_disburse" => Ok(AutomatedCashDisburse), + "automated_fuel_dispensers" => Ok(AutomatedFuelDispensers), + "automobile_associations" => Ok(AutomobileAssociations), + "automotive_parts_and_accessories_stores" => Ok(AutomotivePartsAndAccessoriesStores), + "automotive_tire_stores" => Ok(AutomotiveTireStores), + "bail_and_bond_payments" => Ok(BailAndBondPayments), + "bakeries" => Ok(Bakeries), + "bands_orchestras" => Ok(BandsOrchestras), + "barber_and_beauty_shops" => Ok(BarberAndBeautyShops), + "betting_casino_gambling" => Ok(BettingCasinoGambling), + "bicycle_shops" => Ok(BicycleShops), + "billiard_pool_establishments" => Ok(BilliardPoolEstablishments), + "boat_dealers" => Ok(BoatDealers), + "boat_rentals_and_leases" => Ok(BoatRentalsAndLeases), + "book_stores" => Ok(BookStores), + "books_periodicals_and_newspapers" => Ok(BooksPeriodicalsAndNewspapers), + "bowling_alleys" => Ok(BowlingAlleys), + "bus_lines" => Ok(BusLines), + "business_secretarial_schools" => Ok(BusinessSecretarialSchools), + "buying_shopping_services" => Ok(BuyingShoppingServices), + "cable_satellite_and_other_pay_television_and_radio" => { + Ok(CableSatelliteAndOtherPayTelevisionAndRadio) + } + "camera_and_photographic_supply_stores" => Ok(CameraAndPhotographicSupplyStores), + "candy_nut_and_confectionery_stores" => Ok(CandyNutAndConfectioneryStores), + "car_and_truck_dealers_new_used" => Ok(CarAndTruckDealersNewUsed), + "car_and_truck_dealers_used_only" => Ok(CarAndTruckDealersUsedOnly), + "car_rental_agencies" => Ok(CarRentalAgencies), + "car_washes" => Ok(CarWashes), + "carpentry_services" => Ok(CarpentryServices), + "carpet_upholstery_cleaning" => Ok(CarpetUpholsteryCleaning), + "caterers" => Ok(Caterers), + "charitable_and_social_service_organizations_fundraising" => { + Ok(CharitableAndSocialServiceOrganizationsFundraising) + } + "chemicals_and_allied_products" => Ok(ChemicalsAndAlliedProducts), + "child_care_services" => Ok(ChildCareServices), + "childrens_and_infants_wear_stores" => Ok(ChildrensAndInfantsWearStores), + "chiropodists_podiatrists" => Ok(ChiropodistsPodiatrists), + "chiropractors" => Ok(Chiropractors), + "cigar_stores_and_stands" => Ok(CigarStoresAndStands), + "civic_social_fraternal_associations" => Ok(CivicSocialFraternalAssociations), + "cleaning_and_maintenance" => Ok(CleaningAndMaintenance), + "clothing_rental" => Ok(ClothingRental), + "colleges_universities" => Ok(CollegesUniversities), + "commercial_equipment" => Ok(CommercialEquipment), + "commercial_footwear" => Ok(CommercialFootwear), + "commercial_photography_art_and_graphics" => Ok(CommercialPhotographyArtAndGraphics), + "commuter_transport_and_ferries" => Ok(CommuterTransportAndFerries), + "computer_network_services" => Ok(ComputerNetworkServices), + "computer_programming" => Ok(ComputerProgramming), + "computer_repair" => Ok(ComputerRepair), + "computer_software_stores" => Ok(ComputerSoftwareStores), + "computers_peripherals_and_software" => Ok(ComputersPeripheralsAndSoftware), + "concrete_work_services" => Ok(ConcreteWorkServices), + "construction_materials" => Ok(ConstructionMaterials), + "consulting_public_relations" => Ok(ConsultingPublicRelations), + "correspondence_schools" => Ok(CorrespondenceSchools), + "cosmetic_stores" => Ok(CosmeticStores), + "counseling_services" => Ok(CounselingServices), + "country_clubs" => Ok(CountryClubs), + "courier_services" => Ok(CourierServices), + "court_costs" => Ok(CourtCosts), + "credit_reporting_agencies" => Ok(CreditReportingAgencies), + "cruise_lines" => Ok(CruiseLines), + "dairy_products_stores" => Ok(DairyProductsStores), + "dance_hall_studios_schools" => Ok(DanceHallStudiosSchools), + "dating_escort_services" => Ok(DatingEscortServices), + "dentists_orthodontists" => Ok(DentistsOrthodontists), + "department_stores" => Ok(DepartmentStores), + "detective_agencies" => Ok(DetectiveAgencies), + "digital_goods_applications" => Ok(DigitalGoodsApplications), + "digital_goods_games" => Ok(DigitalGoodsGames), + "digital_goods_large_volume" => Ok(DigitalGoodsLargeVolume), + "digital_goods_media" => Ok(DigitalGoodsMedia), + "direct_marketing_catalog_merchant" => Ok(DirectMarketingCatalogMerchant), + "direct_marketing_combination_catalog_and_retail_merchant" => { + Ok(DirectMarketingCombinationCatalogAndRetailMerchant) + } + "direct_marketing_inbound_telemarketing" => Ok(DirectMarketingInboundTelemarketing), + "direct_marketing_insurance_services" => Ok(DirectMarketingInsuranceServices), + "direct_marketing_other" => Ok(DirectMarketingOther), + "direct_marketing_outbound_telemarketing" => Ok(DirectMarketingOutboundTelemarketing), + "direct_marketing_subscription" => Ok(DirectMarketingSubscription), + "direct_marketing_travel" => Ok(DirectMarketingTravel), + "discount_stores" => Ok(DiscountStores), + "doctors" => Ok(Doctors), + "door_to_door_sales" => Ok(DoorToDoorSales), + "drapery_window_covering_and_upholstery_stores" => { + Ok(DraperyWindowCoveringAndUpholsteryStores) + } + "drinking_places" => Ok(DrinkingPlaces), + "drug_stores_and_pharmacies" => Ok(DrugStoresAndPharmacies), + "drugs_drug_proprietaries_and_druggist_sundries" => { + Ok(DrugsDrugProprietariesAndDruggistSundries) + } + "dry_cleaners" => Ok(DryCleaners), + "durable_goods" => Ok(DurableGoods), + "duty_free_stores" => Ok(DutyFreeStores), + "eating_places_restaurants" => Ok(EatingPlacesRestaurants), + "educational_services" => Ok(EducationalServices), + "electric_razor_stores" => Ok(ElectricRazorStores), + "electric_vehicle_charging" => Ok(ElectricVehicleCharging), + "electrical_parts_and_equipment" => Ok(ElectricalPartsAndEquipment), + "electrical_services" => Ok(ElectricalServices), + "electronics_repair_shops" => Ok(ElectronicsRepairShops), + "electronics_stores" => Ok(ElectronicsStores), + "elementary_secondary_schools" => Ok(ElementarySecondarySchools), + "emergency_services_gcas_visa_use_only" => Ok(EmergencyServicesGcasVisaUseOnly), + "employment_temp_agencies" => Ok(EmploymentTempAgencies), + "equipment_rental" => Ok(EquipmentRental), + "exterminating_services" => Ok(ExterminatingServices), + "family_clothing_stores" => Ok(FamilyClothingStores), + "fast_food_restaurants" => Ok(FastFoodRestaurants), + "financial_institutions" => Ok(FinancialInstitutions), + "fines_government_administrative_entities" => Ok(FinesGovernmentAdministrativeEntities), + "fireplace_fireplace_screens_and_accessories_stores" => { + Ok(FireplaceFireplaceScreensAndAccessoriesStores) + } + "floor_covering_stores" => Ok(FloorCoveringStores), + "florists" => Ok(Florists), + "florists_supplies_nursery_stock_and_flowers" => { + Ok(FloristsSuppliesNurseryStockAndFlowers) + } + "freezer_and_locker_meat_provisioners" => Ok(FreezerAndLockerMeatProvisioners), + "fuel_dealers_non_automotive" => Ok(FuelDealersNonAutomotive), + "funeral_services_crematories" => Ok(FuneralServicesCrematories), + "furniture_home_furnishings_and_equipment_stores_except_appliances" => { + Ok(FurnitureHomeFurnishingsAndEquipmentStoresExceptAppliances) + } + "furniture_repair_refinishing" => Ok(FurnitureRepairRefinishing), + "furriers_and_fur_shops" => Ok(FurriersAndFurShops), + "general_services" => Ok(GeneralServices), + "gift_card_novelty_and_souvenir_shops" => Ok(GiftCardNoveltyAndSouvenirShops), + "glass_paint_and_wallpaper_stores" => Ok(GlassPaintAndWallpaperStores), + "glassware_crystal_stores" => Ok(GlasswareCrystalStores), + "golf_courses_public" => Ok(GolfCoursesPublic), + "government_licensed_horse_dog_racing_us_region_only" => { + Ok(GovernmentLicensedHorseDogRacingUsRegionOnly) + } + "government_licensed_online_casions_online_gambling_us_region_only" => { + Ok(GovernmentLicensedOnlineCasionsOnlineGamblingUsRegionOnly) + } + "government_owned_lotteries_non_us_region" => Ok(GovernmentOwnedLotteriesNonUsRegion), + "government_owned_lotteries_us_region_only" => Ok(GovernmentOwnedLotteriesUsRegionOnly), + "government_services" => Ok(GovernmentServices), + "grocery_stores_supermarkets" => Ok(GroceryStoresSupermarkets), + "hardware_equipment_and_supplies" => Ok(HardwareEquipmentAndSupplies), + "hardware_stores" => Ok(HardwareStores), + "health_and_beauty_spas" => Ok(HealthAndBeautySpas), + "hearing_aids_sales_and_supplies" => Ok(HearingAidsSalesAndSupplies), + "heating_plumbing_a_c" => Ok(HeatingPlumbingAC), + "hobby_toy_and_game_shops" => Ok(HobbyToyAndGameShops), + "home_supply_warehouse_stores" => Ok(HomeSupplyWarehouseStores), + "hospitals" => Ok(Hospitals), + "hotels_motels_and_resorts" => Ok(HotelsMotelsAndResorts), + "household_appliance_stores" => Ok(HouseholdApplianceStores), + "industrial_supplies" => Ok(IndustrialSupplies), + "information_retrieval_services" => Ok(InformationRetrievalServices), + "insurance_default" => Ok(InsuranceDefault), + "insurance_underwriting_premiums" => Ok(InsuranceUnderwritingPremiums), + "intra_company_purchases" => Ok(IntraCompanyPurchases), + "jewelry_stores_watches_clocks_and_silverware_stores" => { + Ok(JewelryStoresWatchesClocksAndSilverwareStores) + } + "landscaping_services" => Ok(LandscapingServices), + "laundries" => Ok(Laundries), + "laundry_cleaning_services" => Ok(LaundryCleaningServices), + "legal_services_attorneys" => Ok(LegalServicesAttorneys), + "luggage_and_leather_goods_stores" => Ok(LuggageAndLeatherGoodsStores), + "lumber_building_materials_stores" => Ok(LumberBuildingMaterialsStores), + "manual_cash_disburse" => Ok(ManualCashDisburse), + "marinas_service_and_supplies" => Ok(MarinasServiceAndSupplies), + "marketplaces" => Ok(Marketplaces), + "masonry_stonework_and_plaster" => Ok(MasonryStoneworkAndPlaster), + "massage_parlors" => Ok(MassageParlors), + "medical_and_dental_labs" => Ok(MedicalAndDentalLabs), + "medical_dental_ophthalmic_and_hospital_equipment_and_supplies" => { + Ok(MedicalDentalOphthalmicAndHospitalEquipmentAndSupplies) + } + "medical_services" => Ok(MedicalServices), + "membership_organizations" => Ok(MembershipOrganizations), + "mens_and_boys_clothing_and_accessories_stores" => { + Ok(MensAndBoysClothingAndAccessoriesStores) + } + "mens_womens_clothing_stores" => Ok(MensWomensClothingStores), + "metal_service_centers" => Ok(MetalServiceCenters), + "miscellaneous_apparel_and_accessory_shops" => { + Ok(MiscellaneousApparelAndAccessoryShops) + } + "miscellaneous_auto_dealers" => Ok(MiscellaneousAutoDealers), + "miscellaneous_business_services" => Ok(MiscellaneousBusinessServices), + "miscellaneous_food_stores" => Ok(MiscellaneousFoodStores), + "miscellaneous_general_merchandise" => Ok(MiscellaneousGeneralMerchandise), + "miscellaneous_general_services" => Ok(MiscellaneousGeneralServices), + "miscellaneous_home_furnishing_specialty_stores" => { + Ok(MiscellaneousHomeFurnishingSpecialtyStores) + } + "miscellaneous_publishing_and_printing" => Ok(MiscellaneousPublishingAndPrinting), + "miscellaneous_recreation_services" => Ok(MiscellaneousRecreationServices), + "miscellaneous_repair_shops" => Ok(MiscellaneousRepairShops), + "miscellaneous_specialty_retail" => Ok(MiscellaneousSpecialtyRetail), + "mobile_home_dealers" => Ok(MobileHomeDealers), + "motion_picture_theaters" => Ok(MotionPictureTheaters), + "motor_freight_carriers_and_trucking" => Ok(MotorFreightCarriersAndTrucking), + "motor_homes_dealers" => Ok(MotorHomesDealers), + "motor_vehicle_supplies_and_new_parts" => Ok(MotorVehicleSuppliesAndNewParts), + "motorcycle_shops_and_dealers" => Ok(MotorcycleShopsAndDealers), + "motorcycle_shops_dealers" => Ok(MotorcycleShopsDealers), + "music_stores_musical_instruments_pianos_and_sheet_music" => { + Ok(MusicStoresMusicalInstrumentsPianosAndSheetMusic) + } + "news_dealers_and_newsstands" => Ok(NewsDealersAndNewsstands), + "non_fi_money_orders" => Ok(NonFiMoneyOrders), + "non_fi_stored_value_card_purchase_load" => Ok(NonFiStoredValueCardPurchaseLoad), + "nondurable_goods" => Ok(NondurableGoods), + "nurseries_lawn_and_garden_supply_stores" => Ok(NurseriesLawnAndGardenSupplyStores), + "nursing_personal_care" => Ok(NursingPersonalCare), + "office_and_commercial_furniture" => Ok(OfficeAndCommercialFurniture), + "opticians_eyeglasses" => Ok(OpticiansEyeglasses), + "optometrists_ophthalmologist" => Ok(OptometristsOphthalmologist), + "orthopedic_goods_prosthetic_devices" => Ok(OrthopedicGoodsProstheticDevices), + "osteopaths" => Ok(Osteopaths), + "package_stores_beer_wine_and_liquor" => Ok(PackageStoresBeerWineAndLiquor), + "paints_varnishes_and_supplies" => Ok(PaintsVarnishesAndSupplies), + "parking_lots_garages" => Ok(ParkingLotsGarages), + "passenger_railways" => Ok(PassengerRailways), + "pawn_shops" => Ok(PawnShops), + "pet_shops_pet_food_and_supplies" => Ok(PetShopsPetFoodAndSupplies), + "petroleum_and_petroleum_products" => Ok(PetroleumAndPetroleumProducts), + "photo_developing" => Ok(PhotoDeveloping), + "photographic_photocopy_microfilm_equipment_and_supplies" => { + Ok(PhotographicPhotocopyMicrofilmEquipmentAndSupplies) + } + "photographic_studios" => Ok(PhotographicStudios), + "picture_video_production" => Ok(PictureVideoProduction), + "piece_goods_notions_and_other_dry_goods" => Ok(PieceGoodsNotionsAndOtherDryGoods), + "plumbing_heating_equipment_and_supplies" => Ok(PlumbingHeatingEquipmentAndSupplies), + "political_organizations" => Ok(PoliticalOrganizations), + "postal_services_government_only" => Ok(PostalServicesGovernmentOnly), + "precious_stones_and_metals_watches_and_jewelry" => { + Ok(PreciousStonesAndMetalsWatchesAndJewelry) + } + "professional_services" => Ok(ProfessionalServices), + "public_warehousing_and_storage" => Ok(PublicWarehousingAndStorage), + "quick_copy_repro_and_blueprint" => Ok(QuickCopyReproAndBlueprint), + "railroads" => Ok(Railroads), + "real_estate_agents_and_managers_rentals" => Ok(RealEstateAgentsAndManagersRentals), + "record_stores" => Ok(RecordStores), + "recreational_vehicle_rentals" => Ok(RecreationalVehicleRentals), + "religious_goods_stores" => Ok(ReligiousGoodsStores), + "religious_organizations" => Ok(ReligiousOrganizations), + "roofing_siding_sheet_metal" => Ok(RoofingSidingSheetMetal), + "secretarial_support_services" => Ok(SecretarialSupportServices), + "security_brokers_dealers" => Ok(SecurityBrokersDealers), + "service_stations" => Ok(ServiceStations), + "sewing_needlework_fabric_and_piece_goods_stores" => { + Ok(SewingNeedleworkFabricAndPieceGoodsStores) + } + "shoe_repair_hat_cleaning" => Ok(ShoeRepairHatCleaning), + "shoe_stores" => Ok(ShoeStores), + "small_appliance_repair" => Ok(SmallApplianceRepair), + "snowmobile_dealers" => Ok(SnowmobileDealers), + "special_trade_services" => Ok(SpecialTradeServices), + "specialty_cleaning" => Ok(SpecialtyCleaning), + "sporting_goods_stores" => Ok(SportingGoodsStores), + "sporting_recreation_camps" => Ok(SportingRecreationCamps), + "sports_and_riding_apparel_stores" => Ok(SportsAndRidingApparelStores), + "sports_clubs_fields" => Ok(SportsClubsFields), + "stamp_and_coin_stores" => Ok(StampAndCoinStores), + "stationary_office_supplies_printing_and_writing_paper" => { + Ok(StationaryOfficeSuppliesPrintingAndWritingPaper) + } + "stationery_stores_office_and_school_supply_stores" => { + Ok(StationeryStoresOfficeAndSchoolSupplyStores) + } + "swimming_pools_sales" => Ok(SwimmingPoolsSales), + "t_ui_travel_germany" => Ok(TUiTravelGermany), + "tailors_alterations" => Ok(TailorsAlterations), + "tax_payments_government_agencies" => Ok(TaxPaymentsGovernmentAgencies), + "tax_preparation_services" => Ok(TaxPreparationServices), + "taxicabs_limousines" => Ok(TaxicabsLimousines), + "telecommunication_equipment_and_telephone_sales" => { + Ok(TelecommunicationEquipmentAndTelephoneSales) + } + "telecommunication_services" => Ok(TelecommunicationServices), + "telegraph_services" => Ok(TelegraphServices), + "tent_and_awning_shops" => Ok(TentAndAwningShops), + "testing_laboratories" => Ok(TestingLaboratories), + "theatrical_ticket_agencies" => Ok(TheatricalTicketAgencies), + "timeshares" => Ok(Timeshares), + "tire_retreading_and_repair" => Ok(TireRetreadingAndRepair), + "tolls_bridge_fees" => Ok(TollsBridgeFees), + "tourist_attractions_and_exhibits" => Ok(TouristAttractionsAndExhibits), + "towing_services" => Ok(TowingServices), + "trailer_parks_campgrounds" => Ok(TrailerParksCampgrounds), + "transportation_services" => Ok(TransportationServices), + "travel_agencies_tour_operators" => Ok(TravelAgenciesTourOperators), + "truck_stop_iteration" => Ok(TruckStopIteration), + "truck_utility_trailer_rentals" => Ok(TruckUtilityTrailerRentals), + "typesetting_plate_making_and_related_services" => { + Ok(TypesettingPlateMakingAndRelatedServices) + } + "typewriter_stores" => Ok(TypewriterStores), + "u_s_federal_government_agencies_or_departments" => { + Ok(USFederalGovernmentAgenciesOrDepartments) + } + "uniforms_commercial_clothing" => Ok(UniformsCommercialClothing), + "used_merchandise_and_secondhand_stores" => Ok(UsedMerchandiseAndSecondhandStores), + "utilities" => Ok(Utilities), + "variety_stores" => Ok(VarietyStores), + "veterinary_services" => Ok(VeterinaryServices), + "video_amusement_game_supplies" => Ok(VideoAmusementGameSupplies), + "video_game_arcades" => Ok(VideoGameArcades), + "video_tape_rental_stores" => Ok(VideoTapeRentalStores), + "vocational_trade_schools" => Ok(VocationalTradeSchools), + "watch_jewelry_repair" => Ok(WatchJewelryRepair), + "welding_repair" => Ok(WeldingRepair), + "wholesale_clubs" => Ok(WholesaleClubs), + "wig_and_toupee_stores" => Ok(WigAndToupeeStores), + "wires_money_orders" => Ok(WiresMoneyOrders), + "womens_accessory_and_specialty_shops" => Ok(WomensAccessoryAndSpecialtyShops), + "womens_ready_to_wear_stores" => Ok(WomensReadyToWearStores), + "wrecking_and_salvage_yards" => Ok(WreckingAndSalvageYards), + _ => Err(()), + } + } +} +impl std::fmt::Display for CreateForceCaptureIssuingTransactionMerchantDataCategory { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreateForceCaptureIssuingTransactionMerchantDataCategory { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreateForceCaptureIssuingTransactionMerchantDataCategory { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Additional purchase information that is optionally provided by the merchant. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreateForceCaptureIssuingTransactionPurchaseDetails<'a> { + /// Information about the flight that was purchased with this transaction. + #[serde(skip_serializing_if = "Option::is_none")] + pub flight: Option>, + /// Information about fuel that was purchased with this transaction. + #[serde(skip_serializing_if = "Option::is_none")] + pub fuel: Option>, + /// Information about lodging that was purchased with this transaction. + #[serde(skip_serializing_if = "Option::is_none")] + pub lodging: Option, + /// The line items in the purchase. + #[serde(skip_serializing_if = "Option::is_none")] + pub receipt: Option<&'a [ReceiptSpecs<'a>]>, + /// A merchant-specific order number. + #[serde(skip_serializing_if = "Option::is_none")] + pub reference: Option<&'a str>, +} +impl<'a> CreateForceCaptureIssuingTransactionPurchaseDetails<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// Information about fuel that was purchased with this transaction. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreateForceCaptureIssuingTransactionPurchaseDetailsFuel<'a> { + /// The type of fuel that was purchased. + /// One of `diesel`, `unleaded_plus`, `unleaded_regular`, `unleaded_super`, or `other`. + #[serde(rename = "type")] + #[serde(skip_serializing_if = "Option::is_none")] + pub type_: Option, + /// The units for `volume_decimal`. One of `us_gallon` or `liter`. + #[serde(skip_serializing_if = "Option::is_none")] + pub unit: Option, + /// The cost in cents per each unit of fuel, represented as a decimal string with at most 12 decimal places. + #[serde(skip_serializing_if = "Option::is_none")] + pub unit_cost_decimal: Option<&'a str>, + /// The volume of the fuel that was pumped, represented as a decimal string with at most 12 decimal places. + #[serde(skip_serializing_if = "Option::is_none")] + pub volume_decimal: Option<&'a str>, +} +impl<'a> CreateForceCaptureIssuingTransactionPurchaseDetailsFuel<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// The type of fuel that was purchased. +/// One of `diesel`, `unleaded_plus`, `unleaded_regular`, `unleaded_super`, or `other`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreateForceCaptureIssuingTransactionPurchaseDetailsFuelType { + Diesel, + Other, + UnleadedPlus, + UnleadedRegular, + UnleadedSuper, +} +impl CreateForceCaptureIssuingTransactionPurchaseDetailsFuelType { + pub fn as_str(self) -> &'static str { + use CreateForceCaptureIssuingTransactionPurchaseDetailsFuelType::*; + match self { + Diesel => "diesel", + Other => "other", + UnleadedPlus => "unleaded_plus", + UnleadedRegular => "unleaded_regular", + UnleadedSuper => "unleaded_super", + } + } +} + +impl std::str::FromStr for CreateForceCaptureIssuingTransactionPurchaseDetailsFuelType { + type Err = (); + fn from_str(s: &str) -> Result { + use CreateForceCaptureIssuingTransactionPurchaseDetailsFuelType::*; + match s { + "diesel" => Ok(Diesel), + "other" => Ok(Other), + "unleaded_plus" => Ok(UnleadedPlus), + "unleaded_regular" => Ok(UnleadedRegular), + "unleaded_super" => Ok(UnleadedSuper), + _ => Err(()), + } + } +} +impl std::fmt::Display for CreateForceCaptureIssuingTransactionPurchaseDetailsFuelType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreateForceCaptureIssuingTransactionPurchaseDetailsFuelType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreateForceCaptureIssuingTransactionPurchaseDetailsFuelType { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// The units for `volume_decimal`. One of `us_gallon` or `liter`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreateForceCaptureIssuingTransactionPurchaseDetailsFuelUnit { + Liter, + UsGallon, +} +impl CreateForceCaptureIssuingTransactionPurchaseDetailsFuelUnit { + pub fn as_str(self) -> &'static str { + use CreateForceCaptureIssuingTransactionPurchaseDetailsFuelUnit::*; + match self { + Liter => "liter", + UsGallon => "us_gallon", + } + } +} + +impl std::str::FromStr for CreateForceCaptureIssuingTransactionPurchaseDetailsFuelUnit { + type Err = (); + fn from_str(s: &str) -> Result { + use CreateForceCaptureIssuingTransactionPurchaseDetailsFuelUnit::*; + match s { + "liter" => Ok(Liter), + "us_gallon" => Ok(UsGallon), + _ => Err(()), + } + } +} +impl std::fmt::Display for CreateForceCaptureIssuingTransactionPurchaseDetailsFuelUnit { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreateForceCaptureIssuingTransactionPurchaseDetailsFuelUnit { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreateForceCaptureIssuingTransactionPurchaseDetailsFuelUnit { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'a> CreateForceCaptureIssuingTransaction<'a> { + /// Allows the user to capture an arbitrary amount, also known as a forced capture. + pub fn send( + &self, + client: &stripe::Client, + ) -> stripe::Response { + client.send_form( + "/test_helpers/issuing/transactions/create_force_capture", + self, + http_types::Method::Post, + ) + } +} +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreateUnlinkedRefundIssuingTransaction<'a> { + /// The total amount to attempt to refund. + /// This amount is in the provided currency, or defaults to the cards currency, and in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal). + pub amount: i64, + /// Card associated with this unlinked refund transaction. + pub card: &'a str, + /// The currency of the unlinked refund. + /// If not provided, defaults to the currency of the card. + /// Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. + /// Must be a [supported currency](https://stripe.com/docs/currencies). + #[serde(skip_serializing_if = "Option::is_none")] + pub currency: Option, + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, + /// Details about the seller (grocery store, e-commerce website, etc.) where the card authorization happened. + #[serde(skip_serializing_if = "Option::is_none")] + pub merchant_data: Option>, + /// Additional purchase information that is optionally provided by the merchant. + #[serde(skip_serializing_if = "Option::is_none")] + pub purchase_details: Option>, +} +impl<'a> CreateUnlinkedRefundIssuingTransaction<'a> { + pub fn new(amount: i64, card: &'a str) -> Self { + Self { + amount, + card, + currency: None, + expand: None, + merchant_data: None, + purchase_details: None, + } + } +} +/// Details about the seller (grocery store, e-commerce website, etc.) where the card authorization happened. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreateUnlinkedRefundIssuingTransactionMerchantData<'a> { + /// A categorization of the seller's type of business. + /// See our [merchant categories guide](https://stripe.com/docs/issuing/merchant-categories) for a list of possible values. + #[serde(skip_serializing_if = "Option::is_none")] + pub category: Option, + /// City where the seller is located + #[serde(skip_serializing_if = "Option::is_none")] + pub city: Option<&'a str>, + /// Country where the seller is located + #[serde(skip_serializing_if = "Option::is_none")] + pub country: Option<&'a str>, + /// Name of the seller + #[serde(skip_serializing_if = "Option::is_none")] + pub name: Option<&'a str>, + /// Identifier assigned to the seller by the card network. + /// Different card networks may assign different network_id fields to the same merchant. + #[serde(skip_serializing_if = "Option::is_none")] + pub network_id: Option<&'a str>, + /// Postal code where the seller is located + #[serde(skip_serializing_if = "Option::is_none")] + pub postal_code: Option<&'a str>, + /// State where the seller is located + #[serde(skip_serializing_if = "Option::is_none")] + pub state: Option<&'a str>, + /// An ID assigned by the seller to the location of the sale. + #[serde(skip_serializing_if = "Option::is_none")] + pub terminal_id: Option<&'a str>, + /// URL provided by the merchant on a 3DS request + #[serde(skip_serializing_if = "Option::is_none")] + pub url: Option<&'a str>, +} +impl<'a> CreateUnlinkedRefundIssuingTransactionMerchantData<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// A categorization of the seller's type of business. +/// See our [merchant categories guide](https://stripe.com/docs/issuing/merchant-categories) for a list of possible values. +#[derive(Copy, Clone, Eq, PartialEq)] +#[non_exhaustive] +pub enum CreateUnlinkedRefundIssuingTransactionMerchantDataCategory { + AcRefrigerationRepair, + AccountingBookkeepingServices, + AdvertisingServices, + AgriculturalCooperative, + AirlinesAirCarriers, + AirportsFlyingFields, + AmbulanceServices, + AmusementParksCarnivals, + AntiqueReproductions, + AntiqueShops, + Aquariums, + ArchitecturalSurveyingServices, + ArtDealersAndGalleries, + ArtistsSupplyAndCraftShops, + AutoAndHomeSupplyStores, + AutoBodyRepairShops, + AutoPaintShops, + AutoServiceShops, + AutomatedCashDisburse, + AutomatedFuelDispensers, + AutomobileAssociations, + AutomotivePartsAndAccessoriesStores, + AutomotiveTireStores, + BailAndBondPayments, + Bakeries, + BandsOrchestras, + BarberAndBeautyShops, + BettingCasinoGambling, + BicycleShops, + BilliardPoolEstablishments, + BoatDealers, + BoatRentalsAndLeases, + BookStores, + BooksPeriodicalsAndNewspapers, + BowlingAlleys, + BusLines, + BusinessSecretarialSchools, + BuyingShoppingServices, + CableSatelliteAndOtherPayTelevisionAndRadio, + CameraAndPhotographicSupplyStores, + CandyNutAndConfectioneryStores, + CarAndTruckDealersNewUsed, + CarAndTruckDealersUsedOnly, + CarRentalAgencies, + CarWashes, + CarpentryServices, + CarpetUpholsteryCleaning, + Caterers, + CharitableAndSocialServiceOrganizationsFundraising, + ChemicalsAndAlliedProducts, + ChildCareServices, + ChildrensAndInfantsWearStores, + ChiropodistsPodiatrists, + Chiropractors, + CigarStoresAndStands, + CivicSocialFraternalAssociations, + CleaningAndMaintenance, + ClothingRental, + CollegesUniversities, + CommercialEquipment, + CommercialFootwear, + CommercialPhotographyArtAndGraphics, + CommuterTransportAndFerries, + ComputerNetworkServices, + ComputerProgramming, + ComputerRepair, + ComputerSoftwareStores, + ComputersPeripheralsAndSoftware, + ConcreteWorkServices, + ConstructionMaterials, + ConsultingPublicRelations, + CorrespondenceSchools, + CosmeticStores, + CounselingServices, + CountryClubs, + CourierServices, + CourtCosts, + CreditReportingAgencies, + CruiseLines, + DairyProductsStores, + DanceHallStudiosSchools, + DatingEscortServices, + DentistsOrthodontists, + DepartmentStores, + DetectiveAgencies, + DigitalGoodsApplications, + DigitalGoodsGames, + DigitalGoodsLargeVolume, + DigitalGoodsMedia, + DirectMarketingCatalogMerchant, + DirectMarketingCombinationCatalogAndRetailMerchant, + DirectMarketingInboundTelemarketing, + DirectMarketingInsuranceServices, + DirectMarketingOther, + DirectMarketingOutboundTelemarketing, + DirectMarketingSubscription, + DirectMarketingTravel, + DiscountStores, + Doctors, + DoorToDoorSales, + DraperyWindowCoveringAndUpholsteryStores, + DrinkingPlaces, + DrugStoresAndPharmacies, + DrugsDrugProprietariesAndDruggistSundries, + DryCleaners, + DurableGoods, + DutyFreeStores, + EatingPlacesRestaurants, + EducationalServices, + ElectricRazorStores, + ElectricVehicleCharging, + ElectricalPartsAndEquipment, + ElectricalServices, + ElectronicsRepairShops, + ElectronicsStores, + ElementarySecondarySchools, + EmergencyServicesGcasVisaUseOnly, + EmploymentTempAgencies, + EquipmentRental, + ExterminatingServices, + FamilyClothingStores, + FastFoodRestaurants, + FinancialInstitutions, + FinesGovernmentAdministrativeEntities, + FireplaceFireplaceScreensAndAccessoriesStores, + FloorCoveringStores, + Florists, + FloristsSuppliesNurseryStockAndFlowers, + FreezerAndLockerMeatProvisioners, + FuelDealersNonAutomotive, + FuneralServicesCrematories, + FurnitureHomeFurnishingsAndEquipmentStoresExceptAppliances, + FurnitureRepairRefinishing, + FurriersAndFurShops, + GeneralServices, + GiftCardNoveltyAndSouvenirShops, + GlassPaintAndWallpaperStores, + GlasswareCrystalStores, + GolfCoursesPublic, + GovernmentLicensedHorseDogRacingUsRegionOnly, + GovernmentLicensedOnlineCasionsOnlineGamblingUsRegionOnly, + GovernmentOwnedLotteriesNonUsRegion, + GovernmentOwnedLotteriesUsRegionOnly, + GovernmentServices, + GroceryStoresSupermarkets, + HardwareEquipmentAndSupplies, + HardwareStores, + HealthAndBeautySpas, + HearingAidsSalesAndSupplies, + HeatingPlumbingAC, + HobbyToyAndGameShops, + HomeSupplyWarehouseStores, + Hospitals, + HotelsMotelsAndResorts, + HouseholdApplianceStores, + IndustrialSupplies, + InformationRetrievalServices, + InsuranceDefault, + InsuranceUnderwritingPremiums, + IntraCompanyPurchases, + JewelryStoresWatchesClocksAndSilverwareStores, + LandscapingServices, + Laundries, + LaundryCleaningServices, + LegalServicesAttorneys, + LuggageAndLeatherGoodsStores, + LumberBuildingMaterialsStores, + ManualCashDisburse, + MarinasServiceAndSupplies, + Marketplaces, + MasonryStoneworkAndPlaster, + MassageParlors, + MedicalAndDentalLabs, + MedicalDentalOphthalmicAndHospitalEquipmentAndSupplies, + MedicalServices, + MembershipOrganizations, + MensAndBoysClothingAndAccessoriesStores, + MensWomensClothingStores, + MetalServiceCenters, + MiscellaneousApparelAndAccessoryShops, + MiscellaneousAutoDealers, + MiscellaneousBusinessServices, + MiscellaneousFoodStores, + MiscellaneousGeneralMerchandise, + MiscellaneousGeneralServices, + MiscellaneousHomeFurnishingSpecialtyStores, + MiscellaneousPublishingAndPrinting, + MiscellaneousRecreationServices, + MiscellaneousRepairShops, + MiscellaneousSpecialtyRetail, + MobileHomeDealers, + MotionPictureTheaters, + MotorFreightCarriersAndTrucking, + MotorHomesDealers, + MotorVehicleSuppliesAndNewParts, + MotorcycleShopsAndDealers, + MotorcycleShopsDealers, + MusicStoresMusicalInstrumentsPianosAndSheetMusic, + NewsDealersAndNewsstands, + NonFiMoneyOrders, + NonFiStoredValueCardPurchaseLoad, + NondurableGoods, + NurseriesLawnAndGardenSupplyStores, + NursingPersonalCare, + OfficeAndCommercialFurniture, + OpticiansEyeglasses, + OptometristsOphthalmologist, + OrthopedicGoodsProstheticDevices, + Osteopaths, + PackageStoresBeerWineAndLiquor, + PaintsVarnishesAndSupplies, + ParkingLotsGarages, + PassengerRailways, + PawnShops, + PetShopsPetFoodAndSupplies, + PetroleumAndPetroleumProducts, + PhotoDeveloping, + PhotographicPhotocopyMicrofilmEquipmentAndSupplies, + PhotographicStudios, + PictureVideoProduction, + PieceGoodsNotionsAndOtherDryGoods, + PlumbingHeatingEquipmentAndSupplies, + PoliticalOrganizations, + PostalServicesGovernmentOnly, + PreciousStonesAndMetalsWatchesAndJewelry, + ProfessionalServices, + PublicWarehousingAndStorage, + QuickCopyReproAndBlueprint, + Railroads, + RealEstateAgentsAndManagersRentals, + RecordStores, + RecreationalVehicleRentals, + ReligiousGoodsStores, + ReligiousOrganizations, + RoofingSidingSheetMetal, + SecretarialSupportServices, + SecurityBrokersDealers, + ServiceStations, + SewingNeedleworkFabricAndPieceGoodsStores, + ShoeRepairHatCleaning, + ShoeStores, + SmallApplianceRepair, + SnowmobileDealers, + SpecialTradeServices, + SpecialtyCleaning, + SportingGoodsStores, + SportingRecreationCamps, + SportsAndRidingApparelStores, + SportsClubsFields, + StampAndCoinStores, + StationaryOfficeSuppliesPrintingAndWritingPaper, + StationeryStoresOfficeAndSchoolSupplyStores, + SwimmingPoolsSales, + TUiTravelGermany, + TailorsAlterations, + TaxPaymentsGovernmentAgencies, + TaxPreparationServices, + TaxicabsLimousines, + TelecommunicationEquipmentAndTelephoneSales, + TelecommunicationServices, + TelegraphServices, + TentAndAwningShops, + TestingLaboratories, + TheatricalTicketAgencies, + Timeshares, + TireRetreadingAndRepair, + TollsBridgeFees, + TouristAttractionsAndExhibits, + TowingServices, + TrailerParksCampgrounds, + TransportationServices, + TravelAgenciesTourOperators, + TruckStopIteration, + TruckUtilityTrailerRentals, + TypesettingPlateMakingAndRelatedServices, + TypewriterStores, + USFederalGovernmentAgenciesOrDepartments, + UniformsCommercialClothing, + UsedMerchandiseAndSecondhandStores, + Utilities, + VarietyStores, + VeterinaryServices, + VideoAmusementGameSupplies, + VideoGameArcades, + VideoTapeRentalStores, + VocationalTradeSchools, + WatchJewelryRepair, + WeldingRepair, + WholesaleClubs, + WigAndToupeeStores, + WiresMoneyOrders, + WomensAccessoryAndSpecialtyShops, + WomensReadyToWearStores, + WreckingAndSalvageYards, + /// An unrecognized value from Stripe. Should not be used as a request parameter. + Unknown, +} +impl CreateUnlinkedRefundIssuingTransactionMerchantDataCategory { + pub fn as_str(self) -> &'static str { + use CreateUnlinkedRefundIssuingTransactionMerchantDataCategory::*; + match self { + AcRefrigerationRepair => "ac_refrigeration_repair", + AccountingBookkeepingServices => "accounting_bookkeeping_services", + AdvertisingServices => "advertising_services", + AgriculturalCooperative => "agricultural_cooperative", + AirlinesAirCarriers => "airlines_air_carriers", + AirportsFlyingFields => "airports_flying_fields", + AmbulanceServices => "ambulance_services", + AmusementParksCarnivals => "amusement_parks_carnivals", + AntiqueReproductions => "antique_reproductions", + AntiqueShops => "antique_shops", + Aquariums => "aquariums", + ArchitecturalSurveyingServices => "architectural_surveying_services", + ArtDealersAndGalleries => "art_dealers_and_galleries", + ArtistsSupplyAndCraftShops => "artists_supply_and_craft_shops", + AutoAndHomeSupplyStores => "auto_and_home_supply_stores", + AutoBodyRepairShops => "auto_body_repair_shops", + AutoPaintShops => "auto_paint_shops", + AutoServiceShops => "auto_service_shops", + AutomatedCashDisburse => "automated_cash_disburse", + AutomatedFuelDispensers => "automated_fuel_dispensers", + AutomobileAssociations => "automobile_associations", + AutomotivePartsAndAccessoriesStores => "automotive_parts_and_accessories_stores", + AutomotiveTireStores => "automotive_tire_stores", + BailAndBondPayments => "bail_and_bond_payments", + Bakeries => "bakeries", + BandsOrchestras => "bands_orchestras", + BarberAndBeautyShops => "barber_and_beauty_shops", + BettingCasinoGambling => "betting_casino_gambling", + BicycleShops => "bicycle_shops", + BilliardPoolEstablishments => "billiard_pool_establishments", + BoatDealers => "boat_dealers", + BoatRentalsAndLeases => "boat_rentals_and_leases", + BookStores => "book_stores", + BooksPeriodicalsAndNewspapers => "books_periodicals_and_newspapers", + BowlingAlleys => "bowling_alleys", + BusLines => "bus_lines", + BusinessSecretarialSchools => "business_secretarial_schools", + BuyingShoppingServices => "buying_shopping_services", + CableSatelliteAndOtherPayTelevisionAndRadio => { + "cable_satellite_and_other_pay_television_and_radio" + } + CameraAndPhotographicSupplyStores => "camera_and_photographic_supply_stores", + CandyNutAndConfectioneryStores => "candy_nut_and_confectionery_stores", + CarAndTruckDealersNewUsed => "car_and_truck_dealers_new_used", + CarAndTruckDealersUsedOnly => "car_and_truck_dealers_used_only", + CarRentalAgencies => "car_rental_agencies", + CarWashes => "car_washes", + CarpentryServices => "carpentry_services", + CarpetUpholsteryCleaning => "carpet_upholstery_cleaning", + Caterers => "caterers", + CharitableAndSocialServiceOrganizationsFundraising => { + "charitable_and_social_service_organizations_fundraising" + } + ChemicalsAndAlliedProducts => "chemicals_and_allied_products", + ChildCareServices => "child_care_services", + ChildrensAndInfantsWearStores => "childrens_and_infants_wear_stores", + ChiropodistsPodiatrists => "chiropodists_podiatrists", + Chiropractors => "chiropractors", + CigarStoresAndStands => "cigar_stores_and_stands", + CivicSocialFraternalAssociations => "civic_social_fraternal_associations", + CleaningAndMaintenance => "cleaning_and_maintenance", + ClothingRental => "clothing_rental", + CollegesUniversities => "colleges_universities", + CommercialEquipment => "commercial_equipment", + CommercialFootwear => "commercial_footwear", + CommercialPhotographyArtAndGraphics => "commercial_photography_art_and_graphics", + CommuterTransportAndFerries => "commuter_transport_and_ferries", + ComputerNetworkServices => "computer_network_services", + ComputerProgramming => "computer_programming", + ComputerRepair => "computer_repair", + ComputerSoftwareStores => "computer_software_stores", + ComputersPeripheralsAndSoftware => "computers_peripherals_and_software", + ConcreteWorkServices => "concrete_work_services", + ConstructionMaterials => "construction_materials", + ConsultingPublicRelations => "consulting_public_relations", + CorrespondenceSchools => "correspondence_schools", + CosmeticStores => "cosmetic_stores", + CounselingServices => "counseling_services", + CountryClubs => "country_clubs", + CourierServices => "courier_services", + CourtCosts => "court_costs", + CreditReportingAgencies => "credit_reporting_agencies", + CruiseLines => "cruise_lines", + DairyProductsStores => "dairy_products_stores", + DanceHallStudiosSchools => "dance_hall_studios_schools", + DatingEscortServices => "dating_escort_services", + DentistsOrthodontists => "dentists_orthodontists", + DepartmentStores => "department_stores", + DetectiveAgencies => "detective_agencies", + DigitalGoodsApplications => "digital_goods_applications", + DigitalGoodsGames => "digital_goods_games", + DigitalGoodsLargeVolume => "digital_goods_large_volume", + DigitalGoodsMedia => "digital_goods_media", + DirectMarketingCatalogMerchant => "direct_marketing_catalog_merchant", + DirectMarketingCombinationCatalogAndRetailMerchant => { + "direct_marketing_combination_catalog_and_retail_merchant" + } + DirectMarketingInboundTelemarketing => "direct_marketing_inbound_telemarketing", + DirectMarketingInsuranceServices => "direct_marketing_insurance_services", + DirectMarketingOther => "direct_marketing_other", + DirectMarketingOutboundTelemarketing => "direct_marketing_outbound_telemarketing", + DirectMarketingSubscription => "direct_marketing_subscription", + DirectMarketingTravel => "direct_marketing_travel", + DiscountStores => "discount_stores", + Doctors => "doctors", + DoorToDoorSales => "door_to_door_sales", + DraperyWindowCoveringAndUpholsteryStores => { + "drapery_window_covering_and_upholstery_stores" + } + DrinkingPlaces => "drinking_places", + DrugStoresAndPharmacies => "drug_stores_and_pharmacies", + DrugsDrugProprietariesAndDruggistSundries => { + "drugs_drug_proprietaries_and_druggist_sundries" + } + DryCleaners => "dry_cleaners", + DurableGoods => "durable_goods", + DutyFreeStores => "duty_free_stores", + EatingPlacesRestaurants => "eating_places_restaurants", + EducationalServices => "educational_services", + ElectricRazorStores => "electric_razor_stores", + ElectricVehicleCharging => "electric_vehicle_charging", + ElectricalPartsAndEquipment => "electrical_parts_and_equipment", + ElectricalServices => "electrical_services", + ElectronicsRepairShops => "electronics_repair_shops", + ElectronicsStores => "electronics_stores", + ElementarySecondarySchools => "elementary_secondary_schools", + EmergencyServicesGcasVisaUseOnly => "emergency_services_gcas_visa_use_only", + EmploymentTempAgencies => "employment_temp_agencies", + EquipmentRental => "equipment_rental", + ExterminatingServices => "exterminating_services", + FamilyClothingStores => "family_clothing_stores", + FastFoodRestaurants => "fast_food_restaurants", + FinancialInstitutions => "financial_institutions", + FinesGovernmentAdministrativeEntities => "fines_government_administrative_entities", + FireplaceFireplaceScreensAndAccessoriesStores => { + "fireplace_fireplace_screens_and_accessories_stores" + } + FloorCoveringStores => "floor_covering_stores", + Florists => "florists", + FloristsSuppliesNurseryStockAndFlowers => "florists_supplies_nursery_stock_and_flowers", + FreezerAndLockerMeatProvisioners => "freezer_and_locker_meat_provisioners", + FuelDealersNonAutomotive => "fuel_dealers_non_automotive", + FuneralServicesCrematories => "funeral_services_crematories", + FurnitureHomeFurnishingsAndEquipmentStoresExceptAppliances => { + "furniture_home_furnishings_and_equipment_stores_except_appliances" + } + FurnitureRepairRefinishing => "furniture_repair_refinishing", + FurriersAndFurShops => "furriers_and_fur_shops", + GeneralServices => "general_services", + GiftCardNoveltyAndSouvenirShops => "gift_card_novelty_and_souvenir_shops", + GlassPaintAndWallpaperStores => "glass_paint_and_wallpaper_stores", + GlasswareCrystalStores => "glassware_crystal_stores", + GolfCoursesPublic => "golf_courses_public", + GovernmentLicensedHorseDogRacingUsRegionOnly => { + "government_licensed_horse_dog_racing_us_region_only" + } + GovernmentLicensedOnlineCasionsOnlineGamblingUsRegionOnly => { + "government_licensed_online_casions_online_gambling_us_region_only" + } + GovernmentOwnedLotteriesNonUsRegion => "government_owned_lotteries_non_us_region", + GovernmentOwnedLotteriesUsRegionOnly => "government_owned_lotteries_us_region_only", + GovernmentServices => "government_services", + GroceryStoresSupermarkets => "grocery_stores_supermarkets", + HardwareEquipmentAndSupplies => "hardware_equipment_and_supplies", + HardwareStores => "hardware_stores", + HealthAndBeautySpas => "health_and_beauty_spas", + HearingAidsSalesAndSupplies => "hearing_aids_sales_and_supplies", + HeatingPlumbingAC => "heating_plumbing_a_c", + HobbyToyAndGameShops => "hobby_toy_and_game_shops", + HomeSupplyWarehouseStores => "home_supply_warehouse_stores", + Hospitals => "hospitals", + HotelsMotelsAndResorts => "hotels_motels_and_resorts", + HouseholdApplianceStores => "household_appliance_stores", + IndustrialSupplies => "industrial_supplies", + InformationRetrievalServices => "information_retrieval_services", + InsuranceDefault => "insurance_default", + InsuranceUnderwritingPremiums => "insurance_underwriting_premiums", + IntraCompanyPurchases => "intra_company_purchases", + JewelryStoresWatchesClocksAndSilverwareStores => { + "jewelry_stores_watches_clocks_and_silverware_stores" + } + LandscapingServices => "landscaping_services", + Laundries => "laundries", + LaundryCleaningServices => "laundry_cleaning_services", + LegalServicesAttorneys => "legal_services_attorneys", + LuggageAndLeatherGoodsStores => "luggage_and_leather_goods_stores", + LumberBuildingMaterialsStores => "lumber_building_materials_stores", + ManualCashDisburse => "manual_cash_disburse", + MarinasServiceAndSupplies => "marinas_service_and_supplies", + Marketplaces => "marketplaces", + MasonryStoneworkAndPlaster => "masonry_stonework_and_plaster", + MassageParlors => "massage_parlors", + MedicalAndDentalLabs => "medical_and_dental_labs", + MedicalDentalOphthalmicAndHospitalEquipmentAndSupplies => { + "medical_dental_ophthalmic_and_hospital_equipment_and_supplies" + } + MedicalServices => "medical_services", + MembershipOrganizations => "membership_organizations", + MensAndBoysClothingAndAccessoriesStores => { + "mens_and_boys_clothing_and_accessories_stores" + } + MensWomensClothingStores => "mens_womens_clothing_stores", + MetalServiceCenters => "metal_service_centers", + MiscellaneousApparelAndAccessoryShops => "miscellaneous_apparel_and_accessory_shops", + MiscellaneousAutoDealers => "miscellaneous_auto_dealers", + MiscellaneousBusinessServices => "miscellaneous_business_services", + MiscellaneousFoodStores => "miscellaneous_food_stores", + MiscellaneousGeneralMerchandise => "miscellaneous_general_merchandise", + MiscellaneousGeneralServices => "miscellaneous_general_services", + MiscellaneousHomeFurnishingSpecialtyStores => { + "miscellaneous_home_furnishing_specialty_stores" + } + MiscellaneousPublishingAndPrinting => "miscellaneous_publishing_and_printing", + MiscellaneousRecreationServices => "miscellaneous_recreation_services", + MiscellaneousRepairShops => "miscellaneous_repair_shops", + MiscellaneousSpecialtyRetail => "miscellaneous_specialty_retail", + MobileHomeDealers => "mobile_home_dealers", + MotionPictureTheaters => "motion_picture_theaters", + MotorFreightCarriersAndTrucking => "motor_freight_carriers_and_trucking", + MotorHomesDealers => "motor_homes_dealers", + MotorVehicleSuppliesAndNewParts => "motor_vehicle_supplies_and_new_parts", + MotorcycleShopsAndDealers => "motorcycle_shops_and_dealers", + MotorcycleShopsDealers => "motorcycle_shops_dealers", + MusicStoresMusicalInstrumentsPianosAndSheetMusic => { + "music_stores_musical_instruments_pianos_and_sheet_music" + } + NewsDealersAndNewsstands => "news_dealers_and_newsstands", + NonFiMoneyOrders => "non_fi_money_orders", + NonFiStoredValueCardPurchaseLoad => "non_fi_stored_value_card_purchase_load", + NondurableGoods => "nondurable_goods", + NurseriesLawnAndGardenSupplyStores => "nurseries_lawn_and_garden_supply_stores", + NursingPersonalCare => "nursing_personal_care", + OfficeAndCommercialFurniture => "office_and_commercial_furniture", + OpticiansEyeglasses => "opticians_eyeglasses", + OptometristsOphthalmologist => "optometrists_ophthalmologist", + OrthopedicGoodsProstheticDevices => "orthopedic_goods_prosthetic_devices", + Osteopaths => "osteopaths", + PackageStoresBeerWineAndLiquor => "package_stores_beer_wine_and_liquor", + PaintsVarnishesAndSupplies => "paints_varnishes_and_supplies", + ParkingLotsGarages => "parking_lots_garages", + PassengerRailways => "passenger_railways", + PawnShops => "pawn_shops", + PetShopsPetFoodAndSupplies => "pet_shops_pet_food_and_supplies", + PetroleumAndPetroleumProducts => "petroleum_and_petroleum_products", + PhotoDeveloping => "photo_developing", + PhotographicPhotocopyMicrofilmEquipmentAndSupplies => { + "photographic_photocopy_microfilm_equipment_and_supplies" + } + PhotographicStudios => "photographic_studios", + PictureVideoProduction => "picture_video_production", + PieceGoodsNotionsAndOtherDryGoods => "piece_goods_notions_and_other_dry_goods", + PlumbingHeatingEquipmentAndSupplies => "plumbing_heating_equipment_and_supplies", + PoliticalOrganizations => "political_organizations", + PostalServicesGovernmentOnly => "postal_services_government_only", + PreciousStonesAndMetalsWatchesAndJewelry => { + "precious_stones_and_metals_watches_and_jewelry" + } + ProfessionalServices => "professional_services", + PublicWarehousingAndStorage => "public_warehousing_and_storage", + QuickCopyReproAndBlueprint => "quick_copy_repro_and_blueprint", + Railroads => "railroads", + RealEstateAgentsAndManagersRentals => "real_estate_agents_and_managers_rentals", + RecordStores => "record_stores", + RecreationalVehicleRentals => "recreational_vehicle_rentals", + ReligiousGoodsStores => "religious_goods_stores", + ReligiousOrganizations => "religious_organizations", + RoofingSidingSheetMetal => "roofing_siding_sheet_metal", + SecretarialSupportServices => "secretarial_support_services", + SecurityBrokersDealers => "security_brokers_dealers", + ServiceStations => "service_stations", + SewingNeedleworkFabricAndPieceGoodsStores => { + "sewing_needlework_fabric_and_piece_goods_stores" + } + ShoeRepairHatCleaning => "shoe_repair_hat_cleaning", + ShoeStores => "shoe_stores", + SmallApplianceRepair => "small_appliance_repair", + SnowmobileDealers => "snowmobile_dealers", + SpecialTradeServices => "special_trade_services", + SpecialtyCleaning => "specialty_cleaning", + SportingGoodsStores => "sporting_goods_stores", + SportingRecreationCamps => "sporting_recreation_camps", + SportsAndRidingApparelStores => "sports_and_riding_apparel_stores", + SportsClubsFields => "sports_clubs_fields", + StampAndCoinStores => "stamp_and_coin_stores", + StationaryOfficeSuppliesPrintingAndWritingPaper => { + "stationary_office_supplies_printing_and_writing_paper" + } + StationeryStoresOfficeAndSchoolSupplyStores => { + "stationery_stores_office_and_school_supply_stores" + } + SwimmingPoolsSales => "swimming_pools_sales", + TUiTravelGermany => "t_ui_travel_germany", + TailorsAlterations => "tailors_alterations", + TaxPaymentsGovernmentAgencies => "tax_payments_government_agencies", + TaxPreparationServices => "tax_preparation_services", + TaxicabsLimousines => "taxicabs_limousines", + TelecommunicationEquipmentAndTelephoneSales => { + "telecommunication_equipment_and_telephone_sales" + } + TelecommunicationServices => "telecommunication_services", + TelegraphServices => "telegraph_services", + TentAndAwningShops => "tent_and_awning_shops", + TestingLaboratories => "testing_laboratories", + TheatricalTicketAgencies => "theatrical_ticket_agencies", + Timeshares => "timeshares", + TireRetreadingAndRepair => "tire_retreading_and_repair", + TollsBridgeFees => "tolls_bridge_fees", + TouristAttractionsAndExhibits => "tourist_attractions_and_exhibits", + TowingServices => "towing_services", + TrailerParksCampgrounds => "trailer_parks_campgrounds", + TransportationServices => "transportation_services", + TravelAgenciesTourOperators => "travel_agencies_tour_operators", + TruckStopIteration => "truck_stop_iteration", + TruckUtilityTrailerRentals => "truck_utility_trailer_rentals", + TypesettingPlateMakingAndRelatedServices => { + "typesetting_plate_making_and_related_services" + } + TypewriterStores => "typewriter_stores", + USFederalGovernmentAgenciesOrDepartments => { + "u_s_federal_government_agencies_or_departments" + } + UniformsCommercialClothing => "uniforms_commercial_clothing", + UsedMerchandiseAndSecondhandStores => "used_merchandise_and_secondhand_stores", + Utilities => "utilities", + VarietyStores => "variety_stores", + VeterinaryServices => "veterinary_services", + VideoAmusementGameSupplies => "video_amusement_game_supplies", + VideoGameArcades => "video_game_arcades", + VideoTapeRentalStores => "video_tape_rental_stores", + VocationalTradeSchools => "vocational_trade_schools", + WatchJewelryRepair => "watch_jewelry_repair", + WeldingRepair => "welding_repair", + WholesaleClubs => "wholesale_clubs", + WigAndToupeeStores => "wig_and_toupee_stores", + WiresMoneyOrders => "wires_money_orders", + WomensAccessoryAndSpecialtyShops => "womens_accessory_and_specialty_shops", + WomensReadyToWearStores => "womens_ready_to_wear_stores", + WreckingAndSalvageYards => "wrecking_and_salvage_yards", + Unknown => "unknown", + } + } +} + +impl std::str::FromStr for CreateUnlinkedRefundIssuingTransactionMerchantDataCategory { + type Err = (); + fn from_str(s: &str) -> Result { + use CreateUnlinkedRefundIssuingTransactionMerchantDataCategory::*; + match s { + "ac_refrigeration_repair" => Ok(AcRefrigerationRepair), + "accounting_bookkeeping_services" => Ok(AccountingBookkeepingServices), + "advertising_services" => Ok(AdvertisingServices), + "agricultural_cooperative" => Ok(AgriculturalCooperative), + "airlines_air_carriers" => Ok(AirlinesAirCarriers), + "airports_flying_fields" => Ok(AirportsFlyingFields), + "ambulance_services" => Ok(AmbulanceServices), + "amusement_parks_carnivals" => Ok(AmusementParksCarnivals), + "antique_reproductions" => Ok(AntiqueReproductions), + "antique_shops" => Ok(AntiqueShops), + "aquariums" => Ok(Aquariums), + "architectural_surveying_services" => Ok(ArchitecturalSurveyingServices), + "art_dealers_and_galleries" => Ok(ArtDealersAndGalleries), + "artists_supply_and_craft_shops" => Ok(ArtistsSupplyAndCraftShops), + "auto_and_home_supply_stores" => Ok(AutoAndHomeSupplyStores), + "auto_body_repair_shops" => Ok(AutoBodyRepairShops), + "auto_paint_shops" => Ok(AutoPaintShops), + "auto_service_shops" => Ok(AutoServiceShops), + "automated_cash_disburse" => Ok(AutomatedCashDisburse), + "automated_fuel_dispensers" => Ok(AutomatedFuelDispensers), + "automobile_associations" => Ok(AutomobileAssociations), + "automotive_parts_and_accessories_stores" => Ok(AutomotivePartsAndAccessoriesStores), + "automotive_tire_stores" => Ok(AutomotiveTireStores), + "bail_and_bond_payments" => Ok(BailAndBondPayments), + "bakeries" => Ok(Bakeries), + "bands_orchestras" => Ok(BandsOrchestras), + "barber_and_beauty_shops" => Ok(BarberAndBeautyShops), + "betting_casino_gambling" => Ok(BettingCasinoGambling), + "bicycle_shops" => Ok(BicycleShops), + "billiard_pool_establishments" => Ok(BilliardPoolEstablishments), + "boat_dealers" => Ok(BoatDealers), + "boat_rentals_and_leases" => Ok(BoatRentalsAndLeases), + "book_stores" => Ok(BookStores), + "books_periodicals_and_newspapers" => Ok(BooksPeriodicalsAndNewspapers), + "bowling_alleys" => Ok(BowlingAlleys), + "bus_lines" => Ok(BusLines), + "business_secretarial_schools" => Ok(BusinessSecretarialSchools), + "buying_shopping_services" => Ok(BuyingShoppingServices), + "cable_satellite_and_other_pay_television_and_radio" => { + Ok(CableSatelliteAndOtherPayTelevisionAndRadio) + } + "camera_and_photographic_supply_stores" => Ok(CameraAndPhotographicSupplyStores), + "candy_nut_and_confectionery_stores" => Ok(CandyNutAndConfectioneryStores), + "car_and_truck_dealers_new_used" => Ok(CarAndTruckDealersNewUsed), + "car_and_truck_dealers_used_only" => Ok(CarAndTruckDealersUsedOnly), + "car_rental_agencies" => Ok(CarRentalAgencies), + "car_washes" => Ok(CarWashes), + "carpentry_services" => Ok(CarpentryServices), + "carpet_upholstery_cleaning" => Ok(CarpetUpholsteryCleaning), + "caterers" => Ok(Caterers), + "charitable_and_social_service_organizations_fundraising" => { + Ok(CharitableAndSocialServiceOrganizationsFundraising) + } + "chemicals_and_allied_products" => Ok(ChemicalsAndAlliedProducts), + "child_care_services" => Ok(ChildCareServices), + "childrens_and_infants_wear_stores" => Ok(ChildrensAndInfantsWearStores), + "chiropodists_podiatrists" => Ok(ChiropodistsPodiatrists), + "chiropractors" => Ok(Chiropractors), + "cigar_stores_and_stands" => Ok(CigarStoresAndStands), + "civic_social_fraternal_associations" => Ok(CivicSocialFraternalAssociations), + "cleaning_and_maintenance" => Ok(CleaningAndMaintenance), + "clothing_rental" => Ok(ClothingRental), + "colleges_universities" => Ok(CollegesUniversities), + "commercial_equipment" => Ok(CommercialEquipment), + "commercial_footwear" => Ok(CommercialFootwear), + "commercial_photography_art_and_graphics" => Ok(CommercialPhotographyArtAndGraphics), + "commuter_transport_and_ferries" => Ok(CommuterTransportAndFerries), + "computer_network_services" => Ok(ComputerNetworkServices), + "computer_programming" => Ok(ComputerProgramming), + "computer_repair" => Ok(ComputerRepair), + "computer_software_stores" => Ok(ComputerSoftwareStores), + "computers_peripherals_and_software" => Ok(ComputersPeripheralsAndSoftware), + "concrete_work_services" => Ok(ConcreteWorkServices), + "construction_materials" => Ok(ConstructionMaterials), + "consulting_public_relations" => Ok(ConsultingPublicRelations), + "correspondence_schools" => Ok(CorrespondenceSchools), + "cosmetic_stores" => Ok(CosmeticStores), + "counseling_services" => Ok(CounselingServices), + "country_clubs" => Ok(CountryClubs), + "courier_services" => Ok(CourierServices), + "court_costs" => Ok(CourtCosts), + "credit_reporting_agencies" => Ok(CreditReportingAgencies), + "cruise_lines" => Ok(CruiseLines), + "dairy_products_stores" => Ok(DairyProductsStores), + "dance_hall_studios_schools" => Ok(DanceHallStudiosSchools), + "dating_escort_services" => Ok(DatingEscortServices), + "dentists_orthodontists" => Ok(DentistsOrthodontists), + "department_stores" => Ok(DepartmentStores), + "detective_agencies" => Ok(DetectiveAgencies), + "digital_goods_applications" => Ok(DigitalGoodsApplications), + "digital_goods_games" => Ok(DigitalGoodsGames), + "digital_goods_large_volume" => Ok(DigitalGoodsLargeVolume), + "digital_goods_media" => Ok(DigitalGoodsMedia), + "direct_marketing_catalog_merchant" => Ok(DirectMarketingCatalogMerchant), + "direct_marketing_combination_catalog_and_retail_merchant" => { + Ok(DirectMarketingCombinationCatalogAndRetailMerchant) + } + "direct_marketing_inbound_telemarketing" => Ok(DirectMarketingInboundTelemarketing), + "direct_marketing_insurance_services" => Ok(DirectMarketingInsuranceServices), + "direct_marketing_other" => Ok(DirectMarketingOther), + "direct_marketing_outbound_telemarketing" => Ok(DirectMarketingOutboundTelemarketing), + "direct_marketing_subscription" => Ok(DirectMarketingSubscription), + "direct_marketing_travel" => Ok(DirectMarketingTravel), + "discount_stores" => Ok(DiscountStores), + "doctors" => Ok(Doctors), + "door_to_door_sales" => Ok(DoorToDoorSales), + "drapery_window_covering_and_upholstery_stores" => { + Ok(DraperyWindowCoveringAndUpholsteryStores) + } + "drinking_places" => Ok(DrinkingPlaces), + "drug_stores_and_pharmacies" => Ok(DrugStoresAndPharmacies), + "drugs_drug_proprietaries_and_druggist_sundries" => { + Ok(DrugsDrugProprietariesAndDruggistSundries) + } + "dry_cleaners" => Ok(DryCleaners), + "durable_goods" => Ok(DurableGoods), + "duty_free_stores" => Ok(DutyFreeStores), + "eating_places_restaurants" => Ok(EatingPlacesRestaurants), + "educational_services" => Ok(EducationalServices), + "electric_razor_stores" => Ok(ElectricRazorStores), + "electric_vehicle_charging" => Ok(ElectricVehicleCharging), + "electrical_parts_and_equipment" => Ok(ElectricalPartsAndEquipment), + "electrical_services" => Ok(ElectricalServices), + "electronics_repair_shops" => Ok(ElectronicsRepairShops), + "electronics_stores" => Ok(ElectronicsStores), + "elementary_secondary_schools" => Ok(ElementarySecondarySchools), + "emergency_services_gcas_visa_use_only" => Ok(EmergencyServicesGcasVisaUseOnly), + "employment_temp_agencies" => Ok(EmploymentTempAgencies), + "equipment_rental" => Ok(EquipmentRental), + "exterminating_services" => Ok(ExterminatingServices), + "family_clothing_stores" => Ok(FamilyClothingStores), + "fast_food_restaurants" => Ok(FastFoodRestaurants), + "financial_institutions" => Ok(FinancialInstitutions), + "fines_government_administrative_entities" => Ok(FinesGovernmentAdministrativeEntities), + "fireplace_fireplace_screens_and_accessories_stores" => { + Ok(FireplaceFireplaceScreensAndAccessoriesStores) + } + "floor_covering_stores" => Ok(FloorCoveringStores), + "florists" => Ok(Florists), + "florists_supplies_nursery_stock_and_flowers" => { + Ok(FloristsSuppliesNurseryStockAndFlowers) + } + "freezer_and_locker_meat_provisioners" => Ok(FreezerAndLockerMeatProvisioners), + "fuel_dealers_non_automotive" => Ok(FuelDealersNonAutomotive), + "funeral_services_crematories" => Ok(FuneralServicesCrematories), + "furniture_home_furnishings_and_equipment_stores_except_appliances" => { + Ok(FurnitureHomeFurnishingsAndEquipmentStoresExceptAppliances) + } + "furniture_repair_refinishing" => Ok(FurnitureRepairRefinishing), + "furriers_and_fur_shops" => Ok(FurriersAndFurShops), + "general_services" => Ok(GeneralServices), + "gift_card_novelty_and_souvenir_shops" => Ok(GiftCardNoveltyAndSouvenirShops), + "glass_paint_and_wallpaper_stores" => Ok(GlassPaintAndWallpaperStores), + "glassware_crystal_stores" => Ok(GlasswareCrystalStores), + "golf_courses_public" => Ok(GolfCoursesPublic), + "government_licensed_horse_dog_racing_us_region_only" => { + Ok(GovernmentLicensedHorseDogRacingUsRegionOnly) + } + "government_licensed_online_casions_online_gambling_us_region_only" => { + Ok(GovernmentLicensedOnlineCasionsOnlineGamblingUsRegionOnly) + } + "government_owned_lotteries_non_us_region" => Ok(GovernmentOwnedLotteriesNonUsRegion), + "government_owned_lotteries_us_region_only" => Ok(GovernmentOwnedLotteriesUsRegionOnly), + "government_services" => Ok(GovernmentServices), + "grocery_stores_supermarkets" => Ok(GroceryStoresSupermarkets), + "hardware_equipment_and_supplies" => Ok(HardwareEquipmentAndSupplies), + "hardware_stores" => Ok(HardwareStores), + "health_and_beauty_spas" => Ok(HealthAndBeautySpas), + "hearing_aids_sales_and_supplies" => Ok(HearingAidsSalesAndSupplies), + "heating_plumbing_a_c" => Ok(HeatingPlumbingAC), + "hobby_toy_and_game_shops" => Ok(HobbyToyAndGameShops), + "home_supply_warehouse_stores" => Ok(HomeSupplyWarehouseStores), + "hospitals" => Ok(Hospitals), + "hotels_motels_and_resorts" => Ok(HotelsMotelsAndResorts), + "household_appliance_stores" => Ok(HouseholdApplianceStores), + "industrial_supplies" => Ok(IndustrialSupplies), + "information_retrieval_services" => Ok(InformationRetrievalServices), + "insurance_default" => Ok(InsuranceDefault), + "insurance_underwriting_premiums" => Ok(InsuranceUnderwritingPremiums), + "intra_company_purchases" => Ok(IntraCompanyPurchases), + "jewelry_stores_watches_clocks_and_silverware_stores" => { + Ok(JewelryStoresWatchesClocksAndSilverwareStores) + } + "landscaping_services" => Ok(LandscapingServices), + "laundries" => Ok(Laundries), + "laundry_cleaning_services" => Ok(LaundryCleaningServices), + "legal_services_attorneys" => Ok(LegalServicesAttorneys), + "luggage_and_leather_goods_stores" => Ok(LuggageAndLeatherGoodsStores), + "lumber_building_materials_stores" => Ok(LumberBuildingMaterialsStores), + "manual_cash_disburse" => Ok(ManualCashDisburse), + "marinas_service_and_supplies" => Ok(MarinasServiceAndSupplies), + "marketplaces" => Ok(Marketplaces), + "masonry_stonework_and_plaster" => Ok(MasonryStoneworkAndPlaster), + "massage_parlors" => Ok(MassageParlors), + "medical_and_dental_labs" => Ok(MedicalAndDentalLabs), + "medical_dental_ophthalmic_and_hospital_equipment_and_supplies" => { + Ok(MedicalDentalOphthalmicAndHospitalEquipmentAndSupplies) + } + "medical_services" => Ok(MedicalServices), + "membership_organizations" => Ok(MembershipOrganizations), + "mens_and_boys_clothing_and_accessories_stores" => { + Ok(MensAndBoysClothingAndAccessoriesStores) + } + "mens_womens_clothing_stores" => Ok(MensWomensClothingStores), + "metal_service_centers" => Ok(MetalServiceCenters), + "miscellaneous_apparel_and_accessory_shops" => { + Ok(MiscellaneousApparelAndAccessoryShops) + } + "miscellaneous_auto_dealers" => Ok(MiscellaneousAutoDealers), + "miscellaneous_business_services" => Ok(MiscellaneousBusinessServices), + "miscellaneous_food_stores" => Ok(MiscellaneousFoodStores), + "miscellaneous_general_merchandise" => Ok(MiscellaneousGeneralMerchandise), + "miscellaneous_general_services" => Ok(MiscellaneousGeneralServices), + "miscellaneous_home_furnishing_specialty_stores" => { + Ok(MiscellaneousHomeFurnishingSpecialtyStores) + } + "miscellaneous_publishing_and_printing" => Ok(MiscellaneousPublishingAndPrinting), + "miscellaneous_recreation_services" => Ok(MiscellaneousRecreationServices), + "miscellaneous_repair_shops" => Ok(MiscellaneousRepairShops), + "miscellaneous_specialty_retail" => Ok(MiscellaneousSpecialtyRetail), + "mobile_home_dealers" => Ok(MobileHomeDealers), + "motion_picture_theaters" => Ok(MotionPictureTheaters), + "motor_freight_carriers_and_trucking" => Ok(MotorFreightCarriersAndTrucking), + "motor_homes_dealers" => Ok(MotorHomesDealers), + "motor_vehicle_supplies_and_new_parts" => Ok(MotorVehicleSuppliesAndNewParts), + "motorcycle_shops_and_dealers" => Ok(MotorcycleShopsAndDealers), + "motorcycle_shops_dealers" => Ok(MotorcycleShopsDealers), + "music_stores_musical_instruments_pianos_and_sheet_music" => { + Ok(MusicStoresMusicalInstrumentsPianosAndSheetMusic) + } + "news_dealers_and_newsstands" => Ok(NewsDealersAndNewsstands), + "non_fi_money_orders" => Ok(NonFiMoneyOrders), + "non_fi_stored_value_card_purchase_load" => Ok(NonFiStoredValueCardPurchaseLoad), + "nondurable_goods" => Ok(NondurableGoods), + "nurseries_lawn_and_garden_supply_stores" => Ok(NurseriesLawnAndGardenSupplyStores), + "nursing_personal_care" => Ok(NursingPersonalCare), + "office_and_commercial_furniture" => Ok(OfficeAndCommercialFurniture), + "opticians_eyeglasses" => Ok(OpticiansEyeglasses), + "optometrists_ophthalmologist" => Ok(OptometristsOphthalmologist), + "orthopedic_goods_prosthetic_devices" => Ok(OrthopedicGoodsProstheticDevices), + "osteopaths" => Ok(Osteopaths), + "package_stores_beer_wine_and_liquor" => Ok(PackageStoresBeerWineAndLiquor), + "paints_varnishes_and_supplies" => Ok(PaintsVarnishesAndSupplies), + "parking_lots_garages" => Ok(ParkingLotsGarages), + "passenger_railways" => Ok(PassengerRailways), + "pawn_shops" => Ok(PawnShops), + "pet_shops_pet_food_and_supplies" => Ok(PetShopsPetFoodAndSupplies), + "petroleum_and_petroleum_products" => Ok(PetroleumAndPetroleumProducts), + "photo_developing" => Ok(PhotoDeveloping), + "photographic_photocopy_microfilm_equipment_and_supplies" => { + Ok(PhotographicPhotocopyMicrofilmEquipmentAndSupplies) + } + "photographic_studios" => Ok(PhotographicStudios), + "picture_video_production" => Ok(PictureVideoProduction), + "piece_goods_notions_and_other_dry_goods" => Ok(PieceGoodsNotionsAndOtherDryGoods), + "plumbing_heating_equipment_and_supplies" => Ok(PlumbingHeatingEquipmentAndSupplies), + "political_organizations" => Ok(PoliticalOrganizations), + "postal_services_government_only" => Ok(PostalServicesGovernmentOnly), + "precious_stones_and_metals_watches_and_jewelry" => { + Ok(PreciousStonesAndMetalsWatchesAndJewelry) + } + "professional_services" => Ok(ProfessionalServices), + "public_warehousing_and_storage" => Ok(PublicWarehousingAndStorage), + "quick_copy_repro_and_blueprint" => Ok(QuickCopyReproAndBlueprint), + "railroads" => Ok(Railroads), + "real_estate_agents_and_managers_rentals" => Ok(RealEstateAgentsAndManagersRentals), + "record_stores" => Ok(RecordStores), + "recreational_vehicle_rentals" => Ok(RecreationalVehicleRentals), + "religious_goods_stores" => Ok(ReligiousGoodsStores), + "religious_organizations" => Ok(ReligiousOrganizations), + "roofing_siding_sheet_metal" => Ok(RoofingSidingSheetMetal), + "secretarial_support_services" => Ok(SecretarialSupportServices), + "security_brokers_dealers" => Ok(SecurityBrokersDealers), + "service_stations" => Ok(ServiceStations), + "sewing_needlework_fabric_and_piece_goods_stores" => { + Ok(SewingNeedleworkFabricAndPieceGoodsStores) + } + "shoe_repair_hat_cleaning" => Ok(ShoeRepairHatCleaning), + "shoe_stores" => Ok(ShoeStores), + "small_appliance_repair" => Ok(SmallApplianceRepair), + "snowmobile_dealers" => Ok(SnowmobileDealers), + "special_trade_services" => Ok(SpecialTradeServices), + "specialty_cleaning" => Ok(SpecialtyCleaning), + "sporting_goods_stores" => Ok(SportingGoodsStores), + "sporting_recreation_camps" => Ok(SportingRecreationCamps), + "sports_and_riding_apparel_stores" => Ok(SportsAndRidingApparelStores), + "sports_clubs_fields" => Ok(SportsClubsFields), + "stamp_and_coin_stores" => Ok(StampAndCoinStores), + "stationary_office_supplies_printing_and_writing_paper" => { + Ok(StationaryOfficeSuppliesPrintingAndWritingPaper) + } + "stationery_stores_office_and_school_supply_stores" => { + Ok(StationeryStoresOfficeAndSchoolSupplyStores) + } + "swimming_pools_sales" => Ok(SwimmingPoolsSales), + "t_ui_travel_germany" => Ok(TUiTravelGermany), + "tailors_alterations" => Ok(TailorsAlterations), + "tax_payments_government_agencies" => Ok(TaxPaymentsGovernmentAgencies), + "tax_preparation_services" => Ok(TaxPreparationServices), + "taxicabs_limousines" => Ok(TaxicabsLimousines), + "telecommunication_equipment_and_telephone_sales" => { + Ok(TelecommunicationEquipmentAndTelephoneSales) + } + "telecommunication_services" => Ok(TelecommunicationServices), + "telegraph_services" => Ok(TelegraphServices), + "tent_and_awning_shops" => Ok(TentAndAwningShops), + "testing_laboratories" => Ok(TestingLaboratories), + "theatrical_ticket_agencies" => Ok(TheatricalTicketAgencies), + "timeshares" => Ok(Timeshares), + "tire_retreading_and_repair" => Ok(TireRetreadingAndRepair), + "tolls_bridge_fees" => Ok(TollsBridgeFees), + "tourist_attractions_and_exhibits" => Ok(TouristAttractionsAndExhibits), + "towing_services" => Ok(TowingServices), + "trailer_parks_campgrounds" => Ok(TrailerParksCampgrounds), + "transportation_services" => Ok(TransportationServices), + "travel_agencies_tour_operators" => Ok(TravelAgenciesTourOperators), + "truck_stop_iteration" => Ok(TruckStopIteration), + "truck_utility_trailer_rentals" => Ok(TruckUtilityTrailerRentals), + "typesetting_plate_making_and_related_services" => { + Ok(TypesettingPlateMakingAndRelatedServices) + } + "typewriter_stores" => Ok(TypewriterStores), + "u_s_federal_government_agencies_or_departments" => { + Ok(USFederalGovernmentAgenciesOrDepartments) + } + "uniforms_commercial_clothing" => Ok(UniformsCommercialClothing), + "used_merchandise_and_secondhand_stores" => Ok(UsedMerchandiseAndSecondhandStores), + "utilities" => Ok(Utilities), + "variety_stores" => Ok(VarietyStores), + "veterinary_services" => Ok(VeterinaryServices), + "video_amusement_game_supplies" => Ok(VideoAmusementGameSupplies), + "video_game_arcades" => Ok(VideoGameArcades), + "video_tape_rental_stores" => Ok(VideoTapeRentalStores), + "vocational_trade_schools" => Ok(VocationalTradeSchools), + "watch_jewelry_repair" => Ok(WatchJewelryRepair), + "welding_repair" => Ok(WeldingRepair), + "wholesale_clubs" => Ok(WholesaleClubs), + "wig_and_toupee_stores" => Ok(WigAndToupeeStores), + "wires_money_orders" => Ok(WiresMoneyOrders), + "womens_accessory_and_specialty_shops" => Ok(WomensAccessoryAndSpecialtyShops), + "womens_ready_to_wear_stores" => Ok(WomensReadyToWearStores), + "wrecking_and_salvage_yards" => Ok(WreckingAndSalvageYards), + _ => Err(()), + } + } +} +impl std::fmt::Display for CreateUnlinkedRefundIssuingTransactionMerchantDataCategory { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreateUnlinkedRefundIssuingTransactionMerchantDataCategory { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreateUnlinkedRefundIssuingTransactionMerchantDataCategory { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Additional purchase information that is optionally provided by the merchant. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreateUnlinkedRefundIssuingTransactionPurchaseDetails<'a> { + /// Information about the flight that was purchased with this transaction. + #[serde(skip_serializing_if = "Option::is_none")] + pub flight: Option>, + /// Information about fuel that was purchased with this transaction. + #[serde(skip_serializing_if = "Option::is_none")] + pub fuel: Option>, + /// Information about lodging that was purchased with this transaction. + #[serde(skip_serializing_if = "Option::is_none")] + pub lodging: Option, + /// The line items in the purchase. + #[serde(skip_serializing_if = "Option::is_none")] + pub receipt: Option<&'a [ReceiptSpecs<'a>]>, + /// A merchant-specific order number. + #[serde(skip_serializing_if = "Option::is_none")] + pub reference: Option<&'a str>, +} +impl<'a> CreateUnlinkedRefundIssuingTransactionPurchaseDetails<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// Information about fuel that was purchased with this transaction. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreateUnlinkedRefundIssuingTransactionPurchaseDetailsFuel<'a> { + /// The type of fuel that was purchased. + /// One of `diesel`, `unleaded_plus`, `unleaded_regular`, `unleaded_super`, or `other`. + #[serde(rename = "type")] + #[serde(skip_serializing_if = "Option::is_none")] + pub type_: Option, + /// The units for `volume_decimal`. One of `us_gallon` or `liter`. + #[serde(skip_serializing_if = "Option::is_none")] + pub unit: Option, + /// The cost in cents per each unit of fuel, represented as a decimal string with at most 12 decimal places. + #[serde(skip_serializing_if = "Option::is_none")] + pub unit_cost_decimal: Option<&'a str>, + /// The volume of the fuel that was pumped, represented as a decimal string with at most 12 decimal places. + #[serde(skip_serializing_if = "Option::is_none")] + pub volume_decimal: Option<&'a str>, +} +impl<'a> CreateUnlinkedRefundIssuingTransactionPurchaseDetailsFuel<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// The type of fuel that was purchased. +/// One of `diesel`, `unleaded_plus`, `unleaded_regular`, `unleaded_super`, or `other`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreateUnlinkedRefundIssuingTransactionPurchaseDetailsFuelType { + Diesel, + Other, + UnleadedPlus, + UnleadedRegular, + UnleadedSuper, +} +impl CreateUnlinkedRefundIssuingTransactionPurchaseDetailsFuelType { + pub fn as_str(self) -> &'static str { + use CreateUnlinkedRefundIssuingTransactionPurchaseDetailsFuelType::*; + match self { + Diesel => "diesel", + Other => "other", + UnleadedPlus => "unleaded_plus", + UnleadedRegular => "unleaded_regular", + UnleadedSuper => "unleaded_super", + } + } +} + +impl std::str::FromStr for CreateUnlinkedRefundIssuingTransactionPurchaseDetailsFuelType { + type Err = (); + fn from_str(s: &str) -> Result { + use CreateUnlinkedRefundIssuingTransactionPurchaseDetailsFuelType::*; + match s { + "diesel" => Ok(Diesel), + "other" => Ok(Other), + "unleaded_plus" => Ok(UnleadedPlus), + "unleaded_regular" => Ok(UnleadedRegular), + "unleaded_super" => Ok(UnleadedSuper), + _ => Err(()), + } + } +} +impl std::fmt::Display for CreateUnlinkedRefundIssuingTransactionPurchaseDetailsFuelType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreateUnlinkedRefundIssuingTransactionPurchaseDetailsFuelType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreateUnlinkedRefundIssuingTransactionPurchaseDetailsFuelType { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// The units for `volume_decimal`. One of `us_gallon` or `liter`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreateUnlinkedRefundIssuingTransactionPurchaseDetailsFuelUnit { + Liter, + UsGallon, +} +impl CreateUnlinkedRefundIssuingTransactionPurchaseDetailsFuelUnit { + pub fn as_str(self) -> &'static str { + use CreateUnlinkedRefundIssuingTransactionPurchaseDetailsFuelUnit::*; + match self { + Liter => "liter", + UsGallon => "us_gallon", + } + } +} + +impl std::str::FromStr for CreateUnlinkedRefundIssuingTransactionPurchaseDetailsFuelUnit { + type Err = (); + fn from_str(s: &str) -> Result { + use CreateUnlinkedRefundIssuingTransactionPurchaseDetailsFuelUnit::*; + match s { + "liter" => Ok(Liter), + "us_gallon" => Ok(UsGallon), + _ => Err(()), + } + } +} +impl std::fmt::Display for CreateUnlinkedRefundIssuingTransactionPurchaseDetailsFuelUnit { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreateUnlinkedRefundIssuingTransactionPurchaseDetailsFuelUnit { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreateUnlinkedRefundIssuingTransactionPurchaseDetailsFuelUnit { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'a> CreateUnlinkedRefundIssuingTransaction<'a> { + /// Allows the user to refund an arbitrary amount, also known as a unlinked refund. + pub fn send( + &self, + client: &stripe::Client, + ) -> stripe::Response { + client.send_form( + "/test_helpers/issuing/transactions/create_unlinked_refund", + self, + http_types::Method::Post, + ) + } +} +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct FlightSegmentSpecs<'a> { + /// The three-letter IATA airport code of the flight's destination. + #[serde(skip_serializing_if = "Option::is_none")] + pub arrival_airport_code: Option<&'a str>, + /// The airline carrier code. + #[serde(skip_serializing_if = "Option::is_none")] + pub carrier: Option<&'a str>, + /// The three-letter IATA airport code that the flight departed from. + #[serde(skip_serializing_if = "Option::is_none")] + pub departure_airport_code: Option<&'a str>, + /// The flight number. + #[serde(skip_serializing_if = "Option::is_none")] + pub flight_number: Option<&'a str>, + /// The flight's service class. + #[serde(skip_serializing_if = "Option::is_none")] + pub service_class: Option<&'a str>, + /// Whether a stopover is allowed on this flight. + #[serde(skip_serializing_if = "Option::is_none")] + pub stopover_allowed: Option, +} +impl<'a> FlightSegmentSpecs<'a> { + pub fn new() -> Self { + Self::default() + } +} +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct LodgingSpecs { + /// The time of checking into the lodging. + #[serde(skip_serializing_if = "Option::is_none")] + pub check_in_at: Option, + /// The number of nights stayed at the lodging. + #[serde(skip_serializing_if = "Option::is_none")] + pub nights: Option, +} +impl LodgingSpecs { + pub fn new() -> Self { + Self::default() + } +} +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct ReceiptSpecs<'a> { + #[serde(skip_serializing_if = "Option::is_none")] + pub description: Option<&'a str>, + #[serde(skip_serializing_if = "Option::is_none")] + pub quantity: Option<&'a str>, + #[serde(skip_serializing_if = "Option::is_none")] + pub total: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub unit_cost: Option, +} +impl<'a> ReceiptSpecs<'a> { + pub fn new() -> Self { + Self::default() + } +} +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct FlightSpecs<'a> { + /// The time that the flight departed. + #[serde(skip_serializing_if = "Option::is_none")] + pub departure_at: Option, + /// The name of the passenger. + #[serde(skip_serializing_if = "Option::is_none")] + pub passenger_name: Option<&'a str>, + /// Whether the ticket is refundable. + #[serde(skip_serializing_if = "Option::is_none")] + pub refundable: Option, + /// The legs of the trip. + #[serde(skip_serializing_if = "Option::is_none")] + pub segments: Option<&'a [FlightSegmentSpecs<'a>]>, + /// The travel agency that issued the ticket. + #[serde(skip_serializing_if = "Option::is_none")] + pub travel_agency: Option<&'a str>, +} +impl<'a> FlightSpecs<'a> { + pub fn new() -> Self { + Self::default() + } +} diff --git a/generated/stripe_issuing/src/mod.rs b/generated/stripe_issuing/src/mod.rs new file mode 100644 index 000000000..4d3172cd4 --- /dev/null +++ b/generated/stripe_issuing/src/mod.rs @@ -0,0 +1,81 @@ +#![recursion_limit = "256"] +#![allow(clippy::large_enum_variant)] +#![allow(rustdoc::broken_intra_doc_links)] +#![allow(rustdoc::invalid_html_tags)] + +//! This crate provides Rust bindings to the Stripe HTTP API, specifically +//! for requests mentioned in the `Issuing` section of the [Stripe API docs](https://stripe.com/docs/api) + +extern crate self as stripe_issuing; +pub use stripe_shared::funding_instructions::*; +pub use stripe_shared::funding_instructions_bank_transfer::*; +pub use stripe_shared::funding_instructions_bank_transfer_aba_record::*; +pub use stripe_shared::funding_instructions_bank_transfer_financial_address::*; +pub use stripe_shared::funding_instructions_bank_transfer_iban_record::*; +pub use stripe_shared::funding_instructions_bank_transfer_sort_code_record::*; +pub use stripe_shared::funding_instructions_bank_transfer_spei_record::*; +pub use stripe_shared::funding_instructions_bank_transfer_swift_record::*; +pub use stripe_shared::funding_instructions_bank_transfer_zengin_record::*; +pub mod issuing_authorization; +pub use stripe_shared::issuing_authorization::*; +pub mod issuing_card; +pub use stripe_shared::issuing_card::*; +pub mod issuing_cardholder; +pub use stripe_shared::issuing_cardholder::*; +pub mod issuing_dispute; +pub use stripe_shared::issuing_dispute::*; +pub mod issuing_token; +pub use stripe_shared::issuing_token::*; +pub mod issuing_transaction; +pub use stripe_shared::issuing_authorization_amount_details::*; +pub use stripe_shared::issuing_authorization_authentication_exemption::*; +pub use stripe_shared::issuing_authorization_merchant_data::*; +pub use stripe_shared::issuing_authorization_network_data::*; +pub use stripe_shared::issuing_authorization_pending_request::*; +pub use stripe_shared::issuing_authorization_request::*; +pub use stripe_shared::issuing_authorization_three_d_secure::*; +pub use stripe_shared::issuing_authorization_treasury::*; +pub use stripe_shared::issuing_authorization_verification_data::*; +pub use stripe_shared::issuing_card_apple_pay::*; +pub use stripe_shared::issuing_card_authorization_controls::*; +pub use stripe_shared::issuing_card_google_pay::*; +pub use stripe_shared::issuing_card_shipping::*; +pub use stripe_shared::issuing_card_shipping_customs::*; +pub use stripe_shared::issuing_card_spending_limit::*; +pub use stripe_shared::issuing_card_wallets::*; +pub use stripe_shared::issuing_cardholder_address::*; +pub use stripe_shared::issuing_cardholder_authorization_controls::*; +pub use stripe_shared::issuing_cardholder_card_issuing::*; +pub use stripe_shared::issuing_cardholder_company::*; +pub use stripe_shared::issuing_cardholder_id_document::*; +pub use stripe_shared::issuing_cardholder_individual::*; +pub use stripe_shared::issuing_cardholder_individual_dob::*; +pub use stripe_shared::issuing_cardholder_requirements::*; +pub use stripe_shared::issuing_cardholder_spending_limit::*; +pub use stripe_shared::issuing_cardholder_user_terms_acceptance::*; +pub use stripe_shared::issuing_cardholder_verification::*; +pub use stripe_shared::issuing_dispute_canceled_evidence::*; +pub use stripe_shared::issuing_dispute_duplicate_evidence::*; +pub use stripe_shared::issuing_dispute_evidence::*; +pub use stripe_shared::issuing_dispute_fraudulent_evidence::*; +pub use stripe_shared::issuing_dispute_merchandise_not_as_described_evidence::*; +pub use stripe_shared::issuing_dispute_not_received_evidence::*; +pub use stripe_shared::issuing_dispute_other_evidence::*; +pub use stripe_shared::issuing_dispute_service_not_as_described_evidence::*; +pub use stripe_shared::issuing_dispute_treasury::*; +pub use stripe_shared::issuing_network_token_address::*; +pub use stripe_shared::issuing_network_token_device::*; +pub use stripe_shared::issuing_network_token_mastercard::*; +pub use stripe_shared::issuing_network_token_network_data::*; +pub use stripe_shared::issuing_network_token_visa::*; +pub use stripe_shared::issuing_network_token_wallet_provider::*; +pub use stripe_shared::issuing_transaction::*; +pub use stripe_shared::issuing_transaction_amount_details::*; +pub use stripe_shared::issuing_transaction_flight_data::*; +pub use stripe_shared::issuing_transaction_flight_data_leg::*; +pub use stripe_shared::issuing_transaction_fuel_data::*; +pub use stripe_shared::issuing_transaction_lodging_data::*; +pub use stripe_shared::issuing_transaction_network_data::*; +pub use stripe_shared::issuing_transaction_purchase_details::*; +pub use stripe_shared::issuing_transaction_receipt_data::*; +pub use stripe_shared::issuing_transaction_treasury::*; diff --git a/generated/stripe_misc/Cargo.toml b/generated/stripe_misc/Cargo.toml new file mode 100644 index 000000000..6d58514f3 --- /dev/null +++ b/generated/stripe_misc/Cargo.toml @@ -0,0 +1,82 @@ +[package] +name = "stripe_misc" +version.workspace = true +description.workspace = true +edition.workspace = true +rust-version.workspace = true +authors.workspace = true +license.workspace = true +homepage.workspace = true +repository.workspace = true +keywords.workspace = true +categories.workspace = true + +[lib] +path = "src/mod.rs" + +[dependencies] +serde.workspace = true +smol_str.workspace = true +serde_json.workspace = true +stripe_types = {path = "../../stripe_types"} + +http-types.workspace = true +async-stripe = {path = "../../async-stripe"} + + +stripe_shared = {path = "../../generated/stripe_shared"} + + +[features] +runtime-tokio-hyper = ["async-stripe/runtime-tokio-hyper"] +runtime-tokio-hyper-rustls = ["async-stripe/runtime-tokio-hyper-rustls"] +runtime-tokio-hyper-rustls-webpki = ["async-stripe/runtime-tokio-hyper-rustls-webpki"] +runtime-blocking = ["async-stripe/runtime-blocking"] +runtime-blocking-rustls = ["async-stripe/runtime-blocking-rustls"] +runtime-blocking-rustls-webpki = ["async-stripe/runtime-blocking-rustls-webpki"] +runtime-async-std-surf = ["async-stripe/runtime-async-std-surf"] + +apple_pay_domain = [] +climate_order = [] +climate_product = [] +climate_supplier = [] +ephemeral_key = [] +exchange_rate = [] +financial_connections_account = [] +financial_connections_session = [] +financial_connections_transaction = [] +identity_verification_report = [] +identity_verification_session = [] +reporting_report_run = [] +reporting_report_type = [] +scheduled_query_run = [] +tax_calculation = [] +tax_registration = [] +tax_settings = [] +tax_transaction = [] +webhook_endpoint = [] + +full = ["apple_pay_domain", +"climate_order", +"climate_product", +"climate_supplier", +"ephemeral_key", +"exchange_rate", +"financial_connections_account", +"financial_connections_session", +"financial_connections_transaction", +"identity_verification_report", +"identity_verification_session", +"reporting_report_run", +"reporting_report_type", +"scheduled_query_run", +"tax_calculation", +"tax_registration", +"tax_settings", +"tax_transaction", +"webhook_endpoint"] + + +[package.metadata.docs.rs] +features = ["runtime-tokio-hyper", "full"] + diff --git a/generated/stripe_misc/src/apple_pay_domain/mod.rs b/generated/stripe_misc/src/apple_pay_domain/mod.rs new file mode 100644 index 000000000..85cbe6430 --- /dev/null +++ b/generated/stripe_misc/src/apple_pay_domain/mod.rs @@ -0,0 +1,5 @@ +#[cfg(feature = "apple_pay_domain")] +mod requests; +pub(crate) mod types; +#[cfg(feature = "apple_pay_domain")] +pub use requests::*; diff --git a/generated/stripe_misc/src/apple_pay_domain/requests.rs b/generated/stripe_misc/src/apple_pay_domain/requests.rs new file mode 100644 index 000000000..7c2460d5f --- /dev/null +++ b/generated/stripe_misc/src/apple_pay_domain/requests.rs @@ -0,0 +1,97 @@ +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct DeleteApplePayDomain {} +impl DeleteApplePayDomain { + pub fn new() -> Self { + Self::default() + } +} +impl DeleteApplePayDomain { + /// Delete an apple pay domain. + pub fn send( + &self, + client: &stripe::Client, + domain: &str, + ) -> stripe::Response { + client.send_form(&format!("/apple_pay/domains/{domain}"), self, http_types::Method::Delete) + } +} +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct ListApplePayDomain<'a> { + #[serde(skip_serializing_if = "Option::is_none")] + pub domain_name: Option<&'a str>, + /// A cursor for use in pagination. + /// `ending_before` is an object ID that defines your place in the list. + /// For instance, if you make a list request and receive 100 objects, starting with `obj_bar`, your subsequent call can include `ending_before=obj_bar` in order to fetch the previous page of the list. + #[serde(skip_serializing_if = "Option::is_none")] + pub ending_before: Option<&'a str>, + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, + /// A limit on the number of objects to be returned. + /// Limit can range between 1 and 100, and the default is 10. + #[serde(skip_serializing_if = "Option::is_none")] + pub limit: Option, + /// A cursor for use in pagination. + /// `starting_after` is an object ID that defines your place in the list. + /// For instance, if you make a list request and receive 100 objects, ending with `obj_foo`, your subsequent call can include `starting_after=obj_foo` in order to fetch the next page of the list. + #[serde(skip_serializing_if = "Option::is_none")] + pub starting_after: Option<&'a str>, +} +impl<'a> ListApplePayDomain<'a> { + pub fn new() -> Self { + Self::default() + } +} +impl<'a> ListApplePayDomain<'a> { + /// List apple pay domains. + pub fn send( + &self, + client: &stripe::Client, + ) -> stripe::Response> { + client.get_query("/apple_pay/domains", self) + } + pub fn paginate( + self, + ) -> stripe::ListPaginator> { + stripe::ListPaginator::from_list_params("/apple_pay/domains", self) + } +} +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct RetrieveApplePayDomain<'a> { + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, +} +impl<'a> RetrieveApplePayDomain<'a> { + pub fn new() -> Self { + Self::default() + } +} +impl<'a> RetrieveApplePayDomain<'a> { + /// Retrieve an apple pay domain. + pub fn send( + &self, + client: &stripe::Client, + domain: &str, + ) -> stripe::Response { + client.get_query(&format!("/apple_pay/domains/{domain}"), self) + } +} +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreateApplePayDomain<'a> { + pub domain_name: &'a str, + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, +} +impl<'a> CreateApplePayDomain<'a> { + pub fn new(domain_name: &'a str) -> Self { + Self { domain_name, expand: None } + } +} +impl<'a> CreateApplePayDomain<'a> { + /// Create an apple pay domain. + pub fn send(&self, client: &stripe::Client) -> stripe::Response { + client.send_form("/apple_pay/domains", self, http_types::Method::Post) + } +} diff --git a/generated/stripe_misc/src/apple_pay_domain/types.rs b/generated/stripe_misc/src/apple_pay_domain/types.rs new file mode 100644 index 000000000..d7f2f4fab --- /dev/null +++ b/generated/stripe_misc/src/apple_pay_domain/types.rs @@ -0,0 +1,17 @@ +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct ApplePayDomain { + /// Time at which the object was created. Measured in seconds since the Unix epoch. + pub created: stripe_types::Timestamp, + pub domain_name: String, + /// Unique identifier for the object. + pub id: stripe_misc::ApplePayDomainId, + /// Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + pub livemode: bool, +} +impl stripe_types::Object for ApplePayDomain { + type Id = stripe_misc::ApplePayDomainId; + fn id(&self) -> &Self::Id { + &self.id + } +} +stripe_types::def_id!(ApplePayDomainId); diff --git a/generated/stripe_misc/src/bank_connections_resource_accountholder.rs b/generated/stripe_misc/src/bank_connections_resource_accountholder.rs new file mode 100644 index 000000000..c66ab8910 --- /dev/null +++ b/generated/stripe_misc/src/bank_connections_resource_accountholder.rs @@ -0,0 +1,69 @@ +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct BankConnectionsResourceAccountholder { + /// The ID of the Stripe account this account belongs to. + /// Should only be present if `account_holder.type` is `account`. + #[serde(skip_serializing_if = "Option::is_none")] + pub account: Option>, + /// ID of the Stripe customer this account belongs to. + /// Present if and only if `account_holder.type` is `customer`. + #[serde(skip_serializing_if = "Option::is_none")] + pub customer: Option>, + /// Type of account holder that this account belongs to. + #[serde(rename = "type")] + pub type_: BankConnectionsResourceAccountholderType, +} +/// Type of account holder that this account belongs to. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum BankConnectionsResourceAccountholderType { + Account, + Customer, +} +impl BankConnectionsResourceAccountholderType { + pub fn as_str(self) -> &'static str { + use BankConnectionsResourceAccountholderType::*; + match self { + Account => "account", + Customer => "customer", + } + } +} + +impl std::str::FromStr for BankConnectionsResourceAccountholderType { + type Err = (); + fn from_str(s: &str) -> Result { + use BankConnectionsResourceAccountholderType::*; + match s { + "account" => Ok(Account), + "customer" => Ok(Customer), + _ => Err(()), + } + } +} +impl std::fmt::Display for BankConnectionsResourceAccountholderType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for BankConnectionsResourceAccountholderType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for BankConnectionsResourceAccountholderType { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for BankConnectionsResourceAccountholderType { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| { + serde::de::Error::custom("Unknown value for BankConnectionsResourceAccountholderType") + }) + } +} diff --git a/generated/stripe_misc/src/bank_connections_resource_balance.rs b/generated/stripe_misc/src/bank_connections_resource_balance.rs new file mode 100644 index 000000000..b7c084010 --- /dev/null +++ b/generated/stripe_misc/src/bank_connections_resource_balance.rs @@ -0,0 +1,78 @@ +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct BankConnectionsResourceBalance { + /// The time that the external institution calculated this balance. + /// Measured in seconds since the Unix epoch. + pub as_of: stripe_types::Timestamp, + #[serde(skip_serializing_if = "Option::is_none")] + pub cash: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub credit: Option, + /// The balances owed to (or by) the account holder. + /// + /// Each key is a three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. + /// + /// Each value is a integer amount. + /// A positive amount indicates money owed to the account holder. + /// A negative amount indicates money owed by the account holder. + pub current: std::collections::HashMap, + /// The `type` of the balance. + /// An additional hash is included on the balance with a name matching this value. + #[serde(rename = "type")] + pub type_: BankConnectionsResourceBalanceType, +} +/// The `type` of the balance. +/// An additional hash is included on the balance with a name matching this value. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum BankConnectionsResourceBalanceType { + Cash, + Credit, +} +impl BankConnectionsResourceBalanceType { + pub fn as_str(self) -> &'static str { + use BankConnectionsResourceBalanceType::*; + match self { + Cash => "cash", + Credit => "credit", + } + } +} + +impl std::str::FromStr for BankConnectionsResourceBalanceType { + type Err = (); + fn from_str(s: &str) -> Result { + use BankConnectionsResourceBalanceType::*; + match s { + "cash" => Ok(Cash), + "credit" => Ok(Credit), + _ => Err(()), + } + } +} +impl std::fmt::Display for BankConnectionsResourceBalanceType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for BankConnectionsResourceBalanceType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for BankConnectionsResourceBalanceType { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for BankConnectionsResourceBalanceType { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| { + serde::de::Error::custom("Unknown value for BankConnectionsResourceBalanceType") + }) + } +} diff --git a/generated/stripe_misc/src/bank_connections_resource_balance_api_resource_cash_balance.rs b/generated/stripe_misc/src/bank_connections_resource_balance_api_resource_cash_balance.rs new file mode 100644 index 000000000..b7d15dbe1 --- /dev/null +++ b/generated/stripe_misc/src/bank_connections_resource_balance_api_resource_cash_balance.rs @@ -0,0 +1,11 @@ +#[derive(Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct BankConnectionsResourceBalanceApiResourceCashBalance { + /// The funds available to the account holder. Typically this is the current balance less any holds. + /// + /// Each key is a three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. + /// + /// Each value is a integer amount. + /// A positive amount indicates money owed to the account holder. + /// A negative amount indicates money owed by the account holder. + pub available: Option>, +} diff --git a/generated/stripe_misc/src/bank_connections_resource_balance_api_resource_credit_balance.rs b/generated/stripe_misc/src/bank_connections_resource_balance_api_resource_credit_balance.rs new file mode 100644 index 000000000..e021be313 --- /dev/null +++ b/generated/stripe_misc/src/bank_connections_resource_balance_api_resource_credit_balance.rs @@ -0,0 +1,11 @@ +#[derive(Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct BankConnectionsResourceBalanceApiResourceCreditBalance { + /// The credit that has been used by the account holder. + /// + /// Each key is a three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. + /// + /// Each value is a integer amount. + /// A positive amount indicates money owed to the account holder. + /// A negative amount indicates money owed by the account holder. + pub used: Option>, +} diff --git a/generated/stripe_misc/src/bank_connections_resource_balance_refresh.rs b/generated/stripe_misc/src/bank_connections_resource_balance_refresh.rs new file mode 100644 index 000000000..e745207aa --- /dev/null +++ b/generated/stripe_misc/src/bank_connections_resource_balance_refresh.rs @@ -0,0 +1,71 @@ +#[derive(Copy, Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct BankConnectionsResourceBalanceRefresh { + /// The time at which the last refresh attempt was initiated. Measured in seconds since the Unix epoch. + pub last_attempted_at: stripe_types::Timestamp, + /// Time at which the next balance refresh can be initiated. + /// This value will be `null` when `status` is `pending`. + /// Measured in seconds since the Unix epoch. + pub next_refresh_available_at: Option, + /// The status of the last refresh attempt. + pub status: BankConnectionsResourceBalanceRefreshStatus, +} +/// The status of the last refresh attempt. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum BankConnectionsResourceBalanceRefreshStatus { + Failed, + Pending, + Succeeded, +} +impl BankConnectionsResourceBalanceRefreshStatus { + pub fn as_str(self) -> &'static str { + use BankConnectionsResourceBalanceRefreshStatus::*; + match self { + Failed => "failed", + Pending => "pending", + Succeeded => "succeeded", + } + } +} + +impl std::str::FromStr for BankConnectionsResourceBalanceRefreshStatus { + type Err = (); + fn from_str(s: &str) -> Result { + use BankConnectionsResourceBalanceRefreshStatus::*; + match s { + "failed" => Ok(Failed), + "pending" => Ok(Pending), + "succeeded" => Ok(Succeeded), + _ => Err(()), + } + } +} +impl std::fmt::Display for BankConnectionsResourceBalanceRefreshStatus { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for BankConnectionsResourceBalanceRefreshStatus { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for BankConnectionsResourceBalanceRefreshStatus { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for BankConnectionsResourceBalanceRefreshStatus { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| { + serde::de::Error::custom( + "Unknown value for BankConnectionsResourceBalanceRefreshStatus", + ) + }) + } +} diff --git a/generated/stripe_misc/src/bank_connections_resource_link_account_session_filters.rs b/generated/stripe_misc/src/bank_connections_resource_link_account_session_filters.rs new file mode 100644 index 000000000..6e0c82fac --- /dev/null +++ b/generated/stripe_misc/src/bank_connections_resource_link_account_session_filters.rs @@ -0,0 +1,5 @@ +#[derive(Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct BankConnectionsResourceLinkAccountSessionFilters { + /// List of countries from which to filter accounts. + pub countries: Option>, +} diff --git a/generated/stripe_misc/src/bank_connections_resource_ownership_refresh.rs b/generated/stripe_misc/src/bank_connections_resource_ownership_refresh.rs new file mode 100644 index 000000000..65566c6ca --- /dev/null +++ b/generated/stripe_misc/src/bank_connections_resource_ownership_refresh.rs @@ -0,0 +1,67 @@ +#[derive(Copy, Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct BankConnectionsResourceOwnershipRefresh { + /// The time at which the last refresh attempt was initiated. Measured in seconds since the Unix epoch. + pub last_attempted_at: stripe_types::Timestamp, + /// The status of the last refresh attempt. + pub status: BankConnectionsResourceOwnershipRefreshStatus, +} +/// The status of the last refresh attempt. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum BankConnectionsResourceOwnershipRefreshStatus { + Failed, + Pending, + Succeeded, +} +impl BankConnectionsResourceOwnershipRefreshStatus { + pub fn as_str(self) -> &'static str { + use BankConnectionsResourceOwnershipRefreshStatus::*; + match self { + Failed => "failed", + Pending => "pending", + Succeeded => "succeeded", + } + } +} + +impl std::str::FromStr for BankConnectionsResourceOwnershipRefreshStatus { + type Err = (); + fn from_str(s: &str) -> Result { + use BankConnectionsResourceOwnershipRefreshStatus::*; + match s { + "failed" => Ok(Failed), + "pending" => Ok(Pending), + "succeeded" => Ok(Succeeded), + _ => Err(()), + } + } +} +impl std::fmt::Display for BankConnectionsResourceOwnershipRefreshStatus { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for BankConnectionsResourceOwnershipRefreshStatus { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for BankConnectionsResourceOwnershipRefreshStatus { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for BankConnectionsResourceOwnershipRefreshStatus { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| { + serde::de::Error::custom( + "Unknown value for BankConnectionsResourceOwnershipRefreshStatus", + ) + }) + } +} diff --git a/generated/stripe_misc/src/bank_connections_resource_transaction_refresh.rs b/generated/stripe_misc/src/bank_connections_resource_transaction_refresh.rs new file mode 100644 index 000000000..f42f5591a --- /dev/null +++ b/generated/stripe_misc/src/bank_connections_resource_transaction_refresh.rs @@ -0,0 +1,80 @@ +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct BankConnectionsResourceTransactionRefresh { + /// Unique identifier for the object. + pub id: stripe_misc::BankConnectionsResourceTransactionRefreshId, + /// The time at which the last refresh attempt was initiated. Measured in seconds since the Unix epoch. + pub last_attempted_at: stripe_types::Timestamp, + /// Time at which the next transaction refresh can be initiated. + /// This value will be `null` when `status` is `pending`. + /// Measured in seconds since the Unix epoch. + pub next_refresh_available_at: Option, + /// The status of the last refresh attempt. + pub status: BankConnectionsResourceTransactionRefreshStatus, +} +/// The status of the last refresh attempt. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum BankConnectionsResourceTransactionRefreshStatus { + Failed, + Pending, + Succeeded, +} +impl BankConnectionsResourceTransactionRefreshStatus { + pub fn as_str(self) -> &'static str { + use BankConnectionsResourceTransactionRefreshStatus::*; + match self { + Failed => "failed", + Pending => "pending", + Succeeded => "succeeded", + } + } +} + +impl std::str::FromStr for BankConnectionsResourceTransactionRefreshStatus { + type Err = (); + fn from_str(s: &str) -> Result { + use BankConnectionsResourceTransactionRefreshStatus::*; + match s { + "failed" => Ok(Failed), + "pending" => Ok(Pending), + "succeeded" => Ok(Succeeded), + _ => Err(()), + } + } +} +impl std::fmt::Display for BankConnectionsResourceTransactionRefreshStatus { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for BankConnectionsResourceTransactionRefreshStatus { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for BankConnectionsResourceTransactionRefreshStatus { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for BankConnectionsResourceTransactionRefreshStatus { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| { + serde::de::Error::custom( + "Unknown value for BankConnectionsResourceTransactionRefreshStatus", + ) + }) + } +} +impl stripe_types::Object for BankConnectionsResourceTransactionRefresh { + type Id = stripe_misc::BankConnectionsResourceTransactionRefreshId; + fn id(&self) -> &Self::Id { + &self.id + } +} +stripe_types::def_id!(BankConnectionsResourceTransactionRefreshId); diff --git a/generated/stripe_misc/src/bank_connections_resource_transaction_resource_status_transitions.rs b/generated/stripe_misc/src/bank_connections_resource_transaction_resource_status_transitions.rs new file mode 100644 index 000000000..cfbe46044 --- /dev/null +++ b/generated/stripe_misc/src/bank_connections_resource_transaction_resource_status_transitions.rs @@ -0,0 +1,7 @@ +#[derive(Copy, Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct BankConnectionsResourceTransactionResourceStatusTransitions { + /// Time at which this transaction posted. Measured in seconds since the Unix epoch. + pub posted_at: Option, + /// Time at which this transaction was voided. Measured in seconds since the Unix epoch. + pub void_at: Option, +} diff --git a/generated/stripe_misc/src/climate_order/mod.rs b/generated/stripe_misc/src/climate_order/mod.rs new file mode 100644 index 000000000..0c0680d82 --- /dev/null +++ b/generated/stripe_misc/src/climate_order/mod.rs @@ -0,0 +1,5 @@ +#[cfg(feature = "climate_order")] +mod requests; +pub(crate) mod types; +#[cfg(feature = "climate_order")] +pub use requests::*; diff --git a/generated/stripe_misc/src/climate_order/requests.rs b/generated/stripe_misc/src/climate_order/requests.rs new file mode 100644 index 000000000..7487dc31f --- /dev/null +++ b/generated/stripe_misc/src/climate_order/requests.rs @@ -0,0 +1,173 @@ +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct ListClimateOrder<'a> { + /// A cursor for use in pagination. + /// `ending_before` is an object ID that defines your place in the list. + /// For instance, if you make a list request and receive 100 objects, starting with `obj_bar`, your subsequent call can include `ending_before=obj_bar` in order to fetch the previous page of the list. + #[serde(skip_serializing_if = "Option::is_none")] + pub ending_before: Option<&'a str>, + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, + /// A limit on the number of objects to be returned. + /// Limit can range between 1 and 100, and the default is 10. + #[serde(skip_serializing_if = "Option::is_none")] + pub limit: Option, + /// A cursor for use in pagination. + /// `starting_after` is an object ID that defines your place in the list. + /// For instance, if you make a list request and receive 100 objects, ending with `obj_foo`, your subsequent call can include `starting_after=obj_foo` in order to fetch the next page of the list. + #[serde(skip_serializing_if = "Option::is_none")] + pub starting_after: Option<&'a str>, +} +impl<'a> ListClimateOrder<'a> { + pub fn new() -> Self { + Self::default() + } +} +impl<'a> ListClimateOrder<'a> { + /// Lists all Climate order objects. The orders are returned sorted by creation date, with the + /// most recently created orders appearing first. + pub fn send( + &self, + client: &stripe::Client, + ) -> stripe::Response> { + client.get_query("/climate/orders", self) + } + pub fn paginate(self) -> stripe::ListPaginator> { + stripe::ListPaginator::from_list_params("/climate/orders", self) + } +} +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct RetrieveClimateOrder<'a> { + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, +} +impl<'a> RetrieveClimateOrder<'a> { + pub fn new() -> Self { + Self::default() + } +} +impl<'a> RetrieveClimateOrder<'a> { + /// Retrieves the details of a Climate order object with the given ID. + pub fn send( + &self, + client: &stripe::Client, + order: &stripe_misc::ClimateOrderId, + ) -> stripe::Response { + client.get_query(&format!("/climate/orders/{order}"), self) + } +} +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreateClimateOrder<'a> { + /// Requested amount of carbon removal units. Either this or `metric_tons` must be specified. + #[serde(skip_serializing_if = "Option::is_none")] + pub amount: Option, + /// Publicly sharable reference for the end beneficiary of carbon removal. + /// Assumed to be the Stripe account if not set. + #[serde(skip_serializing_if = "Option::is_none")] + pub beneficiary: Option>, + /// Request currency for the order as a three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. + /// Must be a supported [settlement currency for your account](https://stripe.com/docs/currencies). + /// If omitted, the account's default currency will be used. + #[serde(skip_serializing_if = "Option::is_none")] + pub currency: Option, + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, + /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. + /// This can be useful for storing additional information about the object in a structured format. + /// Individual keys can be unset by posting an empty value to them. + /// All keys can be unset by posting an empty value to `metadata`. + #[serde(skip_serializing_if = "Option::is_none")] + pub metadata: Option<&'a std::collections::HashMap>, + /// Requested number of tons for the order. Either this or `amount` must be specified. + #[serde(skip_serializing_if = "Option::is_none")] + pub metric_tons: Option<&'a str>, + /// Unique identifier of the Climate product. + pub product: &'a str, +} +impl<'a> CreateClimateOrder<'a> { + pub fn new(product: &'a str) -> Self { + Self { + amount: None, + beneficiary: None, + currency: None, + expand: None, + metadata: None, + metric_tons: None, + product, + } + } +} +impl<'a> CreateClimateOrder<'a> { + /// Creates a Climate order object for a given Climate product. The order will be processed immediately + /// after creation and payment will be deducted your Stripe balance. + pub fn send(&self, client: &stripe::Client) -> stripe::Response { + client.send_form("/climate/orders", self, http_types::Method::Post) + } +} +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdateClimateOrder<'a> { + /// Publicly sharable reference for the end beneficiary of carbon removal. + /// Assumed to be the Stripe account if not set. + #[serde(skip_serializing_if = "Option::is_none")] + pub beneficiary: Option>, + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, + /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. + /// This can be useful for storing additional information about the object in a structured format. + /// Individual keys can be unset by posting an empty value to them. + /// All keys can be unset by posting an empty value to `metadata`. + #[serde(skip_serializing_if = "Option::is_none")] + pub metadata: Option<&'a std::collections::HashMap>, +} +impl<'a> UpdateClimateOrder<'a> { + pub fn new() -> Self { + Self::default() + } +} +impl<'a> UpdateClimateOrder<'a> { + /// Updates the specified order by setting the values of the parameters passed. + pub fn send( + &self, + client: &stripe::Client, + order: &stripe_misc::ClimateOrderId, + ) -> stripe::Response { + client.send_form(&format!("/climate/orders/{order}"), self, http_types::Method::Post) + } +} +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CancelClimateOrder<'a> { + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, +} +impl<'a> CancelClimateOrder<'a> { + pub fn new() -> Self { + Self::default() + } +} +impl<'a> CancelClimateOrder<'a> { + /// Cancels a Climate order. You can cancel an order within 30 days of creation. Stripe refunds the + /// reservation `amount_subtotal`, but not the `amount_fees` for user-triggered cancellations. Frontier + /// might cancel reservations if suppliers fail to deliver. If Frontier cancels the reservation, Stripe + /// provides 90 days advance notice and refunds the `amount_total`. + pub fn send( + &self, + client: &stripe::Client, + order: &stripe_misc::ClimateOrderId, + ) -> stripe::Response { + client.send_form(&format!("/climate/orders/{order}/cancel"), self, http_types::Method::Post) + } +} +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct BeneficiaryParams<'a> { + /// Publicly displayable name for the end beneficiary of carbon removal. + pub public_name: &'a str, +} +impl<'a> BeneficiaryParams<'a> { + pub fn new(public_name: &'a str) -> Self { + Self { public_name } + } +} diff --git a/generated/stripe_misc/src/climate_order/types.rs b/generated/stripe_misc/src/climate_order/types.rs new file mode 100644 index 000000000..bf65955ee --- /dev/null +++ b/generated/stripe_misc/src/climate_order/types.rs @@ -0,0 +1,179 @@ +/// Orders represent your intent to purchase a particular Climate product. +/// When you create an order, the. +/// payment is deducted from your merchant balance. +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct ClimateOrder { + /// Total amount of [Frontier](https://frontierclimate.com/)'s service fees in the currency's smallest unit. + pub amount_fees: i64, + /// Total amount of the carbon removal in the currency's smallest unit. + pub amount_subtotal: i64, + /// Total amount of the order including fees in the currency's smallest unit. + pub amount_total: i64, + #[serde(skip_serializing_if = "Option::is_none")] + pub beneficiary: Option, + /// Time at which the order was canceled. Measured in seconds since the Unix epoch. + pub canceled_at: Option, + /// Reason for the cancellation of this order. + pub cancellation_reason: Option, + /// For delivered orders, a URL to a delivery certificate for the order. + pub certificate: Option, + /// Time at which the order was confirmed. Measured in seconds since the Unix epoch. + pub confirmed_at: Option, + /// Time at which the object was created. Measured in seconds since the Unix epoch. + pub created: stripe_types::Timestamp, + /// Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase, representing the currency for this order. + pub currency: stripe_types::Currency, + /// Time at which the order's expected_delivery_year was delayed. + /// Measured in seconds since the Unix epoch. + pub delayed_at: Option, + /// Time at which the order was delivered. Measured in seconds since the Unix epoch. + pub delivered_at: Option, + /// Details about the delivery of carbon removal for this order. + pub delivery_details: Vec, + /// The year this order is expected to be delivered. + pub expected_delivery_year: i64, + /// Unique identifier for the object. + pub id: stripe_misc::ClimateOrderId, + /// Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + pub livemode: bool, + /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. + /// This can be useful for storing additional information about the object in a structured format. + pub metadata: std::collections::HashMap, + /// Quantity of carbon removal that is included in this order. + pub metric_tons: String, + /// Unique ID for the Climate `Product` this order is purchasing. + pub product: stripe_types::Expandable, + /// Time at which the order's product was substituted for a different product. + /// Measured in seconds since the Unix epoch. + pub product_substituted_at: Option, + /// The current status of this order. + pub status: ClimateOrderStatus, +} +/// Reason for the cancellation of this order. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum ClimateOrderCancellationReason { + Expired, + ProductUnavailable, + Requested, +} +impl ClimateOrderCancellationReason { + pub fn as_str(self) -> &'static str { + use ClimateOrderCancellationReason::*; + match self { + Expired => "expired", + ProductUnavailable => "product_unavailable", + Requested => "requested", + } + } +} + +impl std::str::FromStr for ClimateOrderCancellationReason { + type Err = (); + fn from_str(s: &str) -> Result { + use ClimateOrderCancellationReason::*; + match s { + "expired" => Ok(Expired), + "product_unavailable" => Ok(ProductUnavailable), + "requested" => Ok(Requested), + _ => Err(()), + } + } +} +impl std::fmt::Display for ClimateOrderCancellationReason { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for ClimateOrderCancellationReason { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for ClimateOrderCancellationReason { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for ClimateOrderCancellationReason { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| { + serde::de::Error::custom("Unknown value for ClimateOrderCancellationReason") + }) + } +} +/// The current status of this order. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum ClimateOrderStatus { + AwaitingFunds, + Canceled, + Confirmed, + Delivered, + Open, +} +impl ClimateOrderStatus { + pub fn as_str(self) -> &'static str { + use ClimateOrderStatus::*; + match self { + AwaitingFunds => "awaiting_funds", + Canceled => "canceled", + Confirmed => "confirmed", + Delivered => "delivered", + Open => "open", + } + } +} + +impl std::str::FromStr for ClimateOrderStatus { + type Err = (); + fn from_str(s: &str) -> Result { + use ClimateOrderStatus::*; + match s { + "awaiting_funds" => Ok(AwaitingFunds), + "canceled" => Ok(Canceled), + "confirmed" => Ok(Confirmed), + "delivered" => Ok(Delivered), + "open" => Ok(Open), + _ => Err(()), + } + } +} +impl std::fmt::Display for ClimateOrderStatus { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for ClimateOrderStatus { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for ClimateOrderStatus { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for ClimateOrderStatus { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s) + .map_err(|_| serde::de::Error::custom("Unknown value for ClimateOrderStatus")) + } +} +impl stripe_types::Object for ClimateOrder { + type Id = stripe_misc::ClimateOrderId; + fn id(&self) -> &Self::Id { + &self.id + } +} +stripe_types::def_id!(ClimateOrderId); diff --git a/generated/stripe_misc/src/climate_product/mod.rs b/generated/stripe_misc/src/climate_product/mod.rs new file mode 100644 index 000000000..855638012 --- /dev/null +++ b/generated/stripe_misc/src/climate_product/mod.rs @@ -0,0 +1,5 @@ +#[cfg(feature = "climate_product")] +mod requests; +pub(crate) mod types; +#[cfg(feature = "climate_product")] +pub use requests::*; diff --git a/generated/stripe_misc/src/climate_product/requests.rs b/generated/stripe_misc/src/climate_product/requests.rs new file mode 100644 index 000000000..fe787ea90 --- /dev/null +++ b/generated/stripe_misc/src/climate_product/requests.rs @@ -0,0 +1,60 @@ +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct ListClimateProduct<'a> { + /// A cursor for use in pagination. + /// `ending_before` is an object ID that defines your place in the list. + /// For instance, if you make a list request and receive 100 objects, starting with `obj_bar`, your subsequent call can include `ending_before=obj_bar` in order to fetch the previous page of the list. + #[serde(skip_serializing_if = "Option::is_none")] + pub ending_before: Option<&'a str>, + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, + /// A limit on the number of objects to be returned. + /// Limit can range between 1 and 100, and the default is 10. + #[serde(skip_serializing_if = "Option::is_none")] + pub limit: Option, + /// A cursor for use in pagination. + /// `starting_after` is an object ID that defines your place in the list. + /// For instance, if you make a list request and receive 100 objects, ending with `obj_foo`, your subsequent call can include `starting_after=obj_foo` in order to fetch the next page of the list. + #[serde(skip_serializing_if = "Option::is_none")] + pub starting_after: Option<&'a str>, +} +impl<'a> ListClimateProduct<'a> { + pub fn new() -> Self { + Self::default() + } +} +impl<'a> ListClimateProduct<'a> { + /// Lists all available Climate product objects. + pub fn send( + &self, + client: &stripe::Client, + ) -> stripe::Response> { + client.get_query("/climate/products", self) + } + pub fn paginate( + self, + ) -> stripe::ListPaginator> { + stripe::ListPaginator::from_list_params("/climate/products", self) + } +} +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct RetrieveClimateProduct<'a> { + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, +} +impl<'a> RetrieveClimateProduct<'a> { + pub fn new() -> Self { + Self::default() + } +} +impl<'a> RetrieveClimateProduct<'a> { + /// Retrieves the details of a Climate product with the given ID. + pub fn send( + &self, + client: &stripe::Client, + product: &stripe_misc::ClimateProductId, + ) -> stripe::Response { + client.get_query(&format!("/climate/products/{product}"), self) + } +} diff --git a/generated/stripe_misc/src/climate_product/types.rs b/generated/stripe_misc/src/climate_product/types.rs new file mode 100644 index 000000000..dd2efbada --- /dev/null +++ b/generated/stripe_misc/src/climate_product/types.rs @@ -0,0 +1,32 @@ +/// A Climate product represents a type of carbon removal unit available for reservation. +/// You can retrieve it to see the current price and availability. +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct ClimateProduct { + /// Time at which the object was created. Measured in seconds since the Unix epoch. + pub created: stripe_types::Timestamp, + /// Current prices for a metric ton of carbon removal in a currency's smallest unit. + pub current_prices_per_metric_ton: + std::collections::HashMap, + /// The year in which the carbon removal is expected to be delivered. + pub delivery_year: Option, + /// Unique identifier for the object. For convenience, Climate product IDs are human-readable strings + /// that start with `climsku_`. + /// See [carbon removal inventory](https://stripe.com/docs/climate/orders/carbon-removal-inventory). + /// for a list of available carbon removal products. + pub id: stripe_misc::ClimateProductId, + /// Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + pub livemode: bool, + /// The quantity of metric tons available for reservation. + pub metric_tons_available: String, + /// The Climate product's name. + pub name: String, + /// The carbon removal suppliers that fulfill orders for this Climate product. + pub suppliers: Vec, +} +impl stripe_types::Object for ClimateProduct { + type Id = stripe_misc::ClimateProductId; + fn id(&self) -> &Self::Id { + &self.id + } +} +stripe_types::def_id!(ClimateProductId); diff --git a/generated/stripe_misc/src/climate_removals_beneficiary.rs b/generated/stripe_misc/src/climate_removals_beneficiary.rs new file mode 100644 index 000000000..f0860a5fc --- /dev/null +++ b/generated/stripe_misc/src/climate_removals_beneficiary.rs @@ -0,0 +1,5 @@ +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct ClimateRemovalsBeneficiary { + /// Publicly displayable name for the end beneficiary of carbon removal. + pub public_name: String, +} diff --git a/generated/stripe_misc/src/climate_removals_location.rs b/generated/stripe_misc/src/climate_removals_location.rs new file mode 100644 index 000000000..7fa39bc14 --- /dev/null +++ b/generated/stripe_misc/src/climate_removals_location.rs @@ -0,0 +1,13 @@ +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct ClimateRemovalsLocation { + /// The city where the supplier is located. + pub city: Option, + /// Two-letter ISO code representing the country where the supplier is located. + pub country: String, + /// The geographic latitude where the supplier is located. + pub latitude: Option, + /// The geographic longitude where the supplier is located. + pub longitude: Option, + /// The state/county/province/region where the supplier is located. + pub region: Option, +} diff --git a/generated/stripe_misc/src/climate_removals_order_deliveries.rs b/generated/stripe_misc/src/climate_removals_order_deliveries.rs new file mode 100644 index 000000000..5dab0ff00 --- /dev/null +++ b/generated/stripe_misc/src/climate_removals_order_deliveries.rs @@ -0,0 +1,13 @@ +/// The delivery of a specified quantity of carbon for an order. +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct ClimateRemovalsOrderDeliveries { + /// Time at which the delivery occurred. Measured in seconds since the Unix epoch. + pub delivered_at: stripe_types::Timestamp, + /// Specific location of this delivery. + pub location: Option, + /// Quantity of carbon removal supplied by this delivery. + pub metric_tons: String, + /// Once retired, a URL to the registry entry for the tons from this delivery. + pub registry_url: Option, + pub supplier: stripe_misc::ClimateSupplier, +} diff --git a/generated/stripe_misc/src/climate_removals_products_price.rs b/generated/stripe_misc/src/climate_removals_products_price.rs new file mode 100644 index 000000000..13fb83ed5 --- /dev/null +++ b/generated/stripe_misc/src/climate_removals_products_price.rs @@ -0,0 +1,9 @@ +#[derive(Copy, Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct ClimateRemovalsProductsPrice { + /// Fees for one metric ton of carbon removal in the currency's smallest unit. + pub amount_fees: i64, + /// Subtotal for one metric ton of carbon removal (excluding fees) in the currency's smallest unit. + pub amount_subtotal: i64, + /// Total for one metric ton of carbon removal (including fees) in the currency's smallest unit. + pub amount_total: i64, +} diff --git a/generated/stripe_misc/src/climate_supplier/mod.rs b/generated/stripe_misc/src/climate_supplier/mod.rs new file mode 100644 index 000000000..d334a4cd5 --- /dev/null +++ b/generated/stripe_misc/src/climate_supplier/mod.rs @@ -0,0 +1,5 @@ +#[cfg(feature = "climate_supplier")] +mod requests; +pub(crate) mod types; +#[cfg(feature = "climate_supplier")] +pub use requests::*; diff --git a/generated/stripe_misc/src/climate_supplier/requests.rs b/generated/stripe_misc/src/climate_supplier/requests.rs new file mode 100644 index 000000000..193bb9685 --- /dev/null +++ b/generated/stripe_misc/src/climate_supplier/requests.rs @@ -0,0 +1,60 @@ +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct ListClimateSupplier<'a> { + /// A cursor for use in pagination. + /// `ending_before` is an object ID that defines your place in the list. + /// For instance, if you make a list request and receive 100 objects, starting with `obj_bar`, your subsequent call can include `ending_before=obj_bar` in order to fetch the previous page of the list. + #[serde(skip_serializing_if = "Option::is_none")] + pub ending_before: Option<&'a str>, + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, + /// A limit on the number of objects to be returned. + /// Limit can range between 1 and 100, and the default is 10. + #[serde(skip_serializing_if = "Option::is_none")] + pub limit: Option, + /// A cursor for use in pagination. + /// `starting_after` is an object ID that defines your place in the list. + /// For instance, if you make a list request and receive 100 objects, ending with `obj_foo`, your subsequent call can include `starting_after=obj_foo` in order to fetch the next page of the list. + #[serde(skip_serializing_if = "Option::is_none")] + pub starting_after: Option<&'a str>, +} +impl<'a> ListClimateSupplier<'a> { + pub fn new() -> Self { + Self::default() + } +} +impl<'a> ListClimateSupplier<'a> { + /// Lists all available Climate supplier objects. + pub fn send( + &self, + client: &stripe::Client, + ) -> stripe::Response> { + client.get_query("/climate/suppliers", self) + } + pub fn paginate( + self, + ) -> stripe::ListPaginator> { + stripe::ListPaginator::from_list_params("/climate/suppliers", self) + } +} +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct RetrieveClimateSupplier<'a> { + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, +} +impl<'a> RetrieveClimateSupplier<'a> { + pub fn new() -> Self { + Self::default() + } +} +impl<'a> RetrieveClimateSupplier<'a> { + /// Retrieves a Climate supplier object. + pub fn send( + &self, + client: &stripe::Client, + supplier: &stripe_misc::ClimateSupplierId, + ) -> stripe::Response { + client.get_query(&format!("/climate/suppliers/{supplier}"), self) + } +} diff --git a/generated/stripe_misc/src/climate_supplier/types.rs b/generated/stripe_misc/src/climate_supplier/types.rs new file mode 100644 index 000000000..5f4a13f13 --- /dev/null +++ b/generated/stripe_misc/src/climate_supplier/types.rs @@ -0,0 +1,81 @@ +/// A supplier of carbon removal. +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct ClimateSupplier { + /// Unique identifier for the object. + pub id: stripe_misc::ClimateSupplierId, + /// Link to a webpage to learn more about the supplier. + pub info_url: String, + /// Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + pub livemode: bool, + /// The locations in which this supplier operates. + pub locations: Vec, + /// Name of this carbon removal supplier. + pub name: String, + /// The scientific pathway used for carbon removal. + pub removal_pathway: ClimateSupplierRemovalPathway, +} +/// The scientific pathway used for carbon removal. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum ClimateSupplierRemovalPathway { + BiomassCarbonRemovalAndStorage, + DirectAirCapture, + EnhancedWeathering, +} +impl ClimateSupplierRemovalPathway { + pub fn as_str(self) -> &'static str { + use ClimateSupplierRemovalPathway::*; + match self { + BiomassCarbonRemovalAndStorage => "biomass_carbon_removal_and_storage", + DirectAirCapture => "direct_air_capture", + EnhancedWeathering => "enhanced_weathering", + } + } +} + +impl std::str::FromStr for ClimateSupplierRemovalPathway { + type Err = (); + fn from_str(s: &str) -> Result { + use ClimateSupplierRemovalPathway::*; + match s { + "biomass_carbon_removal_and_storage" => Ok(BiomassCarbonRemovalAndStorage), + "direct_air_capture" => Ok(DirectAirCapture), + "enhanced_weathering" => Ok(EnhancedWeathering), + _ => Err(()), + } + } +} +impl std::fmt::Display for ClimateSupplierRemovalPathway { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for ClimateSupplierRemovalPathway { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for ClimateSupplierRemovalPathway { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for ClimateSupplierRemovalPathway { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| { + serde::de::Error::custom("Unknown value for ClimateSupplierRemovalPathway") + }) + } +} +impl stripe_types::Object for ClimateSupplier { + type Id = stripe_misc::ClimateSupplierId; + fn id(&self) -> &Self::Id { + &self.id + } +} +stripe_types::def_id!(ClimateSupplierId); diff --git a/generated/stripe_misc/src/deleted_apple_pay_domain.rs b/generated/stripe_misc/src/deleted_apple_pay_domain.rs new file mode 100644 index 000000000..666770f23 --- /dev/null +++ b/generated/stripe_misc/src/deleted_apple_pay_domain.rs @@ -0,0 +1,13 @@ +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct DeletedApplePayDomain { + /// Always true for a deleted object + deleted: stripe_types::AlwaysTrue, + /// Unique identifier for the object. + pub id: stripe_misc::ApplePayDomainId, +} +impl stripe_types::Object for DeletedApplePayDomain { + type Id = stripe_misc::ApplePayDomainId; + fn id(&self) -> &Self::Id { + &self.id + } +} diff --git a/generated/stripe_misc/src/deleted_webhook_endpoint.rs b/generated/stripe_misc/src/deleted_webhook_endpoint.rs new file mode 100644 index 000000000..c327e5e37 --- /dev/null +++ b/generated/stripe_misc/src/deleted_webhook_endpoint.rs @@ -0,0 +1,13 @@ +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct DeletedWebhookEndpoint { + /// Always true for a deleted object + deleted: stripe_types::AlwaysTrue, + /// Unique identifier for the object. + pub id: stripe_misc::WebhookEndpointId, +} +impl stripe_types::Object for DeletedWebhookEndpoint { + type Id = stripe_misc::WebhookEndpointId; + fn id(&self) -> &Self::Id { + &self.id + } +} diff --git a/generated/stripe_misc/src/ephemeral_key/mod.rs b/generated/stripe_misc/src/ephemeral_key/mod.rs new file mode 100644 index 000000000..ff44be2fe --- /dev/null +++ b/generated/stripe_misc/src/ephemeral_key/mod.rs @@ -0,0 +1,5 @@ +#[cfg(feature = "ephemeral_key")] +mod requests; +pub(crate) mod types; +#[cfg(feature = "ephemeral_key")] +pub use requests::*; diff --git a/generated/stripe_misc/src/ephemeral_key/requests.rs b/generated/stripe_misc/src/ephemeral_key/requests.rs new file mode 100644 index 000000000..18f1db15b --- /dev/null +++ b/generated/stripe_misc/src/ephemeral_key/requests.rs @@ -0,0 +1,50 @@ +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct DeleteEphemeralKey<'a> { + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, +} +impl<'a> DeleteEphemeralKey<'a> { + pub fn new() -> Self { + Self::default() + } +} +impl<'a> DeleteEphemeralKey<'a> { + /// Invalidates a short-lived API key for a given resource. + pub fn send( + &self, + client: &stripe::Client, + key: &stripe_misc::EphemeralKeyId, + ) -> stripe::Response { + client.send_form(&format!("/ephemeral_keys/{key}"), self, http_types::Method::Delete) + } +} +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreateEphemeralKey<'a> { + /// The ID of the Customer you'd like to modify using the resulting ephemeral key. + #[serde(skip_serializing_if = "Option::is_none")] + pub customer: Option<&'a str>, + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, + /// The ID of the Issuing Card you'd like to access using the resulting ephemeral key. + #[serde(skip_serializing_if = "Option::is_none")] + pub issuing_card: Option<&'a str>, + /// A single-use token, created by Stripe.js, used for creating ephemeral keys for Issuing Cards without exchanging sensitive information. + #[serde(skip_serializing_if = "Option::is_none")] + pub nonce: Option<&'a str>, + /// The ID of the Identity VerificationSession you'd like to access using the resulting ephemeral key + #[serde(skip_serializing_if = "Option::is_none")] + pub verification_session: Option<&'a str>, +} +impl<'a> CreateEphemeralKey<'a> { + pub fn new() -> Self { + Self::default() + } +} +impl<'a> CreateEphemeralKey<'a> { + /// Creates a short-lived API key for a given resource. + pub fn send(&self, client: &stripe::Client) -> stripe::Response { + client.send_form("/ephemeral_keys", self, http_types::Method::Post) + } +} diff --git a/generated/stripe_misc/src/ephemeral_key/types.rs b/generated/stripe_misc/src/ephemeral_key/types.rs new file mode 100644 index 000000000..524bd3190 --- /dev/null +++ b/generated/stripe_misc/src/ephemeral_key/types.rs @@ -0,0 +1,21 @@ +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct EphemeralKey { + /// Time at which the object was created. Measured in seconds since the Unix epoch. + pub created: stripe_types::Timestamp, + /// Time at which the key will expire. Measured in seconds since the Unix epoch. + pub expires: stripe_types::Timestamp, + /// Unique identifier for the object. + pub id: stripe_misc::EphemeralKeyId, + /// Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + pub livemode: bool, + /// The key's secret. You can use this value to make authorized requests to the Stripe API. + #[serde(skip_serializing_if = "Option::is_none")] + pub secret: Option, +} +impl stripe_types::Object for EphemeralKey { + type Id = stripe_misc::EphemeralKeyId; + fn id(&self) -> &Self::Id { + &self.id + } +} +stripe_types::def_id!(EphemeralKeyId, "ephkey_"); diff --git a/generated/stripe_misc/src/exchange_rate/mod.rs b/generated/stripe_misc/src/exchange_rate/mod.rs new file mode 100644 index 000000000..09087c417 --- /dev/null +++ b/generated/stripe_misc/src/exchange_rate/mod.rs @@ -0,0 +1,5 @@ +#[cfg(feature = "exchange_rate")] +mod requests; +pub(crate) mod types; +#[cfg(feature = "exchange_rate")] +pub use requests::*; diff --git a/generated/stripe_misc/src/exchange_rate/requests.rs b/generated/stripe_misc/src/exchange_rate/requests.rs new file mode 100644 index 000000000..3b7ddffe3 --- /dev/null +++ b/generated/stripe_misc/src/exchange_rate/requests.rs @@ -0,0 +1,59 @@ +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct ListExchangeRate<'a> { + /// A cursor for use in pagination. + /// `ending_before` is the currency that defines your place in the list. + /// For instance, if you make a list request and receive 100 objects, starting with the exchange rate for currency X your subsequent call can include `ending_before=obj_bar` in order to fetch the previous page of the list. + #[serde(skip_serializing_if = "Option::is_none")] + pub ending_before: Option<&'a str>, + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, + /// A limit on the number of objects to be returned. + /// Limit can range between 1 and total number of supported payout currencies, and the default is the max. + #[serde(skip_serializing_if = "Option::is_none")] + pub limit: Option, + /// A cursor for use in pagination. + /// `starting_after` is the currency that defines your place in the list. + /// For instance, if you make a list request and receive 100 objects, ending with the exchange rate for currency X, your subsequent call can include `starting_after=X` in order to fetch the next page of the list. + #[serde(skip_serializing_if = "Option::is_none")] + pub starting_after: Option<&'a str>, +} +impl<'a> ListExchangeRate<'a> { + pub fn new() -> Self { + Self::default() + } +} +impl<'a> ListExchangeRate<'a> { + /// Returns a list of objects that contain the rates at which foreign currencies are converted to one another. + /// Only shows the currencies for which Stripe supports. + pub fn send( + &self, + client: &stripe::Client, + ) -> stripe::Response> { + client.get_query("/exchange_rates", self) + } + pub fn paginate(self) -> stripe::ListPaginator> { + stripe::ListPaginator::from_list_params("/exchange_rates", self) + } +} +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct RetrieveExchangeRate<'a> { + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, +} +impl<'a> RetrieveExchangeRate<'a> { + pub fn new() -> Self { + Self::default() + } +} +impl<'a> RetrieveExchangeRate<'a> { + /// Retrieves the exchange rates from the given currency to every supported currency. + pub fn send( + &self, + client: &stripe::Client, + rate_id: &stripe_misc::ExchangeRateId, + ) -> stripe::Response { + client.get_query(&format!("/exchange_rates/{rate_id}"), self) + } +} diff --git a/generated/stripe_misc/src/exchange_rate/types.rs b/generated/stripe_misc/src/exchange_rate/types.rs new file mode 100644 index 000000000..1d6b8a176 --- /dev/null +++ b/generated/stripe_misc/src/exchange_rate/types.rs @@ -0,0 +1,43 @@ +/// `ExchangeRate` objects allow you to determine the rates that Stripe is currently +/// using to convert from one currency to another. Since this number is variable +/// throughout the day, there are various reasons why you might want to know the current +/// rate (for example, to dynamically price an item for a user with a default +/// payment in a foreign currency). +/// +/// Please refer to our [Exchange Rates API](https://stripe.com/docs/fx-rates) guide for more details. +/// +/// *[Note: this integration path is supported but no longer recommended]* Additionally, +/// you can guarantee that a charge is made with an exchange rate that you expect is +/// current. To do so, you must pass in the exchange_rate to charges endpoints. If the +/// value is no longer up to date, the charge won't go through. Please refer to our +/// [Using with charges](https://stripe.com/docs/exchange-rates) guide for more details. +/// +/// ----- +/// +///   +/// +/// *This Exchange Rates API is a Beta Service and is subject to Stripe's terms of service. +/// You may use the API solely for the purpose of transacting on Stripe. +/// For example, the API may be queried in order to:*. +/// +/// - *localize prices for processing payments on Stripe* +/// - *reconcile Stripe transactions* +/// - *determine how much money to send to a connected account* +/// - *determine app fees to charge a connected account* +/// +/// *Using this Exchange Rates API beta for any purpose other than to transact on Stripe is strictly prohibited and constitutes a violation of Stripe's terms of service.*. +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct ExchangeRate { + /// Unique identifier for the object. + /// Represented as the three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html) in lowercase. + pub id: stripe_misc::ExchangeRateId, + /// Hash where the keys are supported currencies and the values are the exchange rate at which the base id currency converts to the key currency. + pub rates: std::collections::HashMap, +} +impl stripe_types::Object for ExchangeRate { + type Id = stripe_misc::ExchangeRateId; + fn id(&self) -> &Self::Id { + &self.id + } +} +stripe_types::def_id!(ExchangeRateId); diff --git a/generated/stripe_misc/src/financial_connections_account/mod.rs b/generated/stripe_misc/src/financial_connections_account/mod.rs new file mode 100644 index 000000000..a948921c4 --- /dev/null +++ b/generated/stripe_misc/src/financial_connections_account/mod.rs @@ -0,0 +1,5 @@ +#[cfg(feature = "financial_connections_account")] +mod requests; +pub(crate) mod types; +#[cfg(feature = "financial_connections_account")] +pub use requests::*; diff --git a/generated/stripe_misc/src/financial_connections_account/requests.rs b/generated/stripe_misc/src/financial_connections_account/requests.rs new file mode 100644 index 000000000..e17232df1 --- /dev/null +++ b/generated/stripe_misc/src/financial_connections_account/requests.rs @@ -0,0 +1,373 @@ +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct ListFinancialConnectionsAccount<'a> { + /// If present, only return accounts that belong to the specified account holder. + /// `account_holder[customer]` and `account_holder[account]` are mutually exclusive. + #[serde(skip_serializing_if = "Option::is_none")] + pub account_holder: Option>, + /// A cursor for use in pagination. + /// `ending_before` is an object ID that defines your place in the list. + /// For instance, if you make a list request and receive 100 objects, starting with `obj_bar`, your subsequent call can include `ending_before=obj_bar` in order to fetch the previous page of the list. + #[serde(skip_serializing_if = "Option::is_none")] + pub ending_before: Option<&'a str>, + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, + /// A limit on the number of objects to be returned. + /// Limit can range between 1 and 100, and the default is 10. + #[serde(skip_serializing_if = "Option::is_none")] + pub limit: Option, + /// If present, only return accounts that were collected as part of the given session. + #[serde(skip_serializing_if = "Option::is_none")] + pub session: Option<&'a str>, + /// A cursor for use in pagination. + /// `starting_after` is an object ID that defines your place in the list. + /// For instance, if you make a list request and receive 100 objects, ending with `obj_foo`, your subsequent call can include `starting_after=obj_foo` in order to fetch the next page of the list. + #[serde(skip_serializing_if = "Option::is_none")] + pub starting_after: Option<&'a str>, +} +impl<'a> ListFinancialConnectionsAccount<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// If present, only return accounts that belong to the specified account holder. +/// `account_holder[customer]` and `account_holder[account]` are mutually exclusive. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct ListFinancialConnectionsAccountAccountHolder<'a> { + /// The ID of the Stripe account whose accounts will be retrieved. + #[serde(skip_serializing_if = "Option::is_none")] + pub account: Option<&'a str>, + /// The ID of the Stripe customer whose accounts will be retrieved. + #[serde(skip_serializing_if = "Option::is_none")] + pub customer: Option<&'a str>, +} +impl<'a> ListFinancialConnectionsAccountAccountHolder<'a> { + pub fn new() -> Self { + Self::default() + } +} +impl<'a> ListFinancialConnectionsAccount<'a> { + /// Returns a list of Financial Connections `Account` objects. + pub fn send( + &self, + client: &stripe::Client, + ) -> stripe::Response> { + client.get_query("/financial_connections/accounts", self) + } + pub fn paginate( + self, + ) -> stripe::ListPaginator> { + stripe::ListPaginator::from_list_params("/financial_connections/accounts", self) + } +} +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct RetrieveFinancialConnectionsAccount<'a> { + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, +} +impl<'a> RetrieveFinancialConnectionsAccount<'a> { + pub fn new() -> Self { + Self::default() + } +} +impl<'a> RetrieveFinancialConnectionsAccount<'a> { + /// Retrieves the details of an Financial Connections `Account`. + pub fn send( + &self, + client: &stripe::Client, + account: &stripe_misc::FinancialConnectionsAccountId, + ) -> stripe::Response { + client.get_query(&format!("/financial_connections/accounts/{account}"), self) + } +} +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct ListOwnersFinancialConnectionsAccount<'a> { + /// A cursor for use in pagination. + /// `ending_before` is an object ID that defines your place in the list. + /// For instance, if you make a list request and receive 100 objects, starting with `obj_bar`, your subsequent call can include `ending_before=obj_bar` in order to fetch the previous page of the list. + #[serde(skip_serializing_if = "Option::is_none")] + pub ending_before: Option<&'a str>, + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, + /// A limit on the number of objects to be returned. + /// Limit can range between 1 and 100, and the default is 10. + #[serde(skip_serializing_if = "Option::is_none")] + pub limit: Option, + /// The ID of the ownership object to fetch owners from. + pub ownership: &'a str, + /// A cursor for use in pagination. + /// `starting_after` is an object ID that defines your place in the list. + /// For instance, if you make a list request and receive 100 objects, ending with `obj_foo`, your subsequent call can include `starting_after=obj_foo` in order to fetch the next page of the list. + #[serde(skip_serializing_if = "Option::is_none")] + pub starting_after: Option<&'a str>, +} +impl<'a> ListOwnersFinancialConnectionsAccount<'a> { + pub fn new(ownership: &'a str) -> Self { + Self { ending_before: None, expand: None, limit: None, ownership, starting_after: None } + } +} +impl<'a> ListOwnersFinancialConnectionsAccount<'a> { + /// Lists all owners for a given `Account` + pub fn send( + &self, + client: &stripe::Client, + account: &stripe_misc::FinancialConnectionsAccountId, + ) -> stripe::Response> { + client.get_query(&format!("/financial_connections/accounts/{account}/owners"), self) + } + pub fn paginate( + self, + account: &stripe_misc::FinancialConnectionsAccountId, + ) -> stripe::ListPaginator> + { + stripe::ListPaginator::from_list_params( + &format!("/financial_connections/accounts/{account}/owners"), + self, + ) + } +} +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct DisconnectFinancialConnectionsAccount<'a> { + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, +} +impl<'a> DisconnectFinancialConnectionsAccount<'a> { + pub fn new() -> Self { + Self::default() + } +} +impl<'a> DisconnectFinancialConnectionsAccount<'a> { + /// Disables your access to a Financial Connections `Account`. + /// You will no longer be able to access data associated with the account (e.g. + /// balances, transactions). + pub fn send( + &self, + client: &stripe::Client, + account: &stripe_misc::FinancialConnectionsAccountId, + ) -> stripe::Response { + client.send_form( + &format!("/financial_connections/accounts/{account}/disconnect"), + self, + http_types::Method::Post, + ) + } +} +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct RefreshFinancialConnectionsAccount<'a> { + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, + /// The list of account features that you would like to refresh. + pub features: &'a [RefreshFinancialConnectionsAccountFeatures], +} +impl<'a> RefreshFinancialConnectionsAccount<'a> { + pub fn new(features: &'a [RefreshFinancialConnectionsAccountFeatures]) -> Self { + Self { expand: None, features } + } +} +/// The list of account features that you would like to refresh. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum RefreshFinancialConnectionsAccountFeatures { + Balance, + Ownership, + Transactions, +} +impl RefreshFinancialConnectionsAccountFeatures { + pub fn as_str(self) -> &'static str { + use RefreshFinancialConnectionsAccountFeatures::*; + match self { + Balance => "balance", + Ownership => "ownership", + Transactions => "transactions", + } + } +} + +impl std::str::FromStr for RefreshFinancialConnectionsAccountFeatures { + type Err = (); + fn from_str(s: &str) -> Result { + use RefreshFinancialConnectionsAccountFeatures::*; + match s { + "balance" => Ok(Balance), + "ownership" => Ok(Ownership), + "transactions" => Ok(Transactions), + _ => Err(()), + } + } +} +impl std::fmt::Display for RefreshFinancialConnectionsAccountFeatures { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for RefreshFinancialConnectionsAccountFeatures { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for RefreshFinancialConnectionsAccountFeatures { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'a> RefreshFinancialConnectionsAccount<'a> { + /// Refreshes the data associated with a Financial Connections `Account`. + pub fn send( + &self, + client: &stripe::Client, + account: &stripe_misc::FinancialConnectionsAccountId, + ) -> stripe::Response { + client.send_form( + &format!("/financial_connections/accounts/{account}/refresh"), + self, + http_types::Method::Post, + ) + } +} +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct SubscribeFinancialConnectionsAccount<'a> { + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, + /// The list of account features to which you would like to subscribe. + pub features: &'a [SubscribeFinancialConnectionsAccountFeatures], +} +impl<'a> SubscribeFinancialConnectionsAccount<'a> { + pub fn new(features: &'a [SubscribeFinancialConnectionsAccountFeatures]) -> Self { + Self { expand: None, features } + } +} +/// The list of account features to which you would like to subscribe. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum SubscribeFinancialConnectionsAccountFeatures { + Transactions, +} +impl SubscribeFinancialConnectionsAccountFeatures { + pub fn as_str(self) -> &'static str { + use SubscribeFinancialConnectionsAccountFeatures::*; + match self { + Transactions => "transactions", + } + } +} + +impl std::str::FromStr for SubscribeFinancialConnectionsAccountFeatures { + type Err = (); + fn from_str(s: &str) -> Result { + use SubscribeFinancialConnectionsAccountFeatures::*; + match s { + "transactions" => Ok(Transactions), + _ => Err(()), + } + } +} +impl std::fmt::Display for SubscribeFinancialConnectionsAccountFeatures { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for SubscribeFinancialConnectionsAccountFeatures { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for SubscribeFinancialConnectionsAccountFeatures { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'a> SubscribeFinancialConnectionsAccount<'a> { + /// Subscribes to periodic refreshes of data associated with a Financial Connections `Account`. + pub fn send( + &self, + client: &stripe::Client, + account: &stripe_misc::FinancialConnectionsAccountId, + ) -> stripe::Response { + client.send_form( + &format!("/financial_connections/accounts/{account}/subscribe"), + self, + http_types::Method::Post, + ) + } +} +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct UnsubscribeFinancialConnectionsAccount<'a> { + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, + /// The list of account features from which you would like to unsubscribe. + pub features: &'a [UnsubscribeFinancialConnectionsAccountFeatures], +} +impl<'a> UnsubscribeFinancialConnectionsAccount<'a> { + pub fn new(features: &'a [UnsubscribeFinancialConnectionsAccountFeatures]) -> Self { + Self { expand: None, features } + } +} +/// The list of account features from which you would like to unsubscribe. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum UnsubscribeFinancialConnectionsAccountFeatures { + Transactions, +} +impl UnsubscribeFinancialConnectionsAccountFeatures { + pub fn as_str(self) -> &'static str { + use UnsubscribeFinancialConnectionsAccountFeatures::*; + match self { + Transactions => "transactions", + } + } +} + +impl std::str::FromStr for UnsubscribeFinancialConnectionsAccountFeatures { + type Err = (); + fn from_str(s: &str) -> Result { + use UnsubscribeFinancialConnectionsAccountFeatures::*; + match s { + "transactions" => Ok(Transactions), + _ => Err(()), + } + } +} +impl std::fmt::Display for UnsubscribeFinancialConnectionsAccountFeatures { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for UnsubscribeFinancialConnectionsAccountFeatures { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for UnsubscribeFinancialConnectionsAccountFeatures { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'a> UnsubscribeFinancialConnectionsAccount<'a> { + /// Unsubscribes from periodic refreshes of data associated with a Financial Connections `Account`. + pub fn send( + &self, + client: &stripe::Client, + account: &stripe_misc::FinancialConnectionsAccountId, + ) -> stripe::Response { + client.send_form( + &format!("/financial_connections/accounts/{account}/unsubscribe"), + self, + http_types::Method::Post, + ) + } +} diff --git a/generated/stripe_misc/src/financial_connections_account/types.rs b/generated/stripe_misc/src/financial_connections_account/types.rs new file mode 100644 index 000000000..c1751e37f --- /dev/null +++ b/generated/stripe_misc/src/financial_connections_account/types.rs @@ -0,0 +1,432 @@ +/// A Financial Connections Account represents an account that exists outside of Stripe, to which you have been granted some degree of access. +/// +/// For more details see <>. +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct FinancialConnectionsAccount { + /// The account holder that this account belongs to. + pub account_holder: Option, + /// The most recent information about the account's balance. + pub balance: Option, + /// The state of the most recent attempt to refresh the account balance. + pub balance_refresh: Option, + /// The type of the account. Account category is further divided in `subcategory`. + pub category: FinancialConnectionsAccountCategory, + /// Time at which the object was created. Measured in seconds since the Unix epoch. + pub created: stripe_types::Timestamp, + /// A human-readable name that has been assigned to this account, either by the account holder or by the institution. + pub display_name: Option, + /// Unique identifier for the object. + pub id: stripe_misc::FinancialConnectionsAccountId, + /// The name of the institution that holds this account. + pub institution_name: String, + /// The last 4 digits of the account number. If present, this will be 4 numeric characters. + pub last4: Option, + /// Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + pub livemode: bool, + /// The most recent information about the account's owners. + pub ownership: + Option>, + /// The state of the most recent attempt to refresh the account owners. + pub ownership_refresh: Option, + /// The list of permissions granted by this account. + pub permissions: Option>, + /// The status of the link to the account. + pub status: FinancialConnectionsAccountStatus, + /// If `category` is `cash`, one of: + /// + /// - `checking` + /// - `savings` + /// - `other` + /// + /// If `category` is `credit`, one of: + /// + /// - `mortgage` + /// - `line_of_credit` + /// - `credit_card` + /// - `other` + /// + /// If `category` is `investment` or `other`, this will be `other`. + pub subcategory: FinancialConnectionsAccountSubcategory, + /// The list of data refresh subscriptions requested on this account. + pub subscriptions: Option>, + /// The [PaymentMethod type](https://stripe.com/docs/api/payment_methods/object#payment_method_object-type)(s) that can be created from this account. + pub supported_payment_method_types: Vec, + /// The state of the most recent attempt to refresh the account transactions. + pub transaction_refresh: Option, +} +/// The type of the account. Account category is further divided in `subcategory`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum FinancialConnectionsAccountCategory { + Cash, + Credit, + Investment, + Other, +} +impl FinancialConnectionsAccountCategory { + pub fn as_str(self) -> &'static str { + use FinancialConnectionsAccountCategory::*; + match self { + Cash => "cash", + Credit => "credit", + Investment => "investment", + Other => "other", + } + } +} + +impl std::str::FromStr for FinancialConnectionsAccountCategory { + type Err = (); + fn from_str(s: &str) -> Result { + use FinancialConnectionsAccountCategory::*; + match s { + "cash" => Ok(Cash), + "credit" => Ok(Credit), + "investment" => Ok(Investment), + "other" => Ok(Other), + _ => Err(()), + } + } +} +impl std::fmt::Display for FinancialConnectionsAccountCategory { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for FinancialConnectionsAccountCategory { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for FinancialConnectionsAccountCategory { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for FinancialConnectionsAccountCategory { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| { + serde::de::Error::custom("Unknown value for FinancialConnectionsAccountCategory") + }) + } +} +/// The list of permissions granted by this account. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum FinancialConnectionsAccountPermissions { + Balances, + Ownership, + PaymentMethod, + Transactions, +} +impl FinancialConnectionsAccountPermissions { + pub fn as_str(self) -> &'static str { + use FinancialConnectionsAccountPermissions::*; + match self { + Balances => "balances", + Ownership => "ownership", + PaymentMethod => "payment_method", + Transactions => "transactions", + } + } +} + +impl std::str::FromStr for FinancialConnectionsAccountPermissions { + type Err = (); + fn from_str(s: &str) -> Result { + use FinancialConnectionsAccountPermissions::*; + match s { + "balances" => Ok(Balances), + "ownership" => Ok(Ownership), + "payment_method" => Ok(PaymentMethod), + "transactions" => Ok(Transactions), + _ => Err(()), + } + } +} +impl std::fmt::Display for FinancialConnectionsAccountPermissions { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for FinancialConnectionsAccountPermissions { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for FinancialConnectionsAccountPermissions { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for FinancialConnectionsAccountPermissions { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| { + serde::de::Error::custom("Unknown value for FinancialConnectionsAccountPermissions") + }) + } +} +/// The status of the link to the account. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum FinancialConnectionsAccountStatus { + Active, + Disconnected, + Inactive, +} +impl FinancialConnectionsAccountStatus { + pub fn as_str(self) -> &'static str { + use FinancialConnectionsAccountStatus::*; + match self { + Active => "active", + Disconnected => "disconnected", + Inactive => "inactive", + } + } +} + +impl std::str::FromStr for FinancialConnectionsAccountStatus { + type Err = (); + fn from_str(s: &str) -> Result { + use FinancialConnectionsAccountStatus::*; + match s { + "active" => Ok(Active), + "disconnected" => Ok(Disconnected), + "inactive" => Ok(Inactive), + _ => Err(()), + } + } +} +impl std::fmt::Display for FinancialConnectionsAccountStatus { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for FinancialConnectionsAccountStatus { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for FinancialConnectionsAccountStatus { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for FinancialConnectionsAccountStatus { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| { + serde::de::Error::custom("Unknown value for FinancialConnectionsAccountStatus") + }) + } +} +/// If `category` is `cash`, one of: +/// +/// - `checking` +/// - `savings` +/// - `other` +/// +/// If `category` is `credit`, one of: +/// +/// - `mortgage` +/// - `line_of_credit` +/// - `credit_card` +/// - `other` +/// +/// If `category` is `investment` or `other`, this will be `other`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum FinancialConnectionsAccountSubcategory { + Checking, + CreditCard, + LineOfCredit, + Mortgage, + Other, + Savings, +} +impl FinancialConnectionsAccountSubcategory { + pub fn as_str(self) -> &'static str { + use FinancialConnectionsAccountSubcategory::*; + match self { + Checking => "checking", + CreditCard => "credit_card", + LineOfCredit => "line_of_credit", + Mortgage => "mortgage", + Other => "other", + Savings => "savings", + } + } +} + +impl std::str::FromStr for FinancialConnectionsAccountSubcategory { + type Err = (); + fn from_str(s: &str) -> Result { + use FinancialConnectionsAccountSubcategory::*; + match s { + "checking" => Ok(Checking), + "credit_card" => Ok(CreditCard), + "line_of_credit" => Ok(LineOfCredit), + "mortgage" => Ok(Mortgage), + "other" => Ok(Other), + "savings" => Ok(Savings), + _ => Err(()), + } + } +} +impl std::fmt::Display for FinancialConnectionsAccountSubcategory { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for FinancialConnectionsAccountSubcategory { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for FinancialConnectionsAccountSubcategory { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for FinancialConnectionsAccountSubcategory { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| { + serde::de::Error::custom("Unknown value for FinancialConnectionsAccountSubcategory") + }) + } +} +/// The list of data refresh subscriptions requested on this account. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum FinancialConnectionsAccountSubscriptions { + Transactions, +} +impl FinancialConnectionsAccountSubscriptions { + pub fn as_str(self) -> &'static str { + use FinancialConnectionsAccountSubscriptions::*; + match self { + Transactions => "transactions", + } + } +} + +impl std::str::FromStr for FinancialConnectionsAccountSubscriptions { + type Err = (); + fn from_str(s: &str) -> Result { + use FinancialConnectionsAccountSubscriptions::*; + match s { + "transactions" => Ok(Transactions), + _ => Err(()), + } + } +} +impl std::fmt::Display for FinancialConnectionsAccountSubscriptions { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for FinancialConnectionsAccountSubscriptions { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for FinancialConnectionsAccountSubscriptions { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for FinancialConnectionsAccountSubscriptions { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| { + serde::de::Error::custom("Unknown value for FinancialConnectionsAccountSubscriptions") + }) + } +} +/// The [PaymentMethod type](https://stripe.com/docs/api/payment_methods/object#payment_method_object-type)(s) that can be created from this account. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum FinancialConnectionsAccountSupportedPaymentMethodTypes { + Link, + UsBankAccount, +} +impl FinancialConnectionsAccountSupportedPaymentMethodTypes { + pub fn as_str(self) -> &'static str { + use FinancialConnectionsAccountSupportedPaymentMethodTypes::*; + match self { + Link => "link", + UsBankAccount => "us_bank_account", + } + } +} + +impl std::str::FromStr for FinancialConnectionsAccountSupportedPaymentMethodTypes { + type Err = (); + fn from_str(s: &str) -> Result { + use FinancialConnectionsAccountSupportedPaymentMethodTypes::*; + match s { + "link" => Ok(Link), + "us_bank_account" => Ok(UsBankAccount), + _ => Err(()), + } + } +} +impl std::fmt::Display for FinancialConnectionsAccountSupportedPaymentMethodTypes { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for FinancialConnectionsAccountSupportedPaymentMethodTypes { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for FinancialConnectionsAccountSupportedPaymentMethodTypes { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for FinancialConnectionsAccountSupportedPaymentMethodTypes { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| { + serde::de::Error::custom( + "Unknown value for FinancialConnectionsAccountSupportedPaymentMethodTypes", + ) + }) + } +} +impl stripe_types::Object for FinancialConnectionsAccount { + type Id = stripe_misc::FinancialConnectionsAccountId; + fn id(&self) -> &Self::Id { + &self.id + } +} +stripe_types::def_id!(FinancialConnectionsAccountId); diff --git a/generated/stripe_misc/src/financial_connections_account_owner.rs b/generated/stripe_misc/src/financial_connections_account_owner.rs new file mode 100644 index 000000000..02630032d --- /dev/null +++ b/generated/stripe_misc/src/financial_connections_account_owner.rs @@ -0,0 +1,25 @@ +/// Describes an owner of an account. +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct FinancialConnectionsAccountOwner { + /// The email address of the owner. + pub email: Option, + /// Unique identifier for the object. + pub id: stripe_misc::FinancialConnectionsAccountOwnerId, + /// The full name of the owner. + pub name: String, + /// The ownership object that this owner belongs to. + pub ownership: String, + /// The raw phone number of the owner. + pub phone: Option, + /// The raw physical address of the owner. + pub raw_address: Option, + /// The timestamp of the refresh that updated this owner. + pub refreshed_at: Option, +} +impl stripe_types::Object for FinancialConnectionsAccountOwner { + type Id = stripe_misc::FinancialConnectionsAccountOwnerId; + fn id(&self) -> &Self::Id { + &self.id + } +} +stripe_types::def_id!(FinancialConnectionsAccountOwnerId); diff --git a/generated/stripe_misc/src/financial_connections_account_ownership.rs b/generated/stripe_misc/src/financial_connections_account_ownership.rs new file mode 100644 index 000000000..82417f791 --- /dev/null +++ b/generated/stripe_misc/src/financial_connections_account_ownership.rs @@ -0,0 +1,17 @@ +/// Describes a snapshot of the owners of an account at a particular point in time. +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct FinancialConnectionsAccountOwnership { + /// Time at which the object was created. Measured in seconds since the Unix epoch. + pub created: stripe_types::Timestamp, + /// Unique identifier for the object. + pub id: stripe_misc::FinancialConnectionsAccountOwnershipId, + /// A paginated list of owners for this account. + pub owners: stripe_types::List, +} +impl stripe_types::Object for FinancialConnectionsAccountOwnership { + type Id = stripe_misc::FinancialConnectionsAccountOwnershipId; + fn id(&self) -> &Self::Id { + &self.id + } +} +stripe_types::def_id!(FinancialConnectionsAccountOwnershipId); diff --git a/generated/stripe_misc/src/financial_connections_session/mod.rs b/generated/stripe_misc/src/financial_connections_session/mod.rs new file mode 100644 index 000000000..6ea2f483a --- /dev/null +++ b/generated/stripe_misc/src/financial_connections_session/mod.rs @@ -0,0 +1,5 @@ +#[cfg(feature = "financial_connections_session")] +mod requests; +pub(crate) mod types; +#[cfg(feature = "financial_connections_session")] +pub use requests::*; diff --git a/generated/stripe_misc/src/financial_connections_session/requests.rs b/generated/stripe_misc/src/financial_connections_session/requests.rs new file mode 100644 index 000000000..d9cd397b3 --- /dev/null +++ b/generated/stripe_misc/src/financial_connections_session/requests.rs @@ -0,0 +1,145 @@ +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct RetrieveFinancialConnectionsSession<'a> { + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, +} +impl<'a> RetrieveFinancialConnectionsSession<'a> { + pub fn new() -> Self { + Self::default() + } +} +impl<'a> RetrieveFinancialConnectionsSession<'a> { + /// Retrieves the details of a Financial Connections `Session` + pub fn send( + &self, + client: &stripe::Client, + session: &stripe_misc::FinancialConnectionsSessionId, + ) -> stripe::Response { + client.get_query(&format!("/financial_connections/sessions/{session}"), self) + } +} +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreateFinancialConnectionsSession<'a> { + /// The account holder to link accounts for. + pub account_holder: CreateFinancialConnectionsSessionAccountHolder<'a>, + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, + /// Filters to restrict the kinds of accounts to collect. + #[serde(skip_serializing_if = "Option::is_none")] + pub filters: Option>, + /// List of data features that you would like to request access to. + /// + /// Possible values are `balances`, `transactions`, `ownership`, and `payment_method`. + pub permissions: &'a [stripe_misc::FinancialConnectionsSessionPermissions], + /// List of data features that you would like to retrieve upon account creation. + #[serde(skip_serializing_if = "Option::is_none")] + pub prefetch: Option<&'a [stripe_misc::FinancialConnectionsSessionPrefetch]>, + /// For webview integrations only. + /// Upon completing OAuth login in the native browser, the user will be redirected to this URL to return to your app. + #[serde(skip_serializing_if = "Option::is_none")] + pub return_url: Option<&'a str>, +} +impl<'a> CreateFinancialConnectionsSession<'a> { + pub fn new( + account_holder: CreateFinancialConnectionsSessionAccountHolder<'a>, + permissions: &'a [stripe_misc::FinancialConnectionsSessionPermissions], + ) -> Self { + Self { + account_holder, + expand: None, + filters: None, + permissions, + prefetch: None, + return_url: None, + } + } +} +/// The account holder to link accounts for. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreateFinancialConnectionsSessionAccountHolder<'a> { + /// The ID of the Stripe account whose accounts will be retrieved. + /// Should only be present if `type` is `account`. + #[serde(skip_serializing_if = "Option::is_none")] + pub account: Option<&'a str>, + /// The ID of the Stripe customer whose accounts will be retrieved. + /// Should only be present if `type` is `customer`. + #[serde(skip_serializing_if = "Option::is_none")] + pub customer: Option<&'a str>, + /// Type of account holder to collect accounts for. + #[serde(rename = "type")] + pub type_: CreateFinancialConnectionsSessionAccountHolderType, +} +impl<'a> CreateFinancialConnectionsSessionAccountHolder<'a> { + pub fn new(type_: CreateFinancialConnectionsSessionAccountHolderType) -> Self { + Self { account: None, customer: None, type_ } + } +} +/// Type of account holder to collect accounts for. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreateFinancialConnectionsSessionAccountHolderType { + Account, + Customer, +} +impl CreateFinancialConnectionsSessionAccountHolderType { + pub fn as_str(self) -> &'static str { + use CreateFinancialConnectionsSessionAccountHolderType::*; + match self { + Account => "account", + Customer => "customer", + } + } +} + +impl std::str::FromStr for CreateFinancialConnectionsSessionAccountHolderType { + type Err = (); + fn from_str(s: &str) -> Result { + use CreateFinancialConnectionsSessionAccountHolderType::*; + match s { + "account" => Ok(Account), + "customer" => Ok(Customer), + _ => Err(()), + } + } +} +impl std::fmt::Display for CreateFinancialConnectionsSessionAccountHolderType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreateFinancialConnectionsSessionAccountHolderType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreateFinancialConnectionsSessionAccountHolderType { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Filters to restrict the kinds of accounts to collect. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreateFinancialConnectionsSessionFilters<'a> { + /// List of countries from which to collect accounts. + pub countries: &'a [&'a str], +} +impl<'a> CreateFinancialConnectionsSessionFilters<'a> { + pub fn new(countries: &'a [&'a str]) -> Self { + Self { countries } + } +} +impl<'a> CreateFinancialConnectionsSession<'a> { + /// To launch the Financial Connections authorization flow, create a `Session`. + /// The session’s `client_secret` can be used to launch the flow using Stripe.js. + pub fn send( + &self, + client: &stripe::Client, + ) -> stripe::Response { + client.send_form("/financial_connections/sessions", self, http_types::Method::Post) + } +} diff --git a/generated/stripe_misc/src/financial_connections_session/types.rs b/generated/stripe_misc/src/financial_connections_session/types.rs new file mode 100644 index 000000000..9890e5288 --- /dev/null +++ b/generated/stripe_misc/src/financial_connections_session/types.rs @@ -0,0 +1,150 @@ +/// A Financial Connections Session is the secure way to programmatically launch the client-side Stripe.js modal that lets your users link their accounts. +/// +/// For more details see <>. +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct FinancialConnectionsSession { + /// The account holder for whom accounts are collected in this session. + pub account_holder: Option, + /// The accounts that were collected as part of this Session. + pub accounts: stripe_types::List, + /// A value that will be passed to the client to launch the authentication flow. + pub client_secret: String, + #[serde(skip_serializing_if = "Option::is_none")] + pub filters: Option, + /// Unique identifier for the object. + pub id: stripe_misc::FinancialConnectionsSessionId, + /// Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + pub livemode: bool, + /// Permissions requested for accounts collected during this session. + pub permissions: Vec, + /// Data features requested to be retrieved upon account creation. + pub prefetch: Option>, + /// For webview integrations only. + /// Upon completing OAuth login in the native browser, the user will be redirected to this URL to return to your app. + #[serde(skip_serializing_if = "Option::is_none")] + pub return_url: Option, +} +impl stripe_types::Object for FinancialConnectionsSession { + type Id = stripe_misc::FinancialConnectionsSessionId; + fn id(&self) -> &Self::Id { + &self.id + } +} +stripe_types::def_id!(FinancialConnectionsSessionId); +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum FinancialConnectionsSessionPermissions { + Balances, + Ownership, + PaymentMethod, + Transactions, +} +impl FinancialConnectionsSessionPermissions { + pub fn as_str(self) -> &'static str { + use FinancialConnectionsSessionPermissions::*; + match self { + Balances => "balances", + Ownership => "ownership", + PaymentMethod => "payment_method", + Transactions => "transactions", + } + } +} + +impl std::str::FromStr for FinancialConnectionsSessionPermissions { + type Err = (); + fn from_str(s: &str) -> Result { + use FinancialConnectionsSessionPermissions::*; + match s { + "balances" => Ok(Balances), + "ownership" => Ok(Ownership), + "payment_method" => Ok(PaymentMethod), + "transactions" => Ok(Transactions), + _ => Err(()), + } + } +} +impl std::fmt::Display for FinancialConnectionsSessionPermissions { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for FinancialConnectionsSessionPermissions { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for FinancialConnectionsSessionPermissions { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for FinancialConnectionsSessionPermissions { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| { + serde::de::Error::custom("Unknown value for FinancialConnectionsSessionPermissions") + }) + } +} +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum FinancialConnectionsSessionPrefetch { + Balances, + Ownership, + Transactions, +} +impl FinancialConnectionsSessionPrefetch { + pub fn as_str(self) -> &'static str { + use FinancialConnectionsSessionPrefetch::*; + match self { + Balances => "balances", + Ownership => "ownership", + Transactions => "transactions", + } + } +} + +impl std::str::FromStr for FinancialConnectionsSessionPrefetch { + type Err = (); + fn from_str(s: &str) -> Result { + use FinancialConnectionsSessionPrefetch::*; + match s { + "balances" => Ok(Balances), + "ownership" => Ok(Ownership), + "transactions" => Ok(Transactions), + _ => Err(()), + } + } +} +impl std::fmt::Display for FinancialConnectionsSessionPrefetch { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for FinancialConnectionsSessionPrefetch { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for FinancialConnectionsSessionPrefetch { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for FinancialConnectionsSessionPrefetch { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| { + serde::de::Error::custom("Unknown value for FinancialConnectionsSessionPrefetch") + }) + } +} diff --git a/generated/stripe_misc/src/financial_connections_transaction/mod.rs b/generated/stripe_misc/src/financial_connections_transaction/mod.rs new file mode 100644 index 000000000..eb10ac40c --- /dev/null +++ b/generated/stripe_misc/src/financial_connections_transaction/mod.rs @@ -0,0 +1,5 @@ +#[cfg(feature = "financial_connections_transaction")] +mod requests; +pub(crate) mod types; +#[cfg(feature = "financial_connections_transaction")] +pub use requests::*; diff --git a/generated/stripe_misc/src/financial_connections_transaction/requests.rs b/generated/stripe_misc/src/financial_connections_transaction/requests.rs new file mode 100644 index 000000000..ec05ca1d9 --- /dev/null +++ b/generated/stripe_misc/src/financial_connections_transaction/requests.rs @@ -0,0 +1,91 @@ +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct ListFinancialConnectionsTransaction<'a> { + /// The ID of the Stripe account whose transactions will be retrieved. + pub account: &'a str, + /// A cursor for use in pagination. + /// `ending_before` is an object ID that defines your place in the list. + /// For instance, if you make a list request and receive 100 objects, starting with `obj_bar`, your subsequent call can include `ending_before=obj_bar` in order to fetch the previous page of the list. + #[serde(skip_serializing_if = "Option::is_none")] + pub ending_before: Option<&'a str>, + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, + /// A limit on the number of objects to be returned. + /// Limit can range between 1 and 100, and the default is 10. + #[serde(skip_serializing_if = "Option::is_none")] + pub limit: Option, + /// A cursor for use in pagination. + /// `starting_after` is an object ID that defines your place in the list. + /// For instance, if you make a list request and receive 100 objects, ending with `obj_foo`, your subsequent call can include `starting_after=obj_foo` in order to fetch the next page of the list. + #[serde(skip_serializing_if = "Option::is_none")] + pub starting_after: Option<&'a str>, + /// A filter on the list based on the object `transacted_at` field. + /// The value can be a string with an integer Unix timestamp, or it can be a dictionary with the following options:. + #[serde(skip_serializing_if = "Option::is_none")] + pub transacted_at: Option, + /// A filter on the list based on the object `transaction_refresh` field. + /// The value can be a dictionary with the following options:. + #[serde(skip_serializing_if = "Option::is_none")] + pub transaction_refresh: Option>, +} +impl<'a> ListFinancialConnectionsTransaction<'a> { + pub fn new(account: &'a str) -> Self { + Self { + account, + ending_before: None, + expand: None, + limit: None, + starting_after: None, + transacted_at: None, + transaction_refresh: None, + } + } +} +/// A filter on the list based on the object `transaction_refresh` field. +/// The value can be a dictionary with the following options:. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct ListFinancialConnectionsTransactionTransactionRefresh<'a> { + /// Return results where the transactions were created or updated by a refresh that took place after this refresh (non-inclusive). + pub after: &'a str, +} +impl<'a> ListFinancialConnectionsTransactionTransactionRefresh<'a> { + pub fn new(after: &'a str) -> Self { + Self { after } + } +} +impl<'a> ListFinancialConnectionsTransaction<'a> { + /// Returns a list of Financial Connections `Transaction` objects. + pub fn send( + &self, + client: &stripe::Client, + ) -> stripe::Response> { + client.get_query("/financial_connections/transactions", self) + } + pub fn paginate( + self, + ) -> stripe::ListPaginator> + { + stripe::ListPaginator::from_list_params("/financial_connections/transactions", self) + } +} +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct RetrieveFinancialConnectionsTransaction<'a> { + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, +} +impl<'a> RetrieveFinancialConnectionsTransaction<'a> { + pub fn new() -> Self { + Self::default() + } +} +impl<'a> RetrieveFinancialConnectionsTransaction<'a> { + /// Retrieves the details of a Financial Connections `Transaction` + pub fn send( + &self, + client: &stripe::Client, + transaction: &stripe_misc::FinancialConnectionsTransactionId, + ) -> stripe::Response { + client.get_query(&format!("/financial_connections/transactions/{transaction}"), self) + } +} diff --git a/generated/stripe_misc/src/financial_connections_transaction/types.rs b/generated/stripe_misc/src/financial_connections_transaction/types.rs new file mode 100644 index 000000000..774426515 --- /dev/null +++ b/generated/stripe_misc/src/financial_connections_transaction/types.rs @@ -0,0 +1,92 @@ +/// A Transaction represents a real transaction that affects a Financial Connections Account balance. +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct FinancialConnectionsTransaction { + /// The ID of the Financial Connections Account this transaction belongs to. + pub account: String, + /// The amount of this transaction, in cents (or local equivalent). + pub amount: i64, + /// Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. + /// Must be a [supported currency](https://stripe.com/docs/currencies). + pub currency: stripe_types::Currency, + /// The description of this transaction. + pub description: String, + /// Unique identifier for the object. + pub id: stripe_misc::FinancialConnectionsTransactionId, + /// Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + pub livemode: bool, + /// The status of the transaction. + pub status: FinancialConnectionsTransactionStatus, + pub status_transitions: + stripe_misc::BankConnectionsResourceTransactionResourceStatusTransitions, + /// Time at which the transaction was transacted. Measured in seconds since the Unix epoch. + pub transacted_at: stripe_types::Timestamp, + /// The token of the transaction refresh that last updated or created this transaction. + pub transaction_refresh: String, + /// Time at which the object was last updated. Measured in seconds since the Unix epoch. + pub updated: stripe_types::Timestamp, +} +/// The status of the transaction. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum FinancialConnectionsTransactionStatus { + Pending, + Posted, + Void, +} +impl FinancialConnectionsTransactionStatus { + pub fn as_str(self) -> &'static str { + use FinancialConnectionsTransactionStatus::*; + match self { + Pending => "pending", + Posted => "posted", + Void => "void", + } + } +} + +impl std::str::FromStr for FinancialConnectionsTransactionStatus { + type Err = (); + fn from_str(s: &str) -> Result { + use FinancialConnectionsTransactionStatus::*; + match s { + "pending" => Ok(Pending), + "posted" => Ok(Posted), + "void" => Ok(Void), + _ => Err(()), + } + } +} +impl std::fmt::Display for FinancialConnectionsTransactionStatus { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for FinancialConnectionsTransactionStatus { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for FinancialConnectionsTransactionStatus { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for FinancialConnectionsTransactionStatus { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| { + serde::de::Error::custom("Unknown value for FinancialConnectionsTransactionStatus") + }) + } +} +impl stripe_types::Object for FinancialConnectionsTransaction { + type Id = stripe_misc::FinancialConnectionsTransactionId; + fn id(&self) -> &Self::Id { + &self.id + } +} +stripe_types::def_id!(FinancialConnectionsTransactionId); diff --git a/generated/stripe_misc/src/financial_reporting_finance_report_run_run_parameters.rs b/generated/stripe_misc/src/financial_reporting_finance_report_run_run_parameters.rs new file mode 100644 index 000000000..f4f1483b3 --- /dev/null +++ b/generated/stripe_misc/src/financial_reporting_finance_report_run_run_parameters.rs @@ -0,0 +1,32 @@ +#[derive(Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct FinancialReportingFinanceReportRunRunParameters { + /// The set of output columns requested for inclusion in the report run. + #[serde(skip_serializing_if = "Option::is_none")] + pub columns: Option>, + /// Connected account ID by which to filter the report run. + #[serde(skip_serializing_if = "Option::is_none")] + pub connected_account: Option, + /// Currency of objects to be included in the report run. + #[serde(skip_serializing_if = "Option::is_none")] + pub currency: Option, + /// Ending timestamp of data to be included in the report run. + /// Can be any UTC timestamp between 1 second after the user specified `interval_start` and 1 second before this report's last `data_available_end` value. + #[serde(skip_serializing_if = "Option::is_none")] + pub interval_end: Option, + /// Starting timestamp of data to be included in the report run. + /// Can be any UTC timestamp between 1 second after this report's `data_available_start` and 1 second before the user specified `interval_end` value. + #[serde(skip_serializing_if = "Option::is_none")] + pub interval_start: Option, + /// Payout ID by which to filter the report run. + #[serde(skip_serializing_if = "Option::is_none")] + pub payout: Option, + /// Category of balance transactions to be included in the report run. + #[serde(skip_serializing_if = "Option::is_none")] + pub reporting_category: Option, + /// Defaults to `Etc/UTC`. + /// The output timezone for all timestamps in the report. + /// A list of possible time zone values is maintained at the [IANA Time Zone Database](http://www.iana.org/time-zones). + /// Has no effect on `interval_start` or `interval_end`. + #[serde(skip_serializing_if = "Option::is_none")] + pub timezone: Option, +} diff --git a/generated/stripe_misc/src/gelato_data_document_report_date_of_birth.rs b/generated/stripe_misc/src/gelato_data_document_report_date_of_birth.rs new file mode 100644 index 000000000..340c8ae4b --- /dev/null +++ b/generated/stripe_misc/src/gelato_data_document_report_date_of_birth.rs @@ -0,0 +1,10 @@ +/// Point in Time +#[derive(Copy, Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct GelatoDataDocumentReportDateOfBirth { + /// Numerical day between 1 and 31. + pub day: Option, + /// Numerical month between 1 and 12. + pub month: Option, + /// The four-digit year. + pub year: Option, +} diff --git a/generated/stripe_misc/src/gelato_data_document_report_expiration_date.rs b/generated/stripe_misc/src/gelato_data_document_report_expiration_date.rs new file mode 100644 index 000000000..a30a7654a --- /dev/null +++ b/generated/stripe_misc/src/gelato_data_document_report_expiration_date.rs @@ -0,0 +1,10 @@ +/// Point in Time +#[derive(Copy, Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct GelatoDataDocumentReportExpirationDate { + /// Numerical day between 1 and 31. + pub day: Option, + /// Numerical month between 1 and 12. + pub month: Option, + /// The four-digit year. + pub year: Option, +} diff --git a/generated/stripe_misc/src/gelato_data_document_report_issued_date.rs b/generated/stripe_misc/src/gelato_data_document_report_issued_date.rs new file mode 100644 index 000000000..950ee2a7e --- /dev/null +++ b/generated/stripe_misc/src/gelato_data_document_report_issued_date.rs @@ -0,0 +1,10 @@ +/// Point in Time +#[derive(Copy, Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct GelatoDataDocumentReportIssuedDate { + /// Numerical day between 1 and 31. + pub day: Option, + /// Numerical month between 1 and 12. + pub month: Option, + /// The four-digit year. + pub year: Option, +} diff --git a/generated/stripe_misc/src/gelato_data_id_number_report_date.rs b/generated/stripe_misc/src/gelato_data_id_number_report_date.rs new file mode 100644 index 000000000..e7c4d2c8d --- /dev/null +++ b/generated/stripe_misc/src/gelato_data_id_number_report_date.rs @@ -0,0 +1,10 @@ +/// Point in Time +#[derive(Copy, Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct GelatoDataIdNumberReportDate { + /// Numerical day between 1 and 31. + pub day: Option, + /// Numerical month between 1 and 12. + pub month: Option, + /// The four-digit year. + pub year: Option, +} diff --git a/generated/stripe_misc/src/gelato_data_verified_outputs_date.rs b/generated/stripe_misc/src/gelato_data_verified_outputs_date.rs new file mode 100644 index 000000000..06b4a0298 --- /dev/null +++ b/generated/stripe_misc/src/gelato_data_verified_outputs_date.rs @@ -0,0 +1,10 @@ +/// Point in Time +#[derive(Copy, Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct GelatoDataVerifiedOutputsDate { + /// Numerical day between 1 and 31. + pub day: Option, + /// Numerical month between 1 and 12. + pub month: Option, + /// The four-digit year. + pub year: Option, +} diff --git a/generated/stripe_misc/src/gelato_document_report.rs b/generated/stripe_misc/src/gelato_document_report.rs new file mode 100644 index 000000000..f78555dfe --- /dev/null +++ b/generated/stripe_misc/src/gelato_document_report.rs @@ -0,0 +1,140 @@ +/// Result from a document check +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct GelatoDocumentReport { + /// Address as it appears in the document. + pub address: Option, + /// Date of birth as it appears in the document. + pub dob: Option, + /// Details on the verification error. Present when status is `unverified`. + pub error: Option, + /// Expiration date of the document. + pub expiration_date: Option, + /// Array of [File](https://stripe.com/docs/api/files) ids containing images for this document. + pub files: Option>, + /// First name as it appears in the document. + pub first_name: Option, + /// Issued date of the document. + pub issued_date: Option, + /// Issuing country of the document. + pub issuing_country: Option, + /// Last name as it appears in the document. + pub last_name: Option, + /// Document ID number. + pub number: Option, + /// Status of this `document` check. + pub status: GelatoDocumentReportStatus, + /// Type of the document. + #[serde(rename = "type")] + pub type_: Option, +} +/// Status of this `document` check. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum GelatoDocumentReportStatus { + Unverified, + Verified, +} +impl GelatoDocumentReportStatus { + pub fn as_str(self) -> &'static str { + use GelatoDocumentReportStatus::*; + match self { + Unverified => "unverified", + Verified => "verified", + } + } +} + +impl std::str::FromStr for GelatoDocumentReportStatus { + type Err = (); + fn from_str(s: &str) -> Result { + use GelatoDocumentReportStatus::*; + match s { + "unverified" => Ok(Unverified), + "verified" => Ok(Verified), + _ => Err(()), + } + } +} +impl std::fmt::Display for GelatoDocumentReportStatus { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for GelatoDocumentReportStatus { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for GelatoDocumentReportStatus { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for GelatoDocumentReportStatus { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s) + .map_err(|_| serde::de::Error::custom("Unknown value for GelatoDocumentReportStatus")) + } +} +/// Type of the document. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum GelatoDocumentReportType { + DrivingLicense, + IdCard, + Passport, +} +impl GelatoDocumentReportType { + pub fn as_str(self) -> &'static str { + use GelatoDocumentReportType::*; + match self { + DrivingLicense => "driving_license", + IdCard => "id_card", + Passport => "passport", + } + } +} + +impl std::str::FromStr for GelatoDocumentReportType { + type Err = (); + fn from_str(s: &str) -> Result { + use GelatoDocumentReportType::*; + match s { + "driving_license" => Ok(DrivingLicense), + "id_card" => Ok(IdCard), + "passport" => Ok(Passport), + _ => Err(()), + } + } +} +impl std::fmt::Display for GelatoDocumentReportType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for GelatoDocumentReportType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for GelatoDocumentReportType { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for GelatoDocumentReportType { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s) + .map_err(|_| serde::de::Error::custom("Unknown value for GelatoDocumentReportType")) + } +} diff --git a/generated/stripe_misc/src/gelato_document_report_error.rs b/generated/stripe_misc/src/gelato_document_report_error.rs new file mode 100644 index 000000000..cb6845bcf --- /dev/null +++ b/generated/stripe_misc/src/gelato_document_report_error.rs @@ -0,0 +1,66 @@ +#[derive(Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct GelatoDocumentReportError { + /// A short machine-readable string giving the reason for the verification failure. + pub code: Option, + /// A human-readable message giving the reason for the failure. + /// These messages can be shown to your users. + pub reason: Option, +} +/// A short machine-readable string giving the reason for the verification failure. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum GelatoDocumentReportErrorCode { + DocumentExpired, + DocumentTypeNotSupported, + DocumentUnverifiedOther, +} +impl GelatoDocumentReportErrorCode { + pub fn as_str(self) -> &'static str { + use GelatoDocumentReportErrorCode::*; + match self { + DocumentExpired => "document_expired", + DocumentTypeNotSupported => "document_type_not_supported", + DocumentUnverifiedOther => "document_unverified_other", + } + } +} + +impl std::str::FromStr for GelatoDocumentReportErrorCode { + type Err = (); + fn from_str(s: &str) -> Result { + use GelatoDocumentReportErrorCode::*; + match s { + "document_expired" => Ok(DocumentExpired), + "document_type_not_supported" => Ok(DocumentTypeNotSupported), + "document_unverified_other" => Ok(DocumentUnverifiedOther), + _ => Err(()), + } + } +} +impl std::fmt::Display for GelatoDocumentReportErrorCode { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for GelatoDocumentReportErrorCode { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for GelatoDocumentReportErrorCode { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for GelatoDocumentReportErrorCode { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| { + serde::de::Error::custom("Unknown value for GelatoDocumentReportErrorCode") + }) + } +} diff --git a/generated/stripe_misc/src/gelato_id_number_report.rs b/generated/stripe_misc/src/gelato_id_number_report.rs new file mode 100644 index 000000000..9f0a3bbeb --- /dev/null +++ b/generated/stripe_misc/src/gelato_id_number_report.rs @@ -0,0 +1,130 @@ +/// Result from an id_number check +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct GelatoIdNumberReport { + /// Date of birth. + pub dob: Option, + /// Details on the verification error. Present when status is `unverified`. + pub error: Option, + /// First name. + pub first_name: Option, + /// ID number. When `id_number_type` is `us_ssn`, only the last 4 digits are present. + pub id_number: Option, + /// Type of ID number. + pub id_number_type: Option, + /// Last name. + pub last_name: Option, + /// Status of this `id_number` check. + pub status: GelatoIdNumberReportStatus, +} +/// Type of ID number. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum GelatoIdNumberReportIdNumberType { + BrCpf, + SgNric, + UsSsn, +} +impl GelatoIdNumberReportIdNumberType { + pub fn as_str(self) -> &'static str { + use GelatoIdNumberReportIdNumberType::*; + match self { + BrCpf => "br_cpf", + SgNric => "sg_nric", + UsSsn => "us_ssn", + } + } +} + +impl std::str::FromStr for GelatoIdNumberReportIdNumberType { + type Err = (); + fn from_str(s: &str) -> Result { + use GelatoIdNumberReportIdNumberType::*; + match s { + "br_cpf" => Ok(BrCpf), + "sg_nric" => Ok(SgNric), + "us_ssn" => Ok(UsSsn), + _ => Err(()), + } + } +} +impl std::fmt::Display for GelatoIdNumberReportIdNumberType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for GelatoIdNumberReportIdNumberType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for GelatoIdNumberReportIdNumberType { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for GelatoIdNumberReportIdNumberType { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| { + serde::de::Error::custom("Unknown value for GelatoIdNumberReportIdNumberType") + }) + } +} +/// Status of this `id_number` check. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum GelatoIdNumberReportStatus { + Unverified, + Verified, +} +impl GelatoIdNumberReportStatus { + pub fn as_str(self) -> &'static str { + use GelatoIdNumberReportStatus::*; + match self { + Unverified => "unverified", + Verified => "verified", + } + } +} + +impl std::str::FromStr for GelatoIdNumberReportStatus { + type Err = (); + fn from_str(s: &str) -> Result { + use GelatoIdNumberReportStatus::*; + match s { + "unverified" => Ok(Unverified), + "verified" => Ok(Verified), + _ => Err(()), + } + } +} +impl std::fmt::Display for GelatoIdNumberReportStatus { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for GelatoIdNumberReportStatus { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for GelatoIdNumberReportStatus { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for GelatoIdNumberReportStatus { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s) + .map_err(|_| serde::de::Error::custom("Unknown value for GelatoIdNumberReportStatus")) + } +} diff --git a/generated/stripe_misc/src/gelato_id_number_report_error.rs b/generated/stripe_misc/src/gelato_id_number_report_error.rs new file mode 100644 index 000000000..409b95f04 --- /dev/null +++ b/generated/stripe_misc/src/gelato_id_number_report_error.rs @@ -0,0 +1,66 @@ +#[derive(Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct GelatoIdNumberReportError { + /// A short machine-readable string giving the reason for the verification failure. + pub code: Option, + /// A human-readable message giving the reason for the failure. + /// These messages can be shown to your users. + pub reason: Option, +} +/// A short machine-readable string giving the reason for the verification failure. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum GelatoIdNumberReportErrorCode { + IdNumberInsufficientDocumentData, + IdNumberMismatch, + IdNumberUnverifiedOther, +} +impl GelatoIdNumberReportErrorCode { + pub fn as_str(self) -> &'static str { + use GelatoIdNumberReportErrorCode::*; + match self { + IdNumberInsufficientDocumentData => "id_number_insufficient_document_data", + IdNumberMismatch => "id_number_mismatch", + IdNumberUnverifiedOther => "id_number_unverified_other", + } + } +} + +impl std::str::FromStr for GelatoIdNumberReportErrorCode { + type Err = (); + fn from_str(s: &str) -> Result { + use GelatoIdNumberReportErrorCode::*; + match s { + "id_number_insufficient_document_data" => Ok(IdNumberInsufficientDocumentData), + "id_number_mismatch" => Ok(IdNumberMismatch), + "id_number_unverified_other" => Ok(IdNumberUnverifiedOther), + _ => Err(()), + } + } +} +impl std::fmt::Display for GelatoIdNumberReportErrorCode { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for GelatoIdNumberReportErrorCode { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for GelatoIdNumberReportErrorCode { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for GelatoIdNumberReportErrorCode { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| { + serde::de::Error::custom("Unknown value for GelatoIdNumberReportErrorCode") + }) + } +} diff --git a/generated/stripe_misc/src/gelato_report_document_options.rs b/generated/stripe_misc/src/gelato_report_document_options.rs new file mode 100644 index 000000000..d64cf9535 --- /dev/null +++ b/generated/stripe_misc/src/gelato_report_document_options.rs @@ -0,0 +1,76 @@ +#[derive(Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct GelatoReportDocumentOptions { + /// Array of strings of allowed identity document types. + /// If the provided identity document isn’t one of the allowed types, the verification check will fail with a document_type_not_allowed error code. + #[serde(skip_serializing_if = "Option::is_none")] + pub allowed_types: Option>, + /// Collect an ID number and perform an [ID number check](https://stripe.com/docs/identity/verification-checks?type=id-number) with the document’s extracted name and date of birth. + #[serde(skip_serializing_if = "Option::is_none")] + pub require_id_number: Option, + /// Disable image uploads, identity document images have to be captured using the device’s camera. + #[serde(skip_serializing_if = "Option::is_none")] + pub require_live_capture: Option, + /// Capture a face image and perform a [selfie check](https://stripe.com/docs/identity/verification-checks?type=selfie) comparing a photo ID and a picture of your user’s face. + /// [Learn more](https://stripe.com/docs/identity/selfie). + #[serde(skip_serializing_if = "Option::is_none")] + pub require_matching_selfie: Option, +} +/// Array of strings of allowed identity document types. +/// If the provided identity document isn’t one of the allowed types, the verification check will fail with a document_type_not_allowed error code. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum GelatoReportDocumentOptionsAllowedTypes { + DrivingLicense, + IdCard, + Passport, +} +impl GelatoReportDocumentOptionsAllowedTypes { + pub fn as_str(self) -> &'static str { + use GelatoReportDocumentOptionsAllowedTypes::*; + match self { + DrivingLicense => "driving_license", + IdCard => "id_card", + Passport => "passport", + } + } +} + +impl std::str::FromStr for GelatoReportDocumentOptionsAllowedTypes { + type Err = (); + fn from_str(s: &str) -> Result { + use GelatoReportDocumentOptionsAllowedTypes::*; + match s { + "driving_license" => Ok(DrivingLicense), + "id_card" => Ok(IdCard), + "passport" => Ok(Passport), + _ => Err(()), + } + } +} +impl std::fmt::Display for GelatoReportDocumentOptionsAllowedTypes { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for GelatoReportDocumentOptionsAllowedTypes { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for GelatoReportDocumentOptionsAllowedTypes { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for GelatoReportDocumentOptionsAllowedTypes { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| { + serde::de::Error::custom("Unknown value for GelatoReportDocumentOptionsAllowedTypes") + }) + } +} diff --git a/generated/stripe_misc/src/gelato_report_id_number_options.rs b/generated/stripe_misc/src/gelato_report_id_number_options.rs new file mode 100644 index 000000000..469d8e9a1 --- /dev/null +++ b/generated/stripe_misc/src/gelato_report_id_number_options.rs @@ -0,0 +1,2 @@ +#[derive(Copy, Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct GelatoReportIdNumberOptions {} diff --git a/generated/stripe_misc/src/gelato_selfie_report.rs b/generated/stripe_misc/src/gelato_selfie_report.rs new file mode 100644 index 000000000..d6d7ed27b --- /dev/null +++ b/generated/stripe_misc/src/gelato_selfie_report.rs @@ -0,0 +1,66 @@ +/// Result from a selfie check +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct GelatoSelfieReport { + /// ID of the [File](https://stripe.com/docs/api/files) holding the image of the identity document used in this check. + pub document: Option, + /// Details on the verification error. Present when status is `unverified`. + pub error: Option, + /// ID of the [File](https://stripe.com/docs/api/files) holding the image of the selfie used in this check. + pub selfie: Option, + /// Status of this `selfie` check. + pub status: GelatoSelfieReportStatus, +} +/// Status of this `selfie` check. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum GelatoSelfieReportStatus { + Unverified, + Verified, +} +impl GelatoSelfieReportStatus { + pub fn as_str(self) -> &'static str { + use GelatoSelfieReportStatus::*; + match self { + Unverified => "unverified", + Verified => "verified", + } + } +} + +impl std::str::FromStr for GelatoSelfieReportStatus { + type Err = (); + fn from_str(s: &str) -> Result { + use GelatoSelfieReportStatus::*; + match s { + "unverified" => Ok(Unverified), + "verified" => Ok(Verified), + _ => Err(()), + } + } +} +impl std::fmt::Display for GelatoSelfieReportStatus { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for GelatoSelfieReportStatus { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for GelatoSelfieReportStatus { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for GelatoSelfieReportStatus { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s) + .map_err(|_| serde::de::Error::custom("Unknown value for GelatoSelfieReportStatus")) + } +} diff --git a/generated/stripe_misc/src/gelato_selfie_report_error.rs b/generated/stripe_misc/src/gelato_selfie_report_error.rs new file mode 100644 index 000000000..068e3dd79 --- /dev/null +++ b/generated/stripe_misc/src/gelato_selfie_report_error.rs @@ -0,0 +1,68 @@ +#[derive(Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct GelatoSelfieReportError { + /// A short machine-readable string giving the reason for the verification failure. + pub code: Option, + /// A human-readable message giving the reason for the failure. + /// These messages can be shown to your users. + pub reason: Option, +} +/// A short machine-readable string giving the reason for the verification failure. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum GelatoSelfieReportErrorCode { + SelfieDocumentMissingPhoto, + SelfieFaceMismatch, + SelfieManipulated, + SelfieUnverifiedOther, +} +impl GelatoSelfieReportErrorCode { + pub fn as_str(self) -> &'static str { + use GelatoSelfieReportErrorCode::*; + match self { + SelfieDocumentMissingPhoto => "selfie_document_missing_photo", + SelfieFaceMismatch => "selfie_face_mismatch", + SelfieManipulated => "selfie_manipulated", + SelfieUnverifiedOther => "selfie_unverified_other", + } + } +} + +impl std::str::FromStr for GelatoSelfieReportErrorCode { + type Err = (); + fn from_str(s: &str) -> Result { + use GelatoSelfieReportErrorCode::*; + match s { + "selfie_document_missing_photo" => Ok(SelfieDocumentMissingPhoto), + "selfie_face_mismatch" => Ok(SelfieFaceMismatch), + "selfie_manipulated" => Ok(SelfieManipulated), + "selfie_unverified_other" => Ok(SelfieUnverifiedOther), + _ => Err(()), + } + } +} +impl std::fmt::Display for GelatoSelfieReportErrorCode { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for GelatoSelfieReportErrorCode { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for GelatoSelfieReportErrorCode { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for GelatoSelfieReportErrorCode { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s) + .map_err(|_| serde::de::Error::custom("Unknown value for GelatoSelfieReportErrorCode")) + } +} diff --git a/generated/stripe_misc/src/gelato_session_document_options.rs b/generated/stripe_misc/src/gelato_session_document_options.rs new file mode 100644 index 000000000..ca96e161a --- /dev/null +++ b/generated/stripe_misc/src/gelato_session_document_options.rs @@ -0,0 +1,76 @@ +#[derive(Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct GelatoSessionDocumentOptions { + /// Array of strings of allowed identity document types. + /// If the provided identity document isn’t one of the allowed types, the verification check will fail with a document_type_not_allowed error code. + #[serde(skip_serializing_if = "Option::is_none")] + pub allowed_types: Option>, + /// Collect an ID number and perform an [ID number check](https://stripe.com/docs/identity/verification-checks?type=id-number) with the document’s extracted name and date of birth. + #[serde(skip_serializing_if = "Option::is_none")] + pub require_id_number: Option, + /// Disable image uploads, identity document images have to be captured using the device’s camera. + #[serde(skip_serializing_if = "Option::is_none")] + pub require_live_capture: Option, + /// Capture a face image and perform a [selfie check](https://stripe.com/docs/identity/verification-checks?type=selfie) comparing a photo ID and a picture of your user’s face. + /// [Learn more](https://stripe.com/docs/identity/selfie). + #[serde(skip_serializing_if = "Option::is_none")] + pub require_matching_selfie: Option, +} +/// Array of strings of allowed identity document types. +/// If the provided identity document isn’t one of the allowed types, the verification check will fail with a document_type_not_allowed error code. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum GelatoSessionDocumentOptionsAllowedTypes { + DrivingLicense, + IdCard, + Passport, +} +impl GelatoSessionDocumentOptionsAllowedTypes { + pub fn as_str(self) -> &'static str { + use GelatoSessionDocumentOptionsAllowedTypes::*; + match self { + DrivingLicense => "driving_license", + IdCard => "id_card", + Passport => "passport", + } + } +} + +impl std::str::FromStr for GelatoSessionDocumentOptionsAllowedTypes { + type Err = (); + fn from_str(s: &str) -> Result { + use GelatoSessionDocumentOptionsAllowedTypes::*; + match s { + "driving_license" => Ok(DrivingLicense), + "id_card" => Ok(IdCard), + "passport" => Ok(Passport), + _ => Err(()), + } + } +} +impl std::fmt::Display for GelatoSessionDocumentOptionsAllowedTypes { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for GelatoSessionDocumentOptionsAllowedTypes { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for GelatoSessionDocumentOptionsAllowedTypes { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for GelatoSessionDocumentOptionsAllowedTypes { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| { + serde::de::Error::custom("Unknown value for GelatoSessionDocumentOptionsAllowedTypes") + }) + } +} diff --git a/generated/stripe_misc/src/gelato_session_id_number_options.rs b/generated/stripe_misc/src/gelato_session_id_number_options.rs new file mode 100644 index 000000000..2e402a477 --- /dev/null +++ b/generated/stripe_misc/src/gelato_session_id_number_options.rs @@ -0,0 +1,2 @@ +#[derive(Copy, Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct GelatoSessionIdNumberOptions {} diff --git a/generated/stripe_misc/src/gelato_session_last_error.rs b/generated/stripe_misc/src/gelato_session_last_error.rs new file mode 100644 index 000000000..bc2802fa4 --- /dev/null +++ b/generated/stripe_misc/src/gelato_session_last_error.rs @@ -0,0 +1,104 @@ +/// Shows last VerificationSession error +#[derive(Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct GelatoSessionLastError { + /// A short machine-readable string giving the reason for the verification or user-session failure. + pub code: Option, + /// A message that explains the reason for verification or user-session failure. + pub reason: Option, +} +/// A short machine-readable string giving the reason for the verification or user-session failure. +#[derive(Copy, Clone, Eq, PartialEq)] +#[non_exhaustive] +pub enum GelatoSessionLastErrorCode { + Abandoned, + ConsentDeclined, + CountryNotSupported, + DeviceNotSupported, + DocumentExpired, + DocumentTypeNotSupported, + DocumentUnverifiedOther, + IdNumberInsufficientDocumentData, + IdNumberMismatch, + IdNumberUnverifiedOther, + SelfieDocumentMissingPhoto, + SelfieFaceMismatch, + SelfieManipulated, + SelfieUnverifiedOther, + UnderSupportedAge, + /// An unrecognized value from Stripe. Should not be used as a request parameter. + Unknown, +} +impl GelatoSessionLastErrorCode { + pub fn as_str(self) -> &'static str { + use GelatoSessionLastErrorCode::*; + match self { + Abandoned => "abandoned", + ConsentDeclined => "consent_declined", + CountryNotSupported => "country_not_supported", + DeviceNotSupported => "device_not_supported", + DocumentExpired => "document_expired", + DocumentTypeNotSupported => "document_type_not_supported", + DocumentUnverifiedOther => "document_unverified_other", + IdNumberInsufficientDocumentData => "id_number_insufficient_document_data", + IdNumberMismatch => "id_number_mismatch", + IdNumberUnverifiedOther => "id_number_unverified_other", + SelfieDocumentMissingPhoto => "selfie_document_missing_photo", + SelfieFaceMismatch => "selfie_face_mismatch", + SelfieManipulated => "selfie_manipulated", + SelfieUnverifiedOther => "selfie_unverified_other", + UnderSupportedAge => "under_supported_age", + Unknown => "unknown", + } + } +} + +impl std::str::FromStr for GelatoSessionLastErrorCode { + type Err = (); + fn from_str(s: &str) -> Result { + use GelatoSessionLastErrorCode::*; + match s { + "abandoned" => Ok(Abandoned), + "consent_declined" => Ok(ConsentDeclined), + "country_not_supported" => Ok(CountryNotSupported), + "device_not_supported" => Ok(DeviceNotSupported), + "document_expired" => Ok(DocumentExpired), + "document_type_not_supported" => Ok(DocumentTypeNotSupported), + "document_unverified_other" => Ok(DocumentUnverifiedOther), + "id_number_insufficient_document_data" => Ok(IdNumberInsufficientDocumentData), + "id_number_mismatch" => Ok(IdNumberMismatch), + "id_number_unverified_other" => Ok(IdNumberUnverifiedOther), + "selfie_document_missing_photo" => Ok(SelfieDocumentMissingPhoto), + "selfie_face_mismatch" => Ok(SelfieFaceMismatch), + "selfie_manipulated" => Ok(SelfieManipulated), + "selfie_unverified_other" => Ok(SelfieUnverifiedOther), + "under_supported_age" => Ok(UnderSupportedAge), + _ => Err(()), + } + } +} +impl std::fmt::Display for GelatoSessionLastErrorCode { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for GelatoSessionLastErrorCode { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for GelatoSessionLastErrorCode { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for GelatoSessionLastErrorCode { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Ok(Self::from_str(&s).unwrap_or(GelatoSessionLastErrorCode::Unknown)) + } +} diff --git a/generated/stripe_misc/src/gelato_verification_report_options.rs b/generated/stripe_misc/src/gelato_verification_report_options.rs new file mode 100644 index 000000000..84bb33614 --- /dev/null +++ b/generated/stripe_misc/src/gelato_verification_report_options.rs @@ -0,0 +1,7 @@ +#[derive(Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct GelatoVerificationReportOptions { + #[serde(skip_serializing_if = "Option::is_none")] + pub document: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub id_number: Option, +} diff --git a/generated/stripe_misc/src/gelato_verification_session_options.rs b/generated/stripe_misc/src/gelato_verification_session_options.rs new file mode 100644 index 000000000..fdce179be --- /dev/null +++ b/generated/stripe_misc/src/gelato_verification_session_options.rs @@ -0,0 +1,7 @@ +#[derive(Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct GelatoVerificationSessionOptions { + #[serde(skip_serializing_if = "Option::is_none")] + pub document: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub id_number: Option, +} diff --git a/generated/stripe_misc/src/gelato_verified_outputs.rs b/generated/stripe_misc/src/gelato_verified_outputs.rs new file mode 100644 index 000000000..74d0960aa --- /dev/null +++ b/generated/stripe_misc/src/gelato_verified_outputs.rs @@ -0,0 +1,73 @@ +#[derive(Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct GelatoVerifiedOutputs { + /// The user's verified address. + pub address: Option, + /// The user’s verified date of birth. + pub dob: Option, + /// The user's verified first name. + pub first_name: Option, + /// The user's verified id number. + pub id_number: Option, + /// The user's verified id number type. + pub id_number_type: Option, + /// The user's verified last name. + pub last_name: Option, +} +/// The user's verified id number type. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum GelatoVerifiedOutputsIdNumberType { + BrCpf, + SgNric, + UsSsn, +} +impl GelatoVerifiedOutputsIdNumberType { + pub fn as_str(self) -> &'static str { + use GelatoVerifiedOutputsIdNumberType::*; + match self { + BrCpf => "br_cpf", + SgNric => "sg_nric", + UsSsn => "us_ssn", + } + } +} + +impl std::str::FromStr for GelatoVerifiedOutputsIdNumberType { + type Err = (); + fn from_str(s: &str) -> Result { + use GelatoVerifiedOutputsIdNumberType::*; + match s { + "br_cpf" => Ok(BrCpf), + "sg_nric" => Ok(SgNric), + "us_ssn" => Ok(UsSsn), + _ => Err(()), + } + } +} +impl std::fmt::Display for GelatoVerifiedOutputsIdNumberType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for GelatoVerifiedOutputsIdNumberType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for GelatoVerifiedOutputsIdNumberType { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for GelatoVerifiedOutputsIdNumberType { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| { + serde::de::Error::custom("Unknown value for GelatoVerifiedOutputsIdNumberType") + }) + } +} diff --git a/generated/stripe_misc/src/identity_verification_report/mod.rs b/generated/stripe_misc/src/identity_verification_report/mod.rs new file mode 100644 index 000000000..a3f2d9863 --- /dev/null +++ b/generated/stripe_misc/src/identity_verification_report/mod.rs @@ -0,0 +1,5 @@ +#[cfg(feature = "identity_verification_report")] +mod requests; +pub(crate) mod types; +#[cfg(feature = "identity_verification_report")] +pub use requests::*; diff --git a/generated/stripe_misc/src/identity_verification_report/requests.rs b/generated/stripe_misc/src/identity_verification_report/requests.rs new file mode 100644 index 000000000..3e4b46c2b --- /dev/null +++ b/generated/stripe_misc/src/identity_verification_report/requests.rs @@ -0,0 +1,70 @@ +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct ListIdentityVerificationReport<'a> { + #[serde(skip_serializing_if = "Option::is_none")] + pub created: Option, + /// A cursor for use in pagination. + /// `ending_before` is an object ID that defines your place in the list. + /// For instance, if you make a list request and receive 100 objects, starting with `obj_bar`, your subsequent call can include `ending_before=obj_bar` in order to fetch the previous page of the list. + #[serde(skip_serializing_if = "Option::is_none")] + pub ending_before: Option<&'a str>, + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, + /// A limit on the number of objects to be returned. + /// Limit can range between 1 and 100, and the default is 10. + #[serde(skip_serializing_if = "Option::is_none")] + pub limit: Option, + /// A cursor for use in pagination. + /// `starting_after` is an object ID that defines your place in the list. + /// For instance, if you make a list request and receive 100 objects, ending with `obj_foo`, your subsequent call can include `starting_after=obj_foo` in order to fetch the next page of the list. + #[serde(skip_serializing_if = "Option::is_none")] + pub starting_after: Option<&'a str>, + /// Only return VerificationReports of this type + #[serde(rename = "type")] + #[serde(skip_serializing_if = "Option::is_none")] + pub type_: Option, + /// Only return VerificationReports created by this VerificationSession ID. + /// It is allowed to provide a VerificationIntent ID. + #[serde(skip_serializing_if = "Option::is_none")] + pub verification_session: Option<&'a str>, +} +impl<'a> ListIdentityVerificationReport<'a> { + pub fn new() -> Self { + Self::default() + } +} +impl<'a> ListIdentityVerificationReport<'a> { + /// List all verification reports. + pub fn send( + &self, + client: &stripe::Client, + ) -> stripe::Response> { + client.get_query("/identity/verification_reports", self) + } + pub fn paginate( + self, + ) -> stripe::ListPaginator> { + stripe::ListPaginator::from_list_params("/identity/verification_reports", self) + } +} +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct RetrieveIdentityVerificationReport<'a> { + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, +} +impl<'a> RetrieveIdentityVerificationReport<'a> { + pub fn new() -> Self { + Self::default() + } +} +impl<'a> RetrieveIdentityVerificationReport<'a> { + /// Retrieves an existing VerificationReport + pub fn send( + &self, + client: &stripe::Client, + report: &stripe_misc::IdentityVerificationReportId, + ) -> stripe::Response { + client.get_query(&format!("/identity/verification_reports/{report}"), self) + } +} diff --git a/generated/stripe_misc/src/identity_verification_report/types.rs b/generated/stripe_misc/src/identity_verification_report/types.rs new file mode 100644 index 000000000..b2d14646d --- /dev/null +++ b/generated/stripe_misc/src/identity_verification_report/types.rs @@ -0,0 +1,97 @@ +/// A VerificationReport is the result of an attempt to collect and verify data from a user. +/// The collection of verification checks performed is determined from the `type` and `options` +/// parameters used. You can find the result of each verification check performed in the +/// appropriate sub-resource: `document`, `id_number`, `selfie`. +/// +/// Each VerificationReport contains a copy of any data collected by the user as well as +/// reference IDs which can be used to access collected images through the [FileUpload](https://stripe.com/docs/api/files). +/// API. To configure and create VerificationReports, use the +/// [VerificationSession](https://stripe.com/docs/api/identity/verification_sessions) API. +/// +/// Related guides: [Accessing verification results](https://stripe.com/docs/identity/verification-sessions#results). +/// +/// For more details see <>. +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct IdentityVerificationReport { + /// Time at which the object was created. Measured in seconds since the Unix epoch. + pub created: stripe_types::Timestamp, + #[serde(skip_serializing_if = "Option::is_none")] + pub document: Option, + /// Unique identifier for the object. + pub id: stripe_misc::IdentityVerificationReportId, + #[serde(skip_serializing_if = "Option::is_none")] + pub id_number: Option, + /// Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + pub livemode: bool, + #[serde(skip_serializing_if = "Option::is_none")] + pub options: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub selfie: Option, + /// Type of report. + #[serde(rename = "type")] + #[serde(skip_serializing_if = "Option::is_none")] + pub type_: Option, + /// ID of the VerificationSession that created this report. + pub verification_session: Option, +} +impl stripe_types::Object for IdentityVerificationReport { + type Id = stripe_misc::IdentityVerificationReportId; + fn id(&self) -> &Self::Id { + &self.id + } +} +stripe_types::def_id!(IdentityVerificationReportId); +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum IdentityVerificationReportType { + Document, + IdNumber, +} +impl IdentityVerificationReportType { + pub fn as_str(self) -> &'static str { + use IdentityVerificationReportType::*; + match self { + Document => "document", + IdNumber => "id_number", + } + } +} + +impl std::str::FromStr for IdentityVerificationReportType { + type Err = (); + fn from_str(s: &str) -> Result { + use IdentityVerificationReportType::*; + match s { + "document" => Ok(Document), + "id_number" => Ok(IdNumber), + _ => Err(()), + } + } +} +impl std::fmt::Display for IdentityVerificationReportType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for IdentityVerificationReportType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for IdentityVerificationReportType { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for IdentityVerificationReportType { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| { + serde::de::Error::custom("Unknown value for IdentityVerificationReportType") + }) + } +} diff --git a/generated/stripe_misc/src/identity_verification_session/mod.rs b/generated/stripe_misc/src/identity_verification_session/mod.rs new file mode 100644 index 000000000..9cb615b07 --- /dev/null +++ b/generated/stripe_misc/src/identity_verification_session/mod.rs @@ -0,0 +1,5 @@ +#[cfg(feature = "identity_verification_session")] +mod requests; +pub(crate) mod types; +#[cfg(feature = "identity_verification_session")] +pub use requests::*; diff --git a/generated/stripe_misc/src/identity_verification_session/requests.rs b/generated/stripe_misc/src/identity_verification_session/requests.rs new file mode 100644 index 000000000..efbfed561 --- /dev/null +++ b/generated/stripe_misc/src/identity_verification_session/requests.rs @@ -0,0 +1,394 @@ +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct ListIdentityVerificationSession<'a> { + #[serde(skip_serializing_if = "Option::is_none")] + pub created: Option, + /// A cursor for use in pagination. + /// `ending_before` is an object ID that defines your place in the list. + /// For instance, if you make a list request and receive 100 objects, starting with `obj_bar`, your subsequent call can include `ending_before=obj_bar` in order to fetch the previous page of the list. + #[serde(skip_serializing_if = "Option::is_none")] + pub ending_before: Option<&'a str>, + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, + /// A limit on the number of objects to be returned. + /// Limit can range between 1 and 100, and the default is 10. + #[serde(skip_serializing_if = "Option::is_none")] + pub limit: Option, + /// A cursor for use in pagination. + /// `starting_after` is an object ID that defines your place in the list. + /// For instance, if you make a list request and receive 100 objects, ending with `obj_foo`, your subsequent call can include `starting_after=obj_foo` in order to fetch the next page of the list. + #[serde(skip_serializing_if = "Option::is_none")] + pub starting_after: Option<&'a str>, + /// Only return VerificationSessions with this status. + /// [Learn more about the lifecycle of sessions](https://stripe.com/docs/identity/how-sessions-work). + #[serde(skip_serializing_if = "Option::is_none")] + pub status: Option, +} +impl<'a> ListIdentityVerificationSession<'a> { + pub fn new() -> Self { + Self::default() + } +} +impl<'a> ListIdentityVerificationSession<'a> { + /// Returns a list of VerificationSessions + pub fn send( + &self, + client: &stripe::Client, + ) -> stripe::Response> { + client.get_query("/identity/verification_sessions", self) + } + pub fn paginate( + self, + ) -> stripe::ListPaginator> { + stripe::ListPaginator::from_list_params("/identity/verification_sessions", self) + } +} +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct RetrieveIdentityVerificationSession<'a> { + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, +} +impl<'a> RetrieveIdentityVerificationSession<'a> { + pub fn new() -> Self { + Self::default() + } +} +impl<'a> RetrieveIdentityVerificationSession<'a> { + /// Retrieves the details of a VerificationSession that was previously created. + /// + /// When the session status is `requires_input`, you can use this method to retrieve a valid + /// `client_secret` or `url` to allow re-submission. + pub fn send( + &self, + client: &stripe::Client, + session: &stripe_misc::IdentityVerificationSessionId, + ) -> stripe::Response { + client.get_query(&format!("/identity/verification_sessions/{session}"), self) + } +} +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreateIdentityVerificationSession<'a> { + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, + /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. + /// This can be useful for storing additional information about the object in a structured format. + /// Individual keys can be unset by posting an empty value to them. + /// All keys can be unset by posting an empty value to `metadata`. + #[serde(skip_serializing_if = "Option::is_none")] + pub metadata: Option<&'a std::collections::HashMap>, + /// A set of options for the session’s verification checks. + #[serde(skip_serializing_if = "Option::is_none")] + pub options: Option>, + /// The URL that the user will be redirected to upon completing the verification flow. + #[serde(skip_serializing_if = "Option::is_none")] + pub return_url: Option<&'a str>, + /// The type of [verification check](https://stripe.com/docs/identity/verification-checks) to be performed. + #[serde(rename = "type")] + pub type_: stripe_misc::IdentityVerificationSessionType, +} +impl<'a> CreateIdentityVerificationSession<'a> { + pub fn new(type_: stripe_misc::IdentityVerificationSessionType) -> Self { + Self { expand: None, metadata: None, options: None, return_url: None, type_ } + } +} +/// A set of options for the session’s verification checks. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreateIdentityVerificationSessionOptions<'a> { + /// Options that apply to the [document check](https://stripe.com/docs/identity/verification-checks?type=document). + #[serde(skip_serializing_if = "Option::is_none")] + pub document: Option>, +} +impl<'a> CreateIdentityVerificationSessionOptions<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// Options that apply to the [document check](https://stripe.com/docs/identity/verification-checks?type=document). +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreateIdentityVerificationSessionOptionsDocument<'a> { + /// Array of strings of allowed identity document types. + /// If the provided identity document isn’t one of the allowed types, the verification check will fail with a document_type_not_allowed error code. + #[serde(skip_serializing_if = "Option::is_none")] + pub allowed_types: Option<&'a [CreateIdentityVerificationSessionOptionsDocumentAllowedTypes]>, + /// Collect an ID number and perform an [ID number check](https://stripe.com/docs/identity/verification-checks?type=id-number) with the document’s extracted name and date of birth. + #[serde(skip_serializing_if = "Option::is_none")] + pub require_id_number: Option, + /// Disable image uploads, identity document images have to be captured using the device’s camera. + #[serde(skip_serializing_if = "Option::is_none")] + pub require_live_capture: Option, + /// Capture a face image and perform a [selfie check](https://stripe.com/docs/identity/verification-checks?type=selfie) comparing a photo ID and a picture of your user’s face. + /// [Learn more](https://stripe.com/docs/identity/selfie). + #[serde(skip_serializing_if = "Option::is_none")] + pub require_matching_selfie: Option, +} +impl<'a> CreateIdentityVerificationSessionOptionsDocument<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// Array of strings of allowed identity document types. +/// If the provided identity document isn’t one of the allowed types, the verification check will fail with a document_type_not_allowed error code. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreateIdentityVerificationSessionOptionsDocumentAllowedTypes { + DrivingLicense, + IdCard, + Passport, +} +impl CreateIdentityVerificationSessionOptionsDocumentAllowedTypes { + pub fn as_str(self) -> &'static str { + use CreateIdentityVerificationSessionOptionsDocumentAllowedTypes::*; + match self { + DrivingLicense => "driving_license", + IdCard => "id_card", + Passport => "passport", + } + } +} + +impl std::str::FromStr for CreateIdentityVerificationSessionOptionsDocumentAllowedTypes { + type Err = (); + fn from_str(s: &str) -> Result { + use CreateIdentityVerificationSessionOptionsDocumentAllowedTypes::*; + match s { + "driving_license" => Ok(DrivingLicense), + "id_card" => Ok(IdCard), + "passport" => Ok(Passport), + _ => Err(()), + } + } +} +impl std::fmt::Display for CreateIdentityVerificationSessionOptionsDocumentAllowedTypes { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreateIdentityVerificationSessionOptionsDocumentAllowedTypes { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreateIdentityVerificationSessionOptionsDocumentAllowedTypes { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'a> CreateIdentityVerificationSession<'a> { + /// Creates a VerificationSession object. + /// + /// After the VerificationSession is created, display a verification modal using the session `client_secret` or send your users to the session’s `url`. + /// + /// If your API key is in test mode, verification checks won’t actually process, though everything else will occur as if in live mode. + /// + /// Related guide: [Verify your users’ identity documents](https://stripe.com/docs/identity/verify-identity-documents). + pub fn send( + &self, + client: &stripe::Client, + ) -> stripe::Response { + client.send_form("/identity/verification_sessions", self, http_types::Method::Post) + } +} +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdateIdentityVerificationSession<'a> { + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, + /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. + /// This can be useful for storing additional information about the object in a structured format. + /// Individual keys can be unset by posting an empty value to them. + /// All keys can be unset by posting an empty value to `metadata`. + #[serde(skip_serializing_if = "Option::is_none")] + pub metadata: Option<&'a std::collections::HashMap>, + /// A set of options for the session’s verification checks. + #[serde(skip_serializing_if = "Option::is_none")] + pub options: Option>, + /// The type of [verification check](https://stripe.com/docs/identity/verification-checks) to be performed. + #[serde(rename = "type")] + #[serde(skip_serializing_if = "Option::is_none")] + pub type_: Option, +} +impl<'a> UpdateIdentityVerificationSession<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// A set of options for the session’s verification checks. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdateIdentityVerificationSessionOptions<'a> { + /// Options that apply to the [document check](https://stripe.com/docs/identity/verification-checks?type=document). + #[serde(skip_serializing_if = "Option::is_none")] + pub document: Option>, +} +impl<'a> UpdateIdentityVerificationSessionOptions<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// Options that apply to the [document check](https://stripe.com/docs/identity/verification-checks?type=document). +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdateIdentityVerificationSessionOptionsDocument<'a> { + /// Array of strings of allowed identity document types. + /// If the provided identity document isn’t one of the allowed types, the verification check will fail with a document_type_not_allowed error code. + #[serde(skip_serializing_if = "Option::is_none")] + pub allowed_types: Option<&'a [UpdateIdentityVerificationSessionOptionsDocumentAllowedTypes]>, + /// Collect an ID number and perform an [ID number check](https://stripe.com/docs/identity/verification-checks?type=id-number) with the document’s extracted name and date of birth. + #[serde(skip_serializing_if = "Option::is_none")] + pub require_id_number: Option, + /// Disable image uploads, identity document images have to be captured using the device’s camera. + #[serde(skip_serializing_if = "Option::is_none")] + pub require_live_capture: Option, + /// Capture a face image and perform a [selfie check](https://stripe.com/docs/identity/verification-checks?type=selfie) comparing a photo ID and a picture of your user’s face. + /// [Learn more](https://stripe.com/docs/identity/selfie). + #[serde(skip_serializing_if = "Option::is_none")] + pub require_matching_selfie: Option, +} +impl<'a> UpdateIdentityVerificationSessionOptionsDocument<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// Array of strings of allowed identity document types. +/// If the provided identity document isn’t one of the allowed types, the verification check will fail with a document_type_not_allowed error code. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum UpdateIdentityVerificationSessionOptionsDocumentAllowedTypes { + DrivingLicense, + IdCard, + Passport, +} +impl UpdateIdentityVerificationSessionOptionsDocumentAllowedTypes { + pub fn as_str(self) -> &'static str { + use UpdateIdentityVerificationSessionOptionsDocumentAllowedTypes::*; + match self { + DrivingLicense => "driving_license", + IdCard => "id_card", + Passport => "passport", + } + } +} + +impl std::str::FromStr for UpdateIdentityVerificationSessionOptionsDocumentAllowedTypes { + type Err = (); + fn from_str(s: &str) -> Result { + use UpdateIdentityVerificationSessionOptionsDocumentAllowedTypes::*; + match s { + "driving_license" => Ok(DrivingLicense), + "id_card" => Ok(IdCard), + "passport" => Ok(Passport), + _ => Err(()), + } + } +} +impl std::fmt::Display for UpdateIdentityVerificationSessionOptionsDocumentAllowedTypes { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for UpdateIdentityVerificationSessionOptionsDocumentAllowedTypes { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for UpdateIdentityVerificationSessionOptionsDocumentAllowedTypes { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'a> UpdateIdentityVerificationSession<'a> { + /// Updates a VerificationSession object. + /// + /// When the session status is `requires_input`, you can use this method to update the + /// verification check and options. + pub fn send( + &self, + client: &stripe::Client, + session: &stripe_misc::IdentityVerificationSessionId, + ) -> stripe::Response { + client.send_form( + &format!("/identity/verification_sessions/{session}"), + self, + http_types::Method::Post, + ) + } +} +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CancelIdentityVerificationSession<'a> { + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, +} +impl<'a> CancelIdentityVerificationSession<'a> { + pub fn new() -> Self { + Self::default() + } +} +impl<'a> CancelIdentityVerificationSession<'a> { + /// A VerificationSession object can be canceled when it is in `requires_input` [status](https://stripe.com/docs/identity/how-sessions-work). + /// + /// Once canceled, future submission attempts are disabled. + /// This cannot be undone. + /// [Learn more](https://stripe.com/docs/identity/verification-sessions#cancel). + pub fn send( + &self, + client: &stripe::Client, + session: &stripe_misc::IdentityVerificationSessionId, + ) -> stripe::Response { + client.send_form( + &format!("/identity/verification_sessions/{session}/cancel"), + self, + http_types::Method::Post, + ) + } +} +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct RedactIdentityVerificationSession<'a> { + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, +} +impl<'a> RedactIdentityVerificationSession<'a> { + pub fn new() -> Self { + Self::default() + } +} +impl<'a> RedactIdentityVerificationSession<'a> { + /// Redact a VerificationSession to remove all collected information from Stripe. This will redact + /// the VerificationSession and all objects related to it, including VerificationReports, Events, + /// request logs, etc. + /// + /// A VerificationSession object can be redacted when it is in `requires_input` or `verified` + /// [status](https://stripe.com/docs/identity/how-sessions-work). + /// Redacting a VerificationSession in `requires_action`. + /// state will automatically cancel it. + /// + /// The redaction process may take up to four days. When the redaction process is in progress, the + /// VerificationSession’s `redaction.status` field will be set to `processing`; when the process is + /// finished, it will change to `redacted` and an `identity.verification_session.redacted` event + /// will be emitted. + /// + /// Redaction is irreversible. Redacted objects are still accessible in the Stripe API, but all the + /// fields that contain personal data will be replaced by the string `[redacted]` or a similar + /// placeholder. The `metadata` field will also be erased. Redacted objects cannot be updated or + /// used for any purpose. + /// + /// [Learn more](https://stripe.com/docs/identity/verification-sessions#redact). + pub fn send( + &self, + client: &stripe::Client, + session: &stripe_misc::IdentityVerificationSessionId, + ) -> stripe::Response { + client.send_form( + &format!("/identity/verification_sessions/{session}/redact"), + self, + http_types::Method::Post, + ) + } +} diff --git a/generated/stripe_misc/src/identity_verification_session/types.rs b/generated/stripe_misc/src/identity_verification_session/types.rs new file mode 100644 index 000000000..f1526e239 --- /dev/null +++ b/generated/stripe_misc/src/identity_verification_session/types.rs @@ -0,0 +1,176 @@ +/// A VerificationSession guides you through the process of collecting and verifying the identities +/// of your users. It contains details about the type of verification, such as what [verification +/// check](/docs/identity/verification-checks) to perform. Only create one VerificationSession for +/// each verification in your system. +/// +/// A VerificationSession transitions through [multiple +/// statuses](/docs/identity/how-sessions-work) throughout its lifetime as it progresses through +/// the verification flow. The VerificationSession contains the user's verified data after +/// verification checks are complete. +/// +/// Related guide: [The Verification Sessions API](https://stripe.com/docs/identity/verification-sessions). +/// +/// For more details see <>. +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct IdentityVerificationSession { + /// The short-lived client secret used by Stripe.js to [show a verification modal](https://stripe.com/docs/js/identity/modal) inside your app. + /// This client secret expires after 24 hours and can only be used once. + /// Don’t store it, log it, embed it in a URL, or expose it to anyone other than the user. + /// Make sure that you have TLS enabled on any page that includes the client secret. + /// Refer to our docs on [passing the client secret to the frontend](https://stripe.com/docs/identity/verification-sessions#client-secret) to learn more. + pub client_secret: Option, + /// Time at which the object was created. Measured in seconds since the Unix epoch. + pub created: stripe_types::Timestamp, + /// Unique identifier for the object. + pub id: stripe_misc::IdentityVerificationSessionId, + /// If present, this property tells you the last error encountered when processing the verification. + pub last_error: Option, + /// ID of the most recent VerificationReport. + /// [Learn more about accessing detailed verification results.](https://stripe.com/docs/identity/verification-sessions#results). + pub last_verification_report: + Option>, + /// Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + pub livemode: bool, + /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. + /// This can be useful for storing additional information about the object in a structured format. + pub metadata: std::collections::HashMap, + /// A set of options for the session’s verification checks. + pub options: Option, + /// Redaction status of this VerificationSession. + /// If the VerificationSession is not redacted, this field will be null. + pub redaction: Option, + /// Status of this VerificationSession. + /// [Learn more about the lifecycle of sessions](https://stripe.com/docs/identity/how-sessions-work). + pub status: stripe_misc::IdentityVerificationSessionStatus, + /// The type of [verification check](https://stripe.com/docs/identity/verification-checks) to be performed. + #[serde(rename = "type")] + pub type_: Option, + /// The short-lived URL that you use to redirect a user to Stripe to submit their identity information. + /// This URL expires after 48 hours and can only be used once. + /// Don’t store it, log it, send it in emails or expose it to anyone other than the user. + /// Refer to our docs on [verifying identity documents](https://stripe.com/docs/identity/verify-identity-documents?platform=web&type=redirect) to learn how to redirect users to Stripe. + pub url: Option, + /// The user’s verified data. + pub verified_outputs: Option, +} +impl stripe_types::Object for IdentityVerificationSession { + type Id = stripe_misc::IdentityVerificationSessionId; + fn id(&self) -> &Self::Id { + &self.id + } +} +stripe_types::def_id!(IdentityVerificationSessionId); +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum IdentityVerificationSessionStatus { + Canceled, + Processing, + RequiresInput, + Verified, +} +impl IdentityVerificationSessionStatus { + pub fn as_str(self) -> &'static str { + use IdentityVerificationSessionStatus::*; + match self { + Canceled => "canceled", + Processing => "processing", + RequiresInput => "requires_input", + Verified => "verified", + } + } +} + +impl std::str::FromStr for IdentityVerificationSessionStatus { + type Err = (); + fn from_str(s: &str) -> Result { + use IdentityVerificationSessionStatus::*; + match s { + "canceled" => Ok(Canceled), + "processing" => Ok(Processing), + "requires_input" => Ok(RequiresInput), + "verified" => Ok(Verified), + _ => Err(()), + } + } +} +impl std::fmt::Display for IdentityVerificationSessionStatus { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for IdentityVerificationSessionStatus { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for IdentityVerificationSessionStatus { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for IdentityVerificationSessionStatus { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| { + serde::de::Error::custom("Unknown value for IdentityVerificationSessionStatus") + }) + } +} +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum IdentityVerificationSessionType { + Document, + IdNumber, +} +impl IdentityVerificationSessionType { + pub fn as_str(self) -> &'static str { + use IdentityVerificationSessionType::*; + match self { + Document => "document", + IdNumber => "id_number", + } + } +} + +impl std::str::FromStr for IdentityVerificationSessionType { + type Err = (); + fn from_str(s: &str) -> Result { + use IdentityVerificationSessionType::*; + match s { + "document" => Ok(Document), + "id_number" => Ok(IdNumber), + _ => Err(()), + } + } +} +impl std::fmt::Display for IdentityVerificationSessionType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for IdentityVerificationSessionType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for IdentityVerificationSessionType { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for IdentityVerificationSessionType { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| { + serde::de::Error::custom("Unknown value for IdentityVerificationSessionType") + }) + } +} diff --git a/generated/stripe_misc/src/mod.rs b/generated/stripe_misc/src/mod.rs new file mode 100644 index 000000000..3ad279696 --- /dev/null +++ b/generated/stripe_misc/src/mod.rs @@ -0,0 +1,320 @@ +#![recursion_limit = "256"] +#![allow(clippy::large_enum_variant)] +#![allow(rustdoc::broken_intra_doc_links)] +#![allow(rustdoc::invalid_html_tags)] + +//! This crate provides Rust bindings to the Stripe HTTP API, specifically +//! for requests mentioned in the `Tax`, `Identity`, `Reporting`, `Sigma`, `Financial Connections` +//! and `Webhooks` sections of the [Stripe API docs](https://stripe.com/docs/api) + +extern crate self as stripe_misc; +pub use apple_pay_domain::types::*; +pub mod apple_pay_domain; +#[doc(hidden)] +pub mod bank_connections_resource_accountholder; +#[doc(inline)] +pub use bank_connections_resource_accountholder::*; +#[doc(hidden)] +pub mod bank_connections_resource_balance; +#[doc(inline)] +pub use bank_connections_resource_balance::*; +#[doc(hidden)] +pub mod bank_connections_resource_balance_api_resource_cash_balance; +#[doc(inline)] +pub use bank_connections_resource_balance_api_resource_cash_balance::*; +#[doc(hidden)] +pub mod bank_connections_resource_balance_api_resource_credit_balance; +#[doc(inline)] +pub use bank_connections_resource_balance_api_resource_credit_balance::*; +#[doc(hidden)] +pub mod bank_connections_resource_balance_refresh; +#[doc(inline)] +pub use bank_connections_resource_balance_refresh::*; +#[doc(hidden)] +pub mod bank_connections_resource_link_account_session_filters; +#[doc(inline)] +pub use bank_connections_resource_link_account_session_filters::*; +#[doc(hidden)] +pub mod bank_connections_resource_ownership_refresh; +#[doc(inline)] +pub use bank_connections_resource_ownership_refresh::*; +#[doc(hidden)] +pub mod bank_connections_resource_transaction_refresh; +#[doc(inline)] +pub use bank_connections_resource_transaction_refresh::*; +#[doc(hidden)] +pub mod bank_connections_resource_transaction_resource_status_transitions; +#[doc(inline)] +pub use bank_connections_resource_transaction_resource_status_transitions::*; +pub use climate_order::types::*; +pub mod climate_order; +pub use climate_product::types::*; +pub mod climate_product; +pub use climate_supplier::types::*; +#[doc(hidden)] +pub mod climate_removals_beneficiary; +pub mod climate_supplier; +#[doc(inline)] +pub use climate_removals_beneficiary::*; +#[doc(hidden)] +pub mod climate_removals_location; +#[doc(inline)] +pub use climate_removals_location::*; +#[doc(hidden)] +pub mod climate_removals_order_deliveries; +#[doc(inline)] +pub use climate_removals_order_deliveries::*; +#[doc(hidden)] +pub mod climate_removals_products_price; +#[doc(inline)] +pub use climate_removals_products_price::*; +#[doc(hidden)] +pub mod deleted_apple_pay_domain; +#[doc(inline)] +pub use deleted_apple_pay_domain::*; +pub use webhook_endpoint::types::*; +#[doc(hidden)] +pub mod verification_session_redaction; +pub mod webhook_endpoint; +#[doc(inline)] +pub use verification_session_redaction::*; +#[doc(hidden)] +pub mod deleted_webhook_endpoint; +#[doc(inline)] +pub use deleted_webhook_endpoint::*; +pub use ephemeral_key::types::*; +pub mod ephemeral_key; +pub use exchange_rate::types::*; +pub mod exchange_rate; +pub use financial_connections_account::types::*; +pub mod financial_connections_account; +#[doc(hidden)] +pub mod financial_connections_account_owner; +#[doc(inline)] +pub use financial_connections_account_owner::*; +#[doc(hidden)] +pub mod financial_connections_account_ownership; +#[doc(inline)] +pub use financial_connections_account_ownership::*; +pub use financial_connections_session::types::*; +pub mod financial_connections_session; +pub use financial_connections_transaction::types::*; +pub mod financial_connections_transaction; +#[doc(hidden)] +pub mod financial_reporting_finance_report_run_run_parameters; +#[doc(inline)] +pub use financial_reporting_finance_report_run_run_parameters::*; +#[doc(hidden)] +pub mod gelato_data_document_report_date_of_birth; +#[doc(inline)] +pub use gelato_data_document_report_date_of_birth::*; +#[doc(hidden)] +pub mod gelato_data_document_report_expiration_date; +#[doc(inline)] +pub use gelato_data_document_report_expiration_date::*; +#[doc(hidden)] +pub mod gelato_data_document_report_issued_date; +#[doc(inline)] +pub use gelato_data_document_report_issued_date::*; +#[doc(hidden)] +pub mod gelato_data_id_number_report_date; +#[doc(inline)] +pub use gelato_data_id_number_report_date::*; +#[doc(hidden)] +pub mod gelato_data_verified_outputs_date; +#[doc(inline)] +pub use gelato_data_verified_outputs_date::*; +#[doc(hidden)] +pub mod gelato_document_report; +#[doc(inline)] +pub use gelato_document_report::*; +#[doc(hidden)] +pub mod gelato_document_report_error; +#[doc(inline)] +pub use gelato_document_report_error::*; +#[doc(hidden)] +pub mod gelato_id_number_report; +#[doc(inline)] +pub use gelato_id_number_report::*; +#[doc(hidden)] +pub mod gelato_id_number_report_error; +#[doc(inline)] +pub use gelato_id_number_report_error::*; +#[doc(hidden)] +pub mod gelato_report_document_options; +#[doc(inline)] +pub use gelato_report_document_options::*; +#[doc(hidden)] +pub mod gelato_report_id_number_options; +#[doc(inline)] +pub use gelato_report_id_number_options::*; +#[doc(hidden)] +pub mod gelato_selfie_report; +#[doc(inline)] +pub use gelato_selfie_report::*; +#[doc(hidden)] +pub mod gelato_selfie_report_error; +#[doc(inline)] +pub use gelato_selfie_report_error::*; +#[doc(hidden)] +pub mod gelato_session_document_options; +#[doc(inline)] +pub use gelato_session_document_options::*; +#[doc(hidden)] +pub mod gelato_session_id_number_options; +#[doc(inline)] +pub use gelato_session_id_number_options::*; +#[doc(hidden)] +pub mod gelato_session_last_error; +#[doc(inline)] +pub use gelato_session_last_error::*; +#[doc(hidden)] +pub mod gelato_verification_report_options; +#[doc(inline)] +pub use gelato_verification_report_options::*; +#[doc(hidden)] +pub mod gelato_verification_session_options; +#[doc(inline)] +pub use gelato_verification_session_options::*; +#[doc(hidden)] +pub mod gelato_verified_outputs; +#[doc(inline)] +pub use gelato_verified_outputs::*; +pub use identity_verification_report::types::*; +pub mod identity_verification_report; +pub use identity_verification_session::types::*; +pub mod identity_verification_session; +pub use reporting_report_run::types::*; +pub mod reporting_report_run; +pub use reporting_report_type::types::*; +pub mod reporting_report_type; +pub use scheduled_query_run::types::*; +pub mod scheduled_query_run; +#[doc(hidden)] +pub mod sigma_scheduled_query_run_error; +#[doc(inline)] +pub use sigma_scheduled_query_run_error::*; +pub use tax_calculation::types::*; +pub mod tax_calculation; +#[doc(hidden)] +pub mod tax_calculation_line_item; +#[doc(inline)] +pub use tax_calculation_line_item::*; +pub use tax_registration::types::*; +pub mod tax_registration; +pub use tax_settings::types::*; +pub mod tax_settings; +pub use tax_transaction::types::*; +pub mod tax_transaction; +#[doc(hidden)] +pub mod tax_transaction_line_item; +#[doc(inline)] +pub use tax_transaction_line_item::*; +#[doc(hidden)] +pub mod tax_product_registrations_resource_country_options; +#[doc(inline)] +pub use tax_product_registrations_resource_country_options::*; +#[doc(hidden)] +pub mod tax_product_registrations_resource_country_options_ca_province_standard; +#[doc(inline)] +pub use tax_product_registrations_resource_country_options_ca_province_standard::*; +#[doc(hidden)] +pub mod tax_product_registrations_resource_country_options_canada; +#[doc(inline)] +pub use tax_product_registrations_resource_country_options_canada::*; +#[doc(hidden)] +pub mod tax_product_registrations_resource_country_options_default; +#[doc(inline)] +pub use tax_product_registrations_resource_country_options_default::*; +#[doc(hidden)] +pub mod tax_product_registrations_resource_country_options_eu_standard; +#[doc(inline)] +pub use tax_product_registrations_resource_country_options_eu_standard::*; +#[doc(hidden)] +pub mod tax_product_registrations_resource_country_options_europe; +#[doc(inline)] +pub use tax_product_registrations_resource_country_options_europe::*; +#[doc(hidden)] +pub mod tax_product_registrations_resource_country_options_simplified; +#[doc(inline)] +pub use tax_product_registrations_resource_country_options_simplified::*; +#[doc(hidden)] +pub mod tax_product_registrations_resource_country_options_united_states; +#[doc(inline)] +pub use tax_product_registrations_resource_country_options_united_states::*; +#[doc(hidden)] +pub mod tax_product_registrations_resource_country_options_us_local_amusement_tax; +#[doc(inline)] +pub use tax_product_registrations_resource_country_options_us_local_amusement_tax::*; +#[doc(hidden)] +pub mod tax_product_registrations_resource_country_options_us_local_lease_tax; +#[doc(inline)] +pub use tax_product_registrations_resource_country_options_us_local_lease_tax::*; +#[doc(hidden)] +pub mod tax_product_resource_customer_details; +#[doc(inline)] +pub use tax_product_resource_customer_details::*; +#[doc(hidden)] +pub mod tax_product_resource_customer_details_resource_tax_id; +#[doc(inline)] +pub use tax_product_resource_customer_details_resource_tax_id::*; +#[doc(hidden)] +pub mod tax_product_resource_jurisdiction; +#[doc(inline)] +pub use tax_product_resource_jurisdiction::*; +#[doc(hidden)] +pub mod tax_product_resource_line_item_tax_breakdown; +#[doc(inline)] +pub use tax_product_resource_line_item_tax_breakdown::*; +#[doc(hidden)] +pub mod tax_product_resource_line_item_tax_rate_details; +#[doc(inline)] +pub use tax_product_resource_line_item_tax_rate_details::*; +#[doc(hidden)] +pub mod tax_product_resource_postal_address; +#[doc(inline)] +pub use tax_product_resource_postal_address::*; +#[doc(hidden)] +pub mod tax_product_resource_tax_breakdown; +#[doc(inline)] +pub use tax_product_resource_tax_breakdown::*; +#[doc(hidden)] +pub mod tax_product_resource_tax_calculation_shipping_cost; +#[doc(inline)] +pub use tax_product_resource_tax_calculation_shipping_cost::*; +#[doc(hidden)] +pub mod tax_product_resource_tax_rate_details; +#[doc(inline)] +pub use tax_product_resource_tax_rate_details::*; +#[doc(hidden)] +pub mod tax_product_resource_tax_settings_defaults; +#[doc(inline)] +pub use tax_product_resource_tax_settings_defaults::*; +#[doc(hidden)] +pub mod tax_product_resource_tax_settings_head_office; +#[doc(inline)] +pub use tax_product_resource_tax_settings_head_office::*; +#[doc(hidden)] +pub mod tax_product_resource_tax_settings_status_details; +#[doc(inline)] +pub use tax_product_resource_tax_settings_status_details::*; +#[doc(hidden)] +pub mod tax_product_resource_tax_settings_status_details_resource_active; +#[doc(inline)] +pub use tax_product_resource_tax_settings_status_details_resource_active::*; +#[doc(hidden)] +pub mod tax_product_resource_tax_settings_status_details_resource_pending; +#[doc(inline)] +pub use tax_product_resource_tax_settings_status_details_resource_pending::*; +#[doc(hidden)] +pub mod tax_product_resource_tax_transaction_line_item_resource_reversal; +#[doc(inline)] +pub use tax_product_resource_tax_transaction_line_item_resource_reversal::*; +#[doc(hidden)] +pub mod tax_product_resource_tax_transaction_resource_reversal; +#[doc(inline)] +pub use tax_product_resource_tax_transaction_resource_reversal::*; +#[doc(hidden)] +pub mod tax_product_resource_tax_transaction_shipping_cost; +#[doc(inline)] +pub use tax_product_resource_tax_transaction_shipping_cost::*; diff --git a/generated/stripe_misc/src/reporting_report_run/mod.rs b/generated/stripe_misc/src/reporting_report_run/mod.rs new file mode 100644 index 000000000..07ac502af --- /dev/null +++ b/generated/stripe_misc/src/reporting_report_run/mod.rs @@ -0,0 +1,5 @@ +#[cfg(feature = "reporting_report_run")] +mod requests; +pub(crate) mod types; +#[cfg(feature = "reporting_report_run")] +pub use requests::*; diff --git a/generated/stripe_misc/src/reporting_report_run/requests.rs b/generated/stripe_misc/src/reporting_report_run/requests.rs new file mode 100644 index 000000000..2cdf5e17c --- /dev/null +++ b/generated/stripe_misc/src/reporting_report_run/requests.rs @@ -0,0 +1,2123 @@ +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct ListReportingReportRun<'a> { + #[serde(skip_serializing_if = "Option::is_none")] + pub created: Option, + /// A cursor for use in pagination. + /// `ending_before` is an object ID that defines your place in the list. + /// For instance, if you make a list request and receive 100 objects, starting with `obj_bar`, your subsequent call can include `ending_before=obj_bar` in order to fetch the previous page of the list. + #[serde(skip_serializing_if = "Option::is_none")] + pub ending_before: Option<&'a str>, + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, + /// A limit on the number of objects to be returned. + /// Limit can range between 1 and 100, and the default is 10. + #[serde(skip_serializing_if = "Option::is_none")] + pub limit: Option, + /// A cursor for use in pagination. + /// `starting_after` is an object ID that defines your place in the list. + /// For instance, if you make a list request and receive 100 objects, ending with `obj_foo`, your subsequent call can include `starting_after=obj_foo` in order to fetch the next page of the list. + #[serde(skip_serializing_if = "Option::is_none")] + pub starting_after: Option<&'a str>, +} +impl<'a> ListReportingReportRun<'a> { + pub fn new() -> Self { + Self::default() + } +} +impl<'a> ListReportingReportRun<'a> { + /// Returns a list of Report Runs, with the most recent appearing first. + pub fn send( + &self, + client: &stripe::Client, + ) -> stripe::Response> { + client.get_query("/reporting/report_runs", self) + } + pub fn paginate( + self, + ) -> stripe::ListPaginator> { + stripe::ListPaginator::from_list_params("/reporting/report_runs", self) + } +} +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct RetrieveReportingReportRun<'a> { + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, +} +impl<'a> RetrieveReportingReportRun<'a> { + pub fn new() -> Self { + Self::default() + } +} +impl<'a> RetrieveReportingReportRun<'a> { + /// Retrieves the details of an existing Report Run. + pub fn send( + &self, + client: &stripe::Client, + report_run: &stripe_misc::ReportingReportRunId, + ) -> stripe::Response { + client.get_query(&format!("/reporting/report_runs/{report_run}"), self) + } +} +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreateReportingReportRun<'a> { + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, + /// Parameters specifying how the report should be run. + /// Different Report Types have different required and optional parameters, listed in the [API Access to Reports](https://stripe.com/docs/reporting/statements/api) documentation. + #[serde(skip_serializing_if = "Option::is_none")] + pub parameters: Option>, + /// The ID of the [report type](https://stripe.com/docs/reporting/statements/api#report-types) to run, such as `"balance.summary.1"`. + pub report_type: &'a str, +} +impl<'a> CreateReportingReportRun<'a> { + pub fn new(report_type: &'a str) -> Self { + Self { expand: None, parameters: None, report_type } + } +} +/// Parameters specifying how the report should be run. +/// Different Report Types have different required and optional parameters, listed in the [API Access to Reports](https://stripe.com/docs/reporting/statements/api) documentation. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreateReportingReportRunParameters<'a> { + /// The set of report columns to include in the report output. + /// If omitted, the Report Type is run with its default column set. + #[serde(skip_serializing_if = "Option::is_none")] + pub columns: Option<&'a [&'a str]>, + /// Connected account ID to filter for in the report run. + #[serde(skip_serializing_if = "Option::is_none")] + pub connected_account: Option<&'a str>, + /// Currency of objects to be included in the report run. + #[serde(skip_serializing_if = "Option::is_none")] + pub currency: Option, + /// Ending timestamp of data to be included in the report run (exclusive). + #[serde(skip_serializing_if = "Option::is_none")] + pub interval_end: Option, + /// Starting timestamp of data to be included in the report run. + #[serde(skip_serializing_if = "Option::is_none")] + pub interval_start: Option, + /// Payout ID by which to filter the report run. + #[serde(skip_serializing_if = "Option::is_none")] + pub payout: Option<&'a str>, + /// Category of balance transactions to be included in the report run. + #[serde(skip_serializing_if = "Option::is_none")] + pub reporting_category: Option, + /// Defaults to `Etc/UTC`. + /// The output timezone for all timestamps in the report. + /// A list of possible time zone values is maintained at the [IANA Time Zone Database](http://www.iana.org/time-zones). + /// Has no effect on `interval_start` or `interval_end`. + #[serde(skip_serializing_if = "Option::is_none")] + pub timezone: Option, +} +impl<'a> CreateReportingReportRunParameters<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// Category of balance transactions to be included in the report run. +#[derive(Copy, Clone, Eq, PartialEq)] +#[non_exhaustive] +pub enum CreateReportingReportRunParametersReportingCategory { + Advance, + AdvanceFunding, + AnticipationRepayment, + Charge, + ChargeFailure, + ClimateOrderPurchase, + ClimateOrderRefund, + ConnectCollectionTransfer, + ConnectReservedFunds, + Contribution, + Dispute, + DisputeReversal, + Fee, + FinancingPaydown, + FinancingPaydownReversal, + FinancingPayout, + FinancingPayoutReversal, + IssuingAuthorizationHold, + IssuingAuthorizationRelease, + IssuingDispute, + IssuingTransaction, + NetworkCost, + OtherAdjustment, + PartialCaptureReversal, + Payout, + PayoutReversal, + PlatformEarning, + PlatformEarningRefund, + Refund, + RefundFailure, + RiskReservedFunds, + Tax, + Topup, + TopupReversal, + Transfer, + TransferReversal, + UnreconciledCustomerFunds, + /// An unrecognized value from Stripe. Should not be used as a request parameter. + Unknown, +} +impl CreateReportingReportRunParametersReportingCategory { + pub fn as_str(self) -> &'static str { + use CreateReportingReportRunParametersReportingCategory::*; + match self { + Advance => "advance", + AdvanceFunding => "advance_funding", + AnticipationRepayment => "anticipation_repayment", + Charge => "charge", + ChargeFailure => "charge_failure", + ClimateOrderPurchase => "climate_order_purchase", + ClimateOrderRefund => "climate_order_refund", + ConnectCollectionTransfer => "connect_collection_transfer", + ConnectReservedFunds => "connect_reserved_funds", + Contribution => "contribution", + Dispute => "dispute", + DisputeReversal => "dispute_reversal", + Fee => "fee", + FinancingPaydown => "financing_paydown", + FinancingPaydownReversal => "financing_paydown_reversal", + FinancingPayout => "financing_payout", + FinancingPayoutReversal => "financing_payout_reversal", + IssuingAuthorizationHold => "issuing_authorization_hold", + IssuingAuthorizationRelease => "issuing_authorization_release", + IssuingDispute => "issuing_dispute", + IssuingTransaction => "issuing_transaction", + NetworkCost => "network_cost", + OtherAdjustment => "other_adjustment", + PartialCaptureReversal => "partial_capture_reversal", + Payout => "payout", + PayoutReversal => "payout_reversal", + PlatformEarning => "platform_earning", + PlatformEarningRefund => "platform_earning_refund", + Refund => "refund", + RefundFailure => "refund_failure", + RiskReservedFunds => "risk_reserved_funds", + Tax => "tax", + Topup => "topup", + TopupReversal => "topup_reversal", + Transfer => "transfer", + TransferReversal => "transfer_reversal", + UnreconciledCustomerFunds => "unreconciled_customer_funds", + Unknown => "unknown", + } + } +} + +impl std::str::FromStr for CreateReportingReportRunParametersReportingCategory { + type Err = (); + fn from_str(s: &str) -> Result { + use CreateReportingReportRunParametersReportingCategory::*; + match s { + "advance" => Ok(Advance), + "advance_funding" => Ok(AdvanceFunding), + "anticipation_repayment" => Ok(AnticipationRepayment), + "charge" => Ok(Charge), + "charge_failure" => Ok(ChargeFailure), + "climate_order_purchase" => Ok(ClimateOrderPurchase), + "climate_order_refund" => Ok(ClimateOrderRefund), + "connect_collection_transfer" => Ok(ConnectCollectionTransfer), + "connect_reserved_funds" => Ok(ConnectReservedFunds), + "contribution" => Ok(Contribution), + "dispute" => Ok(Dispute), + "dispute_reversal" => Ok(DisputeReversal), + "fee" => Ok(Fee), + "financing_paydown" => Ok(FinancingPaydown), + "financing_paydown_reversal" => Ok(FinancingPaydownReversal), + "financing_payout" => Ok(FinancingPayout), + "financing_payout_reversal" => Ok(FinancingPayoutReversal), + "issuing_authorization_hold" => Ok(IssuingAuthorizationHold), + "issuing_authorization_release" => Ok(IssuingAuthorizationRelease), + "issuing_dispute" => Ok(IssuingDispute), + "issuing_transaction" => Ok(IssuingTransaction), + "network_cost" => Ok(NetworkCost), + "other_adjustment" => Ok(OtherAdjustment), + "partial_capture_reversal" => Ok(PartialCaptureReversal), + "payout" => Ok(Payout), + "payout_reversal" => Ok(PayoutReversal), + "platform_earning" => Ok(PlatformEarning), + "platform_earning_refund" => Ok(PlatformEarningRefund), + "refund" => Ok(Refund), + "refund_failure" => Ok(RefundFailure), + "risk_reserved_funds" => Ok(RiskReservedFunds), + "tax" => Ok(Tax), + "topup" => Ok(Topup), + "topup_reversal" => Ok(TopupReversal), + "transfer" => Ok(Transfer), + "transfer_reversal" => Ok(TransferReversal), + "unreconciled_customer_funds" => Ok(UnreconciledCustomerFunds), + _ => Err(()), + } + } +} +impl std::fmt::Display for CreateReportingReportRunParametersReportingCategory { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreateReportingReportRunParametersReportingCategory { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreateReportingReportRunParametersReportingCategory { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Defaults to `Etc/UTC`. +/// The output timezone for all timestamps in the report. +/// A list of possible time zone values is maintained at the [IANA Time Zone Database](http://www.iana.org/time-zones). +/// Has no effect on `interval_start` or `interval_end`. +#[derive(Copy, Clone, Eq, PartialEq)] +#[non_exhaustive] +pub enum CreateReportingReportRunParametersTimezone { + AfricaAbidjan, + AfricaAccra, + AfricaAddisAbaba, + AfricaAlgiers, + AfricaAsmara, + AfricaAsmera, + AfricaBamako, + AfricaBangui, + AfricaBanjul, + AfricaBissau, + AfricaBlantyre, + AfricaBrazzaville, + AfricaBujumbura, + AfricaCairo, + AfricaCasablanca, + AfricaCeuta, + AfricaConakry, + AfricaDakar, + AfricaDarEsSalaam, + AfricaDjibouti, + AfricaDouala, + AfricaElAaiun, + AfricaFreetown, + AfricaGaborone, + AfricaHarare, + AfricaJohannesburg, + AfricaJuba, + AfricaKampala, + AfricaKhartoum, + AfricaKigali, + AfricaKinshasa, + AfricaLagos, + AfricaLibreville, + AfricaLome, + AfricaLuanda, + AfricaLubumbashi, + AfricaLusaka, + AfricaMalabo, + AfricaMaputo, + AfricaMaseru, + AfricaMbabane, + AfricaMogadishu, + AfricaMonrovia, + AfricaNairobi, + AfricaNdjamena, + AfricaNiamey, + AfricaNouakchott, + AfricaOuagadougou, + AfricaPortoMinusNovo, + AfricaSaoTome, + AfricaTimbuktu, + AfricaTripoli, + AfricaTunis, + AfricaWindhoek, + AmericaAdak, + AmericaAnchorage, + AmericaAnguilla, + AmericaAntigua, + AmericaAraguaina, + AmericaArgentinaBuenosAires, + AmericaArgentinaCatamarca, + AmericaArgentinaComodRivadavia, + AmericaArgentinaCordoba, + AmericaArgentinaJujuy, + AmericaArgentinaLaRioja, + AmericaArgentinaMendoza, + AmericaArgentinaRioGallegos, + AmericaArgentinaSalta, + AmericaArgentinaSanJuan, + AmericaArgentinaSanLuis, + AmericaArgentinaTucuman, + AmericaArgentinaUshuaia, + AmericaAruba, + AmericaAsuncion, + AmericaAtikokan, + AmericaAtka, + AmericaBahia, + AmericaBahiaBanderas, + AmericaBarbados, + AmericaBelem, + AmericaBelize, + AmericaBlancMinusSablon, + AmericaBoaVista, + AmericaBogota, + AmericaBoise, + AmericaBuenosAires, + AmericaCambridgeBay, + AmericaCampoGrande, + AmericaCancun, + AmericaCaracas, + AmericaCatamarca, + AmericaCayenne, + AmericaCayman, + AmericaChicago, + AmericaChihuahua, + AmericaCiudadJuarez, + AmericaCoralHarbour, + AmericaCordoba, + AmericaCostaRica, + AmericaCreston, + AmericaCuiaba, + AmericaCuracao, + AmericaDanmarkshavn, + AmericaDawson, + AmericaDawsonCreek, + AmericaDenver, + AmericaDetroit, + AmericaDominica, + AmericaEdmonton, + AmericaEirunepe, + AmericaElSalvador, + AmericaEnsenada, + AmericaFortNelson, + AmericaFortWayne, + AmericaFortaleza, + AmericaGlaceBay, + AmericaGodthab, + AmericaGooseBay, + AmericaGrandTurk, + AmericaGrenada, + AmericaGuadeloupe, + AmericaGuatemala, + AmericaGuayaquil, + AmericaGuyana, + AmericaHalifax, + AmericaHavana, + AmericaHermosillo, + AmericaIndianaIndianapolis, + AmericaIndianaKnox, + AmericaIndianaMarengo, + AmericaIndianaPetersburg, + AmericaIndianaTellCity, + AmericaIndianaVevay, + AmericaIndianaVincennes, + AmericaIndianaWinamac, + AmericaIndianapolis, + AmericaInuvik, + AmericaIqaluit, + AmericaJamaica, + AmericaJujuy, + AmericaJuneau, + AmericaKentuckyLouisville, + AmericaKentuckyMonticello, + AmericaKnoxIn, + AmericaKralendijk, + AmericaLaPaz, + AmericaLima, + AmericaLosAngeles, + AmericaLouisville, + AmericaLowerPrinces, + AmericaMaceio, + AmericaManagua, + AmericaManaus, + AmericaMarigot, + AmericaMartinique, + AmericaMatamoros, + AmericaMazatlan, + AmericaMendoza, + AmericaMenominee, + AmericaMerida, + AmericaMetlakatla, + AmericaMexicoCity, + AmericaMiquelon, + AmericaMoncton, + AmericaMonterrey, + AmericaMontevideo, + AmericaMontreal, + AmericaMontserrat, + AmericaNassau, + AmericaNewYork, + AmericaNipigon, + AmericaNome, + AmericaNoronha, + AmericaNorthDakotaBeulah, + AmericaNorthDakotaCenter, + AmericaNorthDakotaNewSalem, + AmericaNuuk, + AmericaOjinaga, + AmericaPanama, + AmericaPangnirtung, + AmericaParamaribo, + AmericaPhoenix, + AmericaPortMinusauMinusPrince, + AmericaPortOfSpain, + AmericaPortoAcre, + AmericaPortoVelho, + AmericaPuertoRico, + AmericaPuntaArenas, + AmericaRainyRiver, + AmericaRankinInlet, + AmericaRecife, + AmericaRegina, + AmericaResolute, + AmericaRioBranco, + AmericaRosario, + AmericaSantaIsabel, + AmericaSantarem, + AmericaSantiago, + AmericaSantoDomingo, + AmericaSaoPaulo, + AmericaScoresbysund, + AmericaShiprock, + AmericaSitka, + AmericaStBarthelemy, + AmericaStJohns, + AmericaStKitts, + AmericaStLucia, + AmericaStThomas, + AmericaStVincent, + AmericaSwiftCurrent, + AmericaTegucigalpa, + AmericaThule, + AmericaThunderBay, + AmericaTijuana, + AmericaToronto, + AmericaTortola, + AmericaVancouver, + AmericaVirgin, + AmericaWhitehorse, + AmericaWinnipeg, + AmericaYakutat, + AmericaYellowknife, + AntarcticaCasey, + AntarcticaDavis, + AntarcticaDumontDUrville, + AntarcticaMacquarie, + AntarcticaMawson, + AntarcticaMcMurdo, + AntarcticaPalmer, + AntarcticaRothera, + AntarcticaSouthPole, + AntarcticaSyowa, + AntarcticaTroll, + AntarcticaVostok, + ArcticLongyearbyen, + AsiaAden, + AsiaAlmaty, + AsiaAmman, + AsiaAnadyr, + AsiaAqtau, + AsiaAqtobe, + AsiaAshgabat, + AsiaAshkhabad, + AsiaAtyrau, + AsiaBaghdad, + AsiaBahrain, + AsiaBaku, + AsiaBangkok, + AsiaBarnaul, + AsiaBeirut, + AsiaBishkek, + AsiaBrunei, + AsiaCalcutta, + AsiaChita, + AsiaChoibalsan, + AsiaChongqing, + AsiaChungking, + AsiaColombo, + AsiaDacca, + AsiaDamascus, + AsiaDhaka, + AsiaDili, + AsiaDubai, + AsiaDushanbe, + AsiaFamagusta, + AsiaGaza, + AsiaHarbin, + AsiaHebron, + AsiaHoChiMinh, + AsiaHongKong, + AsiaHovd, + AsiaIrkutsk, + AsiaIstanbul, + AsiaJakarta, + AsiaJayapura, + AsiaJerusalem, + AsiaKabul, + AsiaKamchatka, + AsiaKarachi, + AsiaKashgar, + AsiaKathmandu, + AsiaKatmandu, + AsiaKhandyga, + AsiaKolkata, + AsiaKrasnoyarsk, + AsiaKualaLumpur, + AsiaKuching, + AsiaKuwait, + AsiaMacao, + AsiaMacau, + AsiaMagadan, + AsiaMakassar, + AsiaManila, + AsiaMuscat, + AsiaNicosia, + AsiaNovokuznetsk, + AsiaNovosibirsk, + AsiaOmsk, + AsiaOral, + AsiaPhnomPenh, + AsiaPontianak, + AsiaPyongyang, + AsiaQatar, + AsiaQostanay, + AsiaQyzylorda, + AsiaRangoon, + AsiaRiyadh, + AsiaSaigon, + AsiaSakhalin, + AsiaSamarkand, + AsiaSeoul, + AsiaShanghai, + AsiaSingapore, + AsiaSrednekolymsk, + AsiaTaipei, + AsiaTashkent, + AsiaTbilisi, + AsiaTehran, + AsiaTelAviv, + AsiaThimbu, + AsiaThimphu, + AsiaTokyo, + AsiaTomsk, + AsiaUjungPandang, + AsiaUlaanbaatar, + AsiaUlanBator, + AsiaUrumqi, + AsiaUstMinusNera, + AsiaVientiane, + AsiaVladivostok, + AsiaYakutsk, + AsiaYangon, + AsiaYekaterinburg, + AsiaYerevan, + AtlanticAzores, + AtlanticBermuda, + AtlanticCanary, + AtlanticCapeVerde, + AtlanticFaeroe, + AtlanticFaroe, + AtlanticJanMayen, + AtlanticMadeira, + AtlanticReykjavik, + AtlanticSouthGeorgia, + AtlanticStHelena, + AtlanticStanley, + AustraliaAct, + AustraliaAdelaide, + AustraliaBrisbane, + AustraliaBrokenHill, + AustraliaCanberra, + AustraliaCurrie, + AustraliaDarwin, + AustraliaEucla, + AustraliaHobart, + AustraliaLhi, + AustraliaLindeman, + AustraliaLordHowe, + AustraliaMelbourne, + AustraliaNsw, + AustraliaNorth, + AustraliaPerth, + AustraliaQueensland, + AustraliaSouth, + AustraliaSydney, + AustraliaTasmania, + AustraliaVictoria, + AustraliaWest, + AustraliaYancowinna, + BrazilAcre, + BrazilDeNoronha, + BrazilEast, + BrazilWest, + Cet, + Cst6cdt, + CanadaAtlantic, + CanadaCentral, + CanadaEastern, + CanadaMountain, + CanadaNewfoundland, + CanadaPacific, + CanadaSaskatchewan, + CanadaYukon, + ChileContinental, + ChileEasterIsland, + Cuba, + Eet, + Est, + Est5edt, + Egypt, + Eire, + EtcGmt, + EtcGmtPlus0, + EtcGmtPlus1, + EtcGmtPlus10, + EtcGmtPlus11, + EtcGmtPlus12, + EtcGmtPlus2, + EtcGmtPlus3, + EtcGmtPlus4, + EtcGmtPlus5, + EtcGmtPlus6, + EtcGmtPlus7, + EtcGmtPlus8, + EtcGmtPlus9, + EtcGmtMinus0, + EtcGmtMinus1, + EtcGmtMinus10, + EtcGmtMinus11, + EtcGmtMinus12, + EtcGmtMinus13, + EtcGmtMinus14, + EtcGmtMinus2, + EtcGmtMinus3, + EtcGmtMinus4, + EtcGmtMinus5, + EtcGmtMinus6, + EtcGmtMinus7, + EtcGmtMinus8, + EtcGmtMinus9, + EtcGmt0, + EtcGreenwich, + EtcUct, + EtcUtc, + EtcUniversal, + EtcZulu, + EuropeAmsterdam, + EuropeAndorra, + EuropeAstrakhan, + EuropeAthens, + EuropeBelfast, + EuropeBelgrade, + EuropeBerlin, + EuropeBratislava, + EuropeBrussels, + EuropeBucharest, + EuropeBudapest, + EuropeBusingen, + EuropeChisinau, + EuropeCopenhagen, + EuropeDublin, + EuropeGibraltar, + EuropeGuernsey, + EuropeHelsinki, + EuropeIsleOfMan, + EuropeIstanbul, + EuropeJersey, + EuropeKaliningrad, + EuropeKiev, + EuropeKirov, + EuropeKyiv, + EuropeLisbon, + EuropeLjubljana, + EuropeLondon, + EuropeLuxembourg, + EuropeMadrid, + EuropeMalta, + EuropeMariehamn, + EuropeMinsk, + EuropeMonaco, + EuropeMoscow, + EuropeNicosia, + EuropeOslo, + EuropeParis, + EuropePodgorica, + EuropePrague, + EuropeRiga, + EuropeRome, + EuropeSamara, + EuropeSanMarino, + EuropeSarajevo, + EuropeSaratov, + EuropeSimferopol, + EuropeSkopje, + EuropeSofia, + EuropeStockholm, + EuropeTallinn, + EuropeTirane, + EuropeTiraspol, + EuropeUlyanovsk, + EuropeUzhgorod, + EuropeVaduz, + EuropeVatican, + EuropeVienna, + EuropeVilnius, + EuropeVolgograd, + EuropeWarsaw, + EuropeZagreb, + EuropeZaporozhye, + EuropeZurich, + Factory, + Gb, + GbMinusEire, + Gmt, + GmtPlus0, + GmtMinus0, + Gmt0, + Greenwich, + Hst, + Hongkong, + Iceland, + IndianAntananarivo, + IndianChagos, + IndianChristmas, + IndianCocos, + IndianComoro, + IndianKerguelen, + IndianMahe, + IndianMaldives, + IndianMauritius, + IndianMayotte, + IndianReunion, + Iran, + Israel, + Jamaica, + Japan, + Kwajalein, + Libya, + Met, + Mst, + Mst7mdt, + MexicoBajaNorte, + MexicoBajaSur, + MexicoGeneral, + Nz, + NzMinusChat, + Navajo, + Prc, + Pst8pdt, + PacificApia, + PacificAuckland, + PacificBougainville, + PacificChatham, + PacificChuuk, + PacificEaster, + PacificEfate, + PacificEnderbury, + PacificFakaofo, + PacificFiji, + PacificFunafuti, + PacificGalapagos, + PacificGambier, + PacificGuadalcanal, + PacificGuam, + PacificHonolulu, + PacificJohnston, + PacificKanton, + PacificKiritimati, + PacificKosrae, + PacificKwajalein, + PacificMajuro, + PacificMarquesas, + PacificMidway, + PacificNauru, + PacificNiue, + PacificNorfolk, + PacificNoumea, + PacificPagoPago, + PacificPalau, + PacificPitcairn, + PacificPohnpei, + PacificPonape, + PacificPortMoresby, + PacificRarotonga, + PacificSaipan, + PacificSamoa, + PacificTahiti, + PacificTarawa, + PacificTongatapu, + PacificTruk, + PacificWake, + PacificWallis, + PacificYap, + Poland, + Portugal, + Roc, + Rok, + Singapore, + Turkey, + Uct, + UsAlaska, + UsAleutian, + UsArizona, + UsCentral, + UsEastMinusIndiana, + UsEastern, + UsHawaii, + UsIndianaMinusStarke, + UsMichigan, + UsMountain, + UsPacific, + UsPacificMinusNew, + UsSamoa, + Utc, + Universal, + WMinusSu, + Wet, + Zulu, + /// An unrecognized value from Stripe. Should not be used as a request parameter. + Unknown, +} +impl CreateReportingReportRunParametersTimezone { + pub fn as_str(self) -> &'static str { + use CreateReportingReportRunParametersTimezone::*; + match self { + AfricaAbidjan => "Africa/Abidjan", + AfricaAccra => "Africa/Accra", + AfricaAddisAbaba => "Africa/Addis_Ababa", + AfricaAlgiers => "Africa/Algiers", + AfricaAsmara => "Africa/Asmara", + AfricaAsmera => "Africa/Asmera", + AfricaBamako => "Africa/Bamako", + AfricaBangui => "Africa/Bangui", + AfricaBanjul => "Africa/Banjul", + AfricaBissau => "Africa/Bissau", + AfricaBlantyre => "Africa/Blantyre", + AfricaBrazzaville => "Africa/Brazzaville", + AfricaBujumbura => "Africa/Bujumbura", + AfricaCairo => "Africa/Cairo", + AfricaCasablanca => "Africa/Casablanca", + AfricaCeuta => "Africa/Ceuta", + AfricaConakry => "Africa/Conakry", + AfricaDakar => "Africa/Dakar", + AfricaDarEsSalaam => "Africa/Dar_es_Salaam", + AfricaDjibouti => "Africa/Djibouti", + AfricaDouala => "Africa/Douala", + AfricaElAaiun => "Africa/El_Aaiun", + AfricaFreetown => "Africa/Freetown", + AfricaGaborone => "Africa/Gaborone", + AfricaHarare => "Africa/Harare", + AfricaJohannesburg => "Africa/Johannesburg", + AfricaJuba => "Africa/Juba", + AfricaKampala => "Africa/Kampala", + AfricaKhartoum => "Africa/Khartoum", + AfricaKigali => "Africa/Kigali", + AfricaKinshasa => "Africa/Kinshasa", + AfricaLagos => "Africa/Lagos", + AfricaLibreville => "Africa/Libreville", + AfricaLome => "Africa/Lome", + AfricaLuanda => "Africa/Luanda", + AfricaLubumbashi => "Africa/Lubumbashi", + AfricaLusaka => "Africa/Lusaka", + AfricaMalabo => "Africa/Malabo", + AfricaMaputo => "Africa/Maputo", + AfricaMaseru => "Africa/Maseru", + AfricaMbabane => "Africa/Mbabane", + AfricaMogadishu => "Africa/Mogadishu", + AfricaMonrovia => "Africa/Monrovia", + AfricaNairobi => "Africa/Nairobi", + AfricaNdjamena => "Africa/Ndjamena", + AfricaNiamey => "Africa/Niamey", + AfricaNouakchott => "Africa/Nouakchott", + AfricaOuagadougou => "Africa/Ouagadougou", + AfricaPortoMinusNovo => "Africa/Porto-Novo", + AfricaSaoTome => "Africa/Sao_Tome", + AfricaTimbuktu => "Africa/Timbuktu", + AfricaTripoli => "Africa/Tripoli", + AfricaTunis => "Africa/Tunis", + AfricaWindhoek => "Africa/Windhoek", + AmericaAdak => "America/Adak", + AmericaAnchorage => "America/Anchorage", + AmericaAnguilla => "America/Anguilla", + AmericaAntigua => "America/Antigua", + AmericaAraguaina => "America/Araguaina", + AmericaArgentinaBuenosAires => "America/Argentina/Buenos_Aires", + AmericaArgentinaCatamarca => "America/Argentina/Catamarca", + AmericaArgentinaComodRivadavia => "America/Argentina/ComodRivadavia", + AmericaArgentinaCordoba => "America/Argentina/Cordoba", + AmericaArgentinaJujuy => "America/Argentina/Jujuy", + AmericaArgentinaLaRioja => "America/Argentina/La_Rioja", + AmericaArgentinaMendoza => "America/Argentina/Mendoza", + AmericaArgentinaRioGallegos => "America/Argentina/Rio_Gallegos", + AmericaArgentinaSalta => "America/Argentina/Salta", + AmericaArgentinaSanJuan => "America/Argentina/San_Juan", + AmericaArgentinaSanLuis => "America/Argentina/San_Luis", + AmericaArgentinaTucuman => "America/Argentina/Tucuman", + AmericaArgentinaUshuaia => "America/Argentina/Ushuaia", + AmericaAruba => "America/Aruba", + AmericaAsuncion => "America/Asuncion", + AmericaAtikokan => "America/Atikokan", + AmericaAtka => "America/Atka", + AmericaBahia => "America/Bahia", + AmericaBahiaBanderas => "America/Bahia_Banderas", + AmericaBarbados => "America/Barbados", + AmericaBelem => "America/Belem", + AmericaBelize => "America/Belize", + AmericaBlancMinusSablon => "America/Blanc-Sablon", + AmericaBoaVista => "America/Boa_Vista", + AmericaBogota => "America/Bogota", + AmericaBoise => "America/Boise", + AmericaBuenosAires => "America/Buenos_Aires", + AmericaCambridgeBay => "America/Cambridge_Bay", + AmericaCampoGrande => "America/Campo_Grande", + AmericaCancun => "America/Cancun", + AmericaCaracas => "America/Caracas", + AmericaCatamarca => "America/Catamarca", + AmericaCayenne => "America/Cayenne", + AmericaCayman => "America/Cayman", + AmericaChicago => "America/Chicago", + AmericaChihuahua => "America/Chihuahua", + AmericaCiudadJuarez => "America/Ciudad_Juarez", + AmericaCoralHarbour => "America/Coral_Harbour", + AmericaCordoba => "America/Cordoba", + AmericaCostaRica => "America/Costa_Rica", + AmericaCreston => "America/Creston", + AmericaCuiaba => "America/Cuiaba", + AmericaCuracao => "America/Curacao", + AmericaDanmarkshavn => "America/Danmarkshavn", + AmericaDawson => "America/Dawson", + AmericaDawsonCreek => "America/Dawson_Creek", + AmericaDenver => "America/Denver", + AmericaDetroit => "America/Detroit", + AmericaDominica => "America/Dominica", + AmericaEdmonton => "America/Edmonton", + AmericaEirunepe => "America/Eirunepe", + AmericaElSalvador => "America/El_Salvador", + AmericaEnsenada => "America/Ensenada", + AmericaFortNelson => "America/Fort_Nelson", + AmericaFortWayne => "America/Fort_Wayne", + AmericaFortaleza => "America/Fortaleza", + AmericaGlaceBay => "America/Glace_Bay", + AmericaGodthab => "America/Godthab", + AmericaGooseBay => "America/Goose_Bay", + AmericaGrandTurk => "America/Grand_Turk", + AmericaGrenada => "America/Grenada", + AmericaGuadeloupe => "America/Guadeloupe", + AmericaGuatemala => "America/Guatemala", + AmericaGuayaquil => "America/Guayaquil", + AmericaGuyana => "America/Guyana", + AmericaHalifax => "America/Halifax", + AmericaHavana => "America/Havana", + AmericaHermosillo => "America/Hermosillo", + AmericaIndianaIndianapolis => "America/Indiana/Indianapolis", + AmericaIndianaKnox => "America/Indiana/Knox", + AmericaIndianaMarengo => "America/Indiana/Marengo", + AmericaIndianaPetersburg => "America/Indiana/Petersburg", + AmericaIndianaTellCity => "America/Indiana/Tell_City", + AmericaIndianaVevay => "America/Indiana/Vevay", + AmericaIndianaVincennes => "America/Indiana/Vincennes", + AmericaIndianaWinamac => "America/Indiana/Winamac", + AmericaIndianapolis => "America/Indianapolis", + AmericaInuvik => "America/Inuvik", + AmericaIqaluit => "America/Iqaluit", + AmericaJamaica => "America/Jamaica", + AmericaJujuy => "America/Jujuy", + AmericaJuneau => "America/Juneau", + AmericaKentuckyLouisville => "America/Kentucky/Louisville", + AmericaKentuckyMonticello => "America/Kentucky/Monticello", + AmericaKnoxIn => "America/Knox_IN", + AmericaKralendijk => "America/Kralendijk", + AmericaLaPaz => "America/La_Paz", + AmericaLima => "America/Lima", + AmericaLosAngeles => "America/Los_Angeles", + AmericaLouisville => "America/Louisville", + AmericaLowerPrinces => "America/Lower_Princes", + AmericaMaceio => "America/Maceio", + AmericaManagua => "America/Managua", + AmericaManaus => "America/Manaus", + AmericaMarigot => "America/Marigot", + AmericaMartinique => "America/Martinique", + AmericaMatamoros => "America/Matamoros", + AmericaMazatlan => "America/Mazatlan", + AmericaMendoza => "America/Mendoza", + AmericaMenominee => "America/Menominee", + AmericaMerida => "America/Merida", + AmericaMetlakatla => "America/Metlakatla", + AmericaMexicoCity => "America/Mexico_City", + AmericaMiquelon => "America/Miquelon", + AmericaMoncton => "America/Moncton", + AmericaMonterrey => "America/Monterrey", + AmericaMontevideo => "America/Montevideo", + AmericaMontreal => "America/Montreal", + AmericaMontserrat => "America/Montserrat", + AmericaNassau => "America/Nassau", + AmericaNewYork => "America/New_York", + AmericaNipigon => "America/Nipigon", + AmericaNome => "America/Nome", + AmericaNoronha => "America/Noronha", + AmericaNorthDakotaBeulah => "America/North_Dakota/Beulah", + AmericaNorthDakotaCenter => "America/North_Dakota/Center", + AmericaNorthDakotaNewSalem => "America/North_Dakota/New_Salem", + AmericaNuuk => "America/Nuuk", + AmericaOjinaga => "America/Ojinaga", + AmericaPanama => "America/Panama", + AmericaPangnirtung => "America/Pangnirtung", + AmericaParamaribo => "America/Paramaribo", + AmericaPhoenix => "America/Phoenix", + AmericaPortMinusauMinusPrince => "America/Port-au-Prince", + AmericaPortOfSpain => "America/Port_of_Spain", + AmericaPortoAcre => "America/Porto_Acre", + AmericaPortoVelho => "America/Porto_Velho", + AmericaPuertoRico => "America/Puerto_Rico", + AmericaPuntaArenas => "America/Punta_Arenas", + AmericaRainyRiver => "America/Rainy_River", + AmericaRankinInlet => "America/Rankin_Inlet", + AmericaRecife => "America/Recife", + AmericaRegina => "America/Regina", + AmericaResolute => "America/Resolute", + AmericaRioBranco => "America/Rio_Branco", + AmericaRosario => "America/Rosario", + AmericaSantaIsabel => "America/Santa_Isabel", + AmericaSantarem => "America/Santarem", + AmericaSantiago => "America/Santiago", + AmericaSantoDomingo => "America/Santo_Domingo", + AmericaSaoPaulo => "America/Sao_Paulo", + AmericaScoresbysund => "America/Scoresbysund", + AmericaShiprock => "America/Shiprock", + AmericaSitka => "America/Sitka", + AmericaStBarthelemy => "America/St_Barthelemy", + AmericaStJohns => "America/St_Johns", + AmericaStKitts => "America/St_Kitts", + AmericaStLucia => "America/St_Lucia", + AmericaStThomas => "America/St_Thomas", + AmericaStVincent => "America/St_Vincent", + AmericaSwiftCurrent => "America/Swift_Current", + AmericaTegucigalpa => "America/Tegucigalpa", + AmericaThule => "America/Thule", + AmericaThunderBay => "America/Thunder_Bay", + AmericaTijuana => "America/Tijuana", + AmericaToronto => "America/Toronto", + AmericaTortola => "America/Tortola", + AmericaVancouver => "America/Vancouver", + AmericaVirgin => "America/Virgin", + AmericaWhitehorse => "America/Whitehorse", + AmericaWinnipeg => "America/Winnipeg", + AmericaYakutat => "America/Yakutat", + AmericaYellowknife => "America/Yellowknife", + AntarcticaCasey => "Antarctica/Casey", + AntarcticaDavis => "Antarctica/Davis", + AntarcticaDumontDUrville => "Antarctica/DumontDUrville", + AntarcticaMacquarie => "Antarctica/Macquarie", + AntarcticaMawson => "Antarctica/Mawson", + AntarcticaMcMurdo => "Antarctica/McMurdo", + AntarcticaPalmer => "Antarctica/Palmer", + AntarcticaRothera => "Antarctica/Rothera", + AntarcticaSouthPole => "Antarctica/South_Pole", + AntarcticaSyowa => "Antarctica/Syowa", + AntarcticaTroll => "Antarctica/Troll", + AntarcticaVostok => "Antarctica/Vostok", + ArcticLongyearbyen => "Arctic/Longyearbyen", + AsiaAden => "Asia/Aden", + AsiaAlmaty => "Asia/Almaty", + AsiaAmman => "Asia/Amman", + AsiaAnadyr => "Asia/Anadyr", + AsiaAqtau => "Asia/Aqtau", + AsiaAqtobe => "Asia/Aqtobe", + AsiaAshgabat => "Asia/Ashgabat", + AsiaAshkhabad => "Asia/Ashkhabad", + AsiaAtyrau => "Asia/Atyrau", + AsiaBaghdad => "Asia/Baghdad", + AsiaBahrain => "Asia/Bahrain", + AsiaBaku => "Asia/Baku", + AsiaBangkok => "Asia/Bangkok", + AsiaBarnaul => "Asia/Barnaul", + AsiaBeirut => "Asia/Beirut", + AsiaBishkek => "Asia/Bishkek", + AsiaBrunei => "Asia/Brunei", + AsiaCalcutta => "Asia/Calcutta", + AsiaChita => "Asia/Chita", + AsiaChoibalsan => "Asia/Choibalsan", + AsiaChongqing => "Asia/Chongqing", + AsiaChungking => "Asia/Chungking", + AsiaColombo => "Asia/Colombo", + AsiaDacca => "Asia/Dacca", + AsiaDamascus => "Asia/Damascus", + AsiaDhaka => "Asia/Dhaka", + AsiaDili => "Asia/Dili", + AsiaDubai => "Asia/Dubai", + AsiaDushanbe => "Asia/Dushanbe", + AsiaFamagusta => "Asia/Famagusta", + AsiaGaza => "Asia/Gaza", + AsiaHarbin => "Asia/Harbin", + AsiaHebron => "Asia/Hebron", + AsiaHoChiMinh => "Asia/Ho_Chi_Minh", + AsiaHongKong => "Asia/Hong_Kong", + AsiaHovd => "Asia/Hovd", + AsiaIrkutsk => "Asia/Irkutsk", + AsiaIstanbul => "Asia/Istanbul", + AsiaJakarta => "Asia/Jakarta", + AsiaJayapura => "Asia/Jayapura", + AsiaJerusalem => "Asia/Jerusalem", + AsiaKabul => "Asia/Kabul", + AsiaKamchatka => "Asia/Kamchatka", + AsiaKarachi => "Asia/Karachi", + AsiaKashgar => "Asia/Kashgar", + AsiaKathmandu => "Asia/Kathmandu", + AsiaKatmandu => "Asia/Katmandu", + AsiaKhandyga => "Asia/Khandyga", + AsiaKolkata => "Asia/Kolkata", + AsiaKrasnoyarsk => "Asia/Krasnoyarsk", + AsiaKualaLumpur => "Asia/Kuala_Lumpur", + AsiaKuching => "Asia/Kuching", + AsiaKuwait => "Asia/Kuwait", + AsiaMacao => "Asia/Macao", + AsiaMacau => "Asia/Macau", + AsiaMagadan => "Asia/Magadan", + AsiaMakassar => "Asia/Makassar", + AsiaManila => "Asia/Manila", + AsiaMuscat => "Asia/Muscat", + AsiaNicosia => "Asia/Nicosia", + AsiaNovokuznetsk => "Asia/Novokuznetsk", + AsiaNovosibirsk => "Asia/Novosibirsk", + AsiaOmsk => "Asia/Omsk", + AsiaOral => "Asia/Oral", + AsiaPhnomPenh => "Asia/Phnom_Penh", + AsiaPontianak => "Asia/Pontianak", + AsiaPyongyang => "Asia/Pyongyang", + AsiaQatar => "Asia/Qatar", + AsiaQostanay => "Asia/Qostanay", + AsiaQyzylorda => "Asia/Qyzylorda", + AsiaRangoon => "Asia/Rangoon", + AsiaRiyadh => "Asia/Riyadh", + AsiaSaigon => "Asia/Saigon", + AsiaSakhalin => "Asia/Sakhalin", + AsiaSamarkand => "Asia/Samarkand", + AsiaSeoul => "Asia/Seoul", + AsiaShanghai => "Asia/Shanghai", + AsiaSingapore => "Asia/Singapore", + AsiaSrednekolymsk => "Asia/Srednekolymsk", + AsiaTaipei => "Asia/Taipei", + AsiaTashkent => "Asia/Tashkent", + AsiaTbilisi => "Asia/Tbilisi", + AsiaTehran => "Asia/Tehran", + AsiaTelAviv => "Asia/Tel_Aviv", + AsiaThimbu => "Asia/Thimbu", + AsiaThimphu => "Asia/Thimphu", + AsiaTokyo => "Asia/Tokyo", + AsiaTomsk => "Asia/Tomsk", + AsiaUjungPandang => "Asia/Ujung_Pandang", + AsiaUlaanbaatar => "Asia/Ulaanbaatar", + AsiaUlanBator => "Asia/Ulan_Bator", + AsiaUrumqi => "Asia/Urumqi", + AsiaUstMinusNera => "Asia/Ust-Nera", + AsiaVientiane => "Asia/Vientiane", + AsiaVladivostok => "Asia/Vladivostok", + AsiaYakutsk => "Asia/Yakutsk", + AsiaYangon => "Asia/Yangon", + AsiaYekaterinburg => "Asia/Yekaterinburg", + AsiaYerevan => "Asia/Yerevan", + AtlanticAzores => "Atlantic/Azores", + AtlanticBermuda => "Atlantic/Bermuda", + AtlanticCanary => "Atlantic/Canary", + AtlanticCapeVerde => "Atlantic/Cape_Verde", + AtlanticFaeroe => "Atlantic/Faeroe", + AtlanticFaroe => "Atlantic/Faroe", + AtlanticJanMayen => "Atlantic/Jan_Mayen", + AtlanticMadeira => "Atlantic/Madeira", + AtlanticReykjavik => "Atlantic/Reykjavik", + AtlanticSouthGeorgia => "Atlantic/South_Georgia", + AtlanticStHelena => "Atlantic/St_Helena", + AtlanticStanley => "Atlantic/Stanley", + AustraliaAct => "Australia/ACT", + AustraliaAdelaide => "Australia/Adelaide", + AustraliaBrisbane => "Australia/Brisbane", + AustraliaBrokenHill => "Australia/Broken_Hill", + AustraliaCanberra => "Australia/Canberra", + AustraliaCurrie => "Australia/Currie", + AustraliaDarwin => "Australia/Darwin", + AustraliaEucla => "Australia/Eucla", + AustraliaHobart => "Australia/Hobart", + AustraliaLhi => "Australia/LHI", + AustraliaLindeman => "Australia/Lindeman", + AustraliaLordHowe => "Australia/Lord_Howe", + AustraliaMelbourne => "Australia/Melbourne", + AustraliaNsw => "Australia/NSW", + AustraliaNorth => "Australia/North", + AustraliaPerth => "Australia/Perth", + AustraliaQueensland => "Australia/Queensland", + AustraliaSouth => "Australia/South", + AustraliaSydney => "Australia/Sydney", + AustraliaTasmania => "Australia/Tasmania", + AustraliaVictoria => "Australia/Victoria", + AustraliaWest => "Australia/West", + AustraliaYancowinna => "Australia/Yancowinna", + BrazilAcre => "Brazil/Acre", + BrazilDeNoronha => "Brazil/DeNoronha", + BrazilEast => "Brazil/East", + BrazilWest => "Brazil/West", + Cet => "CET", + Cst6cdt => "CST6CDT", + CanadaAtlantic => "Canada/Atlantic", + CanadaCentral => "Canada/Central", + CanadaEastern => "Canada/Eastern", + CanadaMountain => "Canada/Mountain", + CanadaNewfoundland => "Canada/Newfoundland", + CanadaPacific => "Canada/Pacific", + CanadaSaskatchewan => "Canada/Saskatchewan", + CanadaYukon => "Canada/Yukon", + ChileContinental => "Chile/Continental", + ChileEasterIsland => "Chile/EasterIsland", + Cuba => "Cuba", + Eet => "EET", + Est => "EST", + Est5edt => "EST5EDT", + Egypt => "Egypt", + Eire => "Eire", + EtcGmt => "Etc/GMT", + EtcGmtPlus0 => "Etc/GMT+0", + EtcGmtPlus1 => "Etc/GMT+1", + EtcGmtPlus10 => "Etc/GMT+10", + EtcGmtPlus11 => "Etc/GMT+11", + EtcGmtPlus12 => "Etc/GMT+12", + EtcGmtPlus2 => "Etc/GMT+2", + EtcGmtPlus3 => "Etc/GMT+3", + EtcGmtPlus4 => "Etc/GMT+4", + EtcGmtPlus5 => "Etc/GMT+5", + EtcGmtPlus6 => "Etc/GMT+6", + EtcGmtPlus7 => "Etc/GMT+7", + EtcGmtPlus8 => "Etc/GMT+8", + EtcGmtPlus9 => "Etc/GMT+9", + EtcGmtMinus0 => "Etc/GMT-0", + EtcGmtMinus1 => "Etc/GMT-1", + EtcGmtMinus10 => "Etc/GMT-10", + EtcGmtMinus11 => "Etc/GMT-11", + EtcGmtMinus12 => "Etc/GMT-12", + EtcGmtMinus13 => "Etc/GMT-13", + EtcGmtMinus14 => "Etc/GMT-14", + EtcGmtMinus2 => "Etc/GMT-2", + EtcGmtMinus3 => "Etc/GMT-3", + EtcGmtMinus4 => "Etc/GMT-4", + EtcGmtMinus5 => "Etc/GMT-5", + EtcGmtMinus6 => "Etc/GMT-6", + EtcGmtMinus7 => "Etc/GMT-7", + EtcGmtMinus8 => "Etc/GMT-8", + EtcGmtMinus9 => "Etc/GMT-9", + EtcGmt0 => "Etc/GMT0", + EtcGreenwich => "Etc/Greenwich", + EtcUct => "Etc/UCT", + EtcUtc => "Etc/UTC", + EtcUniversal => "Etc/Universal", + EtcZulu => "Etc/Zulu", + EuropeAmsterdam => "Europe/Amsterdam", + EuropeAndorra => "Europe/Andorra", + EuropeAstrakhan => "Europe/Astrakhan", + EuropeAthens => "Europe/Athens", + EuropeBelfast => "Europe/Belfast", + EuropeBelgrade => "Europe/Belgrade", + EuropeBerlin => "Europe/Berlin", + EuropeBratislava => "Europe/Bratislava", + EuropeBrussels => "Europe/Brussels", + EuropeBucharest => "Europe/Bucharest", + EuropeBudapest => "Europe/Budapest", + EuropeBusingen => "Europe/Busingen", + EuropeChisinau => "Europe/Chisinau", + EuropeCopenhagen => "Europe/Copenhagen", + EuropeDublin => "Europe/Dublin", + EuropeGibraltar => "Europe/Gibraltar", + EuropeGuernsey => "Europe/Guernsey", + EuropeHelsinki => "Europe/Helsinki", + EuropeIsleOfMan => "Europe/Isle_of_Man", + EuropeIstanbul => "Europe/Istanbul", + EuropeJersey => "Europe/Jersey", + EuropeKaliningrad => "Europe/Kaliningrad", + EuropeKiev => "Europe/Kiev", + EuropeKirov => "Europe/Kirov", + EuropeKyiv => "Europe/Kyiv", + EuropeLisbon => "Europe/Lisbon", + EuropeLjubljana => "Europe/Ljubljana", + EuropeLondon => "Europe/London", + EuropeLuxembourg => "Europe/Luxembourg", + EuropeMadrid => "Europe/Madrid", + EuropeMalta => "Europe/Malta", + EuropeMariehamn => "Europe/Mariehamn", + EuropeMinsk => "Europe/Minsk", + EuropeMonaco => "Europe/Monaco", + EuropeMoscow => "Europe/Moscow", + EuropeNicosia => "Europe/Nicosia", + EuropeOslo => "Europe/Oslo", + EuropeParis => "Europe/Paris", + EuropePodgorica => "Europe/Podgorica", + EuropePrague => "Europe/Prague", + EuropeRiga => "Europe/Riga", + EuropeRome => "Europe/Rome", + EuropeSamara => "Europe/Samara", + EuropeSanMarino => "Europe/San_Marino", + EuropeSarajevo => "Europe/Sarajevo", + EuropeSaratov => "Europe/Saratov", + EuropeSimferopol => "Europe/Simferopol", + EuropeSkopje => "Europe/Skopje", + EuropeSofia => "Europe/Sofia", + EuropeStockholm => "Europe/Stockholm", + EuropeTallinn => "Europe/Tallinn", + EuropeTirane => "Europe/Tirane", + EuropeTiraspol => "Europe/Tiraspol", + EuropeUlyanovsk => "Europe/Ulyanovsk", + EuropeUzhgorod => "Europe/Uzhgorod", + EuropeVaduz => "Europe/Vaduz", + EuropeVatican => "Europe/Vatican", + EuropeVienna => "Europe/Vienna", + EuropeVilnius => "Europe/Vilnius", + EuropeVolgograd => "Europe/Volgograd", + EuropeWarsaw => "Europe/Warsaw", + EuropeZagreb => "Europe/Zagreb", + EuropeZaporozhye => "Europe/Zaporozhye", + EuropeZurich => "Europe/Zurich", + Factory => "Factory", + Gb => "GB", + GbMinusEire => "GB-Eire", + Gmt => "GMT", + GmtPlus0 => "GMT+0", + GmtMinus0 => "GMT-0", + Gmt0 => "GMT0", + Greenwich => "Greenwich", + Hst => "HST", + Hongkong => "Hongkong", + Iceland => "Iceland", + IndianAntananarivo => "Indian/Antananarivo", + IndianChagos => "Indian/Chagos", + IndianChristmas => "Indian/Christmas", + IndianCocos => "Indian/Cocos", + IndianComoro => "Indian/Comoro", + IndianKerguelen => "Indian/Kerguelen", + IndianMahe => "Indian/Mahe", + IndianMaldives => "Indian/Maldives", + IndianMauritius => "Indian/Mauritius", + IndianMayotte => "Indian/Mayotte", + IndianReunion => "Indian/Reunion", + Iran => "Iran", + Israel => "Israel", + Jamaica => "Jamaica", + Japan => "Japan", + Kwajalein => "Kwajalein", + Libya => "Libya", + Met => "MET", + Mst => "MST", + Mst7mdt => "MST7MDT", + MexicoBajaNorte => "Mexico/BajaNorte", + MexicoBajaSur => "Mexico/BajaSur", + MexicoGeneral => "Mexico/General", + Nz => "NZ", + NzMinusChat => "NZ-CHAT", + Navajo => "Navajo", + Prc => "PRC", + Pst8pdt => "PST8PDT", + PacificApia => "Pacific/Apia", + PacificAuckland => "Pacific/Auckland", + PacificBougainville => "Pacific/Bougainville", + PacificChatham => "Pacific/Chatham", + PacificChuuk => "Pacific/Chuuk", + PacificEaster => "Pacific/Easter", + PacificEfate => "Pacific/Efate", + PacificEnderbury => "Pacific/Enderbury", + PacificFakaofo => "Pacific/Fakaofo", + PacificFiji => "Pacific/Fiji", + PacificFunafuti => "Pacific/Funafuti", + PacificGalapagos => "Pacific/Galapagos", + PacificGambier => "Pacific/Gambier", + PacificGuadalcanal => "Pacific/Guadalcanal", + PacificGuam => "Pacific/Guam", + PacificHonolulu => "Pacific/Honolulu", + PacificJohnston => "Pacific/Johnston", + PacificKanton => "Pacific/Kanton", + PacificKiritimati => "Pacific/Kiritimati", + PacificKosrae => "Pacific/Kosrae", + PacificKwajalein => "Pacific/Kwajalein", + PacificMajuro => "Pacific/Majuro", + PacificMarquesas => "Pacific/Marquesas", + PacificMidway => "Pacific/Midway", + PacificNauru => "Pacific/Nauru", + PacificNiue => "Pacific/Niue", + PacificNorfolk => "Pacific/Norfolk", + PacificNoumea => "Pacific/Noumea", + PacificPagoPago => "Pacific/Pago_Pago", + PacificPalau => "Pacific/Palau", + PacificPitcairn => "Pacific/Pitcairn", + PacificPohnpei => "Pacific/Pohnpei", + PacificPonape => "Pacific/Ponape", + PacificPortMoresby => "Pacific/Port_Moresby", + PacificRarotonga => "Pacific/Rarotonga", + PacificSaipan => "Pacific/Saipan", + PacificSamoa => "Pacific/Samoa", + PacificTahiti => "Pacific/Tahiti", + PacificTarawa => "Pacific/Tarawa", + PacificTongatapu => "Pacific/Tongatapu", + PacificTruk => "Pacific/Truk", + PacificWake => "Pacific/Wake", + PacificWallis => "Pacific/Wallis", + PacificYap => "Pacific/Yap", + Poland => "Poland", + Portugal => "Portugal", + Roc => "ROC", + Rok => "ROK", + Singapore => "Singapore", + Turkey => "Turkey", + Uct => "UCT", + UsAlaska => "US/Alaska", + UsAleutian => "US/Aleutian", + UsArizona => "US/Arizona", + UsCentral => "US/Central", + UsEastMinusIndiana => "US/East-Indiana", + UsEastern => "US/Eastern", + UsHawaii => "US/Hawaii", + UsIndianaMinusStarke => "US/Indiana-Starke", + UsMichigan => "US/Michigan", + UsMountain => "US/Mountain", + UsPacific => "US/Pacific", + UsPacificMinusNew => "US/Pacific-New", + UsSamoa => "US/Samoa", + Utc => "UTC", + Universal => "Universal", + WMinusSu => "W-SU", + Wet => "WET", + Zulu => "Zulu", + Unknown => "unknown", + } + } +} + +impl std::str::FromStr for CreateReportingReportRunParametersTimezone { + type Err = (); + fn from_str(s: &str) -> Result { + use CreateReportingReportRunParametersTimezone::*; + match s { + "Africa/Abidjan" => Ok(AfricaAbidjan), + "Africa/Accra" => Ok(AfricaAccra), + "Africa/Addis_Ababa" => Ok(AfricaAddisAbaba), + "Africa/Algiers" => Ok(AfricaAlgiers), + "Africa/Asmara" => Ok(AfricaAsmara), + "Africa/Asmera" => Ok(AfricaAsmera), + "Africa/Bamako" => Ok(AfricaBamako), + "Africa/Bangui" => Ok(AfricaBangui), + "Africa/Banjul" => Ok(AfricaBanjul), + "Africa/Bissau" => Ok(AfricaBissau), + "Africa/Blantyre" => Ok(AfricaBlantyre), + "Africa/Brazzaville" => Ok(AfricaBrazzaville), + "Africa/Bujumbura" => Ok(AfricaBujumbura), + "Africa/Cairo" => Ok(AfricaCairo), + "Africa/Casablanca" => Ok(AfricaCasablanca), + "Africa/Ceuta" => Ok(AfricaCeuta), + "Africa/Conakry" => Ok(AfricaConakry), + "Africa/Dakar" => Ok(AfricaDakar), + "Africa/Dar_es_Salaam" => Ok(AfricaDarEsSalaam), + "Africa/Djibouti" => Ok(AfricaDjibouti), + "Africa/Douala" => Ok(AfricaDouala), + "Africa/El_Aaiun" => Ok(AfricaElAaiun), + "Africa/Freetown" => Ok(AfricaFreetown), + "Africa/Gaborone" => Ok(AfricaGaborone), + "Africa/Harare" => Ok(AfricaHarare), + "Africa/Johannesburg" => Ok(AfricaJohannesburg), + "Africa/Juba" => Ok(AfricaJuba), + "Africa/Kampala" => Ok(AfricaKampala), + "Africa/Khartoum" => Ok(AfricaKhartoum), + "Africa/Kigali" => Ok(AfricaKigali), + "Africa/Kinshasa" => Ok(AfricaKinshasa), + "Africa/Lagos" => Ok(AfricaLagos), + "Africa/Libreville" => Ok(AfricaLibreville), + "Africa/Lome" => Ok(AfricaLome), + "Africa/Luanda" => Ok(AfricaLuanda), + "Africa/Lubumbashi" => Ok(AfricaLubumbashi), + "Africa/Lusaka" => Ok(AfricaLusaka), + "Africa/Malabo" => Ok(AfricaMalabo), + "Africa/Maputo" => Ok(AfricaMaputo), + "Africa/Maseru" => Ok(AfricaMaseru), + "Africa/Mbabane" => Ok(AfricaMbabane), + "Africa/Mogadishu" => Ok(AfricaMogadishu), + "Africa/Monrovia" => Ok(AfricaMonrovia), + "Africa/Nairobi" => Ok(AfricaNairobi), + "Africa/Ndjamena" => Ok(AfricaNdjamena), + "Africa/Niamey" => Ok(AfricaNiamey), + "Africa/Nouakchott" => Ok(AfricaNouakchott), + "Africa/Ouagadougou" => Ok(AfricaOuagadougou), + "Africa/Porto-Novo" => Ok(AfricaPortoMinusNovo), + "Africa/Sao_Tome" => Ok(AfricaSaoTome), + "Africa/Timbuktu" => Ok(AfricaTimbuktu), + "Africa/Tripoli" => Ok(AfricaTripoli), + "Africa/Tunis" => Ok(AfricaTunis), + "Africa/Windhoek" => Ok(AfricaWindhoek), + "America/Adak" => Ok(AmericaAdak), + "America/Anchorage" => Ok(AmericaAnchorage), + "America/Anguilla" => Ok(AmericaAnguilla), + "America/Antigua" => Ok(AmericaAntigua), + "America/Araguaina" => Ok(AmericaAraguaina), + "America/Argentina/Buenos_Aires" => Ok(AmericaArgentinaBuenosAires), + "America/Argentina/Catamarca" => Ok(AmericaArgentinaCatamarca), + "America/Argentina/ComodRivadavia" => Ok(AmericaArgentinaComodRivadavia), + "America/Argentina/Cordoba" => Ok(AmericaArgentinaCordoba), + "America/Argentina/Jujuy" => Ok(AmericaArgentinaJujuy), + "America/Argentina/La_Rioja" => Ok(AmericaArgentinaLaRioja), + "America/Argentina/Mendoza" => Ok(AmericaArgentinaMendoza), + "America/Argentina/Rio_Gallegos" => Ok(AmericaArgentinaRioGallegos), + "America/Argentina/Salta" => Ok(AmericaArgentinaSalta), + "America/Argentina/San_Juan" => Ok(AmericaArgentinaSanJuan), + "America/Argentina/San_Luis" => Ok(AmericaArgentinaSanLuis), + "America/Argentina/Tucuman" => Ok(AmericaArgentinaTucuman), + "America/Argentina/Ushuaia" => Ok(AmericaArgentinaUshuaia), + "America/Aruba" => Ok(AmericaAruba), + "America/Asuncion" => Ok(AmericaAsuncion), + "America/Atikokan" => Ok(AmericaAtikokan), + "America/Atka" => Ok(AmericaAtka), + "America/Bahia" => Ok(AmericaBahia), + "America/Bahia_Banderas" => Ok(AmericaBahiaBanderas), + "America/Barbados" => Ok(AmericaBarbados), + "America/Belem" => Ok(AmericaBelem), + "America/Belize" => Ok(AmericaBelize), + "America/Blanc-Sablon" => Ok(AmericaBlancMinusSablon), + "America/Boa_Vista" => Ok(AmericaBoaVista), + "America/Bogota" => Ok(AmericaBogota), + "America/Boise" => Ok(AmericaBoise), + "America/Buenos_Aires" => Ok(AmericaBuenosAires), + "America/Cambridge_Bay" => Ok(AmericaCambridgeBay), + "America/Campo_Grande" => Ok(AmericaCampoGrande), + "America/Cancun" => Ok(AmericaCancun), + "America/Caracas" => Ok(AmericaCaracas), + "America/Catamarca" => Ok(AmericaCatamarca), + "America/Cayenne" => Ok(AmericaCayenne), + "America/Cayman" => Ok(AmericaCayman), + "America/Chicago" => Ok(AmericaChicago), + "America/Chihuahua" => Ok(AmericaChihuahua), + "America/Ciudad_Juarez" => Ok(AmericaCiudadJuarez), + "America/Coral_Harbour" => Ok(AmericaCoralHarbour), + "America/Cordoba" => Ok(AmericaCordoba), + "America/Costa_Rica" => Ok(AmericaCostaRica), + "America/Creston" => Ok(AmericaCreston), + "America/Cuiaba" => Ok(AmericaCuiaba), + "America/Curacao" => Ok(AmericaCuracao), + "America/Danmarkshavn" => Ok(AmericaDanmarkshavn), + "America/Dawson" => Ok(AmericaDawson), + "America/Dawson_Creek" => Ok(AmericaDawsonCreek), + "America/Denver" => Ok(AmericaDenver), + "America/Detroit" => Ok(AmericaDetroit), + "America/Dominica" => Ok(AmericaDominica), + "America/Edmonton" => Ok(AmericaEdmonton), + "America/Eirunepe" => Ok(AmericaEirunepe), + "America/El_Salvador" => Ok(AmericaElSalvador), + "America/Ensenada" => Ok(AmericaEnsenada), + "America/Fort_Nelson" => Ok(AmericaFortNelson), + "America/Fort_Wayne" => Ok(AmericaFortWayne), + "America/Fortaleza" => Ok(AmericaFortaleza), + "America/Glace_Bay" => Ok(AmericaGlaceBay), + "America/Godthab" => Ok(AmericaGodthab), + "America/Goose_Bay" => Ok(AmericaGooseBay), + "America/Grand_Turk" => Ok(AmericaGrandTurk), + "America/Grenada" => Ok(AmericaGrenada), + "America/Guadeloupe" => Ok(AmericaGuadeloupe), + "America/Guatemala" => Ok(AmericaGuatemala), + "America/Guayaquil" => Ok(AmericaGuayaquil), + "America/Guyana" => Ok(AmericaGuyana), + "America/Halifax" => Ok(AmericaHalifax), + "America/Havana" => Ok(AmericaHavana), + "America/Hermosillo" => Ok(AmericaHermosillo), + "America/Indiana/Indianapolis" => Ok(AmericaIndianaIndianapolis), + "America/Indiana/Knox" => Ok(AmericaIndianaKnox), + "America/Indiana/Marengo" => Ok(AmericaIndianaMarengo), + "America/Indiana/Petersburg" => Ok(AmericaIndianaPetersburg), + "America/Indiana/Tell_City" => Ok(AmericaIndianaTellCity), + "America/Indiana/Vevay" => Ok(AmericaIndianaVevay), + "America/Indiana/Vincennes" => Ok(AmericaIndianaVincennes), + "America/Indiana/Winamac" => Ok(AmericaIndianaWinamac), + "America/Indianapolis" => Ok(AmericaIndianapolis), + "America/Inuvik" => Ok(AmericaInuvik), + "America/Iqaluit" => Ok(AmericaIqaluit), + "America/Jamaica" => Ok(AmericaJamaica), + "America/Jujuy" => Ok(AmericaJujuy), + "America/Juneau" => Ok(AmericaJuneau), + "America/Kentucky/Louisville" => Ok(AmericaKentuckyLouisville), + "America/Kentucky/Monticello" => Ok(AmericaKentuckyMonticello), + "America/Knox_IN" => Ok(AmericaKnoxIn), + "America/Kralendijk" => Ok(AmericaKralendijk), + "America/La_Paz" => Ok(AmericaLaPaz), + "America/Lima" => Ok(AmericaLima), + "America/Los_Angeles" => Ok(AmericaLosAngeles), + "America/Louisville" => Ok(AmericaLouisville), + "America/Lower_Princes" => Ok(AmericaLowerPrinces), + "America/Maceio" => Ok(AmericaMaceio), + "America/Managua" => Ok(AmericaManagua), + "America/Manaus" => Ok(AmericaManaus), + "America/Marigot" => Ok(AmericaMarigot), + "America/Martinique" => Ok(AmericaMartinique), + "America/Matamoros" => Ok(AmericaMatamoros), + "America/Mazatlan" => Ok(AmericaMazatlan), + "America/Mendoza" => Ok(AmericaMendoza), + "America/Menominee" => Ok(AmericaMenominee), + "America/Merida" => Ok(AmericaMerida), + "America/Metlakatla" => Ok(AmericaMetlakatla), + "America/Mexico_City" => Ok(AmericaMexicoCity), + "America/Miquelon" => Ok(AmericaMiquelon), + "America/Moncton" => Ok(AmericaMoncton), + "America/Monterrey" => Ok(AmericaMonterrey), + "America/Montevideo" => Ok(AmericaMontevideo), + "America/Montreal" => Ok(AmericaMontreal), + "America/Montserrat" => Ok(AmericaMontserrat), + "America/Nassau" => Ok(AmericaNassau), + "America/New_York" => Ok(AmericaNewYork), + "America/Nipigon" => Ok(AmericaNipigon), + "America/Nome" => Ok(AmericaNome), + "America/Noronha" => Ok(AmericaNoronha), + "America/North_Dakota/Beulah" => Ok(AmericaNorthDakotaBeulah), + "America/North_Dakota/Center" => Ok(AmericaNorthDakotaCenter), + "America/North_Dakota/New_Salem" => Ok(AmericaNorthDakotaNewSalem), + "America/Nuuk" => Ok(AmericaNuuk), + "America/Ojinaga" => Ok(AmericaOjinaga), + "America/Panama" => Ok(AmericaPanama), + "America/Pangnirtung" => Ok(AmericaPangnirtung), + "America/Paramaribo" => Ok(AmericaParamaribo), + "America/Phoenix" => Ok(AmericaPhoenix), + "America/Port-au-Prince" => Ok(AmericaPortMinusauMinusPrince), + "America/Port_of_Spain" => Ok(AmericaPortOfSpain), + "America/Porto_Acre" => Ok(AmericaPortoAcre), + "America/Porto_Velho" => Ok(AmericaPortoVelho), + "America/Puerto_Rico" => Ok(AmericaPuertoRico), + "America/Punta_Arenas" => Ok(AmericaPuntaArenas), + "America/Rainy_River" => Ok(AmericaRainyRiver), + "America/Rankin_Inlet" => Ok(AmericaRankinInlet), + "America/Recife" => Ok(AmericaRecife), + "America/Regina" => Ok(AmericaRegina), + "America/Resolute" => Ok(AmericaResolute), + "America/Rio_Branco" => Ok(AmericaRioBranco), + "America/Rosario" => Ok(AmericaRosario), + "America/Santa_Isabel" => Ok(AmericaSantaIsabel), + "America/Santarem" => Ok(AmericaSantarem), + "America/Santiago" => Ok(AmericaSantiago), + "America/Santo_Domingo" => Ok(AmericaSantoDomingo), + "America/Sao_Paulo" => Ok(AmericaSaoPaulo), + "America/Scoresbysund" => Ok(AmericaScoresbysund), + "America/Shiprock" => Ok(AmericaShiprock), + "America/Sitka" => Ok(AmericaSitka), + "America/St_Barthelemy" => Ok(AmericaStBarthelemy), + "America/St_Johns" => Ok(AmericaStJohns), + "America/St_Kitts" => Ok(AmericaStKitts), + "America/St_Lucia" => Ok(AmericaStLucia), + "America/St_Thomas" => Ok(AmericaStThomas), + "America/St_Vincent" => Ok(AmericaStVincent), + "America/Swift_Current" => Ok(AmericaSwiftCurrent), + "America/Tegucigalpa" => Ok(AmericaTegucigalpa), + "America/Thule" => Ok(AmericaThule), + "America/Thunder_Bay" => Ok(AmericaThunderBay), + "America/Tijuana" => Ok(AmericaTijuana), + "America/Toronto" => Ok(AmericaToronto), + "America/Tortola" => Ok(AmericaTortola), + "America/Vancouver" => Ok(AmericaVancouver), + "America/Virgin" => Ok(AmericaVirgin), + "America/Whitehorse" => Ok(AmericaWhitehorse), + "America/Winnipeg" => Ok(AmericaWinnipeg), + "America/Yakutat" => Ok(AmericaYakutat), + "America/Yellowknife" => Ok(AmericaYellowknife), + "Antarctica/Casey" => Ok(AntarcticaCasey), + "Antarctica/Davis" => Ok(AntarcticaDavis), + "Antarctica/DumontDUrville" => Ok(AntarcticaDumontDUrville), + "Antarctica/Macquarie" => Ok(AntarcticaMacquarie), + "Antarctica/Mawson" => Ok(AntarcticaMawson), + "Antarctica/McMurdo" => Ok(AntarcticaMcMurdo), + "Antarctica/Palmer" => Ok(AntarcticaPalmer), + "Antarctica/Rothera" => Ok(AntarcticaRothera), + "Antarctica/South_Pole" => Ok(AntarcticaSouthPole), + "Antarctica/Syowa" => Ok(AntarcticaSyowa), + "Antarctica/Troll" => Ok(AntarcticaTroll), + "Antarctica/Vostok" => Ok(AntarcticaVostok), + "Arctic/Longyearbyen" => Ok(ArcticLongyearbyen), + "Asia/Aden" => Ok(AsiaAden), + "Asia/Almaty" => Ok(AsiaAlmaty), + "Asia/Amman" => Ok(AsiaAmman), + "Asia/Anadyr" => Ok(AsiaAnadyr), + "Asia/Aqtau" => Ok(AsiaAqtau), + "Asia/Aqtobe" => Ok(AsiaAqtobe), + "Asia/Ashgabat" => Ok(AsiaAshgabat), + "Asia/Ashkhabad" => Ok(AsiaAshkhabad), + "Asia/Atyrau" => Ok(AsiaAtyrau), + "Asia/Baghdad" => Ok(AsiaBaghdad), + "Asia/Bahrain" => Ok(AsiaBahrain), + "Asia/Baku" => Ok(AsiaBaku), + "Asia/Bangkok" => Ok(AsiaBangkok), + "Asia/Barnaul" => Ok(AsiaBarnaul), + "Asia/Beirut" => Ok(AsiaBeirut), + "Asia/Bishkek" => Ok(AsiaBishkek), + "Asia/Brunei" => Ok(AsiaBrunei), + "Asia/Calcutta" => Ok(AsiaCalcutta), + "Asia/Chita" => Ok(AsiaChita), + "Asia/Choibalsan" => Ok(AsiaChoibalsan), + "Asia/Chongqing" => Ok(AsiaChongqing), + "Asia/Chungking" => Ok(AsiaChungking), + "Asia/Colombo" => Ok(AsiaColombo), + "Asia/Dacca" => Ok(AsiaDacca), + "Asia/Damascus" => Ok(AsiaDamascus), + "Asia/Dhaka" => Ok(AsiaDhaka), + "Asia/Dili" => Ok(AsiaDili), + "Asia/Dubai" => Ok(AsiaDubai), + "Asia/Dushanbe" => Ok(AsiaDushanbe), + "Asia/Famagusta" => Ok(AsiaFamagusta), + "Asia/Gaza" => Ok(AsiaGaza), + "Asia/Harbin" => Ok(AsiaHarbin), + "Asia/Hebron" => Ok(AsiaHebron), + "Asia/Ho_Chi_Minh" => Ok(AsiaHoChiMinh), + "Asia/Hong_Kong" => Ok(AsiaHongKong), + "Asia/Hovd" => Ok(AsiaHovd), + "Asia/Irkutsk" => Ok(AsiaIrkutsk), + "Asia/Istanbul" => Ok(AsiaIstanbul), + "Asia/Jakarta" => Ok(AsiaJakarta), + "Asia/Jayapura" => Ok(AsiaJayapura), + "Asia/Jerusalem" => Ok(AsiaJerusalem), + "Asia/Kabul" => Ok(AsiaKabul), + "Asia/Kamchatka" => Ok(AsiaKamchatka), + "Asia/Karachi" => Ok(AsiaKarachi), + "Asia/Kashgar" => Ok(AsiaKashgar), + "Asia/Kathmandu" => Ok(AsiaKathmandu), + "Asia/Katmandu" => Ok(AsiaKatmandu), + "Asia/Khandyga" => Ok(AsiaKhandyga), + "Asia/Kolkata" => Ok(AsiaKolkata), + "Asia/Krasnoyarsk" => Ok(AsiaKrasnoyarsk), + "Asia/Kuala_Lumpur" => Ok(AsiaKualaLumpur), + "Asia/Kuching" => Ok(AsiaKuching), + "Asia/Kuwait" => Ok(AsiaKuwait), + "Asia/Macao" => Ok(AsiaMacao), + "Asia/Macau" => Ok(AsiaMacau), + "Asia/Magadan" => Ok(AsiaMagadan), + "Asia/Makassar" => Ok(AsiaMakassar), + "Asia/Manila" => Ok(AsiaManila), + "Asia/Muscat" => Ok(AsiaMuscat), + "Asia/Nicosia" => Ok(AsiaNicosia), + "Asia/Novokuznetsk" => Ok(AsiaNovokuznetsk), + "Asia/Novosibirsk" => Ok(AsiaNovosibirsk), + "Asia/Omsk" => Ok(AsiaOmsk), + "Asia/Oral" => Ok(AsiaOral), + "Asia/Phnom_Penh" => Ok(AsiaPhnomPenh), + "Asia/Pontianak" => Ok(AsiaPontianak), + "Asia/Pyongyang" => Ok(AsiaPyongyang), + "Asia/Qatar" => Ok(AsiaQatar), + "Asia/Qostanay" => Ok(AsiaQostanay), + "Asia/Qyzylorda" => Ok(AsiaQyzylorda), + "Asia/Rangoon" => Ok(AsiaRangoon), + "Asia/Riyadh" => Ok(AsiaRiyadh), + "Asia/Saigon" => Ok(AsiaSaigon), + "Asia/Sakhalin" => Ok(AsiaSakhalin), + "Asia/Samarkand" => Ok(AsiaSamarkand), + "Asia/Seoul" => Ok(AsiaSeoul), + "Asia/Shanghai" => Ok(AsiaShanghai), + "Asia/Singapore" => Ok(AsiaSingapore), + "Asia/Srednekolymsk" => Ok(AsiaSrednekolymsk), + "Asia/Taipei" => Ok(AsiaTaipei), + "Asia/Tashkent" => Ok(AsiaTashkent), + "Asia/Tbilisi" => Ok(AsiaTbilisi), + "Asia/Tehran" => Ok(AsiaTehran), + "Asia/Tel_Aviv" => Ok(AsiaTelAviv), + "Asia/Thimbu" => Ok(AsiaThimbu), + "Asia/Thimphu" => Ok(AsiaThimphu), + "Asia/Tokyo" => Ok(AsiaTokyo), + "Asia/Tomsk" => Ok(AsiaTomsk), + "Asia/Ujung_Pandang" => Ok(AsiaUjungPandang), + "Asia/Ulaanbaatar" => Ok(AsiaUlaanbaatar), + "Asia/Ulan_Bator" => Ok(AsiaUlanBator), + "Asia/Urumqi" => Ok(AsiaUrumqi), + "Asia/Ust-Nera" => Ok(AsiaUstMinusNera), + "Asia/Vientiane" => Ok(AsiaVientiane), + "Asia/Vladivostok" => Ok(AsiaVladivostok), + "Asia/Yakutsk" => Ok(AsiaYakutsk), + "Asia/Yangon" => Ok(AsiaYangon), + "Asia/Yekaterinburg" => Ok(AsiaYekaterinburg), + "Asia/Yerevan" => Ok(AsiaYerevan), + "Atlantic/Azores" => Ok(AtlanticAzores), + "Atlantic/Bermuda" => Ok(AtlanticBermuda), + "Atlantic/Canary" => Ok(AtlanticCanary), + "Atlantic/Cape_Verde" => Ok(AtlanticCapeVerde), + "Atlantic/Faeroe" => Ok(AtlanticFaeroe), + "Atlantic/Faroe" => Ok(AtlanticFaroe), + "Atlantic/Jan_Mayen" => Ok(AtlanticJanMayen), + "Atlantic/Madeira" => Ok(AtlanticMadeira), + "Atlantic/Reykjavik" => Ok(AtlanticReykjavik), + "Atlantic/South_Georgia" => Ok(AtlanticSouthGeorgia), + "Atlantic/St_Helena" => Ok(AtlanticStHelena), + "Atlantic/Stanley" => Ok(AtlanticStanley), + "Australia/ACT" => Ok(AustraliaAct), + "Australia/Adelaide" => Ok(AustraliaAdelaide), + "Australia/Brisbane" => Ok(AustraliaBrisbane), + "Australia/Broken_Hill" => Ok(AustraliaBrokenHill), + "Australia/Canberra" => Ok(AustraliaCanberra), + "Australia/Currie" => Ok(AustraliaCurrie), + "Australia/Darwin" => Ok(AustraliaDarwin), + "Australia/Eucla" => Ok(AustraliaEucla), + "Australia/Hobart" => Ok(AustraliaHobart), + "Australia/LHI" => Ok(AustraliaLhi), + "Australia/Lindeman" => Ok(AustraliaLindeman), + "Australia/Lord_Howe" => Ok(AustraliaLordHowe), + "Australia/Melbourne" => Ok(AustraliaMelbourne), + "Australia/NSW" => Ok(AustraliaNsw), + "Australia/North" => Ok(AustraliaNorth), + "Australia/Perth" => Ok(AustraliaPerth), + "Australia/Queensland" => Ok(AustraliaQueensland), + "Australia/South" => Ok(AustraliaSouth), + "Australia/Sydney" => Ok(AustraliaSydney), + "Australia/Tasmania" => Ok(AustraliaTasmania), + "Australia/Victoria" => Ok(AustraliaVictoria), + "Australia/West" => Ok(AustraliaWest), + "Australia/Yancowinna" => Ok(AustraliaYancowinna), + "Brazil/Acre" => Ok(BrazilAcre), + "Brazil/DeNoronha" => Ok(BrazilDeNoronha), + "Brazil/East" => Ok(BrazilEast), + "Brazil/West" => Ok(BrazilWest), + "CET" => Ok(Cet), + "CST6CDT" => Ok(Cst6cdt), + "Canada/Atlantic" => Ok(CanadaAtlantic), + "Canada/Central" => Ok(CanadaCentral), + "Canada/Eastern" => Ok(CanadaEastern), + "Canada/Mountain" => Ok(CanadaMountain), + "Canada/Newfoundland" => Ok(CanadaNewfoundland), + "Canada/Pacific" => Ok(CanadaPacific), + "Canada/Saskatchewan" => Ok(CanadaSaskatchewan), + "Canada/Yukon" => Ok(CanadaYukon), + "Chile/Continental" => Ok(ChileContinental), + "Chile/EasterIsland" => Ok(ChileEasterIsland), + "Cuba" => Ok(Cuba), + "EET" => Ok(Eet), + "EST" => Ok(Est), + "EST5EDT" => Ok(Est5edt), + "Egypt" => Ok(Egypt), + "Eire" => Ok(Eire), + "Etc/GMT" => Ok(EtcGmt), + "Etc/GMT+0" => Ok(EtcGmtPlus0), + "Etc/GMT+1" => Ok(EtcGmtPlus1), + "Etc/GMT+10" => Ok(EtcGmtPlus10), + "Etc/GMT+11" => Ok(EtcGmtPlus11), + "Etc/GMT+12" => Ok(EtcGmtPlus12), + "Etc/GMT+2" => Ok(EtcGmtPlus2), + "Etc/GMT+3" => Ok(EtcGmtPlus3), + "Etc/GMT+4" => Ok(EtcGmtPlus4), + "Etc/GMT+5" => Ok(EtcGmtPlus5), + "Etc/GMT+6" => Ok(EtcGmtPlus6), + "Etc/GMT+7" => Ok(EtcGmtPlus7), + "Etc/GMT+8" => Ok(EtcGmtPlus8), + "Etc/GMT+9" => Ok(EtcGmtPlus9), + "Etc/GMT-0" => Ok(EtcGmtMinus0), + "Etc/GMT-1" => Ok(EtcGmtMinus1), + "Etc/GMT-10" => Ok(EtcGmtMinus10), + "Etc/GMT-11" => Ok(EtcGmtMinus11), + "Etc/GMT-12" => Ok(EtcGmtMinus12), + "Etc/GMT-13" => Ok(EtcGmtMinus13), + "Etc/GMT-14" => Ok(EtcGmtMinus14), + "Etc/GMT-2" => Ok(EtcGmtMinus2), + "Etc/GMT-3" => Ok(EtcGmtMinus3), + "Etc/GMT-4" => Ok(EtcGmtMinus4), + "Etc/GMT-5" => Ok(EtcGmtMinus5), + "Etc/GMT-6" => Ok(EtcGmtMinus6), + "Etc/GMT-7" => Ok(EtcGmtMinus7), + "Etc/GMT-8" => Ok(EtcGmtMinus8), + "Etc/GMT-9" => Ok(EtcGmtMinus9), + "Etc/GMT0" => Ok(EtcGmt0), + "Etc/Greenwich" => Ok(EtcGreenwich), + "Etc/UCT" => Ok(EtcUct), + "Etc/UTC" => Ok(EtcUtc), + "Etc/Universal" => Ok(EtcUniversal), + "Etc/Zulu" => Ok(EtcZulu), + "Europe/Amsterdam" => Ok(EuropeAmsterdam), + "Europe/Andorra" => Ok(EuropeAndorra), + "Europe/Astrakhan" => Ok(EuropeAstrakhan), + "Europe/Athens" => Ok(EuropeAthens), + "Europe/Belfast" => Ok(EuropeBelfast), + "Europe/Belgrade" => Ok(EuropeBelgrade), + "Europe/Berlin" => Ok(EuropeBerlin), + "Europe/Bratislava" => Ok(EuropeBratislava), + "Europe/Brussels" => Ok(EuropeBrussels), + "Europe/Bucharest" => Ok(EuropeBucharest), + "Europe/Budapest" => Ok(EuropeBudapest), + "Europe/Busingen" => Ok(EuropeBusingen), + "Europe/Chisinau" => Ok(EuropeChisinau), + "Europe/Copenhagen" => Ok(EuropeCopenhagen), + "Europe/Dublin" => Ok(EuropeDublin), + "Europe/Gibraltar" => Ok(EuropeGibraltar), + "Europe/Guernsey" => Ok(EuropeGuernsey), + "Europe/Helsinki" => Ok(EuropeHelsinki), + "Europe/Isle_of_Man" => Ok(EuropeIsleOfMan), + "Europe/Istanbul" => Ok(EuropeIstanbul), + "Europe/Jersey" => Ok(EuropeJersey), + "Europe/Kaliningrad" => Ok(EuropeKaliningrad), + "Europe/Kiev" => Ok(EuropeKiev), + "Europe/Kirov" => Ok(EuropeKirov), + "Europe/Kyiv" => Ok(EuropeKyiv), + "Europe/Lisbon" => Ok(EuropeLisbon), + "Europe/Ljubljana" => Ok(EuropeLjubljana), + "Europe/London" => Ok(EuropeLondon), + "Europe/Luxembourg" => Ok(EuropeLuxembourg), + "Europe/Madrid" => Ok(EuropeMadrid), + "Europe/Malta" => Ok(EuropeMalta), + "Europe/Mariehamn" => Ok(EuropeMariehamn), + "Europe/Minsk" => Ok(EuropeMinsk), + "Europe/Monaco" => Ok(EuropeMonaco), + "Europe/Moscow" => Ok(EuropeMoscow), + "Europe/Nicosia" => Ok(EuropeNicosia), + "Europe/Oslo" => Ok(EuropeOslo), + "Europe/Paris" => Ok(EuropeParis), + "Europe/Podgorica" => Ok(EuropePodgorica), + "Europe/Prague" => Ok(EuropePrague), + "Europe/Riga" => Ok(EuropeRiga), + "Europe/Rome" => Ok(EuropeRome), + "Europe/Samara" => Ok(EuropeSamara), + "Europe/San_Marino" => Ok(EuropeSanMarino), + "Europe/Sarajevo" => Ok(EuropeSarajevo), + "Europe/Saratov" => Ok(EuropeSaratov), + "Europe/Simferopol" => Ok(EuropeSimferopol), + "Europe/Skopje" => Ok(EuropeSkopje), + "Europe/Sofia" => Ok(EuropeSofia), + "Europe/Stockholm" => Ok(EuropeStockholm), + "Europe/Tallinn" => Ok(EuropeTallinn), + "Europe/Tirane" => Ok(EuropeTirane), + "Europe/Tiraspol" => Ok(EuropeTiraspol), + "Europe/Ulyanovsk" => Ok(EuropeUlyanovsk), + "Europe/Uzhgorod" => Ok(EuropeUzhgorod), + "Europe/Vaduz" => Ok(EuropeVaduz), + "Europe/Vatican" => Ok(EuropeVatican), + "Europe/Vienna" => Ok(EuropeVienna), + "Europe/Vilnius" => Ok(EuropeVilnius), + "Europe/Volgograd" => Ok(EuropeVolgograd), + "Europe/Warsaw" => Ok(EuropeWarsaw), + "Europe/Zagreb" => Ok(EuropeZagreb), + "Europe/Zaporozhye" => Ok(EuropeZaporozhye), + "Europe/Zurich" => Ok(EuropeZurich), + "Factory" => Ok(Factory), + "GB" => Ok(Gb), + "GB-Eire" => Ok(GbMinusEire), + "GMT" => Ok(Gmt), + "GMT+0" => Ok(GmtPlus0), + "GMT-0" => Ok(GmtMinus0), + "GMT0" => Ok(Gmt0), + "Greenwich" => Ok(Greenwich), + "HST" => Ok(Hst), + "Hongkong" => Ok(Hongkong), + "Iceland" => Ok(Iceland), + "Indian/Antananarivo" => Ok(IndianAntananarivo), + "Indian/Chagos" => Ok(IndianChagos), + "Indian/Christmas" => Ok(IndianChristmas), + "Indian/Cocos" => Ok(IndianCocos), + "Indian/Comoro" => Ok(IndianComoro), + "Indian/Kerguelen" => Ok(IndianKerguelen), + "Indian/Mahe" => Ok(IndianMahe), + "Indian/Maldives" => Ok(IndianMaldives), + "Indian/Mauritius" => Ok(IndianMauritius), + "Indian/Mayotte" => Ok(IndianMayotte), + "Indian/Reunion" => Ok(IndianReunion), + "Iran" => Ok(Iran), + "Israel" => Ok(Israel), + "Jamaica" => Ok(Jamaica), + "Japan" => Ok(Japan), + "Kwajalein" => Ok(Kwajalein), + "Libya" => Ok(Libya), + "MET" => Ok(Met), + "MST" => Ok(Mst), + "MST7MDT" => Ok(Mst7mdt), + "Mexico/BajaNorte" => Ok(MexicoBajaNorte), + "Mexico/BajaSur" => Ok(MexicoBajaSur), + "Mexico/General" => Ok(MexicoGeneral), + "NZ" => Ok(Nz), + "NZ-CHAT" => Ok(NzMinusChat), + "Navajo" => Ok(Navajo), + "PRC" => Ok(Prc), + "PST8PDT" => Ok(Pst8pdt), + "Pacific/Apia" => Ok(PacificApia), + "Pacific/Auckland" => Ok(PacificAuckland), + "Pacific/Bougainville" => Ok(PacificBougainville), + "Pacific/Chatham" => Ok(PacificChatham), + "Pacific/Chuuk" => Ok(PacificChuuk), + "Pacific/Easter" => Ok(PacificEaster), + "Pacific/Efate" => Ok(PacificEfate), + "Pacific/Enderbury" => Ok(PacificEnderbury), + "Pacific/Fakaofo" => Ok(PacificFakaofo), + "Pacific/Fiji" => Ok(PacificFiji), + "Pacific/Funafuti" => Ok(PacificFunafuti), + "Pacific/Galapagos" => Ok(PacificGalapagos), + "Pacific/Gambier" => Ok(PacificGambier), + "Pacific/Guadalcanal" => Ok(PacificGuadalcanal), + "Pacific/Guam" => Ok(PacificGuam), + "Pacific/Honolulu" => Ok(PacificHonolulu), + "Pacific/Johnston" => Ok(PacificJohnston), + "Pacific/Kanton" => Ok(PacificKanton), + "Pacific/Kiritimati" => Ok(PacificKiritimati), + "Pacific/Kosrae" => Ok(PacificKosrae), + "Pacific/Kwajalein" => Ok(PacificKwajalein), + "Pacific/Majuro" => Ok(PacificMajuro), + "Pacific/Marquesas" => Ok(PacificMarquesas), + "Pacific/Midway" => Ok(PacificMidway), + "Pacific/Nauru" => Ok(PacificNauru), + "Pacific/Niue" => Ok(PacificNiue), + "Pacific/Norfolk" => Ok(PacificNorfolk), + "Pacific/Noumea" => Ok(PacificNoumea), + "Pacific/Pago_Pago" => Ok(PacificPagoPago), + "Pacific/Palau" => Ok(PacificPalau), + "Pacific/Pitcairn" => Ok(PacificPitcairn), + "Pacific/Pohnpei" => Ok(PacificPohnpei), + "Pacific/Ponape" => Ok(PacificPonape), + "Pacific/Port_Moresby" => Ok(PacificPortMoresby), + "Pacific/Rarotonga" => Ok(PacificRarotonga), + "Pacific/Saipan" => Ok(PacificSaipan), + "Pacific/Samoa" => Ok(PacificSamoa), + "Pacific/Tahiti" => Ok(PacificTahiti), + "Pacific/Tarawa" => Ok(PacificTarawa), + "Pacific/Tongatapu" => Ok(PacificTongatapu), + "Pacific/Truk" => Ok(PacificTruk), + "Pacific/Wake" => Ok(PacificWake), + "Pacific/Wallis" => Ok(PacificWallis), + "Pacific/Yap" => Ok(PacificYap), + "Poland" => Ok(Poland), + "Portugal" => Ok(Portugal), + "ROC" => Ok(Roc), + "ROK" => Ok(Rok), + "Singapore" => Ok(Singapore), + "Turkey" => Ok(Turkey), + "UCT" => Ok(Uct), + "US/Alaska" => Ok(UsAlaska), + "US/Aleutian" => Ok(UsAleutian), + "US/Arizona" => Ok(UsArizona), + "US/Central" => Ok(UsCentral), + "US/East-Indiana" => Ok(UsEastMinusIndiana), + "US/Eastern" => Ok(UsEastern), + "US/Hawaii" => Ok(UsHawaii), + "US/Indiana-Starke" => Ok(UsIndianaMinusStarke), + "US/Michigan" => Ok(UsMichigan), + "US/Mountain" => Ok(UsMountain), + "US/Pacific" => Ok(UsPacific), + "US/Pacific-New" => Ok(UsPacificMinusNew), + "US/Samoa" => Ok(UsSamoa), + "UTC" => Ok(Utc), + "Universal" => Ok(Universal), + "W-SU" => Ok(WMinusSu), + "WET" => Ok(Wet), + "Zulu" => Ok(Zulu), + _ => Err(()), + } + } +} +impl std::fmt::Display for CreateReportingReportRunParametersTimezone { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreateReportingReportRunParametersTimezone { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreateReportingReportRunParametersTimezone { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'a> CreateReportingReportRun<'a> { + /// Creates a new object and begin running the report. + /// (Certain report types require a [live-mode API key](https://stripe.com/docs/keys#test-live-modes).). + pub fn send( + &self, + client: &stripe::Client, + ) -> stripe::Response { + client.send_form("/reporting/report_runs", self, http_types::Method::Post) + } +} diff --git a/generated/stripe_misc/src/reporting_report_run/types.rs b/generated/stripe_misc/src/reporting_report_run/types.rs new file mode 100644 index 000000000..0282fc92d --- /dev/null +++ b/generated/stripe_misc/src/reporting_report_run/types.rs @@ -0,0 +1,42 @@ +/// The Report Run object represents an instance of a report type generated with +/// specific run parameters. Once the object is created, Stripe begins processing the report. +/// When the report has finished running, it will give you a reference to a file +/// where you can retrieve your results. For an overview, see +/// [API Access to Reports](https://stripe.com/docs/reporting/statements/api). +/// +/// Note that certain report types can only be run based on your live-mode data (not test-mode +/// data), and will error when queried without a [live-mode API key](https://stripe.com/docs/keys#test-live-modes). +/// +/// For more details see <>. +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct ReportingReportRun { + /// Time at which the object was created. Measured in seconds since the Unix epoch. + pub created: stripe_types::Timestamp, + /// If something should go wrong during the run, a message about the failure (populated when + /// `status=failed`). + pub error: Option, + /// Unique identifier for the object. + pub id: stripe_misc::ReportingReportRunId, + /// `true` if the report is run on live mode data and `false` if it is run on test mode data. + pub livemode: bool, + pub parameters: stripe_misc::FinancialReportingFinanceReportRunRunParameters, + /// The ID of the [report type](https://stripe.com/docs/reports/report-types) to run, such as `"balance.summary.1"`. + pub report_type: String, + /// The file object representing the result of the report run (populated when + /// `status=succeeded`). + pub result: Option, + /// Status of this report run. This will be `pending` when the run is initially created. + /// When the run finishes, this will be set to `succeeded` and the `result` field will be populated. + /// Rarely, we may encounter an error, at which point this will be set to `failed` and the `error` field will be populated. + pub status: String, + /// Timestamp at which this run successfully finished (populated when + /// `status=succeeded`). Measured in seconds since the Unix epoch. + pub succeeded_at: Option, +} +impl stripe_types::Object for ReportingReportRun { + type Id = stripe_misc::ReportingReportRunId; + fn id(&self) -> &Self::Id { + &self.id + } +} +stripe_types::def_id!(ReportingReportRunId); diff --git a/generated/stripe_misc/src/reporting_report_type/mod.rs b/generated/stripe_misc/src/reporting_report_type/mod.rs new file mode 100644 index 000000000..138468b3f --- /dev/null +++ b/generated/stripe_misc/src/reporting_report_type/mod.rs @@ -0,0 +1,5 @@ +#[cfg(feature = "reporting_report_type")] +mod requests; +pub(crate) mod types; +#[cfg(feature = "reporting_report_type")] +pub use requests::*; diff --git a/generated/stripe_misc/src/reporting_report_type/requests.rs b/generated/stripe_misc/src/reporting_report_type/requests.rs new file mode 100644 index 000000000..bb6adf037 --- /dev/null +++ b/generated/stripe_misc/src/reporting_report_type/requests.rs @@ -0,0 +1,47 @@ +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct ListReportingReportType<'a> { + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, +} +impl<'a> ListReportingReportType<'a> { + pub fn new() -> Self { + Self::default() + } +} +impl<'a> ListReportingReportType<'a> { + /// Returns a full list of Report Types. + pub fn send( + &self, + client: &stripe::Client, + ) -> stripe::Response> { + client.get_query("/reporting/report_types", self) + } + pub fn paginate( + self, + ) -> stripe::ListPaginator> { + stripe::ListPaginator::from_list_params("/reporting/report_types", self) + } +} +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct RetrieveReportingReportType<'a> { + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, +} +impl<'a> RetrieveReportingReportType<'a> { + pub fn new() -> Self { + Self::default() + } +} +impl<'a> RetrieveReportingReportType<'a> { + /// Retrieves the details of a Report Type. + /// (Certain report types require a [live-mode API key](https://stripe.com/docs/keys#test-live-modes).). + pub fn send( + &self, + client: &stripe::Client, + report_type: &stripe_misc::ReportingReportTypeId, + ) -> stripe::Response { + client.get_query(&format!("/reporting/report_types/{report_type}"), self) + } +} diff --git a/generated/stripe_misc/src/reporting_report_type/types.rs b/generated/stripe_misc/src/reporting_report_type/types.rs new file mode 100644 index 000000000..fe66c52fe --- /dev/null +++ b/generated/stripe_misc/src/reporting_report_type/types.rs @@ -0,0 +1,38 @@ +/// The Report Type resource corresponds to a particular type of report, such as +/// the "Activity summary" or "Itemized payouts" reports. These objects are +/// identified by an ID belonging to a set of enumerated values. See +/// [API Access to Reports documentation](https://stripe.com/docs/reporting/statements/api) +/// for those Report Type IDs, along with required and optional parameters. +/// +/// Note that certain report types can only be run based on your live-mode data (not test-mode +/// data), and will error when queried without a [live-mode API key](https://stripe.com/docs/keys#test-live-modes). +/// +/// For more details see <>. +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct ReportingReportType { + /// Most recent time for which this Report Type is available. Measured in seconds since the Unix epoch. + pub data_available_end: stripe_types::Timestamp, + /// Earliest time for which this Report Type is available. Measured in seconds since the Unix epoch. + pub data_available_start: stripe_types::Timestamp, + /// List of column names that are included by default when this Report Type gets run. + /// (If the Report Type doesn't support the `columns` parameter, this will be null.). + pub default_columns: Option>, + /// The [ID of the Report Type](https://stripe.com/docs/reporting/statements/api#available-report-types), such as `balance.summary.1`. + pub id: stripe_misc::ReportingReportTypeId, + /// Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + pub livemode: bool, + /// Human-readable name of the Report Type + pub name: String, + /// When this Report Type was latest updated. Measured in seconds since the Unix epoch. + pub updated: stripe_types::Timestamp, + /// Version of the Report Type. + /// Different versions report with the same ID will have the same purpose, but may take different run parameters or have different result schemas. + pub version: i64, +} +impl stripe_types::Object for ReportingReportType { + type Id = stripe_misc::ReportingReportTypeId; + fn id(&self) -> &Self::Id { + &self.id + } +} +stripe_types::def_id!(ReportingReportTypeId); diff --git a/generated/stripe_misc/src/scheduled_query_run/mod.rs b/generated/stripe_misc/src/scheduled_query_run/mod.rs new file mode 100644 index 000000000..7ae88c3f9 --- /dev/null +++ b/generated/stripe_misc/src/scheduled_query_run/mod.rs @@ -0,0 +1,5 @@ +#[cfg(feature = "scheduled_query_run")] +mod requests; +pub(crate) mod types; +#[cfg(feature = "scheduled_query_run")] +pub use requests::*; diff --git a/generated/stripe_misc/src/scheduled_query_run/requests.rs b/generated/stripe_misc/src/scheduled_query_run/requests.rs new file mode 100644 index 000000000..bebced59e --- /dev/null +++ b/generated/stripe_misc/src/scheduled_query_run/requests.rs @@ -0,0 +1,60 @@ +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct ListScheduledQueryRun<'a> { + /// A cursor for use in pagination. + /// `ending_before` is an object ID that defines your place in the list. + /// For instance, if you make a list request and receive 100 objects, starting with `obj_bar`, your subsequent call can include `ending_before=obj_bar` in order to fetch the previous page of the list. + #[serde(skip_serializing_if = "Option::is_none")] + pub ending_before: Option<&'a str>, + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, + /// A limit on the number of objects to be returned. + /// Limit can range between 1 and 100, and the default is 10. + #[serde(skip_serializing_if = "Option::is_none")] + pub limit: Option, + /// A cursor for use in pagination. + /// `starting_after` is an object ID that defines your place in the list. + /// For instance, if you make a list request and receive 100 objects, ending with `obj_foo`, your subsequent call can include `starting_after=obj_foo` in order to fetch the next page of the list. + #[serde(skip_serializing_if = "Option::is_none")] + pub starting_after: Option<&'a str>, +} +impl<'a> ListScheduledQueryRun<'a> { + pub fn new() -> Self { + Self::default() + } +} +impl<'a> ListScheduledQueryRun<'a> { + /// Returns a list of scheduled query runs. + pub fn send( + &self, + client: &stripe::Client, + ) -> stripe::Response> { + client.get_query("/sigma/scheduled_query_runs", self) + } + pub fn paginate( + self, + ) -> stripe::ListPaginator> { + stripe::ListPaginator::from_list_params("/sigma/scheduled_query_runs", self) + } +} +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct RetrieveScheduledQueryRun<'a> { + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, +} +impl<'a> RetrieveScheduledQueryRun<'a> { + pub fn new() -> Self { + Self::default() + } +} +impl<'a> RetrieveScheduledQueryRun<'a> { + /// Retrieves the details of an scheduled query run. + pub fn send( + &self, + client: &stripe::Client, + scheduled_query_run: &str, + ) -> stripe::Response { + client.get_query(&format!("/sigma/scheduled_query_runs/{scheduled_query_run}"), self) + } +} diff --git a/generated/stripe_misc/src/scheduled_query_run/types.rs b/generated/stripe_misc/src/scheduled_query_run/types.rs new file mode 100644 index 000000000..171b45dcf --- /dev/null +++ b/generated/stripe_misc/src/scheduled_query_run/types.rs @@ -0,0 +1,36 @@ +/// If you have [scheduled a Sigma query](https://stripe.com/docs/sigma/scheduled-queries), you'll +/// receive a `sigma.scheduled_query_run.created` webhook each time the query +/// runs. The webhook contains a `ScheduledQueryRun` object, which you can use to +/// retrieve the query results. +/// +/// For more details see <>. +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct ScheduledQueryRun { + /// Time at which the object was created. Measured in seconds since the Unix epoch. + pub created: stripe_types::Timestamp, + /// When the query was run, Sigma contained a snapshot of your Stripe data at this time. + pub data_load_time: stripe_types::Timestamp, + #[serde(skip_serializing_if = "Option::is_none")] + pub error: Option, + /// The file object representing the results of the query. + pub file: Option, + /// Unique identifier for the object. + pub id: stripe_misc::ScheduledQueryRunId, + /// Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + pub livemode: bool, + /// Time at which the result expires and is no longer available for download. + pub result_available_until: stripe_types::Timestamp, + /// SQL for the query. + pub sql: String, + /// The query's execution status, which will be `completed` for successful runs, and `canceled`, `failed`, or `timed_out` otherwise. + pub status: String, + /// Title of the query. + pub title: String, +} +impl stripe_types::Object for ScheduledQueryRun { + type Id = stripe_misc::ScheduledQueryRunId; + fn id(&self) -> &Self::Id { + &self.id + } +} +stripe_types::def_id!(ScheduledQueryRunId, "sqr_"); diff --git a/generated/stripe_misc/src/sigma_scheduled_query_run_error.rs b/generated/stripe_misc/src/sigma_scheduled_query_run_error.rs new file mode 100644 index 000000000..e52c463a5 --- /dev/null +++ b/generated/stripe_misc/src/sigma_scheduled_query_run_error.rs @@ -0,0 +1,5 @@ +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct SigmaScheduledQueryRunError { + /// Information about the run failure. + pub message: String, +} diff --git a/generated/stripe_misc/src/tax_calculation/mod.rs b/generated/stripe_misc/src/tax_calculation/mod.rs new file mode 100644 index 000000000..157e8f9c6 --- /dev/null +++ b/generated/stripe_misc/src/tax_calculation/mod.rs @@ -0,0 +1,5 @@ +#[cfg(feature = "tax_calculation")] +mod requests; +pub(crate) mod types; +#[cfg(feature = "tax_calculation")] +pub use requests::*; diff --git a/generated/stripe_misc/src/tax_calculation/requests.rs b/generated/stripe_misc/src/tax_calculation/requests.rs new file mode 100644 index 000000000..bb3faf6e4 --- /dev/null +++ b/generated/stripe_misc/src/tax_calculation/requests.rs @@ -0,0 +1,663 @@ +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct ListLineItemsTaxCalculation<'a> { + /// A cursor for use in pagination. + /// `ending_before` is an object ID that defines your place in the list. + /// For instance, if you make a list request and receive 100 objects, starting with `obj_bar`, your subsequent call can include `ending_before=obj_bar` in order to fetch the previous page of the list. + #[serde(skip_serializing_if = "Option::is_none")] + pub ending_before: Option<&'a str>, + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, + /// A limit on the number of objects to be returned. + /// Limit can range between 1 and 100, and the default is 10. + #[serde(skip_serializing_if = "Option::is_none")] + pub limit: Option, + /// A cursor for use in pagination. + /// `starting_after` is an object ID that defines your place in the list. + /// For instance, if you make a list request and receive 100 objects, ending with `obj_foo`, your subsequent call can include `starting_after=obj_foo` in order to fetch the next page of the list. + #[serde(skip_serializing_if = "Option::is_none")] + pub starting_after: Option<&'a str>, +} +impl<'a> ListLineItemsTaxCalculation<'a> { + pub fn new() -> Self { + Self::default() + } +} +impl<'a> ListLineItemsTaxCalculation<'a> { + /// Retrieves the line items of a persisted tax calculation as a collection. + pub fn send( + &self, + client: &stripe::Client, + calculation: &stripe_misc::TaxCalculationId, + ) -> stripe::Response> { + client.get_query(&format!("/tax/calculations/{calculation}/line_items"), self) + } + pub fn paginate( + self, + calculation: &stripe_misc::TaxCalculationId, + ) -> stripe::ListPaginator> { + stripe::ListPaginator::from_list_params( + &format!("/tax/calculations/{calculation}/line_items"), + self, + ) + } +} +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreateTaxCalculation<'a> { + /// Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. + /// Must be a [supported currency](https://stripe.com/docs/currencies). + pub currency: stripe_types::Currency, + /// The ID of an existing customer to use for this calculation. + /// If provided, the customer's address and tax IDs are copied to `customer_details`. + #[serde(skip_serializing_if = "Option::is_none")] + pub customer: Option<&'a str>, + /// Details about the customer, including address and tax IDs. + #[serde(skip_serializing_if = "Option::is_none")] + pub customer_details: Option>, + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, + /// A list of items the customer is purchasing. + pub line_items: &'a [CreateTaxCalculationLineItems<'a>], + /// Shipping cost details to be used for the calculation. + #[serde(skip_serializing_if = "Option::is_none")] + pub shipping_cost: Option>, + /// Timestamp of date at which the tax rules and rates in effect applies for the calculation. + /// Measured in seconds since the Unix epoch. + /// Can be up to 48 hours in the past, and up to 48 hours in the future. + #[serde(skip_serializing_if = "Option::is_none")] + pub tax_date: Option, +} +impl<'a> CreateTaxCalculation<'a> { + pub fn new( + currency: stripe_types::Currency, + line_items: &'a [CreateTaxCalculationLineItems<'a>], + ) -> Self { + Self { + currency, + customer: None, + customer_details: None, + expand: None, + line_items, + shipping_cost: None, + tax_date: None, + } + } +} +/// Details about the customer, including address and tax IDs. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreateTaxCalculationCustomerDetails<'a> { + /// The customer's postal address (for example, home or business location). + #[serde(skip_serializing_if = "Option::is_none")] + pub address: Option>, + /// The type of customer address provided. + #[serde(skip_serializing_if = "Option::is_none")] + pub address_source: Option, + /// The customer's IP address (IPv4 or IPv6). + #[serde(skip_serializing_if = "Option::is_none")] + pub ip_address: Option<&'a str>, + /// The customer's tax IDs. + /// Stripe Tax might consider a transaction with applicable tax IDs to be B2B, which might affect the tax calculation result. + /// Stripe Tax doesn't validate tax IDs for correctness. + #[serde(skip_serializing_if = "Option::is_none")] + pub tax_ids: Option<&'a [CreateTaxCalculationCustomerDetailsTaxIds<'a>]>, + /// Overrides the tax calculation result to allow you to not collect tax from your customer. + /// Use this if you've manually checked your customer's tax exemptions. + /// Prefer providing the customer's `tax_ids` where possible, which automatically determines whether `reverse_charge` applies. + #[serde(skip_serializing_if = "Option::is_none")] + pub taxability_override: Option, +} +impl<'a> CreateTaxCalculationCustomerDetails<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// The customer's postal address (for example, home or business location). +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreateTaxCalculationCustomerDetailsAddress<'a> { + /// City, district, suburb, town, or village. + #[serde(skip_serializing_if = "Option::is_none")] + pub city: Option<&'a str>, + /// Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). + pub country: &'a str, + /// Address line 1 (e.g., street, PO Box, or company name). + #[serde(skip_serializing_if = "Option::is_none")] + pub line1: Option<&'a str>, + /// Address line 2 (e.g., apartment, suite, unit, or building). + #[serde(skip_serializing_if = "Option::is_none")] + pub line2: Option<&'a str>, + /// ZIP or postal code. + #[serde(skip_serializing_if = "Option::is_none")] + pub postal_code: Option<&'a str>, + /// State, county, province, or region. + /// We recommend sending [ISO 3166-2](https://en.wikipedia.org/wiki/ISO_3166-2) subdivision code value when possible. + #[serde(skip_serializing_if = "Option::is_none")] + pub state: Option<&'a str>, +} +impl<'a> CreateTaxCalculationCustomerDetailsAddress<'a> { + pub fn new(country: &'a str) -> Self { + Self { city: None, country, line1: None, line2: None, postal_code: None, state: None } + } +} +/// The type of customer address provided. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreateTaxCalculationCustomerDetailsAddressSource { + Billing, + Shipping, +} +impl CreateTaxCalculationCustomerDetailsAddressSource { + pub fn as_str(self) -> &'static str { + use CreateTaxCalculationCustomerDetailsAddressSource::*; + match self { + Billing => "billing", + Shipping => "shipping", + } + } +} + +impl std::str::FromStr for CreateTaxCalculationCustomerDetailsAddressSource { + type Err = (); + fn from_str(s: &str) -> Result { + use CreateTaxCalculationCustomerDetailsAddressSource::*; + match s { + "billing" => Ok(Billing), + "shipping" => Ok(Shipping), + _ => Err(()), + } + } +} +impl std::fmt::Display for CreateTaxCalculationCustomerDetailsAddressSource { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreateTaxCalculationCustomerDetailsAddressSource { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreateTaxCalculationCustomerDetailsAddressSource { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// The customer's tax IDs. +/// Stripe Tax might consider a transaction with applicable tax IDs to be B2B, which might affect the tax calculation result. +/// Stripe Tax doesn't validate tax IDs for correctness. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreateTaxCalculationCustomerDetailsTaxIds<'a> { + /// Type of the tax ID, one of `ad_nrt`, `ae_trn`, `ar_cuit`, `au_abn`, `au_arn`, `bg_uic`, `bo_tin`, `br_cnpj`, `br_cpf`, `ca_bn`, `ca_gst_hst`, `ca_pst_bc`, `ca_pst_mb`, `ca_pst_sk`, `ca_qst`, `ch_vat`, `cl_tin`, `cn_tin`, `co_nit`, `cr_tin`, `do_rcn`, `ec_ruc`, `eg_tin`, `es_cif`, `eu_oss_vat`, `eu_vat`, `gb_vat`, `ge_vat`, `hk_br`, `hu_tin`, `id_npwp`, `il_vat`, `in_gst`, `is_vat`, `jp_cn`, `jp_rn`, `jp_trn`, `ke_pin`, `kr_brn`, `li_uid`, `mx_rfc`, `my_frp`, `my_itn`, `my_sst`, `no_vat`, `nz_gst`, `pe_ruc`, `ph_tin`, `ro_tin`, `rs_pib`, `ru_inn`, `ru_kpp`, `sa_vat`, `sg_gst`, `sg_uen`, `si_tin`, `sv_nit`, `th_vat`, `tr_tin`, `tw_vat`, `ua_vat`, `us_ein`, `uy_ruc`, `ve_rif`, `vn_tin`, or `za_vat`. + #[serde(rename = "type")] + pub type_: CreateTaxCalculationCustomerDetailsTaxIdsType, + /// Value of the tax ID. + pub value: &'a str, +} +impl<'a> CreateTaxCalculationCustomerDetailsTaxIds<'a> { + pub fn new(type_: CreateTaxCalculationCustomerDetailsTaxIdsType, value: &'a str) -> Self { + Self { type_, value } + } +} +/// Type of the tax ID, one of `ad_nrt`, `ae_trn`, `ar_cuit`, `au_abn`, `au_arn`, `bg_uic`, `bo_tin`, `br_cnpj`, `br_cpf`, `ca_bn`, `ca_gst_hst`, `ca_pst_bc`, `ca_pst_mb`, `ca_pst_sk`, `ca_qst`, `ch_vat`, `cl_tin`, `cn_tin`, `co_nit`, `cr_tin`, `do_rcn`, `ec_ruc`, `eg_tin`, `es_cif`, `eu_oss_vat`, `eu_vat`, `gb_vat`, `ge_vat`, `hk_br`, `hu_tin`, `id_npwp`, `il_vat`, `in_gst`, `is_vat`, `jp_cn`, `jp_rn`, `jp_trn`, `ke_pin`, `kr_brn`, `li_uid`, `mx_rfc`, `my_frp`, `my_itn`, `my_sst`, `no_vat`, `nz_gst`, `pe_ruc`, `ph_tin`, `ro_tin`, `rs_pib`, `ru_inn`, `ru_kpp`, `sa_vat`, `sg_gst`, `sg_uen`, `si_tin`, `sv_nit`, `th_vat`, `tr_tin`, `tw_vat`, `ua_vat`, `us_ein`, `uy_ruc`, `ve_rif`, `vn_tin`, or `za_vat`. +#[derive(Copy, Clone, Eq, PartialEq)] +#[non_exhaustive] +pub enum CreateTaxCalculationCustomerDetailsTaxIdsType { + AdNrt, + AeTrn, + ArCuit, + AuAbn, + AuArn, + BgUic, + BoTin, + BrCnpj, + BrCpf, + CaBn, + CaGstHst, + CaPstBc, + CaPstMb, + CaPstSk, + CaQst, + ChVat, + ClTin, + CnTin, + CoNit, + CrTin, + DoRcn, + EcRuc, + EgTin, + EsCif, + EuOssVat, + EuVat, + GbVat, + GeVat, + HkBr, + HuTin, + IdNpwp, + IlVat, + InGst, + IsVat, + JpCn, + JpRn, + JpTrn, + KePin, + KrBrn, + LiUid, + MxRfc, + MyFrp, + MyItn, + MySst, + NoVat, + NzGst, + PeRuc, + PhTin, + RoTin, + RsPib, + RuInn, + RuKpp, + SaVat, + SgGst, + SgUen, + SiTin, + SvNit, + ThVat, + TrTin, + TwVat, + UaVat, + UsEin, + UyRuc, + VeRif, + VnTin, + ZaVat, + /// An unrecognized value from Stripe. Should not be used as a request parameter. + Unknown, +} +impl CreateTaxCalculationCustomerDetailsTaxIdsType { + pub fn as_str(self) -> &'static str { + use CreateTaxCalculationCustomerDetailsTaxIdsType::*; + match self { + AdNrt => "ad_nrt", + AeTrn => "ae_trn", + ArCuit => "ar_cuit", + AuAbn => "au_abn", + AuArn => "au_arn", + BgUic => "bg_uic", + BoTin => "bo_tin", + BrCnpj => "br_cnpj", + BrCpf => "br_cpf", + CaBn => "ca_bn", + CaGstHst => "ca_gst_hst", + CaPstBc => "ca_pst_bc", + CaPstMb => "ca_pst_mb", + CaPstSk => "ca_pst_sk", + CaQst => "ca_qst", + ChVat => "ch_vat", + ClTin => "cl_tin", + CnTin => "cn_tin", + CoNit => "co_nit", + CrTin => "cr_tin", + DoRcn => "do_rcn", + EcRuc => "ec_ruc", + EgTin => "eg_tin", + EsCif => "es_cif", + EuOssVat => "eu_oss_vat", + EuVat => "eu_vat", + GbVat => "gb_vat", + GeVat => "ge_vat", + HkBr => "hk_br", + HuTin => "hu_tin", + IdNpwp => "id_npwp", + IlVat => "il_vat", + InGst => "in_gst", + IsVat => "is_vat", + JpCn => "jp_cn", + JpRn => "jp_rn", + JpTrn => "jp_trn", + KePin => "ke_pin", + KrBrn => "kr_brn", + LiUid => "li_uid", + MxRfc => "mx_rfc", + MyFrp => "my_frp", + MyItn => "my_itn", + MySst => "my_sst", + NoVat => "no_vat", + NzGst => "nz_gst", + PeRuc => "pe_ruc", + PhTin => "ph_tin", + RoTin => "ro_tin", + RsPib => "rs_pib", + RuInn => "ru_inn", + RuKpp => "ru_kpp", + SaVat => "sa_vat", + SgGst => "sg_gst", + SgUen => "sg_uen", + SiTin => "si_tin", + SvNit => "sv_nit", + ThVat => "th_vat", + TrTin => "tr_tin", + TwVat => "tw_vat", + UaVat => "ua_vat", + UsEin => "us_ein", + UyRuc => "uy_ruc", + VeRif => "ve_rif", + VnTin => "vn_tin", + ZaVat => "za_vat", + Unknown => "unknown", + } + } +} + +impl std::str::FromStr for CreateTaxCalculationCustomerDetailsTaxIdsType { + type Err = (); + fn from_str(s: &str) -> Result { + use CreateTaxCalculationCustomerDetailsTaxIdsType::*; + match s { + "ad_nrt" => Ok(AdNrt), + "ae_trn" => Ok(AeTrn), + "ar_cuit" => Ok(ArCuit), + "au_abn" => Ok(AuAbn), + "au_arn" => Ok(AuArn), + "bg_uic" => Ok(BgUic), + "bo_tin" => Ok(BoTin), + "br_cnpj" => Ok(BrCnpj), + "br_cpf" => Ok(BrCpf), + "ca_bn" => Ok(CaBn), + "ca_gst_hst" => Ok(CaGstHst), + "ca_pst_bc" => Ok(CaPstBc), + "ca_pst_mb" => Ok(CaPstMb), + "ca_pst_sk" => Ok(CaPstSk), + "ca_qst" => Ok(CaQst), + "ch_vat" => Ok(ChVat), + "cl_tin" => Ok(ClTin), + "cn_tin" => Ok(CnTin), + "co_nit" => Ok(CoNit), + "cr_tin" => Ok(CrTin), + "do_rcn" => Ok(DoRcn), + "ec_ruc" => Ok(EcRuc), + "eg_tin" => Ok(EgTin), + "es_cif" => Ok(EsCif), + "eu_oss_vat" => Ok(EuOssVat), + "eu_vat" => Ok(EuVat), + "gb_vat" => Ok(GbVat), + "ge_vat" => Ok(GeVat), + "hk_br" => Ok(HkBr), + "hu_tin" => Ok(HuTin), + "id_npwp" => Ok(IdNpwp), + "il_vat" => Ok(IlVat), + "in_gst" => Ok(InGst), + "is_vat" => Ok(IsVat), + "jp_cn" => Ok(JpCn), + "jp_rn" => Ok(JpRn), + "jp_trn" => Ok(JpTrn), + "ke_pin" => Ok(KePin), + "kr_brn" => Ok(KrBrn), + "li_uid" => Ok(LiUid), + "mx_rfc" => Ok(MxRfc), + "my_frp" => Ok(MyFrp), + "my_itn" => Ok(MyItn), + "my_sst" => Ok(MySst), + "no_vat" => Ok(NoVat), + "nz_gst" => Ok(NzGst), + "pe_ruc" => Ok(PeRuc), + "ph_tin" => Ok(PhTin), + "ro_tin" => Ok(RoTin), + "rs_pib" => Ok(RsPib), + "ru_inn" => Ok(RuInn), + "ru_kpp" => Ok(RuKpp), + "sa_vat" => Ok(SaVat), + "sg_gst" => Ok(SgGst), + "sg_uen" => Ok(SgUen), + "si_tin" => Ok(SiTin), + "sv_nit" => Ok(SvNit), + "th_vat" => Ok(ThVat), + "tr_tin" => Ok(TrTin), + "tw_vat" => Ok(TwVat), + "ua_vat" => Ok(UaVat), + "us_ein" => Ok(UsEin), + "uy_ruc" => Ok(UyRuc), + "ve_rif" => Ok(VeRif), + "vn_tin" => Ok(VnTin), + "za_vat" => Ok(ZaVat), + _ => Err(()), + } + } +} +impl std::fmt::Display for CreateTaxCalculationCustomerDetailsTaxIdsType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreateTaxCalculationCustomerDetailsTaxIdsType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreateTaxCalculationCustomerDetailsTaxIdsType { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Overrides the tax calculation result to allow you to not collect tax from your customer. +/// Use this if you've manually checked your customer's tax exemptions. +/// Prefer providing the customer's `tax_ids` where possible, which automatically determines whether `reverse_charge` applies. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreateTaxCalculationCustomerDetailsTaxabilityOverride { + CustomerExempt, + None, + ReverseCharge, +} +impl CreateTaxCalculationCustomerDetailsTaxabilityOverride { + pub fn as_str(self) -> &'static str { + use CreateTaxCalculationCustomerDetailsTaxabilityOverride::*; + match self { + CustomerExempt => "customer_exempt", + None => "none", + ReverseCharge => "reverse_charge", + } + } +} + +impl std::str::FromStr for CreateTaxCalculationCustomerDetailsTaxabilityOverride { + type Err = (); + fn from_str(s: &str) -> Result { + use CreateTaxCalculationCustomerDetailsTaxabilityOverride::*; + match s { + "customer_exempt" => Ok(CustomerExempt), + "none" => Ok(None), + "reverse_charge" => Ok(ReverseCharge), + _ => Err(()), + } + } +} +impl std::fmt::Display for CreateTaxCalculationCustomerDetailsTaxabilityOverride { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreateTaxCalculationCustomerDetailsTaxabilityOverride { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreateTaxCalculationCustomerDetailsTaxabilityOverride { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// A list of items the customer is purchasing. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreateTaxCalculationLineItems<'a> { + /// A positive integer in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal) representing the line item's total price. + /// If `tax_behavior=inclusive`, then this amount includes taxes. + /// Otherwise, taxes are calculated on top of this amount. + pub amount: i64, + /// If provided, the product's `tax_code` will be used as the line item's `tax_code`. + #[serde(skip_serializing_if = "Option::is_none")] + pub product: Option<&'a str>, + /// The number of units of the item being purchased. + /// Used to calculate the per-unit price from the total `amount` for the line. + /// For example, if `amount=100` and `quantity=4`, the calculated unit price is 25. + #[serde(skip_serializing_if = "Option::is_none")] + pub quantity: Option, + /// A custom identifier for this line item, which must be unique across the line items in the calculation. + /// The reference helps identify each line item in exported [tax reports](https://stripe.com/docs/tax/reports). + #[serde(skip_serializing_if = "Option::is_none")] + pub reference: Option<&'a str>, + /// Specifies whether the `amount` includes taxes. Defaults to `exclusive`. + #[serde(skip_serializing_if = "Option::is_none")] + pub tax_behavior: Option, + /// A [tax code](https://stripe.com/docs/tax/tax-categories) ID to use for this line item. + /// If not provided, we will use the tax code from the provided `product` param. + /// If neither `tax_code` nor `product` is provided, we will use the default tax code from your Tax Settings. + #[serde(skip_serializing_if = "Option::is_none")] + pub tax_code: Option<&'a str>, +} +impl<'a> CreateTaxCalculationLineItems<'a> { + pub fn new(amount: i64) -> Self { + Self { + amount, + product: None, + quantity: None, + reference: None, + tax_behavior: None, + tax_code: None, + } + } +} +/// Specifies whether the `amount` includes taxes. Defaults to `exclusive`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreateTaxCalculationLineItemsTaxBehavior { + Exclusive, + Inclusive, +} +impl CreateTaxCalculationLineItemsTaxBehavior { + pub fn as_str(self) -> &'static str { + use CreateTaxCalculationLineItemsTaxBehavior::*; + match self { + Exclusive => "exclusive", + Inclusive => "inclusive", + } + } +} + +impl std::str::FromStr for CreateTaxCalculationLineItemsTaxBehavior { + type Err = (); + fn from_str(s: &str) -> Result { + use CreateTaxCalculationLineItemsTaxBehavior::*; + match s { + "exclusive" => Ok(Exclusive), + "inclusive" => Ok(Inclusive), + _ => Err(()), + } + } +} +impl std::fmt::Display for CreateTaxCalculationLineItemsTaxBehavior { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreateTaxCalculationLineItemsTaxBehavior { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreateTaxCalculationLineItemsTaxBehavior { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Shipping cost details to be used for the calculation. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreateTaxCalculationShippingCost<'a> { + /// A positive integer in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal) representing the shipping charge. + /// If `tax_behavior=inclusive`, then this amount includes taxes. + /// Otherwise, taxes are calculated on top of this amount. + #[serde(skip_serializing_if = "Option::is_none")] + pub amount: Option, + /// If provided, the [shipping rate](https://stripe.com/docs/api/shipping_rates/object)'s `amount`, `tax_code` and `tax_behavior` are used. + /// If you provide a shipping rate, then you cannot pass the `amount`, `tax_code`, or `tax_behavior` parameters. + #[serde(skip_serializing_if = "Option::is_none")] + pub shipping_rate: Option<&'a str>, + /// Specifies whether the `amount` includes taxes. + /// If `tax_behavior=inclusive`, then the amount includes taxes. + /// Defaults to `exclusive`. + #[serde(skip_serializing_if = "Option::is_none")] + pub tax_behavior: Option, + /// The [tax code](https://stripe.com/docs/tax/tax-categories) used to calculate tax on shipping. + /// If not provided, the default shipping tax code from your [Tax Settings](/settings/tax) is used. + #[serde(skip_serializing_if = "Option::is_none")] + pub tax_code: Option<&'a str>, +} +impl<'a> CreateTaxCalculationShippingCost<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// Specifies whether the `amount` includes taxes. +/// If `tax_behavior=inclusive`, then the amount includes taxes. +/// Defaults to `exclusive`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreateTaxCalculationShippingCostTaxBehavior { + Exclusive, + Inclusive, +} +impl CreateTaxCalculationShippingCostTaxBehavior { + pub fn as_str(self) -> &'static str { + use CreateTaxCalculationShippingCostTaxBehavior::*; + match self { + Exclusive => "exclusive", + Inclusive => "inclusive", + } + } +} + +impl std::str::FromStr for CreateTaxCalculationShippingCostTaxBehavior { + type Err = (); + fn from_str(s: &str) -> Result { + use CreateTaxCalculationShippingCostTaxBehavior::*; + match s { + "exclusive" => Ok(Exclusive), + "inclusive" => Ok(Inclusive), + _ => Err(()), + } + } +} +impl std::fmt::Display for CreateTaxCalculationShippingCostTaxBehavior { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreateTaxCalculationShippingCostTaxBehavior { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreateTaxCalculationShippingCostTaxBehavior { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'a> CreateTaxCalculation<'a> { + /// Calculates tax based on input and returns a Tax `Calculation` object. + pub fn send(&self, client: &stripe::Client) -> stripe::Response { + client.send_form("/tax/calculations", self, http_types::Method::Post) + } +} diff --git a/generated/stripe_misc/src/tax_calculation/types.rs b/generated/stripe_misc/src/tax_calculation/types.rs new file mode 100644 index 000000000..1e26a782c --- /dev/null +++ b/generated/stripe_misc/src/tax_calculation/types.rs @@ -0,0 +1,41 @@ +/// A Tax Calculation allows you to calculate the tax to collect from your customer. +/// +/// Related guide: [Calculate tax in your custom payment flow](https://stripe.com/docs/tax/custom) +/// +/// For more details see <>. +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct TaxCalculation { + /// Total after taxes. + pub amount_total: i64, + /// Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. + /// Must be a [supported currency](https://stripe.com/docs/currencies). + pub currency: stripe_types::Currency, + /// The ID of an existing [Customer](https://stripe.com/docs/api/customers/object) used for the resource. + pub customer: Option, + pub customer_details: stripe_misc::TaxProductResourceCustomerDetails, + /// Timestamp of date at which the tax calculation will expire. + pub expires_at: Option, + /// Unique identifier for the calculation. + pub id: Option, + /// The list of items the customer is purchasing. + pub line_items: Option>, + /// Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + pub livemode: bool, + /// The shipping cost details for the calculation. + pub shipping_cost: Option, + /// The amount of tax to be collected on top of the line item prices. + pub tax_amount_exclusive: i64, + /// The amount of tax already included in the line item prices. + pub tax_amount_inclusive: i64, + /// Breakdown of individual tax amounts that add up to the total. + pub tax_breakdown: Vec, + /// Timestamp of date at which the tax rules and rates in effect applies for the calculation. + pub tax_date: stripe_types::Timestamp, +} +impl stripe_types::Object for TaxCalculation { + type Id = Option; + fn id(&self) -> &Self::Id { + &self.id + } +} +stripe_types::def_id!(TaxCalculationId); diff --git a/generated/stripe_misc/src/tax_calculation_line_item.rs b/generated/stripe_misc/src/tax_calculation_line_item.rs new file mode 100644 index 000000000..6b66c87bf --- /dev/null +++ b/generated/stripe_misc/src/tax_calculation_line_item.rs @@ -0,0 +1,89 @@ +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct TaxCalculationLineItem { + /// The line item amount in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal). + /// If `tax_behavior=inclusive`, then this amount includes taxes. + /// Otherwise, taxes were calculated on top of this amount. + pub amount: i64, + /// The amount of tax calculated for this line item, in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal). + pub amount_tax: i64, + /// Unique identifier for the object. + pub id: stripe_misc::TaxCalculationLineItemId, + /// Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + pub livemode: bool, + /// The ID of an existing [Product](https://stripe.com/docs/api/products/object). + pub product: Option, + /// The number of units of the item being purchased. For reversals, this is the quantity reversed. + pub quantity: u64, + /// A custom identifier for this line item. + pub reference: Option, + /// Specifies whether the `amount` includes taxes. + /// If `tax_behavior=inclusive`, then the amount includes taxes. + pub tax_behavior: TaxCalculationLineItemTaxBehavior, + /// Detailed account of taxes relevant to this line item. + pub tax_breakdown: Option>, + /// The [tax code](https://stripe.com/docs/tax/tax-categories) ID used for this resource. + pub tax_code: String, +} +/// Specifies whether the `amount` includes taxes. +/// If `tax_behavior=inclusive`, then the amount includes taxes. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum TaxCalculationLineItemTaxBehavior { + Exclusive, + Inclusive, +} +impl TaxCalculationLineItemTaxBehavior { + pub fn as_str(self) -> &'static str { + use TaxCalculationLineItemTaxBehavior::*; + match self { + Exclusive => "exclusive", + Inclusive => "inclusive", + } + } +} + +impl std::str::FromStr for TaxCalculationLineItemTaxBehavior { + type Err = (); + fn from_str(s: &str) -> Result { + use TaxCalculationLineItemTaxBehavior::*; + match s { + "exclusive" => Ok(Exclusive), + "inclusive" => Ok(Inclusive), + _ => Err(()), + } + } +} +impl std::fmt::Display for TaxCalculationLineItemTaxBehavior { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for TaxCalculationLineItemTaxBehavior { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for TaxCalculationLineItemTaxBehavior { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for TaxCalculationLineItemTaxBehavior { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| { + serde::de::Error::custom("Unknown value for TaxCalculationLineItemTaxBehavior") + }) + } +} +impl stripe_types::Object for TaxCalculationLineItem { + type Id = stripe_misc::TaxCalculationLineItemId; + fn id(&self) -> &Self::Id { + &self.id + } +} +stripe_types::def_id!(TaxCalculationLineItemId); diff --git a/generated/stripe_misc/src/tax_product_registrations_resource_country_options.rs b/generated/stripe_misc/src/tax_product_registrations_resource_country_options.rs new file mode 100644 index 000000000..aae0c58f1 --- /dev/null +++ b/generated/stripe_misc/src/tax_product_registrations_resource_country_options.rs @@ -0,0 +1,101 @@ +#[derive(Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct TaxProductRegistrationsResourceCountryOptions { + #[serde(skip_serializing_if = "Option::is_none")] + pub ae: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub at: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub au: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub be: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub bg: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub ca: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub ch: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub cl: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub co: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub cy: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub cz: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub de: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub dk: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub ee: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub es: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub fi: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub fr: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub gb: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub gr: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub hr: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub hu: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub id: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub ie: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub is: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub it: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub jp: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub kr: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub lt: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub lu: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub lv: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub mt: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub mx: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub my: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub nl: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub no: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub nz: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub pl: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub pt: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub ro: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub sa: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub se: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub sg: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub si: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub sk: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub th: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub tr: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub us: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub vn: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub za: Option, +} diff --git a/generated/stripe_misc/src/tax_product_registrations_resource_country_options_ca_province_standard.rs b/generated/stripe_misc/src/tax_product_registrations_resource_country_options_ca_province_standard.rs new file mode 100644 index 000000000..25ebd3e5c --- /dev/null +++ b/generated/stripe_misc/src/tax_product_registrations_resource_country_options_ca_province_standard.rs @@ -0,0 +1,5 @@ +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct TaxProductRegistrationsResourceCountryOptionsCaProvinceStandard { + /// Two-letter CA province code ([ISO 3166-2](https://en.wikipedia.org/wiki/ISO_3166-2)). + pub province: String, +} diff --git a/generated/stripe_misc/src/tax_product_registrations_resource_country_options_canada.rs b/generated/stripe_misc/src/tax_product_registrations_resource_country_options_canada.rs new file mode 100644 index 000000000..c1e47c541 --- /dev/null +++ b/generated/stripe_misc/src/tax_product_registrations_resource_country_options_canada.rs @@ -0,0 +1,69 @@ +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct TaxProductRegistrationsResourceCountryOptionsCanada { + #[serde(skip_serializing_if = "Option::is_none")] + pub province_standard: + Option, + /// Type of registration in Canada. + #[serde(rename = "type")] + pub type_: TaxProductRegistrationsResourceCountryOptionsCanadaType, +} +/// Type of registration in Canada. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum TaxProductRegistrationsResourceCountryOptionsCanadaType { + ProvinceStandard, + Simplified, + Standard, +} +impl TaxProductRegistrationsResourceCountryOptionsCanadaType { + pub fn as_str(self) -> &'static str { + use TaxProductRegistrationsResourceCountryOptionsCanadaType::*; + match self { + ProvinceStandard => "province_standard", + Simplified => "simplified", + Standard => "standard", + } + } +} + +impl std::str::FromStr for TaxProductRegistrationsResourceCountryOptionsCanadaType { + type Err = (); + fn from_str(s: &str) -> Result { + use TaxProductRegistrationsResourceCountryOptionsCanadaType::*; + match s { + "province_standard" => Ok(ProvinceStandard), + "simplified" => Ok(Simplified), + "standard" => Ok(Standard), + _ => Err(()), + } + } +} +impl std::fmt::Display for TaxProductRegistrationsResourceCountryOptionsCanadaType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for TaxProductRegistrationsResourceCountryOptionsCanadaType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for TaxProductRegistrationsResourceCountryOptionsCanadaType { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for TaxProductRegistrationsResourceCountryOptionsCanadaType { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| { + serde::de::Error::custom( + "Unknown value for TaxProductRegistrationsResourceCountryOptionsCanadaType", + ) + }) + } +} diff --git a/generated/stripe_misc/src/tax_product_registrations_resource_country_options_default.rs b/generated/stripe_misc/src/tax_product_registrations_resource_country_options_default.rs new file mode 100644 index 000000000..40133e476 --- /dev/null +++ b/generated/stripe_misc/src/tax_product_registrations_resource_country_options_default.rs @@ -0,0 +1,60 @@ +#[derive(Copy, Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct TaxProductRegistrationsResourceCountryOptionsDefault { + /// Type of registration in `country`. + #[serde(rename = "type")] + pub type_: TaxProductRegistrationsResourceCountryOptionsDefaultType, +} +/// Type of registration in `country`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum TaxProductRegistrationsResourceCountryOptionsDefaultType { + Standard, +} +impl TaxProductRegistrationsResourceCountryOptionsDefaultType { + pub fn as_str(self) -> &'static str { + use TaxProductRegistrationsResourceCountryOptionsDefaultType::*; + match self { + Standard => "standard", + } + } +} + +impl std::str::FromStr for TaxProductRegistrationsResourceCountryOptionsDefaultType { + type Err = (); + fn from_str(s: &str) -> Result { + use TaxProductRegistrationsResourceCountryOptionsDefaultType::*; + match s { + "standard" => Ok(Standard), + _ => Err(()), + } + } +} +impl std::fmt::Display for TaxProductRegistrationsResourceCountryOptionsDefaultType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for TaxProductRegistrationsResourceCountryOptionsDefaultType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for TaxProductRegistrationsResourceCountryOptionsDefaultType { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for TaxProductRegistrationsResourceCountryOptionsDefaultType { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| { + serde::de::Error::custom( + "Unknown value for TaxProductRegistrationsResourceCountryOptionsDefaultType", + ) + }) + } +} diff --git a/generated/stripe_misc/src/tax_product_registrations_resource_country_options_eu_standard.rs b/generated/stripe_misc/src/tax_product_registrations_resource_country_options_eu_standard.rs new file mode 100644 index 000000000..748d439aa --- /dev/null +++ b/generated/stripe_misc/src/tax_product_registrations_resource_country_options_eu_standard.rs @@ -0,0 +1,69 @@ +#[derive(Copy, Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct TaxProductRegistrationsResourceCountryOptionsEuStandard { + /// Place of supply scheme used in an EU standard registration. + pub place_of_supply_scheme: + TaxProductRegistrationsResourceCountryOptionsEuStandardPlaceOfSupplyScheme, +} +/// Place of supply scheme used in an EU standard registration. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum TaxProductRegistrationsResourceCountryOptionsEuStandardPlaceOfSupplyScheme { + SmallSeller, + Standard, +} +impl TaxProductRegistrationsResourceCountryOptionsEuStandardPlaceOfSupplyScheme { + pub fn as_str(self) -> &'static str { + use TaxProductRegistrationsResourceCountryOptionsEuStandardPlaceOfSupplyScheme::*; + match self { + SmallSeller => "small_seller", + Standard => "standard", + } + } +} + +impl std::str::FromStr + for TaxProductRegistrationsResourceCountryOptionsEuStandardPlaceOfSupplyScheme +{ + type Err = (); + fn from_str(s: &str) -> Result { + use TaxProductRegistrationsResourceCountryOptionsEuStandardPlaceOfSupplyScheme::*; + match s { + "small_seller" => Ok(SmallSeller), + "standard" => Ok(Standard), + _ => Err(()), + } + } +} +impl std::fmt::Display + for TaxProductRegistrationsResourceCountryOptionsEuStandardPlaceOfSupplyScheme +{ + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug + for TaxProductRegistrationsResourceCountryOptionsEuStandardPlaceOfSupplyScheme +{ + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize + for TaxProductRegistrationsResourceCountryOptionsEuStandardPlaceOfSupplyScheme +{ + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> + for TaxProductRegistrationsResourceCountryOptionsEuStandardPlaceOfSupplyScheme +{ + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for TaxProductRegistrationsResourceCountryOptionsEuStandardPlaceOfSupplyScheme")) + } +} diff --git a/generated/stripe_misc/src/tax_product_registrations_resource_country_options_europe.rs b/generated/stripe_misc/src/tax_product_registrations_resource_country_options_europe.rs new file mode 100644 index 000000000..c428dc383 --- /dev/null +++ b/generated/stripe_misc/src/tax_product_registrations_resource_country_options_europe.rs @@ -0,0 +1,71 @@ +#[derive(Copy, Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct TaxProductRegistrationsResourceCountryOptionsEurope { + #[serde(skip_serializing_if = "Option::is_none")] + pub standard: Option, + /// Type of registration in an EU country. + #[serde(rename = "type")] + pub type_: TaxProductRegistrationsResourceCountryOptionsEuropeType, +} +/// Type of registration in an EU country. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum TaxProductRegistrationsResourceCountryOptionsEuropeType { + Ioss, + OssNonUnion, + OssUnion, + Standard, +} +impl TaxProductRegistrationsResourceCountryOptionsEuropeType { + pub fn as_str(self) -> &'static str { + use TaxProductRegistrationsResourceCountryOptionsEuropeType::*; + match self { + Ioss => "ioss", + OssNonUnion => "oss_non_union", + OssUnion => "oss_union", + Standard => "standard", + } + } +} + +impl std::str::FromStr for TaxProductRegistrationsResourceCountryOptionsEuropeType { + type Err = (); + fn from_str(s: &str) -> Result { + use TaxProductRegistrationsResourceCountryOptionsEuropeType::*; + match s { + "ioss" => Ok(Ioss), + "oss_non_union" => Ok(OssNonUnion), + "oss_union" => Ok(OssUnion), + "standard" => Ok(Standard), + _ => Err(()), + } + } +} +impl std::fmt::Display for TaxProductRegistrationsResourceCountryOptionsEuropeType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for TaxProductRegistrationsResourceCountryOptionsEuropeType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for TaxProductRegistrationsResourceCountryOptionsEuropeType { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for TaxProductRegistrationsResourceCountryOptionsEuropeType { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| { + serde::de::Error::custom( + "Unknown value for TaxProductRegistrationsResourceCountryOptionsEuropeType", + ) + }) + } +} diff --git a/generated/stripe_misc/src/tax_product_registrations_resource_country_options_simplified.rs b/generated/stripe_misc/src/tax_product_registrations_resource_country_options_simplified.rs new file mode 100644 index 000000000..1d29bc159 --- /dev/null +++ b/generated/stripe_misc/src/tax_product_registrations_resource_country_options_simplified.rs @@ -0,0 +1,60 @@ +#[derive(Copy, Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct TaxProductRegistrationsResourceCountryOptionsSimplified { + /// Type of registration in `country`. + #[serde(rename = "type")] + pub type_: TaxProductRegistrationsResourceCountryOptionsSimplifiedType, +} +/// Type of registration in `country`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum TaxProductRegistrationsResourceCountryOptionsSimplifiedType { + Simplified, +} +impl TaxProductRegistrationsResourceCountryOptionsSimplifiedType { + pub fn as_str(self) -> &'static str { + use TaxProductRegistrationsResourceCountryOptionsSimplifiedType::*; + match self { + Simplified => "simplified", + } + } +} + +impl std::str::FromStr for TaxProductRegistrationsResourceCountryOptionsSimplifiedType { + type Err = (); + fn from_str(s: &str) -> Result { + use TaxProductRegistrationsResourceCountryOptionsSimplifiedType::*; + match s { + "simplified" => Ok(Simplified), + _ => Err(()), + } + } +} +impl std::fmt::Display for TaxProductRegistrationsResourceCountryOptionsSimplifiedType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for TaxProductRegistrationsResourceCountryOptionsSimplifiedType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for TaxProductRegistrationsResourceCountryOptionsSimplifiedType { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for TaxProductRegistrationsResourceCountryOptionsSimplifiedType { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| { + serde::de::Error::custom( + "Unknown value for TaxProductRegistrationsResourceCountryOptionsSimplifiedType", + ) + }) + } +} diff --git a/generated/stripe_misc/src/tax_product_registrations_resource_country_options_united_states.rs b/generated/stripe_misc/src/tax_product_registrations_resource_country_options_united_states.rs new file mode 100644 index 000000000..a970b140d --- /dev/null +++ b/generated/stripe_misc/src/tax_product_registrations_resource_country_options_united_states.rs @@ -0,0 +1,79 @@ +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct TaxProductRegistrationsResourceCountryOptionsUnitedStates { + #[serde(skip_serializing_if = "Option::is_none")] + pub local_amusement_tax: + Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub local_lease_tax: + Option, + /// Two-letter US state code ([ISO 3166-2](https://en.wikipedia.org/wiki/ISO_3166-2)). + pub state: String, + /// Type of registration in the US. + #[serde(rename = "type")] + pub type_: TaxProductRegistrationsResourceCountryOptionsUnitedStatesType, +} +/// Type of registration in the US. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum TaxProductRegistrationsResourceCountryOptionsUnitedStatesType { + LocalAmusementTax, + LocalLeaseTax, + StateCommunicationsTax, + StateSalesTax, +} +impl TaxProductRegistrationsResourceCountryOptionsUnitedStatesType { + pub fn as_str(self) -> &'static str { + use TaxProductRegistrationsResourceCountryOptionsUnitedStatesType::*; + match self { + LocalAmusementTax => "local_amusement_tax", + LocalLeaseTax => "local_lease_tax", + StateCommunicationsTax => "state_communications_tax", + StateSalesTax => "state_sales_tax", + } + } +} + +impl std::str::FromStr for TaxProductRegistrationsResourceCountryOptionsUnitedStatesType { + type Err = (); + fn from_str(s: &str) -> Result { + use TaxProductRegistrationsResourceCountryOptionsUnitedStatesType::*; + match s { + "local_amusement_tax" => Ok(LocalAmusementTax), + "local_lease_tax" => Ok(LocalLeaseTax), + "state_communications_tax" => Ok(StateCommunicationsTax), + "state_sales_tax" => Ok(StateSalesTax), + _ => Err(()), + } + } +} +impl std::fmt::Display for TaxProductRegistrationsResourceCountryOptionsUnitedStatesType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for TaxProductRegistrationsResourceCountryOptionsUnitedStatesType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for TaxProductRegistrationsResourceCountryOptionsUnitedStatesType { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> + for TaxProductRegistrationsResourceCountryOptionsUnitedStatesType +{ + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| { + serde::de::Error::custom( + "Unknown value for TaxProductRegistrationsResourceCountryOptionsUnitedStatesType", + ) + }) + } +} diff --git a/generated/stripe_misc/src/tax_product_registrations_resource_country_options_us_local_amusement_tax.rs b/generated/stripe_misc/src/tax_product_registrations_resource_country_options_us_local_amusement_tax.rs new file mode 100644 index 000000000..9ddcfee48 --- /dev/null +++ b/generated/stripe_misc/src/tax_product_registrations_resource_country_options_us_local_amusement_tax.rs @@ -0,0 +1,5 @@ +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct TaxProductRegistrationsResourceCountryOptionsUsLocalAmusementTax { + /// A [FIPS code](https://www.census.gov/library/reference/code-lists/ansi.html) representing the local jurisdiction. + pub jurisdiction: String, +} diff --git a/generated/stripe_misc/src/tax_product_registrations_resource_country_options_us_local_lease_tax.rs b/generated/stripe_misc/src/tax_product_registrations_resource_country_options_us_local_lease_tax.rs new file mode 100644 index 000000000..69c7fb567 --- /dev/null +++ b/generated/stripe_misc/src/tax_product_registrations_resource_country_options_us_local_lease_tax.rs @@ -0,0 +1,5 @@ +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct TaxProductRegistrationsResourceCountryOptionsUsLocalLeaseTax { + /// A [FIPS code](https://www.census.gov/library/reference/code-lists/ansi.html) representing the local jurisdiction. + pub jurisdiction: String, +} diff --git a/generated/stripe_misc/src/tax_product_resource_customer_details.rs b/generated/stripe_misc/src/tax_product_resource_customer_details.rs new file mode 100644 index 000000000..3de071af8 --- /dev/null +++ b/generated/stripe_misc/src/tax_product_resource_customer_details.rs @@ -0,0 +1,130 @@ +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct TaxProductResourceCustomerDetails { + /// The customer's postal address (for example, home or business location). + pub address: Option, + /// The type of customer address provided. + pub address_source: Option, + /// The customer's IP address (IPv4 or IPv6). + pub ip_address: Option, + /// The customer's tax IDs (for example, EU VAT numbers). + pub tax_ids: Vec, + /// The taxability override used for taxation. + pub taxability_override: TaxProductResourceCustomerDetailsTaxabilityOverride, +} +/// The type of customer address provided. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum TaxProductResourceCustomerDetailsAddressSource { + Billing, + Shipping, +} +impl TaxProductResourceCustomerDetailsAddressSource { + pub fn as_str(self) -> &'static str { + use TaxProductResourceCustomerDetailsAddressSource::*; + match self { + Billing => "billing", + Shipping => "shipping", + } + } +} + +impl std::str::FromStr for TaxProductResourceCustomerDetailsAddressSource { + type Err = (); + fn from_str(s: &str) -> Result { + use TaxProductResourceCustomerDetailsAddressSource::*; + match s { + "billing" => Ok(Billing), + "shipping" => Ok(Shipping), + _ => Err(()), + } + } +} +impl std::fmt::Display for TaxProductResourceCustomerDetailsAddressSource { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for TaxProductResourceCustomerDetailsAddressSource { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for TaxProductResourceCustomerDetailsAddressSource { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for TaxProductResourceCustomerDetailsAddressSource { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| { + serde::de::Error::custom( + "Unknown value for TaxProductResourceCustomerDetailsAddressSource", + ) + }) + } +} +/// The taxability override used for taxation. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum TaxProductResourceCustomerDetailsTaxabilityOverride { + CustomerExempt, + None, + ReverseCharge, +} +impl TaxProductResourceCustomerDetailsTaxabilityOverride { + pub fn as_str(self) -> &'static str { + use TaxProductResourceCustomerDetailsTaxabilityOverride::*; + match self { + CustomerExempt => "customer_exempt", + None => "none", + ReverseCharge => "reverse_charge", + } + } +} + +impl std::str::FromStr for TaxProductResourceCustomerDetailsTaxabilityOverride { + type Err = (); + fn from_str(s: &str) -> Result { + use TaxProductResourceCustomerDetailsTaxabilityOverride::*; + match s { + "customer_exempt" => Ok(CustomerExempt), + "none" => Ok(None), + "reverse_charge" => Ok(ReverseCharge), + _ => Err(()), + } + } +} +impl std::fmt::Display for TaxProductResourceCustomerDetailsTaxabilityOverride { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for TaxProductResourceCustomerDetailsTaxabilityOverride { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for TaxProductResourceCustomerDetailsTaxabilityOverride { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for TaxProductResourceCustomerDetailsTaxabilityOverride { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| { + serde::de::Error::custom( + "Unknown value for TaxProductResourceCustomerDetailsTaxabilityOverride", + ) + }) + } +} diff --git a/generated/stripe_misc/src/tax_product_resource_customer_details_resource_tax_id.rs b/generated/stripe_misc/src/tax_product_resource_customer_details_resource_tax_id.rs new file mode 100644 index 000000000..1e89a4fdc --- /dev/null +++ b/generated/stripe_misc/src/tax_product_resource_customer_details_resource_tax_id.rs @@ -0,0 +1,260 @@ +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct TaxProductResourceCustomerDetailsResourceTaxId { + /// The type of the tax ID, one of `ad_nrt`, `ar_cuit`, `eu_vat`, `bo_tin`, `br_cnpj`, `br_cpf`, `cn_tin`, `co_nit`, `cr_tin`, `do_rcn`, `ec_ruc`, `eu_oss_vat`, `pe_ruc`, `ro_tin`, `rs_pib`, `sv_nit`, `uy_ruc`, `ve_rif`, `vn_tin`, `gb_vat`, `nz_gst`, `au_abn`, `au_arn`, `in_gst`, `no_vat`, `za_vat`, `ch_vat`, `mx_rfc`, `sg_uen`, `ru_inn`, `ru_kpp`, `ca_bn`, `hk_br`, `es_cif`, `tw_vat`, `th_vat`, `jp_cn`, `jp_rn`, `jp_trn`, `li_uid`, `my_itn`, `us_ein`, `kr_brn`, `ca_qst`, `ca_gst_hst`, `ca_pst_bc`, `ca_pst_mb`, `ca_pst_sk`, `my_sst`, `sg_gst`, `ae_trn`, `cl_tin`, `sa_vat`, `id_npwp`, `my_frp`, `il_vat`, `ge_vat`, `ua_vat`, `is_vat`, `bg_uic`, `hu_tin`, `si_tin`, `ke_pin`, `tr_tin`, `eg_tin`, `ph_tin`, or `unknown`. + #[serde(rename = "type")] + pub type_: TaxProductResourceCustomerDetailsResourceTaxIdType, + /// The value of the tax ID. + pub value: String, +} +/// The type of the tax ID, one of `ad_nrt`, `ar_cuit`, `eu_vat`, `bo_tin`, `br_cnpj`, `br_cpf`, `cn_tin`, `co_nit`, `cr_tin`, `do_rcn`, `ec_ruc`, `eu_oss_vat`, `pe_ruc`, `ro_tin`, `rs_pib`, `sv_nit`, `uy_ruc`, `ve_rif`, `vn_tin`, `gb_vat`, `nz_gst`, `au_abn`, `au_arn`, `in_gst`, `no_vat`, `za_vat`, `ch_vat`, `mx_rfc`, `sg_uen`, `ru_inn`, `ru_kpp`, `ca_bn`, `hk_br`, `es_cif`, `tw_vat`, `th_vat`, `jp_cn`, `jp_rn`, `jp_trn`, `li_uid`, `my_itn`, `us_ein`, `kr_brn`, `ca_qst`, `ca_gst_hst`, `ca_pst_bc`, `ca_pst_mb`, `ca_pst_sk`, `my_sst`, `sg_gst`, `ae_trn`, `cl_tin`, `sa_vat`, `id_npwp`, `my_frp`, `il_vat`, `ge_vat`, `ua_vat`, `is_vat`, `bg_uic`, `hu_tin`, `si_tin`, `ke_pin`, `tr_tin`, `eg_tin`, `ph_tin`, or `unknown`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum TaxProductResourceCustomerDetailsResourceTaxIdType { + AdNrt, + AeTrn, + ArCuit, + AuAbn, + AuArn, + BgUic, + BoTin, + BrCnpj, + BrCpf, + CaBn, + CaGstHst, + CaPstBc, + CaPstMb, + CaPstSk, + CaQst, + ChVat, + ClTin, + CnTin, + CoNit, + CrTin, + DoRcn, + EcRuc, + EgTin, + EsCif, + EuOssVat, + EuVat, + GbVat, + GeVat, + HkBr, + HuTin, + IdNpwp, + IlVat, + InGst, + IsVat, + JpCn, + JpRn, + JpTrn, + KePin, + KrBrn, + LiUid, + MxRfc, + MyFrp, + MyItn, + MySst, + NoVat, + NzGst, + PeRuc, + PhTin, + RoTin, + RsPib, + RuInn, + RuKpp, + SaVat, + SgGst, + SgUen, + SiTin, + SvNit, + ThVat, + TrTin, + TwVat, + UaVat, + Unknown, + UsEin, + UyRuc, + VeRif, + VnTin, + ZaVat, +} +impl TaxProductResourceCustomerDetailsResourceTaxIdType { + pub fn as_str(self) -> &'static str { + use TaxProductResourceCustomerDetailsResourceTaxIdType::*; + match self { + AdNrt => "ad_nrt", + AeTrn => "ae_trn", + ArCuit => "ar_cuit", + AuAbn => "au_abn", + AuArn => "au_arn", + BgUic => "bg_uic", + BoTin => "bo_tin", + BrCnpj => "br_cnpj", + BrCpf => "br_cpf", + CaBn => "ca_bn", + CaGstHst => "ca_gst_hst", + CaPstBc => "ca_pst_bc", + CaPstMb => "ca_pst_mb", + CaPstSk => "ca_pst_sk", + CaQst => "ca_qst", + ChVat => "ch_vat", + ClTin => "cl_tin", + CnTin => "cn_tin", + CoNit => "co_nit", + CrTin => "cr_tin", + DoRcn => "do_rcn", + EcRuc => "ec_ruc", + EgTin => "eg_tin", + EsCif => "es_cif", + EuOssVat => "eu_oss_vat", + EuVat => "eu_vat", + GbVat => "gb_vat", + GeVat => "ge_vat", + HkBr => "hk_br", + HuTin => "hu_tin", + IdNpwp => "id_npwp", + IlVat => "il_vat", + InGst => "in_gst", + IsVat => "is_vat", + JpCn => "jp_cn", + JpRn => "jp_rn", + JpTrn => "jp_trn", + KePin => "ke_pin", + KrBrn => "kr_brn", + LiUid => "li_uid", + MxRfc => "mx_rfc", + MyFrp => "my_frp", + MyItn => "my_itn", + MySst => "my_sst", + NoVat => "no_vat", + NzGst => "nz_gst", + PeRuc => "pe_ruc", + PhTin => "ph_tin", + RoTin => "ro_tin", + RsPib => "rs_pib", + RuInn => "ru_inn", + RuKpp => "ru_kpp", + SaVat => "sa_vat", + SgGst => "sg_gst", + SgUen => "sg_uen", + SiTin => "si_tin", + SvNit => "sv_nit", + ThVat => "th_vat", + TrTin => "tr_tin", + TwVat => "tw_vat", + UaVat => "ua_vat", + Unknown => "unknown", + UsEin => "us_ein", + UyRuc => "uy_ruc", + VeRif => "ve_rif", + VnTin => "vn_tin", + ZaVat => "za_vat", + } + } +} + +impl std::str::FromStr for TaxProductResourceCustomerDetailsResourceTaxIdType { + type Err = (); + fn from_str(s: &str) -> Result { + use TaxProductResourceCustomerDetailsResourceTaxIdType::*; + match s { + "ad_nrt" => Ok(AdNrt), + "ae_trn" => Ok(AeTrn), + "ar_cuit" => Ok(ArCuit), + "au_abn" => Ok(AuAbn), + "au_arn" => Ok(AuArn), + "bg_uic" => Ok(BgUic), + "bo_tin" => Ok(BoTin), + "br_cnpj" => Ok(BrCnpj), + "br_cpf" => Ok(BrCpf), + "ca_bn" => Ok(CaBn), + "ca_gst_hst" => Ok(CaGstHst), + "ca_pst_bc" => Ok(CaPstBc), + "ca_pst_mb" => Ok(CaPstMb), + "ca_pst_sk" => Ok(CaPstSk), + "ca_qst" => Ok(CaQst), + "ch_vat" => Ok(ChVat), + "cl_tin" => Ok(ClTin), + "cn_tin" => Ok(CnTin), + "co_nit" => Ok(CoNit), + "cr_tin" => Ok(CrTin), + "do_rcn" => Ok(DoRcn), + "ec_ruc" => Ok(EcRuc), + "eg_tin" => Ok(EgTin), + "es_cif" => Ok(EsCif), + "eu_oss_vat" => Ok(EuOssVat), + "eu_vat" => Ok(EuVat), + "gb_vat" => Ok(GbVat), + "ge_vat" => Ok(GeVat), + "hk_br" => Ok(HkBr), + "hu_tin" => Ok(HuTin), + "id_npwp" => Ok(IdNpwp), + "il_vat" => Ok(IlVat), + "in_gst" => Ok(InGst), + "is_vat" => Ok(IsVat), + "jp_cn" => Ok(JpCn), + "jp_rn" => Ok(JpRn), + "jp_trn" => Ok(JpTrn), + "ke_pin" => Ok(KePin), + "kr_brn" => Ok(KrBrn), + "li_uid" => Ok(LiUid), + "mx_rfc" => Ok(MxRfc), + "my_frp" => Ok(MyFrp), + "my_itn" => Ok(MyItn), + "my_sst" => Ok(MySst), + "no_vat" => Ok(NoVat), + "nz_gst" => Ok(NzGst), + "pe_ruc" => Ok(PeRuc), + "ph_tin" => Ok(PhTin), + "ro_tin" => Ok(RoTin), + "rs_pib" => Ok(RsPib), + "ru_inn" => Ok(RuInn), + "ru_kpp" => Ok(RuKpp), + "sa_vat" => Ok(SaVat), + "sg_gst" => Ok(SgGst), + "sg_uen" => Ok(SgUen), + "si_tin" => Ok(SiTin), + "sv_nit" => Ok(SvNit), + "th_vat" => Ok(ThVat), + "tr_tin" => Ok(TrTin), + "tw_vat" => Ok(TwVat), + "ua_vat" => Ok(UaVat), + "unknown" => Ok(Unknown), + "us_ein" => Ok(UsEin), + "uy_ruc" => Ok(UyRuc), + "ve_rif" => Ok(VeRif), + "vn_tin" => Ok(VnTin), + "za_vat" => Ok(ZaVat), + _ => Err(()), + } + } +} +impl std::fmt::Display for TaxProductResourceCustomerDetailsResourceTaxIdType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for TaxProductResourceCustomerDetailsResourceTaxIdType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for TaxProductResourceCustomerDetailsResourceTaxIdType { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for TaxProductResourceCustomerDetailsResourceTaxIdType { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| { + serde::de::Error::custom( + "Unknown value for TaxProductResourceCustomerDetailsResourceTaxIdType", + ) + }) + } +} diff --git a/generated/stripe_misc/src/tax_product_resource_jurisdiction.rs b/generated/stripe_misc/src/tax_product_resource_jurisdiction.rs new file mode 100644 index 000000000..47fd98460 --- /dev/null +++ b/generated/stripe_misc/src/tax_product_resource_jurisdiction.rs @@ -0,0 +1,76 @@ +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct TaxProductResourceJurisdiction { + /// Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). + pub country: String, + /// A human-readable name for the jurisdiction imposing the tax. + pub display_name: String, + /// Indicates the level of the jurisdiction imposing the tax. + pub level: TaxProductResourceJurisdictionLevel, + /// [ISO 3166-2 subdivision code](https://en.wikipedia.org/wiki/ISO_3166-2:US), without country prefix. + /// For example, "NY" for New York, United States. + pub state: Option, +} +/// Indicates the level of the jurisdiction imposing the tax. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum TaxProductResourceJurisdictionLevel { + City, + Country, + County, + District, + State, +} +impl TaxProductResourceJurisdictionLevel { + pub fn as_str(self) -> &'static str { + use TaxProductResourceJurisdictionLevel::*; + match self { + City => "city", + Country => "country", + County => "county", + District => "district", + State => "state", + } + } +} + +impl std::str::FromStr for TaxProductResourceJurisdictionLevel { + type Err = (); + fn from_str(s: &str) -> Result { + use TaxProductResourceJurisdictionLevel::*; + match s { + "city" => Ok(City), + "country" => Ok(Country), + "county" => Ok(County), + "district" => Ok(District), + "state" => Ok(State), + _ => Err(()), + } + } +} +impl std::fmt::Display for TaxProductResourceJurisdictionLevel { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for TaxProductResourceJurisdictionLevel { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for TaxProductResourceJurisdictionLevel { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for TaxProductResourceJurisdictionLevel { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| { + serde::de::Error::custom("Unknown value for TaxProductResourceJurisdictionLevel") + }) + } +} diff --git a/generated/stripe_misc/src/tax_product_resource_line_item_tax_breakdown.rs b/generated/stripe_misc/src/tax_product_resource_line_item_tax_breakdown.rs new file mode 100644 index 000000000..b69be54d9 --- /dev/null +++ b/generated/stripe_misc/src/tax_product_resource_line_item_tax_breakdown.rs @@ -0,0 +1,171 @@ +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct TaxProductResourceLineItemTaxBreakdown { + /// The amount of tax, in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal). + pub amount: i64, + pub jurisdiction: stripe_misc::TaxProductResourceJurisdiction, + /// Indicates whether the jurisdiction was determined by the origin (merchant's address) or destination (customer's address). + pub sourcing: TaxProductResourceLineItemTaxBreakdownSourcing, + /// Details regarding the rate for this tax. + /// This field will be `null` when the tax is not imposed, for example if the product is exempt from tax. + pub tax_rate_details: Option, + /// The reasoning behind this tax, for example, if the product is tax exempt. + /// The possible values for this field may be extended as new tax rules are supported. + pub taxability_reason: TaxProductResourceLineItemTaxBreakdownTaxabilityReason, + /// The amount on which tax is calculated, in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal). + pub taxable_amount: i64, +} +/// Indicates whether the jurisdiction was determined by the origin (merchant's address) or destination (customer's address). +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum TaxProductResourceLineItemTaxBreakdownSourcing { + Destination, + Origin, +} +impl TaxProductResourceLineItemTaxBreakdownSourcing { + pub fn as_str(self) -> &'static str { + use TaxProductResourceLineItemTaxBreakdownSourcing::*; + match self { + Destination => "destination", + Origin => "origin", + } + } +} + +impl std::str::FromStr for TaxProductResourceLineItemTaxBreakdownSourcing { + type Err = (); + fn from_str(s: &str) -> Result { + use TaxProductResourceLineItemTaxBreakdownSourcing::*; + match s { + "destination" => Ok(Destination), + "origin" => Ok(Origin), + _ => Err(()), + } + } +} +impl std::fmt::Display for TaxProductResourceLineItemTaxBreakdownSourcing { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for TaxProductResourceLineItemTaxBreakdownSourcing { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for TaxProductResourceLineItemTaxBreakdownSourcing { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for TaxProductResourceLineItemTaxBreakdownSourcing { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| { + serde::de::Error::custom( + "Unknown value for TaxProductResourceLineItemTaxBreakdownSourcing", + ) + }) + } +} +/// The reasoning behind this tax, for example, if the product is tax exempt. +/// The possible values for this field may be extended as new tax rules are supported. +#[derive(Copy, Clone, Eq, PartialEq)] +#[non_exhaustive] +pub enum TaxProductResourceLineItemTaxBreakdownTaxabilityReason { + CustomerExempt, + NotCollecting, + NotSubjectToTax, + NotSupported, + PortionProductExempt, + PortionReducedRated, + PortionStandardRated, + ProductExempt, + ProductExemptHoliday, + ProportionallyRated, + ReducedRated, + ReverseCharge, + StandardRated, + TaxableBasisReduced, + ZeroRated, + /// An unrecognized value from Stripe. Should not be used as a request parameter. + Unknown, +} +impl TaxProductResourceLineItemTaxBreakdownTaxabilityReason { + pub fn as_str(self) -> &'static str { + use TaxProductResourceLineItemTaxBreakdownTaxabilityReason::*; + match self { + CustomerExempt => "customer_exempt", + NotCollecting => "not_collecting", + NotSubjectToTax => "not_subject_to_tax", + NotSupported => "not_supported", + PortionProductExempt => "portion_product_exempt", + PortionReducedRated => "portion_reduced_rated", + PortionStandardRated => "portion_standard_rated", + ProductExempt => "product_exempt", + ProductExemptHoliday => "product_exempt_holiday", + ProportionallyRated => "proportionally_rated", + ReducedRated => "reduced_rated", + ReverseCharge => "reverse_charge", + StandardRated => "standard_rated", + TaxableBasisReduced => "taxable_basis_reduced", + ZeroRated => "zero_rated", + Unknown => "unknown", + } + } +} + +impl std::str::FromStr for TaxProductResourceLineItemTaxBreakdownTaxabilityReason { + type Err = (); + fn from_str(s: &str) -> Result { + use TaxProductResourceLineItemTaxBreakdownTaxabilityReason::*; + match s { + "customer_exempt" => Ok(CustomerExempt), + "not_collecting" => Ok(NotCollecting), + "not_subject_to_tax" => Ok(NotSubjectToTax), + "not_supported" => Ok(NotSupported), + "portion_product_exempt" => Ok(PortionProductExempt), + "portion_reduced_rated" => Ok(PortionReducedRated), + "portion_standard_rated" => Ok(PortionStandardRated), + "product_exempt" => Ok(ProductExempt), + "product_exempt_holiday" => Ok(ProductExemptHoliday), + "proportionally_rated" => Ok(ProportionallyRated), + "reduced_rated" => Ok(ReducedRated), + "reverse_charge" => Ok(ReverseCharge), + "standard_rated" => Ok(StandardRated), + "taxable_basis_reduced" => Ok(TaxableBasisReduced), + "zero_rated" => Ok(ZeroRated), + _ => Err(()), + } + } +} +impl std::fmt::Display for TaxProductResourceLineItemTaxBreakdownTaxabilityReason { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for TaxProductResourceLineItemTaxBreakdownTaxabilityReason { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for TaxProductResourceLineItemTaxBreakdownTaxabilityReason { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for TaxProductResourceLineItemTaxBreakdownTaxabilityReason { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Ok(Self::from_str(&s) + .unwrap_or(TaxProductResourceLineItemTaxBreakdownTaxabilityReason::Unknown)) + } +} diff --git a/generated/stripe_misc/src/tax_product_resource_line_item_tax_rate_details.rs b/generated/stripe_misc/src/tax_product_resource_line_item_tax_rate_details.rs new file mode 100644 index 000000000..253bd40a4 --- /dev/null +++ b/generated/stripe_misc/src/tax_product_resource_line_item_tax_rate_details.rs @@ -0,0 +1,97 @@ +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct TaxProductResourceLineItemTaxRateDetails { + /// A localized display name for tax type, intended to be human-readable. + /// For example, "Local Sales and Use Tax", "Value-added tax (VAT)", or "Umsatzsteuer (USt.)". + pub display_name: String, + /// The tax rate percentage as a string. For example, 8.5% is represented as "8.5". + pub percentage_decimal: String, + /// The tax type, such as `vat` or `sales_tax`. + pub tax_type: TaxProductResourceLineItemTaxRateDetailsTaxType, +} +/// The tax type, such as `vat` or `sales_tax`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum TaxProductResourceLineItemTaxRateDetailsTaxType { + AmusementTax, + CommunicationsTax, + Gst, + Hst, + Igst, + Jct, + LeaseTax, + Pst, + Qst, + Rst, + SalesTax, + Vat, +} +impl TaxProductResourceLineItemTaxRateDetailsTaxType { + pub fn as_str(self) -> &'static str { + use TaxProductResourceLineItemTaxRateDetailsTaxType::*; + match self { + AmusementTax => "amusement_tax", + CommunicationsTax => "communications_tax", + Gst => "gst", + Hst => "hst", + Igst => "igst", + Jct => "jct", + LeaseTax => "lease_tax", + Pst => "pst", + Qst => "qst", + Rst => "rst", + SalesTax => "sales_tax", + Vat => "vat", + } + } +} + +impl std::str::FromStr for TaxProductResourceLineItemTaxRateDetailsTaxType { + type Err = (); + fn from_str(s: &str) -> Result { + use TaxProductResourceLineItemTaxRateDetailsTaxType::*; + match s { + "amusement_tax" => Ok(AmusementTax), + "communications_tax" => Ok(CommunicationsTax), + "gst" => Ok(Gst), + "hst" => Ok(Hst), + "igst" => Ok(Igst), + "jct" => Ok(Jct), + "lease_tax" => Ok(LeaseTax), + "pst" => Ok(Pst), + "qst" => Ok(Qst), + "rst" => Ok(Rst), + "sales_tax" => Ok(SalesTax), + "vat" => Ok(Vat), + _ => Err(()), + } + } +} +impl std::fmt::Display for TaxProductResourceLineItemTaxRateDetailsTaxType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for TaxProductResourceLineItemTaxRateDetailsTaxType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for TaxProductResourceLineItemTaxRateDetailsTaxType { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for TaxProductResourceLineItemTaxRateDetailsTaxType { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| { + serde::de::Error::custom( + "Unknown value for TaxProductResourceLineItemTaxRateDetailsTaxType", + ) + }) + } +} diff --git a/generated/stripe_misc/src/tax_product_resource_postal_address.rs b/generated/stripe_misc/src/tax_product_resource_postal_address.rs new file mode 100644 index 000000000..b048f8c16 --- /dev/null +++ b/generated/stripe_misc/src/tax_product_resource_postal_address.rs @@ -0,0 +1,16 @@ +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct TaxProductResourcePostalAddress { + /// City, district, suburb, town, or village. + pub city: Option, + /// Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). + pub country: String, + /// Address line 1 (e.g., street, PO Box, or company name). + pub line1: Option, + /// Address line 2 (e.g., apartment, suite, unit, or building). + pub line2: Option, + /// ZIP or postal code. + pub postal_code: Option, + /// State/province as an [ISO 3166-2](https://en.wikipedia.org/wiki/ISO_3166-2) subdivision code, without country prefix. + /// Example: "NY" or "TX". + pub state: Option, +} diff --git a/generated/stripe_misc/src/tax_product_resource_tax_breakdown.rs b/generated/stripe_misc/src/tax_product_resource_tax_breakdown.rs new file mode 100644 index 000000000..ee5b2c3e5 --- /dev/null +++ b/generated/stripe_misc/src/tax_product_resource_tax_breakdown.rs @@ -0,0 +1,110 @@ +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct TaxProductResourceTaxBreakdown { + /// The amount of tax, in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal). + pub amount: i64, + /// Specifies whether the tax amount is included in the line item amount. + pub inclusive: bool, + pub tax_rate_details: stripe_misc::TaxProductResourceTaxRateDetails, + /// The reasoning behind this tax, for example, if the product is tax exempt. + /// We might extend the possible values for this field to support new tax rules. + pub taxability_reason: TaxProductResourceTaxBreakdownTaxabilityReason, + /// The amount on which tax is calculated, in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal). + pub taxable_amount: i64, +} +/// The reasoning behind this tax, for example, if the product is tax exempt. +/// We might extend the possible values for this field to support new tax rules. +#[derive(Copy, Clone, Eq, PartialEq)] +#[non_exhaustive] +pub enum TaxProductResourceTaxBreakdownTaxabilityReason { + CustomerExempt, + NotCollecting, + NotSubjectToTax, + NotSupported, + PortionProductExempt, + PortionReducedRated, + PortionStandardRated, + ProductExempt, + ProductExemptHoliday, + ProportionallyRated, + ReducedRated, + ReverseCharge, + StandardRated, + TaxableBasisReduced, + ZeroRated, + /// An unrecognized value from Stripe. Should not be used as a request parameter. + Unknown, +} +impl TaxProductResourceTaxBreakdownTaxabilityReason { + pub fn as_str(self) -> &'static str { + use TaxProductResourceTaxBreakdownTaxabilityReason::*; + match self { + CustomerExempt => "customer_exempt", + NotCollecting => "not_collecting", + NotSubjectToTax => "not_subject_to_tax", + NotSupported => "not_supported", + PortionProductExempt => "portion_product_exempt", + PortionReducedRated => "portion_reduced_rated", + PortionStandardRated => "portion_standard_rated", + ProductExempt => "product_exempt", + ProductExemptHoliday => "product_exempt_holiday", + ProportionallyRated => "proportionally_rated", + ReducedRated => "reduced_rated", + ReverseCharge => "reverse_charge", + StandardRated => "standard_rated", + TaxableBasisReduced => "taxable_basis_reduced", + ZeroRated => "zero_rated", + Unknown => "unknown", + } + } +} + +impl std::str::FromStr for TaxProductResourceTaxBreakdownTaxabilityReason { + type Err = (); + fn from_str(s: &str) -> Result { + use TaxProductResourceTaxBreakdownTaxabilityReason::*; + match s { + "customer_exempt" => Ok(CustomerExempt), + "not_collecting" => Ok(NotCollecting), + "not_subject_to_tax" => Ok(NotSubjectToTax), + "not_supported" => Ok(NotSupported), + "portion_product_exempt" => Ok(PortionProductExempt), + "portion_reduced_rated" => Ok(PortionReducedRated), + "portion_standard_rated" => Ok(PortionStandardRated), + "product_exempt" => Ok(ProductExempt), + "product_exempt_holiday" => Ok(ProductExemptHoliday), + "proportionally_rated" => Ok(ProportionallyRated), + "reduced_rated" => Ok(ReducedRated), + "reverse_charge" => Ok(ReverseCharge), + "standard_rated" => Ok(StandardRated), + "taxable_basis_reduced" => Ok(TaxableBasisReduced), + "zero_rated" => Ok(ZeroRated), + _ => Err(()), + } + } +} +impl std::fmt::Display for TaxProductResourceTaxBreakdownTaxabilityReason { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for TaxProductResourceTaxBreakdownTaxabilityReason { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for TaxProductResourceTaxBreakdownTaxabilityReason { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for TaxProductResourceTaxBreakdownTaxabilityReason { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Ok(Self::from_str(&s).unwrap_or(TaxProductResourceTaxBreakdownTaxabilityReason::Unknown)) + } +} diff --git a/generated/stripe_misc/src/tax_product_resource_tax_calculation_shipping_cost.rs b/generated/stripe_misc/src/tax_product_resource_tax_calculation_shipping_cost.rs new file mode 100644 index 000000000..0ed83962c --- /dev/null +++ b/generated/stripe_misc/src/tax_product_resource_tax_calculation_shipping_cost.rs @@ -0,0 +1,78 @@ +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct TaxProductResourceTaxCalculationShippingCost { + /// The shipping amount in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal). + /// If `tax_behavior=inclusive`, then this amount includes taxes. + /// Otherwise, taxes were calculated on top of this amount. + pub amount: i64, + /// The amount of tax calculated for shipping, in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal). + pub amount_tax: i64, + /// The ID of an existing [ShippingRate](https://stripe.com/docs/api/shipping_rates/object). + #[serde(skip_serializing_if = "Option::is_none")] + pub shipping_rate: Option, + /// Specifies whether the `amount` includes taxes. + /// If `tax_behavior=inclusive`, then the amount includes taxes. + pub tax_behavior: TaxProductResourceTaxCalculationShippingCostTaxBehavior, + /// Detailed account of taxes relevant to shipping cost. + #[serde(skip_serializing_if = "Option::is_none")] + pub tax_breakdown: Option>, + /// The [tax code](https://stripe.com/docs/tax/tax-categories) ID used for shipping. + pub tax_code: String, +} +/// Specifies whether the `amount` includes taxes. +/// If `tax_behavior=inclusive`, then the amount includes taxes. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum TaxProductResourceTaxCalculationShippingCostTaxBehavior { + Exclusive, + Inclusive, +} +impl TaxProductResourceTaxCalculationShippingCostTaxBehavior { + pub fn as_str(self) -> &'static str { + use TaxProductResourceTaxCalculationShippingCostTaxBehavior::*; + match self { + Exclusive => "exclusive", + Inclusive => "inclusive", + } + } +} + +impl std::str::FromStr for TaxProductResourceTaxCalculationShippingCostTaxBehavior { + type Err = (); + fn from_str(s: &str) -> Result { + use TaxProductResourceTaxCalculationShippingCostTaxBehavior::*; + match s { + "exclusive" => Ok(Exclusive), + "inclusive" => Ok(Inclusive), + _ => Err(()), + } + } +} +impl std::fmt::Display for TaxProductResourceTaxCalculationShippingCostTaxBehavior { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for TaxProductResourceTaxCalculationShippingCostTaxBehavior { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for TaxProductResourceTaxCalculationShippingCostTaxBehavior { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for TaxProductResourceTaxCalculationShippingCostTaxBehavior { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| { + serde::de::Error::custom( + "Unknown value for TaxProductResourceTaxCalculationShippingCostTaxBehavior", + ) + }) + } +} diff --git a/generated/stripe_misc/src/tax_product_resource_tax_rate_details.rs b/generated/stripe_misc/src/tax_product_resource_tax_rate_details.rs new file mode 100644 index 000000000..8a300f041 --- /dev/null +++ b/generated/stripe_misc/src/tax_product_resource_tax_rate_details.rs @@ -0,0 +1,96 @@ +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct TaxProductResourceTaxRateDetails { + /// Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). + pub country: Option, + /// The tax rate percentage as a string. For example, 8.5% is represented as `"8.5"`. + pub percentage_decimal: String, + /// State, county, province, or region. + pub state: Option, + /// The tax type, such as `vat` or `sales_tax`. + pub tax_type: Option, +} +/// The tax type, such as `vat` or `sales_tax`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum TaxProductResourceTaxRateDetailsTaxType { + AmusementTax, + CommunicationsTax, + Gst, + Hst, + Igst, + Jct, + LeaseTax, + Pst, + Qst, + Rst, + SalesTax, + Vat, +} +impl TaxProductResourceTaxRateDetailsTaxType { + pub fn as_str(self) -> &'static str { + use TaxProductResourceTaxRateDetailsTaxType::*; + match self { + AmusementTax => "amusement_tax", + CommunicationsTax => "communications_tax", + Gst => "gst", + Hst => "hst", + Igst => "igst", + Jct => "jct", + LeaseTax => "lease_tax", + Pst => "pst", + Qst => "qst", + Rst => "rst", + SalesTax => "sales_tax", + Vat => "vat", + } + } +} + +impl std::str::FromStr for TaxProductResourceTaxRateDetailsTaxType { + type Err = (); + fn from_str(s: &str) -> Result { + use TaxProductResourceTaxRateDetailsTaxType::*; + match s { + "amusement_tax" => Ok(AmusementTax), + "communications_tax" => Ok(CommunicationsTax), + "gst" => Ok(Gst), + "hst" => Ok(Hst), + "igst" => Ok(Igst), + "jct" => Ok(Jct), + "lease_tax" => Ok(LeaseTax), + "pst" => Ok(Pst), + "qst" => Ok(Qst), + "rst" => Ok(Rst), + "sales_tax" => Ok(SalesTax), + "vat" => Ok(Vat), + _ => Err(()), + } + } +} +impl std::fmt::Display for TaxProductResourceTaxRateDetailsTaxType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for TaxProductResourceTaxRateDetailsTaxType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for TaxProductResourceTaxRateDetailsTaxType { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for TaxProductResourceTaxRateDetailsTaxType { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| { + serde::de::Error::custom("Unknown value for TaxProductResourceTaxRateDetailsTaxType") + }) + } +} diff --git a/generated/stripe_misc/src/tax_product_resource_tax_settings_defaults.rs b/generated/stripe_misc/src/tax_product_resource_tax_settings_defaults.rs new file mode 100644 index 000000000..c883b10f6 --- /dev/null +++ b/generated/stripe_misc/src/tax_product_resource_tax_settings_defaults.rs @@ -0,0 +1,69 @@ +#[derive(Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct TaxProductResourceTaxSettingsDefaults { + /// Default [tax behavior](https://stripe.com/docs/tax/products-prices-tax-categories-tax-behavior#tax-behavior) used to specify whether the price is considered inclusive of taxes or exclusive of taxes. + /// If the item's price has a tax behavior set, it will take precedence over the default tax behavior. + pub tax_behavior: Option, + /// Default [tax code](https://stripe.com/docs/tax/tax-categories) used to classify your products and prices. + pub tax_code: Option, +} +/// Default [tax behavior](https://stripe.com/docs/tax/products-prices-tax-categories-tax-behavior#tax-behavior) used to specify whether the price is considered inclusive of taxes or exclusive of taxes. +/// If the item's price has a tax behavior set, it will take precedence over the default tax behavior. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum TaxProductResourceTaxSettingsDefaultsTaxBehavior { + Exclusive, + Inclusive, + InferredByCurrency, +} +impl TaxProductResourceTaxSettingsDefaultsTaxBehavior { + pub fn as_str(self) -> &'static str { + use TaxProductResourceTaxSettingsDefaultsTaxBehavior::*; + match self { + Exclusive => "exclusive", + Inclusive => "inclusive", + InferredByCurrency => "inferred_by_currency", + } + } +} + +impl std::str::FromStr for TaxProductResourceTaxSettingsDefaultsTaxBehavior { + type Err = (); + fn from_str(s: &str) -> Result { + use TaxProductResourceTaxSettingsDefaultsTaxBehavior::*; + match s { + "exclusive" => Ok(Exclusive), + "inclusive" => Ok(Inclusive), + "inferred_by_currency" => Ok(InferredByCurrency), + _ => Err(()), + } + } +} +impl std::fmt::Display for TaxProductResourceTaxSettingsDefaultsTaxBehavior { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for TaxProductResourceTaxSettingsDefaultsTaxBehavior { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for TaxProductResourceTaxSettingsDefaultsTaxBehavior { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for TaxProductResourceTaxSettingsDefaultsTaxBehavior { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| { + serde::de::Error::custom( + "Unknown value for TaxProductResourceTaxSettingsDefaultsTaxBehavior", + ) + }) + } +} diff --git a/generated/stripe_misc/src/tax_product_resource_tax_settings_head_office.rs b/generated/stripe_misc/src/tax_product_resource_tax_settings_head_office.rs new file mode 100644 index 000000000..403641525 --- /dev/null +++ b/generated/stripe_misc/src/tax_product_resource_tax_settings_head_office.rs @@ -0,0 +1,4 @@ +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct TaxProductResourceTaxSettingsHeadOffice { + pub address: stripe_shared::Address, +} diff --git a/generated/stripe_misc/src/tax_product_resource_tax_settings_status_details.rs b/generated/stripe_misc/src/tax_product_resource_tax_settings_status_details.rs new file mode 100644 index 000000000..f31f4308f --- /dev/null +++ b/generated/stripe_misc/src/tax_product_resource_tax_settings_status_details.rs @@ -0,0 +1,7 @@ +#[derive(Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct TaxProductResourceTaxSettingsStatusDetails { + #[serde(skip_serializing_if = "Option::is_none")] + pub active: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub pending: Option, +} diff --git a/generated/stripe_misc/src/tax_product_resource_tax_settings_status_details_resource_active.rs b/generated/stripe_misc/src/tax_product_resource_tax_settings_status_details_resource_active.rs new file mode 100644 index 000000000..f55dff9ac --- /dev/null +++ b/generated/stripe_misc/src/tax_product_resource_tax_settings_status_details_resource_active.rs @@ -0,0 +1,2 @@ +#[derive(Copy, Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct TaxProductResourceTaxSettingsStatusDetailsResourceActive {} diff --git a/generated/stripe_misc/src/tax_product_resource_tax_settings_status_details_resource_pending.rs b/generated/stripe_misc/src/tax_product_resource_tax_settings_status_details_resource_pending.rs new file mode 100644 index 000000000..4aa35d5b8 --- /dev/null +++ b/generated/stripe_misc/src/tax_product_resource_tax_settings_status_details_resource_pending.rs @@ -0,0 +1,8 @@ +#[derive(Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct TaxProductResourceTaxSettingsStatusDetailsResourcePending { + /// The list of missing fields that are required to perform calculations. + /// It includes the entry `head_office` when the status is `pending`. + /// It is recommended to set the optional values even if they aren't listed as required for calculating taxes. + /// Calculations can fail if missing fields aren't explicitly provided on every call. + pub missing_fields: Option>, +} diff --git a/generated/stripe_misc/src/tax_product_resource_tax_transaction_line_item_resource_reversal.rs b/generated/stripe_misc/src/tax_product_resource_tax_transaction_line_item_resource_reversal.rs new file mode 100644 index 000000000..076e5937d --- /dev/null +++ b/generated/stripe_misc/src/tax_product_resource_tax_transaction_line_item_resource_reversal.rs @@ -0,0 +1,5 @@ +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct TaxProductResourceTaxTransactionLineItemResourceReversal { + /// The `id` of the line item to reverse in the original transaction. + pub original_line_item: String, +} diff --git a/generated/stripe_misc/src/tax_product_resource_tax_transaction_resource_reversal.rs b/generated/stripe_misc/src/tax_product_resource_tax_transaction_resource_reversal.rs new file mode 100644 index 000000000..fee5e9769 --- /dev/null +++ b/generated/stripe_misc/src/tax_product_resource_tax_transaction_resource_reversal.rs @@ -0,0 +1,5 @@ +#[derive(Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct TaxProductResourceTaxTransactionResourceReversal { + /// The `id` of the reversed `Transaction` object. + pub original_transaction: Option, +} diff --git a/generated/stripe_misc/src/tax_product_resource_tax_transaction_shipping_cost.rs b/generated/stripe_misc/src/tax_product_resource_tax_transaction_shipping_cost.rs new file mode 100644 index 000000000..c23e6bb91 --- /dev/null +++ b/generated/stripe_misc/src/tax_product_resource_tax_transaction_shipping_cost.rs @@ -0,0 +1,79 @@ +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct TaxProductResourceTaxTransactionShippingCost { + /// The shipping amount in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal). + /// If `tax_behavior=inclusive`, then this amount includes taxes. + /// Otherwise, taxes were calculated on top of this amount. + pub amount: i64, + /// The amount of tax calculated for shipping, in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal). + pub amount_tax: i64, + /// The ID of an existing [ShippingRate](https://stripe.com/docs/api/shipping_rates/object). + #[serde(skip_serializing_if = "Option::is_none")] + pub shipping_rate: Option, + /// Specifies whether the `amount` includes taxes. + /// If `tax_behavior=inclusive`, then the amount includes taxes. + pub tax_behavior: TaxProductResourceTaxTransactionShippingCostTaxBehavior, + /// Detailed account of taxes relevant to shipping cost. + /// (It is not populated for the transaction resource object and will be removed in the next API version.). + #[serde(skip_serializing_if = "Option::is_none")] + pub tax_breakdown: Option>, + /// The [tax code](https://stripe.com/docs/tax/tax-categories) ID used for shipping. + pub tax_code: String, +} +/// Specifies whether the `amount` includes taxes. +/// If `tax_behavior=inclusive`, then the amount includes taxes. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum TaxProductResourceTaxTransactionShippingCostTaxBehavior { + Exclusive, + Inclusive, +} +impl TaxProductResourceTaxTransactionShippingCostTaxBehavior { + pub fn as_str(self) -> &'static str { + use TaxProductResourceTaxTransactionShippingCostTaxBehavior::*; + match self { + Exclusive => "exclusive", + Inclusive => "inclusive", + } + } +} + +impl std::str::FromStr for TaxProductResourceTaxTransactionShippingCostTaxBehavior { + type Err = (); + fn from_str(s: &str) -> Result { + use TaxProductResourceTaxTransactionShippingCostTaxBehavior::*; + match s { + "exclusive" => Ok(Exclusive), + "inclusive" => Ok(Inclusive), + _ => Err(()), + } + } +} +impl std::fmt::Display for TaxProductResourceTaxTransactionShippingCostTaxBehavior { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for TaxProductResourceTaxTransactionShippingCostTaxBehavior { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for TaxProductResourceTaxTransactionShippingCostTaxBehavior { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for TaxProductResourceTaxTransactionShippingCostTaxBehavior { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| { + serde::de::Error::custom( + "Unknown value for TaxProductResourceTaxTransactionShippingCostTaxBehavior", + ) + }) + } +} diff --git a/generated/stripe_misc/src/tax_registration/mod.rs b/generated/stripe_misc/src/tax_registration/mod.rs new file mode 100644 index 000000000..a26ecdf81 --- /dev/null +++ b/generated/stripe_misc/src/tax_registration/mod.rs @@ -0,0 +1,5 @@ +#[cfg(feature = "tax_registration")] +mod requests; +pub(crate) mod types; +#[cfg(feature = "tax_registration")] +pub use requests::*; diff --git a/generated/stripe_misc/src/tax_registration/requests.rs b/generated/stripe_misc/src/tax_registration/requests.rs new file mode 100644 index 000000000..a64b8d749 --- /dev/null +++ b/generated/stripe_misc/src/tax_registration/requests.rs @@ -0,0 +1,5035 @@ +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct ListTaxRegistration<'a> { + /// A cursor for use in pagination. + /// `ending_before` is an object ID that defines your place in the list. + /// For instance, if you make a list request and receive 100 objects, starting with `obj_bar`, your subsequent call can include `ending_before=obj_bar` in order to fetch the previous page of the list. + #[serde(skip_serializing_if = "Option::is_none")] + pub ending_before: Option<&'a str>, + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, + /// A limit on the number of objects to be returned. + /// Limit can range between 1 and 100, and the default is 10. + #[serde(skip_serializing_if = "Option::is_none")] + pub limit: Option, + /// A cursor for use in pagination. + /// `starting_after` is an object ID that defines your place in the list. + /// For instance, if you make a list request and receive 100 objects, ending with `obj_foo`, your subsequent call can include `starting_after=obj_foo` in order to fetch the next page of the list. + #[serde(skip_serializing_if = "Option::is_none")] + pub starting_after: Option<&'a str>, + /// The status of the Tax Registration. + #[serde(skip_serializing_if = "Option::is_none")] + pub status: Option, +} +impl<'a> ListTaxRegistration<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// The status of the Tax Registration. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum ListTaxRegistrationStatus { + Active, + All, + Expired, + Scheduled, +} +impl ListTaxRegistrationStatus { + pub fn as_str(self) -> &'static str { + use ListTaxRegistrationStatus::*; + match self { + Active => "active", + All => "all", + Expired => "expired", + Scheduled => "scheduled", + } + } +} + +impl std::str::FromStr for ListTaxRegistrationStatus { + type Err = (); + fn from_str(s: &str) -> Result { + use ListTaxRegistrationStatus::*; + match s { + "active" => Ok(Active), + "all" => Ok(All), + "expired" => Ok(Expired), + "scheduled" => Ok(Scheduled), + _ => Err(()), + } + } +} +impl std::fmt::Display for ListTaxRegistrationStatus { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for ListTaxRegistrationStatus { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for ListTaxRegistrationStatus { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'a> ListTaxRegistration<'a> { + /// Returns a list of Tax `Registration` objects. + pub fn send( + &self, + client: &stripe::Client, + ) -> stripe::Response> { + client.get_query("/tax/registrations", self) + } + pub fn paginate( + self, + ) -> stripe::ListPaginator> { + stripe::ListPaginator::from_list_params("/tax/registrations", self) + } +} +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct RetrieveTaxRegistration<'a> { + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, +} +impl<'a> RetrieveTaxRegistration<'a> { + pub fn new() -> Self { + Self::default() + } +} +impl<'a> RetrieveTaxRegistration<'a> { + /// Returns a Tax `Registration` object. + pub fn send( + &self, + client: &stripe::Client, + id: &stripe_misc::TaxRegistrationId, + ) -> stripe::Response { + client.get_query(&format!("/tax/registrations/{id}"), self) + } +} +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreateTaxRegistration<'a> { + /// Time at which the Tax Registration becomes active. + /// It can be either `now` to indicate the current time, or a future timestamp measured in seconds since the Unix epoch. + pub active_from: CreateTaxRegistrationActiveFrom, + /// Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). + pub country: &'a str, + /// Specific options for a registration in the specified `country`. + pub country_options: CreateTaxRegistrationCountryOptions<'a>, + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, + /// If set, the Tax Registration stops being active at this time. + /// If not set, the Tax Registration will be active indefinitely. + /// Timestamp measured in seconds since the Unix epoch. + #[serde(skip_serializing_if = "Option::is_none")] + pub expires_at: Option, +} +impl<'a> CreateTaxRegistration<'a> { + pub fn new( + active_from: CreateTaxRegistrationActiveFrom, + country: &'a str, + country_options: CreateTaxRegistrationCountryOptions<'a>, + ) -> Self { + Self { active_from, country, country_options, expand: None, expires_at: None } + } +} +/// Time at which the Tax Registration becomes active. +/// It can be either `now` to indicate the current time, or a future timestamp measured in seconds since the Unix epoch. +#[derive(Copy, Clone, Debug, serde::Serialize)] +#[serde(untagged)] +pub enum CreateTaxRegistrationActiveFrom { + Now, + Timestamp(stripe_types::Timestamp), +} +/// Specific options for a registration in the specified `country`. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreateTaxRegistrationCountryOptions<'a> { + /// Options for the registration in AE. + #[serde(skip_serializing_if = "Option::is_none")] + pub ae: Option, + /// Options for the registration in AT. + #[serde(skip_serializing_if = "Option::is_none")] + pub at: Option, + /// Options for the registration in AU. + #[serde(skip_serializing_if = "Option::is_none")] + pub au: Option, + /// Options for the registration in BE. + #[serde(skip_serializing_if = "Option::is_none")] + pub be: Option, + /// Options for the registration in BG. + #[serde(skip_serializing_if = "Option::is_none")] + pub bg: Option, + /// Options for the registration in CA. + #[serde(skip_serializing_if = "Option::is_none")] + pub ca: Option>, + /// Options for the registration in CH. + #[serde(skip_serializing_if = "Option::is_none")] + pub ch: Option, + /// Options for the registration in CL. + #[serde(skip_serializing_if = "Option::is_none")] + pub cl: Option, + /// Options for the registration in CO. + #[serde(skip_serializing_if = "Option::is_none")] + pub co: Option, + /// Options for the registration in CY. + #[serde(skip_serializing_if = "Option::is_none")] + pub cy: Option, + /// Options for the registration in CZ. + #[serde(skip_serializing_if = "Option::is_none")] + pub cz: Option, + /// Options for the registration in DE. + #[serde(skip_serializing_if = "Option::is_none")] + pub de: Option, + /// Options for the registration in DK. + #[serde(skip_serializing_if = "Option::is_none")] + pub dk: Option, + /// Options for the registration in EE. + #[serde(skip_serializing_if = "Option::is_none")] + pub ee: Option, + /// Options for the registration in ES. + #[serde(skip_serializing_if = "Option::is_none")] + pub es: Option, + /// Options for the registration in FI. + #[serde(skip_serializing_if = "Option::is_none")] + pub fi: Option, + /// Options for the registration in FR. + #[serde(skip_serializing_if = "Option::is_none")] + pub fr: Option, + /// Options for the registration in GB. + #[serde(skip_serializing_if = "Option::is_none")] + pub gb: Option, + /// Options for the registration in GR. + #[serde(skip_serializing_if = "Option::is_none")] + pub gr: Option, + /// Options for the registration in HR. + #[serde(skip_serializing_if = "Option::is_none")] + pub hr: Option, + /// Options for the registration in HU. + #[serde(skip_serializing_if = "Option::is_none")] + pub hu: Option, + /// Options for the registration in ID. + #[serde(skip_serializing_if = "Option::is_none")] + pub id: Option, + /// Options for the registration in IE. + #[serde(skip_serializing_if = "Option::is_none")] + pub ie: Option, + /// Options for the registration in IS. + #[serde(skip_serializing_if = "Option::is_none")] + pub is: Option, + /// Options for the registration in IT. + #[serde(skip_serializing_if = "Option::is_none")] + pub it: Option, + /// Options for the registration in JP. + #[serde(skip_serializing_if = "Option::is_none")] + pub jp: Option, + /// Options for the registration in KR. + #[serde(skip_serializing_if = "Option::is_none")] + pub kr: Option, + /// Options for the registration in LT. + #[serde(skip_serializing_if = "Option::is_none")] + pub lt: Option, + /// Options for the registration in LU. + #[serde(skip_serializing_if = "Option::is_none")] + pub lu: Option, + /// Options for the registration in LV. + #[serde(skip_serializing_if = "Option::is_none")] + pub lv: Option, + /// Options for the registration in MT. + #[serde(skip_serializing_if = "Option::is_none")] + pub mt: Option, + /// Options for the registration in MX. + #[serde(skip_serializing_if = "Option::is_none")] + pub mx: Option, + /// Options for the registration in MY. + #[serde(skip_serializing_if = "Option::is_none")] + pub my: Option, + /// Options for the registration in NL. + #[serde(skip_serializing_if = "Option::is_none")] + pub nl: Option, + /// Options for the registration in NO. + #[serde(skip_serializing_if = "Option::is_none")] + pub no: Option, + /// Options for the registration in NZ. + #[serde(skip_serializing_if = "Option::is_none")] + pub nz: Option, + /// Options for the registration in PL. + #[serde(skip_serializing_if = "Option::is_none")] + pub pl: Option, + /// Options for the registration in PT. + #[serde(skip_serializing_if = "Option::is_none")] + pub pt: Option, + /// Options for the registration in RO. + #[serde(skip_serializing_if = "Option::is_none")] + pub ro: Option, + /// Options for the registration in SA. + #[serde(skip_serializing_if = "Option::is_none")] + pub sa: Option, + /// Options for the registration in SE. + #[serde(skip_serializing_if = "Option::is_none")] + pub se: Option, + /// Options for the registration in SG. + #[serde(skip_serializing_if = "Option::is_none")] + pub sg: Option, + /// Options for the registration in SI. + #[serde(skip_serializing_if = "Option::is_none")] + pub si: Option, + /// Options for the registration in SK. + #[serde(skip_serializing_if = "Option::is_none")] + pub sk: Option, + /// Options for the registration in TH. + #[serde(skip_serializing_if = "Option::is_none")] + pub th: Option, + /// Options for the registration in TR. + #[serde(skip_serializing_if = "Option::is_none")] + pub tr: Option, + /// Options for the registration in US. + #[serde(skip_serializing_if = "Option::is_none")] + pub us: Option>, + /// Options for the registration in VN. + #[serde(skip_serializing_if = "Option::is_none")] + pub vn: Option, + /// Options for the registration in ZA. + #[serde(skip_serializing_if = "Option::is_none")] + pub za: Option, +} +impl<'a> CreateTaxRegistrationCountryOptions<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// Options for the registration in AE. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreateTaxRegistrationCountryOptionsAe { + /// Type of registration to be created in `country`. + #[serde(rename = "type")] + pub type_: CreateTaxRegistrationCountryOptionsAeType, +} +impl CreateTaxRegistrationCountryOptionsAe { + pub fn new(type_: CreateTaxRegistrationCountryOptionsAeType) -> Self { + Self { type_ } + } +} +/// Type of registration to be created in `country`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreateTaxRegistrationCountryOptionsAeType { + Standard, +} +impl CreateTaxRegistrationCountryOptionsAeType { + pub fn as_str(self) -> &'static str { + use CreateTaxRegistrationCountryOptionsAeType::*; + match self { + Standard => "standard", + } + } +} + +impl std::str::FromStr for CreateTaxRegistrationCountryOptionsAeType { + type Err = (); + fn from_str(s: &str) -> Result { + use CreateTaxRegistrationCountryOptionsAeType::*; + match s { + "standard" => Ok(Standard), + _ => Err(()), + } + } +} +impl std::fmt::Display for CreateTaxRegistrationCountryOptionsAeType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreateTaxRegistrationCountryOptionsAeType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreateTaxRegistrationCountryOptionsAeType { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Options for the registration in AT. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreateTaxRegistrationCountryOptionsAt { + /// Options for the standard registration. + #[serde(skip_serializing_if = "Option::is_none")] + pub standard: Option, + /// Type of registration to be created in an EU country. + #[serde(rename = "type")] + pub type_: CreateTaxRegistrationCountryOptionsAtType, +} +impl CreateTaxRegistrationCountryOptionsAt { + pub fn new(type_: CreateTaxRegistrationCountryOptionsAtType) -> Self { + Self { standard: None, type_ } + } +} +/// Options for the standard registration. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreateTaxRegistrationCountryOptionsAtStandard { + /// Place of supply scheme used in an EU standard registration. + pub place_of_supply_scheme: CreateTaxRegistrationCountryOptionsAtStandardPlaceOfSupplyScheme, +} +impl CreateTaxRegistrationCountryOptionsAtStandard { + pub fn new( + place_of_supply_scheme: CreateTaxRegistrationCountryOptionsAtStandardPlaceOfSupplyScheme, + ) -> Self { + Self { place_of_supply_scheme } + } +} +/// Place of supply scheme used in an EU standard registration. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreateTaxRegistrationCountryOptionsAtStandardPlaceOfSupplyScheme { + SmallSeller, + Standard, +} +impl CreateTaxRegistrationCountryOptionsAtStandardPlaceOfSupplyScheme { + pub fn as_str(self) -> &'static str { + use CreateTaxRegistrationCountryOptionsAtStandardPlaceOfSupplyScheme::*; + match self { + SmallSeller => "small_seller", + Standard => "standard", + } + } +} + +impl std::str::FromStr for CreateTaxRegistrationCountryOptionsAtStandardPlaceOfSupplyScheme { + type Err = (); + fn from_str(s: &str) -> Result { + use CreateTaxRegistrationCountryOptionsAtStandardPlaceOfSupplyScheme::*; + match s { + "small_seller" => Ok(SmallSeller), + "standard" => Ok(Standard), + _ => Err(()), + } + } +} +impl std::fmt::Display for CreateTaxRegistrationCountryOptionsAtStandardPlaceOfSupplyScheme { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreateTaxRegistrationCountryOptionsAtStandardPlaceOfSupplyScheme { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreateTaxRegistrationCountryOptionsAtStandardPlaceOfSupplyScheme { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Type of registration to be created in an EU country. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreateTaxRegistrationCountryOptionsAtType { + Ioss, + OssNonUnion, + OssUnion, + Standard, +} +impl CreateTaxRegistrationCountryOptionsAtType { + pub fn as_str(self) -> &'static str { + use CreateTaxRegistrationCountryOptionsAtType::*; + match self { + Ioss => "ioss", + OssNonUnion => "oss_non_union", + OssUnion => "oss_union", + Standard => "standard", + } + } +} + +impl std::str::FromStr for CreateTaxRegistrationCountryOptionsAtType { + type Err = (); + fn from_str(s: &str) -> Result { + use CreateTaxRegistrationCountryOptionsAtType::*; + match s { + "ioss" => Ok(Ioss), + "oss_non_union" => Ok(OssNonUnion), + "oss_union" => Ok(OssUnion), + "standard" => Ok(Standard), + _ => Err(()), + } + } +} +impl std::fmt::Display for CreateTaxRegistrationCountryOptionsAtType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreateTaxRegistrationCountryOptionsAtType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreateTaxRegistrationCountryOptionsAtType { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Options for the registration in AU. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreateTaxRegistrationCountryOptionsAu { + /// Type of registration to be created in `country`. + #[serde(rename = "type")] + pub type_: CreateTaxRegistrationCountryOptionsAuType, +} +impl CreateTaxRegistrationCountryOptionsAu { + pub fn new(type_: CreateTaxRegistrationCountryOptionsAuType) -> Self { + Self { type_ } + } +} +/// Type of registration to be created in `country`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreateTaxRegistrationCountryOptionsAuType { + Standard, +} +impl CreateTaxRegistrationCountryOptionsAuType { + pub fn as_str(self) -> &'static str { + use CreateTaxRegistrationCountryOptionsAuType::*; + match self { + Standard => "standard", + } + } +} + +impl std::str::FromStr for CreateTaxRegistrationCountryOptionsAuType { + type Err = (); + fn from_str(s: &str) -> Result { + use CreateTaxRegistrationCountryOptionsAuType::*; + match s { + "standard" => Ok(Standard), + _ => Err(()), + } + } +} +impl std::fmt::Display for CreateTaxRegistrationCountryOptionsAuType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreateTaxRegistrationCountryOptionsAuType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreateTaxRegistrationCountryOptionsAuType { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Options for the registration in BE. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreateTaxRegistrationCountryOptionsBe { + /// Options for the standard registration. + #[serde(skip_serializing_if = "Option::is_none")] + pub standard: Option, + /// Type of registration to be created in an EU country. + #[serde(rename = "type")] + pub type_: CreateTaxRegistrationCountryOptionsBeType, +} +impl CreateTaxRegistrationCountryOptionsBe { + pub fn new(type_: CreateTaxRegistrationCountryOptionsBeType) -> Self { + Self { standard: None, type_ } + } +} +/// Options for the standard registration. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreateTaxRegistrationCountryOptionsBeStandard { + /// Place of supply scheme used in an EU standard registration. + pub place_of_supply_scheme: CreateTaxRegistrationCountryOptionsBeStandardPlaceOfSupplyScheme, +} +impl CreateTaxRegistrationCountryOptionsBeStandard { + pub fn new( + place_of_supply_scheme: CreateTaxRegistrationCountryOptionsBeStandardPlaceOfSupplyScheme, + ) -> Self { + Self { place_of_supply_scheme } + } +} +/// Place of supply scheme used in an EU standard registration. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreateTaxRegistrationCountryOptionsBeStandardPlaceOfSupplyScheme { + SmallSeller, + Standard, +} +impl CreateTaxRegistrationCountryOptionsBeStandardPlaceOfSupplyScheme { + pub fn as_str(self) -> &'static str { + use CreateTaxRegistrationCountryOptionsBeStandardPlaceOfSupplyScheme::*; + match self { + SmallSeller => "small_seller", + Standard => "standard", + } + } +} + +impl std::str::FromStr for CreateTaxRegistrationCountryOptionsBeStandardPlaceOfSupplyScheme { + type Err = (); + fn from_str(s: &str) -> Result { + use CreateTaxRegistrationCountryOptionsBeStandardPlaceOfSupplyScheme::*; + match s { + "small_seller" => Ok(SmallSeller), + "standard" => Ok(Standard), + _ => Err(()), + } + } +} +impl std::fmt::Display for CreateTaxRegistrationCountryOptionsBeStandardPlaceOfSupplyScheme { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreateTaxRegistrationCountryOptionsBeStandardPlaceOfSupplyScheme { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreateTaxRegistrationCountryOptionsBeStandardPlaceOfSupplyScheme { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Type of registration to be created in an EU country. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreateTaxRegistrationCountryOptionsBeType { + Ioss, + OssNonUnion, + OssUnion, + Standard, +} +impl CreateTaxRegistrationCountryOptionsBeType { + pub fn as_str(self) -> &'static str { + use CreateTaxRegistrationCountryOptionsBeType::*; + match self { + Ioss => "ioss", + OssNonUnion => "oss_non_union", + OssUnion => "oss_union", + Standard => "standard", + } + } +} + +impl std::str::FromStr for CreateTaxRegistrationCountryOptionsBeType { + type Err = (); + fn from_str(s: &str) -> Result { + use CreateTaxRegistrationCountryOptionsBeType::*; + match s { + "ioss" => Ok(Ioss), + "oss_non_union" => Ok(OssNonUnion), + "oss_union" => Ok(OssUnion), + "standard" => Ok(Standard), + _ => Err(()), + } + } +} +impl std::fmt::Display for CreateTaxRegistrationCountryOptionsBeType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreateTaxRegistrationCountryOptionsBeType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreateTaxRegistrationCountryOptionsBeType { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Options for the registration in BG. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreateTaxRegistrationCountryOptionsBg { + /// Options for the standard registration. + #[serde(skip_serializing_if = "Option::is_none")] + pub standard: Option, + /// Type of registration to be created in an EU country. + #[serde(rename = "type")] + pub type_: CreateTaxRegistrationCountryOptionsBgType, +} +impl CreateTaxRegistrationCountryOptionsBg { + pub fn new(type_: CreateTaxRegistrationCountryOptionsBgType) -> Self { + Self { standard: None, type_ } + } +} +/// Options for the standard registration. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreateTaxRegistrationCountryOptionsBgStandard { + /// Place of supply scheme used in an EU standard registration. + pub place_of_supply_scheme: CreateTaxRegistrationCountryOptionsBgStandardPlaceOfSupplyScheme, +} +impl CreateTaxRegistrationCountryOptionsBgStandard { + pub fn new( + place_of_supply_scheme: CreateTaxRegistrationCountryOptionsBgStandardPlaceOfSupplyScheme, + ) -> Self { + Self { place_of_supply_scheme } + } +} +/// Place of supply scheme used in an EU standard registration. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreateTaxRegistrationCountryOptionsBgStandardPlaceOfSupplyScheme { + SmallSeller, + Standard, +} +impl CreateTaxRegistrationCountryOptionsBgStandardPlaceOfSupplyScheme { + pub fn as_str(self) -> &'static str { + use CreateTaxRegistrationCountryOptionsBgStandardPlaceOfSupplyScheme::*; + match self { + SmallSeller => "small_seller", + Standard => "standard", + } + } +} + +impl std::str::FromStr for CreateTaxRegistrationCountryOptionsBgStandardPlaceOfSupplyScheme { + type Err = (); + fn from_str(s: &str) -> Result { + use CreateTaxRegistrationCountryOptionsBgStandardPlaceOfSupplyScheme::*; + match s { + "small_seller" => Ok(SmallSeller), + "standard" => Ok(Standard), + _ => Err(()), + } + } +} +impl std::fmt::Display for CreateTaxRegistrationCountryOptionsBgStandardPlaceOfSupplyScheme { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreateTaxRegistrationCountryOptionsBgStandardPlaceOfSupplyScheme { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreateTaxRegistrationCountryOptionsBgStandardPlaceOfSupplyScheme { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Type of registration to be created in an EU country. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreateTaxRegistrationCountryOptionsBgType { + Ioss, + OssNonUnion, + OssUnion, + Standard, +} +impl CreateTaxRegistrationCountryOptionsBgType { + pub fn as_str(self) -> &'static str { + use CreateTaxRegistrationCountryOptionsBgType::*; + match self { + Ioss => "ioss", + OssNonUnion => "oss_non_union", + OssUnion => "oss_union", + Standard => "standard", + } + } +} + +impl std::str::FromStr for CreateTaxRegistrationCountryOptionsBgType { + type Err = (); + fn from_str(s: &str) -> Result { + use CreateTaxRegistrationCountryOptionsBgType::*; + match s { + "ioss" => Ok(Ioss), + "oss_non_union" => Ok(OssNonUnion), + "oss_union" => Ok(OssUnion), + "standard" => Ok(Standard), + _ => Err(()), + } + } +} +impl std::fmt::Display for CreateTaxRegistrationCountryOptionsBgType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreateTaxRegistrationCountryOptionsBgType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreateTaxRegistrationCountryOptionsBgType { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Options for the registration in CA. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreateTaxRegistrationCountryOptionsCa<'a> { + /// Options for the provincial tax registration. + #[serde(skip_serializing_if = "Option::is_none")] + pub province_standard: Option>, + /// Type of registration to be created in Canada. + #[serde(rename = "type")] + pub type_: CreateTaxRegistrationCountryOptionsCaType, +} +impl<'a> CreateTaxRegistrationCountryOptionsCa<'a> { + pub fn new(type_: CreateTaxRegistrationCountryOptionsCaType) -> Self { + Self { province_standard: None, type_ } + } +} +/// Options for the provincial tax registration. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreateTaxRegistrationCountryOptionsCaProvinceStandard<'a> { + /// Two-letter CA province code ([ISO 3166-2](https://en.wikipedia.org/wiki/ISO_3166-2)). + pub province: &'a str, +} +impl<'a> CreateTaxRegistrationCountryOptionsCaProvinceStandard<'a> { + pub fn new(province: &'a str) -> Self { + Self { province } + } +} +/// Type of registration to be created in Canada. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreateTaxRegistrationCountryOptionsCaType { + ProvinceStandard, + Simplified, + Standard, +} +impl CreateTaxRegistrationCountryOptionsCaType { + pub fn as_str(self) -> &'static str { + use CreateTaxRegistrationCountryOptionsCaType::*; + match self { + ProvinceStandard => "province_standard", + Simplified => "simplified", + Standard => "standard", + } + } +} + +impl std::str::FromStr for CreateTaxRegistrationCountryOptionsCaType { + type Err = (); + fn from_str(s: &str) -> Result { + use CreateTaxRegistrationCountryOptionsCaType::*; + match s { + "province_standard" => Ok(ProvinceStandard), + "simplified" => Ok(Simplified), + "standard" => Ok(Standard), + _ => Err(()), + } + } +} +impl std::fmt::Display for CreateTaxRegistrationCountryOptionsCaType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreateTaxRegistrationCountryOptionsCaType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreateTaxRegistrationCountryOptionsCaType { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Options for the registration in CH. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreateTaxRegistrationCountryOptionsCh { + /// Type of registration to be created in `country`. + #[serde(rename = "type")] + pub type_: CreateTaxRegistrationCountryOptionsChType, +} +impl CreateTaxRegistrationCountryOptionsCh { + pub fn new(type_: CreateTaxRegistrationCountryOptionsChType) -> Self { + Self { type_ } + } +} +/// Type of registration to be created in `country`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreateTaxRegistrationCountryOptionsChType { + Standard, +} +impl CreateTaxRegistrationCountryOptionsChType { + pub fn as_str(self) -> &'static str { + use CreateTaxRegistrationCountryOptionsChType::*; + match self { + Standard => "standard", + } + } +} + +impl std::str::FromStr for CreateTaxRegistrationCountryOptionsChType { + type Err = (); + fn from_str(s: &str) -> Result { + use CreateTaxRegistrationCountryOptionsChType::*; + match s { + "standard" => Ok(Standard), + _ => Err(()), + } + } +} +impl std::fmt::Display for CreateTaxRegistrationCountryOptionsChType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreateTaxRegistrationCountryOptionsChType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreateTaxRegistrationCountryOptionsChType { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Options for the registration in CL. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreateTaxRegistrationCountryOptionsCl { + /// Type of registration to be created in `country`. + #[serde(rename = "type")] + pub type_: CreateTaxRegistrationCountryOptionsClType, +} +impl CreateTaxRegistrationCountryOptionsCl { + pub fn new(type_: CreateTaxRegistrationCountryOptionsClType) -> Self { + Self { type_ } + } +} +/// Type of registration to be created in `country`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreateTaxRegistrationCountryOptionsClType { + Simplified, +} +impl CreateTaxRegistrationCountryOptionsClType { + pub fn as_str(self) -> &'static str { + use CreateTaxRegistrationCountryOptionsClType::*; + match self { + Simplified => "simplified", + } + } +} + +impl std::str::FromStr for CreateTaxRegistrationCountryOptionsClType { + type Err = (); + fn from_str(s: &str) -> Result { + use CreateTaxRegistrationCountryOptionsClType::*; + match s { + "simplified" => Ok(Simplified), + _ => Err(()), + } + } +} +impl std::fmt::Display for CreateTaxRegistrationCountryOptionsClType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreateTaxRegistrationCountryOptionsClType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreateTaxRegistrationCountryOptionsClType { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Options for the registration in CO. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreateTaxRegistrationCountryOptionsCo { + /// Type of registration to be created in `country`. + #[serde(rename = "type")] + pub type_: CreateTaxRegistrationCountryOptionsCoType, +} +impl CreateTaxRegistrationCountryOptionsCo { + pub fn new(type_: CreateTaxRegistrationCountryOptionsCoType) -> Self { + Self { type_ } + } +} +/// Type of registration to be created in `country`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreateTaxRegistrationCountryOptionsCoType { + Simplified, +} +impl CreateTaxRegistrationCountryOptionsCoType { + pub fn as_str(self) -> &'static str { + use CreateTaxRegistrationCountryOptionsCoType::*; + match self { + Simplified => "simplified", + } + } +} + +impl std::str::FromStr for CreateTaxRegistrationCountryOptionsCoType { + type Err = (); + fn from_str(s: &str) -> Result { + use CreateTaxRegistrationCountryOptionsCoType::*; + match s { + "simplified" => Ok(Simplified), + _ => Err(()), + } + } +} +impl std::fmt::Display for CreateTaxRegistrationCountryOptionsCoType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreateTaxRegistrationCountryOptionsCoType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreateTaxRegistrationCountryOptionsCoType { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Options for the registration in CY. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreateTaxRegistrationCountryOptionsCy { + /// Options for the standard registration. + #[serde(skip_serializing_if = "Option::is_none")] + pub standard: Option, + /// Type of registration to be created in an EU country. + #[serde(rename = "type")] + pub type_: CreateTaxRegistrationCountryOptionsCyType, +} +impl CreateTaxRegistrationCountryOptionsCy { + pub fn new(type_: CreateTaxRegistrationCountryOptionsCyType) -> Self { + Self { standard: None, type_ } + } +} +/// Options for the standard registration. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreateTaxRegistrationCountryOptionsCyStandard { + /// Place of supply scheme used in an EU standard registration. + pub place_of_supply_scheme: CreateTaxRegistrationCountryOptionsCyStandardPlaceOfSupplyScheme, +} +impl CreateTaxRegistrationCountryOptionsCyStandard { + pub fn new( + place_of_supply_scheme: CreateTaxRegistrationCountryOptionsCyStandardPlaceOfSupplyScheme, + ) -> Self { + Self { place_of_supply_scheme } + } +} +/// Place of supply scheme used in an EU standard registration. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreateTaxRegistrationCountryOptionsCyStandardPlaceOfSupplyScheme { + SmallSeller, + Standard, +} +impl CreateTaxRegistrationCountryOptionsCyStandardPlaceOfSupplyScheme { + pub fn as_str(self) -> &'static str { + use CreateTaxRegistrationCountryOptionsCyStandardPlaceOfSupplyScheme::*; + match self { + SmallSeller => "small_seller", + Standard => "standard", + } + } +} + +impl std::str::FromStr for CreateTaxRegistrationCountryOptionsCyStandardPlaceOfSupplyScheme { + type Err = (); + fn from_str(s: &str) -> Result { + use CreateTaxRegistrationCountryOptionsCyStandardPlaceOfSupplyScheme::*; + match s { + "small_seller" => Ok(SmallSeller), + "standard" => Ok(Standard), + _ => Err(()), + } + } +} +impl std::fmt::Display for CreateTaxRegistrationCountryOptionsCyStandardPlaceOfSupplyScheme { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreateTaxRegistrationCountryOptionsCyStandardPlaceOfSupplyScheme { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreateTaxRegistrationCountryOptionsCyStandardPlaceOfSupplyScheme { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Type of registration to be created in an EU country. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreateTaxRegistrationCountryOptionsCyType { + Ioss, + OssNonUnion, + OssUnion, + Standard, +} +impl CreateTaxRegistrationCountryOptionsCyType { + pub fn as_str(self) -> &'static str { + use CreateTaxRegistrationCountryOptionsCyType::*; + match self { + Ioss => "ioss", + OssNonUnion => "oss_non_union", + OssUnion => "oss_union", + Standard => "standard", + } + } +} + +impl std::str::FromStr for CreateTaxRegistrationCountryOptionsCyType { + type Err = (); + fn from_str(s: &str) -> Result { + use CreateTaxRegistrationCountryOptionsCyType::*; + match s { + "ioss" => Ok(Ioss), + "oss_non_union" => Ok(OssNonUnion), + "oss_union" => Ok(OssUnion), + "standard" => Ok(Standard), + _ => Err(()), + } + } +} +impl std::fmt::Display for CreateTaxRegistrationCountryOptionsCyType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreateTaxRegistrationCountryOptionsCyType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreateTaxRegistrationCountryOptionsCyType { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Options for the registration in CZ. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreateTaxRegistrationCountryOptionsCz { + /// Options for the standard registration. + #[serde(skip_serializing_if = "Option::is_none")] + pub standard: Option, + /// Type of registration to be created in an EU country. + #[serde(rename = "type")] + pub type_: CreateTaxRegistrationCountryOptionsCzType, +} +impl CreateTaxRegistrationCountryOptionsCz { + pub fn new(type_: CreateTaxRegistrationCountryOptionsCzType) -> Self { + Self { standard: None, type_ } + } +} +/// Options for the standard registration. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreateTaxRegistrationCountryOptionsCzStandard { + /// Place of supply scheme used in an EU standard registration. + pub place_of_supply_scheme: CreateTaxRegistrationCountryOptionsCzStandardPlaceOfSupplyScheme, +} +impl CreateTaxRegistrationCountryOptionsCzStandard { + pub fn new( + place_of_supply_scheme: CreateTaxRegistrationCountryOptionsCzStandardPlaceOfSupplyScheme, + ) -> Self { + Self { place_of_supply_scheme } + } +} +/// Place of supply scheme used in an EU standard registration. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreateTaxRegistrationCountryOptionsCzStandardPlaceOfSupplyScheme { + SmallSeller, + Standard, +} +impl CreateTaxRegistrationCountryOptionsCzStandardPlaceOfSupplyScheme { + pub fn as_str(self) -> &'static str { + use CreateTaxRegistrationCountryOptionsCzStandardPlaceOfSupplyScheme::*; + match self { + SmallSeller => "small_seller", + Standard => "standard", + } + } +} + +impl std::str::FromStr for CreateTaxRegistrationCountryOptionsCzStandardPlaceOfSupplyScheme { + type Err = (); + fn from_str(s: &str) -> Result { + use CreateTaxRegistrationCountryOptionsCzStandardPlaceOfSupplyScheme::*; + match s { + "small_seller" => Ok(SmallSeller), + "standard" => Ok(Standard), + _ => Err(()), + } + } +} +impl std::fmt::Display for CreateTaxRegistrationCountryOptionsCzStandardPlaceOfSupplyScheme { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreateTaxRegistrationCountryOptionsCzStandardPlaceOfSupplyScheme { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreateTaxRegistrationCountryOptionsCzStandardPlaceOfSupplyScheme { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Type of registration to be created in an EU country. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreateTaxRegistrationCountryOptionsCzType { + Ioss, + OssNonUnion, + OssUnion, + Standard, +} +impl CreateTaxRegistrationCountryOptionsCzType { + pub fn as_str(self) -> &'static str { + use CreateTaxRegistrationCountryOptionsCzType::*; + match self { + Ioss => "ioss", + OssNonUnion => "oss_non_union", + OssUnion => "oss_union", + Standard => "standard", + } + } +} + +impl std::str::FromStr for CreateTaxRegistrationCountryOptionsCzType { + type Err = (); + fn from_str(s: &str) -> Result { + use CreateTaxRegistrationCountryOptionsCzType::*; + match s { + "ioss" => Ok(Ioss), + "oss_non_union" => Ok(OssNonUnion), + "oss_union" => Ok(OssUnion), + "standard" => Ok(Standard), + _ => Err(()), + } + } +} +impl std::fmt::Display for CreateTaxRegistrationCountryOptionsCzType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreateTaxRegistrationCountryOptionsCzType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreateTaxRegistrationCountryOptionsCzType { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Options for the registration in DE. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreateTaxRegistrationCountryOptionsDe { + /// Options for the standard registration. + #[serde(skip_serializing_if = "Option::is_none")] + pub standard: Option, + /// Type of registration to be created in an EU country. + #[serde(rename = "type")] + pub type_: CreateTaxRegistrationCountryOptionsDeType, +} +impl CreateTaxRegistrationCountryOptionsDe { + pub fn new(type_: CreateTaxRegistrationCountryOptionsDeType) -> Self { + Self { standard: None, type_ } + } +} +/// Options for the standard registration. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreateTaxRegistrationCountryOptionsDeStandard { + /// Place of supply scheme used in an EU standard registration. + pub place_of_supply_scheme: CreateTaxRegistrationCountryOptionsDeStandardPlaceOfSupplyScheme, +} +impl CreateTaxRegistrationCountryOptionsDeStandard { + pub fn new( + place_of_supply_scheme: CreateTaxRegistrationCountryOptionsDeStandardPlaceOfSupplyScheme, + ) -> Self { + Self { place_of_supply_scheme } + } +} +/// Place of supply scheme used in an EU standard registration. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreateTaxRegistrationCountryOptionsDeStandardPlaceOfSupplyScheme { + SmallSeller, + Standard, +} +impl CreateTaxRegistrationCountryOptionsDeStandardPlaceOfSupplyScheme { + pub fn as_str(self) -> &'static str { + use CreateTaxRegistrationCountryOptionsDeStandardPlaceOfSupplyScheme::*; + match self { + SmallSeller => "small_seller", + Standard => "standard", + } + } +} + +impl std::str::FromStr for CreateTaxRegistrationCountryOptionsDeStandardPlaceOfSupplyScheme { + type Err = (); + fn from_str(s: &str) -> Result { + use CreateTaxRegistrationCountryOptionsDeStandardPlaceOfSupplyScheme::*; + match s { + "small_seller" => Ok(SmallSeller), + "standard" => Ok(Standard), + _ => Err(()), + } + } +} +impl std::fmt::Display for CreateTaxRegistrationCountryOptionsDeStandardPlaceOfSupplyScheme { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreateTaxRegistrationCountryOptionsDeStandardPlaceOfSupplyScheme { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreateTaxRegistrationCountryOptionsDeStandardPlaceOfSupplyScheme { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Type of registration to be created in an EU country. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreateTaxRegistrationCountryOptionsDeType { + Ioss, + OssNonUnion, + OssUnion, + Standard, +} +impl CreateTaxRegistrationCountryOptionsDeType { + pub fn as_str(self) -> &'static str { + use CreateTaxRegistrationCountryOptionsDeType::*; + match self { + Ioss => "ioss", + OssNonUnion => "oss_non_union", + OssUnion => "oss_union", + Standard => "standard", + } + } +} + +impl std::str::FromStr for CreateTaxRegistrationCountryOptionsDeType { + type Err = (); + fn from_str(s: &str) -> Result { + use CreateTaxRegistrationCountryOptionsDeType::*; + match s { + "ioss" => Ok(Ioss), + "oss_non_union" => Ok(OssNonUnion), + "oss_union" => Ok(OssUnion), + "standard" => Ok(Standard), + _ => Err(()), + } + } +} +impl std::fmt::Display for CreateTaxRegistrationCountryOptionsDeType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreateTaxRegistrationCountryOptionsDeType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreateTaxRegistrationCountryOptionsDeType { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Options for the registration in DK. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreateTaxRegistrationCountryOptionsDk { + /// Options for the standard registration. + #[serde(skip_serializing_if = "Option::is_none")] + pub standard: Option, + /// Type of registration to be created in an EU country. + #[serde(rename = "type")] + pub type_: CreateTaxRegistrationCountryOptionsDkType, +} +impl CreateTaxRegistrationCountryOptionsDk { + pub fn new(type_: CreateTaxRegistrationCountryOptionsDkType) -> Self { + Self { standard: None, type_ } + } +} +/// Options for the standard registration. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreateTaxRegistrationCountryOptionsDkStandard { + /// Place of supply scheme used in an EU standard registration. + pub place_of_supply_scheme: CreateTaxRegistrationCountryOptionsDkStandardPlaceOfSupplyScheme, +} +impl CreateTaxRegistrationCountryOptionsDkStandard { + pub fn new( + place_of_supply_scheme: CreateTaxRegistrationCountryOptionsDkStandardPlaceOfSupplyScheme, + ) -> Self { + Self { place_of_supply_scheme } + } +} +/// Place of supply scheme used in an EU standard registration. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreateTaxRegistrationCountryOptionsDkStandardPlaceOfSupplyScheme { + SmallSeller, + Standard, +} +impl CreateTaxRegistrationCountryOptionsDkStandardPlaceOfSupplyScheme { + pub fn as_str(self) -> &'static str { + use CreateTaxRegistrationCountryOptionsDkStandardPlaceOfSupplyScheme::*; + match self { + SmallSeller => "small_seller", + Standard => "standard", + } + } +} + +impl std::str::FromStr for CreateTaxRegistrationCountryOptionsDkStandardPlaceOfSupplyScheme { + type Err = (); + fn from_str(s: &str) -> Result { + use CreateTaxRegistrationCountryOptionsDkStandardPlaceOfSupplyScheme::*; + match s { + "small_seller" => Ok(SmallSeller), + "standard" => Ok(Standard), + _ => Err(()), + } + } +} +impl std::fmt::Display for CreateTaxRegistrationCountryOptionsDkStandardPlaceOfSupplyScheme { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreateTaxRegistrationCountryOptionsDkStandardPlaceOfSupplyScheme { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreateTaxRegistrationCountryOptionsDkStandardPlaceOfSupplyScheme { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Type of registration to be created in an EU country. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreateTaxRegistrationCountryOptionsDkType { + Ioss, + OssNonUnion, + OssUnion, + Standard, +} +impl CreateTaxRegistrationCountryOptionsDkType { + pub fn as_str(self) -> &'static str { + use CreateTaxRegistrationCountryOptionsDkType::*; + match self { + Ioss => "ioss", + OssNonUnion => "oss_non_union", + OssUnion => "oss_union", + Standard => "standard", + } + } +} + +impl std::str::FromStr for CreateTaxRegistrationCountryOptionsDkType { + type Err = (); + fn from_str(s: &str) -> Result { + use CreateTaxRegistrationCountryOptionsDkType::*; + match s { + "ioss" => Ok(Ioss), + "oss_non_union" => Ok(OssNonUnion), + "oss_union" => Ok(OssUnion), + "standard" => Ok(Standard), + _ => Err(()), + } + } +} +impl std::fmt::Display for CreateTaxRegistrationCountryOptionsDkType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreateTaxRegistrationCountryOptionsDkType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreateTaxRegistrationCountryOptionsDkType { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Options for the registration in EE. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreateTaxRegistrationCountryOptionsEe { + /// Options for the standard registration. + #[serde(skip_serializing_if = "Option::is_none")] + pub standard: Option, + /// Type of registration to be created in an EU country. + #[serde(rename = "type")] + pub type_: CreateTaxRegistrationCountryOptionsEeType, +} +impl CreateTaxRegistrationCountryOptionsEe { + pub fn new(type_: CreateTaxRegistrationCountryOptionsEeType) -> Self { + Self { standard: None, type_ } + } +} +/// Options for the standard registration. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreateTaxRegistrationCountryOptionsEeStandard { + /// Place of supply scheme used in an EU standard registration. + pub place_of_supply_scheme: CreateTaxRegistrationCountryOptionsEeStandardPlaceOfSupplyScheme, +} +impl CreateTaxRegistrationCountryOptionsEeStandard { + pub fn new( + place_of_supply_scheme: CreateTaxRegistrationCountryOptionsEeStandardPlaceOfSupplyScheme, + ) -> Self { + Self { place_of_supply_scheme } + } +} +/// Place of supply scheme used in an EU standard registration. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreateTaxRegistrationCountryOptionsEeStandardPlaceOfSupplyScheme { + SmallSeller, + Standard, +} +impl CreateTaxRegistrationCountryOptionsEeStandardPlaceOfSupplyScheme { + pub fn as_str(self) -> &'static str { + use CreateTaxRegistrationCountryOptionsEeStandardPlaceOfSupplyScheme::*; + match self { + SmallSeller => "small_seller", + Standard => "standard", + } + } +} + +impl std::str::FromStr for CreateTaxRegistrationCountryOptionsEeStandardPlaceOfSupplyScheme { + type Err = (); + fn from_str(s: &str) -> Result { + use CreateTaxRegistrationCountryOptionsEeStandardPlaceOfSupplyScheme::*; + match s { + "small_seller" => Ok(SmallSeller), + "standard" => Ok(Standard), + _ => Err(()), + } + } +} +impl std::fmt::Display for CreateTaxRegistrationCountryOptionsEeStandardPlaceOfSupplyScheme { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreateTaxRegistrationCountryOptionsEeStandardPlaceOfSupplyScheme { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreateTaxRegistrationCountryOptionsEeStandardPlaceOfSupplyScheme { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Type of registration to be created in an EU country. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreateTaxRegistrationCountryOptionsEeType { + Ioss, + OssNonUnion, + OssUnion, + Standard, +} +impl CreateTaxRegistrationCountryOptionsEeType { + pub fn as_str(self) -> &'static str { + use CreateTaxRegistrationCountryOptionsEeType::*; + match self { + Ioss => "ioss", + OssNonUnion => "oss_non_union", + OssUnion => "oss_union", + Standard => "standard", + } + } +} + +impl std::str::FromStr for CreateTaxRegistrationCountryOptionsEeType { + type Err = (); + fn from_str(s: &str) -> Result { + use CreateTaxRegistrationCountryOptionsEeType::*; + match s { + "ioss" => Ok(Ioss), + "oss_non_union" => Ok(OssNonUnion), + "oss_union" => Ok(OssUnion), + "standard" => Ok(Standard), + _ => Err(()), + } + } +} +impl std::fmt::Display for CreateTaxRegistrationCountryOptionsEeType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreateTaxRegistrationCountryOptionsEeType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreateTaxRegistrationCountryOptionsEeType { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Options for the registration in ES. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreateTaxRegistrationCountryOptionsEs { + /// Options for the standard registration. + #[serde(skip_serializing_if = "Option::is_none")] + pub standard: Option, + /// Type of registration to be created in an EU country. + #[serde(rename = "type")] + pub type_: CreateTaxRegistrationCountryOptionsEsType, +} +impl CreateTaxRegistrationCountryOptionsEs { + pub fn new(type_: CreateTaxRegistrationCountryOptionsEsType) -> Self { + Self { standard: None, type_ } + } +} +/// Options for the standard registration. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreateTaxRegistrationCountryOptionsEsStandard { + /// Place of supply scheme used in an EU standard registration. + pub place_of_supply_scheme: CreateTaxRegistrationCountryOptionsEsStandardPlaceOfSupplyScheme, +} +impl CreateTaxRegistrationCountryOptionsEsStandard { + pub fn new( + place_of_supply_scheme: CreateTaxRegistrationCountryOptionsEsStandardPlaceOfSupplyScheme, + ) -> Self { + Self { place_of_supply_scheme } + } +} +/// Place of supply scheme used in an EU standard registration. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreateTaxRegistrationCountryOptionsEsStandardPlaceOfSupplyScheme { + SmallSeller, + Standard, +} +impl CreateTaxRegistrationCountryOptionsEsStandardPlaceOfSupplyScheme { + pub fn as_str(self) -> &'static str { + use CreateTaxRegistrationCountryOptionsEsStandardPlaceOfSupplyScheme::*; + match self { + SmallSeller => "small_seller", + Standard => "standard", + } + } +} + +impl std::str::FromStr for CreateTaxRegistrationCountryOptionsEsStandardPlaceOfSupplyScheme { + type Err = (); + fn from_str(s: &str) -> Result { + use CreateTaxRegistrationCountryOptionsEsStandardPlaceOfSupplyScheme::*; + match s { + "small_seller" => Ok(SmallSeller), + "standard" => Ok(Standard), + _ => Err(()), + } + } +} +impl std::fmt::Display for CreateTaxRegistrationCountryOptionsEsStandardPlaceOfSupplyScheme { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreateTaxRegistrationCountryOptionsEsStandardPlaceOfSupplyScheme { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreateTaxRegistrationCountryOptionsEsStandardPlaceOfSupplyScheme { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Type of registration to be created in an EU country. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreateTaxRegistrationCountryOptionsEsType { + Ioss, + OssNonUnion, + OssUnion, + Standard, +} +impl CreateTaxRegistrationCountryOptionsEsType { + pub fn as_str(self) -> &'static str { + use CreateTaxRegistrationCountryOptionsEsType::*; + match self { + Ioss => "ioss", + OssNonUnion => "oss_non_union", + OssUnion => "oss_union", + Standard => "standard", + } + } +} + +impl std::str::FromStr for CreateTaxRegistrationCountryOptionsEsType { + type Err = (); + fn from_str(s: &str) -> Result { + use CreateTaxRegistrationCountryOptionsEsType::*; + match s { + "ioss" => Ok(Ioss), + "oss_non_union" => Ok(OssNonUnion), + "oss_union" => Ok(OssUnion), + "standard" => Ok(Standard), + _ => Err(()), + } + } +} +impl std::fmt::Display for CreateTaxRegistrationCountryOptionsEsType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreateTaxRegistrationCountryOptionsEsType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreateTaxRegistrationCountryOptionsEsType { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Options for the registration in FI. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreateTaxRegistrationCountryOptionsFi { + /// Options for the standard registration. + #[serde(skip_serializing_if = "Option::is_none")] + pub standard: Option, + /// Type of registration to be created in an EU country. + #[serde(rename = "type")] + pub type_: CreateTaxRegistrationCountryOptionsFiType, +} +impl CreateTaxRegistrationCountryOptionsFi { + pub fn new(type_: CreateTaxRegistrationCountryOptionsFiType) -> Self { + Self { standard: None, type_ } + } +} +/// Options for the standard registration. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreateTaxRegistrationCountryOptionsFiStandard { + /// Place of supply scheme used in an EU standard registration. + pub place_of_supply_scheme: CreateTaxRegistrationCountryOptionsFiStandardPlaceOfSupplyScheme, +} +impl CreateTaxRegistrationCountryOptionsFiStandard { + pub fn new( + place_of_supply_scheme: CreateTaxRegistrationCountryOptionsFiStandardPlaceOfSupplyScheme, + ) -> Self { + Self { place_of_supply_scheme } + } +} +/// Place of supply scheme used in an EU standard registration. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreateTaxRegistrationCountryOptionsFiStandardPlaceOfSupplyScheme { + SmallSeller, + Standard, +} +impl CreateTaxRegistrationCountryOptionsFiStandardPlaceOfSupplyScheme { + pub fn as_str(self) -> &'static str { + use CreateTaxRegistrationCountryOptionsFiStandardPlaceOfSupplyScheme::*; + match self { + SmallSeller => "small_seller", + Standard => "standard", + } + } +} + +impl std::str::FromStr for CreateTaxRegistrationCountryOptionsFiStandardPlaceOfSupplyScheme { + type Err = (); + fn from_str(s: &str) -> Result { + use CreateTaxRegistrationCountryOptionsFiStandardPlaceOfSupplyScheme::*; + match s { + "small_seller" => Ok(SmallSeller), + "standard" => Ok(Standard), + _ => Err(()), + } + } +} +impl std::fmt::Display for CreateTaxRegistrationCountryOptionsFiStandardPlaceOfSupplyScheme { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreateTaxRegistrationCountryOptionsFiStandardPlaceOfSupplyScheme { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreateTaxRegistrationCountryOptionsFiStandardPlaceOfSupplyScheme { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Type of registration to be created in an EU country. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreateTaxRegistrationCountryOptionsFiType { + Ioss, + OssNonUnion, + OssUnion, + Standard, +} +impl CreateTaxRegistrationCountryOptionsFiType { + pub fn as_str(self) -> &'static str { + use CreateTaxRegistrationCountryOptionsFiType::*; + match self { + Ioss => "ioss", + OssNonUnion => "oss_non_union", + OssUnion => "oss_union", + Standard => "standard", + } + } +} + +impl std::str::FromStr for CreateTaxRegistrationCountryOptionsFiType { + type Err = (); + fn from_str(s: &str) -> Result { + use CreateTaxRegistrationCountryOptionsFiType::*; + match s { + "ioss" => Ok(Ioss), + "oss_non_union" => Ok(OssNonUnion), + "oss_union" => Ok(OssUnion), + "standard" => Ok(Standard), + _ => Err(()), + } + } +} +impl std::fmt::Display for CreateTaxRegistrationCountryOptionsFiType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreateTaxRegistrationCountryOptionsFiType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreateTaxRegistrationCountryOptionsFiType { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Options for the registration in FR. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreateTaxRegistrationCountryOptionsFr { + /// Options for the standard registration. + #[serde(skip_serializing_if = "Option::is_none")] + pub standard: Option, + /// Type of registration to be created in an EU country. + #[serde(rename = "type")] + pub type_: CreateTaxRegistrationCountryOptionsFrType, +} +impl CreateTaxRegistrationCountryOptionsFr { + pub fn new(type_: CreateTaxRegistrationCountryOptionsFrType) -> Self { + Self { standard: None, type_ } + } +} +/// Options for the standard registration. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreateTaxRegistrationCountryOptionsFrStandard { + /// Place of supply scheme used in an EU standard registration. + pub place_of_supply_scheme: CreateTaxRegistrationCountryOptionsFrStandardPlaceOfSupplyScheme, +} +impl CreateTaxRegistrationCountryOptionsFrStandard { + pub fn new( + place_of_supply_scheme: CreateTaxRegistrationCountryOptionsFrStandardPlaceOfSupplyScheme, + ) -> Self { + Self { place_of_supply_scheme } + } +} +/// Place of supply scheme used in an EU standard registration. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreateTaxRegistrationCountryOptionsFrStandardPlaceOfSupplyScheme { + SmallSeller, + Standard, +} +impl CreateTaxRegistrationCountryOptionsFrStandardPlaceOfSupplyScheme { + pub fn as_str(self) -> &'static str { + use CreateTaxRegistrationCountryOptionsFrStandardPlaceOfSupplyScheme::*; + match self { + SmallSeller => "small_seller", + Standard => "standard", + } + } +} + +impl std::str::FromStr for CreateTaxRegistrationCountryOptionsFrStandardPlaceOfSupplyScheme { + type Err = (); + fn from_str(s: &str) -> Result { + use CreateTaxRegistrationCountryOptionsFrStandardPlaceOfSupplyScheme::*; + match s { + "small_seller" => Ok(SmallSeller), + "standard" => Ok(Standard), + _ => Err(()), + } + } +} +impl std::fmt::Display for CreateTaxRegistrationCountryOptionsFrStandardPlaceOfSupplyScheme { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreateTaxRegistrationCountryOptionsFrStandardPlaceOfSupplyScheme { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreateTaxRegistrationCountryOptionsFrStandardPlaceOfSupplyScheme { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Type of registration to be created in an EU country. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreateTaxRegistrationCountryOptionsFrType { + Ioss, + OssNonUnion, + OssUnion, + Standard, +} +impl CreateTaxRegistrationCountryOptionsFrType { + pub fn as_str(self) -> &'static str { + use CreateTaxRegistrationCountryOptionsFrType::*; + match self { + Ioss => "ioss", + OssNonUnion => "oss_non_union", + OssUnion => "oss_union", + Standard => "standard", + } + } +} + +impl std::str::FromStr for CreateTaxRegistrationCountryOptionsFrType { + type Err = (); + fn from_str(s: &str) -> Result { + use CreateTaxRegistrationCountryOptionsFrType::*; + match s { + "ioss" => Ok(Ioss), + "oss_non_union" => Ok(OssNonUnion), + "oss_union" => Ok(OssUnion), + "standard" => Ok(Standard), + _ => Err(()), + } + } +} +impl std::fmt::Display for CreateTaxRegistrationCountryOptionsFrType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreateTaxRegistrationCountryOptionsFrType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreateTaxRegistrationCountryOptionsFrType { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Options for the registration in GB. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreateTaxRegistrationCountryOptionsGb { + /// Type of registration to be created in `country`. + #[serde(rename = "type")] + pub type_: CreateTaxRegistrationCountryOptionsGbType, +} +impl CreateTaxRegistrationCountryOptionsGb { + pub fn new(type_: CreateTaxRegistrationCountryOptionsGbType) -> Self { + Self { type_ } + } +} +/// Type of registration to be created in `country`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreateTaxRegistrationCountryOptionsGbType { + Standard, +} +impl CreateTaxRegistrationCountryOptionsGbType { + pub fn as_str(self) -> &'static str { + use CreateTaxRegistrationCountryOptionsGbType::*; + match self { + Standard => "standard", + } + } +} + +impl std::str::FromStr for CreateTaxRegistrationCountryOptionsGbType { + type Err = (); + fn from_str(s: &str) -> Result { + use CreateTaxRegistrationCountryOptionsGbType::*; + match s { + "standard" => Ok(Standard), + _ => Err(()), + } + } +} +impl std::fmt::Display for CreateTaxRegistrationCountryOptionsGbType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreateTaxRegistrationCountryOptionsGbType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreateTaxRegistrationCountryOptionsGbType { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Options for the registration in GR. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreateTaxRegistrationCountryOptionsGr { + /// Options for the standard registration. + #[serde(skip_serializing_if = "Option::is_none")] + pub standard: Option, + /// Type of registration to be created in an EU country. + #[serde(rename = "type")] + pub type_: CreateTaxRegistrationCountryOptionsGrType, +} +impl CreateTaxRegistrationCountryOptionsGr { + pub fn new(type_: CreateTaxRegistrationCountryOptionsGrType) -> Self { + Self { standard: None, type_ } + } +} +/// Options for the standard registration. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreateTaxRegistrationCountryOptionsGrStandard { + /// Place of supply scheme used in an EU standard registration. + pub place_of_supply_scheme: CreateTaxRegistrationCountryOptionsGrStandardPlaceOfSupplyScheme, +} +impl CreateTaxRegistrationCountryOptionsGrStandard { + pub fn new( + place_of_supply_scheme: CreateTaxRegistrationCountryOptionsGrStandardPlaceOfSupplyScheme, + ) -> Self { + Self { place_of_supply_scheme } + } +} +/// Place of supply scheme used in an EU standard registration. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreateTaxRegistrationCountryOptionsGrStandardPlaceOfSupplyScheme { + SmallSeller, + Standard, +} +impl CreateTaxRegistrationCountryOptionsGrStandardPlaceOfSupplyScheme { + pub fn as_str(self) -> &'static str { + use CreateTaxRegistrationCountryOptionsGrStandardPlaceOfSupplyScheme::*; + match self { + SmallSeller => "small_seller", + Standard => "standard", + } + } +} + +impl std::str::FromStr for CreateTaxRegistrationCountryOptionsGrStandardPlaceOfSupplyScheme { + type Err = (); + fn from_str(s: &str) -> Result { + use CreateTaxRegistrationCountryOptionsGrStandardPlaceOfSupplyScheme::*; + match s { + "small_seller" => Ok(SmallSeller), + "standard" => Ok(Standard), + _ => Err(()), + } + } +} +impl std::fmt::Display for CreateTaxRegistrationCountryOptionsGrStandardPlaceOfSupplyScheme { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreateTaxRegistrationCountryOptionsGrStandardPlaceOfSupplyScheme { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreateTaxRegistrationCountryOptionsGrStandardPlaceOfSupplyScheme { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Type of registration to be created in an EU country. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreateTaxRegistrationCountryOptionsGrType { + Ioss, + OssNonUnion, + OssUnion, + Standard, +} +impl CreateTaxRegistrationCountryOptionsGrType { + pub fn as_str(self) -> &'static str { + use CreateTaxRegistrationCountryOptionsGrType::*; + match self { + Ioss => "ioss", + OssNonUnion => "oss_non_union", + OssUnion => "oss_union", + Standard => "standard", + } + } +} + +impl std::str::FromStr for CreateTaxRegistrationCountryOptionsGrType { + type Err = (); + fn from_str(s: &str) -> Result { + use CreateTaxRegistrationCountryOptionsGrType::*; + match s { + "ioss" => Ok(Ioss), + "oss_non_union" => Ok(OssNonUnion), + "oss_union" => Ok(OssUnion), + "standard" => Ok(Standard), + _ => Err(()), + } + } +} +impl std::fmt::Display for CreateTaxRegistrationCountryOptionsGrType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreateTaxRegistrationCountryOptionsGrType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreateTaxRegistrationCountryOptionsGrType { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Options for the registration in HR. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreateTaxRegistrationCountryOptionsHr { + /// Options for the standard registration. + #[serde(skip_serializing_if = "Option::is_none")] + pub standard: Option, + /// Type of registration to be created in an EU country. + #[serde(rename = "type")] + pub type_: CreateTaxRegistrationCountryOptionsHrType, +} +impl CreateTaxRegistrationCountryOptionsHr { + pub fn new(type_: CreateTaxRegistrationCountryOptionsHrType) -> Self { + Self { standard: None, type_ } + } +} +/// Options for the standard registration. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreateTaxRegistrationCountryOptionsHrStandard { + /// Place of supply scheme used in an EU standard registration. + pub place_of_supply_scheme: CreateTaxRegistrationCountryOptionsHrStandardPlaceOfSupplyScheme, +} +impl CreateTaxRegistrationCountryOptionsHrStandard { + pub fn new( + place_of_supply_scheme: CreateTaxRegistrationCountryOptionsHrStandardPlaceOfSupplyScheme, + ) -> Self { + Self { place_of_supply_scheme } + } +} +/// Place of supply scheme used in an EU standard registration. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreateTaxRegistrationCountryOptionsHrStandardPlaceOfSupplyScheme { + SmallSeller, + Standard, +} +impl CreateTaxRegistrationCountryOptionsHrStandardPlaceOfSupplyScheme { + pub fn as_str(self) -> &'static str { + use CreateTaxRegistrationCountryOptionsHrStandardPlaceOfSupplyScheme::*; + match self { + SmallSeller => "small_seller", + Standard => "standard", + } + } +} + +impl std::str::FromStr for CreateTaxRegistrationCountryOptionsHrStandardPlaceOfSupplyScheme { + type Err = (); + fn from_str(s: &str) -> Result { + use CreateTaxRegistrationCountryOptionsHrStandardPlaceOfSupplyScheme::*; + match s { + "small_seller" => Ok(SmallSeller), + "standard" => Ok(Standard), + _ => Err(()), + } + } +} +impl std::fmt::Display for CreateTaxRegistrationCountryOptionsHrStandardPlaceOfSupplyScheme { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreateTaxRegistrationCountryOptionsHrStandardPlaceOfSupplyScheme { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreateTaxRegistrationCountryOptionsHrStandardPlaceOfSupplyScheme { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Type of registration to be created in an EU country. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreateTaxRegistrationCountryOptionsHrType { + Ioss, + OssNonUnion, + OssUnion, + Standard, +} +impl CreateTaxRegistrationCountryOptionsHrType { + pub fn as_str(self) -> &'static str { + use CreateTaxRegistrationCountryOptionsHrType::*; + match self { + Ioss => "ioss", + OssNonUnion => "oss_non_union", + OssUnion => "oss_union", + Standard => "standard", + } + } +} + +impl std::str::FromStr for CreateTaxRegistrationCountryOptionsHrType { + type Err = (); + fn from_str(s: &str) -> Result { + use CreateTaxRegistrationCountryOptionsHrType::*; + match s { + "ioss" => Ok(Ioss), + "oss_non_union" => Ok(OssNonUnion), + "oss_union" => Ok(OssUnion), + "standard" => Ok(Standard), + _ => Err(()), + } + } +} +impl std::fmt::Display for CreateTaxRegistrationCountryOptionsHrType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreateTaxRegistrationCountryOptionsHrType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreateTaxRegistrationCountryOptionsHrType { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Options for the registration in HU. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreateTaxRegistrationCountryOptionsHu { + /// Options for the standard registration. + #[serde(skip_serializing_if = "Option::is_none")] + pub standard: Option, + /// Type of registration to be created in an EU country. + #[serde(rename = "type")] + pub type_: CreateTaxRegistrationCountryOptionsHuType, +} +impl CreateTaxRegistrationCountryOptionsHu { + pub fn new(type_: CreateTaxRegistrationCountryOptionsHuType) -> Self { + Self { standard: None, type_ } + } +} +/// Options for the standard registration. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreateTaxRegistrationCountryOptionsHuStandard { + /// Place of supply scheme used in an EU standard registration. + pub place_of_supply_scheme: CreateTaxRegistrationCountryOptionsHuStandardPlaceOfSupplyScheme, +} +impl CreateTaxRegistrationCountryOptionsHuStandard { + pub fn new( + place_of_supply_scheme: CreateTaxRegistrationCountryOptionsHuStandardPlaceOfSupplyScheme, + ) -> Self { + Self { place_of_supply_scheme } + } +} +/// Place of supply scheme used in an EU standard registration. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreateTaxRegistrationCountryOptionsHuStandardPlaceOfSupplyScheme { + SmallSeller, + Standard, +} +impl CreateTaxRegistrationCountryOptionsHuStandardPlaceOfSupplyScheme { + pub fn as_str(self) -> &'static str { + use CreateTaxRegistrationCountryOptionsHuStandardPlaceOfSupplyScheme::*; + match self { + SmallSeller => "small_seller", + Standard => "standard", + } + } +} + +impl std::str::FromStr for CreateTaxRegistrationCountryOptionsHuStandardPlaceOfSupplyScheme { + type Err = (); + fn from_str(s: &str) -> Result { + use CreateTaxRegistrationCountryOptionsHuStandardPlaceOfSupplyScheme::*; + match s { + "small_seller" => Ok(SmallSeller), + "standard" => Ok(Standard), + _ => Err(()), + } + } +} +impl std::fmt::Display for CreateTaxRegistrationCountryOptionsHuStandardPlaceOfSupplyScheme { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreateTaxRegistrationCountryOptionsHuStandardPlaceOfSupplyScheme { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreateTaxRegistrationCountryOptionsHuStandardPlaceOfSupplyScheme { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Type of registration to be created in an EU country. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreateTaxRegistrationCountryOptionsHuType { + Ioss, + OssNonUnion, + OssUnion, + Standard, +} +impl CreateTaxRegistrationCountryOptionsHuType { + pub fn as_str(self) -> &'static str { + use CreateTaxRegistrationCountryOptionsHuType::*; + match self { + Ioss => "ioss", + OssNonUnion => "oss_non_union", + OssUnion => "oss_union", + Standard => "standard", + } + } +} + +impl std::str::FromStr for CreateTaxRegistrationCountryOptionsHuType { + type Err = (); + fn from_str(s: &str) -> Result { + use CreateTaxRegistrationCountryOptionsHuType::*; + match s { + "ioss" => Ok(Ioss), + "oss_non_union" => Ok(OssNonUnion), + "oss_union" => Ok(OssUnion), + "standard" => Ok(Standard), + _ => Err(()), + } + } +} +impl std::fmt::Display for CreateTaxRegistrationCountryOptionsHuType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreateTaxRegistrationCountryOptionsHuType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreateTaxRegistrationCountryOptionsHuType { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Options for the registration in ID. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreateTaxRegistrationCountryOptionsId { + /// Type of registration to be created in `country`. + #[serde(rename = "type")] + pub type_: CreateTaxRegistrationCountryOptionsIdType, +} +impl CreateTaxRegistrationCountryOptionsId { + pub fn new(type_: CreateTaxRegistrationCountryOptionsIdType) -> Self { + Self { type_ } + } +} +/// Type of registration to be created in `country`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreateTaxRegistrationCountryOptionsIdType { + Simplified, +} +impl CreateTaxRegistrationCountryOptionsIdType { + pub fn as_str(self) -> &'static str { + use CreateTaxRegistrationCountryOptionsIdType::*; + match self { + Simplified => "simplified", + } + } +} + +impl std::str::FromStr for CreateTaxRegistrationCountryOptionsIdType { + type Err = (); + fn from_str(s: &str) -> Result { + use CreateTaxRegistrationCountryOptionsIdType::*; + match s { + "simplified" => Ok(Simplified), + _ => Err(()), + } + } +} +impl std::fmt::Display for CreateTaxRegistrationCountryOptionsIdType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreateTaxRegistrationCountryOptionsIdType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreateTaxRegistrationCountryOptionsIdType { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Options for the registration in IE. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreateTaxRegistrationCountryOptionsIe { + /// Options for the standard registration. + #[serde(skip_serializing_if = "Option::is_none")] + pub standard: Option, + /// Type of registration to be created in an EU country. + #[serde(rename = "type")] + pub type_: CreateTaxRegistrationCountryOptionsIeType, +} +impl CreateTaxRegistrationCountryOptionsIe { + pub fn new(type_: CreateTaxRegistrationCountryOptionsIeType) -> Self { + Self { standard: None, type_ } + } +} +/// Options for the standard registration. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreateTaxRegistrationCountryOptionsIeStandard { + /// Place of supply scheme used in an EU standard registration. + pub place_of_supply_scheme: CreateTaxRegistrationCountryOptionsIeStandardPlaceOfSupplyScheme, +} +impl CreateTaxRegistrationCountryOptionsIeStandard { + pub fn new( + place_of_supply_scheme: CreateTaxRegistrationCountryOptionsIeStandardPlaceOfSupplyScheme, + ) -> Self { + Self { place_of_supply_scheme } + } +} +/// Place of supply scheme used in an EU standard registration. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreateTaxRegistrationCountryOptionsIeStandardPlaceOfSupplyScheme { + SmallSeller, + Standard, +} +impl CreateTaxRegistrationCountryOptionsIeStandardPlaceOfSupplyScheme { + pub fn as_str(self) -> &'static str { + use CreateTaxRegistrationCountryOptionsIeStandardPlaceOfSupplyScheme::*; + match self { + SmallSeller => "small_seller", + Standard => "standard", + } + } +} + +impl std::str::FromStr for CreateTaxRegistrationCountryOptionsIeStandardPlaceOfSupplyScheme { + type Err = (); + fn from_str(s: &str) -> Result { + use CreateTaxRegistrationCountryOptionsIeStandardPlaceOfSupplyScheme::*; + match s { + "small_seller" => Ok(SmallSeller), + "standard" => Ok(Standard), + _ => Err(()), + } + } +} +impl std::fmt::Display for CreateTaxRegistrationCountryOptionsIeStandardPlaceOfSupplyScheme { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreateTaxRegistrationCountryOptionsIeStandardPlaceOfSupplyScheme { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreateTaxRegistrationCountryOptionsIeStandardPlaceOfSupplyScheme { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Type of registration to be created in an EU country. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreateTaxRegistrationCountryOptionsIeType { + Ioss, + OssNonUnion, + OssUnion, + Standard, +} +impl CreateTaxRegistrationCountryOptionsIeType { + pub fn as_str(self) -> &'static str { + use CreateTaxRegistrationCountryOptionsIeType::*; + match self { + Ioss => "ioss", + OssNonUnion => "oss_non_union", + OssUnion => "oss_union", + Standard => "standard", + } + } +} + +impl std::str::FromStr for CreateTaxRegistrationCountryOptionsIeType { + type Err = (); + fn from_str(s: &str) -> Result { + use CreateTaxRegistrationCountryOptionsIeType::*; + match s { + "ioss" => Ok(Ioss), + "oss_non_union" => Ok(OssNonUnion), + "oss_union" => Ok(OssUnion), + "standard" => Ok(Standard), + _ => Err(()), + } + } +} +impl std::fmt::Display for CreateTaxRegistrationCountryOptionsIeType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreateTaxRegistrationCountryOptionsIeType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreateTaxRegistrationCountryOptionsIeType { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Options for the registration in IS. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreateTaxRegistrationCountryOptionsIs { + /// Type of registration to be created in `country`. + #[serde(rename = "type")] + pub type_: CreateTaxRegistrationCountryOptionsIsType, +} +impl CreateTaxRegistrationCountryOptionsIs { + pub fn new(type_: CreateTaxRegistrationCountryOptionsIsType) -> Self { + Self { type_ } + } +} +/// Type of registration to be created in `country`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreateTaxRegistrationCountryOptionsIsType { + Standard, +} +impl CreateTaxRegistrationCountryOptionsIsType { + pub fn as_str(self) -> &'static str { + use CreateTaxRegistrationCountryOptionsIsType::*; + match self { + Standard => "standard", + } + } +} + +impl std::str::FromStr for CreateTaxRegistrationCountryOptionsIsType { + type Err = (); + fn from_str(s: &str) -> Result { + use CreateTaxRegistrationCountryOptionsIsType::*; + match s { + "standard" => Ok(Standard), + _ => Err(()), + } + } +} +impl std::fmt::Display for CreateTaxRegistrationCountryOptionsIsType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreateTaxRegistrationCountryOptionsIsType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreateTaxRegistrationCountryOptionsIsType { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Options for the registration in IT. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreateTaxRegistrationCountryOptionsIt { + /// Options for the standard registration. + #[serde(skip_serializing_if = "Option::is_none")] + pub standard: Option, + /// Type of registration to be created in an EU country. + #[serde(rename = "type")] + pub type_: CreateTaxRegistrationCountryOptionsItType, +} +impl CreateTaxRegistrationCountryOptionsIt { + pub fn new(type_: CreateTaxRegistrationCountryOptionsItType) -> Self { + Self { standard: None, type_ } + } +} +/// Options for the standard registration. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreateTaxRegistrationCountryOptionsItStandard { + /// Place of supply scheme used in an EU standard registration. + pub place_of_supply_scheme: CreateTaxRegistrationCountryOptionsItStandardPlaceOfSupplyScheme, +} +impl CreateTaxRegistrationCountryOptionsItStandard { + pub fn new( + place_of_supply_scheme: CreateTaxRegistrationCountryOptionsItStandardPlaceOfSupplyScheme, + ) -> Self { + Self { place_of_supply_scheme } + } +} +/// Place of supply scheme used in an EU standard registration. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreateTaxRegistrationCountryOptionsItStandardPlaceOfSupplyScheme { + SmallSeller, + Standard, +} +impl CreateTaxRegistrationCountryOptionsItStandardPlaceOfSupplyScheme { + pub fn as_str(self) -> &'static str { + use CreateTaxRegistrationCountryOptionsItStandardPlaceOfSupplyScheme::*; + match self { + SmallSeller => "small_seller", + Standard => "standard", + } + } +} + +impl std::str::FromStr for CreateTaxRegistrationCountryOptionsItStandardPlaceOfSupplyScheme { + type Err = (); + fn from_str(s: &str) -> Result { + use CreateTaxRegistrationCountryOptionsItStandardPlaceOfSupplyScheme::*; + match s { + "small_seller" => Ok(SmallSeller), + "standard" => Ok(Standard), + _ => Err(()), + } + } +} +impl std::fmt::Display for CreateTaxRegistrationCountryOptionsItStandardPlaceOfSupplyScheme { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreateTaxRegistrationCountryOptionsItStandardPlaceOfSupplyScheme { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreateTaxRegistrationCountryOptionsItStandardPlaceOfSupplyScheme { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Type of registration to be created in an EU country. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreateTaxRegistrationCountryOptionsItType { + Ioss, + OssNonUnion, + OssUnion, + Standard, +} +impl CreateTaxRegistrationCountryOptionsItType { + pub fn as_str(self) -> &'static str { + use CreateTaxRegistrationCountryOptionsItType::*; + match self { + Ioss => "ioss", + OssNonUnion => "oss_non_union", + OssUnion => "oss_union", + Standard => "standard", + } + } +} + +impl std::str::FromStr for CreateTaxRegistrationCountryOptionsItType { + type Err = (); + fn from_str(s: &str) -> Result { + use CreateTaxRegistrationCountryOptionsItType::*; + match s { + "ioss" => Ok(Ioss), + "oss_non_union" => Ok(OssNonUnion), + "oss_union" => Ok(OssUnion), + "standard" => Ok(Standard), + _ => Err(()), + } + } +} +impl std::fmt::Display for CreateTaxRegistrationCountryOptionsItType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreateTaxRegistrationCountryOptionsItType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreateTaxRegistrationCountryOptionsItType { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Options for the registration in JP. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreateTaxRegistrationCountryOptionsJp { + /// Type of registration to be created in `country`. + #[serde(rename = "type")] + pub type_: CreateTaxRegistrationCountryOptionsJpType, +} +impl CreateTaxRegistrationCountryOptionsJp { + pub fn new(type_: CreateTaxRegistrationCountryOptionsJpType) -> Self { + Self { type_ } + } +} +/// Type of registration to be created in `country`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreateTaxRegistrationCountryOptionsJpType { + Standard, +} +impl CreateTaxRegistrationCountryOptionsJpType { + pub fn as_str(self) -> &'static str { + use CreateTaxRegistrationCountryOptionsJpType::*; + match self { + Standard => "standard", + } + } +} + +impl std::str::FromStr for CreateTaxRegistrationCountryOptionsJpType { + type Err = (); + fn from_str(s: &str) -> Result { + use CreateTaxRegistrationCountryOptionsJpType::*; + match s { + "standard" => Ok(Standard), + _ => Err(()), + } + } +} +impl std::fmt::Display for CreateTaxRegistrationCountryOptionsJpType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreateTaxRegistrationCountryOptionsJpType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreateTaxRegistrationCountryOptionsJpType { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Options for the registration in KR. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreateTaxRegistrationCountryOptionsKr { + /// Type of registration to be created in `country`. + #[serde(rename = "type")] + pub type_: CreateTaxRegistrationCountryOptionsKrType, +} +impl CreateTaxRegistrationCountryOptionsKr { + pub fn new(type_: CreateTaxRegistrationCountryOptionsKrType) -> Self { + Self { type_ } + } +} +/// Type of registration to be created in `country`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreateTaxRegistrationCountryOptionsKrType { + Simplified, +} +impl CreateTaxRegistrationCountryOptionsKrType { + pub fn as_str(self) -> &'static str { + use CreateTaxRegistrationCountryOptionsKrType::*; + match self { + Simplified => "simplified", + } + } +} + +impl std::str::FromStr for CreateTaxRegistrationCountryOptionsKrType { + type Err = (); + fn from_str(s: &str) -> Result { + use CreateTaxRegistrationCountryOptionsKrType::*; + match s { + "simplified" => Ok(Simplified), + _ => Err(()), + } + } +} +impl std::fmt::Display for CreateTaxRegistrationCountryOptionsKrType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreateTaxRegistrationCountryOptionsKrType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreateTaxRegistrationCountryOptionsKrType { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Options for the registration in LT. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreateTaxRegistrationCountryOptionsLt { + /// Options for the standard registration. + #[serde(skip_serializing_if = "Option::is_none")] + pub standard: Option, + /// Type of registration to be created in an EU country. + #[serde(rename = "type")] + pub type_: CreateTaxRegistrationCountryOptionsLtType, +} +impl CreateTaxRegistrationCountryOptionsLt { + pub fn new(type_: CreateTaxRegistrationCountryOptionsLtType) -> Self { + Self { standard: None, type_ } + } +} +/// Options for the standard registration. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreateTaxRegistrationCountryOptionsLtStandard { + /// Place of supply scheme used in an EU standard registration. + pub place_of_supply_scheme: CreateTaxRegistrationCountryOptionsLtStandardPlaceOfSupplyScheme, +} +impl CreateTaxRegistrationCountryOptionsLtStandard { + pub fn new( + place_of_supply_scheme: CreateTaxRegistrationCountryOptionsLtStandardPlaceOfSupplyScheme, + ) -> Self { + Self { place_of_supply_scheme } + } +} +/// Place of supply scheme used in an EU standard registration. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreateTaxRegistrationCountryOptionsLtStandardPlaceOfSupplyScheme { + SmallSeller, + Standard, +} +impl CreateTaxRegistrationCountryOptionsLtStandardPlaceOfSupplyScheme { + pub fn as_str(self) -> &'static str { + use CreateTaxRegistrationCountryOptionsLtStandardPlaceOfSupplyScheme::*; + match self { + SmallSeller => "small_seller", + Standard => "standard", + } + } +} + +impl std::str::FromStr for CreateTaxRegistrationCountryOptionsLtStandardPlaceOfSupplyScheme { + type Err = (); + fn from_str(s: &str) -> Result { + use CreateTaxRegistrationCountryOptionsLtStandardPlaceOfSupplyScheme::*; + match s { + "small_seller" => Ok(SmallSeller), + "standard" => Ok(Standard), + _ => Err(()), + } + } +} +impl std::fmt::Display for CreateTaxRegistrationCountryOptionsLtStandardPlaceOfSupplyScheme { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreateTaxRegistrationCountryOptionsLtStandardPlaceOfSupplyScheme { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreateTaxRegistrationCountryOptionsLtStandardPlaceOfSupplyScheme { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Type of registration to be created in an EU country. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreateTaxRegistrationCountryOptionsLtType { + Ioss, + OssNonUnion, + OssUnion, + Standard, +} +impl CreateTaxRegistrationCountryOptionsLtType { + pub fn as_str(self) -> &'static str { + use CreateTaxRegistrationCountryOptionsLtType::*; + match self { + Ioss => "ioss", + OssNonUnion => "oss_non_union", + OssUnion => "oss_union", + Standard => "standard", + } + } +} + +impl std::str::FromStr for CreateTaxRegistrationCountryOptionsLtType { + type Err = (); + fn from_str(s: &str) -> Result { + use CreateTaxRegistrationCountryOptionsLtType::*; + match s { + "ioss" => Ok(Ioss), + "oss_non_union" => Ok(OssNonUnion), + "oss_union" => Ok(OssUnion), + "standard" => Ok(Standard), + _ => Err(()), + } + } +} +impl std::fmt::Display for CreateTaxRegistrationCountryOptionsLtType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreateTaxRegistrationCountryOptionsLtType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreateTaxRegistrationCountryOptionsLtType { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Options for the registration in LU. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreateTaxRegistrationCountryOptionsLu { + /// Options for the standard registration. + #[serde(skip_serializing_if = "Option::is_none")] + pub standard: Option, + /// Type of registration to be created in an EU country. + #[serde(rename = "type")] + pub type_: CreateTaxRegistrationCountryOptionsLuType, +} +impl CreateTaxRegistrationCountryOptionsLu { + pub fn new(type_: CreateTaxRegistrationCountryOptionsLuType) -> Self { + Self { standard: None, type_ } + } +} +/// Options for the standard registration. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreateTaxRegistrationCountryOptionsLuStandard { + /// Place of supply scheme used in an EU standard registration. + pub place_of_supply_scheme: CreateTaxRegistrationCountryOptionsLuStandardPlaceOfSupplyScheme, +} +impl CreateTaxRegistrationCountryOptionsLuStandard { + pub fn new( + place_of_supply_scheme: CreateTaxRegistrationCountryOptionsLuStandardPlaceOfSupplyScheme, + ) -> Self { + Self { place_of_supply_scheme } + } +} +/// Place of supply scheme used in an EU standard registration. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreateTaxRegistrationCountryOptionsLuStandardPlaceOfSupplyScheme { + SmallSeller, + Standard, +} +impl CreateTaxRegistrationCountryOptionsLuStandardPlaceOfSupplyScheme { + pub fn as_str(self) -> &'static str { + use CreateTaxRegistrationCountryOptionsLuStandardPlaceOfSupplyScheme::*; + match self { + SmallSeller => "small_seller", + Standard => "standard", + } + } +} + +impl std::str::FromStr for CreateTaxRegistrationCountryOptionsLuStandardPlaceOfSupplyScheme { + type Err = (); + fn from_str(s: &str) -> Result { + use CreateTaxRegistrationCountryOptionsLuStandardPlaceOfSupplyScheme::*; + match s { + "small_seller" => Ok(SmallSeller), + "standard" => Ok(Standard), + _ => Err(()), + } + } +} +impl std::fmt::Display for CreateTaxRegistrationCountryOptionsLuStandardPlaceOfSupplyScheme { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreateTaxRegistrationCountryOptionsLuStandardPlaceOfSupplyScheme { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreateTaxRegistrationCountryOptionsLuStandardPlaceOfSupplyScheme { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Type of registration to be created in an EU country. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreateTaxRegistrationCountryOptionsLuType { + Ioss, + OssNonUnion, + OssUnion, + Standard, +} +impl CreateTaxRegistrationCountryOptionsLuType { + pub fn as_str(self) -> &'static str { + use CreateTaxRegistrationCountryOptionsLuType::*; + match self { + Ioss => "ioss", + OssNonUnion => "oss_non_union", + OssUnion => "oss_union", + Standard => "standard", + } + } +} + +impl std::str::FromStr for CreateTaxRegistrationCountryOptionsLuType { + type Err = (); + fn from_str(s: &str) -> Result { + use CreateTaxRegistrationCountryOptionsLuType::*; + match s { + "ioss" => Ok(Ioss), + "oss_non_union" => Ok(OssNonUnion), + "oss_union" => Ok(OssUnion), + "standard" => Ok(Standard), + _ => Err(()), + } + } +} +impl std::fmt::Display for CreateTaxRegistrationCountryOptionsLuType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreateTaxRegistrationCountryOptionsLuType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreateTaxRegistrationCountryOptionsLuType { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Options for the registration in LV. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreateTaxRegistrationCountryOptionsLv { + /// Options for the standard registration. + #[serde(skip_serializing_if = "Option::is_none")] + pub standard: Option, + /// Type of registration to be created in an EU country. + #[serde(rename = "type")] + pub type_: CreateTaxRegistrationCountryOptionsLvType, +} +impl CreateTaxRegistrationCountryOptionsLv { + pub fn new(type_: CreateTaxRegistrationCountryOptionsLvType) -> Self { + Self { standard: None, type_ } + } +} +/// Options for the standard registration. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreateTaxRegistrationCountryOptionsLvStandard { + /// Place of supply scheme used in an EU standard registration. + pub place_of_supply_scheme: CreateTaxRegistrationCountryOptionsLvStandardPlaceOfSupplyScheme, +} +impl CreateTaxRegistrationCountryOptionsLvStandard { + pub fn new( + place_of_supply_scheme: CreateTaxRegistrationCountryOptionsLvStandardPlaceOfSupplyScheme, + ) -> Self { + Self { place_of_supply_scheme } + } +} +/// Place of supply scheme used in an EU standard registration. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreateTaxRegistrationCountryOptionsLvStandardPlaceOfSupplyScheme { + SmallSeller, + Standard, +} +impl CreateTaxRegistrationCountryOptionsLvStandardPlaceOfSupplyScheme { + pub fn as_str(self) -> &'static str { + use CreateTaxRegistrationCountryOptionsLvStandardPlaceOfSupplyScheme::*; + match self { + SmallSeller => "small_seller", + Standard => "standard", + } + } +} + +impl std::str::FromStr for CreateTaxRegistrationCountryOptionsLvStandardPlaceOfSupplyScheme { + type Err = (); + fn from_str(s: &str) -> Result { + use CreateTaxRegistrationCountryOptionsLvStandardPlaceOfSupplyScheme::*; + match s { + "small_seller" => Ok(SmallSeller), + "standard" => Ok(Standard), + _ => Err(()), + } + } +} +impl std::fmt::Display for CreateTaxRegistrationCountryOptionsLvStandardPlaceOfSupplyScheme { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreateTaxRegistrationCountryOptionsLvStandardPlaceOfSupplyScheme { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreateTaxRegistrationCountryOptionsLvStandardPlaceOfSupplyScheme { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Type of registration to be created in an EU country. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreateTaxRegistrationCountryOptionsLvType { + Ioss, + OssNonUnion, + OssUnion, + Standard, +} +impl CreateTaxRegistrationCountryOptionsLvType { + pub fn as_str(self) -> &'static str { + use CreateTaxRegistrationCountryOptionsLvType::*; + match self { + Ioss => "ioss", + OssNonUnion => "oss_non_union", + OssUnion => "oss_union", + Standard => "standard", + } + } +} + +impl std::str::FromStr for CreateTaxRegistrationCountryOptionsLvType { + type Err = (); + fn from_str(s: &str) -> Result { + use CreateTaxRegistrationCountryOptionsLvType::*; + match s { + "ioss" => Ok(Ioss), + "oss_non_union" => Ok(OssNonUnion), + "oss_union" => Ok(OssUnion), + "standard" => Ok(Standard), + _ => Err(()), + } + } +} +impl std::fmt::Display for CreateTaxRegistrationCountryOptionsLvType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreateTaxRegistrationCountryOptionsLvType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreateTaxRegistrationCountryOptionsLvType { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Options for the registration in MT. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreateTaxRegistrationCountryOptionsMt { + /// Options for the standard registration. + #[serde(skip_serializing_if = "Option::is_none")] + pub standard: Option, + /// Type of registration to be created in an EU country. + #[serde(rename = "type")] + pub type_: CreateTaxRegistrationCountryOptionsMtType, +} +impl CreateTaxRegistrationCountryOptionsMt { + pub fn new(type_: CreateTaxRegistrationCountryOptionsMtType) -> Self { + Self { standard: None, type_ } + } +} +/// Options for the standard registration. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreateTaxRegistrationCountryOptionsMtStandard { + /// Place of supply scheme used in an EU standard registration. + pub place_of_supply_scheme: CreateTaxRegistrationCountryOptionsMtStandardPlaceOfSupplyScheme, +} +impl CreateTaxRegistrationCountryOptionsMtStandard { + pub fn new( + place_of_supply_scheme: CreateTaxRegistrationCountryOptionsMtStandardPlaceOfSupplyScheme, + ) -> Self { + Self { place_of_supply_scheme } + } +} +/// Place of supply scheme used in an EU standard registration. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreateTaxRegistrationCountryOptionsMtStandardPlaceOfSupplyScheme { + SmallSeller, + Standard, +} +impl CreateTaxRegistrationCountryOptionsMtStandardPlaceOfSupplyScheme { + pub fn as_str(self) -> &'static str { + use CreateTaxRegistrationCountryOptionsMtStandardPlaceOfSupplyScheme::*; + match self { + SmallSeller => "small_seller", + Standard => "standard", + } + } +} + +impl std::str::FromStr for CreateTaxRegistrationCountryOptionsMtStandardPlaceOfSupplyScheme { + type Err = (); + fn from_str(s: &str) -> Result { + use CreateTaxRegistrationCountryOptionsMtStandardPlaceOfSupplyScheme::*; + match s { + "small_seller" => Ok(SmallSeller), + "standard" => Ok(Standard), + _ => Err(()), + } + } +} +impl std::fmt::Display for CreateTaxRegistrationCountryOptionsMtStandardPlaceOfSupplyScheme { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreateTaxRegistrationCountryOptionsMtStandardPlaceOfSupplyScheme { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreateTaxRegistrationCountryOptionsMtStandardPlaceOfSupplyScheme { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Type of registration to be created in an EU country. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreateTaxRegistrationCountryOptionsMtType { + Ioss, + OssNonUnion, + OssUnion, + Standard, +} +impl CreateTaxRegistrationCountryOptionsMtType { + pub fn as_str(self) -> &'static str { + use CreateTaxRegistrationCountryOptionsMtType::*; + match self { + Ioss => "ioss", + OssNonUnion => "oss_non_union", + OssUnion => "oss_union", + Standard => "standard", + } + } +} + +impl std::str::FromStr for CreateTaxRegistrationCountryOptionsMtType { + type Err = (); + fn from_str(s: &str) -> Result { + use CreateTaxRegistrationCountryOptionsMtType::*; + match s { + "ioss" => Ok(Ioss), + "oss_non_union" => Ok(OssNonUnion), + "oss_union" => Ok(OssUnion), + "standard" => Ok(Standard), + _ => Err(()), + } + } +} +impl std::fmt::Display for CreateTaxRegistrationCountryOptionsMtType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreateTaxRegistrationCountryOptionsMtType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreateTaxRegistrationCountryOptionsMtType { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Options for the registration in MX. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreateTaxRegistrationCountryOptionsMx { + /// Type of registration to be created in `country`. + #[serde(rename = "type")] + pub type_: CreateTaxRegistrationCountryOptionsMxType, +} +impl CreateTaxRegistrationCountryOptionsMx { + pub fn new(type_: CreateTaxRegistrationCountryOptionsMxType) -> Self { + Self { type_ } + } +} +/// Type of registration to be created in `country`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreateTaxRegistrationCountryOptionsMxType { + Simplified, +} +impl CreateTaxRegistrationCountryOptionsMxType { + pub fn as_str(self) -> &'static str { + use CreateTaxRegistrationCountryOptionsMxType::*; + match self { + Simplified => "simplified", + } + } +} + +impl std::str::FromStr for CreateTaxRegistrationCountryOptionsMxType { + type Err = (); + fn from_str(s: &str) -> Result { + use CreateTaxRegistrationCountryOptionsMxType::*; + match s { + "simplified" => Ok(Simplified), + _ => Err(()), + } + } +} +impl std::fmt::Display for CreateTaxRegistrationCountryOptionsMxType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreateTaxRegistrationCountryOptionsMxType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreateTaxRegistrationCountryOptionsMxType { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Options for the registration in MY. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreateTaxRegistrationCountryOptionsMy { + /// Type of registration to be created in `country`. + #[serde(rename = "type")] + pub type_: CreateTaxRegistrationCountryOptionsMyType, +} +impl CreateTaxRegistrationCountryOptionsMy { + pub fn new(type_: CreateTaxRegistrationCountryOptionsMyType) -> Self { + Self { type_ } + } +} +/// Type of registration to be created in `country`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreateTaxRegistrationCountryOptionsMyType { + Simplified, +} +impl CreateTaxRegistrationCountryOptionsMyType { + pub fn as_str(self) -> &'static str { + use CreateTaxRegistrationCountryOptionsMyType::*; + match self { + Simplified => "simplified", + } + } +} + +impl std::str::FromStr for CreateTaxRegistrationCountryOptionsMyType { + type Err = (); + fn from_str(s: &str) -> Result { + use CreateTaxRegistrationCountryOptionsMyType::*; + match s { + "simplified" => Ok(Simplified), + _ => Err(()), + } + } +} +impl std::fmt::Display for CreateTaxRegistrationCountryOptionsMyType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreateTaxRegistrationCountryOptionsMyType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreateTaxRegistrationCountryOptionsMyType { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Options for the registration in NL. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreateTaxRegistrationCountryOptionsNl { + /// Options for the standard registration. + #[serde(skip_serializing_if = "Option::is_none")] + pub standard: Option, + /// Type of registration to be created in an EU country. + #[serde(rename = "type")] + pub type_: CreateTaxRegistrationCountryOptionsNlType, +} +impl CreateTaxRegistrationCountryOptionsNl { + pub fn new(type_: CreateTaxRegistrationCountryOptionsNlType) -> Self { + Self { standard: None, type_ } + } +} +/// Options for the standard registration. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreateTaxRegistrationCountryOptionsNlStandard { + /// Place of supply scheme used in an EU standard registration. + pub place_of_supply_scheme: CreateTaxRegistrationCountryOptionsNlStandardPlaceOfSupplyScheme, +} +impl CreateTaxRegistrationCountryOptionsNlStandard { + pub fn new( + place_of_supply_scheme: CreateTaxRegistrationCountryOptionsNlStandardPlaceOfSupplyScheme, + ) -> Self { + Self { place_of_supply_scheme } + } +} +/// Place of supply scheme used in an EU standard registration. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreateTaxRegistrationCountryOptionsNlStandardPlaceOfSupplyScheme { + SmallSeller, + Standard, +} +impl CreateTaxRegistrationCountryOptionsNlStandardPlaceOfSupplyScheme { + pub fn as_str(self) -> &'static str { + use CreateTaxRegistrationCountryOptionsNlStandardPlaceOfSupplyScheme::*; + match self { + SmallSeller => "small_seller", + Standard => "standard", + } + } +} + +impl std::str::FromStr for CreateTaxRegistrationCountryOptionsNlStandardPlaceOfSupplyScheme { + type Err = (); + fn from_str(s: &str) -> Result { + use CreateTaxRegistrationCountryOptionsNlStandardPlaceOfSupplyScheme::*; + match s { + "small_seller" => Ok(SmallSeller), + "standard" => Ok(Standard), + _ => Err(()), + } + } +} +impl std::fmt::Display for CreateTaxRegistrationCountryOptionsNlStandardPlaceOfSupplyScheme { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreateTaxRegistrationCountryOptionsNlStandardPlaceOfSupplyScheme { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreateTaxRegistrationCountryOptionsNlStandardPlaceOfSupplyScheme { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Type of registration to be created in an EU country. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreateTaxRegistrationCountryOptionsNlType { + Ioss, + OssNonUnion, + OssUnion, + Standard, +} +impl CreateTaxRegistrationCountryOptionsNlType { + pub fn as_str(self) -> &'static str { + use CreateTaxRegistrationCountryOptionsNlType::*; + match self { + Ioss => "ioss", + OssNonUnion => "oss_non_union", + OssUnion => "oss_union", + Standard => "standard", + } + } +} + +impl std::str::FromStr for CreateTaxRegistrationCountryOptionsNlType { + type Err = (); + fn from_str(s: &str) -> Result { + use CreateTaxRegistrationCountryOptionsNlType::*; + match s { + "ioss" => Ok(Ioss), + "oss_non_union" => Ok(OssNonUnion), + "oss_union" => Ok(OssUnion), + "standard" => Ok(Standard), + _ => Err(()), + } + } +} +impl std::fmt::Display for CreateTaxRegistrationCountryOptionsNlType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreateTaxRegistrationCountryOptionsNlType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreateTaxRegistrationCountryOptionsNlType { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Options for the registration in NO. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreateTaxRegistrationCountryOptionsNo { + /// Type of registration to be created in `country`. + #[serde(rename = "type")] + pub type_: CreateTaxRegistrationCountryOptionsNoType, +} +impl CreateTaxRegistrationCountryOptionsNo { + pub fn new(type_: CreateTaxRegistrationCountryOptionsNoType) -> Self { + Self { type_ } + } +} +/// Type of registration to be created in `country`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreateTaxRegistrationCountryOptionsNoType { + Standard, +} +impl CreateTaxRegistrationCountryOptionsNoType { + pub fn as_str(self) -> &'static str { + use CreateTaxRegistrationCountryOptionsNoType::*; + match self { + Standard => "standard", + } + } +} + +impl std::str::FromStr for CreateTaxRegistrationCountryOptionsNoType { + type Err = (); + fn from_str(s: &str) -> Result { + use CreateTaxRegistrationCountryOptionsNoType::*; + match s { + "standard" => Ok(Standard), + _ => Err(()), + } + } +} +impl std::fmt::Display for CreateTaxRegistrationCountryOptionsNoType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreateTaxRegistrationCountryOptionsNoType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreateTaxRegistrationCountryOptionsNoType { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Options for the registration in NZ. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreateTaxRegistrationCountryOptionsNz { + /// Type of registration to be created in `country`. + #[serde(rename = "type")] + pub type_: CreateTaxRegistrationCountryOptionsNzType, +} +impl CreateTaxRegistrationCountryOptionsNz { + pub fn new(type_: CreateTaxRegistrationCountryOptionsNzType) -> Self { + Self { type_ } + } +} +/// Type of registration to be created in `country`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreateTaxRegistrationCountryOptionsNzType { + Standard, +} +impl CreateTaxRegistrationCountryOptionsNzType { + pub fn as_str(self) -> &'static str { + use CreateTaxRegistrationCountryOptionsNzType::*; + match self { + Standard => "standard", + } + } +} + +impl std::str::FromStr for CreateTaxRegistrationCountryOptionsNzType { + type Err = (); + fn from_str(s: &str) -> Result { + use CreateTaxRegistrationCountryOptionsNzType::*; + match s { + "standard" => Ok(Standard), + _ => Err(()), + } + } +} +impl std::fmt::Display for CreateTaxRegistrationCountryOptionsNzType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreateTaxRegistrationCountryOptionsNzType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreateTaxRegistrationCountryOptionsNzType { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Options for the registration in PL. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreateTaxRegistrationCountryOptionsPl { + /// Options for the standard registration. + #[serde(skip_serializing_if = "Option::is_none")] + pub standard: Option, + /// Type of registration to be created in an EU country. + #[serde(rename = "type")] + pub type_: CreateTaxRegistrationCountryOptionsPlType, +} +impl CreateTaxRegistrationCountryOptionsPl { + pub fn new(type_: CreateTaxRegistrationCountryOptionsPlType) -> Self { + Self { standard: None, type_ } + } +} +/// Options for the standard registration. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreateTaxRegistrationCountryOptionsPlStandard { + /// Place of supply scheme used in an EU standard registration. + pub place_of_supply_scheme: CreateTaxRegistrationCountryOptionsPlStandardPlaceOfSupplyScheme, +} +impl CreateTaxRegistrationCountryOptionsPlStandard { + pub fn new( + place_of_supply_scheme: CreateTaxRegistrationCountryOptionsPlStandardPlaceOfSupplyScheme, + ) -> Self { + Self { place_of_supply_scheme } + } +} +/// Place of supply scheme used in an EU standard registration. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreateTaxRegistrationCountryOptionsPlStandardPlaceOfSupplyScheme { + SmallSeller, + Standard, +} +impl CreateTaxRegistrationCountryOptionsPlStandardPlaceOfSupplyScheme { + pub fn as_str(self) -> &'static str { + use CreateTaxRegistrationCountryOptionsPlStandardPlaceOfSupplyScheme::*; + match self { + SmallSeller => "small_seller", + Standard => "standard", + } + } +} + +impl std::str::FromStr for CreateTaxRegistrationCountryOptionsPlStandardPlaceOfSupplyScheme { + type Err = (); + fn from_str(s: &str) -> Result { + use CreateTaxRegistrationCountryOptionsPlStandardPlaceOfSupplyScheme::*; + match s { + "small_seller" => Ok(SmallSeller), + "standard" => Ok(Standard), + _ => Err(()), + } + } +} +impl std::fmt::Display for CreateTaxRegistrationCountryOptionsPlStandardPlaceOfSupplyScheme { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreateTaxRegistrationCountryOptionsPlStandardPlaceOfSupplyScheme { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreateTaxRegistrationCountryOptionsPlStandardPlaceOfSupplyScheme { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Type of registration to be created in an EU country. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreateTaxRegistrationCountryOptionsPlType { + Ioss, + OssNonUnion, + OssUnion, + Standard, +} +impl CreateTaxRegistrationCountryOptionsPlType { + pub fn as_str(self) -> &'static str { + use CreateTaxRegistrationCountryOptionsPlType::*; + match self { + Ioss => "ioss", + OssNonUnion => "oss_non_union", + OssUnion => "oss_union", + Standard => "standard", + } + } +} + +impl std::str::FromStr for CreateTaxRegistrationCountryOptionsPlType { + type Err = (); + fn from_str(s: &str) -> Result { + use CreateTaxRegistrationCountryOptionsPlType::*; + match s { + "ioss" => Ok(Ioss), + "oss_non_union" => Ok(OssNonUnion), + "oss_union" => Ok(OssUnion), + "standard" => Ok(Standard), + _ => Err(()), + } + } +} +impl std::fmt::Display for CreateTaxRegistrationCountryOptionsPlType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreateTaxRegistrationCountryOptionsPlType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreateTaxRegistrationCountryOptionsPlType { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Options for the registration in PT. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreateTaxRegistrationCountryOptionsPt { + /// Options for the standard registration. + #[serde(skip_serializing_if = "Option::is_none")] + pub standard: Option, + /// Type of registration to be created in an EU country. + #[serde(rename = "type")] + pub type_: CreateTaxRegistrationCountryOptionsPtType, +} +impl CreateTaxRegistrationCountryOptionsPt { + pub fn new(type_: CreateTaxRegistrationCountryOptionsPtType) -> Self { + Self { standard: None, type_ } + } +} +/// Options for the standard registration. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreateTaxRegistrationCountryOptionsPtStandard { + /// Place of supply scheme used in an EU standard registration. + pub place_of_supply_scheme: CreateTaxRegistrationCountryOptionsPtStandardPlaceOfSupplyScheme, +} +impl CreateTaxRegistrationCountryOptionsPtStandard { + pub fn new( + place_of_supply_scheme: CreateTaxRegistrationCountryOptionsPtStandardPlaceOfSupplyScheme, + ) -> Self { + Self { place_of_supply_scheme } + } +} +/// Place of supply scheme used in an EU standard registration. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreateTaxRegistrationCountryOptionsPtStandardPlaceOfSupplyScheme { + SmallSeller, + Standard, +} +impl CreateTaxRegistrationCountryOptionsPtStandardPlaceOfSupplyScheme { + pub fn as_str(self) -> &'static str { + use CreateTaxRegistrationCountryOptionsPtStandardPlaceOfSupplyScheme::*; + match self { + SmallSeller => "small_seller", + Standard => "standard", + } + } +} + +impl std::str::FromStr for CreateTaxRegistrationCountryOptionsPtStandardPlaceOfSupplyScheme { + type Err = (); + fn from_str(s: &str) -> Result { + use CreateTaxRegistrationCountryOptionsPtStandardPlaceOfSupplyScheme::*; + match s { + "small_seller" => Ok(SmallSeller), + "standard" => Ok(Standard), + _ => Err(()), + } + } +} +impl std::fmt::Display for CreateTaxRegistrationCountryOptionsPtStandardPlaceOfSupplyScheme { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreateTaxRegistrationCountryOptionsPtStandardPlaceOfSupplyScheme { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreateTaxRegistrationCountryOptionsPtStandardPlaceOfSupplyScheme { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Type of registration to be created in an EU country. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreateTaxRegistrationCountryOptionsPtType { + Ioss, + OssNonUnion, + OssUnion, + Standard, +} +impl CreateTaxRegistrationCountryOptionsPtType { + pub fn as_str(self) -> &'static str { + use CreateTaxRegistrationCountryOptionsPtType::*; + match self { + Ioss => "ioss", + OssNonUnion => "oss_non_union", + OssUnion => "oss_union", + Standard => "standard", + } + } +} + +impl std::str::FromStr for CreateTaxRegistrationCountryOptionsPtType { + type Err = (); + fn from_str(s: &str) -> Result { + use CreateTaxRegistrationCountryOptionsPtType::*; + match s { + "ioss" => Ok(Ioss), + "oss_non_union" => Ok(OssNonUnion), + "oss_union" => Ok(OssUnion), + "standard" => Ok(Standard), + _ => Err(()), + } + } +} +impl std::fmt::Display for CreateTaxRegistrationCountryOptionsPtType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreateTaxRegistrationCountryOptionsPtType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreateTaxRegistrationCountryOptionsPtType { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Options for the registration in RO. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreateTaxRegistrationCountryOptionsRo { + /// Options for the standard registration. + #[serde(skip_serializing_if = "Option::is_none")] + pub standard: Option, + /// Type of registration to be created in an EU country. + #[serde(rename = "type")] + pub type_: CreateTaxRegistrationCountryOptionsRoType, +} +impl CreateTaxRegistrationCountryOptionsRo { + pub fn new(type_: CreateTaxRegistrationCountryOptionsRoType) -> Self { + Self { standard: None, type_ } + } +} +/// Options for the standard registration. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreateTaxRegistrationCountryOptionsRoStandard { + /// Place of supply scheme used in an EU standard registration. + pub place_of_supply_scheme: CreateTaxRegistrationCountryOptionsRoStandardPlaceOfSupplyScheme, +} +impl CreateTaxRegistrationCountryOptionsRoStandard { + pub fn new( + place_of_supply_scheme: CreateTaxRegistrationCountryOptionsRoStandardPlaceOfSupplyScheme, + ) -> Self { + Self { place_of_supply_scheme } + } +} +/// Place of supply scheme used in an EU standard registration. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreateTaxRegistrationCountryOptionsRoStandardPlaceOfSupplyScheme { + SmallSeller, + Standard, +} +impl CreateTaxRegistrationCountryOptionsRoStandardPlaceOfSupplyScheme { + pub fn as_str(self) -> &'static str { + use CreateTaxRegistrationCountryOptionsRoStandardPlaceOfSupplyScheme::*; + match self { + SmallSeller => "small_seller", + Standard => "standard", + } + } +} + +impl std::str::FromStr for CreateTaxRegistrationCountryOptionsRoStandardPlaceOfSupplyScheme { + type Err = (); + fn from_str(s: &str) -> Result { + use CreateTaxRegistrationCountryOptionsRoStandardPlaceOfSupplyScheme::*; + match s { + "small_seller" => Ok(SmallSeller), + "standard" => Ok(Standard), + _ => Err(()), + } + } +} +impl std::fmt::Display for CreateTaxRegistrationCountryOptionsRoStandardPlaceOfSupplyScheme { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreateTaxRegistrationCountryOptionsRoStandardPlaceOfSupplyScheme { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreateTaxRegistrationCountryOptionsRoStandardPlaceOfSupplyScheme { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Type of registration to be created in an EU country. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreateTaxRegistrationCountryOptionsRoType { + Ioss, + OssNonUnion, + OssUnion, + Standard, +} +impl CreateTaxRegistrationCountryOptionsRoType { + pub fn as_str(self) -> &'static str { + use CreateTaxRegistrationCountryOptionsRoType::*; + match self { + Ioss => "ioss", + OssNonUnion => "oss_non_union", + OssUnion => "oss_union", + Standard => "standard", + } + } +} + +impl std::str::FromStr for CreateTaxRegistrationCountryOptionsRoType { + type Err = (); + fn from_str(s: &str) -> Result { + use CreateTaxRegistrationCountryOptionsRoType::*; + match s { + "ioss" => Ok(Ioss), + "oss_non_union" => Ok(OssNonUnion), + "oss_union" => Ok(OssUnion), + "standard" => Ok(Standard), + _ => Err(()), + } + } +} +impl std::fmt::Display for CreateTaxRegistrationCountryOptionsRoType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreateTaxRegistrationCountryOptionsRoType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreateTaxRegistrationCountryOptionsRoType { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Options for the registration in SA. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreateTaxRegistrationCountryOptionsSa { + /// Type of registration to be created in `country`. + #[serde(rename = "type")] + pub type_: CreateTaxRegistrationCountryOptionsSaType, +} +impl CreateTaxRegistrationCountryOptionsSa { + pub fn new(type_: CreateTaxRegistrationCountryOptionsSaType) -> Self { + Self { type_ } + } +} +/// Type of registration to be created in `country`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreateTaxRegistrationCountryOptionsSaType { + Simplified, +} +impl CreateTaxRegistrationCountryOptionsSaType { + pub fn as_str(self) -> &'static str { + use CreateTaxRegistrationCountryOptionsSaType::*; + match self { + Simplified => "simplified", + } + } +} + +impl std::str::FromStr for CreateTaxRegistrationCountryOptionsSaType { + type Err = (); + fn from_str(s: &str) -> Result { + use CreateTaxRegistrationCountryOptionsSaType::*; + match s { + "simplified" => Ok(Simplified), + _ => Err(()), + } + } +} +impl std::fmt::Display for CreateTaxRegistrationCountryOptionsSaType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreateTaxRegistrationCountryOptionsSaType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreateTaxRegistrationCountryOptionsSaType { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Options for the registration in SE. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreateTaxRegistrationCountryOptionsSe { + /// Options for the standard registration. + #[serde(skip_serializing_if = "Option::is_none")] + pub standard: Option, + /// Type of registration to be created in an EU country. + #[serde(rename = "type")] + pub type_: CreateTaxRegistrationCountryOptionsSeType, +} +impl CreateTaxRegistrationCountryOptionsSe { + pub fn new(type_: CreateTaxRegistrationCountryOptionsSeType) -> Self { + Self { standard: None, type_ } + } +} +/// Options for the standard registration. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreateTaxRegistrationCountryOptionsSeStandard { + /// Place of supply scheme used in an EU standard registration. + pub place_of_supply_scheme: CreateTaxRegistrationCountryOptionsSeStandardPlaceOfSupplyScheme, +} +impl CreateTaxRegistrationCountryOptionsSeStandard { + pub fn new( + place_of_supply_scheme: CreateTaxRegistrationCountryOptionsSeStandardPlaceOfSupplyScheme, + ) -> Self { + Self { place_of_supply_scheme } + } +} +/// Place of supply scheme used in an EU standard registration. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreateTaxRegistrationCountryOptionsSeStandardPlaceOfSupplyScheme { + SmallSeller, + Standard, +} +impl CreateTaxRegistrationCountryOptionsSeStandardPlaceOfSupplyScheme { + pub fn as_str(self) -> &'static str { + use CreateTaxRegistrationCountryOptionsSeStandardPlaceOfSupplyScheme::*; + match self { + SmallSeller => "small_seller", + Standard => "standard", + } + } +} + +impl std::str::FromStr for CreateTaxRegistrationCountryOptionsSeStandardPlaceOfSupplyScheme { + type Err = (); + fn from_str(s: &str) -> Result { + use CreateTaxRegistrationCountryOptionsSeStandardPlaceOfSupplyScheme::*; + match s { + "small_seller" => Ok(SmallSeller), + "standard" => Ok(Standard), + _ => Err(()), + } + } +} +impl std::fmt::Display for CreateTaxRegistrationCountryOptionsSeStandardPlaceOfSupplyScheme { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreateTaxRegistrationCountryOptionsSeStandardPlaceOfSupplyScheme { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreateTaxRegistrationCountryOptionsSeStandardPlaceOfSupplyScheme { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Type of registration to be created in an EU country. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreateTaxRegistrationCountryOptionsSeType { + Ioss, + OssNonUnion, + OssUnion, + Standard, +} +impl CreateTaxRegistrationCountryOptionsSeType { + pub fn as_str(self) -> &'static str { + use CreateTaxRegistrationCountryOptionsSeType::*; + match self { + Ioss => "ioss", + OssNonUnion => "oss_non_union", + OssUnion => "oss_union", + Standard => "standard", + } + } +} + +impl std::str::FromStr for CreateTaxRegistrationCountryOptionsSeType { + type Err = (); + fn from_str(s: &str) -> Result { + use CreateTaxRegistrationCountryOptionsSeType::*; + match s { + "ioss" => Ok(Ioss), + "oss_non_union" => Ok(OssNonUnion), + "oss_union" => Ok(OssUnion), + "standard" => Ok(Standard), + _ => Err(()), + } + } +} +impl std::fmt::Display for CreateTaxRegistrationCountryOptionsSeType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreateTaxRegistrationCountryOptionsSeType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreateTaxRegistrationCountryOptionsSeType { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Options for the registration in SG. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreateTaxRegistrationCountryOptionsSg { + /// Type of registration to be created in `country`. + #[serde(rename = "type")] + pub type_: CreateTaxRegistrationCountryOptionsSgType, +} +impl CreateTaxRegistrationCountryOptionsSg { + pub fn new(type_: CreateTaxRegistrationCountryOptionsSgType) -> Self { + Self { type_ } + } +} +/// Type of registration to be created in `country`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreateTaxRegistrationCountryOptionsSgType { + Standard, +} +impl CreateTaxRegistrationCountryOptionsSgType { + pub fn as_str(self) -> &'static str { + use CreateTaxRegistrationCountryOptionsSgType::*; + match self { + Standard => "standard", + } + } +} + +impl std::str::FromStr for CreateTaxRegistrationCountryOptionsSgType { + type Err = (); + fn from_str(s: &str) -> Result { + use CreateTaxRegistrationCountryOptionsSgType::*; + match s { + "standard" => Ok(Standard), + _ => Err(()), + } + } +} +impl std::fmt::Display for CreateTaxRegistrationCountryOptionsSgType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreateTaxRegistrationCountryOptionsSgType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreateTaxRegistrationCountryOptionsSgType { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Options for the registration in SI. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreateTaxRegistrationCountryOptionsSi { + /// Options for the standard registration. + #[serde(skip_serializing_if = "Option::is_none")] + pub standard: Option, + /// Type of registration to be created in an EU country. + #[serde(rename = "type")] + pub type_: CreateTaxRegistrationCountryOptionsSiType, +} +impl CreateTaxRegistrationCountryOptionsSi { + pub fn new(type_: CreateTaxRegistrationCountryOptionsSiType) -> Self { + Self { standard: None, type_ } + } +} +/// Options for the standard registration. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreateTaxRegistrationCountryOptionsSiStandard { + /// Place of supply scheme used in an EU standard registration. + pub place_of_supply_scheme: CreateTaxRegistrationCountryOptionsSiStandardPlaceOfSupplyScheme, +} +impl CreateTaxRegistrationCountryOptionsSiStandard { + pub fn new( + place_of_supply_scheme: CreateTaxRegistrationCountryOptionsSiStandardPlaceOfSupplyScheme, + ) -> Self { + Self { place_of_supply_scheme } + } +} +/// Place of supply scheme used in an EU standard registration. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreateTaxRegistrationCountryOptionsSiStandardPlaceOfSupplyScheme { + SmallSeller, + Standard, +} +impl CreateTaxRegistrationCountryOptionsSiStandardPlaceOfSupplyScheme { + pub fn as_str(self) -> &'static str { + use CreateTaxRegistrationCountryOptionsSiStandardPlaceOfSupplyScheme::*; + match self { + SmallSeller => "small_seller", + Standard => "standard", + } + } +} + +impl std::str::FromStr for CreateTaxRegistrationCountryOptionsSiStandardPlaceOfSupplyScheme { + type Err = (); + fn from_str(s: &str) -> Result { + use CreateTaxRegistrationCountryOptionsSiStandardPlaceOfSupplyScheme::*; + match s { + "small_seller" => Ok(SmallSeller), + "standard" => Ok(Standard), + _ => Err(()), + } + } +} +impl std::fmt::Display for CreateTaxRegistrationCountryOptionsSiStandardPlaceOfSupplyScheme { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreateTaxRegistrationCountryOptionsSiStandardPlaceOfSupplyScheme { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreateTaxRegistrationCountryOptionsSiStandardPlaceOfSupplyScheme { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Type of registration to be created in an EU country. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreateTaxRegistrationCountryOptionsSiType { + Ioss, + OssNonUnion, + OssUnion, + Standard, +} +impl CreateTaxRegistrationCountryOptionsSiType { + pub fn as_str(self) -> &'static str { + use CreateTaxRegistrationCountryOptionsSiType::*; + match self { + Ioss => "ioss", + OssNonUnion => "oss_non_union", + OssUnion => "oss_union", + Standard => "standard", + } + } +} + +impl std::str::FromStr for CreateTaxRegistrationCountryOptionsSiType { + type Err = (); + fn from_str(s: &str) -> Result { + use CreateTaxRegistrationCountryOptionsSiType::*; + match s { + "ioss" => Ok(Ioss), + "oss_non_union" => Ok(OssNonUnion), + "oss_union" => Ok(OssUnion), + "standard" => Ok(Standard), + _ => Err(()), + } + } +} +impl std::fmt::Display for CreateTaxRegistrationCountryOptionsSiType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreateTaxRegistrationCountryOptionsSiType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreateTaxRegistrationCountryOptionsSiType { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Options for the registration in SK. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreateTaxRegistrationCountryOptionsSk { + /// Options for the standard registration. + #[serde(skip_serializing_if = "Option::is_none")] + pub standard: Option, + /// Type of registration to be created in an EU country. + #[serde(rename = "type")] + pub type_: CreateTaxRegistrationCountryOptionsSkType, +} +impl CreateTaxRegistrationCountryOptionsSk { + pub fn new(type_: CreateTaxRegistrationCountryOptionsSkType) -> Self { + Self { standard: None, type_ } + } +} +/// Options for the standard registration. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreateTaxRegistrationCountryOptionsSkStandard { + /// Place of supply scheme used in an EU standard registration. + pub place_of_supply_scheme: CreateTaxRegistrationCountryOptionsSkStandardPlaceOfSupplyScheme, +} +impl CreateTaxRegistrationCountryOptionsSkStandard { + pub fn new( + place_of_supply_scheme: CreateTaxRegistrationCountryOptionsSkStandardPlaceOfSupplyScheme, + ) -> Self { + Self { place_of_supply_scheme } + } +} +/// Place of supply scheme used in an EU standard registration. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreateTaxRegistrationCountryOptionsSkStandardPlaceOfSupplyScheme { + SmallSeller, + Standard, +} +impl CreateTaxRegistrationCountryOptionsSkStandardPlaceOfSupplyScheme { + pub fn as_str(self) -> &'static str { + use CreateTaxRegistrationCountryOptionsSkStandardPlaceOfSupplyScheme::*; + match self { + SmallSeller => "small_seller", + Standard => "standard", + } + } +} + +impl std::str::FromStr for CreateTaxRegistrationCountryOptionsSkStandardPlaceOfSupplyScheme { + type Err = (); + fn from_str(s: &str) -> Result { + use CreateTaxRegistrationCountryOptionsSkStandardPlaceOfSupplyScheme::*; + match s { + "small_seller" => Ok(SmallSeller), + "standard" => Ok(Standard), + _ => Err(()), + } + } +} +impl std::fmt::Display for CreateTaxRegistrationCountryOptionsSkStandardPlaceOfSupplyScheme { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreateTaxRegistrationCountryOptionsSkStandardPlaceOfSupplyScheme { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreateTaxRegistrationCountryOptionsSkStandardPlaceOfSupplyScheme { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Type of registration to be created in an EU country. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreateTaxRegistrationCountryOptionsSkType { + Ioss, + OssNonUnion, + OssUnion, + Standard, +} +impl CreateTaxRegistrationCountryOptionsSkType { + pub fn as_str(self) -> &'static str { + use CreateTaxRegistrationCountryOptionsSkType::*; + match self { + Ioss => "ioss", + OssNonUnion => "oss_non_union", + OssUnion => "oss_union", + Standard => "standard", + } + } +} + +impl std::str::FromStr for CreateTaxRegistrationCountryOptionsSkType { + type Err = (); + fn from_str(s: &str) -> Result { + use CreateTaxRegistrationCountryOptionsSkType::*; + match s { + "ioss" => Ok(Ioss), + "oss_non_union" => Ok(OssNonUnion), + "oss_union" => Ok(OssUnion), + "standard" => Ok(Standard), + _ => Err(()), + } + } +} +impl std::fmt::Display for CreateTaxRegistrationCountryOptionsSkType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreateTaxRegistrationCountryOptionsSkType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreateTaxRegistrationCountryOptionsSkType { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Options for the registration in TH. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreateTaxRegistrationCountryOptionsTh { + /// Type of registration to be created in `country`. + #[serde(rename = "type")] + pub type_: CreateTaxRegistrationCountryOptionsThType, +} +impl CreateTaxRegistrationCountryOptionsTh { + pub fn new(type_: CreateTaxRegistrationCountryOptionsThType) -> Self { + Self { type_ } + } +} +/// Type of registration to be created in `country`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreateTaxRegistrationCountryOptionsThType { + Simplified, +} +impl CreateTaxRegistrationCountryOptionsThType { + pub fn as_str(self) -> &'static str { + use CreateTaxRegistrationCountryOptionsThType::*; + match self { + Simplified => "simplified", + } + } +} + +impl std::str::FromStr for CreateTaxRegistrationCountryOptionsThType { + type Err = (); + fn from_str(s: &str) -> Result { + use CreateTaxRegistrationCountryOptionsThType::*; + match s { + "simplified" => Ok(Simplified), + _ => Err(()), + } + } +} +impl std::fmt::Display for CreateTaxRegistrationCountryOptionsThType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreateTaxRegistrationCountryOptionsThType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreateTaxRegistrationCountryOptionsThType { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Options for the registration in TR. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreateTaxRegistrationCountryOptionsTr { + /// Type of registration to be created in `country`. + #[serde(rename = "type")] + pub type_: CreateTaxRegistrationCountryOptionsTrType, +} +impl CreateTaxRegistrationCountryOptionsTr { + pub fn new(type_: CreateTaxRegistrationCountryOptionsTrType) -> Self { + Self { type_ } + } +} +/// Type of registration to be created in `country`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreateTaxRegistrationCountryOptionsTrType { + Simplified, +} +impl CreateTaxRegistrationCountryOptionsTrType { + pub fn as_str(self) -> &'static str { + use CreateTaxRegistrationCountryOptionsTrType::*; + match self { + Simplified => "simplified", + } + } +} + +impl std::str::FromStr for CreateTaxRegistrationCountryOptionsTrType { + type Err = (); + fn from_str(s: &str) -> Result { + use CreateTaxRegistrationCountryOptionsTrType::*; + match s { + "simplified" => Ok(Simplified), + _ => Err(()), + } + } +} +impl std::fmt::Display for CreateTaxRegistrationCountryOptionsTrType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreateTaxRegistrationCountryOptionsTrType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreateTaxRegistrationCountryOptionsTrType { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Options for the registration in US. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreateTaxRegistrationCountryOptionsUs<'a> { + /// Options for the local amusement tax registration. + #[serde(skip_serializing_if = "Option::is_none")] + pub local_amusement_tax: Option>, + /// Options for the local lease tax registration. + #[serde(skip_serializing_if = "Option::is_none")] + pub local_lease_tax: Option>, + /// Two-letter US state code ([ISO 3166-2](https://en.wikipedia.org/wiki/ISO_3166-2)). + pub state: &'a str, + /// Type of registration to be created in the US. + #[serde(rename = "type")] + pub type_: CreateTaxRegistrationCountryOptionsUsType, +} +impl<'a> CreateTaxRegistrationCountryOptionsUs<'a> { + pub fn new(state: &'a str, type_: CreateTaxRegistrationCountryOptionsUsType) -> Self { + Self { local_amusement_tax: None, local_lease_tax: None, state, type_ } + } +} +/// Options for the local amusement tax registration. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreateTaxRegistrationCountryOptionsUsLocalAmusementTax<'a> { + /// A [FIPS code](https://www.census.gov/library/reference/code-lists/ansi.html) representing the local jurisdiction. + /// Supported FIPS codes are: `14000` (Chicago), `06613` (Bloomington), `21696` (East Dundee), `24582` (Evanston), and `68081` (Schiller Park). + pub jurisdiction: &'a str, +} +impl<'a> CreateTaxRegistrationCountryOptionsUsLocalAmusementTax<'a> { + pub fn new(jurisdiction: &'a str) -> Self { + Self { jurisdiction } + } +} +/// Options for the local lease tax registration. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreateTaxRegistrationCountryOptionsUsLocalLeaseTax<'a> { + /// A [FIPS code](https://www.census.gov/library/reference/code-lists/ansi.html) representing the local jurisdiction. + /// Supported FIPS codes are: `14000` (Chicago). + pub jurisdiction: &'a str, +} +impl<'a> CreateTaxRegistrationCountryOptionsUsLocalLeaseTax<'a> { + pub fn new(jurisdiction: &'a str) -> Self { + Self { jurisdiction } + } +} +/// Type of registration to be created in the US. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreateTaxRegistrationCountryOptionsUsType { + LocalAmusementTax, + LocalLeaseTax, + StateCommunicationsTax, + StateSalesTax, +} +impl CreateTaxRegistrationCountryOptionsUsType { + pub fn as_str(self) -> &'static str { + use CreateTaxRegistrationCountryOptionsUsType::*; + match self { + LocalAmusementTax => "local_amusement_tax", + LocalLeaseTax => "local_lease_tax", + StateCommunicationsTax => "state_communications_tax", + StateSalesTax => "state_sales_tax", + } + } +} + +impl std::str::FromStr for CreateTaxRegistrationCountryOptionsUsType { + type Err = (); + fn from_str(s: &str) -> Result { + use CreateTaxRegistrationCountryOptionsUsType::*; + match s { + "local_amusement_tax" => Ok(LocalAmusementTax), + "local_lease_tax" => Ok(LocalLeaseTax), + "state_communications_tax" => Ok(StateCommunicationsTax), + "state_sales_tax" => Ok(StateSalesTax), + _ => Err(()), + } + } +} +impl std::fmt::Display for CreateTaxRegistrationCountryOptionsUsType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreateTaxRegistrationCountryOptionsUsType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreateTaxRegistrationCountryOptionsUsType { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Options for the registration in VN. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreateTaxRegistrationCountryOptionsVn { + /// Type of registration to be created in `country`. + #[serde(rename = "type")] + pub type_: CreateTaxRegistrationCountryOptionsVnType, +} +impl CreateTaxRegistrationCountryOptionsVn { + pub fn new(type_: CreateTaxRegistrationCountryOptionsVnType) -> Self { + Self { type_ } + } +} +/// Type of registration to be created in `country`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreateTaxRegistrationCountryOptionsVnType { + Simplified, +} +impl CreateTaxRegistrationCountryOptionsVnType { + pub fn as_str(self) -> &'static str { + use CreateTaxRegistrationCountryOptionsVnType::*; + match self { + Simplified => "simplified", + } + } +} + +impl std::str::FromStr for CreateTaxRegistrationCountryOptionsVnType { + type Err = (); + fn from_str(s: &str) -> Result { + use CreateTaxRegistrationCountryOptionsVnType::*; + match s { + "simplified" => Ok(Simplified), + _ => Err(()), + } + } +} +impl std::fmt::Display for CreateTaxRegistrationCountryOptionsVnType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreateTaxRegistrationCountryOptionsVnType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreateTaxRegistrationCountryOptionsVnType { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Options for the registration in ZA. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreateTaxRegistrationCountryOptionsZa { + /// Type of registration to be created in `country`. + #[serde(rename = "type")] + pub type_: CreateTaxRegistrationCountryOptionsZaType, +} +impl CreateTaxRegistrationCountryOptionsZa { + pub fn new(type_: CreateTaxRegistrationCountryOptionsZaType) -> Self { + Self { type_ } + } +} +/// Type of registration to be created in `country`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreateTaxRegistrationCountryOptionsZaType { + Standard, +} +impl CreateTaxRegistrationCountryOptionsZaType { + pub fn as_str(self) -> &'static str { + use CreateTaxRegistrationCountryOptionsZaType::*; + match self { + Standard => "standard", + } + } +} + +impl std::str::FromStr for CreateTaxRegistrationCountryOptionsZaType { + type Err = (); + fn from_str(s: &str) -> Result { + use CreateTaxRegistrationCountryOptionsZaType::*; + match s { + "standard" => Ok(Standard), + _ => Err(()), + } + } +} +impl std::fmt::Display for CreateTaxRegistrationCountryOptionsZaType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreateTaxRegistrationCountryOptionsZaType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreateTaxRegistrationCountryOptionsZaType { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'a> CreateTaxRegistration<'a> { + /// Creates a new Tax `Registration` object. + pub fn send(&self, client: &stripe::Client) -> stripe::Response { + client.send_form("/tax/registrations", self, http_types::Method::Post) + } +} +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdateTaxRegistration<'a> { + /// Time at which the registration becomes active. + /// It can be either `now` to indicate the current time, or a timestamp measured in seconds since the Unix epoch. + #[serde(skip_serializing_if = "Option::is_none")] + pub active_from: Option, + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, + /// If set, the registration stops being active at this time. + /// If not set, the registration will be active indefinitely. + /// It can be either `now` to indicate the current time, or a timestamp measured in seconds since the Unix epoch. + #[serde(skip_serializing_if = "Option::is_none")] + pub expires_at: Option, +} +impl<'a> UpdateTaxRegistration<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// Time at which the registration becomes active. +/// It can be either `now` to indicate the current time, or a timestamp measured in seconds since the Unix epoch. +#[derive(Copy, Clone, Debug, serde::Serialize)] +#[serde(untagged)] +pub enum UpdateTaxRegistrationActiveFrom { + Now, + Timestamp(stripe_types::Timestamp), +} +/// If set, the registration stops being active at this time. +/// If not set, the registration will be active indefinitely. +/// It can be either `now` to indicate the current time, or a timestamp measured in seconds since the Unix epoch. +#[derive(Copy, Clone, Debug, serde::Serialize)] +#[serde(untagged)] +pub enum UpdateTaxRegistrationExpiresAt { + Now, + Timestamp(stripe_types::Timestamp), +} +impl<'a> UpdateTaxRegistration<'a> { + /// Updates an existing Tax `Registration` object. + /// + /// A registration cannot be deleted after it has been created. + /// If you wish to end a registration you may do so by setting `expires_at`. + pub fn send( + &self, + client: &stripe::Client, + id: &stripe_misc::TaxRegistrationId, + ) -> stripe::Response { + client.send_form(&format!("/tax/registrations/{id}"), self, http_types::Method::Post) + } +} diff --git a/generated/stripe_misc/src/tax_registration/types.rs b/generated/stripe_misc/src/tax_registration/types.rs new file mode 100644 index 000000000..74cb67139 --- /dev/null +++ b/generated/stripe_misc/src/tax_registration/types.rs @@ -0,0 +1,92 @@ +/// A Tax `Registration` lets us know that your business is registered to collect tax on payments within a region, enabling you to [automatically collect tax](https://stripe.com/docs/tax). +/// +/// Stripe doesn't register on your behalf with the relevant authorities when you create a Tax `Registration` object. +/// For more information on how to register to collect tax, see [our guide](https://stripe.com/docs/tax/registering). +/// +/// Related guide: [Using the Registrations API](https://stripe.com/docs/tax/registrations-api) +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct TaxRegistration { + /// Time at which the registration becomes active. Measured in seconds since the Unix epoch. + pub active_from: stripe_types::Timestamp, + /// Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). + pub country: String, + pub country_options: stripe_misc::TaxProductRegistrationsResourceCountryOptions, + /// Time at which the object was created. Measured in seconds since the Unix epoch. + pub created: stripe_types::Timestamp, + /// If set, the registration stops being active at this time. + /// If not set, the registration will be active indefinitely. + /// Measured in seconds since the Unix epoch. + pub expires_at: Option, + /// Unique identifier for the object. + pub id: stripe_misc::TaxRegistrationId, + /// Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + pub livemode: bool, + /// The status of the registration. + /// This field is present for convenience and can be deduced from `active_from` and `expires_at`. + pub status: TaxRegistrationStatus, +} +/// The status of the registration. +/// This field is present for convenience and can be deduced from `active_from` and `expires_at`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum TaxRegistrationStatus { + Active, + Expired, + Scheduled, +} +impl TaxRegistrationStatus { + pub fn as_str(self) -> &'static str { + use TaxRegistrationStatus::*; + match self { + Active => "active", + Expired => "expired", + Scheduled => "scheduled", + } + } +} + +impl std::str::FromStr for TaxRegistrationStatus { + type Err = (); + fn from_str(s: &str) -> Result { + use TaxRegistrationStatus::*; + match s { + "active" => Ok(Active), + "expired" => Ok(Expired), + "scheduled" => Ok(Scheduled), + _ => Err(()), + } + } +} +impl std::fmt::Display for TaxRegistrationStatus { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for TaxRegistrationStatus { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for TaxRegistrationStatus { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for TaxRegistrationStatus { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s) + .map_err(|_| serde::de::Error::custom("Unknown value for TaxRegistrationStatus")) + } +} +impl stripe_types::Object for TaxRegistration { + type Id = stripe_misc::TaxRegistrationId; + fn id(&self) -> &Self::Id { + &self.id + } +} +stripe_types::def_id!(TaxRegistrationId); diff --git a/generated/stripe_misc/src/tax_settings/mod.rs b/generated/stripe_misc/src/tax_settings/mod.rs new file mode 100644 index 000000000..bf9875f8f --- /dev/null +++ b/generated/stripe_misc/src/tax_settings/mod.rs @@ -0,0 +1,5 @@ +#[cfg(feature = "tax_settings")] +mod requests; +pub(crate) mod types; +#[cfg(feature = "tax_settings")] +pub use requests::*; diff --git a/generated/stripe_misc/src/tax_settings/requests.rs b/generated/stripe_misc/src/tax_settings/requests.rs new file mode 100644 index 000000000..a92c564ba --- /dev/null +++ b/generated/stripe_misc/src/tax_settings/requests.rs @@ -0,0 +1,148 @@ +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct RetrieveForMyAccountTaxSettings<'a> { + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, +} +impl<'a> RetrieveForMyAccountTaxSettings<'a> { + pub fn new() -> Self { + Self::default() + } +} +impl<'a> RetrieveForMyAccountTaxSettings<'a> { + /// Retrieves Tax `Settings` for a merchant. + pub fn send(&self, client: &stripe::Client) -> stripe::Response { + client.get_query("/tax/settings", self) + } +} +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdateTaxSettings<'a> { + /// Default configuration to be used on Stripe Tax calculations. + #[serde(skip_serializing_if = "Option::is_none")] + pub defaults: Option>, + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, + /// The place where your business is located. + #[serde(skip_serializing_if = "Option::is_none")] + pub head_office: Option>, +} +impl<'a> UpdateTaxSettings<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// Default configuration to be used on Stripe Tax calculations. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdateTaxSettingsDefaults<'a> { + /// Specifies the default [tax behavior](https://stripe.com/docs/tax/products-prices-tax-categories-tax-behavior#tax-behavior) to be used when the item's price has unspecified tax behavior. + /// One of inclusive, exclusive, or inferred_by_currency. + /// Once specified, it cannot be changed back to null. + #[serde(skip_serializing_if = "Option::is_none")] + pub tax_behavior: Option, + /// A [tax code](https://stripe.com/docs/tax/tax-categories) ID. + #[serde(skip_serializing_if = "Option::is_none")] + pub tax_code: Option<&'a str>, +} +impl<'a> UpdateTaxSettingsDefaults<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// Specifies the default [tax behavior](https://stripe.com/docs/tax/products-prices-tax-categories-tax-behavior#tax-behavior) to be used when the item's price has unspecified tax behavior. +/// One of inclusive, exclusive, or inferred_by_currency. +/// Once specified, it cannot be changed back to null. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum UpdateTaxSettingsDefaultsTaxBehavior { + Exclusive, + Inclusive, + InferredByCurrency, +} +impl UpdateTaxSettingsDefaultsTaxBehavior { + pub fn as_str(self) -> &'static str { + use UpdateTaxSettingsDefaultsTaxBehavior::*; + match self { + Exclusive => "exclusive", + Inclusive => "inclusive", + InferredByCurrency => "inferred_by_currency", + } + } +} + +impl std::str::FromStr for UpdateTaxSettingsDefaultsTaxBehavior { + type Err = (); + fn from_str(s: &str) -> Result { + use UpdateTaxSettingsDefaultsTaxBehavior::*; + match s { + "exclusive" => Ok(Exclusive), + "inclusive" => Ok(Inclusive), + "inferred_by_currency" => Ok(InferredByCurrency), + _ => Err(()), + } + } +} +impl std::fmt::Display for UpdateTaxSettingsDefaultsTaxBehavior { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for UpdateTaxSettingsDefaultsTaxBehavior { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for UpdateTaxSettingsDefaultsTaxBehavior { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// The place where your business is located. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct UpdateTaxSettingsHeadOffice<'a> { + /// The location of the business for tax purposes. + pub address: UpdateTaxSettingsHeadOfficeAddress<'a>, +} +impl<'a> UpdateTaxSettingsHeadOffice<'a> { + pub fn new(address: UpdateTaxSettingsHeadOfficeAddress<'a>) -> Self { + Self { address } + } +} +/// The location of the business for tax purposes. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdateTaxSettingsHeadOfficeAddress<'a> { + /// City, district, suburb, town, or village. + #[serde(skip_serializing_if = "Option::is_none")] + pub city: Option<&'a str>, + /// Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). + #[serde(skip_serializing_if = "Option::is_none")] + pub country: Option<&'a str>, + /// Address line 1 (e.g., street, PO Box, or company name). + #[serde(skip_serializing_if = "Option::is_none")] + pub line1: Option<&'a str>, + /// Address line 2 (e.g., apartment, suite, unit, or building). + #[serde(skip_serializing_if = "Option::is_none")] + pub line2: Option<&'a str>, + /// ZIP or postal code. + #[serde(skip_serializing_if = "Option::is_none")] + pub postal_code: Option<&'a str>, + /// State/province as an [ISO 3166-2](https://en.wikipedia.org/wiki/ISO_3166-2) subdivision code, without country prefix. + /// Example: "NY" or "TX". + #[serde(skip_serializing_if = "Option::is_none")] + pub state: Option<&'a str>, +} +impl<'a> UpdateTaxSettingsHeadOfficeAddress<'a> { + pub fn new() -> Self { + Self::default() + } +} +impl<'a> UpdateTaxSettings<'a> { + /// Updates Tax `Settings` parameters used in tax calculations. + /// All parameters are editable but none can be removed once set. + pub fn send(&self, client: &stripe::Client) -> stripe::Response { + client.send_form("/tax/settings", self, http_types::Method::Post) + } +} diff --git a/generated/stripe_misc/src/tax_settings/types.rs b/generated/stripe_misc/src/tax_settings/types.rs new file mode 100644 index 000000000..66d271a9b --- /dev/null +++ b/generated/stripe_misc/src/tax_settings/types.rs @@ -0,0 +1,72 @@ +/// You can use Tax `Settings` to manage configurations used by Stripe Tax calculations. +/// +/// Related guide: [Using the Settings API](https://stripe.com/docs/tax/settings-api) +/// +/// For more details see <>. +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct TaxSettings { + pub defaults: stripe_misc::TaxProductResourceTaxSettingsDefaults, + /// The place where your business is located. + pub head_office: Option, + /// Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + pub livemode: bool, + /// The `active` status indicates you have all required settings to calculate tax. + /// A status can transition out of `active` when new required settings are introduced. + pub status: TaxSettingsStatus, + pub status_details: stripe_misc::TaxProductResourceTaxSettingsStatusDetails, +} +/// The `active` status indicates you have all required settings to calculate tax. +/// A status can transition out of `active` when new required settings are introduced. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum TaxSettingsStatus { + Active, + Pending, +} +impl TaxSettingsStatus { + pub fn as_str(self) -> &'static str { + use TaxSettingsStatus::*; + match self { + Active => "active", + Pending => "pending", + } + } +} + +impl std::str::FromStr for TaxSettingsStatus { + type Err = (); + fn from_str(s: &str) -> Result { + use TaxSettingsStatus::*; + match s { + "active" => Ok(Active), + "pending" => Ok(Pending), + _ => Err(()), + } + } +} +impl std::fmt::Display for TaxSettingsStatus { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for TaxSettingsStatus { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for TaxSettingsStatus { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for TaxSettingsStatus { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s) + .map_err(|_| serde::de::Error::custom("Unknown value for TaxSettingsStatus")) + } +} diff --git a/generated/stripe_misc/src/tax_transaction/mod.rs b/generated/stripe_misc/src/tax_transaction/mod.rs new file mode 100644 index 000000000..75885cc8a --- /dev/null +++ b/generated/stripe_misc/src/tax_transaction/mod.rs @@ -0,0 +1,5 @@ +#[cfg(feature = "tax_transaction")] +mod requests; +pub(crate) mod types; +#[cfg(feature = "tax_transaction")] +pub use requests::*; diff --git a/generated/stripe_misc/src/tax_transaction/requests.rs b/generated/stripe_misc/src/tax_transaction/requests.rs new file mode 100644 index 000000000..f53c5a9c6 --- /dev/null +++ b/generated/stripe_misc/src/tax_transaction/requests.rs @@ -0,0 +1,241 @@ +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct RetrieveTaxTransaction<'a> { + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, +} +impl<'a> RetrieveTaxTransaction<'a> { + pub fn new() -> Self { + Self::default() + } +} +impl<'a> RetrieveTaxTransaction<'a> { + /// Retrieves a Tax `Transaction` object. + pub fn send( + &self, + client: &stripe::Client, + transaction: &stripe_misc::TaxTransactionId, + ) -> stripe::Response { + client.get_query(&format!("/tax/transactions/{transaction}"), self) + } +} +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct ListLineItemsTaxTransaction<'a> { + /// A cursor for use in pagination. + /// `ending_before` is an object ID that defines your place in the list. + /// For instance, if you make a list request and receive 100 objects, starting with `obj_bar`, your subsequent call can include `ending_before=obj_bar` in order to fetch the previous page of the list. + #[serde(skip_serializing_if = "Option::is_none")] + pub ending_before: Option<&'a str>, + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, + /// A limit on the number of objects to be returned. + /// Limit can range between 1 and 100, and the default is 10. + #[serde(skip_serializing_if = "Option::is_none")] + pub limit: Option, + /// A cursor for use in pagination. + /// `starting_after` is an object ID that defines your place in the list. + /// For instance, if you make a list request and receive 100 objects, ending with `obj_foo`, your subsequent call can include `starting_after=obj_foo` in order to fetch the next page of the list. + #[serde(skip_serializing_if = "Option::is_none")] + pub starting_after: Option<&'a str>, +} +impl<'a> ListLineItemsTaxTransaction<'a> { + pub fn new() -> Self { + Self::default() + } +} +impl<'a> ListLineItemsTaxTransaction<'a> { + /// Retrieves the line items of a committed standalone transaction as a collection. + pub fn send( + &self, + client: &stripe::Client, + transaction: &stripe_misc::TaxTransactionId, + ) -> stripe::Response> { + client.get_query(&format!("/tax/transactions/{transaction}/line_items"), self) + } + pub fn paginate( + self, + transaction: &stripe_misc::TaxTransactionId, + ) -> stripe::ListPaginator> { + stripe::ListPaginator::from_list_params( + &format!("/tax/transactions/{transaction}/line_items"), + self, + ) + } +} +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreateFromCalculationTaxTransaction<'a> { + /// Tax Calculation ID to be used as input when creating the transaction. + pub calculation: &'a str, + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, + /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. + /// This can be useful for storing additional information about the object in a structured format. + /// Individual keys can be unset by posting an empty value to them. + /// All keys can be unset by posting an empty value to `metadata`. + #[serde(skip_serializing_if = "Option::is_none")] + pub metadata: Option<&'a std::collections::HashMap>, + /// A custom order or sale identifier, such as 'myOrder_123'. + /// Must be unique across all transactions, including reversals. + pub reference: &'a str, +} +impl<'a> CreateFromCalculationTaxTransaction<'a> { + pub fn new(calculation: &'a str, reference: &'a str) -> Self { + Self { calculation, expand: None, metadata: None, reference } + } +} +impl<'a> CreateFromCalculationTaxTransaction<'a> { + /// Creates a Tax `Transaction` from a calculation. + pub fn send(&self, client: &stripe::Client) -> stripe::Response { + client.send_form( + "/tax/transactions/create_from_calculation", + self, + http_types::Method::Post, + ) + } +} +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreateReversalTaxTransaction<'a> { + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, + /// A flat amount to reverse across the entire transaction, in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal) in negative. + /// This value represents the total amount to refund from the transaction, including taxes. + #[serde(skip_serializing_if = "Option::is_none")] + pub flat_amount: Option, + /// The line item amounts to reverse. + #[serde(skip_serializing_if = "Option::is_none")] + pub line_items: Option<&'a [CreateReversalTaxTransactionLineItems<'a>]>, + /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. + /// This can be useful for storing additional information about the object in a structured format. + /// Individual keys can be unset by posting an empty value to them. + /// All keys can be unset by posting an empty value to `metadata`. + #[serde(skip_serializing_if = "Option::is_none")] + pub metadata: Option<&'a std::collections::HashMap>, + /// If `partial`, the provided line item or shipping cost amounts are reversed. + /// If `full`, the original transaction is fully reversed. + pub mode: CreateReversalTaxTransactionMode, + /// The ID of the Transaction to partially or fully reverse. + pub original_transaction: &'a str, + /// A custom identifier for this reversal, such as `myOrder_123-refund_1`, which must be unique across all transactions. + /// The reference helps identify this reversal transaction in exported [tax reports](https://stripe.com/docs/tax/reports). + pub reference: &'a str, + /// The shipping cost to reverse. + #[serde(skip_serializing_if = "Option::is_none")] + pub shipping_cost: Option, +} +impl<'a> CreateReversalTaxTransaction<'a> { + pub fn new( + mode: CreateReversalTaxTransactionMode, + original_transaction: &'a str, + reference: &'a str, + ) -> Self { + Self { + expand: None, + flat_amount: None, + line_items: None, + metadata: None, + mode, + original_transaction, + reference, + shipping_cost: None, + } + } +} +/// The line item amounts to reverse. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreateReversalTaxTransactionLineItems<'a> { + /// The amount to reverse, in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal) in negative. + pub amount: i64, + /// The amount of tax to reverse, in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal) in negative. + pub amount_tax: i64, + /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. + /// This can be useful for storing additional information about the object in a structured format. + #[serde(skip_serializing_if = "Option::is_none")] + pub metadata: Option<&'a std::collections::HashMap>, + /// The `id` of the line item to reverse in the original transaction. + pub original_line_item: &'a str, + /// The quantity reversed. + /// Appears in [tax exports](https://stripe.com/docs/tax/reports), but does not affect the amount of tax reversed. + #[serde(skip_serializing_if = "Option::is_none")] + pub quantity: Option, + /// A custom identifier for this line item in the reversal transaction, such as 'L1-refund'. + pub reference: &'a str, +} +impl<'a> CreateReversalTaxTransactionLineItems<'a> { + pub fn new( + amount: i64, + amount_tax: i64, + original_line_item: &'a str, + reference: &'a str, + ) -> Self { + Self { amount, amount_tax, metadata: None, original_line_item, quantity: None, reference } + } +} +/// If `partial`, the provided line item or shipping cost amounts are reversed. +/// If `full`, the original transaction is fully reversed. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreateReversalTaxTransactionMode { + Full, + Partial, +} +impl CreateReversalTaxTransactionMode { + pub fn as_str(self) -> &'static str { + use CreateReversalTaxTransactionMode::*; + match self { + Full => "full", + Partial => "partial", + } + } +} + +impl std::str::FromStr for CreateReversalTaxTransactionMode { + type Err = (); + fn from_str(s: &str) -> Result { + use CreateReversalTaxTransactionMode::*; + match s { + "full" => Ok(Full), + "partial" => Ok(Partial), + _ => Err(()), + } + } +} +impl std::fmt::Display for CreateReversalTaxTransactionMode { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreateReversalTaxTransactionMode { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreateReversalTaxTransactionMode { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// The shipping cost to reverse. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreateReversalTaxTransactionShippingCost { + /// The amount to reverse, in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal) in negative. + pub amount: i64, + /// The amount of tax to reverse, in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal) in negative. + pub amount_tax: i64, +} +impl CreateReversalTaxTransactionShippingCost { + pub fn new(amount: i64, amount_tax: i64) -> Self { + Self { amount, amount_tax } + } +} +impl<'a> CreateReversalTaxTransaction<'a> { + /// Partially or fully reverses a previously created `Transaction`. + pub fn send(&self, client: &stripe::Client) -> stripe::Response { + client.send_form("/tax/transactions/create_reversal", self, http_types::Method::Post) + } +} diff --git a/generated/stripe_misc/src/tax_transaction/types.rs b/generated/stripe_misc/src/tax_transaction/types.rs new file mode 100644 index 000000000..dcabfd75e --- /dev/null +++ b/generated/stripe_misc/src/tax_transaction/types.rs @@ -0,0 +1,97 @@ +/// A Tax Transaction records the tax collected from or refunded to your customer. +/// +/// Related guide: [Calculate tax in your custom payment flow](https://stripe.com/docs/tax/custom#tax-transaction). +/// +/// For more details see <>. +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct TaxTransaction { + /// Time at which the object was created. Measured in seconds since the Unix epoch. + pub created: stripe_types::Timestamp, + /// Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. + /// Must be a [supported currency](https://stripe.com/docs/currencies). + pub currency: stripe_types::Currency, + /// The ID of an existing [Customer](https://stripe.com/docs/api/customers/object) used for the resource. + pub customer: Option, + pub customer_details: stripe_misc::TaxProductResourceCustomerDetails, + /// Unique identifier for the transaction. + pub id: stripe_misc::TaxTransactionId, + /// The tax collected or refunded, by line item. + pub line_items: Option>, + /// Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + pub livemode: bool, + /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. + /// This can be useful for storing additional information about the object in a structured format. + pub metadata: Option>, + /// A custom unique identifier, such as 'myOrder_123'. + pub reference: String, + /// If `type=reversal`, contains information about what was reversed. + pub reversal: Option, + /// The shipping cost details for the transaction. + pub shipping_cost: Option, + /// Timestamp of date at which the tax rules and rates in effect applies for the calculation. + pub tax_date: stripe_types::Timestamp, + /// If `reversal`, this transaction reverses an earlier transaction. + #[serde(rename = "type")] + pub type_: TaxTransactionType, +} +/// If `reversal`, this transaction reverses an earlier transaction. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum TaxTransactionType { + Reversal, + Transaction, +} +impl TaxTransactionType { + pub fn as_str(self) -> &'static str { + use TaxTransactionType::*; + match self { + Reversal => "reversal", + Transaction => "transaction", + } + } +} + +impl std::str::FromStr for TaxTransactionType { + type Err = (); + fn from_str(s: &str) -> Result { + use TaxTransactionType::*; + match s { + "reversal" => Ok(Reversal), + "transaction" => Ok(Transaction), + _ => Err(()), + } + } +} +impl std::fmt::Display for TaxTransactionType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for TaxTransactionType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for TaxTransactionType { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for TaxTransactionType { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s) + .map_err(|_| serde::de::Error::custom("Unknown value for TaxTransactionType")) + } +} +impl stripe_types::Object for TaxTransaction { + type Id = stripe_misc::TaxTransactionId; + fn id(&self) -> &Self::Id { + &self.id + } +} +stripe_types::def_id!(TaxTransactionId); diff --git a/generated/stripe_misc/src/tax_transaction_line_item.rs b/generated/stripe_misc/src/tax_transaction_line_item.rs new file mode 100644 index 000000000..06dd5f86f --- /dev/null +++ b/generated/stripe_misc/src/tax_transaction_line_item.rs @@ -0,0 +1,149 @@ +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct TaxTransactionLineItem { + /// The line item amount in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal). + /// If `tax_behavior=inclusive`, then this amount includes taxes. + /// Otherwise, taxes were calculated on top of this amount. + pub amount: i64, + /// The amount of tax calculated for this line item, in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal). + pub amount_tax: i64, + /// Unique identifier for the object. + pub id: stripe_misc::TaxTransactionLineItemId, + /// Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + pub livemode: bool, + /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. + /// This can be useful for storing additional information about the object in a structured format. + pub metadata: Option>, + /// The ID of an existing [Product](https://stripe.com/docs/api/products/object). + pub product: Option, + /// The number of units of the item being purchased. For reversals, this is the quantity reversed. + pub quantity: u64, + /// A custom identifier for this line item in the transaction. + pub reference: String, + /// If `type=reversal`, contains information about what was reversed. + pub reversal: Option, + /// Specifies whether the `amount` includes taxes. + /// If `tax_behavior=inclusive`, then the amount includes taxes. + pub tax_behavior: TaxTransactionLineItemTaxBehavior, + /// The [tax code](https://stripe.com/docs/tax/tax-categories) ID used for this resource. + pub tax_code: String, + /// If `reversal`, this line item reverses an earlier transaction. + #[serde(rename = "type")] + pub type_: TaxTransactionLineItemType, +} +/// Specifies whether the `amount` includes taxes. +/// If `tax_behavior=inclusive`, then the amount includes taxes. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum TaxTransactionLineItemTaxBehavior { + Exclusive, + Inclusive, +} +impl TaxTransactionLineItemTaxBehavior { + pub fn as_str(self) -> &'static str { + use TaxTransactionLineItemTaxBehavior::*; + match self { + Exclusive => "exclusive", + Inclusive => "inclusive", + } + } +} + +impl std::str::FromStr for TaxTransactionLineItemTaxBehavior { + type Err = (); + fn from_str(s: &str) -> Result { + use TaxTransactionLineItemTaxBehavior::*; + match s { + "exclusive" => Ok(Exclusive), + "inclusive" => Ok(Inclusive), + _ => Err(()), + } + } +} +impl std::fmt::Display for TaxTransactionLineItemTaxBehavior { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for TaxTransactionLineItemTaxBehavior { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for TaxTransactionLineItemTaxBehavior { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for TaxTransactionLineItemTaxBehavior { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| { + serde::de::Error::custom("Unknown value for TaxTransactionLineItemTaxBehavior") + }) + } +} +/// If `reversal`, this line item reverses an earlier transaction. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum TaxTransactionLineItemType { + Reversal, + Transaction, +} +impl TaxTransactionLineItemType { + pub fn as_str(self) -> &'static str { + use TaxTransactionLineItemType::*; + match self { + Reversal => "reversal", + Transaction => "transaction", + } + } +} + +impl std::str::FromStr for TaxTransactionLineItemType { + type Err = (); + fn from_str(s: &str) -> Result { + use TaxTransactionLineItemType::*; + match s { + "reversal" => Ok(Reversal), + "transaction" => Ok(Transaction), + _ => Err(()), + } + } +} +impl std::fmt::Display for TaxTransactionLineItemType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for TaxTransactionLineItemType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for TaxTransactionLineItemType { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for TaxTransactionLineItemType { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s) + .map_err(|_| serde::de::Error::custom("Unknown value for TaxTransactionLineItemType")) + } +} +impl stripe_types::Object for TaxTransactionLineItem { + type Id = stripe_misc::TaxTransactionLineItemId; + fn id(&self) -> &Self::Id { + &self.id + } +} +stripe_types::def_id!(TaxTransactionLineItemId); diff --git a/generated/stripe_misc/src/verification_session_redaction.rs b/generated/stripe_misc/src/verification_session_redaction.rs new file mode 100644 index 000000000..c0264d6c4 --- /dev/null +++ b/generated/stripe_misc/src/verification_session_redaction.rs @@ -0,0 +1,60 @@ +#[derive(Copy, Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct VerificationSessionRedaction { + /// Indicates whether this object and its related objects have been redacted or not. + pub status: VerificationSessionRedactionStatus, +} +/// Indicates whether this object and its related objects have been redacted or not. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum VerificationSessionRedactionStatus { + Processing, + Redacted, +} +impl VerificationSessionRedactionStatus { + pub fn as_str(self) -> &'static str { + use VerificationSessionRedactionStatus::*; + match self { + Processing => "processing", + Redacted => "redacted", + } + } +} + +impl std::str::FromStr for VerificationSessionRedactionStatus { + type Err = (); + fn from_str(s: &str) -> Result { + use VerificationSessionRedactionStatus::*; + match s { + "processing" => Ok(Processing), + "redacted" => Ok(Redacted), + _ => Err(()), + } + } +} +impl std::fmt::Display for VerificationSessionRedactionStatus { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for VerificationSessionRedactionStatus { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for VerificationSessionRedactionStatus { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for VerificationSessionRedactionStatus { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| { + serde::de::Error::custom("Unknown value for VerificationSessionRedactionStatus") + }) + } +} diff --git a/generated/stripe_misc/src/webhook_endpoint/mod.rs b/generated/stripe_misc/src/webhook_endpoint/mod.rs new file mode 100644 index 000000000..78c563009 --- /dev/null +++ b/generated/stripe_misc/src/webhook_endpoint/mod.rs @@ -0,0 +1,5 @@ +#[cfg(feature = "webhook_endpoint")] +mod requests; +pub(crate) mod types; +#[cfg(feature = "webhook_endpoint")] +pub use requests::*; diff --git a/generated/stripe_misc/src/webhook_endpoint/requests.rs b/generated/stripe_misc/src/webhook_endpoint/requests.rs new file mode 100644 index 000000000..f02bee507 --- /dev/null +++ b/generated/stripe_misc/src/webhook_endpoint/requests.rs @@ -0,0 +1,1709 @@ +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct DeleteWebhookEndpoint {} +impl DeleteWebhookEndpoint { + pub fn new() -> Self { + Self::default() + } +} +impl DeleteWebhookEndpoint { + /// You can also delete webhook endpoints via the [webhook endpoint management](https://dashboard.stripe.com/account/webhooks) page of the Stripe dashboard. + pub fn send( + &self, + client: &stripe::Client, + webhook_endpoint: &stripe_misc::WebhookEndpointId, + ) -> stripe::Response { + client.send_form( + &format!("/webhook_endpoints/{webhook_endpoint}"), + self, + http_types::Method::Delete, + ) + } +} +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct ListWebhookEndpoint<'a> { + /// A cursor for use in pagination. + /// `ending_before` is an object ID that defines your place in the list. + /// For instance, if you make a list request and receive 100 objects, starting with `obj_bar`, your subsequent call can include `ending_before=obj_bar` in order to fetch the previous page of the list. + #[serde(skip_serializing_if = "Option::is_none")] + pub ending_before: Option<&'a str>, + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, + /// A limit on the number of objects to be returned. + /// Limit can range between 1 and 100, and the default is 10. + #[serde(skip_serializing_if = "Option::is_none")] + pub limit: Option, + /// A cursor for use in pagination. + /// `starting_after` is an object ID that defines your place in the list. + /// For instance, if you make a list request and receive 100 objects, ending with `obj_foo`, your subsequent call can include `starting_after=obj_foo` in order to fetch the next page of the list. + #[serde(skip_serializing_if = "Option::is_none")] + pub starting_after: Option<&'a str>, +} +impl<'a> ListWebhookEndpoint<'a> { + pub fn new() -> Self { + Self::default() + } +} +impl<'a> ListWebhookEndpoint<'a> { + /// Returns a list of your webhook endpoints. + pub fn send( + &self, + client: &stripe::Client, + ) -> stripe::Response> { + client.get_query("/webhook_endpoints", self) + } + pub fn paginate( + self, + ) -> stripe::ListPaginator> { + stripe::ListPaginator::from_list_params("/webhook_endpoints", self) + } +} +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct RetrieveWebhookEndpoint<'a> { + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, +} +impl<'a> RetrieveWebhookEndpoint<'a> { + pub fn new() -> Self { + Self::default() + } +} +impl<'a> RetrieveWebhookEndpoint<'a> { + /// Retrieves the webhook endpoint with the given ID. + pub fn send( + &self, + client: &stripe::Client, + webhook_endpoint: &stripe_misc::WebhookEndpointId, + ) -> stripe::Response { + client.get_query(&format!("/webhook_endpoints/{webhook_endpoint}"), self) + } +} +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreateWebhookEndpoint<'a> { + /// Events sent to this endpoint will be generated with this Stripe Version instead of your account's default Stripe Version. + #[serde(skip_serializing_if = "Option::is_none")] + pub api_version: Option, + /// Whether this endpoint should receive events from connected accounts (`true`), or from your account (`false`). + /// Defaults to `false`. + #[serde(skip_serializing_if = "Option::is_none")] + pub connect: Option, + /// An optional description of what the webhook is used for. + #[serde(skip_serializing_if = "Option::is_none")] + pub description: Option<&'a str>, + /// The list of events to enable for this endpoint. + /// You may specify `['*']` to enable all events, except those that require explicit selection. + pub enabled_events: &'a [CreateWebhookEndpointEnabledEvents], + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, + /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. + /// This can be useful for storing additional information about the object in a structured format. + /// Individual keys can be unset by posting an empty value to them. + /// All keys can be unset by posting an empty value to `metadata`. + #[serde(skip_serializing_if = "Option::is_none")] + pub metadata: Option<&'a std::collections::HashMap>, + /// The URL of the webhook endpoint. + pub url: &'a str, +} +impl<'a> CreateWebhookEndpoint<'a> { + pub fn new(enabled_events: &'a [CreateWebhookEndpointEnabledEvents], url: &'a str) -> Self { + Self { + api_version: None, + connect: None, + description: None, + enabled_events, + expand: None, + metadata: None, + url, + } + } +} +/// The list of events to enable for this endpoint. +/// You may specify `['*']` to enable all events, except those that require explicit selection. +#[derive(Copy, Clone, Eq, PartialEq)] +#[non_exhaustive] +pub enum CreateWebhookEndpointEnabledEvents { + All, + AccountApplicationAuthorized, + AccountApplicationDeauthorized, + AccountExternalAccountCreated, + AccountExternalAccountDeleted, + AccountExternalAccountUpdated, + AccountUpdated, + ApplicationFeeCreated, + ApplicationFeeRefundUpdated, + ApplicationFeeRefunded, + BalanceAvailable, + BillingPortalConfigurationCreated, + BillingPortalConfigurationUpdated, + BillingPortalSessionCreated, + CapabilityUpdated, + CashBalanceFundsAvailable, + ChargeCaptured, + ChargeDisputeClosed, + ChargeDisputeCreated, + ChargeDisputeFundsReinstated, + ChargeDisputeFundsWithdrawn, + ChargeDisputeUpdated, + ChargeExpired, + ChargeFailed, + ChargePending, + ChargeRefundUpdated, + ChargeRefunded, + ChargeSucceeded, + ChargeUpdated, + CheckoutSessionAsyncPaymentFailed, + CheckoutSessionAsyncPaymentSucceeded, + CheckoutSessionCompleted, + CheckoutSessionExpired, + ClimateOrderCanceled, + ClimateOrderCreated, + ClimateOrderDelayed, + ClimateOrderDelivered, + ClimateOrderProductSubstituted, + ClimateProductCreated, + ClimateProductPricingUpdated, + CouponCreated, + CouponDeleted, + CouponUpdated, + CreditNoteCreated, + CreditNoteUpdated, + CreditNoteVoided, + CustomerCreated, + CustomerDeleted, + CustomerDiscountCreated, + CustomerDiscountDeleted, + CustomerDiscountUpdated, + CustomerSourceCreated, + CustomerSourceDeleted, + CustomerSourceExpiring, + CustomerSourceUpdated, + CustomerSubscriptionCreated, + CustomerSubscriptionDeleted, + CustomerSubscriptionPaused, + CustomerSubscriptionPendingUpdateApplied, + CustomerSubscriptionPendingUpdateExpired, + CustomerSubscriptionResumed, + CustomerSubscriptionTrialWillEnd, + CustomerSubscriptionUpdated, + CustomerTaxIdCreated, + CustomerTaxIdDeleted, + CustomerTaxIdUpdated, + CustomerUpdated, + CustomerCashBalanceTransactionCreated, + FileCreated, + FinancialConnectionsAccountCreated, + FinancialConnectionsAccountDeactivated, + FinancialConnectionsAccountDisconnected, + FinancialConnectionsAccountReactivated, + FinancialConnectionsAccountRefreshedBalance, + FinancialConnectionsAccountRefreshedTransactions, + IdentityVerificationSessionCanceled, + IdentityVerificationSessionCreated, + IdentityVerificationSessionProcessing, + IdentityVerificationSessionRedacted, + IdentityVerificationSessionRequiresInput, + IdentityVerificationSessionVerified, + InvoiceCreated, + InvoiceDeleted, + InvoiceFinalizationFailed, + InvoiceFinalized, + InvoiceMarkedUncollectible, + InvoicePaid, + InvoicePaymentActionRequired, + InvoicePaymentFailed, + InvoicePaymentSucceeded, + InvoiceSent, + InvoiceUpcoming, + InvoiceUpdated, + InvoiceVoided, + InvoiceitemCreated, + InvoiceitemDeleted, + IssuingAuthorizationCreated, + IssuingAuthorizationRequest, + IssuingAuthorizationUpdated, + IssuingCardCreated, + IssuingCardUpdated, + IssuingCardholderCreated, + IssuingCardholderUpdated, + IssuingDisputeClosed, + IssuingDisputeCreated, + IssuingDisputeFundsReinstated, + IssuingDisputeSubmitted, + IssuingDisputeUpdated, + IssuingTokenCreated, + IssuingTokenUpdated, + IssuingTransactionCreated, + IssuingTransactionUpdated, + MandateUpdated, + PaymentIntentAmountCapturableUpdated, + PaymentIntentCanceled, + PaymentIntentCreated, + PaymentIntentPartiallyFunded, + PaymentIntentPaymentFailed, + PaymentIntentProcessing, + PaymentIntentRequiresAction, + PaymentIntentSucceeded, + PaymentLinkCreated, + PaymentLinkUpdated, + PaymentMethodAttached, + PaymentMethodAutomaticallyUpdated, + PaymentMethodDetached, + PaymentMethodUpdated, + PayoutCanceled, + PayoutCreated, + PayoutFailed, + PayoutPaid, + PayoutReconciliationCompleted, + PayoutUpdated, + PersonCreated, + PersonDeleted, + PersonUpdated, + PlanCreated, + PlanDeleted, + PlanUpdated, + PriceCreated, + PriceDeleted, + PriceUpdated, + ProductCreated, + ProductDeleted, + ProductUpdated, + PromotionCodeCreated, + PromotionCodeUpdated, + QuoteAccepted, + QuoteCanceled, + QuoteCreated, + QuoteFinalized, + RadarEarlyFraudWarningCreated, + RadarEarlyFraudWarningUpdated, + RefundCreated, + RefundUpdated, + ReportingReportRunFailed, + ReportingReportRunSucceeded, + ReportingReportTypeUpdated, + ReviewClosed, + ReviewOpened, + SetupIntentCanceled, + SetupIntentCreated, + SetupIntentRequiresAction, + SetupIntentSetupFailed, + SetupIntentSucceeded, + SigmaScheduledQueryRunCreated, + SourceCanceled, + SourceChargeable, + SourceFailed, + SourceMandateNotification, + SourceRefundAttributesRequired, + SourceTransactionCreated, + SourceTransactionUpdated, + SubscriptionScheduleAborted, + SubscriptionScheduleCanceled, + SubscriptionScheduleCompleted, + SubscriptionScheduleCreated, + SubscriptionScheduleExpiring, + SubscriptionScheduleReleased, + SubscriptionScheduleUpdated, + TaxSettingsUpdated, + TaxRateCreated, + TaxRateUpdated, + TerminalReaderActionFailed, + TerminalReaderActionSucceeded, + TestHelpersTestClockAdvancing, + TestHelpersTestClockCreated, + TestHelpersTestClockDeleted, + TestHelpersTestClockInternalFailure, + TestHelpersTestClockReady, + TopupCanceled, + TopupCreated, + TopupFailed, + TopupReversed, + TopupSucceeded, + TransferCreated, + TransferReversed, + TransferUpdated, + TreasuryCreditReversalCreated, + TreasuryCreditReversalPosted, + TreasuryDebitReversalCompleted, + TreasuryDebitReversalCreated, + TreasuryDebitReversalInitialCreditGranted, + TreasuryFinancialAccountClosed, + TreasuryFinancialAccountCreated, + TreasuryFinancialAccountFeaturesStatusUpdated, + TreasuryInboundTransferCanceled, + TreasuryInboundTransferCreated, + TreasuryInboundTransferFailed, + TreasuryInboundTransferSucceeded, + TreasuryOutboundPaymentCanceled, + TreasuryOutboundPaymentCreated, + TreasuryOutboundPaymentExpectedArrivalDateUpdated, + TreasuryOutboundPaymentFailed, + TreasuryOutboundPaymentPosted, + TreasuryOutboundPaymentReturned, + TreasuryOutboundTransferCanceled, + TreasuryOutboundTransferCreated, + TreasuryOutboundTransferExpectedArrivalDateUpdated, + TreasuryOutboundTransferFailed, + TreasuryOutboundTransferPosted, + TreasuryOutboundTransferReturned, + TreasuryReceivedCreditCreated, + TreasuryReceivedCreditFailed, + TreasuryReceivedCreditSucceeded, + TreasuryReceivedDebitCreated, + /// An unrecognized value from Stripe. Should not be used as a request parameter. + Unknown, +} +impl CreateWebhookEndpointEnabledEvents { + pub fn as_str(self) -> &'static str { + use CreateWebhookEndpointEnabledEvents::*; + match self { + All => "*", + AccountApplicationAuthorized => "account.application.authorized", + AccountApplicationDeauthorized => "account.application.deauthorized", + AccountExternalAccountCreated => "account.external_account.created", + AccountExternalAccountDeleted => "account.external_account.deleted", + AccountExternalAccountUpdated => "account.external_account.updated", + AccountUpdated => "account.updated", + ApplicationFeeCreated => "application_fee.created", + ApplicationFeeRefundUpdated => "application_fee.refund.updated", + ApplicationFeeRefunded => "application_fee.refunded", + BalanceAvailable => "balance.available", + BillingPortalConfigurationCreated => "billing_portal.configuration.created", + BillingPortalConfigurationUpdated => "billing_portal.configuration.updated", + BillingPortalSessionCreated => "billing_portal.session.created", + CapabilityUpdated => "capability.updated", + CashBalanceFundsAvailable => "cash_balance.funds_available", + ChargeCaptured => "charge.captured", + ChargeDisputeClosed => "charge.dispute.closed", + ChargeDisputeCreated => "charge.dispute.created", + ChargeDisputeFundsReinstated => "charge.dispute.funds_reinstated", + ChargeDisputeFundsWithdrawn => "charge.dispute.funds_withdrawn", + ChargeDisputeUpdated => "charge.dispute.updated", + ChargeExpired => "charge.expired", + ChargeFailed => "charge.failed", + ChargePending => "charge.pending", + ChargeRefundUpdated => "charge.refund.updated", + ChargeRefunded => "charge.refunded", + ChargeSucceeded => "charge.succeeded", + ChargeUpdated => "charge.updated", + CheckoutSessionAsyncPaymentFailed => "checkout.session.async_payment_failed", + CheckoutSessionAsyncPaymentSucceeded => "checkout.session.async_payment_succeeded", + CheckoutSessionCompleted => "checkout.session.completed", + CheckoutSessionExpired => "checkout.session.expired", + ClimateOrderCanceled => "climate.order.canceled", + ClimateOrderCreated => "climate.order.created", + ClimateOrderDelayed => "climate.order.delayed", + ClimateOrderDelivered => "climate.order.delivered", + ClimateOrderProductSubstituted => "climate.order.product_substituted", + ClimateProductCreated => "climate.product.created", + ClimateProductPricingUpdated => "climate.product.pricing_updated", + CouponCreated => "coupon.created", + CouponDeleted => "coupon.deleted", + CouponUpdated => "coupon.updated", + CreditNoteCreated => "credit_note.created", + CreditNoteUpdated => "credit_note.updated", + CreditNoteVoided => "credit_note.voided", + CustomerCreated => "customer.created", + CustomerDeleted => "customer.deleted", + CustomerDiscountCreated => "customer.discount.created", + CustomerDiscountDeleted => "customer.discount.deleted", + CustomerDiscountUpdated => "customer.discount.updated", + CustomerSourceCreated => "customer.source.created", + CustomerSourceDeleted => "customer.source.deleted", + CustomerSourceExpiring => "customer.source.expiring", + CustomerSourceUpdated => "customer.source.updated", + CustomerSubscriptionCreated => "customer.subscription.created", + CustomerSubscriptionDeleted => "customer.subscription.deleted", + CustomerSubscriptionPaused => "customer.subscription.paused", + CustomerSubscriptionPendingUpdateApplied => { + "customer.subscription.pending_update_applied" + } + CustomerSubscriptionPendingUpdateExpired => { + "customer.subscription.pending_update_expired" + } + CustomerSubscriptionResumed => "customer.subscription.resumed", + CustomerSubscriptionTrialWillEnd => "customer.subscription.trial_will_end", + CustomerSubscriptionUpdated => "customer.subscription.updated", + CustomerTaxIdCreated => "customer.tax_id.created", + CustomerTaxIdDeleted => "customer.tax_id.deleted", + CustomerTaxIdUpdated => "customer.tax_id.updated", + CustomerUpdated => "customer.updated", + CustomerCashBalanceTransactionCreated => "customer_cash_balance_transaction.created", + FileCreated => "file.created", + FinancialConnectionsAccountCreated => "financial_connections.account.created", + FinancialConnectionsAccountDeactivated => "financial_connections.account.deactivated", + FinancialConnectionsAccountDisconnected => "financial_connections.account.disconnected", + FinancialConnectionsAccountReactivated => "financial_connections.account.reactivated", + FinancialConnectionsAccountRefreshedBalance => { + "financial_connections.account.refreshed_balance" + } + FinancialConnectionsAccountRefreshedTransactions => { + "financial_connections.account.refreshed_transactions" + } + IdentityVerificationSessionCanceled => "identity.verification_session.canceled", + IdentityVerificationSessionCreated => "identity.verification_session.created", + IdentityVerificationSessionProcessing => "identity.verification_session.processing", + IdentityVerificationSessionRedacted => "identity.verification_session.redacted", + IdentityVerificationSessionRequiresInput => { + "identity.verification_session.requires_input" + } + IdentityVerificationSessionVerified => "identity.verification_session.verified", + InvoiceCreated => "invoice.created", + InvoiceDeleted => "invoice.deleted", + InvoiceFinalizationFailed => "invoice.finalization_failed", + InvoiceFinalized => "invoice.finalized", + InvoiceMarkedUncollectible => "invoice.marked_uncollectible", + InvoicePaid => "invoice.paid", + InvoicePaymentActionRequired => "invoice.payment_action_required", + InvoicePaymentFailed => "invoice.payment_failed", + InvoicePaymentSucceeded => "invoice.payment_succeeded", + InvoiceSent => "invoice.sent", + InvoiceUpcoming => "invoice.upcoming", + InvoiceUpdated => "invoice.updated", + InvoiceVoided => "invoice.voided", + InvoiceitemCreated => "invoiceitem.created", + InvoiceitemDeleted => "invoiceitem.deleted", + IssuingAuthorizationCreated => "issuing_authorization.created", + IssuingAuthorizationRequest => "issuing_authorization.request", + IssuingAuthorizationUpdated => "issuing_authorization.updated", + IssuingCardCreated => "issuing_card.created", + IssuingCardUpdated => "issuing_card.updated", + IssuingCardholderCreated => "issuing_cardholder.created", + IssuingCardholderUpdated => "issuing_cardholder.updated", + IssuingDisputeClosed => "issuing_dispute.closed", + IssuingDisputeCreated => "issuing_dispute.created", + IssuingDisputeFundsReinstated => "issuing_dispute.funds_reinstated", + IssuingDisputeSubmitted => "issuing_dispute.submitted", + IssuingDisputeUpdated => "issuing_dispute.updated", + IssuingTokenCreated => "issuing_token.created", + IssuingTokenUpdated => "issuing_token.updated", + IssuingTransactionCreated => "issuing_transaction.created", + IssuingTransactionUpdated => "issuing_transaction.updated", + MandateUpdated => "mandate.updated", + PaymentIntentAmountCapturableUpdated => "payment_intent.amount_capturable_updated", + PaymentIntentCanceled => "payment_intent.canceled", + PaymentIntentCreated => "payment_intent.created", + PaymentIntentPartiallyFunded => "payment_intent.partially_funded", + PaymentIntentPaymentFailed => "payment_intent.payment_failed", + PaymentIntentProcessing => "payment_intent.processing", + PaymentIntentRequiresAction => "payment_intent.requires_action", + PaymentIntentSucceeded => "payment_intent.succeeded", + PaymentLinkCreated => "payment_link.created", + PaymentLinkUpdated => "payment_link.updated", + PaymentMethodAttached => "payment_method.attached", + PaymentMethodAutomaticallyUpdated => "payment_method.automatically_updated", + PaymentMethodDetached => "payment_method.detached", + PaymentMethodUpdated => "payment_method.updated", + PayoutCanceled => "payout.canceled", + PayoutCreated => "payout.created", + PayoutFailed => "payout.failed", + PayoutPaid => "payout.paid", + PayoutReconciliationCompleted => "payout.reconciliation_completed", + PayoutUpdated => "payout.updated", + PersonCreated => "person.created", + PersonDeleted => "person.deleted", + PersonUpdated => "person.updated", + PlanCreated => "plan.created", + PlanDeleted => "plan.deleted", + PlanUpdated => "plan.updated", + PriceCreated => "price.created", + PriceDeleted => "price.deleted", + PriceUpdated => "price.updated", + ProductCreated => "product.created", + ProductDeleted => "product.deleted", + ProductUpdated => "product.updated", + PromotionCodeCreated => "promotion_code.created", + PromotionCodeUpdated => "promotion_code.updated", + QuoteAccepted => "quote.accepted", + QuoteCanceled => "quote.canceled", + QuoteCreated => "quote.created", + QuoteFinalized => "quote.finalized", + RadarEarlyFraudWarningCreated => "radar.early_fraud_warning.created", + RadarEarlyFraudWarningUpdated => "radar.early_fraud_warning.updated", + RefundCreated => "refund.created", + RefundUpdated => "refund.updated", + ReportingReportRunFailed => "reporting.report_run.failed", + ReportingReportRunSucceeded => "reporting.report_run.succeeded", + ReportingReportTypeUpdated => "reporting.report_type.updated", + ReviewClosed => "review.closed", + ReviewOpened => "review.opened", + SetupIntentCanceled => "setup_intent.canceled", + SetupIntentCreated => "setup_intent.created", + SetupIntentRequiresAction => "setup_intent.requires_action", + SetupIntentSetupFailed => "setup_intent.setup_failed", + SetupIntentSucceeded => "setup_intent.succeeded", + SigmaScheduledQueryRunCreated => "sigma.scheduled_query_run.created", + SourceCanceled => "source.canceled", + SourceChargeable => "source.chargeable", + SourceFailed => "source.failed", + SourceMandateNotification => "source.mandate_notification", + SourceRefundAttributesRequired => "source.refund_attributes_required", + SourceTransactionCreated => "source.transaction.created", + SourceTransactionUpdated => "source.transaction.updated", + SubscriptionScheduleAborted => "subscription_schedule.aborted", + SubscriptionScheduleCanceled => "subscription_schedule.canceled", + SubscriptionScheduleCompleted => "subscription_schedule.completed", + SubscriptionScheduleCreated => "subscription_schedule.created", + SubscriptionScheduleExpiring => "subscription_schedule.expiring", + SubscriptionScheduleReleased => "subscription_schedule.released", + SubscriptionScheduleUpdated => "subscription_schedule.updated", + TaxSettingsUpdated => "tax.settings.updated", + TaxRateCreated => "tax_rate.created", + TaxRateUpdated => "tax_rate.updated", + TerminalReaderActionFailed => "terminal.reader.action_failed", + TerminalReaderActionSucceeded => "terminal.reader.action_succeeded", + TestHelpersTestClockAdvancing => "test_helpers.test_clock.advancing", + TestHelpersTestClockCreated => "test_helpers.test_clock.created", + TestHelpersTestClockDeleted => "test_helpers.test_clock.deleted", + TestHelpersTestClockInternalFailure => "test_helpers.test_clock.internal_failure", + TestHelpersTestClockReady => "test_helpers.test_clock.ready", + TopupCanceled => "topup.canceled", + TopupCreated => "topup.created", + TopupFailed => "topup.failed", + TopupReversed => "topup.reversed", + TopupSucceeded => "topup.succeeded", + TransferCreated => "transfer.created", + TransferReversed => "transfer.reversed", + TransferUpdated => "transfer.updated", + TreasuryCreditReversalCreated => "treasury.credit_reversal.created", + TreasuryCreditReversalPosted => "treasury.credit_reversal.posted", + TreasuryDebitReversalCompleted => "treasury.debit_reversal.completed", + TreasuryDebitReversalCreated => "treasury.debit_reversal.created", + TreasuryDebitReversalInitialCreditGranted => { + "treasury.debit_reversal.initial_credit_granted" + } + TreasuryFinancialAccountClosed => "treasury.financial_account.closed", + TreasuryFinancialAccountCreated => "treasury.financial_account.created", + TreasuryFinancialAccountFeaturesStatusUpdated => { + "treasury.financial_account.features_status_updated" + } + TreasuryInboundTransferCanceled => "treasury.inbound_transfer.canceled", + TreasuryInboundTransferCreated => "treasury.inbound_transfer.created", + TreasuryInboundTransferFailed => "treasury.inbound_transfer.failed", + TreasuryInboundTransferSucceeded => "treasury.inbound_transfer.succeeded", + TreasuryOutboundPaymentCanceled => "treasury.outbound_payment.canceled", + TreasuryOutboundPaymentCreated => "treasury.outbound_payment.created", + TreasuryOutboundPaymentExpectedArrivalDateUpdated => { + "treasury.outbound_payment.expected_arrival_date_updated" + } + TreasuryOutboundPaymentFailed => "treasury.outbound_payment.failed", + TreasuryOutboundPaymentPosted => "treasury.outbound_payment.posted", + TreasuryOutboundPaymentReturned => "treasury.outbound_payment.returned", + TreasuryOutboundTransferCanceled => "treasury.outbound_transfer.canceled", + TreasuryOutboundTransferCreated => "treasury.outbound_transfer.created", + TreasuryOutboundTransferExpectedArrivalDateUpdated => { + "treasury.outbound_transfer.expected_arrival_date_updated" + } + TreasuryOutboundTransferFailed => "treasury.outbound_transfer.failed", + TreasuryOutboundTransferPosted => "treasury.outbound_transfer.posted", + TreasuryOutboundTransferReturned => "treasury.outbound_transfer.returned", + TreasuryReceivedCreditCreated => "treasury.received_credit.created", + TreasuryReceivedCreditFailed => "treasury.received_credit.failed", + TreasuryReceivedCreditSucceeded => "treasury.received_credit.succeeded", + TreasuryReceivedDebitCreated => "treasury.received_debit.created", + Unknown => "unknown", + } + } +} + +impl std::str::FromStr for CreateWebhookEndpointEnabledEvents { + type Err = (); + fn from_str(s: &str) -> Result { + use CreateWebhookEndpointEnabledEvents::*; + match s { + "*" => Ok(All), + "account.application.authorized" => Ok(AccountApplicationAuthorized), + "account.application.deauthorized" => Ok(AccountApplicationDeauthorized), + "account.external_account.created" => Ok(AccountExternalAccountCreated), + "account.external_account.deleted" => Ok(AccountExternalAccountDeleted), + "account.external_account.updated" => Ok(AccountExternalAccountUpdated), + "account.updated" => Ok(AccountUpdated), + "application_fee.created" => Ok(ApplicationFeeCreated), + "application_fee.refund.updated" => Ok(ApplicationFeeRefundUpdated), + "application_fee.refunded" => Ok(ApplicationFeeRefunded), + "balance.available" => Ok(BalanceAvailable), + "billing_portal.configuration.created" => Ok(BillingPortalConfigurationCreated), + "billing_portal.configuration.updated" => Ok(BillingPortalConfigurationUpdated), + "billing_portal.session.created" => Ok(BillingPortalSessionCreated), + "capability.updated" => Ok(CapabilityUpdated), + "cash_balance.funds_available" => Ok(CashBalanceFundsAvailable), + "charge.captured" => Ok(ChargeCaptured), + "charge.dispute.closed" => Ok(ChargeDisputeClosed), + "charge.dispute.created" => Ok(ChargeDisputeCreated), + "charge.dispute.funds_reinstated" => Ok(ChargeDisputeFundsReinstated), + "charge.dispute.funds_withdrawn" => Ok(ChargeDisputeFundsWithdrawn), + "charge.dispute.updated" => Ok(ChargeDisputeUpdated), + "charge.expired" => Ok(ChargeExpired), + "charge.failed" => Ok(ChargeFailed), + "charge.pending" => Ok(ChargePending), + "charge.refund.updated" => Ok(ChargeRefundUpdated), + "charge.refunded" => Ok(ChargeRefunded), + "charge.succeeded" => Ok(ChargeSucceeded), + "charge.updated" => Ok(ChargeUpdated), + "checkout.session.async_payment_failed" => Ok(CheckoutSessionAsyncPaymentFailed), + "checkout.session.async_payment_succeeded" => Ok(CheckoutSessionAsyncPaymentSucceeded), + "checkout.session.completed" => Ok(CheckoutSessionCompleted), + "checkout.session.expired" => Ok(CheckoutSessionExpired), + "climate.order.canceled" => Ok(ClimateOrderCanceled), + "climate.order.created" => Ok(ClimateOrderCreated), + "climate.order.delayed" => Ok(ClimateOrderDelayed), + "climate.order.delivered" => Ok(ClimateOrderDelivered), + "climate.order.product_substituted" => Ok(ClimateOrderProductSubstituted), + "climate.product.created" => Ok(ClimateProductCreated), + "climate.product.pricing_updated" => Ok(ClimateProductPricingUpdated), + "coupon.created" => Ok(CouponCreated), + "coupon.deleted" => Ok(CouponDeleted), + "coupon.updated" => Ok(CouponUpdated), + "credit_note.created" => Ok(CreditNoteCreated), + "credit_note.updated" => Ok(CreditNoteUpdated), + "credit_note.voided" => Ok(CreditNoteVoided), + "customer.created" => Ok(CustomerCreated), + "customer.deleted" => Ok(CustomerDeleted), + "customer.discount.created" => Ok(CustomerDiscountCreated), + "customer.discount.deleted" => Ok(CustomerDiscountDeleted), + "customer.discount.updated" => Ok(CustomerDiscountUpdated), + "customer.source.created" => Ok(CustomerSourceCreated), + "customer.source.deleted" => Ok(CustomerSourceDeleted), + "customer.source.expiring" => Ok(CustomerSourceExpiring), + "customer.source.updated" => Ok(CustomerSourceUpdated), + "customer.subscription.created" => Ok(CustomerSubscriptionCreated), + "customer.subscription.deleted" => Ok(CustomerSubscriptionDeleted), + "customer.subscription.paused" => Ok(CustomerSubscriptionPaused), + "customer.subscription.pending_update_applied" => { + Ok(CustomerSubscriptionPendingUpdateApplied) + } + "customer.subscription.pending_update_expired" => { + Ok(CustomerSubscriptionPendingUpdateExpired) + } + "customer.subscription.resumed" => Ok(CustomerSubscriptionResumed), + "customer.subscription.trial_will_end" => Ok(CustomerSubscriptionTrialWillEnd), + "customer.subscription.updated" => Ok(CustomerSubscriptionUpdated), + "customer.tax_id.created" => Ok(CustomerTaxIdCreated), + "customer.tax_id.deleted" => Ok(CustomerTaxIdDeleted), + "customer.tax_id.updated" => Ok(CustomerTaxIdUpdated), + "customer.updated" => Ok(CustomerUpdated), + "customer_cash_balance_transaction.created" => { + Ok(CustomerCashBalanceTransactionCreated) + } + "file.created" => Ok(FileCreated), + "financial_connections.account.created" => Ok(FinancialConnectionsAccountCreated), + "financial_connections.account.deactivated" => { + Ok(FinancialConnectionsAccountDeactivated) + } + "financial_connections.account.disconnected" => { + Ok(FinancialConnectionsAccountDisconnected) + } + "financial_connections.account.reactivated" => { + Ok(FinancialConnectionsAccountReactivated) + } + "financial_connections.account.refreshed_balance" => { + Ok(FinancialConnectionsAccountRefreshedBalance) + } + "financial_connections.account.refreshed_transactions" => { + Ok(FinancialConnectionsAccountRefreshedTransactions) + } + "identity.verification_session.canceled" => Ok(IdentityVerificationSessionCanceled), + "identity.verification_session.created" => Ok(IdentityVerificationSessionCreated), + "identity.verification_session.processing" => Ok(IdentityVerificationSessionProcessing), + "identity.verification_session.redacted" => Ok(IdentityVerificationSessionRedacted), + "identity.verification_session.requires_input" => { + Ok(IdentityVerificationSessionRequiresInput) + } + "identity.verification_session.verified" => Ok(IdentityVerificationSessionVerified), + "invoice.created" => Ok(InvoiceCreated), + "invoice.deleted" => Ok(InvoiceDeleted), + "invoice.finalization_failed" => Ok(InvoiceFinalizationFailed), + "invoice.finalized" => Ok(InvoiceFinalized), + "invoice.marked_uncollectible" => Ok(InvoiceMarkedUncollectible), + "invoice.paid" => Ok(InvoicePaid), + "invoice.payment_action_required" => Ok(InvoicePaymentActionRequired), + "invoice.payment_failed" => Ok(InvoicePaymentFailed), + "invoice.payment_succeeded" => Ok(InvoicePaymentSucceeded), + "invoice.sent" => Ok(InvoiceSent), + "invoice.upcoming" => Ok(InvoiceUpcoming), + "invoice.updated" => Ok(InvoiceUpdated), + "invoice.voided" => Ok(InvoiceVoided), + "invoiceitem.created" => Ok(InvoiceitemCreated), + "invoiceitem.deleted" => Ok(InvoiceitemDeleted), + "issuing_authorization.created" => Ok(IssuingAuthorizationCreated), + "issuing_authorization.request" => Ok(IssuingAuthorizationRequest), + "issuing_authorization.updated" => Ok(IssuingAuthorizationUpdated), + "issuing_card.created" => Ok(IssuingCardCreated), + "issuing_card.updated" => Ok(IssuingCardUpdated), + "issuing_cardholder.created" => Ok(IssuingCardholderCreated), + "issuing_cardholder.updated" => Ok(IssuingCardholderUpdated), + "issuing_dispute.closed" => Ok(IssuingDisputeClosed), + "issuing_dispute.created" => Ok(IssuingDisputeCreated), + "issuing_dispute.funds_reinstated" => Ok(IssuingDisputeFundsReinstated), + "issuing_dispute.submitted" => Ok(IssuingDisputeSubmitted), + "issuing_dispute.updated" => Ok(IssuingDisputeUpdated), + "issuing_token.created" => Ok(IssuingTokenCreated), + "issuing_token.updated" => Ok(IssuingTokenUpdated), + "issuing_transaction.created" => Ok(IssuingTransactionCreated), + "issuing_transaction.updated" => Ok(IssuingTransactionUpdated), + "mandate.updated" => Ok(MandateUpdated), + "payment_intent.amount_capturable_updated" => Ok(PaymentIntentAmountCapturableUpdated), + "payment_intent.canceled" => Ok(PaymentIntentCanceled), + "payment_intent.created" => Ok(PaymentIntentCreated), + "payment_intent.partially_funded" => Ok(PaymentIntentPartiallyFunded), + "payment_intent.payment_failed" => Ok(PaymentIntentPaymentFailed), + "payment_intent.processing" => Ok(PaymentIntentProcessing), + "payment_intent.requires_action" => Ok(PaymentIntentRequiresAction), + "payment_intent.succeeded" => Ok(PaymentIntentSucceeded), + "payment_link.created" => Ok(PaymentLinkCreated), + "payment_link.updated" => Ok(PaymentLinkUpdated), + "payment_method.attached" => Ok(PaymentMethodAttached), + "payment_method.automatically_updated" => Ok(PaymentMethodAutomaticallyUpdated), + "payment_method.detached" => Ok(PaymentMethodDetached), + "payment_method.updated" => Ok(PaymentMethodUpdated), + "payout.canceled" => Ok(PayoutCanceled), + "payout.created" => Ok(PayoutCreated), + "payout.failed" => Ok(PayoutFailed), + "payout.paid" => Ok(PayoutPaid), + "payout.reconciliation_completed" => Ok(PayoutReconciliationCompleted), + "payout.updated" => Ok(PayoutUpdated), + "person.created" => Ok(PersonCreated), + "person.deleted" => Ok(PersonDeleted), + "person.updated" => Ok(PersonUpdated), + "plan.created" => Ok(PlanCreated), + "plan.deleted" => Ok(PlanDeleted), + "plan.updated" => Ok(PlanUpdated), + "price.created" => Ok(PriceCreated), + "price.deleted" => Ok(PriceDeleted), + "price.updated" => Ok(PriceUpdated), + "product.created" => Ok(ProductCreated), + "product.deleted" => Ok(ProductDeleted), + "product.updated" => Ok(ProductUpdated), + "promotion_code.created" => Ok(PromotionCodeCreated), + "promotion_code.updated" => Ok(PromotionCodeUpdated), + "quote.accepted" => Ok(QuoteAccepted), + "quote.canceled" => Ok(QuoteCanceled), + "quote.created" => Ok(QuoteCreated), + "quote.finalized" => Ok(QuoteFinalized), + "radar.early_fraud_warning.created" => Ok(RadarEarlyFraudWarningCreated), + "radar.early_fraud_warning.updated" => Ok(RadarEarlyFraudWarningUpdated), + "refund.created" => Ok(RefundCreated), + "refund.updated" => Ok(RefundUpdated), + "reporting.report_run.failed" => Ok(ReportingReportRunFailed), + "reporting.report_run.succeeded" => Ok(ReportingReportRunSucceeded), + "reporting.report_type.updated" => Ok(ReportingReportTypeUpdated), + "review.closed" => Ok(ReviewClosed), + "review.opened" => Ok(ReviewOpened), + "setup_intent.canceled" => Ok(SetupIntentCanceled), + "setup_intent.created" => Ok(SetupIntentCreated), + "setup_intent.requires_action" => Ok(SetupIntentRequiresAction), + "setup_intent.setup_failed" => Ok(SetupIntentSetupFailed), + "setup_intent.succeeded" => Ok(SetupIntentSucceeded), + "sigma.scheduled_query_run.created" => Ok(SigmaScheduledQueryRunCreated), + "source.canceled" => Ok(SourceCanceled), + "source.chargeable" => Ok(SourceChargeable), + "source.failed" => Ok(SourceFailed), + "source.mandate_notification" => Ok(SourceMandateNotification), + "source.refund_attributes_required" => Ok(SourceRefundAttributesRequired), + "source.transaction.created" => Ok(SourceTransactionCreated), + "source.transaction.updated" => Ok(SourceTransactionUpdated), + "subscription_schedule.aborted" => Ok(SubscriptionScheduleAborted), + "subscription_schedule.canceled" => Ok(SubscriptionScheduleCanceled), + "subscription_schedule.completed" => Ok(SubscriptionScheduleCompleted), + "subscription_schedule.created" => Ok(SubscriptionScheduleCreated), + "subscription_schedule.expiring" => Ok(SubscriptionScheduleExpiring), + "subscription_schedule.released" => Ok(SubscriptionScheduleReleased), + "subscription_schedule.updated" => Ok(SubscriptionScheduleUpdated), + "tax.settings.updated" => Ok(TaxSettingsUpdated), + "tax_rate.created" => Ok(TaxRateCreated), + "tax_rate.updated" => Ok(TaxRateUpdated), + "terminal.reader.action_failed" => Ok(TerminalReaderActionFailed), + "terminal.reader.action_succeeded" => Ok(TerminalReaderActionSucceeded), + "test_helpers.test_clock.advancing" => Ok(TestHelpersTestClockAdvancing), + "test_helpers.test_clock.created" => Ok(TestHelpersTestClockCreated), + "test_helpers.test_clock.deleted" => Ok(TestHelpersTestClockDeleted), + "test_helpers.test_clock.internal_failure" => Ok(TestHelpersTestClockInternalFailure), + "test_helpers.test_clock.ready" => Ok(TestHelpersTestClockReady), + "topup.canceled" => Ok(TopupCanceled), + "topup.created" => Ok(TopupCreated), + "topup.failed" => Ok(TopupFailed), + "topup.reversed" => Ok(TopupReversed), + "topup.succeeded" => Ok(TopupSucceeded), + "transfer.created" => Ok(TransferCreated), + "transfer.reversed" => Ok(TransferReversed), + "transfer.updated" => Ok(TransferUpdated), + "treasury.credit_reversal.created" => Ok(TreasuryCreditReversalCreated), + "treasury.credit_reversal.posted" => Ok(TreasuryCreditReversalPosted), + "treasury.debit_reversal.completed" => Ok(TreasuryDebitReversalCompleted), + "treasury.debit_reversal.created" => Ok(TreasuryDebitReversalCreated), + "treasury.debit_reversal.initial_credit_granted" => { + Ok(TreasuryDebitReversalInitialCreditGranted) + } + "treasury.financial_account.closed" => Ok(TreasuryFinancialAccountClosed), + "treasury.financial_account.created" => Ok(TreasuryFinancialAccountCreated), + "treasury.financial_account.features_status_updated" => { + Ok(TreasuryFinancialAccountFeaturesStatusUpdated) + } + "treasury.inbound_transfer.canceled" => Ok(TreasuryInboundTransferCanceled), + "treasury.inbound_transfer.created" => Ok(TreasuryInboundTransferCreated), + "treasury.inbound_transfer.failed" => Ok(TreasuryInboundTransferFailed), + "treasury.inbound_transfer.succeeded" => Ok(TreasuryInboundTransferSucceeded), + "treasury.outbound_payment.canceled" => Ok(TreasuryOutboundPaymentCanceled), + "treasury.outbound_payment.created" => Ok(TreasuryOutboundPaymentCreated), + "treasury.outbound_payment.expected_arrival_date_updated" => { + Ok(TreasuryOutboundPaymentExpectedArrivalDateUpdated) + } + "treasury.outbound_payment.failed" => Ok(TreasuryOutboundPaymentFailed), + "treasury.outbound_payment.posted" => Ok(TreasuryOutboundPaymentPosted), + "treasury.outbound_payment.returned" => Ok(TreasuryOutboundPaymentReturned), + "treasury.outbound_transfer.canceled" => Ok(TreasuryOutboundTransferCanceled), + "treasury.outbound_transfer.created" => Ok(TreasuryOutboundTransferCreated), + "treasury.outbound_transfer.expected_arrival_date_updated" => { + Ok(TreasuryOutboundTransferExpectedArrivalDateUpdated) + } + "treasury.outbound_transfer.failed" => Ok(TreasuryOutboundTransferFailed), + "treasury.outbound_transfer.posted" => Ok(TreasuryOutboundTransferPosted), + "treasury.outbound_transfer.returned" => Ok(TreasuryOutboundTransferReturned), + "treasury.received_credit.created" => Ok(TreasuryReceivedCreditCreated), + "treasury.received_credit.failed" => Ok(TreasuryReceivedCreditFailed), + "treasury.received_credit.succeeded" => Ok(TreasuryReceivedCreditSucceeded), + "treasury.received_debit.created" => Ok(TreasuryReceivedDebitCreated), + _ => Err(()), + } + } +} +impl std::fmt::Display for CreateWebhookEndpointEnabledEvents { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreateWebhookEndpointEnabledEvents { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreateWebhookEndpointEnabledEvents { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'a> CreateWebhookEndpoint<'a> { + /// A webhook endpoint must have a `url` and a list of `enabled_events`. + /// You may optionally specify the Boolean `connect` parameter. + /// If set to true, then a Connect webhook endpoint that notifies the specified `url` about events from all connected accounts is created; otherwise an account webhook endpoint that notifies the specified `url` only about events from your account is created. + /// You can also create webhook endpoints in the [webhooks settings](https://dashboard.stripe.com/account/webhooks) section of the Dashboard. + pub fn send(&self, client: &stripe::Client) -> stripe::Response { + client.send_form("/webhook_endpoints", self, http_types::Method::Post) + } +} +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdateWebhookEndpoint<'a> { + /// An optional description of what the webhook is used for. + #[serde(skip_serializing_if = "Option::is_none")] + pub description: Option<&'a str>, + /// Disable the webhook endpoint if set to true. + #[serde(skip_serializing_if = "Option::is_none")] + pub disabled: Option, + /// The list of events to enable for this endpoint. + /// You may specify `['*']` to enable all events, except those that require explicit selection. + #[serde(skip_serializing_if = "Option::is_none")] + pub enabled_events: Option<&'a [UpdateWebhookEndpointEnabledEvents]>, + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, + /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. + /// This can be useful for storing additional information about the object in a structured format. + /// Individual keys can be unset by posting an empty value to them. + /// All keys can be unset by posting an empty value to `metadata`. + #[serde(skip_serializing_if = "Option::is_none")] + pub metadata: Option<&'a std::collections::HashMap>, + /// The URL of the webhook endpoint. + #[serde(skip_serializing_if = "Option::is_none")] + pub url: Option<&'a str>, +} +impl<'a> UpdateWebhookEndpoint<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// The list of events to enable for this endpoint. +/// You may specify `['*']` to enable all events, except those that require explicit selection. +#[derive(Copy, Clone, Eq, PartialEq)] +#[non_exhaustive] +pub enum UpdateWebhookEndpointEnabledEvents { + All, + AccountApplicationAuthorized, + AccountApplicationDeauthorized, + AccountExternalAccountCreated, + AccountExternalAccountDeleted, + AccountExternalAccountUpdated, + AccountUpdated, + ApplicationFeeCreated, + ApplicationFeeRefundUpdated, + ApplicationFeeRefunded, + BalanceAvailable, + BillingPortalConfigurationCreated, + BillingPortalConfigurationUpdated, + BillingPortalSessionCreated, + CapabilityUpdated, + CashBalanceFundsAvailable, + ChargeCaptured, + ChargeDisputeClosed, + ChargeDisputeCreated, + ChargeDisputeFundsReinstated, + ChargeDisputeFundsWithdrawn, + ChargeDisputeUpdated, + ChargeExpired, + ChargeFailed, + ChargePending, + ChargeRefundUpdated, + ChargeRefunded, + ChargeSucceeded, + ChargeUpdated, + CheckoutSessionAsyncPaymentFailed, + CheckoutSessionAsyncPaymentSucceeded, + CheckoutSessionCompleted, + CheckoutSessionExpired, + ClimateOrderCanceled, + ClimateOrderCreated, + ClimateOrderDelayed, + ClimateOrderDelivered, + ClimateOrderProductSubstituted, + ClimateProductCreated, + ClimateProductPricingUpdated, + CouponCreated, + CouponDeleted, + CouponUpdated, + CreditNoteCreated, + CreditNoteUpdated, + CreditNoteVoided, + CustomerCreated, + CustomerDeleted, + CustomerDiscountCreated, + CustomerDiscountDeleted, + CustomerDiscountUpdated, + CustomerSourceCreated, + CustomerSourceDeleted, + CustomerSourceExpiring, + CustomerSourceUpdated, + CustomerSubscriptionCreated, + CustomerSubscriptionDeleted, + CustomerSubscriptionPaused, + CustomerSubscriptionPendingUpdateApplied, + CustomerSubscriptionPendingUpdateExpired, + CustomerSubscriptionResumed, + CustomerSubscriptionTrialWillEnd, + CustomerSubscriptionUpdated, + CustomerTaxIdCreated, + CustomerTaxIdDeleted, + CustomerTaxIdUpdated, + CustomerUpdated, + CustomerCashBalanceTransactionCreated, + FileCreated, + FinancialConnectionsAccountCreated, + FinancialConnectionsAccountDeactivated, + FinancialConnectionsAccountDisconnected, + FinancialConnectionsAccountReactivated, + FinancialConnectionsAccountRefreshedBalance, + FinancialConnectionsAccountRefreshedTransactions, + IdentityVerificationSessionCanceled, + IdentityVerificationSessionCreated, + IdentityVerificationSessionProcessing, + IdentityVerificationSessionRedacted, + IdentityVerificationSessionRequiresInput, + IdentityVerificationSessionVerified, + InvoiceCreated, + InvoiceDeleted, + InvoiceFinalizationFailed, + InvoiceFinalized, + InvoiceMarkedUncollectible, + InvoicePaid, + InvoicePaymentActionRequired, + InvoicePaymentFailed, + InvoicePaymentSucceeded, + InvoiceSent, + InvoiceUpcoming, + InvoiceUpdated, + InvoiceVoided, + InvoiceitemCreated, + InvoiceitemDeleted, + IssuingAuthorizationCreated, + IssuingAuthorizationRequest, + IssuingAuthorizationUpdated, + IssuingCardCreated, + IssuingCardUpdated, + IssuingCardholderCreated, + IssuingCardholderUpdated, + IssuingDisputeClosed, + IssuingDisputeCreated, + IssuingDisputeFundsReinstated, + IssuingDisputeSubmitted, + IssuingDisputeUpdated, + IssuingTokenCreated, + IssuingTokenUpdated, + IssuingTransactionCreated, + IssuingTransactionUpdated, + MandateUpdated, + PaymentIntentAmountCapturableUpdated, + PaymentIntentCanceled, + PaymentIntentCreated, + PaymentIntentPartiallyFunded, + PaymentIntentPaymentFailed, + PaymentIntentProcessing, + PaymentIntentRequiresAction, + PaymentIntentSucceeded, + PaymentLinkCreated, + PaymentLinkUpdated, + PaymentMethodAttached, + PaymentMethodAutomaticallyUpdated, + PaymentMethodDetached, + PaymentMethodUpdated, + PayoutCanceled, + PayoutCreated, + PayoutFailed, + PayoutPaid, + PayoutReconciliationCompleted, + PayoutUpdated, + PersonCreated, + PersonDeleted, + PersonUpdated, + PlanCreated, + PlanDeleted, + PlanUpdated, + PriceCreated, + PriceDeleted, + PriceUpdated, + ProductCreated, + ProductDeleted, + ProductUpdated, + PromotionCodeCreated, + PromotionCodeUpdated, + QuoteAccepted, + QuoteCanceled, + QuoteCreated, + QuoteFinalized, + RadarEarlyFraudWarningCreated, + RadarEarlyFraudWarningUpdated, + RefundCreated, + RefundUpdated, + ReportingReportRunFailed, + ReportingReportRunSucceeded, + ReportingReportTypeUpdated, + ReviewClosed, + ReviewOpened, + SetupIntentCanceled, + SetupIntentCreated, + SetupIntentRequiresAction, + SetupIntentSetupFailed, + SetupIntentSucceeded, + SigmaScheduledQueryRunCreated, + SourceCanceled, + SourceChargeable, + SourceFailed, + SourceMandateNotification, + SourceRefundAttributesRequired, + SourceTransactionCreated, + SourceTransactionUpdated, + SubscriptionScheduleAborted, + SubscriptionScheduleCanceled, + SubscriptionScheduleCompleted, + SubscriptionScheduleCreated, + SubscriptionScheduleExpiring, + SubscriptionScheduleReleased, + SubscriptionScheduleUpdated, + TaxSettingsUpdated, + TaxRateCreated, + TaxRateUpdated, + TerminalReaderActionFailed, + TerminalReaderActionSucceeded, + TestHelpersTestClockAdvancing, + TestHelpersTestClockCreated, + TestHelpersTestClockDeleted, + TestHelpersTestClockInternalFailure, + TestHelpersTestClockReady, + TopupCanceled, + TopupCreated, + TopupFailed, + TopupReversed, + TopupSucceeded, + TransferCreated, + TransferReversed, + TransferUpdated, + TreasuryCreditReversalCreated, + TreasuryCreditReversalPosted, + TreasuryDebitReversalCompleted, + TreasuryDebitReversalCreated, + TreasuryDebitReversalInitialCreditGranted, + TreasuryFinancialAccountClosed, + TreasuryFinancialAccountCreated, + TreasuryFinancialAccountFeaturesStatusUpdated, + TreasuryInboundTransferCanceled, + TreasuryInboundTransferCreated, + TreasuryInboundTransferFailed, + TreasuryInboundTransferSucceeded, + TreasuryOutboundPaymentCanceled, + TreasuryOutboundPaymentCreated, + TreasuryOutboundPaymentExpectedArrivalDateUpdated, + TreasuryOutboundPaymentFailed, + TreasuryOutboundPaymentPosted, + TreasuryOutboundPaymentReturned, + TreasuryOutboundTransferCanceled, + TreasuryOutboundTransferCreated, + TreasuryOutboundTransferExpectedArrivalDateUpdated, + TreasuryOutboundTransferFailed, + TreasuryOutboundTransferPosted, + TreasuryOutboundTransferReturned, + TreasuryReceivedCreditCreated, + TreasuryReceivedCreditFailed, + TreasuryReceivedCreditSucceeded, + TreasuryReceivedDebitCreated, + /// An unrecognized value from Stripe. Should not be used as a request parameter. + Unknown, +} +impl UpdateWebhookEndpointEnabledEvents { + pub fn as_str(self) -> &'static str { + use UpdateWebhookEndpointEnabledEvents::*; + match self { + All => "*", + AccountApplicationAuthorized => "account.application.authorized", + AccountApplicationDeauthorized => "account.application.deauthorized", + AccountExternalAccountCreated => "account.external_account.created", + AccountExternalAccountDeleted => "account.external_account.deleted", + AccountExternalAccountUpdated => "account.external_account.updated", + AccountUpdated => "account.updated", + ApplicationFeeCreated => "application_fee.created", + ApplicationFeeRefundUpdated => "application_fee.refund.updated", + ApplicationFeeRefunded => "application_fee.refunded", + BalanceAvailable => "balance.available", + BillingPortalConfigurationCreated => "billing_portal.configuration.created", + BillingPortalConfigurationUpdated => "billing_portal.configuration.updated", + BillingPortalSessionCreated => "billing_portal.session.created", + CapabilityUpdated => "capability.updated", + CashBalanceFundsAvailable => "cash_balance.funds_available", + ChargeCaptured => "charge.captured", + ChargeDisputeClosed => "charge.dispute.closed", + ChargeDisputeCreated => "charge.dispute.created", + ChargeDisputeFundsReinstated => "charge.dispute.funds_reinstated", + ChargeDisputeFundsWithdrawn => "charge.dispute.funds_withdrawn", + ChargeDisputeUpdated => "charge.dispute.updated", + ChargeExpired => "charge.expired", + ChargeFailed => "charge.failed", + ChargePending => "charge.pending", + ChargeRefundUpdated => "charge.refund.updated", + ChargeRefunded => "charge.refunded", + ChargeSucceeded => "charge.succeeded", + ChargeUpdated => "charge.updated", + CheckoutSessionAsyncPaymentFailed => "checkout.session.async_payment_failed", + CheckoutSessionAsyncPaymentSucceeded => "checkout.session.async_payment_succeeded", + CheckoutSessionCompleted => "checkout.session.completed", + CheckoutSessionExpired => "checkout.session.expired", + ClimateOrderCanceled => "climate.order.canceled", + ClimateOrderCreated => "climate.order.created", + ClimateOrderDelayed => "climate.order.delayed", + ClimateOrderDelivered => "climate.order.delivered", + ClimateOrderProductSubstituted => "climate.order.product_substituted", + ClimateProductCreated => "climate.product.created", + ClimateProductPricingUpdated => "climate.product.pricing_updated", + CouponCreated => "coupon.created", + CouponDeleted => "coupon.deleted", + CouponUpdated => "coupon.updated", + CreditNoteCreated => "credit_note.created", + CreditNoteUpdated => "credit_note.updated", + CreditNoteVoided => "credit_note.voided", + CustomerCreated => "customer.created", + CustomerDeleted => "customer.deleted", + CustomerDiscountCreated => "customer.discount.created", + CustomerDiscountDeleted => "customer.discount.deleted", + CustomerDiscountUpdated => "customer.discount.updated", + CustomerSourceCreated => "customer.source.created", + CustomerSourceDeleted => "customer.source.deleted", + CustomerSourceExpiring => "customer.source.expiring", + CustomerSourceUpdated => "customer.source.updated", + CustomerSubscriptionCreated => "customer.subscription.created", + CustomerSubscriptionDeleted => "customer.subscription.deleted", + CustomerSubscriptionPaused => "customer.subscription.paused", + CustomerSubscriptionPendingUpdateApplied => { + "customer.subscription.pending_update_applied" + } + CustomerSubscriptionPendingUpdateExpired => { + "customer.subscription.pending_update_expired" + } + CustomerSubscriptionResumed => "customer.subscription.resumed", + CustomerSubscriptionTrialWillEnd => "customer.subscription.trial_will_end", + CustomerSubscriptionUpdated => "customer.subscription.updated", + CustomerTaxIdCreated => "customer.tax_id.created", + CustomerTaxIdDeleted => "customer.tax_id.deleted", + CustomerTaxIdUpdated => "customer.tax_id.updated", + CustomerUpdated => "customer.updated", + CustomerCashBalanceTransactionCreated => "customer_cash_balance_transaction.created", + FileCreated => "file.created", + FinancialConnectionsAccountCreated => "financial_connections.account.created", + FinancialConnectionsAccountDeactivated => "financial_connections.account.deactivated", + FinancialConnectionsAccountDisconnected => "financial_connections.account.disconnected", + FinancialConnectionsAccountReactivated => "financial_connections.account.reactivated", + FinancialConnectionsAccountRefreshedBalance => { + "financial_connections.account.refreshed_balance" + } + FinancialConnectionsAccountRefreshedTransactions => { + "financial_connections.account.refreshed_transactions" + } + IdentityVerificationSessionCanceled => "identity.verification_session.canceled", + IdentityVerificationSessionCreated => "identity.verification_session.created", + IdentityVerificationSessionProcessing => "identity.verification_session.processing", + IdentityVerificationSessionRedacted => "identity.verification_session.redacted", + IdentityVerificationSessionRequiresInput => { + "identity.verification_session.requires_input" + } + IdentityVerificationSessionVerified => "identity.verification_session.verified", + InvoiceCreated => "invoice.created", + InvoiceDeleted => "invoice.deleted", + InvoiceFinalizationFailed => "invoice.finalization_failed", + InvoiceFinalized => "invoice.finalized", + InvoiceMarkedUncollectible => "invoice.marked_uncollectible", + InvoicePaid => "invoice.paid", + InvoicePaymentActionRequired => "invoice.payment_action_required", + InvoicePaymentFailed => "invoice.payment_failed", + InvoicePaymentSucceeded => "invoice.payment_succeeded", + InvoiceSent => "invoice.sent", + InvoiceUpcoming => "invoice.upcoming", + InvoiceUpdated => "invoice.updated", + InvoiceVoided => "invoice.voided", + InvoiceitemCreated => "invoiceitem.created", + InvoiceitemDeleted => "invoiceitem.deleted", + IssuingAuthorizationCreated => "issuing_authorization.created", + IssuingAuthorizationRequest => "issuing_authorization.request", + IssuingAuthorizationUpdated => "issuing_authorization.updated", + IssuingCardCreated => "issuing_card.created", + IssuingCardUpdated => "issuing_card.updated", + IssuingCardholderCreated => "issuing_cardholder.created", + IssuingCardholderUpdated => "issuing_cardholder.updated", + IssuingDisputeClosed => "issuing_dispute.closed", + IssuingDisputeCreated => "issuing_dispute.created", + IssuingDisputeFundsReinstated => "issuing_dispute.funds_reinstated", + IssuingDisputeSubmitted => "issuing_dispute.submitted", + IssuingDisputeUpdated => "issuing_dispute.updated", + IssuingTokenCreated => "issuing_token.created", + IssuingTokenUpdated => "issuing_token.updated", + IssuingTransactionCreated => "issuing_transaction.created", + IssuingTransactionUpdated => "issuing_transaction.updated", + MandateUpdated => "mandate.updated", + PaymentIntentAmountCapturableUpdated => "payment_intent.amount_capturable_updated", + PaymentIntentCanceled => "payment_intent.canceled", + PaymentIntentCreated => "payment_intent.created", + PaymentIntentPartiallyFunded => "payment_intent.partially_funded", + PaymentIntentPaymentFailed => "payment_intent.payment_failed", + PaymentIntentProcessing => "payment_intent.processing", + PaymentIntentRequiresAction => "payment_intent.requires_action", + PaymentIntentSucceeded => "payment_intent.succeeded", + PaymentLinkCreated => "payment_link.created", + PaymentLinkUpdated => "payment_link.updated", + PaymentMethodAttached => "payment_method.attached", + PaymentMethodAutomaticallyUpdated => "payment_method.automatically_updated", + PaymentMethodDetached => "payment_method.detached", + PaymentMethodUpdated => "payment_method.updated", + PayoutCanceled => "payout.canceled", + PayoutCreated => "payout.created", + PayoutFailed => "payout.failed", + PayoutPaid => "payout.paid", + PayoutReconciliationCompleted => "payout.reconciliation_completed", + PayoutUpdated => "payout.updated", + PersonCreated => "person.created", + PersonDeleted => "person.deleted", + PersonUpdated => "person.updated", + PlanCreated => "plan.created", + PlanDeleted => "plan.deleted", + PlanUpdated => "plan.updated", + PriceCreated => "price.created", + PriceDeleted => "price.deleted", + PriceUpdated => "price.updated", + ProductCreated => "product.created", + ProductDeleted => "product.deleted", + ProductUpdated => "product.updated", + PromotionCodeCreated => "promotion_code.created", + PromotionCodeUpdated => "promotion_code.updated", + QuoteAccepted => "quote.accepted", + QuoteCanceled => "quote.canceled", + QuoteCreated => "quote.created", + QuoteFinalized => "quote.finalized", + RadarEarlyFraudWarningCreated => "radar.early_fraud_warning.created", + RadarEarlyFraudWarningUpdated => "radar.early_fraud_warning.updated", + RefundCreated => "refund.created", + RefundUpdated => "refund.updated", + ReportingReportRunFailed => "reporting.report_run.failed", + ReportingReportRunSucceeded => "reporting.report_run.succeeded", + ReportingReportTypeUpdated => "reporting.report_type.updated", + ReviewClosed => "review.closed", + ReviewOpened => "review.opened", + SetupIntentCanceled => "setup_intent.canceled", + SetupIntentCreated => "setup_intent.created", + SetupIntentRequiresAction => "setup_intent.requires_action", + SetupIntentSetupFailed => "setup_intent.setup_failed", + SetupIntentSucceeded => "setup_intent.succeeded", + SigmaScheduledQueryRunCreated => "sigma.scheduled_query_run.created", + SourceCanceled => "source.canceled", + SourceChargeable => "source.chargeable", + SourceFailed => "source.failed", + SourceMandateNotification => "source.mandate_notification", + SourceRefundAttributesRequired => "source.refund_attributes_required", + SourceTransactionCreated => "source.transaction.created", + SourceTransactionUpdated => "source.transaction.updated", + SubscriptionScheduleAborted => "subscription_schedule.aborted", + SubscriptionScheduleCanceled => "subscription_schedule.canceled", + SubscriptionScheduleCompleted => "subscription_schedule.completed", + SubscriptionScheduleCreated => "subscription_schedule.created", + SubscriptionScheduleExpiring => "subscription_schedule.expiring", + SubscriptionScheduleReleased => "subscription_schedule.released", + SubscriptionScheduleUpdated => "subscription_schedule.updated", + TaxSettingsUpdated => "tax.settings.updated", + TaxRateCreated => "tax_rate.created", + TaxRateUpdated => "tax_rate.updated", + TerminalReaderActionFailed => "terminal.reader.action_failed", + TerminalReaderActionSucceeded => "terminal.reader.action_succeeded", + TestHelpersTestClockAdvancing => "test_helpers.test_clock.advancing", + TestHelpersTestClockCreated => "test_helpers.test_clock.created", + TestHelpersTestClockDeleted => "test_helpers.test_clock.deleted", + TestHelpersTestClockInternalFailure => "test_helpers.test_clock.internal_failure", + TestHelpersTestClockReady => "test_helpers.test_clock.ready", + TopupCanceled => "topup.canceled", + TopupCreated => "topup.created", + TopupFailed => "topup.failed", + TopupReversed => "topup.reversed", + TopupSucceeded => "topup.succeeded", + TransferCreated => "transfer.created", + TransferReversed => "transfer.reversed", + TransferUpdated => "transfer.updated", + TreasuryCreditReversalCreated => "treasury.credit_reversal.created", + TreasuryCreditReversalPosted => "treasury.credit_reversal.posted", + TreasuryDebitReversalCompleted => "treasury.debit_reversal.completed", + TreasuryDebitReversalCreated => "treasury.debit_reversal.created", + TreasuryDebitReversalInitialCreditGranted => { + "treasury.debit_reversal.initial_credit_granted" + } + TreasuryFinancialAccountClosed => "treasury.financial_account.closed", + TreasuryFinancialAccountCreated => "treasury.financial_account.created", + TreasuryFinancialAccountFeaturesStatusUpdated => { + "treasury.financial_account.features_status_updated" + } + TreasuryInboundTransferCanceled => "treasury.inbound_transfer.canceled", + TreasuryInboundTransferCreated => "treasury.inbound_transfer.created", + TreasuryInboundTransferFailed => "treasury.inbound_transfer.failed", + TreasuryInboundTransferSucceeded => "treasury.inbound_transfer.succeeded", + TreasuryOutboundPaymentCanceled => "treasury.outbound_payment.canceled", + TreasuryOutboundPaymentCreated => "treasury.outbound_payment.created", + TreasuryOutboundPaymentExpectedArrivalDateUpdated => { + "treasury.outbound_payment.expected_arrival_date_updated" + } + TreasuryOutboundPaymentFailed => "treasury.outbound_payment.failed", + TreasuryOutboundPaymentPosted => "treasury.outbound_payment.posted", + TreasuryOutboundPaymentReturned => "treasury.outbound_payment.returned", + TreasuryOutboundTransferCanceled => "treasury.outbound_transfer.canceled", + TreasuryOutboundTransferCreated => "treasury.outbound_transfer.created", + TreasuryOutboundTransferExpectedArrivalDateUpdated => { + "treasury.outbound_transfer.expected_arrival_date_updated" + } + TreasuryOutboundTransferFailed => "treasury.outbound_transfer.failed", + TreasuryOutboundTransferPosted => "treasury.outbound_transfer.posted", + TreasuryOutboundTransferReturned => "treasury.outbound_transfer.returned", + TreasuryReceivedCreditCreated => "treasury.received_credit.created", + TreasuryReceivedCreditFailed => "treasury.received_credit.failed", + TreasuryReceivedCreditSucceeded => "treasury.received_credit.succeeded", + TreasuryReceivedDebitCreated => "treasury.received_debit.created", + Unknown => "unknown", + } + } +} + +impl std::str::FromStr for UpdateWebhookEndpointEnabledEvents { + type Err = (); + fn from_str(s: &str) -> Result { + use UpdateWebhookEndpointEnabledEvents::*; + match s { + "*" => Ok(All), + "account.application.authorized" => Ok(AccountApplicationAuthorized), + "account.application.deauthorized" => Ok(AccountApplicationDeauthorized), + "account.external_account.created" => Ok(AccountExternalAccountCreated), + "account.external_account.deleted" => Ok(AccountExternalAccountDeleted), + "account.external_account.updated" => Ok(AccountExternalAccountUpdated), + "account.updated" => Ok(AccountUpdated), + "application_fee.created" => Ok(ApplicationFeeCreated), + "application_fee.refund.updated" => Ok(ApplicationFeeRefundUpdated), + "application_fee.refunded" => Ok(ApplicationFeeRefunded), + "balance.available" => Ok(BalanceAvailable), + "billing_portal.configuration.created" => Ok(BillingPortalConfigurationCreated), + "billing_portal.configuration.updated" => Ok(BillingPortalConfigurationUpdated), + "billing_portal.session.created" => Ok(BillingPortalSessionCreated), + "capability.updated" => Ok(CapabilityUpdated), + "cash_balance.funds_available" => Ok(CashBalanceFundsAvailable), + "charge.captured" => Ok(ChargeCaptured), + "charge.dispute.closed" => Ok(ChargeDisputeClosed), + "charge.dispute.created" => Ok(ChargeDisputeCreated), + "charge.dispute.funds_reinstated" => Ok(ChargeDisputeFundsReinstated), + "charge.dispute.funds_withdrawn" => Ok(ChargeDisputeFundsWithdrawn), + "charge.dispute.updated" => Ok(ChargeDisputeUpdated), + "charge.expired" => Ok(ChargeExpired), + "charge.failed" => Ok(ChargeFailed), + "charge.pending" => Ok(ChargePending), + "charge.refund.updated" => Ok(ChargeRefundUpdated), + "charge.refunded" => Ok(ChargeRefunded), + "charge.succeeded" => Ok(ChargeSucceeded), + "charge.updated" => Ok(ChargeUpdated), + "checkout.session.async_payment_failed" => Ok(CheckoutSessionAsyncPaymentFailed), + "checkout.session.async_payment_succeeded" => Ok(CheckoutSessionAsyncPaymentSucceeded), + "checkout.session.completed" => Ok(CheckoutSessionCompleted), + "checkout.session.expired" => Ok(CheckoutSessionExpired), + "climate.order.canceled" => Ok(ClimateOrderCanceled), + "climate.order.created" => Ok(ClimateOrderCreated), + "climate.order.delayed" => Ok(ClimateOrderDelayed), + "climate.order.delivered" => Ok(ClimateOrderDelivered), + "climate.order.product_substituted" => Ok(ClimateOrderProductSubstituted), + "climate.product.created" => Ok(ClimateProductCreated), + "climate.product.pricing_updated" => Ok(ClimateProductPricingUpdated), + "coupon.created" => Ok(CouponCreated), + "coupon.deleted" => Ok(CouponDeleted), + "coupon.updated" => Ok(CouponUpdated), + "credit_note.created" => Ok(CreditNoteCreated), + "credit_note.updated" => Ok(CreditNoteUpdated), + "credit_note.voided" => Ok(CreditNoteVoided), + "customer.created" => Ok(CustomerCreated), + "customer.deleted" => Ok(CustomerDeleted), + "customer.discount.created" => Ok(CustomerDiscountCreated), + "customer.discount.deleted" => Ok(CustomerDiscountDeleted), + "customer.discount.updated" => Ok(CustomerDiscountUpdated), + "customer.source.created" => Ok(CustomerSourceCreated), + "customer.source.deleted" => Ok(CustomerSourceDeleted), + "customer.source.expiring" => Ok(CustomerSourceExpiring), + "customer.source.updated" => Ok(CustomerSourceUpdated), + "customer.subscription.created" => Ok(CustomerSubscriptionCreated), + "customer.subscription.deleted" => Ok(CustomerSubscriptionDeleted), + "customer.subscription.paused" => Ok(CustomerSubscriptionPaused), + "customer.subscription.pending_update_applied" => { + Ok(CustomerSubscriptionPendingUpdateApplied) + } + "customer.subscription.pending_update_expired" => { + Ok(CustomerSubscriptionPendingUpdateExpired) + } + "customer.subscription.resumed" => Ok(CustomerSubscriptionResumed), + "customer.subscription.trial_will_end" => Ok(CustomerSubscriptionTrialWillEnd), + "customer.subscription.updated" => Ok(CustomerSubscriptionUpdated), + "customer.tax_id.created" => Ok(CustomerTaxIdCreated), + "customer.tax_id.deleted" => Ok(CustomerTaxIdDeleted), + "customer.tax_id.updated" => Ok(CustomerTaxIdUpdated), + "customer.updated" => Ok(CustomerUpdated), + "customer_cash_balance_transaction.created" => { + Ok(CustomerCashBalanceTransactionCreated) + } + "file.created" => Ok(FileCreated), + "financial_connections.account.created" => Ok(FinancialConnectionsAccountCreated), + "financial_connections.account.deactivated" => { + Ok(FinancialConnectionsAccountDeactivated) + } + "financial_connections.account.disconnected" => { + Ok(FinancialConnectionsAccountDisconnected) + } + "financial_connections.account.reactivated" => { + Ok(FinancialConnectionsAccountReactivated) + } + "financial_connections.account.refreshed_balance" => { + Ok(FinancialConnectionsAccountRefreshedBalance) + } + "financial_connections.account.refreshed_transactions" => { + Ok(FinancialConnectionsAccountRefreshedTransactions) + } + "identity.verification_session.canceled" => Ok(IdentityVerificationSessionCanceled), + "identity.verification_session.created" => Ok(IdentityVerificationSessionCreated), + "identity.verification_session.processing" => Ok(IdentityVerificationSessionProcessing), + "identity.verification_session.redacted" => Ok(IdentityVerificationSessionRedacted), + "identity.verification_session.requires_input" => { + Ok(IdentityVerificationSessionRequiresInput) + } + "identity.verification_session.verified" => Ok(IdentityVerificationSessionVerified), + "invoice.created" => Ok(InvoiceCreated), + "invoice.deleted" => Ok(InvoiceDeleted), + "invoice.finalization_failed" => Ok(InvoiceFinalizationFailed), + "invoice.finalized" => Ok(InvoiceFinalized), + "invoice.marked_uncollectible" => Ok(InvoiceMarkedUncollectible), + "invoice.paid" => Ok(InvoicePaid), + "invoice.payment_action_required" => Ok(InvoicePaymentActionRequired), + "invoice.payment_failed" => Ok(InvoicePaymentFailed), + "invoice.payment_succeeded" => Ok(InvoicePaymentSucceeded), + "invoice.sent" => Ok(InvoiceSent), + "invoice.upcoming" => Ok(InvoiceUpcoming), + "invoice.updated" => Ok(InvoiceUpdated), + "invoice.voided" => Ok(InvoiceVoided), + "invoiceitem.created" => Ok(InvoiceitemCreated), + "invoiceitem.deleted" => Ok(InvoiceitemDeleted), + "issuing_authorization.created" => Ok(IssuingAuthorizationCreated), + "issuing_authorization.request" => Ok(IssuingAuthorizationRequest), + "issuing_authorization.updated" => Ok(IssuingAuthorizationUpdated), + "issuing_card.created" => Ok(IssuingCardCreated), + "issuing_card.updated" => Ok(IssuingCardUpdated), + "issuing_cardholder.created" => Ok(IssuingCardholderCreated), + "issuing_cardholder.updated" => Ok(IssuingCardholderUpdated), + "issuing_dispute.closed" => Ok(IssuingDisputeClosed), + "issuing_dispute.created" => Ok(IssuingDisputeCreated), + "issuing_dispute.funds_reinstated" => Ok(IssuingDisputeFundsReinstated), + "issuing_dispute.submitted" => Ok(IssuingDisputeSubmitted), + "issuing_dispute.updated" => Ok(IssuingDisputeUpdated), + "issuing_token.created" => Ok(IssuingTokenCreated), + "issuing_token.updated" => Ok(IssuingTokenUpdated), + "issuing_transaction.created" => Ok(IssuingTransactionCreated), + "issuing_transaction.updated" => Ok(IssuingTransactionUpdated), + "mandate.updated" => Ok(MandateUpdated), + "payment_intent.amount_capturable_updated" => Ok(PaymentIntentAmountCapturableUpdated), + "payment_intent.canceled" => Ok(PaymentIntentCanceled), + "payment_intent.created" => Ok(PaymentIntentCreated), + "payment_intent.partially_funded" => Ok(PaymentIntentPartiallyFunded), + "payment_intent.payment_failed" => Ok(PaymentIntentPaymentFailed), + "payment_intent.processing" => Ok(PaymentIntentProcessing), + "payment_intent.requires_action" => Ok(PaymentIntentRequiresAction), + "payment_intent.succeeded" => Ok(PaymentIntentSucceeded), + "payment_link.created" => Ok(PaymentLinkCreated), + "payment_link.updated" => Ok(PaymentLinkUpdated), + "payment_method.attached" => Ok(PaymentMethodAttached), + "payment_method.automatically_updated" => Ok(PaymentMethodAutomaticallyUpdated), + "payment_method.detached" => Ok(PaymentMethodDetached), + "payment_method.updated" => Ok(PaymentMethodUpdated), + "payout.canceled" => Ok(PayoutCanceled), + "payout.created" => Ok(PayoutCreated), + "payout.failed" => Ok(PayoutFailed), + "payout.paid" => Ok(PayoutPaid), + "payout.reconciliation_completed" => Ok(PayoutReconciliationCompleted), + "payout.updated" => Ok(PayoutUpdated), + "person.created" => Ok(PersonCreated), + "person.deleted" => Ok(PersonDeleted), + "person.updated" => Ok(PersonUpdated), + "plan.created" => Ok(PlanCreated), + "plan.deleted" => Ok(PlanDeleted), + "plan.updated" => Ok(PlanUpdated), + "price.created" => Ok(PriceCreated), + "price.deleted" => Ok(PriceDeleted), + "price.updated" => Ok(PriceUpdated), + "product.created" => Ok(ProductCreated), + "product.deleted" => Ok(ProductDeleted), + "product.updated" => Ok(ProductUpdated), + "promotion_code.created" => Ok(PromotionCodeCreated), + "promotion_code.updated" => Ok(PromotionCodeUpdated), + "quote.accepted" => Ok(QuoteAccepted), + "quote.canceled" => Ok(QuoteCanceled), + "quote.created" => Ok(QuoteCreated), + "quote.finalized" => Ok(QuoteFinalized), + "radar.early_fraud_warning.created" => Ok(RadarEarlyFraudWarningCreated), + "radar.early_fraud_warning.updated" => Ok(RadarEarlyFraudWarningUpdated), + "refund.created" => Ok(RefundCreated), + "refund.updated" => Ok(RefundUpdated), + "reporting.report_run.failed" => Ok(ReportingReportRunFailed), + "reporting.report_run.succeeded" => Ok(ReportingReportRunSucceeded), + "reporting.report_type.updated" => Ok(ReportingReportTypeUpdated), + "review.closed" => Ok(ReviewClosed), + "review.opened" => Ok(ReviewOpened), + "setup_intent.canceled" => Ok(SetupIntentCanceled), + "setup_intent.created" => Ok(SetupIntentCreated), + "setup_intent.requires_action" => Ok(SetupIntentRequiresAction), + "setup_intent.setup_failed" => Ok(SetupIntentSetupFailed), + "setup_intent.succeeded" => Ok(SetupIntentSucceeded), + "sigma.scheduled_query_run.created" => Ok(SigmaScheduledQueryRunCreated), + "source.canceled" => Ok(SourceCanceled), + "source.chargeable" => Ok(SourceChargeable), + "source.failed" => Ok(SourceFailed), + "source.mandate_notification" => Ok(SourceMandateNotification), + "source.refund_attributes_required" => Ok(SourceRefundAttributesRequired), + "source.transaction.created" => Ok(SourceTransactionCreated), + "source.transaction.updated" => Ok(SourceTransactionUpdated), + "subscription_schedule.aborted" => Ok(SubscriptionScheduleAborted), + "subscription_schedule.canceled" => Ok(SubscriptionScheduleCanceled), + "subscription_schedule.completed" => Ok(SubscriptionScheduleCompleted), + "subscription_schedule.created" => Ok(SubscriptionScheduleCreated), + "subscription_schedule.expiring" => Ok(SubscriptionScheduleExpiring), + "subscription_schedule.released" => Ok(SubscriptionScheduleReleased), + "subscription_schedule.updated" => Ok(SubscriptionScheduleUpdated), + "tax.settings.updated" => Ok(TaxSettingsUpdated), + "tax_rate.created" => Ok(TaxRateCreated), + "tax_rate.updated" => Ok(TaxRateUpdated), + "terminal.reader.action_failed" => Ok(TerminalReaderActionFailed), + "terminal.reader.action_succeeded" => Ok(TerminalReaderActionSucceeded), + "test_helpers.test_clock.advancing" => Ok(TestHelpersTestClockAdvancing), + "test_helpers.test_clock.created" => Ok(TestHelpersTestClockCreated), + "test_helpers.test_clock.deleted" => Ok(TestHelpersTestClockDeleted), + "test_helpers.test_clock.internal_failure" => Ok(TestHelpersTestClockInternalFailure), + "test_helpers.test_clock.ready" => Ok(TestHelpersTestClockReady), + "topup.canceled" => Ok(TopupCanceled), + "topup.created" => Ok(TopupCreated), + "topup.failed" => Ok(TopupFailed), + "topup.reversed" => Ok(TopupReversed), + "topup.succeeded" => Ok(TopupSucceeded), + "transfer.created" => Ok(TransferCreated), + "transfer.reversed" => Ok(TransferReversed), + "transfer.updated" => Ok(TransferUpdated), + "treasury.credit_reversal.created" => Ok(TreasuryCreditReversalCreated), + "treasury.credit_reversal.posted" => Ok(TreasuryCreditReversalPosted), + "treasury.debit_reversal.completed" => Ok(TreasuryDebitReversalCompleted), + "treasury.debit_reversal.created" => Ok(TreasuryDebitReversalCreated), + "treasury.debit_reversal.initial_credit_granted" => { + Ok(TreasuryDebitReversalInitialCreditGranted) + } + "treasury.financial_account.closed" => Ok(TreasuryFinancialAccountClosed), + "treasury.financial_account.created" => Ok(TreasuryFinancialAccountCreated), + "treasury.financial_account.features_status_updated" => { + Ok(TreasuryFinancialAccountFeaturesStatusUpdated) + } + "treasury.inbound_transfer.canceled" => Ok(TreasuryInboundTransferCanceled), + "treasury.inbound_transfer.created" => Ok(TreasuryInboundTransferCreated), + "treasury.inbound_transfer.failed" => Ok(TreasuryInboundTransferFailed), + "treasury.inbound_transfer.succeeded" => Ok(TreasuryInboundTransferSucceeded), + "treasury.outbound_payment.canceled" => Ok(TreasuryOutboundPaymentCanceled), + "treasury.outbound_payment.created" => Ok(TreasuryOutboundPaymentCreated), + "treasury.outbound_payment.expected_arrival_date_updated" => { + Ok(TreasuryOutboundPaymentExpectedArrivalDateUpdated) + } + "treasury.outbound_payment.failed" => Ok(TreasuryOutboundPaymentFailed), + "treasury.outbound_payment.posted" => Ok(TreasuryOutboundPaymentPosted), + "treasury.outbound_payment.returned" => Ok(TreasuryOutboundPaymentReturned), + "treasury.outbound_transfer.canceled" => Ok(TreasuryOutboundTransferCanceled), + "treasury.outbound_transfer.created" => Ok(TreasuryOutboundTransferCreated), + "treasury.outbound_transfer.expected_arrival_date_updated" => { + Ok(TreasuryOutboundTransferExpectedArrivalDateUpdated) + } + "treasury.outbound_transfer.failed" => Ok(TreasuryOutboundTransferFailed), + "treasury.outbound_transfer.posted" => Ok(TreasuryOutboundTransferPosted), + "treasury.outbound_transfer.returned" => Ok(TreasuryOutboundTransferReturned), + "treasury.received_credit.created" => Ok(TreasuryReceivedCreditCreated), + "treasury.received_credit.failed" => Ok(TreasuryReceivedCreditFailed), + "treasury.received_credit.succeeded" => Ok(TreasuryReceivedCreditSucceeded), + "treasury.received_debit.created" => Ok(TreasuryReceivedDebitCreated), + _ => Err(()), + } + } +} +impl std::fmt::Display for UpdateWebhookEndpointEnabledEvents { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for UpdateWebhookEndpointEnabledEvents { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for UpdateWebhookEndpointEnabledEvents { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'a> UpdateWebhookEndpoint<'a> { + /// Updates the webhook endpoint. + /// You may edit the `url`, the list of `enabled_events`, and the status of your endpoint. + pub fn send( + &self, + client: &stripe::Client, + webhook_endpoint: &stripe_misc::WebhookEndpointId, + ) -> stripe::Response { + client.send_form( + &format!("/webhook_endpoints/{webhook_endpoint}"), + self, + http_types::Method::Post, + ) + } +} diff --git a/generated/stripe_misc/src/webhook_endpoint/types.rs b/generated/stripe_misc/src/webhook_endpoint/types.rs new file mode 100644 index 000000000..9eae76e71 --- /dev/null +++ b/generated/stripe_misc/src/webhook_endpoint/types.rs @@ -0,0 +1,45 @@ +/// You can configure [webhook endpoints](https://stripe.com/docs/webhooks/) via the API to be +/// notified about events that happen in your Stripe account or connected +/// accounts. +/// +/// Most users configure webhooks from [the dashboard](https://dashboard.stripe.com/webhooks), which provides a user interface for registering and testing your webhook endpoints. +/// +/// Related guide: [Setting up webhooks](https://stripe.com/docs/webhooks/configure) +/// +/// For more details see <>. +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct WebhookEndpoint { + /// The API version events are rendered as for this webhook endpoint. + pub api_version: Option, + /// The ID of the associated Connect application. + pub application: Option, + /// Time at which the object was created. Measured in seconds since the Unix epoch. + pub created: stripe_types::Timestamp, + /// An optional description of what the webhook is used for. + pub description: Option, + /// The list of events to enable for this endpoint. + /// `['*']` indicates that all events are enabled, except those that require explicit selection. + pub enabled_events: Vec, + /// Unique identifier for the object. + pub id: stripe_misc::WebhookEndpointId, + /// Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + pub livemode: bool, + /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. + /// This can be useful for storing additional information about the object in a structured format. + pub metadata: std::collections::HashMap, + /// The endpoint's secret, used to generate [webhook signatures](https://stripe.com/docs/webhooks/signatures). + /// Only returned at creation. + #[serde(skip_serializing_if = "Option::is_none")] + pub secret: Option, + /// The status of the webhook. It can be `enabled` or `disabled`. + pub status: String, + /// The URL of the webhook endpoint. + pub url: String, +} +impl stripe_types::Object for WebhookEndpoint { + type Id = stripe_misc::WebhookEndpointId; + fn id(&self) -> &Self::Id { + &self.id + } +} +stripe_types::def_id!(WebhookEndpointId, "we_"); diff --git a/generated/stripe_payment/Cargo.toml b/generated/stripe_payment/Cargo.toml new file mode 100644 index 000000000..5776be916 --- /dev/null +++ b/generated/stripe_payment/Cargo.toml @@ -0,0 +1,58 @@ +[package] +name = "stripe_payment" +version.workspace = true +description.workspace = true +edition.workspace = true +rust-version.workspace = true +authors.workspace = true +license.workspace = true +homepage.workspace = true +repository.workspace = true +keywords.workspace = true +categories.workspace = true + +[lib] +path = "src/mod.rs" + +[dependencies] +serde.workspace = true +smol_str.workspace = true +serde_json.workspace = true +stripe_types = {path = "../../stripe_types"} + +http-types.workspace = true +async-stripe = {path = "../../async-stripe"} + + +stripe_shared = {path = "../../generated/stripe_shared"} + + +[features] +runtime-tokio-hyper = ["async-stripe/runtime-tokio-hyper"] +runtime-tokio-hyper-rustls = ["async-stripe/runtime-tokio-hyper-rustls"] +runtime-tokio-hyper-rustls-webpki = ["async-stripe/runtime-tokio-hyper-rustls-webpki"] +runtime-blocking = ["async-stripe/runtime-blocking"] +runtime-blocking-rustls = ["async-stripe/runtime-blocking-rustls"] +runtime-blocking-rustls-webpki = ["async-stripe/runtime-blocking-rustls-webpki"] +runtime-async-std-surf = ["async-stripe/runtime-async-std-surf"] + +bank_account = [] +card = [] +payment_link = [] +payment_method = [] +payment_method_configuration = [] +payment_method_domain = [] +source = [] + +full = ["bank_account", +"card", +"payment_link", +"payment_method", +"payment_method_configuration", +"payment_method_domain", +"source"] + + +[package.metadata.docs.rs] +features = ["runtime-tokio-hyper", "full"] + diff --git a/generated/stripe_payment/src/bank_account/mod.rs b/generated/stripe_payment/src/bank_account/mod.rs new file mode 100644 index 000000000..b4b350671 --- /dev/null +++ b/generated/stripe_payment/src/bank_account/mod.rs @@ -0,0 +1,4 @@ +#[cfg(feature = "bank_account")] +mod requests; +#[cfg(feature = "bank_account")] +pub use requests::*; diff --git a/generated/stripe_payment/src/bank_account/requests.rs b/generated/stripe_payment/src/bank_account/requests.rs new file mode 100644 index 000000000..908638b89 --- /dev/null +++ b/generated/stripe_payment/src/bank_account/requests.rs @@ -0,0 +1,459 @@ +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct DeleteAccountBankAccount {} +impl DeleteAccountBankAccount { + pub fn new() -> Self { + Self::default() + } +} +impl DeleteAccountBankAccount { + /// Delete a specified external account for a given account. + pub fn send( + &self, + client: &stripe::Client, + account: &stripe_shared::AccountId, + id: &str, + ) -> stripe::Response { + client.send_form( + &format!("/accounts/{account}/external_accounts/{id}"), + self, + http_types::Method::Delete, + ) + } +} +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct DeleteCustomerBankAccount<'a> { + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, +} +impl<'a> DeleteCustomerBankAccount<'a> { + pub fn new() -> Self { + Self::default() + } +} +impl<'a> DeleteCustomerBankAccount<'a> { + /// Delete a specified source for a given customer. + pub fn send( + &self, + client: &stripe::Client, + customer: &stripe_shared::CustomerId, + id: &str, + ) -> stripe::Response { + client.send_form( + &format!("/customers/{customer}/sources/{id}"), + self, + http_types::Method::Delete, + ) + } +} +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +#[serde(untagged)] +pub enum DeleteCustomerBankAccountReturned { + PaymentSource(stripe_shared::PaymentSource), + DeletedPaymentSource(stripe_shared::DeletedPaymentSource), +} +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdateAccountBankAccount<'a> { + /// The name of the person or business that owns the bank account. + #[serde(skip_serializing_if = "Option::is_none")] + pub account_holder_name: Option<&'a str>, + /// The type of entity that holds the account. This can be either `individual` or `company`. + #[serde(skip_serializing_if = "Option::is_none")] + pub account_holder_type: Option, + /// The bank account type. + /// This can only be `checking` or `savings` in most countries. + /// In Japan, this can only be `futsu` or `toza`. + #[serde(skip_serializing_if = "Option::is_none")] + pub account_type: Option, + /// City/District/Suburb/Town/Village. + #[serde(skip_serializing_if = "Option::is_none")] + pub address_city: Option<&'a str>, + /// Billing address country, if provided when creating card. + #[serde(skip_serializing_if = "Option::is_none")] + pub address_country: Option<&'a str>, + /// Address line 1 (Street address/PO Box/Company name). + #[serde(skip_serializing_if = "Option::is_none")] + pub address_line1: Option<&'a str>, + /// Address line 2 (Apartment/Suite/Unit/Building). + #[serde(skip_serializing_if = "Option::is_none")] + pub address_line2: Option<&'a str>, + /// State/County/Province/Region. + #[serde(skip_serializing_if = "Option::is_none")] + pub address_state: Option<&'a str>, + /// ZIP or postal code. + #[serde(skip_serializing_if = "Option::is_none")] + pub address_zip: Option<&'a str>, + /// When set to true, this becomes the default external account for its currency. + #[serde(skip_serializing_if = "Option::is_none")] + pub default_for_currency: Option, + /// Documents that may be submitted to satisfy various informational requests. + #[serde(skip_serializing_if = "Option::is_none")] + pub documents: Option>, + /// Two digit number representing the card’s expiration month. + #[serde(skip_serializing_if = "Option::is_none")] + pub exp_month: Option<&'a str>, + /// Four digit number representing the card’s expiration year. + #[serde(skip_serializing_if = "Option::is_none")] + pub exp_year: Option<&'a str>, + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, + /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. + /// This can be useful for storing additional information about the object in a structured format. + /// Individual keys can be unset by posting an empty value to them. + /// All keys can be unset by posting an empty value to `metadata`. + #[serde(skip_serializing_if = "Option::is_none")] + pub metadata: Option<&'a std::collections::HashMap>, + /// Cardholder name. + #[serde(skip_serializing_if = "Option::is_none")] + pub name: Option<&'a str>, +} +impl<'a> UpdateAccountBankAccount<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// The type of entity that holds the account. This can be either `individual` or `company`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum UpdateAccountBankAccountAccountHolderType { + Company, + Individual, +} +impl UpdateAccountBankAccountAccountHolderType { + pub fn as_str(self) -> &'static str { + use UpdateAccountBankAccountAccountHolderType::*; + match self { + Company => "company", + Individual => "individual", + } + } +} + +impl std::str::FromStr for UpdateAccountBankAccountAccountHolderType { + type Err = (); + fn from_str(s: &str) -> Result { + use UpdateAccountBankAccountAccountHolderType::*; + match s { + "company" => Ok(Company), + "individual" => Ok(Individual), + _ => Err(()), + } + } +} +impl std::fmt::Display for UpdateAccountBankAccountAccountHolderType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for UpdateAccountBankAccountAccountHolderType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for UpdateAccountBankAccountAccountHolderType { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// The bank account type. +/// This can only be `checking` or `savings` in most countries. +/// In Japan, this can only be `futsu` or `toza`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum UpdateAccountBankAccountAccountType { + Checking, + Futsu, + Savings, + Toza, +} +impl UpdateAccountBankAccountAccountType { + pub fn as_str(self) -> &'static str { + use UpdateAccountBankAccountAccountType::*; + match self { + Checking => "checking", + Futsu => "futsu", + Savings => "savings", + Toza => "toza", + } + } +} + +impl std::str::FromStr for UpdateAccountBankAccountAccountType { + type Err = (); + fn from_str(s: &str) -> Result { + use UpdateAccountBankAccountAccountType::*; + match s { + "checking" => Ok(Checking), + "futsu" => Ok(Futsu), + "savings" => Ok(Savings), + "toza" => Ok(Toza), + _ => Err(()), + } + } +} +impl std::fmt::Display for UpdateAccountBankAccountAccountType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for UpdateAccountBankAccountAccountType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for UpdateAccountBankAccountAccountType { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Documents that may be submitted to satisfy various informational requests. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdateAccountBankAccountDocuments<'a> { + /// One or more documents that support the [Bank account ownership verification](https://support.stripe.com/questions/bank-account-ownership-verification) requirement. + /// Must be a document associated with the bank account that displays the last 4 digits of the account number, either a statement or a voided check. + #[serde(skip_serializing_if = "Option::is_none")] + pub bank_account_ownership_verification: + Option>, +} +impl<'a> UpdateAccountBankAccountDocuments<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// One or more documents that support the [Bank account ownership verification](https://support.stripe.com/questions/bank-account-ownership-verification) requirement. +/// Must be a document associated with the bank account that displays the last 4 digits of the account number, either a statement or a voided check. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdateAccountBankAccountDocumentsBankAccountOwnershipVerification<'a> { + /// One or more document ids returned by a [file upload](https://stripe.com/docs/api#create_file) with a `purpose` value of `account_requirement`. + #[serde(skip_serializing_if = "Option::is_none")] + pub files: Option<&'a [&'a str]>, +} +impl<'a> UpdateAccountBankAccountDocumentsBankAccountOwnershipVerification<'a> { + pub fn new() -> Self { + Self::default() + } +} +impl<'a> UpdateAccountBankAccount<'a> { + /// Updates the metadata, account holder name, account holder type of a bank account belonging to a [Custom account](https://stripe.com/docs/connect/custom-accounts), and optionally sets it as the default for its currency. + /// Other bank account details are not editable by design. + /// + /// You can re-enable a disabled bank account by performing an update call without providing any arguments or changes. + pub fn send( + &self, + client: &stripe::Client, + account: &stripe_shared::AccountId, + id: &str, + ) -> stripe::Response { + client.send_form( + &format!("/accounts/{account}/external_accounts/{id}"), + self, + http_types::Method::Post, + ) + } +} +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdateCustomerBankAccount<'a> { + /// The name of the person or business that owns the bank account. + #[serde(skip_serializing_if = "Option::is_none")] + pub account_holder_name: Option<&'a str>, + /// The type of entity that holds the account. This can be either `individual` or `company`. + #[serde(skip_serializing_if = "Option::is_none")] + pub account_holder_type: Option, + /// City/District/Suburb/Town/Village. + #[serde(skip_serializing_if = "Option::is_none")] + pub address_city: Option<&'a str>, + /// Billing address country, if provided when creating card. + #[serde(skip_serializing_if = "Option::is_none")] + pub address_country: Option<&'a str>, + /// Address line 1 (Street address/PO Box/Company name). + #[serde(skip_serializing_if = "Option::is_none")] + pub address_line1: Option<&'a str>, + /// Address line 2 (Apartment/Suite/Unit/Building). + #[serde(skip_serializing_if = "Option::is_none")] + pub address_line2: Option<&'a str>, + /// State/County/Province/Region. + #[serde(skip_serializing_if = "Option::is_none")] + pub address_state: Option<&'a str>, + /// ZIP or postal code. + #[serde(skip_serializing_if = "Option::is_none")] + pub address_zip: Option<&'a str>, + /// Two digit number representing the card’s expiration month. + #[serde(skip_serializing_if = "Option::is_none")] + pub exp_month: Option<&'a str>, + /// Four digit number representing the card’s expiration year. + #[serde(skip_serializing_if = "Option::is_none")] + pub exp_year: Option<&'a str>, + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, + /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. + /// This can be useful for storing additional information about the object in a structured format. + /// Individual keys can be unset by posting an empty value to them. + /// All keys can be unset by posting an empty value to `metadata`. + #[serde(skip_serializing_if = "Option::is_none")] + pub metadata: Option<&'a std::collections::HashMap>, + /// Cardholder name. + #[serde(skip_serializing_if = "Option::is_none")] + pub name: Option<&'a str>, + #[serde(skip_serializing_if = "Option::is_none")] + pub owner: Option>, +} +impl<'a> UpdateCustomerBankAccount<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// The type of entity that holds the account. This can be either `individual` or `company`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum UpdateCustomerBankAccountAccountHolderType { + Company, + Individual, +} +impl UpdateCustomerBankAccountAccountHolderType { + pub fn as_str(self) -> &'static str { + use UpdateCustomerBankAccountAccountHolderType::*; + match self { + Company => "company", + Individual => "individual", + } + } +} + +impl std::str::FromStr for UpdateCustomerBankAccountAccountHolderType { + type Err = (); + fn from_str(s: &str) -> Result { + use UpdateCustomerBankAccountAccountHolderType::*; + match s { + "company" => Ok(Company), + "individual" => Ok(Individual), + _ => Err(()), + } + } +} +impl std::fmt::Display for UpdateCustomerBankAccountAccountHolderType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for UpdateCustomerBankAccountAccountHolderType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for UpdateCustomerBankAccountAccountHolderType { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdateCustomerBankAccountOwner<'a> { + /// Owner's address. + #[serde(skip_serializing_if = "Option::is_none")] + pub address: Option>, + /// Owner's email address. + #[serde(skip_serializing_if = "Option::is_none")] + pub email: Option<&'a str>, + /// Owner's full name. + #[serde(skip_serializing_if = "Option::is_none")] + pub name: Option<&'a str>, + /// Owner's phone number. + #[serde(skip_serializing_if = "Option::is_none")] + pub phone: Option<&'a str>, +} +impl<'a> UpdateCustomerBankAccountOwner<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// Owner's address. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdateCustomerBankAccountOwnerAddress<'a> { + /// City, district, suburb, town, or village. + #[serde(skip_serializing_if = "Option::is_none")] + pub city: Option<&'a str>, + /// Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). + #[serde(skip_serializing_if = "Option::is_none")] + pub country: Option<&'a str>, + /// Address line 1 (e.g., street, PO Box, or company name). + #[serde(skip_serializing_if = "Option::is_none")] + pub line1: Option<&'a str>, + /// Address line 2 (e.g., apartment, suite, unit, or building). + #[serde(skip_serializing_if = "Option::is_none")] + pub line2: Option<&'a str>, + /// ZIP or postal code. + #[serde(skip_serializing_if = "Option::is_none")] + pub postal_code: Option<&'a str>, + /// State, county, province, or region. + #[serde(skip_serializing_if = "Option::is_none")] + pub state: Option<&'a str>, +} +impl<'a> UpdateCustomerBankAccountOwnerAddress<'a> { + pub fn new() -> Self { + Self::default() + } +} +impl<'a> UpdateCustomerBankAccount<'a> { + /// Update a specified source for a given customer. + pub fn send( + &self, + client: &stripe::Client, + customer: &stripe_shared::CustomerId, + id: &str, + ) -> stripe::Response { + client.send_form( + &format!("/customers/{customer}/sources/{id}"), + self, + http_types::Method::Post, + ) + } +} +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +#[serde(tag = "object")] +pub enum UpdateCustomerBankAccountReturned { + #[serde(rename = "card")] + Card(stripe_shared::Card), + #[serde(rename = "bank_account")] + BankAccount(stripe_shared::BankAccount), + #[serde(rename = "source")] + Source(stripe_shared::Source), +} +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct VerifyBankAccount<'a> { + /// Two positive integers, in *cents*, equal to the values of the microdeposits sent to the bank account. + #[serde(skip_serializing_if = "Option::is_none")] + pub amounts: Option<&'a [i64]>, + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, +} +impl<'a> VerifyBankAccount<'a> { + pub fn new() -> Self { + Self::default() + } +} +impl<'a> VerifyBankAccount<'a> { + /// Verify a specified bank account for a given customer. + pub fn send( + &self, + client: &stripe::Client, + customer: &stripe_shared::CustomerId, + id: &str, + ) -> stripe::Response { + client.send_form( + &format!("/customers/{customer}/sources/{id}/verify"), + self, + http_types::Method::Post, + ) + } +} diff --git a/generated/stripe_payment/src/card/mod.rs b/generated/stripe_payment/src/card/mod.rs new file mode 100644 index 000000000..c459b0216 --- /dev/null +++ b/generated/stripe_payment/src/card/mod.rs @@ -0,0 +1,4 @@ +#[cfg(feature = "card")] +mod requests; +#[cfg(feature = "card")] +pub use requests::*; diff --git a/generated/stripe_payment/src/card/requests.rs b/generated/stripe_payment/src/card/requests.rs new file mode 100644 index 000000000..37fe3124b --- /dev/null +++ b/generated/stripe_payment/src/card/requests.rs @@ -0,0 +1,430 @@ +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct DeleteAccountCard {} +impl DeleteAccountCard { + pub fn new() -> Self { + Self::default() + } +} +impl DeleteAccountCard { + /// Delete a specified external account for a given account. + pub fn send( + &self, + client: &stripe::Client, + account: &stripe_shared::AccountId, + id: &str, + ) -> stripe::Response { + client.send_form( + &format!("/accounts/{account}/external_accounts/{id}"), + self, + http_types::Method::Delete, + ) + } +} +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct DeleteCustomerCard<'a> { + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, +} +impl<'a> DeleteCustomerCard<'a> { + pub fn new() -> Self { + Self::default() + } +} +impl<'a> DeleteCustomerCard<'a> { + /// Delete a specified source for a given customer. + pub fn send( + &self, + client: &stripe::Client, + customer: &stripe_shared::CustomerId, + id: &str, + ) -> stripe::Response { + client.send_form( + &format!("/customers/{customer}/sources/{id}"), + self, + http_types::Method::Delete, + ) + } +} +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +#[serde(untagged)] +pub enum DeleteCustomerCardReturned { + PaymentSource(stripe_shared::PaymentSource), + DeletedPaymentSource(stripe_shared::DeletedPaymentSource), +} +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdateAccountCard<'a> { + /// The name of the person or business that owns the bank account. + #[serde(skip_serializing_if = "Option::is_none")] + pub account_holder_name: Option<&'a str>, + /// The type of entity that holds the account. This can be either `individual` or `company`. + #[serde(skip_serializing_if = "Option::is_none")] + pub account_holder_type: Option, + /// The bank account type. + /// This can only be `checking` or `savings` in most countries. + /// In Japan, this can only be `futsu` or `toza`. + #[serde(skip_serializing_if = "Option::is_none")] + pub account_type: Option, + /// City/District/Suburb/Town/Village. + #[serde(skip_serializing_if = "Option::is_none")] + pub address_city: Option<&'a str>, + /// Billing address country, if provided when creating card. + #[serde(skip_serializing_if = "Option::is_none")] + pub address_country: Option<&'a str>, + /// Address line 1 (Street address/PO Box/Company name). + #[serde(skip_serializing_if = "Option::is_none")] + pub address_line1: Option<&'a str>, + /// Address line 2 (Apartment/Suite/Unit/Building). + #[serde(skip_serializing_if = "Option::is_none")] + pub address_line2: Option<&'a str>, + /// State/County/Province/Region. + #[serde(skip_serializing_if = "Option::is_none")] + pub address_state: Option<&'a str>, + /// ZIP or postal code. + #[serde(skip_serializing_if = "Option::is_none")] + pub address_zip: Option<&'a str>, + /// When set to true, this becomes the default external account for its currency. + #[serde(skip_serializing_if = "Option::is_none")] + pub default_for_currency: Option, + /// Documents that may be submitted to satisfy various informational requests. + #[serde(skip_serializing_if = "Option::is_none")] + pub documents: Option>, + /// Two digit number representing the card’s expiration month. + #[serde(skip_serializing_if = "Option::is_none")] + pub exp_month: Option<&'a str>, + /// Four digit number representing the card’s expiration year. + #[serde(skip_serializing_if = "Option::is_none")] + pub exp_year: Option<&'a str>, + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, + /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. + /// This can be useful for storing additional information about the object in a structured format. + /// Individual keys can be unset by posting an empty value to them. + /// All keys can be unset by posting an empty value to `metadata`. + #[serde(skip_serializing_if = "Option::is_none")] + pub metadata: Option<&'a std::collections::HashMap>, + /// Cardholder name. + #[serde(skip_serializing_if = "Option::is_none")] + pub name: Option<&'a str>, +} +impl<'a> UpdateAccountCard<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// The type of entity that holds the account. This can be either `individual` or `company`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum UpdateAccountCardAccountHolderType { + Company, + Individual, +} +impl UpdateAccountCardAccountHolderType { + pub fn as_str(self) -> &'static str { + use UpdateAccountCardAccountHolderType::*; + match self { + Company => "company", + Individual => "individual", + } + } +} + +impl std::str::FromStr for UpdateAccountCardAccountHolderType { + type Err = (); + fn from_str(s: &str) -> Result { + use UpdateAccountCardAccountHolderType::*; + match s { + "company" => Ok(Company), + "individual" => Ok(Individual), + _ => Err(()), + } + } +} +impl std::fmt::Display for UpdateAccountCardAccountHolderType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for UpdateAccountCardAccountHolderType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for UpdateAccountCardAccountHolderType { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// The bank account type. +/// This can only be `checking` or `savings` in most countries. +/// In Japan, this can only be `futsu` or `toza`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum UpdateAccountCardAccountType { + Checking, + Futsu, + Savings, + Toza, +} +impl UpdateAccountCardAccountType { + pub fn as_str(self) -> &'static str { + use UpdateAccountCardAccountType::*; + match self { + Checking => "checking", + Futsu => "futsu", + Savings => "savings", + Toza => "toza", + } + } +} + +impl std::str::FromStr for UpdateAccountCardAccountType { + type Err = (); + fn from_str(s: &str) -> Result { + use UpdateAccountCardAccountType::*; + match s { + "checking" => Ok(Checking), + "futsu" => Ok(Futsu), + "savings" => Ok(Savings), + "toza" => Ok(Toza), + _ => Err(()), + } + } +} +impl std::fmt::Display for UpdateAccountCardAccountType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for UpdateAccountCardAccountType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for UpdateAccountCardAccountType { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Documents that may be submitted to satisfy various informational requests. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdateAccountCardDocuments<'a> { + /// One or more documents that support the [Bank account ownership verification](https://support.stripe.com/questions/bank-account-ownership-verification) requirement. + /// Must be a document associated with the bank account that displays the last 4 digits of the account number, either a statement or a voided check. + #[serde(skip_serializing_if = "Option::is_none")] + pub bank_account_ownership_verification: + Option>, +} +impl<'a> UpdateAccountCardDocuments<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// One or more documents that support the [Bank account ownership verification](https://support.stripe.com/questions/bank-account-ownership-verification) requirement. +/// Must be a document associated with the bank account that displays the last 4 digits of the account number, either a statement or a voided check. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdateAccountCardDocumentsBankAccountOwnershipVerification<'a> { + /// One or more document ids returned by a [file upload](https://stripe.com/docs/api#create_file) with a `purpose` value of `account_requirement`. + #[serde(skip_serializing_if = "Option::is_none")] + pub files: Option<&'a [&'a str]>, +} +impl<'a> UpdateAccountCardDocumentsBankAccountOwnershipVerification<'a> { + pub fn new() -> Self { + Self::default() + } +} +impl<'a> UpdateAccountCard<'a> { + /// Updates the metadata, account holder name, account holder type of a bank account belonging to a [Custom account](https://stripe.com/docs/connect/custom-accounts), and optionally sets it as the default for its currency. + /// Other bank account details are not editable by design. + /// + /// You can re-enable a disabled bank account by performing an update call without providing any arguments or changes. + pub fn send( + &self, + client: &stripe::Client, + account: &stripe_shared::AccountId, + id: &str, + ) -> stripe::Response { + client.send_form( + &format!("/accounts/{account}/external_accounts/{id}"), + self, + http_types::Method::Post, + ) + } +} +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdateCustomerCard<'a> { + /// The name of the person or business that owns the bank account. + #[serde(skip_serializing_if = "Option::is_none")] + pub account_holder_name: Option<&'a str>, + /// The type of entity that holds the account. This can be either `individual` or `company`. + #[serde(skip_serializing_if = "Option::is_none")] + pub account_holder_type: Option, + /// City/District/Suburb/Town/Village. + #[serde(skip_serializing_if = "Option::is_none")] + pub address_city: Option<&'a str>, + /// Billing address country, if provided when creating card. + #[serde(skip_serializing_if = "Option::is_none")] + pub address_country: Option<&'a str>, + /// Address line 1 (Street address/PO Box/Company name). + #[serde(skip_serializing_if = "Option::is_none")] + pub address_line1: Option<&'a str>, + /// Address line 2 (Apartment/Suite/Unit/Building). + #[serde(skip_serializing_if = "Option::is_none")] + pub address_line2: Option<&'a str>, + /// State/County/Province/Region. + #[serde(skip_serializing_if = "Option::is_none")] + pub address_state: Option<&'a str>, + /// ZIP or postal code. + #[serde(skip_serializing_if = "Option::is_none")] + pub address_zip: Option<&'a str>, + /// Two digit number representing the card’s expiration month. + #[serde(skip_serializing_if = "Option::is_none")] + pub exp_month: Option<&'a str>, + /// Four digit number representing the card’s expiration year. + #[serde(skip_serializing_if = "Option::is_none")] + pub exp_year: Option<&'a str>, + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, + /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. + /// This can be useful for storing additional information about the object in a structured format. + /// Individual keys can be unset by posting an empty value to them. + /// All keys can be unset by posting an empty value to `metadata`. + #[serde(skip_serializing_if = "Option::is_none")] + pub metadata: Option<&'a std::collections::HashMap>, + /// Cardholder name. + #[serde(skip_serializing_if = "Option::is_none")] + pub name: Option<&'a str>, + #[serde(skip_serializing_if = "Option::is_none")] + pub owner: Option>, +} +impl<'a> UpdateCustomerCard<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// The type of entity that holds the account. This can be either `individual` or `company`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum UpdateCustomerCardAccountHolderType { + Company, + Individual, +} +impl UpdateCustomerCardAccountHolderType { + pub fn as_str(self) -> &'static str { + use UpdateCustomerCardAccountHolderType::*; + match self { + Company => "company", + Individual => "individual", + } + } +} + +impl std::str::FromStr for UpdateCustomerCardAccountHolderType { + type Err = (); + fn from_str(s: &str) -> Result { + use UpdateCustomerCardAccountHolderType::*; + match s { + "company" => Ok(Company), + "individual" => Ok(Individual), + _ => Err(()), + } + } +} +impl std::fmt::Display for UpdateCustomerCardAccountHolderType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for UpdateCustomerCardAccountHolderType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for UpdateCustomerCardAccountHolderType { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdateCustomerCardOwner<'a> { + /// Owner's address. + #[serde(skip_serializing_if = "Option::is_none")] + pub address: Option>, + /// Owner's email address. + #[serde(skip_serializing_if = "Option::is_none")] + pub email: Option<&'a str>, + /// Owner's full name. + #[serde(skip_serializing_if = "Option::is_none")] + pub name: Option<&'a str>, + /// Owner's phone number. + #[serde(skip_serializing_if = "Option::is_none")] + pub phone: Option<&'a str>, +} +impl<'a> UpdateCustomerCardOwner<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// Owner's address. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdateCustomerCardOwnerAddress<'a> { + /// City, district, suburb, town, or village. + #[serde(skip_serializing_if = "Option::is_none")] + pub city: Option<&'a str>, + /// Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). + #[serde(skip_serializing_if = "Option::is_none")] + pub country: Option<&'a str>, + /// Address line 1 (e.g., street, PO Box, or company name). + #[serde(skip_serializing_if = "Option::is_none")] + pub line1: Option<&'a str>, + /// Address line 2 (e.g., apartment, suite, unit, or building). + #[serde(skip_serializing_if = "Option::is_none")] + pub line2: Option<&'a str>, + /// ZIP or postal code. + #[serde(skip_serializing_if = "Option::is_none")] + pub postal_code: Option<&'a str>, + /// State, county, province, or region. + #[serde(skip_serializing_if = "Option::is_none")] + pub state: Option<&'a str>, +} +impl<'a> UpdateCustomerCardOwnerAddress<'a> { + pub fn new() -> Self { + Self::default() + } +} +impl<'a> UpdateCustomerCard<'a> { + /// Update a specified source for a given customer. + pub fn send( + &self, + client: &stripe::Client, + customer: &stripe_shared::CustomerId, + id: &str, + ) -> stripe::Response { + client.send_form( + &format!("/customers/{customer}/sources/{id}"), + self, + http_types::Method::Post, + ) + } +} +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +#[serde(tag = "object")] +pub enum UpdateCustomerCardReturned { + #[serde(rename = "card")] + Card(stripe_shared::Card), + #[serde(rename = "bank_account")] + BankAccount(stripe_shared::BankAccount), + #[serde(rename = "source")] + Source(stripe_shared::Source), +} diff --git a/generated/stripe_payment/src/mod.rs b/generated/stripe_payment/src/mod.rs new file mode 100644 index 000000000..b720fbeaa --- /dev/null +++ b/generated/stripe_payment/src/mod.rs @@ -0,0 +1,252 @@ +#![recursion_limit = "256"] +#![allow(clippy::large_enum_variant)] +#![allow(rustdoc::broken_intra_doc_links)] +#![allow(rustdoc::invalid_html_tags)] + +//! This crate provides Rust bindings to the Stripe HTTP API, specifically +//! for requests mentioned in the `Payment Methods` and `Payment Links` sections +//! of the [Stripe API docs](https://stripe.com/docs/api) + +extern crate self as stripe_payment; +pub mod bank_account; +pub use stripe_shared::bank_account::*; +pub mod card; +pub use stripe_shared::card::*;pub use stripe_shared::card_issuing_account_terms_of_service::*;pub use stripe_shared::card_mandate_payment_method_details::*;pub use stripe_shared::deleted_bank_account::*;pub use stripe_shared::deleted_card::*;pub use stripe_shared::deleted_external_account::*;pub use stripe_shared::deleted_payment_source::*;pub use stripe_shared::external_account_requirements::*;pub use stripe_shared::networks::*;pub use stripe_shared::us_bank_account_networks::*;pub use stripe_shared::payment_flows_private_payment_methods_alipay::*;pub use stripe_shared::payment_flows_private_payment_methods_alipay_details::*;pub use stripe_shared::payment_flows_private_payment_methods_card_details_api_resource_enterprise_features_extended_authorization_extended_authorization::*;pub use stripe_shared::payment_flows_private_payment_methods_card_details_api_resource_enterprise_features_incremental_authorization_incremental_authorization::*;pub use stripe_shared::payment_flows_private_payment_methods_card_details_api_resource_enterprise_features_overcapture_overcapture::*;pub use stripe_shared::payment_flows_private_payment_methods_card_details_api_resource_multicapture::*;pub use stripe_shared::payment_flows_private_payment_methods_klarna_dob::*; +pub mod payment_link; +pub use stripe_shared::payment_link::*; +pub use stripe_shared::payment_links_resource_after_completion::*; +pub use stripe_shared::payment_links_resource_automatic_tax::*; +pub use stripe_shared::payment_links_resource_completed_sessions::*; +pub use stripe_shared::payment_links_resource_completion_behavior_confirmation_page::*; +pub use stripe_shared::payment_links_resource_completion_behavior_redirect::*; +pub use stripe_shared::payment_links_resource_consent_collection::*; +pub use stripe_shared::payment_links_resource_custom_fields::*; +pub use stripe_shared::payment_links_resource_custom_fields_dropdown::*; +pub use stripe_shared::payment_links_resource_custom_fields_dropdown_option::*; +pub use stripe_shared::payment_links_resource_custom_fields_label::*; +pub use stripe_shared::payment_links_resource_custom_fields_numeric::*; +pub use stripe_shared::payment_links_resource_custom_fields_text::*; +pub use stripe_shared::payment_links_resource_custom_text::*; +pub use stripe_shared::payment_links_resource_custom_text_position::*; +pub use stripe_shared::payment_links_resource_invoice_creation::*; +pub use stripe_shared::payment_links_resource_invoice_settings::*; +pub use stripe_shared::payment_links_resource_payment_intent_data::*; +pub use stripe_shared::payment_links_resource_payment_method_reuse_agreement::*; +pub use stripe_shared::payment_links_resource_phone_number_collection::*; +pub use stripe_shared::payment_links_resource_restrictions::*; +pub use stripe_shared::payment_links_resource_shipping_address_collection::*; +pub use stripe_shared::payment_links_resource_shipping_option::*; +pub use stripe_shared::payment_links_resource_subscription_data::*; +pub use stripe_shared::payment_links_resource_subscription_data_invoice_settings::*; +pub use stripe_shared::payment_links_resource_tax_id_collection::*; +pub use stripe_shared::payment_links_resource_transfer_data::*; +pub mod payment_method; +pub use stripe_shared::payment_method::*; +pub use stripe_shared::payment_method_acss_debit::*; +pub use stripe_shared::payment_method_affirm::*; +pub use stripe_shared::payment_method_afterpay_clearpay::*; +pub use stripe_shared::payment_method_au_becs_debit::*; +pub use stripe_shared::payment_method_bacs_debit::*; +pub use stripe_shared::payment_method_bancontact::*; +pub use stripe_shared::payment_method_blik::*; +pub use stripe_shared::payment_method_boleto::*; +pub use stripe_shared::payment_method_card::*; +pub use stripe_shared::payment_method_card_checks::*; +pub use stripe_shared::payment_method_card_present::*; +pub use stripe_shared::payment_method_card_present_networks::*; +pub use stripe_shared::payment_method_card_wallet::*; +pub use stripe_shared::payment_method_card_wallet_amex_express_checkout::*; +pub use stripe_shared::payment_method_card_wallet_apple_pay::*; +pub use stripe_shared::payment_method_card_wallet_google_pay::*; +pub use stripe_shared::payment_method_card_wallet_link::*; +pub use stripe_shared::payment_method_card_wallet_masterpass::*; +pub use stripe_shared::payment_method_card_wallet_samsung_pay::*; +pub use stripe_shared::payment_method_card_wallet_visa_checkout::*; +pub use stripe_shared::payment_method_cashapp::*; +pub use stripe_shared::payment_method_config_biz_payment_method_configuration_details::*; +#[doc(hidden)] +pub mod payment_method_config_resource_display_preference; +#[doc(inline)] +pub use payment_method_config_resource_display_preference::*; +#[doc(hidden)] +pub mod payment_method_config_resource_payment_method_properties; +#[doc(inline)] +pub use payment_method_config_resource_payment_method_properties::*; +pub use payment_method_configuration::types::*; +pub mod payment_method_configuration; +pub use payment_method_domain::types::*; +pub use stripe_shared::payment_method_customer_balance::*; +pub use stripe_shared::payment_method_details::*; +pub use stripe_shared::payment_method_details_ach_credit_transfer::*; +pub use stripe_shared::payment_method_details_ach_debit::*; +pub use stripe_shared::payment_method_details_acss_debit::*; +pub use stripe_shared::payment_method_details_affirm::*; +pub use stripe_shared::payment_method_details_afterpay_clearpay::*; +pub use stripe_shared::payment_method_details_au_becs_debit::*; +pub use stripe_shared::payment_method_details_bacs_debit::*; +pub use stripe_shared::payment_method_details_bancontact::*; +pub use stripe_shared::payment_method_details_blik::*; +pub use stripe_shared::payment_method_details_boleto::*; +pub use stripe_shared::payment_method_details_card::*; +pub use stripe_shared::payment_method_details_card_checks::*; +pub use stripe_shared::payment_method_details_card_installments::*; +pub use stripe_shared::payment_method_details_card_installments_plan::*; +pub use stripe_shared::payment_method_details_card_network_token::*; +pub use stripe_shared::payment_method_details_card_present::*; +pub use stripe_shared::payment_method_details_card_present_offline::*; +pub use stripe_shared::payment_method_details_card_present_receipt::*; +pub use stripe_shared::payment_method_details_card_wallet::*; +pub use stripe_shared::payment_method_details_card_wallet_amex_express_checkout::*; +pub use stripe_shared::payment_method_details_card_wallet_apple_pay::*; +pub use stripe_shared::payment_method_details_card_wallet_google_pay::*; +pub use stripe_shared::payment_method_details_card_wallet_link::*; +pub use stripe_shared::payment_method_details_card_wallet_masterpass::*; +pub use stripe_shared::payment_method_details_card_wallet_samsung_pay::*; +pub use stripe_shared::payment_method_details_card_wallet_visa_checkout::*; +pub use stripe_shared::payment_method_details_cashapp::*; +pub use stripe_shared::payment_method_details_customer_balance::*; +pub use stripe_shared::payment_method_details_eps::*; +pub use stripe_shared::payment_method_details_fpx::*; +pub use stripe_shared::payment_method_details_giropay::*; +pub use stripe_shared::payment_method_details_grabpay::*; +pub use stripe_shared::payment_method_details_ideal::*; +pub use stripe_shared::payment_method_details_interac_present::*; +pub use stripe_shared::payment_method_details_interac_present_receipt::*; +pub use stripe_shared::payment_method_details_klarna::*; +pub use stripe_shared::payment_method_details_konbini::*; +pub use stripe_shared::payment_method_details_konbini_store::*; +pub use stripe_shared::payment_method_details_link::*; +pub use stripe_shared::payment_method_details_multibanco::*; +pub use stripe_shared::payment_method_details_oxxo::*; +pub use stripe_shared::payment_method_details_p24::*; +pub use stripe_shared::payment_method_details_paynow::*; +pub use stripe_shared::payment_method_details_paypal::*; +pub use stripe_shared::payment_method_details_pix::*; +pub use stripe_shared::payment_method_details_promptpay::*; +pub use stripe_shared::payment_method_details_revolut_pay::*; +pub use stripe_shared::payment_method_details_sepa_credit_transfer::*; +pub use stripe_shared::payment_method_details_sepa_debit::*; +pub use stripe_shared::payment_method_details_sofort::*; +pub use stripe_shared::payment_method_details_stripe_account::*; +pub use stripe_shared::payment_method_details_swish::*; +pub use stripe_shared::payment_method_details_us_bank_account::*; +pub use stripe_shared::payment_method_details_wechat::*; +pub use stripe_shared::payment_method_details_wechat_pay::*; +pub use stripe_shared::payment_method_details_zip::*; +pub mod payment_method_domain; +#[doc(hidden)] +pub mod payment_method_domain_resource_payment_method_status; +#[doc(inline)] +pub use payment_method_domain_resource_payment_method_status::*; +#[doc(hidden)] +pub mod payment_method_domain_resource_payment_method_status_details; +#[doc(inline)] +pub use payment_method_domain_resource_payment_method_status_details::*; +pub use stripe_shared::payment_method_eps::*; +pub use stripe_shared::payment_method_fpx::*; +pub use stripe_shared::payment_method_giropay::*; +pub use stripe_shared::payment_method_grabpay::*; +pub use stripe_shared::payment_method_ideal::*; +pub use stripe_shared::payment_method_interac_present::*; +pub use stripe_shared::payment_method_klarna::*; +pub use stripe_shared::payment_method_konbini::*; +pub use stripe_shared::payment_method_link::*; +pub use stripe_shared::payment_method_options_affirm::*; +pub use stripe_shared::payment_method_options_afterpay_clearpay::*; +pub use stripe_shared::payment_method_options_alipay::*; +pub use stripe_shared::payment_method_options_bacs_debit::*; +pub use stripe_shared::payment_method_options_bancontact::*; +pub use stripe_shared::payment_method_options_boleto::*; +pub use stripe_shared::payment_method_options_card_installments::*; +pub use stripe_shared::payment_method_options_card_mandate_options::*; +pub use stripe_shared::payment_method_options_card_present::*; +pub use stripe_shared::payment_method_options_cashapp::*; +pub use stripe_shared::payment_method_options_customer_balance::*; +pub use stripe_shared::payment_method_options_customer_balance_bank_transfer::*; +pub use stripe_shared::payment_method_options_customer_balance_eu_bank_account::*; +pub use stripe_shared::payment_method_options_fpx::*; +pub use stripe_shared::payment_method_options_giropay::*; +pub use stripe_shared::payment_method_options_grabpay::*; +pub use stripe_shared::payment_method_options_ideal::*; +pub use stripe_shared::payment_method_options_interac_present::*; +pub use stripe_shared::payment_method_options_klarna::*; +pub use stripe_shared::payment_method_options_konbini::*; +pub use stripe_shared::payment_method_options_oxxo::*; +pub use stripe_shared::payment_method_options_p24::*; +pub use stripe_shared::payment_method_options_paynow::*; +pub use stripe_shared::payment_method_options_paypal::*; +pub use stripe_shared::payment_method_options_pix::*; +pub use stripe_shared::payment_method_options_promptpay::*; +pub use stripe_shared::payment_method_options_revolut_pay::*; +pub use stripe_shared::payment_method_options_sofort::*; +pub use stripe_shared::payment_method_options_us_bank_account_mandate_options::*; +pub use stripe_shared::payment_method_options_wechat_pay::*; +pub use stripe_shared::payment_method_options_zip::*; +pub use stripe_shared::payment_method_oxxo::*; +pub use stripe_shared::payment_method_p24::*; +pub use stripe_shared::payment_method_paynow::*; +pub use stripe_shared::payment_method_paypal::*; +pub use stripe_shared::payment_method_pix::*; +pub use stripe_shared::payment_method_promptpay::*; +pub use stripe_shared::payment_method_revolut_pay::*; +pub use stripe_shared::payment_method_sepa_debit::*; +pub use stripe_shared::payment_method_sofort::*; +pub use stripe_shared::payment_method_swish::*; +pub use stripe_shared::payment_method_us_bank_account::*; +pub use stripe_shared::payment_method_us_bank_account_blocked::*; +pub use stripe_shared::payment_method_us_bank_account_status_details::*; +pub use stripe_shared::payment_method_wechat_pay::*; +pub use stripe_shared::payment_method_zip::*; +pub use stripe_shared::paypal_seller_protection::*; +pub use stripe_shared::sepa_debit_generated_from::*; +pub mod source; +pub use stripe_shared::source::*; +pub use stripe_shared::source_code_verification_flow::*; +#[doc(hidden)] +pub mod source_mandate_notification; +#[doc(inline)] +pub use source_mandate_notification::*; +#[doc(hidden)] +pub mod source_mandate_notification_acss_debit_data; +#[doc(inline)] +pub use source_mandate_notification_acss_debit_data::*; +#[doc(hidden)] +pub mod source_mandate_notification_bacs_debit_data; +#[doc(inline)] +pub use source_mandate_notification_bacs_debit_data::*; +#[doc(hidden)] +pub mod source_mandate_notification_sepa_debit_data; +#[doc(inline)] +pub use source_mandate_notification_sepa_debit_data::*; +pub use stripe_shared::source_order::*; +pub use stripe_shared::source_order_item::*; +pub use stripe_shared::source_owner::*; +pub use stripe_shared::source_receiver_flow::*; +pub use stripe_shared::source_redirect_flow::*; +pub use stripe_shared::source_transaction::*; +pub use stripe_shared::source_transaction_ach_credit_transfer_data::*; +pub use stripe_shared::source_transaction_chf_credit_transfer_data::*; +pub use stripe_shared::source_transaction_gbp_credit_transfer_data::*; +pub use stripe_shared::source_transaction_paper_check_data::*; +pub use stripe_shared::source_transaction_sepa_credit_transfer_data::*; +pub use stripe_shared::source_type_ach_credit_transfer::*; +pub use stripe_shared::source_type_ach_debit::*; +pub use stripe_shared::source_type_acss_debit::*; +pub use stripe_shared::source_type_alipay::*; +pub use stripe_shared::source_type_au_becs_debit::*; +pub use stripe_shared::source_type_bancontact::*; +pub use stripe_shared::source_type_card::*; +pub use stripe_shared::source_type_card_present::*; +pub use stripe_shared::source_type_eps::*; +pub use stripe_shared::source_type_giropay::*; +pub use stripe_shared::source_type_ideal::*; +pub use stripe_shared::source_type_klarna::*; +pub use stripe_shared::source_type_multibanco::*; +pub use stripe_shared::source_type_p24::*; +pub use stripe_shared::source_type_sepa_credit_transfer::*; +pub use stripe_shared::source_type_sepa_debit::*; +pub use stripe_shared::source_type_sofort::*; +pub use stripe_shared::source_type_three_d_secure::*; +pub use stripe_shared::source_type_wechat::*; +pub use stripe_shared::three_d_secure_details_charge::*; +pub use stripe_shared::three_d_secure_usage::*; diff --git a/generated/stripe_payment/src/payment_link/mod.rs b/generated/stripe_payment/src/payment_link/mod.rs new file mode 100644 index 000000000..6850291df --- /dev/null +++ b/generated/stripe_payment/src/payment_link/mod.rs @@ -0,0 +1,4 @@ +#[cfg(feature = "payment_link")] +mod requests; +#[cfg(feature = "payment_link")] +pub use requests::*; diff --git a/generated/stripe_payment/src/payment_link/requests.rs b/generated/stripe_payment/src/payment_link/requests.rs new file mode 100644 index 000000000..14fde7ad6 --- /dev/null +++ b/generated/stripe_payment/src/payment_link/requests.rs @@ -0,0 +1,4025 @@ +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct ListPaymentLink<'a> { + /// Only return payment links that are active or inactive (e.g., pass `false` to list all inactive payment links). + #[serde(skip_serializing_if = "Option::is_none")] + pub active: Option, + /// A cursor for use in pagination. + /// `ending_before` is an object ID that defines your place in the list. + /// For instance, if you make a list request and receive 100 objects, starting with `obj_bar`, your subsequent call can include `ending_before=obj_bar` in order to fetch the previous page of the list. + #[serde(skip_serializing_if = "Option::is_none")] + pub ending_before: Option<&'a str>, + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, + /// A limit on the number of objects to be returned. + /// Limit can range between 1 and 100, and the default is 10. + #[serde(skip_serializing_if = "Option::is_none")] + pub limit: Option, + /// A cursor for use in pagination. + /// `starting_after` is an object ID that defines your place in the list. + /// For instance, if you make a list request and receive 100 objects, ending with `obj_foo`, your subsequent call can include `starting_after=obj_foo` in order to fetch the next page of the list. + #[serde(skip_serializing_if = "Option::is_none")] + pub starting_after: Option<&'a str>, +} +impl<'a> ListPaymentLink<'a> { + pub fn new() -> Self { + Self::default() + } +} +impl<'a> ListPaymentLink<'a> { + /// Returns a list of your payment links. + pub fn send( + &self, + client: &stripe::Client, + ) -> stripe::Response> { + client.get_query("/payment_links", self) + } + pub fn paginate(self) -> stripe::ListPaginator> { + stripe::ListPaginator::from_list_params("/payment_links", self) + } +} +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct RetrievePaymentLink<'a> { + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, +} +impl<'a> RetrievePaymentLink<'a> { + pub fn new() -> Self { + Self::default() + } +} +impl<'a> RetrievePaymentLink<'a> { + /// Retrieve a payment link. + pub fn send( + &self, + client: &stripe::Client, + payment_link: &stripe_shared::PaymentLinkId, + ) -> stripe::Response { + client.get_query(&format!("/payment_links/{payment_link}"), self) + } +} +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct ListLineItemsPaymentLink<'a> { + /// A cursor for use in pagination. + /// `ending_before` is an object ID that defines your place in the list. + /// For instance, if you make a list request and receive 100 objects, starting with `obj_bar`, your subsequent call can include `ending_before=obj_bar` in order to fetch the previous page of the list. + #[serde(skip_serializing_if = "Option::is_none")] + pub ending_before: Option<&'a str>, + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, + /// A limit on the number of objects to be returned. + /// Limit can range between 1 and 100, and the default is 10. + #[serde(skip_serializing_if = "Option::is_none")] + pub limit: Option, + /// A cursor for use in pagination. + /// `starting_after` is an object ID that defines your place in the list. + /// For instance, if you make a list request and receive 100 objects, ending with `obj_foo`, your subsequent call can include `starting_after=obj_foo` in order to fetch the next page of the list. + #[serde(skip_serializing_if = "Option::is_none")] + pub starting_after: Option<&'a str>, +} +impl<'a> ListLineItemsPaymentLink<'a> { + pub fn new() -> Self { + Self::default() + } +} +impl<'a> ListLineItemsPaymentLink<'a> { + /// When retrieving a payment link, there is an includable **line_items** property containing the first handful of those items. + /// There is also a URL where you can retrieve the full (paginated) list of line items. + pub fn send( + &self, + client: &stripe::Client, + payment_link: &stripe_shared::PaymentLinkId, + ) -> stripe::Response> { + client.get_query(&format!("/payment_links/{payment_link}/line_items"), self) + } + pub fn paginate( + self, + payment_link: &stripe_shared::PaymentLinkId, + ) -> stripe::ListPaginator> { + stripe::ListPaginator::from_list_params( + &format!("/payment_links/{payment_link}/line_items"), + self, + ) + } +} +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreatePaymentLink<'a> { + /// Behavior after the purchase is complete. + #[serde(skip_serializing_if = "Option::is_none")] + pub after_completion: Option>, + /// Enables user redeemable promotion codes. + #[serde(skip_serializing_if = "Option::is_none")] + pub allow_promotion_codes: Option, + /// The amount of the application fee (if any) that will be requested to be applied to the payment and transferred to the application owner's Stripe account. + /// Can only be applied when there are no line items with recurring prices. + #[serde(skip_serializing_if = "Option::is_none")] + pub application_fee_amount: Option, + /// A non-negative decimal between 0 and 100, with at most two decimal places. + /// This represents the percentage of the subscription invoice total that will be transferred to the application owner's Stripe account. + /// There must be at least 1 line item with a recurring price to use this field. + #[serde(skip_serializing_if = "Option::is_none")] + pub application_fee_percent: Option, + /// Configuration for automatic tax collection. + #[serde(skip_serializing_if = "Option::is_none")] + pub automatic_tax: Option>, + /// Configuration for collecting the customer's billing address. + #[serde(skip_serializing_if = "Option::is_none")] + pub billing_address_collection: Option, + /// Configure fields to gather active consent from customers. + #[serde(skip_serializing_if = "Option::is_none")] + pub consent_collection: Option, + /// Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. + /// Must be a [supported currency](https://stripe.com/docs/currencies) and supported by each line item's price. + #[serde(skip_serializing_if = "Option::is_none")] + pub currency: Option, + /// Collect additional information from your customer using custom fields. + /// Up to 3 fields are supported. + #[serde(skip_serializing_if = "Option::is_none")] + pub custom_fields: Option<&'a [CreatePaymentLinkCustomFields<'a>]>, + /// Display additional text for your customers using custom text. + #[serde(skip_serializing_if = "Option::is_none")] + pub custom_text: Option>, + /// Configures whether [checkout sessions](https://stripe.com/docs/api/checkout/sessions) created by this payment link create a [Customer](https://stripe.com/docs/api/customers). + #[serde(skip_serializing_if = "Option::is_none")] + pub customer_creation: Option, + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, + /// The custom message to be displayed to a customer when a payment link is no longer active. + #[serde(skip_serializing_if = "Option::is_none")] + pub inactive_message: Option<&'a str>, + /// Generate a post-purchase Invoice for one-time payments. + #[serde(skip_serializing_if = "Option::is_none")] + pub invoice_creation: Option>, + /// The line items representing what is being sold. + /// Each line item represents an item being sold. + /// Up to 20 line items are supported. + pub line_items: &'a [CreatePaymentLinkLineItems<'a>], + /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. + /// This can be useful for storing additional information about the object in a structured format. + /// Individual keys can be unset by posting an empty value to them. + /// All keys can be unset by posting an empty value to `metadata`. + /// Metadata associated with this Payment Link will automatically be copied to [checkout sessions](https://stripe.com/docs/api/checkout/sessions) created by this payment link. + #[serde(skip_serializing_if = "Option::is_none")] + pub metadata: Option<&'a std::collections::HashMap>, + /// The account on behalf of which to charge. + #[serde(skip_serializing_if = "Option::is_none")] + pub on_behalf_of: Option<&'a str>, + /// A subset of parameters to be passed to PaymentIntent creation for Checkout Sessions in `payment` mode. + #[serde(skip_serializing_if = "Option::is_none")] + pub payment_intent_data: Option>, + /// Specify whether Checkout should collect a payment method. + /// When set to `if_required`, Checkout will not collect a payment method when the total due for the session is 0.This may occur if the Checkout Session includes a free trial or a discount. + /// + /// Can only be set in `subscription` mode. + /// + /// If you'd like information on how to collect a payment method outside of Checkout, read the guide on [configuring subscriptions with a free trial](https://stripe.com/docs/payments/checkout/free-trials). + #[serde(skip_serializing_if = "Option::is_none")] + pub payment_method_collection: Option, + /// The list of payment method types that customers can use. + /// If no value is passed, Stripe will dynamically show relevant payment methods from your [payment method settings](https://dashboard.stripe.com/settings/payment_methods) (20+ payment methods [supported](https://stripe.com/docs/payments/payment-methods/integration-options#payment-method-product-support)). + #[serde(skip_serializing_if = "Option::is_none")] + pub payment_method_types: Option<&'a [stripe_shared::PaymentLinkPaymentMethodTypes]>, + /// Controls phone number collection settings during checkout. + /// + /// We recommend that you review your privacy policy and check with your legal contacts. + #[serde(skip_serializing_if = "Option::is_none")] + pub phone_number_collection: Option, + /// Settings that restrict the usage of a payment link. + #[serde(skip_serializing_if = "Option::is_none")] + pub restrictions: Option, + /// Configuration for collecting the customer's shipping address. + #[serde(skip_serializing_if = "Option::is_none")] + pub shipping_address_collection: Option>, + /// The shipping rate options to apply to [checkout sessions](https://stripe.com/docs/api/checkout/sessions) created by this payment link. + #[serde(skip_serializing_if = "Option::is_none")] + pub shipping_options: Option<&'a [CreatePaymentLinkShippingOptions<'a>]>, + /// Describes the type of transaction being performed in order to customize relevant text on the page, such as the submit button. + /// Changing this value will also affect the hostname in the [url](https://stripe.com/docs/api/payment_links/payment_links/object#url) property (example: `donate.stripe.com`). + #[serde(skip_serializing_if = "Option::is_none")] + pub submit_type: Option, + /// When creating a subscription, the specified configuration data will be used. + /// There must be at least one line item with a recurring price to use `subscription_data`. + #[serde(skip_serializing_if = "Option::is_none")] + pub subscription_data: Option>, + /// Controls tax ID collection during checkout. + #[serde(skip_serializing_if = "Option::is_none")] + pub tax_id_collection: Option, + /// The account (if any) the payments will be attributed to for tax reporting, and where funds from each payment will be transferred to. + #[serde(skip_serializing_if = "Option::is_none")] + pub transfer_data: Option>, +} +impl<'a> CreatePaymentLink<'a> { + pub fn new(line_items: &'a [CreatePaymentLinkLineItems<'a>]) -> Self { + Self { + after_completion: None, + allow_promotion_codes: None, + application_fee_amount: None, + application_fee_percent: None, + automatic_tax: None, + billing_address_collection: None, + consent_collection: None, + currency: None, + custom_fields: None, + custom_text: None, + customer_creation: None, + expand: None, + inactive_message: None, + invoice_creation: None, + line_items, + metadata: None, + on_behalf_of: None, + payment_intent_data: None, + payment_method_collection: None, + payment_method_types: None, + phone_number_collection: None, + restrictions: None, + shipping_address_collection: None, + shipping_options: None, + submit_type: None, + subscription_data: None, + tax_id_collection: None, + transfer_data: None, + } + } +} +/// Behavior after the purchase is complete. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreatePaymentLinkAfterCompletion<'a> { + /// Configuration when `type=hosted_confirmation`. + #[serde(skip_serializing_if = "Option::is_none")] + pub hosted_confirmation: Option>, + /// Configuration when `type=redirect`. + #[serde(skip_serializing_if = "Option::is_none")] + pub redirect: Option>, + /// The specified behavior after the purchase is complete. Either `redirect` or `hosted_confirmation`. + #[serde(rename = "type")] + pub type_: CreatePaymentLinkAfterCompletionType, +} +impl<'a> CreatePaymentLinkAfterCompletion<'a> { + pub fn new(type_: CreatePaymentLinkAfterCompletionType) -> Self { + Self { hosted_confirmation: None, redirect: None, type_ } + } +} +/// The specified behavior after the purchase is complete. Either `redirect` or `hosted_confirmation`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreatePaymentLinkAfterCompletionType { + HostedConfirmation, + Redirect, +} +impl CreatePaymentLinkAfterCompletionType { + pub fn as_str(self) -> &'static str { + use CreatePaymentLinkAfterCompletionType::*; + match self { + HostedConfirmation => "hosted_confirmation", + Redirect => "redirect", + } + } +} + +impl std::str::FromStr for CreatePaymentLinkAfterCompletionType { + type Err = (); + fn from_str(s: &str) -> Result { + use CreatePaymentLinkAfterCompletionType::*; + match s { + "hosted_confirmation" => Ok(HostedConfirmation), + "redirect" => Ok(Redirect), + _ => Err(()), + } + } +} +impl std::fmt::Display for CreatePaymentLinkAfterCompletionType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreatePaymentLinkAfterCompletionType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreatePaymentLinkAfterCompletionType { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Configuration for automatic tax collection. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreatePaymentLinkAutomaticTax<'a> { + /// If `true`, tax will be calculated automatically using the customer's location. + pub enabled: bool, + /// The account that's liable for tax. + /// If set, the business address and tax registrations required to perform the tax calculation are loaded from this account. + /// The tax transaction is returned in the report of the connected account. + #[serde(skip_serializing_if = "Option::is_none")] + pub liability: Option>, +} +impl<'a> CreatePaymentLinkAutomaticTax<'a> { + pub fn new(enabled: bool) -> Self { + Self { enabled, liability: None } + } +} +/// The account that's liable for tax. +/// If set, the business address and tax registrations required to perform the tax calculation are loaded from this account. +/// The tax transaction is returned in the report of the connected account. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreatePaymentLinkAutomaticTaxLiability<'a> { + /// The connected account being referenced when `type` is `account`. + #[serde(skip_serializing_if = "Option::is_none")] + pub account: Option<&'a str>, + /// Type of the account referenced in the request. + #[serde(rename = "type")] + pub type_: CreatePaymentLinkAutomaticTaxLiabilityType, +} +impl<'a> CreatePaymentLinkAutomaticTaxLiability<'a> { + pub fn new(type_: CreatePaymentLinkAutomaticTaxLiabilityType) -> Self { + Self { account: None, type_ } + } +} +/// Type of the account referenced in the request. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreatePaymentLinkAutomaticTaxLiabilityType { + Account, + Self_, +} +impl CreatePaymentLinkAutomaticTaxLiabilityType { + pub fn as_str(self) -> &'static str { + use CreatePaymentLinkAutomaticTaxLiabilityType::*; + match self { + Account => "account", + Self_ => "self", + } + } +} + +impl std::str::FromStr for CreatePaymentLinkAutomaticTaxLiabilityType { + type Err = (); + fn from_str(s: &str) -> Result { + use CreatePaymentLinkAutomaticTaxLiabilityType::*; + match s { + "account" => Ok(Account), + "self" => Ok(Self_), + _ => Err(()), + } + } +} +impl std::fmt::Display for CreatePaymentLinkAutomaticTaxLiabilityType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreatePaymentLinkAutomaticTaxLiabilityType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreatePaymentLinkAutomaticTaxLiabilityType { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Configure fields to gather active consent from customers. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreatePaymentLinkConsentCollection { + /// Determines the display of payment method reuse agreement text in the UI. + /// If set to `hidden`, it will hide legal text related to the reuse of a payment method. + #[serde(skip_serializing_if = "Option::is_none")] + pub payment_method_reuse_agreement: + Option, + /// If set to `auto`, enables the collection of customer consent for promotional communications. + /// The Checkout. + /// Session will determine whether to display an option to opt into promotional communication + /// from the merchant depending on the customer's locale. Only available to US merchants. + #[serde(skip_serializing_if = "Option::is_none")] + pub promotions: Option, + /// If set to `required`, it requires customers to check a terms of service checkbox before being able to pay. + /// There must be a valid terms of service URL set in your [Dashboard settings](https://dashboard.stripe.com/settings/public). + #[serde(skip_serializing_if = "Option::is_none")] + pub terms_of_service: Option, +} +impl CreatePaymentLinkConsentCollection { + pub fn new() -> Self { + Self::default() + } +} +/// Determines the display of payment method reuse agreement text in the UI. +/// If set to `hidden`, it will hide legal text related to the reuse of a payment method. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreatePaymentLinkConsentCollectionPaymentMethodReuseAgreement { + /// Determines the position and visibility of the payment method reuse agreement in the UI. + /// When set to `auto`, Stripe's. + /// defaults will be used. + /// When set to `hidden`, the payment method reuse agreement text will always be hidden in the UI. + pub position: CreatePaymentLinkConsentCollectionPaymentMethodReuseAgreementPosition, +} +impl CreatePaymentLinkConsentCollectionPaymentMethodReuseAgreement { + pub fn new( + position: CreatePaymentLinkConsentCollectionPaymentMethodReuseAgreementPosition, + ) -> Self { + Self { position } + } +} +/// Determines the position and visibility of the payment method reuse agreement in the UI. +/// When set to `auto`, Stripe's. +/// defaults will be used. +/// When set to `hidden`, the payment method reuse agreement text will always be hidden in the UI. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreatePaymentLinkConsentCollectionPaymentMethodReuseAgreementPosition { + Auto, + Hidden, +} +impl CreatePaymentLinkConsentCollectionPaymentMethodReuseAgreementPosition { + pub fn as_str(self) -> &'static str { + use CreatePaymentLinkConsentCollectionPaymentMethodReuseAgreementPosition::*; + match self { + Auto => "auto", + Hidden => "hidden", + } + } +} + +impl std::str::FromStr for CreatePaymentLinkConsentCollectionPaymentMethodReuseAgreementPosition { + type Err = (); + fn from_str(s: &str) -> Result { + use CreatePaymentLinkConsentCollectionPaymentMethodReuseAgreementPosition::*; + match s { + "auto" => Ok(Auto), + "hidden" => Ok(Hidden), + _ => Err(()), + } + } +} +impl std::fmt::Display for CreatePaymentLinkConsentCollectionPaymentMethodReuseAgreementPosition { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreatePaymentLinkConsentCollectionPaymentMethodReuseAgreementPosition { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreatePaymentLinkConsentCollectionPaymentMethodReuseAgreementPosition { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// If set to `auto`, enables the collection of customer consent for promotional communications. +/// The Checkout. +/// Session will determine whether to display an option to opt into promotional communication +/// from the merchant depending on the customer's locale. Only available to US merchants. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreatePaymentLinkConsentCollectionPromotions { + Auto, + None, +} +impl CreatePaymentLinkConsentCollectionPromotions { + pub fn as_str(self) -> &'static str { + use CreatePaymentLinkConsentCollectionPromotions::*; + match self { + Auto => "auto", + None => "none", + } + } +} + +impl std::str::FromStr for CreatePaymentLinkConsentCollectionPromotions { + type Err = (); + fn from_str(s: &str) -> Result { + use CreatePaymentLinkConsentCollectionPromotions::*; + match s { + "auto" => Ok(Auto), + "none" => Ok(None), + _ => Err(()), + } + } +} +impl std::fmt::Display for CreatePaymentLinkConsentCollectionPromotions { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreatePaymentLinkConsentCollectionPromotions { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreatePaymentLinkConsentCollectionPromotions { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// If set to `required`, it requires customers to check a terms of service checkbox before being able to pay. +/// There must be a valid terms of service URL set in your [Dashboard settings](https://dashboard.stripe.com/settings/public). +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreatePaymentLinkConsentCollectionTermsOfService { + None, + Required, +} +impl CreatePaymentLinkConsentCollectionTermsOfService { + pub fn as_str(self) -> &'static str { + use CreatePaymentLinkConsentCollectionTermsOfService::*; + match self { + None => "none", + Required => "required", + } + } +} + +impl std::str::FromStr for CreatePaymentLinkConsentCollectionTermsOfService { + type Err = (); + fn from_str(s: &str) -> Result { + use CreatePaymentLinkConsentCollectionTermsOfService::*; + match s { + "none" => Ok(None), + "required" => Ok(Required), + _ => Err(()), + } + } +} +impl std::fmt::Display for CreatePaymentLinkConsentCollectionTermsOfService { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreatePaymentLinkConsentCollectionTermsOfService { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreatePaymentLinkConsentCollectionTermsOfService { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Collect additional information from your customer using custom fields. +/// Up to 3 fields are supported. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreatePaymentLinkCustomFields<'a> { + /// Configuration for `type=dropdown` fields. + #[serde(skip_serializing_if = "Option::is_none")] + pub dropdown: Option>, + /// String of your choice that your integration can use to reconcile this field. + /// Must be unique to this field, alphanumeric, and up to 200 characters. + pub key: &'a str, + /// The label for the field, displayed to the customer. + pub label: CreatePaymentLinkCustomFieldsLabel<'a>, + /// Configuration for `type=numeric` fields. + #[serde(skip_serializing_if = "Option::is_none")] + pub numeric: Option, + /// Whether the customer is required to complete the field before completing the Checkout Session. + /// Defaults to `false`. + #[serde(skip_serializing_if = "Option::is_none")] + pub optional: Option, + /// Configuration for `type=text` fields. + #[serde(skip_serializing_if = "Option::is_none")] + pub text: Option, + /// The type of the field. + #[serde(rename = "type")] + pub type_: CreatePaymentLinkCustomFieldsType, +} +impl<'a> CreatePaymentLinkCustomFields<'a> { + pub fn new( + key: &'a str, + label: CreatePaymentLinkCustomFieldsLabel<'a>, + type_: CreatePaymentLinkCustomFieldsType, + ) -> Self { + Self { dropdown: None, key, label, numeric: None, optional: None, text: None, type_ } + } +} +/// The label for the field, displayed to the customer. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreatePaymentLinkCustomFieldsLabel<'a> { + /// Custom text for the label, displayed to the customer. Up to 50 characters. + pub custom: &'a str, + /// The type of the label. + #[serde(rename = "type")] + pub type_: CreatePaymentLinkCustomFieldsLabelType, +} +impl<'a> CreatePaymentLinkCustomFieldsLabel<'a> { + pub fn new(custom: &'a str, type_: CreatePaymentLinkCustomFieldsLabelType) -> Self { + Self { custom, type_ } + } +} +/// The type of the label. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreatePaymentLinkCustomFieldsLabelType { + Custom, +} +impl CreatePaymentLinkCustomFieldsLabelType { + pub fn as_str(self) -> &'static str { + use CreatePaymentLinkCustomFieldsLabelType::*; + match self { + Custom => "custom", + } + } +} + +impl std::str::FromStr for CreatePaymentLinkCustomFieldsLabelType { + type Err = (); + fn from_str(s: &str) -> Result { + use CreatePaymentLinkCustomFieldsLabelType::*; + match s { + "custom" => Ok(Custom), + _ => Err(()), + } + } +} +impl std::fmt::Display for CreatePaymentLinkCustomFieldsLabelType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreatePaymentLinkCustomFieldsLabelType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreatePaymentLinkCustomFieldsLabelType { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Configuration for `type=numeric` fields. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreatePaymentLinkCustomFieldsNumeric { + /// The maximum character length constraint for the customer's input. + #[serde(skip_serializing_if = "Option::is_none")] + pub maximum_length: Option, + /// The minimum character length requirement for the customer's input. + #[serde(skip_serializing_if = "Option::is_none")] + pub minimum_length: Option, +} +impl CreatePaymentLinkCustomFieldsNumeric { + pub fn new() -> Self { + Self::default() + } +} +/// Configuration for `type=text` fields. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreatePaymentLinkCustomFieldsText { + /// The maximum character length constraint for the customer's input. + #[serde(skip_serializing_if = "Option::is_none")] + pub maximum_length: Option, + /// The minimum character length requirement for the customer's input. + #[serde(skip_serializing_if = "Option::is_none")] + pub minimum_length: Option, +} +impl CreatePaymentLinkCustomFieldsText { + pub fn new() -> Self { + Self::default() + } +} +/// The type of the field. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreatePaymentLinkCustomFieldsType { + Dropdown, + Numeric, + Text, +} +impl CreatePaymentLinkCustomFieldsType { + pub fn as_str(self) -> &'static str { + use CreatePaymentLinkCustomFieldsType::*; + match self { + Dropdown => "dropdown", + Numeric => "numeric", + Text => "text", + } + } +} + +impl std::str::FromStr for CreatePaymentLinkCustomFieldsType { + type Err = (); + fn from_str(s: &str) -> Result { + use CreatePaymentLinkCustomFieldsType::*; + match s { + "dropdown" => Ok(Dropdown), + "numeric" => Ok(Numeric), + "text" => Ok(Text), + _ => Err(()), + } + } +} +impl std::fmt::Display for CreatePaymentLinkCustomFieldsType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreatePaymentLinkCustomFieldsType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreatePaymentLinkCustomFieldsType { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Configures whether [checkout sessions](https://stripe.com/docs/api/checkout/sessions) created by this payment link create a [Customer](https://stripe.com/docs/api/customers). +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreatePaymentLinkCustomerCreation { + Always, + IfRequired, +} +impl CreatePaymentLinkCustomerCreation { + pub fn as_str(self) -> &'static str { + use CreatePaymentLinkCustomerCreation::*; + match self { + Always => "always", + IfRequired => "if_required", + } + } +} + +impl std::str::FromStr for CreatePaymentLinkCustomerCreation { + type Err = (); + fn from_str(s: &str) -> Result { + use CreatePaymentLinkCustomerCreation::*; + match s { + "always" => Ok(Always), + "if_required" => Ok(IfRequired), + _ => Err(()), + } + } +} +impl std::fmt::Display for CreatePaymentLinkCustomerCreation { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreatePaymentLinkCustomerCreation { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreatePaymentLinkCustomerCreation { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Generate a post-purchase Invoice for one-time payments. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreatePaymentLinkInvoiceCreation<'a> { + /// Whether the feature is enabled + pub enabled: bool, + /// Invoice PDF configuration. + #[serde(skip_serializing_if = "Option::is_none")] + pub invoice_data: Option>, +} +impl<'a> CreatePaymentLinkInvoiceCreation<'a> { + pub fn new(enabled: bool) -> Self { + Self { enabled, invoice_data: None } + } +} +/// Invoice PDF configuration. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreatePaymentLinkInvoiceCreationInvoiceData<'a> { + /// The account tax IDs associated with the invoice. + #[serde(skip_serializing_if = "Option::is_none")] + pub account_tax_ids: Option<&'a [&'a str]>, + /// Default custom fields to be displayed on invoices for this customer. + #[serde(skip_serializing_if = "Option::is_none")] + pub custom_fields: Option<&'a [CustomFieldParams<'a>]>, + /// An arbitrary string attached to the object. Often useful for displaying to users. + #[serde(skip_serializing_if = "Option::is_none")] + pub description: Option<&'a str>, + /// Default footer to be displayed on invoices for this customer. + #[serde(skip_serializing_if = "Option::is_none")] + pub footer: Option<&'a str>, + /// The connected account that issues the invoice. + /// The invoice is presented with the branding and support information of the specified account. + #[serde(skip_serializing_if = "Option::is_none")] + pub issuer: Option>, + /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. + /// This can be useful for storing additional information about the object in a structured format. + /// Individual keys can be unset by posting an empty value to them. + /// All keys can be unset by posting an empty value to `metadata`. + #[serde(skip_serializing_if = "Option::is_none")] + pub metadata: Option<&'a std::collections::HashMap>, + /// Default options for invoice PDF rendering for this customer. + #[serde(skip_serializing_if = "Option::is_none")] + pub rendering_options: Option, +} +impl<'a> CreatePaymentLinkInvoiceCreationInvoiceData<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// The connected account that issues the invoice. +/// The invoice is presented with the branding and support information of the specified account. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreatePaymentLinkInvoiceCreationInvoiceDataIssuer<'a> { + /// The connected account being referenced when `type` is `account`. + #[serde(skip_serializing_if = "Option::is_none")] + pub account: Option<&'a str>, + /// Type of the account referenced in the request. + #[serde(rename = "type")] + pub type_: CreatePaymentLinkInvoiceCreationInvoiceDataIssuerType, +} +impl<'a> CreatePaymentLinkInvoiceCreationInvoiceDataIssuer<'a> { + pub fn new(type_: CreatePaymentLinkInvoiceCreationInvoiceDataIssuerType) -> Self { + Self { account: None, type_ } + } +} +/// Type of the account referenced in the request. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreatePaymentLinkInvoiceCreationInvoiceDataIssuerType { + Account, + Self_, +} +impl CreatePaymentLinkInvoiceCreationInvoiceDataIssuerType { + pub fn as_str(self) -> &'static str { + use CreatePaymentLinkInvoiceCreationInvoiceDataIssuerType::*; + match self { + Account => "account", + Self_ => "self", + } + } +} + +impl std::str::FromStr for CreatePaymentLinkInvoiceCreationInvoiceDataIssuerType { + type Err = (); + fn from_str(s: &str) -> Result { + use CreatePaymentLinkInvoiceCreationInvoiceDataIssuerType::*; + match s { + "account" => Ok(Account), + "self" => Ok(Self_), + _ => Err(()), + } + } +} +impl std::fmt::Display for CreatePaymentLinkInvoiceCreationInvoiceDataIssuerType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreatePaymentLinkInvoiceCreationInvoiceDataIssuerType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreatePaymentLinkInvoiceCreationInvoiceDataIssuerType { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Default options for invoice PDF rendering for this customer. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreatePaymentLinkInvoiceCreationInvoiceDataRenderingOptions { + /// How line-item prices and amounts will be displayed with respect to tax on invoice PDFs. + /// One of `exclude_tax` or `include_inclusive_tax`. + /// `include_inclusive_tax` will include inclusive tax (and exclude exclusive tax) in invoice PDF amounts. + /// `exclude_tax` will exclude all tax (inclusive and exclusive alike) from invoice PDF amounts. + #[serde(skip_serializing_if = "Option::is_none")] + pub amount_tax_display: + Option, +} +impl CreatePaymentLinkInvoiceCreationInvoiceDataRenderingOptions { + pub fn new() -> Self { + Self::default() + } +} +/// How line-item prices and amounts will be displayed with respect to tax on invoice PDFs. +/// One of `exclude_tax` or `include_inclusive_tax`. +/// `include_inclusive_tax` will include inclusive tax (and exclude exclusive tax) in invoice PDF amounts. +/// `exclude_tax` will exclude all tax (inclusive and exclusive alike) from invoice PDF amounts. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreatePaymentLinkInvoiceCreationInvoiceDataRenderingOptionsAmountTaxDisplay { + ExcludeTax, + IncludeInclusiveTax, +} +impl CreatePaymentLinkInvoiceCreationInvoiceDataRenderingOptionsAmountTaxDisplay { + pub fn as_str(self) -> &'static str { + use CreatePaymentLinkInvoiceCreationInvoiceDataRenderingOptionsAmountTaxDisplay::*; + match self { + ExcludeTax => "exclude_tax", + IncludeInclusiveTax => "include_inclusive_tax", + } + } +} + +impl std::str::FromStr + for CreatePaymentLinkInvoiceCreationInvoiceDataRenderingOptionsAmountTaxDisplay +{ + type Err = (); + fn from_str(s: &str) -> Result { + use CreatePaymentLinkInvoiceCreationInvoiceDataRenderingOptionsAmountTaxDisplay::*; + match s { + "exclude_tax" => Ok(ExcludeTax), + "include_inclusive_tax" => Ok(IncludeInclusiveTax), + _ => Err(()), + } + } +} +impl std::fmt::Display + for CreatePaymentLinkInvoiceCreationInvoiceDataRenderingOptionsAmountTaxDisplay +{ + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug + for CreatePaymentLinkInvoiceCreationInvoiceDataRenderingOptionsAmountTaxDisplay +{ + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize + for CreatePaymentLinkInvoiceCreationInvoiceDataRenderingOptionsAmountTaxDisplay +{ + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// The line items representing what is being sold. +/// Each line item represents an item being sold. +/// Up to 20 line items are supported. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreatePaymentLinkLineItems<'a> { + /// When set, provides configuration for this item’s quantity to be adjusted by the customer during checkout. + #[serde(skip_serializing_if = "Option::is_none")] + pub adjustable_quantity: Option, + /// The ID of the [Price](https://stripe.com/docs/api/prices) or [Plan](https://stripe.com/docs/api/plans) object. + pub price: &'a str, + /// The quantity of the line item being purchased. + pub quantity: u64, +} +impl<'a> CreatePaymentLinkLineItems<'a> { + pub fn new(price: &'a str, quantity: u64) -> Self { + Self { adjustable_quantity: None, price, quantity } + } +} +/// A subset of parameters to be passed to PaymentIntent creation for Checkout Sessions in `payment` mode. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreatePaymentLinkPaymentIntentData<'a> { + /// Controls when the funds will be captured from the customer's account. + #[serde(skip_serializing_if = "Option::is_none")] + pub capture_method: Option, + /// An arbitrary string attached to the object. Often useful for displaying to users. + #[serde(skip_serializing_if = "Option::is_none")] + pub description: Option<&'a str>, + /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that will declaratively set metadata on [Payment Intents](https://stripe.com/docs/api/payment_intents) generated from this payment link. + /// Unlike object-level metadata, this field is declarative. + /// Updates will clear prior values. + #[serde(skip_serializing_if = "Option::is_none")] + pub metadata: Option<&'a std::collections::HashMap>, + /// Indicates that you intend to [make future payments](https://stripe.com/docs/payments/payment-intents#future-usage) with the payment method collected by this Checkout Session. + /// + /// When setting this to `on_session`, Checkout will show a notice to the customer that their payment details will be saved. + /// + /// When setting this to `off_session`, Checkout will show a notice to the customer that their payment details will be saved and used for future payments. + /// + /// If a Customer has been provided or Checkout creates a new Customer,Checkout will attach the payment method to the Customer. + /// + /// If Checkout does not create a Customer, the payment method is not attached to a Customer. + /// To reuse the payment method, you can retrieve it from the Checkout Session's PaymentIntent. + /// + /// When processing card payments, Checkout also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as SCA. + #[serde(skip_serializing_if = "Option::is_none")] + pub setup_future_usage: Option, + /// Extra information about the payment. + /// This will appear on your customer's statement when this payment succeeds in creating a charge. + #[serde(skip_serializing_if = "Option::is_none")] + pub statement_descriptor: Option<&'a str>, + /// Provides information about the charge that customers see on their statements. + /// Concatenated with the prefix (shortened descriptor) or statement descriptor that's set on the account to form the complete statement descriptor. + /// Maximum 22 characters for the concatenated descriptor. + #[serde(skip_serializing_if = "Option::is_none")] + pub statement_descriptor_suffix: Option<&'a str>, + /// A string that identifies the resulting payment as part of a group. + /// See the PaymentIntents [use case for connected accounts](https://stripe.com/docs/connect/separate-charges-and-transfers) for details. + #[serde(skip_serializing_if = "Option::is_none")] + pub transfer_group: Option<&'a str>, +} +impl<'a> CreatePaymentLinkPaymentIntentData<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// Controls when the funds will be captured from the customer's account. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreatePaymentLinkPaymentIntentDataCaptureMethod { + Automatic, + AutomaticAsync, + Manual, +} +impl CreatePaymentLinkPaymentIntentDataCaptureMethod { + pub fn as_str(self) -> &'static str { + use CreatePaymentLinkPaymentIntentDataCaptureMethod::*; + match self { + Automatic => "automatic", + AutomaticAsync => "automatic_async", + Manual => "manual", + } + } +} + +impl std::str::FromStr for CreatePaymentLinkPaymentIntentDataCaptureMethod { + type Err = (); + fn from_str(s: &str) -> Result { + use CreatePaymentLinkPaymentIntentDataCaptureMethod::*; + match s { + "automatic" => Ok(Automatic), + "automatic_async" => Ok(AutomaticAsync), + "manual" => Ok(Manual), + _ => Err(()), + } + } +} +impl std::fmt::Display for CreatePaymentLinkPaymentIntentDataCaptureMethod { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreatePaymentLinkPaymentIntentDataCaptureMethod { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreatePaymentLinkPaymentIntentDataCaptureMethod { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Indicates that you intend to [make future payments](https://stripe.com/docs/payments/payment-intents#future-usage) with the payment method collected by this Checkout Session. +/// +/// When setting this to `on_session`, Checkout will show a notice to the customer that their payment details will be saved. +/// +/// When setting this to `off_session`, Checkout will show a notice to the customer that their payment details will be saved and used for future payments. +/// +/// If a Customer has been provided or Checkout creates a new Customer,Checkout will attach the payment method to the Customer. +/// +/// If Checkout does not create a Customer, the payment method is not attached to a Customer. +/// To reuse the payment method, you can retrieve it from the Checkout Session's PaymentIntent. +/// +/// When processing card payments, Checkout also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as SCA. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreatePaymentLinkPaymentIntentDataSetupFutureUsage { + OffSession, + OnSession, +} +impl CreatePaymentLinkPaymentIntentDataSetupFutureUsage { + pub fn as_str(self) -> &'static str { + use CreatePaymentLinkPaymentIntentDataSetupFutureUsage::*; + match self { + OffSession => "off_session", + OnSession => "on_session", + } + } +} + +impl std::str::FromStr for CreatePaymentLinkPaymentIntentDataSetupFutureUsage { + type Err = (); + fn from_str(s: &str) -> Result { + use CreatePaymentLinkPaymentIntentDataSetupFutureUsage::*; + match s { + "off_session" => Ok(OffSession), + "on_session" => Ok(OnSession), + _ => Err(()), + } + } +} +impl std::fmt::Display for CreatePaymentLinkPaymentIntentDataSetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreatePaymentLinkPaymentIntentDataSetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreatePaymentLinkPaymentIntentDataSetupFutureUsage { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Specify whether Checkout should collect a payment method. +/// When set to `if_required`, Checkout will not collect a payment method when the total due for the session is 0.This may occur if the Checkout Session includes a free trial or a discount. +/// +/// Can only be set in `subscription` mode. +/// +/// If you'd like information on how to collect a payment method outside of Checkout, read the guide on [configuring subscriptions with a free trial](https://stripe.com/docs/payments/checkout/free-trials). +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreatePaymentLinkPaymentMethodCollection { + Always, + IfRequired, +} +impl CreatePaymentLinkPaymentMethodCollection { + pub fn as_str(self) -> &'static str { + use CreatePaymentLinkPaymentMethodCollection::*; + match self { + Always => "always", + IfRequired => "if_required", + } + } +} + +impl std::str::FromStr for CreatePaymentLinkPaymentMethodCollection { + type Err = (); + fn from_str(s: &str) -> Result { + use CreatePaymentLinkPaymentMethodCollection::*; + match s { + "always" => Ok(Always), + "if_required" => Ok(IfRequired), + _ => Err(()), + } + } +} +impl std::fmt::Display for CreatePaymentLinkPaymentMethodCollection { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreatePaymentLinkPaymentMethodCollection { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreatePaymentLinkPaymentMethodCollection { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Controls phone number collection settings during checkout. +/// +/// We recommend that you review your privacy policy and check with your legal contacts. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreatePaymentLinkPhoneNumberCollection { + /// Set to `true` to enable phone number collection. + pub enabled: bool, +} +impl CreatePaymentLinkPhoneNumberCollection { + pub fn new(enabled: bool) -> Self { + Self { enabled } + } +} +/// Configuration for collecting the customer's shipping address. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreatePaymentLinkShippingAddressCollection<'a> { + /// An array of two-letter ISO country codes representing which countries Checkout should provide as options for. + /// shipping locations. + /// Unsupported country codes: `AS, CX, CC, CU, HM, IR, KP, MH, FM, NF, MP, PW, SD, SY, UM, VI`. + pub allowed_countries: &'a [CreatePaymentLinkShippingAddressCollectionAllowedCountries], +} +impl<'a> CreatePaymentLinkShippingAddressCollection<'a> { + pub fn new( + allowed_countries: &'a [CreatePaymentLinkShippingAddressCollectionAllowedCountries], + ) -> Self { + Self { allowed_countries } + } +} +/// An array of two-letter ISO country codes representing which countries Checkout should provide as options for. +/// shipping locations. +/// Unsupported country codes: `AS, CX, CC, CU, HM, IR, KP, MH, FM, NF, MP, PW, SD, SY, UM, VI`. +#[derive(Copy, Clone, Eq, PartialEq)] +#[non_exhaustive] +pub enum CreatePaymentLinkShippingAddressCollectionAllowedCountries { + Ac, + Ad, + Ae, + Af, + Ag, + Ai, + Al, + Am, + Ao, + Aq, + Ar, + At, + Au, + Aw, + Ax, + Az, + Ba, + Bb, + Bd, + Be, + Bf, + Bg, + Bh, + Bi, + Bj, + Bl, + Bm, + Bn, + Bo, + Bq, + Br, + Bs, + Bt, + Bv, + Bw, + By, + Bz, + Ca, + Cd, + Cf, + Cg, + Ch, + Ci, + Ck, + Cl, + Cm, + Cn, + Co, + Cr, + Cv, + Cw, + Cy, + Cz, + De, + Dj, + Dk, + Dm, + Do, + Dz, + Ec, + Ee, + Eg, + Eh, + Er, + Es, + Et, + Fi, + Fj, + Fk, + Fo, + Fr, + Ga, + Gb, + Gd, + Ge, + Gf, + Gg, + Gh, + Gi, + Gl, + Gm, + Gn, + Gp, + Gq, + Gr, + Gs, + Gt, + Gu, + Gw, + Gy, + Hk, + Hn, + Hr, + Ht, + Hu, + Id, + Ie, + Il, + Im, + In, + Io, + Iq, + Is, + It, + Je, + Jm, + Jo, + Jp, + Ke, + Kg, + Kh, + Ki, + Km, + Kn, + Kr, + Kw, + Ky, + Kz, + La, + Lb, + Lc, + Li, + Lk, + Lr, + Ls, + Lt, + Lu, + Lv, + Ly, + Ma, + Mc, + Md, + Me, + Mf, + Mg, + Mk, + Ml, + Mm, + Mn, + Mo, + Mq, + Mr, + Ms, + Mt, + Mu, + Mv, + Mw, + Mx, + My, + Mz, + Na, + Nc, + Ne, + Ng, + Ni, + Nl, + No, + Np, + Nr, + Nu, + Nz, + Om, + Pa, + Pe, + Pf, + Pg, + Ph, + Pk, + Pl, + Pm, + Pn, + Pr, + Ps, + Pt, + Py, + Qa, + Re, + Ro, + Rs, + Ru, + Rw, + Sa, + Sb, + Sc, + Se, + Sg, + Sh, + Si, + Sj, + Sk, + Sl, + Sm, + Sn, + So, + Sr, + Ss, + St, + Sv, + Sx, + Sz, + Ta, + Tc, + Td, + Tf, + Tg, + Th, + Tj, + Tk, + Tl, + Tm, + Tn, + To, + Tr, + Tt, + Tv, + Tw, + Tz, + Ua, + Ug, + Us, + Uy, + Uz, + Va, + Vc, + Ve, + Vg, + Vn, + Vu, + Wf, + Ws, + Xk, + Ye, + Yt, + Za, + Zm, + Zw, + Zz, + /// An unrecognized value from Stripe. Should not be used as a request parameter. + Unknown, +} +impl CreatePaymentLinkShippingAddressCollectionAllowedCountries { + pub fn as_str(self) -> &'static str { + use CreatePaymentLinkShippingAddressCollectionAllowedCountries::*; + match self { + Ac => "AC", + Ad => "AD", + Ae => "AE", + Af => "AF", + Ag => "AG", + Ai => "AI", + Al => "AL", + Am => "AM", + Ao => "AO", + Aq => "AQ", + Ar => "AR", + At => "AT", + Au => "AU", + Aw => "AW", + Ax => "AX", + Az => "AZ", + Ba => "BA", + Bb => "BB", + Bd => "BD", + Be => "BE", + Bf => "BF", + Bg => "BG", + Bh => "BH", + Bi => "BI", + Bj => "BJ", + Bl => "BL", + Bm => "BM", + Bn => "BN", + Bo => "BO", + Bq => "BQ", + Br => "BR", + Bs => "BS", + Bt => "BT", + Bv => "BV", + Bw => "BW", + By => "BY", + Bz => "BZ", + Ca => "CA", + Cd => "CD", + Cf => "CF", + Cg => "CG", + Ch => "CH", + Ci => "CI", + Ck => "CK", + Cl => "CL", + Cm => "CM", + Cn => "CN", + Co => "CO", + Cr => "CR", + Cv => "CV", + Cw => "CW", + Cy => "CY", + Cz => "CZ", + De => "DE", + Dj => "DJ", + Dk => "DK", + Dm => "DM", + Do => "DO", + Dz => "DZ", + Ec => "EC", + Ee => "EE", + Eg => "EG", + Eh => "EH", + Er => "ER", + Es => "ES", + Et => "ET", + Fi => "FI", + Fj => "FJ", + Fk => "FK", + Fo => "FO", + Fr => "FR", + Ga => "GA", + Gb => "GB", + Gd => "GD", + Ge => "GE", + Gf => "GF", + Gg => "GG", + Gh => "GH", + Gi => "GI", + Gl => "GL", + Gm => "GM", + Gn => "GN", + Gp => "GP", + Gq => "GQ", + Gr => "GR", + Gs => "GS", + Gt => "GT", + Gu => "GU", + Gw => "GW", + Gy => "GY", + Hk => "HK", + Hn => "HN", + Hr => "HR", + Ht => "HT", + Hu => "HU", + Id => "ID", + Ie => "IE", + Il => "IL", + Im => "IM", + In => "IN", + Io => "IO", + Iq => "IQ", + Is => "IS", + It => "IT", + Je => "JE", + Jm => "JM", + Jo => "JO", + Jp => "JP", + Ke => "KE", + Kg => "KG", + Kh => "KH", + Ki => "KI", + Km => "KM", + Kn => "KN", + Kr => "KR", + Kw => "KW", + Ky => "KY", + Kz => "KZ", + La => "LA", + Lb => "LB", + Lc => "LC", + Li => "LI", + Lk => "LK", + Lr => "LR", + Ls => "LS", + Lt => "LT", + Lu => "LU", + Lv => "LV", + Ly => "LY", + Ma => "MA", + Mc => "MC", + Md => "MD", + Me => "ME", + Mf => "MF", + Mg => "MG", + Mk => "MK", + Ml => "ML", + Mm => "MM", + Mn => "MN", + Mo => "MO", + Mq => "MQ", + Mr => "MR", + Ms => "MS", + Mt => "MT", + Mu => "MU", + Mv => "MV", + Mw => "MW", + Mx => "MX", + My => "MY", + Mz => "MZ", + Na => "NA", + Nc => "NC", + Ne => "NE", + Ng => "NG", + Ni => "NI", + Nl => "NL", + No => "NO", + Np => "NP", + Nr => "NR", + Nu => "NU", + Nz => "NZ", + Om => "OM", + Pa => "PA", + Pe => "PE", + Pf => "PF", + Pg => "PG", + Ph => "PH", + Pk => "PK", + Pl => "PL", + Pm => "PM", + Pn => "PN", + Pr => "PR", + Ps => "PS", + Pt => "PT", + Py => "PY", + Qa => "QA", + Re => "RE", + Ro => "RO", + Rs => "RS", + Ru => "RU", + Rw => "RW", + Sa => "SA", + Sb => "SB", + Sc => "SC", + Se => "SE", + Sg => "SG", + Sh => "SH", + Si => "SI", + Sj => "SJ", + Sk => "SK", + Sl => "SL", + Sm => "SM", + Sn => "SN", + So => "SO", + Sr => "SR", + Ss => "SS", + St => "ST", + Sv => "SV", + Sx => "SX", + Sz => "SZ", + Ta => "TA", + Tc => "TC", + Td => "TD", + Tf => "TF", + Tg => "TG", + Th => "TH", + Tj => "TJ", + Tk => "TK", + Tl => "TL", + Tm => "TM", + Tn => "TN", + To => "TO", + Tr => "TR", + Tt => "TT", + Tv => "TV", + Tw => "TW", + Tz => "TZ", + Ua => "UA", + Ug => "UG", + Us => "US", + Uy => "UY", + Uz => "UZ", + Va => "VA", + Vc => "VC", + Ve => "VE", + Vg => "VG", + Vn => "VN", + Vu => "VU", + Wf => "WF", + Ws => "WS", + Xk => "XK", + Ye => "YE", + Yt => "YT", + Za => "ZA", + Zm => "ZM", + Zw => "ZW", + Zz => "ZZ", + Unknown => "unknown", + } + } +} + +impl std::str::FromStr for CreatePaymentLinkShippingAddressCollectionAllowedCountries { + type Err = (); + fn from_str(s: &str) -> Result { + use CreatePaymentLinkShippingAddressCollectionAllowedCountries::*; + match s { + "AC" => Ok(Ac), + "AD" => Ok(Ad), + "AE" => Ok(Ae), + "AF" => Ok(Af), + "AG" => Ok(Ag), + "AI" => Ok(Ai), + "AL" => Ok(Al), + "AM" => Ok(Am), + "AO" => Ok(Ao), + "AQ" => Ok(Aq), + "AR" => Ok(Ar), + "AT" => Ok(At), + "AU" => Ok(Au), + "AW" => Ok(Aw), + "AX" => Ok(Ax), + "AZ" => Ok(Az), + "BA" => Ok(Ba), + "BB" => Ok(Bb), + "BD" => Ok(Bd), + "BE" => Ok(Be), + "BF" => Ok(Bf), + "BG" => Ok(Bg), + "BH" => Ok(Bh), + "BI" => Ok(Bi), + "BJ" => Ok(Bj), + "BL" => Ok(Bl), + "BM" => Ok(Bm), + "BN" => Ok(Bn), + "BO" => Ok(Bo), + "BQ" => Ok(Bq), + "BR" => Ok(Br), + "BS" => Ok(Bs), + "BT" => Ok(Bt), + "BV" => Ok(Bv), + "BW" => Ok(Bw), + "BY" => Ok(By), + "BZ" => Ok(Bz), + "CA" => Ok(Ca), + "CD" => Ok(Cd), + "CF" => Ok(Cf), + "CG" => Ok(Cg), + "CH" => Ok(Ch), + "CI" => Ok(Ci), + "CK" => Ok(Ck), + "CL" => Ok(Cl), + "CM" => Ok(Cm), + "CN" => Ok(Cn), + "CO" => Ok(Co), + "CR" => Ok(Cr), + "CV" => Ok(Cv), + "CW" => Ok(Cw), + "CY" => Ok(Cy), + "CZ" => Ok(Cz), + "DE" => Ok(De), + "DJ" => Ok(Dj), + "DK" => Ok(Dk), + "DM" => Ok(Dm), + "DO" => Ok(Do), + "DZ" => Ok(Dz), + "EC" => Ok(Ec), + "EE" => Ok(Ee), + "EG" => Ok(Eg), + "EH" => Ok(Eh), + "ER" => Ok(Er), + "ES" => Ok(Es), + "ET" => Ok(Et), + "FI" => Ok(Fi), + "FJ" => Ok(Fj), + "FK" => Ok(Fk), + "FO" => Ok(Fo), + "FR" => Ok(Fr), + "GA" => Ok(Ga), + "GB" => Ok(Gb), + "GD" => Ok(Gd), + "GE" => Ok(Ge), + "GF" => Ok(Gf), + "GG" => Ok(Gg), + "GH" => Ok(Gh), + "GI" => Ok(Gi), + "GL" => Ok(Gl), + "GM" => Ok(Gm), + "GN" => Ok(Gn), + "GP" => Ok(Gp), + "GQ" => Ok(Gq), + "GR" => Ok(Gr), + "GS" => Ok(Gs), + "GT" => Ok(Gt), + "GU" => Ok(Gu), + "GW" => Ok(Gw), + "GY" => Ok(Gy), + "HK" => Ok(Hk), + "HN" => Ok(Hn), + "HR" => Ok(Hr), + "HT" => Ok(Ht), + "HU" => Ok(Hu), + "ID" => Ok(Id), + "IE" => Ok(Ie), + "IL" => Ok(Il), + "IM" => Ok(Im), + "IN" => Ok(In), + "IO" => Ok(Io), + "IQ" => Ok(Iq), + "IS" => Ok(Is), + "IT" => Ok(It), + "JE" => Ok(Je), + "JM" => Ok(Jm), + "JO" => Ok(Jo), + "JP" => Ok(Jp), + "KE" => Ok(Ke), + "KG" => Ok(Kg), + "KH" => Ok(Kh), + "KI" => Ok(Ki), + "KM" => Ok(Km), + "KN" => Ok(Kn), + "KR" => Ok(Kr), + "KW" => Ok(Kw), + "KY" => Ok(Ky), + "KZ" => Ok(Kz), + "LA" => Ok(La), + "LB" => Ok(Lb), + "LC" => Ok(Lc), + "LI" => Ok(Li), + "LK" => Ok(Lk), + "LR" => Ok(Lr), + "LS" => Ok(Ls), + "LT" => Ok(Lt), + "LU" => Ok(Lu), + "LV" => Ok(Lv), + "LY" => Ok(Ly), + "MA" => Ok(Ma), + "MC" => Ok(Mc), + "MD" => Ok(Md), + "ME" => Ok(Me), + "MF" => Ok(Mf), + "MG" => Ok(Mg), + "MK" => Ok(Mk), + "ML" => Ok(Ml), + "MM" => Ok(Mm), + "MN" => Ok(Mn), + "MO" => Ok(Mo), + "MQ" => Ok(Mq), + "MR" => Ok(Mr), + "MS" => Ok(Ms), + "MT" => Ok(Mt), + "MU" => Ok(Mu), + "MV" => Ok(Mv), + "MW" => Ok(Mw), + "MX" => Ok(Mx), + "MY" => Ok(My), + "MZ" => Ok(Mz), + "NA" => Ok(Na), + "NC" => Ok(Nc), + "NE" => Ok(Ne), + "NG" => Ok(Ng), + "NI" => Ok(Ni), + "NL" => Ok(Nl), + "NO" => Ok(No), + "NP" => Ok(Np), + "NR" => Ok(Nr), + "NU" => Ok(Nu), + "NZ" => Ok(Nz), + "OM" => Ok(Om), + "PA" => Ok(Pa), + "PE" => Ok(Pe), + "PF" => Ok(Pf), + "PG" => Ok(Pg), + "PH" => Ok(Ph), + "PK" => Ok(Pk), + "PL" => Ok(Pl), + "PM" => Ok(Pm), + "PN" => Ok(Pn), + "PR" => Ok(Pr), + "PS" => Ok(Ps), + "PT" => Ok(Pt), + "PY" => Ok(Py), + "QA" => Ok(Qa), + "RE" => Ok(Re), + "RO" => Ok(Ro), + "RS" => Ok(Rs), + "RU" => Ok(Ru), + "RW" => Ok(Rw), + "SA" => Ok(Sa), + "SB" => Ok(Sb), + "SC" => Ok(Sc), + "SE" => Ok(Se), + "SG" => Ok(Sg), + "SH" => Ok(Sh), + "SI" => Ok(Si), + "SJ" => Ok(Sj), + "SK" => Ok(Sk), + "SL" => Ok(Sl), + "SM" => Ok(Sm), + "SN" => Ok(Sn), + "SO" => Ok(So), + "SR" => Ok(Sr), + "SS" => Ok(Ss), + "ST" => Ok(St), + "SV" => Ok(Sv), + "SX" => Ok(Sx), + "SZ" => Ok(Sz), + "TA" => Ok(Ta), + "TC" => Ok(Tc), + "TD" => Ok(Td), + "TF" => Ok(Tf), + "TG" => Ok(Tg), + "TH" => Ok(Th), + "TJ" => Ok(Tj), + "TK" => Ok(Tk), + "TL" => Ok(Tl), + "TM" => Ok(Tm), + "TN" => Ok(Tn), + "TO" => Ok(To), + "TR" => Ok(Tr), + "TT" => Ok(Tt), + "TV" => Ok(Tv), + "TW" => Ok(Tw), + "TZ" => Ok(Tz), + "UA" => Ok(Ua), + "UG" => Ok(Ug), + "US" => Ok(Us), + "UY" => Ok(Uy), + "UZ" => Ok(Uz), + "VA" => Ok(Va), + "VC" => Ok(Vc), + "VE" => Ok(Ve), + "VG" => Ok(Vg), + "VN" => Ok(Vn), + "VU" => Ok(Vu), + "WF" => Ok(Wf), + "WS" => Ok(Ws), + "XK" => Ok(Xk), + "YE" => Ok(Ye), + "YT" => Ok(Yt), + "ZA" => Ok(Za), + "ZM" => Ok(Zm), + "ZW" => Ok(Zw), + "ZZ" => Ok(Zz), + _ => Err(()), + } + } +} +impl std::fmt::Display for CreatePaymentLinkShippingAddressCollectionAllowedCountries { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreatePaymentLinkShippingAddressCollectionAllowedCountries { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreatePaymentLinkShippingAddressCollectionAllowedCountries { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// The shipping rate options to apply to [checkout sessions](https://stripe.com/docs/api/checkout/sessions) created by this payment link. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreatePaymentLinkShippingOptions<'a> { + /// The ID of the Shipping Rate to use for this shipping option. + #[serde(skip_serializing_if = "Option::is_none")] + pub shipping_rate: Option<&'a str>, +} +impl<'a> CreatePaymentLinkShippingOptions<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// When creating a subscription, the specified configuration data will be used. +/// There must be at least one line item with a recurring price to use `subscription_data`. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreatePaymentLinkSubscriptionData<'a> { + /// The subscription's description, meant to be displayable to the customer. + /// Use this field to optionally store an explanation of the subscription for rendering in Stripe surfaces and certain local payment methods UIs. + #[serde(skip_serializing_if = "Option::is_none")] + pub description: Option<&'a str>, + /// All invoices will be billed using the specified settings. + #[serde(skip_serializing_if = "Option::is_none")] + pub invoice_settings: Option>, + /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that will declaratively set metadata on [Subscriptions](https://stripe.com/docs/api/subscriptions) generated from this payment link. + /// Unlike object-level metadata, this field is declarative. + /// Updates will clear prior values. + #[serde(skip_serializing_if = "Option::is_none")] + pub metadata: Option<&'a std::collections::HashMap>, + /// Integer representing the number of trial period days before the customer is charged for the first time. + /// Has to be at least 1. + #[serde(skip_serializing_if = "Option::is_none")] + pub trial_period_days: Option, + /// Settings related to subscription trials. + #[serde(skip_serializing_if = "Option::is_none")] + pub trial_settings: Option, +} +impl<'a> CreatePaymentLinkSubscriptionData<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// All invoices will be billed using the specified settings. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreatePaymentLinkSubscriptionDataInvoiceSettings<'a> { + /// The connected account that issues the invoice. + /// The invoice is presented with the branding and support information of the specified account. + #[serde(skip_serializing_if = "Option::is_none")] + pub issuer: Option>, +} +impl<'a> CreatePaymentLinkSubscriptionDataInvoiceSettings<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// The connected account that issues the invoice. +/// The invoice is presented with the branding and support information of the specified account. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreatePaymentLinkSubscriptionDataInvoiceSettingsIssuer<'a> { + /// The connected account being referenced when `type` is `account`. + #[serde(skip_serializing_if = "Option::is_none")] + pub account: Option<&'a str>, + /// Type of the account referenced in the request. + #[serde(rename = "type")] + pub type_: CreatePaymentLinkSubscriptionDataInvoiceSettingsIssuerType, +} +impl<'a> CreatePaymentLinkSubscriptionDataInvoiceSettingsIssuer<'a> { + pub fn new(type_: CreatePaymentLinkSubscriptionDataInvoiceSettingsIssuerType) -> Self { + Self { account: None, type_ } + } +} +/// Type of the account referenced in the request. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreatePaymentLinkSubscriptionDataInvoiceSettingsIssuerType { + Account, + Self_, +} +impl CreatePaymentLinkSubscriptionDataInvoiceSettingsIssuerType { + pub fn as_str(self) -> &'static str { + use CreatePaymentLinkSubscriptionDataInvoiceSettingsIssuerType::*; + match self { + Account => "account", + Self_ => "self", + } + } +} + +impl std::str::FromStr for CreatePaymentLinkSubscriptionDataInvoiceSettingsIssuerType { + type Err = (); + fn from_str(s: &str) -> Result { + use CreatePaymentLinkSubscriptionDataInvoiceSettingsIssuerType::*; + match s { + "account" => Ok(Account), + "self" => Ok(Self_), + _ => Err(()), + } + } +} +impl std::fmt::Display for CreatePaymentLinkSubscriptionDataInvoiceSettingsIssuerType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreatePaymentLinkSubscriptionDataInvoiceSettingsIssuerType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreatePaymentLinkSubscriptionDataInvoiceSettingsIssuerType { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Settings related to subscription trials. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreatePaymentLinkSubscriptionDataTrialSettings { + /// Defines how the subscription should behave when the user's free trial ends. + pub end_behavior: CreatePaymentLinkSubscriptionDataTrialSettingsEndBehavior, +} +impl CreatePaymentLinkSubscriptionDataTrialSettings { + pub fn new(end_behavior: CreatePaymentLinkSubscriptionDataTrialSettingsEndBehavior) -> Self { + Self { end_behavior } + } +} +/// Defines how the subscription should behave when the user's free trial ends. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreatePaymentLinkSubscriptionDataTrialSettingsEndBehavior { + /// Indicates how the subscription should change when the trial ends if the user did not provide a payment method. + pub missing_payment_method: + CreatePaymentLinkSubscriptionDataTrialSettingsEndBehaviorMissingPaymentMethod, +} +impl CreatePaymentLinkSubscriptionDataTrialSettingsEndBehavior { + pub fn new( + missing_payment_method: CreatePaymentLinkSubscriptionDataTrialSettingsEndBehaviorMissingPaymentMethod, + ) -> Self { + Self { missing_payment_method } + } +} +/// Indicates how the subscription should change when the trial ends if the user did not provide a payment method. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreatePaymentLinkSubscriptionDataTrialSettingsEndBehaviorMissingPaymentMethod { + Cancel, + CreateInvoice, + Pause, +} +impl CreatePaymentLinkSubscriptionDataTrialSettingsEndBehaviorMissingPaymentMethod { + pub fn as_str(self) -> &'static str { + use CreatePaymentLinkSubscriptionDataTrialSettingsEndBehaviorMissingPaymentMethod::*; + match self { + Cancel => "cancel", + CreateInvoice => "create_invoice", + Pause => "pause", + } + } +} + +impl std::str::FromStr + for CreatePaymentLinkSubscriptionDataTrialSettingsEndBehaviorMissingPaymentMethod +{ + type Err = (); + fn from_str(s: &str) -> Result { + use CreatePaymentLinkSubscriptionDataTrialSettingsEndBehaviorMissingPaymentMethod::*; + match s { + "cancel" => Ok(Cancel), + "create_invoice" => Ok(CreateInvoice), + "pause" => Ok(Pause), + _ => Err(()), + } + } +} +impl std::fmt::Display + for CreatePaymentLinkSubscriptionDataTrialSettingsEndBehaviorMissingPaymentMethod +{ + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug + for CreatePaymentLinkSubscriptionDataTrialSettingsEndBehaviorMissingPaymentMethod +{ + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize + for CreatePaymentLinkSubscriptionDataTrialSettingsEndBehaviorMissingPaymentMethod +{ + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Controls tax ID collection during checkout. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreatePaymentLinkTaxIdCollection { + /// Set to `true` to enable tax ID collection. + pub enabled: bool, +} +impl CreatePaymentLinkTaxIdCollection { + pub fn new(enabled: bool) -> Self { + Self { enabled } + } +} +/// The account (if any) the payments will be attributed to for tax reporting, and where funds from each payment will be transferred to. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreatePaymentLinkTransferData<'a> { + /// The amount that will be transferred automatically when a charge succeeds. + #[serde(skip_serializing_if = "Option::is_none")] + pub amount: Option, + /// If specified, successful charges will be attributed to the destination + /// account for tax reporting, and the funds from charges will be transferred + /// to the destination account. The ID of the resulting transfer will be + /// returned on the successful charge's `transfer` field. + pub destination: &'a str, +} +impl<'a> CreatePaymentLinkTransferData<'a> { + pub fn new(destination: &'a str) -> Self { + Self { amount: None, destination } + } +} +impl<'a> CreatePaymentLink<'a> { + /// Creates a payment link. + pub fn send(&self, client: &stripe::Client) -> stripe::Response { + client.send_form("/payment_links", self, http_types::Method::Post) + } +} +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdatePaymentLink<'a> { + /// Whether the payment link's `url` is active. + /// If `false`, customers visiting the URL will be shown a page saying that the link has been deactivated. + #[serde(skip_serializing_if = "Option::is_none")] + pub active: Option, + /// Behavior after the purchase is complete. + #[serde(skip_serializing_if = "Option::is_none")] + pub after_completion: Option>, + /// Enables user redeemable promotion codes. + #[serde(skip_serializing_if = "Option::is_none")] + pub allow_promotion_codes: Option, + /// Configuration for automatic tax collection. + #[serde(skip_serializing_if = "Option::is_none")] + pub automatic_tax: Option>, + /// Configuration for collecting the customer's billing address. + #[serde(skip_serializing_if = "Option::is_none")] + pub billing_address_collection: Option, + /// Collect additional information from your customer using custom fields. + /// Up to 3 fields are supported. + #[serde(skip_serializing_if = "Option::is_none")] + pub custom_fields: Option<&'a [UpdatePaymentLinkCustomFields<'a>]>, + /// Display additional text for your customers using custom text. + #[serde(skip_serializing_if = "Option::is_none")] + pub custom_text: Option>, + /// Configures whether [checkout sessions](https://stripe.com/docs/api/checkout/sessions) created by this payment link create a [Customer](https://stripe.com/docs/api/customers). + #[serde(skip_serializing_if = "Option::is_none")] + pub customer_creation: Option, + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, + /// The custom message to be displayed to a customer when a payment link is no longer active. + #[serde(skip_serializing_if = "Option::is_none")] + pub inactive_message: Option<&'a str>, + /// Generate a post-purchase Invoice for one-time payments. + #[serde(skip_serializing_if = "Option::is_none")] + pub invoice_creation: Option>, + /// The line items representing what is being sold. + /// Each line item represents an item being sold. + /// Up to 20 line items are supported. + #[serde(skip_serializing_if = "Option::is_none")] + pub line_items: Option<&'a [UpdatePaymentLinkLineItems<'a>]>, + /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. + /// This can be useful for storing additional information about the object in a structured format. + /// Individual keys can be unset by posting an empty value to them. + /// All keys can be unset by posting an empty value to `metadata`. + /// Metadata associated with this Payment Link will automatically be copied to [checkout sessions](https://stripe.com/docs/api/checkout/sessions) created by this payment link. + #[serde(skip_serializing_if = "Option::is_none")] + pub metadata: Option<&'a std::collections::HashMap>, + /// A subset of parameters to be passed to PaymentIntent creation for Checkout Sessions in `payment` mode. + #[serde(skip_serializing_if = "Option::is_none")] + pub payment_intent_data: Option>, + /// Specify whether Checkout should collect a payment method. + /// When set to `if_required`, Checkout will not collect a payment method when the total due for the session is 0.This may occur if the Checkout Session includes a free trial or a discount. + /// + /// Can only be set in `subscription` mode. + /// + /// If you'd like information on how to collect a payment method outside of Checkout, read the guide on [configuring subscriptions with a free trial](https://stripe.com/docs/payments/checkout/free-trials). + #[serde(skip_serializing_if = "Option::is_none")] + pub payment_method_collection: Option, + /// The list of payment method types that customers can use. + /// Pass an empty string to enable dynamic payment methods that use your [payment method settings](https://dashboard.stripe.com/settings/payment_methods). + #[serde(skip_serializing_if = "Option::is_none")] + pub payment_method_types: Option<&'a [stripe_shared::PaymentLinkPaymentMethodTypes]>, + /// Settings that restrict the usage of a payment link. + #[serde(skip_serializing_if = "Option::is_none")] + pub restrictions: Option, + /// Configuration for collecting the customer's shipping address. + #[serde(skip_serializing_if = "Option::is_none")] + pub shipping_address_collection: Option>, + /// When creating a subscription, the specified configuration data will be used. + /// There must be at least one line item with a recurring price to use `subscription_data`. + #[serde(skip_serializing_if = "Option::is_none")] + pub subscription_data: Option>, +} +impl<'a> UpdatePaymentLink<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// Behavior after the purchase is complete. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct UpdatePaymentLinkAfterCompletion<'a> { + /// Configuration when `type=hosted_confirmation`. + #[serde(skip_serializing_if = "Option::is_none")] + pub hosted_confirmation: Option>, + /// Configuration when `type=redirect`. + #[serde(skip_serializing_if = "Option::is_none")] + pub redirect: Option>, + /// The specified behavior after the purchase is complete. Either `redirect` or `hosted_confirmation`. + #[serde(rename = "type")] + pub type_: UpdatePaymentLinkAfterCompletionType, +} +impl<'a> UpdatePaymentLinkAfterCompletion<'a> { + pub fn new(type_: UpdatePaymentLinkAfterCompletionType) -> Self { + Self { hosted_confirmation: None, redirect: None, type_ } + } +} +/// The specified behavior after the purchase is complete. Either `redirect` or `hosted_confirmation`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum UpdatePaymentLinkAfterCompletionType { + HostedConfirmation, + Redirect, +} +impl UpdatePaymentLinkAfterCompletionType { + pub fn as_str(self) -> &'static str { + use UpdatePaymentLinkAfterCompletionType::*; + match self { + HostedConfirmation => "hosted_confirmation", + Redirect => "redirect", + } + } +} + +impl std::str::FromStr for UpdatePaymentLinkAfterCompletionType { + type Err = (); + fn from_str(s: &str) -> Result { + use UpdatePaymentLinkAfterCompletionType::*; + match s { + "hosted_confirmation" => Ok(HostedConfirmation), + "redirect" => Ok(Redirect), + _ => Err(()), + } + } +} +impl std::fmt::Display for UpdatePaymentLinkAfterCompletionType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for UpdatePaymentLinkAfterCompletionType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for UpdatePaymentLinkAfterCompletionType { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Configuration for automatic tax collection. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct UpdatePaymentLinkAutomaticTax<'a> { + /// If `true`, tax will be calculated automatically using the customer's location. + pub enabled: bool, + /// The account that's liable for tax. + /// If set, the business address and tax registrations required to perform the tax calculation are loaded from this account. + /// The tax transaction is returned in the report of the connected account. + #[serde(skip_serializing_if = "Option::is_none")] + pub liability: Option>, +} +impl<'a> UpdatePaymentLinkAutomaticTax<'a> { + pub fn new(enabled: bool) -> Self { + Self { enabled, liability: None } + } +} +/// The account that's liable for tax. +/// If set, the business address and tax registrations required to perform the tax calculation are loaded from this account. +/// The tax transaction is returned in the report of the connected account. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct UpdatePaymentLinkAutomaticTaxLiability<'a> { + /// The connected account being referenced when `type` is `account`. + #[serde(skip_serializing_if = "Option::is_none")] + pub account: Option<&'a str>, + /// Type of the account referenced in the request. + #[serde(rename = "type")] + pub type_: UpdatePaymentLinkAutomaticTaxLiabilityType, +} +impl<'a> UpdatePaymentLinkAutomaticTaxLiability<'a> { + pub fn new(type_: UpdatePaymentLinkAutomaticTaxLiabilityType) -> Self { + Self { account: None, type_ } + } +} +/// Type of the account referenced in the request. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum UpdatePaymentLinkAutomaticTaxLiabilityType { + Account, + Self_, +} +impl UpdatePaymentLinkAutomaticTaxLiabilityType { + pub fn as_str(self) -> &'static str { + use UpdatePaymentLinkAutomaticTaxLiabilityType::*; + match self { + Account => "account", + Self_ => "self", + } + } +} + +impl std::str::FromStr for UpdatePaymentLinkAutomaticTaxLiabilityType { + type Err = (); + fn from_str(s: &str) -> Result { + use UpdatePaymentLinkAutomaticTaxLiabilityType::*; + match s { + "account" => Ok(Account), + "self" => Ok(Self_), + _ => Err(()), + } + } +} +impl std::fmt::Display for UpdatePaymentLinkAutomaticTaxLiabilityType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for UpdatePaymentLinkAutomaticTaxLiabilityType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for UpdatePaymentLinkAutomaticTaxLiabilityType { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Collect additional information from your customer using custom fields. +/// Up to 3 fields are supported. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct UpdatePaymentLinkCustomFields<'a> { + /// Configuration for `type=dropdown` fields. + #[serde(skip_serializing_if = "Option::is_none")] + pub dropdown: Option>, + /// String of your choice that your integration can use to reconcile this field. + /// Must be unique to this field, alphanumeric, and up to 200 characters. + pub key: &'a str, + /// The label for the field, displayed to the customer. + pub label: UpdatePaymentLinkCustomFieldsLabel<'a>, + /// Configuration for `type=numeric` fields. + #[serde(skip_serializing_if = "Option::is_none")] + pub numeric: Option, + /// Whether the customer is required to complete the field before completing the Checkout Session. + /// Defaults to `false`. + #[serde(skip_serializing_if = "Option::is_none")] + pub optional: Option, + /// Configuration for `type=text` fields. + #[serde(skip_serializing_if = "Option::is_none")] + pub text: Option, + /// The type of the field. + #[serde(rename = "type")] + pub type_: UpdatePaymentLinkCustomFieldsType, +} +impl<'a> UpdatePaymentLinkCustomFields<'a> { + pub fn new( + key: &'a str, + label: UpdatePaymentLinkCustomFieldsLabel<'a>, + type_: UpdatePaymentLinkCustomFieldsType, + ) -> Self { + Self { dropdown: None, key, label, numeric: None, optional: None, text: None, type_ } + } +} +/// The label for the field, displayed to the customer. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct UpdatePaymentLinkCustomFieldsLabel<'a> { + /// Custom text for the label, displayed to the customer. Up to 50 characters. + pub custom: &'a str, + /// The type of the label. + #[serde(rename = "type")] + pub type_: UpdatePaymentLinkCustomFieldsLabelType, +} +impl<'a> UpdatePaymentLinkCustomFieldsLabel<'a> { + pub fn new(custom: &'a str, type_: UpdatePaymentLinkCustomFieldsLabelType) -> Self { + Self { custom, type_ } + } +} +/// The type of the label. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum UpdatePaymentLinkCustomFieldsLabelType { + Custom, +} +impl UpdatePaymentLinkCustomFieldsLabelType { + pub fn as_str(self) -> &'static str { + use UpdatePaymentLinkCustomFieldsLabelType::*; + match self { + Custom => "custom", + } + } +} + +impl std::str::FromStr for UpdatePaymentLinkCustomFieldsLabelType { + type Err = (); + fn from_str(s: &str) -> Result { + use UpdatePaymentLinkCustomFieldsLabelType::*; + match s { + "custom" => Ok(Custom), + _ => Err(()), + } + } +} +impl std::fmt::Display for UpdatePaymentLinkCustomFieldsLabelType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for UpdatePaymentLinkCustomFieldsLabelType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for UpdatePaymentLinkCustomFieldsLabelType { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Configuration for `type=numeric` fields. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdatePaymentLinkCustomFieldsNumeric { + /// The maximum character length constraint for the customer's input. + #[serde(skip_serializing_if = "Option::is_none")] + pub maximum_length: Option, + /// The minimum character length requirement for the customer's input. + #[serde(skip_serializing_if = "Option::is_none")] + pub minimum_length: Option, +} +impl UpdatePaymentLinkCustomFieldsNumeric { + pub fn new() -> Self { + Self::default() + } +} +/// Configuration for `type=text` fields. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdatePaymentLinkCustomFieldsText { + /// The maximum character length constraint for the customer's input. + #[serde(skip_serializing_if = "Option::is_none")] + pub maximum_length: Option, + /// The minimum character length requirement for the customer's input. + #[serde(skip_serializing_if = "Option::is_none")] + pub minimum_length: Option, +} +impl UpdatePaymentLinkCustomFieldsText { + pub fn new() -> Self { + Self::default() + } +} +/// The type of the field. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum UpdatePaymentLinkCustomFieldsType { + Dropdown, + Numeric, + Text, +} +impl UpdatePaymentLinkCustomFieldsType { + pub fn as_str(self) -> &'static str { + use UpdatePaymentLinkCustomFieldsType::*; + match self { + Dropdown => "dropdown", + Numeric => "numeric", + Text => "text", + } + } +} + +impl std::str::FromStr for UpdatePaymentLinkCustomFieldsType { + type Err = (); + fn from_str(s: &str) -> Result { + use UpdatePaymentLinkCustomFieldsType::*; + match s { + "dropdown" => Ok(Dropdown), + "numeric" => Ok(Numeric), + "text" => Ok(Text), + _ => Err(()), + } + } +} +impl std::fmt::Display for UpdatePaymentLinkCustomFieldsType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for UpdatePaymentLinkCustomFieldsType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for UpdatePaymentLinkCustomFieldsType { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Configures whether [checkout sessions](https://stripe.com/docs/api/checkout/sessions) created by this payment link create a [Customer](https://stripe.com/docs/api/customers). +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum UpdatePaymentLinkCustomerCreation { + Always, + IfRequired, +} +impl UpdatePaymentLinkCustomerCreation { + pub fn as_str(self) -> &'static str { + use UpdatePaymentLinkCustomerCreation::*; + match self { + Always => "always", + IfRequired => "if_required", + } + } +} + +impl std::str::FromStr for UpdatePaymentLinkCustomerCreation { + type Err = (); + fn from_str(s: &str) -> Result { + use UpdatePaymentLinkCustomerCreation::*; + match s { + "always" => Ok(Always), + "if_required" => Ok(IfRequired), + _ => Err(()), + } + } +} +impl std::fmt::Display for UpdatePaymentLinkCustomerCreation { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for UpdatePaymentLinkCustomerCreation { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for UpdatePaymentLinkCustomerCreation { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Generate a post-purchase Invoice for one-time payments. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct UpdatePaymentLinkInvoiceCreation<'a> { + /// Whether the feature is enabled + pub enabled: bool, + /// Invoice PDF configuration. + #[serde(skip_serializing_if = "Option::is_none")] + pub invoice_data: Option>, +} +impl<'a> UpdatePaymentLinkInvoiceCreation<'a> { + pub fn new(enabled: bool) -> Self { + Self { enabled, invoice_data: None } + } +} +/// Invoice PDF configuration. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdatePaymentLinkInvoiceCreationInvoiceData<'a> { + /// The account tax IDs associated with the invoice. + #[serde(skip_serializing_if = "Option::is_none")] + pub account_tax_ids: Option<&'a [&'a str]>, + /// Default custom fields to be displayed on invoices for this customer. + #[serde(skip_serializing_if = "Option::is_none")] + pub custom_fields: Option<&'a [CustomFieldParams<'a>]>, + /// An arbitrary string attached to the object. Often useful for displaying to users. + #[serde(skip_serializing_if = "Option::is_none")] + pub description: Option<&'a str>, + /// Default footer to be displayed on invoices for this customer. + #[serde(skip_serializing_if = "Option::is_none")] + pub footer: Option<&'a str>, + /// The connected account that issues the invoice. + /// The invoice is presented with the branding and support information of the specified account. + #[serde(skip_serializing_if = "Option::is_none")] + pub issuer: Option>, + /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. + /// This can be useful for storing additional information about the object in a structured format. + /// Individual keys can be unset by posting an empty value to them. + /// All keys can be unset by posting an empty value to `metadata`. + #[serde(skip_serializing_if = "Option::is_none")] + pub metadata: Option<&'a std::collections::HashMap>, + /// Default options for invoice PDF rendering for this customer. + #[serde(skip_serializing_if = "Option::is_none")] + pub rendering_options: Option, +} +impl<'a> UpdatePaymentLinkInvoiceCreationInvoiceData<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// The connected account that issues the invoice. +/// The invoice is presented with the branding and support information of the specified account. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct UpdatePaymentLinkInvoiceCreationInvoiceDataIssuer<'a> { + /// The connected account being referenced when `type` is `account`. + #[serde(skip_serializing_if = "Option::is_none")] + pub account: Option<&'a str>, + /// Type of the account referenced in the request. + #[serde(rename = "type")] + pub type_: UpdatePaymentLinkInvoiceCreationInvoiceDataIssuerType, +} +impl<'a> UpdatePaymentLinkInvoiceCreationInvoiceDataIssuer<'a> { + pub fn new(type_: UpdatePaymentLinkInvoiceCreationInvoiceDataIssuerType) -> Self { + Self { account: None, type_ } + } +} +/// Type of the account referenced in the request. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum UpdatePaymentLinkInvoiceCreationInvoiceDataIssuerType { + Account, + Self_, +} +impl UpdatePaymentLinkInvoiceCreationInvoiceDataIssuerType { + pub fn as_str(self) -> &'static str { + use UpdatePaymentLinkInvoiceCreationInvoiceDataIssuerType::*; + match self { + Account => "account", + Self_ => "self", + } + } +} + +impl std::str::FromStr for UpdatePaymentLinkInvoiceCreationInvoiceDataIssuerType { + type Err = (); + fn from_str(s: &str) -> Result { + use UpdatePaymentLinkInvoiceCreationInvoiceDataIssuerType::*; + match s { + "account" => Ok(Account), + "self" => Ok(Self_), + _ => Err(()), + } + } +} +impl std::fmt::Display for UpdatePaymentLinkInvoiceCreationInvoiceDataIssuerType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for UpdatePaymentLinkInvoiceCreationInvoiceDataIssuerType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for UpdatePaymentLinkInvoiceCreationInvoiceDataIssuerType { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Default options for invoice PDF rendering for this customer. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdatePaymentLinkInvoiceCreationInvoiceDataRenderingOptions { + /// How line-item prices and amounts will be displayed with respect to tax on invoice PDFs. + /// One of `exclude_tax` or `include_inclusive_tax`. + /// `include_inclusive_tax` will include inclusive tax (and exclude exclusive tax) in invoice PDF amounts. + /// `exclude_tax` will exclude all tax (inclusive and exclusive alike) from invoice PDF amounts. + #[serde(skip_serializing_if = "Option::is_none")] + pub amount_tax_display: + Option, +} +impl UpdatePaymentLinkInvoiceCreationInvoiceDataRenderingOptions { + pub fn new() -> Self { + Self::default() + } +} +/// How line-item prices and amounts will be displayed with respect to tax on invoice PDFs. +/// One of `exclude_tax` or `include_inclusive_tax`. +/// `include_inclusive_tax` will include inclusive tax (and exclude exclusive tax) in invoice PDF amounts. +/// `exclude_tax` will exclude all tax (inclusive and exclusive alike) from invoice PDF amounts. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum UpdatePaymentLinkInvoiceCreationInvoiceDataRenderingOptionsAmountTaxDisplay { + ExcludeTax, + IncludeInclusiveTax, +} +impl UpdatePaymentLinkInvoiceCreationInvoiceDataRenderingOptionsAmountTaxDisplay { + pub fn as_str(self) -> &'static str { + use UpdatePaymentLinkInvoiceCreationInvoiceDataRenderingOptionsAmountTaxDisplay::*; + match self { + ExcludeTax => "exclude_tax", + IncludeInclusiveTax => "include_inclusive_tax", + } + } +} + +impl std::str::FromStr + for UpdatePaymentLinkInvoiceCreationInvoiceDataRenderingOptionsAmountTaxDisplay +{ + type Err = (); + fn from_str(s: &str) -> Result { + use UpdatePaymentLinkInvoiceCreationInvoiceDataRenderingOptionsAmountTaxDisplay::*; + match s { + "exclude_tax" => Ok(ExcludeTax), + "include_inclusive_tax" => Ok(IncludeInclusiveTax), + _ => Err(()), + } + } +} +impl std::fmt::Display + for UpdatePaymentLinkInvoiceCreationInvoiceDataRenderingOptionsAmountTaxDisplay +{ + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug + for UpdatePaymentLinkInvoiceCreationInvoiceDataRenderingOptionsAmountTaxDisplay +{ + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize + for UpdatePaymentLinkInvoiceCreationInvoiceDataRenderingOptionsAmountTaxDisplay +{ + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// The line items representing what is being sold. +/// Each line item represents an item being sold. +/// Up to 20 line items are supported. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct UpdatePaymentLinkLineItems<'a> { + /// When set, provides configuration for this item’s quantity to be adjusted by the customer during checkout. + #[serde(skip_serializing_if = "Option::is_none")] + pub adjustable_quantity: Option, + /// The ID of an existing line item on the payment link. + pub id: &'a str, + /// The quantity of the line item being purchased. + #[serde(skip_serializing_if = "Option::is_none")] + pub quantity: Option, +} +impl<'a> UpdatePaymentLinkLineItems<'a> { + pub fn new(id: &'a str) -> Self { + Self { adjustable_quantity: None, id, quantity: None } + } +} +/// A subset of parameters to be passed to PaymentIntent creation for Checkout Sessions in `payment` mode. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdatePaymentLinkPaymentIntentData<'a> { + /// An arbitrary string attached to the object. Often useful for displaying to users. + #[serde(skip_serializing_if = "Option::is_none")] + pub description: Option<&'a str>, + /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that will declaratively set metadata on [Payment Intents](https://stripe.com/docs/api/payment_intents) generated from this payment link. + /// Unlike object-level metadata, this field is declarative. + /// Updates will clear prior values. + #[serde(skip_serializing_if = "Option::is_none")] + pub metadata: Option<&'a std::collections::HashMap>, + /// Extra information about the payment. + /// This will appear on your customer's statement when this payment succeeds in creating a charge. + #[serde(skip_serializing_if = "Option::is_none")] + pub statement_descriptor: Option<&'a str>, + /// Provides information about the charge that customers see on their statements. + /// Concatenated with the prefix (shortened descriptor) or statement descriptor that's set on the account to form the complete statement descriptor. + /// Maximum 22 characters for the concatenated descriptor. + #[serde(skip_serializing_if = "Option::is_none")] + pub statement_descriptor_suffix: Option<&'a str>, + /// A string that identifies the resulting payment as part of a group. + /// See the PaymentIntents [use case for connected accounts](https://stripe.com/docs/connect/separate-charges-and-transfers) for details. + #[serde(skip_serializing_if = "Option::is_none")] + pub transfer_group: Option<&'a str>, +} +impl<'a> UpdatePaymentLinkPaymentIntentData<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// Specify whether Checkout should collect a payment method. +/// When set to `if_required`, Checkout will not collect a payment method when the total due for the session is 0.This may occur if the Checkout Session includes a free trial or a discount. +/// +/// Can only be set in `subscription` mode. +/// +/// If you'd like information on how to collect a payment method outside of Checkout, read the guide on [configuring subscriptions with a free trial](https://stripe.com/docs/payments/checkout/free-trials). +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum UpdatePaymentLinkPaymentMethodCollection { + Always, + IfRequired, +} +impl UpdatePaymentLinkPaymentMethodCollection { + pub fn as_str(self) -> &'static str { + use UpdatePaymentLinkPaymentMethodCollection::*; + match self { + Always => "always", + IfRequired => "if_required", + } + } +} + +impl std::str::FromStr for UpdatePaymentLinkPaymentMethodCollection { + type Err = (); + fn from_str(s: &str) -> Result { + use UpdatePaymentLinkPaymentMethodCollection::*; + match s { + "always" => Ok(Always), + "if_required" => Ok(IfRequired), + _ => Err(()), + } + } +} +impl std::fmt::Display for UpdatePaymentLinkPaymentMethodCollection { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for UpdatePaymentLinkPaymentMethodCollection { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for UpdatePaymentLinkPaymentMethodCollection { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Configuration for collecting the customer's shipping address. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct UpdatePaymentLinkShippingAddressCollection<'a> { + /// An array of two-letter ISO country codes representing which countries Checkout should provide as options for. + /// shipping locations. + /// Unsupported country codes: `AS, CX, CC, CU, HM, IR, KP, MH, FM, NF, MP, PW, SD, SY, UM, VI`. + pub allowed_countries: &'a [UpdatePaymentLinkShippingAddressCollectionAllowedCountries], +} +impl<'a> UpdatePaymentLinkShippingAddressCollection<'a> { + pub fn new( + allowed_countries: &'a [UpdatePaymentLinkShippingAddressCollectionAllowedCountries], + ) -> Self { + Self { allowed_countries } + } +} +/// An array of two-letter ISO country codes representing which countries Checkout should provide as options for. +/// shipping locations. +/// Unsupported country codes: `AS, CX, CC, CU, HM, IR, KP, MH, FM, NF, MP, PW, SD, SY, UM, VI`. +#[derive(Copy, Clone, Eq, PartialEq)] +#[non_exhaustive] +pub enum UpdatePaymentLinkShippingAddressCollectionAllowedCountries { + Ac, + Ad, + Ae, + Af, + Ag, + Ai, + Al, + Am, + Ao, + Aq, + Ar, + At, + Au, + Aw, + Ax, + Az, + Ba, + Bb, + Bd, + Be, + Bf, + Bg, + Bh, + Bi, + Bj, + Bl, + Bm, + Bn, + Bo, + Bq, + Br, + Bs, + Bt, + Bv, + Bw, + By, + Bz, + Ca, + Cd, + Cf, + Cg, + Ch, + Ci, + Ck, + Cl, + Cm, + Cn, + Co, + Cr, + Cv, + Cw, + Cy, + Cz, + De, + Dj, + Dk, + Dm, + Do, + Dz, + Ec, + Ee, + Eg, + Eh, + Er, + Es, + Et, + Fi, + Fj, + Fk, + Fo, + Fr, + Ga, + Gb, + Gd, + Ge, + Gf, + Gg, + Gh, + Gi, + Gl, + Gm, + Gn, + Gp, + Gq, + Gr, + Gs, + Gt, + Gu, + Gw, + Gy, + Hk, + Hn, + Hr, + Ht, + Hu, + Id, + Ie, + Il, + Im, + In, + Io, + Iq, + Is, + It, + Je, + Jm, + Jo, + Jp, + Ke, + Kg, + Kh, + Ki, + Km, + Kn, + Kr, + Kw, + Ky, + Kz, + La, + Lb, + Lc, + Li, + Lk, + Lr, + Ls, + Lt, + Lu, + Lv, + Ly, + Ma, + Mc, + Md, + Me, + Mf, + Mg, + Mk, + Ml, + Mm, + Mn, + Mo, + Mq, + Mr, + Ms, + Mt, + Mu, + Mv, + Mw, + Mx, + My, + Mz, + Na, + Nc, + Ne, + Ng, + Ni, + Nl, + No, + Np, + Nr, + Nu, + Nz, + Om, + Pa, + Pe, + Pf, + Pg, + Ph, + Pk, + Pl, + Pm, + Pn, + Pr, + Ps, + Pt, + Py, + Qa, + Re, + Ro, + Rs, + Ru, + Rw, + Sa, + Sb, + Sc, + Se, + Sg, + Sh, + Si, + Sj, + Sk, + Sl, + Sm, + Sn, + So, + Sr, + Ss, + St, + Sv, + Sx, + Sz, + Ta, + Tc, + Td, + Tf, + Tg, + Th, + Tj, + Tk, + Tl, + Tm, + Tn, + To, + Tr, + Tt, + Tv, + Tw, + Tz, + Ua, + Ug, + Us, + Uy, + Uz, + Va, + Vc, + Ve, + Vg, + Vn, + Vu, + Wf, + Ws, + Xk, + Ye, + Yt, + Za, + Zm, + Zw, + Zz, + /// An unrecognized value from Stripe. Should not be used as a request parameter. + Unknown, +} +impl UpdatePaymentLinkShippingAddressCollectionAllowedCountries { + pub fn as_str(self) -> &'static str { + use UpdatePaymentLinkShippingAddressCollectionAllowedCountries::*; + match self { + Ac => "AC", + Ad => "AD", + Ae => "AE", + Af => "AF", + Ag => "AG", + Ai => "AI", + Al => "AL", + Am => "AM", + Ao => "AO", + Aq => "AQ", + Ar => "AR", + At => "AT", + Au => "AU", + Aw => "AW", + Ax => "AX", + Az => "AZ", + Ba => "BA", + Bb => "BB", + Bd => "BD", + Be => "BE", + Bf => "BF", + Bg => "BG", + Bh => "BH", + Bi => "BI", + Bj => "BJ", + Bl => "BL", + Bm => "BM", + Bn => "BN", + Bo => "BO", + Bq => "BQ", + Br => "BR", + Bs => "BS", + Bt => "BT", + Bv => "BV", + Bw => "BW", + By => "BY", + Bz => "BZ", + Ca => "CA", + Cd => "CD", + Cf => "CF", + Cg => "CG", + Ch => "CH", + Ci => "CI", + Ck => "CK", + Cl => "CL", + Cm => "CM", + Cn => "CN", + Co => "CO", + Cr => "CR", + Cv => "CV", + Cw => "CW", + Cy => "CY", + Cz => "CZ", + De => "DE", + Dj => "DJ", + Dk => "DK", + Dm => "DM", + Do => "DO", + Dz => "DZ", + Ec => "EC", + Ee => "EE", + Eg => "EG", + Eh => "EH", + Er => "ER", + Es => "ES", + Et => "ET", + Fi => "FI", + Fj => "FJ", + Fk => "FK", + Fo => "FO", + Fr => "FR", + Ga => "GA", + Gb => "GB", + Gd => "GD", + Ge => "GE", + Gf => "GF", + Gg => "GG", + Gh => "GH", + Gi => "GI", + Gl => "GL", + Gm => "GM", + Gn => "GN", + Gp => "GP", + Gq => "GQ", + Gr => "GR", + Gs => "GS", + Gt => "GT", + Gu => "GU", + Gw => "GW", + Gy => "GY", + Hk => "HK", + Hn => "HN", + Hr => "HR", + Ht => "HT", + Hu => "HU", + Id => "ID", + Ie => "IE", + Il => "IL", + Im => "IM", + In => "IN", + Io => "IO", + Iq => "IQ", + Is => "IS", + It => "IT", + Je => "JE", + Jm => "JM", + Jo => "JO", + Jp => "JP", + Ke => "KE", + Kg => "KG", + Kh => "KH", + Ki => "KI", + Km => "KM", + Kn => "KN", + Kr => "KR", + Kw => "KW", + Ky => "KY", + Kz => "KZ", + La => "LA", + Lb => "LB", + Lc => "LC", + Li => "LI", + Lk => "LK", + Lr => "LR", + Ls => "LS", + Lt => "LT", + Lu => "LU", + Lv => "LV", + Ly => "LY", + Ma => "MA", + Mc => "MC", + Md => "MD", + Me => "ME", + Mf => "MF", + Mg => "MG", + Mk => "MK", + Ml => "ML", + Mm => "MM", + Mn => "MN", + Mo => "MO", + Mq => "MQ", + Mr => "MR", + Ms => "MS", + Mt => "MT", + Mu => "MU", + Mv => "MV", + Mw => "MW", + Mx => "MX", + My => "MY", + Mz => "MZ", + Na => "NA", + Nc => "NC", + Ne => "NE", + Ng => "NG", + Ni => "NI", + Nl => "NL", + No => "NO", + Np => "NP", + Nr => "NR", + Nu => "NU", + Nz => "NZ", + Om => "OM", + Pa => "PA", + Pe => "PE", + Pf => "PF", + Pg => "PG", + Ph => "PH", + Pk => "PK", + Pl => "PL", + Pm => "PM", + Pn => "PN", + Pr => "PR", + Ps => "PS", + Pt => "PT", + Py => "PY", + Qa => "QA", + Re => "RE", + Ro => "RO", + Rs => "RS", + Ru => "RU", + Rw => "RW", + Sa => "SA", + Sb => "SB", + Sc => "SC", + Se => "SE", + Sg => "SG", + Sh => "SH", + Si => "SI", + Sj => "SJ", + Sk => "SK", + Sl => "SL", + Sm => "SM", + Sn => "SN", + So => "SO", + Sr => "SR", + Ss => "SS", + St => "ST", + Sv => "SV", + Sx => "SX", + Sz => "SZ", + Ta => "TA", + Tc => "TC", + Td => "TD", + Tf => "TF", + Tg => "TG", + Th => "TH", + Tj => "TJ", + Tk => "TK", + Tl => "TL", + Tm => "TM", + Tn => "TN", + To => "TO", + Tr => "TR", + Tt => "TT", + Tv => "TV", + Tw => "TW", + Tz => "TZ", + Ua => "UA", + Ug => "UG", + Us => "US", + Uy => "UY", + Uz => "UZ", + Va => "VA", + Vc => "VC", + Ve => "VE", + Vg => "VG", + Vn => "VN", + Vu => "VU", + Wf => "WF", + Ws => "WS", + Xk => "XK", + Ye => "YE", + Yt => "YT", + Za => "ZA", + Zm => "ZM", + Zw => "ZW", + Zz => "ZZ", + Unknown => "unknown", + } + } +} + +impl std::str::FromStr for UpdatePaymentLinkShippingAddressCollectionAllowedCountries { + type Err = (); + fn from_str(s: &str) -> Result { + use UpdatePaymentLinkShippingAddressCollectionAllowedCountries::*; + match s { + "AC" => Ok(Ac), + "AD" => Ok(Ad), + "AE" => Ok(Ae), + "AF" => Ok(Af), + "AG" => Ok(Ag), + "AI" => Ok(Ai), + "AL" => Ok(Al), + "AM" => Ok(Am), + "AO" => Ok(Ao), + "AQ" => Ok(Aq), + "AR" => Ok(Ar), + "AT" => Ok(At), + "AU" => Ok(Au), + "AW" => Ok(Aw), + "AX" => Ok(Ax), + "AZ" => Ok(Az), + "BA" => Ok(Ba), + "BB" => Ok(Bb), + "BD" => Ok(Bd), + "BE" => Ok(Be), + "BF" => Ok(Bf), + "BG" => Ok(Bg), + "BH" => Ok(Bh), + "BI" => Ok(Bi), + "BJ" => Ok(Bj), + "BL" => Ok(Bl), + "BM" => Ok(Bm), + "BN" => Ok(Bn), + "BO" => Ok(Bo), + "BQ" => Ok(Bq), + "BR" => Ok(Br), + "BS" => Ok(Bs), + "BT" => Ok(Bt), + "BV" => Ok(Bv), + "BW" => Ok(Bw), + "BY" => Ok(By), + "BZ" => Ok(Bz), + "CA" => Ok(Ca), + "CD" => Ok(Cd), + "CF" => Ok(Cf), + "CG" => Ok(Cg), + "CH" => Ok(Ch), + "CI" => Ok(Ci), + "CK" => Ok(Ck), + "CL" => Ok(Cl), + "CM" => Ok(Cm), + "CN" => Ok(Cn), + "CO" => Ok(Co), + "CR" => Ok(Cr), + "CV" => Ok(Cv), + "CW" => Ok(Cw), + "CY" => Ok(Cy), + "CZ" => Ok(Cz), + "DE" => Ok(De), + "DJ" => Ok(Dj), + "DK" => Ok(Dk), + "DM" => Ok(Dm), + "DO" => Ok(Do), + "DZ" => Ok(Dz), + "EC" => Ok(Ec), + "EE" => Ok(Ee), + "EG" => Ok(Eg), + "EH" => Ok(Eh), + "ER" => Ok(Er), + "ES" => Ok(Es), + "ET" => Ok(Et), + "FI" => Ok(Fi), + "FJ" => Ok(Fj), + "FK" => Ok(Fk), + "FO" => Ok(Fo), + "FR" => Ok(Fr), + "GA" => Ok(Ga), + "GB" => Ok(Gb), + "GD" => Ok(Gd), + "GE" => Ok(Ge), + "GF" => Ok(Gf), + "GG" => Ok(Gg), + "GH" => Ok(Gh), + "GI" => Ok(Gi), + "GL" => Ok(Gl), + "GM" => Ok(Gm), + "GN" => Ok(Gn), + "GP" => Ok(Gp), + "GQ" => Ok(Gq), + "GR" => Ok(Gr), + "GS" => Ok(Gs), + "GT" => Ok(Gt), + "GU" => Ok(Gu), + "GW" => Ok(Gw), + "GY" => Ok(Gy), + "HK" => Ok(Hk), + "HN" => Ok(Hn), + "HR" => Ok(Hr), + "HT" => Ok(Ht), + "HU" => Ok(Hu), + "ID" => Ok(Id), + "IE" => Ok(Ie), + "IL" => Ok(Il), + "IM" => Ok(Im), + "IN" => Ok(In), + "IO" => Ok(Io), + "IQ" => Ok(Iq), + "IS" => Ok(Is), + "IT" => Ok(It), + "JE" => Ok(Je), + "JM" => Ok(Jm), + "JO" => Ok(Jo), + "JP" => Ok(Jp), + "KE" => Ok(Ke), + "KG" => Ok(Kg), + "KH" => Ok(Kh), + "KI" => Ok(Ki), + "KM" => Ok(Km), + "KN" => Ok(Kn), + "KR" => Ok(Kr), + "KW" => Ok(Kw), + "KY" => Ok(Ky), + "KZ" => Ok(Kz), + "LA" => Ok(La), + "LB" => Ok(Lb), + "LC" => Ok(Lc), + "LI" => Ok(Li), + "LK" => Ok(Lk), + "LR" => Ok(Lr), + "LS" => Ok(Ls), + "LT" => Ok(Lt), + "LU" => Ok(Lu), + "LV" => Ok(Lv), + "LY" => Ok(Ly), + "MA" => Ok(Ma), + "MC" => Ok(Mc), + "MD" => Ok(Md), + "ME" => Ok(Me), + "MF" => Ok(Mf), + "MG" => Ok(Mg), + "MK" => Ok(Mk), + "ML" => Ok(Ml), + "MM" => Ok(Mm), + "MN" => Ok(Mn), + "MO" => Ok(Mo), + "MQ" => Ok(Mq), + "MR" => Ok(Mr), + "MS" => Ok(Ms), + "MT" => Ok(Mt), + "MU" => Ok(Mu), + "MV" => Ok(Mv), + "MW" => Ok(Mw), + "MX" => Ok(Mx), + "MY" => Ok(My), + "MZ" => Ok(Mz), + "NA" => Ok(Na), + "NC" => Ok(Nc), + "NE" => Ok(Ne), + "NG" => Ok(Ng), + "NI" => Ok(Ni), + "NL" => Ok(Nl), + "NO" => Ok(No), + "NP" => Ok(Np), + "NR" => Ok(Nr), + "NU" => Ok(Nu), + "NZ" => Ok(Nz), + "OM" => Ok(Om), + "PA" => Ok(Pa), + "PE" => Ok(Pe), + "PF" => Ok(Pf), + "PG" => Ok(Pg), + "PH" => Ok(Ph), + "PK" => Ok(Pk), + "PL" => Ok(Pl), + "PM" => Ok(Pm), + "PN" => Ok(Pn), + "PR" => Ok(Pr), + "PS" => Ok(Ps), + "PT" => Ok(Pt), + "PY" => Ok(Py), + "QA" => Ok(Qa), + "RE" => Ok(Re), + "RO" => Ok(Ro), + "RS" => Ok(Rs), + "RU" => Ok(Ru), + "RW" => Ok(Rw), + "SA" => Ok(Sa), + "SB" => Ok(Sb), + "SC" => Ok(Sc), + "SE" => Ok(Se), + "SG" => Ok(Sg), + "SH" => Ok(Sh), + "SI" => Ok(Si), + "SJ" => Ok(Sj), + "SK" => Ok(Sk), + "SL" => Ok(Sl), + "SM" => Ok(Sm), + "SN" => Ok(Sn), + "SO" => Ok(So), + "SR" => Ok(Sr), + "SS" => Ok(Ss), + "ST" => Ok(St), + "SV" => Ok(Sv), + "SX" => Ok(Sx), + "SZ" => Ok(Sz), + "TA" => Ok(Ta), + "TC" => Ok(Tc), + "TD" => Ok(Td), + "TF" => Ok(Tf), + "TG" => Ok(Tg), + "TH" => Ok(Th), + "TJ" => Ok(Tj), + "TK" => Ok(Tk), + "TL" => Ok(Tl), + "TM" => Ok(Tm), + "TN" => Ok(Tn), + "TO" => Ok(To), + "TR" => Ok(Tr), + "TT" => Ok(Tt), + "TV" => Ok(Tv), + "TW" => Ok(Tw), + "TZ" => Ok(Tz), + "UA" => Ok(Ua), + "UG" => Ok(Ug), + "US" => Ok(Us), + "UY" => Ok(Uy), + "UZ" => Ok(Uz), + "VA" => Ok(Va), + "VC" => Ok(Vc), + "VE" => Ok(Ve), + "VG" => Ok(Vg), + "VN" => Ok(Vn), + "VU" => Ok(Vu), + "WF" => Ok(Wf), + "WS" => Ok(Ws), + "XK" => Ok(Xk), + "YE" => Ok(Ye), + "YT" => Ok(Yt), + "ZA" => Ok(Za), + "ZM" => Ok(Zm), + "ZW" => Ok(Zw), + "ZZ" => Ok(Zz), + _ => Err(()), + } + } +} +impl std::fmt::Display for UpdatePaymentLinkShippingAddressCollectionAllowedCountries { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for UpdatePaymentLinkShippingAddressCollectionAllowedCountries { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for UpdatePaymentLinkShippingAddressCollectionAllowedCountries { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// When creating a subscription, the specified configuration data will be used. +/// There must be at least one line item with a recurring price to use `subscription_data`. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdatePaymentLinkSubscriptionData<'a> { + /// All invoices will be billed using the specified settings. + #[serde(skip_serializing_if = "Option::is_none")] + pub invoice_settings: Option>, + /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that will declaratively set metadata on [Subscriptions](https://stripe.com/docs/api/subscriptions) generated from this payment link. + /// Unlike object-level metadata, this field is declarative. + /// Updates will clear prior values. + #[serde(skip_serializing_if = "Option::is_none")] + pub metadata: Option<&'a std::collections::HashMap>, + /// Settings related to subscription trials. + #[serde(skip_serializing_if = "Option::is_none")] + pub trial_settings: Option, +} +impl<'a> UpdatePaymentLinkSubscriptionData<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// All invoices will be billed using the specified settings. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdatePaymentLinkSubscriptionDataInvoiceSettings<'a> { + /// The connected account that issues the invoice. + /// The invoice is presented with the branding and support information of the specified account. + #[serde(skip_serializing_if = "Option::is_none")] + pub issuer: Option>, +} +impl<'a> UpdatePaymentLinkSubscriptionDataInvoiceSettings<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// The connected account that issues the invoice. +/// The invoice is presented with the branding and support information of the specified account. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct UpdatePaymentLinkSubscriptionDataInvoiceSettingsIssuer<'a> { + /// The connected account being referenced when `type` is `account`. + #[serde(skip_serializing_if = "Option::is_none")] + pub account: Option<&'a str>, + /// Type of the account referenced in the request. + #[serde(rename = "type")] + pub type_: UpdatePaymentLinkSubscriptionDataInvoiceSettingsIssuerType, +} +impl<'a> UpdatePaymentLinkSubscriptionDataInvoiceSettingsIssuer<'a> { + pub fn new(type_: UpdatePaymentLinkSubscriptionDataInvoiceSettingsIssuerType) -> Self { + Self { account: None, type_ } + } +} +/// Type of the account referenced in the request. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum UpdatePaymentLinkSubscriptionDataInvoiceSettingsIssuerType { + Account, + Self_, +} +impl UpdatePaymentLinkSubscriptionDataInvoiceSettingsIssuerType { + pub fn as_str(self) -> &'static str { + use UpdatePaymentLinkSubscriptionDataInvoiceSettingsIssuerType::*; + match self { + Account => "account", + Self_ => "self", + } + } +} + +impl std::str::FromStr for UpdatePaymentLinkSubscriptionDataInvoiceSettingsIssuerType { + type Err = (); + fn from_str(s: &str) -> Result { + use UpdatePaymentLinkSubscriptionDataInvoiceSettingsIssuerType::*; + match s { + "account" => Ok(Account), + "self" => Ok(Self_), + _ => Err(()), + } + } +} +impl std::fmt::Display for UpdatePaymentLinkSubscriptionDataInvoiceSettingsIssuerType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for UpdatePaymentLinkSubscriptionDataInvoiceSettingsIssuerType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for UpdatePaymentLinkSubscriptionDataInvoiceSettingsIssuerType { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Settings related to subscription trials. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct UpdatePaymentLinkSubscriptionDataTrialSettings { + /// Defines how the subscription should behave when the user's free trial ends. + pub end_behavior: UpdatePaymentLinkSubscriptionDataTrialSettingsEndBehavior, +} +impl UpdatePaymentLinkSubscriptionDataTrialSettings { + pub fn new(end_behavior: UpdatePaymentLinkSubscriptionDataTrialSettingsEndBehavior) -> Self { + Self { end_behavior } + } +} +/// Defines how the subscription should behave when the user's free trial ends. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct UpdatePaymentLinkSubscriptionDataTrialSettingsEndBehavior { + /// Indicates how the subscription should change when the trial ends if the user did not provide a payment method. + pub missing_payment_method: + UpdatePaymentLinkSubscriptionDataTrialSettingsEndBehaviorMissingPaymentMethod, +} +impl UpdatePaymentLinkSubscriptionDataTrialSettingsEndBehavior { + pub fn new( + missing_payment_method: UpdatePaymentLinkSubscriptionDataTrialSettingsEndBehaviorMissingPaymentMethod, + ) -> Self { + Self { missing_payment_method } + } +} +/// Indicates how the subscription should change when the trial ends if the user did not provide a payment method. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum UpdatePaymentLinkSubscriptionDataTrialSettingsEndBehaviorMissingPaymentMethod { + Cancel, + CreateInvoice, + Pause, +} +impl UpdatePaymentLinkSubscriptionDataTrialSettingsEndBehaviorMissingPaymentMethod { + pub fn as_str(self) -> &'static str { + use UpdatePaymentLinkSubscriptionDataTrialSettingsEndBehaviorMissingPaymentMethod::*; + match self { + Cancel => "cancel", + CreateInvoice => "create_invoice", + Pause => "pause", + } + } +} + +impl std::str::FromStr + for UpdatePaymentLinkSubscriptionDataTrialSettingsEndBehaviorMissingPaymentMethod +{ + type Err = (); + fn from_str(s: &str) -> Result { + use UpdatePaymentLinkSubscriptionDataTrialSettingsEndBehaviorMissingPaymentMethod::*; + match s { + "cancel" => Ok(Cancel), + "create_invoice" => Ok(CreateInvoice), + "pause" => Ok(Pause), + _ => Err(()), + } + } +} +impl std::fmt::Display + for UpdatePaymentLinkSubscriptionDataTrialSettingsEndBehaviorMissingPaymentMethod +{ + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug + for UpdatePaymentLinkSubscriptionDataTrialSettingsEndBehaviorMissingPaymentMethod +{ + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize + for UpdatePaymentLinkSubscriptionDataTrialSettingsEndBehaviorMissingPaymentMethod +{ + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'a> UpdatePaymentLink<'a> { + /// Updates a payment link. + pub fn send( + &self, + client: &stripe::Client, + payment_link: &stripe_shared::PaymentLinkId, + ) -> stripe::Response { + client.send_form(&format!("/payment_links/{payment_link}"), self, http_types::Method::Post) + } +} +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct AfterCompletionConfirmationPageParams<'a> { + /// A custom message to display to the customer after the purchase is complete. + #[serde(skip_serializing_if = "Option::is_none")] + pub custom_message: Option<&'a str>, +} +impl<'a> AfterCompletionConfirmationPageParams<'a> { + pub fn new() -> Self { + Self::default() + } +} +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct AfterCompletionRedirectParams<'a> { + /// The URL the customer will be redirected to after the purchase is complete. + /// You can embed `{CHECKOUT_SESSION_ID}` into the URL to have the `id` of the completed [checkout session](https://stripe.com/docs/api/checkout/sessions/object#checkout_session_object-id) included. + pub url: &'a str, +} +impl<'a> AfterCompletionRedirectParams<'a> { + pub fn new(url: &'a str) -> Self { + Self { url } + } +} +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CustomFieldOptionParam<'a> { + /// The label for the option, displayed to the customer. Up to 100 characters. + pub label: &'a str, + /// The value for this option, not displayed to the customer, used by your integration to reconcile the option selected by the customer. + /// Must be unique to this option, alphanumeric, and up to 100 characters. + pub value: &'a str, +} +impl<'a> CustomFieldOptionParam<'a> { + pub fn new(label: &'a str, value: &'a str) -> Self { + Self { label, value } + } +} +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CustomTextPositionParam<'a> { + /// Text may be up to 1200 characters in length. + pub message: &'a str, +} +impl<'a> CustomTextPositionParam<'a> { + pub fn new(message: &'a str) -> Self { + Self { message } + } +} +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CustomFieldParams<'a> { + /// The name of the custom field. This may be up to 30 characters. + pub name: &'a str, + /// The value of the custom field. This may be up to 30 characters. + pub value: &'a str, +} +impl<'a> CustomFieldParams<'a> { + pub fn new(name: &'a str, value: &'a str) -> Self { + Self { name, value } + } +} +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct AdjustableQuantityParams { + /// Set to true if the quantity can be adjusted to any non-negative Integer. + pub enabled: bool, + /// The maximum quantity the customer can purchase. + /// By default this value is 99. + /// You can specify a value up to 999. + #[serde(skip_serializing_if = "Option::is_none")] + pub maximum: Option, + /// The minimum quantity the customer can purchase. + /// By default this value is 0. + /// If there is only one item in the cart then that item's quantity cannot go down to 0. + #[serde(skip_serializing_if = "Option::is_none")] + pub minimum: Option, +} +impl AdjustableQuantityParams { + pub fn new(enabled: bool) -> Self { + Self { enabled, maximum: None, minimum: None } + } +} +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CompletedSessionsParams { + /// The maximum number of checkout sessions that can be completed for the `completed_sessions` restriction to be met. + pub limit: i64, +} +impl CompletedSessionsParams { + pub fn new(limit: i64) -> Self { + Self { limit } + } +} +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CustomFieldDropdownParam<'a> { + /// The options available for the customer to select. Up to 200 options allowed. + pub options: &'a [CustomFieldOptionParam<'a>], +} +impl<'a> CustomFieldDropdownParam<'a> { + pub fn new(options: &'a [CustomFieldOptionParam<'a>]) -> Self { + Self { options } + } +} +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CustomTextParam<'a> { + /// Custom text that should be displayed after the payment confirmation button. + #[serde(skip_serializing_if = "Option::is_none")] + pub after_submit: Option>, + /// Custom text that should be displayed alongside shipping address collection. + #[serde(skip_serializing_if = "Option::is_none")] + pub shipping_address: Option>, + /// Custom text that should be displayed alongside the payment confirmation button. + #[serde(skip_serializing_if = "Option::is_none")] + pub submit: Option>, + /// Custom text that should be displayed in place of the default terms of service agreement text. + #[serde(skip_serializing_if = "Option::is_none")] + pub terms_of_service_acceptance: Option>, +} +impl<'a> CustomTextParam<'a> { + pub fn new() -> Self { + Self::default() + } +} +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct RestrictionsParams { + /// Configuration for the `completed_sessions` restriction type. + pub completed_sessions: CompletedSessionsParams, +} +impl RestrictionsParams { + pub fn new(completed_sessions: CompletedSessionsParams) -> Self { + Self { completed_sessions } + } +} diff --git a/generated/stripe_payment/src/payment_method/mod.rs b/generated/stripe_payment/src/payment_method/mod.rs new file mode 100644 index 000000000..2591dc002 --- /dev/null +++ b/generated/stripe_payment/src/payment_method/mod.rs @@ -0,0 +1,4 @@ +#[cfg(feature = "payment_method")] +mod requests; +#[cfg(feature = "payment_method")] +pub use requests::*; diff --git a/generated/stripe_payment/src/payment_method/requests.rs b/generated/stripe_payment/src/payment_method/requests.rs new file mode 100644 index 000000000..9e1f1f17b --- /dev/null +++ b/generated/stripe_payment/src/payment_method/requests.rs @@ -0,0 +1,1675 @@ +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct ListPaymentMethod<'a> { + /// The ID of the customer whose PaymentMethods will be retrieved. + #[serde(skip_serializing_if = "Option::is_none")] + pub customer: Option<&'a str>, + /// A cursor for use in pagination. + /// `ending_before` is an object ID that defines your place in the list. + /// For instance, if you make a list request and receive 100 objects, starting with `obj_bar`, your subsequent call can include `ending_before=obj_bar` in order to fetch the previous page of the list. + #[serde(skip_serializing_if = "Option::is_none")] + pub ending_before: Option<&'a str>, + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, + /// A limit on the number of objects to be returned. + /// Limit can range between 1 and 100, and the default is 10. + #[serde(skip_serializing_if = "Option::is_none")] + pub limit: Option, + /// A cursor for use in pagination. + /// `starting_after` is an object ID that defines your place in the list. + /// For instance, if you make a list request and receive 100 objects, ending with `obj_foo`, your subsequent call can include `starting_after=obj_foo` in order to fetch the next page of the list. + #[serde(skip_serializing_if = "Option::is_none")] + pub starting_after: Option<&'a str>, + /// An optional filter on the list, based on the object `type` field. + /// Without the filter, the list includes all current and future payment method types. + /// If your integration expects only one type of payment method in the response, make sure to provide a type value in the request. + #[serde(rename = "type")] + #[serde(skip_serializing_if = "Option::is_none")] + pub type_: Option, +} +impl<'a> ListPaymentMethod<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// An optional filter on the list, based on the object `type` field. +/// Without the filter, the list includes all current and future payment method types. +/// If your integration expects only one type of payment method in the response, make sure to provide a type value in the request. +#[derive(Copy, Clone, Eq, PartialEq)] +#[non_exhaustive] +pub enum ListPaymentMethodType { + AcssDebit, + Affirm, + AfterpayClearpay, + Alipay, + AuBecsDebit, + BacsDebit, + Bancontact, + Blik, + Boleto, + Card, + Cashapp, + CustomerBalance, + Eps, + Fpx, + Giropay, + Grabpay, + Ideal, + Klarna, + Konbini, + Link, + Oxxo, + P24, + Paynow, + Paypal, + Pix, + Promptpay, + RevolutPay, + SepaDebit, + Sofort, + Swish, + UsBankAccount, + WechatPay, + Zip, + /// An unrecognized value from Stripe. Should not be used as a request parameter. + Unknown, +} +impl ListPaymentMethodType { + pub fn as_str(self) -> &'static str { + use ListPaymentMethodType::*; + match self { + AcssDebit => "acss_debit", + Affirm => "affirm", + AfterpayClearpay => "afterpay_clearpay", + Alipay => "alipay", + AuBecsDebit => "au_becs_debit", + BacsDebit => "bacs_debit", + Bancontact => "bancontact", + Blik => "blik", + Boleto => "boleto", + Card => "card", + Cashapp => "cashapp", + CustomerBalance => "customer_balance", + Eps => "eps", + Fpx => "fpx", + Giropay => "giropay", + Grabpay => "grabpay", + Ideal => "ideal", + Klarna => "klarna", + Konbini => "konbini", + Link => "link", + Oxxo => "oxxo", + P24 => "p24", + Paynow => "paynow", + Paypal => "paypal", + Pix => "pix", + Promptpay => "promptpay", + RevolutPay => "revolut_pay", + SepaDebit => "sepa_debit", + Sofort => "sofort", + Swish => "swish", + UsBankAccount => "us_bank_account", + WechatPay => "wechat_pay", + Zip => "zip", + Unknown => "unknown", + } + } +} + +impl std::str::FromStr for ListPaymentMethodType { + type Err = (); + fn from_str(s: &str) -> Result { + use ListPaymentMethodType::*; + match s { + "acss_debit" => Ok(AcssDebit), + "affirm" => Ok(Affirm), + "afterpay_clearpay" => Ok(AfterpayClearpay), + "alipay" => Ok(Alipay), + "au_becs_debit" => Ok(AuBecsDebit), + "bacs_debit" => Ok(BacsDebit), + "bancontact" => Ok(Bancontact), + "blik" => Ok(Blik), + "boleto" => Ok(Boleto), + "card" => Ok(Card), + "cashapp" => Ok(Cashapp), + "customer_balance" => Ok(CustomerBalance), + "eps" => Ok(Eps), + "fpx" => Ok(Fpx), + "giropay" => Ok(Giropay), + "grabpay" => Ok(Grabpay), + "ideal" => Ok(Ideal), + "klarna" => Ok(Klarna), + "konbini" => Ok(Konbini), + "link" => Ok(Link), + "oxxo" => Ok(Oxxo), + "p24" => Ok(P24), + "paynow" => Ok(Paynow), + "paypal" => Ok(Paypal), + "pix" => Ok(Pix), + "promptpay" => Ok(Promptpay), + "revolut_pay" => Ok(RevolutPay), + "sepa_debit" => Ok(SepaDebit), + "sofort" => Ok(Sofort), + "swish" => Ok(Swish), + "us_bank_account" => Ok(UsBankAccount), + "wechat_pay" => Ok(WechatPay), + "zip" => Ok(Zip), + _ => Err(()), + } + } +} +impl std::fmt::Display for ListPaymentMethodType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for ListPaymentMethodType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for ListPaymentMethodType { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'a> ListPaymentMethod<'a> { + /// Returns a list of PaymentMethods for Treasury flows. + /// If you want to list the PaymentMethods attached to a Customer for payments, you should use the [List a Customer’s PaymentMethods](https://stripe.com/docs/api/payment_methods/customer_list) API instead. + pub fn send( + &self, + client: &stripe::Client, + ) -> stripe::Response> { + client.get_query("/payment_methods", self) + } + pub fn paginate( + self, + ) -> stripe::ListPaginator> { + stripe::ListPaginator::from_list_params("/payment_methods", self) + } +} +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct RetrievePaymentMethod<'a> { + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, +} +impl<'a> RetrievePaymentMethod<'a> { + pub fn new() -> Self { + Self::default() + } +} +impl<'a> RetrievePaymentMethod<'a> { + /// Retrieves a PaymentMethod object attached to the StripeAccount. + /// To retrieve a payment method attached to a Customer, you should use [Retrieve a Customer’s PaymentMethods](https://stripe.com/docs/api/payment_methods/customer). + pub fn send( + &self, + client: &stripe::Client, + payment_method: &stripe_shared::PaymentMethodId, + ) -> stripe::Response { + client.get_query(&format!("/payment_methods/{payment_method}"), self) + } +} +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreatePaymentMethod<'a> { + /// If this is an `acss_debit` PaymentMethod, this hash contains details about the ACSS Debit payment method. + #[serde(skip_serializing_if = "Option::is_none")] + pub acss_debit: Option>, + /// If this is an `affirm` PaymentMethod, this hash contains details about the Affirm payment method. + #[serde(skip_serializing_if = "Option::is_none")] + pub affirm: Option<&'a serde_json::Value>, + /// If this is an `AfterpayClearpay` PaymentMethod, this hash contains details about the AfterpayClearpay payment method. + #[serde(skip_serializing_if = "Option::is_none")] + pub afterpay_clearpay: Option<&'a serde_json::Value>, + /// If this is an `Alipay` PaymentMethod, this hash contains details about the Alipay payment method. + #[serde(skip_serializing_if = "Option::is_none")] + pub alipay: Option<&'a serde_json::Value>, + /// If this is an `au_becs_debit` PaymentMethod, this hash contains details about the bank account. + #[serde(skip_serializing_if = "Option::is_none")] + pub au_becs_debit: Option>, + /// If this is a `bacs_debit` PaymentMethod, this hash contains details about the Bacs Direct Debit bank account. + #[serde(skip_serializing_if = "Option::is_none")] + pub bacs_debit: Option>, + /// If this is a `bancontact` PaymentMethod, this hash contains details about the Bancontact payment method. + #[serde(skip_serializing_if = "Option::is_none")] + pub bancontact: Option<&'a serde_json::Value>, + /// Billing information associated with the PaymentMethod that may be used or required by particular types of payment methods. + #[serde(skip_serializing_if = "Option::is_none")] + pub billing_details: Option>, + /// If this is a `blik` PaymentMethod, this hash contains details about the BLIK payment method. + #[serde(skip_serializing_if = "Option::is_none")] + pub blik: Option<&'a serde_json::Value>, + /// If this is a `boleto` PaymentMethod, this hash contains details about the Boleto payment method. + #[serde(skip_serializing_if = "Option::is_none")] + pub boleto: Option>, + /// If this is a `card` PaymentMethod, this hash contains the user's card details. + /// For backwards compatibility, you can alternatively provide a Stripe token (e.g., for Apple Pay, Amex Express Checkout, or legacy Checkout) into the card hash with format `card: {token: "tok_visa"}`. + /// When providing a card number, you must meet the requirements for [PCI compliance](https://stripe.com/docs/security#validating-pci-compliance). + /// We strongly recommend using Stripe.js instead of interacting with this API directly. + #[serde(skip_serializing_if = "Option::is_none")] + pub card: Option>, + /// If this is a `cashapp` PaymentMethod, this hash contains details about the Cash App Pay payment method. + #[serde(skip_serializing_if = "Option::is_none")] + pub cashapp: Option<&'a serde_json::Value>, + /// The `Customer` to whom the original PaymentMethod is attached. + #[serde(skip_serializing_if = "Option::is_none")] + pub customer: Option<&'a str>, + /// If this is a `customer_balance` PaymentMethod, this hash contains details about the CustomerBalance payment method. + #[serde(skip_serializing_if = "Option::is_none")] + pub customer_balance: Option<&'a serde_json::Value>, + /// If this is an `eps` PaymentMethod, this hash contains details about the EPS payment method. + #[serde(skip_serializing_if = "Option::is_none")] + pub eps: Option, + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, + /// If this is an `fpx` PaymentMethod, this hash contains details about the FPX payment method. + #[serde(skip_serializing_if = "Option::is_none")] + pub fpx: Option, + /// If this is a `giropay` PaymentMethod, this hash contains details about the Giropay payment method. + #[serde(skip_serializing_if = "Option::is_none")] + pub giropay: Option<&'a serde_json::Value>, + /// If this is a `grabpay` PaymentMethod, this hash contains details about the GrabPay payment method. + #[serde(skip_serializing_if = "Option::is_none")] + pub grabpay: Option<&'a serde_json::Value>, + /// If this is an `ideal` PaymentMethod, this hash contains details about the iDEAL payment method. + #[serde(skip_serializing_if = "Option::is_none")] + pub ideal: Option, + /// If this is an `interac_present` PaymentMethod, this hash contains details about the Interac Present payment method. + #[serde(skip_serializing_if = "Option::is_none")] + pub interac_present: Option<&'a serde_json::Value>, + /// If this is a `klarna` PaymentMethod, this hash contains details about the Klarna payment method. + #[serde(skip_serializing_if = "Option::is_none")] + pub klarna: Option, + /// If this is a `konbini` PaymentMethod, this hash contains details about the Konbini payment method. + #[serde(skip_serializing_if = "Option::is_none")] + pub konbini: Option<&'a serde_json::Value>, + /// If this is an `Link` PaymentMethod, this hash contains details about the Link payment method. + #[serde(skip_serializing_if = "Option::is_none")] + pub link: Option<&'a serde_json::Value>, + /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. + /// This can be useful for storing additional information about the object in a structured format. + /// Individual keys can be unset by posting an empty value to them. + /// All keys can be unset by posting an empty value to `metadata`. + #[serde(skip_serializing_if = "Option::is_none")] + pub metadata: Option<&'a std::collections::HashMap>, + /// If this is an `oxxo` PaymentMethod, this hash contains details about the OXXO payment method. + #[serde(skip_serializing_if = "Option::is_none")] + pub oxxo: Option<&'a serde_json::Value>, + /// If this is a `p24` PaymentMethod, this hash contains details about the P24 payment method. + #[serde(skip_serializing_if = "Option::is_none")] + pub p24: Option, + /// The PaymentMethod to share. + #[serde(skip_serializing_if = "Option::is_none")] + pub payment_method: Option<&'a str>, + /// If this is a `paynow` PaymentMethod, this hash contains details about the PayNow payment method. + #[serde(skip_serializing_if = "Option::is_none")] + pub paynow: Option<&'a serde_json::Value>, + /// If this is a `paypal` PaymentMethod, this hash contains details about the PayPal payment method. + #[serde(skip_serializing_if = "Option::is_none")] + pub paypal: Option<&'a serde_json::Value>, + /// If this is a `pix` PaymentMethod, this hash contains details about the Pix payment method. + #[serde(skip_serializing_if = "Option::is_none")] + pub pix: Option<&'a serde_json::Value>, + /// If this is a `promptpay` PaymentMethod, this hash contains details about the PromptPay payment method. + #[serde(skip_serializing_if = "Option::is_none")] + pub promptpay: Option<&'a serde_json::Value>, + /// Options to configure Radar. + /// See [Radar Session](https://stripe.com/docs/radar/radar-session) for more information. + #[serde(skip_serializing_if = "Option::is_none")] + pub radar_options: Option>, + /// If this is a `Revolut Pay` PaymentMethod, this hash contains details about the Revolut Pay payment method. + #[serde(skip_serializing_if = "Option::is_none")] + pub revolut_pay: Option<&'a serde_json::Value>, + /// If this is a `sepa_debit` PaymentMethod, this hash contains details about the SEPA debit bank account. + #[serde(skip_serializing_if = "Option::is_none")] + pub sepa_debit: Option>, + /// If this is a `sofort` PaymentMethod, this hash contains details about the SOFORT payment method. + #[serde(skip_serializing_if = "Option::is_none")] + pub sofort: Option, + /// If this is a `swish` PaymentMethod, this hash contains details about the Swish payment method. + #[serde(skip_serializing_if = "Option::is_none")] + pub swish: Option<&'a serde_json::Value>, + /// The type of the PaymentMethod. + /// An additional hash is included on the PaymentMethod with a name matching this value. + /// It contains additional information specific to the PaymentMethod type. + #[serde(rename = "type")] + #[serde(skip_serializing_if = "Option::is_none")] + pub type_: Option, + /// If this is an `us_bank_account` PaymentMethod, this hash contains details about the US bank account payment method. + #[serde(skip_serializing_if = "Option::is_none")] + pub us_bank_account: Option>, + /// If this is an `wechat_pay` PaymentMethod, this hash contains details about the wechat_pay payment method. + #[serde(skip_serializing_if = "Option::is_none")] + pub wechat_pay: Option<&'a serde_json::Value>, + /// If this is a `zip` PaymentMethod, this hash contains details about the Zip payment method. + #[serde(skip_serializing_if = "Option::is_none")] + pub zip: Option<&'a serde_json::Value>, +} +impl<'a> CreatePaymentMethod<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// If this is an `acss_debit` PaymentMethod, this hash contains details about the ACSS Debit payment method. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreatePaymentMethodAcssDebit<'a> { + /// Customer's bank account number. + pub account_number: &'a str, + /// Institution number of the customer's bank. + pub institution_number: &'a str, + /// Transit number of the customer's bank. + pub transit_number: &'a str, +} +impl<'a> CreatePaymentMethodAcssDebit<'a> { + pub fn new( + account_number: &'a str, + institution_number: &'a str, + transit_number: &'a str, + ) -> Self { + Self { account_number, institution_number, transit_number } + } +} +/// If this is an `au_becs_debit` PaymentMethod, this hash contains details about the bank account. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreatePaymentMethodAuBecsDebit<'a> { + /// The account number for the bank account. + pub account_number: &'a str, + /// Bank-State-Branch number of the bank account. + pub bsb_number: &'a str, +} +impl<'a> CreatePaymentMethodAuBecsDebit<'a> { + pub fn new(account_number: &'a str, bsb_number: &'a str) -> Self { + Self { account_number, bsb_number } + } +} +/// If this is a `bacs_debit` PaymentMethod, this hash contains details about the Bacs Direct Debit bank account. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreatePaymentMethodBacsDebit<'a> { + /// Account number of the bank account that the funds will be debited from. + #[serde(skip_serializing_if = "Option::is_none")] + pub account_number: Option<&'a str>, + /// Sort code of the bank account. (e.g., `10-20-30`) + #[serde(skip_serializing_if = "Option::is_none")] + pub sort_code: Option<&'a str>, +} +impl<'a> CreatePaymentMethodBacsDebit<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// If this is a `boleto` PaymentMethod, this hash contains details about the Boleto payment method. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreatePaymentMethodBoleto<'a> { + /// The tax ID of the customer (CPF for individual consumers or CNPJ for businesses consumers) + pub tax_id: &'a str, +} +impl<'a> CreatePaymentMethodBoleto<'a> { + pub fn new(tax_id: &'a str) -> Self { + Self { tax_id } + } +} +/// If this is a `card` PaymentMethod, this hash contains the user's card details. +/// For backwards compatibility, you can alternatively provide a Stripe token (e.g., for Apple Pay, Amex Express Checkout, or legacy Checkout) into the card hash with format `card: {token: "tok_visa"}`. +/// When providing a card number, you must meet the requirements for [PCI compliance](https://stripe.com/docs/security#validating-pci-compliance). +/// We strongly recommend using Stripe.js instead of interacting with this API directly. +#[derive(Copy, Clone, Debug, serde::Serialize)] +#[serde(untagged)] +pub enum CreatePaymentMethodCard<'a> { + CardDetailsParams(CreatePaymentMethodCardDetailsParams<'a>), + TokenParams(CreatePaymentMethodTokenParams<'a>), +} +/// If this is a `card` PaymentMethod, this hash contains the user's card details. +/// For backwards compatibility, you can alternatively provide a Stripe token (e.g., for Apple Pay, Amex Express Checkout, or legacy Checkout) into the card hash with format `card: {token: "tok_visa"}`. +/// When providing a card number, you must meet the requirements for [PCI compliance](https://stripe.com/docs/security#validating-pci-compliance). +/// We strongly recommend using Stripe.js instead of interacting with this API directly. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreatePaymentMethodCardDetailsParams<'a> { + /// The card's CVC. It is highly recommended to always include this value. + #[serde(skip_serializing_if = "Option::is_none")] + pub cvc: Option<&'a str>, + /// Two-digit number representing the card's expiration month. + pub exp_month: i64, + /// Four-digit number representing the card's expiration year. + pub exp_year: i64, + /// The card number, as a string without any separators. + pub number: &'a str, +} +impl<'a> CreatePaymentMethodCardDetailsParams<'a> { + pub fn new(exp_month: i64, exp_year: i64, number: &'a str) -> Self { + Self { cvc: None, exp_month, exp_year, number } + } +} +/// If this is a `card` PaymentMethod, this hash contains the user's card details. +/// For backwards compatibility, you can alternatively provide a Stripe token (e.g., for Apple Pay, Amex Express Checkout, or legacy Checkout) into the card hash with format `card: {token: "tok_visa"}`. +/// When providing a card number, you must meet the requirements for [PCI compliance](https://stripe.com/docs/security#validating-pci-compliance). +/// We strongly recommend using Stripe.js instead of interacting with this API directly. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreatePaymentMethodTokenParams<'a> { + /// For backwards compatibility, you can alternatively provide a Stripe token (e.g., for Apple Pay, Amex Express Checkout, or legacy Checkout) into the card hash with format card: {token: "tok_visa"}. + pub token: &'a str, +} +impl<'a> CreatePaymentMethodTokenParams<'a> { + pub fn new(token: &'a str) -> Self { + Self { token } + } +} +/// If this is an `eps` PaymentMethod, this hash contains details about the EPS payment method. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreatePaymentMethodEps { + /// The customer's bank. + #[serde(skip_serializing_if = "Option::is_none")] + pub bank: Option, +} +impl CreatePaymentMethodEps { + pub fn new() -> Self { + Self::default() + } +} +/// The customer's bank. +#[derive(Copy, Clone, Eq, PartialEq)] +#[non_exhaustive] +pub enum CreatePaymentMethodEpsBank { + ArzteUndApothekerBank, + AustrianAnadiBankAg, + BankAustria, + BankhausCarlSpangler, + BankhausSchelhammerUndSchatteraAg, + BawagPskAg, + BksBankAg, + BrullKallmusBankAg, + BtvVierLanderBank, + CapitalBankGraweGruppeAg, + DeutscheBankAg, + Dolomitenbank, + EasybankAg, + ErsteBankUndSparkassen, + HypoAlpeadriabankInternationalAg, + HypoBankBurgenlandAktiengesellschaft, + HypoNoeLbFurNiederosterreichUWien, + HypoOberosterreichSalzburgSteiermark, + HypoTirolBankAg, + HypoVorarlbergBankAg, + MarchfelderBank, + OberbankAg, + RaiffeisenBankengruppeOsterreich, + SchoellerbankAg, + SpardaBankWien, + VolksbankGruppe, + VolkskreditbankAg, + VrBankBraunau, + /// An unrecognized value from Stripe. Should not be used as a request parameter. + Unknown, +} +impl CreatePaymentMethodEpsBank { + pub fn as_str(self) -> &'static str { + use CreatePaymentMethodEpsBank::*; + match self { + ArzteUndApothekerBank => "arzte_und_apotheker_bank", + AustrianAnadiBankAg => "austrian_anadi_bank_ag", + BankAustria => "bank_austria", + BankhausCarlSpangler => "bankhaus_carl_spangler", + BankhausSchelhammerUndSchatteraAg => "bankhaus_schelhammer_und_schattera_ag", + BawagPskAg => "bawag_psk_ag", + BksBankAg => "bks_bank_ag", + BrullKallmusBankAg => "brull_kallmus_bank_ag", + BtvVierLanderBank => "btv_vier_lander_bank", + CapitalBankGraweGruppeAg => "capital_bank_grawe_gruppe_ag", + DeutscheBankAg => "deutsche_bank_ag", + Dolomitenbank => "dolomitenbank", + EasybankAg => "easybank_ag", + ErsteBankUndSparkassen => "erste_bank_und_sparkassen", + HypoAlpeadriabankInternationalAg => "hypo_alpeadriabank_international_ag", + HypoBankBurgenlandAktiengesellschaft => "hypo_bank_burgenland_aktiengesellschaft", + HypoNoeLbFurNiederosterreichUWien => "hypo_noe_lb_fur_niederosterreich_u_wien", + HypoOberosterreichSalzburgSteiermark => "hypo_oberosterreich_salzburg_steiermark", + HypoTirolBankAg => "hypo_tirol_bank_ag", + HypoVorarlbergBankAg => "hypo_vorarlberg_bank_ag", + MarchfelderBank => "marchfelder_bank", + OberbankAg => "oberbank_ag", + RaiffeisenBankengruppeOsterreich => "raiffeisen_bankengruppe_osterreich", + SchoellerbankAg => "schoellerbank_ag", + SpardaBankWien => "sparda_bank_wien", + VolksbankGruppe => "volksbank_gruppe", + VolkskreditbankAg => "volkskreditbank_ag", + VrBankBraunau => "vr_bank_braunau", + Unknown => "unknown", + } + } +} + +impl std::str::FromStr for CreatePaymentMethodEpsBank { + type Err = (); + fn from_str(s: &str) -> Result { + use CreatePaymentMethodEpsBank::*; + match s { + "arzte_und_apotheker_bank" => Ok(ArzteUndApothekerBank), + "austrian_anadi_bank_ag" => Ok(AustrianAnadiBankAg), + "bank_austria" => Ok(BankAustria), + "bankhaus_carl_spangler" => Ok(BankhausCarlSpangler), + "bankhaus_schelhammer_und_schattera_ag" => Ok(BankhausSchelhammerUndSchatteraAg), + "bawag_psk_ag" => Ok(BawagPskAg), + "bks_bank_ag" => Ok(BksBankAg), + "brull_kallmus_bank_ag" => Ok(BrullKallmusBankAg), + "btv_vier_lander_bank" => Ok(BtvVierLanderBank), + "capital_bank_grawe_gruppe_ag" => Ok(CapitalBankGraweGruppeAg), + "deutsche_bank_ag" => Ok(DeutscheBankAg), + "dolomitenbank" => Ok(Dolomitenbank), + "easybank_ag" => Ok(EasybankAg), + "erste_bank_und_sparkassen" => Ok(ErsteBankUndSparkassen), + "hypo_alpeadriabank_international_ag" => Ok(HypoAlpeadriabankInternationalAg), + "hypo_bank_burgenland_aktiengesellschaft" => Ok(HypoBankBurgenlandAktiengesellschaft), + "hypo_noe_lb_fur_niederosterreich_u_wien" => Ok(HypoNoeLbFurNiederosterreichUWien), + "hypo_oberosterreich_salzburg_steiermark" => Ok(HypoOberosterreichSalzburgSteiermark), + "hypo_tirol_bank_ag" => Ok(HypoTirolBankAg), + "hypo_vorarlberg_bank_ag" => Ok(HypoVorarlbergBankAg), + "marchfelder_bank" => Ok(MarchfelderBank), + "oberbank_ag" => Ok(OberbankAg), + "raiffeisen_bankengruppe_osterreich" => Ok(RaiffeisenBankengruppeOsterreich), + "schoellerbank_ag" => Ok(SchoellerbankAg), + "sparda_bank_wien" => Ok(SpardaBankWien), + "volksbank_gruppe" => Ok(VolksbankGruppe), + "volkskreditbank_ag" => Ok(VolkskreditbankAg), + "vr_bank_braunau" => Ok(VrBankBraunau), + _ => Err(()), + } + } +} +impl std::fmt::Display for CreatePaymentMethodEpsBank { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreatePaymentMethodEpsBank { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreatePaymentMethodEpsBank { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// If this is an `fpx` PaymentMethod, this hash contains details about the FPX payment method. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreatePaymentMethodFpx { + /// Account holder type for FPX transaction + #[serde(skip_serializing_if = "Option::is_none")] + pub account_holder_type: Option, + /// The customer's bank. + pub bank: CreatePaymentMethodFpxBank, +} +impl CreatePaymentMethodFpx { + pub fn new(bank: CreatePaymentMethodFpxBank) -> Self { + Self { account_holder_type: None, bank } + } +} +/// Account holder type for FPX transaction +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreatePaymentMethodFpxAccountHolderType { + Company, + Individual, +} +impl CreatePaymentMethodFpxAccountHolderType { + pub fn as_str(self) -> &'static str { + use CreatePaymentMethodFpxAccountHolderType::*; + match self { + Company => "company", + Individual => "individual", + } + } +} + +impl std::str::FromStr for CreatePaymentMethodFpxAccountHolderType { + type Err = (); + fn from_str(s: &str) -> Result { + use CreatePaymentMethodFpxAccountHolderType::*; + match s { + "company" => Ok(Company), + "individual" => Ok(Individual), + _ => Err(()), + } + } +} +impl std::fmt::Display for CreatePaymentMethodFpxAccountHolderType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreatePaymentMethodFpxAccountHolderType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreatePaymentMethodFpxAccountHolderType { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// The customer's bank. +#[derive(Copy, Clone, Eq, PartialEq)] +#[non_exhaustive] +pub enum CreatePaymentMethodFpxBank { + AffinBank, + Agrobank, + AllianceBank, + Ambank, + BankIslam, + BankMuamalat, + BankOfChina, + BankRakyat, + Bsn, + Cimb, + DeutscheBank, + HongLeongBank, + Hsbc, + Kfh, + Maybank2e, + Maybank2u, + Ocbc, + PbEnterprise, + PublicBank, + Rhb, + StandardChartered, + Uob, + /// An unrecognized value from Stripe. Should not be used as a request parameter. + Unknown, +} +impl CreatePaymentMethodFpxBank { + pub fn as_str(self) -> &'static str { + use CreatePaymentMethodFpxBank::*; + match self { + AffinBank => "affin_bank", + Agrobank => "agrobank", + AllianceBank => "alliance_bank", + Ambank => "ambank", + BankIslam => "bank_islam", + BankMuamalat => "bank_muamalat", + BankOfChina => "bank_of_china", + BankRakyat => "bank_rakyat", + Bsn => "bsn", + Cimb => "cimb", + DeutscheBank => "deutsche_bank", + HongLeongBank => "hong_leong_bank", + Hsbc => "hsbc", + Kfh => "kfh", + Maybank2e => "maybank2e", + Maybank2u => "maybank2u", + Ocbc => "ocbc", + PbEnterprise => "pb_enterprise", + PublicBank => "public_bank", + Rhb => "rhb", + StandardChartered => "standard_chartered", + Uob => "uob", + Unknown => "unknown", + } + } +} + +impl std::str::FromStr for CreatePaymentMethodFpxBank { + type Err = (); + fn from_str(s: &str) -> Result { + use CreatePaymentMethodFpxBank::*; + match s { + "affin_bank" => Ok(AffinBank), + "agrobank" => Ok(Agrobank), + "alliance_bank" => Ok(AllianceBank), + "ambank" => Ok(Ambank), + "bank_islam" => Ok(BankIslam), + "bank_muamalat" => Ok(BankMuamalat), + "bank_of_china" => Ok(BankOfChina), + "bank_rakyat" => Ok(BankRakyat), + "bsn" => Ok(Bsn), + "cimb" => Ok(Cimb), + "deutsche_bank" => Ok(DeutscheBank), + "hong_leong_bank" => Ok(HongLeongBank), + "hsbc" => Ok(Hsbc), + "kfh" => Ok(Kfh), + "maybank2e" => Ok(Maybank2e), + "maybank2u" => Ok(Maybank2u), + "ocbc" => Ok(Ocbc), + "pb_enterprise" => Ok(PbEnterprise), + "public_bank" => Ok(PublicBank), + "rhb" => Ok(Rhb), + "standard_chartered" => Ok(StandardChartered), + "uob" => Ok(Uob), + _ => Err(()), + } + } +} +impl std::fmt::Display for CreatePaymentMethodFpxBank { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreatePaymentMethodFpxBank { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreatePaymentMethodFpxBank { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// If this is an `ideal` PaymentMethod, this hash contains details about the iDEAL payment method. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreatePaymentMethodIdeal { + /// The customer's bank. + #[serde(skip_serializing_if = "Option::is_none")] + pub bank: Option, +} +impl CreatePaymentMethodIdeal { + pub fn new() -> Self { + Self::default() + } +} +/// The customer's bank. +#[derive(Copy, Clone, Eq, PartialEq)] +#[non_exhaustive] +pub enum CreatePaymentMethodIdealBank { + AbnAmro, + AsnBank, + Bunq, + Handelsbanken, + Ing, + Knab, + Moneyou, + N26, + Nn, + Rabobank, + Regiobank, + Revolut, + SnsBank, + TriodosBank, + VanLanschot, + Yoursafe, + /// An unrecognized value from Stripe. Should not be used as a request parameter. + Unknown, +} +impl CreatePaymentMethodIdealBank { + pub fn as_str(self) -> &'static str { + use CreatePaymentMethodIdealBank::*; + match self { + AbnAmro => "abn_amro", + AsnBank => "asn_bank", + Bunq => "bunq", + Handelsbanken => "handelsbanken", + Ing => "ing", + Knab => "knab", + Moneyou => "moneyou", + N26 => "n26", + Nn => "nn", + Rabobank => "rabobank", + Regiobank => "regiobank", + Revolut => "revolut", + SnsBank => "sns_bank", + TriodosBank => "triodos_bank", + VanLanschot => "van_lanschot", + Yoursafe => "yoursafe", + Unknown => "unknown", + } + } +} + +impl std::str::FromStr for CreatePaymentMethodIdealBank { + type Err = (); + fn from_str(s: &str) -> Result { + use CreatePaymentMethodIdealBank::*; + match s { + "abn_amro" => Ok(AbnAmro), + "asn_bank" => Ok(AsnBank), + "bunq" => Ok(Bunq), + "handelsbanken" => Ok(Handelsbanken), + "ing" => Ok(Ing), + "knab" => Ok(Knab), + "moneyou" => Ok(Moneyou), + "n26" => Ok(N26), + "nn" => Ok(Nn), + "rabobank" => Ok(Rabobank), + "regiobank" => Ok(Regiobank), + "revolut" => Ok(Revolut), + "sns_bank" => Ok(SnsBank), + "triodos_bank" => Ok(TriodosBank), + "van_lanschot" => Ok(VanLanschot), + "yoursafe" => Ok(Yoursafe), + _ => Err(()), + } + } +} +impl std::fmt::Display for CreatePaymentMethodIdealBank { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreatePaymentMethodIdealBank { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreatePaymentMethodIdealBank { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// If this is a `klarna` PaymentMethod, this hash contains details about the Klarna payment method. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreatePaymentMethodKlarna { + /// Customer's date of birth + #[serde(skip_serializing_if = "Option::is_none")] + pub dob: Option, +} +impl CreatePaymentMethodKlarna { + pub fn new() -> Self { + Self::default() + } +} +/// Customer's date of birth +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreatePaymentMethodKlarnaDob { + /// The day of birth, between 1 and 31. + pub day: i64, + /// The month of birth, between 1 and 12. + pub month: i64, + /// The four-digit year of birth. + pub year: i64, +} +impl CreatePaymentMethodKlarnaDob { + pub fn new(day: i64, month: i64, year: i64) -> Self { + Self { day, month, year } + } +} +/// If this is a `p24` PaymentMethod, this hash contains details about the P24 payment method. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreatePaymentMethodP24 { + /// The customer's bank. + #[serde(skip_serializing_if = "Option::is_none")] + pub bank: Option, +} +impl CreatePaymentMethodP24 { + pub fn new() -> Self { + Self::default() + } +} +/// The customer's bank. +#[derive(Copy, Clone, Eq, PartialEq)] +#[non_exhaustive] +pub enum CreatePaymentMethodP24Bank { + AliorBank, + BankMillennium, + BankNowyBfgSa, + BankPekaoSa, + BankiSpbdzielcze, + Blik, + BnpParibas, + Boz, + CitiHandlowy, + CreditAgricole, + Envelobank, + EtransferPocztowy24, + GetinBank, + Ideabank, + Ing, + Inteligo, + MbankMtransfer, + NestPrzelew, + NoblePay, + PbacZIpko, + PlusBank, + SantanderPrzelew24, + TmobileUsbugiBankowe, + ToyotaBank, + Velobank, + VolkswagenBank, + /// An unrecognized value from Stripe. Should not be used as a request parameter. + Unknown, +} +impl CreatePaymentMethodP24Bank { + pub fn as_str(self) -> &'static str { + use CreatePaymentMethodP24Bank::*; + match self { + AliorBank => "alior_bank", + BankMillennium => "bank_millennium", + BankNowyBfgSa => "bank_nowy_bfg_sa", + BankPekaoSa => "bank_pekao_sa", + BankiSpbdzielcze => "banki_spbdzielcze", + Blik => "blik", + BnpParibas => "bnp_paribas", + Boz => "boz", + CitiHandlowy => "citi_handlowy", + CreditAgricole => "credit_agricole", + Envelobank => "envelobank", + EtransferPocztowy24 => "etransfer_pocztowy24", + GetinBank => "getin_bank", + Ideabank => "ideabank", + Ing => "ing", + Inteligo => "inteligo", + MbankMtransfer => "mbank_mtransfer", + NestPrzelew => "nest_przelew", + NoblePay => "noble_pay", + PbacZIpko => "pbac_z_ipko", + PlusBank => "plus_bank", + SantanderPrzelew24 => "santander_przelew24", + TmobileUsbugiBankowe => "tmobile_usbugi_bankowe", + ToyotaBank => "toyota_bank", + Velobank => "velobank", + VolkswagenBank => "volkswagen_bank", + Unknown => "unknown", + } + } +} + +impl std::str::FromStr for CreatePaymentMethodP24Bank { + type Err = (); + fn from_str(s: &str) -> Result { + use CreatePaymentMethodP24Bank::*; + match s { + "alior_bank" => Ok(AliorBank), + "bank_millennium" => Ok(BankMillennium), + "bank_nowy_bfg_sa" => Ok(BankNowyBfgSa), + "bank_pekao_sa" => Ok(BankPekaoSa), + "banki_spbdzielcze" => Ok(BankiSpbdzielcze), + "blik" => Ok(Blik), + "bnp_paribas" => Ok(BnpParibas), + "boz" => Ok(Boz), + "citi_handlowy" => Ok(CitiHandlowy), + "credit_agricole" => Ok(CreditAgricole), + "envelobank" => Ok(Envelobank), + "etransfer_pocztowy24" => Ok(EtransferPocztowy24), + "getin_bank" => Ok(GetinBank), + "ideabank" => Ok(Ideabank), + "ing" => Ok(Ing), + "inteligo" => Ok(Inteligo), + "mbank_mtransfer" => Ok(MbankMtransfer), + "nest_przelew" => Ok(NestPrzelew), + "noble_pay" => Ok(NoblePay), + "pbac_z_ipko" => Ok(PbacZIpko), + "plus_bank" => Ok(PlusBank), + "santander_przelew24" => Ok(SantanderPrzelew24), + "tmobile_usbugi_bankowe" => Ok(TmobileUsbugiBankowe), + "toyota_bank" => Ok(ToyotaBank), + "velobank" => Ok(Velobank), + "volkswagen_bank" => Ok(VolkswagenBank), + _ => Err(()), + } + } +} +impl std::fmt::Display for CreatePaymentMethodP24Bank { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreatePaymentMethodP24Bank { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreatePaymentMethodP24Bank { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Options to configure Radar. +/// See [Radar Session](https://stripe.com/docs/radar/radar-session) for more information. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreatePaymentMethodRadarOptions<'a> { + /// A [Radar Session](https://stripe.com/docs/radar/radar-session) is a snapshot of the browser metadata and device details that help Radar make more accurate predictions on your payments. + #[serde(skip_serializing_if = "Option::is_none")] + pub session: Option<&'a str>, +} +impl<'a> CreatePaymentMethodRadarOptions<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// If this is a `sepa_debit` PaymentMethod, this hash contains details about the SEPA debit bank account. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreatePaymentMethodSepaDebit<'a> { + /// IBAN of the bank account. + pub iban: &'a str, +} +impl<'a> CreatePaymentMethodSepaDebit<'a> { + pub fn new(iban: &'a str) -> Self { + Self { iban } + } +} +/// If this is a `sofort` PaymentMethod, this hash contains details about the SOFORT payment method. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreatePaymentMethodSofort { + /// Two-letter ISO code representing the country the bank account is located in. + pub country: CreatePaymentMethodSofortCountry, +} +impl CreatePaymentMethodSofort { + pub fn new(country: CreatePaymentMethodSofortCountry) -> Self { + Self { country } + } +} +/// Two-letter ISO code representing the country the bank account is located in. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreatePaymentMethodSofortCountry { + At, + Be, + De, + Es, + It, + Nl, +} +impl CreatePaymentMethodSofortCountry { + pub fn as_str(self) -> &'static str { + use CreatePaymentMethodSofortCountry::*; + match self { + At => "AT", + Be => "BE", + De => "DE", + Es => "ES", + It => "IT", + Nl => "NL", + } + } +} + +impl std::str::FromStr for CreatePaymentMethodSofortCountry { + type Err = (); + fn from_str(s: &str) -> Result { + use CreatePaymentMethodSofortCountry::*; + match s { + "AT" => Ok(At), + "BE" => Ok(Be), + "DE" => Ok(De), + "ES" => Ok(Es), + "IT" => Ok(It), + "NL" => Ok(Nl), + _ => Err(()), + } + } +} +impl std::fmt::Display for CreatePaymentMethodSofortCountry { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreatePaymentMethodSofortCountry { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreatePaymentMethodSofortCountry { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// The type of the PaymentMethod. +/// An additional hash is included on the PaymentMethod with a name matching this value. +/// It contains additional information specific to the PaymentMethod type. +#[derive(Copy, Clone, Eq, PartialEq)] +#[non_exhaustive] +pub enum CreatePaymentMethodType { + AcssDebit, + Affirm, + AfterpayClearpay, + Alipay, + AuBecsDebit, + BacsDebit, + Bancontact, + Blik, + Boleto, + Card, + Cashapp, + CustomerBalance, + Eps, + Fpx, + Giropay, + Grabpay, + Ideal, + Klarna, + Konbini, + Link, + Oxxo, + P24, + Paynow, + Paypal, + Pix, + Promptpay, + RevolutPay, + SepaDebit, + Sofort, + Swish, + UsBankAccount, + WechatPay, + Zip, + /// An unrecognized value from Stripe. Should not be used as a request parameter. + Unknown, +} +impl CreatePaymentMethodType { + pub fn as_str(self) -> &'static str { + use CreatePaymentMethodType::*; + match self { + AcssDebit => "acss_debit", + Affirm => "affirm", + AfterpayClearpay => "afterpay_clearpay", + Alipay => "alipay", + AuBecsDebit => "au_becs_debit", + BacsDebit => "bacs_debit", + Bancontact => "bancontact", + Blik => "blik", + Boleto => "boleto", + Card => "card", + Cashapp => "cashapp", + CustomerBalance => "customer_balance", + Eps => "eps", + Fpx => "fpx", + Giropay => "giropay", + Grabpay => "grabpay", + Ideal => "ideal", + Klarna => "klarna", + Konbini => "konbini", + Link => "link", + Oxxo => "oxxo", + P24 => "p24", + Paynow => "paynow", + Paypal => "paypal", + Pix => "pix", + Promptpay => "promptpay", + RevolutPay => "revolut_pay", + SepaDebit => "sepa_debit", + Sofort => "sofort", + Swish => "swish", + UsBankAccount => "us_bank_account", + WechatPay => "wechat_pay", + Zip => "zip", + Unknown => "unknown", + } + } +} + +impl std::str::FromStr for CreatePaymentMethodType { + type Err = (); + fn from_str(s: &str) -> Result { + use CreatePaymentMethodType::*; + match s { + "acss_debit" => Ok(AcssDebit), + "affirm" => Ok(Affirm), + "afterpay_clearpay" => Ok(AfterpayClearpay), + "alipay" => Ok(Alipay), + "au_becs_debit" => Ok(AuBecsDebit), + "bacs_debit" => Ok(BacsDebit), + "bancontact" => Ok(Bancontact), + "blik" => Ok(Blik), + "boleto" => Ok(Boleto), + "card" => Ok(Card), + "cashapp" => Ok(Cashapp), + "customer_balance" => Ok(CustomerBalance), + "eps" => Ok(Eps), + "fpx" => Ok(Fpx), + "giropay" => Ok(Giropay), + "grabpay" => Ok(Grabpay), + "ideal" => Ok(Ideal), + "klarna" => Ok(Klarna), + "konbini" => Ok(Konbini), + "link" => Ok(Link), + "oxxo" => Ok(Oxxo), + "p24" => Ok(P24), + "paynow" => Ok(Paynow), + "paypal" => Ok(Paypal), + "pix" => Ok(Pix), + "promptpay" => Ok(Promptpay), + "revolut_pay" => Ok(RevolutPay), + "sepa_debit" => Ok(SepaDebit), + "sofort" => Ok(Sofort), + "swish" => Ok(Swish), + "us_bank_account" => Ok(UsBankAccount), + "wechat_pay" => Ok(WechatPay), + "zip" => Ok(Zip), + _ => Err(()), + } + } +} +impl std::fmt::Display for CreatePaymentMethodType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreatePaymentMethodType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreatePaymentMethodType { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// If this is an `us_bank_account` PaymentMethod, this hash contains details about the US bank account payment method. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreatePaymentMethodUsBankAccount<'a> { + /// Account holder type: individual or company. + #[serde(skip_serializing_if = "Option::is_none")] + pub account_holder_type: Option, + /// Account number of the bank account. + #[serde(skip_serializing_if = "Option::is_none")] + pub account_number: Option<&'a str>, + /// Account type: checkings or savings. Defaults to checking if omitted. + #[serde(skip_serializing_if = "Option::is_none")] + pub account_type: Option, + /// The ID of a Financial Connections Account to use as a payment method. + #[serde(skip_serializing_if = "Option::is_none")] + pub financial_connections_account: Option<&'a str>, + /// Routing number of the bank account. + #[serde(skip_serializing_if = "Option::is_none")] + pub routing_number: Option<&'a str>, +} +impl<'a> CreatePaymentMethodUsBankAccount<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// Account holder type: individual or company. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreatePaymentMethodUsBankAccountAccountHolderType { + Company, + Individual, +} +impl CreatePaymentMethodUsBankAccountAccountHolderType { + pub fn as_str(self) -> &'static str { + use CreatePaymentMethodUsBankAccountAccountHolderType::*; + match self { + Company => "company", + Individual => "individual", + } + } +} + +impl std::str::FromStr for CreatePaymentMethodUsBankAccountAccountHolderType { + type Err = (); + fn from_str(s: &str) -> Result { + use CreatePaymentMethodUsBankAccountAccountHolderType::*; + match s { + "company" => Ok(Company), + "individual" => Ok(Individual), + _ => Err(()), + } + } +} +impl std::fmt::Display for CreatePaymentMethodUsBankAccountAccountHolderType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreatePaymentMethodUsBankAccountAccountHolderType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreatePaymentMethodUsBankAccountAccountHolderType { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Account type: checkings or savings. Defaults to checking if omitted. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreatePaymentMethodUsBankAccountAccountType { + Checking, + Savings, +} +impl CreatePaymentMethodUsBankAccountAccountType { + pub fn as_str(self) -> &'static str { + use CreatePaymentMethodUsBankAccountAccountType::*; + match self { + Checking => "checking", + Savings => "savings", + } + } +} + +impl std::str::FromStr for CreatePaymentMethodUsBankAccountAccountType { + type Err = (); + fn from_str(s: &str) -> Result { + use CreatePaymentMethodUsBankAccountAccountType::*; + match s { + "checking" => Ok(Checking), + "savings" => Ok(Savings), + _ => Err(()), + } + } +} +impl std::fmt::Display for CreatePaymentMethodUsBankAccountAccountType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreatePaymentMethodUsBankAccountAccountType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreatePaymentMethodUsBankAccountAccountType { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'a> CreatePaymentMethod<'a> { + /// Creates a PaymentMethod object. + /// Read the [Stripe.js reference](https://stripe.com/docs/stripe-js/reference#stripe-create-payment-method) to learn how to create PaymentMethods via Stripe.js. + /// + /// Instead of creating a PaymentMethod directly, we recommend using the [PaymentIntents](https://stripe.com/docs/payments/accept-a-payment) API to accept a payment immediately or the [SetupIntent](https://stripe.com/docs/payments/save-and-reuse) API to collect payment method details ahead of a future payment. + pub fn send(&self, client: &stripe::Client) -> stripe::Response { + client.send_form("/payment_methods", self, http_types::Method::Post) + } +} +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdatePaymentMethod<'a> { + /// Billing information associated with the PaymentMethod that may be used or required by particular types of payment methods. + #[serde(skip_serializing_if = "Option::is_none")] + pub billing_details: Option>, + /// If this is a `card` PaymentMethod, this hash contains the user's card details. + #[serde(skip_serializing_if = "Option::is_none")] + pub card: Option, + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, + /// If this is an `Link` PaymentMethod, this hash contains details about the Link payment method. + #[serde(skip_serializing_if = "Option::is_none")] + pub link: Option<&'a serde_json::Value>, + /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. + /// This can be useful for storing additional information about the object in a structured format. + /// Individual keys can be unset by posting an empty value to them. + /// All keys can be unset by posting an empty value to `metadata`. + #[serde(skip_serializing_if = "Option::is_none")] + pub metadata: Option<&'a std::collections::HashMap>, + /// If this is an `us_bank_account` PaymentMethod, this hash contains details about the US bank account payment method. + #[serde(skip_serializing_if = "Option::is_none")] + pub us_bank_account: Option, +} +impl<'a> UpdatePaymentMethod<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// If this is a `card` PaymentMethod, this hash contains the user's card details. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdatePaymentMethodCard { + /// Two-digit number representing the card's expiration month. + #[serde(skip_serializing_if = "Option::is_none")] + pub exp_month: Option, + /// Four-digit number representing the card's expiration year. + #[serde(skip_serializing_if = "Option::is_none")] + pub exp_year: Option, +} +impl UpdatePaymentMethodCard { + pub fn new() -> Self { + Self::default() + } +} +/// If this is an `us_bank_account` PaymentMethod, this hash contains details about the US bank account payment method. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdatePaymentMethodUsBankAccount { + /// Bank account holder type. + #[serde(skip_serializing_if = "Option::is_none")] + pub account_holder_type: Option, + /// Bank account type. + #[serde(skip_serializing_if = "Option::is_none")] + pub account_type: Option, +} +impl UpdatePaymentMethodUsBankAccount { + pub fn new() -> Self { + Self::default() + } +} +/// Bank account holder type. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum UpdatePaymentMethodUsBankAccountAccountHolderType { + Company, + Individual, +} +impl UpdatePaymentMethodUsBankAccountAccountHolderType { + pub fn as_str(self) -> &'static str { + use UpdatePaymentMethodUsBankAccountAccountHolderType::*; + match self { + Company => "company", + Individual => "individual", + } + } +} + +impl std::str::FromStr for UpdatePaymentMethodUsBankAccountAccountHolderType { + type Err = (); + fn from_str(s: &str) -> Result { + use UpdatePaymentMethodUsBankAccountAccountHolderType::*; + match s { + "company" => Ok(Company), + "individual" => Ok(Individual), + _ => Err(()), + } + } +} +impl std::fmt::Display for UpdatePaymentMethodUsBankAccountAccountHolderType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for UpdatePaymentMethodUsBankAccountAccountHolderType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for UpdatePaymentMethodUsBankAccountAccountHolderType { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Bank account type. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum UpdatePaymentMethodUsBankAccountAccountType { + Checking, + Savings, +} +impl UpdatePaymentMethodUsBankAccountAccountType { + pub fn as_str(self) -> &'static str { + use UpdatePaymentMethodUsBankAccountAccountType::*; + match self { + Checking => "checking", + Savings => "savings", + } + } +} + +impl std::str::FromStr for UpdatePaymentMethodUsBankAccountAccountType { + type Err = (); + fn from_str(s: &str) -> Result { + use UpdatePaymentMethodUsBankAccountAccountType::*; + match s { + "checking" => Ok(Checking), + "savings" => Ok(Savings), + _ => Err(()), + } + } +} +impl std::fmt::Display for UpdatePaymentMethodUsBankAccountAccountType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for UpdatePaymentMethodUsBankAccountAccountType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for UpdatePaymentMethodUsBankAccountAccountType { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'a> UpdatePaymentMethod<'a> { + /// Updates a PaymentMethod object. A PaymentMethod must be attached a customer to be updated. + pub fn send( + &self, + client: &stripe::Client, + payment_method: &stripe_shared::PaymentMethodId, + ) -> stripe::Response { + client.send_form( + &format!("/payment_methods/{payment_method}"), + self, + http_types::Method::Post, + ) + } +} +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct AttachPaymentMethod<'a> { + /// The ID of the customer to which to attach the PaymentMethod. + pub customer: &'a str, + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, +} +impl<'a> AttachPaymentMethod<'a> { + pub fn new(customer: &'a str) -> Self { + Self { customer, expand: None } + } +} +impl<'a> AttachPaymentMethod<'a> { + /// Attaches a PaymentMethod object to a Customer. + /// + /// To attach a new PaymentMethod to a customer for future payments, we recommend you use a [SetupIntent](https://stripe.com/docs/api/setup_intents). + /// or a PaymentIntent with [setup_future_usage](https://stripe.com/docs/api/payment_intents/create#create_payment_intent-setup_future_usage). + /// These approaches will perform any necessary steps to set up the PaymentMethod for future payments. + /// Using the `/v1/payment_methods/:id/attach`. + /// endpoint without first using a SetupIntent or PaymentIntent with `setup_future_usage` does not optimize the PaymentMethod for. + /// future use, which makes later declines and payment friction more likely. + /// See [Optimizing cards for future payments](https://stripe.com/docs/payments/payment-intents#future-usage) for more information about setting up. + /// future payments. + /// + /// To use this PaymentMethod as the default for invoice or subscription payments, + /// set `invoice_settings.default_payment_method`,. + /// on the Customer to the PaymentMethod’s ID. + pub fn send( + &self, + client: &stripe::Client, + payment_method: &stripe_shared::PaymentMethodId, + ) -> stripe::Response { + client.send_form( + &format!("/payment_methods/{payment_method}/attach"), + self, + http_types::Method::Post, + ) + } +} +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct DetachPaymentMethod<'a> { + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, +} +impl<'a> DetachPaymentMethod<'a> { + pub fn new() -> Self { + Self::default() + } +} +impl<'a> DetachPaymentMethod<'a> { + /// Detaches a PaymentMethod object from a Customer. + /// After a PaymentMethod is detached, it can no longer be used for a payment or re-attached to a Customer. + pub fn send( + &self, + client: &stripe::Client, + payment_method: &stripe_shared::PaymentMethodId, + ) -> stripe::Response { + client.send_form( + &format!("/payment_methods/{payment_method}/detach"), + self, + http_types::Method::Post, + ) + } +} +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct BillingDetailsAddress<'a> { + /// City, district, suburb, town, or village. + #[serde(skip_serializing_if = "Option::is_none")] + pub city: Option<&'a str>, + /// Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). + #[serde(skip_serializing_if = "Option::is_none")] + pub country: Option<&'a str>, + /// Address line 1 (e.g., street, PO Box, or company name). + #[serde(skip_serializing_if = "Option::is_none")] + pub line1: Option<&'a str>, + /// Address line 2 (e.g., apartment, suite, unit, or building). + #[serde(skip_serializing_if = "Option::is_none")] + pub line2: Option<&'a str>, + /// ZIP or postal code. + #[serde(skip_serializing_if = "Option::is_none")] + pub postal_code: Option<&'a str>, + /// State, county, province, or region. + #[serde(skip_serializing_if = "Option::is_none")] + pub state: Option<&'a str>, +} +impl<'a> BillingDetailsAddress<'a> { + pub fn new() -> Self { + Self::default() + } +} +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct BillingDetailsInnerParams<'a> { + /// Billing address. + #[serde(skip_serializing_if = "Option::is_none")] + pub address: Option>, + /// Email address. + #[serde(skip_serializing_if = "Option::is_none")] + pub email: Option<&'a str>, + /// Full name. + #[serde(skip_serializing_if = "Option::is_none")] + pub name: Option<&'a str>, + /// Billing phone number (including extension). + #[serde(skip_serializing_if = "Option::is_none")] + pub phone: Option<&'a str>, +} +impl<'a> BillingDetailsInnerParams<'a> { + pub fn new() -> Self { + Self::default() + } +} diff --git a/generated/stripe_payment/src/payment_method_config_resource_display_preference.rs b/generated/stripe_payment/src/payment_method_config_resource_display_preference.rs new file mode 100644 index 000000000..53b6167f9 --- /dev/null +++ b/generated/stripe_payment/src/payment_method_config_resource_display_preference.rs @@ -0,0 +1,127 @@ +#[derive(Copy, Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct PaymentMethodConfigResourceDisplayPreference { + /// For child configs, whether or not the account's preference will be observed. + /// If `false`, the parent configuration's default is used. + pub overridable: Option, + /// The account's display preference. + pub preference: PaymentMethodConfigResourceDisplayPreferencePreference, + /// The effective display preference value. + pub value: PaymentMethodConfigResourceDisplayPreferenceValue, +} +/// The account's display preference. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum PaymentMethodConfigResourceDisplayPreferencePreference { + None, + Off, + On, +} +impl PaymentMethodConfigResourceDisplayPreferencePreference { + pub fn as_str(self) -> &'static str { + use PaymentMethodConfigResourceDisplayPreferencePreference::*; + match self { + None => "none", + Off => "off", + On => "on", + } + } +} + +impl std::str::FromStr for PaymentMethodConfigResourceDisplayPreferencePreference { + type Err = (); + fn from_str(s: &str) -> Result { + use PaymentMethodConfigResourceDisplayPreferencePreference::*; + match s { + "none" => Ok(None), + "off" => Ok(Off), + "on" => Ok(On), + _ => Err(()), + } + } +} +impl std::fmt::Display for PaymentMethodConfigResourceDisplayPreferencePreference { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for PaymentMethodConfigResourceDisplayPreferencePreference { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for PaymentMethodConfigResourceDisplayPreferencePreference { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for PaymentMethodConfigResourceDisplayPreferencePreference { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| { + serde::de::Error::custom( + "Unknown value for PaymentMethodConfigResourceDisplayPreferencePreference", + ) + }) + } +} +/// The effective display preference value. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum PaymentMethodConfigResourceDisplayPreferenceValue { + Off, + On, +} +impl PaymentMethodConfigResourceDisplayPreferenceValue { + pub fn as_str(self) -> &'static str { + use PaymentMethodConfigResourceDisplayPreferenceValue::*; + match self { + Off => "off", + On => "on", + } + } +} + +impl std::str::FromStr for PaymentMethodConfigResourceDisplayPreferenceValue { + type Err = (); + fn from_str(s: &str) -> Result { + use PaymentMethodConfigResourceDisplayPreferenceValue::*; + match s { + "off" => Ok(Off), + "on" => Ok(On), + _ => Err(()), + } + } +} +impl std::fmt::Display for PaymentMethodConfigResourceDisplayPreferenceValue { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for PaymentMethodConfigResourceDisplayPreferenceValue { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for PaymentMethodConfigResourceDisplayPreferenceValue { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for PaymentMethodConfigResourceDisplayPreferenceValue { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| { + serde::de::Error::custom( + "Unknown value for PaymentMethodConfigResourceDisplayPreferenceValue", + ) + }) + } +} diff --git a/generated/stripe_payment/src/payment_method_config_resource_payment_method_properties.rs b/generated/stripe_payment/src/payment_method_config_resource_payment_method_properties.rs new file mode 100644 index 000000000..ef32708bc --- /dev/null +++ b/generated/stripe_payment/src/payment_method_config_resource_payment_method_properties.rs @@ -0,0 +1,7 @@ +#[derive(Copy, Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct PaymentMethodConfigResourcePaymentMethodProperties { + /// Whether this payment method may be offered at checkout. + /// True if `display_preference` is `on` and the payment method's capability is active. + pub available: bool, + pub display_preference: stripe_payment::PaymentMethodConfigResourceDisplayPreference, +} diff --git a/generated/stripe_payment/src/payment_method_configuration/mod.rs b/generated/stripe_payment/src/payment_method_configuration/mod.rs new file mode 100644 index 000000000..a7aab8347 --- /dev/null +++ b/generated/stripe_payment/src/payment_method_configuration/mod.rs @@ -0,0 +1,5 @@ +#[cfg(feature = "payment_method_configuration")] +mod requests; +pub(crate) mod types; +#[cfg(feature = "payment_method_configuration")] +pub use requests::*; diff --git a/generated/stripe_payment/src/payment_method_configuration/requests.rs b/generated/stripe_payment/src/payment_method_configuration/requests.rs new file mode 100644 index 000000000..363c4bb5b --- /dev/null +++ b/generated/stripe_payment/src/payment_method_configuration/requests.rs @@ -0,0 +1,5730 @@ +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct ListPaymentMethodConfiguration<'a> { + /// The Connect application to filter by. + #[serde(skip_serializing_if = "Option::is_none")] + pub application: Option<&'a str>, + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, +} +impl<'a> ListPaymentMethodConfiguration<'a> { + pub fn new() -> Self { + Self::default() + } +} +impl<'a> ListPaymentMethodConfiguration<'a> { + /// List payment method configurations + pub fn send( + &self, + client: &stripe::Client, + ) -> stripe::Response> { + client.get_query("/payment_method_configurations", self) + } + pub fn paginate( + self, + ) -> stripe::ListPaginator> { + stripe::ListPaginator::from_list_params("/payment_method_configurations", self) + } +} +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct RetrievePaymentMethodConfiguration<'a> { + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, +} +impl<'a> RetrievePaymentMethodConfiguration<'a> { + pub fn new() -> Self { + Self::default() + } +} +impl<'a> RetrievePaymentMethodConfiguration<'a> { + /// Retrieve payment method configuration + pub fn send( + &self, + client: &stripe::Client, + configuration: &stripe_payment::PaymentMethodConfigurationId, + ) -> stripe::Response { + client.get_query(&format!("/payment_method_configurations/{configuration}"), self) + } +} +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreatePaymentMethodConfiguration<'a> { + /// Canadian pre-authorized debit payments, check this [page](https://stripe.com/docs/payments/acss-debit) for more details like country availability. + #[serde(skip_serializing_if = "Option::is_none")] + pub acss_debit: Option, + /// [Affirm](https://www.affirm.com/) gives your customers a way to split purchases over a series of payments. + /// Depending on the purchase, they can pay with four interest-free payments (Split Pay) or pay over a longer term (Installments), which might include interest. + /// Check this [page](https://stripe.com/docs/payments/affirm) for more details like country availability. + #[serde(skip_serializing_if = "Option::is_none")] + pub affirm: Option, + /// Afterpay gives your customers a way to pay for purchases in installments, check this [page](https://stripe.com/docs/payments/afterpay-clearpay) for more details like country availability. + /// Afterpay is particularly popular among businesses selling fashion, beauty, and sports products. + #[serde(skip_serializing_if = "Option::is_none")] + pub afterpay_clearpay: Option, + /// Alipay is a digital wallet in China that has more than a billion active users worldwide. + /// Alipay users can pay on the web or on a mobile device using login credentials or their Alipay app. + /// Alipay has a low dispute rate and reduces fraud by authenticating payments using the customer's login credentials. + /// Check this [page](https://stripe.com/docs/payments/alipay) for more details. + #[serde(skip_serializing_if = "Option::is_none")] + pub alipay: Option, + /// Stripe users can accept [Apple Pay](/payments/apple-pay) in iOS applications in iOS 9 and later, and on the web in Safari starting with iOS 10 or macOS Sierra. + /// There are no additional fees to process Apple Pay payments, and the [pricing](/pricing) is the same as other card transactions. + /// Check this [page](https://stripe.com/docs/apple-pay) for more details. + #[serde(skip_serializing_if = "Option::is_none")] + pub apple_pay: Option, + /// Apple Pay Later, a payment method for customers to buy now and pay later, gives your customers a way to split purchases into four installments across six weeks. + #[serde(skip_serializing_if = "Option::is_none")] + pub apple_pay_later: Option, + /// Stripe users in Australia can accept Bulk Electronic Clearing System (BECS) direct debit payments from customers with an Australian bank account. + /// Check this [page](https://stripe.com/docs/payments/au-becs-debit) for more details. + #[serde(skip_serializing_if = "Option::is_none")] + pub au_becs_debit: Option, + /// Stripe users in the UK can accept Bacs Direct Debit payments from customers with a UK bank account, check this [page](https://stripe.com/docs/payments/payment-methods/bacs-debit) for more details. + #[serde(skip_serializing_if = "Option::is_none")] + pub bacs_debit: Option, + /// Bancontact is the most popular online payment method in Belgium, with over 15 million cards in circulation. + /// [Customers](https://stripe.com/docs/api/customers) use a Bancontact card or mobile app linked to a Belgian bank account to make online payments that are secure, guaranteed, and confirmed immediately. + /// Check this [page](https://stripe.com/docs/payments/bancontact) for more details. + #[serde(skip_serializing_if = "Option::is_none")] + pub bancontact: Option, + /// BLIK is a [single use](https://stripe.com/docs/payments/payment-methods#usage) payment method that requires customers to authenticate their payments. + /// When customers want to pay online using BLIK, they request a six-digit code from their banking application and enter it into the payment collection form. + /// Check this [page](https://stripe.com/docs/payments/blik) for more details. + #[serde(skip_serializing_if = "Option::is_none")] + pub blik: Option, + /// Boleto is an official (regulated by the Central Bank of Brazil) payment method in Brazil. + /// Check this [page](https://stripe.com/docs/payments/boleto) for more details. + #[serde(skip_serializing_if = "Option::is_none")] + pub boleto: Option, + /// Cards are a popular way for consumers and businesses to pay online or in person. + /// Stripe supports global and local card networks. + #[serde(skip_serializing_if = "Option::is_none")] + pub card: Option, + /// Cartes Bancaires is France's local card network. + /// More than 95% of these cards are co-branded with either Visa or Mastercard, meaning you can process these cards over either Cartes Bancaires or the Visa or Mastercard networks. + /// Check this [page](https://stripe.com/docs/payments/cartes-bancaires) for more details. + #[serde(skip_serializing_if = "Option::is_none")] + pub cartes_bancaires: Option, + /// Cash App is a popular consumer app in the US that allows customers to bank, invest, send, and receive money using their digital wallet. + /// Check this [page](https://stripe.com/docs/payments/cash-app-pay) for more details. + #[serde(skip_serializing_if = "Option::is_none")] + pub cashapp: Option, + /// Uses a customer’s [cash balance](https://stripe.com/docs/payments/customer-balance) for the payment. + /// The cash balance can be funded via a bank transfer. + /// Check this [page](https://stripe.com/docs/payments/bank-transfers) for more details. + #[serde(skip_serializing_if = "Option::is_none")] + pub customer_balance: Option, + /// EPS is an Austria-based payment method that allows customers to complete transactions online using their bank credentials. + /// EPS is supported by all Austrian banks and is accepted by over 80% of Austrian online retailers. + /// Check this [page](https://stripe.com/docs/payments/eps) for more details. + #[serde(skip_serializing_if = "Option::is_none")] + pub eps: Option, + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, + /// Financial Process Exchange (FPX) is a Malaysia-based payment method that allows customers to complete transactions online using their bank credentials. + /// Bank Negara Malaysia (BNM), the Central Bank of Malaysia, and eleven other major Malaysian financial institutions are members of the PayNet Group, which owns and operates FPX. + /// It is one of the most popular online payment methods in Malaysia, with nearly 90 million transactions in 2018 according to BNM. + /// Check this [page](https://stripe.com/docs/payments/fpx) for more details. + #[serde(skip_serializing_if = "Option::is_none")] + pub fpx: Option, + /// giropay is a German payment method based on online banking, introduced in 2006. + /// It allows customers to complete transactions online using their online banking environment, with funds debited from their bank account. + /// Depending on their bank, customers confirm payments on giropay using a second factor of authentication or a PIN. + /// giropay accounts for 10% of online checkouts in Germany. + /// Check this [page](https://stripe.com/docs/payments/giropay) for more details. + #[serde(skip_serializing_if = "Option::is_none")] + pub giropay: Option, + /// Google Pay allows customers to make payments in your app or website using any credit or debit card saved to their Google Account, including those from Google Play, YouTube, Chrome, or an Android device. + /// Use the Google Pay API to request any credit or debit card stored in your customer's Google account. + /// Check this [page](https://stripe.com/docs/google-pay) for more details. + #[serde(skip_serializing_if = "Option::is_none")] + pub google_pay: Option, + /// GrabPay is a payment method developed by [Grab](https://www.grab.com/sg/consumer/finance/pay/). + /// GrabPay is a digital wallet - customers maintain a balance in their wallets that they pay out with. + /// Check this [page](https://stripe.com/docs/payments/grabpay) for more details. + #[serde(skip_serializing_if = "Option::is_none")] + pub grabpay: Option, + /// iDEAL is a Netherlands-based payment method that allows customers to complete transactions online using their bank credentials. + /// All major Dutch banks are members of Currence, the scheme that operates iDEAL, making it the most popular online payment method in the Netherlands with a share of online transactions close to 55%. + /// Check this [page](https://stripe.com/docs/payments/ideal) for more details. + #[serde(skip_serializing_if = "Option::is_none")] + pub ideal: Option, + /// JCB is a credit card company based in Japan. + /// JCB is currently available in Japan to businesses approved by JCB, and available to all businesses in Australia, Canada, Hong Kong, Japan, New Zealand, Singapore, Switzerland, United Kingdom, United States, and all countries in the European Economic Area except Iceland. + /// Check this [page](https://support.stripe.com/questions/accepting-japan-credit-bureau-%28jcb%29-payments) for more details. + #[serde(skip_serializing_if = "Option::is_none")] + pub jcb: Option, + /// Klarna gives customers a range of [payment options](https://stripe.com/docs/payments/klarna#payment-options) during checkout. + /// Available payment options vary depending on the customer's billing address and the transaction amount. + /// These payment options make it convenient for customers to purchase items in all price ranges. + /// Check this [page](https://stripe.com/docs/payments/klarna) for more details. + #[serde(skip_serializing_if = "Option::is_none")] + pub klarna: Option, + /// Konbini allows customers in Japan to pay for bills and online purchases at convenience stores with cash. + /// Check this [page](https://stripe.com/docs/payments/konbini) for more details. + #[serde(skip_serializing_if = "Option::is_none")] + pub konbini: Option, + /// [Link](https://stripe.com/docs/payments/link) is a payment method network. + /// With Link, users save their payment details once, then reuse that information to pay with one click for any business on the network. + #[serde(skip_serializing_if = "Option::is_none")] + pub link: Option, + /// Configuration name. + #[serde(skip_serializing_if = "Option::is_none")] + pub name: Option<&'a str>, + /// OXXO is a Mexican chain of convenience stores with thousands of locations across Latin America and represents nearly 20% of online transactions in Mexico. + /// OXXO allows customers to pay bills and online purchases in-store with cash. + /// Check this [page](https://stripe.com/docs/payments/oxxo) for more details. + #[serde(skip_serializing_if = "Option::is_none")] + pub oxxo: Option, + /// Przelewy24 is a Poland-based payment method aggregator that allows customers to complete transactions online using bank transfers and other methods. + /// Bank transfers account for 30% of online payments in Poland and Przelewy24 provides a way for customers to pay with over 165 banks. + /// Check this [page](https://stripe.com/docs/payments/p24) for more details. + #[serde(skip_serializing_if = "Option::is_none")] + pub p24: Option, + /// Configuration's parent configuration. Specify to create a child configuration. + #[serde(skip_serializing_if = "Option::is_none")] + pub parent: Option<&'a str>, + /// PayNow is a Singapore-based payment method that allows customers to make a payment using their preferred app from participating banks and participating non-bank financial institutions. + /// Check this [page](https://stripe.com/docs/payments/paynow) for more details. + #[serde(skip_serializing_if = "Option::is_none")] + pub paynow: Option, + /// PayPal, a digital wallet popular with customers in Europe, allows your customers worldwide to pay using their PayPal account. + /// Check this [page](https://stripe.com/docs/payments/paypal) for more details. + #[serde(skip_serializing_if = "Option::is_none")] + pub paypal: Option, + /// PromptPay is a Thailand-based payment method that allows customers to make a payment using their preferred app from participating banks. + /// Check this [page](https://stripe.com/docs/payments/promptpay) for more details. + #[serde(skip_serializing_if = "Option::is_none")] + pub promptpay: Option, + /// Revolut Pay, developed by Revolut, a global finance app, is a digital wallet payment method. + /// Revolut Pay uses the customer’s stored balance or cards to fund the payment, and offers the option for non-Revolut customers to save their details after their first purchase. + #[serde(skip_serializing_if = "Option::is_none")] + pub revolut_pay: Option, + /// The [Single Euro Payments Area (SEPA)](https://en.wikipedia.org/wiki/Single_Euro_Payments_Area) is an initiative of the European Union to simplify payments within and across member countries. + /// SEPA established and enforced banking standards to allow for the direct debiting of every EUR-denominated bank account within the SEPA region, check this [page](https://stripe.com/docs/payments/sepa-debit) for more details. + #[serde(skip_serializing_if = "Option::is_none")] + pub sepa_debit: Option, + /// Stripe users in Europe and the United States can use the [Payment Intents API](https://stripe.com/docs/payments/payment-intents)—a single integration path for creating payments using any supported method—to accept [Sofort](https://www.sofort.com/) payments from customers. + /// Check this [page](https://stripe.com/docs/payments/sofort) for more details. + #[serde(skip_serializing_if = "Option::is_none")] + pub sofort: Option, + /// Stripe users in the United States can accept ACH direct debit payments from customers with a US bank account using the Automated Clearing House (ACH) payments system operated by Nacha. + /// Check this [page](https://stripe.com/docs/payments/ach-debit) for more details. + #[serde(skip_serializing_if = "Option::is_none")] + pub us_bank_account: Option, + /// WeChat, owned by Tencent, is China's leading mobile app with over 1 billion monthly active users. + /// Chinese consumers can use WeChat Pay to pay for goods and services inside of businesses' apps and websites. + /// WeChat Pay users buy most frequently in gaming, e-commerce, travel, online education, and food/nutrition. + /// Check this [page](https://stripe.com/docs/payments/wechat-pay) for more details. + #[serde(skip_serializing_if = "Option::is_none")] + pub wechat_pay: Option, +} +impl<'a> CreatePaymentMethodConfiguration<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// Canadian pre-authorized debit payments, check this [page](https://stripe.com/docs/payments/acss-debit) for more details like country availability. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreatePaymentMethodConfigurationAcssDebit { + /// Whether or not the payment method should be displayed. + #[serde(skip_serializing_if = "Option::is_none")] + pub display_preference: Option, +} +impl CreatePaymentMethodConfigurationAcssDebit { + pub fn new() -> Self { + Self::default() + } +} +/// Whether or not the payment method should be displayed. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreatePaymentMethodConfigurationAcssDebitDisplayPreference { + /// The account's preference for whether or not to display this payment method. + #[serde(skip_serializing_if = "Option::is_none")] + pub preference: Option, +} +impl CreatePaymentMethodConfigurationAcssDebitDisplayPreference { + pub fn new() -> Self { + Self::default() + } +} +/// The account's preference for whether or not to display this payment method. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreatePaymentMethodConfigurationAcssDebitDisplayPreferencePreference { + None, + Off, + On, +} +impl CreatePaymentMethodConfigurationAcssDebitDisplayPreferencePreference { + pub fn as_str(self) -> &'static str { + use CreatePaymentMethodConfigurationAcssDebitDisplayPreferencePreference::*; + match self { + None => "none", + Off => "off", + On => "on", + } + } +} + +impl std::str::FromStr for CreatePaymentMethodConfigurationAcssDebitDisplayPreferencePreference { + type Err = (); + fn from_str(s: &str) -> Result { + use CreatePaymentMethodConfigurationAcssDebitDisplayPreferencePreference::*; + match s { + "none" => Ok(None), + "off" => Ok(Off), + "on" => Ok(On), + _ => Err(()), + } + } +} +impl std::fmt::Display for CreatePaymentMethodConfigurationAcssDebitDisplayPreferencePreference { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreatePaymentMethodConfigurationAcssDebitDisplayPreferencePreference { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreatePaymentMethodConfigurationAcssDebitDisplayPreferencePreference { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// [Affirm](https://www.affirm.com/) gives your customers a way to split purchases over a series of payments. +/// Depending on the purchase, they can pay with four interest-free payments (Split Pay) or pay over a longer term (Installments), which might include interest. +/// Check this [page](https://stripe.com/docs/payments/affirm) for more details like country availability. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreatePaymentMethodConfigurationAffirm { + /// Whether or not the payment method should be displayed. + #[serde(skip_serializing_if = "Option::is_none")] + pub display_preference: Option, +} +impl CreatePaymentMethodConfigurationAffirm { + pub fn new() -> Self { + Self::default() + } +} +/// Whether or not the payment method should be displayed. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreatePaymentMethodConfigurationAffirmDisplayPreference { + /// The account's preference for whether or not to display this payment method. + #[serde(skip_serializing_if = "Option::is_none")] + pub preference: Option, +} +impl CreatePaymentMethodConfigurationAffirmDisplayPreference { + pub fn new() -> Self { + Self::default() + } +} +/// The account's preference for whether or not to display this payment method. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreatePaymentMethodConfigurationAffirmDisplayPreferencePreference { + None, + Off, + On, +} +impl CreatePaymentMethodConfigurationAffirmDisplayPreferencePreference { + pub fn as_str(self) -> &'static str { + use CreatePaymentMethodConfigurationAffirmDisplayPreferencePreference::*; + match self { + None => "none", + Off => "off", + On => "on", + } + } +} + +impl std::str::FromStr for CreatePaymentMethodConfigurationAffirmDisplayPreferencePreference { + type Err = (); + fn from_str(s: &str) -> Result { + use CreatePaymentMethodConfigurationAffirmDisplayPreferencePreference::*; + match s { + "none" => Ok(None), + "off" => Ok(Off), + "on" => Ok(On), + _ => Err(()), + } + } +} +impl std::fmt::Display for CreatePaymentMethodConfigurationAffirmDisplayPreferencePreference { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreatePaymentMethodConfigurationAffirmDisplayPreferencePreference { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreatePaymentMethodConfigurationAffirmDisplayPreferencePreference { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Afterpay gives your customers a way to pay for purchases in installments, check this [page](https://stripe.com/docs/payments/afterpay-clearpay) for more details like country availability. +/// Afterpay is particularly popular among businesses selling fashion, beauty, and sports products. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreatePaymentMethodConfigurationAfterpayClearpay { + /// Whether or not the payment method should be displayed. + #[serde(skip_serializing_if = "Option::is_none")] + pub display_preference: + Option, +} +impl CreatePaymentMethodConfigurationAfterpayClearpay { + pub fn new() -> Self { + Self::default() + } +} +/// Whether or not the payment method should be displayed. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreatePaymentMethodConfigurationAfterpayClearpayDisplayPreference { + /// The account's preference for whether or not to display this payment method. + #[serde(skip_serializing_if = "Option::is_none")] + pub preference: + Option, +} +impl CreatePaymentMethodConfigurationAfterpayClearpayDisplayPreference { + pub fn new() -> Self { + Self::default() + } +} +/// The account's preference for whether or not to display this payment method. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreatePaymentMethodConfigurationAfterpayClearpayDisplayPreferencePreference { + None, + Off, + On, +} +impl CreatePaymentMethodConfigurationAfterpayClearpayDisplayPreferencePreference { + pub fn as_str(self) -> &'static str { + use CreatePaymentMethodConfigurationAfterpayClearpayDisplayPreferencePreference::*; + match self { + None => "none", + Off => "off", + On => "on", + } + } +} + +impl std::str::FromStr + for CreatePaymentMethodConfigurationAfterpayClearpayDisplayPreferencePreference +{ + type Err = (); + fn from_str(s: &str) -> Result { + use CreatePaymentMethodConfigurationAfterpayClearpayDisplayPreferencePreference::*; + match s { + "none" => Ok(None), + "off" => Ok(Off), + "on" => Ok(On), + _ => Err(()), + } + } +} +impl std::fmt::Display + for CreatePaymentMethodConfigurationAfterpayClearpayDisplayPreferencePreference +{ + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug + for CreatePaymentMethodConfigurationAfterpayClearpayDisplayPreferencePreference +{ + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize + for CreatePaymentMethodConfigurationAfterpayClearpayDisplayPreferencePreference +{ + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Alipay is a digital wallet in China that has more than a billion active users worldwide. +/// Alipay users can pay on the web or on a mobile device using login credentials or their Alipay app. +/// Alipay has a low dispute rate and reduces fraud by authenticating payments using the customer's login credentials. +/// Check this [page](https://stripe.com/docs/payments/alipay) for more details. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreatePaymentMethodConfigurationAlipay { + /// Whether or not the payment method should be displayed. + #[serde(skip_serializing_if = "Option::is_none")] + pub display_preference: Option, +} +impl CreatePaymentMethodConfigurationAlipay { + pub fn new() -> Self { + Self::default() + } +} +/// Whether or not the payment method should be displayed. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreatePaymentMethodConfigurationAlipayDisplayPreference { + /// The account's preference for whether or not to display this payment method. + #[serde(skip_serializing_if = "Option::is_none")] + pub preference: Option, +} +impl CreatePaymentMethodConfigurationAlipayDisplayPreference { + pub fn new() -> Self { + Self::default() + } +} +/// The account's preference for whether or not to display this payment method. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreatePaymentMethodConfigurationAlipayDisplayPreferencePreference { + None, + Off, + On, +} +impl CreatePaymentMethodConfigurationAlipayDisplayPreferencePreference { + pub fn as_str(self) -> &'static str { + use CreatePaymentMethodConfigurationAlipayDisplayPreferencePreference::*; + match self { + None => "none", + Off => "off", + On => "on", + } + } +} + +impl std::str::FromStr for CreatePaymentMethodConfigurationAlipayDisplayPreferencePreference { + type Err = (); + fn from_str(s: &str) -> Result { + use CreatePaymentMethodConfigurationAlipayDisplayPreferencePreference::*; + match s { + "none" => Ok(None), + "off" => Ok(Off), + "on" => Ok(On), + _ => Err(()), + } + } +} +impl std::fmt::Display for CreatePaymentMethodConfigurationAlipayDisplayPreferencePreference { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreatePaymentMethodConfigurationAlipayDisplayPreferencePreference { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreatePaymentMethodConfigurationAlipayDisplayPreferencePreference { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Stripe users can accept [Apple Pay](/payments/apple-pay) in iOS applications in iOS 9 and later, and on the web in Safari starting with iOS 10 or macOS Sierra. +/// There are no additional fees to process Apple Pay payments, and the [pricing](/pricing) is the same as other card transactions. +/// Check this [page](https://stripe.com/docs/apple-pay) for more details. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreatePaymentMethodConfigurationApplePay { + /// Whether or not the payment method should be displayed. + #[serde(skip_serializing_if = "Option::is_none")] + pub display_preference: Option, +} +impl CreatePaymentMethodConfigurationApplePay { + pub fn new() -> Self { + Self::default() + } +} +/// Whether or not the payment method should be displayed. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreatePaymentMethodConfigurationApplePayDisplayPreference { + /// The account's preference for whether or not to display this payment method. + #[serde(skip_serializing_if = "Option::is_none")] + pub preference: Option, +} +impl CreatePaymentMethodConfigurationApplePayDisplayPreference { + pub fn new() -> Self { + Self::default() + } +} +/// The account's preference for whether or not to display this payment method. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreatePaymentMethodConfigurationApplePayDisplayPreferencePreference { + None, + Off, + On, +} +impl CreatePaymentMethodConfigurationApplePayDisplayPreferencePreference { + pub fn as_str(self) -> &'static str { + use CreatePaymentMethodConfigurationApplePayDisplayPreferencePreference::*; + match self { + None => "none", + Off => "off", + On => "on", + } + } +} + +impl std::str::FromStr for CreatePaymentMethodConfigurationApplePayDisplayPreferencePreference { + type Err = (); + fn from_str(s: &str) -> Result { + use CreatePaymentMethodConfigurationApplePayDisplayPreferencePreference::*; + match s { + "none" => Ok(None), + "off" => Ok(Off), + "on" => Ok(On), + _ => Err(()), + } + } +} +impl std::fmt::Display for CreatePaymentMethodConfigurationApplePayDisplayPreferencePreference { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreatePaymentMethodConfigurationApplePayDisplayPreferencePreference { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreatePaymentMethodConfigurationApplePayDisplayPreferencePreference { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Apple Pay Later, a payment method for customers to buy now and pay later, gives your customers a way to split purchases into four installments across six weeks. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreatePaymentMethodConfigurationApplePayLater { + /// Whether or not the payment method should be displayed. + #[serde(skip_serializing_if = "Option::is_none")] + pub display_preference: Option, +} +impl CreatePaymentMethodConfigurationApplePayLater { + pub fn new() -> Self { + Self::default() + } +} +/// Whether or not the payment method should be displayed. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreatePaymentMethodConfigurationApplePayLaterDisplayPreference { + /// The account's preference for whether or not to display this payment method. + #[serde(skip_serializing_if = "Option::is_none")] + pub preference: + Option, +} +impl CreatePaymentMethodConfigurationApplePayLaterDisplayPreference { + pub fn new() -> Self { + Self::default() + } +} +/// The account's preference for whether or not to display this payment method. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreatePaymentMethodConfigurationApplePayLaterDisplayPreferencePreference { + None, + Off, + On, +} +impl CreatePaymentMethodConfigurationApplePayLaterDisplayPreferencePreference { + pub fn as_str(self) -> &'static str { + use CreatePaymentMethodConfigurationApplePayLaterDisplayPreferencePreference::*; + match self { + None => "none", + Off => "off", + On => "on", + } + } +} + +impl std::str::FromStr + for CreatePaymentMethodConfigurationApplePayLaterDisplayPreferencePreference +{ + type Err = (); + fn from_str(s: &str) -> Result { + use CreatePaymentMethodConfigurationApplePayLaterDisplayPreferencePreference::*; + match s { + "none" => Ok(None), + "off" => Ok(Off), + "on" => Ok(On), + _ => Err(()), + } + } +} +impl std::fmt::Display + for CreatePaymentMethodConfigurationApplePayLaterDisplayPreferencePreference +{ + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreatePaymentMethodConfigurationApplePayLaterDisplayPreferencePreference { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreatePaymentMethodConfigurationApplePayLaterDisplayPreferencePreference { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Stripe users in Australia can accept Bulk Electronic Clearing System (BECS) direct debit payments from customers with an Australian bank account. +/// Check this [page](https://stripe.com/docs/payments/au-becs-debit) for more details. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreatePaymentMethodConfigurationAuBecsDebit { + /// Whether or not the payment method should be displayed. + #[serde(skip_serializing_if = "Option::is_none")] + pub display_preference: Option, +} +impl CreatePaymentMethodConfigurationAuBecsDebit { + pub fn new() -> Self { + Self::default() + } +} +/// Whether or not the payment method should be displayed. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreatePaymentMethodConfigurationAuBecsDebitDisplayPreference { + /// The account's preference for whether or not to display this payment method. + #[serde(skip_serializing_if = "Option::is_none")] + pub preference: Option, +} +impl CreatePaymentMethodConfigurationAuBecsDebitDisplayPreference { + pub fn new() -> Self { + Self::default() + } +} +/// The account's preference for whether or not to display this payment method. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreatePaymentMethodConfigurationAuBecsDebitDisplayPreferencePreference { + None, + Off, + On, +} +impl CreatePaymentMethodConfigurationAuBecsDebitDisplayPreferencePreference { + pub fn as_str(self) -> &'static str { + use CreatePaymentMethodConfigurationAuBecsDebitDisplayPreferencePreference::*; + match self { + None => "none", + Off => "off", + On => "on", + } + } +} + +impl std::str::FromStr for CreatePaymentMethodConfigurationAuBecsDebitDisplayPreferencePreference { + type Err = (); + fn from_str(s: &str) -> Result { + use CreatePaymentMethodConfigurationAuBecsDebitDisplayPreferencePreference::*; + match s { + "none" => Ok(None), + "off" => Ok(Off), + "on" => Ok(On), + _ => Err(()), + } + } +} +impl std::fmt::Display for CreatePaymentMethodConfigurationAuBecsDebitDisplayPreferencePreference { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreatePaymentMethodConfigurationAuBecsDebitDisplayPreferencePreference { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreatePaymentMethodConfigurationAuBecsDebitDisplayPreferencePreference { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Stripe users in the UK can accept Bacs Direct Debit payments from customers with a UK bank account, check this [page](https://stripe.com/docs/payments/payment-methods/bacs-debit) for more details. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreatePaymentMethodConfigurationBacsDebit { + /// Whether or not the payment method should be displayed. + #[serde(skip_serializing_if = "Option::is_none")] + pub display_preference: Option, +} +impl CreatePaymentMethodConfigurationBacsDebit { + pub fn new() -> Self { + Self::default() + } +} +/// Whether or not the payment method should be displayed. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreatePaymentMethodConfigurationBacsDebitDisplayPreference { + /// The account's preference for whether or not to display this payment method. + #[serde(skip_serializing_if = "Option::is_none")] + pub preference: Option, +} +impl CreatePaymentMethodConfigurationBacsDebitDisplayPreference { + pub fn new() -> Self { + Self::default() + } +} +/// The account's preference for whether or not to display this payment method. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreatePaymentMethodConfigurationBacsDebitDisplayPreferencePreference { + None, + Off, + On, +} +impl CreatePaymentMethodConfigurationBacsDebitDisplayPreferencePreference { + pub fn as_str(self) -> &'static str { + use CreatePaymentMethodConfigurationBacsDebitDisplayPreferencePreference::*; + match self { + None => "none", + Off => "off", + On => "on", + } + } +} + +impl std::str::FromStr for CreatePaymentMethodConfigurationBacsDebitDisplayPreferencePreference { + type Err = (); + fn from_str(s: &str) -> Result { + use CreatePaymentMethodConfigurationBacsDebitDisplayPreferencePreference::*; + match s { + "none" => Ok(None), + "off" => Ok(Off), + "on" => Ok(On), + _ => Err(()), + } + } +} +impl std::fmt::Display for CreatePaymentMethodConfigurationBacsDebitDisplayPreferencePreference { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreatePaymentMethodConfigurationBacsDebitDisplayPreferencePreference { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreatePaymentMethodConfigurationBacsDebitDisplayPreferencePreference { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Bancontact is the most popular online payment method in Belgium, with over 15 million cards in circulation. +/// [Customers](https://stripe.com/docs/api/customers) use a Bancontact card or mobile app linked to a Belgian bank account to make online payments that are secure, guaranteed, and confirmed immediately. +/// Check this [page](https://stripe.com/docs/payments/bancontact) for more details. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreatePaymentMethodConfigurationBancontact { + /// Whether or not the payment method should be displayed. + #[serde(skip_serializing_if = "Option::is_none")] + pub display_preference: Option, +} +impl CreatePaymentMethodConfigurationBancontact { + pub fn new() -> Self { + Self::default() + } +} +/// Whether or not the payment method should be displayed. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreatePaymentMethodConfigurationBancontactDisplayPreference { + /// The account's preference for whether or not to display this payment method. + #[serde(skip_serializing_if = "Option::is_none")] + pub preference: Option, +} +impl CreatePaymentMethodConfigurationBancontactDisplayPreference { + pub fn new() -> Self { + Self::default() + } +} +/// The account's preference for whether or not to display this payment method. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreatePaymentMethodConfigurationBancontactDisplayPreferencePreference { + None, + Off, + On, +} +impl CreatePaymentMethodConfigurationBancontactDisplayPreferencePreference { + pub fn as_str(self) -> &'static str { + use CreatePaymentMethodConfigurationBancontactDisplayPreferencePreference::*; + match self { + None => "none", + Off => "off", + On => "on", + } + } +} + +impl std::str::FromStr for CreatePaymentMethodConfigurationBancontactDisplayPreferencePreference { + type Err = (); + fn from_str(s: &str) -> Result { + use CreatePaymentMethodConfigurationBancontactDisplayPreferencePreference::*; + match s { + "none" => Ok(None), + "off" => Ok(Off), + "on" => Ok(On), + _ => Err(()), + } + } +} +impl std::fmt::Display for CreatePaymentMethodConfigurationBancontactDisplayPreferencePreference { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreatePaymentMethodConfigurationBancontactDisplayPreferencePreference { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreatePaymentMethodConfigurationBancontactDisplayPreferencePreference { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// BLIK is a [single use](https://stripe.com/docs/payments/payment-methods#usage) payment method that requires customers to authenticate their payments. +/// When customers want to pay online using BLIK, they request a six-digit code from their banking application and enter it into the payment collection form. +/// Check this [page](https://stripe.com/docs/payments/blik) for more details. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreatePaymentMethodConfigurationBlik { + /// Whether or not the payment method should be displayed. + #[serde(skip_serializing_if = "Option::is_none")] + pub display_preference: Option, +} +impl CreatePaymentMethodConfigurationBlik { + pub fn new() -> Self { + Self::default() + } +} +/// Whether or not the payment method should be displayed. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreatePaymentMethodConfigurationBlikDisplayPreference { + /// The account's preference for whether or not to display this payment method. + #[serde(skip_serializing_if = "Option::is_none")] + pub preference: Option, +} +impl CreatePaymentMethodConfigurationBlikDisplayPreference { + pub fn new() -> Self { + Self::default() + } +} +/// The account's preference for whether or not to display this payment method. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreatePaymentMethodConfigurationBlikDisplayPreferencePreference { + None, + Off, + On, +} +impl CreatePaymentMethodConfigurationBlikDisplayPreferencePreference { + pub fn as_str(self) -> &'static str { + use CreatePaymentMethodConfigurationBlikDisplayPreferencePreference::*; + match self { + None => "none", + Off => "off", + On => "on", + } + } +} + +impl std::str::FromStr for CreatePaymentMethodConfigurationBlikDisplayPreferencePreference { + type Err = (); + fn from_str(s: &str) -> Result { + use CreatePaymentMethodConfigurationBlikDisplayPreferencePreference::*; + match s { + "none" => Ok(None), + "off" => Ok(Off), + "on" => Ok(On), + _ => Err(()), + } + } +} +impl std::fmt::Display for CreatePaymentMethodConfigurationBlikDisplayPreferencePreference { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreatePaymentMethodConfigurationBlikDisplayPreferencePreference { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreatePaymentMethodConfigurationBlikDisplayPreferencePreference { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Boleto is an official (regulated by the Central Bank of Brazil) payment method in Brazil. +/// Check this [page](https://stripe.com/docs/payments/boleto) for more details. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreatePaymentMethodConfigurationBoleto { + /// Whether or not the payment method should be displayed. + #[serde(skip_serializing_if = "Option::is_none")] + pub display_preference: Option, +} +impl CreatePaymentMethodConfigurationBoleto { + pub fn new() -> Self { + Self::default() + } +} +/// Whether or not the payment method should be displayed. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreatePaymentMethodConfigurationBoletoDisplayPreference { + /// The account's preference for whether or not to display this payment method. + #[serde(skip_serializing_if = "Option::is_none")] + pub preference: Option, +} +impl CreatePaymentMethodConfigurationBoletoDisplayPreference { + pub fn new() -> Self { + Self::default() + } +} +/// The account's preference for whether or not to display this payment method. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreatePaymentMethodConfigurationBoletoDisplayPreferencePreference { + None, + Off, + On, +} +impl CreatePaymentMethodConfigurationBoletoDisplayPreferencePreference { + pub fn as_str(self) -> &'static str { + use CreatePaymentMethodConfigurationBoletoDisplayPreferencePreference::*; + match self { + None => "none", + Off => "off", + On => "on", + } + } +} + +impl std::str::FromStr for CreatePaymentMethodConfigurationBoletoDisplayPreferencePreference { + type Err = (); + fn from_str(s: &str) -> Result { + use CreatePaymentMethodConfigurationBoletoDisplayPreferencePreference::*; + match s { + "none" => Ok(None), + "off" => Ok(Off), + "on" => Ok(On), + _ => Err(()), + } + } +} +impl std::fmt::Display for CreatePaymentMethodConfigurationBoletoDisplayPreferencePreference { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreatePaymentMethodConfigurationBoletoDisplayPreferencePreference { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreatePaymentMethodConfigurationBoletoDisplayPreferencePreference { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Cards are a popular way for consumers and businesses to pay online or in person. +/// Stripe supports global and local card networks. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreatePaymentMethodConfigurationCard { + /// Whether or not the payment method should be displayed. + #[serde(skip_serializing_if = "Option::is_none")] + pub display_preference: Option, +} +impl CreatePaymentMethodConfigurationCard { + pub fn new() -> Self { + Self::default() + } +} +/// Whether or not the payment method should be displayed. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreatePaymentMethodConfigurationCardDisplayPreference { + /// The account's preference for whether or not to display this payment method. + #[serde(skip_serializing_if = "Option::is_none")] + pub preference: Option, +} +impl CreatePaymentMethodConfigurationCardDisplayPreference { + pub fn new() -> Self { + Self::default() + } +} +/// The account's preference for whether or not to display this payment method. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreatePaymentMethodConfigurationCardDisplayPreferencePreference { + None, + Off, + On, +} +impl CreatePaymentMethodConfigurationCardDisplayPreferencePreference { + pub fn as_str(self) -> &'static str { + use CreatePaymentMethodConfigurationCardDisplayPreferencePreference::*; + match self { + None => "none", + Off => "off", + On => "on", + } + } +} + +impl std::str::FromStr for CreatePaymentMethodConfigurationCardDisplayPreferencePreference { + type Err = (); + fn from_str(s: &str) -> Result { + use CreatePaymentMethodConfigurationCardDisplayPreferencePreference::*; + match s { + "none" => Ok(None), + "off" => Ok(Off), + "on" => Ok(On), + _ => Err(()), + } + } +} +impl std::fmt::Display for CreatePaymentMethodConfigurationCardDisplayPreferencePreference { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreatePaymentMethodConfigurationCardDisplayPreferencePreference { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreatePaymentMethodConfigurationCardDisplayPreferencePreference { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Cartes Bancaires is France's local card network. +/// More than 95% of these cards are co-branded with either Visa or Mastercard, meaning you can process these cards over either Cartes Bancaires or the Visa or Mastercard networks. +/// Check this [page](https://stripe.com/docs/payments/cartes-bancaires) for more details. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreatePaymentMethodConfigurationCartesBancaires { + /// Whether or not the payment method should be displayed. + #[serde(skip_serializing_if = "Option::is_none")] + pub display_preference: + Option, +} +impl CreatePaymentMethodConfigurationCartesBancaires { + pub fn new() -> Self { + Self::default() + } +} +/// Whether or not the payment method should be displayed. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreatePaymentMethodConfigurationCartesBancairesDisplayPreference { + /// The account's preference for whether or not to display this payment method. + #[serde(skip_serializing_if = "Option::is_none")] + pub preference: + Option, +} +impl CreatePaymentMethodConfigurationCartesBancairesDisplayPreference { + pub fn new() -> Self { + Self::default() + } +} +/// The account's preference for whether or not to display this payment method. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreatePaymentMethodConfigurationCartesBancairesDisplayPreferencePreference { + None, + Off, + On, +} +impl CreatePaymentMethodConfigurationCartesBancairesDisplayPreferencePreference { + pub fn as_str(self) -> &'static str { + use CreatePaymentMethodConfigurationCartesBancairesDisplayPreferencePreference::*; + match self { + None => "none", + Off => "off", + On => "on", + } + } +} + +impl std::str::FromStr + for CreatePaymentMethodConfigurationCartesBancairesDisplayPreferencePreference +{ + type Err = (); + fn from_str(s: &str) -> Result { + use CreatePaymentMethodConfigurationCartesBancairesDisplayPreferencePreference::*; + match s { + "none" => Ok(None), + "off" => Ok(Off), + "on" => Ok(On), + _ => Err(()), + } + } +} +impl std::fmt::Display + for CreatePaymentMethodConfigurationCartesBancairesDisplayPreferencePreference +{ + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug + for CreatePaymentMethodConfigurationCartesBancairesDisplayPreferencePreference +{ + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize + for CreatePaymentMethodConfigurationCartesBancairesDisplayPreferencePreference +{ + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Cash App is a popular consumer app in the US that allows customers to bank, invest, send, and receive money using their digital wallet. +/// Check this [page](https://stripe.com/docs/payments/cash-app-pay) for more details. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreatePaymentMethodConfigurationCashapp { + /// Whether or not the payment method should be displayed. + #[serde(skip_serializing_if = "Option::is_none")] + pub display_preference: Option, +} +impl CreatePaymentMethodConfigurationCashapp { + pub fn new() -> Self { + Self::default() + } +} +/// Whether or not the payment method should be displayed. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreatePaymentMethodConfigurationCashappDisplayPreference { + /// The account's preference for whether or not to display this payment method. + #[serde(skip_serializing_if = "Option::is_none")] + pub preference: Option, +} +impl CreatePaymentMethodConfigurationCashappDisplayPreference { + pub fn new() -> Self { + Self::default() + } +} +/// The account's preference for whether or not to display this payment method. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreatePaymentMethodConfigurationCashappDisplayPreferencePreference { + None, + Off, + On, +} +impl CreatePaymentMethodConfigurationCashappDisplayPreferencePreference { + pub fn as_str(self) -> &'static str { + use CreatePaymentMethodConfigurationCashappDisplayPreferencePreference::*; + match self { + None => "none", + Off => "off", + On => "on", + } + } +} + +impl std::str::FromStr for CreatePaymentMethodConfigurationCashappDisplayPreferencePreference { + type Err = (); + fn from_str(s: &str) -> Result { + use CreatePaymentMethodConfigurationCashappDisplayPreferencePreference::*; + match s { + "none" => Ok(None), + "off" => Ok(Off), + "on" => Ok(On), + _ => Err(()), + } + } +} +impl std::fmt::Display for CreatePaymentMethodConfigurationCashappDisplayPreferencePreference { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreatePaymentMethodConfigurationCashappDisplayPreferencePreference { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreatePaymentMethodConfigurationCashappDisplayPreferencePreference { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Uses a customer’s [cash balance](https://stripe.com/docs/payments/customer-balance) for the payment. +/// The cash balance can be funded via a bank transfer. +/// Check this [page](https://stripe.com/docs/payments/bank-transfers) for more details. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreatePaymentMethodConfigurationCustomerBalance { + /// Whether or not the payment method should be displayed. + #[serde(skip_serializing_if = "Option::is_none")] + pub display_preference: + Option, +} +impl CreatePaymentMethodConfigurationCustomerBalance { + pub fn new() -> Self { + Self::default() + } +} +/// Whether or not the payment method should be displayed. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreatePaymentMethodConfigurationCustomerBalanceDisplayPreference { + /// The account's preference for whether or not to display this payment method. + #[serde(skip_serializing_if = "Option::is_none")] + pub preference: + Option, +} +impl CreatePaymentMethodConfigurationCustomerBalanceDisplayPreference { + pub fn new() -> Self { + Self::default() + } +} +/// The account's preference for whether or not to display this payment method. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreatePaymentMethodConfigurationCustomerBalanceDisplayPreferencePreference { + None, + Off, + On, +} +impl CreatePaymentMethodConfigurationCustomerBalanceDisplayPreferencePreference { + pub fn as_str(self) -> &'static str { + use CreatePaymentMethodConfigurationCustomerBalanceDisplayPreferencePreference::*; + match self { + None => "none", + Off => "off", + On => "on", + } + } +} + +impl std::str::FromStr + for CreatePaymentMethodConfigurationCustomerBalanceDisplayPreferencePreference +{ + type Err = (); + fn from_str(s: &str) -> Result { + use CreatePaymentMethodConfigurationCustomerBalanceDisplayPreferencePreference::*; + match s { + "none" => Ok(None), + "off" => Ok(Off), + "on" => Ok(On), + _ => Err(()), + } + } +} +impl std::fmt::Display + for CreatePaymentMethodConfigurationCustomerBalanceDisplayPreferencePreference +{ + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug + for CreatePaymentMethodConfigurationCustomerBalanceDisplayPreferencePreference +{ + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize + for CreatePaymentMethodConfigurationCustomerBalanceDisplayPreferencePreference +{ + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// EPS is an Austria-based payment method that allows customers to complete transactions online using their bank credentials. +/// EPS is supported by all Austrian banks and is accepted by over 80% of Austrian online retailers. +/// Check this [page](https://stripe.com/docs/payments/eps) for more details. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreatePaymentMethodConfigurationEps { + /// Whether or not the payment method should be displayed. + #[serde(skip_serializing_if = "Option::is_none")] + pub display_preference: Option, +} +impl CreatePaymentMethodConfigurationEps { + pub fn new() -> Self { + Self::default() + } +} +/// Whether or not the payment method should be displayed. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreatePaymentMethodConfigurationEpsDisplayPreference { + /// The account's preference for whether or not to display this payment method. + #[serde(skip_serializing_if = "Option::is_none")] + pub preference: Option, +} +impl CreatePaymentMethodConfigurationEpsDisplayPreference { + pub fn new() -> Self { + Self::default() + } +} +/// The account's preference for whether or not to display this payment method. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreatePaymentMethodConfigurationEpsDisplayPreferencePreference { + None, + Off, + On, +} +impl CreatePaymentMethodConfigurationEpsDisplayPreferencePreference { + pub fn as_str(self) -> &'static str { + use CreatePaymentMethodConfigurationEpsDisplayPreferencePreference::*; + match self { + None => "none", + Off => "off", + On => "on", + } + } +} + +impl std::str::FromStr for CreatePaymentMethodConfigurationEpsDisplayPreferencePreference { + type Err = (); + fn from_str(s: &str) -> Result { + use CreatePaymentMethodConfigurationEpsDisplayPreferencePreference::*; + match s { + "none" => Ok(None), + "off" => Ok(Off), + "on" => Ok(On), + _ => Err(()), + } + } +} +impl std::fmt::Display for CreatePaymentMethodConfigurationEpsDisplayPreferencePreference { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreatePaymentMethodConfigurationEpsDisplayPreferencePreference { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreatePaymentMethodConfigurationEpsDisplayPreferencePreference { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Financial Process Exchange (FPX) is a Malaysia-based payment method that allows customers to complete transactions online using their bank credentials. +/// Bank Negara Malaysia (BNM), the Central Bank of Malaysia, and eleven other major Malaysian financial institutions are members of the PayNet Group, which owns and operates FPX. +/// It is one of the most popular online payment methods in Malaysia, with nearly 90 million transactions in 2018 according to BNM. +/// Check this [page](https://stripe.com/docs/payments/fpx) for more details. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreatePaymentMethodConfigurationFpx { + /// Whether or not the payment method should be displayed. + #[serde(skip_serializing_if = "Option::is_none")] + pub display_preference: Option, +} +impl CreatePaymentMethodConfigurationFpx { + pub fn new() -> Self { + Self::default() + } +} +/// Whether or not the payment method should be displayed. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreatePaymentMethodConfigurationFpxDisplayPreference { + /// The account's preference for whether or not to display this payment method. + #[serde(skip_serializing_if = "Option::is_none")] + pub preference: Option, +} +impl CreatePaymentMethodConfigurationFpxDisplayPreference { + pub fn new() -> Self { + Self::default() + } +} +/// The account's preference for whether or not to display this payment method. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreatePaymentMethodConfigurationFpxDisplayPreferencePreference { + None, + Off, + On, +} +impl CreatePaymentMethodConfigurationFpxDisplayPreferencePreference { + pub fn as_str(self) -> &'static str { + use CreatePaymentMethodConfigurationFpxDisplayPreferencePreference::*; + match self { + None => "none", + Off => "off", + On => "on", + } + } +} + +impl std::str::FromStr for CreatePaymentMethodConfigurationFpxDisplayPreferencePreference { + type Err = (); + fn from_str(s: &str) -> Result { + use CreatePaymentMethodConfigurationFpxDisplayPreferencePreference::*; + match s { + "none" => Ok(None), + "off" => Ok(Off), + "on" => Ok(On), + _ => Err(()), + } + } +} +impl std::fmt::Display for CreatePaymentMethodConfigurationFpxDisplayPreferencePreference { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreatePaymentMethodConfigurationFpxDisplayPreferencePreference { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreatePaymentMethodConfigurationFpxDisplayPreferencePreference { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// giropay is a German payment method based on online banking, introduced in 2006. +/// It allows customers to complete transactions online using their online banking environment, with funds debited from their bank account. +/// Depending on their bank, customers confirm payments on giropay using a second factor of authentication or a PIN. +/// giropay accounts for 10% of online checkouts in Germany. +/// Check this [page](https://stripe.com/docs/payments/giropay) for more details. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreatePaymentMethodConfigurationGiropay { + /// Whether or not the payment method should be displayed. + #[serde(skip_serializing_if = "Option::is_none")] + pub display_preference: Option, +} +impl CreatePaymentMethodConfigurationGiropay { + pub fn new() -> Self { + Self::default() + } +} +/// Whether or not the payment method should be displayed. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreatePaymentMethodConfigurationGiropayDisplayPreference { + /// The account's preference for whether or not to display this payment method. + #[serde(skip_serializing_if = "Option::is_none")] + pub preference: Option, +} +impl CreatePaymentMethodConfigurationGiropayDisplayPreference { + pub fn new() -> Self { + Self::default() + } +} +/// The account's preference for whether or not to display this payment method. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreatePaymentMethodConfigurationGiropayDisplayPreferencePreference { + None, + Off, + On, +} +impl CreatePaymentMethodConfigurationGiropayDisplayPreferencePreference { + pub fn as_str(self) -> &'static str { + use CreatePaymentMethodConfigurationGiropayDisplayPreferencePreference::*; + match self { + None => "none", + Off => "off", + On => "on", + } + } +} + +impl std::str::FromStr for CreatePaymentMethodConfigurationGiropayDisplayPreferencePreference { + type Err = (); + fn from_str(s: &str) -> Result { + use CreatePaymentMethodConfigurationGiropayDisplayPreferencePreference::*; + match s { + "none" => Ok(None), + "off" => Ok(Off), + "on" => Ok(On), + _ => Err(()), + } + } +} +impl std::fmt::Display for CreatePaymentMethodConfigurationGiropayDisplayPreferencePreference { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreatePaymentMethodConfigurationGiropayDisplayPreferencePreference { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreatePaymentMethodConfigurationGiropayDisplayPreferencePreference { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Google Pay allows customers to make payments in your app or website using any credit or debit card saved to their Google Account, including those from Google Play, YouTube, Chrome, or an Android device. +/// Use the Google Pay API to request any credit or debit card stored in your customer's Google account. +/// Check this [page](https://stripe.com/docs/google-pay) for more details. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreatePaymentMethodConfigurationGooglePay { + /// Whether or not the payment method should be displayed. + #[serde(skip_serializing_if = "Option::is_none")] + pub display_preference: Option, +} +impl CreatePaymentMethodConfigurationGooglePay { + pub fn new() -> Self { + Self::default() + } +} +/// Whether or not the payment method should be displayed. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreatePaymentMethodConfigurationGooglePayDisplayPreference { + /// The account's preference for whether or not to display this payment method. + #[serde(skip_serializing_if = "Option::is_none")] + pub preference: Option, +} +impl CreatePaymentMethodConfigurationGooglePayDisplayPreference { + pub fn new() -> Self { + Self::default() + } +} +/// The account's preference for whether or not to display this payment method. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreatePaymentMethodConfigurationGooglePayDisplayPreferencePreference { + None, + Off, + On, +} +impl CreatePaymentMethodConfigurationGooglePayDisplayPreferencePreference { + pub fn as_str(self) -> &'static str { + use CreatePaymentMethodConfigurationGooglePayDisplayPreferencePreference::*; + match self { + None => "none", + Off => "off", + On => "on", + } + } +} + +impl std::str::FromStr for CreatePaymentMethodConfigurationGooglePayDisplayPreferencePreference { + type Err = (); + fn from_str(s: &str) -> Result { + use CreatePaymentMethodConfigurationGooglePayDisplayPreferencePreference::*; + match s { + "none" => Ok(None), + "off" => Ok(Off), + "on" => Ok(On), + _ => Err(()), + } + } +} +impl std::fmt::Display for CreatePaymentMethodConfigurationGooglePayDisplayPreferencePreference { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreatePaymentMethodConfigurationGooglePayDisplayPreferencePreference { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreatePaymentMethodConfigurationGooglePayDisplayPreferencePreference { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// GrabPay is a payment method developed by [Grab](https://www.grab.com/sg/consumer/finance/pay/). +/// GrabPay is a digital wallet - customers maintain a balance in their wallets that they pay out with. +/// Check this [page](https://stripe.com/docs/payments/grabpay) for more details. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreatePaymentMethodConfigurationGrabpay { + /// Whether or not the payment method should be displayed. + #[serde(skip_serializing_if = "Option::is_none")] + pub display_preference: Option, +} +impl CreatePaymentMethodConfigurationGrabpay { + pub fn new() -> Self { + Self::default() + } +} +/// Whether or not the payment method should be displayed. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreatePaymentMethodConfigurationGrabpayDisplayPreference { + /// The account's preference for whether or not to display this payment method. + #[serde(skip_serializing_if = "Option::is_none")] + pub preference: Option, +} +impl CreatePaymentMethodConfigurationGrabpayDisplayPreference { + pub fn new() -> Self { + Self::default() + } +} +/// The account's preference for whether or not to display this payment method. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreatePaymentMethodConfigurationGrabpayDisplayPreferencePreference { + None, + Off, + On, +} +impl CreatePaymentMethodConfigurationGrabpayDisplayPreferencePreference { + pub fn as_str(self) -> &'static str { + use CreatePaymentMethodConfigurationGrabpayDisplayPreferencePreference::*; + match self { + None => "none", + Off => "off", + On => "on", + } + } +} + +impl std::str::FromStr for CreatePaymentMethodConfigurationGrabpayDisplayPreferencePreference { + type Err = (); + fn from_str(s: &str) -> Result { + use CreatePaymentMethodConfigurationGrabpayDisplayPreferencePreference::*; + match s { + "none" => Ok(None), + "off" => Ok(Off), + "on" => Ok(On), + _ => Err(()), + } + } +} +impl std::fmt::Display for CreatePaymentMethodConfigurationGrabpayDisplayPreferencePreference { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreatePaymentMethodConfigurationGrabpayDisplayPreferencePreference { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreatePaymentMethodConfigurationGrabpayDisplayPreferencePreference { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// iDEAL is a Netherlands-based payment method that allows customers to complete transactions online using their bank credentials. +/// All major Dutch banks are members of Currence, the scheme that operates iDEAL, making it the most popular online payment method in the Netherlands with a share of online transactions close to 55%. +/// Check this [page](https://stripe.com/docs/payments/ideal) for more details. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreatePaymentMethodConfigurationIdeal { + /// Whether or not the payment method should be displayed. + #[serde(skip_serializing_if = "Option::is_none")] + pub display_preference: Option, +} +impl CreatePaymentMethodConfigurationIdeal { + pub fn new() -> Self { + Self::default() + } +} +/// Whether or not the payment method should be displayed. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreatePaymentMethodConfigurationIdealDisplayPreference { + /// The account's preference for whether or not to display this payment method. + #[serde(skip_serializing_if = "Option::is_none")] + pub preference: Option, +} +impl CreatePaymentMethodConfigurationIdealDisplayPreference { + pub fn new() -> Self { + Self::default() + } +} +/// The account's preference for whether or not to display this payment method. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreatePaymentMethodConfigurationIdealDisplayPreferencePreference { + None, + Off, + On, +} +impl CreatePaymentMethodConfigurationIdealDisplayPreferencePreference { + pub fn as_str(self) -> &'static str { + use CreatePaymentMethodConfigurationIdealDisplayPreferencePreference::*; + match self { + None => "none", + Off => "off", + On => "on", + } + } +} + +impl std::str::FromStr for CreatePaymentMethodConfigurationIdealDisplayPreferencePreference { + type Err = (); + fn from_str(s: &str) -> Result { + use CreatePaymentMethodConfigurationIdealDisplayPreferencePreference::*; + match s { + "none" => Ok(None), + "off" => Ok(Off), + "on" => Ok(On), + _ => Err(()), + } + } +} +impl std::fmt::Display for CreatePaymentMethodConfigurationIdealDisplayPreferencePreference { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreatePaymentMethodConfigurationIdealDisplayPreferencePreference { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreatePaymentMethodConfigurationIdealDisplayPreferencePreference { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// JCB is a credit card company based in Japan. +/// JCB is currently available in Japan to businesses approved by JCB, and available to all businesses in Australia, Canada, Hong Kong, Japan, New Zealand, Singapore, Switzerland, United Kingdom, United States, and all countries in the European Economic Area except Iceland. +/// Check this [page](https://support.stripe.com/questions/accepting-japan-credit-bureau-%28jcb%29-payments) for more details. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreatePaymentMethodConfigurationJcb { + /// Whether or not the payment method should be displayed. + #[serde(skip_serializing_if = "Option::is_none")] + pub display_preference: Option, +} +impl CreatePaymentMethodConfigurationJcb { + pub fn new() -> Self { + Self::default() + } +} +/// Whether or not the payment method should be displayed. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreatePaymentMethodConfigurationJcbDisplayPreference { + /// The account's preference for whether or not to display this payment method. + #[serde(skip_serializing_if = "Option::is_none")] + pub preference: Option, +} +impl CreatePaymentMethodConfigurationJcbDisplayPreference { + pub fn new() -> Self { + Self::default() + } +} +/// The account's preference for whether or not to display this payment method. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreatePaymentMethodConfigurationJcbDisplayPreferencePreference { + None, + Off, + On, +} +impl CreatePaymentMethodConfigurationJcbDisplayPreferencePreference { + pub fn as_str(self) -> &'static str { + use CreatePaymentMethodConfigurationJcbDisplayPreferencePreference::*; + match self { + None => "none", + Off => "off", + On => "on", + } + } +} + +impl std::str::FromStr for CreatePaymentMethodConfigurationJcbDisplayPreferencePreference { + type Err = (); + fn from_str(s: &str) -> Result { + use CreatePaymentMethodConfigurationJcbDisplayPreferencePreference::*; + match s { + "none" => Ok(None), + "off" => Ok(Off), + "on" => Ok(On), + _ => Err(()), + } + } +} +impl std::fmt::Display for CreatePaymentMethodConfigurationJcbDisplayPreferencePreference { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreatePaymentMethodConfigurationJcbDisplayPreferencePreference { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreatePaymentMethodConfigurationJcbDisplayPreferencePreference { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Klarna gives customers a range of [payment options](https://stripe.com/docs/payments/klarna#payment-options) during checkout. +/// Available payment options vary depending on the customer's billing address and the transaction amount. +/// These payment options make it convenient for customers to purchase items in all price ranges. +/// Check this [page](https://stripe.com/docs/payments/klarna) for more details. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreatePaymentMethodConfigurationKlarna { + /// Whether or not the payment method should be displayed. + #[serde(skip_serializing_if = "Option::is_none")] + pub display_preference: Option, +} +impl CreatePaymentMethodConfigurationKlarna { + pub fn new() -> Self { + Self::default() + } +} +/// Whether or not the payment method should be displayed. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreatePaymentMethodConfigurationKlarnaDisplayPreference { + /// The account's preference for whether or not to display this payment method. + #[serde(skip_serializing_if = "Option::is_none")] + pub preference: Option, +} +impl CreatePaymentMethodConfigurationKlarnaDisplayPreference { + pub fn new() -> Self { + Self::default() + } +} +/// The account's preference for whether or not to display this payment method. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreatePaymentMethodConfigurationKlarnaDisplayPreferencePreference { + None, + Off, + On, +} +impl CreatePaymentMethodConfigurationKlarnaDisplayPreferencePreference { + pub fn as_str(self) -> &'static str { + use CreatePaymentMethodConfigurationKlarnaDisplayPreferencePreference::*; + match self { + None => "none", + Off => "off", + On => "on", + } + } +} + +impl std::str::FromStr for CreatePaymentMethodConfigurationKlarnaDisplayPreferencePreference { + type Err = (); + fn from_str(s: &str) -> Result { + use CreatePaymentMethodConfigurationKlarnaDisplayPreferencePreference::*; + match s { + "none" => Ok(None), + "off" => Ok(Off), + "on" => Ok(On), + _ => Err(()), + } + } +} +impl std::fmt::Display for CreatePaymentMethodConfigurationKlarnaDisplayPreferencePreference { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreatePaymentMethodConfigurationKlarnaDisplayPreferencePreference { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreatePaymentMethodConfigurationKlarnaDisplayPreferencePreference { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Konbini allows customers in Japan to pay for bills and online purchases at convenience stores with cash. +/// Check this [page](https://stripe.com/docs/payments/konbini) for more details. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreatePaymentMethodConfigurationKonbini { + /// Whether or not the payment method should be displayed. + #[serde(skip_serializing_if = "Option::is_none")] + pub display_preference: Option, +} +impl CreatePaymentMethodConfigurationKonbini { + pub fn new() -> Self { + Self::default() + } +} +/// Whether or not the payment method should be displayed. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreatePaymentMethodConfigurationKonbiniDisplayPreference { + /// The account's preference for whether or not to display this payment method. + #[serde(skip_serializing_if = "Option::is_none")] + pub preference: Option, +} +impl CreatePaymentMethodConfigurationKonbiniDisplayPreference { + pub fn new() -> Self { + Self::default() + } +} +/// The account's preference for whether or not to display this payment method. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreatePaymentMethodConfigurationKonbiniDisplayPreferencePreference { + None, + Off, + On, +} +impl CreatePaymentMethodConfigurationKonbiniDisplayPreferencePreference { + pub fn as_str(self) -> &'static str { + use CreatePaymentMethodConfigurationKonbiniDisplayPreferencePreference::*; + match self { + None => "none", + Off => "off", + On => "on", + } + } +} + +impl std::str::FromStr for CreatePaymentMethodConfigurationKonbiniDisplayPreferencePreference { + type Err = (); + fn from_str(s: &str) -> Result { + use CreatePaymentMethodConfigurationKonbiniDisplayPreferencePreference::*; + match s { + "none" => Ok(None), + "off" => Ok(Off), + "on" => Ok(On), + _ => Err(()), + } + } +} +impl std::fmt::Display for CreatePaymentMethodConfigurationKonbiniDisplayPreferencePreference { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreatePaymentMethodConfigurationKonbiniDisplayPreferencePreference { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreatePaymentMethodConfigurationKonbiniDisplayPreferencePreference { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// [Link](https://stripe.com/docs/payments/link) is a payment method network. +/// With Link, users save their payment details once, then reuse that information to pay with one click for any business on the network. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreatePaymentMethodConfigurationLink { + /// Whether or not the payment method should be displayed. + #[serde(skip_serializing_if = "Option::is_none")] + pub display_preference: Option, +} +impl CreatePaymentMethodConfigurationLink { + pub fn new() -> Self { + Self::default() + } +} +/// Whether or not the payment method should be displayed. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreatePaymentMethodConfigurationLinkDisplayPreference { + /// The account's preference for whether or not to display this payment method. + #[serde(skip_serializing_if = "Option::is_none")] + pub preference: Option, +} +impl CreatePaymentMethodConfigurationLinkDisplayPreference { + pub fn new() -> Self { + Self::default() + } +} +/// The account's preference for whether or not to display this payment method. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreatePaymentMethodConfigurationLinkDisplayPreferencePreference { + None, + Off, + On, +} +impl CreatePaymentMethodConfigurationLinkDisplayPreferencePreference { + pub fn as_str(self) -> &'static str { + use CreatePaymentMethodConfigurationLinkDisplayPreferencePreference::*; + match self { + None => "none", + Off => "off", + On => "on", + } + } +} + +impl std::str::FromStr for CreatePaymentMethodConfigurationLinkDisplayPreferencePreference { + type Err = (); + fn from_str(s: &str) -> Result { + use CreatePaymentMethodConfigurationLinkDisplayPreferencePreference::*; + match s { + "none" => Ok(None), + "off" => Ok(Off), + "on" => Ok(On), + _ => Err(()), + } + } +} +impl std::fmt::Display for CreatePaymentMethodConfigurationLinkDisplayPreferencePreference { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreatePaymentMethodConfigurationLinkDisplayPreferencePreference { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreatePaymentMethodConfigurationLinkDisplayPreferencePreference { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// OXXO is a Mexican chain of convenience stores with thousands of locations across Latin America and represents nearly 20% of online transactions in Mexico. +/// OXXO allows customers to pay bills and online purchases in-store with cash. +/// Check this [page](https://stripe.com/docs/payments/oxxo) for more details. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreatePaymentMethodConfigurationOxxo { + /// Whether or not the payment method should be displayed. + #[serde(skip_serializing_if = "Option::is_none")] + pub display_preference: Option, +} +impl CreatePaymentMethodConfigurationOxxo { + pub fn new() -> Self { + Self::default() + } +} +/// Whether or not the payment method should be displayed. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreatePaymentMethodConfigurationOxxoDisplayPreference { + /// The account's preference for whether or not to display this payment method. + #[serde(skip_serializing_if = "Option::is_none")] + pub preference: Option, +} +impl CreatePaymentMethodConfigurationOxxoDisplayPreference { + pub fn new() -> Self { + Self::default() + } +} +/// The account's preference for whether or not to display this payment method. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreatePaymentMethodConfigurationOxxoDisplayPreferencePreference { + None, + Off, + On, +} +impl CreatePaymentMethodConfigurationOxxoDisplayPreferencePreference { + pub fn as_str(self) -> &'static str { + use CreatePaymentMethodConfigurationOxxoDisplayPreferencePreference::*; + match self { + None => "none", + Off => "off", + On => "on", + } + } +} + +impl std::str::FromStr for CreatePaymentMethodConfigurationOxxoDisplayPreferencePreference { + type Err = (); + fn from_str(s: &str) -> Result { + use CreatePaymentMethodConfigurationOxxoDisplayPreferencePreference::*; + match s { + "none" => Ok(None), + "off" => Ok(Off), + "on" => Ok(On), + _ => Err(()), + } + } +} +impl std::fmt::Display for CreatePaymentMethodConfigurationOxxoDisplayPreferencePreference { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreatePaymentMethodConfigurationOxxoDisplayPreferencePreference { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreatePaymentMethodConfigurationOxxoDisplayPreferencePreference { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Przelewy24 is a Poland-based payment method aggregator that allows customers to complete transactions online using bank transfers and other methods. +/// Bank transfers account for 30% of online payments in Poland and Przelewy24 provides a way for customers to pay with over 165 banks. +/// Check this [page](https://stripe.com/docs/payments/p24) for more details. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreatePaymentMethodConfigurationP24 { + /// Whether or not the payment method should be displayed. + #[serde(skip_serializing_if = "Option::is_none")] + pub display_preference: Option, +} +impl CreatePaymentMethodConfigurationP24 { + pub fn new() -> Self { + Self::default() + } +} +/// Whether or not the payment method should be displayed. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreatePaymentMethodConfigurationP24DisplayPreference { + /// The account's preference for whether or not to display this payment method. + #[serde(skip_serializing_if = "Option::is_none")] + pub preference: Option, +} +impl CreatePaymentMethodConfigurationP24DisplayPreference { + pub fn new() -> Self { + Self::default() + } +} +/// The account's preference for whether or not to display this payment method. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreatePaymentMethodConfigurationP24DisplayPreferencePreference { + None, + Off, + On, +} +impl CreatePaymentMethodConfigurationP24DisplayPreferencePreference { + pub fn as_str(self) -> &'static str { + use CreatePaymentMethodConfigurationP24DisplayPreferencePreference::*; + match self { + None => "none", + Off => "off", + On => "on", + } + } +} + +impl std::str::FromStr for CreatePaymentMethodConfigurationP24DisplayPreferencePreference { + type Err = (); + fn from_str(s: &str) -> Result { + use CreatePaymentMethodConfigurationP24DisplayPreferencePreference::*; + match s { + "none" => Ok(None), + "off" => Ok(Off), + "on" => Ok(On), + _ => Err(()), + } + } +} +impl std::fmt::Display for CreatePaymentMethodConfigurationP24DisplayPreferencePreference { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreatePaymentMethodConfigurationP24DisplayPreferencePreference { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreatePaymentMethodConfigurationP24DisplayPreferencePreference { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// PayNow is a Singapore-based payment method that allows customers to make a payment using their preferred app from participating banks and participating non-bank financial institutions. +/// Check this [page](https://stripe.com/docs/payments/paynow) for more details. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreatePaymentMethodConfigurationPaynow { + /// Whether or not the payment method should be displayed. + #[serde(skip_serializing_if = "Option::is_none")] + pub display_preference: Option, +} +impl CreatePaymentMethodConfigurationPaynow { + pub fn new() -> Self { + Self::default() + } +} +/// Whether or not the payment method should be displayed. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreatePaymentMethodConfigurationPaynowDisplayPreference { + /// The account's preference for whether or not to display this payment method. + #[serde(skip_serializing_if = "Option::is_none")] + pub preference: Option, +} +impl CreatePaymentMethodConfigurationPaynowDisplayPreference { + pub fn new() -> Self { + Self::default() + } +} +/// The account's preference for whether or not to display this payment method. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreatePaymentMethodConfigurationPaynowDisplayPreferencePreference { + None, + Off, + On, +} +impl CreatePaymentMethodConfigurationPaynowDisplayPreferencePreference { + pub fn as_str(self) -> &'static str { + use CreatePaymentMethodConfigurationPaynowDisplayPreferencePreference::*; + match self { + None => "none", + Off => "off", + On => "on", + } + } +} + +impl std::str::FromStr for CreatePaymentMethodConfigurationPaynowDisplayPreferencePreference { + type Err = (); + fn from_str(s: &str) -> Result { + use CreatePaymentMethodConfigurationPaynowDisplayPreferencePreference::*; + match s { + "none" => Ok(None), + "off" => Ok(Off), + "on" => Ok(On), + _ => Err(()), + } + } +} +impl std::fmt::Display for CreatePaymentMethodConfigurationPaynowDisplayPreferencePreference { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreatePaymentMethodConfigurationPaynowDisplayPreferencePreference { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreatePaymentMethodConfigurationPaynowDisplayPreferencePreference { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// PayPal, a digital wallet popular with customers in Europe, allows your customers worldwide to pay using their PayPal account. +/// Check this [page](https://stripe.com/docs/payments/paypal) for more details. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreatePaymentMethodConfigurationPaypal { + /// Whether or not the payment method should be displayed. + #[serde(skip_serializing_if = "Option::is_none")] + pub display_preference: Option, +} +impl CreatePaymentMethodConfigurationPaypal { + pub fn new() -> Self { + Self::default() + } +} +/// Whether or not the payment method should be displayed. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreatePaymentMethodConfigurationPaypalDisplayPreference { + /// The account's preference for whether or not to display this payment method. + #[serde(skip_serializing_if = "Option::is_none")] + pub preference: Option, +} +impl CreatePaymentMethodConfigurationPaypalDisplayPreference { + pub fn new() -> Self { + Self::default() + } +} +/// The account's preference for whether or not to display this payment method. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreatePaymentMethodConfigurationPaypalDisplayPreferencePreference { + None, + Off, + On, +} +impl CreatePaymentMethodConfigurationPaypalDisplayPreferencePreference { + pub fn as_str(self) -> &'static str { + use CreatePaymentMethodConfigurationPaypalDisplayPreferencePreference::*; + match self { + None => "none", + Off => "off", + On => "on", + } + } +} + +impl std::str::FromStr for CreatePaymentMethodConfigurationPaypalDisplayPreferencePreference { + type Err = (); + fn from_str(s: &str) -> Result { + use CreatePaymentMethodConfigurationPaypalDisplayPreferencePreference::*; + match s { + "none" => Ok(None), + "off" => Ok(Off), + "on" => Ok(On), + _ => Err(()), + } + } +} +impl std::fmt::Display for CreatePaymentMethodConfigurationPaypalDisplayPreferencePreference { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreatePaymentMethodConfigurationPaypalDisplayPreferencePreference { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreatePaymentMethodConfigurationPaypalDisplayPreferencePreference { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// PromptPay is a Thailand-based payment method that allows customers to make a payment using their preferred app from participating banks. +/// Check this [page](https://stripe.com/docs/payments/promptpay) for more details. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreatePaymentMethodConfigurationPromptpay { + /// Whether or not the payment method should be displayed. + #[serde(skip_serializing_if = "Option::is_none")] + pub display_preference: Option, +} +impl CreatePaymentMethodConfigurationPromptpay { + pub fn new() -> Self { + Self::default() + } +} +/// Whether or not the payment method should be displayed. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreatePaymentMethodConfigurationPromptpayDisplayPreference { + /// The account's preference for whether or not to display this payment method. + #[serde(skip_serializing_if = "Option::is_none")] + pub preference: Option, +} +impl CreatePaymentMethodConfigurationPromptpayDisplayPreference { + pub fn new() -> Self { + Self::default() + } +} +/// The account's preference for whether or not to display this payment method. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreatePaymentMethodConfigurationPromptpayDisplayPreferencePreference { + None, + Off, + On, +} +impl CreatePaymentMethodConfigurationPromptpayDisplayPreferencePreference { + pub fn as_str(self) -> &'static str { + use CreatePaymentMethodConfigurationPromptpayDisplayPreferencePreference::*; + match self { + None => "none", + Off => "off", + On => "on", + } + } +} + +impl std::str::FromStr for CreatePaymentMethodConfigurationPromptpayDisplayPreferencePreference { + type Err = (); + fn from_str(s: &str) -> Result { + use CreatePaymentMethodConfigurationPromptpayDisplayPreferencePreference::*; + match s { + "none" => Ok(None), + "off" => Ok(Off), + "on" => Ok(On), + _ => Err(()), + } + } +} +impl std::fmt::Display for CreatePaymentMethodConfigurationPromptpayDisplayPreferencePreference { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreatePaymentMethodConfigurationPromptpayDisplayPreferencePreference { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreatePaymentMethodConfigurationPromptpayDisplayPreferencePreference { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Revolut Pay, developed by Revolut, a global finance app, is a digital wallet payment method. +/// Revolut Pay uses the customer’s stored balance or cards to fund the payment, and offers the option for non-Revolut customers to save their details after their first purchase. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreatePaymentMethodConfigurationRevolutPay { + /// Whether or not the payment method should be displayed. + #[serde(skip_serializing_if = "Option::is_none")] + pub display_preference: Option, +} +impl CreatePaymentMethodConfigurationRevolutPay { + pub fn new() -> Self { + Self::default() + } +} +/// Whether or not the payment method should be displayed. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreatePaymentMethodConfigurationRevolutPayDisplayPreference { + /// The account's preference for whether or not to display this payment method. + #[serde(skip_serializing_if = "Option::is_none")] + pub preference: Option, +} +impl CreatePaymentMethodConfigurationRevolutPayDisplayPreference { + pub fn new() -> Self { + Self::default() + } +} +/// The account's preference for whether or not to display this payment method. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreatePaymentMethodConfigurationRevolutPayDisplayPreferencePreference { + None, + Off, + On, +} +impl CreatePaymentMethodConfigurationRevolutPayDisplayPreferencePreference { + pub fn as_str(self) -> &'static str { + use CreatePaymentMethodConfigurationRevolutPayDisplayPreferencePreference::*; + match self { + None => "none", + Off => "off", + On => "on", + } + } +} + +impl std::str::FromStr for CreatePaymentMethodConfigurationRevolutPayDisplayPreferencePreference { + type Err = (); + fn from_str(s: &str) -> Result { + use CreatePaymentMethodConfigurationRevolutPayDisplayPreferencePreference::*; + match s { + "none" => Ok(None), + "off" => Ok(Off), + "on" => Ok(On), + _ => Err(()), + } + } +} +impl std::fmt::Display for CreatePaymentMethodConfigurationRevolutPayDisplayPreferencePreference { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreatePaymentMethodConfigurationRevolutPayDisplayPreferencePreference { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreatePaymentMethodConfigurationRevolutPayDisplayPreferencePreference { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// The [Single Euro Payments Area (SEPA)](https://en.wikipedia.org/wiki/Single_Euro_Payments_Area) is an initiative of the European Union to simplify payments within and across member countries. +/// SEPA established and enforced banking standards to allow for the direct debiting of every EUR-denominated bank account within the SEPA region, check this [page](https://stripe.com/docs/payments/sepa-debit) for more details. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreatePaymentMethodConfigurationSepaDebit { + /// Whether or not the payment method should be displayed. + #[serde(skip_serializing_if = "Option::is_none")] + pub display_preference: Option, +} +impl CreatePaymentMethodConfigurationSepaDebit { + pub fn new() -> Self { + Self::default() + } +} +/// Whether or not the payment method should be displayed. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreatePaymentMethodConfigurationSepaDebitDisplayPreference { + /// The account's preference for whether or not to display this payment method. + #[serde(skip_serializing_if = "Option::is_none")] + pub preference: Option, +} +impl CreatePaymentMethodConfigurationSepaDebitDisplayPreference { + pub fn new() -> Self { + Self::default() + } +} +/// The account's preference for whether or not to display this payment method. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreatePaymentMethodConfigurationSepaDebitDisplayPreferencePreference { + None, + Off, + On, +} +impl CreatePaymentMethodConfigurationSepaDebitDisplayPreferencePreference { + pub fn as_str(self) -> &'static str { + use CreatePaymentMethodConfigurationSepaDebitDisplayPreferencePreference::*; + match self { + None => "none", + Off => "off", + On => "on", + } + } +} + +impl std::str::FromStr for CreatePaymentMethodConfigurationSepaDebitDisplayPreferencePreference { + type Err = (); + fn from_str(s: &str) -> Result { + use CreatePaymentMethodConfigurationSepaDebitDisplayPreferencePreference::*; + match s { + "none" => Ok(None), + "off" => Ok(Off), + "on" => Ok(On), + _ => Err(()), + } + } +} +impl std::fmt::Display for CreatePaymentMethodConfigurationSepaDebitDisplayPreferencePreference { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreatePaymentMethodConfigurationSepaDebitDisplayPreferencePreference { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreatePaymentMethodConfigurationSepaDebitDisplayPreferencePreference { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Stripe users in Europe and the United States can use the [Payment Intents API](https://stripe.com/docs/payments/payment-intents)—a single integration path for creating payments using any supported method—to accept [Sofort](https://www.sofort.com/) payments from customers. +/// Check this [page](https://stripe.com/docs/payments/sofort) for more details. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreatePaymentMethodConfigurationSofort { + /// Whether or not the payment method should be displayed. + #[serde(skip_serializing_if = "Option::is_none")] + pub display_preference: Option, +} +impl CreatePaymentMethodConfigurationSofort { + pub fn new() -> Self { + Self::default() + } +} +/// Whether or not the payment method should be displayed. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreatePaymentMethodConfigurationSofortDisplayPreference { + /// The account's preference for whether or not to display this payment method. + #[serde(skip_serializing_if = "Option::is_none")] + pub preference: Option, +} +impl CreatePaymentMethodConfigurationSofortDisplayPreference { + pub fn new() -> Self { + Self::default() + } +} +/// The account's preference for whether or not to display this payment method. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreatePaymentMethodConfigurationSofortDisplayPreferencePreference { + None, + Off, + On, +} +impl CreatePaymentMethodConfigurationSofortDisplayPreferencePreference { + pub fn as_str(self) -> &'static str { + use CreatePaymentMethodConfigurationSofortDisplayPreferencePreference::*; + match self { + None => "none", + Off => "off", + On => "on", + } + } +} + +impl std::str::FromStr for CreatePaymentMethodConfigurationSofortDisplayPreferencePreference { + type Err = (); + fn from_str(s: &str) -> Result { + use CreatePaymentMethodConfigurationSofortDisplayPreferencePreference::*; + match s { + "none" => Ok(None), + "off" => Ok(Off), + "on" => Ok(On), + _ => Err(()), + } + } +} +impl std::fmt::Display for CreatePaymentMethodConfigurationSofortDisplayPreferencePreference { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreatePaymentMethodConfigurationSofortDisplayPreferencePreference { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreatePaymentMethodConfigurationSofortDisplayPreferencePreference { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Stripe users in the United States can accept ACH direct debit payments from customers with a US bank account using the Automated Clearing House (ACH) payments system operated by Nacha. +/// Check this [page](https://stripe.com/docs/payments/ach-debit) for more details. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreatePaymentMethodConfigurationUsBankAccount { + /// Whether or not the payment method should be displayed. + #[serde(skip_serializing_if = "Option::is_none")] + pub display_preference: Option, +} +impl CreatePaymentMethodConfigurationUsBankAccount { + pub fn new() -> Self { + Self::default() + } +} +/// Whether or not the payment method should be displayed. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreatePaymentMethodConfigurationUsBankAccountDisplayPreference { + /// The account's preference for whether or not to display this payment method. + #[serde(skip_serializing_if = "Option::is_none")] + pub preference: + Option, +} +impl CreatePaymentMethodConfigurationUsBankAccountDisplayPreference { + pub fn new() -> Self { + Self::default() + } +} +/// The account's preference for whether or not to display this payment method. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreatePaymentMethodConfigurationUsBankAccountDisplayPreferencePreference { + None, + Off, + On, +} +impl CreatePaymentMethodConfigurationUsBankAccountDisplayPreferencePreference { + pub fn as_str(self) -> &'static str { + use CreatePaymentMethodConfigurationUsBankAccountDisplayPreferencePreference::*; + match self { + None => "none", + Off => "off", + On => "on", + } + } +} + +impl std::str::FromStr + for CreatePaymentMethodConfigurationUsBankAccountDisplayPreferencePreference +{ + type Err = (); + fn from_str(s: &str) -> Result { + use CreatePaymentMethodConfigurationUsBankAccountDisplayPreferencePreference::*; + match s { + "none" => Ok(None), + "off" => Ok(Off), + "on" => Ok(On), + _ => Err(()), + } + } +} +impl std::fmt::Display + for CreatePaymentMethodConfigurationUsBankAccountDisplayPreferencePreference +{ + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreatePaymentMethodConfigurationUsBankAccountDisplayPreferencePreference { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreatePaymentMethodConfigurationUsBankAccountDisplayPreferencePreference { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// WeChat, owned by Tencent, is China's leading mobile app with over 1 billion monthly active users. +/// Chinese consumers can use WeChat Pay to pay for goods and services inside of businesses' apps and websites. +/// WeChat Pay users buy most frequently in gaming, e-commerce, travel, online education, and food/nutrition. +/// Check this [page](https://stripe.com/docs/payments/wechat-pay) for more details. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreatePaymentMethodConfigurationWechatPay { + /// Whether or not the payment method should be displayed. + #[serde(skip_serializing_if = "Option::is_none")] + pub display_preference: Option, +} +impl CreatePaymentMethodConfigurationWechatPay { + pub fn new() -> Self { + Self::default() + } +} +/// Whether or not the payment method should be displayed. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreatePaymentMethodConfigurationWechatPayDisplayPreference { + /// The account's preference for whether or not to display this payment method. + #[serde(skip_serializing_if = "Option::is_none")] + pub preference: Option, +} +impl CreatePaymentMethodConfigurationWechatPayDisplayPreference { + pub fn new() -> Self { + Self::default() + } +} +/// The account's preference for whether or not to display this payment method. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreatePaymentMethodConfigurationWechatPayDisplayPreferencePreference { + None, + Off, + On, +} +impl CreatePaymentMethodConfigurationWechatPayDisplayPreferencePreference { + pub fn as_str(self) -> &'static str { + use CreatePaymentMethodConfigurationWechatPayDisplayPreferencePreference::*; + match self { + None => "none", + Off => "off", + On => "on", + } + } +} + +impl std::str::FromStr for CreatePaymentMethodConfigurationWechatPayDisplayPreferencePreference { + type Err = (); + fn from_str(s: &str) -> Result { + use CreatePaymentMethodConfigurationWechatPayDisplayPreferencePreference::*; + match s { + "none" => Ok(None), + "off" => Ok(Off), + "on" => Ok(On), + _ => Err(()), + } + } +} +impl std::fmt::Display for CreatePaymentMethodConfigurationWechatPayDisplayPreferencePreference { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreatePaymentMethodConfigurationWechatPayDisplayPreferencePreference { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreatePaymentMethodConfigurationWechatPayDisplayPreferencePreference { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'a> CreatePaymentMethodConfiguration<'a> { + /// Creates a payment method configuration + pub fn send( + &self, + client: &stripe::Client, + ) -> stripe::Response { + client.send_form("/payment_method_configurations", self, http_types::Method::Post) + } +} +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdatePaymentMethodConfiguration<'a> { + /// Canadian pre-authorized debit payments, check this [page](https://stripe.com/docs/payments/acss-debit) for more details like country availability. + #[serde(skip_serializing_if = "Option::is_none")] + pub acss_debit: Option, + /// Whether the configuration can be used for new payments. + #[serde(skip_serializing_if = "Option::is_none")] + pub active: Option, + /// [Affirm](https://www.affirm.com/) gives your customers a way to split purchases over a series of payments. + /// Depending on the purchase, they can pay with four interest-free payments (Split Pay) or pay over a longer term (Installments), which might include interest. + /// Check this [page](https://stripe.com/docs/payments/affirm) for more details like country availability. + #[serde(skip_serializing_if = "Option::is_none")] + pub affirm: Option, + /// Afterpay gives your customers a way to pay for purchases in installments, check this [page](https://stripe.com/docs/payments/afterpay-clearpay) for more details like country availability. + /// Afterpay is particularly popular among businesses selling fashion, beauty, and sports products. + #[serde(skip_serializing_if = "Option::is_none")] + pub afterpay_clearpay: Option, + /// Alipay is a digital wallet in China that has more than a billion active users worldwide. + /// Alipay users can pay on the web or on a mobile device using login credentials or their Alipay app. + /// Alipay has a low dispute rate and reduces fraud by authenticating payments using the customer's login credentials. + /// Check this [page](https://stripe.com/docs/payments/alipay) for more details. + #[serde(skip_serializing_if = "Option::is_none")] + pub alipay: Option, + /// Stripe users can accept [Apple Pay](/payments/apple-pay) in iOS applications in iOS 9 and later, and on the web in Safari starting with iOS 10 or macOS Sierra. + /// There are no additional fees to process Apple Pay payments, and the [pricing](/pricing) is the same as other card transactions. + /// Check this [page](https://stripe.com/docs/apple-pay) for more details. + #[serde(skip_serializing_if = "Option::is_none")] + pub apple_pay: Option, + /// Apple Pay Later, a payment method for customers to buy now and pay later, gives your customers a way to split purchases into four installments across six weeks. + #[serde(skip_serializing_if = "Option::is_none")] + pub apple_pay_later: Option, + /// Stripe users in Australia can accept Bulk Electronic Clearing System (BECS) direct debit payments from customers with an Australian bank account. + /// Check this [page](https://stripe.com/docs/payments/au-becs-debit) for more details. + #[serde(skip_serializing_if = "Option::is_none")] + pub au_becs_debit: Option, + /// Stripe users in the UK can accept Bacs Direct Debit payments from customers with a UK bank account, check this [page](https://stripe.com/docs/payments/payment-methods/bacs-debit) for more details. + #[serde(skip_serializing_if = "Option::is_none")] + pub bacs_debit: Option, + /// Bancontact is the most popular online payment method in Belgium, with over 15 million cards in circulation. + /// [Customers](https://stripe.com/docs/api/customers) use a Bancontact card or mobile app linked to a Belgian bank account to make online payments that are secure, guaranteed, and confirmed immediately. + /// Check this [page](https://stripe.com/docs/payments/bancontact) for more details. + #[serde(skip_serializing_if = "Option::is_none")] + pub bancontact: Option, + /// BLIK is a [single use](https://stripe.com/docs/payments/payment-methods#usage) payment method that requires customers to authenticate their payments. + /// When customers want to pay online using BLIK, they request a six-digit code from their banking application and enter it into the payment collection form. + /// Check this [page](https://stripe.com/docs/payments/blik) for more details. + #[serde(skip_serializing_if = "Option::is_none")] + pub blik: Option, + /// Boleto is an official (regulated by the Central Bank of Brazil) payment method in Brazil. + /// Check this [page](https://stripe.com/docs/payments/boleto) for more details. + #[serde(skip_serializing_if = "Option::is_none")] + pub boleto: Option, + /// Cards are a popular way for consumers and businesses to pay online or in person. + /// Stripe supports global and local card networks. + #[serde(skip_serializing_if = "Option::is_none")] + pub card: Option, + /// Cartes Bancaires is France's local card network. + /// More than 95% of these cards are co-branded with either Visa or Mastercard, meaning you can process these cards over either Cartes Bancaires or the Visa or Mastercard networks. + /// Check this [page](https://stripe.com/docs/payments/cartes-bancaires) for more details. + #[serde(skip_serializing_if = "Option::is_none")] + pub cartes_bancaires: Option, + /// Cash App is a popular consumer app in the US that allows customers to bank, invest, send, and receive money using their digital wallet. + /// Check this [page](https://stripe.com/docs/payments/cash-app-pay) for more details. + #[serde(skip_serializing_if = "Option::is_none")] + pub cashapp: Option, + /// Uses a customer’s [cash balance](https://stripe.com/docs/payments/customer-balance) for the payment. + /// The cash balance can be funded via a bank transfer. + /// Check this [page](https://stripe.com/docs/payments/bank-transfers) for more details. + #[serde(skip_serializing_if = "Option::is_none")] + pub customer_balance: Option, + /// EPS is an Austria-based payment method that allows customers to complete transactions online using their bank credentials. + /// EPS is supported by all Austrian banks and is accepted by over 80% of Austrian online retailers. + /// Check this [page](https://stripe.com/docs/payments/eps) for more details. + #[serde(skip_serializing_if = "Option::is_none")] + pub eps: Option, + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, + /// Financial Process Exchange (FPX) is a Malaysia-based payment method that allows customers to complete transactions online using their bank credentials. + /// Bank Negara Malaysia (BNM), the Central Bank of Malaysia, and eleven other major Malaysian financial institutions are members of the PayNet Group, which owns and operates FPX. + /// It is one of the most popular online payment methods in Malaysia, with nearly 90 million transactions in 2018 according to BNM. + /// Check this [page](https://stripe.com/docs/payments/fpx) for more details. + #[serde(skip_serializing_if = "Option::is_none")] + pub fpx: Option, + /// giropay is a German payment method based on online banking, introduced in 2006. + /// It allows customers to complete transactions online using their online banking environment, with funds debited from their bank account. + /// Depending on their bank, customers confirm payments on giropay using a second factor of authentication or a PIN. + /// giropay accounts for 10% of online checkouts in Germany. + /// Check this [page](https://stripe.com/docs/payments/giropay) for more details. + #[serde(skip_serializing_if = "Option::is_none")] + pub giropay: Option, + /// Google Pay allows customers to make payments in your app or website using any credit or debit card saved to their Google Account, including those from Google Play, YouTube, Chrome, or an Android device. + /// Use the Google Pay API to request any credit or debit card stored in your customer's Google account. + /// Check this [page](https://stripe.com/docs/google-pay) for more details. + #[serde(skip_serializing_if = "Option::is_none")] + pub google_pay: Option, + /// GrabPay is a payment method developed by [Grab](https://www.grab.com/sg/consumer/finance/pay/). + /// GrabPay is a digital wallet - customers maintain a balance in their wallets that they pay out with. + /// Check this [page](https://stripe.com/docs/payments/grabpay) for more details. + #[serde(skip_serializing_if = "Option::is_none")] + pub grabpay: Option, + /// iDEAL is a Netherlands-based payment method that allows customers to complete transactions online using their bank credentials. + /// All major Dutch banks are members of Currence, the scheme that operates iDEAL, making it the most popular online payment method in the Netherlands with a share of online transactions close to 55%. + /// Check this [page](https://stripe.com/docs/payments/ideal) for more details. + #[serde(skip_serializing_if = "Option::is_none")] + pub ideal: Option, + /// JCB is a credit card company based in Japan. + /// JCB is currently available in Japan to businesses approved by JCB, and available to all businesses in Australia, Canada, Hong Kong, Japan, New Zealand, Singapore, Switzerland, United Kingdom, United States, and all countries in the European Economic Area except Iceland. + /// Check this [page](https://support.stripe.com/questions/accepting-japan-credit-bureau-%28jcb%29-payments) for more details. + #[serde(skip_serializing_if = "Option::is_none")] + pub jcb: Option, + /// Klarna gives customers a range of [payment options](https://stripe.com/docs/payments/klarna#payment-options) during checkout. + /// Available payment options vary depending on the customer's billing address and the transaction amount. + /// These payment options make it convenient for customers to purchase items in all price ranges. + /// Check this [page](https://stripe.com/docs/payments/klarna) for more details. + #[serde(skip_serializing_if = "Option::is_none")] + pub klarna: Option, + /// Konbini allows customers in Japan to pay for bills and online purchases at convenience stores with cash. + /// Check this [page](https://stripe.com/docs/payments/konbini) for more details. + #[serde(skip_serializing_if = "Option::is_none")] + pub konbini: Option, + /// [Link](https://stripe.com/docs/payments/link) is a payment method network. + /// With Link, users save their payment details once, then reuse that information to pay with one click for any business on the network. + #[serde(skip_serializing_if = "Option::is_none")] + pub link: Option, + /// Configuration name. + #[serde(skip_serializing_if = "Option::is_none")] + pub name: Option<&'a str>, + /// OXXO is a Mexican chain of convenience stores with thousands of locations across Latin America and represents nearly 20% of online transactions in Mexico. + /// OXXO allows customers to pay bills and online purchases in-store with cash. + /// Check this [page](https://stripe.com/docs/payments/oxxo) for more details. + #[serde(skip_serializing_if = "Option::is_none")] + pub oxxo: Option, + /// Przelewy24 is a Poland-based payment method aggregator that allows customers to complete transactions online using bank transfers and other methods. + /// Bank transfers account for 30% of online payments in Poland and Przelewy24 provides a way for customers to pay with over 165 banks. + /// Check this [page](https://stripe.com/docs/payments/p24) for more details. + #[serde(skip_serializing_if = "Option::is_none")] + pub p24: Option, + /// PayNow is a Singapore-based payment method that allows customers to make a payment using their preferred app from participating banks and participating non-bank financial institutions. + /// Check this [page](https://stripe.com/docs/payments/paynow) for more details. + #[serde(skip_serializing_if = "Option::is_none")] + pub paynow: Option, + /// PayPal, a digital wallet popular with customers in Europe, allows your customers worldwide to pay using their PayPal account. + /// Check this [page](https://stripe.com/docs/payments/paypal) for more details. + #[serde(skip_serializing_if = "Option::is_none")] + pub paypal: Option, + /// PromptPay is a Thailand-based payment method that allows customers to make a payment using their preferred app from participating banks. + /// Check this [page](https://stripe.com/docs/payments/promptpay) for more details. + #[serde(skip_serializing_if = "Option::is_none")] + pub promptpay: Option, + /// Revolut Pay, developed by Revolut, a global finance app, is a digital wallet payment method. + /// Revolut Pay uses the customer’s stored balance or cards to fund the payment, and offers the option for non-Revolut customers to save their details after their first purchase. + #[serde(skip_serializing_if = "Option::is_none")] + pub revolut_pay: Option, + /// The [Single Euro Payments Area (SEPA)](https://en.wikipedia.org/wiki/Single_Euro_Payments_Area) is an initiative of the European Union to simplify payments within and across member countries. + /// SEPA established and enforced banking standards to allow for the direct debiting of every EUR-denominated bank account within the SEPA region, check this [page](https://stripe.com/docs/payments/sepa-debit) for more details. + #[serde(skip_serializing_if = "Option::is_none")] + pub sepa_debit: Option, + /// Stripe users in Europe and the United States can use the [Payment Intents API](https://stripe.com/docs/payments/payment-intents)—a single integration path for creating payments using any supported method—to accept [Sofort](https://www.sofort.com/) payments from customers. + /// Check this [page](https://stripe.com/docs/payments/sofort) for more details. + #[serde(skip_serializing_if = "Option::is_none")] + pub sofort: Option, + /// Stripe users in the United States can accept ACH direct debit payments from customers with a US bank account using the Automated Clearing House (ACH) payments system operated by Nacha. + /// Check this [page](https://stripe.com/docs/payments/ach-debit) for more details. + #[serde(skip_serializing_if = "Option::is_none")] + pub us_bank_account: Option, + /// WeChat, owned by Tencent, is China's leading mobile app with over 1 billion monthly active users. + /// Chinese consumers can use WeChat Pay to pay for goods and services inside of businesses' apps and websites. + /// WeChat Pay users buy most frequently in gaming, e-commerce, travel, online education, and food/nutrition. + /// Check this [page](https://stripe.com/docs/payments/wechat-pay) for more details. + #[serde(skip_serializing_if = "Option::is_none")] + pub wechat_pay: Option, +} +impl<'a> UpdatePaymentMethodConfiguration<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// Canadian pre-authorized debit payments, check this [page](https://stripe.com/docs/payments/acss-debit) for more details like country availability. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdatePaymentMethodConfigurationAcssDebit { + /// Whether or not the payment method should be displayed. + #[serde(skip_serializing_if = "Option::is_none")] + pub display_preference: Option, +} +impl UpdatePaymentMethodConfigurationAcssDebit { + pub fn new() -> Self { + Self::default() + } +} +/// Whether or not the payment method should be displayed. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdatePaymentMethodConfigurationAcssDebitDisplayPreference { + /// The account's preference for whether or not to display this payment method. + #[serde(skip_serializing_if = "Option::is_none")] + pub preference: Option, +} +impl UpdatePaymentMethodConfigurationAcssDebitDisplayPreference { + pub fn new() -> Self { + Self::default() + } +} +/// The account's preference for whether or not to display this payment method. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum UpdatePaymentMethodConfigurationAcssDebitDisplayPreferencePreference { + None, + Off, + On, +} +impl UpdatePaymentMethodConfigurationAcssDebitDisplayPreferencePreference { + pub fn as_str(self) -> &'static str { + use UpdatePaymentMethodConfigurationAcssDebitDisplayPreferencePreference::*; + match self { + None => "none", + Off => "off", + On => "on", + } + } +} + +impl std::str::FromStr for UpdatePaymentMethodConfigurationAcssDebitDisplayPreferencePreference { + type Err = (); + fn from_str(s: &str) -> Result { + use UpdatePaymentMethodConfigurationAcssDebitDisplayPreferencePreference::*; + match s { + "none" => Ok(None), + "off" => Ok(Off), + "on" => Ok(On), + _ => Err(()), + } + } +} +impl std::fmt::Display for UpdatePaymentMethodConfigurationAcssDebitDisplayPreferencePreference { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for UpdatePaymentMethodConfigurationAcssDebitDisplayPreferencePreference { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for UpdatePaymentMethodConfigurationAcssDebitDisplayPreferencePreference { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// [Affirm](https://www.affirm.com/) gives your customers a way to split purchases over a series of payments. +/// Depending on the purchase, they can pay with four interest-free payments (Split Pay) or pay over a longer term (Installments), which might include interest. +/// Check this [page](https://stripe.com/docs/payments/affirm) for more details like country availability. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdatePaymentMethodConfigurationAffirm { + /// Whether or not the payment method should be displayed. + #[serde(skip_serializing_if = "Option::is_none")] + pub display_preference: Option, +} +impl UpdatePaymentMethodConfigurationAffirm { + pub fn new() -> Self { + Self::default() + } +} +/// Whether or not the payment method should be displayed. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdatePaymentMethodConfigurationAffirmDisplayPreference { + /// The account's preference for whether or not to display this payment method. + #[serde(skip_serializing_if = "Option::is_none")] + pub preference: Option, +} +impl UpdatePaymentMethodConfigurationAffirmDisplayPreference { + pub fn new() -> Self { + Self::default() + } +} +/// The account's preference for whether or not to display this payment method. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum UpdatePaymentMethodConfigurationAffirmDisplayPreferencePreference { + None, + Off, + On, +} +impl UpdatePaymentMethodConfigurationAffirmDisplayPreferencePreference { + pub fn as_str(self) -> &'static str { + use UpdatePaymentMethodConfigurationAffirmDisplayPreferencePreference::*; + match self { + None => "none", + Off => "off", + On => "on", + } + } +} + +impl std::str::FromStr for UpdatePaymentMethodConfigurationAffirmDisplayPreferencePreference { + type Err = (); + fn from_str(s: &str) -> Result { + use UpdatePaymentMethodConfigurationAffirmDisplayPreferencePreference::*; + match s { + "none" => Ok(None), + "off" => Ok(Off), + "on" => Ok(On), + _ => Err(()), + } + } +} +impl std::fmt::Display for UpdatePaymentMethodConfigurationAffirmDisplayPreferencePreference { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for UpdatePaymentMethodConfigurationAffirmDisplayPreferencePreference { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for UpdatePaymentMethodConfigurationAffirmDisplayPreferencePreference { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Afterpay gives your customers a way to pay for purchases in installments, check this [page](https://stripe.com/docs/payments/afterpay-clearpay) for more details like country availability. +/// Afterpay is particularly popular among businesses selling fashion, beauty, and sports products. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdatePaymentMethodConfigurationAfterpayClearpay { + /// Whether or not the payment method should be displayed. + #[serde(skip_serializing_if = "Option::is_none")] + pub display_preference: + Option, +} +impl UpdatePaymentMethodConfigurationAfterpayClearpay { + pub fn new() -> Self { + Self::default() + } +} +/// Whether or not the payment method should be displayed. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdatePaymentMethodConfigurationAfterpayClearpayDisplayPreference { + /// The account's preference for whether or not to display this payment method. + #[serde(skip_serializing_if = "Option::is_none")] + pub preference: + Option, +} +impl UpdatePaymentMethodConfigurationAfterpayClearpayDisplayPreference { + pub fn new() -> Self { + Self::default() + } +} +/// The account's preference for whether or not to display this payment method. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum UpdatePaymentMethodConfigurationAfterpayClearpayDisplayPreferencePreference { + None, + Off, + On, +} +impl UpdatePaymentMethodConfigurationAfterpayClearpayDisplayPreferencePreference { + pub fn as_str(self) -> &'static str { + use UpdatePaymentMethodConfigurationAfterpayClearpayDisplayPreferencePreference::*; + match self { + None => "none", + Off => "off", + On => "on", + } + } +} + +impl std::str::FromStr + for UpdatePaymentMethodConfigurationAfterpayClearpayDisplayPreferencePreference +{ + type Err = (); + fn from_str(s: &str) -> Result { + use UpdatePaymentMethodConfigurationAfterpayClearpayDisplayPreferencePreference::*; + match s { + "none" => Ok(None), + "off" => Ok(Off), + "on" => Ok(On), + _ => Err(()), + } + } +} +impl std::fmt::Display + for UpdatePaymentMethodConfigurationAfterpayClearpayDisplayPreferencePreference +{ + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug + for UpdatePaymentMethodConfigurationAfterpayClearpayDisplayPreferencePreference +{ + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize + for UpdatePaymentMethodConfigurationAfterpayClearpayDisplayPreferencePreference +{ + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Alipay is a digital wallet in China that has more than a billion active users worldwide. +/// Alipay users can pay on the web or on a mobile device using login credentials or their Alipay app. +/// Alipay has a low dispute rate and reduces fraud by authenticating payments using the customer's login credentials. +/// Check this [page](https://stripe.com/docs/payments/alipay) for more details. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdatePaymentMethodConfigurationAlipay { + /// Whether or not the payment method should be displayed. + #[serde(skip_serializing_if = "Option::is_none")] + pub display_preference: Option, +} +impl UpdatePaymentMethodConfigurationAlipay { + pub fn new() -> Self { + Self::default() + } +} +/// Whether or not the payment method should be displayed. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdatePaymentMethodConfigurationAlipayDisplayPreference { + /// The account's preference for whether or not to display this payment method. + #[serde(skip_serializing_if = "Option::is_none")] + pub preference: Option, +} +impl UpdatePaymentMethodConfigurationAlipayDisplayPreference { + pub fn new() -> Self { + Self::default() + } +} +/// The account's preference for whether or not to display this payment method. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum UpdatePaymentMethodConfigurationAlipayDisplayPreferencePreference { + None, + Off, + On, +} +impl UpdatePaymentMethodConfigurationAlipayDisplayPreferencePreference { + pub fn as_str(self) -> &'static str { + use UpdatePaymentMethodConfigurationAlipayDisplayPreferencePreference::*; + match self { + None => "none", + Off => "off", + On => "on", + } + } +} + +impl std::str::FromStr for UpdatePaymentMethodConfigurationAlipayDisplayPreferencePreference { + type Err = (); + fn from_str(s: &str) -> Result { + use UpdatePaymentMethodConfigurationAlipayDisplayPreferencePreference::*; + match s { + "none" => Ok(None), + "off" => Ok(Off), + "on" => Ok(On), + _ => Err(()), + } + } +} +impl std::fmt::Display for UpdatePaymentMethodConfigurationAlipayDisplayPreferencePreference { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for UpdatePaymentMethodConfigurationAlipayDisplayPreferencePreference { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for UpdatePaymentMethodConfigurationAlipayDisplayPreferencePreference { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Stripe users can accept [Apple Pay](/payments/apple-pay) in iOS applications in iOS 9 and later, and on the web in Safari starting with iOS 10 or macOS Sierra. +/// There are no additional fees to process Apple Pay payments, and the [pricing](/pricing) is the same as other card transactions. +/// Check this [page](https://stripe.com/docs/apple-pay) for more details. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdatePaymentMethodConfigurationApplePay { + /// Whether or not the payment method should be displayed. + #[serde(skip_serializing_if = "Option::is_none")] + pub display_preference: Option, +} +impl UpdatePaymentMethodConfigurationApplePay { + pub fn new() -> Self { + Self::default() + } +} +/// Whether or not the payment method should be displayed. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdatePaymentMethodConfigurationApplePayDisplayPreference { + /// The account's preference for whether or not to display this payment method. + #[serde(skip_serializing_if = "Option::is_none")] + pub preference: Option, +} +impl UpdatePaymentMethodConfigurationApplePayDisplayPreference { + pub fn new() -> Self { + Self::default() + } +} +/// The account's preference for whether or not to display this payment method. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum UpdatePaymentMethodConfigurationApplePayDisplayPreferencePreference { + None, + Off, + On, +} +impl UpdatePaymentMethodConfigurationApplePayDisplayPreferencePreference { + pub fn as_str(self) -> &'static str { + use UpdatePaymentMethodConfigurationApplePayDisplayPreferencePreference::*; + match self { + None => "none", + Off => "off", + On => "on", + } + } +} + +impl std::str::FromStr for UpdatePaymentMethodConfigurationApplePayDisplayPreferencePreference { + type Err = (); + fn from_str(s: &str) -> Result { + use UpdatePaymentMethodConfigurationApplePayDisplayPreferencePreference::*; + match s { + "none" => Ok(None), + "off" => Ok(Off), + "on" => Ok(On), + _ => Err(()), + } + } +} +impl std::fmt::Display for UpdatePaymentMethodConfigurationApplePayDisplayPreferencePreference { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for UpdatePaymentMethodConfigurationApplePayDisplayPreferencePreference { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for UpdatePaymentMethodConfigurationApplePayDisplayPreferencePreference { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Apple Pay Later, a payment method for customers to buy now and pay later, gives your customers a way to split purchases into four installments across six weeks. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdatePaymentMethodConfigurationApplePayLater { + /// Whether or not the payment method should be displayed. + #[serde(skip_serializing_if = "Option::is_none")] + pub display_preference: Option, +} +impl UpdatePaymentMethodConfigurationApplePayLater { + pub fn new() -> Self { + Self::default() + } +} +/// Whether or not the payment method should be displayed. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdatePaymentMethodConfigurationApplePayLaterDisplayPreference { + /// The account's preference for whether or not to display this payment method. + #[serde(skip_serializing_if = "Option::is_none")] + pub preference: + Option, +} +impl UpdatePaymentMethodConfigurationApplePayLaterDisplayPreference { + pub fn new() -> Self { + Self::default() + } +} +/// The account's preference for whether or not to display this payment method. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum UpdatePaymentMethodConfigurationApplePayLaterDisplayPreferencePreference { + None, + Off, + On, +} +impl UpdatePaymentMethodConfigurationApplePayLaterDisplayPreferencePreference { + pub fn as_str(self) -> &'static str { + use UpdatePaymentMethodConfigurationApplePayLaterDisplayPreferencePreference::*; + match self { + None => "none", + Off => "off", + On => "on", + } + } +} + +impl std::str::FromStr + for UpdatePaymentMethodConfigurationApplePayLaterDisplayPreferencePreference +{ + type Err = (); + fn from_str(s: &str) -> Result { + use UpdatePaymentMethodConfigurationApplePayLaterDisplayPreferencePreference::*; + match s { + "none" => Ok(None), + "off" => Ok(Off), + "on" => Ok(On), + _ => Err(()), + } + } +} +impl std::fmt::Display + for UpdatePaymentMethodConfigurationApplePayLaterDisplayPreferencePreference +{ + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for UpdatePaymentMethodConfigurationApplePayLaterDisplayPreferencePreference { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for UpdatePaymentMethodConfigurationApplePayLaterDisplayPreferencePreference { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Stripe users in Australia can accept Bulk Electronic Clearing System (BECS) direct debit payments from customers with an Australian bank account. +/// Check this [page](https://stripe.com/docs/payments/au-becs-debit) for more details. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdatePaymentMethodConfigurationAuBecsDebit { + /// Whether or not the payment method should be displayed. + #[serde(skip_serializing_if = "Option::is_none")] + pub display_preference: Option, +} +impl UpdatePaymentMethodConfigurationAuBecsDebit { + pub fn new() -> Self { + Self::default() + } +} +/// Whether or not the payment method should be displayed. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdatePaymentMethodConfigurationAuBecsDebitDisplayPreference { + /// The account's preference for whether or not to display this payment method. + #[serde(skip_serializing_if = "Option::is_none")] + pub preference: Option, +} +impl UpdatePaymentMethodConfigurationAuBecsDebitDisplayPreference { + pub fn new() -> Self { + Self::default() + } +} +/// The account's preference for whether or not to display this payment method. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum UpdatePaymentMethodConfigurationAuBecsDebitDisplayPreferencePreference { + None, + Off, + On, +} +impl UpdatePaymentMethodConfigurationAuBecsDebitDisplayPreferencePreference { + pub fn as_str(self) -> &'static str { + use UpdatePaymentMethodConfigurationAuBecsDebitDisplayPreferencePreference::*; + match self { + None => "none", + Off => "off", + On => "on", + } + } +} + +impl std::str::FromStr for UpdatePaymentMethodConfigurationAuBecsDebitDisplayPreferencePreference { + type Err = (); + fn from_str(s: &str) -> Result { + use UpdatePaymentMethodConfigurationAuBecsDebitDisplayPreferencePreference::*; + match s { + "none" => Ok(None), + "off" => Ok(Off), + "on" => Ok(On), + _ => Err(()), + } + } +} +impl std::fmt::Display for UpdatePaymentMethodConfigurationAuBecsDebitDisplayPreferencePreference { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for UpdatePaymentMethodConfigurationAuBecsDebitDisplayPreferencePreference { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for UpdatePaymentMethodConfigurationAuBecsDebitDisplayPreferencePreference { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Stripe users in the UK can accept Bacs Direct Debit payments from customers with a UK bank account, check this [page](https://stripe.com/docs/payments/payment-methods/bacs-debit) for more details. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdatePaymentMethodConfigurationBacsDebit { + /// Whether or not the payment method should be displayed. + #[serde(skip_serializing_if = "Option::is_none")] + pub display_preference: Option, +} +impl UpdatePaymentMethodConfigurationBacsDebit { + pub fn new() -> Self { + Self::default() + } +} +/// Whether or not the payment method should be displayed. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdatePaymentMethodConfigurationBacsDebitDisplayPreference { + /// The account's preference for whether or not to display this payment method. + #[serde(skip_serializing_if = "Option::is_none")] + pub preference: Option, +} +impl UpdatePaymentMethodConfigurationBacsDebitDisplayPreference { + pub fn new() -> Self { + Self::default() + } +} +/// The account's preference for whether or not to display this payment method. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum UpdatePaymentMethodConfigurationBacsDebitDisplayPreferencePreference { + None, + Off, + On, +} +impl UpdatePaymentMethodConfigurationBacsDebitDisplayPreferencePreference { + pub fn as_str(self) -> &'static str { + use UpdatePaymentMethodConfigurationBacsDebitDisplayPreferencePreference::*; + match self { + None => "none", + Off => "off", + On => "on", + } + } +} + +impl std::str::FromStr for UpdatePaymentMethodConfigurationBacsDebitDisplayPreferencePreference { + type Err = (); + fn from_str(s: &str) -> Result { + use UpdatePaymentMethodConfigurationBacsDebitDisplayPreferencePreference::*; + match s { + "none" => Ok(None), + "off" => Ok(Off), + "on" => Ok(On), + _ => Err(()), + } + } +} +impl std::fmt::Display for UpdatePaymentMethodConfigurationBacsDebitDisplayPreferencePreference { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for UpdatePaymentMethodConfigurationBacsDebitDisplayPreferencePreference { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for UpdatePaymentMethodConfigurationBacsDebitDisplayPreferencePreference { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Bancontact is the most popular online payment method in Belgium, with over 15 million cards in circulation. +/// [Customers](https://stripe.com/docs/api/customers) use a Bancontact card or mobile app linked to a Belgian bank account to make online payments that are secure, guaranteed, and confirmed immediately. +/// Check this [page](https://stripe.com/docs/payments/bancontact) for more details. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdatePaymentMethodConfigurationBancontact { + /// Whether or not the payment method should be displayed. + #[serde(skip_serializing_if = "Option::is_none")] + pub display_preference: Option, +} +impl UpdatePaymentMethodConfigurationBancontact { + pub fn new() -> Self { + Self::default() + } +} +/// Whether or not the payment method should be displayed. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdatePaymentMethodConfigurationBancontactDisplayPreference { + /// The account's preference for whether or not to display this payment method. + #[serde(skip_serializing_if = "Option::is_none")] + pub preference: Option, +} +impl UpdatePaymentMethodConfigurationBancontactDisplayPreference { + pub fn new() -> Self { + Self::default() + } +} +/// The account's preference for whether or not to display this payment method. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum UpdatePaymentMethodConfigurationBancontactDisplayPreferencePreference { + None, + Off, + On, +} +impl UpdatePaymentMethodConfigurationBancontactDisplayPreferencePreference { + pub fn as_str(self) -> &'static str { + use UpdatePaymentMethodConfigurationBancontactDisplayPreferencePreference::*; + match self { + None => "none", + Off => "off", + On => "on", + } + } +} + +impl std::str::FromStr for UpdatePaymentMethodConfigurationBancontactDisplayPreferencePreference { + type Err = (); + fn from_str(s: &str) -> Result { + use UpdatePaymentMethodConfigurationBancontactDisplayPreferencePreference::*; + match s { + "none" => Ok(None), + "off" => Ok(Off), + "on" => Ok(On), + _ => Err(()), + } + } +} +impl std::fmt::Display for UpdatePaymentMethodConfigurationBancontactDisplayPreferencePreference { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for UpdatePaymentMethodConfigurationBancontactDisplayPreferencePreference { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for UpdatePaymentMethodConfigurationBancontactDisplayPreferencePreference { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// BLIK is a [single use](https://stripe.com/docs/payments/payment-methods#usage) payment method that requires customers to authenticate their payments. +/// When customers want to pay online using BLIK, they request a six-digit code from their banking application and enter it into the payment collection form. +/// Check this [page](https://stripe.com/docs/payments/blik) for more details. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdatePaymentMethodConfigurationBlik { + /// Whether or not the payment method should be displayed. + #[serde(skip_serializing_if = "Option::is_none")] + pub display_preference: Option, +} +impl UpdatePaymentMethodConfigurationBlik { + pub fn new() -> Self { + Self::default() + } +} +/// Whether or not the payment method should be displayed. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdatePaymentMethodConfigurationBlikDisplayPreference { + /// The account's preference for whether or not to display this payment method. + #[serde(skip_serializing_if = "Option::is_none")] + pub preference: Option, +} +impl UpdatePaymentMethodConfigurationBlikDisplayPreference { + pub fn new() -> Self { + Self::default() + } +} +/// The account's preference for whether or not to display this payment method. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum UpdatePaymentMethodConfigurationBlikDisplayPreferencePreference { + None, + Off, + On, +} +impl UpdatePaymentMethodConfigurationBlikDisplayPreferencePreference { + pub fn as_str(self) -> &'static str { + use UpdatePaymentMethodConfigurationBlikDisplayPreferencePreference::*; + match self { + None => "none", + Off => "off", + On => "on", + } + } +} + +impl std::str::FromStr for UpdatePaymentMethodConfigurationBlikDisplayPreferencePreference { + type Err = (); + fn from_str(s: &str) -> Result { + use UpdatePaymentMethodConfigurationBlikDisplayPreferencePreference::*; + match s { + "none" => Ok(None), + "off" => Ok(Off), + "on" => Ok(On), + _ => Err(()), + } + } +} +impl std::fmt::Display for UpdatePaymentMethodConfigurationBlikDisplayPreferencePreference { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for UpdatePaymentMethodConfigurationBlikDisplayPreferencePreference { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for UpdatePaymentMethodConfigurationBlikDisplayPreferencePreference { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Boleto is an official (regulated by the Central Bank of Brazil) payment method in Brazil. +/// Check this [page](https://stripe.com/docs/payments/boleto) for more details. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdatePaymentMethodConfigurationBoleto { + /// Whether or not the payment method should be displayed. + #[serde(skip_serializing_if = "Option::is_none")] + pub display_preference: Option, +} +impl UpdatePaymentMethodConfigurationBoleto { + pub fn new() -> Self { + Self::default() + } +} +/// Whether or not the payment method should be displayed. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdatePaymentMethodConfigurationBoletoDisplayPreference { + /// The account's preference for whether or not to display this payment method. + #[serde(skip_serializing_if = "Option::is_none")] + pub preference: Option, +} +impl UpdatePaymentMethodConfigurationBoletoDisplayPreference { + pub fn new() -> Self { + Self::default() + } +} +/// The account's preference for whether or not to display this payment method. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum UpdatePaymentMethodConfigurationBoletoDisplayPreferencePreference { + None, + Off, + On, +} +impl UpdatePaymentMethodConfigurationBoletoDisplayPreferencePreference { + pub fn as_str(self) -> &'static str { + use UpdatePaymentMethodConfigurationBoletoDisplayPreferencePreference::*; + match self { + None => "none", + Off => "off", + On => "on", + } + } +} + +impl std::str::FromStr for UpdatePaymentMethodConfigurationBoletoDisplayPreferencePreference { + type Err = (); + fn from_str(s: &str) -> Result { + use UpdatePaymentMethodConfigurationBoletoDisplayPreferencePreference::*; + match s { + "none" => Ok(None), + "off" => Ok(Off), + "on" => Ok(On), + _ => Err(()), + } + } +} +impl std::fmt::Display for UpdatePaymentMethodConfigurationBoletoDisplayPreferencePreference { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for UpdatePaymentMethodConfigurationBoletoDisplayPreferencePreference { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for UpdatePaymentMethodConfigurationBoletoDisplayPreferencePreference { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Cards are a popular way for consumers and businesses to pay online or in person. +/// Stripe supports global and local card networks. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdatePaymentMethodConfigurationCard { + /// Whether or not the payment method should be displayed. + #[serde(skip_serializing_if = "Option::is_none")] + pub display_preference: Option, +} +impl UpdatePaymentMethodConfigurationCard { + pub fn new() -> Self { + Self::default() + } +} +/// Whether or not the payment method should be displayed. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdatePaymentMethodConfigurationCardDisplayPreference { + /// The account's preference for whether or not to display this payment method. + #[serde(skip_serializing_if = "Option::is_none")] + pub preference: Option, +} +impl UpdatePaymentMethodConfigurationCardDisplayPreference { + pub fn new() -> Self { + Self::default() + } +} +/// The account's preference for whether or not to display this payment method. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum UpdatePaymentMethodConfigurationCardDisplayPreferencePreference { + None, + Off, + On, +} +impl UpdatePaymentMethodConfigurationCardDisplayPreferencePreference { + pub fn as_str(self) -> &'static str { + use UpdatePaymentMethodConfigurationCardDisplayPreferencePreference::*; + match self { + None => "none", + Off => "off", + On => "on", + } + } +} + +impl std::str::FromStr for UpdatePaymentMethodConfigurationCardDisplayPreferencePreference { + type Err = (); + fn from_str(s: &str) -> Result { + use UpdatePaymentMethodConfigurationCardDisplayPreferencePreference::*; + match s { + "none" => Ok(None), + "off" => Ok(Off), + "on" => Ok(On), + _ => Err(()), + } + } +} +impl std::fmt::Display for UpdatePaymentMethodConfigurationCardDisplayPreferencePreference { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for UpdatePaymentMethodConfigurationCardDisplayPreferencePreference { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for UpdatePaymentMethodConfigurationCardDisplayPreferencePreference { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Cartes Bancaires is France's local card network. +/// More than 95% of these cards are co-branded with either Visa or Mastercard, meaning you can process these cards over either Cartes Bancaires or the Visa or Mastercard networks. +/// Check this [page](https://stripe.com/docs/payments/cartes-bancaires) for more details. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdatePaymentMethodConfigurationCartesBancaires { + /// Whether or not the payment method should be displayed. + #[serde(skip_serializing_if = "Option::is_none")] + pub display_preference: + Option, +} +impl UpdatePaymentMethodConfigurationCartesBancaires { + pub fn new() -> Self { + Self::default() + } +} +/// Whether or not the payment method should be displayed. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdatePaymentMethodConfigurationCartesBancairesDisplayPreference { + /// The account's preference for whether or not to display this payment method. + #[serde(skip_serializing_if = "Option::is_none")] + pub preference: + Option, +} +impl UpdatePaymentMethodConfigurationCartesBancairesDisplayPreference { + pub fn new() -> Self { + Self::default() + } +} +/// The account's preference for whether or not to display this payment method. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum UpdatePaymentMethodConfigurationCartesBancairesDisplayPreferencePreference { + None, + Off, + On, +} +impl UpdatePaymentMethodConfigurationCartesBancairesDisplayPreferencePreference { + pub fn as_str(self) -> &'static str { + use UpdatePaymentMethodConfigurationCartesBancairesDisplayPreferencePreference::*; + match self { + None => "none", + Off => "off", + On => "on", + } + } +} + +impl std::str::FromStr + for UpdatePaymentMethodConfigurationCartesBancairesDisplayPreferencePreference +{ + type Err = (); + fn from_str(s: &str) -> Result { + use UpdatePaymentMethodConfigurationCartesBancairesDisplayPreferencePreference::*; + match s { + "none" => Ok(None), + "off" => Ok(Off), + "on" => Ok(On), + _ => Err(()), + } + } +} +impl std::fmt::Display + for UpdatePaymentMethodConfigurationCartesBancairesDisplayPreferencePreference +{ + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug + for UpdatePaymentMethodConfigurationCartesBancairesDisplayPreferencePreference +{ + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize + for UpdatePaymentMethodConfigurationCartesBancairesDisplayPreferencePreference +{ + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Cash App is a popular consumer app in the US that allows customers to bank, invest, send, and receive money using their digital wallet. +/// Check this [page](https://stripe.com/docs/payments/cash-app-pay) for more details. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdatePaymentMethodConfigurationCashapp { + /// Whether or not the payment method should be displayed. + #[serde(skip_serializing_if = "Option::is_none")] + pub display_preference: Option, +} +impl UpdatePaymentMethodConfigurationCashapp { + pub fn new() -> Self { + Self::default() + } +} +/// Whether or not the payment method should be displayed. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdatePaymentMethodConfigurationCashappDisplayPreference { + /// The account's preference for whether or not to display this payment method. + #[serde(skip_serializing_if = "Option::is_none")] + pub preference: Option, +} +impl UpdatePaymentMethodConfigurationCashappDisplayPreference { + pub fn new() -> Self { + Self::default() + } +} +/// The account's preference for whether or not to display this payment method. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum UpdatePaymentMethodConfigurationCashappDisplayPreferencePreference { + None, + Off, + On, +} +impl UpdatePaymentMethodConfigurationCashappDisplayPreferencePreference { + pub fn as_str(self) -> &'static str { + use UpdatePaymentMethodConfigurationCashappDisplayPreferencePreference::*; + match self { + None => "none", + Off => "off", + On => "on", + } + } +} + +impl std::str::FromStr for UpdatePaymentMethodConfigurationCashappDisplayPreferencePreference { + type Err = (); + fn from_str(s: &str) -> Result { + use UpdatePaymentMethodConfigurationCashappDisplayPreferencePreference::*; + match s { + "none" => Ok(None), + "off" => Ok(Off), + "on" => Ok(On), + _ => Err(()), + } + } +} +impl std::fmt::Display for UpdatePaymentMethodConfigurationCashappDisplayPreferencePreference { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for UpdatePaymentMethodConfigurationCashappDisplayPreferencePreference { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for UpdatePaymentMethodConfigurationCashappDisplayPreferencePreference { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Uses a customer’s [cash balance](https://stripe.com/docs/payments/customer-balance) for the payment. +/// The cash balance can be funded via a bank transfer. +/// Check this [page](https://stripe.com/docs/payments/bank-transfers) for more details. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdatePaymentMethodConfigurationCustomerBalance { + /// Whether or not the payment method should be displayed. + #[serde(skip_serializing_if = "Option::is_none")] + pub display_preference: + Option, +} +impl UpdatePaymentMethodConfigurationCustomerBalance { + pub fn new() -> Self { + Self::default() + } +} +/// Whether or not the payment method should be displayed. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdatePaymentMethodConfigurationCustomerBalanceDisplayPreference { + /// The account's preference for whether or not to display this payment method. + #[serde(skip_serializing_if = "Option::is_none")] + pub preference: + Option, +} +impl UpdatePaymentMethodConfigurationCustomerBalanceDisplayPreference { + pub fn new() -> Self { + Self::default() + } +} +/// The account's preference for whether or not to display this payment method. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum UpdatePaymentMethodConfigurationCustomerBalanceDisplayPreferencePreference { + None, + Off, + On, +} +impl UpdatePaymentMethodConfigurationCustomerBalanceDisplayPreferencePreference { + pub fn as_str(self) -> &'static str { + use UpdatePaymentMethodConfigurationCustomerBalanceDisplayPreferencePreference::*; + match self { + None => "none", + Off => "off", + On => "on", + } + } +} + +impl std::str::FromStr + for UpdatePaymentMethodConfigurationCustomerBalanceDisplayPreferencePreference +{ + type Err = (); + fn from_str(s: &str) -> Result { + use UpdatePaymentMethodConfigurationCustomerBalanceDisplayPreferencePreference::*; + match s { + "none" => Ok(None), + "off" => Ok(Off), + "on" => Ok(On), + _ => Err(()), + } + } +} +impl std::fmt::Display + for UpdatePaymentMethodConfigurationCustomerBalanceDisplayPreferencePreference +{ + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug + for UpdatePaymentMethodConfigurationCustomerBalanceDisplayPreferencePreference +{ + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize + for UpdatePaymentMethodConfigurationCustomerBalanceDisplayPreferencePreference +{ + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// EPS is an Austria-based payment method that allows customers to complete transactions online using their bank credentials. +/// EPS is supported by all Austrian banks and is accepted by over 80% of Austrian online retailers. +/// Check this [page](https://stripe.com/docs/payments/eps) for more details. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdatePaymentMethodConfigurationEps { + /// Whether or not the payment method should be displayed. + #[serde(skip_serializing_if = "Option::is_none")] + pub display_preference: Option, +} +impl UpdatePaymentMethodConfigurationEps { + pub fn new() -> Self { + Self::default() + } +} +/// Whether or not the payment method should be displayed. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdatePaymentMethodConfigurationEpsDisplayPreference { + /// The account's preference for whether or not to display this payment method. + #[serde(skip_serializing_if = "Option::is_none")] + pub preference: Option, +} +impl UpdatePaymentMethodConfigurationEpsDisplayPreference { + pub fn new() -> Self { + Self::default() + } +} +/// The account's preference for whether or not to display this payment method. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum UpdatePaymentMethodConfigurationEpsDisplayPreferencePreference { + None, + Off, + On, +} +impl UpdatePaymentMethodConfigurationEpsDisplayPreferencePreference { + pub fn as_str(self) -> &'static str { + use UpdatePaymentMethodConfigurationEpsDisplayPreferencePreference::*; + match self { + None => "none", + Off => "off", + On => "on", + } + } +} + +impl std::str::FromStr for UpdatePaymentMethodConfigurationEpsDisplayPreferencePreference { + type Err = (); + fn from_str(s: &str) -> Result { + use UpdatePaymentMethodConfigurationEpsDisplayPreferencePreference::*; + match s { + "none" => Ok(None), + "off" => Ok(Off), + "on" => Ok(On), + _ => Err(()), + } + } +} +impl std::fmt::Display for UpdatePaymentMethodConfigurationEpsDisplayPreferencePreference { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for UpdatePaymentMethodConfigurationEpsDisplayPreferencePreference { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for UpdatePaymentMethodConfigurationEpsDisplayPreferencePreference { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Financial Process Exchange (FPX) is a Malaysia-based payment method that allows customers to complete transactions online using their bank credentials. +/// Bank Negara Malaysia (BNM), the Central Bank of Malaysia, and eleven other major Malaysian financial institutions are members of the PayNet Group, which owns and operates FPX. +/// It is one of the most popular online payment methods in Malaysia, with nearly 90 million transactions in 2018 according to BNM. +/// Check this [page](https://stripe.com/docs/payments/fpx) for more details. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdatePaymentMethodConfigurationFpx { + /// Whether or not the payment method should be displayed. + #[serde(skip_serializing_if = "Option::is_none")] + pub display_preference: Option, +} +impl UpdatePaymentMethodConfigurationFpx { + pub fn new() -> Self { + Self::default() + } +} +/// Whether or not the payment method should be displayed. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdatePaymentMethodConfigurationFpxDisplayPreference { + /// The account's preference for whether or not to display this payment method. + #[serde(skip_serializing_if = "Option::is_none")] + pub preference: Option, +} +impl UpdatePaymentMethodConfigurationFpxDisplayPreference { + pub fn new() -> Self { + Self::default() + } +} +/// The account's preference for whether or not to display this payment method. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum UpdatePaymentMethodConfigurationFpxDisplayPreferencePreference { + None, + Off, + On, +} +impl UpdatePaymentMethodConfigurationFpxDisplayPreferencePreference { + pub fn as_str(self) -> &'static str { + use UpdatePaymentMethodConfigurationFpxDisplayPreferencePreference::*; + match self { + None => "none", + Off => "off", + On => "on", + } + } +} + +impl std::str::FromStr for UpdatePaymentMethodConfigurationFpxDisplayPreferencePreference { + type Err = (); + fn from_str(s: &str) -> Result { + use UpdatePaymentMethodConfigurationFpxDisplayPreferencePreference::*; + match s { + "none" => Ok(None), + "off" => Ok(Off), + "on" => Ok(On), + _ => Err(()), + } + } +} +impl std::fmt::Display for UpdatePaymentMethodConfigurationFpxDisplayPreferencePreference { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for UpdatePaymentMethodConfigurationFpxDisplayPreferencePreference { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for UpdatePaymentMethodConfigurationFpxDisplayPreferencePreference { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// giropay is a German payment method based on online banking, introduced in 2006. +/// It allows customers to complete transactions online using their online banking environment, with funds debited from their bank account. +/// Depending on their bank, customers confirm payments on giropay using a second factor of authentication or a PIN. +/// giropay accounts for 10% of online checkouts in Germany. +/// Check this [page](https://stripe.com/docs/payments/giropay) for more details. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdatePaymentMethodConfigurationGiropay { + /// Whether or not the payment method should be displayed. + #[serde(skip_serializing_if = "Option::is_none")] + pub display_preference: Option, +} +impl UpdatePaymentMethodConfigurationGiropay { + pub fn new() -> Self { + Self::default() + } +} +/// Whether or not the payment method should be displayed. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdatePaymentMethodConfigurationGiropayDisplayPreference { + /// The account's preference for whether or not to display this payment method. + #[serde(skip_serializing_if = "Option::is_none")] + pub preference: Option, +} +impl UpdatePaymentMethodConfigurationGiropayDisplayPreference { + pub fn new() -> Self { + Self::default() + } +} +/// The account's preference for whether or not to display this payment method. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum UpdatePaymentMethodConfigurationGiropayDisplayPreferencePreference { + None, + Off, + On, +} +impl UpdatePaymentMethodConfigurationGiropayDisplayPreferencePreference { + pub fn as_str(self) -> &'static str { + use UpdatePaymentMethodConfigurationGiropayDisplayPreferencePreference::*; + match self { + None => "none", + Off => "off", + On => "on", + } + } +} + +impl std::str::FromStr for UpdatePaymentMethodConfigurationGiropayDisplayPreferencePreference { + type Err = (); + fn from_str(s: &str) -> Result { + use UpdatePaymentMethodConfigurationGiropayDisplayPreferencePreference::*; + match s { + "none" => Ok(None), + "off" => Ok(Off), + "on" => Ok(On), + _ => Err(()), + } + } +} +impl std::fmt::Display for UpdatePaymentMethodConfigurationGiropayDisplayPreferencePreference { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for UpdatePaymentMethodConfigurationGiropayDisplayPreferencePreference { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for UpdatePaymentMethodConfigurationGiropayDisplayPreferencePreference { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Google Pay allows customers to make payments in your app or website using any credit or debit card saved to their Google Account, including those from Google Play, YouTube, Chrome, or an Android device. +/// Use the Google Pay API to request any credit or debit card stored in your customer's Google account. +/// Check this [page](https://stripe.com/docs/google-pay) for more details. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdatePaymentMethodConfigurationGooglePay { + /// Whether or not the payment method should be displayed. + #[serde(skip_serializing_if = "Option::is_none")] + pub display_preference: Option, +} +impl UpdatePaymentMethodConfigurationGooglePay { + pub fn new() -> Self { + Self::default() + } +} +/// Whether or not the payment method should be displayed. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdatePaymentMethodConfigurationGooglePayDisplayPreference { + /// The account's preference for whether or not to display this payment method. + #[serde(skip_serializing_if = "Option::is_none")] + pub preference: Option, +} +impl UpdatePaymentMethodConfigurationGooglePayDisplayPreference { + pub fn new() -> Self { + Self::default() + } +} +/// The account's preference for whether or not to display this payment method. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum UpdatePaymentMethodConfigurationGooglePayDisplayPreferencePreference { + None, + Off, + On, +} +impl UpdatePaymentMethodConfigurationGooglePayDisplayPreferencePreference { + pub fn as_str(self) -> &'static str { + use UpdatePaymentMethodConfigurationGooglePayDisplayPreferencePreference::*; + match self { + None => "none", + Off => "off", + On => "on", + } + } +} + +impl std::str::FromStr for UpdatePaymentMethodConfigurationGooglePayDisplayPreferencePreference { + type Err = (); + fn from_str(s: &str) -> Result { + use UpdatePaymentMethodConfigurationGooglePayDisplayPreferencePreference::*; + match s { + "none" => Ok(None), + "off" => Ok(Off), + "on" => Ok(On), + _ => Err(()), + } + } +} +impl std::fmt::Display for UpdatePaymentMethodConfigurationGooglePayDisplayPreferencePreference { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for UpdatePaymentMethodConfigurationGooglePayDisplayPreferencePreference { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for UpdatePaymentMethodConfigurationGooglePayDisplayPreferencePreference { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// GrabPay is a payment method developed by [Grab](https://www.grab.com/sg/consumer/finance/pay/). +/// GrabPay is a digital wallet - customers maintain a balance in their wallets that they pay out with. +/// Check this [page](https://stripe.com/docs/payments/grabpay) for more details. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdatePaymentMethodConfigurationGrabpay { + /// Whether or not the payment method should be displayed. + #[serde(skip_serializing_if = "Option::is_none")] + pub display_preference: Option, +} +impl UpdatePaymentMethodConfigurationGrabpay { + pub fn new() -> Self { + Self::default() + } +} +/// Whether or not the payment method should be displayed. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdatePaymentMethodConfigurationGrabpayDisplayPreference { + /// The account's preference for whether or not to display this payment method. + #[serde(skip_serializing_if = "Option::is_none")] + pub preference: Option, +} +impl UpdatePaymentMethodConfigurationGrabpayDisplayPreference { + pub fn new() -> Self { + Self::default() + } +} +/// The account's preference for whether or not to display this payment method. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum UpdatePaymentMethodConfigurationGrabpayDisplayPreferencePreference { + None, + Off, + On, +} +impl UpdatePaymentMethodConfigurationGrabpayDisplayPreferencePreference { + pub fn as_str(self) -> &'static str { + use UpdatePaymentMethodConfigurationGrabpayDisplayPreferencePreference::*; + match self { + None => "none", + Off => "off", + On => "on", + } + } +} + +impl std::str::FromStr for UpdatePaymentMethodConfigurationGrabpayDisplayPreferencePreference { + type Err = (); + fn from_str(s: &str) -> Result { + use UpdatePaymentMethodConfigurationGrabpayDisplayPreferencePreference::*; + match s { + "none" => Ok(None), + "off" => Ok(Off), + "on" => Ok(On), + _ => Err(()), + } + } +} +impl std::fmt::Display for UpdatePaymentMethodConfigurationGrabpayDisplayPreferencePreference { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for UpdatePaymentMethodConfigurationGrabpayDisplayPreferencePreference { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for UpdatePaymentMethodConfigurationGrabpayDisplayPreferencePreference { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// iDEAL is a Netherlands-based payment method that allows customers to complete transactions online using their bank credentials. +/// All major Dutch banks are members of Currence, the scheme that operates iDEAL, making it the most popular online payment method in the Netherlands with a share of online transactions close to 55%. +/// Check this [page](https://stripe.com/docs/payments/ideal) for more details. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdatePaymentMethodConfigurationIdeal { + /// Whether or not the payment method should be displayed. + #[serde(skip_serializing_if = "Option::is_none")] + pub display_preference: Option, +} +impl UpdatePaymentMethodConfigurationIdeal { + pub fn new() -> Self { + Self::default() + } +} +/// Whether or not the payment method should be displayed. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdatePaymentMethodConfigurationIdealDisplayPreference { + /// The account's preference for whether or not to display this payment method. + #[serde(skip_serializing_if = "Option::is_none")] + pub preference: Option, +} +impl UpdatePaymentMethodConfigurationIdealDisplayPreference { + pub fn new() -> Self { + Self::default() + } +} +/// The account's preference for whether or not to display this payment method. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum UpdatePaymentMethodConfigurationIdealDisplayPreferencePreference { + None, + Off, + On, +} +impl UpdatePaymentMethodConfigurationIdealDisplayPreferencePreference { + pub fn as_str(self) -> &'static str { + use UpdatePaymentMethodConfigurationIdealDisplayPreferencePreference::*; + match self { + None => "none", + Off => "off", + On => "on", + } + } +} + +impl std::str::FromStr for UpdatePaymentMethodConfigurationIdealDisplayPreferencePreference { + type Err = (); + fn from_str(s: &str) -> Result { + use UpdatePaymentMethodConfigurationIdealDisplayPreferencePreference::*; + match s { + "none" => Ok(None), + "off" => Ok(Off), + "on" => Ok(On), + _ => Err(()), + } + } +} +impl std::fmt::Display for UpdatePaymentMethodConfigurationIdealDisplayPreferencePreference { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for UpdatePaymentMethodConfigurationIdealDisplayPreferencePreference { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for UpdatePaymentMethodConfigurationIdealDisplayPreferencePreference { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// JCB is a credit card company based in Japan. +/// JCB is currently available in Japan to businesses approved by JCB, and available to all businesses in Australia, Canada, Hong Kong, Japan, New Zealand, Singapore, Switzerland, United Kingdom, United States, and all countries in the European Economic Area except Iceland. +/// Check this [page](https://support.stripe.com/questions/accepting-japan-credit-bureau-%28jcb%29-payments) for more details. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdatePaymentMethodConfigurationJcb { + /// Whether or not the payment method should be displayed. + #[serde(skip_serializing_if = "Option::is_none")] + pub display_preference: Option, +} +impl UpdatePaymentMethodConfigurationJcb { + pub fn new() -> Self { + Self::default() + } +} +/// Whether or not the payment method should be displayed. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdatePaymentMethodConfigurationJcbDisplayPreference { + /// The account's preference for whether or not to display this payment method. + #[serde(skip_serializing_if = "Option::is_none")] + pub preference: Option, +} +impl UpdatePaymentMethodConfigurationJcbDisplayPreference { + pub fn new() -> Self { + Self::default() + } +} +/// The account's preference for whether or not to display this payment method. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum UpdatePaymentMethodConfigurationJcbDisplayPreferencePreference { + None, + Off, + On, +} +impl UpdatePaymentMethodConfigurationJcbDisplayPreferencePreference { + pub fn as_str(self) -> &'static str { + use UpdatePaymentMethodConfigurationJcbDisplayPreferencePreference::*; + match self { + None => "none", + Off => "off", + On => "on", + } + } +} + +impl std::str::FromStr for UpdatePaymentMethodConfigurationJcbDisplayPreferencePreference { + type Err = (); + fn from_str(s: &str) -> Result { + use UpdatePaymentMethodConfigurationJcbDisplayPreferencePreference::*; + match s { + "none" => Ok(None), + "off" => Ok(Off), + "on" => Ok(On), + _ => Err(()), + } + } +} +impl std::fmt::Display for UpdatePaymentMethodConfigurationJcbDisplayPreferencePreference { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for UpdatePaymentMethodConfigurationJcbDisplayPreferencePreference { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for UpdatePaymentMethodConfigurationJcbDisplayPreferencePreference { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Klarna gives customers a range of [payment options](https://stripe.com/docs/payments/klarna#payment-options) during checkout. +/// Available payment options vary depending on the customer's billing address and the transaction amount. +/// These payment options make it convenient for customers to purchase items in all price ranges. +/// Check this [page](https://stripe.com/docs/payments/klarna) for more details. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdatePaymentMethodConfigurationKlarna { + /// Whether or not the payment method should be displayed. + #[serde(skip_serializing_if = "Option::is_none")] + pub display_preference: Option, +} +impl UpdatePaymentMethodConfigurationKlarna { + pub fn new() -> Self { + Self::default() + } +} +/// Whether or not the payment method should be displayed. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdatePaymentMethodConfigurationKlarnaDisplayPreference { + /// The account's preference for whether or not to display this payment method. + #[serde(skip_serializing_if = "Option::is_none")] + pub preference: Option, +} +impl UpdatePaymentMethodConfigurationKlarnaDisplayPreference { + pub fn new() -> Self { + Self::default() + } +} +/// The account's preference for whether or not to display this payment method. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum UpdatePaymentMethodConfigurationKlarnaDisplayPreferencePreference { + None, + Off, + On, +} +impl UpdatePaymentMethodConfigurationKlarnaDisplayPreferencePreference { + pub fn as_str(self) -> &'static str { + use UpdatePaymentMethodConfigurationKlarnaDisplayPreferencePreference::*; + match self { + None => "none", + Off => "off", + On => "on", + } + } +} + +impl std::str::FromStr for UpdatePaymentMethodConfigurationKlarnaDisplayPreferencePreference { + type Err = (); + fn from_str(s: &str) -> Result { + use UpdatePaymentMethodConfigurationKlarnaDisplayPreferencePreference::*; + match s { + "none" => Ok(None), + "off" => Ok(Off), + "on" => Ok(On), + _ => Err(()), + } + } +} +impl std::fmt::Display for UpdatePaymentMethodConfigurationKlarnaDisplayPreferencePreference { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for UpdatePaymentMethodConfigurationKlarnaDisplayPreferencePreference { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for UpdatePaymentMethodConfigurationKlarnaDisplayPreferencePreference { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Konbini allows customers in Japan to pay for bills and online purchases at convenience stores with cash. +/// Check this [page](https://stripe.com/docs/payments/konbini) for more details. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdatePaymentMethodConfigurationKonbini { + /// Whether or not the payment method should be displayed. + #[serde(skip_serializing_if = "Option::is_none")] + pub display_preference: Option, +} +impl UpdatePaymentMethodConfigurationKonbini { + pub fn new() -> Self { + Self::default() + } +} +/// Whether or not the payment method should be displayed. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdatePaymentMethodConfigurationKonbiniDisplayPreference { + /// The account's preference for whether or not to display this payment method. + #[serde(skip_serializing_if = "Option::is_none")] + pub preference: Option, +} +impl UpdatePaymentMethodConfigurationKonbiniDisplayPreference { + pub fn new() -> Self { + Self::default() + } +} +/// The account's preference for whether or not to display this payment method. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum UpdatePaymentMethodConfigurationKonbiniDisplayPreferencePreference { + None, + Off, + On, +} +impl UpdatePaymentMethodConfigurationKonbiniDisplayPreferencePreference { + pub fn as_str(self) -> &'static str { + use UpdatePaymentMethodConfigurationKonbiniDisplayPreferencePreference::*; + match self { + None => "none", + Off => "off", + On => "on", + } + } +} + +impl std::str::FromStr for UpdatePaymentMethodConfigurationKonbiniDisplayPreferencePreference { + type Err = (); + fn from_str(s: &str) -> Result { + use UpdatePaymentMethodConfigurationKonbiniDisplayPreferencePreference::*; + match s { + "none" => Ok(None), + "off" => Ok(Off), + "on" => Ok(On), + _ => Err(()), + } + } +} +impl std::fmt::Display for UpdatePaymentMethodConfigurationKonbiniDisplayPreferencePreference { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for UpdatePaymentMethodConfigurationKonbiniDisplayPreferencePreference { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for UpdatePaymentMethodConfigurationKonbiniDisplayPreferencePreference { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// [Link](https://stripe.com/docs/payments/link) is a payment method network. +/// With Link, users save their payment details once, then reuse that information to pay with one click for any business on the network. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdatePaymentMethodConfigurationLink { + /// Whether or not the payment method should be displayed. + #[serde(skip_serializing_if = "Option::is_none")] + pub display_preference: Option, +} +impl UpdatePaymentMethodConfigurationLink { + pub fn new() -> Self { + Self::default() + } +} +/// Whether or not the payment method should be displayed. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdatePaymentMethodConfigurationLinkDisplayPreference { + /// The account's preference for whether or not to display this payment method. + #[serde(skip_serializing_if = "Option::is_none")] + pub preference: Option, +} +impl UpdatePaymentMethodConfigurationLinkDisplayPreference { + pub fn new() -> Self { + Self::default() + } +} +/// The account's preference for whether or not to display this payment method. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum UpdatePaymentMethodConfigurationLinkDisplayPreferencePreference { + None, + Off, + On, +} +impl UpdatePaymentMethodConfigurationLinkDisplayPreferencePreference { + pub fn as_str(self) -> &'static str { + use UpdatePaymentMethodConfigurationLinkDisplayPreferencePreference::*; + match self { + None => "none", + Off => "off", + On => "on", + } + } +} + +impl std::str::FromStr for UpdatePaymentMethodConfigurationLinkDisplayPreferencePreference { + type Err = (); + fn from_str(s: &str) -> Result { + use UpdatePaymentMethodConfigurationLinkDisplayPreferencePreference::*; + match s { + "none" => Ok(None), + "off" => Ok(Off), + "on" => Ok(On), + _ => Err(()), + } + } +} +impl std::fmt::Display for UpdatePaymentMethodConfigurationLinkDisplayPreferencePreference { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for UpdatePaymentMethodConfigurationLinkDisplayPreferencePreference { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for UpdatePaymentMethodConfigurationLinkDisplayPreferencePreference { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// OXXO is a Mexican chain of convenience stores with thousands of locations across Latin America and represents nearly 20% of online transactions in Mexico. +/// OXXO allows customers to pay bills and online purchases in-store with cash. +/// Check this [page](https://stripe.com/docs/payments/oxxo) for more details. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdatePaymentMethodConfigurationOxxo { + /// Whether or not the payment method should be displayed. + #[serde(skip_serializing_if = "Option::is_none")] + pub display_preference: Option, +} +impl UpdatePaymentMethodConfigurationOxxo { + pub fn new() -> Self { + Self::default() + } +} +/// Whether or not the payment method should be displayed. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdatePaymentMethodConfigurationOxxoDisplayPreference { + /// The account's preference for whether or not to display this payment method. + #[serde(skip_serializing_if = "Option::is_none")] + pub preference: Option, +} +impl UpdatePaymentMethodConfigurationOxxoDisplayPreference { + pub fn new() -> Self { + Self::default() + } +} +/// The account's preference for whether or not to display this payment method. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum UpdatePaymentMethodConfigurationOxxoDisplayPreferencePreference { + None, + Off, + On, +} +impl UpdatePaymentMethodConfigurationOxxoDisplayPreferencePreference { + pub fn as_str(self) -> &'static str { + use UpdatePaymentMethodConfigurationOxxoDisplayPreferencePreference::*; + match self { + None => "none", + Off => "off", + On => "on", + } + } +} + +impl std::str::FromStr for UpdatePaymentMethodConfigurationOxxoDisplayPreferencePreference { + type Err = (); + fn from_str(s: &str) -> Result { + use UpdatePaymentMethodConfigurationOxxoDisplayPreferencePreference::*; + match s { + "none" => Ok(None), + "off" => Ok(Off), + "on" => Ok(On), + _ => Err(()), + } + } +} +impl std::fmt::Display for UpdatePaymentMethodConfigurationOxxoDisplayPreferencePreference { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for UpdatePaymentMethodConfigurationOxxoDisplayPreferencePreference { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for UpdatePaymentMethodConfigurationOxxoDisplayPreferencePreference { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Przelewy24 is a Poland-based payment method aggregator that allows customers to complete transactions online using bank transfers and other methods. +/// Bank transfers account for 30% of online payments in Poland and Przelewy24 provides a way for customers to pay with over 165 banks. +/// Check this [page](https://stripe.com/docs/payments/p24) for more details. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdatePaymentMethodConfigurationP24 { + /// Whether or not the payment method should be displayed. + #[serde(skip_serializing_if = "Option::is_none")] + pub display_preference: Option, +} +impl UpdatePaymentMethodConfigurationP24 { + pub fn new() -> Self { + Self::default() + } +} +/// Whether or not the payment method should be displayed. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdatePaymentMethodConfigurationP24DisplayPreference { + /// The account's preference for whether or not to display this payment method. + #[serde(skip_serializing_if = "Option::is_none")] + pub preference: Option, +} +impl UpdatePaymentMethodConfigurationP24DisplayPreference { + pub fn new() -> Self { + Self::default() + } +} +/// The account's preference for whether or not to display this payment method. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum UpdatePaymentMethodConfigurationP24DisplayPreferencePreference { + None, + Off, + On, +} +impl UpdatePaymentMethodConfigurationP24DisplayPreferencePreference { + pub fn as_str(self) -> &'static str { + use UpdatePaymentMethodConfigurationP24DisplayPreferencePreference::*; + match self { + None => "none", + Off => "off", + On => "on", + } + } +} + +impl std::str::FromStr for UpdatePaymentMethodConfigurationP24DisplayPreferencePreference { + type Err = (); + fn from_str(s: &str) -> Result { + use UpdatePaymentMethodConfigurationP24DisplayPreferencePreference::*; + match s { + "none" => Ok(None), + "off" => Ok(Off), + "on" => Ok(On), + _ => Err(()), + } + } +} +impl std::fmt::Display for UpdatePaymentMethodConfigurationP24DisplayPreferencePreference { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for UpdatePaymentMethodConfigurationP24DisplayPreferencePreference { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for UpdatePaymentMethodConfigurationP24DisplayPreferencePreference { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// PayNow is a Singapore-based payment method that allows customers to make a payment using their preferred app from participating banks and participating non-bank financial institutions. +/// Check this [page](https://stripe.com/docs/payments/paynow) for more details. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdatePaymentMethodConfigurationPaynow { + /// Whether or not the payment method should be displayed. + #[serde(skip_serializing_if = "Option::is_none")] + pub display_preference: Option, +} +impl UpdatePaymentMethodConfigurationPaynow { + pub fn new() -> Self { + Self::default() + } +} +/// Whether or not the payment method should be displayed. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdatePaymentMethodConfigurationPaynowDisplayPreference { + /// The account's preference for whether or not to display this payment method. + #[serde(skip_serializing_if = "Option::is_none")] + pub preference: Option, +} +impl UpdatePaymentMethodConfigurationPaynowDisplayPreference { + pub fn new() -> Self { + Self::default() + } +} +/// The account's preference for whether or not to display this payment method. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum UpdatePaymentMethodConfigurationPaynowDisplayPreferencePreference { + None, + Off, + On, +} +impl UpdatePaymentMethodConfigurationPaynowDisplayPreferencePreference { + pub fn as_str(self) -> &'static str { + use UpdatePaymentMethodConfigurationPaynowDisplayPreferencePreference::*; + match self { + None => "none", + Off => "off", + On => "on", + } + } +} + +impl std::str::FromStr for UpdatePaymentMethodConfigurationPaynowDisplayPreferencePreference { + type Err = (); + fn from_str(s: &str) -> Result { + use UpdatePaymentMethodConfigurationPaynowDisplayPreferencePreference::*; + match s { + "none" => Ok(None), + "off" => Ok(Off), + "on" => Ok(On), + _ => Err(()), + } + } +} +impl std::fmt::Display for UpdatePaymentMethodConfigurationPaynowDisplayPreferencePreference { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for UpdatePaymentMethodConfigurationPaynowDisplayPreferencePreference { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for UpdatePaymentMethodConfigurationPaynowDisplayPreferencePreference { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// PayPal, a digital wallet popular with customers in Europe, allows your customers worldwide to pay using their PayPal account. +/// Check this [page](https://stripe.com/docs/payments/paypal) for more details. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdatePaymentMethodConfigurationPaypal { + /// Whether or not the payment method should be displayed. + #[serde(skip_serializing_if = "Option::is_none")] + pub display_preference: Option, +} +impl UpdatePaymentMethodConfigurationPaypal { + pub fn new() -> Self { + Self::default() + } +} +/// Whether or not the payment method should be displayed. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdatePaymentMethodConfigurationPaypalDisplayPreference { + /// The account's preference for whether or not to display this payment method. + #[serde(skip_serializing_if = "Option::is_none")] + pub preference: Option, +} +impl UpdatePaymentMethodConfigurationPaypalDisplayPreference { + pub fn new() -> Self { + Self::default() + } +} +/// The account's preference for whether or not to display this payment method. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum UpdatePaymentMethodConfigurationPaypalDisplayPreferencePreference { + None, + Off, + On, +} +impl UpdatePaymentMethodConfigurationPaypalDisplayPreferencePreference { + pub fn as_str(self) -> &'static str { + use UpdatePaymentMethodConfigurationPaypalDisplayPreferencePreference::*; + match self { + None => "none", + Off => "off", + On => "on", + } + } +} + +impl std::str::FromStr for UpdatePaymentMethodConfigurationPaypalDisplayPreferencePreference { + type Err = (); + fn from_str(s: &str) -> Result { + use UpdatePaymentMethodConfigurationPaypalDisplayPreferencePreference::*; + match s { + "none" => Ok(None), + "off" => Ok(Off), + "on" => Ok(On), + _ => Err(()), + } + } +} +impl std::fmt::Display for UpdatePaymentMethodConfigurationPaypalDisplayPreferencePreference { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for UpdatePaymentMethodConfigurationPaypalDisplayPreferencePreference { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for UpdatePaymentMethodConfigurationPaypalDisplayPreferencePreference { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// PromptPay is a Thailand-based payment method that allows customers to make a payment using their preferred app from participating banks. +/// Check this [page](https://stripe.com/docs/payments/promptpay) for more details. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdatePaymentMethodConfigurationPromptpay { + /// Whether or not the payment method should be displayed. + #[serde(skip_serializing_if = "Option::is_none")] + pub display_preference: Option, +} +impl UpdatePaymentMethodConfigurationPromptpay { + pub fn new() -> Self { + Self::default() + } +} +/// Whether or not the payment method should be displayed. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdatePaymentMethodConfigurationPromptpayDisplayPreference { + /// The account's preference for whether or not to display this payment method. + #[serde(skip_serializing_if = "Option::is_none")] + pub preference: Option, +} +impl UpdatePaymentMethodConfigurationPromptpayDisplayPreference { + pub fn new() -> Self { + Self::default() + } +} +/// The account's preference for whether or not to display this payment method. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum UpdatePaymentMethodConfigurationPromptpayDisplayPreferencePreference { + None, + Off, + On, +} +impl UpdatePaymentMethodConfigurationPromptpayDisplayPreferencePreference { + pub fn as_str(self) -> &'static str { + use UpdatePaymentMethodConfigurationPromptpayDisplayPreferencePreference::*; + match self { + None => "none", + Off => "off", + On => "on", + } + } +} + +impl std::str::FromStr for UpdatePaymentMethodConfigurationPromptpayDisplayPreferencePreference { + type Err = (); + fn from_str(s: &str) -> Result { + use UpdatePaymentMethodConfigurationPromptpayDisplayPreferencePreference::*; + match s { + "none" => Ok(None), + "off" => Ok(Off), + "on" => Ok(On), + _ => Err(()), + } + } +} +impl std::fmt::Display for UpdatePaymentMethodConfigurationPromptpayDisplayPreferencePreference { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for UpdatePaymentMethodConfigurationPromptpayDisplayPreferencePreference { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for UpdatePaymentMethodConfigurationPromptpayDisplayPreferencePreference { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Revolut Pay, developed by Revolut, a global finance app, is a digital wallet payment method. +/// Revolut Pay uses the customer’s stored balance or cards to fund the payment, and offers the option for non-Revolut customers to save their details after their first purchase. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdatePaymentMethodConfigurationRevolutPay { + /// Whether or not the payment method should be displayed. + #[serde(skip_serializing_if = "Option::is_none")] + pub display_preference: Option, +} +impl UpdatePaymentMethodConfigurationRevolutPay { + pub fn new() -> Self { + Self::default() + } +} +/// Whether or not the payment method should be displayed. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdatePaymentMethodConfigurationRevolutPayDisplayPreference { + /// The account's preference for whether or not to display this payment method. + #[serde(skip_serializing_if = "Option::is_none")] + pub preference: Option, +} +impl UpdatePaymentMethodConfigurationRevolutPayDisplayPreference { + pub fn new() -> Self { + Self::default() + } +} +/// The account's preference for whether or not to display this payment method. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum UpdatePaymentMethodConfigurationRevolutPayDisplayPreferencePreference { + None, + Off, + On, +} +impl UpdatePaymentMethodConfigurationRevolutPayDisplayPreferencePreference { + pub fn as_str(self) -> &'static str { + use UpdatePaymentMethodConfigurationRevolutPayDisplayPreferencePreference::*; + match self { + None => "none", + Off => "off", + On => "on", + } + } +} + +impl std::str::FromStr for UpdatePaymentMethodConfigurationRevolutPayDisplayPreferencePreference { + type Err = (); + fn from_str(s: &str) -> Result { + use UpdatePaymentMethodConfigurationRevolutPayDisplayPreferencePreference::*; + match s { + "none" => Ok(None), + "off" => Ok(Off), + "on" => Ok(On), + _ => Err(()), + } + } +} +impl std::fmt::Display for UpdatePaymentMethodConfigurationRevolutPayDisplayPreferencePreference { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for UpdatePaymentMethodConfigurationRevolutPayDisplayPreferencePreference { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for UpdatePaymentMethodConfigurationRevolutPayDisplayPreferencePreference { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// The [Single Euro Payments Area (SEPA)](https://en.wikipedia.org/wiki/Single_Euro_Payments_Area) is an initiative of the European Union to simplify payments within and across member countries. +/// SEPA established and enforced banking standards to allow for the direct debiting of every EUR-denominated bank account within the SEPA region, check this [page](https://stripe.com/docs/payments/sepa-debit) for more details. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdatePaymentMethodConfigurationSepaDebit { + /// Whether or not the payment method should be displayed. + #[serde(skip_serializing_if = "Option::is_none")] + pub display_preference: Option, +} +impl UpdatePaymentMethodConfigurationSepaDebit { + pub fn new() -> Self { + Self::default() + } +} +/// Whether or not the payment method should be displayed. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdatePaymentMethodConfigurationSepaDebitDisplayPreference { + /// The account's preference for whether or not to display this payment method. + #[serde(skip_serializing_if = "Option::is_none")] + pub preference: Option, +} +impl UpdatePaymentMethodConfigurationSepaDebitDisplayPreference { + pub fn new() -> Self { + Self::default() + } +} +/// The account's preference for whether or not to display this payment method. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum UpdatePaymentMethodConfigurationSepaDebitDisplayPreferencePreference { + None, + Off, + On, +} +impl UpdatePaymentMethodConfigurationSepaDebitDisplayPreferencePreference { + pub fn as_str(self) -> &'static str { + use UpdatePaymentMethodConfigurationSepaDebitDisplayPreferencePreference::*; + match self { + None => "none", + Off => "off", + On => "on", + } + } +} + +impl std::str::FromStr for UpdatePaymentMethodConfigurationSepaDebitDisplayPreferencePreference { + type Err = (); + fn from_str(s: &str) -> Result { + use UpdatePaymentMethodConfigurationSepaDebitDisplayPreferencePreference::*; + match s { + "none" => Ok(None), + "off" => Ok(Off), + "on" => Ok(On), + _ => Err(()), + } + } +} +impl std::fmt::Display for UpdatePaymentMethodConfigurationSepaDebitDisplayPreferencePreference { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for UpdatePaymentMethodConfigurationSepaDebitDisplayPreferencePreference { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for UpdatePaymentMethodConfigurationSepaDebitDisplayPreferencePreference { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Stripe users in Europe and the United States can use the [Payment Intents API](https://stripe.com/docs/payments/payment-intents)—a single integration path for creating payments using any supported method—to accept [Sofort](https://www.sofort.com/) payments from customers. +/// Check this [page](https://stripe.com/docs/payments/sofort) for more details. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdatePaymentMethodConfigurationSofort { + /// Whether or not the payment method should be displayed. + #[serde(skip_serializing_if = "Option::is_none")] + pub display_preference: Option, +} +impl UpdatePaymentMethodConfigurationSofort { + pub fn new() -> Self { + Self::default() + } +} +/// Whether or not the payment method should be displayed. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdatePaymentMethodConfigurationSofortDisplayPreference { + /// The account's preference for whether or not to display this payment method. + #[serde(skip_serializing_if = "Option::is_none")] + pub preference: Option, +} +impl UpdatePaymentMethodConfigurationSofortDisplayPreference { + pub fn new() -> Self { + Self::default() + } +} +/// The account's preference for whether or not to display this payment method. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum UpdatePaymentMethodConfigurationSofortDisplayPreferencePreference { + None, + Off, + On, +} +impl UpdatePaymentMethodConfigurationSofortDisplayPreferencePreference { + pub fn as_str(self) -> &'static str { + use UpdatePaymentMethodConfigurationSofortDisplayPreferencePreference::*; + match self { + None => "none", + Off => "off", + On => "on", + } + } +} + +impl std::str::FromStr for UpdatePaymentMethodConfigurationSofortDisplayPreferencePreference { + type Err = (); + fn from_str(s: &str) -> Result { + use UpdatePaymentMethodConfigurationSofortDisplayPreferencePreference::*; + match s { + "none" => Ok(None), + "off" => Ok(Off), + "on" => Ok(On), + _ => Err(()), + } + } +} +impl std::fmt::Display for UpdatePaymentMethodConfigurationSofortDisplayPreferencePreference { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for UpdatePaymentMethodConfigurationSofortDisplayPreferencePreference { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for UpdatePaymentMethodConfigurationSofortDisplayPreferencePreference { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Stripe users in the United States can accept ACH direct debit payments from customers with a US bank account using the Automated Clearing House (ACH) payments system operated by Nacha. +/// Check this [page](https://stripe.com/docs/payments/ach-debit) for more details. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdatePaymentMethodConfigurationUsBankAccount { + /// Whether or not the payment method should be displayed. + #[serde(skip_serializing_if = "Option::is_none")] + pub display_preference: Option, +} +impl UpdatePaymentMethodConfigurationUsBankAccount { + pub fn new() -> Self { + Self::default() + } +} +/// Whether or not the payment method should be displayed. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdatePaymentMethodConfigurationUsBankAccountDisplayPreference { + /// The account's preference for whether or not to display this payment method. + #[serde(skip_serializing_if = "Option::is_none")] + pub preference: + Option, +} +impl UpdatePaymentMethodConfigurationUsBankAccountDisplayPreference { + pub fn new() -> Self { + Self::default() + } +} +/// The account's preference for whether or not to display this payment method. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum UpdatePaymentMethodConfigurationUsBankAccountDisplayPreferencePreference { + None, + Off, + On, +} +impl UpdatePaymentMethodConfigurationUsBankAccountDisplayPreferencePreference { + pub fn as_str(self) -> &'static str { + use UpdatePaymentMethodConfigurationUsBankAccountDisplayPreferencePreference::*; + match self { + None => "none", + Off => "off", + On => "on", + } + } +} + +impl std::str::FromStr + for UpdatePaymentMethodConfigurationUsBankAccountDisplayPreferencePreference +{ + type Err = (); + fn from_str(s: &str) -> Result { + use UpdatePaymentMethodConfigurationUsBankAccountDisplayPreferencePreference::*; + match s { + "none" => Ok(None), + "off" => Ok(Off), + "on" => Ok(On), + _ => Err(()), + } + } +} +impl std::fmt::Display + for UpdatePaymentMethodConfigurationUsBankAccountDisplayPreferencePreference +{ + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for UpdatePaymentMethodConfigurationUsBankAccountDisplayPreferencePreference { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for UpdatePaymentMethodConfigurationUsBankAccountDisplayPreferencePreference { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// WeChat, owned by Tencent, is China's leading mobile app with over 1 billion monthly active users. +/// Chinese consumers can use WeChat Pay to pay for goods and services inside of businesses' apps and websites. +/// WeChat Pay users buy most frequently in gaming, e-commerce, travel, online education, and food/nutrition. +/// Check this [page](https://stripe.com/docs/payments/wechat-pay) for more details. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdatePaymentMethodConfigurationWechatPay { + /// Whether or not the payment method should be displayed. + #[serde(skip_serializing_if = "Option::is_none")] + pub display_preference: Option, +} +impl UpdatePaymentMethodConfigurationWechatPay { + pub fn new() -> Self { + Self::default() + } +} +/// Whether or not the payment method should be displayed. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdatePaymentMethodConfigurationWechatPayDisplayPreference { + /// The account's preference for whether or not to display this payment method. + #[serde(skip_serializing_if = "Option::is_none")] + pub preference: Option, +} +impl UpdatePaymentMethodConfigurationWechatPayDisplayPreference { + pub fn new() -> Self { + Self::default() + } +} +/// The account's preference for whether or not to display this payment method. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum UpdatePaymentMethodConfigurationWechatPayDisplayPreferencePreference { + None, + Off, + On, +} +impl UpdatePaymentMethodConfigurationWechatPayDisplayPreferencePreference { + pub fn as_str(self) -> &'static str { + use UpdatePaymentMethodConfigurationWechatPayDisplayPreferencePreference::*; + match self { + None => "none", + Off => "off", + On => "on", + } + } +} + +impl std::str::FromStr for UpdatePaymentMethodConfigurationWechatPayDisplayPreferencePreference { + type Err = (); + fn from_str(s: &str) -> Result { + use UpdatePaymentMethodConfigurationWechatPayDisplayPreferencePreference::*; + match s { + "none" => Ok(None), + "off" => Ok(Off), + "on" => Ok(On), + _ => Err(()), + } + } +} +impl std::fmt::Display for UpdatePaymentMethodConfigurationWechatPayDisplayPreferencePreference { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for UpdatePaymentMethodConfigurationWechatPayDisplayPreferencePreference { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for UpdatePaymentMethodConfigurationWechatPayDisplayPreferencePreference { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'a> UpdatePaymentMethodConfiguration<'a> { + /// Update payment method configuration + pub fn send( + &self, + client: &stripe::Client, + configuration: &stripe_payment::PaymentMethodConfigurationId, + ) -> stripe::Response { + client.send_form( + &format!("/payment_method_configurations/{configuration}"), + self, + http_types::Method::Post, + ) + } +} diff --git a/generated/stripe_payment/src/payment_method_configuration/types.rs b/generated/stripe_payment/src/payment_method_configuration/types.rs new file mode 100644 index 000000000..2dd733767 --- /dev/null +++ b/generated/stripe_payment/src/payment_method_configuration/types.rs @@ -0,0 +1,115 @@ +/// PaymentMethodConfigurations control which payment methods are displayed to your customers when you don't explicitly specify payment method types. +/// You can have multiple configurations with different sets of payment methods for different scenarios. +/// +/// There are two types of PaymentMethodConfigurations. +/// Which is used depends on the [charge type](https://stripe.com/docs/connect/charges):. +/// +/// **Direct** configurations apply to payments created on your account, including Connect destination charges, Connect separate charges and transfers, and payments not involving Connect. +/// +/// **Child** configurations apply to payments created on your connected accounts using direct charges, and charges with the on_behalf_of parameter. +/// +/// Child configurations have a `parent` that sets default values and controls which settings connected accounts may override. +/// You can specify a parent ID at payment time, and Stripe will automatically resolve the connected account’s associated child configuration. +/// Parent configurations are [managed in the dashboard](https://dashboard.stripe.com/settings/payment_methods/connected_accounts) and are not available in this API. +/// +/// Related guides: +/// - [Payment Method Configurations API](https://stripe.com/docs/connect/payment-method-configurations). +/// - [Multiple configurations on dynamic payment methods](https://stripe.com/docs/payments/multiple-payment-method-configs). +/// - [Multiple configurations for your Connect accounts](https://stripe.com/docs/connect/multiple-payment-method-configurations). +/// +/// For more details see <>. +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct PaymentMethodConfiguration { + #[serde(skip_serializing_if = "Option::is_none")] + pub acss_debit: Option, + /// Whether the configuration can be used for new payments. + pub active: bool, + #[serde(skip_serializing_if = "Option::is_none")] + pub affirm: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub afterpay_clearpay: + Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub alipay: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub apple_pay: Option, + /// For child configs, the Connect application associated with the configuration. + pub application: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub au_becs_debit: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub bacs_debit: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub bancontact: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub blik: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub boleto: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub card: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub cartes_bancaires: + Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub cashapp: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub customer_balance: + Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub eps: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub fpx: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub giropay: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub google_pay: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub grabpay: Option, + /// Unique identifier for the object. + pub id: stripe_payment::PaymentMethodConfigurationId, + #[serde(skip_serializing_if = "Option::is_none")] + pub ideal: Option, + /// The default configuration is used whenever a payment method configuration is not specified. + pub is_default: bool, + #[serde(skip_serializing_if = "Option::is_none")] + pub jcb: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub klarna: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub konbini: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub link: Option, + /// Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + pub livemode: bool, + /// The configuration's name. + pub name: String, + #[serde(skip_serializing_if = "Option::is_none")] + pub oxxo: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub p24: Option, + /// For child configs, the configuration's parent configuration. + pub parent: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub paynow: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub paypal: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub promptpay: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub revolut_pay: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub sepa_debit: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub sofort: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub us_bank_account: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub wechat_pay: Option, +} +impl stripe_types::Object for PaymentMethodConfiguration { + type Id = stripe_payment::PaymentMethodConfigurationId; + fn id(&self) -> &Self::Id { + &self.id + } +} +stripe_types::def_id!(PaymentMethodConfigurationId); diff --git a/generated/stripe_payment/src/payment_method_domain/mod.rs b/generated/stripe_payment/src/payment_method_domain/mod.rs new file mode 100644 index 000000000..48e17e3f0 --- /dev/null +++ b/generated/stripe_payment/src/payment_method_domain/mod.rs @@ -0,0 +1,5 @@ +#[cfg(feature = "payment_method_domain")] +mod requests; +pub(crate) mod types; +#[cfg(feature = "payment_method_domain")] +pub use requests::*; diff --git a/generated/stripe_payment/src/payment_method_domain/requests.rs b/generated/stripe_payment/src/payment_method_domain/requests.rs new file mode 100644 index 000000000..15a45c4a2 --- /dev/null +++ b/generated/stripe_payment/src/payment_method_domain/requests.rs @@ -0,0 +1,153 @@ +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct ListPaymentMethodDomain<'a> { + /// The domain name that this payment method domain object represents. + #[serde(skip_serializing_if = "Option::is_none")] + pub domain_name: Option<&'a str>, + /// Whether this payment method domain is enabled. + /// If the domain is not enabled, payment methods will not appear in Elements. + #[serde(skip_serializing_if = "Option::is_none")] + pub enabled: Option, + /// A cursor for use in pagination. + /// `ending_before` is an object ID that defines your place in the list. + /// For instance, if you make a list request and receive 100 objects, starting with `obj_bar`, your subsequent call can include `ending_before=obj_bar` in order to fetch the previous page of the list. + #[serde(skip_serializing_if = "Option::is_none")] + pub ending_before: Option<&'a str>, + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, + /// A limit on the number of objects to be returned. + /// Limit can range between 1 and 100, and the default is 10. + #[serde(skip_serializing_if = "Option::is_none")] + pub limit: Option, + /// A cursor for use in pagination. + /// `starting_after` is an object ID that defines your place in the list. + /// For instance, if you make a list request and receive 100 objects, ending with `obj_foo`, your subsequent call can include `starting_after=obj_foo` in order to fetch the next page of the list. + #[serde(skip_serializing_if = "Option::is_none")] + pub starting_after: Option<&'a str>, +} +impl<'a> ListPaymentMethodDomain<'a> { + pub fn new() -> Self { + Self::default() + } +} +impl<'a> ListPaymentMethodDomain<'a> { + /// Lists the details of existing payment method domains. + pub fn send( + &self, + client: &stripe::Client, + ) -> stripe::Response> { + client.get_query("/payment_method_domains", self) + } + pub fn paginate( + self, + ) -> stripe::ListPaginator> { + stripe::ListPaginator::from_list_params("/payment_method_domains", self) + } +} +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct RetrievePaymentMethodDomain<'a> { + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, +} +impl<'a> RetrievePaymentMethodDomain<'a> { + pub fn new() -> Self { + Self::default() + } +} +impl<'a> RetrievePaymentMethodDomain<'a> { + /// Retrieves the details of an existing payment method domain. + pub fn send( + &self, + client: &stripe::Client, + payment_method_domain: &stripe_payment::PaymentMethodDomainId, + ) -> stripe::Response { + client.get_query(&format!("/payment_method_domains/{payment_method_domain}"), self) + } +} +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreatePaymentMethodDomain<'a> { + /// The domain name that this payment method domain object represents. + pub domain_name: &'a str, + /// Whether this payment method domain is enabled. + /// If the domain is not enabled, payment methods that require a payment method domain will not appear in Elements. + #[serde(skip_serializing_if = "Option::is_none")] + pub enabled: Option, + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, +} +impl<'a> CreatePaymentMethodDomain<'a> { + pub fn new(domain_name: &'a str) -> Self { + Self { domain_name, enabled: None, expand: None } + } +} +impl<'a> CreatePaymentMethodDomain<'a> { + /// Creates a payment method domain. + pub fn send( + &self, + client: &stripe::Client, + ) -> stripe::Response { + client.send_form("/payment_method_domains", self, http_types::Method::Post) + } +} +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdatePaymentMethodDomain<'a> { + /// Whether this payment method domain is enabled. + /// If the domain is not enabled, payment methods that require a payment method domain will not appear in Elements. + #[serde(skip_serializing_if = "Option::is_none")] + pub enabled: Option, + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, +} +impl<'a> UpdatePaymentMethodDomain<'a> { + pub fn new() -> Self { + Self::default() + } +} +impl<'a> UpdatePaymentMethodDomain<'a> { + /// Updates an existing payment method domain. + pub fn send( + &self, + client: &stripe::Client, + payment_method_domain: &stripe_payment::PaymentMethodDomainId, + ) -> stripe::Response { + client.send_form( + &format!("/payment_method_domains/{payment_method_domain}"), + self, + http_types::Method::Post, + ) + } +} +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct ValidatePaymentMethodDomain<'a> { + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, +} +impl<'a> ValidatePaymentMethodDomain<'a> { + pub fn new() -> Self { + Self::default() + } +} +impl<'a> ValidatePaymentMethodDomain<'a> { + /// Some payment methods such as Apple Pay require additional steps to verify a domain. + /// If the requirements weren’t satisfied when the domain was created, the payment method will be inactive on the domain. + /// The payment method doesn’t appear in Elements for this domain until it is active. + /// + /// To activate a payment method on an existing payment method domain, complete the required validation steps specific to the payment method, and then validate the payment method domain with this endpoint. + /// + /// Related guides: [Payment method domains](https://stripe.com/docs/payments/payment-methods/pmd-registration). + pub fn send( + &self, + client: &stripe::Client, + payment_method_domain: &stripe_payment::PaymentMethodDomainId, + ) -> stripe::Response { + client.send_form( + &format!("/payment_method_domains/{payment_method_domain}/validate"), + self, + http_types::Method::Post, + ) + } +} diff --git a/generated/stripe_payment/src/payment_method_domain/types.rs b/generated/stripe_payment/src/payment_method_domain/types.rs new file mode 100644 index 000000000..432a94292 --- /dev/null +++ b/generated/stripe_payment/src/payment_method_domain/types.rs @@ -0,0 +1,31 @@ +/// A payment method domain represents a web domain that you have registered with Stripe. +/// Stripe Elements use registered payment method domains to control where certain payment methods are shown. +/// +/// Related guides: [Payment method domains](https://stripe.com/docs/payments/payment-methods/pmd-registration). +/// +/// For more details see <>. +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct PaymentMethodDomain { + pub apple_pay: stripe_payment::PaymentMethodDomainResourcePaymentMethodStatus, + /// Time at which the object was created. Measured in seconds since the Unix epoch. + pub created: stripe_types::Timestamp, + /// The domain name that this payment method domain object represents. + pub domain_name: String, + /// Whether this payment method domain is enabled. + /// If the domain is not enabled, payment methods that require a payment method domain will not appear in Elements. + pub enabled: bool, + pub google_pay: stripe_payment::PaymentMethodDomainResourcePaymentMethodStatus, + /// Unique identifier for the object. + pub id: stripe_payment::PaymentMethodDomainId, + pub link: stripe_payment::PaymentMethodDomainResourcePaymentMethodStatus, + /// Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + pub livemode: bool, + pub paypal: stripe_payment::PaymentMethodDomainResourcePaymentMethodStatus, +} +impl stripe_types::Object for PaymentMethodDomain { + type Id = stripe_payment::PaymentMethodDomainId; + fn id(&self) -> &Self::Id { + &self.id + } +} +stripe_types::def_id!(PaymentMethodDomainId); diff --git a/generated/stripe_payment/src/payment_method_domain_resource_payment_method_status.rs b/generated/stripe_payment/src/payment_method_domain_resource_payment_method_status.rs new file mode 100644 index 000000000..1b8e2d061 --- /dev/null +++ b/generated/stripe_payment/src/payment_method_domain_resource_payment_method_status.rs @@ -0,0 +1,66 @@ +/// Indicates the status of a specific payment method on a payment method domain. +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct PaymentMethodDomainResourcePaymentMethodStatus { + /// The status of the payment method on the domain. + pub status: PaymentMethodDomainResourcePaymentMethodStatusStatus, + #[serde(skip_serializing_if = "Option::is_none")] + pub status_details: + Option, +} +/// The status of the payment method on the domain. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum PaymentMethodDomainResourcePaymentMethodStatusStatus { + Active, + Inactive, +} +impl PaymentMethodDomainResourcePaymentMethodStatusStatus { + pub fn as_str(self) -> &'static str { + use PaymentMethodDomainResourcePaymentMethodStatusStatus::*; + match self { + Active => "active", + Inactive => "inactive", + } + } +} + +impl std::str::FromStr for PaymentMethodDomainResourcePaymentMethodStatusStatus { + type Err = (); + fn from_str(s: &str) -> Result { + use PaymentMethodDomainResourcePaymentMethodStatusStatus::*; + match s { + "active" => Ok(Active), + "inactive" => Ok(Inactive), + _ => Err(()), + } + } +} +impl std::fmt::Display for PaymentMethodDomainResourcePaymentMethodStatusStatus { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for PaymentMethodDomainResourcePaymentMethodStatusStatus { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for PaymentMethodDomainResourcePaymentMethodStatusStatus { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for PaymentMethodDomainResourcePaymentMethodStatusStatus { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| { + serde::de::Error::custom( + "Unknown value for PaymentMethodDomainResourcePaymentMethodStatusStatus", + ) + }) + } +} diff --git a/generated/stripe_payment/src/payment_method_domain_resource_payment_method_status_details.rs b/generated/stripe_payment/src/payment_method_domain_resource_payment_method_status_details.rs new file mode 100644 index 000000000..07dcdc569 --- /dev/null +++ b/generated/stripe_payment/src/payment_method_domain_resource_payment_method_status_details.rs @@ -0,0 +1,6 @@ +/// Contains additional details about the status of a payment method for a specific payment method domain. +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct PaymentMethodDomainResourcePaymentMethodStatusDetails { + /// The error message associated with the status of the payment method on the domain. + pub error_message: String, +} diff --git a/generated/stripe_payment/src/source/mod.rs b/generated/stripe_payment/src/source/mod.rs new file mode 100644 index 000000000..434d1a489 --- /dev/null +++ b/generated/stripe_payment/src/source/mod.rs @@ -0,0 +1,4 @@ +#[cfg(feature = "source")] +mod requests; +#[cfg(feature = "source")] +pub use requests::*; diff --git a/generated/stripe_payment/src/source/requests.rs b/generated/stripe_payment/src/source/requests.rs new file mode 100644 index 000000000..e8595713f --- /dev/null +++ b/generated/stripe_payment/src/source/requests.rs @@ -0,0 +1,1272 @@ +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct DetachSource<'a> { + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, +} +impl<'a> DetachSource<'a> { + pub fn new() -> Self { + Self::default() + } +} +impl<'a> DetachSource<'a> { + /// Delete a specified source for a given customer. + pub fn send( + &self, + client: &stripe::Client, + customer: &stripe_shared::CustomerId, + id: &str, + ) -> stripe::Response { + client.send_form( + &format!("/customers/{customer}/sources/{id}"), + self, + http_types::Method::Delete, + ) + } +} +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +#[serde(untagged)] +pub enum DetachSourceReturned { + PaymentSource(stripe_shared::PaymentSource), + DeletedPaymentSource(stripe_shared::DeletedPaymentSource), +} +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct RetrieveSource<'a> { + /// The client secret of the source. Required if a publishable key is used to retrieve the source. + #[serde(skip_serializing_if = "Option::is_none")] + pub client_secret: Option<&'a str>, + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, +} +impl<'a> RetrieveSource<'a> { + pub fn new() -> Self { + Self::default() + } +} +impl<'a> RetrieveSource<'a> { + /// Retrieves an existing source object. + /// Supply the unique source ID from a source creation request and Stripe will return the corresponding up-to-date source object information. + pub fn send( + &self, + client: &stripe::Client, + source: &stripe_shared::SourceId, + ) -> stripe::Response { + client.get_query(&format!("/sources/{source}"), self) + } +} +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct SourceTransactionsSource<'a> { + /// A cursor for use in pagination. + /// `ending_before` is an object ID that defines your place in the list. + /// For instance, if you make a list request and receive 100 objects, starting with `obj_bar`, your subsequent call can include `ending_before=obj_bar` in order to fetch the previous page of the list. + #[serde(skip_serializing_if = "Option::is_none")] + pub ending_before: Option<&'a str>, + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, + /// A limit on the number of objects to be returned. + /// Limit can range between 1 and 100, and the default is 10. + #[serde(skip_serializing_if = "Option::is_none")] + pub limit: Option, + /// A cursor for use in pagination. + /// `starting_after` is an object ID that defines your place in the list. + /// For instance, if you make a list request and receive 100 objects, ending with `obj_foo`, your subsequent call can include `starting_after=obj_foo` in order to fetch the next page of the list. + #[serde(skip_serializing_if = "Option::is_none")] + pub starting_after: Option<&'a str>, +} +impl<'a> SourceTransactionsSource<'a> { + pub fn new() -> Self { + Self::default() + } +} +impl<'a> SourceTransactionsSource<'a> { + /// List source transactions for a given source. + pub fn send( + &self, + client: &stripe::Client, + source: &stripe_shared::SourceId, + ) -> stripe::Response> { + client.get_query(&format!("/sources/{source}/source_transactions"), self) + } + pub fn paginate( + self, + source: &stripe_shared::SourceId, + ) -> stripe::ListPaginator> { + stripe::ListPaginator::from_list_params( + &format!("/sources/{source}/source_transactions"), + self, + ) + } +} +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreateSource<'a> { + /// Amount associated with the source. + /// This is the amount for which the source will be chargeable once ready. + /// Required for `single_use` sources. + /// Not supported for `receiver` type sources, where charge amount may not be specified until funds land. + #[serde(skip_serializing_if = "Option::is_none")] + pub amount: Option, + /// Three-letter [ISO code for the currency](https://stripe.com/docs/currencies) associated with the source. + /// This is the currency for which the source will be chargeable once ready. + #[serde(skip_serializing_if = "Option::is_none")] + pub currency: Option, + /// The `Customer` to whom the original source is attached to. + /// Must be set when the original source is not a `Source` (e.g., `Card`). + #[serde(skip_serializing_if = "Option::is_none")] + pub customer: Option<&'a str>, + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, + /// The authentication `flow` of the source to create. + /// `flow` is one of `redirect`, `receiver`, `code_verification`, `none`. + /// It is generally inferred unless a type supports multiple flows. + #[serde(skip_serializing_if = "Option::is_none")] + pub flow: Option, + /// Information about a mandate possibility attached to a source object (generally for bank debits) as well as its acceptance status. + #[serde(skip_serializing_if = "Option::is_none")] + pub mandate: Option>, + #[serde(skip_serializing_if = "Option::is_none")] + pub metadata: Option<&'a std::collections::HashMap>, + /// The source to share. + #[serde(skip_serializing_if = "Option::is_none")] + pub original_source: Option<&'a str>, + /// Information about the owner of the payment instrument that may be used or required by particular source types. + #[serde(skip_serializing_if = "Option::is_none")] + pub owner: Option>, + /// Optional parameters for the receiver flow. + /// Can be set only if the source is a receiver (`flow` is `receiver`). + #[serde(skip_serializing_if = "Option::is_none")] + pub receiver: Option, + /// Parameters required for the redirect flow. + /// Required if the source is authenticated by a redirect (`flow` is `redirect`). + #[serde(skip_serializing_if = "Option::is_none")] + pub redirect: Option>, + /// Information about the items and shipping associated with the source. + /// Required for transactional credit (for example Klarna) sources before you can charge it. + #[serde(skip_serializing_if = "Option::is_none")] + pub source_order: Option>, + /// An arbitrary string to be displayed on your customer's statement. + /// As an example, if your website is `RunClub` and the item you're charging for is a race ticket, you may want to specify a `statement_descriptor` of `RunClub 5K race ticket.` While many payment types will display this information, some may not display it at all. + #[serde(skip_serializing_if = "Option::is_none")] + pub statement_descriptor: Option<&'a str>, + /// An optional token used to create the source. + /// When passed, token properties will override source parameters. + #[serde(skip_serializing_if = "Option::is_none")] + pub token: Option<&'a str>, + /// The `type` of the source to create. + /// Required unless `customer` and `original_source` are specified (see the [Cloning card Sources](https://stripe.com/docs/sources/connect#cloning-card-sources) guide). + #[serde(rename = "type")] + #[serde(skip_serializing_if = "Option::is_none")] + pub type_: Option<&'a str>, + #[serde(skip_serializing_if = "Option::is_none")] + pub usage: Option, +} +impl<'a> CreateSource<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// The authentication `flow` of the source to create. +/// `flow` is one of `redirect`, `receiver`, `code_verification`, `none`. +/// It is generally inferred unless a type supports multiple flows. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreateSourceFlow { + CodeVerification, + None, + Receiver, + Redirect, +} +impl CreateSourceFlow { + pub fn as_str(self) -> &'static str { + use CreateSourceFlow::*; + match self { + CodeVerification => "code_verification", + None => "none", + Receiver => "receiver", + Redirect => "redirect", + } + } +} + +impl std::str::FromStr for CreateSourceFlow { + type Err = (); + fn from_str(s: &str) -> Result { + use CreateSourceFlow::*; + match s { + "code_verification" => Ok(CodeVerification), + "none" => Ok(None), + "receiver" => Ok(Receiver), + "redirect" => Ok(Redirect), + _ => Err(()), + } + } +} +impl std::fmt::Display for CreateSourceFlow { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreateSourceFlow { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreateSourceFlow { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Information about a mandate possibility attached to a source object (generally for bank debits) as well as its acceptance status. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreateSourceMandate<'a> { + /// The parameters required to notify Stripe of a mandate acceptance or refusal by the customer. + #[serde(skip_serializing_if = "Option::is_none")] + pub acceptance: Option>, + /// The amount specified by the mandate. (Leave null for a mandate covering all amounts) + #[serde(skip_serializing_if = "Option::is_none")] + pub amount: Option, + /// The currency specified by the mandate. (Must match `currency` of the source) + #[serde(skip_serializing_if = "Option::is_none")] + pub currency: Option, + /// The interval of debits permitted by the mandate. + /// Either `one_time` (just permitting a single debit), `scheduled` (with debits on an agreed schedule or for clearly-defined events), or `variable`(for debits with any frequency). + #[serde(skip_serializing_if = "Option::is_none")] + pub interval: Option, + /// The method Stripe should use to notify the customer of upcoming debit instructions and/or mandate confirmation as required by the underlying debit network. + /// Either `email` (an email is sent directly to the customer), `manual` (a `source.mandate_notification` event is sent to your webhooks endpoint and you should handle the notification) or `none` (the underlying debit network does not require any notification). + #[serde(skip_serializing_if = "Option::is_none")] + pub notification_method: Option, +} +impl<'a> CreateSourceMandate<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// The parameters required to notify Stripe of a mandate acceptance or refusal by the customer. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreateSourceMandateAcceptance<'a> { + /// The Unix timestamp (in seconds) when the mandate was accepted or refused by the customer. + #[serde(skip_serializing_if = "Option::is_none")] + pub date: Option, + /// The IP address from which the mandate was accepted or refused by the customer. + #[serde(skip_serializing_if = "Option::is_none")] + pub ip: Option<&'a str>, + /// The parameters required to store a mandate accepted offline. + /// Should only be set if `mandate[type]` is `offline`. + #[serde(skip_serializing_if = "Option::is_none")] + pub offline: Option>, + /// The parameters required to store a mandate accepted online. + /// Should only be set if `mandate[type]` is `online`. + #[serde(skip_serializing_if = "Option::is_none")] + pub online: Option>, + /// The status of the mandate acceptance. + /// Either `accepted` (the mandate was accepted) or `refused` (the mandate was refused). + pub status: CreateSourceMandateAcceptanceStatus, + /// The type of acceptance information included with the mandate. Either `online` or `offline` + #[serde(rename = "type")] + #[serde(skip_serializing_if = "Option::is_none")] + pub type_: Option, + /// The user agent of the browser from which the mandate was accepted or refused by the customer. + #[serde(skip_serializing_if = "Option::is_none")] + pub user_agent: Option<&'a str>, +} +impl<'a> CreateSourceMandateAcceptance<'a> { + pub fn new(status: CreateSourceMandateAcceptanceStatus) -> Self { + Self { + date: None, + ip: None, + offline: None, + online: None, + status, + type_: None, + user_agent: None, + } + } +} +/// The status of the mandate acceptance. +/// Either `accepted` (the mandate was accepted) or `refused` (the mandate was refused). +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreateSourceMandateAcceptanceStatus { + Accepted, + Pending, + Refused, + Revoked, +} +impl CreateSourceMandateAcceptanceStatus { + pub fn as_str(self) -> &'static str { + use CreateSourceMandateAcceptanceStatus::*; + match self { + Accepted => "accepted", + Pending => "pending", + Refused => "refused", + Revoked => "revoked", + } + } +} + +impl std::str::FromStr for CreateSourceMandateAcceptanceStatus { + type Err = (); + fn from_str(s: &str) -> Result { + use CreateSourceMandateAcceptanceStatus::*; + match s { + "accepted" => Ok(Accepted), + "pending" => Ok(Pending), + "refused" => Ok(Refused), + "revoked" => Ok(Revoked), + _ => Err(()), + } + } +} +impl std::fmt::Display for CreateSourceMandateAcceptanceStatus { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreateSourceMandateAcceptanceStatus { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreateSourceMandateAcceptanceStatus { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// The type of acceptance information included with the mandate. Either `online` or `offline` +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreateSourceMandateAcceptanceType { + Offline, + Online, +} +impl CreateSourceMandateAcceptanceType { + pub fn as_str(self) -> &'static str { + use CreateSourceMandateAcceptanceType::*; + match self { + Offline => "offline", + Online => "online", + } + } +} + +impl std::str::FromStr for CreateSourceMandateAcceptanceType { + type Err = (); + fn from_str(s: &str) -> Result { + use CreateSourceMandateAcceptanceType::*; + match s { + "offline" => Ok(Offline), + "online" => Ok(Online), + _ => Err(()), + } + } +} +impl std::fmt::Display for CreateSourceMandateAcceptanceType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreateSourceMandateAcceptanceType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreateSourceMandateAcceptanceType { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// The interval of debits permitted by the mandate. +/// Either `one_time` (just permitting a single debit), `scheduled` (with debits on an agreed schedule or for clearly-defined events), or `variable`(for debits with any frequency). +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreateSourceMandateInterval { + OneTime, + Scheduled, + Variable, +} +impl CreateSourceMandateInterval { + pub fn as_str(self) -> &'static str { + use CreateSourceMandateInterval::*; + match self { + OneTime => "one_time", + Scheduled => "scheduled", + Variable => "variable", + } + } +} + +impl std::str::FromStr for CreateSourceMandateInterval { + type Err = (); + fn from_str(s: &str) -> Result { + use CreateSourceMandateInterval::*; + match s { + "one_time" => Ok(OneTime), + "scheduled" => Ok(Scheduled), + "variable" => Ok(Variable), + _ => Err(()), + } + } +} +impl std::fmt::Display for CreateSourceMandateInterval { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreateSourceMandateInterval { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreateSourceMandateInterval { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// The method Stripe should use to notify the customer of upcoming debit instructions and/or mandate confirmation as required by the underlying debit network. +/// Either `email` (an email is sent directly to the customer), `manual` (a `source.mandate_notification` event is sent to your webhooks endpoint and you should handle the notification) or `none` (the underlying debit network does not require any notification). +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreateSourceMandateNotificationMethod { + DeprecatedNone, + Email, + Manual, + None, + StripeEmail, +} +impl CreateSourceMandateNotificationMethod { + pub fn as_str(self) -> &'static str { + use CreateSourceMandateNotificationMethod::*; + match self { + DeprecatedNone => "deprecated_none", + Email => "email", + Manual => "manual", + None => "none", + StripeEmail => "stripe_email", + } + } +} + +impl std::str::FromStr for CreateSourceMandateNotificationMethod { + type Err = (); + fn from_str(s: &str) -> Result { + use CreateSourceMandateNotificationMethod::*; + match s { + "deprecated_none" => Ok(DeprecatedNone), + "email" => Ok(Email), + "manual" => Ok(Manual), + "none" => Ok(None), + "stripe_email" => Ok(StripeEmail), + _ => Err(()), + } + } +} +impl std::fmt::Display for CreateSourceMandateNotificationMethod { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreateSourceMandateNotificationMethod { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreateSourceMandateNotificationMethod { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Optional parameters for the receiver flow. +/// Can be set only if the source is a receiver (`flow` is `receiver`). +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreateSourceReceiver { + /// The method Stripe should use to request information needed to process a refund or mispayment. + /// Either `email` (an email is sent directly to the customer) or `manual` (a `source.refund_attributes_required` event is sent to your webhooks endpoint). + /// Refer to each payment method's documentation to learn which refund attributes may be required. + #[serde(skip_serializing_if = "Option::is_none")] + pub refund_attributes_method: Option, +} +impl CreateSourceReceiver { + pub fn new() -> Self { + Self::default() + } +} +/// The method Stripe should use to request information needed to process a refund or mispayment. +/// Either `email` (an email is sent directly to the customer) or `manual` (a `source.refund_attributes_required` event is sent to your webhooks endpoint). +/// Refer to each payment method's documentation to learn which refund attributes may be required. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreateSourceReceiverRefundAttributesMethod { + Email, + Manual, + None, +} +impl CreateSourceReceiverRefundAttributesMethod { + pub fn as_str(self) -> &'static str { + use CreateSourceReceiverRefundAttributesMethod::*; + match self { + Email => "email", + Manual => "manual", + None => "none", + } + } +} + +impl std::str::FromStr for CreateSourceReceiverRefundAttributesMethod { + type Err = (); + fn from_str(s: &str) -> Result { + use CreateSourceReceiverRefundAttributesMethod::*; + match s { + "email" => Ok(Email), + "manual" => Ok(Manual), + "none" => Ok(None), + _ => Err(()), + } + } +} +impl std::fmt::Display for CreateSourceReceiverRefundAttributesMethod { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreateSourceReceiverRefundAttributesMethod { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreateSourceReceiverRefundAttributesMethod { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Parameters required for the redirect flow. +/// Required if the source is authenticated by a redirect (`flow` is `redirect`). +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreateSourceRedirect<'a> { + /// The URL you provide to redirect the customer back to you after they authenticated their payment. + /// It can use your application URI scheme in the context of a mobile application. + pub return_url: &'a str, +} +impl<'a> CreateSourceRedirect<'a> { + pub fn new(return_url: &'a str) -> Self { + Self { return_url } + } +} +/// Information about the items and shipping associated with the source. +/// Required for transactional credit (for example Klarna) sources before you can charge it. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreateSourceSourceOrder<'a> { + /// List of items constituting the order. + #[serde(skip_serializing_if = "Option::is_none")] + pub items: Option<&'a [CreateSourceSourceOrderItems<'a>]>, + /// Shipping address for the order. + /// Required if any of the SKUs are for products that have `shippable` set to true. + #[serde(skip_serializing_if = "Option::is_none")] + pub shipping: Option>, +} +impl<'a> CreateSourceSourceOrder<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// List of items constituting the order. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreateSourceSourceOrderItems<'a> { + #[serde(skip_serializing_if = "Option::is_none")] + pub amount: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub currency: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub description: Option<&'a str>, + /// The ID of the SKU being ordered. + #[serde(skip_serializing_if = "Option::is_none")] + pub parent: Option<&'a str>, + /// The quantity of this order item. + /// When type is `sku`, this is the number of instances of the SKU to be ordered. + #[serde(skip_serializing_if = "Option::is_none")] + pub quantity: Option, + #[serde(rename = "type")] + #[serde(skip_serializing_if = "Option::is_none")] + pub type_: Option, +} +impl<'a> CreateSourceSourceOrderItems<'a> { + pub fn new() -> Self { + Self::default() + } +} +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreateSourceSourceOrderItemsType { + Discount, + Shipping, + Sku, + Tax, +} +impl CreateSourceSourceOrderItemsType { + pub fn as_str(self) -> &'static str { + use CreateSourceSourceOrderItemsType::*; + match self { + Discount => "discount", + Shipping => "shipping", + Sku => "sku", + Tax => "tax", + } + } +} + +impl std::str::FromStr for CreateSourceSourceOrderItemsType { + type Err = (); + fn from_str(s: &str) -> Result { + use CreateSourceSourceOrderItemsType::*; + match s { + "discount" => Ok(Discount), + "shipping" => Ok(Shipping), + "sku" => Ok(Sku), + "tax" => Ok(Tax), + _ => Err(()), + } + } +} +impl std::fmt::Display for CreateSourceSourceOrderItemsType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreateSourceSourceOrderItemsType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreateSourceSourceOrderItemsType { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreateSourceUsage { + Reusable, + SingleUse, +} +impl CreateSourceUsage { + pub fn as_str(self) -> &'static str { + use CreateSourceUsage::*; + match self { + Reusable => "reusable", + SingleUse => "single_use", + } + } +} + +impl std::str::FromStr for CreateSourceUsage { + type Err = (); + fn from_str(s: &str) -> Result { + use CreateSourceUsage::*; + match s { + "reusable" => Ok(Reusable), + "single_use" => Ok(SingleUse), + _ => Err(()), + } + } +} +impl std::fmt::Display for CreateSourceUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreateSourceUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreateSourceUsage { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'a> CreateSource<'a> { + /// Creates a new source object. + pub fn send(&self, client: &stripe::Client) -> stripe::Response { + client.send_form("/sources", self, http_types::Method::Post) + } +} +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdateSource<'a> { + /// Amount associated with the source. + #[serde(skip_serializing_if = "Option::is_none")] + pub amount: Option, + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, + /// Information about a mandate possibility attached to a source object (generally for bank debits) as well as its acceptance status. + #[serde(skip_serializing_if = "Option::is_none")] + pub mandate: Option>, + /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. + /// This can be useful for storing additional information about the object in a structured format. + /// Individual keys can be unset by posting an empty value to them. + /// All keys can be unset by posting an empty value to `metadata`. + #[serde(skip_serializing_if = "Option::is_none")] + pub metadata: Option<&'a std::collections::HashMap>, + /// Information about the owner of the payment instrument that may be used or required by particular source types. + #[serde(skip_serializing_if = "Option::is_none")] + pub owner: Option>, + /// Information about the items and shipping associated with the source. + /// Required for transactional credit (for example Klarna) sources before you can charge it. + #[serde(skip_serializing_if = "Option::is_none")] + pub source_order: Option>, +} +impl<'a> UpdateSource<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// Information about a mandate possibility attached to a source object (generally for bank debits) as well as its acceptance status. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdateSourceMandate<'a> { + /// The parameters required to notify Stripe of a mandate acceptance or refusal by the customer. + #[serde(skip_serializing_if = "Option::is_none")] + pub acceptance: Option>, + /// The amount specified by the mandate. (Leave null for a mandate covering all amounts) + #[serde(skip_serializing_if = "Option::is_none")] + pub amount: Option, + /// The currency specified by the mandate. (Must match `currency` of the source) + #[serde(skip_serializing_if = "Option::is_none")] + pub currency: Option, + /// The interval of debits permitted by the mandate. + /// Either `one_time` (just permitting a single debit), `scheduled` (with debits on an agreed schedule or for clearly-defined events), or `variable`(for debits with any frequency). + #[serde(skip_serializing_if = "Option::is_none")] + pub interval: Option, + /// The method Stripe should use to notify the customer of upcoming debit instructions and/or mandate confirmation as required by the underlying debit network. + /// Either `email` (an email is sent directly to the customer), `manual` (a `source.mandate_notification` event is sent to your webhooks endpoint and you should handle the notification) or `none` (the underlying debit network does not require any notification). + #[serde(skip_serializing_if = "Option::is_none")] + pub notification_method: Option, +} +impl<'a> UpdateSourceMandate<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// The parameters required to notify Stripe of a mandate acceptance or refusal by the customer. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct UpdateSourceMandateAcceptance<'a> { + /// The Unix timestamp (in seconds) when the mandate was accepted or refused by the customer. + #[serde(skip_serializing_if = "Option::is_none")] + pub date: Option, + /// The IP address from which the mandate was accepted or refused by the customer. + #[serde(skip_serializing_if = "Option::is_none")] + pub ip: Option<&'a str>, + /// The parameters required to store a mandate accepted offline. + /// Should only be set if `mandate[type]` is `offline`. + #[serde(skip_serializing_if = "Option::is_none")] + pub offline: Option>, + /// The parameters required to store a mandate accepted online. + /// Should only be set if `mandate[type]` is `online`. + #[serde(skip_serializing_if = "Option::is_none")] + pub online: Option>, + /// The status of the mandate acceptance. + /// Either `accepted` (the mandate was accepted) or `refused` (the mandate was refused). + pub status: UpdateSourceMandateAcceptanceStatus, + /// The type of acceptance information included with the mandate. Either `online` or `offline` + #[serde(rename = "type")] + #[serde(skip_serializing_if = "Option::is_none")] + pub type_: Option, + /// The user agent of the browser from which the mandate was accepted or refused by the customer. + #[serde(skip_serializing_if = "Option::is_none")] + pub user_agent: Option<&'a str>, +} +impl<'a> UpdateSourceMandateAcceptance<'a> { + pub fn new(status: UpdateSourceMandateAcceptanceStatus) -> Self { + Self { + date: None, + ip: None, + offline: None, + online: None, + status, + type_: None, + user_agent: None, + } + } +} +/// The status of the mandate acceptance. +/// Either `accepted` (the mandate was accepted) or `refused` (the mandate was refused). +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum UpdateSourceMandateAcceptanceStatus { + Accepted, + Pending, + Refused, + Revoked, +} +impl UpdateSourceMandateAcceptanceStatus { + pub fn as_str(self) -> &'static str { + use UpdateSourceMandateAcceptanceStatus::*; + match self { + Accepted => "accepted", + Pending => "pending", + Refused => "refused", + Revoked => "revoked", + } + } +} + +impl std::str::FromStr for UpdateSourceMandateAcceptanceStatus { + type Err = (); + fn from_str(s: &str) -> Result { + use UpdateSourceMandateAcceptanceStatus::*; + match s { + "accepted" => Ok(Accepted), + "pending" => Ok(Pending), + "refused" => Ok(Refused), + "revoked" => Ok(Revoked), + _ => Err(()), + } + } +} +impl std::fmt::Display for UpdateSourceMandateAcceptanceStatus { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for UpdateSourceMandateAcceptanceStatus { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for UpdateSourceMandateAcceptanceStatus { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// The type of acceptance information included with the mandate. Either `online` or `offline` +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum UpdateSourceMandateAcceptanceType { + Offline, + Online, +} +impl UpdateSourceMandateAcceptanceType { + pub fn as_str(self) -> &'static str { + use UpdateSourceMandateAcceptanceType::*; + match self { + Offline => "offline", + Online => "online", + } + } +} + +impl std::str::FromStr for UpdateSourceMandateAcceptanceType { + type Err = (); + fn from_str(s: &str) -> Result { + use UpdateSourceMandateAcceptanceType::*; + match s { + "offline" => Ok(Offline), + "online" => Ok(Online), + _ => Err(()), + } + } +} +impl std::fmt::Display for UpdateSourceMandateAcceptanceType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for UpdateSourceMandateAcceptanceType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for UpdateSourceMandateAcceptanceType { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// The interval of debits permitted by the mandate. +/// Either `one_time` (just permitting a single debit), `scheduled` (with debits on an agreed schedule or for clearly-defined events), or `variable`(for debits with any frequency). +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum UpdateSourceMandateInterval { + OneTime, + Scheduled, + Variable, +} +impl UpdateSourceMandateInterval { + pub fn as_str(self) -> &'static str { + use UpdateSourceMandateInterval::*; + match self { + OneTime => "one_time", + Scheduled => "scheduled", + Variable => "variable", + } + } +} + +impl std::str::FromStr for UpdateSourceMandateInterval { + type Err = (); + fn from_str(s: &str) -> Result { + use UpdateSourceMandateInterval::*; + match s { + "one_time" => Ok(OneTime), + "scheduled" => Ok(Scheduled), + "variable" => Ok(Variable), + _ => Err(()), + } + } +} +impl std::fmt::Display for UpdateSourceMandateInterval { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for UpdateSourceMandateInterval { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for UpdateSourceMandateInterval { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// The method Stripe should use to notify the customer of upcoming debit instructions and/or mandate confirmation as required by the underlying debit network. +/// Either `email` (an email is sent directly to the customer), `manual` (a `source.mandate_notification` event is sent to your webhooks endpoint and you should handle the notification) or `none` (the underlying debit network does not require any notification). +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum UpdateSourceMandateNotificationMethod { + DeprecatedNone, + Email, + Manual, + None, + StripeEmail, +} +impl UpdateSourceMandateNotificationMethod { + pub fn as_str(self) -> &'static str { + use UpdateSourceMandateNotificationMethod::*; + match self { + DeprecatedNone => "deprecated_none", + Email => "email", + Manual => "manual", + None => "none", + StripeEmail => "stripe_email", + } + } +} + +impl std::str::FromStr for UpdateSourceMandateNotificationMethod { + type Err = (); + fn from_str(s: &str) -> Result { + use UpdateSourceMandateNotificationMethod::*; + match s { + "deprecated_none" => Ok(DeprecatedNone), + "email" => Ok(Email), + "manual" => Ok(Manual), + "none" => Ok(None), + "stripe_email" => Ok(StripeEmail), + _ => Err(()), + } + } +} +impl std::fmt::Display for UpdateSourceMandateNotificationMethod { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for UpdateSourceMandateNotificationMethod { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for UpdateSourceMandateNotificationMethod { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Information about the items and shipping associated with the source. +/// Required for transactional credit (for example Klarna) sources before you can charge it. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdateSourceSourceOrder<'a> { + /// List of items constituting the order. + #[serde(skip_serializing_if = "Option::is_none")] + pub items: Option<&'a [UpdateSourceSourceOrderItems<'a>]>, + /// Shipping address for the order. + /// Required if any of the SKUs are for products that have `shippable` set to true. + #[serde(skip_serializing_if = "Option::is_none")] + pub shipping: Option>, +} +impl<'a> UpdateSourceSourceOrder<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// List of items constituting the order. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdateSourceSourceOrderItems<'a> { + #[serde(skip_serializing_if = "Option::is_none")] + pub amount: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub currency: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub description: Option<&'a str>, + /// The ID of the SKU being ordered. + #[serde(skip_serializing_if = "Option::is_none")] + pub parent: Option<&'a str>, + /// The quantity of this order item. + /// When type is `sku`, this is the number of instances of the SKU to be ordered. + #[serde(skip_serializing_if = "Option::is_none")] + pub quantity: Option, + #[serde(rename = "type")] + #[serde(skip_serializing_if = "Option::is_none")] + pub type_: Option, +} +impl<'a> UpdateSourceSourceOrderItems<'a> { + pub fn new() -> Self { + Self::default() + } +} +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum UpdateSourceSourceOrderItemsType { + Discount, + Shipping, + Sku, + Tax, +} +impl UpdateSourceSourceOrderItemsType { + pub fn as_str(self) -> &'static str { + use UpdateSourceSourceOrderItemsType::*; + match self { + Discount => "discount", + Shipping => "shipping", + Sku => "sku", + Tax => "tax", + } + } +} + +impl std::str::FromStr for UpdateSourceSourceOrderItemsType { + type Err = (); + fn from_str(s: &str) -> Result { + use UpdateSourceSourceOrderItemsType::*; + match s { + "discount" => Ok(Discount), + "shipping" => Ok(Shipping), + "sku" => Ok(Sku), + "tax" => Ok(Tax), + _ => Err(()), + } + } +} +impl std::fmt::Display for UpdateSourceSourceOrderItemsType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for UpdateSourceSourceOrderItemsType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for UpdateSourceSourceOrderItemsType { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'a> UpdateSource<'a> { + /// Updates the specified source by setting the values of the parameters passed. + /// Any parameters not provided will be left unchanged. + /// + /// This request accepts the `metadata` and `owner` as arguments. + /// It is also possible to update type specific information for selected payment methods. + /// Please refer to our [payment method guides](https://stripe.com/docs/sources) for more detail. + pub fn send( + &self, + client: &stripe::Client, + source: &stripe_shared::SourceId, + ) -> stripe::Response { + client.send_form(&format!("/sources/{source}"), self, http_types::Method::Post) + } +} +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct VerifySource<'a> { + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, + /// The values needed to verify the source. + pub values: &'a [&'a str], +} +impl<'a> VerifySource<'a> { + pub fn new(values: &'a [&'a str]) -> Self { + Self { expand: None, values } + } +} +impl<'a> VerifySource<'a> { + /// Verify a given source. + pub fn send( + &self, + client: &stripe::Client, + source: &stripe_shared::SourceId, + ) -> stripe::Response { + client.send_form(&format!("/sources/{source}/verify"), self, http_types::Method::Post) + } +} +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct MandateOfflineAcceptanceParams<'a> { + /// An email to contact you with if a copy of the mandate is requested, required if `type` is `offline`. + pub contact_email: &'a str, +} +impl<'a> MandateOfflineAcceptanceParams<'a> { + pub fn new(contact_email: &'a str) -> Self { + Self { contact_email } + } +} +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct MandateOnlineAcceptanceParams<'a> { + /// The Unix timestamp (in seconds) when the mandate was accepted or refused by the customer. + #[serde(skip_serializing_if = "Option::is_none")] + pub date: Option, + /// The IP address from which the mandate was accepted or refused by the customer. + #[serde(skip_serializing_if = "Option::is_none")] + pub ip: Option<&'a str>, + /// The user agent of the browser from which the mandate was accepted or refused by the customer. + #[serde(skip_serializing_if = "Option::is_none")] + pub user_agent: Option<&'a str>, +} +impl<'a> MandateOnlineAcceptanceParams<'a> { + pub fn new() -> Self { + Self::default() + } +} +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct SourceAddress<'a> { + /// City, district, suburb, town, or village. + #[serde(skip_serializing_if = "Option::is_none")] + pub city: Option<&'a str>, + /// Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). + #[serde(skip_serializing_if = "Option::is_none")] + pub country: Option<&'a str>, + /// Address line 1 (e.g., street, PO Box, or company name). + #[serde(skip_serializing_if = "Option::is_none")] + pub line1: Option<&'a str>, + /// Address line 2 (e.g., apartment, suite, unit, or building). + #[serde(skip_serializing_if = "Option::is_none")] + pub line2: Option<&'a str>, + /// ZIP or postal code. + #[serde(skip_serializing_if = "Option::is_none")] + pub postal_code: Option<&'a str>, + /// State, county, province, or region. + #[serde(skip_serializing_if = "Option::is_none")] + pub state: Option<&'a str>, +} +impl<'a> SourceAddress<'a> { + pub fn new() -> Self { + Self::default() + } +} +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct Address<'a> { + /// City, district, suburb, town, or village. + #[serde(skip_serializing_if = "Option::is_none")] + pub city: Option<&'a str>, + /// Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). + #[serde(skip_serializing_if = "Option::is_none")] + pub country: Option<&'a str>, + /// Address line 1 (e.g., street, PO Box, or company name). + pub line1: &'a str, + /// Address line 2 (e.g., apartment, suite, unit, or building). + #[serde(skip_serializing_if = "Option::is_none")] + pub line2: Option<&'a str>, + /// ZIP or postal code. + #[serde(skip_serializing_if = "Option::is_none")] + pub postal_code: Option<&'a str>, + /// State, county, province, or region. + #[serde(skip_serializing_if = "Option::is_none")] + pub state: Option<&'a str>, +} +impl<'a> Address<'a> { + pub fn new(line1: &'a str) -> Self { + Self { city: None, country: None, line1, line2: None, postal_code: None, state: None } + } +} +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct Owner<'a> { + /// Owner's address. + #[serde(skip_serializing_if = "Option::is_none")] + pub address: Option>, + /// Owner's email address. + #[serde(skip_serializing_if = "Option::is_none")] + pub email: Option<&'a str>, + /// Owner's full name. + #[serde(skip_serializing_if = "Option::is_none")] + pub name: Option<&'a str>, + /// Owner's phone number. + #[serde(skip_serializing_if = "Option::is_none")] + pub phone: Option<&'a str>, +} +impl<'a> Owner<'a> { + pub fn new() -> Self { + Self::default() + } +} +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct OrderShipping<'a> { + /// Shipping address. + pub address: Address<'a>, + /// The delivery service that shipped a physical product, such as Fedex, UPS, USPS, etc. + #[serde(skip_serializing_if = "Option::is_none")] + pub carrier: Option<&'a str>, + /// Recipient name. + #[serde(skip_serializing_if = "Option::is_none")] + pub name: Option<&'a str>, + /// Recipient phone (including extension). + #[serde(skip_serializing_if = "Option::is_none")] + pub phone: Option<&'a str>, + /// The tracking number for a physical product, obtained from the delivery service. + /// If multiple tracking numbers were generated for this purchase, please separate them with commas. + #[serde(skip_serializing_if = "Option::is_none")] + pub tracking_number: Option<&'a str>, +} +impl<'a> OrderShipping<'a> { + pub fn new(address: Address<'a>) -> Self { + Self { address, carrier: None, name: None, phone: None, tracking_number: None } + } +} diff --git a/generated/stripe_payment/src/source_mandate_notification.rs b/generated/stripe_payment/src/source_mandate_notification.rs new file mode 100644 index 000000000..66ecbc19c --- /dev/null +++ b/generated/stripe_payment/src/source_mandate_notification.rs @@ -0,0 +1,38 @@ +/// Source mandate notifications should be created when a notification related to +/// a source mandate must be sent to the payer. They will trigger a webhook or +/// deliver an email to the customer. +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct SourceMandateNotification { + #[serde(skip_serializing_if = "Option::is_none")] + pub acss_debit: Option, + /// A positive integer in the smallest currency unit (that is, 100 cents for $1.00, or 1 for ¥1, Japanese Yen being a zero-decimal currency) representing the amount associated with the mandate notification. + /// The amount is expressed in the currency of the underlying source. + /// Required if the notification type is `debit_initiated`. + pub amount: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub bacs_debit: Option, + /// Time at which the object was created. Measured in seconds since the Unix epoch. + pub created: stripe_types::Timestamp, + /// Unique identifier for the object. + pub id: stripe_payment::SourceMandateNotificationId, + /// Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + pub livemode: bool, + /// The reason of the mandate notification. Valid reasons are `mandate_confirmed` or `debit_initiated`. + pub reason: String, + #[serde(skip_serializing_if = "Option::is_none")] + pub sepa_debit: Option, + pub source: stripe_shared::Source, + /// The status of the mandate notification. Valid statuses are `pending` or `submitted`. + pub status: String, + /// The type of source this mandate notification is attached to. + /// Should be the source type identifier code for the payment method, such as `three_d_secure`. + #[serde(rename = "type")] + pub type_: String, +} +impl stripe_types::Object for SourceMandateNotification { + type Id = stripe_payment::SourceMandateNotificationId; + fn id(&self) -> &Self::Id { + &self.id + } +} +stripe_types::def_id!(SourceMandateNotificationId); diff --git a/generated/stripe_payment/src/source_mandate_notification_acss_debit_data.rs b/generated/stripe_payment/src/source_mandate_notification_acss_debit_data.rs new file mode 100644 index 000000000..6e8b5c44e --- /dev/null +++ b/generated/stripe_payment/src/source_mandate_notification_acss_debit_data.rs @@ -0,0 +1,6 @@ +#[derive(Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct SourceMandateNotificationAcssDebitData { + /// The statement descriptor associate with the debit. + #[serde(skip_serializing_if = "Option::is_none")] + pub statement_descriptor: Option, +} diff --git a/generated/stripe_payment/src/source_mandate_notification_bacs_debit_data.rs b/generated/stripe_payment/src/source_mandate_notification_bacs_debit_data.rs new file mode 100644 index 000000000..214203f0b --- /dev/null +++ b/generated/stripe_payment/src/source_mandate_notification_bacs_debit_data.rs @@ -0,0 +1,6 @@ +#[derive(Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct SourceMandateNotificationBacsDebitData { + /// Last 4 digits of the account number associated with the debit. + #[serde(skip_serializing_if = "Option::is_none")] + pub last4: Option, +} diff --git a/generated/stripe_payment/src/source_mandate_notification_sepa_debit_data.rs b/generated/stripe_payment/src/source_mandate_notification_sepa_debit_data.rs new file mode 100644 index 000000000..1ac22700e --- /dev/null +++ b/generated/stripe_payment/src/source_mandate_notification_sepa_debit_data.rs @@ -0,0 +1,12 @@ +#[derive(Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct SourceMandateNotificationSepaDebitData { + /// SEPA creditor ID. + #[serde(skip_serializing_if = "Option::is_none")] + pub creditor_identifier: Option, + /// Last 4 digits of the account number associated with the debit. + #[serde(skip_serializing_if = "Option::is_none")] + pub last4: Option, + /// Mandate reference associated with the debit. + #[serde(skip_serializing_if = "Option::is_none")] + pub mandate_reference: Option, +} diff --git a/generated/stripe_product/Cargo.toml b/generated/stripe_product/Cargo.toml new file mode 100644 index 000000000..8dd73d620 --- /dev/null +++ b/generated/stripe_product/Cargo.toml @@ -0,0 +1,58 @@ +[package] +name = "stripe_product" +version.workspace = true +description.workspace = true +edition.workspace = true +rust-version.workspace = true +authors.workspace = true +license.workspace = true +homepage.workspace = true +repository.workspace = true +keywords.workspace = true +categories.workspace = true + +[lib] +path = "src/mod.rs" + +[dependencies] +serde.workspace = true +smol_str.workspace = true +serde_json.workspace = true +stripe_types = {path = "../../stripe_types"} + +http-types.workspace = true +async-stripe = {path = "../../async-stripe"} + + +stripe_shared = {path = "../../generated/stripe_shared"} + + +[features] +runtime-tokio-hyper = ["async-stripe/runtime-tokio-hyper"] +runtime-tokio-hyper-rustls = ["async-stripe/runtime-tokio-hyper-rustls"] +runtime-tokio-hyper-rustls-webpki = ["async-stripe/runtime-tokio-hyper-rustls-webpki"] +runtime-blocking = ["async-stripe/runtime-blocking"] +runtime-blocking-rustls = ["async-stripe/runtime-blocking-rustls"] +runtime-blocking-rustls-webpki = ["async-stripe/runtime-blocking-rustls-webpki"] +runtime-async-std-surf = ["async-stripe/runtime-async-std-surf"] + +coupon = [] +price = [] +product = [] +promotion_code = [] +shipping_rate = [] +tax_code = [] +tax_rate = [] + +full = ["coupon", +"price", +"product", +"promotion_code", +"shipping_rate", +"tax_code", +"tax_rate"] + + +[package.metadata.docs.rs] +features = ["runtime-tokio-hyper", "full"] + diff --git a/generated/stripe_product/src/coupon/mod.rs b/generated/stripe_product/src/coupon/mod.rs new file mode 100644 index 000000000..1d3a55ef8 --- /dev/null +++ b/generated/stripe_product/src/coupon/mod.rs @@ -0,0 +1,4 @@ +#[cfg(feature = "coupon")] +mod requests; +#[cfg(feature = "coupon")] +pub use requests::*; diff --git a/generated/stripe_product/src/coupon/requests.rs b/generated/stripe_product/src/coupon/requests.rs new file mode 100644 index 000000000..5be70a4da --- /dev/null +++ b/generated/stripe_product/src/coupon/requests.rs @@ -0,0 +1,207 @@ +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct DeleteCoupon {} +impl DeleteCoupon { + pub fn new() -> Self { + Self::default() + } +} +impl DeleteCoupon { + /// You can delete coupons via the [coupon management](https://dashboard.stripe.com/coupons) page of the Stripe dashboard. + /// However, deleting a coupon does not affect any customers who have already applied the coupon; it means that new customers can’t redeem the coupon. + /// You can also delete coupons via the API. + pub fn send( + &self, + client: &stripe::Client, + coupon: &stripe_shared::CouponId, + ) -> stripe::Response { + client.send_form(&format!("/coupons/{coupon}"), self, http_types::Method::Delete) + } +} +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct ListCoupon<'a> { + /// A filter on the list, based on the object `created` field. + /// The value can be a string with an integer Unix timestamp, or it can be a dictionary with a number of different query options. + #[serde(skip_serializing_if = "Option::is_none")] + pub created: Option, + /// A cursor for use in pagination. + /// `ending_before` is an object ID that defines your place in the list. + /// For instance, if you make a list request and receive 100 objects, starting with `obj_bar`, your subsequent call can include `ending_before=obj_bar` in order to fetch the previous page of the list. + #[serde(skip_serializing_if = "Option::is_none")] + pub ending_before: Option<&'a str>, + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, + /// A limit on the number of objects to be returned. + /// Limit can range between 1 and 100, and the default is 10. + #[serde(skip_serializing_if = "Option::is_none")] + pub limit: Option, + /// A cursor for use in pagination. + /// `starting_after` is an object ID that defines your place in the list. + /// For instance, if you make a list request and receive 100 objects, ending with `obj_foo`, your subsequent call can include `starting_after=obj_foo` in order to fetch the next page of the list. + #[serde(skip_serializing_if = "Option::is_none")] + pub starting_after: Option<&'a str>, +} +impl<'a> ListCoupon<'a> { + pub fn new() -> Self { + Self::default() + } +} +impl<'a> ListCoupon<'a> { + /// Returns a list of your coupons. + pub fn send( + &self, + client: &stripe::Client, + ) -> stripe::Response> { + client.get_query("/coupons", self) + } + pub fn paginate(self) -> stripe::ListPaginator> { + stripe::ListPaginator::from_list_params("/coupons", self) + } +} +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct RetrieveCoupon<'a> { + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, +} +impl<'a> RetrieveCoupon<'a> { + pub fn new() -> Self { + Self::default() + } +} +impl<'a> RetrieveCoupon<'a> { + /// Retrieves the coupon with the given ID. + pub fn send( + &self, + client: &stripe::Client, + coupon: &stripe_shared::CouponId, + ) -> stripe::Response { + client.get_query(&format!("/coupons/{coupon}"), self) + } +} +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreateCoupon<'a> { + /// A positive integer representing the amount to subtract from an invoice total (required if `percent_off` is not passed). + #[serde(skip_serializing_if = "Option::is_none")] + pub amount_off: Option, + /// A hash containing directions for what this Coupon will apply discounts to. + #[serde(skip_serializing_if = "Option::is_none")] + pub applies_to: Option>, + /// Three-letter [ISO code for the currency](https://stripe.com/docs/currencies) of the `amount_off` parameter (required if `amount_off` is passed). + #[serde(skip_serializing_if = "Option::is_none")] + pub currency: Option, + /// Coupons defined in each available currency option (only supported if `amount_off` is passed). + /// Each key must be a three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html) and a [supported currency](https://stripe.com/docs/currencies). + #[serde(skip_serializing_if = "Option::is_none")] + pub currency_options: + Option<&'a std::collections::HashMap>, + /// Specifies how long the discount will be in effect if used on a subscription. Defaults to `once`. + #[serde(skip_serializing_if = "Option::is_none")] + pub duration: Option, + /// Required only if `duration` is `repeating`, in which case it must be a positive integer that specifies the number of months the discount will be in effect. + #[serde(skip_serializing_if = "Option::is_none")] + pub duration_in_months: Option, + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, + /// Unique string of your choice that will be used to identify this coupon when applying it to a customer. + /// If you don't want to specify a particular code, you can leave the ID blank and we'll generate a random code for you. + #[serde(skip_serializing_if = "Option::is_none")] + pub id: Option<&'a str>, + /// A positive integer specifying the number of times the coupon can be redeemed before it's no longer valid. + /// For example, you might have a 50% off coupon that the first 20 readers of your blog can use. + #[serde(skip_serializing_if = "Option::is_none")] + pub max_redemptions: Option, + /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. + /// This can be useful for storing additional information about the object in a structured format. + /// Individual keys can be unset by posting an empty value to them. + /// All keys can be unset by posting an empty value to `metadata`. + #[serde(skip_serializing_if = "Option::is_none")] + pub metadata: Option<&'a std::collections::HashMap>, + /// Name of the coupon displayed to customers on, for instance invoices, or receipts. + /// By default the `id` is shown if `name` is not set. + #[serde(skip_serializing_if = "Option::is_none")] + pub name: Option<&'a str>, + /// A positive float larger than 0, and smaller or equal to 100, that represents the discount the coupon will apply (required if `amount_off` is not passed). + #[serde(skip_serializing_if = "Option::is_none")] + pub percent_off: Option, + /// Unix timestamp specifying the last time at which the coupon can be redeemed. + /// After the redeem_by date, the coupon can no longer be applied to new customers. + #[serde(skip_serializing_if = "Option::is_none")] + pub redeem_by: Option, +} +impl<'a> CreateCoupon<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// A hash containing directions for what this Coupon will apply discounts to. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreateCouponAppliesTo<'a> { + /// An array of Product IDs that this Coupon will apply to. + #[serde(skip_serializing_if = "Option::is_none")] + pub products: Option<&'a [&'a str]>, +} +impl<'a> CreateCouponAppliesTo<'a> { + pub fn new() -> Self { + Self::default() + } +} +impl<'a> CreateCoupon<'a> { + /// You can create coupons easily via the [coupon management](https://dashboard.stripe.com/coupons) page of the Stripe dashboard. + /// Coupon creation is also accessible via the API if you need to create coupons on the fly. + /// + /// A coupon has either a `percent_off` or an `amount_off` and `currency`. + /// If you set an `amount_off`, that amount will be subtracted from any invoice’s subtotal. + /// For example, an invoice with a subtotal of $100 will have a final total of $0 if a coupon with an `amount_off` of 20000 is applied to it and an invoice with a subtotal of $300 will have a final total of $100 if a coupon with an `amount_off` of 20000 is applied to it. + pub fn send(&self, client: &stripe::Client) -> stripe::Response { + client.send_form("/coupons", self, http_types::Method::Post) + } +} +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdateCoupon<'a> { + /// Coupons defined in each available currency option (only supported if the coupon is amount-based). + /// Each key must be a three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html) and a [supported currency](https://stripe.com/docs/currencies). + #[serde(skip_serializing_if = "Option::is_none")] + pub currency_options: + Option<&'a std::collections::HashMap>, + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, + /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. + /// This can be useful for storing additional information about the object in a structured format. + /// Individual keys can be unset by posting an empty value to them. + /// All keys can be unset by posting an empty value to `metadata`. + #[serde(skip_serializing_if = "Option::is_none")] + pub metadata: Option<&'a std::collections::HashMap>, + /// Name of the coupon displayed to customers on, for instance invoices, or receipts. + /// By default the `id` is shown if `name` is not set. + #[serde(skip_serializing_if = "Option::is_none")] + pub name: Option<&'a str>, +} +impl<'a> UpdateCoupon<'a> { + pub fn new() -> Self { + Self::default() + } +} +impl<'a> UpdateCoupon<'a> { + /// Updates the metadata of a coupon. + /// Other coupon details (currency, duration, amount_off) are, by design, not editable. + pub fn send( + &self, + client: &stripe::Client, + coupon: &stripe_shared::CouponId, + ) -> stripe::Response { + client.send_form(&format!("/coupons/{coupon}"), self, http_types::Method::Post) + } +} +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CurrencyOption { + /// A positive integer representing the amount to subtract from an invoice total. + pub amount_off: i64, +} +impl CurrencyOption { + pub fn new(amount_off: i64) -> Self { + Self { amount_off } + } +} diff --git a/generated/stripe_product/src/mod.rs b/generated/stripe_product/src/mod.rs new file mode 100644 index 000000000..544a4bd74 --- /dev/null +++ b/generated/stripe_product/src/mod.rs @@ -0,0 +1,40 @@ +#![recursion_limit = "256"] +#![allow(clippy::large_enum_variant)] +#![allow(rustdoc::broken_intra_doc_links)] +#![allow(rustdoc::invalid_html_tags)] + +//! This crate provides Rust bindings to the Stripe HTTP API, specifically +//! for requests mentioned in the `Products` section of the [Stripe API docs](https://stripe.com/docs/api) + +extern crate self as stripe_product; +pub mod coupon; +pub use stripe_shared::coupon::*; +pub use stripe_shared::coupon_applies_to::*; +pub use stripe_shared::coupon_currency_option::*; +pub use stripe_shared::currency_option::*; +pub use stripe_shared::custom_unit_amount::*; +pub use stripe_shared::deleted_coupon::*; +pub use stripe_shared::deleted_discount::*; +pub use stripe_shared::deleted_product::*; +pub use stripe_shared::discount::*; +pub use stripe_shared::line_items_discount_amount::*; +pub use stripe_shared::line_items_tax_amount::*; +pub use stripe_shared::package_dimensions::*; +pub mod price; +pub use stripe_shared::price::*; +pub use stripe_shared::price_tier::*; +pub mod product; +pub use stripe_shared::product::*; +pub use stripe_shared::product_feature::*; +pub mod promotion_code; +pub use stripe_shared::promotion_code::*; +pub use stripe_shared::promotion_code_currency_option::*; +pub use stripe_shared::promotion_codes_resource_restrictions::*; +pub use stripe_shared::recurring::*; +pub mod shipping_rate; +pub use stripe_shared::shipping_rate::*; +pub mod tax_code; +pub use stripe_shared::tax_code::*; +pub mod tax_rate; +pub use stripe_shared::tax_rate::*; +pub use stripe_shared::transform_quantity::*; diff --git a/generated/stripe_product/src/price/mod.rs b/generated/stripe_product/src/price/mod.rs new file mode 100644 index 000000000..41e8f2a61 --- /dev/null +++ b/generated/stripe_product/src/price/mod.rs @@ -0,0 +1,4 @@ +#[cfg(feature = "price")] +mod requests; +#[cfg(feature = "price")] +pub use requests::*; diff --git a/generated/stripe_product/src/price/requests.rs b/generated/stripe_product/src/price/requests.rs new file mode 100644 index 000000000..36800ef73 --- /dev/null +++ b/generated/stripe_product/src/price/requests.rs @@ -0,0 +1,907 @@ +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct ListPrice<'a> { + /// Only return prices that are active or inactive (e.g., pass `false` to list all inactive prices). + #[serde(skip_serializing_if = "Option::is_none")] + pub active: Option, + /// A filter on the list, based on the object `created` field. + /// The value can be a string with an integer Unix timestamp, or it can be a dictionary with a number of different query options. + #[serde(skip_serializing_if = "Option::is_none")] + pub created: Option, + /// Only return prices for the given currency. + #[serde(skip_serializing_if = "Option::is_none")] + pub currency: Option, + /// A cursor for use in pagination. + /// `ending_before` is an object ID that defines your place in the list. + /// For instance, if you make a list request and receive 100 objects, starting with `obj_bar`, your subsequent call can include `ending_before=obj_bar` in order to fetch the previous page of the list. + #[serde(skip_serializing_if = "Option::is_none")] + pub ending_before: Option<&'a str>, + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, + /// A limit on the number of objects to be returned. + /// Limit can range between 1 and 100, and the default is 10. + #[serde(skip_serializing_if = "Option::is_none")] + pub limit: Option, + /// Only return the price with these lookup_keys, if any exist. + #[serde(skip_serializing_if = "Option::is_none")] + pub lookup_keys: Option<&'a [&'a str]>, + /// Only return prices for the given product. + #[serde(skip_serializing_if = "Option::is_none")] + pub product: Option<&'a str>, + /// Only return prices with these recurring fields. + #[serde(skip_serializing_if = "Option::is_none")] + pub recurring: Option, + /// A cursor for use in pagination. + /// `starting_after` is an object ID that defines your place in the list. + /// For instance, if you make a list request and receive 100 objects, ending with `obj_foo`, your subsequent call can include `starting_after=obj_foo` in order to fetch the next page of the list. + #[serde(skip_serializing_if = "Option::is_none")] + pub starting_after: Option<&'a str>, + /// Only return prices of type `recurring` or `one_time`. + #[serde(rename = "type")] + #[serde(skip_serializing_if = "Option::is_none")] + pub type_: Option, +} +impl<'a> ListPrice<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// Only return prices with these recurring fields. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct ListPriceRecurring { + /// Filter by billing frequency. Either `day`, `week`, `month` or `year`. + #[serde(skip_serializing_if = "Option::is_none")] + pub interval: Option, + /// Filter by the usage type for this price. Can be either `metered` or `licensed`. + #[serde(skip_serializing_if = "Option::is_none")] + pub usage_type: Option, +} +impl ListPriceRecurring { + pub fn new() -> Self { + Self::default() + } +} +/// Filter by billing frequency. Either `day`, `week`, `month` or `year`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum ListPriceRecurringInterval { + Day, + Month, + Week, + Year, +} +impl ListPriceRecurringInterval { + pub fn as_str(self) -> &'static str { + use ListPriceRecurringInterval::*; + match self { + Day => "day", + Month => "month", + Week => "week", + Year => "year", + } + } +} + +impl std::str::FromStr for ListPriceRecurringInterval { + type Err = (); + fn from_str(s: &str) -> Result { + use ListPriceRecurringInterval::*; + match s { + "day" => Ok(Day), + "month" => Ok(Month), + "week" => Ok(Week), + "year" => Ok(Year), + _ => Err(()), + } + } +} +impl std::fmt::Display for ListPriceRecurringInterval { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for ListPriceRecurringInterval { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for ListPriceRecurringInterval { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Filter by the usage type for this price. Can be either `metered` or `licensed`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum ListPriceRecurringUsageType { + Licensed, + Metered, +} +impl ListPriceRecurringUsageType { + pub fn as_str(self) -> &'static str { + use ListPriceRecurringUsageType::*; + match self { + Licensed => "licensed", + Metered => "metered", + } + } +} + +impl std::str::FromStr for ListPriceRecurringUsageType { + type Err = (); + fn from_str(s: &str) -> Result { + use ListPriceRecurringUsageType::*; + match s { + "licensed" => Ok(Licensed), + "metered" => Ok(Metered), + _ => Err(()), + } + } +} +impl std::fmt::Display for ListPriceRecurringUsageType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for ListPriceRecurringUsageType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for ListPriceRecurringUsageType { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'a> ListPrice<'a> { + /// Returns a list of your active prices, excluding [inline prices](https://stripe.com/docs/products-prices/pricing-models#inline-pricing). + /// For the list of inactive prices, set `active` to false. + pub fn send( + &self, + client: &stripe::Client, + ) -> stripe::Response> { + client.get_query("/prices", self) + } + pub fn paginate(self) -> stripe::ListPaginator> { + stripe::ListPaginator::from_list_params("/prices", self) + } +} +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct RetrievePrice<'a> { + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, +} +impl<'a> RetrievePrice<'a> { + pub fn new() -> Self { + Self::default() + } +} +impl<'a> RetrievePrice<'a> { + /// Retrieves the price with the given ID. + pub fn send( + &self, + client: &stripe::Client, + price: &stripe_shared::PriceId, + ) -> stripe::Response { + client.get_query(&format!("/prices/{price}"), self) + } +} +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct SearchPrice<'a> { + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, + /// A limit on the number of objects to be returned. + /// Limit can range between 1 and 100, and the default is 10. + #[serde(skip_serializing_if = "Option::is_none")] + pub limit: Option, + /// A cursor for pagination across multiple pages of results. + /// Don't include this parameter on the first call. + /// Use the next_page value returned in a previous response to request subsequent results. + #[serde(skip_serializing_if = "Option::is_none")] + pub page: Option<&'a str>, + /// The search query string. + /// See [search query language](https://stripe.com/docs/search#search-query-language) and the list of supported [query fields for prices](https://stripe.com/docs/search#query-fields-for-prices). + pub query: &'a str, +} +impl<'a> SearchPrice<'a> { + pub fn new(query: &'a str) -> Self { + Self { expand: None, limit: None, page: None, query } + } +} +impl<'a> SearchPrice<'a> { + /// Search for prices you’ve previously created using Stripe’s [Search Query Language](https://stripe.com/docs/search#search-query-language). + /// Don’t use search in read-after-write flows where strict consistency is necessary. + /// Under normal operating. + /// conditions, data is searchable in less than a minute. + /// Occasionally, propagation of new or updated data can be up. + /// to an hour behind during outages. Search functionality is not available to merchants in India. + pub fn send( + &self, + client: &stripe::Client, + ) -> stripe::Response> { + client.get_query("/prices/search", self) + } + pub fn paginate(self) -> stripe::ListPaginator> { + stripe::ListPaginator::from_search_params("/prices/search", self) + } +} +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreatePrice<'a> { + /// Whether the price can be used for new purchases. Defaults to `true`. + #[serde(skip_serializing_if = "Option::is_none")] + pub active: Option, + /// Describes how to compute the price per period. + /// Either `per_unit` or `tiered`. + /// `per_unit` indicates that the fixed amount (specified in `unit_amount` or `unit_amount_decimal`) will be charged per unit in `quantity` (for prices with `usage_type=licensed`), or per unit of total usage (for prices with `usage_type=metered`). + /// `tiered` indicates that the unit pricing will be computed using a tiering strategy as defined using the `tiers` and `tiers_mode` attributes. + #[serde(skip_serializing_if = "Option::is_none")] + pub billing_scheme: Option, + /// Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. + /// Must be a [supported currency](https://stripe.com/docs/currencies). + pub currency: stripe_types::Currency, + /// Prices defined in each available currency option. + /// Each key must be a three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html) and a [supported currency](https://stripe.com/docs/currencies). + #[serde(skip_serializing_if = "Option::is_none")] + pub currency_options: + Option<&'a std::collections::HashMap>, + /// When set, provides configuration for the amount to be adjusted by the customer during Checkout Sessions and Payment Links. + #[serde(skip_serializing_if = "Option::is_none")] + pub custom_unit_amount: Option, + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, + /// A lookup key used to retrieve prices dynamically from a static string. + /// This may be up to 200 characters. + #[serde(skip_serializing_if = "Option::is_none")] + pub lookup_key: Option<&'a str>, + /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. + /// This can be useful for storing additional information about the object in a structured format. + /// Individual keys can be unset by posting an empty value to them. + /// All keys can be unset by posting an empty value to `metadata`. + #[serde(skip_serializing_if = "Option::is_none")] + pub metadata: Option<&'a std::collections::HashMap>, + /// A brief description of the price, hidden from customers. + #[serde(skip_serializing_if = "Option::is_none")] + pub nickname: Option<&'a str>, + /// The ID of the product that this price will belong to. + #[serde(skip_serializing_if = "Option::is_none")] + pub product: Option<&'a str>, + /// These fields can be used to create a new product that this price will belong to. + #[serde(skip_serializing_if = "Option::is_none")] + pub product_data: Option>, + /// The recurring components of a price such as `interval` and `usage_type`. + #[serde(skip_serializing_if = "Option::is_none")] + pub recurring: Option, + /// Only required if a [default tax behavior](https://stripe.com/docs/tax/products-prices-tax-categories-tax-behavior#setting-a-default-tax-behavior-(recommended)) was not provided in the Stripe Tax settings. + /// Specifies whether the price is considered inclusive of taxes or exclusive of taxes. + /// One of `inclusive`, `exclusive`, or `unspecified`. + /// Once specified as either `inclusive` or `exclusive`, it cannot be changed. + #[serde(skip_serializing_if = "Option::is_none")] + pub tax_behavior: Option, + /// Each element represents a pricing tier. + /// This parameter requires `billing_scheme` to be set to `tiered`. + /// See also the documentation for `billing_scheme`. + #[serde(skip_serializing_if = "Option::is_none")] + pub tiers: Option<&'a [CreatePriceTiers<'a>]>, + /// Defines if the tiering price should be `graduated` or `volume` based. + /// In `volume`-based tiering, the maximum quantity within a period determines the per unit price, in `graduated` tiering pricing can successively change as the quantity grows. + #[serde(skip_serializing_if = "Option::is_none")] + pub tiers_mode: Option, + /// If set to true, will atomically remove the lookup key from the existing price, and assign it to this price. + #[serde(skip_serializing_if = "Option::is_none")] + pub transfer_lookup_key: Option, + /// Apply a transformation to the reported usage or set quantity before computing the billed price. + /// Cannot be combined with `tiers`. + #[serde(skip_serializing_if = "Option::is_none")] + pub transform_quantity: Option, + /// A positive integer in cents (or local equivalent) (or 0 for a free price) representing how much to charge. + /// One of `unit_amount` or `custom_unit_amount` is required, unless `billing_scheme=tiered`. + #[serde(skip_serializing_if = "Option::is_none")] + pub unit_amount: Option, + /// Same as `unit_amount`, but accepts a decimal value in cents (or local equivalent) with at most 12 decimal places. + /// Only one of `unit_amount` and `unit_amount_decimal` can be set. + #[serde(skip_serializing_if = "Option::is_none")] + pub unit_amount_decimal: Option<&'a str>, +} +impl<'a> CreatePrice<'a> { + pub fn new(currency: stripe_types::Currency) -> Self { + Self { + active: None, + billing_scheme: None, + currency, + currency_options: None, + custom_unit_amount: None, + expand: None, + lookup_key: None, + metadata: None, + nickname: None, + product: None, + product_data: None, + recurring: None, + tax_behavior: None, + tiers: None, + tiers_mode: None, + transfer_lookup_key: None, + transform_quantity: None, + unit_amount: None, + unit_amount_decimal: None, + } + } +} +/// Prices defined in each available currency option. +/// Each key must be a three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html) and a [supported currency](https://stripe.com/docs/currencies). +#[derive(Clone, Debug, Default, serde::Serialize)] +pub struct CreatePriceCurrencyOptions { + /// When set, provides configuration for the amount to be adjusted by the customer during Checkout Sessions and Payment Links. + #[serde(skip_serializing_if = "Option::is_none")] + pub custom_unit_amount: Option, + /// Only required if a [default tax behavior](https://stripe.com/docs/tax/products-prices-tax-categories-tax-behavior#setting-a-default-tax-behavior-(recommended)) was not provided in the Stripe Tax settings. + /// Specifies whether the price is considered inclusive of taxes or exclusive of taxes. + /// One of `inclusive`, `exclusive`, or `unspecified`. + /// Once specified as either `inclusive` or `exclusive`, it cannot be changed. + #[serde(skip_serializing_if = "Option::is_none")] + pub tax_behavior: Option, + /// Each element represents a pricing tier. + /// This parameter requires `billing_scheme` to be set to `tiered`. + /// See also the documentation for `billing_scheme`. + #[serde(skip_serializing_if = "Option::is_none")] + pub tiers: Option>, + /// A positive integer in cents (or local equivalent) (or 0 for a free price) representing how much to charge. + #[serde(skip_serializing_if = "Option::is_none")] + pub unit_amount: Option, + /// Same as `unit_amount`, but accepts a decimal value in cents (or local equivalent) with at most 12 decimal places. + /// Only one of `unit_amount` and `unit_amount_decimal` can be set. + #[serde(skip_serializing_if = "Option::is_none")] + pub unit_amount_decimal: Option, +} +impl CreatePriceCurrencyOptions { + pub fn new() -> Self { + Self::default() + } +} +/// Each element represents a pricing tier. +/// This parameter requires `billing_scheme` to be set to `tiered`. +/// See also the documentation for `billing_scheme`. +#[derive(Clone, Debug, serde::Serialize)] +pub struct CreatePriceCurrencyOptionsTiers { + /// The flat billing amount for an entire tier, regardless of the number of units in the tier. + #[serde(skip_serializing_if = "Option::is_none")] + pub flat_amount: Option, + /// Same as `flat_amount`, but accepts a decimal value representing an integer in the minor units of the currency. + /// Only one of `flat_amount` and `flat_amount_decimal` can be set. + #[serde(skip_serializing_if = "Option::is_none")] + pub flat_amount_decimal: Option, + /// The per unit billing amount for each individual unit for which this tier applies. + #[serde(skip_serializing_if = "Option::is_none")] + pub unit_amount: Option, + /// Same as `unit_amount`, but accepts a decimal value in cents (or local equivalent) with at most 12 decimal places. + /// Only one of `unit_amount` and `unit_amount_decimal` can be set. + #[serde(skip_serializing_if = "Option::is_none")] + pub unit_amount_decimal: Option, + /// Specifies the upper bound of this tier. + /// The lower bound of a tier is the upper bound of the previous tier adding one. + /// Use `inf` to define a fallback tier. + pub up_to: CreatePriceCurrencyOptionsTiersUpTo, +} +impl CreatePriceCurrencyOptionsTiers { + pub fn new(up_to: CreatePriceCurrencyOptionsTiersUpTo) -> Self { + Self { + flat_amount: None, + flat_amount_decimal: None, + unit_amount: None, + unit_amount_decimal: None, + up_to, + } + } +} +/// Specifies the upper bound of this tier. +/// The lower bound of a tier is the upper bound of the previous tier adding one. +/// Use `inf` to define a fallback tier. +#[derive(Copy, Clone, Debug, serde::Serialize)] +#[serde(untagged)] +pub enum CreatePriceCurrencyOptionsTiersUpTo { + Inf, + I64(i64), +} +/// These fields can be used to create a new product that this price will belong to. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreatePriceProductData<'a> { + /// Whether the product is currently available for purchase. Defaults to `true`. + #[serde(skip_serializing_if = "Option::is_none")] + pub active: Option, + /// The identifier for the product. + /// Must be unique. + /// If not provided, an identifier will be randomly generated. + #[serde(skip_serializing_if = "Option::is_none")] + pub id: Option<&'a str>, + /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. + /// This can be useful for storing additional information about the object in a structured format. + /// Individual keys can be unset by posting an empty value to them. + /// All keys can be unset by posting an empty value to `metadata`. + #[serde(skip_serializing_if = "Option::is_none")] + pub metadata: Option<&'a std::collections::HashMap>, + /// The product's name, meant to be displayable to the customer. + pub name: &'a str, + /// An arbitrary string to be displayed on your customer's credit card or bank statement. + /// While most banks display this information consistently, some may display it incorrectly or not at all. + /// + /// This may be up to 22 characters. + /// The statement description may not include `<`, `>`, `\`, `"`, `'` characters, and will appear on your customer's statement in capital letters. + /// Non-ASCII characters are automatically stripped. + #[serde(skip_serializing_if = "Option::is_none")] + pub statement_descriptor: Option<&'a str>, + /// A [tax code](https://stripe.com/docs/tax/tax-categories) ID. + #[serde(skip_serializing_if = "Option::is_none")] + pub tax_code: Option<&'a str>, + /// A label that represents units of this product. + /// When set, this will be included in customers' receipts, invoices, Checkout, and the customer portal. + #[serde(skip_serializing_if = "Option::is_none")] + pub unit_label: Option<&'a str>, +} +impl<'a> CreatePriceProductData<'a> { + pub fn new(name: &'a str) -> Self { + Self { + active: None, + id: None, + metadata: None, + name, + statement_descriptor: None, + tax_code: None, + unit_label: None, + } + } +} +/// The recurring components of a price such as `interval` and `usage_type`. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreatePriceRecurring { + /// Specifies a usage aggregation strategy for prices of `usage_type=metered`. Defaults to `sum`. + #[serde(skip_serializing_if = "Option::is_none")] + pub aggregate_usage: Option, + /// Specifies billing frequency. Either `day`, `week`, `month` or `year`. + pub interval: CreatePriceRecurringInterval, + /// The number of intervals between subscription billings. + /// For example, `interval=month` and `interval_count=3` bills every 3 months. + /// Maximum of three years interval allowed (3 years, 36 months, or 156 weeks). + #[serde(skip_serializing_if = "Option::is_none")] + pub interval_count: Option, + /// Default number of trial days when subscribing a customer to this price using [`trial_from_plan=true`](https://stripe.com/docs/api#create_subscription-trial_from_plan). + #[serde(skip_serializing_if = "Option::is_none")] + pub trial_period_days: Option, + /// Configures how the quantity per period should be determined. + /// Can be either `metered` or `licensed`. + /// `licensed` automatically bills the `quantity` set when adding it to a subscription. + /// `metered` aggregates the total usage based on usage records. + /// Defaults to `licensed`. + #[serde(skip_serializing_if = "Option::is_none")] + pub usage_type: Option, +} +impl CreatePriceRecurring { + pub fn new(interval: CreatePriceRecurringInterval) -> Self { + Self { + aggregate_usage: None, + interval, + interval_count: None, + trial_period_days: None, + usage_type: None, + } + } +} +/// Specifies a usage aggregation strategy for prices of `usage_type=metered`. Defaults to `sum`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreatePriceRecurringAggregateUsage { + LastDuringPeriod, + LastEver, + Max, + Sum, +} +impl CreatePriceRecurringAggregateUsage { + pub fn as_str(self) -> &'static str { + use CreatePriceRecurringAggregateUsage::*; + match self { + LastDuringPeriod => "last_during_period", + LastEver => "last_ever", + Max => "max", + Sum => "sum", + } + } +} + +impl std::str::FromStr for CreatePriceRecurringAggregateUsage { + type Err = (); + fn from_str(s: &str) -> Result { + use CreatePriceRecurringAggregateUsage::*; + match s { + "last_during_period" => Ok(LastDuringPeriod), + "last_ever" => Ok(LastEver), + "max" => Ok(Max), + "sum" => Ok(Sum), + _ => Err(()), + } + } +} +impl std::fmt::Display for CreatePriceRecurringAggregateUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreatePriceRecurringAggregateUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreatePriceRecurringAggregateUsage { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Specifies billing frequency. Either `day`, `week`, `month` or `year`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreatePriceRecurringInterval { + Day, + Month, + Week, + Year, +} +impl CreatePriceRecurringInterval { + pub fn as_str(self) -> &'static str { + use CreatePriceRecurringInterval::*; + match self { + Day => "day", + Month => "month", + Week => "week", + Year => "year", + } + } +} + +impl std::str::FromStr for CreatePriceRecurringInterval { + type Err = (); + fn from_str(s: &str) -> Result { + use CreatePriceRecurringInterval::*; + match s { + "day" => Ok(Day), + "month" => Ok(Month), + "week" => Ok(Week), + "year" => Ok(Year), + _ => Err(()), + } + } +} +impl std::fmt::Display for CreatePriceRecurringInterval { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreatePriceRecurringInterval { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreatePriceRecurringInterval { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Configures how the quantity per period should be determined. +/// Can be either `metered` or `licensed`. +/// `licensed` automatically bills the `quantity` set when adding it to a subscription. +/// `metered` aggregates the total usage based on usage records. +/// Defaults to `licensed`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreatePriceRecurringUsageType { + Licensed, + Metered, +} +impl CreatePriceRecurringUsageType { + pub fn as_str(self) -> &'static str { + use CreatePriceRecurringUsageType::*; + match self { + Licensed => "licensed", + Metered => "metered", + } + } +} + +impl std::str::FromStr for CreatePriceRecurringUsageType { + type Err = (); + fn from_str(s: &str) -> Result { + use CreatePriceRecurringUsageType::*; + match s { + "licensed" => Ok(Licensed), + "metered" => Ok(Metered), + _ => Err(()), + } + } +} +impl std::fmt::Display for CreatePriceRecurringUsageType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreatePriceRecurringUsageType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreatePriceRecurringUsageType { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Each element represents a pricing tier. +/// This parameter requires `billing_scheme` to be set to `tiered`. +/// See also the documentation for `billing_scheme`. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreatePriceTiers<'a> { + /// The flat billing amount for an entire tier, regardless of the number of units in the tier. + #[serde(skip_serializing_if = "Option::is_none")] + pub flat_amount: Option, + /// Same as `flat_amount`, but accepts a decimal value representing an integer in the minor units of the currency. + /// Only one of `flat_amount` and `flat_amount_decimal` can be set. + #[serde(skip_serializing_if = "Option::is_none")] + pub flat_amount_decimal: Option<&'a str>, + /// The per unit billing amount for each individual unit for which this tier applies. + #[serde(skip_serializing_if = "Option::is_none")] + pub unit_amount: Option, + /// Same as `unit_amount`, but accepts a decimal value in cents (or local equivalent) with at most 12 decimal places. + /// Only one of `unit_amount` and `unit_amount_decimal` can be set. + #[serde(skip_serializing_if = "Option::is_none")] + pub unit_amount_decimal: Option<&'a str>, + /// Specifies the upper bound of this tier. + /// The lower bound of a tier is the upper bound of the previous tier adding one. + /// Use `inf` to define a fallback tier. + pub up_to: CreatePriceTiersUpTo, +} +impl<'a> CreatePriceTiers<'a> { + pub fn new(up_to: CreatePriceTiersUpTo) -> Self { + Self { + flat_amount: None, + flat_amount_decimal: None, + unit_amount: None, + unit_amount_decimal: None, + up_to, + } + } +} +/// Specifies the upper bound of this tier. +/// The lower bound of a tier is the upper bound of the previous tier adding one. +/// Use `inf` to define a fallback tier. +#[derive(Copy, Clone, Debug, serde::Serialize)] +#[serde(untagged)] +pub enum CreatePriceTiersUpTo { + Inf, + I64(i64), +} +/// Apply a transformation to the reported usage or set quantity before computing the billed price. +/// Cannot be combined with `tiers`. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreatePriceTransformQuantity { + /// Divide usage by this number. + pub divide_by: i64, + /// After division, either round the result `up` or `down`. + pub round: CreatePriceTransformQuantityRound, +} +impl CreatePriceTransformQuantity { + pub fn new(divide_by: i64, round: CreatePriceTransformQuantityRound) -> Self { + Self { divide_by, round } + } +} +/// After division, either round the result `up` or `down`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreatePriceTransformQuantityRound { + Down, + Up, +} +impl CreatePriceTransformQuantityRound { + pub fn as_str(self) -> &'static str { + use CreatePriceTransformQuantityRound::*; + match self { + Down => "down", + Up => "up", + } + } +} + +impl std::str::FromStr for CreatePriceTransformQuantityRound { + type Err = (); + fn from_str(s: &str) -> Result { + use CreatePriceTransformQuantityRound::*; + match s { + "down" => Ok(Down), + "up" => Ok(Up), + _ => Err(()), + } + } +} +impl std::fmt::Display for CreatePriceTransformQuantityRound { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreatePriceTransformQuantityRound { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreatePriceTransformQuantityRound { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'a> CreatePrice<'a> { + /// Creates a new price for an existing product. The price can be recurring or one-time. + pub fn send(&self, client: &stripe::Client) -> stripe::Response { + client.send_form("/prices", self, http_types::Method::Post) + } +} +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdatePrice<'a> { + /// Whether the price can be used for new purchases. Defaults to `true`. + #[serde(skip_serializing_if = "Option::is_none")] + pub active: Option, + /// Prices defined in each available currency option. + /// Each key must be a three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html) and a [supported currency](https://stripe.com/docs/currencies). + #[serde(skip_serializing_if = "Option::is_none")] + pub currency_options: + Option<&'a std::collections::HashMap>, + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, + /// A lookup key used to retrieve prices dynamically from a static string. + /// This may be up to 200 characters. + #[serde(skip_serializing_if = "Option::is_none")] + pub lookup_key: Option<&'a str>, + /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. + /// This can be useful for storing additional information about the object in a structured format. + /// Individual keys can be unset by posting an empty value to them. + /// All keys can be unset by posting an empty value to `metadata`. + #[serde(skip_serializing_if = "Option::is_none")] + pub metadata: Option<&'a std::collections::HashMap>, + /// A brief description of the price, hidden from customers. + #[serde(skip_serializing_if = "Option::is_none")] + pub nickname: Option<&'a str>, + /// Only required if a [default tax behavior](https://stripe.com/docs/tax/products-prices-tax-categories-tax-behavior#setting-a-default-tax-behavior-(recommended)) was not provided in the Stripe Tax settings. + /// Specifies whether the price is considered inclusive of taxes or exclusive of taxes. + /// One of `inclusive`, `exclusive`, or `unspecified`. + /// Once specified as either `inclusive` or `exclusive`, it cannot be changed. + #[serde(skip_serializing_if = "Option::is_none")] + pub tax_behavior: Option, + /// If set to true, will atomically remove the lookup key from the existing price, and assign it to this price. + #[serde(skip_serializing_if = "Option::is_none")] + pub transfer_lookup_key: Option, +} +impl<'a> UpdatePrice<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// Prices defined in each available currency option. +/// Each key must be a three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html) and a [supported currency](https://stripe.com/docs/currencies). +#[derive(Clone, Debug, Default, serde::Serialize)] +pub struct UpdatePriceCurrencyOptions { + /// When set, provides configuration for the amount to be adjusted by the customer during Checkout Sessions and Payment Links. + #[serde(skip_serializing_if = "Option::is_none")] + pub custom_unit_amount: Option, + /// Only required if a [default tax behavior](https://stripe.com/docs/tax/products-prices-tax-categories-tax-behavior#setting-a-default-tax-behavior-(recommended)) was not provided in the Stripe Tax settings. + /// Specifies whether the price is considered inclusive of taxes or exclusive of taxes. + /// One of `inclusive`, `exclusive`, or `unspecified`. + /// Once specified as either `inclusive` or `exclusive`, it cannot be changed. + #[serde(skip_serializing_if = "Option::is_none")] + pub tax_behavior: Option, + /// Each element represents a pricing tier. + /// This parameter requires `billing_scheme` to be set to `tiered`. + /// See also the documentation for `billing_scheme`. + #[serde(skip_serializing_if = "Option::is_none")] + pub tiers: Option>, + /// A positive integer in cents (or local equivalent) (or 0 for a free price) representing how much to charge. + #[serde(skip_serializing_if = "Option::is_none")] + pub unit_amount: Option, + /// Same as `unit_amount`, but accepts a decimal value in cents (or local equivalent) with at most 12 decimal places. + /// Only one of `unit_amount` and `unit_amount_decimal` can be set. + #[serde(skip_serializing_if = "Option::is_none")] + pub unit_amount_decimal: Option, +} +impl UpdatePriceCurrencyOptions { + pub fn new() -> Self { + Self::default() + } +} +/// Each element represents a pricing tier. +/// This parameter requires `billing_scheme` to be set to `tiered`. +/// See also the documentation for `billing_scheme`. +#[derive(Clone, Debug, serde::Serialize)] +pub struct UpdatePriceCurrencyOptionsTiers { + /// The flat billing amount for an entire tier, regardless of the number of units in the tier. + #[serde(skip_serializing_if = "Option::is_none")] + pub flat_amount: Option, + /// Same as `flat_amount`, but accepts a decimal value representing an integer in the minor units of the currency. + /// Only one of `flat_amount` and `flat_amount_decimal` can be set. + #[serde(skip_serializing_if = "Option::is_none")] + pub flat_amount_decimal: Option, + /// The per unit billing amount for each individual unit for which this tier applies. + #[serde(skip_serializing_if = "Option::is_none")] + pub unit_amount: Option, + /// Same as `unit_amount`, but accepts a decimal value in cents (or local equivalent) with at most 12 decimal places. + /// Only one of `unit_amount` and `unit_amount_decimal` can be set. + #[serde(skip_serializing_if = "Option::is_none")] + pub unit_amount_decimal: Option, + /// Specifies the upper bound of this tier. + /// The lower bound of a tier is the upper bound of the previous tier adding one. + /// Use `inf` to define a fallback tier. + pub up_to: UpdatePriceCurrencyOptionsTiersUpTo, +} +impl UpdatePriceCurrencyOptionsTiers { + pub fn new(up_to: UpdatePriceCurrencyOptionsTiersUpTo) -> Self { + Self { + flat_amount: None, + flat_amount_decimal: None, + unit_amount: None, + unit_amount_decimal: None, + up_to, + } + } +} +/// Specifies the upper bound of this tier. +/// The lower bound of a tier is the upper bound of the previous tier adding one. +/// Use `inf` to define a fallback tier. +#[derive(Copy, Clone, Debug, serde::Serialize)] +#[serde(untagged)] +pub enum UpdatePriceCurrencyOptionsTiersUpTo { + Inf, + I64(i64), +} +impl<'a> UpdatePrice<'a> { + /// Updates the specified price by setting the values of the parameters passed. + /// Any parameters not provided are left unchanged. + pub fn send( + &self, + client: &stripe::Client, + price: &stripe_shared::PriceId, + ) -> stripe::Response { + client.send_form(&format!("/prices/{price}"), self, http_types::Method::Post) + } +} +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CustomUnitAmount { + /// Pass in `true` to enable `custom_unit_amount`, otherwise omit `custom_unit_amount`. + pub enabled: bool, + /// The maximum unit amount the customer can specify for this item. + #[serde(skip_serializing_if = "Option::is_none")] + pub maximum: Option, + /// The minimum unit amount the customer can specify for this item. + /// Must be at least the minimum charge amount. + #[serde(skip_serializing_if = "Option::is_none")] + pub minimum: Option, + /// The starting unit amount which can be updated by the customer. + #[serde(skip_serializing_if = "Option::is_none")] + pub preset: Option, +} +impl CustomUnitAmount { + pub fn new(enabled: bool) -> Self { + Self { enabled, maximum: None, minimum: None, preset: None } + } +} diff --git a/generated/stripe_product/src/product/mod.rs b/generated/stripe_product/src/product/mod.rs new file mode 100644 index 000000000..e5eb1ea67 --- /dev/null +++ b/generated/stripe_product/src/product/mod.rs @@ -0,0 +1,4 @@ +#[cfg(feature = "product")] +mod requests; +#[cfg(feature = "product")] +pub use requests::*; diff --git a/src/resources/generated/product.rs b/generated/stripe_product/src/product/requests.rs similarity index 55% rename from src/resources/generated/product.rs rename to generated/stripe_product/src/product/requests.rs index 49a6f6e14..4fc865adb 100644 --- a/src/resources/generated/product.rs +++ b/generated/stripe_product/src/product/requests.rs @@ -1,764 +1,651 @@ -// ====================================== -// This file was automatically generated. -// ====================================== - -use serde::{Deserialize, Serialize}; - -use crate::client::{Client, Response}; -use crate::ids::{ProductId, TaxCodeId}; -use crate::params::{ - CurrencyMap, Deleted, Expand, Expandable, List, Metadata, Object, Paginable, RangeQuery, - Timestamp, -}; -use crate::resources::{Currency, Price, TaxCode, UpTo}; - -/// The resource representing a Stripe "Product". -/// -/// For more details see -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct Product { - /// Unique identifier for the object. - pub id: ProductId, - - /// Whether the product is currently available for purchase. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct DeleteProduct {} +impl DeleteProduct { + pub fn new() -> Self { + Self::default() + } +} +impl DeleteProduct { + /// Delete a product. + /// Deleting a product is only possible if it has no prices associated with it. + /// Additionally, deleting a product with `type=good` is only possible if it has no SKUs associated with it. + pub fn send( + &self, + client: &stripe::Client, + id: &stripe_shared::ProductId, + ) -> stripe::Response { + client.send_form(&format!("/products/{id}"), self, http_types::Method::Delete) + } +} +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct ListProduct<'a> { + /// Only return products that are active or inactive (e.g., pass `false` to list all inactive products). #[serde(skip_serializing_if = "Option::is_none")] pub active: Option, - - /// Time at which the object was created. - /// - /// Measured in seconds since the Unix epoch. - #[serde(skip_serializing_if = "Option::is_none")] - pub created: Option, - - /// The ID of the [Price](https://stripe.com/docs/api/prices) object that is the default price for this product. - #[serde(skip_serializing_if = "Option::is_none")] - pub default_price: Option>, - - // Always true for a deleted object - #[serde(default)] - pub deleted: bool, - - /// The product's description, meant to be displayable to the customer. - /// - /// Use this field to optionally store a long form explanation of the product being sold for your own rendering purposes. - #[serde(skip_serializing_if = "Option::is_none")] - pub description: Option, - - /// A list of up to 15 features for this product. - /// - /// These are displayed in [pricing tables](https://stripe.com/docs/payments/checkout/pricing-table). - #[serde(skip_serializing_if = "Option::is_none")] - pub features: Option>, - - /// A list of up to 8 URLs of images for this product, meant to be displayable to the customer. + /// Only return products that were created during the given date interval. #[serde(skip_serializing_if = "Option::is_none")] - pub images: Option>, - - /// Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + pub created: Option, + /// A cursor for use in pagination. + /// `ending_before` is an object ID that defines your place in the list. + /// For instance, if you make a list request and receive 100 objects, starting with `obj_bar`, your subsequent call can include `ending_before=obj_bar` in order to fetch the previous page of the list. #[serde(skip_serializing_if = "Option::is_none")] - pub livemode: Option, - - /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. - /// - /// This can be useful for storing additional information about the object in a structured format. + pub ending_before: Option<&'a str>, + /// Specifies which fields in the response should be expanded. #[serde(skip_serializing_if = "Option::is_none")] - pub metadata: Option, - - /// The product's name, meant to be displayable to the customer. + pub expand: Option<&'a [&'a str]>, + /// Only return products with the given IDs. + /// Cannot be used with [starting_after](https://stripe.com/docs/api#list_products-starting_after) or [ending_before](https://stripe.com/docs/api#list_products-ending_before). #[serde(skip_serializing_if = "Option::is_none")] - pub name: Option, - - /// The dimensions of this product for shipping purposes. + pub ids: Option<&'a [&'a str]>, + /// A limit on the number of objects to be returned. + /// Limit can range between 1 and 100, and the default is 10. #[serde(skip_serializing_if = "Option::is_none")] - pub package_dimensions: Option, - - /// Whether this product is shipped (i.e., physical goods). + pub limit: Option, + /// Only return products that can be shipped (i.e., physical, not digital products). #[serde(skip_serializing_if = "Option::is_none")] pub shippable: Option, - - /// Extra information about a product which will appear on your customer's credit card statement. - /// - /// In the case that multiple products are billed at once, the first statement descriptor will be used. - #[serde(skip_serializing_if = "Option::is_none")] - pub statement_descriptor: Option, - - /// A [tax code](https://stripe.com/docs/tax/tax-categories) ID. + /// A cursor for use in pagination. + /// `starting_after` is an object ID that defines your place in the list. + /// For instance, if you make a list request and receive 100 objects, ending with `obj_foo`, your subsequent call can include `starting_after=obj_foo` in order to fetch the next page of the list. #[serde(skip_serializing_if = "Option::is_none")] - pub tax_code: Option>, - - /// The type of the product. - /// - /// The product is either of type `good`, which is eligible for use with Orders and SKUs, or `service`, which is eligible for use with Subscriptions and Plans. + pub starting_after: Option<&'a str>, + /// Only return products of this type. #[serde(rename = "type")] #[serde(skip_serializing_if = "Option::is_none")] - pub type_: Option, - - /// A label that represents units of this product. - /// - /// When set, this will be included in customers' receipts, invoices, Checkout, and the customer portal. - #[serde(skip_serializing_if = "Option::is_none")] - pub unit_label: Option, - - /// Time at which the object was last updated. - /// - /// Measured in seconds since the Unix epoch. - #[serde(skip_serializing_if = "Option::is_none")] - pub updated: Option, - - /// A URL of a publicly-accessible webpage for this product. + pub type_: Option, + /// Only return products with the given url. #[serde(skip_serializing_if = "Option::is_none")] - pub url: Option, + pub url: Option<&'a str>, } - -impl Product { +impl<'a> ListProduct<'a> { + pub fn new() -> Self { + Self::default() + } +} +impl<'a> ListProduct<'a> { /// Returns a list of your products. - /// /// The products are returned sorted by creation date, with the most recently created products appearing first. - pub fn list(client: &Client, params: &ListProducts<'_>) -> Response> { - client.get_query("/products", ¶ms) + pub fn send( + &self, + client: &stripe::Client, + ) -> stripe::Response> { + client.get_query("/products", self) } - - /// Creates a new product object. - pub fn create(client: &Client, params: CreateProduct<'_>) -> Response { - client.post_form("/products", ¶ms) + pub fn paginate(self) -> stripe::ListPaginator> { + stripe::ListPaginator::from_list_params("/products", self) } - +} +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct RetrieveProduct<'a> { + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, +} +impl<'a> RetrieveProduct<'a> { + pub fn new() -> Self { + Self::default() + } +} +impl<'a> RetrieveProduct<'a> { /// Retrieves the details of an existing product. - /// /// Supply the unique product ID from either a product creation request or the product list, and Stripe will return the corresponding product information. - pub fn retrieve(client: &Client, id: &ProductId, expand: &[&str]) -> Response { - client.get_query(&format!("/products/{}", id), &Expand { expand }) - } - - /// Updates the specific product by setting the values of the parameters passed. - /// - /// Any parameters not provided will be left unchanged. - pub fn update(client: &Client, id: &ProductId, params: UpdateProduct<'_>) -> Response { - client.post_form(&format!("/products/{}", id), ¶ms) + pub fn send( + &self, + client: &stripe::Client, + id: &stripe_shared::ProductId, + ) -> stripe::Response { + client.get_query(&format!("/products/{id}"), self) } - - /// Delete a product. - /// - /// Deleting a product is only possible if it has no prices associated with it. - /// Additionally, deleting a product with `type=good` is only possible if it has no SKUs associated with it. - pub fn delete(client: &Client, id: &ProductId) -> Response> { - client.delete(&format!("/products/{}", id)) +} +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct SearchProduct<'a> { + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, + /// A limit on the number of objects to be returned. + /// Limit can range between 1 and 100, and the default is 10. + #[serde(skip_serializing_if = "Option::is_none")] + pub limit: Option, + /// A cursor for pagination across multiple pages of results. + /// Don't include this parameter on the first call. + /// Use the next_page value returned in a previous response to request subsequent results. + #[serde(skip_serializing_if = "Option::is_none")] + pub page: Option<&'a str>, + /// The search query string. + /// See [search query language](https://stripe.com/docs/search#search-query-language) and the list of supported [query fields for products](https://stripe.com/docs/search#query-fields-for-products). + pub query: &'a str, +} +impl<'a> SearchProduct<'a> { + pub fn new(query: &'a str) -> Self { + Self { expand: None, limit: None, page: None, query } } } - -impl Object for Product { - type Id = ProductId; - fn id(&self) -> Self::Id { - self.id.clone() +impl<'a> SearchProduct<'a> { + /// Search for products you’ve previously created using Stripe’s [Search Query Language](https://stripe.com/docs/search#search-query-language). + /// Don’t use search in read-after-write flows where strict consistency is necessary. + /// Under normal operating. + /// conditions, data is searchable in less than a minute. + /// Occasionally, propagation of new or updated data can be up. + /// to an hour behind during outages. Search functionality is not available to merchants in India. + pub fn send( + &self, + client: &stripe::Client, + ) -> stripe::Response> { + client.get_query("/products/search", self) } - fn object(&self) -> &'static str { - "product" + pub fn paginate( + self, + ) -> stripe::ListPaginator> { + stripe::ListPaginator::from_search_params("/products/search", self) } } - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct PackageDimensions { - /// Height, in inches. - pub height: f64, - - /// Length, in inches. - pub length: f64, - - /// Weight, in ounces. - pub weight: f64, - - /// Width, in inches. - pub width: f64, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct ProductFeature { - /// The feature's name. - /// - /// Up to 80 characters long. - #[serde(skip_serializing_if = "Option::is_none")] - pub name: Option, -} - -/// The parameters for `Product::create`. -#[derive(Clone, Debug, Serialize)] +#[derive(Copy, Clone, Debug, serde::Serialize)] pub struct CreateProduct<'a> { - /// Whether the product is currently available for purchase. - /// - /// Defaults to `true`. + /// Whether the product is currently available for purchase. Defaults to `true`. #[serde(skip_serializing_if = "Option::is_none")] pub active: Option, - /// Data used to generate a new [Price](https://stripe.com/docs/api/prices) object. - /// /// This Price will be set as the default price for this product. #[serde(skip_serializing_if = "Option::is_none")] - pub default_price_data: Option, - + pub default_price_data: Option>, /// The product's description, meant to be displayable to the customer. - /// /// Use this field to optionally store a long form explanation of the product being sold for your own rendering purposes. #[serde(skip_serializing_if = "Option::is_none")] pub description: Option<&'a str>, - /// Specifies which fields in the response should be expanded. - #[serde(skip_serializing_if = "Expand::is_empty")] - pub expand: &'a [&'a str], - + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, /// A list of up to 15 features for this product. - /// /// These are displayed in [pricing tables](https://stripe.com/docs/payments/checkout/pricing-table). #[serde(skip_serializing_if = "Option::is_none")] - pub features: Option>, - + pub features: Option<&'a [Features<'a>]>, /// An identifier will be randomly generated by Stripe. - /// /// You can optionally override this ID, but the ID must be unique across all products in your Stripe account. #[serde(skip_serializing_if = "Option::is_none")] pub id: Option<&'a str>, - /// A list of up to 8 URLs of images for this product, meant to be displayable to the customer. #[serde(skip_serializing_if = "Option::is_none")] - pub images: Option>, - + pub images: Option<&'a [&'a str]>, /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. - /// /// This can be useful for storing additional information about the object in a structured format. /// Individual keys can be unset by posting an empty value to them. /// All keys can be unset by posting an empty value to `metadata`. #[serde(skip_serializing_if = "Option::is_none")] - pub metadata: Option, - + pub metadata: Option<&'a std::collections::HashMap>, /// The product's name, meant to be displayable to the customer. pub name: &'a str, - /// The dimensions of this product for shipping purposes. #[serde(skip_serializing_if = "Option::is_none")] - pub package_dimensions: Option, - + pub package_dimensions: Option, /// Whether this product is shipped (i.e., physical goods). #[serde(skip_serializing_if = "Option::is_none")] pub shippable: Option, - /// An arbitrary string to be displayed on your customer's credit card or bank statement. + /// While most banks display this information consistently, some may display it incorrectly or not at all. /// - /// While most banks display this information consistently, some may display it incorrectly or not at all. This may be up to 22 characters. + /// This may be up to 22 characters. /// The statement description may not include `<`, `>`, `\`, `"`, `'` characters, and will appear on your customer's statement in capital letters. - /// Non-ASCII characters are automatically stripped. It must contain at least one letter. + /// Non-ASCII characters are automatically stripped. + /// It must contain at least one letter. #[serde(skip_serializing_if = "Option::is_none")] pub statement_descriptor: Option<&'a str>, - /// A [tax code](https://stripe.com/docs/tax/tax-categories) ID. #[serde(skip_serializing_if = "Option::is_none")] - pub tax_code: Option, - + pub tax_code: Option<&'a str>, /// The type of the product. - /// /// Defaults to `service` if not explicitly specified, enabling use of this product with Subscriptions and Plans. /// Set this parameter to `good` to use this product with Orders and SKUs. /// On API versions before `2018-02-05`, this field defaults to `good` for compatibility reasons. #[serde(rename = "type")] #[serde(skip_serializing_if = "Option::is_none")] - pub type_: Option, - + pub type_: Option, /// A label that represents units of this product. - /// /// When set, this will be included in customers' receipts, invoices, Checkout, and the customer portal. #[serde(skip_serializing_if = "Option::is_none")] pub unit_label: Option<&'a str>, - /// A URL of a publicly-accessible webpage for this product. #[serde(skip_serializing_if = "Option::is_none")] pub url: Option<&'a str>, } - impl<'a> CreateProduct<'a> { pub fn new(name: &'a str) -> Self { - CreateProduct { - active: Default::default(), - default_price_data: Default::default(), - description: Default::default(), - expand: Default::default(), - features: Default::default(), - id: Default::default(), - images: Default::default(), - metadata: Default::default(), + Self { + active: None, + default_price_data: None, + description: None, + expand: None, + features: None, + id: None, + images: None, + metadata: None, name, - package_dimensions: Default::default(), - shippable: Default::default(), - statement_descriptor: Default::default(), - tax_code: Default::default(), - type_: Default::default(), - unit_label: Default::default(), - url: Default::default(), - } - } -} - -/// The parameters for `Product::list`. -#[derive(Clone, Debug, Serialize, Default)] -pub struct ListProducts<'a> { - /// Only return products that are active or inactive (e.g., pass `false` to list all inactive products). - #[serde(skip_serializing_if = "Option::is_none")] - pub active: Option, - - /// Only return products that were created during the given date interval. - #[serde(skip_serializing_if = "Option::is_none")] - pub created: Option>, - - /// A cursor for use in pagination. - /// - /// `ending_before` is an object ID that defines your place in the list. - /// For instance, if you make a list request and receive 100 objects, starting with `obj_bar`, your subsequent call can include `ending_before=obj_bar` in order to fetch the previous page of the list. - #[serde(skip_serializing_if = "Option::is_none")] - pub ending_before: Option, - - /// Specifies which fields in the response should be expanded. - #[serde(skip_serializing_if = "Expand::is_empty")] - pub expand: &'a [&'a str], - - /// Only return products with the given IDs. - /// - /// Cannot be used with [starting_after](https://stripe.com/docs/api#list_products-starting_after) or [ending_before](https://stripe.com/docs/api#list_products-ending_before). - #[serde(skip_serializing_if = "Option::is_none")] - pub ids: Option>, - - /// A limit on the number of objects to be returned. - /// - /// Limit can range between 1 and 100, and the default is 10. - #[serde(skip_serializing_if = "Option::is_none")] - pub limit: Option, - - /// Only return products that can be shipped (i.e., physical, not digital products). - #[serde(skip_serializing_if = "Option::is_none")] - pub shippable: Option, - - /// A cursor for use in pagination. - /// - /// `starting_after` is an object ID that defines your place in the list. - /// For instance, if you make a list request and receive 100 objects, ending with `obj_foo`, your subsequent call can include `starting_after=obj_foo` in order to fetch the next page of the list. - #[serde(skip_serializing_if = "Option::is_none")] - pub starting_after: Option, - - /// Only return products of this type. - #[serde(rename = "type")] - #[serde(skip_serializing_if = "Option::is_none")] - pub type_: Option, - - /// Only return products with the given url. - #[serde(skip_serializing_if = "Option::is_none")] - pub url: Option<&'a str>, -} - -impl<'a> ListProducts<'a> { - pub fn new() -> Self { - ListProducts { - active: Default::default(), - created: Default::default(), - ending_before: Default::default(), - expand: Default::default(), - ids: Default::default(), - limit: Default::default(), - shippable: Default::default(), - starting_after: Default::default(), - type_: Default::default(), - url: Default::default(), - } - } -} -impl Paginable for ListProducts<'_> { - type O = Product; - fn set_last(&mut self, item: Self::O) { - self.starting_after = Some(item.id()); - } -} -/// The parameters for `Product::update`. -#[derive(Clone, Debug, Serialize, Default)] -pub struct UpdateProduct<'a> { - /// Whether the product is available for purchase. - #[serde(skip_serializing_if = "Option::is_none")] - pub active: Option, - - /// The ID of the [Price](https://stripe.com/docs/api/prices) object that is the default price for this product. - #[serde(skip_serializing_if = "Option::is_none")] - pub default_price: Option<&'a str>, - - /// The product's description, meant to be displayable to the customer. - /// - /// Use this field to optionally store a long form explanation of the product being sold for your own rendering purposes. - #[serde(skip_serializing_if = "Option::is_none")] - pub description: Option, - - /// Specifies which fields in the response should be expanded. - #[serde(skip_serializing_if = "Expand::is_empty")] - pub expand: &'a [&'a str], - - /// A list of up to 15 features for this product. - /// - /// These are displayed in [pricing tables](https://stripe.com/docs/payments/checkout/pricing-table). - #[serde(skip_serializing_if = "Option::is_none")] - pub features: Option>, - - /// A list of up to 8 URLs of images for this product, meant to be displayable to the customer. - #[serde(skip_serializing_if = "Option::is_none")] - pub images: Option>, - - /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. - /// - /// This can be useful for storing additional information about the object in a structured format. - /// Individual keys can be unset by posting an empty value to them. - /// All keys can be unset by posting an empty value to `metadata`. - #[serde(skip_serializing_if = "Option::is_none")] - pub metadata: Option, - - /// The product's name, meant to be displayable to the customer. - #[serde(skip_serializing_if = "Option::is_none")] - pub name: Option<&'a str>, - - /// The dimensions of this product for shipping purposes. - #[serde(skip_serializing_if = "Option::is_none")] - pub package_dimensions: Option, - - /// Whether this product is shipped (i.e., physical goods). - #[serde(skip_serializing_if = "Option::is_none")] - pub shippable: Option, - - /// An arbitrary string to be displayed on your customer's credit card or bank statement. - /// - /// While most banks display this information consistently, some may display it incorrectly or not at all. This may be up to 22 characters. - /// The statement description may not include `<`, `>`, `\`, `"`, `'` characters, and will appear on your customer's statement in capital letters. - /// Non-ASCII characters are automatically stripped. It must contain at least one letter. - /// May only be set if `type=service`. - #[serde(skip_serializing_if = "Option::is_none")] - pub statement_descriptor: Option<&'a str>, - - /// A [tax code](https://stripe.com/docs/tax/tax-categories) ID. - #[serde(skip_serializing_if = "Option::is_none")] - pub tax_code: Option, - - /// A label that represents units of this product. - /// - /// When set, this will be included in customers' receipts, invoices, Checkout, and the customer portal. - /// May only be set if `type=service`. - #[serde(skip_serializing_if = "Option::is_none")] - pub unit_label: Option, - - /// A URL of a publicly-accessible webpage for this product. - #[serde(skip_serializing_if = "Option::is_none")] - pub url: Option, -} - -impl<'a> UpdateProduct<'a> { - pub fn new() -> Self { - UpdateProduct { - active: Default::default(), - default_price: Default::default(), - description: Default::default(), - expand: Default::default(), - features: Default::default(), - images: Default::default(), - metadata: Default::default(), - name: Default::default(), - package_dimensions: Default::default(), - shippable: Default::default(), - statement_descriptor: Default::default(), - tax_code: Default::default(), - unit_label: Default::default(), - url: Default::default(), + package_dimensions: None, + shippable: None, + statement_descriptor: None, + tax_code: None, + type_: None, + unit_label: None, + url: None, } } } - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreateProductDefaultPriceData { +/// Data used to generate a new [Price](https://stripe.com/docs/api/prices) object. +/// This Price will be set as the default price for this product. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreateProductDefaultPriceData<'a> { /// Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. - /// /// Must be a [supported currency](https://stripe.com/docs/currencies). - pub currency: Currency, - + pub currency: stripe_types::Currency, /// Prices defined in each available currency option. - /// /// Each key must be a three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html) and a [supported currency](https://stripe.com/docs/currencies). #[serde(skip_serializing_if = "Option::is_none")] - pub currency_options: Option>, - + pub currency_options: Option< + &'a std::collections::HashMap< + stripe_types::Currency, + CreateProductDefaultPriceDataCurrencyOptions, + >, + >, /// The recurring components of a price such as `interval` and `interval_count`. #[serde(skip_serializing_if = "Option::is_none")] pub recurring: Option, - /// Only required if a [default tax behavior](https://stripe.com/docs/tax/products-prices-tax-categories-tax-behavior#setting-a-default-tax-behavior-(recommended)) was not provided in the Stripe Tax settings. - /// /// Specifies whether the price is considered inclusive of taxes or exclusive of taxes. /// One of `inclusive`, `exclusive`, or `unspecified`. /// Once specified as either `inclusive` or `exclusive`, it cannot be changed. #[serde(skip_serializing_if = "Option::is_none")] pub tax_behavior: Option, - /// A positive integer in cents (or local equivalent) (or 0 for a free price) representing how much to charge. - /// /// One of `unit_amount` or `unit_amount_decimal` is required. #[serde(skip_serializing_if = "Option::is_none")] pub unit_amount: Option, - /// Same as `unit_amount`, but accepts a decimal value in cents (or local equivalent) with at most 12 decimal places. - /// /// Only one of `unit_amount` and `unit_amount_decimal` can be set. #[serde(skip_serializing_if = "Option::is_none")] - pub unit_amount_decimal: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreateProductFeatures { - /// The feature's name. - /// - /// Up to 80 characters long. - pub name: String, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UpdateProductFeatures { - /// The feature's name. - /// - /// Up to 80 characters long. - pub name: String, + pub unit_amount_decimal: Option<&'a str>, +} +impl<'a> CreateProductDefaultPriceData<'a> { + pub fn new(currency: stripe_types::Currency) -> Self { + Self { + currency, + currency_options: None, + recurring: None, + tax_behavior: None, + unit_amount: None, + unit_amount_decimal: None, + } + } } - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] +/// Prices defined in each available currency option. +/// Each key must be a three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html) and a [supported currency](https://stripe.com/docs/currencies). +#[derive(Clone, Debug, Default, serde::Serialize)] pub struct CreateProductDefaultPriceDataCurrencyOptions { /// When set, provides configuration for the amount to be adjusted by the customer during Checkout Sessions and Payment Links. #[serde(skip_serializing_if = "Option::is_none")] pub custom_unit_amount: Option, - /// Only required if a [default tax behavior](https://stripe.com/docs/tax/products-prices-tax-categories-tax-behavior#setting-a-default-tax-behavior-(recommended)) was not provided in the Stripe Tax settings. - /// /// Specifies whether the price is considered inclusive of taxes or exclusive of taxes. /// One of `inclusive`, `exclusive`, or `unspecified`. /// Once specified as either `inclusive` or `exclusive`, it cannot be changed. #[serde(skip_serializing_if = "Option::is_none")] pub tax_behavior: Option, - /// Each element represents a pricing tier. - /// /// This parameter requires `billing_scheme` to be set to `tiered`. /// See also the documentation for `billing_scheme`. #[serde(skip_serializing_if = "Option::is_none")] pub tiers: Option>, - /// A positive integer in cents (or local equivalent) (or 0 for a free price) representing how much to charge. #[serde(skip_serializing_if = "Option::is_none")] pub unit_amount: Option, - /// Same as `unit_amount`, but accepts a decimal value in cents (or local equivalent) with at most 12 decimal places. - /// /// Only one of `unit_amount` and `unit_amount_decimal` can be set. #[serde(skip_serializing_if = "Option::is_none")] pub unit_amount_decimal: Option, } - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreateProductDefaultPriceDataRecurring { - /// Specifies billing frequency. - /// - /// Either `day`, `week`, `month` or `year`. - pub interval: CreateProductDefaultPriceDataRecurringInterval, - - /// The number of intervals between subscription billings. - /// - /// For example, `interval=month` and `interval_count=3` bills every 3 months. - /// Maximum of three years interval allowed (3 years, 36 months, or 156 weeks). - #[serde(skip_serializing_if = "Option::is_none")] - pub interval_count: Option, +impl CreateProductDefaultPriceDataCurrencyOptions { + pub fn new() -> Self { + Self::default() + } } - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] +/// When set, provides configuration for the amount to be adjusted by the customer during Checkout Sessions and Payment Links. +#[derive(Copy, Clone, Debug, serde::Serialize)] pub struct CreateProductDefaultPriceDataCurrencyOptionsCustomUnitAmount { /// Pass in `true` to enable `custom_unit_amount`, otherwise omit `custom_unit_amount`. pub enabled: bool, - /// The maximum unit amount the customer can specify for this item. #[serde(skip_serializing_if = "Option::is_none")] pub maximum: Option, - /// The minimum unit amount the customer can specify for this item. - /// /// Must be at least the minimum charge amount. #[serde(skip_serializing_if = "Option::is_none")] pub minimum: Option, - /// The starting unit amount which can be updated by the customer. #[serde(skip_serializing_if = "Option::is_none")] pub preset: Option, } +impl CreateProductDefaultPriceDataCurrencyOptionsCustomUnitAmount { + pub fn new(enabled: bool) -> Self { + Self { enabled, maximum: None, minimum: None, preset: None } + } +} +/// Only required if a [default tax behavior](https://stripe.com/docs/tax/products-prices-tax-categories-tax-behavior#setting-a-default-tax-behavior-(recommended)) was not provided in the Stripe Tax settings. +/// Specifies whether the price is considered inclusive of taxes or exclusive of taxes. +/// One of `inclusive`, `exclusive`, or `unspecified`. +/// Once specified as either `inclusive` or `exclusive`, it cannot be changed. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreateProductDefaultPriceDataCurrencyOptionsTaxBehavior { + Exclusive, + Inclusive, + Unspecified, +} +impl CreateProductDefaultPriceDataCurrencyOptionsTaxBehavior { + pub fn as_str(self) -> &'static str { + use CreateProductDefaultPriceDataCurrencyOptionsTaxBehavior::*; + match self { + Exclusive => "exclusive", + Inclusive => "inclusive", + Unspecified => "unspecified", + } + } +} + +impl std::str::FromStr for CreateProductDefaultPriceDataCurrencyOptionsTaxBehavior { + type Err = (); + fn from_str(s: &str) -> Result { + use CreateProductDefaultPriceDataCurrencyOptionsTaxBehavior::*; + match s { + "exclusive" => Ok(Exclusive), + "inclusive" => Ok(Inclusive), + "unspecified" => Ok(Unspecified), + _ => Err(()), + } + } +} +impl std::fmt::Display for CreateProductDefaultPriceDataCurrencyOptionsTaxBehavior { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} -#[derive(Clone, Debug, Default, Deserialize, Serialize)] +impl std::fmt::Debug for CreateProductDefaultPriceDataCurrencyOptionsTaxBehavior { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreateProductDefaultPriceDataCurrencyOptionsTaxBehavior { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Each element represents a pricing tier. +/// This parameter requires `billing_scheme` to be set to `tiered`. +/// See also the documentation for `billing_scheme`. +#[derive(Clone, Debug, serde::Serialize)] pub struct CreateProductDefaultPriceDataCurrencyOptionsTiers { /// The flat billing amount for an entire tier, regardless of the number of units in the tier. #[serde(skip_serializing_if = "Option::is_none")] pub flat_amount: Option, - /// Same as `flat_amount`, but accepts a decimal value representing an integer in the minor units of the currency. - /// /// Only one of `flat_amount` and `flat_amount_decimal` can be set. #[serde(skip_serializing_if = "Option::is_none")] pub flat_amount_decimal: Option, - /// The per unit billing amount for each individual unit for which this tier applies. #[serde(skip_serializing_if = "Option::is_none")] pub unit_amount: Option, - /// Same as `unit_amount`, but accepts a decimal value in cents (or local equivalent) with at most 12 decimal places. - /// /// Only one of `unit_amount` and `unit_amount_decimal` can be set. #[serde(skip_serializing_if = "Option::is_none")] pub unit_amount_decimal: Option, - /// Specifies the upper bound of this tier. - /// /// The lower bound of a tier is the upper bound of the previous tier adding one. /// Use `inf` to define a fallback tier. - pub up_to: Option, -} - -/// An enum representing the possible values of an `CreateProductDefaultPriceDataCurrencyOptions`'s `tax_behavior` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CreateProductDefaultPriceDataCurrencyOptionsTaxBehavior { - Exclusive, - Inclusive, - Unspecified, -} - -impl CreateProductDefaultPriceDataCurrencyOptionsTaxBehavior { - pub fn as_str(self) -> &'static str { - match self { - CreateProductDefaultPriceDataCurrencyOptionsTaxBehavior::Exclusive => "exclusive", - CreateProductDefaultPriceDataCurrencyOptionsTaxBehavior::Inclusive => "inclusive", - CreateProductDefaultPriceDataCurrencyOptionsTaxBehavior::Unspecified => "unspecified", + pub up_to: CreateProductDefaultPriceDataCurrencyOptionsTiersUpTo, +} +impl CreateProductDefaultPriceDataCurrencyOptionsTiers { + pub fn new(up_to: CreateProductDefaultPriceDataCurrencyOptionsTiersUpTo) -> Self { + Self { + flat_amount: None, + flat_amount_decimal: None, + unit_amount: None, + unit_amount_decimal: None, + up_to, } } } - -impl AsRef for CreateProductDefaultPriceDataCurrencyOptionsTaxBehavior { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for CreateProductDefaultPriceDataCurrencyOptionsTaxBehavior { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } +/// Specifies the upper bound of this tier. +/// The lower bound of a tier is the upper bound of the previous tier adding one. +/// Use `inf` to define a fallback tier. +#[derive(Copy, Clone, Debug, serde::Serialize)] +#[serde(untagged)] +pub enum CreateProductDefaultPriceDataCurrencyOptionsTiersUpTo { + Inf, + I64(i64), +} +/// The recurring components of a price such as `interval` and `interval_count`. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreateProductDefaultPriceDataRecurring { + /// Specifies billing frequency. Either `day`, `week`, `month` or `year`. + pub interval: CreateProductDefaultPriceDataRecurringInterval, + /// The number of intervals between subscription billings. + /// For example, `interval=month` and `interval_count=3` bills every 3 months. + /// Maximum of three years interval allowed (3 years, 36 months, or 156 weeks). + #[serde(skip_serializing_if = "Option::is_none")] + pub interval_count: Option, } -impl std::default::Default for CreateProductDefaultPriceDataCurrencyOptionsTaxBehavior { - fn default() -> Self { - Self::Exclusive +impl CreateProductDefaultPriceDataRecurring { + pub fn new(interval: CreateProductDefaultPriceDataRecurringInterval) -> Self { + Self { interval, interval_count: None } } } - -/// An enum representing the possible values of an `CreateProductDefaultPriceDataRecurring`'s `interval` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] +/// Specifies billing frequency. Either `day`, `week`, `month` or `year`. +#[derive(Copy, Clone, Eq, PartialEq)] pub enum CreateProductDefaultPriceDataRecurringInterval { Day, Month, Week, Year, } - impl CreateProductDefaultPriceDataRecurringInterval { pub fn as_str(self) -> &'static str { + use CreateProductDefaultPriceDataRecurringInterval::*; match self { - CreateProductDefaultPriceDataRecurringInterval::Day => "day", - CreateProductDefaultPriceDataRecurringInterval::Month => "month", - CreateProductDefaultPriceDataRecurringInterval::Week => "week", - CreateProductDefaultPriceDataRecurringInterval::Year => "year", + Day => "day", + Month => "month", + Week => "week", + Year => "year", } } } -impl AsRef for CreateProductDefaultPriceDataRecurringInterval { - fn as_ref(&self) -> &str { - self.as_str() +impl std::str::FromStr for CreateProductDefaultPriceDataRecurringInterval { + type Err = (); + fn from_str(s: &str) -> Result { + use CreateProductDefaultPriceDataRecurringInterval::*; + match s { + "day" => Ok(Day), + "month" => Ok(Month), + "week" => Ok(Week), + "year" => Ok(Year), + _ => Err(()), + } } } - impl std::fmt::Display for CreateProductDefaultPriceDataRecurringInterval { fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreateProductDefaultPriceDataRecurringInterval { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) } } -impl std::default::Default for CreateProductDefaultPriceDataRecurringInterval { - fn default() -> Self { - Self::Day +impl serde::Serialize for CreateProductDefaultPriceDataRecurringInterval { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) } } - -/// An enum representing the possible values of an `CreateProductDefaultPriceData`'s `tax_behavior` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] +/// Only required if a [default tax behavior](https://stripe.com/docs/tax/products-prices-tax-categories-tax-behavior#setting-a-default-tax-behavior-(recommended)) was not provided in the Stripe Tax settings. +/// Specifies whether the price is considered inclusive of taxes or exclusive of taxes. +/// One of `inclusive`, `exclusive`, or `unspecified`. +/// Once specified as either `inclusive` or `exclusive`, it cannot be changed. +#[derive(Copy, Clone, Eq, PartialEq)] pub enum CreateProductDefaultPriceDataTaxBehavior { Exclusive, Inclusive, Unspecified, } - impl CreateProductDefaultPriceDataTaxBehavior { pub fn as_str(self) -> &'static str { + use CreateProductDefaultPriceDataTaxBehavior::*; match self { - CreateProductDefaultPriceDataTaxBehavior::Exclusive => "exclusive", - CreateProductDefaultPriceDataTaxBehavior::Inclusive => "inclusive", - CreateProductDefaultPriceDataTaxBehavior::Unspecified => "unspecified", + Exclusive => "exclusive", + Inclusive => "inclusive", + Unspecified => "unspecified", } } } -impl AsRef for CreateProductDefaultPriceDataTaxBehavior { - fn as_ref(&self) -> &str { - self.as_str() +impl std::str::FromStr for CreateProductDefaultPriceDataTaxBehavior { + type Err = (); + fn from_str(s: &str) -> Result { + use CreateProductDefaultPriceDataTaxBehavior::*; + match s { + "exclusive" => Ok(Exclusive), + "inclusive" => Ok(Inclusive), + "unspecified" => Ok(Unspecified), + _ => Err(()), + } } } - impl std::fmt::Display for CreateProductDefaultPriceDataTaxBehavior { fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) + f.write_str(self.as_str()) } } -impl std::default::Default for CreateProductDefaultPriceDataTaxBehavior { - fn default() -> Self { - Self::Exclusive + +impl std::fmt::Debug for CreateProductDefaultPriceDataTaxBehavior { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) } } - -/// An enum representing the possible values of an `Product`'s `type` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum ProductType { - Good, - Service, +impl serde::Serialize for CreateProductDefaultPriceDataTaxBehavior { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } } - -impl ProductType { - pub fn as_str(self) -> &'static str { - match self { - ProductType::Good => "good", - ProductType::Service => "service", - } +impl<'a> CreateProduct<'a> { + /// Creates a new product object. + pub fn send(&self, client: &stripe::Client) -> stripe::Response { + client.send_form("/products", self, http_types::Method::Post) } } - -impl AsRef for ProductType { - fn as_ref(&self) -> &str { - self.as_str() +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdateProduct<'a> { + /// Whether the product is available for purchase. + #[serde(skip_serializing_if = "Option::is_none")] + pub active: Option, + /// The ID of the [Price](https://stripe.com/docs/api/prices) object that is the default price for this product. + #[serde(skip_serializing_if = "Option::is_none")] + pub default_price: Option<&'a str>, + /// The product's description, meant to be displayable to the customer. + /// Use this field to optionally store a long form explanation of the product being sold for your own rendering purposes. + #[serde(skip_serializing_if = "Option::is_none")] + pub description: Option<&'a str>, + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, + /// A list of up to 15 features for this product. + /// These are displayed in [pricing tables](https://stripe.com/docs/payments/checkout/pricing-table). + #[serde(skip_serializing_if = "Option::is_none")] + pub features: Option<&'a [Features<'a>]>, + /// A list of up to 8 URLs of images for this product, meant to be displayable to the customer. + #[serde(skip_serializing_if = "Option::is_none")] + pub images: Option<&'a [&'a str]>, + /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. + /// This can be useful for storing additional information about the object in a structured format. + /// Individual keys can be unset by posting an empty value to them. + /// All keys can be unset by posting an empty value to `metadata`. + #[serde(skip_serializing_if = "Option::is_none")] + pub metadata: Option<&'a std::collections::HashMap>, + /// The product's name, meant to be displayable to the customer. + #[serde(skip_serializing_if = "Option::is_none")] + pub name: Option<&'a str>, + /// The dimensions of this product for shipping purposes. + #[serde(skip_serializing_if = "Option::is_none")] + pub package_dimensions: Option, + /// Whether this product is shipped (i.e., physical goods). + #[serde(skip_serializing_if = "Option::is_none")] + pub shippable: Option, + /// An arbitrary string to be displayed on your customer's credit card or bank statement. + /// While most banks display this information consistently, some may display it incorrectly or not at all. + /// + /// This may be up to 22 characters. + /// The statement description may not include `<`, `>`, `\`, `"`, `'` characters, and will appear on your customer's statement in capital letters. + /// Non-ASCII characters are automatically stripped. + /// It must contain at least one letter. May only be set if `type=service`. + #[serde(skip_serializing_if = "Option::is_none")] + pub statement_descriptor: Option<&'a str>, + /// A [tax code](https://stripe.com/docs/tax/tax-categories) ID. + #[serde(skip_serializing_if = "Option::is_none")] + pub tax_code: Option<&'a str>, + /// A label that represents units of this product. + /// When set, this will be included in customers' receipts, invoices, Checkout, and the customer portal. + /// May only be set if `type=service`. + #[serde(skip_serializing_if = "Option::is_none")] + pub unit_label: Option<&'a str>, + /// A URL of a publicly-accessible webpage for this product. + #[serde(skip_serializing_if = "Option::is_none")] + pub url: Option<&'a str>, +} +impl<'a> UpdateProduct<'a> { + pub fn new() -> Self { + Self::default() } } - -impl std::fmt::Display for ProductType { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) +impl<'a> UpdateProduct<'a> { + /// Updates the specific product by setting the values of the parameters passed. + /// Any parameters not provided will be left unchanged. + pub fn send( + &self, + client: &stripe::Client, + id: &stripe_shared::ProductId, + ) -> stripe::Response { + client.send_form(&format!("/products/{id}"), self, http_types::Method::Post) + } +} +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct Features<'a> { + /// The feature's name. Up to 80 characters long. + pub name: &'a str, +} +impl<'a> Features<'a> { + pub fn new(name: &'a str) -> Self { + Self { name } } } -impl std::default::Default for ProductType { - fn default() -> Self { - Self::Good +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct PackageDimensionsSpecs { + /// Height, in inches. Maximum precision is 2 decimal places. + pub height: f64, + /// Length, in inches. Maximum precision is 2 decimal places. + pub length: f64, + /// Weight, in ounces. Maximum precision is 2 decimal places. + pub weight: f64, + /// Width, in inches. Maximum precision is 2 decimal places. + pub width: f64, +} +impl PackageDimensionsSpecs { + pub fn new(height: f64, length: f64, weight: f64, width: f64) -> Self { + Self { height, length, weight, width } } } diff --git a/generated/stripe_product/src/promotion_code/mod.rs b/generated/stripe_product/src/promotion_code/mod.rs new file mode 100644 index 000000000..b018bb299 --- /dev/null +++ b/generated/stripe_product/src/promotion_code/mod.rs @@ -0,0 +1,4 @@ +#[cfg(feature = "promotion_code")] +mod requests; +#[cfg(feature = "promotion_code")] +pub use requests::*; diff --git a/generated/stripe_product/src/promotion_code/requests.rs b/generated/stripe_product/src/promotion_code/requests.rs new file mode 100644 index 000000000..9e35b2d1d --- /dev/null +++ b/generated/stripe_product/src/promotion_code/requests.rs @@ -0,0 +1,223 @@ +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct ListPromotionCode<'a> { + /// Filter promotion codes by whether they are active. + #[serde(skip_serializing_if = "Option::is_none")] + pub active: Option, + /// Only return promotion codes that have this case-insensitive code. + #[serde(skip_serializing_if = "Option::is_none")] + pub code: Option<&'a str>, + /// Only return promotion codes for this coupon. + #[serde(skip_serializing_if = "Option::is_none")] + pub coupon: Option<&'a str>, + /// A filter on the list, based on the object `created` field. + /// The value can be a string with an integer Unix timestamp, or it can be a dictionary with a number of different query options. + #[serde(skip_serializing_if = "Option::is_none")] + pub created: Option, + /// Only return promotion codes that are restricted to this customer. + #[serde(skip_serializing_if = "Option::is_none")] + pub customer: Option<&'a str>, + /// A cursor for use in pagination. + /// `ending_before` is an object ID that defines your place in the list. + /// For instance, if you make a list request and receive 100 objects, starting with `obj_bar`, your subsequent call can include `ending_before=obj_bar` in order to fetch the previous page of the list. + #[serde(skip_serializing_if = "Option::is_none")] + pub ending_before: Option<&'a str>, + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, + /// A limit on the number of objects to be returned. + /// Limit can range between 1 and 100, and the default is 10. + #[serde(skip_serializing_if = "Option::is_none")] + pub limit: Option, + /// A cursor for use in pagination. + /// `starting_after` is an object ID that defines your place in the list. + /// For instance, if you make a list request and receive 100 objects, ending with `obj_foo`, your subsequent call can include `starting_after=obj_foo` in order to fetch the next page of the list. + #[serde(skip_serializing_if = "Option::is_none")] + pub starting_after: Option<&'a str>, +} +impl<'a> ListPromotionCode<'a> { + pub fn new() -> Self { + Self::default() + } +} +impl<'a> ListPromotionCode<'a> { + /// Returns a list of your promotion codes. + pub fn send( + &self, + client: &stripe::Client, + ) -> stripe::Response> { + client.get_query("/promotion_codes", self) + } + pub fn paginate( + self, + ) -> stripe::ListPaginator> { + stripe::ListPaginator::from_list_params("/promotion_codes", self) + } +} +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct RetrievePromotionCode<'a> { + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, +} +impl<'a> RetrievePromotionCode<'a> { + pub fn new() -> Self { + Self::default() + } +} +impl<'a> RetrievePromotionCode<'a> { + /// Retrieves the promotion code with the given ID. + /// In order to retrieve a promotion code by the customer-facing `code` use [list](https://stripe.com/docs/api/promotion_codes/list) with the desired `code`. + pub fn send( + &self, + client: &stripe::Client, + promotion_code: &stripe_shared::PromotionCodeId, + ) -> stripe::Response { + client.get_query(&format!("/promotion_codes/{promotion_code}"), self) + } +} +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreatePromotionCode<'a> { + /// Whether the promotion code is currently active. + #[serde(skip_serializing_if = "Option::is_none")] + pub active: Option, + /// The customer-facing code. + /// Regardless of case, this code must be unique across all active promotion codes for a specific customer. + /// If left blank, we will generate one automatically. + #[serde(skip_serializing_if = "Option::is_none")] + pub code: Option<&'a str>, + /// The coupon for this promotion code. + pub coupon: &'a str, + /// The customer that this promotion code can be used by. + /// If not set, the promotion code can be used by all customers. + #[serde(skip_serializing_if = "Option::is_none")] + pub customer: Option<&'a str>, + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, + /// The timestamp at which this promotion code will expire. + /// If the coupon has specified a `redeems_by`, then this value cannot be after the coupon's `redeems_by`. + #[serde(skip_serializing_if = "Option::is_none")] + pub expires_at: Option, + /// A positive integer specifying the number of times the promotion code can be redeemed. + /// If the coupon has specified a `max_redemptions`, then this value cannot be greater than the coupon's `max_redemptions`. + #[serde(skip_serializing_if = "Option::is_none")] + pub max_redemptions: Option, + /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. + /// This can be useful for storing additional information about the object in a structured format. + /// Individual keys can be unset by posting an empty value to them. + /// All keys can be unset by posting an empty value to `metadata`. + #[serde(skip_serializing_if = "Option::is_none")] + pub metadata: Option<&'a std::collections::HashMap>, + /// Settings that restrict the redemption of the promotion code. + #[serde(skip_serializing_if = "Option::is_none")] + pub restrictions: Option>, +} +impl<'a> CreatePromotionCode<'a> { + pub fn new(coupon: &'a str) -> Self { + Self { + active: None, + code: None, + coupon, + customer: None, + expand: None, + expires_at: None, + max_redemptions: None, + metadata: None, + restrictions: None, + } + } +} +/// Settings that restrict the redemption of the promotion code. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreatePromotionCodeRestrictions<'a> { + /// Promotion codes defined in each available currency option. + /// Each key must be a three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html) and a [supported currency](https://stripe.com/docs/currencies). + #[serde(skip_serializing_if = "Option::is_none")] + pub currency_options: + Option<&'a std::collections::HashMap>, + /// A Boolean indicating if the Promotion Code should only be redeemed for Customers without any successful payments or invoices. + #[serde(skip_serializing_if = "Option::is_none")] + pub first_time_transaction: Option, + /// Minimum amount required to redeem this Promotion Code into a Coupon (e.g., a purchase must be $100 or more to work). + #[serde(skip_serializing_if = "Option::is_none")] + pub minimum_amount: Option, + /// Three-letter [ISO code](https://stripe.com/docs/currencies) for minimum_amount + #[serde(skip_serializing_if = "Option::is_none")] + pub minimum_amount_currency: Option, +} +impl<'a> CreatePromotionCodeRestrictions<'a> { + pub fn new() -> Self { + Self::default() + } +} +impl<'a> CreatePromotionCode<'a> { + /// A promotion code points to a coupon. + /// You can optionally restrict the code to a specific customer, redemption limit, and expiration date. + pub fn send(&self, client: &stripe::Client) -> stripe::Response { + client.send_form("/promotion_codes", self, http_types::Method::Post) + } +} +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdatePromotionCode<'a> { + /// Whether the promotion code is currently active. + /// A promotion code can only be reactivated when the coupon is still valid and the promotion code is otherwise redeemable. + #[serde(skip_serializing_if = "Option::is_none")] + pub active: Option, + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, + /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. + /// This can be useful for storing additional information about the object in a structured format. + /// Individual keys can be unset by posting an empty value to them. + /// All keys can be unset by posting an empty value to `metadata`. + #[serde(skip_serializing_if = "Option::is_none")] + pub metadata: Option<&'a std::collections::HashMap>, + /// Settings that restrict the redemption of the promotion code. + #[serde(skip_serializing_if = "Option::is_none")] + pub restrictions: Option>, +} +impl<'a> UpdatePromotionCode<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// Settings that restrict the redemption of the promotion code. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdatePromotionCodeRestrictions<'a> { + /// Promotion codes defined in each available currency option. + /// Each key must be a three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html) and a [supported currency](https://stripe.com/docs/currencies). + #[serde(skip_serializing_if = "Option::is_none")] + pub currency_options: + Option<&'a std::collections::HashMap>, +} +impl<'a> UpdatePromotionCodeRestrictions<'a> { + pub fn new() -> Self { + Self::default() + } +} +impl<'a> UpdatePromotionCode<'a> { + /// Updates the specified promotion code by setting the values of the parameters passed. + /// Most fields are, by design, not editable. + pub fn send( + &self, + client: &stripe::Client, + promotion_code: &stripe_shared::PromotionCodeId, + ) -> stripe::Response { + client.send_form( + &format!("/promotion_codes/{promotion_code}"), + self, + http_types::Method::Post, + ) + } +} +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CurrencyOption { + /// Minimum amount required to redeem this Promotion Code into a Coupon (e.g., a purchase must be $100 or more to work). + #[serde(skip_serializing_if = "Option::is_none")] + pub minimum_amount: Option, +} +impl CurrencyOption { + pub fn new() -> Self { + Self::default() + } +} diff --git a/generated/stripe_product/src/shipping_rate/mod.rs b/generated/stripe_product/src/shipping_rate/mod.rs new file mode 100644 index 000000000..7c38e9537 --- /dev/null +++ b/generated/stripe_product/src/shipping_rate/mod.rs @@ -0,0 +1,4 @@ +#[cfg(feature = "shipping_rate")] +mod requests; +#[cfg(feature = "shipping_rate")] +pub use requests::*; diff --git a/generated/stripe_product/src/shipping_rate/requests.rs b/generated/stripe_product/src/shipping_rate/requests.rs new file mode 100644 index 000000000..c785de5c1 --- /dev/null +++ b/generated/stripe_product/src/shipping_rate/requests.rs @@ -0,0 +1,391 @@ +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct ListShippingRate<'a> { + /// Only return shipping rates that are active or inactive. + #[serde(skip_serializing_if = "Option::is_none")] + pub active: Option, + /// A filter on the list, based on the object `created` field. + /// The value can be a string with an integer Unix timestamp, or it can be a dictionary with a number of different query options. + #[serde(skip_serializing_if = "Option::is_none")] + pub created: Option, + /// Only return shipping rates for the given currency. + #[serde(skip_serializing_if = "Option::is_none")] + pub currency: Option, + /// A cursor for use in pagination. + /// `ending_before` is an object ID that defines your place in the list. + /// For instance, if you make a list request and receive 100 objects, starting with `obj_bar`, your subsequent call can include `ending_before=obj_bar` in order to fetch the previous page of the list. + #[serde(skip_serializing_if = "Option::is_none")] + pub ending_before: Option<&'a str>, + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, + /// A limit on the number of objects to be returned. + /// Limit can range between 1 and 100, and the default is 10. + #[serde(skip_serializing_if = "Option::is_none")] + pub limit: Option, + /// A cursor for use in pagination. + /// `starting_after` is an object ID that defines your place in the list. + /// For instance, if you make a list request and receive 100 objects, ending with `obj_foo`, your subsequent call can include `starting_after=obj_foo` in order to fetch the next page of the list. + #[serde(skip_serializing_if = "Option::is_none")] + pub starting_after: Option<&'a str>, +} +impl<'a> ListShippingRate<'a> { + pub fn new() -> Self { + Self::default() + } +} +impl<'a> ListShippingRate<'a> { + /// Returns a list of your shipping rates. + pub fn send( + &self, + client: &stripe::Client, + ) -> stripe::Response> { + client.get_query("/shipping_rates", self) + } + pub fn paginate( + self, + ) -> stripe::ListPaginator> { + stripe::ListPaginator::from_list_params("/shipping_rates", self) + } +} +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct RetrieveShippingRate<'a> { + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, +} +impl<'a> RetrieveShippingRate<'a> { + pub fn new() -> Self { + Self::default() + } +} +impl<'a> RetrieveShippingRate<'a> { + /// Returns the shipping rate object with the given ID. + pub fn send( + &self, + client: &stripe::Client, + shipping_rate_token: &stripe_shared::ShippingRateId, + ) -> stripe::Response { + client.get_query(&format!("/shipping_rates/{shipping_rate_token}"), self) + } +} +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreateShippingRate<'a> { + /// The estimated range for how long shipping will take, meant to be displayable to the customer. + /// This will appear on CheckoutSessions. + #[serde(skip_serializing_if = "Option::is_none")] + pub delivery_estimate: Option, + /// The name of the shipping rate, meant to be displayable to the customer. + /// This will appear on CheckoutSessions. + pub display_name: &'a str, + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, + /// Describes a fixed amount to charge for shipping. Must be present if type is `fixed_amount`. + #[serde(skip_serializing_if = "Option::is_none")] + pub fixed_amount: Option>, + /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. + /// This can be useful for storing additional information about the object in a structured format. + /// Individual keys can be unset by posting an empty value to them. + /// All keys can be unset by posting an empty value to `metadata`. + #[serde(skip_serializing_if = "Option::is_none")] + pub metadata: Option<&'a std::collections::HashMap>, + /// Specifies whether the rate is considered inclusive of taxes or exclusive of taxes. + /// One of `inclusive`, `exclusive`, or `unspecified`. + #[serde(skip_serializing_if = "Option::is_none")] + pub tax_behavior: Option, + /// A [tax code](https://stripe.com/docs/tax/tax-categories) ID. + /// The Shipping tax code is `txcd_92010001`. + #[serde(skip_serializing_if = "Option::is_none")] + pub tax_code: Option<&'a str>, + /// The type of calculation to use on the shipping rate. Can only be `fixed_amount` for now. + #[serde(rename = "type")] + #[serde(skip_serializing_if = "Option::is_none")] + pub type_: Option, +} +impl<'a> CreateShippingRate<'a> { + pub fn new(display_name: &'a str) -> Self { + Self { + delivery_estimate: None, + display_name, + expand: None, + fixed_amount: None, + metadata: None, + tax_behavior: None, + tax_code: None, + type_: None, + } + } +} +/// The estimated range for how long shipping will take, meant to be displayable to the customer. +/// This will appear on CheckoutSessions. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreateShippingRateDeliveryEstimate { + /// The upper bound of the estimated range. If empty, represents no upper bound i.e., infinite. + #[serde(skip_serializing_if = "Option::is_none")] + pub maximum: Option, + /// The lower bound of the estimated range. If empty, represents no lower bound. + #[serde(skip_serializing_if = "Option::is_none")] + pub minimum: Option, +} +impl CreateShippingRateDeliveryEstimate { + pub fn new() -> Self { + Self::default() + } +} +/// The upper bound of the estimated range. If empty, represents no upper bound i.e., infinite. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreateShippingRateDeliveryEstimateMaximum { + /// A unit of time. + pub unit: CreateShippingRateDeliveryEstimateMaximumUnit, + /// Must be greater than 0. + pub value: i64, +} +impl CreateShippingRateDeliveryEstimateMaximum { + pub fn new(unit: CreateShippingRateDeliveryEstimateMaximumUnit, value: i64) -> Self { + Self { unit, value } + } +} +/// A unit of time. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreateShippingRateDeliveryEstimateMaximumUnit { + BusinessDay, + Day, + Hour, + Month, + Week, +} +impl CreateShippingRateDeliveryEstimateMaximumUnit { + pub fn as_str(self) -> &'static str { + use CreateShippingRateDeliveryEstimateMaximumUnit::*; + match self { + BusinessDay => "business_day", + Day => "day", + Hour => "hour", + Month => "month", + Week => "week", + } + } +} + +impl std::str::FromStr for CreateShippingRateDeliveryEstimateMaximumUnit { + type Err = (); + fn from_str(s: &str) -> Result { + use CreateShippingRateDeliveryEstimateMaximumUnit::*; + match s { + "business_day" => Ok(BusinessDay), + "day" => Ok(Day), + "hour" => Ok(Hour), + "month" => Ok(Month), + "week" => Ok(Week), + _ => Err(()), + } + } +} +impl std::fmt::Display for CreateShippingRateDeliveryEstimateMaximumUnit { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreateShippingRateDeliveryEstimateMaximumUnit { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreateShippingRateDeliveryEstimateMaximumUnit { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// The lower bound of the estimated range. If empty, represents no lower bound. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreateShippingRateDeliveryEstimateMinimum { + /// A unit of time. + pub unit: CreateShippingRateDeliveryEstimateMinimumUnit, + /// Must be greater than 0. + pub value: i64, +} +impl CreateShippingRateDeliveryEstimateMinimum { + pub fn new(unit: CreateShippingRateDeliveryEstimateMinimumUnit, value: i64) -> Self { + Self { unit, value } + } +} +/// A unit of time. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreateShippingRateDeliveryEstimateMinimumUnit { + BusinessDay, + Day, + Hour, + Month, + Week, +} +impl CreateShippingRateDeliveryEstimateMinimumUnit { + pub fn as_str(self) -> &'static str { + use CreateShippingRateDeliveryEstimateMinimumUnit::*; + match self { + BusinessDay => "business_day", + Day => "day", + Hour => "hour", + Month => "month", + Week => "week", + } + } +} + +impl std::str::FromStr for CreateShippingRateDeliveryEstimateMinimumUnit { + type Err = (); + fn from_str(s: &str) -> Result { + use CreateShippingRateDeliveryEstimateMinimumUnit::*; + match s { + "business_day" => Ok(BusinessDay), + "day" => Ok(Day), + "hour" => Ok(Hour), + "month" => Ok(Month), + "week" => Ok(Week), + _ => Err(()), + } + } +} +impl std::fmt::Display for CreateShippingRateDeliveryEstimateMinimumUnit { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreateShippingRateDeliveryEstimateMinimumUnit { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreateShippingRateDeliveryEstimateMinimumUnit { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Describes a fixed amount to charge for shipping. Must be present if type is `fixed_amount`. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreateShippingRateFixedAmount<'a> { + /// A non-negative integer in cents representing how much to charge. + pub amount: i64, + /// Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. + /// Must be a [supported currency](https://stripe.com/docs/currencies). + pub currency: stripe_types::Currency, + /// Shipping rates defined in each available currency option. + /// Each key must be a three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html) and a [supported currency](https://stripe.com/docs/currencies). + #[serde(skip_serializing_if = "Option::is_none")] + pub currency_options: Option< + &'a std::collections::HashMap< + stripe_types::Currency, + CreateShippingRateFixedAmountCurrencyOptions, + >, + >, +} +impl<'a> CreateShippingRateFixedAmount<'a> { + pub fn new(amount: i64, currency: stripe_types::Currency) -> Self { + Self { amount, currency, currency_options: None } + } +} +/// Shipping rates defined in each available currency option. +/// Each key must be a three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html) and a [supported currency](https://stripe.com/docs/currencies). +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreateShippingRateFixedAmountCurrencyOptions { + /// A non-negative integer in cents representing how much to charge. + pub amount: i64, + /// Specifies whether the rate is considered inclusive of taxes or exclusive of taxes. + /// One of `inclusive`, `exclusive`, or `unspecified`. + #[serde(skip_serializing_if = "Option::is_none")] + pub tax_behavior: Option, +} +impl CreateShippingRateFixedAmountCurrencyOptions { + pub fn new(amount: i64) -> Self { + Self { amount, tax_behavior: None } + } +} +impl<'a> CreateShippingRate<'a> { + /// Creates a new shipping rate object. + pub fn send(&self, client: &stripe::Client) -> stripe::Response { + client.send_form("/shipping_rates", self, http_types::Method::Post) + } +} +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdateShippingRate<'a> { + /// Whether the shipping rate can be used for new purchases. Defaults to `true`. + #[serde(skip_serializing_if = "Option::is_none")] + pub active: Option, + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, + /// Describes a fixed amount to charge for shipping. Must be present if type is `fixed_amount`. + #[serde(skip_serializing_if = "Option::is_none")] + pub fixed_amount: Option>, + /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. + /// This can be useful for storing additional information about the object in a structured format. + /// Individual keys can be unset by posting an empty value to them. + /// All keys can be unset by posting an empty value to `metadata`. + #[serde(skip_serializing_if = "Option::is_none")] + pub metadata: Option<&'a std::collections::HashMap>, + /// Specifies whether the rate is considered inclusive of taxes or exclusive of taxes. + /// One of `inclusive`, `exclusive`, or `unspecified`. + #[serde(skip_serializing_if = "Option::is_none")] + pub tax_behavior: Option, +} +impl<'a> UpdateShippingRate<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// Describes a fixed amount to charge for shipping. Must be present if type is `fixed_amount`. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdateShippingRateFixedAmount<'a> { + /// Shipping rates defined in each available currency option. + /// Each key must be a three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html) and a [supported currency](https://stripe.com/docs/currencies). + #[serde(skip_serializing_if = "Option::is_none")] + pub currency_options: Option< + &'a std::collections::HashMap< + stripe_types::Currency, + UpdateShippingRateFixedAmountCurrencyOptions, + >, + >, +} +impl<'a> UpdateShippingRateFixedAmount<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// Shipping rates defined in each available currency option. +/// Each key must be a three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html) and a [supported currency](https://stripe.com/docs/currencies). +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdateShippingRateFixedAmountCurrencyOptions { + /// A non-negative integer in cents representing how much to charge. + #[serde(skip_serializing_if = "Option::is_none")] + pub amount: Option, + /// Specifies whether the rate is considered inclusive of taxes or exclusive of taxes. + /// One of `inclusive`, `exclusive`, or `unspecified`. + #[serde(skip_serializing_if = "Option::is_none")] + pub tax_behavior: Option, +} +impl UpdateShippingRateFixedAmountCurrencyOptions { + pub fn new() -> Self { + Self::default() + } +} +impl<'a> UpdateShippingRate<'a> { + /// Updates an existing shipping rate object. + pub fn send( + &self, + client: &stripe::Client, + shipping_rate_token: &stripe_shared::ShippingRateId, + ) -> stripe::Response { + client.send_form( + &format!("/shipping_rates/{shipping_rate_token}"), + self, + http_types::Method::Post, + ) + } +} diff --git a/generated/stripe_product/src/tax_code/mod.rs b/generated/stripe_product/src/tax_code/mod.rs new file mode 100644 index 000000000..13cda4ef7 --- /dev/null +++ b/generated/stripe_product/src/tax_code/mod.rs @@ -0,0 +1,4 @@ +#[cfg(feature = "tax_code")] +mod requests; +#[cfg(feature = "tax_code")] +pub use requests::*; diff --git a/generated/stripe_product/src/tax_code/requests.rs b/generated/stripe_product/src/tax_code/requests.rs new file mode 100644 index 000000000..ee21268c9 --- /dev/null +++ b/generated/stripe_product/src/tax_code/requests.rs @@ -0,0 +1,59 @@ +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct ListTaxCode<'a> { + /// A cursor for use in pagination. + /// `ending_before` is an object ID that defines your place in the list. + /// For instance, if you make a list request and receive 100 objects, starting with `obj_bar`, your subsequent call can include `ending_before=obj_bar` in order to fetch the previous page of the list. + #[serde(skip_serializing_if = "Option::is_none")] + pub ending_before: Option<&'a str>, + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, + /// A limit on the number of objects to be returned. + /// Limit can range between 1 and 100, and the default is 10. + #[serde(skip_serializing_if = "Option::is_none")] + pub limit: Option, + /// A cursor for use in pagination. + /// `starting_after` is an object ID that defines your place in the list. + /// For instance, if you make a list request and receive 100 objects, ending with `obj_foo`, your subsequent call can include `starting_after=obj_foo` in order to fetch the next page of the list. + #[serde(skip_serializing_if = "Option::is_none")] + pub starting_after: Option<&'a str>, +} +impl<'a> ListTaxCode<'a> { + pub fn new() -> Self { + Self::default() + } +} +impl<'a> ListTaxCode<'a> { + /// A list of [all tax codes available](https://stripe.com/docs/tax/tax-categories) to add to Products in order to allow specific tax calculations. + pub fn send( + &self, + client: &stripe::Client, + ) -> stripe::Response> { + client.get_query("/tax_codes", self) + } + pub fn paginate(self) -> stripe::ListPaginator> { + stripe::ListPaginator::from_list_params("/tax_codes", self) + } +} +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct RetrieveTaxCode<'a> { + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, +} +impl<'a> RetrieveTaxCode<'a> { + pub fn new() -> Self { + Self::default() + } +} +impl<'a> RetrieveTaxCode<'a> { + /// Retrieves the details of an existing tax code. + /// Supply the unique tax code ID and Stripe will return the corresponding tax code information. + pub fn send( + &self, + client: &stripe::Client, + id: &stripe_shared::TaxCodeId, + ) -> stripe::Response { + client.get_query(&format!("/tax_codes/{id}"), self) + } +} diff --git a/generated/stripe_product/src/tax_rate/mod.rs b/generated/stripe_product/src/tax_rate/mod.rs new file mode 100644 index 000000000..cee8aec75 --- /dev/null +++ b/generated/stripe_product/src/tax_rate/mod.rs @@ -0,0 +1,4 @@ +#[cfg(feature = "tax_rate")] +mod requests; +#[cfg(feature = "tax_rate")] +pub use requests::*; diff --git a/generated/stripe_product/src/tax_rate/requests.rs b/generated/stripe_product/src/tax_rate/requests.rs new file mode 100644 index 000000000..fa943d8d6 --- /dev/null +++ b/generated/stripe_product/src/tax_rate/requests.rs @@ -0,0 +1,185 @@ +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct ListTaxRate<'a> { + /// Optional flag to filter by tax rates that are either active or inactive (archived). + #[serde(skip_serializing_if = "Option::is_none")] + pub active: Option, + /// Optional range for filtering created date. + #[serde(skip_serializing_if = "Option::is_none")] + pub created: Option, + /// A cursor for use in pagination. + /// `ending_before` is an object ID that defines your place in the list. + /// For instance, if you make a list request and receive 100 objects, starting with `obj_bar`, your subsequent call can include `ending_before=obj_bar` in order to fetch the previous page of the list. + #[serde(skip_serializing_if = "Option::is_none")] + pub ending_before: Option<&'a str>, + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, + /// Optional flag to filter by tax rates that are inclusive (or those that are not inclusive). + #[serde(skip_serializing_if = "Option::is_none")] + pub inclusive: Option, + /// A limit on the number of objects to be returned. + /// Limit can range between 1 and 100, and the default is 10. + #[serde(skip_serializing_if = "Option::is_none")] + pub limit: Option, + /// A cursor for use in pagination. + /// `starting_after` is an object ID that defines your place in the list. + /// For instance, if you make a list request and receive 100 objects, ending with `obj_foo`, your subsequent call can include `starting_after=obj_foo` in order to fetch the next page of the list. + #[serde(skip_serializing_if = "Option::is_none")] + pub starting_after: Option<&'a str>, +} +impl<'a> ListTaxRate<'a> { + pub fn new() -> Self { + Self::default() + } +} +impl<'a> ListTaxRate<'a> { + /// Returns a list of your tax rates. + /// Tax rates are returned sorted by creation date, with the most recently created tax rates appearing first. + pub fn send( + &self, + client: &stripe::Client, + ) -> stripe::Response> { + client.get_query("/tax_rates", self) + } + pub fn paginate(self) -> stripe::ListPaginator> { + stripe::ListPaginator::from_list_params("/tax_rates", self) + } +} +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct RetrieveTaxRate<'a> { + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, +} +impl<'a> RetrieveTaxRate<'a> { + pub fn new() -> Self { + Self::default() + } +} +impl<'a> RetrieveTaxRate<'a> { + /// Retrieves a tax rate with the given ID + pub fn send( + &self, + client: &stripe::Client, + tax_rate: &stripe_shared::TaxRateId, + ) -> stripe::Response { + client.get_query(&format!("/tax_rates/{tax_rate}"), self) + } +} +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreateTaxRate<'a> { + /// Flag determining whether the tax rate is active or inactive (archived). + /// Inactive tax rates cannot be used with new applications or Checkout Sessions, but will still work for subscriptions and invoices that already have it set. + #[serde(skip_serializing_if = "Option::is_none")] + pub active: Option, + /// Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). + #[serde(skip_serializing_if = "Option::is_none")] + pub country: Option<&'a str>, + /// An arbitrary string attached to the tax rate for your internal use only. + /// It will not be visible to your customers. + #[serde(skip_serializing_if = "Option::is_none")] + pub description: Option<&'a str>, + /// The display name of the tax rate, which will be shown to users. + pub display_name: &'a str, + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, + /// This specifies if the tax rate is inclusive or exclusive. + pub inclusive: bool, + /// The jurisdiction for the tax rate. + /// You can use this label field for tax reporting purposes. + /// It also appears on your customer’s invoice. + #[serde(skip_serializing_if = "Option::is_none")] + pub jurisdiction: Option<&'a str>, + /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. + /// This can be useful for storing additional information about the object in a structured format. + /// Individual keys can be unset by posting an empty value to them. + /// All keys can be unset by posting an empty value to `metadata`. + #[serde(skip_serializing_if = "Option::is_none")] + pub metadata: Option<&'a std::collections::HashMap>, + /// This represents the tax rate percent out of 100. + pub percentage: f64, + /// [ISO 3166-2 subdivision code](https://en.wikipedia.org/wiki/ISO_3166-2:US), without country prefix. + /// For example, "NY" for New York, United States. + #[serde(skip_serializing_if = "Option::is_none")] + pub state: Option<&'a str>, + /// The high-level tax type, such as `vat` or `sales_tax`. + #[serde(skip_serializing_if = "Option::is_none")] + pub tax_type: Option, +} +impl<'a> CreateTaxRate<'a> { + pub fn new(display_name: &'a str, inclusive: bool, percentage: f64) -> Self { + Self { + active: None, + country: None, + description: None, + display_name, + expand: None, + inclusive, + jurisdiction: None, + metadata: None, + percentage, + state: None, + tax_type: None, + } + } +} +impl<'a> CreateTaxRate<'a> { + /// Creates a new tax rate. + pub fn send(&self, client: &stripe::Client) -> stripe::Response { + client.send_form("/tax_rates", self, http_types::Method::Post) + } +} +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdateTaxRate<'a> { + /// Flag determining whether the tax rate is active or inactive (archived). + /// Inactive tax rates cannot be used with new applications or Checkout Sessions, but will still work for subscriptions and invoices that already have it set. + #[serde(skip_serializing_if = "Option::is_none")] + pub active: Option, + /// Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). + #[serde(skip_serializing_if = "Option::is_none")] + pub country: Option<&'a str>, + /// An arbitrary string attached to the tax rate for your internal use only. + /// It will not be visible to your customers. + #[serde(skip_serializing_if = "Option::is_none")] + pub description: Option<&'a str>, + /// The display name of the tax rate, which will be shown to users. + #[serde(skip_serializing_if = "Option::is_none")] + pub display_name: Option<&'a str>, + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, + /// The jurisdiction for the tax rate. + /// You can use this label field for tax reporting purposes. + /// It also appears on your customer’s invoice. + #[serde(skip_serializing_if = "Option::is_none")] + pub jurisdiction: Option<&'a str>, + /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. + /// This can be useful for storing additional information about the object in a structured format. + /// Individual keys can be unset by posting an empty value to them. + /// All keys can be unset by posting an empty value to `metadata`. + #[serde(skip_serializing_if = "Option::is_none")] + pub metadata: Option<&'a std::collections::HashMap>, + /// [ISO 3166-2 subdivision code](https://en.wikipedia.org/wiki/ISO_3166-2:US), without country prefix. + /// For example, "NY" for New York, United States. + #[serde(skip_serializing_if = "Option::is_none")] + pub state: Option<&'a str>, + /// The high-level tax type, such as `vat` or `sales_tax`. + #[serde(skip_serializing_if = "Option::is_none")] + pub tax_type: Option, +} +impl<'a> UpdateTaxRate<'a> { + pub fn new() -> Self { + Self::default() + } +} +impl<'a> UpdateTaxRate<'a> { + /// Updates an existing tax rate. + pub fn send( + &self, + client: &stripe::Client, + tax_rate: &stripe_shared::TaxRateId, + ) -> stripe::Response { + client.send_form(&format!("/tax_rates/{tax_rate}"), self, http_types::Method::Post) + } +} diff --git a/generated/stripe_shared/Cargo.toml b/generated/stripe_shared/Cargo.toml new file mode 100644 index 000000000..abaa68367 --- /dev/null +++ b/generated/stripe_shared/Cargo.toml @@ -0,0 +1,27 @@ +[package] +name = "stripe_shared" +version.workspace = true +description.workspace = true +edition.workspace = true +rust-version.workspace = true +authors.workspace = true +license.workspace = true +homepage.workspace = true +repository.workspace = true +keywords.workspace = true +categories.workspace = true + +[lib] +path = "src/mod.rs" + +[dependencies] +serde.workspace = true +smol_str.workspace = true +serde_json.workspace = true +stripe_types = {path = "../../stripe_types"} + + + + + + diff --git a/generated/stripe_shared/src/account.rs b/generated/stripe_shared/src/account.rs new file mode 100644 index 000000000..c34d82a4d --- /dev/null +++ b/generated/stripe_shared/src/account.rs @@ -0,0 +1,198 @@ +/// This is an object representing a Stripe account. You can retrieve it to see +/// properties on the account like its current requirements or if the account is +/// enabled to make live charges or receive payouts. +/// +/// For Custom accounts, the properties below are always returned. +/// For other accounts, some properties are returned until that. +/// account has started to go through Connect Onboarding. +/// Once you create an [Account Link](https://stripe.com/docs/api/account_links) or [Account Session](https://stripe.com/docs/api/account_sessions),. +/// some properties are only returned for Custom accounts. +/// Learn about the differences [between accounts](https://stripe.com/docs/connect/accounts). +/// +/// For more details see <>. +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct Account { + /// Business information about the account. + #[serde(skip_serializing_if = "Option::is_none")] + pub business_profile: Option, + /// The business type. + /// Once you create an [Account Link](https://stripe.com/docs/api/account_links) or [Account Session](https://stripe.com/docs/api/account_sessions), this property is only returned for Custom accounts. + #[serde(skip_serializing_if = "Option::is_none")] + pub business_type: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub capabilities: Option, + /// Whether the account can create live charges. + #[serde(skip_serializing_if = "Option::is_none")] + pub charges_enabled: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub company: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub controller: Option, + /// The account's country. + #[serde(skip_serializing_if = "Option::is_none")] + pub country: Option, + /// Time at which the account was connected. Measured in seconds since the Unix epoch. + #[serde(skip_serializing_if = "Option::is_none")] + pub created: Option, + /// Three-letter ISO currency code representing the default currency for the account. + /// This must be a currency that [Stripe supports in the account's country](https://stripe.com/docs/payouts). + #[serde(skip_serializing_if = "Option::is_none")] + pub default_currency: Option, + /// Whether account details have been submitted. + /// Standard accounts cannot receive payouts before this is true. + #[serde(skip_serializing_if = "Option::is_none")] + pub details_submitted: Option, + /// An email address associated with the account. + /// It's not used for authentication and Stripe doesn't market to this field without explicit approval from the platform. + #[serde(skip_serializing_if = "Option::is_none")] + pub email: Option, + /// External accounts (bank accounts and debit cards) currently attached to this account. + /// External accounts are only returned for requests where `controller[is_controller]` is true. + #[serde(skip_serializing_if = "Option::is_none")] + pub external_accounts: Option>, + #[serde(skip_serializing_if = "Option::is_none")] + pub future_requirements: Option, + /// Unique identifier for the object. + pub id: stripe_shared::AccountId, + #[serde(skip_serializing_if = "Option::is_none")] + pub individual: Option, + /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. + /// This can be useful for storing additional information about the object in a structured format. + #[serde(skip_serializing_if = "Option::is_none")] + pub metadata: Option>, + /// Whether Stripe can send payouts to this account. + #[serde(skip_serializing_if = "Option::is_none")] + pub payouts_enabled: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub requirements: Option, + /// Options for customizing how the account functions within Stripe. + #[serde(skip_serializing_if = "Option::is_none")] + pub settings: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub tos_acceptance: Option, + /// The Stripe account type. Can be `standard`, `express`, or `custom`. + #[serde(rename = "type")] + #[serde(skip_serializing_if = "Option::is_none")] + pub type_: Option, +} +impl stripe_types::Object for Account { + type Id = stripe_shared::AccountId; + fn id(&self) -> &Self::Id { + &self.id + } +} +stripe_types::def_id!(AccountId, "acct_"); +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum AccountBusinessType { + Company, + GovernmentEntity, + Individual, + NonProfit, +} +impl AccountBusinessType { + pub fn as_str(self) -> &'static str { + use AccountBusinessType::*; + match self { + Company => "company", + GovernmentEntity => "government_entity", + Individual => "individual", + NonProfit => "non_profit", + } + } +} + +impl std::str::FromStr for AccountBusinessType { + type Err = (); + fn from_str(s: &str) -> Result { + use AccountBusinessType::*; + match s { + "company" => Ok(Company), + "government_entity" => Ok(GovernmentEntity), + "individual" => Ok(Individual), + "non_profit" => Ok(NonProfit), + _ => Err(()), + } + } +} +impl std::fmt::Display for AccountBusinessType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for AccountBusinessType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for AccountBusinessType { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for AccountBusinessType { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s) + .map_err(|_| serde::de::Error::custom("Unknown value for AccountBusinessType")) + } +} +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum AccountType { + Custom, + Express, + Standard, +} +impl AccountType { + pub fn as_str(self) -> &'static str { + use AccountType::*; + match self { + Custom => "custom", + Express => "express", + Standard => "standard", + } + } +} + +impl std::str::FromStr for AccountType { + type Err = (); + fn from_str(s: &str) -> Result { + use AccountType::*; + match s { + "custom" => Ok(Custom), + "express" => Ok(Express), + "standard" => Ok(Standard), + _ => Err(()), + } + } +} +impl std::fmt::Display for AccountType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for AccountType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for AccountType { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for AccountType { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for AccountType")) + } +} diff --git a/generated/stripe_shared/src/account_annual_revenue.rs b/generated/stripe_shared/src/account_annual_revenue.rs new file mode 100644 index 000000000..7f3366455 --- /dev/null +++ b/generated/stripe_shared/src/account_annual_revenue.rs @@ -0,0 +1,12 @@ +#[derive(Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct AccountAnnualRevenue { + /// A non-negative integer representing the amount in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal). + pub amount: Option, + /// Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. + /// Must be a [supported currency](https://stripe.com/docs/currencies). + pub currency: Option, + /// The close-out date of the preceding fiscal year in ISO 8601 format. + /// E.g. + /// 2023-12-31 for the 31st of December, 2023. + pub fiscal_year_end: Option, +} diff --git a/generated/stripe_shared/src/account_bacs_debit_payments_settings.rs b/generated/stripe_shared/src/account_bacs_debit_payments_settings.rs new file mode 100644 index 000000000..a7f6c20ad --- /dev/null +++ b/generated/stripe_shared/src/account_bacs_debit_payments_settings.rs @@ -0,0 +1,14 @@ +#[derive(Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct AccountBacsDebitPaymentsSettings { + /// The Bacs Direct Debit display name for this account. + /// For payments made with Bacs Direct Debit, this name appears on the mandate as the statement descriptor. + /// Mobile banking apps display it as the name of the business. + /// To use custom branding, set the Bacs Direct Debit Display Name during or right after creation. + /// Custom branding incurs an additional monthly fee for the platform. + /// The fee appears 5 business days after requesting Bacs. + /// If you don't set the display name before requesting Bacs capability, it's automatically set as "Stripe" and the account is onboarded to Stripe branding, which is free. + pub display_name: Option, + /// The Bacs Direct Debit Service user number for this account. + /// For payments made with Bacs Direct Debit, this number is a unique identifier of the account with our banking partners. + pub service_user_number: Option, +} diff --git a/generated/stripe_shared/src/account_branding_settings.rs b/generated/stripe_shared/src/account_branding_settings.rs new file mode 100644 index 000000000..8836a20c5 --- /dev/null +++ b/generated/stripe_shared/src/account_branding_settings.rs @@ -0,0 +1,13 @@ +#[derive(Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct AccountBrandingSettings { + /// (ID of a [file upload](https://stripe.com/docs/guides/file-upload)) An icon for the account. + /// Must be square and at least 128px x 128px. + pub icon: Option>, + /// (ID of a [file upload](https://stripe.com/docs/guides/file-upload)) A logo for the account that will be used in Checkout instead of the icon and without the account's name next to it if provided. + /// Must be at least 128px x 128px. + pub logo: Option>, + /// A CSS hex color value representing the primary branding color for this account + pub primary_color: Option, + /// A CSS hex color value representing the secondary branding color for this account + pub secondary_color: Option, +} diff --git a/generated/stripe_shared/src/account_business_profile.rs b/generated/stripe_shared/src/account_business_profile.rs new file mode 100644 index 000000000..50c276b7b --- /dev/null +++ b/generated/stripe_shared/src/account_business_profile.rs @@ -0,0 +1,29 @@ +#[derive(Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct AccountBusinessProfile { + /// The applicant's gross annual revenue for its preceding fiscal year. + pub annual_revenue: Option, + /// An estimated upper bound of employees, contractors, vendors, etc. + /// currently working for the business. + pub estimated_worker_count: Option, + /// [The merchant category code for the account](https://stripe.com/docs/connect/setting-mcc). + /// MCCs are used to classify businesses based on the goods or services they provide. + pub mcc: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub monthly_estimated_revenue: Option, + /// The customer-facing business name. + pub name: Option, + /// Internal-only description of the product sold or service provided by the business. + /// It's used by Stripe for risk and underwriting purposes. + #[serde(skip_serializing_if = "Option::is_none")] + pub product_description: Option, + /// A publicly available mailing address for sending support issues to. + pub support_address: Option, + /// A publicly available email address for sending support issues to. + pub support_email: Option, + /// A publicly available phone number to call with support issues. + pub support_phone: Option, + /// A publicly available website for handling support issues. + pub support_url: Option, + /// The business's publicly available website. + pub url: Option, +} diff --git a/generated/stripe_shared/src/account_capabilities.rs b/generated/stripe_shared/src/account_capabilities.rs new file mode 100644 index 000000000..ba6b0b499 --- /dev/null +++ b/generated/stripe_shared/src/account_capabilities.rs @@ -0,0 +1,173 @@ +#[derive(Copy, Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct AccountCapabilities { + /// The status of the Canadian pre-authorized debits payments capability of the account, or whether the account can directly process Canadian pre-authorized debits charges. + #[serde(skip_serializing_if = "Option::is_none")] + pub acss_debit_payments: Option, + /// The status of the Affirm capability of the account, or whether the account can directly process Affirm charges. + #[serde(skip_serializing_if = "Option::is_none")] + pub affirm_payments: Option, + /// The status of the Afterpay Clearpay capability of the account, or whether the account can directly process Afterpay Clearpay charges. + #[serde(skip_serializing_if = "Option::is_none")] + pub afterpay_clearpay_payments: Option, + /// The status of the BECS Direct Debit (AU) payments capability of the account, or whether the account can directly process BECS Direct Debit (AU) charges. + #[serde(skip_serializing_if = "Option::is_none")] + pub au_becs_debit_payments: Option, + /// The status of the Bacs Direct Debits payments capability of the account, or whether the account can directly process Bacs Direct Debits charges. + #[serde(skip_serializing_if = "Option::is_none")] + pub bacs_debit_payments: Option, + /// The status of the Bancontact payments capability of the account, or whether the account can directly process Bancontact charges. + #[serde(skip_serializing_if = "Option::is_none")] + pub bancontact_payments: Option, + /// The status of the customer_balance payments capability of the account, or whether the account can directly process customer_balance charges. + #[serde(skip_serializing_if = "Option::is_none")] + pub bank_transfer_payments: Option, + /// The status of the blik payments capability of the account, or whether the account can directly process blik charges. + #[serde(skip_serializing_if = "Option::is_none")] + pub blik_payments: Option, + /// The status of the boleto payments capability of the account, or whether the account can directly process boleto charges. + #[serde(skip_serializing_if = "Option::is_none")] + pub boleto_payments: Option, + /// The status of the card issuing capability of the account, or whether you can use Issuing to distribute funds on cards. + #[serde(skip_serializing_if = "Option::is_none")] + pub card_issuing: Option, + /// The status of the card payments capability of the account, or whether the account can directly process credit and debit card charges. + #[serde(skip_serializing_if = "Option::is_none")] + pub card_payments: Option, + /// The status of the Cartes Bancaires payments capability of the account, or whether the account can directly process Cartes Bancaires card charges in EUR currency. + #[serde(skip_serializing_if = "Option::is_none")] + pub cartes_bancaires_payments: Option, + /// The status of the Cash App Pay capability of the account, or whether the account can directly process Cash App Pay payments. + #[serde(skip_serializing_if = "Option::is_none")] + pub cashapp_payments: Option, + /// The status of the EPS payments capability of the account, or whether the account can directly process EPS charges. + #[serde(skip_serializing_if = "Option::is_none")] + pub eps_payments: Option, + /// The status of the FPX payments capability of the account, or whether the account can directly process FPX charges. + #[serde(skip_serializing_if = "Option::is_none")] + pub fpx_payments: Option, + /// The status of the giropay payments capability of the account, or whether the account can directly process giropay charges. + #[serde(skip_serializing_if = "Option::is_none")] + pub giropay_payments: Option, + /// The status of the GrabPay payments capability of the account, or whether the account can directly process GrabPay charges. + #[serde(skip_serializing_if = "Option::is_none")] + pub grabpay_payments: Option, + /// The status of the iDEAL payments capability of the account, or whether the account can directly process iDEAL charges. + #[serde(skip_serializing_if = "Option::is_none")] + pub ideal_payments: Option, + /// The status of the india_international_payments capability of the account, or whether the account can process international charges (non INR) in India. + #[serde(skip_serializing_if = "Option::is_none")] + pub india_international_payments: Option, + /// The status of the JCB payments capability of the account, or whether the account (Japan only) can directly process JCB credit card charges in JPY currency. + #[serde(skip_serializing_if = "Option::is_none")] + pub jcb_payments: Option, + /// The status of the Klarna payments capability of the account, or whether the account can directly process Klarna charges. + #[serde(skip_serializing_if = "Option::is_none")] + pub klarna_payments: Option, + /// The status of the konbini payments capability of the account, or whether the account can directly process konbini charges. + #[serde(skip_serializing_if = "Option::is_none")] + pub konbini_payments: Option, + /// The status of the legacy payments capability of the account. + #[serde(skip_serializing_if = "Option::is_none")] + pub legacy_payments: Option, + /// The status of the link_payments capability of the account, or whether the account can directly process Link charges. + #[serde(skip_serializing_if = "Option::is_none")] + pub link_payments: Option, + /// The status of the OXXO payments capability of the account, or whether the account can directly process OXXO charges. + #[serde(skip_serializing_if = "Option::is_none")] + pub oxxo_payments: Option, + /// The status of the P24 payments capability of the account, or whether the account can directly process P24 charges. + #[serde(skip_serializing_if = "Option::is_none")] + pub p24_payments: Option, + /// The status of the paynow payments capability of the account, or whether the account can directly process paynow charges. + #[serde(skip_serializing_if = "Option::is_none")] + pub paynow_payments: Option, + /// The status of the promptpay payments capability of the account, or whether the account can directly process promptpay charges. + #[serde(skip_serializing_if = "Option::is_none")] + pub promptpay_payments: Option, + /// The status of the RevolutPay capability of the account, or whether the account can directly process RevolutPay payments. + #[serde(skip_serializing_if = "Option::is_none")] + pub revolut_pay_payments: Option, + /// The status of the SEPA Direct Debits payments capability of the account, or whether the account can directly process SEPA Direct Debits charges. + #[serde(skip_serializing_if = "Option::is_none")] + pub sepa_debit_payments: Option, + /// The status of the Sofort payments capability of the account, or whether the account can directly process Sofort charges. + #[serde(skip_serializing_if = "Option::is_none")] + pub sofort_payments: Option, + /// The status of the Swish capability of the account, or whether the account can directly process Swish payments. + #[serde(skip_serializing_if = "Option::is_none")] + pub swish_payments: Option, + /// The status of the tax reporting 1099-K (US) capability of the account. + #[serde(skip_serializing_if = "Option::is_none")] + pub tax_reporting_us_1099_k: Option, + /// The status of the tax reporting 1099-MISC (US) capability of the account. + #[serde(skip_serializing_if = "Option::is_none")] + pub tax_reporting_us_1099_misc: Option, + /// The status of the transfers capability of the account, or whether your platform can transfer funds to the account. + #[serde(skip_serializing_if = "Option::is_none")] + pub transfers: Option, + /// The status of the banking capability, or whether the account can have bank accounts. + #[serde(skip_serializing_if = "Option::is_none")] + pub treasury: Option, + /// The status of the US bank account ACH payments capability of the account, or whether the account can directly process US bank account charges. + #[serde(skip_serializing_if = "Option::is_none")] + pub us_bank_account_ach_payments: Option, + /// The status of the Zip capability of the account, or whether the account can directly process Zip charges. + #[serde(skip_serializing_if = "Option::is_none")] + pub zip_payments: Option, +} +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum AccountCapabilitiesStatus { + Active, + Inactive, + Pending, +} +impl AccountCapabilitiesStatus { + pub fn as_str(self) -> &'static str { + use AccountCapabilitiesStatus::*; + match self { + Active => "active", + Inactive => "inactive", + Pending => "pending", + } + } +} + +impl std::str::FromStr for AccountCapabilitiesStatus { + type Err = (); + fn from_str(s: &str) -> Result { + use AccountCapabilitiesStatus::*; + match s { + "active" => Ok(Active), + "inactive" => Ok(Inactive), + "pending" => Ok(Pending), + _ => Err(()), + } + } +} +impl std::fmt::Display for AccountCapabilitiesStatus { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for AccountCapabilitiesStatus { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for AccountCapabilitiesStatus { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for AccountCapabilitiesStatus { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s) + .map_err(|_| serde::de::Error::custom("Unknown value for AccountCapabilitiesStatus")) + } +} diff --git a/generated/stripe_shared/src/account_capability_future_requirements.rs b/generated/stripe_shared/src/account_capability_future_requirements.rs new file mode 100644 index 000000000..ece1afa90 --- /dev/null +++ b/generated/stripe_shared/src/account_capability_future_requirements.rs @@ -0,0 +1,26 @@ +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct AccountCapabilityFutureRequirements { + /// Fields that are due and can be satisfied by providing the corresponding alternative fields instead. + pub alternatives: Option>, + /// Date on which `future_requirements` merges with the main `requirements` hash and `future_requirements` becomes empty. + /// After the transition, `currently_due` requirements may immediately become `past_due`, but the account may also be given a grace period depending on the capability's enablement state prior to transitioning. + pub current_deadline: Option, + /// Fields that need to be collected to keep the capability enabled. + /// If not collected by `future_requirements[current_deadline]`, these fields will transition to the main `requirements` hash. + pub currently_due: Vec, + /// This is typed as a string for consistency with `requirements.disabled_reason`, but it safe to assume `future_requirements.disabled_reason` is empty because fields in `future_requirements` will never disable the account. + pub disabled_reason: Option, + /// Fields that are `currently_due` and need to be collected again because validation or verification failed. + pub errors: Vec, + /// Fields that need to be collected assuming all volume thresholds are reached. + /// As they become required, they appear in `currently_due` as well. + pub eventually_due: Vec, + /// Fields that weren't collected by `requirements.current_deadline`. + /// These fields need to be collected to enable the capability on the account. + /// New fields will never appear here; `future_requirements.past_due` will always be a subset of `requirements.past_due`. + pub past_due: Vec, + /// Fields that may become required depending on the results of verification or review. + /// Will be an empty array unless an asynchronous verification is pending. + /// If verification fails, these fields move to `eventually_due` or `currently_due`. + pub pending_verification: Vec, +} diff --git a/generated/stripe_shared/src/account_capability_requirements.rs b/generated/stripe_shared/src/account_capability_requirements.rs new file mode 100644 index 000000000..b38d68d93 --- /dev/null +++ b/generated/stripe_shared/src/account_capability_requirements.rs @@ -0,0 +1,33 @@ +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct AccountCapabilityRequirements { + /// Fields that are due and can be satisfied by providing the corresponding alternative fields instead. + pub alternatives: Option>, + /// Date by which the fields in `currently_due` must be collected to keep the capability enabled for the account. + /// These fields may disable the capability sooner if the next threshold is reached before they are collected. + pub current_deadline: Option, + /// Fields that need to be collected to keep the capability enabled. + /// If not collected by `current_deadline`, these fields appear in `past_due` as well, and the capability is disabled. + pub currently_due: Vec, + /// If the capability is disabled, this string describes why. + /// Can be `requirements.past_due`, `requirements.pending_verification`, `listed`, `platform_paused`, `rejected.fraud`, `rejected.listed`, `rejected.terms_of_service`, `rejected.other`, `under_review`, or `other`. + /// + /// `rejected.unsupported_business` means that the account's business is not supported by the capability. + /// For example, payment methods may restrict the businesses they support in their terms of service:. + /// + /// - [Afterpay Clearpay's terms of service](/afterpay-clearpay/legal#restricted-businesses) + /// + /// If you believe that the rejection is in error, please contact support at for assistance. + pub disabled_reason: Option, + /// Fields that are `currently_due` and need to be collected again because validation or verification failed. + pub errors: Vec, + /// Fields that need to be collected assuming all volume thresholds are reached. + /// As they become required, they appear in `currently_due` as well, and `current_deadline` becomes set. + pub eventually_due: Vec, + /// Fields that weren't collected by `current_deadline`. + /// These fields need to be collected to enable the capability on the account. + pub past_due: Vec, + /// Fields that may become required depending on the results of verification or review. + /// Will be an empty array unless an asynchronous verification is pending. + /// If verification fails, these fields move to `eventually_due`, `currently_due`, or `past_due`. + pub pending_verification: Vec, +} diff --git a/generated/stripe_shared/src/account_card_issuing_settings.rs b/generated/stripe_shared/src/account_card_issuing_settings.rs new file mode 100644 index 000000000..7c781fa69 --- /dev/null +++ b/generated/stripe_shared/src/account_card_issuing_settings.rs @@ -0,0 +1,5 @@ +#[derive(Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct AccountCardIssuingSettings { + #[serde(skip_serializing_if = "Option::is_none")] + pub tos_acceptance: Option, +} diff --git a/generated/stripe_shared/src/account_card_payments_settings.rs b/generated/stripe_shared/src/account_card_payments_settings.rs new file mode 100644 index 000000000..13dbad24a --- /dev/null +++ b/generated/stripe_shared/src/account_card_payments_settings.rs @@ -0,0 +1,17 @@ +#[derive(Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct AccountCardPaymentsSettings { + #[serde(skip_serializing_if = "Option::is_none")] + pub decline_on: Option, + /// The default text that appears on credit card statements when a charge is made. + /// This field prefixes any dynamic `statement_descriptor` specified on the charge. + /// `statement_descriptor_prefix` is useful for maximizing descriptor space for the dynamic portion. + pub statement_descriptor_prefix: Option, + /// The Kana variation of the default text that appears on credit card statements when a charge is made (Japan only). + /// This field prefixes any dynamic `statement_descriptor_suffix_kana` specified on the charge. + /// `statement_descriptor_prefix_kana` is useful for maximizing descriptor space for the dynamic portion. + pub statement_descriptor_prefix_kana: Option, + /// The Kanji variation of the default text that appears on credit card statements when a charge is made (Japan only). + /// This field prefixes any dynamic `statement_descriptor_suffix_kanji` specified on the charge. + /// `statement_descriptor_prefix_kanji` is useful for maximizing descriptor space for the dynamic portion. + pub statement_descriptor_prefix_kanji: Option, +} diff --git a/generated/stripe_shared/src/account_dashboard_settings.rs b/generated/stripe_shared/src/account_dashboard_settings.rs new file mode 100644 index 000000000..59f2808aa --- /dev/null +++ b/generated/stripe_shared/src/account_dashboard_settings.rs @@ -0,0 +1,9 @@ +#[derive(Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct AccountDashboardSettings { + /// The display name for this account. + /// This is used on the Stripe Dashboard to differentiate between accounts. + pub display_name: Option, + /// The timezone used in the Stripe Dashboard for this account. + /// A list of possible time zone values is maintained at the [IANA Time Zone Database](http://www.iana.org/time-zones). + pub timezone: Option, +} diff --git a/generated/stripe_shared/src/account_decline_charge_on.rs b/generated/stripe_shared/src/account_decline_charge_on.rs new file mode 100644 index 000000000..122a38980 --- /dev/null +++ b/generated/stripe_shared/src/account_decline_charge_on.rs @@ -0,0 +1,9 @@ +#[derive(Copy, Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct AccountDeclineChargeOn { + /// Whether Stripe automatically declines charges with an incorrect ZIP or postal code. + /// This setting only applies when a ZIP or postal code is provided and they fail bank verification. + pub avs_failure: bool, + /// Whether Stripe automatically declines charges with an incorrect CVC. + /// This setting only applies when a CVC is provided and it fails bank verification. + pub cvc_failure: bool, +} diff --git a/generated/stripe_shared/src/account_future_requirements.rs b/generated/stripe_shared/src/account_future_requirements.rs new file mode 100644 index 000000000..2edb3fecc --- /dev/null +++ b/generated/stripe_shared/src/account_future_requirements.rs @@ -0,0 +1,26 @@ +#[derive(Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct AccountFutureRequirements { + /// Fields that are due and can be satisfied by providing the corresponding alternative fields instead. + pub alternatives: Option>, + /// Date on which `future_requirements` merges with the main `requirements` hash and `future_requirements` becomes empty. + /// After the transition, `currently_due` requirements may immediately become `past_due`, but the account may also be given a grace period depending on its enablement state prior to transitioning. + pub current_deadline: Option, + /// Fields that need to be collected to keep the account enabled. + /// If not collected by `future_requirements[current_deadline]`, these fields will transition to the main `requirements` hash. + pub currently_due: Option>, + /// This is typed as a string for consistency with `requirements.disabled_reason`. + pub disabled_reason: Option, + /// Fields that are `currently_due` and need to be collected again because validation or verification failed. + pub errors: Option>, + /// Fields that need to be collected assuming all volume thresholds are reached. + /// As they become required, they appear in `currently_due` as well. + pub eventually_due: Option>, + /// Fields that weren't collected by `requirements.current_deadline`. + /// These fields need to be collected to enable the capability on the account. + /// New fields will never appear here; `future_requirements.past_due` will always be a subset of `requirements.past_due`. + pub past_due: Option>, + /// Fields that may become required depending on the results of verification or review. + /// Will be an empty array unless an asynchronous verification is pending. + /// If verification fails, these fields move to `eventually_due` or `currently_due`. + pub pending_verification: Option>, +} diff --git a/generated/stripe_shared/src/account_invoices_settings.rs b/generated/stripe_shared/src/account_invoices_settings.rs new file mode 100644 index 000000000..f493594a8 --- /dev/null +++ b/generated/stripe_shared/src/account_invoices_settings.rs @@ -0,0 +1,6 @@ +#[derive(Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct AccountInvoicesSettings { + /// The list of default Account Tax IDs to automatically include on invoices. + /// Account Tax IDs get added when an invoice is finalized. + pub default_account_tax_ids: Option>>, +} diff --git a/generated/stripe_shared/src/account_monthly_estimated_revenue.rs b/generated/stripe_shared/src/account_monthly_estimated_revenue.rs new file mode 100644 index 000000000..276f7ec27 --- /dev/null +++ b/generated/stripe_shared/src/account_monthly_estimated_revenue.rs @@ -0,0 +1,8 @@ +#[derive(Copy, Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct AccountMonthlyEstimatedRevenue { + /// A non-negative integer representing how much to charge in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal). + pub amount: i64, + /// Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. + /// Must be a [supported currency](https://stripe.com/docs/currencies). + pub currency: stripe_types::Currency, +} diff --git a/generated/stripe_shared/src/account_payments_settings.rs b/generated/stripe_shared/src/account_payments_settings.rs new file mode 100644 index 000000000..a7567f7fc --- /dev/null +++ b/generated/stripe_shared/src/account_payments_settings.rs @@ -0,0 +1,18 @@ +#[derive(Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct AccountPaymentsSettings { + /// The default text that appears on credit card statements when a charge is made. + /// This field prefixes any dynamic `statement_descriptor` specified on the charge. + pub statement_descriptor: Option, + /// The Kana variation of the default text that appears on credit card statements when a charge is made (Japan only). + pub statement_descriptor_kana: Option, + /// The Kanji variation of the default text that appears on credit card statements when a charge is made (Japan only). + pub statement_descriptor_kanji: Option, + /// The Kana variation of the default text that appears on credit card statements when a charge is made (Japan only). + /// This field prefixes any dynamic `statement_descriptor_suffix_kana` specified on the charge. + /// `statement_descriptor_prefix_kana` is useful for maximizing descriptor space for the dynamic portion. + pub statement_descriptor_prefix_kana: Option, + /// The Kanji variation of the default text that appears on credit card statements when a charge is made (Japan only). + /// This field prefixes any dynamic `statement_descriptor_suffix_kanji` specified on the charge. + /// `statement_descriptor_prefix_kanji` is useful for maximizing descriptor space for the dynamic portion. + pub statement_descriptor_prefix_kanji: Option, +} diff --git a/generated/stripe_shared/src/account_payout_settings.rs b/generated/stripe_shared/src/account_payout_settings.rs new file mode 100644 index 000000000..2cfd61c37 --- /dev/null +++ b/generated/stripe_shared/src/account_payout_settings.rs @@ -0,0 +1,11 @@ +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct AccountPayoutSettings { + /// A Boolean indicating if Stripe should try to reclaim negative balances from an attached bank account. + /// See our [Understanding Connect Account Balances](https://stripe.com/docs/connect/account-balances) documentation for details. + /// Default value is `false` for Custom accounts, otherwise `true`. + pub debit_negative_balances: bool, + pub schedule: stripe_shared::TransferSchedule, + /// The text that appears on the bank account statement for payouts. + /// If not set, this defaults to the platform's bank descriptor as set in the Dashboard. + pub statement_descriptor: Option, +} diff --git a/generated/stripe_shared/src/account_requirements.rs b/generated/stripe_shared/src/account_requirements.rs new file mode 100644 index 000000000..0aa4c8a44 --- /dev/null +++ b/generated/stripe_shared/src/account_requirements.rs @@ -0,0 +1,27 @@ +#[derive(Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct AccountRequirements { + /// Fields that are due and can be satisfied by providing the corresponding alternative fields instead. + pub alternatives: Option>, + /// Date by which the fields in `currently_due` must be collected to keep the account enabled. + /// These fields may disable the account sooner if the next threshold is reached before they are collected. + pub current_deadline: Option, + /// Fields that need to be collected to keep the account enabled. + /// If not collected by `current_deadline`, these fields appear in `past_due` as well, and the account is disabled. + pub currently_due: Option>, + /// If the account is disabled, this string describes why. + /// [Learn more about handling verification issues](https://stripe.com/docs/connect/handling-api-verification). + /// Can be `action_required.requested_capabilities`, `requirements.past_due`, `requirements.pending_verification`, `listed`, `platform_paused`, `rejected.fraud`, `rejected.incomplete_verification`, `rejected.listed`, `rejected.other`, `rejected.terms_of_service`, `under_review`, or `other`. + pub disabled_reason: Option, + /// Fields that are `currently_due` and need to be collected again because validation or verification failed. + pub errors: Option>, + /// Fields that need to be collected assuming all volume thresholds are reached. + /// As they become required, they appear in `currently_due` as well, and `current_deadline` becomes set. + pub eventually_due: Option>, + /// Fields that weren't collected by `current_deadline`. + /// These fields need to be collected to enable the account. + pub past_due: Option>, + /// Fields that may become required depending on the results of verification or review. + /// Will be an empty array unless an asynchronous verification is pending. + /// If verification fails, these fields move to `eventually_due`, `currently_due`, or `past_due`. + pub pending_verification: Option>, +} diff --git a/generated/stripe_shared/src/account_requirements_alternative.rs b/generated/stripe_shared/src/account_requirements_alternative.rs new file mode 100644 index 000000000..31d08a601 --- /dev/null +++ b/generated/stripe_shared/src/account_requirements_alternative.rs @@ -0,0 +1,7 @@ +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct AccountRequirementsAlternative { + /// Fields that can be provided to satisfy all fields in `original_fields_due`. + pub alternative_fields_due: Vec, + /// Fields that are due and can be satisfied by providing all fields in `alternative_fields_due`. + pub original_fields_due: Vec, +} diff --git a/generated/stripe_shared/src/account_requirements_error.rs b/generated/stripe_shared/src/account_requirements_error.rs new file mode 100644 index 000000000..b8f37c96f --- /dev/null +++ b/generated/stripe_shared/src/account_requirements_error.rs @@ -0,0 +1,387 @@ +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct AccountRequirementsError { + /// The code for the type of error. + pub code: AccountRequirementsErrorCode, + /// An informative message that indicates the error type and provides additional details about the error. + pub reason: String, + /// The specific user onboarding requirement field (in the requirements hash) that needs to be resolved. + pub requirement: String, +} +/// The code for the type of error. +#[derive(Copy, Clone, Eq, PartialEq)] +#[non_exhaustive] +pub enum AccountRequirementsErrorCode { + InvalidAddressCityStatePostalCode, + InvalidAddressHighwayContractBox, + InvalidAddressPrivateMailbox, + InvalidBusinessProfileName, + InvalidBusinessProfileNameDenylisted, + InvalidCompanyNameDenylisted, + InvalidDobAgeOverMaximum, + InvalidDobAgeUnder18, + InvalidDobAgeUnderMinimum, + InvalidProductDescriptionLength, + InvalidProductDescriptionUrlMatch, + InvalidRepresentativeCountry, + InvalidStatementDescriptorBusinessMismatch, + InvalidStatementDescriptorDenylisted, + InvalidStatementDescriptorLength, + InvalidStatementDescriptorPrefixDenylisted, + InvalidStatementDescriptorPrefixMismatch, + InvalidStreetAddress, + InvalidTaxId, + InvalidTaxIdFormat, + InvalidTosAcceptance, + InvalidUrlDenylisted, + InvalidUrlFormat, + InvalidUrlLength, + InvalidUrlWebPresenceDetected, + InvalidUrlWebsiteBusinessInformationMismatch, + InvalidUrlWebsiteEmpty, + InvalidUrlWebsiteInaccessible, + InvalidUrlWebsiteInaccessibleGeoblocked, + InvalidUrlWebsiteInaccessiblePasswordProtected, + InvalidUrlWebsiteIncomplete, + InvalidUrlWebsiteIncompleteCancellationPolicy, + InvalidUrlWebsiteIncompleteCustomerServiceDetails, + InvalidUrlWebsiteIncompleteLegalRestrictions, + InvalidUrlWebsiteIncompleteRefundPolicy, + InvalidUrlWebsiteIncompleteReturnPolicy, + InvalidUrlWebsiteIncompleteTermsAndConditions, + InvalidUrlWebsiteIncompleteUnderConstruction, + InvalidUrlWebsiteOther, + InvalidValueOther, + VerificationDirectorsMismatch, + VerificationDocumentAddressMismatch, + VerificationDocumentAddressMissing, + VerificationDocumentCorrupt, + VerificationDocumentCountryNotSupported, + VerificationDocumentDirectorsMismatch, + VerificationDocumentDobMismatch, + VerificationDocumentDuplicateType, + VerificationDocumentExpired, + VerificationDocumentFailedCopy, + VerificationDocumentFailedGreyscale, + VerificationDocumentFailedOther, + VerificationDocumentFailedTestMode, + VerificationDocumentFraudulent, + VerificationDocumentIdNumberMismatch, + VerificationDocumentIdNumberMissing, + VerificationDocumentIncomplete, + VerificationDocumentInvalid, + VerificationDocumentIssueOrExpiryDateMissing, + VerificationDocumentManipulated, + VerificationDocumentMissingBack, + VerificationDocumentMissingFront, + VerificationDocumentNameMismatch, + VerificationDocumentNameMissing, + VerificationDocumentNationalityMismatch, + VerificationDocumentNotReadable, + VerificationDocumentNotSigned, + VerificationDocumentNotUploaded, + VerificationDocumentPhotoMismatch, + VerificationDocumentTooLarge, + VerificationDocumentTypeNotSupported, + VerificationExtraneousDirectors, + VerificationFailedAddressMatch, + VerificationFailedBusinessIecNumber, + VerificationFailedDocumentMatch, + VerificationFailedIdNumberMatch, + VerificationFailedKeyedIdentity, + VerificationFailedKeyedMatch, + VerificationFailedNameMatch, + VerificationFailedOther, + VerificationFailedResidentialAddress, + VerificationFailedTaxIdMatch, + VerificationFailedTaxIdNotIssued, + VerificationMissingDirectors, + VerificationMissingExecutives, + VerificationMissingOwners, + VerificationRequiresAdditionalMemorandumOfAssociations, + /// An unrecognized value from Stripe. Should not be used as a request parameter. + Unknown, +} +impl AccountRequirementsErrorCode { + pub fn as_str(self) -> &'static str { + use AccountRequirementsErrorCode::*; + match self { + InvalidAddressCityStatePostalCode => "invalid_address_city_state_postal_code", + InvalidAddressHighwayContractBox => "invalid_address_highway_contract_box", + InvalidAddressPrivateMailbox => "invalid_address_private_mailbox", + InvalidBusinessProfileName => "invalid_business_profile_name", + InvalidBusinessProfileNameDenylisted => "invalid_business_profile_name_denylisted", + InvalidCompanyNameDenylisted => "invalid_company_name_denylisted", + InvalidDobAgeOverMaximum => "invalid_dob_age_over_maximum", + InvalidDobAgeUnder18 => "invalid_dob_age_under_18", + InvalidDobAgeUnderMinimum => "invalid_dob_age_under_minimum", + InvalidProductDescriptionLength => "invalid_product_description_length", + InvalidProductDescriptionUrlMatch => "invalid_product_description_url_match", + InvalidRepresentativeCountry => "invalid_representative_country", + InvalidStatementDescriptorBusinessMismatch => { + "invalid_statement_descriptor_business_mismatch" + } + InvalidStatementDescriptorDenylisted => "invalid_statement_descriptor_denylisted", + InvalidStatementDescriptorLength => "invalid_statement_descriptor_length", + InvalidStatementDescriptorPrefixDenylisted => { + "invalid_statement_descriptor_prefix_denylisted" + } + InvalidStatementDescriptorPrefixMismatch => { + "invalid_statement_descriptor_prefix_mismatch" + } + InvalidStreetAddress => "invalid_street_address", + InvalidTaxId => "invalid_tax_id", + InvalidTaxIdFormat => "invalid_tax_id_format", + InvalidTosAcceptance => "invalid_tos_acceptance", + InvalidUrlDenylisted => "invalid_url_denylisted", + InvalidUrlFormat => "invalid_url_format", + InvalidUrlLength => "invalid_url_length", + InvalidUrlWebPresenceDetected => "invalid_url_web_presence_detected", + InvalidUrlWebsiteBusinessInformationMismatch => { + "invalid_url_website_business_information_mismatch" + } + InvalidUrlWebsiteEmpty => "invalid_url_website_empty", + InvalidUrlWebsiteInaccessible => "invalid_url_website_inaccessible", + InvalidUrlWebsiteInaccessibleGeoblocked => { + "invalid_url_website_inaccessible_geoblocked" + } + InvalidUrlWebsiteInaccessiblePasswordProtected => { + "invalid_url_website_inaccessible_password_protected" + } + InvalidUrlWebsiteIncomplete => "invalid_url_website_incomplete", + InvalidUrlWebsiteIncompleteCancellationPolicy => { + "invalid_url_website_incomplete_cancellation_policy" + } + InvalidUrlWebsiteIncompleteCustomerServiceDetails => { + "invalid_url_website_incomplete_customer_service_details" + } + InvalidUrlWebsiteIncompleteLegalRestrictions => { + "invalid_url_website_incomplete_legal_restrictions" + } + InvalidUrlWebsiteIncompleteRefundPolicy => { + "invalid_url_website_incomplete_refund_policy" + } + InvalidUrlWebsiteIncompleteReturnPolicy => { + "invalid_url_website_incomplete_return_policy" + } + InvalidUrlWebsiteIncompleteTermsAndConditions => { + "invalid_url_website_incomplete_terms_and_conditions" + } + InvalidUrlWebsiteIncompleteUnderConstruction => { + "invalid_url_website_incomplete_under_construction" + } + InvalidUrlWebsiteOther => "invalid_url_website_other", + InvalidValueOther => "invalid_value_other", + VerificationDirectorsMismatch => "verification_directors_mismatch", + VerificationDocumentAddressMismatch => "verification_document_address_mismatch", + VerificationDocumentAddressMissing => "verification_document_address_missing", + VerificationDocumentCorrupt => "verification_document_corrupt", + VerificationDocumentCountryNotSupported => { + "verification_document_country_not_supported" + } + VerificationDocumentDirectorsMismatch => "verification_document_directors_mismatch", + VerificationDocumentDobMismatch => "verification_document_dob_mismatch", + VerificationDocumentDuplicateType => "verification_document_duplicate_type", + VerificationDocumentExpired => "verification_document_expired", + VerificationDocumentFailedCopy => "verification_document_failed_copy", + VerificationDocumentFailedGreyscale => "verification_document_failed_greyscale", + VerificationDocumentFailedOther => "verification_document_failed_other", + VerificationDocumentFailedTestMode => "verification_document_failed_test_mode", + VerificationDocumentFraudulent => "verification_document_fraudulent", + VerificationDocumentIdNumberMismatch => "verification_document_id_number_mismatch", + VerificationDocumentIdNumberMissing => "verification_document_id_number_missing", + VerificationDocumentIncomplete => "verification_document_incomplete", + VerificationDocumentInvalid => "verification_document_invalid", + VerificationDocumentIssueOrExpiryDateMissing => { + "verification_document_issue_or_expiry_date_missing" + } + VerificationDocumentManipulated => "verification_document_manipulated", + VerificationDocumentMissingBack => "verification_document_missing_back", + VerificationDocumentMissingFront => "verification_document_missing_front", + VerificationDocumentNameMismatch => "verification_document_name_mismatch", + VerificationDocumentNameMissing => "verification_document_name_missing", + VerificationDocumentNationalityMismatch => "verification_document_nationality_mismatch", + VerificationDocumentNotReadable => "verification_document_not_readable", + VerificationDocumentNotSigned => "verification_document_not_signed", + VerificationDocumentNotUploaded => "verification_document_not_uploaded", + VerificationDocumentPhotoMismatch => "verification_document_photo_mismatch", + VerificationDocumentTooLarge => "verification_document_too_large", + VerificationDocumentTypeNotSupported => "verification_document_type_not_supported", + VerificationExtraneousDirectors => "verification_extraneous_directors", + VerificationFailedAddressMatch => "verification_failed_address_match", + VerificationFailedBusinessIecNumber => "verification_failed_business_iec_number", + VerificationFailedDocumentMatch => "verification_failed_document_match", + VerificationFailedIdNumberMatch => "verification_failed_id_number_match", + VerificationFailedKeyedIdentity => "verification_failed_keyed_identity", + VerificationFailedKeyedMatch => "verification_failed_keyed_match", + VerificationFailedNameMatch => "verification_failed_name_match", + VerificationFailedOther => "verification_failed_other", + VerificationFailedResidentialAddress => "verification_failed_residential_address", + VerificationFailedTaxIdMatch => "verification_failed_tax_id_match", + VerificationFailedTaxIdNotIssued => "verification_failed_tax_id_not_issued", + VerificationMissingDirectors => "verification_missing_directors", + VerificationMissingExecutives => "verification_missing_executives", + VerificationMissingOwners => "verification_missing_owners", + VerificationRequiresAdditionalMemorandumOfAssociations => { + "verification_requires_additional_memorandum_of_associations" + } + Unknown => "unknown", + } + } +} + +impl std::str::FromStr for AccountRequirementsErrorCode { + type Err = (); + fn from_str(s: &str) -> Result { + use AccountRequirementsErrorCode::*; + match s { + "invalid_address_city_state_postal_code" => Ok(InvalidAddressCityStatePostalCode), + "invalid_address_highway_contract_box" => Ok(InvalidAddressHighwayContractBox), + "invalid_address_private_mailbox" => Ok(InvalidAddressPrivateMailbox), + "invalid_business_profile_name" => Ok(InvalidBusinessProfileName), + "invalid_business_profile_name_denylisted" => Ok(InvalidBusinessProfileNameDenylisted), + "invalid_company_name_denylisted" => Ok(InvalidCompanyNameDenylisted), + "invalid_dob_age_over_maximum" => Ok(InvalidDobAgeOverMaximum), + "invalid_dob_age_under_18" => Ok(InvalidDobAgeUnder18), + "invalid_dob_age_under_minimum" => Ok(InvalidDobAgeUnderMinimum), + "invalid_product_description_length" => Ok(InvalidProductDescriptionLength), + "invalid_product_description_url_match" => Ok(InvalidProductDescriptionUrlMatch), + "invalid_representative_country" => Ok(InvalidRepresentativeCountry), + "invalid_statement_descriptor_business_mismatch" => { + Ok(InvalidStatementDescriptorBusinessMismatch) + } + "invalid_statement_descriptor_denylisted" => Ok(InvalidStatementDescriptorDenylisted), + "invalid_statement_descriptor_length" => Ok(InvalidStatementDescriptorLength), + "invalid_statement_descriptor_prefix_denylisted" => { + Ok(InvalidStatementDescriptorPrefixDenylisted) + } + "invalid_statement_descriptor_prefix_mismatch" => { + Ok(InvalidStatementDescriptorPrefixMismatch) + } + "invalid_street_address" => Ok(InvalidStreetAddress), + "invalid_tax_id" => Ok(InvalidTaxId), + "invalid_tax_id_format" => Ok(InvalidTaxIdFormat), + "invalid_tos_acceptance" => Ok(InvalidTosAcceptance), + "invalid_url_denylisted" => Ok(InvalidUrlDenylisted), + "invalid_url_format" => Ok(InvalidUrlFormat), + "invalid_url_length" => Ok(InvalidUrlLength), + "invalid_url_web_presence_detected" => Ok(InvalidUrlWebPresenceDetected), + "invalid_url_website_business_information_mismatch" => { + Ok(InvalidUrlWebsiteBusinessInformationMismatch) + } + "invalid_url_website_empty" => Ok(InvalidUrlWebsiteEmpty), + "invalid_url_website_inaccessible" => Ok(InvalidUrlWebsiteInaccessible), + "invalid_url_website_inaccessible_geoblocked" => { + Ok(InvalidUrlWebsiteInaccessibleGeoblocked) + } + "invalid_url_website_inaccessible_password_protected" => { + Ok(InvalidUrlWebsiteInaccessiblePasswordProtected) + } + "invalid_url_website_incomplete" => Ok(InvalidUrlWebsiteIncomplete), + "invalid_url_website_incomplete_cancellation_policy" => { + Ok(InvalidUrlWebsiteIncompleteCancellationPolicy) + } + "invalid_url_website_incomplete_customer_service_details" => { + Ok(InvalidUrlWebsiteIncompleteCustomerServiceDetails) + } + "invalid_url_website_incomplete_legal_restrictions" => { + Ok(InvalidUrlWebsiteIncompleteLegalRestrictions) + } + "invalid_url_website_incomplete_refund_policy" => { + Ok(InvalidUrlWebsiteIncompleteRefundPolicy) + } + "invalid_url_website_incomplete_return_policy" => { + Ok(InvalidUrlWebsiteIncompleteReturnPolicy) + } + "invalid_url_website_incomplete_terms_and_conditions" => { + Ok(InvalidUrlWebsiteIncompleteTermsAndConditions) + } + "invalid_url_website_incomplete_under_construction" => { + Ok(InvalidUrlWebsiteIncompleteUnderConstruction) + } + "invalid_url_website_other" => Ok(InvalidUrlWebsiteOther), + "invalid_value_other" => Ok(InvalidValueOther), + "verification_directors_mismatch" => Ok(VerificationDirectorsMismatch), + "verification_document_address_mismatch" => Ok(VerificationDocumentAddressMismatch), + "verification_document_address_missing" => Ok(VerificationDocumentAddressMissing), + "verification_document_corrupt" => Ok(VerificationDocumentCorrupt), + "verification_document_country_not_supported" => { + Ok(VerificationDocumentCountryNotSupported) + } + "verification_document_directors_mismatch" => Ok(VerificationDocumentDirectorsMismatch), + "verification_document_dob_mismatch" => Ok(VerificationDocumentDobMismatch), + "verification_document_duplicate_type" => Ok(VerificationDocumentDuplicateType), + "verification_document_expired" => Ok(VerificationDocumentExpired), + "verification_document_failed_copy" => Ok(VerificationDocumentFailedCopy), + "verification_document_failed_greyscale" => Ok(VerificationDocumentFailedGreyscale), + "verification_document_failed_other" => Ok(VerificationDocumentFailedOther), + "verification_document_failed_test_mode" => Ok(VerificationDocumentFailedTestMode), + "verification_document_fraudulent" => Ok(VerificationDocumentFraudulent), + "verification_document_id_number_mismatch" => Ok(VerificationDocumentIdNumberMismatch), + "verification_document_id_number_missing" => Ok(VerificationDocumentIdNumberMissing), + "verification_document_incomplete" => Ok(VerificationDocumentIncomplete), + "verification_document_invalid" => Ok(VerificationDocumentInvalid), + "verification_document_issue_or_expiry_date_missing" => { + Ok(VerificationDocumentIssueOrExpiryDateMissing) + } + "verification_document_manipulated" => Ok(VerificationDocumentManipulated), + "verification_document_missing_back" => Ok(VerificationDocumentMissingBack), + "verification_document_missing_front" => Ok(VerificationDocumentMissingFront), + "verification_document_name_mismatch" => Ok(VerificationDocumentNameMismatch), + "verification_document_name_missing" => Ok(VerificationDocumentNameMissing), + "verification_document_nationality_mismatch" => { + Ok(VerificationDocumentNationalityMismatch) + } + "verification_document_not_readable" => Ok(VerificationDocumentNotReadable), + "verification_document_not_signed" => Ok(VerificationDocumentNotSigned), + "verification_document_not_uploaded" => Ok(VerificationDocumentNotUploaded), + "verification_document_photo_mismatch" => Ok(VerificationDocumentPhotoMismatch), + "verification_document_too_large" => Ok(VerificationDocumentTooLarge), + "verification_document_type_not_supported" => Ok(VerificationDocumentTypeNotSupported), + "verification_extraneous_directors" => Ok(VerificationExtraneousDirectors), + "verification_failed_address_match" => Ok(VerificationFailedAddressMatch), + "verification_failed_business_iec_number" => Ok(VerificationFailedBusinessIecNumber), + "verification_failed_document_match" => Ok(VerificationFailedDocumentMatch), + "verification_failed_id_number_match" => Ok(VerificationFailedIdNumberMatch), + "verification_failed_keyed_identity" => Ok(VerificationFailedKeyedIdentity), + "verification_failed_keyed_match" => Ok(VerificationFailedKeyedMatch), + "verification_failed_name_match" => Ok(VerificationFailedNameMatch), + "verification_failed_other" => Ok(VerificationFailedOther), + "verification_failed_residential_address" => Ok(VerificationFailedResidentialAddress), + "verification_failed_tax_id_match" => Ok(VerificationFailedTaxIdMatch), + "verification_failed_tax_id_not_issued" => Ok(VerificationFailedTaxIdNotIssued), + "verification_missing_directors" => Ok(VerificationMissingDirectors), + "verification_missing_executives" => Ok(VerificationMissingExecutives), + "verification_missing_owners" => Ok(VerificationMissingOwners), + "verification_requires_additional_memorandum_of_associations" => { + Ok(VerificationRequiresAdditionalMemorandumOfAssociations) + } + _ => Err(()), + } + } +} +impl std::fmt::Display for AccountRequirementsErrorCode { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for AccountRequirementsErrorCode { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for AccountRequirementsErrorCode { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for AccountRequirementsErrorCode { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Ok(Self::from_str(&s).unwrap_or(AccountRequirementsErrorCode::Unknown)) + } +} diff --git a/generated/stripe_shared/src/account_sepa_debit_payments_settings.rs b/generated/stripe_shared/src/account_sepa_debit_payments_settings.rs new file mode 100644 index 000000000..9da113cc0 --- /dev/null +++ b/generated/stripe_shared/src/account_sepa_debit_payments_settings.rs @@ -0,0 +1,6 @@ +#[derive(Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct AccountSepaDebitPaymentsSettings { + /// SEPA creditor identifier that identifies the company making the payment. + #[serde(skip_serializing_if = "Option::is_none")] + pub creditor_id: Option, +} diff --git a/generated/stripe_shared/src/account_settings.rs b/generated/stripe_shared/src/account_settings.rs new file mode 100644 index 000000000..6fd008740 --- /dev/null +++ b/generated/stripe_shared/src/account_settings.rs @@ -0,0 +1,19 @@ +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct AccountSettings { + #[serde(skip_serializing_if = "Option::is_none")] + pub bacs_debit_payments: Option, + pub branding: stripe_shared::AccountBrandingSettings, + #[serde(skip_serializing_if = "Option::is_none")] + pub card_issuing: Option, + pub card_payments: stripe_shared::AccountCardPaymentsSettings, + pub dashboard: stripe_shared::AccountDashboardSettings, + #[serde(skip_serializing_if = "Option::is_none")] + pub invoices: Option, + pub payments: stripe_shared::AccountPaymentsSettings, + #[serde(skip_serializing_if = "Option::is_none")] + pub payouts: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub sepa_debit_payments: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub treasury: Option, +} diff --git a/generated/stripe_shared/src/account_terms_of_service.rs b/generated/stripe_shared/src/account_terms_of_service.rs new file mode 100644 index 000000000..a096416f5 --- /dev/null +++ b/generated/stripe_shared/src/account_terms_of_service.rs @@ -0,0 +1,10 @@ +#[derive(Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct AccountTermsOfService { + /// The Unix timestamp marking when the account representative accepted the service agreement. + pub date: Option, + /// The IP address from which the account representative accepted the service agreement. + pub ip: Option, + /// The user agent of the browser from which the account representative accepted the service agreement. + #[serde(skip_serializing_if = "Option::is_none")] + pub user_agent: Option, +} diff --git a/generated/stripe_shared/src/account_tos_acceptance.rs b/generated/stripe_shared/src/account_tos_acceptance.rs new file mode 100644 index 000000000..9874a88f7 --- /dev/null +++ b/generated/stripe_shared/src/account_tos_acceptance.rs @@ -0,0 +1,15 @@ +#[derive(Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct AccountTosAcceptance { + /// The Unix timestamp marking when the account representative accepted their service agreement + #[serde(skip_serializing_if = "Option::is_none")] + pub date: Option, + /// The IP address from which the account representative accepted their service agreement + #[serde(skip_serializing_if = "Option::is_none")] + pub ip: Option, + /// The user's service agreement type + #[serde(skip_serializing_if = "Option::is_none")] + pub service_agreement: Option, + /// The user agent of the browser from which the account representative accepted their service agreement. + #[serde(skip_serializing_if = "Option::is_none")] + pub user_agent: Option, +} diff --git a/generated/stripe_shared/src/account_treasury_settings.rs b/generated/stripe_shared/src/account_treasury_settings.rs new file mode 100644 index 000000000..37f832a0e --- /dev/null +++ b/generated/stripe_shared/src/account_treasury_settings.rs @@ -0,0 +1,5 @@ +#[derive(Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct AccountTreasurySettings { + #[serde(skip_serializing_if = "Option::is_none")] + pub tos_acceptance: Option, +} diff --git a/generated/stripe_shared/src/account_unification_account_controller.rs b/generated/stripe_shared/src/account_unification_account_controller.rs new file mode 100644 index 000000000..196772550 --- /dev/null +++ b/generated/stripe_shared/src/account_unification_account_controller.rs @@ -0,0 +1,67 @@ +#[derive(Copy, Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct AccountUnificationAccountController { + /// `true` if the Connect application retrieving the resource controls the account and can therefore exercise [platform controls](https://stripe.com/docs/connect/platform-controls-for-standard-accounts). + /// Otherwise, this field is null. + #[serde(skip_serializing_if = "Option::is_none")] + pub is_controller: Option, + /// The controller type. + /// Can be `application`, if a Connect application controls the account, or `account`, if the account controls itself. + #[serde(rename = "type")] + pub type_: AccountUnificationAccountControllerType, +} +/// The controller type. +/// Can be `application`, if a Connect application controls the account, or `account`, if the account controls itself. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum AccountUnificationAccountControllerType { + Account, + Application, +} +impl AccountUnificationAccountControllerType { + pub fn as_str(self) -> &'static str { + use AccountUnificationAccountControllerType::*; + match self { + Account => "account", + Application => "application", + } + } +} + +impl std::str::FromStr for AccountUnificationAccountControllerType { + type Err = (); + fn from_str(s: &str) -> Result { + use AccountUnificationAccountControllerType::*; + match s { + "account" => Ok(Account), + "application" => Ok(Application), + _ => Err(()), + } + } +} +impl std::fmt::Display for AccountUnificationAccountControllerType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for AccountUnificationAccountControllerType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for AccountUnificationAccountControllerType { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for AccountUnificationAccountControllerType { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| { + serde::de::Error::custom("Unknown value for AccountUnificationAccountControllerType") + }) + } +} diff --git a/src/resources/generated/address.rs b/generated/stripe_shared/src/address.rs similarity index 67% rename from src/resources/generated/address.rs rename to generated/stripe_shared/src/address.rs index 0bb574529..9aaf337bf 100644 --- a/src/resources/generated/address.rs +++ b/generated/stripe_shared/src/address.rs @@ -1,27 +1,15 @@ -// ====================================== -// This file was automatically generated. -// ====================================== - -use serde::{Deserialize, Serialize}; - -/// The resource representing a Stripe "Address". -#[derive(Clone, Debug, Default, Deserialize, Serialize)] +#[derive(Clone, Debug, Default, serde::Serialize, serde::Deserialize)] pub struct Address { /// City, district, suburb, town, or village. pub city: Option, - /// Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). pub country: Option, - /// Address line 1 (e.g., street, PO Box, or company name). pub line1: Option, - /// Address line 2 (e.g., apartment, suite, unit, or building). pub line2: Option, - /// ZIP or postal code. pub postal_code: Option, - /// State, county, province, or region. pub state: Option, } diff --git a/generated/stripe_shared/src/api_errors.rs b/generated/stripe_shared/src/api_errors.rs new file mode 100644 index 000000000..9cbf161e2 --- /dev/null +++ b/generated/stripe_shared/src/api_errors.rs @@ -0,0 +1,690 @@ +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct ApiErrors { + /// For card errors, the ID of the failed charge. + #[serde(skip_serializing_if = "Option::is_none")] + pub charge: Option, + /// For some errors that could be handled programmatically, a short string indicating the [error code](https://stripe.com/docs/error-codes) reported. + #[serde(skip_serializing_if = "Option::is_none")] + pub code: Option, + /// For card errors resulting from a card issuer decline, a short string indicating the [card issuer's reason for the decline](https://stripe.com/docs/declines#issuer-declines) if they provide one. + #[serde(skip_serializing_if = "Option::is_none")] + pub decline_code: Option, + /// A URL to more information about the [error code](https://stripe.com/docs/error-codes) reported. + #[serde(skip_serializing_if = "Option::is_none")] + pub doc_url: Option, + /// A human-readable message providing more details about the error. + /// For card errors, these messages can be shown to your users. + #[serde(skip_serializing_if = "Option::is_none")] + pub message: Option, + /// If the error is parameter-specific, the parameter related to the error. + /// For example, you can use this to display a message near the correct form field. + #[serde(skip_serializing_if = "Option::is_none")] + pub param: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub payment_intent: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub payment_method: Option, + /// If the error is specific to the type of payment method, the payment method type that had a problem. + /// This field is only populated for invoice-related errors. + #[serde(skip_serializing_if = "Option::is_none")] + pub payment_method_type: Option, + /// A URL to the request log entry in your dashboard. + #[serde(skip_serializing_if = "Option::is_none")] + pub request_log_url: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub setup_intent: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub source: Option, + /// The type of error returned. + /// One of `api_error`, `card_error`, `idempotency_error`, or `invalid_request_error`. + #[serde(rename = "type")] + pub type_: ApiErrorsType, +} +/// For some errors that could be handled programmatically, a short string indicating the [error code](https://stripe.com/docs/error-codes) reported. +#[derive(Copy, Clone, Eq, PartialEq)] +#[non_exhaustive] +pub enum ApiErrorsCode { + AccountClosed, + AccountCountryInvalidAddress, + AccountErrorCountryChangeRequiresAdditionalSteps, + AccountInformationMismatch, + AccountInvalid, + AccountNumberInvalid, + AcssDebitSessionIncomplete, + AlipayUpgradeRequired, + AmountTooLarge, + AmountTooSmall, + ApiKeyExpired, + ApplicationFeesNotAllowed, + AuthenticationRequired, + BalanceInsufficient, + BalanceInvalidParameter, + BankAccountBadRoutingNumbers, + BankAccountDeclined, + BankAccountExists, + BankAccountRestricted, + BankAccountUnusable, + BankAccountUnverified, + BankAccountVerificationFailed, + BillingInvalidMandate, + BitcoinUpgradeRequired, + CaptureChargeAuthorizationExpired, + CaptureUnauthorizedPayment, + CardDeclineRateLimitExceeded, + CardDeclined, + CardholderPhoneNumberRequired, + ChargeAlreadyCaptured, + ChargeAlreadyRefunded, + ChargeDisputed, + ChargeExceedsSourceLimit, + ChargeExpiredForCapture, + ChargeInvalidParameter, + ChargeNotRefundable, + ClearingCodeUnsupported, + CountryCodeInvalid, + CountryUnsupported, + CouponExpired, + CustomerMaxPaymentMethods, + CustomerMaxSubscriptions, + CustomerTaxLocationInvalid, + DebitNotAuthorized, + EmailInvalid, + ExpiredCard, + FinancialConnectionsAccountInactive, + FinancialConnectionsNoSuccessfulTransactionRefresh, + IdempotencyKeyInUse, + IncorrectAddress, + IncorrectCvc, + IncorrectNumber, + IncorrectZip, + InstantPayoutsConfigDisabled, + InstantPayoutsCurrencyDisabled, + InstantPayoutsLimitExceeded, + InstantPayoutsUnsupported, + InsufficientFunds, + IntentInvalidState, + IntentVerificationMethodMissing, + InvalidCardType, + InvalidCharacters, + InvalidChargeAmount, + InvalidCvc, + InvalidExpiryMonth, + InvalidExpiryYear, + InvalidNumber, + InvalidSourceUsage, + InvalidTaxLocation, + InvoiceNoCustomerLineItems, + InvoiceNoPaymentMethodTypes, + InvoiceNoSubscriptionLineItems, + InvoiceNotEditable, + InvoiceOnBehalfOfNotEditable, + InvoicePaymentIntentRequiresAction, + InvoiceUpcomingNone, + LivemodeMismatch, + LockTimeout, + Missing, + NoAccount, + NotAllowedOnStandardAccount, + OutOfInventory, + OwnershipDeclarationNotAllowed, + ParameterInvalidEmpty, + ParameterInvalidInteger, + ParameterInvalidStringBlank, + ParameterInvalidStringEmpty, + ParameterMissing, + ParameterUnknown, + ParametersExclusive, + PaymentIntentActionRequired, + PaymentIntentAuthenticationFailure, + PaymentIntentIncompatiblePaymentMethod, + PaymentIntentInvalidParameter, + PaymentIntentKonbiniRejectedConfirmationNumber, + PaymentIntentMandateInvalid, + PaymentIntentPaymentAttemptExpired, + PaymentIntentPaymentAttemptFailed, + PaymentIntentUnexpectedState, + PaymentMethodBankAccountAlreadyVerified, + PaymentMethodBankAccountBlocked, + PaymentMethodBillingDetailsAddressMissing, + PaymentMethodConfigurationFailures, + PaymentMethodCurrencyMismatch, + PaymentMethodCustomerDecline, + PaymentMethodInvalidParameter, + PaymentMethodInvalidParameterTestmode, + PaymentMethodMicrodepositFailed, + PaymentMethodMicrodepositVerificationAmountsInvalid, + PaymentMethodMicrodepositVerificationAmountsMismatch, + PaymentMethodMicrodepositVerificationAttemptsExceeded, + PaymentMethodMicrodepositVerificationDescriptorCodeMismatch, + PaymentMethodMicrodepositVerificationTimeout, + PaymentMethodNotAvailable, + PaymentMethodProviderDecline, + PaymentMethodProviderTimeout, + PaymentMethodUnactivated, + PaymentMethodUnexpectedState, + PaymentMethodUnsupportedType, + PayoutReconciliationNotReady, + PayoutsLimitExceeded, + PayoutsNotAllowed, + PlatformAccountRequired, + PlatformApiKeyExpired, + PostalCodeInvalid, + ProcessingError, + ProductInactive, + ProgressiveOnboardingLimitExceeded, + RateLimit, + ReferToCustomer, + RefundDisputedPayment, + ResourceAlreadyExists, + ResourceMissing, + ReturnIntentAlreadyProcessed, + RoutingNumberInvalid, + SecretKeyRequired, + SepaUnsupportedAccount, + SetupAttemptFailed, + SetupIntentAuthenticationFailure, + SetupIntentInvalidParameter, + SetupIntentMandateInvalid, + SetupIntentSetupAttemptExpired, + SetupIntentUnexpectedState, + ShippingCalculationFailed, + SkuInactive, + StateUnsupported, + StatusTransitionInvalid, + StripeTaxInactive, + TaxIdInvalid, + TaxesCalculationFailed, + TerminalLocationCountryUnsupported, + TerminalReaderBusy, + TerminalReaderHardwareFault, + TerminalReaderOffline, + TerminalReaderTimeout, + TestmodeChargesOnly, + TlsVersionUnsupported, + TokenAlreadyUsed, + TokenCardNetworkInvalid, + TokenInUse, + TransferSourceBalanceParametersMismatch, + TransfersNotAllowed, + UrlInvalid, + /// An unrecognized value from Stripe. Should not be used as a request parameter. + Unknown, +} +impl ApiErrorsCode { + pub fn as_str(self) -> &'static str { + use ApiErrorsCode::*; + match self { + AccountClosed => "account_closed", + AccountCountryInvalidAddress => "account_country_invalid_address", + AccountErrorCountryChangeRequiresAdditionalSteps => { + "account_error_country_change_requires_additional_steps" + } + AccountInformationMismatch => "account_information_mismatch", + AccountInvalid => "account_invalid", + AccountNumberInvalid => "account_number_invalid", + AcssDebitSessionIncomplete => "acss_debit_session_incomplete", + AlipayUpgradeRequired => "alipay_upgrade_required", + AmountTooLarge => "amount_too_large", + AmountTooSmall => "amount_too_small", + ApiKeyExpired => "api_key_expired", + ApplicationFeesNotAllowed => "application_fees_not_allowed", + AuthenticationRequired => "authentication_required", + BalanceInsufficient => "balance_insufficient", + BalanceInvalidParameter => "balance_invalid_parameter", + BankAccountBadRoutingNumbers => "bank_account_bad_routing_numbers", + BankAccountDeclined => "bank_account_declined", + BankAccountExists => "bank_account_exists", + BankAccountRestricted => "bank_account_restricted", + BankAccountUnusable => "bank_account_unusable", + BankAccountUnverified => "bank_account_unverified", + BankAccountVerificationFailed => "bank_account_verification_failed", + BillingInvalidMandate => "billing_invalid_mandate", + BitcoinUpgradeRequired => "bitcoin_upgrade_required", + CaptureChargeAuthorizationExpired => "capture_charge_authorization_expired", + CaptureUnauthorizedPayment => "capture_unauthorized_payment", + CardDeclineRateLimitExceeded => "card_decline_rate_limit_exceeded", + CardDeclined => "card_declined", + CardholderPhoneNumberRequired => "cardholder_phone_number_required", + ChargeAlreadyCaptured => "charge_already_captured", + ChargeAlreadyRefunded => "charge_already_refunded", + ChargeDisputed => "charge_disputed", + ChargeExceedsSourceLimit => "charge_exceeds_source_limit", + ChargeExpiredForCapture => "charge_expired_for_capture", + ChargeInvalidParameter => "charge_invalid_parameter", + ChargeNotRefundable => "charge_not_refundable", + ClearingCodeUnsupported => "clearing_code_unsupported", + CountryCodeInvalid => "country_code_invalid", + CountryUnsupported => "country_unsupported", + CouponExpired => "coupon_expired", + CustomerMaxPaymentMethods => "customer_max_payment_methods", + CustomerMaxSubscriptions => "customer_max_subscriptions", + CustomerTaxLocationInvalid => "customer_tax_location_invalid", + DebitNotAuthorized => "debit_not_authorized", + EmailInvalid => "email_invalid", + ExpiredCard => "expired_card", + FinancialConnectionsAccountInactive => "financial_connections_account_inactive", + FinancialConnectionsNoSuccessfulTransactionRefresh => { + "financial_connections_no_successful_transaction_refresh" + } + IdempotencyKeyInUse => "idempotency_key_in_use", + IncorrectAddress => "incorrect_address", + IncorrectCvc => "incorrect_cvc", + IncorrectNumber => "incorrect_number", + IncorrectZip => "incorrect_zip", + InstantPayoutsConfigDisabled => "instant_payouts_config_disabled", + InstantPayoutsCurrencyDisabled => "instant_payouts_currency_disabled", + InstantPayoutsLimitExceeded => "instant_payouts_limit_exceeded", + InstantPayoutsUnsupported => "instant_payouts_unsupported", + InsufficientFunds => "insufficient_funds", + IntentInvalidState => "intent_invalid_state", + IntentVerificationMethodMissing => "intent_verification_method_missing", + InvalidCardType => "invalid_card_type", + InvalidCharacters => "invalid_characters", + InvalidChargeAmount => "invalid_charge_amount", + InvalidCvc => "invalid_cvc", + InvalidExpiryMonth => "invalid_expiry_month", + InvalidExpiryYear => "invalid_expiry_year", + InvalidNumber => "invalid_number", + InvalidSourceUsage => "invalid_source_usage", + InvalidTaxLocation => "invalid_tax_location", + InvoiceNoCustomerLineItems => "invoice_no_customer_line_items", + InvoiceNoPaymentMethodTypes => "invoice_no_payment_method_types", + InvoiceNoSubscriptionLineItems => "invoice_no_subscription_line_items", + InvoiceNotEditable => "invoice_not_editable", + InvoiceOnBehalfOfNotEditable => "invoice_on_behalf_of_not_editable", + InvoicePaymentIntentRequiresAction => "invoice_payment_intent_requires_action", + InvoiceUpcomingNone => "invoice_upcoming_none", + LivemodeMismatch => "livemode_mismatch", + LockTimeout => "lock_timeout", + Missing => "missing", + NoAccount => "no_account", + NotAllowedOnStandardAccount => "not_allowed_on_standard_account", + OutOfInventory => "out_of_inventory", + OwnershipDeclarationNotAllowed => "ownership_declaration_not_allowed", + ParameterInvalidEmpty => "parameter_invalid_empty", + ParameterInvalidInteger => "parameter_invalid_integer", + ParameterInvalidStringBlank => "parameter_invalid_string_blank", + ParameterInvalidStringEmpty => "parameter_invalid_string_empty", + ParameterMissing => "parameter_missing", + ParameterUnknown => "parameter_unknown", + ParametersExclusive => "parameters_exclusive", + PaymentIntentActionRequired => "payment_intent_action_required", + PaymentIntentAuthenticationFailure => "payment_intent_authentication_failure", + PaymentIntentIncompatiblePaymentMethod => "payment_intent_incompatible_payment_method", + PaymentIntentInvalidParameter => "payment_intent_invalid_parameter", + PaymentIntentKonbiniRejectedConfirmationNumber => { + "payment_intent_konbini_rejected_confirmation_number" + } + PaymentIntentMandateInvalid => "payment_intent_mandate_invalid", + PaymentIntentPaymentAttemptExpired => "payment_intent_payment_attempt_expired", + PaymentIntentPaymentAttemptFailed => "payment_intent_payment_attempt_failed", + PaymentIntentUnexpectedState => "payment_intent_unexpected_state", + PaymentMethodBankAccountAlreadyVerified => { + "payment_method_bank_account_already_verified" + } + PaymentMethodBankAccountBlocked => "payment_method_bank_account_blocked", + PaymentMethodBillingDetailsAddressMissing => { + "payment_method_billing_details_address_missing" + } + PaymentMethodConfigurationFailures => "payment_method_configuration_failures", + PaymentMethodCurrencyMismatch => "payment_method_currency_mismatch", + PaymentMethodCustomerDecline => "payment_method_customer_decline", + PaymentMethodInvalidParameter => "payment_method_invalid_parameter", + PaymentMethodInvalidParameterTestmode => "payment_method_invalid_parameter_testmode", + PaymentMethodMicrodepositFailed => "payment_method_microdeposit_failed", + PaymentMethodMicrodepositVerificationAmountsInvalid => { + "payment_method_microdeposit_verification_amounts_invalid" + } + PaymentMethodMicrodepositVerificationAmountsMismatch => { + "payment_method_microdeposit_verification_amounts_mismatch" + } + PaymentMethodMicrodepositVerificationAttemptsExceeded => { + "payment_method_microdeposit_verification_attempts_exceeded" + } + PaymentMethodMicrodepositVerificationDescriptorCodeMismatch => { + "payment_method_microdeposit_verification_descriptor_code_mismatch" + } + PaymentMethodMicrodepositVerificationTimeout => { + "payment_method_microdeposit_verification_timeout" + } + PaymentMethodNotAvailable => "payment_method_not_available", + PaymentMethodProviderDecline => "payment_method_provider_decline", + PaymentMethodProviderTimeout => "payment_method_provider_timeout", + PaymentMethodUnactivated => "payment_method_unactivated", + PaymentMethodUnexpectedState => "payment_method_unexpected_state", + PaymentMethodUnsupportedType => "payment_method_unsupported_type", + PayoutReconciliationNotReady => "payout_reconciliation_not_ready", + PayoutsLimitExceeded => "payouts_limit_exceeded", + PayoutsNotAllowed => "payouts_not_allowed", + PlatformAccountRequired => "platform_account_required", + PlatformApiKeyExpired => "platform_api_key_expired", + PostalCodeInvalid => "postal_code_invalid", + ProcessingError => "processing_error", + ProductInactive => "product_inactive", + ProgressiveOnboardingLimitExceeded => "progressive_onboarding_limit_exceeded", + RateLimit => "rate_limit", + ReferToCustomer => "refer_to_customer", + RefundDisputedPayment => "refund_disputed_payment", + ResourceAlreadyExists => "resource_already_exists", + ResourceMissing => "resource_missing", + ReturnIntentAlreadyProcessed => "return_intent_already_processed", + RoutingNumberInvalid => "routing_number_invalid", + SecretKeyRequired => "secret_key_required", + SepaUnsupportedAccount => "sepa_unsupported_account", + SetupAttemptFailed => "setup_attempt_failed", + SetupIntentAuthenticationFailure => "setup_intent_authentication_failure", + SetupIntentInvalidParameter => "setup_intent_invalid_parameter", + SetupIntentMandateInvalid => "setup_intent_mandate_invalid", + SetupIntentSetupAttemptExpired => "setup_intent_setup_attempt_expired", + SetupIntentUnexpectedState => "setup_intent_unexpected_state", + ShippingCalculationFailed => "shipping_calculation_failed", + SkuInactive => "sku_inactive", + StateUnsupported => "state_unsupported", + StatusTransitionInvalid => "status_transition_invalid", + StripeTaxInactive => "stripe_tax_inactive", + TaxIdInvalid => "tax_id_invalid", + TaxesCalculationFailed => "taxes_calculation_failed", + TerminalLocationCountryUnsupported => "terminal_location_country_unsupported", + TerminalReaderBusy => "terminal_reader_busy", + TerminalReaderHardwareFault => "terminal_reader_hardware_fault", + TerminalReaderOffline => "terminal_reader_offline", + TerminalReaderTimeout => "terminal_reader_timeout", + TestmodeChargesOnly => "testmode_charges_only", + TlsVersionUnsupported => "tls_version_unsupported", + TokenAlreadyUsed => "token_already_used", + TokenCardNetworkInvalid => "token_card_network_invalid", + TokenInUse => "token_in_use", + TransferSourceBalanceParametersMismatch => { + "transfer_source_balance_parameters_mismatch" + } + TransfersNotAllowed => "transfers_not_allowed", + UrlInvalid => "url_invalid", + Unknown => "unknown", + } + } +} + +impl std::str::FromStr for ApiErrorsCode { + type Err = (); + fn from_str(s: &str) -> Result { + use ApiErrorsCode::*; + match s { + "account_closed" => Ok(AccountClosed), + "account_country_invalid_address" => Ok(AccountCountryInvalidAddress), + "account_error_country_change_requires_additional_steps" => { + Ok(AccountErrorCountryChangeRequiresAdditionalSteps) + } + "account_information_mismatch" => Ok(AccountInformationMismatch), + "account_invalid" => Ok(AccountInvalid), + "account_number_invalid" => Ok(AccountNumberInvalid), + "acss_debit_session_incomplete" => Ok(AcssDebitSessionIncomplete), + "alipay_upgrade_required" => Ok(AlipayUpgradeRequired), + "amount_too_large" => Ok(AmountTooLarge), + "amount_too_small" => Ok(AmountTooSmall), + "api_key_expired" => Ok(ApiKeyExpired), + "application_fees_not_allowed" => Ok(ApplicationFeesNotAllowed), + "authentication_required" => Ok(AuthenticationRequired), + "balance_insufficient" => Ok(BalanceInsufficient), + "balance_invalid_parameter" => Ok(BalanceInvalidParameter), + "bank_account_bad_routing_numbers" => Ok(BankAccountBadRoutingNumbers), + "bank_account_declined" => Ok(BankAccountDeclined), + "bank_account_exists" => Ok(BankAccountExists), + "bank_account_restricted" => Ok(BankAccountRestricted), + "bank_account_unusable" => Ok(BankAccountUnusable), + "bank_account_unverified" => Ok(BankAccountUnverified), + "bank_account_verification_failed" => Ok(BankAccountVerificationFailed), + "billing_invalid_mandate" => Ok(BillingInvalidMandate), + "bitcoin_upgrade_required" => Ok(BitcoinUpgradeRequired), + "capture_charge_authorization_expired" => Ok(CaptureChargeAuthorizationExpired), + "capture_unauthorized_payment" => Ok(CaptureUnauthorizedPayment), + "card_decline_rate_limit_exceeded" => Ok(CardDeclineRateLimitExceeded), + "card_declined" => Ok(CardDeclined), + "cardholder_phone_number_required" => Ok(CardholderPhoneNumberRequired), + "charge_already_captured" => Ok(ChargeAlreadyCaptured), + "charge_already_refunded" => Ok(ChargeAlreadyRefunded), + "charge_disputed" => Ok(ChargeDisputed), + "charge_exceeds_source_limit" => Ok(ChargeExceedsSourceLimit), + "charge_expired_for_capture" => Ok(ChargeExpiredForCapture), + "charge_invalid_parameter" => Ok(ChargeInvalidParameter), + "charge_not_refundable" => Ok(ChargeNotRefundable), + "clearing_code_unsupported" => Ok(ClearingCodeUnsupported), + "country_code_invalid" => Ok(CountryCodeInvalid), + "country_unsupported" => Ok(CountryUnsupported), + "coupon_expired" => Ok(CouponExpired), + "customer_max_payment_methods" => Ok(CustomerMaxPaymentMethods), + "customer_max_subscriptions" => Ok(CustomerMaxSubscriptions), + "customer_tax_location_invalid" => Ok(CustomerTaxLocationInvalid), + "debit_not_authorized" => Ok(DebitNotAuthorized), + "email_invalid" => Ok(EmailInvalid), + "expired_card" => Ok(ExpiredCard), + "financial_connections_account_inactive" => Ok(FinancialConnectionsAccountInactive), + "financial_connections_no_successful_transaction_refresh" => { + Ok(FinancialConnectionsNoSuccessfulTransactionRefresh) + } + "idempotency_key_in_use" => Ok(IdempotencyKeyInUse), + "incorrect_address" => Ok(IncorrectAddress), + "incorrect_cvc" => Ok(IncorrectCvc), + "incorrect_number" => Ok(IncorrectNumber), + "incorrect_zip" => Ok(IncorrectZip), + "instant_payouts_config_disabled" => Ok(InstantPayoutsConfigDisabled), + "instant_payouts_currency_disabled" => Ok(InstantPayoutsCurrencyDisabled), + "instant_payouts_limit_exceeded" => Ok(InstantPayoutsLimitExceeded), + "instant_payouts_unsupported" => Ok(InstantPayoutsUnsupported), + "insufficient_funds" => Ok(InsufficientFunds), + "intent_invalid_state" => Ok(IntentInvalidState), + "intent_verification_method_missing" => Ok(IntentVerificationMethodMissing), + "invalid_card_type" => Ok(InvalidCardType), + "invalid_characters" => Ok(InvalidCharacters), + "invalid_charge_amount" => Ok(InvalidChargeAmount), + "invalid_cvc" => Ok(InvalidCvc), + "invalid_expiry_month" => Ok(InvalidExpiryMonth), + "invalid_expiry_year" => Ok(InvalidExpiryYear), + "invalid_number" => Ok(InvalidNumber), + "invalid_source_usage" => Ok(InvalidSourceUsage), + "invalid_tax_location" => Ok(InvalidTaxLocation), + "invoice_no_customer_line_items" => Ok(InvoiceNoCustomerLineItems), + "invoice_no_payment_method_types" => Ok(InvoiceNoPaymentMethodTypes), + "invoice_no_subscription_line_items" => Ok(InvoiceNoSubscriptionLineItems), + "invoice_not_editable" => Ok(InvoiceNotEditable), + "invoice_on_behalf_of_not_editable" => Ok(InvoiceOnBehalfOfNotEditable), + "invoice_payment_intent_requires_action" => Ok(InvoicePaymentIntentRequiresAction), + "invoice_upcoming_none" => Ok(InvoiceUpcomingNone), + "livemode_mismatch" => Ok(LivemodeMismatch), + "lock_timeout" => Ok(LockTimeout), + "missing" => Ok(Missing), + "no_account" => Ok(NoAccount), + "not_allowed_on_standard_account" => Ok(NotAllowedOnStandardAccount), + "out_of_inventory" => Ok(OutOfInventory), + "ownership_declaration_not_allowed" => Ok(OwnershipDeclarationNotAllowed), + "parameter_invalid_empty" => Ok(ParameterInvalidEmpty), + "parameter_invalid_integer" => Ok(ParameterInvalidInteger), + "parameter_invalid_string_blank" => Ok(ParameterInvalidStringBlank), + "parameter_invalid_string_empty" => Ok(ParameterInvalidStringEmpty), + "parameter_missing" => Ok(ParameterMissing), + "parameter_unknown" => Ok(ParameterUnknown), + "parameters_exclusive" => Ok(ParametersExclusive), + "payment_intent_action_required" => Ok(PaymentIntentActionRequired), + "payment_intent_authentication_failure" => Ok(PaymentIntentAuthenticationFailure), + "payment_intent_incompatible_payment_method" => { + Ok(PaymentIntentIncompatiblePaymentMethod) + } + "payment_intent_invalid_parameter" => Ok(PaymentIntentInvalidParameter), + "payment_intent_konbini_rejected_confirmation_number" => { + Ok(PaymentIntentKonbiniRejectedConfirmationNumber) + } + "payment_intent_mandate_invalid" => Ok(PaymentIntentMandateInvalid), + "payment_intent_payment_attempt_expired" => Ok(PaymentIntentPaymentAttemptExpired), + "payment_intent_payment_attempt_failed" => Ok(PaymentIntentPaymentAttemptFailed), + "payment_intent_unexpected_state" => Ok(PaymentIntentUnexpectedState), + "payment_method_bank_account_already_verified" => { + Ok(PaymentMethodBankAccountAlreadyVerified) + } + "payment_method_bank_account_blocked" => Ok(PaymentMethodBankAccountBlocked), + "payment_method_billing_details_address_missing" => { + Ok(PaymentMethodBillingDetailsAddressMissing) + } + "payment_method_configuration_failures" => Ok(PaymentMethodConfigurationFailures), + "payment_method_currency_mismatch" => Ok(PaymentMethodCurrencyMismatch), + "payment_method_customer_decline" => Ok(PaymentMethodCustomerDecline), + "payment_method_invalid_parameter" => Ok(PaymentMethodInvalidParameter), + "payment_method_invalid_parameter_testmode" => { + Ok(PaymentMethodInvalidParameterTestmode) + } + "payment_method_microdeposit_failed" => Ok(PaymentMethodMicrodepositFailed), + "payment_method_microdeposit_verification_amounts_invalid" => { + Ok(PaymentMethodMicrodepositVerificationAmountsInvalid) + } + "payment_method_microdeposit_verification_amounts_mismatch" => { + Ok(PaymentMethodMicrodepositVerificationAmountsMismatch) + } + "payment_method_microdeposit_verification_attempts_exceeded" => { + Ok(PaymentMethodMicrodepositVerificationAttemptsExceeded) + } + "payment_method_microdeposit_verification_descriptor_code_mismatch" => { + Ok(PaymentMethodMicrodepositVerificationDescriptorCodeMismatch) + } + "payment_method_microdeposit_verification_timeout" => { + Ok(PaymentMethodMicrodepositVerificationTimeout) + } + "payment_method_not_available" => Ok(PaymentMethodNotAvailable), + "payment_method_provider_decline" => Ok(PaymentMethodProviderDecline), + "payment_method_provider_timeout" => Ok(PaymentMethodProviderTimeout), + "payment_method_unactivated" => Ok(PaymentMethodUnactivated), + "payment_method_unexpected_state" => Ok(PaymentMethodUnexpectedState), + "payment_method_unsupported_type" => Ok(PaymentMethodUnsupportedType), + "payout_reconciliation_not_ready" => Ok(PayoutReconciliationNotReady), + "payouts_limit_exceeded" => Ok(PayoutsLimitExceeded), + "payouts_not_allowed" => Ok(PayoutsNotAllowed), + "platform_account_required" => Ok(PlatformAccountRequired), + "platform_api_key_expired" => Ok(PlatformApiKeyExpired), + "postal_code_invalid" => Ok(PostalCodeInvalid), + "processing_error" => Ok(ProcessingError), + "product_inactive" => Ok(ProductInactive), + "progressive_onboarding_limit_exceeded" => Ok(ProgressiveOnboardingLimitExceeded), + "rate_limit" => Ok(RateLimit), + "refer_to_customer" => Ok(ReferToCustomer), + "refund_disputed_payment" => Ok(RefundDisputedPayment), + "resource_already_exists" => Ok(ResourceAlreadyExists), + "resource_missing" => Ok(ResourceMissing), + "return_intent_already_processed" => Ok(ReturnIntentAlreadyProcessed), + "routing_number_invalid" => Ok(RoutingNumberInvalid), + "secret_key_required" => Ok(SecretKeyRequired), + "sepa_unsupported_account" => Ok(SepaUnsupportedAccount), + "setup_attempt_failed" => Ok(SetupAttemptFailed), + "setup_intent_authentication_failure" => Ok(SetupIntentAuthenticationFailure), + "setup_intent_invalid_parameter" => Ok(SetupIntentInvalidParameter), + "setup_intent_mandate_invalid" => Ok(SetupIntentMandateInvalid), + "setup_intent_setup_attempt_expired" => Ok(SetupIntentSetupAttemptExpired), + "setup_intent_unexpected_state" => Ok(SetupIntentUnexpectedState), + "shipping_calculation_failed" => Ok(ShippingCalculationFailed), + "sku_inactive" => Ok(SkuInactive), + "state_unsupported" => Ok(StateUnsupported), + "status_transition_invalid" => Ok(StatusTransitionInvalid), + "stripe_tax_inactive" => Ok(StripeTaxInactive), + "tax_id_invalid" => Ok(TaxIdInvalid), + "taxes_calculation_failed" => Ok(TaxesCalculationFailed), + "terminal_location_country_unsupported" => Ok(TerminalLocationCountryUnsupported), + "terminal_reader_busy" => Ok(TerminalReaderBusy), + "terminal_reader_hardware_fault" => Ok(TerminalReaderHardwareFault), + "terminal_reader_offline" => Ok(TerminalReaderOffline), + "terminal_reader_timeout" => Ok(TerminalReaderTimeout), + "testmode_charges_only" => Ok(TestmodeChargesOnly), + "tls_version_unsupported" => Ok(TlsVersionUnsupported), + "token_already_used" => Ok(TokenAlreadyUsed), + "token_card_network_invalid" => Ok(TokenCardNetworkInvalid), + "token_in_use" => Ok(TokenInUse), + "transfer_source_balance_parameters_mismatch" => { + Ok(TransferSourceBalanceParametersMismatch) + } + "transfers_not_allowed" => Ok(TransfersNotAllowed), + "url_invalid" => Ok(UrlInvalid), + _ => Err(()), + } + } +} +impl std::fmt::Display for ApiErrorsCode { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for ApiErrorsCode { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for ApiErrorsCode { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for ApiErrorsCode { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Ok(Self::from_str(&s).unwrap_or(ApiErrorsCode::Unknown)) + } +} +/// The type of error returned. +/// One of `api_error`, `card_error`, `idempotency_error`, or `invalid_request_error`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum ApiErrorsType { + ApiError, + CardError, + IdempotencyError, + InvalidRequestError, +} +impl ApiErrorsType { + pub fn as_str(self) -> &'static str { + use ApiErrorsType::*; + match self { + ApiError => "api_error", + CardError => "card_error", + IdempotencyError => "idempotency_error", + InvalidRequestError => "invalid_request_error", + } + } +} + +impl std::str::FromStr for ApiErrorsType { + type Err = (); + fn from_str(s: &str) -> Result { + use ApiErrorsType::*; + match s { + "api_error" => Ok(ApiError), + "card_error" => Ok(CardError), + "idempotency_error" => Ok(IdempotencyError), + "invalid_request_error" => Ok(InvalidRequestError), + _ => Err(()), + } + } +} +impl std::fmt::Display for ApiErrorsType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for ApiErrorsType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for ApiErrorsType { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for ApiErrorsType { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for ApiErrorsType")) + } +} diff --git a/generated/stripe_shared/src/api_version.rs b/generated/stripe_shared/src/api_version.rs new file mode 100644 index 000000000..7dfe978ab --- /dev/null +++ b/generated/stripe_shared/src/api_version.rs @@ -0,0 +1,350 @@ +#[derive(Copy, Clone, Eq, PartialEq)] +#[non_exhaustive] +pub enum ApiVersion { + V2011_01_01, + V2011_06_21, + V2011_06_28, + V2011_08_01, + V2011_09_15, + V2011_11_17, + V2012_02_23, + V2012_03_25, + V2012_06_18, + V2012_06_28, + V2012_07_09, + V2012_09_24, + V2012_10_26, + V2012_11_07, + V2013_02_11, + V2013_02_13, + V2013_07_05, + V2013_08_12, + V2013_08_13, + V2013_10_29, + V2013_12_03, + V2014_01_31, + V2014_03_13, + V2014_03_28, + V2014_05_19, + V2014_06_13, + V2014_06_17, + V2014_07_22, + V2014_07_26, + V2014_08_04, + V2014_08_20, + V2014_09_08, + V2014_10_07, + V2014_11_05, + V2014_11_20, + V2014_12_08, + V2014_12_17, + V2014_12_22, + V2015_01_11, + V2015_01_26, + V2015_02_10, + V2015_02_16, + V2015_02_18, + V2015_03_24, + V2015_04_07, + V2015_06_15, + V2015_07_07, + V2015_07_13, + V2015_07_28, + V2015_08_07, + V2015_08_19, + V2015_09_03, + V2015_09_08, + V2015_09_23, + V2015_10_01, + V2015_10_12, + V2015_10_16, + V2016_02_03, + V2016_02_19, + V2016_02_22, + V2016_02_23, + V2016_02_29, + V2016_03_07, + V2016_06_15, + V2016_07_06, + V2016_10_19, + V2017_01_27, + V2017_02_14, + V2017_04_06, + V2017_05_25, + V2017_06_05, + V2017_08_15, + V2017_12_14, + V2018_01_23, + V2018_02_05, + V2018_02_06, + V2018_02_28, + V2018_05_21, + V2018_07_27, + V2018_08_23, + V2018_09_06, + V2018_09_24, + V2018_10_31, + V2018_11_08, + V2019_02_11, + V2019_02_19, + V2019_03_14, + V2019_05_16, + V2019_08_14, + V2019_09_09, + V2019_10_08, + V2019_10_17, + V2019_11_05, + V2019_12_03, + V2020_03_02, + V2020_08_27, + V2022_08_01, + V2022_11_15, + V2023_08_16, + V2023_10_16, + /// An unrecognized value from Stripe. Should not be used as a request parameter. + Unknown, +} +impl ApiVersion { + pub fn as_str(self) -> &'static str { + use ApiVersion::*; + match self { + V2011_01_01 => "2011-01-01", + V2011_06_21 => "2011-06-21", + V2011_06_28 => "2011-06-28", + V2011_08_01 => "2011-08-01", + V2011_09_15 => "2011-09-15", + V2011_11_17 => "2011-11-17", + V2012_02_23 => "2012-02-23", + V2012_03_25 => "2012-03-25", + V2012_06_18 => "2012-06-18", + V2012_06_28 => "2012-06-28", + V2012_07_09 => "2012-07-09", + V2012_09_24 => "2012-09-24", + V2012_10_26 => "2012-10-26", + V2012_11_07 => "2012-11-07", + V2013_02_11 => "2013-02-11", + V2013_02_13 => "2013-02-13", + V2013_07_05 => "2013-07-05", + V2013_08_12 => "2013-08-12", + V2013_08_13 => "2013-08-13", + V2013_10_29 => "2013-10-29", + V2013_12_03 => "2013-12-03", + V2014_01_31 => "2014-01-31", + V2014_03_13 => "2014-03-13", + V2014_03_28 => "2014-03-28", + V2014_05_19 => "2014-05-19", + V2014_06_13 => "2014-06-13", + V2014_06_17 => "2014-06-17", + V2014_07_22 => "2014-07-22", + V2014_07_26 => "2014-07-26", + V2014_08_04 => "2014-08-04", + V2014_08_20 => "2014-08-20", + V2014_09_08 => "2014-09-08", + V2014_10_07 => "2014-10-07", + V2014_11_05 => "2014-11-05", + V2014_11_20 => "2014-11-20", + V2014_12_08 => "2014-12-08", + V2014_12_17 => "2014-12-17", + V2014_12_22 => "2014-12-22", + V2015_01_11 => "2015-01-11", + V2015_01_26 => "2015-01-26", + V2015_02_10 => "2015-02-10", + V2015_02_16 => "2015-02-16", + V2015_02_18 => "2015-02-18", + V2015_03_24 => "2015-03-24", + V2015_04_07 => "2015-04-07", + V2015_06_15 => "2015-06-15", + V2015_07_07 => "2015-07-07", + V2015_07_13 => "2015-07-13", + V2015_07_28 => "2015-07-28", + V2015_08_07 => "2015-08-07", + V2015_08_19 => "2015-08-19", + V2015_09_03 => "2015-09-03", + V2015_09_08 => "2015-09-08", + V2015_09_23 => "2015-09-23", + V2015_10_01 => "2015-10-01", + V2015_10_12 => "2015-10-12", + V2015_10_16 => "2015-10-16", + V2016_02_03 => "2016-02-03", + V2016_02_19 => "2016-02-19", + V2016_02_22 => "2016-02-22", + V2016_02_23 => "2016-02-23", + V2016_02_29 => "2016-02-29", + V2016_03_07 => "2016-03-07", + V2016_06_15 => "2016-06-15", + V2016_07_06 => "2016-07-06", + V2016_10_19 => "2016-10-19", + V2017_01_27 => "2017-01-27", + V2017_02_14 => "2017-02-14", + V2017_04_06 => "2017-04-06", + V2017_05_25 => "2017-05-25", + V2017_06_05 => "2017-06-05", + V2017_08_15 => "2017-08-15", + V2017_12_14 => "2017-12-14", + V2018_01_23 => "2018-01-23", + V2018_02_05 => "2018-02-05", + V2018_02_06 => "2018-02-06", + V2018_02_28 => "2018-02-28", + V2018_05_21 => "2018-05-21", + V2018_07_27 => "2018-07-27", + V2018_08_23 => "2018-08-23", + V2018_09_06 => "2018-09-06", + V2018_09_24 => "2018-09-24", + V2018_10_31 => "2018-10-31", + V2018_11_08 => "2018-11-08", + V2019_02_11 => "2019-02-11", + V2019_02_19 => "2019-02-19", + V2019_03_14 => "2019-03-14", + V2019_05_16 => "2019-05-16", + V2019_08_14 => "2019-08-14", + V2019_09_09 => "2019-09-09", + V2019_10_08 => "2019-10-08", + V2019_10_17 => "2019-10-17", + V2019_11_05 => "2019-11-05", + V2019_12_03 => "2019-12-03", + V2020_03_02 => "2020-03-02", + V2020_08_27 => "2020-08-27", + V2022_08_01 => "2022-08-01", + V2022_11_15 => "2022-11-15", + V2023_08_16 => "2023-08-16", + V2023_10_16 => "2023-10-16", + Unknown => "unknown", + } + } +} + +impl std::str::FromStr for ApiVersion { + type Err = (); + fn from_str(s: &str) -> Result { + use ApiVersion::*; + match s { + "2011-01-01" => Ok(V2011_01_01), + "2011-06-21" => Ok(V2011_06_21), + "2011-06-28" => Ok(V2011_06_28), + "2011-08-01" => Ok(V2011_08_01), + "2011-09-15" => Ok(V2011_09_15), + "2011-11-17" => Ok(V2011_11_17), + "2012-02-23" => Ok(V2012_02_23), + "2012-03-25" => Ok(V2012_03_25), + "2012-06-18" => Ok(V2012_06_18), + "2012-06-28" => Ok(V2012_06_28), + "2012-07-09" => Ok(V2012_07_09), + "2012-09-24" => Ok(V2012_09_24), + "2012-10-26" => Ok(V2012_10_26), + "2012-11-07" => Ok(V2012_11_07), + "2013-02-11" => Ok(V2013_02_11), + "2013-02-13" => Ok(V2013_02_13), + "2013-07-05" => Ok(V2013_07_05), + "2013-08-12" => Ok(V2013_08_12), + "2013-08-13" => Ok(V2013_08_13), + "2013-10-29" => Ok(V2013_10_29), + "2013-12-03" => Ok(V2013_12_03), + "2014-01-31" => Ok(V2014_01_31), + "2014-03-13" => Ok(V2014_03_13), + "2014-03-28" => Ok(V2014_03_28), + "2014-05-19" => Ok(V2014_05_19), + "2014-06-13" => Ok(V2014_06_13), + "2014-06-17" => Ok(V2014_06_17), + "2014-07-22" => Ok(V2014_07_22), + "2014-07-26" => Ok(V2014_07_26), + "2014-08-04" => Ok(V2014_08_04), + "2014-08-20" => Ok(V2014_08_20), + "2014-09-08" => Ok(V2014_09_08), + "2014-10-07" => Ok(V2014_10_07), + "2014-11-05" => Ok(V2014_11_05), + "2014-11-20" => Ok(V2014_11_20), + "2014-12-08" => Ok(V2014_12_08), + "2014-12-17" => Ok(V2014_12_17), + "2014-12-22" => Ok(V2014_12_22), + "2015-01-11" => Ok(V2015_01_11), + "2015-01-26" => Ok(V2015_01_26), + "2015-02-10" => Ok(V2015_02_10), + "2015-02-16" => Ok(V2015_02_16), + "2015-02-18" => Ok(V2015_02_18), + "2015-03-24" => Ok(V2015_03_24), + "2015-04-07" => Ok(V2015_04_07), + "2015-06-15" => Ok(V2015_06_15), + "2015-07-07" => Ok(V2015_07_07), + "2015-07-13" => Ok(V2015_07_13), + "2015-07-28" => Ok(V2015_07_28), + "2015-08-07" => Ok(V2015_08_07), + "2015-08-19" => Ok(V2015_08_19), + "2015-09-03" => Ok(V2015_09_03), + "2015-09-08" => Ok(V2015_09_08), + "2015-09-23" => Ok(V2015_09_23), + "2015-10-01" => Ok(V2015_10_01), + "2015-10-12" => Ok(V2015_10_12), + "2015-10-16" => Ok(V2015_10_16), + "2016-02-03" => Ok(V2016_02_03), + "2016-02-19" => Ok(V2016_02_19), + "2016-02-22" => Ok(V2016_02_22), + "2016-02-23" => Ok(V2016_02_23), + "2016-02-29" => Ok(V2016_02_29), + "2016-03-07" => Ok(V2016_03_07), + "2016-06-15" => Ok(V2016_06_15), + "2016-07-06" => Ok(V2016_07_06), + "2016-10-19" => Ok(V2016_10_19), + "2017-01-27" => Ok(V2017_01_27), + "2017-02-14" => Ok(V2017_02_14), + "2017-04-06" => Ok(V2017_04_06), + "2017-05-25" => Ok(V2017_05_25), + "2017-06-05" => Ok(V2017_06_05), + "2017-08-15" => Ok(V2017_08_15), + "2017-12-14" => Ok(V2017_12_14), + "2018-01-23" => Ok(V2018_01_23), + "2018-02-05" => Ok(V2018_02_05), + "2018-02-06" => Ok(V2018_02_06), + "2018-02-28" => Ok(V2018_02_28), + "2018-05-21" => Ok(V2018_05_21), + "2018-07-27" => Ok(V2018_07_27), + "2018-08-23" => Ok(V2018_08_23), + "2018-09-06" => Ok(V2018_09_06), + "2018-09-24" => Ok(V2018_09_24), + "2018-10-31" => Ok(V2018_10_31), + "2018-11-08" => Ok(V2018_11_08), + "2019-02-11" => Ok(V2019_02_11), + "2019-02-19" => Ok(V2019_02_19), + "2019-03-14" => Ok(V2019_03_14), + "2019-05-16" => Ok(V2019_05_16), + "2019-08-14" => Ok(V2019_08_14), + "2019-09-09" => Ok(V2019_09_09), + "2019-10-08" => Ok(V2019_10_08), + "2019-10-17" => Ok(V2019_10_17), + "2019-11-05" => Ok(V2019_11_05), + "2019-12-03" => Ok(V2019_12_03), + "2020-03-02" => Ok(V2020_03_02), + "2020-08-27" => Ok(V2020_08_27), + "2022-08-01" => Ok(V2022_08_01), + "2022-11-15" => Ok(V2022_11_15), + "2023-08-16" => Ok(V2023_08_16), + "2023-10-16" => Ok(V2023_10_16), + _ => Err(()), + } + } +} +impl std::fmt::Display for ApiVersion { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for ApiVersion { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for ApiVersion { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for ApiVersion { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Ok(Self::from_str(&s).unwrap_or(ApiVersion::Unknown)) + } +} diff --git a/generated/stripe_shared/src/application.rs b/generated/stripe_shared/src/application.rs new file mode 100644 index 000000000..4f671ae0e --- /dev/null +++ b/generated/stripe_shared/src/application.rs @@ -0,0 +1,14 @@ +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct Application { + /// Unique identifier for the object. + pub id: stripe_shared::ApplicationId, + /// The name of the application. + pub name: Option, +} +impl stripe_types::Object for Application { + type Id = stripe_shared::ApplicationId; + fn id(&self) -> &Self::Id { + &self.id + } +} +stripe_types::def_id!(ApplicationId, "ca_"); diff --git a/generated/stripe_shared/src/application_fee.rs b/generated/stripe_shared/src/application_fee.rs new file mode 100644 index 000000000..ebc801ef6 --- /dev/null +++ b/generated/stripe_shared/src/application_fee.rs @@ -0,0 +1,39 @@ +/// For more details see <>. +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct ApplicationFee { + /// ID of the Stripe account this fee was taken from. + pub account: stripe_types::Expandable, + /// Amount earned, in cents (or local equivalent). + pub amount: i64, + /// Amount in cents (or local equivalent) refunded (can be less than the amount attribute on the fee if a partial refund was issued). + pub amount_refunded: i64, + /// ID of the Connect application that earned the fee. + pub application: stripe_types::Expandable, + /// Balance transaction that describes the impact of this collected application fee on your account balance (not including refunds). + pub balance_transaction: Option>, + /// ID of the charge that the application fee was taken from. + pub charge: stripe_types::Expandable, + /// Time at which the object was created. Measured in seconds since the Unix epoch. + pub created: stripe_types::Timestamp, + /// Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. + /// Must be a [supported currency](https://stripe.com/docs/currencies). + pub currency: stripe_types::Currency, + /// Unique identifier for the object. + pub id: stripe_shared::ApplicationFeeId, + /// Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + pub livemode: bool, + /// ID of the corresponding charge on the platform account, if this fee was the result of a charge using the `destination` parameter. + pub originating_transaction: Option>, + /// Whether the fee has been fully refunded. + /// If the fee is only partially refunded, this attribute will still be false. + pub refunded: bool, + /// A list of refunds that have been applied to the fee. + pub refunds: stripe_types::List, +} +impl stripe_types::Object for ApplicationFee { + type Id = stripe_shared::ApplicationFeeId; + fn id(&self) -> &Self::Id { + &self.id + } +} +stripe_types::def_id!(ApplicationFeeId, "fee_"); diff --git a/generated/stripe_shared/src/application_fee_refund.rs b/generated/stripe_shared/src/application_fee_refund.rs new file mode 100644 index 000000000..d89e4260e --- /dev/null +++ b/generated/stripe_shared/src/application_fee_refund.rs @@ -0,0 +1,33 @@ +/// `Application Fee Refund` objects allow you to refund an application fee that +/// has previously been created but not yet refunded. Funds will be refunded to +/// the Stripe account from which the fee was originally collected. +/// +/// Related guide: [Refunding application fees](https://stripe.com/docs/connect/destination-charges#refunding-app-fee). +/// +/// For more details see <>. +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct ApplicationFeeRefund { + /// Amount, in cents (or local equivalent). + pub amount: i64, + /// Balance transaction that describes the impact on your account balance. + pub balance_transaction: Option>, + /// Time at which the object was created. Measured in seconds since the Unix epoch. + pub created: stripe_types::Timestamp, + /// Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. + /// Must be a [supported currency](https://stripe.com/docs/currencies). + pub currency: stripe_types::Currency, + /// ID of the application fee that was refunded. + pub fee: stripe_types::Expandable, + /// Unique identifier for the object. + pub id: stripe_shared::ApplicationFeeRefundId, + /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. + /// This can be useful for storing additional information about the object in a structured format. + pub metadata: Option>, +} +impl stripe_types::Object for ApplicationFeeRefund { + type Id = stripe_shared::ApplicationFeeRefundId; + fn id(&self) -> &Self::Id { + &self.id + } +} +stripe_types::def_id!(ApplicationFeeRefundId, "fr_"); diff --git a/generated/stripe_shared/src/automatic_tax.rs b/generated/stripe_shared/src/automatic_tax.rs new file mode 100644 index 000000000..8afb53aba --- /dev/null +++ b/generated/stripe_shared/src/automatic_tax.rs @@ -0,0 +1,69 @@ +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct AutomaticTax { + /// Whether Stripe automatically computes tax on this invoice. + /// Note that incompatible invoice items (invoice items with manually specified [tax rates](https://stripe.com/docs/api/tax_rates), negative amounts, or `tax_behavior=unspecified`) cannot be added to automatic tax invoices. + pub enabled: bool, + /// The account that's liable for tax. + /// If set, the business address and tax registrations required to perform the tax calculation are loaded from this account. + /// The tax transaction is returned in the report of the connected account. + pub liability: Option, + /// The status of the most recent automated tax calculation for this invoice. + pub status: Option, +} +/// The status of the most recent automated tax calculation for this invoice. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum AutomaticTaxStatus { + Complete, + Failed, + RequiresLocationInputs, +} +impl AutomaticTaxStatus { + pub fn as_str(self) -> &'static str { + use AutomaticTaxStatus::*; + match self { + Complete => "complete", + Failed => "failed", + RequiresLocationInputs => "requires_location_inputs", + } + } +} + +impl std::str::FromStr for AutomaticTaxStatus { + type Err = (); + fn from_str(s: &str) -> Result { + use AutomaticTaxStatus::*; + match s { + "complete" => Ok(Complete), + "failed" => Ok(Failed), + "requires_location_inputs" => Ok(RequiresLocationInputs), + _ => Err(()), + } + } +} +impl std::fmt::Display for AutomaticTaxStatus { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for AutomaticTaxStatus { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for AutomaticTaxStatus { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for AutomaticTaxStatus { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s) + .map_err(|_| serde::de::Error::custom("Unknown value for AutomaticTaxStatus")) + } +} diff --git a/generated/stripe_shared/src/balance_transaction.rs b/generated/stripe_shared/src/balance_transaction.rs new file mode 100644 index 000000000..ad8b77726 --- /dev/null +++ b/generated/stripe_shared/src/balance_transaction.rs @@ -0,0 +1,228 @@ +/// Balance transactions represent funds moving through your Stripe account. +/// Stripe creates them for every type of transaction that enters or leaves your Stripe account balance. +/// +/// Related guide: [Balance transaction types](https://stripe.com/docs/reports/balance-transaction-types). +/// +/// For more details see <>. +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct BalanceTransaction { + /// Gross amount of this transaction (in cents (or local equivalent)). + /// A positive value represents funds charged to another party, and a negative value represents funds sent to another party. + pub amount: i64, + /// The date that the transaction's net funds become available in the Stripe balance. + pub available_on: stripe_types::Timestamp, + /// Time at which the object was created. Measured in seconds since the Unix epoch. + pub created: stripe_types::Timestamp, + /// Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. + /// Must be a [supported currency](https://stripe.com/docs/currencies). + pub currency: stripe_types::Currency, + /// An arbitrary string attached to the object. Often useful for displaying to users. + pub description: Option, + /// If applicable, this transaction uses an exchange rate. + /// If money converts from currency A to currency B, then the `amount` in currency A, multipled by the `exchange_rate`, equals the `amount` in currency B. + /// For example, if you charge a customer 10.00 EUR, the PaymentIntent's `amount` is `1000` and `currency` is `eur`. + /// If this converts to 12.34 USD in your Stripe account, the BalanceTransaction's `amount` is `1234`, its `currency` is `usd`, and the `exchange_rate` is `1.234`. + pub exchange_rate: Option, + /// Fees (in cents (or local equivalent)) paid for this transaction. + /// Represented as a positive integer when assessed. + pub fee: i64, + /// Detailed breakdown of fees (in cents (or local equivalent)) paid for this transaction. + pub fee_details: Vec, + /// Unique identifier for the object. + pub id: stripe_shared::BalanceTransactionId, + /// Net impact to a Stripe balance (in cents (or local equivalent)). + /// A positive value represents incrementing a Stripe balance, and a negative value decrementing a Stripe balance. + /// You can calculate the net impact of a transaction on a balance by `amount` - `fee`. + pub net: i64, + /// Learn more about how [reporting categories](https://stripe.com/docs/reports/reporting-categories) can help you understand balance transactions from an accounting perspective. + pub reporting_category: String, + /// This transaction relates to the Stripe object. + pub source: Option>, + /// The transaction's net funds status in the Stripe balance, which are either `available` or `pending`. + pub status: String, + /// Transaction type: `adjustment`, `advance`, `advance_funding`, `anticipation_repayment`, `application_fee`, `application_fee_refund`, `charge`, `climate_order_purchase`, `climate_order_refund`, `connect_collection_transfer`, `contribution`, `issuing_authorization_hold`, `issuing_authorization_release`, `issuing_dispute`, `issuing_transaction`, `obligation_outbound`, `obligation_reversal_inbound`, `payment`, `payment_failure_refund`, `payment_network_reserve_hold`, `payment_network_reserve_release`, `payment_refund`, `payment_reversal`, `payment_unreconciled`, `payout`, `payout_cancel`, `payout_failure`, `refund`, `refund_failure`, `reserve_transaction`, `reserved_funds`, `stripe_fee`, `stripe_fx_fee`, `tax_fee`, `topup`, `topup_reversal`, `transfer`, `transfer_cancel`, `transfer_failure`, or `transfer_refund`. + /// Learn more about [balance transaction types and what they represent](https://stripe.com/docs/reports/balance-transaction-types). + /// To classify transactions for accounting purposes, consider `reporting_category` instead. + #[serde(rename = "type")] + pub type_: BalanceTransactionType, +} +/// Transaction type: `adjustment`, `advance`, `advance_funding`, `anticipation_repayment`, `application_fee`, `application_fee_refund`, `charge`, `climate_order_purchase`, `climate_order_refund`, `connect_collection_transfer`, `contribution`, `issuing_authorization_hold`, `issuing_authorization_release`, `issuing_dispute`, `issuing_transaction`, `obligation_outbound`, `obligation_reversal_inbound`, `payment`, `payment_failure_refund`, `payment_network_reserve_hold`, `payment_network_reserve_release`, `payment_refund`, `payment_reversal`, `payment_unreconciled`, `payout`, `payout_cancel`, `payout_failure`, `refund`, `refund_failure`, `reserve_transaction`, `reserved_funds`, `stripe_fee`, `stripe_fx_fee`, `tax_fee`, `topup`, `topup_reversal`, `transfer`, `transfer_cancel`, `transfer_failure`, or `transfer_refund`. +/// Learn more about [balance transaction types and what they represent](https://stripe.com/docs/reports/balance-transaction-types). +/// To classify transactions for accounting purposes, consider `reporting_category` instead. +#[derive(Copy, Clone, Eq, PartialEq)] +#[non_exhaustive] +pub enum BalanceTransactionType { + Adjustment, + Advance, + AdvanceFunding, + AnticipationRepayment, + ApplicationFee, + ApplicationFeeRefund, + Charge, + ClimateOrderPurchase, + ClimateOrderRefund, + ConnectCollectionTransfer, + Contribution, + IssuingAuthorizationHold, + IssuingAuthorizationRelease, + IssuingDispute, + IssuingTransaction, + ObligationOutbound, + ObligationReversalInbound, + Payment, + PaymentFailureRefund, + PaymentNetworkReserveHold, + PaymentNetworkReserveRelease, + PaymentRefund, + PaymentReversal, + PaymentUnreconciled, + Payout, + PayoutCancel, + PayoutFailure, + Refund, + RefundFailure, + ReserveTransaction, + ReservedFunds, + StripeFee, + StripeFxFee, + TaxFee, + Topup, + TopupReversal, + Transfer, + TransferCancel, + TransferFailure, + TransferRefund, + /// An unrecognized value from Stripe. Should not be used as a request parameter. + Unknown, +} +impl BalanceTransactionType { + pub fn as_str(self) -> &'static str { + use BalanceTransactionType::*; + match self { + Adjustment => "adjustment", + Advance => "advance", + AdvanceFunding => "advance_funding", + AnticipationRepayment => "anticipation_repayment", + ApplicationFee => "application_fee", + ApplicationFeeRefund => "application_fee_refund", + Charge => "charge", + ClimateOrderPurchase => "climate_order_purchase", + ClimateOrderRefund => "climate_order_refund", + ConnectCollectionTransfer => "connect_collection_transfer", + Contribution => "contribution", + IssuingAuthorizationHold => "issuing_authorization_hold", + IssuingAuthorizationRelease => "issuing_authorization_release", + IssuingDispute => "issuing_dispute", + IssuingTransaction => "issuing_transaction", + ObligationOutbound => "obligation_outbound", + ObligationReversalInbound => "obligation_reversal_inbound", + Payment => "payment", + PaymentFailureRefund => "payment_failure_refund", + PaymentNetworkReserveHold => "payment_network_reserve_hold", + PaymentNetworkReserveRelease => "payment_network_reserve_release", + PaymentRefund => "payment_refund", + PaymentReversal => "payment_reversal", + PaymentUnreconciled => "payment_unreconciled", + Payout => "payout", + PayoutCancel => "payout_cancel", + PayoutFailure => "payout_failure", + Refund => "refund", + RefundFailure => "refund_failure", + ReserveTransaction => "reserve_transaction", + ReservedFunds => "reserved_funds", + StripeFee => "stripe_fee", + StripeFxFee => "stripe_fx_fee", + TaxFee => "tax_fee", + Topup => "topup", + TopupReversal => "topup_reversal", + Transfer => "transfer", + TransferCancel => "transfer_cancel", + TransferFailure => "transfer_failure", + TransferRefund => "transfer_refund", + Unknown => "unknown", + } + } +} + +impl std::str::FromStr for BalanceTransactionType { + type Err = (); + fn from_str(s: &str) -> Result { + use BalanceTransactionType::*; + match s { + "adjustment" => Ok(Adjustment), + "advance" => Ok(Advance), + "advance_funding" => Ok(AdvanceFunding), + "anticipation_repayment" => Ok(AnticipationRepayment), + "application_fee" => Ok(ApplicationFee), + "application_fee_refund" => Ok(ApplicationFeeRefund), + "charge" => Ok(Charge), + "climate_order_purchase" => Ok(ClimateOrderPurchase), + "climate_order_refund" => Ok(ClimateOrderRefund), + "connect_collection_transfer" => Ok(ConnectCollectionTransfer), + "contribution" => Ok(Contribution), + "issuing_authorization_hold" => Ok(IssuingAuthorizationHold), + "issuing_authorization_release" => Ok(IssuingAuthorizationRelease), + "issuing_dispute" => Ok(IssuingDispute), + "issuing_transaction" => Ok(IssuingTransaction), + "obligation_outbound" => Ok(ObligationOutbound), + "obligation_reversal_inbound" => Ok(ObligationReversalInbound), + "payment" => Ok(Payment), + "payment_failure_refund" => Ok(PaymentFailureRefund), + "payment_network_reserve_hold" => Ok(PaymentNetworkReserveHold), + "payment_network_reserve_release" => Ok(PaymentNetworkReserveRelease), + "payment_refund" => Ok(PaymentRefund), + "payment_reversal" => Ok(PaymentReversal), + "payment_unreconciled" => Ok(PaymentUnreconciled), + "payout" => Ok(Payout), + "payout_cancel" => Ok(PayoutCancel), + "payout_failure" => Ok(PayoutFailure), + "refund" => Ok(Refund), + "refund_failure" => Ok(RefundFailure), + "reserve_transaction" => Ok(ReserveTransaction), + "reserved_funds" => Ok(ReservedFunds), + "stripe_fee" => Ok(StripeFee), + "stripe_fx_fee" => Ok(StripeFxFee), + "tax_fee" => Ok(TaxFee), + "topup" => Ok(Topup), + "topup_reversal" => Ok(TopupReversal), + "transfer" => Ok(Transfer), + "transfer_cancel" => Ok(TransferCancel), + "transfer_failure" => Ok(TransferFailure), + "transfer_refund" => Ok(TransferRefund), + _ => Err(()), + } + } +} +impl std::fmt::Display for BalanceTransactionType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for BalanceTransactionType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for BalanceTransactionType { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for BalanceTransactionType { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Ok(Self::from_str(&s).unwrap_or(BalanceTransactionType::Unknown)) + } +} +impl stripe_types::Object for BalanceTransaction { + type Id = stripe_shared::BalanceTransactionId; + fn id(&self) -> &Self::Id { + &self.id + } +} +stripe_types::def_id!(BalanceTransactionId, "txn_"); diff --git a/generated/stripe_shared/src/balance_transaction_source.rs b/generated/stripe_shared/src/balance_transaction_source.rs new file mode 100644 index 000000000..5ca060b07 --- /dev/null +++ b/generated/stripe_shared/src/balance_transaction_source.rs @@ -0,0 +1,63 @@ +/// The resource representing a Stripe Polymorphic +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +#[serde(tag = "object")] +pub enum BalanceTransactionSource { + #[serde(rename = "application_fee")] + ApplicationFee(stripe_shared::ApplicationFee), + #[serde(rename = "charge")] + Charge(stripe_shared::Charge), + #[serde(rename = "connect_collection_transfer")] + ConnectCollectionTransfer(stripe_shared::ConnectCollectionTransfer), + #[serde(rename = "customer_cash_balance_transaction")] + CustomerCashBalanceTransaction(stripe_shared::CustomerCashBalanceTransaction), + #[serde(rename = "dispute")] + Dispute(stripe_shared::Dispute), + #[serde(rename = "fee_refund")] + ApplicationFeeRefund(stripe_shared::ApplicationFeeRefund), + #[serde(rename = "issuing.authorization")] + IssuingAuthorization(stripe_shared::IssuingAuthorization), + #[serde(rename = "issuing.dispute")] + IssuingDispute(stripe_shared::IssuingDispute), + #[serde(rename = "issuing.transaction")] + IssuingTransaction(stripe_shared::IssuingTransaction), + #[serde(rename = "payout")] + Payout(stripe_shared::Payout), + #[serde(rename = "platform_tax_fee")] + PlatformTaxFee(stripe_shared::PlatformTaxFee), + #[serde(rename = "refund")] + Refund(stripe_shared::Refund), + #[serde(rename = "reserve_transaction")] + ReserveTransaction(stripe_shared::ReserveTransaction), + #[serde(rename = "tax_deducted_at_source")] + TaxDeductedAtSource(stripe_shared::TaxDeductedAtSource), + #[serde(rename = "topup")] + Topup(stripe_shared::Topup), + #[serde(rename = "transfer")] + Transfer(stripe_shared::Transfer), + #[serde(rename = "transfer_reversal")] + TransferReversal(stripe_shared::TransferReversal), +} +impl stripe_types::Object for BalanceTransactionSource { + type Id = smol_str::SmolStr; + fn id(&self) -> &Self::Id { + match self { + Self::ApplicationFee(v) => v.id.inner(), + Self::Charge(v) => v.id.inner(), + Self::ConnectCollectionTransfer(v) => v.id.inner(), + Self::CustomerCashBalanceTransaction(v) => v.id.inner(), + Self::Dispute(v) => v.id.inner(), + Self::ApplicationFeeRefund(v) => v.id.inner(), + Self::IssuingAuthorization(v) => v.id.inner(), + Self::IssuingDispute(v) => v.id.inner(), + Self::IssuingTransaction(v) => v.id.inner(), + Self::Payout(v) => v.id.inner(), + Self::PlatformTaxFee(v) => v.id.inner(), + Self::Refund(v) => v.id.inner(), + Self::ReserveTransaction(v) => v.id.inner(), + Self::TaxDeductedAtSource(v) => v.id.inner(), + Self::Topup(v) => v.id.inner(), + Self::Transfer(v) => v.id.inner(), + Self::TransferReversal(v) => v.id.inner(), + } + } +} diff --git a/generated/stripe_shared/src/bank_account.rs b/generated/stripe_shared/src/bank_account.rs new file mode 100644 index 000000000..8aacedb5a --- /dev/null +++ b/generated/stripe_shared/src/bank_account.rs @@ -0,0 +1,133 @@ +/// These bank accounts are payment methods on `Customer` objects. +/// +/// On the other hand [External Accounts](https://stripe.com/docs/api#external_accounts) are transfer +/// destinations on `Account` objects for [Custom accounts](https://stripe.com/docs/connect/custom-accounts). +/// They can be bank accounts or debit cards as well, and are documented in the links above. +/// +/// Related guide: [Bank debits and transfers](https://stripe.com/docs/payments/bank-debits-transfers) +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct BankAccount { + /// The ID of the account that the bank account is associated with. + #[serde(skip_serializing_if = "Option::is_none")] + pub account: Option>, + /// The name of the person or business that owns the bank account. + pub account_holder_name: Option, + /// The type of entity that holds the account. This can be either `individual` or `company`. + pub account_holder_type: Option, + /// The bank account type. + /// This can only be `checking` or `savings` in most countries. + /// In Japan, this can only be `futsu` or `toza`. + pub account_type: Option, + /// A set of available payout methods for this bank account. + /// Only values from this set should be passed as the `method` when creating a payout. + #[serde(skip_serializing_if = "Option::is_none")] + pub available_payout_methods: Option>, + /// Name of the bank associated with the routing number (e.g., `WELLS FARGO`). + pub bank_name: Option, + /// Two-letter ISO code representing the country the bank account is located in. + pub country: String, + /// Three-letter [ISO code for the currency](https://stripe.com/docs/payouts) paid out to the bank account. + pub currency: stripe_types::Currency, + /// The ID of the customer that the bank account is associated with. + #[serde(skip_serializing_if = "Option::is_none")] + pub customer: Option>, + /// Whether this bank account is the default external account for its currency. + #[serde(skip_serializing_if = "Option::is_none")] + pub default_for_currency: Option, + /// Uniquely identifies this particular bank account. + /// You can use this attribute to check whether two bank accounts are the same. + pub fingerprint: Option, + /// Information about the [upcoming new requirements for the bank account](https://stripe.com/docs/connect/custom-accounts/future-requirements), including what information needs to be collected, and by when. + #[serde(skip_serializing_if = "Option::is_none")] + pub future_requirements: Option, + /// Unique identifier for the object. + pub id: stripe_shared::BankAccountId, + /// The last four digits of the bank account number. + pub last4: String, + /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. + /// This can be useful for storing additional information about the object in a structured format. + #[serde(skip_serializing_if = "Option::is_none")] + pub metadata: Option>, + /// Information about the requirements for the bank account, including what information needs to be collected. + #[serde(skip_serializing_if = "Option::is_none")] + pub requirements: Option, + /// The routing transit number for the bank account. + pub routing_number: Option, + /// For bank accounts, possible values are `new`, `validated`, `verified`, `verification_failed`, or `errored`. + /// A bank account that hasn't had any activity or validation performed is `new`. + /// If Stripe can determine that the bank account exists, its status will be `validated`. + /// Note that there often isn’t enough information to know (e.g., for smaller credit unions), and the validation is not always run. + /// If customer bank account verification has succeeded, the bank account status will be `verified`. + /// If the verification failed for any reason, such as microdeposit failure, the status will be `verification_failed`. + /// If a payout sent to this bank account fails, we'll set the status to `errored` and will not continue to send [scheduled payouts](https://stripe.com/docs/payouts#payout-schedule) until the bank details are updated. + /// + /// For external accounts, possible values are `new`, `errored` and `verification_failed`. + /// If a payouts fails, the status is set to `errored` and scheduled payouts are stopped until account details are updated. + /// In India, if we can't [verify the owner of the bank account](https://support.stripe.com/questions/bank-account-ownership-verification), we'll set the status to `verification_failed`. + /// Other validations aren't run against external accounts because they're only used for payouts. + /// This means the other statuses don't apply. + pub status: String, +} +/// A set of available payout methods for this bank account. +/// Only values from this set should be passed as the `method` when creating a payout. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum BankAccountAvailablePayoutMethods { + Instant, + Standard, +} +impl BankAccountAvailablePayoutMethods { + pub fn as_str(self) -> &'static str { + use BankAccountAvailablePayoutMethods::*; + match self { + Instant => "instant", + Standard => "standard", + } + } +} + +impl std::str::FromStr for BankAccountAvailablePayoutMethods { + type Err = (); + fn from_str(s: &str) -> Result { + use BankAccountAvailablePayoutMethods::*; + match s { + "instant" => Ok(Instant), + "standard" => Ok(Standard), + _ => Err(()), + } + } +} +impl std::fmt::Display for BankAccountAvailablePayoutMethods { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for BankAccountAvailablePayoutMethods { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for BankAccountAvailablePayoutMethods { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for BankAccountAvailablePayoutMethods { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| { + serde::de::Error::custom("Unknown value for BankAccountAvailablePayoutMethods") + }) + } +} +impl stripe_types::Object for BankAccount { + type Id = stripe_shared::BankAccountId; + fn id(&self) -> &Self::Id { + &self.id + } +} +stripe_types::def_id!(BankAccountId, "ba_" | "card_"); diff --git a/generated/stripe_shared/src/billing_details.rs b/generated/stripe_shared/src/billing_details.rs new file mode 100644 index 000000000..39da030a3 --- /dev/null +++ b/generated/stripe_shared/src/billing_details.rs @@ -0,0 +1,11 @@ +#[derive(Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct BillingDetails { + /// Billing address. + pub address: Option, + /// Email address. + pub email: Option, + /// Full name. + pub name: Option, + /// Billing phone number (including extension). + pub phone: Option, +} diff --git a/generated/stripe_shared/src/cancellation_details.rs b/generated/stripe_shared/src/cancellation_details.rs new file mode 100644 index 000000000..977140f99 --- /dev/null +++ b/generated/stripe_shared/src/cancellation_details.rs @@ -0,0 +1,138 @@ +#[derive(Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct CancellationDetails { + /// Additional comments about why the user canceled the subscription, if the subscription was canceled explicitly by the user. + pub comment: Option, + /// The customer submitted reason for why they canceled, if the subscription was canceled explicitly by the user. + pub feedback: Option, + /// Why this subscription was canceled. + pub reason: Option, +} +/// The customer submitted reason for why they canceled, if the subscription was canceled explicitly by the user. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CancellationDetailsFeedback { + CustomerService, + LowQuality, + MissingFeatures, + Other, + SwitchedService, + TooComplex, + TooExpensive, + Unused, +} +impl CancellationDetailsFeedback { + pub fn as_str(self) -> &'static str { + use CancellationDetailsFeedback::*; + match self { + CustomerService => "customer_service", + LowQuality => "low_quality", + MissingFeatures => "missing_features", + Other => "other", + SwitchedService => "switched_service", + TooComplex => "too_complex", + TooExpensive => "too_expensive", + Unused => "unused", + } + } +} + +impl std::str::FromStr for CancellationDetailsFeedback { + type Err = (); + fn from_str(s: &str) -> Result { + use CancellationDetailsFeedback::*; + match s { + "customer_service" => Ok(CustomerService), + "low_quality" => Ok(LowQuality), + "missing_features" => Ok(MissingFeatures), + "other" => Ok(Other), + "switched_service" => Ok(SwitchedService), + "too_complex" => Ok(TooComplex), + "too_expensive" => Ok(TooExpensive), + "unused" => Ok(Unused), + _ => Err(()), + } + } +} +impl std::fmt::Display for CancellationDetailsFeedback { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CancellationDetailsFeedback { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CancellationDetailsFeedback { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for CancellationDetailsFeedback { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s) + .map_err(|_| serde::de::Error::custom("Unknown value for CancellationDetailsFeedback")) + } +} +/// Why this subscription was canceled. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CancellationDetailsReason { + CancellationRequested, + PaymentDisputed, + PaymentFailed, +} +impl CancellationDetailsReason { + pub fn as_str(self) -> &'static str { + use CancellationDetailsReason::*; + match self { + CancellationRequested => "cancellation_requested", + PaymentDisputed => "payment_disputed", + PaymentFailed => "payment_failed", + } + } +} + +impl std::str::FromStr for CancellationDetailsReason { + type Err = (); + fn from_str(s: &str) -> Result { + use CancellationDetailsReason::*; + match s { + "cancellation_requested" => Ok(CancellationRequested), + "payment_disputed" => Ok(PaymentDisputed), + "payment_failed" => Ok(PaymentFailed), + _ => Err(()), + } + } +} +impl std::fmt::Display for CancellationDetailsReason { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CancellationDetailsReason { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CancellationDetailsReason { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for CancellationDetailsReason { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s) + .map_err(|_| serde::de::Error::custom("Unknown value for CancellationDetailsReason")) + } +} diff --git a/generated/stripe_shared/src/capability.rs b/generated/stripe_shared/src/capability.rs new file mode 100644 index 000000000..4876b8912 --- /dev/null +++ b/generated/stripe_shared/src/capability.rs @@ -0,0 +1,92 @@ +/// This is an object representing a capability for a Stripe account. +/// +/// Related guide: [Account capabilities](https://stripe.com/docs/connect/account-capabilities) +/// +/// For more details see <>. +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct Capability { + /// The account for which the capability enables functionality. + pub account: stripe_types::Expandable, + #[serde(skip_serializing_if = "Option::is_none")] + pub future_requirements: Option, + /// The identifier for the capability. + pub id: stripe_shared::CapabilityId, + /// Whether the capability has been requested. + pub requested: bool, + /// Time at which the capability was requested. Measured in seconds since the Unix epoch. + pub requested_at: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub requirements: Option, + /// The status of the capability. Can be `active`, `inactive`, `pending`, or `unrequested`. + pub status: CapabilityStatus, +} +/// The status of the capability. Can be `active`, `inactive`, `pending`, or `unrequested`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CapabilityStatus { + Active, + Disabled, + Inactive, + Pending, + Unrequested, +} +impl CapabilityStatus { + pub fn as_str(self) -> &'static str { + use CapabilityStatus::*; + match self { + Active => "active", + Disabled => "disabled", + Inactive => "inactive", + Pending => "pending", + Unrequested => "unrequested", + } + } +} + +impl std::str::FromStr for CapabilityStatus { + type Err = (); + fn from_str(s: &str) -> Result { + use CapabilityStatus::*; + match s { + "active" => Ok(Active), + "disabled" => Ok(Disabled), + "inactive" => Ok(Inactive), + "pending" => Ok(Pending), + "unrequested" => Ok(Unrequested), + _ => Err(()), + } + } +} +impl std::fmt::Display for CapabilityStatus { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CapabilityStatus { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CapabilityStatus { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for CapabilityStatus { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s) + .map_err(|_| serde::de::Error::custom("Unknown value for CapabilityStatus")) + } +} +impl stripe_types::Object for Capability { + type Id = stripe_shared::CapabilityId; + fn id(&self) -> &Self::Id { + &self.id + } +} +stripe_types::def_id!(CapabilityId); diff --git a/src/resources/generated/card.rs b/generated/stripe_shared/src/card.rs similarity index 64% rename from src/resources/generated/card.rs rename to generated/stripe_shared/src/card.rs index 458001f38..1200b690d 100644 --- a/src/resources/generated/card.rs +++ b/generated/stripe_shared/src/card.rs @@ -1,216 +1,162 @@ -// ====================================== -// This file was automatically generated. -// ====================================== - -use serde::{Deserialize, Serialize}; - -use crate::ids::CardId; -use crate::params::{Expandable, Metadata, Object}; -use crate::resources::{Account, Currency, Customer}; - -/// The resource representing a Stripe "Card". +/// You can store multiple cards on a customer in order to charge the customer +/// later. You can also store multiple debit cards on a recipient in order to +/// transfer to those cards later. /// -/// For more details see -#[derive(Clone, Debug, Default, Deserialize, Serialize)] +/// Related guide: [Card payments with Sources](https://stripe.com/docs/sources/cards) +/// +/// For more details see <>. +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] pub struct Card { - /// Unique identifier for the object. - pub id: CardId, - /// The account this card belongs to. - /// /// This attribute will not be in the card object if the card belongs to a customer or recipient instead. #[serde(skip_serializing_if = "Option::is_none")] - pub account: Option>, - + pub account: Option>, /// City/District/Suburb/Town/Village. - #[serde(skip_serializing_if = "Option::is_none")] pub address_city: Option, - /// Billing address country, if provided when creating card. - #[serde(skip_serializing_if = "Option::is_none")] pub address_country: Option, - /// Address line 1 (Street address/PO Box/Company name). - #[serde(skip_serializing_if = "Option::is_none")] pub address_line1: Option, - /// If `address_line1` was provided, results of the check: `pass`, `fail`, `unavailable`, or `unchecked`. - #[serde(skip_serializing_if = "Option::is_none")] pub address_line1_check: Option, - /// Address line 2 (Apartment/Suite/Unit/Building). - #[serde(skip_serializing_if = "Option::is_none")] pub address_line2: Option, - /// State/County/Province/Region. - #[serde(skip_serializing_if = "Option::is_none")] pub address_state: Option, - /// ZIP or postal code. - #[serde(skip_serializing_if = "Option::is_none")] pub address_zip: Option, - /// If `address_zip` was provided, results of the check: `pass`, `fail`, `unavailable`, or `unchecked`. - #[serde(skip_serializing_if = "Option::is_none")] pub address_zip_check: Option, - /// A set of available payout methods for this card. - /// /// Only values from this set should be passed as the `method` when creating a payout. #[serde(skip_serializing_if = "Option::is_none")] pub available_payout_methods: Option>, - /// Card brand. - /// /// Can be `American Express`, `Diners Club`, `Discover`, `Eftpos Australia`, `JCB`, `MasterCard`, `UnionPay`, `Visa`, or `Unknown`. - #[serde(skip_serializing_if = "Option::is_none")] - pub brand: Option, - + pub brand: String, /// Two-letter ISO code representing the country of the card. - /// /// You could use this attribute to get a sense of the international breakdown of cards you've collected. - #[serde(skip_serializing_if = "Option::is_none")] pub country: Option, - /// Three-letter [ISO code for currency](https://stripe.com/docs/payouts). - /// /// Only applicable on accounts (not customers or recipients). /// The card can be used as a transfer destination for funds in this currency. #[serde(skip_serializing_if = "Option::is_none")] - pub currency: Option, - + pub currency: Option, /// The customer that this card belongs to. - /// /// This attribute will not be in the card object if the card belongs to an account or recipient instead. #[serde(skip_serializing_if = "Option::is_none")] - pub customer: Option>, - + pub customer: Option>, /// If a CVC was provided, results of the check: `pass`, `fail`, `unavailable`, or `unchecked`. - /// /// A result of unchecked indicates that CVC was provided but hasn't been checked yet. /// Checks are typically performed when attaching a card to a Customer object, or when creating a charge. /// For more details, see [Check if a card is valid without a charge](https://support.stripe.com/questions/check-if-a-card-is-valid-without-a-charge). - #[serde(skip_serializing_if = "Option::is_none")] pub cvc_check: Option, - /// Whether this card is the default external account for its currency. #[serde(skip_serializing_if = "Option::is_none")] pub default_for_currency: Option, - - // Always true for a deleted object - #[serde(default)] - pub deleted: bool, - /// A high-level description of the type of cards issued in this range. - /// /// (For internal use only and not typically available in standard API requests.). #[serde(skip_serializing_if = "Option::is_none")] pub description: Option, - /// (For tokenized numbers only.) The last four digits of the device account number. - #[serde(skip_serializing_if = "Option::is_none")] pub dynamic_last4: Option, - /// Two-digit number representing the card's expiration month. - #[serde(skip_serializing_if = "Option::is_none")] - pub exp_month: Option, - + pub exp_month: i64, /// Four-digit number representing the card's expiration year. - #[serde(skip_serializing_if = "Option::is_none")] - pub exp_year: Option, - + pub exp_year: i64, /// Uniquely identifies this particular card number. - /// /// You can use this attribute to check whether two customers who’ve signed up with you are using the same card number, for example. - /// For payment methods that tokenize card information (Apple Pay, Google Pay), the tokenized number might be provided instead of the underlying card number. *As of May 1, 2021, card fingerprint in India for Connect changed to allow two fingerprints for the same card---one for India and one for the rest of the world.*. - #[serde(skip_serializing_if = "Option::is_none")] - pub fingerprint: Option, - - /// Card funding type. + /// For payment methods that tokenize card information (Apple Pay, Google Pay), the tokenized number might be provided instead of the underlying card number. /// - /// Can be `credit`, `debit`, `prepaid`, or `unknown`. + /// *As of May 1, 2021, card fingerprint in India for Connect changed to allow two fingerprints for the same card---one for India and one for the rest of the world.*. #[serde(skip_serializing_if = "Option::is_none")] - pub funding: Option, - + pub fingerprint: Option, + /// Card funding type. Can be `credit`, `debit`, `prepaid`, or `unknown`. + pub funding: String, + /// Unique identifier for the object. + pub id: stripe_shared::CardId, /// Issuer identification number of the card. - /// /// (For internal use only and not typically available in standard API requests.). #[serde(skip_serializing_if = "Option::is_none")] pub iin: Option, - /// The name of the card's issuing bank. - /// /// (For internal use only and not typically available in standard API requests.). #[serde(skip_serializing_if = "Option::is_none")] pub issuer: Option, - /// The last four digits of the card. - #[serde(skip_serializing_if = "Option::is_none")] - pub last4: Option, - + pub last4: String, /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. - /// /// This can be useful for storing additional information about the object in a structured format. - #[serde(skip_serializing_if = "Option::is_none")] - pub metadata: Option, - + pub metadata: Option>, /// Cardholder name. - #[serde(skip_serializing_if = "Option::is_none")] pub name: Option, - /// For external accounts that are cards, possible values are `new` and `errored`. - /// /// If a payout fails, the status is set to `errored` and [scheduled payouts](https://stripe.com/docs/payouts#payout-schedule) are stopped until account details are updated. #[serde(skip_serializing_if = "Option::is_none")] pub status: Option, - /// If the card number is tokenized, this is the method that was used. - /// /// Can be `android_pay` (includes Google Pay), `apple_pay`, `masterpass`, `visa_checkout`, or null. - #[serde(skip_serializing_if = "Option::is_none")] pub tokenization_method: Option, } - -impl Object for Card { - type Id = CardId; - fn id(&self) -> Self::Id { - self.id.clone() - } - fn object(&self) -> &'static str { - "card" - } -} - -/// An enum representing the possible values of an `Card`'s `available_payout_methods` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] +/// A set of available payout methods for this card. +/// Only values from this set should be passed as the `method` when creating a payout. +#[derive(Copy, Clone, Eq, PartialEq)] pub enum CardAvailablePayoutMethods { Instant, Standard, } - impl CardAvailablePayoutMethods { pub fn as_str(self) -> &'static str { + use CardAvailablePayoutMethods::*; match self { - CardAvailablePayoutMethods::Instant => "instant", - CardAvailablePayoutMethods::Standard => "standard", + Instant => "instant", + Standard => "standard", } } } -impl AsRef for CardAvailablePayoutMethods { - fn as_ref(&self) -> &str { - self.as_str() +impl std::str::FromStr for CardAvailablePayoutMethods { + type Err = (); + fn from_str(s: &str) -> Result { + use CardAvailablePayoutMethods::*; + match s { + "instant" => Ok(Instant), + "standard" => Ok(Standard), + _ => Err(()), + } } } - impl std::fmt::Display for CardAvailablePayoutMethods { fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CardAvailablePayoutMethods { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CardAvailablePayoutMethods { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for CardAvailablePayoutMethods { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s) + .map_err(|_| serde::de::Error::custom("Unknown value for CardAvailablePayoutMethods")) } } -impl std::default::Default for CardAvailablePayoutMethods { - fn default() -> Self { - Self::Instant +impl stripe_types::Object for Card { + type Id = stripe_shared::CardId; + fn id(&self) -> &Self::Id { + &self.id } } +stripe_types::def_id!(CardId, "card_"); diff --git a/generated/stripe_shared/src/card_issuing_account_terms_of_service.rs b/generated/stripe_shared/src/card_issuing_account_terms_of_service.rs new file mode 100644 index 000000000..de88385d1 --- /dev/null +++ b/generated/stripe_shared/src/card_issuing_account_terms_of_service.rs @@ -0,0 +1,10 @@ +#[derive(Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct CardIssuingAccountTermsOfService { + /// The Unix timestamp marking when the account representative accepted the service agreement. + pub date: Option, + /// The IP address from which the account representative accepted the service agreement. + pub ip: Option, + /// The user agent of the browser from which the account representative accepted the service agreement. + #[serde(skip_serializing_if = "Option::is_none")] + pub user_agent: Option, +} diff --git a/generated/stripe_shared/src/card_mandate_payment_method_details.rs b/generated/stripe_shared/src/card_mandate_payment_method_details.rs new file mode 100644 index 000000000..715b901ed --- /dev/null +++ b/generated/stripe_shared/src/card_mandate_payment_method_details.rs @@ -0,0 +1,2 @@ +#[derive(Copy, Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct CardMandatePaymentMethodDetails {} diff --git a/generated/stripe_shared/src/cash_balance.rs b/generated/stripe_shared/src/cash_balance.rs new file mode 100644 index 000000000..90d8e489b --- /dev/null +++ b/generated/stripe_shared/src/cash_balance.rs @@ -0,0 +1,17 @@ +/// A customer's `Cash balance` represents real funds. +/// Customers can add funds to their cash balance by sending a bank transfer. +/// These funds can be used for payment and can eventually be paid out to your bank account. +/// +/// For more details see <>. +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct CashBalance { + /// A hash of all cash balances available to this customer. + /// You cannot delete a customer with any cash balances, even if the balance is 0. + /// Amounts are represented in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal). + pub available: Option>, + /// The ID of the customer whose cash balance this object represents. + pub customer: String, + /// Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + pub livemode: bool, + pub settings: stripe_shared::CustomerBalanceCustomerBalanceSettings, +} diff --git a/generated/stripe_shared/src/charge.rs b/generated/stripe_shared/src/charge.rs new file mode 100644 index 000000000..d4bc526f1 --- /dev/null +++ b/generated/stripe_shared/src/charge.rs @@ -0,0 +1,192 @@ +/// The `Charge` object represents a single attempt to move money into your Stripe account. +/// PaymentIntent confirmation is the most common way to create Charges, but transferring +/// money to a different Stripe account through Connect also creates Charges. +/// Some legacy payment flows create Charges directly, which is not recommended for new integrations. +/// +/// For more details see <>. +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct Charge { + /// Amount intended to be collected by this payment. + /// A positive integer representing how much to charge in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal) (e.g., 100 cents to charge $1.00 or 100 to charge ¥100, a zero-decimal currency). + /// The minimum amount is $0.50 US or [equivalent in charge currency](https://stripe.com/docs/currencies#minimum-and-maximum-charge-amounts). + /// The amount value supports up to eight digits (e.g., a value of 99999999 for a USD charge of $999,999.99). + pub amount: i64, + /// Amount in cents (or local equivalent) captured (can be less than the amount attribute on the charge if a partial capture was made). + pub amount_captured: i64, + /// Amount in cents (or local equivalent) refunded (can be less than the amount attribute on the charge if a partial refund was issued). + pub amount_refunded: i64, + /// ID of the Connect application that created the charge. + pub application: Option>, + /// The application fee (if any) for the charge. + /// [See the Connect documentation](https://stripe.com/docs/connect/direct-charges#collecting-fees) for details. + pub application_fee: Option>, + /// The amount of the application fee (if any) requested for the charge. + /// [See the Connect documentation](https://stripe.com/docs/connect/direct-charges#collecting-fees) for details. + pub application_fee_amount: Option, + /// Authorization code on the charge. + #[serde(skip_serializing_if = "Option::is_none")] + pub authorization_code: Option, + /// ID of the balance transaction that describes the impact of this charge on your account balance (not including refunds or disputes). + pub balance_transaction: Option>, + pub billing_details: stripe_shared::BillingDetails, + /// The full statement descriptor that is passed to card networks, and that is displayed on your customers' credit card and bank statements. + /// Allows you to see what the statement descriptor looks like after the static and dynamic portions are combined. + pub calculated_statement_descriptor: Option, + /// If the charge was created without capturing, this Boolean represents whether it is still uncaptured or has since been captured. + pub captured: bool, + /// Time at which the object was created. Measured in seconds since the Unix epoch. + pub created: stripe_types::Timestamp, + /// Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. + /// Must be a [supported currency](https://stripe.com/docs/currencies). + pub currency: stripe_types::Currency, + /// ID of the customer this charge is for if one exists. + pub customer: Option>, + /// An arbitrary string attached to the object. Often useful for displaying to users. + pub description: Option, + /// Whether the charge has been disputed. + pub disputed: bool, + /// ID of the balance transaction that describes the reversal of the balance on your account due to payment failure. + pub failure_balance_transaction: + Option>, + /// Error code explaining reason for charge failure if available (see [the errors section](https://stripe.com/docs/error-codes) for a list of codes). + pub failure_code: Option, + /// Message to user further explaining reason for charge failure if available. + pub failure_message: Option, + /// Information on fraud assessments for the charge. + pub fraud_details: Option, + /// Unique identifier for the object. + pub id: stripe_shared::ChargeId, + /// ID of the invoice this charge is for if one exists. + pub invoice: Option>, + #[serde(skip_serializing_if = "Option::is_none")] + pub level3: Option, + /// Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + pub livemode: bool, + /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. + /// This can be useful for storing additional information about the object in a structured format. + pub metadata: std::collections::HashMap, + /// The account (if any) the charge was made on behalf of without triggering an automatic transfer. + /// See the [Connect documentation](https://stripe.com/docs/connect/separate-charges-and-transfers) for details. + pub on_behalf_of: Option>, + /// Details about whether the payment was accepted, and why. + /// See [understanding declines](https://stripe.com/docs/declines) for details. + pub outcome: Option, + /// `true` if the charge succeeded, or was successfully authorized for later capture. + pub paid: bool, + /// ID of the PaymentIntent associated with this charge, if one exists. + pub payment_intent: Option>, + /// ID of the payment method used in this charge. + pub payment_method: Option, + /// Details about the payment method at the time of the transaction. + pub payment_method_details: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub radar_options: Option, + /// This is the email address that the receipt for this charge was sent to. + pub receipt_email: Option, + /// This is the transaction number that appears on email receipts sent for this charge. + /// This attribute will be `null` until a receipt has been sent. + pub receipt_number: Option, + /// This is the URL to view the receipt for this charge. + /// The receipt is kept up-to-date to the latest state of the charge, including any refunds. + /// If the charge is for an Invoice, the receipt will be stylized as an Invoice receipt. + pub receipt_url: Option, + /// Whether the charge has been fully refunded. + /// If the charge is only partially refunded, this attribute will still be false. + pub refunded: bool, + /// A list of refunds that have been applied to the charge. + pub refunds: Option>, + /// ID of the review associated with this charge if one exists. + pub review: Option>, + /// Shipping information for the charge. + pub shipping: Option, + /// This is a legacy field that will be removed in the future. + /// It contains the Source, Card, or BankAccount object used for the charge. + /// For details about the payment method used for this charge, refer to `payment_method` or `payment_method_details` instead. + pub source: Option, + /// The transfer ID which created this charge. + /// Only present if the charge came from another Stripe account. + /// [See the Connect documentation](https://stripe.com/docs/connect/destination-charges) for details. + pub source_transfer: Option>, + /// For card charges, use `statement_descriptor_suffix` instead. + /// Otherwise, you can use this value as the complete description of a charge on your customers’ statements. + /// Must contain at least one letter, maximum 22 characters. + pub statement_descriptor: Option, + /// Provides information about the charge that customers see on their statements. + /// Concatenated with the prefix (shortened descriptor) or statement descriptor that’s set on the account to form the complete statement descriptor. + /// Maximum 22 characters for the concatenated descriptor. + pub statement_descriptor_suffix: Option, + /// The status of the payment is either `succeeded`, `pending`, or `failed`. + pub status: ChargeStatus, + /// ID of the transfer to the `destination` account (only applicable if the charge was created using the `destination` parameter). + #[serde(skip_serializing_if = "Option::is_none")] + pub transfer: Option>, + /// An optional dictionary including the account to automatically transfer to as part of a destination charge. + /// [See the Connect documentation](https://stripe.com/docs/connect/destination-charges) for details. + pub transfer_data: Option, + /// A string that identifies this transaction as part of a group. + /// See the [Connect documentation](https://stripe.com/docs/connect/separate-charges-and-transfers#transfer-options) for details. + pub transfer_group: Option, +} +/// The status of the payment is either `succeeded`, `pending`, or `failed`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum ChargeStatus { + Failed, + Pending, + Succeeded, +} +impl ChargeStatus { + pub fn as_str(self) -> &'static str { + use ChargeStatus::*; + match self { + Failed => "failed", + Pending => "pending", + Succeeded => "succeeded", + } + } +} + +impl std::str::FromStr for ChargeStatus { + type Err = (); + fn from_str(s: &str) -> Result { + use ChargeStatus::*; + match s { + "failed" => Ok(Failed), + "pending" => Ok(Pending), + "succeeded" => Ok(Succeeded), + _ => Err(()), + } + } +} +impl std::fmt::Display for ChargeStatus { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for ChargeStatus { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for ChargeStatus { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for ChargeStatus { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for ChargeStatus")) + } +} +impl stripe_types::Object for Charge { + type Id = stripe_shared::ChargeId; + fn id(&self) -> &Self::Id { + &self.id + } +} +stripe_types::def_id!(ChargeId, "ch_" | "py_"); diff --git a/generated/stripe_shared/src/charge_fraud_details.rs b/generated/stripe_shared/src/charge_fraud_details.rs new file mode 100644 index 000000000..e1de5731d --- /dev/null +++ b/generated/stripe_shared/src/charge_fraud_details.rs @@ -0,0 +1,9 @@ +#[derive(Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct ChargeFraudDetails { + /// Assessments from Stripe. If set, the value is `fraudulent`. + #[serde(skip_serializing_if = "Option::is_none")] + pub stripe_report: Option, + /// Assessments reported by you. If set, possible values of are `safe` and `fraudulent`. + #[serde(skip_serializing_if = "Option::is_none")] + pub user_report: Option, +} diff --git a/generated/stripe_shared/src/charge_outcome.rs b/generated/stripe_shared/src/charge_outcome.rs new file mode 100644 index 000000000..d5840d096 --- /dev/null +++ b/generated/stripe_shared/src/charge_outcome.rs @@ -0,0 +1,34 @@ +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct ChargeOutcome { + /// Possible values are `approved_by_network`, `declined_by_network`, `not_sent_to_network`, and `reversed_after_approval`. + /// The value `reversed_after_approval` indicates the payment was [blocked by Stripe](https://stripe.com/docs/declines#blocked-payments) after bank authorization, and may temporarily appear as "pending" on a cardholder's statement. + pub network_status: Option, + /// An enumerated value providing a more detailed explanation of the outcome's `type`. + /// Charges blocked by Radar's default block rule have the value `highest_risk_level`. + /// Charges placed in review by Radar's default review rule have the value `elevated_risk_level`. + /// Charges authorized, blocked, or placed in review by custom rules have the value `rule`. + /// See [understanding declines](https://stripe.com/docs/declines) for more details. + pub reason: Option, + /// Stripe Radar's evaluation of the riskiness of the payment. + /// Possible values for evaluated payments are `normal`, `elevated`, `highest`. + /// For non-card payments, and card-based payments predating the public assignment of risk levels, this field will have the value `not_assessed`. + /// In the event of an error in the evaluation, this field will have the value `unknown`. + /// This field is only available with Radar. + #[serde(skip_serializing_if = "Option::is_none")] + pub risk_level: Option, + /// Stripe Radar's evaluation of the riskiness of the payment. + /// Possible values for evaluated payments are between 0 and 100. + /// For non-card payments, card-based payments predating the public assignment of risk scores, or in the event of an error during evaluation, this field will not be present. + /// This field is only available with Radar for Fraud Teams. + #[serde(skip_serializing_if = "Option::is_none")] + pub risk_score: Option, + /// The ID of the Radar rule that matched the payment, if applicable. + #[serde(skip_serializing_if = "Option::is_none")] + pub rule: Option>, + /// A human-readable description of the outcome type and reason, designed for you (the recipient of the payment), not your customer. + pub seller_message: Option, + /// Possible values are `authorized`, `manual_review`, `issuer_declined`, `blocked`, and `invalid`. + /// See [understanding declines](https://stripe.com/docs/declines) and [Radar reviews](https://stripe.com/docs/radar/reviews) for details. + #[serde(rename = "type")] + pub type_: String, +} diff --git a/generated/stripe_shared/src/charge_transfer_data.rs b/generated/stripe_shared/src/charge_transfer_data.rs new file mode 100644 index 000000000..32f702920 --- /dev/null +++ b/generated/stripe_shared/src/charge_transfer_data.rs @@ -0,0 +1,8 @@ +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct ChargeTransferData { + /// The amount transferred to the destination account, if specified. + /// By default, the entire charge amount is transferred to the destination account. + pub amount: Option, + /// ID of an existing, connected Stripe account to transfer funds to if `transfer_data` was specified in the charge request. + pub destination: stripe_types::Expandable, +} diff --git a/generated/stripe_shared/src/checkout_session_item.rs b/generated/stripe_shared/src/checkout_session_item.rs new file mode 100644 index 000000000..164d7965a --- /dev/null +++ b/generated/stripe_shared/src/checkout_session_item.rs @@ -0,0 +1,38 @@ +/// A line item. +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct CheckoutSessionItem { + /// Total discount amount applied. If no discounts were applied, defaults to 0. + pub amount_discount: i64, + /// Total before any discounts or taxes are applied. + pub amount_subtotal: i64, + /// Total tax amount applied. If no tax was applied, defaults to 0. + pub amount_tax: i64, + /// Total after discounts and taxes. + pub amount_total: i64, + /// Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. + /// Must be a [supported currency](https://stripe.com/docs/currencies). + pub currency: stripe_types::Currency, + /// An arbitrary string attached to the object. + /// Often useful for displaying to users. + /// Defaults to product name. + pub description: String, + /// The discounts applied to the line item. + #[serde(skip_serializing_if = "Option::is_none")] + pub discounts: Option>, + /// Unique identifier for the object. + pub id: stripe_shared::CheckoutSessionItemId, + /// The price used to generate the line item. + pub price: Option, + /// The quantity of products being purchased. + pub quantity: Option, + /// The taxes applied to the line item. + #[serde(skip_serializing_if = "Option::is_none")] + pub taxes: Option>, +} +impl stripe_types::Object for CheckoutSessionItem { + type Id = stripe_shared::CheckoutSessionItemId; + fn id(&self) -> &Self::Id { + &self.id + } +} +stripe_types::def_id!(CheckoutSessionItemId, "li_"); diff --git a/generated/stripe_shared/src/connect_account_reference.rs b/generated/stripe_shared/src/connect_account_reference.rs new file mode 100644 index 000000000..672d07b2c --- /dev/null +++ b/generated/stripe_shared/src/connect_account_reference.rs @@ -0,0 +1,63 @@ +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct ConnectAccountReference { + /// The connected account being referenced when `type` is `account`. + #[serde(skip_serializing_if = "Option::is_none")] + pub account: Option>, + /// Type of the account referenced. + #[serde(rename = "type")] + pub type_: ConnectAccountReferenceType, +} +/// Type of the account referenced. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum ConnectAccountReferenceType { + Account, + Self_, +} +impl ConnectAccountReferenceType { + pub fn as_str(self) -> &'static str { + use ConnectAccountReferenceType::*; + match self { + Account => "account", + Self_ => "self", + } + } +} + +impl std::str::FromStr for ConnectAccountReferenceType { + type Err = (); + fn from_str(s: &str) -> Result { + use ConnectAccountReferenceType::*; + match s { + "account" => Ok(Account), + "self" => Ok(Self_), + _ => Err(()), + } + } +} +impl std::fmt::Display for ConnectAccountReferenceType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for ConnectAccountReferenceType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for ConnectAccountReferenceType { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for ConnectAccountReferenceType { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s) + .map_err(|_| serde::de::Error::custom("Unknown value for ConnectAccountReferenceType")) + } +} diff --git a/generated/stripe_shared/src/connect_collection_transfer.rs b/generated/stripe_shared/src/connect_collection_transfer.rs new file mode 100644 index 000000000..9aafd6e1b --- /dev/null +++ b/generated/stripe_shared/src/connect_collection_transfer.rs @@ -0,0 +1,21 @@ +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct ConnectCollectionTransfer { + /// Amount transferred, in cents (or local equivalent). + pub amount: i64, + /// Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. + /// Must be a [supported currency](https://stripe.com/docs/currencies). + pub currency: stripe_types::Currency, + /// ID of the account that funds are being collected for. + pub destination: stripe_types::Expandable, + /// Unique identifier for the object. + pub id: stripe_shared::ConnectCollectionTransferId, + /// Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + pub livemode: bool, +} +impl stripe_types::Object for ConnectCollectionTransfer { + type Id = stripe_shared::ConnectCollectionTransferId; + fn id(&self) -> &Self::Id { + &self.id + } +} +stripe_types::def_id!(ConnectCollectionTransferId, "connct_"); diff --git a/generated/stripe_shared/src/coupon.rs b/generated/stripe_shared/src/coupon.rs new file mode 100644 index 000000000..bde2892a3 --- /dev/null +++ b/generated/stripe_shared/src/coupon.rs @@ -0,0 +1,112 @@ +/// A coupon contains information about a percent-off or amount-off discount you +/// might want to apply to a customer. +/// Coupons may be applied to [subscriptions](https://stripe.com/docs/api#subscriptions), [invoices](https://stripe.com/docs/api#invoices),. +/// [checkout sessions](https://stripe.com/docs/api/checkout/sessions), [quotes](https://stripe.com/docs/api#quotes), and more. +/// Coupons do not work with conventional one-off [charges](https://stripe.com/docs/api#create_charge) or [payment intents](https://stripe.com/docs/api/payment_intents). +/// +/// For more details see <>. +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct Coupon { + /// Amount (in the `currency` specified) that will be taken off the subtotal of any invoices for this customer. + pub amount_off: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub applies_to: Option, + /// Time at which the object was created. Measured in seconds since the Unix epoch. + pub created: stripe_types::Timestamp, + /// If `amount_off` has been set, the three-letter [ISO code for the currency](https://stripe.com/docs/currencies) of the amount to take off. + pub currency: Option, + /// Coupons defined in each available currency option. + /// Each key must be a three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html) and a [supported currency](https://stripe.com/docs/currencies). + #[serde(skip_serializing_if = "Option::is_none")] + pub currency_options: Option< + std::collections::HashMap, + >, + /// One of `forever`, `once`, and `repeating`. + /// Describes how long a customer who applies this coupon will get the discount. + pub duration: stripe_shared::CouponDuration, + /// If `duration` is `repeating`, the number of months the coupon applies. + /// Null if coupon `duration` is `forever` or `once`. + pub duration_in_months: Option, + /// Unique identifier for the object. + pub id: stripe_shared::CouponId, + /// Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + pub livemode: bool, + /// Maximum number of times this coupon can be redeemed, in total, across all customers, before it is no longer valid. + pub max_redemptions: Option, + /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. + /// This can be useful for storing additional information about the object in a structured format. + pub metadata: Option>, + /// Name of the coupon displayed to customers on for instance invoices or receipts. + pub name: Option, + /// Percent that will be taken off the subtotal of any invoices for this customer for the duration of the coupon. + /// For example, a coupon with percent_off of 50 will make a $ (or local equivalent)100 invoice $ (or local equivalent)50 instead. + pub percent_off: Option, + /// Date after which the coupon can no longer be redeemed. + pub redeem_by: Option, + /// Number of times this coupon has been applied to a customer. + pub times_redeemed: i64, + /// Taking account of the above properties, whether this coupon can still be applied to a customer. + pub valid: bool, +} +impl stripe_types::Object for Coupon { + type Id = stripe_shared::CouponId; + fn id(&self) -> &Self::Id { + &self.id + } +} +stripe_types::def_id!(CouponId); +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CouponDuration { + Forever, + Once, + Repeating, +} +impl CouponDuration { + pub fn as_str(self) -> &'static str { + use CouponDuration::*; + match self { + Forever => "forever", + Once => "once", + Repeating => "repeating", + } + } +} + +impl std::str::FromStr for CouponDuration { + type Err = (); + fn from_str(s: &str) -> Result { + use CouponDuration::*; + match s { + "forever" => Ok(Forever), + "once" => Ok(Once), + "repeating" => Ok(Repeating), + _ => Err(()), + } + } +} +impl std::fmt::Display for CouponDuration { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CouponDuration { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CouponDuration { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for CouponDuration { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for CouponDuration")) + } +} diff --git a/generated/stripe_shared/src/coupon_applies_to.rs b/generated/stripe_shared/src/coupon_applies_to.rs new file mode 100644 index 000000000..ca45f409b --- /dev/null +++ b/generated/stripe_shared/src/coupon_applies_to.rs @@ -0,0 +1,5 @@ +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct CouponAppliesTo { + /// A list of product IDs this coupon applies to + pub products: Vec, +} diff --git a/generated/stripe_shared/src/coupon_currency_option.rs b/generated/stripe_shared/src/coupon_currency_option.rs new file mode 100644 index 000000000..4e1881dbc --- /dev/null +++ b/generated/stripe_shared/src/coupon_currency_option.rs @@ -0,0 +1,5 @@ +#[derive(Copy, Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct CouponCurrencyOption { + /// Amount (in the `currency` specified) that will be taken off the subtotal of any invoices for this customer. + pub amount_off: i64, +} diff --git a/generated/stripe_shared/src/credit_note.rs b/generated/stripe_shared/src/credit_note.rs new file mode 100644 index 000000000..a24ccb78f --- /dev/null +++ b/generated/stripe_shared/src/credit_note.rs @@ -0,0 +1,251 @@ +/// Issue a credit note to adjust an invoice's amount after the invoice is finalized. +/// +/// Related guide: [Credit notes](https://stripe.com/docs/billing/invoices/credit-notes) +/// +/// For more details see <>. +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct CreditNote { + /// The integer amount in cents (or local equivalent) representing the total amount of the credit note, including tax. + pub amount: i64, + /// This is the sum of all the shipping amounts. + pub amount_shipping: i64, + /// Time at which the object was created. Measured in seconds since the Unix epoch. + pub created: stripe_types::Timestamp, + /// Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. + /// Must be a [supported currency](https://stripe.com/docs/currencies). + pub currency: stripe_types::Currency, + /// ID of the customer. + pub customer: stripe_types::Expandable, + /// Customer balance transaction related to this credit note. + pub customer_balance_transaction: + Option>, + /// The integer amount in cents (or local equivalent) representing the total amount of discount that was credited. + pub discount_amount: i64, + /// The aggregate amounts calculated per discount for all line items. + pub discount_amounts: Vec, + /// The date when this credit note is in effect. + /// Same as `created` unless overwritten. + /// When defined, this value replaces the system-generated 'Date of issue' printed on the credit note PDF. + pub effective_at: Option, + /// Unique identifier for the object. + pub id: stripe_shared::CreditNoteId, + /// ID of the invoice. + pub invoice: stripe_types::Expandable, + /// Line items that make up the credit note + pub lines: stripe_types::List, + /// Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + pub livemode: bool, + /// Customer-facing text that appears on the credit note PDF. + pub memo: Option, + /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. + /// This can be useful for storing additional information about the object in a structured format. + pub metadata: Option>, + /// A unique number that identifies this particular credit note and appears on the PDF of the credit note and its associated invoice. + pub number: String, + /// Amount that was credited outside of Stripe. + pub out_of_band_amount: Option, + /// The link to download the PDF of the credit note. + pub pdf: String, + /// Reason for issuing this credit note, one of `duplicate`, `fraudulent`, `order_change`, or `product_unsatisfactory`. + pub reason: Option, + /// Refund related to this credit note. + pub refund: Option>, + /// The details of the cost of shipping, including the ShippingRate applied to the invoice. + pub shipping_cost: Option, + /// Status of this credit note, one of `issued` or `void`. + /// Learn more about [voiding credit notes](https://stripe.com/docs/billing/invoices/credit-notes#voiding). + pub status: CreditNoteStatus, + /// The integer amount in cents (or local equivalent) representing the amount of the credit note, excluding exclusive tax and invoice level discounts. + pub subtotal: i64, + /// The integer amount in cents (or local equivalent) representing the amount of the credit note, excluding all tax and invoice level discounts. + pub subtotal_excluding_tax: Option, + /// The aggregate amounts calculated per tax rate for all line items. + pub tax_amounts: Vec, + /// The integer amount in cents (or local equivalent) representing the total amount of the credit note, including tax and all discount. + pub total: i64, + /// The integer amount in cents (or local equivalent) representing the total amount of the credit note, excluding tax, but including discounts. + pub total_excluding_tax: Option, + /// Type of this credit note, one of `pre_payment` or `post_payment`. + /// A `pre_payment` credit note means it was issued when the invoice was open. + /// A `post_payment` credit note means it was issued when the invoice was paid. + #[serde(rename = "type")] + pub type_: CreditNoteType, + /// The time that the credit note was voided. + pub voided_at: Option, +} +/// Status of this credit note, one of `issued` or `void`. +/// Learn more about [voiding credit notes](https://stripe.com/docs/billing/invoices/credit-notes#voiding). +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreditNoteStatus { + Issued, + Void, +} +impl CreditNoteStatus { + pub fn as_str(self) -> &'static str { + use CreditNoteStatus::*; + match self { + Issued => "issued", + Void => "void", + } + } +} + +impl std::str::FromStr for CreditNoteStatus { + type Err = (); + fn from_str(s: &str) -> Result { + use CreditNoteStatus::*; + match s { + "issued" => Ok(Issued), + "void" => Ok(Void), + _ => Err(()), + } + } +} +impl std::fmt::Display for CreditNoteStatus { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreditNoteStatus { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreditNoteStatus { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for CreditNoteStatus { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s) + .map_err(|_| serde::de::Error::custom("Unknown value for CreditNoteStatus")) + } +} +/// Type of this credit note, one of `pre_payment` or `post_payment`. +/// A `pre_payment` credit note means it was issued when the invoice was open. +/// A `post_payment` credit note means it was issued when the invoice was paid. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreditNoteType { + PostPayment, + PrePayment, +} +impl CreditNoteType { + pub fn as_str(self) -> &'static str { + use CreditNoteType::*; + match self { + PostPayment => "post_payment", + PrePayment => "pre_payment", + } + } +} + +impl std::str::FromStr for CreditNoteType { + type Err = (); + fn from_str(s: &str) -> Result { + use CreditNoteType::*; + match s { + "post_payment" => Ok(PostPayment), + "pre_payment" => Ok(PrePayment), + _ => Err(()), + } + } +} +impl std::fmt::Display for CreditNoteType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreditNoteType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreditNoteType { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for CreditNoteType { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for CreditNoteType")) + } +} +impl stripe_types::Object for CreditNote { + type Id = stripe_shared::CreditNoteId; + fn id(&self) -> &Self::Id { + &self.id + } +} +stripe_types::def_id!(CreditNoteId, "cn_"); +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreditNoteReason { + Duplicate, + Fraudulent, + OrderChange, + ProductUnsatisfactory, +} +impl CreditNoteReason { + pub fn as_str(self) -> &'static str { + use CreditNoteReason::*; + match self { + Duplicate => "duplicate", + Fraudulent => "fraudulent", + OrderChange => "order_change", + ProductUnsatisfactory => "product_unsatisfactory", + } + } +} + +impl std::str::FromStr for CreditNoteReason { + type Err = (); + fn from_str(s: &str) -> Result { + use CreditNoteReason::*; + match s { + "duplicate" => Ok(Duplicate), + "fraudulent" => Ok(Fraudulent), + "order_change" => Ok(OrderChange), + "product_unsatisfactory" => Ok(ProductUnsatisfactory), + _ => Err(()), + } + } +} +impl std::fmt::Display for CreditNoteReason { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreditNoteReason { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreditNoteReason { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for CreditNoteReason { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s) + .map_err(|_| serde::de::Error::custom("Unknown value for CreditNoteReason")) + } +} diff --git a/generated/stripe_shared/src/credit_note_line_item.rs b/generated/stripe_shared/src/credit_note_line_item.rs new file mode 100644 index 000000000..b35f9e106 --- /dev/null +++ b/generated/stripe_shared/src/credit_note_line_item.rs @@ -0,0 +1,101 @@ +/// The credit note line item object +/// +/// For more details see <>. +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct CreditNoteLineItem { + /// The integer amount in cents (or local equivalent) representing the gross amount being credited for this line item, excluding (exclusive) tax and discounts. + pub amount: i64, + /// The integer amount in cents (or local equivalent) representing the amount being credited for this line item, excluding all tax and discounts. + pub amount_excluding_tax: Option, + /// Description of the item being credited. + pub description: Option, + /// The integer amount in cents (or local equivalent) representing the discount being credited for this line item. + pub discount_amount: i64, + /// The amount of discount calculated per discount for this line item + pub discount_amounts: Vec, + /// Unique identifier for the object. + pub id: stripe_shared::CreditNoteLineItemId, + /// ID of the invoice line item being credited + #[serde(skip_serializing_if = "Option::is_none")] + pub invoice_line_item: Option, + /// Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + pub livemode: bool, + /// The number of units of product being credited. + pub quantity: Option, + /// The amount of tax calculated per tax rate for this line item + pub tax_amounts: Vec, + /// The tax rates which apply to the line item. + pub tax_rates: Vec, + /// The type of the credit note line item, one of `invoice_line_item` or `custom_line_item`. + /// When the type is `invoice_line_item` there is an additional `invoice_line_item` property on the resource the value of which is the id of the credited line item on the invoice. + #[serde(rename = "type")] + pub type_: CreditNoteLineItemType, + /// The cost of each unit of product being credited. + pub unit_amount: Option, + /// Same as `unit_amount`, but contains a decimal value with at most 12 decimal places. + pub unit_amount_decimal: Option, + /// The amount in cents (or local equivalent) representing the unit amount being credited for this line item, excluding all tax and discounts. + pub unit_amount_excluding_tax: Option, +} +/// The type of the credit note line item, one of `invoice_line_item` or `custom_line_item`. +/// When the type is `invoice_line_item` there is an additional `invoice_line_item` property on the resource the value of which is the id of the credited line item on the invoice. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreditNoteLineItemType { + CustomLineItem, + InvoiceLineItem, +} +impl CreditNoteLineItemType { + pub fn as_str(self) -> &'static str { + use CreditNoteLineItemType::*; + match self { + CustomLineItem => "custom_line_item", + InvoiceLineItem => "invoice_line_item", + } + } +} + +impl std::str::FromStr for CreditNoteLineItemType { + type Err = (); + fn from_str(s: &str) -> Result { + use CreditNoteLineItemType::*; + match s { + "custom_line_item" => Ok(CustomLineItem), + "invoice_line_item" => Ok(InvoiceLineItem), + _ => Err(()), + } + } +} +impl std::fmt::Display for CreditNoteLineItemType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreditNoteLineItemType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreditNoteLineItemType { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for CreditNoteLineItemType { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s) + .map_err(|_| serde::de::Error::custom("Unknown value for CreditNoteLineItemType")) + } +} +impl stripe_types::Object for CreditNoteLineItem { + type Id = stripe_shared::CreditNoteLineItemId; + fn id(&self) -> &Self::Id { + &self.id + } +} +stripe_types::def_id!(CreditNoteLineItemId, "cnli_"); diff --git a/generated/stripe_shared/src/credit_note_tax_amount.rs b/generated/stripe_shared/src/credit_note_tax_amount.rs new file mode 100644 index 000000000..6a78ae397 --- /dev/null +++ b/generated/stripe_shared/src/credit_note_tax_amount.rs @@ -0,0 +1,111 @@ +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct CreditNoteTaxAmount { + /// The amount, in cents (or local equivalent), of the tax. + pub amount: i64, + /// Whether this tax amount is inclusive or exclusive. + pub inclusive: bool, + /// The tax rate that was applied to get this tax amount. + pub tax_rate: stripe_types::Expandable, + /// The reasoning behind this tax, for example, if the product is tax exempt. + /// The possible values for this field may be extended as new tax rules are supported. + pub taxability_reason: Option, + /// The amount on which tax is calculated, in cents (or local equivalent). + pub taxable_amount: Option, +} +/// The reasoning behind this tax, for example, if the product is tax exempt. +/// The possible values for this field may be extended as new tax rules are supported. +#[derive(Copy, Clone, Eq, PartialEq)] +#[non_exhaustive] +pub enum CreditNoteTaxAmountTaxabilityReason { + CustomerExempt, + NotCollecting, + NotSubjectToTax, + NotSupported, + PortionProductExempt, + PortionReducedRated, + PortionStandardRated, + ProductExempt, + ProductExemptHoliday, + ProportionallyRated, + ReducedRated, + ReverseCharge, + StandardRated, + TaxableBasisReduced, + ZeroRated, + /// An unrecognized value from Stripe. Should not be used as a request parameter. + Unknown, +} +impl CreditNoteTaxAmountTaxabilityReason { + pub fn as_str(self) -> &'static str { + use CreditNoteTaxAmountTaxabilityReason::*; + match self { + CustomerExempt => "customer_exempt", + NotCollecting => "not_collecting", + NotSubjectToTax => "not_subject_to_tax", + NotSupported => "not_supported", + PortionProductExempt => "portion_product_exempt", + PortionReducedRated => "portion_reduced_rated", + PortionStandardRated => "portion_standard_rated", + ProductExempt => "product_exempt", + ProductExemptHoliday => "product_exempt_holiday", + ProportionallyRated => "proportionally_rated", + ReducedRated => "reduced_rated", + ReverseCharge => "reverse_charge", + StandardRated => "standard_rated", + TaxableBasisReduced => "taxable_basis_reduced", + ZeroRated => "zero_rated", + Unknown => "unknown", + } + } +} + +impl std::str::FromStr for CreditNoteTaxAmountTaxabilityReason { + type Err = (); + fn from_str(s: &str) -> Result { + use CreditNoteTaxAmountTaxabilityReason::*; + match s { + "customer_exempt" => Ok(CustomerExempt), + "not_collecting" => Ok(NotCollecting), + "not_subject_to_tax" => Ok(NotSubjectToTax), + "not_supported" => Ok(NotSupported), + "portion_product_exempt" => Ok(PortionProductExempt), + "portion_reduced_rated" => Ok(PortionReducedRated), + "portion_standard_rated" => Ok(PortionStandardRated), + "product_exempt" => Ok(ProductExempt), + "product_exempt_holiday" => Ok(ProductExemptHoliday), + "proportionally_rated" => Ok(ProportionallyRated), + "reduced_rated" => Ok(ReducedRated), + "reverse_charge" => Ok(ReverseCharge), + "standard_rated" => Ok(StandardRated), + "taxable_basis_reduced" => Ok(TaxableBasisReduced), + "zero_rated" => Ok(ZeroRated), + _ => Err(()), + } + } +} +impl std::fmt::Display for CreditNoteTaxAmountTaxabilityReason { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreditNoteTaxAmountTaxabilityReason { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreditNoteTaxAmountTaxabilityReason { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for CreditNoteTaxAmountTaxabilityReason { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Ok(Self::from_str(&s).unwrap_or(CreditNoteTaxAmountTaxabilityReason::Unknown)) + } +} diff --git a/generated/stripe_shared/src/currency_option.rs b/generated/stripe_shared/src/currency_option.rs new file mode 100644 index 000000000..cee2cd55b --- /dev/null +++ b/generated/stripe_shared/src/currency_option.rs @@ -0,0 +1,81 @@ +#[derive(Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct CurrencyOption { + /// When set, provides configuration for the amount to be adjusted by the customer during Checkout Sessions and Payment Links. + pub custom_unit_amount: Option, + /// Only required if a [default tax behavior](https://stripe.com/docs/tax/products-prices-tax-categories-tax-behavior#setting-a-default-tax-behavior-(recommended)) was not provided in the Stripe Tax settings. + /// Specifies whether the price is considered inclusive of taxes or exclusive of taxes. + /// One of `inclusive`, `exclusive`, or `unspecified`. + /// Once specified as either `inclusive` or `exclusive`, it cannot be changed. + pub tax_behavior: Option, + /// Each element represents a pricing tier. + /// This parameter requires `billing_scheme` to be set to `tiered`. + /// See also the documentation for `billing_scheme`. + #[serde(skip_serializing_if = "Option::is_none")] + pub tiers: Option>, + /// The unit amount in cents (or local equivalent) to be charged, represented as a whole integer if possible. + /// Only set if `billing_scheme=per_unit`. + pub unit_amount: Option, + /// The unit amount in cents (or local equivalent) to be charged, represented as a decimal string with at most 12 decimal places. + /// Only set if `billing_scheme=per_unit`. + pub unit_amount_decimal: Option, +} +/// Only required if a [default tax behavior](https://stripe.com/docs/tax/products-prices-tax-categories-tax-behavior#setting-a-default-tax-behavior-(recommended)) was not provided in the Stripe Tax settings. +/// Specifies whether the price is considered inclusive of taxes or exclusive of taxes. +/// One of `inclusive`, `exclusive`, or `unspecified`. +/// Once specified as either `inclusive` or `exclusive`, it cannot be changed. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CurrencyOptionTaxBehavior { + Exclusive, + Inclusive, + Unspecified, +} +impl CurrencyOptionTaxBehavior { + pub fn as_str(self) -> &'static str { + use CurrencyOptionTaxBehavior::*; + match self { + Exclusive => "exclusive", + Inclusive => "inclusive", + Unspecified => "unspecified", + } + } +} + +impl std::str::FromStr for CurrencyOptionTaxBehavior { + type Err = (); + fn from_str(s: &str) -> Result { + use CurrencyOptionTaxBehavior::*; + match s { + "exclusive" => Ok(Exclusive), + "inclusive" => Ok(Inclusive), + "unspecified" => Ok(Unspecified), + _ => Err(()), + } + } +} +impl std::fmt::Display for CurrencyOptionTaxBehavior { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CurrencyOptionTaxBehavior { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CurrencyOptionTaxBehavior { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for CurrencyOptionTaxBehavior { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s) + .map_err(|_| serde::de::Error::custom("Unknown value for CurrencyOptionTaxBehavior")) + } +} diff --git a/src/resources/generated/custom_unit_amount.rs b/generated/stripe_shared/src/custom_unit_amount.rs similarity index 57% rename from src/resources/generated/custom_unit_amount.rs rename to generated/stripe_shared/src/custom_unit_amount.rs index d5a85c842..6fd2c00df 100644 --- a/src/resources/generated/custom_unit_amount.rs +++ b/generated/stripe_shared/src/custom_unit_amount.rs @@ -1,20 +1,10 @@ -// ====================================== -// This file was automatically generated. -// ====================================== - -use serde::{Deserialize, Serialize}; - -/// The resource representing a Stripe "CustomUnitAmount". -#[derive(Clone, Debug, Default, Deserialize, Serialize)] +#[derive(Copy, Clone, Debug, Default, serde::Serialize, serde::Deserialize)] pub struct CustomUnitAmount { /// The maximum unit amount the customer can specify for this item. pub maximum: Option, - /// The minimum unit amount the customer can specify for this item. - /// /// Must be at least the minimum charge amount. pub minimum: Option, - /// The starting unit amount which can be updated by the customer. pub preset: Option, } diff --git a/generated/stripe_shared/src/customer.rs b/generated/stripe_shared/src/customer.rs new file mode 100644 index 000000000..df33c84e2 --- /dev/null +++ b/generated/stripe_shared/src/customer.rs @@ -0,0 +1,167 @@ +/// This object represents a customer of your business. +/// Use it to create recurring charges and track payments that belong to the same customer. +/// +/// Related guide: [Save a card during payment](https://stripe.com/docs/payments/save-during-payment) +/// +/// For more details see <>. +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct Customer { + /// The customer's address. + #[serde(skip_serializing_if = "Option::is_none")] + pub address: Option, + /// The current balance, if any, that's stored on the customer. + /// If negative, the customer has credit to apply to their next invoice. + /// If positive, the customer has an amount owed that's added to their next invoice. + /// The balance only considers amounts that Stripe hasn't successfully applied to any invoice. + /// It doesn't reflect unpaid invoices. + /// This balance is only taken into account after invoices finalize. + #[serde(skip_serializing_if = "Option::is_none")] + pub balance: Option, + /// The current funds being held by Stripe on behalf of the customer. + /// You can apply these funds towards payment intents when the source is "cash_balance". + /// The `settings[reconciliation_mode]` field describes if these funds apply to these payment intents manually or automatically. + #[serde(skip_serializing_if = "Option::is_none")] + pub cash_balance: Option, + /// Time at which the object was created. Measured in seconds since the Unix epoch. + pub created: stripe_types::Timestamp, + /// Three-letter [ISO code for the currency](https://stripe.com/docs/currencies) the customer can be charged in for recurring billing purposes. + #[serde(skip_serializing_if = "Option::is_none")] + pub currency: Option, + /// ID of the default payment source for the customer. + /// + /// If you use payment methods created through the PaymentMethods API, see the [invoice_settings.default_payment_method](https://stripe.com/docs/api/customers/object#customer_object-invoice_settings-default_payment_method) field instead. + pub default_source: Option>, + /// Tracks the most recent state change on any invoice belonging to the customer. + /// Paying an invoice or marking it uncollectible via the API will set this field to false. + /// An automatic payment failure or passing the `invoice.due_date` will set this field to `true`. + /// + /// If an invoice becomes uncollectible by [dunning](https://stripe.com/docs/billing/automatic-collection), `delinquent` doesn't reset to `false`. + /// + /// If you care whether the customer has paid their most recent subscription invoice, use `subscription.status` instead. + /// Paying or marking uncollectible any customer invoice regardless of whether it is the latest invoice for a subscription will always set this field to `false`. + #[serde(skip_serializing_if = "Option::is_none")] + pub delinquent: Option, + /// An arbitrary string attached to the object. Often useful for displaying to users. + pub description: Option, + /// Describes the current discount active on the customer, if there is one. + #[serde(skip_serializing_if = "Option::is_none")] + pub discount: Option, + /// The customer's email address. + pub email: Option, + /// Unique identifier for the object. + pub id: stripe_shared::CustomerId, + /// The current multi-currency balances, if any, that's stored on the customer. + /// If positive in a currency, the customer has a credit to apply to their next invoice denominated in that currency. + /// If negative, the customer has an amount owed that's added to their next invoice denominated in that currency. + /// These balances don't apply to unpaid invoices. + /// They solely track amounts that Stripe hasn't successfully applied to any invoice. + /// Stripe only applies a balance in a specific currency to an invoice after that invoice (which is in the same currency) finalizes. + #[serde(skip_serializing_if = "Option::is_none")] + pub invoice_credit_balance: Option>, + /// The prefix for the customer used to generate unique invoice numbers. + #[serde(skip_serializing_if = "Option::is_none")] + pub invoice_prefix: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub invoice_settings: Option, + /// Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + pub livemode: bool, + /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. + /// This can be useful for storing additional information about the object in a structured format. + #[serde(skip_serializing_if = "Option::is_none")] + pub metadata: Option>, + /// The customer's full name or business name. + #[serde(skip_serializing_if = "Option::is_none")] + pub name: Option, + /// The suffix of the customer's next invoice number (for example, 0001). + #[serde(skip_serializing_if = "Option::is_none")] + pub next_invoice_sequence: Option, + /// The customer's phone number. + #[serde(skip_serializing_if = "Option::is_none")] + pub phone: Option, + /// The customer's preferred locales (languages), ordered by preference. + #[serde(skip_serializing_if = "Option::is_none")] + pub preferred_locales: Option>, + /// Mailing and shipping address for the customer. Appears on invoices emailed to this customer. + pub shipping: Option, + /// The customer's payment sources, if any. + #[serde(skip_serializing_if = "Option::is_none")] + pub sources: Option>, + /// The customer's current subscriptions, if any. + #[serde(skip_serializing_if = "Option::is_none")] + pub subscriptions: Option>, + #[serde(skip_serializing_if = "Option::is_none")] + pub tax: Option, + /// Describes the customer's tax exemption status, which is `none`, `exempt`, or `reverse`. + /// When set to `reverse`, invoice and receipt PDFs include the following text: **"Reverse charge"**. + #[serde(skip_serializing_if = "Option::is_none")] + pub tax_exempt: Option, + /// The customer's tax IDs. + #[serde(skip_serializing_if = "Option::is_none")] + pub tax_ids: Option>, + /// ID of the test clock that this customer belongs to. + #[serde(skip_serializing_if = "Option::is_none")] + pub test_clock: Option>, +} +impl stripe_types::Object for Customer { + type Id = stripe_shared::CustomerId; + fn id(&self) -> &Self::Id { + &self.id + } +} +stripe_types::def_id!(CustomerId, "cus_"); +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CustomerTaxExempt { + Exempt, + None, + Reverse, +} +impl CustomerTaxExempt { + pub fn as_str(self) -> &'static str { + use CustomerTaxExempt::*; + match self { + Exempt => "exempt", + None => "none", + Reverse => "reverse", + } + } +} + +impl std::str::FromStr for CustomerTaxExempt { + type Err = (); + fn from_str(s: &str) -> Result { + use CustomerTaxExempt::*; + match s { + "exempt" => Ok(Exempt), + "none" => Ok(None), + "reverse" => Ok(Reverse), + _ => Err(()), + } + } +} +impl std::fmt::Display for CustomerTaxExempt { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CustomerTaxExempt { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CustomerTaxExempt { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for CustomerTaxExempt { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s) + .map_err(|_| serde::de::Error::custom("Unknown value for CustomerTaxExempt")) + } +} diff --git a/generated/stripe_shared/src/customer_acceptance.rs b/generated/stripe_shared/src/customer_acceptance.rs new file mode 100644 index 000000000..237725fe6 --- /dev/null +++ b/generated/stripe_shared/src/customer_acceptance.rs @@ -0,0 +1,66 @@ +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct CustomerAcceptance { + /// The time that the customer accepts the mandate. + pub accepted_at: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub offline: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub online: Option, + /// The mandate includes the type of customer acceptance information, such as: `online` or `offline`. + #[serde(rename = "type")] + pub type_: CustomerAcceptanceType, +} +/// The mandate includes the type of customer acceptance information, such as: `online` or `offline`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CustomerAcceptanceType { + Offline, + Online, +} +impl CustomerAcceptanceType { + pub fn as_str(self) -> &'static str { + use CustomerAcceptanceType::*; + match self { + Offline => "offline", + Online => "online", + } + } +} + +impl std::str::FromStr for CustomerAcceptanceType { + type Err = (); + fn from_str(s: &str) -> Result { + use CustomerAcceptanceType::*; + match s { + "offline" => Ok(Offline), + "online" => Ok(Online), + _ => Err(()), + } + } +} +impl std::fmt::Display for CustomerAcceptanceType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CustomerAcceptanceType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CustomerAcceptanceType { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for CustomerAcceptanceType { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s) + .map_err(|_| serde::de::Error::custom("Unknown value for CustomerAcceptanceType")) + } +} diff --git a/generated/stripe_shared/src/customer_balance_customer_balance_settings.rs b/generated/stripe_shared/src/customer_balance_customer_balance_settings.rs new file mode 100644 index 000000000..c8cbe74d6 --- /dev/null +++ b/generated/stripe_shared/src/customer_balance_customer_balance_settings.rs @@ -0,0 +1,64 @@ +#[derive(Copy, Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct CustomerBalanceCustomerBalanceSettings { + /// The configuration for how funds that land in the customer cash balance are reconciled. + pub reconciliation_mode: CustomerBalanceCustomerBalanceSettingsReconciliationMode, + /// A flag to indicate if reconciliation mode returned is the user's default or is specific to this customer cash balance. + pub using_merchant_default: bool, +} +/// The configuration for how funds that land in the customer cash balance are reconciled. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CustomerBalanceCustomerBalanceSettingsReconciliationMode { + Automatic, + Manual, +} +impl CustomerBalanceCustomerBalanceSettingsReconciliationMode { + pub fn as_str(self) -> &'static str { + use CustomerBalanceCustomerBalanceSettingsReconciliationMode::*; + match self { + Automatic => "automatic", + Manual => "manual", + } + } +} + +impl std::str::FromStr for CustomerBalanceCustomerBalanceSettingsReconciliationMode { + type Err = (); + fn from_str(s: &str) -> Result { + use CustomerBalanceCustomerBalanceSettingsReconciliationMode::*; + match s { + "automatic" => Ok(Automatic), + "manual" => Ok(Manual), + _ => Err(()), + } + } +} +impl std::fmt::Display for CustomerBalanceCustomerBalanceSettingsReconciliationMode { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CustomerBalanceCustomerBalanceSettingsReconciliationMode { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CustomerBalanceCustomerBalanceSettingsReconciliationMode { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for CustomerBalanceCustomerBalanceSettingsReconciliationMode { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| { + serde::de::Error::custom( + "Unknown value for CustomerBalanceCustomerBalanceSettingsReconciliationMode", + ) + }) + } +} diff --git a/generated/stripe_shared/src/customer_balance_resource_cash_balance_transaction_resource_adjusted_for_overdraft.rs b/generated/stripe_shared/src/customer_balance_resource_cash_balance_transaction_resource_adjusted_for_overdraft.rs new file mode 100644 index 000000000..5cda40951 --- /dev/null +++ b/generated/stripe_shared/src/customer_balance_resource_cash_balance_transaction_resource_adjusted_for_overdraft.rs @@ -0,0 +1,7 @@ +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct CustomerBalanceResourceCashBalanceTransactionResourceAdjustedForOverdraft { + /// The [Balance Transaction](https://stripe.com/docs/api/balance_transactions/object) that corresponds to funds taken out of your Stripe balance. + pub balance_transaction: stripe_types::Expandable, + /// The [Cash Balance Transaction](https://stripe.com/docs/api/cash_balance_transactions/object) that brought the customer balance negative, triggering the clawback of funds. + pub linked_transaction: stripe_types::Expandable, +} diff --git a/generated/stripe_shared/src/customer_balance_resource_cash_balance_transaction_resource_applied_to_payment_transaction.rs b/generated/stripe_shared/src/customer_balance_resource_cash_balance_transaction_resource_applied_to_payment_transaction.rs new file mode 100644 index 000000000..9f055d1c4 --- /dev/null +++ b/generated/stripe_shared/src/customer_balance_resource_cash_balance_transaction_resource_applied_to_payment_transaction.rs @@ -0,0 +1,5 @@ +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct CustomerBalanceResourceCashBalanceTransactionResourceAppliedToPaymentTransaction { + /// The [Payment Intent](https://stripe.com/docs/api/payment_intents/object) that funds were applied to. + pub payment_intent: stripe_types::Expandable, +} diff --git a/generated/stripe_shared/src/customer_balance_resource_cash_balance_transaction_resource_funded_transaction.rs b/generated/stripe_shared/src/customer_balance_resource_cash_balance_transaction_resource_funded_transaction.rs new file mode 100644 index 000000000..99460779b --- /dev/null +++ b/generated/stripe_shared/src/customer_balance_resource_cash_balance_transaction_resource_funded_transaction.rs @@ -0,0 +1,5 @@ +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct CustomerBalanceResourceCashBalanceTransactionResourceFundedTransaction { +pub bank_transfer: stripe_shared::CustomerBalanceResourceCashBalanceTransactionResourceFundedTransactionResourceBankTransfer, + +} diff --git a/generated/stripe_shared/src/customer_balance_resource_cash_balance_transaction_resource_funded_transaction_resource_bank_transfer.rs b/generated/stripe_shared/src/customer_balance_resource_cash_balance_transaction_resource_funded_transaction_resource_bank_transfer.rs new file mode 100644 index 000000000..75c20a452 --- /dev/null +++ b/generated/stripe_shared/src/customer_balance_resource_cash_balance_transaction_resource_funded_transaction_resource_bank_transfer.rs @@ -0,0 +1,82 @@ +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct CustomerBalanceResourceCashBalanceTransactionResourceFundedTransactionResourceBankTransfer { +#[serde(skip_serializing_if = "Option::is_none")] +pub eu_bank_transfer: Option, +#[serde(skip_serializing_if = "Option::is_none")] +pub gb_bank_transfer: Option, +#[serde(skip_serializing_if = "Option::is_none")] +pub jp_bank_transfer: Option, + /// The user-supplied reference field on the bank transfer. +pub reference: Option, + /// The funding method type used to fund the customer balance. + /// Permitted values include: `eu_bank_transfer`, `gb_bank_transfer`, `jp_bank_transfer`, `mx_bank_transfer`, or `us_bank_transfer`. +#[serde(rename = "type")] +pub type_: CustomerBalanceResourceCashBalanceTransactionResourceFundedTransactionResourceBankTransferType, +#[serde(skip_serializing_if = "Option::is_none")] +pub us_bank_transfer: Option, + +} +/// The funding method type used to fund the customer balance. +/// Permitted values include: `eu_bank_transfer`, `gb_bank_transfer`, `jp_bank_transfer`, `mx_bank_transfer`, or `us_bank_transfer`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CustomerBalanceResourceCashBalanceTransactionResourceFundedTransactionResourceBankTransferType +{ + EuBankTransfer, + GbBankTransfer, + JpBankTransfer, + MxBankTransfer, + UsBankTransfer, +} +impl + CustomerBalanceResourceCashBalanceTransactionResourceFundedTransactionResourceBankTransferType +{ + pub fn as_str(self) -> &'static str { + use CustomerBalanceResourceCashBalanceTransactionResourceFundedTransactionResourceBankTransferType::*; + match self { + EuBankTransfer => "eu_bank_transfer", + GbBankTransfer => "gb_bank_transfer", + JpBankTransfer => "jp_bank_transfer", + MxBankTransfer => "mx_bank_transfer", + UsBankTransfer => "us_bank_transfer", + } + } +} + +impl std::str::FromStr for CustomerBalanceResourceCashBalanceTransactionResourceFundedTransactionResourceBankTransferType { + type Err = (); + fn from_str(s: &str) -> Result { + use CustomerBalanceResourceCashBalanceTransactionResourceFundedTransactionResourceBankTransferType::*; + match s { + "eu_bank_transfer" => Ok(EuBankTransfer), +"gb_bank_transfer" => Ok(GbBankTransfer), +"jp_bank_transfer" => Ok(JpBankTransfer), +"mx_bank_transfer" => Ok(MxBankTransfer), +"us_bank_transfer" => Ok(UsBankTransfer), +_ => Err(()) + + } + } +} +impl std::fmt::Display for CustomerBalanceResourceCashBalanceTransactionResourceFundedTransactionResourceBankTransferType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CustomerBalanceResourceCashBalanceTransactionResourceFundedTransactionResourceBankTransferType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CustomerBalanceResourceCashBalanceTransactionResourceFundedTransactionResourceBankTransferType { + fn serialize(&self, serializer: S) -> Result where S: serde::Serializer { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for CustomerBalanceResourceCashBalanceTransactionResourceFundedTransactionResourceBankTransferType { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for CustomerBalanceResourceCashBalanceTransactionResourceFundedTransactionResourceBankTransferType")) + } +} diff --git a/generated/stripe_shared/src/customer_balance_resource_cash_balance_transaction_resource_funded_transaction_resource_bank_transfer_resource_eu_bank_transfer.rs b/generated/stripe_shared/src/customer_balance_resource_cash_balance_transaction_resource_funded_transaction_resource_bank_transfer_resource_eu_bank_transfer.rs new file mode 100644 index 000000000..47a2dd437 --- /dev/null +++ b/generated/stripe_shared/src/customer_balance_resource_cash_balance_transaction_resource_funded_transaction_resource_bank_transfer_resource_eu_bank_transfer.rs @@ -0,0 +1,10 @@ +#[derive(Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct CustomerBalanceResourceCashBalanceTransactionResourceFundedTransactionResourceBankTransferResourceEuBankTransfer +{ + /// The BIC of the bank of the sender of the funding. + pub bic: Option, + /// The last 4 digits of the IBAN of the sender of the funding. + pub iban_last4: Option, + /// The full name of the sender, as supplied by the sending bank. + pub sender_name: Option, +} diff --git a/generated/stripe_shared/src/customer_balance_resource_cash_balance_transaction_resource_funded_transaction_resource_bank_transfer_resource_gb_bank_transfer.rs b/generated/stripe_shared/src/customer_balance_resource_cash_balance_transaction_resource_funded_transaction_resource_bank_transfer_resource_gb_bank_transfer.rs new file mode 100644 index 000000000..8ecb631c8 --- /dev/null +++ b/generated/stripe_shared/src/customer_balance_resource_cash_balance_transaction_resource_funded_transaction_resource_bank_transfer_resource_gb_bank_transfer.rs @@ -0,0 +1,10 @@ +#[derive(Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct CustomerBalanceResourceCashBalanceTransactionResourceFundedTransactionResourceBankTransferResourceGbBankTransfer +{ + /// The last 4 digits of the account number of the sender of the funding. + pub account_number_last4: Option, + /// The full name of the sender, as supplied by the sending bank. + pub sender_name: Option, + /// The sort code of the bank of the sender of the funding + pub sort_code: Option, +} diff --git a/generated/stripe_shared/src/customer_balance_resource_cash_balance_transaction_resource_funded_transaction_resource_bank_transfer_resource_jp_bank_transfer.rs b/generated/stripe_shared/src/customer_balance_resource_cash_balance_transaction_resource_funded_transaction_resource_bank_transfer_resource_jp_bank_transfer.rs new file mode 100644 index 000000000..694874cb8 --- /dev/null +++ b/generated/stripe_shared/src/customer_balance_resource_cash_balance_transaction_resource_funded_transaction_resource_bank_transfer_resource_jp_bank_transfer.rs @@ -0,0 +1,10 @@ +#[derive(Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct CustomerBalanceResourceCashBalanceTransactionResourceFundedTransactionResourceBankTransferResourceJpBankTransfer +{ + /// The name of the bank of the sender of the funding. + pub sender_bank: Option, + /// The name of the bank branch of the sender of the funding. + pub sender_branch: Option, + /// The full name of the sender, as supplied by the sending bank. + pub sender_name: Option, +} diff --git a/generated/stripe_shared/src/customer_balance_resource_cash_balance_transaction_resource_funded_transaction_resource_bank_transfer_resource_us_bank_transfer.rs b/generated/stripe_shared/src/customer_balance_resource_cash_balance_transaction_resource_funded_transaction_resource_bank_transfer_resource_us_bank_transfer.rs new file mode 100644 index 000000000..f675d01a1 --- /dev/null +++ b/generated/stripe_shared/src/customer_balance_resource_cash_balance_transaction_resource_funded_transaction_resource_bank_transfer_resource_us_bank_transfer.rs @@ -0,0 +1,65 @@ +#[derive(Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct CustomerBalanceResourceCashBalanceTransactionResourceFundedTransactionResourceBankTransferResourceUsBankTransfer { + /// The banking network used for this funding. +#[serde(skip_serializing_if = "Option::is_none")] +pub network: Option, + /// The full name of the sender, as supplied by the sending bank. +pub sender_name: Option, + +} +/// The banking network used for this funding. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CustomerBalanceResourceCashBalanceTransactionResourceFundedTransactionResourceBankTransferResourceUsBankTransferNetwork +{ + Ach, + DomesticWireUs, + Swift, +} +impl CustomerBalanceResourceCashBalanceTransactionResourceFundedTransactionResourceBankTransferResourceUsBankTransferNetwork { + pub fn as_str(self) -> &'static str { + use CustomerBalanceResourceCashBalanceTransactionResourceFundedTransactionResourceBankTransferResourceUsBankTransferNetwork::*; + match self { +Ach => "ach", +DomesticWireUs => "domestic_wire_us", +Swift => "swift", + + } + } +} + +impl std::str::FromStr for CustomerBalanceResourceCashBalanceTransactionResourceFundedTransactionResourceBankTransferResourceUsBankTransferNetwork { + type Err = (); + fn from_str(s: &str) -> Result { + use CustomerBalanceResourceCashBalanceTransactionResourceFundedTransactionResourceBankTransferResourceUsBankTransferNetwork::*; + match s { + "ach" => Ok(Ach), +"domestic_wire_us" => Ok(DomesticWireUs), +"swift" => Ok(Swift), +_ => Err(()) + + } + } +} +impl std::fmt::Display for CustomerBalanceResourceCashBalanceTransactionResourceFundedTransactionResourceBankTransferResourceUsBankTransferNetwork { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CustomerBalanceResourceCashBalanceTransactionResourceFundedTransactionResourceBankTransferResourceUsBankTransferNetwork { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CustomerBalanceResourceCashBalanceTransactionResourceFundedTransactionResourceBankTransferResourceUsBankTransferNetwork { + fn serialize(&self, serializer: S) -> Result where S: serde::Serializer { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for CustomerBalanceResourceCashBalanceTransactionResourceFundedTransactionResourceBankTransferResourceUsBankTransferNetwork { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for CustomerBalanceResourceCashBalanceTransactionResourceFundedTransactionResourceBankTransferResourceUsBankTransferNetwork")) + } +} diff --git a/generated/stripe_shared/src/customer_balance_resource_cash_balance_transaction_resource_refunded_from_payment_transaction.rs b/generated/stripe_shared/src/customer_balance_resource_cash_balance_transaction_resource_refunded_from_payment_transaction.rs new file mode 100644 index 000000000..2c96cf7b8 --- /dev/null +++ b/generated/stripe_shared/src/customer_balance_resource_cash_balance_transaction_resource_refunded_from_payment_transaction.rs @@ -0,0 +1,5 @@ +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct CustomerBalanceResourceCashBalanceTransactionResourceRefundedFromPaymentTransaction { + /// The [Refund](https://stripe.com/docs/api/refunds/object) that moved these funds into the customer's cash balance. + pub refund: stripe_types::Expandable, +} diff --git a/generated/stripe_shared/src/customer_balance_resource_cash_balance_transaction_resource_transferred_to_balance.rs b/generated/stripe_shared/src/customer_balance_resource_cash_balance_transaction_resource_transferred_to_balance.rs new file mode 100644 index 000000000..e18d761cb --- /dev/null +++ b/generated/stripe_shared/src/customer_balance_resource_cash_balance_transaction_resource_transferred_to_balance.rs @@ -0,0 +1,5 @@ +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct CustomerBalanceResourceCashBalanceTransactionResourceTransferredToBalance { + /// The [Balance Transaction](https://stripe.com/docs/api/balance_transactions/object) that corresponds to funds transferred to your Stripe balance. + pub balance_transaction: stripe_types::Expandable, +} diff --git a/generated/stripe_shared/src/customer_balance_resource_cash_balance_transaction_resource_unapplied_from_payment_transaction.rs b/generated/stripe_shared/src/customer_balance_resource_cash_balance_transaction_resource_unapplied_from_payment_transaction.rs new file mode 100644 index 000000000..8d188aa97 --- /dev/null +++ b/generated/stripe_shared/src/customer_balance_resource_cash_balance_transaction_resource_unapplied_from_payment_transaction.rs @@ -0,0 +1,5 @@ +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct CustomerBalanceResourceCashBalanceTransactionResourceUnappliedFromPaymentTransaction { + /// The [Payment Intent](https://stripe.com/docs/api/payment_intents/object) that funds were unapplied from. + pub payment_intent: stripe_types::Expandable, +} diff --git a/generated/stripe_shared/src/customer_balance_transaction.rs b/generated/stripe_shared/src/customer_balance_transaction.rs new file mode 100644 index 000000000..c7be37a23 --- /dev/null +++ b/generated/stripe_shared/src/customer_balance_transaction.rs @@ -0,0 +1,129 @@ +/// Each customer has a [Balance](https://stripe.com/docs/api/customers/object#customer_object-balance) value,. +/// which denotes a debit or credit that's automatically applied to their next invoice upon finalization. +/// You may modify the value directly by using the [update customer API](https://stripe.com/docs/api/customers/update),. +/// or by creating a Customer Balance Transaction, which increments or decrements the customer's `balance` by the specified `amount`. +/// +/// Related guide: [Customer balance](https://stripe.com/docs/billing/customer/balance) +/// +/// For more details see <>. +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct CustomerBalanceTransaction { + /// The amount of the transaction. + /// A negative value is a credit for the customer's balance, and a positive value is a debit to the customer's `balance`. + pub amount: i64, + /// Time at which the object was created. Measured in seconds since the Unix epoch. + pub created: stripe_types::Timestamp, + /// The ID of the credit note (if any) related to the transaction. + pub credit_note: Option>, + /// Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. + /// Must be a [supported currency](https://stripe.com/docs/currencies). + pub currency: stripe_types::Currency, + /// The ID of the customer the transaction belongs to. + pub customer: stripe_types::Expandable, + /// An arbitrary string attached to the object. Often useful for displaying to users. + pub description: Option, + /// The customer's `balance` after the transaction was applied. + /// A negative value decreases the amount due on the customer's next invoice. + /// A positive value increases the amount due on the customer's next invoice. + pub ending_balance: i64, + /// Unique identifier for the object. + pub id: stripe_shared::CustomerBalanceTransactionId, + /// The ID of the invoice (if any) related to the transaction. + pub invoice: Option>, + /// Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + pub livemode: bool, + /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. + /// This can be useful for storing additional information about the object in a structured format. + pub metadata: Option>, + /// Transaction type: `adjustment`, `applied_to_invoice`, `credit_note`, `initial`, `invoice_overpaid`, `invoice_too_large`, `invoice_too_small`, `unspent_receiver_credit`, or `unapplied_from_invoice`. + /// See the [Customer Balance page](https://stripe.com/docs/billing/customer/balance#types) to learn more about transaction types. + #[serde(rename = "type")] + pub type_: CustomerBalanceTransactionType, +} +/// Transaction type: `adjustment`, `applied_to_invoice`, `credit_note`, `initial`, `invoice_overpaid`, `invoice_too_large`, `invoice_too_small`, `unspent_receiver_credit`, or `unapplied_from_invoice`. +/// See the [Customer Balance page](https://stripe.com/docs/billing/customer/balance#types) to learn more about transaction types. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CustomerBalanceTransactionType { + Adjustment, + AppliedToInvoice, + CreditNote, + Initial, + InvoiceOverpaid, + InvoiceTooLarge, + InvoiceTooSmall, + Migration, + UnappliedFromInvoice, + UnspentReceiverCredit, +} +impl CustomerBalanceTransactionType { + pub fn as_str(self) -> &'static str { + use CustomerBalanceTransactionType::*; + match self { + Adjustment => "adjustment", + AppliedToInvoice => "applied_to_invoice", + CreditNote => "credit_note", + Initial => "initial", + InvoiceOverpaid => "invoice_overpaid", + InvoiceTooLarge => "invoice_too_large", + InvoiceTooSmall => "invoice_too_small", + Migration => "migration", + UnappliedFromInvoice => "unapplied_from_invoice", + UnspentReceiverCredit => "unspent_receiver_credit", + } + } +} + +impl std::str::FromStr for CustomerBalanceTransactionType { + type Err = (); + fn from_str(s: &str) -> Result { + use CustomerBalanceTransactionType::*; + match s { + "adjustment" => Ok(Adjustment), + "applied_to_invoice" => Ok(AppliedToInvoice), + "credit_note" => Ok(CreditNote), + "initial" => Ok(Initial), + "invoice_overpaid" => Ok(InvoiceOverpaid), + "invoice_too_large" => Ok(InvoiceTooLarge), + "invoice_too_small" => Ok(InvoiceTooSmall), + "migration" => Ok(Migration), + "unapplied_from_invoice" => Ok(UnappliedFromInvoice), + "unspent_receiver_credit" => Ok(UnspentReceiverCredit), + _ => Err(()), + } + } +} +impl std::fmt::Display for CustomerBalanceTransactionType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CustomerBalanceTransactionType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CustomerBalanceTransactionType { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for CustomerBalanceTransactionType { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| { + serde::de::Error::custom("Unknown value for CustomerBalanceTransactionType") + }) + } +} +impl stripe_types::Object for CustomerBalanceTransaction { + type Id = stripe_shared::CustomerBalanceTransactionId; + fn id(&self) -> &Self::Id { + &self.id + } +} +stripe_types::def_id!(CustomerBalanceTransactionId, "cbtxn_"); diff --git a/generated/stripe_shared/src/customer_cash_balance_transaction.rs b/generated/stripe_shared/src/customer_cash_balance_transaction.rs new file mode 100644 index 000000000..e65cf7add --- /dev/null +++ b/generated/stripe_shared/src/customer_cash_balance_transaction.rs @@ -0,0 +1,131 @@ +/// Customers with certain payments enabled have a cash balance, representing funds that were paid +/// by the customer to a merchant, but have not yet been allocated to a payment. +/// Cash Balance Transactions. +/// represent when funds are moved into or out of this balance. +/// This includes funding by the customer, allocation. +/// to payments, and refunds to the customer. +/// +/// For more details see <>. +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct CustomerCashBalanceTransaction { +#[serde(skip_serializing_if = "Option::is_none")] +pub adjusted_for_overdraft: Option, +#[serde(skip_serializing_if = "Option::is_none")] +pub applied_to_payment: Option, + /// Time at which the object was created. Measured in seconds since the Unix epoch. +pub created: stripe_types::Timestamp, + /// Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. + /// Must be a [supported currency](https://stripe.com/docs/currencies). +pub currency: stripe_types::Currency, + /// The customer whose available cash balance changed as a result of this transaction. +pub customer: stripe_types::Expandable, + /// The total available cash balance for the specified currency after this transaction was applied. + /// Represented in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal). +pub ending_balance: i64, +#[serde(skip_serializing_if = "Option::is_none")] +pub funded: Option, + /// Unique identifier for the object. +pub id: stripe_shared::CustomerCashBalanceTransactionId, + /// Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. +pub livemode: bool, + /// The amount by which the cash balance changed, represented in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal). + /// A positive value represents funds being added to the cash balance, a negative value represents funds being removed from the cash balance. +pub net_amount: i64, +#[serde(skip_serializing_if = "Option::is_none")] +pub refunded_from_payment: Option, +#[serde(skip_serializing_if = "Option::is_none")] +pub transferred_to_balance: Option, + /// The type of the cash balance transaction. + /// New types may be added in future. + /// See [Customer Balance](https://stripe.com/docs/payments/customer-balance#types) to learn more about these types. +#[serde(rename = "type")] +pub type_: CustomerCashBalanceTransactionType, +#[serde(skip_serializing_if = "Option::is_none")] +pub unapplied_from_payment: Option, + +} +/// The type of the cash balance transaction. +/// New types may be added in future. +/// See [Customer Balance](https://stripe.com/docs/payments/customer-balance#types) to learn more about these types. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CustomerCashBalanceTransactionType { + AdjustedForOverdraft, + AppliedToPayment, + Funded, + FundingReversed, + RefundedFromPayment, + ReturnCanceled, + ReturnInitiated, + TransferredToBalance, + UnappliedFromPayment, +} +impl CustomerCashBalanceTransactionType { + pub fn as_str(self) -> &'static str { + use CustomerCashBalanceTransactionType::*; + match self { + AdjustedForOverdraft => "adjusted_for_overdraft", + AppliedToPayment => "applied_to_payment", + Funded => "funded", + FundingReversed => "funding_reversed", + RefundedFromPayment => "refunded_from_payment", + ReturnCanceled => "return_canceled", + ReturnInitiated => "return_initiated", + TransferredToBalance => "transferred_to_balance", + UnappliedFromPayment => "unapplied_from_payment", + } + } +} + +impl std::str::FromStr for CustomerCashBalanceTransactionType { + type Err = (); + fn from_str(s: &str) -> Result { + use CustomerCashBalanceTransactionType::*; + match s { + "adjusted_for_overdraft" => Ok(AdjustedForOverdraft), + "applied_to_payment" => Ok(AppliedToPayment), + "funded" => Ok(Funded), + "funding_reversed" => Ok(FundingReversed), + "refunded_from_payment" => Ok(RefundedFromPayment), + "return_canceled" => Ok(ReturnCanceled), + "return_initiated" => Ok(ReturnInitiated), + "transferred_to_balance" => Ok(TransferredToBalance), + "unapplied_from_payment" => Ok(UnappliedFromPayment), + _ => Err(()), + } + } +} +impl std::fmt::Display for CustomerCashBalanceTransactionType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CustomerCashBalanceTransactionType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CustomerCashBalanceTransactionType { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for CustomerCashBalanceTransactionType { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| { + serde::de::Error::custom("Unknown value for CustomerCashBalanceTransactionType") + }) + } +} +impl stripe_types::Object for CustomerCashBalanceTransaction { + type Id = stripe_shared::CustomerCashBalanceTransactionId; + fn id(&self) -> &Self::Id { + &self.id + } +} +stripe_types::def_id!(CustomerCashBalanceTransactionId); diff --git a/generated/stripe_shared/src/customer_tax.rs b/generated/stripe_shared/src/customer_tax.rs new file mode 100644 index 000000000..a4698f5dd --- /dev/null +++ b/generated/stripe_shared/src/customer_tax.rs @@ -0,0 +1,69 @@ +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct CustomerTax { + /// Surfaces if automatic tax computation is possible given the current customer location information. + pub automatic_tax: CustomerTaxAutomaticTax, + /// A recent IP address of the customer used for tax reporting and tax location inference. + pub ip_address: Option, + /// The customer's location as identified by Stripe Tax. + pub location: Option, +} +/// Surfaces if automatic tax computation is possible given the current customer location information. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CustomerTaxAutomaticTax { + Failed, + NotCollecting, + Supported, + UnrecognizedLocation, +} +impl CustomerTaxAutomaticTax { + pub fn as_str(self) -> &'static str { + use CustomerTaxAutomaticTax::*; + match self { + Failed => "failed", + NotCollecting => "not_collecting", + Supported => "supported", + UnrecognizedLocation => "unrecognized_location", + } + } +} + +impl std::str::FromStr for CustomerTaxAutomaticTax { + type Err = (); + fn from_str(s: &str) -> Result { + use CustomerTaxAutomaticTax::*; + match s { + "failed" => Ok(Failed), + "not_collecting" => Ok(NotCollecting), + "supported" => Ok(Supported), + "unrecognized_location" => Ok(UnrecognizedLocation), + _ => Err(()), + } + } +} +impl std::fmt::Display for CustomerTaxAutomaticTax { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CustomerTaxAutomaticTax { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CustomerTaxAutomaticTax { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for CustomerTaxAutomaticTax { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s) + .map_err(|_| serde::de::Error::custom("Unknown value for CustomerTaxAutomaticTax")) + } +} diff --git a/generated/stripe_shared/src/customer_tax_location.rs b/generated/stripe_shared/src/customer_tax_location.rs new file mode 100644 index 000000000..b99613984 --- /dev/null +++ b/generated/stripe_shared/src/customer_tax_location.rs @@ -0,0 +1,69 @@ +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct CustomerTaxLocation { + /// The customer's country as identified by Stripe Tax. + pub country: String, + /// The data source used to infer the customer's location. + pub source: CustomerTaxLocationSource, + /// The customer's state, county, province, or region as identified by Stripe Tax. + pub state: Option, +} +/// The data source used to infer the customer's location. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CustomerTaxLocationSource { + BillingAddress, + IpAddress, + PaymentMethod, + ShippingDestination, +} +impl CustomerTaxLocationSource { + pub fn as_str(self) -> &'static str { + use CustomerTaxLocationSource::*; + match self { + BillingAddress => "billing_address", + IpAddress => "ip_address", + PaymentMethod => "payment_method", + ShippingDestination => "shipping_destination", + } + } +} + +impl std::str::FromStr for CustomerTaxLocationSource { + type Err = (); + fn from_str(s: &str) -> Result { + use CustomerTaxLocationSource::*; + match s { + "billing_address" => Ok(BillingAddress), + "ip_address" => Ok(IpAddress), + "payment_method" => Ok(PaymentMethod), + "shipping_destination" => Ok(ShippingDestination), + _ => Err(()), + } + } +} +impl std::fmt::Display for CustomerTaxLocationSource { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CustomerTaxLocationSource { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CustomerTaxLocationSource { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for CustomerTaxLocationSource { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s) + .map_err(|_| serde::de::Error::custom("Unknown value for CustomerTaxLocationSource")) + } +} diff --git a/generated/stripe_shared/src/deleted_account.rs b/generated/stripe_shared/src/deleted_account.rs new file mode 100644 index 000000000..7f3c8435a --- /dev/null +++ b/generated/stripe_shared/src/deleted_account.rs @@ -0,0 +1,13 @@ +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct DeletedAccount { + /// Always true for a deleted object + deleted: stripe_types::AlwaysTrue, + /// Unique identifier for the object. + pub id: stripe_shared::AccountId, +} +impl stripe_types::Object for DeletedAccount { + type Id = stripe_shared::AccountId; + fn id(&self) -> &Self::Id { + &self.id + } +} diff --git a/generated/stripe_shared/src/deleted_bank_account.rs b/generated/stripe_shared/src/deleted_bank_account.rs new file mode 100644 index 000000000..2c8093965 --- /dev/null +++ b/generated/stripe_shared/src/deleted_bank_account.rs @@ -0,0 +1,16 @@ +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct DeletedBankAccount { + /// Three-letter [ISO code for the currency](https://stripe.com/docs/payouts) paid out to the bank account. + #[serde(skip_serializing_if = "Option::is_none")] + pub currency: Option, + /// Always true for a deleted object + deleted: stripe_types::AlwaysTrue, + /// Unique identifier for the object. + pub id: stripe_shared::BankAccountId, +} +impl stripe_types::Object for DeletedBankAccount { + type Id = stripe_shared::BankAccountId; + fn id(&self) -> &Self::Id { + &self.id + } +} diff --git a/generated/stripe_shared/src/deleted_card.rs b/generated/stripe_shared/src/deleted_card.rs new file mode 100644 index 000000000..e430a17aa --- /dev/null +++ b/generated/stripe_shared/src/deleted_card.rs @@ -0,0 +1,16 @@ +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct DeletedCard { + /// Three-letter [ISO code for the currency](https://stripe.com/docs/payouts) paid out to the bank account. + #[serde(skip_serializing_if = "Option::is_none")] + pub currency: Option, + /// Always true for a deleted object + deleted: stripe_types::AlwaysTrue, + /// Unique identifier for the object. + pub id: stripe_shared::CardId, +} +impl stripe_types::Object for DeletedCard { + type Id = stripe_shared::CardId; + fn id(&self) -> &Self::Id { + &self.id + } +} diff --git a/generated/stripe_shared/src/deleted_coupon.rs b/generated/stripe_shared/src/deleted_coupon.rs new file mode 100644 index 000000000..f179913b1 --- /dev/null +++ b/generated/stripe_shared/src/deleted_coupon.rs @@ -0,0 +1,13 @@ +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct DeletedCoupon { + /// Always true for a deleted object + deleted: stripe_types::AlwaysTrue, + /// Unique identifier for the object. + pub id: stripe_shared::CouponId, +} +impl stripe_types::Object for DeletedCoupon { + type Id = stripe_shared::CouponId; + fn id(&self) -> &Self::Id { + &self.id + } +} diff --git a/generated/stripe_shared/src/deleted_customer.rs b/generated/stripe_shared/src/deleted_customer.rs new file mode 100644 index 000000000..96058aab1 --- /dev/null +++ b/generated/stripe_shared/src/deleted_customer.rs @@ -0,0 +1,13 @@ +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct DeletedCustomer { + /// Always true for a deleted object + deleted: stripe_types::AlwaysTrue, + /// Unique identifier for the object. + pub id: stripe_shared::CustomerId, +} +impl stripe_types::Object for DeletedCustomer { + type Id = stripe_shared::CustomerId; + fn id(&self) -> &Self::Id { + &self.id + } +} diff --git a/generated/stripe_shared/src/deleted_discount.rs b/generated/stripe_shared/src/deleted_discount.rs new file mode 100644 index 000000000..a3027a163 --- /dev/null +++ b/generated/stripe_shared/src/deleted_discount.rs @@ -0,0 +1,31 @@ +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct DeletedDiscount { + /// The Checkout session that this coupon is applied to, if it is applied to a particular session in payment mode. + /// Will not be present for subscription mode. + pub checkout_session: Option, + pub coupon: stripe_shared::Coupon, + /// The ID of the customer associated with this discount. + pub customer: Option>, + /// Always true for a deleted object + deleted: stripe_types::AlwaysTrue, + /// The ID of the discount object. + /// Discounts cannot be fetched by ID. + /// Use `expand[]=discounts` in API calls to expand discount IDs in an array. + pub id: stripe_shared::DiscountId, + /// The invoice that the discount's coupon was applied to, if it was applied directly to a particular invoice. + pub invoice: Option, + /// The invoice item `id` (or invoice line item `id` for invoice line items of type='subscription') that the discount's coupon was applied to, if it was applied directly to a particular invoice item or invoice line item. + pub invoice_item: Option, + /// The promotion code applied to create this discount. + pub promotion_code: Option>, + /// Date that the coupon was applied. + pub start: stripe_types::Timestamp, + /// The subscription that this coupon is applied to, if it is applied to a particular subscription. + pub subscription: Option, +} +impl stripe_types::Object for DeletedDiscount { + type Id = stripe_shared::DiscountId; + fn id(&self) -> &Self::Id { + &self.id + } +} diff --git a/generated/stripe_shared/src/deleted_external_account.rs b/generated/stripe_shared/src/deleted_external_account.rs new file mode 100644 index 000000000..a43f16905 --- /dev/null +++ b/generated/stripe_shared/src/deleted_external_account.rs @@ -0,0 +1,18 @@ +/// The resource representing a Stripe Polymorphic +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +#[serde(tag = "object")] +pub enum DeletedExternalAccount { + #[serde(rename = "bank_account")] + DeletedBankAccount(stripe_shared::DeletedBankAccount), + #[serde(rename = "card")] + DeletedCard(stripe_shared::DeletedCard), +} +impl stripe_types::Object for DeletedExternalAccount { + type Id = smol_str::SmolStr; + fn id(&self) -> &Self::Id { + match self { + Self::DeletedBankAccount(v) => v.id.inner(), + Self::DeletedCard(v) => v.id.inner(), + } + } +} diff --git a/generated/stripe_shared/src/deleted_invoice.rs b/generated/stripe_shared/src/deleted_invoice.rs new file mode 100644 index 000000000..c70fedb3e --- /dev/null +++ b/generated/stripe_shared/src/deleted_invoice.rs @@ -0,0 +1,13 @@ +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct DeletedInvoice { + /// Always true for a deleted object + deleted: stripe_types::AlwaysTrue, + /// Unique identifier for the object. + pub id: stripe_shared::InvoiceId, +} +impl stripe_types::Object for DeletedInvoice { + type Id = stripe_shared::InvoiceId; + fn id(&self) -> &Self::Id { + &self.id + } +} diff --git a/generated/stripe_shared/src/deleted_invoiceitem.rs b/generated/stripe_shared/src/deleted_invoiceitem.rs new file mode 100644 index 000000000..bcaf0face --- /dev/null +++ b/generated/stripe_shared/src/deleted_invoiceitem.rs @@ -0,0 +1,13 @@ +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct DeletedInvoiceitem { + /// Always true for a deleted object + deleted: stripe_types::AlwaysTrue, + /// Unique identifier for the object. + pub id: stripe_shared::InvoiceItemId, +} +impl stripe_types::Object for DeletedInvoiceitem { + type Id = stripe_shared::InvoiceItemId; + fn id(&self) -> &Self::Id { + &self.id + } +} diff --git a/generated/stripe_shared/src/deleted_payment_source.rs b/generated/stripe_shared/src/deleted_payment_source.rs new file mode 100644 index 000000000..a7e02870f --- /dev/null +++ b/generated/stripe_shared/src/deleted_payment_source.rs @@ -0,0 +1,18 @@ +/// The resource representing a Stripe Polymorphic +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +#[serde(tag = "object")] +pub enum DeletedPaymentSource { + #[serde(rename = "bank_account")] + DeletedBankAccount(stripe_shared::DeletedBankAccount), + #[serde(rename = "card")] + DeletedCard(stripe_shared::DeletedCard), +} +impl stripe_types::Object for DeletedPaymentSource { + type Id = smol_str::SmolStr; + fn id(&self) -> &Self::Id { + match self { + Self::DeletedBankAccount(v) => v.id.inner(), + Self::DeletedCard(v) => v.id.inner(), + } + } +} diff --git a/generated/stripe_shared/src/deleted_person.rs b/generated/stripe_shared/src/deleted_person.rs new file mode 100644 index 000000000..5c31e7795 --- /dev/null +++ b/generated/stripe_shared/src/deleted_person.rs @@ -0,0 +1,13 @@ +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct DeletedPerson { + /// Always true for a deleted object + deleted: stripe_types::AlwaysTrue, + /// Unique identifier for the object. + pub id: stripe_shared::PersonId, +} +impl stripe_types::Object for DeletedPerson { + type Id = stripe_shared::PersonId; + fn id(&self) -> &Self::Id { + &self.id + } +} diff --git a/generated/stripe_shared/src/deleted_plan.rs b/generated/stripe_shared/src/deleted_plan.rs new file mode 100644 index 000000000..0d749aff2 --- /dev/null +++ b/generated/stripe_shared/src/deleted_plan.rs @@ -0,0 +1,13 @@ +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct DeletedPlan { + /// Always true for a deleted object + deleted: stripe_types::AlwaysTrue, + /// Unique identifier for the object. + pub id: stripe_shared::PlanId, +} +impl stripe_types::Object for DeletedPlan { + type Id = stripe_shared::PlanId; + fn id(&self) -> &Self::Id { + &self.id + } +} diff --git a/generated/stripe_shared/src/deleted_product.rs b/generated/stripe_shared/src/deleted_product.rs new file mode 100644 index 000000000..754490d5c --- /dev/null +++ b/generated/stripe_shared/src/deleted_product.rs @@ -0,0 +1,13 @@ +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct DeletedProduct { + /// Always true for a deleted object + deleted: stripe_types::AlwaysTrue, + /// Unique identifier for the object. + pub id: stripe_shared::ProductId, +} +impl stripe_types::Object for DeletedProduct { + type Id = stripe_shared::ProductId; + fn id(&self) -> &Self::Id { + &self.id + } +} diff --git a/generated/stripe_shared/src/deleted_subscription_item.rs b/generated/stripe_shared/src/deleted_subscription_item.rs new file mode 100644 index 000000000..1fe5b43dd --- /dev/null +++ b/generated/stripe_shared/src/deleted_subscription_item.rs @@ -0,0 +1,13 @@ +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct DeletedSubscriptionItem { + /// Always true for a deleted object + deleted: stripe_types::AlwaysTrue, + /// Unique identifier for the object. + pub id: stripe_shared::SubscriptionItemId, +} +impl stripe_types::Object for DeletedSubscriptionItem { + type Id = stripe_shared::SubscriptionItemId; + fn id(&self) -> &Self::Id { + &self.id + } +} diff --git a/generated/stripe_shared/src/deleted_tax_id.rs b/generated/stripe_shared/src/deleted_tax_id.rs new file mode 100644 index 000000000..79bdb8882 --- /dev/null +++ b/generated/stripe_shared/src/deleted_tax_id.rs @@ -0,0 +1,13 @@ +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct DeletedTaxId { + /// Always true for a deleted object + deleted: stripe_types::AlwaysTrue, + /// Unique identifier for the object. + pub id: stripe_shared::TaxIdId, +} +impl stripe_types::Object for DeletedTaxId { + type Id = stripe_shared::TaxIdId; + fn id(&self) -> &Self::Id { + &self.id + } +} diff --git a/generated/stripe_shared/src/deleted_test_helpers_test_clock.rs b/generated/stripe_shared/src/deleted_test_helpers_test_clock.rs new file mode 100644 index 000000000..748c67122 --- /dev/null +++ b/generated/stripe_shared/src/deleted_test_helpers_test_clock.rs @@ -0,0 +1,13 @@ +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct DeletedTestHelpersTestClock { + /// Always true for a deleted object + deleted: stripe_types::AlwaysTrue, + /// Unique identifier for the object. + pub id: stripe_shared::TestHelpersTestClockId, +} +impl stripe_types::Object for DeletedTestHelpersTestClock { + type Id = stripe_shared::TestHelpersTestClockId; + fn id(&self) -> &Self::Id { + &self.id + } +} diff --git a/generated/stripe_shared/src/destination_details_unimplemented.rs b/generated/stripe_shared/src/destination_details_unimplemented.rs new file mode 100644 index 000000000..0c49c86d1 --- /dev/null +++ b/generated/stripe_shared/src/destination_details_unimplemented.rs @@ -0,0 +1,2 @@ +#[derive(Copy, Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct DestinationDetailsUnimplemented {} diff --git a/src/resources/generated/discount.rs b/generated/stripe_shared/src/discount.rs similarity index 55% rename from src/resources/generated/discount.rs rename to generated/stripe_shared/src/discount.rs index 4ab82cd45..09db8a753 100644 --- a/src/resources/generated/discount.rs +++ b/generated/stripe_shared/src/discount.rs @@ -1,66 +1,39 @@ -// ====================================== -// This file was automatically generated. -// ====================================== - -use serde::{Deserialize, Serialize}; - -use crate::ids::DiscountId; -use crate::params::{Expandable, Object, Timestamp}; -use crate::resources::{Coupon, Customer, PromotionCode}; - -/// The resource representing a Stripe "Discount". +/// A discount represents the actual application of a [coupon](https://stripe.com/docs/api#coupons) or [promotion code](https://stripe.com/docs/api#promotion_codes). +/// It contains information about when the discount began, when it will end, and what it is applied to. /// -/// For more details see -#[derive(Clone, Debug, Default, Deserialize, Serialize)] +/// Related guide: [Applying discounts to subscriptions](https://stripe.com/docs/billing/subscriptions/discounts). +/// +/// For more details see <>. +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] pub struct Discount { - /// The ID of the discount object. - /// - /// Discounts cannot be fetched by ID. - /// Use `expand[]=discounts` in API calls to expand discount IDs in an array. - pub id: DiscountId, - /// The Checkout session that this coupon is applied to, if it is applied to a particular session in payment mode. - /// /// Will not be present for subscription mode. pub checkout_session: Option, - - pub coupon: Coupon, - + pub coupon: stripe_shared::Coupon, /// The ID of the customer associated with this discount. - pub customer: Option>, - - // Always true for a deleted object - #[serde(default)] - pub deleted: bool, - + pub customer: Option>, /// If the coupon has a duration of `repeating`, the date that this discount will end. - /// /// If the coupon has a duration of `once` or `forever`, this attribute will be null. - #[serde(skip_serializing_if = "Option::is_none")] - pub end: Option, - + pub end: Option, + /// The ID of the discount object. + /// Discounts cannot be fetched by ID. + /// Use `expand[]=discounts` in API calls to expand discount IDs in an array. + pub id: stripe_shared::DiscountId, /// The invoice that the discount's coupon was applied to, if it was applied directly to a particular invoice. pub invoice: Option, - /// The invoice item `id` (or invoice line item `id` for invoice line items of type='subscription') that the discount's coupon was applied to, if it was applied directly to a particular invoice item or invoice line item. pub invoice_item: Option, - /// The promotion code applied to create this discount. - pub promotion_code: Option>, - + pub promotion_code: Option>, /// Date that the coupon was applied. - pub start: Timestamp, - + pub start: stripe_types::Timestamp, /// The subscription that this coupon is applied to, if it is applied to a particular subscription. pub subscription: Option, } - -impl Object for Discount { - type Id = DiscountId; - fn id(&self) -> Self::Id { - self.id.clone() - } - fn object(&self) -> &'static str { - "discount" +impl stripe_types::Object for Discount { + type Id = stripe_shared::DiscountId; + fn id(&self) -> &Self::Id { + &self.id } } +stripe_types::def_id!(DiscountId, "di_"); diff --git a/generated/stripe_shared/src/discounts_resource_discount_amount.rs b/generated/stripe_shared/src/discounts_resource_discount_amount.rs new file mode 100644 index 000000000..34eb3dfda --- /dev/null +++ b/generated/stripe_shared/src/discounts_resource_discount_amount.rs @@ -0,0 +1,7 @@ +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct DiscountsResourceDiscountAmount { + /// The amount, in cents (or local equivalent), of the discount. + pub amount: i64, + /// The discount that was applied to get this discount amount. + pub discount: stripe_types::Expandable, +} diff --git a/generated/stripe_shared/src/dispute.rs b/generated/stripe_shared/src/dispute.rs new file mode 100644 index 000000000..20653ecb7 --- /dev/null +++ b/generated/stripe_shared/src/dispute.rs @@ -0,0 +1,124 @@ +/// A dispute occurs when a customer questions your charge with their card issuer. +/// When this happens, you have the opportunity to respond to the dispute with +/// evidence that shows that the charge is legitimate. +/// +/// Related guide: [Disputes and fraud](https://stripe.com/docs/disputes) +/// +/// For more details see <>. +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct Dispute { + /// Disputed amount. + /// Usually the amount of the charge, but it can differ (usually because of currency fluctuation or because only part of the order is disputed). + pub amount: i64, + /// List of zero, one, or two balance transactions that show funds withdrawn and reinstated to your Stripe account as a result of this dispute. + pub balance_transactions: Vec, + /// ID of the charge that's disputed. + pub charge: stripe_types::Expandable, + /// Time at which the object was created. Measured in seconds since the Unix epoch. + pub created: stripe_types::Timestamp, + /// Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. + /// Must be a [supported currency](https://stripe.com/docs/currencies). + pub currency: stripe_types::Currency, + pub evidence: stripe_shared::DisputeEvidence, + pub evidence_details: stripe_shared::DisputeEvidenceDetails, + /// Unique identifier for the object. + pub id: stripe_shared::DisputeId, + /// If true, it's still possible to refund the disputed payment. + /// After the payment has been fully refunded, no further funds are withdrawn from your Stripe account as a result of this dispute. + pub is_charge_refundable: bool, + /// Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + pub livemode: bool, + /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. + /// This can be useful for storing additional information about the object in a structured format. + pub metadata: std::collections::HashMap, + /// Network-dependent reason code for the dispute. + #[serde(skip_serializing_if = "Option::is_none")] + pub network_reason_code: Option, + /// ID of the PaymentIntent that's disputed. + pub payment_intent: Option>, + #[serde(skip_serializing_if = "Option::is_none")] + pub payment_method_details: Option, + /// Reason given by cardholder for dispute. + /// Possible values are `bank_cannot_process`, `check_returned`, `credit_not_processed`, `customer_initiated`, `debit_not_authorized`, `duplicate`, `fraudulent`, `general`, `incorrect_account_details`, `insufficient_funds`, `product_not_received`, `product_unacceptable`, `subscription_canceled`, or `unrecognized`. + /// Learn more about [dispute reasons](https://stripe.com/docs/disputes/categories). + pub reason: String, + /// Current status of dispute. + /// Possible values are `warning_needs_response`, `warning_under_review`, `warning_closed`, `needs_response`, `under_review`, `won`, or `lost`. + pub status: DisputeStatus, +} +/// Current status of dispute. +/// Possible values are `warning_needs_response`, `warning_under_review`, `warning_closed`, `needs_response`, `under_review`, `won`, or `lost`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum DisputeStatus { + Lost, + NeedsResponse, + UnderReview, + WarningClosed, + WarningNeedsResponse, + WarningUnderReview, + Won, +} +impl DisputeStatus { + pub fn as_str(self) -> &'static str { + use DisputeStatus::*; + match self { + Lost => "lost", + NeedsResponse => "needs_response", + UnderReview => "under_review", + WarningClosed => "warning_closed", + WarningNeedsResponse => "warning_needs_response", + WarningUnderReview => "warning_under_review", + Won => "won", + } + } +} + +impl std::str::FromStr for DisputeStatus { + type Err = (); + fn from_str(s: &str) -> Result { + use DisputeStatus::*; + match s { + "lost" => Ok(Lost), + "needs_response" => Ok(NeedsResponse), + "under_review" => Ok(UnderReview), + "warning_closed" => Ok(WarningClosed), + "warning_needs_response" => Ok(WarningNeedsResponse), + "warning_under_review" => Ok(WarningUnderReview), + "won" => Ok(Won), + _ => Err(()), + } + } +} +impl std::fmt::Display for DisputeStatus { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for DisputeStatus { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for DisputeStatus { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for DisputeStatus { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for DisputeStatus")) + } +} +impl stripe_types::Object for Dispute { + type Id = stripe_shared::DisputeId; + fn id(&self) -> &Self::Id { + &self.id + } +} +stripe_types::def_id!(DisputeId, "dp_" | "du_" | "pdp_"); diff --git a/generated/stripe_shared/src/dispute_evidence.rs b/generated/stripe_shared/src/dispute_evidence.rs new file mode 100644 index 000000000..9437e4a8f --- /dev/null +++ b/generated/stripe_shared/src/dispute_evidence.rs @@ -0,0 +1,67 @@ +/// For more details see <>. +#[derive(Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct DisputeEvidence { + /// Any server or activity logs showing proof that the customer accessed or downloaded the purchased digital product. + /// This information should include IP addresses, corresponding timestamps, and any detailed recorded activity. + pub access_activity_log: Option, + /// The billing address provided by the customer. + pub billing_address: Option, + /// (ID of a [file upload](https://stripe.com/docs/guides/file-upload)) Your subscription cancellation policy, as shown to the customer. + pub cancellation_policy: Option>, + /// An explanation of how and when the customer was shown your refund policy prior to purchase. + pub cancellation_policy_disclosure: Option, + /// A justification for why the customer's subscription was not canceled. + pub cancellation_rebuttal: Option, + /// (ID of a [file upload](https://stripe.com/docs/guides/file-upload)) Any communication with the customer that you feel is relevant to your case. + /// Examples include emails proving that the customer received the product or service, or demonstrating their use of or satisfaction with the product or service. + pub customer_communication: Option>, + /// The email address of the customer. + pub customer_email_address: Option, + /// The name of the customer. + pub customer_name: Option, + /// The IP address that the customer used when making the purchase. + pub customer_purchase_ip: Option, + /// (ID of a [file upload](https://stripe.com/docs/guides/file-upload)) A relevant document or contract showing the customer's signature. + pub customer_signature: Option>, + /// (ID of a [file upload](https://stripe.com/docs/guides/file-upload)) Documentation for the prior charge that can uniquely identify the charge, such as a receipt, shipping label, work order, etc. + /// This document should be paired with a similar document from the disputed payment that proves the two payments are separate. + pub duplicate_charge_documentation: Option>, + /// An explanation of the difference between the disputed charge versus the prior charge that appears to be a duplicate. + pub duplicate_charge_explanation: Option, + /// The Stripe ID for the prior charge which appears to be a duplicate of the disputed charge. + pub duplicate_charge_id: Option, + /// A description of the product or service that was sold. + pub product_description: Option, + /// (ID of a [file upload](https://stripe.com/docs/guides/file-upload)) Any receipt or message sent to the customer notifying them of the charge. + pub receipt: Option>, + /// (ID of a [file upload](https://stripe.com/docs/guides/file-upload)) Your refund policy, as shown to the customer. + pub refund_policy: Option>, + /// Documentation demonstrating that the customer was shown your refund policy prior to purchase. + pub refund_policy_disclosure: Option, + /// A justification for why the customer is not entitled to a refund. + pub refund_refusal_explanation: Option, + /// The date on which the customer received or began receiving the purchased service, in a clear human-readable format. + pub service_date: Option, + /// (ID of a [file upload](https://stripe.com/docs/guides/file-upload)) Documentation showing proof that a service was provided to the customer. + /// This could include a copy of a signed contract, work order, or other form of written agreement. + pub service_documentation: Option>, + /// The address to which a physical product was shipped. + /// You should try to include as complete address information as possible. + pub shipping_address: Option, + /// The delivery service that shipped a physical product, such as Fedex, UPS, USPS, etc. + /// If multiple carriers were used for this purchase, please separate them with commas. + pub shipping_carrier: Option, + /// The date on which a physical product began its route to the shipping address, in a clear human-readable format. + pub shipping_date: Option, + /// (ID of a [file upload](https://stripe.com/docs/guides/file-upload)) Documentation showing proof that a product was shipped to the customer at the same address the customer provided to you. + /// This could include a copy of the shipment receipt, shipping label, etc. + /// It should show the customer's full shipping address, if possible. + pub shipping_documentation: Option>, + /// The tracking number for a physical product, obtained from the delivery service. + /// If multiple tracking numbers were generated for this purchase, please separate them with commas. + pub shipping_tracking_number: Option, + /// (ID of a [file upload](https://stripe.com/docs/guides/file-upload)) Any additional evidence or statements. + pub uncategorized_file: Option>, + /// Any additional evidence or statements. + pub uncategorized_text: Option, +} diff --git a/generated/stripe_shared/src/dispute_evidence_details.rs b/generated/stripe_shared/src/dispute_evidence_details.rs new file mode 100644 index 000000000..cef52563c --- /dev/null +++ b/generated/stripe_shared/src/dispute_evidence_details.rs @@ -0,0 +1,14 @@ +#[derive(Copy, Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct DisputeEvidenceDetails { + /// Date by which evidence must be submitted in order to successfully challenge dispute. + /// Will be 0 if the customer's bank or credit card company doesn't allow a response for this particular dispute. + pub due_by: Option, + /// Whether evidence has been staged for this dispute. + pub has_evidence: bool, + /// Whether the last evidence submission was submitted past the due date. + /// Defaults to `false` if no evidence submissions have occurred. + /// If `true`, then delivery of the latest evidence is *not* guaranteed. + pub past_due: bool, + /// The number of times evidence has been submitted. Typically, you may only submit evidence once. + pub submission_count: u64, +} diff --git a/generated/stripe_shared/src/dispute_payment_method_details.rs b/generated/stripe_shared/src/dispute_payment_method_details.rs new file mode 100644 index 000000000..f3fd5f59b --- /dev/null +++ b/generated/stripe_shared/src/dispute_payment_method_details.rs @@ -0,0 +1,60 @@ +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct DisputePaymentMethodDetails { + /// Card specific dispute details. + pub card: Option, + /// Payment method type. + #[serde(rename = "type")] + pub type_: DisputePaymentMethodDetailsType, +} +/// Payment method type. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum DisputePaymentMethodDetailsType { + Card, +} +impl DisputePaymentMethodDetailsType { + pub fn as_str(self) -> &'static str { + use DisputePaymentMethodDetailsType::*; + match self { + Card => "card", + } + } +} + +impl std::str::FromStr for DisputePaymentMethodDetailsType { + type Err = (); + fn from_str(s: &str) -> Result { + use DisputePaymentMethodDetailsType::*; + match s { + "card" => Ok(Card), + _ => Err(()), + } + } +} +impl std::fmt::Display for DisputePaymentMethodDetailsType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for DisputePaymentMethodDetailsType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for DisputePaymentMethodDetailsType { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for DisputePaymentMethodDetailsType { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| { + serde::de::Error::custom("Unknown value for DisputePaymentMethodDetailsType") + }) + } +} diff --git a/generated/stripe_shared/src/dispute_payment_method_details_card.rs b/generated/stripe_shared/src/dispute_payment_method_details_card.rs new file mode 100644 index 000000000..f44c8a755 --- /dev/null +++ b/generated/stripe_shared/src/dispute_payment_method_details_card.rs @@ -0,0 +1,9 @@ +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct DisputePaymentMethodDetailsCard { + /// Card brand. + /// Can be `amex`, `diners`, `discover`, `eftpos_au`, `jcb`, `mastercard`, `unionpay`, `visa`, or `unknown`. + pub brand: String, + /// The card network's specific dispute reason code, which maps to one of Stripe's primary dispute categories to simplify response guidance. + /// The [Network code map](https://stripe.com/docs/disputes/categories#network-code-map) lists all available dispute reason codes by network. + pub network_reason_code: Option, +} diff --git a/generated/stripe_shared/src/email_sent.rs b/generated/stripe_shared/src/email_sent.rs new file mode 100644 index 000000000..da23740ac --- /dev/null +++ b/generated/stripe_shared/src/email_sent.rs @@ -0,0 +1,7 @@ +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct EmailSent { + /// The timestamp when the email was sent. + pub email_sent_at: stripe_types::Timestamp, + /// The recipient's email address. + pub email_sent_to: String, +} diff --git a/generated/stripe_shared/src/error.rs b/generated/stripe_shared/src/error.rs new file mode 100644 index 000000000..e8e568b45 --- /dev/null +++ b/generated/stripe_shared/src/error.rs @@ -0,0 +1,5 @@ +/// An error response from the Stripe API +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct Error { + pub error: Box, +} diff --git a/generated/stripe_shared/src/event.rs b/generated/stripe_shared/src/event.rs new file mode 100644 index 000000000..492f51a52 --- /dev/null +++ b/generated/stripe_shared/src/event.rs @@ -0,0 +1,832 @@ +/// Events are our way of letting you know when something interesting happens in +/// your account. When an interesting event occurs, we create a new `Event` +/// object. For example, when a charge succeeds, we create a `charge.succeeded` +/// event, and when an invoice payment attempt fails, we create an +/// `invoice.payment_failed` event. Certain API requests might create multiple +/// events. For example, if you create a new subscription for a +/// customer, you receive both a `customer.subscription.created` event and a +/// `charge.succeeded` event. +/// +/// Events occur when the state of another API resource changes. The event's data +/// field embeds the resource's state at the time of the change. For +/// example, a `charge.succeeded` event contains a charge, and an +/// `invoice.payment_failed` event contains an invoice. +/// +/// As with other API resources, you can use endpoints to retrieve an +/// [individual event](https://stripe.com/docs/api#retrieve_event) or a [list of events](https://stripe.com/docs/api#list_events). +/// from the API. We also have a separate +/// [webhooks](http://en.wikipedia.org/wiki/Webhook) system for sending the +/// `Event` objects directly to an endpoint on your server. You can manage +/// webhooks in your +/// [account settings](https://dashboard.stripe.com/account/webhooks). Learn how +/// to [listen for events](https://stripe.com/docs/webhooks) +/// so that your integration can automatically trigger reactions. +/// +/// When using [Connect](https://stripe.com/docs/connect), you can also receive event notifications +/// that occur in connected accounts. For these events, there's an +/// additional `account` attribute in the received `Event` object. +/// +/// We only guarantee access to events through the [Retrieve Event API](https://stripe.com/docs/api#retrieve_event). +/// for 30 days. +/// +/// For more details see <>. +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct Event { + /// The connected account that originates the event. + #[serde(skip_serializing_if = "Option::is_none")] + pub account: Option, + /// The Stripe API version used to render `data`. + /// This property is populated only for events on or after October 31, 2014. + pub api_version: Option, + /// Time at which the object was created. Measured in seconds since the Unix epoch. + pub created: stripe_types::Timestamp, + pub data: stripe_shared::NotificationEventData, + /// Unique identifier for the object. + pub id: stripe_shared::EventId, + /// Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + pub livemode: bool, + /// Number of webhooks that haven't been successfully delivered (for example, to return a 20x response) to the URLs you specify. + pub pending_webhooks: i64, + /// Information on the API request that triggers the event. + pub request: Option, + /// Description of the event (for example, `invoice.created` or `charge.refunded`). + #[serde(rename = "type")] + pub type_: EventType, +} +/// Description of the event (for example, `invoice.created` or `charge.refunded`). +#[derive(Copy, Clone, Eq, PartialEq)] +#[non_exhaustive] +pub enum EventType { + AccountApplicationAuthorized, + AccountApplicationDeauthorized, + AccountExternalAccountCreated, + AccountExternalAccountDeleted, + AccountExternalAccountUpdated, + AccountUpdated, + ApplicationFeeCreated, + ApplicationFeeRefundUpdated, + ApplicationFeeRefunded, + BalanceAvailable, + BillingPortalConfigurationCreated, + BillingPortalConfigurationUpdated, + BillingPortalSessionCreated, + CapabilityUpdated, + CashBalanceFundsAvailable, + ChargeCaptured, + ChargeDisputeClosed, + ChargeDisputeCreated, + ChargeDisputeFundsReinstated, + ChargeDisputeFundsWithdrawn, + ChargeDisputeUpdated, + ChargeExpired, + ChargeFailed, + ChargePending, + ChargeRefundUpdated, + ChargeRefunded, + ChargeSucceeded, + ChargeUpdated, + CheckoutSessionAsyncPaymentFailed, + CheckoutSessionAsyncPaymentSucceeded, + CheckoutSessionCompleted, + CheckoutSessionExpired, + ClimateOrderCanceled, + ClimateOrderCreated, + ClimateOrderDelayed, + ClimateOrderDelivered, + ClimateOrderProductSubstituted, + ClimateProductCreated, + ClimateProductPricingUpdated, + CouponCreated, + CouponDeleted, + CouponUpdated, + CreditNoteCreated, + CreditNoteUpdated, + CreditNoteVoided, + CustomerCreated, + CustomerDeleted, + CustomerDiscountCreated, + CustomerDiscountDeleted, + CustomerDiscountUpdated, + CustomerSourceCreated, + CustomerSourceDeleted, + CustomerSourceExpiring, + CustomerSourceUpdated, + CustomerSubscriptionCreated, + CustomerSubscriptionDeleted, + CustomerSubscriptionPaused, + CustomerSubscriptionPendingUpdateApplied, + CustomerSubscriptionPendingUpdateExpired, + CustomerSubscriptionResumed, + CustomerSubscriptionTrialWillEnd, + CustomerSubscriptionUpdated, + CustomerTaxIdCreated, + CustomerTaxIdDeleted, + CustomerTaxIdUpdated, + CustomerUpdated, + CustomerCashBalanceTransactionCreated, + FileCreated, + FinancialConnectionsAccountCreated, + FinancialConnectionsAccountDeactivated, + FinancialConnectionsAccountDisconnected, + FinancialConnectionsAccountReactivated, + FinancialConnectionsAccountRefreshedBalance, + FinancialConnectionsAccountRefreshedTransactions, + IdentityVerificationSessionCanceled, + IdentityVerificationSessionCreated, + IdentityVerificationSessionProcessing, + IdentityVerificationSessionRedacted, + IdentityVerificationSessionRequiresInput, + IdentityVerificationSessionVerified, + InvoiceCreated, + InvoiceDeleted, + InvoiceFinalizationFailed, + InvoiceFinalized, + InvoiceMarkedUncollectible, + InvoicePaid, + InvoicePaymentActionRequired, + InvoicePaymentFailed, + InvoicePaymentSucceeded, + InvoiceSent, + InvoiceUpcoming, + InvoiceUpdated, + InvoiceVoided, + InvoiceitemCreated, + InvoiceitemDeleted, + IssuingAuthorizationCreated, + IssuingAuthorizationRequest, + IssuingAuthorizationUpdated, + IssuingCardCreated, + IssuingCardUpdated, + IssuingCardholderCreated, + IssuingCardholderUpdated, + IssuingDisputeClosed, + IssuingDisputeCreated, + IssuingDisputeFundsReinstated, + IssuingDisputeSubmitted, + IssuingDisputeUpdated, + IssuingTokenCreated, + IssuingTokenUpdated, + IssuingTransactionCreated, + IssuingTransactionUpdated, + MandateUpdated, + PaymentIntentAmountCapturableUpdated, + PaymentIntentCanceled, + PaymentIntentCreated, + PaymentIntentPartiallyFunded, + PaymentIntentPaymentFailed, + PaymentIntentProcessing, + PaymentIntentRequiresAction, + PaymentIntentSucceeded, + PaymentLinkCreated, + PaymentLinkUpdated, + PaymentMethodAttached, + PaymentMethodAutomaticallyUpdated, + PaymentMethodDetached, + PaymentMethodUpdated, + PayoutCanceled, + PayoutCreated, + PayoutFailed, + PayoutPaid, + PayoutReconciliationCompleted, + PayoutUpdated, + PersonCreated, + PersonDeleted, + PersonUpdated, + PlanCreated, + PlanDeleted, + PlanUpdated, + PriceCreated, + PriceDeleted, + PriceUpdated, + ProductCreated, + ProductDeleted, + ProductUpdated, + PromotionCodeCreated, + PromotionCodeUpdated, + QuoteAccepted, + QuoteCanceled, + QuoteCreated, + QuoteFinalized, + RadarEarlyFraudWarningCreated, + RadarEarlyFraudWarningUpdated, + RefundCreated, + RefundUpdated, + ReportingReportRunFailed, + ReportingReportRunSucceeded, + ReportingReportTypeUpdated, + ReviewClosed, + ReviewOpened, + SetupIntentCanceled, + SetupIntentCreated, + SetupIntentRequiresAction, + SetupIntentSetupFailed, + SetupIntentSucceeded, + SigmaScheduledQueryRunCreated, + SourceCanceled, + SourceChargeable, + SourceFailed, + SourceMandateNotification, + SourceRefundAttributesRequired, + SourceTransactionCreated, + SourceTransactionUpdated, + SubscriptionScheduleAborted, + SubscriptionScheduleCanceled, + SubscriptionScheduleCompleted, + SubscriptionScheduleCreated, + SubscriptionScheduleExpiring, + SubscriptionScheduleReleased, + SubscriptionScheduleUpdated, + TaxSettingsUpdated, + TaxRateCreated, + TaxRateUpdated, + TerminalReaderActionFailed, + TerminalReaderActionSucceeded, + TestHelpersTestClockAdvancing, + TestHelpersTestClockCreated, + TestHelpersTestClockDeleted, + TestHelpersTestClockInternalFailure, + TestHelpersTestClockReady, + TopupCanceled, + TopupCreated, + TopupFailed, + TopupReversed, + TopupSucceeded, + TransferCreated, + TransferReversed, + TransferUpdated, + TreasuryCreditReversalCreated, + TreasuryCreditReversalPosted, + TreasuryDebitReversalCompleted, + TreasuryDebitReversalCreated, + TreasuryDebitReversalInitialCreditGranted, + TreasuryFinancialAccountClosed, + TreasuryFinancialAccountCreated, + TreasuryFinancialAccountFeaturesStatusUpdated, + TreasuryInboundTransferCanceled, + TreasuryInboundTransferCreated, + TreasuryInboundTransferFailed, + TreasuryInboundTransferSucceeded, + TreasuryOutboundPaymentCanceled, + TreasuryOutboundPaymentCreated, + TreasuryOutboundPaymentExpectedArrivalDateUpdated, + TreasuryOutboundPaymentFailed, + TreasuryOutboundPaymentPosted, + TreasuryOutboundPaymentReturned, + TreasuryOutboundTransferCanceled, + TreasuryOutboundTransferCreated, + TreasuryOutboundTransferExpectedArrivalDateUpdated, + TreasuryOutboundTransferFailed, + TreasuryOutboundTransferPosted, + TreasuryOutboundTransferReturned, + TreasuryReceivedCreditCreated, + TreasuryReceivedCreditFailed, + TreasuryReceivedCreditSucceeded, + TreasuryReceivedDebitCreated, + /// An unrecognized value from Stripe. Should not be used as a request parameter. + Unknown, +} +impl EventType { + pub fn as_str(self) -> &'static str { + use EventType::*; + match self { + AccountApplicationAuthorized => "account.application.authorized", + AccountApplicationDeauthorized => "account.application.deauthorized", + AccountExternalAccountCreated => "account.external_account.created", + AccountExternalAccountDeleted => "account.external_account.deleted", + AccountExternalAccountUpdated => "account.external_account.updated", + AccountUpdated => "account.updated", + ApplicationFeeCreated => "application_fee.created", + ApplicationFeeRefundUpdated => "application_fee.refund.updated", + ApplicationFeeRefunded => "application_fee.refunded", + BalanceAvailable => "balance.available", + BillingPortalConfigurationCreated => "billing_portal.configuration.created", + BillingPortalConfigurationUpdated => "billing_portal.configuration.updated", + BillingPortalSessionCreated => "billing_portal.session.created", + CapabilityUpdated => "capability.updated", + CashBalanceFundsAvailable => "cash_balance.funds_available", + ChargeCaptured => "charge.captured", + ChargeDisputeClosed => "charge.dispute.closed", + ChargeDisputeCreated => "charge.dispute.created", + ChargeDisputeFundsReinstated => "charge.dispute.funds_reinstated", + ChargeDisputeFundsWithdrawn => "charge.dispute.funds_withdrawn", + ChargeDisputeUpdated => "charge.dispute.updated", + ChargeExpired => "charge.expired", + ChargeFailed => "charge.failed", + ChargePending => "charge.pending", + ChargeRefundUpdated => "charge.refund.updated", + ChargeRefunded => "charge.refunded", + ChargeSucceeded => "charge.succeeded", + ChargeUpdated => "charge.updated", + CheckoutSessionAsyncPaymentFailed => "checkout.session.async_payment_failed", + CheckoutSessionAsyncPaymentSucceeded => "checkout.session.async_payment_succeeded", + CheckoutSessionCompleted => "checkout.session.completed", + CheckoutSessionExpired => "checkout.session.expired", + ClimateOrderCanceled => "climate.order.canceled", + ClimateOrderCreated => "climate.order.created", + ClimateOrderDelayed => "climate.order.delayed", + ClimateOrderDelivered => "climate.order.delivered", + ClimateOrderProductSubstituted => "climate.order.product_substituted", + ClimateProductCreated => "climate.product.created", + ClimateProductPricingUpdated => "climate.product.pricing_updated", + CouponCreated => "coupon.created", + CouponDeleted => "coupon.deleted", + CouponUpdated => "coupon.updated", + CreditNoteCreated => "credit_note.created", + CreditNoteUpdated => "credit_note.updated", + CreditNoteVoided => "credit_note.voided", + CustomerCreated => "customer.created", + CustomerDeleted => "customer.deleted", + CustomerDiscountCreated => "customer.discount.created", + CustomerDiscountDeleted => "customer.discount.deleted", + CustomerDiscountUpdated => "customer.discount.updated", + CustomerSourceCreated => "customer.source.created", + CustomerSourceDeleted => "customer.source.deleted", + CustomerSourceExpiring => "customer.source.expiring", + CustomerSourceUpdated => "customer.source.updated", + CustomerSubscriptionCreated => "customer.subscription.created", + CustomerSubscriptionDeleted => "customer.subscription.deleted", + CustomerSubscriptionPaused => "customer.subscription.paused", + CustomerSubscriptionPendingUpdateApplied => { + "customer.subscription.pending_update_applied" + } + CustomerSubscriptionPendingUpdateExpired => { + "customer.subscription.pending_update_expired" + } + CustomerSubscriptionResumed => "customer.subscription.resumed", + CustomerSubscriptionTrialWillEnd => "customer.subscription.trial_will_end", + CustomerSubscriptionUpdated => "customer.subscription.updated", + CustomerTaxIdCreated => "customer.tax_id.created", + CustomerTaxIdDeleted => "customer.tax_id.deleted", + CustomerTaxIdUpdated => "customer.tax_id.updated", + CustomerUpdated => "customer.updated", + CustomerCashBalanceTransactionCreated => "customer_cash_balance_transaction.created", + FileCreated => "file.created", + FinancialConnectionsAccountCreated => "financial_connections.account.created", + FinancialConnectionsAccountDeactivated => "financial_connections.account.deactivated", + FinancialConnectionsAccountDisconnected => "financial_connections.account.disconnected", + FinancialConnectionsAccountReactivated => "financial_connections.account.reactivated", + FinancialConnectionsAccountRefreshedBalance => { + "financial_connections.account.refreshed_balance" + } + FinancialConnectionsAccountRefreshedTransactions => { + "financial_connections.account.refreshed_transactions" + } + IdentityVerificationSessionCanceled => "identity.verification_session.canceled", + IdentityVerificationSessionCreated => "identity.verification_session.created", + IdentityVerificationSessionProcessing => "identity.verification_session.processing", + IdentityVerificationSessionRedacted => "identity.verification_session.redacted", + IdentityVerificationSessionRequiresInput => { + "identity.verification_session.requires_input" + } + IdentityVerificationSessionVerified => "identity.verification_session.verified", + InvoiceCreated => "invoice.created", + InvoiceDeleted => "invoice.deleted", + InvoiceFinalizationFailed => "invoice.finalization_failed", + InvoiceFinalized => "invoice.finalized", + InvoiceMarkedUncollectible => "invoice.marked_uncollectible", + InvoicePaid => "invoice.paid", + InvoicePaymentActionRequired => "invoice.payment_action_required", + InvoicePaymentFailed => "invoice.payment_failed", + InvoicePaymentSucceeded => "invoice.payment_succeeded", + InvoiceSent => "invoice.sent", + InvoiceUpcoming => "invoice.upcoming", + InvoiceUpdated => "invoice.updated", + InvoiceVoided => "invoice.voided", + InvoiceitemCreated => "invoiceitem.created", + InvoiceitemDeleted => "invoiceitem.deleted", + IssuingAuthorizationCreated => "issuing_authorization.created", + IssuingAuthorizationRequest => "issuing_authorization.request", + IssuingAuthorizationUpdated => "issuing_authorization.updated", + IssuingCardCreated => "issuing_card.created", + IssuingCardUpdated => "issuing_card.updated", + IssuingCardholderCreated => "issuing_cardholder.created", + IssuingCardholderUpdated => "issuing_cardholder.updated", + IssuingDisputeClosed => "issuing_dispute.closed", + IssuingDisputeCreated => "issuing_dispute.created", + IssuingDisputeFundsReinstated => "issuing_dispute.funds_reinstated", + IssuingDisputeSubmitted => "issuing_dispute.submitted", + IssuingDisputeUpdated => "issuing_dispute.updated", + IssuingTokenCreated => "issuing_token.created", + IssuingTokenUpdated => "issuing_token.updated", + IssuingTransactionCreated => "issuing_transaction.created", + IssuingTransactionUpdated => "issuing_transaction.updated", + MandateUpdated => "mandate.updated", + PaymentIntentAmountCapturableUpdated => "payment_intent.amount_capturable_updated", + PaymentIntentCanceled => "payment_intent.canceled", + PaymentIntentCreated => "payment_intent.created", + PaymentIntentPartiallyFunded => "payment_intent.partially_funded", + PaymentIntentPaymentFailed => "payment_intent.payment_failed", + PaymentIntentProcessing => "payment_intent.processing", + PaymentIntentRequiresAction => "payment_intent.requires_action", + PaymentIntentSucceeded => "payment_intent.succeeded", + PaymentLinkCreated => "payment_link.created", + PaymentLinkUpdated => "payment_link.updated", + PaymentMethodAttached => "payment_method.attached", + PaymentMethodAutomaticallyUpdated => "payment_method.automatically_updated", + PaymentMethodDetached => "payment_method.detached", + PaymentMethodUpdated => "payment_method.updated", + PayoutCanceled => "payout.canceled", + PayoutCreated => "payout.created", + PayoutFailed => "payout.failed", + PayoutPaid => "payout.paid", + PayoutReconciliationCompleted => "payout.reconciliation_completed", + PayoutUpdated => "payout.updated", + PersonCreated => "person.created", + PersonDeleted => "person.deleted", + PersonUpdated => "person.updated", + PlanCreated => "plan.created", + PlanDeleted => "plan.deleted", + PlanUpdated => "plan.updated", + PriceCreated => "price.created", + PriceDeleted => "price.deleted", + PriceUpdated => "price.updated", + ProductCreated => "product.created", + ProductDeleted => "product.deleted", + ProductUpdated => "product.updated", + PromotionCodeCreated => "promotion_code.created", + PromotionCodeUpdated => "promotion_code.updated", + QuoteAccepted => "quote.accepted", + QuoteCanceled => "quote.canceled", + QuoteCreated => "quote.created", + QuoteFinalized => "quote.finalized", + RadarEarlyFraudWarningCreated => "radar.early_fraud_warning.created", + RadarEarlyFraudWarningUpdated => "radar.early_fraud_warning.updated", + RefundCreated => "refund.created", + RefundUpdated => "refund.updated", + ReportingReportRunFailed => "reporting.report_run.failed", + ReportingReportRunSucceeded => "reporting.report_run.succeeded", + ReportingReportTypeUpdated => "reporting.report_type.updated", + ReviewClosed => "review.closed", + ReviewOpened => "review.opened", + SetupIntentCanceled => "setup_intent.canceled", + SetupIntentCreated => "setup_intent.created", + SetupIntentRequiresAction => "setup_intent.requires_action", + SetupIntentSetupFailed => "setup_intent.setup_failed", + SetupIntentSucceeded => "setup_intent.succeeded", + SigmaScheduledQueryRunCreated => "sigma.scheduled_query_run.created", + SourceCanceled => "source.canceled", + SourceChargeable => "source.chargeable", + SourceFailed => "source.failed", + SourceMandateNotification => "source.mandate_notification", + SourceRefundAttributesRequired => "source.refund_attributes_required", + SourceTransactionCreated => "source.transaction.created", + SourceTransactionUpdated => "source.transaction.updated", + SubscriptionScheduleAborted => "subscription_schedule.aborted", + SubscriptionScheduleCanceled => "subscription_schedule.canceled", + SubscriptionScheduleCompleted => "subscription_schedule.completed", + SubscriptionScheduleCreated => "subscription_schedule.created", + SubscriptionScheduleExpiring => "subscription_schedule.expiring", + SubscriptionScheduleReleased => "subscription_schedule.released", + SubscriptionScheduleUpdated => "subscription_schedule.updated", + TaxSettingsUpdated => "tax.settings.updated", + TaxRateCreated => "tax_rate.created", + TaxRateUpdated => "tax_rate.updated", + TerminalReaderActionFailed => "terminal.reader.action_failed", + TerminalReaderActionSucceeded => "terminal.reader.action_succeeded", + TestHelpersTestClockAdvancing => "test_helpers.test_clock.advancing", + TestHelpersTestClockCreated => "test_helpers.test_clock.created", + TestHelpersTestClockDeleted => "test_helpers.test_clock.deleted", + TestHelpersTestClockInternalFailure => "test_helpers.test_clock.internal_failure", + TestHelpersTestClockReady => "test_helpers.test_clock.ready", + TopupCanceled => "topup.canceled", + TopupCreated => "topup.created", + TopupFailed => "topup.failed", + TopupReversed => "topup.reversed", + TopupSucceeded => "topup.succeeded", + TransferCreated => "transfer.created", + TransferReversed => "transfer.reversed", + TransferUpdated => "transfer.updated", + TreasuryCreditReversalCreated => "treasury.credit_reversal.created", + TreasuryCreditReversalPosted => "treasury.credit_reversal.posted", + TreasuryDebitReversalCompleted => "treasury.debit_reversal.completed", + TreasuryDebitReversalCreated => "treasury.debit_reversal.created", + TreasuryDebitReversalInitialCreditGranted => { + "treasury.debit_reversal.initial_credit_granted" + } + TreasuryFinancialAccountClosed => "treasury.financial_account.closed", + TreasuryFinancialAccountCreated => "treasury.financial_account.created", + TreasuryFinancialAccountFeaturesStatusUpdated => { + "treasury.financial_account.features_status_updated" + } + TreasuryInboundTransferCanceled => "treasury.inbound_transfer.canceled", + TreasuryInboundTransferCreated => "treasury.inbound_transfer.created", + TreasuryInboundTransferFailed => "treasury.inbound_transfer.failed", + TreasuryInboundTransferSucceeded => "treasury.inbound_transfer.succeeded", + TreasuryOutboundPaymentCanceled => "treasury.outbound_payment.canceled", + TreasuryOutboundPaymentCreated => "treasury.outbound_payment.created", + TreasuryOutboundPaymentExpectedArrivalDateUpdated => { + "treasury.outbound_payment.expected_arrival_date_updated" + } + TreasuryOutboundPaymentFailed => "treasury.outbound_payment.failed", + TreasuryOutboundPaymentPosted => "treasury.outbound_payment.posted", + TreasuryOutboundPaymentReturned => "treasury.outbound_payment.returned", + TreasuryOutboundTransferCanceled => "treasury.outbound_transfer.canceled", + TreasuryOutboundTransferCreated => "treasury.outbound_transfer.created", + TreasuryOutboundTransferExpectedArrivalDateUpdated => { + "treasury.outbound_transfer.expected_arrival_date_updated" + } + TreasuryOutboundTransferFailed => "treasury.outbound_transfer.failed", + TreasuryOutboundTransferPosted => "treasury.outbound_transfer.posted", + TreasuryOutboundTransferReturned => "treasury.outbound_transfer.returned", + TreasuryReceivedCreditCreated => "treasury.received_credit.created", + TreasuryReceivedCreditFailed => "treasury.received_credit.failed", + TreasuryReceivedCreditSucceeded => "treasury.received_credit.succeeded", + TreasuryReceivedDebitCreated => "treasury.received_debit.created", + Unknown => "unknown", + } + } +} + +impl std::str::FromStr for EventType { + type Err = (); + fn from_str(s: &str) -> Result { + use EventType::*; + match s { + "account.application.authorized" => Ok(AccountApplicationAuthorized), + "account.application.deauthorized" => Ok(AccountApplicationDeauthorized), + "account.external_account.created" => Ok(AccountExternalAccountCreated), + "account.external_account.deleted" => Ok(AccountExternalAccountDeleted), + "account.external_account.updated" => Ok(AccountExternalAccountUpdated), + "account.updated" => Ok(AccountUpdated), + "application_fee.created" => Ok(ApplicationFeeCreated), + "application_fee.refund.updated" => Ok(ApplicationFeeRefundUpdated), + "application_fee.refunded" => Ok(ApplicationFeeRefunded), + "balance.available" => Ok(BalanceAvailable), + "billing_portal.configuration.created" => Ok(BillingPortalConfigurationCreated), + "billing_portal.configuration.updated" => Ok(BillingPortalConfigurationUpdated), + "billing_portal.session.created" => Ok(BillingPortalSessionCreated), + "capability.updated" => Ok(CapabilityUpdated), + "cash_balance.funds_available" => Ok(CashBalanceFundsAvailable), + "charge.captured" => Ok(ChargeCaptured), + "charge.dispute.closed" => Ok(ChargeDisputeClosed), + "charge.dispute.created" => Ok(ChargeDisputeCreated), + "charge.dispute.funds_reinstated" => Ok(ChargeDisputeFundsReinstated), + "charge.dispute.funds_withdrawn" => Ok(ChargeDisputeFundsWithdrawn), + "charge.dispute.updated" => Ok(ChargeDisputeUpdated), + "charge.expired" => Ok(ChargeExpired), + "charge.failed" => Ok(ChargeFailed), + "charge.pending" => Ok(ChargePending), + "charge.refund.updated" => Ok(ChargeRefundUpdated), + "charge.refunded" => Ok(ChargeRefunded), + "charge.succeeded" => Ok(ChargeSucceeded), + "charge.updated" => Ok(ChargeUpdated), + "checkout.session.async_payment_failed" => Ok(CheckoutSessionAsyncPaymentFailed), + "checkout.session.async_payment_succeeded" => Ok(CheckoutSessionAsyncPaymentSucceeded), + "checkout.session.completed" => Ok(CheckoutSessionCompleted), + "checkout.session.expired" => Ok(CheckoutSessionExpired), + "climate.order.canceled" => Ok(ClimateOrderCanceled), + "climate.order.created" => Ok(ClimateOrderCreated), + "climate.order.delayed" => Ok(ClimateOrderDelayed), + "climate.order.delivered" => Ok(ClimateOrderDelivered), + "climate.order.product_substituted" => Ok(ClimateOrderProductSubstituted), + "climate.product.created" => Ok(ClimateProductCreated), + "climate.product.pricing_updated" => Ok(ClimateProductPricingUpdated), + "coupon.created" => Ok(CouponCreated), + "coupon.deleted" => Ok(CouponDeleted), + "coupon.updated" => Ok(CouponUpdated), + "credit_note.created" => Ok(CreditNoteCreated), + "credit_note.updated" => Ok(CreditNoteUpdated), + "credit_note.voided" => Ok(CreditNoteVoided), + "customer.created" => Ok(CustomerCreated), + "customer.deleted" => Ok(CustomerDeleted), + "customer.discount.created" => Ok(CustomerDiscountCreated), + "customer.discount.deleted" => Ok(CustomerDiscountDeleted), + "customer.discount.updated" => Ok(CustomerDiscountUpdated), + "customer.source.created" => Ok(CustomerSourceCreated), + "customer.source.deleted" => Ok(CustomerSourceDeleted), + "customer.source.expiring" => Ok(CustomerSourceExpiring), + "customer.source.updated" => Ok(CustomerSourceUpdated), + "customer.subscription.created" => Ok(CustomerSubscriptionCreated), + "customer.subscription.deleted" => Ok(CustomerSubscriptionDeleted), + "customer.subscription.paused" => Ok(CustomerSubscriptionPaused), + "customer.subscription.pending_update_applied" => { + Ok(CustomerSubscriptionPendingUpdateApplied) + } + "customer.subscription.pending_update_expired" => { + Ok(CustomerSubscriptionPendingUpdateExpired) + } + "customer.subscription.resumed" => Ok(CustomerSubscriptionResumed), + "customer.subscription.trial_will_end" => Ok(CustomerSubscriptionTrialWillEnd), + "customer.subscription.updated" => Ok(CustomerSubscriptionUpdated), + "customer.tax_id.created" => Ok(CustomerTaxIdCreated), + "customer.tax_id.deleted" => Ok(CustomerTaxIdDeleted), + "customer.tax_id.updated" => Ok(CustomerTaxIdUpdated), + "customer.updated" => Ok(CustomerUpdated), + "customer_cash_balance_transaction.created" => { + Ok(CustomerCashBalanceTransactionCreated) + } + "file.created" => Ok(FileCreated), + "financial_connections.account.created" => Ok(FinancialConnectionsAccountCreated), + "financial_connections.account.deactivated" => { + Ok(FinancialConnectionsAccountDeactivated) + } + "financial_connections.account.disconnected" => { + Ok(FinancialConnectionsAccountDisconnected) + } + "financial_connections.account.reactivated" => { + Ok(FinancialConnectionsAccountReactivated) + } + "financial_connections.account.refreshed_balance" => { + Ok(FinancialConnectionsAccountRefreshedBalance) + } + "financial_connections.account.refreshed_transactions" => { + Ok(FinancialConnectionsAccountRefreshedTransactions) + } + "identity.verification_session.canceled" => Ok(IdentityVerificationSessionCanceled), + "identity.verification_session.created" => Ok(IdentityVerificationSessionCreated), + "identity.verification_session.processing" => Ok(IdentityVerificationSessionProcessing), + "identity.verification_session.redacted" => Ok(IdentityVerificationSessionRedacted), + "identity.verification_session.requires_input" => { + Ok(IdentityVerificationSessionRequiresInput) + } + "identity.verification_session.verified" => Ok(IdentityVerificationSessionVerified), + "invoice.created" => Ok(InvoiceCreated), + "invoice.deleted" => Ok(InvoiceDeleted), + "invoice.finalization_failed" => Ok(InvoiceFinalizationFailed), + "invoice.finalized" => Ok(InvoiceFinalized), + "invoice.marked_uncollectible" => Ok(InvoiceMarkedUncollectible), + "invoice.paid" => Ok(InvoicePaid), + "invoice.payment_action_required" => Ok(InvoicePaymentActionRequired), + "invoice.payment_failed" => Ok(InvoicePaymentFailed), + "invoice.payment_succeeded" => Ok(InvoicePaymentSucceeded), + "invoice.sent" => Ok(InvoiceSent), + "invoice.upcoming" => Ok(InvoiceUpcoming), + "invoice.updated" => Ok(InvoiceUpdated), + "invoice.voided" => Ok(InvoiceVoided), + "invoiceitem.created" => Ok(InvoiceitemCreated), + "invoiceitem.deleted" => Ok(InvoiceitemDeleted), + "issuing_authorization.created" => Ok(IssuingAuthorizationCreated), + "issuing_authorization.request" => Ok(IssuingAuthorizationRequest), + "issuing_authorization.updated" => Ok(IssuingAuthorizationUpdated), + "issuing_card.created" => Ok(IssuingCardCreated), + "issuing_card.updated" => Ok(IssuingCardUpdated), + "issuing_cardholder.created" => Ok(IssuingCardholderCreated), + "issuing_cardholder.updated" => Ok(IssuingCardholderUpdated), + "issuing_dispute.closed" => Ok(IssuingDisputeClosed), + "issuing_dispute.created" => Ok(IssuingDisputeCreated), + "issuing_dispute.funds_reinstated" => Ok(IssuingDisputeFundsReinstated), + "issuing_dispute.submitted" => Ok(IssuingDisputeSubmitted), + "issuing_dispute.updated" => Ok(IssuingDisputeUpdated), + "issuing_token.created" => Ok(IssuingTokenCreated), + "issuing_token.updated" => Ok(IssuingTokenUpdated), + "issuing_transaction.created" => Ok(IssuingTransactionCreated), + "issuing_transaction.updated" => Ok(IssuingTransactionUpdated), + "mandate.updated" => Ok(MandateUpdated), + "payment_intent.amount_capturable_updated" => Ok(PaymentIntentAmountCapturableUpdated), + "payment_intent.canceled" => Ok(PaymentIntentCanceled), + "payment_intent.created" => Ok(PaymentIntentCreated), + "payment_intent.partially_funded" => Ok(PaymentIntentPartiallyFunded), + "payment_intent.payment_failed" => Ok(PaymentIntentPaymentFailed), + "payment_intent.processing" => Ok(PaymentIntentProcessing), + "payment_intent.requires_action" => Ok(PaymentIntentRequiresAction), + "payment_intent.succeeded" => Ok(PaymentIntentSucceeded), + "payment_link.created" => Ok(PaymentLinkCreated), + "payment_link.updated" => Ok(PaymentLinkUpdated), + "payment_method.attached" => Ok(PaymentMethodAttached), + "payment_method.automatically_updated" => Ok(PaymentMethodAutomaticallyUpdated), + "payment_method.detached" => Ok(PaymentMethodDetached), + "payment_method.updated" => Ok(PaymentMethodUpdated), + "payout.canceled" => Ok(PayoutCanceled), + "payout.created" => Ok(PayoutCreated), + "payout.failed" => Ok(PayoutFailed), + "payout.paid" => Ok(PayoutPaid), + "payout.reconciliation_completed" => Ok(PayoutReconciliationCompleted), + "payout.updated" => Ok(PayoutUpdated), + "person.created" => Ok(PersonCreated), + "person.deleted" => Ok(PersonDeleted), + "person.updated" => Ok(PersonUpdated), + "plan.created" => Ok(PlanCreated), + "plan.deleted" => Ok(PlanDeleted), + "plan.updated" => Ok(PlanUpdated), + "price.created" => Ok(PriceCreated), + "price.deleted" => Ok(PriceDeleted), + "price.updated" => Ok(PriceUpdated), + "product.created" => Ok(ProductCreated), + "product.deleted" => Ok(ProductDeleted), + "product.updated" => Ok(ProductUpdated), + "promotion_code.created" => Ok(PromotionCodeCreated), + "promotion_code.updated" => Ok(PromotionCodeUpdated), + "quote.accepted" => Ok(QuoteAccepted), + "quote.canceled" => Ok(QuoteCanceled), + "quote.created" => Ok(QuoteCreated), + "quote.finalized" => Ok(QuoteFinalized), + "radar.early_fraud_warning.created" => Ok(RadarEarlyFraudWarningCreated), + "radar.early_fraud_warning.updated" => Ok(RadarEarlyFraudWarningUpdated), + "refund.created" => Ok(RefundCreated), + "refund.updated" => Ok(RefundUpdated), + "reporting.report_run.failed" => Ok(ReportingReportRunFailed), + "reporting.report_run.succeeded" => Ok(ReportingReportRunSucceeded), + "reporting.report_type.updated" => Ok(ReportingReportTypeUpdated), + "review.closed" => Ok(ReviewClosed), + "review.opened" => Ok(ReviewOpened), + "setup_intent.canceled" => Ok(SetupIntentCanceled), + "setup_intent.created" => Ok(SetupIntentCreated), + "setup_intent.requires_action" => Ok(SetupIntentRequiresAction), + "setup_intent.setup_failed" => Ok(SetupIntentSetupFailed), + "setup_intent.succeeded" => Ok(SetupIntentSucceeded), + "sigma.scheduled_query_run.created" => Ok(SigmaScheduledQueryRunCreated), + "source.canceled" => Ok(SourceCanceled), + "source.chargeable" => Ok(SourceChargeable), + "source.failed" => Ok(SourceFailed), + "source.mandate_notification" => Ok(SourceMandateNotification), + "source.refund_attributes_required" => Ok(SourceRefundAttributesRequired), + "source.transaction.created" => Ok(SourceTransactionCreated), + "source.transaction.updated" => Ok(SourceTransactionUpdated), + "subscription_schedule.aborted" => Ok(SubscriptionScheduleAborted), + "subscription_schedule.canceled" => Ok(SubscriptionScheduleCanceled), + "subscription_schedule.completed" => Ok(SubscriptionScheduleCompleted), + "subscription_schedule.created" => Ok(SubscriptionScheduleCreated), + "subscription_schedule.expiring" => Ok(SubscriptionScheduleExpiring), + "subscription_schedule.released" => Ok(SubscriptionScheduleReleased), + "subscription_schedule.updated" => Ok(SubscriptionScheduleUpdated), + "tax.settings.updated" => Ok(TaxSettingsUpdated), + "tax_rate.created" => Ok(TaxRateCreated), + "tax_rate.updated" => Ok(TaxRateUpdated), + "terminal.reader.action_failed" => Ok(TerminalReaderActionFailed), + "terminal.reader.action_succeeded" => Ok(TerminalReaderActionSucceeded), + "test_helpers.test_clock.advancing" => Ok(TestHelpersTestClockAdvancing), + "test_helpers.test_clock.created" => Ok(TestHelpersTestClockCreated), + "test_helpers.test_clock.deleted" => Ok(TestHelpersTestClockDeleted), + "test_helpers.test_clock.internal_failure" => Ok(TestHelpersTestClockInternalFailure), + "test_helpers.test_clock.ready" => Ok(TestHelpersTestClockReady), + "topup.canceled" => Ok(TopupCanceled), + "topup.created" => Ok(TopupCreated), + "topup.failed" => Ok(TopupFailed), + "topup.reversed" => Ok(TopupReversed), + "topup.succeeded" => Ok(TopupSucceeded), + "transfer.created" => Ok(TransferCreated), + "transfer.reversed" => Ok(TransferReversed), + "transfer.updated" => Ok(TransferUpdated), + "treasury.credit_reversal.created" => Ok(TreasuryCreditReversalCreated), + "treasury.credit_reversal.posted" => Ok(TreasuryCreditReversalPosted), + "treasury.debit_reversal.completed" => Ok(TreasuryDebitReversalCompleted), + "treasury.debit_reversal.created" => Ok(TreasuryDebitReversalCreated), + "treasury.debit_reversal.initial_credit_granted" => { + Ok(TreasuryDebitReversalInitialCreditGranted) + } + "treasury.financial_account.closed" => Ok(TreasuryFinancialAccountClosed), + "treasury.financial_account.created" => Ok(TreasuryFinancialAccountCreated), + "treasury.financial_account.features_status_updated" => { + Ok(TreasuryFinancialAccountFeaturesStatusUpdated) + } + "treasury.inbound_transfer.canceled" => Ok(TreasuryInboundTransferCanceled), + "treasury.inbound_transfer.created" => Ok(TreasuryInboundTransferCreated), + "treasury.inbound_transfer.failed" => Ok(TreasuryInboundTransferFailed), + "treasury.inbound_transfer.succeeded" => Ok(TreasuryInboundTransferSucceeded), + "treasury.outbound_payment.canceled" => Ok(TreasuryOutboundPaymentCanceled), + "treasury.outbound_payment.created" => Ok(TreasuryOutboundPaymentCreated), + "treasury.outbound_payment.expected_arrival_date_updated" => { + Ok(TreasuryOutboundPaymentExpectedArrivalDateUpdated) + } + "treasury.outbound_payment.failed" => Ok(TreasuryOutboundPaymentFailed), + "treasury.outbound_payment.posted" => Ok(TreasuryOutboundPaymentPosted), + "treasury.outbound_payment.returned" => Ok(TreasuryOutboundPaymentReturned), + "treasury.outbound_transfer.canceled" => Ok(TreasuryOutboundTransferCanceled), + "treasury.outbound_transfer.created" => Ok(TreasuryOutboundTransferCreated), + "treasury.outbound_transfer.expected_arrival_date_updated" => { + Ok(TreasuryOutboundTransferExpectedArrivalDateUpdated) + } + "treasury.outbound_transfer.failed" => Ok(TreasuryOutboundTransferFailed), + "treasury.outbound_transfer.posted" => Ok(TreasuryOutboundTransferPosted), + "treasury.outbound_transfer.returned" => Ok(TreasuryOutboundTransferReturned), + "treasury.received_credit.created" => Ok(TreasuryReceivedCreditCreated), + "treasury.received_credit.failed" => Ok(TreasuryReceivedCreditFailed), + "treasury.received_credit.succeeded" => Ok(TreasuryReceivedCreditSucceeded), + "treasury.received_debit.created" => Ok(TreasuryReceivedDebitCreated), + _ => Err(()), + } + } +} +impl std::fmt::Display for EventType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for EventType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for EventType { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for EventType { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Ok(Self::from_str(&s).unwrap_or(EventType::Unknown)) + } +} +impl stripe_types::Object for Event { + type Id = stripe_shared::EventId; + fn id(&self) -> &Self::Id { + &self.id + } +} +stripe_types::def_id!(EventId, "evt_"); diff --git a/generated/stripe_shared/src/external_account.rs b/generated/stripe_shared/src/external_account.rs new file mode 100644 index 000000000..60ea6a327 --- /dev/null +++ b/generated/stripe_shared/src/external_account.rs @@ -0,0 +1,18 @@ +/// The resource representing a Stripe Polymorphic +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +#[serde(tag = "object")] +pub enum ExternalAccount { + #[serde(rename = "bank_account")] + BankAccount(stripe_shared::BankAccount), + #[serde(rename = "card")] + Card(stripe_shared::Card), +} +impl stripe_types::Object for ExternalAccount { + type Id = smol_str::SmolStr; + fn id(&self) -> &Self::Id { + match self { + Self::BankAccount(v) => v.id.inner(), + Self::Card(v) => v.id.inner(), + } + } +} diff --git a/generated/stripe_shared/src/external_account_requirements.rs b/generated/stripe_shared/src/external_account_requirements.rs new file mode 100644 index 000000000..2cc4aa592 --- /dev/null +++ b/generated/stripe_shared/src/external_account_requirements.rs @@ -0,0 +1,15 @@ +#[derive(Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct ExternalAccountRequirements { + /// Fields that need to be collected to keep the external account enabled. + /// If not collected by `current_deadline`, these fields appear in `past_due` as well, and the account is disabled. + pub currently_due: Option>, + /// Fields that are `currently_due` and need to be collected again because validation or verification failed. + pub errors: Option>, + /// Fields that weren't collected by `current_deadline`. + /// These fields need to be collected to enable the external account. + pub past_due: Option>, + /// Fields that may become required depending on the results of verification or review. + /// Will be an empty array unless an asynchronous verification is pending. + /// If verification fails, these fields move to `eventually_due`, `currently_due`, or `past_due`. + pub pending_verification: Option>, +} diff --git a/generated/stripe_shared/src/fee.rs b/generated/stripe_shared/src/fee.rs new file mode 100644 index 000000000..203adf736 --- /dev/null +++ b/generated/stripe_shared/src/fee.rs @@ -0,0 +1,15 @@ +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct Fee { + /// Amount of the fee, in cents. + pub amount: i64, + /// ID of the Connect application that earned the fee. + pub application: Option, + /// Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. + /// Must be a [supported currency](https://stripe.com/docs/currencies). + pub currency: stripe_types::Currency, + /// An arbitrary string attached to the object. Often useful for displaying to users. + pub description: Option, + /// Type of the fee, one of: `application_fee`, `stripe_fee` or `tax`. + #[serde(rename = "type")] + pub type_: String, +} diff --git a/generated/stripe_shared/src/file.rs b/generated/stripe_shared/src/file.rs new file mode 100644 index 000000000..316ea89bb --- /dev/null +++ b/generated/stripe_shared/src/file.rs @@ -0,0 +1,136 @@ +/// This object represents files hosted on Stripe's servers. You can upload +/// files with the [create file](https://stripe.com/docs/api#create_file) request +/// (for example, when uploading dispute evidence). Stripe also +/// creates files independently (for example, the results of a [Sigma scheduled +/// query](#scheduled_queries)). +/// +/// Related guide: [File upload guide](https://stripe.com/docs/file-upload) +/// +/// For more details see <>. +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct File { + /// Time at which the object was created. Measured in seconds since the Unix epoch. + pub created: stripe_types::Timestamp, + /// The file expires and isn't available at this time in epoch seconds. + pub expires_at: Option, + /// The suitable name for saving the file to a filesystem. + pub filename: Option, + /// Unique identifier for the object. + pub id: stripe_shared::FileId, + /// A list of [file links](https://stripe.com/docs/api#file_links) that point at this file. + #[serde(skip_serializing_if = "Option::is_none")] + pub links: Option>, + /// The [purpose](https://stripe.com/docs/file-upload#uploading-a-file) of the uploaded file. + pub purpose: stripe_shared::FilePurpose, + /// The size of the file object in bytes. + pub size: u64, + /// A suitable title for the document. + pub title: Option, + /// The returned file type (for example, `csv`, `pdf`, `jpg`, or `png`). + #[serde(rename = "type")] + pub type_: Option, + /// Use your live secret API key to download the file from this URL. + pub url: Option, +} +impl stripe_types::Object for File { + type Id = stripe_shared::FileId; + fn id(&self) -> &Self::Id { + &self.id + } +} +stripe_types::def_id!(FileId, "file_"); +#[derive(Copy, Clone, Eq, PartialEq)] +#[non_exhaustive] +pub enum FilePurpose { + AccountRequirement, + AdditionalVerification, + BusinessIcon, + BusinessLogo, + CustomerSignature, + DisputeEvidence, + DocumentProviderIdentityDocument, + FinanceReportRun, + IdentityDocument, + IdentityDocumentDownloadable, + PciDocument, + Selfie, + SigmaScheduledQuery, + TaxDocumentUserUpload, + TerminalReaderSplashscreen, + /// An unrecognized value from Stripe. Should not be used as a request parameter. + Unknown, +} +impl FilePurpose { + pub fn as_str(self) -> &'static str { + use FilePurpose::*; + match self { + AccountRequirement => "account_requirement", + AdditionalVerification => "additional_verification", + BusinessIcon => "business_icon", + BusinessLogo => "business_logo", + CustomerSignature => "customer_signature", + DisputeEvidence => "dispute_evidence", + DocumentProviderIdentityDocument => "document_provider_identity_document", + FinanceReportRun => "finance_report_run", + IdentityDocument => "identity_document", + IdentityDocumentDownloadable => "identity_document_downloadable", + PciDocument => "pci_document", + Selfie => "selfie", + SigmaScheduledQuery => "sigma_scheduled_query", + TaxDocumentUserUpload => "tax_document_user_upload", + TerminalReaderSplashscreen => "terminal_reader_splashscreen", + Unknown => "unknown", + } + } +} + +impl std::str::FromStr for FilePurpose { + type Err = (); + fn from_str(s: &str) -> Result { + use FilePurpose::*; + match s { + "account_requirement" => Ok(AccountRequirement), + "additional_verification" => Ok(AdditionalVerification), + "business_icon" => Ok(BusinessIcon), + "business_logo" => Ok(BusinessLogo), + "customer_signature" => Ok(CustomerSignature), + "dispute_evidence" => Ok(DisputeEvidence), + "document_provider_identity_document" => Ok(DocumentProviderIdentityDocument), + "finance_report_run" => Ok(FinanceReportRun), + "identity_document" => Ok(IdentityDocument), + "identity_document_downloadable" => Ok(IdentityDocumentDownloadable), + "pci_document" => Ok(PciDocument), + "selfie" => Ok(Selfie), + "sigma_scheduled_query" => Ok(SigmaScheduledQuery), + "tax_document_user_upload" => Ok(TaxDocumentUserUpload), + "terminal_reader_splashscreen" => Ok(TerminalReaderSplashscreen), + _ => Err(()), + } + } +} +impl std::fmt::Display for FilePurpose { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for FilePurpose { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for FilePurpose { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for FilePurpose { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Ok(Self::from_str(&s).unwrap_or(FilePurpose::Unknown)) + } +} diff --git a/generated/stripe_shared/src/file_link.rs b/generated/stripe_shared/src/file_link.rs new file mode 100644 index 000000000..79c569794 --- /dev/null +++ b/generated/stripe_shared/src/file_link.rs @@ -0,0 +1,32 @@ +/// To share the contents of a `File` object with non-Stripe users, you can +/// create a `FileLink`. `FileLink`s contain a URL that you can use to +/// retrieve the contents of the file without authentication. +/// +/// For more details see <>. +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct FileLink { + /// Time at which the object was created. Measured in seconds since the Unix epoch. + pub created: stripe_types::Timestamp, + /// Returns if the link is already expired. + pub expired: bool, + /// Time that the link expires. + pub expires_at: Option, + /// The file object this link points to. + pub file: stripe_types::Expandable, + /// Unique identifier for the object. + pub id: stripe_shared::FileLinkId, + /// Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + pub livemode: bool, + /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. + /// This can be useful for storing additional information about the object in a structured format. + pub metadata: std::collections::HashMap, + /// The publicly accessible URL to download the file. + pub url: Option, +} +impl stripe_types::Object for FileLink { + type Id = stripe_shared::FileLinkId; + fn id(&self) -> &Self::Id { + &self.id + } +} +stripe_types::def_id!(FileLinkId, "link_"); diff --git a/generated/stripe_shared/src/funding_instructions.rs b/generated/stripe_shared/src/funding_instructions.rs new file mode 100644 index 000000000..1c24cbf80 --- /dev/null +++ b/generated/stripe_shared/src/funding_instructions.rs @@ -0,0 +1,68 @@ +/// Each customer has a [`balance`](https://stripe.com/docs/api/customers/object#customer_object-balance) that is. +/// automatically applied to future invoices and payments using the `customer_balance` payment method. +/// Customers can fund this balance by initiating a bank transfer to any account in the +/// `financial_addresses` field. +/// Related guide: [Customer balance funding instructions](https://stripe.com/docs/payments/customer-balance/funding-instructions). +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct FundingInstructions { + pub bank_transfer: stripe_shared::FundingInstructionsBankTransfer, + /// Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. + /// Must be a [supported currency](https://stripe.com/docs/currencies). + pub currency: stripe_types::Currency, + /// The `funding_type` of the returned instructions + pub funding_type: FundingInstructionsFundingType, + /// Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + pub livemode: bool, +} +/// The `funding_type` of the returned instructions +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum FundingInstructionsFundingType { + BankTransfer, +} +impl FundingInstructionsFundingType { + pub fn as_str(self) -> &'static str { + use FundingInstructionsFundingType::*; + match self { + BankTransfer => "bank_transfer", + } + } +} + +impl std::str::FromStr for FundingInstructionsFundingType { + type Err = (); + fn from_str(s: &str) -> Result { + use FundingInstructionsFundingType::*; + match s { + "bank_transfer" => Ok(BankTransfer), + _ => Err(()), + } + } +} +impl std::fmt::Display for FundingInstructionsFundingType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for FundingInstructionsFundingType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for FundingInstructionsFundingType { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for FundingInstructionsFundingType { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| { + serde::de::Error::custom("Unknown value for FundingInstructionsFundingType") + }) + } +} diff --git a/generated/stripe_shared/src/funding_instructions_bank_transfer.rs b/generated/stripe_shared/src/funding_instructions_bank_transfer.rs new file mode 100644 index 000000000..3556b6569 --- /dev/null +++ b/generated/stripe_shared/src/funding_instructions_bank_transfer.rs @@ -0,0 +1,65 @@ +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct FundingInstructionsBankTransfer { + /// The country of the bank account to fund + pub country: String, + /// A list of financial addresses that can be used to fund a particular balance + pub financial_addresses: Vec, + /// The bank_transfer type + #[serde(rename = "type")] + pub type_: FundingInstructionsBankTransferType, +} +/// The bank_transfer type +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum FundingInstructionsBankTransferType { + EuBankTransfer, + JpBankTransfer, +} +impl FundingInstructionsBankTransferType { + pub fn as_str(self) -> &'static str { + use FundingInstructionsBankTransferType::*; + match self { + EuBankTransfer => "eu_bank_transfer", + JpBankTransfer => "jp_bank_transfer", + } + } +} + +impl std::str::FromStr for FundingInstructionsBankTransferType { + type Err = (); + fn from_str(s: &str) -> Result { + use FundingInstructionsBankTransferType::*; + match s { + "eu_bank_transfer" => Ok(EuBankTransfer), + "jp_bank_transfer" => Ok(JpBankTransfer), + _ => Err(()), + } + } +} +impl std::fmt::Display for FundingInstructionsBankTransferType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for FundingInstructionsBankTransferType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for FundingInstructionsBankTransferType { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for FundingInstructionsBankTransferType { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| { + serde::de::Error::custom("Unknown value for FundingInstructionsBankTransferType") + }) + } +} diff --git a/generated/stripe_shared/src/funding_instructions_bank_transfer_aba_record.rs b/generated/stripe_shared/src/funding_instructions_bank_transfer_aba_record.rs new file mode 100644 index 000000000..7d573bf59 --- /dev/null +++ b/generated/stripe_shared/src/funding_instructions_bank_transfer_aba_record.rs @@ -0,0 +1,10 @@ +/// ABA Records contain U.S. bank account details per the ABA format. +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct FundingInstructionsBankTransferAbaRecord { + /// The ABA account number + pub account_number: String, + /// The bank name + pub bank_name: String, + /// The ABA routing number + pub routing_number: String, +} diff --git a/generated/stripe_shared/src/funding_instructions_bank_transfer_financial_address.rs b/generated/stripe_shared/src/funding_instructions_bank_transfer_financial_address.rs new file mode 100644 index 000000000..e3967d1e3 --- /dev/null +++ b/generated/stripe_shared/src/funding_instructions_bank_transfer_financial_address.rs @@ -0,0 +1,165 @@ +/// FinancialAddresses contain identifying information that resolves to a FinancialAccount. +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct FundingInstructionsBankTransferFinancialAddress { + #[serde(skip_serializing_if = "Option::is_none")] + pub aba: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub iban: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub sort_code: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub spei: Option, + /// The payment networks supported by this FinancialAddress + #[serde(skip_serializing_if = "Option::is_none")] + pub supported_networks: + Option>, + #[serde(skip_serializing_if = "Option::is_none")] + pub swift: Option, + /// The type of financial address + #[serde(rename = "type")] + pub type_: FundingInstructionsBankTransferFinancialAddressType, + #[serde(skip_serializing_if = "Option::is_none")] + pub zengin: Option, +} +/// The payment networks supported by this FinancialAddress +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum FundingInstructionsBankTransferFinancialAddressSupportedNetworks { + Ach, + Bacs, + DomesticWireUs, + Fps, + Sepa, + Spei, + Swift, + Zengin, +} +impl FundingInstructionsBankTransferFinancialAddressSupportedNetworks { + pub fn as_str(self) -> &'static str { + use FundingInstructionsBankTransferFinancialAddressSupportedNetworks::*; + match self { + Ach => "ach", + Bacs => "bacs", + DomesticWireUs => "domestic_wire_us", + Fps => "fps", + Sepa => "sepa", + Spei => "spei", + Swift => "swift", + Zengin => "zengin", + } + } +} + +impl std::str::FromStr for FundingInstructionsBankTransferFinancialAddressSupportedNetworks { + type Err = (); + fn from_str(s: &str) -> Result { + use FundingInstructionsBankTransferFinancialAddressSupportedNetworks::*; + match s { + "ach" => Ok(Ach), + "bacs" => Ok(Bacs), + "domestic_wire_us" => Ok(DomesticWireUs), + "fps" => Ok(Fps), + "sepa" => Ok(Sepa), + "spei" => Ok(Spei), + "swift" => Ok(Swift), + "zengin" => Ok(Zengin), + _ => Err(()), + } + } +} +impl std::fmt::Display for FundingInstructionsBankTransferFinancialAddressSupportedNetworks { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for FundingInstructionsBankTransferFinancialAddressSupportedNetworks { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for FundingInstructionsBankTransferFinancialAddressSupportedNetworks { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> + for FundingInstructionsBankTransferFinancialAddressSupportedNetworks +{ + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for FundingInstructionsBankTransferFinancialAddressSupportedNetworks")) + } +} +/// The type of financial address +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum FundingInstructionsBankTransferFinancialAddressType { + Aba, + Iban, + SortCode, + Spei, + Swift, + Zengin, +} +impl FundingInstructionsBankTransferFinancialAddressType { + pub fn as_str(self) -> &'static str { + use FundingInstructionsBankTransferFinancialAddressType::*; + match self { + Aba => "aba", + Iban => "iban", + SortCode => "sort_code", + Spei => "spei", + Swift => "swift", + Zengin => "zengin", + } + } +} + +impl std::str::FromStr for FundingInstructionsBankTransferFinancialAddressType { + type Err = (); + fn from_str(s: &str) -> Result { + use FundingInstructionsBankTransferFinancialAddressType::*; + match s { + "aba" => Ok(Aba), + "iban" => Ok(Iban), + "sort_code" => Ok(SortCode), + "spei" => Ok(Spei), + "swift" => Ok(Swift), + "zengin" => Ok(Zengin), + _ => Err(()), + } + } +} +impl std::fmt::Display for FundingInstructionsBankTransferFinancialAddressType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for FundingInstructionsBankTransferFinancialAddressType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for FundingInstructionsBankTransferFinancialAddressType { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for FundingInstructionsBankTransferFinancialAddressType { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| { + serde::de::Error::custom( + "Unknown value for FundingInstructionsBankTransferFinancialAddressType", + ) + }) + } +} diff --git a/generated/stripe_shared/src/funding_instructions_bank_transfer_iban_record.rs b/generated/stripe_shared/src/funding_instructions_bank_transfer_iban_record.rs new file mode 100644 index 000000000..271653c71 --- /dev/null +++ b/generated/stripe_shared/src/funding_instructions_bank_transfer_iban_record.rs @@ -0,0 +1,12 @@ +/// Iban Records contain E.U. bank account details per the SEPA format. +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct FundingInstructionsBankTransferIbanRecord { + /// The name of the person or business that owns the bank account + pub account_holder_name: String, + /// The BIC/SWIFT code of the account. + pub bic: String, + /// Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). + pub country: String, + /// The IBAN of the account. + pub iban: String, +} diff --git a/generated/stripe_shared/src/funding_instructions_bank_transfer_sort_code_record.rs b/generated/stripe_shared/src/funding_instructions_bank_transfer_sort_code_record.rs new file mode 100644 index 000000000..64c33de14 --- /dev/null +++ b/generated/stripe_shared/src/funding_instructions_bank_transfer_sort_code_record.rs @@ -0,0 +1,10 @@ +/// Sort Code Records contain U.K. bank account details per the sort code format. +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct FundingInstructionsBankTransferSortCodeRecord { + /// The name of the person or business that owns the bank account + pub account_holder_name: String, + /// The account number + pub account_number: String, + /// The six-digit sort code + pub sort_code: String, +} diff --git a/generated/stripe_shared/src/funding_instructions_bank_transfer_spei_record.rs b/generated/stripe_shared/src/funding_instructions_bank_transfer_spei_record.rs new file mode 100644 index 000000000..bce20ff9f --- /dev/null +++ b/generated/stripe_shared/src/funding_instructions_bank_transfer_spei_record.rs @@ -0,0 +1,10 @@ +/// SPEI Records contain Mexico bank account details per the SPEI format. +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct FundingInstructionsBankTransferSpeiRecord { + /// The three-digit bank code + pub bank_code: String, + /// The short banking institution name + pub bank_name: String, + /// The CLABE number + pub clabe: String, +} diff --git a/generated/stripe_shared/src/funding_instructions_bank_transfer_swift_record.rs b/generated/stripe_shared/src/funding_instructions_bank_transfer_swift_record.rs new file mode 100644 index 000000000..458b7e023 --- /dev/null +++ b/generated/stripe_shared/src/funding_instructions_bank_transfer_swift_record.rs @@ -0,0 +1,10 @@ +/// SWIFT Records contain U.S. bank account details per the SWIFT format. +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct FundingInstructionsBankTransferSwiftRecord { + /// The account number + pub account_number: String, + /// The bank name + pub bank_name: String, + /// The SWIFT code + pub swift_code: String, +} diff --git a/generated/stripe_shared/src/funding_instructions_bank_transfer_zengin_record.rs b/generated/stripe_shared/src/funding_instructions_bank_transfer_zengin_record.rs new file mode 100644 index 000000000..a50e1be8d --- /dev/null +++ b/generated/stripe_shared/src/funding_instructions_bank_transfer_zengin_record.rs @@ -0,0 +1,18 @@ +/// Zengin Records contain Japan bank account details per the Zengin format. +#[derive(Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct FundingInstructionsBankTransferZenginRecord { + /// The account holder name + pub account_holder_name: Option, + /// The account number + pub account_number: Option, + /// The bank account type. In Japan, this can only be `futsu` or `toza`. + pub account_type: Option, + /// The bank code of the account + pub bank_code: Option, + /// The bank name of the account + pub bank_name: Option, + /// The branch code of the account + pub branch_code: Option, + /// The branch name of the account + pub branch_name: Option, +} diff --git a/generated/stripe_shared/src/invoice.rs b/generated/stripe_shared/src/invoice.rs new file mode 100644 index 000000000..05578f764 --- /dev/null +++ b/generated/stripe_shared/src/invoice.rs @@ -0,0 +1,539 @@ +/// Invoices are statements of amounts owed by a customer, and are either +/// generated one-off, or generated periodically from a subscription. +/// +/// They contain [invoice items](https://stripe.com/docs/api#invoiceitems), and proration adjustments +/// that may be caused by subscription upgrades/downgrades (if necessary). +/// +/// If your invoice is configured to be billed through automatic charges, +/// Stripe automatically finalizes your invoice and attempts payment. Note +/// that finalizing the invoice, +/// [when automatic](https://stripe.com/docs/invoicing/integration/automatic-advancement-collection), does. +/// not happen immediately as the invoice is created. Stripe waits +/// until one hour after the last webhook was successfully sent (or the last +/// webhook timed out after failing). If you (and the platforms you may have +/// connected to) have no webhooks configured, Stripe waits one hour after +/// creation to finalize the invoice. +/// +/// If your invoice is configured to be billed by sending an email, then based on your +/// [email settings](https://dashboard.stripe.com/account/billing/automatic), +/// Stripe will email the invoice to your customer and await payment. These +/// emails can contain a link to a hosted page to pay the invoice. +/// +/// Stripe applies any customer credit on the account before determining the +/// amount due for the invoice (i.e., the amount that will be actually +/// charged). If the amount due for the invoice is less than Stripe's [minimum allowed charge +/// per currency](/docs/currencies#minimum-and-maximum-charge-amounts), the +/// invoice is automatically marked paid, and we add the amount due to the +/// customer's credit balance which is applied to the next invoice. +/// +/// More details on the customer's credit balance are +/// [here](https://stripe.com/docs/billing/customer/balance). +/// +/// Related guide: [Send invoices to customers](https://stripe.com/docs/billing/invoices/sending) +/// +/// For more details see <>. +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct Invoice { + /// The country of the business associated with this invoice, most often the business creating the invoice. + pub account_country: Option, + /// The public name of the business associated with this invoice, most often the business creating the invoice. + pub account_name: Option, + /// The account tax IDs associated with the invoice. Only editable when the invoice is a draft. + pub account_tax_ids: Option>>, + /// Final amount due at this time for this invoice. + /// If the invoice's total is smaller than the minimum charge amount, for example, or if there is account credit that can be applied to the invoice, the `amount_due` may be 0. + /// If there is a positive `starting_balance` for the invoice (the customer owes money), the `amount_due` will also take that into account. + /// The charge that gets generated for the invoice will be for the amount specified in `amount_due`. + pub amount_due: i64, + /// The amount, in cents (or local equivalent), that was paid. + pub amount_paid: i64, + /// The difference between amount_due and amount_paid, in cents (or local equivalent). + pub amount_remaining: i64, + /// This is the sum of all the shipping amounts. + pub amount_shipping: i64, + /// ID of the Connect Application that created the invoice. + pub application: Option>, + /// The fee in cents (or local equivalent) that will be applied to the invoice and transferred to the application owner's Stripe account when the invoice is paid. + pub application_fee_amount: Option, + /// Number of payment attempts made for this invoice, from the perspective of the payment retry schedule. + /// Any payment attempt counts as the first attempt, and subsequently only automatic retries increment the attempt count. + /// In other words, manual payment attempts after the first attempt do not affect the retry schedule. + pub attempt_count: u64, + /// Whether an attempt has been made to pay the invoice. + /// An invoice is not attempted until 1 hour after the `invoice.created` webhook, for example, so you might not want to display that invoice as unpaid to your users. + pub attempted: bool, + /// Controls whether Stripe performs [automatic collection](https://stripe.com/docs/invoicing/integration/automatic-advancement-collection) of the invoice. + /// If `false`, the invoice's state doesn't automatically advance without an explicit action. + #[serde(skip_serializing_if = "Option::is_none")] + pub auto_advance: Option, + pub automatic_tax: stripe_shared::AutomaticTax, + /// Indicates the reason why the invoice was created. + /// + /// * `manual`: Unrelated to a subscription, for example, created via the invoice editor. + /// * `subscription`: No longer in use. + /// Applies to subscriptions from before May 2018 where no distinction was made between updates, cycles, and thresholds. + /// * `subscription_create`: A new subscription was created. + /// * `subscription_cycle`: A subscription advanced into a new period. + /// * `subscription_threshold`: A subscription reached a billing threshold. + /// * `subscription_update`: A subscription was updated. + /// * `upcoming`: Reserved for simulated invoices, per the upcoming invoice endpoint. + pub billing_reason: Option, + /// ID of the latest charge generated for this invoice, if any. + pub charge: Option>, + /// Either `charge_automatically`, or `send_invoice`. + /// When charging automatically, Stripe will attempt to pay this invoice using the default source attached to the customer. + /// When sending an invoice, Stripe will email this invoice to the customer with payment instructions. + pub collection_method: stripe_shared::InvoiceCollectionMethod, + /// Time at which the object was created. Measured in seconds since the Unix epoch. + pub created: stripe_types::Timestamp, + /// Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. + /// Must be a [supported currency](https://stripe.com/docs/currencies). + pub currency: stripe_types::Currency, + /// Custom fields displayed on the invoice. + pub custom_fields: Option>, + /// The ID of the customer who will be billed. + pub customer: Option>, + /// The customer's address. + /// Until the invoice is finalized, this field will equal `customer.address`. + /// Once the invoice is finalized, this field will no longer be updated. + pub customer_address: Option, + /// The customer's email. + /// Until the invoice is finalized, this field will equal `customer.email`. + /// Once the invoice is finalized, this field will no longer be updated. + pub customer_email: Option, + /// The customer's name. + /// Until the invoice is finalized, this field will equal `customer.name`. + /// Once the invoice is finalized, this field will no longer be updated. + pub customer_name: Option, + /// The customer's phone number. + /// Until the invoice is finalized, this field will equal `customer.phone`. + /// Once the invoice is finalized, this field will no longer be updated. + pub customer_phone: Option, + /// The customer's shipping information. + /// Until the invoice is finalized, this field will equal `customer.shipping`. + /// Once the invoice is finalized, this field will no longer be updated. + pub customer_shipping: Option, + /// The customer's tax exempt status. + /// Until the invoice is finalized, this field will equal `customer.tax_exempt`. + /// Once the invoice is finalized, this field will no longer be updated. + pub customer_tax_exempt: Option, + /// The customer's tax IDs. + /// Until the invoice is finalized, this field will contain the same tax IDs as `customer.tax_ids`. + /// Once the invoice is finalized, this field will no longer be updated. + #[serde(skip_serializing_if = "Option::is_none")] + pub customer_tax_ids: Option>, + /// ID of the default payment method for the invoice. + /// It must belong to the customer associated with the invoice. + /// If not set, defaults to the subscription's default payment method, if any, or to the default payment method in the customer's invoice settings. + pub default_payment_method: Option>, + /// ID of the default payment source for the invoice. + /// It must belong to the customer associated with the invoice and be in a chargeable state. + /// If not set, defaults to the subscription's default source, if any, or to the customer's default source. + pub default_source: Option>, + /// The tax rates applied to this invoice, if any. + pub default_tax_rates: Vec, + /// An arbitrary string attached to the object. + /// Often useful for displaying to users. + /// Referenced as 'memo' in the Dashboard. + pub description: Option, + /// Describes the current discount applied to this invoice, if there is one. + /// Not populated if there are multiple discounts. + pub discount: Option, + /// The discounts applied to the invoice. + /// Line item discounts are applied before invoice discounts. + /// Use `expand[]=discounts` to expand each discount. + pub discounts: Option>>, + /// The date on which payment for this invoice is due. + /// This value will be `null` for invoices where `collection_method=charge_automatically`. + pub due_date: Option, + /// The date when this invoice is in effect. + /// Same as `finalized_at` unless overwritten. + /// When defined, this value replaces the system-generated 'Date of issue' printed on the invoice PDF and receipt. + pub effective_at: Option, + /// Ending customer balance after the invoice is finalized. + /// Invoices are finalized approximately an hour after successful webhook delivery or when payment collection is attempted for the invoice. + /// If the invoice has not been finalized yet, this will be null. + pub ending_balance: Option, + /// Footer displayed on the invoice. + pub footer: Option, + /// Details of the invoice that was cloned. + /// See the [revision documentation](https://stripe.com/docs/invoicing/invoice-revisions) for more details. + pub from_invoice: Option, + /// The URL for the hosted invoice page, which allows customers to view and pay an invoice. + /// If the invoice has not been finalized yet, this will be null. + #[serde(skip_serializing_if = "Option::is_none")] + pub hosted_invoice_url: Option, + /// Unique identifier for the object. + /// This property is always present unless the invoice is an upcoming invoice. + /// See [Retrieve an upcoming invoice](https://stripe.com/docs/api/invoices/upcoming) for more details. + #[serde(skip_serializing_if = "Option::is_none")] + pub id: Option, + /// The link to download the PDF for the invoice. + /// If the invoice has not been finalized yet, this will be null. + #[serde(skip_serializing_if = "Option::is_none")] + pub invoice_pdf: Option, + pub issuer: stripe_shared::ConnectAccountReference, + /// The error encountered during the previous attempt to finalize the invoice. + /// This field is cleared when the invoice is successfully finalized. + pub last_finalization_error: Option>, + /// The ID of the most recent non-draft revision of this invoice + pub latest_revision: Option>, + /// The individual line items that make up the invoice. + /// `lines` is sorted as follows: (1) pending invoice items (including prorations) in reverse chronological order, (2) subscription items in reverse chronological order, and (3) invoice items added after invoice creation in chronological order. + pub lines: stripe_types::List, + /// Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + pub livemode: bool, + /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. + /// This can be useful for storing additional information about the object in a structured format. + pub metadata: Option>, + /// The time at which payment will next be attempted. + /// This value will be `null` for invoices where `collection_method=send_invoice`. + pub next_payment_attempt: Option, + /// A unique, identifying string that appears on emails sent to the customer for this invoice. + /// This starts with the customer's unique invoice_prefix if it is specified. + pub number: Option, + /// The account (if any) for which the funds of the invoice payment are intended. + /// If set, the invoice will be presented with the branding and support information of the specified account. + /// See the [Invoices with Connect](https://stripe.com/docs/billing/invoices/connect) documentation for details. + pub on_behalf_of: Option>, + /// Whether payment was successfully collected for this invoice. + /// An invoice can be paid (most commonly) with a charge or with credit from the customer's account balance. + pub paid: bool, + /// Returns true if the invoice was manually marked paid, returns false if the invoice hasn't been paid yet or was paid on Stripe. + pub paid_out_of_band: bool, + /// The PaymentIntent associated with this invoice. + /// The PaymentIntent is generated when the invoice is finalized, and can then be used to pay the invoice. + /// Note that voiding an invoice will cancel the PaymentIntent. + pub payment_intent: Option>, + pub payment_settings: stripe_shared::InvoicesPaymentSettings, + /// End of the usage period during which invoice items were added to this invoice. + pub period_end: stripe_types::Timestamp, + /// Start of the usage period during which invoice items were added to this invoice. + pub period_start: stripe_types::Timestamp, + /// Total amount of all post-payment credit notes issued for this invoice. + pub post_payment_credit_notes_amount: i64, + /// Total amount of all pre-payment credit notes issued for this invoice. + pub pre_payment_credit_notes_amount: i64, + /// The quote this invoice was generated from. + pub quote: Option>, + /// This is the transaction number that appears on email receipts sent for this invoice. + pub receipt_number: Option, + /// The rendering-related settings that control how the invoice is displayed on customer-facing surfaces such as PDF and Hosted Invoice Page. + pub rendering: Option, + /// This is a legacy field that will be removed soon. + /// For details about `rendering_options`, refer to `rendering` instead. + /// Options for invoice PDF rendering. + pub rendering_options: Option, + /// The details of the cost of shipping, including the ShippingRate applied on the invoice. + pub shipping_cost: Option, + /// Shipping details for the invoice. + /// The Invoice PDF will use the `shipping_details` value if it is set, otherwise the PDF will render the shipping address from the customer. + pub shipping_details: Option, + /// Starting customer balance before the invoice is finalized. + /// If the invoice has not been finalized yet, this will be the current customer balance. + /// For revision invoices, this also includes any customer balance that was applied to the original invoice. + pub starting_balance: i64, + /// Extra information about an invoice for the customer's credit card statement. + pub statement_descriptor: Option, + /// The status of the invoice, one of `draft`, `open`, `paid`, `uncollectible`, or `void`. + /// [Learn more](https://stripe.com/docs/billing/invoices/workflow#workflow-overview). + pub status: Option, + pub status_transitions: stripe_shared::InvoicesStatusTransitions, + /// The subscription that this invoice was prepared for, if any. + pub subscription: Option>, + /// Details about the subscription that created this invoice. + pub subscription_details: Option, + /// Only set for upcoming invoices that preview prorations. The time used to calculate prorations. + #[serde(skip_serializing_if = "Option::is_none")] + pub subscription_proration_date: Option, + /// Total of all subscriptions, invoice items, and prorations on the invoice before any invoice level discount or exclusive tax is applied. + /// Item discounts are already incorporated. + pub subtotal: i64, + /// The integer amount in cents (or local equivalent) representing the subtotal of the invoice before any invoice level discount or tax is applied. + /// Item discounts are already incorporated. + pub subtotal_excluding_tax: Option, + /// The amount of tax on this invoice. This is the sum of all the tax amounts on this invoice. + pub tax: Option, + /// ID of the test clock this invoice belongs to. + pub test_clock: Option>, + #[serde(skip_serializing_if = "Option::is_none")] + pub threshold_reason: Option, + /// Total after discounts and taxes. + pub total: i64, + /// The aggregate amounts calculated per discount across all line items. + pub total_discount_amounts: Option>, + /// The integer amount in cents (or local equivalent) representing the total amount of the invoice including all discounts but excluding all tax. + pub total_excluding_tax: Option, + /// The aggregate amounts calculated per tax rate for all line items. + pub total_tax_amounts: Vec, + /// The account (if any) the payment will be attributed to for tax reporting, and where funds from the payment will be transferred to for the invoice. + pub transfer_data: Option, + /// Invoices are automatically paid or sent 1 hour after webhooks are delivered, or until all webhook delivery attempts have [been exhausted](https://stripe.com/docs/billing/webhooks#understand). + /// This field tracks the time when webhooks for this invoice were successfully delivered. + /// If the invoice had no webhooks to deliver, this will be set while the invoice is being created. + pub webhooks_delivered_at: Option, +} +/// Indicates the reason why the invoice was created. +/// +/// * `manual`: Unrelated to a subscription, for example, created via the invoice editor. +/// * `subscription`: No longer in use. +/// Applies to subscriptions from before May 2018 where no distinction was made between updates, cycles, and thresholds. +/// * `subscription_create`: A new subscription was created. +/// * `subscription_cycle`: A subscription advanced into a new period. +/// * `subscription_threshold`: A subscription reached a billing threshold. +/// * `subscription_update`: A subscription was updated. +/// * `upcoming`: Reserved for simulated invoices, per the upcoming invoice endpoint. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum InvoiceBillingReason { + AutomaticPendingInvoiceItemInvoice, + Manual, + QuoteAccept, + Subscription, + SubscriptionCreate, + SubscriptionCycle, + SubscriptionThreshold, + SubscriptionUpdate, + Upcoming, +} +impl InvoiceBillingReason { + pub fn as_str(self) -> &'static str { + use InvoiceBillingReason::*; + match self { + AutomaticPendingInvoiceItemInvoice => "automatic_pending_invoice_item_invoice", + Manual => "manual", + QuoteAccept => "quote_accept", + Subscription => "subscription", + SubscriptionCreate => "subscription_create", + SubscriptionCycle => "subscription_cycle", + SubscriptionThreshold => "subscription_threshold", + SubscriptionUpdate => "subscription_update", + Upcoming => "upcoming", + } + } +} + +impl std::str::FromStr for InvoiceBillingReason { + type Err = (); + fn from_str(s: &str) -> Result { + use InvoiceBillingReason::*; + match s { + "automatic_pending_invoice_item_invoice" => Ok(AutomaticPendingInvoiceItemInvoice), + "manual" => Ok(Manual), + "quote_accept" => Ok(QuoteAccept), + "subscription" => Ok(Subscription), + "subscription_create" => Ok(SubscriptionCreate), + "subscription_cycle" => Ok(SubscriptionCycle), + "subscription_threshold" => Ok(SubscriptionThreshold), + "subscription_update" => Ok(SubscriptionUpdate), + "upcoming" => Ok(Upcoming), + _ => Err(()), + } + } +} +impl std::fmt::Display for InvoiceBillingReason { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for InvoiceBillingReason { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for InvoiceBillingReason { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for InvoiceBillingReason { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s) + .map_err(|_| serde::de::Error::custom("Unknown value for InvoiceBillingReason")) + } +} +/// The customer's tax exempt status. +/// Until the invoice is finalized, this field will equal `customer.tax_exempt`. +/// Once the invoice is finalized, this field will no longer be updated. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum InvoiceCustomerTaxExempt { + Exempt, + None, + Reverse, +} +impl InvoiceCustomerTaxExempt { + pub fn as_str(self) -> &'static str { + use InvoiceCustomerTaxExempt::*; + match self { + Exempt => "exempt", + None => "none", + Reverse => "reverse", + } + } +} + +impl std::str::FromStr for InvoiceCustomerTaxExempt { + type Err = (); + fn from_str(s: &str) -> Result { + use InvoiceCustomerTaxExempt::*; + match s { + "exempt" => Ok(Exempt), + "none" => Ok(None), + "reverse" => Ok(Reverse), + _ => Err(()), + } + } +} +impl std::fmt::Display for InvoiceCustomerTaxExempt { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for InvoiceCustomerTaxExempt { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for InvoiceCustomerTaxExempt { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for InvoiceCustomerTaxExempt { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s) + .map_err(|_| serde::de::Error::custom("Unknown value for InvoiceCustomerTaxExempt")) + } +} +impl stripe_types::Object for Invoice { + type Id = Option; + fn id(&self) -> &Self::Id { + &self.id + } +} +stripe_types::def_id!(InvoiceId, "in_"); +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum InvoiceCollectionMethod { + ChargeAutomatically, + SendInvoice, +} +impl InvoiceCollectionMethod { + pub fn as_str(self) -> &'static str { + use InvoiceCollectionMethod::*; + match self { + ChargeAutomatically => "charge_automatically", + SendInvoice => "send_invoice", + } + } +} + +impl std::str::FromStr for InvoiceCollectionMethod { + type Err = (); + fn from_str(s: &str) -> Result { + use InvoiceCollectionMethod::*; + match s { + "charge_automatically" => Ok(ChargeAutomatically), + "send_invoice" => Ok(SendInvoice), + _ => Err(()), + } + } +} +impl std::fmt::Display for InvoiceCollectionMethod { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for InvoiceCollectionMethod { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for InvoiceCollectionMethod { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for InvoiceCollectionMethod { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s) + .map_err(|_| serde::de::Error::custom("Unknown value for InvoiceCollectionMethod")) + } +} +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum InvoiceStatus { + Draft, + Open, + Paid, + Uncollectible, + Void, +} +impl InvoiceStatus { + pub fn as_str(self) -> &'static str { + use InvoiceStatus::*; + match self { + Draft => "draft", + Open => "open", + Paid => "paid", + Uncollectible => "uncollectible", + Void => "void", + } + } +} + +impl std::str::FromStr for InvoiceStatus { + type Err = (); + fn from_str(s: &str) -> Result { + use InvoiceStatus::*; + match s { + "draft" => Ok(Draft), + "open" => Ok(Open), + "paid" => Ok(Paid), + "uncollectible" => Ok(Uncollectible), + "void" => Ok(Void), + _ => Err(()), + } + } +} +impl std::fmt::Display for InvoiceStatus { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for InvoiceStatus { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for InvoiceStatus { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for InvoiceStatus { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for InvoiceStatus")) + } +} diff --git a/generated/stripe_shared/src/invoice_installments_card.rs b/generated/stripe_shared/src/invoice_installments_card.rs new file mode 100644 index 000000000..eb15116d7 --- /dev/null +++ b/generated/stripe_shared/src/invoice_installments_card.rs @@ -0,0 +1,5 @@ +#[derive(Copy, Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct InvoiceInstallmentsCard { + /// Whether Installments are enabled for this Invoice. + pub enabled: Option, +} diff --git a/generated/stripe_shared/src/invoice_item.rs b/generated/stripe_shared/src/invoice_item.rs new file mode 100644 index 000000000..3d3ee3ac4 --- /dev/null +++ b/generated/stripe_shared/src/invoice_item.rs @@ -0,0 +1,78 @@ +/// Invoice Items represent the component lines of an [invoice](https://stripe.com/docs/api/invoices). +/// An invoice item is added to an. +/// invoice by creating or updating it with an `invoice` field, at which point it will be included as +/// [an invoice line item](https://stripe.com/docs/api/invoices/line_item) within +/// [invoice.lines](https://stripe.com/docs/api/invoices/object#invoice_object-lines). +/// +/// Invoice Items can be created before you are ready to actually send the invoice. +/// This can be particularly useful when combined. +/// with a [subscription](https://stripe.com/docs/api/subscriptions). +/// Sometimes you want to add a charge or credit to a customer, but actually charge. +/// or credit the customer’s card only at the end of a regular billing cycle. +/// This is useful for combining several charges. +/// (to minimize per-transaction fees), or for having Stripe tabulate your usage-based billing totals. +/// +/// Related guides: [Integrate with the Invoicing API](https://stripe.com/docs/invoicing/integration), [Subscription Invoices](https://stripe.com/docs/billing/invoices/subscription#adding-upcoming-invoice-items). +/// +/// For more details see <>. +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct InvoiceItem { + /// Amount (in the `currency` specified) of the invoice item. + /// This should always be equal to `unit_amount * quantity`. + pub amount: i64, + /// Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. + /// Must be a [supported currency](https://stripe.com/docs/currencies). + pub currency: stripe_types::Currency, + /// The ID of the customer who will be billed when this invoice item is billed. + pub customer: stripe_types::Expandable, + /// Time at which the object was created. Measured in seconds since the Unix epoch. + pub date: stripe_types::Timestamp, + /// An arbitrary string attached to the object. Often useful for displaying to users. + pub description: Option, + /// If true, discounts will apply to this invoice item. Always false for prorations. + pub discountable: bool, + /// The discounts which apply to the invoice item. + /// Item discounts are applied before invoice discounts. + /// Use `expand[]=discounts` to expand each discount. + pub discounts: Option>>, + /// Unique identifier for the object. + pub id: stripe_shared::InvoiceItemId, + /// The ID of the invoice this invoice item belongs to. + pub invoice: Option>, + /// Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + pub livemode: bool, + /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. + /// This can be useful for storing additional information about the object in a structured format. + pub metadata: Option>, + pub period: stripe_shared::InvoiceLineItemPeriod, + /// If the invoice item is a proration, the plan of the subscription that the proration was computed for. + pub plan: Option, + /// The price of the invoice item. + pub price: Option, + /// Whether the invoice item was created automatically as a proration adjustment when the customer switched plans. + pub proration: bool, + /// Quantity of units for the invoice item. + /// If the invoice item is a proration, the quantity of the subscription that the proration was computed for. + pub quantity: u64, + /// The subscription that this invoice item has been created for, if any. + pub subscription: Option>, + /// The subscription item that this invoice item has been created for, if any. + #[serde(skip_serializing_if = "Option::is_none")] + pub subscription_item: Option, + /// The tax rates which apply to the invoice item. + /// When set, the `default_tax_rates` on the invoice do not apply to this invoice item. + pub tax_rates: Option>, + /// ID of the test clock this invoice item belongs to. + pub test_clock: Option>, + /// Unit amount (in the `currency` specified) of the invoice item. + pub unit_amount: Option, + /// Same as `unit_amount`, but contains a decimal value with at most 12 decimal places. + pub unit_amount_decimal: Option, +} +impl stripe_types::Object for InvoiceItem { + type Id = stripe_shared::InvoiceItemId; + fn id(&self) -> &Self::Id { + &self.id + } +} +stripe_types::def_id!(InvoiceItemId, "ii_"); diff --git a/generated/stripe_shared/src/invoice_item_threshold_reason.rs b/generated/stripe_shared/src/invoice_item_threshold_reason.rs new file mode 100644 index 000000000..76947aae7 --- /dev/null +++ b/generated/stripe_shared/src/invoice_item_threshold_reason.rs @@ -0,0 +1,7 @@ +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct InvoiceItemThresholdReason { + /// The IDs of the line items that triggered the threshold invoice. + pub line_item_ids: Vec, + /// The quantity threshold boundary that applied to the given line item. + pub usage_gte: i64, +} diff --git a/generated/stripe_shared/src/invoice_line_item.rs b/generated/stripe_shared/src/invoice_line_item.rs new file mode 100644 index 000000000..262d0115e --- /dev/null +++ b/generated/stripe_shared/src/invoice_line_item.rs @@ -0,0 +1,120 @@ +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct InvoiceLineItem { + /// The amount, in cents (or local equivalent). + pub amount: i64, + /// The integer amount in cents (or local equivalent) representing the amount for this line item, excluding all tax and discounts. + pub amount_excluding_tax: Option, + /// Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. + /// Must be a [supported currency](https://stripe.com/docs/currencies). + pub currency: stripe_types::Currency, + /// An arbitrary string attached to the object. Often useful for displaying to users. + pub description: Option, + /// The amount of discount calculated per discount for this line item. + pub discount_amounts: Option>, + /// If true, discounts will apply to this line item. Always false for prorations. + pub discountable: bool, + /// The discounts applied to the invoice line item. + /// Line item discounts are applied before invoice discounts. + /// Use `expand[]=discounts` to expand each discount. + pub discounts: Option>>, + /// Unique identifier for the object. + pub id: stripe_shared::InvoiceLineItemId, + /// The ID of the [invoice item](https://stripe.com/docs/api/invoiceitems) associated with this line item if any. + #[serde(skip_serializing_if = "Option::is_none")] + pub invoice_item: Option>, + /// Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + pub livemode: bool, + /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. + /// This can be useful for storing additional information about the object in a structured format. + /// Note that for line items with `type=subscription` this will reflect the metadata of the subscription that caused the line item to be created. + pub metadata: std::collections::HashMap, + pub period: stripe_shared::InvoiceLineItemPeriod, + /// The plan of the subscription, if the line item is a subscription or a proration. + pub plan: Option, + /// The price of the line item. + pub price: Option, + /// Whether this is a proration. + pub proration: bool, + /// Additional details for proration line items + pub proration_details: Option, + /// The quantity of the subscription, if the line item is a subscription or a proration. + pub quantity: Option, + /// The subscription that the invoice item pertains to, if any. + pub subscription: Option>, + /// The subscription item that generated this line item. + /// Left empty if the line item is not an explicit result of a subscription. + #[serde(skip_serializing_if = "Option::is_none")] + pub subscription_item: Option>, + /// The amount of tax calculated per tax rate for this line item + #[serde(skip_serializing_if = "Option::is_none")] + pub tax_amounts: Option>, + /// The tax rates which apply to the line item. + #[serde(skip_serializing_if = "Option::is_none")] + pub tax_rates: Option>, + /// A string identifying the type of the source of this line item, either an `invoiceitem` or a `subscription`. + #[serde(rename = "type")] + pub type_: InvoiceLineItemType, + /// The amount in cents (or local equivalent) representing the unit amount for this line item, excluding all tax and discounts. + pub unit_amount_excluding_tax: Option, +} +/// A string identifying the type of the source of this line item, either an `invoiceitem` or a `subscription`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum InvoiceLineItemType { + Invoiceitem, + Subscription, +} +impl InvoiceLineItemType { + pub fn as_str(self) -> &'static str { + use InvoiceLineItemType::*; + match self { + Invoiceitem => "invoiceitem", + Subscription => "subscription", + } + } +} + +impl std::str::FromStr for InvoiceLineItemType { + type Err = (); + fn from_str(s: &str) -> Result { + use InvoiceLineItemType::*; + match s { + "invoiceitem" => Ok(Invoiceitem), + "subscription" => Ok(Subscription), + _ => Err(()), + } + } +} +impl std::fmt::Display for InvoiceLineItemType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for InvoiceLineItemType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for InvoiceLineItemType { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for InvoiceLineItemType { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s) + .map_err(|_| serde::de::Error::custom("Unknown value for InvoiceLineItemType")) + } +} +impl stripe_types::Object for InvoiceLineItem { + type Id = stripe_shared::InvoiceLineItemId; + fn id(&self) -> &Self::Id { + &self.id + } +} +stripe_types::def_id!(InvoiceLineItemId); diff --git a/generated/stripe_shared/src/invoice_line_item_period.rs b/generated/stripe_shared/src/invoice_line_item_period.rs new file mode 100644 index 000000000..19b7fe0ba --- /dev/null +++ b/generated/stripe_shared/src/invoice_line_item_period.rs @@ -0,0 +1,7 @@ +#[derive(Copy, Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct InvoiceLineItemPeriod { + /// The end of the period, which must be greater than or equal to the start. This value is inclusive. + pub end: stripe_types::Timestamp, + /// The start of the period. This value is inclusive. + pub start: stripe_types::Timestamp, +} diff --git a/generated/stripe_shared/src/invoice_mandate_options_card.rs b/generated/stripe_shared/src/invoice_mandate_options_card.rs new file mode 100644 index 000000000..8ec277463 --- /dev/null +++ b/generated/stripe_shared/src/invoice_mandate_options_card.rs @@ -0,0 +1,68 @@ +#[derive(Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct InvoiceMandateOptionsCard { + /// Amount to be charged for future payments. + pub amount: Option, + /// One of `fixed` or `maximum`. + /// If `fixed`, the `amount` param refers to the exact amount to be charged in future payments. + /// If `maximum`, the amount charged can be up to the value passed for the `amount` param. + pub amount_type: Option, + /// A description of the mandate or subscription that is meant to be displayed to the customer. + pub description: Option, +} +/// One of `fixed` or `maximum`. +/// If `fixed`, the `amount` param refers to the exact amount to be charged in future payments. +/// If `maximum`, the amount charged can be up to the value passed for the `amount` param. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum InvoiceMandateOptionsCardAmountType { + Fixed, + Maximum, +} +impl InvoiceMandateOptionsCardAmountType { + pub fn as_str(self) -> &'static str { + use InvoiceMandateOptionsCardAmountType::*; + match self { + Fixed => "fixed", + Maximum => "maximum", + } + } +} + +impl std::str::FromStr for InvoiceMandateOptionsCardAmountType { + type Err = (); + fn from_str(s: &str) -> Result { + use InvoiceMandateOptionsCardAmountType::*; + match s { + "fixed" => Ok(Fixed), + "maximum" => Ok(Maximum), + _ => Err(()), + } + } +} +impl std::fmt::Display for InvoiceMandateOptionsCardAmountType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for InvoiceMandateOptionsCardAmountType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for InvoiceMandateOptionsCardAmountType { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for InvoiceMandateOptionsCardAmountType { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| { + serde::de::Error::custom("Unknown value for InvoiceMandateOptionsCardAmountType") + }) + } +} diff --git a/generated/stripe_shared/src/invoice_payment_method_options_acss_debit.rs b/generated/stripe_shared/src/invoice_payment_method_options_acss_debit.rs new file mode 100644 index 000000000..d4bbc066f --- /dev/null +++ b/generated/stripe_shared/src/invoice_payment_method_options_acss_debit.rs @@ -0,0 +1,68 @@ +#[derive(Copy, Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct InvoicePaymentMethodOptionsAcssDebit { + #[serde(skip_serializing_if = "Option::is_none")] + pub mandate_options: Option, + /// Bank account verification method. + #[serde(skip_serializing_if = "Option::is_none")] + pub verification_method: Option, +} +/// Bank account verification method. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum InvoicePaymentMethodOptionsAcssDebitVerificationMethod { + Automatic, + Instant, + Microdeposits, +} +impl InvoicePaymentMethodOptionsAcssDebitVerificationMethod { + pub fn as_str(self) -> &'static str { + use InvoicePaymentMethodOptionsAcssDebitVerificationMethod::*; + match self { + Automatic => "automatic", + Instant => "instant", + Microdeposits => "microdeposits", + } + } +} + +impl std::str::FromStr for InvoicePaymentMethodOptionsAcssDebitVerificationMethod { + type Err = (); + fn from_str(s: &str) -> Result { + use InvoicePaymentMethodOptionsAcssDebitVerificationMethod::*; + match s { + "automatic" => Ok(Automatic), + "instant" => Ok(Instant), + "microdeposits" => Ok(Microdeposits), + _ => Err(()), + } + } +} +impl std::fmt::Display for InvoicePaymentMethodOptionsAcssDebitVerificationMethod { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for InvoicePaymentMethodOptionsAcssDebitVerificationMethod { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for InvoicePaymentMethodOptionsAcssDebitVerificationMethod { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for InvoicePaymentMethodOptionsAcssDebitVerificationMethod { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| { + serde::de::Error::custom( + "Unknown value for InvoicePaymentMethodOptionsAcssDebitVerificationMethod", + ) + }) + } +} diff --git a/generated/stripe_shared/src/invoice_payment_method_options_acss_debit_mandate_options.rs b/generated/stripe_shared/src/invoice_payment_method_options_acss_debit_mandate_options.rs new file mode 100644 index 000000000..b26bf2259 --- /dev/null +++ b/generated/stripe_shared/src/invoice_payment_method_options_acss_debit_mandate_options.rs @@ -0,0 +1,60 @@ +#[derive(Copy, Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct InvoicePaymentMethodOptionsAcssDebitMandateOptions { + /// Transaction type of the mandate. + pub transaction_type: Option, +} +/// Transaction type of the mandate. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum InvoicePaymentMethodOptionsAcssDebitMandateOptionsTransactionType { + Business, + Personal, +} +impl InvoicePaymentMethodOptionsAcssDebitMandateOptionsTransactionType { + pub fn as_str(self) -> &'static str { + use InvoicePaymentMethodOptionsAcssDebitMandateOptionsTransactionType::*; + match self { + Business => "business", + Personal => "personal", + } + } +} + +impl std::str::FromStr for InvoicePaymentMethodOptionsAcssDebitMandateOptionsTransactionType { + type Err = (); + fn from_str(s: &str) -> Result { + use InvoicePaymentMethodOptionsAcssDebitMandateOptionsTransactionType::*; + match s { + "business" => Ok(Business), + "personal" => Ok(Personal), + _ => Err(()), + } + } +} +impl std::fmt::Display for InvoicePaymentMethodOptionsAcssDebitMandateOptionsTransactionType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for InvoicePaymentMethodOptionsAcssDebitMandateOptionsTransactionType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for InvoicePaymentMethodOptionsAcssDebitMandateOptionsTransactionType { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> + for InvoicePaymentMethodOptionsAcssDebitMandateOptionsTransactionType +{ + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for InvoicePaymentMethodOptionsAcssDebitMandateOptionsTransactionType")) + } +} diff --git a/generated/stripe_shared/src/invoice_payment_method_options_bancontact.rs b/generated/stripe_shared/src/invoice_payment_method_options_bancontact.rs new file mode 100644 index 000000000..620989038 --- /dev/null +++ b/generated/stripe_shared/src/invoice_payment_method_options_bancontact.rs @@ -0,0 +1,68 @@ +#[derive(Copy, Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct InvoicePaymentMethodOptionsBancontact { + /// Preferred language of the Bancontact authorization page that the customer is redirected to. + pub preferred_language: InvoicePaymentMethodOptionsBancontactPreferredLanguage, +} +/// Preferred language of the Bancontact authorization page that the customer is redirected to. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum InvoicePaymentMethodOptionsBancontactPreferredLanguage { + De, + En, + Fr, + Nl, +} +impl InvoicePaymentMethodOptionsBancontactPreferredLanguage { + pub fn as_str(self) -> &'static str { + use InvoicePaymentMethodOptionsBancontactPreferredLanguage::*; + match self { + De => "de", + En => "en", + Fr => "fr", + Nl => "nl", + } + } +} + +impl std::str::FromStr for InvoicePaymentMethodOptionsBancontactPreferredLanguage { + type Err = (); + fn from_str(s: &str) -> Result { + use InvoicePaymentMethodOptionsBancontactPreferredLanguage::*; + match s { + "de" => Ok(De), + "en" => Ok(En), + "fr" => Ok(Fr), + "nl" => Ok(Nl), + _ => Err(()), + } + } +} +impl std::fmt::Display for InvoicePaymentMethodOptionsBancontactPreferredLanguage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for InvoicePaymentMethodOptionsBancontactPreferredLanguage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for InvoicePaymentMethodOptionsBancontactPreferredLanguage { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for InvoicePaymentMethodOptionsBancontactPreferredLanguage { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| { + serde::de::Error::custom( + "Unknown value for InvoicePaymentMethodOptionsBancontactPreferredLanguage", + ) + }) + } +} diff --git a/generated/stripe_shared/src/invoice_payment_method_options_card.rs b/generated/stripe_shared/src/invoice_payment_method_options_card.rs new file mode 100644 index 000000000..39c32a89a --- /dev/null +++ b/generated/stripe_shared/src/invoice_payment_method_options_card.rs @@ -0,0 +1,71 @@ +#[derive(Copy, Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct InvoicePaymentMethodOptionsCard { + #[serde(skip_serializing_if = "Option::is_none")] + pub installments: Option, + /// We strongly recommend that you rely on our SCA Engine to automatically prompt your customers for authentication based on risk level and [other requirements](https://stripe.com/docs/strong-customer-authentication). + /// However, if you wish to request 3D Secure based on logic from your own fraud engine, provide this option. + /// Read our guide on [manually requesting 3D Secure](https://stripe.com/docs/payments/3d-secure#manual-three-ds) for more information on how this configuration interacts with Radar and our SCA Engine. + pub request_three_d_secure: Option, +} +/// We strongly recommend that you rely on our SCA Engine to automatically prompt your customers for authentication based on risk level and [other requirements](https://stripe.com/docs/strong-customer-authentication). +/// However, if you wish to request 3D Secure based on logic from your own fraud engine, provide this option. +/// Read our guide on [manually requesting 3D Secure](https://stripe.com/docs/payments/3d-secure#manual-three-ds) for more information on how this configuration interacts with Radar and our SCA Engine. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum InvoicePaymentMethodOptionsCardRequestThreeDSecure { + Any, + Automatic, + Challenge, +} +impl InvoicePaymentMethodOptionsCardRequestThreeDSecure { + pub fn as_str(self) -> &'static str { + use InvoicePaymentMethodOptionsCardRequestThreeDSecure::*; + match self { + Any => "any", + Automatic => "automatic", + Challenge => "challenge", + } + } +} + +impl std::str::FromStr for InvoicePaymentMethodOptionsCardRequestThreeDSecure { + type Err = (); + fn from_str(s: &str) -> Result { + use InvoicePaymentMethodOptionsCardRequestThreeDSecure::*; + match s { + "any" => Ok(Any), + "automatic" => Ok(Automatic), + "challenge" => Ok(Challenge), + _ => Err(()), + } + } +} +impl std::fmt::Display for InvoicePaymentMethodOptionsCardRequestThreeDSecure { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for InvoicePaymentMethodOptionsCardRequestThreeDSecure { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for InvoicePaymentMethodOptionsCardRequestThreeDSecure { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for InvoicePaymentMethodOptionsCardRequestThreeDSecure { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| { + serde::de::Error::custom( + "Unknown value for InvoicePaymentMethodOptionsCardRequestThreeDSecure", + ) + }) + } +} diff --git a/generated/stripe_shared/src/invoice_payment_method_options_customer_balance.rs b/generated/stripe_shared/src/invoice_payment_method_options_customer_balance.rs new file mode 100644 index 000000000..940dc6b7b --- /dev/null +++ b/generated/stripe_shared/src/invoice_payment_method_options_customer_balance.rs @@ -0,0 +1,64 @@ +#[derive(Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct InvoicePaymentMethodOptionsCustomerBalance { + #[serde(skip_serializing_if = "Option::is_none")] + pub bank_transfer: + Option, + /// The funding method type to be used when there are not enough funds in the customer balance. + /// Permitted values include: `bank_transfer`. + pub funding_type: Option, +} +/// The funding method type to be used when there are not enough funds in the customer balance. +/// Permitted values include: `bank_transfer`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum InvoicePaymentMethodOptionsCustomerBalanceFundingType { + BankTransfer, +} +impl InvoicePaymentMethodOptionsCustomerBalanceFundingType { + pub fn as_str(self) -> &'static str { + use InvoicePaymentMethodOptionsCustomerBalanceFundingType::*; + match self { + BankTransfer => "bank_transfer", + } + } +} + +impl std::str::FromStr for InvoicePaymentMethodOptionsCustomerBalanceFundingType { + type Err = (); + fn from_str(s: &str) -> Result { + use InvoicePaymentMethodOptionsCustomerBalanceFundingType::*; + match s { + "bank_transfer" => Ok(BankTransfer), + _ => Err(()), + } + } +} +impl std::fmt::Display for InvoicePaymentMethodOptionsCustomerBalanceFundingType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for InvoicePaymentMethodOptionsCustomerBalanceFundingType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for InvoicePaymentMethodOptionsCustomerBalanceFundingType { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for InvoicePaymentMethodOptionsCustomerBalanceFundingType { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| { + serde::de::Error::custom( + "Unknown value for InvoicePaymentMethodOptionsCustomerBalanceFundingType", + ) + }) + } +} diff --git a/generated/stripe_shared/src/invoice_payment_method_options_customer_balance_bank_transfer.rs b/generated/stripe_shared/src/invoice_payment_method_options_customer_balance_bank_transfer.rs new file mode 100644 index 000000000..156446afc --- /dev/null +++ b/generated/stripe_shared/src/invoice_payment_method_options_customer_balance_bank_transfer.rs @@ -0,0 +1,10 @@ +#[derive(Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct InvoicePaymentMethodOptionsCustomerBalanceBankTransfer { + #[serde(skip_serializing_if = "Option::is_none")] + pub eu_bank_transfer: + Option, + /// The bank transfer type that can be used for funding. + /// Permitted values include: `eu_bank_transfer`, `gb_bank_transfer`, `jp_bank_transfer`, `mx_bank_transfer`, or `us_bank_transfer`. + #[serde(rename = "type")] + pub type_: Option, +} diff --git a/generated/stripe_shared/src/invoice_payment_method_options_customer_balance_bank_transfer_eu_bank_transfer.rs b/generated/stripe_shared/src/invoice_payment_method_options_customer_balance_bank_transfer_eu_bank_transfer.rs new file mode 100644 index 000000000..9f880a3d6 --- /dev/null +++ b/generated/stripe_shared/src/invoice_payment_method_options_customer_balance_bank_transfer_eu_bank_transfer.rs @@ -0,0 +1,82 @@ +#[derive(Copy, Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct InvoicePaymentMethodOptionsCustomerBalanceBankTransferEuBankTransfer { + /// The desired country code of the bank account information. + /// Permitted values include: `BE`, `DE`, `ES`, `FR`, `IE`, or `NL`. + pub country: InvoicePaymentMethodOptionsCustomerBalanceBankTransferEuBankTransferCountry, +} +/// The desired country code of the bank account information. +/// Permitted values include: `BE`, `DE`, `ES`, `FR`, `IE`, or `NL`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum InvoicePaymentMethodOptionsCustomerBalanceBankTransferEuBankTransferCountry { + Be, + De, + Es, + Fr, + Ie, + Nl, +} +impl InvoicePaymentMethodOptionsCustomerBalanceBankTransferEuBankTransferCountry { + pub fn as_str(self) -> &'static str { + use InvoicePaymentMethodOptionsCustomerBalanceBankTransferEuBankTransferCountry::*; + match self { + Be => "BE", + De => "DE", + Es => "ES", + Fr => "FR", + Ie => "IE", + Nl => "NL", + } + } +} + +impl std::str::FromStr + for InvoicePaymentMethodOptionsCustomerBalanceBankTransferEuBankTransferCountry +{ + type Err = (); + fn from_str(s: &str) -> Result { + use InvoicePaymentMethodOptionsCustomerBalanceBankTransferEuBankTransferCountry::*; + match s { + "BE" => Ok(Be), + "DE" => Ok(De), + "ES" => Ok(Es), + "FR" => Ok(Fr), + "IE" => Ok(Ie), + "NL" => Ok(Nl), + _ => Err(()), + } + } +} +impl std::fmt::Display + for InvoicePaymentMethodOptionsCustomerBalanceBankTransferEuBankTransferCountry +{ + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug + for InvoicePaymentMethodOptionsCustomerBalanceBankTransferEuBankTransferCountry +{ + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize + for InvoicePaymentMethodOptionsCustomerBalanceBankTransferEuBankTransferCountry +{ + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> + for InvoicePaymentMethodOptionsCustomerBalanceBankTransferEuBankTransferCountry +{ + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for InvoicePaymentMethodOptionsCustomerBalanceBankTransferEuBankTransferCountry")) + } +} diff --git a/generated/stripe_shared/src/invoice_payment_method_options_konbini.rs b/generated/stripe_shared/src/invoice_payment_method_options_konbini.rs new file mode 100644 index 000000000..676a93018 --- /dev/null +++ b/generated/stripe_shared/src/invoice_payment_method_options_konbini.rs @@ -0,0 +1,2 @@ +#[derive(Copy, Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct InvoicePaymentMethodOptionsKonbini {} diff --git a/generated/stripe_shared/src/invoice_payment_method_options_us_bank_account.rs b/generated/stripe_shared/src/invoice_payment_method_options_us_bank_account.rs new file mode 100644 index 000000000..c02b52ea5 --- /dev/null +++ b/generated/stripe_shared/src/invoice_payment_method_options_us_bank_account.rs @@ -0,0 +1,69 @@ +#[derive(Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct InvoicePaymentMethodOptionsUsBankAccount { + #[serde(skip_serializing_if = "Option::is_none")] + pub financial_connections: + Option, + /// Bank account verification method. + #[serde(skip_serializing_if = "Option::is_none")] + pub verification_method: Option, +} +/// Bank account verification method. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum InvoicePaymentMethodOptionsUsBankAccountVerificationMethod { + Automatic, + Instant, + Microdeposits, +} +impl InvoicePaymentMethodOptionsUsBankAccountVerificationMethod { + pub fn as_str(self) -> &'static str { + use InvoicePaymentMethodOptionsUsBankAccountVerificationMethod::*; + match self { + Automatic => "automatic", + Instant => "instant", + Microdeposits => "microdeposits", + } + } +} + +impl std::str::FromStr for InvoicePaymentMethodOptionsUsBankAccountVerificationMethod { + type Err = (); + fn from_str(s: &str) -> Result { + use InvoicePaymentMethodOptionsUsBankAccountVerificationMethod::*; + match s { + "automatic" => Ok(Automatic), + "instant" => Ok(Instant), + "microdeposits" => Ok(Microdeposits), + _ => Err(()), + } + } +} +impl std::fmt::Display for InvoicePaymentMethodOptionsUsBankAccountVerificationMethod { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for InvoicePaymentMethodOptionsUsBankAccountVerificationMethod { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for InvoicePaymentMethodOptionsUsBankAccountVerificationMethod { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for InvoicePaymentMethodOptionsUsBankAccountVerificationMethod { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| { + serde::de::Error::custom( + "Unknown value for InvoicePaymentMethodOptionsUsBankAccountVerificationMethod", + ) + }) + } +} diff --git a/generated/stripe_shared/src/invoice_payment_method_options_us_bank_account_linked_account_options.rs b/generated/stripe_shared/src/invoice_payment_method_options_us_bank_account_linked_account_options.rs new file mode 100644 index 000000000..5d6060734 --- /dev/null +++ b/generated/stripe_shared/src/invoice_payment_method_options_us_bank_account_linked_account_options.rs @@ -0,0 +1,122 @@ +#[derive(Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct InvoicePaymentMethodOptionsUsBankAccountLinkedAccountOptions { + /// The list of permissions to request. The `payment_method` permission must be included. + #[serde(skip_serializing_if = "Option::is_none")] + pub permissions: + Option>, + /// Data features requested to be retrieved upon account creation. + pub prefetch: Option>, +} +/// The list of permissions to request. The `payment_method` permission must be included. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum InvoicePaymentMethodOptionsUsBankAccountLinkedAccountOptionsPermissions { + Balances, + PaymentMethod, + Transactions, +} +impl InvoicePaymentMethodOptionsUsBankAccountLinkedAccountOptionsPermissions { + pub fn as_str(self) -> &'static str { + use InvoicePaymentMethodOptionsUsBankAccountLinkedAccountOptionsPermissions::*; + match self { + Balances => "balances", + PaymentMethod => "payment_method", + Transactions => "transactions", + } + } +} + +impl std::str::FromStr for InvoicePaymentMethodOptionsUsBankAccountLinkedAccountOptionsPermissions { + type Err = (); + fn from_str(s: &str) -> Result { + use InvoicePaymentMethodOptionsUsBankAccountLinkedAccountOptionsPermissions::*; + match s { + "balances" => Ok(Balances), + "payment_method" => Ok(PaymentMethod), + "transactions" => Ok(Transactions), + _ => Err(()), + } + } +} +impl std::fmt::Display for InvoicePaymentMethodOptionsUsBankAccountLinkedAccountOptionsPermissions { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for InvoicePaymentMethodOptionsUsBankAccountLinkedAccountOptionsPermissions { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for InvoicePaymentMethodOptionsUsBankAccountLinkedAccountOptionsPermissions { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> + for InvoicePaymentMethodOptionsUsBankAccountLinkedAccountOptionsPermissions +{ + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for InvoicePaymentMethodOptionsUsBankAccountLinkedAccountOptionsPermissions")) + } +} +/// Data features requested to be retrieved upon account creation. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum InvoicePaymentMethodOptionsUsBankAccountLinkedAccountOptionsPrefetch { + Balances, + Transactions, +} +impl InvoicePaymentMethodOptionsUsBankAccountLinkedAccountOptionsPrefetch { + pub fn as_str(self) -> &'static str { + use InvoicePaymentMethodOptionsUsBankAccountLinkedAccountOptionsPrefetch::*; + match self { + Balances => "balances", + Transactions => "transactions", + } + } +} + +impl std::str::FromStr for InvoicePaymentMethodOptionsUsBankAccountLinkedAccountOptionsPrefetch { + type Err = (); + fn from_str(s: &str) -> Result { + use InvoicePaymentMethodOptionsUsBankAccountLinkedAccountOptionsPrefetch::*; + match s { + "balances" => Ok(Balances), + "transactions" => Ok(Transactions), + _ => Err(()), + } + } +} +impl std::fmt::Display for InvoicePaymentMethodOptionsUsBankAccountLinkedAccountOptionsPrefetch { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for InvoicePaymentMethodOptionsUsBankAccountLinkedAccountOptionsPrefetch { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for InvoicePaymentMethodOptionsUsBankAccountLinkedAccountOptionsPrefetch { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> + for InvoicePaymentMethodOptionsUsBankAccountLinkedAccountOptionsPrefetch +{ + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for InvoicePaymentMethodOptionsUsBankAccountLinkedAccountOptionsPrefetch")) + } +} diff --git a/generated/stripe_shared/src/invoice_rendering_pdf.rs b/generated/stripe_shared/src/invoice_rendering_pdf.rs new file mode 100644 index 000000000..5ede36ef1 --- /dev/null +++ b/generated/stripe_shared/src/invoice_rendering_pdf.rs @@ -0,0 +1,66 @@ +#[derive(Copy, Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct InvoiceRenderingPdf { + /// Page size of invoice pdf. + /// Options include a4, letter, and auto. + /// If set to auto, page size will be switched to a4 or letter based on customer locale. + pub page_size: Option, +} +/// Page size of invoice pdf. +/// Options include a4, letter, and auto. +/// If set to auto, page size will be switched to a4 or letter based on customer locale. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum InvoiceRenderingPdfPageSize { + A4, + Auto, + Letter, +} +impl InvoiceRenderingPdfPageSize { + pub fn as_str(self) -> &'static str { + use InvoiceRenderingPdfPageSize::*; + match self { + A4 => "a4", + Auto => "auto", + Letter => "letter", + } + } +} + +impl std::str::FromStr for InvoiceRenderingPdfPageSize { + type Err = (); + fn from_str(s: &str) -> Result { + use InvoiceRenderingPdfPageSize::*; + match s { + "a4" => Ok(A4), + "auto" => Ok(Auto), + "letter" => Ok(Letter), + _ => Err(()), + } + } +} +impl std::fmt::Display for InvoiceRenderingPdfPageSize { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for InvoiceRenderingPdfPageSize { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for InvoiceRenderingPdfPageSize { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for InvoiceRenderingPdfPageSize { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s) + .map_err(|_| serde::de::Error::custom("Unknown value for InvoiceRenderingPdfPageSize")) + } +} diff --git a/generated/stripe_shared/src/invoice_setting_custom_field.rs b/generated/stripe_shared/src/invoice_setting_custom_field.rs new file mode 100644 index 000000000..6a3c97ccc --- /dev/null +++ b/generated/stripe_shared/src/invoice_setting_custom_field.rs @@ -0,0 +1,7 @@ +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct InvoiceSettingCustomField { + /// The name of the custom field. + pub name: String, + /// The value of the custom field. + pub value: String, +} diff --git a/generated/stripe_shared/src/invoice_setting_customer_setting.rs b/generated/stripe_shared/src/invoice_setting_customer_setting.rs new file mode 100644 index 000000000..4af0fd658 --- /dev/null +++ b/generated/stripe_shared/src/invoice_setting_customer_setting.rs @@ -0,0 +1,11 @@ +#[derive(Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct InvoiceSettingCustomerSetting { + /// Default custom fields to be displayed on invoices for this customer. + pub custom_fields: Option>, + /// ID of a payment method that's attached to the customer, to be used as the customer's default payment method for subscriptions and invoices. + pub default_payment_method: Option>, + /// Default footer to be displayed on invoices for this customer. + pub footer: Option, + /// Default options for invoice PDF rendering for this customer. + pub rendering_options: Option, +} diff --git a/generated/stripe_shared/src/invoice_setting_quote_setting.rs b/generated/stripe_shared/src/invoice_setting_quote_setting.rs new file mode 100644 index 000000000..079a33825 --- /dev/null +++ b/generated/stripe_shared/src/invoice_setting_quote_setting.rs @@ -0,0 +1,7 @@ +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct InvoiceSettingQuoteSetting { + /// Number of days within which a customer must pay invoices generated by this quote. + /// This value will be `null` for quotes where `collection_method=charge_automatically`. + pub days_until_due: Option, + pub issuer: stripe_shared::ConnectAccountReference, +} diff --git a/generated/stripe_shared/src/invoice_setting_rendering_options.rs b/generated/stripe_shared/src/invoice_setting_rendering_options.rs new file mode 100644 index 000000000..152f5561f --- /dev/null +++ b/generated/stripe_shared/src/invoice_setting_rendering_options.rs @@ -0,0 +1,5 @@ +#[derive(Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct InvoiceSettingRenderingOptions { + /// How line-item prices and amounts will be displayed with respect to tax on invoice PDFs. + pub amount_tax_display: Option, +} diff --git a/generated/stripe_shared/src/invoice_setting_subscription_schedule_phase_setting.rs b/generated/stripe_shared/src/invoice_setting_subscription_schedule_phase_setting.rs new file mode 100644 index 000000000..9263d736a --- /dev/null +++ b/generated/stripe_shared/src/invoice_setting_subscription_schedule_phase_setting.rs @@ -0,0 +1,13 @@ +#[derive(Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct InvoiceSettingSubscriptionSchedulePhaseSetting { + /// The account tax IDs associated with this phase of the subscription schedule. + /// Will be set on invoices generated by this phase of the subscription schedule. + #[serde(skip_serializing_if = "Option::is_none")] + pub account_tax_ids: Option>>, + /// Number of days within which a customer must pay invoices generated by this subscription schedule. + /// This value will be `null` for subscription schedules where `billing=charge_automatically`. + pub days_until_due: Option, + /// The connected account that issues the invoice. + /// The invoice is presented with the branding and support information of the specified account. + pub issuer: Option, +} diff --git a/generated/stripe_shared/src/invoice_setting_subscription_schedule_setting.rs b/generated/stripe_shared/src/invoice_setting_subscription_schedule_setting.rs new file mode 100644 index 000000000..1d85917fd --- /dev/null +++ b/generated/stripe_shared/src/invoice_setting_subscription_schedule_setting.rs @@ -0,0 +1,11 @@ +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct InvoiceSettingSubscriptionScheduleSetting { + /// The account tax IDs associated with the subscription schedule. + /// Will be set on invoices generated by the subscription schedule. + #[serde(skip_serializing_if = "Option::is_none")] + pub account_tax_ids: Option>>, + /// Number of days within which a customer must pay invoices generated by this subscription schedule. + /// This value will be `null` for subscription schedules where `billing=charge_automatically`. + pub days_until_due: Option, + pub issuer: stripe_shared::ConnectAccountReference, +} diff --git a/generated/stripe_shared/src/invoice_tax_amount.rs b/generated/stripe_shared/src/invoice_tax_amount.rs new file mode 100644 index 000000000..f72f84f57 --- /dev/null +++ b/generated/stripe_shared/src/invoice_tax_amount.rs @@ -0,0 +1,111 @@ +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct InvoiceTaxAmount { + /// The amount, in cents (or local equivalent), of the tax. + pub amount: i64, + /// Whether this tax amount is inclusive or exclusive. + pub inclusive: bool, + /// The tax rate that was applied to get this tax amount. + pub tax_rate: stripe_types::Expandable, + /// The reasoning behind this tax, for example, if the product is tax exempt. + /// The possible values for this field may be extended as new tax rules are supported. + pub taxability_reason: Option, + /// The amount on which tax is calculated, in cents (or local equivalent). + pub taxable_amount: Option, +} +/// The reasoning behind this tax, for example, if the product is tax exempt. +/// The possible values for this field may be extended as new tax rules are supported. +#[derive(Copy, Clone, Eq, PartialEq)] +#[non_exhaustive] +pub enum InvoiceTaxAmountTaxabilityReason { + CustomerExempt, + NotCollecting, + NotSubjectToTax, + NotSupported, + PortionProductExempt, + PortionReducedRated, + PortionStandardRated, + ProductExempt, + ProductExemptHoliday, + ProportionallyRated, + ReducedRated, + ReverseCharge, + StandardRated, + TaxableBasisReduced, + ZeroRated, + /// An unrecognized value from Stripe. Should not be used as a request parameter. + Unknown, +} +impl InvoiceTaxAmountTaxabilityReason { + pub fn as_str(self) -> &'static str { + use InvoiceTaxAmountTaxabilityReason::*; + match self { + CustomerExempt => "customer_exempt", + NotCollecting => "not_collecting", + NotSubjectToTax => "not_subject_to_tax", + NotSupported => "not_supported", + PortionProductExempt => "portion_product_exempt", + PortionReducedRated => "portion_reduced_rated", + PortionStandardRated => "portion_standard_rated", + ProductExempt => "product_exempt", + ProductExemptHoliday => "product_exempt_holiday", + ProportionallyRated => "proportionally_rated", + ReducedRated => "reduced_rated", + ReverseCharge => "reverse_charge", + StandardRated => "standard_rated", + TaxableBasisReduced => "taxable_basis_reduced", + ZeroRated => "zero_rated", + Unknown => "unknown", + } + } +} + +impl std::str::FromStr for InvoiceTaxAmountTaxabilityReason { + type Err = (); + fn from_str(s: &str) -> Result { + use InvoiceTaxAmountTaxabilityReason::*; + match s { + "customer_exempt" => Ok(CustomerExempt), + "not_collecting" => Ok(NotCollecting), + "not_subject_to_tax" => Ok(NotSubjectToTax), + "not_supported" => Ok(NotSupported), + "portion_product_exempt" => Ok(PortionProductExempt), + "portion_reduced_rated" => Ok(PortionReducedRated), + "portion_standard_rated" => Ok(PortionStandardRated), + "product_exempt" => Ok(ProductExempt), + "product_exempt_holiday" => Ok(ProductExemptHoliday), + "proportionally_rated" => Ok(ProportionallyRated), + "reduced_rated" => Ok(ReducedRated), + "reverse_charge" => Ok(ReverseCharge), + "standard_rated" => Ok(StandardRated), + "taxable_basis_reduced" => Ok(TaxableBasisReduced), + "zero_rated" => Ok(ZeroRated), + _ => Err(()), + } + } +} +impl std::fmt::Display for InvoiceTaxAmountTaxabilityReason { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for InvoiceTaxAmountTaxabilityReason { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for InvoiceTaxAmountTaxabilityReason { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for InvoiceTaxAmountTaxabilityReason { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Ok(Self::from_str(&s).unwrap_or(InvoiceTaxAmountTaxabilityReason::Unknown)) + } +} diff --git a/generated/stripe_shared/src/invoice_threshold_reason.rs b/generated/stripe_shared/src/invoice_threshold_reason.rs new file mode 100644 index 000000000..fdf1ccc36 --- /dev/null +++ b/generated/stripe_shared/src/invoice_threshold_reason.rs @@ -0,0 +1,7 @@ +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct InvoiceThresholdReason { + /// The total invoice amount threshold boundary if it triggered the threshold invoice. + pub amount_gte: Option, + /// Indicates which line items triggered a threshold invoice. + pub item_reasons: Vec, +} diff --git a/generated/stripe_shared/src/invoice_transfer_data.rs b/generated/stripe_shared/src/invoice_transfer_data.rs new file mode 100644 index 000000000..82e728763 --- /dev/null +++ b/generated/stripe_shared/src/invoice_transfer_data.rs @@ -0,0 +1,8 @@ +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct InvoiceTransferData { + /// The amount in cents (or local equivalent) that will be transferred to the destination account when the invoice is paid. + /// By default, the entire amount is transferred to the destination. + pub amount: Option, + /// The account where funds from the payment will be transferred to upon payment success. + pub destination: stripe_types::Expandable, +} diff --git a/generated/stripe_shared/src/invoices_from_invoice.rs b/generated/stripe_shared/src/invoices_from_invoice.rs new file mode 100644 index 000000000..86c86e8cc --- /dev/null +++ b/generated/stripe_shared/src/invoices_from_invoice.rs @@ -0,0 +1,7 @@ +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct InvoicesFromInvoice { + /// The relation between this invoice and the cloned invoice + pub action: String, + /// The invoice that was cloned. + pub invoice: stripe_types::Expandable, +} diff --git a/generated/stripe_shared/src/invoices_invoice_rendering.rs b/generated/stripe_shared/src/invoices_invoice_rendering.rs new file mode 100644 index 000000000..4197addf4 --- /dev/null +++ b/generated/stripe_shared/src/invoices_invoice_rendering.rs @@ -0,0 +1,7 @@ +#[derive(Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct InvoicesInvoiceRendering { + /// How line-item prices and amounts will be displayed with respect to tax on invoice PDFs. + pub amount_tax_display: Option, + /// Invoice pdf rendering options + pub pdf: Option, +} diff --git a/generated/stripe_shared/src/invoices_payment_method_options.rs b/generated/stripe_shared/src/invoices_payment_method_options.rs new file mode 100644 index 000000000..899acde20 --- /dev/null +++ b/generated/stripe_shared/src/invoices_payment_method_options.rs @@ -0,0 +1,15 @@ +#[derive(Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct InvoicesPaymentMethodOptions { + /// If paying by `acss_debit`, this sub-hash contains details about the Canadian pre-authorized debit payment method options to pass to the invoice’s PaymentIntent. + pub acss_debit: Option, + /// If paying by `bancontact`, this sub-hash contains details about the Bancontact payment method options to pass to the invoice’s PaymentIntent. + pub bancontact: Option, + /// If paying by `card`, this sub-hash contains details about the Card payment method options to pass to the invoice’s PaymentIntent. + pub card: Option, + /// If paying by `customer_balance`, this sub-hash contains details about the Bank transfer payment method options to pass to the invoice’s PaymentIntent. + pub customer_balance: Option, + /// If paying by `konbini`, this sub-hash contains details about the Konbini payment method options to pass to the invoice’s PaymentIntent. + pub konbini: Option, + /// If paying by `us_bank_account`, this sub-hash contains details about the ACH direct debit payment method options to pass to the invoice’s PaymentIntent. + pub us_bank_account: Option, +} diff --git a/generated/stripe_shared/src/invoices_payment_settings.rs b/generated/stripe_shared/src/invoices_payment_settings.rs new file mode 100644 index 000000000..e0137a6da --- /dev/null +++ b/generated/stripe_shared/src/invoices_payment_settings.rs @@ -0,0 +1,143 @@ +#[derive(Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct InvoicesPaymentSettings { + /// ID of the mandate to be used for this invoice. + /// It must correspond to the payment method used to pay the invoice, including the invoice's default_payment_method or default_source, if set. + pub default_mandate: Option, + /// Payment-method-specific configuration to provide to the invoice’s PaymentIntent. + pub payment_method_options: Option, + /// The list of payment method types (e.g. + /// card) to provide to the invoice’s PaymentIntent. + /// If not set, Stripe attempts to automatically determine the types to use by looking at the invoice’s default payment method, the subscription’s default payment method, the customer’s default payment method, and your [invoice template settings](https://dashboard.stripe.com/settings/billing/invoice). + pub payment_method_types: Option>, +} +/// The list of payment method types (e.g. +/// card) to provide to the invoice’s PaymentIntent. +/// If not set, Stripe attempts to automatically determine the types to use by looking at the invoice’s default payment method, the subscription’s default payment method, the customer’s default payment method, and your [invoice template settings](https://dashboard.stripe.com/settings/billing/invoice). +#[derive(Copy, Clone, Eq, PartialEq)] +#[non_exhaustive] +pub enum InvoicesPaymentSettingsPaymentMethodTypes { + AchCreditTransfer, + AchDebit, + AcssDebit, + AuBecsDebit, + BacsDebit, + Bancontact, + Boleto, + Card, + Cashapp, + CustomerBalance, + Eps, + Fpx, + Giropay, + Grabpay, + Ideal, + Konbini, + Link, + P24, + Paynow, + Paypal, + Promptpay, + SepaCreditTransfer, + SepaDebit, + Sofort, + UsBankAccount, + WechatPay, + /// An unrecognized value from Stripe. Should not be used as a request parameter. + Unknown, +} +impl InvoicesPaymentSettingsPaymentMethodTypes { + pub fn as_str(self) -> &'static str { + use InvoicesPaymentSettingsPaymentMethodTypes::*; + match self { + AchCreditTransfer => "ach_credit_transfer", + AchDebit => "ach_debit", + AcssDebit => "acss_debit", + AuBecsDebit => "au_becs_debit", + BacsDebit => "bacs_debit", + Bancontact => "bancontact", + Boleto => "boleto", + Card => "card", + Cashapp => "cashapp", + CustomerBalance => "customer_balance", + Eps => "eps", + Fpx => "fpx", + Giropay => "giropay", + Grabpay => "grabpay", + Ideal => "ideal", + Konbini => "konbini", + Link => "link", + P24 => "p24", + Paynow => "paynow", + Paypal => "paypal", + Promptpay => "promptpay", + SepaCreditTransfer => "sepa_credit_transfer", + SepaDebit => "sepa_debit", + Sofort => "sofort", + UsBankAccount => "us_bank_account", + WechatPay => "wechat_pay", + Unknown => "unknown", + } + } +} + +impl std::str::FromStr for InvoicesPaymentSettingsPaymentMethodTypes { + type Err = (); + fn from_str(s: &str) -> Result { + use InvoicesPaymentSettingsPaymentMethodTypes::*; + match s { + "ach_credit_transfer" => Ok(AchCreditTransfer), + "ach_debit" => Ok(AchDebit), + "acss_debit" => Ok(AcssDebit), + "au_becs_debit" => Ok(AuBecsDebit), + "bacs_debit" => Ok(BacsDebit), + "bancontact" => Ok(Bancontact), + "boleto" => Ok(Boleto), + "card" => Ok(Card), + "cashapp" => Ok(Cashapp), + "customer_balance" => Ok(CustomerBalance), + "eps" => Ok(Eps), + "fpx" => Ok(Fpx), + "giropay" => Ok(Giropay), + "grabpay" => Ok(Grabpay), + "ideal" => Ok(Ideal), + "konbini" => Ok(Konbini), + "link" => Ok(Link), + "p24" => Ok(P24), + "paynow" => Ok(Paynow), + "paypal" => Ok(Paypal), + "promptpay" => Ok(Promptpay), + "sepa_credit_transfer" => Ok(SepaCreditTransfer), + "sepa_debit" => Ok(SepaDebit), + "sofort" => Ok(Sofort), + "us_bank_account" => Ok(UsBankAccount), + "wechat_pay" => Ok(WechatPay), + _ => Err(()), + } + } +} +impl std::fmt::Display for InvoicesPaymentSettingsPaymentMethodTypes { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for InvoicesPaymentSettingsPaymentMethodTypes { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for InvoicesPaymentSettingsPaymentMethodTypes { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for InvoicesPaymentSettingsPaymentMethodTypes { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Ok(Self::from_str(&s).unwrap_or(InvoicesPaymentSettingsPaymentMethodTypes::Unknown)) + } +} diff --git a/generated/stripe_shared/src/invoices_resource_invoice_tax_id.rs b/generated/stripe_shared/src/invoices_resource_invoice_tax_id.rs new file mode 100644 index 000000000..fd0cd95ed --- /dev/null +++ b/generated/stripe_shared/src/invoices_resource_invoice_tax_id.rs @@ -0,0 +1,258 @@ +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct InvoicesResourceInvoiceTaxId { + /// The type of the tax ID, one of `ad_nrt`, `ar_cuit`, `eu_vat`, `bo_tin`, `br_cnpj`, `br_cpf`, `cn_tin`, `co_nit`, `cr_tin`, `do_rcn`, `ec_ruc`, `eu_oss_vat`, `pe_ruc`, `ro_tin`, `rs_pib`, `sv_nit`, `uy_ruc`, `ve_rif`, `vn_tin`, `gb_vat`, `nz_gst`, `au_abn`, `au_arn`, `in_gst`, `no_vat`, `za_vat`, `ch_vat`, `mx_rfc`, `sg_uen`, `ru_inn`, `ru_kpp`, `ca_bn`, `hk_br`, `es_cif`, `tw_vat`, `th_vat`, `jp_cn`, `jp_rn`, `jp_trn`, `li_uid`, `my_itn`, `us_ein`, `kr_brn`, `ca_qst`, `ca_gst_hst`, `ca_pst_bc`, `ca_pst_mb`, `ca_pst_sk`, `my_sst`, `sg_gst`, `ae_trn`, `cl_tin`, `sa_vat`, `id_npwp`, `my_frp`, `il_vat`, `ge_vat`, `ua_vat`, `is_vat`, `bg_uic`, `hu_tin`, `si_tin`, `ke_pin`, `tr_tin`, `eg_tin`, `ph_tin`, or `unknown`. + #[serde(rename = "type")] + pub type_: InvoicesResourceInvoiceTaxIdType, + /// The value of the tax ID. + pub value: Option, +} +/// The type of the tax ID, one of `ad_nrt`, `ar_cuit`, `eu_vat`, `bo_tin`, `br_cnpj`, `br_cpf`, `cn_tin`, `co_nit`, `cr_tin`, `do_rcn`, `ec_ruc`, `eu_oss_vat`, `pe_ruc`, `ro_tin`, `rs_pib`, `sv_nit`, `uy_ruc`, `ve_rif`, `vn_tin`, `gb_vat`, `nz_gst`, `au_abn`, `au_arn`, `in_gst`, `no_vat`, `za_vat`, `ch_vat`, `mx_rfc`, `sg_uen`, `ru_inn`, `ru_kpp`, `ca_bn`, `hk_br`, `es_cif`, `tw_vat`, `th_vat`, `jp_cn`, `jp_rn`, `jp_trn`, `li_uid`, `my_itn`, `us_ein`, `kr_brn`, `ca_qst`, `ca_gst_hst`, `ca_pst_bc`, `ca_pst_mb`, `ca_pst_sk`, `my_sst`, `sg_gst`, `ae_trn`, `cl_tin`, `sa_vat`, `id_npwp`, `my_frp`, `il_vat`, `ge_vat`, `ua_vat`, `is_vat`, `bg_uic`, `hu_tin`, `si_tin`, `ke_pin`, `tr_tin`, `eg_tin`, `ph_tin`, or `unknown`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum InvoicesResourceInvoiceTaxIdType { + AdNrt, + AeTrn, + ArCuit, + AuAbn, + AuArn, + BgUic, + BoTin, + BrCnpj, + BrCpf, + CaBn, + CaGstHst, + CaPstBc, + CaPstMb, + CaPstSk, + CaQst, + ChVat, + ClTin, + CnTin, + CoNit, + CrTin, + DoRcn, + EcRuc, + EgTin, + EsCif, + EuOssVat, + EuVat, + GbVat, + GeVat, + HkBr, + HuTin, + IdNpwp, + IlVat, + InGst, + IsVat, + JpCn, + JpRn, + JpTrn, + KePin, + KrBrn, + LiUid, + MxRfc, + MyFrp, + MyItn, + MySst, + NoVat, + NzGst, + PeRuc, + PhTin, + RoTin, + RsPib, + RuInn, + RuKpp, + SaVat, + SgGst, + SgUen, + SiTin, + SvNit, + ThVat, + TrTin, + TwVat, + UaVat, + Unknown, + UsEin, + UyRuc, + VeRif, + VnTin, + ZaVat, +} +impl InvoicesResourceInvoiceTaxIdType { + pub fn as_str(self) -> &'static str { + use InvoicesResourceInvoiceTaxIdType::*; + match self { + AdNrt => "ad_nrt", + AeTrn => "ae_trn", + ArCuit => "ar_cuit", + AuAbn => "au_abn", + AuArn => "au_arn", + BgUic => "bg_uic", + BoTin => "bo_tin", + BrCnpj => "br_cnpj", + BrCpf => "br_cpf", + CaBn => "ca_bn", + CaGstHst => "ca_gst_hst", + CaPstBc => "ca_pst_bc", + CaPstMb => "ca_pst_mb", + CaPstSk => "ca_pst_sk", + CaQst => "ca_qst", + ChVat => "ch_vat", + ClTin => "cl_tin", + CnTin => "cn_tin", + CoNit => "co_nit", + CrTin => "cr_tin", + DoRcn => "do_rcn", + EcRuc => "ec_ruc", + EgTin => "eg_tin", + EsCif => "es_cif", + EuOssVat => "eu_oss_vat", + EuVat => "eu_vat", + GbVat => "gb_vat", + GeVat => "ge_vat", + HkBr => "hk_br", + HuTin => "hu_tin", + IdNpwp => "id_npwp", + IlVat => "il_vat", + InGst => "in_gst", + IsVat => "is_vat", + JpCn => "jp_cn", + JpRn => "jp_rn", + JpTrn => "jp_trn", + KePin => "ke_pin", + KrBrn => "kr_brn", + LiUid => "li_uid", + MxRfc => "mx_rfc", + MyFrp => "my_frp", + MyItn => "my_itn", + MySst => "my_sst", + NoVat => "no_vat", + NzGst => "nz_gst", + PeRuc => "pe_ruc", + PhTin => "ph_tin", + RoTin => "ro_tin", + RsPib => "rs_pib", + RuInn => "ru_inn", + RuKpp => "ru_kpp", + SaVat => "sa_vat", + SgGst => "sg_gst", + SgUen => "sg_uen", + SiTin => "si_tin", + SvNit => "sv_nit", + ThVat => "th_vat", + TrTin => "tr_tin", + TwVat => "tw_vat", + UaVat => "ua_vat", + Unknown => "unknown", + UsEin => "us_ein", + UyRuc => "uy_ruc", + VeRif => "ve_rif", + VnTin => "vn_tin", + ZaVat => "za_vat", + } + } +} + +impl std::str::FromStr for InvoicesResourceInvoiceTaxIdType { + type Err = (); + fn from_str(s: &str) -> Result { + use InvoicesResourceInvoiceTaxIdType::*; + match s { + "ad_nrt" => Ok(AdNrt), + "ae_trn" => Ok(AeTrn), + "ar_cuit" => Ok(ArCuit), + "au_abn" => Ok(AuAbn), + "au_arn" => Ok(AuArn), + "bg_uic" => Ok(BgUic), + "bo_tin" => Ok(BoTin), + "br_cnpj" => Ok(BrCnpj), + "br_cpf" => Ok(BrCpf), + "ca_bn" => Ok(CaBn), + "ca_gst_hst" => Ok(CaGstHst), + "ca_pst_bc" => Ok(CaPstBc), + "ca_pst_mb" => Ok(CaPstMb), + "ca_pst_sk" => Ok(CaPstSk), + "ca_qst" => Ok(CaQst), + "ch_vat" => Ok(ChVat), + "cl_tin" => Ok(ClTin), + "cn_tin" => Ok(CnTin), + "co_nit" => Ok(CoNit), + "cr_tin" => Ok(CrTin), + "do_rcn" => Ok(DoRcn), + "ec_ruc" => Ok(EcRuc), + "eg_tin" => Ok(EgTin), + "es_cif" => Ok(EsCif), + "eu_oss_vat" => Ok(EuOssVat), + "eu_vat" => Ok(EuVat), + "gb_vat" => Ok(GbVat), + "ge_vat" => Ok(GeVat), + "hk_br" => Ok(HkBr), + "hu_tin" => Ok(HuTin), + "id_npwp" => Ok(IdNpwp), + "il_vat" => Ok(IlVat), + "in_gst" => Ok(InGst), + "is_vat" => Ok(IsVat), + "jp_cn" => Ok(JpCn), + "jp_rn" => Ok(JpRn), + "jp_trn" => Ok(JpTrn), + "ke_pin" => Ok(KePin), + "kr_brn" => Ok(KrBrn), + "li_uid" => Ok(LiUid), + "mx_rfc" => Ok(MxRfc), + "my_frp" => Ok(MyFrp), + "my_itn" => Ok(MyItn), + "my_sst" => Ok(MySst), + "no_vat" => Ok(NoVat), + "nz_gst" => Ok(NzGst), + "pe_ruc" => Ok(PeRuc), + "ph_tin" => Ok(PhTin), + "ro_tin" => Ok(RoTin), + "rs_pib" => Ok(RsPib), + "ru_inn" => Ok(RuInn), + "ru_kpp" => Ok(RuKpp), + "sa_vat" => Ok(SaVat), + "sg_gst" => Ok(SgGst), + "sg_uen" => Ok(SgUen), + "si_tin" => Ok(SiTin), + "sv_nit" => Ok(SvNit), + "th_vat" => Ok(ThVat), + "tr_tin" => Ok(TrTin), + "tw_vat" => Ok(TwVat), + "ua_vat" => Ok(UaVat), + "unknown" => Ok(Unknown), + "us_ein" => Ok(UsEin), + "uy_ruc" => Ok(UyRuc), + "ve_rif" => Ok(VeRif), + "vn_tin" => Ok(VnTin), + "za_vat" => Ok(ZaVat), + _ => Err(()), + } + } +} +impl std::fmt::Display for InvoicesResourceInvoiceTaxIdType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for InvoicesResourceInvoiceTaxIdType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for InvoicesResourceInvoiceTaxIdType { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for InvoicesResourceInvoiceTaxIdType { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| { + serde::de::Error::custom("Unknown value for InvoicesResourceInvoiceTaxIdType") + }) + } +} diff --git a/generated/stripe_shared/src/invoices_resource_line_items_credited_items.rs b/generated/stripe_shared/src/invoices_resource_line_items_credited_items.rs new file mode 100644 index 000000000..bf86d3cc0 --- /dev/null +++ b/generated/stripe_shared/src/invoices_resource_line_items_credited_items.rs @@ -0,0 +1,7 @@ +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct InvoicesResourceLineItemsCreditedItems { + /// Invoice containing the credited invoice line items + pub invoice: String, + /// Credited invoice line items + pub invoice_line_items: Vec, +} diff --git a/generated/stripe_shared/src/invoices_resource_line_items_proration_details.rs b/generated/stripe_shared/src/invoices_resource_line_items_proration_details.rs new file mode 100644 index 000000000..ff08c0c51 --- /dev/null +++ b/generated/stripe_shared/src/invoices_resource_line_items_proration_details.rs @@ -0,0 +1,5 @@ +#[derive(Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct InvoicesResourceLineItemsProrationDetails { + /// For a credit proration `line_item`, the original debit line_items to which the credit proration applies. + pub credited_items: Option, +} diff --git a/generated/stripe_shared/src/invoices_shipping_cost.rs b/generated/stripe_shared/src/invoices_shipping_cost.rs new file mode 100644 index 000000000..944ab7de0 --- /dev/null +++ b/generated/stripe_shared/src/invoices_shipping_cost.rs @@ -0,0 +1,14 @@ +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct InvoicesShippingCost { + /// Total shipping cost before any taxes are applied. + pub amount_subtotal: i64, + /// Total tax amount applied due to shipping costs. If no tax was applied, defaults to 0. + pub amount_tax: i64, + /// Total shipping cost after taxes are applied. + pub amount_total: i64, + /// The ID of the ShippingRate for this invoice. + pub shipping_rate: Option>, + /// The taxes applied to the shipping rate. + #[serde(skip_serializing_if = "Option::is_none")] + pub taxes: Option>, +} diff --git a/generated/stripe_shared/src/invoices_status_transitions.rs b/generated/stripe_shared/src/invoices_status_transitions.rs new file mode 100644 index 000000000..6f9935f05 --- /dev/null +++ b/generated/stripe_shared/src/invoices_status_transitions.rs @@ -0,0 +1,11 @@ +#[derive(Copy, Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct InvoicesStatusTransitions { + /// The time that the invoice draft was finalized. + pub finalized_at: Option, + /// The time that the invoice was marked uncollectible. + pub marked_uncollectible_at: Option, + /// The time that the invoice was paid. + pub paid_at: Option, + /// The time that the invoice was voided. + pub voided_at: Option, +} diff --git a/generated/stripe_shared/src/issuing_authorization.rs b/generated/stripe_shared/src/issuing_authorization.rs new file mode 100644 index 000000000..e0d046fcb --- /dev/null +++ b/generated/stripe_shared/src/issuing_authorization.rs @@ -0,0 +1,203 @@ +/// When an [issued card](https://stripe.com/docs/issuing) is used to make a purchase, an Issuing `Authorization`. +/// object is created. +/// [Authorizations](https://stripe.com/docs/issuing/purchases/authorizations) must be approved for the. +/// purchase to be completed successfully. +/// +/// Related guide: [Issued card authorizations](https://stripe.com/docs/issuing/purchases/authorizations). +/// +/// For more details see <>. +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct IssuingAuthorization { + /// The total amount that was authorized or rejected. + /// This amount is in `currency` and in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal). + /// `amount` should be the same as `merchant_amount`, unless `currency` and `merchant_currency` are different. + pub amount: i64, + /// Detailed breakdown of amount components. + /// These amounts are denominated in `currency` and in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal). + pub amount_details: Option, + /// Whether the authorization has been approved. + pub approved: bool, + /// How the card details were provided. + pub authorization_method: stripe_shared::IssuingAuthorizationAuthorizationMethod, + /// List of balance transactions associated with this authorization. + pub balance_transactions: Vec, + pub card: stripe_shared::IssuingCard, + /// The cardholder to whom this authorization belongs. + pub cardholder: Option>, + /// Time at which the object was created. Measured in seconds since the Unix epoch. + pub created: stripe_types::Timestamp, + /// The currency of the cardholder. + /// This currency can be different from the currency presented at authorization and the `merchant_currency` field on this authorization. + /// Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. + /// Must be a [supported currency](https://stripe.com/docs/currencies). + pub currency: stripe_types::Currency, + /// Unique identifier for the object. + pub id: stripe_shared::IssuingAuthorizationId, + /// Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + pub livemode: bool, + /// The total amount that was authorized or rejected. + /// This amount is in the `merchant_currency` and in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal). + /// `merchant_amount` should be the same as `amount`, unless `merchant_currency` and `currency` are different. + pub merchant_amount: i64, + /// The local currency that was presented to the cardholder for the authorization. + /// This currency can be different from the cardholder currency and the `currency` field on this authorization. + /// Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. + /// Must be a [supported currency](https://stripe.com/docs/currencies). + pub merchant_currency: stripe_types::Currency, + pub merchant_data: stripe_shared::IssuingAuthorizationMerchantData, + /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. + /// This can be useful for storing additional information about the object in a structured format. + pub metadata: std::collections::HashMap, + /// Details about the authorization, such as identifiers, set by the card network. + pub network_data: Option, + /// The pending authorization request. + /// This field will only be non-null during an `issuing_authorization.request` webhook. + pub pending_request: Option, + /// History of every time a `pending_request` authorization was approved/declined, either by you directly or by Stripe (e.g. + /// based on your spending_controls). + /// If the merchant changes the authorization by performing an incremental authorization, you can look at this field to see the previous requests for the authorization. + /// This field can be helpful in determining why a given authorization was approved/declined. + pub request_history: Vec, + /// The current status of the authorization in its lifecycle. + pub status: stripe_shared::IssuingAuthorizationStatus, + /// [Token](https://stripe.com/docs/api/issuing/tokens/object) object used for this authorization. + /// If a network token was not used for this authorization, this field will be null. + #[serde(skip_serializing_if = "Option::is_none")] + pub token: Option>, + /// List of [transactions](https://stripe.com/docs/api/issuing/transactions) associated with this authorization. + pub transactions: Vec, + /// [Treasury](https://stripe.com/docs/api/treasury) details related to this authorization if it was created on a [FinancialAccount](https://stripe.com/docs/api/treasury/financial_accounts). + #[serde(skip_serializing_if = "Option::is_none")] + pub treasury: Option, + pub verification_data: stripe_shared::IssuingAuthorizationVerificationData, + /// The digital wallet used for this transaction. + /// One of `apple_pay`, `google_pay`, or `samsung_pay`. + /// Will populate as `null` when no digital wallet was utilized. + pub wallet: Option, +} +impl stripe_types::Object for IssuingAuthorization { + type Id = stripe_shared::IssuingAuthorizationId; + fn id(&self) -> &Self::Id { + &self.id + } +} +stripe_types::def_id!(IssuingAuthorizationId, "iauth_"); +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum IssuingAuthorizationAuthorizationMethod { + Chip, + Contactless, + KeyedIn, + Online, + Swipe, +} +impl IssuingAuthorizationAuthorizationMethod { + pub fn as_str(self) -> &'static str { + use IssuingAuthorizationAuthorizationMethod::*; + match self { + Chip => "chip", + Contactless => "contactless", + KeyedIn => "keyed_in", + Online => "online", + Swipe => "swipe", + } + } +} + +impl std::str::FromStr for IssuingAuthorizationAuthorizationMethod { + type Err = (); + fn from_str(s: &str) -> Result { + use IssuingAuthorizationAuthorizationMethod::*; + match s { + "chip" => Ok(Chip), + "contactless" => Ok(Contactless), + "keyed_in" => Ok(KeyedIn), + "online" => Ok(Online), + "swipe" => Ok(Swipe), + _ => Err(()), + } + } +} +impl std::fmt::Display for IssuingAuthorizationAuthorizationMethod { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for IssuingAuthorizationAuthorizationMethod { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for IssuingAuthorizationAuthorizationMethod { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for IssuingAuthorizationAuthorizationMethod { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| { + serde::de::Error::custom("Unknown value for IssuingAuthorizationAuthorizationMethod") + }) + } +} +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum IssuingAuthorizationStatus { + Closed, + Pending, + Reversed, +} +impl IssuingAuthorizationStatus { + pub fn as_str(self) -> &'static str { + use IssuingAuthorizationStatus::*; + match self { + Closed => "closed", + Pending => "pending", + Reversed => "reversed", + } + } +} + +impl std::str::FromStr for IssuingAuthorizationStatus { + type Err = (); + fn from_str(s: &str) -> Result { + use IssuingAuthorizationStatus::*; + match s { + "closed" => Ok(Closed), + "pending" => Ok(Pending), + "reversed" => Ok(Reversed), + _ => Err(()), + } + } +} +impl std::fmt::Display for IssuingAuthorizationStatus { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for IssuingAuthorizationStatus { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for IssuingAuthorizationStatus { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for IssuingAuthorizationStatus { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s) + .map_err(|_| serde::de::Error::custom("Unknown value for IssuingAuthorizationStatus")) + } +} diff --git a/generated/stripe_shared/src/issuing_authorization_amount_details.rs b/generated/stripe_shared/src/issuing_authorization_amount_details.rs new file mode 100644 index 000000000..f4d63c2f2 --- /dev/null +++ b/generated/stripe_shared/src/issuing_authorization_amount_details.rs @@ -0,0 +1,7 @@ +#[derive(Copy, Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct IssuingAuthorizationAmountDetails { + /// The fee charged by the ATM for the cash withdrawal. + pub atm_fee: Option, + /// The amount of cash requested by the cardholder. + pub cashback_amount: Option, +} diff --git a/generated/stripe_shared/src/issuing_authorization_authentication_exemption.rs b/generated/stripe_shared/src/issuing_authorization_authentication_exemption.rs new file mode 100644 index 000000000..b359c3008 --- /dev/null +++ b/generated/stripe_shared/src/issuing_authorization_authentication_exemption.rs @@ -0,0 +1,125 @@ +#[derive(Copy, Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct IssuingAuthorizationAuthenticationExemption { + /// The entity that requested the exemption, either the acquiring merchant or the Issuing user. + pub claimed_by: IssuingAuthorizationAuthenticationExemptionClaimedBy, + /// The specific exemption claimed for this authorization. + #[serde(rename = "type")] + pub type_: IssuingAuthorizationAuthenticationExemptionType, +} +/// The entity that requested the exemption, either the acquiring merchant or the Issuing user. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum IssuingAuthorizationAuthenticationExemptionClaimedBy { + Acquirer, + Issuer, +} +impl IssuingAuthorizationAuthenticationExemptionClaimedBy { + pub fn as_str(self) -> &'static str { + use IssuingAuthorizationAuthenticationExemptionClaimedBy::*; + match self { + Acquirer => "acquirer", + Issuer => "issuer", + } + } +} + +impl std::str::FromStr for IssuingAuthorizationAuthenticationExemptionClaimedBy { + type Err = (); + fn from_str(s: &str) -> Result { + use IssuingAuthorizationAuthenticationExemptionClaimedBy::*; + match s { + "acquirer" => Ok(Acquirer), + "issuer" => Ok(Issuer), + _ => Err(()), + } + } +} +impl std::fmt::Display for IssuingAuthorizationAuthenticationExemptionClaimedBy { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for IssuingAuthorizationAuthenticationExemptionClaimedBy { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for IssuingAuthorizationAuthenticationExemptionClaimedBy { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for IssuingAuthorizationAuthenticationExemptionClaimedBy { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| { + serde::de::Error::custom( + "Unknown value for IssuingAuthorizationAuthenticationExemptionClaimedBy", + ) + }) + } +} +/// The specific exemption claimed for this authorization. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum IssuingAuthorizationAuthenticationExemptionType { + LowValueTransaction, + TransactionRiskAnalysis, + Unknown, +} +impl IssuingAuthorizationAuthenticationExemptionType { + pub fn as_str(self) -> &'static str { + use IssuingAuthorizationAuthenticationExemptionType::*; + match self { + LowValueTransaction => "low_value_transaction", + TransactionRiskAnalysis => "transaction_risk_analysis", + Unknown => "unknown", + } + } +} + +impl std::str::FromStr for IssuingAuthorizationAuthenticationExemptionType { + type Err = (); + fn from_str(s: &str) -> Result { + use IssuingAuthorizationAuthenticationExemptionType::*; + match s { + "low_value_transaction" => Ok(LowValueTransaction), + "transaction_risk_analysis" => Ok(TransactionRiskAnalysis), + "unknown" => Ok(Unknown), + _ => Err(()), + } + } +} +impl std::fmt::Display for IssuingAuthorizationAuthenticationExemptionType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for IssuingAuthorizationAuthenticationExemptionType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for IssuingAuthorizationAuthenticationExemptionType { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for IssuingAuthorizationAuthenticationExemptionType { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| { + serde::de::Error::custom( + "Unknown value for IssuingAuthorizationAuthenticationExemptionType", + ) + }) + } +} diff --git a/src/resources/generated/issuing_authorization_merchant_data.rs b/generated/stripe_shared/src/issuing_authorization_merchant_data.rs similarity index 51% rename from src/resources/generated/issuing_authorization_merchant_data.rs rename to generated/stripe_shared/src/issuing_authorization_merchant_data.rs index e11965262..b88adc535 100644 --- a/src/resources/generated/issuing_authorization_merchant_data.rs +++ b/generated/stripe_shared/src/issuing_authorization_merchant_data.rs @@ -1,44 +1,25 @@ -// ====================================== -// This file was automatically generated. -// ====================================== - -use serde::{Deserialize, Serialize}; - -/// The resource representing a Stripe "IssuingAuthorizationMerchantData". -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct MerchantData { - +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct IssuingAuthorizationMerchantData { /// A categorization of the seller's type of business. - /// /// See our [merchant categories guide](https://stripe.com/docs/issuing/merchant-categories) for a list of possible values. pub category: String, - - /// The merchant category code for the seller’s business. + /// The merchant category code for the seller’s business pub category_code: String, - - /// City where the seller is located. + /// City where the seller is located pub city: Option, - - /// Country where the seller is located. + /// Country where the seller is located pub country: Option, - - /// Name of the seller. + /// Name of the seller pub name: Option, - /// Identifier assigned to the seller by the card network. - /// /// Different card networks may assign different network_id fields to the same merchant. pub network_id: String, - - /// Postal code where the seller is located. + /// Postal code where the seller is located pub postal_code: Option, - - /// State where the seller is located. + /// State where the seller is located pub state: Option, - /// An ID assigned by the seller to the location of the sale. pub terminal_id: Option, - - /// URL provided by the merchant on a 3DS request. + /// URL provided by the merchant on a 3DS request pub url: Option, } diff --git a/generated/stripe_shared/src/issuing_authorization_network_data.rs b/generated/stripe_shared/src/issuing_authorization_network_data.rs new file mode 100644 index 000000000..dae11162c --- /dev/null +++ b/generated/stripe_shared/src/issuing_authorization_network_data.rs @@ -0,0 +1,11 @@ +#[derive(Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct IssuingAuthorizationNetworkData { + /// Identifier assigned to the acquirer by the card network. + /// Sometimes this value is not provided by the network; in this case, the value will be `null`. + pub acquiring_institution_id: Option, + /// The System Trace Audit Number (STAN) is a 6-digit identifier assigned by the acquirer. + /// Prefer `network_data.transaction_id` if present, unless you have special requirements. + pub system_trace_audit_number: Option, + /// Unique identifier for the authorization assigned by the card network used to match subsequent messages, disputes, and transactions. + pub transaction_id: Option, +} diff --git a/generated/stripe_shared/src/issuing_authorization_pending_request.rs b/generated/stripe_shared/src/issuing_authorization_pending_request.rs new file mode 100644 index 000000000..6f6b1f49f --- /dev/null +++ b/generated/stripe_shared/src/issuing_authorization_pending_request.rs @@ -0,0 +1,21 @@ +#[derive(Copy, Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct IssuingAuthorizationPendingRequest { + /// The additional amount Stripe will hold if the authorization is approved, in the card's [currency](https://stripe.com/docs/api#issuing_authorization_object-pending-request-currency) and in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal). + pub amount: i64, + /// Detailed breakdown of amount components. + /// These amounts are denominated in `currency` and in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal). + pub amount_details: Option, + /// Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. + /// Must be a [supported currency](https://stripe.com/docs/currencies). + pub currency: stripe_types::Currency, + /// If set `true`, you may provide [amount](https://stripe.com/docs/api/issuing/authorizations/approve#approve_issuing_authorization-amount) to control how much to hold for the authorization. + pub is_amount_controllable: bool, + /// The amount the merchant is requesting to be authorized in the `merchant_currency`. + /// The amount is in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal). + pub merchant_amount: i64, + /// The local currency the merchant is requesting to authorize. + pub merchant_currency: stripe_types::Currency, + /// The card network's estimate of the likelihood that an authorization is fraudulent. + /// Takes on values between 1 and 99. + pub network_risk_score: Option, +} diff --git a/generated/stripe_shared/src/issuing_authorization_request.rs b/generated/stripe_shared/src/issuing_authorization_request.rs new file mode 100644 index 000000000..406ac98d0 --- /dev/null +++ b/generated/stripe_shared/src/issuing_authorization_request.rs @@ -0,0 +1,131 @@ +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct IssuingAuthorizationRequest { + /// The `pending_request.amount` at the time of the request, presented in your card's currency and in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal). + /// Stripe held this amount from your account to fund the authorization if the request was approved. + pub amount: i64, + /// Detailed breakdown of amount components. + /// These amounts are denominated in `currency` and in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal). + pub amount_details: Option, + /// Whether this request was approved. + pub approved: bool, + /// A code created by Stripe which is shared with the merchant to validate the authorization. + /// This field will be populated if the authorization message was approved. + /// The code typically starts with the letter "S", followed by a six-digit number. + /// For example, "S498162". + /// Please note that the code is not guaranteed to be unique across authorizations. + pub authorization_code: Option, + /// Time at which the object was created. Measured in seconds since the Unix epoch. + pub created: stripe_types::Timestamp, + /// Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. + /// Must be a [supported currency](https://stripe.com/docs/currencies). + pub currency: stripe_types::Currency, + /// The `pending_request.merchant_amount` at the time of the request, presented in the `merchant_currency` and in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal). + pub merchant_amount: i64, + /// The currency that was collected by the merchant and presented to the cardholder for the authorization. + /// Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. + /// Must be a [supported currency](https://stripe.com/docs/currencies). + pub merchant_currency: stripe_types::Currency, + /// The card network's estimate of the likelihood that an authorization is fraudulent. + /// Takes on values between 1 and 99. + pub network_risk_score: Option, + /// When an authorization is approved or declined by you or by Stripe, this field provides additional detail on the reason for the outcome. + pub reason: IssuingAuthorizationRequestReason, + /// If the `request_history.reason` is `webhook_error` because the direct webhook response is invalid (for example, parsing errors or missing parameters), we surface a more detailed error message via this field. + pub reason_message: Option, + /// Time when the card network received an authorization request from the acquirer in UTC. + /// Referred to by networks as transmission time. + pub requested_at: Option, +} +/// When an authorization is approved or declined by you or by Stripe, this field provides additional detail on the reason for the outcome. +#[derive(Copy, Clone, Eq, PartialEq)] +#[non_exhaustive] +pub enum IssuingAuthorizationRequestReason { + AccountDisabled, + CardActive, + CardInactive, + CardholderInactive, + CardholderVerificationRequired, + InsufficientFunds, + NotAllowed, + SpendingControls, + SuspectedFraud, + VerificationFailed, + WebhookApproved, + WebhookDeclined, + WebhookError, + WebhookTimeout, + /// An unrecognized value from Stripe. Should not be used as a request parameter. + Unknown, +} +impl IssuingAuthorizationRequestReason { + pub fn as_str(self) -> &'static str { + use IssuingAuthorizationRequestReason::*; + match self { + AccountDisabled => "account_disabled", + CardActive => "card_active", + CardInactive => "card_inactive", + CardholderInactive => "cardholder_inactive", + CardholderVerificationRequired => "cardholder_verification_required", + InsufficientFunds => "insufficient_funds", + NotAllowed => "not_allowed", + SpendingControls => "spending_controls", + SuspectedFraud => "suspected_fraud", + VerificationFailed => "verification_failed", + WebhookApproved => "webhook_approved", + WebhookDeclined => "webhook_declined", + WebhookError => "webhook_error", + WebhookTimeout => "webhook_timeout", + Unknown => "unknown", + } + } +} + +impl std::str::FromStr for IssuingAuthorizationRequestReason { + type Err = (); + fn from_str(s: &str) -> Result { + use IssuingAuthorizationRequestReason::*; + match s { + "account_disabled" => Ok(AccountDisabled), + "card_active" => Ok(CardActive), + "card_inactive" => Ok(CardInactive), + "cardholder_inactive" => Ok(CardholderInactive), + "cardholder_verification_required" => Ok(CardholderVerificationRequired), + "insufficient_funds" => Ok(InsufficientFunds), + "not_allowed" => Ok(NotAllowed), + "spending_controls" => Ok(SpendingControls), + "suspected_fraud" => Ok(SuspectedFraud), + "verification_failed" => Ok(VerificationFailed), + "webhook_approved" => Ok(WebhookApproved), + "webhook_declined" => Ok(WebhookDeclined), + "webhook_error" => Ok(WebhookError), + "webhook_timeout" => Ok(WebhookTimeout), + _ => Err(()), + } + } +} +impl std::fmt::Display for IssuingAuthorizationRequestReason { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for IssuingAuthorizationRequestReason { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for IssuingAuthorizationRequestReason { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for IssuingAuthorizationRequestReason { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Ok(Self::from_str(&s).unwrap_or(IssuingAuthorizationRequestReason::Unknown)) + } +} diff --git a/generated/stripe_shared/src/issuing_authorization_three_d_secure.rs b/generated/stripe_shared/src/issuing_authorization_three_d_secure.rs new file mode 100644 index 000000000..30b56e6bc --- /dev/null +++ b/generated/stripe_shared/src/issuing_authorization_three_d_secure.rs @@ -0,0 +1,66 @@ +#[derive(Copy, Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct IssuingAuthorizationThreeDSecure { + /// The outcome of the 3D Secure authentication request. + pub result: IssuingAuthorizationThreeDSecureResult, +} +/// The outcome of the 3D Secure authentication request. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum IssuingAuthorizationThreeDSecureResult { + AttemptAcknowledged, + Authenticated, + Failed, + Required, +} +impl IssuingAuthorizationThreeDSecureResult { + pub fn as_str(self) -> &'static str { + use IssuingAuthorizationThreeDSecureResult::*; + match self { + AttemptAcknowledged => "attempt_acknowledged", + Authenticated => "authenticated", + Failed => "failed", + Required => "required", + } + } +} + +impl std::str::FromStr for IssuingAuthorizationThreeDSecureResult { + type Err = (); + fn from_str(s: &str) -> Result { + use IssuingAuthorizationThreeDSecureResult::*; + match s { + "attempt_acknowledged" => Ok(AttemptAcknowledged), + "authenticated" => Ok(Authenticated), + "failed" => Ok(Failed), + "required" => Ok(Required), + _ => Err(()), + } + } +} +impl std::fmt::Display for IssuingAuthorizationThreeDSecureResult { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for IssuingAuthorizationThreeDSecureResult { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for IssuingAuthorizationThreeDSecureResult { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for IssuingAuthorizationThreeDSecureResult { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| { + serde::de::Error::custom("Unknown value for IssuingAuthorizationThreeDSecureResult") + }) + } +} diff --git a/generated/stripe_shared/src/issuing_authorization_treasury.rs b/generated/stripe_shared/src/issuing_authorization_treasury.rs new file mode 100644 index 000000000..58eac0bde --- /dev/null +++ b/generated/stripe_shared/src/issuing_authorization_treasury.rs @@ -0,0 +1,9 @@ +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct IssuingAuthorizationTreasury { + /// The array of [ReceivedCredits](https://stripe.com/docs/api/treasury/received_credits) associated with this authorization. + pub received_credits: Vec, + /// The array of [ReceivedDebits](https://stripe.com/docs/api/treasury/received_debits) associated with this authorization. + pub received_debits: Vec, + /// The Treasury [Transaction](https://stripe.com/docs/api/treasury/transactions) associated with this authorization. + pub transaction: Option, +} diff --git a/generated/stripe_shared/src/issuing_authorization_verification_data.rs b/generated/stripe_shared/src/issuing_authorization_verification_data.rs new file mode 100644 index 000000000..80e7ed58e --- /dev/null +++ b/generated/stripe_shared/src/issuing_authorization_verification_data.rs @@ -0,0 +1,258 @@ +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct IssuingAuthorizationVerificationData { + /// Whether the cardholder provided an address first line and if it matched the cardholder’s `billing.address.line1`. + pub address_line1_check: IssuingAuthorizationVerificationDataAddressLine1Check, + /// Whether the cardholder provided a postal code and if it matched the cardholder’s `billing.address.postal_code`. + pub address_postal_code_check: IssuingAuthorizationVerificationDataAddressPostalCodeCheck, + /// The exemption applied to this authorization. + pub authentication_exemption: + Option, + /// Whether the cardholder provided a CVC and if it matched Stripe’s record. + pub cvc_check: IssuingAuthorizationVerificationDataCvcCheck, + /// Whether the cardholder provided an expiry date and if it matched Stripe’s record. + pub expiry_check: IssuingAuthorizationVerificationDataExpiryCheck, + /// The postal code submitted as part of the authorization used for postal code verification. + pub postal_code: Option, + /// 3D Secure details. + pub three_d_secure: Option, +} +/// Whether the cardholder provided an address first line and if it matched the cardholder’s `billing.address.line1`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum IssuingAuthorizationVerificationDataAddressLine1Check { + Match, + Mismatch, + NotProvided, +} +impl IssuingAuthorizationVerificationDataAddressLine1Check { + pub fn as_str(self) -> &'static str { + use IssuingAuthorizationVerificationDataAddressLine1Check::*; + match self { + Match => "match", + Mismatch => "mismatch", + NotProvided => "not_provided", + } + } +} + +impl std::str::FromStr for IssuingAuthorizationVerificationDataAddressLine1Check { + type Err = (); + fn from_str(s: &str) -> Result { + use IssuingAuthorizationVerificationDataAddressLine1Check::*; + match s { + "match" => Ok(Match), + "mismatch" => Ok(Mismatch), + "not_provided" => Ok(NotProvided), + _ => Err(()), + } + } +} +impl std::fmt::Display for IssuingAuthorizationVerificationDataAddressLine1Check { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for IssuingAuthorizationVerificationDataAddressLine1Check { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for IssuingAuthorizationVerificationDataAddressLine1Check { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for IssuingAuthorizationVerificationDataAddressLine1Check { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| { + serde::de::Error::custom( + "Unknown value for IssuingAuthorizationVerificationDataAddressLine1Check", + ) + }) + } +} +/// Whether the cardholder provided a postal code and if it matched the cardholder’s `billing.address.postal_code`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum IssuingAuthorizationVerificationDataAddressPostalCodeCheck { + Match, + Mismatch, + NotProvided, +} +impl IssuingAuthorizationVerificationDataAddressPostalCodeCheck { + pub fn as_str(self) -> &'static str { + use IssuingAuthorizationVerificationDataAddressPostalCodeCheck::*; + match self { + Match => "match", + Mismatch => "mismatch", + NotProvided => "not_provided", + } + } +} + +impl std::str::FromStr for IssuingAuthorizationVerificationDataAddressPostalCodeCheck { + type Err = (); + fn from_str(s: &str) -> Result { + use IssuingAuthorizationVerificationDataAddressPostalCodeCheck::*; + match s { + "match" => Ok(Match), + "mismatch" => Ok(Mismatch), + "not_provided" => Ok(NotProvided), + _ => Err(()), + } + } +} +impl std::fmt::Display for IssuingAuthorizationVerificationDataAddressPostalCodeCheck { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for IssuingAuthorizationVerificationDataAddressPostalCodeCheck { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for IssuingAuthorizationVerificationDataAddressPostalCodeCheck { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for IssuingAuthorizationVerificationDataAddressPostalCodeCheck { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| { + serde::de::Error::custom( + "Unknown value for IssuingAuthorizationVerificationDataAddressPostalCodeCheck", + ) + }) + } +} +/// Whether the cardholder provided a CVC and if it matched Stripe’s record. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum IssuingAuthorizationVerificationDataCvcCheck { + Match, + Mismatch, + NotProvided, +} +impl IssuingAuthorizationVerificationDataCvcCheck { + pub fn as_str(self) -> &'static str { + use IssuingAuthorizationVerificationDataCvcCheck::*; + match self { + Match => "match", + Mismatch => "mismatch", + NotProvided => "not_provided", + } + } +} + +impl std::str::FromStr for IssuingAuthorizationVerificationDataCvcCheck { + type Err = (); + fn from_str(s: &str) -> Result { + use IssuingAuthorizationVerificationDataCvcCheck::*; + match s { + "match" => Ok(Match), + "mismatch" => Ok(Mismatch), + "not_provided" => Ok(NotProvided), + _ => Err(()), + } + } +} +impl std::fmt::Display for IssuingAuthorizationVerificationDataCvcCheck { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for IssuingAuthorizationVerificationDataCvcCheck { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for IssuingAuthorizationVerificationDataCvcCheck { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for IssuingAuthorizationVerificationDataCvcCheck { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| { + serde::de::Error::custom( + "Unknown value for IssuingAuthorizationVerificationDataCvcCheck", + ) + }) + } +} +/// Whether the cardholder provided an expiry date and if it matched Stripe’s record. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum IssuingAuthorizationVerificationDataExpiryCheck { + Match, + Mismatch, + NotProvided, +} +impl IssuingAuthorizationVerificationDataExpiryCheck { + pub fn as_str(self) -> &'static str { + use IssuingAuthorizationVerificationDataExpiryCheck::*; + match self { + Match => "match", + Mismatch => "mismatch", + NotProvided => "not_provided", + } + } +} + +impl std::str::FromStr for IssuingAuthorizationVerificationDataExpiryCheck { + type Err = (); + fn from_str(s: &str) -> Result { + use IssuingAuthorizationVerificationDataExpiryCheck::*; + match s { + "match" => Ok(Match), + "mismatch" => Ok(Mismatch), + "not_provided" => Ok(NotProvided), + _ => Err(()), + } + } +} +impl std::fmt::Display for IssuingAuthorizationVerificationDataExpiryCheck { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for IssuingAuthorizationVerificationDataExpiryCheck { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for IssuingAuthorizationVerificationDataExpiryCheck { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for IssuingAuthorizationVerificationDataExpiryCheck { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| { + serde::de::Error::custom( + "Unknown value for IssuingAuthorizationVerificationDataExpiryCheck", + ) + }) + } +} diff --git a/generated/stripe_shared/src/issuing_card.rs b/generated/stripe_shared/src/issuing_card.rs new file mode 100644 index 000000000..27602fc82 --- /dev/null +++ b/generated/stripe_shared/src/issuing_card.rs @@ -0,0 +1,293 @@ +/// You can [create physical or virtual cards](https://stripe.com/docs/issuing/cards) that are issued to cardholders. +/// +/// For more details see <>. +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct IssuingCard { + /// The brand of the card. + pub brand: String, + /// The reason why the card was canceled. + pub cancellation_reason: Option, + pub cardholder: stripe_shared::IssuingCardholder, + /// Time at which the object was created. Measured in seconds since the Unix epoch. + pub created: stripe_types::Timestamp, + /// Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. + /// Supported currencies are `usd` in the US, `eur` in the EU, and `gbp` in the UK. + pub currency: stripe_types::Currency, + /// The card's CVC. + /// For security reasons, this is only available for virtual cards, and will be omitted unless you explicitly request it with [the `expand` parameter](https://stripe.com/docs/api/expanding_objects). + /// Additionally, it's only available via the ["Retrieve a card" endpoint](https://stripe.com/docs/api/issuing/cards/retrieve), not via "List all cards" or any other endpoint. + #[serde(skip_serializing_if = "Option::is_none")] + pub cvc: Option, + /// The expiration month of the card. + pub exp_month: i64, + /// The expiration year of the card. + pub exp_year: i64, + /// The financial account this card is attached to. + #[serde(skip_serializing_if = "Option::is_none")] + pub financial_account: Option, + /// Unique identifier for the object. + pub id: stripe_shared::IssuingCardId, + /// The last 4 digits of the card number. + pub last4: String, + /// Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + pub livemode: bool, + /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. + /// This can be useful for storing additional information about the object in a structured format. + pub metadata: std::collections::HashMap, + /// The full unredacted card number. + /// For security reasons, this is only available for virtual cards, and will be omitted unless you explicitly request it with [the `expand` parameter](https://stripe.com/docs/api/expanding_objects). + /// Additionally, it's only available via the ["Retrieve a card" endpoint](https://stripe.com/docs/api/issuing/cards/retrieve), not via "List all cards" or any other endpoint. + #[serde(skip_serializing_if = "Option::is_none")] + pub number: Option, + /// The latest card that replaces this card, if any. + pub replaced_by: Option>, + /// The card this card replaces, if any. + pub replacement_for: Option>, + /// The reason why the previous card needed to be replaced. + pub replacement_reason: Option, + /// Where and how the card will be shipped. + pub shipping: Option, + pub spending_controls: stripe_shared::IssuingCardAuthorizationControls, + /// Whether authorizations can be approved on this card. + /// May be blocked from activating cards depending on past-due Cardholder requirements. + /// Defaults to `inactive`. + pub status: stripe_shared::IssuingCardStatus, + /// The type of the card. + #[serde(rename = "type")] + pub type_: stripe_shared::IssuingCardType, + /// Information relating to digital wallets (like Apple Pay and Google Pay). + pub wallets: Option, +} +/// The reason why the card was canceled. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum IssuingCardCancellationReason { + DesignRejected, + Lost, + Stolen, +} +impl IssuingCardCancellationReason { + pub fn as_str(self) -> &'static str { + use IssuingCardCancellationReason::*; + match self { + DesignRejected => "design_rejected", + Lost => "lost", + Stolen => "stolen", + } + } +} + +impl std::str::FromStr for IssuingCardCancellationReason { + type Err = (); + fn from_str(s: &str) -> Result { + use IssuingCardCancellationReason::*; + match s { + "design_rejected" => Ok(DesignRejected), + "lost" => Ok(Lost), + "stolen" => Ok(Stolen), + _ => Err(()), + } + } +} +impl std::fmt::Display for IssuingCardCancellationReason { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for IssuingCardCancellationReason { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for IssuingCardCancellationReason { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for IssuingCardCancellationReason { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| { + serde::de::Error::custom("Unknown value for IssuingCardCancellationReason") + }) + } +} +impl stripe_types::Object for IssuingCard { + type Id = stripe_shared::IssuingCardId; + fn id(&self) -> &Self::Id { + &self.id + } +} +stripe_types::def_id!(IssuingCardId, "ic_"); +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum IssuingCardReplacementReason { + Damaged, + Expired, + Lost, + Stolen, +} +impl IssuingCardReplacementReason { + pub fn as_str(self) -> &'static str { + use IssuingCardReplacementReason::*; + match self { + Damaged => "damaged", + Expired => "expired", + Lost => "lost", + Stolen => "stolen", + } + } +} + +impl std::str::FromStr for IssuingCardReplacementReason { + type Err = (); + fn from_str(s: &str) -> Result { + use IssuingCardReplacementReason::*; + match s { + "damaged" => Ok(Damaged), + "expired" => Ok(Expired), + "lost" => Ok(Lost), + "stolen" => Ok(Stolen), + _ => Err(()), + } + } +} +impl std::fmt::Display for IssuingCardReplacementReason { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for IssuingCardReplacementReason { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for IssuingCardReplacementReason { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for IssuingCardReplacementReason { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s) + .map_err(|_| serde::de::Error::custom("Unknown value for IssuingCardReplacementReason")) + } +} +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum IssuingCardStatus { + Active, + Canceled, + Inactive, +} +impl IssuingCardStatus { + pub fn as_str(self) -> &'static str { + use IssuingCardStatus::*; + match self { + Active => "active", + Canceled => "canceled", + Inactive => "inactive", + } + } +} + +impl std::str::FromStr for IssuingCardStatus { + type Err = (); + fn from_str(s: &str) -> Result { + use IssuingCardStatus::*; + match s { + "active" => Ok(Active), + "canceled" => Ok(Canceled), + "inactive" => Ok(Inactive), + _ => Err(()), + } + } +} +impl std::fmt::Display for IssuingCardStatus { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for IssuingCardStatus { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for IssuingCardStatus { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for IssuingCardStatus { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s) + .map_err(|_| serde::de::Error::custom("Unknown value for IssuingCardStatus")) + } +} +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum IssuingCardType { + Physical, + Virtual, +} +impl IssuingCardType { + pub fn as_str(self) -> &'static str { + use IssuingCardType::*; + match self { + Physical => "physical", + Virtual => "virtual", + } + } +} + +impl std::str::FromStr for IssuingCardType { + type Err = (); + fn from_str(s: &str) -> Result { + use IssuingCardType::*; + match s { + "physical" => Ok(Physical), + "virtual" => Ok(Virtual), + _ => Err(()), + } + } +} +impl std::fmt::Display for IssuingCardType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for IssuingCardType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for IssuingCardType { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for IssuingCardType { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s) + .map_err(|_| serde::de::Error::custom("Unknown value for IssuingCardType")) + } +} diff --git a/generated/stripe_shared/src/issuing_card_apple_pay.rs b/generated/stripe_shared/src/issuing_card_apple_pay.rs new file mode 100644 index 000000000..b968c6e43 --- /dev/null +++ b/generated/stripe_shared/src/issuing_card_apple_pay.rs @@ -0,0 +1,65 @@ +#[derive(Copy, Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct IssuingCardApplePay { + /// Apple Pay Eligibility + pub eligible: bool, + /// Reason the card is ineligible for Apple Pay + pub ineligible_reason: Option, +} +/// Reason the card is ineligible for Apple Pay +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum IssuingCardApplePayIneligibleReason { + MissingAgreement, + MissingCardholderContact, + UnsupportedRegion, +} +impl IssuingCardApplePayIneligibleReason { + pub fn as_str(self) -> &'static str { + use IssuingCardApplePayIneligibleReason::*; + match self { + MissingAgreement => "missing_agreement", + MissingCardholderContact => "missing_cardholder_contact", + UnsupportedRegion => "unsupported_region", + } + } +} + +impl std::str::FromStr for IssuingCardApplePayIneligibleReason { + type Err = (); + fn from_str(s: &str) -> Result { + use IssuingCardApplePayIneligibleReason::*; + match s { + "missing_agreement" => Ok(MissingAgreement), + "missing_cardholder_contact" => Ok(MissingCardholderContact), + "unsupported_region" => Ok(UnsupportedRegion), + _ => Err(()), + } + } +} +impl std::fmt::Display for IssuingCardApplePayIneligibleReason { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for IssuingCardApplePayIneligibleReason { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for IssuingCardApplePayIneligibleReason { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for IssuingCardApplePayIneligibleReason { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| { + serde::de::Error::custom("Unknown value for IssuingCardApplePayIneligibleReason") + }) + } +} diff --git a/generated/stripe_shared/src/issuing_card_authorization_controls.rs b/generated/stripe_shared/src/issuing_card_authorization_controls.rs new file mode 100644 index 000000000..f1428a4e5 --- /dev/null +++ b/generated/stripe_shared/src/issuing_card_authorization_controls.rs @@ -0,0 +1,2075 @@ +#[derive(Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct IssuingCardAuthorizationControls { + /// Array of strings containing [categories](https://stripe.com/docs/api#issuing_authorization_object-merchant_data-category) of authorizations to allow. + /// All other categories will be blocked. + /// Cannot be set with `blocked_categories`. + pub allowed_categories: Option>, + /// Array of strings containing [categories](https://stripe.com/docs/api#issuing_authorization_object-merchant_data-category) of authorizations to decline. + /// All other categories will be allowed. + /// Cannot be set with `allowed_categories`. + pub blocked_categories: Option>, + /// Limit spending with amount-based rules that apply across any cards this card replaced (i.e., its `replacement_for` card and _that_ card's `replacement_for` card, up the chain). + pub spending_limits: Option>, + /// Currency of the amounts within `spending_limits`. Always the same as the currency of the card. + pub spending_limits_currency: Option, +} +/// Array of strings containing [categories](https://stripe.com/docs/api#issuing_authorization_object-merchant_data-category) of authorizations to allow. +/// All other categories will be blocked. +/// Cannot be set with `blocked_categories`. +#[derive(Copy, Clone, Eq, PartialEq)] +#[non_exhaustive] +pub enum IssuingCardAuthorizationControlsAllowedCategories { + AcRefrigerationRepair, + AccountingBookkeepingServices, + AdvertisingServices, + AgriculturalCooperative, + AirlinesAirCarriers, + AirportsFlyingFields, + AmbulanceServices, + AmusementParksCarnivals, + AntiqueReproductions, + AntiqueShops, + Aquariums, + ArchitecturalSurveyingServices, + ArtDealersAndGalleries, + ArtistsSupplyAndCraftShops, + AutoAndHomeSupplyStores, + AutoBodyRepairShops, + AutoPaintShops, + AutoServiceShops, + AutomatedCashDisburse, + AutomatedFuelDispensers, + AutomobileAssociations, + AutomotivePartsAndAccessoriesStores, + AutomotiveTireStores, + BailAndBondPayments, + Bakeries, + BandsOrchestras, + BarberAndBeautyShops, + BettingCasinoGambling, + BicycleShops, + BilliardPoolEstablishments, + BoatDealers, + BoatRentalsAndLeases, + BookStores, + BooksPeriodicalsAndNewspapers, + BowlingAlleys, + BusLines, + BusinessSecretarialSchools, + BuyingShoppingServices, + CableSatelliteAndOtherPayTelevisionAndRadio, + CameraAndPhotographicSupplyStores, + CandyNutAndConfectioneryStores, + CarAndTruckDealersNewUsed, + CarAndTruckDealersUsedOnly, + CarRentalAgencies, + CarWashes, + CarpentryServices, + CarpetUpholsteryCleaning, + Caterers, + CharitableAndSocialServiceOrganizationsFundraising, + ChemicalsAndAlliedProducts, + ChildCareServices, + ChildrensAndInfantsWearStores, + ChiropodistsPodiatrists, + Chiropractors, + CigarStoresAndStands, + CivicSocialFraternalAssociations, + CleaningAndMaintenance, + ClothingRental, + CollegesUniversities, + CommercialEquipment, + CommercialFootwear, + CommercialPhotographyArtAndGraphics, + CommuterTransportAndFerries, + ComputerNetworkServices, + ComputerProgramming, + ComputerRepair, + ComputerSoftwareStores, + ComputersPeripheralsAndSoftware, + ConcreteWorkServices, + ConstructionMaterials, + ConsultingPublicRelations, + CorrespondenceSchools, + CosmeticStores, + CounselingServices, + CountryClubs, + CourierServices, + CourtCosts, + CreditReportingAgencies, + CruiseLines, + DairyProductsStores, + DanceHallStudiosSchools, + DatingEscortServices, + DentistsOrthodontists, + DepartmentStores, + DetectiveAgencies, + DigitalGoodsApplications, + DigitalGoodsGames, + DigitalGoodsLargeVolume, + DigitalGoodsMedia, + DirectMarketingCatalogMerchant, + DirectMarketingCombinationCatalogAndRetailMerchant, + DirectMarketingInboundTelemarketing, + DirectMarketingInsuranceServices, + DirectMarketingOther, + DirectMarketingOutboundTelemarketing, + DirectMarketingSubscription, + DirectMarketingTravel, + DiscountStores, + Doctors, + DoorToDoorSales, + DraperyWindowCoveringAndUpholsteryStores, + DrinkingPlaces, + DrugStoresAndPharmacies, + DrugsDrugProprietariesAndDruggistSundries, + DryCleaners, + DurableGoods, + DutyFreeStores, + EatingPlacesRestaurants, + EducationalServices, + ElectricRazorStores, + ElectricVehicleCharging, + ElectricalPartsAndEquipment, + ElectricalServices, + ElectronicsRepairShops, + ElectronicsStores, + ElementarySecondarySchools, + EmergencyServicesGcasVisaUseOnly, + EmploymentTempAgencies, + EquipmentRental, + ExterminatingServices, + FamilyClothingStores, + FastFoodRestaurants, + FinancialInstitutions, + FinesGovernmentAdministrativeEntities, + FireplaceFireplaceScreensAndAccessoriesStores, + FloorCoveringStores, + Florists, + FloristsSuppliesNurseryStockAndFlowers, + FreezerAndLockerMeatProvisioners, + FuelDealersNonAutomotive, + FuneralServicesCrematories, + FurnitureHomeFurnishingsAndEquipmentStoresExceptAppliances, + FurnitureRepairRefinishing, + FurriersAndFurShops, + GeneralServices, + GiftCardNoveltyAndSouvenirShops, + GlassPaintAndWallpaperStores, + GlasswareCrystalStores, + GolfCoursesPublic, + GovernmentLicensedHorseDogRacingUsRegionOnly, + GovernmentLicensedOnlineCasionsOnlineGamblingUsRegionOnly, + GovernmentOwnedLotteriesNonUsRegion, + GovernmentOwnedLotteriesUsRegionOnly, + GovernmentServices, + GroceryStoresSupermarkets, + HardwareEquipmentAndSupplies, + HardwareStores, + HealthAndBeautySpas, + HearingAidsSalesAndSupplies, + HeatingPlumbingAC, + HobbyToyAndGameShops, + HomeSupplyWarehouseStores, + Hospitals, + HotelsMotelsAndResorts, + HouseholdApplianceStores, + IndustrialSupplies, + InformationRetrievalServices, + InsuranceDefault, + InsuranceUnderwritingPremiums, + IntraCompanyPurchases, + JewelryStoresWatchesClocksAndSilverwareStores, + LandscapingServices, + Laundries, + LaundryCleaningServices, + LegalServicesAttorneys, + LuggageAndLeatherGoodsStores, + LumberBuildingMaterialsStores, + ManualCashDisburse, + MarinasServiceAndSupplies, + Marketplaces, + MasonryStoneworkAndPlaster, + MassageParlors, + MedicalAndDentalLabs, + MedicalDentalOphthalmicAndHospitalEquipmentAndSupplies, + MedicalServices, + MembershipOrganizations, + MensAndBoysClothingAndAccessoriesStores, + MensWomensClothingStores, + MetalServiceCenters, + Miscellaneous, + MiscellaneousApparelAndAccessoryShops, + MiscellaneousAutoDealers, + MiscellaneousBusinessServices, + MiscellaneousFoodStores, + MiscellaneousGeneralMerchandise, + MiscellaneousGeneralServices, + MiscellaneousHomeFurnishingSpecialtyStores, + MiscellaneousPublishingAndPrinting, + MiscellaneousRecreationServices, + MiscellaneousRepairShops, + MiscellaneousSpecialtyRetail, + MobileHomeDealers, + MotionPictureTheaters, + MotorFreightCarriersAndTrucking, + MotorHomesDealers, + MotorVehicleSuppliesAndNewParts, + MotorcycleShopsAndDealers, + MotorcycleShopsDealers, + MusicStoresMusicalInstrumentsPianosAndSheetMusic, + NewsDealersAndNewsstands, + NonFiMoneyOrders, + NonFiStoredValueCardPurchaseLoad, + NondurableGoods, + NurseriesLawnAndGardenSupplyStores, + NursingPersonalCare, + OfficeAndCommercialFurniture, + OpticiansEyeglasses, + OptometristsOphthalmologist, + OrthopedicGoodsProstheticDevices, + Osteopaths, + PackageStoresBeerWineAndLiquor, + PaintsVarnishesAndSupplies, + ParkingLotsGarages, + PassengerRailways, + PawnShops, + PetShopsPetFoodAndSupplies, + PetroleumAndPetroleumProducts, + PhotoDeveloping, + PhotographicPhotocopyMicrofilmEquipmentAndSupplies, + PhotographicStudios, + PictureVideoProduction, + PieceGoodsNotionsAndOtherDryGoods, + PlumbingHeatingEquipmentAndSupplies, + PoliticalOrganizations, + PostalServicesGovernmentOnly, + PreciousStonesAndMetalsWatchesAndJewelry, + ProfessionalServices, + PublicWarehousingAndStorage, + QuickCopyReproAndBlueprint, + Railroads, + RealEstateAgentsAndManagersRentals, + RecordStores, + RecreationalVehicleRentals, + ReligiousGoodsStores, + ReligiousOrganizations, + RoofingSidingSheetMetal, + SecretarialSupportServices, + SecurityBrokersDealers, + ServiceStations, + SewingNeedleworkFabricAndPieceGoodsStores, + ShoeRepairHatCleaning, + ShoeStores, + SmallApplianceRepair, + SnowmobileDealers, + SpecialTradeServices, + SpecialtyCleaning, + SportingGoodsStores, + SportingRecreationCamps, + SportsAndRidingApparelStores, + SportsClubsFields, + StampAndCoinStores, + StationaryOfficeSuppliesPrintingAndWritingPaper, + StationeryStoresOfficeAndSchoolSupplyStores, + SwimmingPoolsSales, + TUiTravelGermany, + TailorsAlterations, + TaxPaymentsGovernmentAgencies, + TaxPreparationServices, + TaxicabsLimousines, + TelecommunicationEquipmentAndTelephoneSales, + TelecommunicationServices, + TelegraphServices, + TentAndAwningShops, + TestingLaboratories, + TheatricalTicketAgencies, + Timeshares, + TireRetreadingAndRepair, + TollsBridgeFees, + TouristAttractionsAndExhibits, + TowingServices, + TrailerParksCampgrounds, + TransportationServices, + TravelAgenciesTourOperators, + TruckStopIteration, + TruckUtilityTrailerRentals, + TypesettingPlateMakingAndRelatedServices, + TypewriterStores, + USFederalGovernmentAgenciesOrDepartments, + UniformsCommercialClothing, + UsedMerchandiseAndSecondhandStores, + Utilities, + VarietyStores, + VeterinaryServices, + VideoAmusementGameSupplies, + VideoGameArcades, + VideoTapeRentalStores, + VocationalTradeSchools, + WatchJewelryRepair, + WeldingRepair, + WholesaleClubs, + WigAndToupeeStores, + WiresMoneyOrders, + WomensAccessoryAndSpecialtyShops, + WomensReadyToWearStores, + WreckingAndSalvageYards, + /// An unrecognized value from Stripe. Should not be used as a request parameter. + Unknown, +} +impl IssuingCardAuthorizationControlsAllowedCategories { + pub fn as_str(self) -> &'static str { + use IssuingCardAuthorizationControlsAllowedCategories::*; + match self { + AcRefrigerationRepair => "ac_refrigeration_repair", + AccountingBookkeepingServices => "accounting_bookkeeping_services", + AdvertisingServices => "advertising_services", + AgriculturalCooperative => "agricultural_cooperative", + AirlinesAirCarriers => "airlines_air_carriers", + AirportsFlyingFields => "airports_flying_fields", + AmbulanceServices => "ambulance_services", + AmusementParksCarnivals => "amusement_parks_carnivals", + AntiqueReproductions => "antique_reproductions", + AntiqueShops => "antique_shops", + Aquariums => "aquariums", + ArchitecturalSurveyingServices => "architectural_surveying_services", + ArtDealersAndGalleries => "art_dealers_and_galleries", + ArtistsSupplyAndCraftShops => "artists_supply_and_craft_shops", + AutoAndHomeSupplyStores => "auto_and_home_supply_stores", + AutoBodyRepairShops => "auto_body_repair_shops", + AutoPaintShops => "auto_paint_shops", + AutoServiceShops => "auto_service_shops", + AutomatedCashDisburse => "automated_cash_disburse", + AutomatedFuelDispensers => "automated_fuel_dispensers", + AutomobileAssociations => "automobile_associations", + AutomotivePartsAndAccessoriesStores => "automotive_parts_and_accessories_stores", + AutomotiveTireStores => "automotive_tire_stores", + BailAndBondPayments => "bail_and_bond_payments", + Bakeries => "bakeries", + BandsOrchestras => "bands_orchestras", + BarberAndBeautyShops => "barber_and_beauty_shops", + BettingCasinoGambling => "betting_casino_gambling", + BicycleShops => "bicycle_shops", + BilliardPoolEstablishments => "billiard_pool_establishments", + BoatDealers => "boat_dealers", + BoatRentalsAndLeases => "boat_rentals_and_leases", + BookStores => "book_stores", + BooksPeriodicalsAndNewspapers => "books_periodicals_and_newspapers", + BowlingAlleys => "bowling_alleys", + BusLines => "bus_lines", + BusinessSecretarialSchools => "business_secretarial_schools", + BuyingShoppingServices => "buying_shopping_services", + CableSatelliteAndOtherPayTelevisionAndRadio => { + "cable_satellite_and_other_pay_television_and_radio" + } + CameraAndPhotographicSupplyStores => "camera_and_photographic_supply_stores", + CandyNutAndConfectioneryStores => "candy_nut_and_confectionery_stores", + CarAndTruckDealersNewUsed => "car_and_truck_dealers_new_used", + CarAndTruckDealersUsedOnly => "car_and_truck_dealers_used_only", + CarRentalAgencies => "car_rental_agencies", + CarWashes => "car_washes", + CarpentryServices => "carpentry_services", + CarpetUpholsteryCleaning => "carpet_upholstery_cleaning", + Caterers => "caterers", + CharitableAndSocialServiceOrganizationsFundraising => { + "charitable_and_social_service_organizations_fundraising" + } + ChemicalsAndAlliedProducts => "chemicals_and_allied_products", + ChildCareServices => "child_care_services", + ChildrensAndInfantsWearStores => "childrens_and_infants_wear_stores", + ChiropodistsPodiatrists => "chiropodists_podiatrists", + Chiropractors => "chiropractors", + CigarStoresAndStands => "cigar_stores_and_stands", + CivicSocialFraternalAssociations => "civic_social_fraternal_associations", + CleaningAndMaintenance => "cleaning_and_maintenance", + ClothingRental => "clothing_rental", + CollegesUniversities => "colleges_universities", + CommercialEquipment => "commercial_equipment", + CommercialFootwear => "commercial_footwear", + CommercialPhotographyArtAndGraphics => "commercial_photography_art_and_graphics", + CommuterTransportAndFerries => "commuter_transport_and_ferries", + ComputerNetworkServices => "computer_network_services", + ComputerProgramming => "computer_programming", + ComputerRepair => "computer_repair", + ComputerSoftwareStores => "computer_software_stores", + ComputersPeripheralsAndSoftware => "computers_peripherals_and_software", + ConcreteWorkServices => "concrete_work_services", + ConstructionMaterials => "construction_materials", + ConsultingPublicRelations => "consulting_public_relations", + CorrespondenceSchools => "correspondence_schools", + CosmeticStores => "cosmetic_stores", + CounselingServices => "counseling_services", + CountryClubs => "country_clubs", + CourierServices => "courier_services", + CourtCosts => "court_costs", + CreditReportingAgencies => "credit_reporting_agencies", + CruiseLines => "cruise_lines", + DairyProductsStores => "dairy_products_stores", + DanceHallStudiosSchools => "dance_hall_studios_schools", + DatingEscortServices => "dating_escort_services", + DentistsOrthodontists => "dentists_orthodontists", + DepartmentStores => "department_stores", + DetectiveAgencies => "detective_agencies", + DigitalGoodsApplications => "digital_goods_applications", + DigitalGoodsGames => "digital_goods_games", + DigitalGoodsLargeVolume => "digital_goods_large_volume", + DigitalGoodsMedia => "digital_goods_media", + DirectMarketingCatalogMerchant => "direct_marketing_catalog_merchant", + DirectMarketingCombinationCatalogAndRetailMerchant => { + "direct_marketing_combination_catalog_and_retail_merchant" + } + DirectMarketingInboundTelemarketing => "direct_marketing_inbound_telemarketing", + DirectMarketingInsuranceServices => "direct_marketing_insurance_services", + DirectMarketingOther => "direct_marketing_other", + DirectMarketingOutboundTelemarketing => "direct_marketing_outbound_telemarketing", + DirectMarketingSubscription => "direct_marketing_subscription", + DirectMarketingTravel => "direct_marketing_travel", + DiscountStores => "discount_stores", + Doctors => "doctors", + DoorToDoorSales => "door_to_door_sales", + DraperyWindowCoveringAndUpholsteryStores => { + "drapery_window_covering_and_upholstery_stores" + } + DrinkingPlaces => "drinking_places", + DrugStoresAndPharmacies => "drug_stores_and_pharmacies", + DrugsDrugProprietariesAndDruggistSundries => { + "drugs_drug_proprietaries_and_druggist_sundries" + } + DryCleaners => "dry_cleaners", + DurableGoods => "durable_goods", + DutyFreeStores => "duty_free_stores", + EatingPlacesRestaurants => "eating_places_restaurants", + EducationalServices => "educational_services", + ElectricRazorStores => "electric_razor_stores", + ElectricVehicleCharging => "electric_vehicle_charging", + ElectricalPartsAndEquipment => "electrical_parts_and_equipment", + ElectricalServices => "electrical_services", + ElectronicsRepairShops => "electronics_repair_shops", + ElectronicsStores => "electronics_stores", + ElementarySecondarySchools => "elementary_secondary_schools", + EmergencyServicesGcasVisaUseOnly => "emergency_services_gcas_visa_use_only", + EmploymentTempAgencies => "employment_temp_agencies", + EquipmentRental => "equipment_rental", + ExterminatingServices => "exterminating_services", + FamilyClothingStores => "family_clothing_stores", + FastFoodRestaurants => "fast_food_restaurants", + FinancialInstitutions => "financial_institutions", + FinesGovernmentAdministrativeEntities => "fines_government_administrative_entities", + FireplaceFireplaceScreensAndAccessoriesStores => { + "fireplace_fireplace_screens_and_accessories_stores" + } + FloorCoveringStores => "floor_covering_stores", + Florists => "florists", + FloristsSuppliesNurseryStockAndFlowers => "florists_supplies_nursery_stock_and_flowers", + FreezerAndLockerMeatProvisioners => "freezer_and_locker_meat_provisioners", + FuelDealersNonAutomotive => "fuel_dealers_non_automotive", + FuneralServicesCrematories => "funeral_services_crematories", + FurnitureHomeFurnishingsAndEquipmentStoresExceptAppliances => { + "furniture_home_furnishings_and_equipment_stores_except_appliances" + } + FurnitureRepairRefinishing => "furniture_repair_refinishing", + FurriersAndFurShops => "furriers_and_fur_shops", + GeneralServices => "general_services", + GiftCardNoveltyAndSouvenirShops => "gift_card_novelty_and_souvenir_shops", + GlassPaintAndWallpaperStores => "glass_paint_and_wallpaper_stores", + GlasswareCrystalStores => "glassware_crystal_stores", + GolfCoursesPublic => "golf_courses_public", + GovernmentLicensedHorseDogRacingUsRegionOnly => { + "government_licensed_horse_dog_racing_us_region_only" + } + GovernmentLicensedOnlineCasionsOnlineGamblingUsRegionOnly => { + "government_licensed_online_casions_online_gambling_us_region_only" + } + GovernmentOwnedLotteriesNonUsRegion => "government_owned_lotteries_non_us_region", + GovernmentOwnedLotteriesUsRegionOnly => "government_owned_lotteries_us_region_only", + GovernmentServices => "government_services", + GroceryStoresSupermarkets => "grocery_stores_supermarkets", + HardwareEquipmentAndSupplies => "hardware_equipment_and_supplies", + HardwareStores => "hardware_stores", + HealthAndBeautySpas => "health_and_beauty_spas", + HearingAidsSalesAndSupplies => "hearing_aids_sales_and_supplies", + HeatingPlumbingAC => "heating_plumbing_a_c", + HobbyToyAndGameShops => "hobby_toy_and_game_shops", + HomeSupplyWarehouseStores => "home_supply_warehouse_stores", + Hospitals => "hospitals", + HotelsMotelsAndResorts => "hotels_motels_and_resorts", + HouseholdApplianceStores => "household_appliance_stores", + IndustrialSupplies => "industrial_supplies", + InformationRetrievalServices => "information_retrieval_services", + InsuranceDefault => "insurance_default", + InsuranceUnderwritingPremiums => "insurance_underwriting_premiums", + IntraCompanyPurchases => "intra_company_purchases", + JewelryStoresWatchesClocksAndSilverwareStores => { + "jewelry_stores_watches_clocks_and_silverware_stores" + } + LandscapingServices => "landscaping_services", + Laundries => "laundries", + LaundryCleaningServices => "laundry_cleaning_services", + LegalServicesAttorneys => "legal_services_attorneys", + LuggageAndLeatherGoodsStores => "luggage_and_leather_goods_stores", + LumberBuildingMaterialsStores => "lumber_building_materials_stores", + ManualCashDisburse => "manual_cash_disburse", + MarinasServiceAndSupplies => "marinas_service_and_supplies", + Marketplaces => "marketplaces", + MasonryStoneworkAndPlaster => "masonry_stonework_and_plaster", + MassageParlors => "massage_parlors", + MedicalAndDentalLabs => "medical_and_dental_labs", + MedicalDentalOphthalmicAndHospitalEquipmentAndSupplies => { + "medical_dental_ophthalmic_and_hospital_equipment_and_supplies" + } + MedicalServices => "medical_services", + MembershipOrganizations => "membership_organizations", + MensAndBoysClothingAndAccessoriesStores => { + "mens_and_boys_clothing_and_accessories_stores" + } + MensWomensClothingStores => "mens_womens_clothing_stores", + MetalServiceCenters => "metal_service_centers", + Miscellaneous => "miscellaneous", + MiscellaneousApparelAndAccessoryShops => "miscellaneous_apparel_and_accessory_shops", + MiscellaneousAutoDealers => "miscellaneous_auto_dealers", + MiscellaneousBusinessServices => "miscellaneous_business_services", + MiscellaneousFoodStores => "miscellaneous_food_stores", + MiscellaneousGeneralMerchandise => "miscellaneous_general_merchandise", + MiscellaneousGeneralServices => "miscellaneous_general_services", + MiscellaneousHomeFurnishingSpecialtyStores => { + "miscellaneous_home_furnishing_specialty_stores" + } + MiscellaneousPublishingAndPrinting => "miscellaneous_publishing_and_printing", + MiscellaneousRecreationServices => "miscellaneous_recreation_services", + MiscellaneousRepairShops => "miscellaneous_repair_shops", + MiscellaneousSpecialtyRetail => "miscellaneous_specialty_retail", + MobileHomeDealers => "mobile_home_dealers", + MotionPictureTheaters => "motion_picture_theaters", + MotorFreightCarriersAndTrucking => "motor_freight_carriers_and_trucking", + MotorHomesDealers => "motor_homes_dealers", + MotorVehicleSuppliesAndNewParts => "motor_vehicle_supplies_and_new_parts", + MotorcycleShopsAndDealers => "motorcycle_shops_and_dealers", + MotorcycleShopsDealers => "motorcycle_shops_dealers", + MusicStoresMusicalInstrumentsPianosAndSheetMusic => { + "music_stores_musical_instruments_pianos_and_sheet_music" + } + NewsDealersAndNewsstands => "news_dealers_and_newsstands", + NonFiMoneyOrders => "non_fi_money_orders", + NonFiStoredValueCardPurchaseLoad => "non_fi_stored_value_card_purchase_load", + NondurableGoods => "nondurable_goods", + NurseriesLawnAndGardenSupplyStores => "nurseries_lawn_and_garden_supply_stores", + NursingPersonalCare => "nursing_personal_care", + OfficeAndCommercialFurniture => "office_and_commercial_furniture", + OpticiansEyeglasses => "opticians_eyeglasses", + OptometristsOphthalmologist => "optometrists_ophthalmologist", + OrthopedicGoodsProstheticDevices => "orthopedic_goods_prosthetic_devices", + Osteopaths => "osteopaths", + PackageStoresBeerWineAndLiquor => "package_stores_beer_wine_and_liquor", + PaintsVarnishesAndSupplies => "paints_varnishes_and_supplies", + ParkingLotsGarages => "parking_lots_garages", + PassengerRailways => "passenger_railways", + PawnShops => "pawn_shops", + PetShopsPetFoodAndSupplies => "pet_shops_pet_food_and_supplies", + PetroleumAndPetroleumProducts => "petroleum_and_petroleum_products", + PhotoDeveloping => "photo_developing", + PhotographicPhotocopyMicrofilmEquipmentAndSupplies => { + "photographic_photocopy_microfilm_equipment_and_supplies" + } + PhotographicStudios => "photographic_studios", + PictureVideoProduction => "picture_video_production", + PieceGoodsNotionsAndOtherDryGoods => "piece_goods_notions_and_other_dry_goods", + PlumbingHeatingEquipmentAndSupplies => "plumbing_heating_equipment_and_supplies", + PoliticalOrganizations => "political_organizations", + PostalServicesGovernmentOnly => "postal_services_government_only", + PreciousStonesAndMetalsWatchesAndJewelry => { + "precious_stones_and_metals_watches_and_jewelry" + } + ProfessionalServices => "professional_services", + PublicWarehousingAndStorage => "public_warehousing_and_storage", + QuickCopyReproAndBlueprint => "quick_copy_repro_and_blueprint", + Railroads => "railroads", + RealEstateAgentsAndManagersRentals => "real_estate_agents_and_managers_rentals", + RecordStores => "record_stores", + RecreationalVehicleRentals => "recreational_vehicle_rentals", + ReligiousGoodsStores => "religious_goods_stores", + ReligiousOrganizations => "religious_organizations", + RoofingSidingSheetMetal => "roofing_siding_sheet_metal", + SecretarialSupportServices => "secretarial_support_services", + SecurityBrokersDealers => "security_brokers_dealers", + ServiceStations => "service_stations", + SewingNeedleworkFabricAndPieceGoodsStores => { + "sewing_needlework_fabric_and_piece_goods_stores" + } + ShoeRepairHatCleaning => "shoe_repair_hat_cleaning", + ShoeStores => "shoe_stores", + SmallApplianceRepair => "small_appliance_repair", + SnowmobileDealers => "snowmobile_dealers", + SpecialTradeServices => "special_trade_services", + SpecialtyCleaning => "specialty_cleaning", + SportingGoodsStores => "sporting_goods_stores", + SportingRecreationCamps => "sporting_recreation_camps", + SportsAndRidingApparelStores => "sports_and_riding_apparel_stores", + SportsClubsFields => "sports_clubs_fields", + StampAndCoinStores => "stamp_and_coin_stores", + StationaryOfficeSuppliesPrintingAndWritingPaper => { + "stationary_office_supplies_printing_and_writing_paper" + } + StationeryStoresOfficeAndSchoolSupplyStores => { + "stationery_stores_office_and_school_supply_stores" + } + SwimmingPoolsSales => "swimming_pools_sales", + TUiTravelGermany => "t_ui_travel_germany", + TailorsAlterations => "tailors_alterations", + TaxPaymentsGovernmentAgencies => "tax_payments_government_agencies", + TaxPreparationServices => "tax_preparation_services", + TaxicabsLimousines => "taxicabs_limousines", + TelecommunicationEquipmentAndTelephoneSales => { + "telecommunication_equipment_and_telephone_sales" + } + TelecommunicationServices => "telecommunication_services", + TelegraphServices => "telegraph_services", + TentAndAwningShops => "tent_and_awning_shops", + TestingLaboratories => "testing_laboratories", + TheatricalTicketAgencies => "theatrical_ticket_agencies", + Timeshares => "timeshares", + TireRetreadingAndRepair => "tire_retreading_and_repair", + TollsBridgeFees => "tolls_bridge_fees", + TouristAttractionsAndExhibits => "tourist_attractions_and_exhibits", + TowingServices => "towing_services", + TrailerParksCampgrounds => "trailer_parks_campgrounds", + TransportationServices => "transportation_services", + TravelAgenciesTourOperators => "travel_agencies_tour_operators", + TruckStopIteration => "truck_stop_iteration", + TruckUtilityTrailerRentals => "truck_utility_trailer_rentals", + TypesettingPlateMakingAndRelatedServices => { + "typesetting_plate_making_and_related_services" + } + TypewriterStores => "typewriter_stores", + USFederalGovernmentAgenciesOrDepartments => { + "u_s_federal_government_agencies_or_departments" + } + UniformsCommercialClothing => "uniforms_commercial_clothing", + UsedMerchandiseAndSecondhandStores => "used_merchandise_and_secondhand_stores", + Utilities => "utilities", + VarietyStores => "variety_stores", + VeterinaryServices => "veterinary_services", + VideoAmusementGameSupplies => "video_amusement_game_supplies", + VideoGameArcades => "video_game_arcades", + VideoTapeRentalStores => "video_tape_rental_stores", + VocationalTradeSchools => "vocational_trade_schools", + WatchJewelryRepair => "watch_jewelry_repair", + WeldingRepair => "welding_repair", + WholesaleClubs => "wholesale_clubs", + WigAndToupeeStores => "wig_and_toupee_stores", + WiresMoneyOrders => "wires_money_orders", + WomensAccessoryAndSpecialtyShops => "womens_accessory_and_specialty_shops", + WomensReadyToWearStores => "womens_ready_to_wear_stores", + WreckingAndSalvageYards => "wrecking_and_salvage_yards", + Unknown => "unknown", + } + } +} + +impl std::str::FromStr for IssuingCardAuthorizationControlsAllowedCategories { + type Err = (); + fn from_str(s: &str) -> Result { + use IssuingCardAuthorizationControlsAllowedCategories::*; + match s { + "ac_refrigeration_repair" => Ok(AcRefrigerationRepair), + "accounting_bookkeeping_services" => Ok(AccountingBookkeepingServices), + "advertising_services" => Ok(AdvertisingServices), + "agricultural_cooperative" => Ok(AgriculturalCooperative), + "airlines_air_carriers" => Ok(AirlinesAirCarriers), + "airports_flying_fields" => Ok(AirportsFlyingFields), + "ambulance_services" => Ok(AmbulanceServices), + "amusement_parks_carnivals" => Ok(AmusementParksCarnivals), + "antique_reproductions" => Ok(AntiqueReproductions), + "antique_shops" => Ok(AntiqueShops), + "aquariums" => Ok(Aquariums), + "architectural_surveying_services" => Ok(ArchitecturalSurveyingServices), + "art_dealers_and_galleries" => Ok(ArtDealersAndGalleries), + "artists_supply_and_craft_shops" => Ok(ArtistsSupplyAndCraftShops), + "auto_and_home_supply_stores" => Ok(AutoAndHomeSupplyStores), + "auto_body_repair_shops" => Ok(AutoBodyRepairShops), + "auto_paint_shops" => Ok(AutoPaintShops), + "auto_service_shops" => Ok(AutoServiceShops), + "automated_cash_disburse" => Ok(AutomatedCashDisburse), + "automated_fuel_dispensers" => Ok(AutomatedFuelDispensers), + "automobile_associations" => Ok(AutomobileAssociations), + "automotive_parts_and_accessories_stores" => Ok(AutomotivePartsAndAccessoriesStores), + "automotive_tire_stores" => Ok(AutomotiveTireStores), + "bail_and_bond_payments" => Ok(BailAndBondPayments), + "bakeries" => Ok(Bakeries), + "bands_orchestras" => Ok(BandsOrchestras), + "barber_and_beauty_shops" => Ok(BarberAndBeautyShops), + "betting_casino_gambling" => Ok(BettingCasinoGambling), + "bicycle_shops" => Ok(BicycleShops), + "billiard_pool_establishments" => Ok(BilliardPoolEstablishments), + "boat_dealers" => Ok(BoatDealers), + "boat_rentals_and_leases" => Ok(BoatRentalsAndLeases), + "book_stores" => Ok(BookStores), + "books_periodicals_and_newspapers" => Ok(BooksPeriodicalsAndNewspapers), + "bowling_alleys" => Ok(BowlingAlleys), + "bus_lines" => Ok(BusLines), + "business_secretarial_schools" => Ok(BusinessSecretarialSchools), + "buying_shopping_services" => Ok(BuyingShoppingServices), + "cable_satellite_and_other_pay_television_and_radio" => { + Ok(CableSatelliteAndOtherPayTelevisionAndRadio) + } + "camera_and_photographic_supply_stores" => Ok(CameraAndPhotographicSupplyStores), + "candy_nut_and_confectionery_stores" => Ok(CandyNutAndConfectioneryStores), + "car_and_truck_dealers_new_used" => Ok(CarAndTruckDealersNewUsed), + "car_and_truck_dealers_used_only" => Ok(CarAndTruckDealersUsedOnly), + "car_rental_agencies" => Ok(CarRentalAgencies), + "car_washes" => Ok(CarWashes), + "carpentry_services" => Ok(CarpentryServices), + "carpet_upholstery_cleaning" => Ok(CarpetUpholsteryCleaning), + "caterers" => Ok(Caterers), + "charitable_and_social_service_organizations_fundraising" => { + Ok(CharitableAndSocialServiceOrganizationsFundraising) + } + "chemicals_and_allied_products" => Ok(ChemicalsAndAlliedProducts), + "child_care_services" => Ok(ChildCareServices), + "childrens_and_infants_wear_stores" => Ok(ChildrensAndInfantsWearStores), + "chiropodists_podiatrists" => Ok(ChiropodistsPodiatrists), + "chiropractors" => Ok(Chiropractors), + "cigar_stores_and_stands" => Ok(CigarStoresAndStands), + "civic_social_fraternal_associations" => Ok(CivicSocialFraternalAssociations), + "cleaning_and_maintenance" => Ok(CleaningAndMaintenance), + "clothing_rental" => Ok(ClothingRental), + "colleges_universities" => Ok(CollegesUniversities), + "commercial_equipment" => Ok(CommercialEquipment), + "commercial_footwear" => Ok(CommercialFootwear), + "commercial_photography_art_and_graphics" => Ok(CommercialPhotographyArtAndGraphics), + "commuter_transport_and_ferries" => Ok(CommuterTransportAndFerries), + "computer_network_services" => Ok(ComputerNetworkServices), + "computer_programming" => Ok(ComputerProgramming), + "computer_repair" => Ok(ComputerRepair), + "computer_software_stores" => Ok(ComputerSoftwareStores), + "computers_peripherals_and_software" => Ok(ComputersPeripheralsAndSoftware), + "concrete_work_services" => Ok(ConcreteWorkServices), + "construction_materials" => Ok(ConstructionMaterials), + "consulting_public_relations" => Ok(ConsultingPublicRelations), + "correspondence_schools" => Ok(CorrespondenceSchools), + "cosmetic_stores" => Ok(CosmeticStores), + "counseling_services" => Ok(CounselingServices), + "country_clubs" => Ok(CountryClubs), + "courier_services" => Ok(CourierServices), + "court_costs" => Ok(CourtCosts), + "credit_reporting_agencies" => Ok(CreditReportingAgencies), + "cruise_lines" => Ok(CruiseLines), + "dairy_products_stores" => Ok(DairyProductsStores), + "dance_hall_studios_schools" => Ok(DanceHallStudiosSchools), + "dating_escort_services" => Ok(DatingEscortServices), + "dentists_orthodontists" => Ok(DentistsOrthodontists), + "department_stores" => Ok(DepartmentStores), + "detective_agencies" => Ok(DetectiveAgencies), + "digital_goods_applications" => Ok(DigitalGoodsApplications), + "digital_goods_games" => Ok(DigitalGoodsGames), + "digital_goods_large_volume" => Ok(DigitalGoodsLargeVolume), + "digital_goods_media" => Ok(DigitalGoodsMedia), + "direct_marketing_catalog_merchant" => Ok(DirectMarketingCatalogMerchant), + "direct_marketing_combination_catalog_and_retail_merchant" => { + Ok(DirectMarketingCombinationCatalogAndRetailMerchant) + } + "direct_marketing_inbound_telemarketing" => Ok(DirectMarketingInboundTelemarketing), + "direct_marketing_insurance_services" => Ok(DirectMarketingInsuranceServices), + "direct_marketing_other" => Ok(DirectMarketingOther), + "direct_marketing_outbound_telemarketing" => Ok(DirectMarketingOutboundTelemarketing), + "direct_marketing_subscription" => Ok(DirectMarketingSubscription), + "direct_marketing_travel" => Ok(DirectMarketingTravel), + "discount_stores" => Ok(DiscountStores), + "doctors" => Ok(Doctors), + "door_to_door_sales" => Ok(DoorToDoorSales), + "drapery_window_covering_and_upholstery_stores" => { + Ok(DraperyWindowCoveringAndUpholsteryStores) + } + "drinking_places" => Ok(DrinkingPlaces), + "drug_stores_and_pharmacies" => Ok(DrugStoresAndPharmacies), + "drugs_drug_proprietaries_and_druggist_sundries" => { + Ok(DrugsDrugProprietariesAndDruggistSundries) + } + "dry_cleaners" => Ok(DryCleaners), + "durable_goods" => Ok(DurableGoods), + "duty_free_stores" => Ok(DutyFreeStores), + "eating_places_restaurants" => Ok(EatingPlacesRestaurants), + "educational_services" => Ok(EducationalServices), + "electric_razor_stores" => Ok(ElectricRazorStores), + "electric_vehicle_charging" => Ok(ElectricVehicleCharging), + "electrical_parts_and_equipment" => Ok(ElectricalPartsAndEquipment), + "electrical_services" => Ok(ElectricalServices), + "electronics_repair_shops" => Ok(ElectronicsRepairShops), + "electronics_stores" => Ok(ElectronicsStores), + "elementary_secondary_schools" => Ok(ElementarySecondarySchools), + "emergency_services_gcas_visa_use_only" => Ok(EmergencyServicesGcasVisaUseOnly), + "employment_temp_agencies" => Ok(EmploymentTempAgencies), + "equipment_rental" => Ok(EquipmentRental), + "exterminating_services" => Ok(ExterminatingServices), + "family_clothing_stores" => Ok(FamilyClothingStores), + "fast_food_restaurants" => Ok(FastFoodRestaurants), + "financial_institutions" => Ok(FinancialInstitutions), + "fines_government_administrative_entities" => Ok(FinesGovernmentAdministrativeEntities), + "fireplace_fireplace_screens_and_accessories_stores" => { + Ok(FireplaceFireplaceScreensAndAccessoriesStores) + } + "floor_covering_stores" => Ok(FloorCoveringStores), + "florists" => Ok(Florists), + "florists_supplies_nursery_stock_and_flowers" => { + Ok(FloristsSuppliesNurseryStockAndFlowers) + } + "freezer_and_locker_meat_provisioners" => Ok(FreezerAndLockerMeatProvisioners), + "fuel_dealers_non_automotive" => Ok(FuelDealersNonAutomotive), + "funeral_services_crematories" => Ok(FuneralServicesCrematories), + "furniture_home_furnishings_and_equipment_stores_except_appliances" => { + Ok(FurnitureHomeFurnishingsAndEquipmentStoresExceptAppliances) + } + "furniture_repair_refinishing" => Ok(FurnitureRepairRefinishing), + "furriers_and_fur_shops" => Ok(FurriersAndFurShops), + "general_services" => Ok(GeneralServices), + "gift_card_novelty_and_souvenir_shops" => Ok(GiftCardNoveltyAndSouvenirShops), + "glass_paint_and_wallpaper_stores" => Ok(GlassPaintAndWallpaperStores), + "glassware_crystal_stores" => Ok(GlasswareCrystalStores), + "golf_courses_public" => Ok(GolfCoursesPublic), + "government_licensed_horse_dog_racing_us_region_only" => { + Ok(GovernmentLicensedHorseDogRacingUsRegionOnly) + } + "government_licensed_online_casions_online_gambling_us_region_only" => { + Ok(GovernmentLicensedOnlineCasionsOnlineGamblingUsRegionOnly) + } + "government_owned_lotteries_non_us_region" => Ok(GovernmentOwnedLotteriesNonUsRegion), + "government_owned_lotteries_us_region_only" => Ok(GovernmentOwnedLotteriesUsRegionOnly), + "government_services" => Ok(GovernmentServices), + "grocery_stores_supermarkets" => Ok(GroceryStoresSupermarkets), + "hardware_equipment_and_supplies" => Ok(HardwareEquipmentAndSupplies), + "hardware_stores" => Ok(HardwareStores), + "health_and_beauty_spas" => Ok(HealthAndBeautySpas), + "hearing_aids_sales_and_supplies" => Ok(HearingAidsSalesAndSupplies), + "heating_plumbing_a_c" => Ok(HeatingPlumbingAC), + "hobby_toy_and_game_shops" => Ok(HobbyToyAndGameShops), + "home_supply_warehouse_stores" => Ok(HomeSupplyWarehouseStores), + "hospitals" => Ok(Hospitals), + "hotels_motels_and_resorts" => Ok(HotelsMotelsAndResorts), + "household_appliance_stores" => Ok(HouseholdApplianceStores), + "industrial_supplies" => Ok(IndustrialSupplies), + "information_retrieval_services" => Ok(InformationRetrievalServices), + "insurance_default" => Ok(InsuranceDefault), + "insurance_underwriting_premiums" => Ok(InsuranceUnderwritingPremiums), + "intra_company_purchases" => Ok(IntraCompanyPurchases), + "jewelry_stores_watches_clocks_and_silverware_stores" => { + Ok(JewelryStoresWatchesClocksAndSilverwareStores) + } + "landscaping_services" => Ok(LandscapingServices), + "laundries" => Ok(Laundries), + "laundry_cleaning_services" => Ok(LaundryCleaningServices), + "legal_services_attorneys" => Ok(LegalServicesAttorneys), + "luggage_and_leather_goods_stores" => Ok(LuggageAndLeatherGoodsStores), + "lumber_building_materials_stores" => Ok(LumberBuildingMaterialsStores), + "manual_cash_disburse" => Ok(ManualCashDisburse), + "marinas_service_and_supplies" => Ok(MarinasServiceAndSupplies), + "marketplaces" => Ok(Marketplaces), + "masonry_stonework_and_plaster" => Ok(MasonryStoneworkAndPlaster), + "massage_parlors" => Ok(MassageParlors), + "medical_and_dental_labs" => Ok(MedicalAndDentalLabs), + "medical_dental_ophthalmic_and_hospital_equipment_and_supplies" => { + Ok(MedicalDentalOphthalmicAndHospitalEquipmentAndSupplies) + } + "medical_services" => Ok(MedicalServices), + "membership_organizations" => Ok(MembershipOrganizations), + "mens_and_boys_clothing_and_accessories_stores" => { + Ok(MensAndBoysClothingAndAccessoriesStores) + } + "mens_womens_clothing_stores" => Ok(MensWomensClothingStores), + "metal_service_centers" => Ok(MetalServiceCenters), + "miscellaneous" => Ok(Miscellaneous), + "miscellaneous_apparel_and_accessory_shops" => { + Ok(MiscellaneousApparelAndAccessoryShops) + } + "miscellaneous_auto_dealers" => Ok(MiscellaneousAutoDealers), + "miscellaneous_business_services" => Ok(MiscellaneousBusinessServices), + "miscellaneous_food_stores" => Ok(MiscellaneousFoodStores), + "miscellaneous_general_merchandise" => Ok(MiscellaneousGeneralMerchandise), + "miscellaneous_general_services" => Ok(MiscellaneousGeneralServices), + "miscellaneous_home_furnishing_specialty_stores" => { + Ok(MiscellaneousHomeFurnishingSpecialtyStores) + } + "miscellaneous_publishing_and_printing" => Ok(MiscellaneousPublishingAndPrinting), + "miscellaneous_recreation_services" => Ok(MiscellaneousRecreationServices), + "miscellaneous_repair_shops" => Ok(MiscellaneousRepairShops), + "miscellaneous_specialty_retail" => Ok(MiscellaneousSpecialtyRetail), + "mobile_home_dealers" => Ok(MobileHomeDealers), + "motion_picture_theaters" => Ok(MotionPictureTheaters), + "motor_freight_carriers_and_trucking" => Ok(MotorFreightCarriersAndTrucking), + "motor_homes_dealers" => Ok(MotorHomesDealers), + "motor_vehicle_supplies_and_new_parts" => Ok(MotorVehicleSuppliesAndNewParts), + "motorcycle_shops_and_dealers" => Ok(MotorcycleShopsAndDealers), + "motorcycle_shops_dealers" => Ok(MotorcycleShopsDealers), + "music_stores_musical_instruments_pianos_and_sheet_music" => { + Ok(MusicStoresMusicalInstrumentsPianosAndSheetMusic) + } + "news_dealers_and_newsstands" => Ok(NewsDealersAndNewsstands), + "non_fi_money_orders" => Ok(NonFiMoneyOrders), + "non_fi_stored_value_card_purchase_load" => Ok(NonFiStoredValueCardPurchaseLoad), + "nondurable_goods" => Ok(NondurableGoods), + "nurseries_lawn_and_garden_supply_stores" => Ok(NurseriesLawnAndGardenSupplyStores), + "nursing_personal_care" => Ok(NursingPersonalCare), + "office_and_commercial_furniture" => Ok(OfficeAndCommercialFurniture), + "opticians_eyeglasses" => Ok(OpticiansEyeglasses), + "optometrists_ophthalmologist" => Ok(OptometristsOphthalmologist), + "orthopedic_goods_prosthetic_devices" => Ok(OrthopedicGoodsProstheticDevices), + "osteopaths" => Ok(Osteopaths), + "package_stores_beer_wine_and_liquor" => Ok(PackageStoresBeerWineAndLiquor), + "paints_varnishes_and_supplies" => Ok(PaintsVarnishesAndSupplies), + "parking_lots_garages" => Ok(ParkingLotsGarages), + "passenger_railways" => Ok(PassengerRailways), + "pawn_shops" => Ok(PawnShops), + "pet_shops_pet_food_and_supplies" => Ok(PetShopsPetFoodAndSupplies), + "petroleum_and_petroleum_products" => Ok(PetroleumAndPetroleumProducts), + "photo_developing" => Ok(PhotoDeveloping), + "photographic_photocopy_microfilm_equipment_and_supplies" => { + Ok(PhotographicPhotocopyMicrofilmEquipmentAndSupplies) + } + "photographic_studios" => Ok(PhotographicStudios), + "picture_video_production" => Ok(PictureVideoProduction), + "piece_goods_notions_and_other_dry_goods" => Ok(PieceGoodsNotionsAndOtherDryGoods), + "plumbing_heating_equipment_and_supplies" => Ok(PlumbingHeatingEquipmentAndSupplies), + "political_organizations" => Ok(PoliticalOrganizations), + "postal_services_government_only" => Ok(PostalServicesGovernmentOnly), + "precious_stones_and_metals_watches_and_jewelry" => { + Ok(PreciousStonesAndMetalsWatchesAndJewelry) + } + "professional_services" => Ok(ProfessionalServices), + "public_warehousing_and_storage" => Ok(PublicWarehousingAndStorage), + "quick_copy_repro_and_blueprint" => Ok(QuickCopyReproAndBlueprint), + "railroads" => Ok(Railroads), + "real_estate_agents_and_managers_rentals" => Ok(RealEstateAgentsAndManagersRentals), + "record_stores" => Ok(RecordStores), + "recreational_vehicle_rentals" => Ok(RecreationalVehicleRentals), + "religious_goods_stores" => Ok(ReligiousGoodsStores), + "religious_organizations" => Ok(ReligiousOrganizations), + "roofing_siding_sheet_metal" => Ok(RoofingSidingSheetMetal), + "secretarial_support_services" => Ok(SecretarialSupportServices), + "security_brokers_dealers" => Ok(SecurityBrokersDealers), + "service_stations" => Ok(ServiceStations), + "sewing_needlework_fabric_and_piece_goods_stores" => { + Ok(SewingNeedleworkFabricAndPieceGoodsStores) + } + "shoe_repair_hat_cleaning" => Ok(ShoeRepairHatCleaning), + "shoe_stores" => Ok(ShoeStores), + "small_appliance_repair" => Ok(SmallApplianceRepair), + "snowmobile_dealers" => Ok(SnowmobileDealers), + "special_trade_services" => Ok(SpecialTradeServices), + "specialty_cleaning" => Ok(SpecialtyCleaning), + "sporting_goods_stores" => Ok(SportingGoodsStores), + "sporting_recreation_camps" => Ok(SportingRecreationCamps), + "sports_and_riding_apparel_stores" => Ok(SportsAndRidingApparelStores), + "sports_clubs_fields" => Ok(SportsClubsFields), + "stamp_and_coin_stores" => Ok(StampAndCoinStores), + "stationary_office_supplies_printing_and_writing_paper" => { + Ok(StationaryOfficeSuppliesPrintingAndWritingPaper) + } + "stationery_stores_office_and_school_supply_stores" => { + Ok(StationeryStoresOfficeAndSchoolSupplyStores) + } + "swimming_pools_sales" => Ok(SwimmingPoolsSales), + "t_ui_travel_germany" => Ok(TUiTravelGermany), + "tailors_alterations" => Ok(TailorsAlterations), + "tax_payments_government_agencies" => Ok(TaxPaymentsGovernmentAgencies), + "tax_preparation_services" => Ok(TaxPreparationServices), + "taxicabs_limousines" => Ok(TaxicabsLimousines), + "telecommunication_equipment_and_telephone_sales" => { + Ok(TelecommunicationEquipmentAndTelephoneSales) + } + "telecommunication_services" => Ok(TelecommunicationServices), + "telegraph_services" => Ok(TelegraphServices), + "tent_and_awning_shops" => Ok(TentAndAwningShops), + "testing_laboratories" => Ok(TestingLaboratories), + "theatrical_ticket_agencies" => Ok(TheatricalTicketAgencies), + "timeshares" => Ok(Timeshares), + "tire_retreading_and_repair" => Ok(TireRetreadingAndRepair), + "tolls_bridge_fees" => Ok(TollsBridgeFees), + "tourist_attractions_and_exhibits" => Ok(TouristAttractionsAndExhibits), + "towing_services" => Ok(TowingServices), + "trailer_parks_campgrounds" => Ok(TrailerParksCampgrounds), + "transportation_services" => Ok(TransportationServices), + "travel_agencies_tour_operators" => Ok(TravelAgenciesTourOperators), + "truck_stop_iteration" => Ok(TruckStopIteration), + "truck_utility_trailer_rentals" => Ok(TruckUtilityTrailerRentals), + "typesetting_plate_making_and_related_services" => { + Ok(TypesettingPlateMakingAndRelatedServices) + } + "typewriter_stores" => Ok(TypewriterStores), + "u_s_federal_government_agencies_or_departments" => { + Ok(USFederalGovernmentAgenciesOrDepartments) + } + "uniforms_commercial_clothing" => Ok(UniformsCommercialClothing), + "used_merchandise_and_secondhand_stores" => Ok(UsedMerchandiseAndSecondhandStores), + "utilities" => Ok(Utilities), + "variety_stores" => Ok(VarietyStores), + "veterinary_services" => Ok(VeterinaryServices), + "video_amusement_game_supplies" => Ok(VideoAmusementGameSupplies), + "video_game_arcades" => Ok(VideoGameArcades), + "video_tape_rental_stores" => Ok(VideoTapeRentalStores), + "vocational_trade_schools" => Ok(VocationalTradeSchools), + "watch_jewelry_repair" => Ok(WatchJewelryRepair), + "welding_repair" => Ok(WeldingRepair), + "wholesale_clubs" => Ok(WholesaleClubs), + "wig_and_toupee_stores" => Ok(WigAndToupeeStores), + "wires_money_orders" => Ok(WiresMoneyOrders), + "womens_accessory_and_specialty_shops" => Ok(WomensAccessoryAndSpecialtyShops), + "womens_ready_to_wear_stores" => Ok(WomensReadyToWearStores), + "wrecking_and_salvage_yards" => Ok(WreckingAndSalvageYards), + _ => Err(()), + } + } +} +impl std::fmt::Display for IssuingCardAuthorizationControlsAllowedCategories { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for IssuingCardAuthorizationControlsAllowedCategories { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for IssuingCardAuthorizationControlsAllowedCategories { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for IssuingCardAuthorizationControlsAllowedCategories { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Ok(Self::from_str(&s).unwrap_or(IssuingCardAuthorizationControlsAllowedCategories::Unknown)) + } +} +/// Array of strings containing [categories](https://stripe.com/docs/api#issuing_authorization_object-merchant_data-category) of authorizations to decline. +/// All other categories will be allowed. +/// Cannot be set with `allowed_categories`. +#[derive(Copy, Clone, Eq, PartialEq)] +#[non_exhaustive] +pub enum IssuingCardAuthorizationControlsBlockedCategories { + AcRefrigerationRepair, + AccountingBookkeepingServices, + AdvertisingServices, + AgriculturalCooperative, + AirlinesAirCarriers, + AirportsFlyingFields, + AmbulanceServices, + AmusementParksCarnivals, + AntiqueReproductions, + AntiqueShops, + Aquariums, + ArchitecturalSurveyingServices, + ArtDealersAndGalleries, + ArtistsSupplyAndCraftShops, + AutoAndHomeSupplyStores, + AutoBodyRepairShops, + AutoPaintShops, + AutoServiceShops, + AutomatedCashDisburse, + AutomatedFuelDispensers, + AutomobileAssociations, + AutomotivePartsAndAccessoriesStores, + AutomotiveTireStores, + BailAndBondPayments, + Bakeries, + BandsOrchestras, + BarberAndBeautyShops, + BettingCasinoGambling, + BicycleShops, + BilliardPoolEstablishments, + BoatDealers, + BoatRentalsAndLeases, + BookStores, + BooksPeriodicalsAndNewspapers, + BowlingAlleys, + BusLines, + BusinessSecretarialSchools, + BuyingShoppingServices, + CableSatelliteAndOtherPayTelevisionAndRadio, + CameraAndPhotographicSupplyStores, + CandyNutAndConfectioneryStores, + CarAndTruckDealersNewUsed, + CarAndTruckDealersUsedOnly, + CarRentalAgencies, + CarWashes, + CarpentryServices, + CarpetUpholsteryCleaning, + Caterers, + CharitableAndSocialServiceOrganizationsFundraising, + ChemicalsAndAlliedProducts, + ChildCareServices, + ChildrensAndInfantsWearStores, + ChiropodistsPodiatrists, + Chiropractors, + CigarStoresAndStands, + CivicSocialFraternalAssociations, + CleaningAndMaintenance, + ClothingRental, + CollegesUniversities, + CommercialEquipment, + CommercialFootwear, + CommercialPhotographyArtAndGraphics, + CommuterTransportAndFerries, + ComputerNetworkServices, + ComputerProgramming, + ComputerRepair, + ComputerSoftwareStores, + ComputersPeripheralsAndSoftware, + ConcreteWorkServices, + ConstructionMaterials, + ConsultingPublicRelations, + CorrespondenceSchools, + CosmeticStores, + CounselingServices, + CountryClubs, + CourierServices, + CourtCosts, + CreditReportingAgencies, + CruiseLines, + DairyProductsStores, + DanceHallStudiosSchools, + DatingEscortServices, + DentistsOrthodontists, + DepartmentStores, + DetectiveAgencies, + DigitalGoodsApplications, + DigitalGoodsGames, + DigitalGoodsLargeVolume, + DigitalGoodsMedia, + DirectMarketingCatalogMerchant, + DirectMarketingCombinationCatalogAndRetailMerchant, + DirectMarketingInboundTelemarketing, + DirectMarketingInsuranceServices, + DirectMarketingOther, + DirectMarketingOutboundTelemarketing, + DirectMarketingSubscription, + DirectMarketingTravel, + DiscountStores, + Doctors, + DoorToDoorSales, + DraperyWindowCoveringAndUpholsteryStores, + DrinkingPlaces, + DrugStoresAndPharmacies, + DrugsDrugProprietariesAndDruggistSundries, + DryCleaners, + DurableGoods, + DutyFreeStores, + EatingPlacesRestaurants, + EducationalServices, + ElectricRazorStores, + ElectricVehicleCharging, + ElectricalPartsAndEquipment, + ElectricalServices, + ElectronicsRepairShops, + ElectronicsStores, + ElementarySecondarySchools, + EmergencyServicesGcasVisaUseOnly, + EmploymentTempAgencies, + EquipmentRental, + ExterminatingServices, + FamilyClothingStores, + FastFoodRestaurants, + FinancialInstitutions, + FinesGovernmentAdministrativeEntities, + FireplaceFireplaceScreensAndAccessoriesStores, + FloorCoveringStores, + Florists, + FloristsSuppliesNurseryStockAndFlowers, + FreezerAndLockerMeatProvisioners, + FuelDealersNonAutomotive, + FuneralServicesCrematories, + FurnitureHomeFurnishingsAndEquipmentStoresExceptAppliances, + FurnitureRepairRefinishing, + FurriersAndFurShops, + GeneralServices, + GiftCardNoveltyAndSouvenirShops, + GlassPaintAndWallpaperStores, + GlasswareCrystalStores, + GolfCoursesPublic, + GovernmentLicensedHorseDogRacingUsRegionOnly, + GovernmentLicensedOnlineCasionsOnlineGamblingUsRegionOnly, + GovernmentOwnedLotteriesNonUsRegion, + GovernmentOwnedLotteriesUsRegionOnly, + GovernmentServices, + GroceryStoresSupermarkets, + HardwareEquipmentAndSupplies, + HardwareStores, + HealthAndBeautySpas, + HearingAidsSalesAndSupplies, + HeatingPlumbingAC, + HobbyToyAndGameShops, + HomeSupplyWarehouseStores, + Hospitals, + HotelsMotelsAndResorts, + HouseholdApplianceStores, + IndustrialSupplies, + InformationRetrievalServices, + InsuranceDefault, + InsuranceUnderwritingPremiums, + IntraCompanyPurchases, + JewelryStoresWatchesClocksAndSilverwareStores, + LandscapingServices, + Laundries, + LaundryCleaningServices, + LegalServicesAttorneys, + LuggageAndLeatherGoodsStores, + LumberBuildingMaterialsStores, + ManualCashDisburse, + MarinasServiceAndSupplies, + Marketplaces, + MasonryStoneworkAndPlaster, + MassageParlors, + MedicalAndDentalLabs, + MedicalDentalOphthalmicAndHospitalEquipmentAndSupplies, + MedicalServices, + MembershipOrganizations, + MensAndBoysClothingAndAccessoriesStores, + MensWomensClothingStores, + MetalServiceCenters, + Miscellaneous, + MiscellaneousApparelAndAccessoryShops, + MiscellaneousAutoDealers, + MiscellaneousBusinessServices, + MiscellaneousFoodStores, + MiscellaneousGeneralMerchandise, + MiscellaneousGeneralServices, + MiscellaneousHomeFurnishingSpecialtyStores, + MiscellaneousPublishingAndPrinting, + MiscellaneousRecreationServices, + MiscellaneousRepairShops, + MiscellaneousSpecialtyRetail, + MobileHomeDealers, + MotionPictureTheaters, + MotorFreightCarriersAndTrucking, + MotorHomesDealers, + MotorVehicleSuppliesAndNewParts, + MotorcycleShopsAndDealers, + MotorcycleShopsDealers, + MusicStoresMusicalInstrumentsPianosAndSheetMusic, + NewsDealersAndNewsstands, + NonFiMoneyOrders, + NonFiStoredValueCardPurchaseLoad, + NondurableGoods, + NurseriesLawnAndGardenSupplyStores, + NursingPersonalCare, + OfficeAndCommercialFurniture, + OpticiansEyeglasses, + OptometristsOphthalmologist, + OrthopedicGoodsProstheticDevices, + Osteopaths, + PackageStoresBeerWineAndLiquor, + PaintsVarnishesAndSupplies, + ParkingLotsGarages, + PassengerRailways, + PawnShops, + PetShopsPetFoodAndSupplies, + PetroleumAndPetroleumProducts, + PhotoDeveloping, + PhotographicPhotocopyMicrofilmEquipmentAndSupplies, + PhotographicStudios, + PictureVideoProduction, + PieceGoodsNotionsAndOtherDryGoods, + PlumbingHeatingEquipmentAndSupplies, + PoliticalOrganizations, + PostalServicesGovernmentOnly, + PreciousStonesAndMetalsWatchesAndJewelry, + ProfessionalServices, + PublicWarehousingAndStorage, + QuickCopyReproAndBlueprint, + Railroads, + RealEstateAgentsAndManagersRentals, + RecordStores, + RecreationalVehicleRentals, + ReligiousGoodsStores, + ReligiousOrganizations, + RoofingSidingSheetMetal, + SecretarialSupportServices, + SecurityBrokersDealers, + ServiceStations, + SewingNeedleworkFabricAndPieceGoodsStores, + ShoeRepairHatCleaning, + ShoeStores, + SmallApplianceRepair, + SnowmobileDealers, + SpecialTradeServices, + SpecialtyCleaning, + SportingGoodsStores, + SportingRecreationCamps, + SportsAndRidingApparelStores, + SportsClubsFields, + StampAndCoinStores, + StationaryOfficeSuppliesPrintingAndWritingPaper, + StationeryStoresOfficeAndSchoolSupplyStores, + SwimmingPoolsSales, + TUiTravelGermany, + TailorsAlterations, + TaxPaymentsGovernmentAgencies, + TaxPreparationServices, + TaxicabsLimousines, + TelecommunicationEquipmentAndTelephoneSales, + TelecommunicationServices, + TelegraphServices, + TentAndAwningShops, + TestingLaboratories, + TheatricalTicketAgencies, + Timeshares, + TireRetreadingAndRepair, + TollsBridgeFees, + TouristAttractionsAndExhibits, + TowingServices, + TrailerParksCampgrounds, + TransportationServices, + TravelAgenciesTourOperators, + TruckStopIteration, + TruckUtilityTrailerRentals, + TypesettingPlateMakingAndRelatedServices, + TypewriterStores, + USFederalGovernmentAgenciesOrDepartments, + UniformsCommercialClothing, + UsedMerchandiseAndSecondhandStores, + Utilities, + VarietyStores, + VeterinaryServices, + VideoAmusementGameSupplies, + VideoGameArcades, + VideoTapeRentalStores, + VocationalTradeSchools, + WatchJewelryRepair, + WeldingRepair, + WholesaleClubs, + WigAndToupeeStores, + WiresMoneyOrders, + WomensAccessoryAndSpecialtyShops, + WomensReadyToWearStores, + WreckingAndSalvageYards, + /// An unrecognized value from Stripe. Should not be used as a request parameter. + Unknown, +} +impl IssuingCardAuthorizationControlsBlockedCategories { + pub fn as_str(self) -> &'static str { + use IssuingCardAuthorizationControlsBlockedCategories::*; + match self { + AcRefrigerationRepair => "ac_refrigeration_repair", + AccountingBookkeepingServices => "accounting_bookkeeping_services", + AdvertisingServices => "advertising_services", + AgriculturalCooperative => "agricultural_cooperative", + AirlinesAirCarriers => "airlines_air_carriers", + AirportsFlyingFields => "airports_flying_fields", + AmbulanceServices => "ambulance_services", + AmusementParksCarnivals => "amusement_parks_carnivals", + AntiqueReproductions => "antique_reproductions", + AntiqueShops => "antique_shops", + Aquariums => "aquariums", + ArchitecturalSurveyingServices => "architectural_surveying_services", + ArtDealersAndGalleries => "art_dealers_and_galleries", + ArtistsSupplyAndCraftShops => "artists_supply_and_craft_shops", + AutoAndHomeSupplyStores => "auto_and_home_supply_stores", + AutoBodyRepairShops => "auto_body_repair_shops", + AutoPaintShops => "auto_paint_shops", + AutoServiceShops => "auto_service_shops", + AutomatedCashDisburse => "automated_cash_disburse", + AutomatedFuelDispensers => "automated_fuel_dispensers", + AutomobileAssociations => "automobile_associations", + AutomotivePartsAndAccessoriesStores => "automotive_parts_and_accessories_stores", + AutomotiveTireStores => "automotive_tire_stores", + BailAndBondPayments => "bail_and_bond_payments", + Bakeries => "bakeries", + BandsOrchestras => "bands_orchestras", + BarberAndBeautyShops => "barber_and_beauty_shops", + BettingCasinoGambling => "betting_casino_gambling", + BicycleShops => "bicycle_shops", + BilliardPoolEstablishments => "billiard_pool_establishments", + BoatDealers => "boat_dealers", + BoatRentalsAndLeases => "boat_rentals_and_leases", + BookStores => "book_stores", + BooksPeriodicalsAndNewspapers => "books_periodicals_and_newspapers", + BowlingAlleys => "bowling_alleys", + BusLines => "bus_lines", + BusinessSecretarialSchools => "business_secretarial_schools", + BuyingShoppingServices => "buying_shopping_services", + CableSatelliteAndOtherPayTelevisionAndRadio => { + "cable_satellite_and_other_pay_television_and_radio" + } + CameraAndPhotographicSupplyStores => "camera_and_photographic_supply_stores", + CandyNutAndConfectioneryStores => "candy_nut_and_confectionery_stores", + CarAndTruckDealersNewUsed => "car_and_truck_dealers_new_used", + CarAndTruckDealersUsedOnly => "car_and_truck_dealers_used_only", + CarRentalAgencies => "car_rental_agencies", + CarWashes => "car_washes", + CarpentryServices => "carpentry_services", + CarpetUpholsteryCleaning => "carpet_upholstery_cleaning", + Caterers => "caterers", + CharitableAndSocialServiceOrganizationsFundraising => { + "charitable_and_social_service_organizations_fundraising" + } + ChemicalsAndAlliedProducts => "chemicals_and_allied_products", + ChildCareServices => "child_care_services", + ChildrensAndInfantsWearStores => "childrens_and_infants_wear_stores", + ChiropodistsPodiatrists => "chiropodists_podiatrists", + Chiropractors => "chiropractors", + CigarStoresAndStands => "cigar_stores_and_stands", + CivicSocialFraternalAssociations => "civic_social_fraternal_associations", + CleaningAndMaintenance => "cleaning_and_maintenance", + ClothingRental => "clothing_rental", + CollegesUniversities => "colleges_universities", + CommercialEquipment => "commercial_equipment", + CommercialFootwear => "commercial_footwear", + CommercialPhotographyArtAndGraphics => "commercial_photography_art_and_graphics", + CommuterTransportAndFerries => "commuter_transport_and_ferries", + ComputerNetworkServices => "computer_network_services", + ComputerProgramming => "computer_programming", + ComputerRepair => "computer_repair", + ComputerSoftwareStores => "computer_software_stores", + ComputersPeripheralsAndSoftware => "computers_peripherals_and_software", + ConcreteWorkServices => "concrete_work_services", + ConstructionMaterials => "construction_materials", + ConsultingPublicRelations => "consulting_public_relations", + CorrespondenceSchools => "correspondence_schools", + CosmeticStores => "cosmetic_stores", + CounselingServices => "counseling_services", + CountryClubs => "country_clubs", + CourierServices => "courier_services", + CourtCosts => "court_costs", + CreditReportingAgencies => "credit_reporting_agencies", + CruiseLines => "cruise_lines", + DairyProductsStores => "dairy_products_stores", + DanceHallStudiosSchools => "dance_hall_studios_schools", + DatingEscortServices => "dating_escort_services", + DentistsOrthodontists => "dentists_orthodontists", + DepartmentStores => "department_stores", + DetectiveAgencies => "detective_agencies", + DigitalGoodsApplications => "digital_goods_applications", + DigitalGoodsGames => "digital_goods_games", + DigitalGoodsLargeVolume => "digital_goods_large_volume", + DigitalGoodsMedia => "digital_goods_media", + DirectMarketingCatalogMerchant => "direct_marketing_catalog_merchant", + DirectMarketingCombinationCatalogAndRetailMerchant => { + "direct_marketing_combination_catalog_and_retail_merchant" + } + DirectMarketingInboundTelemarketing => "direct_marketing_inbound_telemarketing", + DirectMarketingInsuranceServices => "direct_marketing_insurance_services", + DirectMarketingOther => "direct_marketing_other", + DirectMarketingOutboundTelemarketing => "direct_marketing_outbound_telemarketing", + DirectMarketingSubscription => "direct_marketing_subscription", + DirectMarketingTravel => "direct_marketing_travel", + DiscountStores => "discount_stores", + Doctors => "doctors", + DoorToDoorSales => "door_to_door_sales", + DraperyWindowCoveringAndUpholsteryStores => { + "drapery_window_covering_and_upholstery_stores" + } + DrinkingPlaces => "drinking_places", + DrugStoresAndPharmacies => "drug_stores_and_pharmacies", + DrugsDrugProprietariesAndDruggistSundries => { + "drugs_drug_proprietaries_and_druggist_sundries" + } + DryCleaners => "dry_cleaners", + DurableGoods => "durable_goods", + DutyFreeStores => "duty_free_stores", + EatingPlacesRestaurants => "eating_places_restaurants", + EducationalServices => "educational_services", + ElectricRazorStores => "electric_razor_stores", + ElectricVehicleCharging => "electric_vehicle_charging", + ElectricalPartsAndEquipment => "electrical_parts_and_equipment", + ElectricalServices => "electrical_services", + ElectronicsRepairShops => "electronics_repair_shops", + ElectronicsStores => "electronics_stores", + ElementarySecondarySchools => "elementary_secondary_schools", + EmergencyServicesGcasVisaUseOnly => "emergency_services_gcas_visa_use_only", + EmploymentTempAgencies => "employment_temp_agencies", + EquipmentRental => "equipment_rental", + ExterminatingServices => "exterminating_services", + FamilyClothingStores => "family_clothing_stores", + FastFoodRestaurants => "fast_food_restaurants", + FinancialInstitutions => "financial_institutions", + FinesGovernmentAdministrativeEntities => "fines_government_administrative_entities", + FireplaceFireplaceScreensAndAccessoriesStores => { + "fireplace_fireplace_screens_and_accessories_stores" + } + FloorCoveringStores => "floor_covering_stores", + Florists => "florists", + FloristsSuppliesNurseryStockAndFlowers => "florists_supplies_nursery_stock_and_flowers", + FreezerAndLockerMeatProvisioners => "freezer_and_locker_meat_provisioners", + FuelDealersNonAutomotive => "fuel_dealers_non_automotive", + FuneralServicesCrematories => "funeral_services_crematories", + FurnitureHomeFurnishingsAndEquipmentStoresExceptAppliances => { + "furniture_home_furnishings_and_equipment_stores_except_appliances" + } + FurnitureRepairRefinishing => "furniture_repair_refinishing", + FurriersAndFurShops => "furriers_and_fur_shops", + GeneralServices => "general_services", + GiftCardNoveltyAndSouvenirShops => "gift_card_novelty_and_souvenir_shops", + GlassPaintAndWallpaperStores => "glass_paint_and_wallpaper_stores", + GlasswareCrystalStores => "glassware_crystal_stores", + GolfCoursesPublic => "golf_courses_public", + GovernmentLicensedHorseDogRacingUsRegionOnly => { + "government_licensed_horse_dog_racing_us_region_only" + } + GovernmentLicensedOnlineCasionsOnlineGamblingUsRegionOnly => { + "government_licensed_online_casions_online_gambling_us_region_only" + } + GovernmentOwnedLotteriesNonUsRegion => "government_owned_lotteries_non_us_region", + GovernmentOwnedLotteriesUsRegionOnly => "government_owned_lotteries_us_region_only", + GovernmentServices => "government_services", + GroceryStoresSupermarkets => "grocery_stores_supermarkets", + HardwareEquipmentAndSupplies => "hardware_equipment_and_supplies", + HardwareStores => "hardware_stores", + HealthAndBeautySpas => "health_and_beauty_spas", + HearingAidsSalesAndSupplies => "hearing_aids_sales_and_supplies", + HeatingPlumbingAC => "heating_plumbing_a_c", + HobbyToyAndGameShops => "hobby_toy_and_game_shops", + HomeSupplyWarehouseStores => "home_supply_warehouse_stores", + Hospitals => "hospitals", + HotelsMotelsAndResorts => "hotels_motels_and_resorts", + HouseholdApplianceStores => "household_appliance_stores", + IndustrialSupplies => "industrial_supplies", + InformationRetrievalServices => "information_retrieval_services", + InsuranceDefault => "insurance_default", + InsuranceUnderwritingPremiums => "insurance_underwriting_premiums", + IntraCompanyPurchases => "intra_company_purchases", + JewelryStoresWatchesClocksAndSilverwareStores => { + "jewelry_stores_watches_clocks_and_silverware_stores" + } + LandscapingServices => "landscaping_services", + Laundries => "laundries", + LaundryCleaningServices => "laundry_cleaning_services", + LegalServicesAttorneys => "legal_services_attorneys", + LuggageAndLeatherGoodsStores => "luggage_and_leather_goods_stores", + LumberBuildingMaterialsStores => "lumber_building_materials_stores", + ManualCashDisburse => "manual_cash_disburse", + MarinasServiceAndSupplies => "marinas_service_and_supplies", + Marketplaces => "marketplaces", + MasonryStoneworkAndPlaster => "masonry_stonework_and_plaster", + MassageParlors => "massage_parlors", + MedicalAndDentalLabs => "medical_and_dental_labs", + MedicalDentalOphthalmicAndHospitalEquipmentAndSupplies => { + "medical_dental_ophthalmic_and_hospital_equipment_and_supplies" + } + MedicalServices => "medical_services", + MembershipOrganizations => "membership_organizations", + MensAndBoysClothingAndAccessoriesStores => { + "mens_and_boys_clothing_and_accessories_stores" + } + MensWomensClothingStores => "mens_womens_clothing_stores", + MetalServiceCenters => "metal_service_centers", + Miscellaneous => "miscellaneous", + MiscellaneousApparelAndAccessoryShops => "miscellaneous_apparel_and_accessory_shops", + MiscellaneousAutoDealers => "miscellaneous_auto_dealers", + MiscellaneousBusinessServices => "miscellaneous_business_services", + MiscellaneousFoodStores => "miscellaneous_food_stores", + MiscellaneousGeneralMerchandise => "miscellaneous_general_merchandise", + MiscellaneousGeneralServices => "miscellaneous_general_services", + MiscellaneousHomeFurnishingSpecialtyStores => { + "miscellaneous_home_furnishing_specialty_stores" + } + MiscellaneousPublishingAndPrinting => "miscellaneous_publishing_and_printing", + MiscellaneousRecreationServices => "miscellaneous_recreation_services", + MiscellaneousRepairShops => "miscellaneous_repair_shops", + MiscellaneousSpecialtyRetail => "miscellaneous_specialty_retail", + MobileHomeDealers => "mobile_home_dealers", + MotionPictureTheaters => "motion_picture_theaters", + MotorFreightCarriersAndTrucking => "motor_freight_carriers_and_trucking", + MotorHomesDealers => "motor_homes_dealers", + MotorVehicleSuppliesAndNewParts => "motor_vehicle_supplies_and_new_parts", + MotorcycleShopsAndDealers => "motorcycle_shops_and_dealers", + MotorcycleShopsDealers => "motorcycle_shops_dealers", + MusicStoresMusicalInstrumentsPianosAndSheetMusic => { + "music_stores_musical_instruments_pianos_and_sheet_music" + } + NewsDealersAndNewsstands => "news_dealers_and_newsstands", + NonFiMoneyOrders => "non_fi_money_orders", + NonFiStoredValueCardPurchaseLoad => "non_fi_stored_value_card_purchase_load", + NondurableGoods => "nondurable_goods", + NurseriesLawnAndGardenSupplyStores => "nurseries_lawn_and_garden_supply_stores", + NursingPersonalCare => "nursing_personal_care", + OfficeAndCommercialFurniture => "office_and_commercial_furniture", + OpticiansEyeglasses => "opticians_eyeglasses", + OptometristsOphthalmologist => "optometrists_ophthalmologist", + OrthopedicGoodsProstheticDevices => "orthopedic_goods_prosthetic_devices", + Osteopaths => "osteopaths", + PackageStoresBeerWineAndLiquor => "package_stores_beer_wine_and_liquor", + PaintsVarnishesAndSupplies => "paints_varnishes_and_supplies", + ParkingLotsGarages => "parking_lots_garages", + PassengerRailways => "passenger_railways", + PawnShops => "pawn_shops", + PetShopsPetFoodAndSupplies => "pet_shops_pet_food_and_supplies", + PetroleumAndPetroleumProducts => "petroleum_and_petroleum_products", + PhotoDeveloping => "photo_developing", + PhotographicPhotocopyMicrofilmEquipmentAndSupplies => { + "photographic_photocopy_microfilm_equipment_and_supplies" + } + PhotographicStudios => "photographic_studios", + PictureVideoProduction => "picture_video_production", + PieceGoodsNotionsAndOtherDryGoods => "piece_goods_notions_and_other_dry_goods", + PlumbingHeatingEquipmentAndSupplies => "plumbing_heating_equipment_and_supplies", + PoliticalOrganizations => "political_organizations", + PostalServicesGovernmentOnly => "postal_services_government_only", + PreciousStonesAndMetalsWatchesAndJewelry => { + "precious_stones_and_metals_watches_and_jewelry" + } + ProfessionalServices => "professional_services", + PublicWarehousingAndStorage => "public_warehousing_and_storage", + QuickCopyReproAndBlueprint => "quick_copy_repro_and_blueprint", + Railroads => "railroads", + RealEstateAgentsAndManagersRentals => "real_estate_agents_and_managers_rentals", + RecordStores => "record_stores", + RecreationalVehicleRentals => "recreational_vehicle_rentals", + ReligiousGoodsStores => "religious_goods_stores", + ReligiousOrganizations => "religious_organizations", + RoofingSidingSheetMetal => "roofing_siding_sheet_metal", + SecretarialSupportServices => "secretarial_support_services", + SecurityBrokersDealers => "security_brokers_dealers", + ServiceStations => "service_stations", + SewingNeedleworkFabricAndPieceGoodsStores => { + "sewing_needlework_fabric_and_piece_goods_stores" + } + ShoeRepairHatCleaning => "shoe_repair_hat_cleaning", + ShoeStores => "shoe_stores", + SmallApplianceRepair => "small_appliance_repair", + SnowmobileDealers => "snowmobile_dealers", + SpecialTradeServices => "special_trade_services", + SpecialtyCleaning => "specialty_cleaning", + SportingGoodsStores => "sporting_goods_stores", + SportingRecreationCamps => "sporting_recreation_camps", + SportsAndRidingApparelStores => "sports_and_riding_apparel_stores", + SportsClubsFields => "sports_clubs_fields", + StampAndCoinStores => "stamp_and_coin_stores", + StationaryOfficeSuppliesPrintingAndWritingPaper => { + "stationary_office_supplies_printing_and_writing_paper" + } + StationeryStoresOfficeAndSchoolSupplyStores => { + "stationery_stores_office_and_school_supply_stores" + } + SwimmingPoolsSales => "swimming_pools_sales", + TUiTravelGermany => "t_ui_travel_germany", + TailorsAlterations => "tailors_alterations", + TaxPaymentsGovernmentAgencies => "tax_payments_government_agencies", + TaxPreparationServices => "tax_preparation_services", + TaxicabsLimousines => "taxicabs_limousines", + TelecommunicationEquipmentAndTelephoneSales => { + "telecommunication_equipment_and_telephone_sales" + } + TelecommunicationServices => "telecommunication_services", + TelegraphServices => "telegraph_services", + TentAndAwningShops => "tent_and_awning_shops", + TestingLaboratories => "testing_laboratories", + TheatricalTicketAgencies => "theatrical_ticket_agencies", + Timeshares => "timeshares", + TireRetreadingAndRepair => "tire_retreading_and_repair", + TollsBridgeFees => "tolls_bridge_fees", + TouristAttractionsAndExhibits => "tourist_attractions_and_exhibits", + TowingServices => "towing_services", + TrailerParksCampgrounds => "trailer_parks_campgrounds", + TransportationServices => "transportation_services", + TravelAgenciesTourOperators => "travel_agencies_tour_operators", + TruckStopIteration => "truck_stop_iteration", + TruckUtilityTrailerRentals => "truck_utility_trailer_rentals", + TypesettingPlateMakingAndRelatedServices => { + "typesetting_plate_making_and_related_services" + } + TypewriterStores => "typewriter_stores", + USFederalGovernmentAgenciesOrDepartments => { + "u_s_federal_government_agencies_or_departments" + } + UniformsCommercialClothing => "uniforms_commercial_clothing", + UsedMerchandiseAndSecondhandStores => "used_merchandise_and_secondhand_stores", + Utilities => "utilities", + VarietyStores => "variety_stores", + VeterinaryServices => "veterinary_services", + VideoAmusementGameSupplies => "video_amusement_game_supplies", + VideoGameArcades => "video_game_arcades", + VideoTapeRentalStores => "video_tape_rental_stores", + VocationalTradeSchools => "vocational_trade_schools", + WatchJewelryRepair => "watch_jewelry_repair", + WeldingRepair => "welding_repair", + WholesaleClubs => "wholesale_clubs", + WigAndToupeeStores => "wig_and_toupee_stores", + WiresMoneyOrders => "wires_money_orders", + WomensAccessoryAndSpecialtyShops => "womens_accessory_and_specialty_shops", + WomensReadyToWearStores => "womens_ready_to_wear_stores", + WreckingAndSalvageYards => "wrecking_and_salvage_yards", + Unknown => "unknown", + } + } +} + +impl std::str::FromStr for IssuingCardAuthorizationControlsBlockedCategories { + type Err = (); + fn from_str(s: &str) -> Result { + use IssuingCardAuthorizationControlsBlockedCategories::*; + match s { + "ac_refrigeration_repair" => Ok(AcRefrigerationRepair), + "accounting_bookkeeping_services" => Ok(AccountingBookkeepingServices), + "advertising_services" => Ok(AdvertisingServices), + "agricultural_cooperative" => Ok(AgriculturalCooperative), + "airlines_air_carriers" => Ok(AirlinesAirCarriers), + "airports_flying_fields" => Ok(AirportsFlyingFields), + "ambulance_services" => Ok(AmbulanceServices), + "amusement_parks_carnivals" => Ok(AmusementParksCarnivals), + "antique_reproductions" => Ok(AntiqueReproductions), + "antique_shops" => Ok(AntiqueShops), + "aquariums" => Ok(Aquariums), + "architectural_surveying_services" => Ok(ArchitecturalSurveyingServices), + "art_dealers_and_galleries" => Ok(ArtDealersAndGalleries), + "artists_supply_and_craft_shops" => Ok(ArtistsSupplyAndCraftShops), + "auto_and_home_supply_stores" => Ok(AutoAndHomeSupplyStores), + "auto_body_repair_shops" => Ok(AutoBodyRepairShops), + "auto_paint_shops" => Ok(AutoPaintShops), + "auto_service_shops" => Ok(AutoServiceShops), + "automated_cash_disburse" => Ok(AutomatedCashDisburse), + "automated_fuel_dispensers" => Ok(AutomatedFuelDispensers), + "automobile_associations" => Ok(AutomobileAssociations), + "automotive_parts_and_accessories_stores" => Ok(AutomotivePartsAndAccessoriesStores), + "automotive_tire_stores" => Ok(AutomotiveTireStores), + "bail_and_bond_payments" => Ok(BailAndBondPayments), + "bakeries" => Ok(Bakeries), + "bands_orchestras" => Ok(BandsOrchestras), + "barber_and_beauty_shops" => Ok(BarberAndBeautyShops), + "betting_casino_gambling" => Ok(BettingCasinoGambling), + "bicycle_shops" => Ok(BicycleShops), + "billiard_pool_establishments" => Ok(BilliardPoolEstablishments), + "boat_dealers" => Ok(BoatDealers), + "boat_rentals_and_leases" => Ok(BoatRentalsAndLeases), + "book_stores" => Ok(BookStores), + "books_periodicals_and_newspapers" => Ok(BooksPeriodicalsAndNewspapers), + "bowling_alleys" => Ok(BowlingAlleys), + "bus_lines" => Ok(BusLines), + "business_secretarial_schools" => Ok(BusinessSecretarialSchools), + "buying_shopping_services" => Ok(BuyingShoppingServices), + "cable_satellite_and_other_pay_television_and_radio" => { + Ok(CableSatelliteAndOtherPayTelevisionAndRadio) + } + "camera_and_photographic_supply_stores" => Ok(CameraAndPhotographicSupplyStores), + "candy_nut_and_confectionery_stores" => Ok(CandyNutAndConfectioneryStores), + "car_and_truck_dealers_new_used" => Ok(CarAndTruckDealersNewUsed), + "car_and_truck_dealers_used_only" => Ok(CarAndTruckDealersUsedOnly), + "car_rental_agencies" => Ok(CarRentalAgencies), + "car_washes" => Ok(CarWashes), + "carpentry_services" => Ok(CarpentryServices), + "carpet_upholstery_cleaning" => Ok(CarpetUpholsteryCleaning), + "caterers" => Ok(Caterers), + "charitable_and_social_service_organizations_fundraising" => { + Ok(CharitableAndSocialServiceOrganizationsFundraising) + } + "chemicals_and_allied_products" => Ok(ChemicalsAndAlliedProducts), + "child_care_services" => Ok(ChildCareServices), + "childrens_and_infants_wear_stores" => Ok(ChildrensAndInfantsWearStores), + "chiropodists_podiatrists" => Ok(ChiropodistsPodiatrists), + "chiropractors" => Ok(Chiropractors), + "cigar_stores_and_stands" => Ok(CigarStoresAndStands), + "civic_social_fraternal_associations" => Ok(CivicSocialFraternalAssociations), + "cleaning_and_maintenance" => Ok(CleaningAndMaintenance), + "clothing_rental" => Ok(ClothingRental), + "colleges_universities" => Ok(CollegesUniversities), + "commercial_equipment" => Ok(CommercialEquipment), + "commercial_footwear" => Ok(CommercialFootwear), + "commercial_photography_art_and_graphics" => Ok(CommercialPhotographyArtAndGraphics), + "commuter_transport_and_ferries" => Ok(CommuterTransportAndFerries), + "computer_network_services" => Ok(ComputerNetworkServices), + "computer_programming" => Ok(ComputerProgramming), + "computer_repair" => Ok(ComputerRepair), + "computer_software_stores" => Ok(ComputerSoftwareStores), + "computers_peripherals_and_software" => Ok(ComputersPeripheralsAndSoftware), + "concrete_work_services" => Ok(ConcreteWorkServices), + "construction_materials" => Ok(ConstructionMaterials), + "consulting_public_relations" => Ok(ConsultingPublicRelations), + "correspondence_schools" => Ok(CorrespondenceSchools), + "cosmetic_stores" => Ok(CosmeticStores), + "counseling_services" => Ok(CounselingServices), + "country_clubs" => Ok(CountryClubs), + "courier_services" => Ok(CourierServices), + "court_costs" => Ok(CourtCosts), + "credit_reporting_agencies" => Ok(CreditReportingAgencies), + "cruise_lines" => Ok(CruiseLines), + "dairy_products_stores" => Ok(DairyProductsStores), + "dance_hall_studios_schools" => Ok(DanceHallStudiosSchools), + "dating_escort_services" => Ok(DatingEscortServices), + "dentists_orthodontists" => Ok(DentistsOrthodontists), + "department_stores" => Ok(DepartmentStores), + "detective_agencies" => Ok(DetectiveAgencies), + "digital_goods_applications" => Ok(DigitalGoodsApplications), + "digital_goods_games" => Ok(DigitalGoodsGames), + "digital_goods_large_volume" => Ok(DigitalGoodsLargeVolume), + "digital_goods_media" => Ok(DigitalGoodsMedia), + "direct_marketing_catalog_merchant" => Ok(DirectMarketingCatalogMerchant), + "direct_marketing_combination_catalog_and_retail_merchant" => { + Ok(DirectMarketingCombinationCatalogAndRetailMerchant) + } + "direct_marketing_inbound_telemarketing" => Ok(DirectMarketingInboundTelemarketing), + "direct_marketing_insurance_services" => Ok(DirectMarketingInsuranceServices), + "direct_marketing_other" => Ok(DirectMarketingOther), + "direct_marketing_outbound_telemarketing" => Ok(DirectMarketingOutboundTelemarketing), + "direct_marketing_subscription" => Ok(DirectMarketingSubscription), + "direct_marketing_travel" => Ok(DirectMarketingTravel), + "discount_stores" => Ok(DiscountStores), + "doctors" => Ok(Doctors), + "door_to_door_sales" => Ok(DoorToDoorSales), + "drapery_window_covering_and_upholstery_stores" => { + Ok(DraperyWindowCoveringAndUpholsteryStores) + } + "drinking_places" => Ok(DrinkingPlaces), + "drug_stores_and_pharmacies" => Ok(DrugStoresAndPharmacies), + "drugs_drug_proprietaries_and_druggist_sundries" => { + Ok(DrugsDrugProprietariesAndDruggistSundries) + } + "dry_cleaners" => Ok(DryCleaners), + "durable_goods" => Ok(DurableGoods), + "duty_free_stores" => Ok(DutyFreeStores), + "eating_places_restaurants" => Ok(EatingPlacesRestaurants), + "educational_services" => Ok(EducationalServices), + "electric_razor_stores" => Ok(ElectricRazorStores), + "electric_vehicle_charging" => Ok(ElectricVehicleCharging), + "electrical_parts_and_equipment" => Ok(ElectricalPartsAndEquipment), + "electrical_services" => Ok(ElectricalServices), + "electronics_repair_shops" => Ok(ElectronicsRepairShops), + "electronics_stores" => Ok(ElectronicsStores), + "elementary_secondary_schools" => Ok(ElementarySecondarySchools), + "emergency_services_gcas_visa_use_only" => Ok(EmergencyServicesGcasVisaUseOnly), + "employment_temp_agencies" => Ok(EmploymentTempAgencies), + "equipment_rental" => Ok(EquipmentRental), + "exterminating_services" => Ok(ExterminatingServices), + "family_clothing_stores" => Ok(FamilyClothingStores), + "fast_food_restaurants" => Ok(FastFoodRestaurants), + "financial_institutions" => Ok(FinancialInstitutions), + "fines_government_administrative_entities" => Ok(FinesGovernmentAdministrativeEntities), + "fireplace_fireplace_screens_and_accessories_stores" => { + Ok(FireplaceFireplaceScreensAndAccessoriesStores) + } + "floor_covering_stores" => Ok(FloorCoveringStores), + "florists" => Ok(Florists), + "florists_supplies_nursery_stock_and_flowers" => { + Ok(FloristsSuppliesNurseryStockAndFlowers) + } + "freezer_and_locker_meat_provisioners" => Ok(FreezerAndLockerMeatProvisioners), + "fuel_dealers_non_automotive" => Ok(FuelDealersNonAutomotive), + "funeral_services_crematories" => Ok(FuneralServicesCrematories), + "furniture_home_furnishings_and_equipment_stores_except_appliances" => { + Ok(FurnitureHomeFurnishingsAndEquipmentStoresExceptAppliances) + } + "furniture_repair_refinishing" => Ok(FurnitureRepairRefinishing), + "furriers_and_fur_shops" => Ok(FurriersAndFurShops), + "general_services" => Ok(GeneralServices), + "gift_card_novelty_and_souvenir_shops" => Ok(GiftCardNoveltyAndSouvenirShops), + "glass_paint_and_wallpaper_stores" => Ok(GlassPaintAndWallpaperStores), + "glassware_crystal_stores" => Ok(GlasswareCrystalStores), + "golf_courses_public" => Ok(GolfCoursesPublic), + "government_licensed_horse_dog_racing_us_region_only" => { + Ok(GovernmentLicensedHorseDogRacingUsRegionOnly) + } + "government_licensed_online_casions_online_gambling_us_region_only" => { + Ok(GovernmentLicensedOnlineCasionsOnlineGamblingUsRegionOnly) + } + "government_owned_lotteries_non_us_region" => Ok(GovernmentOwnedLotteriesNonUsRegion), + "government_owned_lotteries_us_region_only" => Ok(GovernmentOwnedLotteriesUsRegionOnly), + "government_services" => Ok(GovernmentServices), + "grocery_stores_supermarkets" => Ok(GroceryStoresSupermarkets), + "hardware_equipment_and_supplies" => Ok(HardwareEquipmentAndSupplies), + "hardware_stores" => Ok(HardwareStores), + "health_and_beauty_spas" => Ok(HealthAndBeautySpas), + "hearing_aids_sales_and_supplies" => Ok(HearingAidsSalesAndSupplies), + "heating_plumbing_a_c" => Ok(HeatingPlumbingAC), + "hobby_toy_and_game_shops" => Ok(HobbyToyAndGameShops), + "home_supply_warehouse_stores" => Ok(HomeSupplyWarehouseStores), + "hospitals" => Ok(Hospitals), + "hotels_motels_and_resorts" => Ok(HotelsMotelsAndResorts), + "household_appliance_stores" => Ok(HouseholdApplianceStores), + "industrial_supplies" => Ok(IndustrialSupplies), + "information_retrieval_services" => Ok(InformationRetrievalServices), + "insurance_default" => Ok(InsuranceDefault), + "insurance_underwriting_premiums" => Ok(InsuranceUnderwritingPremiums), + "intra_company_purchases" => Ok(IntraCompanyPurchases), + "jewelry_stores_watches_clocks_and_silverware_stores" => { + Ok(JewelryStoresWatchesClocksAndSilverwareStores) + } + "landscaping_services" => Ok(LandscapingServices), + "laundries" => Ok(Laundries), + "laundry_cleaning_services" => Ok(LaundryCleaningServices), + "legal_services_attorneys" => Ok(LegalServicesAttorneys), + "luggage_and_leather_goods_stores" => Ok(LuggageAndLeatherGoodsStores), + "lumber_building_materials_stores" => Ok(LumberBuildingMaterialsStores), + "manual_cash_disburse" => Ok(ManualCashDisburse), + "marinas_service_and_supplies" => Ok(MarinasServiceAndSupplies), + "marketplaces" => Ok(Marketplaces), + "masonry_stonework_and_plaster" => Ok(MasonryStoneworkAndPlaster), + "massage_parlors" => Ok(MassageParlors), + "medical_and_dental_labs" => Ok(MedicalAndDentalLabs), + "medical_dental_ophthalmic_and_hospital_equipment_and_supplies" => { + Ok(MedicalDentalOphthalmicAndHospitalEquipmentAndSupplies) + } + "medical_services" => Ok(MedicalServices), + "membership_organizations" => Ok(MembershipOrganizations), + "mens_and_boys_clothing_and_accessories_stores" => { + Ok(MensAndBoysClothingAndAccessoriesStores) + } + "mens_womens_clothing_stores" => Ok(MensWomensClothingStores), + "metal_service_centers" => Ok(MetalServiceCenters), + "miscellaneous" => Ok(Miscellaneous), + "miscellaneous_apparel_and_accessory_shops" => { + Ok(MiscellaneousApparelAndAccessoryShops) + } + "miscellaneous_auto_dealers" => Ok(MiscellaneousAutoDealers), + "miscellaneous_business_services" => Ok(MiscellaneousBusinessServices), + "miscellaneous_food_stores" => Ok(MiscellaneousFoodStores), + "miscellaneous_general_merchandise" => Ok(MiscellaneousGeneralMerchandise), + "miscellaneous_general_services" => Ok(MiscellaneousGeneralServices), + "miscellaneous_home_furnishing_specialty_stores" => { + Ok(MiscellaneousHomeFurnishingSpecialtyStores) + } + "miscellaneous_publishing_and_printing" => Ok(MiscellaneousPublishingAndPrinting), + "miscellaneous_recreation_services" => Ok(MiscellaneousRecreationServices), + "miscellaneous_repair_shops" => Ok(MiscellaneousRepairShops), + "miscellaneous_specialty_retail" => Ok(MiscellaneousSpecialtyRetail), + "mobile_home_dealers" => Ok(MobileHomeDealers), + "motion_picture_theaters" => Ok(MotionPictureTheaters), + "motor_freight_carriers_and_trucking" => Ok(MotorFreightCarriersAndTrucking), + "motor_homes_dealers" => Ok(MotorHomesDealers), + "motor_vehicle_supplies_and_new_parts" => Ok(MotorVehicleSuppliesAndNewParts), + "motorcycle_shops_and_dealers" => Ok(MotorcycleShopsAndDealers), + "motorcycle_shops_dealers" => Ok(MotorcycleShopsDealers), + "music_stores_musical_instruments_pianos_and_sheet_music" => { + Ok(MusicStoresMusicalInstrumentsPianosAndSheetMusic) + } + "news_dealers_and_newsstands" => Ok(NewsDealersAndNewsstands), + "non_fi_money_orders" => Ok(NonFiMoneyOrders), + "non_fi_stored_value_card_purchase_load" => Ok(NonFiStoredValueCardPurchaseLoad), + "nondurable_goods" => Ok(NondurableGoods), + "nurseries_lawn_and_garden_supply_stores" => Ok(NurseriesLawnAndGardenSupplyStores), + "nursing_personal_care" => Ok(NursingPersonalCare), + "office_and_commercial_furniture" => Ok(OfficeAndCommercialFurniture), + "opticians_eyeglasses" => Ok(OpticiansEyeglasses), + "optometrists_ophthalmologist" => Ok(OptometristsOphthalmologist), + "orthopedic_goods_prosthetic_devices" => Ok(OrthopedicGoodsProstheticDevices), + "osteopaths" => Ok(Osteopaths), + "package_stores_beer_wine_and_liquor" => Ok(PackageStoresBeerWineAndLiquor), + "paints_varnishes_and_supplies" => Ok(PaintsVarnishesAndSupplies), + "parking_lots_garages" => Ok(ParkingLotsGarages), + "passenger_railways" => Ok(PassengerRailways), + "pawn_shops" => Ok(PawnShops), + "pet_shops_pet_food_and_supplies" => Ok(PetShopsPetFoodAndSupplies), + "petroleum_and_petroleum_products" => Ok(PetroleumAndPetroleumProducts), + "photo_developing" => Ok(PhotoDeveloping), + "photographic_photocopy_microfilm_equipment_and_supplies" => { + Ok(PhotographicPhotocopyMicrofilmEquipmentAndSupplies) + } + "photographic_studios" => Ok(PhotographicStudios), + "picture_video_production" => Ok(PictureVideoProduction), + "piece_goods_notions_and_other_dry_goods" => Ok(PieceGoodsNotionsAndOtherDryGoods), + "plumbing_heating_equipment_and_supplies" => Ok(PlumbingHeatingEquipmentAndSupplies), + "political_organizations" => Ok(PoliticalOrganizations), + "postal_services_government_only" => Ok(PostalServicesGovernmentOnly), + "precious_stones_and_metals_watches_and_jewelry" => { + Ok(PreciousStonesAndMetalsWatchesAndJewelry) + } + "professional_services" => Ok(ProfessionalServices), + "public_warehousing_and_storage" => Ok(PublicWarehousingAndStorage), + "quick_copy_repro_and_blueprint" => Ok(QuickCopyReproAndBlueprint), + "railroads" => Ok(Railroads), + "real_estate_agents_and_managers_rentals" => Ok(RealEstateAgentsAndManagersRentals), + "record_stores" => Ok(RecordStores), + "recreational_vehicle_rentals" => Ok(RecreationalVehicleRentals), + "religious_goods_stores" => Ok(ReligiousGoodsStores), + "religious_organizations" => Ok(ReligiousOrganizations), + "roofing_siding_sheet_metal" => Ok(RoofingSidingSheetMetal), + "secretarial_support_services" => Ok(SecretarialSupportServices), + "security_brokers_dealers" => Ok(SecurityBrokersDealers), + "service_stations" => Ok(ServiceStations), + "sewing_needlework_fabric_and_piece_goods_stores" => { + Ok(SewingNeedleworkFabricAndPieceGoodsStores) + } + "shoe_repair_hat_cleaning" => Ok(ShoeRepairHatCleaning), + "shoe_stores" => Ok(ShoeStores), + "small_appliance_repair" => Ok(SmallApplianceRepair), + "snowmobile_dealers" => Ok(SnowmobileDealers), + "special_trade_services" => Ok(SpecialTradeServices), + "specialty_cleaning" => Ok(SpecialtyCleaning), + "sporting_goods_stores" => Ok(SportingGoodsStores), + "sporting_recreation_camps" => Ok(SportingRecreationCamps), + "sports_and_riding_apparel_stores" => Ok(SportsAndRidingApparelStores), + "sports_clubs_fields" => Ok(SportsClubsFields), + "stamp_and_coin_stores" => Ok(StampAndCoinStores), + "stationary_office_supplies_printing_and_writing_paper" => { + Ok(StationaryOfficeSuppliesPrintingAndWritingPaper) + } + "stationery_stores_office_and_school_supply_stores" => { + Ok(StationeryStoresOfficeAndSchoolSupplyStores) + } + "swimming_pools_sales" => Ok(SwimmingPoolsSales), + "t_ui_travel_germany" => Ok(TUiTravelGermany), + "tailors_alterations" => Ok(TailorsAlterations), + "tax_payments_government_agencies" => Ok(TaxPaymentsGovernmentAgencies), + "tax_preparation_services" => Ok(TaxPreparationServices), + "taxicabs_limousines" => Ok(TaxicabsLimousines), + "telecommunication_equipment_and_telephone_sales" => { + Ok(TelecommunicationEquipmentAndTelephoneSales) + } + "telecommunication_services" => Ok(TelecommunicationServices), + "telegraph_services" => Ok(TelegraphServices), + "tent_and_awning_shops" => Ok(TentAndAwningShops), + "testing_laboratories" => Ok(TestingLaboratories), + "theatrical_ticket_agencies" => Ok(TheatricalTicketAgencies), + "timeshares" => Ok(Timeshares), + "tire_retreading_and_repair" => Ok(TireRetreadingAndRepair), + "tolls_bridge_fees" => Ok(TollsBridgeFees), + "tourist_attractions_and_exhibits" => Ok(TouristAttractionsAndExhibits), + "towing_services" => Ok(TowingServices), + "trailer_parks_campgrounds" => Ok(TrailerParksCampgrounds), + "transportation_services" => Ok(TransportationServices), + "travel_agencies_tour_operators" => Ok(TravelAgenciesTourOperators), + "truck_stop_iteration" => Ok(TruckStopIteration), + "truck_utility_trailer_rentals" => Ok(TruckUtilityTrailerRentals), + "typesetting_plate_making_and_related_services" => { + Ok(TypesettingPlateMakingAndRelatedServices) + } + "typewriter_stores" => Ok(TypewriterStores), + "u_s_federal_government_agencies_or_departments" => { + Ok(USFederalGovernmentAgenciesOrDepartments) + } + "uniforms_commercial_clothing" => Ok(UniformsCommercialClothing), + "used_merchandise_and_secondhand_stores" => Ok(UsedMerchandiseAndSecondhandStores), + "utilities" => Ok(Utilities), + "variety_stores" => Ok(VarietyStores), + "veterinary_services" => Ok(VeterinaryServices), + "video_amusement_game_supplies" => Ok(VideoAmusementGameSupplies), + "video_game_arcades" => Ok(VideoGameArcades), + "video_tape_rental_stores" => Ok(VideoTapeRentalStores), + "vocational_trade_schools" => Ok(VocationalTradeSchools), + "watch_jewelry_repair" => Ok(WatchJewelryRepair), + "welding_repair" => Ok(WeldingRepair), + "wholesale_clubs" => Ok(WholesaleClubs), + "wig_and_toupee_stores" => Ok(WigAndToupeeStores), + "wires_money_orders" => Ok(WiresMoneyOrders), + "womens_accessory_and_specialty_shops" => Ok(WomensAccessoryAndSpecialtyShops), + "womens_ready_to_wear_stores" => Ok(WomensReadyToWearStores), + "wrecking_and_salvage_yards" => Ok(WreckingAndSalvageYards), + _ => Err(()), + } + } +} +impl std::fmt::Display for IssuingCardAuthorizationControlsBlockedCategories { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for IssuingCardAuthorizationControlsBlockedCategories { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for IssuingCardAuthorizationControlsBlockedCategories { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for IssuingCardAuthorizationControlsBlockedCategories { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Ok(Self::from_str(&s).unwrap_or(IssuingCardAuthorizationControlsBlockedCategories::Unknown)) + } +} diff --git a/generated/stripe_shared/src/issuing_card_google_pay.rs b/generated/stripe_shared/src/issuing_card_google_pay.rs new file mode 100644 index 000000000..0b8418878 --- /dev/null +++ b/generated/stripe_shared/src/issuing_card_google_pay.rs @@ -0,0 +1,65 @@ +#[derive(Copy, Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct IssuingCardGooglePay { + /// Google Pay Eligibility + pub eligible: bool, + /// Reason the card is ineligible for Google Pay + pub ineligible_reason: Option, +} +/// Reason the card is ineligible for Google Pay +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum IssuingCardGooglePayIneligibleReason { + MissingAgreement, + MissingCardholderContact, + UnsupportedRegion, +} +impl IssuingCardGooglePayIneligibleReason { + pub fn as_str(self) -> &'static str { + use IssuingCardGooglePayIneligibleReason::*; + match self { + MissingAgreement => "missing_agreement", + MissingCardholderContact => "missing_cardholder_contact", + UnsupportedRegion => "unsupported_region", + } + } +} + +impl std::str::FromStr for IssuingCardGooglePayIneligibleReason { + type Err = (); + fn from_str(s: &str) -> Result { + use IssuingCardGooglePayIneligibleReason::*; + match s { + "missing_agreement" => Ok(MissingAgreement), + "missing_cardholder_contact" => Ok(MissingCardholderContact), + "unsupported_region" => Ok(UnsupportedRegion), + _ => Err(()), + } + } +} +impl std::fmt::Display for IssuingCardGooglePayIneligibleReason { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for IssuingCardGooglePayIneligibleReason { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for IssuingCardGooglePayIneligibleReason { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for IssuingCardGooglePayIneligibleReason { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| { + serde::de::Error::custom("Unknown value for IssuingCardGooglePayIneligibleReason") + }) + } +} diff --git a/generated/stripe_shared/src/issuing_card_shipping.rs b/generated/stripe_shared/src/issuing_card_shipping.rs new file mode 100644 index 000000000..2abc86aad --- /dev/null +++ b/generated/stripe_shared/src/issuing_card_shipping.rs @@ -0,0 +1,269 @@ +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct IssuingCardShipping { + pub address: stripe_shared::Address, + /// The delivery company that shipped a card. + pub carrier: Option, + /// Additional information that may be required for clearing customs. + pub customs: Option, + /// A unix timestamp representing a best estimate of when the card will be delivered. + pub eta: Option, + /// Recipient name. + pub name: String, + /// The phone number of the receiver of the shipment. + /// Our courier partners will use this number to contact you in the event of card delivery issues. + /// For individual shipments to the EU/UK, if this field is empty, we will provide them with the phone number provided when the cardholder was initially created. + pub phone_number: Option, + /// Whether a signature is required for card delivery. + /// This feature is only supported for US users. + /// Standard shipping service does not support signature on delivery. + /// The default value for standard shipping service is false and for express and priority services is true. + pub require_signature: Option, + /// Shipment service, such as `standard` or `express`. + pub service: IssuingCardShippingService, + /// The delivery status of the card. + pub status: Option, + /// A tracking number for a card shipment. + pub tracking_number: Option, + /// A link to the shipping carrier's site where you can view detailed information about a card shipment. + pub tracking_url: Option, + /// Packaging options. + #[serde(rename = "type")] + pub type_: IssuingCardShippingType, +} +/// The delivery company that shipped a card. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum IssuingCardShippingCarrier { + Dhl, + Fedex, + RoyalMail, + Usps, +} +impl IssuingCardShippingCarrier { + pub fn as_str(self) -> &'static str { + use IssuingCardShippingCarrier::*; + match self { + Dhl => "dhl", + Fedex => "fedex", + RoyalMail => "royal_mail", + Usps => "usps", + } + } +} + +impl std::str::FromStr for IssuingCardShippingCarrier { + type Err = (); + fn from_str(s: &str) -> Result { + use IssuingCardShippingCarrier::*; + match s { + "dhl" => Ok(Dhl), + "fedex" => Ok(Fedex), + "royal_mail" => Ok(RoyalMail), + "usps" => Ok(Usps), + _ => Err(()), + } + } +} +impl std::fmt::Display for IssuingCardShippingCarrier { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for IssuingCardShippingCarrier { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for IssuingCardShippingCarrier { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for IssuingCardShippingCarrier { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s) + .map_err(|_| serde::de::Error::custom("Unknown value for IssuingCardShippingCarrier")) + } +} +/// Shipment service, such as `standard` or `express`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum IssuingCardShippingService { + Express, + Priority, + Standard, +} +impl IssuingCardShippingService { + pub fn as_str(self) -> &'static str { + use IssuingCardShippingService::*; + match self { + Express => "express", + Priority => "priority", + Standard => "standard", + } + } +} + +impl std::str::FromStr for IssuingCardShippingService { + type Err = (); + fn from_str(s: &str) -> Result { + use IssuingCardShippingService::*; + match s { + "express" => Ok(Express), + "priority" => Ok(Priority), + "standard" => Ok(Standard), + _ => Err(()), + } + } +} +impl std::fmt::Display for IssuingCardShippingService { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for IssuingCardShippingService { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for IssuingCardShippingService { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for IssuingCardShippingService { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s) + .map_err(|_| serde::de::Error::custom("Unknown value for IssuingCardShippingService")) + } +} +/// The delivery status of the card. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum IssuingCardShippingStatus { + Canceled, + Delivered, + Failure, + Pending, + Returned, + Shipped, +} +impl IssuingCardShippingStatus { + pub fn as_str(self) -> &'static str { + use IssuingCardShippingStatus::*; + match self { + Canceled => "canceled", + Delivered => "delivered", + Failure => "failure", + Pending => "pending", + Returned => "returned", + Shipped => "shipped", + } + } +} + +impl std::str::FromStr for IssuingCardShippingStatus { + type Err = (); + fn from_str(s: &str) -> Result { + use IssuingCardShippingStatus::*; + match s { + "canceled" => Ok(Canceled), + "delivered" => Ok(Delivered), + "failure" => Ok(Failure), + "pending" => Ok(Pending), + "returned" => Ok(Returned), + "shipped" => Ok(Shipped), + _ => Err(()), + } + } +} +impl std::fmt::Display for IssuingCardShippingStatus { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for IssuingCardShippingStatus { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for IssuingCardShippingStatus { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for IssuingCardShippingStatus { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s) + .map_err(|_| serde::de::Error::custom("Unknown value for IssuingCardShippingStatus")) + } +} +/// Packaging options. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum IssuingCardShippingType { + Bulk, + Individual, +} +impl IssuingCardShippingType { + pub fn as_str(self) -> &'static str { + use IssuingCardShippingType::*; + match self { + Bulk => "bulk", + Individual => "individual", + } + } +} + +impl std::str::FromStr for IssuingCardShippingType { + type Err = (); + fn from_str(s: &str) -> Result { + use IssuingCardShippingType::*; + match s { + "bulk" => Ok(Bulk), + "individual" => Ok(Individual), + _ => Err(()), + } + } +} +impl std::fmt::Display for IssuingCardShippingType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for IssuingCardShippingType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for IssuingCardShippingType { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for IssuingCardShippingType { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s) + .map_err(|_| serde::de::Error::custom("Unknown value for IssuingCardShippingType")) + } +} diff --git a/generated/stripe_shared/src/issuing_card_shipping_customs.rs b/generated/stripe_shared/src/issuing_card_shipping_customs.rs new file mode 100644 index 000000000..71c6bc68e --- /dev/null +++ b/generated/stripe_shared/src/issuing_card_shipping_customs.rs @@ -0,0 +1,6 @@ +#[derive(Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct IssuingCardShippingCustoms { + /// A registration number used for customs in Europe. + /// See [](https://www.gov.uk/eori) for the UK and [](https://ec.europa.eu/taxation_customs/business/customs-procedures-import-and-export/customs-procedures/economic-operators-registration-and-identification-number-eori_en) for the EU. + pub eori_number: Option, +} diff --git a/generated/stripe_shared/src/issuing_card_spending_limit.rs b/generated/stripe_shared/src/issuing_card_spending_limit.rs new file mode 100644 index 000000000..a92f4b746 --- /dev/null +++ b/generated/stripe_shared/src/issuing_card_spending_limit.rs @@ -0,0 +1,1107 @@ +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct IssuingCardSpendingLimit { + /// Maximum amount allowed to spend per interval. + /// This amount is in the card's currency and in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal). + pub amount: i64, + /// Array of strings containing [categories](https://stripe.com/docs/api#issuing_authorization_object-merchant_data-category) this limit applies to. + /// Omitting this field will apply the limit to all categories. + pub categories: Option>, + /// Interval (or event) to which the amount applies. + pub interval: IssuingCardSpendingLimitInterval, +} +/// Array of strings containing [categories](https://stripe.com/docs/api#issuing_authorization_object-merchant_data-category) this limit applies to. +/// Omitting this field will apply the limit to all categories. +#[derive(Copy, Clone, Eq, PartialEq)] +#[non_exhaustive] +pub enum IssuingCardSpendingLimitCategories { + AcRefrigerationRepair, + AccountingBookkeepingServices, + AdvertisingServices, + AgriculturalCooperative, + AirlinesAirCarriers, + AirportsFlyingFields, + AmbulanceServices, + AmusementParksCarnivals, + AntiqueReproductions, + AntiqueShops, + Aquariums, + ArchitecturalSurveyingServices, + ArtDealersAndGalleries, + ArtistsSupplyAndCraftShops, + AutoAndHomeSupplyStores, + AutoBodyRepairShops, + AutoPaintShops, + AutoServiceShops, + AutomatedCashDisburse, + AutomatedFuelDispensers, + AutomobileAssociations, + AutomotivePartsAndAccessoriesStores, + AutomotiveTireStores, + BailAndBondPayments, + Bakeries, + BandsOrchestras, + BarberAndBeautyShops, + BettingCasinoGambling, + BicycleShops, + BilliardPoolEstablishments, + BoatDealers, + BoatRentalsAndLeases, + BookStores, + BooksPeriodicalsAndNewspapers, + BowlingAlleys, + BusLines, + BusinessSecretarialSchools, + BuyingShoppingServices, + CableSatelliteAndOtherPayTelevisionAndRadio, + CameraAndPhotographicSupplyStores, + CandyNutAndConfectioneryStores, + CarAndTruckDealersNewUsed, + CarAndTruckDealersUsedOnly, + CarRentalAgencies, + CarWashes, + CarpentryServices, + CarpetUpholsteryCleaning, + Caterers, + CharitableAndSocialServiceOrganizationsFundraising, + ChemicalsAndAlliedProducts, + ChildCareServices, + ChildrensAndInfantsWearStores, + ChiropodistsPodiatrists, + Chiropractors, + CigarStoresAndStands, + CivicSocialFraternalAssociations, + CleaningAndMaintenance, + ClothingRental, + CollegesUniversities, + CommercialEquipment, + CommercialFootwear, + CommercialPhotographyArtAndGraphics, + CommuterTransportAndFerries, + ComputerNetworkServices, + ComputerProgramming, + ComputerRepair, + ComputerSoftwareStores, + ComputersPeripheralsAndSoftware, + ConcreteWorkServices, + ConstructionMaterials, + ConsultingPublicRelations, + CorrespondenceSchools, + CosmeticStores, + CounselingServices, + CountryClubs, + CourierServices, + CourtCosts, + CreditReportingAgencies, + CruiseLines, + DairyProductsStores, + DanceHallStudiosSchools, + DatingEscortServices, + DentistsOrthodontists, + DepartmentStores, + DetectiveAgencies, + DigitalGoodsApplications, + DigitalGoodsGames, + DigitalGoodsLargeVolume, + DigitalGoodsMedia, + DirectMarketingCatalogMerchant, + DirectMarketingCombinationCatalogAndRetailMerchant, + DirectMarketingInboundTelemarketing, + DirectMarketingInsuranceServices, + DirectMarketingOther, + DirectMarketingOutboundTelemarketing, + DirectMarketingSubscription, + DirectMarketingTravel, + DiscountStores, + Doctors, + DoorToDoorSales, + DraperyWindowCoveringAndUpholsteryStores, + DrinkingPlaces, + DrugStoresAndPharmacies, + DrugsDrugProprietariesAndDruggistSundries, + DryCleaners, + DurableGoods, + DutyFreeStores, + EatingPlacesRestaurants, + EducationalServices, + ElectricRazorStores, + ElectricVehicleCharging, + ElectricalPartsAndEquipment, + ElectricalServices, + ElectronicsRepairShops, + ElectronicsStores, + ElementarySecondarySchools, + EmergencyServicesGcasVisaUseOnly, + EmploymentTempAgencies, + EquipmentRental, + ExterminatingServices, + FamilyClothingStores, + FastFoodRestaurants, + FinancialInstitutions, + FinesGovernmentAdministrativeEntities, + FireplaceFireplaceScreensAndAccessoriesStores, + FloorCoveringStores, + Florists, + FloristsSuppliesNurseryStockAndFlowers, + FreezerAndLockerMeatProvisioners, + FuelDealersNonAutomotive, + FuneralServicesCrematories, + FurnitureHomeFurnishingsAndEquipmentStoresExceptAppliances, + FurnitureRepairRefinishing, + FurriersAndFurShops, + GeneralServices, + GiftCardNoveltyAndSouvenirShops, + GlassPaintAndWallpaperStores, + GlasswareCrystalStores, + GolfCoursesPublic, + GovernmentLicensedHorseDogRacingUsRegionOnly, + GovernmentLicensedOnlineCasionsOnlineGamblingUsRegionOnly, + GovernmentOwnedLotteriesNonUsRegion, + GovernmentOwnedLotteriesUsRegionOnly, + GovernmentServices, + GroceryStoresSupermarkets, + HardwareEquipmentAndSupplies, + HardwareStores, + HealthAndBeautySpas, + HearingAidsSalesAndSupplies, + HeatingPlumbingAC, + HobbyToyAndGameShops, + HomeSupplyWarehouseStores, + Hospitals, + HotelsMotelsAndResorts, + HouseholdApplianceStores, + IndustrialSupplies, + InformationRetrievalServices, + InsuranceDefault, + InsuranceUnderwritingPremiums, + IntraCompanyPurchases, + JewelryStoresWatchesClocksAndSilverwareStores, + LandscapingServices, + Laundries, + LaundryCleaningServices, + LegalServicesAttorneys, + LuggageAndLeatherGoodsStores, + LumberBuildingMaterialsStores, + ManualCashDisburse, + MarinasServiceAndSupplies, + Marketplaces, + MasonryStoneworkAndPlaster, + MassageParlors, + MedicalAndDentalLabs, + MedicalDentalOphthalmicAndHospitalEquipmentAndSupplies, + MedicalServices, + MembershipOrganizations, + MensAndBoysClothingAndAccessoriesStores, + MensWomensClothingStores, + MetalServiceCenters, + Miscellaneous, + MiscellaneousApparelAndAccessoryShops, + MiscellaneousAutoDealers, + MiscellaneousBusinessServices, + MiscellaneousFoodStores, + MiscellaneousGeneralMerchandise, + MiscellaneousGeneralServices, + MiscellaneousHomeFurnishingSpecialtyStores, + MiscellaneousPublishingAndPrinting, + MiscellaneousRecreationServices, + MiscellaneousRepairShops, + MiscellaneousSpecialtyRetail, + MobileHomeDealers, + MotionPictureTheaters, + MotorFreightCarriersAndTrucking, + MotorHomesDealers, + MotorVehicleSuppliesAndNewParts, + MotorcycleShopsAndDealers, + MotorcycleShopsDealers, + MusicStoresMusicalInstrumentsPianosAndSheetMusic, + NewsDealersAndNewsstands, + NonFiMoneyOrders, + NonFiStoredValueCardPurchaseLoad, + NondurableGoods, + NurseriesLawnAndGardenSupplyStores, + NursingPersonalCare, + OfficeAndCommercialFurniture, + OpticiansEyeglasses, + OptometristsOphthalmologist, + OrthopedicGoodsProstheticDevices, + Osteopaths, + PackageStoresBeerWineAndLiquor, + PaintsVarnishesAndSupplies, + ParkingLotsGarages, + PassengerRailways, + PawnShops, + PetShopsPetFoodAndSupplies, + PetroleumAndPetroleumProducts, + PhotoDeveloping, + PhotographicPhotocopyMicrofilmEquipmentAndSupplies, + PhotographicStudios, + PictureVideoProduction, + PieceGoodsNotionsAndOtherDryGoods, + PlumbingHeatingEquipmentAndSupplies, + PoliticalOrganizations, + PostalServicesGovernmentOnly, + PreciousStonesAndMetalsWatchesAndJewelry, + ProfessionalServices, + PublicWarehousingAndStorage, + QuickCopyReproAndBlueprint, + Railroads, + RealEstateAgentsAndManagersRentals, + RecordStores, + RecreationalVehicleRentals, + ReligiousGoodsStores, + ReligiousOrganizations, + RoofingSidingSheetMetal, + SecretarialSupportServices, + SecurityBrokersDealers, + ServiceStations, + SewingNeedleworkFabricAndPieceGoodsStores, + ShoeRepairHatCleaning, + ShoeStores, + SmallApplianceRepair, + SnowmobileDealers, + SpecialTradeServices, + SpecialtyCleaning, + SportingGoodsStores, + SportingRecreationCamps, + SportsAndRidingApparelStores, + SportsClubsFields, + StampAndCoinStores, + StationaryOfficeSuppliesPrintingAndWritingPaper, + StationeryStoresOfficeAndSchoolSupplyStores, + SwimmingPoolsSales, + TUiTravelGermany, + TailorsAlterations, + TaxPaymentsGovernmentAgencies, + TaxPreparationServices, + TaxicabsLimousines, + TelecommunicationEquipmentAndTelephoneSales, + TelecommunicationServices, + TelegraphServices, + TentAndAwningShops, + TestingLaboratories, + TheatricalTicketAgencies, + Timeshares, + TireRetreadingAndRepair, + TollsBridgeFees, + TouristAttractionsAndExhibits, + TowingServices, + TrailerParksCampgrounds, + TransportationServices, + TravelAgenciesTourOperators, + TruckStopIteration, + TruckUtilityTrailerRentals, + TypesettingPlateMakingAndRelatedServices, + TypewriterStores, + USFederalGovernmentAgenciesOrDepartments, + UniformsCommercialClothing, + UsedMerchandiseAndSecondhandStores, + Utilities, + VarietyStores, + VeterinaryServices, + VideoAmusementGameSupplies, + VideoGameArcades, + VideoTapeRentalStores, + VocationalTradeSchools, + WatchJewelryRepair, + WeldingRepair, + WholesaleClubs, + WigAndToupeeStores, + WiresMoneyOrders, + WomensAccessoryAndSpecialtyShops, + WomensReadyToWearStores, + WreckingAndSalvageYards, + /// An unrecognized value from Stripe. Should not be used as a request parameter. + Unknown, +} +impl IssuingCardSpendingLimitCategories { + pub fn as_str(self) -> &'static str { + use IssuingCardSpendingLimitCategories::*; + match self { + AcRefrigerationRepair => "ac_refrigeration_repair", + AccountingBookkeepingServices => "accounting_bookkeeping_services", + AdvertisingServices => "advertising_services", + AgriculturalCooperative => "agricultural_cooperative", + AirlinesAirCarriers => "airlines_air_carriers", + AirportsFlyingFields => "airports_flying_fields", + AmbulanceServices => "ambulance_services", + AmusementParksCarnivals => "amusement_parks_carnivals", + AntiqueReproductions => "antique_reproductions", + AntiqueShops => "antique_shops", + Aquariums => "aquariums", + ArchitecturalSurveyingServices => "architectural_surveying_services", + ArtDealersAndGalleries => "art_dealers_and_galleries", + ArtistsSupplyAndCraftShops => "artists_supply_and_craft_shops", + AutoAndHomeSupplyStores => "auto_and_home_supply_stores", + AutoBodyRepairShops => "auto_body_repair_shops", + AutoPaintShops => "auto_paint_shops", + AutoServiceShops => "auto_service_shops", + AutomatedCashDisburse => "automated_cash_disburse", + AutomatedFuelDispensers => "automated_fuel_dispensers", + AutomobileAssociations => "automobile_associations", + AutomotivePartsAndAccessoriesStores => "automotive_parts_and_accessories_stores", + AutomotiveTireStores => "automotive_tire_stores", + BailAndBondPayments => "bail_and_bond_payments", + Bakeries => "bakeries", + BandsOrchestras => "bands_orchestras", + BarberAndBeautyShops => "barber_and_beauty_shops", + BettingCasinoGambling => "betting_casino_gambling", + BicycleShops => "bicycle_shops", + BilliardPoolEstablishments => "billiard_pool_establishments", + BoatDealers => "boat_dealers", + BoatRentalsAndLeases => "boat_rentals_and_leases", + BookStores => "book_stores", + BooksPeriodicalsAndNewspapers => "books_periodicals_and_newspapers", + BowlingAlleys => "bowling_alleys", + BusLines => "bus_lines", + BusinessSecretarialSchools => "business_secretarial_schools", + BuyingShoppingServices => "buying_shopping_services", + CableSatelliteAndOtherPayTelevisionAndRadio => { + "cable_satellite_and_other_pay_television_and_radio" + } + CameraAndPhotographicSupplyStores => "camera_and_photographic_supply_stores", + CandyNutAndConfectioneryStores => "candy_nut_and_confectionery_stores", + CarAndTruckDealersNewUsed => "car_and_truck_dealers_new_used", + CarAndTruckDealersUsedOnly => "car_and_truck_dealers_used_only", + CarRentalAgencies => "car_rental_agencies", + CarWashes => "car_washes", + CarpentryServices => "carpentry_services", + CarpetUpholsteryCleaning => "carpet_upholstery_cleaning", + Caterers => "caterers", + CharitableAndSocialServiceOrganizationsFundraising => { + "charitable_and_social_service_organizations_fundraising" + } + ChemicalsAndAlliedProducts => "chemicals_and_allied_products", + ChildCareServices => "child_care_services", + ChildrensAndInfantsWearStores => "childrens_and_infants_wear_stores", + ChiropodistsPodiatrists => "chiropodists_podiatrists", + Chiropractors => "chiropractors", + CigarStoresAndStands => "cigar_stores_and_stands", + CivicSocialFraternalAssociations => "civic_social_fraternal_associations", + CleaningAndMaintenance => "cleaning_and_maintenance", + ClothingRental => "clothing_rental", + CollegesUniversities => "colleges_universities", + CommercialEquipment => "commercial_equipment", + CommercialFootwear => "commercial_footwear", + CommercialPhotographyArtAndGraphics => "commercial_photography_art_and_graphics", + CommuterTransportAndFerries => "commuter_transport_and_ferries", + ComputerNetworkServices => "computer_network_services", + ComputerProgramming => "computer_programming", + ComputerRepair => "computer_repair", + ComputerSoftwareStores => "computer_software_stores", + ComputersPeripheralsAndSoftware => "computers_peripherals_and_software", + ConcreteWorkServices => "concrete_work_services", + ConstructionMaterials => "construction_materials", + ConsultingPublicRelations => "consulting_public_relations", + CorrespondenceSchools => "correspondence_schools", + CosmeticStores => "cosmetic_stores", + CounselingServices => "counseling_services", + CountryClubs => "country_clubs", + CourierServices => "courier_services", + CourtCosts => "court_costs", + CreditReportingAgencies => "credit_reporting_agencies", + CruiseLines => "cruise_lines", + DairyProductsStores => "dairy_products_stores", + DanceHallStudiosSchools => "dance_hall_studios_schools", + DatingEscortServices => "dating_escort_services", + DentistsOrthodontists => "dentists_orthodontists", + DepartmentStores => "department_stores", + DetectiveAgencies => "detective_agencies", + DigitalGoodsApplications => "digital_goods_applications", + DigitalGoodsGames => "digital_goods_games", + DigitalGoodsLargeVolume => "digital_goods_large_volume", + DigitalGoodsMedia => "digital_goods_media", + DirectMarketingCatalogMerchant => "direct_marketing_catalog_merchant", + DirectMarketingCombinationCatalogAndRetailMerchant => { + "direct_marketing_combination_catalog_and_retail_merchant" + } + DirectMarketingInboundTelemarketing => "direct_marketing_inbound_telemarketing", + DirectMarketingInsuranceServices => "direct_marketing_insurance_services", + DirectMarketingOther => "direct_marketing_other", + DirectMarketingOutboundTelemarketing => "direct_marketing_outbound_telemarketing", + DirectMarketingSubscription => "direct_marketing_subscription", + DirectMarketingTravel => "direct_marketing_travel", + DiscountStores => "discount_stores", + Doctors => "doctors", + DoorToDoorSales => "door_to_door_sales", + DraperyWindowCoveringAndUpholsteryStores => { + "drapery_window_covering_and_upholstery_stores" + } + DrinkingPlaces => "drinking_places", + DrugStoresAndPharmacies => "drug_stores_and_pharmacies", + DrugsDrugProprietariesAndDruggistSundries => { + "drugs_drug_proprietaries_and_druggist_sundries" + } + DryCleaners => "dry_cleaners", + DurableGoods => "durable_goods", + DutyFreeStores => "duty_free_stores", + EatingPlacesRestaurants => "eating_places_restaurants", + EducationalServices => "educational_services", + ElectricRazorStores => "electric_razor_stores", + ElectricVehicleCharging => "electric_vehicle_charging", + ElectricalPartsAndEquipment => "electrical_parts_and_equipment", + ElectricalServices => "electrical_services", + ElectronicsRepairShops => "electronics_repair_shops", + ElectronicsStores => "electronics_stores", + ElementarySecondarySchools => "elementary_secondary_schools", + EmergencyServicesGcasVisaUseOnly => "emergency_services_gcas_visa_use_only", + EmploymentTempAgencies => "employment_temp_agencies", + EquipmentRental => "equipment_rental", + ExterminatingServices => "exterminating_services", + FamilyClothingStores => "family_clothing_stores", + FastFoodRestaurants => "fast_food_restaurants", + FinancialInstitutions => "financial_institutions", + FinesGovernmentAdministrativeEntities => "fines_government_administrative_entities", + FireplaceFireplaceScreensAndAccessoriesStores => { + "fireplace_fireplace_screens_and_accessories_stores" + } + FloorCoveringStores => "floor_covering_stores", + Florists => "florists", + FloristsSuppliesNurseryStockAndFlowers => "florists_supplies_nursery_stock_and_flowers", + FreezerAndLockerMeatProvisioners => "freezer_and_locker_meat_provisioners", + FuelDealersNonAutomotive => "fuel_dealers_non_automotive", + FuneralServicesCrematories => "funeral_services_crematories", + FurnitureHomeFurnishingsAndEquipmentStoresExceptAppliances => { + "furniture_home_furnishings_and_equipment_stores_except_appliances" + } + FurnitureRepairRefinishing => "furniture_repair_refinishing", + FurriersAndFurShops => "furriers_and_fur_shops", + GeneralServices => "general_services", + GiftCardNoveltyAndSouvenirShops => "gift_card_novelty_and_souvenir_shops", + GlassPaintAndWallpaperStores => "glass_paint_and_wallpaper_stores", + GlasswareCrystalStores => "glassware_crystal_stores", + GolfCoursesPublic => "golf_courses_public", + GovernmentLicensedHorseDogRacingUsRegionOnly => { + "government_licensed_horse_dog_racing_us_region_only" + } + GovernmentLicensedOnlineCasionsOnlineGamblingUsRegionOnly => { + "government_licensed_online_casions_online_gambling_us_region_only" + } + GovernmentOwnedLotteriesNonUsRegion => "government_owned_lotteries_non_us_region", + GovernmentOwnedLotteriesUsRegionOnly => "government_owned_lotteries_us_region_only", + GovernmentServices => "government_services", + GroceryStoresSupermarkets => "grocery_stores_supermarkets", + HardwareEquipmentAndSupplies => "hardware_equipment_and_supplies", + HardwareStores => "hardware_stores", + HealthAndBeautySpas => "health_and_beauty_spas", + HearingAidsSalesAndSupplies => "hearing_aids_sales_and_supplies", + HeatingPlumbingAC => "heating_plumbing_a_c", + HobbyToyAndGameShops => "hobby_toy_and_game_shops", + HomeSupplyWarehouseStores => "home_supply_warehouse_stores", + Hospitals => "hospitals", + HotelsMotelsAndResorts => "hotels_motels_and_resorts", + HouseholdApplianceStores => "household_appliance_stores", + IndustrialSupplies => "industrial_supplies", + InformationRetrievalServices => "information_retrieval_services", + InsuranceDefault => "insurance_default", + InsuranceUnderwritingPremiums => "insurance_underwriting_premiums", + IntraCompanyPurchases => "intra_company_purchases", + JewelryStoresWatchesClocksAndSilverwareStores => { + "jewelry_stores_watches_clocks_and_silverware_stores" + } + LandscapingServices => "landscaping_services", + Laundries => "laundries", + LaundryCleaningServices => "laundry_cleaning_services", + LegalServicesAttorneys => "legal_services_attorneys", + LuggageAndLeatherGoodsStores => "luggage_and_leather_goods_stores", + LumberBuildingMaterialsStores => "lumber_building_materials_stores", + ManualCashDisburse => "manual_cash_disburse", + MarinasServiceAndSupplies => "marinas_service_and_supplies", + Marketplaces => "marketplaces", + MasonryStoneworkAndPlaster => "masonry_stonework_and_plaster", + MassageParlors => "massage_parlors", + MedicalAndDentalLabs => "medical_and_dental_labs", + MedicalDentalOphthalmicAndHospitalEquipmentAndSupplies => { + "medical_dental_ophthalmic_and_hospital_equipment_and_supplies" + } + MedicalServices => "medical_services", + MembershipOrganizations => "membership_organizations", + MensAndBoysClothingAndAccessoriesStores => { + "mens_and_boys_clothing_and_accessories_stores" + } + MensWomensClothingStores => "mens_womens_clothing_stores", + MetalServiceCenters => "metal_service_centers", + Miscellaneous => "miscellaneous", + MiscellaneousApparelAndAccessoryShops => "miscellaneous_apparel_and_accessory_shops", + MiscellaneousAutoDealers => "miscellaneous_auto_dealers", + MiscellaneousBusinessServices => "miscellaneous_business_services", + MiscellaneousFoodStores => "miscellaneous_food_stores", + MiscellaneousGeneralMerchandise => "miscellaneous_general_merchandise", + MiscellaneousGeneralServices => "miscellaneous_general_services", + MiscellaneousHomeFurnishingSpecialtyStores => { + "miscellaneous_home_furnishing_specialty_stores" + } + MiscellaneousPublishingAndPrinting => "miscellaneous_publishing_and_printing", + MiscellaneousRecreationServices => "miscellaneous_recreation_services", + MiscellaneousRepairShops => "miscellaneous_repair_shops", + MiscellaneousSpecialtyRetail => "miscellaneous_specialty_retail", + MobileHomeDealers => "mobile_home_dealers", + MotionPictureTheaters => "motion_picture_theaters", + MotorFreightCarriersAndTrucking => "motor_freight_carriers_and_trucking", + MotorHomesDealers => "motor_homes_dealers", + MotorVehicleSuppliesAndNewParts => "motor_vehicle_supplies_and_new_parts", + MotorcycleShopsAndDealers => "motorcycle_shops_and_dealers", + MotorcycleShopsDealers => "motorcycle_shops_dealers", + MusicStoresMusicalInstrumentsPianosAndSheetMusic => { + "music_stores_musical_instruments_pianos_and_sheet_music" + } + NewsDealersAndNewsstands => "news_dealers_and_newsstands", + NonFiMoneyOrders => "non_fi_money_orders", + NonFiStoredValueCardPurchaseLoad => "non_fi_stored_value_card_purchase_load", + NondurableGoods => "nondurable_goods", + NurseriesLawnAndGardenSupplyStores => "nurseries_lawn_and_garden_supply_stores", + NursingPersonalCare => "nursing_personal_care", + OfficeAndCommercialFurniture => "office_and_commercial_furniture", + OpticiansEyeglasses => "opticians_eyeglasses", + OptometristsOphthalmologist => "optometrists_ophthalmologist", + OrthopedicGoodsProstheticDevices => "orthopedic_goods_prosthetic_devices", + Osteopaths => "osteopaths", + PackageStoresBeerWineAndLiquor => "package_stores_beer_wine_and_liquor", + PaintsVarnishesAndSupplies => "paints_varnishes_and_supplies", + ParkingLotsGarages => "parking_lots_garages", + PassengerRailways => "passenger_railways", + PawnShops => "pawn_shops", + PetShopsPetFoodAndSupplies => "pet_shops_pet_food_and_supplies", + PetroleumAndPetroleumProducts => "petroleum_and_petroleum_products", + PhotoDeveloping => "photo_developing", + PhotographicPhotocopyMicrofilmEquipmentAndSupplies => { + "photographic_photocopy_microfilm_equipment_and_supplies" + } + PhotographicStudios => "photographic_studios", + PictureVideoProduction => "picture_video_production", + PieceGoodsNotionsAndOtherDryGoods => "piece_goods_notions_and_other_dry_goods", + PlumbingHeatingEquipmentAndSupplies => "plumbing_heating_equipment_and_supplies", + PoliticalOrganizations => "political_organizations", + PostalServicesGovernmentOnly => "postal_services_government_only", + PreciousStonesAndMetalsWatchesAndJewelry => { + "precious_stones_and_metals_watches_and_jewelry" + } + ProfessionalServices => "professional_services", + PublicWarehousingAndStorage => "public_warehousing_and_storage", + QuickCopyReproAndBlueprint => "quick_copy_repro_and_blueprint", + Railroads => "railroads", + RealEstateAgentsAndManagersRentals => "real_estate_agents_and_managers_rentals", + RecordStores => "record_stores", + RecreationalVehicleRentals => "recreational_vehicle_rentals", + ReligiousGoodsStores => "religious_goods_stores", + ReligiousOrganizations => "religious_organizations", + RoofingSidingSheetMetal => "roofing_siding_sheet_metal", + SecretarialSupportServices => "secretarial_support_services", + SecurityBrokersDealers => "security_brokers_dealers", + ServiceStations => "service_stations", + SewingNeedleworkFabricAndPieceGoodsStores => { + "sewing_needlework_fabric_and_piece_goods_stores" + } + ShoeRepairHatCleaning => "shoe_repair_hat_cleaning", + ShoeStores => "shoe_stores", + SmallApplianceRepair => "small_appliance_repair", + SnowmobileDealers => "snowmobile_dealers", + SpecialTradeServices => "special_trade_services", + SpecialtyCleaning => "specialty_cleaning", + SportingGoodsStores => "sporting_goods_stores", + SportingRecreationCamps => "sporting_recreation_camps", + SportsAndRidingApparelStores => "sports_and_riding_apparel_stores", + SportsClubsFields => "sports_clubs_fields", + StampAndCoinStores => "stamp_and_coin_stores", + StationaryOfficeSuppliesPrintingAndWritingPaper => { + "stationary_office_supplies_printing_and_writing_paper" + } + StationeryStoresOfficeAndSchoolSupplyStores => { + "stationery_stores_office_and_school_supply_stores" + } + SwimmingPoolsSales => "swimming_pools_sales", + TUiTravelGermany => "t_ui_travel_germany", + TailorsAlterations => "tailors_alterations", + TaxPaymentsGovernmentAgencies => "tax_payments_government_agencies", + TaxPreparationServices => "tax_preparation_services", + TaxicabsLimousines => "taxicabs_limousines", + TelecommunicationEquipmentAndTelephoneSales => { + "telecommunication_equipment_and_telephone_sales" + } + TelecommunicationServices => "telecommunication_services", + TelegraphServices => "telegraph_services", + TentAndAwningShops => "tent_and_awning_shops", + TestingLaboratories => "testing_laboratories", + TheatricalTicketAgencies => "theatrical_ticket_agencies", + Timeshares => "timeshares", + TireRetreadingAndRepair => "tire_retreading_and_repair", + TollsBridgeFees => "tolls_bridge_fees", + TouristAttractionsAndExhibits => "tourist_attractions_and_exhibits", + TowingServices => "towing_services", + TrailerParksCampgrounds => "trailer_parks_campgrounds", + TransportationServices => "transportation_services", + TravelAgenciesTourOperators => "travel_agencies_tour_operators", + TruckStopIteration => "truck_stop_iteration", + TruckUtilityTrailerRentals => "truck_utility_trailer_rentals", + TypesettingPlateMakingAndRelatedServices => { + "typesetting_plate_making_and_related_services" + } + TypewriterStores => "typewriter_stores", + USFederalGovernmentAgenciesOrDepartments => { + "u_s_federal_government_agencies_or_departments" + } + UniformsCommercialClothing => "uniforms_commercial_clothing", + UsedMerchandiseAndSecondhandStores => "used_merchandise_and_secondhand_stores", + Utilities => "utilities", + VarietyStores => "variety_stores", + VeterinaryServices => "veterinary_services", + VideoAmusementGameSupplies => "video_amusement_game_supplies", + VideoGameArcades => "video_game_arcades", + VideoTapeRentalStores => "video_tape_rental_stores", + VocationalTradeSchools => "vocational_trade_schools", + WatchJewelryRepair => "watch_jewelry_repair", + WeldingRepair => "welding_repair", + WholesaleClubs => "wholesale_clubs", + WigAndToupeeStores => "wig_and_toupee_stores", + WiresMoneyOrders => "wires_money_orders", + WomensAccessoryAndSpecialtyShops => "womens_accessory_and_specialty_shops", + WomensReadyToWearStores => "womens_ready_to_wear_stores", + WreckingAndSalvageYards => "wrecking_and_salvage_yards", + Unknown => "unknown", + } + } +} + +impl std::str::FromStr for IssuingCardSpendingLimitCategories { + type Err = (); + fn from_str(s: &str) -> Result { + use IssuingCardSpendingLimitCategories::*; + match s { + "ac_refrigeration_repair" => Ok(AcRefrigerationRepair), + "accounting_bookkeeping_services" => Ok(AccountingBookkeepingServices), + "advertising_services" => Ok(AdvertisingServices), + "agricultural_cooperative" => Ok(AgriculturalCooperative), + "airlines_air_carriers" => Ok(AirlinesAirCarriers), + "airports_flying_fields" => Ok(AirportsFlyingFields), + "ambulance_services" => Ok(AmbulanceServices), + "amusement_parks_carnivals" => Ok(AmusementParksCarnivals), + "antique_reproductions" => Ok(AntiqueReproductions), + "antique_shops" => Ok(AntiqueShops), + "aquariums" => Ok(Aquariums), + "architectural_surveying_services" => Ok(ArchitecturalSurveyingServices), + "art_dealers_and_galleries" => Ok(ArtDealersAndGalleries), + "artists_supply_and_craft_shops" => Ok(ArtistsSupplyAndCraftShops), + "auto_and_home_supply_stores" => Ok(AutoAndHomeSupplyStores), + "auto_body_repair_shops" => Ok(AutoBodyRepairShops), + "auto_paint_shops" => Ok(AutoPaintShops), + "auto_service_shops" => Ok(AutoServiceShops), + "automated_cash_disburse" => Ok(AutomatedCashDisburse), + "automated_fuel_dispensers" => Ok(AutomatedFuelDispensers), + "automobile_associations" => Ok(AutomobileAssociations), + "automotive_parts_and_accessories_stores" => Ok(AutomotivePartsAndAccessoriesStores), + "automotive_tire_stores" => Ok(AutomotiveTireStores), + "bail_and_bond_payments" => Ok(BailAndBondPayments), + "bakeries" => Ok(Bakeries), + "bands_orchestras" => Ok(BandsOrchestras), + "barber_and_beauty_shops" => Ok(BarberAndBeautyShops), + "betting_casino_gambling" => Ok(BettingCasinoGambling), + "bicycle_shops" => Ok(BicycleShops), + "billiard_pool_establishments" => Ok(BilliardPoolEstablishments), + "boat_dealers" => Ok(BoatDealers), + "boat_rentals_and_leases" => Ok(BoatRentalsAndLeases), + "book_stores" => Ok(BookStores), + "books_periodicals_and_newspapers" => Ok(BooksPeriodicalsAndNewspapers), + "bowling_alleys" => Ok(BowlingAlleys), + "bus_lines" => Ok(BusLines), + "business_secretarial_schools" => Ok(BusinessSecretarialSchools), + "buying_shopping_services" => Ok(BuyingShoppingServices), + "cable_satellite_and_other_pay_television_and_radio" => { + Ok(CableSatelliteAndOtherPayTelevisionAndRadio) + } + "camera_and_photographic_supply_stores" => Ok(CameraAndPhotographicSupplyStores), + "candy_nut_and_confectionery_stores" => Ok(CandyNutAndConfectioneryStores), + "car_and_truck_dealers_new_used" => Ok(CarAndTruckDealersNewUsed), + "car_and_truck_dealers_used_only" => Ok(CarAndTruckDealersUsedOnly), + "car_rental_agencies" => Ok(CarRentalAgencies), + "car_washes" => Ok(CarWashes), + "carpentry_services" => Ok(CarpentryServices), + "carpet_upholstery_cleaning" => Ok(CarpetUpholsteryCleaning), + "caterers" => Ok(Caterers), + "charitable_and_social_service_organizations_fundraising" => { + Ok(CharitableAndSocialServiceOrganizationsFundraising) + } + "chemicals_and_allied_products" => Ok(ChemicalsAndAlliedProducts), + "child_care_services" => Ok(ChildCareServices), + "childrens_and_infants_wear_stores" => Ok(ChildrensAndInfantsWearStores), + "chiropodists_podiatrists" => Ok(ChiropodistsPodiatrists), + "chiropractors" => Ok(Chiropractors), + "cigar_stores_and_stands" => Ok(CigarStoresAndStands), + "civic_social_fraternal_associations" => Ok(CivicSocialFraternalAssociations), + "cleaning_and_maintenance" => Ok(CleaningAndMaintenance), + "clothing_rental" => Ok(ClothingRental), + "colleges_universities" => Ok(CollegesUniversities), + "commercial_equipment" => Ok(CommercialEquipment), + "commercial_footwear" => Ok(CommercialFootwear), + "commercial_photography_art_and_graphics" => Ok(CommercialPhotographyArtAndGraphics), + "commuter_transport_and_ferries" => Ok(CommuterTransportAndFerries), + "computer_network_services" => Ok(ComputerNetworkServices), + "computer_programming" => Ok(ComputerProgramming), + "computer_repair" => Ok(ComputerRepair), + "computer_software_stores" => Ok(ComputerSoftwareStores), + "computers_peripherals_and_software" => Ok(ComputersPeripheralsAndSoftware), + "concrete_work_services" => Ok(ConcreteWorkServices), + "construction_materials" => Ok(ConstructionMaterials), + "consulting_public_relations" => Ok(ConsultingPublicRelations), + "correspondence_schools" => Ok(CorrespondenceSchools), + "cosmetic_stores" => Ok(CosmeticStores), + "counseling_services" => Ok(CounselingServices), + "country_clubs" => Ok(CountryClubs), + "courier_services" => Ok(CourierServices), + "court_costs" => Ok(CourtCosts), + "credit_reporting_agencies" => Ok(CreditReportingAgencies), + "cruise_lines" => Ok(CruiseLines), + "dairy_products_stores" => Ok(DairyProductsStores), + "dance_hall_studios_schools" => Ok(DanceHallStudiosSchools), + "dating_escort_services" => Ok(DatingEscortServices), + "dentists_orthodontists" => Ok(DentistsOrthodontists), + "department_stores" => Ok(DepartmentStores), + "detective_agencies" => Ok(DetectiveAgencies), + "digital_goods_applications" => Ok(DigitalGoodsApplications), + "digital_goods_games" => Ok(DigitalGoodsGames), + "digital_goods_large_volume" => Ok(DigitalGoodsLargeVolume), + "digital_goods_media" => Ok(DigitalGoodsMedia), + "direct_marketing_catalog_merchant" => Ok(DirectMarketingCatalogMerchant), + "direct_marketing_combination_catalog_and_retail_merchant" => { + Ok(DirectMarketingCombinationCatalogAndRetailMerchant) + } + "direct_marketing_inbound_telemarketing" => Ok(DirectMarketingInboundTelemarketing), + "direct_marketing_insurance_services" => Ok(DirectMarketingInsuranceServices), + "direct_marketing_other" => Ok(DirectMarketingOther), + "direct_marketing_outbound_telemarketing" => Ok(DirectMarketingOutboundTelemarketing), + "direct_marketing_subscription" => Ok(DirectMarketingSubscription), + "direct_marketing_travel" => Ok(DirectMarketingTravel), + "discount_stores" => Ok(DiscountStores), + "doctors" => Ok(Doctors), + "door_to_door_sales" => Ok(DoorToDoorSales), + "drapery_window_covering_and_upholstery_stores" => { + Ok(DraperyWindowCoveringAndUpholsteryStores) + } + "drinking_places" => Ok(DrinkingPlaces), + "drug_stores_and_pharmacies" => Ok(DrugStoresAndPharmacies), + "drugs_drug_proprietaries_and_druggist_sundries" => { + Ok(DrugsDrugProprietariesAndDruggistSundries) + } + "dry_cleaners" => Ok(DryCleaners), + "durable_goods" => Ok(DurableGoods), + "duty_free_stores" => Ok(DutyFreeStores), + "eating_places_restaurants" => Ok(EatingPlacesRestaurants), + "educational_services" => Ok(EducationalServices), + "electric_razor_stores" => Ok(ElectricRazorStores), + "electric_vehicle_charging" => Ok(ElectricVehicleCharging), + "electrical_parts_and_equipment" => Ok(ElectricalPartsAndEquipment), + "electrical_services" => Ok(ElectricalServices), + "electronics_repair_shops" => Ok(ElectronicsRepairShops), + "electronics_stores" => Ok(ElectronicsStores), + "elementary_secondary_schools" => Ok(ElementarySecondarySchools), + "emergency_services_gcas_visa_use_only" => Ok(EmergencyServicesGcasVisaUseOnly), + "employment_temp_agencies" => Ok(EmploymentTempAgencies), + "equipment_rental" => Ok(EquipmentRental), + "exterminating_services" => Ok(ExterminatingServices), + "family_clothing_stores" => Ok(FamilyClothingStores), + "fast_food_restaurants" => Ok(FastFoodRestaurants), + "financial_institutions" => Ok(FinancialInstitutions), + "fines_government_administrative_entities" => Ok(FinesGovernmentAdministrativeEntities), + "fireplace_fireplace_screens_and_accessories_stores" => { + Ok(FireplaceFireplaceScreensAndAccessoriesStores) + } + "floor_covering_stores" => Ok(FloorCoveringStores), + "florists" => Ok(Florists), + "florists_supplies_nursery_stock_and_flowers" => { + Ok(FloristsSuppliesNurseryStockAndFlowers) + } + "freezer_and_locker_meat_provisioners" => Ok(FreezerAndLockerMeatProvisioners), + "fuel_dealers_non_automotive" => Ok(FuelDealersNonAutomotive), + "funeral_services_crematories" => Ok(FuneralServicesCrematories), + "furniture_home_furnishings_and_equipment_stores_except_appliances" => { + Ok(FurnitureHomeFurnishingsAndEquipmentStoresExceptAppliances) + } + "furniture_repair_refinishing" => Ok(FurnitureRepairRefinishing), + "furriers_and_fur_shops" => Ok(FurriersAndFurShops), + "general_services" => Ok(GeneralServices), + "gift_card_novelty_and_souvenir_shops" => Ok(GiftCardNoveltyAndSouvenirShops), + "glass_paint_and_wallpaper_stores" => Ok(GlassPaintAndWallpaperStores), + "glassware_crystal_stores" => Ok(GlasswareCrystalStores), + "golf_courses_public" => Ok(GolfCoursesPublic), + "government_licensed_horse_dog_racing_us_region_only" => { + Ok(GovernmentLicensedHorseDogRacingUsRegionOnly) + } + "government_licensed_online_casions_online_gambling_us_region_only" => { + Ok(GovernmentLicensedOnlineCasionsOnlineGamblingUsRegionOnly) + } + "government_owned_lotteries_non_us_region" => Ok(GovernmentOwnedLotteriesNonUsRegion), + "government_owned_lotteries_us_region_only" => Ok(GovernmentOwnedLotteriesUsRegionOnly), + "government_services" => Ok(GovernmentServices), + "grocery_stores_supermarkets" => Ok(GroceryStoresSupermarkets), + "hardware_equipment_and_supplies" => Ok(HardwareEquipmentAndSupplies), + "hardware_stores" => Ok(HardwareStores), + "health_and_beauty_spas" => Ok(HealthAndBeautySpas), + "hearing_aids_sales_and_supplies" => Ok(HearingAidsSalesAndSupplies), + "heating_plumbing_a_c" => Ok(HeatingPlumbingAC), + "hobby_toy_and_game_shops" => Ok(HobbyToyAndGameShops), + "home_supply_warehouse_stores" => Ok(HomeSupplyWarehouseStores), + "hospitals" => Ok(Hospitals), + "hotels_motels_and_resorts" => Ok(HotelsMotelsAndResorts), + "household_appliance_stores" => Ok(HouseholdApplianceStores), + "industrial_supplies" => Ok(IndustrialSupplies), + "information_retrieval_services" => Ok(InformationRetrievalServices), + "insurance_default" => Ok(InsuranceDefault), + "insurance_underwriting_premiums" => Ok(InsuranceUnderwritingPremiums), + "intra_company_purchases" => Ok(IntraCompanyPurchases), + "jewelry_stores_watches_clocks_and_silverware_stores" => { + Ok(JewelryStoresWatchesClocksAndSilverwareStores) + } + "landscaping_services" => Ok(LandscapingServices), + "laundries" => Ok(Laundries), + "laundry_cleaning_services" => Ok(LaundryCleaningServices), + "legal_services_attorneys" => Ok(LegalServicesAttorneys), + "luggage_and_leather_goods_stores" => Ok(LuggageAndLeatherGoodsStores), + "lumber_building_materials_stores" => Ok(LumberBuildingMaterialsStores), + "manual_cash_disburse" => Ok(ManualCashDisburse), + "marinas_service_and_supplies" => Ok(MarinasServiceAndSupplies), + "marketplaces" => Ok(Marketplaces), + "masonry_stonework_and_plaster" => Ok(MasonryStoneworkAndPlaster), + "massage_parlors" => Ok(MassageParlors), + "medical_and_dental_labs" => Ok(MedicalAndDentalLabs), + "medical_dental_ophthalmic_and_hospital_equipment_and_supplies" => { + Ok(MedicalDentalOphthalmicAndHospitalEquipmentAndSupplies) + } + "medical_services" => Ok(MedicalServices), + "membership_organizations" => Ok(MembershipOrganizations), + "mens_and_boys_clothing_and_accessories_stores" => { + Ok(MensAndBoysClothingAndAccessoriesStores) + } + "mens_womens_clothing_stores" => Ok(MensWomensClothingStores), + "metal_service_centers" => Ok(MetalServiceCenters), + "miscellaneous" => Ok(Miscellaneous), + "miscellaneous_apparel_and_accessory_shops" => { + Ok(MiscellaneousApparelAndAccessoryShops) + } + "miscellaneous_auto_dealers" => Ok(MiscellaneousAutoDealers), + "miscellaneous_business_services" => Ok(MiscellaneousBusinessServices), + "miscellaneous_food_stores" => Ok(MiscellaneousFoodStores), + "miscellaneous_general_merchandise" => Ok(MiscellaneousGeneralMerchandise), + "miscellaneous_general_services" => Ok(MiscellaneousGeneralServices), + "miscellaneous_home_furnishing_specialty_stores" => { + Ok(MiscellaneousHomeFurnishingSpecialtyStores) + } + "miscellaneous_publishing_and_printing" => Ok(MiscellaneousPublishingAndPrinting), + "miscellaneous_recreation_services" => Ok(MiscellaneousRecreationServices), + "miscellaneous_repair_shops" => Ok(MiscellaneousRepairShops), + "miscellaneous_specialty_retail" => Ok(MiscellaneousSpecialtyRetail), + "mobile_home_dealers" => Ok(MobileHomeDealers), + "motion_picture_theaters" => Ok(MotionPictureTheaters), + "motor_freight_carriers_and_trucking" => Ok(MotorFreightCarriersAndTrucking), + "motor_homes_dealers" => Ok(MotorHomesDealers), + "motor_vehicle_supplies_and_new_parts" => Ok(MotorVehicleSuppliesAndNewParts), + "motorcycle_shops_and_dealers" => Ok(MotorcycleShopsAndDealers), + "motorcycle_shops_dealers" => Ok(MotorcycleShopsDealers), + "music_stores_musical_instruments_pianos_and_sheet_music" => { + Ok(MusicStoresMusicalInstrumentsPianosAndSheetMusic) + } + "news_dealers_and_newsstands" => Ok(NewsDealersAndNewsstands), + "non_fi_money_orders" => Ok(NonFiMoneyOrders), + "non_fi_stored_value_card_purchase_load" => Ok(NonFiStoredValueCardPurchaseLoad), + "nondurable_goods" => Ok(NondurableGoods), + "nurseries_lawn_and_garden_supply_stores" => Ok(NurseriesLawnAndGardenSupplyStores), + "nursing_personal_care" => Ok(NursingPersonalCare), + "office_and_commercial_furniture" => Ok(OfficeAndCommercialFurniture), + "opticians_eyeglasses" => Ok(OpticiansEyeglasses), + "optometrists_ophthalmologist" => Ok(OptometristsOphthalmologist), + "orthopedic_goods_prosthetic_devices" => Ok(OrthopedicGoodsProstheticDevices), + "osteopaths" => Ok(Osteopaths), + "package_stores_beer_wine_and_liquor" => Ok(PackageStoresBeerWineAndLiquor), + "paints_varnishes_and_supplies" => Ok(PaintsVarnishesAndSupplies), + "parking_lots_garages" => Ok(ParkingLotsGarages), + "passenger_railways" => Ok(PassengerRailways), + "pawn_shops" => Ok(PawnShops), + "pet_shops_pet_food_and_supplies" => Ok(PetShopsPetFoodAndSupplies), + "petroleum_and_petroleum_products" => Ok(PetroleumAndPetroleumProducts), + "photo_developing" => Ok(PhotoDeveloping), + "photographic_photocopy_microfilm_equipment_and_supplies" => { + Ok(PhotographicPhotocopyMicrofilmEquipmentAndSupplies) + } + "photographic_studios" => Ok(PhotographicStudios), + "picture_video_production" => Ok(PictureVideoProduction), + "piece_goods_notions_and_other_dry_goods" => Ok(PieceGoodsNotionsAndOtherDryGoods), + "plumbing_heating_equipment_and_supplies" => Ok(PlumbingHeatingEquipmentAndSupplies), + "political_organizations" => Ok(PoliticalOrganizations), + "postal_services_government_only" => Ok(PostalServicesGovernmentOnly), + "precious_stones_and_metals_watches_and_jewelry" => { + Ok(PreciousStonesAndMetalsWatchesAndJewelry) + } + "professional_services" => Ok(ProfessionalServices), + "public_warehousing_and_storage" => Ok(PublicWarehousingAndStorage), + "quick_copy_repro_and_blueprint" => Ok(QuickCopyReproAndBlueprint), + "railroads" => Ok(Railroads), + "real_estate_agents_and_managers_rentals" => Ok(RealEstateAgentsAndManagersRentals), + "record_stores" => Ok(RecordStores), + "recreational_vehicle_rentals" => Ok(RecreationalVehicleRentals), + "religious_goods_stores" => Ok(ReligiousGoodsStores), + "religious_organizations" => Ok(ReligiousOrganizations), + "roofing_siding_sheet_metal" => Ok(RoofingSidingSheetMetal), + "secretarial_support_services" => Ok(SecretarialSupportServices), + "security_brokers_dealers" => Ok(SecurityBrokersDealers), + "service_stations" => Ok(ServiceStations), + "sewing_needlework_fabric_and_piece_goods_stores" => { + Ok(SewingNeedleworkFabricAndPieceGoodsStores) + } + "shoe_repair_hat_cleaning" => Ok(ShoeRepairHatCleaning), + "shoe_stores" => Ok(ShoeStores), + "small_appliance_repair" => Ok(SmallApplianceRepair), + "snowmobile_dealers" => Ok(SnowmobileDealers), + "special_trade_services" => Ok(SpecialTradeServices), + "specialty_cleaning" => Ok(SpecialtyCleaning), + "sporting_goods_stores" => Ok(SportingGoodsStores), + "sporting_recreation_camps" => Ok(SportingRecreationCamps), + "sports_and_riding_apparel_stores" => Ok(SportsAndRidingApparelStores), + "sports_clubs_fields" => Ok(SportsClubsFields), + "stamp_and_coin_stores" => Ok(StampAndCoinStores), + "stationary_office_supplies_printing_and_writing_paper" => { + Ok(StationaryOfficeSuppliesPrintingAndWritingPaper) + } + "stationery_stores_office_and_school_supply_stores" => { + Ok(StationeryStoresOfficeAndSchoolSupplyStores) + } + "swimming_pools_sales" => Ok(SwimmingPoolsSales), + "t_ui_travel_germany" => Ok(TUiTravelGermany), + "tailors_alterations" => Ok(TailorsAlterations), + "tax_payments_government_agencies" => Ok(TaxPaymentsGovernmentAgencies), + "tax_preparation_services" => Ok(TaxPreparationServices), + "taxicabs_limousines" => Ok(TaxicabsLimousines), + "telecommunication_equipment_and_telephone_sales" => { + Ok(TelecommunicationEquipmentAndTelephoneSales) + } + "telecommunication_services" => Ok(TelecommunicationServices), + "telegraph_services" => Ok(TelegraphServices), + "tent_and_awning_shops" => Ok(TentAndAwningShops), + "testing_laboratories" => Ok(TestingLaboratories), + "theatrical_ticket_agencies" => Ok(TheatricalTicketAgencies), + "timeshares" => Ok(Timeshares), + "tire_retreading_and_repair" => Ok(TireRetreadingAndRepair), + "tolls_bridge_fees" => Ok(TollsBridgeFees), + "tourist_attractions_and_exhibits" => Ok(TouristAttractionsAndExhibits), + "towing_services" => Ok(TowingServices), + "trailer_parks_campgrounds" => Ok(TrailerParksCampgrounds), + "transportation_services" => Ok(TransportationServices), + "travel_agencies_tour_operators" => Ok(TravelAgenciesTourOperators), + "truck_stop_iteration" => Ok(TruckStopIteration), + "truck_utility_trailer_rentals" => Ok(TruckUtilityTrailerRentals), + "typesetting_plate_making_and_related_services" => { + Ok(TypesettingPlateMakingAndRelatedServices) + } + "typewriter_stores" => Ok(TypewriterStores), + "u_s_federal_government_agencies_or_departments" => { + Ok(USFederalGovernmentAgenciesOrDepartments) + } + "uniforms_commercial_clothing" => Ok(UniformsCommercialClothing), + "used_merchandise_and_secondhand_stores" => Ok(UsedMerchandiseAndSecondhandStores), + "utilities" => Ok(Utilities), + "variety_stores" => Ok(VarietyStores), + "veterinary_services" => Ok(VeterinaryServices), + "video_amusement_game_supplies" => Ok(VideoAmusementGameSupplies), + "video_game_arcades" => Ok(VideoGameArcades), + "video_tape_rental_stores" => Ok(VideoTapeRentalStores), + "vocational_trade_schools" => Ok(VocationalTradeSchools), + "watch_jewelry_repair" => Ok(WatchJewelryRepair), + "welding_repair" => Ok(WeldingRepair), + "wholesale_clubs" => Ok(WholesaleClubs), + "wig_and_toupee_stores" => Ok(WigAndToupeeStores), + "wires_money_orders" => Ok(WiresMoneyOrders), + "womens_accessory_and_specialty_shops" => Ok(WomensAccessoryAndSpecialtyShops), + "womens_ready_to_wear_stores" => Ok(WomensReadyToWearStores), + "wrecking_and_salvage_yards" => Ok(WreckingAndSalvageYards), + _ => Err(()), + } + } +} +impl std::fmt::Display for IssuingCardSpendingLimitCategories { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for IssuingCardSpendingLimitCategories { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for IssuingCardSpendingLimitCategories { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for IssuingCardSpendingLimitCategories { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Ok(Self::from_str(&s).unwrap_or(IssuingCardSpendingLimitCategories::Unknown)) + } +} +/// Interval (or event) to which the amount applies. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum IssuingCardSpendingLimitInterval { + AllTime, + Daily, + Monthly, + PerAuthorization, + Weekly, + Yearly, +} +impl IssuingCardSpendingLimitInterval { + pub fn as_str(self) -> &'static str { + use IssuingCardSpendingLimitInterval::*; + match self { + AllTime => "all_time", + Daily => "daily", + Monthly => "monthly", + PerAuthorization => "per_authorization", + Weekly => "weekly", + Yearly => "yearly", + } + } +} + +impl std::str::FromStr for IssuingCardSpendingLimitInterval { + type Err = (); + fn from_str(s: &str) -> Result { + use IssuingCardSpendingLimitInterval::*; + match s { + "all_time" => Ok(AllTime), + "daily" => Ok(Daily), + "monthly" => Ok(Monthly), + "per_authorization" => Ok(PerAuthorization), + "weekly" => Ok(Weekly), + "yearly" => Ok(Yearly), + _ => Err(()), + } + } +} +impl std::fmt::Display for IssuingCardSpendingLimitInterval { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for IssuingCardSpendingLimitInterval { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for IssuingCardSpendingLimitInterval { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for IssuingCardSpendingLimitInterval { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| { + serde::de::Error::custom("Unknown value for IssuingCardSpendingLimitInterval") + }) + } +} diff --git a/generated/stripe_shared/src/issuing_card_wallets.rs b/generated/stripe_shared/src/issuing_card_wallets.rs new file mode 100644 index 000000000..d3a3840df --- /dev/null +++ b/generated/stripe_shared/src/issuing_card_wallets.rs @@ -0,0 +1,7 @@ +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct IssuingCardWallets { + pub apple_pay: stripe_shared::IssuingCardApplePay, + pub google_pay: stripe_shared::IssuingCardGooglePay, + /// Unique identifier for a card used with digital wallets + pub primary_account_identifier: Option, +} diff --git a/generated/stripe_shared/src/issuing_cardholder.rs b/generated/stripe_shared/src/issuing_cardholder.rs new file mode 100644 index 000000000..241ef69fe --- /dev/null +++ b/generated/stripe_shared/src/issuing_cardholder.rs @@ -0,0 +1,223 @@ +/// An Issuing `Cardholder` object represents an individual or business entity who is [issued](https://stripe.com/docs/issuing) cards. +/// +/// Related guide: [How to create a cardholder](https://stripe.com/docs/issuing/cards#create-cardholder). +/// +/// For more details see <>. +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct IssuingCardholder { + pub billing: stripe_shared::IssuingCardholderAddress, + /// Additional information about a `company` cardholder. + pub company: Option, + /// Time at which the object was created. Measured in seconds since the Unix epoch. + pub created: stripe_types::Timestamp, + /// The cardholder's email address. + pub email: Option, + /// Unique identifier for the object. + pub id: stripe_shared::IssuingCardholderId, + /// Additional information about an `individual` cardholder. + pub individual: Option, + /// Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + pub livemode: bool, + /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. + /// This can be useful for storing additional information about the object in a structured format. + pub metadata: std::collections::HashMap, + /// The cardholder's name. This will be printed on cards issued to them. + pub name: String, + /// The cardholder's phone number. + /// This is required for all cardholders who will be creating EU cards. + /// See the [3D Secure documentation](https://stripe.com/docs/issuing/3d-secure#when-is-3d-secure-applied) for more details. + pub phone_number: Option, + /// The cardholder’s preferred locales (languages), ordered by preference. + /// Locales can be `de`, `en`, `es`, `fr`, or `it`. + /// This changes the language of the [3D Secure flow](https://stripe.com/docs/issuing/3d-secure) and one-time password messages sent to the cardholder. + pub preferred_locales: Option>, + pub requirements: stripe_shared::IssuingCardholderRequirements, + /// Rules that control spending across this cardholder's cards. + /// Refer to our [documentation](https://stripe.com/docs/issuing/controls/spending-controls) for more details. + pub spending_controls: Option, + /// Specifies whether to permit authorizations on this cardholder's cards. + pub status: stripe_shared::IssuingCardholderStatus, + /// One of `individual` or `company`. + /// See [Choose a cardholder type](https://stripe.com/docs/issuing/other/choose-cardholder) for more details. + #[serde(rename = "type")] + pub type_: stripe_shared::IssuingCardholderType, +} +impl stripe_types::Object for IssuingCardholder { + type Id = stripe_shared::IssuingCardholderId; + fn id(&self) -> &Self::Id { + &self.id + } +} +stripe_types::def_id!(IssuingCardholderId, "ich_"); +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum IssuingCardholderPreferredLocales { + De, + En, + Es, + Fr, + It, +} +impl IssuingCardholderPreferredLocales { + pub fn as_str(self) -> &'static str { + use IssuingCardholderPreferredLocales::*; + match self { + De => "de", + En => "en", + Es => "es", + Fr => "fr", + It => "it", + } + } +} + +impl std::str::FromStr for IssuingCardholderPreferredLocales { + type Err = (); + fn from_str(s: &str) -> Result { + use IssuingCardholderPreferredLocales::*; + match s { + "de" => Ok(De), + "en" => Ok(En), + "es" => Ok(Es), + "fr" => Ok(Fr), + "it" => Ok(It), + _ => Err(()), + } + } +} +impl std::fmt::Display for IssuingCardholderPreferredLocales { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for IssuingCardholderPreferredLocales { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for IssuingCardholderPreferredLocales { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for IssuingCardholderPreferredLocales { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| { + serde::de::Error::custom("Unknown value for IssuingCardholderPreferredLocales") + }) + } +} +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum IssuingCardholderStatus { + Active, + Blocked, + Inactive, +} +impl IssuingCardholderStatus { + pub fn as_str(self) -> &'static str { + use IssuingCardholderStatus::*; + match self { + Active => "active", + Blocked => "blocked", + Inactive => "inactive", + } + } +} + +impl std::str::FromStr for IssuingCardholderStatus { + type Err = (); + fn from_str(s: &str) -> Result { + use IssuingCardholderStatus::*; + match s { + "active" => Ok(Active), + "blocked" => Ok(Blocked), + "inactive" => Ok(Inactive), + _ => Err(()), + } + } +} +impl std::fmt::Display for IssuingCardholderStatus { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for IssuingCardholderStatus { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for IssuingCardholderStatus { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for IssuingCardholderStatus { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s) + .map_err(|_| serde::de::Error::custom("Unknown value for IssuingCardholderStatus")) + } +} +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum IssuingCardholderType { + Company, + Individual, +} +impl IssuingCardholderType { + pub fn as_str(self) -> &'static str { + use IssuingCardholderType::*; + match self { + Company => "company", + Individual => "individual", + } + } +} + +impl std::str::FromStr for IssuingCardholderType { + type Err = (); + fn from_str(s: &str) -> Result { + use IssuingCardholderType::*; + match s { + "company" => Ok(Company), + "individual" => Ok(Individual), + _ => Err(()), + } + } +} +impl std::fmt::Display for IssuingCardholderType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for IssuingCardholderType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for IssuingCardholderType { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for IssuingCardholderType { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s) + .map_err(|_| serde::de::Error::custom("Unknown value for IssuingCardholderType")) + } +} diff --git a/generated/stripe_shared/src/issuing_cardholder_address.rs b/generated/stripe_shared/src/issuing_cardholder_address.rs new file mode 100644 index 000000000..ed0c54052 --- /dev/null +++ b/generated/stripe_shared/src/issuing_cardholder_address.rs @@ -0,0 +1,4 @@ +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct IssuingCardholderAddress { + pub address: stripe_shared::Address, +} diff --git a/generated/stripe_shared/src/issuing_cardholder_authorization_controls.rs b/generated/stripe_shared/src/issuing_cardholder_authorization_controls.rs new file mode 100644 index 000000000..735bb61f0 --- /dev/null +++ b/generated/stripe_shared/src/issuing_cardholder_authorization_controls.rs @@ -0,0 +1,2077 @@ +#[derive(Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct IssuingCardholderAuthorizationControls { + /// Array of strings containing [categories](https://stripe.com/docs/api#issuing_authorization_object-merchant_data-category) of authorizations to allow. + /// All other categories will be blocked. + /// Cannot be set with `blocked_categories`. + pub allowed_categories: Option>, + /// Array of strings containing [categories](https://stripe.com/docs/api#issuing_authorization_object-merchant_data-category) of authorizations to decline. + /// All other categories will be allowed. + /// Cannot be set with `allowed_categories`. + pub blocked_categories: Option>, + /// Limit spending with amount-based rules that apply across this cardholder's cards. + pub spending_limits: Option>, + /// Currency of the amounts within `spending_limits`. + pub spending_limits_currency: Option, +} +/// Array of strings containing [categories](https://stripe.com/docs/api#issuing_authorization_object-merchant_data-category) of authorizations to allow. +/// All other categories will be blocked. +/// Cannot be set with `blocked_categories`. +#[derive(Copy, Clone, Eq, PartialEq)] +#[non_exhaustive] +pub enum IssuingCardholderAuthorizationControlsAllowedCategories { + AcRefrigerationRepair, + AccountingBookkeepingServices, + AdvertisingServices, + AgriculturalCooperative, + AirlinesAirCarriers, + AirportsFlyingFields, + AmbulanceServices, + AmusementParksCarnivals, + AntiqueReproductions, + AntiqueShops, + Aquariums, + ArchitecturalSurveyingServices, + ArtDealersAndGalleries, + ArtistsSupplyAndCraftShops, + AutoAndHomeSupplyStores, + AutoBodyRepairShops, + AutoPaintShops, + AutoServiceShops, + AutomatedCashDisburse, + AutomatedFuelDispensers, + AutomobileAssociations, + AutomotivePartsAndAccessoriesStores, + AutomotiveTireStores, + BailAndBondPayments, + Bakeries, + BandsOrchestras, + BarberAndBeautyShops, + BettingCasinoGambling, + BicycleShops, + BilliardPoolEstablishments, + BoatDealers, + BoatRentalsAndLeases, + BookStores, + BooksPeriodicalsAndNewspapers, + BowlingAlleys, + BusLines, + BusinessSecretarialSchools, + BuyingShoppingServices, + CableSatelliteAndOtherPayTelevisionAndRadio, + CameraAndPhotographicSupplyStores, + CandyNutAndConfectioneryStores, + CarAndTruckDealersNewUsed, + CarAndTruckDealersUsedOnly, + CarRentalAgencies, + CarWashes, + CarpentryServices, + CarpetUpholsteryCleaning, + Caterers, + CharitableAndSocialServiceOrganizationsFundraising, + ChemicalsAndAlliedProducts, + ChildCareServices, + ChildrensAndInfantsWearStores, + ChiropodistsPodiatrists, + Chiropractors, + CigarStoresAndStands, + CivicSocialFraternalAssociations, + CleaningAndMaintenance, + ClothingRental, + CollegesUniversities, + CommercialEquipment, + CommercialFootwear, + CommercialPhotographyArtAndGraphics, + CommuterTransportAndFerries, + ComputerNetworkServices, + ComputerProgramming, + ComputerRepair, + ComputerSoftwareStores, + ComputersPeripheralsAndSoftware, + ConcreteWorkServices, + ConstructionMaterials, + ConsultingPublicRelations, + CorrespondenceSchools, + CosmeticStores, + CounselingServices, + CountryClubs, + CourierServices, + CourtCosts, + CreditReportingAgencies, + CruiseLines, + DairyProductsStores, + DanceHallStudiosSchools, + DatingEscortServices, + DentistsOrthodontists, + DepartmentStores, + DetectiveAgencies, + DigitalGoodsApplications, + DigitalGoodsGames, + DigitalGoodsLargeVolume, + DigitalGoodsMedia, + DirectMarketingCatalogMerchant, + DirectMarketingCombinationCatalogAndRetailMerchant, + DirectMarketingInboundTelemarketing, + DirectMarketingInsuranceServices, + DirectMarketingOther, + DirectMarketingOutboundTelemarketing, + DirectMarketingSubscription, + DirectMarketingTravel, + DiscountStores, + Doctors, + DoorToDoorSales, + DraperyWindowCoveringAndUpholsteryStores, + DrinkingPlaces, + DrugStoresAndPharmacies, + DrugsDrugProprietariesAndDruggistSundries, + DryCleaners, + DurableGoods, + DutyFreeStores, + EatingPlacesRestaurants, + EducationalServices, + ElectricRazorStores, + ElectricVehicleCharging, + ElectricalPartsAndEquipment, + ElectricalServices, + ElectronicsRepairShops, + ElectronicsStores, + ElementarySecondarySchools, + EmergencyServicesGcasVisaUseOnly, + EmploymentTempAgencies, + EquipmentRental, + ExterminatingServices, + FamilyClothingStores, + FastFoodRestaurants, + FinancialInstitutions, + FinesGovernmentAdministrativeEntities, + FireplaceFireplaceScreensAndAccessoriesStores, + FloorCoveringStores, + Florists, + FloristsSuppliesNurseryStockAndFlowers, + FreezerAndLockerMeatProvisioners, + FuelDealersNonAutomotive, + FuneralServicesCrematories, + FurnitureHomeFurnishingsAndEquipmentStoresExceptAppliances, + FurnitureRepairRefinishing, + FurriersAndFurShops, + GeneralServices, + GiftCardNoveltyAndSouvenirShops, + GlassPaintAndWallpaperStores, + GlasswareCrystalStores, + GolfCoursesPublic, + GovernmentLicensedHorseDogRacingUsRegionOnly, + GovernmentLicensedOnlineCasionsOnlineGamblingUsRegionOnly, + GovernmentOwnedLotteriesNonUsRegion, + GovernmentOwnedLotteriesUsRegionOnly, + GovernmentServices, + GroceryStoresSupermarkets, + HardwareEquipmentAndSupplies, + HardwareStores, + HealthAndBeautySpas, + HearingAidsSalesAndSupplies, + HeatingPlumbingAC, + HobbyToyAndGameShops, + HomeSupplyWarehouseStores, + Hospitals, + HotelsMotelsAndResorts, + HouseholdApplianceStores, + IndustrialSupplies, + InformationRetrievalServices, + InsuranceDefault, + InsuranceUnderwritingPremiums, + IntraCompanyPurchases, + JewelryStoresWatchesClocksAndSilverwareStores, + LandscapingServices, + Laundries, + LaundryCleaningServices, + LegalServicesAttorneys, + LuggageAndLeatherGoodsStores, + LumberBuildingMaterialsStores, + ManualCashDisburse, + MarinasServiceAndSupplies, + Marketplaces, + MasonryStoneworkAndPlaster, + MassageParlors, + MedicalAndDentalLabs, + MedicalDentalOphthalmicAndHospitalEquipmentAndSupplies, + MedicalServices, + MembershipOrganizations, + MensAndBoysClothingAndAccessoriesStores, + MensWomensClothingStores, + MetalServiceCenters, + Miscellaneous, + MiscellaneousApparelAndAccessoryShops, + MiscellaneousAutoDealers, + MiscellaneousBusinessServices, + MiscellaneousFoodStores, + MiscellaneousGeneralMerchandise, + MiscellaneousGeneralServices, + MiscellaneousHomeFurnishingSpecialtyStores, + MiscellaneousPublishingAndPrinting, + MiscellaneousRecreationServices, + MiscellaneousRepairShops, + MiscellaneousSpecialtyRetail, + MobileHomeDealers, + MotionPictureTheaters, + MotorFreightCarriersAndTrucking, + MotorHomesDealers, + MotorVehicleSuppliesAndNewParts, + MotorcycleShopsAndDealers, + MotorcycleShopsDealers, + MusicStoresMusicalInstrumentsPianosAndSheetMusic, + NewsDealersAndNewsstands, + NonFiMoneyOrders, + NonFiStoredValueCardPurchaseLoad, + NondurableGoods, + NurseriesLawnAndGardenSupplyStores, + NursingPersonalCare, + OfficeAndCommercialFurniture, + OpticiansEyeglasses, + OptometristsOphthalmologist, + OrthopedicGoodsProstheticDevices, + Osteopaths, + PackageStoresBeerWineAndLiquor, + PaintsVarnishesAndSupplies, + ParkingLotsGarages, + PassengerRailways, + PawnShops, + PetShopsPetFoodAndSupplies, + PetroleumAndPetroleumProducts, + PhotoDeveloping, + PhotographicPhotocopyMicrofilmEquipmentAndSupplies, + PhotographicStudios, + PictureVideoProduction, + PieceGoodsNotionsAndOtherDryGoods, + PlumbingHeatingEquipmentAndSupplies, + PoliticalOrganizations, + PostalServicesGovernmentOnly, + PreciousStonesAndMetalsWatchesAndJewelry, + ProfessionalServices, + PublicWarehousingAndStorage, + QuickCopyReproAndBlueprint, + Railroads, + RealEstateAgentsAndManagersRentals, + RecordStores, + RecreationalVehicleRentals, + ReligiousGoodsStores, + ReligiousOrganizations, + RoofingSidingSheetMetal, + SecretarialSupportServices, + SecurityBrokersDealers, + ServiceStations, + SewingNeedleworkFabricAndPieceGoodsStores, + ShoeRepairHatCleaning, + ShoeStores, + SmallApplianceRepair, + SnowmobileDealers, + SpecialTradeServices, + SpecialtyCleaning, + SportingGoodsStores, + SportingRecreationCamps, + SportsAndRidingApparelStores, + SportsClubsFields, + StampAndCoinStores, + StationaryOfficeSuppliesPrintingAndWritingPaper, + StationeryStoresOfficeAndSchoolSupplyStores, + SwimmingPoolsSales, + TUiTravelGermany, + TailorsAlterations, + TaxPaymentsGovernmentAgencies, + TaxPreparationServices, + TaxicabsLimousines, + TelecommunicationEquipmentAndTelephoneSales, + TelecommunicationServices, + TelegraphServices, + TentAndAwningShops, + TestingLaboratories, + TheatricalTicketAgencies, + Timeshares, + TireRetreadingAndRepair, + TollsBridgeFees, + TouristAttractionsAndExhibits, + TowingServices, + TrailerParksCampgrounds, + TransportationServices, + TravelAgenciesTourOperators, + TruckStopIteration, + TruckUtilityTrailerRentals, + TypesettingPlateMakingAndRelatedServices, + TypewriterStores, + USFederalGovernmentAgenciesOrDepartments, + UniformsCommercialClothing, + UsedMerchandiseAndSecondhandStores, + Utilities, + VarietyStores, + VeterinaryServices, + VideoAmusementGameSupplies, + VideoGameArcades, + VideoTapeRentalStores, + VocationalTradeSchools, + WatchJewelryRepair, + WeldingRepair, + WholesaleClubs, + WigAndToupeeStores, + WiresMoneyOrders, + WomensAccessoryAndSpecialtyShops, + WomensReadyToWearStores, + WreckingAndSalvageYards, + /// An unrecognized value from Stripe. Should not be used as a request parameter. + Unknown, +} +impl IssuingCardholderAuthorizationControlsAllowedCategories { + pub fn as_str(self) -> &'static str { + use IssuingCardholderAuthorizationControlsAllowedCategories::*; + match self { + AcRefrigerationRepair => "ac_refrigeration_repair", + AccountingBookkeepingServices => "accounting_bookkeeping_services", + AdvertisingServices => "advertising_services", + AgriculturalCooperative => "agricultural_cooperative", + AirlinesAirCarriers => "airlines_air_carriers", + AirportsFlyingFields => "airports_flying_fields", + AmbulanceServices => "ambulance_services", + AmusementParksCarnivals => "amusement_parks_carnivals", + AntiqueReproductions => "antique_reproductions", + AntiqueShops => "antique_shops", + Aquariums => "aquariums", + ArchitecturalSurveyingServices => "architectural_surveying_services", + ArtDealersAndGalleries => "art_dealers_and_galleries", + ArtistsSupplyAndCraftShops => "artists_supply_and_craft_shops", + AutoAndHomeSupplyStores => "auto_and_home_supply_stores", + AutoBodyRepairShops => "auto_body_repair_shops", + AutoPaintShops => "auto_paint_shops", + AutoServiceShops => "auto_service_shops", + AutomatedCashDisburse => "automated_cash_disburse", + AutomatedFuelDispensers => "automated_fuel_dispensers", + AutomobileAssociations => "automobile_associations", + AutomotivePartsAndAccessoriesStores => "automotive_parts_and_accessories_stores", + AutomotiveTireStores => "automotive_tire_stores", + BailAndBondPayments => "bail_and_bond_payments", + Bakeries => "bakeries", + BandsOrchestras => "bands_orchestras", + BarberAndBeautyShops => "barber_and_beauty_shops", + BettingCasinoGambling => "betting_casino_gambling", + BicycleShops => "bicycle_shops", + BilliardPoolEstablishments => "billiard_pool_establishments", + BoatDealers => "boat_dealers", + BoatRentalsAndLeases => "boat_rentals_and_leases", + BookStores => "book_stores", + BooksPeriodicalsAndNewspapers => "books_periodicals_and_newspapers", + BowlingAlleys => "bowling_alleys", + BusLines => "bus_lines", + BusinessSecretarialSchools => "business_secretarial_schools", + BuyingShoppingServices => "buying_shopping_services", + CableSatelliteAndOtherPayTelevisionAndRadio => { + "cable_satellite_and_other_pay_television_and_radio" + } + CameraAndPhotographicSupplyStores => "camera_and_photographic_supply_stores", + CandyNutAndConfectioneryStores => "candy_nut_and_confectionery_stores", + CarAndTruckDealersNewUsed => "car_and_truck_dealers_new_used", + CarAndTruckDealersUsedOnly => "car_and_truck_dealers_used_only", + CarRentalAgencies => "car_rental_agencies", + CarWashes => "car_washes", + CarpentryServices => "carpentry_services", + CarpetUpholsteryCleaning => "carpet_upholstery_cleaning", + Caterers => "caterers", + CharitableAndSocialServiceOrganizationsFundraising => { + "charitable_and_social_service_organizations_fundraising" + } + ChemicalsAndAlliedProducts => "chemicals_and_allied_products", + ChildCareServices => "child_care_services", + ChildrensAndInfantsWearStores => "childrens_and_infants_wear_stores", + ChiropodistsPodiatrists => "chiropodists_podiatrists", + Chiropractors => "chiropractors", + CigarStoresAndStands => "cigar_stores_and_stands", + CivicSocialFraternalAssociations => "civic_social_fraternal_associations", + CleaningAndMaintenance => "cleaning_and_maintenance", + ClothingRental => "clothing_rental", + CollegesUniversities => "colleges_universities", + CommercialEquipment => "commercial_equipment", + CommercialFootwear => "commercial_footwear", + CommercialPhotographyArtAndGraphics => "commercial_photography_art_and_graphics", + CommuterTransportAndFerries => "commuter_transport_and_ferries", + ComputerNetworkServices => "computer_network_services", + ComputerProgramming => "computer_programming", + ComputerRepair => "computer_repair", + ComputerSoftwareStores => "computer_software_stores", + ComputersPeripheralsAndSoftware => "computers_peripherals_and_software", + ConcreteWorkServices => "concrete_work_services", + ConstructionMaterials => "construction_materials", + ConsultingPublicRelations => "consulting_public_relations", + CorrespondenceSchools => "correspondence_schools", + CosmeticStores => "cosmetic_stores", + CounselingServices => "counseling_services", + CountryClubs => "country_clubs", + CourierServices => "courier_services", + CourtCosts => "court_costs", + CreditReportingAgencies => "credit_reporting_agencies", + CruiseLines => "cruise_lines", + DairyProductsStores => "dairy_products_stores", + DanceHallStudiosSchools => "dance_hall_studios_schools", + DatingEscortServices => "dating_escort_services", + DentistsOrthodontists => "dentists_orthodontists", + DepartmentStores => "department_stores", + DetectiveAgencies => "detective_agencies", + DigitalGoodsApplications => "digital_goods_applications", + DigitalGoodsGames => "digital_goods_games", + DigitalGoodsLargeVolume => "digital_goods_large_volume", + DigitalGoodsMedia => "digital_goods_media", + DirectMarketingCatalogMerchant => "direct_marketing_catalog_merchant", + DirectMarketingCombinationCatalogAndRetailMerchant => { + "direct_marketing_combination_catalog_and_retail_merchant" + } + DirectMarketingInboundTelemarketing => "direct_marketing_inbound_telemarketing", + DirectMarketingInsuranceServices => "direct_marketing_insurance_services", + DirectMarketingOther => "direct_marketing_other", + DirectMarketingOutboundTelemarketing => "direct_marketing_outbound_telemarketing", + DirectMarketingSubscription => "direct_marketing_subscription", + DirectMarketingTravel => "direct_marketing_travel", + DiscountStores => "discount_stores", + Doctors => "doctors", + DoorToDoorSales => "door_to_door_sales", + DraperyWindowCoveringAndUpholsteryStores => { + "drapery_window_covering_and_upholstery_stores" + } + DrinkingPlaces => "drinking_places", + DrugStoresAndPharmacies => "drug_stores_and_pharmacies", + DrugsDrugProprietariesAndDruggistSundries => { + "drugs_drug_proprietaries_and_druggist_sundries" + } + DryCleaners => "dry_cleaners", + DurableGoods => "durable_goods", + DutyFreeStores => "duty_free_stores", + EatingPlacesRestaurants => "eating_places_restaurants", + EducationalServices => "educational_services", + ElectricRazorStores => "electric_razor_stores", + ElectricVehicleCharging => "electric_vehicle_charging", + ElectricalPartsAndEquipment => "electrical_parts_and_equipment", + ElectricalServices => "electrical_services", + ElectronicsRepairShops => "electronics_repair_shops", + ElectronicsStores => "electronics_stores", + ElementarySecondarySchools => "elementary_secondary_schools", + EmergencyServicesGcasVisaUseOnly => "emergency_services_gcas_visa_use_only", + EmploymentTempAgencies => "employment_temp_agencies", + EquipmentRental => "equipment_rental", + ExterminatingServices => "exterminating_services", + FamilyClothingStores => "family_clothing_stores", + FastFoodRestaurants => "fast_food_restaurants", + FinancialInstitutions => "financial_institutions", + FinesGovernmentAdministrativeEntities => "fines_government_administrative_entities", + FireplaceFireplaceScreensAndAccessoriesStores => { + "fireplace_fireplace_screens_and_accessories_stores" + } + FloorCoveringStores => "floor_covering_stores", + Florists => "florists", + FloristsSuppliesNurseryStockAndFlowers => "florists_supplies_nursery_stock_and_flowers", + FreezerAndLockerMeatProvisioners => "freezer_and_locker_meat_provisioners", + FuelDealersNonAutomotive => "fuel_dealers_non_automotive", + FuneralServicesCrematories => "funeral_services_crematories", + FurnitureHomeFurnishingsAndEquipmentStoresExceptAppliances => { + "furniture_home_furnishings_and_equipment_stores_except_appliances" + } + FurnitureRepairRefinishing => "furniture_repair_refinishing", + FurriersAndFurShops => "furriers_and_fur_shops", + GeneralServices => "general_services", + GiftCardNoveltyAndSouvenirShops => "gift_card_novelty_and_souvenir_shops", + GlassPaintAndWallpaperStores => "glass_paint_and_wallpaper_stores", + GlasswareCrystalStores => "glassware_crystal_stores", + GolfCoursesPublic => "golf_courses_public", + GovernmentLicensedHorseDogRacingUsRegionOnly => { + "government_licensed_horse_dog_racing_us_region_only" + } + GovernmentLicensedOnlineCasionsOnlineGamblingUsRegionOnly => { + "government_licensed_online_casions_online_gambling_us_region_only" + } + GovernmentOwnedLotteriesNonUsRegion => "government_owned_lotteries_non_us_region", + GovernmentOwnedLotteriesUsRegionOnly => "government_owned_lotteries_us_region_only", + GovernmentServices => "government_services", + GroceryStoresSupermarkets => "grocery_stores_supermarkets", + HardwareEquipmentAndSupplies => "hardware_equipment_and_supplies", + HardwareStores => "hardware_stores", + HealthAndBeautySpas => "health_and_beauty_spas", + HearingAidsSalesAndSupplies => "hearing_aids_sales_and_supplies", + HeatingPlumbingAC => "heating_plumbing_a_c", + HobbyToyAndGameShops => "hobby_toy_and_game_shops", + HomeSupplyWarehouseStores => "home_supply_warehouse_stores", + Hospitals => "hospitals", + HotelsMotelsAndResorts => "hotels_motels_and_resorts", + HouseholdApplianceStores => "household_appliance_stores", + IndustrialSupplies => "industrial_supplies", + InformationRetrievalServices => "information_retrieval_services", + InsuranceDefault => "insurance_default", + InsuranceUnderwritingPremiums => "insurance_underwriting_premiums", + IntraCompanyPurchases => "intra_company_purchases", + JewelryStoresWatchesClocksAndSilverwareStores => { + "jewelry_stores_watches_clocks_and_silverware_stores" + } + LandscapingServices => "landscaping_services", + Laundries => "laundries", + LaundryCleaningServices => "laundry_cleaning_services", + LegalServicesAttorneys => "legal_services_attorneys", + LuggageAndLeatherGoodsStores => "luggage_and_leather_goods_stores", + LumberBuildingMaterialsStores => "lumber_building_materials_stores", + ManualCashDisburse => "manual_cash_disburse", + MarinasServiceAndSupplies => "marinas_service_and_supplies", + Marketplaces => "marketplaces", + MasonryStoneworkAndPlaster => "masonry_stonework_and_plaster", + MassageParlors => "massage_parlors", + MedicalAndDentalLabs => "medical_and_dental_labs", + MedicalDentalOphthalmicAndHospitalEquipmentAndSupplies => { + "medical_dental_ophthalmic_and_hospital_equipment_and_supplies" + } + MedicalServices => "medical_services", + MembershipOrganizations => "membership_organizations", + MensAndBoysClothingAndAccessoriesStores => { + "mens_and_boys_clothing_and_accessories_stores" + } + MensWomensClothingStores => "mens_womens_clothing_stores", + MetalServiceCenters => "metal_service_centers", + Miscellaneous => "miscellaneous", + MiscellaneousApparelAndAccessoryShops => "miscellaneous_apparel_and_accessory_shops", + MiscellaneousAutoDealers => "miscellaneous_auto_dealers", + MiscellaneousBusinessServices => "miscellaneous_business_services", + MiscellaneousFoodStores => "miscellaneous_food_stores", + MiscellaneousGeneralMerchandise => "miscellaneous_general_merchandise", + MiscellaneousGeneralServices => "miscellaneous_general_services", + MiscellaneousHomeFurnishingSpecialtyStores => { + "miscellaneous_home_furnishing_specialty_stores" + } + MiscellaneousPublishingAndPrinting => "miscellaneous_publishing_and_printing", + MiscellaneousRecreationServices => "miscellaneous_recreation_services", + MiscellaneousRepairShops => "miscellaneous_repair_shops", + MiscellaneousSpecialtyRetail => "miscellaneous_specialty_retail", + MobileHomeDealers => "mobile_home_dealers", + MotionPictureTheaters => "motion_picture_theaters", + MotorFreightCarriersAndTrucking => "motor_freight_carriers_and_trucking", + MotorHomesDealers => "motor_homes_dealers", + MotorVehicleSuppliesAndNewParts => "motor_vehicle_supplies_and_new_parts", + MotorcycleShopsAndDealers => "motorcycle_shops_and_dealers", + MotorcycleShopsDealers => "motorcycle_shops_dealers", + MusicStoresMusicalInstrumentsPianosAndSheetMusic => { + "music_stores_musical_instruments_pianos_and_sheet_music" + } + NewsDealersAndNewsstands => "news_dealers_and_newsstands", + NonFiMoneyOrders => "non_fi_money_orders", + NonFiStoredValueCardPurchaseLoad => "non_fi_stored_value_card_purchase_load", + NondurableGoods => "nondurable_goods", + NurseriesLawnAndGardenSupplyStores => "nurseries_lawn_and_garden_supply_stores", + NursingPersonalCare => "nursing_personal_care", + OfficeAndCommercialFurniture => "office_and_commercial_furniture", + OpticiansEyeglasses => "opticians_eyeglasses", + OptometristsOphthalmologist => "optometrists_ophthalmologist", + OrthopedicGoodsProstheticDevices => "orthopedic_goods_prosthetic_devices", + Osteopaths => "osteopaths", + PackageStoresBeerWineAndLiquor => "package_stores_beer_wine_and_liquor", + PaintsVarnishesAndSupplies => "paints_varnishes_and_supplies", + ParkingLotsGarages => "parking_lots_garages", + PassengerRailways => "passenger_railways", + PawnShops => "pawn_shops", + PetShopsPetFoodAndSupplies => "pet_shops_pet_food_and_supplies", + PetroleumAndPetroleumProducts => "petroleum_and_petroleum_products", + PhotoDeveloping => "photo_developing", + PhotographicPhotocopyMicrofilmEquipmentAndSupplies => { + "photographic_photocopy_microfilm_equipment_and_supplies" + } + PhotographicStudios => "photographic_studios", + PictureVideoProduction => "picture_video_production", + PieceGoodsNotionsAndOtherDryGoods => "piece_goods_notions_and_other_dry_goods", + PlumbingHeatingEquipmentAndSupplies => "plumbing_heating_equipment_and_supplies", + PoliticalOrganizations => "political_organizations", + PostalServicesGovernmentOnly => "postal_services_government_only", + PreciousStonesAndMetalsWatchesAndJewelry => { + "precious_stones_and_metals_watches_and_jewelry" + } + ProfessionalServices => "professional_services", + PublicWarehousingAndStorage => "public_warehousing_and_storage", + QuickCopyReproAndBlueprint => "quick_copy_repro_and_blueprint", + Railroads => "railroads", + RealEstateAgentsAndManagersRentals => "real_estate_agents_and_managers_rentals", + RecordStores => "record_stores", + RecreationalVehicleRentals => "recreational_vehicle_rentals", + ReligiousGoodsStores => "religious_goods_stores", + ReligiousOrganizations => "religious_organizations", + RoofingSidingSheetMetal => "roofing_siding_sheet_metal", + SecretarialSupportServices => "secretarial_support_services", + SecurityBrokersDealers => "security_brokers_dealers", + ServiceStations => "service_stations", + SewingNeedleworkFabricAndPieceGoodsStores => { + "sewing_needlework_fabric_and_piece_goods_stores" + } + ShoeRepairHatCleaning => "shoe_repair_hat_cleaning", + ShoeStores => "shoe_stores", + SmallApplianceRepair => "small_appliance_repair", + SnowmobileDealers => "snowmobile_dealers", + SpecialTradeServices => "special_trade_services", + SpecialtyCleaning => "specialty_cleaning", + SportingGoodsStores => "sporting_goods_stores", + SportingRecreationCamps => "sporting_recreation_camps", + SportsAndRidingApparelStores => "sports_and_riding_apparel_stores", + SportsClubsFields => "sports_clubs_fields", + StampAndCoinStores => "stamp_and_coin_stores", + StationaryOfficeSuppliesPrintingAndWritingPaper => { + "stationary_office_supplies_printing_and_writing_paper" + } + StationeryStoresOfficeAndSchoolSupplyStores => { + "stationery_stores_office_and_school_supply_stores" + } + SwimmingPoolsSales => "swimming_pools_sales", + TUiTravelGermany => "t_ui_travel_germany", + TailorsAlterations => "tailors_alterations", + TaxPaymentsGovernmentAgencies => "tax_payments_government_agencies", + TaxPreparationServices => "tax_preparation_services", + TaxicabsLimousines => "taxicabs_limousines", + TelecommunicationEquipmentAndTelephoneSales => { + "telecommunication_equipment_and_telephone_sales" + } + TelecommunicationServices => "telecommunication_services", + TelegraphServices => "telegraph_services", + TentAndAwningShops => "tent_and_awning_shops", + TestingLaboratories => "testing_laboratories", + TheatricalTicketAgencies => "theatrical_ticket_agencies", + Timeshares => "timeshares", + TireRetreadingAndRepair => "tire_retreading_and_repair", + TollsBridgeFees => "tolls_bridge_fees", + TouristAttractionsAndExhibits => "tourist_attractions_and_exhibits", + TowingServices => "towing_services", + TrailerParksCampgrounds => "trailer_parks_campgrounds", + TransportationServices => "transportation_services", + TravelAgenciesTourOperators => "travel_agencies_tour_operators", + TruckStopIteration => "truck_stop_iteration", + TruckUtilityTrailerRentals => "truck_utility_trailer_rentals", + TypesettingPlateMakingAndRelatedServices => { + "typesetting_plate_making_and_related_services" + } + TypewriterStores => "typewriter_stores", + USFederalGovernmentAgenciesOrDepartments => { + "u_s_federal_government_agencies_or_departments" + } + UniformsCommercialClothing => "uniforms_commercial_clothing", + UsedMerchandiseAndSecondhandStores => "used_merchandise_and_secondhand_stores", + Utilities => "utilities", + VarietyStores => "variety_stores", + VeterinaryServices => "veterinary_services", + VideoAmusementGameSupplies => "video_amusement_game_supplies", + VideoGameArcades => "video_game_arcades", + VideoTapeRentalStores => "video_tape_rental_stores", + VocationalTradeSchools => "vocational_trade_schools", + WatchJewelryRepair => "watch_jewelry_repair", + WeldingRepair => "welding_repair", + WholesaleClubs => "wholesale_clubs", + WigAndToupeeStores => "wig_and_toupee_stores", + WiresMoneyOrders => "wires_money_orders", + WomensAccessoryAndSpecialtyShops => "womens_accessory_and_specialty_shops", + WomensReadyToWearStores => "womens_ready_to_wear_stores", + WreckingAndSalvageYards => "wrecking_and_salvage_yards", + Unknown => "unknown", + } + } +} + +impl std::str::FromStr for IssuingCardholderAuthorizationControlsAllowedCategories { + type Err = (); + fn from_str(s: &str) -> Result { + use IssuingCardholderAuthorizationControlsAllowedCategories::*; + match s { + "ac_refrigeration_repair" => Ok(AcRefrigerationRepair), + "accounting_bookkeeping_services" => Ok(AccountingBookkeepingServices), + "advertising_services" => Ok(AdvertisingServices), + "agricultural_cooperative" => Ok(AgriculturalCooperative), + "airlines_air_carriers" => Ok(AirlinesAirCarriers), + "airports_flying_fields" => Ok(AirportsFlyingFields), + "ambulance_services" => Ok(AmbulanceServices), + "amusement_parks_carnivals" => Ok(AmusementParksCarnivals), + "antique_reproductions" => Ok(AntiqueReproductions), + "antique_shops" => Ok(AntiqueShops), + "aquariums" => Ok(Aquariums), + "architectural_surveying_services" => Ok(ArchitecturalSurveyingServices), + "art_dealers_and_galleries" => Ok(ArtDealersAndGalleries), + "artists_supply_and_craft_shops" => Ok(ArtistsSupplyAndCraftShops), + "auto_and_home_supply_stores" => Ok(AutoAndHomeSupplyStores), + "auto_body_repair_shops" => Ok(AutoBodyRepairShops), + "auto_paint_shops" => Ok(AutoPaintShops), + "auto_service_shops" => Ok(AutoServiceShops), + "automated_cash_disburse" => Ok(AutomatedCashDisburse), + "automated_fuel_dispensers" => Ok(AutomatedFuelDispensers), + "automobile_associations" => Ok(AutomobileAssociations), + "automotive_parts_and_accessories_stores" => Ok(AutomotivePartsAndAccessoriesStores), + "automotive_tire_stores" => Ok(AutomotiveTireStores), + "bail_and_bond_payments" => Ok(BailAndBondPayments), + "bakeries" => Ok(Bakeries), + "bands_orchestras" => Ok(BandsOrchestras), + "barber_and_beauty_shops" => Ok(BarberAndBeautyShops), + "betting_casino_gambling" => Ok(BettingCasinoGambling), + "bicycle_shops" => Ok(BicycleShops), + "billiard_pool_establishments" => Ok(BilliardPoolEstablishments), + "boat_dealers" => Ok(BoatDealers), + "boat_rentals_and_leases" => Ok(BoatRentalsAndLeases), + "book_stores" => Ok(BookStores), + "books_periodicals_and_newspapers" => Ok(BooksPeriodicalsAndNewspapers), + "bowling_alleys" => Ok(BowlingAlleys), + "bus_lines" => Ok(BusLines), + "business_secretarial_schools" => Ok(BusinessSecretarialSchools), + "buying_shopping_services" => Ok(BuyingShoppingServices), + "cable_satellite_and_other_pay_television_and_radio" => { + Ok(CableSatelliteAndOtherPayTelevisionAndRadio) + } + "camera_and_photographic_supply_stores" => Ok(CameraAndPhotographicSupplyStores), + "candy_nut_and_confectionery_stores" => Ok(CandyNutAndConfectioneryStores), + "car_and_truck_dealers_new_used" => Ok(CarAndTruckDealersNewUsed), + "car_and_truck_dealers_used_only" => Ok(CarAndTruckDealersUsedOnly), + "car_rental_agencies" => Ok(CarRentalAgencies), + "car_washes" => Ok(CarWashes), + "carpentry_services" => Ok(CarpentryServices), + "carpet_upholstery_cleaning" => Ok(CarpetUpholsteryCleaning), + "caterers" => Ok(Caterers), + "charitable_and_social_service_organizations_fundraising" => { + Ok(CharitableAndSocialServiceOrganizationsFundraising) + } + "chemicals_and_allied_products" => Ok(ChemicalsAndAlliedProducts), + "child_care_services" => Ok(ChildCareServices), + "childrens_and_infants_wear_stores" => Ok(ChildrensAndInfantsWearStores), + "chiropodists_podiatrists" => Ok(ChiropodistsPodiatrists), + "chiropractors" => Ok(Chiropractors), + "cigar_stores_and_stands" => Ok(CigarStoresAndStands), + "civic_social_fraternal_associations" => Ok(CivicSocialFraternalAssociations), + "cleaning_and_maintenance" => Ok(CleaningAndMaintenance), + "clothing_rental" => Ok(ClothingRental), + "colleges_universities" => Ok(CollegesUniversities), + "commercial_equipment" => Ok(CommercialEquipment), + "commercial_footwear" => Ok(CommercialFootwear), + "commercial_photography_art_and_graphics" => Ok(CommercialPhotographyArtAndGraphics), + "commuter_transport_and_ferries" => Ok(CommuterTransportAndFerries), + "computer_network_services" => Ok(ComputerNetworkServices), + "computer_programming" => Ok(ComputerProgramming), + "computer_repair" => Ok(ComputerRepair), + "computer_software_stores" => Ok(ComputerSoftwareStores), + "computers_peripherals_and_software" => Ok(ComputersPeripheralsAndSoftware), + "concrete_work_services" => Ok(ConcreteWorkServices), + "construction_materials" => Ok(ConstructionMaterials), + "consulting_public_relations" => Ok(ConsultingPublicRelations), + "correspondence_schools" => Ok(CorrespondenceSchools), + "cosmetic_stores" => Ok(CosmeticStores), + "counseling_services" => Ok(CounselingServices), + "country_clubs" => Ok(CountryClubs), + "courier_services" => Ok(CourierServices), + "court_costs" => Ok(CourtCosts), + "credit_reporting_agencies" => Ok(CreditReportingAgencies), + "cruise_lines" => Ok(CruiseLines), + "dairy_products_stores" => Ok(DairyProductsStores), + "dance_hall_studios_schools" => Ok(DanceHallStudiosSchools), + "dating_escort_services" => Ok(DatingEscortServices), + "dentists_orthodontists" => Ok(DentistsOrthodontists), + "department_stores" => Ok(DepartmentStores), + "detective_agencies" => Ok(DetectiveAgencies), + "digital_goods_applications" => Ok(DigitalGoodsApplications), + "digital_goods_games" => Ok(DigitalGoodsGames), + "digital_goods_large_volume" => Ok(DigitalGoodsLargeVolume), + "digital_goods_media" => Ok(DigitalGoodsMedia), + "direct_marketing_catalog_merchant" => Ok(DirectMarketingCatalogMerchant), + "direct_marketing_combination_catalog_and_retail_merchant" => { + Ok(DirectMarketingCombinationCatalogAndRetailMerchant) + } + "direct_marketing_inbound_telemarketing" => Ok(DirectMarketingInboundTelemarketing), + "direct_marketing_insurance_services" => Ok(DirectMarketingInsuranceServices), + "direct_marketing_other" => Ok(DirectMarketingOther), + "direct_marketing_outbound_telemarketing" => Ok(DirectMarketingOutboundTelemarketing), + "direct_marketing_subscription" => Ok(DirectMarketingSubscription), + "direct_marketing_travel" => Ok(DirectMarketingTravel), + "discount_stores" => Ok(DiscountStores), + "doctors" => Ok(Doctors), + "door_to_door_sales" => Ok(DoorToDoorSales), + "drapery_window_covering_and_upholstery_stores" => { + Ok(DraperyWindowCoveringAndUpholsteryStores) + } + "drinking_places" => Ok(DrinkingPlaces), + "drug_stores_and_pharmacies" => Ok(DrugStoresAndPharmacies), + "drugs_drug_proprietaries_and_druggist_sundries" => { + Ok(DrugsDrugProprietariesAndDruggistSundries) + } + "dry_cleaners" => Ok(DryCleaners), + "durable_goods" => Ok(DurableGoods), + "duty_free_stores" => Ok(DutyFreeStores), + "eating_places_restaurants" => Ok(EatingPlacesRestaurants), + "educational_services" => Ok(EducationalServices), + "electric_razor_stores" => Ok(ElectricRazorStores), + "electric_vehicle_charging" => Ok(ElectricVehicleCharging), + "electrical_parts_and_equipment" => Ok(ElectricalPartsAndEquipment), + "electrical_services" => Ok(ElectricalServices), + "electronics_repair_shops" => Ok(ElectronicsRepairShops), + "electronics_stores" => Ok(ElectronicsStores), + "elementary_secondary_schools" => Ok(ElementarySecondarySchools), + "emergency_services_gcas_visa_use_only" => Ok(EmergencyServicesGcasVisaUseOnly), + "employment_temp_agencies" => Ok(EmploymentTempAgencies), + "equipment_rental" => Ok(EquipmentRental), + "exterminating_services" => Ok(ExterminatingServices), + "family_clothing_stores" => Ok(FamilyClothingStores), + "fast_food_restaurants" => Ok(FastFoodRestaurants), + "financial_institutions" => Ok(FinancialInstitutions), + "fines_government_administrative_entities" => Ok(FinesGovernmentAdministrativeEntities), + "fireplace_fireplace_screens_and_accessories_stores" => { + Ok(FireplaceFireplaceScreensAndAccessoriesStores) + } + "floor_covering_stores" => Ok(FloorCoveringStores), + "florists" => Ok(Florists), + "florists_supplies_nursery_stock_and_flowers" => { + Ok(FloristsSuppliesNurseryStockAndFlowers) + } + "freezer_and_locker_meat_provisioners" => Ok(FreezerAndLockerMeatProvisioners), + "fuel_dealers_non_automotive" => Ok(FuelDealersNonAutomotive), + "funeral_services_crematories" => Ok(FuneralServicesCrematories), + "furniture_home_furnishings_and_equipment_stores_except_appliances" => { + Ok(FurnitureHomeFurnishingsAndEquipmentStoresExceptAppliances) + } + "furniture_repair_refinishing" => Ok(FurnitureRepairRefinishing), + "furriers_and_fur_shops" => Ok(FurriersAndFurShops), + "general_services" => Ok(GeneralServices), + "gift_card_novelty_and_souvenir_shops" => Ok(GiftCardNoveltyAndSouvenirShops), + "glass_paint_and_wallpaper_stores" => Ok(GlassPaintAndWallpaperStores), + "glassware_crystal_stores" => Ok(GlasswareCrystalStores), + "golf_courses_public" => Ok(GolfCoursesPublic), + "government_licensed_horse_dog_racing_us_region_only" => { + Ok(GovernmentLicensedHorseDogRacingUsRegionOnly) + } + "government_licensed_online_casions_online_gambling_us_region_only" => { + Ok(GovernmentLicensedOnlineCasionsOnlineGamblingUsRegionOnly) + } + "government_owned_lotteries_non_us_region" => Ok(GovernmentOwnedLotteriesNonUsRegion), + "government_owned_lotteries_us_region_only" => Ok(GovernmentOwnedLotteriesUsRegionOnly), + "government_services" => Ok(GovernmentServices), + "grocery_stores_supermarkets" => Ok(GroceryStoresSupermarkets), + "hardware_equipment_and_supplies" => Ok(HardwareEquipmentAndSupplies), + "hardware_stores" => Ok(HardwareStores), + "health_and_beauty_spas" => Ok(HealthAndBeautySpas), + "hearing_aids_sales_and_supplies" => Ok(HearingAidsSalesAndSupplies), + "heating_plumbing_a_c" => Ok(HeatingPlumbingAC), + "hobby_toy_and_game_shops" => Ok(HobbyToyAndGameShops), + "home_supply_warehouse_stores" => Ok(HomeSupplyWarehouseStores), + "hospitals" => Ok(Hospitals), + "hotels_motels_and_resorts" => Ok(HotelsMotelsAndResorts), + "household_appliance_stores" => Ok(HouseholdApplianceStores), + "industrial_supplies" => Ok(IndustrialSupplies), + "information_retrieval_services" => Ok(InformationRetrievalServices), + "insurance_default" => Ok(InsuranceDefault), + "insurance_underwriting_premiums" => Ok(InsuranceUnderwritingPremiums), + "intra_company_purchases" => Ok(IntraCompanyPurchases), + "jewelry_stores_watches_clocks_and_silverware_stores" => { + Ok(JewelryStoresWatchesClocksAndSilverwareStores) + } + "landscaping_services" => Ok(LandscapingServices), + "laundries" => Ok(Laundries), + "laundry_cleaning_services" => Ok(LaundryCleaningServices), + "legal_services_attorneys" => Ok(LegalServicesAttorneys), + "luggage_and_leather_goods_stores" => Ok(LuggageAndLeatherGoodsStores), + "lumber_building_materials_stores" => Ok(LumberBuildingMaterialsStores), + "manual_cash_disburse" => Ok(ManualCashDisburse), + "marinas_service_and_supplies" => Ok(MarinasServiceAndSupplies), + "marketplaces" => Ok(Marketplaces), + "masonry_stonework_and_plaster" => Ok(MasonryStoneworkAndPlaster), + "massage_parlors" => Ok(MassageParlors), + "medical_and_dental_labs" => Ok(MedicalAndDentalLabs), + "medical_dental_ophthalmic_and_hospital_equipment_and_supplies" => { + Ok(MedicalDentalOphthalmicAndHospitalEquipmentAndSupplies) + } + "medical_services" => Ok(MedicalServices), + "membership_organizations" => Ok(MembershipOrganizations), + "mens_and_boys_clothing_and_accessories_stores" => { + Ok(MensAndBoysClothingAndAccessoriesStores) + } + "mens_womens_clothing_stores" => Ok(MensWomensClothingStores), + "metal_service_centers" => Ok(MetalServiceCenters), + "miscellaneous" => Ok(Miscellaneous), + "miscellaneous_apparel_and_accessory_shops" => { + Ok(MiscellaneousApparelAndAccessoryShops) + } + "miscellaneous_auto_dealers" => Ok(MiscellaneousAutoDealers), + "miscellaneous_business_services" => Ok(MiscellaneousBusinessServices), + "miscellaneous_food_stores" => Ok(MiscellaneousFoodStores), + "miscellaneous_general_merchandise" => Ok(MiscellaneousGeneralMerchandise), + "miscellaneous_general_services" => Ok(MiscellaneousGeneralServices), + "miscellaneous_home_furnishing_specialty_stores" => { + Ok(MiscellaneousHomeFurnishingSpecialtyStores) + } + "miscellaneous_publishing_and_printing" => Ok(MiscellaneousPublishingAndPrinting), + "miscellaneous_recreation_services" => Ok(MiscellaneousRecreationServices), + "miscellaneous_repair_shops" => Ok(MiscellaneousRepairShops), + "miscellaneous_specialty_retail" => Ok(MiscellaneousSpecialtyRetail), + "mobile_home_dealers" => Ok(MobileHomeDealers), + "motion_picture_theaters" => Ok(MotionPictureTheaters), + "motor_freight_carriers_and_trucking" => Ok(MotorFreightCarriersAndTrucking), + "motor_homes_dealers" => Ok(MotorHomesDealers), + "motor_vehicle_supplies_and_new_parts" => Ok(MotorVehicleSuppliesAndNewParts), + "motorcycle_shops_and_dealers" => Ok(MotorcycleShopsAndDealers), + "motorcycle_shops_dealers" => Ok(MotorcycleShopsDealers), + "music_stores_musical_instruments_pianos_and_sheet_music" => { + Ok(MusicStoresMusicalInstrumentsPianosAndSheetMusic) + } + "news_dealers_and_newsstands" => Ok(NewsDealersAndNewsstands), + "non_fi_money_orders" => Ok(NonFiMoneyOrders), + "non_fi_stored_value_card_purchase_load" => Ok(NonFiStoredValueCardPurchaseLoad), + "nondurable_goods" => Ok(NondurableGoods), + "nurseries_lawn_and_garden_supply_stores" => Ok(NurseriesLawnAndGardenSupplyStores), + "nursing_personal_care" => Ok(NursingPersonalCare), + "office_and_commercial_furniture" => Ok(OfficeAndCommercialFurniture), + "opticians_eyeglasses" => Ok(OpticiansEyeglasses), + "optometrists_ophthalmologist" => Ok(OptometristsOphthalmologist), + "orthopedic_goods_prosthetic_devices" => Ok(OrthopedicGoodsProstheticDevices), + "osteopaths" => Ok(Osteopaths), + "package_stores_beer_wine_and_liquor" => Ok(PackageStoresBeerWineAndLiquor), + "paints_varnishes_and_supplies" => Ok(PaintsVarnishesAndSupplies), + "parking_lots_garages" => Ok(ParkingLotsGarages), + "passenger_railways" => Ok(PassengerRailways), + "pawn_shops" => Ok(PawnShops), + "pet_shops_pet_food_and_supplies" => Ok(PetShopsPetFoodAndSupplies), + "petroleum_and_petroleum_products" => Ok(PetroleumAndPetroleumProducts), + "photo_developing" => Ok(PhotoDeveloping), + "photographic_photocopy_microfilm_equipment_and_supplies" => { + Ok(PhotographicPhotocopyMicrofilmEquipmentAndSupplies) + } + "photographic_studios" => Ok(PhotographicStudios), + "picture_video_production" => Ok(PictureVideoProduction), + "piece_goods_notions_and_other_dry_goods" => Ok(PieceGoodsNotionsAndOtherDryGoods), + "plumbing_heating_equipment_and_supplies" => Ok(PlumbingHeatingEquipmentAndSupplies), + "political_organizations" => Ok(PoliticalOrganizations), + "postal_services_government_only" => Ok(PostalServicesGovernmentOnly), + "precious_stones_and_metals_watches_and_jewelry" => { + Ok(PreciousStonesAndMetalsWatchesAndJewelry) + } + "professional_services" => Ok(ProfessionalServices), + "public_warehousing_and_storage" => Ok(PublicWarehousingAndStorage), + "quick_copy_repro_and_blueprint" => Ok(QuickCopyReproAndBlueprint), + "railroads" => Ok(Railroads), + "real_estate_agents_and_managers_rentals" => Ok(RealEstateAgentsAndManagersRentals), + "record_stores" => Ok(RecordStores), + "recreational_vehicle_rentals" => Ok(RecreationalVehicleRentals), + "religious_goods_stores" => Ok(ReligiousGoodsStores), + "religious_organizations" => Ok(ReligiousOrganizations), + "roofing_siding_sheet_metal" => Ok(RoofingSidingSheetMetal), + "secretarial_support_services" => Ok(SecretarialSupportServices), + "security_brokers_dealers" => Ok(SecurityBrokersDealers), + "service_stations" => Ok(ServiceStations), + "sewing_needlework_fabric_and_piece_goods_stores" => { + Ok(SewingNeedleworkFabricAndPieceGoodsStores) + } + "shoe_repair_hat_cleaning" => Ok(ShoeRepairHatCleaning), + "shoe_stores" => Ok(ShoeStores), + "small_appliance_repair" => Ok(SmallApplianceRepair), + "snowmobile_dealers" => Ok(SnowmobileDealers), + "special_trade_services" => Ok(SpecialTradeServices), + "specialty_cleaning" => Ok(SpecialtyCleaning), + "sporting_goods_stores" => Ok(SportingGoodsStores), + "sporting_recreation_camps" => Ok(SportingRecreationCamps), + "sports_and_riding_apparel_stores" => Ok(SportsAndRidingApparelStores), + "sports_clubs_fields" => Ok(SportsClubsFields), + "stamp_and_coin_stores" => Ok(StampAndCoinStores), + "stationary_office_supplies_printing_and_writing_paper" => { + Ok(StationaryOfficeSuppliesPrintingAndWritingPaper) + } + "stationery_stores_office_and_school_supply_stores" => { + Ok(StationeryStoresOfficeAndSchoolSupplyStores) + } + "swimming_pools_sales" => Ok(SwimmingPoolsSales), + "t_ui_travel_germany" => Ok(TUiTravelGermany), + "tailors_alterations" => Ok(TailorsAlterations), + "tax_payments_government_agencies" => Ok(TaxPaymentsGovernmentAgencies), + "tax_preparation_services" => Ok(TaxPreparationServices), + "taxicabs_limousines" => Ok(TaxicabsLimousines), + "telecommunication_equipment_and_telephone_sales" => { + Ok(TelecommunicationEquipmentAndTelephoneSales) + } + "telecommunication_services" => Ok(TelecommunicationServices), + "telegraph_services" => Ok(TelegraphServices), + "tent_and_awning_shops" => Ok(TentAndAwningShops), + "testing_laboratories" => Ok(TestingLaboratories), + "theatrical_ticket_agencies" => Ok(TheatricalTicketAgencies), + "timeshares" => Ok(Timeshares), + "tire_retreading_and_repair" => Ok(TireRetreadingAndRepair), + "tolls_bridge_fees" => Ok(TollsBridgeFees), + "tourist_attractions_and_exhibits" => Ok(TouristAttractionsAndExhibits), + "towing_services" => Ok(TowingServices), + "trailer_parks_campgrounds" => Ok(TrailerParksCampgrounds), + "transportation_services" => Ok(TransportationServices), + "travel_agencies_tour_operators" => Ok(TravelAgenciesTourOperators), + "truck_stop_iteration" => Ok(TruckStopIteration), + "truck_utility_trailer_rentals" => Ok(TruckUtilityTrailerRentals), + "typesetting_plate_making_and_related_services" => { + Ok(TypesettingPlateMakingAndRelatedServices) + } + "typewriter_stores" => Ok(TypewriterStores), + "u_s_federal_government_agencies_or_departments" => { + Ok(USFederalGovernmentAgenciesOrDepartments) + } + "uniforms_commercial_clothing" => Ok(UniformsCommercialClothing), + "used_merchandise_and_secondhand_stores" => Ok(UsedMerchandiseAndSecondhandStores), + "utilities" => Ok(Utilities), + "variety_stores" => Ok(VarietyStores), + "veterinary_services" => Ok(VeterinaryServices), + "video_amusement_game_supplies" => Ok(VideoAmusementGameSupplies), + "video_game_arcades" => Ok(VideoGameArcades), + "video_tape_rental_stores" => Ok(VideoTapeRentalStores), + "vocational_trade_schools" => Ok(VocationalTradeSchools), + "watch_jewelry_repair" => Ok(WatchJewelryRepair), + "welding_repair" => Ok(WeldingRepair), + "wholesale_clubs" => Ok(WholesaleClubs), + "wig_and_toupee_stores" => Ok(WigAndToupeeStores), + "wires_money_orders" => Ok(WiresMoneyOrders), + "womens_accessory_and_specialty_shops" => Ok(WomensAccessoryAndSpecialtyShops), + "womens_ready_to_wear_stores" => Ok(WomensReadyToWearStores), + "wrecking_and_salvage_yards" => Ok(WreckingAndSalvageYards), + _ => Err(()), + } + } +} +impl std::fmt::Display for IssuingCardholderAuthorizationControlsAllowedCategories { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for IssuingCardholderAuthorizationControlsAllowedCategories { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for IssuingCardholderAuthorizationControlsAllowedCategories { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for IssuingCardholderAuthorizationControlsAllowedCategories { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Ok(Self::from_str(&s) + .unwrap_or(IssuingCardholderAuthorizationControlsAllowedCategories::Unknown)) + } +} +/// Array of strings containing [categories](https://stripe.com/docs/api#issuing_authorization_object-merchant_data-category) of authorizations to decline. +/// All other categories will be allowed. +/// Cannot be set with `allowed_categories`. +#[derive(Copy, Clone, Eq, PartialEq)] +#[non_exhaustive] +pub enum IssuingCardholderAuthorizationControlsBlockedCategories { + AcRefrigerationRepair, + AccountingBookkeepingServices, + AdvertisingServices, + AgriculturalCooperative, + AirlinesAirCarriers, + AirportsFlyingFields, + AmbulanceServices, + AmusementParksCarnivals, + AntiqueReproductions, + AntiqueShops, + Aquariums, + ArchitecturalSurveyingServices, + ArtDealersAndGalleries, + ArtistsSupplyAndCraftShops, + AutoAndHomeSupplyStores, + AutoBodyRepairShops, + AutoPaintShops, + AutoServiceShops, + AutomatedCashDisburse, + AutomatedFuelDispensers, + AutomobileAssociations, + AutomotivePartsAndAccessoriesStores, + AutomotiveTireStores, + BailAndBondPayments, + Bakeries, + BandsOrchestras, + BarberAndBeautyShops, + BettingCasinoGambling, + BicycleShops, + BilliardPoolEstablishments, + BoatDealers, + BoatRentalsAndLeases, + BookStores, + BooksPeriodicalsAndNewspapers, + BowlingAlleys, + BusLines, + BusinessSecretarialSchools, + BuyingShoppingServices, + CableSatelliteAndOtherPayTelevisionAndRadio, + CameraAndPhotographicSupplyStores, + CandyNutAndConfectioneryStores, + CarAndTruckDealersNewUsed, + CarAndTruckDealersUsedOnly, + CarRentalAgencies, + CarWashes, + CarpentryServices, + CarpetUpholsteryCleaning, + Caterers, + CharitableAndSocialServiceOrganizationsFundraising, + ChemicalsAndAlliedProducts, + ChildCareServices, + ChildrensAndInfantsWearStores, + ChiropodistsPodiatrists, + Chiropractors, + CigarStoresAndStands, + CivicSocialFraternalAssociations, + CleaningAndMaintenance, + ClothingRental, + CollegesUniversities, + CommercialEquipment, + CommercialFootwear, + CommercialPhotographyArtAndGraphics, + CommuterTransportAndFerries, + ComputerNetworkServices, + ComputerProgramming, + ComputerRepair, + ComputerSoftwareStores, + ComputersPeripheralsAndSoftware, + ConcreteWorkServices, + ConstructionMaterials, + ConsultingPublicRelations, + CorrespondenceSchools, + CosmeticStores, + CounselingServices, + CountryClubs, + CourierServices, + CourtCosts, + CreditReportingAgencies, + CruiseLines, + DairyProductsStores, + DanceHallStudiosSchools, + DatingEscortServices, + DentistsOrthodontists, + DepartmentStores, + DetectiveAgencies, + DigitalGoodsApplications, + DigitalGoodsGames, + DigitalGoodsLargeVolume, + DigitalGoodsMedia, + DirectMarketingCatalogMerchant, + DirectMarketingCombinationCatalogAndRetailMerchant, + DirectMarketingInboundTelemarketing, + DirectMarketingInsuranceServices, + DirectMarketingOther, + DirectMarketingOutboundTelemarketing, + DirectMarketingSubscription, + DirectMarketingTravel, + DiscountStores, + Doctors, + DoorToDoorSales, + DraperyWindowCoveringAndUpholsteryStores, + DrinkingPlaces, + DrugStoresAndPharmacies, + DrugsDrugProprietariesAndDruggistSundries, + DryCleaners, + DurableGoods, + DutyFreeStores, + EatingPlacesRestaurants, + EducationalServices, + ElectricRazorStores, + ElectricVehicleCharging, + ElectricalPartsAndEquipment, + ElectricalServices, + ElectronicsRepairShops, + ElectronicsStores, + ElementarySecondarySchools, + EmergencyServicesGcasVisaUseOnly, + EmploymentTempAgencies, + EquipmentRental, + ExterminatingServices, + FamilyClothingStores, + FastFoodRestaurants, + FinancialInstitutions, + FinesGovernmentAdministrativeEntities, + FireplaceFireplaceScreensAndAccessoriesStores, + FloorCoveringStores, + Florists, + FloristsSuppliesNurseryStockAndFlowers, + FreezerAndLockerMeatProvisioners, + FuelDealersNonAutomotive, + FuneralServicesCrematories, + FurnitureHomeFurnishingsAndEquipmentStoresExceptAppliances, + FurnitureRepairRefinishing, + FurriersAndFurShops, + GeneralServices, + GiftCardNoveltyAndSouvenirShops, + GlassPaintAndWallpaperStores, + GlasswareCrystalStores, + GolfCoursesPublic, + GovernmentLicensedHorseDogRacingUsRegionOnly, + GovernmentLicensedOnlineCasionsOnlineGamblingUsRegionOnly, + GovernmentOwnedLotteriesNonUsRegion, + GovernmentOwnedLotteriesUsRegionOnly, + GovernmentServices, + GroceryStoresSupermarkets, + HardwareEquipmentAndSupplies, + HardwareStores, + HealthAndBeautySpas, + HearingAidsSalesAndSupplies, + HeatingPlumbingAC, + HobbyToyAndGameShops, + HomeSupplyWarehouseStores, + Hospitals, + HotelsMotelsAndResorts, + HouseholdApplianceStores, + IndustrialSupplies, + InformationRetrievalServices, + InsuranceDefault, + InsuranceUnderwritingPremiums, + IntraCompanyPurchases, + JewelryStoresWatchesClocksAndSilverwareStores, + LandscapingServices, + Laundries, + LaundryCleaningServices, + LegalServicesAttorneys, + LuggageAndLeatherGoodsStores, + LumberBuildingMaterialsStores, + ManualCashDisburse, + MarinasServiceAndSupplies, + Marketplaces, + MasonryStoneworkAndPlaster, + MassageParlors, + MedicalAndDentalLabs, + MedicalDentalOphthalmicAndHospitalEquipmentAndSupplies, + MedicalServices, + MembershipOrganizations, + MensAndBoysClothingAndAccessoriesStores, + MensWomensClothingStores, + MetalServiceCenters, + Miscellaneous, + MiscellaneousApparelAndAccessoryShops, + MiscellaneousAutoDealers, + MiscellaneousBusinessServices, + MiscellaneousFoodStores, + MiscellaneousGeneralMerchandise, + MiscellaneousGeneralServices, + MiscellaneousHomeFurnishingSpecialtyStores, + MiscellaneousPublishingAndPrinting, + MiscellaneousRecreationServices, + MiscellaneousRepairShops, + MiscellaneousSpecialtyRetail, + MobileHomeDealers, + MotionPictureTheaters, + MotorFreightCarriersAndTrucking, + MotorHomesDealers, + MotorVehicleSuppliesAndNewParts, + MotorcycleShopsAndDealers, + MotorcycleShopsDealers, + MusicStoresMusicalInstrumentsPianosAndSheetMusic, + NewsDealersAndNewsstands, + NonFiMoneyOrders, + NonFiStoredValueCardPurchaseLoad, + NondurableGoods, + NurseriesLawnAndGardenSupplyStores, + NursingPersonalCare, + OfficeAndCommercialFurniture, + OpticiansEyeglasses, + OptometristsOphthalmologist, + OrthopedicGoodsProstheticDevices, + Osteopaths, + PackageStoresBeerWineAndLiquor, + PaintsVarnishesAndSupplies, + ParkingLotsGarages, + PassengerRailways, + PawnShops, + PetShopsPetFoodAndSupplies, + PetroleumAndPetroleumProducts, + PhotoDeveloping, + PhotographicPhotocopyMicrofilmEquipmentAndSupplies, + PhotographicStudios, + PictureVideoProduction, + PieceGoodsNotionsAndOtherDryGoods, + PlumbingHeatingEquipmentAndSupplies, + PoliticalOrganizations, + PostalServicesGovernmentOnly, + PreciousStonesAndMetalsWatchesAndJewelry, + ProfessionalServices, + PublicWarehousingAndStorage, + QuickCopyReproAndBlueprint, + Railroads, + RealEstateAgentsAndManagersRentals, + RecordStores, + RecreationalVehicleRentals, + ReligiousGoodsStores, + ReligiousOrganizations, + RoofingSidingSheetMetal, + SecretarialSupportServices, + SecurityBrokersDealers, + ServiceStations, + SewingNeedleworkFabricAndPieceGoodsStores, + ShoeRepairHatCleaning, + ShoeStores, + SmallApplianceRepair, + SnowmobileDealers, + SpecialTradeServices, + SpecialtyCleaning, + SportingGoodsStores, + SportingRecreationCamps, + SportsAndRidingApparelStores, + SportsClubsFields, + StampAndCoinStores, + StationaryOfficeSuppliesPrintingAndWritingPaper, + StationeryStoresOfficeAndSchoolSupplyStores, + SwimmingPoolsSales, + TUiTravelGermany, + TailorsAlterations, + TaxPaymentsGovernmentAgencies, + TaxPreparationServices, + TaxicabsLimousines, + TelecommunicationEquipmentAndTelephoneSales, + TelecommunicationServices, + TelegraphServices, + TentAndAwningShops, + TestingLaboratories, + TheatricalTicketAgencies, + Timeshares, + TireRetreadingAndRepair, + TollsBridgeFees, + TouristAttractionsAndExhibits, + TowingServices, + TrailerParksCampgrounds, + TransportationServices, + TravelAgenciesTourOperators, + TruckStopIteration, + TruckUtilityTrailerRentals, + TypesettingPlateMakingAndRelatedServices, + TypewriterStores, + USFederalGovernmentAgenciesOrDepartments, + UniformsCommercialClothing, + UsedMerchandiseAndSecondhandStores, + Utilities, + VarietyStores, + VeterinaryServices, + VideoAmusementGameSupplies, + VideoGameArcades, + VideoTapeRentalStores, + VocationalTradeSchools, + WatchJewelryRepair, + WeldingRepair, + WholesaleClubs, + WigAndToupeeStores, + WiresMoneyOrders, + WomensAccessoryAndSpecialtyShops, + WomensReadyToWearStores, + WreckingAndSalvageYards, + /// An unrecognized value from Stripe. Should not be used as a request parameter. + Unknown, +} +impl IssuingCardholderAuthorizationControlsBlockedCategories { + pub fn as_str(self) -> &'static str { + use IssuingCardholderAuthorizationControlsBlockedCategories::*; + match self { + AcRefrigerationRepair => "ac_refrigeration_repair", + AccountingBookkeepingServices => "accounting_bookkeeping_services", + AdvertisingServices => "advertising_services", + AgriculturalCooperative => "agricultural_cooperative", + AirlinesAirCarriers => "airlines_air_carriers", + AirportsFlyingFields => "airports_flying_fields", + AmbulanceServices => "ambulance_services", + AmusementParksCarnivals => "amusement_parks_carnivals", + AntiqueReproductions => "antique_reproductions", + AntiqueShops => "antique_shops", + Aquariums => "aquariums", + ArchitecturalSurveyingServices => "architectural_surveying_services", + ArtDealersAndGalleries => "art_dealers_and_galleries", + ArtistsSupplyAndCraftShops => "artists_supply_and_craft_shops", + AutoAndHomeSupplyStores => "auto_and_home_supply_stores", + AutoBodyRepairShops => "auto_body_repair_shops", + AutoPaintShops => "auto_paint_shops", + AutoServiceShops => "auto_service_shops", + AutomatedCashDisburse => "automated_cash_disburse", + AutomatedFuelDispensers => "automated_fuel_dispensers", + AutomobileAssociations => "automobile_associations", + AutomotivePartsAndAccessoriesStores => "automotive_parts_and_accessories_stores", + AutomotiveTireStores => "automotive_tire_stores", + BailAndBondPayments => "bail_and_bond_payments", + Bakeries => "bakeries", + BandsOrchestras => "bands_orchestras", + BarberAndBeautyShops => "barber_and_beauty_shops", + BettingCasinoGambling => "betting_casino_gambling", + BicycleShops => "bicycle_shops", + BilliardPoolEstablishments => "billiard_pool_establishments", + BoatDealers => "boat_dealers", + BoatRentalsAndLeases => "boat_rentals_and_leases", + BookStores => "book_stores", + BooksPeriodicalsAndNewspapers => "books_periodicals_and_newspapers", + BowlingAlleys => "bowling_alleys", + BusLines => "bus_lines", + BusinessSecretarialSchools => "business_secretarial_schools", + BuyingShoppingServices => "buying_shopping_services", + CableSatelliteAndOtherPayTelevisionAndRadio => { + "cable_satellite_and_other_pay_television_and_radio" + } + CameraAndPhotographicSupplyStores => "camera_and_photographic_supply_stores", + CandyNutAndConfectioneryStores => "candy_nut_and_confectionery_stores", + CarAndTruckDealersNewUsed => "car_and_truck_dealers_new_used", + CarAndTruckDealersUsedOnly => "car_and_truck_dealers_used_only", + CarRentalAgencies => "car_rental_agencies", + CarWashes => "car_washes", + CarpentryServices => "carpentry_services", + CarpetUpholsteryCleaning => "carpet_upholstery_cleaning", + Caterers => "caterers", + CharitableAndSocialServiceOrganizationsFundraising => { + "charitable_and_social_service_organizations_fundraising" + } + ChemicalsAndAlliedProducts => "chemicals_and_allied_products", + ChildCareServices => "child_care_services", + ChildrensAndInfantsWearStores => "childrens_and_infants_wear_stores", + ChiropodistsPodiatrists => "chiropodists_podiatrists", + Chiropractors => "chiropractors", + CigarStoresAndStands => "cigar_stores_and_stands", + CivicSocialFraternalAssociations => "civic_social_fraternal_associations", + CleaningAndMaintenance => "cleaning_and_maintenance", + ClothingRental => "clothing_rental", + CollegesUniversities => "colleges_universities", + CommercialEquipment => "commercial_equipment", + CommercialFootwear => "commercial_footwear", + CommercialPhotographyArtAndGraphics => "commercial_photography_art_and_graphics", + CommuterTransportAndFerries => "commuter_transport_and_ferries", + ComputerNetworkServices => "computer_network_services", + ComputerProgramming => "computer_programming", + ComputerRepair => "computer_repair", + ComputerSoftwareStores => "computer_software_stores", + ComputersPeripheralsAndSoftware => "computers_peripherals_and_software", + ConcreteWorkServices => "concrete_work_services", + ConstructionMaterials => "construction_materials", + ConsultingPublicRelations => "consulting_public_relations", + CorrespondenceSchools => "correspondence_schools", + CosmeticStores => "cosmetic_stores", + CounselingServices => "counseling_services", + CountryClubs => "country_clubs", + CourierServices => "courier_services", + CourtCosts => "court_costs", + CreditReportingAgencies => "credit_reporting_agencies", + CruiseLines => "cruise_lines", + DairyProductsStores => "dairy_products_stores", + DanceHallStudiosSchools => "dance_hall_studios_schools", + DatingEscortServices => "dating_escort_services", + DentistsOrthodontists => "dentists_orthodontists", + DepartmentStores => "department_stores", + DetectiveAgencies => "detective_agencies", + DigitalGoodsApplications => "digital_goods_applications", + DigitalGoodsGames => "digital_goods_games", + DigitalGoodsLargeVolume => "digital_goods_large_volume", + DigitalGoodsMedia => "digital_goods_media", + DirectMarketingCatalogMerchant => "direct_marketing_catalog_merchant", + DirectMarketingCombinationCatalogAndRetailMerchant => { + "direct_marketing_combination_catalog_and_retail_merchant" + } + DirectMarketingInboundTelemarketing => "direct_marketing_inbound_telemarketing", + DirectMarketingInsuranceServices => "direct_marketing_insurance_services", + DirectMarketingOther => "direct_marketing_other", + DirectMarketingOutboundTelemarketing => "direct_marketing_outbound_telemarketing", + DirectMarketingSubscription => "direct_marketing_subscription", + DirectMarketingTravel => "direct_marketing_travel", + DiscountStores => "discount_stores", + Doctors => "doctors", + DoorToDoorSales => "door_to_door_sales", + DraperyWindowCoveringAndUpholsteryStores => { + "drapery_window_covering_and_upholstery_stores" + } + DrinkingPlaces => "drinking_places", + DrugStoresAndPharmacies => "drug_stores_and_pharmacies", + DrugsDrugProprietariesAndDruggistSundries => { + "drugs_drug_proprietaries_and_druggist_sundries" + } + DryCleaners => "dry_cleaners", + DurableGoods => "durable_goods", + DutyFreeStores => "duty_free_stores", + EatingPlacesRestaurants => "eating_places_restaurants", + EducationalServices => "educational_services", + ElectricRazorStores => "electric_razor_stores", + ElectricVehicleCharging => "electric_vehicle_charging", + ElectricalPartsAndEquipment => "electrical_parts_and_equipment", + ElectricalServices => "electrical_services", + ElectronicsRepairShops => "electronics_repair_shops", + ElectronicsStores => "electronics_stores", + ElementarySecondarySchools => "elementary_secondary_schools", + EmergencyServicesGcasVisaUseOnly => "emergency_services_gcas_visa_use_only", + EmploymentTempAgencies => "employment_temp_agencies", + EquipmentRental => "equipment_rental", + ExterminatingServices => "exterminating_services", + FamilyClothingStores => "family_clothing_stores", + FastFoodRestaurants => "fast_food_restaurants", + FinancialInstitutions => "financial_institutions", + FinesGovernmentAdministrativeEntities => "fines_government_administrative_entities", + FireplaceFireplaceScreensAndAccessoriesStores => { + "fireplace_fireplace_screens_and_accessories_stores" + } + FloorCoveringStores => "floor_covering_stores", + Florists => "florists", + FloristsSuppliesNurseryStockAndFlowers => "florists_supplies_nursery_stock_and_flowers", + FreezerAndLockerMeatProvisioners => "freezer_and_locker_meat_provisioners", + FuelDealersNonAutomotive => "fuel_dealers_non_automotive", + FuneralServicesCrematories => "funeral_services_crematories", + FurnitureHomeFurnishingsAndEquipmentStoresExceptAppliances => { + "furniture_home_furnishings_and_equipment_stores_except_appliances" + } + FurnitureRepairRefinishing => "furniture_repair_refinishing", + FurriersAndFurShops => "furriers_and_fur_shops", + GeneralServices => "general_services", + GiftCardNoveltyAndSouvenirShops => "gift_card_novelty_and_souvenir_shops", + GlassPaintAndWallpaperStores => "glass_paint_and_wallpaper_stores", + GlasswareCrystalStores => "glassware_crystal_stores", + GolfCoursesPublic => "golf_courses_public", + GovernmentLicensedHorseDogRacingUsRegionOnly => { + "government_licensed_horse_dog_racing_us_region_only" + } + GovernmentLicensedOnlineCasionsOnlineGamblingUsRegionOnly => { + "government_licensed_online_casions_online_gambling_us_region_only" + } + GovernmentOwnedLotteriesNonUsRegion => "government_owned_lotteries_non_us_region", + GovernmentOwnedLotteriesUsRegionOnly => "government_owned_lotteries_us_region_only", + GovernmentServices => "government_services", + GroceryStoresSupermarkets => "grocery_stores_supermarkets", + HardwareEquipmentAndSupplies => "hardware_equipment_and_supplies", + HardwareStores => "hardware_stores", + HealthAndBeautySpas => "health_and_beauty_spas", + HearingAidsSalesAndSupplies => "hearing_aids_sales_and_supplies", + HeatingPlumbingAC => "heating_plumbing_a_c", + HobbyToyAndGameShops => "hobby_toy_and_game_shops", + HomeSupplyWarehouseStores => "home_supply_warehouse_stores", + Hospitals => "hospitals", + HotelsMotelsAndResorts => "hotels_motels_and_resorts", + HouseholdApplianceStores => "household_appliance_stores", + IndustrialSupplies => "industrial_supplies", + InformationRetrievalServices => "information_retrieval_services", + InsuranceDefault => "insurance_default", + InsuranceUnderwritingPremiums => "insurance_underwriting_premiums", + IntraCompanyPurchases => "intra_company_purchases", + JewelryStoresWatchesClocksAndSilverwareStores => { + "jewelry_stores_watches_clocks_and_silverware_stores" + } + LandscapingServices => "landscaping_services", + Laundries => "laundries", + LaundryCleaningServices => "laundry_cleaning_services", + LegalServicesAttorneys => "legal_services_attorneys", + LuggageAndLeatherGoodsStores => "luggage_and_leather_goods_stores", + LumberBuildingMaterialsStores => "lumber_building_materials_stores", + ManualCashDisburse => "manual_cash_disburse", + MarinasServiceAndSupplies => "marinas_service_and_supplies", + Marketplaces => "marketplaces", + MasonryStoneworkAndPlaster => "masonry_stonework_and_plaster", + MassageParlors => "massage_parlors", + MedicalAndDentalLabs => "medical_and_dental_labs", + MedicalDentalOphthalmicAndHospitalEquipmentAndSupplies => { + "medical_dental_ophthalmic_and_hospital_equipment_and_supplies" + } + MedicalServices => "medical_services", + MembershipOrganizations => "membership_organizations", + MensAndBoysClothingAndAccessoriesStores => { + "mens_and_boys_clothing_and_accessories_stores" + } + MensWomensClothingStores => "mens_womens_clothing_stores", + MetalServiceCenters => "metal_service_centers", + Miscellaneous => "miscellaneous", + MiscellaneousApparelAndAccessoryShops => "miscellaneous_apparel_and_accessory_shops", + MiscellaneousAutoDealers => "miscellaneous_auto_dealers", + MiscellaneousBusinessServices => "miscellaneous_business_services", + MiscellaneousFoodStores => "miscellaneous_food_stores", + MiscellaneousGeneralMerchandise => "miscellaneous_general_merchandise", + MiscellaneousGeneralServices => "miscellaneous_general_services", + MiscellaneousHomeFurnishingSpecialtyStores => { + "miscellaneous_home_furnishing_specialty_stores" + } + MiscellaneousPublishingAndPrinting => "miscellaneous_publishing_and_printing", + MiscellaneousRecreationServices => "miscellaneous_recreation_services", + MiscellaneousRepairShops => "miscellaneous_repair_shops", + MiscellaneousSpecialtyRetail => "miscellaneous_specialty_retail", + MobileHomeDealers => "mobile_home_dealers", + MotionPictureTheaters => "motion_picture_theaters", + MotorFreightCarriersAndTrucking => "motor_freight_carriers_and_trucking", + MotorHomesDealers => "motor_homes_dealers", + MotorVehicleSuppliesAndNewParts => "motor_vehicle_supplies_and_new_parts", + MotorcycleShopsAndDealers => "motorcycle_shops_and_dealers", + MotorcycleShopsDealers => "motorcycle_shops_dealers", + MusicStoresMusicalInstrumentsPianosAndSheetMusic => { + "music_stores_musical_instruments_pianos_and_sheet_music" + } + NewsDealersAndNewsstands => "news_dealers_and_newsstands", + NonFiMoneyOrders => "non_fi_money_orders", + NonFiStoredValueCardPurchaseLoad => "non_fi_stored_value_card_purchase_load", + NondurableGoods => "nondurable_goods", + NurseriesLawnAndGardenSupplyStores => "nurseries_lawn_and_garden_supply_stores", + NursingPersonalCare => "nursing_personal_care", + OfficeAndCommercialFurniture => "office_and_commercial_furniture", + OpticiansEyeglasses => "opticians_eyeglasses", + OptometristsOphthalmologist => "optometrists_ophthalmologist", + OrthopedicGoodsProstheticDevices => "orthopedic_goods_prosthetic_devices", + Osteopaths => "osteopaths", + PackageStoresBeerWineAndLiquor => "package_stores_beer_wine_and_liquor", + PaintsVarnishesAndSupplies => "paints_varnishes_and_supplies", + ParkingLotsGarages => "parking_lots_garages", + PassengerRailways => "passenger_railways", + PawnShops => "pawn_shops", + PetShopsPetFoodAndSupplies => "pet_shops_pet_food_and_supplies", + PetroleumAndPetroleumProducts => "petroleum_and_petroleum_products", + PhotoDeveloping => "photo_developing", + PhotographicPhotocopyMicrofilmEquipmentAndSupplies => { + "photographic_photocopy_microfilm_equipment_and_supplies" + } + PhotographicStudios => "photographic_studios", + PictureVideoProduction => "picture_video_production", + PieceGoodsNotionsAndOtherDryGoods => "piece_goods_notions_and_other_dry_goods", + PlumbingHeatingEquipmentAndSupplies => "plumbing_heating_equipment_and_supplies", + PoliticalOrganizations => "political_organizations", + PostalServicesGovernmentOnly => "postal_services_government_only", + PreciousStonesAndMetalsWatchesAndJewelry => { + "precious_stones_and_metals_watches_and_jewelry" + } + ProfessionalServices => "professional_services", + PublicWarehousingAndStorage => "public_warehousing_and_storage", + QuickCopyReproAndBlueprint => "quick_copy_repro_and_blueprint", + Railroads => "railroads", + RealEstateAgentsAndManagersRentals => "real_estate_agents_and_managers_rentals", + RecordStores => "record_stores", + RecreationalVehicleRentals => "recreational_vehicle_rentals", + ReligiousGoodsStores => "religious_goods_stores", + ReligiousOrganizations => "religious_organizations", + RoofingSidingSheetMetal => "roofing_siding_sheet_metal", + SecretarialSupportServices => "secretarial_support_services", + SecurityBrokersDealers => "security_brokers_dealers", + ServiceStations => "service_stations", + SewingNeedleworkFabricAndPieceGoodsStores => { + "sewing_needlework_fabric_and_piece_goods_stores" + } + ShoeRepairHatCleaning => "shoe_repair_hat_cleaning", + ShoeStores => "shoe_stores", + SmallApplianceRepair => "small_appliance_repair", + SnowmobileDealers => "snowmobile_dealers", + SpecialTradeServices => "special_trade_services", + SpecialtyCleaning => "specialty_cleaning", + SportingGoodsStores => "sporting_goods_stores", + SportingRecreationCamps => "sporting_recreation_camps", + SportsAndRidingApparelStores => "sports_and_riding_apparel_stores", + SportsClubsFields => "sports_clubs_fields", + StampAndCoinStores => "stamp_and_coin_stores", + StationaryOfficeSuppliesPrintingAndWritingPaper => { + "stationary_office_supplies_printing_and_writing_paper" + } + StationeryStoresOfficeAndSchoolSupplyStores => { + "stationery_stores_office_and_school_supply_stores" + } + SwimmingPoolsSales => "swimming_pools_sales", + TUiTravelGermany => "t_ui_travel_germany", + TailorsAlterations => "tailors_alterations", + TaxPaymentsGovernmentAgencies => "tax_payments_government_agencies", + TaxPreparationServices => "tax_preparation_services", + TaxicabsLimousines => "taxicabs_limousines", + TelecommunicationEquipmentAndTelephoneSales => { + "telecommunication_equipment_and_telephone_sales" + } + TelecommunicationServices => "telecommunication_services", + TelegraphServices => "telegraph_services", + TentAndAwningShops => "tent_and_awning_shops", + TestingLaboratories => "testing_laboratories", + TheatricalTicketAgencies => "theatrical_ticket_agencies", + Timeshares => "timeshares", + TireRetreadingAndRepair => "tire_retreading_and_repair", + TollsBridgeFees => "tolls_bridge_fees", + TouristAttractionsAndExhibits => "tourist_attractions_and_exhibits", + TowingServices => "towing_services", + TrailerParksCampgrounds => "trailer_parks_campgrounds", + TransportationServices => "transportation_services", + TravelAgenciesTourOperators => "travel_agencies_tour_operators", + TruckStopIteration => "truck_stop_iteration", + TruckUtilityTrailerRentals => "truck_utility_trailer_rentals", + TypesettingPlateMakingAndRelatedServices => { + "typesetting_plate_making_and_related_services" + } + TypewriterStores => "typewriter_stores", + USFederalGovernmentAgenciesOrDepartments => { + "u_s_federal_government_agencies_or_departments" + } + UniformsCommercialClothing => "uniforms_commercial_clothing", + UsedMerchandiseAndSecondhandStores => "used_merchandise_and_secondhand_stores", + Utilities => "utilities", + VarietyStores => "variety_stores", + VeterinaryServices => "veterinary_services", + VideoAmusementGameSupplies => "video_amusement_game_supplies", + VideoGameArcades => "video_game_arcades", + VideoTapeRentalStores => "video_tape_rental_stores", + VocationalTradeSchools => "vocational_trade_schools", + WatchJewelryRepair => "watch_jewelry_repair", + WeldingRepair => "welding_repair", + WholesaleClubs => "wholesale_clubs", + WigAndToupeeStores => "wig_and_toupee_stores", + WiresMoneyOrders => "wires_money_orders", + WomensAccessoryAndSpecialtyShops => "womens_accessory_and_specialty_shops", + WomensReadyToWearStores => "womens_ready_to_wear_stores", + WreckingAndSalvageYards => "wrecking_and_salvage_yards", + Unknown => "unknown", + } + } +} + +impl std::str::FromStr for IssuingCardholderAuthorizationControlsBlockedCategories { + type Err = (); + fn from_str(s: &str) -> Result { + use IssuingCardholderAuthorizationControlsBlockedCategories::*; + match s { + "ac_refrigeration_repair" => Ok(AcRefrigerationRepair), + "accounting_bookkeeping_services" => Ok(AccountingBookkeepingServices), + "advertising_services" => Ok(AdvertisingServices), + "agricultural_cooperative" => Ok(AgriculturalCooperative), + "airlines_air_carriers" => Ok(AirlinesAirCarriers), + "airports_flying_fields" => Ok(AirportsFlyingFields), + "ambulance_services" => Ok(AmbulanceServices), + "amusement_parks_carnivals" => Ok(AmusementParksCarnivals), + "antique_reproductions" => Ok(AntiqueReproductions), + "antique_shops" => Ok(AntiqueShops), + "aquariums" => Ok(Aquariums), + "architectural_surveying_services" => Ok(ArchitecturalSurveyingServices), + "art_dealers_and_galleries" => Ok(ArtDealersAndGalleries), + "artists_supply_and_craft_shops" => Ok(ArtistsSupplyAndCraftShops), + "auto_and_home_supply_stores" => Ok(AutoAndHomeSupplyStores), + "auto_body_repair_shops" => Ok(AutoBodyRepairShops), + "auto_paint_shops" => Ok(AutoPaintShops), + "auto_service_shops" => Ok(AutoServiceShops), + "automated_cash_disburse" => Ok(AutomatedCashDisburse), + "automated_fuel_dispensers" => Ok(AutomatedFuelDispensers), + "automobile_associations" => Ok(AutomobileAssociations), + "automotive_parts_and_accessories_stores" => Ok(AutomotivePartsAndAccessoriesStores), + "automotive_tire_stores" => Ok(AutomotiveTireStores), + "bail_and_bond_payments" => Ok(BailAndBondPayments), + "bakeries" => Ok(Bakeries), + "bands_orchestras" => Ok(BandsOrchestras), + "barber_and_beauty_shops" => Ok(BarberAndBeautyShops), + "betting_casino_gambling" => Ok(BettingCasinoGambling), + "bicycle_shops" => Ok(BicycleShops), + "billiard_pool_establishments" => Ok(BilliardPoolEstablishments), + "boat_dealers" => Ok(BoatDealers), + "boat_rentals_and_leases" => Ok(BoatRentalsAndLeases), + "book_stores" => Ok(BookStores), + "books_periodicals_and_newspapers" => Ok(BooksPeriodicalsAndNewspapers), + "bowling_alleys" => Ok(BowlingAlleys), + "bus_lines" => Ok(BusLines), + "business_secretarial_schools" => Ok(BusinessSecretarialSchools), + "buying_shopping_services" => Ok(BuyingShoppingServices), + "cable_satellite_and_other_pay_television_and_radio" => { + Ok(CableSatelliteAndOtherPayTelevisionAndRadio) + } + "camera_and_photographic_supply_stores" => Ok(CameraAndPhotographicSupplyStores), + "candy_nut_and_confectionery_stores" => Ok(CandyNutAndConfectioneryStores), + "car_and_truck_dealers_new_used" => Ok(CarAndTruckDealersNewUsed), + "car_and_truck_dealers_used_only" => Ok(CarAndTruckDealersUsedOnly), + "car_rental_agencies" => Ok(CarRentalAgencies), + "car_washes" => Ok(CarWashes), + "carpentry_services" => Ok(CarpentryServices), + "carpet_upholstery_cleaning" => Ok(CarpetUpholsteryCleaning), + "caterers" => Ok(Caterers), + "charitable_and_social_service_organizations_fundraising" => { + Ok(CharitableAndSocialServiceOrganizationsFundraising) + } + "chemicals_and_allied_products" => Ok(ChemicalsAndAlliedProducts), + "child_care_services" => Ok(ChildCareServices), + "childrens_and_infants_wear_stores" => Ok(ChildrensAndInfantsWearStores), + "chiropodists_podiatrists" => Ok(ChiropodistsPodiatrists), + "chiropractors" => Ok(Chiropractors), + "cigar_stores_and_stands" => Ok(CigarStoresAndStands), + "civic_social_fraternal_associations" => Ok(CivicSocialFraternalAssociations), + "cleaning_and_maintenance" => Ok(CleaningAndMaintenance), + "clothing_rental" => Ok(ClothingRental), + "colleges_universities" => Ok(CollegesUniversities), + "commercial_equipment" => Ok(CommercialEquipment), + "commercial_footwear" => Ok(CommercialFootwear), + "commercial_photography_art_and_graphics" => Ok(CommercialPhotographyArtAndGraphics), + "commuter_transport_and_ferries" => Ok(CommuterTransportAndFerries), + "computer_network_services" => Ok(ComputerNetworkServices), + "computer_programming" => Ok(ComputerProgramming), + "computer_repair" => Ok(ComputerRepair), + "computer_software_stores" => Ok(ComputerSoftwareStores), + "computers_peripherals_and_software" => Ok(ComputersPeripheralsAndSoftware), + "concrete_work_services" => Ok(ConcreteWorkServices), + "construction_materials" => Ok(ConstructionMaterials), + "consulting_public_relations" => Ok(ConsultingPublicRelations), + "correspondence_schools" => Ok(CorrespondenceSchools), + "cosmetic_stores" => Ok(CosmeticStores), + "counseling_services" => Ok(CounselingServices), + "country_clubs" => Ok(CountryClubs), + "courier_services" => Ok(CourierServices), + "court_costs" => Ok(CourtCosts), + "credit_reporting_agencies" => Ok(CreditReportingAgencies), + "cruise_lines" => Ok(CruiseLines), + "dairy_products_stores" => Ok(DairyProductsStores), + "dance_hall_studios_schools" => Ok(DanceHallStudiosSchools), + "dating_escort_services" => Ok(DatingEscortServices), + "dentists_orthodontists" => Ok(DentistsOrthodontists), + "department_stores" => Ok(DepartmentStores), + "detective_agencies" => Ok(DetectiveAgencies), + "digital_goods_applications" => Ok(DigitalGoodsApplications), + "digital_goods_games" => Ok(DigitalGoodsGames), + "digital_goods_large_volume" => Ok(DigitalGoodsLargeVolume), + "digital_goods_media" => Ok(DigitalGoodsMedia), + "direct_marketing_catalog_merchant" => Ok(DirectMarketingCatalogMerchant), + "direct_marketing_combination_catalog_and_retail_merchant" => { + Ok(DirectMarketingCombinationCatalogAndRetailMerchant) + } + "direct_marketing_inbound_telemarketing" => Ok(DirectMarketingInboundTelemarketing), + "direct_marketing_insurance_services" => Ok(DirectMarketingInsuranceServices), + "direct_marketing_other" => Ok(DirectMarketingOther), + "direct_marketing_outbound_telemarketing" => Ok(DirectMarketingOutboundTelemarketing), + "direct_marketing_subscription" => Ok(DirectMarketingSubscription), + "direct_marketing_travel" => Ok(DirectMarketingTravel), + "discount_stores" => Ok(DiscountStores), + "doctors" => Ok(Doctors), + "door_to_door_sales" => Ok(DoorToDoorSales), + "drapery_window_covering_and_upholstery_stores" => { + Ok(DraperyWindowCoveringAndUpholsteryStores) + } + "drinking_places" => Ok(DrinkingPlaces), + "drug_stores_and_pharmacies" => Ok(DrugStoresAndPharmacies), + "drugs_drug_proprietaries_and_druggist_sundries" => { + Ok(DrugsDrugProprietariesAndDruggistSundries) + } + "dry_cleaners" => Ok(DryCleaners), + "durable_goods" => Ok(DurableGoods), + "duty_free_stores" => Ok(DutyFreeStores), + "eating_places_restaurants" => Ok(EatingPlacesRestaurants), + "educational_services" => Ok(EducationalServices), + "electric_razor_stores" => Ok(ElectricRazorStores), + "electric_vehicle_charging" => Ok(ElectricVehicleCharging), + "electrical_parts_and_equipment" => Ok(ElectricalPartsAndEquipment), + "electrical_services" => Ok(ElectricalServices), + "electronics_repair_shops" => Ok(ElectronicsRepairShops), + "electronics_stores" => Ok(ElectronicsStores), + "elementary_secondary_schools" => Ok(ElementarySecondarySchools), + "emergency_services_gcas_visa_use_only" => Ok(EmergencyServicesGcasVisaUseOnly), + "employment_temp_agencies" => Ok(EmploymentTempAgencies), + "equipment_rental" => Ok(EquipmentRental), + "exterminating_services" => Ok(ExterminatingServices), + "family_clothing_stores" => Ok(FamilyClothingStores), + "fast_food_restaurants" => Ok(FastFoodRestaurants), + "financial_institutions" => Ok(FinancialInstitutions), + "fines_government_administrative_entities" => Ok(FinesGovernmentAdministrativeEntities), + "fireplace_fireplace_screens_and_accessories_stores" => { + Ok(FireplaceFireplaceScreensAndAccessoriesStores) + } + "floor_covering_stores" => Ok(FloorCoveringStores), + "florists" => Ok(Florists), + "florists_supplies_nursery_stock_and_flowers" => { + Ok(FloristsSuppliesNurseryStockAndFlowers) + } + "freezer_and_locker_meat_provisioners" => Ok(FreezerAndLockerMeatProvisioners), + "fuel_dealers_non_automotive" => Ok(FuelDealersNonAutomotive), + "funeral_services_crematories" => Ok(FuneralServicesCrematories), + "furniture_home_furnishings_and_equipment_stores_except_appliances" => { + Ok(FurnitureHomeFurnishingsAndEquipmentStoresExceptAppliances) + } + "furniture_repair_refinishing" => Ok(FurnitureRepairRefinishing), + "furriers_and_fur_shops" => Ok(FurriersAndFurShops), + "general_services" => Ok(GeneralServices), + "gift_card_novelty_and_souvenir_shops" => Ok(GiftCardNoveltyAndSouvenirShops), + "glass_paint_and_wallpaper_stores" => Ok(GlassPaintAndWallpaperStores), + "glassware_crystal_stores" => Ok(GlasswareCrystalStores), + "golf_courses_public" => Ok(GolfCoursesPublic), + "government_licensed_horse_dog_racing_us_region_only" => { + Ok(GovernmentLicensedHorseDogRacingUsRegionOnly) + } + "government_licensed_online_casions_online_gambling_us_region_only" => { + Ok(GovernmentLicensedOnlineCasionsOnlineGamblingUsRegionOnly) + } + "government_owned_lotteries_non_us_region" => Ok(GovernmentOwnedLotteriesNonUsRegion), + "government_owned_lotteries_us_region_only" => Ok(GovernmentOwnedLotteriesUsRegionOnly), + "government_services" => Ok(GovernmentServices), + "grocery_stores_supermarkets" => Ok(GroceryStoresSupermarkets), + "hardware_equipment_and_supplies" => Ok(HardwareEquipmentAndSupplies), + "hardware_stores" => Ok(HardwareStores), + "health_and_beauty_spas" => Ok(HealthAndBeautySpas), + "hearing_aids_sales_and_supplies" => Ok(HearingAidsSalesAndSupplies), + "heating_plumbing_a_c" => Ok(HeatingPlumbingAC), + "hobby_toy_and_game_shops" => Ok(HobbyToyAndGameShops), + "home_supply_warehouse_stores" => Ok(HomeSupplyWarehouseStores), + "hospitals" => Ok(Hospitals), + "hotels_motels_and_resorts" => Ok(HotelsMotelsAndResorts), + "household_appliance_stores" => Ok(HouseholdApplianceStores), + "industrial_supplies" => Ok(IndustrialSupplies), + "information_retrieval_services" => Ok(InformationRetrievalServices), + "insurance_default" => Ok(InsuranceDefault), + "insurance_underwriting_premiums" => Ok(InsuranceUnderwritingPremiums), + "intra_company_purchases" => Ok(IntraCompanyPurchases), + "jewelry_stores_watches_clocks_and_silverware_stores" => { + Ok(JewelryStoresWatchesClocksAndSilverwareStores) + } + "landscaping_services" => Ok(LandscapingServices), + "laundries" => Ok(Laundries), + "laundry_cleaning_services" => Ok(LaundryCleaningServices), + "legal_services_attorneys" => Ok(LegalServicesAttorneys), + "luggage_and_leather_goods_stores" => Ok(LuggageAndLeatherGoodsStores), + "lumber_building_materials_stores" => Ok(LumberBuildingMaterialsStores), + "manual_cash_disburse" => Ok(ManualCashDisburse), + "marinas_service_and_supplies" => Ok(MarinasServiceAndSupplies), + "marketplaces" => Ok(Marketplaces), + "masonry_stonework_and_plaster" => Ok(MasonryStoneworkAndPlaster), + "massage_parlors" => Ok(MassageParlors), + "medical_and_dental_labs" => Ok(MedicalAndDentalLabs), + "medical_dental_ophthalmic_and_hospital_equipment_and_supplies" => { + Ok(MedicalDentalOphthalmicAndHospitalEquipmentAndSupplies) + } + "medical_services" => Ok(MedicalServices), + "membership_organizations" => Ok(MembershipOrganizations), + "mens_and_boys_clothing_and_accessories_stores" => { + Ok(MensAndBoysClothingAndAccessoriesStores) + } + "mens_womens_clothing_stores" => Ok(MensWomensClothingStores), + "metal_service_centers" => Ok(MetalServiceCenters), + "miscellaneous" => Ok(Miscellaneous), + "miscellaneous_apparel_and_accessory_shops" => { + Ok(MiscellaneousApparelAndAccessoryShops) + } + "miscellaneous_auto_dealers" => Ok(MiscellaneousAutoDealers), + "miscellaneous_business_services" => Ok(MiscellaneousBusinessServices), + "miscellaneous_food_stores" => Ok(MiscellaneousFoodStores), + "miscellaneous_general_merchandise" => Ok(MiscellaneousGeneralMerchandise), + "miscellaneous_general_services" => Ok(MiscellaneousGeneralServices), + "miscellaneous_home_furnishing_specialty_stores" => { + Ok(MiscellaneousHomeFurnishingSpecialtyStores) + } + "miscellaneous_publishing_and_printing" => Ok(MiscellaneousPublishingAndPrinting), + "miscellaneous_recreation_services" => Ok(MiscellaneousRecreationServices), + "miscellaneous_repair_shops" => Ok(MiscellaneousRepairShops), + "miscellaneous_specialty_retail" => Ok(MiscellaneousSpecialtyRetail), + "mobile_home_dealers" => Ok(MobileHomeDealers), + "motion_picture_theaters" => Ok(MotionPictureTheaters), + "motor_freight_carriers_and_trucking" => Ok(MotorFreightCarriersAndTrucking), + "motor_homes_dealers" => Ok(MotorHomesDealers), + "motor_vehicle_supplies_and_new_parts" => Ok(MotorVehicleSuppliesAndNewParts), + "motorcycle_shops_and_dealers" => Ok(MotorcycleShopsAndDealers), + "motorcycle_shops_dealers" => Ok(MotorcycleShopsDealers), + "music_stores_musical_instruments_pianos_and_sheet_music" => { + Ok(MusicStoresMusicalInstrumentsPianosAndSheetMusic) + } + "news_dealers_and_newsstands" => Ok(NewsDealersAndNewsstands), + "non_fi_money_orders" => Ok(NonFiMoneyOrders), + "non_fi_stored_value_card_purchase_load" => Ok(NonFiStoredValueCardPurchaseLoad), + "nondurable_goods" => Ok(NondurableGoods), + "nurseries_lawn_and_garden_supply_stores" => Ok(NurseriesLawnAndGardenSupplyStores), + "nursing_personal_care" => Ok(NursingPersonalCare), + "office_and_commercial_furniture" => Ok(OfficeAndCommercialFurniture), + "opticians_eyeglasses" => Ok(OpticiansEyeglasses), + "optometrists_ophthalmologist" => Ok(OptometristsOphthalmologist), + "orthopedic_goods_prosthetic_devices" => Ok(OrthopedicGoodsProstheticDevices), + "osteopaths" => Ok(Osteopaths), + "package_stores_beer_wine_and_liquor" => Ok(PackageStoresBeerWineAndLiquor), + "paints_varnishes_and_supplies" => Ok(PaintsVarnishesAndSupplies), + "parking_lots_garages" => Ok(ParkingLotsGarages), + "passenger_railways" => Ok(PassengerRailways), + "pawn_shops" => Ok(PawnShops), + "pet_shops_pet_food_and_supplies" => Ok(PetShopsPetFoodAndSupplies), + "petroleum_and_petroleum_products" => Ok(PetroleumAndPetroleumProducts), + "photo_developing" => Ok(PhotoDeveloping), + "photographic_photocopy_microfilm_equipment_and_supplies" => { + Ok(PhotographicPhotocopyMicrofilmEquipmentAndSupplies) + } + "photographic_studios" => Ok(PhotographicStudios), + "picture_video_production" => Ok(PictureVideoProduction), + "piece_goods_notions_and_other_dry_goods" => Ok(PieceGoodsNotionsAndOtherDryGoods), + "plumbing_heating_equipment_and_supplies" => Ok(PlumbingHeatingEquipmentAndSupplies), + "political_organizations" => Ok(PoliticalOrganizations), + "postal_services_government_only" => Ok(PostalServicesGovernmentOnly), + "precious_stones_and_metals_watches_and_jewelry" => { + Ok(PreciousStonesAndMetalsWatchesAndJewelry) + } + "professional_services" => Ok(ProfessionalServices), + "public_warehousing_and_storage" => Ok(PublicWarehousingAndStorage), + "quick_copy_repro_and_blueprint" => Ok(QuickCopyReproAndBlueprint), + "railroads" => Ok(Railroads), + "real_estate_agents_and_managers_rentals" => Ok(RealEstateAgentsAndManagersRentals), + "record_stores" => Ok(RecordStores), + "recreational_vehicle_rentals" => Ok(RecreationalVehicleRentals), + "religious_goods_stores" => Ok(ReligiousGoodsStores), + "religious_organizations" => Ok(ReligiousOrganizations), + "roofing_siding_sheet_metal" => Ok(RoofingSidingSheetMetal), + "secretarial_support_services" => Ok(SecretarialSupportServices), + "security_brokers_dealers" => Ok(SecurityBrokersDealers), + "service_stations" => Ok(ServiceStations), + "sewing_needlework_fabric_and_piece_goods_stores" => { + Ok(SewingNeedleworkFabricAndPieceGoodsStores) + } + "shoe_repair_hat_cleaning" => Ok(ShoeRepairHatCleaning), + "shoe_stores" => Ok(ShoeStores), + "small_appliance_repair" => Ok(SmallApplianceRepair), + "snowmobile_dealers" => Ok(SnowmobileDealers), + "special_trade_services" => Ok(SpecialTradeServices), + "specialty_cleaning" => Ok(SpecialtyCleaning), + "sporting_goods_stores" => Ok(SportingGoodsStores), + "sporting_recreation_camps" => Ok(SportingRecreationCamps), + "sports_and_riding_apparel_stores" => Ok(SportsAndRidingApparelStores), + "sports_clubs_fields" => Ok(SportsClubsFields), + "stamp_and_coin_stores" => Ok(StampAndCoinStores), + "stationary_office_supplies_printing_and_writing_paper" => { + Ok(StationaryOfficeSuppliesPrintingAndWritingPaper) + } + "stationery_stores_office_and_school_supply_stores" => { + Ok(StationeryStoresOfficeAndSchoolSupplyStores) + } + "swimming_pools_sales" => Ok(SwimmingPoolsSales), + "t_ui_travel_germany" => Ok(TUiTravelGermany), + "tailors_alterations" => Ok(TailorsAlterations), + "tax_payments_government_agencies" => Ok(TaxPaymentsGovernmentAgencies), + "tax_preparation_services" => Ok(TaxPreparationServices), + "taxicabs_limousines" => Ok(TaxicabsLimousines), + "telecommunication_equipment_and_telephone_sales" => { + Ok(TelecommunicationEquipmentAndTelephoneSales) + } + "telecommunication_services" => Ok(TelecommunicationServices), + "telegraph_services" => Ok(TelegraphServices), + "tent_and_awning_shops" => Ok(TentAndAwningShops), + "testing_laboratories" => Ok(TestingLaboratories), + "theatrical_ticket_agencies" => Ok(TheatricalTicketAgencies), + "timeshares" => Ok(Timeshares), + "tire_retreading_and_repair" => Ok(TireRetreadingAndRepair), + "tolls_bridge_fees" => Ok(TollsBridgeFees), + "tourist_attractions_and_exhibits" => Ok(TouristAttractionsAndExhibits), + "towing_services" => Ok(TowingServices), + "trailer_parks_campgrounds" => Ok(TrailerParksCampgrounds), + "transportation_services" => Ok(TransportationServices), + "travel_agencies_tour_operators" => Ok(TravelAgenciesTourOperators), + "truck_stop_iteration" => Ok(TruckStopIteration), + "truck_utility_trailer_rentals" => Ok(TruckUtilityTrailerRentals), + "typesetting_plate_making_and_related_services" => { + Ok(TypesettingPlateMakingAndRelatedServices) + } + "typewriter_stores" => Ok(TypewriterStores), + "u_s_federal_government_agencies_or_departments" => { + Ok(USFederalGovernmentAgenciesOrDepartments) + } + "uniforms_commercial_clothing" => Ok(UniformsCommercialClothing), + "used_merchandise_and_secondhand_stores" => Ok(UsedMerchandiseAndSecondhandStores), + "utilities" => Ok(Utilities), + "variety_stores" => Ok(VarietyStores), + "veterinary_services" => Ok(VeterinaryServices), + "video_amusement_game_supplies" => Ok(VideoAmusementGameSupplies), + "video_game_arcades" => Ok(VideoGameArcades), + "video_tape_rental_stores" => Ok(VideoTapeRentalStores), + "vocational_trade_schools" => Ok(VocationalTradeSchools), + "watch_jewelry_repair" => Ok(WatchJewelryRepair), + "welding_repair" => Ok(WeldingRepair), + "wholesale_clubs" => Ok(WholesaleClubs), + "wig_and_toupee_stores" => Ok(WigAndToupeeStores), + "wires_money_orders" => Ok(WiresMoneyOrders), + "womens_accessory_and_specialty_shops" => Ok(WomensAccessoryAndSpecialtyShops), + "womens_ready_to_wear_stores" => Ok(WomensReadyToWearStores), + "wrecking_and_salvage_yards" => Ok(WreckingAndSalvageYards), + _ => Err(()), + } + } +} +impl std::fmt::Display for IssuingCardholderAuthorizationControlsBlockedCategories { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for IssuingCardholderAuthorizationControlsBlockedCategories { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for IssuingCardholderAuthorizationControlsBlockedCategories { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for IssuingCardholderAuthorizationControlsBlockedCategories { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Ok(Self::from_str(&s) + .unwrap_or(IssuingCardholderAuthorizationControlsBlockedCategories::Unknown)) + } +} diff --git a/generated/stripe_shared/src/issuing_cardholder_card_issuing.rs b/generated/stripe_shared/src/issuing_cardholder_card_issuing.rs new file mode 100644 index 000000000..bd905a1c8 --- /dev/null +++ b/generated/stripe_shared/src/issuing_cardholder_card_issuing.rs @@ -0,0 +1,6 @@ +#[derive(Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct IssuingCardholderCardIssuing { + /// Information about cardholder acceptance of Celtic [Authorized User Terms](https://stripe.com/docs/issuing/cards#accept-authorized-user-terms). + /// Required for cards backed by a Celtic program. + pub user_terms_acceptance: Option, +} diff --git a/generated/stripe_shared/src/issuing_cardholder_company.rs b/generated/stripe_shared/src/issuing_cardholder_company.rs new file mode 100644 index 000000000..b6e397d9d --- /dev/null +++ b/generated/stripe_shared/src/issuing_cardholder_company.rs @@ -0,0 +1,5 @@ +#[derive(Copy, Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct IssuingCardholderCompany { + /// Whether the company's business ID number was provided. + pub tax_id_provided: bool, +} diff --git a/generated/stripe_shared/src/issuing_cardholder_id_document.rs b/generated/stripe_shared/src/issuing_cardholder_id_document.rs new file mode 100644 index 000000000..aad29b05d --- /dev/null +++ b/generated/stripe_shared/src/issuing_cardholder_id_document.rs @@ -0,0 +1,7 @@ +#[derive(Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct IssuingCardholderIdDocument { + /// The back of a document returned by a [file upload](https://stripe.com/docs/api#create_file) with a `purpose` value of `identity_document`. + pub back: Option>, + /// The front of a document returned by a [file upload](https://stripe.com/docs/api#create_file) with a `purpose` value of `identity_document`. + pub front: Option>, +} diff --git a/generated/stripe_shared/src/issuing_cardholder_individual.rs b/generated/stripe_shared/src/issuing_cardholder_individual.rs new file mode 100644 index 000000000..e674d554e --- /dev/null +++ b/generated/stripe_shared/src/issuing_cardholder_individual.rs @@ -0,0 +1,18 @@ +#[derive(Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct IssuingCardholderIndividual { + /// Information related to the card_issuing program for this cardholder. + #[serde(skip_serializing_if = "Option::is_none")] + pub card_issuing: Option, + /// The date of birth of this cardholder. + pub dob: Option, + /// The first name of this cardholder. + /// Required before activating Cards. + /// This field cannot contain any numbers, special characters (except periods, commas, hyphens, spaces and apostrophes) or non-latin letters. + pub first_name: Option, + /// The last name of this cardholder. + /// Required before activating Cards. + /// This field cannot contain any numbers, special characters (except periods, commas, hyphens, spaces and apostrophes) or non-latin letters. + pub last_name: Option, + /// Government-issued ID document for this cardholder. + pub verification: Option, +} diff --git a/generated/stripe_shared/src/issuing_cardholder_individual_dob.rs b/generated/stripe_shared/src/issuing_cardholder_individual_dob.rs new file mode 100644 index 000000000..285ff4d68 --- /dev/null +++ b/generated/stripe_shared/src/issuing_cardholder_individual_dob.rs @@ -0,0 +1,9 @@ +#[derive(Copy, Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct IssuingCardholderIndividualDob { + /// The day of birth, between 1 and 31. + pub day: Option, + /// The month of birth, between 1 and 12. + pub month: Option, + /// The four-digit year of birth. + pub year: Option, +} diff --git a/generated/stripe_shared/src/issuing_cardholder_requirements.rs b/generated/stripe_shared/src/issuing_cardholder_requirements.rs new file mode 100644 index 000000000..68ba85718 --- /dev/null +++ b/generated/stripe_shared/src/issuing_cardholder_requirements.rs @@ -0,0 +1,154 @@ +#[derive(Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct IssuingCardholderRequirements { + /// If `disabled_reason` is present, all cards will decline authorizations with `cardholder_verification_required` reason. + pub disabled_reason: Option, + /// Array of fields that need to be collected in order to verify and re-enable the cardholder. + pub past_due: Option>, +} +/// If `disabled_reason` is present, all cards will decline authorizations with `cardholder_verification_required` reason. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum IssuingCardholderRequirementsDisabledReason { + Listed, + RejectedListed, + RequirementsPastDue, + UnderReview, +} +impl IssuingCardholderRequirementsDisabledReason { + pub fn as_str(self) -> &'static str { + use IssuingCardholderRequirementsDisabledReason::*; + match self { + Listed => "listed", + RejectedListed => "rejected.listed", + RequirementsPastDue => "requirements.past_due", + UnderReview => "under_review", + } + } +} + +impl std::str::FromStr for IssuingCardholderRequirementsDisabledReason { + type Err = (); + fn from_str(s: &str) -> Result { + use IssuingCardholderRequirementsDisabledReason::*; + match s { + "listed" => Ok(Listed), + "rejected.listed" => Ok(RejectedListed), + "requirements.past_due" => Ok(RequirementsPastDue), + "under_review" => Ok(UnderReview), + _ => Err(()), + } + } +} +impl std::fmt::Display for IssuingCardholderRequirementsDisabledReason { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for IssuingCardholderRequirementsDisabledReason { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for IssuingCardholderRequirementsDisabledReason { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for IssuingCardholderRequirementsDisabledReason { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| { + serde::de::Error::custom( + "Unknown value for IssuingCardholderRequirementsDisabledReason", + ) + }) + } +} +/// Array of fields that need to be collected in order to verify and re-enable the cardholder. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum IssuingCardholderRequirementsPastDue { + CompanyTaxId, + IndividualCardIssuingUserTermsAcceptanceDate, + IndividualCardIssuingUserTermsAcceptanceIp, + IndividualDobDay, + IndividualDobMonth, + IndividualDobYear, + IndividualFirstName, + IndividualLastName, + IndividualVerificationDocument, +} +impl IssuingCardholderRequirementsPastDue { + pub fn as_str(self) -> &'static str { + use IssuingCardholderRequirementsPastDue::*; + match self { + CompanyTaxId => "company.tax_id", + IndividualCardIssuingUserTermsAcceptanceDate => { + "individual.card_issuing.user_terms_acceptance.date" + } + IndividualCardIssuingUserTermsAcceptanceIp => { + "individual.card_issuing.user_terms_acceptance.ip" + } + IndividualDobDay => "individual.dob.day", + IndividualDobMonth => "individual.dob.month", + IndividualDobYear => "individual.dob.year", + IndividualFirstName => "individual.first_name", + IndividualLastName => "individual.last_name", + IndividualVerificationDocument => "individual.verification.document", + } + } +} + +impl std::str::FromStr for IssuingCardholderRequirementsPastDue { + type Err = (); + fn from_str(s: &str) -> Result { + use IssuingCardholderRequirementsPastDue::*; + match s { + "company.tax_id" => Ok(CompanyTaxId), + "individual.card_issuing.user_terms_acceptance.date" => { + Ok(IndividualCardIssuingUserTermsAcceptanceDate) + } + "individual.card_issuing.user_terms_acceptance.ip" => { + Ok(IndividualCardIssuingUserTermsAcceptanceIp) + } + "individual.dob.day" => Ok(IndividualDobDay), + "individual.dob.month" => Ok(IndividualDobMonth), + "individual.dob.year" => Ok(IndividualDobYear), + "individual.first_name" => Ok(IndividualFirstName), + "individual.last_name" => Ok(IndividualLastName), + "individual.verification.document" => Ok(IndividualVerificationDocument), + _ => Err(()), + } + } +} +impl std::fmt::Display for IssuingCardholderRequirementsPastDue { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for IssuingCardholderRequirementsPastDue { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for IssuingCardholderRequirementsPastDue { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for IssuingCardholderRequirementsPastDue { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| { + serde::de::Error::custom("Unknown value for IssuingCardholderRequirementsPastDue") + }) + } +} diff --git a/generated/stripe_shared/src/issuing_cardholder_spending_limit.rs b/generated/stripe_shared/src/issuing_cardholder_spending_limit.rs new file mode 100644 index 000000000..4ca0340cc --- /dev/null +++ b/generated/stripe_shared/src/issuing_cardholder_spending_limit.rs @@ -0,0 +1,1107 @@ +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct IssuingCardholderSpendingLimit { + /// Maximum amount allowed to spend per interval. + /// This amount is in the card's currency and in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal). + pub amount: i64, + /// Array of strings containing [categories](https://stripe.com/docs/api#issuing_authorization_object-merchant_data-category) this limit applies to. + /// Omitting this field will apply the limit to all categories. + pub categories: Option>, + /// Interval (or event) to which the amount applies. + pub interval: IssuingCardholderSpendingLimitInterval, +} +/// Array of strings containing [categories](https://stripe.com/docs/api#issuing_authorization_object-merchant_data-category) this limit applies to. +/// Omitting this field will apply the limit to all categories. +#[derive(Copy, Clone, Eq, PartialEq)] +#[non_exhaustive] +pub enum IssuingCardholderSpendingLimitCategories { + AcRefrigerationRepair, + AccountingBookkeepingServices, + AdvertisingServices, + AgriculturalCooperative, + AirlinesAirCarriers, + AirportsFlyingFields, + AmbulanceServices, + AmusementParksCarnivals, + AntiqueReproductions, + AntiqueShops, + Aquariums, + ArchitecturalSurveyingServices, + ArtDealersAndGalleries, + ArtistsSupplyAndCraftShops, + AutoAndHomeSupplyStores, + AutoBodyRepairShops, + AutoPaintShops, + AutoServiceShops, + AutomatedCashDisburse, + AutomatedFuelDispensers, + AutomobileAssociations, + AutomotivePartsAndAccessoriesStores, + AutomotiveTireStores, + BailAndBondPayments, + Bakeries, + BandsOrchestras, + BarberAndBeautyShops, + BettingCasinoGambling, + BicycleShops, + BilliardPoolEstablishments, + BoatDealers, + BoatRentalsAndLeases, + BookStores, + BooksPeriodicalsAndNewspapers, + BowlingAlleys, + BusLines, + BusinessSecretarialSchools, + BuyingShoppingServices, + CableSatelliteAndOtherPayTelevisionAndRadio, + CameraAndPhotographicSupplyStores, + CandyNutAndConfectioneryStores, + CarAndTruckDealersNewUsed, + CarAndTruckDealersUsedOnly, + CarRentalAgencies, + CarWashes, + CarpentryServices, + CarpetUpholsteryCleaning, + Caterers, + CharitableAndSocialServiceOrganizationsFundraising, + ChemicalsAndAlliedProducts, + ChildCareServices, + ChildrensAndInfantsWearStores, + ChiropodistsPodiatrists, + Chiropractors, + CigarStoresAndStands, + CivicSocialFraternalAssociations, + CleaningAndMaintenance, + ClothingRental, + CollegesUniversities, + CommercialEquipment, + CommercialFootwear, + CommercialPhotographyArtAndGraphics, + CommuterTransportAndFerries, + ComputerNetworkServices, + ComputerProgramming, + ComputerRepair, + ComputerSoftwareStores, + ComputersPeripheralsAndSoftware, + ConcreteWorkServices, + ConstructionMaterials, + ConsultingPublicRelations, + CorrespondenceSchools, + CosmeticStores, + CounselingServices, + CountryClubs, + CourierServices, + CourtCosts, + CreditReportingAgencies, + CruiseLines, + DairyProductsStores, + DanceHallStudiosSchools, + DatingEscortServices, + DentistsOrthodontists, + DepartmentStores, + DetectiveAgencies, + DigitalGoodsApplications, + DigitalGoodsGames, + DigitalGoodsLargeVolume, + DigitalGoodsMedia, + DirectMarketingCatalogMerchant, + DirectMarketingCombinationCatalogAndRetailMerchant, + DirectMarketingInboundTelemarketing, + DirectMarketingInsuranceServices, + DirectMarketingOther, + DirectMarketingOutboundTelemarketing, + DirectMarketingSubscription, + DirectMarketingTravel, + DiscountStores, + Doctors, + DoorToDoorSales, + DraperyWindowCoveringAndUpholsteryStores, + DrinkingPlaces, + DrugStoresAndPharmacies, + DrugsDrugProprietariesAndDruggistSundries, + DryCleaners, + DurableGoods, + DutyFreeStores, + EatingPlacesRestaurants, + EducationalServices, + ElectricRazorStores, + ElectricVehicleCharging, + ElectricalPartsAndEquipment, + ElectricalServices, + ElectronicsRepairShops, + ElectronicsStores, + ElementarySecondarySchools, + EmergencyServicesGcasVisaUseOnly, + EmploymentTempAgencies, + EquipmentRental, + ExterminatingServices, + FamilyClothingStores, + FastFoodRestaurants, + FinancialInstitutions, + FinesGovernmentAdministrativeEntities, + FireplaceFireplaceScreensAndAccessoriesStores, + FloorCoveringStores, + Florists, + FloristsSuppliesNurseryStockAndFlowers, + FreezerAndLockerMeatProvisioners, + FuelDealersNonAutomotive, + FuneralServicesCrematories, + FurnitureHomeFurnishingsAndEquipmentStoresExceptAppliances, + FurnitureRepairRefinishing, + FurriersAndFurShops, + GeneralServices, + GiftCardNoveltyAndSouvenirShops, + GlassPaintAndWallpaperStores, + GlasswareCrystalStores, + GolfCoursesPublic, + GovernmentLicensedHorseDogRacingUsRegionOnly, + GovernmentLicensedOnlineCasionsOnlineGamblingUsRegionOnly, + GovernmentOwnedLotteriesNonUsRegion, + GovernmentOwnedLotteriesUsRegionOnly, + GovernmentServices, + GroceryStoresSupermarkets, + HardwareEquipmentAndSupplies, + HardwareStores, + HealthAndBeautySpas, + HearingAidsSalesAndSupplies, + HeatingPlumbingAC, + HobbyToyAndGameShops, + HomeSupplyWarehouseStores, + Hospitals, + HotelsMotelsAndResorts, + HouseholdApplianceStores, + IndustrialSupplies, + InformationRetrievalServices, + InsuranceDefault, + InsuranceUnderwritingPremiums, + IntraCompanyPurchases, + JewelryStoresWatchesClocksAndSilverwareStores, + LandscapingServices, + Laundries, + LaundryCleaningServices, + LegalServicesAttorneys, + LuggageAndLeatherGoodsStores, + LumberBuildingMaterialsStores, + ManualCashDisburse, + MarinasServiceAndSupplies, + Marketplaces, + MasonryStoneworkAndPlaster, + MassageParlors, + MedicalAndDentalLabs, + MedicalDentalOphthalmicAndHospitalEquipmentAndSupplies, + MedicalServices, + MembershipOrganizations, + MensAndBoysClothingAndAccessoriesStores, + MensWomensClothingStores, + MetalServiceCenters, + Miscellaneous, + MiscellaneousApparelAndAccessoryShops, + MiscellaneousAutoDealers, + MiscellaneousBusinessServices, + MiscellaneousFoodStores, + MiscellaneousGeneralMerchandise, + MiscellaneousGeneralServices, + MiscellaneousHomeFurnishingSpecialtyStores, + MiscellaneousPublishingAndPrinting, + MiscellaneousRecreationServices, + MiscellaneousRepairShops, + MiscellaneousSpecialtyRetail, + MobileHomeDealers, + MotionPictureTheaters, + MotorFreightCarriersAndTrucking, + MotorHomesDealers, + MotorVehicleSuppliesAndNewParts, + MotorcycleShopsAndDealers, + MotorcycleShopsDealers, + MusicStoresMusicalInstrumentsPianosAndSheetMusic, + NewsDealersAndNewsstands, + NonFiMoneyOrders, + NonFiStoredValueCardPurchaseLoad, + NondurableGoods, + NurseriesLawnAndGardenSupplyStores, + NursingPersonalCare, + OfficeAndCommercialFurniture, + OpticiansEyeglasses, + OptometristsOphthalmologist, + OrthopedicGoodsProstheticDevices, + Osteopaths, + PackageStoresBeerWineAndLiquor, + PaintsVarnishesAndSupplies, + ParkingLotsGarages, + PassengerRailways, + PawnShops, + PetShopsPetFoodAndSupplies, + PetroleumAndPetroleumProducts, + PhotoDeveloping, + PhotographicPhotocopyMicrofilmEquipmentAndSupplies, + PhotographicStudios, + PictureVideoProduction, + PieceGoodsNotionsAndOtherDryGoods, + PlumbingHeatingEquipmentAndSupplies, + PoliticalOrganizations, + PostalServicesGovernmentOnly, + PreciousStonesAndMetalsWatchesAndJewelry, + ProfessionalServices, + PublicWarehousingAndStorage, + QuickCopyReproAndBlueprint, + Railroads, + RealEstateAgentsAndManagersRentals, + RecordStores, + RecreationalVehicleRentals, + ReligiousGoodsStores, + ReligiousOrganizations, + RoofingSidingSheetMetal, + SecretarialSupportServices, + SecurityBrokersDealers, + ServiceStations, + SewingNeedleworkFabricAndPieceGoodsStores, + ShoeRepairHatCleaning, + ShoeStores, + SmallApplianceRepair, + SnowmobileDealers, + SpecialTradeServices, + SpecialtyCleaning, + SportingGoodsStores, + SportingRecreationCamps, + SportsAndRidingApparelStores, + SportsClubsFields, + StampAndCoinStores, + StationaryOfficeSuppliesPrintingAndWritingPaper, + StationeryStoresOfficeAndSchoolSupplyStores, + SwimmingPoolsSales, + TUiTravelGermany, + TailorsAlterations, + TaxPaymentsGovernmentAgencies, + TaxPreparationServices, + TaxicabsLimousines, + TelecommunicationEquipmentAndTelephoneSales, + TelecommunicationServices, + TelegraphServices, + TentAndAwningShops, + TestingLaboratories, + TheatricalTicketAgencies, + Timeshares, + TireRetreadingAndRepair, + TollsBridgeFees, + TouristAttractionsAndExhibits, + TowingServices, + TrailerParksCampgrounds, + TransportationServices, + TravelAgenciesTourOperators, + TruckStopIteration, + TruckUtilityTrailerRentals, + TypesettingPlateMakingAndRelatedServices, + TypewriterStores, + USFederalGovernmentAgenciesOrDepartments, + UniformsCommercialClothing, + UsedMerchandiseAndSecondhandStores, + Utilities, + VarietyStores, + VeterinaryServices, + VideoAmusementGameSupplies, + VideoGameArcades, + VideoTapeRentalStores, + VocationalTradeSchools, + WatchJewelryRepair, + WeldingRepair, + WholesaleClubs, + WigAndToupeeStores, + WiresMoneyOrders, + WomensAccessoryAndSpecialtyShops, + WomensReadyToWearStores, + WreckingAndSalvageYards, + /// An unrecognized value from Stripe. Should not be used as a request parameter. + Unknown, +} +impl IssuingCardholderSpendingLimitCategories { + pub fn as_str(self) -> &'static str { + use IssuingCardholderSpendingLimitCategories::*; + match self { + AcRefrigerationRepair => "ac_refrigeration_repair", + AccountingBookkeepingServices => "accounting_bookkeeping_services", + AdvertisingServices => "advertising_services", + AgriculturalCooperative => "agricultural_cooperative", + AirlinesAirCarriers => "airlines_air_carriers", + AirportsFlyingFields => "airports_flying_fields", + AmbulanceServices => "ambulance_services", + AmusementParksCarnivals => "amusement_parks_carnivals", + AntiqueReproductions => "antique_reproductions", + AntiqueShops => "antique_shops", + Aquariums => "aquariums", + ArchitecturalSurveyingServices => "architectural_surveying_services", + ArtDealersAndGalleries => "art_dealers_and_galleries", + ArtistsSupplyAndCraftShops => "artists_supply_and_craft_shops", + AutoAndHomeSupplyStores => "auto_and_home_supply_stores", + AutoBodyRepairShops => "auto_body_repair_shops", + AutoPaintShops => "auto_paint_shops", + AutoServiceShops => "auto_service_shops", + AutomatedCashDisburse => "automated_cash_disburse", + AutomatedFuelDispensers => "automated_fuel_dispensers", + AutomobileAssociations => "automobile_associations", + AutomotivePartsAndAccessoriesStores => "automotive_parts_and_accessories_stores", + AutomotiveTireStores => "automotive_tire_stores", + BailAndBondPayments => "bail_and_bond_payments", + Bakeries => "bakeries", + BandsOrchestras => "bands_orchestras", + BarberAndBeautyShops => "barber_and_beauty_shops", + BettingCasinoGambling => "betting_casino_gambling", + BicycleShops => "bicycle_shops", + BilliardPoolEstablishments => "billiard_pool_establishments", + BoatDealers => "boat_dealers", + BoatRentalsAndLeases => "boat_rentals_and_leases", + BookStores => "book_stores", + BooksPeriodicalsAndNewspapers => "books_periodicals_and_newspapers", + BowlingAlleys => "bowling_alleys", + BusLines => "bus_lines", + BusinessSecretarialSchools => "business_secretarial_schools", + BuyingShoppingServices => "buying_shopping_services", + CableSatelliteAndOtherPayTelevisionAndRadio => { + "cable_satellite_and_other_pay_television_and_radio" + } + CameraAndPhotographicSupplyStores => "camera_and_photographic_supply_stores", + CandyNutAndConfectioneryStores => "candy_nut_and_confectionery_stores", + CarAndTruckDealersNewUsed => "car_and_truck_dealers_new_used", + CarAndTruckDealersUsedOnly => "car_and_truck_dealers_used_only", + CarRentalAgencies => "car_rental_agencies", + CarWashes => "car_washes", + CarpentryServices => "carpentry_services", + CarpetUpholsteryCleaning => "carpet_upholstery_cleaning", + Caterers => "caterers", + CharitableAndSocialServiceOrganizationsFundraising => { + "charitable_and_social_service_organizations_fundraising" + } + ChemicalsAndAlliedProducts => "chemicals_and_allied_products", + ChildCareServices => "child_care_services", + ChildrensAndInfantsWearStores => "childrens_and_infants_wear_stores", + ChiropodistsPodiatrists => "chiropodists_podiatrists", + Chiropractors => "chiropractors", + CigarStoresAndStands => "cigar_stores_and_stands", + CivicSocialFraternalAssociations => "civic_social_fraternal_associations", + CleaningAndMaintenance => "cleaning_and_maintenance", + ClothingRental => "clothing_rental", + CollegesUniversities => "colleges_universities", + CommercialEquipment => "commercial_equipment", + CommercialFootwear => "commercial_footwear", + CommercialPhotographyArtAndGraphics => "commercial_photography_art_and_graphics", + CommuterTransportAndFerries => "commuter_transport_and_ferries", + ComputerNetworkServices => "computer_network_services", + ComputerProgramming => "computer_programming", + ComputerRepair => "computer_repair", + ComputerSoftwareStores => "computer_software_stores", + ComputersPeripheralsAndSoftware => "computers_peripherals_and_software", + ConcreteWorkServices => "concrete_work_services", + ConstructionMaterials => "construction_materials", + ConsultingPublicRelations => "consulting_public_relations", + CorrespondenceSchools => "correspondence_schools", + CosmeticStores => "cosmetic_stores", + CounselingServices => "counseling_services", + CountryClubs => "country_clubs", + CourierServices => "courier_services", + CourtCosts => "court_costs", + CreditReportingAgencies => "credit_reporting_agencies", + CruiseLines => "cruise_lines", + DairyProductsStores => "dairy_products_stores", + DanceHallStudiosSchools => "dance_hall_studios_schools", + DatingEscortServices => "dating_escort_services", + DentistsOrthodontists => "dentists_orthodontists", + DepartmentStores => "department_stores", + DetectiveAgencies => "detective_agencies", + DigitalGoodsApplications => "digital_goods_applications", + DigitalGoodsGames => "digital_goods_games", + DigitalGoodsLargeVolume => "digital_goods_large_volume", + DigitalGoodsMedia => "digital_goods_media", + DirectMarketingCatalogMerchant => "direct_marketing_catalog_merchant", + DirectMarketingCombinationCatalogAndRetailMerchant => { + "direct_marketing_combination_catalog_and_retail_merchant" + } + DirectMarketingInboundTelemarketing => "direct_marketing_inbound_telemarketing", + DirectMarketingInsuranceServices => "direct_marketing_insurance_services", + DirectMarketingOther => "direct_marketing_other", + DirectMarketingOutboundTelemarketing => "direct_marketing_outbound_telemarketing", + DirectMarketingSubscription => "direct_marketing_subscription", + DirectMarketingTravel => "direct_marketing_travel", + DiscountStores => "discount_stores", + Doctors => "doctors", + DoorToDoorSales => "door_to_door_sales", + DraperyWindowCoveringAndUpholsteryStores => { + "drapery_window_covering_and_upholstery_stores" + } + DrinkingPlaces => "drinking_places", + DrugStoresAndPharmacies => "drug_stores_and_pharmacies", + DrugsDrugProprietariesAndDruggistSundries => { + "drugs_drug_proprietaries_and_druggist_sundries" + } + DryCleaners => "dry_cleaners", + DurableGoods => "durable_goods", + DutyFreeStores => "duty_free_stores", + EatingPlacesRestaurants => "eating_places_restaurants", + EducationalServices => "educational_services", + ElectricRazorStores => "electric_razor_stores", + ElectricVehicleCharging => "electric_vehicle_charging", + ElectricalPartsAndEquipment => "electrical_parts_and_equipment", + ElectricalServices => "electrical_services", + ElectronicsRepairShops => "electronics_repair_shops", + ElectronicsStores => "electronics_stores", + ElementarySecondarySchools => "elementary_secondary_schools", + EmergencyServicesGcasVisaUseOnly => "emergency_services_gcas_visa_use_only", + EmploymentTempAgencies => "employment_temp_agencies", + EquipmentRental => "equipment_rental", + ExterminatingServices => "exterminating_services", + FamilyClothingStores => "family_clothing_stores", + FastFoodRestaurants => "fast_food_restaurants", + FinancialInstitutions => "financial_institutions", + FinesGovernmentAdministrativeEntities => "fines_government_administrative_entities", + FireplaceFireplaceScreensAndAccessoriesStores => { + "fireplace_fireplace_screens_and_accessories_stores" + } + FloorCoveringStores => "floor_covering_stores", + Florists => "florists", + FloristsSuppliesNurseryStockAndFlowers => "florists_supplies_nursery_stock_and_flowers", + FreezerAndLockerMeatProvisioners => "freezer_and_locker_meat_provisioners", + FuelDealersNonAutomotive => "fuel_dealers_non_automotive", + FuneralServicesCrematories => "funeral_services_crematories", + FurnitureHomeFurnishingsAndEquipmentStoresExceptAppliances => { + "furniture_home_furnishings_and_equipment_stores_except_appliances" + } + FurnitureRepairRefinishing => "furniture_repair_refinishing", + FurriersAndFurShops => "furriers_and_fur_shops", + GeneralServices => "general_services", + GiftCardNoveltyAndSouvenirShops => "gift_card_novelty_and_souvenir_shops", + GlassPaintAndWallpaperStores => "glass_paint_and_wallpaper_stores", + GlasswareCrystalStores => "glassware_crystal_stores", + GolfCoursesPublic => "golf_courses_public", + GovernmentLicensedHorseDogRacingUsRegionOnly => { + "government_licensed_horse_dog_racing_us_region_only" + } + GovernmentLicensedOnlineCasionsOnlineGamblingUsRegionOnly => { + "government_licensed_online_casions_online_gambling_us_region_only" + } + GovernmentOwnedLotteriesNonUsRegion => "government_owned_lotteries_non_us_region", + GovernmentOwnedLotteriesUsRegionOnly => "government_owned_lotteries_us_region_only", + GovernmentServices => "government_services", + GroceryStoresSupermarkets => "grocery_stores_supermarkets", + HardwareEquipmentAndSupplies => "hardware_equipment_and_supplies", + HardwareStores => "hardware_stores", + HealthAndBeautySpas => "health_and_beauty_spas", + HearingAidsSalesAndSupplies => "hearing_aids_sales_and_supplies", + HeatingPlumbingAC => "heating_plumbing_a_c", + HobbyToyAndGameShops => "hobby_toy_and_game_shops", + HomeSupplyWarehouseStores => "home_supply_warehouse_stores", + Hospitals => "hospitals", + HotelsMotelsAndResorts => "hotels_motels_and_resorts", + HouseholdApplianceStores => "household_appliance_stores", + IndustrialSupplies => "industrial_supplies", + InformationRetrievalServices => "information_retrieval_services", + InsuranceDefault => "insurance_default", + InsuranceUnderwritingPremiums => "insurance_underwriting_premiums", + IntraCompanyPurchases => "intra_company_purchases", + JewelryStoresWatchesClocksAndSilverwareStores => { + "jewelry_stores_watches_clocks_and_silverware_stores" + } + LandscapingServices => "landscaping_services", + Laundries => "laundries", + LaundryCleaningServices => "laundry_cleaning_services", + LegalServicesAttorneys => "legal_services_attorneys", + LuggageAndLeatherGoodsStores => "luggage_and_leather_goods_stores", + LumberBuildingMaterialsStores => "lumber_building_materials_stores", + ManualCashDisburse => "manual_cash_disburse", + MarinasServiceAndSupplies => "marinas_service_and_supplies", + Marketplaces => "marketplaces", + MasonryStoneworkAndPlaster => "masonry_stonework_and_plaster", + MassageParlors => "massage_parlors", + MedicalAndDentalLabs => "medical_and_dental_labs", + MedicalDentalOphthalmicAndHospitalEquipmentAndSupplies => { + "medical_dental_ophthalmic_and_hospital_equipment_and_supplies" + } + MedicalServices => "medical_services", + MembershipOrganizations => "membership_organizations", + MensAndBoysClothingAndAccessoriesStores => { + "mens_and_boys_clothing_and_accessories_stores" + } + MensWomensClothingStores => "mens_womens_clothing_stores", + MetalServiceCenters => "metal_service_centers", + Miscellaneous => "miscellaneous", + MiscellaneousApparelAndAccessoryShops => "miscellaneous_apparel_and_accessory_shops", + MiscellaneousAutoDealers => "miscellaneous_auto_dealers", + MiscellaneousBusinessServices => "miscellaneous_business_services", + MiscellaneousFoodStores => "miscellaneous_food_stores", + MiscellaneousGeneralMerchandise => "miscellaneous_general_merchandise", + MiscellaneousGeneralServices => "miscellaneous_general_services", + MiscellaneousHomeFurnishingSpecialtyStores => { + "miscellaneous_home_furnishing_specialty_stores" + } + MiscellaneousPublishingAndPrinting => "miscellaneous_publishing_and_printing", + MiscellaneousRecreationServices => "miscellaneous_recreation_services", + MiscellaneousRepairShops => "miscellaneous_repair_shops", + MiscellaneousSpecialtyRetail => "miscellaneous_specialty_retail", + MobileHomeDealers => "mobile_home_dealers", + MotionPictureTheaters => "motion_picture_theaters", + MotorFreightCarriersAndTrucking => "motor_freight_carriers_and_trucking", + MotorHomesDealers => "motor_homes_dealers", + MotorVehicleSuppliesAndNewParts => "motor_vehicle_supplies_and_new_parts", + MotorcycleShopsAndDealers => "motorcycle_shops_and_dealers", + MotorcycleShopsDealers => "motorcycle_shops_dealers", + MusicStoresMusicalInstrumentsPianosAndSheetMusic => { + "music_stores_musical_instruments_pianos_and_sheet_music" + } + NewsDealersAndNewsstands => "news_dealers_and_newsstands", + NonFiMoneyOrders => "non_fi_money_orders", + NonFiStoredValueCardPurchaseLoad => "non_fi_stored_value_card_purchase_load", + NondurableGoods => "nondurable_goods", + NurseriesLawnAndGardenSupplyStores => "nurseries_lawn_and_garden_supply_stores", + NursingPersonalCare => "nursing_personal_care", + OfficeAndCommercialFurniture => "office_and_commercial_furniture", + OpticiansEyeglasses => "opticians_eyeglasses", + OptometristsOphthalmologist => "optometrists_ophthalmologist", + OrthopedicGoodsProstheticDevices => "orthopedic_goods_prosthetic_devices", + Osteopaths => "osteopaths", + PackageStoresBeerWineAndLiquor => "package_stores_beer_wine_and_liquor", + PaintsVarnishesAndSupplies => "paints_varnishes_and_supplies", + ParkingLotsGarages => "parking_lots_garages", + PassengerRailways => "passenger_railways", + PawnShops => "pawn_shops", + PetShopsPetFoodAndSupplies => "pet_shops_pet_food_and_supplies", + PetroleumAndPetroleumProducts => "petroleum_and_petroleum_products", + PhotoDeveloping => "photo_developing", + PhotographicPhotocopyMicrofilmEquipmentAndSupplies => { + "photographic_photocopy_microfilm_equipment_and_supplies" + } + PhotographicStudios => "photographic_studios", + PictureVideoProduction => "picture_video_production", + PieceGoodsNotionsAndOtherDryGoods => "piece_goods_notions_and_other_dry_goods", + PlumbingHeatingEquipmentAndSupplies => "plumbing_heating_equipment_and_supplies", + PoliticalOrganizations => "political_organizations", + PostalServicesGovernmentOnly => "postal_services_government_only", + PreciousStonesAndMetalsWatchesAndJewelry => { + "precious_stones_and_metals_watches_and_jewelry" + } + ProfessionalServices => "professional_services", + PublicWarehousingAndStorage => "public_warehousing_and_storage", + QuickCopyReproAndBlueprint => "quick_copy_repro_and_blueprint", + Railroads => "railroads", + RealEstateAgentsAndManagersRentals => "real_estate_agents_and_managers_rentals", + RecordStores => "record_stores", + RecreationalVehicleRentals => "recreational_vehicle_rentals", + ReligiousGoodsStores => "religious_goods_stores", + ReligiousOrganizations => "religious_organizations", + RoofingSidingSheetMetal => "roofing_siding_sheet_metal", + SecretarialSupportServices => "secretarial_support_services", + SecurityBrokersDealers => "security_brokers_dealers", + ServiceStations => "service_stations", + SewingNeedleworkFabricAndPieceGoodsStores => { + "sewing_needlework_fabric_and_piece_goods_stores" + } + ShoeRepairHatCleaning => "shoe_repair_hat_cleaning", + ShoeStores => "shoe_stores", + SmallApplianceRepair => "small_appliance_repair", + SnowmobileDealers => "snowmobile_dealers", + SpecialTradeServices => "special_trade_services", + SpecialtyCleaning => "specialty_cleaning", + SportingGoodsStores => "sporting_goods_stores", + SportingRecreationCamps => "sporting_recreation_camps", + SportsAndRidingApparelStores => "sports_and_riding_apparel_stores", + SportsClubsFields => "sports_clubs_fields", + StampAndCoinStores => "stamp_and_coin_stores", + StationaryOfficeSuppliesPrintingAndWritingPaper => { + "stationary_office_supplies_printing_and_writing_paper" + } + StationeryStoresOfficeAndSchoolSupplyStores => { + "stationery_stores_office_and_school_supply_stores" + } + SwimmingPoolsSales => "swimming_pools_sales", + TUiTravelGermany => "t_ui_travel_germany", + TailorsAlterations => "tailors_alterations", + TaxPaymentsGovernmentAgencies => "tax_payments_government_agencies", + TaxPreparationServices => "tax_preparation_services", + TaxicabsLimousines => "taxicabs_limousines", + TelecommunicationEquipmentAndTelephoneSales => { + "telecommunication_equipment_and_telephone_sales" + } + TelecommunicationServices => "telecommunication_services", + TelegraphServices => "telegraph_services", + TentAndAwningShops => "tent_and_awning_shops", + TestingLaboratories => "testing_laboratories", + TheatricalTicketAgencies => "theatrical_ticket_agencies", + Timeshares => "timeshares", + TireRetreadingAndRepair => "tire_retreading_and_repair", + TollsBridgeFees => "tolls_bridge_fees", + TouristAttractionsAndExhibits => "tourist_attractions_and_exhibits", + TowingServices => "towing_services", + TrailerParksCampgrounds => "trailer_parks_campgrounds", + TransportationServices => "transportation_services", + TravelAgenciesTourOperators => "travel_agencies_tour_operators", + TruckStopIteration => "truck_stop_iteration", + TruckUtilityTrailerRentals => "truck_utility_trailer_rentals", + TypesettingPlateMakingAndRelatedServices => { + "typesetting_plate_making_and_related_services" + } + TypewriterStores => "typewriter_stores", + USFederalGovernmentAgenciesOrDepartments => { + "u_s_federal_government_agencies_or_departments" + } + UniformsCommercialClothing => "uniforms_commercial_clothing", + UsedMerchandiseAndSecondhandStores => "used_merchandise_and_secondhand_stores", + Utilities => "utilities", + VarietyStores => "variety_stores", + VeterinaryServices => "veterinary_services", + VideoAmusementGameSupplies => "video_amusement_game_supplies", + VideoGameArcades => "video_game_arcades", + VideoTapeRentalStores => "video_tape_rental_stores", + VocationalTradeSchools => "vocational_trade_schools", + WatchJewelryRepair => "watch_jewelry_repair", + WeldingRepair => "welding_repair", + WholesaleClubs => "wholesale_clubs", + WigAndToupeeStores => "wig_and_toupee_stores", + WiresMoneyOrders => "wires_money_orders", + WomensAccessoryAndSpecialtyShops => "womens_accessory_and_specialty_shops", + WomensReadyToWearStores => "womens_ready_to_wear_stores", + WreckingAndSalvageYards => "wrecking_and_salvage_yards", + Unknown => "unknown", + } + } +} + +impl std::str::FromStr for IssuingCardholderSpendingLimitCategories { + type Err = (); + fn from_str(s: &str) -> Result { + use IssuingCardholderSpendingLimitCategories::*; + match s { + "ac_refrigeration_repair" => Ok(AcRefrigerationRepair), + "accounting_bookkeeping_services" => Ok(AccountingBookkeepingServices), + "advertising_services" => Ok(AdvertisingServices), + "agricultural_cooperative" => Ok(AgriculturalCooperative), + "airlines_air_carriers" => Ok(AirlinesAirCarriers), + "airports_flying_fields" => Ok(AirportsFlyingFields), + "ambulance_services" => Ok(AmbulanceServices), + "amusement_parks_carnivals" => Ok(AmusementParksCarnivals), + "antique_reproductions" => Ok(AntiqueReproductions), + "antique_shops" => Ok(AntiqueShops), + "aquariums" => Ok(Aquariums), + "architectural_surveying_services" => Ok(ArchitecturalSurveyingServices), + "art_dealers_and_galleries" => Ok(ArtDealersAndGalleries), + "artists_supply_and_craft_shops" => Ok(ArtistsSupplyAndCraftShops), + "auto_and_home_supply_stores" => Ok(AutoAndHomeSupplyStores), + "auto_body_repair_shops" => Ok(AutoBodyRepairShops), + "auto_paint_shops" => Ok(AutoPaintShops), + "auto_service_shops" => Ok(AutoServiceShops), + "automated_cash_disburse" => Ok(AutomatedCashDisburse), + "automated_fuel_dispensers" => Ok(AutomatedFuelDispensers), + "automobile_associations" => Ok(AutomobileAssociations), + "automotive_parts_and_accessories_stores" => Ok(AutomotivePartsAndAccessoriesStores), + "automotive_tire_stores" => Ok(AutomotiveTireStores), + "bail_and_bond_payments" => Ok(BailAndBondPayments), + "bakeries" => Ok(Bakeries), + "bands_orchestras" => Ok(BandsOrchestras), + "barber_and_beauty_shops" => Ok(BarberAndBeautyShops), + "betting_casino_gambling" => Ok(BettingCasinoGambling), + "bicycle_shops" => Ok(BicycleShops), + "billiard_pool_establishments" => Ok(BilliardPoolEstablishments), + "boat_dealers" => Ok(BoatDealers), + "boat_rentals_and_leases" => Ok(BoatRentalsAndLeases), + "book_stores" => Ok(BookStores), + "books_periodicals_and_newspapers" => Ok(BooksPeriodicalsAndNewspapers), + "bowling_alleys" => Ok(BowlingAlleys), + "bus_lines" => Ok(BusLines), + "business_secretarial_schools" => Ok(BusinessSecretarialSchools), + "buying_shopping_services" => Ok(BuyingShoppingServices), + "cable_satellite_and_other_pay_television_and_radio" => { + Ok(CableSatelliteAndOtherPayTelevisionAndRadio) + } + "camera_and_photographic_supply_stores" => Ok(CameraAndPhotographicSupplyStores), + "candy_nut_and_confectionery_stores" => Ok(CandyNutAndConfectioneryStores), + "car_and_truck_dealers_new_used" => Ok(CarAndTruckDealersNewUsed), + "car_and_truck_dealers_used_only" => Ok(CarAndTruckDealersUsedOnly), + "car_rental_agencies" => Ok(CarRentalAgencies), + "car_washes" => Ok(CarWashes), + "carpentry_services" => Ok(CarpentryServices), + "carpet_upholstery_cleaning" => Ok(CarpetUpholsteryCleaning), + "caterers" => Ok(Caterers), + "charitable_and_social_service_organizations_fundraising" => { + Ok(CharitableAndSocialServiceOrganizationsFundraising) + } + "chemicals_and_allied_products" => Ok(ChemicalsAndAlliedProducts), + "child_care_services" => Ok(ChildCareServices), + "childrens_and_infants_wear_stores" => Ok(ChildrensAndInfantsWearStores), + "chiropodists_podiatrists" => Ok(ChiropodistsPodiatrists), + "chiropractors" => Ok(Chiropractors), + "cigar_stores_and_stands" => Ok(CigarStoresAndStands), + "civic_social_fraternal_associations" => Ok(CivicSocialFraternalAssociations), + "cleaning_and_maintenance" => Ok(CleaningAndMaintenance), + "clothing_rental" => Ok(ClothingRental), + "colleges_universities" => Ok(CollegesUniversities), + "commercial_equipment" => Ok(CommercialEquipment), + "commercial_footwear" => Ok(CommercialFootwear), + "commercial_photography_art_and_graphics" => Ok(CommercialPhotographyArtAndGraphics), + "commuter_transport_and_ferries" => Ok(CommuterTransportAndFerries), + "computer_network_services" => Ok(ComputerNetworkServices), + "computer_programming" => Ok(ComputerProgramming), + "computer_repair" => Ok(ComputerRepair), + "computer_software_stores" => Ok(ComputerSoftwareStores), + "computers_peripherals_and_software" => Ok(ComputersPeripheralsAndSoftware), + "concrete_work_services" => Ok(ConcreteWorkServices), + "construction_materials" => Ok(ConstructionMaterials), + "consulting_public_relations" => Ok(ConsultingPublicRelations), + "correspondence_schools" => Ok(CorrespondenceSchools), + "cosmetic_stores" => Ok(CosmeticStores), + "counseling_services" => Ok(CounselingServices), + "country_clubs" => Ok(CountryClubs), + "courier_services" => Ok(CourierServices), + "court_costs" => Ok(CourtCosts), + "credit_reporting_agencies" => Ok(CreditReportingAgencies), + "cruise_lines" => Ok(CruiseLines), + "dairy_products_stores" => Ok(DairyProductsStores), + "dance_hall_studios_schools" => Ok(DanceHallStudiosSchools), + "dating_escort_services" => Ok(DatingEscortServices), + "dentists_orthodontists" => Ok(DentistsOrthodontists), + "department_stores" => Ok(DepartmentStores), + "detective_agencies" => Ok(DetectiveAgencies), + "digital_goods_applications" => Ok(DigitalGoodsApplications), + "digital_goods_games" => Ok(DigitalGoodsGames), + "digital_goods_large_volume" => Ok(DigitalGoodsLargeVolume), + "digital_goods_media" => Ok(DigitalGoodsMedia), + "direct_marketing_catalog_merchant" => Ok(DirectMarketingCatalogMerchant), + "direct_marketing_combination_catalog_and_retail_merchant" => { + Ok(DirectMarketingCombinationCatalogAndRetailMerchant) + } + "direct_marketing_inbound_telemarketing" => Ok(DirectMarketingInboundTelemarketing), + "direct_marketing_insurance_services" => Ok(DirectMarketingInsuranceServices), + "direct_marketing_other" => Ok(DirectMarketingOther), + "direct_marketing_outbound_telemarketing" => Ok(DirectMarketingOutboundTelemarketing), + "direct_marketing_subscription" => Ok(DirectMarketingSubscription), + "direct_marketing_travel" => Ok(DirectMarketingTravel), + "discount_stores" => Ok(DiscountStores), + "doctors" => Ok(Doctors), + "door_to_door_sales" => Ok(DoorToDoorSales), + "drapery_window_covering_and_upholstery_stores" => { + Ok(DraperyWindowCoveringAndUpholsteryStores) + } + "drinking_places" => Ok(DrinkingPlaces), + "drug_stores_and_pharmacies" => Ok(DrugStoresAndPharmacies), + "drugs_drug_proprietaries_and_druggist_sundries" => { + Ok(DrugsDrugProprietariesAndDruggistSundries) + } + "dry_cleaners" => Ok(DryCleaners), + "durable_goods" => Ok(DurableGoods), + "duty_free_stores" => Ok(DutyFreeStores), + "eating_places_restaurants" => Ok(EatingPlacesRestaurants), + "educational_services" => Ok(EducationalServices), + "electric_razor_stores" => Ok(ElectricRazorStores), + "electric_vehicle_charging" => Ok(ElectricVehicleCharging), + "electrical_parts_and_equipment" => Ok(ElectricalPartsAndEquipment), + "electrical_services" => Ok(ElectricalServices), + "electronics_repair_shops" => Ok(ElectronicsRepairShops), + "electronics_stores" => Ok(ElectronicsStores), + "elementary_secondary_schools" => Ok(ElementarySecondarySchools), + "emergency_services_gcas_visa_use_only" => Ok(EmergencyServicesGcasVisaUseOnly), + "employment_temp_agencies" => Ok(EmploymentTempAgencies), + "equipment_rental" => Ok(EquipmentRental), + "exterminating_services" => Ok(ExterminatingServices), + "family_clothing_stores" => Ok(FamilyClothingStores), + "fast_food_restaurants" => Ok(FastFoodRestaurants), + "financial_institutions" => Ok(FinancialInstitutions), + "fines_government_administrative_entities" => Ok(FinesGovernmentAdministrativeEntities), + "fireplace_fireplace_screens_and_accessories_stores" => { + Ok(FireplaceFireplaceScreensAndAccessoriesStores) + } + "floor_covering_stores" => Ok(FloorCoveringStores), + "florists" => Ok(Florists), + "florists_supplies_nursery_stock_and_flowers" => { + Ok(FloristsSuppliesNurseryStockAndFlowers) + } + "freezer_and_locker_meat_provisioners" => Ok(FreezerAndLockerMeatProvisioners), + "fuel_dealers_non_automotive" => Ok(FuelDealersNonAutomotive), + "funeral_services_crematories" => Ok(FuneralServicesCrematories), + "furniture_home_furnishings_and_equipment_stores_except_appliances" => { + Ok(FurnitureHomeFurnishingsAndEquipmentStoresExceptAppliances) + } + "furniture_repair_refinishing" => Ok(FurnitureRepairRefinishing), + "furriers_and_fur_shops" => Ok(FurriersAndFurShops), + "general_services" => Ok(GeneralServices), + "gift_card_novelty_and_souvenir_shops" => Ok(GiftCardNoveltyAndSouvenirShops), + "glass_paint_and_wallpaper_stores" => Ok(GlassPaintAndWallpaperStores), + "glassware_crystal_stores" => Ok(GlasswareCrystalStores), + "golf_courses_public" => Ok(GolfCoursesPublic), + "government_licensed_horse_dog_racing_us_region_only" => { + Ok(GovernmentLicensedHorseDogRacingUsRegionOnly) + } + "government_licensed_online_casions_online_gambling_us_region_only" => { + Ok(GovernmentLicensedOnlineCasionsOnlineGamblingUsRegionOnly) + } + "government_owned_lotteries_non_us_region" => Ok(GovernmentOwnedLotteriesNonUsRegion), + "government_owned_lotteries_us_region_only" => Ok(GovernmentOwnedLotteriesUsRegionOnly), + "government_services" => Ok(GovernmentServices), + "grocery_stores_supermarkets" => Ok(GroceryStoresSupermarkets), + "hardware_equipment_and_supplies" => Ok(HardwareEquipmentAndSupplies), + "hardware_stores" => Ok(HardwareStores), + "health_and_beauty_spas" => Ok(HealthAndBeautySpas), + "hearing_aids_sales_and_supplies" => Ok(HearingAidsSalesAndSupplies), + "heating_plumbing_a_c" => Ok(HeatingPlumbingAC), + "hobby_toy_and_game_shops" => Ok(HobbyToyAndGameShops), + "home_supply_warehouse_stores" => Ok(HomeSupplyWarehouseStores), + "hospitals" => Ok(Hospitals), + "hotels_motels_and_resorts" => Ok(HotelsMotelsAndResorts), + "household_appliance_stores" => Ok(HouseholdApplianceStores), + "industrial_supplies" => Ok(IndustrialSupplies), + "information_retrieval_services" => Ok(InformationRetrievalServices), + "insurance_default" => Ok(InsuranceDefault), + "insurance_underwriting_premiums" => Ok(InsuranceUnderwritingPremiums), + "intra_company_purchases" => Ok(IntraCompanyPurchases), + "jewelry_stores_watches_clocks_and_silverware_stores" => { + Ok(JewelryStoresWatchesClocksAndSilverwareStores) + } + "landscaping_services" => Ok(LandscapingServices), + "laundries" => Ok(Laundries), + "laundry_cleaning_services" => Ok(LaundryCleaningServices), + "legal_services_attorneys" => Ok(LegalServicesAttorneys), + "luggage_and_leather_goods_stores" => Ok(LuggageAndLeatherGoodsStores), + "lumber_building_materials_stores" => Ok(LumberBuildingMaterialsStores), + "manual_cash_disburse" => Ok(ManualCashDisburse), + "marinas_service_and_supplies" => Ok(MarinasServiceAndSupplies), + "marketplaces" => Ok(Marketplaces), + "masonry_stonework_and_plaster" => Ok(MasonryStoneworkAndPlaster), + "massage_parlors" => Ok(MassageParlors), + "medical_and_dental_labs" => Ok(MedicalAndDentalLabs), + "medical_dental_ophthalmic_and_hospital_equipment_and_supplies" => { + Ok(MedicalDentalOphthalmicAndHospitalEquipmentAndSupplies) + } + "medical_services" => Ok(MedicalServices), + "membership_organizations" => Ok(MembershipOrganizations), + "mens_and_boys_clothing_and_accessories_stores" => { + Ok(MensAndBoysClothingAndAccessoriesStores) + } + "mens_womens_clothing_stores" => Ok(MensWomensClothingStores), + "metal_service_centers" => Ok(MetalServiceCenters), + "miscellaneous" => Ok(Miscellaneous), + "miscellaneous_apparel_and_accessory_shops" => { + Ok(MiscellaneousApparelAndAccessoryShops) + } + "miscellaneous_auto_dealers" => Ok(MiscellaneousAutoDealers), + "miscellaneous_business_services" => Ok(MiscellaneousBusinessServices), + "miscellaneous_food_stores" => Ok(MiscellaneousFoodStores), + "miscellaneous_general_merchandise" => Ok(MiscellaneousGeneralMerchandise), + "miscellaneous_general_services" => Ok(MiscellaneousGeneralServices), + "miscellaneous_home_furnishing_specialty_stores" => { + Ok(MiscellaneousHomeFurnishingSpecialtyStores) + } + "miscellaneous_publishing_and_printing" => Ok(MiscellaneousPublishingAndPrinting), + "miscellaneous_recreation_services" => Ok(MiscellaneousRecreationServices), + "miscellaneous_repair_shops" => Ok(MiscellaneousRepairShops), + "miscellaneous_specialty_retail" => Ok(MiscellaneousSpecialtyRetail), + "mobile_home_dealers" => Ok(MobileHomeDealers), + "motion_picture_theaters" => Ok(MotionPictureTheaters), + "motor_freight_carriers_and_trucking" => Ok(MotorFreightCarriersAndTrucking), + "motor_homes_dealers" => Ok(MotorHomesDealers), + "motor_vehicle_supplies_and_new_parts" => Ok(MotorVehicleSuppliesAndNewParts), + "motorcycle_shops_and_dealers" => Ok(MotorcycleShopsAndDealers), + "motorcycle_shops_dealers" => Ok(MotorcycleShopsDealers), + "music_stores_musical_instruments_pianos_and_sheet_music" => { + Ok(MusicStoresMusicalInstrumentsPianosAndSheetMusic) + } + "news_dealers_and_newsstands" => Ok(NewsDealersAndNewsstands), + "non_fi_money_orders" => Ok(NonFiMoneyOrders), + "non_fi_stored_value_card_purchase_load" => Ok(NonFiStoredValueCardPurchaseLoad), + "nondurable_goods" => Ok(NondurableGoods), + "nurseries_lawn_and_garden_supply_stores" => Ok(NurseriesLawnAndGardenSupplyStores), + "nursing_personal_care" => Ok(NursingPersonalCare), + "office_and_commercial_furniture" => Ok(OfficeAndCommercialFurniture), + "opticians_eyeglasses" => Ok(OpticiansEyeglasses), + "optometrists_ophthalmologist" => Ok(OptometristsOphthalmologist), + "orthopedic_goods_prosthetic_devices" => Ok(OrthopedicGoodsProstheticDevices), + "osteopaths" => Ok(Osteopaths), + "package_stores_beer_wine_and_liquor" => Ok(PackageStoresBeerWineAndLiquor), + "paints_varnishes_and_supplies" => Ok(PaintsVarnishesAndSupplies), + "parking_lots_garages" => Ok(ParkingLotsGarages), + "passenger_railways" => Ok(PassengerRailways), + "pawn_shops" => Ok(PawnShops), + "pet_shops_pet_food_and_supplies" => Ok(PetShopsPetFoodAndSupplies), + "petroleum_and_petroleum_products" => Ok(PetroleumAndPetroleumProducts), + "photo_developing" => Ok(PhotoDeveloping), + "photographic_photocopy_microfilm_equipment_and_supplies" => { + Ok(PhotographicPhotocopyMicrofilmEquipmentAndSupplies) + } + "photographic_studios" => Ok(PhotographicStudios), + "picture_video_production" => Ok(PictureVideoProduction), + "piece_goods_notions_and_other_dry_goods" => Ok(PieceGoodsNotionsAndOtherDryGoods), + "plumbing_heating_equipment_and_supplies" => Ok(PlumbingHeatingEquipmentAndSupplies), + "political_organizations" => Ok(PoliticalOrganizations), + "postal_services_government_only" => Ok(PostalServicesGovernmentOnly), + "precious_stones_and_metals_watches_and_jewelry" => { + Ok(PreciousStonesAndMetalsWatchesAndJewelry) + } + "professional_services" => Ok(ProfessionalServices), + "public_warehousing_and_storage" => Ok(PublicWarehousingAndStorage), + "quick_copy_repro_and_blueprint" => Ok(QuickCopyReproAndBlueprint), + "railroads" => Ok(Railroads), + "real_estate_agents_and_managers_rentals" => Ok(RealEstateAgentsAndManagersRentals), + "record_stores" => Ok(RecordStores), + "recreational_vehicle_rentals" => Ok(RecreationalVehicleRentals), + "religious_goods_stores" => Ok(ReligiousGoodsStores), + "religious_organizations" => Ok(ReligiousOrganizations), + "roofing_siding_sheet_metal" => Ok(RoofingSidingSheetMetal), + "secretarial_support_services" => Ok(SecretarialSupportServices), + "security_brokers_dealers" => Ok(SecurityBrokersDealers), + "service_stations" => Ok(ServiceStations), + "sewing_needlework_fabric_and_piece_goods_stores" => { + Ok(SewingNeedleworkFabricAndPieceGoodsStores) + } + "shoe_repair_hat_cleaning" => Ok(ShoeRepairHatCleaning), + "shoe_stores" => Ok(ShoeStores), + "small_appliance_repair" => Ok(SmallApplianceRepair), + "snowmobile_dealers" => Ok(SnowmobileDealers), + "special_trade_services" => Ok(SpecialTradeServices), + "specialty_cleaning" => Ok(SpecialtyCleaning), + "sporting_goods_stores" => Ok(SportingGoodsStores), + "sporting_recreation_camps" => Ok(SportingRecreationCamps), + "sports_and_riding_apparel_stores" => Ok(SportsAndRidingApparelStores), + "sports_clubs_fields" => Ok(SportsClubsFields), + "stamp_and_coin_stores" => Ok(StampAndCoinStores), + "stationary_office_supplies_printing_and_writing_paper" => { + Ok(StationaryOfficeSuppliesPrintingAndWritingPaper) + } + "stationery_stores_office_and_school_supply_stores" => { + Ok(StationeryStoresOfficeAndSchoolSupplyStores) + } + "swimming_pools_sales" => Ok(SwimmingPoolsSales), + "t_ui_travel_germany" => Ok(TUiTravelGermany), + "tailors_alterations" => Ok(TailorsAlterations), + "tax_payments_government_agencies" => Ok(TaxPaymentsGovernmentAgencies), + "tax_preparation_services" => Ok(TaxPreparationServices), + "taxicabs_limousines" => Ok(TaxicabsLimousines), + "telecommunication_equipment_and_telephone_sales" => { + Ok(TelecommunicationEquipmentAndTelephoneSales) + } + "telecommunication_services" => Ok(TelecommunicationServices), + "telegraph_services" => Ok(TelegraphServices), + "tent_and_awning_shops" => Ok(TentAndAwningShops), + "testing_laboratories" => Ok(TestingLaboratories), + "theatrical_ticket_agencies" => Ok(TheatricalTicketAgencies), + "timeshares" => Ok(Timeshares), + "tire_retreading_and_repair" => Ok(TireRetreadingAndRepair), + "tolls_bridge_fees" => Ok(TollsBridgeFees), + "tourist_attractions_and_exhibits" => Ok(TouristAttractionsAndExhibits), + "towing_services" => Ok(TowingServices), + "trailer_parks_campgrounds" => Ok(TrailerParksCampgrounds), + "transportation_services" => Ok(TransportationServices), + "travel_agencies_tour_operators" => Ok(TravelAgenciesTourOperators), + "truck_stop_iteration" => Ok(TruckStopIteration), + "truck_utility_trailer_rentals" => Ok(TruckUtilityTrailerRentals), + "typesetting_plate_making_and_related_services" => { + Ok(TypesettingPlateMakingAndRelatedServices) + } + "typewriter_stores" => Ok(TypewriterStores), + "u_s_federal_government_agencies_or_departments" => { + Ok(USFederalGovernmentAgenciesOrDepartments) + } + "uniforms_commercial_clothing" => Ok(UniformsCommercialClothing), + "used_merchandise_and_secondhand_stores" => Ok(UsedMerchandiseAndSecondhandStores), + "utilities" => Ok(Utilities), + "variety_stores" => Ok(VarietyStores), + "veterinary_services" => Ok(VeterinaryServices), + "video_amusement_game_supplies" => Ok(VideoAmusementGameSupplies), + "video_game_arcades" => Ok(VideoGameArcades), + "video_tape_rental_stores" => Ok(VideoTapeRentalStores), + "vocational_trade_schools" => Ok(VocationalTradeSchools), + "watch_jewelry_repair" => Ok(WatchJewelryRepair), + "welding_repair" => Ok(WeldingRepair), + "wholesale_clubs" => Ok(WholesaleClubs), + "wig_and_toupee_stores" => Ok(WigAndToupeeStores), + "wires_money_orders" => Ok(WiresMoneyOrders), + "womens_accessory_and_specialty_shops" => Ok(WomensAccessoryAndSpecialtyShops), + "womens_ready_to_wear_stores" => Ok(WomensReadyToWearStores), + "wrecking_and_salvage_yards" => Ok(WreckingAndSalvageYards), + _ => Err(()), + } + } +} +impl std::fmt::Display for IssuingCardholderSpendingLimitCategories { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for IssuingCardholderSpendingLimitCategories { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for IssuingCardholderSpendingLimitCategories { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for IssuingCardholderSpendingLimitCategories { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Ok(Self::from_str(&s).unwrap_or(IssuingCardholderSpendingLimitCategories::Unknown)) + } +} +/// Interval (or event) to which the amount applies. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum IssuingCardholderSpendingLimitInterval { + AllTime, + Daily, + Monthly, + PerAuthorization, + Weekly, + Yearly, +} +impl IssuingCardholderSpendingLimitInterval { + pub fn as_str(self) -> &'static str { + use IssuingCardholderSpendingLimitInterval::*; + match self { + AllTime => "all_time", + Daily => "daily", + Monthly => "monthly", + PerAuthorization => "per_authorization", + Weekly => "weekly", + Yearly => "yearly", + } + } +} + +impl std::str::FromStr for IssuingCardholderSpendingLimitInterval { + type Err = (); + fn from_str(s: &str) -> Result { + use IssuingCardholderSpendingLimitInterval::*; + match s { + "all_time" => Ok(AllTime), + "daily" => Ok(Daily), + "monthly" => Ok(Monthly), + "per_authorization" => Ok(PerAuthorization), + "weekly" => Ok(Weekly), + "yearly" => Ok(Yearly), + _ => Err(()), + } + } +} +impl std::fmt::Display for IssuingCardholderSpendingLimitInterval { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for IssuingCardholderSpendingLimitInterval { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for IssuingCardholderSpendingLimitInterval { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for IssuingCardholderSpendingLimitInterval { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| { + serde::de::Error::custom("Unknown value for IssuingCardholderSpendingLimitInterval") + }) + } +} diff --git a/generated/stripe_shared/src/issuing_cardholder_user_terms_acceptance.rs b/generated/stripe_shared/src/issuing_cardholder_user_terms_acceptance.rs new file mode 100644 index 000000000..b86c849fe --- /dev/null +++ b/generated/stripe_shared/src/issuing_cardholder_user_terms_acceptance.rs @@ -0,0 +1,9 @@ +#[derive(Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct IssuingCardholderUserTermsAcceptance { + /// The Unix timestamp marking when the cardholder accepted the Authorized User Terms. + pub date: Option, + /// The IP address from which the cardholder accepted the Authorized User Terms. + pub ip: Option, + /// The user agent of the browser from which the cardholder accepted the Authorized User Terms. + pub user_agent: Option, +} diff --git a/generated/stripe_shared/src/issuing_cardholder_verification.rs b/generated/stripe_shared/src/issuing_cardholder_verification.rs new file mode 100644 index 000000000..4fabd9d05 --- /dev/null +++ b/generated/stripe_shared/src/issuing_cardholder_verification.rs @@ -0,0 +1,5 @@ +#[derive(Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct IssuingCardholderVerification { + /// An identifying document, either a passport or local ID card. + pub document: Option, +} diff --git a/generated/stripe_shared/src/issuing_dispute.rs b/generated/stripe_shared/src/issuing_dispute.rs new file mode 100644 index 000000000..23672233a --- /dev/null +++ b/generated/stripe_shared/src/issuing_dispute.rs @@ -0,0 +1,101 @@ +/// As a [card issuer](https://stripe.com/docs/issuing), you can dispute transactions that the cardholder does not recognize, suspects to be fraudulent, or has other issues with. +/// +/// Related guide: [Issuing disputes](https://stripe.com/docs/issuing/purchases/disputes) +/// +/// For more details see <>. +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct IssuingDispute { + /// Disputed amount in the card's currency and in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal). + /// Usually the amount of the `transaction`, but can differ (usually because of currency fluctuation). + pub amount: i64, + /// List of balance transactions associated with the dispute. + pub balance_transactions: Option>, + /// Time at which the object was created. Measured in seconds since the Unix epoch. + pub created: stripe_types::Timestamp, + /// The currency the `transaction` was made in. + pub currency: stripe_types::Currency, + pub evidence: stripe_shared::IssuingDisputeEvidence, + /// Unique identifier for the object. + pub id: stripe_shared::IssuingDisputeId, + /// Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + pub livemode: bool, + /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. + /// This can be useful for storing additional information about the object in a structured format. + pub metadata: std::collections::HashMap, + /// Current status of the dispute. + pub status: stripe_shared::IssuingDisputeStatus, + /// The transaction being disputed. + pub transaction: stripe_types::Expandable, + /// [Treasury](https://stripe.com/docs/api/treasury) details related to this dispute if it was created on a [FinancialAccount](/docs/api/treasury/financial_accounts. + #[serde(skip_serializing_if = "Option::is_none")] + pub treasury: Option, +} +impl stripe_types::Object for IssuingDispute { + type Id = stripe_shared::IssuingDisputeId; + fn id(&self) -> &Self::Id { + &self.id + } +} +stripe_types::def_id!(IssuingDisputeId, "idp_"); +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum IssuingDisputeStatus { + Expired, + Lost, + Submitted, + Unsubmitted, + Won, +} +impl IssuingDisputeStatus { + pub fn as_str(self) -> &'static str { + use IssuingDisputeStatus::*; + match self { + Expired => "expired", + Lost => "lost", + Submitted => "submitted", + Unsubmitted => "unsubmitted", + Won => "won", + } + } +} + +impl std::str::FromStr for IssuingDisputeStatus { + type Err = (); + fn from_str(s: &str) -> Result { + use IssuingDisputeStatus::*; + match s { + "expired" => Ok(Expired), + "lost" => Ok(Lost), + "submitted" => Ok(Submitted), + "unsubmitted" => Ok(Unsubmitted), + "won" => Ok(Won), + _ => Err(()), + } + } +} +impl std::fmt::Display for IssuingDisputeStatus { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for IssuingDisputeStatus { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for IssuingDisputeStatus { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for IssuingDisputeStatus { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s) + .map_err(|_| serde::de::Error::custom("Unknown value for IssuingDisputeStatus")) + } +} diff --git a/generated/stripe_shared/src/issuing_dispute_canceled_evidence.rs b/generated/stripe_shared/src/issuing_dispute_canceled_evidence.rs new file mode 100644 index 000000000..f060bf7a0 --- /dev/null +++ b/generated/stripe_shared/src/issuing_dispute_canceled_evidence.rs @@ -0,0 +1,133 @@ +#[derive(Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct IssuingDisputeCanceledEvidence { + /// (ID of a [file upload](https://stripe.com/docs/guides/file-upload)) Additional documentation supporting the dispute. + pub additional_documentation: Option>, + /// Date when order was canceled. + pub canceled_at: Option, + /// Whether the cardholder was provided with a cancellation policy. + pub cancellation_policy_provided: Option, + /// Reason for canceling the order. + pub cancellation_reason: Option, + /// Date when the cardholder expected to receive the product. + pub expected_at: Option, + /// Explanation of why the cardholder is disputing this transaction. + pub explanation: Option, + /// Description of the merchandise or service that was purchased. + pub product_description: Option, + /// Whether the product was a merchandise or service. + pub product_type: Option, + /// Result of cardholder's attempt to return the product. + pub return_status: Option, + /// Date when the product was returned or attempted to be returned. + pub returned_at: Option, +} +/// Whether the product was a merchandise or service. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum IssuingDisputeCanceledEvidenceProductType { + Merchandise, + Service, +} +impl IssuingDisputeCanceledEvidenceProductType { + pub fn as_str(self) -> &'static str { + use IssuingDisputeCanceledEvidenceProductType::*; + match self { + Merchandise => "merchandise", + Service => "service", + } + } +} + +impl std::str::FromStr for IssuingDisputeCanceledEvidenceProductType { + type Err = (); + fn from_str(s: &str) -> Result { + use IssuingDisputeCanceledEvidenceProductType::*; + match s { + "merchandise" => Ok(Merchandise), + "service" => Ok(Service), + _ => Err(()), + } + } +} +impl std::fmt::Display for IssuingDisputeCanceledEvidenceProductType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for IssuingDisputeCanceledEvidenceProductType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for IssuingDisputeCanceledEvidenceProductType { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for IssuingDisputeCanceledEvidenceProductType { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| { + serde::de::Error::custom("Unknown value for IssuingDisputeCanceledEvidenceProductType") + }) + } +} +/// Result of cardholder's attempt to return the product. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum IssuingDisputeCanceledEvidenceReturnStatus { + MerchantRejected, + Successful, +} +impl IssuingDisputeCanceledEvidenceReturnStatus { + pub fn as_str(self) -> &'static str { + use IssuingDisputeCanceledEvidenceReturnStatus::*; + match self { + MerchantRejected => "merchant_rejected", + Successful => "successful", + } + } +} + +impl std::str::FromStr for IssuingDisputeCanceledEvidenceReturnStatus { + type Err = (); + fn from_str(s: &str) -> Result { + use IssuingDisputeCanceledEvidenceReturnStatus::*; + match s { + "merchant_rejected" => Ok(MerchantRejected), + "successful" => Ok(Successful), + _ => Err(()), + } + } +} +impl std::fmt::Display for IssuingDisputeCanceledEvidenceReturnStatus { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for IssuingDisputeCanceledEvidenceReturnStatus { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for IssuingDisputeCanceledEvidenceReturnStatus { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for IssuingDisputeCanceledEvidenceReturnStatus { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| { + serde::de::Error::custom("Unknown value for IssuingDisputeCanceledEvidenceReturnStatus") + }) + } +} diff --git a/generated/stripe_shared/src/issuing_dispute_duplicate_evidence.rs b/generated/stripe_shared/src/issuing_dispute_duplicate_evidence.rs new file mode 100644 index 000000000..816a47a52 --- /dev/null +++ b/generated/stripe_shared/src/issuing_dispute_duplicate_evidence.rs @@ -0,0 +1,16 @@ +#[derive(Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct IssuingDisputeDuplicateEvidence { + /// (ID of a [file upload](https://stripe.com/docs/guides/file-upload)) Additional documentation supporting the dispute. + pub additional_documentation: Option>, + /// (ID of a [file upload](https://stripe.com/docs/guides/file-upload)) Copy of the card statement showing that the product had already been paid for. + pub card_statement: Option>, + /// (ID of a [file upload](https://stripe.com/docs/guides/file-upload)) Copy of the receipt showing that the product had been paid for in cash. + pub cash_receipt: Option>, + /// (ID of a [file upload](https://stripe.com/docs/guides/file-upload)) Image of the front and back of the check that was used to pay for the product. + pub check_image: Option>, + /// Explanation of why the cardholder is disputing this transaction. + pub explanation: Option, + /// Transaction (e.g., ipi_...) that the disputed transaction is a duplicate of. + /// Of the two or more transactions that are copies of each other, this is original undisputed one. + pub original_transaction: Option, +} diff --git a/generated/stripe_shared/src/issuing_dispute_evidence.rs b/generated/stripe_shared/src/issuing_dispute_evidence.rs new file mode 100644 index 000000000..8435e921b --- /dev/null +++ b/generated/stripe_shared/src/issuing_dispute_evidence.rs @@ -0,0 +1,90 @@ +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct IssuingDisputeEvidence { + #[serde(skip_serializing_if = "Option::is_none")] + pub canceled: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub duplicate: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub fraudulent: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub merchandise_not_as_described: + Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub not_received: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub other: Option, + /// The reason for filing the dispute. Its value will match the field containing the evidence. + pub reason: IssuingDisputeEvidenceReason, + #[serde(skip_serializing_if = "Option::is_none")] + pub service_not_as_described: + Option, +} +/// The reason for filing the dispute. Its value will match the field containing the evidence. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum IssuingDisputeEvidenceReason { + Canceled, + Duplicate, + Fraudulent, + MerchandiseNotAsDescribed, + NotReceived, + Other, + ServiceNotAsDescribed, +} +impl IssuingDisputeEvidenceReason { + pub fn as_str(self) -> &'static str { + use IssuingDisputeEvidenceReason::*; + match self { + Canceled => "canceled", + Duplicate => "duplicate", + Fraudulent => "fraudulent", + MerchandiseNotAsDescribed => "merchandise_not_as_described", + NotReceived => "not_received", + Other => "other", + ServiceNotAsDescribed => "service_not_as_described", + } + } +} + +impl std::str::FromStr for IssuingDisputeEvidenceReason { + type Err = (); + fn from_str(s: &str) -> Result { + use IssuingDisputeEvidenceReason::*; + match s { + "canceled" => Ok(Canceled), + "duplicate" => Ok(Duplicate), + "fraudulent" => Ok(Fraudulent), + "merchandise_not_as_described" => Ok(MerchandiseNotAsDescribed), + "not_received" => Ok(NotReceived), + "other" => Ok(Other), + "service_not_as_described" => Ok(ServiceNotAsDescribed), + _ => Err(()), + } + } +} +impl std::fmt::Display for IssuingDisputeEvidenceReason { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for IssuingDisputeEvidenceReason { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for IssuingDisputeEvidenceReason { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for IssuingDisputeEvidenceReason { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s) + .map_err(|_| serde::de::Error::custom("Unknown value for IssuingDisputeEvidenceReason")) + } +} diff --git a/generated/stripe_shared/src/issuing_dispute_fraudulent_evidence.rs b/generated/stripe_shared/src/issuing_dispute_fraudulent_evidence.rs new file mode 100644 index 000000000..36058d9c0 --- /dev/null +++ b/generated/stripe_shared/src/issuing_dispute_fraudulent_evidence.rs @@ -0,0 +1,7 @@ +#[derive(Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct IssuingDisputeFraudulentEvidence { + /// (ID of a [file upload](https://stripe.com/docs/guides/file-upload)) Additional documentation supporting the dispute. + pub additional_documentation: Option>, + /// Explanation of why the cardholder is disputing this transaction. + pub explanation: Option, +} diff --git a/generated/stripe_shared/src/issuing_dispute_merchandise_not_as_described_evidence.rs b/generated/stripe_shared/src/issuing_dispute_merchandise_not_as_described_evidence.rs new file mode 100644 index 000000000..8760b0584 --- /dev/null +++ b/generated/stripe_shared/src/issuing_dispute_merchandise_not_as_described_evidence.rs @@ -0,0 +1,72 @@ +#[derive(Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct IssuingDisputeMerchandiseNotAsDescribedEvidence { + /// (ID of a [file upload](https://stripe.com/docs/guides/file-upload)) Additional documentation supporting the dispute. + pub additional_documentation: Option>, + /// Explanation of why the cardholder is disputing this transaction. + pub explanation: Option, + /// Date when the product was received. + pub received_at: Option, + /// Description of the cardholder's attempt to return the product. + pub return_description: Option, + /// Result of cardholder's attempt to return the product. + pub return_status: Option, + /// Date when the product was returned or attempted to be returned. + pub returned_at: Option, +} +/// Result of cardholder's attempt to return the product. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum IssuingDisputeMerchandiseNotAsDescribedEvidenceReturnStatus { + MerchantRejected, + Successful, +} +impl IssuingDisputeMerchandiseNotAsDescribedEvidenceReturnStatus { + pub fn as_str(self) -> &'static str { + use IssuingDisputeMerchandiseNotAsDescribedEvidenceReturnStatus::*; + match self { + MerchantRejected => "merchant_rejected", + Successful => "successful", + } + } +} + +impl std::str::FromStr for IssuingDisputeMerchandiseNotAsDescribedEvidenceReturnStatus { + type Err = (); + fn from_str(s: &str) -> Result { + use IssuingDisputeMerchandiseNotAsDescribedEvidenceReturnStatus::*; + match s { + "merchant_rejected" => Ok(MerchantRejected), + "successful" => Ok(Successful), + _ => Err(()), + } + } +} +impl std::fmt::Display for IssuingDisputeMerchandiseNotAsDescribedEvidenceReturnStatus { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for IssuingDisputeMerchandiseNotAsDescribedEvidenceReturnStatus { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for IssuingDisputeMerchandiseNotAsDescribedEvidenceReturnStatus { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for IssuingDisputeMerchandiseNotAsDescribedEvidenceReturnStatus { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| { + serde::de::Error::custom( + "Unknown value for IssuingDisputeMerchandiseNotAsDescribedEvidenceReturnStatus", + ) + }) + } +} diff --git a/generated/stripe_shared/src/issuing_dispute_not_received_evidence.rs b/generated/stripe_shared/src/issuing_dispute_not_received_evidence.rs new file mode 100644 index 000000000..8ba8e1c1f --- /dev/null +++ b/generated/stripe_shared/src/issuing_dispute_not_received_evidence.rs @@ -0,0 +1,70 @@ +#[derive(Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct IssuingDisputeNotReceivedEvidence { + /// (ID of a [file upload](https://stripe.com/docs/guides/file-upload)) Additional documentation supporting the dispute. + pub additional_documentation: Option>, + /// Date when the cardholder expected to receive the product. + pub expected_at: Option, + /// Explanation of why the cardholder is disputing this transaction. + pub explanation: Option, + /// Description of the merchandise or service that was purchased. + pub product_description: Option, + /// Whether the product was a merchandise or service. + pub product_type: Option, +} +/// Whether the product was a merchandise or service. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum IssuingDisputeNotReceivedEvidenceProductType { + Merchandise, + Service, +} +impl IssuingDisputeNotReceivedEvidenceProductType { + pub fn as_str(self) -> &'static str { + use IssuingDisputeNotReceivedEvidenceProductType::*; + match self { + Merchandise => "merchandise", + Service => "service", + } + } +} + +impl std::str::FromStr for IssuingDisputeNotReceivedEvidenceProductType { + type Err = (); + fn from_str(s: &str) -> Result { + use IssuingDisputeNotReceivedEvidenceProductType::*; + match s { + "merchandise" => Ok(Merchandise), + "service" => Ok(Service), + _ => Err(()), + } + } +} +impl std::fmt::Display for IssuingDisputeNotReceivedEvidenceProductType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for IssuingDisputeNotReceivedEvidenceProductType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for IssuingDisputeNotReceivedEvidenceProductType { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for IssuingDisputeNotReceivedEvidenceProductType { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| { + serde::de::Error::custom( + "Unknown value for IssuingDisputeNotReceivedEvidenceProductType", + ) + }) + } +} diff --git a/generated/stripe_shared/src/issuing_dispute_other_evidence.rs b/generated/stripe_shared/src/issuing_dispute_other_evidence.rs new file mode 100644 index 000000000..471711d49 --- /dev/null +++ b/generated/stripe_shared/src/issuing_dispute_other_evidence.rs @@ -0,0 +1,66 @@ +#[derive(Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct IssuingDisputeOtherEvidence { + /// (ID of a [file upload](https://stripe.com/docs/guides/file-upload)) Additional documentation supporting the dispute. + pub additional_documentation: Option>, + /// Explanation of why the cardholder is disputing this transaction. + pub explanation: Option, + /// Description of the merchandise or service that was purchased. + pub product_description: Option, + /// Whether the product was a merchandise or service. + pub product_type: Option, +} +/// Whether the product was a merchandise or service. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum IssuingDisputeOtherEvidenceProductType { + Merchandise, + Service, +} +impl IssuingDisputeOtherEvidenceProductType { + pub fn as_str(self) -> &'static str { + use IssuingDisputeOtherEvidenceProductType::*; + match self { + Merchandise => "merchandise", + Service => "service", + } + } +} + +impl std::str::FromStr for IssuingDisputeOtherEvidenceProductType { + type Err = (); + fn from_str(s: &str) -> Result { + use IssuingDisputeOtherEvidenceProductType::*; + match s { + "merchandise" => Ok(Merchandise), + "service" => Ok(Service), + _ => Err(()), + } + } +} +impl std::fmt::Display for IssuingDisputeOtherEvidenceProductType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for IssuingDisputeOtherEvidenceProductType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for IssuingDisputeOtherEvidenceProductType { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for IssuingDisputeOtherEvidenceProductType { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| { + serde::de::Error::custom("Unknown value for IssuingDisputeOtherEvidenceProductType") + }) + } +} diff --git a/generated/stripe_shared/src/issuing_dispute_service_not_as_described_evidence.rs b/generated/stripe_shared/src/issuing_dispute_service_not_as_described_evidence.rs new file mode 100644 index 000000000..1ce6c4f88 --- /dev/null +++ b/generated/stripe_shared/src/issuing_dispute_service_not_as_described_evidence.rs @@ -0,0 +1,13 @@ +#[derive(Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct IssuingDisputeServiceNotAsDescribedEvidence { + /// (ID of a [file upload](https://stripe.com/docs/guides/file-upload)) Additional documentation supporting the dispute. + pub additional_documentation: Option>, + /// Date when order was canceled. + pub canceled_at: Option, + /// Reason for canceling the order. + pub cancellation_reason: Option, + /// Explanation of why the cardholder is disputing this transaction. + pub explanation: Option, + /// Date when the product was received. + pub received_at: Option, +} diff --git a/generated/stripe_shared/src/issuing_dispute_treasury.rs b/generated/stripe_shared/src/issuing_dispute_treasury.rs new file mode 100644 index 000000000..dcdb0485d --- /dev/null +++ b/generated/stripe_shared/src/issuing_dispute_treasury.rs @@ -0,0 +1,7 @@ +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct IssuingDisputeTreasury { + /// The Treasury [DebitReversal](https://stripe.com/docs/api/treasury/debit_reversals) representing this Issuing dispute. + pub debit_reversal: Option, + /// The Treasury [ReceivedDebit](https://stripe.com/docs/api/treasury/received_debits) that is being disputed. + pub received_debit: String, +} diff --git a/generated/stripe_shared/src/issuing_network_token_address.rs b/generated/stripe_shared/src/issuing_network_token_address.rs new file mode 100644 index 000000000..942291828 --- /dev/null +++ b/generated/stripe_shared/src/issuing_network_token_address.rs @@ -0,0 +1,7 @@ +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct IssuingNetworkTokenAddress { + /// The street address of the cardholder tokenizing the card. + pub line1: String, + /// The postal code of the cardholder tokenizing the card. + pub postal_code: String, +} diff --git a/generated/stripe_shared/src/issuing_network_token_device.rs b/generated/stripe_shared/src/issuing_network_token_device.rs new file mode 100644 index 000000000..b241db65d --- /dev/null +++ b/generated/stripe_shared/src/issuing_network_token_device.rs @@ -0,0 +1,81 @@ +#[derive(Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct IssuingNetworkTokenDevice { + /// An obfuscated ID derived from the device ID. + #[serde(skip_serializing_if = "Option::is_none")] + pub device_fingerprint: Option, + /// The IP address of the device at provisioning time. + #[serde(skip_serializing_if = "Option::is_none")] + pub ip_address: Option, + /// The geographic latitude/longitude coordinates of the device at provisioning time. + /// The format is [+-]decimal/[+-]decimal. + #[serde(skip_serializing_if = "Option::is_none")] + pub location: Option, + /// The name of the device used for tokenization. + #[serde(skip_serializing_if = "Option::is_none")] + pub name: Option, + /// The phone number of the device used for tokenization. + #[serde(skip_serializing_if = "Option::is_none")] + pub phone_number: Option, + /// The type of device used for tokenization. + #[serde(rename = "type")] + #[serde(skip_serializing_if = "Option::is_none")] + pub type_: Option, +} +/// The type of device used for tokenization. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum IssuingNetworkTokenDeviceType { + Other, + Phone, + Watch, +} +impl IssuingNetworkTokenDeviceType { + pub fn as_str(self) -> &'static str { + use IssuingNetworkTokenDeviceType::*; + match self { + Other => "other", + Phone => "phone", + Watch => "watch", + } + } +} + +impl std::str::FromStr for IssuingNetworkTokenDeviceType { + type Err = (); + fn from_str(s: &str) -> Result { + use IssuingNetworkTokenDeviceType::*; + match s { + "other" => Ok(Other), + "phone" => Ok(Phone), + "watch" => Ok(Watch), + _ => Err(()), + } + } +} +impl std::fmt::Display for IssuingNetworkTokenDeviceType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for IssuingNetworkTokenDeviceType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for IssuingNetworkTokenDeviceType { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for IssuingNetworkTokenDeviceType { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| { + serde::de::Error::custom("Unknown value for IssuingNetworkTokenDeviceType") + }) + } +} diff --git a/generated/stripe_shared/src/issuing_network_token_mastercard.rs b/generated/stripe_shared/src/issuing_network_token_mastercard.rs new file mode 100644 index 000000000..a76c0a20c --- /dev/null +++ b/generated/stripe_shared/src/issuing_network_token_mastercard.rs @@ -0,0 +1,14 @@ +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct IssuingNetworkTokenMastercard { + /// A unique reference ID from MasterCard to represent the card account number. + #[serde(skip_serializing_if = "Option::is_none")] + pub card_reference_id: Option, + /// The network-unique identifier for the token. + pub token_reference_id: String, + /// The ID of the entity requesting tokenization, specific to MasterCard. + pub token_requestor_id: String, + /// The name of the entity requesting tokenization, if known. + /// This is directly provided from MasterCard. + #[serde(skip_serializing_if = "Option::is_none")] + pub token_requestor_name: Option, +} diff --git a/generated/stripe_shared/src/issuing_network_token_network_data.rs b/generated/stripe_shared/src/issuing_network_token_network_data.rs new file mode 100644 index 000000000..acab32015 --- /dev/null +++ b/generated/stripe_shared/src/issuing_network_token_network_data.rs @@ -0,0 +1,71 @@ +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct IssuingNetworkTokenNetworkData { + #[serde(skip_serializing_if = "Option::is_none")] + pub device: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub mastercard: Option, + /// The network that the token is associated with. + /// An additional hash is included with a name matching this value, containing tokenization data specific to the card network. + #[serde(rename = "type")] + pub type_: IssuingNetworkTokenNetworkDataType, + #[serde(skip_serializing_if = "Option::is_none")] + pub visa: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub wallet_provider: Option, +} +/// The network that the token is associated with. +/// An additional hash is included with a name matching this value, containing tokenization data specific to the card network. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum IssuingNetworkTokenNetworkDataType { + Mastercard, + Visa, +} +impl IssuingNetworkTokenNetworkDataType { + pub fn as_str(self) -> &'static str { + use IssuingNetworkTokenNetworkDataType::*; + match self { + Mastercard => "mastercard", + Visa => "visa", + } + } +} + +impl std::str::FromStr for IssuingNetworkTokenNetworkDataType { + type Err = (); + fn from_str(s: &str) -> Result { + use IssuingNetworkTokenNetworkDataType::*; + match s { + "mastercard" => Ok(Mastercard), + "visa" => Ok(Visa), + _ => Err(()), + } + } +} +impl std::fmt::Display for IssuingNetworkTokenNetworkDataType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for IssuingNetworkTokenNetworkDataType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for IssuingNetworkTokenNetworkDataType { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for IssuingNetworkTokenNetworkDataType { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| { + serde::de::Error::custom("Unknown value for IssuingNetworkTokenNetworkDataType") + }) + } +} diff --git a/generated/stripe_shared/src/issuing_network_token_visa.rs b/generated/stripe_shared/src/issuing_network_token_visa.rs new file mode 100644 index 000000000..a88180197 --- /dev/null +++ b/generated/stripe_shared/src/issuing_network_token_visa.rs @@ -0,0 +1,13 @@ +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct IssuingNetworkTokenVisa { + /// A unique reference ID from Visa to represent the card account number. + pub card_reference_id: String, + /// The network-unique identifier for the token. + pub token_reference_id: String, + /// The ID of the entity requesting tokenization, specific to Visa. + pub token_requestor_id: String, + /// Degree of risk associated with the token between `01` and `99`, with higher number indicating higher risk. + /// A `00` value indicates the token was not scored by Visa. + #[serde(skip_serializing_if = "Option::is_none")] + pub token_risk_score: Option, +} diff --git a/generated/stripe_shared/src/issuing_network_token_wallet_provider.rs b/generated/stripe_shared/src/issuing_network_token_wallet_provider.rs new file mode 100644 index 000000000..567fe061a --- /dev/null +++ b/generated/stripe_shared/src/issuing_network_token_wallet_provider.rs @@ -0,0 +1,299 @@ +#[derive(Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct IssuingNetworkTokenWalletProvider { + /// The wallet provider-given account ID of the digital wallet the token belongs to. + #[serde(skip_serializing_if = "Option::is_none")] + pub account_id: Option, + /// An evaluation on the trustworthiness of the wallet account between 1 and 5. + /// A higher score indicates more trustworthy. + #[serde(skip_serializing_if = "Option::is_none")] + pub account_trust_score: Option, + /// The method used for tokenizing a card. + #[serde(skip_serializing_if = "Option::is_none")] + pub card_number_source: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub cardholder_address: Option, + /// The name of the cardholder tokenizing the card. + #[serde(skip_serializing_if = "Option::is_none")] + pub cardholder_name: Option, + /// An evaluation on the trustworthiness of the device. A higher score indicates more trustworthy. + #[serde(skip_serializing_if = "Option::is_none")] + pub device_trust_score: Option, + /// The hashed email address of the cardholder's account with the wallet provider. + #[serde(skip_serializing_if = "Option::is_none")] + pub hashed_account_email_address: Option, + /// The reasons for suggested tokenization given by the card network. + #[serde(skip_serializing_if = "Option::is_none")] + pub reason_codes: Option>, + /// The recommendation on responding to the tokenization request. + #[serde(skip_serializing_if = "Option::is_none")] + pub suggested_decision: Option, + /// The version of the standard for mapping reason codes followed by the wallet provider. + #[serde(skip_serializing_if = "Option::is_none")] + pub suggested_decision_version: Option, +} +/// The method used for tokenizing a card. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum IssuingNetworkTokenWalletProviderCardNumberSource { + App, + Manual, + OnFile, + Other, +} +impl IssuingNetworkTokenWalletProviderCardNumberSource { + pub fn as_str(self) -> &'static str { + use IssuingNetworkTokenWalletProviderCardNumberSource::*; + match self { + App => "app", + Manual => "manual", + OnFile => "on_file", + Other => "other", + } + } +} + +impl std::str::FromStr for IssuingNetworkTokenWalletProviderCardNumberSource { + type Err = (); + fn from_str(s: &str) -> Result { + use IssuingNetworkTokenWalletProviderCardNumberSource::*; + match s { + "app" => Ok(App), + "manual" => Ok(Manual), + "on_file" => Ok(OnFile), + "other" => Ok(Other), + _ => Err(()), + } + } +} +impl std::fmt::Display for IssuingNetworkTokenWalletProviderCardNumberSource { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for IssuingNetworkTokenWalletProviderCardNumberSource { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for IssuingNetworkTokenWalletProviderCardNumberSource { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for IssuingNetworkTokenWalletProviderCardNumberSource { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| { + serde::de::Error::custom( + "Unknown value for IssuingNetworkTokenWalletProviderCardNumberSource", + ) + }) + } +} +/// The reasons for suggested tokenization given by the card network. +#[derive(Copy, Clone, Eq, PartialEq)] +#[non_exhaustive] +pub enum IssuingNetworkTokenWalletProviderReasonCodes { + AccountCardTooNew, + AccountRecentlyChanged, + AccountTooNew, + AccountTooNewSinceLaunch, + AdditionalDevice, + DataExpired, + DeferIdVDecision, + DeviceRecentlyLost, + GoodActivityHistory, + HasSuspendedTokens, + HighRisk, + InactiveAccount, + LongAccountTenure, + LowAccountScore, + LowDeviceScore, + LowPhoneNumberScore, + NetworkServiceError, + OutsideHomeTerritory, + ProvisioningCardholderMismatch, + ProvisioningDeviceAndCardholderMismatch, + ProvisioningDeviceMismatch, + SameDeviceNoPriorAuthentication, + SameDeviceSuccessfulPriorAuthentication, + SoftwareUpdate, + SuspiciousActivity, + TooManyDifferentCardholders, + TooManyRecentAttempts, + TooManyRecentTokens, + /// An unrecognized value from Stripe. Should not be used as a request parameter. + Unknown, +} +impl IssuingNetworkTokenWalletProviderReasonCodes { + pub fn as_str(self) -> &'static str { + use IssuingNetworkTokenWalletProviderReasonCodes::*; + match self { + AccountCardTooNew => "account_card_too_new", + AccountRecentlyChanged => "account_recently_changed", + AccountTooNew => "account_too_new", + AccountTooNewSinceLaunch => "account_too_new_since_launch", + AdditionalDevice => "additional_device", + DataExpired => "data_expired", + DeferIdVDecision => "defer_id_v_decision", + DeviceRecentlyLost => "device_recently_lost", + GoodActivityHistory => "good_activity_history", + HasSuspendedTokens => "has_suspended_tokens", + HighRisk => "high_risk", + InactiveAccount => "inactive_account", + LongAccountTenure => "long_account_tenure", + LowAccountScore => "low_account_score", + LowDeviceScore => "low_device_score", + LowPhoneNumberScore => "low_phone_number_score", + NetworkServiceError => "network_service_error", + OutsideHomeTerritory => "outside_home_territory", + ProvisioningCardholderMismatch => "provisioning_cardholder_mismatch", + ProvisioningDeviceAndCardholderMismatch => { + "provisioning_device_and_cardholder_mismatch" + } + ProvisioningDeviceMismatch => "provisioning_device_mismatch", + SameDeviceNoPriorAuthentication => "same_device_no_prior_authentication", + SameDeviceSuccessfulPriorAuthentication => { + "same_device_successful_prior_authentication" + } + SoftwareUpdate => "software_update", + SuspiciousActivity => "suspicious_activity", + TooManyDifferentCardholders => "too_many_different_cardholders", + TooManyRecentAttempts => "too_many_recent_attempts", + TooManyRecentTokens => "too_many_recent_tokens", + Unknown => "unknown", + } + } +} + +impl std::str::FromStr for IssuingNetworkTokenWalletProviderReasonCodes { + type Err = (); + fn from_str(s: &str) -> Result { + use IssuingNetworkTokenWalletProviderReasonCodes::*; + match s { + "account_card_too_new" => Ok(AccountCardTooNew), + "account_recently_changed" => Ok(AccountRecentlyChanged), + "account_too_new" => Ok(AccountTooNew), + "account_too_new_since_launch" => Ok(AccountTooNewSinceLaunch), + "additional_device" => Ok(AdditionalDevice), + "data_expired" => Ok(DataExpired), + "defer_id_v_decision" => Ok(DeferIdVDecision), + "device_recently_lost" => Ok(DeviceRecentlyLost), + "good_activity_history" => Ok(GoodActivityHistory), + "has_suspended_tokens" => Ok(HasSuspendedTokens), + "high_risk" => Ok(HighRisk), + "inactive_account" => Ok(InactiveAccount), + "long_account_tenure" => Ok(LongAccountTenure), + "low_account_score" => Ok(LowAccountScore), + "low_device_score" => Ok(LowDeviceScore), + "low_phone_number_score" => Ok(LowPhoneNumberScore), + "network_service_error" => Ok(NetworkServiceError), + "outside_home_territory" => Ok(OutsideHomeTerritory), + "provisioning_cardholder_mismatch" => Ok(ProvisioningCardholderMismatch), + "provisioning_device_and_cardholder_mismatch" => { + Ok(ProvisioningDeviceAndCardholderMismatch) + } + "provisioning_device_mismatch" => Ok(ProvisioningDeviceMismatch), + "same_device_no_prior_authentication" => Ok(SameDeviceNoPriorAuthentication), + "same_device_successful_prior_authentication" => { + Ok(SameDeviceSuccessfulPriorAuthentication) + } + "software_update" => Ok(SoftwareUpdate), + "suspicious_activity" => Ok(SuspiciousActivity), + "too_many_different_cardholders" => Ok(TooManyDifferentCardholders), + "too_many_recent_attempts" => Ok(TooManyRecentAttempts), + "too_many_recent_tokens" => Ok(TooManyRecentTokens), + _ => Err(()), + } + } +} +impl std::fmt::Display for IssuingNetworkTokenWalletProviderReasonCodes { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for IssuingNetworkTokenWalletProviderReasonCodes { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for IssuingNetworkTokenWalletProviderReasonCodes { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for IssuingNetworkTokenWalletProviderReasonCodes { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Ok(Self::from_str(&s).unwrap_or(IssuingNetworkTokenWalletProviderReasonCodes::Unknown)) + } +} +/// The recommendation on responding to the tokenization request. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum IssuingNetworkTokenWalletProviderSuggestedDecision { + Approve, + Decline, + RequireAuth, +} +impl IssuingNetworkTokenWalletProviderSuggestedDecision { + pub fn as_str(self) -> &'static str { + use IssuingNetworkTokenWalletProviderSuggestedDecision::*; + match self { + Approve => "approve", + Decline => "decline", + RequireAuth => "require_auth", + } + } +} + +impl std::str::FromStr for IssuingNetworkTokenWalletProviderSuggestedDecision { + type Err = (); + fn from_str(s: &str) -> Result { + use IssuingNetworkTokenWalletProviderSuggestedDecision::*; + match s { + "approve" => Ok(Approve), + "decline" => Ok(Decline), + "require_auth" => Ok(RequireAuth), + _ => Err(()), + } + } +} +impl std::fmt::Display for IssuingNetworkTokenWalletProviderSuggestedDecision { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for IssuingNetworkTokenWalletProviderSuggestedDecision { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for IssuingNetworkTokenWalletProviderSuggestedDecision { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for IssuingNetworkTokenWalletProviderSuggestedDecision { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| { + serde::de::Error::custom( + "Unknown value for IssuingNetworkTokenWalletProviderSuggestedDecision", + ) + }) + } +} diff --git a/generated/stripe_shared/src/issuing_token.rs b/generated/stripe_shared/src/issuing_token.rs new file mode 100644 index 000000000..2867187c1 --- /dev/null +++ b/generated/stripe_shared/src/issuing_token.rs @@ -0,0 +1,209 @@ +/// An issuing token object is created when an issued card is added to a digital wallet. +/// As a [card issuer](https://stripe.com/docs/issuing), you can [view and manage these tokens](https://stripe.com/docs/issuing/controls/token-management) through Stripe. +/// +/// For more details see <>. +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct IssuingToken { + /// Card associated with this token. + pub card: stripe_types::Expandable, + /// Time at which the object was created. Measured in seconds since the Unix epoch. + pub created: stripe_types::Timestamp, + /// The hashed ID derived from the device ID from the card network associated with the token + pub device_fingerprint: Option, + /// Unique identifier for the object. + pub id: stripe_shared::IssuingTokenId, + /// The last four digits of the token. + #[serde(skip_serializing_if = "Option::is_none")] + pub last4: Option, + /// Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + pub livemode: bool, + /// The token service provider / card network associated with the token. + pub network: IssuingTokenNetwork, + #[serde(skip_serializing_if = "Option::is_none")] + pub network_data: Option, + /// Time at which the token was last updated by the card network. + /// Measured in seconds since the Unix epoch. + pub network_updated_at: stripe_types::Timestamp, + /// The usage state of the token. + pub status: stripe_shared::IssuingTokenStatus, + /// The digital wallet for this token, if one was used. + #[serde(skip_serializing_if = "Option::is_none")] + pub wallet_provider: Option, +} +/// The token service provider / card network associated with the token. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum IssuingTokenNetwork { + Mastercard, + Visa, +} +impl IssuingTokenNetwork { + pub fn as_str(self) -> &'static str { + use IssuingTokenNetwork::*; + match self { + Mastercard => "mastercard", + Visa => "visa", + } + } +} + +impl std::str::FromStr for IssuingTokenNetwork { + type Err = (); + fn from_str(s: &str) -> Result { + use IssuingTokenNetwork::*; + match s { + "mastercard" => Ok(Mastercard), + "visa" => Ok(Visa), + _ => Err(()), + } + } +} +impl std::fmt::Display for IssuingTokenNetwork { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for IssuingTokenNetwork { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for IssuingTokenNetwork { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for IssuingTokenNetwork { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s) + .map_err(|_| serde::de::Error::custom("Unknown value for IssuingTokenNetwork")) + } +} +/// The digital wallet for this token, if one was used. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum IssuingTokenWalletProvider { + ApplePay, + GooglePay, + SamsungPay, +} +impl IssuingTokenWalletProvider { + pub fn as_str(self) -> &'static str { + use IssuingTokenWalletProvider::*; + match self { + ApplePay => "apple_pay", + GooglePay => "google_pay", + SamsungPay => "samsung_pay", + } + } +} + +impl std::str::FromStr for IssuingTokenWalletProvider { + type Err = (); + fn from_str(s: &str) -> Result { + use IssuingTokenWalletProvider::*; + match s { + "apple_pay" => Ok(ApplePay), + "google_pay" => Ok(GooglePay), + "samsung_pay" => Ok(SamsungPay), + _ => Err(()), + } + } +} +impl std::fmt::Display for IssuingTokenWalletProvider { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for IssuingTokenWalletProvider { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for IssuingTokenWalletProvider { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for IssuingTokenWalletProvider { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s) + .map_err(|_| serde::de::Error::custom("Unknown value for IssuingTokenWalletProvider")) + } +} +impl stripe_types::Object for IssuingToken { + type Id = stripe_shared::IssuingTokenId; + fn id(&self) -> &Self::Id { + &self.id + } +} +stripe_types::def_id!(IssuingTokenId); +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum IssuingTokenStatus { + Active, + Deleted, + Requested, + Suspended, +} +impl IssuingTokenStatus { + pub fn as_str(self) -> &'static str { + use IssuingTokenStatus::*; + match self { + Active => "active", + Deleted => "deleted", + Requested => "requested", + Suspended => "suspended", + } + } +} + +impl std::str::FromStr for IssuingTokenStatus { + type Err = (); + fn from_str(s: &str) -> Result { + use IssuingTokenStatus::*; + match s { + "active" => Ok(Active), + "deleted" => Ok(Deleted), + "requested" => Ok(Requested), + "suspended" => Ok(Suspended), + _ => Err(()), + } + } +} +impl std::fmt::Display for IssuingTokenStatus { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for IssuingTokenStatus { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for IssuingTokenStatus { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for IssuingTokenStatus { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s) + .map_err(|_| serde::de::Error::custom("Unknown value for IssuingTokenStatus")) + } +} diff --git a/generated/stripe_shared/src/issuing_transaction.rs b/generated/stripe_shared/src/issuing_transaction.rs new file mode 100644 index 000000000..c7251e7ec --- /dev/null +++ b/generated/stripe_shared/src/issuing_transaction.rs @@ -0,0 +1,177 @@ +/// Any use of an [issued card](https://stripe.com/docs/issuing) that results in funds entering or leaving. +/// your Stripe account, such as a completed purchase or refund, is represented by an Issuing +/// `Transaction` object. +/// +/// Related guide: [Issued card transactions](https://stripe.com/docs/issuing/purchases/transactions) +/// +/// For more details see <>. +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct IssuingTransaction { + /// The transaction amount, which will be reflected in your balance. + /// This amount is in your currency and in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal). + pub amount: i64, + /// Detailed breakdown of amount components. + /// These amounts are denominated in `currency` and in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal). + pub amount_details: Option, + /// The `Authorization` object that led to this transaction. + pub authorization: Option>, + /// ID of the [balance transaction](https://stripe.com/docs/api/balance_transactions) associated with this transaction. + pub balance_transaction: Option>, + /// The card used to make this transaction. + pub card: stripe_types::Expandable, + /// The cardholder to whom this transaction belongs. + pub cardholder: Option>, + /// Time at which the object was created. Measured in seconds since the Unix epoch. + pub created: stripe_types::Timestamp, + /// Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. + /// Must be a [supported currency](https://stripe.com/docs/currencies). + pub currency: stripe_types::Currency, + /// If you've disputed the transaction, the ID of the dispute. + pub dispute: Option>, + /// Unique identifier for the object. + pub id: stripe_shared::IssuingTransactionId, + /// Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + pub livemode: bool, + /// The amount that the merchant will receive, denominated in `merchant_currency` and in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal). + /// It will be different from `amount` if the merchant is taking payment in a different currency. + pub merchant_amount: i64, + /// The currency with which the merchant is taking payment. + pub merchant_currency: stripe_types::Currency, + pub merchant_data: stripe_shared::IssuingAuthorizationMerchantData, + /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. + /// This can be useful for storing additional information about the object in a structured format. + pub metadata: std::collections::HashMap, + /// Details about the transaction, such as processing dates, set by the card network. + pub network_data: Option, + /// Additional purchase information that is optionally provided by the merchant. + pub purchase_details: Option, + /// [Token](https://stripe.com/docs/api/issuing/tokens/object) object used for this transaction. + /// If a network token was not used for this transaction, this field will be null. + #[serde(skip_serializing_if = "Option::is_none")] + pub token: Option>, + /// [Treasury](https://stripe.com/docs/api/treasury) details related to this transaction if it was created on a [FinancialAccount](/docs/api/treasury/financial_accounts. + #[serde(skip_serializing_if = "Option::is_none")] + pub treasury: Option, + /// The nature of the transaction. + #[serde(rename = "type")] + pub type_: stripe_shared::IssuingTransactionType, + /// The digital wallet used for this transaction. One of `apple_pay`, `google_pay`, or `samsung_pay`. + pub wallet: Option, +} +/// The digital wallet used for this transaction. One of `apple_pay`, `google_pay`, or `samsung_pay`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum IssuingTransactionWallet { + ApplePay, + GooglePay, + SamsungPay, +} +impl IssuingTransactionWallet { + pub fn as_str(self) -> &'static str { + use IssuingTransactionWallet::*; + match self { + ApplePay => "apple_pay", + GooglePay => "google_pay", + SamsungPay => "samsung_pay", + } + } +} + +impl std::str::FromStr for IssuingTransactionWallet { + type Err = (); + fn from_str(s: &str) -> Result { + use IssuingTransactionWallet::*; + match s { + "apple_pay" => Ok(ApplePay), + "google_pay" => Ok(GooglePay), + "samsung_pay" => Ok(SamsungPay), + _ => Err(()), + } + } +} +impl std::fmt::Display for IssuingTransactionWallet { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for IssuingTransactionWallet { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for IssuingTransactionWallet { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for IssuingTransactionWallet { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s) + .map_err(|_| serde::de::Error::custom("Unknown value for IssuingTransactionWallet")) + } +} +impl stripe_types::Object for IssuingTransaction { + type Id = stripe_shared::IssuingTransactionId; + fn id(&self) -> &Self::Id { + &self.id + } +} +stripe_types::def_id!(IssuingTransactionId, "ipi_"); +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum IssuingTransactionType { + Capture, + Refund, +} +impl IssuingTransactionType { + pub fn as_str(self) -> &'static str { + use IssuingTransactionType::*; + match self { + Capture => "capture", + Refund => "refund", + } + } +} + +impl std::str::FromStr for IssuingTransactionType { + type Err = (); + fn from_str(s: &str) -> Result { + use IssuingTransactionType::*; + match s { + "capture" => Ok(Capture), + "refund" => Ok(Refund), + _ => Err(()), + } + } +} +impl std::fmt::Display for IssuingTransactionType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for IssuingTransactionType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for IssuingTransactionType { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for IssuingTransactionType { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s) + .map_err(|_| serde::de::Error::custom("Unknown value for IssuingTransactionType")) + } +} diff --git a/generated/stripe_shared/src/issuing_transaction_amount_details.rs b/generated/stripe_shared/src/issuing_transaction_amount_details.rs new file mode 100644 index 000000000..8c5db148b --- /dev/null +++ b/generated/stripe_shared/src/issuing_transaction_amount_details.rs @@ -0,0 +1,7 @@ +#[derive(Copy, Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct IssuingTransactionAmountDetails { + /// The fee charged by the ATM for the cash withdrawal. + pub atm_fee: Option, + /// The amount of cash requested by the cardholder. + pub cashback_amount: Option, +} diff --git a/generated/stripe_shared/src/issuing_transaction_flight_data.rs b/generated/stripe_shared/src/issuing_transaction_flight_data.rs new file mode 100644 index 000000000..17c546ad4 --- /dev/null +++ b/generated/stripe_shared/src/issuing_transaction_flight_data.rs @@ -0,0 +1,13 @@ +#[derive(Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct IssuingTransactionFlightData { + /// The time that the flight departed. + pub departure_at: Option, + /// The name of the passenger. + pub passenger_name: Option, + /// Whether the ticket is refundable. + pub refundable: Option, + /// The legs of the trip. + pub segments: Option>, + /// The travel agency that issued the ticket. + pub travel_agency: Option, +} diff --git a/generated/stripe_shared/src/issuing_transaction_flight_data_leg.rs b/generated/stripe_shared/src/issuing_transaction_flight_data_leg.rs new file mode 100644 index 000000000..18571a91d --- /dev/null +++ b/generated/stripe_shared/src/issuing_transaction_flight_data_leg.rs @@ -0,0 +1,15 @@ +#[derive(Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct IssuingTransactionFlightDataLeg { + /// The three-letter IATA airport code of the flight's destination. + pub arrival_airport_code: Option, + /// The airline carrier code. + pub carrier: Option, + /// The three-letter IATA airport code that the flight departed from. + pub departure_airport_code: Option, + /// The flight number. + pub flight_number: Option, + /// The flight's service class. + pub service_class: Option, + /// Whether a stopover is allowed on this flight. + pub stopover_allowed: Option, +} diff --git a/generated/stripe_shared/src/issuing_transaction_fuel_data.rs b/generated/stripe_shared/src/issuing_transaction_fuel_data.rs new file mode 100644 index 000000000..cfdece44e --- /dev/null +++ b/generated/stripe_shared/src/issuing_transaction_fuel_data.rs @@ -0,0 +1,13 @@ +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct IssuingTransactionFuelData { + /// The type of fuel that was purchased. + /// One of `diesel`, `unleaded_plus`, `unleaded_regular`, `unleaded_super`, or `other`. + #[serde(rename = "type")] + pub type_: String, + /// The units for `volume_decimal`. One of `us_gallon` or `liter`. + pub unit: String, + /// The cost in cents per each unit of fuel, represented as a decimal string with at most 12 decimal places. + pub unit_cost_decimal: String, + /// The volume of the fuel that was pumped, represented as a decimal string with at most 12 decimal places. + pub volume_decimal: Option, +} diff --git a/generated/stripe_shared/src/issuing_transaction_lodging_data.rs b/generated/stripe_shared/src/issuing_transaction_lodging_data.rs new file mode 100644 index 000000000..cc69c37f7 --- /dev/null +++ b/generated/stripe_shared/src/issuing_transaction_lodging_data.rs @@ -0,0 +1,7 @@ +#[derive(Copy, Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct IssuingTransactionLodgingData { + /// The time of checking into the lodging. + pub check_in_at: Option, + /// The number of nights stayed at the lodging. + pub nights: Option, +} diff --git a/generated/stripe_shared/src/issuing_transaction_network_data.rs b/generated/stripe_shared/src/issuing_transaction_network_data.rs new file mode 100644 index 000000000..4f36934ff --- /dev/null +++ b/generated/stripe_shared/src/issuing_transaction_network_data.rs @@ -0,0 +1,14 @@ +#[derive(Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct IssuingTransactionNetworkData { + /// A code created by Stripe which is shared with the merchant to validate the authorization. + /// This field will be populated if the authorization message was approved. + /// The code typically starts with the letter "S", followed by a six-digit number. + /// For example, "S498162". + /// Please note that the code is not guaranteed to be unique across authorizations. + pub authorization_code: Option, + /// The date the transaction was processed by the card network. + /// This can be different from the date the seller recorded the transaction depending on when the acquirer submits the transaction to the network. + pub processing_date: Option, + /// Unique identifier for the authorization assigned by the card network used to match subsequent messages, disputes, and transactions. + pub transaction_id: Option, +} diff --git a/generated/stripe_shared/src/issuing_transaction_purchase_details.rs b/generated/stripe_shared/src/issuing_transaction_purchase_details.rs new file mode 100644 index 000000000..354982a88 --- /dev/null +++ b/generated/stripe_shared/src/issuing_transaction_purchase_details.rs @@ -0,0 +1,13 @@ +#[derive(Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct IssuingTransactionPurchaseDetails { + /// Information about the flight that was purchased with this transaction. + pub flight: Option, + /// Information about fuel that was purchased with this transaction. + pub fuel: Option, + /// Information about lodging that was purchased with this transaction. + pub lodging: Option, + /// The line items in the purchase. + pub receipt: Option>, + /// A merchant-specific order number. + pub reference: Option, +} diff --git a/generated/stripe_shared/src/issuing_transaction_receipt_data.rs b/generated/stripe_shared/src/issuing_transaction_receipt_data.rs new file mode 100644 index 000000000..e16f7d813 --- /dev/null +++ b/generated/stripe_shared/src/issuing_transaction_receipt_data.rs @@ -0,0 +1,11 @@ +#[derive(Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct IssuingTransactionReceiptData { + /// The description of the item. The maximum length of this field is 26 characters. + pub description: Option, + /// The quantity of the item. + pub quantity: Option, + /// The total for this line item in cents. + pub total: Option, + /// The unit cost of the item in cents. + pub unit_cost: Option, +} diff --git a/generated/stripe_shared/src/issuing_transaction_treasury.rs b/generated/stripe_shared/src/issuing_transaction_treasury.rs new file mode 100644 index 000000000..e48dad849 --- /dev/null +++ b/generated/stripe_shared/src/issuing_transaction_treasury.rs @@ -0,0 +1,7 @@ +#[derive(Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct IssuingTransactionTreasury { + /// The Treasury [ReceivedCredit](https://stripe.com/docs/api/treasury/received_credits) representing this Issuing transaction if it is a refund. + pub received_credit: Option, + /// The Treasury [ReceivedDebit](https://stripe.com/docs/api/treasury/received_debits) representing this Issuing transaction if it is a capture. + pub received_debit: Option, +} diff --git a/generated/stripe_shared/src/legal_entity_company.rs b/generated/stripe_shared/src/legal_entity_company.rs new file mode 100644 index 000000000..34f2221c1 --- /dev/null +++ b/generated/stripe_shared/src/legal_entity_company.rs @@ -0,0 +1,182 @@ +#[derive(Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct LegalEntityCompany { + #[serde(skip_serializing_if = "Option::is_none")] + pub address: Option, + /// The Kana variation of the company's primary address (Japan only). + #[serde(skip_serializing_if = "Option::is_none")] + pub address_kana: Option, + /// The Kanji variation of the company's primary address (Japan only). + #[serde(skip_serializing_if = "Option::is_none")] + pub address_kanji: Option, + /// Whether the company's directors have been provided. + /// This Boolean will be `true` if you've manually indicated that all directors are provided via [the `directors_provided` parameter](https://stripe.com/docs/api/accounts/update#update_account-company-directors_provided). + #[serde(skip_serializing_if = "Option::is_none")] + pub directors_provided: Option, + /// Whether the company's executives have been provided. + /// This Boolean will be `true` if you've manually indicated that all executives are provided via [the `executives_provided` parameter](https://stripe.com/docs/api/accounts/update#update_account-company-executives_provided), or if Stripe determined that sufficient executives were provided. + #[serde(skip_serializing_if = "Option::is_none")] + pub executives_provided: Option, + /// The export license ID number of the company, also referred as Import Export Code (India only). + #[serde(skip_serializing_if = "Option::is_none")] + pub export_license_id: Option, + /// The purpose code to use for export transactions (India only). + #[serde(skip_serializing_if = "Option::is_none")] + pub export_purpose_code: Option, + /// The company's legal name. + #[serde(skip_serializing_if = "Option::is_none")] + pub name: Option, + /// The Kana variation of the company's legal name (Japan only). + #[serde(skip_serializing_if = "Option::is_none")] + pub name_kana: Option, + /// The Kanji variation of the company's legal name (Japan only). + #[serde(skip_serializing_if = "Option::is_none")] + pub name_kanji: Option, + /// Whether the company's owners have been provided. + /// This Boolean will be `true` if you've manually indicated that all owners are provided via [the `owners_provided` parameter](https://stripe.com/docs/api/accounts/update#update_account-company-owners_provided), or if Stripe determined that sufficient owners were provided. + /// Stripe determines ownership requirements using both the number of owners provided and their total percent ownership (calculated by adding the `percent_ownership` of each owner together). + #[serde(skip_serializing_if = "Option::is_none")] + pub owners_provided: Option, + /// This hash is used to attest that the beneficial owner information provided to Stripe is both current and correct. + #[serde(skip_serializing_if = "Option::is_none")] + pub ownership_declaration: Option, + /// The company's phone number (used for verification). + #[serde(skip_serializing_if = "Option::is_none")] + pub phone: Option, + /// The category identifying the legal structure of the company or legal entity. + /// See [Business structure](https://stripe.com/docs/connect/identity-verification#business-structure) for more details. + #[serde(skip_serializing_if = "Option::is_none")] + pub structure: Option, + /// Whether the company's business ID number was provided. + #[serde(skip_serializing_if = "Option::is_none")] + pub tax_id_provided: Option, + /// The jurisdiction in which the `tax_id` is registered (Germany-based companies only). + #[serde(skip_serializing_if = "Option::is_none")] + pub tax_id_registrar: Option, + /// Whether the company's business VAT number was provided. + #[serde(skip_serializing_if = "Option::is_none")] + pub vat_id_provided: Option, + /// Information on the verification state of the company. + #[serde(skip_serializing_if = "Option::is_none")] + pub verification: Option, +} +/// The category identifying the legal structure of the company or legal entity. +/// See [Business structure](https://stripe.com/docs/connect/identity-verification#business-structure) for more details. +#[derive(Copy, Clone, Eq, PartialEq)] +#[non_exhaustive] +pub enum LegalEntityCompanyStructure { + FreeZoneEstablishment, + FreeZoneLlc, + GovernmentInstrumentality, + GovernmentalUnit, + IncorporatedNonProfit, + IncorporatedPartnership, + LimitedLiabilityPartnership, + Llc, + MultiMemberLlc, + PrivateCompany, + PrivateCorporation, + PrivatePartnership, + PublicCompany, + PublicCorporation, + PublicPartnership, + RegisteredCharity, + SingleMemberLlc, + SoleEstablishment, + SoleProprietorship, + TaxExemptGovernmentInstrumentality, + UnincorporatedAssociation, + UnincorporatedNonProfit, + UnincorporatedPartnership, + /// An unrecognized value from Stripe. Should not be used as a request parameter. + Unknown, +} +impl LegalEntityCompanyStructure { + pub fn as_str(self) -> &'static str { + use LegalEntityCompanyStructure::*; + match self { + FreeZoneEstablishment => "free_zone_establishment", + FreeZoneLlc => "free_zone_llc", + GovernmentInstrumentality => "government_instrumentality", + GovernmentalUnit => "governmental_unit", + IncorporatedNonProfit => "incorporated_non_profit", + IncorporatedPartnership => "incorporated_partnership", + LimitedLiabilityPartnership => "limited_liability_partnership", + Llc => "llc", + MultiMemberLlc => "multi_member_llc", + PrivateCompany => "private_company", + PrivateCorporation => "private_corporation", + PrivatePartnership => "private_partnership", + PublicCompany => "public_company", + PublicCorporation => "public_corporation", + PublicPartnership => "public_partnership", + RegisteredCharity => "registered_charity", + SingleMemberLlc => "single_member_llc", + SoleEstablishment => "sole_establishment", + SoleProprietorship => "sole_proprietorship", + TaxExemptGovernmentInstrumentality => "tax_exempt_government_instrumentality", + UnincorporatedAssociation => "unincorporated_association", + UnincorporatedNonProfit => "unincorporated_non_profit", + UnincorporatedPartnership => "unincorporated_partnership", + Unknown => "unknown", + } + } +} + +impl std::str::FromStr for LegalEntityCompanyStructure { + type Err = (); + fn from_str(s: &str) -> Result { + use LegalEntityCompanyStructure::*; + match s { + "free_zone_establishment" => Ok(FreeZoneEstablishment), + "free_zone_llc" => Ok(FreeZoneLlc), + "government_instrumentality" => Ok(GovernmentInstrumentality), + "governmental_unit" => Ok(GovernmentalUnit), + "incorporated_non_profit" => Ok(IncorporatedNonProfit), + "incorporated_partnership" => Ok(IncorporatedPartnership), + "limited_liability_partnership" => Ok(LimitedLiabilityPartnership), + "llc" => Ok(Llc), + "multi_member_llc" => Ok(MultiMemberLlc), + "private_company" => Ok(PrivateCompany), + "private_corporation" => Ok(PrivateCorporation), + "private_partnership" => Ok(PrivatePartnership), + "public_company" => Ok(PublicCompany), + "public_corporation" => Ok(PublicCorporation), + "public_partnership" => Ok(PublicPartnership), + "registered_charity" => Ok(RegisteredCharity), + "single_member_llc" => Ok(SingleMemberLlc), + "sole_establishment" => Ok(SoleEstablishment), + "sole_proprietorship" => Ok(SoleProprietorship), + "tax_exempt_government_instrumentality" => Ok(TaxExemptGovernmentInstrumentality), + "unincorporated_association" => Ok(UnincorporatedAssociation), + "unincorporated_non_profit" => Ok(UnincorporatedNonProfit), + "unincorporated_partnership" => Ok(UnincorporatedPartnership), + _ => Err(()), + } + } +} +impl std::fmt::Display for LegalEntityCompanyStructure { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for LegalEntityCompanyStructure { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for LegalEntityCompanyStructure { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for LegalEntityCompanyStructure { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Ok(Self::from_str(&s).unwrap_or(LegalEntityCompanyStructure::Unknown)) + } +} diff --git a/generated/stripe_shared/src/legal_entity_company_verification.rs b/generated/stripe_shared/src/legal_entity_company_verification.rs new file mode 100644 index 000000000..cbe5a09d7 --- /dev/null +++ b/generated/stripe_shared/src/legal_entity_company_verification.rs @@ -0,0 +1,4 @@ +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct LegalEntityCompanyVerification { + pub document: stripe_shared::LegalEntityCompanyVerificationDocument, +} diff --git a/generated/stripe_shared/src/legal_entity_company_verification_document.rs b/generated/stripe_shared/src/legal_entity_company_verification_document.rs new file mode 100644 index 000000000..6e9e6b843 --- /dev/null +++ b/generated/stripe_shared/src/legal_entity_company_verification_document.rs @@ -0,0 +1,12 @@ +#[derive(Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct LegalEntityCompanyVerificationDocument { + /// The back of a document returned by a [file upload](https://stripe.com/docs/api#create_file) with a `purpose` value of `additional_verification`. + pub back: Option>, + /// A user-displayable string describing the verification state of this document. + pub details: Option, + /// One of `document_corrupt`, `document_expired`, `document_failed_copy`, `document_failed_greyscale`, `document_failed_other`, `document_failed_test_mode`, `document_fraudulent`, `document_incomplete`, `document_invalid`, `document_manipulated`, `document_not_readable`, `document_not_uploaded`, `document_type_not_supported`, or `document_too_large`. + /// A machine-readable code specifying the verification state for this document. + pub details_code: Option, + /// The front of a document returned by a [file upload](https://stripe.com/docs/api#create_file) with a `purpose` value of `additional_verification`. + pub front: Option>, +} diff --git a/generated/stripe_shared/src/legal_entity_dob.rs b/generated/stripe_shared/src/legal_entity_dob.rs new file mode 100644 index 000000000..44dc0a314 --- /dev/null +++ b/generated/stripe_shared/src/legal_entity_dob.rs @@ -0,0 +1,9 @@ +#[derive(Copy, Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct LegalEntityDob { + /// The day of birth, between 1 and 31. + pub day: Option, + /// The month of birth, between 1 and 12. + pub month: Option, + /// The four-digit year of birth. + pub year: Option, +} diff --git a/src/resources/generated/legal_entity_japan_address.rs b/generated/stripe_shared/src/legal_entity_japan_address.rs similarity index 60% rename from src/resources/generated/legal_entity_japan_address.rs rename to generated/stripe_shared/src/legal_entity_japan_address.rs index 06250c23b..38fd816e7 100644 --- a/src/resources/generated/legal_entity_japan_address.rs +++ b/generated/stripe_shared/src/legal_entity_japan_address.rs @@ -1,31 +1,17 @@ -// ====================================== -// This file was automatically generated. -// ====================================== - -use serde::{Deserialize, Serialize}; - -/// The resource representing a Stripe "LegalEntityJapanAddress". -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct Address { - +#[derive(Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct LegalEntityJapanAddress { /// City/Ward. pub city: Option, - /// Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). pub country: Option, - /// Block/Building number. pub line1: Option, - /// Building details. pub line2: Option, - /// ZIP or postal code. pub postal_code: Option, - /// Prefecture. pub state: Option, - /// Town/cho-me. pub town: Option, } diff --git a/generated/stripe_shared/src/legal_entity_person_verification.rs b/generated/stripe_shared/src/legal_entity_person_verification.rs new file mode 100644 index 000000000..ff947c2b5 --- /dev/null +++ b/generated/stripe_shared/src/legal_entity_person_verification.rs @@ -0,0 +1,19 @@ +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct LegalEntityPersonVerification { + /// A document showing address, either a passport, local ID card, or utility bill from a well-known utility company. + #[serde(skip_serializing_if = "Option::is_none")] + pub additional_document: Option, + /// A user-displayable string describing the verification state for the person. + /// For example, this may say "Provided identity information could not be verified". + #[serde(skip_serializing_if = "Option::is_none")] + pub details: Option, + /// One of `document_address_mismatch`, `document_dob_mismatch`, `document_duplicate_type`, `document_id_number_mismatch`, `document_name_mismatch`, `document_nationality_mismatch`, `failed_keyed_identity`, or `failed_other`. + /// A machine-readable code specifying the verification state for the person. + #[serde(skip_serializing_if = "Option::is_none")] + pub details_code: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub document: Option, + /// The state of verification for the person. + /// Possible values are `unverified`, `pending`, or `verified`. + pub status: String, +} diff --git a/generated/stripe_shared/src/legal_entity_person_verification_document.rs b/generated/stripe_shared/src/legal_entity_person_verification_document.rs new file mode 100644 index 000000000..24e4bc03e --- /dev/null +++ b/generated/stripe_shared/src/legal_entity_person_verification_document.rs @@ -0,0 +1,13 @@ +#[derive(Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct LegalEntityPersonVerificationDocument { + /// The back of an ID returned by a [file upload](https://stripe.com/docs/api#create_file) with a `purpose` value of `identity_document`. + pub back: Option>, + /// A user-displayable string describing the verification state of this document. + /// For example, if a document is uploaded and the picture is too fuzzy, this may say "Identity document is too unclear to read". + pub details: Option, + /// One of `document_corrupt`, `document_country_not_supported`, `document_expired`, `document_failed_copy`, `document_failed_other`, `document_failed_test_mode`, `document_fraudulent`, `document_failed_greyscale`, `document_incomplete`, `document_invalid`, `document_manipulated`, `document_missing_back`, `document_missing_front`, `document_not_readable`, `document_not_uploaded`, `document_photo_mismatch`, `document_too_large`, or `document_type_not_supported`. + /// A machine-readable code specifying the verification state for this document. + pub details_code: Option, + /// The front of an ID returned by a [file upload](https://stripe.com/docs/api#create_file) with a `purpose` value of `identity_document`. + pub front: Option>, +} diff --git a/generated/stripe_shared/src/legal_entity_ubo_declaration.rs b/generated/stripe_shared/src/legal_entity_ubo_declaration.rs new file mode 100644 index 000000000..1db87525d --- /dev/null +++ b/generated/stripe_shared/src/legal_entity_ubo_declaration.rs @@ -0,0 +1,9 @@ +#[derive(Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct LegalEntityUboDeclaration { + /// The Unix timestamp marking when the beneficial owner attestation was made. + pub date: Option, + /// The IP address from which the beneficial owner attestation was made. + pub ip: Option, + /// The user-agent string from the browser where the beneficial owner attestation was made. + pub user_agent: Option, +} diff --git a/generated/stripe_shared/src/level3.rs b/generated/stripe_shared/src/level3.rs new file mode 100644 index 000000000..d61172c79 --- /dev/null +++ b/generated/stripe_shared/src/level3.rs @@ -0,0 +1,13 @@ +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct Level3 { + #[serde(skip_serializing_if = "Option::is_none")] + pub customer_reference: Option, + pub line_items: Vec, + pub merchant_reference: String, + #[serde(skip_serializing_if = "Option::is_none")] + pub shipping_address_zip: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub shipping_amount: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub shipping_from_zip: Option, +} diff --git a/generated/stripe_shared/src/level3_line_items.rs b/generated/stripe_shared/src/level3_line_items.rs new file mode 100644 index 000000000..60d0a1321 --- /dev/null +++ b/generated/stripe_shared/src/level3_line_items.rs @@ -0,0 +1,9 @@ +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct Level3LineItems { + pub discount_amount: Option, + pub product_code: String, + pub product_description: String, + pub quantity: Option, + pub tax_amount: Option, + pub unit_cost: Option, +} diff --git a/generated/stripe_shared/src/line_items_discount_amount.rs b/generated/stripe_shared/src/line_items_discount_amount.rs new file mode 100644 index 000000000..a0027caf1 --- /dev/null +++ b/generated/stripe_shared/src/line_items_discount_amount.rs @@ -0,0 +1,6 @@ +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct LineItemsDiscountAmount { + /// The amount discounted. + pub amount: i64, + pub discount: stripe_shared::Discount, +} diff --git a/generated/stripe_shared/src/line_items_tax_amount.rs b/generated/stripe_shared/src/line_items_tax_amount.rs new file mode 100644 index 000000000..77f14c659 --- /dev/null +++ b/generated/stripe_shared/src/line_items_tax_amount.rs @@ -0,0 +1,108 @@ +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct LineItemsTaxAmount { + /// Amount of tax applied for this rate. + pub amount: i64, + pub rate: stripe_shared::TaxRate, + /// The reasoning behind this tax, for example, if the product is tax exempt. + /// The possible values for this field may be extended as new tax rules are supported. + pub taxability_reason: Option, + /// The amount on which tax is calculated, in cents (or local equivalent). + pub taxable_amount: Option, +} +/// The reasoning behind this tax, for example, if the product is tax exempt. +/// The possible values for this field may be extended as new tax rules are supported. +#[derive(Copy, Clone, Eq, PartialEq)] +#[non_exhaustive] +pub enum LineItemsTaxAmountTaxabilityReason { + CustomerExempt, + NotCollecting, + NotSubjectToTax, + NotSupported, + PortionProductExempt, + PortionReducedRated, + PortionStandardRated, + ProductExempt, + ProductExemptHoliday, + ProportionallyRated, + ReducedRated, + ReverseCharge, + StandardRated, + TaxableBasisReduced, + ZeroRated, + /// An unrecognized value from Stripe. Should not be used as a request parameter. + Unknown, +} +impl LineItemsTaxAmountTaxabilityReason { + pub fn as_str(self) -> &'static str { + use LineItemsTaxAmountTaxabilityReason::*; + match self { + CustomerExempt => "customer_exempt", + NotCollecting => "not_collecting", + NotSubjectToTax => "not_subject_to_tax", + NotSupported => "not_supported", + PortionProductExempt => "portion_product_exempt", + PortionReducedRated => "portion_reduced_rated", + PortionStandardRated => "portion_standard_rated", + ProductExempt => "product_exempt", + ProductExemptHoliday => "product_exempt_holiday", + ProportionallyRated => "proportionally_rated", + ReducedRated => "reduced_rated", + ReverseCharge => "reverse_charge", + StandardRated => "standard_rated", + TaxableBasisReduced => "taxable_basis_reduced", + ZeroRated => "zero_rated", + Unknown => "unknown", + } + } +} + +impl std::str::FromStr for LineItemsTaxAmountTaxabilityReason { + type Err = (); + fn from_str(s: &str) -> Result { + use LineItemsTaxAmountTaxabilityReason::*; + match s { + "customer_exempt" => Ok(CustomerExempt), + "not_collecting" => Ok(NotCollecting), + "not_subject_to_tax" => Ok(NotSubjectToTax), + "not_supported" => Ok(NotSupported), + "portion_product_exempt" => Ok(PortionProductExempt), + "portion_reduced_rated" => Ok(PortionReducedRated), + "portion_standard_rated" => Ok(PortionStandardRated), + "product_exempt" => Ok(ProductExempt), + "product_exempt_holiday" => Ok(ProductExemptHoliday), + "proportionally_rated" => Ok(ProportionallyRated), + "reduced_rated" => Ok(ReducedRated), + "reverse_charge" => Ok(ReverseCharge), + "standard_rated" => Ok(StandardRated), + "taxable_basis_reduced" => Ok(TaxableBasisReduced), + "zero_rated" => Ok(ZeroRated), + _ => Err(()), + } + } +} +impl std::fmt::Display for LineItemsTaxAmountTaxabilityReason { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for LineItemsTaxAmountTaxabilityReason { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for LineItemsTaxAmountTaxabilityReason { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for LineItemsTaxAmountTaxabilityReason { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Ok(Self::from_str(&s).unwrap_or(LineItemsTaxAmountTaxabilityReason::Unknown)) + } +} diff --git a/generated/stripe_shared/src/linked_account_options_us_bank_account.rs b/generated/stripe_shared/src/linked_account_options_us_bank_account.rs new file mode 100644 index 000000000..e768eec63 --- /dev/null +++ b/generated/stripe_shared/src/linked_account_options_us_bank_account.rs @@ -0,0 +1,130 @@ +#[derive(Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct LinkedAccountOptionsUsBankAccount { + /// The list of permissions to request. The `payment_method` permission must be included. + #[serde(skip_serializing_if = "Option::is_none")] + pub permissions: Option>, + /// Data features requested to be retrieved upon account creation. + pub prefetch: Option>, + /// For webview integrations only. + /// Upon completing OAuth login in the native browser, the user will be redirected to this URL to return to your app. + #[serde(skip_serializing_if = "Option::is_none")] + pub return_url: Option, +} +/// The list of permissions to request. The `payment_method` permission must be included. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum LinkedAccountOptionsUsBankAccountPermissions { + Balances, + Ownership, + PaymentMethod, + Transactions, +} +impl LinkedAccountOptionsUsBankAccountPermissions { + pub fn as_str(self) -> &'static str { + use LinkedAccountOptionsUsBankAccountPermissions::*; + match self { + Balances => "balances", + Ownership => "ownership", + PaymentMethod => "payment_method", + Transactions => "transactions", + } + } +} + +impl std::str::FromStr for LinkedAccountOptionsUsBankAccountPermissions { + type Err = (); + fn from_str(s: &str) -> Result { + use LinkedAccountOptionsUsBankAccountPermissions::*; + match s { + "balances" => Ok(Balances), + "ownership" => Ok(Ownership), + "payment_method" => Ok(PaymentMethod), + "transactions" => Ok(Transactions), + _ => Err(()), + } + } +} +impl std::fmt::Display for LinkedAccountOptionsUsBankAccountPermissions { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for LinkedAccountOptionsUsBankAccountPermissions { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for LinkedAccountOptionsUsBankAccountPermissions { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for LinkedAccountOptionsUsBankAccountPermissions { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| { + serde::de::Error::custom( + "Unknown value for LinkedAccountOptionsUsBankAccountPermissions", + ) + }) + } +} +/// Data features requested to be retrieved upon account creation. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum LinkedAccountOptionsUsBankAccountPrefetch { + Balances, + Transactions, +} +impl LinkedAccountOptionsUsBankAccountPrefetch { + pub fn as_str(self) -> &'static str { + use LinkedAccountOptionsUsBankAccountPrefetch::*; + match self { + Balances => "balances", + Transactions => "transactions", + } + } +} + +impl std::str::FromStr for LinkedAccountOptionsUsBankAccountPrefetch { + type Err = (); + fn from_str(s: &str) -> Result { + use LinkedAccountOptionsUsBankAccountPrefetch::*; + match s { + "balances" => Ok(Balances), + "transactions" => Ok(Transactions), + _ => Err(()), + } + } +} +impl std::fmt::Display for LinkedAccountOptionsUsBankAccountPrefetch { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for LinkedAccountOptionsUsBankAccountPrefetch { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for LinkedAccountOptionsUsBankAccountPrefetch { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for LinkedAccountOptionsUsBankAccountPrefetch { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| { + serde::de::Error::custom("Unknown value for LinkedAccountOptionsUsBankAccountPrefetch") + }) + } +} diff --git a/generated/stripe_shared/src/mandate.rs b/generated/stripe_shared/src/mandate.rs new file mode 100644 index 000000000..362aadcd3 --- /dev/null +++ b/generated/stripe_shared/src/mandate.rs @@ -0,0 +1,142 @@ +/// A Mandate is a record of the permission that your customer gives you to debit their payment method. +/// +/// For more details see <>. +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct Mandate { + pub customer_acceptance: stripe_shared::CustomerAcceptance, + /// Unique identifier for the object. + pub id: stripe_shared::MandateId, + /// Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + pub livemode: bool, + #[serde(skip_serializing_if = "Option::is_none")] + pub multi_use: Option, + /// The account (if any) that the mandate is intended for. + #[serde(skip_serializing_if = "Option::is_none")] + pub on_behalf_of: Option, + /// ID of the payment method associated with this mandate. + pub payment_method: stripe_types::Expandable, + pub payment_method_details: stripe_shared::MandatePaymentMethodDetails, + #[serde(skip_serializing_if = "Option::is_none")] + pub single_use: Option, + /// The mandate status indicates whether or not you can use it to initiate a payment. + pub status: MandateStatus, + /// The type of the mandate. + #[serde(rename = "type")] + pub type_: MandateType, +} +/// The mandate status indicates whether or not you can use it to initiate a payment. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum MandateStatus { + Active, + Inactive, + Pending, +} +impl MandateStatus { + pub fn as_str(self) -> &'static str { + use MandateStatus::*; + match self { + Active => "active", + Inactive => "inactive", + Pending => "pending", + } + } +} + +impl std::str::FromStr for MandateStatus { + type Err = (); + fn from_str(s: &str) -> Result { + use MandateStatus::*; + match s { + "active" => Ok(Active), + "inactive" => Ok(Inactive), + "pending" => Ok(Pending), + _ => Err(()), + } + } +} +impl std::fmt::Display for MandateStatus { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for MandateStatus { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for MandateStatus { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for MandateStatus { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for MandateStatus")) + } +} +/// The type of the mandate. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum MandateType { + MultiUse, + SingleUse, +} +impl MandateType { + pub fn as_str(self) -> &'static str { + use MandateType::*; + match self { + MultiUse => "multi_use", + SingleUse => "single_use", + } + } +} + +impl std::str::FromStr for MandateType { + type Err = (); + fn from_str(s: &str) -> Result { + use MandateType::*; + match s { + "multi_use" => Ok(MultiUse), + "single_use" => Ok(SingleUse), + _ => Err(()), + } + } +} +impl std::fmt::Display for MandateType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for MandateType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for MandateType { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for MandateType { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for MandateType")) + } +} +impl stripe_types::Object for Mandate { + type Id = stripe_shared::MandateId; + fn id(&self) -> &Self::Id { + &self.id + } +} +stripe_types::def_id!(MandateId, "mandate_"); diff --git a/generated/stripe_shared/src/mandate_acss_debit.rs b/generated/stripe_shared/src/mandate_acss_debit.rs new file mode 100644 index 000000000..c890abade --- /dev/null +++ b/generated/stripe_shared/src/mandate_acss_debit.rs @@ -0,0 +1,180 @@ +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct MandateAcssDebit { + /// List of Stripe products where this mandate can be selected automatically. + #[serde(skip_serializing_if = "Option::is_none")] + pub default_for: Option>, + /// Description of the interval. + /// Only required if the 'payment_schedule' parameter is 'interval' or 'combined'. + pub interval_description: Option, + /// Payment schedule for the mandate. + pub payment_schedule: MandateAcssDebitPaymentSchedule, + /// Transaction type of the mandate. + pub transaction_type: MandateAcssDebitTransactionType, +} +/// List of Stripe products where this mandate can be selected automatically. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum MandateAcssDebitDefaultFor { + Invoice, + Subscription, +} +impl MandateAcssDebitDefaultFor { + pub fn as_str(self) -> &'static str { + use MandateAcssDebitDefaultFor::*; + match self { + Invoice => "invoice", + Subscription => "subscription", + } + } +} + +impl std::str::FromStr for MandateAcssDebitDefaultFor { + type Err = (); + fn from_str(s: &str) -> Result { + use MandateAcssDebitDefaultFor::*; + match s { + "invoice" => Ok(Invoice), + "subscription" => Ok(Subscription), + _ => Err(()), + } + } +} +impl std::fmt::Display for MandateAcssDebitDefaultFor { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for MandateAcssDebitDefaultFor { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for MandateAcssDebitDefaultFor { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for MandateAcssDebitDefaultFor { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s) + .map_err(|_| serde::de::Error::custom("Unknown value for MandateAcssDebitDefaultFor")) + } +} +/// Payment schedule for the mandate. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum MandateAcssDebitPaymentSchedule { + Combined, + Interval, + Sporadic, +} +impl MandateAcssDebitPaymentSchedule { + pub fn as_str(self) -> &'static str { + use MandateAcssDebitPaymentSchedule::*; + match self { + Combined => "combined", + Interval => "interval", + Sporadic => "sporadic", + } + } +} + +impl std::str::FromStr for MandateAcssDebitPaymentSchedule { + type Err = (); + fn from_str(s: &str) -> Result { + use MandateAcssDebitPaymentSchedule::*; + match s { + "combined" => Ok(Combined), + "interval" => Ok(Interval), + "sporadic" => Ok(Sporadic), + _ => Err(()), + } + } +} +impl std::fmt::Display for MandateAcssDebitPaymentSchedule { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for MandateAcssDebitPaymentSchedule { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for MandateAcssDebitPaymentSchedule { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for MandateAcssDebitPaymentSchedule { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| { + serde::de::Error::custom("Unknown value for MandateAcssDebitPaymentSchedule") + }) + } +} +/// Transaction type of the mandate. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum MandateAcssDebitTransactionType { + Business, + Personal, +} +impl MandateAcssDebitTransactionType { + pub fn as_str(self) -> &'static str { + use MandateAcssDebitTransactionType::*; + match self { + Business => "business", + Personal => "personal", + } + } +} + +impl std::str::FromStr for MandateAcssDebitTransactionType { + type Err = (); + fn from_str(s: &str) -> Result { + use MandateAcssDebitTransactionType::*; + match s { + "business" => Ok(Business), + "personal" => Ok(Personal), + _ => Err(()), + } + } +} +impl std::fmt::Display for MandateAcssDebitTransactionType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for MandateAcssDebitTransactionType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for MandateAcssDebitTransactionType { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for MandateAcssDebitTransactionType { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| { + serde::de::Error::custom("Unknown value for MandateAcssDebitTransactionType") + }) + } +} diff --git a/generated/stripe_shared/src/mandate_au_becs_debit.rs b/generated/stripe_shared/src/mandate_au_becs_debit.rs new file mode 100644 index 000000000..f1e02f406 --- /dev/null +++ b/generated/stripe_shared/src/mandate_au_becs_debit.rs @@ -0,0 +1,6 @@ +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct MandateAuBecsDebit { + /// The URL of the mandate. + /// This URL generally contains sensitive information about the customer and should be shared with them exclusively. + pub url: String, +} diff --git a/generated/stripe_shared/src/mandate_bacs_debit.rs b/generated/stripe_shared/src/mandate_bacs_debit.rs new file mode 100644 index 000000000..b1fda1130 --- /dev/null +++ b/generated/stripe_shared/src/mandate_bacs_debit.rs @@ -0,0 +1,138 @@ +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct MandateBacsDebit { + /// The status of the mandate on the Bacs network. + /// Can be one of `pending`, `revoked`, `refused`, or `accepted`. + pub network_status: MandateBacsDebitNetworkStatus, + /// The unique reference identifying the mandate on the Bacs network. + pub reference: String, + /// When the mandate is revoked on the Bacs network this field displays the reason for the revocation. + pub revocation_reason: Option, + /// The URL that will contain the mandate that the customer has signed. + pub url: String, +} +/// The status of the mandate on the Bacs network. +/// Can be one of `pending`, `revoked`, `refused`, or `accepted`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum MandateBacsDebitNetworkStatus { + Accepted, + Pending, + Refused, + Revoked, +} +impl MandateBacsDebitNetworkStatus { + pub fn as_str(self) -> &'static str { + use MandateBacsDebitNetworkStatus::*; + match self { + Accepted => "accepted", + Pending => "pending", + Refused => "refused", + Revoked => "revoked", + } + } +} + +impl std::str::FromStr for MandateBacsDebitNetworkStatus { + type Err = (); + fn from_str(s: &str) -> Result { + use MandateBacsDebitNetworkStatus::*; + match s { + "accepted" => Ok(Accepted), + "pending" => Ok(Pending), + "refused" => Ok(Refused), + "revoked" => Ok(Revoked), + _ => Err(()), + } + } +} +impl std::fmt::Display for MandateBacsDebitNetworkStatus { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for MandateBacsDebitNetworkStatus { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for MandateBacsDebitNetworkStatus { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for MandateBacsDebitNetworkStatus { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| { + serde::de::Error::custom("Unknown value for MandateBacsDebitNetworkStatus") + }) + } +} +/// When the mandate is revoked on the Bacs network this field displays the reason for the revocation. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum MandateBacsDebitRevocationReason { + AccountClosed, + BankAccountRestricted, + BankOwnershipChanged, + CouldNotProcess, + DebitNotAuthorized, +} +impl MandateBacsDebitRevocationReason { + pub fn as_str(self) -> &'static str { + use MandateBacsDebitRevocationReason::*; + match self { + AccountClosed => "account_closed", + BankAccountRestricted => "bank_account_restricted", + BankOwnershipChanged => "bank_ownership_changed", + CouldNotProcess => "could_not_process", + DebitNotAuthorized => "debit_not_authorized", + } + } +} + +impl std::str::FromStr for MandateBacsDebitRevocationReason { + type Err = (); + fn from_str(s: &str) -> Result { + use MandateBacsDebitRevocationReason::*; + match s { + "account_closed" => Ok(AccountClosed), + "bank_account_restricted" => Ok(BankAccountRestricted), + "bank_ownership_changed" => Ok(BankOwnershipChanged), + "could_not_process" => Ok(CouldNotProcess), + "debit_not_authorized" => Ok(DebitNotAuthorized), + _ => Err(()), + } + } +} +impl std::fmt::Display for MandateBacsDebitRevocationReason { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for MandateBacsDebitRevocationReason { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for MandateBacsDebitRevocationReason { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for MandateBacsDebitRevocationReason { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| { + serde::de::Error::custom("Unknown value for MandateBacsDebitRevocationReason") + }) + } +} diff --git a/generated/stripe_shared/src/mandate_cashapp.rs b/generated/stripe_shared/src/mandate_cashapp.rs new file mode 100644 index 000000000..e28fa9bba --- /dev/null +++ b/generated/stripe_shared/src/mandate_cashapp.rs @@ -0,0 +1,2 @@ +#[derive(Copy, Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct MandateCashapp {} diff --git a/generated/stripe_shared/src/mandate_link.rs b/generated/stripe_shared/src/mandate_link.rs new file mode 100644 index 000000000..9b0fc2773 --- /dev/null +++ b/generated/stripe_shared/src/mandate_link.rs @@ -0,0 +1,2 @@ +#[derive(Copy, Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct MandateLink {} diff --git a/generated/stripe_shared/src/mandate_multi_use.rs b/generated/stripe_shared/src/mandate_multi_use.rs new file mode 100644 index 000000000..f214a7fec --- /dev/null +++ b/generated/stripe_shared/src/mandate_multi_use.rs @@ -0,0 +1,2 @@ +#[derive(Copy, Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct MandateMultiUse {} diff --git a/generated/stripe_shared/src/mandate_payment_method_details.rs b/generated/stripe_shared/src/mandate_payment_method_details.rs new file mode 100644 index 000000000..b930e9867 --- /dev/null +++ b/generated/stripe_shared/src/mandate_payment_method_details.rs @@ -0,0 +1,25 @@ +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct MandatePaymentMethodDetails { + #[serde(skip_serializing_if = "Option::is_none")] + pub acss_debit: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub au_becs_debit: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub bacs_debit: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub card: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub cashapp: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub link: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub paypal: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub sepa_debit: Option, + /// This mandate corresponds with a specific payment method type. + /// The `payment_method_details` includes an additional hash with the same name and contains mandate information that's specific to that payment method. + #[serde(rename = "type")] + pub type_: String, + #[serde(skip_serializing_if = "Option::is_none")] + pub us_bank_account: Option, +} diff --git a/generated/stripe_shared/src/mandate_paypal.rs b/generated/stripe_shared/src/mandate_paypal.rs new file mode 100644 index 000000000..82b4a1e93 --- /dev/null +++ b/generated/stripe_shared/src/mandate_paypal.rs @@ -0,0 +1,8 @@ +#[derive(Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct MandatePaypal { + /// The PayPal Billing Agreement ID (BAID). + /// This is an ID generated by PayPal which represents the mandate between the merchant and the customer. + pub billing_agreement_id: Option, + /// PayPal account PayerID. This identifier uniquely identifies the PayPal customer. + pub payer_id: Option, +} diff --git a/generated/stripe_shared/src/mandate_sepa_debit.rs b/generated/stripe_shared/src/mandate_sepa_debit.rs new file mode 100644 index 000000000..103e31afb --- /dev/null +++ b/generated/stripe_shared/src/mandate_sepa_debit.rs @@ -0,0 +1,8 @@ +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct MandateSepaDebit { + /// The unique reference of the mandate. + pub reference: String, + /// The URL of the mandate. + /// This URL generally contains sensitive information about the customer and should be shared with them exclusively. + pub url: String, +} diff --git a/generated/stripe_shared/src/mandate_single_use.rs b/generated/stripe_shared/src/mandate_single_use.rs new file mode 100644 index 000000000..8cabcb79e --- /dev/null +++ b/generated/stripe_shared/src/mandate_single_use.rs @@ -0,0 +1,7 @@ +#[derive(Copy, Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct MandateSingleUse { + /// The amount of the payment on a single use mandate. + pub amount: i64, + /// The currency of the payment on a single use mandate. + pub currency: stripe_types::Currency, +} diff --git a/generated/stripe_shared/src/mandate_us_bank_account.rs b/generated/stripe_shared/src/mandate_us_bank_account.rs new file mode 100644 index 000000000..7616c7013 --- /dev/null +++ b/generated/stripe_shared/src/mandate_us_bank_account.rs @@ -0,0 +1,58 @@ +#[derive(Copy, Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct MandateUsBankAccount { + /// Mandate collection method + #[serde(skip_serializing_if = "Option::is_none")] + pub collection_method: Option, +} +/// Mandate collection method +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum MandateUsBankAccountCollectionMethod { + Paper, +} +impl MandateUsBankAccountCollectionMethod { + pub fn as_str(self) -> &'static str { + use MandateUsBankAccountCollectionMethod::*; + match self { + Paper => "paper", + } + } +} + +impl std::str::FromStr for MandateUsBankAccountCollectionMethod { + type Err = (); + fn from_str(s: &str) -> Result { + use MandateUsBankAccountCollectionMethod::*; + match s { + "paper" => Ok(Paper), + _ => Err(()), + } + } +} +impl std::fmt::Display for MandateUsBankAccountCollectionMethod { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for MandateUsBankAccountCollectionMethod { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for MandateUsBankAccountCollectionMethod { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for MandateUsBankAccountCollectionMethod { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| { + serde::de::Error::custom("Unknown value for MandateUsBankAccountCollectionMethod") + }) + } +} diff --git a/generated/stripe_shared/src/mod.rs b/generated/stripe_shared/src/mod.rs new file mode 100644 index 000000000..24d3f3fea --- /dev/null +++ b/generated/stripe_shared/src/mod.rs @@ -0,0 +1,2465 @@ +#![recursion_limit = "256"] +#![allow(clippy::large_enum_variant)] +#![allow(rustdoc::broken_intra_doc_links)] +#![allow(rustdoc::invalid_html_tags)] + +//! Autogenerated types shared between stripe_* crates. If you find yourself +//! needing to depend on this crate, please open an issue, as all useful types should be +//! reexported. + +extern crate self as stripe_shared; +#[doc(hidden)] +pub mod account; +#[doc(inline)] +pub use account::*; +#[doc(hidden)] +pub mod account_annual_revenue; +#[doc(inline)] +pub use account_annual_revenue::*; +#[doc(hidden)] +pub mod account_bacs_debit_payments_settings; +#[doc(inline)] +pub use account_bacs_debit_payments_settings::*; +#[doc(hidden)] +pub mod account_branding_settings; +#[doc(inline)] +pub use account_branding_settings::*; +#[doc(hidden)] +pub mod account_business_profile; +#[doc(inline)] +pub use account_business_profile::*; +#[doc(hidden)] +pub mod account_capabilities; +#[doc(inline)] +pub use account_capabilities::*; +#[doc(hidden)] +pub mod account_capability_future_requirements; +#[doc(inline)] +pub use account_capability_future_requirements::*; +#[doc(hidden)] +pub mod account_capability_requirements; +#[doc(inline)] +pub use account_capability_requirements::*; +#[doc(hidden)] +pub mod account_card_issuing_settings; +#[doc(inline)] +pub use account_card_issuing_settings::*; +#[doc(hidden)] +pub mod account_card_payments_settings; +#[doc(inline)] +pub use account_card_payments_settings::*; +#[doc(hidden)] +pub mod account_dashboard_settings; +#[doc(inline)] +pub use account_dashboard_settings::*; +#[doc(hidden)] +pub mod account_decline_charge_on; +#[doc(inline)] +pub use account_decline_charge_on::*; +#[doc(hidden)] +pub mod account_future_requirements; +#[doc(inline)] +pub use account_future_requirements::*; +#[doc(hidden)] +pub mod account_invoices_settings; +#[doc(inline)] +pub use account_invoices_settings::*; +#[doc(hidden)] +pub mod account_monthly_estimated_revenue; +#[doc(inline)] +pub use account_monthly_estimated_revenue::*; +#[doc(hidden)] +pub mod account_payments_settings; +#[doc(inline)] +pub use account_payments_settings::*; +#[doc(hidden)] +pub mod account_payout_settings; +#[doc(inline)] +pub use account_payout_settings::*; +#[doc(hidden)] +pub mod account_requirements; +#[doc(inline)] +pub use account_requirements::*; +#[doc(hidden)] +pub mod account_requirements_alternative; +#[doc(inline)] +pub use account_requirements_alternative::*; +#[doc(hidden)] +pub mod account_requirements_error; +#[doc(inline)] +pub use account_requirements_error::*; +#[doc(hidden)] +pub mod account_sepa_debit_payments_settings; +#[doc(inline)] +pub use account_sepa_debit_payments_settings::*; +#[doc(hidden)] +pub mod account_settings; +#[doc(inline)] +pub use account_settings::*; +#[doc(hidden)] +pub mod account_terms_of_service; +#[doc(inline)] +pub use account_terms_of_service::*; +#[doc(hidden)] +pub mod account_tos_acceptance; +#[doc(inline)] +pub use account_tos_acceptance::*; +#[doc(hidden)] +pub mod account_treasury_settings; +#[doc(inline)] +pub use account_treasury_settings::*; +#[doc(hidden)] +pub mod account_unification_account_controller; +#[doc(inline)] +pub use account_unification_account_controller::*; +#[doc(hidden)] +pub mod address; +#[doc(inline)] +pub use address::*; +#[doc(hidden)] +pub mod api_errors; +#[doc(inline)] +pub use api_errors::*; +#[doc(hidden)] +pub mod application; +#[doc(inline)] +pub use application::*; +#[doc(hidden)] +pub mod application_fee; +#[doc(inline)] +pub use application_fee::*; +#[doc(hidden)] +pub mod automatic_tax; +#[doc(inline)] +pub use automatic_tax::*; +#[doc(hidden)] +pub mod balance_transaction; +#[doc(inline)] +pub use balance_transaction::*; +#[doc(hidden)] +pub mod balance_transaction_source; +#[doc(inline)] +pub use balance_transaction_source::*; +#[doc(hidden)] +pub mod bank_account; +#[doc(inline)] +pub use bank_account::*; +#[doc(hidden)] +pub mod billing_details; +#[doc(inline)] +pub use billing_details::*; +#[doc(hidden)] +pub mod cancellation_details; +#[doc(inline)] +pub use cancellation_details::*; +#[doc(hidden)] +pub mod capability; +#[doc(inline)] +pub use capability::*; +#[doc(hidden)] +pub mod card; +#[doc(inline)] +pub use card::*; +#[doc(hidden)] +pub mod card_issuing_account_terms_of_service; +#[doc(inline)] +pub use card_issuing_account_terms_of_service::*; +#[doc(hidden)] +pub mod card_mandate_payment_method_details; +#[doc(inline)] +pub use card_mandate_payment_method_details::*; +#[doc(hidden)] +pub mod cash_balance; +#[doc(inline)] +pub use cash_balance::*; +#[doc(hidden)] +pub mod charge; +#[doc(inline)] +pub use charge::*; +#[doc(hidden)] +pub mod charge_fraud_details; +#[doc(inline)] +pub use charge_fraud_details::*; +#[doc(hidden)] +pub mod charge_outcome; +#[doc(inline)] +pub use charge_outcome::*; +#[doc(hidden)] +pub mod charge_transfer_data; +#[doc(inline)] +pub use charge_transfer_data::*; +#[doc(hidden)] +pub mod connect_account_reference; +#[doc(inline)] +pub use connect_account_reference::*; +#[doc(hidden)] +pub mod connect_collection_transfer; +#[doc(inline)] +pub use connect_collection_transfer::*; +#[doc(hidden)] +pub mod coupon; +#[doc(inline)] +pub use coupon::*; +#[doc(hidden)] +pub mod coupon_applies_to; +#[doc(inline)] +pub use coupon_applies_to::*; +#[doc(hidden)] +pub mod coupon_currency_option; +#[doc(inline)] +pub use coupon_currency_option::*; +#[doc(hidden)] +pub mod credit_note; +#[doc(inline)] +pub use credit_note::*; +#[doc(hidden)] +pub mod credit_note_line_item; +#[doc(inline)] +pub use credit_note_line_item::*; +#[doc(hidden)] +pub mod credit_note_tax_amount; +#[doc(inline)] +pub use credit_note_tax_amount::*; +#[doc(hidden)] +pub mod currency_option; +#[doc(inline)] +pub use currency_option::*; +#[doc(hidden)] +pub mod custom_unit_amount; +#[doc(inline)] +pub use custom_unit_amount::*; +#[doc(hidden)] +pub mod customer; +#[doc(inline)] +pub use customer::*; +#[doc(hidden)] +pub mod customer_acceptance; +#[doc(inline)] +pub use customer_acceptance::*; +#[doc(hidden)] +pub mod customer_balance_customer_balance_settings; +#[doc(inline)] +pub use customer_balance_customer_balance_settings::*; +#[doc(hidden)] +pub mod customer_balance_resource_cash_balance_transaction_resource_adjusted_for_overdraft; +#[doc(inline)] +pub use customer_balance_resource_cash_balance_transaction_resource_adjusted_for_overdraft::*; +#[doc(hidden)] +pub mod customer_balance_resource_cash_balance_transaction_resource_applied_to_payment_transaction; +#[doc(inline)] +pub use customer_balance_resource_cash_balance_transaction_resource_applied_to_payment_transaction::*; +#[doc(hidden)] +pub mod customer_balance_resource_cash_balance_transaction_resource_funded_transaction; +#[doc(inline)] +pub use customer_balance_resource_cash_balance_transaction_resource_funded_transaction::*; +#[doc(hidden)] +pub mod customer_balance_resource_cash_balance_transaction_resource_funded_transaction_resource_bank_transfer; +#[doc(inline)] +pub use customer_balance_resource_cash_balance_transaction_resource_funded_transaction_resource_bank_transfer::*; +#[doc(hidden)] +pub mod customer_balance_resource_cash_balance_transaction_resource_funded_transaction_resource_bank_transfer_resource_eu_bank_transfer; +#[doc(inline)] +pub use customer_balance_resource_cash_balance_transaction_resource_funded_transaction_resource_bank_transfer_resource_eu_bank_transfer::*; +#[doc(hidden)] +pub mod customer_balance_resource_cash_balance_transaction_resource_funded_transaction_resource_bank_transfer_resource_gb_bank_transfer; +#[doc(inline)] +pub use customer_balance_resource_cash_balance_transaction_resource_funded_transaction_resource_bank_transfer_resource_gb_bank_transfer::*; +#[doc(hidden)] +pub mod customer_balance_resource_cash_balance_transaction_resource_funded_transaction_resource_bank_transfer_resource_jp_bank_transfer; +#[doc(inline)] +pub use customer_balance_resource_cash_balance_transaction_resource_funded_transaction_resource_bank_transfer_resource_jp_bank_transfer::*; +#[doc(hidden)] +pub mod customer_balance_resource_cash_balance_transaction_resource_funded_transaction_resource_bank_transfer_resource_us_bank_transfer; +#[doc(inline)] +pub use customer_balance_resource_cash_balance_transaction_resource_funded_transaction_resource_bank_transfer_resource_us_bank_transfer::*; +#[doc(hidden)] +pub mod customer_balance_resource_cash_balance_transaction_resource_refunded_from_payment_transaction; +#[doc(inline)] +pub use customer_balance_resource_cash_balance_transaction_resource_refunded_from_payment_transaction::*; +#[doc(hidden)] +pub mod customer_balance_resource_cash_balance_transaction_resource_transferred_to_balance; +#[doc(inline)] +pub use customer_balance_resource_cash_balance_transaction_resource_transferred_to_balance::*; +#[doc(hidden)] +pub mod customer_balance_resource_cash_balance_transaction_resource_unapplied_from_payment_transaction; +#[doc(inline)] +pub use customer_balance_resource_cash_balance_transaction_resource_unapplied_from_payment_transaction::*; +#[doc(hidden)] +pub mod customer_balance_transaction; +#[doc(inline)] +pub use customer_balance_transaction::*; +#[doc(hidden)] +pub mod customer_cash_balance_transaction; +#[doc(inline)] +pub use customer_cash_balance_transaction::*; +#[doc(hidden)] +pub mod customer_tax; +#[doc(inline)] +pub use customer_tax::*; +#[doc(hidden)] +pub mod customer_tax_location; +#[doc(inline)] +pub use customer_tax_location::*; +#[doc(hidden)] +pub mod deleted_account; +#[doc(inline)] +pub use deleted_account::*; +#[doc(hidden)] +pub mod deleted_bank_account; +#[doc(inline)] +pub use deleted_bank_account::*; +#[doc(hidden)] +pub mod deleted_card; +#[doc(inline)] +pub use deleted_card::*; +#[doc(hidden)] +pub mod deleted_coupon; +#[doc(inline)] +pub use deleted_coupon::*; +#[doc(hidden)] +pub mod deleted_customer; +#[doc(inline)] +pub use deleted_customer::*; +#[doc(hidden)] +pub mod deleted_discount; +#[doc(inline)] +pub use deleted_discount::*; +#[doc(hidden)] +pub mod deleted_external_account; +#[doc(inline)] +pub use deleted_external_account::*; +#[doc(hidden)] +pub mod deleted_invoice; +#[doc(inline)] +pub use deleted_invoice::*; +#[doc(hidden)] +pub mod deleted_invoiceitem; +#[doc(inline)] +pub use deleted_invoiceitem::*; +#[doc(hidden)] +pub mod deleted_payment_source; +#[doc(inline)] +pub use deleted_payment_source::*; +#[doc(hidden)] +pub mod deleted_person; +#[doc(inline)] +pub use deleted_person::*; +#[doc(hidden)] +pub mod deleted_plan; +#[doc(inline)] +pub use deleted_plan::*; +#[doc(hidden)] +pub mod deleted_product; +#[doc(inline)] +pub use deleted_product::*; +#[doc(hidden)] +pub mod deleted_subscription_item; +#[doc(inline)] +pub use deleted_subscription_item::*; +#[doc(hidden)] +pub mod deleted_tax_id; +#[doc(inline)] +pub use deleted_tax_id::*; +#[doc(hidden)] +pub mod deleted_test_helpers_test_clock; +#[doc(inline)] +pub use deleted_test_helpers_test_clock::*; +#[doc(hidden)] +pub mod destination_details_unimplemented; +#[doc(inline)] +pub use destination_details_unimplemented::*; +#[doc(hidden)] +pub mod discount; +#[doc(inline)] +pub use discount::*; +#[doc(hidden)] +pub mod discounts_resource_discount_amount; +#[doc(inline)] +pub use discounts_resource_discount_amount::*; +#[doc(hidden)] +pub mod dispute; +#[doc(inline)] +pub use dispute::*; +#[doc(hidden)] +pub mod dispute_evidence; +#[doc(inline)] +pub use dispute_evidence::*; +#[doc(hidden)] +pub mod dispute_evidence_details; +#[doc(inline)] +pub use dispute_evidence_details::*; +#[doc(hidden)] +pub mod dispute_payment_method_details; +#[doc(inline)] +pub use dispute_payment_method_details::*; +#[doc(hidden)] +pub mod dispute_payment_method_details_card; +#[doc(inline)] +pub use dispute_payment_method_details_card::*; +#[doc(hidden)] +pub mod email_sent; +#[doc(inline)] +pub use email_sent::*; +#[doc(hidden)] +pub mod error; +#[doc(inline)] +pub use error::*; +#[doc(hidden)] +pub mod event; +#[doc(inline)] +pub use event::*; +#[doc(hidden)] +pub mod external_account; +#[doc(inline)] +pub use external_account::*; +#[doc(hidden)] +pub mod external_account_requirements; +#[doc(inline)] +pub use external_account_requirements::*; +#[doc(hidden)] +pub mod fee; +#[doc(inline)] +pub use fee::*; +#[doc(hidden)] +pub mod application_fee_refund; +#[doc(inline)] +pub use application_fee_refund::*; +#[doc(hidden)] +pub mod file; +#[doc(inline)] +pub use file::*; +#[doc(hidden)] +pub mod file_link; +#[doc(inline)] +pub use file_link::*; +#[doc(hidden)] +pub mod funding_instructions; +#[doc(inline)] +pub use funding_instructions::*; +#[doc(hidden)] +pub mod funding_instructions_bank_transfer; +#[doc(inline)] +pub use funding_instructions_bank_transfer::*; +#[doc(hidden)] +pub mod funding_instructions_bank_transfer_aba_record; +#[doc(inline)] +pub use funding_instructions_bank_transfer_aba_record::*; +#[doc(hidden)] +pub mod funding_instructions_bank_transfer_financial_address; +#[doc(inline)] +pub use funding_instructions_bank_transfer_financial_address::*; +#[doc(hidden)] +pub mod funding_instructions_bank_transfer_iban_record; +#[doc(inline)] +pub use funding_instructions_bank_transfer_iban_record::*; +#[doc(hidden)] +pub mod funding_instructions_bank_transfer_sort_code_record; +#[doc(inline)] +pub use funding_instructions_bank_transfer_sort_code_record::*; +#[doc(hidden)] +pub mod funding_instructions_bank_transfer_spei_record; +#[doc(inline)] +pub use funding_instructions_bank_transfer_spei_record::*; +#[doc(hidden)] +pub mod funding_instructions_bank_transfer_swift_record; +#[doc(inline)] +pub use funding_instructions_bank_transfer_swift_record::*; +#[doc(hidden)] +pub mod funding_instructions_bank_transfer_zengin_record; +#[doc(inline)] +pub use funding_instructions_bank_transfer_zengin_record::*; +#[doc(hidden)] +pub mod invoice; +#[doc(inline)] +pub use invoice::*; +#[doc(hidden)] +pub mod invoice_installments_card; +#[doc(inline)] +pub use invoice_installments_card::*; +#[doc(hidden)] +pub mod invoice_item_threshold_reason; +#[doc(inline)] +pub use invoice_item_threshold_reason::*; +#[doc(hidden)] +pub mod invoice_line_item_period; +#[doc(inline)] +pub use invoice_line_item_period::*; +#[doc(hidden)] +pub mod invoice_mandate_options_card; +#[doc(inline)] +pub use invoice_mandate_options_card::*; +#[doc(hidden)] +pub mod invoice_payment_method_options_acss_debit; +#[doc(inline)] +pub use invoice_payment_method_options_acss_debit::*; +#[doc(hidden)] +pub mod invoice_payment_method_options_acss_debit_mandate_options; +#[doc(inline)] +pub use invoice_payment_method_options_acss_debit_mandate_options::*; +#[doc(hidden)] +pub mod invoice_payment_method_options_bancontact; +#[doc(inline)] +pub use invoice_payment_method_options_bancontact::*; +#[doc(hidden)] +pub mod invoice_payment_method_options_card; +#[doc(inline)] +pub use invoice_payment_method_options_card::*; +#[doc(hidden)] +pub mod invoice_payment_method_options_customer_balance; +#[doc(inline)] +pub use invoice_payment_method_options_customer_balance::*; +#[doc(hidden)] +pub mod invoice_payment_method_options_customer_balance_bank_transfer; +#[doc(inline)] +pub use invoice_payment_method_options_customer_balance_bank_transfer::*; +#[doc(hidden)] +pub mod invoice_payment_method_options_customer_balance_bank_transfer_eu_bank_transfer; +#[doc(inline)] +pub use invoice_payment_method_options_customer_balance_bank_transfer_eu_bank_transfer::*; +#[doc(hidden)] +pub mod invoice_payment_method_options_konbini; +#[doc(inline)] +pub use invoice_payment_method_options_konbini::*; +#[doc(hidden)] +pub mod invoice_payment_method_options_us_bank_account; +#[doc(inline)] +pub use invoice_payment_method_options_us_bank_account::*; +#[doc(hidden)] +pub mod invoice_payment_method_options_us_bank_account_linked_account_options; +#[doc(inline)] +pub use invoice_payment_method_options_us_bank_account_linked_account_options::*; +#[doc(hidden)] +pub mod invoice_rendering_pdf; +#[doc(inline)] +pub use invoice_rendering_pdf::*; +#[doc(hidden)] +pub mod invoice_setting_custom_field; +#[doc(inline)] +pub use invoice_setting_custom_field::*; +#[doc(hidden)] +pub mod invoice_setting_customer_setting; +#[doc(inline)] +pub use invoice_setting_customer_setting::*; +#[doc(hidden)] +pub mod invoice_setting_quote_setting; +#[doc(inline)] +pub use invoice_setting_quote_setting::*; +#[doc(hidden)] +pub mod invoice_setting_rendering_options; +#[doc(inline)] +pub use invoice_setting_rendering_options::*; +#[doc(hidden)] +pub mod invoice_setting_subscription_schedule_phase_setting; +#[doc(inline)] +pub use invoice_setting_subscription_schedule_phase_setting::*; +#[doc(hidden)] +pub mod invoice_setting_subscription_schedule_setting; +#[doc(inline)] +pub use invoice_setting_subscription_schedule_setting::*; +#[doc(hidden)] +pub mod invoice_tax_amount; +#[doc(inline)] +pub use invoice_tax_amount::*; +#[doc(hidden)] +pub mod invoice_threshold_reason; +#[doc(inline)] +pub use invoice_threshold_reason::*; +#[doc(hidden)] +pub mod invoice_transfer_data; +#[doc(inline)] +pub use invoice_transfer_data::*; +#[doc(hidden)] +pub mod invoice_item; +#[doc(inline)] +pub use invoice_item::*; +#[doc(hidden)] +pub mod invoices_from_invoice; +#[doc(inline)] +pub use invoices_from_invoice::*; +#[doc(hidden)] +pub mod invoices_invoice_rendering; +#[doc(inline)] +pub use invoices_invoice_rendering::*; +#[doc(hidden)] +pub mod invoices_payment_method_options; +#[doc(inline)] +pub use invoices_payment_method_options::*; +#[doc(hidden)] +pub mod invoices_payment_settings; +#[doc(inline)] +pub use invoices_payment_settings::*; +#[doc(hidden)] +pub mod invoices_resource_invoice_tax_id; +#[doc(inline)] +pub use invoices_resource_invoice_tax_id::*; +#[doc(hidden)] +pub mod invoices_resource_line_items_credited_items; +#[doc(inline)] +pub use invoices_resource_line_items_credited_items::*; +#[doc(hidden)] +pub mod invoices_resource_line_items_proration_details; +#[doc(inline)] +pub use invoices_resource_line_items_proration_details::*; +#[doc(hidden)] +pub mod invoices_shipping_cost; +#[doc(inline)] +pub use invoices_shipping_cost::*; +#[doc(hidden)] +pub mod invoices_status_transitions; +#[doc(inline)] +pub use invoices_status_transitions::*; +#[doc(hidden)] +pub mod issuing_authorization; +#[doc(inline)] +pub use issuing_authorization::*; +#[doc(hidden)] +pub mod issuing_card; +#[doc(inline)] +pub use issuing_card::*; +#[doc(hidden)] +pub mod issuing_cardholder; +#[doc(inline)] +pub use issuing_cardholder::*; +#[doc(hidden)] +pub mod issuing_dispute; +#[doc(inline)] +pub use issuing_dispute::*; +#[doc(hidden)] +pub mod issuing_token; +#[doc(inline)] +pub use issuing_token::*; +#[doc(hidden)] +pub mod issuing_transaction; +#[doc(inline)] +pub use issuing_transaction::*; +#[doc(hidden)] +pub mod issuing_authorization_amount_details; +#[doc(inline)] +pub use issuing_authorization_amount_details::*; +#[doc(hidden)] +pub mod issuing_authorization_authentication_exemption; +#[doc(inline)] +pub use issuing_authorization_authentication_exemption::*; +#[doc(hidden)] +pub mod issuing_authorization_merchant_data; +#[doc(inline)] +pub use issuing_authorization_merchant_data::*; +#[doc(hidden)] +pub mod issuing_authorization_network_data; +#[doc(inline)] +pub use issuing_authorization_network_data::*; +#[doc(hidden)] +pub mod issuing_authorization_pending_request; +#[doc(inline)] +pub use issuing_authorization_pending_request::*; +#[doc(hidden)] +pub mod issuing_authorization_request; +#[doc(inline)] +pub use issuing_authorization_request::*; +#[doc(hidden)] +pub mod issuing_authorization_three_d_secure; +#[doc(inline)] +pub use issuing_authorization_three_d_secure::*; +#[doc(hidden)] +pub mod issuing_authorization_treasury; +#[doc(inline)] +pub use issuing_authorization_treasury::*; +#[doc(hidden)] +pub mod issuing_authorization_verification_data; +#[doc(inline)] +pub use issuing_authorization_verification_data::*; +#[doc(hidden)] +pub mod issuing_card_apple_pay; +#[doc(inline)] +pub use issuing_card_apple_pay::*; +#[doc(hidden)] +pub mod issuing_card_authorization_controls; +#[doc(inline)] +pub use issuing_card_authorization_controls::*; +#[doc(hidden)] +pub mod issuing_card_google_pay; +#[doc(inline)] +pub use issuing_card_google_pay::*; +#[doc(hidden)] +pub mod issuing_card_shipping; +#[doc(inline)] +pub use issuing_card_shipping::*; +#[doc(hidden)] +pub mod issuing_card_shipping_customs; +#[doc(inline)] +pub use issuing_card_shipping_customs::*; +#[doc(hidden)] +pub mod issuing_card_spending_limit; +#[doc(inline)] +pub use issuing_card_spending_limit::*; +#[doc(hidden)] +pub mod issuing_card_wallets; +#[doc(inline)] +pub use issuing_card_wallets::*; +#[doc(hidden)] +pub mod issuing_cardholder_address; +#[doc(inline)] +pub use issuing_cardholder_address::*; +#[doc(hidden)] +pub mod issuing_cardholder_authorization_controls; +#[doc(inline)] +pub use issuing_cardholder_authorization_controls::*; +#[doc(hidden)] +pub mod issuing_cardholder_card_issuing; +#[doc(inline)] +pub use issuing_cardholder_card_issuing::*; +#[doc(hidden)] +pub mod issuing_cardholder_company; +#[doc(inline)] +pub use issuing_cardholder_company::*; +#[doc(hidden)] +pub mod issuing_cardholder_id_document; +#[doc(inline)] +pub use issuing_cardholder_id_document::*; +#[doc(hidden)] +pub mod issuing_cardholder_individual; +#[doc(inline)] +pub use issuing_cardholder_individual::*; +#[doc(hidden)] +pub mod issuing_cardholder_individual_dob; +#[doc(inline)] +pub use issuing_cardholder_individual_dob::*; +#[doc(hidden)] +pub mod issuing_cardholder_requirements; +#[doc(inline)] +pub use issuing_cardholder_requirements::*; +#[doc(hidden)] +pub mod issuing_cardholder_spending_limit; +#[doc(inline)] +pub use issuing_cardholder_spending_limit::*; +#[doc(hidden)] +pub mod issuing_cardholder_user_terms_acceptance; +#[doc(inline)] +pub use issuing_cardholder_user_terms_acceptance::*; +#[doc(hidden)] +pub mod issuing_cardholder_verification; +#[doc(inline)] +pub use issuing_cardholder_verification::*; +#[doc(hidden)] +pub mod issuing_dispute_canceled_evidence; +#[doc(inline)] +pub use issuing_dispute_canceled_evidence::*; +#[doc(hidden)] +pub mod issuing_dispute_duplicate_evidence; +#[doc(inline)] +pub use issuing_dispute_duplicate_evidence::*; +#[doc(hidden)] +pub mod issuing_dispute_evidence; +#[doc(inline)] +pub use issuing_dispute_evidence::*; +#[doc(hidden)] +pub mod issuing_dispute_fraudulent_evidence; +#[doc(inline)] +pub use issuing_dispute_fraudulent_evidence::*; +#[doc(hidden)] +pub mod issuing_dispute_merchandise_not_as_described_evidence; +#[doc(inline)] +pub use issuing_dispute_merchandise_not_as_described_evidence::*; +#[doc(hidden)] +pub mod issuing_dispute_not_received_evidence; +#[doc(inline)] +pub use issuing_dispute_not_received_evidence::*; +#[doc(hidden)] +pub mod issuing_dispute_other_evidence; +#[doc(inline)] +pub use issuing_dispute_other_evidence::*; +#[doc(hidden)] +pub mod issuing_dispute_service_not_as_described_evidence; +#[doc(inline)] +pub use issuing_dispute_service_not_as_described_evidence::*; +#[doc(hidden)] +pub mod issuing_dispute_treasury; +#[doc(inline)] +pub use issuing_dispute_treasury::*; +#[doc(hidden)] +pub mod issuing_network_token_address; +#[doc(inline)] +pub use issuing_network_token_address::*; +#[doc(hidden)] +pub mod issuing_network_token_device; +#[doc(inline)] +pub use issuing_network_token_device::*; +#[doc(hidden)] +pub mod issuing_network_token_mastercard; +#[doc(inline)] +pub use issuing_network_token_mastercard::*; +#[doc(hidden)] +pub mod issuing_network_token_network_data; +#[doc(inline)] +pub use issuing_network_token_network_data::*; +#[doc(hidden)] +pub mod issuing_network_token_visa; +#[doc(inline)] +pub use issuing_network_token_visa::*; +#[doc(hidden)] +pub mod issuing_network_token_wallet_provider; +#[doc(inline)] +pub use issuing_network_token_wallet_provider::*; +#[doc(hidden)] +pub mod issuing_transaction_amount_details; +#[doc(inline)] +pub use issuing_transaction_amount_details::*; +#[doc(hidden)] +pub mod issuing_transaction_flight_data; +#[doc(inline)] +pub use issuing_transaction_flight_data::*; +#[doc(hidden)] +pub mod issuing_transaction_flight_data_leg; +#[doc(inline)] +pub use issuing_transaction_flight_data_leg::*; +#[doc(hidden)] +pub mod issuing_transaction_fuel_data; +#[doc(inline)] +pub use issuing_transaction_fuel_data::*; +#[doc(hidden)] +pub mod issuing_transaction_lodging_data; +#[doc(inline)] +pub use issuing_transaction_lodging_data::*; +#[doc(hidden)] +pub mod issuing_transaction_network_data; +#[doc(inline)] +pub use issuing_transaction_network_data::*; +#[doc(hidden)] +pub mod issuing_transaction_purchase_details; +#[doc(inline)] +pub use issuing_transaction_purchase_details::*; +#[doc(hidden)] +pub mod issuing_transaction_receipt_data; +#[doc(inline)] +pub use issuing_transaction_receipt_data::*; +#[doc(hidden)] +pub mod issuing_transaction_treasury; +#[doc(inline)] +pub use issuing_transaction_treasury::*; +#[doc(hidden)] +pub mod checkout_session_item; +#[doc(inline)] +pub use checkout_session_item::*; +#[doc(hidden)] +pub mod legal_entity_company; +#[doc(inline)] +pub use legal_entity_company::*; +#[doc(hidden)] +pub mod legal_entity_company_verification; +#[doc(inline)] +pub use legal_entity_company_verification::*; +#[doc(hidden)] +pub mod legal_entity_company_verification_document; +#[doc(inline)] +pub use legal_entity_company_verification_document::*; +#[doc(hidden)] +pub mod legal_entity_dob; +#[doc(inline)] +pub use legal_entity_dob::*; +#[doc(hidden)] +pub mod legal_entity_japan_address; +#[doc(inline)] +pub use legal_entity_japan_address::*; +#[doc(hidden)] +pub mod legal_entity_person_verification; +#[doc(inline)] +pub use legal_entity_person_verification::*; +#[doc(hidden)] +pub mod legal_entity_person_verification_document; +#[doc(inline)] +pub use legal_entity_person_verification_document::*; +#[doc(hidden)] +pub mod legal_entity_ubo_declaration; +#[doc(inline)] +pub use legal_entity_ubo_declaration::*; +#[doc(hidden)] +pub mod level3; +#[doc(inline)] +pub use level3::*; +#[doc(hidden)] +pub mod level3_line_items; +#[doc(inline)] +pub use level3_line_items::*; +#[doc(hidden)] +pub mod invoice_line_item; +#[doc(inline)] +pub use invoice_line_item::*; +#[doc(hidden)] +pub mod line_items_discount_amount; +#[doc(inline)] +pub use line_items_discount_amount::*; +#[doc(hidden)] +pub mod line_items_tax_amount; +#[doc(inline)] +pub use line_items_tax_amount::*; +#[doc(hidden)] +pub mod linked_account_options_us_bank_account; +#[doc(inline)] +pub use linked_account_options_us_bank_account::*; +#[doc(hidden)] +pub mod mandate; +#[doc(inline)] +pub use mandate::*; +#[doc(hidden)] +pub mod mandate_acss_debit; +#[doc(inline)] +pub use mandate_acss_debit::*; +#[doc(hidden)] +pub mod mandate_au_becs_debit; +#[doc(inline)] +pub use mandate_au_becs_debit::*; +#[doc(hidden)] +pub mod mandate_bacs_debit; +#[doc(inline)] +pub use mandate_bacs_debit::*; +#[doc(hidden)] +pub mod mandate_cashapp; +#[doc(inline)] +pub use mandate_cashapp::*; +#[doc(hidden)] +pub mod mandate_link; +#[doc(inline)] +pub use mandate_link::*; +#[doc(hidden)] +pub mod mandate_multi_use; +#[doc(inline)] +pub use mandate_multi_use::*; +#[doc(hidden)] +pub mod mandate_payment_method_details; +#[doc(inline)] +pub use mandate_payment_method_details::*; +#[doc(hidden)] +pub mod mandate_paypal; +#[doc(inline)] +pub use mandate_paypal::*; +#[doc(hidden)] +pub mod mandate_sepa_debit; +#[doc(inline)] +pub use mandate_sepa_debit::*; +#[doc(hidden)] +pub mod mandate_single_use; +#[doc(inline)] +pub use mandate_single_use::*; +#[doc(hidden)] +pub mod mandate_us_bank_account; +#[doc(inline)] +pub use mandate_us_bank_account::*; +#[doc(hidden)] +pub mod networks; +#[doc(inline)] +pub use networks::*; +#[doc(hidden)] +pub mod notification_event_data; +#[doc(inline)] +pub use notification_event_data::*; +#[doc(hidden)] +pub mod notification_event_request; +#[doc(inline)] +pub use notification_event_request::*; +#[doc(hidden)] +pub mod offline_acceptance; +#[doc(inline)] +pub use offline_acceptance::*; +#[doc(hidden)] +pub mod online_acceptance; +#[doc(inline)] +pub use online_acceptance::*; +#[doc(hidden)] +pub mod package_dimensions; +#[doc(inline)] +pub use package_dimensions::*; +#[doc(hidden)] +pub mod payment_flows_amount_details; +#[doc(inline)] +pub use payment_flows_amount_details::*; +#[doc(hidden)] +pub mod payment_flows_amount_details_resource_tip; +#[doc(inline)] +pub use payment_flows_amount_details_resource_tip::*; +#[doc(hidden)] +pub mod payment_flows_automatic_payment_methods_payment_intent; +#[doc(inline)] +pub use payment_flows_automatic_payment_methods_payment_intent::*; +#[doc(hidden)] +pub mod payment_flows_automatic_payment_methods_setup_intent; +#[doc(inline)] +pub use payment_flows_automatic_payment_methods_setup_intent::*; +#[doc(hidden)] +pub mod us_bank_account_networks; +#[doc(inline)] +pub use us_bank_account_networks::*; +#[doc(hidden)] +pub mod payment_flows_private_payment_methods_alipay; +#[doc(inline)] +pub use payment_flows_private_payment_methods_alipay::*; +#[doc(hidden)] +pub mod payment_flows_private_payment_methods_alipay_details; +#[doc(inline)] +pub use payment_flows_private_payment_methods_alipay_details::*; +#[doc(hidden)] +pub mod payment_flows_private_payment_methods_card_details_api_resource_enterprise_features_extended_authorization_extended_authorization; +#[doc(inline)] +pub use payment_flows_private_payment_methods_card_details_api_resource_enterprise_features_extended_authorization_extended_authorization::*; +#[doc(hidden)] +pub mod payment_flows_private_payment_methods_card_details_api_resource_enterprise_features_incremental_authorization_incremental_authorization; +#[doc(inline)] +pub use payment_flows_private_payment_methods_card_details_api_resource_enterprise_features_incremental_authorization_incremental_authorization::*; +#[doc(hidden)] +pub mod payment_flows_private_payment_methods_card_details_api_resource_enterprise_features_overcapture_overcapture; +#[doc(inline)] +pub use payment_flows_private_payment_methods_card_details_api_resource_enterprise_features_overcapture_overcapture::*; +#[doc(hidden)] +pub mod payment_flows_private_payment_methods_card_details_api_resource_multicapture; +#[doc(inline)] +pub use payment_flows_private_payment_methods_card_details_api_resource_multicapture::*; +#[doc(hidden)] +pub mod payment_flows_private_payment_methods_klarna_dob; +#[doc(inline)] +pub use payment_flows_private_payment_methods_klarna_dob::*; +#[doc(hidden)] +pub mod payment_intent; +#[doc(inline)] +pub use payment_intent::*; +#[doc(hidden)] +pub mod payment_intent_card_processing; +#[doc(inline)] +pub use payment_intent_card_processing::*; +#[doc(hidden)] +pub mod payment_intent_next_action; +#[doc(inline)] +pub use payment_intent_next_action::*; +#[doc(hidden)] +pub mod payment_intent_next_action_alipay_handle_redirect; +#[doc(inline)] +pub use payment_intent_next_action_alipay_handle_redirect::*; +#[doc(hidden)] +pub mod payment_intent_next_action_boleto; +#[doc(inline)] +pub use payment_intent_next_action_boleto::*; +#[doc(hidden)] +pub mod payment_intent_next_action_card_await_notification; +#[doc(inline)] +pub use payment_intent_next_action_card_await_notification::*; +#[doc(hidden)] +pub mod payment_intent_next_action_cashapp_handle_redirect_or_display_qr_code; +#[doc(inline)] +pub use payment_intent_next_action_cashapp_handle_redirect_or_display_qr_code::*; +#[doc(hidden)] +pub mod payment_intent_next_action_cashapp_qr_code; +#[doc(inline)] +pub use payment_intent_next_action_cashapp_qr_code::*; +#[doc(hidden)] +pub mod payment_intent_next_action_display_bank_transfer_instructions; +#[doc(inline)] +pub use payment_intent_next_action_display_bank_transfer_instructions::*; +#[doc(hidden)] +pub mod payment_intent_next_action_display_oxxo_details; +#[doc(inline)] +pub use payment_intent_next_action_display_oxxo_details::*; +#[doc(hidden)] +pub mod payment_intent_next_action_konbini; +#[doc(inline)] +pub use payment_intent_next_action_konbini::*; +#[doc(hidden)] +pub mod payment_intent_next_action_konbini_familymart; +#[doc(inline)] +pub use payment_intent_next_action_konbini_familymart::*; +#[doc(hidden)] +pub mod payment_intent_next_action_konbini_lawson; +#[doc(inline)] +pub use payment_intent_next_action_konbini_lawson::*; +#[doc(hidden)] +pub mod payment_intent_next_action_konbini_ministop; +#[doc(inline)] +pub use payment_intent_next_action_konbini_ministop::*; +#[doc(hidden)] +pub mod payment_intent_next_action_konbini_seicomart; +#[doc(inline)] +pub use payment_intent_next_action_konbini_seicomart::*; +#[doc(hidden)] +pub mod payment_intent_next_action_konbini_stores; +#[doc(inline)] +pub use payment_intent_next_action_konbini_stores::*; +#[doc(hidden)] +pub mod payment_intent_next_action_paynow_display_qr_code; +#[doc(inline)] +pub use payment_intent_next_action_paynow_display_qr_code::*; +#[doc(hidden)] +pub mod payment_intent_next_action_pix_display_qr_code; +#[doc(inline)] +pub use payment_intent_next_action_pix_display_qr_code::*; +#[doc(hidden)] +pub mod payment_intent_next_action_promptpay_display_qr_code; +#[doc(inline)] +pub use payment_intent_next_action_promptpay_display_qr_code::*; +#[doc(hidden)] +pub mod payment_intent_next_action_redirect_to_url; +#[doc(inline)] +pub use payment_intent_next_action_redirect_to_url::*; +#[doc(hidden)] +pub mod payment_intent_next_action_swish_handle_redirect_or_display_qr_code; +#[doc(inline)] +pub use payment_intent_next_action_swish_handle_redirect_or_display_qr_code::*; +#[doc(hidden)] +pub mod payment_intent_next_action_swish_qr_code; +#[doc(inline)] +pub use payment_intent_next_action_swish_qr_code::*; +#[doc(hidden)] +pub mod payment_intent_next_action_verify_with_microdeposits; +#[doc(inline)] +pub use payment_intent_next_action_verify_with_microdeposits::*; +#[doc(hidden)] +pub mod payment_intent_next_action_wechat_pay_display_qr_code; +#[doc(inline)] +pub use payment_intent_next_action_wechat_pay_display_qr_code::*; +#[doc(hidden)] +pub mod payment_intent_next_action_wechat_pay_redirect_to_android_app; +#[doc(inline)] +pub use payment_intent_next_action_wechat_pay_redirect_to_android_app::*; +#[doc(hidden)] +pub mod payment_intent_next_action_wechat_pay_redirect_to_ios_app; +#[doc(inline)] +pub use payment_intent_next_action_wechat_pay_redirect_to_ios_app::*; +#[doc(hidden)] +pub mod payment_intent_payment_method_options; +#[doc(inline)] +pub use payment_intent_payment_method_options::*; +#[doc(hidden)] +pub mod payment_intent_payment_method_options_acss_debit; +#[doc(inline)] +pub use payment_intent_payment_method_options_acss_debit::*; +#[doc(hidden)] +pub mod payment_intent_payment_method_options_au_becs_debit; +#[doc(inline)] +pub use payment_intent_payment_method_options_au_becs_debit::*; +#[doc(hidden)] +pub mod payment_intent_payment_method_options_blik; +#[doc(inline)] +pub use payment_intent_payment_method_options_blik::*; +#[doc(hidden)] +pub mod payment_intent_payment_method_options_card; +#[doc(inline)] +pub use payment_intent_payment_method_options_card::*; +#[doc(hidden)] +pub mod payment_intent_payment_method_options_eps; +#[doc(inline)] +pub use payment_intent_payment_method_options_eps::*; +#[doc(hidden)] +pub mod payment_intent_payment_method_options_link; +#[doc(inline)] +pub use payment_intent_payment_method_options_link::*; +#[doc(hidden)] +pub mod payment_intent_payment_method_options_mandate_options_acss_debit; +#[doc(inline)] +pub use payment_intent_payment_method_options_mandate_options_acss_debit::*; +#[doc(hidden)] +pub mod payment_intent_payment_method_options_mandate_options_sepa_debit; +#[doc(inline)] +pub use payment_intent_payment_method_options_mandate_options_sepa_debit::*; +#[doc(hidden)] +pub mod payment_intent_payment_method_options_sepa_debit; +#[doc(inline)] +pub use payment_intent_payment_method_options_sepa_debit::*; +#[doc(hidden)] +pub mod payment_intent_payment_method_options_swish; +#[doc(inline)] +pub use payment_intent_payment_method_options_swish::*; +#[doc(hidden)] +pub mod payment_intent_payment_method_options_us_bank_account; +#[doc(inline)] +pub use payment_intent_payment_method_options_us_bank_account::*; +#[doc(hidden)] +pub mod payment_intent_processing; +#[doc(inline)] +pub use payment_intent_processing::*; +#[doc(hidden)] +pub mod payment_intent_processing_customer_notification; +#[doc(inline)] +pub use payment_intent_processing_customer_notification::*; +#[doc(hidden)] +pub mod usage_record_summary; +#[doc(inline)] +pub use usage_record_summary::*; +#[doc(hidden)] +pub mod payment_link; +#[doc(inline)] +pub use payment_link::*; +#[doc(hidden)] +pub mod payment_links_resource_after_completion; +#[doc(inline)] +pub use payment_links_resource_after_completion::*; +#[doc(hidden)] +pub mod payment_links_resource_automatic_tax; +#[doc(inline)] +pub use payment_links_resource_automatic_tax::*; +#[doc(hidden)] +pub mod payment_links_resource_completed_sessions; +#[doc(inline)] +pub use payment_links_resource_completed_sessions::*; +#[doc(hidden)] +pub mod payment_links_resource_completion_behavior_confirmation_page; +#[doc(inline)] +pub use payment_links_resource_completion_behavior_confirmation_page::*; +#[doc(hidden)] +pub mod payment_links_resource_completion_behavior_redirect; +#[doc(inline)] +pub use payment_links_resource_completion_behavior_redirect::*; +#[doc(hidden)] +pub mod payment_links_resource_consent_collection; +#[doc(inline)] +pub use payment_links_resource_consent_collection::*; +#[doc(hidden)] +pub mod payment_links_resource_custom_fields; +#[doc(inline)] +pub use payment_links_resource_custom_fields::*; +#[doc(hidden)] +pub mod payment_links_resource_custom_fields_dropdown; +#[doc(inline)] +pub use payment_links_resource_custom_fields_dropdown::*; +#[doc(hidden)] +pub mod payment_links_resource_custom_fields_dropdown_option; +#[doc(inline)] +pub use payment_links_resource_custom_fields_dropdown_option::*; +#[doc(hidden)] +pub mod payment_links_resource_custom_fields_label; +#[doc(inline)] +pub use payment_links_resource_custom_fields_label::*; +#[doc(hidden)] +pub mod payment_links_resource_custom_fields_numeric; +#[doc(inline)] +pub use payment_links_resource_custom_fields_numeric::*; +#[doc(hidden)] +pub mod payment_links_resource_custom_fields_text; +#[doc(inline)] +pub use payment_links_resource_custom_fields_text::*; +#[doc(hidden)] +pub mod payment_links_resource_custom_text; +#[doc(inline)] +pub use payment_links_resource_custom_text::*; +#[doc(hidden)] +pub mod payment_links_resource_custom_text_position; +#[doc(inline)] +pub use payment_links_resource_custom_text_position::*; +#[doc(hidden)] +pub mod payment_links_resource_invoice_creation; +#[doc(inline)] +pub use payment_links_resource_invoice_creation::*; +#[doc(hidden)] +pub mod payment_links_resource_invoice_settings; +#[doc(inline)] +pub use payment_links_resource_invoice_settings::*; +#[doc(hidden)] +pub mod payment_links_resource_payment_intent_data; +#[doc(inline)] +pub use payment_links_resource_payment_intent_data::*; +#[doc(hidden)] +pub mod payment_links_resource_payment_method_reuse_agreement; +#[doc(inline)] +pub use payment_links_resource_payment_method_reuse_agreement::*; +#[doc(hidden)] +pub mod payment_links_resource_phone_number_collection; +#[doc(inline)] +pub use payment_links_resource_phone_number_collection::*; +#[doc(hidden)] +pub mod payment_links_resource_restrictions; +#[doc(inline)] +pub use payment_links_resource_restrictions::*; +#[doc(hidden)] +pub mod payment_links_resource_shipping_address_collection; +#[doc(inline)] +pub use payment_links_resource_shipping_address_collection::*; +#[doc(hidden)] +pub mod payment_links_resource_shipping_option; +#[doc(inline)] +pub use payment_links_resource_shipping_option::*; +#[doc(hidden)] +pub mod payment_links_resource_subscription_data; +#[doc(inline)] +pub use payment_links_resource_subscription_data::*; +#[doc(hidden)] +pub mod payment_links_resource_subscription_data_invoice_settings; +#[doc(inline)] +pub use payment_links_resource_subscription_data_invoice_settings::*; +#[doc(hidden)] +pub mod payment_links_resource_tax_id_collection; +#[doc(inline)] +pub use payment_links_resource_tax_id_collection::*; +#[doc(hidden)] +pub mod payment_links_resource_transfer_data; +#[doc(inline)] +pub use payment_links_resource_transfer_data::*; +#[doc(hidden)] +pub mod payment_method; +#[doc(inline)] +pub use payment_method::*; +#[doc(hidden)] +pub mod payment_method_acss_debit; +#[doc(inline)] +pub use payment_method_acss_debit::*; +#[doc(hidden)] +pub mod payment_method_affirm; +#[doc(inline)] +pub use payment_method_affirm::*; +#[doc(hidden)] +pub mod payment_method_afterpay_clearpay; +#[doc(inline)] +pub use payment_method_afterpay_clearpay::*; +#[doc(hidden)] +pub mod payment_method_au_becs_debit; +#[doc(inline)] +pub use payment_method_au_becs_debit::*; +#[doc(hidden)] +pub mod payment_method_bacs_debit; +#[doc(inline)] +pub use payment_method_bacs_debit::*; +#[doc(hidden)] +pub mod payment_method_bancontact; +#[doc(inline)] +pub use payment_method_bancontact::*; +#[doc(hidden)] +pub mod payment_method_blik; +#[doc(inline)] +pub use payment_method_blik::*; +#[doc(hidden)] +pub mod payment_method_boleto; +#[doc(inline)] +pub use payment_method_boleto::*; +#[doc(hidden)] +pub mod payment_method_card; +#[doc(inline)] +pub use payment_method_card::*; +#[doc(hidden)] +pub mod payment_method_card_checks; +#[doc(inline)] +pub use payment_method_card_checks::*; +#[doc(hidden)] +pub mod payment_method_card_present; +#[doc(inline)] +pub use payment_method_card_present::*; +#[doc(hidden)] +pub mod payment_method_card_present_networks; +#[doc(inline)] +pub use payment_method_card_present_networks::*; +#[doc(hidden)] +pub mod payment_method_card_wallet; +#[doc(inline)] +pub use payment_method_card_wallet::*; +#[doc(hidden)] +pub mod payment_method_card_wallet_amex_express_checkout; +#[doc(inline)] +pub use payment_method_card_wallet_amex_express_checkout::*; +#[doc(hidden)] +pub mod payment_method_card_wallet_apple_pay; +#[doc(inline)] +pub use payment_method_card_wallet_apple_pay::*; +#[doc(hidden)] +pub mod payment_method_card_wallet_google_pay; +#[doc(inline)] +pub use payment_method_card_wallet_google_pay::*; +#[doc(hidden)] +pub mod payment_method_card_wallet_link; +#[doc(inline)] +pub use payment_method_card_wallet_link::*; +#[doc(hidden)] +pub mod payment_method_card_wallet_masterpass; +#[doc(inline)] +pub use payment_method_card_wallet_masterpass::*; +#[doc(hidden)] +pub mod payment_method_card_wallet_samsung_pay; +#[doc(inline)] +pub use payment_method_card_wallet_samsung_pay::*; +#[doc(hidden)] +pub mod payment_method_card_wallet_visa_checkout; +#[doc(inline)] +pub use payment_method_card_wallet_visa_checkout::*; +#[doc(hidden)] +pub mod payment_method_cashapp; +#[doc(inline)] +pub use payment_method_cashapp::*; +#[doc(hidden)] +pub mod payment_method_config_biz_payment_method_configuration_details; +#[doc(inline)] +pub use payment_method_config_biz_payment_method_configuration_details::*; +#[doc(hidden)] +pub mod payment_method_customer_balance; +#[doc(inline)] +pub use payment_method_customer_balance::*; +#[doc(hidden)] +pub mod payment_method_details; +#[doc(inline)] +pub use payment_method_details::*; +#[doc(hidden)] +pub mod payment_method_details_ach_credit_transfer; +#[doc(inline)] +pub use payment_method_details_ach_credit_transfer::*; +#[doc(hidden)] +pub mod payment_method_details_ach_debit; +#[doc(inline)] +pub use payment_method_details_ach_debit::*; +#[doc(hidden)] +pub mod payment_method_details_acss_debit; +#[doc(inline)] +pub use payment_method_details_acss_debit::*; +#[doc(hidden)] +pub mod payment_method_details_affirm; +#[doc(inline)] +pub use payment_method_details_affirm::*; +#[doc(hidden)] +pub mod payment_method_details_afterpay_clearpay; +#[doc(inline)] +pub use payment_method_details_afterpay_clearpay::*; +#[doc(hidden)] +pub mod payment_method_details_au_becs_debit; +#[doc(inline)] +pub use payment_method_details_au_becs_debit::*; +#[doc(hidden)] +pub mod payment_method_details_bacs_debit; +#[doc(inline)] +pub use payment_method_details_bacs_debit::*; +#[doc(hidden)] +pub mod payment_method_details_bancontact; +#[doc(inline)] +pub use payment_method_details_bancontact::*; +#[doc(hidden)] +pub mod payment_method_details_blik; +#[doc(inline)] +pub use payment_method_details_blik::*; +#[doc(hidden)] +pub mod payment_method_details_boleto; +#[doc(inline)] +pub use payment_method_details_boleto::*; +#[doc(hidden)] +pub mod payment_method_details_card; +#[doc(inline)] +pub use payment_method_details_card::*; +#[doc(hidden)] +pub mod payment_method_details_card_checks; +#[doc(inline)] +pub use payment_method_details_card_checks::*; +#[doc(hidden)] +pub mod payment_method_details_card_installments; +#[doc(inline)] +pub use payment_method_details_card_installments::*; +#[doc(hidden)] +pub mod payment_method_details_card_installments_plan; +#[doc(inline)] +pub use payment_method_details_card_installments_plan::*; +#[doc(hidden)] +pub mod payment_method_details_card_network_token; +#[doc(inline)] +pub use payment_method_details_card_network_token::*; +#[doc(hidden)] +pub mod payment_method_details_card_present; +#[doc(inline)] +pub use payment_method_details_card_present::*; +#[doc(hidden)] +pub mod payment_method_details_card_present_offline; +#[doc(inline)] +pub use payment_method_details_card_present_offline::*; +#[doc(hidden)] +pub mod payment_method_details_card_present_receipt; +#[doc(inline)] +pub use payment_method_details_card_present_receipt::*; +#[doc(hidden)] +pub mod payment_method_details_card_wallet; +#[doc(inline)] +pub use payment_method_details_card_wallet::*; +#[doc(hidden)] +pub mod payment_method_details_card_wallet_amex_express_checkout; +#[doc(inline)] +pub use payment_method_details_card_wallet_amex_express_checkout::*; +#[doc(hidden)] +pub mod payment_method_details_card_wallet_apple_pay; +#[doc(inline)] +pub use payment_method_details_card_wallet_apple_pay::*; +#[doc(hidden)] +pub mod payment_method_details_card_wallet_google_pay; +#[doc(inline)] +pub use payment_method_details_card_wallet_google_pay::*; +#[doc(hidden)] +pub mod payment_method_details_card_wallet_link; +#[doc(inline)] +pub use payment_method_details_card_wallet_link::*; +#[doc(hidden)] +pub mod payment_method_details_card_wallet_masterpass; +#[doc(inline)] +pub use payment_method_details_card_wallet_masterpass::*; +#[doc(hidden)] +pub mod payment_method_details_card_wallet_samsung_pay; +#[doc(inline)] +pub use payment_method_details_card_wallet_samsung_pay::*; +#[doc(hidden)] +pub mod payment_method_details_card_wallet_visa_checkout; +#[doc(inline)] +pub use payment_method_details_card_wallet_visa_checkout::*; +#[doc(hidden)] +pub mod payment_method_details_cashapp; +#[doc(inline)] +pub use payment_method_details_cashapp::*; +#[doc(hidden)] +pub mod payment_method_details_customer_balance; +#[doc(inline)] +pub use payment_method_details_customer_balance::*; +#[doc(hidden)] +pub mod payment_method_details_eps; +#[doc(inline)] +pub use payment_method_details_eps::*; +#[doc(hidden)] +pub mod payment_method_details_fpx; +#[doc(inline)] +pub use payment_method_details_fpx::*; +#[doc(hidden)] +pub mod payment_method_details_giropay; +#[doc(inline)] +pub use payment_method_details_giropay::*; +#[doc(hidden)] +pub mod payment_method_details_grabpay; +#[doc(inline)] +pub use payment_method_details_grabpay::*; +#[doc(hidden)] +pub mod payment_method_details_ideal; +#[doc(inline)] +pub use payment_method_details_ideal::*; +#[doc(hidden)] +pub mod payment_method_details_interac_present; +#[doc(inline)] +pub use payment_method_details_interac_present::*; +#[doc(hidden)] +pub mod payment_method_details_interac_present_receipt; +#[doc(inline)] +pub use payment_method_details_interac_present_receipt::*; +#[doc(hidden)] +pub mod payment_method_details_klarna; +#[doc(inline)] +pub use payment_method_details_klarna::*; +#[doc(hidden)] +pub mod payment_method_details_konbini; +#[doc(inline)] +pub use payment_method_details_konbini::*; +#[doc(hidden)] +pub mod payment_method_details_konbini_store; +#[doc(inline)] +pub use payment_method_details_konbini_store::*; +#[doc(hidden)] +pub mod payment_method_details_link; +#[doc(inline)] +pub use payment_method_details_link::*; +#[doc(hidden)] +pub mod payment_method_details_multibanco; +#[doc(inline)] +pub use payment_method_details_multibanco::*; +#[doc(hidden)] +pub mod payment_method_details_oxxo; +#[doc(inline)] +pub use payment_method_details_oxxo::*; +#[doc(hidden)] +pub mod payment_method_details_p24; +#[doc(inline)] +pub use payment_method_details_p24::*; +#[doc(hidden)] +pub mod payment_method_details_paynow; +#[doc(inline)] +pub use payment_method_details_paynow::*; +#[doc(hidden)] +pub mod payment_method_details_paypal; +#[doc(inline)] +pub use payment_method_details_paypal::*; +#[doc(hidden)] +pub mod payment_method_details_pix; +#[doc(inline)] +pub use payment_method_details_pix::*; +#[doc(hidden)] +pub mod payment_method_details_promptpay; +#[doc(inline)] +pub use payment_method_details_promptpay::*; +#[doc(hidden)] +pub mod payment_method_details_revolut_pay; +#[doc(inline)] +pub use payment_method_details_revolut_pay::*; +#[doc(hidden)] +pub mod payment_method_details_sepa_credit_transfer; +#[doc(inline)] +pub use payment_method_details_sepa_credit_transfer::*; +#[doc(hidden)] +pub mod payment_method_details_sepa_debit; +#[doc(inline)] +pub use payment_method_details_sepa_debit::*; +#[doc(hidden)] +pub mod payment_method_details_sofort; +#[doc(inline)] +pub use payment_method_details_sofort::*; +#[doc(hidden)] +pub mod payment_method_details_stripe_account; +#[doc(inline)] +pub use payment_method_details_stripe_account::*; +#[doc(hidden)] +pub mod payment_method_details_swish; +#[doc(inline)] +pub use payment_method_details_swish::*; +#[doc(hidden)] +pub mod payment_method_details_us_bank_account; +#[doc(inline)] +pub use payment_method_details_us_bank_account::*; +#[doc(hidden)] +pub mod payment_method_details_wechat; +#[doc(inline)] +pub use payment_method_details_wechat::*; +#[doc(hidden)] +pub mod payment_method_details_wechat_pay; +#[doc(inline)] +pub use payment_method_details_wechat_pay::*; +#[doc(hidden)] +pub mod payment_method_details_zip; +#[doc(inline)] +pub use payment_method_details_zip::*; +#[doc(hidden)] +pub mod payment_method_eps; +#[doc(inline)] +pub use payment_method_eps::*; +#[doc(hidden)] +pub mod payment_method_fpx; +#[doc(inline)] +pub use payment_method_fpx::*; +#[doc(hidden)] +pub mod payment_method_giropay; +#[doc(inline)] +pub use payment_method_giropay::*; +#[doc(hidden)] +pub mod payment_method_grabpay; +#[doc(inline)] +pub use payment_method_grabpay::*; +#[doc(hidden)] +pub mod payment_method_ideal; +#[doc(inline)] +pub use payment_method_ideal::*; +#[doc(hidden)] +pub mod payment_method_interac_present; +#[doc(inline)] +pub use payment_method_interac_present::*; +#[doc(hidden)] +pub mod payment_method_klarna; +#[doc(inline)] +pub use payment_method_klarna::*; +#[doc(hidden)] +pub mod payment_method_konbini; +#[doc(inline)] +pub use payment_method_konbini::*; +#[doc(hidden)] +pub mod payment_method_link; +#[doc(inline)] +pub use payment_method_link::*; +#[doc(hidden)] +pub mod payment_method_options_affirm; +#[doc(inline)] +pub use payment_method_options_affirm::*; +#[doc(hidden)] +pub mod payment_method_options_afterpay_clearpay; +#[doc(inline)] +pub use payment_method_options_afterpay_clearpay::*; +#[doc(hidden)] +pub mod payment_method_options_alipay; +#[doc(inline)] +pub use payment_method_options_alipay::*; +#[doc(hidden)] +pub mod payment_method_options_bacs_debit; +#[doc(inline)] +pub use payment_method_options_bacs_debit::*; +#[doc(hidden)] +pub mod payment_method_options_bancontact; +#[doc(inline)] +pub use payment_method_options_bancontact::*; +#[doc(hidden)] +pub mod payment_method_options_boleto; +#[doc(inline)] +pub use payment_method_options_boleto::*; +#[doc(hidden)] +pub mod payment_method_options_card_installments; +#[doc(inline)] +pub use payment_method_options_card_installments::*; +#[doc(hidden)] +pub mod payment_method_options_card_mandate_options; +#[doc(inline)] +pub use payment_method_options_card_mandate_options::*; +#[doc(hidden)] +pub mod payment_method_options_card_present; +#[doc(inline)] +pub use payment_method_options_card_present::*; +#[doc(hidden)] +pub mod payment_method_options_cashapp; +#[doc(inline)] +pub use payment_method_options_cashapp::*; +#[doc(hidden)] +pub mod payment_method_options_customer_balance; +#[doc(inline)] +pub use payment_method_options_customer_balance::*; +#[doc(hidden)] +pub mod payment_method_options_customer_balance_bank_transfer; +#[doc(inline)] +pub use payment_method_options_customer_balance_bank_transfer::*; +#[doc(hidden)] +pub mod payment_method_options_customer_balance_eu_bank_account; +#[doc(inline)] +pub use payment_method_options_customer_balance_eu_bank_account::*; +#[doc(hidden)] +pub mod payment_method_options_fpx; +#[doc(inline)] +pub use payment_method_options_fpx::*; +#[doc(hidden)] +pub mod payment_method_options_giropay; +#[doc(inline)] +pub use payment_method_options_giropay::*; +#[doc(hidden)] +pub mod payment_method_options_grabpay; +#[doc(inline)] +pub use payment_method_options_grabpay::*; +#[doc(hidden)] +pub mod payment_method_options_ideal; +#[doc(inline)] +pub use payment_method_options_ideal::*; +#[doc(hidden)] +pub mod payment_method_options_interac_present; +#[doc(inline)] +pub use payment_method_options_interac_present::*; +#[doc(hidden)] +pub mod payment_method_options_klarna; +#[doc(inline)] +pub use payment_method_options_klarna::*; +#[doc(hidden)] +pub mod payment_method_options_konbini; +#[doc(inline)] +pub use payment_method_options_konbini::*; +#[doc(hidden)] +pub mod payment_method_options_oxxo; +#[doc(inline)] +pub use payment_method_options_oxxo::*; +#[doc(hidden)] +pub mod payment_method_options_p24; +#[doc(inline)] +pub use payment_method_options_p24::*; +#[doc(hidden)] +pub mod payment_method_options_paynow; +#[doc(inline)] +pub use payment_method_options_paynow::*; +#[doc(hidden)] +pub mod payment_method_options_paypal; +#[doc(inline)] +pub use payment_method_options_paypal::*; +#[doc(hidden)] +pub mod payment_method_options_pix; +#[doc(inline)] +pub use payment_method_options_pix::*; +#[doc(hidden)] +pub mod payment_method_options_promptpay; +#[doc(inline)] +pub use payment_method_options_promptpay::*; +#[doc(hidden)] +pub mod payment_method_options_revolut_pay; +#[doc(inline)] +pub use payment_method_options_revolut_pay::*; +#[doc(hidden)] +pub mod payment_method_options_sofort; +#[doc(inline)] +pub use payment_method_options_sofort::*; +#[doc(hidden)] +pub mod payment_method_options_us_bank_account_mandate_options; +#[doc(inline)] +pub use payment_method_options_us_bank_account_mandate_options::*; +#[doc(hidden)] +pub mod payment_method_options_wechat_pay; +#[doc(inline)] +pub use payment_method_options_wechat_pay::*; +#[doc(hidden)] +pub mod payment_method_options_zip; +#[doc(inline)] +pub use payment_method_options_zip::*; +#[doc(hidden)] +pub mod payment_method_oxxo; +#[doc(inline)] +pub use payment_method_oxxo::*; +#[doc(hidden)] +pub mod payment_method_p24; +#[doc(inline)] +pub use payment_method_p24::*; +#[doc(hidden)] +pub mod payment_method_paynow; +#[doc(inline)] +pub use payment_method_paynow::*; +#[doc(hidden)] +pub mod payment_method_paypal; +#[doc(inline)] +pub use payment_method_paypal::*; +#[doc(hidden)] +pub mod payment_method_pix; +#[doc(inline)] +pub use payment_method_pix::*; +#[doc(hidden)] +pub mod payment_method_promptpay; +#[doc(inline)] +pub use payment_method_promptpay::*; +#[doc(hidden)] +pub mod payment_method_revolut_pay; +#[doc(inline)] +pub use payment_method_revolut_pay::*; +#[doc(hidden)] +pub mod payment_method_sepa_debit; +#[doc(inline)] +pub use payment_method_sepa_debit::*; +#[doc(hidden)] +pub mod payment_method_sofort; +#[doc(inline)] +pub use payment_method_sofort::*; +#[doc(hidden)] +pub mod payment_method_swish; +#[doc(inline)] +pub use payment_method_swish::*; +#[doc(hidden)] +pub mod payment_method_us_bank_account; +#[doc(inline)] +pub use payment_method_us_bank_account::*; +#[doc(hidden)] +pub mod payment_method_us_bank_account_blocked; +#[doc(inline)] +pub use payment_method_us_bank_account_blocked::*; +#[doc(hidden)] +pub mod payment_method_us_bank_account_status_details; +#[doc(inline)] +pub use payment_method_us_bank_account_status_details::*; +#[doc(hidden)] +pub mod payment_method_wechat_pay; +#[doc(inline)] +pub use payment_method_wechat_pay::*; +#[doc(hidden)] +pub mod payment_method_zip; +#[doc(inline)] +pub use payment_method_zip::*; +#[doc(hidden)] +pub mod payment_source; +#[doc(inline)] +pub use payment_source::*; +#[doc(hidden)] +pub mod payout; +#[doc(inline)] +pub use payout::*; +#[doc(hidden)] +pub mod paypal_seller_protection; +#[doc(inline)] +pub use paypal_seller_protection::*; +#[doc(hidden)] +pub mod period; +#[doc(inline)] +pub use period::*; +#[doc(hidden)] +pub mod person; +#[doc(inline)] +pub use person::*; +#[doc(hidden)] +pub mod person_additional_tos_acceptance; +#[doc(inline)] +pub use person_additional_tos_acceptance::*; +#[doc(hidden)] +pub mod person_additional_tos_acceptances; +#[doc(inline)] +pub use person_additional_tos_acceptances::*; +#[doc(hidden)] +pub mod person_future_requirements; +#[doc(inline)] +pub use person_future_requirements::*; +#[doc(hidden)] +pub mod person_relationship; +#[doc(inline)] +pub use person_relationship::*; +#[doc(hidden)] +pub mod person_requirements; +#[doc(inline)] +pub use person_requirements::*; +#[doc(hidden)] +pub mod plan; +#[doc(inline)] +pub use plan::*; +#[doc(hidden)] +pub mod plan_tier; +#[doc(inline)] +pub use plan_tier::*; +#[doc(hidden)] +pub mod platform_tax_fee; +#[doc(inline)] +pub use platform_tax_fee::*; +#[doc(hidden)] +pub mod price; +#[doc(inline)] +pub use price::*; +#[doc(hidden)] +pub mod price_tier; +#[doc(inline)] +pub use price_tier::*; +#[doc(hidden)] +pub mod product; +#[doc(inline)] +pub use product::*; +#[doc(hidden)] +pub mod product_feature; +#[doc(inline)] +pub use product_feature::*; +#[doc(hidden)] +pub mod promotion_code; +#[doc(inline)] +pub use promotion_code::*; +#[doc(hidden)] +pub mod promotion_code_currency_option; +#[doc(inline)] +pub use promotion_code_currency_option::*; +#[doc(hidden)] +pub mod promotion_codes_resource_restrictions; +#[doc(inline)] +pub use promotion_codes_resource_restrictions::*; +#[doc(hidden)] +pub mod quote; +#[doc(inline)] +pub use quote::*; +#[doc(hidden)] +pub mod quotes_resource_automatic_tax; +#[doc(inline)] +pub use quotes_resource_automatic_tax::*; +#[doc(hidden)] +pub mod quotes_resource_computed; +#[doc(inline)] +pub use quotes_resource_computed::*; +#[doc(hidden)] +pub mod quotes_resource_from_quote; +#[doc(inline)] +pub use quotes_resource_from_quote::*; +#[doc(hidden)] +pub mod quotes_resource_recurring; +#[doc(inline)] +pub use quotes_resource_recurring::*; +#[doc(hidden)] +pub mod quotes_resource_status_transitions; +#[doc(inline)] +pub use quotes_resource_status_transitions::*; +#[doc(hidden)] +pub mod quotes_resource_subscription_data_subscription_data; +#[doc(inline)] +pub use quotes_resource_subscription_data_subscription_data::*; +#[doc(hidden)] +pub mod quotes_resource_total_details; +#[doc(inline)] +pub use quotes_resource_total_details::*; +#[doc(hidden)] +pub mod quotes_resource_total_details_resource_breakdown; +#[doc(inline)] +pub use quotes_resource_total_details_resource_breakdown::*; +#[doc(hidden)] +pub mod quotes_resource_transfer_data; +#[doc(inline)] +pub use quotes_resource_transfer_data::*; +#[doc(hidden)] +pub mod quotes_resource_upfront; +#[doc(inline)] +pub use quotes_resource_upfront::*; +#[doc(hidden)] +pub mod radar_radar_options; +#[doc(inline)] +pub use radar_radar_options::*; +#[doc(hidden)] +pub mod radar_review_resource_location; +#[doc(inline)] +pub use radar_review_resource_location::*; +#[doc(hidden)] +pub mod radar_review_resource_session; +#[doc(inline)] +pub use radar_review_resource_session::*; +#[doc(hidden)] +pub mod recurring; +#[doc(inline)] +pub use recurring::*; +#[doc(hidden)] +pub mod refund; +#[doc(inline)] +pub use refund::*; +#[doc(hidden)] +pub mod refund_destination_details; +#[doc(inline)] +pub use refund_destination_details::*; +#[doc(hidden)] +pub mod refund_destination_details_card; +#[doc(inline)] +pub use refund_destination_details_card::*; +#[doc(hidden)] +pub mod refund_destination_details_generic; +#[doc(inline)] +pub use refund_destination_details_generic::*; +#[doc(hidden)] +pub mod refund_next_action; +#[doc(inline)] +pub use refund_next_action::*; +#[doc(hidden)] +pub mod refund_next_action_display_details; +#[doc(inline)] +pub use refund_next_action_display_details::*; +#[doc(hidden)] +pub mod reserve_transaction; +#[doc(inline)] +pub use reserve_transaction::*; +#[doc(hidden)] +pub mod review; +#[doc(inline)] +pub use review::*; +#[doc(hidden)] +pub mod rule; +#[doc(inline)] +pub use rule::*; +#[doc(hidden)] +pub mod schedules_phase_automatic_tax; +#[doc(inline)] +pub use schedules_phase_automatic_tax::*; +#[doc(hidden)] +pub mod sepa_debit_generated_from; +#[doc(inline)] +pub use sepa_debit_generated_from::*; +#[doc(hidden)] +pub mod setup_attempt; +#[doc(inline)] +pub use setup_attempt::*; +#[doc(hidden)] +pub mod setup_attempt_payment_method_details; +#[doc(inline)] +pub use setup_attempt_payment_method_details::*; +#[doc(hidden)] +pub mod setup_attempt_payment_method_details_acss_debit; +#[doc(inline)] +pub use setup_attempt_payment_method_details_acss_debit::*; +#[doc(hidden)] +pub mod setup_attempt_payment_method_details_au_becs_debit; +#[doc(inline)] +pub use setup_attempt_payment_method_details_au_becs_debit::*; +#[doc(hidden)] +pub mod setup_attempt_payment_method_details_bacs_debit; +#[doc(inline)] +pub use setup_attempt_payment_method_details_bacs_debit::*; +#[doc(hidden)] +pub mod setup_attempt_payment_method_details_bancontact; +#[doc(inline)] +pub use setup_attempt_payment_method_details_bancontact::*; +#[doc(hidden)] +pub mod setup_attempt_payment_method_details_boleto; +#[doc(inline)] +pub use setup_attempt_payment_method_details_boleto::*; +#[doc(hidden)] +pub mod setup_attempt_payment_method_details_card; +#[doc(inline)] +pub use setup_attempt_payment_method_details_card::*; +#[doc(hidden)] +pub mod setup_attempt_payment_method_details_card_checks; +#[doc(inline)] +pub use setup_attempt_payment_method_details_card_checks::*; +#[doc(hidden)] +pub mod setup_attempt_payment_method_details_card_present; +#[doc(inline)] +pub use setup_attempt_payment_method_details_card_present::*; +#[doc(hidden)] +pub mod setup_attempt_payment_method_details_card_wallet; +#[doc(inline)] +pub use setup_attempt_payment_method_details_card_wallet::*; +#[doc(hidden)] +pub mod setup_attempt_payment_method_details_cashapp; +#[doc(inline)] +pub use setup_attempt_payment_method_details_cashapp::*; +#[doc(hidden)] +pub mod setup_attempt_payment_method_details_ideal; +#[doc(inline)] +pub use setup_attempt_payment_method_details_ideal::*; +#[doc(hidden)] +pub mod setup_attempt_payment_method_details_klarna; +#[doc(inline)] +pub use setup_attempt_payment_method_details_klarna::*; +#[doc(hidden)] +pub mod setup_attempt_payment_method_details_link; +#[doc(inline)] +pub use setup_attempt_payment_method_details_link::*; +#[doc(hidden)] +pub mod setup_attempt_payment_method_details_paypal; +#[doc(inline)] +pub use setup_attempt_payment_method_details_paypal::*; +#[doc(hidden)] +pub mod setup_attempt_payment_method_details_sepa_debit; +#[doc(inline)] +pub use setup_attempt_payment_method_details_sepa_debit::*; +#[doc(hidden)] +pub mod setup_attempt_payment_method_details_sofort; +#[doc(inline)] +pub use setup_attempt_payment_method_details_sofort::*; +#[doc(hidden)] +pub mod setup_attempt_payment_method_details_us_bank_account; +#[doc(inline)] +pub use setup_attempt_payment_method_details_us_bank_account::*; +#[doc(hidden)] +pub mod setup_intent; +#[doc(inline)] +pub use setup_intent::*; +#[doc(hidden)] +pub mod setup_intent_next_action; +#[doc(inline)] +pub use setup_intent_next_action::*; +#[doc(hidden)] +pub mod setup_intent_next_action_redirect_to_url; +#[doc(inline)] +pub use setup_intent_next_action_redirect_to_url::*; +#[doc(hidden)] +pub mod setup_intent_next_action_verify_with_microdeposits; +#[doc(inline)] +pub use setup_intent_next_action_verify_with_microdeposits::*; +#[doc(hidden)] +pub mod setup_intent_payment_method_options; +#[doc(inline)] +pub use setup_intent_payment_method_options::*; +#[doc(hidden)] +pub mod setup_intent_payment_method_options_acss_debit; +#[doc(inline)] +pub use setup_intent_payment_method_options_acss_debit::*; +#[doc(hidden)] +pub mod setup_intent_payment_method_options_card; +#[doc(inline)] +pub use setup_intent_payment_method_options_card::*; +#[doc(hidden)] +pub mod setup_intent_payment_method_options_card_mandate_options; +#[doc(inline)] +pub use setup_intent_payment_method_options_card_mandate_options::*; +#[doc(hidden)] +pub mod setup_intent_payment_method_options_link; +#[doc(inline)] +pub use setup_intent_payment_method_options_link::*; +#[doc(hidden)] +pub mod setup_intent_payment_method_options_mandate_options_acss_debit; +#[doc(inline)] +pub use setup_intent_payment_method_options_mandate_options_acss_debit::*; +#[doc(hidden)] +pub mod setup_intent_payment_method_options_mandate_options_sepa_debit; +#[doc(inline)] +pub use setup_intent_payment_method_options_mandate_options_sepa_debit::*; +#[doc(hidden)] +pub mod setup_intent_payment_method_options_paypal; +#[doc(inline)] +pub use setup_intent_payment_method_options_paypal::*; +#[doc(hidden)] +pub mod setup_intent_payment_method_options_sepa_debit; +#[doc(inline)] +pub use setup_intent_payment_method_options_sepa_debit::*; +#[doc(hidden)] +pub mod setup_intent_payment_method_options_us_bank_account; +#[doc(inline)] +pub use setup_intent_payment_method_options_us_bank_account::*; +#[doc(hidden)] +pub mod shipping; +#[doc(inline)] +pub use shipping::*; +#[doc(hidden)] +pub mod shipping_rate; +#[doc(inline)] +pub use shipping_rate::*; +#[doc(hidden)] +pub mod shipping_rate_currency_option; +#[doc(inline)] +pub use shipping_rate_currency_option::*; +#[doc(hidden)] +pub mod shipping_rate_delivery_estimate; +#[doc(inline)] +pub use shipping_rate_delivery_estimate::*; +#[doc(hidden)] +pub mod shipping_rate_delivery_estimate_bound; +#[doc(inline)] +pub use shipping_rate_delivery_estimate_bound::*; +#[doc(hidden)] +pub mod shipping_rate_fixed_amount; +#[doc(inline)] +pub use shipping_rate_fixed_amount::*; +#[doc(hidden)] +pub mod source; +#[doc(inline)] +pub use source::*; +#[doc(hidden)] +pub mod source_code_verification_flow; +#[doc(inline)] +pub use source_code_verification_flow::*; +#[doc(hidden)] +pub mod source_order; +#[doc(inline)] +pub use source_order::*; +#[doc(hidden)] +pub mod source_order_item; +#[doc(inline)] +pub use source_order_item::*; +#[doc(hidden)] +pub mod source_owner; +#[doc(inline)] +pub use source_owner::*; +#[doc(hidden)] +pub mod source_receiver_flow; +#[doc(inline)] +pub use source_receiver_flow::*; +#[doc(hidden)] +pub mod source_redirect_flow; +#[doc(inline)] +pub use source_redirect_flow::*; +#[doc(hidden)] +pub mod source_transaction; +#[doc(inline)] +pub use source_transaction::*; +#[doc(hidden)] +pub mod source_transaction_ach_credit_transfer_data; +#[doc(inline)] +pub use source_transaction_ach_credit_transfer_data::*; +#[doc(hidden)] +pub mod source_transaction_chf_credit_transfer_data; +#[doc(inline)] +pub use source_transaction_chf_credit_transfer_data::*; +#[doc(hidden)] +pub mod source_transaction_gbp_credit_transfer_data; +#[doc(inline)] +pub use source_transaction_gbp_credit_transfer_data::*; +#[doc(hidden)] +pub mod source_transaction_paper_check_data; +#[doc(inline)] +pub use source_transaction_paper_check_data::*; +#[doc(hidden)] +pub mod source_transaction_sepa_credit_transfer_data; +#[doc(inline)] +pub use source_transaction_sepa_credit_transfer_data::*; +#[doc(hidden)] +pub mod source_type_ach_credit_transfer; +#[doc(inline)] +pub use source_type_ach_credit_transfer::*; +#[doc(hidden)] +pub mod source_type_ach_debit; +#[doc(inline)] +pub use source_type_ach_debit::*; +#[doc(hidden)] +pub mod source_type_acss_debit; +#[doc(inline)] +pub use source_type_acss_debit::*; +#[doc(hidden)] +pub mod source_type_alipay; +#[doc(inline)] +pub use source_type_alipay::*; +#[doc(hidden)] +pub mod source_type_au_becs_debit; +#[doc(inline)] +pub use source_type_au_becs_debit::*; +#[doc(hidden)] +pub mod source_type_bancontact; +#[doc(inline)] +pub use source_type_bancontact::*; +#[doc(hidden)] +pub mod source_type_card; +#[doc(inline)] +pub use source_type_card::*; +#[doc(hidden)] +pub mod source_type_card_present; +#[doc(inline)] +pub use source_type_card_present::*; +#[doc(hidden)] +pub mod source_type_eps; +#[doc(inline)] +pub use source_type_eps::*; +#[doc(hidden)] +pub mod source_type_giropay; +#[doc(inline)] +pub use source_type_giropay::*; +#[doc(hidden)] +pub mod source_type_ideal; +#[doc(inline)] +pub use source_type_ideal::*; +#[doc(hidden)] +pub mod source_type_klarna; +#[doc(inline)] +pub use source_type_klarna::*; +#[doc(hidden)] +pub mod source_type_multibanco; +#[doc(inline)] +pub use source_type_multibanco::*; +#[doc(hidden)] +pub mod source_type_p24; +#[doc(inline)] +pub use source_type_p24::*; +#[doc(hidden)] +pub mod source_type_sepa_credit_transfer; +#[doc(inline)] +pub use source_type_sepa_credit_transfer::*; +#[doc(hidden)] +pub mod source_type_sepa_debit; +#[doc(inline)] +pub use source_type_sepa_debit::*; +#[doc(hidden)] +pub mod source_type_sofort; +#[doc(inline)] +pub use source_type_sofort::*; +#[doc(hidden)] +pub mod source_type_three_d_secure; +#[doc(inline)] +pub use source_type_three_d_secure::*; +#[doc(hidden)] +pub mod source_type_wechat; +#[doc(inline)] +pub use source_type_wechat::*; +#[doc(hidden)] +pub mod subscription; +#[doc(inline)] +pub use subscription::*; +#[doc(hidden)] +pub mod subscription_automatic_tax; +#[doc(inline)] +pub use subscription_automatic_tax::*; +#[doc(hidden)] +pub mod subscription_billing_thresholds; +#[doc(inline)] +pub use subscription_billing_thresholds::*; +#[doc(hidden)] +pub mod subscription_details_data; +#[doc(inline)] +pub use subscription_details_data::*; +#[doc(hidden)] +pub mod subscription_item; +#[doc(inline)] +pub use subscription_item::*; +#[doc(hidden)] +pub mod subscription_item_billing_thresholds; +#[doc(inline)] +pub use subscription_item_billing_thresholds::*; +#[doc(hidden)] +pub mod subscription_payment_method_options_card; +#[doc(inline)] +pub use subscription_payment_method_options_card::*; +#[doc(hidden)] +pub mod subscription_pending_invoice_item_interval; +#[doc(inline)] +pub use subscription_pending_invoice_item_interval::*; +#[doc(hidden)] +pub mod subscription_schedule; +#[doc(inline)] +pub use subscription_schedule::*; +#[doc(hidden)] +pub mod subscription_schedule_add_invoice_item; +#[doc(inline)] +pub use subscription_schedule_add_invoice_item::*; +#[doc(hidden)] +pub mod subscription_schedule_configuration_item; +#[doc(inline)] +pub use subscription_schedule_configuration_item::*; +#[doc(hidden)] +pub mod subscription_schedule_current_phase; +#[doc(inline)] +pub use subscription_schedule_current_phase::*; +#[doc(hidden)] +pub mod subscription_schedule_phase_configuration; +#[doc(inline)] +pub use subscription_schedule_phase_configuration::*; +#[doc(hidden)] +pub mod subscription_schedules_resource_default_settings; +#[doc(inline)] +pub use subscription_schedules_resource_default_settings::*; +#[doc(hidden)] +pub mod subscription_schedules_resource_default_settings_automatic_tax; +#[doc(inline)] +pub use subscription_schedules_resource_default_settings_automatic_tax::*; +#[doc(hidden)] +pub mod subscription_transfer_data; +#[doc(inline)] +pub use subscription_transfer_data::*; +#[doc(hidden)] +pub mod subscriptions_resource_billing_cycle_anchor_config; +#[doc(inline)] +pub use subscriptions_resource_billing_cycle_anchor_config::*; +#[doc(hidden)] +pub mod subscriptions_resource_pause_collection; +#[doc(inline)] +pub use subscriptions_resource_pause_collection::*; +#[doc(hidden)] +pub mod subscriptions_resource_payment_method_options; +#[doc(inline)] +pub use subscriptions_resource_payment_method_options::*; +#[doc(hidden)] +pub mod subscriptions_resource_payment_settings; +#[doc(inline)] +pub use subscriptions_resource_payment_settings::*; +#[doc(hidden)] +pub mod subscriptions_resource_pending_update; +#[doc(inline)] +pub use subscriptions_resource_pending_update::*; +#[doc(hidden)] +pub mod subscriptions_trials_resource_end_behavior; +#[doc(inline)] +pub use subscriptions_trials_resource_end_behavior::*; +#[doc(hidden)] +pub mod subscriptions_trials_resource_trial_settings; +#[doc(inline)] +pub use subscriptions_trials_resource_trial_settings::*; +#[doc(hidden)] +pub mod tax_code; +#[doc(inline)] +pub use tax_code::*; +#[doc(hidden)] +pub mod tax_deducted_at_source; +#[doc(inline)] +pub use tax_deducted_at_source::*; +#[doc(hidden)] +pub mod tax_i_ds_owner; +#[doc(inline)] +pub use tax_i_ds_owner::*; +#[doc(hidden)] +pub mod tax_id; +#[doc(inline)] +pub use tax_id::*; +#[doc(hidden)] +pub mod tax_id_verification; +#[doc(inline)] +pub use tax_id_verification::*; +#[doc(hidden)] +pub mod tax_rate; +#[doc(inline)] +pub use tax_rate::*; +#[doc(hidden)] +pub mod test_helpers_test_clock; +#[doc(inline)] +pub use test_helpers_test_clock::*; +#[doc(hidden)] +pub mod three_d_secure_details; +#[doc(inline)] +pub use three_d_secure_details::*; +#[doc(hidden)] +pub mod three_d_secure_details_charge; +#[doc(inline)] +pub use three_d_secure_details_charge::*; +#[doc(hidden)] +pub mod three_d_secure_usage; +#[doc(inline)] +pub use three_d_secure_usage::*; +#[doc(hidden)] +pub mod topup; +#[doc(inline)] +pub use topup::*; +#[doc(hidden)] +pub mod transfer; +#[doc(inline)] +pub use transfer::*; +#[doc(hidden)] +pub mod transfer_data; +#[doc(inline)] +pub use transfer_data::*; +#[doc(hidden)] +pub mod transfer_reversal; +#[doc(inline)] +pub use transfer_reversal::*; +#[doc(hidden)] +pub mod transfer_schedule; +#[doc(inline)] +pub use transfer_schedule::*; +#[doc(hidden)] +pub mod transform_quantity; +#[doc(inline)] +pub use transform_quantity::*; +#[doc(hidden)] +pub mod transform_usage; +#[doc(inline)] +pub use transform_usage::*; +pub mod api_version; +pub use api_version::ApiVersion; +pub mod version; diff --git a/generated/stripe_shared/src/networks.rs b/generated/stripe_shared/src/networks.rs new file mode 100644 index 000000000..2e272069d --- /dev/null +++ b/generated/stripe_shared/src/networks.rs @@ -0,0 +1,8 @@ +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct Networks { + /// All available networks for the card. + pub available: Vec, + /// The preferred network for co-branded cards. + /// Can be `cartes_bancaires`, `mastercard`, `visa` or `invalid_preference` if requested network is not valid for the card. + pub preferred: Option, +} diff --git a/generated/stripe_shared/src/notification_event_data.rs b/generated/stripe_shared/src/notification_event_data.rs new file mode 100644 index 000000000..b50e482a4 --- /dev/null +++ b/generated/stripe_shared/src/notification_event_data.rs @@ -0,0 +1,11 @@ +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct NotificationEventData { + /// Object containing the API resource relevant to the event. + /// For example, an `invoice.created` event will have a full [invoice object](https://stripe.com/docs/api#invoice_object) as the value of the object key. + pub object: serde_json::Value, + /// Object containing the names of the updated attributes and their values prior to the event (only included in events of type `*.updated`). + /// If an array attribute has any updated elements, this object contains the entire array. + /// In Stripe API versions 2017-04-06 or earlier, an updated array attribute in this object includes only the updated array elements. + #[serde(skip_serializing_if = "Option::is_none")] + pub previous_attributes: Option, +} diff --git a/generated/stripe_shared/src/notification_event_request.rs b/generated/stripe_shared/src/notification_event_request.rs new file mode 100644 index 000000000..a4b778196 --- /dev/null +++ b/generated/stripe_shared/src/notification_event_request.rs @@ -0,0 +1,10 @@ +#[derive(Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct NotificationEventRequest { + /// ID of the API request that caused the event. + /// If null, the event was automatic (e.g., Stripe's automatic subscription handling). + /// Request logs are available in the [dashboard](https://dashboard.stripe.com/logs), but currently not in the API. + pub id: Option, + /// The idempotency key transmitted during the request, if any. + /// *Note: This property is populated only for events on or after May 23, 2017*. + pub idempotency_key: Option, +} diff --git a/generated/stripe_shared/src/offline_acceptance.rs b/generated/stripe_shared/src/offline_acceptance.rs new file mode 100644 index 000000000..b83820747 --- /dev/null +++ b/generated/stripe_shared/src/offline_acceptance.rs @@ -0,0 +1,2 @@ +#[derive(Copy, Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct OfflineAcceptance {} diff --git a/generated/stripe_shared/src/online_acceptance.rs b/generated/stripe_shared/src/online_acceptance.rs new file mode 100644 index 000000000..e8a780018 --- /dev/null +++ b/generated/stripe_shared/src/online_acceptance.rs @@ -0,0 +1,7 @@ +#[derive(Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct OnlineAcceptance { + /// The customer accepts the mandate from this IP address. + pub ip_address: Option, + /// The customer accepts the mandate using the user agent of the browser. + pub user_agent: Option, +} diff --git a/generated/stripe_shared/src/package_dimensions.rs b/generated/stripe_shared/src/package_dimensions.rs new file mode 100644 index 000000000..384074024 --- /dev/null +++ b/generated/stripe_shared/src/package_dimensions.rs @@ -0,0 +1,11 @@ +#[derive(Copy, Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct PackageDimensions { + /// Height, in inches. + pub height: f64, + /// Length, in inches. + pub length: f64, + /// Weight, in ounces. + pub weight: f64, + /// Width, in inches. + pub width: f64, +} diff --git a/generated/stripe_shared/src/payment_flows_amount_details.rs b/generated/stripe_shared/src/payment_flows_amount_details.rs new file mode 100644 index 000000000..0ba1b5d1e --- /dev/null +++ b/generated/stripe_shared/src/payment_flows_amount_details.rs @@ -0,0 +1,5 @@ +#[derive(Copy, Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct PaymentFlowsAmountDetails { + #[serde(skip_serializing_if = "Option::is_none")] + pub tip: Option, +} diff --git a/generated/stripe_shared/src/payment_flows_amount_details_resource_tip.rs b/generated/stripe_shared/src/payment_flows_amount_details_resource_tip.rs new file mode 100644 index 000000000..9bb050a35 --- /dev/null +++ b/generated/stripe_shared/src/payment_flows_amount_details_resource_tip.rs @@ -0,0 +1,6 @@ +#[derive(Copy, Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct PaymentFlowsAmountDetailsResourceTip { + /// Portion of the amount that corresponds to a tip. + #[serde(skip_serializing_if = "Option::is_none")] + pub amount: Option, +} diff --git a/generated/stripe_shared/src/payment_flows_automatic_payment_methods_payment_intent.rs b/generated/stripe_shared/src/payment_flows_automatic_payment_methods_payment_intent.rs new file mode 100644 index 000000000..1c30291e7 --- /dev/null +++ b/generated/stripe_shared/src/payment_flows_automatic_payment_methods_payment_intent.rs @@ -0,0 +1,73 @@ +#[derive(Copy, Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct PaymentFlowsAutomaticPaymentMethodsPaymentIntent { + /// Controls whether this PaymentIntent will accept redirect-based payment methods. + /// + /// Redirect-based payment methods may require your customer to be redirected to a payment method's app or site for authentication or additional steps. + /// To [confirm](https://stripe.com/docs/api/payment_intents/confirm) this PaymentIntent, you may be required to provide a `return_url` to redirect customers back to your site after they authenticate or complete the payment. + #[serde(skip_serializing_if = "Option::is_none")] + pub allow_redirects: Option, + /// Automatically calculates compatible payment methods + pub enabled: bool, +} +/// Controls whether this PaymentIntent will accept redirect-based payment methods. +/// +/// Redirect-based payment methods may require your customer to be redirected to a payment method's app or site for authentication or additional steps. +/// To [confirm](https://stripe.com/docs/api/payment_intents/confirm) this PaymentIntent, you may be required to provide a `return_url` to redirect customers back to your site after they authenticate or complete the payment. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum PaymentFlowsAutomaticPaymentMethodsPaymentIntentAllowRedirects { + Always, + Never, +} +impl PaymentFlowsAutomaticPaymentMethodsPaymentIntentAllowRedirects { + pub fn as_str(self) -> &'static str { + use PaymentFlowsAutomaticPaymentMethodsPaymentIntentAllowRedirects::*; + match self { + Always => "always", + Never => "never", + } + } +} + +impl std::str::FromStr for PaymentFlowsAutomaticPaymentMethodsPaymentIntentAllowRedirects { + type Err = (); + fn from_str(s: &str) -> Result { + use PaymentFlowsAutomaticPaymentMethodsPaymentIntentAllowRedirects::*; + match s { + "always" => Ok(Always), + "never" => Ok(Never), + _ => Err(()), + } + } +} +impl std::fmt::Display for PaymentFlowsAutomaticPaymentMethodsPaymentIntentAllowRedirects { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for PaymentFlowsAutomaticPaymentMethodsPaymentIntentAllowRedirects { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for PaymentFlowsAutomaticPaymentMethodsPaymentIntentAllowRedirects { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> + for PaymentFlowsAutomaticPaymentMethodsPaymentIntentAllowRedirects +{ + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| { + serde::de::Error::custom( + "Unknown value for PaymentFlowsAutomaticPaymentMethodsPaymentIntentAllowRedirects", + ) + }) + } +} diff --git a/generated/stripe_shared/src/payment_flows_automatic_payment_methods_setup_intent.rs b/generated/stripe_shared/src/payment_flows_automatic_payment_methods_setup_intent.rs new file mode 100644 index 000000000..07be5f69a --- /dev/null +++ b/generated/stripe_shared/src/payment_flows_automatic_payment_methods_setup_intent.rs @@ -0,0 +1,71 @@ +#[derive(Copy, Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct PaymentFlowsAutomaticPaymentMethodsSetupIntent { + /// Controls whether this SetupIntent will accept redirect-based payment methods. + /// + /// Redirect-based payment methods may require your customer to be redirected to a payment method's app or site for authentication or additional steps. + /// To [confirm](https://stripe.com/docs/api/setup_intents/confirm) this SetupIntent, you may be required to provide a `return_url` to redirect customers back to your site after they authenticate or complete the setup. + #[serde(skip_serializing_if = "Option::is_none")] + pub allow_redirects: Option, + /// Automatically calculates compatible payment methods + pub enabled: Option, +} +/// Controls whether this SetupIntent will accept redirect-based payment methods. +/// +/// Redirect-based payment methods may require your customer to be redirected to a payment method's app or site for authentication or additional steps. +/// To [confirm](https://stripe.com/docs/api/setup_intents/confirm) this SetupIntent, you may be required to provide a `return_url` to redirect customers back to your site after they authenticate or complete the setup. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum PaymentFlowsAutomaticPaymentMethodsSetupIntentAllowRedirects { + Always, + Never, +} +impl PaymentFlowsAutomaticPaymentMethodsSetupIntentAllowRedirects { + pub fn as_str(self) -> &'static str { + use PaymentFlowsAutomaticPaymentMethodsSetupIntentAllowRedirects::*; + match self { + Always => "always", + Never => "never", + } + } +} + +impl std::str::FromStr for PaymentFlowsAutomaticPaymentMethodsSetupIntentAllowRedirects { + type Err = (); + fn from_str(s: &str) -> Result { + use PaymentFlowsAutomaticPaymentMethodsSetupIntentAllowRedirects::*; + match s { + "always" => Ok(Always), + "never" => Ok(Never), + _ => Err(()), + } + } +} +impl std::fmt::Display for PaymentFlowsAutomaticPaymentMethodsSetupIntentAllowRedirects { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for PaymentFlowsAutomaticPaymentMethodsSetupIntentAllowRedirects { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for PaymentFlowsAutomaticPaymentMethodsSetupIntentAllowRedirects { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for PaymentFlowsAutomaticPaymentMethodsSetupIntentAllowRedirects { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| { + serde::de::Error::custom( + "Unknown value for PaymentFlowsAutomaticPaymentMethodsSetupIntentAllowRedirects", + ) + }) + } +} diff --git a/generated/stripe_shared/src/payment_flows_private_payment_methods_alipay.rs b/generated/stripe_shared/src/payment_flows_private_payment_methods_alipay.rs new file mode 100644 index 000000000..2262cd443 --- /dev/null +++ b/generated/stripe_shared/src/payment_flows_private_payment_methods_alipay.rs @@ -0,0 +1,2 @@ +#[derive(Copy, Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct PaymentFlowsPrivatePaymentMethodsAlipay {} diff --git a/generated/stripe_shared/src/payment_flows_private_payment_methods_alipay_details.rs b/generated/stripe_shared/src/payment_flows_private_payment_methods_alipay_details.rs new file mode 100644 index 000000000..01119c284 --- /dev/null +++ b/generated/stripe_shared/src/payment_flows_private_payment_methods_alipay_details.rs @@ -0,0 +1,12 @@ +#[derive(Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct PaymentFlowsPrivatePaymentMethodsAlipayDetails { + /// Uniquely identifies this particular Alipay account. + /// You can use this attribute to check whether two Alipay accounts are the same. + #[serde(skip_serializing_if = "Option::is_none")] + pub buyer_id: Option, + /// Uniquely identifies this particular Alipay account. + /// You can use this attribute to check whether two Alipay accounts are the same. + pub fingerprint: Option, + /// Transaction ID of this particular Alipay transaction. + pub transaction_id: Option, +} diff --git a/generated/stripe_shared/src/payment_flows_private_payment_methods_card_details_api_resource_enterprise_features_extended_authorization_extended_authorization.rs b/generated/stripe_shared/src/payment_flows_private_payment_methods_card_details_api_resource_enterprise_features_extended_authorization_extended_authorization.rs new file mode 100644 index 000000000..d3055edc0 --- /dev/null +++ b/generated/stripe_shared/src/payment_flows_private_payment_methods_card_details_api_resource_enterprise_features_extended_authorization_extended_authorization.rs @@ -0,0 +1,59 @@ +#[derive(Copy, Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct PaymentFlowsPrivatePaymentMethodsCardDetailsApiResourceEnterpriseFeaturesExtendedAuthorizationExtendedAuthorization { + /// Indicates whether or not the capture window is extended beyond the standard authorization. +pub status: PaymentFlowsPrivatePaymentMethodsCardDetailsApiResourceEnterpriseFeaturesExtendedAuthorizationExtendedAuthorizationStatus, + +} +/// Indicates whether or not the capture window is extended beyond the standard authorization. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum PaymentFlowsPrivatePaymentMethodsCardDetailsApiResourceEnterpriseFeaturesExtendedAuthorizationExtendedAuthorizationStatus +{ + Disabled, + Enabled, +} +impl PaymentFlowsPrivatePaymentMethodsCardDetailsApiResourceEnterpriseFeaturesExtendedAuthorizationExtendedAuthorizationStatus { + pub fn as_str(self) -> &'static str { + use PaymentFlowsPrivatePaymentMethodsCardDetailsApiResourceEnterpriseFeaturesExtendedAuthorizationExtendedAuthorizationStatus::*; + match self { +Disabled => "disabled", +Enabled => "enabled", + + } + } +} + +impl std::str::FromStr for PaymentFlowsPrivatePaymentMethodsCardDetailsApiResourceEnterpriseFeaturesExtendedAuthorizationExtendedAuthorizationStatus { + type Err = (); + fn from_str(s: &str) -> Result { + use PaymentFlowsPrivatePaymentMethodsCardDetailsApiResourceEnterpriseFeaturesExtendedAuthorizationExtendedAuthorizationStatus::*; + match s { + "disabled" => Ok(Disabled), +"enabled" => Ok(Enabled), +_ => Err(()) + + } + } +} +impl std::fmt::Display for PaymentFlowsPrivatePaymentMethodsCardDetailsApiResourceEnterpriseFeaturesExtendedAuthorizationExtendedAuthorizationStatus { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for PaymentFlowsPrivatePaymentMethodsCardDetailsApiResourceEnterpriseFeaturesExtendedAuthorizationExtendedAuthorizationStatus { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for PaymentFlowsPrivatePaymentMethodsCardDetailsApiResourceEnterpriseFeaturesExtendedAuthorizationExtendedAuthorizationStatus { + fn serialize(&self, serializer: S) -> Result where S: serde::Serializer { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for PaymentFlowsPrivatePaymentMethodsCardDetailsApiResourceEnterpriseFeaturesExtendedAuthorizationExtendedAuthorizationStatus { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for PaymentFlowsPrivatePaymentMethodsCardDetailsApiResourceEnterpriseFeaturesExtendedAuthorizationExtendedAuthorizationStatus")) + } +} diff --git a/generated/stripe_shared/src/payment_flows_private_payment_methods_card_details_api_resource_enterprise_features_incremental_authorization_incremental_authorization.rs b/generated/stripe_shared/src/payment_flows_private_payment_methods_card_details_api_resource_enterprise_features_incremental_authorization_incremental_authorization.rs new file mode 100644 index 000000000..cbdb1896b --- /dev/null +++ b/generated/stripe_shared/src/payment_flows_private_payment_methods_card_details_api_resource_enterprise_features_incremental_authorization_incremental_authorization.rs @@ -0,0 +1,59 @@ +#[derive(Copy, Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct PaymentFlowsPrivatePaymentMethodsCardDetailsApiResourceEnterpriseFeaturesIncrementalAuthorizationIncrementalAuthorization { + /// Indicates whether or not the incremental authorization feature is supported. +pub status: PaymentFlowsPrivatePaymentMethodsCardDetailsApiResourceEnterpriseFeaturesIncrementalAuthorizationIncrementalAuthorizationStatus, + +} +/// Indicates whether or not the incremental authorization feature is supported. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum PaymentFlowsPrivatePaymentMethodsCardDetailsApiResourceEnterpriseFeaturesIncrementalAuthorizationIncrementalAuthorizationStatus +{ + Available, + Unavailable, +} +impl PaymentFlowsPrivatePaymentMethodsCardDetailsApiResourceEnterpriseFeaturesIncrementalAuthorizationIncrementalAuthorizationStatus { + pub fn as_str(self) -> &'static str { + use PaymentFlowsPrivatePaymentMethodsCardDetailsApiResourceEnterpriseFeaturesIncrementalAuthorizationIncrementalAuthorizationStatus::*; + match self { +Available => "available", +Unavailable => "unavailable", + + } + } +} + +impl std::str::FromStr for PaymentFlowsPrivatePaymentMethodsCardDetailsApiResourceEnterpriseFeaturesIncrementalAuthorizationIncrementalAuthorizationStatus { + type Err = (); + fn from_str(s: &str) -> Result { + use PaymentFlowsPrivatePaymentMethodsCardDetailsApiResourceEnterpriseFeaturesIncrementalAuthorizationIncrementalAuthorizationStatus::*; + match s { + "available" => Ok(Available), +"unavailable" => Ok(Unavailable), +_ => Err(()) + + } + } +} +impl std::fmt::Display for PaymentFlowsPrivatePaymentMethodsCardDetailsApiResourceEnterpriseFeaturesIncrementalAuthorizationIncrementalAuthorizationStatus { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for PaymentFlowsPrivatePaymentMethodsCardDetailsApiResourceEnterpriseFeaturesIncrementalAuthorizationIncrementalAuthorizationStatus { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for PaymentFlowsPrivatePaymentMethodsCardDetailsApiResourceEnterpriseFeaturesIncrementalAuthorizationIncrementalAuthorizationStatus { + fn serialize(&self, serializer: S) -> Result where S: serde::Serializer { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for PaymentFlowsPrivatePaymentMethodsCardDetailsApiResourceEnterpriseFeaturesIncrementalAuthorizationIncrementalAuthorizationStatus { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for PaymentFlowsPrivatePaymentMethodsCardDetailsApiResourceEnterpriseFeaturesIncrementalAuthorizationIncrementalAuthorizationStatus")) + } +} diff --git a/generated/stripe_shared/src/payment_flows_private_payment_methods_card_details_api_resource_enterprise_features_overcapture_overcapture.rs b/generated/stripe_shared/src/payment_flows_private_payment_methods_card_details_api_resource_enterprise_features_overcapture_overcapture.rs new file mode 100644 index 000000000..290a2e869 --- /dev/null +++ b/generated/stripe_shared/src/payment_flows_private_payment_methods_card_details_api_resource_enterprise_features_overcapture_overcapture.rs @@ -0,0 +1,61 @@ +#[derive(Copy, Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct PaymentFlowsPrivatePaymentMethodsCardDetailsApiResourceEnterpriseFeaturesOvercaptureOvercapture { + /// The maximum amount that can be captured. +pub maximum_amount_capturable: i64, + /// Indicates whether or not the authorized amount can be over-captured. +pub status: PaymentFlowsPrivatePaymentMethodsCardDetailsApiResourceEnterpriseFeaturesOvercaptureOvercaptureStatus, + +} +/// Indicates whether or not the authorized amount can be over-captured. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum PaymentFlowsPrivatePaymentMethodsCardDetailsApiResourceEnterpriseFeaturesOvercaptureOvercaptureStatus +{ + Available, + Unavailable, +} +impl PaymentFlowsPrivatePaymentMethodsCardDetailsApiResourceEnterpriseFeaturesOvercaptureOvercaptureStatus { + pub fn as_str(self) -> &'static str { + use PaymentFlowsPrivatePaymentMethodsCardDetailsApiResourceEnterpriseFeaturesOvercaptureOvercaptureStatus::*; + match self { +Available => "available", +Unavailable => "unavailable", + + } + } +} + +impl std::str::FromStr for PaymentFlowsPrivatePaymentMethodsCardDetailsApiResourceEnterpriseFeaturesOvercaptureOvercaptureStatus { + type Err = (); + fn from_str(s: &str) -> Result { + use PaymentFlowsPrivatePaymentMethodsCardDetailsApiResourceEnterpriseFeaturesOvercaptureOvercaptureStatus::*; + match s { + "available" => Ok(Available), +"unavailable" => Ok(Unavailable), +_ => Err(()) + + } + } +} +impl std::fmt::Display for PaymentFlowsPrivatePaymentMethodsCardDetailsApiResourceEnterpriseFeaturesOvercaptureOvercaptureStatus { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for PaymentFlowsPrivatePaymentMethodsCardDetailsApiResourceEnterpriseFeaturesOvercaptureOvercaptureStatus { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for PaymentFlowsPrivatePaymentMethodsCardDetailsApiResourceEnterpriseFeaturesOvercaptureOvercaptureStatus { + fn serialize(&self, serializer: S) -> Result where S: serde::Serializer { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for PaymentFlowsPrivatePaymentMethodsCardDetailsApiResourceEnterpriseFeaturesOvercaptureOvercaptureStatus { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for PaymentFlowsPrivatePaymentMethodsCardDetailsApiResourceEnterpriseFeaturesOvercaptureOvercaptureStatus")) + } +} diff --git a/generated/stripe_shared/src/payment_flows_private_payment_methods_card_details_api_resource_multicapture.rs b/generated/stripe_shared/src/payment_flows_private_payment_methods_card_details_api_resource_multicapture.rs new file mode 100644 index 000000000..02d9c03bd --- /dev/null +++ b/generated/stripe_shared/src/payment_flows_private_payment_methods_card_details_api_resource_multicapture.rs @@ -0,0 +1,66 @@ +#[derive(Copy, Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct PaymentFlowsPrivatePaymentMethodsCardDetailsApiResourceMulticapture { + /// Indicates whether or not multiple captures are supported. + pub status: PaymentFlowsPrivatePaymentMethodsCardDetailsApiResourceMulticaptureStatus, +} +/// Indicates whether or not multiple captures are supported. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum PaymentFlowsPrivatePaymentMethodsCardDetailsApiResourceMulticaptureStatus { + Available, + Unavailable, +} +impl PaymentFlowsPrivatePaymentMethodsCardDetailsApiResourceMulticaptureStatus { + pub fn as_str(self) -> &'static str { + use PaymentFlowsPrivatePaymentMethodsCardDetailsApiResourceMulticaptureStatus::*; + match self { + Available => "available", + Unavailable => "unavailable", + } + } +} + +impl std::str::FromStr + for PaymentFlowsPrivatePaymentMethodsCardDetailsApiResourceMulticaptureStatus +{ + type Err = (); + fn from_str(s: &str) -> Result { + use PaymentFlowsPrivatePaymentMethodsCardDetailsApiResourceMulticaptureStatus::*; + match s { + "available" => Ok(Available), + "unavailable" => Ok(Unavailable), + _ => Err(()), + } + } +} +impl std::fmt::Display + for PaymentFlowsPrivatePaymentMethodsCardDetailsApiResourceMulticaptureStatus +{ + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for PaymentFlowsPrivatePaymentMethodsCardDetailsApiResourceMulticaptureStatus { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize + for PaymentFlowsPrivatePaymentMethodsCardDetailsApiResourceMulticaptureStatus +{ + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> + for PaymentFlowsPrivatePaymentMethodsCardDetailsApiResourceMulticaptureStatus +{ + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for PaymentFlowsPrivatePaymentMethodsCardDetailsApiResourceMulticaptureStatus")) + } +} diff --git a/generated/stripe_shared/src/payment_flows_private_payment_methods_klarna_dob.rs b/generated/stripe_shared/src/payment_flows_private_payment_methods_klarna_dob.rs new file mode 100644 index 000000000..fe0a52dbf --- /dev/null +++ b/generated/stripe_shared/src/payment_flows_private_payment_methods_klarna_dob.rs @@ -0,0 +1,9 @@ +#[derive(Copy, Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct PaymentFlowsPrivatePaymentMethodsKlarnaDob { + /// The day of birth, between 1 and 31. + pub day: Option, + /// The month of birth, between 1 and 12. + pub month: Option, + /// The four-digit year of birth. + pub year: Option, +} diff --git a/generated/stripe_shared/src/payment_intent.rs b/generated/stripe_shared/src/payment_intent.rs new file mode 100644 index 000000000..b89f4ae14 --- /dev/null +++ b/generated/stripe_shared/src/payment_intent.rs @@ -0,0 +1,442 @@ +/// A PaymentIntent guides you through the process of collecting a payment from your customer. +/// We recommend that you create exactly one PaymentIntent for each order or +/// customer session in your system. You can reference the PaymentIntent later to +/// see the history of payment attempts for a particular session. +/// +/// A PaymentIntent transitions through +/// [multiple statuses](https://stripe.com/docs/payments/intents#intent-statuses) +/// throughout its lifetime as it interfaces with Stripe.js to perform +/// authentication flows and ultimately creates at most one successful charge. +/// +/// Related guide: [Payment Intents API](https://stripe.com/docs/payments/payment-intents) +/// +/// For more details see <>. +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct PaymentIntent { + /// Amount intended to be collected by this PaymentIntent. + /// A positive integer representing how much to charge in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal) (e.g., 100 cents to charge $1.00 or 100 to charge ¥100, a zero-decimal currency). + /// The minimum amount is $0.50 US or [equivalent in charge currency](https://stripe.com/docs/currencies#minimum-and-maximum-charge-amounts). + /// The amount value supports up to eight digits (e.g., a value of 99999999 for a USD charge of $999,999.99). + pub amount: i64, + /// Amount that can be captured from this PaymentIntent. + pub amount_capturable: i64, + #[serde(skip_serializing_if = "Option::is_none")] + pub amount_details: Option, + /// Amount that this PaymentIntent collects. + pub amount_received: i64, + /// ID of the Connect application that created the PaymentIntent. + pub application: Option>, + /// The amount of the application fee (if any) that will be requested to be applied to the payment and transferred to the application owner's Stripe account. + /// The amount of the application fee collected will be capped at the total payment amount. + /// For more information, see the PaymentIntents [use case for connected accounts](https://stripe.com/docs/payments/connected-accounts). + pub application_fee_amount: Option, + /// Settings to configure compatible payment methods from the [Stripe Dashboard](https://dashboard.stripe.com/settings/payment_methods). + pub automatic_payment_methods: + Option, + /// Populated when `status` is `canceled`, this is the time at which the PaymentIntent was canceled. + /// Measured in seconds since the Unix epoch. + pub canceled_at: Option, + /// Reason for cancellation of this PaymentIntent, either user-provided (`duplicate`, `fraudulent`, `requested_by_customer`, or `abandoned`) or generated by Stripe internally (`failed_invoice`, `void_invoice`, or `automatic`). + pub cancellation_reason: Option, + /// Controls when the funds will be captured from the customer's account. + pub capture_method: stripe_shared::PaymentIntentCaptureMethod, + /// The client secret of this PaymentIntent. Used for client-side retrieval using a publishable key. + /// + /// The client secret can be used to complete a payment from your frontend. + /// It should not be stored, logged, or exposed to anyone other than the customer. + /// Make sure that you have TLS enabled on any page that includes the client secret. + /// + /// Refer to our docs to [accept a payment](https://stripe.com/docs/payments/accept-a-payment?ui=elements) and learn about how `client_secret` should be handled. + pub client_secret: Option, + /// Describes whether we can confirm this PaymentIntent automatically, or if it requires customer action to confirm the payment. + pub confirmation_method: stripe_shared::PaymentIntentConfirmationMethod, + /// Time at which the object was created. Measured in seconds since the Unix epoch. + pub created: stripe_types::Timestamp, + /// Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. + /// Must be a [supported currency](https://stripe.com/docs/currencies). + pub currency: stripe_types::Currency, + /// ID of the Customer this PaymentIntent belongs to, if one exists. + /// + /// Payment methods attached to other Customers cannot be used with this PaymentIntent. + /// + /// If present in combination with [setup_future_usage](https://stripe.com/docs/api#payment_intent_object-setup_future_usage), this PaymentIntent's payment method will be attached to the Customer after the PaymentIntent has been confirmed and any required actions from the user are complete. + pub customer: Option>, + /// An arbitrary string attached to the object. Often useful for displaying to users. + pub description: Option, + /// Unique identifier for the object. + pub id: stripe_shared::PaymentIntentId, + /// ID of the invoice that created this PaymentIntent, if it exists. + pub invoice: Option>, + /// The payment error encountered in the previous PaymentIntent confirmation. + /// It will be cleared if the PaymentIntent is later updated for any reason. + pub last_payment_error: Option>, + /// The latest charge created by this PaymentIntent. + pub latest_charge: Option>, + /// Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + pub livemode: bool, + /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. + /// This can be useful for storing additional information about the object in a structured format. + /// Learn more about [storing information in metadata](https://stripe.com/docs/payments/payment-intents/creating-payment-intents#storing-information-in-metadata). + pub metadata: std::collections::HashMap, + /// If present, this property tells you what actions you need to take in order for your customer to fulfill a payment using the provided source. + pub next_action: Option, + /// The account (if any) for which the funds of the PaymentIntent are intended. + /// See the PaymentIntents [use case for connected accounts](https://stripe.com/docs/payments/connected-accounts) for details. + pub on_behalf_of: Option>, + /// ID of the payment method used in this PaymentIntent. + pub payment_method: Option>, + /// Information about the payment method configuration used for this PaymentIntent. + pub payment_method_configuration_details: + Option, + /// Payment-method-specific configuration for this PaymentIntent. + pub payment_method_options: Option, + /// The list of payment method types (e.g. card) that this PaymentIntent is allowed to use. + pub payment_method_types: Vec, + /// If present, this property tells you about the processing state of the payment. + pub processing: Option, + /// Email address that the receipt for the resulting payment will be sent to. + /// If `receipt_email` is specified for a payment in live mode, a receipt will be sent regardless of your [email settings](https://dashboard.stripe.com/account/emails). + pub receipt_email: Option, + /// ID of the review associated with this PaymentIntent, if any. + pub review: Option>, + /// Indicates that you intend to make future payments with this PaymentIntent's payment method. + /// + /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. + /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + /// + /// When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + pub setup_future_usage: Option, + /// Shipping information for this PaymentIntent. + pub shipping: Option, + /// This is a legacy field that will be removed in the future. + /// It is the ID of the Source object that is associated with this PaymentIntent, if one was supplied. + pub source: Option>, + /// For card charges, use [statement_descriptor_suffix](https://stripe.com/docs/payments/account/statement-descriptors#dynamic). + /// Otherwise, you can use this value as the complete description of a charge on your customers' statements. + /// It must contain at least one letter and be 1–22 characters long. + pub statement_descriptor: Option, + /// Provides information about a card payment that customers see on their statements. + /// Concatenated with the prefix (shortened descriptor) or statement descriptor that’s set on the account to form the complete statement descriptor. + /// Maximum 22 characters for the concatenated descriptor. + pub statement_descriptor_suffix: Option, + /// Status of this PaymentIntent, one of `requires_payment_method`, `requires_confirmation`, `requires_action`, `processing`, `requires_capture`, `canceled`, or `succeeded`. + /// Read more about each PaymentIntent [status](https://stripe.com/docs/payments/intents#intent-statuses). + pub status: PaymentIntentStatus, + /// The data that automatically creates a Transfer after the payment finalizes. + /// Learn more about the [use case for connected accounts](https://stripe.com/docs/payments/connected-accounts). + pub transfer_data: Option, + /// A string that identifies the resulting payment as part of a group. + /// Learn more about the [use case for connected accounts](https://stripe.com/docs/connect/separate-charges-and-transfers). + pub transfer_group: Option, +} +/// Reason for cancellation of this PaymentIntent, either user-provided (`duplicate`, `fraudulent`, `requested_by_customer`, or `abandoned`) or generated by Stripe internally (`failed_invoice`, `void_invoice`, or `automatic`). +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum PaymentIntentCancellationReason { + Abandoned, + Automatic, + Duplicate, + FailedInvoice, + Fraudulent, + RequestedByCustomer, + VoidInvoice, +} +impl PaymentIntentCancellationReason { + pub fn as_str(self) -> &'static str { + use PaymentIntentCancellationReason::*; + match self { + Abandoned => "abandoned", + Automatic => "automatic", + Duplicate => "duplicate", + FailedInvoice => "failed_invoice", + Fraudulent => "fraudulent", + RequestedByCustomer => "requested_by_customer", + VoidInvoice => "void_invoice", + } + } +} + +impl std::str::FromStr for PaymentIntentCancellationReason { + type Err = (); + fn from_str(s: &str) -> Result { + use PaymentIntentCancellationReason::*; + match s { + "abandoned" => Ok(Abandoned), + "automatic" => Ok(Automatic), + "duplicate" => Ok(Duplicate), + "failed_invoice" => Ok(FailedInvoice), + "fraudulent" => Ok(Fraudulent), + "requested_by_customer" => Ok(RequestedByCustomer), + "void_invoice" => Ok(VoidInvoice), + _ => Err(()), + } + } +} +impl std::fmt::Display for PaymentIntentCancellationReason { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for PaymentIntentCancellationReason { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for PaymentIntentCancellationReason { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for PaymentIntentCancellationReason { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| { + serde::de::Error::custom("Unknown value for PaymentIntentCancellationReason") + }) + } +} +/// Status of this PaymentIntent, one of `requires_payment_method`, `requires_confirmation`, `requires_action`, `processing`, `requires_capture`, `canceled`, or `succeeded`. +/// Read more about each PaymentIntent [status](https://stripe.com/docs/payments/intents#intent-statuses). +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum PaymentIntentStatus { + Canceled, + Processing, + RequiresAction, + RequiresCapture, + RequiresConfirmation, + RequiresPaymentMethod, + Succeeded, +} +impl PaymentIntentStatus { + pub fn as_str(self) -> &'static str { + use PaymentIntentStatus::*; + match self { + Canceled => "canceled", + Processing => "processing", + RequiresAction => "requires_action", + RequiresCapture => "requires_capture", + RequiresConfirmation => "requires_confirmation", + RequiresPaymentMethod => "requires_payment_method", + Succeeded => "succeeded", + } + } +} + +impl std::str::FromStr for PaymentIntentStatus { + type Err = (); + fn from_str(s: &str) -> Result { + use PaymentIntentStatus::*; + match s { + "canceled" => Ok(Canceled), + "processing" => Ok(Processing), + "requires_action" => Ok(RequiresAction), + "requires_capture" => Ok(RequiresCapture), + "requires_confirmation" => Ok(RequiresConfirmation), + "requires_payment_method" => Ok(RequiresPaymentMethod), + "succeeded" => Ok(Succeeded), + _ => Err(()), + } + } +} +impl std::fmt::Display for PaymentIntentStatus { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for PaymentIntentStatus { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for PaymentIntentStatus { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for PaymentIntentStatus { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s) + .map_err(|_| serde::de::Error::custom("Unknown value for PaymentIntentStatus")) + } +} +impl stripe_types::Object for PaymentIntent { + type Id = stripe_shared::PaymentIntentId; + fn id(&self) -> &Self::Id { + &self.id + } +} +stripe_types::def_id!(PaymentIntentId, "pi_"); +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum PaymentIntentCaptureMethod { + Automatic, + AutomaticAsync, + Manual, +} +impl PaymentIntentCaptureMethod { + pub fn as_str(self) -> &'static str { + use PaymentIntentCaptureMethod::*; + match self { + Automatic => "automatic", + AutomaticAsync => "automatic_async", + Manual => "manual", + } + } +} + +impl std::str::FromStr for PaymentIntentCaptureMethod { + type Err = (); + fn from_str(s: &str) -> Result { + use PaymentIntentCaptureMethod::*; + match s { + "automatic" => Ok(Automatic), + "automatic_async" => Ok(AutomaticAsync), + "manual" => Ok(Manual), + _ => Err(()), + } + } +} +impl std::fmt::Display for PaymentIntentCaptureMethod { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for PaymentIntentCaptureMethod { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for PaymentIntentCaptureMethod { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for PaymentIntentCaptureMethod { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s) + .map_err(|_| serde::de::Error::custom("Unknown value for PaymentIntentCaptureMethod")) + } +} +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum PaymentIntentConfirmationMethod { + Automatic, + Manual, +} +impl PaymentIntentConfirmationMethod { + pub fn as_str(self) -> &'static str { + use PaymentIntentConfirmationMethod::*; + match self { + Automatic => "automatic", + Manual => "manual", + } + } +} + +impl std::str::FromStr for PaymentIntentConfirmationMethod { + type Err = (); + fn from_str(s: &str) -> Result { + use PaymentIntentConfirmationMethod::*; + match s { + "automatic" => Ok(Automatic), + "manual" => Ok(Manual), + _ => Err(()), + } + } +} +impl std::fmt::Display for PaymentIntentConfirmationMethod { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for PaymentIntentConfirmationMethod { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for PaymentIntentConfirmationMethod { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for PaymentIntentConfirmationMethod { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| { + serde::de::Error::custom("Unknown value for PaymentIntentConfirmationMethod") + }) + } +} +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum PaymentIntentSetupFutureUsage { + OffSession, + OnSession, +} +impl PaymentIntentSetupFutureUsage { + pub fn as_str(self) -> &'static str { + use PaymentIntentSetupFutureUsage::*; + match self { + OffSession => "off_session", + OnSession => "on_session", + } + } +} + +impl std::str::FromStr for PaymentIntentSetupFutureUsage { + type Err = (); + fn from_str(s: &str) -> Result { + use PaymentIntentSetupFutureUsage::*; + match s { + "off_session" => Ok(OffSession), + "on_session" => Ok(OnSession), + _ => Err(()), + } + } +} +impl std::fmt::Display for PaymentIntentSetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for PaymentIntentSetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for PaymentIntentSetupFutureUsage { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for PaymentIntentSetupFutureUsage { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| { + serde::de::Error::custom("Unknown value for PaymentIntentSetupFutureUsage") + }) + } +} diff --git a/generated/stripe_shared/src/payment_intent_card_processing.rs b/generated/stripe_shared/src/payment_intent_card_processing.rs new file mode 100644 index 000000000..1ba024f23 --- /dev/null +++ b/generated/stripe_shared/src/payment_intent_card_processing.rs @@ -0,0 +1,5 @@ +#[derive(Copy, Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct PaymentIntentCardProcessing { + #[serde(skip_serializing_if = "Option::is_none")] + pub customer_notification: Option, +} diff --git a/generated/stripe_shared/src/payment_intent_next_action.rs b/generated/stripe_shared/src/payment_intent_next_action.rs new file mode 100644 index 000000000..d9c5c4112 --- /dev/null +++ b/generated/stripe_shared/src/payment_intent_next_action.rs @@ -0,0 +1,51 @@ +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct PaymentIntentNextAction { + #[serde(skip_serializing_if = "Option::is_none")] + pub alipay_handle_redirect: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub boleto_display_details: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub card_await_notification: + Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub cashapp_handle_redirect_or_display_qr_code: + Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub display_bank_transfer_instructions: + Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub konbini_display_details: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub oxxo_display_details: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub paynow_display_qr_code: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub pix_display_qr_code: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub promptpay_display_qr_code: + Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub redirect_to_url: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub swish_handle_redirect_or_display_qr_code: + Option, + /// Type of the next action to perform, one of `redirect_to_url`, `use_stripe_sdk`, `alipay_handle_redirect`, `oxxo_display_details`, or `verify_with_microdeposits`. + #[serde(rename = "type")] + pub type_: String, + /// When confirming a PaymentIntent with Stripe.js, Stripe.js depends on the contents of this dictionary to invoke authentication flows. + /// The shape of the contents is subject to change and is only intended to be used by Stripe.js. + #[serde(skip_serializing_if = "Option::is_none")] + pub use_stripe_sdk: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub verify_with_microdeposits: + Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub wechat_pay_display_qr_code: + Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub wechat_pay_redirect_to_android_app: + Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub wechat_pay_redirect_to_ios_app: + Option, +} diff --git a/generated/stripe_shared/src/payment_intent_next_action_alipay_handle_redirect.rs b/generated/stripe_shared/src/payment_intent_next_action_alipay_handle_redirect.rs new file mode 100644 index 000000000..220cc2b67 --- /dev/null +++ b/generated/stripe_shared/src/payment_intent_next_action_alipay_handle_redirect.rs @@ -0,0 +1,11 @@ +#[derive(Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct PaymentIntentNextActionAlipayHandleRedirect { + /// The native data to be used with Alipay SDK you must redirect your customer to in order to authenticate the payment in an Android App. + pub native_data: Option, + /// The native URL you must redirect your customer to in order to authenticate the payment in an iOS App. + pub native_url: Option, + /// If the customer does not exit their browser while authenticating, they will be redirected to this specified URL after completion. + pub return_url: Option, + /// The URL you must redirect your customer to in order to authenticate the payment. + pub url: Option, +} diff --git a/generated/stripe_shared/src/payment_intent_next_action_boleto.rs b/generated/stripe_shared/src/payment_intent_next_action_boleto.rs new file mode 100644 index 000000000..ef085d4d4 --- /dev/null +++ b/generated/stripe_shared/src/payment_intent_next_action_boleto.rs @@ -0,0 +1,11 @@ +#[derive(Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct PaymentIntentNextActionBoleto { + /// The timestamp after which the boleto expires. + pub expires_at: Option, + /// The URL to the hosted boleto voucher page, which allows customers to view the boleto voucher. + pub hosted_voucher_url: Option, + /// The boleto number. + pub number: Option, + /// The URL to the downloadable boleto voucher PDF. + pub pdf: Option, +} diff --git a/generated/stripe_shared/src/payment_intent_next_action_card_await_notification.rs b/generated/stripe_shared/src/payment_intent_next_action_card_await_notification.rs new file mode 100644 index 000000000..531e79d8c --- /dev/null +++ b/generated/stripe_shared/src/payment_intent_next_action_card_await_notification.rs @@ -0,0 +1,9 @@ +#[derive(Copy, Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct PaymentIntentNextActionCardAwaitNotification { + /// The time that payment will be attempted. + /// If customer approval is required, they need to provide approval before this time. + pub charge_attempt_at: Option, + /// For payments greater than INR 15000, the customer must provide explicit approval of the payment with their bank. + /// For payments of lower amount, no customer action is required. + pub customer_approval_required: Option, +} diff --git a/generated/stripe_shared/src/payment_intent_next_action_cashapp_handle_redirect_or_display_qr_code.rs b/generated/stripe_shared/src/payment_intent_next_action_cashapp_handle_redirect_or_display_qr_code.rs new file mode 100644 index 000000000..cfcb58f16 --- /dev/null +++ b/generated/stripe_shared/src/payment_intent_next_action_cashapp_handle_redirect_or_display_qr_code.rs @@ -0,0 +1,8 @@ +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct PaymentIntentNextActionCashappHandleRedirectOrDisplayQrCode { + /// The URL to the hosted Cash App Pay instructions page, which allows customers to view the QR code, and supports QR code refreshing on expiration. + pub hosted_instructions_url: String, + /// The url for mobile redirect based auth + pub mobile_auth_url: String, + pub qr_code: stripe_shared::PaymentIntentNextActionCashappQrCode, +} diff --git a/generated/stripe_shared/src/payment_intent_next_action_cashapp_qr_code.rs b/generated/stripe_shared/src/payment_intent_next_action_cashapp_qr_code.rs new file mode 100644 index 000000000..0cd66605d --- /dev/null +++ b/generated/stripe_shared/src/payment_intent_next_action_cashapp_qr_code.rs @@ -0,0 +1,9 @@ +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct PaymentIntentNextActionCashappQrCode { + /// The date (unix timestamp) when the QR code expires. + pub expires_at: stripe_types::Timestamp, + /// The image_url_png string used to render QR code + pub image_url_png: String, + /// The image_url_svg string used to render QR code + pub image_url_svg: String, +} diff --git a/generated/stripe_shared/src/payment_intent_next_action_display_bank_transfer_instructions.rs b/generated/stripe_shared/src/payment_intent_next_action_display_bank_transfer_instructions.rs new file mode 100644 index 000000000..199459e7c --- /dev/null +++ b/generated/stripe_shared/src/payment_intent_next_action_display_bank_transfer_instructions.rs @@ -0,0 +1,86 @@ +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct PaymentIntentNextActionDisplayBankTransferInstructions { + /// The remaining amount that needs to be transferred to complete the payment. + pub amount_remaining: Option, + /// Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. + /// Must be a [supported currency](https://stripe.com/docs/currencies). + pub currency: Option, + /// A list of financial addresses that can be used to fund the customer balance + #[serde(skip_serializing_if = "Option::is_none")] + pub financial_addresses: + Option>, + /// A link to a hosted page that guides your customer through completing the transfer. + pub hosted_instructions_url: Option, + /// A string identifying this payment. + /// Instruct your customer to include this code in the reference or memo field of their bank transfer. + pub reference: Option, + /// Type of bank transfer + #[serde(rename = "type")] + pub type_: PaymentIntentNextActionDisplayBankTransferInstructionsType, +} +/// Type of bank transfer +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum PaymentIntentNextActionDisplayBankTransferInstructionsType { + EuBankTransfer, + GbBankTransfer, + JpBankTransfer, + MxBankTransfer, + UsBankTransfer, +} +impl PaymentIntentNextActionDisplayBankTransferInstructionsType { + pub fn as_str(self) -> &'static str { + use PaymentIntentNextActionDisplayBankTransferInstructionsType::*; + match self { + EuBankTransfer => "eu_bank_transfer", + GbBankTransfer => "gb_bank_transfer", + JpBankTransfer => "jp_bank_transfer", + MxBankTransfer => "mx_bank_transfer", + UsBankTransfer => "us_bank_transfer", + } + } +} + +impl std::str::FromStr for PaymentIntentNextActionDisplayBankTransferInstructionsType { + type Err = (); + fn from_str(s: &str) -> Result { + use PaymentIntentNextActionDisplayBankTransferInstructionsType::*; + match s { + "eu_bank_transfer" => Ok(EuBankTransfer), + "gb_bank_transfer" => Ok(GbBankTransfer), + "jp_bank_transfer" => Ok(JpBankTransfer), + "mx_bank_transfer" => Ok(MxBankTransfer), + "us_bank_transfer" => Ok(UsBankTransfer), + _ => Err(()), + } + } +} +impl std::fmt::Display for PaymentIntentNextActionDisplayBankTransferInstructionsType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for PaymentIntentNextActionDisplayBankTransferInstructionsType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for PaymentIntentNextActionDisplayBankTransferInstructionsType { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for PaymentIntentNextActionDisplayBankTransferInstructionsType { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| { + serde::de::Error::custom( + "Unknown value for PaymentIntentNextActionDisplayBankTransferInstructionsType", + ) + }) + } +} diff --git a/generated/stripe_shared/src/payment_intent_next_action_display_oxxo_details.rs b/generated/stripe_shared/src/payment_intent_next_action_display_oxxo_details.rs new file mode 100644 index 000000000..f20f9d0a3 --- /dev/null +++ b/generated/stripe_shared/src/payment_intent_next_action_display_oxxo_details.rs @@ -0,0 +1,9 @@ +#[derive(Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct PaymentIntentNextActionDisplayOxxoDetails { + /// The timestamp after which the OXXO voucher expires. + pub expires_after: Option, + /// The URL for the hosted OXXO voucher page, which allows customers to view and print an OXXO voucher. + pub hosted_voucher_url: Option, + /// OXXO reference number. + pub number: Option, +} diff --git a/generated/stripe_shared/src/payment_intent_next_action_konbini.rs b/generated/stripe_shared/src/payment_intent_next_action_konbini.rs new file mode 100644 index 000000000..10ec732ab --- /dev/null +++ b/generated/stripe_shared/src/payment_intent_next_action_konbini.rs @@ -0,0 +1,8 @@ +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct PaymentIntentNextActionKonbini { + /// The timestamp at which the pending Konbini payment expires. + pub expires_at: stripe_types::Timestamp, + /// The URL for the Konbini payment instructions page, which allows customers to view and print a Konbini voucher. + pub hosted_voucher_url: Option, + pub stores: stripe_shared::PaymentIntentNextActionKonbiniStores, +} diff --git a/generated/stripe_shared/src/payment_intent_next_action_konbini_familymart.rs b/generated/stripe_shared/src/payment_intent_next_action_konbini_familymart.rs new file mode 100644 index 000000000..f19a04ed3 --- /dev/null +++ b/generated/stripe_shared/src/payment_intent_next_action_konbini_familymart.rs @@ -0,0 +1,8 @@ +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct PaymentIntentNextActionKonbiniFamilymart { + /// The confirmation number. + #[serde(skip_serializing_if = "Option::is_none")] + pub confirmation_number: Option, + /// The payment code. + pub payment_code: String, +} diff --git a/generated/stripe_shared/src/payment_intent_next_action_konbini_lawson.rs b/generated/stripe_shared/src/payment_intent_next_action_konbini_lawson.rs new file mode 100644 index 000000000..17b27bc7d --- /dev/null +++ b/generated/stripe_shared/src/payment_intent_next_action_konbini_lawson.rs @@ -0,0 +1,8 @@ +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct PaymentIntentNextActionKonbiniLawson { + /// The confirmation number. + #[serde(skip_serializing_if = "Option::is_none")] + pub confirmation_number: Option, + /// The payment code. + pub payment_code: String, +} diff --git a/generated/stripe_shared/src/payment_intent_next_action_konbini_ministop.rs b/generated/stripe_shared/src/payment_intent_next_action_konbini_ministop.rs new file mode 100644 index 000000000..449a464c8 --- /dev/null +++ b/generated/stripe_shared/src/payment_intent_next_action_konbini_ministop.rs @@ -0,0 +1,8 @@ +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct PaymentIntentNextActionKonbiniMinistop { + /// The confirmation number. + #[serde(skip_serializing_if = "Option::is_none")] + pub confirmation_number: Option, + /// The payment code. + pub payment_code: String, +} diff --git a/generated/stripe_shared/src/payment_intent_next_action_konbini_seicomart.rs b/generated/stripe_shared/src/payment_intent_next_action_konbini_seicomart.rs new file mode 100644 index 000000000..b9416a59f --- /dev/null +++ b/generated/stripe_shared/src/payment_intent_next_action_konbini_seicomart.rs @@ -0,0 +1,8 @@ +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct PaymentIntentNextActionKonbiniSeicomart { + /// The confirmation number. + #[serde(skip_serializing_if = "Option::is_none")] + pub confirmation_number: Option, + /// The payment code. + pub payment_code: String, +} diff --git a/generated/stripe_shared/src/payment_intent_next_action_konbini_stores.rs b/generated/stripe_shared/src/payment_intent_next_action_konbini_stores.rs new file mode 100644 index 000000000..ccfd9ceb3 --- /dev/null +++ b/generated/stripe_shared/src/payment_intent_next_action_konbini_stores.rs @@ -0,0 +1,11 @@ +#[derive(Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct PaymentIntentNextActionKonbiniStores { + /// FamilyMart instruction details. + pub familymart: Option, + /// Lawson instruction details. + pub lawson: Option, + /// Ministop instruction details. + pub ministop: Option, + /// Seicomart instruction details. + pub seicomart: Option, +} diff --git a/generated/stripe_shared/src/payment_intent_next_action_paynow_display_qr_code.rs b/generated/stripe_shared/src/payment_intent_next_action_paynow_display_qr_code.rs new file mode 100644 index 000000000..913f75180 --- /dev/null +++ b/generated/stripe_shared/src/payment_intent_next_action_paynow_display_qr_code.rs @@ -0,0 +1,11 @@ +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct PaymentIntentNextActionPaynowDisplayQrCode { + /// The raw data string used to generate QR code, it should be used together with QR code library. + pub data: String, + /// The URL to the hosted PayNow instructions page, which allows customers to view the PayNow QR code. + pub hosted_instructions_url: Option, + /// The image_url_png string used to render QR code + pub image_url_png: String, + /// The image_url_svg string used to render QR code + pub image_url_svg: String, +} diff --git a/generated/stripe_shared/src/payment_intent_next_action_pix_display_qr_code.rs b/generated/stripe_shared/src/payment_intent_next_action_pix_display_qr_code.rs new file mode 100644 index 000000000..91b3cb5bf --- /dev/null +++ b/generated/stripe_shared/src/payment_intent_next_action_pix_display_qr_code.rs @@ -0,0 +1,18 @@ +#[derive(Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct PaymentIntentNextActionPixDisplayQrCode { + /// The raw data string used to generate QR code, it should be used together with QR code library. + #[serde(skip_serializing_if = "Option::is_none")] + pub data: Option, + /// The date (unix timestamp) when the PIX expires. + #[serde(skip_serializing_if = "Option::is_none")] + pub expires_at: Option, + /// The URL to the hosted pix instructions page, which allows customers to view the pix QR code. + #[serde(skip_serializing_if = "Option::is_none")] + pub hosted_instructions_url: Option, + /// The image_url_png string used to render png QR code + #[serde(skip_serializing_if = "Option::is_none")] + pub image_url_png: Option, + /// The image_url_svg string used to render svg QR code + #[serde(skip_serializing_if = "Option::is_none")] + pub image_url_svg: Option, +} diff --git a/generated/stripe_shared/src/payment_intent_next_action_promptpay_display_qr_code.rs b/generated/stripe_shared/src/payment_intent_next_action_promptpay_display_qr_code.rs new file mode 100644 index 000000000..a66eeead0 --- /dev/null +++ b/generated/stripe_shared/src/payment_intent_next_action_promptpay_display_qr_code.rs @@ -0,0 +1,11 @@ +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct PaymentIntentNextActionPromptpayDisplayQrCode { + /// The raw data string used to generate QR code, it should be used together with QR code library. + pub data: String, + /// The URL to the hosted PromptPay instructions page, which allows customers to view the PromptPay QR code. + pub hosted_instructions_url: String, + /// The PNG path used to render the QR code, can be used as the source in an HTML img tag + pub image_url_png: String, + /// The SVG path used to render the QR code, can be used as the source in an HTML img tag + pub image_url_svg: String, +} diff --git a/generated/stripe_shared/src/payment_intent_next_action_redirect_to_url.rs b/generated/stripe_shared/src/payment_intent_next_action_redirect_to_url.rs new file mode 100644 index 000000000..4dcdf5e6c --- /dev/null +++ b/generated/stripe_shared/src/payment_intent_next_action_redirect_to_url.rs @@ -0,0 +1,7 @@ +#[derive(Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct PaymentIntentNextActionRedirectToUrl { + /// If the customer does not exit their browser while authenticating, they will be redirected to this specified URL after completion. + pub return_url: Option, + /// The URL you must redirect your customer to in order to authenticate the payment. + pub url: Option, +} diff --git a/generated/stripe_shared/src/payment_intent_next_action_swish_handle_redirect_or_display_qr_code.rs b/generated/stripe_shared/src/payment_intent_next_action_swish_handle_redirect_or_display_qr_code.rs new file mode 100644 index 000000000..0a4692b1a --- /dev/null +++ b/generated/stripe_shared/src/payment_intent_next_action_swish_handle_redirect_or_display_qr_code.rs @@ -0,0 +1,11 @@ +#[derive(Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct PaymentIntentNextActionSwishHandleRedirectOrDisplayQrCode { + /// The URL to the hosted Swish instructions page, which allows customers to view the QR code. + #[serde(skip_serializing_if = "Option::is_none")] + pub hosted_instructions_url: Option, + /// The url for mobile redirect based auth + #[serde(skip_serializing_if = "Option::is_none")] + pub mobile_auth_url: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub qr_code: Option, +} diff --git a/generated/stripe_shared/src/payment_intent_next_action_swish_qr_code.rs b/generated/stripe_shared/src/payment_intent_next_action_swish_qr_code.rs new file mode 100644 index 000000000..410c69da5 --- /dev/null +++ b/generated/stripe_shared/src/payment_intent_next_action_swish_qr_code.rs @@ -0,0 +1,12 @@ +#[derive(Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct PaymentIntentNextActionSwishQrCode { + /// The raw data string used to generate QR code, it should be used together with QR code library. + #[serde(skip_serializing_if = "Option::is_none")] + pub data: Option, + /// The image_url_png string used to render QR code + #[serde(skip_serializing_if = "Option::is_none")] + pub image_url_png: Option, + /// The image_url_svg string used to render QR code + #[serde(skip_serializing_if = "Option::is_none")] + pub image_url_svg: Option, +} diff --git a/generated/stripe_shared/src/payment_intent_next_action_verify_with_microdeposits.rs b/generated/stripe_shared/src/payment_intent_next_action_verify_with_microdeposits.rs new file mode 100644 index 000000000..135a45185 --- /dev/null +++ b/generated/stripe_shared/src/payment_intent_next_action_verify_with_microdeposits.rs @@ -0,0 +1,70 @@ +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct PaymentIntentNextActionVerifyWithMicrodeposits { + /// The timestamp when the microdeposits are expected to land. + pub arrival_date: stripe_types::Timestamp, + /// The URL for the hosted verification page, which allows customers to verify their bank account. + pub hosted_verification_url: String, + /// The type of the microdeposit sent to the customer. + /// Used to distinguish between different verification methods. + pub microdeposit_type: Option, +} +/// The type of the microdeposit sent to the customer. +/// Used to distinguish between different verification methods. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum PaymentIntentNextActionVerifyWithMicrodepositsMicrodepositType { + Amounts, + DescriptorCode, +} +impl PaymentIntentNextActionVerifyWithMicrodepositsMicrodepositType { + pub fn as_str(self) -> &'static str { + use PaymentIntentNextActionVerifyWithMicrodepositsMicrodepositType::*; + match self { + Amounts => "amounts", + DescriptorCode => "descriptor_code", + } + } +} + +impl std::str::FromStr for PaymentIntentNextActionVerifyWithMicrodepositsMicrodepositType { + type Err = (); + fn from_str(s: &str) -> Result { + use PaymentIntentNextActionVerifyWithMicrodepositsMicrodepositType::*; + match s { + "amounts" => Ok(Amounts), + "descriptor_code" => Ok(DescriptorCode), + _ => Err(()), + } + } +} +impl std::fmt::Display for PaymentIntentNextActionVerifyWithMicrodepositsMicrodepositType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for PaymentIntentNextActionVerifyWithMicrodepositsMicrodepositType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for PaymentIntentNextActionVerifyWithMicrodepositsMicrodepositType { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> + for PaymentIntentNextActionVerifyWithMicrodepositsMicrodepositType +{ + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| { + serde::de::Error::custom( + "Unknown value for PaymentIntentNextActionVerifyWithMicrodepositsMicrodepositType", + ) + }) + } +} diff --git a/generated/stripe_shared/src/payment_intent_next_action_wechat_pay_display_qr_code.rs b/generated/stripe_shared/src/payment_intent_next_action_wechat_pay_display_qr_code.rs new file mode 100644 index 000000000..e40378cc3 --- /dev/null +++ b/generated/stripe_shared/src/payment_intent_next_action_wechat_pay_display_qr_code.rs @@ -0,0 +1,13 @@ +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct PaymentIntentNextActionWechatPayDisplayQrCode { + /// The data being used to generate QR code + pub data: String, + /// The URL to the hosted WeChat Pay instructions page, which allows customers to view the WeChat Pay QR code. + pub hosted_instructions_url: String, + /// The base64 image data for a pre-generated QR code + pub image_data_url: String, + /// The image_url_png string used to render QR code + pub image_url_png: String, + /// The image_url_svg string used to render QR code + pub image_url_svg: String, +} diff --git a/generated/stripe_shared/src/payment_intent_next_action_wechat_pay_redirect_to_android_app.rs b/generated/stripe_shared/src/payment_intent_next_action_wechat_pay_redirect_to_android_app.rs new file mode 100644 index 000000000..6c7bcc0fe --- /dev/null +++ b/generated/stripe_shared/src/payment_intent_next_action_wechat_pay_redirect_to_android_app.rs @@ -0,0 +1,17 @@ +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct PaymentIntentNextActionWechatPayRedirectToAndroidApp { + /// app_id is the APP ID registered on WeChat open platform + pub app_id: String, + /// nonce_str is a random string + pub nonce_str: String, + /// package is static value + pub package: String, + /// an unique merchant ID assigned by WeChat Pay + pub partner_id: String, + /// an unique trading ID assigned by WeChat Pay + pub prepay_id: String, + /// A signature + pub sign: String, + /// Specifies the current time in epoch format + pub timestamp: String, +} diff --git a/generated/stripe_shared/src/payment_intent_next_action_wechat_pay_redirect_to_ios_app.rs b/generated/stripe_shared/src/payment_intent_next_action_wechat_pay_redirect_to_ios_app.rs new file mode 100644 index 000000000..b216b6392 --- /dev/null +++ b/generated/stripe_shared/src/payment_intent_next_action_wechat_pay_redirect_to_ios_app.rs @@ -0,0 +1,5 @@ +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct PaymentIntentNextActionWechatPayRedirectToIosApp { + /// An universal link that redirect to WeChat Pay app + pub native_url: String, +} diff --git a/generated/stripe_shared/src/payment_intent_payment_method_options.rs b/generated/stripe_shared/src/payment_intent_payment_method_options.rs new file mode 100644 index 000000000..0cf03635b --- /dev/null +++ b/generated/stripe_shared/src/payment_intent_payment_method_options.rs @@ -0,0 +1,73 @@ +#[derive(Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct PaymentIntentPaymentMethodOptions { + #[serde(skip_serializing_if = "Option::is_none")] + pub acss_debit: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub affirm: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub afterpay_clearpay: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub alipay: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub au_becs_debit: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub bacs_debit: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub bancontact: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub blik: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub boleto: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub card: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub card_present: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub cashapp: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub customer_balance: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub eps: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub fpx: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub giropay: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub grabpay: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub ideal: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub interac_present: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub klarna: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub konbini: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub link: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub oxxo: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub p24: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub paynow: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub paypal: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub pix: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub promptpay: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub revolut_pay: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub sepa_debit: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub sofort: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub swish: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub us_bank_account: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub wechat_pay: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub zip: Option, +} diff --git a/generated/stripe_shared/src/payment_intent_payment_method_options_acss_debit.rs b/generated/stripe_shared/src/payment_intent_payment_method_options_acss_debit.rs new file mode 100644 index 000000000..59efe0767 --- /dev/null +++ b/generated/stripe_shared/src/payment_intent_payment_method_options_acss_debit.rs @@ -0,0 +1,142 @@ +#[derive(Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct PaymentIntentPaymentMethodOptionsAcssDebit { + #[serde(skip_serializing_if = "Option::is_none")] + pub mandate_options: + Option, + /// Indicates that you intend to make future payments with this PaymentIntent's payment method. + /// + /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. + /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + /// + /// When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + #[serde(skip_serializing_if = "Option::is_none")] + pub setup_future_usage: Option, + /// Bank account verification method. + #[serde(skip_serializing_if = "Option::is_none")] + pub verification_method: Option, +} +/// Indicates that you intend to make future payments with this PaymentIntent's payment method. +/// +/// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. +/// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. +/// +/// When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum PaymentIntentPaymentMethodOptionsAcssDebitSetupFutureUsage { + None, + OffSession, + OnSession, +} +impl PaymentIntentPaymentMethodOptionsAcssDebitSetupFutureUsage { + pub fn as_str(self) -> &'static str { + use PaymentIntentPaymentMethodOptionsAcssDebitSetupFutureUsage::*; + match self { + None => "none", + OffSession => "off_session", + OnSession => "on_session", + } + } +} + +impl std::str::FromStr for PaymentIntentPaymentMethodOptionsAcssDebitSetupFutureUsage { + type Err = (); + fn from_str(s: &str) -> Result { + use PaymentIntentPaymentMethodOptionsAcssDebitSetupFutureUsage::*; + match s { + "none" => Ok(None), + "off_session" => Ok(OffSession), + "on_session" => Ok(OnSession), + _ => Err(()), + } + } +} +impl std::fmt::Display for PaymentIntentPaymentMethodOptionsAcssDebitSetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for PaymentIntentPaymentMethodOptionsAcssDebitSetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for PaymentIntentPaymentMethodOptionsAcssDebitSetupFutureUsage { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for PaymentIntentPaymentMethodOptionsAcssDebitSetupFutureUsage { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| { + serde::de::Error::custom( + "Unknown value for PaymentIntentPaymentMethodOptionsAcssDebitSetupFutureUsage", + ) + }) + } +} +/// Bank account verification method. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum PaymentIntentPaymentMethodOptionsAcssDebitVerificationMethod { + Automatic, + Instant, + Microdeposits, +} +impl PaymentIntentPaymentMethodOptionsAcssDebitVerificationMethod { + pub fn as_str(self) -> &'static str { + use PaymentIntentPaymentMethodOptionsAcssDebitVerificationMethod::*; + match self { + Automatic => "automatic", + Instant => "instant", + Microdeposits => "microdeposits", + } + } +} + +impl std::str::FromStr for PaymentIntentPaymentMethodOptionsAcssDebitVerificationMethod { + type Err = (); + fn from_str(s: &str) -> Result { + use PaymentIntentPaymentMethodOptionsAcssDebitVerificationMethod::*; + match s { + "automatic" => Ok(Automatic), + "instant" => Ok(Instant), + "microdeposits" => Ok(Microdeposits), + _ => Err(()), + } + } +} +impl std::fmt::Display for PaymentIntentPaymentMethodOptionsAcssDebitVerificationMethod { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for PaymentIntentPaymentMethodOptionsAcssDebitVerificationMethod { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for PaymentIntentPaymentMethodOptionsAcssDebitVerificationMethod { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for PaymentIntentPaymentMethodOptionsAcssDebitVerificationMethod { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| { + serde::de::Error::custom( + "Unknown value for PaymentIntentPaymentMethodOptionsAcssDebitVerificationMethod", + ) + }) + } +} diff --git a/generated/stripe_shared/src/payment_intent_payment_method_options_au_becs_debit.rs b/generated/stripe_shared/src/payment_intent_payment_method_options_au_becs_debit.rs new file mode 100644 index 000000000..01b55cf62 --- /dev/null +++ b/generated/stripe_shared/src/payment_intent_payment_method_options_au_becs_debit.rs @@ -0,0 +1,76 @@ +#[derive(Copy, Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct PaymentIntentPaymentMethodOptionsAuBecsDebit { + /// Indicates that you intend to make future payments with this PaymentIntent's payment method. + /// + /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. + /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + /// + /// When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + #[serde(skip_serializing_if = "Option::is_none")] + pub setup_future_usage: Option, +} +/// Indicates that you intend to make future payments with this PaymentIntent's payment method. +/// +/// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. +/// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. +/// +/// When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum PaymentIntentPaymentMethodOptionsAuBecsDebitSetupFutureUsage { + None, + OffSession, + OnSession, +} +impl PaymentIntentPaymentMethodOptionsAuBecsDebitSetupFutureUsage { + pub fn as_str(self) -> &'static str { + use PaymentIntentPaymentMethodOptionsAuBecsDebitSetupFutureUsage::*; + match self { + None => "none", + OffSession => "off_session", + OnSession => "on_session", + } + } +} + +impl std::str::FromStr for PaymentIntentPaymentMethodOptionsAuBecsDebitSetupFutureUsage { + type Err = (); + fn from_str(s: &str) -> Result { + use PaymentIntentPaymentMethodOptionsAuBecsDebitSetupFutureUsage::*; + match s { + "none" => Ok(None), + "off_session" => Ok(OffSession), + "on_session" => Ok(OnSession), + _ => Err(()), + } + } +} +impl std::fmt::Display for PaymentIntentPaymentMethodOptionsAuBecsDebitSetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for PaymentIntentPaymentMethodOptionsAuBecsDebitSetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for PaymentIntentPaymentMethodOptionsAuBecsDebitSetupFutureUsage { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for PaymentIntentPaymentMethodOptionsAuBecsDebitSetupFutureUsage { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| { + serde::de::Error::custom( + "Unknown value for PaymentIntentPaymentMethodOptionsAuBecsDebitSetupFutureUsage", + ) + }) + } +} diff --git a/generated/stripe_shared/src/payment_intent_payment_method_options_blik.rs b/generated/stripe_shared/src/payment_intent_payment_method_options_blik.rs new file mode 100644 index 000000000..2e09c304f --- /dev/null +++ b/generated/stripe_shared/src/payment_intent_payment_method_options_blik.rs @@ -0,0 +1,70 @@ +#[derive(Copy, Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct PaymentIntentPaymentMethodOptionsBlik { + /// Indicates that you intend to make future payments with this PaymentIntent's payment method. + /// + /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. + /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + /// + /// When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + #[serde(skip_serializing_if = "Option::is_none")] + pub setup_future_usage: Option, +} +/// Indicates that you intend to make future payments with this PaymentIntent's payment method. +/// +/// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. +/// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. +/// +/// When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum PaymentIntentPaymentMethodOptionsBlikSetupFutureUsage { + None, +} +impl PaymentIntentPaymentMethodOptionsBlikSetupFutureUsage { + pub fn as_str(self) -> &'static str { + use PaymentIntentPaymentMethodOptionsBlikSetupFutureUsage::*; + match self { + None => "none", + } + } +} + +impl std::str::FromStr for PaymentIntentPaymentMethodOptionsBlikSetupFutureUsage { + type Err = (); + fn from_str(s: &str) -> Result { + use PaymentIntentPaymentMethodOptionsBlikSetupFutureUsage::*; + match s { + "none" => Ok(None), + _ => Err(()), + } + } +} +impl std::fmt::Display for PaymentIntentPaymentMethodOptionsBlikSetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for PaymentIntentPaymentMethodOptionsBlikSetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for PaymentIntentPaymentMethodOptionsBlikSetupFutureUsage { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for PaymentIntentPaymentMethodOptionsBlikSetupFutureUsage { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| { + serde::de::Error::custom( + "Unknown value for PaymentIntentPaymentMethodOptionsBlikSetupFutureUsage", + ) + }) + } +} diff --git a/generated/stripe_shared/src/payment_intent_payment_method_options_card.rs b/generated/stripe_shared/src/payment_intent_payment_method_options_card.rs new file mode 100644 index 000000000..983e53363 --- /dev/null +++ b/generated/stripe_shared/src/payment_intent_payment_method_options_card.rs @@ -0,0 +1,551 @@ +#[derive(Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct PaymentIntentPaymentMethodOptionsCard { + /// Controls when the funds will be captured from the customer's account. + #[serde(skip_serializing_if = "Option::is_none")] + pub capture_method: Option, + /// Installment details for this payment (Mexico only). + /// + /// For more information, see the [installments integration guide](https://stripe.com/docs/payments/installments). + pub installments: Option, + /// Configuration options for setting up an eMandate for cards issued in India. + pub mandate_options: Option, + /// Selected network to process this payment intent on. + /// Depends on the available networks of the card attached to the payment intent. + /// Can be only set confirm-time. + pub network: Option, + /// Request ability to [capture beyond the standard authorization validity window](https://stripe.com/docs/payments/extended-authorization) for this PaymentIntent. + #[serde(skip_serializing_if = "Option::is_none")] + pub request_extended_authorization: + Option, + /// Request ability to [increment the authorization](https://stripe.com/docs/payments/incremental-authorization) for this PaymentIntent. + #[serde(skip_serializing_if = "Option::is_none")] + pub request_incremental_authorization: + Option, + /// Request ability to make [multiple captures](https://stripe.com/docs/payments/multicapture) for this PaymentIntent. + #[serde(skip_serializing_if = "Option::is_none")] + pub request_multicapture: Option, + /// Request ability to [overcapture](https://stripe.com/docs/payments/overcapture) for this PaymentIntent. + #[serde(skip_serializing_if = "Option::is_none")] + pub request_overcapture: Option, + /// We strongly recommend that you rely on our SCA Engine to automatically prompt your customers for authentication based on risk level and [other requirements](https://stripe.com/docs/strong-customer-authentication). + /// However, if you wish to request 3D Secure based on logic from your own fraud engine, provide this option. + /// If not provided, this value defaults to `automatic`. + /// Read our guide on [manually requesting 3D Secure](https://stripe.com/docs/payments/3d-secure#manual-three-ds) for more information on how this configuration interacts with Radar and our SCA Engine. + pub request_three_d_secure: Option, + /// When enabled, using a card that is attached to a customer will require the CVC to be provided again (i.e. + /// using the cvc_token parameter). + #[serde(skip_serializing_if = "Option::is_none")] + pub require_cvc_recollection: Option, + /// Indicates that you intend to make future payments with this PaymentIntent's payment method. + /// + /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. + /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + /// + /// When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + #[serde(skip_serializing_if = "Option::is_none")] + pub setup_future_usage: Option, + /// Provides information about a card payment that customers see on their statements. + /// Concatenated with the Kana prefix (shortened Kana descriptor) or Kana statement descriptor that’s set on the account to form the complete statement descriptor. + /// Maximum 22 characters. + /// On card statements, the *concatenation* of both prefix and suffix (including separators) will appear truncated to 22 characters. + #[serde(skip_serializing_if = "Option::is_none")] + pub statement_descriptor_suffix_kana: Option, + /// Provides information about a card payment that customers see on their statements. + /// Concatenated with the Kanji prefix (shortened Kanji descriptor) or Kanji statement descriptor that’s set on the account to form the complete statement descriptor. + /// Maximum 17 characters. + /// On card statements, the *concatenation* of both prefix and suffix (including separators) will appear truncated to 17 characters. + #[serde(skip_serializing_if = "Option::is_none")] + pub statement_descriptor_suffix_kanji: Option, +} +/// Controls when the funds will be captured from the customer's account. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum PaymentIntentPaymentMethodOptionsCardCaptureMethod { + Manual, +} +impl PaymentIntentPaymentMethodOptionsCardCaptureMethod { + pub fn as_str(self) -> &'static str { + use PaymentIntentPaymentMethodOptionsCardCaptureMethod::*; + match self { + Manual => "manual", + } + } +} + +impl std::str::FromStr for PaymentIntentPaymentMethodOptionsCardCaptureMethod { + type Err = (); + fn from_str(s: &str) -> Result { + use PaymentIntentPaymentMethodOptionsCardCaptureMethod::*; + match s { + "manual" => Ok(Manual), + _ => Err(()), + } + } +} +impl std::fmt::Display for PaymentIntentPaymentMethodOptionsCardCaptureMethod { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for PaymentIntentPaymentMethodOptionsCardCaptureMethod { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for PaymentIntentPaymentMethodOptionsCardCaptureMethod { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for PaymentIntentPaymentMethodOptionsCardCaptureMethod { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| { + serde::de::Error::custom( + "Unknown value for PaymentIntentPaymentMethodOptionsCardCaptureMethod", + ) + }) + } +} +/// Selected network to process this payment intent on. +/// Depends on the available networks of the card attached to the payment intent. +/// Can be only set confirm-time. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum PaymentIntentPaymentMethodOptionsCardNetwork { + Amex, + CartesBancaires, + Diners, + Discover, + EftposAu, + Interac, + Jcb, + Mastercard, + Unionpay, + Unknown, + Visa, +} +impl PaymentIntentPaymentMethodOptionsCardNetwork { + pub fn as_str(self) -> &'static str { + use PaymentIntentPaymentMethodOptionsCardNetwork::*; + match self { + Amex => "amex", + CartesBancaires => "cartes_bancaires", + Diners => "diners", + Discover => "discover", + EftposAu => "eftpos_au", + Interac => "interac", + Jcb => "jcb", + Mastercard => "mastercard", + Unionpay => "unionpay", + Unknown => "unknown", + Visa => "visa", + } + } +} + +impl std::str::FromStr for PaymentIntentPaymentMethodOptionsCardNetwork { + type Err = (); + fn from_str(s: &str) -> Result { + use PaymentIntentPaymentMethodOptionsCardNetwork::*; + match s { + "amex" => Ok(Amex), + "cartes_bancaires" => Ok(CartesBancaires), + "diners" => Ok(Diners), + "discover" => Ok(Discover), + "eftpos_au" => Ok(EftposAu), + "interac" => Ok(Interac), + "jcb" => Ok(Jcb), + "mastercard" => Ok(Mastercard), + "unionpay" => Ok(Unionpay), + "unknown" => Ok(Unknown), + "visa" => Ok(Visa), + _ => Err(()), + } + } +} +impl std::fmt::Display for PaymentIntentPaymentMethodOptionsCardNetwork { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for PaymentIntentPaymentMethodOptionsCardNetwork { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for PaymentIntentPaymentMethodOptionsCardNetwork { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for PaymentIntentPaymentMethodOptionsCardNetwork { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| { + serde::de::Error::custom( + "Unknown value for PaymentIntentPaymentMethodOptionsCardNetwork", + ) + }) + } +} +/// Request ability to [capture beyond the standard authorization validity window](https://stripe.com/docs/payments/extended-authorization) for this PaymentIntent. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum PaymentIntentPaymentMethodOptionsCardRequestExtendedAuthorization { + IfAvailable, + Never, +} +impl PaymentIntentPaymentMethodOptionsCardRequestExtendedAuthorization { + pub fn as_str(self) -> &'static str { + use PaymentIntentPaymentMethodOptionsCardRequestExtendedAuthorization::*; + match self { + IfAvailable => "if_available", + Never => "never", + } + } +} + +impl std::str::FromStr for PaymentIntentPaymentMethodOptionsCardRequestExtendedAuthorization { + type Err = (); + fn from_str(s: &str) -> Result { + use PaymentIntentPaymentMethodOptionsCardRequestExtendedAuthorization::*; + match s { + "if_available" => Ok(IfAvailable), + "never" => Ok(Never), + _ => Err(()), + } + } +} +impl std::fmt::Display for PaymentIntentPaymentMethodOptionsCardRequestExtendedAuthorization { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for PaymentIntentPaymentMethodOptionsCardRequestExtendedAuthorization { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for PaymentIntentPaymentMethodOptionsCardRequestExtendedAuthorization { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> + for PaymentIntentPaymentMethodOptionsCardRequestExtendedAuthorization +{ + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for PaymentIntentPaymentMethodOptionsCardRequestExtendedAuthorization")) + } +} +/// Request ability to [increment the authorization](https://stripe.com/docs/payments/incremental-authorization) for this PaymentIntent. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum PaymentIntentPaymentMethodOptionsCardRequestIncrementalAuthorization { + IfAvailable, + Never, +} +impl PaymentIntentPaymentMethodOptionsCardRequestIncrementalAuthorization { + pub fn as_str(self) -> &'static str { + use PaymentIntentPaymentMethodOptionsCardRequestIncrementalAuthorization::*; + match self { + IfAvailable => "if_available", + Never => "never", + } + } +} + +impl std::str::FromStr for PaymentIntentPaymentMethodOptionsCardRequestIncrementalAuthorization { + type Err = (); + fn from_str(s: &str) -> Result { + use PaymentIntentPaymentMethodOptionsCardRequestIncrementalAuthorization::*; + match s { + "if_available" => Ok(IfAvailable), + "never" => Ok(Never), + _ => Err(()), + } + } +} +impl std::fmt::Display for PaymentIntentPaymentMethodOptionsCardRequestIncrementalAuthorization { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for PaymentIntentPaymentMethodOptionsCardRequestIncrementalAuthorization { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for PaymentIntentPaymentMethodOptionsCardRequestIncrementalAuthorization { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> + for PaymentIntentPaymentMethodOptionsCardRequestIncrementalAuthorization +{ + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for PaymentIntentPaymentMethodOptionsCardRequestIncrementalAuthorization")) + } +} +/// Request ability to make [multiple captures](https://stripe.com/docs/payments/multicapture) for this PaymentIntent. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum PaymentIntentPaymentMethodOptionsCardRequestMulticapture { + IfAvailable, + Never, +} +impl PaymentIntentPaymentMethodOptionsCardRequestMulticapture { + pub fn as_str(self) -> &'static str { + use PaymentIntentPaymentMethodOptionsCardRequestMulticapture::*; + match self { + IfAvailable => "if_available", + Never => "never", + } + } +} + +impl std::str::FromStr for PaymentIntentPaymentMethodOptionsCardRequestMulticapture { + type Err = (); + fn from_str(s: &str) -> Result { + use PaymentIntentPaymentMethodOptionsCardRequestMulticapture::*; + match s { + "if_available" => Ok(IfAvailable), + "never" => Ok(Never), + _ => Err(()), + } + } +} +impl std::fmt::Display for PaymentIntentPaymentMethodOptionsCardRequestMulticapture { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for PaymentIntentPaymentMethodOptionsCardRequestMulticapture { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for PaymentIntentPaymentMethodOptionsCardRequestMulticapture { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for PaymentIntentPaymentMethodOptionsCardRequestMulticapture { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| { + serde::de::Error::custom( + "Unknown value for PaymentIntentPaymentMethodOptionsCardRequestMulticapture", + ) + }) + } +} +/// Request ability to [overcapture](https://stripe.com/docs/payments/overcapture) for this PaymentIntent. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum PaymentIntentPaymentMethodOptionsCardRequestOvercapture { + IfAvailable, + Never, +} +impl PaymentIntentPaymentMethodOptionsCardRequestOvercapture { + pub fn as_str(self) -> &'static str { + use PaymentIntentPaymentMethodOptionsCardRequestOvercapture::*; + match self { + IfAvailable => "if_available", + Never => "never", + } + } +} + +impl std::str::FromStr for PaymentIntentPaymentMethodOptionsCardRequestOvercapture { + type Err = (); + fn from_str(s: &str) -> Result { + use PaymentIntentPaymentMethodOptionsCardRequestOvercapture::*; + match s { + "if_available" => Ok(IfAvailable), + "never" => Ok(Never), + _ => Err(()), + } + } +} +impl std::fmt::Display for PaymentIntentPaymentMethodOptionsCardRequestOvercapture { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for PaymentIntentPaymentMethodOptionsCardRequestOvercapture { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for PaymentIntentPaymentMethodOptionsCardRequestOvercapture { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for PaymentIntentPaymentMethodOptionsCardRequestOvercapture { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| { + serde::de::Error::custom( + "Unknown value for PaymentIntentPaymentMethodOptionsCardRequestOvercapture", + ) + }) + } +} +/// We strongly recommend that you rely on our SCA Engine to automatically prompt your customers for authentication based on risk level and [other requirements](https://stripe.com/docs/strong-customer-authentication). +/// However, if you wish to request 3D Secure based on logic from your own fraud engine, provide this option. +/// If not provided, this value defaults to `automatic`. +/// Read our guide on [manually requesting 3D Secure](https://stripe.com/docs/payments/3d-secure#manual-three-ds) for more information on how this configuration interacts with Radar and our SCA Engine. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum PaymentIntentPaymentMethodOptionsCardRequestThreeDSecure { + Any, + Automatic, + Challenge, +} +impl PaymentIntentPaymentMethodOptionsCardRequestThreeDSecure { + pub fn as_str(self) -> &'static str { + use PaymentIntentPaymentMethodOptionsCardRequestThreeDSecure::*; + match self { + Any => "any", + Automatic => "automatic", + Challenge => "challenge", + } + } +} + +impl std::str::FromStr for PaymentIntentPaymentMethodOptionsCardRequestThreeDSecure { + type Err = (); + fn from_str(s: &str) -> Result { + use PaymentIntentPaymentMethodOptionsCardRequestThreeDSecure::*; + match s { + "any" => Ok(Any), + "automatic" => Ok(Automatic), + "challenge" => Ok(Challenge), + _ => Err(()), + } + } +} +impl std::fmt::Display for PaymentIntentPaymentMethodOptionsCardRequestThreeDSecure { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for PaymentIntentPaymentMethodOptionsCardRequestThreeDSecure { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for PaymentIntentPaymentMethodOptionsCardRequestThreeDSecure { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for PaymentIntentPaymentMethodOptionsCardRequestThreeDSecure { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| { + serde::de::Error::custom( + "Unknown value for PaymentIntentPaymentMethodOptionsCardRequestThreeDSecure", + ) + }) + } +} +/// Indicates that you intend to make future payments with this PaymentIntent's payment method. +/// +/// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. +/// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. +/// +/// When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum PaymentIntentPaymentMethodOptionsCardSetupFutureUsage { + None, + OffSession, + OnSession, +} +impl PaymentIntentPaymentMethodOptionsCardSetupFutureUsage { + pub fn as_str(self) -> &'static str { + use PaymentIntentPaymentMethodOptionsCardSetupFutureUsage::*; + match self { + None => "none", + OffSession => "off_session", + OnSession => "on_session", + } + } +} + +impl std::str::FromStr for PaymentIntentPaymentMethodOptionsCardSetupFutureUsage { + type Err = (); + fn from_str(s: &str) -> Result { + use PaymentIntentPaymentMethodOptionsCardSetupFutureUsage::*; + match s { + "none" => Ok(None), + "off_session" => Ok(OffSession), + "on_session" => Ok(OnSession), + _ => Err(()), + } + } +} +impl std::fmt::Display for PaymentIntentPaymentMethodOptionsCardSetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for PaymentIntentPaymentMethodOptionsCardSetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for PaymentIntentPaymentMethodOptionsCardSetupFutureUsage { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for PaymentIntentPaymentMethodOptionsCardSetupFutureUsage { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| { + serde::de::Error::custom( + "Unknown value for PaymentIntentPaymentMethodOptionsCardSetupFutureUsage", + ) + }) + } +} diff --git a/generated/stripe_shared/src/payment_intent_payment_method_options_eps.rs b/generated/stripe_shared/src/payment_intent_payment_method_options_eps.rs new file mode 100644 index 000000000..f6d8fd7a8 --- /dev/null +++ b/generated/stripe_shared/src/payment_intent_payment_method_options_eps.rs @@ -0,0 +1,70 @@ +#[derive(Copy, Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct PaymentIntentPaymentMethodOptionsEps { + /// Indicates that you intend to make future payments with this PaymentIntent's payment method. + /// + /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. + /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + /// + /// When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + #[serde(skip_serializing_if = "Option::is_none")] + pub setup_future_usage: Option, +} +/// Indicates that you intend to make future payments with this PaymentIntent's payment method. +/// +/// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. +/// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. +/// +/// When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum PaymentIntentPaymentMethodOptionsEpsSetupFutureUsage { + None, +} +impl PaymentIntentPaymentMethodOptionsEpsSetupFutureUsage { + pub fn as_str(self) -> &'static str { + use PaymentIntentPaymentMethodOptionsEpsSetupFutureUsage::*; + match self { + None => "none", + } + } +} + +impl std::str::FromStr for PaymentIntentPaymentMethodOptionsEpsSetupFutureUsage { + type Err = (); + fn from_str(s: &str) -> Result { + use PaymentIntentPaymentMethodOptionsEpsSetupFutureUsage::*; + match s { + "none" => Ok(None), + _ => Err(()), + } + } +} +impl std::fmt::Display for PaymentIntentPaymentMethodOptionsEpsSetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for PaymentIntentPaymentMethodOptionsEpsSetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for PaymentIntentPaymentMethodOptionsEpsSetupFutureUsage { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for PaymentIntentPaymentMethodOptionsEpsSetupFutureUsage { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| { + serde::de::Error::custom( + "Unknown value for PaymentIntentPaymentMethodOptionsEpsSetupFutureUsage", + ) + }) + } +} diff --git a/generated/stripe_shared/src/payment_intent_payment_method_options_link.rs b/generated/stripe_shared/src/payment_intent_payment_method_options_link.rs new file mode 100644 index 000000000..b9c971f7e --- /dev/null +++ b/generated/stripe_shared/src/payment_intent_payment_method_options_link.rs @@ -0,0 +1,132 @@ +#[derive(Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct PaymentIntentPaymentMethodOptionsLink { + /// Controls when the funds will be captured from the customer's account. + #[serde(skip_serializing_if = "Option::is_none")] + pub capture_method: Option, + /// \[Deprecated\] This is a legacy parameter that no longer has any function. + pub persistent_token: Option, + /// Indicates that you intend to make future payments with this PaymentIntent's payment method. + /// + /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. + /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + /// + /// When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + #[serde(skip_serializing_if = "Option::is_none")] + pub setup_future_usage: Option, +} +/// Controls when the funds will be captured from the customer's account. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum PaymentIntentPaymentMethodOptionsLinkCaptureMethod { + Manual, +} +impl PaymentIntentPaymentMethodOptionsLinkCaptureMethod { + pub fn as_str(self) -> &'static str { + use PaymentIntentPaymentMethodOptionsLinkCaptureMethod::*; + match self { + Manual => "manual", + } + } +} + +impl std::str::FromStr for PaymentIntentPaymentMethodOptionsLinkCaptureMethod { + type Err = (); + fn from_str(s: &str) -> Result { + use PaymentIntentPaymentMethodOptionsLinkCaptureMethod::*; + match s { + "manual" => Ok(Manual), + _ => Err(()), + } + } +} +impl std::fmt::Display for PaymentIntentPaymentMethodOptionsLinkCaptureMethod { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for PaymentIntentPaymentMethodOptionsLinkCaptureMethod { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for PaymentIntentPaymentMethodOptionsLinkCaptureMethod { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for PaymentIntentPaymentMethodOptionsLinkCaptureMethod { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| { + serde::de::Error::custom( + "Unknown value for PaymentIntentPaymentMethodOptionsLinkCaptureMethod", + ) + }) + } +} +/// Indicates that you intend to make future payments with this PaymentIntent's payment method. +/// +/// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. +/// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. +/// +/// When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum PaymentIntentPaymentMethodOptionsLinkSetupFutureUsage { + None, + OffSession, +} +impl PaymentIntentPaymentMethodOptionsLinkSetupFutureUsage { + pub fn as_str(self) -> &'static str { + use PaymentIntentPaymentMethodOptionsLinkSetupFutureUsage::*; + match self { + None => "none", + OffSession => "off_session", + } + } +} + +impl std::str::FromStr for PaymentIntentPaymentMethodOptionsLinkSetupFutureUsage { + type Err = (); + fn from_str(s: &str) -> Result { + use PaymentIntentPaymentMethodOptionsLinkSetupFutureUsage::*; + match s { + "none" => Ok(None), + "off_session" => Ok(OffSession), + _ => Err(()), + } + } +} +impl std::fmt::Display for PaymentIntentPaymentMethodOptionsLinkSetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for PaymentIntentPaymentMethodOptionsLinkSetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for PaymentIntentPaymentMethodOptionsLinkSetupFutureUsage { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for PaymentIntentPaymentMethodOptionsLinkSetupFutureUsage { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| { + serde::de::Error::custom( + "Unknown value for PaymentIntentPaymentMethodOptionsLinkSetupFutureUsage", + ) + }) + } +} diff --git a/generated/stripe_shared/src/payment_intent_payment_method_options_mandate_options_acss_debit.rs b/generated/stripe_shared/src/payment_intent_payment_method_options_mandate_options_acss_debit.rs new file mode 100644 index 000000000..0a743d280 --- /dev/null +++ b/generated/stripe_shared/src/payment_intent_payment_method_options_mandate_options_acss_debit.rs @@ -0,0 +1,128 @@ +#[derive(Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct PaymentIntentPaymentMethodOptionsMandateOptionsAcssDebit { + /// A URL for custom mandate text + #[serde(skip_serializing_if = "Option::is_none")] + pub custom_mandate_url: Option, + /// Description of the interval. + /// Only required if the 'payment_schedule' parameter is 'interval' or 'combined'. + pub interval_description: Option, + /// Payment schedule for the mandate. + pub payment_schedule: + Option, + /// Transaction type of the mandate. + pub transaction_type: + Option, +} +/// Payment schedule for the mandate. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum PaymentIntentPaymentMethodOptionsMandateOptionsAcssDebitPaymentSchedule { + Combined, + Interval, + Sporadic, +} +impl PaymentIntentPaymentMethodOptionsMandateOptionsAcssDebitPaymentSchedule { + pub fn as_str(self) -> &'static str { + use PaymentIntentPaymentMethodOptionsMandateOptionsAcssDebitPaymentSchedule::*; + match self { + Combined => "combined", + Interval => "interval", + Sporadic => "sporadic", + } + } +} + +impl std::str::FromStr for PaymentIntentPaymentMethodOptionsMandateOptionsAcssDebitPaymentSchedule { + type Err = (); + fn from_str(s: &str) -> Result { + use PaymentIntentPaymentMethodOptionsMandateOptionsAcssDebitPaymentSchedule::*; + match s { + "combined" => Ok(Combined), + "interval" => Ok(Interval), + "sporadic" => Ok(Sporadic), + _ => Err(()), + } + } +} +impl std::fmt::Display for PaymentIntentPaymentMethodOptionsMandateOptionsAcssDebitPaymentSchedule { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for PaymentIntentPaymentMethodOptionsMandateOptionsAcssDebitPaymentSchedule { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for PaymentIntentPaymentMethodOptionsMandateOptionsAcssDebitPaymentSchedule { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> + for PaymentIntentPaymentMethodOptionsMandateOptionsAcssDebitPaymentSchedule +{ + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for PaymentIntentPaymentMethodOptionsMandateOptionsAcssDebitPaymentSchedule")) + } +} +/// Transaction type of the mandate. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum PaymentIntentPaymentMethodOptionsMandateOptionsAcssDebitTransactionType { + Business, + Personal, +} +impl PaymentIntentPaymentMethodOptionsMandateOptionsAcssDebitTransactionType { + pub fn as_str(self) -> &'static str { + use PaymentIntentPaymentMethodOptionsMandateOptionsAcssDebitTransactionType::*; + match self { + Business => "business", + Personal => "personal", + } + } +} + +impl std::str::FromStr for PaymentIntentPaymentMethodOptionsMandateOptionsAcssDebitTransactionType { + type Err = (); + fn from_str(s: &str) -> Result { + use PaymentIntentPaymentMethodOptionsMandateOptionsAcssDebitTransactionType::*; + match s { + "business" => Ok(Business), + "personal" => Ok(Personal), + _ => Err(()), + } + } +} +impl std::fmt::Display for PaymentIntentPaymentMethodOptionsMandateOptionsAcssDebitTransactionType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for PaymentIntentPaymentMethodOptionsMandateOptionsAcssDebitTransactionType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for PaymentIntentPaymentMethodOptionsMandateOptionsAcssDebitTransactionType { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> + for PaymentIntentPaymentMethodOptionsMandateOptionsAcssDebitTransactionType +{ + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for PaymentIntentPaymentMethodOptionsMandateOptionsAcssDebitTransactionType")) + } +} diff --git a/generated/stripe_shared/src/payment_intent_payment_method_options_mandate_options_sepa_debit.rs b/generated/stripe_shared/src/payment_intent_payment_method_options_mandate_options_sepa_debit.rs new file mode 100644 index 000000000..7571f1f03 --- /dev/null +++ b/generated/stripe_shared/src/payment_intent_payment_method_options_mandate_options_sepa_debit.rs @@ -0,0 +1,2 @@ +#[derive(Copy, Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct PaymentIntentPaymentMethodOptionsMandateOptionsSepaDebit {} diff --git a/generated/stripe_shared/src/payment_intent_payment_method_options_sepa_debit.rs b/generated/stripe_shared/src/payment_intent_payment_method_options_sepa_debit.rs new file mode 100644 index 000000000..c12599aab --- /dev/null +++ b/generated/stripe_shared/src/payment_intent_payment_method_options_sepa_debit.rs @@ -0,0 +1,79 @@ +#[derive(Copy, Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct PaymentIntentPaymentMethodOptionsSepaDebit { + #[serde(skip_serializing_if = "Option::is_none")] + pub mandate_options: + Option, + /// Indicates that you intend to make future payments with this PaymentIntent's payment method. + /// + /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. + /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + /// + /// When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + #[serde(skip_serializing_if = "Option::is_none")] + pub setup_future_usage: Option, +} +/// Indicates that you intend to make future payments with this PaymentIntent's payment method. +/// +/// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. +/// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. +/// +/// When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum PaymentIntentPaymentMethodOptionsSepaDebitSetupFutureUsage { + None, + OffSession, + OnSession, +} +impl PaymentIntentPaymentMethodOptionsSepaDebitSetupFutureUsage { + pub fn as_str(self) -> &'static str { + use PaymentIntentPaymentMethodOptionsSepaDebitSetupFutureUsage::*; + match self { + None => "none", + OffSession => "off_session", + OnSession => "on_session", + } + } +} + +impl std::str::FromStr for PaymentIntentPaymentMethodOptionsSepaDebitSetupFutureUsage { + type Err = (); + fn from_str(s: &str) -> Result { + use PaymentIntentPaymentMethodOptionsSepaDebitSetupFutureUsage::*; + match s { + "none" => Ok(None), + "off_session" => Ok(OffSession), + "on_session" => Ok(OnSession), + _ => Err(()), + } + } +} +impl std::fmt::Display for PaymentIntentPaymentMethodOptionsSepaDebitSetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for PaymentIntentPaymentMethodOptionsSepaDebitSetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for PaymentIntentPaymentMethodOptionsSepaDebitSetupFutureUsage { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for PaymentIntentPaymentMethodOptionsSepaDebitSetupFutureUsage { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| { + serde::de::Error::custom( + "Unknown value for PaymentIntentPaymentMethodOptionsSepaDebitSetupFutureUsage", + ) + }) + } +} diff --git a/generated/stripe_shared/src/payment_intent_payment_method_options_swish.rs b/generated/stripe_shared/src/payment_intent_payment_method_options_swish.rs new file mode 100644 index 000000000..f535e0d86 --- /dev/null +++ b/generated/stripe_shared/src/payment_intent_payment_method_options_swish.rs @@ -0,0 +1,73 @@ +#[derive(Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct PaymentIntentPaymentMethodOptionsSwish { + /// The order ID displayed in the Swish app after the payment is authorized. + #[serde(skip_serializing_if = "Option::is_none")] + pub reference: Option, + /// Indicates that you intend to make future payments with this PaymentIntent's payment method. + /// + /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. + /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + /// + /// When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + #[serde(skip_serializing_if = "Option::is_none")] + pub setup_future_usage: Option, +} +/// Indicates that you intend to make future payments with this PaymentIntent's payment method. +/// +/// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. +/// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. +/// +/// When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum PaymentIntentPaymentMethodOptionsSwishSetupFutureUsage { + None, +} +impl PaymentIntentPaymentMethodOptionsSwishSetupFutureUsage { + pub fn as_str(self) -> &'static str { + use PaymentIntentPaymentMethodOptionsSwishSetupFutureUsage::*; + match self { + None => "none", + } + } +} + +impl std::str::FromStr for PaymentIntentPaymentMethodOptionsSwishSetupFutureUsage { + type Err = (); + fn from_str(s: &str) -> Result { + use PaymentIntentPaymentMethodOptionsSwishSetupFutureUsage::*; + match s { + "none" => Ok(None), + _ => Err(()), + } + } +} +impl std::fmt::Display for PaymentIntentPaymentMethodOptionsSwishSetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for PaymentIntentPaymentMethodOptionsSwishSetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for PaymentIntentPaymentMethodOptionsSwishSetupFutureUsage { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for PaymentIntentPaymentMethodOptionsSwishSetupFutureUsage { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| { + serde::de::Error::custom( + "Unknown value for PaymentIntentPaymentMethodOptionsSwishSetupFutureUsage", + ) + }) + } +} diff --git a/generated/stripe_shared/src/payment_intent_payment_method_options_us_bank_account.rs b/generated/stripe_shared/src/payment_intent_payment_method_options_us_bank_account.rs new file mode 100644 index 000000000..46e4a054b --- /dev/null +++ b/generated/stripe_shared/src/payment_intent_payment_method_options_us_bank_account.rs @@ -0,0 +1,203 @@ +#[derive(Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct PaymentIntentPaymentMethodOptionsUsBankAccount { + #[serde(skip_serializing_if = "Option::is_none")] + pub financial_connections: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub mandate_options: Option, + /// Preferred transaction settlement speed + #[serde(skip_serializing_if = "Option::is_none")] + pub preferred_settlement_speed: + Option, + /// Indicates that you intend to make future payments with this PaymentIntent's payment method. + /// + /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. + /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + /// + /// When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + #[serde(skip_serializing_if = "Option::is_none")] + pub setup_future_usage: Option, + /// Bank account verification method. + #[serde(skip_serializing_if = "Option::is_none")] + pub verification_method: + Option, +} +/// Preferred transaction settlement speed +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum PaymentIntentPaymentMethodOptionsUsBankAccountPreferredSettlementSpeed { + Fastest, + Standard, +} +impl PaymentIntentPaymentMethodOptionsUsBankAccountPreferredSettlementSpeed { + pub fn as_str(self) -> &'static str { + use PaymentIntentPaymentMethodOptionsUsBankAccountPreferredSettlementSpeed::*; + match self { + Fastest => "fastest", + Standard => "standard", + } + } +} + +impl std::str::FromStr for PaymentIntentPaymentMethodOptionsUsBankAccountPreferredSettlementSpeed { + type Err = (); + fn from_str(s: &str) -> Result { + use PaymentIntentPaymentMethodOptionsUsBankAccountPreferredSettlementSpeed::*; + match s { + "fastest" => Ok(Fastest), + "standard" => Ok(Standard), + _ => Err(()), + } + } +} +impl std::fmt::Display for PaymentIntentPaymentMethodOptionsUsBankAccountPreferredSettlementSpeed { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for PaymentIntentPaymentMethodOptionsUsBankAccountPreferredSettlementSpeed { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for PaymentIntentPaymentMethodOptionsUsBankAccountPreferredSettlementSpeed { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> + for PaymentIntentPaymentMethodOptionsUsBankAccountPreferredSettlementSpeed +{ + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for PaymentIntentPaymentMethodOptionsUsBankAccountPreferredSettlementSpeed")) + } +} +/// Indicates that you intend to make future payments with this PaymentIntent's payment method. +/// +/// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. +/// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. +/// +/// When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum PaymentIntentPaymentMethodOptionsUsBankAccountSetupFutureUsage { + None, + OffSession, + OnSession, +} +impl PaymentIntentPaymentMethodOptionsUsBankAccountSetupFutureUsage { + pub fn as_str(self) -> &'static str { + use PaymentIntentPaymentMethodOptionsUsBankAccountSetupFutureUsage::*; + match self { + None => "none", + OffSession => "off_session", + OnSession => "on_session", + } + } +} + +impl std::str::FromStr for PaymentIntentPaymentMethodOptionsUsBankAccountSetupFutureUsage { + type Err = (); + fn from_str(s: &str) -> Result { + use PaymentIntentPaymentMethodOptionsUsBankAccountSetupFutureUsage::*; + match s { + "none" => Ok(None), + "off_session" => Ok(OffSession), + "on_session" => Ok(OnSession), + _ => Err(()), + } + } +} +impl std::fmt::Display for PaymentIntentPaymentMethodOptionsUsBankAccountSetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for PaymentIntentPaymentMethodOptionsUsBankAccountSetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for PaymentIntentPaymentMethodOptionsUsBankAccountSetupFutureUsage { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> + for PaymentIntentPaymentMethodOptionsUsBankAccountSetupFutureUsage +{ + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| { + serde::de::Error::custom( + "Unknown value for PaymentIntentPaymentMethodOptionsUsBankAccountSetupFutureUsage", + ) + }) + } +} +/// Bank account verification method. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum PaymentIntentPaymentMethodOptionsUsBankAccountVerificationMethod { + Automatic, + Instant, + Microdeposits, +} +impl PaymentIntentPaymentMethodOptionsUsBankAccountVerificationMethod { + pub fn as_str(self) -> &'static str { + use PaymentIntentPaymentMethodOptionsUsBankAccountVerificationMethod::*; + match self { + Automatic => "automatic", + Instant => "instant", + Microdeposits => "microdeposits", + } + } +} + +impl std::str::FromStr for PaymentIntentPaymentMethodOptionsUsBankAccountVerificationMethod { + type Err = (); + fn from_str(s: &str) -> Result { + use PaymentIntentPaymentMethodOptionsUsBankAccountVerificationMethod::*; + match s { + "automatic" => Ok(Automatic), + "instant" => Ok(Instant), + "microdeposits" => Ok(Microdeposits), + _ => Err(()), + } + } +} +impl std::fmt::Display for PaymentIntentPaymentMethodOptionsUsBankAccountVerificationMethod { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for PaymentIntentPaymentMethodOptionsUsBankAccountVerificationMethod { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for PaymentIntentPaymentMethodOptionsUsBankAccountVerificationMethod { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> + for PaymentIntentPaymentMethodOptionsUsBankAccountVerificationMethod +{ + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for PaymentIntentPaymentMethodOptionsUsBankAccountVerificationMethod")) + } +} diff --git a/generated/stripe_shared/src/payment_intent_processing.rs b/generated/stripe_shared/src/payment_intent_processing.rs new file mode 100644 index 000000000..249bfa825 --- /dev/null +++ b/generated/stripe_shared/src/payment_intent_processing.rs @@ -0,0 +1,59 @@ +#[derive(Copy, Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct PaymentIntentProcessing { + #[serde(skip_serializing_if = "Option::is_none")] + pub card: Option, + /// Type of the payment method for which payment is in `processing` state, one of `card`. + #[serde(rename = "type")] + pub type_: PaymentIntentProcessingType, +} +/// Type of the payment method for which payment is in `processing` state, one of `card`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum PaymentIntentProcessingType { + Card, +} +impl PaymentIntentProcessingType { + pub fn as_str(self) -> &'static str { + use PaymentIntentProcessingType::*; + match self { + Card => "card", + } + } +} + +impl std::str::FromStr for PaymentIntentProcessingType { + type Err = (); + fn from_str(s: &str) -> Result { + use PaymentIntentProcessingType::*; + match s { + "card" => Ok(Card), + _ => Err(()), + } + } +} +impl std::fmt::Display for PaymentIntentProcessingType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for PaymentIntentProcessingType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for PaymentIntentProcessingType { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for PaymentIntentProcessingType { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s) + .map_err(|_| serde::de::Error::custom("Unknown value for PaymentIntentProcessingType")) + } +} diff --git a/generated/stripe_shared/src/payment_intent_processing_customer_notification.rs b/generated/stripe_shared/src/payment_intent_processing_customer_notification.rs new file mode 100644 index 000000000..46b5848f9 --- /dev/null +++ b/generated/stripe_shared/src/payment_intent_processing_customer_notification.rs @@ -0,0 +1,8 @@ +#[derive(Copy, Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct PaymentIntentProcessingCustomerNotification { + /// Whether customer approval has been requested for this payment. + /// For payments greater than INR 15000 or mandate amount, the customer must provide explicit approval of the payment with their bank. + pub approval_requested: Option, + /// If customer approval is required, they need to provide approval before this time. + pub completes_at: Option, +} diff --git a/generated/stripe_shared/src/payment_link.rs b/generated/stripe_shared/src/payment_link.rs new file mode 100644 index 000000000..2b1b5a6dc --- /dev/null +++ b/generated/stripe_shared/src/payment_link.rs @@ -0,0 +1,446 @@ +/// A payment link is a shareable URL that will take your customers to a hosted payment page. +/// A payment link can be shared and used multiple times. +/// +/// When a customer opens a payment link it will open a new [checkout session](https://stripe.com/docs/api/checkout/sessions) to render the payment page. +/// You can use [checkout session events](https://stripe.com/docs/api/events/types#event_types-checkout.session.completed) to track payments through payment links. +/// +/// Related guide: [Payment Links API](https://stripe.com/docs/payment-links) +/// +/// For more details see <>. +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct PaymentLink { + /// Whether the payment link's `url` is active. + /// If `false`, customers visiting the URL will be shown a page saying that the link has been deactivated. + pub active: bool, + pub after_completion: stripe_shared::PaymentLinksResourceAfterCompletion, + /// Whether user redeemable promotion codes are enabled. + pub allow_promotion_codes: bool, + /// The ID of the Connect application that created the Payment Link. + pub application: Option>, + /// The amount of the application fee (if any) that will be requested to be applied to the payment and transferred to the application owner's Stripe account. + pub application_fee_amount: Option, + /// This represents the percentage of the subscription invoice total that will be transferred to the application owner's Stripe account. + pub application_fee_percent: Option, + pub automatic_tax: stripe_shared::PaymentLinksResourceAutomaticTax, + /// Configuration for collecting the customer's billing address. + pub billing_address_collection: stripe_shared::PaymentLinkBillingAddressCollection, + /// When set, provides configuration to gather active consent from customers. + pub consent_collection: Option, + /// Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. + /// Must be a [supported currency](https://stripe.com/docs/currencies). + pub currency: stripe_types::Currency, + /// Collect additional information from your customer using custom fields. + /// Up to 3 fields are supported. + pub custom_fields: Vec, + pub custom_text: stripe_shared::PaymentLinksResourceCustomText, + /// Configuration for Customer creation during checkout. + pub customer_creation: PaymentLinkCustomerCreation, + /// Unique identifier for the object. + pub id: stripe_shared::PaymentLinkId, + /// The custom message to be displayed to a customer when a payment link is no longer active. + pub inactive_message: Option, + /// Configuration for creating invoice for payment mode payment links. + pub invoice_creation: Option, + /// The line items representing what is being sold. + #[serde(skip_serializing_if = "Option::is_none")] + pub line_items: Option>, + /// Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + pub livemode: bool, + /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. + /// This can be useful for storing additional information about the object in a structured format. + pub metadata: std::collections::HashMap, + /// The account on behalf of which to charge. + /// See the [Connect documentation](https://support.stripe.com/questions/sending-invoices-on-behalf-of-connected-accounts) for details. + pub on_behalf_of: Option>, + /// Indicates the parameters to be passed to PaymentIntent creation during checkout. + pub payment_intent_data: Option, + /// Configuration for collecting a payment method during checkout. + pub payment_method_collection: PaymentLinkPaymentMethodCollection, + /// The list of payment method types that customers can use. + /// When `null`, Stripe will dynamically show relevant payment methods you've enabled in your [payment method settings](https://dashboard.stripe.com/settings/payment_methods). + pub payment_method_types: Option>, + pub phone_number_collection: stripe_shared::PaymentLinksResourcePhoneNumberCollection, + /// Settings that restrict the usage of a payment link. + pub restrictions: Option, + /// Configuration for collecting the customer's shipping address. + pub shipping_address_collection: + Option, + /// The shipping rate options applied to the session. + pub shipping_options: Vec, + /// Indicates the type of transaction being performed which customizes relevant text on the page, such as the submit button. + pub submit_type: stripe_shared::PaymentLinkSubmitType, + /// When creating a subscription, the specified configuration data will be used. + /// There must be at least one line item with a recurring price to use `subscription_data`. + pub subscription_data: Option, + pub tax_id_collection: stripe_shared::PaymentLinksResourceTaxIdCollection, + /// The account (if any) the payments will be attributed to for tax reporting, and where funds from each payment will be transferred to. + pub transfer_data: Option, + /// The public URL that can be shared with customers. + pub url: String, +} +/// Configuration for Customer creation during checkout. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum PaymentLinkCustomerCreation { + Always, + IfRequired, +} +impl PaymentLinkCustomerCreation { + pub fn as_str(self) -> &'static str { + use PaymentLinkCustomerCreation::*; + match self { + Always => "always", + IfRequired => "if_required", + } + } +} + +impl std::str::FromStr for PaymentLinkCustomerCreation { + type Err = (); + fn from_str(s: &str) -> Result { + use PaymentLinkCustomerCreation::*; + match s { + "always" => Ok(Always), + "if_required" => Ok(IfRequired), + _ => Err(()), + } + } +} +impl std::fmt::Display for PaymentLinkCustomerCreation { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for PaymentLinkCustomerCreation { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for PaymentLinkCustomerCreation { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for PaymentLinkCustomerCreation { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s) + .map_err(|_| serde::de::Error::custom("Unknown value for PaymentLinkCustomerCreation")) + } +} +/// Configuration for collecting a payment method during checkout. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum PaymentLinkPaymentMethodCollection { + Always, + IfRequired, +} +impl PaymentLinkPaymentMethodCollection { + pub fn as_str(self) -> &'static str { + use PaymentLinkPaymentMethodCollection::*; + match self { + Always => "always", + IfRequired => "if_required", + } + } +} + +impl std::str::FromStr for PaymentLinkPaymentMethodCollection { + type Err = (); + fn from_str(s: &str) -> Result { + use PaymentLinkPaymentMethodCollection::*; + match s { + "always" => Ok(Always), + "if_required" => Ok(IfRequired), + _ => Err(()), + } + } +} +impl std::fmt::Display for PaymentLinkPaymentMethodCollection { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for PaymentLinkPaymentMethodCollection { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for PaymentLinkPaymentMethodCollection { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for PaymentLinkPaymentMethodCollection { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| { + serde::de::Error::custom("Unknown value for PaymentLinkPaymentMethodCollection") + }) + } +} +impl stripe_types::Object for PaymentLink { + type Id = stripe_shared::PaymentLinkId; + fn id(&self) -> &Self::Id { + &self.id + } +} +stripe_types::def_id!(PaymentLinkId, "plink_"); +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum PaymentLinkBillingAddressCollection { + Auto, + Required, +} +impl PaymentLinkBillingAddressCollection { + pub fn as_str(self) -> &'static str { + use PaymentLinkBillingAddressCollection::*; + match self { + Auto => "auto", + Required => "required", + } + } +} + +impl std::str::FromStr for PaymentLinkBillingAddressCollection { + type Err = (); + fn from_str(s: &str) -> Result { + use PaymentLinkBillingAddressCollection::*; + match s { + "auto" => Ok(Auto), + "required" => Ok(Required), + _ => Err(()), + } + } +} +impl std::fmt::Display for PaymentLinkBillingAddressCollection { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for PaymentLinkBillingAddressCollection { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for PaymentLinkBillingAddressCollection { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for PaymentLinkBillingAddressCollection { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| { + serde::de::Error::custom("Unknown value for PaymentLinkBillingAddressCollection") + }) + } +} +#[derive(Copy, Clone, Eq, PartialEq)] +#[non_exhaustive] +pub enum PaymentLinkPaymentMethodTypes { + Affirm, + AfterpayClearpay, + Alipay, + AuBecsDebit, + BacsDebit, + Bancontact, + Blik, + Boleto, + Card, + Cashapp, + Eps, + Fpx, + Giropay, + Grabpay, + Ideal, + Klarna, + Konbini, + Link, + Oxxo, + P24, + Paynow, + Paypal, + Pix, + Promptpay, + SepaDebit, + Sofort, + Swish, + UsBankAccount, + WechatPay, + /// An unrecognized value from Stripe. Should not be used as a request parameter. + Unknown, +} +impl PaymentLinkPaymentMethodTypes { + pub fn as_str(self) -> &'static str { + use PaymentLinkPaymentMethodTypes::*; + match self { + Affirm => "affirm", + AfterpayClearpay => "afterpay_clearpay", + Alipay => "alipay", + AuBecsDebit => "au_becs_debit", + BacsDebit => "bacs_debit", + Bancontact => "bancontact", + Blik => "blik", + Boleto => "boleto", + Card => "card", + Cashapp => "cashapp", + Eps => "eps", + Fpx => "fpx", + Giropay => "giropay", + Grabpay => "grabpay", + Ideal => "ideal", + Klarna => "klarna", + Konbini => "konbini", + Link => "link", + Oxxo => "oxxo", + P24 => "p24", + Paynow => "paynow", + Paypal => "paypal", + Pix => "pix", + Promptpay => "promptpay", + SepaDebit => "sepa_debit", + Sofort => "sofort", + Swish => "swish", + UsBankAccount => "us_bank_account", + WechatPay => "wechat_pay", + Unknown => "unknown", + } + } +} + +impl std::str::FromStr for PaymentLinkPaymentMethodTypes { + type Err = (); + fn from_str(s: &str) -> Result { + use PaymentLinkPaymentMethodTypes::*; + match s { + "affirm" => Ok(Affirm), + "afterpay_clearpay" => Ok(AfterpayClearpay), + "alipay" => Ok(Alipay), + "au_becs_debit" => Ok(AuBecsDebit), + "bacs_debit" => Ok(BacsDebit), + "bancontact" => Ok(Bancontact), + "blik" => Ok(Blik), + "boleto" => Ok(Boleto), + "card" => Ok(Card), + "cashapp" => Ok(Cashapp), + "eps" => Ok(Eps), + "fpx" => Ok(Fpx), + "giropay" => Ok(Giropay), + "grabpay" => Ok(Grabpay), + "ideal" => Ok(Ideal), + "klarna" => Ok(Klarna), + "konbini" => Ok(Konbini), + "link" => Ok(Link), + "oxxo" => Ok(Oxxo), + "p24" => Ok(P24), + "paynow" => Ok(Paynow), + "paypal" => Ok(Paypal), + "pix" => Ok(Pix), + "promptpay" => Ok(Promptpay), + "sepa_debit" => Ok(SepaDebit), + "sofort" => Ok(Sofort), + "swish" => Ok(Swish), + "us_bank_account" => Ok(UsBankAccount), + "wechat_pay" => Ok(WechatPay), + _ => Err(()), + } + } +} +impl std::fmt::Display for PaymentLinkPaymentMethodTypes { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for PaymentLinkPaymentMethodTypes { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for PaymentLinkPaymentMethodTypes { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for PaymentLinkPaymentMethodTypes { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Ok(Self::from_str(&s).unwrap_or(PaymentLinkPaymentMethodTypes::Unknown)) + } +} +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum PaymentLinkSubmitType { + Auto, + Book, + Donate, + Pay, +} +impl PaymentLinkSubmitType { + pub fn as_str(self) -> &'static str { + use PaymentLinkSubmitType::*; + match self { + Auto => "auto", + Book => "book", + Donate => "donate", + Pay => "pay", + } + } +} + +impl std::str::FromStr for PaymentLinkSubmitType { + type Err = (); + fn from_str(s: &str) -> Result { + use PaymentLinkSubmitType::*; + match s { + "auto" => Ok(Auto), + "book" => Ok(Book), + "donate" => Ok(Donate), + "pay" => Ok(Pay), + _ => Err(()), + } + } +} +impl std::fmt::Display for PaymentLinkSubmitType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for PaymentLinkSubmitType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for PaymentLinkSubmitType { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for PaymentLinkSubmitType { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s) + .map_err(|_| serde::de::Error::custom("Unknown value for PaymentLinkSubmitType")) + } +} diff --git a/generated/stripe_shared/src/payment_links_resource_after_completion.rs b/generated/stripe_shared/src/payment_links_resource_after_completion.rs new file mode 100644 index 000000000..73c843e35 --- /dev/null +++ b/generated/stripe_shared/src/payment_links_resource_after_completion.rs @@ -0,0 +1,66 @@ +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct PaymentLinksResourceAfterCompletion { + #[serde(skip_serializing_if = "Option::is_none")] + pub hosted_confirmation: + Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub redirect: Option, + /// The specified behavior after the purchase is complete. + #[serde(rename = "type")] + pub type_: PaymentLinksResourceAfterCompletionType, +} +/// The specified behavior after the purchase is complete. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum PaymentLinksResourceAfterCompletionType { + HostedConfirmation, + Redirect, +} +impl PaymentLinksResourceAfterCompletionType { + pub fn as_str(self) -> &'static str { + use PaymentLinksResourceAfterCompletionType::*; + match self { + HostedConfirmation => "hosted_confirmation", + Redirect => "redirect", + } + } +} + +impl std::str::FromStr for PaymentLinksResourceAfterCompletionType { + type Err = (); + fn from_str(s: &str) -> Result { + use PaymentLinksResourceAfterCompletionType::*; + match s { + "hosted_confirmation" => Ok(HostedConfirmation), + "redirect" => Ok(Redirect), + _ => Err(()), + } + } +} +impl std::fmt::Display for PaymentLinksResourceAfterCompletionType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for PaymentLinksResourceAfterCompletionType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for PaymentLinksResourceAfterCompletionType { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for PaymentLinksResourceAfterCompletionType { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| { + serde::de::Error::custom("Unknown value for PaymentLinksResourceAfterCompletionType") + }) + } +} diff --git a/generated/stripe_shared/src/payment_links_resource_automatic_tax.rs b/generated/stripe_shared/src/payment_links_resource_automatic_tax.rs new file mode 100644 index 000000000..9996bae28 --- /dev/null +++ b/generated/stripe_shared/src/payment_links_resource_automatic_tax.rs @@ -0,0 +1,9 @@ +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct PaymentLinksResourceAutomaticTax { + /// If `true`, tax will be calculated automatically using the customer's location. + pub enabled: bool, + /// The account that's liable for tax. + /// If set, the business address and tax registrations required to perform the tax calculation are loaded from this account. + /// The tax transaction is returned in the report of the connected account. + pub liability: Option, +} diff --git a/generated/stripe_shared/src/payment_links_resource_completed_sessions.rs b/generated/stripe_shared/src/payment_links_resource_completed_sessions.rs new file mode 100644 index 000000000..5459c9fd9 --- /dev/null +++ b/generated/stripe_shared/src/payment_links_resource_completed_sessions.rs @@ -0,0 +1,7 @@ +#[derive(Copy, Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct PaymentLinksResourceCompletedSessions { + /// The current number of checkout sessions that have been completed on the payment link which count towards the `completed_sessions` restriction to be met. + pub count: u64, + /// The maximum number of checkout sessions that can be completed for the `completed_sessions` restriction to be met. + pub limit: i64, +} diff --git a/generated/stripe_shared/src/payment_links_resource_completion_behavior_confirmation_page.rs b/generated/stripe_shared/src/payment_links_resource_completion_behavior_confirmation_page.rs new file mode 100644 index 000000000..e49274d09 --- /dev/null +++ b/generated/stripe_shared/src/payment_links_resource_completion_behavior_confirmation_page.rs @@ -0,0 +1,5 @@ +#[derive(Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct PaymentLinksResourceCompletionBehaviorConfirmationPage { + /// The custom message that is displayed to the customer after the purchase is complete. + pub custom_message: Option, +} diff --git a/generated/stripe_shared/src/payment_links_resource_completion_behavior_redirect.rs b/generated/stripe_shared/src/payment_links_resource_completion_behavior_redirect.rs new file mode 100644 index 000000000..9a36cb2a2 --- /dev/null +++ b/generated/stripe_shared/src/payment_links_resource_completion_behavior_redirect.rs @@ -0,0 +1,5 @@ +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct PaymentLinksResourceCompletionBehaviorRedirect { + /// The URL the customer will be redirected to after the purchase is complete. + pub url: String, +} diff --git a/generated/stripe_shared/src/payment_links_resource_consent_collection.rs b/generated/stripe_shared/src/payment_links_resource_consent_collection.rs new file mode 100644 index 000000000..7096a9f9f --- /dev/null +++ b/generated/stripe_shared/src/payment_links_resource_consent_collection.rs @@ -0,0 +1,126 @@ +#[derive(Copy, Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct PaymentLinksResourceConsentCollection { + /// Settings related to the payment method reuse text shown in the Checkout UI. + pub payment_method_reuse_agreement: + Option, + /// If set to `auto`, enables the collection of customer consent for promotional communications. + pub promotions: Option, + /// If set to `required`, it requires cutomers to accept the terms of service before being able to pay. + /// If set to `none`, customers won't be shown a checkbox to accept the terms of service. + pub terms_of_service: Option, +} +/// If set to `auto`, enables the collection of customer consent for promotional communications. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum PaymentLinksResourceConsentCollectionPromotions { + Auto, + None, +} +impl PaymentLinksResourceConsentCollectionPromotions { + pub fn as_str(self) -> &'static str { + use PaymentLinksResourceConsentCollectionPromotions::*; + match self { + Auto => "auto", + None => "none", + } + } +} + +impl std::str::FromStr for PaymentLinksResourceConsentCollectionPromotions { + type Err = (); + fn from_str(s: &str) -> Result { + use PaymentLinksResourceConsentCollectionPromotions::*; + match s { + "auto" => Ok(Auto), + "none" => Ok(None), + _ => Err(()), + } + } +} +impl std::fmt::Display for PaymentLinksResourceConsentCollectionPromotions { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for PaymentLinksResourceConsentCollectionPromotions { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for PaymentLinksResourceConsentCollectionPromotions { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for PaymentLinksResourceConsentCollectionPromotions { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| { + serde::de::Error::custom( + "Unknown value for PaymentLinksResourceConsentCollectionPromotions", + ) + }) + } +} +/// If set to `required`, it requires cutomers to accept the terms of service before being able to pay. +/// If set to `none`, customers won't be shown a checkbox to accept the terms of service. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum PaymentLinksResourceConsentCollectionTermsOfService { + None, + Required, +} +impl PaymentLinksResourceConsentCollectionTermsOfService { + pub fn as_str(self) -> &'static str { + use PaymentLinksResourceConsentCollectionTermsOfService::*; + match self { + None => "none", + Required => "required", + } + } +} + +impl std::str::FromStr for PaymentLinksResourceConsentCollectionTermsOfService { + type Err = (); + fn from_str(s: &str) -> Result { + use PaymentLinksResourceConsentCollectionTermsOfService::*; + match s { + "none" => Ok(None), + "required" => Ok(Required), + _ => Err(()), + } + } +} +impl std::fmt::Display for PaymentLinksResourceConsentCollectionTermsOfService { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for PaymentLinksResourceConsentCollectionTermsOfService { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for PaymentLinksResourceConsentCollectionTermsOfService { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for PaymentLinksResourceConsentCollectionTermsOfService { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| { + serde::de::Error::custom( + "Unknown value for PaymentLinksResourceConsentCollectionTermsOfService", + ) + }) + } +} diff --git a/generated/stripe_shared/src/payment_links_resource_custom_fields.rs b/generated/stripe_shared/src/payment_links_resource_custom_fields.rs new file mode 100644 index 000000000..157ae43eb --- /dev/null +++ b/generated/stripe_shared/src/payment_links_resource_custom_fields.rs @@ -0,0 +1,77 @@ +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct PaymentLinksResourceCustomFields { + #[serde(skip_serializing_if = "Option::is_none")] + pub dropdown: Option, + /// String of your choice that your integration can use to reconcile this field. + /// Must be unique to this field, alphanumeric, and up to 200 characters. + pub key: String, + pub label: stripe_shared::PaymentLinksResourceCustomFieldsLabel, + #[serde(skip_serializing_if = "Option::is_none")] + pub numeric: Option, + /// Whether the customer is required to complete the field before completing the Checkout Session. + /// Defaults to `false`. + pub optional: bool, + #[serde(skip_serializing_if = "Option::is_none")] + pub text: Option, + /// The type of the field. + #[serde(rename = "type")] + pub type_: PaymentLinksResourceCustomFieldsType, +} +/// The type of the field. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum PaymentLinksResourceCustomFieldsType { + Dropdown, + Numeric, + Text, +} +impl PaymentLinksResourceCustomFieldsType { + pub fn as_str(self) -> &'static str { + use PaymentLinksResourceCustomFieldsType::*; + match self { + Dropdown => "dropdown", + Numeric => "numeric", + Text => "text", + } + } +} + +impl std::str::FromStr for PaymentLinksResourceCustomFieldsType { + type Err = (); + fn from_str(s: &str) -> Result { + use PaymentLinksResourceCustomFieldsType::*; + match s { + "dropdown" => Ok(Dropdown), + "numeric" => Ok(Numeric), + "text" => Ok(Text), + _ => Err(()), + } + } +} +impl std::fmt::Display for PaymentLinksResourceCustomFieldsType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for PaymentLinksResourceCustomFieldsType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for PaymentLinksResourceCustomFieldsType { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for PaymentLinksResourceCustomFieldsType { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| { + serde::de::Error::custom("Unknown value for PaymentLinksResourceCustomFieldsType") + }) + } +} diff --git a/generated/stripe_shared/src/payment_links_resource_custom_fields_dropdown.rs b/generated/stripe_shared/src/payment_links_resource_custom_fields_dropdown.rs new file mode 100644 index 000000000..f38092d50 --- /dev/null +++ b/generated/stripe_shared/src/payment_links_resource_custom_fields_dropdown.rs @@ -0,0 +1,5 @@ +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct PaymentLinksResourceCustomFieldsDropdown { + /// The options available for the customer to select. Up to 200 options allowed. + pub options: Vec, +} diff --git a/generated/stripe_shared/src/payment_links_resource_custom_fields_dropdown_option.rs b/generated/stripe_shared/src/payment_links_resource_custom_fields_dropdown_option.rs new file mode 100644 index 000000000..f2c52007a --- /dev/null +++ b/generated/stripe_shared/src/payment_links_resource_custom_fields_dropdown_option.rs @@ -0,0 +1,8 @@ +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct PaymentLinksResourceCustomFieldsDropdownOption { + /// The label for the option, displayed to the customer. Up to 100 characters. + pub label: String, + /// The value for this option, not displayed to the customer, used by your integration to reconcile the option selected by the customer. + /// Must be unique to this option, alphanumeric, and up to 100 characters. + pub value: String, +} diff --git a/generated/stripe_shared/src/payment_links_resource_custom_fields_label.rs b/generated/stripe_shared/src/payment_links_resource_custom_fields_label.rs new file mode 100644 index 000000000..bd358de3a --- /dev/null +++ b/generated/stripe_shared/src/payment_links_resource_custom_fields_label.rs @@ -0,0 +1,60 @@ +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct PaymentLinksResourceCustomFieldsLabel { + /// Custom text for the label, displayed to the customer. Up to 50 characters. + pub custom: Option, + /// The type of the label. + #[serde(rename = "type")] + pub type_: PaymentLinksResourceCustomFieldsLabelType, +} +/// The type of the label. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum PaymentLinksResourceCustomFieldsLabelType { + Custom, +} +impl PaymentLinksResourceCustomFieldsLabelType { + pub fn as_str(self) -> &'static str { + use PaymentLinksResourceCustomFieldsLabelType::*; + match self { + Custom => "custom", + } + } +} + +impl std::str::FromStr for PaymentLinksResourceCustomFieldsLabelType { + type Err = (); + fn from_str(s: &str) -> Result { + use PaymentLinksResourceCustomFieldsLabelType::*; + match s { + "custom" => Ok(Custom), + _ => Err(()), + } + } +} +impl std::fmt::Display for PaymentLinksResourceCustomFieldsLabelType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for PaymentLinksResourceCustomFieldsLabelType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for PaymentLinksResourceCustomFieldsLabelType { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for PaymentLinksResourceCustomFieldsLabelType { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| { + serde::de::Error::custom("Unknown value for PaymentLinksResourceCustomFieldsLabelType") + }) + } +} diff --git a/generated/stripe_shared/src/payment_links_resource_custom_fields_numeric.rs b/generated/stripe_shared/src/payment_links_resource_custom_fields_numeric.rs new file mode 100644 index 000000000..991942e28 --- /dev/null +++ b/generated/stripe_shared/src/payment_links_resource_custom_fields_numeric.rs @@ -0,0 +1,7 @@ +#[derive(Copy, Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct PaymentLinksResourceCustomFieldsNumeric { + /// The maximum character length constraint for the customer's input. + pub maximum_length: Option, + /// The minimum character length requirement for the customer's input. + pub minimum_length: Option, +} diff --git a/generated/stripe_shared/src/payment_links_resource_custom_fields_text.rs b/generated/stripe_shared/src/payment_links_resource_custom_fields_text.rs new file mode 100644 index 000000000..2bc876ea7 --- /dev/null +++ b/generated/stripe_shared/src/payment_links_resource_custom_fields_text.rs @@ -0,0 +1,7 @@ +#[derive(Copy, Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct PaymentLinksResourceCustomFieldsText { + /// The maximum character length constraint for the customer's input. + pub maximum_length: Option, + /// The minimum character length requirement for the customer's input. + pub minimum_length: Option, +} diff --git a/generated/stripe_shared/src/payment_links_resource_custom_text.rs b/generated/stripe_shared/src/payment_links_resource_custom_text.rs new file mode 100644 index 000000000..e92effe8a --- /dev/null +++ b/generated/stripe_shared/src/payment_links_resource_custom_text.rs @@ -0,0 +1,11 @@ +#[derive(Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct PaymentLinksResourceCustomText { + /// Custom text that should be displayed after the payment confirmation button. + pub after_submit: Option, + /// Custom text that should be displayed alongside shipping address collection. + pub shipping_address: Option, + /// Custom text that should be displayed alongside the payment confirmation button. + pub submit: Option, + /// Custom text that should be displayed in place of the default terms of service agreement text. + pub terms_of_service_acceptance: Option, +} diff --git a/generated/stripe_shared/src/payment_links_resource_custom_text_position.rs b/generated/stripe_shared/src/payment_links_resource_custom_text_position.rs new file mode 100644 index 000000000..cbef6514a --- /dev/null +++ b/generated/stripe_shared/src/payment_links_resource_custom_text_position.rs @@ -0,0 +1,5 @@ +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct PaymentLinksResourceCustomTextPosition { + /// Text may be up to 1200 characters in length. + pub message: String, +} diff --git a/generated/stripe_shared/src/payment_links_resource_invoice_creation.rs b/generated/stripe_shared/src/payment_links_resource_invoice_creation.rs new file mode 100644 index 000000000..83c9b584c --- /dev/null +++ b/generated/stripe_shared/src/payment_links_resource_invoice_creation.rs @@ -0,0 +1,7 @@ +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct PaymentLinksResourceInvoiceCreation { + /// Enable creating an invoice on successful payment. + pub enabled: bool, + /// Configuration for the invoice. Default invoice values will be used if unspecified. + pub invoice_data: Option, +} diff --git a/generated/stripe_shared/src/payment_links_resource_invoice_settings.rs b/generated/stripe_shared/src/payment_links_resource_invoice_settings.rs new file mode 100644 index 000000000..23eb97d2d --- /dev/null +++ b/generated/stripe_shared/src/payment_links_resource_invoice_settings.rs @@ -0,0 +1,19 @@ +#[derive(Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct PaymentLinksResourceInvoiceSettings { + /// The account tax IDs associated with the invoice. + pub account_tax_ids: Option>>, + /// A list of up to 4 custom fields to be displayed on the invoice. + pub custom_fields: Option>, + /// An arbitrary string attached to the object. Often useful for displaying to users. + pub description: Option, + /// Footer to be displayed on the invoice. + pub footer: Option, + /// The connected account that issues the invoice. + /// The invoice is presented with the branding and support information of the specified account. + pub issuer: Option, + /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. + /// This can be useful for storing additional information about the object in a structured format. + pub metadata: Option>, + /// Options for invoice PDF rendering. + pub rendering_options: Option, +} diff --git a/generated/stripe_shared/src/payment_links_resource_payment_intent_data.rs b/generated/stripe_shared/src/payment_links_resource_payment_intent_data.rs new file mode 100644 index 000000000..c7b9602bc --- /dev/null +++ b/generated/stripe_shared/src/payment_links_resource_payment_intent_data.rs @@ -0,0 +1,138 @@ +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct PaymentLinksResourcePaymentIntentData { + /// Indicates when the funds will be captured from the customer's account. + pub capture_method: Option, + /// An arbitrary string attached to the object. Often useful for displaying to users. + pub description: Option, + /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that will set metadata on [Payment Intents](https://stripe.com/docs/api/payment_intents) generated from this payment link. + pub metadata: std::collections::HashMap, + /// Indicates that you intend to make future payments with the payment method collected during checkout. + pub setup_future_usage: Option, + /// Extra information about the payment. + /// This will appear on your customer's statement when this payment succeeds in creating a charge. + pub statement_descriptor: Option, + /// Provides information about the charge that customers see on their statements. + /// Concatenated with the prefix (shortened descriptor) or statement descriptor that's set on the account to form the complete statement descriptor. + /// Maximum 22 characters for the concatenated descriptor. + pub statement_descriptor_suffix: Option, + /// A string that identifies the resulting payment as part of a group. + /// See the PaymentIntents [use case for connected accounts](https://stripe.com/docs/connect/separate-charges-and-transfers) for details. + pub transfer_group: Option, +} +/// Indicates when the funds will be captured from the customer's account. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum PaymentLinksResourcePaymentIntentDataCaptureMethod { + Automatic, + AutomaticAsync, + Manual, +} +impl PaymentLinksResourcePaymentIntentDataCaptureMethod { + pub fn as_str(self) -> &'static str { + use PaymentLinksResourcePaymentIntentDataCaptureMethod::*; + match self { + Automatic => "automatic", + AutomaticAsync => "automatic_async", + Manual => "manual", + } + } +} + +impl std::str::FromStr for PaymentLinksResourcePaymentIntentDataCaptureMethod { + type Err = (); + fn from_str(s: &str) -> Result { + use PaymentLinksResourcePaymentIntentDataCaptureMethod::*; + match s { + "automatic" => Ok(Automatic), + "automatic_async" => Ok(AutomaticAsync), + "manual" => Ok(Manual), + _ => Err(()), + } + } +} +impl std::fmt::Display for PaymentLinksResourcePaymentIntentDataCaptureMethod { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for PaymentLinksResourcePaymentIntentDataCaptureMethod { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for PaymentLinksResourcePaymentIntentDataCaptureMethod { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for PaymentLinksResourcePaymentIntentDataCaptureMethod { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| { + serde::de::Error::custom( + "Unknown value for PaymentLinksResourcePaymentIntentDataCaptureMethod", + ) + }) + } +} +/// Indicates that you intend to make future payments with the payment method collected during checkout. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum PaymentLinksResourcePaymentIntentDataSetupFutureUsage { + OffSession, + OnSession, +} +impl PaymentLinksResourcePaymentIntentDataSetupFutureUsage { + pub fn as_str(self) -> &'static str { + use PaymentLinksResourcePaymentIntentDataSetupFutureUsage::*; + match self { + OffSession => "off_session", + OnSession => "on_session", + } + } +} + +impl std::str::FromStr for PaymentLinksResourcePaymentIntentDataSetupFutureUsage { + type Err = (); + fn from_str(s: &str) -> Result { + use PaymentLinksResourcePaymentIntentDataSetupFutureUsage::*; + match s { + "off_session" => Ok(OffSession), + "on_session" => Ok(OnSession), + _ => Err(()), + } + } +} +impl std::fmt::Display for PaymentLinksResourcePaymentIntentDataSetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for PaymentLinksResourcePaymentIntentDataSetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for PaymentLinksResourcePaymentIntentDataSetupFutureUsage { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for PaymentLinksResourcePaymentIntentDataSetupFutureUsage { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| { + serde::de::Error::custom( + "Unknown value for PaymentLinksResourcePaymentIntentDataSetupFutureUsage", + ) + }) + } +} diff --git a/generated/stripe_shared/src/payment_links_resource_payment_method_reuse_agreement.rs b/generated/stripe_shared/src/payment_links_resource_payment_method_reuse_agreement.rs new file mode 100644 index 000000000..dff5dd838 --- /dev/null +++ b/generated/stripe_shared/src/payment_links_resource_payment_method_reuse_agreement.rs @@ -0,0 +1,68 @@ +#[derive(Copy, Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct PaymentLinksResourcePaymentMethodReuseAgreement { + /// Determines the position and visibility of the payment method reuse agreement in the UI. + /// When set to `auto`, Stripe's defaults will be used. + /// + /// When set to `hidden`, the payment method reuse agreement text will always be hidden in the UI. + pub position: PaymentLinksResourcePaymentMethodReuseAgreementPosition, +} +/// Determines the position and visibility of the payment method reuse agreement in the UI. +/// When set to `auto`, Stripe's defaults will be used. +/// +/// When set to `hidden`, the payment method reuse agreement text will always be hidden in the UI. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum PaymentLinksResourcePaymentMethodReuseAgreementPosition { + Auto, + Hidden, +} +impl PaymentLinksResourcePaymentMethodReuseAgreementPosition { + pub fn as_str(self) -> &'static str { + use PaymentLinksResourcePaymentMethodReuseAgreementPosition::*; + match self { + Auto => "auto", + Hidden => "hidden", + } + } +} + +impl std::str::FromStr for PaymentLinksResourcePaymentMethodReuseAgreementPosition { + type Err = (); + fn from_str(s: &str) -> Result { + use PaymentLinksResourcePaymentMethodReuseAgreementPosition::*; + match s { + "auto" => Ok(Auto), + "hidden" => Ok(Hidden), + _ => Err(()), + } + } +} +impl std::fmt::Display for PaymentLinksResourcePaymentMethodReuseAgreementPosition { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for PaymentLinksResourcePaymentMethodReuseAgreementPosition { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for PaymentLinksResourcePaymentMethodReuseAgreementPosition { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for PaymentLinksResourcePaymentMethodReuseAgreementPosition { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| { + serde::de::Error::custom( + "Unknown value for PaymentLinksResourcePaymentMethodReuseAgreementPosition", + ) + }) + } +} diff --git a/generated/stripe_shared/src/payment_links_resource_phone_number_collection.rs b/generated/stripe_shared/src/payment_links_resource_phone_number_collection.rs new file mode 100644 index 000000000..20a7c9d22 --- /dev/null +++ b/generated/stripe_shared/src/payment_links_resource_phone_number_collection.rs @@ -0,0 +1,5 @@ +#[derive(Copy, Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct PaymentLinksResourcePhoneNumberCollection { + /// If `true`, a phone number will be collected during checkout. + pub enabled: bool, +} diff --git a/generated/stripe_shared/src/payment_links_resource_restrictions.rs b/generated/stripe_shared/src/payment_links_resource_restrictions.rs new file mode 100644 index 000000000..697c4612a --- /dev/null +++ b/generated/stripe_shared/src/payment_links_resource_restrictions.rs @@ -0,0 +1,4 @@ +#[derive(Copy, Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct PaymentLinksResourceRestrictions { + pub completed_sessions: stripe_shared::PaymentLinksResourceCompletedSessions, +} diff --git a/generated/stripe_shared/src/payment_links_resource_shipping_address_collection.rs b/generated/stripe_shared/src/payment_links_resource_shipping_address_collection.rs new file mode 100644 index 000000000..3cbf4fdc4 --- /dev/null +++ b/generated/stripe_shared/src/payment_links_resource_shipping_address_collection.rs @@ -0,0 +1,772 @@ +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct PaymentLinksResourceShippingAddressCollection { + /// An array of two-letter ISO country codes representing which countries Checkout should provide as options for shipping locations. + /// Unsupported country codes: `AS, CX, CC, CU, HM, IR, KP, MH, FM, NF, MP, PW, SD, SY, UM, VI`. + pub allowed_countries: Vec, +} +/// An array of two-letter ISO country codes representing which countries Checkout should provide as options for shipping locations. +/// Unsupported country codes: `AS, CX, CC, CU, HM, IR, KP, MH, FM, NF, MP, PW, SD, SY, UM, VI`. +#[derive(Copy, Clone, Eq, PartialEq)] +#[non_exhaustive] +pub enum PaymentLinksResourceShippingAddressCollectionAllowedCountries { + Ac, + Ad, + Ae, + Af, + Ag, + Ai, + Al, + Am, + Ao, + Aq, + Ar, + At, + Au, + Aw, + Ax, + Az, + Ba, + Bb, + Bd, + Be, + Bf, + Bg, + Bh, + Bi, + Bj, + Bl, + Bm, + Bn, + Bo, + Bq, + Br, + Bs, + Bt, + Bv, + Bw, + By, + Bz, + Ca, + Cd, + Cf, + Cg, + Ch, + Ci, + Ck, + Cl, + Cm, + Cn, + Co, + Cr, + Cv, + Cw, + Cy, + Cz, + De, + Dj, + Dk, + Dm, + Do, + Dz, + Ec, + Ee, + Eg, + Eh, + Er, + Es, + Et, + Fi, + Fj, + Fk, + Fo, + Fr, + Ga, + Gb, + Gd, + Ge, + Gf, + Gg, + Gh, + Gi, + Gl, + Gm, + Gn, + Gp, + Gq, + Gr, + Gs, + Gt, + Gu, + Gw, + Gy, + Hk, + Hn, + Hr, + Ht, + Hu, + Id, + Ie, + Il, + Im, + In, + Io, + Iq, + Is, + It, + Je, + Jm, + Jo, + Jp, + Ke, + Kg, + Kh, + Ki, + Km, + Kn, + Kr, + Kw, + Ky, + Kz, + La, + Lb, + Lc, + Li, + Lk, + Lr, + Ls, + Lt, + Lu, + Lv, + Ly, + Ma, + Mc, + Md, + Me, + Mf, + Mg, + Mk, + Ml, + Mm, + Mn, + Mo, + Mq, + Mr, + Ms, + Mt, + Mu, + Mv, + Mw, + Mx, + My, + Mz, + Na, + Nc, + Ne, + Ng, + Ni, + Nl, + No, + Np, + Nr, + Nu, + Nz, + Om, + Pa, + Pe, + Pf, + Pg, + Ph, + Pk, + Pl, + Pm, + Pn, + Pr, + Ps, + Pt, + Py, + Qa, + Re, + Ro, + Rs, + Ru, + Rw, + Sa, + Sb, + Sc, + Se, + Sg, + Sh, + Si, + Sj, + Sk, + Sl, + Sm, + Sn, + So, + Sr, + Ss, + St, + Sv, + Sx, + Sz, + Ta, + Tc, + Td, + Tf, + Tg, + Th, + Tj, + Tk, + Tl, + Tm, + Tn, + To, + Tr, + Tt, + Tv, + Tw, + Tz, + Ua, + Ug, + Us, + Uy, + Uz, + Va, + Vc, + Ve, + Vg, + Vn, + Vu, + Wf, + Ws, + Xk, + Ye, + Yt, + Za, + Zm, + Zw, + Zz, + /// An unrecognized value from Stripe. Should not be used as a request parameter. + Unknown, +} +impl PaymentLinksResourceShippingAddressCollectionAllowedCountries { + pub fn as_str(self) -> &'static str { + use PaymentLinksResourceShippingAddressCollectionAllowedCountries::*; + match self { + Ac => "AC", + Ad => "AD", + Ae => "AE", + Af => "AF", + Ag => "AG", + Ai => "AI", + Al => "AL", + Am => "AM", + Ao => "AO", + Aq => "AQ", + Ar => "AR", + At => "AT", + Au => "AU", + Aw => "AW", + Ax => "AX", + Az => "AZ", + Ba => "BA", + Bb => "BB", + Bd => "BD", + Be => "BE", + Bf => "BF", + Bg => "BG", + Bh => "BH", + Bi => "BI", + Bj => "BJ", + Bl => "BL", + Bm => "BM", + Bn => "BN", + Bo => "BO", + Bq => "BQ", + Br => "BR", + Bs => "BS", + Bt => "BT", + Bv => "BV", + Bw => "BW", + By => "BY", + Bz => "BZ", + Ca => "CA", + Cd => "CD", + Cf => "CF", + Cg => "CG", + Ch => "CH", + Ci => "CI", + Ck => "CK", + Cl => "CL", + Cm => "CM", + Cn => "CN", + Co => "CO", + Cr => "CR", + Cv => "CV", + Cw => "CW", + Cy => "CY", + Cz => "CZ", + De => "DE", + Dj => "DJ", + Dk => "DK", + Dm => "DM", + Do => "DO", + Dz => "DZ", + Ec => "EC", + Ee => "EE", + Eg => "EG", + Eh => "EH", + Er => "ER", + Es => "ES", + Et => "ET", + Fi => "FI", + Fj => "FJ", + Fk => "FK", + Fo => "FO", + Fr => "FR", + Ga => "GA", + Gb => "GB", + Gd => "GD", + Ge => "GE", + Gf => "GF", + Gg => "GG", + Gh => "GH", + Gi => "GI", + Gl => "GL", + Gm => "GM", + Gn => "GN", + Gp => "GP", + Gq => "GQ", + Gr => "GR", + Gs => "GS", + Gt => "GT", + Gu => "GU", + Gw => "GW", + Gy => "GY", + Hk => "HK", + Hn => "HN", + Hr => "HR", + Ht => "HT", + Hu => "HU", + Id => "ID", + Ie => "IE", + Il => "IL", + Im => "IM", + In => "IN", + Io => "IO", + Iq => "IQ", + Is => "IS", + It => "IT", + Je => "JE", + Jm => "JM", + Jo => "JO", + Jp => "JP", + Ke => "KE", + Kg => "KG", + Kh => "KH", + Ki => "KI", + Km => "KM", + Kn => "KN", + Kr => "KR", + Kw => "KW", + Ky => "KY", + Kz => "KZ", + La => "LA", + Lb => "LB", + Lc => "LC", + Li => "LI", + Lk => "LK", + Lr => "LR", + Ls => "LS", + Lt => "LT", + Lu => "LU", + Lv => "LV", + Ly => "LY", + Ma => "MA", + Mc => "MC", + Md => "MD", + Me => "ME", + Mf => "MF", + Mg => "MG", + Mk => "MK", + Ml => "ML", + Mm => "MM", + Mn => "MN", + Mo => "MO", + Mq => "MQ", + Mr => "MR", + Ms => "MS", + Mt => "MT", + Mu => "MU", + Mv => "MV", + Mw => "MW", + Mx => "MX", + My => "MY", + Mz => "MZ", + Na => "NA", + Nc => "NC", + Ne => "NE", + Ng => "NG", + Ni => "NI", + Nl => "NL", + No => "NO", + Np => "NP", + Nr => "NR", + Nu => "NU", + Nz => "NZ", + Om => "OM", + Pa => "PA", + Pe => "PE", + Pf => "PF", + Pg => "PG", + Ph => "PH", + Pk => "PK", + Pl => "PL", + Pm => "PM", + Pn => "PN", + Pr => "PR", + Ps => "PS", + Pt => "PT", + Py => "PY", + Qa => "QA", + Re => "RE", + Ro => "RO", + Rs => "RS", + Ru => "RU", + Rw => "RW", + Sa => "SA", + Sb => "SB", + Sc => "SC", + Se => "SE", + Sg => "SG", + Sh => "SH", + Si => "SI", + Sj => "SJ", + Sk => "SK", + Sl => "SL", + Sm => "SM", + Sn => "SN", + So => "SO", + Sr => "SR", + Ss => "SS", + St => "ST", + Sv => "SV", + Sx => "SX", + Sz => "SZ", + Ta => "TA", + Tc => "TC", + Td => "TD", + Tf => "TF", + Tg => "TG", + Th => "TH", + Tj => "TJ", + Tk => "TK", + Tl => "TL", + Tm => "TM", + Tn => "TN", + To => "TO", + Tr => "TR", + Tt => "TT", + Tv => "TV", + Tw => "TW", + Tz => "TZ", + Ua => "UA", + Ug => "UG", + Us => "US", + Uy => "UY", + Uz => "UZ", + Va => "VA", + Vc => "VC", + Ve => "VE", + Vg => "VG", + Vn => "VN", + Vu => "VU", + Wf => "WF", + Ws => "WS", + Xk => "XK", + Ye => "YE", + Yt => "YT", + Za => "ZA", + Zm => "ZM", + Zw => "ZW", + Zz => "ZZ", + Unknown => "unknown", + } + } +} + +impl std::str::FromStr for PaymentLinksResourceShippingAddressCollectionAllowedCountries { + type Err = (); + fn from_str(s: &str) -> Result { + use PaymentLinksResourceShippingAddressCollectionAllowedCountries::*; + match s { + "AC" => Ok(Ac), + "AD" => Ok(Ad), + "AE" => Ok(Ae), + "AF" => Ok(Af), + "AG" => Ok(Ag), + "AI" => Ok(Ai), + "AL" => Ok(Al), + "AM" => Ok(Am), + "AO" => Ok(Ao), + "AQ" => Ok(Aq), + "AR" => Ok(Ar), + "AT" => Ok(At), + "AU" => Ok(Au), + "AW" => Ok(Aw), + "AX" => Ok(Ax), + "AZ" => Ok(Az), + "BA" => Ok(Ba), + "BB" => Ok(Bb), + "BD" => Ok(Bd), + "BE" => Ok(Be), + "BF" => Ok(Bf), + "BG" => Ok(Bg), + "BH" => Ok(Bh), + "BI" => Ok(Bi), + "BJ" => Ok(Bj), + "BL" => Ok(Bl), + "BM" => Ok(Bm), + "BN" => Ok(Bn), + "BO" => Ok(Bo), + "BQ" => Ok(Bq), + "BR" => Ok(Br), + "BS" => Ok(Bs), + "BT" => Ok(Bt), + "BV" => Ok(Bv), + "BW" => Ok(Bw), + "BY" => Ok(By), + "BZ" => Ok(Bz), + "CA" => Ok(Ca), + "CD" => Ok(Cd), + "CF" => Ok(Cf), + "CG" => Ok(Cg), + "CH" => Ok(Ch), + "CI" => Ok(Ci), + "CK" => Ok(Ck), + "CL" => Ok(Cl), + "CM" => Ok(Cm), + "CN" => Ok(Cn), + "CO" => Ok(Co), + "CR" => Ok(Cr), + "CV" => Ok(Cv), + "CW" => Ok(Cw), + "CY" => Ok(Cy), + "CZ" => Ok(Cz), + "DE" => Ok(De), + "DJ" => Ok(Dj), + "DK" => Ok(Dk), + "DM" => Ok(Dm), + "DO" => Ok(Do), + "DZ" => Ok(Dz), + "EC" => Ok(Ec), + "EE" => Ok(Ee), + "EG" => Ok(Eg), + "EH" => Ok(Eh), + "ER" => Ok(Er), + "ES" => Ok(Es), + "ET" => Ok(Et), + "FI" => Ok(Fi), + "FJ" => Ok(Fj), + "FK" => Ok(Fk), + "FO" => Ok(Fo), + "FR" => Ok(Fr), + "GA" => Ok(Ga), + "GB" => Ok(Gb), + "GD" => Ok(Gd), + "GE" => Ok(Ge), + "GF" => Ok(Gf), + "GG" => Ok(Gg), + "GH" => Ok(Gh), + "GI" => Ok(Gi), + "GL" => Ok(Gl), + "GM" => Ok(Gm), + "GN" => Ok(Gn), + "GP" => Ok(Gp), + "GQ" => Ok(Gq), + "GR" => Ok(Gr), + "GS" => Ok(Gs), + "GT" => Ok(Gt), + "GU" => Ok(Gu), + "GW" => Ok(Gw), + "GY" => Ok(Gy), + "HK" => Ok(Hk), + "HN" => Ok(Hn), + "HR" => Ok(Hr), + "HT" => Ok(Ht), + "HU" => Ok(Hu), + "ID" => Ok(Id), + "IE" => Ok(Ie), + "IL" => Ok(Il), + "IM" => Ok(Im), + "IN" => Ok(In), + "IO" => Ok(Io), + "IQ" => Ok(Iq), + "IS" => Ok(Is), + "IT" => Ok(It), + "JE" => Ok(Je), + "JM" => Ok(Jm), + "JO" => Ok(Jo), + "JP" => Ok(Jp), + "KE" => Ok(Ke), + "KG" => Ok(Kg), + "KH" => Ok(Kh), + "KI" => Ok(Ki), + "KM" => Ok(Km), + "KN" => Ok(Kn), + "KR" => Ok(Kr), + "KW" => Ok(Kw), + "KY" => Ok(Ky), + "KZ" => Ok(Kz), + "LA" => Ok(La), + "LB" => Ok(Lb), + "LC" => Ok(Lc), + "LI" => Ok(Li), + "LK" => Ok(Lk), + "LR" => Ok(Lr), + "LS" => Ok(Ls), + "LT" => Ok(Lt), + "LU" => Ok(Lu), + "LV" => Ok(Lv), + "LY" => Ok(Ly), + "MA" => Ok(Ma), + "MC" => Ok(Mc), + "MD" => Ok(Md), + "ME" => Ok(Me), + "MF" => Ok(Mf), + "MG" => Ok(Mg), + "MK" => Ok(Mk), + "ML" => Ok(Ml), + "MM" => Ok(Mm), + "MN" => Ok(Mn), + "MO" => Ok(Mo), + "MQ" => Ok(Mq), + "MR" => Ok(Mr), + "MS" => Ok(Ms), + "MT" => Ok(Mt), + "MU" => Ok(Mu), + "MV" => Ok(Mv), + "MW" => Ok(Mw), + "MX" => Ok(Mx), + "MY" => Ok(My), + "MZ" => Ok(Mz), + "NA" => Ok(Na), + "NC" => Ok(Nc), + "NE" => Ok(Ne), + "NG" => Ok(Ng), + "NI" => Ok(Ni), + "NL" => Ok(Nl), + "NO" => Ok(No), + "NP" => Ok(Np), + "NR" => Ok(Nr), + "NU" => Ok(Nu), + "NZ" => Ok(Nz), + "OM" => Ok(Om), + "PA" => Ok(Pa), + "PE" => Ok(Pe), + "PF" => Ok(Pf), + "PG" => Ok(Pg), + "PH" => Ok(Ph), + "PK" => Ok(Pk), + "PL" => Ok(Pl), + "PM" => Ok(Pm), + "PN" => Ok(Pn), + "PR" => Ok(Pr), + "PS" => Ok(Ps), + "PT" => Ok(Pt), + "PY" => Ok(Py), + "QA" => Ok(Qa), + "RE" => Ok(Re), + "RO" => Ok(Ro), + "RS" => Ok(Rs), + "RU" => Ok(Ru), + "RW" => Ok(Rw), + "SA" => Ok(Sa), + "SB" => Ok(Sb), + "SC" => Ok(Sc), + "SE" => Ok(Se), + "SG" => Ok(Sg), + "SH" => Ok(Sh), + "SI" => Ok(Si), + "SJ" => Ok(Sj), + "SK" => Ok(Sk), + "SL" => Ok(Sl), + "SM" => Ok(Sm), + "SN" => Ok(Sn), + "SO" => Ok(So), + "SR" => Ok(Sr), + "SS" => Ok(Ss), + "ST" => Ok(St), + "SV" => Ok(Sv), + "SX" => Ok(Sx), + "SZ" => Ok(Sz), + "TA" => Ok(Ta), + "TC" => Ok(Tc), + "TD" => Ok(Td), + "TF" => Ok(Tf), + "TG" => Ok(Tg), + "TH" => Ok(Th), + "TJ" => Ok(Tj), + "TK" => Ok(Tk), + "TL" => Ok(Tl), + "TM" => Ok(Tm), + "TN" => Ok(Tn), + "TO" => Ok(To), + "TR" => Ok(Tr), + "TT" => Ok(Tt), + "TV" => Ok(Tv), + "TW" => Ok(Tw), + "TZ" => Ok(Tz), + "UA" => Ok(Ua), + "UG" => Ok(Ug), + "US" => Ok(Us), + "UY" => Ok(Uy), + "UZ" => Ok(Uz), + "VA" => Ok(Va), + "VC" => Ok(Vc), + "VE" => Ok(Ve), + "VG" => Ok(Vg), + "VN" => Ok(Vn), + "VU" => Ok(Vu), + "WF" => Ok(Wf), + "WS" => Ok(Ws), + "XK" => Ok(Xk), + "YE" => Ok(Ye), + "YT" => Ok(Yt), + "ZA" => Ok(Za), + "ZM" => Ok(Zm), + "ZW" => Ok(Zw), + "ZZ" => Ok(Zz), + _ => Err(()), + } + } +} +impl std::fmt::Display for PaymentLinksResourceShippingAddressCollectionAllowedCountries { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for PaymentLinksResourceShippingAddressCollectionAllowedCountries { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for PaymentLinksResourceShippingAddressCollectionAllowedCountries { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> + for PaymentLinksResourceShippingAddressCollectionAllowedCountries +{ + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Ok(Self::from_str(&s) + .unwrap_or(PaymentLinksResourceShippingAddressCollectionAllowedCountries::Unknown)) + } +} diff --git a/generated/stripe_shared/src/payment_links_resource_shipping_option.rs b/generated/stripe_shared/src/payment_links_resource_shipping_option.rs new file mode 100644 index 000000000..b96cbd3f1 --- /dev/null +++ b/generated/stripe_shared/src/payment_links_resource_shipping_option.rs @@ -0,0 +1,7 @@ +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct PaymentLinksResourceShippingOption { + /// A non-negative integer in cents representing how much to charge. + pub shipping_amount: i64, + /// The ID of the Shipping Rate to use for this shipping option. + pub shipping_rate: stripe_types::Expandable, +} diff --git a/generated/stripe_shared/src/payment_links_resource_subscription_data.rs b/generated/stripe_shared/src/payment_links_resource_subscription_data.rs new file mode 100644 index 000000000..a176b9ff8 --- /dev/null +++ b/generated/stripe_shared/src/payment_links_resource_subscription_data.rs @@ -0,0 +1,13 @@ +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct PaymentLinksResourceSubscriptionData { + /// The subscription's description, meant to be displayable to the customer. + /// Use this field to optionally store an explanation of the subscription for rendering in Stripe surfaces and certain local payment methods UIs. + pub description: Option, + pub invoice_settings: stripe_shared::PaymentLinksResourceSubscriptionDataInvoiceSettings, + /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that will set metadata on [Subscriptions](https://stripe.com/docs/api/subscriptions) generated from this payment link. + pub metadata: std::collections::HashMap, + /// Integer representing the number of trial period days before the customer is charged for the first time. + pub trial_period_days: Option, + /// Settings related to subscription trials. + pub trial_settings: Option, +} diff --git a/generated/stripe_shared/src/payment_links_resource_subscription_data_invoice_settings.rs b/generated/stripe_shared/src/payment_links_resource_subscription_data_invoice_settings.rs new file mode 100644 index 000000000..67c6c7750 --- /dev/null +++ b/generated/stripe_shared/src/payment_links_resource_subscription_data_invoice_settings.rs @@ -0,0 +1,4 @@ +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct PaymentLinksResourceSubscriptionDataInvoiceSettings { + pub issuer: stripe_shared::ConnectAccountReference, +} diff --git a/generated/stripe_shared/src/payment_links_resource_tax_id_collection.rs b/generated/stripe_shared/src/payment_links_resource_tax_id_collection.rs new file mode 100644 index 000000000..9282ec204 --- /dev/null +++ b/generated/stripe_shared/src/payment_links_resource_tax_id_collection.rs @@ -0,0 +1,5 @@ +#[derive(Copy, Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct PaymentLinksResourceTaxIdCollection { + /// Indicates whether tax ID collection is enabled for the session. + pub enabled: bool, +} diff --git a/generated/stripe_shared/src/payment_links_resource_transfer_data.rs b/generated/stripe_shared/src/payment_links_resource_transfer_data.rs new file mode 100644 index 000000000..b6562b454 --- /dev/null +++ b/generated/stripe_shared/src/payment_links_resource_transfer_data.rs @@ -0,0 +1,8 @@ +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct PaymentLinksResourceTransferData { + /// The amount in cents (or local equivalent) that will be transferred to the destination account. + /// By default, the entire amount is transferred to the destination. + pub amount: Option, + /// The connected account receiving the transfer. + pub destination: stripe_types::Expandable, +} diff --git a/generated/stripe_shared/src/payment_method.rs b/generated/stripe_shared/src/payment_method.rs new file mode 100644 index 000000000..aa8017d45 --- /dev/null +++ b/generated/stripe_shared/src/payment_method.rs @@ -0,0 +1,265 @@ +/// PaymentMethod objects represent your customer's payment instruments. +/// You can use them with [PaymentIntents](https://stripe.com/docs/payments/payment-intents) to collect payments or save them to. +/// Customer objects to store instrument details for future payments. +/// +/// Related guides: [Payment Methods](https://stripe.com/docs/payments/payment-methods) and [More Payment Scenarios](https://stripe.com/docs/payments/more-payment-scenarios). +/// +/// For more details see <>. +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct PaymentMethod { + #[serde(skip_serializing_if = "Option::is_none")] + pub acss_debit: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub affirm: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub afterpay_clearpay: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub alipay: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub au_becs_debit: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub bacs_debit: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub bancontact: Option, + pub billing_details: stripe_shared::BillingDetails, + #[serde(skip_serializing_if = "Option::is_none")] + pub blik: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub boleto: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub card: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub card_present: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub cashapp: Option, + /// Time at which the object was created. Measured in seconds since the Unix epoch. + pub created: stripe_types::Timestamp, + /// The ID of the Customer to which this PaymentMethod is saved. + /// This will not be set when the PaymentMethod has not been saved to a Customer. + pub customer: Option>, + #[serde(skip_serializing_if = "Option::is_none")] + pub customer_balance: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub eps: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub fpx: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub giropay: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub grabpay: Option, + /// Unique identifier for the object. + pub id: stripe_shared::PaymentMethodId, + #[serde(skip_serializing_if = "Option::is_none")] + pub ideal: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub interac_present: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub klarna: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub konbini: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub link: Option, + /// Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + pub livemode: bool, + /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. + /// This can be useful for storing additional information about the object in a structured format. + pub metadata: Option>, + #[serde(skip_serializing_if = "Option::is_none")] + pub oxxo: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub p24: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub paynow: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub paypal: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub pix: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub promptpay: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub radar_options: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub revolut_pay: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub sepa_debit: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub sofort: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub swish: Option, + /// The type of the PaymentMethod. + /// An additional hash is included on the PaymentMethod with a name matching this value. + /// It contains additional information specific to the PaymentMethod type. + #[serde(rename = "type")] + pub type_: PaymentMethodType, + #[serde(skip_serializing_if = "Option::is_none")] + pub us_bank_account: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub wechat_pay: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub zip: Option, +} +/// The type of the PaymentMethod. +/// An additional hash is included on the PaymentMethod with a name matching this value. +/// It contains additional information specific to the PaymentMethod type. +#[derive(Copy, Clone, Eq, PartialEq)] +#[non_exhaustive] +pub enum PaymentMethodType { + AcssDebit, + Affirm, + AfterpayClearpay, + Alipay, + AuBecsDebit, + BacsDebit, + Bancontact, + Blik, + Boleto, + Card, + CardPresent, + Cashapp, + CustomerBalance, + Eps, + Fpx, + Giropay, + Grabpay, + Ideal, + InteracPresent, + Klarna, + Konbini, + Link, + Oxxo, + P24, + Paynow, + Paypal, + Pix, + Promptpay, + RevolutPay, + SepaDebit, + Sofort, + Swish, + UsBankAccount, + WechatPay, + Zip, + /// An unrecognized value from Stripe. Should not be used as a request parameter. + Unknown, +} +impl PaymentMethodType { + pub fn as_str(self) -> &'static str { + use PaymentMethodType::*; + match self { + AcssDebit => "acss_debit", + Affirm => "affirm", + AfterpayClearpay => "afterpay_clearpay", + Alipay => "alipay", + AuBecsDebit => "au_becs_debit", + BacsDebit => "bacs_debit", + Bancontact => "bancontact", + Blik => "blik", + Boleto => "boleto", + Card => "card", + CardPresent => "card_present", + Cashapp => "cashapp", + CustomerBalance => "customer_balance", + Eps => "eps", + Fpx => "fpx", + Giropay => "giropay", + Grabpay => "grabpay", + Ideal => "ideal", + InteracPresent => "interac_present", + Klarna => "klarna", + Konbini => "konbini", + Link => "link", + Oxxo => "oxxo", + P24 => "p24", + Paynow => "paynow", + Paypal => "paypal", + Pix => "pix", + Promptpay => "promptpay", + RevolutPay => "revolut_pay", + SepaDebit => "sepa_debit", + Sofort => "sofort", + Swish => "swish", + UsBankAccount => "us_bank_account", + WechatPay => "wechat_pay", + Zip => "zip", + Unknown => "unknown", + } + } +} + +impl std::str::FromStr for PaymentMethodType { + type Err = (); + fn from_str(s: &str) -> Result { + use PaymentMethodType::*; + match s { + "acss_debit" => Ok(AcssDebit), + "affirm" => Ok(Affirm), + "afterpay_clearpay" => Ok(AfterpayClearpay), + "alipay" => Ok(Alipay), + "au_becs_debit" => Ok(AuBecsDebit), + "bacs_debit" => Ok(BacsDebit), + "bancontact" => Ok(Bancontact), + "blik" => Ok(Blik), + "boleto" => Ok(Boleto), + "card" => Ok(Card), + "card_present" => Ok(CardPresent), + "cashapp" => Ok(Cashapp), + "customer_balance" => Ok(CustomerBalance), + "eps" => Ok(Eps), + "fpx" => Ok(Fpx), + "giropay" => Ok(Giropay), + "grabpay" => Ok(Grabpay), + "ideal" => Ok(Ideal), + "interac_present" => Ok(InteracPresent), + "klarna" => Ok(Klarna), + "konbini" => Ok(Konbini), + "link" => Ok(Link), + "oxxo" => Ok(Oxxo), + "p24" => Ok(P24), + "paynow" => Ok(Paynow), + "paypal" => Ok(Paypal), + "pix" => Ok(Pix), + "promptpay" => Ok(Promptpay), + "revolut_pay" => Ok(RevolutPay), + "sepa_debit" => Ok(SepaDebit), + "sofort" => Ok(Sofort), + "swish" => Ok(Swish), + "us_bank_account" => Ok(UsBankAccount), + "wechat_pay" => Ok(WechatPay), + "zip" => Ok(Zip), + _ => Err(()), + } + } +} +impl std::fmt::Display for PaymentMethodType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for PaymentMethodType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for PaymentMethodType { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for PaymentMethodType { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Ok(Self::from_str(&s).unwrap_or(PaymentMethodType::Unknown)) + } +} +impl stripe_types::Object for PaymentMethod { + type Id = stripe_shared::PaymentMethodId; + fn id(&self) -> &Self::Id { + &self.id + } +} +stripe_types::def_id!(PaymentMethodId, "pm_" | "card_" | "src_" | "ba_"); diff --git a/generated/stripe_shared/src/payment_method_acss_debit.rs b/generated/stripe_shared/src/payment_method_acss_debit.rs new file mode 100644 index 000000000..cf687891c --- /dev/null +++ b/generated/stripe_shared/src/payment_method_acss_debit.rs @@ -0,0 +1,14 @@ +#[derive(Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct PaymentMethodAcssDebit { + /// Name of the bank associated with the bank account. + pub bank_name: Option, + /// Uniquely identifies this particular bank account. + /// You can use this attribute to check whether two bank accounts are the same. + pub fingerprint: Option, + /// Institution number of the bank account. + pub institution_number: Option, + /// Last four digits of the bank account number. + pub last4: Option, + /// Transit number of the bank account. + pub transit_number: Option, +} diff --git a/generated/stripe_shared/src/payment_method_affirm.rs b/generated/stripe_shared/src/payment_method_affirm.rs new file mode 100644 index 000000000..21482a272 --- /dev/null +++ b/generated/stripe_shared/src/payment_method_affirm.rs @@ -0,0 +1,2 @@ +#[derive(Copy, Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct PaymentMethodAffirm {} diff --git a/generated/stripe_shared/src/payment_method_afterpay_clearpay.rs b/generated/stripe_shared/src/payment_method_afterpay_clearpay.rs new file mode 100644 index 000000000..4a9cbd897 --- /dev/null +++ b/generated/stripe_shared/src/payment_method_afterpay_clearpay.rs @@ -0,0 +1,2 @@ +#[derive(Copy, Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct PaymentMethodAfterpayClearpay {} diff --git a/generated/stripe_shared/src/payment_method_au_becs_debit.rs b/generated/stripe_shared/src/payment_method_au_becs_debit.rs new file mode 100644 index 000000000..a25c416ee --- /dev/null +++ b/generated/stripe_shared/src/payment_method_au_becs_debit.rs @@ -0,0 +1,10 @@ +#[derive(Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct PaymentMethodAuBecsDebit { + /// Six-digit number identifying bank and branch associated with this bank account. + pub bsb_number: Option, + /// Uniquely identifies this particular bank account. + /// You can use this attribute to check whether two bank accounts are the same. + pub fingerprint: Option, + /// Last four digits of the bank account number. + pub last4: Option, +} diff --git a/generated/stripe_shared/src/payment_method_bacs_debit.rs b/generated/stripe_shared/src/payment_method_bacs_debit.rs new file mode 100644 index 000000000..fe3ee850c --- /dev/null +++ b/generated/stripe_shared/src/payment_method_bacs_debit.rs @@ -0,0 +1,10 @@ +#[derive(Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct PaymentMethodBacsDebit { + /// Uniquely identifies this particular bank account. + /// You can use this attribute to check whether two bank accounts are the same. + pub fingerprint: Option, + /// Last four digits of the bank account number. + pub last4: Option, + /// Sort code of the bank account. (e.g., `10-20-30`) + pub sort_code: Option, +} diff --git a/generated/stripe_shared/src/payment_method_bancontact.rs b/generated/stripe_shared/src/payment_method_bancontact.rs new file mode 100644 index 000000000..8c7d8a5b9 --- /dev/null +++ b/generated/stripe_shared/src/payment_method_bancontact.rs @@ -0,0 +1,2 @@ +#[derive(Copy, Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct PaymentMethodBancontact {} diff --git a/generated/stripe_shared/src/payment_method_blik.rs b/generated/stripe_shared/src/payment_method_blik.rs new file mode 100644 index 000000000..f89a95af6 --- /dev/null +++ b/generated/stripe_shared/src/payment_method_blik.rs @@ -0,0 +1,2 @@ +#[derive(Copy, Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct PaymentMethodBlik {} diff --git a/generated/stripe_shared/src/payment_method_boleto.rs b/generated/stripe_shared/src/payment_method_boleto.rs new file mode 100644 index 000000000..7d42b3261 --- /dev/null +++ b/generated/stripe_shared/src/payment_method_boleto.rs @@ -0,0 +1,5 @@ +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct PaymentMethodBoleto { + /// Uniquely identifies the customer tax id (CNPJ or CPF) + pub tax_id: String, +} diff --git a/generated/stripe_shared/src/payment_method_card.rs b/generated/stripe_shared/src/payment_method_card.rs new file mode 100644 index 000000000..b9ca4b3ac --- /dev/null +++ b/generated/stripe_shared/src/payment_method_card.rs @@ -0,0 +1,44 @@ +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct PaymentMethodCard { + /// Card brand. + /// Can be `amex`, `diners`, `discover`, `eftpos_au`, `jcb`, `mastercard`, `unionpay`, `visa`, or `unknown`. + pub brand: String, + /// Checks on Card address and CVC if provided. + pub checks: Option, + /// Two-letter ISO code representing the country of the card. + /// You could use this attribute to get a sense of the international breakdown of cards you've collected. + pub country: Option, + /// A high-level description of the type of cards issued in this range. + /// (For internal use only and not typically available in standard API requests.). + #[serde(skip_serializing_if = "Option::is_none")] + pub description: Option, + /// Two-digit number representing the card's expiration month. + pub exp_month: i64, + /// Four-digit number representing the card's expiration year. + pub exp_year: i64, + /// Uniquely identifies this particular card number. + /// You can use this attribute to check whether two customers who’ve signed up with you are using the same card number, for example. + /// For payment methods that tokenize card information (Apple Pay, Google Pay), the tokenized number might be provided instead of the underlying card number. + /// + /// *As of May 1, 2021, card fingerprint in India for Connect changed to allow two fingerprints for the same card---one for India and one for the rest of the world.*. + #[serde(skip_serializing_if = "Option::is_none")] + pub fingerprint: Option, + /// Card funding type. Can be `credit`, `debit`, `prepaid`, or `unknown`. + pub funding: String, + /// Issuer identification number of the card. + /// (For internal use only and not typically available in standard API requests.). + #[serde(skip_serializing_if = "Option::is_none")] + pub iin: Option, + /// The name of the card's issuing bank. + /// (For internal use only and not typically available in standard API requests.). + #[serde(skip_serializing_if = "Option::is_none")] + pub issuer: Option, + /// The last four digits of the card. + pub last4: String, + /// Contains information about card networks that can be used to process the payment. + pub networks: Option, + /// Contains details on how this Card may be used for 3D Secure authentication. + pub three_d_secure_usage: Option, + /// If this Card is part of a card wallet, this contains the details of the card wallet. + pub wallet: Option, +} diff --git a/generated/stripe_shared/src/payment_method_card_checks.rs b/generated/stripe_shared/src/payment_method_card_checks.rs new file mode 100644 index 000000000..4d44d424b --- /dev/null +++ b/generated/stripe_shared/src/payment_method_card_checks.rs @@ -0,0 +1,9 @@ +#[derive(Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct PaymentMethodCardChecks { + /// If a address line1 was provided, results of the check, one of `pass`, `fail`, `unavailable`, or `unchecked`. + pub address_line1_check: Option, + /// If a address postal code was provided, results of the check, one of `pass`, `fail`, `unavailable`, or `unchecked`. + pub address_postal_code_check: Option, + /// If a CVC was provided, results of the check, one of `pass`, `fail`, `unavailable`, or `unchecked`. + pub cvc_check: Option, +} diff --git a/generated/stripe_shared/src/payment_method_card_present.rs b/generated/stripe_shared/src/payment_method_card_present.rs new file mode 100644 index 000000000..7777c00da --- /dev/null +++ b/generated/stripe_shared/src/payment_method_card_present.rs @@ -0,0 +1,108 @@ +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct PaymentMethodCardPresent { + /// Card brand. + /// Can be `amex`, `diners`, `discover`, `eftpos_au`, `jcb`, `mastercard`, `unionpay`, `visa`, or `unknown`. + pub brand: Option, + /// The cardholder name as read from the card, in [ISO 7813](https://en.wikipedia.org/wiki/ISO/IEC_7813) format. + /// May include alphanumeric characters, special characters and first/last name separator (`/`). + /// In some cases, the cardholder name may not be available depending on how the issuer has configured the card. + /// Cardholder name is typically not available on swipe or contactless payments, such as those made with Apple Pay and Google Pay. + pub cardholder_name: Option, + /// Two-letter ISO code representing the country of the card. + /// You could use this attribute to get a sense of the international breakdown of cards you've collected. + pub country: Option, + /// A high-level description of the type of cards issued in this range. + /// (For internal use only and not typically available in standard API requests.). + #[serde(skip_serializing_if = "Option::is_none")] + pub description: Option, + /// Two-digit number representing the card's expiration month. + pub exp_month: i64, + /// Four-digit number representing the card's expiration year. + pub exp_year: i64, + /// Uniquely identifies this particular card number. + /// You can use this attribute to check whether two customers who’ve signed up with you are using the same card number, for example. + /// For payment methods that tokenize card information (Apple Pay, Google Pay), the tokenized number might be provided instead of the underlying card number. + /// + /// *As of May 1, 2021, card fingerprint in India for Connect changed to allow two fingerprints for the same card---one for India and one for the rest of the world.*. + pub fingerprint: Option, + /// Card funding type. Can be `credit`, `debit`, `prepaid`, or `unknown`. + pub funding: Option, + /// Issuer identification number of the card. + /// (For internal use only and not typically available in standard API requests.). + #[serde(skip_serializing_if = "Option::is_none")] + pub iin: Option, + /// The name of the card's issuing bank. + /// (For internal use only and not typically available in standard API requests.). + #[serde(skip_serializing_if = "Option::is_none")] + pub issuer: Option, + /// The last four digits of the card. + pub last4: Option, + /// Contains information about card networks that can be used to process the payment. + pub networks: Option, + /// How card details were read in this transaction. + pub read_method: Option, +} +/// How card details were read in this transaction. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum PaymentMethodCardPresentReadMethod { + ContactEmv, + ContactlessEmv, + ContactlessMagstripeMode, + MagneticStripeFallback, + MagneticStripeTrack2, +} +impl PaymentMethodCardPresentReadMethod { + pub fn as_str(self) -> &'static str { + use PaymentMethodCardPresentReadMethod::*; + match self { + ContactEmv => "contact_emv", + ContactlessEmv => "contactless_emv", + ContactlessMagstripeMode => "contactless_magstripe_mode", + MagneticStripeFallback => "magnetic_stripe_fallback", + MagneticStripeTrack2 => "magnetic_stripe_track2", + } + } +} + +impl std::str::FromStr for PaymentMethodCardPresentReadMethod { + type Err = (); + fn from_str(s: &str) -> Result { + use PaymentMethodCardPresentReadMethod::*; + match s { + "contact_emv" => Ok(ContactEmv), + "contactless_emv" => Ok(ContactlessEmv), + "contactless_magstripe_mode" => Ok(ContactlessMagstripeMode), + "magnetic_stripe_fallback" => Ok(MagneticStripeFallback), + "magnetic_stripe_track2" => Ok(MagneticStripeTrack2), + _ => Err(()), + } + } +} +impl std::fmt::Display for PaymentMethodCardPresentReadMethod { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for PaymentMethodCardPresentReadMethod { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for PaymentMethodCardPresentReadMethod { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for PaymentMethodCardPresentReadMethod { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| { + serde::de::Error::custom("Unknown value for PaymentMethodCardPresentReadMethod") + }) + } +} diff --git a/generated/stripe_shared/src/payment_method_card_present_networks.rs b/generated/stripe_shared/src/payment_method_card_present_networks.rs new file mode 100644 index 000000000..6385e724c --- /dev/null +++ b/generated/stripe_shared/src/payment_method_card_present_networks.rs @@ -0,0 +1,7 @@ +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct PaymentMethodCardPresentNetworks { + /// All available networks for the card. + pub available: Vec, + /// The preferred network for the card. + pub preferred: Option, +} diff --git a/generated/stripe_shared/src/payment_method_card_wallet.rs b/generated/stripe_shared/src/payment_method_card_wallet.rs new file mode 100644 index 000000000..8dec84790 --- /dev/null +++ b/generated/stripe_shared/src/payment_method_card_wallet.rs @@ -0,0 +1,95 @@ +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct PaymentMethodCardWallet { + #[serde(skip_serializing_if = "Option::is_none")] + pub amex_express_checkout: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub apple_pay: Option, + /// (For tokenized numbers only.) The last four digits of the device account number. + pub dynamic_last4: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub google_pay: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub link: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub masterpass: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub samsung_pay: Option, + /// The type of the card wallet, one of `amex_express_checkout`, `apple_pay`, `google_pay`, `masterpass`, `samsung_pay`, `visa_checkout`, or `link`. + /// An additional hash is included on the Wallet subhash with a name matching this value. + /// It contains additional information specific to the card wallet type. + #[serde(rename = "type")] + pub type_: PaymentMethodCardWalletType, + #[serde(skip_serializing_if = "Option::is_none")] + pub visa_checkout: Option, +} +/// The type of the card wallet, one of `amex_express_checkout`, `apple_pay`, `google_pay`, `masterpass`, `samsung_pay`, `visa_checkout`, or `link`. +/// An additional hash is included on the Wallet subhash with a name matching this value. +/// It contains additional information specific to the card wallet type. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum PaymentMethodCardWalletType { + AmexExpressCheckout, + ApplePay, + GooglePay, + Link, + Masterpass, + SamsungPay, + VisaCheckout, +} +impl PaymentMethodCardWalletType { + pub fn as_str(self) -> &'static str { + use PaymentMethodCardWalletType::*; + match self { + AmexExpressCheckout => "amex_express_checkout", + ApplePay => "apple_pay", + GooglePay => "google_pay", + Link => "link", + Masterpass => "masterpass", + SamsungPay => "samsung_pay", + VisaCheckout => "visa_checkout", + } + } +} + +impl std::str::FromStr for PaymentMethodCardWalletType { + type Err = (); + fn from_str(s: &str) -> Result { + use PaymentMethodCardWalletType::*; + match s { + "amex_express_checkout" => Ok(AmexExpressCheckout), + "apple_pay" => Ok(ApplePay), + "google_pay" => Ok(GooglePay), + "link" => Ok(Link), + "masterpass" => Ok(Masterpass), + "samsung_pay" => Ok(SamsungPay), + "visa_checkout" => Ok(VisaCheckout), + _ => Err(()), + } + } +} +impl std::fmt::Display for PaymentMethodCardWalletType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for PaymentMethodCardWalletType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for PaymentMethodCardWalletType { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for PaymentMethodCardWalletType { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s) + .map_err(|_| serde::de::Error::custom("Unknown value for PaymentMethodCardWalletType")) + } +} diff --git a/generated/stripe_shared/src/payment_method_card_wallet_amex_express_checkout.rs b/generated/stripe_shared/src/payment_method_card_wallet_amex_express_checkout.rs new file mode 100644 index 000000000..e96dafb68 --- /dev/null +++ b/generated/stripe_shared/src/payment_method_card_wallet_amex_express_checkout.rs @@ -0,0 +1,2 @@ +#[derive(Copy, Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct PaymentMethodCardWalletAmexExpressCheckout {} diff --git a/generated/stripe_shared/src/payment_method_card_wallet_apple_pay.rs b/generated/stripe_shared/src/payment_method_card_wallet_apple_pay.rs new file mode 100644 index 000000000..9948e0e45 --- /dev/null +++ b/generated/stripe_shared/src/payment_method_card_wallet_apple_pay.rs @@ -0,0 +1,2 @@ +#[derive(Copy, Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct PaymentMethodCardWalletApplePay {} diff --git a/generated/stripe_shared/src/payment_method_card_wallet_google_pay.rs b/generated/stripe_shared/src/payment_method_card_wallet_google_pay.rs new file mode 100644 index 000000000..c7282dd73 --- /dev/null +++ b/generated/stripe_shared/src/payment_method_card_wallet_google_pay.rs @@ -0,0 +1,2 @@ +#[derive(Copy, Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct PaymentMethodCardWalletGooglePay {} diff --git a/generated/stripe_shared/src/payment_method_card_wallet_link.rs b/generated/stripe_shared/src/payment_method_card_wallet_link.rs new file mode 100644 index 000000000..ba0b9d736 --- /dev/null +++ b/generated/stripe_shared/src/payment_method_card_wallet_link.rs @@ -0,0 +1,2 @@ +#[derive(Copy, Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct PaymentMethodCardWalletLink {} diff --git a/generated/stripe_shared/src/payment_method_card_wallet_masterpass.rs b/generated/stripe_shared/src/payment_method_card_wallet_masterpass.rs new file mode 100644 index 000000000..281b61fb8 --- /dev/null +++ b/generated/stripe_shared/src/payment_method_card_wallet_masterpass.rs @@ -0,0 +1,19 @@ +#[derive(Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct PaymentMethodCardWalletMasterpass { + /// Owner's verified billing address. + /// Values are verified or provided by the wallet directly (if supported) at the time of authorization or settlement. + /// They cannot be set or mutated. + pub billing_address: Option, + /// Owner's verified email. + /// Values are verified or provided by the wallet directly (if supported) at the time of authorization or settlement. + /// They cannot be set or mutated. + pub email: Option, + /// Owner's verified full name. + /// Values are verified or provided by the wallet directly (if supported) at the time of authorization or settlement. + /// They cannot be set or mutated. + pub name: Option, + /// Owner's verified shipping address. + /// Values are verified or provided by the wallet directly (if supported) at the time of authorization or settlement. + /// They cannot be set or mutated. + pub shipping_address: Option, +} diff --git a/generated/stripe_shared/src/payment_method_card_wallet_samsung_pay.rs b/generated/stripe_shared/src/payment_method_card_wallet_samsung_pay.rs new file mode 100644 index 000000000..e015c6843 --- /dev/null +++ b/generated/stripe_shared/src/payment_method_card_wallet_samsung_pay.rs @@ -0,0 +1,2 @@ +#[derive(Copy, Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct PaymentMethodCardWalletSamsungPay {} diff --git a/generated/stripe_shared/src/payment_method_card_wallet_visa_checkout.rs b/generated/stripe_shared/src/payment_method_card_wallet_visa_checkout.rs new file mode 100644 index 000000000..ff4dfe3ec --- /dev/null +++ b/generated/stripe_shared/src/payment_method_card_wallet_visa_checkout.rs @@ -0,0 +1,19 @@ +#[derive(Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct PaymentMethodCardWalletVisaCheckout { + /// Owner's verified billing address. + /// Values are verified or provided by the wallet directly (if supported) at the time of authorization or settlement. + /// They cannot be set or mutated. + pub billing_address: Option, + /// Owner's verified email. + /// Values are verified or provided by the wallet directly (if supported) at the time of authorization or settlement. + /// They cannot be set or mutated. + pub email: Option, + /// Owner's verified full name. + /// Values are verified or provided by the wallet directly (if supported) at the time of authorization or settlement. + /// They cannot be set or mutated. + pub name: Option, + /// Owner's verified shipping address. + /// Values are verified or provided by the wallet directly (if supported) at the time of authorization or settlement. + /// They cannot be set or mutated. + pub shipping_address: Option, +} diff --git a/generated/stripe_shared/src/payment_method_cashapp.rs b/generated/stripe_shared/src/payment_method_cashapp.rs new file mode 100644 index 000000000..f2d838cc6 --- /dev/null +++ b/generated/stripe_shared/src/payment_method_cashapp.rs @@ -0,0 +1,7 @@ +#[derive(Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct PaymentMethodCashapp { + /// A unique and immutable identifier assigned by Cash App to every buyer. + pub buyer_id: Option, + /// A public identifier for buyers using Cash App. + pub cashtag: Option, +} diff --git a/generated/stripe_shared/src/payment_method_config_biz_payment_method_configuration_details.rs b/generated/stripe_shared/src/payment_method_config_biz_payment_method_configuration_details.rs new file mode 100644 index 000000000..58c432f62 --- /dev/null +++ b/generated/stripe_shared/src/payment_method_config_biz_payment_method_configuration_details.rs @@ -0,0 +1,7 @@ +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct PaymentMethodConfigBizPaymentMethodConfigurationDetails { + /// ID of the payment method configuration used. + pub id: String, + /// ID of the parent payment method configuration used. + pub parent: Option, +} diff --git a/generated/stripe_shared/src/payment_method_customer_balance.rs b/generated/stripe_shared/src/payment_method_customer_balance.rs new file mode 100644 index 000000000..6e1cd2152 --- /dev/null +++ b/generated/stripe_shared/src/payment_method_customer_balance.rs @@ -0,0 +1,2 @@ +#[derive(Copy, Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct PaymentMethodCustomerBalance {} diff --git a/generated/stripe_shared/src/payment_method_details.rs b/generated/stripe_shared/src/payment_method_details.rs new file mode 100644 index 000000000..bcb6ce6ba --- /dev/null +++ b/generated/stripe_shared/src/payment_method_details.rs @@ -0,0 +1,90 @@ +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct PaymentMethodDetails { + #[serde(skip_serializing_if = "Option::is_none")] + pub ach_credit_transfer: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub ach_debit: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub acss_debit: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub affirm: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub afterpay_clearpay: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub alipay: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub au_becs_debit: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub bacs_debit: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub bancontact: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub blik: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub boleto: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub card: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub card_present: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub cashapp: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub customer_balance: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub eps: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub fpx: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub giropay: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub grabpay: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub ideal: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub interac_present: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub klarna: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub konbini: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub link: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub multibanco: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub oxxo: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub p24: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub paynow: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub paypal: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub pix: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub promptpay: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub revolut_pay: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub sepa_credit_transfer: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub sepa_debit: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub sofort: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub stripe_account: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub swish: Option, + /// The type of transaction-specific details of the payment method used in the payment, one of `ach_credit_transfer`, `ach_debit`, `acss_debit`, `alipay`, `au_becs_debit`, `bancontact`, `card`, `card_present`, `eps`, `giropay`, `ideal`, `klarna`, `multibanco`, `p24`, `sepa_debit`, `sofort`, `stripe_account`, or `wechat`. + /// An additional hash is included on `payment_method_details` with a name matching this value. + /// It contains information specific to the payment method. + #[serde(rename = "type")] + pub type_: String, + #[serde(skip_serializing_if = "Option::is_none")] + pub us_bank_account: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub wechat: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub wechat_pay: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub zip: Option, +} diff --git a/generated/stripe_shared/src/payment_method_details_ach_credit_transfer.rs b/generated/stripe_shared/src/payment_method_details_ach_credit_transfer.rs new file mode 100644 index 000000000..be72e0222 --- /dev/null +++ b/generated/stripe_shared/src/payment_method_details_ach_credit_transfer.rs @@ -0,0 +1,11 @@ +#[derive(Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct PaymentMethodDetailsAchCreditTransfer { + /// Account number to transfer funds to. + pub account_number: Option, + /// Name of the bank associated with the routing number. + pub bank_name: Option, + /// Routing transit number for the bank account to transfer funds to. + pub routing_number: Option, + /// SWIFT code of the bank associated with the routing number. + pub swift_code: Option, +} diff --git a/generated/stripe_shared/src/payment_method_details_ach_debit.rs b/generated/stripe_shared/src/payment_method_details_ach_debit.rs new file mode 100644 index 000000000..1e41479cc --- /dev/null +++ b/generated/stripe_shared/src/payment_method_details_ach_debit.rs @@ -0,0 +1,73 @@ +#[derive(Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct PaymentMethodDetailsAchDebit { + /// Type of entity that holds the account. This can be either `individual` or `company`. + pub account_holder_type: Option, + /// Name of the bank associated with the bank account. + pub bank_name: Option, + /// Two-letter ISO code representing the country the bank account is located in. + pub country: Option, + /// Uniquely identifies this particular bank account. + /// You can use this attribute to check whether two bank accounts are the same. + pub fingerprint: Option, + /// Last four digits of the bank account number. + pub last4: Option, + /// Routing transit number of the bank account. + pub routing_number: Option, +} +/// Type of entity that holds the account. This can be either `individual` or `company`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum PaymentMethodDetailsAchDebitAccountHolderType { + Company, + Individual, +} +impl PaymentMethodDetailsAchDebitAccountHolderType { + pub fn as_str(self) -> &'static str { + use PaymentMethodDetailsAchDebitAccountHolderType::*; + match self { + Company => "company", + Individual => "individual", + } + } +} + +impl std::str::FromStr for PaymentMethodDetailsAchDebitAccountHolderType { + type Err = (); + fn from_str(s: &str) -> Result { + use PaymentMethodDetailsAchDebitAccountHolderType::*; + match s { + "company" => Ok(Company), + "individual" => Ok(Individual), + _ => Err(()), + } + } +} +impl std::fmt::Display for PaymentMethodDetailsAchDebitAccountHolderType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for PaymentMethodDetailsAchDebitAccountHolderType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for PaymentMethodDetailsAchDebitAccountHolderType { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for PaymentMethodDetailsAchDebitAccountHolderType { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| { + serde::de::Error::custom( + "Unknown value for PaymentMethodDetailsAchDebitAccountHolderType", + ) + }) + } +} diff --git a/generated/stripe_shared/src/payment_method_details_acss_debit.rs b/generated/stripe_shared/src/payment_method_details_acss_debit.rs new file mode 100644 index 000000000..c9f1f96f3 --- /dev/null +++ b/generated/stripe_shared/src/payment_method_details_acss_debit.rs @@ -0,0 +1,17 @@ +#[derive(Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct PaymentMethodDetailsAcssDebit { + /// Name of the bank associated with the bank account. + pub bank_name: Option, + /// Uniquely identifies this particular bank account. + /// You can use this attribute to check whether two bank accounts are the same. + pub fingerprint: Option, + /// Institution number of the bank account + pub institution_number: Option, + /// Last four digits of the bank account number. + pub last4: Option, + /// ID of the mandate used to make this payment. + #[serde(skip_serializing_if = "Option::is_none")] + pub mandate: Option, + /// Transit number of the bank account. + pub transit_number: Option, +} diff --git a/generated/stripe_shared/src/payment_method_details_affirm.rs b/generated/stripe_shared/src/payment_method_details_affirm.rs new file mode 100644 index 000000000..e88966e31 --- /dev/null +++ b/generated/stripe_shared/src/payment_method_details_affirm.rs @@ -0,0 +1,2 @@ +#[derive(Copy, Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct PaymentMethodDetailsAffirm {} diff --git a/generated/stripe_shared/src/payment_method_details_afterpay_clearpay.rs b/generated/stripe_shared/src/payment_method_details_afterpay_clearpay.rs new file mode 100644 index 000000000..a03a3296f --- /dev/null +++ b/generated/stripe_shared/src/payment_method_details_afterpay_clearpay.rs @@ -0,0 +1,7 @@ +#[derive(Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct PaymentMethodDetailsAfterpayClearpay { + /// The Afterpay order ID associated with this payment intent. + pub order_id: Option, + /// Order identifier shown to the merchant in Afterpay’s online portal. + pub reference: Option, +} diff --git a/generated/stripe_shared/src/payment_method_details_au_becs_debit.rs b/generated/stripe_shared/src/payment_method_details_au_becs_debit.rs new file mode 100644 index 000000000..bd8d92351 --- /dev/null +++ b/generated/stripe_shared/src/payment_method_details_au_becs_debit.rs @@ -0,0 +1,13 @@ +#[derive(Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct PaymentMethodDetailsAuBecsDebit { + /// Bank-State-Branch number of the bank account. + pub bsb_number: Option, + /// Uniquely identifies this particular bank account. + /// You can use this attribute to check whether two bank accounts are the same. + pub fingerprint: Option, + /// Last four digits of the bank account number. + pub last4: Option, + /// ID of the mandate used to make this payment. + #[serde(skip_serializing_if = "Option::is_none")] + pub mandate: Option, +} diff --git a/generated/stripe_shared/src/payment_method_details_bacs_debit.rs b/generated/stripe_shared/src/payment_method_details_bacs_debit.rs new file mode 100644 index 000000000..9d0e77bfe --- /dev/null +++ b/generated/stripe_shared/src/payment_method_details_bacs_debit.rs @@ -0,0 +1,12 @@ +#[derive(Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct PaymentMethodDetailsBacsDebit { + /// Uniquely identifies this particular bank account. + /// You can use this attribute to check whether two bank accounts are the same. + pub fingerprint: Option, + /// Last four digits of the bank account number. + pub last4: Option, + /// ID of the mandate used to make this payment. + pub mandate: Option, + /// Sort code of the bank account. (e.g., `10-20-30`) + pub sort_code: Option, +} diff --git a/generated/stripe_shared/src/payment_method_details_bancontact.rs b/generated/stripe_shared/src/payment_method_details_bancontact.rs new file mode 100644 index 000000000..f0948896c --- /dev/null +++ b/generated/stripe_shared/src/payment_method_details_bancontact.rs @@ -0,0 +1,85 @@ +#[derive(Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct PaymentMethodDetailsBancontact { + /// Bank code of bank associated with the bank account. + pub bank_code: Option, + /// Name of the bank associated with the bank account. + pub bank_name: Option, + /// Bank Identifier Code of the bank associated with the bank account. + pub bic: Option, + /// The ID of the SEPA Direct Debit PaymentMethod which was generated by this Charge. + pub generated_sepa_debit: Option>, + /// The mandate for the SEPA Direct Debit PaymentMethod which was generated by this Charge. + pub generated_sepa_debit_mandate: Option>, + /// Last four characters of the IBAN. + pub iban_last4: Option, + /// Preferred language of the Bancontact authorization page that the customer is redirected to. + /// Can be one of `en`, `de`, `fr`, or `nl` + pub preferred_language: Option, + /// Owner's verified full name. Values are verified or provided by Bancontact directly + /// (if supported) at the time of authorization or settlement. They cannot be set or mutated. + pub verified_name: Option, +} +/// Preferred language of the Bancontact authorization page that the customer is redirected to. +/// Can be one of `en`, `de`, `fr`, or `nl` +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum PaymentMethodDetailsBancontactPreferredLanguage { + De, + En, + Fr, + Nl, +} +impl PaymentMethodDetailsBancontactPreferredLanguage { + pub fn as_str(self) -> &'static str { + use PaymentMethodDetailsBancontactPreferredLanguage::*; + match self { + De => "de", + En => "en", + Fr => "fr", + Nl => "nl", + } + } +} + +impl std::str::FromStr for PaymentMethodDetailsBancontactPreferredLanguage { + type Err = (); + fn from_str(s: &str) -> Result { + use PaymentMethodDetailsBancontactPreferredLanguage::*; + match s { + "de" => Ok(De), + "en" => Ok(En), + "fr" => Ok(Fr), + "nl" => Ok(Nl), + _ => Err(()), + } + } +} +impl std::fmt::Display for PaymentMethodDetailsBancontactPreferredLanguage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for PaymentMethodDetailsBancontactPreferredLanguage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for PaymentMethodDetailsBancontactPreferredLanguage { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for PaymentMethodDetailsBancontactPreferredLanguage { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| { + serde::de::Error::custom( + "Unknown value for PaymentMethodDetailsBancontactPreferredLanguage", + ) + }) + } +} diff --git a/generated/stripe_shared/src/payment_method_details_blik.rs b/generated/stripe_shared/src/payment_method_details_blik.rs new file mode 100644 index 000000000..d19223ff9 --- /dev/null +++ b/generated/stripe_shared/src/payment_method_details_blik.rs @@ -0,0 +1,2 @@ +#[derive(Copy, Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct PaymentMethodDetailsBlik {} diff --git a/generated/stripe_shared/src/payment_method_details_boleto.rs b/generated/stripe_shared/src/payment_method_details_boleto.rs new file mode 100644 index 000000000..ef12f5e3f --- /dev/null +++ b/generated/stripe_shared/src/payment_method_details_boleto.rs @@ -0,0 +1,5 @@ +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct PaymentMethodDetailsBoleto { + /// The tax ID of the customer (CPF for individuals consumers or CNPJ for businesses consumers) + pub tax_id: String, +} diff --git a/generated/stripe_shared/src/payment_method_details_card.rs b/generated/stripe_shared/src/payment_method_details_card.rs new file mode 100644 index 000000000..01f4e216c --- /dev/null +++ b/generated/stripe_shared/src/payment_method_details_card.rs @@ -0,0 +1,71 @@ +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct PaymentMethodDetailsCard { + /// The authorized amount. +pub amount_authorized: Option, + /// Card brand. + /// Can be `amex`, `diners`, `discover`, `eftpos_au`, `jcb`, `mastercard`, `unionpay`, `visa`, or `unknown`. +pub brand: Option, + /// When using manual capture, a future timestamp at which the charge will be automatically refunded if uncaptured. +#[serde(skip_serializing_if = "Option::is_none")] +pub capture_before: Option, + /// Check results by Card networks on Card address and CVC at time of payment. +pub checks: Option, + /// Two-letter ISO code representing the country of the card. + /// You could use this attribute to get a sense of the international breakdown of cards you've collected. +pub country: Option, + /// A high-level description of the type of cards issued in this range. + /// (For internal use only and not typically available in standard API requests.). +#[serde(skip_serializing_if = "Option::is_none")] +pub description: Option, + /// Two-digit number representing the card's expiration month. +pub exp_month: i64, + /// Four-digit number representing the card's expiration year. +pub exp_year: i64, +#[serde(skip_serializing_if = "Option::is_none")] +pub extended_authorization: Option, + /// Uniquely identifies this particular card number. + /// You can use this attribute to check whether two customers who’ve signed up with you are using the same card number, for example. + /// For payment methods that tokenize card information (Apple Pay, Google Pay), the tokenized number might be provided instead of the underlying card number. + /// + /// *As of May 1, 2021, card fingerprint in India for Connect changed to allow two fingerprints for the same card---one for India and one for the rest of the world.*. +#[serde(skip_serializing_if = "Option::is_none")] +pub fingerprint: Option, + /// Card funding type. Can be `credit`, `debit`, `prepaid`, or `unknown`. +pub funding: Option, + /// Issuer identification number of the card. + /// (For internal use only and not typically available in standard API requests.). +#[serde(skip_serializing_if = "Option::is_none")] +pub iin: Option, +#[serde(skip_serializing_if = "Option::is_none")] +pub incremental_authorization: Option, + /// Installment details for this payment (Mexico only). + /// + /// For more information, see the [installments integration guide](https://stripe.com/docs/payments/installments). +pub installments: Option, + /// The name of the card's issuing bank. + /// (For internal use only and not typically available in standard API requests.). +#[serde(skip_serializing_if = "Option::is_none")] +pub issuer: Option, + /// The last four digits of the card. +pub last4: Option, + /// ID of the mandate used to make this payment or created by it. +pub mandate: Option, + /// True if this payment was marked as MOTO and out of scope for SCA. +#[serde(skip_serializing_if = "Option::is_none")] +pub moto: Option, +#[serde(skip_serializing_if = "Option::is_none")] +pub multicapture: Option, + /// Identifies which network this charge was processed on. + /// Can be `amex`, `cartes_bancaires`, `diners`, `discover`, `eftpos_au`, `interac`, `jcb`, `mastercard`, `unionpay`, `visa`, or `unknown`. +pub network: Option, + /// If this card has network token credentials, this contains the details of the network token credentials. +#[serde(skip_serializing_if = "Option::is_none")] +pub network_token: Option, +#[serde(skip_serializing_if = "Option::is_none")] +pub overcapture: Option, + /// Populated if this transaction used 3D Secure authentication. +pub three_d_secure: Option, + /// If this Card is part of a card wallet, this contains the details of the card wallet. +pub wallet: Option, + +} diff --git a/generated/stripe_shared/src/payment_method_details_card_checks.rs b/generated/stripe_shared/src/payment_method_details_card_checks.rs new file mode 100644 index 000000000..3f0d16aff --- /dev/null +++ b/generated/stripe_shared/src/payment_method_details_card_checks.rs @@ -0,0 +1,9 @@ +#[derive(Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct PaymentMethodDetailsCardChecks { + /// If a address line1 was provided, results of the check, one of `pass`, `fail`, `unavailable`, or `unchecked`. + pub address_line1_check: Option, + /// If a address postal code was provided, results of the check, one of `pass`, `fail`, `unavailable`, or `unchecked`. + pub address_postal_code_check: Option, + /// If a CVC was provided, results of the check, one of `pass`, `fail`, `unavailable`, or `unchecked`. + pub cvc_check: Option, +} diff --git a/generated/stripe_shared/src/payment_method_details_card_installments.rs b/generated/stripe_shared/src/payment_method_details_card_installments.rs new file mode 100644 index 000000000..45ddbf0f4 --- /dev/null +++ b/generated/stripe_shared/src/payment_method_details_card_installments.rs @@ -0,0 +1,5 @@ +#[derive(Copy, Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct PaymentMethodDetailsCardInstallments { + /// Installment plan selected for the payment. + pub plan: Option, +} diff --git a/generated/stripe_shared/src/payment_method_details_card_installments_plan.rs b/generated/stripe_shared/src/payment_method_details_card_installments_plan.rs new file mode 100644 index 000000000..2f3a98f78 --- /dev/null +++ b/generated/stripe_shared/src/payment_method_details_card_installments_plan.rs @@ -0,0 +1,120 @@ +#[derive(Copy, Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct PaymentMethodDetailsCardInstallmentsPlan { + /// For `fixed_count` installment plans, this is the number of installment payments your customer will make to their credit card. + pub count: Option, + /// For `fixed_count` installment plans, this is the interval between installment payments your customer will make to their credit card. + /// One of `month`. + pub interval: Option, + /// Type of installment plan, one of `fixed_count`. + #[serde(rename = "type")] + pub type_: PaymentMethodDetailsCardInstallmentsPlanType, +} +/// For `fixed_count` installment plans, this is the interval between installment payments your customer will make to their credit card. +/// One of `month`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum PaymentMethodDetailsCardInstallmentsPlanInterval { + Month, +} +impl PaymentMethodDetailsCardInstallmentsPlanInterval { + pub fn as_str(self) -> &'static str { + use PaymentMethodDetailsCardInstallmentsPlanInterval::*; + match self { + Month => "month", + } + } +} + +impl std::str::FromStr for PaymentMethodDetailsCardInstallmentsPlanInterval { + type Err = (); + fn from_str(s: &str) -> Result { + use PaymentMethodDetailsCardInstallmentsPlanInterval::*; + match s { + "month" => Ok(Month), + _ => Err(()), + } + } +} +impl std::fmt::Display for PaymentMethodDetailsCardInstallmentsPlanInterval { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for PaymentMethodDetailsCardInstallmentsPlanInterval { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for PaymentMethodDetailsCardInstallmentsPlanInterval { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for PaymentMethodDetailsCardInstallmentsPlanInterval { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| { + serde::de::Error::custom( + "Unknown value for PaymentMethodDetailsCardInstallmentsPlanInterval", + ) + }) + } +} +/// Type of installment plan, one of `fixed_count`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum PaymentMethodDetailsCardInstallmentsPlanType { + FixedCount, +} +impl PaymentMethodDetailsCardInstallmentsPlanType { + pub fn as_str(self) -> &'static str { + use PaymentMethodDetailsCardInstallmentsPlanType::*; + match self { + FixedCount => "fixed_count", + } + } +} + +impl std::str::FromStr for PaymentMethodDetailsCardInstallmentsPlanType { + type Err = (); + fn from_str(s: &str) -> Result { + use PaymentMethodDetailsCardInstallmentsPlanType::*; + match s { + "fixed_count" => Ok(FixedCount), + _ => Err(()), + } + } +} +impl std::fmt::Display for PaymentMethodDetailsCardInstallmentsPlanType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for PaymentMethodDetailsCardInstallmentsPlanType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for PaymentMethodDetailsCardInstallmentsPlanType { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for PaymentMethodDetailsCardInstallmentsPlanType { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| { + serde::de::Error::custom( + "Unknown value for PaymentMethodDetailsCardInstallmentsPlanType", + ) + }) + } +} diff --git a/generated/stripe_shared/src/payment_method_details_card_network_token.rs b/generated/stripe_shared/src/payment_method_details_card_network_token.rs new file mode 100644 index 000000000..14178b946 --- /dev/null +++ b/generated/stripe_shared/src/payment_method_details_card_network_token.rs @@ -0,0 +1,5 @@ +#[derive(Copy, Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct PaymentMethodDetailsCardNetworkToken { + /// Indicates if Stripe used a network token, either user provided or Stripe managed when processing the transaction. + pub used: bool, +} diff --git a/generated/stripe_shared/src/payment_method_details_card_present.rs b/generated/stripe_shared/src/payment_method_details_card_present.rs new file mode 100644 index 000000000..44df57d11 --- /dev/null +++ b/generated/stripe_shared/src/payment_method_details_card_present.rs @@ -0,0 +1,128 @@ +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct PaymentMethodDetailsCardPresent { + /// The authorized amount + pub amount_authorized: Option, + /// Card brand. + /// Can be `amex`, `diners`, `discover`, `eftpos_au`, `jcb`, `mastercard`, `unionpay`, `visa`, or `unknown`. + pub brand: Option, + /// When using manual capture, a future timestamp after which the charge will be automatically refunded if uncaptured. + #[serde(skip_serializing_if = "Option::is_none")] + pub capture_before: Option, + /// The cardholder name as read from the card, in [ISO 7813](https://en.wikipedia.org/wiki/ISO/IEC_7813) format. + /// May include alphanumeric characters, special characters and first/last name separator (`/`). + /// In some cases, the cardholder name may not be available depending on how the issuer has configured the card. + /// Cardholder name is typically not available on swipe or contactless payments, such as those made with Apple Pay and Google Pay. + pub cardholder_name: Option, + /// Two-letter ISO code representing the country of the card. + /// You could use this attribute to get a sense of the international breakdown of cards you've collected. + pub country: Option, + /// A high-level description of the type of cards issued in this range. + /// (For internal use only and not typically available in standard API requests.). + #[serde(skip_serializing_if = "Option::is_none")] + pub description: Option, + /// Authorization response cryptogram. + pub emv_auth_data: Option, + /// Two-digit number representing the card's expiration month. + pub exp_month: i64, + /// Four-digit number representing the card's expiration year. + pub exp_year: i64, + /// Uniquely identifies this particular card number. + /// You can use this attribute to check whether two customers who’ve signed up with you are using the same card number, for example. + /// For payment methods that tokenize card information (Apple Pay, Google Pay), the tokenized number might be provided instead of the underlying card number. + /// + /// *As of May 1, 2021, card fingerprint in India for Connect changed to allow two fingerprints for the same card---one for India and one for the rest of the world.*. + pub fingerprint: Option, + /// Card funding type. Can be `credit`, `debit`, `prepaid`, or `unknown`. + pub funding: Option, + /// ID of a card PaymentMethod generated from the card_present PaymentMethod that may be attached to a Customer for future transactions. + /// Only present if it was possible to generate a card PaymentMethod. + pub generated_card: Option, + /// Issuer identification number of the card. + /// (For internal use only and not typically available in standard API requests.). + #[serde(skip_serializing_if = "Option::is_none")] + pub iin: Option, + /// Whether this [PaymentIntent](https://stripe.com/docs/api/payment_intents) is eligible for incremental authorizations. + /// Request support using [request_incremental_authorization_support](https://stripe.com/docs/api/payment_intents/create#create_payment_intent-payment_method_options-card_present-request_incremental_authorization_support). + pub incremental_authorization_supported: bool, + /// The name of the card's issuing bank. + /// (For internal use only and not typically available in standard API requests.). + #[serde(skip_serializing_if = "Option::is_none")] + pub issuer: Option, + /// The last four digits of the card. + pub last4: Option, + /// Identifies which network this charge was processed on. + /// Can be `amex`, `cartes_bancaires`, `diners`, `discover`, `eftpos_au`, `interac`, `jcb`, `mastercard`, `unionpay`, `visa`, or `unknown`. + pub network: Option, + /// Details about payments collected offline. + pub offline: Option, + /// Defines whether the authorized amount can be over-captured or not + pub overcapture_supported: bool, + /// How card details were read in this transaction. + pub read_method: Option, + /// A collection of fields required to be displayed on receipts. Only required for EMV transactions. + pub receipt: Option, +} +/// How card details were read in this transaction. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum PaymentMethodDetailsCardPresentReadMethod { + ContactEmv, + ContactlessEmv, + ContactlessMagstripeMode, + MagneticStripeFallback, + MagneticStripeTrack2, +} +impl PaymentMethodDetailsCardPresentReadMethod { + pub fn as_str(self) -> &'static str { + use PaymentMethodDetailsCardPresentReadMethod::*; + match self { + ContactEmv => "contact_emv", + ContactlessEmv => "contactless_emv", + ContactlessMagstripeMode => "contactless_magstripe_mode", + MagneticStripeFallback => "magnetic_stripe_fallback", + MagneticStripeTrack2 => "magnetic_stripe_track2", + } + } +} + +impl std::str::FromStr for PaymentMethodDetailsCardPresentReadMethod { + type Err = (); + fn from_str(s: &str) -> Result { + use PaymentMethodDetailsCardPresentReadMethod::*; + match s { + "contact_emv" => Ok(ContactEmv), + "contactless_emv" => Ok(ContactlessEmv), + "contactless_magstripe_mode" => Ok(ContactlessMagstripeMode), + "magnetic_stripe_fallback" => Ok(MagneticStripeFallback), + "magnetic_stripe_track2" => Ok(MagneticStripeTrack2), + _ => Err(()), + } + } +} +impl std::fmt::Display for PaymentMethodDetailsCardPresentReadMethod { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for PaymentMethodDetailsCardPresentReadMethod { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for PaymentMethodDetailsCardPresentReadMethod { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for PaymentMethodDetailsCardPresentReadMethod { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| { + serde::de::Error::custom("Unknown value for PaymentMethodDetailsCardPresentReadMethod") + }) + } +} diff --git a/generated/stripe_shared/src/payment_method_details_card_present_offline.rs b/generated/stripe_shared/src/payment_method_details_card_present_offline.rs new file mode 100644 index 000000000..1a9cfb636 --- /dev/null +++ b/generated/stripe_shared/src/payment_method_details_card_present_offline.rs @@ -0,0 +1,5 @@ +#[derive(Copy, Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct PaymentMethodDetailsCardPresentOffline { + /// Time at which the payment was collected while offline + pub stored_at: Option, +} diff --git a/generated/stripe_shared/src/payment_method_details_card_present_receipt.rs b/generated/stripe_shared/src/payment_method_details_card_present_receipt.rs new file mode 100644 index 000000000..d7cea8ddb --- /dev/null +++ b/generated/stripe_shared/src/payment_method_details_card_present_receipt.rs @@ -0,0 +1,85 @@ +#[derive(Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct PaymentMethodDetailsCardPresentReceipt { + /// The type of account being debited or credited + #[serde(skip_serializing_if = "Option::is_none")] + pub account_type: Option, + /// EMV tag 9F26, cryptogram generated by the integrated circuit chip. + pub application_cryptogram: Option, + /// Mnenomic of the Application Identifier. + pub application_preferred_name: Option, + /// Identifier for this transaction. + pub authorization_code: Option, + /// EMV tag 8A. A code returned by the card issuer. + pub authorization_response_code: Option, + /// How the cardholder verified ownership of the card. + pub cardholder_verification_method: Option, + /// EMV tag 84. Similar to the application identifier stored on the integrated circuit chip. + pub dedicated_file_name: Option, + /// The outcome of a series of EMV functions performed by the card reader. + pub terminal_verification_results: Option, + /// An indication of various EMV functions performed during the transaction. + pub transaction_status_information: Option, +} +/// The type of account being debited or credited +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum PaymentMethodDetailsCardPresentReceiptAccountType { + Checking, + Credit, + Prepaid, + Unknown, +} +impl PaymentMethodDetailsCardPresentReceiptAccountType { + pub fn as_str(self) -> &'static str { + use PaymentMethodDetailsCardPresentReceiptAccountType::*; + match self { + Checking => "checking", + Credit => "credit", + Prepaid => "prepaid", + Unknown => "unknown", + } + } +} + +impl std::str::FromStr for PaymentMethodDetailsCardPresentReceiptAccountType { + type Err = (); + fn from_str(s: &str) -> Result { + use PaymentMethodDetailsCardPresentReceiptAccountType::*; + match s { + "checking" => Ok(Checking), + "credit" => Ok(Credit), + "prepaid" => Ok(Prepaid), + "unknown" => Ok(Unknown), + _ => Err(()), + } + } +} +impl std::fmt::Display for PaymentMethodDetailsCardPresentReceiptAccountType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for PaymentMethodDetailsCardPresentReceiptAccountType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for PaymentMethodDetailsCardPresentReceiptAccountType { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for PaymentMethodDetailsCardPresentReceiptAccountType { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| { + serde::de::Error::custom( + "Unknown value for PaymentMethodDetailsCardPresentReceiptAccountType", + ) + }) + } +} diff --git a/generated/stripe_shared/src/payment_method_details_card_wallet.rs b/generated/stripe_shared/src/payment_method_details_card_wallet.rs new file mode 100644 index 000000000..61e48efe2 --- /dev/null +++ b/generated/stripe_shared/src/payment_method_details_card_wallet.rs @@ -0,0 +1,97 @@ +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct PaymentMethodDetailsCardWallet { + #[serde(skip_serializing_if = "Option::is_none")] + pub amex_express_checkout: + Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub apple_pay: Option, + /// (For tokenized numbers only.) The last four digits of the device account number. + pub dynamic_last4: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub google_pay: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub link: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub masterpass: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub samsung_pay: Option, + /// The type of the card wallet, one of `amex_express_checkout`, `apple_pay`, `google_pay`, `masterpass`, `samsung_pay`, `visa_checkout`, or `link`. + /// An additional hash is included on the Wallet subhash with a name matching this value. + /// It contains additional information specific to the card wallet type. + #[serde(rename = "type")] + pub type_: PaymentMethodDetailsCardWalletType, + #[serde(skip_serializing_if = "Option::is_none")] + pub visa_checkout: Option, +} +/// The type of the card wallet, one of `amex_express_checkout`, `apple_pay`, `google_pay`, `masterpass`, `samsung_pay`, `visa_checkout`, or `link`. +/// An additional hash is included on the Wallet subhash with a name matching this value. +/// It contains additional information specific to the card wallet type. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum PaymentMethodDetailsCardWalletType { + AmexExpressCheckout, + ApplePay, + GooglePay, + Link, + Masterpass, + SamsungPay, + VisaCheckout, +} +impl PaymentMethodDetailsCardWalletType { + pub fn as_str(self) -> &'static str { + use PaymentMethodDetailsCardWalletType::*; + match self { + AmexExpressCheckout => "amex_express_checkout", + ApplePay => "apple_pay", + GooglePay => "google_pay", + Link => "link", + Masterpass => "masterpass", + SamsungPay => "samsung_pay", + VisaCheckout => "visa_checkout", + } + } +} + +impl std::str::FromStr for PaymentMethodDetailsCardWalletType { + type Err = (); + fn from_str(s: &str) -> Result { + use PaymentMethodDetailsCardWalletType::*; + match s { + "amex_express_checkout" => Ok(AmexExpressCheckout), + "apple_pay" => Ok(ApplePay), + "google_pay" => Ok(GooglePay), + "link" => Ok(Link), + "masterpass" => Ok(Masterpass), + "samsung_pay" => Ok(SamsungPay), + "visa_checkout" => Ok(VisaCheckout), + _ => Err(()), + } + } +} +impl std::fmt::Display for PaymentMethodDetailsCardWalletType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for PaymentMethodDetailsCardWalletType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for PaymentMethodDetailsCardWalletType { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for PaymentMethodDetailsCardWalletType { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| { + serde::de::Error::custom("Unknown value for PaymentMethodDetailsCardWalletType") + }) + } +} diff --git a/generated/stripe_shared/src/payment_method_details_card_wallet_amex_express_checkout.rs b/generated/stripe_shared/src/payment_method_details_card_wallet_amex_express_checkout.rs new file mode 100644 index 000000000..d6bb316e9 --- /dev/null +++ b/generated/stripe_shared/src/payment_method_details_card_wallet_amex_express_checkout.rs @@ -0,0 +1,2 @@ +#[derive(Copy, Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct PaymentMethodDetailsCardWalletAmexExpressCheckout {} diff --git a/generated/stripe_shared/src/payment_method_details_card_wallet_apple_pay.rs b/generated/stripe_shared/src/payment_method_details_card_wallet_apple_pay.rs new file mode 100644 index 000000000..7acbfb6e3 --- /dev/null +++ b/generated/stripe_shared/src/payment_method_details_card_wallet_apple_pay.rs @@ -0,0 +1,2 @@ +#[derive(Copy, Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct PaymentMethodDetailsCardWalletApplePay {} diff --git a/generated/stripe_shared/src/payment_method_details_card_wallet_google_pay.rs b/generated/stripe_shared/src/payment_method_details_card_wallet_google_pay.rs new file mode 100644 index 000000000..6695fbe5f --- /dev/null +++ b/generated/stripe_shared/src/payment_method_details_card_wallet_google_pay.rs @@ -0,0 +1,2 @@ +#[derive(Copy, Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct PaymentMethodDetailsCardWalletGooglePay {} diff --git a/generated/stripe_shared/src/payment_method_details_card_wallet_link.rs b/generated/stripe_shared/src/payment_method_details_card_wallet_link.rs new file mode 100644 index 000000000..873024f1d --- /dev/null +++ b/generated/stripe_shared/src/payment_method_details_card_wallet_link.rs @@ -0,0 +1,2 @@ +#[derive(Copy, Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct PaymentMethodDetailsCardWalletLink {} diff --git a/generated/stripe_shared/src/payment_method_details_card_wallet_masterpass.rs b/generated/stripe_shared/src/payment_method_details_card_wallet_masterpass.rs new file mode 100644 index 000000000..dec58d814 --- /dev/null +++ b/generated/stripe_shared/src/payment_method_details_card_wallet_masterpass.rs @@ -0,0 +1,19 @@ +#[derive(Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct PaymentMethodDetailsCardWalletMasterpass { + /// Owner's verified billing address. + /// Values are verified or provided by the wallet directly (if supported) at the time of authorization or settlement. + /// They cannot be set or mutated. + pub billing_address: Option, + /// Owner's verified email. + /// Values are verified or provided by the wallet directly (if supported) at the time of authorization or settlement. + /// They cannot be set or mutated. + pub email: Option, + /// Owner's verified full name. + /// Values are verified or provided by the wallet directly (if supported) at the time of authorization or settlement. + /// They cannot be set or mutated. + pub name: Option, + /// Owner's verified shipping address. + /// Values are verified or provided by the wallet directly (if supported) at the time of authorization or settlement. + /// They cannot be set or mutated. + pub shipping_address: Option, +} diff --git a/generated/stripe_shared/src/payment_method_details_card_wallet_samsung_pay.rs b/generated/stripe_shared/src/payment_method_details_card_wallet_samsung_pay.rs new file mode 100644 index 000000000..cca8ef217 --- /dev/null +++ b/generated/stripe_shared/src/payment_method_details_card_wallet_samsung_pay.rs @@ -0,0 +1,2 @@ +#[derive(Copy, Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct PaymentMethodDetailsCardWalletSamsungPay {} diff --git a/generated/stripe_shared/src/payment_method_details_card_wallet_visa_checkout.rs b/generated/stripe_shared/src/payment_method_details_card_wallet_visa_checkout.rs new file mode 100644 index 000000000..902c15c77 --- /dev/null +++ b/generated/stripe_shared/src/payment_method_details_card_wallet_visa_checkout.rs @@ -0,0 +1,19 @@ +#[derive(Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct PaymentMethodDetailsCardWalletVisaCheckout { + /// Owner's verified billing address. + /// Values are verified or provided by the wallet directly (if supported) at the time of authorization or settlement. + /// They cannot be set or mutated. + pub billing_address: Option, + /// Owner's verified email. + /// Values are verified or provided by the wallet directly (if supported) at the time of authorization or settlement. + /// They cannot be set or mutated. + pub email: Option, + /// Owner's verified full name. + /// Values are verified or provided by the wallet directly (if supported) at the time of authorization or settlement. + /// They cannot be set or mutated. + pub name: Option, + /// Owner's verified shipping address. + /// Values are verified or provided by the wallet directly (if supported) at the time of authorization or settlement. + /// They cannot be set or mutated. + pub shipping_address: Option, +} diff --git a/generated/stripe_shared/src/payment_method_details_cashapp.rs b/generated/stripe_shared/src/payment_method_details_cashapp.rs new file mode 100644 index 000000000..86783959f --- /dev/null +++ b/generated/stripe_shared/src/payment_method_details_cashapp.rs @@ -0,0 +1,7 @@ +#[derive(Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct PaymentMethodDetailsCashapp { + /// A unique and immutable identifier assigned by Cash App to every buyer. + pub buyer_id: Option, + /// A public identifier for buyers using Cash App. + pub cashtag: Option, +} diff --git a/generated/stripe_shared/src/payment_method_details_customer_balance.rs b/generated/stripe_shared/src/payment_method_details_customer_balance.rs new file mode 100644 index 000000000..14673643c --- /dev/null +++ b/generated/stripe_shared/src/payment_method_details_customer_balance.rs @@ -0,0 +1,2 @@ +#[derive(Copy, Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct PaymentMethodDetailsCustomerBalance {} diff --git a/generated/stripe_shared/src/payment_method_details_eps.rs b/generated/stripe_shared/src/payment_method_details_eps.rs new file mode 100644 index 000000000..d70131a36 --- /dev/null +++ b/generated/stripe_shared/src/payment_method_details_eps.rs @@ -0,0 +1,146 @@ +#[derive(Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct PaymentMethodDetailsEps { + /// The customer's bank. + /// Should be one of `arzte_und_apotheker_bank`, `austrian_anadi_bank_ag`, `bank_austria`, `bankhaus_carl_spangler`, `bankhaus_schelhammer_und_schattera_ag`, `bawag_psk_ag`, `bks_bank_ag`, `brull_kallmus_bank_ag`, `btv_vier_lander_bank`, `capital_bank_grawe_gruppe_ag`, `deutsche_bank_ag`, `dolomitenbank`, `easybank_ag`, `erste_bank_und_sparkassen`, `hypo_alpeadriabank_international_ag`, `hypo_noe_lb_fur_niederosterreich_u_wien`, `hypo_oberosterreich_salzburg_steiermark`, `hypo_tirol_bank_ag`, `hypo_vorarlberg_bank_ag`, `hypo_bank_burgenland_aktiengesellschaft`, `marchfelder_bank`, `oberbank_ag`, `raiffeisen_bankengruppe_osterreich`, `schoellerbank_ag`, `sparda_bank_wien`, `volksbank_gruppe`, `volkskreditbank_ag`, or `vr_bank_braunau`. + pub bank: Option, + /// Owner's verified full name. Values are verified or provided by EPS directly + /// (if supported) at the time of authorization or settlement. They cannot be set or mutated. + /// EPS rarely provides this information so the attribute is usually empty. + pub verified_name: Option, +} +/// The customer's bank. +/// Should be one of `arzte_und_apotheker_bank`, `austrian_anadi_bank_ag`, `bank_austria`, `bankhaus_carl_spangler`, `bankhaus_schelhammer_und_schattera_ag`, `bawag_psk_ag`, `bks_bank_ag`, `brull_kallmus_bank_ag`, `btv_vier_lander_bank`, `capital_bank_grawe_gruppe_ag`, `deutsche_bank_ag`, `dolomitenbank`, `easybank_ag`, `erste_bank_und_sparkassen`, `hypo_alpeadriabank_international_ag`, `hypo_noe_lb_fur_niederosterreich_u_wien`, `hypo_oberosterreich_salzburg_steiermark`, `hypo_tirol_bank_ag`, `hypo_vorarlberg_bank_ag`, `hypo_bank_burgenland_aktiengesellschaft`, `marchfelder_bank`, `oberbank_ag`, `raiffeisen_bankengruppe_osterreich`, `schoellerbank_ag`, `sparda_bank_wien`, `volksbank_gruppe`, `volkskreditbank_ag`, or `vr_bank_braunau`. +#[derive(Copy, Clone, Eq, PartialEq)] +#[non_exhaustive] +pub enum PaymentMethodDetailsEpsBank { + ArzteUndApothekerBank, + AustrianAnadiBankAg, + BankAustria, + BankhausCarlSpangler, + BankhausSchelhammerUndSchatteraAg, + BawagPskAg, + BksBankAg, + BrullKallmusBankAg, + BtvVierLanderBank, + CapitalBankGraweGruppeAg, + DeutscheBankAg, + Dolomitenbank, + EasybankAg, + ErsteBankUndSparkassen, + HypoAlpeadriabankInternationalAg, + HypoBankBurgenlandAktiengesellschaft, + HypoNoeLbFurNiederosterreichUWien, + HypoOberosterreichSalzburgSteiermark, + HypoTirolBankAg, + HypoVorarlbergBankAg, + MarchfelderBank, + OberbankAg, + RaiffeisenBankengruppeOsterreich, + SchoellerbankAg, + SpardaBankWien, + VolksbankGruppe, + VolkskreditbankAg, + VrBankBraunau, + /// An unrecognized value from Stripe. Should not be used as a request parameter. + Unknown, +} +impl PaymentMethodDetailsEpsBank { + pub fn as_str(self) -> &'static str { + use PaymentMethodDetailsEpsBank::*; + match self { + ArzteUndApothekerBank => "arzte_und_apotheker_bank", + AustrianAnadiBankAg => "austrian_anadi_bank_ag", + BankAustria => "bank_austria", + BankhausCarlSpangler => "bankhaus_carl_spangler", + BankhausSchelhammerUndSchatteraAg => "bankhaus_schelhammer_und_schattera_ag", + BawagPskAg => "bawag_psk_ag", + BksBankAg => "bks_bank_ag", + BrullKallmusBankAg => "brull_kallmus_bank_ag", + BtvVierLanderBank => "btv_vier_lander_bank", + CapitalBankGraweGruppeAg => "capital_bank_grawe_gruppe_ag", + DeutscheBankAg => "deutsche_bank_ag", + Dolomitenbank => "dolomitenbank", + EasybankAg => "easybank_ag", + ErsteBankUndSparkassen => "erste_bank_und_sparkassen", + HypoAlpeadriabankInternationalAg => "hypo_alpeadriabank_international_ag", + HypoBankBurgenlandAktiengesellschaft => "hypo_bank_burgenland_aktiengesellschaft", + HypoNoeLbFurNiederosterreichUWien => "hypo_noe_lb_fur_niederosterreich_u_wien", + HypoOberosterreichSalzburgSteiermark => "hypo_oberosterreich_salzburg_steiermark", + HypoTirolBankAg => "hypo_tirol_bank_ag", + HypoVorarlbergBankAg => "hypo_vorarlberg_bank_ag", + MarchfelderBank => "marchfelder_bank", + OberbankAg => "oberbank_ag", + RaiffeisenBankengruppeOsterreich => "raiffeisen_bankengruppe_osterreich", + SchoellerbankAg => "schoellerbank_ag", + SpardaBankWien => "sparda_bank_wien", + VolksbankGruppe => "volksbank_gruppe", + VolkskreditbankAg => "volkskreditbank_ag", + VrBankBraunau => "vr_bank_braunau", + Unknown => "unknown", + } + } +} + +impl std::str::FromStr for PaymentMethodDetailsEpsBank { + type Err = (); + fn from_str(s: &str) -> Result { + use PaymentMethodDetailsEpsBank::*; + match s { + "arzte_und_apotheker_bank" => Ok(ArzteUndApothekerBank), + "austrian_anadi_bank_ag" => Ok(AustrianAnadiBankAg), + "bank_austria" => Ok(BankAustria), + "bankhaus_carl_spangler" => Ok(BankhausCarlSpangler), + "bankhaus_schelhammer_und_schattera_ag" => Ok(BankhausSchelhammerUndSchatteraAg), + "bawag_psk_ag" => Ok(BawagPskAg), + "bks_bank_ag" => Ok(BksBankAg), + "brull_kallmus_bank_ag" => Ok(BrullKallmusBankAg), + "btv_vier_lander_bank" => Ok(BtvVierLanderBank), + "capital_bank_grawe_gruppe_ag" => Ok(CapitalBankGraweGruppeAg), + "deutsche_bank_ag" => Ok(DeutscheBankAg), + "dolomitenbank" => Ok(Dolomitenbank), + "easybank_ag" => Ok(EasybankAg), + "erste_bank_und_sparkassen" => Ok(ErsteBankUndSparkassen), + "hypo_alpeadriabank_international_ag" => Ok(HypoAlpeadriabankInternationalAg), + "hypo_bank_burgenland_aktiengesellschaft" => Ok(HypoBankBurgenlandAktiengesellschaft), + "hypo_noe_lb_fur_niederosterreich_u_wien" => Ok(HypoNoeLbFurNiederosterreichUWien), + "hypo_oberosterreich_salzburg_steiermark" => Ok(HypoOberosterreichSalzburgSteiermark), + "hypo_tirol_bank_ag" => Ok(HypoTirolBankAg), + "hypo_vorarlberg_bank_ag" => Ok(HypoVorarlbergBankAg), + "marchfelder_bank" => Ok(MarchfelderBank), + "oberbank_ag" => Ok(OberbankAg), + "raiffeisen_bankengruppe_osterreich" => Ok(RaiffeisenBankengruppeOsterreich), + "schoellerbank_ag" => Ok(SchoellerbankAg), + "sparda_bank_wien" => Ok(SpardaBankWien), + "volksbank_gruppe" => Ok(VolksbankGruppe), + "volkskreditbank_ag" => Ok(VolkskreditbankAg), + "vr_bank_braunau" => Ok(VrBankBraunau), + _ => Err(()), + } + } +} +impl std::fmt::Display for PaymentMethodDetailsEpsBank { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for PaymentMethodDetailsEpsBank { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for PaymentMethodDetailsEpsBank { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for PaymentMethodDetailsEpsBank { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Ok(Self::from_str(&s).unwrap_or(PaymentMethodDetailsEpsBank::Unknown)) + } +} diff --git a/generated/stripe_shared/src/payment_method_details_fpx.rs b/generated/stripe_shared/src/payment_method_details_fpx.rs new file mode 100644 index 000000000..1fd4679be --- /dev/null +++ b/generated/stripe_shared/src/payment_method_details_fpx.rs @@ -0,0 +1,183 @@ +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct PaymentMethodDetailsFpx { + /// Account holder type, if provided. Can be one of `individual` or `company`. + pub account_holder_type: Option, + /// The customer's bank. + /// Can be one of `affin_bank`, `agrobank`, `alliance_bank`, `ambank`, `bank_islam`, `bank_muamalat`, `bank_rakyat`, `bsn`, `cimb`, `hong_leong_bank`, `hsbc`, `kfh`, `maybank2u`, `ocbc`, `public_bank`, `rhb`, `standard_chartered`, `uob`, `deutsche_bank`, `maybank2e`, `pb_enterprise`, or `bank_of_china`. + pub bank: PaymentMethodDetailsFpxBank, + /// Unique transaction id generated by FPX for every request from the merchant + pub transaction_id: Option, +} +/// Account holder type, if provided. Can be one of `individual` or `company`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum PaymentMethodDetailsFpxAccountHolderType { + Company, + Individual, +} +impl PaymentMethodDetailsFpxAccountHolderType { + pub fn as_str(self) -> &'static str { + use PaymentMethodDetailsFpxAccountHolderType::*; + match self { + Company => "company", + Individual => "individual", + } + } +} + +impl std::str::FromStr for PaymentMethodDetailsFpxAccountHolderType { + type Err = (); + fn from_str(s: &str) -> Result { + use PaymentMethodDetailsFpxAccountHolderType::*; + match s { + "company" => Ok(Company), + "individual" => Ok(Individual), + _ => Err(()), + } + } +} +impl std::fmt::Display for PaymentMethodDetailsFpxAccountHolderType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for PaymentMethodDetailsFpxAccountHolderType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for PaymentMethodDetailsFpxAccountHolderType { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for PaymentMethodDetailsFpxAccountHolderType { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| { + serde::de::Error::custom("Unknown value for PaymentMethodDetailsFpxAccountHolderType") + }) + } +} +/// The customer's bank. +/// Can be one of `affin_bank`, `agrobank`, `alliance_bank`, `ambank`, `bank_islam`, `bank_muamalat`, `bank_rakyat`, `bsn`, `cimb`, `hong_leong_bank`, `hsbc`, `kfh`, `maybank2u`, `ocbc`, `public_bank`, `rhb`, `standard_chartered`, `uob`, `deutsche_bank`, `maybank2e`, `pb_enterprise`, or `bank_of_china`. +#[derive(Copy, Clone, Eq, PartialEq)] +#[non_exhaustive] +pub enum PaymentMethodDetailsFpxBank { + AffinBank, + Agrobank, + AllianceBank, + Ambank, + BankIslam, + BankMuamalat, + BankOfChina, + BankRakyat, + Bsn, + Cimb, + DeutscheBank, + HongLeongBank, + Hsbc, + Kfh, + Maybank2e, + Maybank2u, + Ocbc, + PbEnterprise, + PublicBank, + Rhb, + StandardChartered, + Uob, + /// An unrecognized value from Stripe. Should not be used as a request parameter. + Unknown, +} +impl PaymentMethodDetailsFpxBank { + pub fn as_str(self) -> &'static str { + use PaymentMethodDetailsFpxBank::*; + match self { + AffinBank => "affin_bank", + Agrobank => "agrobank", + AllianceBank => "alliance_bank", + Ambank => "ambank", + BankIslam => "bank_islam", + BankMuamalat => "bank_muamalat", + BankOfChina => "bank_of_china", + BankRakyat => "bank_rakyat", + Bsn => "bsn", + Cimb => "cimb", + DeutscheBank => "deutsche_bank", + HongLeongBank => "hong_leong_bank", + Hsbc => "hsbc", + Kfh => "kfh", + Maybank2e => "maybank2e", + Maybank2u => "maybank2u", + Ocbc => "ocbc", + PbEnterprise => "pb_enterprise", + PublicBank => "public_bank", + Rhb => "rhb", + StandardChartered => "standard_chartered", + Uob => "uob", + Unknown => "unknown", + } + } +} + +impl std::str::FromStr for PaymentMethodDetailsFpxBank { + type Err = (); + fn from_str(s: &str) -> Result { + use PaymentMethodDetailsFpxBank::*; + match s { + "affin_bank" => Ok(AffinBank), + "agrobank" => Ok(Agrobank), + "alliance_bank" => Ok(AllianceBank), + "ambank" => Ok(Ambank), + "bank_islam" => Ok(BankIslam), + "bank_muamalat" => Ok(BankMuamalat), + "bank_of_china" => Ok(BankOfChina), + "bank_rakyat" => Ok(BankRakyat), + "bsn" => Ok(Bsn), + "cimb" => Ok(Cimb), + "deutsche_bank" => Ok(DeutscheBank), + "hong_leong_bank" => Ok(HongLeongBank), + "hsbc" => Ok(Hsbc), + "kfh" => Ok(Kfh), + "maybank2e" => Ok(Maybank2e), + "maybank2u" => Ok(Maybank2u), + "ocbc" => Ok(Ocbc), + "pb_enterprise" => Ok(PbEnterprise), + "public_bank" => Ok(PublicBank), + "rhb" => Ok(Rhb), + "standard_chartered" => Ok(StandardChartered), + "uob" => Ok(Uob), + _ => Err(()), + } + } +} +impl std::fmt::Display for PaymentMethodDetailsFpxBank { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for PaymentMethodDetailsFpxBank { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for PaymentMethodDetailsFpxBank { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for PaymentMethodDetailsFpxBank { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Ok(Self::from_str(&s).unwrap_or(PaymentMethodDetailsFpxBank::Unknown)) + } +} diff --git a/generated/stripe_shared/src/payment_method_details_giropay.rs b/generated/stripe_shared/src/payment_method_details_giropay.rs new file mode 100644 index 000000000..0c8a75eb6 --- /dev/null +++ b/generated/stripe_shared/src/payment_method_details_giropay.rs @@ -0,0 +1,13 @@ +#[derive(Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct PaymentMethodDetailsGiropay { + /// Bank code of bank associated with the bank account. + pub bank_code: Option, + /// Name of the bank associated with the bank account. + pub bank_name: Option, + /// Bank Identifier Code of the bank associated with the bank account. + pub bic: Option, + /// Owner's verified full name. Values are verified or provided by Giropay directly + /// (if supported) at the time of authorization or settlement. They cannot be set or mutated. + /// Giropay rarely provides this information so the attribute is usually empty. + pub verified_name: Option, +} diff --git a/generated/stripe_shared/src/payment_method_details_grabpay.rs b/generated/stripe_shared/src/payment_method_details_grabpay.rs new file mode 100644 index 000000000..d96f85e85 --- /dev/null +++ b/generated/stripe_shared/src/payment_method_details_grabpay.rs @@ -0,0 +1,5 @@ +#[derive(Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct PaymentMethodDetailsGrabpay { + /// Unique transaction id generated by GrabPay + pub transaction_id: Option, +} diff --git a/generated/stripe_shared/src/payment_method_details_ideal.rs b/generated/stripe_shared/src/payment_method_details_ideal.rs new file mode 100644 index 000000000..139b7a1f8 --- /dev/null +++ b/generated/stripe_shared/src/payment_method_details_ideal.rs @@ -0,0 +1,219 @@ +#[derive(Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct PaymentMethodDetailsIdeal { + /// The customer's bank. + /// Can be one of `abn_amro`, `asn_bank`, `bunq`, `handelsbanken`, `ing`, `knab`, `moneyou`, `n26`, `nn`, `rabobank`, `regiobank`, `revolut`, `sns_bank`, `triodos_bank`, `van_lanschot`, or `yoursafe`. + pub bank: Option, + /// The Bank Identifier Code of the customer's bank. + pub bic: Option, + /// The ID of the SEPA Direct Debit PaymentMethod which was generated by this Charge. + pub generated_sepa_debit: Option>, + /// The mandate for the SEPA Direct Debit PaymentMethod which was generated by this Charge. + pub generated_sepa_debit_mandate: Option>, + /// Last four characters of the IBAN. + pub iban_last4: Option, + /// Owner's verified full name. Values are verified or provided by iDEAL directly + /// (if supported) at the time of authorization or settlement. They cannot be set or mutated. + pub verified_name: Option, +} +/// The customer's bank. +/// Can be one of `abn_amro`, `asn_bank`, `bunq`, `handelsbanken`, `ing`, `knab`, `moneyou`, `n26`, `nn`, `rabobank`, `regiobank`, `revolut`, `sns_bank`, `triodos_bank`, `van_lanschot`, or `yoursafe`. +#[derive(Copy, Clone, Eq, PartialEq)] +#[non_exhaustive] +pub enum PaymentMethodDetailsIdealBank { + AbnAmro, + AsnBank, + Bunq, + Handelsbanken, + Ing, + Knab, + Moneyou, + N26, + Nn, + Rabobank, + Regiobank, + Revolut, + SnsBank, + TriodosBank, + VanLanschot, + Yoursafe, + /// An unrecognized value from Stripe. Should not be used as a request parameter. + Unknown, +} +impl PaymentMethodDetailsIdealBank { + pub fn as_str(self) -> &'static str { + use PaymentMethodDetailsIdealBank::*; + match self { + AbnAmro => "abn_amro", + AsnBank => "asn_bank", + Bunq => "bunq", + Handelsbanken => "handelsbanken", + Ing => "ing", + Knab => "knab", + Moneyou => "moneyou", + N26 => "n26", + Nn => "nn", + Rabobank => "rabobank", + Regiobank => "regiobank", + Revolut => "revolut", + SnsBank => "sns_bank", + TriodosBank => "triodos_bank", + VanLanschot => "van_lanschot", + Yoursafe => "yoursafe", + Unknown => "unknown", + } + } +} + +impl std::str::FromStr for PaymentMethodDetailsIdealBank { + type Err = (); + fn from_str(s: &str) -> Result { + use PaymentMethodDetailsIdealBank::*; + match s { + "abn_amro" => Ok(AbnAmro), + "asn_bank" => Ok(AsnBank), + "bunq" => Ok(Bunq), + "handelsbanken" => Ok(Handelsbanken), + "ing" => Ok(Ing), + "knab" => Ok(Knab), + "moneyou" => Ok(Moneyou), + "n26" => Ok(N26), + "nn" => Ok(Nn), + "rabobank" => Ok(Rabobank), + "regiobank" => Ok(Regiobank), + "revolut" => Ok(Revolut), + "sns_bank" => Ok(SnsBank), + "triodos_bank" => Ok(TriodosBank), + "van_lanschot" => Ok(VanLanschot), + "yoursafe" => Ok(Yoursafe), + _ => Err(()), + } + } +} +impl std::fmt::Display for PaymentMethodDetailsIdealBank { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for PaymentMethodDetailsIdealBank { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for PaymentMethodDetailsIdealBank { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for PaymentMethodDetailsIdealBank { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Ok(Self::from_str(&s).unwrap_or(PaymentMethodDetailsIdealBank::Unknown)) + } +} +/// The Bank Identifier Code of the customer's bank. +#[derive(Copy, Clone, Eq, PartialEq)] +#[non_exhaustive] +pub enum PaymentMethodDetailsIdealBic { + Abnanl2a, + Asnbnl21, + Bitsnl2a, + Bunqnl2a, + Fvlbnl22, + Handnl2a, + Ingbnl2a, + Knabnl2h, + Moyonl21, + Nnbanl2g, + Ntsbdeb1, + Rabonl2u, + Rbrbnl21, + Revoie23, + Revolt21, + Snsbnl2a, + Trionl2u, + /// An unrecognized value from Stripe. Should not be used as a request parameter. + Unknown, +} +impl PaymentMethodDetailsIdealBic { + pub fn as_str(self) -> &'static str { + use PaymentMethodDetailsIdealBic::*; + match self { + Abnanl2a => "ABNANL2A", + Asnbnl21 => "ASNBNL21", + Bitsnl2a => "BITSNL2A", + Bunqnl2a => "BUNQNL2A", + Fvlbnl22 => "FVLBNL22", + Handnl2a => "HANDNL2A", + Ingbnl2a => "INGBNL2A", + Knabnl2h => "KNABNL2H", + Moyonl21 => "MOYONL21", + Nnbanl2g => "NNBANL2G", + Ntsbdeb1 => "NTSBDEB1", + Rabonl2u => "RABONL2U", + Rbrbnl21 => "RBRBNL21", + Revoie23 => "REVOIE23", + Revolt21 => "REVOLT21", + Snsbnl2a => "SNSBNL2A", + Trionl2u => "TRIONL2U", + Unknown => "unknown", + } + } +} + +impl std::str::FromStr for PaymentMethodDetailsIdealBic { + type Err = (); + fn from_str(s: &str) -> Result { + use PaymentMethodDetailsIdealBic::*; + match s { + "ABNANL2A" => Ok(Abnanl2a), + "ASNBNL21" => Ok(Asnbnl21), + "BITSNL2A" => Ok(Bitsnl2a), + "BUNQNL2A" => Ok(Bunqnl2a), + "FVLBNL22" => Ok(Fvlbnl22), + "HANDNL2A" => Ok(Handnl2a), + "INGBNL2A" => Ok(Ingbnl2a), + "KNABNL2H" => Ok(Knabnl2h), + "MOYONL21" => Ok(Moyonl21), + "NNBANL2G" => Ok(Nnbanl2g), + "NTSBDEB1" => Ok(Ntsbdeb1), + "RABONL2U" => Ok(Rabonl2u), + "RBRBNL21" => Ok(Rbrbnl21), + "REVOIE23" => Ok(Revoie23), + "REVOLT21" => Ok(Revolt21), + "SNSBNL2A" => Ok(Snsbnl2a), + "TRIONL2U" => Ok(Trionl2u), + _ => Err(()), + } + } +} +impl std::fmt::Display for PaymentMethodDetailsIdealBic { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for PaymentMethodDetailsIdealBic { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for PaymentMethodDetailsIdealBic { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for PaymentMethodDetailsIdealBic { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Ok(Self::from_str(&s).unwrap_or(PaymentMethodDetailsIdealBic::Unknown)) + } +} diff --git a/generated/stripe_shared/src/payment_method_details_interac_present.rs b/generated/stripe_shared/src/payment_method_details_interac_present.rs new file mode 100644 index 000000000..ac20be016 --- /dev/null +++ b/generated/stripe_shared/src/payment_method_details_interac_present.rs @@ -0,0 +1,119 @@ +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct PaymentMethodDetailsInteracPresent { + /// Card brand. Can be `interac`, `mastercard` or `visa`. + pub brand: Option, + /// The cardholder name as read from the card, in [ISO 7813](https://en.wikipedia.org/wiki/ISO/IEC_7813) format. + /// May include alphanumeric characters, special characters and first/last name separator (`/`). + /// In some cases, the cardholder name may not be available depending on how the issuer has configured the card. + /// Cardholder name is typically not available on swipe or contactless payments, such as those made with Apple Pay and Google Pay. + pub cardholder_name: Option, + /// Two-letter ISO code representing the country of the card. + /// You could use this attribute to get a sense of the international breakdown of cards you've collected. + pub country: Option, + /// A high-level description of the type of cards issued in this range. + /// (For internal use only and not typically available in standard API requests.). + #[serde(skip_serializing_if = "Option::is_none")] + pub description: Option, + /// Authorization response cryptogram. + pub emv_auth_data: Option, + /// Two-digit number representing the card's expiration month. + pub exp_month: i64, + /// Four-digit number representing the card's expiration year. + pub exp_year: i64, + /// Uniquely identifies this particular card number. + /// You can use this attribute to check whether two customers who’ve signed up with you are using the same card number, for example. + /// For payment methods that tokenize card information (Apple Pay, Google Pay), the tokenized number might be provided instead of the underlying card number. + /// + /// *As of May 1, 2021, card fingerprint in India for Connect changed to allow two fingerprints for the same card---one for India and one for the rest of the world.*. + pub fingerprint: Option, + /// Card funding type. Can be `credit`, `debit`, `prepaid`, or `unknown`. + pub funding: Option, + /// ID of a card PaymentMethod generated from the card_present PaymentMethod that may be attached to a Customer for future transactions. + /// Only present if it was possible to generate a card PaymentMethod. + pub generated_card: Option, + /// Issuer identification number of the card. + /// (For internal use only and not typically available in standard API requests.). + #[serde(skip_serializing_if = "Option::is_none")] + pub iin: Option, + /// The name of the card's issuing bank. + /// (For internal use only and not typically available in standard API requests.). + #[serde(skip_serializing_if = "Option::is_none")] + pub issuer: Option, + /// The last four digits of the card. + pub last4: Option, + /// Identifies which network this charge was processed on. + /// Can be `amex`, `cartes_bancaires`, `diners`, `discover`, `eftpos_au`, `interac`, `jcb`, `mastercard`, `unionpay`, `visa`, or `unknown`. + pub network: Option, + /// EMV tag 5F2D. Preferred languages specified by the integrated circuit chip. + pub preferred_locales: Option>, + /// How card details were read in this transaction. + pub read_method: Option, + /// A collection of fields required to be displayed on receipts. Only required for EMV transactions. + pub receipt: Option, +} +/// How card details were read in this transaction. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum PaymentMethodDetailsInteracPresentReadMethod { + ContactEmv, + ContactlessEmv, + ContactlessMagstripeMode, + MagneticStripeFallback, + MagneticStripeTrack2, +} +impl PaymentMethodDetailsInteracPresentReadMethod { + pub fn as_str(self) -> &'static str { + use PaymentMethodDetailsInteracPresentReadMethod::*; + match self { + ContactEmv => "contact_emv", + ContactlessEmv => "contactless_emv", + ContactlessMagstripeMode => "contactless_magstripe_mode", + MagneticStripeFallback => "magnetic_stripe_fallback", + MagneticStripeTrack2 => "magnetic_stripe_track2", + } + } +} + +impl std::str::FromStr for PaymentMethodDetailsInteracPresentReadMethod { + type Err = (); + fn from_str(s: &str) -> Result { + use PaymentMethodDetailsInteracPresentReadMethod::*; + match s { + "contact_emv" => Ok(ContactEmv), + "contactless_emv" => Ok(ContactlessEmv), + "contactless_magstripe_mode" => Ok(ContactlessMagstripeMode), + "magnetic_stripe_fallback" => Ok(MagneticStripeFallback), + "magnetic_stripe_track2" => Ok(MagneticStripeTrack2), + _ => Err(()), + } + } +} +impl std::fmt::Display for PaymentMethodDetailsInteracPresentReadMethod { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for PaymentMethodDetailsInteracPresentReadMethod { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for PaymentMethodDetailsInteracPresentReadMethod { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for PaymentMethodDetailsInteracPresentReadMethod { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| { + serde::de::Error::custom( + "Unknown value for PaymentMethodDetailsInteracPresentReadMethod", + ) + }) + } +} diff --git a/generated/stripe_shared/src/payment_method_details_interac_present_receipt.rs b/generated/stripe_shared/src/payment_method_details_interac_present_receipt.rs new file mode 100644 index 000000000..96061144e --- /dev/null +++ b/generated/stripe_shared/src/payment_method_details_interac_present_receipt.rs @@ -0,0 +1,82 @@ +#[derive(Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct PaymentMethodDetailsInteracPresentReceipt { + /// The type of account being debited or credited + #[serde(skip_serializing_if = "Option::is_none")] + pub account_type: Option, + /// EMV tag 9F26, cryptogram generated by the integrated circuit chip. + pub application_cryptogram: Option, + /// Mnenomic of the Application Identifier. + pub application_preferred_name: Option, + /// Identifier for this transaction. + pub authorization_code: Option, + /// EMV tag 8A. A code returned by the card issuer. + pub authorization_response_code: Option, + /// How the cardholder verified ownership of the card. + pub cardholder_verification_method: Option, + /// EMV tag 84. Similar to the application identifier stored on the integrated circuit chip. + pub dedicated_file_name: Option, + /// The outcome of a series of EMV functions performed by the card reader. + pub terminal_verification_results: Option, + /// An indication of various EMV functions performed during the transaction. + pub transaction_status_information: Option, +} +/// The type of account being debited or credited +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum PaymentMethodDetailsInteracPresentReceiptAccountType { + Checking, + Savings, + Unknown, +} +impl PaymentMethodDetailsInteracPresentReceiptAccountType { + pub fn as_str(self) -> &'static str { + use PaymentMethodDetailsInteracPresentReceiptAccountType::*; + match self { + Checking => "checking", + Savings => "savings", + Unknown => "unknown", + } + } +} + +impl std::str::FromStr for PaymentMethodDetailsInteracPresentReceiptAccountType { + type Err = (); + fn from_str(s: &str) -> Result { + use PaymentMethodDetailsInteracPresentReceiptAccountType::*; + match s { + "checking" => Ok(Checking), + "savings" => Ok(Savings), + "unknown" => Ok(Unknown), + _ => Err(()), + } + } +} +impl std::fmt::Display for PaymentMethodDetailsInteracPresentReceiptAccountType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for PaymentMethodDetailsInteracPresentReceiptAccountType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for PaymentMethodDetailsInteracPresentReceiptAccountType { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for PaymentMethodDetailsInteracPresentReceiptAccountType { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| { + serde::de::Error::custom( + "Unknown value for PaymentMethodDetailsInteracPresentReceiptAccountType", + ) + }) + } +} diff --git a/generated/stripe_shared/src/payment_method_details_klarna.rs b/generated/stripe_shared/src/payment_method_details_klarna.rs new file mode 100644 index 000000000..47d911fbe --- /dev/null +++ b/generated/stripe_shared/src/payment_method_details_klarna.rs @@ -0,0 +1,9 @@ +#[derive(Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct PaymentMethodDetailsKlarna { + /// The Klarna payment method used for this transaction. + /// Can be one of `pay_later`, `pay_now`, `pay_with_financing`, or `pay_in_installments` + pub payment_method_category: Option, + /// Preferred language of the Klarna authorization page that the customer is redirected to. + /// Can be one of `de-AT`, `en-AT`, `nl-BE`, `fr-BE`, `en-BE`, `de-DE`, `en-DE`, `da-DK`, `en-DK`, `es-ES`, `en-ES`, `fi-FI`, `sv-FI`, `en-FI`, `en-GB`, `en-IE`, `it-IT`, `en-IT`, `nl-NL`, `en-NL`, `nb-NO`, `en-NO`, `sv-SE`, `en-SE`, `en-US`, `es-US`, `fr-FR`, `en-FR`, `cs-CZ`, `en-CZ`, `el-GR`, `en-GR`, `en-AU`, `en-NZ`, `en-CA`, `fr-CA`, `pl-PL`, `en-PL`, `pt-PT`, `en-PT`, `de-CH`, `fr-CH`, `it-CH`, or `en-CH`. + pub preferred_locale: Option, +} diff --git a/generated/stripe_shared/src/payment_method_details_konbini.rs b/generated/stripe_shared/src/payment_method_details_konbini.rs new file mode 100644 index 000000000..8c4c05f1b --- /dev/null +++ b/generated/stripe_shared/src/payment_method_details_konbini.rs @@ -0,0 +1,5 @@ +#[derive(Copy, Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct PaymentMethodDetailsKonbini { + /// If the payment succeeded, this contains the details of the convenience store where the payment was completed. + pub store: Option, +} diff --git a/generated/stripe_shared/src/payment_method_details_konbini_store.rs b/generated/stripe_shared/src/payment_method_details_konbini_store.rs new file mode 100644 index 000000000..5817a7f7c --- /dev/null +++ b/generated/stripe_shared/src/payment_method_details_konbini_store.rs @@ -0,0 +1,66 @@ +#[derive(Copy, Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct PaymentMethodDetailsKonbiniStore { + /// The name of the convenience store chain where the payment was completed. + pub chain: Option, +} +/// The name of the convenience store chain where the payment was completed. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum PaymentMethodDetailsKonbiniStoreChain { + Familymart, + Lawson, + Ministop, + Seicomart, +} +impl PaymentMethodDetailsKonbiniStoreChain { + pub fn as_str(self) -> &'static str { + use PaymentMethodDetailsKonbiniStoreChain::*; + match self { + Familymart => "familymart", + Lawson => "lawson", + Ministop => "ministop", + Seicomart => "seicomart", + } + } +} + +impl std::str::FromStr for PaymentMethodDetailsKonbiniStoreChain { + type Err = (); + fn from_str(s: &str) -> Result { + use PaymentMethodDetailsKonbiniStoreChain::*; + match s { + "familymart" => Ok(Familymart), + "lawson" => Ok(Lawson), + "ministop" => Ok(Ministop), + "seicomart" => Ok(Seicomart), + _ => Err(()), + } + } +} +impl std::fmt::Display for PaymentMethodDetailsKonbiniStoreChain { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for PaymentMethodDetailsKonbiniStoreChain { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for PaymentMethodDetailsKonbiniStoreChain { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for PaymentMethodDetailsKonbiniStoreChain { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| { + serde::de::Error::custom("Unknown value for PaymentMethodDetailsKonbiniStoreChain") + }) + } +} diff --git a/generated/stripe_shared/src/payment_method_details_link.rs b/generated/stripe_shared/src/payment_method_details_link.rs new file mode 100644 index 000000000..987e76d1d --- /dev/null +++ b/generated/stripe_shared/src/payment_method_details_link.rs @@ -0,0 +1,6 @@ +#[derive(Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct PaymentMethodDetailsLink { + /// Two-letter ISO code representing the funding source country beneath the Link payment. + /// You could use this attribute to get a sense of international fees. + pub country: Option, +} diff --git a/generated/stripe_shared/src/payment_method_details_multibanco.rs b/generated/stripe_shared/src/payment_method_details_multibanco.rs new file mode 100644 index 000000000..3bf8acff6 --- /dev/null +++ b/generated/stripe_shared/src/payment_method_details_multibanco.rs @@ -0,0 +1,7 @@ +#[derive(Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct PaymentMethodDetailsMultibanco { + /// Entity number associated with this Multibanco payment. + pub entity: Option, + /// Reference number associated with this Multibanco payment. + pub reference: Option, +} diff --git a/generated/stripe_shared/src/payment_method_details_oxxo.rs b/generated/stripe_shared/src/payment_method_details_oxxo.rs new file mode 100644 index 000000000..01e27e1a3 --- /dev/null +++ b/generated/stripe_shared/src/payment_method_details_oxxo.rs @@ -0,0 +1,5 @@ +#[derive(Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct PaymentMethodDetailsOxxo { + /// OXXO reference number + pub number: Option, +} diff --git a/generated/stripe_shared/src/payment_method_details_p24.rs b/generated/stripe_shared/src/payment_method_details_p24.rs new file mode 100644 index 000000000..5a69b86ef --- /dev/null +++ b/generated/stripe_shared/src/payment_method_details_p24.rs @@ -0,0 +1,142 @@ +#[derive(Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct PaymentMethodDetailsP24 { + /// The customer's bank. + /// Can be one of `ing`, `citi_handlowy`, `tmobile_usbugi_bankowe`, `plus_bank`, `etransfer_pocztowy24`, `banki_spbdzielcze`, `bank_nowy_bfg_sa`, `getin_bank`, `velobank`, `blik`, `noble_pay`, `ideabank`, `envelobank`, `santander_przelew24`, `nest_przelew`, `mbank_mtransfer`, `inteligo`, `pbac_z_ipko`, `bnp_paribas`, `credit_agricole`, `toyota_bank`, `bank_pekao_sa`, `volkswagen_bank`, `bank_millennium`, `alior_bank`, or `boz`. + pub bank: Option, + /// Unique reference for this Przelewy24 payment. + pub reference: Option, + /// Owner's verified full name. Values are verified or provided by Przelewy24 directly + /// (if supported) at the time of authorization or settlement. They cannot be set or mutated. + /// Przelewy24 rarely provides this information so the attribute is usually empty. + pub verified_name: Option, +} +/// The customer's bank. +/// Can be one of `ing`, `citi_handlowy`, `tmobile_usbugi_bankowe`, `plus_bank`, `etransfer_pocztowy24`, `banki_spbdzielcze`, `bank_nowy_bfg_sa`, `getin_bank`, `velobank`, `blik`, `noble_pay`, `ideabank`, `envelobank`, `santander_przelew24`, `nest_przelew`, `mbank_mtransfer`, `inteligo`, `pbac_z_ipko`, `bnp_paribas`, `credit_agricole`, `toyota_bank`, `bank_pekao_sa`, `volkswagen_bank`, `bank_millennium`, `alior_bank`, or `boz`. +#[derive(Copy, Clone, Eq, PartialEq)] +#[non_exhaustive] +pub enum PaymentMethodDetailsP24Bank { + AliorBank, + BankMillennium, + BankNowyBfgSa, + BankPekaoSa, + BankiSpbdzielcze, + Blik, + BnpParibas, + Boz, + CitiHandlowy, + CreditAgricole, + Envelobank, + EtransferPocztowy24, + GetinBank, + Ideabank, + Ing, + Inteligo, + MbankMtransfer, + NestPrzelew, + NoblePay, + PbacZIpko, + PlusBank, + SantanderPrzelew24, + TmobileUsbugiBankowe, + ToyotaBank, + Velobank, + VolkswagenBank, + /// An unrecognized value from Stripe. Should not be used as a request parameter. + Unknown, +} +impl PaymentMethodDetailsP24Bank { + pub fn as_str(self) -> &'static str { + use PaymentMethodDetailsP24Bank::*; + match self { + AliorBank => "alior_bank", + BankMillennium => "bank_millennium", + BankNowyBfgSa => "bank_nowy_bfg_sa", + BankPekaoSa => "bank_pekao_sa", + BankiSpbdzielcze => "banki_spbdzielcze", + Blik => "blik", + BnpParibas => "bnp_paribas", + Boz => "boz", + CitiHandlowy => "citi_handlowy", + CreditAgricole => "credit_agricole", + Envelobank => "envelobank", + EtransferPocztowy24 => "etransfer_pocztowy24", + GetinBank => "getin_bank", + Ideabank => "ideabank", + Ing => "ing", + Inteligo => "inteligo", + MbankMtransfer => "mbank_mtransfer", + NestPrzelew => "nest_przelew", + NoblePay => "noble_pay", + PbacZIpko => "pbac_z_ipko", + PlusBank => "plus_bank", + SantanderPrzelew24 => "santander_przelew24", + TmobileUsbugiBankowe => "tmobile_usbugi_bankowe", + ToyotaBank => "toyota_bank", + Velobank => "velobank", + VolkswagenBank => "volkswagen_bank", + Unknown => "unknown", + } + } +} + +impl std::str::FromStr for PaymentMethodDetailsP24Bank { + type Err = (); + fn from_str(s: &str) -> Result { + use PaymentMethodDetailsP24Bank::*; + match s { + "alior_bank" => Ok(AliorBank), + "bank_millennium" => Ok(BankMillennium), + "bank_nowy_bfg_sa" => Ok(BankNowyBfgSa), + "bank_pekao_sa" => Ok(BankPekaoSa), + "banki_spbdzielcze" => Ok(BankiSpbdzielcze), + "blik" => Ok(Blik), + "bnp_paribas" => Ok(BnpParibas), + "boz" => Ok(Boz), + "citi_handlowy" => Ok(CitiHandlowy), + "credit_agricole" => Ok(CreditAgricole), + "envelobank" => Ok(Envelobank), + "etransfer_pocztowy24" => Ok(EtransferPocztowy24), + "getin_bank" => Ok(GetinBank), + "ideabank" => Ok(Ideabank), + "ing" => Ok(Ing), + "inteligo" => Ok(Inteligo), + "mbank_mtransfer" => Ok(MbankMtransfer), + "nest_przelew" => Ok(NestPrzelew), + "noble_pay" => Ok(NoblePay), + "pbac_z_ipko" => Ok(PbacZIpko), + "plus_bank" => Ok(PlusBank), + "santander_przelew24" => Ok(SantanderPrzelew24), + "tmobile_usbugi_bankowe" => Ok(TmobileUsbugiBankowe), + "toyota_bank" => Ok(ToyotaBank), + "velobank" => Ok(Velobank), + "volkswagen_bank" => Ok(VolkswagenBank), + _ => Err(()), + } + } +} +impl std::fmt::Display for PaymentMethodDetailsP24Bank { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for PaymentMethodDetailsP24Bank { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for PaymentMethodDetailsP24Bank { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for PaymentMethodDetailsP24Bank { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Ok(Self::from_str(&s).unwrap_or(PaymentMethodDetailsP24Bank::Unknown)) + } +} diff --git a/generated/stripe_shared/src/payment_method_details_paynow.rs b/generated/stripe_shared/src/payment_method_details_paynow.rs new file mode 100644 index 000000000..7dbf13243 --- /dev/null +++ b/generated/stripe_shared/src/payment_method_details_paynow.rs @@ -0,0 +1,5 @@ +#[derive(Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct PaymentMethodDetailsPaynow { + /// Reference number associated with this PayNow payment + pub reference: Option, +} diff --git a/generated/stripe_shared/src/payment_method_details_paypal.rs b/generated/stripe_shared/src/payment_method_details_paypal.rs new file mode 100644 index 000000000..c08a36ed2 --- /dev/null +++ b/generated/stripe_shared/src/payment_method_details_paypal.rs @@ -0,0 +1,15 @@ +#[derive(Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct PaymentMethodDetailsPaypal { + /// Owner's email. Values are provided by PayPal directly + /// (if supported) at the time of authorization or settlement. They cannot be set or mutated. + pub payer_email: Option, + /// PayPal account PayerID. This identifier uniquely identifies the PayPal customer. + pub payer_id: Option, + /// Owner's full name. Values provided by PayPal directly + /// (if supported) at the time of authorization or settlement. They cannot be set or mutated. + pub payer_name: Option, + /// The level of protection offered as defined by PayPal Seller Protection for Merchants, for this transaction. + pub seller_protection: Option, + /// A unique ID generated by PayPal for this transaction. + pub transaction_id: Option, +} diff --git a/generated/stripe_shared/src/payment_method_details_pix.rs b/generated/stripe_shared/src/payment_method_details_pix.rs new file mode 100644 index 000000000..a92189d86 --- /dev/null +++ b/generated/stripe_shared/src/payment_method_details_pix.rs @@ -0,0 +1,6 @@ +#[derive(Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct PaymentMethodDetailsPix { + /// Unique transaction id generated by BCB + #[serde(skip_serializing_if = "Option::is_none")] + pub bank_transaction_id: Option, +} diff --git a/generated/stripe_shared/src/payment_method_details_promptpay.rs b/generated/stripe_shared/src/payment_method_details_promptpay.rs new file mode 100644 index 000000000..44b0d772e --- /dev/null +++ b/generated/stripe_shared/src/payment_method_details_promptpay.rs @@ -0,0 +1,5 @@ +#[derive(Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct PaymentMethodDetailsPromptpay { + /// Bill reference generated by PromptPay + pub reference: Option, +} diff --git a/generated/stripe_shared/src/payment_method_details_revolut_pay.rs b/generated/stripe_shared/src/payment_method_details_revolut_pay.rs new file mode 100644 index 000000000..8207d189c --- /dev/null +++ b/generated/stripe_shared/src/payment_method_details_revolut_pay.rs @@ -0,0 +1,2 @@ +#[derive(Copy, Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct PaymentMethodDetailsRevolutPay {} diff --git a/generated/stripe_shared/src/payment_method_details_sepa_credit_transfer.rs b/generated/stripe_shared/src/payment_method_details_sepa_credit_transfer.rs new file mode 100644 index 000000000..008b614cc --- /dev/null +++ b/generated/stripe_shared/src/payment_method_details_sepa_credit_transfer.rs @@ -0,0 +1,9 @@ +#[derive(Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct PaymentMethodDetailsSepaCreditTransfer { + /// Name of the bank associated with the bank account. + pub bank_name: Option, + /// Bank Identifier Code of the bank associated with the bank account. + pub bic: Option, + /// IBAN of the bank account to transfer funds to. + pub iban: Option, +} diff --git a/generated/stripe_shared/src/payment_method_details_sepa_debit.rs b/generated/stripe_shared/src/payment_method_details_sepa_debit.rs new file mode 100644 index 000000000..8a79283c1 --- /dev/null +++ b/generated/stripe_shared/src/payment_method_details_sepa_debit.rs @@ -0,0 +1,17 @@ +#[derive(Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct PaymentMethodDetailsSepaDebit { + /// Bank code of bank associated with the bank account. + pub bank_code: Option, + /// Branch code of bank associated with the bank account. + pub branch_code: Option, + /// Two-letter ISO code representing the country the bank account is located in. + pub country: Option, + /// Uniquely identifies this particular bank account. + /// You can use this attribute to check whether two bank accounts are the same. + pub fingerprint: Option, + /// Last four characters of the IBAN. + pub last4: Option, + /// Find the ID of the mandate used for this payment under the [payment_method_details.sepa_debit.mandate](https://stripe.com/docs/api/charges/object#charge_object-payment_method_details-sepa_debit-mandate) property on the Charge. + /// Use this mandate ID to [retrieve the Mandate](https://stripe.com/docs/api/mandates/retrieve). + pub mandate: Option, +} diff --git a/generated/stripe_shared/src/payment_method_details_sofort.rs b/generated/stripe_shared/src/payment_method_details_sofort.rs new file mode 100644 index 000000000..db61df3b6 --- /dev/null +++ b/generated/stripe_shared/src/payment_method_details_sofort.rs @@ -0,0 +1,96 @@ +#[derive(Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct PaymentMethodDetailsSofort { + /// Bank code of bank associated with the bank account. + pub bank_code: Option, + /// Name of the bank associated with the bank account. + pub bank_name: Option, + /// Bank Identifier Code of the bank associated with the bank account. + pub bic: Option, + /// Two-letter ISO code representing the country the bank account is located in. + pub country: Option, + /// The ID of the SEPA Direct Debit PaymentMethod which was generated by this Charge. + pub generated_sepa_debit: Option>, + /// The mandate for the SEPA Direct Debit PaymentMethod which was generated by this Charge. + pub generated_sepa_debit_mandate: Option>, + /// Last four characters of the IBAN. + pub iban_last4: Option, + /// Preferred language of the SOFORT authorization page that the customer is redirected to. + /// Can be one of `de`, `en`, `es`, `fr`, `it`, `nl`, or `pl` + pub preferred_language: Option, + /// Owner's verified full name. Values are verified or provided by SOFORT directly + /// (if supported) at the time of authorization or settlement. They cannot be set or mutated. + pub verified_name: Option, +} +/// Preferred language of the SOFORT authorization page that the customer is redirected to. +/// Can be one of `de`, `en`, `es`, `fr`, `it`, `nl`, or `pl` +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum PaymentMethodDetailsSofortPreferredLanguage { + De, + En, + Es, + Fr, + It, + Nl, + Pl, +} +impl PaymentMethodDetailsSofortPreferredLanguage { + pub fn as_str(self) -> &'static str { + use PaymentMethodDetailsSofortPreferredLanguage::*; + match self { + De => "de", + En => "en", + Es => "es", + Fr => "fr", + It => "it", + Nl => "nl", + Pl => "pl", + } + } +} + +impl std::str::FromStr for PaymentMethodDetailsSofortPreferredLanguage { + type Err = (); + fn from_str(s: &str) -> Result { + use PaymentMethodDetailsSofortPreferredLanguage::*; + match s { + "de" => Ok(De), + "en" => Ok(En), + "es" => Ok(Es), + "fr" => Ok(Fr), + "it" => Ok(It), + "nl" => Ok(Nl), + "pl" => Ok(Pl), + _ => Err(()), + } + } +} +impl std::fmt::Display for PaymentMethodDetailsSofortPreferredLanguage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for PaymentMethodDetailsSofortPreferredLanguage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for PaymentMethodDetailsSofortPreferredLanguage { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for PaymentMethodDetailsSofortPreferredLanguage { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| { + serde::de::Error::custom( + "Unknown value for PaymentMethodDetailsSofortPreferredLanguage", + ) + }) + } +} diff --git a/generated/stripe_shared/src/payment_method_details_stripe_account.rs b/generated/stripe_shared/src/payment_method_details_stripe_account.rs new file mode 100644 index 000000000..730157405 --- /dev/null +++ b/generated/stripe_shared/src/payment_method_details_stripe_account.rs @@ -0,0 +1,2 @@ +#[derive(Copy, Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct PaymentMethodDetailsStripeAccount {} diff --git a/generated/stripe_shared/src/payment_method_details_swish.rs b/generated/stripe_shared/src/payment_method_details_swish.rs new file mode 100644 index 000000000..26525604f --- /dev/null +++ b/generated/stripe_shared/src/payment_method_details_swish.rs @@ -0,0 +1,10 @@ +#[derive(Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct PaymentMethodDetailsSwish { + /// Uniquely identifies the payer's Swish account. + /// You can use this attribute to check whether two Swish transactions were paid for by the same payer. + pub fingerprint: Option, + /// Payer bank reference number for the payment + pub payment_reference: Option, + /// The last four digits of the Swish account phone number + pub verified_phone_last4: Option, +} diff --git a/generated/stripe_shared/src/payment_method_details_us_bank_account.rs b/generated/stripe_shared/src/payment_method_details_us_bank_account.rs new file mode 100644 index 000000000..a73587c8b --- /dev/null +++ b/generated/stripe_shared/src/payment_method_details_us_bank_account.rs @@ -0,0 +1,130 @@ +#[derive(Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct PaymentMethodDetailsUsBankAccount { + /// Account holder type: individual or company. + pub account_holder_type: Option, + /// Account type: checkings or savings. Defaults to checking if omitted. + pub account_type: Option, + /// Name of the bank associated with the bank account. + pub bank_name: Option, + /// Uniquely identifies this particular bank account. + /// You can use this attribute to check whether two bank accounts are the same. + pub fingerprint: Option, + /// Last four digits of the bank account number. + pub last4: Option, + /// Routing number of the bank account. + pub routing_number: Option, +} +/// Account holder type: individual or company. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum PaymentMethodDetailsUsBankAccountAccountHolderType { + Company, + Individual, +} +impl PaymentMethodDetailsUsBankAccountAccountHolderType { + pub fn as_str(self) -> &'static str { + use PaymentMethodDetailsUsBankAccountAccountHolderType::*; + match self { + Company => "company", + Individual => "individual", + } + } +} + +impl std::str::FromStr for PaymentMethodDetailsUsBankAccountAccountHolderType { + type Err = (); + fn from_str(s: &str) -> Result { + use PaymentMethodDetailsUsBankAccountAccountHolderType::*; + match s { + "company" => Ok(Company), + "individual" => Ok(Individual), + _ => Err(()), + } + } +} +impl std::fmt::Display for PaymentMethodDetailsUsBankAccountAccountHolderType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for PaymentMethodDetailsUsBankAccountAccountHolderType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for PaymentMethodDetailsUsBankAccountAccountHolderType { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for PaymentMethodDetailsUsBankAccountAccountHolderType { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| { + serde::de::Error::custom( + "Unknown value for PaymentMethodDetailsUsBankAccountAccountHolderType", + ) + }) + } +} +/// Account type: checkings or savings. Defaults to checking if omitted. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum PaymentMethodDetailsUsBankAccountAccountType { + Checking, + Savings, +} +impl PaymentMethodDetailsUsBankAccountAccountType { + pub fn as_str(self) -> &'static str { + use PaymentMethodDetailsUsBankAccountAccountType::*; + match self { + Checking => "checking", + Savings => "savings", + } + } +} + +impl std::str::FromStr for PaymentMethodDetailsUsBankAccountAccountType { + type Err = (); + fn from_str(s: &str) -> Result { + use PaymentMethodDetailsUsBankAccountAccountType::*; + match s { + "checking" => Ok(Checking), + "savings" => Ok(Savings), + _ => Err(()), + } + } +} +impl std::fmt::Display for PaymentMethodDetailsUsBankAccountAccountType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for PaymentMethodDetailsUsBankAccountAccountType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for PaymentMethodDetailsUsBankAccountAccountType { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for PaymentMethodDetailsUsBankAccountAccountType { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| { + serde::de::Error::custom( + "Unknown value for PaymentMethodDetailsUsBankAccountAccountType", + ) + }) + } +} diff --git a/generated/stripe_shared/src/payment_method_details_wechat.rs b/generated/stripe_shared/src/payment_method_details_wechat.rs new file mode 100644 index 000000000..33dbea74d --- /dev/null +++ b/generated/stripe_shared/src/payment_method_details_wechat.rs @@ -0,0 +1,2 @@ +#[derive(Copy, Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct PaymentMethodDetailsWechat {} diff --git a/generated/stripe_shared/src/payment_method_details_wechat_pay.rs b/generated/stripe_shared/src/payment_method_details_wechat_pay.rs new file mode 100644 index 000000000..ab0737345 --- /dev/null +++ b/generated/stripe_shared/src/payment_method_details_wechat_pay.rs @@ -0,0 +1,8 @@ +#[derive(Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct PaymentMethodDetailsWechatPay { + /// Uniquely identifies this particular WeChat Pay account. + /// You can use this attribute to check whether two WeChat accounts are the same. + pub fingerprint: Option, + /// Transaction ID of this particular WeChat Pay transaction. + pub transaction_id: Option, +} diff --git a/generated/stripe_shared/src/payment_method_details_zip.rs b/generated/stripe_shared/src/payment_method_details_zip.rs new file mode 100644 index 000000000..4dfd4c934 --- /dev/null +++ b/generated/stripe_shared/src/payment_method_details_zip.rs @@ -0,0 +1,2 @@ +#[derive(Copy, Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct PaymentMethodDetailsZip {} diff --git a/generated/stripe_shared/src/payment_method_eps.rs b/generated/stripe_shared/src/payment_method_eps.rs new file mode 100644 index 000000000..dde24edfb --- /dev/null +++ b/generated/stripe_shared/src/payment_method_eps.rs @@ -0,0 +1,142 @@ +#[derive(Copy, Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct PaymentMethodEps { + /// The customer's bank. + /// Should be one of `arzte_und_apotheker_bank`, `austrian_anadi_bank_ag`, `bank_austria`, `bankhaus_carl_spangler`, `bankhaus_schelhammer_und_schattera_ag`, `bawag_psk_ag`, `bks_bank_ag`, `brull_kallmus_bank_ag`, `btv_vier_lander_bank`, `capital_bank_grawe_gruppe_ag`, `deutsche_bank_ag`, `dolomitenbank`, `easybank_ag`, `erste_bank_und_sparkassen`, `hypo_alpeadriabank_international_ag`, `hypo_noe_lb_fur_niederosterreich_u_wien`, `hypo_oberosterreich_salzburg_steiermark`, `hypo_tirol_bank_ag`, `hypo_vorarlberg_bank_ag`, `hypo_bank_burgenland_aktiengesellschaft`, `marchfelder_bank`, `oberbank_ag`, `raiffeisen_bankengruppe_osterreich`, `schoellerbank_ag`, `sparda_bank_wien`, `volksbank_gruppe`, `volkskreditbank_ag`, or `vr_bank_braunau`. + pub bank: Option, +} +/// The customer's bank. +/// Should be one of `arzte_und_apotheker_bank`, `austrian_anadi_bank_ag`, `bank_austria`, `bankhaus_carl_spangler`, `bankhaus_schelhammer_und_schattera_ag`, `bawag_psk_ag`, `bks_bank_ag`, `brull_kallmus_bank_ag`, `btv_vier_lander_bank`, `capital_bank_grawe_gruppe_ag`, `deutsche_bank_ag`, `dolomitenbank`, `easybank_ag`, `erste_bank_und_sparkassen`, `hypo_alpeadriabank_international_ag`, `hypo_noe_lb_fur_niederosterreich_u_wien`, `hypo_oberosterreich_salzburg_steiermark`, `hypo_tirol_bank_ag`, `hypo_vorarlberg_bank_ag`, `hypo_bank_burgenland_aktiengesellschaft`, `marchfelder_bank`, `oberbank_ag`, `raiffeisen_bankengruppe_osterreich`, `schoellerbank_ag`, `sparda_bank_wien`, `volksbank_gruppe`, `volkskreditbank_ag`, or `vr_bank_braunau`. +#[derive(Copy, Clone, Eq, PartialEq)] +#[non_exhaustive] +pub enum PaymentMethodEpsBank { + ArzteUndApothekerBank, + AustrianAnadiBankAg, + BankAustria, + BankhausCarlSpangler, + BankhausSchelhammerUndSchatteraAg, + BawagPskAg, + BksBankAg, + BrullKallmusBankAg, + BtvVierLanderBank, + CapitalBankGraweGruppeAg, + DeutscheBankAg, + Dolomitenbank, + EasybankAg, + ErsteBankUndSparkassen, + HypoAlpeadriabankInternationalAg, + HypoBankBurgenlandAktiengesellschaft, + HypoNoeLbFurNiederosterreichUWien, + HypoOberosterreichSalzburgSteiermark, + HypoTirolBankAg, + HypoVorarlbergBankAg, + MarchfelderBank, + OberbankAg, + RaiffeisenBankengruppeOsterreich, + SchoellerbankAg, + SpardaBankWien, + VolksbankGruppe, + VolkskreditbankAg, + VrBankBraunau, + /// An unrecognized value from Stripe. Should not be used as a request parameter. + Unknown, +} +impl PaymentMethodEpsBank { + pub fn as_str(self) -> &'static str { + use PaymentMethodEpsBank::*; + match self { + ArzteUndApothekerBank => "arzte_und_apotheker_bank", + AustrianAnadiBankAg => "austrian_anadi_bank_ag", + BankAustria => "bank_austria", + BankhausCarlSpangler => "bankhaus_carl_spangler", + BankhausSchelhammerUndSchatteraAg => "bankhaus_schelhammer_und_schattera_ag", + BawagPskAg => "bawag_psk_ag", + BksBankAg => "bks_bank_ag", + BrullKallmusBankAg => "brull_kallmus_bank_ag", + BtvVierLanderBank => "btv_vier_lander_bank", + CapitalBankGraweGruppeAg => "capital_bank_grawe_gruppe_ag", + DeutscheBankAg => "deutsche_bank_ag", + Dolomitenbank => "dolomitenbank", + EasybankAg => "easybank_ag", + ErsteBankUndSparkassen => "erste_bank_und_sparkassen", + HypoAlpeadriabankInternationalAg => "hypo_alpeadriabank_international_ag", + HypoBankBurgenlandAktiengesellschaft => "hypo_bank_burgenland_aktiengesellschaft", + HypoNoeLbFurNiederosterreichUWien => "hypo_noe_lb_fur_niederosterreich_u_wien", + HypoOberosterreichSalzburgSteiermark => "hypo_oberosterreich_salzburg_steiermark", + HypoTirolBankAg => "hypo_tirol_bank_ag", + HypoVorarlbergBankAg => "hypo_vorarlberg_bank_ag", + MarchfelderBank => "marchfelder_bank", + OberbankAg => "oberbank_ag", + RaiffeisenBankengruppeOsterreich => "raiffeisen_bankengruppe_osterreich", + SchoellerbankAg => "schoellerbank_ag", + SpardaBankWien => "sparda_bank_wien", + VolksbankGruppe => "volksbank_gruppe", + VolkskreditbankAg => "volkskreditbank_ag", + VrBankBraunau => "vr_bank_braunau", + Unknown => "unknown", + } + } +} + +impl std::str::FromStr for PaymentMethodEpsBank { + type Err = (); + fn from_str(s: &str) -> Result { + use PaymentMethodEpsBank::*; + match s { + "arzte_und_apotheker_bank" => Ok(ArzteUndApothekerBank), + "austrian_anadi_bank_ag" => Ok(AustrianAnadiBankAg), + "bank_austria" => Ok(BankAustria), + "bankhaus_carl_spangler" => Ok(BankhausCarlSpangler), + "bankhaus_schelhammer_und_schattera_ag" => Ok(BankhausSchelhammerUndSchatteraAg), + "bawag_psk_ag" => Ok(BawagPskAg), + "bks_bank_ag" => Ok(BksBankAg), + "brull_kallmus_bank_ag" => Ok(BrullKallmusBankAg), + "btv_vier_lander_bank" => Ok(BtvVierLanderBank), + "capital_bank_grawe_gruppe_ag" => Ok(CapitalBankGraweGruppeAg), + "deutsche_bank_ag" => Ok(DeutscheBankAg), + "dolomitenbank" => Ok(Dolomitenbank), + "easybank_ag" => Ok(EasybankAg), + "erste_bank_und_sparkassen" => Ok(ErsteBankUndSparkassen), + "hypo_alpeadriabank_international_ag" => Ok(HypoAlpeadriabankInternationalAg), + "hypo_bank_burgenland_aktiengesellschaft" => Ok(HypoBankBurgenlandAktiengesellschaft), + "hypo_noe_lb_fur_niederosterreich_u_wien" => Ok(HypoNoeLbFurNiederosterreichUWien), + "hypo_oberosterreich_salzburg_steiermark" => Ok(HypoOberosterreichSalzburgSteiermark), + "hypo_tirol_bank_ag" => Ok(HypoTirolBankAg), + "hypo_vorarlberg_bank_ag" => Ok(HypoVorarlbergBankAg), + "marchfelder_bank" => Ok(MarchfelderBank), + "oberbank_ag" => Ok(OberbankAg), + "raiffeisen_bankengruppe_osterreich" => Ok(RaiffeisenBankengruppeOsterreich), + "schoellerbank_ag" => Ok(SchoellerbankAg), + "sparda_bank_wien" => Ok(SpardaBankWien), + "volksbank_gruppe" => Ok(VolksbankGruppe), + "volkskreditbank_ag" => Ok(VolkskreditbankAg), + "vr_bank_braunau" => Ok(VrBankBraunau), + _ => Err(()), + } + } +} +impl std::fmt::Display for PaymentMethodEpsBank { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for PaymentMethodEpsBank { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for PaymentMethodEpsBank { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for PaymentMethodEpsBank { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Ok(Self::from_str(&s).unwrap_or(PaymentMethodEpsBank::Unknown)) + } +} diff --git a/generated/stripe_shared/src/payment_method_fpx.rs b/generated/stripe_shared/src/payment_method_fpx.rs new file mode 100644 index 000000000..faf3c8fd6 --- /dev/null +++ b/generated/stripe_shared/src/payment_method_fpx.rs @@ -0,0 +1,181 @@ +#[derive(Copy, Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct PaymentMethodFpx { + /// Account holder type, if provided. Can be one of `individual` or `company`. + pub account_holder_type: Option, + /// The customer's bank, if provided. + /// Can be one of `affin_bank`, `agrobank`, `alliance_bank`, `ambank`, `bank_islam`, `bank_muamalat`, `bank_rakyat`, `bsn`, `cimb`, `hong_leong_bank`, `hsbc`, `kfh`, `maybank2u`, `ocbc`, `public_bank`, `rhb`, `standard_chartered`, `uob`, `deutsche_bank`, `maybank2e`, `pb_enterprise`, or `bank_of_china`. + pub bank: PaymentMethodFpxBank, +} +/// Account holder type, if provided. Can be one of `individual` or `company`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum PaymentMethodFpxAccountHolderType { + Company, + Individual, +} +impl PaymentMethodFpxAccountHolderType { + pub fn as_str(self) -> &'static str { + use PaymentMethodFpxAccountHolderType::*; + match self { + Company => "company", + Individual => "individual", + } + } +} + +impl std::str::FromStr for PaymentMethodFpxAccountHolderType { + type Err = (); + fn from_str(s: &str) -> Result { + use PaymentMethodFpxAccountHolderType::*; + match s { + "company" => Ok(Company), + "individual" => Ok(Individual), + _ => Err(()), + } + } +} +impl std::fmt::Display for PaymentMethodFpxAccountHolderType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for PaymentMethodFpxAccountHolderType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for PaymentMethodFpxAccountHolderType { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for PaymentMethodFpxAccountHolderType { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| { + serde::de::Error::custom("Unknown value for PaymentMethodFpxAccountHolderType") + }) + } +} +/// The customer's bank, if provided. +/// Can be one of `affin_bank`, `agrobank`, `alliance_bank`, `ambank`, `bank_islam`, `bank_muamalat`, `bank_rakyat`, `bsn`, `cimb`, `hong_leong_bank`, `hsbc`, `kfh`, `maybank2u`, `ocbc`, `public_bank`, `rhb`, `standard_chartered`, `uob`, `deutsche_bank`, `maybank2e`, `pb_enterprise`, or `bank_of_china`. +#[derive(Copy, Clone, Eq, PartialEq)] +#[non_exhaustive] +pub enum PaymentMethodFpxBank { + AffinBank, + Agrobank, + AllianceBank, + Ambank, + BankIslam, + BankMuamalat, + BankOfChina, + BankRakyat, + Bsn, + Cimb, + DeutscheBank, + HongLeongBank, + Hsbc, + Kfh, + Maybank2e, + Maybank2u, + Ocbc, + PbEnterprise, + PublicBank, + Rhb, + StandardChartered, + Uob, + /// An unrecognized value from Stripe. Should not be used as a request parameter. + Unknown, +} +impl PaymentMethodFpxBank { + pub fn as_str(self) -> &'static str { + use PaymentMethodFpxBank::*; + match self { + AffinBank => "affin_bank", + Agrobank => "agrobank", + AllianceBank => "alliance_bank", + Ambank => "ambank", + BankIslam => "bank_islam", + BankMuamalat => "bank_muamalat", + BankOfChina => "bank_of_china", + BankRakyat => "bank_rakyat", + Bsn => "bsn", + Cimb => "cimb", + DeutscheBank => "deutsche_bank", + HongLeongBank => "hong_leong_bank", + Hsbc => "hsbc", + Kfh => "kfh", + Maybank2e => "maybank2e", + Maybank2u => "maybank2u", + Ocbc => "ocbc", + PbEnterprise => "pb_enterprise", + PublicBank => "public_bank", + Rhb => "rhb", + StandardChartered => "standard_chartered", + Uob => "uob", + Unknown => "unknown", + } + } +} + +impl std::str::FromStr for PaymentMethodFpxBank { + type Err = (); + fn from_str(s: &str) -> Result { + use PaymentMethodFpxBank::*; + match s { + "affin_bank" => Ok(AffinBank), + "agrobank" => Ok(Agrobank), + "alliance_bank" => Ok(AllianceBank), + "ambank" => Ok(Ambank), + "bank_islam" => Ok(BankIslam), + "bank_muamalat" => Ok(BankMuamalat), + "bank_of_china" => Ok(BankOfChina), + "bank_rakyat" => Ok(BankRakyat), + "bsn" => Ok(Bsn), + "cimb" => Ok(Cimb), + "deutsche_bank" => Ok(DeutscheBank), + "hong_leong_bank" => Ok(HongLeongBank), + "hsbc" => Ok(Hsbc), + "kfh" => Ok(Kfh), + "maybank2e" => Ok(Maybank2e), + "maybank2u" => Ok(Maybank2u), + "ocbc" => Ok(Ocbc), + "pb_enterprise" => Ok(PbEnterprise), + "public_bank" => Ok(PublicBank), + "rhb" => Ok(Rhb), + "standard_chartered" => Ok(StandardChartered), + "uob" => Ok(Uob), + _ => Err(()), + } + } +} +impl std::fmt::Display for PaymentMethodFpxBank { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for PaymentMethodFpxBank { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for PaymentMethodFpxBank { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for PaymentMethodFpxBank { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Ok(Self::from_str(&s).unwrap_or(PaymentMethodFpxBank::Unknown)) + } +} diff --git a/generated/stripe_shared/src/payment_method_giropay.rs b/generated/stripe_shared/src/payment_method_giropay.rs new file mode 100644 index 000000000..1003535de --- /dev/null +++ b/generated/stripe_shared/src/payment_method_giropay.rs @@ -0,0 +1,2 @@ +#[derive(Copy, Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct PaymentMethodGiropay {} diff --git a/generated/stripe_shared/src/payment_method_grabpay.rs b/generated/stripe_shared/src/payment_method_grabpay.rs new file mode 100644 index 000000000..8832df64a --- /dev/null +++ b/generated/stripe_shared/src/payment_method_grabpay.rs @@ -0,0 +1,2 @@ +#[derive(Copy, Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct PaymentMethodGrabpay {} diff --git a/generated/stripe_shared/src/payment_method_ideal.rs b/generated/stripe_shared/src/payment_method_ideal.rs new file mode 100644 index 000000000..e5c8d7092 --- /dev/null +++ b/generated/stripe_shared/src/payment_method_ideal.rs @@ -0,0 +1,210 @@ +#[derive(Copy, Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct PaymentMethodIdeal { + /// The customer's bank, if provided. + /// Can be one of `abn_amro`, `asn_bank`, `bunq`, `handelsbanken`, `ing`, `knab`, `moneyou`, `n26`, `nn`, `rabobank`, `regiobank`, `revolut`, `sns_bank`, `triodos_bank`, `van_lanschot`, or `yoursafe`. + pub bank: Option, + /// The Bank Identifier Code of the customer's bank, if the bank was provided. + pub bic: Option, +} +/// The customer's bank, if provided. +/// Can be one of `abn_amro`, `asn_bank`, `bunq`, `handelsbanken`, `ing`, `knab`, `moneyou`, `n26`, `nn`, `rabobank`, `regiobank`, `revolut`, `sns_bank`, `triodos_bank`, `van_lanschot`, or `yoursafe`. +#[derive(Copy, Clone, Eq, PartialEq)] +#[non_exhaustive] +pub enum PaymentMethodIdealBank { + AbnAmro, + AsnBank, + Bunq, + Handelsbanken, + Ing, + Knab, + Moneyou, + N26, + Nn, + Rabobank, + Regiobank, + Revolut, + SnsBank, + TriodosBank, + VanLanschot, + Yoursafe, + /// An unrecognized value from Stripe. Should not be used as a request parameter. + Unknown, +} +impl PaymentMethodIdealBank { + pub fn as_str(self) -> &'static str { + use PaymentMethodIdealBank::*; + match self { + AbnAmro => "abn_amro", + AsnBank => "asn_bank", + Bunq => "bunq", + Handelsbanken => "handelsbanken", + Ing => "ing", + Knab => "knab", + Moneyou => "moneyou", + N26 => "n26", + Nn => "nn", + Rabobank => "rabobank", + Regiobank => "regiobank", + Revolut => "revolut", + SnsBank => "sns_bank", + TriodosBank => "triodos_bank", + VanLanschot => "van_lanschot", + Yoursafe => "yoursafe", + Unknown => "unknown", + } + } +} + +impl std::str::FromStr for PaymentMethodIdealBank { + type Err = (); + fn from_str(s: &str) -> Result { + use PaymentMethodIdealBank::*; + match s { + "abn_amro" => Ok(AbnAmro), + "asn_bank" => Ok(AsnBank), + "bunq" => Ok(Bunq), + "handelsbanken" => Ok(Handelsbanken), + "ing" => Ok(Ing), + "knab" => Ok(Knab), + "moneyou" => Ok(Moneyou), + "n26" => Ok(N26), + "nn" => Ok(Nn), + "rabobank" => Ok(Rabobank), + "regiobank" => Ok(Regiobank), + "revolut" => Ok(Revolut), + "sns_bank" => Ok(SnsBank), + "triodos_bank" => Ok(TriodosBank), + "van_lanschot" => Ok(VanLanschot), + "yoursafe" => Ok(Yoursafe), + _ => Err(()), + } + } +} +impl std::fmt::Display for PaymentMethodIdealBank { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for PaymentMethodIdealBank { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for PaymentMethodIdealBank { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for PaymentMethodIdealBank { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Ok(Self::from_str(&s).unwrap_or(PaymentMethodIdealBank::Unknown)) + } +} +/// The Bank Identifier Code of the customer's bank, if the bank was provided. +#[derive(Copy, Clone, Eq, PartialEq)] +#[non_exhaustive] +pub enum PaymentMethodIdealBic { + Abnanl2a, + Asnbnl21, + Bitsnl2a, + Bunqnl2a, + Fvlbnl22, + Handnl2a, + Ingbnl2a, + Knabnl2h, + Moyonl21, + Nnbanl2g, + Ntsbdeb1, + Rabonl2u, + Rbrbnl21, + Revoie23, + Revolt21, + Snsbnl2a, + Trionl2u, + /// An unrecognized value from Stripe. Should not be used as a request parameter. + Unknown, +} +impl PaymentMethodIdealBic { + pub fn as_str(self) -> &'static str { + use PaymentMethodIdealBic::*; + match self { + Abnanl2a => "ABNANL2A", + Asnbnl21 => "ASNBNL21", + Bitsnl2a => "BITSNL2A", + Bunqnl2a => "BUNQNL2A", + Fvlbnl22 => "FVLBNL22", + Handnl2a => "HANDNL2A", + Ingbnl2a => "INGBNL2A", + Knabnl2h => "KNABNL2H", + Moyonl21 => "MOYONL21", + Nnbanl2g => "NNBANL2G", + Ntsbdeb1 => "NTSBDEB1", + Rabonl2u => "RABONL2U", + Rbrbnl21 => "RBRBNL21", + Revoie23 => "REVOIE23", + Revolt21 => "REVOLT21", + Snsbnl2a => "SNSBNL2A", + Trionl2u => "TRIONL2U", + Unknown => "unknown", + } + } +} + +impl std::str::FromStr for PaymentMethodIdealBic { + type Err = (); + fn from_str(s: &str) -> Result { + use PaymentMethodIdealBic::*; + match s { + "ABNANL2A" => Ok(Abnanl2a), + "ASNBNL21" => Ok(Asnbnl21), + "BITSNL2A" => Ok(Bitsnl2a), + "BUNQNL2A" => Ok(Bunqnl2a), + "FVLBNL22" => Ok(Fvlbnl22), + "HANDNL2A" => Ok(Handnl2a), + "INGBNL2A" => Ok(Ingbnl2a), + "KNABNL2H" => Ok(Knabnl2h), + "MOYONL21" => Ok(Moyonl21), + "NNBANL2G" => Ok(Nnbanl2g), + "NTSBDEB1" => Ok(Ntsbdeb1), + "RABONL2U" => Ok(Rabonl2u), + "RBRBNL21" => Ok(Rbrbnl21), + "REVOIE23" => Ok(Revoie23), + "REVOLT21" => Ok(Revolt21), + "SNSBNL2A" => Ok(Snsbnl2a), + "TRIONL2U" => Ok(Trionl2u), + _ => Err(()), + } + } +} +impl std::fmt::Display for PaymentMethodIdealBic { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for PaymentMethodIdealBic { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for PaymentMethodIdealBic { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for PaymentMethodIdealBic { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Ok(Self::from_str(&s).unwrap_or(PaymentMethodIdealBic::Unknown)) + } +} diff --git a/generated/stripe_shared/src/payment_method_interac_present.rs b/generated/stripe_shared/src/payment_method_interac_present.rs new file mode 100644 index 000000000..32e84af30 --- /dev/null +++ b/generated/stripe_shared/src/payment_method_interac_present.rs @@ -0,0 +1,109 @@ +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct PaymentMethodInteracPresent { + /// Card brand. Can be `interac`, `mastercard` or `visa`. + pub brand: Option, + /// The cardholder name as read from the card, in [ISO 7813](https://en.wikipedia.org/wiki/ISO/IEC_7813) format. + /// May include alphanumeric characters, special characters and first/last name separator (`/`). + /// In some cases, the cardholder name may not be available depending on how the issuer has configured the card. + /// Cardholder name is typically not available on swipe or contactless payments, such as those made with Apple Pay and Google Pay. + pub cardholder_name: Option, + /// Two-letter ISO code representing the country of the card. + /// You could use this attribute to get a sense of the international breakdown of cards you've collected. + pub country: Option, + /// A high-level description of the type of cards issued in this range. + /// (For internal use only and not typically available in standard API requests.). + #[serde(skip_serializing_if = "Option::is_none")] + pub description: Option, + /// Two-digit number representing the card's expiration month. + pub exp_month: i64, + /// Four-digit number representing the card's expiration year. + pub exp_year: i64, + /// Uniquely identifies this particular card number. + /// You can use this attribute to check whether two customers who’ve signed up with you are using the same card number, for example. + /// For payment methods that tokenize card information (Apple Pay, Google Pay), the tokenized number might be provided instead of the underlying card number. + /// + /// *As of May 1, 2021, card fingerprint in India for Connect changed to allow two fingerprints for the same card---one for India and one for the rest of the world.*. + pub fingerprint: Option, + /// Card funding type. Can be `credit`, `debit`, `prepaid`, or `unknown`. + pub funding: Option, + /// Issuer identification number of the card. + /// (For internal use only and not typically available in standard API requests.). + #[serde(skip_serializing_if = "Option::is_none")] + pub iin: Option, + /// The name of the card's issuing bank. + /// (For internal use only and not typically available in standard API requests.). + #[serde(skip_serializing_if = "Option::is_none")] + pub issuer: Option, + /// The last four digits of the card. + pub last4: Option, + /// Contains information about card networks that can be used to process the payment. + pub networks: Option, + /// EMV tag 5F2D. Preferred languages specified by the integrated circuit chip. + pub preferred_locales: Option>, + /// How card details were read in this transaction. + pub read_method: Option, +} +/// How card details were read in this transaction. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum PaymentMethodInteracPresentReadMethod { + ContactEmv, + ContactlessEmv, + ContactlessMagstripeMode, + MagneticStripeFallback, + MagneticStripeTrack2, +} +impl PaymentMethodInteracPresentReadMethod { + pub fn as_str(self) -> &'static str { + use PaymentMethodInteracPresentReadMethod::*; + match self { + ContactEmv => "contact_emv", + ContactlessEmv => "contactless_emv", + ContactlessMagstripeMode => "contactless_magstripe_mode", + MagneticStripeFallback => "magnetic_stripe_fallback", + MagneticStripeTrack2 => "magnetic_stripe_track2", + } + } +} + +impl std::str::FromStr for PaymentMethodInteracPresentReadMethod { + type Err = (); + fn from_str(s: &str) -> Result { + use PaymentMethodInteracPresentReadMethod::*; + match s { + "contact_emv" => Ok(ContactEmv), + "contactless_emv" => Ok(ContactlessEmv), + "contactless_magstripe_mode" => Ok(ContactlessMagstripeMode), + "magnetic_stripe_fallback" => Ok(MagneticStripeFallback), + "magnetic_stripe_track2" => Ok(MagneticStripeTrack2), + _ => Err(()), + } + } +} +impl std::fmt::Display for PaymentMethodInteracPresentReadMethod { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for PaymentMethodInteracPresentReadMethod { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for PaymentMethodInteracPresentReadMethod { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for PaymentMethodInteracPresentReadMethod { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| { + serde::de::Error::custom("Unknown value for PaymentMethodInteracPresentReadMethod") + }) + } +} diff --git a/generated/stripe_shared/src/payment_method_klarna.rs b/generated/stripe_shared/src/payment_method_klarna.rs new file mode 100644 index 000000000..310d1c2b1 --- /dev/null +++ b/generated/stripe_shared/src/payment_method_klarna.rs @@ -0,0 +1,5 @@ +#[derive(Copy, Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct PaymentMethodKlarna { + /// The customer's date of birth, if provided. + pub dob: Option, +} diff --git a/generated/stripe_shared/src/payment_method_konbini.rs b/generated/stripe_shared/src/payment_method_konbini.rs new file mode 100644 index 000000000..0df2b4210 --- /dev/null +++ b/generated/stripe_shared/src/payment_method_konbini.rs @@ -0,0 +1,2 @@ +#[derive(Copy, Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct PaymentMethodKonbini {} diff --git a/generated/stripe_shared/src/payment_method_link.rs b/generated/stripe_shared/src/payment_method_link.rs new file mode 100644 index 000000000..45718fced --- /dev/null +++ b/generated/stripe_shared/src/payment_method_link.rs @@ -0,0 +1,8 @@ +#[derive(Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct PaymentMethodLink { + /// Account owner's email address. + pub email: Option, + /// \[Deprecated\] This is a legacy parameter that no longer has any function. + #[serde(skip_serializing_if = "Option::is_none")] + pub persistent_token: Option, +} diff --git a/generated/stripe_shared/src/payment_method_options_affirm.rs b/generated/stripe_shared/src/payment_method_options_affirm.rs new file mode 100644 index 000000000..a78bd6919 --- /dev/null +++ b/generated/stripe_shared/src/payment_method_options_affirm.rs @@ -0,0 +1,126 @@ +#[derive(Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct PaymentMethodOptionsAffirm { + /// Controls when the funds will be captured from the customer's account. + #[serde(skip_serializing_if = "Option::is_none")] + pub capture_method: Option, + /// Preferred language of the Affirm authorization page that the customer is redirected to. + #[serde(skip_serializing_if = "Option::is_none")] + pub preferred_locale: Option, + /// Indicates that you intend to make future payments with this PaymentIntent's payment method. + /// + /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. + /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + /// + /// When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + #[serde(skip_serializing_if = "Option::is_none")] + pub setup_future_usage: Option, +} +/// Controls when the funds will be captured from the customer's account. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum PaymentMethodOptionsAffirmCaptureMethod { + Manual, +} +impl PaymentMethodOptionsAffirmCaptureMethod { + pub fn as_str(self) -> &'static str { + use PaymentMethodOptionsAffirmCaptureMethod::*; + match self { + Manual => "manual", + } + } +} + +impl std::str::FromStr for PaymentMethodOptionsAffirmCaptureMethod { + type Err = (); + fn from_str(s: &str) -> Result { + use PaymentMethodOptionsAffirmCaptureMethod::*; + match s { + "manual" => Ok(Manual), + _ => Err(()), + } + } +} +impl std::fmt::Display for PaymentMethodOptionsAffirmCaptureMethod { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for PaymentMethodOptionsAffirmCaptureMethod { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for PaymentMethodOptionsAffirmCaptureMethod { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for PaymentMethodOptionsAffirmCaptureMethod { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| { + serde::de::Error::custom("Unknown value for PaymentMethodOptionsAffirmCaptureMethod") + }) + } +} +/// Indicates that you intend to make future payments with this PaymentIntent's payment method. +/// +/// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. +/// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. +/// +/// When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum PaymentMethodOptionsAffirmSetupFutureUsage { + None, +} +impl PaymentMethodOptionsAffirmSetupFutureUsage { + pub fn as_str(self) -> &'static str { + use PaymentMethodOptionsAffirmSetupFutureUsage::*; + match self { + None => "none", + } + } +} + +impl std::str::FromStr for PaymentMethodOptionsAffirmSetupFutureUsage { + type Err = (); + fn from_str(s: &str) -> Result { + use PaymentMethodOptionsAffirmSetupFutureUsage::*; + match s { + "none" => Ok(None), + _ => Err(()), + } + } +} +impl std::fmt::Display for PaymentMethodOptionsAffirmSetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for PaymentMethodOptionsAffirmSetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for PaymentMethodOptionsAffirmSetupFutureUsage { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for PaymentMethodOptionsAffirmSetupFutureUsage { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| { + serde::de::Error::custom("Unknown value for PaymentMethodOptionsAffirmSetupFutureUsage") + }) + } +} diff --git a/generated/stripe_shared/src/payment_method_options_afterpay_clearpay.rs b/generated/stripe_shared/src/payment_method_options_afterpay_clearpay.rs new file mode 100644 index 000000000..f07f9ec26 --- /dev/null +++ b/generated/stripe_shared/src/payment_method_options_afterpay_clearpay.rs @@ -0,0 +1,131 @@ +#[derive(Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct PaymentMethodOptionsAfterpayClearpay { + /// Controls when the funds will be captured from the customer's account. + #[serde(skip_serializing_if = "Option::is_none")] + pub capture_method: Option, + /// An internal identifier or reference that this payment corresponds to. + /// You must limit the identifier to 128 characters, and it can only contain letters, numbers, underscores, backslashes, and dashes. + /// This field differs from the statement descriptor and item name. + pub reference: Option, + /// Indicates that you intend to make future payments with this PaymentIntent's payment method. + /// + /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. + /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + /// + /// When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + #[serde(skip_serializing_if = "Option::is_none")] + pub setup_future_usage: Option, +} +/// Controls when the funds will be captured from the customer's account. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum PaymentMethodOptionsAfterpayClearpayCaptureMethod { + Manual, +} +impl PaymentMethodOptionsAfterpayClearpayCaptureMethod { + pub fn as_str(self) -> &'static str { + use PaymentMethodOptionsAfterpayClearpayCaptureMethod::*; + match self { + Manual => "manual", + } + } +} + +impl std::str::FromStr for PaymentMethodOptionsAfterpayClearpayCaptureMethod { + type Err = (); + fn from_str(s: &str) -> Result { + use PaymentMethodOptionsAfterpayClearpayCaptureMethod::*; + match s { + "manual" => Ok(Manual), + _ => Err(()), + } + } +} +impl std::fmt::Display for PaymentMethodOptionsAfterpayClearpayCaptureMethod { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for PaymentMethodOptionsAfterpayClearpayCaptureMethod { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for PaymentMethodOptionsAfterpayClearpayCaptureMethod { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for PaymentMethodOptionsAfterpayClearpayCaptureMethod { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| { + serde::de::Error::custom( + "Unknown value for PaymentMethodOptionsAfterpayClearpayCaptureMethod", + ) + }) + } +} +/// Indicates that you intend to make future payments with this PaymentIntent's payment method. +/// +/// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. +/// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. +/// +/// When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum PaymentMethodOptionsAfterpayClearpaySetupFutureUsage { + None, +} +impl PaymentMethodOptionsAfterpayClearpaySetupFutureUsage { + pub fn as_str(self) -> &'static str { + use PaymentMethodOptionsAfterpayClearpaySetupFutureUsage::*; + match self { + None => "none", + } + } +} + +impl std::str::FromStr for PaymentMethodOptionsAfterpayClearpaySetupFutureUsage { + type Err = (); + fn from_str(s: &str) -> Result { + use PaymentMethodOptionsAfterpayClearpaySetupFutureUsage::*; + match s { + "none" => Ok(None), + _ => Err(()), + } + } +} +impl std::fmt::Display for PaymentMethodOptionsAfterpayClearpaySetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for PaymentMethodOptionsAfterpayClearpaySetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for PaymentMethodOptionsAfterpayClearpaySetupFutureUsage { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for PaymentMethodOptionsAfterpayClearpaySetupFutureUsage { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| { + serde::de::Error::custom( + "Unknown value for PaymentMethodOptionsAfterpayClearpaySetupFutureUsage", + ) + }) + } +} diff --git a/generated/stripe_shared/src/payment_method_options_alipay.rs b/generated/stripe_shared/src/payment_method_options_alipay.rs new file mode 100644 index 000000000..9013c291f --- /dev/null +++ b/generated/stripe_shared/src/payment_method_options_alipay.rs @@ -0,0 +1,71 @@ +#[derive(Copy, Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct PaymentMethodOptionsAlipay { + /// Indicates that you intend to make future payments with this PaymentIntent's payment method. + /// + /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. + /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + /// + /// When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + #[serde(skip_serializing_if = "Option::is_none")] + pub setup_future_usage: Option, +} +/// Indicates that you intend to make future payments with this PaymentIntent's payment method. +/// +/// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. +/// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. +/// +/// When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum PaymentMethodOptionsAlipaySetupFutureUsage { + None, + OffSession, +} +impl PaymentMethodOptionsAlipaySetupFutureUsage { + pub fn as_str(self) -> &'static str { + use PaymentMethodOptionsAlipaySetupFutureUsage::*; + match self { + None => "none", + OffSession => "off_session", + } + } +} + +impl std::str::FromStr for PaymentMethodOptionsAlipaySetupFutureUsage { + type Err = (); + fn from_str(s: &str) -> Result { + use PaymentMethodOptionsAlipaySetupFutureUsage::*; + match s { + "none" => Ok(None), + "off_session" => Ok(OffSession), + _ => Err(()), + } + } +} +impl std::fmt::Display for PaymentMethodOptionsAlipaySetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for PaymentMethodOptionsAlipaySetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for PaymentMethodOptionsAlipaySetupFutureUsage { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for PaymentMethodOptionsAlipaySetupFutureUsage { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| { + serde::de::Error::custom("Unknown value for PaymentMethodOptionsAlipaySetupFutureUsage") + }) + } +} diff --git a/generated/stripe_shared/src/payment_method_options_bacs_debit.rs b/generated/stripe_shared/src/payment_method_options_bacs_debit.rs new file mode 100644 index 000000000..b3718bc93 --- /dev/null +++ b/generated/stripe_shared/src/payment_method_options_bacs_debit.rs @@ -0,0 +1,76 @@ +#[derive(Copy, Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct PaymentMethodOptionsBacsDebit { + /// Indicates that you intend to make future payments with this PaymentIntent's payment method. + /// + /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. + /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + /// + /// When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + #[serde(skip_serializing_if = "Option::is_none")] + pub setup_future_usage: Option, +} +/// Indicates that you intend to make future payments with this PaymentIntent's payment method. +/// +/// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. +/// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. +/// +/// When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum PaymentMethodOptionsBacsDebitSetupFutureUsage { + None, + OffSession, + OnSession, +} +impl PaymentMethodOptionsBacsDebitSetupFutureUsage { + pub fn as_str(self) -> &'static str { + use PaymentMethodOptionsBacsDebitSetupFutureUsage::*; + match self { + None => "none", + OffSession => "off_session", + OnSession => "on_session", + } + } +} + +impl std::str::FromStr for PaymentMethodOptionsBacsDebitSetupFutureUsage { + type Err = (); + fn from_str(s: &str) -> Result { + use PaymentMethodOptionsBacsDebitSetupFutureUsage::*; + match s { + "none" => Ok(None), + "off_session" => Ok(OffSession), + "on_session" => Ok(OnSession), + _ => Err(()), + } + } +} +impl std::fmt::Display for PaymentMethodOptionsBacsDebitSetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for PaymentMethodOptionsBacsDebitSetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for PaymentMethodOptionsBacsDebitSetupFutureUsage { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for PaymentMethodOptionsBacsDebitSetupFutureUsage { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| { + serde::de::Error::custom( + "Unknown value for PaymentMethodOptionsBacsDebitSetupFutureUsage", + ) + }) + } +} diff --git a/generated/stripe_shared/src/payment_method_options_bancontact.rs b/generated/stripe_shared/src/payment_method_options_bancontact.rs new file mode 100644 index 000000000..dfc086ae3 --- /dev/null +++ b/generated/stripe_shared/src/payment_method_options_bancontact.rs @@ -0,0 +1,138 @@ +#[derive(Copy, Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct PaymentMethodOptionsBancontact { + /// Preferred language of the Bancontact authorization page that the customer is redirected to. + pub preferred_language: PaymentMethodOptionsBancontactPreferredLanguage, + /// Indicates that you intend to make future payments with this PaymentIntent's payment method. + /// + /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. + /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + /// + /// When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + #[serde(skip_serializing_if = "Option::is_none")] + pub setup_future_usage: Option, +} +/// Preferred language of the Bancontact authorization page that the customer is redirected to. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum PaymentMethodOptionsBancontactPreferredLanguage { + De, + En, + Fr, + Nl, +} +impl PaymentMethodOptionsBancontactPreferredLanguage { + pub fn as_str(self) -> &'static str { + use PaymentMethodOptionsBancontactPreferredLanguage::*; + match self { + De => "de", + En => "en", + Fr => "fr", + Nl => "nl", + } + } +} + +impl std::str::FromStr for PaymentMethodOptionsBancontactPreferredLanguage { + type Err = (); + fn from_str(s: &str) -> Result { + use PaymentMethodOptionsBancontactPreferredLanguage::*; + match s { + "de" => Ok(De), + "en" => Ok(En), + "fr" => Ok(Fr), + "nl" => Ok(Nl), + _ => Err(()), + } + } +} +impl std::fmt::Display for PaymentMethodOptionsBancontactPreferredLanguage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for PaymentMethodOptionsBancontactPreferredLanguage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for PaymentMethodOptionsBancontactPreferredLanguage { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for PaymentMethodOptionsBancontactPreferredLanguage { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| { + serde::de::Error::custom( + "Unknown value for PaymentMethodOptionsBancontactPreferredLanguage", + ) + }) + } +} +/// Indicates that you intend to make future payments with this PaymentIntent's payment method. +/// +/// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. +/// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. +/// +/// When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum PaymentMethodOptionsBancontactSetupFutureUsage { + None, + OffSession, +} +impl PaymentMethodOptionsBancontactSetupFutureUsage { + pub fn as_str(self) -> &'static str { + use PaymentMethodOptionsBancontactSetupFutureUsage::*; + match self { + None => "none", + OffSession => "off_session", + } + } +} + +impl std::str::FromStr for PaymentMethodOptionsBancontactSetupFutureUsage { + type Err = (); + fn from_str(s: &str) -> Result { + use PaymentMethodOptionsBancontactSetupFutureUsage::*; + match s { + "none" => Ok(None), + "off_session" => Ok(OffSession), + _ => Err(()), + } + } +} +impl std::fmt::Display for PaymentMethodOptionsBancontactSetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for PaymentMethodOptionsBancontactSetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for PaymentMethodOptionsBancontactSetupFutureUsage { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for PaymentMethodOptionsBancontactSetupFutureUsage { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| { + serde::de::Error::custom( + "Unknown value for PaymentMethodOptionsBancontactSetupFutureUsage", + ) + }) + } +} diff --git a/generated/stripe_shared/src/payment_method_options_boleto.rs b/generated/stripe_shared/src/payment_method_options_boleto.rs new file mode 100644 index 000000000..3e72deb93 --- /dev/null +++ b/generated/stripe_shared/src/payment_method_options_boleto.rs @@ -0,0 +1,77 @@ +#[derive(Copy, Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct PaymentMethodOptionsBoleto { + /// The number of calendar days before a Boleto voucher expires. + /// For example, if you create a Boleto voucher on Monday and you set expires_after_days to 2, the Boleto voucher will expire on Wednesday at 23:59 America/Sao_Paulo time. + pub expires_after_days: u32, + /// Indicates that you intend to make future payments with this PaymentIntent's payment method. + /// + /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. + /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + /// + /// When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + #[serde(skip_serializing_if = "Option::is_none")] + pub setup_future_usage: Option, +} +/// Indicates that you intend to make future payments with this PaymentIntent's payment method. +/// +/// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. +/// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. +/// +/// When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum PaymentMethodOptionsBoletoSetupFutureUsage { + None, + OffSession, + OnSession, +} +impl PaymentMethodOptionsBoletoSetupFutureUsage { + pub fn as_str(self) -> &'static str { + use PaymentMethodOptionsBoletoSetupFutureUsage::*; + match self { + None => "none", + OffSession => "off_session", + OnSession => "on_session", + } + } +} + +impl std::str::FromStr for PaymentMethodOptionsBoletoSetupFutureUsage { + type Err = (); + fn from_str(s: &str) -> Result { + use PaymentMethodOptionsBoletoSetupFutureUsage::*; + match s { + "none" => Ok(None), + "off_session" => Ok(OffSession), + "on_session" => Ok(OnSession), + _ => Err(()), + } + } +} +impl std::fmt::Display for PaymentMethodOptionsBoletoSetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for PaymentMethodOptionsBoletoSetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for PaymentMethodOptionsBoletoSetupFutureUsage { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for PaymentMethodOptionsBoletoSetupFutureUsage { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| { + serde::de::Error::custom("Unknown value for PaymentMethodOptionsBoletoSetupFutureUsage") + }) + } +} diff --git a/generated/stripe_shared/src/payment_method_options_card_installments.rs b/generated/stripe_shared/src/payment_method_options_card_installments.rs new file mode 100644 index 000000000..067cea0d8 --- /dev/null +++ b/generated/stripe_shared/src/payment_method_options_card_installments.rs @@ -0,0 +1,9 @@ +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct PaymentMethodOptionsCardInstallments { + /// Installment plans that may be selected for this PaymentIntent. + pub available_plans: Option>, + /// Whether Installments are enabled for this PaymentIntent. + pub enabled: bool, + /// Installment plan selected for this PaymentIntent. + pub plan: Option, +} diff --git a/generated/stripe_shared/src/payment_method_options_card_mandate_options.rs b/generated/stripe_shared/src/payment_method_options_card_mandate_options.rs new file mode 100644 index 000000000..b6c34f699 --- /dev/null +++ b/generated/stripe_shared/src/payment_method_options_card_mandate_options.rs @@ -0,0 +1,207 @@ +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct PaymentMethodOptionsCardMandateOptions { + /// Amount to be charged for future payments. + pub amount: i64, + /// One of `fixed` or `maximum`. + /// If `fixed`, the `amount` param refers to the exact amount to be charged in future payments. + /// If `maximum`, the amount charged can be up to the value passed for the `amount` param. + pub amount_type: PaymentMethodOptionsCardMandateOptionsAmountType, + /// A description of the mandate or subscription that is meant to be displayed to the customer. + pub description: Option, + /// End date of the mandate or subscription. + /// If not provided, the mandate will be active until canceled. + /// If provided, end date should be after start date. + pub end_date: Option, + /// Specifies payment frequency. One of `day`, `week`, `month`, `year`, or `sporadic`. + pub interval: PaymentMethodOptionsCardMandateOptionsInterval, + /// The number of intervals between payments. + /// For example, `interval=month` and `interval_count=3` indicates one payment every three months. + /// Maximum of one year interval allowed (1 year, 12 months, or 52 weeks). + /// This parameter is optional when `interval=sporadic`. + pub interval_count: Option, + /// Unique identifier for the mandate or subscription. + pub reference: String, + /// Start date of the mandate or subscription. Start date should not be lesser than yesterday. + pub start_date: stripe_types::Timestamp, + /// Specifies the type of mandates supported. Possible values are `india`. + pub supported_types: Option>, +} +/// One of `fixed` or `maximum`. +/// If `fixed`, the `amount` param refers to the exact amount to be charged in future payments. +/// If `maximum`, the amount charged can be up to the value passed for the `amount` param. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum PaymentMethodOptionsCardMandateOptionsAmountType { + Fixed, + Maximum, +} +impl PaymentMethodOptionsCardMandateOptionsAmountType { + pub fn as_str(self) -> &'static str { + use PaymentMethodOptionsCardMandateOptionsAmountType::*; + match self { + Fixed => "fixed", + Maximum => "maximum", + } + } +} + +impl std::str::FromStr for PaymentMethodOptionsCardMandateOptionsAmountType { + type Err = (); + fn from_str(s: &str) -> Result { + use PaymentMethodOptionsCardMandateOptionsAmountType::*; + match s { + "fixed" => Ok(Fixed), + "maximum" => Ok(Maximum), + _ => Err(()), + } + } +} +impl std::fmt::Display for PaymentMethodOptionsCardMandateOptionsAmountType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for PaymentMethodOptionsCardMandateOptionsAmountType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for PaymentMethodOptionsCardMandateOptionsAmountType { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for PaymentMethodOptionsCardMandateOptionsAmountType { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| { + serde::de::Error::custom( + "Unknown value for PaymentMethodOptionsCardMandateOptionsAmountType", + ) + }) + } +} +/// Specifies payment frequency. One of `day`, `week`, `month`, `year`, or `sporadic`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum PaymentMethodOptionsCardMandateOptionsInterval { + Day, + Month, + Sporadic, + Week, + Year, +} +impl PaymentMethodOptionsCardMandateOptionsInterval { + pub fn as_str(self) -> &'static str { + use PaymentMethodOptionsCardMandateOptionsInterval::*; + match self { + Day => "day", + Month => "month", + Sporadic => "sporadic", + Week => "week", + Year => "year", + } + } +} + +impl std::str::FromStr for PaymentMethodOptionsCardMandateOptionsInterval { + type Err = (); + fn from_str(s: &str) -> Result { + use PaymentMethodOptionsCardMandateOptionsInterval::*; + match s { + "day" => Ok(Day), + "month" => Ok(Month), + "sporadic" => Ok(Sporadic), + "week" => Ok(Week), + "year" => Ok(Year), + _ => Err(()), + } + } +} +impl std::fmt::Display for PaymentMethodOptionsCardMandateOptionsInterval { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for PaymentMethodOptionsCardMandateOptionsInterval { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for PaymentMethodOptionsCardMandateOptionsInterval { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for PaymentMethodOptionsCardMandateOptionsInterval { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| { + serde::de::Error::custom( + "Unknown value for PaymentMethodOptionsCardMandateOptionsInterval", + ) + }) + } +} +/// Specifies the type of mandates supported. Possible values are `india`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum PaymentMethodOptionsCardMandateOptionsSupportedTypes { + India, +} +impl PaymentMethodOptionsCardMandateOptionsSupportedTypes { + pub fn as_str(self) -> &'static str { + use PaymentMethodOptionsCardMandateOptionsSupportedTypes::*; + match self { + India => "india", + } + } +} + +impl std::str::FromStr for PaymentMethodOptionsCardMandateOptionsSupportedTypes { + type Err = (); + fn from_str(s: &str) -> Result { + use PaymentMethodOptionsCardMandateOptionsSupportedTypes::*; + match s { + "india" => Ok(India), + _ => Err(()), + } + } +} +impl std::fmt::Display for PaymentMethodOptionsCardMandateOptionsSupportedTypes { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for PaymentMethodOptionsCardMandateOptionsSupportedTypes { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for PaymentMethodOptionsCardMandateOptionsSupportedTypes { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for PaymentMethodOptionsCardMandateOptionsSupportedTypes { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| { + serde::de::Error::custom( + "Unknown value for PaymentMethodOptionsCardMandateOptionsSupportedTypes", + ) + }) + } +} diff --git a/generated/stripe_shared/src/payment_method_options_card_present.rs b/generated/stripe_shared/src/payment_method_options_card_present.rs new file mode 100644 index 000000000..3353636b5 --- /dev/null +++ b/generated/stripe_shared/src/payment_method_options_card_present.rs @@ -0,0 +1,8 @@ +#[derive(Copy, Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct PaymentMethodOptionsCardPresent { + /// Request ability to capture this payment beyond the standard [authorization validity window](https://stripe.com/docs/terminal/features/extended-authorizations#authorization-validity). + pub request_extended_authorization: Option, + /// Request ability to [increment](https://stripe.com/docs/terminal/features/incremental-authorizations) this PaymentIntent if the combination of MCC and card brand is eligible. + /// Check [incremental_authorization_supported](https://stripe.com/docs/api/charges/object#charge_object-payment_method_details-card_present-incremental_authorization_supported) in the [Confirm](https://stripe.com/docs/api/payment_intents/confirm) response to verify support. + pub request_incremental_authorization_support: Option, +} diff --git a/generated/stripe_shared/src/payment_method_options_cashapp.rs b/generated/stripe_shared/src/payment_method_options_cashapp.rs new file mode 100644 index 000000000..09a6b462d --- /dev/null +++ b/generated/stripe_shared/src/payment_method_options_cashapp.rs @@ -0,0 +1,131 @@ +#[derive(Copy, Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct PaymentMethodOptionsCashapp { + /// Controls when the funds will be captured from the customer's account. + #[serde(skip_serializing_if = "Option::is_none")] + pub capture_method: Option, + /// Indicates that you intend to make future payments with this PaymentIntent's payment method. + /// + /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. + /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + /// + /// When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + #[serde(skip_serializing_if = "Option::is_none")] + pub setup_future_usage: Option, +} +/// Controls when the funds will be captured from the customer's account. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum PaymentMethodOptionsCashappCaptureMethod { + Manual, +} +impl PaymentMethodOptionsCashappCaptureMethod { + pub fn as_str(self) -> &'static str { + use PaymentMethodOptionsCashappCaptureMethod::*; + match self { + Manual => "manual", + } + } +} + +impl std::str::FromStr for PaymentMethodOptionsCashappCaptureMethod { + type Err = (); + fn from_str(s: &str) -> Result { + use PaymentMethodOptionsCashappCaptureMethod::*; + match s { + "manual" => Ok(Manual), + _ => Err(()), + } + } +} +impl std::fmt::Display for PaymentMethodOptionsCashappCaptureMethod { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for PaymentMethodOptionsCashappCaptureMethod { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for PaymentMethodOptionsCashappCaptureMethod { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for PaymentMethodOptionsCashappCaptureMethod { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| { + serde::de::Error::custom("Unknown value for PaymentMethodOptionsCashappCaptureMethod") + }) + } +} +/// Indicates that you intend to make future payments with this PaymentIntent's payment method. +/// +/// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. +/// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. +/// +/// When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum PaymentMethodOptionsCashappSetupFutureUsage { + None, + OffSession, + OnSession, +} +impl PaymentMethodOptionsCashappSetupFutureUsage { + pub fn as_str(self) -> &'static str { + use PaymentMethodOptionsCashappSetupFutureUsage::*; + match self { + None => "none", + OffSession => "off_session", + OnSession => "on_session", + } + } +} + +impl std::str::FromStr for PaymentMethodOptionsCashappSetupFutureUsage { + type Err = (); + fn from_str(s: &str) -> Result { + use PaymentMethodOptionsCashappSetupFutureUsage::*; + match s { + "none" => Ok(None), + "off_session" => Ok(OffSession), + "on_session" => Ok(OnSession), + _ => Err(()), + } + } +} +impl std::fmt::Display for PaymentMethodOptionsCashappSetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for PaymentMethodOptionsCashappSetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for PaymentMethodOptionsCashappSetupFutureUsage { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for PaymentMethodOptionsCashappSetupFutureUsage { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| { + serde::de::Error::custom( + "Unknown value for PaymentMethodOptionsCashappSetupFutureUsage", + ) + }) + } +} diff --git a/generated/stripe_shared/src/payment_method_options_customer_balance.rs b/generated/stripe_shared/src/payment_method_options_customer_balance.rs new file mode 100644 index 000000000..c21b5e5e7 --- /dev/null +++ b/generated/stripe_shared/src/payment_method_options_customer_balance.rs @@ -0,0 +1,130 @@ +#[derive(Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct PaymentMethodOptionsCustomerBalance { + #[serde(skip_serializing_if = "Option::is_none")] + pub bank_transfer: Option, + /// The funding method type to be used when there are not enough funds in the customer balance. + /// Permitted values include: `bank_transfer`. + pub funding_type: Option, + /// Indicates that you intend to make future payments with this PaymentIntent's payment method. + /// + /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. + /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + /// + /// When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + #[serde(skip_serializing_if = "Option::is_none")] + pub setup_future_usage: Option, +} +/// The funding method type to be used when there are not enough funds in the customer balance. +/// Permitted values include: `bank_transfer`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum PaymentMethodOptionsCustomerBalanceFundingType { + BankTransfer, +} +impl PaymentMethodOptionsCustomerBalanceFundingType { + pub fn as_str(self) -> &'static str { + use PaymentMethodOptionsCustomerBalanceFundingType::*; + match self { + BankTransfer => "bank_transfer", + } + } +} + +impl std::str::FromStr for PaymentMethodOptionsCustomerBalanceFundingType { + type Err = (); + fn from_str(s: &str) -> Result { + use PaymentMethodOptionsCustomerBalanceFundingType::*; + match s { + "bank_transfer" => Ok(BankTransfer), + _ => Err(()), + } + } +} +impl std::fmt::Display for PaymentMethodOptionsCustomerBalanceFundingType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for PaymentMethodOptionsCustomerBalanceFundingType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for PaymentMethodOptionsCustomerBalanceFundingType { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for PaymentMethodOptionsCustomerBalanceFundingType { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| { + serde::de::Error::custom( + "Unknown value for PaymentMethodOptionsCustomerBalanceFundingType", + ) + }) + } +} +/// Indicates that you intend to make future payments with this PaymentIntent's payment method. +/// +/// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. +/// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. +/// +/// When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum PaymentMethodOptionsCustomerBalanceSetupFutureUsage { + None, +} +impl PaymentMethodOptionsCustomerBalanceSetupFutureUsage { + pub fn as_str(self) -> &'static str { + use PaymentMethodOptionsCustomerBalanceSetupFutureUsage::*; + match self { + None => "none", + } + } +} + +impl std::str::FromStr for PaymentMethodOptionsCustomerBalanceSetupFutureUsage { + type Err = (); + fn from_str(s: &str) -> Result { + use PaymentMethodOptionsCustomerBalanceSetupFutureUsage::*; + match s { + "none" => Ok(None), + _ => Err(()), + } + } +} +impl std::fmt::Display for PaymentMethodOptionsCustomerBalanceSetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for PaymentMethodOptionsCustomerBalanceSetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for PaymentMethodOptionsCustomerBalanceSetupFutureUsage { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for PaymentMethodOptionsCustomerBalanceSetupFutureUsage { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| { + serde::de::Error::custom( + "Unknown value for PaymentMethodOptionsCustomerBalanceSetupFutureUsage", + ) + }) + } +} diff --git a/generated/stripe_shared/src/payment_method_options_customer_balance_bank_transfer.rs b/generated/stripe_shared/src/payment_method_options_customer_balance_bank_transfer.rs new file mode 100644 index 000000000..1ddd80ee7 --- /dev/null +++ b/generated/stripe_shared/src/payment_method_options_customer_balance_bank_transfer.rs @@ -0,0 +1,154 @@ +#[derive(Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct PaymentMethodOptionsCustomerBalanceBankTransfer { + #[serde(skip_serializing_if = "Option::is_none")] + pub eu_bank_transfer: Option, + /// List of address types that should be returned in the financial_addresses response. + /// If not specified, all valid types will be returned. + /// + /// Permitted values include: `sort_code`, `zengin`, `iban`, or `spei`. + #[serde(skip_serializing_if = "Option::is_none")] + pub requested_address_types: + Option>, + /// The bank transfer type that this PaymentIntent is allowed to use for funding Permitted values include: `eu_bank_transfer`, `gb_bank_transfer`, `jp_bank_transfer`, `mx_bank_transfer`, or `us_bank_transfer`. + #[serde(rename = "type")] + pub type_: Option, +} +/// List of address types that should be returned in the financial_addresses response. +/// If not specified, all valid types will be returned. +/// +/// Permitted values include: `sort_code`, `zengin`, `iban`, or `spei`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum PaymentMethodOptionsCustomerBalanceBankTransferRequestedAddressTypes { + Aba, + Iban, + Sepa, + SortCode, + Spei, + Swift, + Zengin, +} +impl PaymentMethodOptionsCustomerBalanceBankTransferRequestedAddressTypes { + pub fn as_str(self) -> &'static str { + use PaymentMethodOptionsCustomerBalanceBankTransferRequestedAddressTypes::*; + match self { + Aba => "aba", + Iban => "iban", + Sepa => "sepa", + SortCode => "sort_code", + Spei => "spei", + Swift => "swift", + Zengin => "zengin", + } + } +} + +impl std::str::FromStr for PaymentMethodOptionsCustomerBalanceBankTransferRequestedAddressTypes { + type Err = (); + fn from_str(s: &str) -> Result { + use PaymentMethodOptionsCustomerBalanceBankTransferRequestedAddressTypes::*; + match s { + "aba" => Ok(Aba), + "iban" => Ok(Iban), + "sepa" => Ok(Sepa), + "sort_code" => Ok(SortCode), + "spei" => Ok(Spei), + "swift" => Ok(Swift), + "zengin" => Ok(Zengin), + _ => Err(()), + } + } +} +impl std::fmt::Display for PaymentMethodOptionsCustomerBalanceBankTransferRequestedAddressTypes { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for PaymentMethodOptionsCustomerBalanceBankTransferRequestedAddressTypes { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for PaymentMethodOptionsCustomerBalanceBankTransferRequestedAddressTypes { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> + for PaymentMethodOptionsCustomerBalanceBankTransferRequestedAddressTypes +{ + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for PaymentMethodOptionsCustomerBalanceBankTransferRequestedAddressTypes")) + } +} +/// The bank transfer type that this PaymentIntent is allowed to use for funding Permitted values include: `eu_bank_transfer`, `gb_bank_transfer`, `jp_bank_transfer`, `mx_bank_transfer`, or `us_bank_transfer`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum PaymentMethodOptionsCustomerBalanceBankTransferType { + EuBankTransfer, + GbBankTransfer, + JpBankTransfer, + MxBankTransfer, + UsBankTransfer, +} +impl PaymentMethodOptionsCustomerBalanceBankTransferType { + pub fn as_str(self) -> &'static str { + use PaymentMethodOptionsCustomerBalanceBankTransferType::*; + match self { + EuBankTransfer => "eu_bank_transfer", + GbBankTransfer => "gb_bank_transfer", + JpBankTransfer => "jp_bank_transfer", + MxBankTransfer => "mx_bank_transfer", + UsBankTransfer => "us_bank_transfer", + } + } +} + +impl std::str::FromStr for PaymentMethodOptionsCustomerBalanceBankTransferType { + type Err = (); + fn from_str(s: &str) -> Result { + use PaymentMethodOptionsCustomerBalanceBankTransferType::*; + match s { + "eu_bank_transfer" => Ok(EuBankTransfer), + "gb_bank_transfer" => Ok(GbBankTransfer), + "jp_bank_transfer" => Ok(JpBankTransfer), + "mx_bank_transfer" => Ok(MxBankTransfer), + "us_bank_transfer" => Ok(UsBankTransfer), + _ => Err(()), + } + } +} +impl std::fmt::Display for PaymentMethodOptionsCustomerBalanceBankTransferType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for PaymentMethodOptionsCustomerBalanceBankTransferType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for PaymentMethodOptionsCustomerBalanceBankTransferType { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for PaymentMethodOptionsCustomerBalanceBankTransferType { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| { + serde::de::Error::custom( + "Unknown value for PaymentMethodOptionsCustomerBalanceBankTransferType", + ) + }) + } +} diff --git a/generated/stripe_shared/src/payment_method_options_customer_balance_eu_bank_account.rs b/generated/stripe_shared/src/payment_method_options_customer_balance_eu_bank_account.rs new file mode 100644 index 000000000..65c8f3252 --- /dev/null +++ b/generated/stripe_shared/src/payment_method_options_customer_balance_eu_bank_account.rs @@ -0,0 +1,76 @@ +#[derive(Copy, Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct PaymentMethodOptionsCustomerBalanceEuBankAccount { + /// The desired country code of the bank account information. + /// Permitted values include: `BE`, `DE`, `ES`, `FR`, `IE`, or `NL`. + pub country: PaymentMethodOptionsCustomerBalanceEuBankAccountCountry, +} +/// The desired country code of the bank account information. +/// Permitted values include: `BE`, `DE`, `ES`, `FR`, `IE`, or `NL`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum PaymentMethodOptionsCustomerBalanceEuBankAccountCountry { + Be, + De, + Es, + Fr, + Ie, + Nl, +} +impl PaymentMethodOptionsCustomerBalanceEuBankAccountCountry { + pub fn as_str(self) -> &'static str { + use PaymentMethodOptionsCustomerBalanceEuBankAccountCountry::*; + match self { + Be => "BE", + De => "DE", + Es => "ES", + Fr => "FR", + Ie => "IE", + Nl => "NL", + } + } +} + +impl std::str::FromStr for PaymentMethodOptionsCustomerBalanceEuBankAccountCountry { + type Err = (); + fn from_str(s: &str) -> Result { + use PaymentMethodOptionsCustomerBalanceEuBankAccountCountry::*; + match s { + "BE" => Ok(Be), + "DE" => Ok(De), + "ES" => Ok(Es), + "FR" => Ok(Fr), + "IE" => Ok(Ie), + "NL" => Ok(Nl), + _ => Err(()), + } + } +} +impl std::fmt::Display for PaymentMethodOptionsCustomerBalanceEuBankAccountCountry { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for PaymentMethodOptionsCustomerBalanceEuBankAccountCountry { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for PaymentMethodOptionsCustomerBalanceEuBankAccountCountry { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for PaymentMethodOptionsCustomerBalanceEuBankAccountCountry { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| { + serde::de::Error::custom( + "Unknown value for PaymentMethodOptionsCustomerBalanceEuBankAccountCountry", + ) + }) + } +} diff --git a/generated/stripe_shared/src/payment_method_options_fpx.rs b/generated/stripe_shared/src/payment_method_options_fpx.rs new file mode 100644 index 000000000..785d95521 --- /dev/null +++ b/generated/stripe_shared/src/payment_method_options_fpx.rs @@ -0,0 +1,68 @@ +#[derive(Copy, Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct PaymentMethodOptionsFpx { + /// Indicates that you intend to make future payments with this PaymentIntent's payment method. + /// + /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. + /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + /// + /// When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + #[serde(skip_serializing_if = "Option::is_none")] + pub setup_future_usage: Option, +} +/// Indicates that you intend to make future payments with this PaymentIntent's payment method. +/// +/// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. +/// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. +/// +/// When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum PaymentMethodOptionsFpxSetupFutureUsage { + None, +} +impl PaymentMethodOptionsFpxSetupFutureUsage { + pub fn as_str(self) -> &'static str { + use PaymentMethodOptionsFpxSetupFutureUsage::*; + match self { + None => "none", + } + } +} + +impl std::str::FromStr for PaymentMethodOptionsFpxSetupFutureUsage { + type Err = (); + fn from_str(s: &str) -> Result { + use PaymentMethodOptionsFpxSetupFutureUsage::*; + match s { + "none" => Ok(None), + _ => Err(()), + } + } +} +impl std::fmt::Display for PaymentMethodOptionsFpxSetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for PaymentMethodOptionsFpxSetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for PaymentMethodOptionsFpxSetupFutureUsage { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for PaymentMethodOptionsFpxSetupFutureUsage { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| { + serde::de::Error::custom("Unknown value for PaymentMethodOptionsFpxSetupFutureUsage") + }) + } +} diff --git a/generated/stripe_shared/src/payment_method_options_giropay.rs b/generated/stripe_shared/src/payment_method_options_giropay.rs new file mode 100644 index 000000000..27b1695f9 --- /dev/null +++ b/generated/stripe_shared/src/payment_method_options_giropay.rs @@ -0,0 +1,70 @@ +#[derive(Copy, Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct PaymentMethodOptionsGiropay { + /// Indicates that you intend to make future payments with this PaymentIntent's payment method. + /// + /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. + /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + /// + /// When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + #[serde(skip_serializing_if = "Option::is_none")] + pub setup_future_usage: Option, +} +/// Indicates that you intend to make future payments with this PaymentIntent's payment method. +/// +/// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. +/// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. +/// +/// When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum PaymentMethodOptionsGiropaySetupFutureUsage { + None, +} +impl PaymentMethodOptionsGiropaySetupFutureUsage { + pub fn as_str(self) -> &'static str { + use PaymentMethodOptionsGiropaySetupFutureUsage::*; + match self { + None => "none", + } + } +} + +impl std::str::FromStr for PaymentMethodOptionsGiropaySetupFutureUsage { + type Err = (); + fn from_str(s: &str) -> Result { + use PaymentMethodOptionsGiropaySetupFutureUsage::*; + match s { + "none" => Ok(None), + _ => Err(()), + } + } +} +impl std::fmt::Display for PaymentMethodOptionsGiropaySetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for PaymentMethodOptionsGiropaySetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for PaymentMethodOptionsGiropaySetupFutureUsage { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for PaymentMethodOptionsGiropaySetupFutureUsage { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| { + serde::de::Error::custom( + "Unknown value for PaymentMethodOptionsGiropaySetupFutureUsage", + ) + }) + } +} diff --git a/generated/stripe_shared/src/payment_method_options_grabpay.rs b/generated/stripe_shared/src/payment_method_options_grabpay.rs new file mode 100644 index 000000000..9254d1f9d --- /dev/null +++ b/generated/stripe_shared/src/payment_method_options_grabpay.rs @@ -0,0 +1,70 @@ +#[derive(Copy, Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct PaymentMethodOptionsGrabpay { + /// Indicates that you intend to make future payments with this PaymentIntent's payment method. + /// + /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. + /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + /// + /// When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + #[serde(skip_serializing_if = "Option::is_none")] + pub setup_future_usage: Option, +} +/// Indicates that you intend to make future payments with this PaymentIntent's payment method. +/// +/// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. +/// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. +/// +/// When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum PaymentMethodOptionsGrabpaySetupFutureUsage { + None, +} +impl PaymentMethodOptionsGrabpaySetupFutureUsage { + pub fn as_str(self) -> &'static str { + use PaymentMethodOptionsGrabpaySetupFutureUsage::*; + match self { + None => "none", + } + } +} + +impl std::str::FromStr for PaymentMethodOptionsGrabpaySetupFutureUsage { + type Err = (); + fn from_str(s: &str) -> Result { + use PaymentMethodOptionsGrabpaySetupFutureUsage::*; + match s { + "none" => Ok(None), + _ => Err(()), + } + } +} +impl std::fmt::Display for PaymentMethodOptionsGrabpaySetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for PaymentMethodOptionsGrabpaySetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for PaymentMethodOptionsGrabpaySetupFutureUsage { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for PaymentMethodOptionsGrabpaySetupFutureUsage { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| { + serde::de::Error::custom( + "Unknown value for PaymentMethodOptionsGrabpaySetupFutureUsage", + ) + }) + } +} diff --git a/generated/stripe_shared/src/payment_method_options_ideal.rs b/generated/stripe_shared/src/payment_method_options_ideal.rs new file mode 100644 index 000000000..7be10d3a4 --- /dev/null +++ b/generated/stripe_shared/src/payment_method_options_ideal.rs @@ -0,0 +1,71 @@ +#[derive(Copy, Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct PaymentMethodOptionsIdeal { + /// Indicates that you intend to make future payments with this PaymentIntent's payment method. + /// + /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. + /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + /// + /// When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + #[serde(skip_serializing_if = "Option::is_none")] + pub setup_future_usage: Option, +} +/// Indicates that you intend to make future payments with this PaymentIntent's payment method. +/// +/// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. +/// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. +/// +/// When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum PaymentMethodOptionsIdealSetupFutureUsage { + None, + OffSession, +} +impl PaymentMethodOptionsIdealSetupFutureUsage { + pub fn as_str(self) -> &'static str { + use PaymentMethodOptionsIdealSetupFutureUsage::*; + match self { + None => "none", + OffSession => "off_session", + } + } +} + +impl std::str::FromStr for PaymentMethodOptionsIdealSetupFutureUsage { + type Err = (); + fn from_str(s: &str) -> Result { + use PaymentMethodOptionsIdealSetupFutureUsage::*; + match s { + "none" => Ok(None), + "off_session" => Ok(OffSession), + _ => Err(()), + } + } +} +impl std::fmt::Display for PaymentMethodOptionsIdealSetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for PaymentMethodOptionsIdealSetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for PaymentMethodOptionsIdealSetupFutureUsage { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for PaymentMethodOptionsIdealSetupFutureUsage { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| { + serde::de::Error::custom("Unknown value for PaymentMethodOptionsIdealSetupFutureUsage") + }) + } +} diff --git a/generated/stripe_shared/src/payment_method_options_interac_present.rs b/generated/stripe_shared/src/payment_method_options_interac_present.rs new file mode 100644 index 000000000..702a90947 --- /dev/null +++ b/generated/stripe_shared/src/payment_method_options_interac_present.rs @@ -0,0 +1,2 @@ +#[derive(Copy, Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct PaymentMethodOptionsInteracPresent {} diff --git a/generated/stripe_shared/src/payment_method_options_klarna.rs b/generated/stripe_shared/src/payment_method_options_klarna.rs new file mode 100644 index 000000000..38cc09e99 --- /dev/null +++ b/generated/stripe_shared/src/payment_method_options_klarna.rs @@ -0,0 +1,125 @@ +#[derive(Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct PaymentMethodOptionsKlarna { + /// Controls when the funds will be captured from the customer's account. + #[serde(skip_serializing_if = "Option::is_none")] + pub capture_method: Option, + /// Preferred locale of the Klarna checkout page that the customer is redirected to. + pub preferred_locale: Option, + /// Indicates that you intend to make future payments with this PaymentIntent's payment method. + /// + /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. + /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + /// + /// When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + #[serde(skip_serializing_if = "Option::is_none")] + pub setup_future_usage: Option, +} +/// Controls when the funds will be captured from the customer's account. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum PaymentMethodOptionsKlarnaCaptureMethod { + Manual, +} +impl PaymentMethodOptionsKlarnaCaptureMethod { + pub fn as_str(self) -> &'static str { + use PaymentMethodOptionsKlarnaCaptureMethod::*; + match self { + Manual => "manual", + } + } +} + +impl std::str::FromStr for PaymentMethodOptionsKlarnaCaptureMethod { + type Err = (); + fn from_str(s: &str) -> Result { + use PaymentMethodOptionsKlarnaCaptureMethod::*; + match s { + "manual" => Ok(Manual), + _ => Err(()), + } + } +} +impl std::fmt::Display for PaymentMethodOptionsKlarnaCaptureMethod { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for PaymentMethodOptionsKlarnaCaptureMethod { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for PaymentMethodOptionsKlarnaCaptureMethod { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for PaymentMethodOptionsKlarnaCaptureMethod { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| { + serde::de::Error::custom("Unknown value for PaymentMethodOptionsKlarnaCaptureMethod") + }) + } +} +/// Indicates that you intend to make future payments with this PaymentIntent's payment method. +/// +/// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. +/// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. +/// +/// When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum PaymentMethodOptionsKlarnaSetupFutureUsage { + None, +} +impl PaymentMethodOptionsKlarnaSetupFutureUsage { + pub fn as_str(self) -> &'static str { + use PaymentMethodOptionsKlarnaSetupFutureUsage::*; + match self { + None => "none", + } + } +} + +impl std::str::FromStr for PaymentMethodOptionsKlarnaSetupFutureUsage { + type Err = (); + fn from_str(s: &str) -> Result { + use PaymentMethodOptionsKlarnaSetupFutureUsage::*; + match s { + "none" => Ok(None), + _ => Err(()), + } + } +} +impl std::fmt::Display for PaymentMethodOptionsKlarnaSetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for PaymentMethodOptionsKlarnaSetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for PaymentMethodOptionsKlarnaSetupFutureUsage { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for PaymentMethodOptionsKlarnaSetupFutureUsage { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| { + serde::de::Error::custom("Unknown value for PaymentMethodOptionsKlarnaSetupFutureUsage") + }) + } +} diff --git a/generated/stripe_shared/src/payment_method_options_konbini.rs b/generated/stripe_shared/src/payment_method_options_konbini.rs new file mode 100644 index 000000000..7efd4c2f4 --- /dev/null +++ b/generated/stripe_shared/src/payment_method_options_konbini.rs @@ -0,0 +1,80 @@ +#[derive(Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct PaymentMethodOptionsKonbini { + /// An optional 10 to 11 digit numeric-only string determining the confirmation code at applicable convenience stores. + pub confirmation_number: Option, + /// The number of calendar days (between 1 and 60) after which Konbini payment instructions will expire. + /// For example, if a PaymentIntent is confirmed with Konbini and `expires_after_days` set to 2 on Monday JST, the instructions will expire on Wednesday 23:59:59 JST. + pub expires_after_days: Option, + /// The timestamp at which the Konbini payment instructions will expire. + /// Only one of `expires_after_days` or `expires_at` may be set. + pub expires_at: Option, + /// A product descriptor of up to 22 characters, which will appear to customers at the convenience store. + pub product_description: Option, + /// Indicates that you intend to make future payments with this PaymentIntent's payment method. + /// + /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. + /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + /// + /// When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + #[serde(skip_serializing_if = "Option::is_none")] + pub setup_future_usage: Option, +} +/// Indicates that you intend to make future payments with this PaymentIntent's payment method. +/// +/// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. +/// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. +/// +/// When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum PaymentMethodOptionsKonbiniSetupFutureUsage { + None, +} +impl PaymentMethodOptionsKonbiniSetupFutureUsage { + pub fn as_str(self) -> &'static str { + use PaymentMethodOptionsKonbiniSetupFutureUsage::*; + match self { + None => "none", + } + } +} + +impl std::str::FromStr for PaymentMethodOptionsKonbiniSetupFutureUsage { + type Err = (); + fn from_str(s: &str) -> Result { + use PaymentMethodOptionsKonbiniSetupFutureUsage::*; + match s { + "none" => Ok(None), + _ => Err(()), + } + } +} +impl std::fmt::Display for PaymentMethodOptionsKonbiniSetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for PaymentMethodOptionsKonbiniSetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for PaymentMethodOptionsKonbiniSetupFutureUsage { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for PaymentMethodOptionsKonbiniSetupFutureUsage { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| { + serde::de::Error::custom( + "Unknown value for PaymentMethodOptionsKonbiniSetupFutureUsage", + ) + }) + } +} diff --git a/generated/stripe_shared/src/payment_method_options_oxxo.rs b/generated/stripe_shared/src/payment_method_options_oxxo.rs new file mode 100644 index 000000000..a1867c77e --- /dev/null +++ b/generated/stripe_shared/src/payment_method_options_oxxo.rs @@ -0,0 +1,71 @@ +#[derive(Copy, Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct PaymentMethodOptionsOxxo { + /// The number of calendar days before an OXXO invoice expires. + /// For example, if you create an OXXO invoice on Monday and you set expires_after_days to 2, the OXXO invoice will expire on Wednesday at 23:59 America/Mexico_City time. + pub expires_after_days: u32, + /// Indicates that you intend to make future payments with this PaymentIntent's payment method. + /// + /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. + /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + /// + /// When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + #[serde(skip_serializing_if = "Option::is_none")] + pub setup_future_usage: Option, +} +/// Indicates that you intend to make future payments with this PaymentIntent's payment method. +/// +/// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. +/// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. +/// +/// When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum PaymentMethodOptionsOxxoSetupFutureUsage { + None, +} +impl PaymentMethodOptionsOxxoSetupFutureUsage { + pub fn as_str(self) -> &'static str { + use PaymentMethodOptionsOxxoSetupFutureUsage::*; + match self { + None => "none", + } + } +} + +impl std::str::FromStr for PaymentMethodOptionsOxxoSetupFutureUsage { + type Err = (); + fn from_str(s: &str) -> Result { + use PaymentMethodOptionsOxxoSetupFutureUsage::*; + match s { + "none" => Ok(None), + _ => Err(()), + } + } +} +impl std::fmt::Display for PaymentMethodOptionsOxxoSetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for PaymentMethodOptionsOxxoSetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for PaymentMethodOptionsOxxoSetupFutureUsage { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for PaymentMethodOptionsOxxoSetupFutureUsage { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| { + serde::de::Error::custom("Unknown value for PaymentMethodOptionsOxxoSetupFutureUsage") + }) + } +} diff --git a/generated/stripe_shared/src/payment_method_options_p24.rs b/generated/stripe_shared/src/payment_method_options_p24.rs new file mode 100644 index 000000000..3ba6d5541 --- /dev/null +++ b/generated/stripe_shared/src/payment_method_options_p24.rs @@ -0,0 +1,68 @@ +#[derive(Copy, Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct PaymentMethodOptionsP24 { + /// Indicates that you intend to make future payments with this PaymentIntent's payment method. + /// + /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. + /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + /// + /// When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + #[serde(skip_serializing_if = "Option::is_none")] + pub setup_future_usage: Option, +} +/// Indicates that you intend to make future payments with this PaymentIntent's payment method. +/// +/// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. +/// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. +/// +/// When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum PaymentMethodOptionsP24SetupFutureUsage { + None, +} +impl PaymentMethodOptionsP24SetupFutureUsage { + pub fn as_str(self) -> &'static str { + use PaymentMethodOptionsP24SetupFutureUsage::*; + match self { + None => "none", + } + } +} + +impl std::str::FromStr for PaymentMethodOptionsP24SetupFutureUsage { + type Err = (); + fn from_str(s: &str) -> Result { + use PaymentMethodOptionsP24SetupFutureUsage::*; + match s { + "none" => Ok(None), + _ => Err(()), + } + } +} +impl std::fmt::Display for PaymentMethodOptionsP24SetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for PaymentMethodOptionsP24SetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for PaymentMethodOptionsP24SetupFutureUsage { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for PaymentMethodOptionsP24SetupFutureUsage { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| { + serde::de::Error::custom("Unknown value for PaymentMethodOptionsP24SetupFutureUsage") + }) + } +} diff --git a/generated/stripe_shared/src/payment_method_options_paynow.rs b/generated/stripe_shared/src/payment_method_options_paynow.rs new file mode 100644 index 000000000..654aa47da --- /dev/null +++ b/generated/stripe_shared/src/payment_method_options_paynow.rs @@ -0,0 +1,68 @@ +#[derive(Copy, Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct PaymentMethodOptionsPaynow { + /// Indicates that you intend to make future payments with this PaymentIntent's payment method. + /// + /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. + /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + /// + /// When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + #[serde(skip_serializing_if = "Option::is_none")] + pub setup_future_usage: Option, +} +/// Indicates that you intend to make future payments with this PaymentIntent's payment method. +/// +/// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. +/// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. +/// +/// When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum PaymentMethodOptionsPaynowSetupFutureUsage { + None, +} +impl PaymentMethodOptionsPaynowSetupFutureUsage { + pub fn as_str(self) -> &'static str { + use PaymentMethodOptionsPaynowSetupFutureUsage::*; + match self { + None => "none", + } + } +} + +impl std::str::FromStr for PaymentMethodOptionsPaynowSetupFutureUsage { + type Err = (); + fn from_str(s: &str) -> Result { + use PaymentMethodOptionsPaynowSetupFutureUsage::*; + match s { + "none" => Ok(None), + _ => Err(()), + } + } +} +impl std::fmt::Display for PaymentMethodOptionsPaynowSetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for PaymentMethodOptionsPaynowSetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for PaymentMethodOptionsPaynowSetupFutureUsage { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for PaymentMethodOptionsPaynowSetupFutureUsage { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| { + serde::de::Error::custom("Unknown value for PaymentMethodOptionsPaynowSetupFutureUsage") + }) + } +} diff --git a/generated/stripe_shared/src/payment_method_options_paypal.rs b/generated/stripe_shared/src/payment_method_options_paypal.rs new file mode 100644 index 000000000..241d948c6 --- /dev/null +++ b/generated/stripe_shared/src/payment_method_options_paypal.rs @@ -0,0 +1,131 @@ +#[derive(Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct PaymentMethodOptionsPaypal { + /// Controls when the funds will be captured from the customer's account. + #[serde(skip_serializing_if = "Option::is_none")] + pub capture_method: Option, + /// Preferred locale of the PayPal checkout page that the customer is redirected to. + pub preferred_locale: Option, + /// A reference of the PayPal transaction visible to customer which is mapped to PayPal's invoice ID. + /// This must be a globally unique ID if you have configured in your PayPal settings to block multiple payments per invoice ID. + pub reference: Option, + /// Indicates that you intend to make future payments with this PaymentIntent's payment method. + /// + /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. + /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + /// + /// When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + #[serde(skip_serializing_if = "Option::is_none")] + pub setup_future_usage: Option, +} +/// Controls when the funds will be captured from the customer's account. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum PaymentMethodOptionsPaypalCaptureMethod { + Manual, +} +impl PaymentMethodOptionsPaypalCaptureMethod { + pub fn as_str(self) -> &'static str { + use PaymentMethodOptionsPaypalCaptureMethod::*; + match self { + Manual => "manual", + } + } +} + +impl std::str::FromStr for PaymentMethodOptionsPaypalCaptureMethod { + type Err = (); + fn from_str(s: &str) -> Result { + use PaymentMethodOptionsPaypalCaptureMethod::*; + match s { + "manual" => Ok(Manual), + _ => Err(()), + } + } +} +impl std::fmt::Display for PaymentMethodOptionsPaypalCaptureMethod { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for PaymentMethodOptionsPaypalCaptureMethod { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for PaymentMethodOptionsPaypalCaptureMethod { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for PaymentMethodOptionsPaypalCaptureMethod { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| { + serde::de::Error::custom("Unknown value for PaymentMethodOptionsPaypalCaptureMethod") + }) + } +} +/// Indicates that you intend to make future payments with this PaymentIntent's payment method. +/// +/// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. +/// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. +/// +/// When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum PaymentMethodOptionsPaypalSetupFutureUsage { + None, + OffSession, +} +impl PaymentMethodOptionsPaypalSetupFutureUsage { + pub fn as_str(self) -> &'static str { + use PaymentMethodOptionsPaypalSetupFutureUsage::*; + match self { + None => "none", + OffSession => "off_session", + } + } +} + +impl std::str::FromStr for PaymentMethodOptionsPaypalSetupFutureUsage { + type Err = (); + fn from_str(s: &str) -> Result { + use PaymentMethodOptionsPaypalSetupFutureUsage::*; + match s { + "none" => Ok(None), + "off_session" => Ok(OffSession), + _ => Err(()), + } + } +} +impl std::fmt::Display for PaymentMethodOptionsPaypalSetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for PaymentMethodOptionsPaypalSetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for PaymentMethodOptionsPaypalSetupFutureUsage { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for PaymentMethodOptionsPaypalSetupFutureUsage { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| { + serde::de::Error::custom("Unknown value for PaymentMethodOptionsPaypalSetupFutureUsage") + }) + } +} diff --git a/generated/stripe_shared/src/payment_method_options_pix.rs b/generated/stripe_shared/src/payment_method_options_pix.rs new file mode 100644 index 000000000..6f79294d5 --- /dev/null +++ b/generated/stripe_shared/src/payment_method_options_pix.rs @@ -0,0 +1,72 @@ +#[derive(Copy, Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct PaymentMethodOptionsPix { + /// The number of seconds (between 10 and 1209600) after which Pix payment will expire. + pub expires_after_seconds: Option, + /// The timestamp at which the Pix expires. + pub expires_at: Option, + /// Indicates that you intend to make future payments with this PaymentIntent's payment method. + /// + /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. + /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + /// + /// When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + #[serde(skip_serializing_if = "Option::is_none")] + pub setup_future_usage: Option, +} +/// Indicates that you intend to make future payments with this PaymentIntent's payment method. +/// +/// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. +/// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. +/// +/// When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum PaymentMethodOptionsPixSetupFutureUsage { + None, +} +impl PaymentMethodOptionsPixSetupFutureUsage { + pub fn as_str(self) -> &'static str { + use PaymentMethodOptionsPixSetupFutureUsage::*; + match self { + None => "none", + } + } +} + +impl std::str::FromStr for PaymentMethodOptionsPixSetupFutureUsage { + type Err = (); + fn from_str(s: &str) -> Result { + use PaymentMethodOptionsPixSetupFutureUsage::*; + match s { + "none" => Ok(None), + _ => Err(()), + } + } +} +impl std::fmt::Display for PaymentMethodOptionsPixSetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for PaymentMethodOptionsPixSetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for PaymentMethodOptionsPixSetupFutureUsage { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for PaymentMethodOptionsPixSetupFutureUsage { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| { + serde::de::Error::custom("Unknown value for PaymentMethodOptionsPixSetupFutureUsage") + }) + } +} diff --git a/generated/stripe_shared/src/payment_method_options_promptpay.rs b/generated/stripe_shared/src/payment_method_options_promptpay.rs new file mode 100644 index 000000000..a09bb6f57 --- /dev/null +++ b/generated/stripe_shared/src/payment_method_options_promptpay.rs @@ -0,0 +1,70 @@ +#[derive(Copy, Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct PaymentMethodOptionsPromptpay { + /// Indicates that you intend to make future payments with this PaymentIntent's payment method. + /// + /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. + /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + /// + /// When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + #[serde(skip_serializing_if = "Option::is_none")] + pub setup_future_usage: Option, +} +/// Indicates that you intend to make future payments with this PaymentIntent's payment method. +/// +/// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. +/// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. +/// +/// When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum PaymentMethodOptionsPromptpaySetupFutureUsage { + None, +} +impl PaymentMethodOptionsPromptpaySetupFutureUsage { + pub fn as_str(self) -> &'static str { + use PaymentMethodOptionsPromptpaySetupFutureUsage::*; + match self { + None => "none", + } + } +} + +impl std::str::FromStr for PaymentMethodOptionsPromptpaySetupFutureUsage { + type Err = (); + fn from_str(s: &str) -> Result { + use PaymentMethodOptionsPromptpaySetupFutureUsage::*; + match s { + "none" => Ok(None), + _ => Err(()), + } + } +} +impl std::fmt::Display for PaymentMethodOptionsPromptpaySetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for PaymentMethodOptionsPromptpaySetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for PaymentMethodOptionsPromptpaySetupFutureUsage { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for PaymentMethodOptionsPromptpaySetupFutureUsage { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| { + serde::de::Error::custom( + "Unknown value for PaymentMethodOptionsPromptpaySetupFutureUsage", + ) + }) + } +} diff --git a/generated/stripe_shared/src/payment_method_options_revolut_pay.rs b/generated/stripe_shared/src/payment_method_options_revolut_pay.rs new file mode 100644 index 000000000..75f50f7a6 --- /dev/null +++ b/generated/stripe_shared/src/payment_method_options_revolut_pay.rs @@ -0,0 +1,2 @@ +#[derive(Copy, Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct PaymentMethodOptionsRevolutPay {} diff --git a/generated/stripe_shared/src/payment_method_options_sofort.rs b/generated/stripe_shared/src/payment_method_options_sofort.rs new file mode 100644 index 000000000..cfdc26e2d --- /dev/null +++ b/generated/stripe_shared/src/payment_method_options_sofort.rs @@ -0,0 +1,145 @@ +#[derive(Copy, Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct PaymentMethodOptionsSofort { + /// Preferred language of the SOFORT authorization page that the customer is redirected to. + pub preferred_language: Option, + /// Indicates that you intend to make future payments with this PaymentIntent's payment method. + /// + /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. + /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + /// + /// When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + #[serde(skip_serializing_if = "Option::is_none")] + pub setup_future_usage: Option, +} +/// Preferred language of the SOFORT authorization page that the customer is redirected to. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum PaymentMethodOptionsSofortPreferredLanguage { + De, + En, + Es, + Fr, + It, + Nl, + Pl, +} +impl PaymentMethodOptionsSofortPreferredLanguage { + pub fn as_str(self) -> &'static str { + use PaymentMethodOptionsSofortPreferredLanguage::*; + match self { + De => "de", + En => "en", + Es => "es", + Fr => "fr", + It => "it", + Nl => "nl", + Pl => "pl", + } + } +} + +impl std::str::FromStr for PaymentMethodOptionsSofortPreferredLanguage { + type Err = (); + fn from_str(s: &str) -> Result { + use PaymentMethodOptionsSofortPreferredLanguage::*; + match s { + "de" => Ok(De), + "en" => Ok(En), + "es" => Ok(Es), + "fr" => Ok(Fr), + "it" => Ok(It), + "nl" => Ok(Nl), + "pl" => Ok(Pl), + _ => Err(()), + } + } +} +impl std::fmt::Display for PaymentMethodOptionsSofortPreferredLanguage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for PaymentMethodOptionsSofortPreferredLanguage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for PaymentMethodOptionsSofortPreferredLanguage { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for PaymentMethodOptionsSofortPreferredLanguage { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| { + serde::de::Error::custom( + "Unknown value for PaymentMethodOptionsSofortPreferredLanguage", + ) + }) + } +} +/// Indicates that you intend to make future payments with this PaymentIntent's payment method. +/// +/// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. +/// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. +/// +/// When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum PaymentMethodOptionsSofortSetupFutureUsage { + None, + OffSession, +} +impl PaymentMethodOptionsSofortSetupFutureUsage { + pub fn as_str(self) -> &'static str { + use PaymentMethodOptionsSofortSetupFutureUsage::*; + match self { + None => "none", + OffSession => "off_session", + } + } +} + +impl std::str::FromStr for PaymentMethodOptionsSofortSetupFutureUsage { + type Err = (); + fn from_str(s: &str) -> Result { + use PaymentMethodOptionsSofortSetupFutureUsage::*; + match s { + "none" => Ok(None), + "off_session" => Ok(OffSession), + _ => Err(()), + } + } +} +impl std::fmt::Display for PaymentMethodOptionsSofortSetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for PaymentMethodOptionsSofortSetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for PaymentMethodOptionsSofortSetupFutureUsage { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for PaymentMethodOptionsSofortSetupFutureUsage { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| { + serde::de::Error::custom("Unknown value for PaymentMethodOptionsSofortSetupFutureUsage") + }) + } +} diff --git a/generated/stripe_shared/src/payment_method_options_us_bank_account_mandate_options.rs b/generated/stripe_shared/src/payment_method_options_us_bank_account_mandate_options.rs new file mode 100644 index 000000000..f7b0781c8 --- /dev/null +++ b/generated/stripe_shared/src/payment_method_options_us_bank_account_mandate_options.rs @@ -0,0 +1,62 @@ +#[derive(Copy, Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct PaymentMethodOptionsUsBankAccountMandateOptions { + /// Mandate collection method + #[serde(skip_serializing_if = "Option::is_none")] + pub collection_method: Option, +} +/// Mandate collection method +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum PaymentMethodOptionsUsBankAccountMandateOptionsCollectionMethod { + Paper, +} +impl PaymentMethodOptionsUsBankAccountMandateOptionsCollectionMethod { + pub fn as_str(self) -> &'static str { + use PaymentMethodOptionsUsBankAccountMandateOptionsCollectionMethod::*; + match self { + Paper => "paper", + } + } +} + +impl std::str::FromStr for PaymentMethodOptionsUsBankAccountMandateOptionsCollectionMethod { + type Err = (); + fn from_str(s: &str) -> Result { + use PaymentMethodOptionsUsBankAccountMandateOptionsCollectionMethod::*; + match s { + "paper" => Ok(Paper), + _ => Err(()), + } + } +} +impl std::fmt::Display for PaymentMethodOptionsUsBankAccountMandateOptionsCollectionMethod { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for PaymentMethodOptionsUsBankAccountMandateOptionsCollectionMethod { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for PaymentMethodOptionsUsBankAccountMandateOptionsCollectionMethod { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> + for PaymentMethodOptionsUsBankAccountMandateOptionsCollectionMethod +{ + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| { + serde::de::Error::custom( + "Unknown value for PaymentMethodOptionsUsBankAccountMandateOptionsCollectionMethod", + ) + }) + } +} diff --git a/generated/stripe_shared/src/payment_method_options_wechat_pay.rs b/generated/stripe_shared/src/payment_method_options_wechat_pay.rs new file mode 100644 index 000000000..6824715de --- /dev/null +++ b/generated/stripe_shared/src/payment_method_options_wechat_pay.rs @@ -0,0 +1,132 @@ +#[derive(Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct PaymentMethodOptionsWechatPay { + /// The app ID registered with WeChat Pay. Only required when client is ios or android. + pub app_id: Option, + /// The client type that the end customer will pay from + pub client: Option, + /// Indicates that you intend to make future payments with this PaymentIntent's payment method. + /// + /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. + /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + /// + /// When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + #[serde(skip_serializing_if = "Option::is_none")] + pub setup_future_usage: Option, +} +/// The client type that the end customer will pay from +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum PaymentMethodOptionsWechatPayClient { + Android, + Ios, + Web, +} +impl PaymentMethodOptionsWechatPayClient { + pub fn as_str(self) -> &'static str { + use PaymentMethodOptionsWechatPayClient::*; + match self { + Android => "android", + Ios => "ios", + Web => "web", + } + } +} + +impl std::str::FromStr for PaymentMethodOptionsWechatPayClient { + type Err = (); + fn from_str(s: &str) -> Result { + use PaymentMethodOptionsWechatPayClient::*; + match s { + "android" => Ok(Android), + "ios" => Ok(Ios), + "web" => Ok(Web), + _ => Err(()), + } + } +} +impl std::fmt::Display for PaymentMethodOptionsWechatPayClient { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for PaymentMethodOptionsWechatPayClient { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for PaymentMethodOptionsWechatPayClient { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for PaymentMethodOptionsWechatPayClient { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| { + serde::de::Error::custom("Unknown value for PaymentMethodOptionsWechatPayClient") + }) + } +} +/// Indicates that you intend to make future payments with this PaymentIntent's payment method. +/// +/// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. +/// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. +/// +/// When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum PaymentMethodOptionsWechatPaySetupFutureUsage { + None, +} +impl PaymentMethodOptionsWechatPaySetupFutureUsage { + pub fn as_str(self) -> &'static str { + use PaymentMethodOptionsWechatPaySetupFutureUsage::*; + match self { + None => "none", + } + } +} + +impl std::str::FromStr for PaymentMethodOptionsWechatPaySetupFutureUsage { + type Err = (); + fn from_str(s: &str) -> Result { + use PaymentMethodOptionsWechatPaySetupFutureUsage::*; + match s { + "none" => Ok(None), + _ => Err(()), + } + } +} +impl std::fmt::Display for PaymentMethodOptionsWechatPaySetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for PaymentMethodOptionsWechatPaySetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for PaymentMethodOptionsWechatPaySetupFutureUsage { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for PaymentMethodOptionsWechatPaySetupFutureUsage { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| { + serde::de::Error::custom( + "Unknown value for PaymentMethodOptionsWechatPaySetupFutureUsage", + ) + }) + } +} diff --git a/generated/stripe_shared/src/payment_method_options_zip.rs b/generated/stripe_shared/src/payment_method_options_zip.rs new file mode 100644 index 000000000..6a09ea1f5 --- /dev/null +++ b/generated/stripe_shared/src/payment_method_options_zip.rs @@ -0,0 +1,68 @@ +#[derive(Copy, Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct PaymentMethodOptionsZip { + /// Indicates that you intend to make future payments with this PaymentIntent's payment method. + /// + /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. + /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + /// + /// When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). + #[serde(skip_serializing_if = "Option::is_none")] + pub setup_future_usage: Option, +} +/// Indicates that you intend to make future payments with this PaymentIntent's payment method. +/// +/// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. +/// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. +/// +/// When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum PaymentMethodOptionsZipSetupFutureUsage { + None, +} +impl PaymentMethodOptionsZipSetupFutureUsage { + pub fn as_str(self) -> &'static str { + use PaymentMethodOptionsZipSetupFutureUsage::*; + match self { + None => "none", + } + } +} + +impl std::str::FromStr for PaymentMethodOptionsZipSetupFutureUsage { + type Err = (); + fn from_str(s: &str) -> Result { + use PaymentMethodOptionsZipSetupFutureUsage::*; + match s { + "none" => Ok(None), + _ => Err(()), + } + } +} +impl std::fmt::Display for PaymentMethodOptionsZipSetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for PaymentMethodOptionsZipSetupFutureUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for PaymentMethodOptionsZipSetupFutureUsage { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for PaymentMethodOptionsZipSetupFutureUsage { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| { + serde::de::Error::custom("Unknown value for PaymentMethodOptionsZipSetupFutureUsage") + }) + } +} diff --git a/generated/stripe_shared/src/payment_method_oxxo.rs b/generated/stripe_shared/src/payment_method_oxxo.rs new file mode 100644 index 000000000..5680d3a17 --- /dev/null +++ b/generated/stripe_shared/src/payment_method_oxxo.rs @@ -0,0 +1,2 @@ +#[derive(Copy, Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct PaymentMethodOxxo {} diff --git a/generated/stripe_shared/src/payment_method_p24.rs b/generated/stripe_shared/src/payment_method_p24.rs new file mode 100644 index 000000000..733b760de --- /dev/null +++ b/generated/stripe_shared/src/payment_method_p24.rs @@ -0,0 +1,134 @@ +#[derive(Copy, Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct PaymentMethodP24 { + /// The customer's bank, if provided. + pub bank: Option, +} +/// The customer's bank, if provided. +#[derive(Copy, Clone, Eq, PartialEq)] +#[non_exhaustive] +pub enum PaymentMethodP24Bank { + AliorBank, + BankMillennium, + BankNowyBfgSa, + BankPekaoSa, + BankiSpbdzielcze, + Blik, + BnpParibas, + Boz, + CitiHandlowy, + CreditAgricole, + Envelobank, + EtransferPocztowy24, + GetinBank, + Ideabank, + Ing, + Inteligo, + MbankMtransfer, + NestPrzelew, + NoblePay, + PbacZIpko, + PlusBank, + SantanderPrzelew24, + TmobileUsbugiBankowe, + ToyotaBank, + Velobank, + VolkswagenBank, + /// An unrecognized value from Stripe. Should not be used as a request parameter. + Unknown, +} +impl PaymentMethodP24Bank { + pub fn as_str(self) -> &'static str { + use PaymentMethodP24Bank::*; + match self { + AliorBank => "alior_bank", + BankMillennium => "bank_millennium", + BankNowyBfgSa => "bank_nowy_bfg_sa", + BankPekaoSa => "bank_pekao_sa", + BankiSpbdzielcze => "banki_spbdzielcze", + Blik => "blik", + BnpParibas => "bnp_paribas", + Boz => "boz", + CitiHandlowy => "citi_handlowy", + CreditAgricole => "credit_agricole", + Envelobank => "envelobank", + EtransferPocztowy24 => "etransfer_pocztowy24", + GetinBank => "getin_bank", + Ideabank => "ideabank", + Ing => "ing", + Inteligo => "inteligo", + MbankMtransfer => "mbank_mtransfer", + NestPrzelew => "nest_przelew", + NoblePay => "noble_pay", + PbacZIpko => "pbac_z_ipko", + PlusBank => "plus_bank", + SantanderPrzelew24 => "santander_przelew24", + TmobileUsbugiBankowe => "tmobile_usbugi_bankowe", + ToyotaBank => "toyota_bank", + Velobank => "velobank", + VolkswagenBank => "volkswagen_bank", + Unknown => "unknown", + } + } +} + +impl std::str::FromStr for PaymentMethodP24Bank { + type Err = (); + fn from_str(s: &str) -> Result { + use PaymentMethodP24Bank::*; + match s { + "alior_bank" => Ok(AliorBank), + "bank_millennium" => Ok(BankMillennium), + "bank_nowy_bfg_sa" => Ok(BankNowyBfgSa), + "bank_pekao_sa" => Ok(BankPekaoSa), + "banki_spbdzielcze" => Ok(BankiSpbdzielcze), + "blik" => Ok(Blik), + "bnp_paribas" => Ok(BnpParibas), + "boz" => Ok(Boz), + "citi_handlowy" => Ok(CitiHandlowy), + "credit_agricole" => Ok(CreditAgricole), + "envelobank" => Ok(Envelobank), + "etransfer_pocztowy24" => Ok(EtransferPocztowy24), + "getin_bank" => Ok(GetinBank), + "ideabank" => Ok(Ideabank), + "ing" => Ok(Ing), + "inteligo" => Ok(Inteligo), + "mbank_mtransfer" => Ok(MbankMtransfer), + "nest_przelew" => Ok(NestPrzelew), + "noble_pay" => Ok(NoblePay), + "pbac_z_ipko" => Ok(PbacZIpko), + "plus_bank" => Ok(PlusBank), + "santander_przelew24" => Ok(SantanderPrzelew24), + "tmobile_usbugi_bankowe" => Ok(TmobileUsbugiBankowe), + "toyota_bank" => Ok(ToyotaBank), + "velobank" => Ok(Velobank), + "volkswagen_bank" => Ok(VolkswagenBank), + _ => Err(()), + } + } +} +impl std::fmt::Display for PaymentMethodP24Bank { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for PaymentMethodP24Bank { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for PaymentMethodP24Bank { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for PaymentMethodP24Bank { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Ok(Self::from_str(&s).unwrap_or(PaymentMethodP24Bank::Unknown)) + } +} diff --git a/generated/stripe_shared/src/payment_method_paynow.rs b/generated/stripe_shared/src/payment_method_paynow.rs new file mode 100644 index 000000000..e48602eee --- /dev/null +++ b/generated/stripe_shared/src/payment_method_paynow.rs @@ -0,0 +1,2 @@ +#[derive(Copy, Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct PaymentMethodPaynow {} diff --git a/generated/stripe_shared/src/payment_method_paypal.rs b/generated/stripe_shared/src/payment_method_paypal.rs new file mode 100644 index 000000000..2f453f1b4 --- /dev/null +++ b/generated/stripe_shared/src/payment_method_paypal.rs @@ -0,0 +1,8 @@ +#[derive(Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct PaymentMethodPaypal { + /// Owner's email. Values are provided by PayPal directly + /// (if supported) at the time of authorization or settlement. They cannot be set or mutated. + pub payer_email: Option, + /// PayPal account PayerID. This identifier uniquely identifies the PayPal customer. + pub payer_id: Option, +} diff --git a/generated/stripe_shared/src/payment_method_pix.rs b/generated/stripe_shared/src/payment_method_pix.rs new file mode 100644 index 000000000..d85b9e220 --- /dev/null +++ b/generated/stripe_shared/src/payment_method_pix.rs @@ -0,0 +1,2 @@ +#[derive(Copy, Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct PaymentMethodPix {} diff --git a/generated/stripe_shared/src/payment_method_promptpay.rs b/generated/stripe_shared/src/payment_method_promptpay.rs new file mode 100644 index 000000000..6f706eb99 --- /dev/null +++ b/generated/stripe_shared/src/payment_method_promptpay.rs @@ -0,0 +1,2 @@ +#[derive(Copy, Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct PaymentMethodPromptpay {} diff --git a/generated/stripe_shared/src/payment_method_revolut_pay.rs b/generated/stripe_shared/src/payment_method_revolut_pay.rs new file mode 100644 index 000000000..d51e34e8a --- /dev/null +++ b/generated/stripe_shared/src/payment_method_revolut_pay.rs @@ -0,0 +1,2 @@ +#[derive(Copy, Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct PaymentMethodRevolutPay {} diff --git a/generated/stripe_shared/src/payment_method_sepa_debit.rs b/generated/stripe_shared/src/payment_method_sepa_debit.rs new file mode 100644 index 000000000..c68ab553e --- /dev/null +++ b/generated/stripe_shared/src/payment_method_sepa_debit.rs @@ -0,0 +1,16 @@ +#[derive(Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct PaymentMethodSepaDebit { + /// Bank code of bank associated with the bank account. + pub bank_code: Option, + /// Branch code of bank associated with the bank account. + pub branch_code: Option, + /// Two-letter ISO code representing the country the bank account is located in. + pub country: Option, + /// Uniquely identifies this particular bank account. + /// You can use this attribute to check whether two bank accounts are the same. + pub fingerprint: Option, + /// Information about the object that generated this PaymentMethod. + pub generated_from: Option, + /// Last four characters of the IBAN. + pub last4: Option, +} diff --git a/generated/stripe_shared/src/payment_method_sofort.rs b/generated/stripe_shared/src/payment_method_sofort.rs new file mode 100644 index 000000000..5932ff7bd --- /dev/null +++ b/generated/stripe_shared/src/payment_method_sofort.rs @@ -0,0 +1,5 @@ +#[derive(Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct PaymentMethodSofort { + /// Two-letter ISO code representing the country the bank account is located in. + pub country: Option, +} diff --git a/generated/stripe_shared/src/payment_method_swish.rs b/generated/stripe_shared/src/payment_method_swish.rs new file mode 100644 index 000000000..e47969890 --- /dev/null +++ b/generated/stripe_shared/src/payment_method_swish.rs @@ -0,0 +1,2 @@ +#[derive(Copy, Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct PaymentMethodSwish {} diff --git a/generated/stripe_shared/src/payment_method_us_bank_account.rs b/generated/stripe_shared/src/payment_method_us_bank_account.rs new file mode 100644 index 000000000..a485b4f71 --- /dev/null +++ b/generated/stripe_shared/src/payment_method_us_bank_account.rs @@ -0,0 +1,134 @@ +#[derive(Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct PaymentMethodUsBankAccount { + /// Account holder type: individual or company. + pub account_holder_type: Option, + /// Account type: checkings or savings. Defaults to checking if omitted. + pub account_type: Option, + /// The name of the bank. + pub bank_name: Option, + /// The ID of the Financial Connections Account used to create the payment method. + pub financial_connections_account: Option, + /// Uniquely identifies this particular bank account. + /// You can use this attribute to check whether two bank accounts are the same. + pub fingerprint: Option, + /// Last four digits of the bank account number. + pub last4: Option, + /// Contains information about US bank account networks that can be used. + pub networks: Option, + /// Routing number of the bank account. + pub routing_number: Option, + /// Contains information about the future reusability of this PaymentMethod. + pub status_details: Option, +} +/// Account holder type: individual or company. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum PaymentMethodUsBankAccountAccountHolderType { + Company, + Individual, +} +impl PaymentMethodUsBankAccountAccountHolderType { + pub fn as_str(self) -> &'static str { + use PaymentMethodUsBankAccountAccountHolderType::*; + match self { + Company => "company", + Individual => "individual", + } + } +} + +impl std::str::FromStr for PaymentMethodUsBankAccountAccountHolderType { + type Err = (); + fn from_str(s: &str) -> Result { + use PaymentMethodUsBankAccountAccountHolderType::*; + match s { + "company" => Ok(Company), + "individual" => Ok(Individual), + _ => Err(()), + } + } +} +impl std::fmt::Display for PaymentMethodUsBankAccountAccountHolderType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for PaymentMethodUsBankAccountAccountHolderType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for PaymentMethodUsBankAccountAccountHolderType { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for PaymentMethodUsBankAccountAccountHolderType { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| { + serde::de::Error::custom( + "Unknown value for PaymentMethodUsBankAccountAccountHolderType", + ) + }) + } +} +/// Account type: checkings or savings. Defaults to checking if omitted. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum PaymentMethodUsBankAccountAccountType { + Checking, + Savings, +} +impl PaymentMethodUsBankAccountAccountType { + pub fn as_str(self) -> &'static str { + use PaymentMethodUsBankAccountAccountType::*; + match self { + Checking => "checking", + Savings => "savings", + } + } +} + +impl std::str::FromStr for PaymentMethodUsBankAccountAccountType { + type Err = (); + fn from_str(s: &str) -> Result { + use PaymentMethodUsBankAccountAccountType::*; + match s { + "checking" => Ok(Checking), + "savings" => Ok(Savings), + _ => Err(()), + } + } +} +impl std::fmt::Display for PaymentMethodUsBankAccountAccountType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for PaymentMethodUsBankAccountAccountType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for PaymentMethodUsBankAccountAccountType { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for PaymentMethodUsBankAccountAccountType { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| { + serde::de::Error::custom("Unknown value for PaymentMethodUsBankAccountAccountType") + }) + } +} diff --git a/generated/stripe_shared/src/payment_method_us_bank_account_blocked.rs b/generated/stripe_shared/src/payment_method_us_bank_account_blocked.rs new file mode 100644 index 000000000..f48ef46f3 --- /dev/null +++ b/generated/stripe_shared/src/payment_method_us_bank_account_blocked.rs @@ -0,0 +1,161 @@ +#[derive(Copy, Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct PaymentMethodUsBankAccountBlocked { + /// The ACH network code that resulted in this block. + pub network_code: Option, + /// The reason why this PaymentMethod's fingerprint has been blocked + pub reason: Option, +} +/// The ACH network code that resulted in this block. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum PaymentMethodUsBankAccountBlockedNetworkCode { + R02, + R03, + R04, + R05, + R07, + R08, + R10, + R11, + R16, + R20, + R29, + R31, +} +impl PaymentMethodUsBankAccountBlockedNetworkCode { + pub fn as_str(self) -> &'static str { + use PaymentMethodUsBankAccountBlockedNetworkCode::*; + match self { + R02 => "R02", + R03 => "R03", + R04 => "R04", + R05 => "R05", + R07 => "R07", + R08 => "R08", + R10 => "R10", + R11 => "R11", + R16 => "R16", + R20 => "R20", + R29 => "R29", + R31 => "R31", + } + } +} + +impl std::str::FromStr for PaymentMethodUsBankAccountBlockedNetworkCode { + type Err = (); + fn from_str(s: &str) -> Result { + use PaymentMethodUsBankAccountBlockedNetworkCode::*; + match s { + "R02" => Ok(R02), + "R03" => Ok(R03), + "R04" => Ok(R04), + "R05" => Ok(R05), + "R07" => Ok(R07), + "R08" => Ok(R08), + "R10" => Ok(R10), + "R11" => Ok(R11), + "R16" => Ok(R16), + "R20" => Ok(R20), + "R29" => Ok(R29), + "R31" => Ok(R31), + _ => Err(()), + } + } +} +impl std::fmt::Display for PaymentMethodUsBankAccountBlockedNetworkCode { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for PaymentMethodUsBankAccountBlockedNetworkCode { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for PaymentMethodUsBankAccountBlockedNetworkCode { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for PaymentMethodUsBankAccountBlockedNetworkCode { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| { + serde::de::Error::custom( + "Unknown value for PaymentMethodUsBankAccountBlockedNetworkCode", + ) + }) + } +} +/// The reason why this PaymentMethod's fingerprint has been blocked +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum PaymentMethodUsBankAccountBlockedReason { + BankAccountClosed, + BankAccountFrozen, + BankAccountInvalidDetails, + BankAccountRestricted, + BankAccountUnusable, + DebitNotAuthorized, +} +impl PaymentMethodUsBankAccountBlockedReason { + pub fn as_str(self) -> &'static str { + use PaymentMethodUsBankAccountBlockedReason::*; + match self { + BankAccountClosed => "bank_account_closed", + BankAccountFrozen => "bank_account_frozen", + BankAccountInvalidDetails => "bank_account_invalid_details", + BankAccountRestricted => "bank_account_restricted", + BankAccountUnusable => "bank_account_unusable", + DebitNotAuthorized => "debit_not_authorized", + } + } +} + +impl std::str::FromStr for PaymentMethodUsBankAccountBlockedReason { + type Err = (); + fn from_str(s: &str) -> Result { + use PaymentMethodUsBankAccountBlockedReason::*; + match s { + "bank_account_closed" => Ok(BankAccountClosed), + "bank_account_frozen" => Ok(BankAccountFrozen), + "bank_account_invalid_details" => Ok(BankAccountInvalidDetails), + "bank_account_restricted" => Ok(BankAccountRestricted), + "bank_account_unusable" => Ok(BankAccountUnusable), + "debit_not_authorized" => Ok(DebitNotAuthorized), + _ => Err(()), + } + } +} +impl std::fmt::Display for PaymentMethodUsBankAccountBlockedReason { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for PaymentMethodUsBankAccountBlockedReason { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for PaymentMethodUsBankAccountBlockedReason { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for PaymentMethodUsBankAccountBlockedReason { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| { + serde::de::Error::custom("Unknown value for PaymentMethodUsBankAccountBlockedReason") + }) + } +} diff --git a/generated/stripe_shared/src/payment_method_us_bank_account_status_details.rs b/generated/stripe_shared/src/payment_method_us_bank_account_status_details.rs new file mode 100644 index 000000000..c721bac94 --- /dev/null +++ b/generated/stripe_shared/src/payment_method_us_bank_account_status_details.rs @@ -0,0 +1,5 @@ +#[derive(Copy, Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct PaymentMethodUsBankAccountStatusDetails { + #[serde(skip_serializing_if = "Option::is_none")] + pub blocked: Option, +} diff --git a/generated/stripe_shared/src/payment_method_wechat_pay.rs b/generated/stripe_shared/src/payment_method_wechat_pay.rs new file mode 100644 index 000000000..704c7830c --- /dev/null +++ b/generated/stripe_shared/src/payment_method_wechat_pay.rs @@ -0,0 +1,2 @@ +#[derive(Copy, Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct PaymentMethodWechatPay {} diff --git a/generated/stripe_shared/src/payment_method_zip.rs b/generated/stripe_shared/src/payment_method_zip.rs new file mode 100644 index 000000000..425e0d65f --- /dev/null +++ b/generated/stripe_shared/src/payment_method_zip.rs @@ -0,0 +1,2 @@ +#[derive(Copy, Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct PaymentMethodZip {} diff --git a/generated/stripe_shared/src/payment_source.rs b/generated/stripe_shared/src/payment_source.rs new file mode 100644 index 000000000..27ae89f32 --- /dev/null +++ b/generated/stripe_shared/src/payment_source.rs @@ -0,0 +1,24 @@ +/// The resource representing a Stripe Polymorphic +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +#[serde(tag = "object")] +pub enum PaymentSource { + #[serde(rename = "account")] + Account(stripe_shared::Account), + #[serde(rename = "bank_account")] + BankAccount(stripe_shared::BankAccount), + #[serde(rename = "card")] + Card(stripe_shared::Card), + #[serde(rename = "source")] + Source(stripe_shared::Source), +} +impl stripe_types::Object for PaymentSource { + type Id = smol_str::SmolStr; + fn id(&self) -> &Self::Id { + match self { + Self::Account(v) => v.id.inner(), + Self::BankAccount(v) => v.id.inner(), + Self::Card(v) => v.id.inner(), + Self::Source(v) => v.id.inner(), + } + } +} diff --git a/generated/stripe_shared/src/payout.rs b/generated/stripe_shared/src/payout.rs new file mode 100644 index 000000000..2bed66d8f --- /dev/null +++ b/generated/stripe_shared/src/payout.rs @@ -0,0 +1,185 @@ +/// A `Payout` object is created when you receive funds from Stripe, or when you +/// initiate a payout to either a bank account or debit card of a [connected +/// Stripe account](/docs/connect/bank-debit-card-payouts). You can retrieve individual payouts, +/// and list all payouts. Payouts are made on [varying +/// schedules](/docs/connect/manage-payout-schedule), depending on your country and +/// industry. +/// +/// Related guide: [Receiving payouts](https://stripe.com/docs/payouts) +/// +/// For more details see <>. +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct Payout { + /// The amount (in cents (or local equivalent)) that transfers to your bank account or debit card. + pub amount: i64, + /// Date that you can expect the payout to arrive in the bank. + /// This factors in delays to account for weekends or bank holidays. + pub arrival_date: stripe_types::Timestamp, + /// Returns `true` if the payout is created by an [automated payout schedule](https://stripe.com/docs/payouts#payout-schedule) and `false` if it's [requested manually](https://stripe.com/docs/payouts#manual-payouts). + pub automatic: bool, + /// ID of the balance transaction that describes the impact of this payout on your account balance. + pub balance_transaction: Option>, + /// Time at which the object was created. Measured in seconds since the Unix epoch. + pub created: stripe_types::Timestamp, + /// Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. + /// Must be a [supported currency](https://stripe.com/docs/currencies). + pub currency: stripe_types::Currency, + /// An arbitrary string attached to the object. Often useful for displaying to users. + pub description: Option, + /// ID of the bank account or card the payout is sent to. + pub destination: Option>, + /// If the payout fails or cancels, this is the ID of the balance transaction that reverses the initial balance transaction and returns the funds from the failed payout back in your balance. + pub failure_balance_transaction: + Option>, + /// Error code that provides a reason for a payout failure, if available. + /// View our [list of failure codes](https://stripe.com/docs/api#payout_failures). + pub failure_code: Option, + /// Message that provides the reason for a payout failure, if available. + pub failure_message: Option, + /// Unique identifier for the object. + pub id: stripe_shared::PayoutId, + /// Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + pub livemode: bool, + /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. + /// This can be useful for storing additional information about the object in a structured format. + pub metadata: Option>, + /// The method used to send this payout, which can be `standard` or `instant`. + /// `instant` is supported for payouts to debit cards and bank accounts in certain countries. + /// Learn more about [bank support for Instant Payouts](https://stripe.com/docs/payouts/instant-payouts-banks). + pub method: String, + /// If the payout reverses another, this is the ID of the original payout. + pub original_payout: Option>, + /// If `completed`, you can use the [Balance Transactions API](https://stripe.com/docs/api/balance_transactions/list#balance_transaction_list-payout) to list all balance transactions that are paid out in this payout. + pub reconciliation_status: PayoutReconciliationStatus, + /// If the payout reverses, this is the ID of the payout that reverses this payout. + pub reversed_by: Option>, + /// The source balance this payout came from, which can be one of the following: `card`, `fpx`, or `bank_account`. + pub source_type: String, + /// Extra information about a payout that displays on the user's bank statement. + pub statement_descriptor: Option, + /// Current status of the payout: `paid`, `pending`, `in_transit`, `canceled` or `failed`. + /// A payout is `pending` until it's submitted to the bank, when it becomes `in_transit`. + /// The status changes to `paid` if the transaction succeeds, or to `failed` or `canceled` (within 5 business days). + /// Some payouts that fail might initially show as `paid`, then change to `failed`. + pub status: String, + /// Can be `bank_account` or `card`. + #[serde(rename = "type")] + pub type_: PayoutType, +} +/// If `completed`, you can use the [Balance Transactions API](https://stripe.com/docs/api/balance_transactions/list#balance_transaction_list-payout) to list all balance transactions that are paid out in this payout. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum PayoutReconciliationStatus { + Completed, + InProgress, + NotApplicable, +} +impl PayoutReconciliationStatus { + pub fn as_str(self) -> &'static str { + use PayoutReconciliationStatus::*; + match self { + Completed => "completed", + InProgress => "in_progress", + NotApplicable => "not_applicable", + } + } +} + +impl std::str::FromStr for PayoutReconciliationStatus { + type Err = (); + fn from_str(s: &str) -> Result { + use PayoutReconciliationStatus::*; + match s { + "completed" => Ok(Completed), + "in_progress" => Ok(InProgress), + "not_applicable" => Ok(NotApplicable), + _ => Err(()), + } + } +} +impl std::fmt::Display for PayoutReconciliationStatus { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for PayoutReconciliationStatus { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for PayoutReconciliationStatus { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for PayoutReconciliationStatus { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s) + .map_err(|_| serde::de::Error::custom("Unknown value for PayoutReconciliationStatus")) + } +} +/// Can be `bank_account` or `card`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum PayoutType { + BankAccount, + Card, +} +impl PayoutType { + pub fn as_str(self) -> &'static str { + use PayoutType::*; + match self { + BankAccount => "bank_account", + Card => "card", + } + } +} + +impl std::str::FromStr for PayoutType { + type Err = (); + fn from_str(s: &str) -> Result { + use PayoutType::*; + match s { + "bank_account" => Ok(BankAccount), + "card" => Ok(Card), + _ => Err(()), + } + } +} +impl std::fmt::Display for PayoutType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for PayoutType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for PayoutType { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for PayoutType { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for PayoutType")) + } +} +impl stripe_types::Object for Payout { + type Id = stripe_shared::PayoutId; + fn id(&self) -> &Self::Id { + &self.id + } +} +stripe_types::def_id!(PayoutId, "po_"); diff --git a/generated/stripe_shared/src/paypal_seller_protection.rs b/generated/stripe_shared/src/paypal_seller_protection.rs new file mode 100644 index 000000000..cf524141f --- /dev/null +++ b/generated/stripe_shared/src/paypal_seller_protection.rs @@ -0,0 +1,119 @@ +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct PaypalSellerProtection { + /// An array of conditions that are covered for the transaction, if applicable. + pub dispute_categories: Option>, + /// Indicates whether the transaction is eligible for PayPal's seller protection. + pub status: PaypalSellerProtectionStatus, +} +/// An array of conditions that are covered for the transaction, if applicable. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum PaypalSellerProtectionDisputeCategories { + Fraudulent, + ProductNotReceived, +} +impl PaypalSellerProtectionDisputeCategories { + pub fn as_str(self) -> &'static str { + use PaypalSellerProtectionDisputeCategories::*; + match self { + Fraudulent => "fraudulent", + ProductNotReceived => "product_not_received", + } + } +} + +impl std::str::FromStr for PaypalSellerProtectionDisputeCategories { + type Err = (); + fn from_str(s: &str) -> Result { + use PaypalSellerProtectionDisputeCategories::*; + match s { + "fraudulent" => Ok(Fraudulent), + "product_not_received" => Ok(ProductNotReceived), + _ => Err(()), + } + } +} +impl std::fmt::Display for PaypalSellerProtectionDisputeCategories { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for PaypalSellerProtectionDisputeCategories { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for PaypalSellerProtectionDisputeCategories { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for PaypalSellerProtectionDisputeCategories { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| { + serde::de::Error::custom("Unknown value for PaypalSellerProtectionDisputeCategories") + }) + } +} +/// Indicates whether the transaction is eligible for PayPal's seller protection. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum PaypalSellerProtectionStatus { + Eligible, + NotEligible, + PartiallyEligible, +} +impl PaypalSellerProtectionStatus { + pub fn as_str(self) -> &'static str { + use PaypalSellerProtectionStatus::*; + match self { + Eligible => "eligible", + NotEligible => "not_eligible", + PartiallyEligible => "partially_eligible", + } + } +} + +impl std::str::FromStr for PaypalSellerProtectionStatus { + type Err = (); + fn from_str(s: &str) -> Result { + use PaypalSellerProtectionStatus::*; + match s { + "eligible" => Ok(Eligible), + "not_eligible" => Ok(NotEligible), + "partially_eligible" => Ok(PartiallyEligible), + _ => Err(()), + } + } +} +impl std::fmt::Display for PaypalSellerProtectionStatus { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for PaypalSellerProtectionStatus { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for PaypalSellerProtectionStatus { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for PaypalSellerProtectionStatus { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s) + .map_err(|_| serde::de::Error::custom("Unknown value for PaypalSellerProtectionStatus")) + } +} diff --git a/generated/stripe_shared/src/period.rs b/generated/stripe_shared/src/period.rs new file mode 100644 index 000000000..5dd14f7fd --- /dev/null +++ b/generated/stripe_shared/src/period.rs @@ -0,0 +1,7 @@ +#[derive(Copy, Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct Period { + /// The end date of this usage period. All usage up to and including this point in time is included. + pub end: Option, + /// The start date of this usage period. All usage after this point in time is included. + pub start: Option, +} diff --git a/generated/stripe_shared/src/person.rs b/generated/stripe_shared/src/person.rs new file mode 100644 index 000000000..9389f82c4 --- /dev/null +++ b/generated/stripe_shared/src/person.rs @@ -0,0 +1,157 @@ +/// This is an object representing a person associated with a Stripe account. +/// +/// A platform cannot access a Standard or Express account's persons after the account starts onboarding, such as after generating an account link for the account. +/// See the [Standard onboarding](https://stripe.com/docs/connect/standard-accounts) or [Express onboarding documentation](https://stripe.com/docs/connect/express-accounts) for information about platform prefilling and account onboarding steps. +/// +/// Related guide: [Handling identity verification with the API](https://stripe.com/docs/connect/handling-api-verification#person-information). +/// +/// For more details see <>. +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct Person { + /// The account the person is associated with. + #[serde(skip_serializing_if = "Option::is_none")] + pub account: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub additional_tos_acceptances: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub address: Option, + /// The Kana variation of the person's address (Japan only). + #[serde(skip_serializing_if = "Option::is_none")] + pub address_kana: Option, + /// The Kanji variation of the person's address (Japan only). + #[serde(skip_serializing_if = "Option::is_none")] + pub address_kanji: Option, + /// Time at which the object was created. Measured in seconds since the Unix epoch. + pub created: stripe_types::Timestamp, + #[serde(skip_serializing_if = "Option::is_none")] + pub dob: Option, + /// The person's email address. + #[serde(skip_serializing_if = "Option::is_none")] + pub email: Option, + /// The person's first name. + #[serde(skip_serializing_if = "Option::is_none")] + pub first_name: Option, + /// The Kana variation of the person's first name (Japan only). + #[serde(skip_serializing_if = "Option::is_none")] + pub first_name_kana: Option, + /// The Kanji variation of the person's first name (Japan only). + #[serde(skip_serializing_if = "Option::is_none")] + pub first_name_kanji: Option, + /// A list of alternate names or aliases that the person is known by. + #[serde(skip_serializing_if = "Option::is_none")] + pub full_name_aliases: Option>, + /// Information about the [upcoming new requirements for this person](https://stripe.com/docs/connect/custom-accounts/future-requirements), including what information needs to be collected, and by when. + #[serde(skip_serializing_if = "Option::is_none")] + pub future_requirements: Option, + /// The person's gender (International regulations require either "male" or "female"). + #[serde(skip_serializing_if = "Option::is_none")] + pub gender: Option, + /// Unique identifier for the object. + pub id: stripe_shared::PersonId, + /// Whether the person's `id_number` was provided. + /// True if either the full ID number was provided or if only the required part of the ID number was provided (ex. + /// last four of an individual's SSN for the US indicated by `ssn_last_4_provided`). + #[serde(skip_serializing_if = "Option::is_none")] + pub id_number_provided: Option, + /// Whether the person's `id_number_secondary` was provided. + #[serde(skip_serializing_if = "Option::is_none")] + pub id_number_secondary_provided: Option, + /// The person's last name. + #[serde(skip_serializing_if = "Option::is_none")] + pub last_name: Option, + /// The Kana variation of the person's last name (Japan only). + #[serde(skip_serializing_if = "Option::is_none")] + pub last_name_kana: Option, + /// The Kanji variation of the person's last name (Japan only). + #[serde(skip_serializing_if = "Option::is_none")] + pub last_name_kanji: Option, + /// The person's maiden name. + #[serde(skip_serializing_if = "Option::is_none")] + pub maiden_name: Option, + /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. + /// This can be useful for storing additional information about the object in a structured format. + #[serde(skip_serializing_if = "Option::is_none")] + pub metadata: Option>, + /// The country where the person is a national. + #[serde(skip_serializing_if = "Option::is_none")] + pub nationality: Option, + /// The person's phone number. + #[serde(skip_serializing_if = "Option::is_none")] + pub phone: Option, + /// Indicates if the person or any of their representatives, family members, or other closely related persons, declares that they hold or have held an important public job or function, in any jurisdiction. + #[serde(skip_serializing_if = "Option::is_none")] + pub political_exposure: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub registered_address: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub relationship: Option, + /// Information about the requirements for this person, including what information needs to be collected, and by when. + #[serde(skip_serializing_if = "Option::is_none")] + pub requirements: Option, + /// Whether the last four digits of the person's Social Security number have been provided (U.S. only). + #[serde(skip_serializing_if = "Option::is_none")] + pub ssn_last_4_provided: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub verification: Option, +} +/// Indicates if the person or any of their representatives, family members, or other closely related persons, declares that they hold or have held an important public job or function, in any jurisdiction. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum PersonPoliticalExposure { + Existing, + None, +} +impl PersonPoliticalExposure { + pub fn as_str(self) -> &'static str { + use PersonPoliticalExposure::*; + match self { + Existing => "existing", + None => "none", + } + } +} + +impl std::str::FromStr for PersonPoliticalExposure { + type Err = (); + fn from_str(s: &str) -> Result { + use PersonPoliticalExposure::*; + match s { + "existing" => Ok(Existing), + "none" => Ok(None), + _ => Err(()), + } + } +} +impl std::fmt::Display for PersonPoliticalExposure { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for PersonPoliticalExposure { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for PersonPoliticalExposure { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for PersonPoliticalExposure { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s) + .map_err(|_| serde::de::Error::custom("Unknown value for PersonPoliticalExposure")) + } +} +impl stripe_types::Object for Person { + type Id = stripe_shared::PersonId; + fn id(&self) -> &Self::Id { + &self.id + } +} +stripe_types::def_id!(PersonId, "person_"); diff --git a/generated/stripe_shared/src/person_additional_tos_acceptance.rs b/generated/stripe_shared/src/person_additional_tos_acceptance.rs new file mode 100644 index 000000000..e0d67e184 --- /dev/null +++ b/generated/stripe_shared/src/person_additional_tos_acceptance.rs @@ -0,0 +1,9 @@ +#[derive(Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct PersonAdditionalTosAcceptance { + /// The Unix timestamp marking when the legal guardian accepted the service agreement. + pub date: Option, + /// The IP address from which the legal guardian accepted the service agreement. + pub ip: Option, + /// The user agent of the browser from which the legal guardian accepted the service agreement. + pub user_agent: Option, +} diff --git a/generated/stripe_shared/src/person_additional_tos_acceptances.rs b/generated/stripe_shared/src/person_additional_tos_acceptances.rs new file mode 100644 index 000000000..0e3c641e7 --- /dev/null +++ b/generated/stripe_shared/src/person_additional_tos_acceptances.rs @@ -0,0 +1,4 @@ +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct PersonAdditionalTosAcceptances { + pub account: stripe_shared::PersonAdditionalTosAcceptance, +} diff --git a/generated/stripe_shared/src/person_future_requirements.rs b/generated/stripe_shared/src/person_future_requirements.rs new file mode 100644 index 000000000..b226c55a5 --- /dev/null +++ b/generated/stripe_shared/src/person_future_requirements.rs @@ -0,0 +1,21 @@ +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct PersonFutureRequirements { + /// Fields that are due and can be satisfied by providing the corresponding alternative fields instead. + pub alternatives: Option>, + /// Fields that need to be collected to keep the person's account enabled. + /// If not collected by the account's `future_requirements[current_deadline]`, these fields will transition to the main `requirements` hash, and may immediately become `past_due`, but the account may also be given a grace period depending on the account's enablement state prior to transition. + pub currently_due: Vec, + /// Fields that are `currently_due` and need to be collected again because validation or verification failed. + pub errors: Vec, + /// Fields that need to be collected assuming all volume thresholds are reached. + /// As they become required, they appear in `currently_due` as well, and the account's `future_requirements[current_deadline]` becomes set. + pub eventually_due: Vec, + /// Fields that weren't collected by the account's `requirements.current_deadline`. + /// These fields need to be collected to enable the person's account. + /// New fields will never appear here; `future_requirements.past_due` will always be a subset of `requirements.past_due`. + pub past_due: Vec, + /// Fields that may become required depending on the results of verification or review. + /// Will be an empty array unless an asynchronous verification is pending. + /// If verification fails, these fields move to `eventually_due` or `currently_due`. + pub pending_verification: Vec, +} diff --git a/generated/stripe_shared/src/person_relationship.rs b/generated/stripe_shared/src/person_relationship.rs new file mode 100644 index 000000000..5dff94be4 --- /dev/null +++ b/generated/stripe_shared/src/person_relationship.rs @@ -0,0 +1,21 @@ +#[derive(Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct PersonRelationship { + /// Whether the person is a director of the account's legal entity. + /// Directors are typically members of the governing board of the company, or responsible for ensuring the company meets its regulatory obligations. + pub director: Option, + /// Whether the person has significant responsibility to control, manage, or direct the organization. + pub executive: Option, + /// Whether the person is the legal guardian of the account's representative. + pub legal_guardian: Option, + /// Whether the person is an owner of the account’s legal entity. + pub owner: Option, + /// The percent owned by the person of the account's legal entity. + pub percent_ownership: Option, + /// Whether the person is authorized as the primary representative of the account. + /// This is the person nominated by the business to provide information about themselves, and general information about the account. + /// There can only be one representative at any given time. + /// At the time the account is created, this person should be set to the person responsible for opening the account. + pub representative: Option, + /// The person's title (e.g., CEO, Support Engineer). + pub title: Option, +} diff --git a/generated/stripe_shared/src/person_requirements.rs b/generated/stripe_shared/src/person_requirements.rs new file mode 100644 index 000000000..b15182337 --- /dev/null +++ b/generated/stripe_shared/src/person_requirements.rs @@ -0,0 +1,20 @@ +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct PersonRequirements { + /// Fields that are due and can be satisfied by providing the corresponding alternative fields instead. + pub alternatives: Option>, + /// Fields that need to be collected to keep the person's account enabled. + /// If not collected by the account's `current_deadline`, these fields appear in `past_due` as well, and the account is disabled. + pub currently_due: Vec, + /// Fields that are `currently_due` and need to be collected again because validation or verification failed. + pub errors: Vec, + /// Fields that need to be collected assuming all volume thresholds are reached. + /// As they become required, they appear in `currently_due` as well, and the account's `current_deadline` becomes set. + pub eventually_due: Vec, + /// Fields that weren't collected by the account's `current_deadline`. + /// These fields need to be collected to enable the person's account. + pub past_due: Vec, + /// Fields that may become required depending on the results of verification or review. + /// Will be an empty array unless an asynchronous verification is pending. + /// If verification fails, these fields move to `eventually_due`, `currently_due`, or `past_due`. + pub pending_verification: Vec, +} diff --git a/generated/stripe_shared/src/plan.rs b/generated/stripe_shared/src/plan.rs new file mode 100644 index 000000000..eab07a8f9 --- /dev/null +++ b/generated/stripe_shared/src/plan.rs @@ -0,0 +1,355 @@ +/// You can now model subscriptions more flexibly using the [Prices API](https://stripe.com/docs/api#prices). +/// It replaces the Plans API and is backwards compatible to simplify your migration. +/// +/// Plans define the base price, currency, and billing cycle for recurring purchases of products. +/// [Products](https://stripe.com/docs/api#products) help you track inventory or provisioning, and plans help you track pricing. +/// Different physical goods or levels of service should be represented by products, and pricing options should be represented by plans. +/// This approach lets you change prices without having to change your provisioning scheme. +/// +/// For example, you might have a single "gold" product that has plans for $10/month, $100/year, €9/month, and €90/year. +/// +/// Related guides: [Set up a subscription](https://stripe.com/docs/billing/subscriptions/set-up-subscription) and more about [products and prices](https://stripe.com/docs/products-prices/overview). +/// +/// For more details see <>. +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct Plan { + /// Whether the plan can be used for new purchases. + pub active: bool, + /// Specifies a usage aggregation strategy for plans of `usage_type=metered`. + /// Allowed values are `sum` for summing up all usage during a period, `last_during_period` for using the last usage record reported within a period, `last_ever` for using the last usage record ever (across period bounds) or `max` which uses the usage record with the maximum reported usage during a period. + /// Defaults to `sum`. + pub aggregate_usage: Option, + /// The unit amount in cents (or local equivalent) to be charged, represented as a whole integer if possible. + /// Only set if `billing_scheme=per_unit`. + pub amount: Option, + /// The unit amount in cents (or local equivalent) to be charged, represented as a decimal string with at most 12 decimal places. + /// Only set if `billing_scheme=per_unit`. + pub amount_decimal: Option, + /// Describes how to compute the price per period. + /// Either `per_unit` or `tiered`. + /// `per_unit` indicates that the fixed amount (specified in `amount`) will be charged per unit in `quantity` (for plans with `usage_type=licensed`), or per unit of total usage (for plans with `usage_type=metered`). + /// `tiered` indicates that the unit pricing will be computed using a tiering strategy as defined using the `tiers` and `tiers_mode` attributes. + pub billing_scheme: stripe_shared::PlanBillingScheme, + /// Time at which the object was created. Measured in seconds since the Unix epoch. + pub created: stripe_types::Timestamp, + /// Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. + /// Must be a [supported currency](https://stripe.com/docs/currencies). + pub currency: stripe_types::Currency, + /// Unique identifier for the object. + pub id: stripe_shared::PlanId, + /// The frequency at which a subscription is billed. One of `day`, `week`, `month` or `year`. + pub interval: stripe_shared::PlanInterval, + /// The number of intervals (specified in the `interval` attribute) between subscription billings. + /// For example, `interval=month` and `interval_count=3` bills every 3 months. + pub interval_count: u64, + /// Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + pub livemode: bool, + /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. + /// This can be useful for storing additional information about the object in a structured format. + pub metadata: Option>, + /// A brief description of the plan, hidden from customers. + pub nickname: Option, + /// The product whose pricing this plan determines. + pub product: Option>, + /// Each element represents a pricing tier. + /// This parameter requires `billing_scheme` to be set to `tiered`. + /// See also the documentation for `billing_scheme`. + #[serde(skip_serializing_if = "Option::is_none")] + pub tiers: Option>, + /// Defines if the tiering price should be `graduated` or `volume` based. + /// In `volume`-based tiering, the maximum quantity within a period determines the per unit price. + /// In `graduated` tiering, pricing can change as the quantity grows. + pub tiers_mode: Option, + /// Apply a transformation to the reported usage or set quantity before computing the amount billed. + /// Cannot be combined with `tiers`. + pub transform_usage: Option, + /// Default number of trial days when subscribing a customer to this plan using [`trial_from_plan=true`](https://stripe.com/docs/api#create_subscription-trial_from_plan). + pub trial_period_days: Option, + /// Configures how the quantity per period should be determined. + /// Can be either `metered` or `licensed`. + /// `licensed` automatically bills the `quantity` set when adding it to a subscription. + /// `metered` aggregates the total usage based on usage records. + /// Defaults to `licensed`. + pub usage_type: stripe_shared::PlanUsageType, +} +impl stripe_types::Object for Plan { + type Id = stripe_shared::PlanId; + fn id(&self) -> &Self::Id { + &self.id + } +} +stripe_types::def_id!(PlanId); +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum PlanAggregateUsage { + LastDuringPeriod, + LastEver, + Max, + Sum, +} +impl PlanAggregateUsage { + pub fn as_str(self) -> &'static str { + use PlanAggregateUsage::*; + match self { + LastDuringPeriod => "last_during_period", + LastEver => "last_ever", + Max => "max", + Sum => "sum", + } + } +} + +impl std::str::FromStr for PlanAggregateUsage { + type Err = (); + fn from_str(s: &str) -> Result { + use PlanAggregateUsage::*; + match s { + "last_during_period" => Ok(LastDuringPeriod), + "last_ever" => Ok(LastEver), + "max" => Ok(Max), + "sum" => Ok(Sum), + _ => Err(()), + } + } +} +impl std::fmt::Display for PlanAggregateUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for PlanAggregateUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for PlanAggregateUsage { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for PlanAggregateUsage { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s) + .map_err(|_| serde::de::Error::custom("Unknown value for PlanAggregateUsage")) + } +} +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum PlanBillingScheme { + PerUnit, + Tiered, +} +impl PlanBillingScheme { + pub fn as_str(self) -> &'static str { + use PlanBillingScheme::*; + match self { + PerUnit => "per_unit", + Tiered => "tiered", + } + } +} + +impl std::str::FromStr for PlanBillingScheme { + type Err = (); + fn from_str(s: &str) -> Result { + use PlanBillingScheme::*; + match s { + "per_unit" => Ok(PerUnit), + "tiered" => Ok(Tiered), + _ => Err(()), + } + } +} +impl std::fmt::Display for PlanBillingScheme { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for PlanBillingScheme { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for PlanBillingScheme { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for PlanBillingScheme { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s) + .map_err(|_| serde::de::Error::custom("Unknown value for PlanBillingScheme")) + } +} +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum PlanInterval { + Day, + Month, + Week, + Year, +} +impl PlanInterval { + pub fn as_str(self) -> &'static str { + use PlanInterval::*; + match self { + Day => "day", + Month => "month", + Week => "week", + Year => "year", + } + } +} + +impl std::str::FromStr for PlanInterval { + type Err = (); + fn from_str(s: &str) -> Result { + use PlanInterval::*; + match s { + "day" => Ok(Day), + "month" => Ok(Month), + "week" => Ok(Week), + "year" => Ok(Year), + _ => Err(()), + } + } +} +impl std::fmt::Display for PlanInterval { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for PlanInterval { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for PlanInterval { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for PlanInterval { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for PlanInterval")) + } +} +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum PlanTiersMode { + Graduated, + Volume, +} +impl PlanTiersMode { + pub fn as_str(self) -> &'static str { + use PlanTiersMode::*; + match self { + Graduated => "graduated", + Volume => "volume", + } + } +} + +impl std::str::FromStr for PlanTiersMode { + type Err = (); + fn from_str(s: &str) -> Result { + use PlanTiersMode::*; + match s { + "graduated" => Ok(Graduated), + "volume" => Ok(Volume), + _ => Err(()), + } + } +} +impl std::fmt::Display for PlanTiersMode { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for PlanTiersMode { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for PlanTiersMode { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for PlanTiersMode { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for PlanTiersMode")) + } +} +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum PlanUsageType { + Licensed, + Metered, +} +impl PlanUsageType { + pub fn as_str(self) -> &'static str { + use PlanUsageType::*; + match self { + Licensed => "licensed", + Metered => "metered", + } + } +} + +impl std::str::FromStr for PlanUsageType { + type Err = (); + fn from_str(s: &str) -> Result { + use PlanUsageType::*; + match s { + "licensed" => Ok(Licensed), + "metered" => Ok(Metered), + _ => Err(()), + } + } +} +impl std::fmt::Display for PlanUsageType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for PlanUsageType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for PlanUsageType { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for PlanUsageType { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for PlanUsageType")) + } +} diff --git a/generated/stripe_shared/src/plan_tier.rs b/generated/stripe_shared/src/plan_tier.rs new file mode 100644 index 000000000..ad338db35 --- /dev/null +++ b/generated/stripe_shared/src/plan_tier.rs @@ -0,0 +1,13 @@ +#[derive(Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct PlanTier { + /// Price for the entire tier. + pub flat_amount: Option, + /// Same as `flat_amount`, but contains a decimal value with at most 12 decimal places. + pub flat_amount_decimal: Option, + /// Per unit price for units relevant to the tier. + pub unit_amount: Option, + /// Same as `unit_amount`, but contains a decimal value with at most 12 decimal places. + pub unit_amount_decimal: Option, + /// Up to and including to this quantity will be contained in the tier. + pub up_to: Option, +} diff --git a/generated/stripe_shared/src/platform_tax_fee.rs b/generated/stripe_shared/src/platform_tax_fee.rs new file mode 100644 index 000000000..5a5bf46f5 --- /dev/null +++ b/generated/stripe_shared/src/platform_tax_fee.rs @@ -0,0 +1,19 @@ +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct PlatformTaxFee { + /// The Connected account that incurred this charge. + pub account: String, + /// Unique identifier for the object. + pub id: stripe_shared::PlatformTaxFeeId, + /// The payment object that caused this tax to be inflicted. + pub source_transaction: String, + /// The type of tax (VAT). + #[serde(rename = "type")] + pub type_: String, +} +impl stripe_types::Object for PlatformTaxFee { + type Id = stripe_shared::PlatformTaxFeeId; + fn id(&self) -> &Self::Id { + &self.id + } +} +stripe_types::def_id!(PlatformTaxFeeId, "ptf_"); diff --git a/generated/stripe_shared/src/price.rs b/generated/stripe_shared/src/price.rs new file mode 100644 index 000000000..06397b4e6 --- /dev/null +++ b/generated/stripe_shared/src/price.rs @@ -0,0 +1,294 @@ +/// Prices define the unit cost, currency, and (optional) billing cycle for both recurring and one-time purchases of products. +/// [Products](https://stripe.com/docs/api#products) help you track inventory or provisioning, and prices help you track payment terms. +/// Different physical goods or levels of service should be represented by products, and pricing options should be represented by prices. +/// This approach lets you change prices without having to change your provisioning scheme. +/// +/// For example, you might have a single "gold" product that has prices for $10/month, $100/year, and €9 once. +/// +/// Related guides: [Set up a subscription](https://stripe.com/docs/billing/subscriptions/set-up-subscription), [create an invoice](https://stripe.com/docs/billing/invoices/create), and more about [products and prices](https://stripe.com/docs/products-prices/overview). +/// +/// For more details see <>. +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct Price { + /// Whether the price can be used for new purchases. + pub active: bool, + /// Describes how to compute the price per period. + /// Either `per_unit` or `tiered`. + /// `per_unit` indicates that the fixed amount (specified in `unit_amount` or `unit_amount_decimal`) will be charged per unit in `quantity` (for prices with `usage_type=licensed`), or per unit of total usage (for prices with `usage_type=metered`). + /// `tiered` indicates that the unit pricing will be computed using a tiering strategy as defined using the `tiers` and `tiers_mode` attributes. + pub billing_scheme: stripe_shared::PriceBillingScheme, + /// Time at which the object was created. Measured in seconds since the Unix epoch. + pub created: stripe_types::Timestamp, + /// Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. + /// Must be a [supported currency](https://stripe.com/docs/currencies). + pub currency: stripe_types::Currency, + /// Prices defined in each available currency option. + /// Each key must be a three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html) and a [supported currency](https://stripe.com/docs/currencies). + #[serde(skip_serializing_if = "Option::is_none")] + pub currency_options: + Option>, + /// When set, provides configuration for the amount to be adjusted by the customer during Checkout Sessions and Payment Links. + pub custom_unit_amount: Option, + /// Unique identifier for the object. + pub id: stripe_shared::PriceId, + /// Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + pub livemode: bool, + /// A lookup key used to retrieve prices dynamically from a static string. + /// This may be up to 200 characters. + pub lookup_key: Option, + /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. + /// This can be useful for storing additional information about the object in a structured format. + pub metadata: std::collections::HashMap, + /// A brief description of the price, hidden from customers. + pub nickname: Option, + /// The ID of the product this price is associated with. + pub product: stripe_types::Expandable, + /// The recurring components of a price such as `interval` and `usage_type`. + pub recurring: Option, + /// Only required if a [default tax behavior](https://stripe.com/docs/tax/products-prices-tax-categories-tax-behavior#setting-a-default-tax-behavior-(recommended)) was not provided in the Stripe Tax settings. + /// Specifies whether the price is considered inclusive of taxes or exclusive of taxes. + /// One of `inclusive`, `exclusive`, or `unspecified`. + /// Once specified as either `inclusive` or `exclusive`, it cannot be changed. + pub tax_behavior: Option, + /// Each element represents a pricing tier. + /// This parameter requires `billing_scheme` to be set to `tiered`. + /// See also the documentation for `billing_scheme`. + #[serde(skip_serializing_if = "Option::is_none")] + pub tiers: Option>, + /// Defines if the tiering price should be `graduated` or `volume` based. + /// In `volume`-based tiering, the maximum quantity within a period determines the per unit price. + /// In `graduated` tiering, pricing can change as the quantity grows. + pub tiers_mode: Option, + /// Apply a transformation to the reported usage or set quantity before computing the amount billed. + /// Cannot be combined with `tiers`. + pub transform_quantity: Option, + /// One of `one_time` or `recurring` depending on whether the price is for a one-time purchase or a recurring (subscription) purchase. + #[serde(rename = "type")] + pub type_: stripe_shared::PriceType, + /// The unit amount in cents (or local equivalent) to be charged, represented as a whole integer if possible. + /// Only set if `billing_scheme=per_unit`. + pub unit_amount: Option, + /// The unit amount in cents (or local equivalent) to be charged, represented as a decimal string with at most 12 decimal places. + /// Only set if `billing_scheme=per_unit`. + pub unit_amount_decimal: Option, +} +impl stripe_types::Object for Price { + type Id = stripe_shared::PriceId; + fn id(&self) -> &Self::Id { + &self.id + } +} +stripe_types::def_id!(PriceId, "price_" | "plan_"); +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum PriceBillingScheme { + PerUnit, + Tiered, +} +impl PriceBillingScheme { + pub fn as_str(self) -> &'static str { + use PriceBillingScheme::*; + match self { + PerUnit => "per_unit", + Tiered => "tiered", + } + } +} + +impl std::str::FromStr for PriceBillingScheme { + type Err = (); + fn from_str(s: &str) -> Result { + use PriceBillingScheme::*; + match s { + "per_unit" => Ok(PerUnit), + "tiered" => Ok(Tiered), + _ => Err(()), + } + } +} +impl std::fmt::Display for PriceBillingScheme { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for PriceBillingScheme { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for PriceBillingScheme { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for PriceBillingScheme { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s) + .map_err(|_| serde::de::Error::custom("Unknown value for PriceBillingScheme")) + } +} +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum PriceTaxBehavior { + Exclusive, + Inclusive, + Unspecified, +} +impl PriceTaxBehavior { + pub fn as_str(self) -> &'static str { + use PriceTaxBehavior::*; + match self { + Exclusive => "exclusive", + Inclusive => "inclusive", + Unspecified => "unspecified", + } + } +} + +impl std::str::FromStr for PriceTaxBehavior { + type Err = (); + fn from_str(s: &str) -> Result { + use PriceTaxBehavior::*; + match s { + "exclusive" => Ok(Exclusive), + "inclusive" => Ok(Inclusive), + "unspecified" => Ok(Unspecified), + _ => Err(()), + } + } +} +impl std::fmt::Display for PriceTaxBehavior { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for PriceTaxBehavior { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for PriceTaxBehavior { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for PriceTaxBehavior { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s) + .map_err(|_| serde::de::Error::custom("Unknown value for PriceTaxBehavior")) + } +} +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum PriceTiersMode { + Graduated, + Volume, +} +impl PriceTiersMode { + pub fn as_str(self) -> &'static str { + use PriceTiersMode::*; + match self { + Graduated => "graduated", + Volume => "volume", + } + } +} + +impl std::str::FromStr for PriceTiersMode { + type Err = (); + fn from_str(s: &str) -> Result { + use PriceTiersMode::*; + match s { + "graduated" => Ok(Graduated), + "volume" => Ok(Volume), + _ => Err(()), + } + } +} +impl std::fmt::Display for PriceTiersMode { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for PriceTiersMode { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for PriceTiersMode { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for PriceTiersMode { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for PriceTiersMode")) + } +} +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum PriceType { + OneTime, + Recurring, +} +impl PriceType { + pub fn as_str(self) -> &'static str { + use PriceType::*; + match self { + OneTime => "one_time", + Recurring => "recurring", + } + } +} + +impl std::str::FromStr for PriceType { + type Err = (); + fn from_str(s: &str) -> Result { + use PriceType::*; + match s { + "one_time" => Ok(OneTime), + "recurring" => Ok(Recurring), + _ => Err(()), + } + } +} +impl std::fmt::Display for PriceType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for PriceType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for PriceType { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for PriceType { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for PriceType")) + } +} diff --git a/generated/stripe_shared/src/price_tier.rs b/generated/stripe_shared/src/price_tier.rs new file mode 100644 index 000000000..6cd47e0a1 --- /dev/null +++ b/generated/stripe_shared/src/price_tier.rs @@ -0,0 +1,13 @@ +#[derive(Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct PriceTier { + /// Price for the entire tier. + pub flat_amount: Option, + /// Same as `flat_amount`, but contains a decimal value with at most 12 decimal places. + pub flat_amount_decimal: Option, + /// Per unit price for units relevant to the tier. + pub unit_amount: Option, + /// Same as `unit_amount`, but contains a decimal value with at most 12 decimal places. + pub unit_amount_decimal: Option, + /// Up to and including to this quantity will be contained in the tier. + pub up_to: Option, +} diff --git a/generated/stripe_shared/src/product.rs b/generated/stripe_shared/src/product.rs new file mode 100644 index 000000000..fdf34a279 --- /dev/null +++ b/generated/stripe_shared/src/product.rs @@ -0,0 +1,118 @@ +/// Products describe the specific goods or services you offer to your customers. +/// For example, you might offer a Standard and Premium version of your goods or service; each version would be a separate Product. +/// They can be used in conjunction with [Prices](https://stripe.com/docs/api#prices) to configure pricing in Payment Links, Checkout, and Subscriptions. +/// +/// Related guides: [Set up a subscription](https://stripe.com/docs/billing/subscriptions/set-up-subscription),. +/// [share a Payment Link](https://stripe.com/docs/payment-links), +/// [accept payments with Checkout](https://stripe.com/docs/payments/accept-a-payment#create-product-prices-upfront),. +/// and more about [Products and Prices](https://stripe.com/docs/products-prices/overview) +/// +/// For more details see <>. +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct Product { + /// Whether the product is currently available for purchase. + pub active: bool, + /// Time at which the object was created. Measured in seconds since the Unix epoch. + pub created: stripe_types::Timestamp, + /// The ID of the [Price](https://stripe.com/docs/api/prices) object that is the default price for this product. + #[serde(skip_serializing_if = "Option::is_none")] + pub default_price: Option>, + /// The product's description, meant to be displayable to the customer. + /// Use this field to optionally store a long form explanation of the product being sold for your own rendering purposes. + pub description: Option, + /// A list of up to 15 features for this product. + /// These are displayed in [pricing tables](https://stripe.com/docs/payments/checkout/pricing-table). + pub features: Vec, + /// Unique identifier for the object. + pub id: stripe_shared::ProductId, + /// A list of up to 8 URLs of images for this product, meant to be displayable to the customer. + pub images: Vec, + /// Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + pub livemode: bool, + /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. + /// This can be useful for storing additional information about the object in a structured format. + pub metadata: std::collections::HashMap, + /// The product's name, meant to be displayable to the customer. + pub name: String, + /// The dimensions of this product for shipping purposes. + pub package_dimensions: Option, + /// Whether this product is shipped (i.e., physical goods). + pub shippable: Option, + /// Extra information about a product which will appear on your customer's credit card statement. + /// In the case that multiple products are billed at once, the first statement descriptor will be used. + #[serde(skip_serializing_if = "Option::is_none")] + pub statement_descriptor: Option, + /// A [tax code](https://stripe.com/docs/tax/tax-categories) ID. + pub tax_code: Option>, + /// The type of the product. + /// The product is either of type `good`, which is eligible for use with Orders and SKUs, or `service`, which is eligible for use with Subscriptions and Plans. + #[serde(rename = "type")] + pub type_: stripe_shared::ProductType, + /// A label that represents units of this product. + /// When set, this will be included in customers' receipts, invoices, Checkout, and the customer portal. + #[serde(skip_serializing_if = "Option::is_none")] + pub unit_label: Option, + /// Time at which the object was last updated. Measured in seconds since the Unix epoch. + pub updated: stripe_types::Timestamp, + /// A URL of a publicly-accessible webpage for this product. + pub url: Option, +} +impl stripe_types::Object for Product { + type Id = stripe_shared::ProductId; + fn id(&self) -> &Self::Id { + &self.id + } +} +stripe_types::def_id!(ProductId); +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum ProductType { + Good, + Service, +} +impl ProductType { + pub fn as_str(self) -> &'static str { + use ProductType::*; + match self { + Good => "good", + Service => "service", + } + } +} + +impl std::str::FromStr for ProductType { + type Err = (); + fn from_str(s: &str) -> Result { + use ProductType::*; + match s { + "good" => Ok(Good), + "service" => Ok(Service), + _ => Err(()), + } + } +} +impl std::fmt::Display for ProductType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for ProductType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for ProductType { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for ProductType { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for ProductType")) + } +} diff --git a/generated/stripe_shared/src/product_feature.rs b/generated/stripe_shared/src/product_feature.rs new file mode 100644 index 000000000..996e4221e --- /dev/null +++ b/generated/stripe_shared/src/product_feature.rs @@ -0,0 +1,6 @@ +#[derive(Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct ProductFeature { + /// The feature's name. Up to 80 characters long. + #[serde(skip_serializing_if = "Option::is_none")] + pub name: Option, +} diff --git a/generated/stripe_shared/src/promotion_code.rs b/generated/stripe_shared/src/promotion_code.rs new file mode 100644 index 000000000..6ff340261 --- /dev/null +++ b/generated/stripe_shared/src/promotion_code.rs @@ -0,0 +1,40 @@ +/// A Promotion Code represents a customer-redeemable code for a [coupon](https://stripe.com/docs/api#coupons). +/// It can be used to. +/// create multiple codes for a single coupon. +/// +/// For more details see <>. +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct PromotionCode { + /// Whether the promotion code is currently active. + /// A promotion code is only active if the coupon is also valid. + pub active: bool, + /// The customer-facing code. + /// Regardless of case, this code must be unique across all active promotion codes for each customer. + pub code: String, + pub coupon: stripe_shared::Coupon, + /// Time at which the object was created. Measured in seconds since the Unix epoch. + pub created: stripe_types::Timestamp, + /// The customer that this promotion code can be used by. + pub customer: Option>, + /// Date at which the promotion code can no longer be redeemed. + pub expires_at: Option, + /// Unique identifier for the object. + pub id: stripe_shared::PromotionCodeId, + /// Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + pub livemode: bool, + /// Maximum number of times this promotion code can be redeemed. + pub max_redemptions: Option, + /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. + /// This can be useful for storing additional information about the object in a structured format. + pub metadata: Option>, + pub restrictions: stripe_shared::PromotionCodesResourceRestrictions, + /// Number of times this promotion code has been used. + pub times_redeemed: i64, +} +impl stripe_types::Object for PromotionCode { + type Id = stripe_shared::PromotionCodeId; + fn id(&self) -> &Self::Id { + &self.id + } +} +stripe_types::def_id!(PromotionCodeId, "promo_"); diff --git a/generated/stripe_shared/src/promotion_code_currency_option.rs b/generated/stripe_shared/src/promotion_code_currency_option.rs new file mode 100644 index 000000000..87758d03e --- /dev/null +++ b/generated/stripe_shared/src/promotion_code_currency_option.rs @@ -0,0 +1,5 @@ +#[derive(Copy, Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct PromotionCodeCurrencyOption { + /// Minimum amount required to redeem this Promotion Code into a Coupon (e.g., a purchase must be $100 or more to work). + pub minimum_amount: i64, +} diff --git a/generated/stripe_shared/src/promotion_codes_resource_restrictions.rs b/generated/stripe_shared/src/promotion_codes_resource_restrictions.rs new file mode 100644 index 000000000..659e71f8d --- /dev/null +++ b/generated/stripe_shared/src/promotion_codes_resource_restrictions.rs @@ -0,0 +1,18 @@ +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct PromotionCodesResourceRestrictions { + /// Promotion code restrictions defined in each available currency option. + /// Each key must be a three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html) and a [supported currency](https://stripe.com/docs/currencies). + #[serde(skip_serializing_if = "Option::is_none")] + pub currency_options: Option< + std::collections::HashMap< + stripe_types::Currency, + stripe_shared::PromotionCodeCurrencyOption, + >, + >, + /// A Boolean indicating if the Promotion Code should only be redeemed for Customers without any successful payments or invoices. + pub first_time_transaction: bool, + /// Minimum amount required to redeem this Promotion Code into a Coupon (e.g., a purchase must be $100 or more to work). + pub minimum_amount: Option, + /// Three-letter [ISO code](https://stripe.com/docs/currencies) for minimum_amount + pub minimum_amount_currency: Option, +} diff --git a/generated/stripe_shared/src/quote.rs b/generated/stripe_shared/src/quote.rs new file mode 100644 index 000000000..2ce2d8397 --- /dev/null +++ b/generated/stripe_shared/src/quote.rs @@ -0,0 +1,204 @@ +/// A Quote is a way to model prices that you'd like to provide to a customer. +/// Once accepted, it will automatically create an invoice, subscription or subscription schedule. +/// +/// For more details see <>. +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct Quote { + /// Total before any discounts or taxes are applied. + pub amount_subtotal: i64, + /// Total after discounts and taxes are applied. + pub amount_total: i64, + /// ID of the Connect Application that created the quote. + pub application: Option>, + /// The amount of the application fee (if any) that will be requested to be applied to the payment and transferred to the application owner's Stripe account. + /// Only applicable if there are no line items with recurring prices on the quote. + pub application_fee_amount: Option, + /// A non-negative decimal between 0 and 100, with at most two decimal places. + /// This represents the percentage of the subscription invoice total that will be transferred to the application owner's Stripe account. + /// Only applicable if there are line items with recurring prices on the quote. + pub application_fee_percent: Option, + pub automatic_tax: stripe_shared::QuotesResourceAutomaticTax, + /// Either `charge_automatically`, or `send_invoice`. + /// When charging automatically, Stripe will attempt to pay invoices at the end of the subscription cycle or on finalization using the default payment method attached to the subscription or customer. + /// When sending an invoice, Stripe will email your customer an invoice with payment instructions and mark the subscription as `active`. + /// Defaults to `charge_automatically`. + pub collection_method: stripe_shared::QuoteCollectionMethod, + pub computed: stripe_shared::QuotesResourceComputed, + /// Time at which the object was created. Measured in seconds since the Unix epoch. + pub created: stripe_types::Timestamp, + /// Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. + /// Must be a [supported currency](https://stripe.com/docs/currencies). + pub currency: Option, + /// The customer which this quote belongs to. + /// A customer is required before finalizing the quote. + /// Once specified, it cannot be changed. + pub customer: Option>, + /// The tax rates applied to this quote. + #[serde(skip_serializing_if = "Option::is_none")] + pub default_tax_rates: Option>>, + /// A description that will be displayed on the quote PDF. + pub description: Option, + /// The discounts applied to this quote. + pub discounts: Vec>, + /// The date on which the quote will be canceled if in `open` or `draft` status. + /// Measured in seconds since the Unix epoch. + pub expires_at: stripe_types::Timestamp, + /// A footer that will be displayed on the quote PDF. + pub footer: Option, + /// Details of the quote that was cloned. + /// See the [cloning documentation](https://stripe.com/docs/quotes/clone) for more details. + pub from_quote: Option, + /// A header that will be displayed on the quote PDF. + pub header: Option, + /// Unique identifier for the object. + pub id: stripe_shared::QuoteId, + /// The invoice that was created from this quote. + pub invoice: Option>, + pub invoice_settings: stripe_shared::InvoiceSettingQuoteSetting, + /// A list of items the customer is being quoted for. + #[serde(skip_serializing_if = "Option::is_none")] + pub line_items: Option>, + /// Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + pub livemode: bool, + /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. + /// This can be useful for storing additional information about the object in a structured format. + pub metadata: std::collections::HashMap, + /// A unique number that identifies this particular quote. + /// This number is assigned once the quote is [finalized](https://stripe.com/docs/quotes/overview#finalize). + pub number: Option, + /// The account on behalf of which to charge. + /// See the [Connect documentation](https://support.stripe.com/questions/sending-invoices-on-behalf-of-connected-accounts) for details. + pub on_behalf_of: Option>, + /// The status of the quote. + pub status: stripe_shared::QuoteStatus, + pub status_transitions: stripe_shared::QuotesResourceStatusTransitions, + /// The subscription that was created or updated from this quote. + pub subscription: Option>, + pub subscription_data: stripe_shared::QuotesResourceSubscriptionDataSubscriptionData, + /// The subscription schedule that was created or updated from this quote. + pub subscription_schedule: + Option>, + /// ID of the test clock this quote belongs to. + pub test_clock: Option>, + pub total_details: stripe_shared::QuotesResourceTotalDetails, + /// The account (if any) the payments will be attributed to for tax reporting, and where funds from each payment will be transferred to for each of the invoices. + pub transfer_data: Option, +} +impl stripe_types::Object for Quote { + type Id = stripe_shared::QuoteId; + fn id(&self) -> &Self::Id { + &self.id + } +} +stripe_types::def_id!(QuoteId, "qt_"); +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum QuoteCollectionMethod { + ChargeAutomatically, + SendInvoice, +} +impl QuoteCollectionMethod { + pub fn as_str(self) -> &'static str { + use QuoteCollectionMethod::*; + match self { + ChargeAutomatically => "charge_automatically", + SendInvoice => "send_invoice", + } + } +} + +impl std::str::FromStr for QuoteCollectionMethod { + type Err = (); + fn from_str(s: &str) -> Result { + use QuoteCollectionMethod::*; + match s { + "charge_automatically" => Ok(ChargeAutomatically), + "send_invoice" => Ok(SendInvoice), + _ => Err(()), + } + } +} +impl std::fmt::Display for QuoteCollectionMethod { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for QuoteCollectionMethod { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for QuoteCollectionMethod { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for QuoteCollectionMethod { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s) + .map_err(|_| serde::de::Error::custom("Unknown value for QuoteCollectionMethod")) + } +} +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum QuoteStatus { + Accepted, + Canceled, + Draft, + Open, +} +impl QuoteStatus { + pub fn as_str(self) -> &'static str { + use QuoteStatus::*; + match self { + Accepted => "accepted", + Canceled => "canceled", + Draft => "draft", + Open => "open", + } + } +} + +impl std::str::FromStr for QuoteStatus { + type Err = (); + fn from_str(s: &str) -> Result { + use QuoteStatus::*; + match s { + "accepted" => Ok(Accepted), + "canceled" => Ok(Canceled), + "draft" => Ok(Draft), + "open" => Ok(Open), + _ => Err(()), + } + } +} +impl std::fmt::Display for QuoteStatus { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for QuoteStatus { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for QuoteStatus { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for QuoteStatus { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for QuoteStatus")) + } +} diff --git a/generated/stripe_shared/src/quotes_resource_automatic_tax.rs b/generated/stripe_shared/src/quotes_resource_automatic_tax.rs new file mode 100644 index 000000000..4b16b7111 --- /dev/null +++ b/generated/stripe_shared/src/quotes_resource_automatic_tax.rs @@ -0,0 +1,69 @@ +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct QuotesResourceAutomaticTax { + /// Automatically calculate taxes + pub enabled: bool, + /// The account that's liable for tax. + /// If set, the business address and tax registrations required to perform the tax calculation are loaded from this account. + /// The tax transaction is returned in the report of the connected account. + pub liability: Option, + /// The status of the most recent automated tax calculation for this quote. + pub status: Option, +} +/// The status of the most recent automated tax calculation for this quote. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum QuotesResourceAutomaticTaxStatus { + Complete, + Failed, + RequiresLocationInputs, +} +impl QuotesResourceAutomaticTaxStatus { + pub fn as_str(self) -> &'static str { + use QuotesResourceAutomaticTaxStatus::*; + match self { + Complete => "complete", + Failed => "failed", + RequiresLocationInputs => "requires_location_inputs", + } + } +} + +impl std::str::FromStr for QuotesResourceAutomaticTaxStatus { + type Err = (); + fn from_str(s: &str) -> Result { + use QuotesResourceAutomaticTaxStatus::*; + match s { + "complete" => Ok(Complete), + "failed" => Ok(Failed), + "requires_location_inputs" => Ok(RequiresLocationInputs), + _ => Err(()), + } + } +} +impl std::fmt::Display for QuotesResourceAutomaticTaxStatus { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for QuotesResourceAutomaticTaxStatus { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for QuotesResourceAutomaticTaxStatus { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for QuotesResourceAutomaticTaxStatus { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| { + serde::de::Error::custom("Unknown value for QuotesResourceAutomaticTaxStatus") + }) + } +} diff --git a/generated/stripe_shared/src/quotes_resource_computed.rs b/generated/stripe_shared/src/quotes_resource_computed.rs new file mode 100644 index 000000000..45192eec7 --- /dev/null +++ b/generated/stripe_shared/src/quotes_resource_computed.rs @@ -0,0 +1,8 @@ +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct QuotesResourceComputed { + /// The definitive totals and line items the customer will be charged on a recurring basis. + /// Takes into account the line items with recurring prices and discounts with `duration=forever` coupons only. + /// Defaults to `null` if no inputted line items with recurring prices. + pub recurring: Option, + pub upfront: stripe_shared::QuotesResourceUpfront, +} diff --git a/generated/stripe_shared/src/quotes_resource_from_quote.rs b/generated/stripe_shared/src/quotes_resource_from_quote.rs new file mode 100644 index 000000000..f2253f47b --- /dev/null +++ b/generated/stripe_shared/src/quotes_resource_from_quote.rs @@ -0,0 +1,7 @@ +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct QuotesResourceFromQuote { + /// Whether this quote is a revision of a different quote. + pub is_revision: bool, + /// The quote that was cloned. + pub quote: stripe_types::Expandable, +} diff --git a/generated/stripe_shared/src/quotes_resource_recurring.rs b/generated/stripe_shared/src/quotes_resource_recurring.rs new file mode 100644 index 000000000..981f9dbff --- /dev/null +++ b/generated/stripe_shared/src/quotes_resource_recurring.rs @@ -0,0 +1,74 @@ +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct QuotesResourceRecurring { + /// Total before any discounts or taxes are applied. + pub amount_subtotal: i64, + /// Total after discounts and taxes are applied. + pub amount_total: i64, + /// The frequency at which a subscription is billed. One of `day`, `week`, `month` or `year`. + pub interval: QuotesResourceRecurringInterval, + /// The number of intervals (specified in the `interval` attribute) between subscription billings. + /// For example, `interval=month` and `interval_count=3` bills every 3 months. + pub interval_count: u64, + pub total_details: stripe_shared::QuotesResourceTotalDetails, +} +/// The frequency at which a subscription is billed. One of `day`, `week`, `month` or `year`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum QuotesResourceRecurringInterval { + Day, + Month, + Week, + Year, +} +impl QuotesResourceRecurringInterval { + pub fn as_str(self) -> &'static str { + use QuotesResourceRecurringInterval::*; + match self { + Day => "day", + Month => "month", + Week => "week", + Year => "year", + } + } +} + +impl std::str::FromStr for QuotesResourceRecurringInterval { + type Err = (); + fn from_str(s: &str) -> Result { + use QuotesResourceRecurringInterval::*; + match s { + "day" => Ok(Day), + "month" => Ok(Month), + "week" => Ok(Week), + "year" => Ok(Year), + _ => Err(()), + } + } +} +impl std::fmt::Display for QuotesResourceRecurringInterval { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for QuotesResourceRecurringInterval { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for QuotesResourceRecurringInterval { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for QuotesResourceRecurringInterval { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| { + serde::de::Error::custom("Unknown value for QuotesResourceRecurringInterval") + }) + } +} diff --git a/generated/stripe_shared/src/quotes_resource_status_transitions.rs b/generated/stripe_shared/src/quotes_resource_status_transitions.rs new file mode 100644 index 000000000..2e7f6345c --- /dev/null +++ b/generated/stripe_shared/src/quotes_resource_status_transitions.rs @@ -0,0 +1,9 @@ +#[derive(Copy, Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct QuotesResourceStatusTransitions { + /// The time that the quote was accepted. Measured in seconds since Unix epoch. + pub accepted_at: Option, + /// The time that the quote was canceled. Measured in seconds since Unix epoch. + pub canceled_at: Option, + /// The time that the quote was finalized. Measured in seconds since Unix epoch. + pub finalized_at: Option, +} diff --git a/generated/stripe_shared/src/quotes_resource_subscription_data_subscription_data.rs b/generated/stripe_shared/src/quotes_resource_subscription_data_subscription_data.rs new file mode 100644 index 000000000..04e6bc883 --- /dev/null +++ b/generated/stripe_shared/src/quotes_resource_subscription_data_subscription_data.rs @@ -0,0 +1,18 @@ +#[derive(Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct QuotesResourceSubscriptionDataSubscriptionData { + /// The subscription's description, meant to be displayable to the customer. + /// Use this field to optionally store an explanation of the subscription for rendering in Stripe surfaces and certain local payment methods UIs. + pub description: Option, + /// When creating a new subscription, the date of which the subscription schedule will start after the quote is accepted. + /// This date is ignored if it is in the past when the quote is accepted. + /// Measured in seconds since the Unix epoch. + pub effective_date: Option, + /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that will set metadata on the subscription or subscription schedule when the quote is accepted. + /// If a recurring price is included in `line_items`, this field will be passed to the resulting subscription's `metadata` field. + /// If `subscription_data.effective_date` is used, this field will be passed to the resulting subscription schedule's `phases.metadata` field. + /// Unlike object-level metadata, this field is declarative. + /// Updates will clear prior values. + pub metadata: Option>, + /// Integer representing the number of trial period days before the customer is charged for the first time. + pub trial_period_days: Option, +} diff --git a/generated/stripe_shared/src/quotes_resource_total_details.rs b/generated/stripe_shared/src/quotes_resource_total_details.rs new file mode 100644 index 000000000..d3b364928 --- /dev/null +++ b/generated/stripe_shared/src/quotes_resource_total_details.rs @@ -0,0 +1,11 @@ +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct QuotesResourceTotalDetails { + /// This is the sum of all the discounts. + pub amount_discount: i64, + /// This is the sum of all the shipping amounts. + pub amount_shipping: Option, + /// This is the sum of all the tax amounts. + pub amount_tax: i64, + #[serde(skip_serializing_if = "Option::is_none")] + pub breakdown: Option, +} diff --git a/generated/stripe_shared/src/quotes_resource_total_details_resource_breakdown.rs b/generated/stripe_shared/src/quotes_resource_total_details_resource_breakdown.rs new file mode 100644 index 000000000..70202709b --- /dev/null +++ b/generated/stripe_shared/src/quotes_resource_total_details_resource_breakdown.rs @@ -0,0 +1,7 @@ +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct QuotesResourceTotalDetailsResourceBreakdown { + /// The aggregated discounts. + pub discounts: Vec, + /// The aggregated tax amounts by rate. + pub taxes: Vec, +} diff --git a/generated/stripe_shared/src/quotes_resource_transfer_data.rs b/generated/stripe_shared/src/quotes_resource_transfer_data.rs new file mode 100644 index 000000000..929567c19 --- /dev/null +++ b/generated/stripe_shared/src/quotes_resource_transfer_data.rs @@ -0,0 +1,12 @@ +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct QuotesResourceTransferData { + /// The amount in cents (or local equivalent) that will be transferred to the destination account when the invoice is paid. + /// By default, the entire amount is transferred to the destination. + pub amount: Option, + /// A non-negative decimal between 0 and 100, with at most two decimal places. + /// This represents the percentage of the subscription invoice total that will be transferred to the destination account. + /// By default, the entire amount will be transferred to the destination. + pub amount_percent: Option, + /// The account where funds from the payment will be transferred to upon payment success. + pub destination: stripe_types::Expandable, +} diff --git a/generated/stripe_shared/src/quotes_resource_upfront.rs b/generated/stripe_shared/src/quotes_resource_upfront.rs new file mode 100644 index 000000000..efed07033 --- /dev/null +++ b/generated/stripe_shared/src/quotes_resource_upfront.rs @@ -0,0 +1,12 @@ +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct QuotesResourceUpfront { + /// Total before any discounts or taxes are applied. + pub amount_subtotal: i64, + /// Total after discounts and taxes are applied. + pub amount_total: i64, + /// The line items that will appear on the next invoice after this quote is accepted. + /// This does not include pending invoice items that exist on the customer but may still be included in the next invoice. + #[serde(skip_serializing_if = "Option::is_none")] + pub line_items: Option>, + pub total_details: stripe_shared::QuotesResourceTotalDetails, +} diff --git a/src/resources/generated/radar_radar_options.rs b/generated/stripe_shared/src/radar_radar_options.rs similarity index 52% rename from src/resources/generated/radar_radar_options.rs rename to generated/stripe_shared/src/radar_radar_options.rs index fe16e861e..a27ddf87f 100644 --- a/src/resources/generated/radar_radar_options.rs +++ b/generated/stripe_shared/src/radar_radar_options.rs @@ -1,11 +1,6 @@ -// ====================================== -// This file was automatically generated. -// ====================================== - -use serde::{Deserialize, Serialize}; - -/// The resource representing a Stripe "RadarRadarOptions". -#[derive(Clone, Debug, Default, Deserialize, Serialize)] +/// Options to configure Radar. +/// See [Radar Session](https://stripe.com/docs/radar/radar-session) for more information. +#[derive(Clone, Debug, Default, serde::Serialize, serde::Deserialize)] pub struct RadarRadarOptions { /// A [Radar Session](https://stripe.com/docs/radar/radar-session) is a snapshot of the browser metadata and device details that help Radar make more accurate predictions on your payments. #[serde(skip_serializing_if = "Option::is_none")] diff --git a/generated/stripe_shared/src/radar_review_resource_location.rs b/generated/stripe_shared/src/radar_review_resource_location.rs new file mode 100644 index 000000000..a658c5806 --- /dev/null +++ b/generated/stripe_shared/src/radar_review_resource_location.rs @@ -0,0 +1,13 @@ +#[derive(Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct RadarReviewResourceLocation { + /// The city where the payment originated. + pub city: Option, + /// Two-letter ISO code representing the country where the payment originated. + pub country: Option, + /// The geographic latitude where the payment originated. + pub latitude: Option, + /// The geographic longitude where the payment originated. + pub longitude: Option, + /// The state/county/province/region where the payment originated. + pub region: Option, +} diff --git a/generated/stripe_shared/src/radar_review_resource_session.rs b/generated/stripe_shared/src/radar_review_resource_session.rs new file mode 100644 index 000000000..5bc93e651 --- /dev/null +++ b/generated/stripe_shared/src/radar_review_resource_session.rs @@ -0,0 +1,11 @@ +#[derive(Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct RadarReviewResourceSession { + /// The browser used in this browser session (e.g., `Chrome`). + pub browser: Option, + /// Information about the device used for the browser session (e.g., `Samsung SM-G930T`). + pub device: Option, + /// The platform for the browser session (e.g., `Macintosh`). + pub platform: Option, + /// The version for the browser session (e.g., `61.0.3163.100`). + pub version: Option, +} diff --git a/generated/stripe_shared/src/recurring.rs b/generated/stripe_shared/src/recurring.rs new file mode 100644 index 000000000..8cbc330d2 --- /dev/null +++ b/generated/stripe_shared/src/recurring.rs @@ -0,0 +1,196 @@ +#[derive(Copy, Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct Recurring { + /// Specifies a usage aggregation strategy for prices of `usage_type=metered`. Defaults to `sum`. + pub aggregate_usage: Option, + /// The frequency at which a subscription is billed. One of `day`, `week`, `month` or `year`. + pub interval: RecurringInterval, + /// The number of intervals (specified in the `interval` attribute) between subscription billings. + /// For example, `interval=month` and `interval_count=3` bills every 3 months. + pub interval_count: u64, + /// Default number of trial days when subscribing a customer to this price using [`trial_from_plan=true`](https://stripe.com/docs/api#create_subscription-trial_from_plan). + pub trial_period_days: Option, + /// Configures how the quantity per period should be determined. + /// Can be either `metered` or `licensed`. + /// `licensed` automatically bills the `quantity` set when adding it to a subscription. + /// `metered` aggregates the total usage based on usage records. + /// Defaults to `licensed`. + pub usage_type: RecurringUsageType, +} +/// Specifies a usage aggregation strategy for prices of `usage_type=metered`. Defaults to `sum`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum RecurringAggregateUsage { + LastDuringPeriod, + LastEver, + Max, + Sum, +} +impl RecurringAggregateUsage { + pub fn as_str(self) -> &'static str { + use RecurringAggregateUsage::*; + match self { + LastDuringPeriod => "last_during_period", + LastEver => "last_ever", + Max => "max", + Sum => "sum", + } + } +} + +impl std::str::FromStr for RecurringAggregateUsage { + type Err = (); + fn from_str(s: &str) -> Result { + use RecurringAggregateUsage::*; + match s { + "last_during_period" => Ok(LastDuringPeriod), + "last_ever" => Ok(LastEver), + "max" => Ok(Max), + "sum" => Ok(Sum), + _ => Err(()), + } + } +} +impl std::fmt::Display for RecurringAggregateUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for RecurringAggregateUsage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for RecurringAggregateUsage { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for RecurringAggregateUsage { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s) + .map_err(|_| serde::de::Error::custom("Unknown value for RecurringAggregateUsage")) + } +} +/// The frequency at which a subscription is billed. One of `day`, `week`, `month` or `year`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum RecurringInterval { + Day, + Month, + Week, + Year, +} +impl RecurringInterval { + pub fn as_str(self) -> &'static str { + use RecurringInterval::*; + match self { + Day => "day", + Month => "month", + Week => "week", + Year => "year", + } + } +} + +impl std::str::FromStr for RecurringInterval { + type Err = (); + fn from_str(s: &str) -> Result { + use RecurringInterval::*; + match s { + "day" => Ok(Day), + "month" => Ok(Month), + "week" => Ok(Week), + "year" => Ok(Year), + _ => Err(()), + } + } +} +impl std::fmt::Display for RecurringInterval { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for RecurringInterval { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for RecurringInterval { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for RecurringInterval { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s) + .map_err(|_| serde::de::Error::custom("Unknown value for RecurringInterval")) + } +} +/// Configures how the quantity per period should be determined. +/// Can be either `metered` or `licensed`. +/// `licensed` automatically bills the `quantity` set when adding it to a subscription. +/// `metered` aggregates the total usage based on usage records. +/// Defaults to `licensed`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum RecurringUsageType { + Licensed, + Metered, +} +impl RecurringUsageType { + pub fn as_str(self) -> &'static str { + use RecurringUsageType::*; + match self { + Licensed => "licensed", + Metered => "metered", + } + } +} + +impl std::str::FromStr for RecurringUsageType { + type Err = (); + fn from_str(s: &str) -> Result { + use RecurringUsageType::*; + match s { + "licensed" => Ok(Licensed), + "metered" => Ok(Metered), + _ => Err(()), + } + } +} +impl std::fmt::Display for RecurringUsageType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for RecurringUsageType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for RecurringUsageType { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for RecurringUsageType { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s) + .map_err(|_| serde::de::Error::custom("Unknown value for RecurringUsageType")) + } +} diff --git a/generated/stripe_shared/src/refund.rs b/generated/stripe_shared/src/refund.rs new file mode 100644 index 000000000..c48c33369 --- /dev/null +++ b/generated/stripe_shared/src/refund.rs @@ -0,0 +1,127 @@ +/// Refund objects allow you to refund a previously created charge that isn't +/// refunded yet. Funds are refunded to the credit or debit card that's +/// initially charged. +/// +/// Related guide: [Refunds](https://stripe.com/docs/refunds) +/// +/// For more details see <>. +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct Refund { + /// Amount, in cents (or local equivalent). + pub amount: i64, + /// Balance transaction that describes the impact on your account balance. + pub balance_transaction: Option>, + /// ID of the charge that's refunded. + pub charge: Option>, + /// Time at which the object was created. Measured in seconds since the Unix epoch. + pub created: stripe_types::Timestamp, + /// Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. + /// Must be a [supported currency](https://stripe.com/docs/currencies). + pub currency: stripe_types::Currency, + /// An arbitrary string attached to the object. + /// You can use this for displaying to users (available on non-card refunds only). + #[serde(skip_serializing_if = "Option::is_none")] + pub description: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub destination_details: Option, + /// After the refund fails, this balance transaction describes the adjustment made on your account balance that reverses the initial balance transaction. + #[serde(skip_serializing_if = "Option::is_none")] + pub failure_balance_transaction: + Option>, + /// Provides the reason for the refund failure. + /// Possible values are: `lost_or_stolen_card`, `expired_or_canceled_card`, `charge_for_pending_refund_disputed`, `insufficient_funds`, `declined`, `merchant_request`, or `unknown`. + #[serde(skip_serializing_if = "Option::is_none")] + pub failure_reason: Option, + /// Unique identifier for the object. + pub id: stripe_shared::RefundId, + /// For payment methods without native refund support (for example, Konbini, PromptPay), provide an email address for the customer to receive refund instructions. + #[serde(skip_serializing_if = "Option::is_none")] + pub instructions_email: Option, + /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. + /// This can be useful for storing additional information about the object in a structured format. + pub metadata: Option>, + #[serde(skip_serializing_if = "Option::is_none")] + pub next_action: Option, + /// ID of the PaymentIntent that's refunded. + pub payment_intent: Option>, + /// Reason for the refund, which is either user-provided (`duplicate`, `fraudulent`, or `requested_by_customer`) or generated by Stripe internally (`expired_uncaptured_charge`). + pub reason: Option, + /// This is the transaction number that appears on email receipts sent for this refund. + pub receipt_number: Option, + /// The transfer reversal that's associated with the refund. + /// Only present if the charge came from another Stripe account. + pub source_transfer_reversal: Option>, + /// Status of the refund. + /// This can be `pending`, `requires_action`, `succeeded`, `failed`, or `canceled`. + /// Learn more about [failed refunds](https://stripe.com/docs/refunds#failed-refunds). + pub status: Option, + /// This refers to the transfer reversal object if the accompanying transfer reverses. + /// This is only applicable if the charge was created using the destination parameter. + pub transfer_reversal: Option>, +} +/// Reason for the refund, which is either user-provided (`duplicate`, `fraudulent`, or `requested_by_customer`) or generated by Stripe internally (`expired_uncaptured_charge`). +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum RefundReason { + Duplicate, + ExpiredUncapturedCharge, + Fraudulent, + RequestedByCustomer, +} +impl RefundReason { + pub fn as_str(self) -> &'static str { + use RefundReason::*; + match self { + Duplicate => "duplicate", + ExpiredUncapturedCharge => "expired_uncaptured_charge", + Fraudulent => "fraudulent", + RequestedByCustomer => "requested_by_customer", + } + } +} + +impl std::str::FromStr for RefundReason { + type Err = (); + fn from_str(s: &str) -> Result { + use RefundReason::*; + match s { + "duplicate" => Ok(Duplicate), + "expired_uncaptured_charge" => Ok(ExpiredUncapturedCharge), + "fraudulent" => Ok(Fraudulent), + "requested_by_customer" => Ok(RequestedByCustomer), + _ => Err(()), + } + } +} +impl std::fmt::Display for RefundReason { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for RefundReason { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for RefundReason { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for RefundReason { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for RefundReason")) + } +} +impl stripe_types::Object for Refund { + type Id = stripe_shared::RefundId; + fn id(&self) -> &Self::Id { + &self.id + } +} +stripe_types::def_id!(RefundId, "re_" | "pyr_"); diff --git a/generated/stripe_shared/src/refund_destination_details.rs b/generated/stripe_shared/src/refund_destination_details.rs new file mode 100644 index 000000000..a64f2802e --- /dev/null +++ b/generated/stripe_shared/src/refund_destination_details.rs @@ -0,0 +1,64 @@ +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct RefundDestinationDetails { + #[serde(skip_serializing_if = "Option::is_none")] + pub affirm: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub afterpay_clearpay: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub alipay: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub au_bank_transfer: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub blik: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub br_bank_transfer: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub card: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub cashapp: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub customer_cash_balance: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub eps: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub eu_bank_transfer: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub gb_bank_transfer: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub giropay: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub grabpay: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub jp_bank_transfer: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub klarna: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub mx_bank_transfer: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub p24: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub paynow: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub paypal: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub pix: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub revolut: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub sofort: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub swish: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub th_bank_transfer: Option, + /// The type of transaction-specific details of the payment method used in the refund (e.g., `card`). + /// An additional hash is included on `destination_details` with a name matching this value. + /// It contains information specific to the refund transaction. + #[serde(rename = "type")] + pub type_: String, + #[serde(skip_serializing_if = "Option::is_none")] + pub us_bank_transfer: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub wechat_pay: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub zip: Option, +} diff --git a/generated/stripe_shared/src/refund_destination_details_card.rs b/generated/stripe_shared/src/refund_destination_details_card.rs new file mode 100644 index 000000000..a3531e4d2 --- /dev/null +++ b/generated/stripe_shared/src/refund_destination_details_card.rs @@ -0,0 +1,73 @@ +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct RefundDestinationDetailsCard { + /// Value of the reference number assigned to the refund. + #[serde(skip_serializing_if = "Option::is_none")] + pub reference: Option, + /// Status of the reference number on the refund. This can be `pending`, `available` or `unavailable`. + #[serde(skip_serializing_if = "Option::is_none")] + pub reference_status: Option, + /// Type of the reference number assigned to the refund. + #[serde(skip_serializing_if = "Option::is_none")] + pub reference_type: Option, + /// The type of refund. This can be `refund`, `reversal`, or `pending`. + #[serde(rename = "type")] + pub type_: RefundDestinationDetailsCardType, +} +/// The type of refund. This can be `refund`, `reversal`, or `pending`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum RefundDestinationDetailsCardType { + Pending, + Refund, + Reversal, +} +impl RefundDestinationDetailsCardType { + pub fn as_str(self) -> &'static str { + use RefundDestinationDetailsCardType::*; + match self { + Pending => "pending", + Refund => "refund", + Reversal => "reversal", + } + } +} + +impl std::str::FromStr for RefundDestinationDetailsCardType { + type Err = (); + fn from_str(s: &str) -> Result { + use RefundDestinationDetailsCardType::*; + match s { + "pending" => Ok(Pending), + "refund" => Ok(Refund), + "reversal" => Ok(Reversal), + _ => Err(()), + } + } +} +impl std::fmt::Display for RefundDestinationDetailsCardType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for RefundDestinationDetailsCardType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for RefundDestinationDetailsCardType { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for RefundDestinationDetailsCardType { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| { + serde::de::Error::custom("Unknown value for RefundDestinationDetailsCardType") + }) + } +} diff --git a/generated/stripe_shared/src/refund_destination_details_generic.rs b/generated/stripe_shared/src/refund_destination_details_generic.rs new file mode 100644 index 000000000..38af924b3 --- /dev/null +++ b/generated/stripe_shared/src/refund_destination_details_generic.rs @@ -0,0 +1,7 @@ +#[derive(Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct RefundDestinationDetailsGeneric { + /// The reference assigned to the refund. + pub reference: Option, + /// Status of the reference on the refund. This can be `pending`, `available` or `unavailable`. + pub reference_status: Option, +} diff --git a/generated/stripe_shared/src/refund_next_action.rs b/generated/stripe_shared/src/refund_next_action.rs new file mode 100644 index 000000000..2073c3d0b --- /dev/null +++ b/generated/stripe_shared/src/refund_next_action.rs @@ -0,0 +1,8 @@ +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct RefundNextAction { + /// Contains the refund details. + pub display_details: Option, + /// Type of the next action to perform. + #[serde(rename = "type")] + pub type_: String, +} diff --git a/generated/stripe_shared/src/refund_next_action_display_details.rs b/generated/stripe_shared/src/refund_next_action_display_details.rs new file mode 100644 index 000000000..2db329477 --- /dev/null +++ b/generated/stripe_shared/src/refund_next_action_display_details.rs @@ -0,0 +1,6 @@ +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct RefundNextActionDisplayDetails { + pub email_sent: stripe_shared::EmailSent, + /// The expiry timestamp. + pub expires_at: stripe_types::Timestamp, +} diff --git a/generated/stripe_shared/src/reserve_transaction.rs b/generated/stripe_shared/src/reserve_transaction.rs new file mode 100644 index 000000000..6eff61158 --- /dev/null +++ b/generated/stripe_shared/src/reserve_transaction.rs @@ -0,0 +1,18 @@ +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct ReserveTransaction { + pub amount: i64, + /// Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. + /// Must be a [supported currency](https://stripe.com/docs/currencies). + pub currency: stripe_types::Currency, + /// An arbitrary string attached to the object. Often useful for displaying to users. + pub description: Option, + /// Unique identifier for the object. + pub id: stripe_shared::ReserveTransactionId, +} +impl stripe_types::Object for ReserveTransaction { + type Id = stripe_shared::ReserveTransactionId; + fn id(&self) -> &Self::Id { + &self.id + } +} +stripe_types::def_id!(ReserveTransactionId, "rtx_"); diff --git a/generated/stripe_shared/src/review.rs b/generated/stripe_shared/src/review.rs new file mode 100644 index 000000000..c173ea8b2 --- /dev/null +++ b/generated/stripe_shared/src/review.rs @@ -0,0 +1,164 @@ +/// Reviews can be used to supplement automated fraud detection with human expertise. +/// +/// Learn more about [Radar](/radar) and reviewing payments +/// [here](https://stripe.com/docs/radar/reviews). +/// +/// For more details see <>. +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct Review { + /// The ZIP or postal code of the card used, if applicable. + pub billing_zip: Option, + /// The charge associated with this review. + pub charge: Option>, + /// The reason the review was closed, or null if it has not yet been closed. + /// One of `approved`, `refunded`, `refunded_as_fraud`, `disputed`, or `redacted`. + pub closed_reason: Option, + /// Time at which the object was created. Measured in seconds since the Unix epoch. + pub created: stripe_types::Timestamp, + /// Unique identifier for the object. + pub id: stripe_shared::ReviewId, + /// The IP address where the payment originated. + pub ip_address: Option, + /// Information related to the location of the payment. + /// Note that this information is an approximation and attempts to locate the nearest population center - it should not be used to determine a specific address. + pub ip_address_location: Option, + /// Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + pub livemode: bool, + /// If `true`, the review needs action. + pub open: bool, + /// The reason the review was opened. One of `rule` or `manual`. + pub opened_reason: ReviewOpenedReason, + /// The PaymentIntent ID associated with this review, if one exists. + #[serde(skip_serializing_if = "Option::is_none")] + pub payment_intent: Option>, + /// The reason the review is currently open or closed. + /// One of `rule`, `manual`, `approved`, `refunded`, `refunded_as_fraud`, `disputed`, or `redacted`. + pub reason: String, + /// Information related to the browsing session of the user who initiated the payment. + pub session: Option, +} +/// The reason the review was closed, or null if it has not yet been closed. +/// One of `approved`, `refunded`, `refunded_as_fraud`, `disputed`, or `redacted`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum ReviewClosedReason { + Approved, + Disputed, + Redacted, + Refunded, + RefundedAsFraud, +} +impl ReviewClosedReason { + pub fn as_str(self) -> &'static str { + use ReviewClosedReason::*; + match self { + Approved => "approved", + Disputed => "disputed", + Redacted => "redacted", + Refunded => "refunded", + RefundedAsFraud => "refunded_as_fraud", + } + } +} + +impl std::str::FromStr for ReviewClosedReason { + type Err = (); + fn from_str(s: &str) -> Result { + use ReviewClosedReason::*; + match s { + "approved" => Ok(Approved), + "disputed" => Ok(Disputed), + "redacted" => Ok(Redacted), + "refunded" => Ok(Refunded), + "refunded_as_fraud" => Ok(RefundedAsFraud), + _ => Err(()), + } + } +} +impl std::fmt::Display for ReviewClosedReason { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for ReviewClosedReason { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for ReviewClosedReason { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for ReviewClosedReason { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s) + .map_err(|_| serde::de::Error::custom("Unknown value for ReviewClosedReason")) + } +} +/// The reason the review was opened. One of `rule` or `manual`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum ReviewOpenedReason { + Manual, + Rule, +} +impl ReviewOpenedReason { + pub fn as_str(self) -> &'static str { + use ReviewOpenedReason::*; + match self { + Manual => "manual", + Rule => "rule", + } + } +} + +impl std::str::FromStr for ReviewOpenedReason { + type Err = (); + fn from_str(s: &str) -> Result { + use ReviewOpenedReason::*; + match s { + "manual" => Ok(Manual), + "rule" => Ok(Rule), + _ => Err(()), + } + } +} +impl std::fmt::Display for ReviewOpenedReason { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for ReviewOpenedReason { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for ReviewOpenedReason { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for ReviewOpenedReason { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s) + .map_err(|_| serde::de::Error::custom("Unknown value for ReviewOpenedReason")) + } +} +impl stripe_types::Object for Review { + type Id = stripe_shared::ReviewId; + fn id(&self) -> &Self::Id { + &self.id + } +} +stripe_types::def_id!(ReviewId, "prv_"); diff --git a/generated/stripe_shared/src/rule.rs b/generated/stripe_shared/src/rule.rs new file mode 100644 index 000000000..c3c8c0bfb --- /dev/null +++ b/generated/stripe_shared/src/rule.rs @@ -0,0 +1,16 @@ +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct Rule { + /// The action taken on the payment. + pub action: String, + /// Unique identifier for the object. + pub id: stripe_shared::RuleId, + /// The predicate to evaluate the payment against. + pub predicate: String, +} +impl stripe_types::Object for Rule { + type Id = stripe_shared::RuleId; + fn id(&self) -> &Self::Id { + &self.id + } +} +stripe_types::def_id!(RuleId); diff --git a/generated/stripe_shared/src/schedules_phase_automatic_tax.rs b/generated/stripe_shared/src/schedules_phase_automatic_tax.rs new file mode 100644 index 000000000..e0f4228ae --- /dev/null +++ b/generated/stripe_shared/src/schedules_phase_automatic_tax.rs @@ -0,0 +1,9 @@ +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct SchedulesPhaseAutomaticTax { + /// Whether Stripe automatically computes tax on invoices created during this phase. + pub enabled: bool, + /// The account that's liable for tax. + /// If set, the business address and tax registrations required to perform the tax calculation are loaded from this account. + /// The tax transaction is returned in the report of the connected account. + pub liability: Option, +} diff --git a/generated/stripe_shared/src/sepa_debit_generated_from.rs b/generated/stripe_shared/src/sepa_debit_generated_from.rs new file mode 100644 index 000000000..a6bf1ccae --- /dev/null +++ b/generated/stripe_shared/src/sepa_debit_generated_from.rs @@ -0,0 +1,7 @@ +#[derive(Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct SepaDebitGeneratedFrom { + /// The ID of the Charge that generated this PaymentMethod, if any. + pub charge: Option>, + /// The ID of the SetupAttempt that generated this PaymentMethod, if any. + pub setup_attempt: Option>, +} diff --git a/generated/stripe_shared/src/setup_attempt.rs b/generated/stripe_shared/src/setup_attempt.rs new file mode 100644 index 000000000..a68fbdbc4 --- /dev/null +++ b/generated/stripe_shared/src/setup_attempt.rs @@ -0,0 +1,109 @@ +/// A SetupAttempt describes one attempted confirmation of a SetupIntent, +/// whether that confirmation is successful or unsuccessful. You can use +/// SetupAttempts to inspect details of a specific attempt at setting up a +/// payment method using a SetupIntent. +/// +/// For more details see <>. +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct SetupAttempt { + /// The value of [application](https://stripe.com/docs/api/setup_intents/object#setup_intent_object-application) on the SetupIntent at the time of this confirmation. + pub application: Option>, + /// If present, the SetupIntent's payment method will be attached to the in-context Stripe Account. + /// + /// It can only be used for this Stripe Account’s own money movement flows like InboundTransfer and OutboundTransfers. + /// It cannot be set to true when setting up a PaymentMethod for a Customer, and defaults to false when attaching a PaymentMethod to a Customer. + #[serde(skip_serializing_if = "Option::is_none")] + pub attach_to_self: Option, + /// Time at which the object was created. Measured in seconds since the Unix epoch. + pub created: stripe_types::Timestamp, + /// The value of [customer](https://stripe.com/docs/api/setup_intents/object#setup_intent_object-customer) on the SetupIntent at the time of this confirmation. + pub customer: Option>, + /// Indicates the directions of money movement for which this payment method is intended to be used. + /// + /// Include `inbound` if you intend to use the payment method as the origin to pull funds from. + /// Include `outbound` if you intend to use the payment method as the destination to send funds to. + /// You can include both if you intend to use the payment method for both purposes. + pub flow_directions: Option>, + /// Unique identifier for the object. + pub id: stripe_shared::SetupAttemptId, + /// Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + pub livemode: bool, + /// The value of [on_behalf_of](https://stripe.com/docs/api/setup_intents/object#setup_intent_object-on_behalf_of) on the SetupIntent at the time of this confirmation. + pub on_behalf_of: Option>, + /// ID of the payment method used with this SetupAttempt. + pub payment_method: stripe_types::Expandable, + pub payment_method_details: stripe_shared::SetupAttemptPaymentMethodDetails, + /// The error encountered during this attempt to confirm the SetupIntent, if any. + pub setup_error: Option>, + /// ID of the SetupIntent that this attempt belongs to. + pub setup_intent: stripe_types::Expandable, + /// Status of this SetupAttempt, one of `requires_confirmation`, `requires_action`, `processing`, `succeeded`, `failed`, or `abandoned`. + pub status: String, + /// The value of [usage](https://stripe.com/docs/api/setup_intents/object#setup_intent_object-usage) on the SetupIntent at the time of this confirmation, one of `off_session` or `on_session`. + pub usage: String, +} +/// Indicates the directions of money movement for which this payment method is intended to be used. +/// +/// Include `inbound` if you intend to use the payment method as the origin to pull funds from. +/// Include `outbound` if you intend to use the payment method as the destination to send funds to. +/// You can include both if you intend to use the payment method for both purposes. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum SetupAttemptFlowDirections { + Inbound, + Outbound, +} +impl SetupAttemptFlowDirections { + pub fn as_str(self) -> &'static str { + use SetupAttemptFlowDirections::*; + match self { + Inbound => "inbound", + Outbound => "outbound", + } + } +} + +impl std::str::FromStr for SetupAttemptFlowDirections { + type Err = (); + fn from_str(s: &str) -> Result { + use SetupAttemptFlowDirections::*; + match s { + "inbound" => Ok(Inbound), + "outbound" => Ok(Outbound), + _ => Err(()), + } + } +} +impl std::fmt::Display for SetupAttemptFlowDirections { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for SetupAttemptFlowDirections { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for SetupAttemptFlowDirections { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for SetupAttemptFlowDirections { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s) + .map_err(|_| serde::de::Error::custom("Unknown value for SetupAttemptFlowDirections")) + } +} +impl stripe_types::Object for SetupAttempt { + type Id = stripe_shared::SetupAttemptId; + fn id(&self) -> &Self::Id { + &self.id + } +} +stripe_types::def_id!(SetupAttemptId, "setatt_"); diff --git a/generated/stripe_shared/src/setup_attempt_payment_method_details.rs b/generated/stripe_shared/src/setup_attempt_payment_method_details.rs new file mode 100644 index 000000000..0b3f15bc9 --- /dev/null +++ b/generated/stripe_shared/src/setup_attempt_payment_method_details.rs @@ -0,0 +1,38 @@ +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct SetupAttemptPaymentMethodDetails { + #[serde(skip_serializing_if = "Option::is_none")] + pub acss_debit: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub au_becs_debit: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub bacs_debit: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub bancontact: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub boleto: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub card: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub card_present: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub cashapp: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub ideal: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub klarna: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub link: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub paypal: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub sepa_debit: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub sofort: Option, + /// The type of the payment method used in the SetupIntent (e.g., `card`). + /// An additional hash is included on `payment_method_details` with a name matching this value. + /// It contains confirmation-specific information for the payment method. + #[serde(rename = "type")] + pub type_: String, + #[serde(skip_serializing_if = "Option::is_none")] + pub us_bank_account: Option, +} diff --git a/generated/stripe_shared/src/setup_attempt_payment_method_details_acss_debit.rs b/generated/stripe_shared/src/setup_attempt_payment_method_details_acss_debit.rs new file mode 100644 index 000000000..59426ea77 --- /dev/null +++ b/generated/stripe_shared/src/setup_attempt_payment_method_details_acss_debit.rs @@ -0,0 +1,2 @@ +#[derive(Copy, Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct SetupAttemptPaymentMethodDetailsAcssDebit {} diff --git a/generated/stripe_shared/src/setup_attempt_payment_method_details_au_becs_debit.rs b/generated/stripe_shared/src/setup_attempt_payment_method_details_au_becs_debit.rs new file mode 100644 index 000000000..092b15c74 --- /dev/null +++ b/generated/stripe_shared/src/setup_attempt_payment_method_details_au_becs_debit.rs @@ -0,0 +1,2 @@ +#[derive(Copy, Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct SetupAttemptPaymentMethodDetailsAuBecsDebit {} diff --git a/generated/stripe_shared/src/setup_attempt_payment_method_details_bacs_debit.rs b/generated/stripe_shared/src/setup_attempt_payment_method_details_bacs_debit.rs new file mode 100644 index 000000000..39be12ee4 --- /dev/null +++ b/generated/stripe_shared/src/setup_attempt_payment_method_details_bacs_debit.rs @@ -0,0 +1,2 @@ +#[derive(Copy, Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct SetupAttemptPaymentMethodDetailsBacsDebit {} diff --git a/generated/stripe_shared/src/setup_attempt_payment_method_details_bancontact.rs b/generated/stripe_shared/src/setup_attempt_payment_method_details_bancontact.rs new file mode 100644 index 000000000..647a5caca --- /dev/null +++ b/generated/stripe_shared/src/setup_attempt_payment_method_details_bancontact.rs @@ -0,0 +1,85 @@ +#[derive(Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct SetupAttemptPaymentMethodDetailsBancontact { + /// Bank code of bank associated with the bank account. + pub bank_code: Option, + /// Name of the bank associated with the bank account. + pub bank_name: Option, + /// Bank Identifier Code of the bank associated with the bank account. + pub bic: Option, + /// The ID of the SEPA Direct Debit PaymentMethod which was generated by this SetupAttempt. + pub generated_sepa_debit: Option>, + /// The mandate for the SEPA Direct Debit PaymentMethod which was generated by this SetupAttempt. + pub generated_sepa_debit_mandate: Option>, + /// Last four characters of the IBAN. + pub iban_last4: Option, + /// Preferred language of the Bancontact authorization page that the customer is redirected to. + /// Can be one of `en`, `de`, `fr`, or `nl` + pub preferred_language: Option, + /// Owner's verified full name. Values are verified or provided by Bancontact directly + /// (if supported) at the time of authorization or settlement. They cannot be set or mutated. + pub verified_name: Option, +} +/// Preferred language of the Bancontact authorization page that the customer is redirected to. +/// Can be one of `en`, `de`, `fr`, or `nl` +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum SetupAttemptPaymentMethodDetailsBancontactPreferredLanguage { + De, + En, + Fr, + Nl, +} +impl SetupAttemptPaymentMethodDetailsBancontactPreferredLanguage { + pub fn as_str(self) -> &'static str { + use SetupAttemptPaymentMethodDetailsBancontactPreferredLanguage::*; + match self { + De => "de", + En => "en", + Fr => "fr", + Nl => "nl", + } + } +} + +impl std::str::FromStr for SetupAttemptPaymentMethodDetailsBancontactPreferredLanguage { + type Err = (); + fn from_str(s: &str) -> Result { + use SetupAttemptPaymentMethodDetailsBancontactPreferredLanguage::*; + match s { + "de" => Ok(De), + "en" => Ok(En), + "fr" => Ok(Fr), + "nl" => Ok(Nl), + _ => Err(()), + } + } +} +impl std::fmt::Display for SetupAttemptPaymentMethodDetailsBancontactPreferredLanguage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for SetupAttemptPaymentMethodDetailsBancontactPreferredLanguage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for SetupAttemptPaymentMethodDetailsBancontactPreferredLanguage { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for SetupAttemptPaymentMethodDetailsBancontactPreferredLanguage { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| { + serde::de::Error::custom( + "Unknown value for SetupAttemptPaymentMethodDetailsBancontactPreferredLanguage", + ) + }) + } +} diff --git a/generated/stripe_shared/src/setup_attempt_payment_method_details_boleto.rs b/generated/stripe_shared/src/setup_attempt_payment_method_details_boleto.rs new file mode 100644 index 000000000..879f54e79 --- /dev/null +++ b/generated/stripe_shared/src/setup_attempt_payment_method_details_boleto.rs @@ -0,0 +1,2 @@ +#[derive(Copy, Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct SetupAttemptPaymentMethodDetailsBoleto {} diff --git a/generated/stripe_shared/src/setup_attempt_payment_method_details_card.rs b/generated/stripe_shared/src/setup_attempt_payment_method_details_card.rs new file mode 100644 index 000000000..ed67fedc4 --- /dev/null +++ b/generated/stripe_shared/src/setup_attempt_payment_method_details_card.rs @@ -0,0 +1,45 @@ +#[derive(Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct SetupAttemptPaymentMethodDetailsCard { + /// Card brand. + /// Can be `amex`, `diners`, `discover`, `eftpos_au`, `jcb`, `mastercard`, `unionpay`, `visa`, or `unknown`. + pub brand: Option, + /// Check results by Card networks on Card address and CVC at the time of authorization + pub checks: Option, + /// Two-letter ISO code representing the country of the card. + /// You could use this attribute to get a sense of the international breakdown of cards you've collected. + pub country: Option, + /// A high-level description of the type of cards issued in this range. + /// (For internal use only and not typically available in standard API requests.). + #[serde(skip_serializing_if = "Option::is_none")] + pub description: Option, + /// Two-digit number representing the card's expiration month. + pub exp_month: Option, + /// Four-digit number representing the card's expiration year. + pub exp_year: Option, + /// Uniquely identifies this particular card number. + /// You can use this attribute to check whether two customers who’ve signed up with you are using the same card number, for example. + /// For payment methods that tokenize card information (Apple Pay, Google Pay), the tokenized number might be provided instead of the underlying card number. + /// + /// *As of May 1, 2021, card fingerprint in India for Connect changed to allow two fingerprints for the same card---one for India and one for the rest of the world.*. + #[serde(skip_serializing_if = "Option::is_none")] + pub fingerprint: Option, + /// Card funding type. Can be `credit`, `debit`, `prepaid`, or `unknown`. + pub funding: Option, + /// Issuer identification number of the card. + /// (For internal use only and not typically available in standard API requests.). + #[serde(skip_serializing_if = "Option::is_none")] + pub iin: Option, + /// The name of the card's issuing bank. + /// (For internal use only and not typically available in standard API requests.). + #[serde(skip_serializing_if = "Option::is_none")] + pub issuer: Option, + /// The last four digits of the card. + pub last4: Option, + /// Identifies which network this charge was processed on. + /// Can be `amex`, `cartes_bancaires`, `diners`, `discover`, `eftpos_au`, `interac`, `jcb`, `mastercard`, `unionpay`, `visa`, or `unknown`. + pub network: Option, + /// Populated if this authorization used 3D Secure authentication. + pub three_d_secure: Option, + /// If this Card is part of a card wallet, this contains the details of the card wallet. + pub wallet: Option, +} diff --git a/generated/stripe_shared/src/setup_attempt_payment_method_details_card_checks.rs b/generated/stripe_shared/src/setup_attempt_payment_method_details_card_checks.rs new file mode 100644 index 000000000..de56ad5c9 --- /dev/null +++ b/generated/stripe_shared/src/setup_attempt_payment_method_details_card_checks.rs @@ -0,0 +1,9 @@ +#[derive(Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct SetupAttemptPaymentMethodDetailsCardChecks { + /// If a address line1 was provided, results of the check, one of `pass`, `fail`, `unavailable`, or `unchecked`. + pub address_line1_check: Option, + /// If a address postal code was provided, results of the check, one of `pass`, `fail`, `unavailable`, or `unchecked`. + pub address_postal_code_check: Option, + /// If a CVC was provided, results of the check, one of `pass`, `fail`, `unavailable`, or `unchecked`. + pub cvc_check: Option, +} diff --git a/generated/stripe_shared/src/setup_attempt_payment_method_details_card_present.rs b/generated/stripe_shared/src/setup_attempt_payment_method_details_card_present.rs new file mode 100644 index 000000000..a9ea3977c --- /dev/null +++ b/generated/stripe_shared/src/setup_attempt_payment_method_details_card_present.rs @@ -0,0 +1,5 @@ +#[derive(Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct SetupAttemptPaymentMethodDetailsCardPresent { + /// The ID of the Card PaymentMethod which was generated by this SetupAttempt. + pub generated_card: Option>, +} diff --git a/generated/stripe_shared/src/setup_attempt_payment_method_details_card_wallet.rs b/generated/stripe_shared/src/setup_attempt_payment_method_details_card_wallet.rs new file mode 100644 index 000000000..4911031db --- /dev/null +++ b/generated/stripe_shared/src/setup_attempt_payment_method_details_card_wallet.rs @@ -0,0 +1,74 @@ +#[derive(Copy, Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct SetupAttemptPaymentMethodDetailsCardWallet { + #[serde(skip_serializing_if = "Option::is_none")] + pub apple_pay: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub google_pay: Option, + /// The type of the card wallet, one of `apple_pay`, `google_pay`, or `link`. + /// An additional hash is included on the Wallet subhash with a name matching this value. + /// It contains additional information specific to the card wallet type. + #[serde(rename = "type")] + pub type_: SetupAttemptPaymentMethodDetailsCardWalletType, +} +/// The type of the card wallet, one of `apple_pay`, `google_pay`, or `link`. +/// An additional hash is included on the Wallet subhash with a name matching this value. +/// It contains additional information specific to the card wallet type. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum SetupAttemptPaymentMethodDetailsCardWalletType { + ApplePay, + GooglePay, + Link, +} +impl SetupAttemptPaymentMethodDetailsCardWalletType { + pub fn as_str(self) -> &'static str { + use SetupAttemptPaymentMethodDetailsCardWalletType::*; + match self { + ApplePay => "apple_pay", + GooglePay => "google_pay", + Link => "link", + } + } +} + +impl std::str::FromStr for SetupAttemptPaymentMethodDetailsCardWalletType { + type Err = (); + fn from_str(s: &str) -> Result { + use SetupAttemptPaymentMethodDetailsCardWalletType::*; + match s { + "apple_pay" => Ok(ApplePay), + "google_pay" => Ok(GooglePay), + "link" => Ok(Link), + _ => Err(()), + } + } +} +impl std::fmt::Display for SetupAttemptPaymentMethodDetailsCardWalletType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for SetupAttemptPaymentMethodDetailsCardWalletType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for SetupAttemptPaymentMethodDetailsCardWalletType { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for SetupAttemptPaymentMethodDetailsCardWalletType { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| { + serde::de::Error::custom( + "Unknown value for SetupAttemptPaymentMethodDetailsCardWalletType", + ) + }) + } +} diff --git a/generated/stripe_shared/src/setup_attempt_payment_method_details_cashapp.rs b/generated/stripe_shared/src/setup_attempt_payment_method_details_cashapp.rs new file mode 100644 index 000000000..f5980430c --- /dev/null +++ b/generated/stripe_shared/src/setup_attempt_payment_method_details_cashapp.rs @@ -0,0 +1,2 @@ +#[derive(Copy, Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct SetupAttemptPaymentMethodDetailsCashapp {} diff --git a/generated/stripe_shared/src/setup_attempt_payment_method_details_ideal.rs b/generated/stripe_shared/src/setup_attempt_payment_method_details_ideal.rs new file mode 100644 index 000000000..f7379c164 --- /dev/null +++ b/generated/stripe_shared/src/setup_attempt_payment_method_details_ideal.rs @@ -0,0 +1,219 @@ +#[derive(Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct SetupAttemptPaymentMethodDetailsIdeal { + /// The customer's bank. + /// Can be one of `abn_amro`, `asn_bank`, `bunq`, `handelsbanken`, `ing`, `knab`, `moneyou`, `n26`, `nn`, `rabobank`, `regiobank`, `revolut`, `sns_bank`, `triodos_bank`, `van_lanschot`, or `yoursafe`. + pub bank: Option, + /// The Bank Identifier Code of the customer's bank. + pub bic: Option, + /// The ID of the SEPA Direct Debit PaymentMethod which was generated by this SetupAttempt. + pub generated_sepa_debit: Option>, + /// The mandate for the SEPA Direct Debit PaymentMethod which was generated by this SetupAttempt. + pub generated_sepa_debit_mandate: Option>, + /// Last four characters of the IBAN. + pub iban_last4: Option, + /// Owner's verified full name. Values are verified or provided by iDEAL directly + /// (if supported) at the time of authorization or settlement. They cannot be set or mutated. + pub verified_name: Option, +} +/// The customer's bank. +/// Can be one of `abn_amro`, `asn_bank`, `bunq`, `handelsbanken`, `ing`, `knab`, `moneyou`, `n26`, `nn`, `rabobank`, `regiobank`, `revolut`, `sns_bank`, `triodos_bank`, `van_lanschot`, or `yoursafe`. +#[derive(Copy, Clone, Eq, PartialEq)] +#[non_exhaustive] +pub enum SetupAttemptPaymentMethodDetailsIdealBank { + AbnAmro, + AsnBank, + Bunq, + Handelsbanken, + Ing, + Knab, + Moneyou, + N26, + Nn, + Rabobank, + Regiobank, + Revolut, + SnsBank, + TriodosBank, + VanLanschot, + Yoursafe, + /// An unrecognized value from Stripe. Should not be used as a request parameter. + Unknown, +} +impl SetupAttemptPaymentMethodDetailsIdealBank { + pub fn as_str(self) -> &'static str { + use SetupAttemptPaymentMethodDetailsIdealBank::*; + match self { + AbnAmro => "abn_amro", + AsnBank => "asn_bank", + Bunq => "bunq", + Handelsbanken => "handelsbanken", + Ing => "ing", + Knab => "knab", + Moneyou => "moneyou", + N26 => "n26", + Nn => "nn", + Rabobank => "rabobank", + Regiobank => "regiobank", + Revolut => "revolut", + SnsBank => "sns_bank", + TriodosBank => "triodos_bank", + VanLanschot => "van_lanschot", + Yoursafe => "yoursafe", + Unknown => "unknown", + } + } +} + +impl std::str::FromStr for SetupAttemptPaymentMethodDetailsIdealBank { + type Err = (); + fn from_str(s: &str) -> Result { + use SetupAttemptPaymentMethodDetailsIdealBank::*; + match s { + "abn_amro" => Ok(AbnAmro), + "asn_bank" => Ok(AsnBank), + "bunq" => Ok(Bunq), + "handelsbanken" => Ok(Handelsbanken), + "ing" => Ok(Ing), + "knab" => Ok(Knab), + "moneyou" => Ok(Moneyou), + "n26" => Ok(N26), + "nn" => Ok(Nn), + "rabobank" => Ok(Rabobank), + "regiobank" => Ok(Regiobank), + "revolut" => Ok(Revolut), + "sns_bank" => Ok(SnsBank), + "triodos_bank" => Ok(TriodosBank), + "van_lanschot" => Ok(VanLanschot), + "yoursafe" => Ok(Yoursafe), + _ => Err(()), + } + } +} +impl std::fmt::Display for SetupAttemptPaymentMethodDetailsIdealBank { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for SetupAttemptPaymentMethodDetailsIdealBank { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for SetupAttemptPaymentMethodDetailsIdealBank { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for SetupAttemptPaymentMethodDetailsIdealBank { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Ok(Self::from_str(&s).unwrap_or(SetupAttemptPaymentMethodDetailsIdealBank::Unknown)) + } +} +/// The Bank Identifier Code of the customer's bank. +#[derive(Copy, Clone, Eq, PartialEq)] +#[non_exhaustive] +pub enum SetupAttemptPaymentMethodDetailsIdealBic { + Abnanl2a, + Asnbnl21, + Bitsnl2a, + Bunqnl2a, + Fvlbnl22, + Handnl2a, + Ingbnl2a, + Knabnl2h, + Moyonl21, + Nnbanl2g, + Ntsbdeb1, + Rabonl2u, + Rbrbnl21, + Revoie23, + Revolt21, + Snsbnl2a, + Trionl2u, + /// An unrecognized value from Stripe. Should not be used as a request parameter. + Unknown, +} +impl SetupAttemptPaymentMethodDetailsIdealBic { + pub fn as_str(self) -> &'static str { + use SetupAttemptPaymentMethodDetailsIdealBic::*; + match self { + Abnanl2a => "ABNANL2A", + Asnbnl21 => "ASNBNL21", + Bitsnl2a => "BITSNL2A", + Bunqnl2a => "BUNQNL2A", + Fvlbnl22 => "FVLBNL22", + Handnl2a => "HANDNL2A", + Ingbnl2a => "INGBNL2A", + Knabnl2h => "KNABNL2H", + Moyonl21 => "MOYONL21", + Nnbanl2g => "NNBANL2G", + Ntsbdeb1 => "NTSBDEB1", + Rabonl2u => "RABONL2U", + Rbrbnl21 => "RBRBNL21", + Revoie23 => "REVOIE23", + Revolt21 => "REVOLT21", + Snsbnl2a => "SNSBNL2A", + Trionl2u => "TRIONL2U", + Unknown => "unknown", + } + } +} + +impl std::str::FromStr for SetupAttemptPaymentMethodDetailsIdealBic { + type Err = (); + fn from_str(s: &str) -> Result { + use SetupAttemptPaymentMethodDetailsIdealBic::*; + match s { + "ABNANL2A" => Ok(Abnanl2a), + "ASNBNL21" => Ok(Asnbnl21), + "BITSNL2A" => Ok(Bitsnl2a), + "BUNQNL2A" => Ok(Bunqnl2a), + "FVLBNL22" => Ok(Fvlbnl22), + "HANDNL2A" => Ok(Handnl2a), + "INGBNL2A" => Ok(Ingbnl2a), + "KNABNL2H" => Ok(Knabnl2h), + "MOYONL21" => Ok(Moyonl21), + "NNBANL2G" => Ok(Nnbanl2g), + "NTSBDEB1" => Ok(Ntsbdeb1), + "RABONL2U" => Ok(Rabonl2u), + "RBRBNL21" => Ok(Rbrbnl21), + "REVOIE23" => Ok(Revoie23), + "REVOLT21" => Ok(Revolt21), + "SNSBNL2A" => Ok(Snsbnl2a), + "TRIONL2U" => Ok(Trionl2u), + _ => Err(()), + } + } +} +impl std::fmt::Display for SetupAttemptPaymentMethodDetailsIdealBic { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for SetupAttemptPaymentMethodDetailsIdealBic { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for SetupAttemptPaymentMethodDetailsIdealBic { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for SetupAttemptPaymentMethodDetailsIdealBic { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Ok(Self::from_str(&s).unwrap_or(SetupAttemptPaymentMethodDetailsIdealBic::Unknown)) + } +} diff --git a/generated/stripe_shared/src/setup_attempt_payment_method_details_klarna.rs b/generated/stripe_shared/src/setup_attempt_payment_method_details_klarna.rs new file mode 100644 index 000000000..530bbd657 --- /dev/null +++ b/generated/stripe_shared/src/setup_attempt_payment_method_details_klarna.rs @@ -0,0 +1,2 @@ +#[derive(Copy, Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct SetupAttemptPaymentMethodDetailsKlarna {} diff --git a/generated/stripe_shared/src/setup_attempt_payment_method_details_link.rs b/generated/stripe_shared/src/setup_attempt_payment_method_details_link.rs new file mode 100644 index 000000000..cfd19ba47 --- /dev/null +++ b/generated/stripe_shared/src/setup_attempt_payment_method_details_link.rs @@ -0,0 +1,2 @@ +#[derive(Copy, Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct SetupAttemptPaymentMethodDetailsLink {} diff --git a/generated/stripe_shared/src/setup_attempt_payment_method_details_paypal.rs b/generated/stripe_shared/src/setup_attempt_payment_method_details_paypal.rs new file mode 100644 index 000000000..915512a00 --- /dev/null +++ b/generated/stripe_shared/src/setup_attempt_payment_method_details_paypal.rs @@ -0,0 +1,2 @@ +#[derive(Copy, Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct SetupAttemptPaymentMethodDetailsPaypal {} diff --git a/generated/stripe_shared/src/setup_attempt_payment_method_details_sepa_debit.rs b/generated/stripe_shared/src/setup_attempt_payment_method_details_sepa_debit.rs new file mode 100644 index 000000000..2063e17ca --- /dev/null +++ b/generated/stripe_shared/src/setup_attempt_payment_method_details_sepa_debit.rs @@ -0,0 +1,2 @@ +#[derive(Copy, Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct SetupAttemptPaymentMethodDetailsSepaDebit {} diff --git a/generated/stripe_shared/src/setup_attempt_payment_method_details_sofort.rs b/generated/stripe_shared/src/setup_attempt_payment_method_details_sofort.rs new file mode 100644 index 000000000..fed163ded --- /dev/null +++ b/generated/stripe_shared/src/setup_attempt_payment_method_details_sofort.rs @@ -0,0 +1,85 @@ +#[derive(Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct SetupAttemptPaymentMethodDetailsSofort { + /// Bank code of bank associated with the bank account. + pub bank_code: Option, + /// Name of the bank associated with the bank account. + pub bank_name: Option, + /// Bank Identifier Code of the bank associated with the bank account. + pub bic: Option, + /// The ID of the SEPA Direct Debit PaymentMethod which was generated by this SetupAttempt. + pub generated_sepa_debit: Option>, + /// The mandate for the SEPA Direct Debit PaymentMethod which was generated by this SetupAttempt. + pub generated_sepa_debit_mandate: Option>, + /// Last four characters of the IBAN. + pub iban_last4: Option, + /// Preferred language of the Sofort authorization page that the customer is redirected to. + /// Can be one of `en`, `de`, `fr`, or `nl` + pub preferred_language: Option, + /// Owner's verified full name. Values are verified or provided by Sofort directly + /// (if supported) at the time of authorization or settlement. They cannot be set or mutated. + pub verified_name: Option, +} +/// Preferred language of the Sofort authorization page that the customer is redirected to. +/// Can be one of `en`, `de`, `fr`, or `nl` +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum SetupAttemptPaymentMethodDetailsSofortPreferredLanguage { + De, + En, + Fr, + Nl, +} +impl SetupAttemptPaymentMethodDetailsSofortPreferredLanguage { + pub fn as_str(self) -> &'static str { + use SetupAttemptPaymentMethodDetailsSofortPreferredLanguage::*; + match self { + De => "de", + En => "en", + Fr => "fr", + Nl => "nl", + } + } +} + +impl std::str::FromStr for SetupAttemptPaymentMethodDetailsSofortPreferredLanguage { + type Err = (); + fn from_str(s: &str) -> Result { + use SetupAttemptPaymentMethodDetailsSofortPreferredLanguage::*; + match s { + "de" => Ok(De), + "en" => Ok(En), + "fr" => Ok(Fr), + "nl" => Ok(Nl), + _ => Err(()), + } + } +} +impl std::fmt::Display for SetupAttemptPaymentMethodDetailsSofortPreferredLanguage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for SetupAttemptPaymentMethodDetailsSofortPreferredLanguage { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for SetupAttemptPaymentMethodDetailsSofortPreferredLanguage { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for SetupAttemptPaymentMethodDetailsSofortPreferredLanguage { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| { + serde::de::Error::custom( + "Unknown value for SetupAttemptPaymentMethodDetailsSofortPreferredLanguage", + ) + }) + } +} diff --git a/generated/stripe_shared/src/setup_attempt_payment_method_details_us_bank_account.rs b/generated/stripe_shared/src/setup_attempt_payment_method_details_us_bank_account.rs new file mode 100644 index 000000000..e8938c099 --- /dev/null +++ b/generated/stripe_shared/src/setup_attempt_payment_method_details_us_bank_account.rs @@ -0,0 +1,2 @@ +#[derive(Copy, Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct SetupAttemptPaymentMethodDetailsUsBankAccount {} diff --git a/generated/stripe_shared/src/setup_intent.rs b/generated/stripe_shared/src/setup_intent.rs new file mode 100644 index 000000000..5a775a4d1 --- /dev/null +++ b/generated/stripe_shared/src/setup_intent.rs @@ -0,0 +1,279 @@ +/// A SetupIntent guides you through the process of setting up and saving a customer's payment credentials for future payments. +/// For example, you can use a SetupIntent to set up and save your customer's card without immediately collecting a payment. +/// Later, you can use [PaymentIntents](https://stripe.com/docs/api#payment_intents) to drive the payment flow. +/// +/// Create a SetupIntent when you're ready to collect your customer's payment credentials. +/// Don't maintain long-lived, unconfirmed SetupIntents because they might not be valid. +/// The SetupIntent transitions through multiple [statuses](https://stripe.com/docs/payments/intents#intent-statuses) as it guides. +/// you through the setup process. +/// +/// Successful SetupIntents result in payment credentials that are optimized for future payments. +/// For example, cardholders in [certain regions](/guides/strong-customer-authentication) might need to be run through. +/// [Strong Customer Authentication](https://stripe.com/docs/strong-customer-authentication) during payment method collection. +/// to streamline later [off-session payments](https://stripe.com/docs/payments/setup-intents). +/// If you use the SetupIntent with a [Customer](https://stripe.com/docs/api#setup_intent_object-customer),. +/// it automatically attaches the resulting payment method to that Customer after successful setup. +/// We recommend using SetupIntents or [setup_future_usage](https://stripe.com/docs/api#payment_intent_object-setup_future_usage) on. +/// PaymentIntents to save payment methods to prevent saving invalid or unoptimized payment methods. +/// +/// By using SetupIntents, you can reduce friction for your customers, even as regulations change over time. +/// +/// Related guide: [Setup Intents API](https://stripe.com/docs/payments/setup-intents) +/// +/// For more details see <>. +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct SetupIntent { + /// ID of the Connect application that created the SetupIntent. + pub application: Option>, + /// If present, the SetupIntent's payment method will be attached to the in-context Stripe Account. + /// + /// It can only be used for this Stripe Account’s own money movement flows like InboundTransfer and OutboundTransfers. + /// It cannot be set to true when setting up a PaymentMethod for a Customer, and defaults to false when attaching a PaymentMethod to a Customer. + #[serde(skip_serializing_if = "Option::is_none")] + pub attach_to_self: Option, + /// Settings for dynamic payment methods compatible with this Setup Intent + pub automatic_payment_methods: + Option, + /// Reason for cancellation of this SetupIntent, one of `abandoned`, `requested_by_customer`, or `duplicate`. + pub cancellation_reason: Option, + /// The client secret of this SetupIntent. Used for client-side retrieval using a publishable key. + /// + /// The client secret can be used to complete payment setup from your frontend. + /// It should not be stored, logged, or exposed to anyone other than the customer. + /// Make sure that you have TLS enabled on any page that includes the client secret. + pub client_secret: Option, + /// Time at which the object was created. Measured in seconds since the Unix epoch. + pub created: stripe_types::Timestamp, + /// ID of the Customer this SetupIntent belongs to, if one exists. + /// + /// If present, the SetupIntent's payment method will be attached to the Customer on successful setup. + /// Payment methods attached to other Customers cannot be used with this SetupIntent. + pub customer: Option>, + /// An arbitrary string attached to the object. Often useful for displaying to users. + pub description: Option, + /// Indicates the directions of money movement for which this payment method is intended to be used. + /// + /// Include `inbound` if you intend to use the payment method as the origin to pull funds from. + /// Include `outbound` if you intend to use the payment method as the destination to send funds to. + /// You can include both if you intend to use the payment method for both purposes. + pub flow_directions: Option>, + /// Unique identifier for the object. + pub id: stripe_shared::SetupIntentId, + /// The error encountered in the previous SetupIntent confirmation. + pub last_setup_error: Option>, + /// The most recent SetupAttempt for this SetupIntent. + pub latest_attempt: Option>, + /// Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + pub livemode: bool, + /// ID of the multi use Mandate generated by the SetupIntent. + pub mandate: Option>, + /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. + /// This can be useful for storing additional information about the object in a structured format. + pub metadata: Option>, + /// If present, this property tells you what actions you need to take in order for your customer to continue payment setup. + pub next_action: Option, + /// The account (if any) for which the setup is intended. + pub on_behalf_of: Option>, + /// ID of the payment method used with this SetupIntent. + pub payment_method: Option>, + /// Information about the payment method configuration used for this Setup Intent. + pub payment_method_configuration_details: + Option, + /// Payment method-specific configuration for this SetupIntent. + pub payment_method_options: Option, + /// The list of payment method types (e.g. card) that this SetupIntent is allowed to set up. + pub payment_method_types: Vec, + /// ID of the single_use Mandate generated by the SetupIntent. + pub single_use_mandate: Option>, + /// [Status](https://stripe.com/docs/payments/intents#intent-statuses) of this SetupIntent, one of `requires_payment_method`, `requires_confirmation`, `requires_action`, `processing`, `canceled`, or `succeeded`. + pub status: SetupIntentStatus, + /// Indicates how the payment method is intended to be used in the future. + /// + /// Use `on_session` if you intend to only reuse the payment method when the customer is in your checkout flow. + /// Use `off_session` if your customer may or may not be in your checkout flow. + /// If not provided, this value defaults to `off_session`. + pub usage: String, +} +/// [Status](https://stripe.com/docs/payments/intents#intent-statuses) of this SetupIntent, one of `requires_payment_method`, `requires_confirmation`, `requires_action`, `processing`, `canceled`, or `succeeded`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum SetupIntentStatus { + Canceled, + Processing, + RequiresAction, + RequiresConfirmation, + RequiresPaymentMethod, + Succeeded, +} +impl SetupIntentStatus { + pub fn as_str(self) -> &'static str { + use SetupIntentStatus::*; + match self { + Canceled => "canceled", + Processing => "processing", + RequiresAction => "requires_action", + RequiresConfirmation => "requires_confirmation", + RequiresPaymentMethod => "requires_payment_method", + Succeeded => "succeeded", + } + } +} + +impl std::str::FromStr for SetupIntentStatus { + type Err = (); + fn from_str(s: &str) -> Result { + use SetupIntentStatus::*; + match s { + "canceled" => Ok(Canceled), + "processing" => Ok(Processing), + "requires_action" => Ok(RequiresAction), + "requires_confirmation" => Ok(RequiresConfirmation), + "requires_payment_method" => Ok(RequiresPaymentMethod), + "succeeded" => Ok(Succeeded), + _ => Err(()), + } + } +} +impl std::fmt::Display for SetupIntentStatus { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for SetupIntentStatus { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for SetupIntentStatus { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for SetupIntentStatus { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s) + .map_err(|_| serde::de::Error::custom("Unknown value for SetupIntentStatus")) + } +} +impl stripe_types::Object for SetupIntent { + type Id = stripe_shared::SetupIntentId; + fn id(&self) -> &Self::Id { + &self.id + } +} +stripe_types::def_id!(SetupIntentId, "seti_"); +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum SetupIntentCancellationReason { + Abandoned, + Duplicate, + RequestedByCustomer, +} +impl SetupIntentCancellationReason { + pub fn as_str(self) -> &'static str { + use SetupIntentCancellationReason::*; + match self { + Abandoned => "abandoned", + Duplicate => "duplicate", + RequestedByCustomer => "requested_by_customer", + } + } +} + +impl std::str::FromStr for SetupIntentCancellationReason { + type Err = (); + fn from_str(s: &str) -> Result { + use SetupIntentCancellationReason::*; + match s { + "abandoned" => Ok(Abandoned), + "duplicate" => Ok(Duplicate), + "requested_by_customer" => Ok(RequestedByCustomer), + _ => Err(()), + } + } +} +impl std::fmt::Display for SetupIntentCancellationReason { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for SetupIntentCancellationReason { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for SetupIntentCancellationReason { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for SetupIntentCancellationReason { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| { + serde::de::Error::custom("Unknown value for SetupIntentCancellationReason") + }) + } +} +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum SetupIntentFlowDirections { + Inbound, + Outbound, +} +impl SetupIntentFlowDirections { + pub fn as_str(self) -> &'static str { + use SetupIntentFlowDirections::*; + match self { + Inbound => "inbound", + Outbound => "outbound", + } + } +} + +impl std::str::FromStr for SetupIntentFlowDirections { + type Err = (); + fn from_str(s: &str) -> Result { + use SetupIntentFlowDirections::*; + match s { + "inbound" => Ok(Inbound), + "outbound" => Ok(Outbound), + _ => Err(()), + } + } +} +impl std::fmt::Display for SetupIntentFlowDirections { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for SetupIntentFlowDirections { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for SetupIntentFlowDirections { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for SetupIntentFlowDirections { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s) + .map_err(|_| serde::de::Error::custom("Unknown value for SetupIntentFlowDirections")) + } +} diff --git a/generated/stripe_shared/src/setup_intent_next_action.rs b/generated/stripe_shared/src/setup_intent_next_action.rs new file mode 100644 index 000000000..896115660 --- /dev/null +++ b/generated/stripe_shared/src/setup_intent_next_action.rs @@ -0,0 +1,18 @@ +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct SetupIntentNextAction { + #[serde(skip_serializing_if = "Option::is_none")] + pub cashapp_handle_redirect_or_display_qr_code: + Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub redirect_to_url: Option, + /// Type of the next action to perform, one of `redirect_to_url`, `use_stripe_sdk`, `alipay_handle_redirect`, `oxxo_display_details`, or `verify_with_microdeposits`. + #[serde(rename = "type")] + pub type_: String, + /// When confirming a SetupIntent with Stripe.js, Stripe.js depends on the contents of this dictionary to invoke authentication flows. + /// The shape of the contents is subject to change and is only intended to be used by Stripe.js. + #[serde(skip_serializing_if = "Option::is_none")] + pub use_stripe_sdk: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub verify_with_microdeposits: + Option, +} diff --git a/generated/stripe_shared/src/setup_intent_next_action_redirect_to_url.rs b/generated/stripe_shared/src/setup_intent_next_action_redirect_to_url.rs new file mode 100644 index 000000000..c999292b4 --- /dev/null +++ b/generated/stripe_shared/src/setup_intent_next_action_redirect_to_url.rs @@ -0,0 +1,7 @@ +#[derive(Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct SetupIntentNextActionRedirectToUrl { + /// If the customer does not exit their browser while authenticating, they will be redirected to this specified URL after completion. + pub return_url: Option, + /// The URL you must redirect your customer to in order to authenticate. + pub url: Option, +} diff --git a/generated/stripe_shared/src/setup_intent_next_action_verify_with_microdeposits.rs b/generated/stripe_shared/src/setup_intent_next_action_verify_with_microdeposits.rs new file mode 100644 index 000000000..5bdda8ebb --- /dev/null +++ b/generated/stripe_shared/src/setup_intent_next_action_verify_with_microdeposits.rs @@ -0,0 +1,68 @@ +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct SetupIntentNextActionVerifyWithMicrodeposits { + /// The timestamp when the microdeposits are expected to land. + pub arrival_date: stripe_types::Timestamp, + /// The URL for the hosted verification page, which allows customers to verify their bank account. + pub hosted_verification_url: String, + /// The type of the microdeposit sent to the customer. + /// Used to distinguish between different verification methods. + pub microdeposit_type: Option, +} +/// The type of the microdeposit sent to the customer. +/// Used to distinguish between different verification methods. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum SetupIntentNextActionVerifyWithMicrodepositsMicrodepositType { + Amounts, + DescriptorCode, +} +impl SetupIntentNextActionVerifyWithMicrodepositsMicrodepositType { + pub fn as_str(self) -> &'static str { + use SetupIntentNextActionVerifyWithMicrodepositsMicrodepositType::*; + match self { + Amounts => "amounts", + DescriptorCode => "descriptor_code", + } + } +} + +impl std::str::FromStr for SetupIntentNextActionVerifyWithMicrodepositsMicrodepositType { + type Err = (); + fn from_str(s: &str) -> Result { + use SetupIntentNextActionVerifyWithMicrodepositsMicrodepositType::*; + match s { + "amounts" => Ok(Amounts), + "descriptor_code" => Ok(DescriptorCode), + _ => Err(()), + } + } +} +impl std::fmt::Display for SetupIntentNextActionVerifyWithMicrodepositsMicrodepositType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for SetupIntentNextActionVerifyWithMicrodepositsMicrodepositType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for SetupIntentNextActionVerifyWithMicrodepositsMicrodepositType { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for SetupIntentNextActionVerifyWithMicrodepositsMicrodepositType { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| { + serde::de::Error::custom( + "Unknown value for SetupIntentNextActionVerifyWithMicrodepositsMicrodepositType", + ) + }) + } +} diff --git a/generated/stripe_shared/src/setup_intent_payment_method_options.rs b/generated/stripe_shared/src/setup_intent_payment_method_options.rs new file mode 100644 index 000000000..69f9c634e --- /dev/null +++ b/generated/stripe_shared/src/setup_intent_payment_method_options.rs @@ -0,0 +1,15 @@ +#[derive(Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct SetupIntentPaymentMethodOptions { + #[serde(skip_serializing_if = "Option::is_none")] + pub acss_debit: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub card: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub link: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub paypal: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub sepa_debit: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub us_bank_account: Option, +} diff --git a/generated/stripe_shared/src/setup_intent_payment_method_options_acss_debit.rs b/generated/stripe_shared/src/setup_intent_payment_method_options_acss_debit.rs new file mode 100644 index 000000000..2bce40999 --- /dev/null +++ b/generated/stripe_shared/src/setup_intent_payment_method_options_acss_debit.rs @@ -0,0 +1,128 @@ +#[derive(Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct SetupIntentPaymentMethodOptionsAcssDebit { + /// Currency supported by the bank account + pub currency: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub mandate_options: + Option, + /// Bank account verification method. + #[serde(skip_serializing_if = "Option::is_none")] + pub verification_method: Option, +} +/// Currency supported by the bank account +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum SetupIntentPaymentMethodOptionsAcssDebitCurrency { + Cad, + Usd, +} +impl SetupIntentPaymentMethodOptionsAcssDebitCurrency { + pub fn as_str(self) -> &'static str { + use SetupIntentPaymentMethodOptionsAcssDebitCurrency::*; + match self { + Cad => "cad", + Usd => "usd", + } + } +} + +impl std::str::FromStr for SetupIntentPaymentMethodOptionsAcssDebitCurrency { + type Err = (); + fn from_str(s: &str) -> Result { + use SetupIntentPaymentMethodOptionsAcssDebitCurrency::*; + match s { + "cad" => Ok(Cad), + "usd" => Ok(Usd), + _ => Err(()), + } + } +} +impl std::fmt::Display for SetupIntentPaymentMethodOptionsAcssDebitCurrency { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for SetupIntentPaymentMethodOptionsAcssDebitCurrency { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for SetupIntentPaymentMethodOptionsAcssDebitCurrency { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for SetupIntentPaymentMethodOptionsAcssDebitCurrency { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| { + serde::de::Error::custom( + "Unknown value for SetupIntentPaymentMethodOptionsAcssDebitCurrency", + ) + }) + } +} +/// Bank account verification method. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum SetupIntentPaymentMethodOptionsAcssDebitVerificationMethod { + Automatic, + Instant, + Microdeposits, +} +impl SetupIntentPaymentMethodOptionsAcssDebitVerificationMethod { + pub fn as_str(self) -> &'static str { + use SetupIntentPaymentMethodOptionsAcssDebitVerificationMethod::*; + match self { + Automatic => "automatic", + Instant => "instant", + Microdeposits => "microdeposits", + } + } +} + +impl std::str::FromStr for SetupIntentPaymentMethodOptionsAcssDebitVerificationMethod { + type Err = (); + fn from_str(s: &str) -> Result { + use SetupIntentPaymentMethodOptionsAcssDebitVerificationMethod::*; + match s { + "automatic" => Ok(Automatic), + "instant" => Ok(Instant), + "microdeposits" => Ok(Microdeposits), + _ => Err(()), + } + } +} +impl std::fmt::Display for SetupIntentPaymentMethodOptionsAcssDebitVerificationMethod { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for SetupIntentPaymentMethodOptionsAcssDebitVerificationMethod { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for SetupIntentPaymentMethodOptionsAcssDebitVerificationMethod { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for SetupIntentPaymentMethodOptionsAcssDebitVerificationMethod { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| { + serde::de::Error::custom( + "Unknown value for SetupIntentPaymentMethodOptionsAcssDebitVerificationMethod", + ) + }) + } +} diff --git a/generated/stripe_shared/src/setup_intent_payment_method_options_card.rs b/generated/stripe_shared/src/setup_intent_payment_method_options_card.rs new file mode 100644 index 000000000..189f64e33 --- /dev/null +++ b/generated/stripe_shared/src/setup_intent_payment_method_options_card.rs @@ -0,0 +1,161 @@ +#[derive(Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct SetupIntentPaymentMethodOptionsCard { + /// Configuration options for setting up an eMandate for cards issued in India. + pub mandate_options: Option, + /// Selected network to process this SetupIntent on. + /// Depends on the available networks of the card attached to the setup intent. + /// Can be only set confirm-time. + pub network: Option, + /// We strongly recommend that you rely on our SCA Engine to automatically prompt your customers for authentication based on risk level and [other requirements](https://stripe.com/docs/strong-customer-authentication). + /// However, if you wish to request 3D Secure based on logic from your own fraud engine, provide this option. + /// If not provided, this value defaults to `automatic`. + /// Read our guide on [manually requesting 3D Secure](https://stripe.com/docs/payments/3d-secure#manual-three-ds) for more information on how this configuration interacts with Radar and our SCA Engine. + pub request_three_d_secure: Option, +} +/// Selected network to process this SetupIntent on. +/// Depends on the available networks of the card attached to the setup intent. +/// Can be only set confirm-time. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum SetupIntentPaymentMethodOptionsCardNetwork { + Amex, + CartesBancaires, + Diners, + Discover, + EftposAu, + Interac, + Jcb, + Mastercard, + Unionpay, + Unknown, + Visa, +} +impl SetupIntentPaymentMethodOptionsCardNetwork { + pub fn as_str(self) -> &'static str { + use SetupIntentPaymentMethodOptionsCardNetwork::*; + match self { + Amex => "amex", + CartesBancaires => "cartes_bancaires", + Diners => "diners", + Discover => "discover", + EftposAu => "eftpos_au", + Interac => "interac", + Jcb => "jcb", + Mastercard => "mastercard", + Unionpay => "unionpay", + Unknown => "unknown", + Visa => "visa", + } + } +} + +impl std::str::FromStr for SetupIntentPaymentMethodOptionsCardNetwork { + type Err = (); + fn from_str(s: &str) -> Result { + use SetupIntentPaymentMethodOptionsCardNetwork::*; + match s { + "amex" => Ok(Amex), + "cartes_bancaires" => Ok(CartesBancaires), + "diners" => Ok(Diners), + "discover" => Ok(Discover), + "eftpos_au" => Ok(EftposAu), + "interac" => Ok(Interac), + "jcb" => Ok(Jcb), + "mastercard" => Ok(Mastercard), + "unionpay" => Ok(Unionpay), + "unknown" => Ok(Unknown), + "visa" => Ok(Visa), + _ => Err(()), + } + } +} +impl std::fmt::Display for SetupIntentPaymentMethodOptionsCardNetwork { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for SetupIntentPaymentMethodOptionsCardNetwork { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for SetupIntentPaymentMethodOptionsCardNetwork { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for SetupIntentPaymentMethodOptionsCardNetwork { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| { + serde::de::Error::custom("Unknown value for SetupIntentPaymentMethodOptionsCardNetwork") + }) + } +} +/// We strongly recommend that you rely on our SCA Engine to automatically prompt your customers for authentication based on risk level and [other requirements](https://stripe.com/docs/strong-customer-authentication). +/// However, if you wish to request 3D Secure based on logic from your own fraud engine, provide this option. +/// If not provided, this value defaults to `automatic`. +/// Read our guide on [manually requesting 3D Secure](https://stripe.com/docs/payments/3d-secure#manual-three-ds) for more information on how this configuration interacts with Radar and our SCA Engine. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum SetupIntentPaymentMethodOptionsCardRequestThreeDSecure { + Any, + Automatic, + Challenge, +} +impl SetupIntentPaymentMethodOptionsCardRequestThreeDSecure { + pub fn as_str(self) -> &'static str { + use SetupIntentPaymentMethodOptionsCardRequestThreeDSecure::*; + match self { + Any => "any", + Automatic => "automatic", + Challenge => "challenge", + } + } +} + +impl std::str::FromStr for SetupIntentPaymentMethodOptionsCardRequestThreeDSecure { + type Err = (); + fn from_str(s: &str) -> Result { + use SetupIntentPaymentMethodOptionsCardRequestThreeDSecure::*; + match s { + "any" => Ok(Any), + "automatic" => Ok(Automatic), + "challenge" => Ok(Challenge), + _ => Err(()), + } + } +} +impl std::fmt::Display for SetupIntentPaymentMethodOptionsCardRequestThreeDSecure { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for SetupIntentPaymentMethodOptionsCardRequestThreeDSecure { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for SetupIntentPaymentMethodOptionsCardRequestThreeDSecure { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for SetupIntentPaymentMethodOptionsCardRequestThreeDSecure { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| { + serde::de::Error::custom( + "Unknown value for SetupIntentPaymentMethodOptionsCardRequestThreeDSecure", + ) + }) + } +} diff --git a/generated/stripe_shared/src/setup_intent_payment_method_options_card_mandate_options.rs b/generated/stripe_shared/src/setup_intent_payment_method_options_card_mandate_options.rs new file mode 100644 index 000000000..db15e4d82 --- /dev/null +++ b/generated/stripe_shared/src/setup_intent_payment_method_options_card_mandate_options.rs @@ -0,0 +1,213 @@ +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct SetupIntentPaymentMethodOptionsCardMandateOptions { + /// Amount to be charged for future payments. + pub amount: i64, + /// One of `fixed` or `maximum`. + /// If `fixed`, the `amount` param refers to the exact amount to be charged in future payments. + /// If `maximum`, the amount charged can be up to the value passed for the `amount` param. + pub amount_type: SetupIntentPaymentMethodOptionsCardMandateOptionsAmountType, + /// Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. + /// Must be a [supported currency](https://stripe.com/docs/currencies). + pub currency: stripe_types::Currency, + /// A description of the mandate or subscription that is meant to be displayed to the customer. + pub description: Option, + /// End date of the mandate or subscription. + /// If not provided, the mandate will be active until canceled. + /// If provided, end date should be after start date. + pub end_date: Option, + /// Specifies payment frequency. One of `day`, `week`, `month`, `year`, or `sporadic`. + pub interval: SetupIntentPaymentMethodOptionsCardMandateOptionsInterval, + /// The number of intervals between payments. + /// For example, `interval=month` and `interval_count=3` indicates one payment every three months. + /// Maximum of one year interval allowed (1 year, 12 months, or 52 weeks). + /// This parameter is optional when `interval=sporadic`. + pub interval_count: Option, + /// Unique identifier for the mandate or subscription. + pub reference: String, + /// Start date of the mandate or subscription. Start date should not be lesser than yesterday. + pub start_date: stripe_types::Timestamp, + /// Specifies the type of mandates supported. Possible values are `india`. + pub supported_types: + Option>, +} +/// One of `fixed` or `maximum`. +/// If `fixed`, the `amount` param refers to the exact amount to be charged in future payments. +/// If `maximum`, the amount charged can be up to the value passed for the `amount` param. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum SetupIntentPaymentMethodOptionsCardMandateOptionsAmountType { + Fixed, + Maximum, +} +impl SetupIntentPaymentMethodOptionsCardMandateOptionsAmountType { + pub fn as_str(self) -> &'static str { + use SetupIntentPaymentMethodOptionsCardMandateOptionsAmountType::*; + match self { + Fixed => "fixed", + Maximum => "maximum", + } + } +} + +impl std::str::FromStr for SetupIntentPaymentMethodOptionsCardMandateOptionsAmountType { + type Err = (); + fn from_str(s: &str) -> Result { + use SetupIntentPaymentMethodOptionsCardMandateOptionsAmountType::*; + match s { + "fixed" => Ok(Fixed), + "maximum" => Ok(Maximum), + _ => Err(()), + } + } +} +impl std::fmt::Display for SetupIntentPaymentMethodOptionsCardMandateOptionsAmountType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for SetupIntentPaymentMethodOptionsCardMandateOptionsAmountType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for SetupIntentPaymentMethodOptionsCardMandateOptionsAmountType { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for SetupIntentPaymentMethodOptionsCardMandateOptionsAmountType { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| { + serde::de::Error::custom( + "Unknown value for SetupIntentPaymentMethodOptionsCardMandateOptionsAmountType", + ) + }) + } +} +/// Specifies payment frequency. One of `day`, `week`, `month`, `year`, or `sporadic`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum SetupIntentPaymentMethodOptionsCardMandateOptionsInterval { + Day, + Month, + Sporadic, + Week, + Year, +} +impl SetupIntentPaymentMethodOptionsCardMandateOptionsInterval { + pub fn as_str(self) -> &'static str { + use SetupIntentPaymentMethodOptionsCardMandateOptionsInterval::*; + match self { + Day => "day", + Month => "month", + Sporadic => "sporadic", + Week => "week", + Year => "year", + } + } +} + +impl std::str::FromStr for SetupIntentPaymentMethodOptionsCardMandateOptionsInterval { + type Err = (); + fn from_str(s: &str) -> Result { + use SetupIntentPaymentMethodOptionsCardMandateOptionsInterval::*; + match s { + "day" => Ok(Day), + "month" => Ok(Month), + "sporadic" => Ok(Sporadic), + "week" => Ok(Week), + "year" => Ok(Year), + _ => Err(()), + } + } +} +impl std::fmt::Display for SetupIntentPaymentMethodOptionsCardMandateOptionsInterval { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for SetupIntentPaymentMethodOptionsCardMandateOptionsInterval { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for SetupIntentPaymentMethodOptionsCardMandateOptionsInterval { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for SetupIntentPaymentMethodOptionsCardMandateOptionsInterval { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| { + serde::de::Error::custom( + "Unknown value for SetupIntentPaymentMethodOptionsCardMandateOptionsInterval", + ) + }) + } +} +/// Specifies the type of mandates supported. Possible values are `india`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum SetupIntentPaymentMethodOptionsCardMandateOptionsSupportedTypes { + India, +} +impl SetupIntentPaymentMethodOptionsCardMandateOptionsSupportedTypes { + pub fn as_str(self) -> &'static str { + use SetupIntentPaymentMethodOptionsCardMandateOptionsSupportedTypes::*; + match self { + India => "india", + } + } +} + +impl std::str::FromStr for SetupIntentPaymentMethodOptionsCardMandateOptionsSupportedTypes { + type Err = (); + fn from_str(s: &str) -> Result { + use SetupIntentPaymentMethodOptionsCardMandateOptionsSupportedTypes::*; + match s { + "india" => Ok(India), + _ => Err(()), + } + } +} +impl std::fmt::Display for SetupIntentPaymentMethodOptionsCardMandateOptionsSupportedTypes { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for SetupIntentPaymentMethodOptionsCardMandateOptionsSupportedTypes { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for SetupIntentPaymentMethodOptionsCardMandateOptionsSupportedTypes { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> + for SetupIntentPaymentMethodOptionsCardMandateOptionsSupportedTypes +{ + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| { + serde::de::Error::custom( + "Unknown value for SetupIntentPaymentMethodOptionsCardMandateOptionsSupportedTypes", + ) + }) + } +} diff --git a/generated/stripe_shared/src/setup_intent_payment_method_options_link.rs b/generated/stripe_shared/src/setup_intent_payment_method_options_link.rs new file mode 100644 index 000000000..752428286 --- /dev/null +++ b/generated/stripe_shared/src/setup_intent_payment_method_options_link.rs @@ -0,0 +1,5 @@ +#[derive(Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct SetupIntentPaymentMethodOptionsLink { + /// \[Deprecated\] This is a legacy parameter that no longer has any function. + pub persistent_token: Option, +} diff --git a/generated/stripe_shared/src/setup_intent_payment_method_options_mandate_options_acss_debit.rs b/generated/stripe_shared/src/setup_intent_payment_method_options_mandate_options_acss_debit.rs new file mode 100644 index 000000000..76f39b13e --- /dev/null +++ b/generated/stripe_shared/src/setup_intent_payment_method_options_mandate_options_acss_debit.rs @@ -0,0 +1,186 @@ +#[derive(Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct SetupIntentPaymentMethodOptionsMandateOptionsAcssDebit { + /// A URL for custom mandate text + #[serde(skip_serializing_if = "Option::is_none")] + pub custom_mandate_url: Option, + /// List of Stripe products where this mandate can be selected automatically. + #[serde(skip_serializing_if = "Option::is_none")] + pub default_for: Option>, + /// Description of the interval. + /// Only required if the 'payment_schedule' parameter is 'interval' or 'combined'. + pub interval_description: Option, + /// Payment schedule for the mandate. + pub payment_schedule: + Option, + /// Transaction type of the mandate. + pub transaction_type: + Option, +} +/// List of Stripe products where this mandate can be selected automatically. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum SetupIntentPaymentMethodOptionsMandateOptionsAcssDebitDefaultFor { + Invoice, + Subscription, +} +impl SetupIntentPaymentMethodOptionsMandateOptionsAcssDebitDefaultFor { + pub fn as_str(self) -> &'static str { + use SetupIntentPaymentMethodOptionsMandateOptionsAcssDebitDefaultFor::*; + match self { + Invoice => "invoice", + Subscription => "subscription", + } + } +} + +impl std::str::FromStr for SetupIntentPaymentMethodOptionsMandateOptionsAcssDebitDefaultFor { + type Err = (); + fn from_str(s: &str) -> Result { + use SetupIntentPaymentMethodOptionsMandateOptionsAcssDebitDefaultFor::*; + match s { + "invoice" => Ok(Invoice), + "subscription" => Ok(Subscription), + _ => Err(()), + } + } +} +impl std::fmt::Display for SetupIntentPaymentMethodOptionsMandateOptionsAcssDebitDefaultFor { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for SetupIntentPaymentMethodOptionsMandateOptionsAcssDebitDefaultFor { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for SetupIntentPaymentMethodOptionsMandateOptionsAcssDebitDefaultFor { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> + for SetupIntentPaymentMethodOptionsMandateOptionsAcssDebitDefaultFor +{ + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for SetupIntentPaymentMethodOptionsMandateOptionsAcssDebitDefaultFor")) + } +} +/// Payment schedule for the mandate. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum SetupIntentPaymentMethodOptionsMandateOptionsAcssDebitPaymentSchedule { + Combined, + Interval, + Sporadic, +} +impl SetupIntentPaymentMethodOptionsMandateOptionsAcssDebitPaymentSchedule { + pub fn as_str(self) -> &'static str { + use SetupIntentPaymentMethodOptionsMandateOptionsAcssDebitPaymentSchedule::*; + match self { + Combined => "combined", + Interval => "interval", + Sporadic => "sporadic", + } + } +} + +impl std::str::FromStr for SetupIntentPaymentMethodOptionsMandateOptionsAcssDebitPaymentSchedule { + type Err = (); + fn from_str(s: &str) -> Result { + use SetupIntentPaymentMethodOptionsMandateOptionsAcssDebitPaymentSchedule::*; + match s { + "combined" => Ok(Combined), + "interval" => Ok(Interval), + "sporadic" => Ok(Sporadic), + _ => Err(()), + } + } +} +impl std::fmt::Display for SetupIntentPaymentMethodOptionsMandateOptionsAcssDebitPaymentSchedule { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for SetupIntentPaymentMethodOptionsMandateOptionsAcssDebitPaymentSchedule { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for SetupIntentPaymentMethodOptionsMandateOptionsAcssDebitPaymentSchedule { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> + for SetupIntentPaymentMethodOptionsMandateOptionsAcssDebitPaymentSchedule +{ + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for SetupIntentPaymentMethodOptionsMandateOptionsAcssDebitPaymentSchedule")) + } +} +/// Transaction type of the mandate. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum SetupIntentPaymentMethodOptionsMandateOptionsAcssDebitTransactionType { + Business, + Personal, +} +impl SetupIntentPaymentMethodOptionsMandateOptionsAcssDebitTransactionType { + pub fn as_str(self) -> &'static str { + use SetupIntentPaymentMethodOptionsMandateOptionsAcssDebitTransactionType::*; + match self { + Business => "business", + Personal => "personal", + } + } +} + +impl std::str::FromStr for SetupIntentPaymentMethodOptionsMandateOptionsAcssDebitTransactionType { + type Err = (); + fn from_str(s: &str) -> Result { + use SetupIntentPaymentMethodOptionsMandateOptionsAcssDebitTransactionType::*; + match s { + "business" => Ok(Business), + "personal" => Ok(Personal), + _ => Err(()), + } + } +} +impl std::fmt::Display for SetupIntentPaymentMethodOptionsMandateOptionsAcssDebitTransactionType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for SetupIntentPaymentMethodOptionsMandateOptionsAcssDebitTransactionType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for SetupIntentPaymentMethodOptionsMandateOptionsAcssDebitTransactionType { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> + for SetupIntentPaymentMethodOptionsMandateOptionsAcssDebitTransactionType +{ + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for SetupIntentPaymentMethodOptionsMandateOptionsAcssDebitTransactionType")) + } +} diff --git a/generated/stripe_shared/src/setup_intent_payment_method_options_mandate_options_sepa_debit.rs b/generated/stripe_shared/src/setup_intent_payment_method_options_mandate_options_sepa_debit.rs new file mode 100644 index 000000000..810fb8543 --- /dev/null +++ b/generated/stripe_shared/src/setup_intent_payment_method_options_mandate_options_sepa_debit.rs @@ -0,0 +1,2 @@ +#[derive(Copy, Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct SetupIntentPaymentMethodOptionsMandateOptionsSepaDebit {} diff --git a/generated/stripe_shared/src/setup_intent_payment_method_options_paypal.rs b/generated/stripe_shared/src/setup_intent_payment_method_options_paypal.rs new file mode 100644 index 000000000..359203a15 --- /dev/null +++ b/generated/stripe_shared/src/setup_intent_payment_method_options_paypal.rs @@ -0,0 +1,6 @@ +#[derive(Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct SetupIntentPaymentMethodOptionsPaypal { + /// The PayPal Billing Agreement ID (BAID). + /// This is an ID generated by PayPal which represents the mandate between the merchant and the customer. + pub billing_agreement_id: Option, +} diff --git a/generated/stripe_shared/src/setup_intent_payment_method_options_sepa_debit.rs b/generated/stripe_shared/src/setup_intent_payment_method_options_sepa_debit.rs new file mode 100644 index 000000000..57fb0d3e5 --- /dev/null +++ b/generated/stripe_shared/src/setup_intent_payment_method_options_sepa_debit.rs @@ -0,0 +1,6 @@ +#[derive(Copy, Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct SetupIntentPaymentMethodOptionsSepaDebit { + #[serde(skip_serializing_if = "Option::is_none")] + pub mandate_options: + Option, +} diff --git a/generated/stripe_shared/src/setup_intent_payment_method_options_us_bank_account.rs b/generated/stripe_shared/src/setup_intent_payment_method_options_us_bank_account.rs new file mode 100644 index 000000000..da3226828 --- /dev/null +++ b/generated/stripe_shared/src/setup_intent_payment_method_options_us_bank_account.rs @@ -0,0 +1,72 @@ +#[derive(Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct SetupIntentPaymentMethodOptionsUsBankAccount { + #[serde(skip_serializing_if = "Option::is_none")] + pub financial_connections: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub mandate_options: Option, + /// Bank account verification method. + #[serde(skip_serializing_if = "Option::is_none")] + pub verification_method: Option, +} +/// Bank account verification method. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum SetupIntentPaymentMethodOptionsUsBankAccountVerificationMethod { + Automatic, + Instant, + Microdeposits, +} +impl SetupIntentPaymentMethodOptionsUsBankAccountVerificationMethod { + pub fn as_str(self) -> &'static str { + use SetupIntentPaymentMethodOptionsUsBankAccountVerificationMethod::*; + match self { + Automatic => "automatic", + Instant => "instant", + Microdeposits => "microdeposits", + } + } +} + +impl std::str::FromStr for SetupIntentPaymentMethodOptionsUsBankAccountVerificationMethod { + type Err = (); + fn from_str(s: &str) -> Result { + use SetupIntentPaymentMethodOptionsUsBankAccountVerificationMethod::*; + match s { + "automatic" => Ok(Automatic), + "instant" => Ok(Instant), + "microdeposits" => Ok(Microdeposits), + _ => Err(()), + } + } +} +impl std::fmt::Display for SetupIntentPaymentMethodOptionsUsBankAccountVerificationMethod { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for SetupIntentPaymentMethodOptionsUsBankAccountVerificationMethod { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for SetupIntentPaymentMethodOptionsUsBankAccountVerificationMethod { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> + for SetupIntentPaymentMethodOptionsUsBankAccountVerificationMethod +{ + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| { + serde::de::Error::custom( + "Unknown value for SetupIntentPaymentMethodOptionsUsBankAccountVerificationMethod", + ) + }) + } +} diff --git a/src/resources/generated/shipping.rs b/generated/stripe_shared/src/shipping.rs similarity index 69% rename from src/resources/generated/shipping.rs rename to generated/stripe_shared/src/shipping.rs index 37ec84939..4599cf4a5 100644 --- a/src/resources/generated/shipping.rs +++ b/generated/stripe_shared/src/shipping.rs @@ -1,31 +1,17 @@ -// ====================================== -// This file was automatically generated. -// ====================================== - -use serde::{Deserialize, Serialize}; - -use crate::resources::Address; - -/// The resource representing a Stripe "Shipping". -#[derive(Clone, Debug, Default, Deserialize, Serialize)] +#[derive(Clone, Debug, Default, serde::Serialize, serde::Deserialize)] pub struct Shipping { #[serde(skip_serializing_if = "Option::is_none")] - pub address: Option
, - + pub address: Option, /// The delivery service that shipped a physical product, such as Fedex, UPS, USPS, etc. #[serde(skip_serializing_if = "Option::is_none")] pub carrier: Option, - /// Recipient name. #[serde(skip_serializing_if = "Option::is_none")] pub name: Option, - /// Recipient phone (including extension). #[serde(skip_serializing_if = "Option::is_none")] pub phone: Option, - /// The tracking number for a physical product, obtained from the delivery service. - /// /// If multiple tracking numbers were generated for this purchase, please separate them with commas. #[serde(skip_serializing_if = "Option::is_none")] pub tracking_number: Option, diff --git a/generated/stripe_shared/src/shipping_rate.rs b/generated/stripe_shared/src/shipping_rate.rs new file mode 100644 index 000000000..b11603669 --- /dev/null +++ b/generated/stripe_shared/src/shipping_rate.rs @@ -0,0 +1,149 @@ +/// Shipping rates describe the price of shipping presented to your customers and +/// applied to a purchase. +/// For more information, see [Charge for shipping](https://stripe.com/docs/payments/during-payment/charge-shipping). +/// +/// For more details see <>. +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct ShippingRate { + /// Whether the shipping rate can be used for new purchases. Defaults to `true`. + pub active: bool, + /// Time at which the object was created. Measured in seconds since the Unix epoch. + pub created: stripe_types::Timestamp, + /// The estimated range for how long shipping will take, meant to be displayable to the customer. + /// This will appear on CheckoutSessions. + pub delivery_estimate: Option, + /// The name of the shipping rate, meant to be displayable to the customer. + /// This will appear on CheckoutSessions. + pub display_name: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub fixed_amount: Option, + /// Unique identifier for the object. + pub id: stripe_shared::ShippingRateId, + /// Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + pub livemode: bool, + /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. + /// This can be useful for storing additional information about the object in a structured format. + pub metadata: std::collections::HashMap, + /// Specifies whether the rate is considered inclusive of taxes or exclusive of taxes. + /// One of `inclusive`, `exclusive`, or `unspecified`. + pub tax_behavior: Option, + /// A [tax code](https://stripe.com/docs/tax/tax-categories) ID. + /// The Shipping tax code is `txcd_92010001`. + pub tax_code: Option>, + /// The type of calculation to use on the shipping rate. Can only be `fixed_amount` for now. + #[serde(rename = "type")] + pub type_: stripe_shared::ShippingRateType, +} +impl stripe_types::Object for ShippingRate { + type Id = stripe_shared::ShippingRateId; + fn id(&self) -> &Self::Id { + &self.id + } +} +stripe_types::def_id!(ShippingRateId, "shr_"); +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum ShippingRateTaxBehavior { + Exclusive, + Inclusive, + Unspecified, +} +impl ShippingRateTaxBehavior { + pub fn as_str(self) -> &'static str { + use ShippingRateTaxBehavior::*; + match self { + Exclusive => "exclusive", + Inclusive => "inclusive", + Unspecified => "unspecified", + } + } +} + +impl std::str::FromStr for ShippingRateTaxBehavior { + type Err = (); + fn from_str(s: &str) -> Result { + use ShippingRateTaxBehavior::*; + match s { + "exclusive" => Ok(Exclusive), + "inclusive" => Ok(Inclusive), + "unspecified" => Ok(Unspecified), + _ => Err(()), + } + } +} +impl std::fmt::Display for ShippingRateTaxBehavior { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for ShippingRateTaxBehavior { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for ShippingRateTaxBehavior { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for ShippingRateTaxBehavior { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s) + .map_err(|_| serde::de::Error::custom("Unknown value for ShippingRateTaxBehavior")) + } +} +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum ShippingRateType { + FixedAmount, +} +impl ShippingRateType { + pub fn as_str(self) -> &'static str { + use ShippingRateType::*; + match self { + FixedAmount => "fixed_amount", + } + } +} + +impl std::str::FromStr for ShippingRateType { + type Err = (); + fn from_str(s: &str) -> Result { + use ShippingRateType::*; + match s { + "fixed_amount" => Ok(FixedAmount), + _ => Err(()), + } + } +} +impl std::fmt::Display for ShippingRateType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for ShippingRateType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for ShippingRateType { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for ShippingRateType { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s) + .map_err(|_| serde::de::Error::custom("Unknown value for ShippingRateType")) + } +} diff --git a/generated/stripe_shared/src/shipping_rate_currency_option.rs b/generated/stripe_shared/src/shipping_rate_currency_option.rs new file mode 100644 index 000000000..a1fcafacd --- /dev/null +++ b/generated/stripe_shared/src/shipping_rate_currency_option.rs @@ -0,0 +1,67 @@ +#[derive(Copy, Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct ShippingRateCurrencyOption { + /// A non-negative integer in cents representing how much to charge. + pub amount: i64, + /// Specifies whether the rate is considered inclusive of taxes or exclusive of taxes. + /// One of `inclusive`, `exclusive`, or `unspecified`. + pub tax_behavior: ShippingRateCurrencyOptionTaxBehavior, +} +/// Specifies whether the rate is considered inclusive of taxes or exclusive of taxes. +/// One of `inclusive`, `exclusive`, or `unspecified`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum ShippingRateCurrencyOptionTaxBehavior { + Exclusive, + Inclusive, + Unspecified, +} +impl ShippingRateCurrencyOptionTaxBehavior { + pub fn as_str(self) -> &'static str { + use ShippingRateCurrencyOptionTaxBehavior::*; + match self { + Exclusive => "exclusive", + Inclusive => "inclusive", + Unspecified => "unspecified", + } + } +} + +impl std::str::FromStr for ShippingRateCurrencyOptionTaxBehavior { + type Err = (); + fn from_str(s: &str) -> Result { + use ShippingRateCurrencyOptionTaxBehavior::*; + match s { + "exclusive" => Ok(Exclusive), + "inclusive" => Ok(Inclusive), + "unspecified" => Ok(Unspecified), + _ => Err(()), + } + } +} +impl std::fmt::Display for ShippingRateCurrencyOptionTaxBehavior { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for ShippingRateCurrencyOptionTaxBehavior { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for ShippingRateCurrencyOptionTaxBehavior { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for ShippingRateCurrencyOptionTaxBehavior { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| { + serde::de::Error::custom("Unknown value for ShippingRateCurrencyOptionTaxBehavior") + }) + } +} diff --git a/generated/stripe_shared/src/shipping_rate_delivery_estimate.rs b/generated/stripe_shared/src/shipping_rate_delivery_estimate.rs new file mode 100644 index 000000000..16875264f --- /dev/null +++ b/generated/stripe_shared/src/shipping_rate_delivery_estimate.rs @@ -0,0 +1,7 @@ +#[derive(Copy, Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct ShippingRateDeliveryEstimate { + /// The upper bound of the estimated range. If empty, represents no upper bound i.e., infinite. + pub maximum: Option, + /// The lower bound of the estimated range. If empty, represents no lower bound. + pub minimum: Option, +} diff --git a/generated/stripe_shared/src/shipping_rate_delivery_estimate_bound.rs b/generated/stripe_shared/src/shipping_rate_delivery_estimate_bound.rs new file mode 100644 index 000000000..87372926b --- /dev/null +++ b/generated/stripe_shared/src/shipping_rate_delivery_estimate_bound.rs @@ -0,0 +1,71 @@ +#[derive(Copy, Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct ShippingRateDeliveryEstimateBound { + /// A unit of time. + pub unit: ShippingRateDeliveryEstimateBoundUnit, + /// Must be greater than 0. + pub value: i64, +} +/// A unit of time. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum ShippingRateDeliveryEstimateBoundUnit { + BusinessDay, + Day, + Hour, + Month, + Week, +} +impl ShippingRateDeliveryEstimateBoundUnit { + pub fn as_str(self) -> &'static str { + use ShippingRateDeliveryEstimateBoundUnit::*; + match self { + BusinessDay => "business_day", + Day => "day", + Hour => "hour", + Month => "month", + Week => "week", + } + } +} + +impl std::str::FromStr for ShippingRateDeliveryEstimateBoundUnit { + type Err = (); + fn from_str(s: &str) -> Result { + use ShippingRateDeliveryEstimateBoundUnit::*; + match s { + "business_day" => Ok(BusinessDay), + "day" => Ok(Day), + "hour" => Ok(Hour), + "month" => Ok(Month), + "week" => Ok(Week), + _ => Err(()), + } + } +} +impl std::fmt::Display for ShippingRateDeliveryEstimateBoundUnit { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for ShippingRateDeliveryEstimateBoundUnit { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for ShippingRateDeliveryEstimateBoundUnit { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for ShippingRateDeliveryEstimateBoundUnit { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| { + serde::de::Error::custom("Unknown value for ShippingRateDeliveryEstimateBoundUnit") + }) + } +} diff --git a/generated/stripe_shared/src/shipping_rate_fixed_amount.rs b/generated/stripe_shared/src/shipping_rate_fixed_amount.rs new file mode 100644 index 000000000..8259a0bbf --- /dev/null +++ b/generated/stripe_shared/src/shipping_rate_fixed_amount.rs @@ -0,0 +1,17 @@ +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct ShippingRateFixedAmount { + /// A non-negative integer in cents representing how much to charge. + pub amount: i64, + /// Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. + /// Must be a [supported currency](https://stripe.com/docs/currencies). + pub currency: stripe_types::Currency, + /// Shipping rates defined in each available currency option. + /// Each key must be a three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html) and a [supported currency](https://stripe.com/docs/currencies). + #[serde(skip_serializing_if = "Option::is_none")] + pub currency_options: Option< + std::collections::HashMap< + stripe_types::Currency, + stripe_shared::ShippingRateCurrencyOption, + >, + >, +} diff --git a/generated/stripe_shared/src/source.rs b/generated/stripe_shared/src/source.rs new file mode 100644 index 000000000..e34a1fde9 --- /dev/null +++ b/generated/stripe_shared/src/source.rs @@ -0,0 +1,224 @@ +/// `Source` objects allow you to accept a variety of payment methods. They +/// represent a customer's payment instrument, and can be used with the Stripe API +/// just like a `Card` object: once chargeable, they can be charged, or can be +/// attached to customers. +/// +/// Stripe doesn't recommend using the deprecated [Sources API](https://stripe.com/docs/api/sources). +/// We recommend that you adopt the [PaymentMethods API](https://stripe.com/docs/api/payment_methods). +/// This newer API provides access to our latest features and payment method types. +/// +/// Related guides: [Sources API](https://stripe.com/docs/sources) and [Sources & Customers](https://stripe.com/docs/sources/customers). +/// +/// For more details see <>. +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct Source { + #[serde(skip_serializing_if = "Option::is_none")] + pub ach_credit_transfer: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub ach_debit: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub acss_debit: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub alipay: Option, + /// A positive integer in the smallest currency unit (that is, 100 cents for $1.00, or 1 for ¥1, Japanese Yen being a zero-decimal currency) representing the total amount associated with the source. + /// This is the amount for which the source will be chargeable once ready. + /// Required for `single_use` sources. + pub amount: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub au_becs_debit: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub bancontact: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub card: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub card_present: Option, + /// The client secret of the source. Used for client-side retrieval using a publishable key. + pub client_secret: String, + #[serde(skip_serializing_if = "Option::is_none")] + pub code_verification: Option, + /// Time at which the object was created. Measured in seconds since the Unix epoch. + pub created: stripe_types::Timestamp, + /// Three-letter [ISO code for the currency](https://stripe.com/docs/currencies) associated with the source. + /// This is the currency for which the source will be chargeable once ready. + /// Required for `single_use` sources. + pub currency: Option, + /// The ID of the customer to which this source is attached. + /// This will not be present when the source has not been attached to a customer. + #[serde(skip_serializing_if = "Option::is_none")] + pub customer: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub eps: Option, + /// The authentication `flow` of the source. + /// `flow` is one of `redirect`, `receiver`, `code_verification`, `none`. + pub flow: String, + #[serde(skip_serializing_if = "Option::is_none")] + pub giropay: Option, + /// Unique identifier for the object. + pub id: stripe_shared::SourceId, + #[serde(skip_serializing_if = "Option::is_none")] + pub ideal: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub klarna: Option, + /// Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + pub livemode: bool, + /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. + /// This can be useful for storing additional information about the object in a structured format. + pub metadata: Option>, + #[serde(skip_serializing_if = "Option::is_none")] + pub multibanco: Option, + /// Information about the owner of the payment instrument that may be used or required by particular source types. + pub owner: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub p24: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub receiver: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub redirect: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub sepa_credit_transfer: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub sepa_debit: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub sofort: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub source_order: Option, + /// Extra information about a source. + /// This will appear on your customer's statement every time you charge the source. + pub statement_descriptor: Option, + /// The status of the source, one of `canceled`, `chargeable`, `consumed`, `failed`, or `pending`. + /// Only `chargeable` sources can be used to create a charge. + pub status: String, + #[serde(skip_serializing_if = "Option::is_none")] + pub three_d_secure: Option, + /// The `type` of the source. + /// The `type` is a payment method, one of `ach_credit_transfer`, `ach_debit`, `alipay`, `bancontact`, `card`, `card_present`, `eps`, `giropay`, `ideal`, `multibanco`, `klarna`, `p24`, `sepa_debit`, `sofort`, `three_d_secure`, or `wechat`. + /// An additional hash is included on the source with a name matching this value. + /// It contains additional information specific to the [payment method](https://stripe.com/docs/sources) used. + #[serde(rename = "type")] + pub type_: SourceType, + /// Either `reusable` or `single_use`. + /// Whether this source should be reusable or not. + /// Some source types may or may not be reusable by construction, while others may leave the option at creation. + /// If an incompatible value is passed, an error will be returned. + pub usage: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub wechat: Option, +} +/// The `type` of the source. +/// The `type` is a payment method, one of `ach_credit_transfer`, `ach_debit`, `alipay`, `bancontact`, `card`, `card_present`, `eps`, `giropay`, `ideal`, `multibanco`, `klarna`, `p24`, `sepa_debit`, `sofort`, `three_d_secure`, or `wechat`. +/// An additional hash is included on the source with a name matching this value. +/// It contains additional information specific to the [payment method](https://stripe.com/docs/sources) used. +#[derive(Copy, Clone, Eq, PartialEq)] +#[non_exhaustive] +pub enum SourceType { + AchCreditTransfer, + AchDebit, + AcssDebit, + Alipay, + AuBecsDebit, + Bancontact, + Card, + CardPresent, + Eps, + Giropay, + Ideal, + Klarna, + Multibanco, + P24, + SepaCreditTransfer, + SepaDebit, + Sofort, + ThreeDSecure, + Wechat, + /// An unrecognized value from Stripe. Should not be used as a request parameter. + Unknown, +} +impl SourceType { + pub fn as_str(self) -> &'static str { + use SourceType::*; + match self { + AchCreditTransfer => "ach_credit_transfer", + AchDebit => "ach_debit", + AcssDebit => "acss_debit", + Alipay => "alipay", + AuBecsDebit => "au_becs_debit", + Bancontact => "bancontact", + Card => "card", + CardPresent => "card_present", + Eps => "eps", + Giropay => "giropay", + Ideal => "ideal", + Klarna => "klarna", + Multibanco => "multibanco", + P24 => "p24", + SepaCreditTransfer => "sepa_credit_transfer", + SepaDebit => "sepa_debit", + Sofort => "sofort", + ThreeDSecure => "three_d_secure", + Wechat => "wechat", + Unknown => "unknown", + } + } +} + +impl std::str::FromStr for SourceType { + type Err = (); + fn from_str(s: &str) -> Result { + use SourceType::*; + match s { + "ach_credit_transfer" => Ok(AchCreditTransfer), + "ach_debit" => Ok(AchDebit), + "acss_debit" => Ok(AcssDebit), + "alipay" => Ok(Alipay), + "au_becs_debit" => Ok(AuBecsDebit), + "bancontact" => Ok(Bancontact), + "card" => Ok(Card), + "card_present" => Ok(CardPresent), + "eps" => Ok(Eps), + "giropay" => Ok(Giropay), + "ideal" => Ok(Ideal), + "klarna" => Ok(Klarna), + "multibanco" => Ok(Multibanco), + "p24" => Ok(P24), + "sepa_credit_transfer" => Ok(SepaCreditTransfer), + "sepa_debit" => Ok(SepaDebit), + "sofort" => Ok(Sofort), + "three_d_secure" => Ok(ThreeDSecure), + "wechat" => Ok(Wechat), + _ => Err(()), + } + } +} +impl std::fmt::Display for SourceType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for SourceType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for SourceType { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for SourceType { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Ok(Self::from_str(&s).unwrap_or(SourceType::Unknown)) + } +} +impl stripe_types::Object for Source { + type Id = stripe_shared::SourceId; + fn id(&self) -> &Self::Id { + &self.id + } +} +stripe_types::def_id!(SourceId, "src_"); diff --git a/generated/stripe_shared/src/source_code_verification_flow.rs b/generated/stripe_shared/src/source_code_verification_flow.rs new file mode 100644 index 000000000..ebaa0cc38 --- /dev/null +++ b/generated/stripe_shared/src/source_code_verification_flow.rs @@ -0,0 +1,7 @@ +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct SourceCodeVerificationFlow { + /// The number of attempts remaining to authenticate the source object with a verification code. + pub attempts_remaining: i64, + /// The status of the code verification, either `pending` (awaiting verification, `attempts_remaining` should be greater than 0), `succeeded` (successful verification) or `failed` (failed verification, cannot be verified anymore as `attempts_remaining` should be 0). + pub status: String, +} diff --git a/generated/stripe_shared/src/source_order.rs b/generated/stripe_shared/src/source_order.rs new file mode 100644 index 000000000..8efce108e --- /dev/null +++ b/generated/stripe_shared/src/source_order.rs @@ -0,0 +1,15 @@ +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct SourceOrder { + /// A positive integer in the smallest currency unit (that is, 100 cents for $1.00, or 1 for ¥1, Japanese Yen being a zero-decimal currency) representing the total amount for the order. + pub amount: i64, + /// Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. + /// Must be a [supported currency](https://stripe.com/docs/currencies). + pub currency: stripe_types::Currency, + /// The email address of the customer placing the order. + #[serde(skip_serializing_if = "Option::is_none")] + pub email: Option, + /// List of items constituting the order. + pub items: Option>, + #[serde(skip_serializing_if = "Option::is_none")] + pub shipping: Option, +} diff --git a/generated/stripe_shared/src/source_order_item.rs b/generated/stripe_shared/src/source_order_item.rs new file mode 100644 index 000000000..fec4f886b --- /dev/null +++ b/generated/stripe_shared/src/source_order_item.rs @@ -0,0 +1,19 @@ +#[derive(Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct SourceOrderItem { + /// The amount (price) for this order item. + pub amount: Option, + /// This currency of this order item. Required when `amount` is present. + pub currency: Option, + /// Human-readable description for this order item. + pub description: Option, + /// The ID of the associated object for this line item. + /// Expandable if not null (e.g., expandable to a SKU). + pub parent: Option, + /// The quantity of this order item. + /// When type is `sku`, this is the number of instances of the SKU to be ordered. + #[serde(skip_serializing_if = "Option::is_none")] + pub quantity: Option, + /// The type of this order item. Must be `sku`, `tax`, or `shipping`. + #[serde(rename = "type")] + pub type_: Option, +} diff --git a/generated/stripe_shared/src/source_owner.rs b/generated/stripe_shared/src/source_owner.rs new file mode 100644 index 000000000..72a67ffb8 --- /dev/null +++ b/generated/stripe_shared/src/source_owner.rs @@ -0,0 +1,27 @@ +#[derive(Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct SourceOwner { + /// Owner's address. + pub address: Option, + /// Owner's email address. + pub email: Option, + /// Owner's full name. + pub name: Option, + /// Owner's phone number (including extension). + pub phone: Option, + /// Verified owner's address. + /// Verified values are verified or provided by the payment method directly (and if supported) at the time of authorization or settlement. + /// They cannot be set or mutated. + pub verified_address: Option, + /// Verified owner's email address. + /// Verified values are verified or provided by the payment method directly (and if supported) at the time of authorization or settlement. + /// They cannot be set or mutated. + pub verified_email: Option, + /// Verified owner's full name. + /// Verified values are verified or provided by the payment method directly (and if supported) at the time of authorization or settlement. + /// They cannot be set or mutated. + pub verified_name: Option, + /// Verified owner's phone number (including extension). + /// Verified values are verified or provided by the payment method directly (and if supported) at the time of authorization or settlement. + /// They cannot be set or mutated. + pub verified_phone: Option, +} diff --git a/generated/stripe_shared/src/source_receiver_flow.rs b/generated/stripe_shared/src/source_receiver_flow.rs new file mode 100644 index 000000000..d8dcdb46d --- /dev/null +++ b/generated/stripe_shared/src/source_receiver_flow.rs @@ -0,0 +1,22 @@ +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct SourceReceiverFlow { + /// The address of the receiver source. + /// This is the value that should be communicated to the customer to send their funds to. + pub address: Option, + /// The total amount that was moved to your balance. + /// This is almost always equal to the amount charged. + /// In rare cases when customers deposit excess funds and we are unable to refund those, those funds get moved to your balance and show up in amount_charged as well. + /// The amount charged is expressed in the source's currency. + pub amount_charged: i64, + /// The total amount received by the receiver source. + /// `amount_received = amount_returned + amount_charged` should be true for consumed sources unless customers deposit excess funds. + /// The amount received is expressed in the source's currency. + pub amount_received: i64, + /// The total amount that was returned to the customer. + /// The amount returned is expressed in the source's currency. + pub amount_returned: i64, + /// Type of refund attribute method, one of `email`, `manual`, or `none`. + pub refund_attributes_method: String, + /// Type of refund attribute status, one of `missing`, `requested`, or `available`. + pub refund_attributes_status: String, +} diff --git a/generated/stripe_shared/src/source_redirect_flow.rs b/generated/stripe_shared/src/source_redirect_flow.rs new file mode 100644 index 000000000..5c150985c --- /dev/null +++ b/generated/stripe_shared/src/source_redirect_flow.rs @@ -0,0 +1,12 @@ +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct SourceRedirectFlow { + /// The failure reason for the redirect, either `user_abort` (the customer aborted or dropped out of the redirect flow), `declined` (the authentication failed or the transaction was declined), or `processing_error` (the redirect failed due to a technical error). + /// Present only if the redirect status is `failed`. + pub failure_reason: Option, + /// The URL you provide to redirect the customer to after they authenticated their payment. + pub return_url: String, + /// The status of the redirect, either `pending` (ready to be used by your customer to authenticate the transaction), `succeeded` (succesful authentication, cannot be reused) or `not_required` (redirect should not be used) or `failed` (failed authentication, cannot be reused). + pub status: String, + /// The URL provided to you to redirect a customer to as part of a `redirect` authentication flow. + pub url: String, +} diff --git a/generated/stripe_shared/src/source_transaction.rs b/generated/stripe_shared/src/source_transaction.rs new file mode 100644 index 000000000..866c94771 --- /dev/null +++ b/generated/stripe_shared/src/source_transaction.rs @@ -0,0 +1,141 @@ +/// Some payment methods have no required amount that a customer must send. +/// Customers can be instructed to send any amount, and it can be made up of +/// multiple transactions. As such, sources can have multiple associated +/// transactions. +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct SourceTransaction { + #[serde(skip_serializing_if = "Option::is_none")] + pub ach_credit_transfer: Option, + /// A positive integer in the smallest currency unit (that is, 100 cents for $1.00, or 1 for ¥1, Japanese Yen being a zero-decimal currency) representing the amount your customer has pushed to the receiver. + pub amount: i64, + #[serde(skip_serializing_if = "Option::is_none")] + pub chf_credit_transfer: Option, + /// Time at which the object was created. Measured in seconds since the Unix epoch. + pub created: stripe_types::Timestamp, + /// Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. + /// Must be a [supported currency](https://stripe.com/docs/currencies). + pub currency: stripe_types::Currency, + #[serde(skip_serializing_if = "Option::is_none")] + pub gbp_credit_transfer: Option, + /// Unique identifier for the object. + pub id: stripe_shared::SourceTransactionId, + /// Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + pub livemode: bool, + #[serde(skip_serializing_if = "Option::is_none")] + pub paper_check: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub sepa_credit_transfer: Option, + /// The ID of the source this transaction is attached to. + pub source: String, + /// The status of the transaction, one of `succeeded`, `pending`, or `failed`. + pub status: String, + /// The type of source this transaction is attached to. + #[serde(rename = "type")] + pub type_: SourceTransactionType, +} +/// The type of source this transaction is attached to. +#[derive(Copy, Clone, Eq, PartialEq)] +#[non_exhaustive] +pub enum SourceTransactionType { + AchCreditTransfer, + AchDebit, + Alipay, + Bancontact, + Card, + CardPresent, + Eps, + Giropay, + Ideal, + Klarna, + Multibanco, + P24, + SepaDebit, + Sofort, + ThreeDSecure, + Wechat, + /// An unrecognized value from Stripe. Should not be used as a request parameter. + Unknown, +} +impl SourceTransactionType { + pub fn as_str(self) -> &'static str { + use SourceTransactionType::*; + match self { + AchCreditTransfer => "ach_credit_transfer", + AchDebit => "ach_debit", + Alipay => "alipay", + Bancontact => "bancontact", + Card => "card", + CardPresent => "card_present", + Eps => "eps", + Giropay => "giropay", + Ideal => "ideal", + Klarna => "klarna", + Multibanco => "multibanco", + P24 => "p24", + SepaDebit => "sepa_debit", + Sofort => "sofort", + ThreeDSecure => "three_d_secure", + Wechat => "wechat", + Unknown => "unknown", + } + } +} + +impl std::str::FromStr for SourceTransactionType { + type Err = (); + fn from_str(s: &str) -> Result { + use SourceTransactionType::*; + match s { + "ach_credit_transfer" => Ok(AchCreditTransfer), + "ach_debit" => Ok(AchDebit), + "alipay" => Ok(Alipay), + "bancontact" => Ok(Bancontact), + "card" => Ok(Card), + "card_present" => Ok(CardPresent), + "eps" => Ok(Eps), + "giropay" => Ok(Giropay), + "ideal" => Ok(Ideal), + "klarna" => Ok(Klarna), + "multibanco" => Ok(Multibanco), + "p24" => Ok(P24), + "sepa_debit" => Ok(SepaDebit), + "sofort" => Ok(Sofort), + "three_d_secure" => Ok(ThreeDSecure), + "wechat" => Ok(Wechat), + _ => Err(()), + } + } +} +impl std::fmt::Display for SourceTransactionType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for SourceTransactionType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for SourceTransactionType { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for SourceTransactionType { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Ok(Self::from_str(&s).unwrap_or(SourceTransactionType::Unknown)) + } +} +impl stripe_types::Object for SourceTransaction { + type Id = stripe_shared::SourceTransactionId; + fn id(&self) -> &Self::Id { + &self.id + } +} +stripe_types::def_id!(SourceTransactionId); diff --git a/generated/stripe_shared/src/source_transaction_ach_credit_transfer_data.rs b/generated/stripe_shared/src/source_transaction_ach_credit_transfer_data.rs new file mode 100644 index 000000000..cbb4be85d --- /dev/null +++ b/generated/stripe_shared/src/source_transaction_ach_credit_transfer_data.rs @@ -0,0 +1,15 @@ +#[derive(Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct SourceTransactionAchCreditTransferData { + /// Customer data associated with the transfer. + #[serde(skip_serializing_if = "Option::is_none")] + pub customer_data: Option, + /// Bank account fingerprint associated with the transfer. + #[serde(skip_serializing_if = "Option::is_none")] + pub fingerprint: Option, + /// Last 4 digits of the account number associated with the transfer. + #[serde(skip_serializing_if = "Option::is_none")] + pub last4: Option, + /// Routing number associated with the transfer. + #[serde(skip_serializing_if = "Option::is_none")] + pub routing_number: Option, +} diff --git a/generated/stripe_shared/src/source_transaction_chf_credit_transfer_data.rs b/generated/stripe_shared/src/source_transaction_chf_credit_transfer_data.rs new file mode 100644 index 000000000..491954c7f --- /dev/null +++ b/generated/stripe_shared/src/source_transaction_chf_credit_transfer_data.rs @@ -0,0 +1,18 @@ +#[derive(Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct SourceTransactionChfCreditTransferData { + /// Reference associated with the transfer. + #[serde(skip_serializing_if = "Option::is_none")] + pub reference: Option, + /// Sender's country address. + #[serde(skip_serializing_if = "Option::is_none")] + pub sender_address_country: Option, + /// Sender's line 1 address. + #[serde(skip_serializing_if = "Option::is_none")] + pub sender_address_line1: Option, + /// Sender's bank account IBAN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sender_iban: Option, + /// Sender's name. + #[serde(skip_serializing_if = "Option::is_none")] + pub sender_name: Option, +} diff --git a/generated/stripe_shared/src/source_transaction_gbp_credit_transfer_data.rs b/generated/stripe_shared/src/source_transaction_gbp_credit_transfer_data.rs new file mode 100644 index 000000000..da7082cda --- /dev/null +++ b/generated/stripe_shared/src/source_transaction_gbp_credit_transfer_data.rs @@ -0,0 +1,26 @@ +#[derive(Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct SourceTransactionGbpCreditTransferData { + /// Bank account fingerprint associated with the Stripe owned bank account receiving the transfer. + #[serde(skip_serializing_if = "Option::is_none")] + pub fingerprint: Option, + /// The credit transfer rails the sender used to push this transfer. + /// The possible rails are: Faster Payments, BACS, CHAPS, and wire transfers. + /// Currently only Faster Payments is supported. + #[serde(skip_serializing_if = "Option::is_none")] + pub funding_method: Option, + /// Last 4 digits of sender account number associated with the transfer. + #[serde(skip_serializing_if = "Option::is_none")] + pub last4: Option, + /// Sender entered arbitrary information about the transfer. + #[serde(skip_serializing_if = "Option::is_none")] + pub reference: Option, + /// Sender account number associated with the transfer. + #[serde(skip_serializing_if = "Option::is_none")] + pub sender_account_number: Option, + /// Sender name associated with the transfer. + #[serde(skip_serializing_if = "Option::is_none")] + pub sender_name: Option, + /// Sender sort code associated with the transfer. + #[serde(skip_serializing_if = "Option::is_none")] + pub sender_sort_code: Option, +} diff --git a/generated/stripe_shared/src/source_transaction_paper_check_data.rs b/generated/stripe_shared/src/source_transaction_paper_check_data.rs new file mode 100644 index 000000000..fd465c5be --- /dev/null +++ b/generated/stripe_shared/src/source_transaction_paper_check_data.rs @@ -0,0 +1,10 @@ +#[derive(Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct SourceTransactionPaperCheckData { + /// Time at which the deposited funds will be available for use. + /// Measured in seconds since the Unix epoch. + #[serde(skip_serializing_if = "Option::is_none")] + pub available_at: Option, + /// Comma-separated list of invoice IDs associated with the paper check. + #[serde(skip_serializing_if = "Option::is_none")] + pub invoices: Option, +} diff --git a/generated/stripe_shared/src/source_transaction_sepa_credit_transfer_data.rs b/generated/stripe_shared/src/source_transaction_sepa_credit_transfer_data.rs new file mode 100644 index 000000000..99674772b --- /dev/null +++ b/generated/stripe_shared/src/source_transaction_sepa_credit_transfer_data.rs @@ -0,0 +1,12 @@ +#[derive(Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct SourceTransactionSepaCreditTransferData { + /// Reference associated with the transfer. + #[serde(skip_serializing_if = "Option::is_none")] + pub reference: Option, + /// Sender's bank account IBAN. + #[serde(skip_serializing_if = "Option::is_none")] + pub sender_iban: Option, + /// Sender's name. + #[serde(skip_serializing_if = "Option::is_none")] + pub sender_name: Option, +} diff --git a/generated/stripe_shared/src/source_type_ach_credit_transfer.rs b/generated/stripe_shared/src/source_type_ach_credit_transfer.rs new file mode 100644 index 000000000..fec1cfaa7 --- /dev/null +++ b/generated/stripe_shared/src/source_type_ach_credit_transfer.rs @@ -0,0 +1,19 @@ +#[derive(Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct SourceTypeAchCreditTransfer { + #[serde(skip_serializing_if = "Option::is_none")] + pub account_number: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub bank_name: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub fingerprint: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub refund_account_holder_name: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub refund_account_holder_type: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub refund_routing_number: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub routing_number: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub swift_code: Option, +} diff --git a/generated/stripe_shared/src/source_type_ach_debit.rs b/generated/stripe_shared/src/source_type_ach_debit.rs new file mode 100644 index 000000000..3af75e8ad --- /dev/null +++ b/generated/stripe_shared/src/source_type_ach_debit.rs @@ -0,0 +1,16 @@ +#[derive(Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct SourceTypeAchDebit { + #[serde(skip_serializing_if = "Option::is_none")] + pub bank_name: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub country: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub fingerprint: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub last4: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub routing_number: Option, + #[serde(rename = "type")] + #[serde(skip_serializing_if = "Option::is_none")] + pub type_: Option, +} diff --git a/generated/stripe_shared/src/source_type_acss_debit.rs b/generated/stripe_shared/src/source_type_acss_debit.rs new file mode 100644 index 000000000..5a5f28b88 --- /dev/null +++ b/generated/stripe_shared/src/source_type_acss_debit.rs @@ -0,0 +1,23 @@ +#[derive(Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct SourceTypeAcssDebit { + #[serde(skip_serializing_if = "Option::is_none")] + pub bank_address_city: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub bank_address_line_1: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub bank_address_line_2: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub bank_address_postal_code: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub bank_name: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub category: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub country: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub fingerprint: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub last4: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub routing_number: Option, +} diff --git a/generated/stripe_shared/src/source_type_alipay.rs b/generated/stripe_shared/src/source_type_alipay.rs new file mode 100644 index 000000000..bdc2da5e3 --- /dev/null +++ b/generated/stripe_shared/src/source_type_alipay.rs @@ -0,0 +1,9 @@ +#[derive(Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct SourceTypeAlipay { + #[serde(skip_serializing_if = "Option::is_none")] + pub data_string: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub native_url: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub statement_descriptor: Option, +} diff --git a/generated/stripe_shared/src/source_type_au_becs_debit.rs b/generated/stripe_shared/src/source_type_au_becs_debit.rs new file mode 100644 index 000000000..2d8f5e245 --- /dev/null +++ b/generated/stripe_shared/src/source_type_au_becs_debit.rs @@ -0,0 +1,9 @@ +#[derive(Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct SourceTypeAuBecsDebit { + #[serde(skip_serializing_if = "Option::is_none")] + pub bsb_number: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub fingerprint: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub last4: Option, +} diff --git a/generated/stripe_shared/src/source_type_bancontact.rs b/generated/stripe_shared/src/source_type_bancontact.rs new file mode 100644 index 000000000..718fc33e9 --- /dev/null +++ b/generated/stripe_shared/src/source_type_bancontact.rs @@ -0,0 +1,15 @@ +#[derive(Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct SourceTypeBancontact { + #[serde(skip_serializing_if = "Option::is_none")] + pub bank_code: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub bank_name: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub bic: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub iban_last4: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub preferred_language: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub statement_descriptor: Option, +} diff --git a/generated/stripe_shared/src/source_type_card.rs b/generated/stripe_shared/src/source_type_card.rs new file mode 100644 index 000000000..bdee83df8 --- /dev/null +++ b/generated/stripe_shared/src/source_type_card.rs @@ -0,0 +1,37 @@ +#[derive(Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct SourceTypeCard { + #[serde(skip_serializing_if = "Option::is_none")] + pub address_line1_check: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub address_zip_check: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub brand: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub country: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub cvc_check: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub description: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub dynamic_last4: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub exp_month: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub exp_year: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub fingerprint: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub funding: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub iin: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub issuer: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub last4: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub name: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub three_d_secure: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub tokenization_method: Option, +} diff --git a/generated/stripe_shared/src/source_type_card_present.rs b/generated/stripe_shared/src/source_type_card_present.rs new file mode 100644 index 000000000..c1ba590f0 --- /dev/null +++ b/generated/stripe_shared/src/source_type_card_present.rs @@ -0,0 +1,55 @@ +#[derive(Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct SourceTypeCardPresent { + #[serde(skip_serializing_if = "Option::is_none")] + pub application_cryptogram: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub application_preferred_name: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub authorization_code: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub authorization_response_code: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub brand: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub country: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub cvm_type: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub data_type: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub dedicated_file_name: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub description: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub emv_auth_data: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub evidence_customer_signature: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub evidence_transaction_certificate: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub exp_month: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub exp_year: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub fingerprint: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub funding: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub iin: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub issuer: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub last4: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub pos_device_id: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub pos_entry_mode: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub read_method: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub reader: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub terminal_verification_results: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub transaction_status_information: Option, +} diff --git a/generated/stripe_shared/src/source_type_eps.rs b/generated/stripe_shared/src/source_type_eps.rs new file mode 100644 index 000000000..38e2d3838 --- /dev/null +++ b/generated/stripe_shared/src/source_type_eps.rs @@ -0,0 +1,7 @@ +#[derive(Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct SourceTypeEps { + #[serde(skip_serializing_if = "Option::is_none")] + pub reference: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub statement_descriptor: Option, +} diff --git a/generated/stripe_shared/src/source_type_giropay.rs b/generated/stripe_shared/src/source_type_giropay.rs new file mode 100644 index 000000000..6815d3aa9 --- /dev/null +++ b/generated/stripe_shared/src/source_type_giropay.rs @@ -0,0 +1,11 @@ +#[derive(Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct SourceTypeGiropay { + #[serde(skip_serializing_if = "Option::is_none")] + pub bank_code: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub bank_name: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub bic: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub statement_descriptor: Option, +} diff --git a/generated/stripe_shared/src/source_type_ideal.rs b/generated/stripe_shared/src/source_type_ideal.rs new file mode 100644 index 000000000..e32bc18de --- /dev/null +++ b/generated/stripe_shared/src/source_type_ideal.rs @@ -0,0 +1,11 @@ +#[derive(Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct SourceTypeIdeal { + #[serde(skip_serializing_if = "Option::is_none")] + pub bank: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub bic: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub iban_last4: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub statement_descriptor: Option, +} diff --git a/generated/stripe_shared/src/source_type_klarna.rs b/generated/stripe_shared/src/source_type_klarna.rs new file mode 100644 index 000000000..4af723679 --- /dev/null +++ b/generated/stripe_shared/src/source_type_klarna.rs @@ -0,0 +1,55 @@ +#[derive(Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct SourceTypeKlarna { + #[serde(skip_serializing_if = "Option::is_none")] + pub background_image_url: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub client_token: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub first_name: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub last_name: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub locale: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub logo_url: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub page_title: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub pay_later_asset_urls_descriptive: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub pay_later_asset_urls_standard: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub pay_later_name: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub pay_later_redirect_url: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub pay_now_asset_urls_descriptive: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub pay_now_asset_urls_standard: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub pay_now_name: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub pay_now_redirect_url: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub pay_over_time_asset_urls_descriptive: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub pay_over_time_asset_urls_standard: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub pay_over_time_name: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub pay_over_time_redirect_url: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub payment_method_categories: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub purchase_country: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub purchase_type: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub redirect_url: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub shipping_delay: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub shipping_first_name: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub shipping_last_name: Option, +} diff --git a/generated/stripe_shared/src/source_type_multibanco.rs b/generated/stripe_shared/src/source_type_multibanco.rs new file mode 100644 index 000000000..8765f2828 --- /dev/null +++ b/generated/stripe_shared/src/source_type_multibanco.rs @@ -0,0 +1,23 @@ +#[derive(Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct SourceTypeMultibanco { + #[serde(skip_serializing_if = "Option::is_none")] + pub entity: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub reference: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub refund_account_holder_address_city: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub refund_account_holder_address_country: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub refund_account_holder_address_line1: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub refund_account_holder_address_line2: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub refund_account_holder_address_postal_code: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub refund_account_holder_address_state: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub refund_account_holder_name: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub refund_iban: Option, +} diff --git a/generated/stripe_shared/src/source_type_p24.rs b/generated/stripe_shared/src/source_type_p24.rs new file mode 100644 index 000000000..c7bb5edda --- /dev/null +++ b/generated/stripe_shared/src/source_type_p24.rs @@ -0,0 +1,5 @@ +#[derive(Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct SourceTypeP24 { + #[serde(skip_serializing_if = "Option::is_none")] + pub reference: Option, +} diff --git a/generated/stripe_shared/src/source_type_sepa_credit_transfer.rs b/generated/stripe_shared/src/source_type_sepa_credit_transfer.rs new file mode 100644 index 000000000..6fc345841 --- /dev/null +++ b/generated/stripe_shared/src/source_type_sepa_credit_transfer.rs @@ -0,0 +1,25 @@ +#[derive(Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct SourceTypeSepaCreditTransfer { + #[serde(skip_serializing_if = "Option::is_none")] + pub bank_name: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub bic: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub iban: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub refund_account_holder_address_city: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub refund_account_holder_address_country: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub refund_account_holder_address_line1: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub refund_account_holder_address_line2: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub refund_account_holder_address_postal_code: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub refund_account_holder_address_state: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub refund_account_holder_name: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub refund_iban: Option, +} diff --git a/generated/stripe_shared/src/source_type_sepa_debit.rs b/generated/stripe_shared/src/source_type_sepa_debit.rs new file mode 100644 index 000000000..30b5d9495 --- /dev/null +++ b/generated/stripe_shared/src/source_type_sepa_debit.rs @@ -0,0 +1,17 @@ +#[derive(Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct SourceTypeSepaDebit { + #[serde(skip_serializing_if = "Option::is_none")] + pub bank_code: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub branch_code: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub country: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub fingerprint: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub last4: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub mandate_reference: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub mandate_url: Option, +} diff --git a/generated/stripe_shared/src/source_type_sofort.rs b/generated/stripe_shared/src/source_type_sofort.rs new file mode 100644 index 000000000..8cd9f2f9f --- /dev/null +++ b/generated/stripe_shared/src/source_type_sofort.rs @@ -0,0 +1,17 @@ +#[derive(Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct SourceTypeSofort { + #[serde(skip_serializing_if = "Option::is_none")] + pub bank_code: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub bank_name: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub bic: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub country: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub iban_last4: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub preferred_language: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub statement_descriptor: Option, +} diff --git a/generated/stripe_shared/src/source_type_three_d_secure.rs b/generated/stripe_shared/src/source_type_three_d_secure.rs new file mode 100644 index 000000000..5a64afe54 --- /dev/null +++ b/generated/stripe_shared/src/source_type_three_d_secure.rs @@ -0,0 +1,43 @@ +#[derive(Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct SourceTypeThreeDSecure { + #[serde(skip_serializing_if = "Option::is_none")] + pub address_line1_check: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub address_zip_check: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub authenticated: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub brand: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub card: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub country: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub customer: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub cvc_check: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub description: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub dynamic_last4: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub exp_month: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub exp_year: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub fingerprint: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub funding: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub iin: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub issuer: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub last4: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub name: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub three_d_secure: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub tokenization_method: Option, +} diff --git a/generated/stripe_shared/src/source_type_wechat.rs b/generated/stripe_shared/src/source_type_wechat.rs new file mode 100644 index 000000000..72ba418f9 --- /dev/null +++ b/generated/stripe_shared/src/source_type_wechat.rs @@ -0,0 +1,9 @@ +#[derive(Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct SourceTypeWechat { + #[serde(skip_serializing_if = "Option::is_none")] + pub prepay_id: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub qr_code_url: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub statement_descriptor: Option, +} diff --git a/generated/stripe_shared/src/subscription.rs b/generated/stripe_shared/src/subscription.rs new file mode 100644 index 000000000..587fcf24a --- /dev/null +++ b/generated/stripe_shared/src/subscription.rs @@ -0,0 +1,290 @@ +/// Subscriptions allow you to charge a customer on a recurring basis. +/// +/// Related guide: [Creating subscriptions](https://stripe.com/docs/billing/subscriptions/creating) +/// +/// For more details see <>. +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct Subscription { + /// ID of the Connect Application that created the subscription. + pub application: Option>, + /// A non-negative decimal between 0 and 100, with at most two decimal places. + /// This represents the percentage of the subscription invoice total that will be transferred to the application owner's Stripe account. + pub application_fee_percent: Option, + pub automatic_tax: stripe_shared::SubscriptionAutomaticTax, + /// The reference point that aligns future [billing cycle](https://stripe.com/docs/subscriptions/billing-cycle) dates. + /// It sets the day of week for `week` intervals, the day of month for `month` and `year` intervals, and the month of year for `year` intervals. + /// The timestamp is in UTC format. + pub billing_cycle_anchor: stripe_types::Timestamp, + /// The fixed values used to calculate the `billing_cycle_anchor`. + pub billing_cycle_anchor_config: + Option, + /// Define thresholds at which an invoice will be sent, and the subscription advanced to a new billing period. + pub billing_thresholds: Option, + /// A date in the future at which the subscription will automatically get canceled + pub cancel_at: Option, + /// If the subscription has been canceled with the `at_period_end` flag set to `true`, `cancel_at_period_end` on the subscription will be true. + /// You can use this attribute to determine whether a subscription that has a status of active is scheduled to be canceled at the end of the current period. + pub cancel_at_period_end: bool, + /// If the subscription has been canceled, the date of that cancellation. + /// If the subscription was canceled with `cancel_at_period_end`, `canceled_at` will reflect the time of the most recent update request, not the end of the subscription period when the subscription is automatically moved to a canceled state. + pub canceled_at: Option, + /// Details about why this subscription was cancelled + pub cancellation_details: Option, + /// Either `charge_automatically`, or `send_invoice`. + /// When charging automatically, Stripe will attempt to pay this subscription at the end of the cycle using the default source attached to the customer. + /// When sending an invoice, Stripe will email your customer an invoice with payment instructions and mark the subscription as `active`. + pub collection_method: stripe_shared::SubscriptionCollectionMethod, + /// Time at which the object was created. Measured in seconds since the Unix epoch. + pub created: stripe_types::Timestamp, + /// Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. + /// Must be a [supported currency](https://stripe.com/docs/currencies). + pub currency: stripe_types::Currency, + /// End of the current period that the subscription has been invoiced for. + /// At the end of this period, a new invoice will be created. + pub current_period_end: stripe_types::Timestamp, + /// Start of the current period that the subscription has been invoiced for. + pub current_period_start: stripe_types::Timestamp, + /// ID of the customer who owns the subscription. + pub customer: stripe_types::Expandable, + /// Number of days a customer has to pay invoices generated by this subscription. + /// This value will be `null` for subscriptions where `collection_method=charge_automatically`. + pub days_until_due: Option, + /// ID of the default payment method for the subscription. + /// It must belong to the customer associated with the subscription. + /// This takes precedence over `default_source`. + /// If neither are set, invoices will use the customer's [invoice_settings.default_payment_method](https://stripe.com/docs/api/customers/object#customer_object-invoice_settings-default_payment_method) or [default_source](https://stripe.com/docs/api/customers/object#customer_object-default_source). + pub default_payment_method: Option>, + /// ID of the default payment source for the subscription. + /// It must belong to the customer associated with the subscription and be in a chargeable state. + /// If `default_payment_method` is also set, `default_payment_method` will take precedence. + /// If neither are set, invoices will use the customer's [invoice_settings.default_payment_method](https://stripe.com/docs/api/customers/object#customer_object-invoice_settings-default_payment_method) or [default_source](https://stripe.com/docs/api/customers/object#customer_object-default_source). + pub default_source: Option>, + /// The tax rates that will apply to any subscription item that does not have `tax_rates` set. + /// Invoices created will have their `default_tax_rates` populated from the subscription. + #[serde(skip_serializing_if = "Option::is_none")] + pub default_tax_rates: Option>, + /// The subscription's description, meant to be displayable to the customer. + /// Use this field to optionally store an explanation of the subscription for rendering in Stripe surfaces and certain local payment methods UIs. + pub description: Option, + /// Describes the current discount applied to this subscription, if there is one. + /// When billing, a discount applied to a subscription overrides a discount applied on a customer-wide basis. + pub discount: Option, + /// If the subscription has ended, the date the subscription ended. + pub ended_at: Option, + /// Unique identifier for the object. + pub id: stripe_shared::SubscriptionId, + /// List of subscription items, each with an attached price. + pub items: stripe_types::List, + /// The most recent invoice this subscription has generated. + pub latest_invoice: Option>, + /// Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + pub livemode: bool, + /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. + /// This can be useful for storing additional information about the object in a structured format. + pub metadata: std::collections::HashMap, + /// Specifies the approximate timestamp on which any pending invoice items will be billed according to the schedule provided at `pending_invoice_item_interval`. + pub next_pending_invoice_item_invoice: Option, + /// The account (if any) the charge was made on behalf of for charges associated with this subscription. + /// See the Connect documentation for details. + pub on_behalf_of: Option>, + /// If specified, payment collection for this subscription will be paused. + pub pause_collection: Option, + /// Payment settings passed on to invoices created by the subscription. + pub payment_settings: Option, + /// Specifies an interval for how often to bill for any pending invoice items. + /// It is analogous to calling [Create an invoice](https://stripe.com/docs/api#create_invoice) for the given subscription at the specified interval. + pub pending_invoice_item_interval: + Option, + /// You can use this [SetupIntent](https://stripe.com/docs/api/setup_intents) to collect user authentication when creating a subscription without immediate payment or updating a subscription's payment method, allowing you to optimize for off-session payments. + /// Learn more in the [SCA Migration Guide](https://stripe.com/docs/billing/migration/strong-customer-authentication#scenario-2). + pub pending_setup_intent: Option>, + /// If specified, [pending updates](https://stripe.com/docs/billing/subscriptions/pending-updates) that will be applied to the subscription once the `latest_invoice` has been paid. + pub pending_update: Option, + /// The schedule attached to the subscription + pub schedule: Option>, + /// Date when the subscription was first created. + /// The date might differ from the `created` date due to backdating. + pub start_date: stripe_types::Timestamp, + /// Possible values are `incomplete`, `incomplete_expired`, `trialing`, `active`, `past_due`, `canceled`, or `unpaid`. + /// + /// + /// For `collection_method=charge_automatically` a subscription moves into `incomplete` if the initial payment attempt fails. + /// A subscription in this state can only have metadata and default_source updated. + /// Once the first invoice is paid, the subscription moves into an `active` state. + /// If the first invoice is not paid within 23 hours, the subscription transitions to `incomplete_expired`. + /// This is a terminal state, the open invoice will be voided and no further invoices will be generated. + /// + /// + /// A subscription that is currently in a trial period is `trialing` and moves to `active` when the trial period is over. + /// + /// + /// If subscription `collection_method=charge_automatically`, it becomes `past_due` when payment is required but cannot be paid (due to failed payment or awaiting additional user actions). + /// Once Stripe has exhausted all payment retry attempts, the subscription will become `canceled` or `unpaid` (depending on your subscriptions settings). + /// + /// + /// If subscription `collection_method=send_invoice` it becomes `past_due` when its invoice is not paid by the due date, and `canceled` or `unpaid` if it is still not paid by an additional deadline after that. + /// Note that when a subscription has a status of `unpaid`, no subsequent invoices will be attempted (invoices will be created, but then immediately automatically closed). + /// After receiving updated payment information from a customer, you may choose to reopen and pay their closed invoices. + pub status: SubscriptionStatus, + /// ID of the test clock this subscription belongs to. + pub test_clock: Option>, + /// The account (if any) the subscription's payments will be attributed to for tax reporting, and where funds from each payment will be transferred to for each of the subscription's invoices. + pub transfer_data: Option, + /// If the subscription has a trial, the end of that trial. + pub trial_end: Option, + /// Settings related to subscription trials. + pub trial_settings: Option, + /// If the subscription has a trial, the beginning of that trial. + pub trial_start: Option, +} +/// Possible values are `incomplete`, `incomplete_expired`, `trialing`, `active`, `past_due`, `canceled`, or `unpaid`. +/// +/// +/// For `collection_method=charge_automatically` a subscription moves into `incomplete` if the initial payment attempt fails. +/// A subscription in this state can only have metadata and default_source updated. +/// Once the first invoice is paid, the subscription moves into an `active` state. +/// If the first invoice is not paid within 23 hours, the subscription transitions to `incomplete_expired`. +/// This is a terminal state, the open invoice will be voided and no further invoices will be generated. +/// +/// +/// A subscription that is currently in a trial period is `trialing` and moves to `active` when the trial period is over. +/// +/// +/// If subscription `collection_method=charge_automatically`, it becomes `past_due` when payment is required but cannot be paid (due to failed payment or awaiting additional user actions). +/// Once Stripe has exhausted all payment retry attempts, the subscription will become `canceled` or `unpaid` (depending on your subscriptions settings). +/// +/// +/// If subscription `collection_method=send_invoice` it becomes `past_due` when its invoice is not paid by the due date, and `canceled` or `unpaid` if it is still not paid by an additional deadline after that. +/// Note that when a subscription has a status of `unpaid`, no subsequent invoices will be attempted (invoices will be created, but then immediately automatically closed). +/// After receiving updated payment information from a customer, you may choose to reopen and pay their closed invoices. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum SubscriptionStatus { + Active, + Canceled, + Incomplete, + IncompleteExpired, + PastDue, + Paused, + Trialing, + Unpaid, +} +impl SubscriptionStatus { + pub fn as_str(self) -> &'static str { + use SubscriptionStatus::*; + match self { + Active => "active", + Canceled => "canceled", + Incomplete => "incomplete", + IncompleteExpired => "incomplete_expired", + PastDue => "past_due", + Paused => "paused", + Trialing => "trialing", + Unpaid => "unpaid", + } + } +} + +impl std::str::FromStr for SubscriptionStatus { + type Err = (); + fn from_str(s: &str) -> Result { + use SubscriptionStatus::*; + match s { + "active" => Ok(Active), + "canceled" => Ok(Canceled), + "incomplete" => Ok(Incomplete), + "incomplete_expired" => Ok(IncompleteExpired), + "past_due" => Ok(PastDue), + "paused" => Ok(Paused), + "trialing" => Ok(Trialing), + "unpaid" => Ok(Unpaid), + _ => Err(()), + } + } +} +impl std::fmt::Display for SubscriptionStatus { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for SubscriptionStatus { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for SubscriptionStatus { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for SubscriptionStatus { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s) + .map_err(|_| serde::de::Error::custom("Unknown value for SubscriptionStatus")) + } +} +impl stripe_types::Object for Subscription { + type Id = stripe_shared::SubscriptionId; + fn id(&self) -> &Self::Id { + &self.id + } +} +stripe_types::def_id!(SubscriptionId, "sub_"); +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum SubscriptionCollectionMethod { + ChargeAutomatically, + SendInvoice, +} +impl SubscriptionCollectionMethod { + pub fn as_str(self) -> &'static str { + use SubscriptionCollectionMethod::*; + match self { + ChargeAutomatically => "charge_automatically", + SendInvoice => "send_invoice", + } + } +} + +impl std::str::FromStr for SubscriptionCollectionMethod { + type Err = (); + fn from_str(s: &str) -> Result { + use SubscriptionCollectionMethod::*; + match s { + "charge_automatically" => Ok(ChargeAutomatically), + "send_invoice" => Ok(SendInvoice), + _ => Err(()), + } + } +} +impl std::fmt::Display for SubscriptionCollectionMethod { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for SubscriptionCollectionMethod { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for SubscriptionCollectionMethod { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for SubscriptionCollectionMethod { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s) + .map_err(|_| serde::de::Error::custom("Unknown value for SubscriptionCollectionMethod")) + } +} diff --git a/generated/stripe_shared/src/subscription_automatic_tax.rs b/generated/stripe_shared/src/subscription_automatic_tax.rs new file mode 100644 index 000000000..4328f2c5f --- /dev/null +++ b/generated/stripe_shared/src/subscription_automatic_tax.rs @@ -0,0 +1,9 @@ +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct SubscriptionAutomaticTax { + /// Whether Stripe automatically computes tax on this subscription. + pub enabled: bool, + /// The account that's liable for tax. + /// If set, the business address and tax registrations required to perform the tax calculation are loaded from this account. + /// The tax transaction is returned in the report of the connected account. + pub liability: Option, +} diff --git a/src/resources/generated/subscription_billing_thresholds.rs b/generated/stripe_shared/src/subscription_billing_thresholds.rs similarity index 63% rename from src/resources/generated/subscription_billing_thresholds.rs rename to generated/stripe_shared/src/subscription_billing_thresholds.rs index e4ec6bd85..fd4a84121 100644 --- a/src/resources/generated/subscription_billing_thresholds.rs +++ b/generated/stripe_shared/src/subscription_billing_thresholds.rs @@ -1,17 +1,8 @@ -// ====================================== -// This file was automatically generated. -// ====================================== - -use serde::{Deserialize, Serialize}; - -/// The resource representing a Stripe "SubscriptionBillingThresholds". -#[derive(Clone, Debug, Default, Deserialize, Serialize)] +#[derive(Copy, Clone, Debug, Default, serde::Serialize, serde::Deserialize)] pub struct SubscriptionBillingThresholds { - /// Monetary threshold that triggers the subscription to create an invoice. + /// Monetary threshold that triggers the subscription to create an invoice pub amount_gte: Option, - /// Indicates if the `billing_cycle_anchor` should be reset when a threshold is reached. - /// /// If true, `billing_cycle_anchor` will be updated to the date/time the threshold was last reached; otherwise, the value will remain unchanged. /// This value may not be `true` if the subscription contains items with plans that have `aggregate_usage=last_ever`. pub reset_billing_cycle_anchor: Option, diff --git a/generated/stripe_shared/src/subscription_details_data.rs b/generated/stripe_shared/src/subscription_details_data.rs new file mode 100644 index 000000000..9aaed6099 --- /dev/null +++ b/generated/stripe_shared/src/subscription_details_data.rs @@ -0,0 +1,6 @@ +#[derive(Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct SubscriptionDetailsData { + /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that will reflect the metadata of the subscription at the time of invoice creation. + /// *Note: This attribute is populated only for invoices created on or after June 29, 2023.*. + pub metadata: Option>, +} diff --git a/generated/stripe_shared/src/subscription_item.rs b/generated/stripe_shared/src/subscription_item.rs new file mode 100644 index 000000000..f77fbbacf --- /dev/null +++ b/generated/stripe_shared/src/subscription_item.rs @@ -0,0 +1,33 @@ +/// Subscription items allow you to create customer subscriptions with more than +/// one plan, making it easy to represent complex billing relationships. +/// +/// For more details see <>. +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct SubscriptionItem { + /// Define thresholds at which an invoice will be sent, and the related subscription advanced to a new billing period. + pub billing_thresholds: Option, + /// Time at which the object was created. Measured in seconds since the Unix epoch. + pub created: i64, + /// Unique identifier for the object. + pub id: stripe_shared::SubscriptionItemId, + /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. + /// This can be useful for storing additional information about the object in a structured format. + pub metadata: std::collections::HashMap, + pub plan: stripe_shared::Plan, + pub price: stripe_shared::Price, + /// The [quantity](https://stripe.com/docs/subscriptions/quantities) of the plan to which the customer should be subscribed. + #[serde(skip_serializing_if = "Option::is_none")] + pub quantity: Option, + /// The `subscription` this `subscription_item` belongs to. + pub subscription: String, + /// The tax rates which apply to this `subscription_item`. + /// When set, the `default_tax_rates` on the subscription do not apply to this `subscription_item`. + pub tax_rates: Option>, +} +impl stripe_types::Object for SubscriptionItem { + type Id = stripe_shared::SubscriptionItemId; + fn id(&self) -> &Self::Id { + &self.id + } +} +stripe_types::def_id!(SubscriptionItemId, "si_"); diff --git a/generated/stripe_shared/src/subscription_item_billing_thresholds.rs b/generated/stripe_shared/src/subscription_item_billing_thresholds.rs new file mode 100644 index 000000000..31d4f7f63 --- /dev/null +++ b/generated/stripe_shared/src/subscription_item_billing_thresholds.rs @@ -0,0 +1,5 @@ +#[derive(Copy, Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct SubscriptionItemBillingThresholds { + /// Usage threshold that triggers the subscription to create an invoice + pub usage_gte: Option, +} diff --git a/generated/stripe_shared/src/subscription_payment_method_options_card.rs b/generated/stripe_shared/src/subscription_payment_method_options_card.rs new file mode 100644 index 000000000..eea74be21 --- /dev/null +++ b/generated/stripe_shared/src/subscription_payment_method_options_card.rs @@ -0,0 +1,161 @@ +#[derive(Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct SubscriptionPaymentMethodOptionsCard { + #[serde(skip_serializing_if = "Option::is_none")] + pub mandate_options: Option, + /// Selected network to process this Subscription on. + /// Depends on the available networks of the card attached to the Subscription. + /// Can be only set confirm-time. + pub network: Option, + /// We strongly recommend that you rely on our SCA Engine to automatically prompt your customers for authentication based on risk level and [other requirements](https://stripe.com/docs/strong-customer-authentication). + /// However, if you wish to request 3D Secure based on logic from your own fraud engine, provide this option. + /// Read our guide on [manually requesting 3D Secure](https://stripe.com/docs/payments/3d-secure#manual-three-ds) for more information on how this configuration interacts with Radar and our SCA Engine. + pub request_three_d_secure: Option, +} +/// Selected network to process this Subscription on. +/// Depends on the available networks of the card attached to the Subscription. +/// Can be only set confirm-time. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum SubscriptionPaymentMethodOptionsCardNetwork { + Amex, + CartesBancaires, + Diners, + Discover, + EftposAu, + Interac, + Jcb, + Mastercard, + Unionpay, + Unknown, + Visa, +} +impl SubscriptionPaymentMethodOptionsCardNetwork { + pub fn as_str(self) -> &'static str { + use SubscriptionPaymentMethodOptionsCardNetwork::*; + match self { + Amex => "amex", + CartesBancaires => "cartes_bancaires", + Diners => "diners", + Discover => "discover", + EftposAu => "eftpos_au", + Interac => "interac", + Jcb => "jcb", + Mastercard => "mastercard", + Unionpay => "unionpay", + Unknown => "unknown", + Visa => "visa", + } + } +} + +impl std::str::FromStr for SubscriptionPaymentMethodOptionsCardNetwork { + type Err = (); + fn from_str(s: &str) -> Result { + use SubscriptionPaymentMethodOptionsCardNetwork::*; + match s { + "amex" => Ok(Amex), + "cartes_bancaires" => Ok(CartesBancaires), + "diners" => Ok(Diners), + "discover" => Ok(Discover), + "eftpos_au" => Ok(EftposAu), + "interac" => Ok(Interac), + "jcb" => Ok(Jcb), + "mastercard" => Ok(Mastercard), + "unionpay" => Ok(Unionpay), + "unknown" => Ok(Unknown), + "visa" => Ok(Visa), + _ => Err(()), + } + } +} +impl std::fmt::Display for SubscriptionPaymentMethodOptionsCardNetwork { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for SubscriptionPaymentMethodOptionsCardNetwork { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for SubscriptionPaymentMethodOptionsCardNetwork { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for SubscriptionPaymentMethodOptionsCardNetwork { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| { + serde::de::Error::custom( + "Unknown value for SubscriptionPaymentMethodOptionsCardNetwork", + ) + }) + } +} +/// We strongly recommend that you rely on our SCA Engine to automatically prompt your customers for authentication based on risk level and [other requirements](https://stripe.com/docs/strong-customer-authentication). +/// However, if you wish to request 3D Secure based on logic from your own fraud engine, provide this option. +/// Read our guide on [manually requesting 3D Secure](https://stripe.com/docs/payments/3d-secure#manual-three-ds) for more information on how this configuration interacts with Radar and our SCA Engine. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum SubscriptionPaymentMethodOptionsCardRequestThreeDSecure { + Any, + Automatic, + Challenge, +} +impl SubscriptionPaymentMethodOptionsCardRequestThreeDSecure { + pub fn as_str(self) -> &'static str { + use SubscriptionPaymentMethodOptionsCardRequestThreeDSecure::*; + match self { + Any => "any", + Automatic => "automatic", + Challenge => "challenge", + } + } +} + +impl std::str::FromStr for SubscriptionPaymentMethodOptionsCardRequestThreeDSecure { + type Err = (); + fn from_str(s: &str) -> Result { + use SubscriptionPaymentMethodOptionsCardRequestThreeDSecure::*; + match s { + "any" => Ok(Any), + "automatic" => Ok(Automatic), + "challenge" => Ok(Challenge), + _ => Err(()), + } + } +} +impl std::fmt::Display for SubscriptionPaymentMethodOptionsCardRequestThreeDSecure { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for SubscriptionPaymentMethodOptionsCardRequestThreeDSecure { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for SubscriptionPaymentMethodOptionsCardRequestThreeDSecure { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for SubscriptionPaymentMethodOptionsCardRequestThreeDSecure { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| { + serde::de::Error::custom( + "Unknown value for SubscriptionPaymentMethodOptionsCardRequestThreeDSecure", + ) + }) + } +} diff --git a/generated/stripe_shared/src/subscription_pending_invoice_item_interval.rs b/generated/stripe_shared/src/subscription_pending_invoice_item_interval.rs new file mode 100644 index 000000000..e5e9ebb90 --- /dev/null +++ b/generated/stripe_shared/src/subscription_pending_invoice_item_interval.rs @@ -0,0 +1,72 @@ +#[derive(Copy, Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct SubscriptionPendingInvoiceItemInterval { + /// Specifies invoicing frequency. Either `day`, `week`, `month` or `year`. + pub interval: SubscriptionPendingInvoiceItemIntervalInterval, + /// The number of intervals between invoices. + /// For example, `interval=month` and `interval_count=3` bills every 3 months. + /// Maximum of one year interval allowed (1 year, 12 months, or 52 weeks). + pub interval_count: u64, +} +/// Specifies invoicing frequency. Either `day`, `week`, `month` or `year`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum SubscriptionPendingInvoiceItemIntervalInterval { + Day, + Month, + Week, + Year, +} +impl SubscriptionPendingInvoiceItemIntervalInterval { + pub fn as_str(self) -> &'static str { + use SubscriptionPendingInvoiceItemIntervalInterval::*; + match self { + Day => "day", + Month => "month", + Week => "week", + Year => "year", + } + } +} + +impl std::str::FromStr for SubscriptionPendingInvoiceItemIntervalInterval { + type Err = (); + fn from_str(s: &str) -> Result { + use SubscriptionPendingInvoiceItemIntervalInterval::*; + match s { + "day" => Ok(Day), + "month" => Ok(Month), + "week" => Ok(Week), + "year" => Ok(Year), + _ => Err(()), + } + } +} +impl std::fmt::Display for SubscriptionPendingInvoiceItemIntervalInterval { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for SubscriptionPendingInvoiceItemIntervalInterval { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for SubscriptionPendingInvoiceItemIntervalInterval { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for SubscriptionPendingInvoiceItemIntervalInterval { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| { + serde::de::Error::custom( + "Unknown value for SubscriptionPendingInvoiceItemIntervalInterval", + ) + }) + } +} diff --git a/generated/stripe_shared/src/subscription_schedule.rs b/generated/stripe_shared/src/subscription_schedule.rs new file mode 100644 index 000000000..7672ad33d --- /dev/null +++ b/generated/stripe_shared/src/subscription_schedule.rs @@ -0,0 +1,179 @@ +/// A subscription schedule allows you to create and manage the lifecycle of a subscription by predefining expected changes. +/// +/// Related guide: [Subscription schedules](https://stripe.com/docs/billing/subscriptions/subscription-schedules). +/// +/// For more details see <>. +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct SubscriptionSchedule { + /// ID of the Connect Application that created the schedule. + pub application: Option>, + /// Time at which the subscription schedule was canceled. Measured in seconds since the Unix epoch. + pub canceled_at: Option, + /// Time at which the subscription schedule was completed. Measured in seconds since the Unix epoch. + pub completed_at: Option, + /// Time at which the object was created. Measured in seconds since the Unix epoch. + pub created: stripe_types::Timestamp, + /// Object representing the start and end dates for the current phase of the subscription schedule, if it is `active`. + pub current_phase: Option, + /// ID of the customer who owns the subscription schedule. + pub customer: stripe_types::Expandable, + pub default_settings: stripe_shared::SubscriptionSchedulesResourceDefaultSettings, + /// Behavior of the subscription schedule and underlying subscription when it ends. + /// Possible values are `release` or `cancel` with the default being `release`. + /// `release` will end the subscription schedule and keep the underlying subscription running. + /// `cancel` will end the subscription schedule and cancel the underlying subscription. + pub end_behavior: stripe_shared::SubscriptionScheduleEndBehavior, + /// Unique identifier for the object. + pub id: stripe_shared::SubscriptionScheduleId, + /// Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + pub livemode: bool, + /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. + /// This can be useful for storing additional information about the object in a structured format. + pub metadata: Option>, + /// Configuration for the subscription schedule's phases. + pub phases: Vec, + /// Time at which the subscription schedule was released. Measured in seconds since the Unix epoch. + pub released_at: Option, + /// ID of the subscription once managed by the subscription schedule (if it is released). + pub released_subscription: Option, + /// The present status of the subscription schedule. + /// Possible values are `not_started`, `active`, `completed`, `released`, and `canceled`. + /// You can read more about the different states in our [behavior guide](https://stripe.com/docs/billing/subscriptions/subscription-schedules). + pub status: SubscriptionScheduleStatus, + /// ID of the subscription managed by the subscription schedule. + pub subscription: Option>, + /// ID of the test clock this subscription schedule belongs to. + pub test_clock: Option>, +} +/// The present status of the subscription schedule. +/// Possible values are `not_started`, `active`, `completed`, `released`, and `canceled`. +/// You can read more about the different states in our [behavior guide](https://stripe.com/docs/billing/subscriptions/subscription-schedules). +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum SubscriptionScheduleStatus { + Active, + Canceled, + Completed, + NotStarted, + Released, +} +impl SubscriptionScheduleStatus { + pub fn as_str(self) -> &'static str { + use SubscriptionScheduleStatus::*; + match self { + Active => "active", + Canceled => "canceled", + Completed => "completed", + NotStarted => "not_started", + Released => "released", + } + } +} + +impl std::str::FromStr for SubscriptionScheduleStatus { + type Err = (); + fn from_str(s: &str) -> Result { + use SubscriptionScheduleStatus::*; + match s { + "active" => Ok(Active), + "canceled" => Ok(Canceled), + "completed" => Ok(Completed), + "not_started" => Ok(NotStarted), + "released" => Ok(Released), + _ => Err(()), + } + } +} +impl std::fmt::Display for SubscriptionScheduleStatus { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for SubscriptionScheduleStatus { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for SubscriptionScheduleStatus { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for SubscriptionScheduleStatus { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s) + .map_err(|_| serde::de::Error::custom("Unknown value for SubscriptionScheduleStatus")) + } +} +impl stripe_types::Object for SubscriptionSchedule { + type Id = stripe_shared::SubscriptionScheduleId; + fn id(&self) -> &Self::Id { + &self.id + } +} +stripe_types::def_id!(SubscriptionScheduleId, "sub_sched_"); +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum SubscriptionScheduleEndBehavior { + Cancel, + None, + Release, + Renew, +} +impl SubscriptionScheduleEndBehavior { + pub fn as_str(self) -> &'static str { + use SubscriptionScheduleEndBehavior::*; + match self { + Cancel => "cancel", + None => "none", + Release => "release", + Renew => "renew", + } + } +} + +impl std::str::FromStr for SubscriptionScheduleEndBehavior { + type Err = (); + fn from_str(s: &str) -> Result { + use SubscriptionScheduleEndBehavior::*; + match s { + "cancel" => Ok(Cancel), + "none" => Ok(None), + "release" => Ok(Release), + "renew" => Ok(Renew), + _ => Err(()), + } + } +} +impl std::fmt::Display for SubscriptionScheduleEndBehavior { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for SubscriptionScheduleEndBehavior { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for SubscriptionScheduleEndBehavior { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for SubscriptionScheduleEndBehavior { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| { + serde::de::Error::custom("Unknown value for SubscriptionScheduleEndBehavior") + }) + } +} diff --git a/generated/stripe_shared/src/subscription_schedule_add_invoice_item.rs b/generated/stripe_shared/src/subscription_schedule_add_invoice_item.rs new file mode 100644 index 000000000..3d164892c --- /dev/null +++ b/generated/stripe_shared/src/subscription_schedule_add_invoice_item.rs @@ -0,0 +1,11 @@ +/// An Add Invoice Item describes the prices and quantities that will be added as pending invoice items when entering a phase. +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct SubscriptionScheduleAddInvoiceItem { + /// ID of the price used to generate the invoice item. + pub price: stripe_types::Expandable, + /// The quantity of the invoice item. + pub quantity: Option, + /// The tax rates which apply to the item. When set, the `default_tax_rates` do not apply to this item. + #[serde(skip_serializing_if = "Option::is_none")] + pub tax_rates: Option>, +} diff --git a/generated/stripe_shared/src/subscription_schedule_configuration_item.rs b/generated/stripe_shared/src/subscription_schedule_configuration_item.rs new file mode 100644 index 000000000..11148bfdb --- /dev/null +++ b/generated/stripe_shared/src/subscription_schedule_configuration_item.rs @@ -0,0 +1,20 @@ +/// A phase item describes the price and quantity of a phase. +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct SubscriptionScheduleConfigurationItem { + /// Define thresholds at which an invoice will be sent, and the related subscription advanced to a new billing period. + pub billing_thresholds: Option, + /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an item. + /// Metadata on this item will update the underlying subscription item's `metadata` when the phase is entered. + pub metadata: Option>, + /// ID of the plan to which the customer should be subscribed. + pub plan: stripe_types::Expandable, + /// ID of the price to which the customer should be subscribed. + pub price: stripe_types::Expandable, + /// Quantity of the plan to which the customer should be subscribed. + #[serde(skip_serializing_if = "Option::is_none")] + pub quantity: Option, + /// The tax rates which apply to this `phase_item`. + /// When set, the `default_tax_rates` on the phase do not apply to this `phase_item`. + #[serde(skip_serializing_if = "Option::is_none")] + pub tax_rates: Option>, +} diff --git a/generated/stripe_shared/src/subscription_schedule_current_phase.rs b/generated/stripe_shared/src/subscription_schedule_current_phase.rs new file mode 100644 index 000000000..28d2195a8 --- /dev/null +++ b/generated/stripe_shared/src/subscription_schedule_current_phase.rs @@ -0,0 +1,7 @@ +#[derive(Copy, Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct SubscriptionScheduleCurrentPhase { + /// The end of this phase of the subscription schedule. + pub end_date: stripe_types::Timestamp, + /// The start of this phase of the subscription schedule. + pub start_date: stripe_types::Timestamp, +} diff --git a/generated/stripe_shared/src/subscription_schedule_phase_configuration.rs b/generated/stripe_shared/src/subscription_schedule_phase_configuration.rs new file mode 100644 index 000000000..43c9fde1b --- /dev/null +++ b/generated/stripe_shared/src/subscription_schedule_phase_configuration.rs @@ -0,0 +1,239 @@ +/// A phase describes the plans, coupon, and trialing status of a subscription for a predefined time period. +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct SubscriptionSchedulePhaseConfiguration { + /// A list of prices and quantities that will generate invoice items appended to the next invoice for this phase. + pub add_invoice_items: Vec, + /// A non-negative decimal between 0 and 100, with at most two decimal places. + /// This represents the percentage of the subscription invoice total that will be transferred to the application owner's Stripe account during this phase of the schedule. + pub application_fee_percent: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub automatic_tax: Option, + /// Possible values are `phase_start` or `automatic`. + /// If `phase_start` then billing cycle anchor of the subscription is set to the start of the phase when entering the phase. + /// If `automatic` then the billing cycle anchor is automatically modified as needed when entering the phase. + /// For more information, see the billing cycle [documentation](https://stripe.com/docs/billing/subscriptions/billing-cycle). + pub billing_cycle_anchor: Option, + /// Define thresholds at which an invoice will be sent, and the subscription advanced to a new billing period. + pub billing_thresholds: Option, + /// Either `charge_automatically`, or `send_invoice`. + /// When charging automatically, Stripe will attempt to pay the underlying subscription at the end of each billing cycle using the default source attached to the customer. + /// When sending an invoice, Stripe will email your customer an invoice with payment instructions and mark the subscription as `active`. + pub collection_method: Option, + /// ID of the coupon to use during this phase of the subscription schedule. + pub coupon: Option>, + /// Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. + /// Must be a [supported currency](https://stripe.com/docs/currencies). + pub currency: stripe_types::Currency, + /// ID of the default payment method for the subscription schedule. + /// It must belong to the customer associated with the subscription schedule. + /// If not set, invoices will use the default payment method in the customer's invoice settings. + pub default_payment_method: Option>, + /// The default tax rates to apply to the subscription during this phase of the subscription schedule. + #[serde(skip_serializing_if = "Option::is_none")] + pub default_tax_rates: Option>, + /// Subscription description, meant to be displayable to the customer. + /// Use this field to optionally store an explanation of the subscription for rendering in Stripe surfaces and certain local payment methods UIs. + pub description: Option, + /// The end of this phase of the subscription schedule. + pub end_date: stripe_types::Timestamp, + /// The invoice settings applicable during this phase. + pub invoice_settings: Option, + /// Subscription items to configure the subscription to during this phase of the subscription schedule. + pub items: Vec, + /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to a phase. + /// Metadata on a schedule's phase will update the underlying subscription's `metadata` when the phase is entered. + /// Updating the underlying subscription's `metadata` directly will not affect the current phase's `metadata`. + pub metadata: Option>, + /// The account (if any) the charge was made on behalf of for charges associated with the schedule's subscription. + /// See the Connect documentation for details. + pub on_behalf_of: Option>, + /// If the subscription schedule will prorate when transitioning to this phase. + /// Possible values are `create_prorations` and `none`. + pub proration_behavior: SubscriptionSchedulePhaseConfigurationProrationBehavior, + /// The start of this phase of the subscription schedule. + pub start_date: stripe_types::Timestamp, + /// The account (if any) the associated subscription's payments will be attributed to for tax reporting, and where funds from each payment will be transferred to for each of the subscription's invoices. + pub transfer_data: Option, + /// When the trial ends within the phase. + pub trial_end: Option, +} +/// Possible values are `phase_start` or `automatic`. +/// If `phase_start` then billing cycle anchor of the subscription is set to the start of the phase when entering the phase. +/// If `automatic` then the billing cycle anchor is automatically modified as needed when entering the phase. +/// For more information, see the billing cycle [documentation](https://stripe.com/docs/billing/subscriptions/billing-cycle). +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum SubscriptionSchedulePhaseConfigurationBillingCycleAnchor { + Automatic, + PhaseStart, +} +impl SubscriptionSchedulePhaseConfigurationBillingCycleAnchor { + pub fn as_str(self) -> &'static str { + use SubscriptionSchedulePhaseConfigurationBillingCycleAnchor::*; + match self { + Automatic => "automatic", + PhaseStart => "phase_start", + } + } +} + +impl std::str::FromStr for SubscriptionSchedulePhaseConfigurationBillingCycleAnchor { + type Err = (); + fn from_str(s: &str) -> Result { + use SubscriptionSchedulePhaseConfigurationBillingCycleAnchor::*; + match s { + "automatic" => Ok(Automatic), + "phase_start" => Ok(PhaseStart), + _ => Err(()), + } + } +} +impl std::fmt::Display for SubscriptionSchedulePhaseConfigurationBillingCycleAnchor { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for SubscriptionSchedulePhaseConfigurationBillingCycleAnchor { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for SubscriptionSchedulePhaseConfigurationBillingCycleAnchor { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for SubscriptionSchedulePhaseConfigurationBillingCycleAnchor { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| { + serde::de::Error::custom( + "Unknown value for SubscriptionSchedulePhaseConfigurationBillingCycleAnchor", + ) + }) + } +} +/// Either `charge_automatically`, or `send_invoice`. +/// When charging automatically, Stripe will attempt to pay the underlying subscription at the end of each billing cycle using the default source attached to the customer. +/// When sending an invoice, Stripe will email your customer an invoice with payment instructions and mark the subscription as `active`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum SubscriptionSchedulePhaseConfigurationCollectionMethod { + ChargeAutomatically, + SendInvoice, +} +impl SubscriptionSchedulePhaseConfigurationCollectionMethod { + pub fn as_str(self) -> &'static str { + use SubscriptionSchedulePhaseConfigurationCollectionMethod::*; + match self { + ChargeAutomatically => "charge_automatically", + SendInvoice => "send_invoice", + } + } +} + +impl std::str::FromStr for SubscriptionSchedulePhaseConfigurationCollectionMethod { + type Err = (); + fn from_str(s: &str) -> Result { + use SubscriptionSchedulePhaseConfigurationCollectionMethod::*; + match s { + "charge_automatically" => Ok(ChargeAutomatically), + "send_invoice" => Ok(SendInvoice), + _ => Err(()), + } + } +} +impl std::fmt::Display for SubscriptionSchedulePhaseConfigurationCollectionMethod { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for SubscriptionSchedulePhaseConfigurationCollectionMethod { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for SubscriptionSchedulePhaseConfigurationCollectionMethod { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for SubscriptionSchedulePhaseConfigurationCollectionMethod { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| { + serde::de::Error::custom( + "Unknown value for SubscriptionSchedulePhaseConfigurationCollectionMethod", + ) + }) + } +} +/// If the subscription schedule will prorate when transitioning to this phase. +/// Possible values are `create_prorations` and `none`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum SubscriptionSchedulePhaseConfigurationProrationBehavior { + AlwaysInvoice, + CreateProrations, + None, +} +impl SubscriptionSchedulePhaseConfigurationProrationBehavior { + pub fn as_str(self) -> &'static str { + use SubscriptionSchedulePhaseConfigurationProrationBehavior::*; + match self { + AlwaysInvoice => "always_invoice", + CreateProrations => "create_prorations", + None => "none", + } + } +} + +impl std::str::FromStr for SubscriptionSchedulePhaseConfigurationProrationBehavior { + type Err = (); + fn from_str(s: &str) -> Result { + use SubscriptionSchedulePhaseConfigurationProrationBehavior::*; + match s { + "always_invoice" => Ok(AlwaysInvoice), + "create_prorations" => Ok(CreateProrations), + "none" => Ok(None), + _ => Err(()), + } + } +} +impl std::fmt::Display for SubscriptionSchedulePhaseConfigurationProrationBehavior { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for SubscriptionSchedulePhaseConfigurationProrationBehavior { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for SubscriptionSchedulePhaseConfigurationProrationBehavior { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for SubscriptionSchedulePhaseConfigurationProrationBehavior { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| { + serde::de::Error::custom( + "Unknown value for SubscriptionSchedulePhaseConfigurationProrationBehavior", + ) + }) + } +} diff --git a/generated/stripe_shared/src/subscription_schedules_resource_default_settings.rs b/generated/stripe_shared/src/subscription_schedules_resource_default_settings.rs new file mode 100644 index 000000000..c83761673 --- /dev/null +++ b/generated/stripe_shared/src/subscription_schedules_resource_default_settings.rs @@ -0,0 +1,153 @@ +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct SubscriptionSchedulesResourceDefaultSettings { + /// A non-negative decimal between 0 and 100, with at most two decimal places. + /// This represents the percentage of the subscription invoice total that will be transferred to the application owner's Stripe account during this phase of the schedule. + pub application_fee_percent: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub automatic_tax: + Option, + /// Possible values are `phase_start` or `automatic`. + /// If `phase_start` then billing cycle anchor of the subscription is set to the start of the phase when entering the phase. + /// If `automatic` then the billing cycle anchor is automatically modified as needed when entering the phase. + /// For more information, see the billing cycle [documentation](https://stripe.com/docs/billing/subscriptions/billing-cycle). + pub billing_cycle_anchor: SubscriptionSchedulesResourceDefaultSettingsBillingCycleAnchor, + /// Define thresholds at which an invoice will be sent, and the subscription advanced to a new billing period. + pub billing_thresholds: Option, + /// Either `charge_automatically`, or `send_invoice`. + /// When charging automatically, Stripe will attempt to pay the underlying subscription at the end of each billing cycle using the default source attached to the customer. + /// When sending an invoice, Stripe will email your customer an invoice with payment instructions and mark the subscription as `active`. + pub collection_method: Option, + /// ID of the default payment method for the subscription schedule. + /// If not set, invoices will use the default payment method in the customer's invoice settings. + pub default_payment_method: Option>, + /// Subscription description, meant to be displayable to the customer. + /// Use this field to optionally store an explanation of the subscription for rendering in Stripe surfaces and certain local payment methods UIs. + pub description: Option, + pub invoice_settings: stripe_shared::InvoiceSettingSubscriptionScheduleSetting, + /// The account (if any) the charge was made on behalf of for charges associated with the schedule's subscription. + /// See the Connect documentation for details. + pub on_behalf_of: Option>, + /// The account (if any) the associated subscription's payments will be attributed to for tax reporting, and where funds from each payment will be transferred to for each of the subscription's invoices. + pub transfer_data: Option, +} +/// Possible values are `phase_start` or `automatic`. +/// If `phase_start` then billing cycle anchor of the subscription is set to the start of the phase when entering the phase. +/// If `automatic` then the billing cycle anchor is automatically modified as needed when entering the phase. +/// For more information, see the billing cycle [documentation](https://stripe.com/docs/billing/subscriptions/billing-cycle). +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum SubscriptionSchedulesResourceDefaultSettingsBillingCycleAnchor { + Automatic, + PhaseStart, +} +impl SubscriptionSchedulesResourceDefaultSettingsBillingCycleAnchor { + pub fn as_str(self) -> &'static str { + use SubscriptionSchedulesResourceDefaultSettingsBillingCycleAnchor::*; + match self { + Automatic => "automatic", + PhaseStart => "phase_start", + } + } +} + +impl std::str::FromStr for SubscriptionSchedulesResourceDefaultSettingsBillingCycleAnchor { + type Err = (); + fn from_str(s: &str) -> Result { + use SubscriptionSchedulesResourceDefaultSettingsBillingCycleAnchor::*; + match s { + "automatic" => Ok(Automatic), + "phase_start" => Ok(PhaseStart), + _ => Err(()), + } + } +} +impl std::fmt::Display for SubscriptionSchedulesResourceDefaultSettingsBillingCycleAnchor { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for SubscriptionSchedulesResourceDefaultSettingsBillingCycleAnchor { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for SubscriptionSchedulesResourceDefaultSettingsBillingCycleAnchor { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> + for SubscriptionSchedulesResourceDefaultSettingsBillingCycleAnchor +{ + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| { + serde::de::Error::custom( + "Unknown value for SubscriptionSchedulesResourceDefaultSettingsBillingCycleAnchor", + ) + }) + } +} +/// Either `charge_automatically`, or `send_invoice`. +/// When charging automatically, Stripe will attempt to pay the underlying subscription at the end of each billing cycle using the default source attached to the customer. +/// When sending an invoice, Stripe will email your customer an invoice with payment instructions and mark the subscription as `active`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum SubscriptionSchedulesResourceDefaultSettingsCollectionMethod { + ChargeAutomatically, + SendInvoice, +} +impl SubscriptionSchedulesResourceDefaultSettingsCollectionMethod { + pub fn as_str(self) -> &'static str { + use SubscriptionSchedulesResourceDefaultSettingsCollectionMethod::*; + match self { + ChargeAutomatically => "charge_automatically", + SendInvoice => "send_invoice", + } + } +} + +impl std::str::FromStr for SubscriptionSchedulesResourceDefaultSettingsCollectionMethod { + type Err = (); + fn from_str(s: &str) -> Result { + use SubscriptionSchedulesResourceDefaultSettingsCollectionMethod::*; + match s { + "charge_automatically" => Ok(ChargeAutomatically), + "send_invoice" => Ok(SendInvoice), + _ => Err(()), + } + } +} +impl std::fmt::Display for SubscriptionSchedulesResourceDefaultSettingsCollectionMethod { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for SubscriptionSchedulesResourceDefaultSettingsCollectionMethod { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for SubscriptionSchedulesResourceDefaultSettingsCollectionMethod { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for SubscriptionSchedulesResourceDefaultSettingsCollectionMethod { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| { + serde::de::Error::custom( + "Unknown value for SubscriptionSchedulesResourceDefaultSettingsCollectionMethod", + ) + }) + } +} diff --git a/generated/stripe_shared/src/subscription_schedules_resource_default_settings_automatic_tax.rs b/generated/stripe_shared/src/subscription_schedules_resource_default_settings_automatic_tax.rs new file mode 100644 index 000000000..78b1fd762 --- /dev/null +++ b/generated/stripe_shared/src/subscription_schedules_resource_default_settings_automatic_tax.rs @@ -0,0 +1,9 @@ +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct SubscriptionSchedulesResourceDefaultSettingsAutomaticTax { + /// Whether Stripe automatically computes tax on invoices created during this phase. + pub enabled: bool, + /// The account that's liable for tax. + /// If set, the business address and tax registrations required to perform the tax calculation are loaded from this account. + /// The tax transaction is returned in the report of the connected account. + pub liability: Option, +} diff --git a/src/resources/generated/subscription_transfer_data.rs b/generated/stripe_shared/src/subscription_transfer_data.rs similarity index 52% rename from src/resources/generated/subscription_transfer_data.rs rename to generated/stripe_shared/src/subscription_transfer_data.rs index 15cc9ddfe..07682dcc7 100644 --- a/src/resources/generated/subscription_transfer_data.rs +++ b/generated/stripe_shared/src/subscription_transfer_data.rs @@ -1,21 +1,9 @@ -// ====================================== -// This file was automatically generated. -// ====================================== - -use crate::params::{Expandable}; -use crate::resources::{Account}; -use serde::{Deserialize, Serialize}; - -/// The resource representing a Stripe "SubscriptionTransferData". -#[derive(Clone, Debug, Default, Deserialize, Serialize)] +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] pub struct SubscriptionTransferData { - /// A non-negative decimal between 0 and 100, with at most two decimal places. - /// /// This represents the percentage of the subscription invoice total that will be transferred to the destination account. /// By default, the entire amount is transferred to the destination. pub amount_percent: Option, - /// The account where funds from the payment will be transferred to upon payment success. - pub destination: Expandable, + pub destination: stripe_types::Expandable, } diff --git a/generated/stripe_shared/src/subscriptions_resource_billing_cycle_anchor_config.rs b/generated/stripe_shared/src/subscriptions_resource_billing_cycle_anchor_config.rs new file mode 100644 index 000000000..f1b2614f9 --- /dev/null +++ b/generated/stripe_shared/src/subscriptions_resource_billing_cycle_anchor_config.rs @@ -0,0 +1,13 @@ +#[derive(Copy, Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct SubscriptionsResourceBillingCycleAnchorConfig { + /// The day of the month of the billing_cycle_anchor. + pub day_of_month: i64, + /// The hour of the day of the billing_cycle_anchor. + pub hour: Option, + /// The minute of the hour of the billing_cycle_anchor. + pub minute: Option, + /// The month to start full cycle billing periods. + pub month: Option, + /// The second of the minute of the billing_cycle_anchor. + pub second: Option, +} diff --git a/generated/stripe_shared/src/subscriptions_resource_pause_collection.rs b/generated/stripe_shared/src/subscriptions_resource_pause_collection.rs new file mode 100644 index 000000000..0ff0713ff --- /dev/null +++ b/generated/stripe_shared/src/subscriptions_resource_pause_collection.rs @@ -0,0 +1,71 @@ +/// The Pause Collection settings determine how we will pause collection for this subscription and for how long the subscription. +/// should be paused. +#[derive(Copy, Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct SubscriptionsResourcePauseCollection { + /// The payment collection behavior for this subscription while paused. + /// One of `keep_as_draft`, `mark_uncollectible`, or `void`. + pub behavior: SubscriptionsResourcePauseCollectionBehavior, + /// The time after which the subscription will resume collecting payments. + pub resumes_at: Option, +} +/// The payment collection behavior for this subscription while paused. +/// One of `keep_as_draft`, `mark_uncollectible`, or `void`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum SubscriptionsResourcePauseCollectionBehavior { + KeepAsDraft, + MarkUncollectible, + Void, +} +impl SubscriptionsResourcePauseCollectionBehavior { + pub fn as_str(self) -> &'static str { + use SubscriptionsResourcePauseCollectionBehavior::*; + match self { + KeepAsDraft => "keep_as_draft", + MarkUncollectible => "mark_uncollectible", + Void => "void", + } + } +} + +impl std::str::FromStr for SubscriptionsResourcePauseCollectionBehavior { + type Err = (); + fn from_str(s: &str) -> Result { + use SubscriptionsResourcePauseCollectionBehavior::*; + match s { + "keep_as_draft" => Ok(KeepAsDraft), + "mark_uncollectible" => Ok(MarkUncollectible), + "void" => Ok(Void), + _ => Err(()), + } + } +} +impl std::fmt::Display for SubscriptionsResourcePauseCollectionBehavior { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for SubscriptionsResourcePauseCollectionBehavior { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for SubscriptionsResourcePauseCollectionBehavior { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for SubscriptionsResourcePauseCollectionBehavior { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| { + serde::de::Error::custom( + "Unknown value for SubscriptionsResourcePauseCollectionBehavior", + ) + }) + } +} diff --git a/generated/stripe_shared/src/subscriptions_resource_payment_method_options.rs b/generated/stripe_shared/src/subscriptions_resource_payment_method_options.rs new file mode 100644 index 000000000..57e8ea013 --- /dev/null +++ b/generated/stripe_shared/src/subscriptions_resource_payment_method_options.rs @@ -0,0 +1,15 @@ +#[derive(Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct SubscriptionsResourcePaymentMethodOptions { + /// This sub-hash contains details about the Canadian pre-authorized debit payment method options to pass to invoices created by the subscription. + pub acss_debit: Option, + /// This sub-hash contains details about the Bancontact payment method options to pass to invoices created by the subscription. + pub bancontact: Option, + /// This sub-hash contains details about the Card payment method options to pass to invoices created by the subscription. + pub card: Option, + /// This sub-hash contains details about the Bank transfer payment method options to pass to invoices created by the subscription. + pub customer_balance: Option, + /// This sub-hash contains details about the Konbini payment method options to pass to invoices created by the subscription. + pub konbini: Option, + /// This sub-hash contains details about the ACH direct debit payment method options to pass to invoices created by the subscription. + pub us_bank_account: Option, +} diff --git a/generated/stripe_shared/src/subscriptions_resource_payment_settings.rs b/generated/stripe_shared/src/subscriptions_resource_payment_settings.rs new file mode 100644 index 000000000..2f53272f5 --- /dev/null +++ b/generated/stripe_shared/src/subscriptions_resource_payment_settings.rs @@ -0,0 +1,201 @@ +#[derive(Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct SubscriptionsResourcePaymentSettings { + /// Payment-method-specific configuration to provide to invoices created by the subscription. + pub payment_method_options: Option, + /// The list of payment method types to provide to every invoice created by the subscription. + /// If not set, Stripe attempts to automatically determine the types to use by looking at the invoice’s default payment method, the subscription’s default payment method, the customer’s default payment method, and your [invoice template settings](https://dashboard.stripe.com/settings/billing/invoice). + pub payment_method_types: Option>, + /// Either `off`, or `on_subscription`. + /// With `on_subscription` Stripe updates `subscription.default_payment_method` when a subscription payment succeeds. + pub save_default_payment_method: + Option, +} +/// The list of payment method types to provide to every invoice created by the subscription. +/// If not set, Stripe attempts to automatically determine the types to use by looking at the invoice’s default payment method, the subscription’s default payment method, the customer’s default payment method, and your [invoice template settings](https://dashboard.stripe.com/settings/billing/invoice). +#[derive(Copy, Clone, Eq, PartialEq)] +#[non_exhaustive] +pub enum SubscriptionsResourcePaymentSettingsPaymentMethodTypes { + AchCreditTransfer, + AchDebit, + AcssDebit, + AuBecsDebit, + BacsDebit, + Bancontact, + Boleto, + Card, + Cashapp, + CustomerBalance, + Eps, + Fpx, + Giropay, + Grabpay, + Ideal, + Konbini, + Link, + P24, + Paynow, + Paypal, + Promptpay, + SepaCreditTransfer, + SepaDebit, + Sofort, + UsBankAccount, + WechatPay, + /// An unrecognized value from Stripe. Should not be used as a request parameter. + Unknown, +} +impl SubscriptionsResourcePaymentSettingsPaymentMethodTypes { + pub fn as_str(self) -> &'static str { + use SubscriptionsResourcePaymentSettingsPaymentMethodTypes::*; + match self { + AchCreditTransfer => "ach_credit_transfer", + AchDebit => "ach_debit", + AcssDebit => "acss_debit", + AuBecsDebit => "au_becs_debit", + BacsDebit => "bacs_debit", + Bancontact => "bancontact", + Boleto => "boleto", + Card => "card", + Cashapp => "cashapp", + CustomerBalance => "customer_balance", + Eps => "eps", + Fpx => "fpx", + Giropay => "giropay", + Grabpay => "grabpay", + Ideal => "ideal", + Konbini => "konbini", + Link => "link", + P24 => "p24", + Paynow => "paynow", + Paypal => "paypal", + Promptpay => "promptpay", + SepaCreditTransfer => "sepa_credit_transfer", + SepaDebit => "sepa_debit", + Sofort => "sofort", + UsBankAccount => "us_bank_account", + WechatPay => "wechat_pay", + Unknown => "unknown", + } + } +} + +impl std::str::FromStr for SubscriptionsResourcePaymentSettingsPaymentMethodTypes { + type Err = (); + fn from_str(s: &str) -> Result { + use SubscriptionsResourcePaymentSettingsPaymentMethodTypes::*; + match s { + "ach_credit_transfer" => Ok(AchCreditTransfer), + "ach_debit" => Ok(AchDebit), + "acss_debit" => Ok(AcssDebit), + "au_becs_debit" => Ok(AuBecsDebit), + "bacs_debit" => Ok(BacsDebit), + "bancontact" => Ok(Bancontact), + "boleto" => Ok(Boleto), + "card" => Ok(Card), + "cashapp" => Ok(Cashapp), + "customer_balance" => Ok(CustomerBalance), + "eps" => Ok(Eps), + "fpx" => Ok(Fpx), + "giropay" => Ok(Giropay), + "grabpay" => Ok(Grabpay), + "ideal" => Ok(Ideal), + "konbini" => Ok(Konbini), + "link" => Ok(Link), + "p24" => Ok(P24), + "paynow" => Ok(Paynow), + "paypal" => Ok(Paypal), + "promptpay" => Ok(Promptpay), + "sepa_credit_transfer" => Ok(SepaCreditTransfer), + "sepa_debit" => Ok(SepaDebit), + "sofort" => Ok(Sofort), + "us_bank_account" => Ok(UsBankAccount), + "wechat_pay" => Ok(WechatPay), + _ => Err(()), + } + } +} +impl std::fmt::Display for SubscriptionsResourcePaymentSettingsPaymentMethodTypes { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for SubscriptionsResourcePaymentSettingsPaymentMethodTypes { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for SubscriptionsResourcePaymentSettingsPaymentMethodTypes { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for SubscriptionsResourcePaymentSettingsPaymentMethodTypes { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Ok(Self::from_str(&s) + .unwrap_or(SubscriptionsResourcePaymentSettingsPaymentMethodTypes::Unknown)) + } +} +/// Either `off`, or `on_subscription`. +/// With `on_subscription` Stripe updates `subscription.default_payment_method` when a subscription payment succeeds. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum SubscriptionsResourcePaymentSettingsSaveDefaultPaymentMethod { + Off, + OnSubscription, +} +impl SubscriptionsResourcePaymentSettingsSaveDefaultPaymentMethod { + pub fn as_str(self) -> &'static str { + use SubscriptionsResourcePaymentSettingsSaveDefaultPaymentMethod::*; + match self { + Off => "off", + OnSubscription => "on_subscription", + } + } +} + +impl std::str::FromStr for SubscriptionsResourcePaymentSettingsSaveDefaultPaymentMethod { + type Err = (); + fn from_str(s: &str) -> Result { + use SubscriptionsResourcePaymentSettingsSaveDefaultPaymentMethod::*; + match s { + "off" => Ok(Off), + "on_subscription" => Ok(OnSubscription), + _ => Err(()), + } + } +} +impl std::fmt::Display for SubscriptionsResourcePaymentSettingsSaveDefaultPaymentMethod { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for SubscriptionsResourcePaymentSettingsSaveDefaultPaymentMethod { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for SubscriptionsResourcePaymentSettingsSaveDefaultPaymentMethod { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for SubscriptionsResourcePaymentSettingsSaveDefaultPaymentMethod { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| { + serde::de::Error::custom( + "Unknown value for SubscriptionsResourcePaymentSettingsSaveDefaultPaymentMethod", + ) + }) + } +} diff --git a/generated/stripe_shared/src/subscriptions_resource_pending_update.rs b/generated/stripe_shared/src/subscriptions_resource_pending_update.rs new file mode 100644 index 000000000..ef129a0dc --- /dev/null +++ b/generated/stripe_shared/src/subscriptions_resource_pending_update.rs @@ -0,0 +1,19 @@ +/// Pending Updates store the changes pending from a previous update that will be applied +/// to the Subscription upon successful payment. +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct SubscriptionsResourcePendingUpdate { + /// If the update is applied, determines the date of the first full invoice, and, for plans with `month` or `year` intervals, the day of the month for subsequent invoices. + /// The timestamp is in UTC format. + pub billing_cycle_anchor: Option, + /// The point after which the changes reflected by this update will be discarded and no longer applied. + pub expires_at: stripe_types::Timestamp, + /// List of subscription items, each with an attached plan, that will be set if the update is applied. + pub subscription_items: Option>, + /// Unix timestamp representing the end of the trial period the customer will get before being charged for the first time, if the update is applied. + pub trial_end: Option, + /// Indicates if a plan's `trial_period_days` should be applied to the subscription. + /// Setting `trial_end` per subscription is preferred, and this defaults to `false`. + /// Setting this flag to `true` together with `trial_end` is not allowed. + /// See [Using trial periods on subscriptions](https://stripe.com/docs/billing/subscriptions/trials) to learn more. + pub trial_from_plan: Option, +} diff --git a/generated/stripe_shared/src/subscriptions_trials_resource_end_behavior.rs b/generated/stripe_shared/src/subscriptions_trials_resource_end_behavior.rs new file mode 100644 index 000000000..8fded3031 --- /dev/null +++ b/generated/stripe_shared/src/subscriptions_trials_resource_end_behavior.rs @@ -0,0 +1,66 @@ +/// Defines how a subscription behaves when a free trial ends. +#[derive(Copy, Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct SubscriptionsTrialsResourceEndBehavior { + /// Indicates how the subscription should change when the trial ends if the user did not provide a payment method. + pub missing_payment_method: SubscriptionsTrialsResourceEndBehaviorMissingPaymentMethod, +} +/// Indicates how the subscription should change when the trial ends if the user did not provide a payment method. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum SubscriptionsTrialsResourceEndBehaviorMissingPaymentMethod { + Cancel, + CreateInvoice, + Pause, +} +impl SubscriptionsTrialsResourceEndBehaviorMissingPaymentMethod { + pub fn as_str(self) -> &'static str { + use SubscriptionsTrialsResourceEndBehaviorMissingPaymentMethod::*; + match self { + Cancel => "cancel", + CreateInvoice => "create_invoice", + Pause => "pause", + } + } +} + +impl std::str::FromStr for SubscriptionsTrialsResourceEndBehaviorMissingPaymentMethod { + type Err = (); + fn from_str(s: &str) -> Result { + use SubscriptionsTrialsResourceEndBehaviorMissingPaymentMethod::*; + match s { + "cancel" => Ok(Cancel), + "create_invoice" => Ok(CreateInvoice), + "pause" => Ok(Pause), + _ => Err(()), + } + } +} +impl std::fmt::Display for SubscriptionsTrialsResourceEndBehaviorMissingPaymentMethod { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for SubscriptionsTrialsResourceEndBehaviorMissingPaymentMethod { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for SubscriptionsTrialsResourceEndBehaviorMissingPaymentMethod { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for SubscriptionsTrialsResourceEndBehaviorMissingPaymentMethod { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| { + serde::de::Error::custom( + "Unknown value for SubscriptionsTrialsResourceEndBehaviorMissingPaymentMethod", + ) + }) + } +} diff --git a/generated/stripe_shared/src/subscriptions_trials_resource_trial_settings.rs b/generated/stripe_shared/src/subscriptions_trials_resource_trial_settings.rs new file mode 100644 index 000000000..c83a12296 --- /dev/null +++ b/generated/stripe_shared/src/subscriptions_trials_resource_trial_settings.rs @@ -0,0 +1,5 @@ +/// Configures how this subscription behaves during the trial period. +#[derive(Copy, Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct SubscriptionsTrialsResourceTrialSettings { + pub end_behavior: stripe_shared::SubscriptionsTrialsResourceEndBehavior, +} diff --git a/generated/stripe_shared/src/tax_code.rs b/generated/stripe_shared/src/tax_code.rs new file mode 100644 index 000000000..a1df43358 --- /dev/null +++ b/generated/stripe_shared/src/tax_code.rs @@ -0,0 +1,19 @@ +/// [Tax codes](https://stripe.com/docs/tax/tax-categories) classify goods and services for tax purposes. +/// +/// For more details see <>. +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct TaxCode { + /// A detailed description of which types of products the tax code represents. + pub description: String, + /// Unique identifier for the object. + pub id: stripe_shared::TaxCodeId, + /// A short name for the tax code. + pub name: String, +} +impl stripe_types::Object for TaxCode { + type Id = stripe_shared::TaxCodeId; + fn id(&self) -> &Self::Id { + &self.id + } +} +stripe_types::def_id!(TaxCodeId, "txcd_"); diff --git a/generated/stripe_shared/src/tax_deducted_at_source.rs b/generated/stripe_shared/src/tax_deducted_at_source.rs new file mode 100644 index 000000000..9e9fd08f7 --- /dev/null +++ b/generated/stripe_shared/src/tax_deducted_at_source.rs @@ -0,0 +1,20 @@ +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct TaxDeductedAtSource { + /// Unique identifier for the object. + pub id: stripe_shared::TaxDeductedAtSourceId, + /// The end of the invoicing period. + /// This TDS applies to Stripe fees collected during this invoicing period. + pub period_end: stripe_types::Timestamp, + /// The start of the invoicing period. + /// This TDS applies to Stripe fees collected during this invoicing period. + pub period_start: stripe_types::Timestamp, + /// The TAN that was supplied to Stripe when TDS was assessed + pub tax_deduction_account_number: String, +} +impl stripe_types::Object for TaxDeductedAtSource { + type Id = stripe_shared::TaxDeductedAtSourceId; + fn id(&self) -> &Self::Id { + &self.id + } +} +stripe_types::def_id!(TaxDeductedAtSourceId, "itds_"); diff --git a/generated/stripe_shared/src/tax_i_ds_owner.rs b/generated/stripe_shared/src/tax_i_ds_owner.rs new file mode 100644 index 000000000..79a1ffa55 --- /dev/null +++ b/generated/stripe_shared/src/tax_i_ds_owner.rs @@ -0,0 +1,75 @@ +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct TaxIDsOwner { + /// The account being referenced when `type` is `account`. + #[serde(skip_serializing_if = "Option::is_none")] + pub account: Option>, + /// The Connect Application being referenced when `type` is `application`. + #[serde(skip_serializing_if = "Option::is_none")] + pub application: Option>, + /// The customer being referenced when `type` is `customer`. + #[serde(skip_serializing_if = "Option::is_none")] + pub customer: Option>, + /// Type of owner referenced. + #[serde(rename = "type")] + pub type_: TaxIDsOwnerType, +} +/// Type of owner referenced. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum TaxIDsOwnerType { + Account, + Application, + Customer, + Self_, +} +impl TaxIDsOwnerType { + pub fn as_str(self) -> &'static str { + use TaxIDsOwnerType::*; + match self { + Account => "account", + Application => "application", + Customer => "customer", + Self_ => "self", + } + } +} + +impl std::str::FromStr for TaxIDsOwnerType { + type Err = (); + fn from_str(s: &str) -> Result { + use TaxIDsOwnerType::*; + match s { + "account" => Ok(Account), + "application" => Ok(Application), + "customer" => Ok(Customer), + "self" => Ok(Self_), + _ => Err(()), + } + } +} +impl std::fmt::Display for TaxIDsOwnerType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for TaxIDsOwnerType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for TaxIDsOwnerType { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for TaxIDsOwnerType { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s) + .map_err(|_| serde::de::Error::custom("Unknown value for TaxIDsOwnerType")) + } +} diff --git a/generated/stripe_shared/src/tax_id.rs b/generated/stripe_shared/src/tax_id.rs new file mode 100644 index 000000000..d8bceb5c0 --- /dev/null +++ b/generated/stripe_shared/src/tax_id.rs @@ -0,0 +1,286 @@ +/// You can add one or multiple tax IDs to a [customer](https://stripe.com/docs/api/customers) or account. +/// Customer and account tax IDs get displayed on related invoices and credit notes. +/// +/// Related guides: [Customer tax identification numbers](https://stripe.com/docs/billing/taxes/tax-ids), [Account tax IDs](https://stripe.com/docs/invoicing/connect#account-tax-ids). +/// +/// For more details see <>. +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct TaxId { + /// Two-letter ISO code representing the country of the tax ID. + pub country: Option, + /// Time at which the object was created. Measured in seconds since the Unix epoch. + pub created: stripe_types::Timestamp, + /// ID of the customer. + pub customer: Option>, + /// Unique identifier for the object. + pub id: stripe_shared::TaxIdId, + /// Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + pub livemode: bool, + /// The account or customer the tax ID belongs to. + #[serde(skip_serializing_if = "Option::is_none")] + pub owner: Option, + /// Type of the tax ID, one of `ad_nrt`, `ae_trn`, `ar_cuit`, `au_abn`, `au_arn`, `bg_uic`, `bo_tin`, `br_cnpj`, `br_cpf`, `ca_bn`, `ca_gst_hst`, `ca_pst_bc`, `ca_pst_mb`, `ca_pst_sk`, `ca_qst`, `ch_vat`, `cl_tin`, `cn_tin`, `co_nit`, `cr_tin`, `do_rcn`, `ec_ruc`, `eg_tin`, `es_cif`, `eu_oss_vat`, `eu_vat`, `gb_vat`, `ge_vat`, `hk_br`, `hu_tin`, `id_npwp`, `il_vat`, `in_gst`, `is_vat`, `jp_cn`, `jp_rn`, `jp_trn`, `ke_pin`, `kr_brn`, `li_uid`, `mx_rfc`, `my_frp`, `my_itn`, `my_sst`, `no_vat`, `nz_gst`, `pe_ruc`, `ph_tin`, `ro_tin`, `rs_pib`, `ru_inn`, `ru_kpp`, `sa_vat`, `sg_gst`, `sg_uen`, `si_tin`, `sv_nit`, `th_vat`, `tr_tin`, `tw_vat`, `ua_vat`, `us_ein`, `uy_ruc`, `ve_rif`, `vn_tin`, or `za_vat`. + /// Note that some legacy tax IDs have type `unknown`. + #[serde(rename = "type")] + pub type_: TaxIdType, + /// Value of the tax ID. + pub value: String, + /// Tax ID verification information. + pub verification: Option, +} +/// Type of the tax ID, one of `ad_nrt`, `ae_trn`, `ar_cuit`, `au_abn`, `au_arn`, `bg_uic`, `bo_tin`, `br_cnpj`, `br_cpf`, `ca_bn`, `ca_gst_hst`, `ca_pst_bc`, `ca_pst_mb`, `ca_pst_sk`, `ca_qst`, `ch_vat`, `cl_tin`, `cn_tin`, `co_nit`, `cr_tin`, `do_rcn`, `ec_ruc`, `eg_tin`, `es_cif`, `eu_oss_vat`, `eu_vat`, `gb_vat`, `ge_vat`, `hk_br`, `hu_tin`, `id_npwp`, `il_vat`, `in_gst`, `is_vat`, `jp_cn`, `jp_rn`, `jp_trn`, `ke_pin`, `kr_brn`, `li_uid`, `mx_rfc`, `my_frp`, `my_itn`, `my_sst`, `no_vat`, `nz_gst`, `pe_ruc`, `ph_tin`, `ro_tin`, `rs_pib`, `ru_inn`, `ru_kpp`, `sa_vat`, `sg_gst`, `sg_uen`, `si_tin`, `sv_nit`, `th_vat`, `tr_tin`, `tw_vat`, `ua_vat`, `us_ein`, `uy_ruc`, `ve_rif`, `vn_tin`, or `za_vat`. +/// Note that some legacy tax IDs have type `unknown`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum TaxIdType { + AdNrt, + AeTrn, + ArCuit, + AuAbn, + AuArn, + BgUic, + BoTin, + BrCnpj, + BrCpf, + CaBn, + CaGstHst, + CaPstBc, + CaPstMb, + CaPstSk, + CaQst, + ChVat, + ClTin, + CnTin, + CoNit, + CrTin, + DoRcn, + EcRuc, + EgTin, + EsCif, + EuOssVat, + EuVat, + GbVat, + GeVat, + HkBr, + HuTin, + IdNpwp, + IlVat, + InGst, + IsVat, + JpCn, + JpRn, + JpTrn, + KePin, + KrBrn, + LiUid, + MxRfc, + MyFrp, + MyItn, + MySst, + NoVat, + NzGst, + PeRuc, + PhTin, + RoTin, + RsPib, + RuInn, + RuKpp, + SaVat, + SgGst, + SgUen, + SiTin, + SvNit, + ThVat, + TrTin, + TwVat, + UaVat, + Unknown, + UsEin, + UyRuc, + VeRif, + VnTin, + ZaVat, +} +impl TaxIdType { + pub fn as_str(self) -> &'static str { + use TaxIdType::*; + match self { + AdNrt => "ad_nrt", + AeTrn => "ae_trn", + ArCuit => "ar_cuit", + AuAbn => "au_abn", + AuArn => "au_arn", + BgUic => "bg_uic", + BoTin => "bo_tin", + BrCnpj => "br_cnpj", + BrCpf => "br_cpf", + CaBn => "ca_bn", + CaGstHst => "ca_gst_hst", + CaPstBc => "ca_pst_bc", + CaPstMb => "ca_pst_mb", + CaPstSk => "ca_pst_sk", + CaQst => "ca_qst", + ChVat => "ch_vat", + ClTin => "cl_tin", + CnTin => "cn_tin", + CoNit => "co_nit", + CrTin => "cr_tin", + DoRcn => "do_rcn", + EcRuc => "ec_ruc", + EgTin => "eg_tin", + EsCif => "es_cif", + EuOssVat => "eu_oss_vat", + EuVat => "eu_vat", + GbVat => "gb_vat", + GeVat => "ge_vat", + HkBr => "hk_br", + HuTin => "hu_tin", + IdNpwp => "id_npwp", + IlVat => "il_vat", + InGst => "in_gst", + IsVat => "is_vat", + JpCn => "jp_cn", + JpRn => "jp_rn", + JpTrn => "jp_trn", + KePin => "ke_pin", + KrBrn => "kr_brn", + LiUid => "li_uid", + MxRfc => "mx_rfc", + MyFrp => "my_frp", + MyItn => "my_itn", + MySst => "my_sst", + NoVat => "no_vat", + NzGst => "nz_gst", + PeRuc => "pe_ruc", + PhTin => "ph_tin", + RoTin => "ro_tin", + RsPib => "rs_pib", + RuInn => "ru_inn", + RuKpp => "ru_kpp", + SaVat => "sa_vat", + SgGst => "sg_gst", + SgUen => "sg_uen", + SiTin => "si_tin", + SvNit => "sv_nit", + ThVat => "th_vat", + TrTin => "tr_tin", + TwVat => "tw_vat", + UaVat => "ua_vat", + Unknown => "unknown", + UsEin => "us_ein", + UyRuc => "uy_ruc", + VeRif => "ve_rif", + VnTin => "vn_tin", + ZaVat => "za_vat", + } + } +} + +impl std::str::FromStr for TaxIdType { + type Err = (); + fn from_str(s: &str) -> Result { + use TaxIdType::*; + match s { + "ad_nrt" => Ok(AdNrt), + "ae_trn" => Ok(AeTrn), + "ar_cuit" => Ok(ArCuit), + "au_abn" => Ok(AuAbn), + "au_arn" => Ok(AuArn), + "bg_uic" => Ok(BgUic), + "bo_tin" => Ok(BoTin), + "br_cnpj" => Ok(BrCnpj), + "br_cpf" => Ok(BrCpf), + "ca_bn" => Ok(CaBn), + "ca_gst_hst" => Ok(CaGstHst), + "ca_pst_bc" => Ok(CaPstBc), + "ca_pst_mb" => Ok(CaPstMb), + "ca_pst_sk" => Ok(CaPstSk), + "ca_qst" => Ok(CaQst), + "ch_vat" => Ok(ChVat), + "cl_tin" => Ok(ClTin), + "cn_tin" => Ok(CnTin), + "co_nit" => Ok(CoNit), + "cr_tin" => Ok(CrTin), + "do_rcn" => Ok(DoRcn), + "ec_ruc" => Ok(EcRuc), + "eg_tin" => Ok(EgTin), + "es_cif" => Ok(EsCif), + "eu_oss_vat" => Ok(EuOssVat), + "eu_vat" => Ok(EuVat), + "gb_vat" => Ok(GbVat), + "ge_vat" => Ok(GeVat), + "hk_br" => Ok(HkBr), + "hu_tin" => Ok(HuTin), + "id_npwp" => Ok(IdNpwp), + "il_vat" => Ok(IlVat), + "in_gst" => Ok(InGst), + "is_vat" => Ok(IsVat), + "jp_cn" => Ok(JpCn), + "jp_rn" => Ok(JpRn), + "jp_trn" => Ok(JpTrn), + "ke_pin" => Ok(KePin), + "kr_brn" => Ok(KrBrn), + "li_uid" => Ok(LiUid), + "mx_rfc" => Ok(MxRfc), + "my_frp" => Ok(MyFrp), + "my_itn" => Ok(MyItn), + "my_sst" => Ok(MySst), + "no_vat" => Ok(NoVat), + "nz_gst" => Ok(NzGst), + "pe_ruc" => Ok(PeRuc), + "ph_tin" => Ok(PhTin), + "ro_tin" => Ok(RoTin), + "rs_pib" => Ok(RsPib), + "ru_inn" => Ok(RuInn), + "ru_kpp" => Ok(RuKpp), + "sa_vat" => Ok(SaVat), + "sg_gst" => Ok(SgGst), + "sg_uen" => Ok(SgUen), + "si_tin" => Ok(SiTin), + "sv_nit" => Ok(SvNit), + "th_vat" => Ok(ThVat), + "tr_tin" => Ok(TrTin), + "tw_vat" => Ok(TwVat), + "ua_vat" => Ok(UaVat), + "unknown" => Ok(Unknown), + "us_ein" => Ok(UsEin), + "uy_ruc" => Ok(UyRuc), + "ve_rif" => Ok(VeRif), + "vn_tin" => Ok(VnTin), + "za_vat" => Ok(ZaVat), + _ => Err(()), + } + } +} +impl std::fmt::Display for TaxIdType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for TaxIdType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for TaxIdType { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for TaxIdType { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for TaxIdType")) + } +} +impl stripe_types::Object for TaxId { + type Id = stripe_shared::TaxIdId; + fn id(&self) -> &Self::Id { + &self.id + } +} +stripe_types::def_id!(TaxIdId, "txi_" | "atxi_"); diff --git a/generated/stripe_shared/src/tax_id_verification.rs b/generated/stripe_shared/src/tax_id_verification.rs new file mode 100644 index 000000000..2b50c88d2 --- /dev/null +++ b/generated/stripe_shared/src/tax_id_verification.rs @@ -0,0 +1,69 @@ +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct TaxIdVerification { + /// Verification status, one of `pending`, `verified`, `unverified`, or `unavailable`. + pub status: TaxIdVerificationStatus, + /// Verified address. + pub verified_address: Option, + /// Verified name. + pub verified_name: Option, +} +/// Verification status, one of `pending`, `verified`, `unverified`, or `unavailable`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum TaxIdVerificationStatus { + Pending, + Unavailable, + Unverified, + Verified, +} +impl TaxIdVerificationStatus { + pub fn as_str(self) -> &'static str { + use TaxIdVerificationStatus::*; + match self { + Pending => "pending", + Unavailable => "unavailable", + Unverified => "unverified", + Verified => "verified", + } + } +} + +impl std::str::FromStr for TaxIdVerificationStatus { + type Err = (); + fn from_str(s: &str) -> Result { + use TaxIdVerificationStatus::*; + match s { + "pending" => Ok(Pending), + "unavailable" => Ok(Unavailable), + "unverified" => Ok(Unverified), + "verified" => Ok(Verified), + _ => Err(()), + } + } +} +impl std::fmt::Display for TaxIdVerificationStatus { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for TaxIdVerificationStatus { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for TaxIdVerificationStatus { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for TaxIdVerificationStatus { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s) + .map_err(|_| serde::de::Error::custom("Unknown value for TaxIdVerificationStatus")) + } +} diff --git a/generated/stripe_shared/src/tax_rate.rs b/generated/stripe_shared/src/tax_rate.rs new file mode 100644 index 000000000..d45339be6 --- /dev/null +++ b/generated/stripe_shared/src/tax_rate.rs @@ -0,0 +1,212 @@ +/// Tax rates can be applied to [invoices](https://stripe.com/docs/billing/invoices/tax-rates), [subscriptions](https://stripe.com/docs/billing/subscriptions/taxes) and [Checkout Sessions](https://stripe.com/docs/payments/checkout/set-up-a-subscription#tax-rates) to collect tax. +/// +/// Related guide: [Tax rates](https://stripe.com/docs/billing/taxes/tax-rates) +/// +/// For more details see <>. +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct TaxRate { + /// Defaults to `true`. + /// When set to `false`, this tax rate cannot be used with new applications or Checkout Sessions, but will still work for subscriptions and invoices that already have it set. + pub active: bool, + /// Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). + pub country: Option, + /// Time at which the object was created. Measured in seconds since the Unix epoch. + pub created: stripe_types::Timestamp, + /// An arbitrary string attached to the tax rate for your internal use only. + /// It will not be visible to your customers. + pub description: Option, + /// The display name of the tax rates as it will appear to your customer on their receipt email, PDF, and the hosted invoice page. + pub display_name: String, + /// Actual/effective tax rate percentage out of 100. + /// For tax calculations with automatic_tax[enabled]=true,. + /// this percentage reflects the rate actually used to calculate tax based on the product's taxability + /// and whether the user is registered to collect taxes in the corresponding jurisdiction. + pub effective_percentage: Option, + /// Unique identifier for the object. + pub id: stripe_shared::TaxRateId, + /// This specifies if the tax rate is inclusive or exclusive. + pub inclusive: bool, + /// The jurisdiction for the tax rate. + /// You can use this label field for tax reporting purposes. + /// It also appears on your customer’s invoice. + pub jurisdiction: Option, + /// The level of the jurisdiction that imposes this tax rate. + /// Will be `null` for manually defined tax rates. + pub jurisdiction_level: Option, + /// Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + pub livemode: bool, + /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. + /// This can be useful for storing additional information about the object in a structured format. + pub metadata: Option>, + /// Tax rate percentage out of 100. + /// For tax calculations with automatic_tax[enabled]=true, this percentage includes the statutory tax rate of non-taxable jurisdictions. + pub percentage: f64, + /// [ISO 3166-2 subdivision code](https://en.wikipedia.org/wiki/ISO_3166-2:US), without country prefix. + /// For example, "NY" for New York, United States. + pub state: Option, + /// The high-level tax type, such as `vat` or `sales_tax`. + pub tax_type: Option, +} +/// The level of the jurisdiction that imposes this tax rate. +/// Will be `null` for manually defined tax rates. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum TaxRateJurisdictionLevel { + City, + Country, + County, + District, + Multiple, + State, +} +impl TaxRateJurisdictionLevel { + pub fn as_str(self) -> &'static str { + use TaxRateJurisdictionLevel::*; + match self { + City => "city", + Country => "country", + County => "county", + District => "district", + Multiple => "multiple", + State => "state", + } + } +} + +impl std::str::FromStr for TaxRateJurisdictionLevel { + type Err = (); + fn from_str(s: &str) -> Result { + use TaxRateJurisdictionLevel::*; + match s { + "city" => Ok(City), + "country" => Ok(Country), + "county" => Ok(County), + "district" => Ok(District), + "multiple" => Ok(Multiple), + "state" => Ok(State), + _ => Err(()), + } + } +} +impl std::fmt::Display for TaxRateJurisdictionLevel { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for TaxRateJurisdictionLevel { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for TaxRateJurisdictionLevel { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for TaxRateJurisdictionLevel { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s) + .map_err(|_| serde::de::Error::custom("Unknown value for TaxRateJurisdictionLevel")) + } +} +impl stripe_types::Object for TaxRate { + type Id = stripe_shared::TaxRateId; + fn id(&self) -> &Self::Id { + &self.id + } +} +stripe_types::def_id!(TaxRateId, "txr_"); +#[derive(Copy, Clone, Eq, PartialEq)] +#[non_exhaustive] +pub enum TaxRateTaxType { + AmusementTax, + CommunicationsTax, + Gst, + Hst, + Igst, + Jct, + LeaseTax, + Pst, + Qst, + Rst, + SalesTax, + ServiceTax, + Vat, + /// An unrecognized value from Stripe. Should not be used as a request parameter. + Unknown, +} +impl TaxRateTaxType { + pub fn as_str(self) -> &'static str { + use TaxRateTaxType::*; + match self { + AmusementTax => "amusement_tax", + CommunicationsTax => "communications_tax", + Gst => "gst", + Hst => "hst", + Igst => "igst", + Jct => "jct", + LeaseTax => "lease_tax", + Pst => "pst", + Qst => "qst", + Rst => "rst", + SalesTax => "sales_tax", + ServiceTax => "service_tax", + Vat => "vat", + Unknown => "unknown", + } + } +} + +impl std::str::FromStr for TaxRateTaxType { + type Err = (); + fn from_str(s: &str) -> Result { + use TaxRateTaxType::*; + match s { + "amusement_tax" => Ok(AmusementTax), + "communications_tax" => Ok(CommunicationsTax), + "gst" => Ok(Gst), + "hst" => Ok(Hst), + "igst" => Ok(Igst), + "jct" => Ok(Jct), + "lease_tax" => Ok(LeaseTax), + "pst" => Ok(Pst), + "qst" => Ok(Qst), + "rst" => Ok(Rst), + "sales_tax" => Ok(SalesTax), + "service_tax" => Ok(ServiceTax), + "vat" => Ok(Vat), + _ => Err(()), + } + } +} +impl std::fmt::Display for TaxRateTaxType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for TaxRateTaxType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for TaxRateTaxType { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for TaxRateTaxType { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Ok(Self::from_str(&s).unwrap_or(TaxRateTaxType::Unknown)) + } +} diff --git a/generated/stripe_shared/src/test_helpers_test_clock.rs b/generated/stripe_shared/src/test_helpers_test_clock.rs new file mode 100644 index 000000000..af1af728e --- /dev/null +++ b/generated/stripe_shared/src/test_helpers_test_clock.rs @@ -0,0 +1,86 @@ +/// A test clock enables deterministic control over objects in testmode. +/// With a test clock, you can create. +/// objects at a frozen time in the past or future, and advance to a specific future time to observe webhooks and state changes. +/// After the clock advances,. +/// you can either validate the current state of your scenario (and test your assumptions), change the current state of your scenario (and test more complex scenarios), or keep advancing forward in time. +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct TestHelpersTestClock { + /// Time at which the object was created. Measured in seconds since the Unix epoch. + pub created: stripe_types::Timestamp, + /// Time at which this clock is scheduled to auto delete. + pub deletes_after: stripe_types::Timestamp, + /// Time at which all objects belonging to this clock are frozen. + pub frozen_time: stripe_types::Timestamp, + /// Unique identifier for the object. + pub id: stripe_shared::TestHelpersTestClockId, + /// Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + pub livemode: bool, + /// The custom name supplied at creation. + pub name: Option, + /// The status of the Test Clock. + pub status: TestHelpersTestClockStatus, +} +/// The status of the Test Clock. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum TestHelpersTestClockStatus { + Advancing, + InternalFailure, + Ready, +} +impl TestHelpersTestClockStatus { + pub fn as_str(self) -> &'static str { + use TestHelpersTestClockStatus::*; + match self { + Advancing => "advancing", + InternalFailure => "internal_failure", + Ready => "ready", + } + } +} + +impl std::str::FromStr for TestHelpersTestClockStatus { + type Err = (); + fn from_str(s: &str) -> Result { + use TestHelpersTestClockStatus::*; + match s { + "advancing" => Ok(Advancing), + "internal_failure" => Ok(InternalFailure), + "ready" => Ok(Ready), + _ => Err(()), + } + } +} +impl std::fmt::Display for TestHelpersTestClockStatus { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for TestHelpersTestClockStatus { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for TestHelpersTestClockStatus { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for TestHelpersTestClockStatus { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s) + .map_err(|_| serde::de::Error::custom("Unknown value for TestHelpersTestClockStatus")) + } +} +impl stripe_types::Object for TestHelpersTestClock { + type Id = stripe_shared::TestHelpersTestClockId; + fn id(&self) -> &Self::Id { + &self.id + } +} +stripe_types::def_id!(TestHelpersTestClockId, "clock_"); diff --git a/generated/stripe_shared/src/three_d_secure_details.rs b/generated/stripe_shared/src/three_d_secure_details.rs new file mode 100644 index 000000000..b61bbeab4 --- /dev/null +++ b/generated/stripe_shared/src/three_d_secure_details.rs @@ -0,0 +1,336 @@ +#[derive(Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct ThreeDSecureDetails { + /// For authenticated transactions: how the customer was authenticated by + /// the issuing bank. + pub authentication_flow: Option, + /// The Electronic Commerce Indicator (ECI). A protocol-level field + /// indicating what degree of authentication was performed. + pub electronic_commerce_indicator: Option, + /// Indicates the outcome of 3D Secure authentication. + pub result: Option, + /// Additional information about why 3D Secure succeeded or failed based + /// on the `result`. + pub result_reason: Option, + /// The 3D Secure 1 XID or 3D Secure 2 Directory Server Transaction ID + /// (dsTransId) for this payment. + pub transaction_id: Option, + /// The version of 3D Secure that was used. + pub version: Option, +} +/// For authenticated transactions: how the customer was authenticated by +/// the issuing bank. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum ThreeDSecureDetailsAuthenticationFlow { + Challenge, + Frictionless, +} +impl ThreeDSecureDetailsAuthenticationFlow { + pub fn as_str(self) -> &'static str { + use ThreeDSecureDetailsAuthenticationFlow::*; + match self { + Challenge => "challenge", + Frictionless => "frictionless", + } + } +} + +impl std::str::FromStr for ThreeDSecureDetailsAuthenticationFlow { + type Err = (); + fn from_str(s: &str) -> Result { + use ThreeDSecureDetailsAuthenticationFlow::*; + match s { + "challenge" => Ok(Challenge), + "frictionless" => Ok(Frictionless), + _ => Err(()), + } + } +} +impl std::fmt::Display for ThreeDSecureDetailsAuthenticationFlow { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for ThreeDSecureDetailsAuthenticationFlow { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for ThreeDSecureDetailsAuthenticationFlow { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for ThreeDSecureDetailsAuthenticationFlow { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| { + serde::de::Error::custom("Unknown value for ThreeDSecureDetailsAuthenticationFlow") + }) + } +} +/// The Electronic Commerce Indicator (ECI). A protocol-level field +/// indicating what degree of authentication was performed. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum ThreeDSecureDetailsElectronicCommerceIndicator { + V01, + V02, + V05, + V06, + V07, +} +impl ThreeDSecureDetailsElectronicCommerceIndicator { + pub fn as_str(self) -> &'static str { + use ThreeDSecureDetailsElectronicCommerceIndicator::*; + match self { + V01 => "01", + V02 => "02", + V05 => "05", + V06 => "06", + V07 => "07", + } + } +} + +impl std::str::FromStr for ThreeDSecureDetailsElectronicCommerceIndicator { + type Err = (); + fn from_str(s: &str) -> Result { + use ThreeDSecureDetailsElectronicCommerceIndicator::*; + match s { + "01" => Ok(V01), + "02" => Ok(V02), + "05" => Ok(V05), + "06" => Ok(V06), + "07" => Ok(V07), + _ => Err(()), + } + } +} +impl std::fmt::Display for ThreeDSecureDetailsElectronicCommerceIndicator { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for ThreeDSecureDetailsElectronicCommerceIndicator { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for ThreeDSecureDetailsElectronicCommerceIndicator { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for ThreeDSecureDetailsElectronicCommerceIndicator { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| { + serde::de::Error::custom( + "Unknown value for ThreeDSecureDetailsElectronicCommerceIndicator", + ) + }) + } +} +/// Indicates the outcome of 3D Secure authentication. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum ThreeDSecureDetailsResult { + AttemptAcknowledged, + Authenticated, + Exempted, + Failed, + NotSupported, + ProcessingError, +} +impl ThreeDSecureDetailsResult { + pub fn as_str(self) -> &'static str { + use ThreeDSecureDetailsResult::*; + match self { + AttemptAcknowledged => "attempt_acknowledged", + Authenticated => "authenticated", + Exempted => "exempted", + Failed => "failed", + NotSupported => "not_supported", + ProcessingError => "processing_error", + } + } +} + +impl std::str::FromStr for ThreeDSecureDetailsResult { + type Err = (); + fn from_str(s: &str) -> Result { + use ThreeDSecureDetailsResult::*; + match s { + "attempt_acknowledged" => Ok(AttemptAcknowledged), + "authenticated" => Ok(Authenticated), + "exempted" => Ok(Exempted), + "failed" => Ok(Failed), + "not_supported" => Ok(NotSupported), + "processing_error" => Ok(ProcessingError), + _ => Err(()), + } + } +} +impl std::fmt::Display for ThreeDSecureDetailsResult { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for ThreeDSecureDetailsResult { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for ThreeDSecureDetailsResult { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for ThreeDSecureDetailsResult { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s) + .map_err(|_| serde::de::Error::custom("Unknown value for ThreeDSecureDetailsResult")) + } +} +/// Additional information about why 3D Secure succeeded or failed based +/// on the `result`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum ThreeDSecureDetailsResultReason { + Abandoned, + Bypassed, + Canceled, + CardNotEnrolled, + NetworkNotSupported, + ProtocolError, + Rejected, +} +impl ThreeDSecureDetailsResultReason { + pub fn as_str(self) -> &'static str { + use ThreeDSecureDetailsResultReason::*; + match self { + Abandoned => "abandoned", + Bypassed => "bypassed", + Canceled => "canceled", + CardNotEnrolled => "card_not_enrolled", + NetworkNotSupported => "network_not_supported", + ProtocolError => "protocol_error", + Rejected => "rejected", + } + } +} + +impl std::str::FromStr for ThreeDSecureDetailsResultReason { + type Err = (); + fn from_str(s: &str) -> Result { + use ThreeDSecureDetailsResultReason::*; + match s { + "abandoned" => Ok(Abandoned), + "bypassed" => Ok(Bypassed), + "canceled" => Ok(Canceled), + "card_not_enrolled" => Ok(CardNotEnrolled), + "network_not_supported" => Ok(NetworkNotSupported), + "protocol_error" => Ok(ProtocolError), + "rejected" => Ok(Rejected), + _ => Err(()), + } + } +} +impl std::fmt::Display for ThreeDSecureDetailsResultReason { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for ThreeDSecureDetailsResultReason { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for ThreeDSecureDetailsResultReason { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for ThreeDSecureDetailsResultReason { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| { + serde::de::Error::custom("Unknown value for ThreeDSecureDetailsResultReason") + }) + } +} +/// The version of 3D Secure that was used. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum ThreeDSecureDetailsVersion { + V1_0_2, + V2_1_0, + V2_2_0, +} +impl ThreeDSecureDetailsVersion { + pub fn as_str(self) -> &'static str { + use ThreeDSecureDetailsVersion::*; + match self { + V1_0_2 => "1.0.2", + V2_1_0 => "2.1.0", + V2_2_0 => "2.2.0", + } + } +} + +impl std::str::FromStr for ThreeDSecureDetailsVersion { + type Err = (); + fn from_str(s: &str) -> Result { + use ThreeDSecureDetailsVersion::*; + match s { + "1.0.2" => Ok(V1_0_2), + "2.1.0" => Ok(V2_1_0), + "2.2.0" => Ok(V2_2_0), + _ => Err(()), + } + } +} +impl std::fmt::Display for ThreeDSecureDetailsVersion { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for ThreeDSecureDetailsVersion { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for ThreeDSecureDetailsVersion { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for ThreeDSecureDetailsVersion { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s) + .map_err(|_| serde::de::Error::custom("Unknown value for ThreeDSecureDetailsVersion")) + } +} diff --git a/generated/stripe_shared/src/three_d_secure_details_charge.rs b/generated/stripe_shared/src/three_d_secure_details_charge.rs new file mode 100644 index 000000000..39a51b6ca --- /dev/null +++ b/generated/stripe_shared/src/three_d_secure_details_charge.rs @@ -0,0 +1,403 @@ +#[derive(Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct ThreeDSecureDetailsCharge { + /// For authenticated transactions: how the customer was authenticated by + /// the issuing bank. + pub authentication_flow: Option, + /// The Electronic Commerce Indicator (ECI). A protocol-level field + /// indicating what degree of authentication was performed. + pub electronic_commerce_indicator: Option, + /// The exemption requested via 3DS and accepted by the issuer at authentication time. + pub exemption_indicator: Option, + /// Whether Stripe requested the value of `exemption_indicator` in the transaction. This will depend on + /// the outcome of Stripe's internal risk assessment. + #[serde(skip_serializing_if = "Option::is_none")] + pub exemption_indicator_applied: Option, + /// Indicates the outcome of 3D Secure authentication. + pub result: Option, + /// Additional information about why 3D Secure succeeded or failed based + /// on the `result`. + pub result_reason: Option, + /// The 3D Secure 1 XID or 3D Secure 2 Directory Server Transaction ID + /// (dsTransId) for this payment. + pub transaction_id: Option, + /// The version of 3D Secure that was used. + pub version: Option, +} +/// For authenticated transactions: how the customer was authenticated by +/// the issuing bank. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum ThreeDSecureDetailsChargeAuthenticationFlow { + Challenge, + Frictionless, +} +impl ThreeDSecureDetailsChargeAuthenticationFlow { + pub fn as_str(self) -> &'static str { + use ThreeDSecureDetailsChargeAuthenticationFlow::*; + match self { + Challenge => "challenge", + Frictionless => "frictionless", + } + } +} + +impl std::str::FromStr for ThreeDSecureDetailsChargeAuthenticationFlow { + type Err = (); + fn from_str(s: &str) -> Result { + use ThreeDSecureDetailsChargeAuthenticationFlow::*; + match s { + "challenge" => Ok(Challenge), + "frictionless" => Ok(Frictionless), + _ => Err(()), + } + } +} +impl std::fmt::Display for ThreeDSecureDetailsChargeAuthenticationFlow { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for ThreeDSecureDetailsChargeAuthenticationFlow { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for ThreeDSecureDetailsChargeAuthenticationFlow { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for ThreeDSecureDetailsChargeAuthenticationFlow { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| { + serde::de::Error::custom( + "Unknown value for ThreeDSecureDetailsChargeAuthenticationFlow", + ) + }) + } +} +/// The Electronic Commerce Indicator (ECI). A protocol-level field +/// indicating what degree of authentication was performed. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum ThreeDSecureDetailsChargeElectronicCommerceIndicator { + V01, + V02, + V05, + V06, + V07, +} +impl ThreeDSecureDetailsChargeElectronicCommerceIndicator { + pub fn as_str(self) -> &'static str { + use ThreeDSecureDetailsChargeElectronicCommerceIndicator::*; + match self { + V01 => "01", + V02 => "02", + V05 => "05", + V06 => "06", + V07 => "07", + } + } +} + +impl std::str::FromStr for ThreeDSecureDetailsChargeElectronicCommerceIndicator { + type Err = (); + fn from_str(s: &str) -> Result { + use ThreeDSecureDetailsChargeElectronicCommerceIndicator::*; + match s { + "01" => Ok(V01), + "02" => Ok(V02), + "05" => Ok(V05), + "06" => Ok(V06), + "07" => Ok(V07), + _ => Err(()), + } + } +} +impl std::fmt::Display for ThreeDSecureDetailsChargeElectronicCommerceIndicator { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for ThreeDSecureDetailsChargeElectronicCommerceIndicator { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for ThreeDSecureDetailsChargeElectronicCommerceIndicator { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for ThreeDSecureDetailsChargeElectronicCommerceIndicator { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| { + serde::de::Error::custom( + "Unknown value for ThreeDSecureDetailsChargeElectronicCommerceIndicator", + ) + }) + } +} +/// The exemption requested via 3DS and accepted by the issuer at authentication time. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum ThreeDSecureDetailsChargeExemptionIndicator { + LowRisk, + None, +} +impl ThreeDSecureDetailsChargeExemptionIndicator { + pub fn as_str(self) -> &'static str { + use ThreeDSecureDetailsChargeExemptionIndicator::*; + match self { + LowRisk => "low_risk", + None => "none", + } + } +} + +impl std::str::FromStr for ThreeDSecureDetailsChargeExemptionIndicator { + type Err = (); + fn from_str(s: &str) -> Result { + use ThreeDSecureDetailsChargeExemptionIndicator::*; + match s { + "low_risk" => Ok(LowRisk), + "none" => Ok(None), + _ => Err(()), + } + } +} +impl std::fmt::Display for ThreeDSecureDetailsChargeExemptionIndicator { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for ThreeDSecureDetailsChargeExemptionIndicator { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for ThreeDSecureDetailsChargeExemptionIndicator { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for ThreeDSecureDetailsChargeExemptionIndicator { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| { + serde::de::Error::custom( + "Unknown value for ThreeDSecureDetailsChargeExemptionIndicator", + ) + }) + } +} +/// Indicates the outcome of 3D Secure authentication. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum ThreeDSecureDetailsChargeResult { + AttemptAcknowledged, + Authenticated, + Exempted, + Failed, + NotSupported, + ProcessingError, +} +impl ThreeDSecureDetailsChargeResult { + pub fn as_str(self) -> &'static str { + use ThreeDSecureDetailsChargeResult::*; + match self { + AttemptAcknowledged => "attempt_acknowledged", + Authenticated => "authenticated", + Exempted => "exempted", + Failed => "failed", + NotSupported => "not_supported", + ProcessingError => "processing_error", + } + } +} + +impl std::str::FromStr for ThreeDSecureDetailsChargeResult { + type Err = (); + fn from_str(s: &str) -> Result { + use ThreeDSecureDetailsChargeResult::*; + match s { + "attempt_acknowledged" => Ok(AttemptAcknowledged), + "authenticated" => Ok(Authenticated), + "exempted" => Ok(Exempted), + "failed" => Ok(Failed), + "not_supported" => Ok(NotSupported), + "processing_error" => Ok(ProcessingError), + _ => Err(()), + } + } +} +impl std::fmt::Display for ThreeDSecureDetailsChargeResult { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for ThreeDSecureDetailsChargeResult { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for ThreeDSecureDetailsChargeResult { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for ThreeDSecureDetailsChargeResult { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| { + serde::de::Error::custom("Unknown value for ThreeDSecureDetailsChargeResult") + }) + } +} +/// Additional information about why 3D Secure succeeded or failed based +/// on the `result`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum ThreeDSecureDetailsChargeResultReason { + Abandoned, + Bypassed, + Canceled, + CardNotEnrolled, + NetworkNotSupported, + ProtocolError, + Rejected, +} +impl ThreeDSecureDetailsChargeResultReason { + pub fn as_str(self) -> &'static str { + use ThreeDSecureDetailsChargeResultReason::*; + match self { + Abandoned => "abandoned", + Bypassed => "bypassed", + Canceled => "canceled", + CardNotEnrolled => "card_not_enrolled", + NetworkNotSupported => "network_not_supported", + ProtocolError => "protocol_error", + Rejected => "rejected", + } + } +} + +impl std::str::FromStr for ThreeDSecureDetailsChargeResultReason { + type Err = (); + fn from_str(s: &str) -> Result { + use ThreeDSecureDetailsChargeResultReason::*; + match s { + "abandoned" => Ok(Abandoned), + "bypassed" => Ok(Bypassed), + "canceled" => Ok(Canceled), + "card_not_enrolled" => Ok(CardNotEnrolled), + "network_not_supported" => Ok(NetworkNotSupported), + "protocol_error" => Ok(ProtocolError), + "rejected" => Ok(Rejected), + _ => Err(()), + } + } +} +impl std::fmt::Display for ThreeDSecureDetailsChargeResultReason { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for ThreeDSecureDetailsChargeResultReason { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for ThreeDSecureDetailsChargeResultReason { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for ThreeDSecureDetailsChargeResultReason { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| { + serde::de::Error::custom("Unknown value for ThreeDSecureDetailsChargeResultReason") + }) + } +} +/// The version of 3D Secure that was used. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum ThreeDSecureDetailsChargeVersion { + V1_0_2, + V2_1_0, + V2_2_0, +} +impl ThreeDSecureDetailsChargeVersion { + pub fn as_str(self) -> &'static str { + use ThreeDSecureDetailsChargeVersion::*; + match self { + V1_0_2 => "1.0.2", + V2_1_0 => "2.1.0", + V2_2_0 => "2.2.0", + } + } +} + +impl std::str::FromStr for ThreeDSecureDetailsChargeVersion { + type Err = (); + fn from_str(s: &str) -> Result { + use ThreeDSecureDetailsChargeVersion::*; + match s { + "1.0.2" => Ok(V1_0_2), + "2.1.0" => Ok(V2_1_0), + "2.2.0" => Ok(V2_2_0), + _ => Err(()), + } + } +} +impl std::fmt::Display for ThreeDSecureDetailsChargeVersion { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for ThreeDSecureDetailsChargeVersion { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for ThreeDSecureDetailsChargeVersion { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for ThreeDSecureDetailsChargeVersion { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| { + serde::de::Error::custom("Unknown value for ThreeDSecureDetailsChargeVersion") + }) + } +} diff --git a/generated/stripe_shared/src/three_d_secure_usage.rs b/generated/stripe_shared/src/three_d_secure_usage.rs new file mode 100644 index 000000000..c2869dd18 --- /dev/null +++ b/generated/stripe_shared/src/three_d_secure_usage.rs @@ -0,0 +1,5 @@ +#[derive(Copy, Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct ThreeDSecureUsage { + /// Whether 3D Secure is supported on this card. + pub supported: bool, +} diff --git a/generated/stripe_shared/src/topup.rs b/generated/stripe_shared/src/topup.rs new file mode 100644 index 000000000..a4a4bc5ac --- /dev/null +++ b/generated/stripe_shared/src/topup.rs @@ -0,0 +1,116 @@ +/// To top up your Stripe balance, you create a top-up object. You can retrieve +/// individual top-ups, as well as list all top-ups. Top-ups are identified by a +/// unique, random ID. +/// +/// Related guide: [Topping up your platform account](https://stripe.com/docs/connect/top-ups) +/// +/// For more details see <>. +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct Topup { + /// Amount transferred. + pub amount: i64, + /// ID of the balance transaction that describes the impact of this top-up on your account balance. + /// May not be specified depending on status of top-up. + pub balance_transaction: Option>, + /// Time at which the object was created. Measured in seconds since the Unix epoch. + pub created: stripe_types::Timestamp, + /// Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. + /// Must be a [supported currency](https://stripe.com/docs/currencies). + pub currency: stripe_types::Currency, + /// An arbitrary string attached to the object. Often useful for displaying to users. + pub description: Option, + /// Date the funds are expected to arrive in your Stripe account for payouts. + /// This factors in delays like weekends or bank holidays. + /// May not be specified depending on status of top-up. + pub expected_availability_date: Option, + /// Error code explaining reason for top-up failure if available (see [the errors section](https://stripe.com/docs/api#errors) for a list of codes). + pub failure_code: Option, + /// Message to user further explaining reason for top-up failure if available. + pub failure_message: Option, + /// Unique identifier for the object. + pub id: stripe_shared::TopupId, + /// Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + pub livemode: bool, + /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. + /// This can be useful for storing additional information about the object in a structured format. + pub metadata: std::collections::HashMap, + /// The source field is deprecated. It might not always be present in the API response. + pub source: Option, + /// Extra information about a top-up. + /// This will appear on your source's bank statement. + /// It must contain at least one letter. + pub statement_descriptor: Option, + /// The status of the top-up is either `canceled`, `failed`, `pending`, `reversed`, or `succeeded`. + pub status: TopupStatus, + /// A string that identifies this top-up as part of a group. + pub transfer_group: Option, +} +/// The status of the top-up is either `canceled`, `failed`, `pending`, `reversed`, or `succeeded`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum TopupStatus { + Canceled, + Failed, + Pending, + Reversed, + Succeeded, +} +impl TopupStatus { + pub fn as_str(self) -> &'static str { + use TopupStatus::*; + match self { + Canceled => "canceled", + Failed => "failed", + Pending => "pending", + Reversed => "reversed", + Succeeded => "succeeded", + } + } +} + +impl std::str::FromStr for TopupStatus { + type Err = (); + fn from_str(s: &str) -> Result { + use TopupStatus::*; + match s { + "canceled" => Ok(Canceled), + "failed" => Ok(Failed), + "pending" => Ok(Pending), + "reversed" => Ok(Reversed), + "succeeded" => Ok(Succeeded), + _ => Err(()), + } + } +} +impl std::fmt::Display for TopupStatus { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for TopupStatus { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for TopupStatus { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for TopupStatus { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for TopupStatus")) + } +} +impl stripe_types::Object for Topup { + type Id = stripe_shared::TopupId; + fn id(&self) -> &Self::Id { + &self.id + } +} +stripe_types::def_id!(TopupId, "tu_"); diff --git a/generated/stripe_shared/src/transfer.rs b/generated/stripe_shared/src/transfer.rs new file mode 100644 index 000000000..ac70f0ce6 --- /dev/null +++ b/generated/stripe_shared/src/transfer.rs @@ -0,0 +1,62 @@ +/// A `Transfer` object is created when you move funds between Stripe accounts as +/// part of Connect. +/// +/// Before April 6, 2017, transfers also represented movement of funds from a +/// Stripe account to a card or bank account. This behavior has since been split +/// out into a [Payout](https://stripe.com/docs/api#payout_object) object, with corresponding payout endpoints. +/// For more. +/// information, read about the +/// [transfer/payout split](https://stripe.com/docs/transfer-payout-split). +/// +/// Related guide: [Creating separate charges and transfers](https://stripe.com/docs/connect/separate-charges-and-transfers). +/// +/// For more details see <>. +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct Transfer { + /// Amount in cents (or local equivalent) to be transferred. + pub amount: i64, + /// Amount in cents (or local equivalent) reversed (can be less than the amount attribute on the transfer if a partial reversal was issued). + pub amount_reversed: i64, + /// Balance transaction that describes the impact of this transfer on your account balance. + pub balance_transaction: Option>, + /// Time that this record of the transfer was first created. + pub created: stripe_types::Timestamp, + /// Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. + /// Must be a [supported currency](https://stripe.com/docs/currencies). + pub currency: stripe_types::Currency, + /// An arbitrary string attached to the object. Often useful for displaying to users. + pub description: Option, + /// ID of the Stripe account the transfer was sent to. + pub destination: Option>, + /// If the destination is a Stripe account, this will be the ID of the payment that the destination account received for the transfer. + #[serde(skip_serializing_if = "Option::is_none")] + pub destination_payment: Option>, + /// Unique identifier for the object. + pub id: stripe_shared::TransferId, + /// Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + pub livemode: bool, + /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. + /// This can be useful for storing additional information about the object in a structured format. + pub metadata: std::collections::HashMap, + /// A list of reversals that have been applied to the transfer. + pub reversals: stripe_types::List, + /// Whether the transfer has been fully reversed. + /// If the transfer is only partially reversed, this attribute will still be false. + pub reversed: bool, + /// ID of the charge or payment that was used to fund the transfer. + /// If null, the transfer was funded from the available balance. + pub source_transaction: Option>, + /// The source balance this transfer came from. One of `card`, `fpx`, or `bank_account`. + #[serde(skip_serializing_if = "Option::is_none")] + pub source_type: Option, + /// A string that identifies this transaction as part of a group. + /// See the [Connect documentation](https://stripe.com/docs/connect/separate-charges-and-transfers#transfer-options) for details. + pub transfer_group: Option, +} +impl stripe_types::Object for Transfer { + type Id = stripe_shared::TransferId; + fn id(&self) -> &Self::Id { + &self.id + } +} +stripe_types::def_id!(TransferId, "tr_"); diff --git a/generated/stripe_shared/src/transfer_data.rs b/generated/stripe_shared/src/transfer_data.rs new file mode 100644 index 000000000..40749d57f --- /dev/null +++ b/generated/stripe_shared/src/transfer_data.rs @@ -0,0 +1,13 @@ +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct TransferData { + /// Amount intended to be collected by this PaymentIntent. + /// A positive integer representing how much to charge in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal) (e.g., 100 cents to charge $1.00 or 100 to charge ¥100, a zero-decimal currency). + /// The minimum amount is $0.50 US or [equivalent in charge currency](https://stripe.com/docs/currencies#minimum-and-maximum-charge-amounts). + /// The amount value supports up to eight digits (e.g., a value of 99999999 for a USD charge of $999,999.99). + #[serde(skip_serializing_if = "Option::is_none")] + pub amount: Option, + /// The account (if any) that the payment is attributed to for tax + /// reporting, and where funds from the payment are transferred to after + /// payment success. + pub destination: stripe_types::Expandable, +} diff --git a/generated/stripe_shared/src/transfer_reversal.rs b/generated/stripe_shared/src/transfer_reversal.rs new file mode 100644 index 000000000..7c3f201f6 --- /dev/null +++ b/generated/stripe_shared/src/transfer_reversal.rs @@ -0,0 +1,45 @@ +/// [Stripe Connect](https://stripe.com/docs/connect) platforms can reverse transfers made to a +/// connected account, either entirely or partially, and can also specify whether +/// to refund any related application fees. Transfer reversals add to the +/// platform's balance and subtract from the destination account's balance. +/// +/// Reversing a transfer that was made for a [destination +/// charge](/docs/connect/destination-charges) is allowed only up to the amount of +/// the charge. It is possible to reverse a +/// [transfer_group](https://stripe.com/docs/connect/separate-charges-and-transfers#transfer-options) +/// transfer only if the destination account has enough balance to cover the +/// reversal. +/// +/// Related guide: [Reversing transfers](https://stripe.com/docs/connect/separate-charges-and-transfers#reversing-transfers). +/// +/// For more details see <>. +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct TransferReversal { + /// Amount, in cents (or local equivalent). + pub amount: i64, + /// Balance transaction that describes the impact on your account balance. + pub balance_transaction: Option>, + /// Time at which the object was created. Measured in seconds since the Unix epoch. + pub created: stripe_types::Timestamp, + /// Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. + /// Must be a [supported currency](https://stripe.com/docs/currencies). + pub currency: stripe_types::Currency, + /// Linked payment refund for the transfer reversal. + pub destination_payment_refund: Option>, + /// Unique identifier for the object. + pub id: stripe_shared::TransferReversalId, + /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. + /// This can be useful for storing additional information about the object in a structured format. + pub metadata: Option>, + /// ID of the refund responsible for the transfer reversal. + pub source_refund: Option>, + /// ID of the transfer that was reversed. + pub transfer: stripe_types::Expandable, +} +impl stripe_types::Object for TransferReversal { + type Id = stripe_shared::TransferReversalId; + fn id(&self) -> &Self::Id { + &self.id + } +} +stripe_types::def_id!(TransferReversalId, "trr_"); diff --git a/generated/stripe_shared/src/transfer_schedule.rs b/generated/stripe_shared/src/transfer_schedule.rs new file mode 100644 index 000000000..9bb3a27a0 --- /dev/null +++ b/generated/stripe_shared/src/transfer_schedule.rs @@ -0,0 +1,17 @@ +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct TransferSchedule { + /// The number of days charges for the account will be held before being paid out. + pub delay_days: u32, + /// How frequently funds will be paid out. + /// One of `manual` (payouts only created via API call), `daily`, `weekly`, or `monthly`. + pub interval: String, + /// The day of the month funds will be paid out. + /// Only shown if `interval` is monthly. + /// Payouts scheduled between the 29th and 31st of the month are sent on the last day of shorter months. + #[serde(skip_serializing_if = "Option::is_none")] + pub monthly_anchor: Option, + /// The day of the week funds will be paid out, of the style 'monday', 'tuesday', etc. + /// Only shown if `interval` is weekly. + #[serde(skip_serializing_if = "Option::is_none")] + pub weekly_anchor: Option, +} diff --git a/generated/stripe_shared/src/transform_quantity.rs b/generated/stripe_shared/src/transform_quantity.rs new file mode 100644 index 000000000..badb1f107 --- /dev/null +++ b/generated/stripe_shared/src/transform_quantity.rs @@ -0,0 +1,61 @@ +#[derive(Copy, Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct TransformQuantity { + /// Divide usage by this number. + pub divide_by: i64, + /// After division, either round the result `up` or `down`. + pub round: TransformQuantityRound, +} +/// After division, either round the result `up` or `down`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum TransformQuantityRound { + Down, + Up, +} +impl TransformQuantityRound { + pub fn as_str(self) -> &'static str { + use TransformQuantityRound::*; + match self { + Down => "down", + Up => "up", + } + } +} + +impl std::str::FromStr for TransformQuantityRound { + type Err = (); + fn from_str(s: &str) -> Result { + use TransformQuantityRound::*; + match s { + "down" => Ok(Down), + "up" => Ok(Up), + _ => Err(()), + } + } +} +impl std::fmt::Display for TransformQuantityRound { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for TransformQuantityRound { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for TransformQuantityRound { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for TransformQuantityRound { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s) + .map_err(|_| serde::de::Error::custom("Unknown value for TransformQuantityRound")) + } +} diff --git a/generated/stripe_shared/src/transform_usage.rs b/generated/stripe_shared/src/transform_usage.rs new file mode 100644 index 000000000..4b27d3e7d --- /dev/null +++ b/generated/stripe_shared/src/transform_usage.rs @@ -0,0 +1,61 @@ +#[derive(Copy, Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct TransformUsage { + /// Divide usage by this number. + pub divide_by: i64, + /// After division, either round the result `up` or `down`. + pub round: TransformUsageRound, +} +/// After division, either round the result `up` or `down`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum TransformUsageRound { + Down, + Up, +} +impl TransformUsageRound { + pub fn as_str(self) -> &'static str { + use TransformUsageRound::*; + match self { + Down => "down", + Up => "up", + } + } +} + +impl std::str::FromStr for TransformUsageRound { + type Err = (); + fn from_str(s: &str) -> Result { + use TransformUsageRound::*; + match s { + "down" => Ok(Down), + "up" => Ok(Up), + _ => Err(()), + } + } +} +impl std::fmt::Display for TransformUsageRound { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for TransformUsageRound { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for TransformUsageRound { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for TransformUsageRound { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s) + .map_err(|_| serde::de::Error::custom("Unknown value for TransformUsageRound")) + } +} diff --git a/generated/stripe_shared/src/us_bank_account_networks.rs b/generated/stripe_shared/src/us_bank_account_networks.rs new file mode 100644 index 000000000..987f23aea --- /dev/null +++ b/generated/stripe_shared/src/us_bank_account_networks.rs @@ -0,0 +1,62 @@ +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct UsBankAccountNetworks { + /// The preferred network. + pub preferred: Option, + /// All supported networks. + pub supported: Vec, +} +/// All supported networks. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum UsBankAccountNetworksSupported { + Ach, + UsDomesticWire, +} +impl UsBankAccountNetworksSupported { + pub fn as_str(self) -> &'static str { + use UsBankAccountNetworksSupported::*; + match self { + Ach => "ach", + UsDomesticWire => "us_domestic_wire", + } + } +} + +impl std::str::FromStr for UsBankAccountNetworksSupported { + type Err = (); + fn from_str(s: &str) -> Result { + use UsBankAccountNetworksSupported::*; + match s { + "ach" => Ok(Ach), + "us_domestic_wire" => Ok(UsDomesticWire), + _ => Err(()), + } + } +} +impl std::fmt::Display for UsBankAccountNetworksSupported { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for UsBankAccountNetworksSupported { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for UsBankAccountNetworksSupported { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for UsBankAccountNetworksSupported { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| { + serde::de::Error::custom("Unknown value for UsBankAccountNetworksSupported") + }) + } +} diff --git a/generated/stripe_shared/src/usage_record_summary.rs b/generated/stripe_shared/src/usage_record_summary.rs new file mode 100644 index 000000000..2b9343648 --- /dev/null +++ b/generated/stripe_shared/src/usage_record_summary.rs @@ -0,0 +1,21 @@ +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct UsageRecordSummary { + /// Unique identifier for the object. + pub id: stripe_shared::UsageRecordSummaryId, + /// The invoice in which this usage period has been billed for. + pub invoice: Option, + /// Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + pub livemode: bool, + pub period: stripe_shared::Period, + /// The ID of the subscription item this summary is describing. + pub subscription_item: String, + /// The total usage within this usage period. + pub total_usage: i64, +} +impl stripe_types::Object for UsageRecordSummary { + type Id = stripe_shared::UsageRecordSummaryId; + fn id(&self) -> &Self::Id { + &self.id + } +} +stripe_types::def_id!(UsageRecordSummaryId, "urs_" | "sis_"); diff --git a/generated/stripe_shared/src/version.rs b/generated/stripe_shared/src/version.rs new file mode 100644 index 000000000..351cac38b --- /dev/null +++ b/generated/stripe_shared/src/version.rs @@ -0,0 +1 @@ +pub const VERSION: crate::ApiVersion = crate::ApiVersion::V2023_10_16; diff --git a/generated/stripe_terminal/Cargo.toml b/generated/stripe_terminal/Cargo.toml new file mode 100644 index 000000000..04def9be3 --- /dev/null +++ b/generated/stripe_terminal/Cargo.toml @@ -0,0 +1,52 @@ +[package] +name = "stripe_terminal" +version.workspace = true +description.workspace = true +edition.workspace = true +rust-version.workspace = true +authors.workspace = true +license.workspace = true +homepage.workspace = true +repository.workspace = true +keywords.workspace = true +categories.workspace = true + +[lib] +path = "src/mod.rs" + +[dependencies] +serde.workspace = true +smol_str.workspace = true +serde_json.workspace = true +stripe_types = {path = "../../stripe_types"} + +http-types.workspace = true +async-stripe = {path = "../../async-stripe"} + + +stripe_shared = {path = "../../generated/stripe_shared"} + + +[features] +runtime-tokio-hyper = ["async-stripe/runtime-tokio-hyper"] +runtime-tokio-hyper-rustls = ["async-stripe/runtime-tokio-hyper-rustls"] +runtime-tokio-hyper-rustls-webpki = ["async-stripe/runtime-tokio-hyper-rustls-webpki"] +runtime-blocking = ["async-stripe/runtime-blocking"] +runtime-blocking-rustls = ["async-stripe/runtime-blocking-rustls"] +runtime-blocking-rustls-webpki = ["async-stripe/runtime-blocking-rustls-webpki"] +runtime-async-std-surf = ["async-stripe/runtime-async-std-surf"] + +terminal_configuration = [] +terminal_connection_token = [] +terminal_location = [] +terminal_reader = [] + +full = ["terminal_configuration", +"terminal_connection_token", +"terminal_location", +"terminal_reader"] + + +[package.metadata.docs.rs] +features = ["runtime-tokio-hyper", "full"] + diff --git a/generated/stripe_terminal/src/deleted_terminal_configuration.rs b/generated/stripe_terminal/src/deleted_terminal_configuration.rs new file mode 100644 index 000000000..742ca8d5c --- /dev/null +++ b/generated/stripe_terminal/src/deleted_terminal_configuration.rs @@ -0,0 +1,13 @@ +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct DeletedTerminalConfiguration { + /// Always true for a deleted object + deleted: stripe_types::AlwaysTrue, + /// Unique identifier for the object. + pub id: stripe_terminal::TerminalConfigurationId, +} +impl stripe_types::Object for DeletedTerminalConfiguration { + type Id = stripe_terminal::TerminalConfigurationId; + fn id(&self) -> &Self::Id { + &self.id + } +} diff --git a/generated/stripe_terminal/src/deleted_terminal_location.rs b/generated/stripe_terminal/src/deleted_terminal_location.rs new file mode 100644 index 000000000..e60106201 --- /dev/null +++ b/generated/stripe_terminal/src/deleted_terminal_location.rs @@ -0,0 +1,13 @@ +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct DeletedTerminalLocation { + /// Always true for a deleted object + deleted: stripe_types::AlwaysTrue, + /// Unique identifier for the object. + pub id: stripe_terminal::TerminalLocationId, +} +impl stripe_types::Object for DeletedTerminalLocation { + type Id = stripe_terminal::TerminalLocationId; + fn id(&self) -> &Self::Id { + &self.id + } +} diff --git a/generated/stripe_terminal/src/deleted_terminal_reader.rs b/generated/stripe_terminal/src/deleted_terminal_reader.rs new file mode 100644 index 000000000..9143214e1 --- /dev/null +++ b/generated/stripe_terminal/src/deleted_terminal_reader.rs @@ -0,0 +1,13 @@ +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct DeletedTerminalReader { + /// Always true for a deleted object + deleted: stripe_types::AlwaysTrue, + /// Unique identifier for the object. + pub id: stripe_terminal::TerminalReaderId, +} +impl stripe_types::Object for DeletedTerminalReader { + type Id = stripe_terminal::TerminalReaderId; + fn id(&self) -> &Self::Id { + &self.id + } +} diff --git a/generated/stripe_terminal/src/mod.rs b/generated/stripe_terminal/src/mod.rs new file mode 100644 index 000000000..854cc8cf1 --- /dev/null +++ b/generated/stripe_terminal/src/mod.rs @@ -0,0 +1,85 @@ +#![recursion_limit = "256"] +#![allow(clippy::large_enum_variant)] +#![allow(rustdoc::broken_intra_doc_links)] +#![allow(rustdoc::invalid_html_tags)] + +//! This crate provides Rust bindings to the Stripe HTTP API, specifically +//! for requests mentioned in the `Terminal` section of the [Stripe API docs](https://stripe.com/docs/api) + +extern crate self as stripe_terminal; +#[doc(hidden)] +pub mod deleted_terminal_configuration; +#[doc(inline)] +pub use deleted_terminal_configuration::*; +#[doc(hidden)] +pub mod deleted_terminal_location; +#[doc(inline)] +pub use deleted_terminal_location::*; +#[doc(hidden)] +pub mod deleted_terminal_reader; +#[doc(inline)] +pub use deleted_terminal_reader::*; +pub use terminal_configuration::types::*; +pub mod terminal_configuration; +pub use terminal_connection_token::types::*; +pub mod terminal_connection_token; +pub use terminal_location::types::*; +pub mod terminal_location; +pub use terminal_reader::types::*; +#[doc(hidden)] +pub mod terminal_configuration_configuration_resource_currency_specific_config; +pub mod terminal_reader; +#[doc(inline)] +pub use terminal_configuration_configuration_resource_currency_specific_config::*; +#[doc(hidden)] +pub mod terminal_configuration_configuration_resource_device_type_specific_config; +#[doc(inline)] +pub use terminal_configuration_configuration_resource_device_type_specific_config::*; +#[doc(hidden)] +pub mod terminal_configuration_configuration_resource_offline_config; +#[doc(inline)] +pub use terminal_configuration_configuration_resource_offline_config::*; +#[doc(hidden)] +pub mod terminal_configuration_configuration_resource_tipping; +#[doc(inline)] +pub use terminal_configuration_configuration_resource_tipping::*; +#[doc(hidden)] +pub mod terminal_reader_reader_resource_cart; +#[doc(inline)] +pub use terminal_reader_reader_resource_cart::*; +#[doc(hidden)] +pub mod terminal_reader_reader_resource_line_item; +#[doc(inline)] +pub use terminal_reader_reader_resource_line_item::*; +#[doc(hidden)] +pub mod terminal_reader_reader_resource_process_config; +#[doc(inline)] +pub use terminal_reader_reader_resource_process_config::*; +#[doc(hidden)] +pub mod terminal_reader_reader_resource_process_payment_intent_action; +#[doc(inline)] +pub use terminal_reader_reader_resource_process_payment_intent_action::*; +#[doc(hidden)] +pub mod terminal_reader_reader_resource_process_setup_config; +#[doc(inline)] +pub use terminal_reader_reader_resource_process_setup_config::*; +#[doc(hidden)] +pub mod terminal_reader_reader_resource_process_setup_intent_action; +#[doc(inline)] +pub use terminal_reader_reader_resource_process_setup_intent_action::*; +#[doc(hidden)] +pub mod terminal_reader_reader_resource_reader_action; +#[doc(inline)] +pub use terminal_reader_reader_resource_reader_action::*; +#[doc(hidden)] +pub mod terminal_reader_reader_resource_refund_payment_action; +#[doc(inline)] +pub use terminal_reader_reader_resource_refund_payment_action::*; +#[doc(hidden)] +pub mod terminal_reader_reader_resource_set_reader_display_action; +#[doc(inline)] +pub use terminal_reader_reader_resource_set_reader_display_action::*; +#[doc(hidden)] +pub mod terminal_reader_reader_resource_tipping_config; +#[doc(inline)] +pub use terminal_reader_reader_resource_tipping_config::*; diff --git a/generated/stripe_terminal/src/terminal_configuration/mod.rs b/generated/stripe_terminal/src/terminal_configuration/mod.rs new file mode 100644 index 000000000..33d49c4a8 --- /dev/null +++ b/generated/stripe_terminal/src/terminal_configuration/mod.rs @@ -0,0 +1,5 @@ +#[cfg(feature = "terminal_configuration")] +mod requests; +pub(crate) mod types; +#[cfg(feature = "terminal_configuration")] +pub use requests::*; diff --git a/generated/stripe_terminal/src/terminal_configuration/requests.rs b/generated/stripe_terminal/src/terminal_configuration/requests.rs new file mode 100644 index 000000000..25cbf531c --- /dev/null +++ b/generated/stripe_terminal/src/terminal_configuration/requests.rs @@ -0,0 +1,291 @@ +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct DeleteTerminalConfiguration {} +impl DeleteTerminalConfiguration { + pub fn new() -> Self { + Self::default() + } +} +impl DeleteTerminalConfiguration { + /// Deletes a `Configuration` object. + pub fn send( + &self, + client: &stripe::Client, + configuration: &stripe_terminal::TerminalConfigurationId, + ) -> stripe::Response { + client.send_form( + &format!("/terminal/configurations/{configuration}"), + self, + http_types::Method::Delete, + ) + } +} +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct ListTerminalConfiguration<'a> { + /// A cursor for use in pagination. + /// `ending_before` is an object ID that defines your place in the list. + /// For instance, if you make a list request and receive 100 objects, starting with `obj_bar`, your subsequent call can include `ending_before=obj_bar` in order to fetch the previous page of the list. + #[serde(skip_serializing_if = "Option::is_none")] + pub ending_before: Option<&'a str>, + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, + /// if present, only return the account default or non-default configurations. + #[serde(skip_serializing_if = "Option::is_none")] + pub is_account_default: Option, + /// A limit on the number of objects to be returned. + /// Limit can range between 1 and 100, and the default is 10. + #[serde(skip_serializing_if = "Option::is_none")] + pub limit: Option, + /// A cursor for use in pagination. + /// `starting_after` is an object ID that defines your place in the list. + /// For instance, if you make a list request and receive 100 objects, ending with `obj_foo`, your subsequent call can include `starting_after=obj_foo` in order to fetch the next page of the list. + #[serde(skip_serializing_if = "Option::is_none")] + pub starting_after: Option<&'a str>, +} +impl<'a> ListTerminalConfiguration<'a> { + pub fn new() -> Self { + Self::default() + } +} +impl<'a> ListTerminalConfiguration<'a> { + /// Returns a list of `Configuration` objects. + pub fn send( + &self, + client: &stripe::Client, + ) -> stripe::Response> { + client.get_query("/terminal/configurations", self) + } + pub fn paginate( + self, + ) -> stripe::ListPaginator> { + stripe::ListPaginator::from_list_params("/terminal/configurations", self) + } +} +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct RetrieveTerminalConfiguration<'a> { + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, +} +impl<'a> RetrieveTerminalConfiguration<'a> { + pub fn new() -> Self { + Self::default() + } +} +impl<'a> RetrieveTerminalConfiguration<'a> { + /// Retrieves a `Configuration` object. + pub fn send( + &self, + client: &stripe::Client, + configuration: &stripe_terminal::TerminalConfigurationId, + ) -> stripe::Response { + client.get_query(&format!("/terminal/configurations/{configuration}"), self) + } +} +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +#[serde(untagged)] +pub enum RetrieveTerminalConfigurationReturned { + TerminalConfiguration(stripe_terminal::TerminalConfiguration), + DeletedTerminalConfiguration(stripe_terminal::DeletedTerminalConfiguration), +} +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreateTerminalConfiguration<'a> { + /// An object containing device type specific settings for BBPOS WisePOS E readers + #[serde(skip_serializing_if = "Option::is_none")] + pub bbpos_wisepos_e: Option>, + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, + /// Configurations for collecting transactions offline. + #[serde(skip_serializing_if = "Option::is_none")] + pub offline: Option, + /// Tipping configurations for readers supporting on-reader tips + #[serde(skip_serializing_if = "Option::is_none")] + pub tipping: Option>, + /// An object containing device type specific settings for Verifone P400 readers + #[serde(skip_serializing_if = "Option::is_none")] + pub verifone_p400: Option>, +} +impl<'a> CreateTerminalConfiguration<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// An object containing device type specific settings for BBPOS WisePOS E readers +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreateTerminalConfigurationBbposWiseposE<'a> { + /// A File ID representing an image you would like displayed on the reader. + #[serde(skip_serializing_if = "Option::is_none")] + pub splashscreen: Option<&'a str>, +} +impl<'a> CreateTerminalConfigurationBbposWiseposE<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// An object containing device type specific settings for Verifone P400 readers +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreateTerminalConfigurationVerifoneP400<'a> { + /// A File ID representing an image you would like displayed on the reader. + #[serde(skip_serializing_if = "Option::is_none")] + pub splashscreen: Option<&'a str>, +} +impl<'a> CreateTerminalConfigurationVerifoneP400<'a> { + pub fn new() -> Self { + Self::default() + } +} +impl<'a> CreateTerminalConfiguration<'a> { + /// Creates a new `Configuration` object. + pub fn send( + &self, + client: &stripe::Client, + ) -> stripe::Response { + client.send_form("/terminal/configurations", self, http_types::Method::Post) + } +} +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdateTerminalConfiguration<'a> { + /// An object containing device type specific settings for BBPOS WisePOS E readers + #[serde(skip_serializing_if = "Option::is_none")] + pub bbpos_wisepos_e: Option>, + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, + /// Configurations for collecting transactions offline. + #[serde(skip_serializing_if = "Option::is_none")] + pub offline: Option, + /// Tipping configurations for readers supporting on-reader tips + #[serde(skip_serializing_if = "Option::is_none")] + pub tipping: Option>, + /// An object containing device type specific settings for Verifone P400 readers + #[serde(skip_serializing_if = "Option::is_none")] + pub verifone_p400: Option>, +} +impl<'a> UpdateTerminalConfiguration<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// An object containing device type specific settings for BBPOS WisePOS E readers +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdateTerminalConfigurationBbposWiseposE<'a> { + /// A File ID representing an image you would like displayed on the reader. + #[serde(skip_serializing_if = "Option::is_none")] + pub splashscreen: Option<&'a str>, +} +impl<'a> UpdateTerminalConfigurationBbposWiseposE<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// An object containing device type specific settings for Verifone P400 readers +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdateTerminalConfigurationVerifoneP400<'a> { + /// A File ID representing an image you would like displayed on the reader. + #[serde(skip_serializing_if = "Option::is_none")] + pub splashscreen: Option<&'a str>, +} +impl<'a> UpdateTerminalConfigurationVerifoneP400<'a> { + pub fn new() -> Self { + Self::default() + } +} +impl<'a> UpdateTerminalConfiguration<'a> { + /// Updates a new `Configuration` object. + pub fn send( + &self, + client: &stripe::Client, + configuration: &stripe_terminal::TerminalConfigurationId, + ) -> stripe::Response { + client.send_form( + &format!("/terminal/configurations/{configuration}"), + self, + http_types::Method::Post, + ) + } +} +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +#[serde(untagged)] +pub enum UpdateTerminalConfigurationReturned { + TerminalConfiguration(stripe_terminal::TerminalConfiguration), + DeletedTerminalConfiguration(stripe_terminal::DeletedTerminalConfiguration), +} +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct Offline { + /// Determines whether to allow transactions to be collected while reader is offline. + /// Defaults to false. + pub enabled: bool, +} +impl Offline { + pub fn new(enabled: bool) -> Self { + Self { enabled } + } +} +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CurrencySpecificConfig<'a> { + /// Fixed amounts displayed when collecting a tip + #[serde(skip_serializing_if = "Option::is_none")] + pub fixed_amounts: Option<&'a [i64]>, + /// Percentages displayed when collecting a tip + #[serde(skip_serializing_if = "Option::is_none")] + pub percentages: Option<&'a [i64]>, + /// Below this amount, fixed amounts will be displayed; above it, percentages will be displayed + #[serde(skip_serializing_if = "Option::is_none")] + pub smart_tip_threshold: Option, +} +impl<'a> CurrencySpecificConfig<'a> { + pub fn new() -> Self { + Self::default() + } +} +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct Tipping<'a> { + /// Tipping configuration for AUD + #[serde(skip_serializing_if = "Option::is_none")] + pub aud: Option>, + /// Tipping configuration for CAD + #[serde(skip_serializing_if = "Option::is_none")] + pub cad: Option>, + /// Tipping configuration for CHF + #[serde(skip_serializing_if = "Option::is_none")] + pub chf: Option>, + /// Tipping configuration for CZK + #[serde(skip_serializing_if = "Option::is_none")] + pub czk: Option>, + /// Tipping configuration for DKK + #[serde(skip_serializing_if = "Option::is_none")] + pub dkk: Option>, + /// Tipping configuration for EUR + #[serde(skip_serializing_if = "Option::is_none")] + pub eur: Option>, + /// Tipping configuration for GBP + #[serde(skip_serializing_if = "Option::is_none")] + pub gbp: Option>, + /// Tipping configuration for HKD + #[serde(skip_serializing_if = "Option::is_none")] + pub hkd: Option>, + /// Tipping configuration for MYR + #[serde(skip_serializing_if = "Option::is_none")] + pub myr: Option>, + /// Tipping configuration for NOK + #[serde(skip_serializing_if = "Option::is_none")] + pub nok: Option>, + /// Tipping configuration for NZD + #[serde(skip_serializing_if = "Option::is_none")] + pub nzd: Option>, + /// Tipping configuration for SEK + #[serde(skip_serializing_if = "Option::is_none")] + pub sek: Option>, + /// Tipping configuration for SGD + #[serde(skip_serializing_if = "Option::is_none")] + pub sgd: Option>, + /// Tipping configuration for USD + #[serde(skip_serializing_if = "Option::is_none")] + pub usd: Option>, +} +impl<'a> Tipping<'a> { + pub fn new() -> Self { + Self::default() + } +} diff --git a/generated/stripe_terminal/src/terminal_configuration/types.rs b/generated/stripe_terminal/src/terminal_configuration/types.rs new file mode 100644 index 000000000..4a3cf4abb --- /dev/null +++ b/generated/stripe_terminal/src/terminal_configuration/types.rs @@ -0,0 +1,29 @@ +/// A Configurations object represents how features should be configured for terminal readers. +/// +/// For more details see <>. +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct TerminalConfiguration { + #[serde(skip_serializing_if = "Option::is_none")] + pub bbpos_wisepos_e: + Option, + /// Unique identifier for the object. + pub id: stripe_terminal::TerminalConfigurationId, + /// Whether this Configuration is the default for your account + pub is_account_default: Option, + /// Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + pub livemode: bool, + #[serde(skip_serializing_if = "Option::is_none")] + pub offline: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub tipping: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub verifone_p400: + Option, +} +impl stripe_types::Object for TerminalConfiguration { + type Id = stripe_terminal::TerminalConfigurationId; + fn id(&self) -> &Self::Id { + &self.id + } +} +stripe_types::def_id!(TerminalConfigurationId, "tmc_"); diff --git a/generated/stripe_terminal/src/terminal_configuration_configuration_resource_currency_specific_config.rs b/generated/stripe_terminal/src/terminal_configuration_configuration_resource_currency_specific_config.rs new file mode 100644 index 000000000..8b850cb67 --- /dev/null +++ b/generated/stripe_terminal/src/terminal_configuration_configuration_resource_currency_specific_config.rs @@ -0,0 +1,12 @@ +#[derive(Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct TerminalConfigurationConfigurationResourceCurrencySpecificConfig { + /// Fixed amounts displayed when collecting a tip + #[serde(skip_serializing_if = "Option::is_none")] + pub fixed_amounts: Option>, + /// Percentages displayed when collecting a tip + #[serde(skip_serializing_if = "Option::is_none")] + pub percentages: Option>, + /// Below this amount, fixed amounts will be displayed; above it, percentages will be displayed + #[serde(skip_serializing_if = "Option::is_none")] + pub smart_tip_threshold: Option, +} diff --git a/generated/stripe_terminal/src/terminal_configuration_configuration_resource_device_type_specific_config.rs b/generated/stripe_terminal/src/terminal_configuration_configuration_resource_device_type_specific_config.rs new file mode 100644 index 000000000..7ac2f16cd --- /dev/null +++ b/generated/stripe_terminal/src/terminal_configuration_configuration_resource_device_type_specific_config.rs @@ -0,0 +1,6 @@ +#[derive(Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct TerminalConfigurationConfigurationResourceDeviceTypeSpecificConfig { + /// A File ID representing an image you would like displayed on the reader. + #[serde(skip_serializing_if = "Option::is_none")] + pub splashscreen: Option>, +} diff --git a/generated/stripe_terminal/src/terminal_configuration_configuration_resource_offline_config.rs b/generated/stripe_terminal/src/terminal_configuration_configuration_resource_offline_config.rs new file mode 100644 index 000000000..3f97bc4f6 --- /dev/null +++ b/generated/stripe_terminal/src/terminal_configuration_configuration_resource_offline_config.rs @@ -0,0 +1,6 @@ +#[derive(Copy, Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct TerminalConfigurationConfigurationResourceOfflineConfig { + /// Determines whether to allow transactions to be collected while reader is offline. + /// Defaults to false. + pub enabled: Option, +} diff --git a/generated/stripe_terminal/src/terminal_configuration_configuration_resource_tipping.rs b/generated/stripe_terminal/src/terminal_configuration_configuration_resource_tipping.rs new file mode 100644 index 000000000..92a96136f --- /dev/null +++ b/generated/stripe_terminal/src/terminal_configuration_configuration_resource_tipping.rs @@ -0,0 +1,45 @@ +#[derive(Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct TerminalConfigurationConfigurationResourceTipping { + #[serde(skip_serializing_if = "Option::is_none")] + pub aud: + Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub cad: + Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub chf: + Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub czk: + Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub dkk: + Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub eur: + Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub gbp: + Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub hkd: + Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub myr: + Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub nok: + Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub nzd: + Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub sek: + Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub sgd: + Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub usd: + Option, +} diff --git a/generated/stripe_terminal/src/terminal_connection_token/mod.rs b/generated/stripe_terminal/src/terminal_connection_token/mod.rs new file mode 100644 index 000000000..402cfe28b --- /dev/null +++ b/generated/stripe_terminal/src/terminal_connection_token/mod.rs @@ -0,0 +1,5 @@ +#[cfg(feature = "terminal_connection_token")] +mod requests; +pub(crate) mod types; +#[cfg(feature = "terminal_connection_token")] +pub use requests::*; diff --git a/generated/stripe_terminal/src/terminal_connection_token/requests.rs b/generated/stripe_terminal/src/terminal_connection_token/requests.rs new file mode 100644 index 000000000..f3e002140 --- /dev/null +++ b/generated/stripe_terminal/src/terminal_connection_token/requests.rs @@ -0,0 +1,27 @@ +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreateTerminalConnectionToken<'a> { + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, + /// The id of the location that this connection token is scoped to. + /// If specified the connection token will only be usable with readers assigned to that location, otherwise the connection token will be usable with all readers. + /// Note that location scoping only applies to internet-connected readers. + /// For more details, see [the docs on scoping connection tokens](https://stripe.com/docs/terminal/fleet/locations#connection-tokens). + #[serde(skip_serializing_if = "Option::is_none")] + pub location: Option<&'a str>, +} +impl<'a> CreateTerminalConnectionToken<'a> { + pub fn new() -> Self { + Self::default() + } +} +impl<'a> CreateTerminalConnectionToken<'a> { + /// To connect to a reader the Stripe Terminal SDK needs to retrieve a short-lived connection token from Stripe, proxied through your server. + /// On your backend, add an endpoint that creates and returns a connection token. + pub fn send( + &self, + client: &stripe::Client, + ) -> stripe::Response { + client.send_form("/terminal/connection_tokens", self, http_types::Method::Post) + } +} diff --git a/generated/stripe_terminal/src/terminal_connection_token/types.rs b/generated/stripe_terminal/src/terminal_connection_token/types.rs new file mode 100644 index 000000000..4b10b55db --- /dev/null +++ b/generated/stripe_terminal/src/terminal_connection_token/types.rs @@ -0,0 +1,15 @@ +/// A Connection Token is used by the Stripe Terminal SDK to connect to a reader. +/// +/// Related guide: [Fleet management](https://stripe.com/docs/terminal/fleet/locations) +/// +/// For more details see <>. +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct TerminalConnectionToken { + /// The id of the location that this connection token is scoped to. + /// Note that location scoping only applies to internet-connected readers. + /// For more details, see [the docs on scoping connection tokens](https://stripe.com/docs/terminal/fleet/locations#connection-tokens). + #[serde(skip_serializing_if = "Option::is_none")] + pub location: Option, + /// Your application should pass this token to the Stripe Terminal SDK. + pub secret: String, +} diff --git a/generated/stripe_terminal/src/terminal_location/mod.rs b/generated/stripe_terminal/src/terminal_location/mod.rs new file mode 100644 index 000000000..72f1519f1 --- /dev/null +++ b/generated/stripe_terminal/src/terminal_location/mod.rs @@ -0,0 +1,5 @@ +#[cfg(feature = "terminal_location")] +mod requests; +pub(crate) mod types; +#[cfg(feature = "terminal_location")] +pub use requests::*; diff --git a/generated/stripe_terminal/src/terminal_location/requests.rs b/generated/stripe_terminal/src/terminal_location/requests.rs new file mode 100644 index 000000000..137fb10ce --- /dev/null +++ b/generated/stripe_terminal/src/terminal_location/requests.rs @@ -0,0 +1,217 @@ +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct DeleteTerminalLocation {} +impl DeleteTerminalLocation { + pub fn new() -> Self { + Self::default() + } +} +impl DeleteTerminalLocation { + /// Deletes a `Location` object. + pub fn send( + &self, + client: &stripe::Client, + location: &stripe_terminal::TerminalLocationId, + ) -> stripe::Response { + client.send_form( + &format!("/terminal/locations/{location}"), + self, + http_types::Method::Delete, + ) + } +} +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct ListTerminalLocation<'a> { + /// A cursor for use in pagination. + /// `ending_before` is an object ID that defines your place in the list. + /// For instance, if you make a list request and receive 100 objects, starting with `obj_bar`, your subsequent call can include `ending_before=obj_bar` in order to fetch the previous page of the list. + #[serde(skip_serializing_if = "Option::is_none")] + pub ending_before: Option<&'a str>, + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, + /// A limit on the number of objects to be returned. + /// Limit can range between 1 and 100, and the default is 10. + #[serde(skip_serializing_if = "Option::is_none")] + pub limit: Option, + /// A cursor for use in pagination. + /// `starting_after` is an object ID that defines your place in the list. + /// For instance, if you make a list request and receive 100 objects, ending with `obj_foo`, your subsequent call can include `starting_after=obj_foo` in order to fetch the next page of the list. + #[serde(skip_serializing_if = "Option::is_none")] + pub starting_after: Option<&'a str>, +} +impl<'a> ListTerminalLocation<'a> { + pub fn new() -> Self { + Self::default() + } +} +impl<'a> ListTerminalLocation<'a> { + /// Returns a list of `Location` objects. + pub fn send( + &self, + client: &stripe::Client, + ) -> stripe::Response> { + client.get_query("/terminal/locations", self) + } + pub fn paginate( + self, + ) -> stripe::ListPaginator> { + stripe::ListPaginator::from_list_params("/terminal/locations", self) + } +} +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct RetrieveTerminalLocation<'a> { + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, +} +impl<'a> RetrieveTerminalLocation<'a> { + pub fn new() -> Self { + Self::default() + } +} +impl<'a> RetrieveTerminalLocation<'a> { + /// Retrieves a `Location` object. + pub fn send( + &self, + client: &stripe::Client, + location: &stripe_terminal::TerminalLocationId, + ) -> stripe::Response { + client.get_query(&format!("/terminal/locations/{location}"), self) + } +} +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +#[serde(untagged)] +pub enum RetrieveTerminalLocationReturned { + TerminalLocation(stripe_terminal::TerminalLocation), + DeletedTerminalLocation(stripe_terminal::DeletedTerminalLocation), +} +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreateTerminalLocation<'a> { + /// The full address of the location. + pub address: CreateTerminalLocationAddress<'a>, + /// The ID of a configuration that will be used to customize all readers in this location. + #[serde(skip_serializing_if = "Option::is_none")] + pub configuration_overrides: Option<&'a str>, + /// A name for the location. + pub display_name: &'a str, + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, + /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. + /// This can be useful for storing additional information about the object in a structured format. + /// Individual keys can be unset by posting an empty value to them. + /// All keys can be unset by posting an empty value to `metadata`. + #[serde(skip_serializing_if = "Option::is_none")] + pub metadata: Option<&'a std::collections::HashMap>, +} +impl<'a> CreateTerminalLocation<'a> { + pub fn new(address: CreateTerminalLocationAddress<'a>, display_name: &'a str) -> Self { + Self { address, configuration_overrides: None, display_name, expand: None, metadata: None } + } +} +/// The full address of the location. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreateTerminalLocationAddress<'a> { + /// City, district, suburb, town, or village. + #[serde(skip_serializing_if = "Option::is_none")] + pub city: Option<&'a str>, + /// Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). + pub country: &'a str, + /// Address line 1 (e.g., street, PO Box, or company name). + #[serde(skip_serializing_if = "Option::is_none")] + pub line1: Option<&'a str>, + /// Address line 2 (e.g., apartment, suite, unit, or building). + #[serde(skip_serializing_if = "Option::is_none")] + pub line2: Option<&'a str>, + /// ZIP or postal code. + #[serde(skip_serializing_if = "Option::is_none")] + pub postal_code: Option<&'a str>, + /// State, county, province, or region. + #[serde(skip_serializing_if = "Option::is_none")] + pub state: Option<&'a str>, +} +impl<'a> CreateTerminalLocationAddress<'a> { + pub fn new(country: &'a str) -> Self { + Self { city: None, country, line1: None, line2: None, postal_code: None, state: None } + } +} +impl<'a> CreateTerminalLocation<'a> { + /// Creates a new `Location` object. + /// For further details, including which address fields are required in each country, see the [Manage locations](https://stripe.com/docs/terminal/fleet/locations) guide. + pub fn send( + &self, + client: &stripe::Client, + ) -> stripe::Response { + client.send_form("/terminal/locations", self, http_types::Method::Post) + } +} +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdateTerminalLocation<'a> { + /// The full address of the location. + #[serde(skip_serializing_if = "Option::is_none")] + pub address: Option>, + /// The ID of a configuration that will be used to customize all readers in this location. + #[serde(skip_serializing_if = "Option::is_none")] + pub configuration_overrides: Option<&'a str>, + /// A name for the location. + #[serde(skip_serializing_if = "Option::is_none")] + pub display_name: Option<&'a str>, + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, + /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. + /// This can be useful for storing additional information about the object in a structured format. + /// Individual keys can be unset by posting an empty value to them. + /// All keys can be unset by posting an empty value to `metadata`. + #[serde(skip_serializing_if = "Option::is_none")] + pub metadata: Option<&'a std::collections::HashMap>, +} +impl<'a> UpdateTerminalLocation<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// The full address of the location. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdateTerminalLocationAddress<'a> { + /// City, district, suburb, town, or village. + #[serde(skip_serializing_if = "Option::is_none")] + pub city: Option<&'a str>, + /// Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). + #[serde(skip_serializing_if = "Option::is_none")] + pub country: Option<&'a str>, + /// Address line 1 (e.g., street, PO Box, or company name). + #[serde(skip_serializing_if = "Option::is_none")] + pub line1: Option<&'a str>, + /// Address line 2 (e.g., apartment, suite, unit, or building). + #[serde(skip_serializing_if = "Option::is_none")] + pub line2: Option<&'a str>, + /// ZIP or postal code. + #[serde(skip_serializing_if = "Option::is_none")] + pub postal_code: Option<&'a str>, + /// State, county, province, or region. + #[serde(skip_serializing_if = "Option::is_none")] + pub state: Option<&'a str>, +} +impl<'a> UpdateTerminalLocationAddress<'a> { + pub fn new() -> Self { + Self::default() + } +} +impl<'a> UpdateTerminalLocation<'a> { + /// Updates a `Location` object by setting the values of the parameters passed. + /// Any parameters not provided will be left unchanged. + pub fn send( + &self, + client: &stripe::Client, + location: &stripe_terminal::TerminalLocationId, + ) -> stripe::Response { + client.send_form(&format!("/terminal/locations/{location}"), self, http_types::Method::Post) + } +} +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +#[serde(untagged)] +pub enum UpdateTerminalLocationReturned { + TerminalLocation(stripe_terminal::TerminalLocation), + DeletedTerminalLocation(stripe_terminal::DeletedTerminalLocation), +} diff --git a/generated/stripe_terminal/src/terminal_location/types.rs b/generated/stripe_terminal/src/terminal_location/types.rs new file mode 100644 index 000000000..d7762ef3a --- /dev/null +++ b/generated/stripe_terminal/src/terminal_location/types.rs @@ -0,0 +1,28 @@ +/// A Location represents a grouping of readers. +/// +/// Related guide: [Fleet management](https://stripe.com/docs/terminal/fleet/locations) +/// +/// For more details see <>. +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct TerminalLocation { + pub address: stripe_shared::Address, + /// The ID of a configuration that will be used to customize all readers in this location. + #[serde(skip_serializing_if = "Option::is_none")] + pub configuration_overrides: Option, + /// The display name of the location. + pub display_name: String, + /// Unique identifier for the object. + pub id: stripe_terminal::TerminalLocationId, + /// Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + pub livemode: bool, + /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. + /// This can be useful for storing additional information about the object in a structured format. + pub metadata: std::collections::HashMap, +} +impl stripe_types::Object for TerminalLocation { + type Id = stripe_terminal::TerminalLocationId; + fn id(&self) -> &Self::Id { + &self.id + } +} +stripe_types::def_id!(TerminalLocationId, "tml_"); diff --git a/generated/stripe_terminal/src/terminal_reader/mod.rs b/generated/stripe_terminal/src/terminal_reader/mod.rs new file mode 100644 index 000000000..132b5bcc2 --- /dev/null +++ b/generated/stripe_terminal/src/terminal_reader/mod.rs @@ -0,0 +1,5 @@ +#[cfg(feature = "terminal_reader")] +mod requests; +pub(crate) mod types; +#[cfg(feature = "terminal_reader")] +pub use requests::*; diff --git a/generated/stripe_terminal/src/terminal_reader/requests.rs b/generated/stripe_terminal/src/terminal_reader/requests.rs new file mode 100644 index 000000000..97b961716 --- /dev/null +++ b/generated/stripe_terminal/src/terminal_reader/requests.rs @@ -0,0 +1,554 @@ +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct DeleteTerminalReader {} +impl DeleteTerminalReader { + pub fn new() -> Self { + Self::default() + } +} +impl DeleteTerminalReader { + /// Deletes a `Reader` object. + pub fn send( + &self, + client: &stripe::Client, + reader: &stripe_terminal::TerminalReaderId, + ) -> stripe::Response { + client.send_form(&format!("/terminal/readers/{reader}"), self, http_types::Method::Delete) + } +} +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct ListTerminalReader<'a> { + /// Filters readers by device type + #[serde(skip_serializing_if = "Option::is_none")] + pub device_type: Option, + /// A cursor for use in pagination. + /// `ending_before` is an object ID that defines your place in the list. + /// For instance, if you make a list request and receive 100 objects, starting with `obj_bar`, your subsequent call can include `ending_before=obj_bar` in order to fetch the previous page of the list. + #[serde(skip_serializing_if = "Option::is_none")] + pub ending_before: Option<&'a str>, + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, + /// A limit on the number of objects to be returned. + /// Limit can range between 1 and 100, and the default is 10. + #[serde(skip_serializing_if = "Option::is_none")] + pub limit: Option, + /// A location ID to filter the response list to only readers at the specific location + #[serde(skip_serializing_if = "Option::is_none")] + pub location: Option<&'a str>, + /// Filters readers by serial number + #[serde(skip_serializing_if = "Option::is_none")] + pub serial_number: Option<&'a str>, + /// A cursor for use in pagination. + /// `starting_after` is an object ID that defines your place in the list. + /// For instance, if you make a list request and receive 100 objects, ending with `obj_foo`, your subsequent call can include `starting_after=obj_foo` in order to fetch the next page of the list. + #[serde(skip_serializing_if = "Option::is_none")] + pub starting_after: Option<&'a str>, + /// A status filter to filter readers to only offline or online readers + #[serde(skip_serializing_if = "Option::is_none")] + pub status: Option, +} +impl<'a> ListTerminalReader<'a> { + pub fn new() -> Self { + Self::default() + } +} +impl<'a> ListTerminalReader<'a> { + /// Returns a list of `Reader` objects. + pub fn send( + &self, + client: &stripe::Client, + ) -> stripe::Response> { + client.get_query("/terminal/readers", self) + } + pub fn paginate( + self, + ) -> stripe::ListPaginator> { + stripe::ListPaginator::from_list_params("/terminal/readers", self) + } +} +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct RetrieveTerminalReader<'a> { + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, +} +impl<'a> RetrieveTerminalReader<'a> { + pub fn new() -> Self { + Self::default() + } +} +impl<'a> RetrieveTerminalReader<'a> { + /// Retrieves a `Reader` object. + pub fn send( + &self, + client: &stripe::Client, + reader: &stripe_terminal::TerminalReaderId, + ) -> stripe::Response { + client.get_query(&format!("/terminal/readers/{reader}"), self) + } +} +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +#[serde(untagged)] +pub enum RetrieveTerminalReaderReturned { + TerminalReader(stripe_terminal::TerminalReader), + DeletedTerminalReader(stripe_terminal::DeletedTerminalReader), +} +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreateTerminalReader<'a> { + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, + /// Custom label given to the reader for easier identification. + /// If no label is specified, the registration code will be used. + #[serde(skip_serializing_if = "Option::is_none")] + pub label: Option<&'a str>, + /// The location to assign the reader to. + #[serde(skip_serializing_if = "Option::is_none")] + pub location: Option<&'a str>, + /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. + /// This can be useful for storing additional information about the object in a structured format. + /// Individual keys can be unset by posting an empty value to them. + /// All keys can be unset by posting an empty value to `metadata`. + #[serde(skip_serializing_if = "Option::is_none")] + pub metadata: Option<&'a std::collections::HashMap>, + /// A code generated by the reader used for registering to an account. + pub registration_code: &'a str, +} +impl<'a> CreateTerminalReader<'a> { + pub fn new(registration_code: &'a str) -> Self { + Self { expand: None, label: None, location: None, metadata: None, registration_code } + } +} +impl<'a> CreateTerminalReader<'a> { + /// Creates a new `Reader` object. + pub fn send( + &self, + client: &stripe::Client, + ) -> stripe::Response { + client.send_form("/terminal/readers", self, http_types::Method::Post) + } +} +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdateTerminalReader<'a> { + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, + /// The new label of the reader. + #[serde(skip_serializing_if = "Option::is_none")] + pub label: Option<&'a str>, + /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. + /// This can be useful for storing additional information about the object in a structured format. + /// Individual keys can be unset by posting an empty value to them. + /// All keys can be unset by posting an empty value to `metadata`. + #[serde(skip_serializing_if = "Option::is_none")] + pub metadata: Option<&'a std::collections::HashMap>, +} +impl<'a> UpdateTerminalReader<'a> { + pub fn new() -> Self { + Self::default() + } +} +impl<'a> UpdateTerminalReader<'a> { + /// Updates a `Reader` object by setting the values of the parameters passed. + /// Any parameters not provided will be left unchanged. + pub fn send( + &self, + client: &stripe::Client, + reader: &stripe_terminal::TerminalReaderId, + ) -> stripe::Response { + client.send_form(&format!("/terminal/readers/{reader}"), self, http_types::Method::Post) + } +} +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +#[serde(untagged)] +pub enum UpdateTerminalReaderReturned { + TerminalReader(stripe_terminal::TerminalReader), + DeletedTerminalReader(stripe_terminal::DeletedTerminalReader), +} +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CancelActionTerminalReader<'a> { + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, +} +impl<'a> CancelActionTerminalReader<'a> { + pub fn new() -> Self { + Self::default() + } +} +impl<'a> CancelActionTerminalReader<'a> { + /// Cancels the current reader action. + pub fn send( + &self, + client: &stripe::Client, + reader: &stripe_terminal::TerminalReaderId, + ) -> stripe::Response { + client.send_form( + &format!("/terminal/readers/{reader}/cancel_action"), + self, + http_types::Method::Post, + ) + } +} +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct ProcessPaymentIntentTerminalReader<'a> { + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, + /// PaymentIntent ID + pub payment_intent: &'a str, + /// Configuration overrides + #[serde(skip_serializing_if = "Option::is_none")] + pub process_config: Option, +} +impl<'a> ProcessPaymentIntentTerminalReader<'a> { + pub fn new(payment_intent: &'a str) -> Self { + Self { expand: None, payment_intent, process_config: None } + } +} +/// Configuration overrides +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct ProcessPaymentIntentTerminalReaderProcessConfig { + /// Override showing a tipping selection screen on this transaction. + #[serde(skip_serializing_if = "Option::is_none")] + pub skip_tipping: Option, + /// Tipping configuration for this transaction. + #[serde(skip_serializing_if = "Option::is_none")] + pub tipping: Option, +} +impl ProcessPaymentIntentTerminalReaderProcessConfig { + pub fn new() -> Self { + Self::default() + } +} +/// Tipping configuration for this transaction. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct ProcessPaymentIntentTerminalReaderProcessConfigTipping { + /// Amount used to calculate tip suggestions on tipping selection screen for this transaction. + /// Must be a positive integer in the smallest currency unit (e.g., 100 cents to represent $1.00 or 100 to represent ¥100, a zero-decimal currency). + #[serde(skip_serializing_if = "Option::is_none")] + pub amount_eligible: Option, +} +impl ProcessPaymentIntentTerminalReaderProcessConfigTipping { + pub fn new() -> Self { + Self::default() + } +} +impl<'a> ProcessPaymentIntentTerminalReader<'a> { + /// Initiates a payment flow on a Reader. + pub fn send( + &self, + client: &stripe::Client, + reader: &stripe_terminal::TerminalReaderId, + ) -> stripe::Response { + client.send_form( + &format!("/terminal/readers/{reader}/process_payment_intent"), + self, + http_types::Method::Post, + ) + } +} +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct ProcessSetupIntentTerminalReader<'a> { + /// Customer Consent Collected + pub customer_consent_collected: bool, + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, + /// Configuration overrides + #[serde(skip_serializing_if = "Option::is_none")] + pub process_config: Option<&'a serde_json::Value>, + /// SetupIntent ID + pub setup_intent: &'a str, +} +impl<'a> ProcessSetupIntentTerminalReader<'a> { + pub fn new(customer_consent_collected: bool, setup_intent: &'a str) -> Self { + Self { customer_consent_collected, expand: None, process_config: None, setup_intent } + } +} +impl<'a> ProcessSetupIntentTerminalReader<'a> { + /// Initiates a setup intent flow on a Reader. + pub fn send( + &self, + client: &stripe::Client, + reader: &stripe_terminal::TerminalReaderId, + ) -> stripe::Response { + client.send_form( + &format!("/terminal/readers/{reader}/process_setup_intent"), + self, + http_types::Method::Post, + ) + } +} +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct RefundPaymentTerminalReader<'a> { + /// A positive integer in __cents__ representing how much of this charge to refund. + #[serde(skip_serializing_if = "Option::is_none")] + pub amount: Option, + /// ID of the Charge to refund. + #[serde(skip_serializing_if = "Option::is_none")] + pub charge: Option<&'a str>, + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, + /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. + /// This can be useful for storing additional information about the object in a structured format. + /// Individual keys can be unset by posting an empty value to them. + /// All keys can be unset by posting an empty value to `metadata`. + #[serde(skip_serializing_if = "Option::is_none")] + pub metadata: Option<&'a std::collections::HashMap>, + /// ID of the PaymentIntent to refund. + #[serde(skip_serializing_if = "Option::is_none")] + pub payment_intent: Option<&'a str>, + /// Boolean indicating whether the application fee should be refunded when refunding this charge. + /// If a full charge refund is given, the full application fee will be refunded. + /// Otherwise, the application fee will be refunded in an amount proportional to the amount of the charge refunded. + /// An application fee can be refunded only by the application that created the charge. + #[serde(skip_serializing_if = "Option::is_none")] + pub refund_application_fee: Option, + /// Boolean indicating whether the transfer should be reversed when refunding this charge. + /// The transfer will be reversed proportionally to the amount being refunded (either the entire or partial amount). + /// A transfer can be reversed only by the application that created the charge. + #[serde(skip_serializing_if = "Option::is_none")] + pub reverse_transfer: Option, +} +impl<'a> RefundPaymentTerminalReader<'a> { + pub fn new() -> Self { + Self::default() + } +} +impl<'a> RefundPaymentTerminalReader<'a> { + /// Initiates a refund on a Reader + pub fn send( + &self, + client: &stripe::Client, + reader: &stripe_terminal::TerminalReaderId, + ) -> stripe::Response { + client.send_form( + &format!("/terminal/readers/{reader}/refund_payment"), + self, + http_types::Method::Post, + ) + } +} +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct SetReaderDisplayTerminalReader<'a> { + /// Cart + #[serde(skip_serializing_if = "Option::is_none")] + pub cart: Option>, + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, + /// Type + #[serde(rename = "type")] + pub type_: SetReaderDisplayTerminalReaderType, +} +impl<'a> SetReaderDisplayTerminalReader<'a> { + pub fn new(type_: SetReaderDisplayTerminalReaderType) -> Self { + Self { cart: None, expand: None, type_ } + } +} +/// Cart +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct SetReaderDisplayTerminalReaderCart<'a> { + /// Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. + /// Must be a [supported currency](https://stripe.com/docs/currencies). + pub currency: stripe_types::Currency, + /// Array of line items that were purchased. + pub line_items: &'a [SetReaderDisplayTerminalReaderCartLineItems<'a>], + /// The amount of tax in cents. + #[serde(skip_serializing_if = "Option::is_none")] + pub tax: Option, + /// Total balance of cart due in cents. + pub total: i64, +} +impl<'a> SetReaderDisplayTerminalReaderCart<'a> { + pub fn new( + currency: stripe_types::Currency, + line_items: &'a [SetReaderDisplayTerminalReaderCartLineItems<'a>], + total: i64, + ) -> Self { + Self { currency, line_items, tax: None, total } + } +} +/// Array of line items that were purchased. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct SetReaderDisplayTerminalReaderCartLineItems<'a> { + /// The price of the item in cents. + pub amount: i64, + /// The description or name of the item. + pub description: &'a str, + /// The quantity of the line item being purchased. + pub quantity: u64, +} +impl<'a> SetReaderDisplayTerminalReaderCartLineItems<'a> { + pub fn new(amount: i64, description: &'a str, quantity: u64) -> Self { + Self { amount, description, quantity } + } +} +/// Type +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum SetReaderDisplayTerminalReaderType { + Cart, +} +impl SetReaderDisplayTerminalReaderType { + pub fn as_str(self) -> &'static str { + use SetReaderDisplayTerminalReaderType::*; + match self { + Cart => "cart", + } + } +} + +impl std::str::FromStr for SetReaderDisplayTerminalReaderType { + type Err = (); + fn from_str(s: &str) -> Result { + use SetReaderDisplayTerminalReaderType::*; + match s { + "cart" => Ok(Cart), + _ => Err(()), + } + } +} +impl std::fmt::Display for SetReaderDisplayTerminalReaderType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for SetReaderDisplayTerminalReaderType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for SetReaderDisplayTerminalReaderType { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'a> SetReaderDisplayTerminalReader<'a> { + /// Sets reader display to show cart details. + pub fn send( + &self, + client: &stripe::Client, + reader: &stripe_terminal::TerminalReaderId, + ) -> stripe::Response { + client.send_form( + &format!("/terminal/readers/{reader}/set_reader_display"), + self, + http_types::Method::Post, + ) + } +} +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct PresentPaymentMethodTerminalReader<'a> { + /// Simulated on-reader tip amount. + #[serde(skip_serializing_if = "Option::is_none")] + pub amount_tip: Option, + /// Simulated data for the card_present payment method. + #[serde(skip_serializing_if = "Option::is_none")] + pub card_present: Option>, + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, + /// Simulated data for the interac_present payment method. + #[serde(skip_serializing_if = "Option::is_none")] + pub interac_present: Option>, + /// Simulated payment type. + #[serde(rename = "type")] + #[serde(skip_serializing_if = "Option::is_none")] + pub type_: Option, +} +impl<'a> PresentPaymentMethodTerminalReader<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// Simulated data for the card_present payment method. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct PresentPaymentMethodTerminalReaderCardPresent<'a> { + /// The card number, as a string without any separators. + #[serde(skip_serializing_if = "Option::is_none")] + pub number: Option<&'a str>, +} +impl<'a> PresentPaymentMethodTerminalReaderCardPresent<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// Simulated data for the interac_present payment method. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct PresentPaymentMethodTerminalReaderInteracPresent<'a> { + /// Card Number + #[serde(skip_serializing_if = "Option::is_none")] + pub number: Option<&'a str>, +} +impl<'a> PresentPaymentMethodTerminalReaderInteracPresent<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// Simulated payment type. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum PresentPaymentMethodTerminalReaderType { + CardPresent, + InteracPresent, +} +impl PresentPaymentMethodTerminalReaderType { + pub fn as_str(self) -> &'static str { + use PresentPaymentMethodTerminalReaderType::*; + match self { + CardPresent => "card_present", + InteracPresent => "interac_present", + } + } +} + +impl std::str::FromStr for PresentPaymentMethodTerminalReaderType { + type Err = (); + fn from_str(s: &str) -> Result { + use PresentPaymentMethodTerminalReaderType::*; + match s { + "card_present" => Ok(CardPresent), + "interac_present" => Ok(InteracPresent), + _ => Err(()), + } + } +} +impl std::fmt::Display for PresentPaymentMethodTerminalReaderType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for PresentPaymentMethodTerminalReaderType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for PresentPaymentMethodTerminalReaderType { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'a> PresentPaymentMethodTerminalReader<'a> { + /// Presents a payment method on a simulated reader. + /// Can be used to simulate accepting a payment, saving a card or refunding a transaction. + pub fn send( + &self, + client: &stripe::Client, + reader: &str, + ) -> stripe::Response { + client.send_form( + &format!("/test_helpers/terminal/readers/{reader}/present_payment_method"), + self, + http_types::Method::Post, + ) + } +} diff --git a/generated/stripe_terminal/src/terminal_reader/types.rs b/generated/stripe_terminal/src/terminal_reader/types.rs new file mode 100644 index 000000000..8f2edbcd7 --- /dev/null +++ b/generated/stripe_terminal/src/terminal_reader/types.rs @@ -0,0 +1,156 @@ +/// A Reader represents a physical device for accepting payment details. +/// +/// Related guide: [Connecting to a reader](https://stripe.com/docs/terminal/payments/connect-reader) +/// +/// For more details see <>. +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct TerminalReader { + /// The most recent action performed by the reader. + pub action: Option, + /// The current software version of the reader. + pub device_sw_version: Option, + /// Type of reader, one of `bbpos_wisepad3`, `stripe_m2`, `bbpos_chipper2x`, `bbpos_wisepos_e`, `verifone_P400`, or `simulated_wisepos_e`. + pub device_type: stripe_terminal::TerminalReaderDeviceType, + /// Unique identifier for the object. + pub id: stripe_terminal::TerminalReaderId, + /// The local IP address of the reader. + pub ip_address: Option, + /// Custom label given to the reader for easier identification. + pub label: String, + /// Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + pub livemode: bool, + /// The location identifier of the reader. + pub location: Option>, + /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. + /// This can be useful for storing additional information about the object in a structured format. + pub metadata: std::collections::HashMap, + /// Serial number of the reader. + pub serial_number: String, + /// The networking status of the reader. + pub status: Option, +} +impl stripe_types::Object for TerminalReader { + type Id = stripe_terminal::TerminalReaderId; + fn id(&self) -> &Self::Id { + &self.id + } +} +stripe_types::def_id!(TerminalReaderId, "tmr_"); +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum TerminalReaderDeviceType { + BbposChipper2x, + BbposWisepad3, + BbposWiseposE, + SimulatedWiseposE, + StripeM2, + VerifoneP400, +} +impl TerminalReaderDeviceType { + pub fn as_str(self) -> &'static str { + use TerminalReaderDeviceType::*; + match self { + BbposChipper2x => "bbpos_chipper2x", + BbposWisepad3 => "bbpos_wisepad3", + BbposWiseposE => "bbpos_wisepos_e", + SimulatedWiseposE => "simulated_wisepos_e", + StripeM2 => "stripe_m2", + VerifoneP400 => "verifone_P400", + } + } +} + +impl std::str::FromStr for TerminalReaderDeviceType { + type Err = (); + fn from_str(s: &str) -> Result { + use TerminalReaderDeviceType::*; + match s { + "bbpos_chipper2x" => Ok(BbposChipper2x), + "bbpos_wisepad3" => Ok(BbposWisepad3), + "bbpos_wisepos_e" => Ok(BbposWiseposE), + "simulated_wisepos_e" => Ok(SimulatedWiseposE), + "stripe_m2" => Ok(StripeM2), + "verifone_P400" => Ok(VerifoneP400), + _ => Err(()), + } + } +} +impl std::fmt::Display for TerminalReaderDeviceType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for TerminalReaderDeviceType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for TerminalReaderDeviceType { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for TerminalReaderDeviceType { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s) + .map_err(|_| serde::de::Error::custom("Unknown value for TerminalReaderDeviceType")) + } +} +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum TerminalReaderStatus { + Offline, + Online, +} +impl TerminalReaderStatus { + pub fn as_str(self) -> &'static str { + use TerminalReaderStatus::*; + match self { + Offline => "offline", + Online => "online", + } + } +} + +impl std::str::FromStr for TerminalReaderStatus { + type Err = (); + fn from_str(s: &str) -> Result { + use TerminalReaderStatus::*; + match s { + "offline" => Ok(Offline), + "online" => Ok(Online), + _ => Err(()), + } + } +} +impl std::fmt::Display for TerminalReaderStatus { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for TerminalReaderStatus { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for TerminalReaderStatus { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for TerminalReaderStatus { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s) + .map_err(|_| serde::de::Error::custom("Unknown value for TerminalReaderStatus")) + } +} diff --git a/generated/stripe_terminal/src/terminal_reader_reader_resource_cart.rs b/generated/stripe_terminal/src/terminal_reader_reader_resource_cart.rs new file mode 100644 index 000000000..0ce7ac835 --- /dev/null +++ b/generated/stripe_terminal/src/terminal_reader_reader_resource_cart.rs @@ -0,0 +1,15 @@ +/// Represents a cart to be displayed on the reader +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct TerminalReaderReaderResourceCart { + /// Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. + /// Must be a [supported currency](https://stripe.com/docs/currencies). + pub currency: stripe_types::Currency, + /// List of line items in the cart. + pub line_items: Vec, + /// Tax amount for the entire cart. + /// A positive integer in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal). + pub tax: Option, + /// Total amount for the entire cart, including tax. + /// A positive integer in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal). + pub total: i64, +} diff --git a/generated/stripe_terminal/src/terminal_reader_reader_resource_line_item.rs b/generated/stripe_terminal/src/terminal_reader_reader_resource_line_item.rs new file mode 100644 index 000000000..82077341a --- /dev/null +++ b/generated/stripe_terminal/src/terminal_reader_reader_resource_line_item.rs @@ -0,0 +1,11 @@ +/// Represents a line item to be displayed on the reader +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct TerminalReaderReaderResourceLineItem { + /// The amount of the line item. + /// A positive integer in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal). + pub amount: i64, + /// Description of the line item. + pub description: String, + /// The quantity of the line item. + pub quantity: u64, +} diff --git a/generated/stripe_terminal/src/terminal_reader_reader_resource_process_config.rs b/generated/stripe_terminal/src/terminal_reader_reader_resource_process_config.rs new file mode 100644 index 000000000..000d3e32d --- /dev/null +++ b/generated/stripe_terminal/src/terminal_reader_reader_resource_process_config.rs @@ -0,0 +1,9 @@ +/// Represents a per-transaction override of a reader configuration +#[derive(Copy, Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct TerminalReaderReaderResourceProcessConfig { + /// Override showing a tipping selection screen on this transaction. + #[serde(skip_serializing_if = "Option::is_none")] + pub skip_tipping: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub tipping: Option, +} diff --git a/generated/stripe_terminal/src/terminal_reader_reader_resource_process_payment_intent_action.rs b/generated/stripe_terminal/src/terminal_reader_reader_resource_process_payment_intent_action.rs new file mode 100644 index 000000000..9c89f8a78 --- /dev/null +++ b/generated/stripe_terminal/src/terminal_reader_reader_resource_process_payment_intent_action.rs @@ -0,0 +1,8 @@ +/// Represents a reader action to process a payment intent +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct TerminalReaderReaderResourceProcessPaymentIntentAction { + /// Most recent PaymentIntent processed by the reader. + pub payment_intent: stripe_types::Expandable, + #[serde(skip_serializing_if = "Option::is_none")] + pub process_config: Option, +} diff --git a/generated/stripe_terminal/src/terminal_reader_reader_resource_process_setup_config.rs b/generated/stripe_terminal/src/terminal_reader_reader_resource_process_setup_config.rs new file mode 100644 index 000000000..3fbdbe812 --- /dev/null +++ b/generated/stripe_terminal/src/terminal_reader_reader_resource_process_setup_config.rs @@ -0,0 +1,3 @@ +/// Represents a per-setup override of a reader configuration +#[derive(Copy, Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct TerminalReaderReaderResourceProcessSetupConfig {} diff --git a/generated/stripe_terminal/src/terminal_reader_reader_resource_process_setup_intent_action.rs b/generated/stripe_terminal/src/terminal_reader_reader_resource_process_setup_intent_action.rs new file mode 100644 index 000000000..75247c62c --- /dev/null +++ b/generated/stripe_terminal/src/terminal_reader_reader_resource_process_setup_intent_action.rs @@ -0,0 +1,12 @@ +/// Represents a reader action to process a setup intent +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct TerminalReaderReaderResourceProcessSetupIntentAction { + /// ID of a card PaymentMethod generated from the card_present PaymentMethod that may be attached to a Customer for future transactions. + /// Only present if it was possible to generate a card PaymentMethod. + #[serde(skip_serializing_if = "Option::is_none")] + pub generated_card: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub process_config: Option, + /// Most recent SetupIntent processed by the reader. + pub setup_intent: stripe_types::Expandable, +} diff --git a/generated/stripe_terminal/src/terminal_reader_reader_resource_reader_action.rs b/generated/stripe_terminal/src/terminal_reader_reader_resource_reader_action.rs new file mode 100644 index 000000000..712d32a68 --- /dev/null +++ b/generated/stripe_terminal/src/terminal_reader_reader_resource_reader_action.rs @@ -0,0 +1,147 @@ +/// Represents an action performed by the reader +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct TerminalReaderReaderResourceReaderAction { + /// Failure code, only set if status is `failed`. + pub failure_code: Option, + /// Detailed failure message, only set if status is `failed`. + pub failure_message: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub process_payment_intent: + Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub process_setup_intent: + Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub refund_payment: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub set_reader_display: + Option, + /// Status of the action performed by the reader. + pub status: TerminalReaderReaderResourceReaderActionStatus, + /// Type of action performed by the reader. + #[serde(rename = "type")] + pub type_: TerminalReaderReaderResourceReaderActionType, +} +/// Status of the action performed by the reader. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum TerminalReaderReaderResourceReaderActionStatus { + Failed, + InProgress, + Succeeded, +} +impl TerminalReaderReaderResourceReaderActionStatus { + pub fn as_str(self) -> &'static str { + use TerminalReaderReaderResourceReaderActionStatus::*; + match self { + Failed => "failed", + InProgress => "in_progress", + Succeeded => "succeeded", + } + } +} + +impl std::str::FromStr for TerminalReaderReaderResourceReaderActionStatus { + type Err = (); + fn from_str(s: &str) -> Result { + use TerminalReaderReaderResourceReaderActionStatus::*; + match s { + "failed" => Ok(Failed), + "in_progress" => Ok(InProgress), + "succeeded" => Ok(Succeeded), + _ => Err(()), + } + } +} +impl std::fmt::Display for TerminalReaderReaderResourceReaderActionStatus { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for TerminalReaderReaderResourceReaderActionStatus { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for TerminalReaderReaderResourceReaderActionStatus { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for TerminalReaderReaderResourceReaderActionStatus { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| { + serde::de::Error::custom( + "Unknown value for TerminalReaderReaderResourceReaderActionStatus", + ) + }) + } +} +/// Type of action performed by the reader. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum TerminalReaderReaderResourceReaderActionType { + ProcessPaymentIntent, + ProcessSetupIntent, + RefundPayment, + SetReaderDisplay, +} +impl TerminalReaderReaderResourceReaderActionType { + pub fn as_str(self) -> &'static str { + use TerminalReaderReaderResourceReaderActionType::*; + match self { + ProcessPaymentIntent => "process_payment_intent", + ProcessSetupIntent => "process_setup_intent", + RefundPayment => "refund_payment", + SetReaderDisplay => "set_reader_display", + } + } +} + +impl std::str::FromStr for TerminalReaderReaderResourceReaderActionType { + type Err = (); + fn from_str(s: &str) -> Result { + use TerminalReaderReaderResourceReaderActionType::*; + match s { + "process_payment_intent" => Ok(ProcessPaymentIntent), + "process_setup_intent" => Ok(ProcessSetupIntent), + "refund_payment" => Ok(RefundPayment), + "set_reader_display" => Ok(SetReaderDisplay), + _ => Err(()), + } + } +} +impl std::fmt::Display for TerminalReaderReaderResourceReaderActionType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for TerminalReaderReaderResourceReaderActionType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for TerminalReaderReaderResourceReaderActionType { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for TerminalReaderReaderResourceReaderActionType { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| { + serde::de::Error::custom( + "Unknown value for TerminalReaderReaderResourceReaderActionType", + ) + }) + } +} diff --git a/generated/stripe_terminal/src/terminal_reader_reader_resource_refund_payment_action.rs b/generated/stripe_terminal/src/terminal_reader_reader_resource_refund_payment_action.rs new file mode 100644 index 000000000..73202eff9 --- /dev/null +++ b/generated/stripe_terminal/src/terminal_reader_reader_resource_refund_payment_action.rs @@ -0,0 +1,94 @@ +/// Represents a reader action to refund a payment +#[derive(Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct TerminalReaderReaderResourceRefundPaymentAction { + /// The amount being refunded. + #[serde(skip_serializing_if = "Option::is_none")] + pub amount: Option, + /// Charge that is being refunded. + #[serde(skip_serializing_if = "Option::is_none")] + pub charge: Option>, + /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. + /// This can be useful for storing additional information about the object in a structured format. + #[serde(skip_serializing_if = "Option::is_none")] + pub metadata: Option>, + /// Payment intent that is being refunded. + #[serde(skip_serializing_if = "Option::is_none")] + pub payment_intent: Option>, + /// The reason for the refund. + #[serde(skip_serializing_if = "Option::is_none")] + pub reason: Option, + /// Unique identifier for the refund object. + #[serde(skip_serializing_if = "Option::is_none")] + pub refund: Option>, + /// Boolean indicating whether the application fee should be refunded when refunding this charge. + /// If a full charge refund is given, the full application fee will be refunded. + /// Otherwise, the application fee will be refunded in an amount proportional to the amount of the charge refunded. + /// An application fee can be refunded only by the application that created the charge. + #[serde(skip_serializing_if = "Option::is_none")] + pub refund_application_fee: Option, + /// Boolean indicating whether the transfer should be reversed when refunding this charge. + /// The transfer will be reversed proportionally to the amount being refunded (either the entire or partial amount). + /// A transfer can be reversed only by the application that created the charge. + #[serde(skip_serializing_if = "Option::is_none")] + pub reverse_transfer: Option, +} +/// The reason for the refund. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum TerminalReaderReaderResourceRefundPaymentActionReason { + Duplicate, + Fraudulent, + RequestedByCustomer, +} +impl TerminalReaderReaderResourceRefundPaymentActionReason { + pub fn as_str(self) -> &'static str { + use TerminalReaderReaderResourceRefundPaymentActionReason::*; + match self { + Duplicate => "duplicate", + Fraudulent => "fraudulent", + RequestedByCustomer => "requested_by_customer", + } + } +} + +impl std::str::FromStr for TerminalReaderReaderResourceRefundPaymentActionReason { + type Err = (); + fn from_str(s: &str) -> Result { + use TerminalReaderReaderResourceRefundPaymentActionReason::*; + match s { + "duplicate" => Ok(Duplicate), + "fraudulent" => Ok(Fraudulent), + "requested_by_customer" => Ok(RequestedByCustomer), + _ => Err(()), + } + } +} +impl std::fmt::Display for TerminalReaderReaderResourceRefundPaymentActionReason { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for TerminalReaderReaderResourceRefundPaymentActionReason { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for TerminalReaderReaderResourceRefundPaymentActionReason { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for TerminalReaderReaderResourceRefundPaymentActionReason { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| { + serde::de::Error::custom( + "Unknown value for TerminalReaderReaderResourceRefundPaymentActionReason", + ) + }) + } +} diff --git a/generated/stripe_terminal/src/terminal_reader_reader_resource_set_reader_display_action.rs b/generated/stripe_terminal/src/terminal_reader_reader_resource_set_reader_display_action.rs new file mode 100644 index 000000000..622300a8d --- /dev/null +++ b/generated/stripe_terminal/src/terminal_reader_reader_resource_set_reader_display_action.rs @@ -0,0 +1,63 @@ +/// Represents a reader action to set the reader display +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct TerminalReaderReaderResourceSetReaderDisplayAction { + /// Cart object to be displayed by the reader. + pub cart: Option, + /// Type of information to be displayed by the reader. + #[serde(rename = "type")] + pub type_: TerminalReaderReaderResourceSetReaderDisplayActionType, +} +/// Type of information to be displayed by the reader. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum TerminalReaderReaderResourceSetReaderDisplayActionType { + Cart, +} +impl TerminalReaderReaderResourceSetReaderDisplayActionType { + pub fn as_str(self) -> &'static str { + use TerminalReaderReaderResourceSetReaderDisplayActionType::*; + match self { + Cart => "cart", + } + } +} + +impl std::str::FromStr for TerminalReaderReaderResourceSetReaderDisplayActionType { + type Err = (); + fn from_str(s: &str) -> Result { + use TerminalReaderReaderResourceSetReaderDisplayActionType::*; + match s { + "cart" => Ok(Cart), + _ => Err(()), + } + } +} +impl std::fmt::Display for TerminalReaderReaderResourceSetReaderDisplayActionType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for TerminalReaderReaderResourceSetReaderDisplayActionType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for TerminalReaderReaderResourceSetReaderDisplayActionType { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for TerminalReaderReaderResourceSetReaderDisplayActionType { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| { + serde::de::Error::custom( + "Unknown value for TerminalReaderReaderResourceSetReaderDisplayActionType", + ) + }) + } +} diff --git a/generated/stripe_terminal/src/terminal_reader_reader_resource_tipping_config.rs b/generated/stripe_terminal/src/terminal_reader_reader_resource_tipping_config.rs new file mode 100644 index 000000000..7c7199602 --- /dev/null +++ b/generated/stripe_terminal/src/terminal_reader_reader_resource_tipping_config.rs @@ -0,0 +1,8 @@ +/// Represents a per-transaction tipping configuration +#[derive(Copy, Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct TerminalReaderReaderResourceTippingConfig { + /// Amount used to calculate tip suggestions on tipping selection screen for this transaction. + /// Must be a positive integer in the smallest currency unit (e.g., 100 cents to represent $1.00 or 100 to represent ¥100, a zero-decimal currency). + #[serde(skip_serializing_if = "Option::is_none")] + pub amount_eligible: Option, +} diff --git a/generated/stripe_treasury/Cargo.toml b/generated/stripe_treasury/Cargo.toml new file mode 100644 index 000000000..7595a426f --- /dev/null +++ b/generated/stripe_treasury/Cargo.toml @@ -0,0 +1,64 @@ +[package] +name = "stripe_treasury" +version.workspace = true +description.workspace = true +edition.workspace = true +rust-version.workspace = true +authors.workspace = true +license.workspace = true +homepage.workspace = true +repository.workspace = true +keywords.workspace = true +categories.workspace = true + +[lib] +path = "src/mod.rs" + +[dependencies] +serde.workspace = true +smol_str.workspace = true +serde_json.workspace = true +stripe_types = {path = "../../stripe_types"} + +http-types.workspace = true +async-stripe = {path = "../../async-stripe"} + + +stripe_shared = {path = "../../generated/stripe_shared"} + + +[features] +runtime-tokio-hyper = ["async-stripe/runtime-tokio-hyper"] +runtime-tokio-hyper-rustls = ["async-stripe/runtime-tokio-hyper-rustls"] +runtime-tokio-hyper-rustls-webpki = ["async-stripe/runtime-tokio-hyper-rustls-webpki"] +runtime-blocking = ["async-stripe/runtime-blocking"] +runtime-blocking-rustls = ["async-stripe/runtime-blocking-rustls"] +runtime-blocking-rustls-webpki = ["async-stripe/runtime-blocking-rustls-webpki"] +runtime-async-std-surf = ["async-stripe/runtime-async-std-surf"] + +treasury_credit_reversal = [] +treasury_debit_reversal = [] +treasury_financial_account = [] +treasury_inbound_transfer = [] +treasury_outbound_payment = [] +treasury_outbound_transfer = [] +treasury_received_credit = [] +treasury_received_debit = [] +treasury_transaction = [] +treasury_transaction_entry = [] + +full = ["treasury_credit_reversal", +"treasury_debit_reversal", +"treasury_financial_account", +"treasury_inbound_transfer", +"treasury_outbound_payment", +"treasury_outbound_transfer", +"treasury_received_credit", +"treasury_received_debit", +"treasury_transaction", +"treasury_transaction_entry"] + + +[package.metadata.docs.rs] +features = ["runtime-tokio-hyper", "full"] + diff --git a/generated/stripe_treasury/src/inbound_transfers.rs b/generated/stripe_treasury/src/inbound_transfers.rs new file mode 100644 index 000000000..252f6141d --- /dev/null +++ b/generated/stripe_treasury/src/inbound_transfers.rs @@ -0,0 +1,61 @@ +/// For more details see <>. +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct InboundTransfers { + pub billing_details: stripe_treasury::TreasurySharedResourceBillingDetails, + /// The type of the payment method used in the InboundTransfer. + #[serde(rename = "type")] + pub type_: InboundTransfersType, + #[serde(skip_serializing_if = "Option::is_none")] + pub us_bank_account: Option, +} +/// The type of the payment method used in the InboundTransfer. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum InboundTransfersType { + UsBankAccount, +} +impl InboundTransfersType { + pub fn as_str(self) -> &'static str { + use InboundTransfersType::*; + match self { + UsBankAccount => "us_bank_account", + } + } +} + +impl std::str::FromStr for InboundTransfersType { + type Err = (); + fn from_str(s: &str) -> Result { + use InboundTransfersType::*; + match s { + "us_bank_account" => Ok(UsBankAccount), + _ => Err(()), + } + } +} +impl std::fmt::Display for InboundTransfersType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for InboundTransfersType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for InboundTransfersType { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for InboundTransfersType { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s) + .map_err(|_| serde::de::Error::custom("Unknown value for InboundTransfersType")) + } +} diff --git a/generated/stripe_treasury/src/inbound_transfers_payment_method_details_us_bank_account.rs b/generated/stripe_treasury/src/inbound_transfers_payment_method_details_us_bank_account.rs new file mode 100644 index 000000000..1dcbda518 --- /dev/null +++ b/generated/stripe_treasury/src/inbound_transfers_payment_method_details_us_bank_account.rs @@ -0,0 +1,185 @@ +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct InboundTransfersPaymentMethodDetailsUsBankAccount { + /// Account holder type: individual or company. + pub account_holder_type: + Option, + /// Account type: checkings or savings. Defaults to checking if omitted. + pub account_type: Option, + /// Name of the bank associated with the bank account. + pub bank_name: Option, + /// Uniquely identifies this particular bank account. + /// You can use this attribute to check whether two bank accounts are the same. + pub fingerprint: Option, + /// Last four digits of the bank account number. + pub last4: Option, + /// The US bank account network used to debit funds. + pub network: InboundTransfersPaymentMethodDetailsUsBankAccountNetwork, + /// Routing number of the bank account. + pub routing_number: Option, +} +/// Account holder type: individual or company. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum InboundTransfersPaymentMethodDetailsUsBankAccountAccountHolderType { + Company, + Individual, +} +impl InboundTransfersPaymentMethodDetailsUsBankAccountAccountHolderType { + pub fn as_str(self) -> &'static str { + use InboundTransfersPaymentMethodDetailsUsBankAccountAccountHolderType::*; + match self { + Company => "company", + Individual => "individual", + } + } +} + +impl std::str::FromStr for InboundTransfersPaymentMethodDetailsUsBankAccountAccountHolderType { + type Err = (); + fn from_str(s: &str) -> Result { + use InboundTransfersPaymentMethodDetailsUsBankAccountAccountHolderType::*; + match s { + "company" => Ok(Company), + "individual" => Ok(Individual), + _ => Err(()), + } + } +} +impl std::fmt::Display for InboundTransfersPaymentMethodDetailsUsBankAccountAccountHolderType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for InboundTransfersPaymentMethodDetailsUsBankAccountAccountHolderType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for InboundTransfersPaymentMethodDetailsUsBankAccountAccountHolderType { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> + for InboundTransfersPaymentMethodDetailsUsBankAccountAccountHolderType +{ + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for InboundTransfersPaymentMethodDetailsUsBankAccountAccountHolderType")) + } +} +/// Account type: checkings or savings. Defaults to checking if omitted. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum InboundTransfersPaymentMethodDetailsUsBankAccountAccountType { + Checking, + Savings, +} +impl InboundTransfersPaymentMethodDetailsUsBankAccountAccountType { + pub fn as_str(self) -> &'static str { + use InboundTransfersPaymentMethodDetailsUsBankAccountAccountType::*; + match self { + Checking => "checking", + Savings => "savings", + } + } +} + +impl std::str::FromStr for InboundTransfersPaymentMethodDetailsUsBankAccountAccountType { + type Err = (); + fn from_str(s: &str) -> Result { + use InboundTransfersPaymentMethodDetailsUsBankAccountAccountType::*; + match s { + "checking" => Ok(Checking), + "savings" => Ok(Savings), + _ => Err(()), + } + } +} +impl std::fmt::Display for InboundTransfersPaymentMethodDetailsUsBankAccountAccountType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for InboundTransfersPaymentMethodDetailsUsBankAccountAccountType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for InboundTransfersPaymentMethodDetailsUsBankAccountAccountType { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for InboundTransfersPaymentMethodDetailsUsBankAccountAccountType { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| { + serde::de::Error::custom( + "Unknown value for InboundTransfersPaymentMethodDetailsUsBankAccountAccountType", + ) + }) + } +} +/// The US bank account network used to debit funds. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum InboundTransfersPaymentMethodDetailsUsBankAccountNetwork { + Ach, +} +impl InboundTransfersPaymentMethodDetailsUsBankAccountNetwork { + pub fn as_str(self) -> &'static str { + use InboundTransfersPaymentMethodDetailsUsBankAccountNetwork::*; + match self { + Ach => "ach", + } + } +} + +impl std::str::FromStr for InboundTransfersPaymentMethodDetailsUsBankAccountNetwork { + type Err = (); + fn from_str(s: &str) -> Result { + use InboundTransfersPaymentMethodDetailsUsBankAccountNetwork::*; + match s { + "ach" => Ok(Ach), + _ => Err(()), + } + } +} +impl std::fmt::Display for InboundTransfersPaymentMethodDetailsUsBankAccountNetwork { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for InboundTransfersPaymentMethodDetailsUsBankAccountNetwork { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for InboundTransfersPaymentMethodDetailsUsBankAccountNetwork { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for InboundTransfersPaymentMethodDetailsUsBankAccountNetwork { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| { + serde::de::Error::custom( + "Unknown value for InboundTransfersPaymentMethodDetailsUsBankAccountNetwork", + ) + }) + } +} diff --git a/generated/stripe_treasury/src/mod.rs b/generated/stripe_treasury/src/mod.rs new file mode 100644 index 000000000..e99ca40d7 --- /dev/null +++ b/generated/stripe_treasury/src/mod.rs @@ -0,0 +1,209 @@ +#![recursion_limit = "256"] +#![allow(clippy::large_enum_variant)] +#![allow(rustdoc::broken_intra_doc_links)] +#![allow(rustdoc::invalid_html_tags)] + +//! This crate provides Rust bindings to the Stripe HTTP API, specifically +//! for requests mentioned in the `Treasury` section of the [Stripe API docs](https://stripe.com/docs/api) + +extern crate self as stripe_treasury; +#[doc(hidden)] +pub mod inbound_transfers; +#[doc(inline)] +pub use inbound_transfers::*; +#[doc(hidden)] +pub mod inbound_transfers_payment_method_details_us_bank_account; +#[doc(inline)] +pub use inbound_transfers_payment_method_details_us_bank_account::*; +#[doc(hidden)] +pub mod outbound_payments_payment_method_details; +#[doc(inline)] +pub use outbound_payments_payment_method_details::*; +#[doc(hidden)] +pub mod outbound_payments_payment_method_details_financial_account; +#[doc(inline)] +pub use outbound_payments_payment_method_details_financial_account::*; +#[doc(hidden)] +pub mod outbound_payments_payment_method_details_us_bank_account; +#[doc(inline)] +pub use outbound_payments_payment_method_details_us_bank_account::*; +#[doc(hidden)] +pub mod outbound_transfers_payment_method_details; +#[doc(inline)] +pub use outbound_transfers_payment_method_details::*; +#[doc(hidden)] +pub mod outbound_transfers_payment_method_details_us_bank_account; +#[doc(inline)] +pub use outbound_transfers_payment_method_details_us_bank_account::*; +#[doc(hidden)] +pub mod received_payment_method_details_financial_account; +#[doc(inline)] +pub use received_payment_method_details_financial_account::*; +pub use treasury_credit_reversal::types::*; +pub mod treasury_credit_reversal; +pub use treasury_debit_reversal::types::*; +pub mod treasury_debit_reversal; +pub use treasury_financial_account::types::*; +pub mod treasury_financial_account; +#[doc(hidden)] +pub mod treasury_financial_account_features; +#[doc(inline)] +pub use treasury_financial_account_features::*; +pub use treasury_inbound_transfer::types::*; +pub mod treasury_inbound_transfer; +pub use treasury_outbound_payment::types::*; +pub mod treasury_outbound_payment; +pub use treasury_outbound_transfer::types::*; +pub mod treasury_outbound_transfer; +pub use treasury_received_credit::types::*; +pub mod treasury_received_credit; +pub use treasury_received_debit::types::*; +pub mod treasury_received_debit; +pub use treasury_transaction::types::*; +pub mod treasury_transaction; +pub use treasury_transaction_entry::types::*; +#[doc(hidden)] +pub mod treasury_financial_accounts_resource_aba_record; +pub mod treasury_transaction_entry; +#[doc(inline)] +pub use treasury_financial_accounts_resource_aba_record::*; +#[doc(hidden)] +pub mod treasury_financial_accounts_resource_aba_toggle_settings; +#[doc(inline)] +pub use treasury_financial_accounts_resource_aba_toggle_settings::*; +#[doc(hidden)] +pub mod treasury_financial_accounts_resource_ach_toggle_settings; +#[doc(inline)] +pub use treasury_financial_accounts_resource_ach_toggle_settings::*; +#[doc(hidden)] +pub mod treasury_financial_accounts_resource_balance; +#[doc(inline)] +pub use treasury_financial_accounts_resource_balance::*; +#[doc(hidden)] +pub mod treasury_financial_accounts_resource_closed_status_details; +#[doc(inline)] +pub use treasury_financial_accounts_resource_closed_status_details::*; +#[doc(hidden)] +pub mod treasury_financial_accounts_resource_financial_address; +#[doc(inline)] +pub use treasury_financial_accounts_resource_financial_address::*; +#[doc(hidden)] +pub mod treasury_financial_accounts_resource_financial_addresses_features; +#[doc(inline)] +pub use treasury_financial_accounts_resource_financial_addresses_features::*; +#[doc(hidden)] +pub mod treasury_financial_accounts_resource_inbound_transfers; +#[doc(inline)] +pub use treasury_financial_accounts_resource_inbound_transfers::*; +#[doc(hidden)] +pub mod treasury_financial_accounts_resource_outbound_payments; +#[doc(inline)] +pub use treasury_financial_accounts_resource_outbound_payments::*; +#[doc(hidden)] +pub mod treasury_financial_accounts_resource_outbound_transfers; +#[doc(inline)] +pub use treasury_financial_accounts_resource_outbound_transfers::*; +#[doc(hidden)] +pub mod treasury_financial_accounts_resource_platform_restrictions; +#[doc(inline)] +pub use treasury_financial_accounts_resource_platform_restrictions::*; +#[doc(hidden)] +pub mod treasury_financial_accounts_resource_status_details; +#[doc(inline)] +pub use treasury_financial_accounts_resource_status_details::*; +#[doc(hidden)] +pub mod treasury_financial_accounts_resource_toggle_settings; +#[doc(inline)] +pub use treasury_financial_accounts_resource_toggle_settings::*; +#[doc(hidden)] +pub mod treasury_financial_accounts_resource_toggles_setting_status_details; +#[doc(inline)] +pub use treasury_financial_accounts_resource_toggles_setting_status_details::*; +#[doc(hidden)] +pub mod treasury_inbound_transfers_resource_failure_details; +#[doc(inline)] +pub use treasury_inbound_transfers_resource_failure_details::*; +#[doc(hidden)] +pub mod treasury_inbound_transfers_resource_inbound_transfer_resource_linked_flows; +#[doc(inline)] +pub use treasury_inbound_transfers_resource_inbound_transfer_resource_linked_flows::*; +#[doc(hidden)] +pub mod treasury_inbound_transfers_resource_inbound_transfer_resource_status_transitions; +#[doc(inline)] +pub use treasury_inbound_transfers_resource_inbound_transfer_resource_status_transitions::*; +#[doc(hidden)] +pub mod treasury_outbound_payments_resource_outbound_payment_resource_end_user_details; +#[doc(inline)] +pub use treasury_outbound_payments_resource_outbound_payment_resource_end_user_details::*; +#[doc(hidden)] +pub mod treasury_outbound_payments_resource_outbound_payment_resource_status_transitions; +#[doc(inline)] +pub use treasury_outbound_payments_resource_outbound_payment_resource_status_transitions::*; +#[doc(hidden)] +pub mod treasury_outbound_payments_resource_returned_status; +#[doc(inline)] +pub use treasury_outbound_payments_resource_returned_status::*; +#[doc(hidden)] +pub mod treasury_outbound_transfers_resource_returned_details; +#[doc(inline)] +pub use treasury_outbound_transfers_resource_returned_details::*; +#[doc(hidden)] +pub mod treasury_outbound_transfers_resource_status_transitions; +#[doc(inline)] +pub use treasury_outbound_transfers_resource_status_transitions::*; +#[doc(hidden)] +pub mod treasury_received_credits_resource_linked_flows; +#[doc(inline)] +pub use treasury_received_credits_resource_linked_flows::*; +#[doc(hidden)] +pub mod treasury_received_credits_resource_reversal_details; +#[doc(inline)] +pub use treasury_received_credits_resource_reversal_details::*; +#[doc(hidden)] +pub mod treasury_received_credits_resource_source_flows_details; +#[doc(inline)] +pub use treasury_received_credits_resource_source_flows_details::*; +#[doc(hidden)] +pub mod treasury_received_credits_resource_status_transitions; +#[doc(inline)] +pub use treasury_received_credits_resource_status_transitions::*; +#[doc(hidden)] +pub mod treasury_received_debits_resource_debit_reversal_linked_flows; +#[doc(inline)] +pub use treasury_received_debits_resource_debit_reversal_linked_flows::*; +#[doc(hidden)] +pub mod treasury_received_debits_resource_linked_flows; +#[doc(inline)] +pub use treasury_received_debits_resource_linked_flows::*; +#[doc(hidden)] +pub mod treasury_received_debits_resource_reversal_details; +#[doc(inline)] +pub use treasury_received_debits_resource_reversal_details::*; +#[doc(hidden)] +pub mod treasury_received_debits_resource_status_transitions; +#[doc(inline)] +pub use treasury_received_debits_resource_status_transitions::*; +#[doc(hidden)] +pub mod treasury_shared_resource_billing_details; +#[doc(inline)] +pub use treasury_shared_resource_billing_details::*; +#[doc(hidden)] +pub mod treasury_shared_resource_initiating_payment_method_details_initiating_payment_method_details; +#[doc(inline)] +pub use treasury_shared_resource_initiating_payment_method_details_initiating_payment_method_details::*; +#[doc(hidden)] +pub mod treasury_shared_resource_initiating_payment_method_details_us_bank_account; +#[doc(inline)] +pub use treasury_shared_resource_initiating_payment_method_details_us_bank_account::*; +#[doc(hidden)] +pub mod treasury_transactions_resource_abstract_transaction_resource_status_transitions; +#[doc(inline)] +pub use treasury_transactions_resource_abstract_transaction_resource_status_transitions::*; +#[doc(hidden)] +pub mod treasury_transactions_resource_balance_impact; +#[doc(inline)] +pub use treasury_transactions_resource_balance_impact::*; +#[doc(hidden)] +pub mod treasury_transactions_resource_flow_details; +#[doc(inline)] +pub use treasury_transactions_resource_flow_details::*; diff --git a/generated/stripe_treasury/src/outbound_payments_payment_method_details.rs b/generated/stripe_treasury/src/outbound_payments_payment_method_details.rs new file mode 100644 index 000000000..6ef35c314 --- /dev/null +++ b/generated/stripe_treasury/src/outbound_payments_payment_method_details.rs @@ -0,0 +1,67 @@ +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct OutboundPaymentsPaymentMethodDetails { + pub billing_details: stripe_treasury::TreasurySharedResourceBillingDetails, + #[serde(skip_serializing_if = "Option::is_none")] + pub financial_account: + Option, + /// The type of the payment method used in the OutboundPayment. + #[serde(rename = "type")] + pub type_: OutboundPaymentsPaymentMethodDetailsType, + #[serde(skip_serializing_if = "Option::is_none")] + pub us_bank_account: Option, +} +/// The type of the payment method used in the OutboundPayment. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum OutboundPaymentsPaymentMethodDetailsType { + FinancialAccount, + UsBankAccount, +} +impl OutboundPaymentsPaymentMethodDetailsType { + pub fn as_str(self) -> &'static str { + use OutboundPaymentsPaymentMethodDetailsType::*; + match self { + FinancialAccount => "financial_account", + UsBankAccount => "us_bank_account", + } + } +} + +impl std::str::FromStr for OutboundPaymentsPaymentMethodDetailsType { + type Err = (); + fn from_str(s: &str) -> Result { + use OutboundPaymentsPaymentMethodDetailsType::*; + match s { + "financial_account" => Ok(FinancialAccount), + "us_bank_account" => Ok(UsBankAccount), + _ => Err(()), + } + } +} +impl std::fmt::Display for OutboundPaymentsPaymentMethodDetailsType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for OutboundPaymentsPaymentMethodDetailsType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for OutboundPaymentsPaymentMethodDetailsType { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for OutboundPaymentsPaymentMethodDetailsType { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| { + serde::de::Error::custom("Unknown value for OutboundPaymentsPaymentMethodDetailsType") + }) + } +} diff --git a/generated/stripe_treasury/src/outbound_payments_payment_method_details_financial_account.rs b/generated/stripe_treasury/src/outbound_payments_payment_method_details_financial_account.rs new file mode 100644 index 000000000..56312bfab --- /dev/null +++ b/generated/stripe_treasury/src/outbound_payments_payment_method_details_financial_account.rs @@ -0,0 +1,61 @@ +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct OutboundPaymentsPaymentMethodDetailsFinancialAccount { + /// Token of the FinancialAccount. + pub id: String, + /// The rails used to send funds. + pub network: OutboundPaymentsPaymentMethodDetailsFinancialAccountNetwork, +} +/// The rails used to send funds. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum OutboundPaymentsPaymentMethodDetailsFinancialAccountNetwork { + Stripe, +} +impl OutboundPaymentsPaymentMethodDetailsFinancialAccountNetwork { + pub fn as_str(self) -> &'static str { + use OutboundPaymentsPaymentMethodDetailsFinancialAccountNetwork::*; + match self { + Stripe => "stripe", + } + } +} + +impl std::str::FromStr for OutboundPaymentsPaymentMethodDetailsFinancialAccountNetwork { + type Err = (); + fn from_str(s: &str) -> Result { + use OutboundPaymentsPaymentMethodDetailsFinancialAccountNetwork::*; + match s { + "stripe" => Ok(Stripe), + _ => Err(()), + } + } +} +impl std::fmt::Display for OutboundPaymentsPaymentMethodDetailsFinancialAccountNetwork { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for OutboundPaymentsPaymentMethodDetailsFinancialAccountNetwork { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for OutboundPaymentsPaymentMethodDetailsFinancialAccountNetwork { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for OutboundPaymentsPaymentMethodDetailsFinancialAccountNetwork { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| { + serde::de::Error::custom( + "Unknown value for OutboundPaymentsPaymentMethodDetailsFinancialAccountNetwork", + ) + }) + } +} diff --git a/generated/stripe_treasury/src/outbound_payments_payment_method_details_us_bank_account.rs b/generated/stripe_treasury/src/outbound_payments_payment_method_details_us_bank_account.rs new file mode 100644 index 000000000..fd4fc2fb3 --- /dev/null +++ b/generated/stripe_treasury/src/outbound_payments_payment_method_details_us_bank_account.rs @@ -0,0 +1,188 @@ +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct OutboundPaymentsPaymentMethodDetailsUsBankAccount { + /// Account holder type: individual or company. + pub account_holder_type: + Option, + /// Account type: checkings or savings. Defaults to checking if omitted. + pub account_type: Option, + /// Name of the bank associated with the bank account. + pub bank_name: Option, + /// Uniquely identifies this particular bank account. + /// You can use this attribute to check whether two bank accounts are the same. + pub fingerprint: Option, + /// Last four digits of the bank account number. + pub last4: Option, + /// The US bank account network used to send funds. + pub network: OutboundPaymentsPaymentMethodDetailsUsBankAccountNetwork, + /// Routing number of the bank account. + pub routing_number: Option, +} +/// Account holder type: individual or company. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum OutboundPaymentsPaymentMethodDetailsUsBankAccountAccountHolderType { + Company, + Individual, +} +impl OutboundPaymentsPaymentMethodDetailsUsBankAccountAccountHolderType { + pub fn as_str(self) -> &'static str { + use OutboundPaymentsPaymentMethodDetailsUsBankAccountAccountHolderType::*; + match self { + Company => "company", + Individual => "individual", + } + } +} + +impl std::str::FromStr for OutboundPaymentsPaymentMethodDetailsUsBankAccountAccountHolderType { + type Err = (); + fn from_str(s: &str) -> Result { + use OutboundPaymentsPaymentMethodDetailsUsBankAccountAccountHolderType::*; + match s { + "company" => Ok(Company), + "individual" => Ok(Individual), + _ => Err(()), + } + } +} +impl std::fmt::Display for OutboundPaymentsPaymentMethodDetailsUsBankAccountAccountHolderType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for OutboundPaymentsPaymentMethodDetailsUsBankAccountAccountHolderType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for OutboundPaymentsPaymentMethodDetailsUsBankAccountAccountHolderType { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> + for OutboundPaymentsPaymentMethodDetailsUsBankAccountAccountHolderType +{ + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for OutboundPaymentsPaymentMethodDetailsUsBankAccountAccountHolderType")) + } +} +/// Account type: checkings or savings. Defaults to checking if omitted. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum OutboundPaymentsPaymentMethodDetailsUsBankAccountAccountType { + Checking, + Savings, +} +impl OutboundPaymentsPaymentMethodDetailsUsBankAccountAccountType { + pub fn as_str(self) -> &'static str { + use OutboundPaymentsPaymentMethodDetailsUsBankAccountAccountType::*; + match self { + Checking => "checking", + Savings => "savings", + } + } +} + +impl std::str::FromStr for OutboundPaymentsPaymentMethodDetailsUsBankAccountAccountType { + type Err = (); + fn from_str(s: &str) -> Result { + use OutboundPaymentsPaymentMethodDetailsUsBankAccountAccountType::*; + match s { + "checking" => Ok(Checking), + "savings" => Ok(Savings), + _ => Err(()), + } + } +} +impl std::fmt::Display for OutboundPaymentsPaymentMethodDetailsUsBankAccountAccountType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for OutboundPaymentsPaymentMethodDetailsUsBankAccountAccountType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for OutboundPaymentsPaymentMethodDetailsUsBankAccountAccountType { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for OutboundPaymentsPaymentMethodDetailsUsBankAccountAccountType { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| { + serde::de::Error::custom( + "Unknown value for OutboundPaymentsPaymentMethodDetailsUsBankAccountAccountType", + ) + }) + } +} +/// The US bank account network used to send funds. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum OutboundPaymentsPaymentMethodDetailsUsBankAccountNetwork { + Ach, + UsDomesticWire, +} +impl OutboundPaymentsPaymentMethodDetailsUsBankAccountNetwork { + pub fn as_str(self) -> &'static str { + use OutboundPaymentsPaymentMethodDetailsUsBankAccountNetwork::*; + match self { + Ach => "ach", + UsDomesticWire => "us_domestic_wire", + } + } +} + +impl std::str::FromStr for OutboundPaymentsPaymentMethodDetailsUsBankAccountNetwork { + type Err = (); + fn from_str(s: &str) -> Result { + use OutboundPaymentsPaymentMethodDetailsUsBankAccountNetwork::*; + match s { + "ach" => Ok(Ach), + "us_domestic_wire" => Ok(UsDomesticWire), + _ => Err(()), + } + } +} +impl std::fmt::Display for OutboundPaymentsPaymentMethodDetailsUsBankAccountNetwork { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for OutboundPaymentsPaymentMethodDetailsUsBankAccountNetwork { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for OutboundPaymentsPaymentMethodDetailsUsBankAccountNetwork { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for OutboundPaymentsPaymentMethodDetailsUsBankAccountNetwork { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| { + serde::de::Error::custom( + "Unknown value for OutboundPaymentsPaymentMethodDetailsUsBankAccountNetwork", + ) + }) + } +} diff --git a/generated/stripe_treasury/src/outbound_transfers_payment_method_details.rs b/generated/stripe_treasury/src/outbound_transfers_payment_method_details.rs new file mode 100644 index 000000000..caa995e3c --- /dev/null +++ b/generated/stripe_treasury/src/outbound_transfers_payment_method_details.rs @@ -0,0 +1,62 @@ +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct OutboundTransfersPaymentMethodDetails { + pub billing_details: stripe_treasury::TreasurySharedResourceBillingDetails, + /// The type of the payment method used in the OutboundTransfer. + #[serde(rename = "type")] + pub type_: OutboundTransfersPaymentMethodDetailsType, + #[serde(skip_serializing_if = "Option::is_none")] + pub us_bank_account: + Option, +} +/// The type of the payment method used in the OutboundTransfer. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum OutboundTransfersPaymentMethodDetailsType { + UsBankAccount, +} +impl OutboundTransfersPaymentMethodDetailsType { + pub fn as_str(self) -> &'static str { + use OutboundTransfersPaymentMethodDetailsType::*; + match self { + UsBankAccount => "us_bank_account", + } + } +} + +impl std::str::FromStr for OutboundTransfersPaymentMethodDetailsType { + type Err = (); + fn from_str(s: &str) -> Result { + use OutboundTransfersPaymentMethodDetailsType::*; + match s { + "us_bank_account" => Ok(UsBankAccount), + _ => Err(()), + } + } +} +impl std::fmt::Display for OutboundTransfersPaymentMethodDetailsType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for OutboundTransfersPaymentMethodDetailsType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for OutboundTransfersPaymentMethodDetailsType { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for OutboundTransfersPaymentMethodDetailsType { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| { + serde::de::Error::custom("Unknown value for OutboundTransfersPaymentMethodDetailsType") + }) + } +} diff --git a/generated/stripe_treasury/src/outbound_transfers_payment_method_details_us_bank_account.rs b/generated/stripe_treasury/src/outbound_transfers_payment_method_details_us_bank_account.rs new file mode 100644 index 000000000..4e2f90566 --- /dev/null +++ b/generated/stripe_treasury/src/outbound_transfers_payment_method_details_us_bank_account.rs @@ -0,0 +1,190 @@ +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct OutboundTransfersPaymentMethodDetailsUsBankAccount { + /// Account holder type: individual or company. + pub account_holder_type: + Option, + /// Account type: checkings or savings. Defaults to checking if omitted. + pub account_type: Option, + /// Name of the bank associated with the bank account. + pub bank_name: Option, + /// Uniquely identifies this particular bank account. + /// You can use this attribute to check whether two bank accounts are the same. + pub fingerprint: Option, + /// Last four digits of the bank account number. + pub last4: Option, + /// The US bank account network used to send funds. + pub network: OutboundTransfersPaymentMethodDetailsUsBankAccountNetwork, + /// Routing number of the bank account. + pub routing_number: Option, +} +/// Account holder type: individual or company. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum OutboundTransfersPaymentMethodDetailsUsBankAccountAccountHolderType { + Company, + Individual, +} +impl OutboundTransfersPaymentMethodDetailsUsBankAccountAccountHolderType { + pub fn as_str(self) -> &'static str { + use OutboundTransfersPaymentMethodDetailsUsBankAccountAccountHolderType::*; + match self { + Company => "company", + Individual => "individual", + } + } +} + +impl std::str::FromStr for OutboundTransfersPaymentMethodDetailsUsBankAccountAccountHolderType { + type Err = (); + fn from_str(s: &str) -> Result { + use OutboundTransfersPaymentMethodDetailsUsBankAccountAccountHolderType::*; + match s { + "company" => Ok(Company), + "individual" => Ok(Individual), + _ => Err(()), + } + } +} +impl std::fmt::Display for OutboundTransfersPaymentMethodDetailsUsBankAccountAccountHolderType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for OutboundTransfersPaymentMethodDetailsUsBankAccountAccountHolderType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for OutboundTransfersPaymentMethodDetailsUsBankAccountAccountHolderType { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> + for OutboundTransfersPaymentMethodDetailsUsBankAccountAccountHolderType +{ + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for OutboundTransfersPaymentMethodDetailsUsBankAccountAccountHolderType")) + } +} +/// Account type: checkings or savings. Defaults to checking if omitted. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum OutboundTransfersPaymentMethodDetailsUsBankAccountAccountType { + Checking, + Savings, +} +impl OutboundTransfersPaymentMethodDetailsUsBankAccountAccountType { + pub fn as_str(self) -> &'static str { + use OutboundTransfersPaymentMethodDetailsUsBankAccountAccountType::*; + match self { + Checking => "checking", + Savings => "savings", + } + } +} + +impl std::str::FromStr for OutboundTransfersPaymentMethodDetailsUsBankAccountAccountType { + type Err = (); + fn from_str(s: &str) -> Result { + use OutboundTransfersPaymentMethodDetailsUsBankAccountAccountType::*; + match s { + "checking" => Ok(Checking), + "savings" => Ok(Savings), + _ => Err(()), + } + } +} +impl std::fmt::Display for OutboundTransfersPaymentMethodDetailsUsBankAccountAccountType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for OutboundTransfersPaymentMethodDetailsUsBankAccountAccountType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for OutboundTransfersPaymentMethodDetailsUsBankAccountAccountType { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> + for OutboundTransfersPaymentMethodDetailsUsBankAccountAccountType +{ + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| { + serde::de::Error::custom( + "Unknown value for OutboundTransfersPaymentMethodDetailsUsBankAccountAccountType", + ) + }) + } +} +/// The US bank account network used to send funds. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum OutboundTransfersPaymentMethodDetailsUsBankAccountNetwork { + Ach, + UsDomesticWire, +} +impl OutboundTransfersPaymentMethodDetailsUsBankAccountNetwork { + pub fn as_str(self) -> &'static str { + use OutboundTransfersPaymentMethodDetailsUsBankAccountNetwork::*; + match self { + Ach => "ach", + UsDomesticWire => "us_domestic_wire", + } + } +} + +impl std::str::FromStr for OutboundTransfersPaymentMethodDetailsUsBankAccountNetwork { + type Err = (); + fn from_str(s: &str) -> Result { + use OutboundTransfersPaymentMethodDetailsUsBankAccountNetwork::*; + match s { + "ach" => Ok(Ach), + "us_domestic_wire" => Ok(UsDomesticWire), + _ => Err(()), + } + } +} +impl std::fmt::Display for OutboundTransfersPaymentMethodDetailsUsBankAccountNetwork { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for OutboundTransfersPaymentMethodDetailsUsBankAccountNetwork { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for OutboundTransfersPaymentMethodDetailsUsBankAccountNetwork { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for OutboundTransfersPaymentMethodDetailsUsBankAccountNetwork { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| { + serde::de::Error::custom( + "Unknown value for OutboundTransfersPaymentMethodDetailsUsBankAccountNetwork", + ) + }) + } +} diff --git a/generated/stripe_treasury/src/received_payment_method_details_financial_account.rs b/generated/stripe_treasury/src/received_payment_method_details_financial_account.rs new file mode 100644 index 000000000..0adc990de --- /dev/null +++ b/generated/stripe_treasury/src/received_payment_method_details_financial_account.rs @@ -0,0 +1,61 @@ +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct ReceivedPaymentMethodDetailsFinancialAccount { + /// The FinancialAccount ID. + pub id: String, + /// The rails the ReceivedCredit was sent over. A FinancialAccount can only send funds over `stripe`. + pub network: ReceivedPaymentMethodDetailsFinancialAccountNetwork, +} +/// The rails the ReceivedCredit was sent over. A FinancialAccount can only send funds over `stripe`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum ReceivedPaymentMethodDetailsFinancialAccountNetwork { + Stripe, +} +impl ReceivedPaymentMethodDetailsFinancialAccountNetwork { + pub fn as_str(self) -> &'static str { + use ReceivedPaymentMethodDetailsFinancialAccountNetwork::*; + match self { + Stripe => "stripe", + } + } +} + +impl std::str::FromStr for ReceivedPaymentMethodDetailsFinancialAccountNetwork { + type Err = (); + fn from_str(s: &str) -> Result { + use ReceivedPaymentMethodDetailsFinancialAccountNetwork::*; + match s { + "stripe" => Ok(Stripe), + _ => Err(()), + } + } +} +impl std::fmt::Display for ReceivedPaymentMethodDetailsFinancialAccountNetwork { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for ReceivedPaymentMethodDetailsFinancialAccountNetwork { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for ReceivedPaymentMethodDetailsFinancialAccountNetwork { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for ReceivedPaymentMethodDetailsFinancialAccountNetwork { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| { + serde::de::Error::custom( + "Unknown value for ReceivedPaymentMethodDetailsFinancialAccountNetwork", + ) + }) + } +} diff --git a/generated/stripe_treasury/src/treasury_credit_reversal/mod.rs b/generated/stripe_treasury/src/treasury_credit_reversal/mod.rs new file mode 100644 index 000000000..7a66a81d8 --- /dev/null +++ b/generated/stripe_treasury/src/treasury_credit_reversal/mod.rs @@ -0,0 +1,5 @@ +#[cfg(feature = "treasury_credit_reversal")] +mod requests; +pub(crate) mod types; +#[cfg(feature = "treasury_credit_reversal")] +pub use requests::*; diff --git a/generated/stripe_treasury/src/treasury_credit_reversal/requests.rs b/generated/stripe_treasury/src/treasury_credit_reversal/requests.rs new file mode 100644 index 000000000..dd64da691 --- /dev/null +++ b/generated/stripe_treasury/src/treasury_credit_reversal/requests.rs @@ -0,0 +1,104 @@ +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct ListTreasuryCreditReversal<'a> { + /// A cursor for use in pagination. + /// `ending_before` is an object ID that defines your place in the list. + /// For instance, if you make a list request and receive 100 objects, starting with `obj_bar`, your subsequent call can include `ending_before=obj_bar` in order to fetch the previous page of the list. + #[serde(skip_serializing_if = "Option::is_none")] + pub ending_before: Option<&'a str>, + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, + /// Returns objects associated with this FinancialAccount. + pub financial_account: &'a str, + /// A limit on the number of objects to be returned. + /// Limit can range between 1 and 100, and the default is 10. + #[serde(skip_serializing_if = "Option::is_none")] + pub limit: Option, + /// Only return CreditReversals for the ReceivedCredit ID. + #[serde(skip_serializing_if = "Option::is_none")] + pub received_credit: Option<&'a str>, + /// A cursor for use in pagination. + /// `starting_after` is an object ID that defines your place in the list. + /// For instance, if you make a list request and receive 100 objects, ending with `obj_foo`, your subsequent call can include `starting_after=obj_foo` in order to fetch the next page of the list. + #[serde(skip_serializing_if = "Option::is_none")] + pub starting_after: Option<&'a str>, + /// Only return CreditReversals for a given status. + #[serde(skip_serializing_if = "Option::is_none")] + pub status: Option, +} +impl<'a> ListTreasuryCreditReversal<'a> { + pub fn new(financial_account: &'a str) -> Self { + Self { + ending_before: None, + expand: None, + financial_account, + limit: None, + received_credit: None, + starting_after: None, + status: None, + } + } +} +impl<'a> ListTreasuryCreditReversal<'a> { + /// Returns a list of CreditReversals. + pub fn send( + &self, + client: &stripe::Client, + ) -> stripe::Response> { + client.get_query("/treasury/credit_reversals", self) + } + pub fn paginate( + self, + ) -> stripe::ListPaginator> { + stripe::ListPaginator::from_list_params("/treasury/credit_reversals", self) + } +} +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct RetrieveTreasuryCreditReversal<'a> { + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, +} +impl<'a> RetrieveTreasuryCreditReversal<'a> { + pub fn new() -> Self { + Self::default() + } +} +impl<'a> RetrieveTreasuryCreditReversal<'a> { + /// Retrieves the details of an existing CreditReversal by passing the unique CreditReversal ID from either the CreditReversal creation request or CreditReversal list. + pub fn send( + &self, + client: &stripe::Client, + credit_reversal: &stripe_treasury::TreasuryCreditReversalId, + ) -> stripe::Response { + client.get_query(&format!("/treasury/credit_reversals/{credit_reversal}"), self) + } +} +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreateTreasuryCreditReversal<'a> { + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, + /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. + /// This can be useful for storing additional information about the object in a structured format. + /// Individual keys can be unset by posting an empty value to them. + /// All keys can be unset by posting an empty value to `metadata`. + #[serde(skip_serializing_if = "Option::is_none")] + pub metadata: Option<&'a std::collections::HashMap>, + /// The ReceivedCredit to reverse. + pub received_credit: &'a str, +} +impl<'a> CreateTreasuryCreditReversal<'a> { + pub fn new(received_credit: &'a str) -> Self { + Self { expand: None, metadata: None, received_credit } + } +} +impl<'a> CreateTreasuryCreditReversal<'a> { + /// Reverses a ReceivedCredit and creates a CreditReversal object. + pub fn send( + &self, + client: &stripe::Client, + ) -> stripe::Response { + client.send_form("/treasury/credit_reversals", self, http_types::Method::Post) + } +} diff --git a/generated/stripe_treasury/src/treasury_credit_reversal/types.rs b/generated/stripe_treasury/src/treasury_credit_reversal/types.rs new file mode 100644 index 000000000..21eff098f --- /dev/null +++ b/generated/stripe_treasury/src/treasury_credit_reversal/types.rs @@ -0,0 +1,150 @@ +/// You can reverse some [ReceivedCredits](https://stripe.com/docs/api#received_credits) depending on their network and source flow. +/// Reversing a ReceivedCredit leads to the creation of a new object known as a CreditReversal. +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct TreasuryCreditReversal { + /// Amount (in cents) transferred. + pub amount: i64, + /// Time at which the object was created. Measured in seconds since the Unix epoch. + pub created: stripe_types::Timestamp, + /// Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. + /// Must be a [supported currency](https://stripe.com/docs/currencies). + pub currency: stripe_types::Currency, + /// The FinancialAccount to reverse funds from. + pub financial_account: String, + /// A [hosted transaction receipt](https://stripe.com/docs/treasury/moving-money/regulatory-receipts) URL that is provided when money movement is considered regulated under Stripe's money transmission licenses. + pub hosted_regulatory_receipt_url: Option, + /// Unique identifier for the object. + pub id: stripe_treasury::TreasuryCreditReversalId, + /// Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + pub livemode: bool, + /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. + /// This can be useful for storing additional information about the object in a structured format. + pub metadata: std::collections::HashMap, + /// The rails used to reverse the funds. + pub network: TreasuryCreditReversalNetwork, + /// The ReceivedCredit being reversed. + pub received_credit: String, + /// Status of the CreditReversal + pub status: stripe_treasury::TreasuryCreditReversalStatus, + pub status_transitions: stripe_treasury::TreasuryReceivedCreditsResourceStatusTransitions, + /// The Transaction associated with this object. + pub transaction: Option>, +} +/// The rails used to reverse the funds. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum TreasuryCreditReversalNetwork { + Ach, + Stripe, +} +impl TreasuryCreditReversalNetwork { + pub fn as_str(self) -> &'static str { + use TreasuryCreditReversalNetwork::*; + match self { + Ach => "ach", + Stripe => "stripe", + } + } +} + +impl std::str::FromStr for TreasuryCreditReversalNetwork { + type Err = (); + fn from_str(s: &str) -> Result { + use TreasuryCreditReversalNetwork::*; + match s { + "ach" => Ok(Ach), + "stripe" => Ok(Stripe), + _ => Err(()), + } + } +} +impl std::fmt::Display for TreasuryCreditReversalNetwork { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for TreasuryCreditReversalNetwork { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for TreasuryCreditReversalNetwork { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for TreasuryCreditReversalNetwork { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| { + serde::de::Error::custom("Unknown value for TreasuryCreditReversalNetwork") + }) + } +} +impl stripe_types::Object for TreasuryCreditReversal { + type Id = stripe_treasury::TreasuryCreditReversalId; + fn id(&self) -> &Self::Id { + &self.id + } +} +stripe_types::def_id!(TreasuryCreditReversalId); +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum TreasuryCreditReversalStatus { + Canceled, + Posted, + Processing, +} +impl TreasuryCreditReversalStatus { + pub fn as_str(self) -> &'static str { + use TreasuryCreditReversalStatus::*; + match self { + Canceled => "canceled", + Posted => "posted", + Processing => "processing", + } + } +} + +impl std::str::FromStr for TreasuryCreditReversalStatus { + type Err = (); + fn from_str(s: &str) -> Result { + use TreasuryCreditReversalStatus::*; + match s { + "canceled" => Ok(Canceled), + "posted" => Ok(Posted), + "processing" => Ok(Processing), + _ => Err(()), + } + } +} +impl std::fmt::Display for TreasuryCreditReversalStatus { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for TreasuryCreditReversalStatus { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for TreasuryCreditReversalStatus { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for TreasuryCreditReversalStatus { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s) + .map_err(|_| serde::de::Error::custom("Unknown value for TreasuryCreditReversalStatus")) + } +} diff --git a/generated/stripe_treasury/src/treasury_debit_reversal/mod.rs b/generated/stripe_treasury/src/treasury_debit_reversal/mod.rs new file mode 100644 index 000000000..a34c528cc --- /dev/null +++ b/generated/stripe_treasury/src/treasury_debit_reversal/mod.rs @@ -0,0 +1,5 @@ +#[cfg(feature = "treasury_debit_reversal")] +mod requests; +pub(crate) mod types; +#[cfg(feature = "treasury_debit_reversal")] +pub use requests::*; diff --git a/generated/stripe_treasury/src/treasury_debit_reversal/requests.rs b/generated/stripe_treasury/src/treasury_debit_reversal/requests.rs new file mode 100644 index 000000000..a02d734dd --- /dev/null +++ b/generated/stripe_treasury/src/treasury_debit_reversal/requests.rs @@ -0,0 +1,203 @@ +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct ListTreasuryDebitReversal<'a> { + /// A cursor for use in pagination. + /// `ending_before` is an object ID that defines your place in the list. + /// For instance, if you make a list request and receive 100 objects, starting with `obj_bar`, your subsequent call can include `ending_before=obj_bar` in order to fetch the previous page of the list. + #[serde(skip_serializing_if = "Option::is_none")] + pub ending_before: Option<&'a str>, + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, + /// Returns objects associated with this FinancialAccount. + pub financial_account: &'a str, + /// A limit on the number of objects to be returned. + /// Limit can range between 1 and 100, and the default is 10. + #[serde(skip_serializing_if = "Option::is_none")] + pub limit: Option, + /// Only return DebitReversals for the ReceivedDebit ID. + #[serde(skip_serializing_if = "Option::is_none")] + pub received_debit: Option<&'a str>, + /// Only return DebitReversals for a given resolution. + #[serde(skip_serializing_if = "Option::is_none")] + pub resolution: Option, + /// A cursor for use in pagination. + /// `starting_after` is an object ID that defines your place in the list. + /// For instance, if you make a list request and receive 100 objects, ending with `obj_foo`, your subsequent call can include `starting_after=obj_foo` in order to fetch the next page of the list. + #[serde(skip_serializing_if = "Option::is_none")] + pub starting_after: Option<&'a str>, + /// Only return DebitReversals for a given status. + #[serde(skip_serializing_if = "Option::is_none")] + pub status: Option, +} +impl<'a> ListTreasuryDebitReversal<'a> { + pub fn new(financial_account: &'a str) -> Self { + Self { + ending_before: None, + expand: None, + financial_account, + limit: None, + received_debit: None, + resolution: None, + starting_after: None, + status: None, + } + } +} +/// Only return DebitReversals for a given resolution. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum ListTreasuryDebitReversalResolution { + Lost, + Won, +} +impl ListTreasuryDebitReversalResolution { + pub fn as_str(self) -> &'static str { + use ListTreasuryDebitReversalResolution::*; + match self { + Lost => "lost", + Won => "won", + } + } +} + +impl std::str::FromStr for ListTreasuryDebitReversalResolution { + type Err = (); + fn from_str(s: &str) -> Result { + use ListTreasuryDebitReversalResolution::*; + match s { + "lost" => Ok(Lost), + "won" => Ok(Won), + _ => Err(()), + } + } +} +impl std::fmt::Display for ListTreasuryDebitReversalResolution { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for ListTreasuryDebitReversalResolution { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for ListTreasuryDebitReversalResolution { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Only return DebitReversals for a given status. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum ListTreasuryDebitReversalStatus { + Canceled, + Completed, + Processing, +} +impl ListTreasuryDebitReversalStatus { + pub fn as_str(self) -> &'static str { + use ListTreasuryDebitReversalStatus::*; + match self { + Canceled => "canceled", + Completed => "completed", + Processing => "processing", + } + } +} + +impl std::str::FromStr for ListTreasuryDebitReversalStatus { + type Err = (); + fn from_str(s: &str) -> Result { + use ListTreasuryDebitReversalStatus::*; + match s { + "canceled" => Ok(Canceled), + "completed" => Ok(Completed), + "processing" => Ok(Processing), + _ => Err(()), + } + } +} +impl std::fmt::Display for ListTreasuryDebitReversalStatus { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for ListTreasuryDebitReversalStatus { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for ListTreasuryDebitReversalStatus { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'a> ListTreasuryDebitReversal<'a> { + /// Returns a list of DebitReversals. + pub fn send( + &self, + client: &stripe::Client, + ) -> stripe::Response> { + client.get_query("/treasury/debit_reversals", self) + } + pub fn paginate( + self, + ) -> stripe::ListPaginator> { + stripe::ListPaginator::from_list_params("/treasury/debit_reversals", self) + } +} +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct RetrieveTreasuryDebitReversal<'a> { + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, +} +impl<'a> RetrieveTreasuryDebitReversal<'a> { + pub fn new() -> Self { + Self::default() + } +} +impl<'a> RetrieveTreasuryDebitReversal<'a> { + /// Retrieves a DebitReversal object. + pub fn send( + &self, + client: &stripe::Client, + debit_reversal: &stripe_treasury::TreasuryDebitReversalId, + ) -> stripe::Response { + client.get_query(&format!("/treasury/debit_reversals/{debit_reversal}"), self) + } +} +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreateTreasuryDebitReversal<'a> { + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, + /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. + /// This can be useful for storing additional information about the object in a structured format. + /// Individual keys can be unset by posting an empty value to them. + /// All keys can be unset by posting an empty value to `metadata`. + #[serde(skip_serializing_if = "Option::is_none")] + pub metadata: Option<&'a std::collections::HashMap>, + /// The ReceivedDebit to reverse. + pub received_debit: &'a str, +} +impl<'a> CreateTreasuryDebitReversal<'a> { + pub fn new(received_debit: &'a str) -> Self { + Self { expand: None, metadata: None, received_debit } + } +} +impl<'a> CreateTreasuryDebitReversal<'a> { + /// Reverses a ReceivedDebit and creates a DebitReversal object. + pub fn send( + &self, + client: &stripe::Client, + ) -> stripe::Response { + client.send_form("/treasury/debit_reversals", self, http_types::Method::Post) + } +} diff --git a/generated/stripe_treasury/src/treasury_debit_reversal/types.rs b/generated/stripe_treasury/src/treasury_debit_reversal/types.rs new file mode 100644 index 000000000..62ec67342 --- /dev/null +++ b/generated/stripe_treasury/src/treasury_debit_reversal/types.rs @@ -0,0 +1,153 @@ +/// You can reverse some [ReceivedDebits](https://stripe.com/docs/api#received_debits) depending on their network and source flow. +/// Reversing a ReceivedDebit leads to the creation of a new object known as a DebitReversal. +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct TreasuryDebitReversal { + /// Amount (in cents) transferred. + pub amount: i64, + /// Time at which the object was created. Measured in seconds since the Unix epoch. + pub created: stripe_types::Timestamp, + /// Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. + /// Must be a [supported currency](https://stripe.com/docs/currencies). + pub currency: stripe_types::Currency, + /// The FinancialAccount to reverse funds from. + pub financial_account: Option, + /// A [hosted transaction receipt](https://stripe.com/docs/treasury/moving-money/regulatory-receipts) URL that is provided when money movement is considered regulated under Stripe's money transmission licenses. + pub hosted_regulatory_receipt_url: Option, + /// Unique identifier for the object. + pub id: stripe_treasury::TreasuryDebitReversalId, + /// Other flows linked to a DebitReversal. + pub linked_flows: + Option, + /// Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + pub livemode: bool, + /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. + /// This can be useful for storing additional information about the object in a structured format. + pub metadata: std::collections::HashMap, + /// The rails used to reverse the funds. + pub network: TreasuryDebitReversalNetwork, + /// The ReceivedDebit being reversed. + pub received_debit: String, + /// Status of the DebitReversal + pub status: TreasuryDebitReversalStatus, + pub status_transitions: stripe_treasury::TreasuryReceivedDebitsResourceStatusTransitions, + /// The Transaction associated with this object. + pub transaction: Option>, +} +/// The rails used to reverse the funds. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum TreasuryDebitReversalNetwork { + Ach, + Card, +} +impl TreasuryDebitReversalNetwork { + pub fn as_str(self) -> &'static str { + use TreasuryDebitReversalNetwork::*; + match self { + Ach => "ach", + Card => "card", + } + } +} + +impl std::str::FromStr for TreasuryDebitReversalNetwork { + type Err = (); + fn from_str(s: &str) -> Result { + use TreasuryDebitReversalNetwork::*; + match s { + "ach" => Ok(Ach), + "card" => Ok(Card), + _ => Err(()), + } + } +} +impl std::fmt::Display for TreasuryDebitReversalNetwork { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for TreasuryDebitReversalNetwork { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for TreasuryDebitReversalNetwork { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for TreasuryDebitReversalNetwork { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s) + .map_err(|_| serde::de::Error::custom("Unknown value for TreasuryDebitReversalNetwork")) + } +} +/// Status of the DebitReversal +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum TreasuryDebitReversalStatus { + Failed, + Processing, + Succeeded, +} +impl TreasuryDebitReversalStatus { + pub fn as_str(self) -> &'static str { + use TreasuryDebitReversalStatus::*; + match self { + Failed => "failed", + Processing => "processing", + Succeeded => "succeeded", + } + } +} + +impl std::str::FromStr for TreasuryDebitReversalStatus { + type Err = (); + fn from_str(s: &str) -> Result { + use TreasuryDebitReversalStatus::*; + match s { + "failed" => Ok(Failed), + "processing" => Ok(Processing), + "succeeded" => Ok(Succeeded), + _ => Err(()), + } + } +} +impl std::fmt::Display for TreasuryDebitReversalStatus { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for TreasuryDebitReversalStatus { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for TreasuryDebitReversalStatus { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for TreasuryDebitReversalStatus { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s) + .map_err(|_| serde::de::Error::custom("Unknown value for TreasuryDebitReversalStatus")) + } +} +impl stripe_types::Object for TreasuryDebitReversal { + type Id = stripe_treasury::TreasuryDebitReversalId; + fn id(&self) -> &Self::Id { + &self.id + } +} +stripe_types::def_id!(TreasuryDebitReversalId); diff --git a/generated/stripe_treasury/src/treasury_financial_account/mod.rs b/generated/stripe_treasury/src/treasury_financial_account/mod.rs new file mode 100644 index 000000000..8878bdf8c --- /dev/null +++ b/generated/stripe_treasury/src/treasury_financial_account/mod.rs @@ -0,0 +1,5 @@ +#[cfg(feature = "treasury_financial_account")] +mod requests; +pub(crate) mod types; +#[cfg(feature = "treasury_financial_account")] +pub use requests::*; diff --git a/generated/stripe_treasury/src/treasury_financial_account/requests.rs b/generated/stripe_treasury/src/treasury_financial_account/requests.rs new file mode 100644 index 000000000..a30f0be40 --- /dev/null +++ b/generated/stripe_treasury/src/treasury_financial_account/requests.rs @@ -0,0 +1,951 @@ +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct ListTreasuryFinancialAccount<'a> { + #[serde(skip_serializing_if = "Option::is_none")] + pub created: Option, + /// An object ID cursor for use in pagination. + #[serde(skip_serializing_if = "Option::is_none")] + pub ending_before: Option<&'a str>, + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, + /// A limit ranging from 1 to 100 (defaults to 10). + #[serde(skip_serializing_if = "Option::is_none")] + pub limit: Option, + /// An object ID cursor for use in pagination. + #[serde(skip_serializing_if = "Option::is_none")] + pub starting_after: Option<&'a str>, +} +impl<'a> ListTreasuryFinancialAccount<'a> { + pub fn new() -> Self { + Self::default() + } +} +impl<'a> ListTreasuryFinancialAccount<'a> { + /// Returns a list of FinancialAccounts. + pub fn send( + &self, + client: &stripe::Client, + ) -> stripe::Response> { + client.get_query("/treasury/financial_accounts", self) + } + pub fn paginate( + self, + ) -> stripe::ListPaginator> { + stripe::ListPaginator::from_list_params("/treasury/financial_accounts", self) + } +} +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct RetrieveTreasuryFinancialAccount<'a> { + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, +} +impl<'a> RetrieveTreasuryFinancialAccount<'a> { + pub fn new() -> Self { + Self::default() + } +} +impl<'a> RetrieveTreasuryFinancialAccount<'a> { + /// Retrieves the details of a FinancialAccount. + pub fn send( + &self, + client: &stripe::Client, + financial_account: &stripe_treasury::TreasuryFinancialAccountId, + ) -> stripe::Response { + client.get_query(&format!("/treasury/financial_accounts/{financial_account}"), self) + } +} +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct RetrieveFeaturesTreasuryFinancialAccount<'a> { + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, +} +impl<'a> RetrieveFeaturesTreasuryFinancialAccount<'a> { + pub fn new() -> Self { + Self::default() + } +} +impl<'a> RetrieveFeaturesTreasuryFinancialAccount<'a> { + /// Retrieves Features information associated with the FinancialAccount. + pub fn send( + &self, + client: &stripe::Client, + financial_account: &stripe_treasury::TreasuryFinancialAccountId, + ) -> stripe::Response { + client + .get_query(&format!("/treasury/financial_accounts/{financial_account}/features"), self) + } +} +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreateTreasuryFinancialAccount<'a> { + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, + /// Encodes whether a FinancialAccount has access to a particular feature. + /// Stripe or the platform can control features via the requested field. + #[serde(skip_serializing_if = "Option::is_none")] + pub features: Option, + /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. + /// This can be useful for storing additional information about the object in a structured format. + /// Individual keys can be unset by posting an empty value to them. + /// All keys can be unset by posting an empty value to `metadata`. + #[serde(skip_serializing_if = "Option::is_none")] + pub metadata: Option<&'a std::collections::HashMap>, + /// The set of functionalities that the platform can restrict on the FinancialAccount. + #[serde(skip_serializing_if = "Option::is_none")] + pub platform_restrictions: Option, + /// The currencies the FinancialAccount can hold a balance in. + pub supported_currencies: &'a [&'a str], +} +impl<'a> CreateTreasuryFinancialAccount<'a> { + pub fn new(supported_currencies: &'a [&'a str]) -> Self { + Self { + expand: None, + features: None, + metadata: None, + platform_restrictions: None, + supported_currencies, + } + } +} +/// Encodes whether a FinancialAccount has access to a particular feature. +/// Stripe or the platform can control features via the requested field. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreateTreasuryFinancialAccountFeatures { + /// Encodes the FinancialAccount's ability to be used with the Issuing product, including attaching cards to and drawing funds from the FinancialAccount. + #[serde(skip_serializing_if = "Option::is_none")] + pub card_issuing: Option, + /// Represents whether this FinancialAccount is eligible for deposit insurance. + /// Various factors determine the insurance amount. + #[serde(skip_serializing_if = "Option::is_none")] + pub deposit_insurance: Option, + /// Contains Features that add FinancialAddresses to the FinancialAccount. + #[serde(skip_serializing_if = "Option::is_none")] + pub financial_addresses: Option, + /// Contains settings related to adding funds to a FinancialAccount from another Account with the same owner. + #[serde(skip_serializing_if = "Option::is_none")] + pub inbound_transfers: Option, + /// Represents the ability for the FinancialAccount to send money to, or receive money from other FinancialAccounts (for example, via OutboundPayment). + #[serde(skip_serializing_if = "Option::is_none")] + pub intra_stripe_flows: Option, + /// Includes Features related to initiating money movement out of the FinancialAccount to someone else's bucket of money. + #[serde(skip_serializing_if = "Option::is_none")] + pub outbound_payments: Option, + /// Contains a Feature and settings related to moving money out of the FinancialAccount into another Account with the same owner. + #[serde(skip_serializing_if = "Option::is_none")] + pub outbound_transfers: Option, +} +impl CreateTreasuryFinancialAccountFeatures { + pub fn new() -> Self { + Self::default() + } +} +/// Encodes the FinancialAccount's ability to be used with the Issuing product, including attaching cards to and drawing funds from the FinancialAccount. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreateTreasuryFinancialAccountFeaturesCardIssuing { + /// Whether the FinancialAccount should have the Feature. + pub requested: bool, +} +impl CreateTreasuryFinancialAccountFeaturesCardIssuing { + pub fn new(requested: bool) -> Self { + Self { requested } + } +} +/// Represents whether this FinancialAccount is eligible for deposit insurance. +/// Various factors determine the insurance amount. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreateTreasuryFinancialAccountFeaturesDepositInsurance { + /// Whether the FinancialAccount should have the Feature. + pub requested: bool, +} +impl CreateTreasuryFinancialAccountFeaturesDepositInsurance { + pub fn new(requested: bool) -> Self { + Self { requested } + } +} +/// Contains Features that add FinancialAddresses to the FinancialAccount. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreateTreasuryFinancialAccountFeaturesFinancialAddresses { + /// Adds an ABA FinancialAddress to the FinancialAccount. + #[serde(skip_serializing_if = "Option::is_none")] + pub aba: Option, +} +impl CreateTreasuryFinancialAccountFeaturesFinancialAddresses { + pub fn new() -> Self { + Self::default() + } +} +/// Adds an ABA FinancialAddress to the FinancialAccount. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreateTreasuryFinancialAccountFeaturesFinancialAddressesAba { + /// Whether the FinancialAccount should have the Feature. + pub requested: bool, +} +impl CreateTreasuryFinancialAccountFeaturesFinancialAddressesAba { + pub fn new(requested: bool) -> Self { + Self { requested } + } +} +/// Contains settings related to adding funds to a FinancialAccount from another Account with the same owner. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreateTreasuryFinancialAccountFeaturesInboundTransfers { + /// Enables ACH Debits via the InboundTransfers API. + #[serde(skip_serializing_if = "Option::is_none")] + pub ach: Option, +} +impl CreateTreasuryFinancialAccountFeaturesInboundTransfers { + pub fn new() -> Self { + Self::default() + } +} +/// Enables ACH Debits via the InboundTransfers API. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreateTreasuryFinancialAccountFeaturesInboundTransfersAch { + /// Whether the FinancialAccount should have the Feature. + pub requested: bool, +} +impl CreateTreasuryFinancialAccountFeaturesInboundTransfersAch { + pub fn new(requested: bool) -> Self { + Self { requested } + } +} +/// Represents the ability for the FinancialAccount to send money to, or receive money from other FinancialAccounts (for example, via OutboundPayment). +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreateTreasuryFinancialAccountFeaturesIntraStripeFlows { + /// Whether the FinancialAccount should have the Feature. + pub requested: bool, +} +impl CreateTreasuryFinancialAccountFeaturesIntraStripeFlows { + pub fn new(requested: bool) -> Self { + Self { requested } + } +} +/// Includes Features related to initiating money movement out of the FinancialAccount to someone else's bucket of money. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreateTreasuryFinancialAccountFeaturesOutboundPayments { + /// Enables ACH transfers via the OutboundPayments API. + #[serde(skip_serializing_if = "Option::is_none")] + pub ach: Option, + /// Enables US domestic wire transfers via the OutboundPayments API. + #[serde(skip_serializing_if = "Option::is_none")] + pub us_domestic_wire: + Option, +} +impl CreateTreasuryFinancialAccountFeaturesOutboundPayments { + pub fn new() -> Self { + Self::default() + } +} +/// Enables ACH transfers via the OutboundPayments API. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreateTreasuryFinancialAccountFeaturesOutboundPaymentsAch { + /// Whether the FinancialAccount should have the Feature. + pub requested: bool, +} +impl CreateTreasuryFinancialAccountFeaturesOutboundPaymentsAch { + pub fn new(requested: bool) -> Self { + Self { requested } + } +} +/// Enables US domestic wire transfers via the OutboundPayments API. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreateTreasuryFinancialAccountFeaturesOutboundPaymentsUsDomesticWire { + /// Whether the FinancialAccount should have the Feature. + pub requested: bool, +} +impl CreateTreasuryFinancialAccountFeaturesOutboundPaymentsUsDomesticWire { + pub fn new(requested: bool) -> Self { + Self { requested } + } +} +/// Contains a Feature and settings related to moving money out of the FinancialAccount into another Account with the same owner. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreateTreasuryFinancialAccountFeaturesOutboundTransfers { + /// Enables ACH transfers via the OutboundTransfers API. + #[serde(skip_serializing_if = "Option::is_none")] + pub ach: Option, + /// Enables US domestic wire transfers via the OutboundTransfers API. + #[serde(skip_serializing_if = "Option::is_none")] + pub us_domestic_wire: + Option, +} +impl CreateTreasuryFinancialAccountFeaturesOutboundTransfers { + pub fn new() -> Self { + Self::default() + } +} +/// Enables ACH transfers via the OutboundTransfers API. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreateTreasuryFinancialAccountFeaturesOutboundTransfersAch { + /// Whether the FinancialAccount should have the Feature. + pub requested: bool, +} +impl CreateTreasuryFinancialAccountFeaturesOutboundTransfersAch { + pub fn new(requested: bool) -> Self { + Self { requested } + } +} +/// Enables US domestic wire transfers via the OutboundTransfers API. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreateTreasuryFinancialAccountFeaturesOutboundTransfersUsDomesticWire { + /// Whether the FinancialAccount should have the Feature. + pub requested: bool, +} +impl CreateTreasuryFinancialAccountFeaturesOutboundTransfersUsDomesticWire { + pub fn new(requested: bool) -> Self { + Self { requested } + } +} +/// The set of functionalities that the platform can restrict on the FinancialAccount. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreateTreasuryFinancialAccountPlatformRestrictions { + /// Restricts all inbound money movement. + #[serde(skip_serializing_if = "Option::is_none")] + pub inbound_flows: Option, + /// Restricts all outbound money movement. + #[serde(skip_serializing_if = "Option::is_none")] + pub outbound_flows: Option, +} +impl CreateTreasuryFinancialAccountPlatformRestrictions { + pub fn new() -> Self { + Self::default() + } +} +/// Restricts all inbound money movement. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreateTreasuryFinancialAccountPlatformRestrictionsInboundFlows { + Restricted, + Unrestricted, +} +impl CreateTreasuryFinancialAccountPlatformRestrictionsInboundFlows { + pub fn as_str(self) -> &'static str { + use CreateTreasuryFinancialAccountPlatformRestrictionsInboundFlows::*; + match self { + Restricted => "restricted", + Unrestricted => "unrestricted", + } + } +} + +impl std::str::FromStr for CreateTreasuryFinancialAccountPlatformRestrictionsInboundFlows { + type Err = (); + fn from_str(s: &str) -> Result { + use CreateTreasuryFinancialAccountPlatformRestrictionsInboundFlows::*; + match s { + "restricted" => Ok(Restricted), + "unrestricted" => Ok(Unrestricted), + _ => Err(()), + } + } +} +impl std::fmt::Display for CreateTreasuryFinancialAccountPlatformRestrictionsInboundFlows { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreateTreasuryFinancialAccountPlatformRestrictionsInboundFlows { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreateTreasuryFinancialAccountPlatformRestrictionsInboundFlows { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Restricts all outbound money movement. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreateTreasuryFinancialAccountPlatformRestrictionsOutboundFlows { + Restricted, + Unrestricted, +} +impl CreateTreasuryFinancialAccountPlatformRestrictionsOutboundFlows { + pub fn as_str(self) -> &'static str { + use CreateTreasuryFinancialAccountPlatformRestrictionsOutboundFlows::*; + match self { + Restricted => "restricted", + Unrestricted => "unrestricted", + } + } +} + +impl std::str::FromStr for CreateTreasuryFinancialAccountPlatformRestrictionsOutboundFlows { + type Err = (); + fn from_str(s: &str) -> Result { + use CreateTreasuryFinancialAccountPlatformRestrictionsOutboundFlows::*; + match s { + "restricted" => Ok(Restricted), + "unrestricted" => Ok(Unrestricted), + _ => Err(()), + } + } +} +impl std::fmt::Display for CreateTreasuryFinancialAccountPlatformRestrictionsOutboundFlows { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreateTreasuryFinancialAccountPlatformRestrictionsOutboundFlows { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreateTreasuryFinancialAccountPlatformRestrictionsOutboundFlows { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'a> CreateTreasuryFinancialAccount<'a> { + /// Creates a new FinancialAccount. For now, each connected account can only have one FinancialAccount. + pub fn send( + &self, + client: &stripe::Client, + ) -> stripe::Response { + client.send_form("/treasury/financial_accounts", self, http_types::Method::Post) + } +} +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdateTreasuryFinancialAccount<'a> { + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, + /// Encodes whether a FinancialAccount has access to a particular feature, with a status enum and associated `status_details`. + /// Stripe or the platform may control features via the requested field. + #[serde(skip_serializing_if = "Option::is_none")] + pub features: Option, + /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. + /// This can be useful for storing additional information about the object in a structured format. + /// Individual keys can be unset by posting an empty value to them. + /// All keys can be unset by posting an empty value to `metadata`. + #[serde(skip_serializing_if = "Option::is_none")] + pub metadata: Option<&'a std::collections::HashMap>, + /// The set of functionalities that the platform can restrict on the FinancialAccount. + #[serde(skip_serializing_if = "Option::is_none")] + pub platform_restrictions: Option, +} +impl<'a> UpdateTreasuryFinancialAccount<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// Encodes whether a FinancialAccount has access to a particular feature, with a status enum and associated `status_details`. +/// Stripe or the platform may control features via the requested field. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdateTreasuryFinancialAccountFeatures { + /// Encodes the FinancialAccount's ability to be used with the Issuing product, including attaching cards to and drawing funds from the FinancialAccount. + #[serde(skip_serializing_if = "Option::is_none")] + pub card_issuing: Option, + /// Represents whether this FinancialAccount is eligible for deposit insurance. + /// Various factors determine the insurance amount. + #[serde(skip_serializing_if = "Option::is_none")] + pub deposit_insurance: Option, + /// Contains Features that add FinancialAddresses to the FinancialAccount. + #[serde(skip_serializing_if = "Option::is_none")] + pub financial_addresses: Option, + /// Contains settings related to adding funds to a FinancialAccount from another Account with the same owner. + #[serde(skip_serializing_if = "Option::is_none")] + pub inbound_transfers: Option, + /// Represents the ability for the FinancialAccount to send money to, or receive money from other FinancialAccounts (for example, via OutboundPayment). + #[serde(skip_serializing_if = "Option::is_none")] + pub intra_stripe_flows: Option, + /// Includes Features related to initiating money movement out of the FinancialAccount to someone else's bucket of money. + #[serde(skip_serializing_if = "Option::is_none")] + pub outbound_payments: Option, + /// Contains a Feature and settings related to moving money out of the FinancialAccount into another Account with the same owner. + #[serde(skip_serializing_if = "Option::is_none")] + pub outbound_transfers: Option, +} +impl UpdateTreasuryFinancialAccountFeatures { + pub fn new() -> Self { + Self::default() + } +} +/// Encodes the FinancialAccount's ability to be used with the Issuing product, including attaching cards to and drawing funds from the FinancialAccount. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct UpdateTreasuryFinancialAccountFeaturesCardIssuing { + /// Whether the FinancialAccount should have the Feature. + pub requested: bool, +} +impl UpdateTreasuryFinancialAccountFeaturesCardIssuing { + pub fn new(requested: bool) -> Self { + Self { requested } + } +} +/// Represents whether this FinancialAccount is eligible for deposit insurance. +/// Various factors determine the insurance amount. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct UpdateTreasuryFinancialAccountFeaturesDepositInsurance { + /// Whether the FinancialAccount should have the Feature. + pub requested: bool, +} +impl UpdateTreasuryFinancialAccountFeaturesDepositInsurance { + pub fn new(requested: bool) -> Self { + Self { requested } + } +} +/// Contains Features that add FinancialAddresses to the FinancialAccount. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdateTreasuryFinancialAccountFeaturesFinancialAddresses { + /// Adds an ABA FinancialAddress to the FinancialAccount. + #[serde(skip_serializing_if = "Option::is_none")] + pub aba: Option, +} +impl UpdateTreasuryFinancialAccountFeaturesFinancialAddresses { + pub fn new() -> Self { + Self::default() + } +} +/// Adds an ABA FinancialAddress to the FinancialAccount. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct UpdateTreasuryFinancialAccountFeaturesFinancialAddressesAba { + /// Whether the FinancialAccount should have the Feature. + pub requested: bool, +} +impl UpdateTreasuryFinancialAccountFeaturesFinancialAddressesAba { + pub fn new(requested: bool) -> Self { + Self { requested } + } +} +/// Contains settings related to adding funds to a FinancialAccount from another Account with the same owner. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdateTreasuryFinancialAccountFeaturesInboundTransfers { + /// Enables ACH Debits via the InboundTransfers API. + #[serde(skip_serializing_if = "Option::is_none")] + pub ach: Option, +} +impl UpdateTreasuryFinancialAccountFeaturesInboundTransfers { + pub fn new() -> Self { + Self::default() + } +} +/// Enables ACH Debits via the InboundTransfers API. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct UpdateTreasuryFinancialAccountFeaturesInboundTransfersAch { + /// Whether the FinancialAccount should have the Feature. + pub requested: bool, +} +impl UpdateTreasuryFinancialAccountFeaturesInboundTransfersAch { + pub fn new(requested: bool) -> Self { + Self { requested } + } +} +/// Represents the ability for the FinancialAccount to send money to, or receive money from other FinancialAccounts (for example, via OutboundPayment). +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct UpdateTreasuryFinancialAccountFeaturesIntraStripeFlows { + /// Whether the FinancialAccount should have the Feature. + pub requested: bool, +} +impl UpdateTreasuryFinancialAccountFeaturesIntraStripeFlows { + pub fn new(requested: bool) -> Self { + Self { requested } + } +} +/// Includes Features related to initiating money movement out of the FinancialAccount to someone else's bucket of money. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdateTreasuryFinancialAccountFeaturesOutboundPayments { + /// Enables ACH transfers via the OutboundPayments API. + #[serde(skip_serializing_if = "Option::is_none")] + pub ach: Option, + /// Enables US domestic wire transfers via the OutboundPayments API. + #[serde(skip_serializing_if = "Option::is_none")] + pub us_domestic_wire: + Option, +} +impl UpdateTreasuryFinancialAccountFeaturesOutboundPayments { + pub fn new() -> Self { + Self::default() + } +} +/// Enables ACH transfers via the OutboundPayments API. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct UpdateTreasuryFinancialAccountFeaturesOutboundPaymentsAch { + /// Whether the FinancialAccount should have the Feature. + pub requested: bool, +} +impl UpdateTreasuryFinancialAccountFeaturesOutboundPaymentsAch { + pub fn new(requested: bool) -> Self { + Self { requested } + } +} +/// Enables US domestic wire transfers via the OutboundPayments API. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct UpdateTreasuryFinancialAccountFeaturesOutboundPaymentsUsDomesticWire { + /// Whether the FinancialAccount should have the Feature. + pub requested: bool, +} +impl UpdateTreasuryFinancialAccountFeaturesOutboundPaymentsUsDomesticWire { + pub fn new(requested: bool) -> Self { + Self { requested } + } +} +/// Contains a Feature and settings related to moving money out of the FinancialAccount into another Account with the same owner. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdateTreasuryFinancialAccountFeaturesOutboundTransfers { + /// Enables ACH transfers via the OutboundTransfers API. + #[serde(skip_serializing_if = "Option::is_none")] + pub ach: Option, + /// Enables US domestic wire transfers via the OutboundTransfers API. + #[serde(skip_serializing_if = "Option::is_none")] + pub us_domestic_wire: + Option, +} +impl UpdateTreasuryFinancialAccountFeaturesOutboundTransfers { + pub fn new() -> Self { + Self::default() + } +} +/// Enables ACH transfers via the OutboundTransfers API. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct UpdateTreasuryFinancialAccountFeaturesOutboundTransfersAch { + /// Whether the FinancialAccount should have the Feature. + pub requested: bool, +} +impl UpdateTreasuryFinancialAccountFeaturesOutboundTransfersAch { + pub fn new(requested: bool) -> Self { + Self { requested } + } +} +/// Enables US domestic wire transfers via the OutboundTransfers API. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct UpdateTreasuryFinancialAccountFeaturesOutboundTransfersUsDomesticWire { + /// Whether the FinancialAccount should have the Feature. + pub requested: bool, +} +impl UpdateTreasuryFinancialAccountFeaturesOutboundTransfersUsDomesticWire { + pub fn new(requested: bool) -> Self { + Self { requested } + } +} +/// The set of functionalities that the platform can restrict on the FinancialAccount. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdateTreasuryFinancialAccountPlatformRestrictions { + /// Restricts all inbound money movement. + #[serde(skip_serializing_if = "Option::is_none")] + pub inbound_flows: Option, + /// Restricts all outbound money movement. + #[serde(skip_serializing_if = "Option::is_none")] + pub outbound_flows: Option, +} +impl UpdateTreasuryFinancialAccountPlatformRestrictions { + pub fn new() -> Self { + Self::default() + } +} +/// Restricts all inbound money movement. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum UpdateTreasuryFinancialAccountPlatformRestrictionsInboundFlows { + Restricted, + Unrestricted, +} +impl UpdateTreasuryFinancialAccountPlatformRestrictionsInboundFlows { + pub fn as_str(self) -> &'static str { + use UpdateTreasuryFinancialAccountPlatformRestrictionsInboundFlows::*; + match self { + Restricted => "restricted", + Unrestricted => "unrestricted", + } + } +} + +impl std::str::FromStr for UpdateTreasuryFinancialAccountPlatformRestrictionsInboundFlows { + type Err = (); + fn from_str(s: &str) -> Result { + use UpdateTreasuryFinancialAccountPlatformRestrictionsInboundFlows::*; + match s { + "restricted" => Ok(Restricted), + "unrestricted" => Ok(Unrestricted), + _ => Err(()), + } + } +} +impl std::fmt::Display for UpdateTreasuryFinancialAccountPlatformRestrictionsInboundFlows { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for UpdateTreasuryFinancialAccountPlatformRestrictionsInboundFlows { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for UpdateTreasuryFinancialAccountPlatformRestrictionsInboundFlows { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Restricts all outbound money movement. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum UpdateTreasuryFinancialAccountPlatformRestrictionsOutboundFlows { + Restricted, + Unrestricted, +} +impl UpdateTreasuryFinancialAccountPlatformRestrictionsOutboundFlows { + pub fn as_str(self) -> &'static str { + use UpdateTreasuryFinancialAccountPlatformRestrictionsOutboundFlows::*; + match self { + Restricted => "restricted", + Unrestricted => "unrestricted", + } + } +} + +impl std::str::FromStr for UpdateTreasuryFinancialAccountPlatformRestrictionsOutboundFlows { + type Err = (); + fn from_str(s: &str) -> Result { + use UpdateTreasuryFinancialAccountPlatformRestrictionsOutboundFlows::*; + match s { + "restricted" => Ok(Restricted), + "unrestricted" => Ok(Unrestricted), + _ => Err(()), + } + } +} +impl std::fmt::Display for UpdateTreasuryFinancialAccountPlatformRestrictionsOutboundFlows { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for UpdateTreasuryFinancialAccountPlatformRestrictionsOutboundFlows { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for UpdateTreasuryFinancialAccountPlatformRestrictionsOutboundFlows { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'a> UpdateTreasuryFinancialAccount<'a> { + /// Updates the details of a FinancialAccount. + pub fn send( + &self, + client: &stripe::Client, + financial_account: &stripe_treasury::TreasuryFinancialAccountId, + ) -> stripe::Response { + client.send_form( + &format!("/treasury/financial_accounts/{financial_account}"), + self, + http_types::Method::Post, + ) + } +} +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdateFeaturesTreasuryFinancialAccount<'a> { + /// Encodes the FinancialAccount's ability to be used with the Issuing product, including attaching cards to and drawing funds from the FinancialAccount. + #[serde(skip_serializing_if = "Option::is_none")] + pub card_issuing: Option, + /// Represents whether this FinancialAccount is eligible for deposit insurance. + /// Various factors determine the insurance amount. + #[serde(skip_serializing_if = "Option::is_none")] + pub deposit_insurance: Option, + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, + /// Contains Features that add FinancialAddresses to the FinancialAccount. + #[serde(skip_serializing_if = "Option::is_none")] + pub financial_addresses: Option, + /// Contains settings related to adding funds to a FinancialAccount from another Account with the same owner. + #[serde(skip_serializing_if = "Option::is_none")] + pub inbound_transfers: Option, + /// Represents the ability for the FinancialAccount to send money to, or receive money from other FinancialAccounts (for example, via OutboundPayment). + #[serde(skip_serializing_if = "Option::is_none")] + pub intra_stripe_flows: Option, + /// Includes Features related to initiating money movement out of the FinancialAccount to someone else's bucket of money. + #[serde(skip_serializing_if = "Option::is_none")] + pub outbound_payments: Option, + /// Contains a Feature and settings related to moving money out of the FinancialAccount into another Account with the same owner. + #[serde(skip_serializing_if = "Option::is_none")] + pub outbound_transfers: Option, +} +impl<'a> UpdateFeaturesTreasuryFinancialAccount<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// Encodes the FinancialAccount's ability to be used with the Issuing product, including attaching cards to and drawing funds from the FinancialAccount. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct UpdateFeaturesTreasuryFinancialAccountCardIssuing { + /// Whether the FinancialAccount should have the Feature. + pub requested: bool, +} +impl UpdateFeaturesTreasuryFinancialAccountCardIssuing { + pub fn new(requested: bool) -> Self { + Self { requested } + } +} +/// Represents whether this FinancialAccount is eligible for deposit insurance. +/// Various factors determine the insurance amount. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct UpdateFeaturesTreasuryFinancialAccountDepositInsurance { + /// Whether the FinancialAccount should have the Feature. + pub requested: bool, +} +impl UpdateFeaturesTreasuryFinancialAccountDepositInsurance { + pub fn new(requested: bool) -> Self { + Self { requested } + } +} +/// Contains Features that add FinancialAddresses to the FinancialAccount. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdateFeaturesTreasuryFinancialAccountFinancialAddresses { + /// Adds an ABA FinancialAddress to the FinancialAccount. + #[serde(skip_serializing_if = "Option::is_none")] + pub aba: Option, +} +impl UpdateFeaturesTreasuryFinancialAccountFinancialAddresses { + pub fn new() -> Self { + Self::default() + } +} +/// Adds an ABA FinancialAddress to the FinancialAccount. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct UpdateFeaturesTreasuryFinancialAccountFinancialAddressesAba { + /// Whether the FinancialAccount should have the Feature. + pub requested: bool, +} +impl UpdateFeaturesTreasuryFinancialAccountFinancialAddressesAba { + pub fn new(requested: bool) -> Self { + Self { requested } + } +} +/// Contains settings related to adding funds to a FinancialAccount from another Account with the same owner. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdateFeaturesTreasuryFinancialAccountInboundTransfers { + /// Enables ACH Debits via the InboundTransfers API. + #[serde(skip_serializing_if = "Option::is_none")] + pub ach: Option, +} +impl UpdateFeaturesTreasuryFinancialAccountInboundTransfers { + pub fn new() -> Self { + Self::default() + } +} +/// Enables ACH Debits via the InboundTransfers API. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct UpdateFeaturesTreasuryFinancialAccountInboundTransfersAch { + /// Whether the FinancialAccount should have the Feature. + pub requested: bool, +} +impl UpdateFeaturesTreasuryFinancialAccountInboundTransfersAch { + pub fn new(requested: bool) -> Self { + Self { requested } + } +} +/// Represents the ability for the FinancialAccount to send money to, or receive money from other FinancialAccounts (for example, via OutboundPayment). +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct UpdateFeaturesTreasuryFinancialAccountIntraStripeFlows { + /// Whether the FinancialAccount should have the Feature. + pub requested: bool, +} +impl UpdateFeaturesTreasuryFinancialAccountIntraStripeFlows { + pub fn new(requested: bool) -> Self { + Self { requested } + } +} +/// Includes Features related to initiating money movement out of the FinancialAccount to someone else's bucket of money. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdateFeaturesTreasuryFinancialAccountOutboundPayments { + /// Enables ACH transfers via the OutboundPayments API. + #[serde(skip_serializing_if = "Option::is_none")] + pub ach: Option, + /// Enables US domestic wire transfers via the OutboundPayments API. + #[serde(skip_serializing_if = "Option::is_none")] + pub us_domestic_wire: + Option, +} +impl UpdateFeaturesTreasuryFinancialAccountOutboundPayments { + pub fn new() -> Self { + Self::default() + } +} +/// Enables ACH transfers via the OutboundPayments API. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct UpdateFeaturesTreasuryFinancialAccountOutboundPaymentsAch { + /// Whether the FinancialAccount should have the Feature. + pub requested: bool, +} +impl UpdateFeaturesTreasuryFinancialAccountOutboundPaymentsAch { + pub fn new(requested: bool) -> Self { + Self { requested } + } +} +/// Enables US domestic wire transfers via the OutboundPayments API. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct UpdateFeaturesTreasuryFinancialAccountOutboundPaymentsUsDomesticWire { + /// Whether the FinancialAccount should have the Feature. + pub requested: bool, +} +impl UpdateFeaturesTreasuryFinancialAccountOutboundPaymentsUsDomesticWire { + pub fn new(requested: bool) -> Self { + Self { requested } + } +} +/// Contains a Feature and settings related to moving money out of the FinancialAccount into another Account with the same owner. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct UpdateFeaturesTreasuryFinancialAccountOutboundTransfers { + /// Enables ACH transfers via the OutboundTransfers API. + #[serde(skip_serializing_if = "Option::is_none")] + pub ach: Option, + /// Enables US domestic wire transfers via the OutboundTransfers API. + #[serde(skip_serializing_if = "Option::is_none")] + pub us_domestic_wire: + Option, +} +impl UpdateFeaturesTreasuryFinancialAccountOutboundTransfers { + pub fn new() -> Self { + Self::default() + } +} +/// Enables ACH transfers via the OutboundTransfers API. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct UpdateFeaturesTreasuryFinancialAccountOutboundTransfersAch { + /// Whether the FinancialAccount should have the Feature. + pub requested: bool, +} +impl UpdateFeaturesTreasuryFinancialAccountOutboundTransfersAch { + pub fn new(requested: bool) -> Self { + Self { requested } + } +} +/// Enables US domestic wire transfers via the OutboundTransfers API. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct UpdateFeaturesTreasuryFinancialAccountOutboundTransfersUsDomesticWire { + /// Whether the FinancialAccount should have the Feature. + pub requested: bool, +} +impl UpdateFeaturesTreasuryFinancialAccountOutboundTransfersUsDomesticWire { + pub fn new(requested: bool) -> Self { + Self { requested } + } +} +impl<'a> UpdateFeaturesTreasuryFinancialAccount<'a> { + /// Updates the Features associated with a FinancialAccount. + pub fn send( + &self, + client: &stripe::Client, + financial_account: &stripe_treasury::TreasuryFinancialAccountId, + ) -> stripe::Response { + client.send_form( + &format!("/treasury/financial_accounts/{financial_account}/features"), + self, + http_types::Method::Post, + ) + } +} diff --git a/generated/stripe_treasury/src/treasury_financial_account/types.rs b/generated/stripe_treasury/src/treasury_financial_account/types.rs new file mode 100644 index 000000000..0bbcf92ad --- /dev/null +++ b/generated/stripe_treasury/src/treasury_financial_account/types.rs @@ -0,0 +1,181 @@ +/// Stripe Treasury provides users with a container for money called a FinancialAccount that is separate from their Payments balance. +/// FinancialAccounts serve as the source and destination of Treasury’s money movement APIs. +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct TreasuryFinancialAccount { + /// The array of paths to active Features in the Features hash. + #[serde(skip_serializing_if = "Option::is_none")] + pub active_features: Option>, + pub balance: stripe_treasury::TreasuryFinancialAccountsResourceBalance, + /// Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). + pub country: String, + /// Time at which the object was created. Measured in seconds since the Unix epoch. + pub created: stripe_types::Timestamp, + #[serde(skip_serializing_if = "Option::is_none")] + pub features: Option, + /// The set of credentials that resolve to a FinancialAccount. + pub financial_addresses: + Vec, + /// Unique identifier for the object. + pub id: stripe_treasury::TreasuryFinancialAccountId, + /// Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + pub livemode: bool, + /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. + /// This can be useful for storing additional information about the object in a structured format. + pub metadata: Option>, + /// The array of paths to pending Features in the Features hash. + #[serde(skip_serializing_if = "Option::is_none")] + pub pending_features: Option>, + /// The set of functionalities that the platform can restrict on the FinancialAccount. + #[serde(skip_serializing_if = "Option::is_none")] + pub platform_restrictions: + Option, + /// The array of paths to restricted Features in the Features hash. + #[serde(skip_serializing_if = "Option::is_none")] + pub restricted_features: Option>, + /// The enum specifying what state the account is in. + pub status: TreasuryFinancialAccountStatus, + pub status_details: stripe_treasury::TreasuryFinancialAccountsResourceStatusDetails, + /// The currencies the FinancialAccount can hold a balance in. + /// Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. + pub supported_currencies: Vec, +} +/// The enum specifying what state the account is in. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum TreasuryFinancialAccountStatus { + Closed, + Open, +} +impl TreasuryFinancialAccountStatus { + pub fn as_str(self) -> &'static str { + use TreasuryFinancialAccountStatus::*; + match self { + Closed => "closed", + Open => "open", + } + } +} + +impl std::str::FromStr for TreasuryFinancialAccountStatus { + type Err = (); + fn from_str(s: &str) -> Result { + use TreasuryFinancialAccountStatus::*; + match s { + "closed" => Ok(Closed), + "open" => Ok(Open), + _ => Err(()), + } + } +} +impl std::fmt::Display for TreasuryFinancialAccountStatus { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for TreasuryFinancialAccountStatus { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for TreasuryFinancialAccountStatus { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for TreasuryFinancialAccountStatus { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| { + serde::de::Error::custom("Unknown value for TreasuryFinancialAccountStatus") + }) + } +} +impl stripe_types::Object for TreasuryFinancialAccount { + type Id = stripe_treasury::TreasuryFinancialAccountId; + fn id(&self) -> &Self::Id { + &self.id + } +} +stripe_types::def_id!(TreasuryFinancialAccountId); +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum TreasuryFinancialAccountArray { + CardIssuing, + DepositInsurance, + FinancialAddressesAba, + InboundTransfersAch, + IntraStripeFlows, + OutboundPaymentsAch, + OutboundPaymentsUsDomesticWire, + OutboundTransfersAch, + OutboundTransfersUsDomesticWire, + RemoteDepositCapture, +} +impl TreasuryFinancialAccountArray { + pub fn as_str(self) -> &'static str { + use TreasuryFinancialAccountArray::*; + match self { + CardIssuing => "card_issuing", + DepositInsurance => "deposit_insurance", + FinancialAddressesAba => "financial_addresses.aba", + InboundTransfersAch => "inbound_transfers.ach", + IntraStripeFlows => "intra_stripe_flows", + OutboundPaymentsAch => "outbound_payments.ach", + OutboundPaymentsUsDomesticWire => "outbound_payments.us_domestic_wire", + OutboundTransfersAch => "outbound_transfers.ach", + OutboundTransfersUsDomesticWire => "outbound_transfers.us_domestic_wire", + RemoteDepositCapture => "remote_deposit_capture", + } + } +} + +impl std::str::FromStr for TreasuryFinancialAccountArray { + type Err = (); + fn from_str(s: &str) -> Result { + use TreasuryFinancialAccountArray::*; + match s { + "card_issuing" => Ok(CardIssuing), + "deposit_insurance" => Ok(DepositInsurance), + "financial_addresses.aba" => Ok(FinancialAddressesAba), + "inbound_transfers.ach" => Ok(InboundTransfersAch), + "intra_stripe_flows" => Ok(IntraStripeFlows), + "outbound_payments.ach" => Ok(OutboundPaymentsAch), + "outbound_payments.us_domestic_wire" => Ok(OutboundPaymentsUsDomesticWire), + "outbound_transfers.ach" => Ok(OutboundTransfersAch), + "outbound_transfers.us_domestic_wire" => Ok(OutboundTransfersUsDomesticWire), + "remote_deposit_capture" => Ok(RemoteDepositCapture), + _ => Err(()), + } + } +} +impl std::fmt::Display for TreasuryFinancialAccountArray { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for TreasuryFinancialAccountArray { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for TreasuryFinancialAccountArray { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for TreasuryFinancialAccountArray { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| { + serde::de::Error::custom("Unknown value for TreasuryFinancialAccountArray") + }) + } +} diff --git a/generated/stripe_treasury/src/treasury_financial_account_features.rs b/generated/stripe_treasury/src/treasury_financial_account_features.rs new file mode 100644 index 000000000..3a461ef13 --- /dev/null +++ b/generated/stripe_treasury/src/treasury_financial_account_features.rs @@ -0,0 +1,24 @@ +/// Encodes whether a FinancialAccount has access to a particular Feature, with a `status` enum and associated `status_details`. +/// Stripe or the platform can control Features via the requested field. +#[derive(Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct TreasuryFinancialAccountFeatures { + #[serde(skip_serializing_if = "Option::is_none")] + pub card_issuing: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub deposit_insurance: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub financial_addresses: + Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub inbound_transfers: + Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub intra_stripe_flows: + Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub outbound_payments: + Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub outbound_transfers: + Option, +} diff --git a/generated/stripe_treasury/src/treasury_financial_accounts_resource_aba_record.rs b/generated/stripe_treasury/src/treasury_financial_accounts_resource_aba_record.rs new file mode 100644 index 000000000..8cb667094 --- /dev/null +++ b/generated/stripe_treasury/src/treasury_financial_accounts_resource_aba_record.rs @@ -0,0 +1,14 @@ +/// ABA Records contain U.S. bank account details per the ABA format. +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct TreasuryFinancialAccountsResourceAbaRecord { + /// The name of the person or business that owns the bank account. + pub account_holder_name: String, + /// The account number. + pub account_number: Option, + /// The last four characters of the account number. + pub account_number_last4: String, + /// Name of the bank. + pub bank_name: String, + /// Routing number for the account. + pub routing_number: String, +} diff --git a/generated/stripe_treasury/src/treasury_financial_accounts_resource_aba_toggle_settings.rs b/generated/stripe_treasury/src/treasury_financial_accounts_resource_aba_toggle_settings.rs new file mode 100644 index 000000000..5d62705e9 --- /dev/null +++ b/generated/stripe_treasury/src/treasury_financial_accounts_resource_aba_toggle_settings.rs @@ -0,0 +1,71 @@ +/// Toggle settings for enabling/disabling the ABA address feature +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct TreasuryFinancialAccountsResourceAbaToggleSettings { + /// Whether the FinancialAccount should have the Feature. + pub requested: bool, + /// Whether the Feature is operational. + pub status: TreasuryFinancialAccountsResourceAbaToggleSettingsStatus, + /// Additional details; includes at least one entry when the status is not `active`. + pub status_details: + Vec, +} +/// Whether the Feature is operational. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum TreasuryFinancialAccountsResourceAbaToggleSettingsStatus { + Active, + Pending, + Restricted, +} +impl TreasuryFinancialAccountsResourceAbaToggleSettingsStatus { + pub fn as_str(self) -> &'static str { + use TreasuryFinancialAccountsResourceAbaToggleSettingsStatus::*; + match self { + Active => "active", + Pending => "pending", + Restricted => "restricted", + } + } +} + +impl std::str::FromStr for TreasuryFinancialAccountsResourceAbaToggleSettingsStatus { + type Err = (); + fn from_str(s: &str) -> Result { + use TreasuryFinancialAccountsResourceAbaToggleSettingsStatus::*; + match s { + "active" => Ok(Active), + "pending" => Ok(Pending), + "restricted" => Ok(Restricted), + _ => Err(()), + } + } +} +impl std::fmt::Display for TreasuryFinancialAccountsResourceAbaToggleSettingsStatus { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for TreasuryFinancialAccountsResourceAbaToggleSettingsStatus { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for TreasuryFinancialAccountsResourceAbaToggleSettingsStatus { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for TreasuryFinancialAccountsResourceAbaToggleSettingsStatus { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| { + serde::de::Error::custom( + "Unknown value for TreasuryFinancialAccountsResourceAbaToggleSettingsStatus", + ) + }) + } +} diff --git a/generated/stripe_treasury/src/treasury_financial_accounts_resource_ach_toggle_settings.rs b/generated/stripe_treasury/src/treasury_financial_accounts_resource_ach_toggle_settings.rs new file mode 100644 index 000000000..7200910eb --- /dev/null +++ b/generated/stripe_treasury/src/treasury_financial_accounts_resource_ach_toggle_settings.rs @@ -0,0 +1,71 @@ +/// Toggle settings for enabling/disabling an ACH specific feature +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct TreasuryFinancialAccountsResourceAchToggleSettings { + /// Whether the FinancialAccount should have the Feature. + pub requested: bool, + /// Whether the Feature is operational. + pub status: TreasuryFinancialAccountsResourceAchToggleSettingsStatus, + /// Additional details; includes at least one entry when the status is not `active`. + pub status_details: + Vec, +} +/// Whether the Feature is operational. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum TreasuryFinancialAccountsResourceAchToggleSettingsStatus { + Active, + Pending, + Restricted, +} +impl TreasuryFinancialAccountsResourceAchToggleSettingsStatus { + pub fn as_str(self) -> &'static str { + use TreasuryFinancialAccountsResourceAchToggleSettingsStatus::*; + match self { + Active => "active", + Pending => "pending", + Restricted => "restricted", + } + } +} + +impl std::str::FromStr for TreasuryFinancialAccountsResourceAchToggleSettingsStatus { + type Err = (); + fn from_str(s: &str) -> Result { + use TreasuryFinancialAccountsResourceAchToggleSettingsStatus::*; + match s { + "active" => Ok(Active), + "pending" => Ok(Pending), + "restricted" => Ok(Restricted), + _ => Err(()), + } + } +} +impl std::fmt::Display for TreasuryFinancialAccountsResourceAchToggleSettingsStatus { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for TreasuryFinancialAccountsResourceAchToggleSettingsStatus { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for TreasuryFinancialAccountsResourceAchToggleSettingsStatus { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for TreasuryFinancialAccountsResourceAchToggleSettingsStatus { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| { + serde::de::Error::custom( + "Unknown value for TreasuryFinancialAccountsResourceAchToggleSettingsStatus", + ) + }) + } +} diff --git a/generated/stripe_treasury/src/treasury_financial_accounts_resource_balance.rs b/generated/stripe_treasury/src/treasury_financial_accounts_resource_balance.rs new file mode 100644 index 000000000..e24b30e80 --- /dev/null +++ b/generated/stripe_treasury/src/treasury_financial_accounts_resource_balance.rs @@ -0,0 +1,10 @@ +/// Balance information for the FinancialAccount +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct TreasuryFinancialAccountsResourceBalance { + /// Funds the user can spend right now. + pub cash: std::collections::HashMap, + /// Funds not spendable yet, but will become available at a later time. + pub inbound_pending: std::collections::HashMap, + /// Funds in the account, but not spendable because they are being held for pending outbound flows. + pub outbound_pending: std::collections::HashMap, +} diff --git a/generated/stripe_treasury/src/treasury_financial_accounts_resource_closed_status_details.rs b/generated/stripe_treasury/src/treasury_financial_accounts_resource_closed_status_details.rs new file mode 100644 index 000000000..29cd3d10e --- /dev/null +++ b/generated/stripe_treasury/src/treasury_financial_accounts_resource_closed_status_details.rs @@ -0,0 +1,65 @@ +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct TreasuryFinancialAccountsResourceClosedStatusDetails { + /// The array that contains reasons for a FinancialAccount closure. + pub reasons: Vec, +} +/// The array that contains reasons for a FinancialAccount closure. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum TreasuryFinancialAccountsResourceClosedStatusDetailsReasons { + AccountRejected, + ClosedByPlatform, + Other, +} +impl TreasuryFinancialAccountsResourceClosedStatusDetailsReasons { + pub fn as_str(self) -> &'static str { + use TreasuryFinancialAccountsResourceClosedStatusDetailsReasons::*; + match self { + AccountRejected => "account_rejected", + ClosedByPlatform => "closed_by_platform", + Other => "other", + } + } +} + +impl std::str::FromStr for TreasuryFinancialAccountsResourceClosedStatusDetailsReasons { + type Err = (); + fn from_str(s: &str) -> Result { + use TreasuryFinancialAccountsResourceClosedStatusDetailsReasons::*; + match s { + "account_rejected" => Ok(AccountRejected), + "closed_by_platform" => Ok(ClosedByPlatform), + "other" => Ok(Other), + _ => Err(()), + } + } +} +impl std::fmt::Display for TreasuryFinancialAccountsResourceClosedStatusDetailsReasons { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for TreasuryFinancialAccountsResourceClosedStatusDetailsReasons { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for TreasuryFinancialAccountsResourceClosedStatusDetailsReasons { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for TreasuryFinancialAccountsResourceClosedStatusDetailsReasons { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| { + serde::de::Error::custom( + "Unknown value for TreasuryFinancialAccountsResourceClosedStatusDetailsReasons", + ) + }) + } +} diff --git a/generated/stripe_treasury/src/treasury_financial_accounts_resource_financial_address.rs b/generated/stripe_treasury/src/treasury_financial_accounts_resource_financial_address.rs new file mode 100644 index 000000000..1ee47e7cf --- /dev/null +++ b/generated/stripe_treasury/src/treasury_financial_accounts_resource_financial_address.rs @@ -0,0 +1,122 @@ +/// FinancialAddresses contain identifying information that resolves to a FinancialAccount. +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct TreasuryFinancialAccountsResourceFinancialAddress { + #[serde(skip_serializing_if = "Option::is_none")] + pub aba: Option, + /// The list of networks that the address supports + #[serde(skip_serializing_if = "Option::is_none")] + pub supported_networks: + Option>, + /// The type of financial address + #[serde(rename = "type")] + pub type_: TreasuryFinancialAccountsResourceFinancialAddressType, +} +/// The list of networks that the address supports +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum TreasuryFinancialAccountsResourceFinancialAddressSupportedNetworks { + Ach, + UsDomesticWire, +} +impl TreasuryFinancialAccountsResourceFinancialAddressSupportedNetworks { + pub fn as_str(self) -> &'static str { + use TreasuryFinancialAccountsResourceFinancialAddressSupportedNetworks::*; + match self { + Ach => "ach", + UsDomesticWire => "us_domestic_wire", + } + } +} + +impl std::str::FromStr for TreasuryFinancialAccountsResourceFinancialAddressSupportedNetworks { + type Err = (); + fn from_str(s: &str) -> Result { + use TreasuryFinancialAccountsResourceFinancialAddressSupportedNetworks::*; + match s { + "ach" => Ok(Ach), + "us_domestic_wire" => Ok(UsDomesticWire), + _ => Err(()), + } + } +} +impl std::fmt::Display for TreasuryFinancialAccountsResourceFinancialAddressSupportedNetworks { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for TreasuryFinancialAccountsResourceFinancialAddressSupportedNetworks { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for TreasuryFinancialAccountsResourceFinancialAddressSupportedNetworks { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> + for TreasuryFinancialAccountsResourceFinancialAddressSupportedNetworks +{ + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for TreasuryFinancialAccountsResourceFinancialAddressSupportedNetworks")) + } +} +/// The type of financial address +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum TreasuryFinancialAccountsResourceFinancialAddressType { + Aba, +} +impl TreasuryFinancialAccountsResourceFinancialAddressType { + pub fn as_str(self) -> &'static str { + use TreasuryFinancialAccountsResourceFinancialAddressType::*; + match self { + Aba => "aba", + } + } +} + +impl std::str::FromStr for TreasuryFinancialAccountsResourceFinancialAddressType { + type Err = (); + fn from_str(s: &str) -> Result { + use TreasuryFinancialAccountsResourceFinancialAddressType::*; + match s { + "aba" => Ok(Aba), + _ => Err(()), + } + } +} +impl std::fmt::Display for TreasuryFinancialAccountsResourceFinancialAddressType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for TreasuryFinancialAccountsResourceFinancialAddressType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for TreasuryFinancialAccountsResourceFinancialAddressType { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for TreasuryFinancialAccountsResourceFinancialAddressType { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| { + serde::de::Error::custom( + "Unknown value for TreasuryFinancialAccountsResourceFinancialAddressType", + ) + }) + } +} diff --git a/generated/stripe_treasury/src/treasury_financial_accounts_resource_financial_addresses_features.rs b/generated/stripe_treasury/src/treasury_financial_accounts_resource_financial_addresses_features.rs new file mode 100644 index 000000000..20f75b4de --- /dev/null +++ b/generated/stripe_treasury/src/treasury_financial_accounts_resource_financial_addresses_features.rs @@ -0,0 +1,6 @@ +/// Settings related to Financial Addresses features on a Financial Account +#[derive(Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct TreasuryFinancialAccountsResourceFinancialAddressesFeatures { + #[serde(skip_serializing_if = "Option::is_none")] + pub aba: Option, +} diff --git a/generated/stripe_treasury/src/treasury_financial_accounts_resource_inbound_transfers.rs b/generated/stripe_treasury/src/treasury_financial_accounts_resource_inbound_transfers.rs new file mode 100644 index 000000000..666a4f695 --- /dev/null +++ b/generated/stripe_treasury/src/treasury_financial_accounts_resource_inbound_transfers.rs @@ -0,0 +1,6 @@ +/// InboundTransfers contains inbound transfers features for a FinancialAccount. +#[derive(Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct TreasuryFinancialAccountsResourceInboundTransfers { + #[serde(skip_serializing_if = "Option::is_none")] + pub ach: Option, +} diff --git a/generated/stripe_treasury/src/treasury_financial_accounts_resource_outbound_payments.rs b/generated/stripe_treasury/src/treasury_financial_accounts_resource_outbound_payments.rs new file mode 100644 index 000000000..9deb349ad --- /dev/null +++ b/generated/stripe_treasury/src/treasury_financial_accounts_resource_outbound_payments.rs @@ -0,0 +1,8 @@ +/// Settings related to Outbound Payments features on a Financial Account +#[derive(Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct TreasuryFinancialAccountsResourceOutboundPayments { + #[serde(skip_serializing_if = "Option::is_none")] + pub ach: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub us_domestic_wire: Option, +} diff --git a/generated/stripe_treasury/src/treasury_financial_accounts_resource_outbound_transfers.rs b/generated/stripe_treasury/src/treasury_financial_accounts_resource_outbound_transfers.rs new file mode 100644 index 000000000..c9a0abe03 --- /dev/null +++ b/generated/stripe_treasury/src/treasury_financial_accounts_resource_outbound_transfers.rs @@ -0,0 +1,8 @@ +/// OutboundTransfers contains outbound transfers features for a FinancialAccount. +#[derive(Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct TreasuryFinancialAccountsResourceOutboundTransfers { + #[serde(skip_serializing_if = "Option::is_none")] + pub ach: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub us_domestic_wire: Option, +} diff --git a/generated/stripe_treasury/src/treasury_financial_accounts_resource_platform_restrictions.rs b/generated/stripe_treasury/src/treasury_financial_accounts_resource_platform_restrictions.rs new file mode 100644 index 000000000..469e247d9 --- /dev/null +++ b/generated/stripe_treasury/src/treasury_financial_accounts_resource_platform_restrictions.rs @@ -0,0 +1,118 @@ +/// Restrictions that a Connect Platform has placed on this FinancialAccount. +#[derive(Copy, Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct TreasuryFinancialAccountsResourcePlatformRestrictions { + /// Restricts all inbound money movement. + pub inbound_flows: Option, + /// Restricts all outbound money movement. + pub outbound_flows: Option, +} +/// Restricts all inbound money movement. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum TreasuryFinancialAccountsResourcePlatformRestrictionsInboundFlows { + Restricted, + Unrestricted, +} +impl TreasuryFinancialAccountsResourcePlatformRestrictionsInboundFlows { + pub fn as_str(self) -> &'static str { + use TreasuryFinancialAccountsResourcePlatformRestrictionsInboundFlows::*; + match self { + Restricted => "restricted", + Unrestricted => "unrestricted", + } + } +} + +impl std::str::FromStr for TreasuryFinancialAccountsResourcePlatformRestrictionsInboundFlows { + type Err = (); + fn from_str(s: &str) -> Result { + use TreasuryFinancialAccountsResourcePlatformRestrictionsInboundFlows::*; + match s { + "restricted" => Ok(Restricted), + "unrestricted" => Ok(Unrestricted), + _ => Err(()), + } + } +} +impl std::fmt::Display for TreasuryFinancialAccountsResourcePlatformRestrictionsInboundFlows { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for TreasuryFinancialAccountsResourcePlatformRestrictionsInboundFlows { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for TreasuryFinancialAccountsResourcePlatformRestrictionsInboundFlows { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> + for TreasuryFinancialAccountsResourcePlatformRestrictionsInboundFlows +{ + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for TreasuryFinancialAccountsResourcePlatformRestrictionsInboundFlows")) + } +} +/// Restricts all outbound money movement. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum TreasuryFinancialAccountsResourcePlatformRestrictionsOutboundFlows { + Restricted, + Unrestricted, +} +impl TreasuryFinancialAccountsResourcePlatformRestrictionsOutboundFlows { + pub fn as_str(self) -> &'static str { + use TreasuryFinancialAccountsResourcePlatformRestrictionsOutboundFlows::*; + match self { + Restricted => "restricted", + Unrestricted => "unrestricted", + } + } +} + +impl std::str::FromStr for TreasuryFinancialAccountsResourcePlatformRestrictionsOutboundFlows { + type Err = (); + fn from_str(s: &str) -> Result { + use TreasuryFinancialAccountsResourcePlatformRestrictionsOutboundFlows::*; + match s { + "restricted" => Ok(Restricted), + "unrestricted" => Ok(Unrestricted), + _ => Err(()), + } + } +} +impl std::fmt::Display for TreasuryFinancialAccountsResourcePlatformRestrictionsOutboundFlows { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for TreasuryFinancialAccountsResourcePlatformRestrictionsOutboundFlows { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for TreasuryFinancialAccountsResourcePlatformRestrictionsOutboundFlows { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> + for TreasuryFinancialAccountsResourcePlatformRestrictionsOutboundFlows +{ + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for TreasuryFinancialAccountsResourcePlatformRestrictionsOutboundFlows")) + } +} diff --git a/generated/stripe_treasury/src/treasury_financial_accounts_resource_status_details.rs b/generated/stripe_treasury/src/treasury_financial_accounts_resource_status_details.rs new file mode 100644 index 000000000..9af0ca396 --- /dev/null +++ b/generated/stripe_treasury/src/treasury_financial_accounts_resource_status_details.rs @@ -0,0 +1,5 @@ +#[derive(Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct TreasuryFinancialAccountsResourceStatusDetails { + /// Details related to the closure of this FinancialAccount + pub closed: Option, +} diff --git a/generated/stripe_treasury/src/treasury_financial_accounts_resource_toggle_settings.rs b/generated/stripe_treasury/src/treasury_financial_accounts_resource_toggle_settings.rs new file mode 100644 index 000000000..c36be9c5d --- /dev/null +++ b/generated/stripe_treasury/src/treasury_financial_accounts_resource_toggle_settings.rs @@ -0,0 +1,71 @@ +/// Toggle settings for enabling/disabling a feature +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct TreasuryFinancialAccountsResourceToggleSettings { + /// Whether the FinancialAccount should have the Feature. + pub requested: bool, + /// Whether the Feature is operational. + pub status: TreasuryFinancialAccountsResourceToggleSettingsStatus, + /// Additional details; includes at least one entry when the status is not `active`. + pub status_details: + Vec, +} +/// Whether the Feature is operational. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum TreasuryFinancialAccountsResourceToggleSettingsStatus { + Active, + Pending, + Restricted, +} +impl TreasuryFinancialAccountsResourceToggleSettingsStatus { + pub fn as_str(self) -> &'static str { + use TreasuryFinancialAccountsResourceToggleSettingsStatus::*; + match self { + Active => "active", + Pending => "pending", + Restricted => "restricted", + } + } +} + +impl std::str::FromStr for TreasuryFinancialAccountsResourceToggleSettingsStatus { + type Err = (); + fn from_str(s: &str) -> Result { + use TreasuryFinancialAccountsResourceToggleSettingsStatus::*; + match s { + "active" => Ok(Active), + "pending" => Ok(Pending), + "restricted" => Ok(Restricted), + _ => Err(()), + } + } +} +impl std::fmt::Display for TreasuryFinancialAccountsResourceToggleSettingsStatus { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for TreasuryFinancialAccountsResourceToggleSettingsStatus { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for TreasuryFinancialAccountsResourceToggleSettingsStatus { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for TreasuryFinancialAccountsResourceToggleSettingsStatus { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| { + serde::de::Error::custom( + "Unknown value for TreasuryFinancialAccountsResourceToggleSettingsStatus", + ) + }) + } +} diff --git a/generated/stripe_treasury/src/treasury_financial_accounts_resource_toggles_setting_status_details.rs b/generated/stripe_treasury/src/treasury_financial_accounts_resource_toggles_setting_status_details.rs new file mode 100644 index 000000000..a9730ced8 --- /dev/null +++ b/generated/stripe_treasury/src/treasury_financial_accounts_resource_toggles_setting_status_details.rs @@ -0,0 +1,201 @@ +/// Additional details on the FinancialAccount Features information. +#[derive(Copy, Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct TreasuryFinancialAccountsResourceTogglesSettingStatusDetails { + /// Represents the reason why the status is `pending` or `restricted`. + pub code: TreasuryFinancialAccountsResourceTogglesSettingStatusDetailsCode, + /// Represents what the user should do, if anything, to activate the Feature. + pub resolution: Option, + /// The `platform_restrictions` that are restricting this Feature. + #[serde(skip_serializing_if = "Option::is_none")] + pub restriction: + Option, +} +/// Represents the reason why the status is `pending` or `restricted`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum TreasuryFinancialAccountsResourceTogglesSettingStatusDetailsCode { + Activating, + CapabilityNotRequested, + FinancialAccountClosed, + RejectedOther, + RejectedUnsupportedBusiness, + RequirementsPastDue, + RequirementsPendingVerification, + RestrictedByPlatform, + RestrictedOther, +} +impl TreasuryFinancialAccountsResourceTogglesSettingStatusDetailsCode { + pub fn as_str(self) -> &'static str { + use TreasuryFinancialAccountsResourceTogglesSettingStatusDetailsCode::*; + match self { + Activating => "activating", + CapabilityNotRequested => "capability_not_requested", + FinancialAccountClosed => "financial_account_closed", + RejectedOther => "rejected_other", + RejectedUnsupportedBusiness => "rejected_unsupported_business", + RequirementsPastDue => "requirements_past_due", + RequirementsPendingVerification => "requirements_pending_verification", + RestrictedByPlatform => "restricted_by_platform", + RestrictedOther => "restricted_other", + } + } +} + +impl std::str::FromStr for TreasuryFinancialAccountsResourceTogglesSettingStatusDetailsCode { + type Err = (); + fn from_str(s: &str) -> Result { + use TreasuryFinancialAccountsResourceTogglesSettingStatusDetailsCode::*; + match s { + "activating" => Ok(Activating), + "capability_not_requested" => Ok(CapabilityNotRequested), + "financial_account_closed" => Ok(FinancialAccountClosed), + "rejected_other" => Ok(RejectedOther), + "rejected_unsupported_business" => Ok(RejectedUnsupportedBusiness), + "requirements_past_due" => Ok(RequirementsPastDue), + "requirements_pending_verification" => Ok(RequirementsPendingVerification), + "restricted_by_platform" => Ok(RestrictedByPlatform), + "restricted_other" => Ok(RestrictedOther), + _ => Err(()), + } + } +} +impl std::fmt::Display for TreasuryFinancialAccountsResourceTogglesSettingStatusDetailsCode { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for TreasuryFinancialAccountsResourceTogglesSettingStatusDetailsCode { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for TreasuryFinancialAccountsResourceTogglesSettingStatusDetailsCode { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> + for TreasuryFinancialAccountsResourceTogglesSettingStatusDetailsCode +{ + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for TreasuryFinancialAccountsResourceTogglesSettingStatusDetailsCode")) + } +} +/// Represents what the user should do, if anything, to activate the Feature. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum TreasuryFinancialAccountsResourceTogglesSettingStatusDetailsResolution { + ContactStripe, + ProvideInformation, + RemoveRestriction, +} +impl TreasuryFinancialAccountsResourceTogglesSettingStatusDetailsResolution { + pub fn as_str(self) -> &'static str { + use TreasuryFinancialAccountsResourceTogglesSettingStatusDetailsResolution::*; + match self { + ContactStripe => "contact_stripe", + ProvideInformation => "provide_information", + RemoveRestriction => "remove_restriction", + } + } +} + +impl std::str::FromStr for TreasuryFinancialAccountsResourceTogglesSettingStatusDetailsResolution { + type Err = (); + fn from_str(s: &str) -> Result { + use TreasuryFinancialAccountsResourceTogglesSettingStatusDetailsResolution::*; + match s { + "contact_stripe" => Ok(ContactStripe), + "provide_information" => Ok(ProvideInformation), + "remove_restriction" => Ok(RemoveRestriction), + _ => Err(()), + } + } +} +impl std::fmt::Display for TreasuryFinancialAccountsResourceTogglesSettingStatusDetailsResolution { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for TreasuryFinancialAccountsResourceTogglesSettingStatusDetailsResolution { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for TreasuryFinancialAccountsResourceTogglesSettingStatusDetailsResolution { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> + for TreasuryFinancialAccountsResourceTogglesSettingStatusDetailsResolution +{ + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for TreasuryFinancialAccountsResourceTogglesSettingStatusDetailsResolution")) + } +} +/// The `platform_restrictions` that are restricting this Feature. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum TreasuryFinancialAccountsResourceTogglesSettingStatusDetailsRestriction { + InboundFlows, + OutboundFlows, +} +impl TreasuryFinancialAccountsResourceTogglesSettingStatusDetailsRestriction { + pub fn as_str(self) -> &'static str { + use TreasuryFinancialAccountsResourceTogglesSettingStatusDetailsRestriction::*; + match self { + InboundFlows => "inbound_flows", + OutboundFlows => "outbound_flows", + } + } +} + +impl std::str::FromStr for TreasuryFinancialAccountsResourceTogglesSettingStatusDetailsRestriction { + type Err = (); + fn from_str(s: &str) -> Result { + use TreasuryFinancialAccountsResourceTogglesSettingStatusDetailsRestriction::*; + match s { + "inbound_flows" => Ok(InboundFlows), + "outbound_flows" => Ok(OutboundFlows), + _ => Err(()), + } + } +} +impl std::fmt::Display for TreasuryFinancialAccountsResourceTogglesSettingStatusDetailsRestriction { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for TreasuryFinancialAccountsResourceTogglesSettingStatusDetailsRestriction { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for TreasuryFinancialAccountsResourceTogglesSettingStatusDetailsRestriction { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> + for TreasuryFinancialAccountsResourceTogglesSettingStatusDetailsRestriction +{ + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for TreasuryFinancialAccountsResourceTogglesSettingStatusDetailsRestriction")) + } +} diff --git a/generated/stripe_treasury/src/treasury_inbound_transfer/mod.rs b/generated/stripe_treasury/src/treasury_inbound_transfer/mod.rs new file mode 100644 index 000000000..d3eb86426 --- /dev/null +++ b/generated/stripe_treasury/src/treasury_inbound_transfer/mod.rs @@ -0,0 +1,5 @@ +#[cfg(feature = "treasury_inbound_transfer")] +mod requests; +pub(crate) mod types; +#[cfg(feature = "treasury_inbound_transfer")] +pub use requests::*; diff --git a/generated/stripe_treasury/src/treasury_inbound_transfer/requests.rs b/generated/stripe_treasury/src/treasury_inbound_transfer/requests.rs new file mode 100644 index 000000000..827f865be --- /dev/null +++ b/generated/stripe_treasury/src/treasury_inbound_transfer/requests.rs @@ -0,0 +1,328 @@ +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct ListTreasuryInboundTransfer<'a> { + /// A cursor for use in pagination. + /// `ending_before` is an object ID that defines your place in the list. + /// For instance, if you make a list request and receive 100 objects, starting with `obj_bar`, your subsequent call can include `ending_before=obj_bar` in order to fetch the previous page of the list. + #[serde(skip_serializing_if = "Option::is_none")] + pub ending_before: Option<&'a str>, + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, + /// Returns objects associated with this FinancialAccount. + pub financial_account: &'a str, + /// A limit on the number of objects to be returned. + /// Limit can range between 1 and 100, and the default is 10. + #[serde(skip_serializing_if = "Option::is_none")] + pub limit: Option, + /// A cursor for use in pagination. + /// `starting_after` is an object ID that defines your place in the list. + /// For instance, if you make a list request and receive 100 objects, ending with `obj_foo`, your subsequent call can include `starting_after=obj_foo` in order to fetch the next page of the list. + #[serde(skip_serializing_if = "Option::is_none")] + pub starting_after: Option<&'a str>, + /// Only return InboundTransfers that have the given status: `processing`, `succeeded`, `failed` or `canceled`. + #[serde(skip_serializing_if = "Option::is_none")] + pub status: Option, +} +impl<'a> ListTreasuryInboundTransfer<'a> { + pub fn new(financial_account: &'a str) -> Self { + Self { + ending_before: None, + expand: None, + financial_account, + limit: None, + starting_after: None, + status: None, + } + } +} +impl<'a> ListTreasuryInboundTransfer<'a> { + /// Returns a list of InboundTransfers sent from the specified FinancialAccount. + pub fn send( + &self, + client: &stripe::Client, + ) -> stripe::Response> { + client.get_query("/treasury/inbound_transfers", self) + } + pub fn paginate( + self, + ) -> stripe::ListPaginator> { + stripe::ListPaginator::from_list_params("/treasury/inbound_transfers", self) + } +} +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct RetrieveTreasuryInboundTransfer<'a> { + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, +} +impl<'a> RetrieveTreasuryInboundTransfer<'a> { + pub fn new() -> Self { + Self::default() + } +} +impl<'a> RetrieveTreasuryInboundTransfer<'a> { + /// Retrieves the details of an existing InboundTransfer. + pub fn send( + &self, + client: &stripe::Client, + id: &stripe_treasury::TreasuryInboundTransferId, + ) -> stripe::Response { + client.get_query(&format!("/treasury/inbound_transfers/{id}"), self) + } +} +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct FailTreasuryInboundTransfer<'a> { + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, + /// Details about a failed InboundTransfer. + #[serde(skip_serializing_if = "Option::is_none")] + pub failure_details: Option, +} +impl<'a> FailTreasuryInboundTransfer<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// Details about a failed InboundTransfer. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct FailTreasuryInboundTransferFailureDetails { + /// Reason for the failure. + #[serde(skip_serializing_if = "Option::is_none")] + pub code: Option, +} +impl FailTreasuryInboundTransferFailureDetails { + pub fn new() -> Self { + Self::default() + } +} +/// Reason for the failure. +#[derive(Copy, Clone, Eq, PartialEq)] +#[non_exhaustive] +pub enum FailTreasuryInboundTransferFailureDetailsCode { + AccountClosed, + AccountFrozen, + BankAccountRestricted, + BankOwnershipChanged, + DebitNotAuthorized, + IncorrectAccountHolderAddress, + IncorrectAccountHolderName, + IncorrectAccountHolderTaxId, + InsufficientFunds, + InvalidAccountNumber, + InvalidCurrency, + NoAccount, + Other, + /// An unrecognized value from Stripe. Should not be used as a request parameter. + Unknown, +} +impl FailTreasuryInboundTransferFailureDetailsCode { + pub fn as_str(self) -> &'static str { + use FailTreasuryInboundTransferFailureDetailsCode::*; + match self { + AccountClosed => "account_closed", + AccountFrozen => "account_frozen", + BankAccountRestricted => "bank_account_restricted", + BankOwnershipChanged => "bank_ownership_changed", + DebitNotAuthorized => "debit_not_authorized", + IncorrectAccountHolderAddress => "incorrect_account_holder_address", + IncorrectAccountHolderName => "incorrect_account_holder_name", + IncorrectAccountHolderTaxId => "incorrect_account_holder_tax_id", + InsufficientFunds => "insufficient_funds", + InvalidAccountNumber => "invalid_account_number", + InvalidCurrency => "invalid_currency", + NoAccount => "no_account", + Other => "other", + Unknown => "unknown", + } + } +} + +impl std::str::FromStr for FailTreasuryInboundTransferFailureDetailsCode { + type Err = (); + fn from_str(s: &str) -> Result { + use FailTreasuryInboundTransferFailureDetailsCode::*; + match s { + "account_closed" => Ok(AccountClosed), + "account_frozen" => Ok(AccountFrozen), + "bank_account_restricted" => Ok(BankAccountRestricted), + "bank_ownership_changed" => Ok(BankOwnershipChanged), + "debit_not_authorized" => Ok(DebitNotAuthorized), + "incorrect_account_holder_address" => Ok(IncorrectAccountHolderAddress), + "incorrect_account_holder_name" => Ok(IncorrectAccountHolderName), + "incorrect_account_holder_tax_id" => Ok(IncorrectAccountHolderTaxId), + "insufficient_funds" => Ok(InsufficientFunds), + "invalid_account_number" => Ok(InvalidAccountNumber), + "invalid_currency" => Ok(InvalidCurrency), + "no_account" => Ok(NoAccount), + "other" => Ok(Other), + _ => Err(()), + } + } +} +impl std::fmt::Display for FailTreasuryInboundTransferFailureDetailsCode { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for FailTreasuryInboundTransferFailureDetailsCode { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for FailTreasuryInboundTransferFailureDetailsCode { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'a> FailTreasuryInboundTransfer<'a> { + /// Transitions a test mode created InboundTransfer to the `failed` status. + /// The InboundTransfer must already be in the `processing` state. + pub fn send( + &self, + client: &stripe::Client, + id: &str, + ) -> stripe::Response { + client.send_form( + &format!("/test_helpers/treasury/inbound_transfers/{id}/fail"), + self, + http_types::Method::Post, + ) + } +} +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct ReturnInboundTransferTreasuryInboundTransfer<'a> { + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, +} +impl<'a> ReturnInboundTransferTreasuryInboundTransfer<'a> { + pub fn new() -> Self { + Self::default() + } +} +impl<'a> ReturnInboundTransferTreasuryInboundTransfer<'a> { + /// Marks the test mode InboundTransfer object as returned and links the InboundTransfer to a ReceivedDebit. + /// The InboundTransfer must already be in the `succeeded` state. + pub fn send( + &self, + client: &stripe::Client, + id: &str, + ) -> stripe::Response { + client.send_form( + &format!("/test_helpers/treasury/inbound_transfers/{id}/return"), + self, + http_types::Method::Post, + ) + } +} +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct SucceedTreasuryInboundTransfer<'a> { + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, +} +impl<'a> SucceedTreasuryInboundTransfer<'a> { + pub fn new() -> Self { + Self::default() + } +} +impl<'a> SucceedTreasuryInboundTransfer<'a> { + /// Transitions a test mode created InboundTransfer to the `succeeded` status. + /// The InboundTransfer must already be in the `processing` state. + pub fn send( + &self, + client: &stripe::Client, + id: &str, + ) -> stripe::Response { + client.send_form( + &format!("/test_helpers/treasury/inbound_transfers/{id}/succeed"), + self, + http_types::Method::Post, + ) + } +} +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreateTreasuryInboundTransfer<'a> { + /// Amount (in cents) to be transferred. + pub amount: i64, + /// Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. + /// Must be a [supported currency](https://stripe.com/docs/currencies). + pub currency: stripe_types::Currency, + /// An arbitrary string attached to the object. Often useful for displaying to users. + #[serde(skip_serializing_if = "Option::is_none")] + pub description: Option<&'a str>, + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, + /// The FinancialAccount to send funds to. + pub financial_account: &'a str, + /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. + /// This can be useful for storing additional information about the object in a structured format. + /// Individual keys can be unset by posting an empty value to them. + /// All keys can be unset by posting an empty value to `metadata`. + #[serde(skip_serializing_if = "Option::is_none")] + pub metadata: Option<&'a std::collections::HashMap>, + /// The origin payment method to be debited for the InboundTransfer. + pub origin_payment_method: &'a str, + /// The complete description that appears on your customers' statements. Maximum 10 characters. + #[serde(skip_serializing_if = "Option::is_none")] + pub statement_descriptor: Option<&'a str>, +} +impl<'a> CreateTreasuryInboundTransfer<'a> { + pub fn new( + amount: i64, + currency: stripe_types::Currency, + financial_account: &'a str, + origin_payment_method: &'a str, + ) -> Self { + Self { + amount, + currency, + description: None, + expand: None, + financial_account, + metadata: None, + origin_payment_method, + statement_descriptor: None, + } + } +} +impl<'a> CreateTreasuryInboundTransfer<'a> { + /// Creates an InboundTransfer. + pub fn send( + &self, + client: &stripe::Client, + ) -> stripe::Response { + client.send_form("/treasury/inbound_transfers", self, http_types::Method::Post) + } +} +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CancelTreasuryInboundTransfer<'a> { + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, +} +impl<'a> CancelTreasuryInboundTransfer<'a> { + pub fn new() -> Self { + Self::default() + } +} +impl<'a> CancelTreasuryInboundTransfer<'a> { + /// Cancels an InboundTransfer. + pub fn send( + &self, + client: &stripe::Client, + inbound_transfer: &stripe_treasury::TreasuryInboundTransferId, + ) -> stripe::Response { + client.send_form( + &format!("/treasury/inbound_transfers/{inbound_transfer}/cancel"), + self, + http_types::Method::Post, + ) + } +} diff --git a/generated/stripe_treasury/src/treasury_inbound_transfer/types.rs b/generated/stripe_treasury/src/treasury_inbound_transfer/types.rs new file mode 100644 index 000000000..81965670f --- /dev/null +++ b/generated/stripe_treasury/src/treasury_inbound_transfer/types.rs @@ -0,0 +1,116 @@ +/// Use [InboundTransfers](https://stripe.com/docs/treasury/moving-money/financial-accounts/into/inbound-transfers) to add funds to your [FinancialAccount](https://stripe.com/docs/api#financial_accounts) via a PaymentMethod that is owned by you. +/// The funds will be transferred via an ACH debit. +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct TreasuryInboundTransfer { + /// Amount (in cents) transferred. + pub amount: i64, + /// Returns `true` if the InboundTransfer is able to be canceled. + pub cancelable: bool, + /// Time at which the object was created. Measured in seconds since the Unix epoch. + pub created: stripe_types::Timestamp, + /// Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. + /// Must be a [supported currency](https://stripe.com/docs/currencies). + pub currency: stripe_types::Currency, + /// An arbitrary string attached to the object. Often useful for displaying to users. + pub description: Option, + /// Details about this InboundTransfer's failure. Only set when status is `failed`. + pub failure_details: Option, + /// The FinancialAccount that received the funds. + pub financial_account: String, + /// A [hosted transaction receipt](https://stripe.com/docs/treasury/moving-money/regulatory-receipts) URL that is provided when money movement is considered regulated under Stripe's money transmission licenses. + pub hosted_regulatory_receipt_url: Option, + /// Unique identifier for the object. + pub id: stripe_treasury::TreasuryInboundTransferId, + pub linked_flows: + stripe_treasury::TreasuryInboundTransfersResourceInboundTransferResourceLinkedFlows, + /// Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + pub livemode: bool, + /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. + /// This can be useful for storing additional information about the object in a structured format. + pub metadata: std::collections::HashMap, + /// The origin payment method to be debited for an InboundTransfer. + pub origin_payment_method: String, + /// Details about the PaymentMethod for an InboundTransfer. + pub origin_payment_method_details: Option, + /// Returns `true` if the funds for an InboundTransfer were returned after the InboundTransfer went to the `succeeded` state. + pub returned: Option, + /// Statement descriptor shown when funds are debited from the source. + /// Not all payment networks support `statement_descriptor`. + pub statement_descriptor: String, + /// Status of the InboundTransfer: `processing`, `succeeded`, `failed`, and `canceled`. + /// An InboundTransfer is `processing` if it is created and pending. + /// The status changes to `succeeded` once the funds have been "confirmed" and a `transaction` is created and posted. + /// The status changes to `failed` if the transfer fails. + pub status: stripe_treasury::TreasuryInboundTransferStatus, + pub status_transitions: + stripe_treasury::TreasuryInboundTransfersResourceInboundTransferResourceStatusTransitions, + /// The Transaction associated with this object. + pub transaction: Option>, +} +impl stripe_types::Object for TreasuryInboundTransfer { + type Id = stripe_treasury::TreasuryInboundTransferId; + fn id(&self) -> &Self::Id { + &self.id + } +} +stripe_types::def_id!(TreasuryInboundTransferId); +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum TreasuryInboundTransferStatus { + Canceled, + Failed, + Processing, + Succeeded, +} +impl TreasuryInboundTransferStatus { + pub fn as_str(self) -> &'static str { + use TreasuryInboundTransferStatus::*; + match self { + Canceled => "canceled", + Failed => "failed", + Processing => "processing", + Succeeded => "succeeded", + } + } +} + +impl std::str::FromStr for TreasuryInboundTransferStatus { + type Err = (); + fn from_str(s: &str) -> Result { + use TreasuryInboundTransferStatus::*; + match s { + "canceled" => Ok(Canceled), + "failed" => Ok(Failed), + "processing" => Ok(Processing), + "succeeded" => Ok(Succeeded), + _ => Err(()), + } + } +} +impl std::fmt::Display for TreasuryInboundTransferStatus { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for TreasuryInboundTransferStatus { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for TreasuryInboundTransferStatus { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for TreasuryInboundTransferStatus { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| { + serde::de::Error::custom("Unknown value for TreasuryInboundTransferStatus") + }) + } +} diff --git a/generated/stripe_treasury/src/treasury_inbound_transfers_resource_failure_details.rs b/generated/stripe_treasury/src/treasury_inbound_transfers_resource_failure_details.rs new file mode 100644 index 000000000..8bd02e372 --- /dev/null +++ b/generated/stripe_treasury/src/treasury_inbound_transfers_resource_failure_details.rs @@ -0,0 +1,96 @@ +#[derive(Copy, Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct TreasuryInboundTransfersResourceFailureDetails { + /// Reason for the failure. + pub code: TreasuryInboundTransfersResourceFailureDetailsCode, +} +/// Reason for the failure. +#[derive(Copy, Clone, Eq, PartialEq)] +#[non_exhaustive] +pub enum TreasuryInboundTransfersResourceFailureDetailsCode { + AccountClosed, + AccountFrozen, + BankAccountRestricted, + BankOwnershipChanged, + DebitNotAuthorized, + IncorrectAccountHolderAddress, + IncorrectAccountHolderName, + IncorrectAccountHolderTaxId, + InsufficientFunds, + InvalidAccountNumber, + InvalidCurrency, + NoAccount, + Other, + /// An unrecognized value from Stripe. Should not be used as a request parameter. + Unknown, +} +impl TreasuryInboundTransfersResourceFailureDetailsCode { + pub fn as_str(self) -> &'static str { + use TreasuryInboundTransfersResourceFailureDetailsCode::*; + match self { + AccountClosed => "account_closed", + AccountFrozen => "account_frozen", + BankAccountRestricted => "bank_account_restricted", + BankOwnershipChanged => "bank_ownership_changed", + DebitNotAuthorized => "debit_not_authorized", + IncorrectAccountHolderAddress => "incorrect_account_holder_address", + IncorrectAccountHolderName => "incorrect_account_holder_name", + IncorrectAccountHolderTaxId => "incorrect_account_holder_tax_id", + InsufficientFunds => "insufficient_funds", + InvalidAccountNumber => "invalid_account_number", + InvalidCurrency => "invalid_currency", + NoAccount => "no_account", + Other => "other", + Unknown => "unknown", + } + } +} + +impl std::str::FromStr for TreasuryInboundTransfersResourceFailureDetailsCode { + type Err = (); + fn from_str(s: &str) -> Result { + use TreasuryInboundTransfersResourceFailureDetailsCode::*; + match s { + "account_closed" => Ok(AccountClosed), + "account_frozen" => Ok(AccountFrozen), + "bank_account_restricted" => Ok(BankAccountRestricted), + "bank_ownership_changed" => Ok(BankOwnershipChanged), + "debit_not_authorized" => Ok(DebitNotAuthorized), + "incorrect_account_holder_address" => Ok(IncorrectAccountHolderAddress), + "incorrect_account_holder_name" => Ok(IncorrectAccountHolderName), + "incorrect_account_holder_tax_id" => Ok(IncorrectAccountHolderTaxId), + "insufficient_funds" => Ok(InsufficientFunds), + "invalid_account_number" => Ok(InvalidAccountNumber), + "invalid_currency" => Ok(InvalidCurrency), + "no_account" => Ok(NoAccount), + "other" => Ok(Other), + _ => Err(()), + } + } +} +impl std::fmt::Display for TreasuryInboundTransfersResourceFailureDetailsCode { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for TreasuryInboundTransfersResourceFailureDetailsCode { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for TreasuryInboundTransfersResourceFailureDetailsCode { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for TreasuryInboundTransfersResourceFailureDetailsCode { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Ok(Self::from_str(&s) + .unwrap_or(TreasuryInboundTransfersResourceFailureDetailsCode::Unknown)) + } +} diff --git a/generated/stripe_treasury/src/treasury_inbound_transfers_resource_inbound_transfer_resource_linked_flows.rs b/generated/stripe_treasury/src/treasury_inbound_transfers_resource_inbound_transfer_resource_linked_flows.rs new file mode 100644 index 000000000..cb81ee4fa --- /dev/null +++ b/generated/stripe_treasury/src/treasury_inbound_transfers_resource_inbound_transfer_resource_linked_flows.rs @@ -0,0 +1,5 @@ +#[derive(Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct TreasuryInboundTransfersResourceInboundTransferResourceLinkedFlows { + /// If funds for this flow were returned after the flow went to the `succeeded` state, this field contains a reference to the ReceivedDebit return. + pub received_debit: Option, +} diff --git a/generated/stripe_treasury/src/treasury_inbound_transfers_resource_inbound_transfer_resource_status_transitions.rs b/generated/stripe_treasury/src/treasury_inbound_transfers_resource_inbound_transfer_resource_status_transitions.rs new file mode 100644 index 000000000..2f044fd44 --- /dev/null +++ b/generated/stripe_treasury/src/treasury_inbound_transfers_resource_inbound_transfer_resource_status_transitions.rs @@ -0,0 +1,10 @@ +#[derive(Copy, Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct TreasuryInboundTransfersResourceInboundTransferResourceStatusTransitions { + /// Timestamp describing when an InboundTransfer changed status to `canceled`. + #[serde(skip_serializing_if = "Option::is_none")] + pub canceled_at: Option, + /// Timestamp describing when an InboundTransfer changed status to `failed`. + pub failed_at: Option, + /// Timestamp describing when an InboundTransfer changed status to `succeeded`. + pub succeeded_at: Option, +} diff --git a/generated/stripe_treasury/src/treasury_outbound_payment/mod.rs b/generated/stripe_treasury/src/treasury_outbound_payment/mod.rs new file mode 100644 index 000000000..4d5d90416 --- /dev/null +++ b/generated/stripe_treasury/src/treasury_outbound_payment/mod.rs @@ -0,0 +1,5 @@ +#[cfg(feature = "treasury_outbound_payment")] +mod requests; +pub(crate) mod types; +#[cfg(feature = "treasury_outbound_payment")] +pub use requests::*; diff --git a/generated/stripe_treasury/src/treasury_outbound_payment/requests.rs b/generated/stripe_treasury/src/treasury_outbound_payment/requests.rs new file mode 100644 index 000000000..f189e6490 --- /dev/null +++ b/generated/stripe_treasury/src/treasury_outbound_payment/requests.rs @@ -0,0 +1,706 @@ +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct ListTreasuryOutboundPayment<'a> { + /// Only return OutboundPayments sent to this customer. + #[serde(skip_serializing_if = "Option::is_none")] + pub customer: Option<&'a str>, + /// A cursor for use in pagination. + /// `ending_before` is an object ID that defines your place in the list. + /// For instance, if you make a list request and receive 100 objects, starting with `obj_bar`, your subsequent call can include `ending_before=obj_bar` in order to fetch the previous page of the list. + #[serde(skip_serializing_if = "Option::is_none")] + pub ending_before: Option<&'a str>, + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, + /// Returns objects associated with this FinancialAccount. + pub financial_account: &'a str, + /// A limit on the number of objects to be returned. + /// Limit can range between 1 and 100, and the default is 10. + #[serde(skip_serializing_if = "Option::is_none")] + pub limit: Option, + /// A cursor for use in pagination. + /// `starting_after` is an object ID that defines your place in the list. + /// For instance, if you make a list request and receive 100 objects, ending with `obj_foo`, your subsequent call can include `starting_after=obj_foo` in order to fetch the next page of the list. + #[serde(skip_serializing_if = "Option::is_none")] + pub starting_after: Option<&'a str>, + /// Only return OutboundPayments that have the given status: `processing`, `failed`, `posted`, `returned`, or `canceled`. + #[serde(skip_serializing_if = "Option::is_none")] + pub status: Option, +} +impl<'a> ListTreasuryOutboundPayment<'a> { + pub fn new(financial_account: &'a str) -> Self { + Self { + customer: None, + ending_before: None, + expand: None, + financial_account, + limit: None, + starting_after: None, + status: None, + } + } +} +impl<'a> ListTreasuryOutboundPayment<'a> { + /// Returns a list of OutboundPayments sent from the specified FinancialAccount. + pub fn send( + &self, + client: &stripe::Client, + ) -> stripe::Response> { + client.get_query("/treasury/outbound_payments", self) + } + pub fn paginate( + self, + ) -> stripe::ListPaginator> { + stripe::ListPaginator::from_list_params("/treasury/outbound_payments", self) + } +} +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct RetrieveTreasuryOutboundPayment<'a> { + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, +} +impl<'a> RetrieveTreasuryOutboundPayment<'a> { + pub fn new() -> Self { + Self::default() + } +} +impl<'a> RetrieveTreasuryOutboundPayment<'a> { + /// Retrieves the details of an existing OutboundPayment by passing the unique OutboundPayment ID from either the OutboundPayment creation request or OutboundPayment list. + pub fn send( + &self, + client: &stripe::Client, + id: &stripe_treasury::TreasuryOutboundPaymentId, + ) -> stripe::Response { + client.get_query(&format!("/treasury/outbound_payments/{id}"), self) + } +} +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct FailTreasuryOutboundPayment<'a> { + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, +} +impl<'a> FailTreasuryOutboundPayment<'a> { + pub fn new() -> Self { + Self::default() + } +} +impl<'a> FailTreasuryOutboundPayment<'a> { + /// Transitions a test mode created OutboundPayment to the `failed` status. + /// The OutboundPayment must already be in the `processing` state. + pub fn send( + &self, + client: &stripe::Client, + id: &str, + ) -> stripe::Response { + client.send_form( + &format!("/test_helpers/treasury/outbound_payments/{id}/fail"), + self, + http_types::Method::Post, + ) + } +} +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct PostTreasuryOutboundPayment<'a> { + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, +} +impl<'a> PostTreasuryOutboundPayment<'a> { + pub fn new() -> Self { + Self::default() + } +} +impl<'a> PostTreasuryOutboundPayment<'a> { + /// Transitions a test mode created OutboundPayment to the `posted` status. + /// The OutboundPayment must already be in the `processing` state. + pub fn send( + &self, + client: &stripe::Client, + id: &str, + ) -> stripe::Response { + client.send_form( + &format!("/test_helpers/treasury/outbound_payments/{id}/post"), + self, + http_types::Method::Post, + ) + } +} +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct ReturnOutboundPaymentTreasuryOutboundPayment<'a> { + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, + /// Optional hash to set the the return code. + #[serde(skip_serializing_if = "Option::is_none")] + pub returned_details: Option, +} +impl<'a> ReturnOutboundPaymentTreasuryOutboundPayment<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// Optional hash to set the the return code. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct ReturnOutboundPaymentTreasuryOutboundPaymentReturnedDetails { + /// The return code to be set on the OutboundPayment object. + #[serde(skip_serializing_if = "Option::is_none")] + pub code: Option, +} +impl ReturnOutboundPaymentTreasuryOutboundPaymentReturnedDetails { + pub fn new() -> Self { + Self::default() + } +} +/// The return code to be set on the OutboundPayment object. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum ReturnOutboundPaymentTreasuryOutboundPaymentReturnedDetailsCode { + AccountClosed, + AccountFrozen, + BankAccountRestricted, + BankOwnershipChanged, + Declined, + IncorrectAccountHolderName, + InvalidAccountNumber, + InvalidCurrency, + NoAccount, + Other, +} +impl ReturnOutboundPaymentTreasuryOutboundPaymentReturnedDetailsCode { + pub fn as_str(self) -> &'static str { + use ReturnOutboundPaymentTreasuryOutboundPaymentReturnedDetailsCode::*; + match self { + AccountClosed => "account_closed", + AccountFrozen => "account_frozen", + BankAccountRestricted => "bank_account_restricted", + BankOwnershipChanged => "bank_ownership_changed", + Declined => "declined", + IncorrectAccountHolderName => "incorrect_account_holder_name", + InvalidAccountNumber => "invalid_account_number", + InvalidCurrency => "invalid_currency", + NoAccount => "no_account", + Other => "other", + } + } +} + +impl std::str::FromStr for ReturnOutboundPaymentTreasuryOutboundPaymentReturnedDetailsCode { + type Err = (); + fn from_str(s: &str) -> Result { + use ReturnOutboundPaymentTreasuryOutboundPaymentReturnedDetailsCode::*; + match s { + "account_closed" => Ok(AccountClosed), + "account_frozen" => Ok(AccountFrozen), + "bank_account_restricted" => Ok(BankAccountRestricted), + "bank_ownership_changed" => Ok(BankOwnershipChanged), + "declined" => Ok(Declined), + "incorrect_account_holder_name" => Ok(IncorrectAccountHolderName), + "invalid_account_number" => Ok(InvalidAccountNumber), + "invalid_currency" => Ok(InvalidCurrency), + "no_account" => Ok(NoAccount), + "other" => Ok(Other), + _ => Err(()), + } + } +} +impl std::fmt::Display for ReturnOutboundPaymentTreasuryOutboundPaymentReturnedDetailsCode { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for ReturnOutboundPaymentTreasuryOutboundPaymentReturnedDetailsCode { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for ReturnOutboundPaymentTreasuryOutboundPaymentReturnedDetailsCode { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'a> ReturnOutboundPaymentTreasuryOutboundPayment<'a> { + /// Transitions a test mode created OutboundPayment to the `returned` status. + /// The OutboundPayment must already be in the `processing` state. + pub fn send( + &self, + client: &stripe::Client, + id: &str, + ) -> stripe::Response { + client.send_form( + &format!("/test_helpers/treasury/outbound_payments/{id}/return"), + self, + http_types::Method::Post, + ) + } +} +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreateTreasuryOutboundPayment<'a> { + /// Amount (in cents) to be transferred. + pub amount: i64, + /// Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. + /// Must be a [supported currency](https://stripe.com/docs/currencies). + pub currency: stripe_types::Currency, + /// ID of the customer to whom the OutboundPayment is sent. + /// Must match the Customer attached to the `destination_payment_method` passed in. + #[serde(skip_serializing_if = "Option::is_none")] + pub customer: Option<&'a str>, + /// An arbitrary string attached to the object. Often useful for displaying to users. + #[serde(skip_serializing_if = "Option::is_none")] + pub description: Option<&'a str>, + /// The PaymentMethod to use as the payment instrument for the OutboundPayment. + /// Exclusive with `destination_payment_method_data`. + #[serde(skip_serializing_if = "Option::is_none")] + pub destination_payment_method: Option<&'a str>, + /// Hash used to generate the PaymentMethod to be used for this OutboundPayment. + /// Exclusive with `destination_payment_method`. + #[serde(skip_serializing_if = "Option::is_none")] + pub destination_payment_method_data: + Option>, + /// Payment method-specific configuration for this OutboundPayment. + #[serde(skip_serializing_if = "Option::is_none")] + pub destination_payment_method_options: + Option, + /// End user details. + #[serde(skip_serializing_if = "Option::is_none")] + pub end_user_details: Option>, + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, + /// The FinancialAccount to pull funds from. + pub financial_account: &'a str, + /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. + /// This can be useful for storing additional information about the object in a structured format. + /// Individual keys can be unset by posting an empty value to them. + /// All keys can be unset by posting an empty value to `metadata`. + #[serde(skip_serializing_if = "Option::is_none")] + pub metadata: Option<&'a std::collections::HashMap>, + /// The description that appears on the receiving end for this OutboundPayment (for example, bank statement for external bank transfer). + /// Maximum 10 characters for `ach` payments, 140 characters for `us_domestic_wire` payments, or 500 characters for `stripe` network transfers. + /// The default value is "payment". + #[serde(skip_serializing_if = "Option::is_none")] + pub statement_descriptor: Option<&'a str>, +} +impl<'a> CreateTreasuryOutboundPayment<'a> { + pub fn new(amount: i64, currency: stripe_types::Currency, financial_account: &'a str) -> Self { + Self { + amount, + currency, + customer: None, + description: None, + destination_payment_method: None, + destination_payment_method_data: None, + destination_payment_method_options: None, + end_user_details: None, + expand: None, + financial_account, + metadata: None, + statement_descriptor: None, + } + } +} +/// Hash used to generate the PaymentMethod to be used for this OutboundPayment. +/// Exclusive with `destination_payment_method`. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreateTreasuryOutboundPaymentDestinationPaymentMethodData<'a> { + /// Billing information associated with the PaymentMethod that may be used or required by particular types of payment methods. + #[serde(skip_serializing_if = "Option::is_none")] + pub billing_details: + Option>, + /// Required if type is set to `financial_account`. The FinancialAccount ID to send funds to. + #[serde(skip_serializing_if = "Option::is_none")] + pub financial_account: Option<&'a str>, + /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. + /// This can be useful for storing additional information about the object in a structured format. + /// Individual keys can be unset by posting an empty value to them. + /// All keys can be unset by posting an empty value to `metadata`. + #[serde(skip_serializing_if = "Option::is_none")] + pub metadata: Option<&'a std::collections::HashMap>, + /// The type of the PaymentMethod. + /// An additional hash is included on the PaymentMethod with a name matching this value. + /// It contains additional information specific to the PaymentMethod type. + #[serde(rename = "type")] + pub type_: CreateTreasuryOutboundPaymentDestinationPaymentMethodDataType, + /// Required hash if type is set to `us_bank_account`. + #[serde(skip_serializing_if = "Option::is_none")] + pub us_bank_account: + Option>, +} +impl<'a> CreateTreasuryOutboundPaymentDestinationPaymentMethodData<'a> { + pub fn new(type_: CreateTreasuryOutboundPaymentDestinationPaymentMethodDataType) -> Self { + Self { + billing_details: None, + financial_account: None, + metadata: None, + type_, + us_bank_account: None, + } + } +} +/// Billing information associated with the PaymentMethod that may be used or required by particular types of payment methods. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreateTreasuryOutboundPaymentDestinationPaymentMethodDataBillingDetails<'a> { + /// Billing address. + #[serde(skip_serializing_if = "Option::is_none")] + pub address: + Option>, + /// Email address. + #[serde(skip_serializing_if = "Option::is_none")] + pub email: Option<&'a str>, + /// Full name. + #[serde(skip_serializing_if = "Option::is_none")] + pub name: Option<&'a str>, + /// Billing phone number (including extension). + #[serde(skip_serializing_if = "Option::is_none")] + pub phone: Option<&'a str>, +} +impl<'a> CreateTreasuryOutboundPaymentDestinationPaymentMethodDataBillingDetails<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// Billing address. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreateTreasuryOutboundPaymentDestinationPaymentMethodDataBillingDetailsAddress<'a> { + /// City, district, suburb, town, or village. + #[serde(skip_serializing_if = "Option::is_none")] + pub city: Option<&'a str>, + /// Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). + #[serde(skip_serializing_if = "Option::is_none")] + pub country: Option<&'a str>, + /// Address line 1 (e.g., street, PO Box, or company name). + #[serde(skip_serializing_if = "Option::is_none")] + pub line1: Option<&'a str>, + /// Address line 2 (e.g., apartment, suite, unit, or building). + #[serde(skip_serializing_if = "Option::is_none")] + pub line2: Option<&'a str>, + /// ZIP or postal code. + #[serde(skip_serializing_if = "Option::is_none")] + pub postal_code: Option<&'a str>, + /// State, county, province, or region. + #[serde(skip_serializing_if = "Option::is_none")] + pub state: Option<&'a str>, +} +impl<'a> CreateTreasuryOutboundPaymentDestinationPaymentMethodDataBillingDetailsAddress<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// The type of the PaymentMethod. +/// An additional hash is included on the PaymentMethod with a name matching this value. +/// It contains additional information specific to the PaymentMethod type. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreateTreasuryOutboundPaymentDestinationPaymentMethodDataType { + FinancialAccount, + UsBankAccount, +} +impl CreateTreasuryOutboundPaymentDestinationPaymentMethodDataType { + pub fn as_str(self) -> &'static str { + use CreateTreasuryOutboundPaymentDestinationPaymentMethodDataType::*; + match self { + FinancialAccount => "financial_account", + UsBankAccount => "us_bank_account", + } + } +} + +impl std::str::FromStr for CreateTreasuryOutboundPaymentDestinationPaymentMethodDataType { + type Err = (); + fn from_str(s: &str) -> Result { + use CreateTreasuryOutboundPaymentDestinationPaymentMethodDataType::*; + match s { + "financial_account" => Ok(FinancialAccount), + "us_bank_account" => Ok(UsBankAccount), + _ => Err(()), + } + } +} +impl std::fmt::Display for CreateTreasuryOutboundPaymentDestinationPaymentMethodDataType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreateTreasuryOutboundPaymentDestinationPaymentMethodDataType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreateTreasuryOutboundPaymentDestinationPaymentMethodDataType { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Required hash if type is set to `us_bank_account`. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreateTreasuryOutboundPaymentDestinationPaymentMethodDataUsBankAccount<'a> { + /// Account holder type: individual or company. + #[serde(skip_serializing_if = "Option::is_none")] + pub account_holder_type: Option< + CreateTreasuryOutboundPaymentDestinationPaymentMethodDataUsBankAccountAccountHolderType, + >, + /// Account number of the bank account. + #[serde(skip_serializing_if = "Option::is_none")] + pub account_number: Option<&'a str>, + /// Account type: checkings or savings. Defaults to checking if omitted. + #[serde(skip_serializing_if = "Option::is_none")] + pub account_type: + Option, + /// The ID of a Financial Connections Account to use as a payment method. + #[serde(skip_serializing_if = "Option::is_none")] + pub financial_connections_account: Option<&'a str>, + /// Routing number of the bank account. + #[serde(skip_serializing_if = "Option::is_none")] + pub routing_number: Option<&'a str>, +} +impl<'a> CreateTreasuryOutboundPaymentDestinationPaymentMethodDataUsBankAccount<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// Account holder type: individual or company. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreateTreasuryOutboundPaymentDestinationPaymentMethodDataUsBankAccountAccountHolderType { + Company, + Individual, +} +impl CreateTreasuryOutboundPaymentDestinationPaymentMethodDataUsBankAccountAccountHolderType { + pub fn as_str(self) -> &'static str { + use CreateTreasuryOutboundPaymentDestinationPaymentMethodDataUsBankAccountAccountHolderType::*; + match self { + Company => "company", + Individual => "individual", + } + } +} + +impl std::str::FromStr + for CreateTreasuryOutboundPaymentDestinationPaymentMethodDataUsBankAccountAccountHolderType +{ + type Err = (); + fn from_str(s: &str) -> Result { + use CreateTreasuryOutboundPaymentDestinationPaymentMethodDataUsBankAccountAccountHolderType::*; + match s { + "company" => Ok(Company), + "individual" => Ok(Individual), + _ => Err(()), + } + } +} +impl std::fmt::Display + for CreateTreasuryOutboundPaymentDestinationPaymentMethodDataUsBankAccountAccountHolderType +{ + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug + for CreateTreasuryOutboundPaymentDestinationPaymentMethodDataUsBankAccountAccountHolderType +{ + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize + for CreateTreasuryOutboundPaymentDestinationPaymentMethodDataUsBankAccountAccountHolderType +{ + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Account type: checkings or savings. Defaults to checking if omitted. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreateTreasuryOutboundPaymentDestinationPaymentMethodDataUsBankAccountAccountType { + Checking, + Savings, +} +impl CreateTreasuryOutboundPaymentDestinationPaymentMethodDataUsBankAccountAccountType { + pub fn as_str(self) -> &'static str { + use CreateTreasuryOutboundPaymentDestinationPaymentMethodDataUsBankAccountAccountType::*; + match self { + Checking => "checking", + Savings => "savings", + } + } +} + +impl std::str::FromStr + for CreateTreasuryOutboundPaymentDestinationPaymentMethodDataUsBankAccountAccountType +{ + type Err = (); + fn from_str(s: &str) -> Result { + use CreateTreasuryOutboundPaymentDestinationPaymentMethodDataUsBankAccountAccountType::*; + match s { + "checking" => Ok(Checking), + "savings" => Ok(Savings), + _ => Err(()), + } + } +} +impl std::fmt::Display + for CreateTreasuryOutboundPaymentDestinationPaymentMethodDataUsBankAccountAccountType +{ + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug + for CreateTreasuryOutboundPaymentDestinationPaymentMethodDataUsBankAccountAccountType +{ + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize + for CreateTreasuryOutboundPaymentDestinationPaymentMethodDataUsBankAccountAccountType +{ + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Payment method-specific configuration for this OutboundPayment. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreateTreasuryOutboundPaymentDestinationPaymentMethodOptions { + /// Optional fields for `us_bank_account`. + #[serde(skip_serializing_if = "Option::is_none")] + pub us_bank_account: + Option, +} +impl CreateTreasuryOutboundPaymentDestinationPaymentMethodOptions { + pub fn new() -> Self { + Self::default() + } +} +/// Optional fields for `us_bank_account`. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreateTreasuryOutboundPaymentDestinationPaymentMethodOptionsUsBankAccount { + /// The US bank account network that must be used for this OutboundPayment. + /// If not set, we will default to the PaymentMethod's preferred network. + #[serde(skip_serializing_if = "Option::is_none")] + pub network: + Option, +} +impl CreateTreasuryOutboundPaymentDestinationPaymentMethodOptionsUsBankAccount { + pub fn new() -> Self { + Self::default() + } +} +/// The US bank account network that must be used for this OutboundPayment. +/// If not set, we will default to the PaymentMethod's preferred network. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreateTreasuryOutboundPaymentDestinationPaymentMethodOptionsUsBankAccountNetwork { + Ach, + UsDomesticWire, +} +impl CreateTreasuryOutboundPaymentDestinationPaymentMethodOptionsUsBankAccountNetwork { + pub fn as_str(self) -> &'static str { + use CreateTreasuryOutboundPaymentDestinationPaymentMethodOptionsUsBankAccountNetwork::*; + match self { + Ach => "ach", + UsDomesticWire => "us_domestic_wire", + } + } +} + +impl std::str::FromStr + for CreateTreasuryOutboundPaymentDestinationPaymentMethodOptionsUsBankAccountNetwork +{ + type Err = (); + fn from_str(s: &str) -> Result { + use CreateTreasuryOutboundPaymentDestinationPaymentMethodOptionsUsBankAccountNetwork::*; + match s { + "ach" => Ok(Ach), + "us_domestic_wire" => Ok(UsDomesticWire), + _ => Err(()), + } + } +} +impl std::fmt::Display + for CreateTreasuryOutboundPaymentDestinationPaymentMethodOptionsUsBankAccountNetwork +{ + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug + for CreateTreasuryOutboundPaymentDestinationPaymentMethodOptionsUsBankAccountNetwork +{ + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize + for CreateTreasuryOutboundPaymentDestinationPaymentMethodOptionsUsBankAccountNetwork +{ + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// End user details. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreateTreasuryOutboundPaymentEndUserDetails<'a> { + /// IP address of the user initiating the OutboundPayment. + /// Must be supplied if `present` is set to `true`. + #[serde(skip_serializing_if = "Option::is_none")] + pub ip_address: Option<&'a str>, + /// `True` if the OutboundPayment creation request is being made on behalf of an end user by a platform. + /// Otherwise, `false`. + pub present: bool, +} +impl<'a> CreateTreasuryOutboundPaymentEndUserDetails<'a> { + pub fn new(present: bool) -> Self { + Self { ip_address: None, present } + } +} +impl<'a> CreateTreasuryOutboundPayment<'a> { + /// Creates an OutboundPayment. + pub fn send( + &self, + client: &stripe::Client, + ) -> stripe::Response { + client.send_form("/treasury/outbound_payments", self, http_types::Method::Post) + } +} +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CancelTreasuryOutboundPayment<'a> { + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, +} +impl<'a> CancelTreasuryOutboundPayment<'a> { + pub fn new() -> Self { + Self::default() + } +} +impl<'a> CancelTreasuryOutboundPayment<'a> { + /// Cancel an OutboundPayment. + pub fn send( + &self, + client: &stripe::Client, + id: &stripe_treasury::TreasuryOutboundPaymentId, + ) -> stripe::Response { + client.send_form( + &format!("/treasury/outbound_payments/{id}/cancel"), + self, + http_types::Method::Post, + ) + } +} diff --git a/generated/stripe_treasury/src/treasury_outbound_payment/types.rs b/generated/stripe_treasury/src/treasury_outbound_payment/types.rs new file mode 100644 index 000000000..4c59edc33 --- /dev/null +++ b/generated/stripe_treasury/src/treasury_outbound_payment/types.rs @@ -0,0 +1,127 @@ +/// Use OutboundPayments to send funds to another party's external bank account or [FinancialAccount](https://stripe.com/docs/api#financial_accounts). +/// To send money to an account belonging to the same user, use an [OutboundTransfer](https://stripe.com/docs/api#outbound_transfers). +/// +/// Simulate OutboundPayment state changes with the `/v1/test_helpers/treasury/outbound_payments` endpoints. +/// These methods can only be called on test mode objects. +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct TreasuryOutboundPayment { + /// Amount (in cents) transferred. + pub amount: i64, + /// Returns `true` if the object can be canceled, and `false` otherwise. + pub cancelable: bool, + /// Time at which the object was created. Measured in seconds since the Unix epoch. + pub created: stripe_types::Timestamp, + /// Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. + /// Must be a [supported currency](https://stripe.com/docs/currencies). + pub currency: stripe_types::Currency, + /// ID of the [customer](https://stripe.com/docs/api/customers) to whom an OutboundPayment is sent. + pub customer: Option, + /// An arbitrary string attached to the object. Often useful for displaying to users. + pub description: Option, + /// The PaymentMethod via which an OutboundPayment is sent. + /// This field can be empty if the OutboundPayment was created using `destination_payment_method_data`. + pub destination_payment_method: Option, + /// Details about the PaymentMethod for an OutboundPayment. + pub destination_payment_method_details: + Option, + /// Details about the end user. + pub end_user_details: Option< + stripe_treasury::TreasuryOutboundPaymentsResourceOutboundPaymentResourceEndUserDetails, + >, + /// The date when funds are expected to arrive in the destination account. + pub expected_arrival_date: stripe_types::Timestamp, + /// The FinancialAccount that funds were pulled from. + pub financial_account: String, + /// A [hosted transaction receipt](https://stripe.com/docs/treasury/moving-money/regulatory-receipts) URL that is provided when money movement is considered regulated under Stripe's money transmission licenses. + pub hosted_regulatory_receipt_url: Option, + /// Unique identifier for the object. + pub id: stripe_treasury::TreasuryOutboundPaymentId, + /// Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + pub livemode: bool, + /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. + /// This can be useful for storing additional information about the object in a structured format. + pub metadata: std::collections::HashMap, + /// Details about a returned OutboundPayment. Only set when the status is `returned`. + pub returned_details: Option, + /// The description that appears on the receiving end for an OutboundPayment (for example, bank statement for external bank transfer). + pub statement_descriptor: String, + /// Current status of the OutboundPayment: `processing`, `failed`, `posted`, `returned`, `canceled`. + /// An OutboundPayment is `processing` if it has been created and is pending. + /// The status changes to `posted` once the OutboundPayment has been "confirmed" and funds have left the account, or to `failed` or `canceled`. + /// If an OutboundPayment fails to arrive at its destination, its status will change to `returned`. + pub status: stripe_treasury::TreasuryOutboundPaymentStatus, + pub status_transitions: + stripe_treasury::TreasuryOutboundPaymentsResourceOutboundPaymentResourceStatusTransitions, + /// The Transaction associated with this object. + pub transaction: stripe_types::Expandable, +} +impl stripe_types::Object for TreasuryOutboundPayment { + type Id = stripe_treasury::TreasuryOutboundPaymentId; + fn id(&self) -> &Self::Id { + &self.id + } +} +stripe_types::def_id!(TreasuryOutboundPaymentId); +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum TreasuryOutboundPaymentStatus { + Canceled, + Failed, + Posted, + Processing, + Returned, +} +impl TreasuryOutboundPaymentStatus { + pub fn as_str(self) -> &'static str { + use TreasuryOutboundPaymentStatus::*; + match self { + Canceled => "canceled", + Failed => "failed", + Posted => "posted", + Processing => "processing", + Returned => "returned", + } + } +} + +impl std::str::FromStr for TreasuryOutboundPaymentStatus { + type Err = (); + fn from_str(s: &str) -> Result { + use TreasuryOutboundPaymentStatus::*; + match s { + "canceled" => Ok(Canceled), + "failed" => Ok(Failed), + "posted" => Ok(Posted), + "processing" => Ok(Processing), + "returned" => Ok(Returned), + _ => Err(()), + } + } +} +impl std::fmt::Display for TreasuryOutboundPaymentStatus { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for TreasuryOutboundPaymentStatus { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for TreasuryOutboundPaymentStatus { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for TreasuryOutboundPaymentStatus { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| { + serde::de::Error::custom("Unknown value for TreasuryOutboundPaymentStatus") + }) + } +} diff --git a/generated/stripe_treasury/src/treasury_outbound_payments_resource_outbound_payment_resource_end_user_details.rs b/generated/stripe_treasury/src/treasury_outbound_payments_resource_outbound_payment_resource_end_user_details.rs new file mode 100644 index 000000000..04d3734ef --- /dev/null +++ b/generated/stripe_treasury/src/treasury_outbound_payments_resource_outbound_payment_resource_end_user_details.rs @@ -0,0 +1,11 @@ +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct TreasuryOutboundPaymentsResourceOutboundPaymentResourceEndUserDetails { + /// IP address of the user initiating the OutboundPayment. + /// Set if `present` is set to `true`. + /// IP address collection is required for risk and compliance reasons. + /// This will be used to help determine if the OutboundPayment is authorized or should be blocked. + pub ip_address: Option, + /// `true` if the OutboundPayment creation request is being made on behalf of an end user by a platform. + /// Otherwise, `false`. + pub present: bool, +} diff --git a/generated/stripe_treasury/src/treasury_outbound_payments_resource_outbound_payment_resource_status_transitions.rs b/generated/stripe_treasury/src/treasury_outbound_payments_resource_outbound_payment_resource_status_transitions.rs new file mode 100644 index 000000000..7a1a3d797 --- /dev/null +++ b/generated/stripe_treasury/src/treasury_outbound_payments_resource_outbound_payment_resource_status_transitions.rs @@ -0,0 +1,11 @@ +#[derive(Copy, Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct TreasuryOutboundPaymentsResourceOutboundPaymentResourceStatusTransitions { + /// Timestamp describing when an OutboundPayment changed status to `canceled`. + pub canceled_at: Option, + /// Timestamp describing when an OutboundPayment changed status to `failed`. + pub failed_at: Option, + /// Timestamp describing when an OutboundPayment changed status to `posted`. + pub posted_at: Option, + /// Timestamp describing when an OutboundPayment changed status to `returned`. + pub returned_at: Option, +} diff --git a/generated/stripe_treasury/src/treasury_outbound_payments_resource_returned_status.rs b/generated/stripe_treasury/src/treasury_outbound_payments_resource_returned_status.rs new file mode 100644 index 000000000..1b9b481a4 --- /dev/null +++ b/generated/stripe_treasury/src/treasury_outbound_payments_resource_returned_status.rs @@ -0,0 +1,88 @@ +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct TreasuryOutboundPaymentsResourceReturnedStatus { + /// Reason for the return. + pub code: TreasuryOutboundPaymentsResourceReturnedStatusCode, + /// The Transaction associated with this object. + pub transaction: stripe_types::Expandable, +} +/// Reason for the return. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum TreasuryOutboundPaymentsResourceReturnedStatusCode { + AccountClosed, + AccountFrozen, + BankAccountRestricted, + BankOwnershipChanged, + Declined, + IncorrectAccountHolderName, + InvalidAccountNumber, + InvalidCurrency, + NoAccount, + Other, +} +impl TreasuryOutboundPaymentsResourceReturnedStatusCode { + pub fn as_str(self) -> &'static str { + use TreasuryOutboundPaymentsResourceReturnedStatusCode::*; + match self { + AccountClosed => "account_closed", + AccountFrozen => "account_frozen", + BankAccountRestricted => "bank_account_restricted", + BankOwnershipChanged => "bank_ownership_changed", + Declined => "declined", + IncorrectAccountHolderName => "incorrect_account_holder_name", + InvalidAccountNumber => "invalid_account_number", + InvalidCurrency => "invalid_currency", + NoAccount => "no_account", + Other => "other", + } + } +} + +impl std::str::FromStr for TreasuryOutboundPaymentsResourceReturnedStatusCode { + type Err = (); + fn from_str(s: &str) -> Result { + use TreasuryOutboundPaymentsResourceReturnedStatusCode::*; + match s { + "account_closed" => Ok(AccountClosed), + "account_frozen" => Ok(AccountFrozen), + "bank_account_restricted" => Ok(BankAccountRestricted), + "bank_ownership_changed" => Ok(BankOwnershipChanged), + "declined" => Ok(Declined), + "incorrect_account_holder_name" => Ok(IncorrectAccountHolderName), + "invalid_account_number" => Ok(InvalidAccountNumber), + "invalid_currency" => Ok(InvalidCurrency), + "no_account" => Ok(NoAccount), + "other" => Ok(Other), + _ => Err(()), + } + } +} +impl std::fmt::Display for TreasuryOutboundPaymentsResourceReturnedStatusCode { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for TreasuryOutboundPaymentsResourceReturnedStatusCode { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for TreasuryOutboundPaymentsResourceReturnedStatusCode { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for TreasuryOutboundPaymentsResourceReturnedStatusCode { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| { + serde::de::Error::custom( + "Unknown value for TreasuryOutboundPaymentsResourceReturnedStatusCode", + ) + }) + } +} diff --git a/generated/stripe_treasury/src/treasury_outbound_transfer/mod.rs b/generated/stripe_treasury/src/treasury_outbound_transfer/mod.rs new file mode 100644 index 000000000..bb367c137 --- /dev/null +++ b/generated/stripe_treasury/src/treasury_outbound_transfer/mod.rs @@ -0,0 +1,5 @@ +#[cfg(feature = "treasury_outbound_transfer")] +mod requests; +pub(crate) mod types; +#[cfg(feature = "treasury_outbound_transfer")] +pub use requests::*; diff --git a/generated/stripe_treasury/src/treasury_outbound_transfer/requests.rs b/generated/stripe_treasury/src/treasury_outbound_transfer/requests.rs new file mode 100644 index 000000000..a5f1ac540 --- /dev/null +++ b/generated/stripe_treasury/src/treasury_outbound_transfer/requests.rs @@ -0,0 +1,398 @@ +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct ListTreasuryOutboundTransfer<'a> { + /// A cursor for use in pagination. + /// `ending_before` is an object ID that defines your place in the list. + /// For instance, if you make a list request and receive 100 objects, starting with `obj_bar`, your subsequent call can include `ending_before=obj_bar` in order to fetch the previous page of the list. + #[serde(skip_serializing_if = "Option::is_none")] + pub ending_before: Option<&'a str>, + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, + /// Returns objects associated with this FinancialAccount. + pub financial_account: &'a str, + /// A limit on the number of objects to be returned. + /// Limit can range between 1 and 100, and the default is 10. + #[serde(skip_serializing_if = "Option::is_none")] + pub limit: Option, + /// A cursor for use in pagination. + /// `starting_after` is an object ID that defines your place in the list. + /// For instance, if you make a list request and receive 100 objects, ending with `obj_foo`, your subsequent call can include `starting_after=obj_foo` in order to fetch the next page of the list. + #[serde(skip_serializing_if = "Option::is_none")] + pub starting_after: Option<&'a str>, + /// Only return OutboundTransfers that have the given status: `processing`, `canceled`, `failed`, `posted`, or `returned`. + #[serde(skip_serializing_if = "Option::is_none")] + pub status: Option, +} +impl<'a> ListTreasuryOutboundTransfer<'a> { + pub fn new(financial_account: &'a str) -> Self { + Self { + ending_before: None, + expand: None, + financial_account, + limit: None, + starting_after: None, + status: None, + } + } +} +impl<'a> ListTreasuryOutboundTransfer<'a> { + /// Returns a list of OutboundTransfers sent from the specified FinancialAccount. + pub fn send( + &self, + client: &stripe::Client, + ) -> stripe::Response> { + client.get_query("/treasury/outbound_transfers", self) + } + pub fn paginate( + self, + ) -> stripe::ListPaginator> { + stripe::ListPaginator::from_list_params("/treasury/outbound_transfers", self) + } +} +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct RetrieveTreasuryOutboundTransfer<'a> { + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, +} +impl<'a> RetrieveTreasuryOutboundTransfer<'a> { + pub fn new() -> Self { + Self::default() + } +} +impl<'a> RetrieveTreasuryOutboundTransfer<'a> { + /// Retrieves the details of an existing OutboundTransfer by passing the unique OutboundTransfer ID from either the OutboundTransfer creation request or OutboundTransfer list. + pub fn send( + &self, + client: &stripe::Client, + outbound_transfer: &stripe_treasury::TreasuryOutboundTransferId, + ) -> stripe::Response { + client.get_query(&format!("/treasury/outbound_transfers/{outbound_transfer}"), self) + } +} +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct FailTreasuryOutboundTransfer<'a> { + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, +} +impl<'a> FailTreasuryOutboundTransfer<'a> { + pub fn new() -> Self { + Self::default() + } +} +impl<'a> FailTreasuryOutboundTransfer<'a> { + /// Transitions a test mode created OutboundTransfer to the `failed` status. + /// The OutboundTransfer must already be in the `processing` state. + pub fn send( + &self, + client: &stripe::Client, + outbound_transfer: &str, + ) -> stripe::Response { + client.send_form( + &format!("/test_helpers/treasury/outbound_transfers/{outbound_transfer}/fail"), + self, + http_types::Method::Post, + ) + } +} +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct PostTreasuryOutboundTransfer<'a> { + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, +} +impl<'a> PostTreasuryOutboundTransfer<'a> { + pub fn new() -> Self { + Self::default() + } +} +impl<'a> PostTreasuryOutboundTransfer<'a> { + /// Transitions a test mode created OutboundTransfer to the `posted` status. + /// The OutboundTransfer must already be in the `processing` state. + pub fn send( + &self, + client: &stripe::Client, + outbound_transfer: &str, + ) -> stripe::Response { + client.send_form( + &format!("/test_helpers/treasury/outbound_transfers/{outbound_transfer}/post"), + self, + http_types::Method::Post, + ) + } +} +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct ReturnOutboundTransferTreasuryOutboundTransfer<'a> { + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, + /// Details about a returned OutboundTransfer. + #[serde(skip_serializing_if = "Option::is_none")] + pub returned_details: Option, +} +impl<'a> ReturnOutboundTransferTreasuryOutboundTransfer<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// Details about a returned OutboundTransfer. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct ReturnOutboundTransferTreasuryOutboundTransferReturnedDetails { + /// Reason for the return. + #[serde(skip_serializing_if = "Option::is_none")] + pub code: Option, +} +impl ReturnOutboundTransferTreasuryOutboundTransferReturnedDetails { + pub fn new() -> Self { + Self::default() + } +} +/// Reason for the return. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum ReturnOutboundTransferTreasuryOutboundTransferReturnedDetailsCode { + AccountClosed, + AccountFrozen, + BankAccountRestricted, + BankOwnershipChanged, + Declined, + IncorrectAccountHolderName, + InvalidAccountNumber, + InvalidCurrency, + NoAccount, + Other, +} +impl ReturnOutboundTransferTreasuryOutboundTransferReturnedDetailsCode { + pub fn as_str(self) -> &'static str { + use ReturnOutboundTransferTreasuryOutboundTransferReturnedDetailsCode::*; + match self { + AccountClosed => "account_closed", + AccountFrozen => "account_frozen", + BankAccountRestricted => "bank_account_restricted", + BankOwnershipChanged => "bank_ownership_changed", + Declined => "declined", + IncorrectAccountHolderName => "incorrect_account_holder_name", + InvalidAccountNumber => "invalid_account_number", + InvalidCurrency => "invalid_currency", + NoAccount => "no_account", + Other => "other", + } + } +} + +impl std::str::FromStr for ReturnOutboundTransferTreasuryOutboundTransferReturnedDetailsCode { + type Err = (); + fn from_str(s: &str) -> Result { + use ReturnOutboundTransferTreasuryOutboundTransferReturnedDetailsCode::*; + match s { + "account_closed" => Ok(AccountClosed), + "account_frozen" => Ok(AccountFrozen), + "bank_account_restricted" => Ok(BankAccountRestricted), + "bank_ownership_changed" => Ok(BankOwnershipChanged), + "declined" => Ok(Declined), + "incorrect_account_holder_name" => Ok(IncorrectAccountHolderName), + "invalid_account_number" => Ok(InvalidAccountNumber), + "invalid_currency" => Ok(InvalidCurrency), + "no_account" => Ok(NoAccount), + "other" => Ok(Other), + _ => Err(()), + } + } +} +impl std::fmt::Display for ReturnOutboundTransferTreasuryOutboundTransferReturnedDetailsCode { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for ReturnOutboundTransferTreasuryOutboundTransferReturnedDetailsCode { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for ReturnOutboundTransferTreasuryOutboundTransferReturnedDetailsCode { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'a> ReturnOutboundTransferTreasuryOutboundTransfer<'a> { + /// Transitions a test mode created OutboundTransfer to the `returned` status. + /// The OutboundTransfer must already be in the `processing` state. + pub fn send( + &self, + client: &stripe::Client, + outbound_transfer: &str, + ) -> stripe::Response { + client.send_form( + &format!("/test_helpers/treasury/outbound_transfers/{outbound_transfer}/return"), + self, + http_types::Method::Post, + ) + } +} +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreateTreasuryOutboundTransfer<'a> { + /// Amount (in cents) to be transferred. + pub amount: i64, + /// Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. + /// Must be a [supported currency](https://stripe.com/docs/currencies). + pub currency: stripe_types::Currency, + /// An arbitrary string attached to the object. Often useful for displaying to users. + #[serde(skip_serializing_if = "Option::is_none")] + pub description: Option<&'a str>, + /// The PaymentMethod to use as the payment instrument for the OutboundTransfer. + #[serde(skip_serializing_if = "Option::is_none")] + pub destination_payment_method: Option<&'a str>, + /// Hash describing payment method configuration details. + #[serde(skip_serializing_if = "Option::is_none")] + pub destination_payment_method_options: + Option, + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, + /// The FinancialAccount to pull funds from. + pub financial_account: &'a str, + /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. + /// This can be useful for storing additional information about the object in a structured format. + /// Individual keys can be unset by posting an empty value to them. + /// All keys can be unset by posting an empty value to `metadata`. + #[serde(skip_serializing_if = "Option::is_none")] + pub metadata: Option<&'a std::collections::HashMap>, + /// Statement descriptor to be shown on the receiving end of an OutboundTransfer. + /// Maximum 10 characters for `ach` transfers or 140 characters for `us_domestic_wire` transfers. + /// The default value is "transfer". + #[serde(skip_serializing_if = "Option::is_none")] + pub statement_descriptor: Option<&'a str>, +} +impl<'a> CreateTreasuryOutboundTransfer<'a> { + pub fn new(amount: i64, currency: stripe_types::Currency, financial_account: &'a str) -> Self { + Self { + amount, + currency, + description: None, + destination_payment_method: None, + destination_payment_method_options: None, + expand: None, + financial_account, + metadata: None, + statement_descriptor: None, + } + } +} +/// Hash describing payment method configuration details. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreateTreasuryOutboundTransferDestinationPaymentMethodOptions { + /// Optional fields for `us_bank_account`. + #[serde(skip_serializing_if = "Option::is_none")] + pub us_bank_account: + Option, +} +impl CreateTreasuryOutboundTransferDestinationPaymentMethodOptions { + pub fn new() -> Self { + Self::default() + } +} +/// Optional fields for `us_bank_account`. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreateTreasuryOutboundTransferDestinationPaymentMethodOptionsUsBankAccount { + /// Designate the OutboundTransfer as using a US bank account network configuration. + #[serde(skip_serializing_if = "Option::is_none")] + pub network: + Option, +} +impl CreateTreasuryOutboundTransferDestinationPaymentMethodOptionsUsBankAccount { + pub fn new() -> Self { + Self::default() + } +} +/// Designate the OutboundTransfer as using a US bank account network configuration. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreateTreasuryOutboundTransferDestinationPaymentMethodOptionsUsBankAccountNetwork { + Ach, + UsDomesticWire, +} +impl CreateTreasuryOutboundTransferDestinationPaymentMethodOptionsUsBankAccountNetwork { + pub fn as_str(self) -> &'static str { + use CreateTreasuryOutboundTransferDestinationPaymentMethodOptionsUsBankAccountNetwork::*; + match self { + Ach => "ach", + UsDomesticWire => "us_domestic_wire", + } + } +} + +impl std::str::FromStr + for CreateTreasuryOutboundTransferDestinationPaymentMethodOptionsUsBankAccountNetwork +{ + type Err = (); + fn from_str(s: &str) -> Result { + use CreateTreasuryOutboundTransferDestinationPaymentMethodOptionsUsBankAccountNetwork::*; + match s { + "ach" => Ok(Ach), + "us_domestic_wire" => Ok(UsDomesticWire), + _ => Err(()), + } + } +} +impl std::fmt::Display + for CreateTreasuryOutboundTransferDestinationPaymentMethodOptionsUsBankAccountNetwork +{ + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug + for CreateTreasuryOutboundTransferDestinationPaymentMethodOptionsUsBankAccountNetwork +{ + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize + for CreateTreasuryOutboundTransferDestinationPaymentMethodOptionsUsBankAccountNetwork +{ + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'a> CreateTreasuryOutboundTransfer<'a> { + /// Creates an OutboundTransfer. + pub fn send( + &self, + client: &stripe::Client, + ) -> stripe::Response { + client.send_form("/treasury/outbound_transfers", self, http_types::Method::Post) + } +} +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CancelTreasuryOutboundTransfer<'a> { + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, +} +impl<'a> CancelTreasuryOutboundTransfer<'a> { + pub fn new() -> Self { + Self::default() + } +} +impl<'a> CancelTreasuryOutboundTransfer<'a> { + /// An OutboundTransfer can be canceled if the funds have not yet been paid out. + pub fn send( + &self, + client: &stripe::Client, + outbound_transfer: &stripe_treasury::TreasuryOutboundTransferId, + ) -> stripe::Response { + client.send_form( + &format!("/treasury/outbound_transfers/{outbound_transfer}/cancel"), + self, + http_types::Method::Post, + ) + } +} diff --git a/generated/stripe_treasury/src/treasury_outbound_transfer/types.rs b/generated/stripe_treasury/src/treasury_outbound_transfer/types.rs new file mode 100644 index 000000000..08415c713 --- /dev/null +++ b/generated/stripe_treasury/src/treasury_outbound_transfer/types.rs @@ -0,0 +1,118 @@ +/// Use OutboundTransfers to transfer funds from a [FinancialAccount](https://stripe.com/docs/api#financial_accounts) to a PaymentMethod belonging to the same entity. +/// To send funds to a different party, use [OutboundPayments](https://stripe.com/docs/api#outbound_payments) instead. +/// You can send funds over ACH rails or through a domestic wire transfer to a user's own external bank account. +/// +/// Simulate OutboundTransfer state changes with the `/v1/test_helpers/treasury/outbound_transfers` endpoints. +/// These methods can only be called on test mode objects. +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct TreasuryOutboundTransfer { + /// Amount (in cents) transferred. + pub amount: i64, + /// Returns `true` if the object can be canceled, and `false` otherwise. + pub cancelable: bool, + /// Time at which the object was created. Measured in seconds since the Unix epoch. + pub created: stripe_types::Timestamp, + /// Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. + /// Must be a [supported currency](https://stripe.com/docs/currencies). + pub currency: stripe_types::Currency, + /// An arbitrary string attached to the object. Often useful for displaying to users. + pub description: Option, + /// The PaymentMethod used as the payment instrument for an OutboundTransfer. + pub destination_payment_method: Option, + pub destination_payment_method_details: stripe_treasury::OutboundTransfersPaymentMethodDetails, + /// The date when funds are expected to arrive in the destination account. + pub expected_arrival_date: stripe_types::Timestamp, + /// The FinancialAccount that funds were pulled from. + pub financial_account: String, + /// A [hosted transaction receipt](https://stripe.com/docs/treasury/moving-money/regulatory-receipts) URL that is provided when money movement is considered regulated under Stripe's money transmission licenses. + pub hosted_regulatory_receipt_url: Option, + /// Unique identifier for the object. + pub id: stripe_treasury::TreasuryOutboundTransferId, + /// Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + pub livemode: bool, + /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. + /// This can be useful for storing additional information about the object in a structured format. + pub metadata: std::collections::HashMap, + /// Details about a returned OutboundTransfer. Only set when the status is `returned`. + pub returned_details: Option, + /// Information about the OutboundTransfer to be sent to the recipient account. + pub statement_descriptor: String, + /// Current status of the OutboundTransfer: `processing`, `failed`, `canceled`, `posted`, `returned`. + /// An OutboundTransfer is `processing` if it has been created and is pending. + /// The status changes to `posted` once the OutboundTransfer has been "confirmed" and funds have left the account, or to `failed` or `canceled`. + /// If an OutboundTransfer fails to arrive at its destination, its status will change to `returned`. + pub status: stripe_treasury::TreasuryOutboundTransferStatus, + pub status_transitions: stripe_treasury::TreasuryOutboundTransfersResourceStatusTransitions, + /// The Transaction associated with this object. + pub transaction: stripe_types::Expandable, +} +impl stripe_types::Object for TreasuryOutboundTransfer { + type Id = stripe_treasury::TreasuryOutboundTransferId; + fn id(&self) -> &Self::Id { + &self.id + } +} +stripe_types::def_id!(TreasuryOutboundTransferId); +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum TreasuryOutboundTransferStatus { + Canceled, + Failed, + Posted, + Processing, + Returned, +} +impl TreasuryOutboundTransferStatus { + pub fn as_str(self) -> &'static str { + use TreasuryOutboundTransferStatus::*; + match self { + Canceled => "canceled", + Failed => "failed", + Posted => "posted", + Processing => "processing", + Returned => "returned", + } + } +} + +impl std::str::FromStr for TreasuryOutboundTransferStatus { + type Err = (); + fn from_str(s: &str) -> Result { + use TreasuryOutboundTransferStatus::*; + match s { + "canceled" => Ok(Canceled), + "failed" => Ok(Failed), + "posted" => Ok(Posted), + "processing" => Ok(Processing), + "returned" => Ok(Returned), + _ => Err(()), + } + } +} +impl std::fmt::Display for TreasuryOutboundTransferStatus { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for TreasuryOutboundTransferStatus { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for TreasuryOutboundTransferStatus { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for TreasuryOutboundTransferStatus { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| { + serde::de::Error::custom("Unknown value for TreasuryOutboundTransferStatus") + }) + } +} diff --git a/generated/stripe_treasury/src/treasury_outbound_transfers_resource_returned_details.rs b/generated/stripe_treasury/src/treasury_outbound_transfers_resource_returned_details.rs new file mode 100644 index 000000000..3369e6b0f --- /dev/null +++ b/generated/stripe_treasury/src/treasury_outbound_transfers_resource_returned_details.rs @@ -0,0 +1,88 @@ +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct TreasuryOutboundTransfersResourceReturnedDetails { + /// Reason for the return. + pub code: TreasuryOutboundTransfersResourceReturnedDetailsCode, + /// The Transaction associated with this object. + pub transaction: stripe_types::Expandable, +} +/// Reason for the return. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum TreasuryOutboundTransfersResourceReturnedDetailsCode { + AccountClosed, + AccountFrozen, + BankAccountRestricted, + BankOwnershipChanged, + Declined, + IncorrectAccountHolderName, + InvalidAccountNumber, + InvalidCurrency, + NoAccount, + Other, +} +impl TreasuryOutboundTransfersResourceReturnedDetailsCode { + pub fn as_str(self) -> &'static str { + use TreasuryOutboundTransfersResourceReturnedDetailsCode::*; + match self { + AccountClosed => "account_closed", + AccountFrozen => "account_frozen", + BankAccountRestricted => "bank_account_restricted", + BankOwnershipChanged => "bank_ownership_changed", + Declined => "declined", + IncorrectAccountHolderName => "incorrect_account_holder_name", + InvalidAccountNumber => "invalid_account_number", + InvalidCurrency => "invalid_currency", + NoAccount => "no_account", + Other => "other", + } + } +} + +impl std::str::FromStr for TreasuryOutboundTransfersResourceReturnedDetailsCode { + type Err = (); + fn from_str(s: &str) -> Result { + use TreasuryOutboundTransfersResourceReturnedDetailsCode::*; + match s { + "account_closed" => Ok(AccountClosed), + "account_frozen" => Ok(AccountFrozen), + "bank_account_restricted" => Ok(BankAccountRestricted), + "bank_ownership_changed" => Ok(BankOwnershipChanged), + "declined" => Ok(Declined), + "incorrect_account_holder_name" => Ok(IncorrectAccountHolderName), + "invalid_account_number" => Ok(InvalidAccountNumber), + "invalid_currency" => Ok(InvalidCurrency), + "no_account" => Ok(NoAccount), + "other" => Ok(Other), + _ => Err(()), + } + } +} +impl std::fmt::Display for TreasuryOutboundTransfersResourceReturnedDetailsCode { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for TreasuryOutboundTransfersResourceReturnedDetailsCode { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for TreasuryOutboundTransfersResourceReturnedDetailsCode { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for TreasuryOutboundTransfersResourceReturnedDetailsCode { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| { + serde::de::Error::custom( + "Unknown value for TreasuryOutboundTransfersResourceReturnedDetailsCode", + ) + }) + } +} diff --git a/generated/stripe_treasury/src/treasury_outbound_transfers_resource_status_transitions.rs b/generated/stripe_treasury/src/treasury_outbound_transfers_resource_status_transitions.rs new file mode 100644 index 000000000..5c77bafdd --- /dev/null +++ b/generated/stripe_treasury/src/treasury_outbound_transfers_resource_status_transitions.rs @@ -0,0 +1,11 @@ +#[derive(Copy, Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct TreasuryOutboundTransfersResourceStatusTransitions { + /// Timestamp describing when an OutboundTransfer changed status to `canceled` + pub canceled_at: Option, + /// Timestamp describing when an OutboundTransfer changed status to `failed` + pub failed_at: Option, + /// Timestamp describing when an OutboundTransfer changed status to `posted` + pub posted_at: Option, + /// Timestamp describing when an OutboundTransfer changed status to `returned` + pub returned_at: Option, +} diff --git a/generated/stripe_treasury/src/treasury_received_credit/mod.rs b/generated/stripe_treasury/src/treasury_received_credit/mod.rs new file mode 100644 index 000000000..ded7d95a7 --- /dev/null +++ b/generated/stripe_treasury/src/treasury_received_credit/mod.rs @@ -0,0 +1,5 @@ +#[cfg(feature = "treasury_received_credit")] +mod requests; +pub(crate) mod types; +#[cfg(feature = "treasury_received_credit")] +pub use requests::*; diff --git a/generated/stripe_treasury/src/treasury_received_credit/requests.rs b/generated/stripe_treasury/src/treasury_received_credit/requests.rs new file mode 100644 index 000000000..fd87be55a --- /dev/null +++ b/generated/stripe_treasury/src/treasury_received_credit/requests.rs @@ -0,0 +1,312 @@ +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct ListTreasuryReceivedCredit<'a> { + /// A cursor for use in pagination. + /// `ending_before` is an object ID that defines your place in the list. + /// For instance, if you make a list request and receive 100 objects, starting with `obj_bar`, your subsequent call can include `ending_before=obj_bar` in order to fetch the previous page of the list. + #[serde(skip_serializing_if = "Option::is_none")] + pub ending_before: Option<&'a str>, + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, + /// The FinancialAccount that received the funds. + pub financial_account: &'a str, + /// A limit on the number of objects to be returned. + /// Limit can range between 1 and 100, and the default is 10. + #[serde(skip_serializing_if = "Option::is_none")] + pub limit: Option, + /// Only return ReceivedCredits described by the flow. + #[serde(skip_serializing_if = "Option::is_none")] + pub linked_flows: Option, + /// A cursor for use in pagination. + /// `starting_after` is an object ID that defines your place in the list. + /// For instance, if you make a list request and receive 100 objects, ending with `obj_foo`, your subsequent call can include `starting_after=obj_foo` in order to fetch the next page of the list. + #[serde(skip_serializing_if = "Option::is_none")] + pub starting_after: Option<&'a str>, + /// Only return ReceivedCredits that have the given status: `succeeded` or `failed`. + #[serde(skip_serializing_if = "Option::is_none")] + pub status: Option, +} +impl<'a> ListTreasuryReceivedCredit<'a> { + pub fn new(financial_account: &'a str) -> Self { + Self { + ending_before: None, + expand: None, + financial_account, + limit: None, + linked_flows: None, + starting_after: None, + status: None, + } + } +} +/// Only return ReceivedCredits described by the flow. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct ListTreasuryReceivedCreditLinkedFlows { + /// The source flow type. + pub source_flow_type: ListTreasuryReceivedCreditLinkedFlowsSourceFlowType, +} +impl ListTreasuryReceivedCreditLinkedFlows { + pub fn new(source_flow_type: ListTreasuryReceivedCreditLinkedFlowsSourceFlowType) -> Self { + Self { source_flow_type } + } +} +/// The source flow type. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum ListTreasuryReceivedCreditLinkedFlowsSourceFlowType { + CreditReversal, + Other, + OutboundPayment, + Payout, +} +impl ListTreasuryReceivedCreditLinkedFlowsSourceFlowType { + pub fn as_str(self) -> &'static str { + use ListTreasuryReceivedCreditLinkedFlowsSourceFlowType::*; + match self { + CreditReversal => "credit_reversal", + Other => "other", + OutboundPayment => "outbound_payment", + Payout => "payout", + } + } +} + +impl std::str::FromStr for ListTreasuryReceivedCreditLinkedFlowsSourceFlowType { + type Err = (); + fn from_str(s: &str) -> Result { + use ListTreasuryReceivedCreditLinkedFlowsSourceFlowType::*; + match s { + "credit_reversal" => Ok(CreditReversal), + "other" => Ok(Other), + "outbound_payment" => Ok(OutboundPayment), + "payout" => Ok(Payout), + _ => Err(()), + } + } +} +impl std::fmt::Display for ListTreasuryReceivedCreditLinkedFlowsSourceFlowType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for ListTreasuryReceivedCreditLinkedFlowsSourceFlowType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for ListTreasuryReceivedCreditLinkedFlowsSourceFlowType { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'a> ListTreasuryReceivedCredit<'a> { + /// Returns a list of ReceivedCredits. + pub fn send( + &self, + client: &stripe::Client, + ) -> stripe::Response> { + client.get_query("/treasury/received_credits", self) + } + pub fn paginate( + self, + ) -> stripe::ListPaginator> { + stripe::ListPaginator::from_list_params("/treasury/received_credits", self) + } +} +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct RetrieveTreasuryReceivedCredit<'a> { + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, +} +impl<'a> RetrieveTreasuryReceivedCredit<'a> { + pub fn new() -> Self { + Self::default() + } +} +impl<'a> RetrieveTreasuryReceivedCredit<'a> { + /// Retrieves the details of an existing ReceivedCredit by passing the unique ReceivedCredit ID from the ReceivedCredit list. + pub fn send( + &self, + client: &stripe::Client, + id: &stripe_treasury::TreasuryReceivedCreditId, + ) -> stripe::Response { + client.get_query(&format!("/treasury/received_credits/{id}"), self) + } +} +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreateTreasuryReceivedCredit<'a> { + /// Amount (in cents) to be transferred. + pub amount: i64, + /// Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. + /// Must be a [supported currency](https://stripe.com/docs/currencies). + pub currency: stripe_types::Currency, + /// An arbitrary string attached to the object. Often useful for displaying to users. + #[serde(skip_serializing_if = "Option::is_none")] + pub description: Option<&'a str>, + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, + /// The FinancialAccount to send funds to. + pub financial_account: &'a str, + /// Initiating payment method details for the object. + #[serde(skip_serializing_if = "Option::is_none")] + pub initiating_payment_method_details: + Option>, + /// The rails used for the object. + pub network: CreateTreasuryReceivedCreditNetwork, +} +impl<'a> CreateTreasuryReceivedCredit<'a> { + pub fn new( + amount: i64, + currency: stripe_types::Currency, + financial_account: &'a str, + network: CreateTreasuryReceivedCreditNetwork, + ) -> Self { + Self { + amount, + currency, + description: None, + expand: None, + financial_account, + initiating_payment_method_details: None, + network, + } + } +} +/// Initiating payment method details for the object. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreateTreasuryReceivedCreditInitiatingPaymentMethodDetails<'a> { + /// The source type. + #[serde(rename = "type")] + pub type_: CreateTreasuryReceivedCreditInitiatingPaymentMethodDetailsType, + /// Optional fields for `us_bank_account`. + #[serde(skip_serializing_if = "Option::is_none")] + pub us_bank_account: + Option>, +} +impl<'a> CreateTreasuryReceivedCreditInitiatingPaymentMethodDetails<'a> { + pub fn new(type_: CreateTreasuryReceivedCreditInitiatingPaymentMethodDetailsType) -> Self { + Self { type_, us_bank_account: None } + } +} +/// The source type. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreateTreasuryReceivedCreditInitiatingPaymentMethodDetailsType { + UsBankAccount, +} +impl CreateTreasuryReceivedCreditInitiatingPaymentMethodDetailsType { + pub fn as_str(self) -> &'static str { + use CreateTreasuryReceivedCreditInitiatingPaymentMethodDetailsType::*; + match self { + UsBankAccount => "us_bank_account", + } + } +} + +impl std::str::FromStr for CreateTreasuryReceivedCreditInitiatingPaymentMethodDetailsType { + type Err = (); + fn from_str(s: &str) -> Result { + use CreateTreasuryReceivedCreditInitiatingPaymentMethodDetailsType::*; + match s { + "us_bank_account" => Ok(UsBankAccount), + _ => Err(()), + } + } +} +impl std::fmt::Display for CreateTreasuryReceivedCreditInitiatingPaymentMethodDetailsType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreateTreasuryReceivedCreditInitiatingPaymentMethodDetailsType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreateTreasuryReceivedCreditInitiatingPaymentMethodDetailsType { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Optional fields for `us_bank_account`. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreateTreasuryReceivedCreditInitiatingPaymentMethodDetailsUsBankAccount<'a> { + /// The bank account holder's name. + #[serde(skip_serializing_if = "Option::is_none")] + pub account_holder_name: Option<&'a str>, + /// The bank account number. + #[serde(skip_serializing_if = "Option::is_none")] + pub account_number: Option<&'a str>, + /// The bank account's routing number. + #[serde(skip_serializing_if = "Option::is_none")] + pub routing_number: Option<&'a str>, +} +impl<'a> CreateTreasuryReceivedCreditInitiatingPaymentMethodDetailsUsBankAccount<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// The rails used for the object. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreateTreasuryReceivedCreditNetwork { + Ach, + UsDomesticWire, +} +impl CreateTreasuryReceivedCreditNetwork { + pub fn as_str(self) -> &'static str { + use CreateTreasuryReceivedCreditNetwork::*; + match self { + Ach => "ach", + UsDomesticWire => "us_domestic_wire", + } + } +} + +impl std::str::FromStr for CreateTreasuryReceivedCreditNetwork { + type Err = (); + fn from_str(s: &str) -> Result { + use CreateTreasuryReceivedCreditNetwork::*; + match s { + "ach" => Ok(Ach), + "us_domestic_wire" => Ok(UsDomesticWire), + _ => Err(()), + } + } +} +impl std::fmt::Display for CreateTreasuryReceivedCreditNetwork { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreateTreasuryReceivedCreditNetwork { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreateTreasuryReceivedCreditNetwork { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'a> CreateTreasuryReceivedCredit<'a> { + /// Use this endpoint to simulate a test mode ReceivedCredit initiated by a third party. + /// In live mode, you can’t directly create ReceivedCredits initiated by third parties. + pub fn send( + &self, + client: &stripe::Client, + ) -> stripe::Response { + client.send_form("/test_helpers/treasury/received_credits", self, http_types::Method::Post) + } +} diff --git a/generated/stripe_treasury/src/treasury_received_credit/types.rs b/generated/stripe_treasury/src/treasury_received_credit/types.rs new file mode 100644 index 000000000..c9cf74773 --- /dev/null +++ b/generated/stripe_treasury/src/treasury_received_credit/types.rs @@ -0,0 +1,218 @@ +/// ReceivedCredits represent funds sent to a [FinancialAccount](https://stripe.com/docs/api#financial_accounts) (for example, via ACH or wire). +/// These money movements are not initiated from the FinancialAccount. +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct TreasuryReceivedCredit { + /// Amount (in cents) transferred. +pub amount: i64, + /// Time at which the object was created. Measured in seconds since the Unix epoch. +pub created: stripe_types::Timestamp, + /// Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. + /// Must be a [supported currency](https://stripe.com/docs/currencies). +pub currency: stripe_types::Currency, + /// An arbitrary string attached to the object. Often useful for displaying to users. +pub description: String, + /// Reason for the failure. + /// A ReceivedCredit might fail because the receiving FinancialAccount is closed or frozen. +pub failure_code: Option, + /// The FinancialAccount that received the funds. +pub financial_account: Option, + /// A [hosted transaction receipt](https://stripe.com/docs/treasury/moving-money/regulatory-receipts) URL that is provided when money movement is considered regulated under Stripe's money transmission licenses. +pub hosted_regulatory_receipt_url: Option, + /// Unique identifier for the object. +pub id: stripe_treasury::TreasuryReceivedCreditId, +pub initiating_payment_method_details: stripe_treasury::TreasurySharedResourceInitiatingPaymentMethodDetailsInitiatingPaymentMethodDetails, +pub linked_flows: stripe_treasury::TreasuryReceivedCreditsResourceLinkedFlows, + /// Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. +pub livemode: bool, + /// The rails used to send the funds. +pub network: TreasuryReceivedCreditNetwork, + /// Details describing when a ReceivedCredit may be reversed. +pub reversal_details: Option, + /// Status of the ReceivedCredit. + /// ReceivedCredits are created either `succeeded` (approved) or `failed` (declined). + /// If a ReceivedCredit is declined, the failure reason can be found in the `failure_code` field. +pub status: stripe_treasury::TreasuryReceivedCreditStatus, + /// The Transaction associated with this object. +pub transaction: Option>, + +} +/// Reason for the failure. +/// A ReceivedCredit might fail because the receiving FinancialAccount is closed or frozen. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum TreasuryReceivedCreditFailureCode { + AccountClosed, + AccountFrozen, + Other, +} +impl TreasuryReceivedCreditFailureCode { + pub fn as_str(self) -> &'static str { + use TreasuryReceivedCreditFailureCode::*; + match self { + AccountClosed => "account_closed", + AccountFrozen => "account_frozen", + Other => "other", + } + } +} + +impl std::str::FromStr for TreasuryReceivedCreditFailureCode { + type Err = (); + fn from_str(s: &str) -> Result { + use TreasuryReceivedCreditFailureCode::*; + match s { + "account_closed" => Ok(AccountClosed), + "account_frozen" => Ok(AccountFrozen), + "other" => Ok(Other), + _ => Err(()), + } + } +} +impl std::fmt::Display for TreasuryReceivedCreditFailureCode { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for TreasuryReceivedCreditFailureCode { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for TreasuryReceivedCreditFailureCode { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for TreasuryReceivedCreditFailureCode { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| { + serde::de::Error::custom("Unknown value for TreasuryReceivedCreditFailureCode") + }) + } +} +/// The rails used to send the funds. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum TreasuryReceivedCreditNetwork { + Ach, + Card, + Stripe, + UsDomesticWire, +} +impl TreasuryReceivedCreditNetwork { + pub fn as_str(self) -> &'static str { + use TreasuryReceivedCreditNetwork::*; + match self { + Ach => "ach", + Card => "card", + Stripe => "stripe", + UsDomesticWire => "us_domestic_wire", + } + } +} + +impl std::str::FromStr for TreasuryReceivedCreditNetwork { + type Err = (); + fn from_str(s: &str) -> Result { + use TreasuryReceivedCreditNetwork::*; + match s { + "ach" => Ok(Ach), + "card" => Ok(Card), + "stripe" => Ok(Stripe), + "us_domestic_wire" => Ok(UsDomesticWire), + _ => Err(()), + } + } +} +impl std::fmt::Display for TreasuryReceivedCreditNetwork { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for TreasuryReceivedCreditNetwork { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for TreasuryReceivedCreditNetwork { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for TreasuryReceivedCreditNetwork { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| { + serde::de::Error::custom("Unknown value for TreasuryReceivedCreditNetwork") + }) + } +} +impl stripe_types::Object for TreasuryReceivedCredit { + type Id = stripe_treasury::TreasuryReceivedCreditId; + fn id(&self) -> &Self::Id { + &self.id + } +} +stripe_types::def_id!(TreasuryReceivedCreditId); +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum TreasuryReceivedCreditStatus { + Failed, + Succeeded, +} +impl TreasuryReceivedCreditStatus { + pub fn as_str(self) -> &'static str { + use TreasuryReceivedCreditStatus::*; + match self { + Failed => "failed", + Succeeded => "succeeded", + } + } +} + +impl std::str::FromStr for TreasuryReceivedCreditStatus { + type Err = (); + fn from_str(s: &str) -> Result { + use TreasuryReceivedCreditStatus::*; + match s { + "failed" => Ok(Failed), + "succeeded" => Ok(Succeeded), + _ => Err(()), + } + } +} +impl std::fmt::Display for TreasuryReceivedCreditStatus { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for TreasuryReceivedCreditStatus { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for TreasuryReceivedCreditStatus { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for TreasuryReceivedCreditStatus { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s) + .map_err(|_| serde::de::Error::custom("Unknown value for TreasuryReceivedCreditStatus")) + } +} diff --git a/generated/stripe_treasury/src/treasury_received_credits_resource_linked_flows.rs b/generated/stripe_treasury/src/treasury_received_credits_resource_linked_flows.rs new file mode 100644 index 000000000..db5527c60 --- /dev/null +++ b/generated/stripe_treasury/src/treasury_received_credits_resource_linked_flows.rs @@ -0,0 +1,18 @@ +#[derive(Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct TreasuryReceivedCreditsResourceLinkedFlows { + /// The CreditReversal created as a result of this ReceivedCredit being reversed. + pub credit_reversal: Option, + /// Set if the ReceivedCredit was created due to an [Issuing Authorization](https://stripe.com/docs/api#issuing_authorizations) object. + pub issuing_authorization: Option, + /// Set if the ReceivedCredit is also viewable as an [Issuing transaction](https://stripe.com/docs/api#issuing_transactions) object. + pub issuing_transaction: Option, + /// ID of the source flow. + /// Set if `network` is `stripe` and the source flow is visible to the user. + /// Examples of source flows include OutboundPayments, payouts, or CreditReversals. + pub source_flow: Option, + /// The expandable object of the source flow. + pub source_flow_details: + Option, + /// The type of flow that originated the ReceivedCredit (for example, `outbound_payment`). + pub source_flow_type: Option, +} diff --git a/generated/stripe_treasury/src/treasury_received_credits_resource_reversal_details.rs b/generated/stripe_treasury/src/treasury_received_credits_resource_reversal_details.rs new file mode 100644 index 000000000..e46815910 --- /dev/null +++ b/generated/stripe_treasury/src/treasury_received_credits_resource_reversal_details.rs @@ -0,0 +1,75 @@ +#[derive(Copy, Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct TreasuryReceivedCreditsResourceReversalDetails { + /// Time before which a ReceivedCredit can be reversed. + pub deadline: Option, + /// Set if a ReceivedCredit cannot be reversed. + pub restricted_reason: Option, +} +/// Set if a ReceivedCredit cannot be reversed. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum TreasuryReceivedCreditsResourceReversalDetailsRestrictedReason { + AlreadyReversed, + DeadlinePassed, + NetworkRestricted, + Other, + SourceFlowRestricted, +} +impl TreasuryReceivedCreditsResourceReversalDetailsRestrictedReason { + pub fn as_str(self) -> &'static str { + use TreasuryReceivedCreditsResourceReversalDetailsRestrictedReason::*; + match self { + AlreadyReversed => "already_reversed", + DeadlinePassed => "deadline_passed", + NetworkRestricted => "network_restricted", + Other => "other", + SourceFlowRestricted => "source_flow_restricted", + } + } +} + +impl std::str::FromStr for TreasuryReceivedCreditsResourceReversalDetailsRestrictedReason { + type Err = (); + fn from_str(s: &str) -> Result { + use TreasuryReceivedCreditsResourceReversalDetailsRestrictedReason::*; + match s { + "already_reversed" => Ok(AlreadyReversed), + "deadline_passed" => Ok(DeadlinePassed), + "network_restricted" => Ok(NetworkRestricted), + "other" => Ok(Other), + "source_flow_restricted" => Ok(SourceFlowRestricted), + _ => Err(()), + } + } +} +impl std::fmt::Display for TreasuryReceivedCreditsResourceReversalDetailsRestrictedReason { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for TreasuryReceivedCreditsResourceReversalDetailsRestrictedReason { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for TreasuryReceivedCreditsResourceReversalDetailsRestrictedReason { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> + for TreasuryReceivedCreditsResourceReversalDetailsRestrictedReason +{ + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| { + serde::de::Error::custom( + "Unknown value for TreasuryReceivedCreditsResourceReversalDetailsRestrictedReason", + ) + }) + } +} diff --git a/generated/stripe_treasury/src/treasury_received_credits_resource_source_flows_details.rs b/generated/stripe_treasury/src/treasury_received_credits_resource_source_flows_details.rs new file mode 100644 index 000000000..b99995f83 --- /dev/null +++ b/generated/stripe_treasury/src/treasury_received_credits_resource_source_flows_details.rs @@ -0,0 +1,75 @@ +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct TreasuryReceivedCreditsResourceSourceFlowsDetails { + #[serde(skip_serializing_if = "Option::is_none")] + pub credit_reversal: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub outbound_payment: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub payout: Option, + /// The type of the source flow that originated the ReceivedCredit. + #[serde(rename = "type")] + pub type_: TreasuryReceivedCreditsResourceSourceFlowsDetailsType, +} +/// The type of the source flow that originated the ReceivedCredit. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum TreasuryReceivedCreditsResourceSourceFlowsDetailsType { + CreditReversal, + Other, + OutboundPayment, + Payout, +} +impl TreasuryReceivedCreditsResourceSourceFlowsDetailsType { + pub fn as_str(self) -> &'static str { + use TreasuryReceivedCreditsResourceSourceFlowsDetailsType::*; + match self { + CreditReversal => "credit_reversal", + Other => "other", + OutboundPayment => "outbound_payment", + Payout => "payout", + } + } +} + +impl std::str::FromStr for TreasuryReceivedCreditsResourceSourceFlowsDetailsType { + type Err = (); + fn from_str(s: &str) -> Result { + use TreasuryReceivedCreditsResourceSourceFlowsDetailsType::*; + match s { + "credit_reversal" => Ok(CreditReversal), + "other" => Ok(Other), + "outbound_payment" => Ok(OutboundPayment), + "payout" => Ok(Payout), + _ => Err(()), + } + } +} +impl std::fmt::Display for TreasuryReceivedCreditsResourceSourceFlowsDetailsType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for TreasuryReceivedCreditsResourceSourceFlowsDetailsType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for TreasuryReceivedCreditsResourceSourceFlowsDetailsType { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for TreasuryReceivedCreditsResourceSourceFlowsDetailsType { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| { + serde::de::Error::custom( + "Unknown value for TreasuryReceivedCreditsResourceSourceFlowsDetailsType", + ) + }) + } +} diff --git a/generated/stripe_treasury/src/treasury_received_credits_resource_status_transitions.rs b/generated/stripe_treasury/src/treasury_received_credits_resource_status_transitions.rs new file mode 100644 index 000000000..ebbdc717b --- /dev/null +++ b/generated/stripe_treasury/src/treasury_received_credits_resource_status_transitions.rs @@ -0,0 +1,5 @@ +#[derive(Copy, Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct TreasuryReceivedCreditsResourceStatusTransitions { + /// Timestamp describing when the CreditReversal changed status to `posted` + pub posted_at: Option, +} diff --git a/generated/stripe_treasury/src/treasury_received_debit/mod.rs b/generated/stripe_treasury/src/treasury_received_debit/mod.rs new file mode 100644 index 000000000..0fe82ef7a --- /dev/null +++ b/generated/stripe_treasury/src/treasury_received_debit/mod.rs @@ -0,0 +1,5 @@ +#[cfg(feature = "treasury_received_debit")] +mod requests; +pub(crate) mod types; +#[cfg(feature = "treasury_received_debit")] +pub use requests::*; diff --git a/generated/stripe_treasury/src/treasury_received_debit/requests.rs b/generated/stripe_treasury/src/treasury_received_debit/requests.rs new file mode 100644 index 000000000..d04972f91 --- /dev/null +++ b/generated/stripe_treasury/src/treasury_received_debit/requests.rs @@ -0,0 +1,242 @@ +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct ListTreasuryReceivedDebit<'a> { + /// A cursor for use in pagination. + /// `ending_before` is an object ID that defines your place in the list. + /// For instance, if you make a list request and receive 100 objects, starting with `obj_bar`, your subsequent call can include `ending_before=obj_bar` in order to fetch the previous page of the list. + #[serde(skip_serializing_if = "Option::is_none")] + pub ending_before: Option<&'a str>, + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, + /// The FinancialAccount that funds were pulled from. + pub financial_account: &'a str, + /// A limit on the number of objects to be returned. + /// Limit can range between 1 and 100, and the default is 10. + #[serde(skip_serializing_if = "Option::is_none")] + pub limit: Option, + /// A cursor for use in pagination. + /// `starting_after` is an object ID that defines your place in the list. + /// For instance, if you make a list request and receive 100 objects, ending with `obj_foo`, your subsequent call can include `starting_after=obj_foo` in order to fetch the next page of the list. + #[serde(skip_serializing_if = "Option::is_none")] + pub starting_after: Option<&'a str>, + /// Only return ReceivedDebits that have the given status: `succeeded` or `failed`. + #[serde(skip_serializing_if = "Option::is_none")] + pub status: Option, +} +impl<'a> ListTreasuryReceivedDebit<'a> { + pub fn new(financial_account: &'a str) -> Self { + Self { + ending_before: None, + expand: None, + financial_account, + limit: None, + starting_after: None, + status: None, + } + } +} +impl<'a> ListTreasuryReceivedDebit<'a> { + /// Returns a list of ReceivedDebits. + pub fn send( + &self, + client: &stripe::Client, + ) -> stripe::Response> { + client.get_query("/treasury/received_debits", self) + } + pub fn paginate( + self, + ) -> stripe::ListPaginator> { + stripe::ListPaginator::from_list_params("/treasury/received_debits", self) + } +} +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct RetrieveTreasuryReceivedDebit<'a> { + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, +} +impl<'a> RetrieveTreasuryReceivedDebit<'a> { + pub fn new() -> Self { + Self::default() + } +} +impl<'a> RetrieveTreasuryReceivedDebit<'a> { + /// Retrieves the details of an existing ReceivedDebit by passing the unique ReceivedDebit ID from the ReceivedDebit list. + pub fn send( + &self, + client: &stripe::Client, + id: &stripe_treasury::TreasuryReceivedDebitId, + ) -> stripe::Response { + client.get_query(&format!("/treasury/received_debits/{id}"), self) + } +} +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreateTreasuryReceivedDebit<'a> { + /// Amount (in cents) to be transferred. + pub amount: i64, + /// Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. + /// Must be a [supported currency](https://stripe.com/docs/currencies). + pub currency: stripe_types::Currency, + /// An arbitrary string attached to the object. Often useful for displaying to users. + #[serde(skip_serializing_if = "Option::is_none")] + pub description: Option<&'a str>, + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, + /// The FinancialAccount to pull funds from. + pub financial_account: &'a str, + /// Initiating payment method details for the object. + #[serde(skip_serializing_if = "Option::is_none")] + pub initiating_payment_method_details: + Option>, + /// The rails used for the object. + pub network: CreateTreasuryReceivedDebitNetwork, +} +impl<'a> CreateTreasuryReceivedDebit<'a> { + pub fn new( + amount: i64, + currency: stripe_types::Currency, + financial_account: &'a str, + network: CreateTreasuryReceivedDebitNetwork, + ) -> Self { + Self { + amount, + currency, + description: None, + expand: None, + financial_account, + initiating_payment_method_details: None, + network, + } + } +} +/// Initiating payment method details for the object. +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct CreateTreasuryReceivedDebitInitiatingPaymentMethodDetails<'a> { + /// The source type. + #[serde(rename = "type")] + pub type_: CreateTreasuryReceivedDebitInitiatingPaymentMethodDetailsType, + /// Optional fields for `us_bank_account`. + #[serde(skip_serializing_if = "Option::is_none")] + pub us_bank_account: + Option>, +} +impl<'a> CreateTreasuryReceivedDebitInitiatingPaymentMethodDetails<'a> { + pub fn new(type_: CreateTreasuryReceivedDebitInitiatingPaymentMethodDetailsType) -> Self { + Self { type_, us_bank_account: None } + } +} +/// The source type. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreateTreasuryReceivedDebitInitiatingPaymentMethodDetailsType { + UsBankAccount, +} +impl CreateTreasuryReceivedDebitInitiatingPaymentMethodDetailsType { + pub fn as_str(self) -> &'static str { + use CreateTreasuryReceivedDebitInitiatingPaymentMethodDetailsType::*; + match self { + UsBankAccount => "us_bank_account", + } + } +} + +impl std::str::FromStr for CreateTreasuryReceivedDebitInitiatingPaymentMethodDetailsType { + type Err = (); + fn from_str(s: &str) -> Result { + use CreateTreasuryReceivedDebitInitiatingPaymentMethodDetailsType::*; + match s { + "us_bank_account" => Ok(UsBankAccount), + _ => Err(()), + } + } +} +impl std::fmt::Display for CreateTreasuryReceivedDebitInitiatingPaymentMethodDetailsType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreateTreasuryReceivedDebitInitiatingPaymentMethodDetailsType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreateTreasuryReceivedDebitInitiatingPaymentMethodDetailsType { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// Optional fields for `us_bank_account`. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct CreateTreasuryReceivedDebitInitiatingPaymentMethodDetailsUsBankAccount<'a> { + /// The bank account holder's name. + #[serde(skip_serializing_if = "Option::is_none")] + pub account_holder_name: Option<&'a str>, + /// The bank account number. + #[serde(skip_serializing_if = "Option::is_none")] + pub account_number: Option<&'a str>, + /// The bank account's routing number. + #[serde(skip_serializing_if = "Option::is_none")] + pub routing_number: Option<&'a str>, +} +impl<'a> CreateTreasuryReceivedDebitInitiatingPaymentMethodDetailsUsBankAccount<'a> { + pub fn new() -> Self { + Self::default() + } +} +/// The rails used for the object. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum CreateTreasuryReceivedDebitNetwork { + Ach, +} +impl CreateTreasuryReceivedDebitNetwork { + pub fn as_str(self) -> &'static str { + use CreateTreasuryReceivedDebitNetwork::*; + match self { + Ach => "ach", + } + } +} + +impl std::str::FromStr for CreateTreasuryReceivedDebitNetwork { + type Err = (); + fn from_str(s: &str) -> Result { + use CreateTreasuryReceivedDebitNetwork::*; + match s { + "ach" => Ok(Ach), + _ => Err(()), + } + } +} +impl std::fmt::Display for CreateTreasuryReceivedDebitNetwork { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for CreateTreasuryReceivedDebitNetwork { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for CreateTreasuryReceivedDebitNetwork { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'a> CreateTreasuryReceivedDebit<'a> { + /// Use this endpoint to simulate a test mode ReceivedDebit initiated by a third party. + /// In live mode, you can’t directly create ReceivedDebits initiated by third parties. + pub fn send( + &self, + client: &stripe::Client, + ) -> stripe::Response { + client.send_form("/test_helpers/treasury/received_debits", self, http_types::Method::Post) + } +} diff --git a/generated/stripe_treasury/src/treasury_received_debit/types.rs b/generated/stripe_treasury/src/treasury_received_debit/types.rs new file mode 100644 index 000000000..fe061ab9b --- /dev/null +++ b/generated/stripe_treasury/src/treasury_received_debit/types.rs @@ -0,0 +1,218 @@ +/// ReceivedDebits represent funds pulled from a [FinancialAccount](https://stripe.com/docs/api#financial_accounts). +/// These are not initiated from the FinancialAccount. +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct TreasuryReceivedDebit { + /// Amount (in cents) transferred. +pub amount: i64, + /// Time at which the object was created. Measured in seconds since the Unix epoch. +pub created: stripe_types::Timestamp, + /// Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. + /// Must be a [supported currency](https://stripe.com/docs/currencies). +pub currency: stripe_types::Currency, + /// An arbitrary string attached to the object. Often useful for displaying to users. +pub description: String, + /// Reason for the failure. + /// A ReceivedDebit might fail because the FinancialAccount doesn't have sufficient funds, is closed, or is frozen. +pub failure_code: Option, + /// The FinancialAccount that funds were pulled from. +pub financial_account: Option, + /// A [hosted transaction receipt](https://stripe.com/docs/treasury/moving-money/regulatory-receipts) URL that is provided when money movement is considered regulated under Stripe's money transmission licenses. +pub hosted_regulatory_receipt_url: Option, + /// Unique identifier for the object. +pub id: stripe_treasury::TreasuryReceivedDebitId, +#[serde(skip_serializing_if = "Option::is_none")] +pub initiating_payment_method_details: Option, +pub linked_flows: stripe_treasury::TreasuryReceivedDebitsResourceLinkedFlows, + /// Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. +pub livemode: bool, + /// The network used for the ReceivedDebit. +pub network: TreasuryReceivedDebitNetwork, + /// Details describing when a ReceivedDebit might be reversed. +pub reversal_details: Option, + /// Status of the ReceivedDebit. + /// ReceivedDebits are created with a status of either `succeeded` (approved) or `failed` (declined). + /// The failure reason can be found under the `failure_code`. +pub status: stripe_treasury::TreasuryReceivedDebitStatus, + /// The Transaction associated with this object. +pub transaction: Option>, + +} +/// Reason for the failure. +/// A ReceivedDebit might fail because the FinancialAccount doesn't have sufficient funds, is closed, or is frozen. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum TreasuryReceivedDebitFailureCode { + AccountClosed, + AccountFrozen, + InsufficientFunds, + Other, +} +impl TreasuryReceivedDebitFailureCode { + pub fn as_str(self) -> &'static str { + use TreasuryReceivedDebitFailureCode::*; + match self { + AccountClosed => "account_closed", + AccountFrozen => "account_frozen", + InsufficientFunds => "insufficient_funds", + Other => "other", + } + } +} + +impl std::str::FromStr for TreasuryReceivedDebitFailureCode { + type Err = (); + fn from_str(s: &str) -> Result { + use TreasuryReceivedDebitFailureCode::*; + match s { + "account_closed" => Ok(AccountClosed), + "account_frozen" => Ok(AccountFrozen), + "insufficient_funds" => Ok(InsufficientFunds), + "other" => Ok(Other), + _ => Err(()), + } + } +} +impl std::fmt::Display for TreasuryReceivedDebitFailureCode { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for TreasuryReceivedDebitFailureCode { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for TreasuryReceivedDebitFailureCode { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for TreasuryReceivedDebitFailureCode { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| { + serde::de::Error::custom("Unknown value for TreasuryReceivedDebitFailureCode") + }) + } +} +/// The network used for the ReceivedDebit. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum TreasuryReceivedDebitNetwork { + Ach, + Card, + Stripe, +} +impl TreasuryReceivedDebitNetwork { + pub fn as_str(self) -> &'static str { + use TreasuryReceivedDebitNetwork::*; + match self { + Ach => "ach", + Card => "card", + Stripe => "stripe", + } + } +} + +impl std::str::FromStr for TreasuryReceivedDebitNetwork { + type Err = (); + fn from_str(s: &str) -> Result { + use TreasuryReceivedDebitNetwork::*; + match s { + "ach" => Ok(Ach), + "card" => Ok(Card), + "stripe" => Ok(Stripe), + _ => Err(()), + } + } +} +impl std::fmt::Display for TreasuryReceivedDebitNetwork { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for TreasuryReceivedDebitNetwork { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for TreasuryReceivedDebitNetwork { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for TreasuryReceivedDebitNetwork { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s) + .map_err(|_| serde::de::Error::custom("Unknown value for TreasuryReceivedDebitNetwork")) + } +} +impl stripe_types::Object for TreasuryReceivedDebit { + type Id = stripe_treasury::TreasuryReceivedDebitId; + fn id(&self) -> &Self::Id { + &self.id + } +} +stripe_types::def_id!(TreasuryReceivedDebitId); +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum TreasuryReceivedDebitStatus { + Failed, + Succeeded, +} +impl TreasuryReceivedDebitStatus { + pub fn as_str(self) -> &'static str { + use TreasuryReceivedDebitStatus::*; + match self { + Failed => "failed", + Succeeded => "succeeded", + } + } +} + +impl std::str::FromStr for TreasuryReceivedDebitStatus { + type Err = (); + fn from_str(s: &str) -> Result { + use TreasuryReceivedDebitStatus::*; + match s { + "failed" => Ok(Failed), + "succeeded" => Ok(Succeeded), + _ => Err(()), + } + } +} +impl std::fmt::Display for TreasuryReceivedDebitStatus { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for TreasuryReceivedDebitStatus { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for TreasuryReceivedDebitStatus { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for TreasuryReceivedDebitStatus { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s) + .map_err(|_| serde::de::Error::custom("Unknown value for TreasuryReceivedDebitStatus")) + } +} diff --git a/generated/stripe_treasury/src/treasury_received_debits_resource_debit_reversal_linked_flows.rs b/generated/stripe_treasury/src/treasury_received_debits_resource_debit_reversal_linked_flows.rs new file mode 100644 index 000000000..96b31b048 --- /dev/null +++ b/generated/stripe_treasury/src/treasury_received_debits_resource_debit_reversal_linked_flows.rs @@ -0,0 +1,5 @@ +#[derive(Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct TreasuryReceivedDebitsResourceDebitReversalLinkedFlows { + /// Set if there is an Issuing dispute associated with the DebitReversal. + pub issuing_dispute: Option, +} diff --git a/generated/stripe_treasury/src/treasury_received_debits_resource_linked_flows.rs b/generated/stripe_treasury/src/treasury_received_debits_resource_linked_flows.rs new file mode 100644 index 000000000..f5f2f5e4a --- /dev/null +++ b/generated/stripe_treasury/src/treasury_received_debits_resource_linked_flows.rs @@ -0,0 +1,11 @@ +#[derive(Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct TreasuryReceivedDebitsResourceLinkedFlows { + /// The DebitReversal created as a result of this ReceivedDebit being reversed. + pub debit_reversal: Option, + /// Set if the ReceivedDebit is associated with an InboundTransfer's return of funds. + pub inbound_transfer: Option, + /// Set if the ReceivedDebit was created due to an [Issuing Authorization](https://stripe.com/docs/api#issuing_authorizations) object. + pub issuing_authorization: Option, + /// Set if the ReceivedDebit is also viewable as an [Issuing Dispute](https://stripe.com/docs/api#issuing_disputes) object. + pub issuing_transaction: Option, +} diff --git a/generated/stripe_treasury/src/treasury_received_debits_resource_reversal_details.rs b/generated/stripe_treasury/src/treasury_received_debits_resource_reversal_details.rs new file mode 100644 index 000000000..c83c17064 --- /dev/null +++ b/generated/stripe_treasury/src/treasury_received_debits_resource_reversal_details.rs @@ -0,0 +1,75 @@ +#[derive(Copy, Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct TreasuryReceivedDebitsResourceReversalDetails { + /// Time before which a ReceivedDebit can be reversed. + pub deadline: Option, + /// Set if a ReceivedDebit can't be reversed. + pub restricted_reason: Option, +} +/// Set if a ReceivedDebit can't be reversed. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum TreasuryReceivedDebitsResourceReversalDetailsRestrictedReason { + AlreadyReversed, + DeadlinePassed, + NetworkRestricted, + Other, + SourceFlowRestricted, +} +impl TreasuryReceivedDebitsResourceReversalDetailsRestrictedReason { + pub fn as_str(self) -> &'static str { + use TreasuryReceivedDebitsResourceReversalDetailsRestrictedReason::*; + match self { + AlreadyReversed => "already_reversed", + DeadlinePassed => "deadline_passed", + NetworkRestricted => "network_restricted", + Other => "other", + SourceFlowRestricted => "source_flow_restricted", + } + } +} + +impl std::str::FromStr for TreasuryReceivedDebitsResourceReversalDetailsRestrictedReason { + type Err = (); + fn from_str(s: &str) -> Result { + use TreasuryReceivedDebitsResourceReversalDetailsRestrictedReason::*; + match s { + "already_reversed" => Ok(AlreadyReversed), + "deadline_passed" => Ok(DeadlinePassed), + "network_restricted" => Ok(NetworkRestricted), + "other" => Ok(Other), + "source_flow_restricted" => Ok(SourceFlowRestricted), + _ => Err(()), + } + } +} +impl std::fmt::Display for TreasuryReceivedDebitsResourceReversalDetailsRestrictedReason { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for TreasuryReceivedDebitsResourceReversalDetailsRestrictedReason { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for TreasuryReceivedDebitsResourceReversalDetailsRestrictedReason { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> + for TreasuryReceivedDebitsResourceReversalDetailsRestrictedReason +{ + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| { + serde::de::Error::custom( + "Unknown value for TreasuryReceivedDebitsResourceReversalDetailsRestrictedReason", + ) + }) + } +} diff --git a/generated/stripe_treasury/src/treasury_received_debits_resource_status_transitions.rs b/generated/stripe_treasury/src/treasury_received_debits_resource_status_transitions.rs new file mode 100644 index 000000000..66df51d8e --- /dev/null +++ b/generated/stripe_treasury/src/treasury_received_debits_resource_status_transitions.rs @@ -0,0 +1,5 @@ +#[derive(Copy, Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct TreasuryReceivedDebitsResourceStatusTransitions { + /// Timestamp describing when the DebitReversal changed status to `completed`. + pub completed_at: Option, +} diff --git a/generated/stripe_treasury/src/treasury_shared_resource_billing_details.rs b/generated/stripe_treasury/src/treasury_shared_resource_billing_details.rs new file mode 100644 index 000000000..6c3950af7 --- /dev/null +++ b/generated/stripe_treasury/src/treasury_shared_resource_billing_details.rs @@ -0,0 +1,8 @@ +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct TreasurySharedResourceBillingDetails { + pub address: stripe_shared::Address, + /// Email address. + pub email: Option, + /// Full name. + pub name: Option, +} diff --git a/generated/stripe_treasury/src/treasury_shared_resource_initiating_payment_method_details_initiating_payment_method_details.rs b/generated/stripe_treasury/src/treasury_shared_resource_initiating_payment_method_details_initiating_payment_method_details.rs new file mode 100644 index 000000000..46ac9e487 --- /dev/null +++ b/generated/stripe_treasury/src/treasury_shared_resource_initiating_payment_method_details_initiating_payment_method_details.rs @@ -0,0 +1,156 @@ +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct TreasurySharedResourceInitiatingPaymentMethodDetailsInitiatingPaymentMethodDetails { + /// Set when `type` is `balance`. + #[serde(skip_serializing_if = "Option::is_none")] + pub balance: Option< + TreasurySharedResourceInitiatingPaymentMethodDetailsInitiatingPaymentMethodDetailsBalance, + >, + pub billing_details: stripe_treasury::TreasurySharedResourceBillingDetails, + #[serde(skip_serializing_if = "Option::is_none")] + pub financial_account: Option, + /// Set when `type` is `issuing_card`. + /// This is an [Issuing Card](https://stripe.com/docs/api#issuing_cards) ID. + #[serde(skip_serializing_if = "Option::is_none")] + pub issuing_card: Option, + /// Polymorphic type matching the originating money movement's source. + /// This can be an external account, a Stripe balance, or a FinancialAccount. + #[serde(rename = "type")] + pub type_: + TreasurySharedResourceInitiatingPaymentMethodDetailsInitiatingPaymentMethodDetailsType, + #[serde(skip_serializing_if = "Option::is_none")] + pub us_bank_account: + Option, +} +/// Set when `type` is `balance`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum TreasurySharedResourceInitiatingPaymentMethodDetailsInitiatingPaymentMethodDetailsBalance { + Payments, +} +impl TreasurySharedResourceInitiatingPaymentMethodDetailsInitiatingPaymentMethodDetailsBalance { + pub fn as_str(self) -> &'static str { + use TreasurySharedResourceInitiatingPaymentMethodDetailsInitiatingPaymentMethodDetailsBalance::*; + match self { + Payments => "payments", + } + } +} + +impl std::str::FromStr + for TreasurySharedResourceInitiatingPaymentMethodDetailsInitiatingPaymentMethodDetailsBalance +{ + type Err = (); + fn from_str(s: &str) -> Result { + use TreasurySharedResourceInitiatingPaymentMethodDetailsInitiatingPaymentMethodDetailsBalance::*; + match s { + "payments" => Ok(Payments), + _ => Err(()), + } + } +} +impl std::fmt::Display + for TreasurySharedResourceInitiatingPaymentMethodDetailsInitiatingPaymentMethodDetailsBalance +{ + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug + for TreasurySharedResourceInitiatingPaymentMethodDetailsInitiatingPaymentMethodDetailsBalance +{ + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize + for TreasurySharedResourceInitiatingPaymentMethodDetailsInitiatingPaymentMethodDetailsBalance +{ + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> + for TreasurySharedResourceInitiatingPaymentMethodDetailsInitiatingPaymentMethodDetailsBalance +{ + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for TreasurySharedResourceInitiatingPaymentMethodDetailsInitiatingPaymentMethodDetailsBalance")) + } +} +/// Polymorphic type matching the originating money movement's source. +/// This can be an external account, a Stripe balance, or a FinancialAccount. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum TreasurySharedResourceInitiatingPaymentMethodDetailsInitiatingPaymentMethodDetailsType { + Balance, + FinancialAccount, + IssuingCard, + Stripe, + UsBankAccount, +} +impl TreasurySharedResourceInitiatingPaymentMethodDetailsInitiatingPaymentMethodDetailsType { + pub fn as_str(self) -> &'static str { + use TreasurySharedResourceInitiatingPaymentMethodDetailsInitiatingPaymentMethodDetailsType::*; + match self { + Balance => "balance", + FinancialAccount => "financial_account", + IssuingCard => "issuing_card", + Stripe => "stripe", + UsBankAccount => "us_bank_account", + } + } +} + +impl std::str::FromStr + for TreasurySharedResourceInitiatingPaymentMethodDetailsInitiatingPaymentMethodDetailsType +{ + type Err = (); + fn from_str(s: &str) -> Result { + use TreasurySharedResourceInitiatingPaymentMethodDetailsInitiatingPaymentMethodDetailsType::*; + match s { + "balance" => Ok(Balance), + "financial_account" => Ok(FinancialAccount), + "issuing_card" => Ok(IssuingCard), + "stripe" => Ok(Stripe), + "us_bank_account" => Ok(UsBankAccount), + _ => Err(()), + } + } +} +impl std::fmt::Display + for TreasurySharedResourceInitiatingPaymentMethodDetailsInitiatingPaymentMethodDetailsType +{ + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug + for TreasurySharedResourceInitiatingPaymentMethodDetailsInitiatingPaymentMethodDetailsType +{ + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize + for TreasurySharedResourceInitiatingPaymentMethodDetailsInitiatingPaymentMethodDetailsType +{ + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> + for TreasurySharedResourceInitiatingPaymentMethodDetailsInitiatingPaymentMethodDetailsType +{ + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for TreasurySharedResourceInitiatingPaymentMethodDetailsInitiatingPaymentMethodDetailsType")) + } +} diff --git a/generated/stripe_treasury/src/treasury_shared_resource_initiating_payment_method_details_us_bank_account.rs b/generated/stripe_treasury/src/treasury_shared_resource_initiating_payment_method_details_us_bank_account.rs new file mode 100644 index 000000000..24ba0cdff --- /dev/null +++ b/generated/stripe_treasury/src/treasury_shared_resource_initiating_payment_method_details_us_bank_account.rs @@ -0,0 +1,9 @@ +#[derive(Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct TreasurySharedResourceInitiatingPaymentMethodDetailsUsBankAccount { + /// Bank name. + pub bank_name: Option, + /// The last four digits of the bank account number. + pub last4: Option, + /// The routing number for the bank account. + pub routing_number: Option, +} diff --git a/generated/stripe_treasury/src/treasury_transaction/mod.rs b/generated/stripe_treasury/src/treasury_transaction/mod.rs new file mode 100644 index 000000000..d8d880848 --- /dev/null +++ b/generated/stripe_treasury/src/treasury_transaction/mod.rs @@ -0,0 +1,5 @@ +#[cfg(feature = "treasury_transaction")] +mod requests; +pub(crate) mod types; +#[cfg(feature = "treasury_transaction")] +pub use requests::*; diff --git a/generated/stripe_treasury/src/treasury_transaction/requests.rs b/generated/stripe_treasury/src/treasury_transaction/requests.rs new file mode 100644 index 000000000..e9dc83b9f --- /dev/null +++ b/generated/stripe_treasury/src/treasury_transaction/requests.rs @@ -0,0 +1,145 @@ +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct ListTreasuryTransaction<'a> { + #[serde(skip_serializing_if = "Option::is_none")] + pub created: Option, + /// A cursor for use in pagination. + /// `ending_before` is an object ID that defines your place in the list. + /// For instance, if you make a list request and receive 100 objects, starting with `obj_bar`, your subsequent call can include `ending_before=obj_bar` in order to fetch the previous page of the list. + #[serde(skip_serializing_if = "Option::is_none")] + pub ending_before: Option<&'a str>, + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, + /// Returns objects associated with this FinancialAccount. + pub financial_account: &'a str, + /// A limit on the number of objects to be returned. + /// Limit can range between 1 and 100, and the default is 10. + #[serde(skip_serializing_if = "Option::is_none")] + pub limit: Option, + /// The results are in reverse chronological order by `created` or `posted_at`. + /// The default is `created`. + #[serde(skip_serializing_if = "Option::is_none")] + pub order_by: Option, + /// A cursor for use in pagination. + /// `starting_after` is an object ID that defines your place in the list. + /// For instance, if you make a list request and receive 100 objects, ending with `obj_foo`, your subsequent call can include `starting_after=obj_foo` in order to fetch the next page of the list. + #[serde(skip_serializing_if = "Option::is_none")] + pub starting_after: Option<&'a str>, + /// Only return Transactions that have the given status: `open`, `posted`, or `void`. + #[serde(skip_serializing_if = "Option::is_none")] + pub status: Option, + /// A filter for the `status_transitions.posted_at` timestamp. + /// When using this filter, `status=posted` and `order_by=posted_at` must also be specified. + #[serde(skip_serializing_if = "Option::is_none")] + pub status_transitions: Option, +} +impl<'a> ListTreasuryTransaction<'a> { + pub fn new(financial_account: &'a str) -> Self { + Self { + created: None, + ending_before: None, + expand: None, + financial_account, + limit: None, + order_by: None, + starting_after: None, + status: None, + status_transitions: None, + } + } +} +/// The results are in reverse chronological order by `created` or `posted_at`. +/// The default is `created`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum ListTreasuryTransactionOrderBy { + Created, + PostedAt, +} +impl ListTreasuryTransactionOrderBy { + pub fn as_str(self) -> &'static str { + use ListTreasuryTransactionOrderBy::*; + match self { + Created => "created", + PostedAt => "posted_at", + } + } +} + +impl std::str::FromStr for ListTreasuryTransactionOrderBy { + type Err = (); + fn from_str(s: &str) -> Result { + use ListTreasuryTransactionOrderBy::*; + match s { + "created" => Ok(Created), + "posted_at" => Ok(PostedAt), + _ => Err(()), + } + } +} +impl std::fmt::Display for ListTreasuryTransactionOrderBy { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for ListTreasuryTransactionOrderBy { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for ListTreasuryTransactionOrderBy { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +/// A filter for the `status_transitions.posted_at` timestamp. +/// When using this filter, `status=posted` and `order_by=posted_at` must also be specified. +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct ListTreasuryTransactionStatusTransitions { + /// Returns Transactions with `posted_at` within the specified range. + #[serde(skip_serializing_if = "Option::is_none")] + pub posted_at: Option, +} +impl ListTreasuryTransactionStatusTransitions { + pub fn new() -> Self { + Self::default() + } +} +impl<'a> ListTreasuryTransaction<'a> { + /// Retrieves a list of Transaction objects. + pub fn send( + &self, + client: &stripe::Client, + ) -> stripe::Response> { + client.get_query("/treasury/transactions", self) + } + pub fn paginate( + self, + ) -> stripe::ListPaginator> { + stripe::ListPaginator::from_list_params("/treasury/transactions", self) + } +} +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct RetrieveTreasuryTransaction<'a> { + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, +} +impl<'a> RetrieveTreasuryTransaction<'a> { + pub fn new() -> Self { + Self::default() + } +} +impl<'a> RetrieveTreasuryTransaction<'a> { + /// Retrieves the details of an existing Transaction. + pub fn send( + &self, + client: &stripe::Client, + id: &stripe_treasury::TreasuryTransactionId, + ) -> stripe::Response { + client.get_query(&format!("/treasury/transactions/{id}"), self) + } +} diff --git a/generated/stripe_treasury/src/treasury_transaction/types.rs b/generated/stripe_treasury/src/treasury_transaction/types.rs new file mode 100644 index 000000000..33e551d9a --- /dev/null +++ b/generated/stripe_treasury/src/treasury_transaction/types.rs @@ -0,0 +1,171 @@ +/// Transactions represent changes to a [FinancialAccount's](https://stripe.com/docs/api#financial_accounts) balance. +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct TreasuryTransaction { + /// Amount (in cents) transferred. + pub amount: i64, + pub balance_impact: stripe_treasury::TreasuryTransactionsResourceBalanceImpact, + /// Time at which the object was created. Measured in seconds since the Unix epoch. + pub created: stripe_types::Timestamp, + /// Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. + /// Must be a [supported currency](https://stripe.com/docs/currencies). + pub currency: stripe_types::Currency, + /// An arbitrary string attached to the object. Often useful for displaying to users. + pub description: String, + /// A list of TransactionEntries that are part of this Transaction. + /// This cannot be expanded in any list endpoints. + pub entries: Option>, + /// The FinancialAccount associated with this object. + pub financial_account: String, + /// ID of the flow that created the Transaction. + pub flow: Option, + /// Details of the flow that created the Transaction. + pub flow_details: Option, + /// Type of the flow that created the Transaction. + pub flow_type: TreasuryTransactionFlowType, + /// Unique identifier for the object. + pub id: stripe_treasury::TreasuryTransactionId, + /// Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + pub livemode: bool, + /// Status of the Transaction. + pub status: stripe_treasury::TreasuryTransactionStatus, + pub status_transitions: + stripe_treasury::TreasuryTransactionsResourceAbstractTransactionResourceStatusTransitions, +} +/// Type of the flow that created the Transaction. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum TreasuryTransactionFlowType { + CreditReversal, + DebitReversal, + InboundTransfer, + IssuingAuthorization, + Other, + OutboundPayment, + OutboundTransfer, + ReceivedCredit, + ReceivedDebit, +} +impl TreasuryTransactionFlowType { + pub fn as_str(self) -> &'static str { + use TreasuryTransactionFlowType::*; + match self { + CreditReversal => "credit_reversal", + DebitReversal => "debit_reversal", + InboundTransfer => "inbound_transfer", + IssuingAuthorization => "issuing_authorization", + Other => "other", + OutboundPayment => "outbound_payment", + OutboundTransfer => "outbound_transfer", + ReceivedCredit => "received_credit", + ReceivedDebit => "received_debit", + } + } +} + +impl std::str::FromStr for TreasuryTransactionFlowType { + type Err = (); + fn from_str(s: &str) -> Result { + use TreasuryTransactionFlowType::*; + match s { + "credit_reversal" => Ok(CreditReversal), + "debit_reversal" => Ok(DebitReversal), + "inbound_transfer" => Ok(InboundTransfer), + "issuing_authorization" => Ok(IssuingAuthorization), + "other" => Ok(Other), + "outbound_payment" => Ok(OutboundPayment), + "outbound_transfer" => Ok(OutboundTransfer), + "received_credit" => Ok(ReceivedCredit), + "received_debit" => Ok(ReceivedDebit), + _ => Err(()), + } + } +} +impl std::fmt::Display for TreasuryTransactionFlowType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for TreasuryTransactionFlowType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for TreasuryTransactionFlowType { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for TreasuryTransactionFlowType { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s) + .map_err(|_| serde::de::Error::custom("Unknown value for TreasuryTransactionFlowType")) + } +} +impl stripe_types::Object for TreasuryTransaction { + type Id = stripe_treasury::TreasuryTransactionId; + fn id(&self) -> &Self::Id { + &self.id + } +} +stripe_types::def_id!(TreasuryTransactionId); +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum TreasuryTransactionStatus { + Open, + Posted, + Void, +} +impl TreasuryTransactionStatus { + pub fn as_str(self) -> &'static str { + use TreasuryTransactionStatus::*; + match self { + Open => "open", + Posted => "posted", + Void => "void", + } + } +} + +impl std::str::FromStr for TreasuryTransactionStatus { + type Err = (); + fn from_str(s: &str) -> Result { + use TreasuryTransactionStatus::*; + match s { + "open" => Ok(Open), + "posted" => Ok(Posted), + "void" => Ok(Void), + _ => Err(()), + } + } +} +impl std::fmt::Display for TreasuryTransactionStatus { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for TreasuryTransactionStatus { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for TreasuryTransactionStatus { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for TreasuryTransactionStatus { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s) + .map_err(|_| serde::de::Error::custom("Unknown value for TreasuryTransactionStatus")) + } +} diff --git a/generated/stripe_treasury/src/treasury_transaction_entry/mod.rs b/generated/stripe_treasury/src/treasury_transaction_entry/mod.rs new file mode 100644 index 000000000..ceda91e27 --- /dev/null +++ b/generated/stripe_treasury/src/treasury_transaction_entry/mod.rs @@ -0,0 +1,5 @@ +#[cfg(feature = "treasury_transaction_entry")] +mod requests; +pub(crate) mod types; +#[cfg(feature = "treasury_transaction_entry")] +pub use requests::*; diff --git a/generated/stripe_treasury/src/treasury_transaction_entry/requests.rs b/generated/stripe_treasury/src/treasury_transaction_entry/requests.rs new file mode 100644 index 000000000..5e1cbf5d3 --- /dev/null +++ b/generated/stripe_treasury/src/treasury_transaction_entry/requests.rs @@ -0,0 +1,130 @@ +#[derive(Copy, Clone, Debug, serde::Serialize)] +pub struct ListTreasuryTransactionEntry<'a> { + #[serde(skip_serializing_if = "Option::is_none")] + pub created: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub effective_at: Option, + /// A cursor for use in pagination. + /// `ending_before` is an object ID that defines your place in the list. + /// For instance, if you make a list request and receive 100 objects, starting with `obj_bar`, your subsequent call can include `ending_before=obj_bar` in order to fetch the previous page of the list. + #[serde(skip_serializing_if = "Option::is_none")] + pub ending_before: Option<&'a str>, + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, + /// Returns objects associated with this FinancialAccount. + pub financial_account: &'a str, + /// A limit on the number of objects to be returned. + /// Limit can range between 1 and 100, and the default is 10. + #[serde(skip_serializing_if = "Option::is_none")] + pub limit: Option, + /// The results are in reverse chronological order by `created` or `effective_at`. + /// The default is `created`. + #[serde(skip_serializing_if = "Option::is_none")] + pub order_by: Option, + /// A cursor for use in pagination. + /// `starting_after` is an object ID that defines your place in the list. + /// For instance, if you make a list request and receive 100 objects, ending with `obj_foo`, your subsequent call can include `starting_after=obj_foo` in order to fetch the next page of the list. + #[serde(skip_serializing_if = "Option::is_none")] + pub starting_after: Option<&'a str>, + /// Only return TransactionEntries associated with this Transaction. + #[serde(skip_serializing_if = "Option::is_none")] + pub transaction: Option<&'a str>, +} +impl<'a> ListTreasuryTransactionEntry<'a> { + pub fn new(financial_account: &'a str) -> Self { + Self { + created: None, + effective_at: None, + ending_before: None, + expand: None, + financial_account, + limit: None, + order_by: None, + starting_after: None, + transaction: None, + } + } +} +/// The results are in reverse chronological order by `created` or `effective_at`. +/// The default is `created`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum ListTreasuryTransactionEntryOrderBy { + Created, + EffectiveAt, +} +impl ListTreasuryTransactionEntryOrderBy { + pub fn as_str(self) -> &'static str { + use ListTreasuryTransactionEntryOrderBy::*; + match self { + Created => "created", + EffectiveAt => "effective_at", + } + } +} + +impl std::str::FromStr for ListTreasuryTransactionEntryOrderBy { + type Err = (); + fn from_str(s: &str) -> Result { + use ListTreasuryTransactionEntryOrderBy::*; + match s { + "created" => Ok(Created), + "effective_at" => Ok(EffectiveAt), + _ => Err(()), + } + } +} +impl std::fmt::Display for ListTreasuryTransactionEntryOrderBy { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for ListTreasuryTransactionEntryOrderBy { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for ListTreasuryTransactionEntryOrderBy { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'a> ListTreasuryTransactionEntry<'a> { + /// Retrieves a list of TransactionEntry objects. + pub fn send( + &self, + client: &stripe::Client, + ) -> stripe::Response> { + client.get_query("/treasury/transaction_entries", self) + } + pub fn paginate( + self, + ) -> stripe::ListPaginator> { + stripe::ListPaginator::from_list_params("/treasury/transaction_entries", self) + } +} +#[derive(Copy, Clone, Debug, Default, serde::Serialize)] +pub struct RetrieveTreasuryTransactionEntry<'a> { + /// Specifies which fields in the response should be expanded. + #[serde(skip_serializing_if = "Option::is_none")] + pub expand: Option<&'a [&'a str]>, +} +impl<'a> RetrieveTreasuryTransactionEntry<'a> { + pub fn new() -> Self { + Self::default() + } +} +impl<'a> RetrieveTreasuryTransactionEntry<'a> { + /// Retrieves a TransactionEntry object. + pub fn send( + &self, + client: &stripe::Client, + id: &stripe_treasury::TreasuryTransactionEntryId, + ) -> stripe::Response { + client.get_query(&format!("/treasury/transaction_entries/{id}"), self) + } +} diff --git a/generated/stripe_treasury/src/treasury_transaction_entry/types.rs b/generated/stripe_treasury/src/treasury_transaction_entry/types.rs new file mode 100644 index 000000000..920eb0631 --- /dev/null +++ b/generated/stripe_treasury/src/treasury_transaction_entry/types.rs @@ -0,0 +1,223 @@ +/// TransactionEntries represent individual units of money movements within a single [Transaction](https://stripe.com/docs/api#transactions). +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct TreasuryTransactionEntry { + pub balance_impact: stripe_treasury::TreasuryTransactionsResourceBalanceImpact, + /// Time at which the object was created. Measured in seconds since the Unix epoch. + pub created: stripe_types::Timestamp, + /// Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. + /// Must be a [supported currency](https://stripe.com/docs/currencies). + pub currency: stripe_types::Currency, + /// When the TransactionEntry will impact the FinancialAccount's balance. + pub effective_at: stripe_types::Timestamp, + /// The FinancialAccount associated with this object. + pub financial_account: String, + /// Token of the flow associated with the TransactionEntry. + pub flow: Option, + /// Details of the flow associated with the TransactionEntry. + pub flow_details: Option, + /// Type of the flow associated with the TransactionEntry. + pub flow_type: TreasuryTransactionEntryFlowType, + /// Unique identifier for the object. + pub id: stripe_treasury::TreasuryTransactionEntryId, + /// Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + pub livemode: bool, + /// The Transaction associated with this object. + pub transaction: stripe_types::Expandable, + /// The specific money movement that generated the TransactionEntry. + #[serde(rename = "type")] + pub type_: TreasuryTransactionEntryType, +} +/// Type of the flow associated with the TransactionEntry. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum TreasuryTransactionEntryFlowType { + CreditReversal, + DebitReversal, + InboundTransfer, + IssuingAuthorization, + Other, + OutboundPayment, + OutboundTransfer, + ReceivedCredit, + ReceivedDebit, +} +impl TreasuryTransactionEntryFlowType { + pub fn as_str(self) -> &'static str { + use TreasuryTransactionEntryFlowType::*; + match self { + CreditReversal => "credit_reversal", + DebitReversal => "debit_reversal", + InboundTransfer => "inbound_transfer", + IssuingAuthorization => "issuing_authorization", + Other => "other", + OutboundPayment => "outbound_payment", + OutboundTransfer => "outbound_transfer", + ReceivedCredit => "received_credit", + ReceivedDebit => "received_debit", + } + } +} + +impl std::str::FromStr for TreasuryTransactionEntryFlowType { + type Err = (); + fn from_str(s: &str) -> Result { + use TreasuryTransactionEntryFlowType::*; + match s { + "credit_reversal" => Ok(CreditReversal), + "debit_reversal" => Ok(DebitReversal), + "inbound_transfer" => Ok(InboundTransfer), + "issuing_authorization" => Ok(IssuingAuthorization), + "other" => Ok(Other), + "outbound_payment" => Ok(OutboundPayment), + "outbound_transfer" => Ok(OutboundTransfer), + "received_credit" => Ok(ReceivedCredit), + "received_debit" => Ok(ReceivedDebit), + _ => Err(()), + } + } +} +impl std::fmt::Display for TreasuryTransactionEntryFlowType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for TreasuryTransactionEntryFlowType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for TreasuryTransactionEntryFlowType { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for TreasuryTransactionEntryFlowType { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| { + serde::de::Error::custom("Unknown value for TreasuryTransactionEntryFlowType") + }) + } +} +/// The specific money movement that generated the TransactionEntry. +#[derive(Copy, Clone, Eq, PartialEq)] +#[non_exhaustive] +pub enum TreasuryTransactionEntryType { + CreditReversal, + CreditReversalPosting, + DebitReversal, + InboundTransfer, + InboundTransferReturn, + IssuingAuthorizationHold, + IssuingAuthorizationRelease, + Other, + OutboundPayment, + OutboundPaymentCancellation, + OutboundPaymentFailure, + OutboundPaymentPosting, + OutboundPaymentReturn, + OutboundTransfer, + OutboundTransferCancellation, + OutboundTransferFailure, + OutboundTransferPosting, + OutboundTransferReturn, + ReceivedCredit, + ReceivedDebit, + /// An unrecognized value from Stripe. Should not be used as a request parameter. + Unknown, +} +impl TreasuryTransactionEntryType { + pub fn as_str(self) -> &'static str { + use TreasuryTransactionEntryType::*; + match self { + CreditReversal => "credit_reversal", + CreditReversalPosting => "credit_reversal_posting", + DebitReversal => "debit_reversal", + InboundTransfer => "inbound_transfer", + InboundTransferReturn => "inbound_transfer_return", + IssuingAuthorizationHold => "issuing_authorization_hold", + IssuingAuthorizationRelease => "issuing_authorization_release", + Other => "other", + OutboundPayment => "outbound_payment", + OutboundPaymentCancellation => "outbound_payment_cancellation", + OutboundPaymentFailure => "outbound_payment_failure", + OutboundPaymentPosting => "outbound_payment_posting", + OutboundPaymentReturn => "outbound_payment_return", + OutboundTransfer => "outbound_transfer", + OutboundTransferCancellation => "outbound_transfer_cancellation", + OutboundTransferFailure => "outbound_transfer_failure", + OutboundTransferPosting => "outbound_transfer_posting", + OutboundTransferReturn => "outbound_transfer_return", + ReceivedCredit => "received_credit", + ReceivedDebit => "received_debit", + Unknown => "unknown", + } + } +} + +impl std::str::FromStr for TreasuryTransactionEntryType { + type Err = (); + fn from_str(s: &str) -> Result { + use TreasuryTransactionEntryType::*; + match s { + "credit_reversal" => Ok(CreditReversal), + "credit_reversal_posting" => Ok(CreditReversalPosting), + "debit_reversal" => Ok(DebitReversal), + "inbound_transfer" => Ok(InboundTransfer), + "inbound_transfer_return" => Ok(InboundTransferReturn), + "issuing_authorization_hold" => Ok(IssuingAuthorizationHold), + "issuing_authorization_release" => Ok(IssuingAuthorizationRelease), + "other" => Ok(Other), + "outbound_payment" => Ok(OutboundPayment), + "outbound_payment_cancellation" => Ok(OutboundPaymentCancellation), + "outbound_payment_failure" => Ok(OutboundPaymentFailure), + "outbound_payment_posting" => Ok(OutboundPaymentPosting), + "outbound_payment_return" => Ok(OutboundPaymentReturn), + "outbound_transfer" => Ok(OutboundTransfer), + "outbound_transfer_cancellation" => Ok(OutboundTransferCancellation), + "outbound_transfer_failure" => Ok(OutboundTransferFailure), + "outbound_transfer_posting" => Ok(OutboundTransferPosting), + "outbound_transfer_return" => Ok(OutboundTransferReturn), + "received_credit" => Ok(ReceivedCredit), + "received_debit" => Ok(ReceivedDebit), + _ => Err(()), + } + } +} +impl std::fmt::Display for TreasuryTransactionEntryType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for TreasuryTransactionEntryType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for TreasuryTransactionEntryType { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for TreasuryTransactionEntryType { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Ok(Self::from_str(&s).unwrap_or(TreasuryTransactionEntryType::Unknown)) + } +} +impl stripe_types::Object for TreasuryTransactionEntry { + type Id = stripe_treasury::TreasuryTransactionEntryId; + fn id(&self) -> &Self::Id { + &self.id + } +} +stripe_types::def_id!(TreasuryTransactionEntryId); diff --git a/generated/stripe_treasury/src/treasury_transactions_resource_abstract_transaction_resource_status_transitions.rs b/generated/stripe_treasury/src/treasury_transactions_resource_abstract_transaction_resource_status_transitions.rs new file mode 100644 index 000000000..cf9550c30 --- /dev/null +++ b/generated/stripe_treasury/src/treasury_transactions_resource_abstract_transaction_resource_status_transitions.rs @@ -0,0 +1,7 @@ +#[derive(Copy, Clone, Debug, Default, serde::Serialize, serde::Deserialize)] +pub struct TreasuryTransactionsResourceAbstractTransactionResourceStatusTransitions { + /// Timestamp describing when the Transaction changed status to `posted`. + pub posted_at: Option, + /// Timestamp describing when the Transaction changed status to `void`. + pub void_at: Option, +} diff --git a/src/resources/generated/treasury_transactions_resource_balance_impact.rs b/generated/stripe_treasury/src/treasury_transactions_resource_balance_impact.rs similarity index 58% rename from src/resources/generated/treasury_transactions_resource_balance_impact.rs rename to generated/stripe_treasury/src/treasury_transactions_resource_balance_impact.rs index 307e2b891..13d65acb0 100644 --- a/src/resources/generated/treasury_transactions_resource_balance_impact.rs +++ b/generated/stripe_treasury/src/treasury_transactions_resource_balance_impact.rs @@ -1,19 +1,10 @@ -// ====================================== -// This file was automatically generated. -// ====================================== - -use serde::{Deserialize, Serialize}; - -/// The resource representing a Stripe "TreasuryTransactionsResourceBalanceImpact". -#[derive(Clone, Debug, Default, Deserialize, Serialize)] +/// Change to a FinancialAccount's balance +#[derive(Copy, Clone, Debug, serde::Serialize, serde::Deserialize)] pub struct TreasuryTransactionsResourceBalanceImpact { - /// The change made to funds the user can spend right now. pub cash: i64, - /// The change made to funds that are not spendable yet, but will become available at a later time. pub inbound_pending: i64, - /// The change made to funds in the account, but not spendable because they are being held for pending outbound flows. pub outbound_pending: i64, } diff --git a/generated/stripe_treasury/src/treasury_transactions_resource_flow_details.rs b/generated/stripe_treasury/src/treasury_transactions_resource_flow_details.rs new file mode 100644 index 000000000..29a4ea2ee --- /dev/null +++ b/generated/stripe_treasury/src/treasury_transactions_resource_flow_details.rs @@ -0,0 +1,100 @@ +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +pub struct TreasuryTransactionsResourceFlowDetails { + #[serde(skip_serializing_if = "Option::is_none")] + pub credit_reversal: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub debit_reversal: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub inbound_transfer: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub issuing_authorization: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub outbound_payment: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub outbound_transfer: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub received_credit: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub received_debit: Option, + /// Type of the flow that created the Transaction. Set to the same value as `flow_type`. + #[serde(rename = "type")] + pub type_: TreasuryTransactionsResourceFlowDetailsType, +} +/// Type of the flow that created the Transaction. Set to the same value as `flow_type`. +#[derive(Copy, Clone, Eq, PartialEq)] +pub enum TreasuryTransactionsResourceFlowDetailsType { + CreditReversal, + DebitReversal, + InboundTransfer, + IssuingAuthorization, + Other, + OutboundPayment, + OutboundTransfer, + ReceivedCredit, + ReceivedDebit, +} +impl TreasuryTransactionsResourceFlowDetailsType { + pub fn as_str(self) -> &'static str { + use TreasuryTransactionsResourceFlowDetailsType::*; + match self { + CreditReversal => "credit_reversal", + DebitReversal => "debit_reversal", + InboundTransfer => "inbound_transfer", + IssuingAuthorization => "issuing_authorization", + Other => "other", + OutboundPayment => "outbound_payment", + OutboundTransfer => "outbound_transfer", + ReceivedCredit => "received_credit", + ReceivedDebit => "received_debit", + } + } +} + +impl std::str::FromStr for TreasuryTransactionsResourceFlowDetailsType { + type Err = (); + fn from_str(s: &str) -> Result { + use TreasuryTransactionsResourceFlowDetailsType::*; + match s { + "credit_reversal" => Ok(CreditReversal), + "debit_reversal" => Ok(DebitReversal), + "inbound_transfer" => Ok(InboundTransfer), + "issuing_authorization" => Ok(IssuingAuthorization), + "other" => Ok(Other), + "outbound_payment" => Ok(OutboundPayment), + "outbound_transfer" => Ok(OutboundTransfer), + "received_credit" => Ok(ReceivedCredit), + "received_debit" => Ok(ReceivedDebit), + _ => Err(()), + } + } +} +impl std::fmt::Display for TreasuryTransactionsResourceFlowDetailsType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +impl std::fmt::Debug for TreasuryTransactionsResourceFlowDetailsType { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} +impl serde::Serialize for TreasuryTransactionsResourceFlowDetailsType { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} +impl<'de> serde::Deserialize<'de> for TreasuryTransactionsResourceFlowDetailsType { + fn deserialize>(deserializer: D) -> Result { + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + Self::from_str(&s).map_err(|_| { + serde::de::Error::custom( + "Unknown value for TreasuryTransactionsResourceFlowDetailsType", + ) + }) + } +} diff --git a/keys.json b/keys.json deleted file mode 100644 index 3a2ffbf91..000000000 --- a/keys.json +++ /dev/null @@ -1,619 +0,0 @@ -[ - "accept_quote", - "account_bank_account_object", - "account_card_object", - "account_create_bank_account", - "account_create_card", - "account_delete_bank_account", - "account_delete_card", - "account_link_object", - "account_links", - "account_list_bank_accounts", - "account_list_cards", - "account_object", - "account_retrieve_bank_account", - "account_retrieve_card", - "account_session_object", - "account_sessions", - "account_update_bank_account", - "account_update_card", - "accounts", - "advance_test_clock", - "all_portal_configurations", - "application_fee_object", - "application_fees", - "apply_customer_balance", - "approve_issuing_authorization", - "approve_review", - "attach_source", - "authentication", - "auto_pagination", - "balance", - "balance_object", - "balance_transaction_list", - "balance_transaction_object", - "balance_transaction_retrieve", - "balance_transactions", - "bank_accounts", - "cancel_action", - "cancel_identity_verification_session", - "cancel_inbound_transfer", - "cancel_outbound_payment", - "cancel_outbound_transfer", - "cancel_payment_intent", - "cancel_payout", - "cancel_quote", - "cancel_refund", - "cancel_setup_intent", - "cancel_subscription", - "cancel_subscription_schedule", - "cancel_topup", - "capabilities", - "capability_object", - "capture_charge", - "capture_payment_intent", - "card_object", - "cards", - "cash_balance", - "cash_balance_object", - "charge_object", - "charges", - "checkout_session_object", - "checkout_sessions", - "close_dispute", - "confirm_payment_intent", - "confirm_setup_intent", - "connected_accounts", - "country_spec_object", - "country_specs", - "coupon_object", - "coupons", - "create_account", - "create_account_link", - "create_account_session", - "create_account_token", - "create_bank_account_token", - "create_card", - "create_card_token", - "create_charge", - "create_checkout_session", - "create_configuration", - "create_coupon", - "create_credit_note", - "create_credit_reversal", - "create_customer", - "create_customer_balance_transaction", - "create_cvc_update_token", - "create_debit_reversal", - "create_fee_refund", - "create_file", - "create_file_link", - "create_financial_account", - "create_identity_verification_session", - "create_inbound_transfer", - "create_invoice", - "create_invoiceitem", - "create_issuing_card", - "create_issuing_cardholder", - "create_issuing_dispute", - "create_issuing_funding_instructions", - "create_login_link", - "create_outbound_payment", - "create_outbound_transfer", - "create_payment_intent", - "create_payment_link", - "create_payment_method", - "create_payout", - "create_person", - "create_person_token", - "create_pii_token", - "create_plan", - "create_portal_configuration", - "create_portal_session", - "create_price", - "create_product", - "create_promotion_code", - "create_quote", - "create_refund", - "create_reporting_report_run", - "create_setup_intent", - "create_shipping_rate", - "create_source", - "create_subscription", - "create_subscription_item", - "create_subscription_schedule", - "create_tax_id", - "create_tax_rate", - "create_terminal_connection_token", - "create_terminal_location", - "create_terminal_reader", - "create_test_clock", - "create_topup", - "create_transfer", - "create_transfer_reversal", - "create_value_list", - "create_value_list_item", - "create_webhook_endpoint", - "credit_note_line_item_object", - "credit_note_lines", - "credit_note_object", - "credit_note_preview_lines", - "credit_notes", - "credit_reversal_object", - "credit_reversals", - "customer_attach_payment_method", - "customer_balance_transaction_object", - "customer_balance_transactions", - "customer_bank_account_object", - "customer_cash_balance_transaction_object", - "customer_create_bank_account", - "customer_delete_bank_account", - "customer_detach_payment_method", - "customer_list_bank_accounts", - "customer_object", - "customer_portal", - "customer_retrieve_bank_account", - "customer_tax_ids", - "customer_update_bank_account", - "customer_verify_bank_account", - "customers", - "debit_reversal_object", - "debit_reversals", - "decline_issuing_authorization", - "delete_account", - "delete_card", - "delete_configuration", - "delete_coupon", - "delete_customer", - "delete_discount", - "delete_invoice", - "delete_invoiceitem", - "delete_person", - "delete_plan", - "delete_product", - "delete_secret", - "delete_subscription_discount", - "delete_subscription_item", - "delete_tax_id", - "delete_terminal_location", - "delete_terminal_reader", - "delete_test_clock", - "delete_value_list", - "delete_value_list_item", - "delete_webhook_endpoints", - "detach_source", - "discount_object", - "discounts", - "dispute_evidence_object", - "dispute_object", - "disputes", - "download_pdf_method", - "early_fraud_warning_object", - "early_fraud_warnings", - "error_handling", - "errors", - "event_object", - "event_types", - "events", - "expanding_objects", - "expire_checkout_session", - "external_accounts", - "fee_refund_object", - "fee_refunds", - "file_link_object", - "file_links", - "file_object", - "files", - "finalize_invoice", - "finalize_quote", - "financial_account_features", - "financial_account_features_object", - "financial_account_object", - "financial_accounts", - "financial_connections_account_object", - "financial_connections_accounts", - "financial_connections_create_session", - "financial_connections_disconnect_account", - "financial_connections_list_account_owners", - "financial_connections_list_accounts", - "financial_connections_list_transactions", - "financial_connections_owner_object", - "financial_connections_ownership", - "financial_connections_ownership_object", - "financial_connections_refresh_account", - "financial_connections_retrieve_account", - "financial_connections_retrieve_session", - "financial_connections_session", - "financial_connections_session_object", - "financial_connections_subscribe_account", - "financial_connections_transaction", - "financial_connections_transaction_object", - "financial_connections_unsubscribe_account", - "find_secret", - "fund_cash_balance", - "fund_issuing_funding_instruction", - "idempotent_requests", - "identity_verification_report_object", - "identity_verification_reports", - "identity_verification_session_object", - "identity_verification_sessions", - "inbound_transfer_object", - "inbound_transfers", - "increment_authorization", - "intro", - "invoice_line_item_object", - "invoice_lines", - "invoice_object", - "invoiceitem_object", - "invoiceitems", - "invoices", - "issuing_authorization_object", - "issuing_authorizations", - "issuing_card_object", - "issuing_cardholder_object", - "issuing_cardholders", - "issuing_cards", - "issuing_dispute_object", - "issuing_disputes", - "issuing_funding_instructions", - "issuing_funding_instructions_object", - "issuing_transaction_object", - "issuing_transactions", - "list_accounts", - "list_application_fees", - "list_capability", - "list_cards", - "list_cash_balance_transactions", - "list_charges", - "list_checkout_sessions", - "list_configuration", - "list_country_specs", - "list_coupons", - "list_credit_notes", - "list_credit_reversal", - "list_customer_balance_transactions", - "list_customer_payment_methods", - "list_customers", - "list_debit_reversal", - "list_disputes", - "list_early_fraud_warnings", - "list_events", - "list_fee_refunds", - "list_file_links", - "list_files", - "list_financial_account", - "list_identity_verification_report", - "list_identity_verification_session", - "list_inbound_transfer", - "list_invoiceitems", - "list_invoices", - "list_issuing_authorizations", - "list_issuing_cardholders", - "list_issuing_cards", - "list_issuing_disputes", - "list_issuing_funding_instructions", - "list_issuing_transactions", - "list_line_item", - "list_outbound_payment", - "list_outbound_transfers", - "list_payment_intents", - "list_payment_link", - "list_payment_methods", - "list_payouts", - "list_person", - "list_plans", - "list_prices", - "list_products", - "list_promotion_code", - "list_quote", - "list_received_credit", - "list_received_debit", - "list_refunds", - "list_reporting_report_run", - "list_reporting_report_type", - "list_reviews", - "list_scheduled_query_run", - "list_secret", - "list_setup_attempts", - "list_setup_intents", - "list_shipping_rates", - "list_subscription_items", - "list_subscription_schedules", - "list_subscriptions", - "list_tax_codes", - "list_tax_ids", - "list_tax_rates", - "list_terminal_hardware_product", - "list_terminal_hardware_shipping_method", - "list_terminal_locations", - "list_terminal_reader", - "list_test_clocks", - "list_topups", - "list_transaction_entries", - "list_transactions", - "list_transfer_reversals", - "list_transfers", - "list_upfront_line_item", - "list_value_list_items", - "list_value_lists", - "list_webhook_endpoints", - "login_link_object", - "mandate_object", - "mandates", - "mark_uncollectible_invoice", - "metadata", - "outbound_payment_object", - "outbound_payments", - "outbound_transfer_object", - "outbound_transfers", - "pagination", - "pay_invoice", - "payment_intent_object", - "payment_intents", - "payment_link_object", - "payment_links", - "payment_method_object", - "payment_methods", - "payout_failures", - "payout_object", - "payouts", - "person_object", - "persons", - "plan_object", - "plans", - "portal_configuration_object", - "portal_session_object", - "present_payment_method", - "preview_credit_note", - "price_object", - "prices", - "process_payment_intent", - "process_setup_intent", - "product_object", - "products", - "promotion_code_object", - "promotion_codes", - "quote_object", - "quotes", - "radar_value_list_item_object", - "radar_value_list_object", - "received_credit_object", - "received_credits", - "received_debit_object", - "received_debits", - "redact_identity_verification_session", - "refund_object", - "refunds", - "reject_account", - "release_subscription_schedule", - "reporting_report_run", - "reporting_report_run_object", - "reporting_report_type", - "reporting_report_type_object", - "request_ids", - "retrieve_account", - "retrieve_application_fee", - "retrieve_balance", - "retrieve_capability", - "retrieve_card", - "retrieve_cash_balance", - "retrieve_cash_balance_transaction", - "retrieve_charge", - "retrieve_checkout_session", - "retrieve_checkout_session_line_items", - "retrieve_configuration", - "retrieve_country_spec", - "retrieve_coupon", - "retrieve_credit_note", - "retrieve_credit_reversal", - "retrieve_customer", - "retrieve_customer_balance_transaction", - "retrieve_customer_payment_method", - "retrieve_debit_reversal", - "retrieve_dispute", - "retrieve_early_fraud_warning", - "retrieve_event", - "retrieve_fee_refund", - "retrieve_file", - "retrieve_file_link", - "retrieve_financial_account", - "retrieve_financial_account_features", - "retrieve_identity_verification_report", - "retrieve_identity_verification_session", - "retrieve_inbound_transfer", - "retrieve_invoice", - "retrieve_invoiceitem", - "retrieve_issuing_authorization", - "retrieve_issuing_card", - "retrieve_issuing_cardholder", - "retrieve_issuing_dispute", - "retrieve_issuing_transaction", - "retrieve_mandate", - "retrieve_outbound_payment", - "retrieve_outbound_transfer", - "retrieve_payment_intent", - "retrieve_payment_link", - "retrieve_payment_link_line_items", - "retrieve_payment_method", - "retrieve_payout", - "retrieve_person", - "retrieve_plan", - "retrieve_portal_configuration", - "retrieve_price", - "retrieve_product", - "retrieve_promotion_code", - "retrieve_quote", - "retrieve_received_credit", - "retrieve_received_debit", - "retrieve_refund", - "retrieve_reporting_report_run", - "retrieve_reporting_report_type", - "retrieve_review", - "retrieve_scheduled_query_run", - "retrieve_setup_intent", - "retrieve_shipping_rate", - "retrieve_source", - "retrieve_subscription", - "retrieve_subscription_item", - "retrieve_subscription_schedule", - "retrieve_tax_id", - "retrieve_tax_rate", - "retrieve_taxcode", - "retrieve_terminal_hardware_product", - "retrieve_terminal_hardware_shipping_method", - "retrieve_terminal_location", - "retrieve_terminal_reader", - "retrieve_test_clock", - "retrieve_token", - "retrieve_topup", - "retrieve_transaction", - "retrieve_transaction_entry", - "retrieve_transfer", - "retrieve_transfer_reversal", - "retrieve_value_list", - "retrieve_value_list_item", - "retrieve_webhook_endpoint", - "reverse_payout", - "review_object", - "reviews", - "scheduled_queries", - "scheduled_query_run_object", - "search_charges", - "search_customers", - "search_invoices", - "search_pagination", - "search_payment_intents", - "search_prices", - "search_products", - "secret_management", - "secret_object", - "send_invoice", - "set_reader_display", - "set_secret", - "setup_attempt_object", - "setup_attempts", - "setup_intent_object", - "setup_intents", - "shipping_rate_object", - "shipping_rates", - "source_object", - "sources", - "submit_issuing_dispute", - "subscription_item_object", - "subscription_items", - "subscription_object", - "subscription_schedule_object", - "subscription_schedules", - "subscriptions", - "subscriptions_search", - "tax_code_object", - "tax_codes", - "tax_id_object", - "tax_rate_object", - "tax_rates", - "terminal_configuration", - "terminal_configuration_object", - "terminal_connection_token_object", - "terminal_connection_tokens", - "terminal_hardware_product_object", - "terminal_hardware_products", - "terminal_hardware_shipping_method_object", - "terminal_hardware_shipping_methods", - "terminal_location_object", - "terminal_locations", - "terminal_reader_object", - "terminal_readers", - "test_clock_object", - "test_clocks", - "test_mode_create_received_credit", - "test_mode_create_received_debit", - "test_mode_deliver_physical_card", - "test_mode_fail_outbound_transfer", - "test_mode_fail_physical_card", - "test_mode_inbound_transfer_fail", - "test_mode_inbound_transfer_return", - "test_mode_inbound_transfer_succeed", - "test_mode_outbound_payment_fail", - "test_mode_outbound_payment_post", - "test_mode_outbound_payment_return", - "test_mode_post_outbound_transfer", - "test_mode_return_outbound_transfer", - "test_mode_return_physical_card", - "test_mode_ship_physical_card", - "token_object", - "tokens", - "topup_object", - "topups", - "transaction_entries", - "transaction_entry_object", - "transaction_object", - "transactions", - "transfer_object", - "transfer_reversal_object", - "transfer_reversals", - "transfers", - "upcoming_invoice", - "upcoming_invoice_lines", - "update_account", - "update_capability", - "update_card", - "update_cash_balance", - "update_charge", - "update_configuration", - "update_coupon", - "update_credit_note", - "update_customer", - "update_customer_balance_transaction", - "update_dispute", - "update_fee_refund", - "update_file_link", - "update_financial_acccount_features", - "update_financial_account", - "update_identity_verification_session", - "update_invoice", - "update_invoiceitem", - "update_issuing_authorization", - "update_issuing_card", - "update_issuing_cardholder", - "update_issuing_dispute", - "update_issuing_transaction", - "update_payment_intent", - "update_payment_link", - "update_payment_method", - "update_payout", - "update_person", - "update_plan", - "update_portal_configuration", - "update_price", - "update_product", - "update_promotion_code", - "update_quote", - "update_refund", - "update_setup_intent", - "update_shipping_rate", - "update_source", - "update_subscription", - "update_subscription_item", - "update_subscription_schedule", - "update_tax_rate", - "update_terminal_location", - "update_terminal_reader", - "update_topup", - "update_transfer", - "update_transfer_reversal", - "update_value_list", - "update_webhook_endpoint", - "usage_record_create", - "usage_record_object", - "usage_record_summary_all", - "usage_records", - "value_list_items", - "value_lists", - "verify_microdeposits_payment_intent", - "verify_microdeposits_setup_intent", - "versioning", - "void_credit_note", - "void_invoice", - "webhook_endpoint_object", - "webhook_endpoints" -] diff --git a/openapi/.gitignore b/openapi/.gitignore index d8a1d071d..71fcb2eb7 100644 --- a/openapi/.gitignore +++ b/openapi/.gitignore @@ -1,2 +1,4 @@ cache/ out/ +# For any graphviz files +*.svg \ No newline at end of file diff --git a/openapi/Cargo.toml b/openapi/Cargo.toml index 773041d2b..b03208a4c 100644 --- a/openapi/Cargo.toml +++ b/openapi/Cargo.toml @@ -2,22 +2,25 @@ name = "stripe-openapi-codegen" version = "0.1.0" authors = ["Kevin Stenerson "] -edition = "2018" +edition = "2021" # workaround for semantic-release-cargo publish = ["do-not-publish"] [dependencies] -heck = "0.3" +heck = "0.4.1" +petgraph = { version = "0.6.2", default-features = false, features = ["graphmap"] } lazy_static = "1" reqwest = { version = "0.11", features = ["blocking", "json"] } -regex = "1" -serde = {version = "1", features = ["derive"]} +regex-lite = "0.1.5" +serde = { version = "1", features = ["derive"] } serde_json = "1" +toml = "0.8.8" anyhow = "1.0.34" tracing = "0.1.36" -openapiv3 = "2" -indexmap = "2" +openapiv3 = "2.0.0" +indexmap = "2.1.0" tracing-subscriber = "0.3.15" -structopt = "0.3.26" -indoc = "1.0.7" \ No newline at end of file +tabled = "0.14.0" +clap = { version = "4.3", features = ["derive"] } +indoc = "2.0.1" \ No newline at end of file diff --git a/openapi/README.md b/openapi/README.md new file mode 100644 index 000000000..9013d486b --- /dev/null +++ b/openapi/README.md @@ -0,0 +1,72 @@ +# Code Generation +The `openapi` crates handles code generation based on the [Stripe OpenAPI spec](https://github.com/stripe/openapi) + +## Running the Binary +The main arguments of interest will be +- `--fetch`: + - `current`: Fetch the OpenAPI spec version defined in `version.json`. + - `latest`: Fetch the latest OpenAPI [release](https://github.com/stripe/openapi/releases) + - `v{}`: e.g. `v171` - A specific version found in the OpenAPI [release history](https://github.com/stripe/openapi/releases) + +Skipping the `--fetch` argument expects an already downloaded spec, useful for quicker development. + +- `--graph`: Generates graphs in `graphviz` `DOT` format to aid in understanding autogenerated code: + - `crate_graph.txt`: Map of crate dependencies + - `component_graph.txt`: Map of OpenAPI component dependencies + +`openapi` uses `clap`, so running `cargo run -- --help` will print the documentation of each argument. + +## Generated Files +- `generated/*`: Crates including both type definitions and API requests +- `stripe_types/generated/*`: Type definitions which are required by `generated/*` crates +- `stripe_webhook/generated/*`: Type definitions related to Stripe webhook event deserialization +- `crate_info.md`: A Markdown table explaining which crate contains each Stripe API object + +## Generated Crate Organization +This section is not necessary for development, but explains the rationale behind the generated crate +structure. The main annoyance in splitting the generated code into crates is that the Stripe OpenAPI +specification easily creates cyclic dependencies. +For example, a simplified definition of `BalanceTransactionSource` is +```rust +pub enum BalanceTransactionSource { + // Many more fields + IssuingAuthorization(IssuingAuthorization), + // Many more fields +} +``` +`IssuingAuthorization` then completes the cycle: +```rust +pub struct IssuingAuthorization { + // Many fields + pub balance_transactions: Vec, + // Many fields +} +``` +where `BalanceTransaction` is a struct containing a `BalanceTransactionSource` field. + +So the only way to avoid a cyclic dependency is for `BalanceTransactionSource` and `IssuingAuthorization` +to live in the same crate. + +The solution to avoiding one giant crate was to separate the OpenAPI type definitions from the request +definitions. Every type definition that would result in a cyclic dependency is contained in the +`stripe_types` crate, which contains only type definitions (which also allows it to start +much earlier in a compilation pipeline since it does not depend on the client) + +Each of the crates in `generated/*` depends on `stripe_types`. Request definitions do not +depend on each other, so each request can live behind its own feature gate, avoiding compilation +time scaling with the size of the OpenAPI spec. + +For a concrete example with `Account`: +- The type definition for `Account` is part of many cycles, so it is defined in `stripe_types`. +- The requests related to `Account` (`CreateAccount`, `UpdateAccount`, etc.) are defined in `generated/stripe_connect` and gated by the feature `account`. + - Users not needing those requests can just skip that feature or skip the entire crate if they need nothing from it. + - `Account` is also reexported in `stripe_connect` so that a user does not need to know about crate + structure, they just need to know everything related to `Account` lives in `stripe_connect` + +### Special Files +Where possible, keeping hardcoded logic in configuration files read by the code instead of the code +itself is preferred. Currently, these files are: +- `gen_crates.toml`: Specifications for the crates we generate, including which core parts of the +OpenAPI spec belong in each crate. Modifying this file is how you would change which items are included in which crate, or add additional crate splitting. +- `id_prefixes.json`: A mapping of components to the specification for the allowed prefixes of their `Id` + diff --git a/openapi/doc_urls.json b/openapi/doc_urls.json new file mode 100644 index 000000000..2840f22f0 --- /dev/null +++ b/openapi/doc_urls.json @@ -0,0 +1,84 @@ +{ + "tax_rate": "/tax_rates/object", + "scheduled_query_run": "/sigma/scheduled_queries/object", + "cash_balance": "/cash_balance/object", + "customer": "/customers/object", + "account_session": "/account_sessions/object", + "discount": "/discounts/object", + "transfer_reversal": "/transfer_reversals/object", + "price": "/prices/object", + "subscription": "/subscriptions/object", + "payout": "/payouts/object", + "payment_method_configuration": "/payment_method_configurations/object", + "dispute": "/disputes/object", + "subscription_item": "/subscription_items/object", + "identity.verification_report": "/identity/verification_reports/object", + "identity.verification_session": "/identity/verification_sessions/object", + "issuing.transaction": "/issuing/transactions/object", + "login_link": "/account/login_link", + "review": "/radar/reviews/object", + "tax.calculation": "/tax/calculations/object", + "terminal.reader": "/terminal/readers/object", + "payment_link": "/payment_links/payment_links/object", + "customer_balance_transaction": "/customer_balance_transactions/object", + "issuing.authorization": "/issuing/authorizations/object", + "product": "/products/object", + "coupon": "/coupons/object", + "setup_intent": "/setup_intents/object", + "subscription_schedule": "/subscription_schedules/object", + "application_fee": "/application_fees/object", + "terminal.connection_token": "/terminal/connection_tokens/object", + "capability": "/capabilities/object", + "radar.value_list_item": "/radar/value_list_items/object", + "refund": "/refunds/object", + "source": "/sources/object", + "reporting.report_run": "/reporting/report_run/object", + "file_link": "/file_links/object", + "payment_method_domain": "/payment_method_domains/object", + "usage_record": "/usage_records/object", + "financial_connections.session": "/financial_connections/sessions/object", + "file": "/files/object", + "inbound_transfers": "/treasury/inbound_transfers", + "tax.settings": "/tax/settings/object", + "credit_note": "/credit_notes/object", + "charge": "/charges/object", + "customer_cash_balance_transaction": "/cash_balance_transactions/object", + "fee_refund": "/fee_refunds/object", + "tax_id": "/tax_ids/object", + "plan": "/plans/object", + "issuing.dispute": "/issuing/disputes/object", + "quote": "/quotes/object", + "terminal.location": "/terminal/locations/object", + "checkout.session": "/checkout/sessions/object", + "issuing.cardholder": "/issuing/cardholders/object", + "topup": "/topups/object", + "balance": "/balance/balance_object", + "financial_connections.account": "/financial_connections/accounts/object", + "shipping_rate": "/shipping_rates/object", + "payment_intent": "/payment_intents/object", + "payment_method": "/payment_methods/object", + "tax.transaction": "/tax/transactions/object", + "promotion_code": "/promotion_codes/object", + "radar.value_list": "/radar/value_lists/object", + "account": "/accounts/object", + "webhook_endpoint": "/webhook_endpoints/object", + "credit_note_line_item": "/credit_notes/line_item", + "card": "/cards/object", + "terminal.configuration": "/terminal/configuration/object", + "reporting.report_type": "/reporting/report_type/object", + "token": "/tokens/object", + "country_spec": "/country_specs/object", + "person": "/persons/object", + "invoice": "/invoices/object", + "invoiceitem": "/invoiceitems/object", + "transfer": "/transfers/object", + "event": "/events/object", + "balance_transaction": "/balance_transactions/object", + "dispute_evidence": "/disputes/evidence_object", + "issuing.card": "/issuing/cards/object", + "mandate": "/mandates/object", + "account_link": "/account_links/object", + "setup_attempt": "/setup_attempts/object", + "issuing.token": "/issuing/tokens/object", + "tax_code": "/tax_codes/object" +} \ No newline at end of file diff --git a/openapi/gen_crates.toml b/openapi/gen_crates.toml new file mode 100644 index 000000000..1291193e3 --- /dev/null +++ b/openapi/gen_crates.toml @@ -0,0 +1,151 @@ +[[crates]] +name = "stripe_billing" +packages = ["test_helpers", "billing_portal"] +paths = [ + "credit_note", + "tax_id", + "invoice", + "item", + "plan", + "quote", + "subscription" +] +description = '''This crate provides Rust bindings to the Stripe HTTP API, specifically +for requests mentioned in the `Billing` section of the [Stripe API docs](https://stripe.com/docs/api) +''' + +[[crates]] +name = "stripe_checkout" +packages = ["checkout"] +description = '''This crate provides Rust bindings to the Stripe HTTP API, +centered around [Checkout Sessions](https://stripe.com/docs/api/checkout/sessions). +''' + +[[crates]] +name = "stripe_connect" +paths = ["country_spec", "account", "topup", "application_fee", "transfer", "application"] +packages = ["apps"] +description = '''This crate provides Rust bindings to the Stripe HTTP API, specifically +for requests mentioned in the `Connect` section of the [Stripe API docs](https://stripe.com/docs/api) +''' + +[[crates]] +name = "stripe_core" +paths = [ + "balance", + "balance_transaction", + "charge", + "customer", + "dispute", + "event", + "file", + "mandate", + "payment_intent", + "setup_intent", + "setup_attempt", + "payout", + "refund", + "token" +] +description = '''This crate provides Rust bindings to the Stripe HTTP API, specifically +for requests mentioned in the `Core Resources` section of the [Stripe API docs](https://stripe.com/docs/api) +''' + +[[crates]] +name = "stripe_fraud" +paths = ["review"] +packages = ["radar"] +description = '''This crate provides Rust bindings to the Stripe HTTP API, specifically +for requests mentioned in the `Fraud` section of the [Stripe API docs](https://stripe.com/docs/api) +''' + +[[crates]] +name = "stripe_issuing" +paths = ["funding_instructions"] +packages = ["issuing"] +description = '''This crate provides Rust bindings to the Stripe HTTP API, specifically +for requests mentioned in the `Issuing` section of the [Stripe API docs](https://stripe.com/docs/api) +''' + +[[crates]] +name = "stripe_payment" +paths = [ + "card", + "payment_method", + "source", + "bank_account", + "payment_link" +] +description = '''This crate provides Rust bindings to the Stripe HTTP API, specifically +for requests mentioned in the `Payment Methods` and `Payment Links` sections +of the [Stripe API docs](https://stripe.com/docs/api) +''' + +[[crates]] +name = "stripe_product" +paths = [ + "product", + "price", + "coupon", + "promotion_code", + "discount", + "tax_code", + "tax_rate", + "shipping_rate" +] +description = '''This crate provides Rust bindings to the Stripe HTTP API, specifically +for requests mentioned in the `Products` section of the [Stripe API docs](https://stripe.com/docs/api) +''' + +[[crates]] +name = "stripe_terminal" +packages = ["terminal"] +description = '''This crate provides Rust bindings to the Stripe HTTP API, specifically +for requests mentioned in the `Terminal` section of the [Stripe API docs](https://stripe.com/docs/api) +''' + +[[crates]] +name = "stripe_treasury" +packages = ["treasury"] +description = '''This crate provides Rust bindings to the Stripe HTTP API, specifically +for requests mentioned in the `Treasury` section of the [Stripe API docs](https://stripe.com/docs/api) +''' + +[[crates]] +name = "stripe_misc" +paths = [ + "apple_pay_domain", + "ephemeral_key", + "exchange_rate", + "webhook_endpoint" +] +packages = [ + "tax", + "identity", + "reporting", + "sigma", + "financial_connections", + "climate" +] +description = '''This crate provides Rust bindings to the Stripe HTTP API, specifically +for requests mentioned in the `Tax`, `Identity`, `Reporting`, `Sigma`, `Financial Connections` +and `Webhooks` sections of the [Stripe API docs](https://stripe.com/docs/api) +''' + +[[crates]] +name = "stripe_shared" +paths = [ + "api_errors", + "shipping", + "address", + # These should not need to be manually specified, but currently + # cannot have their crate inferred + "linked_account_options_us_bank_account", + "subscriptions_trials_resource_trial_settings", + "radar_radar_options" +] +description = '''Autogenerated types shared between stripe_* crates. If you find yourself +needing to depend on this crate, please open an issue, as all useful types should be +reexported. +''' + diff --git a/openapi/id_prefixes.json b/openapi/id_prefixes.json new file mode 100644 index 000000000..483fe9748 --- /dev/null +++ b/openapi/id_prefixes.json @@ -0,0 +1,96 @@ +{ + "account": "acct", + "application_fee": "fee", + "application": "ca", + "bank_account": [ + "ba", + "card" + ], + "balance_transaction": "txn", + "billing_portal.session": "bps", + "billing_portal.configuration": "bpc", + "card": "card", + "charge": [ + "ch", + "py" + ], + "checkout.session": "cs", + "credit_note": "cn", + "credit_note_line_item": "cnli", + "connect_collection_transfer": "connct", + "customer": "cus", + "customer_balance_transaction": "cbtxn", + "discount": "di", + "dispute": [ + "dp", + "du", + "pdp" + ], + "ephemeral_key": "ephkey", + "event": "evt", + "fee_refund": "fr", + "file": "file", + "file_link": "link", + "invoice": "in", + "invoiceitem": "ii", + "item": "li", + "issuing.dispute": "idp", + "issuing.cardholder": "ich", + "issuing.card": "ic", + "issuing.transaction": "ipi", + "issuing.authorization": "iauth", + "mandate": "mandate", + "order": "or", + "payout": "po", + "payment_intent": "pi", + "payment_link": "plink", + "payment_method": [ + "pm", + "card", + "src", + "ba" + ], + "person": "person", + "platform_tax_fee": "ptf", + "price": [ + "price", + "plan" + ], + "promotion_code": "promo", + "quote": "qt", + "review": "prv", + "refund": [ + "re", + "pyr" + ], + "reserve_transaction": "rtx", + "scheduled_query_run": "sqr", + "setup_attempt": "setatt", + "setup_intent": "seti", + "sku": "sku", + "source": "src", + "shipping_rate": "shr", + "subscription": "sub", + "subscription_item": "si", + "subscription_schedule": "sub_sched", + "tax_code": "txcd", + "tax_id": [ + "txi", + "atxi" + ], + "tax_rate": "txr", + "tax_deducted_at_source": "itds", + "terminal.reader": "tmr", + "terminal.location": "tml", + "terminal.configuration": "tmc", + "test_helpers.test_clock": "clock", + "topup": "tu", + "transfer": "tr", + "transfer_reversal": "trr", + "usage_record": "mbur", + "usage_record_summary": [ + "urs", + "sis" + ], + "webhook_endpoint": "we" +} \ No newline at end of file diff --git a/openapi/main.c b/openapi/main.c deleted file mode 100644 index 11bec8b13..000000000 --- a/openapi/main.c +++ /dev/null @@ -1,7 +0,0 @@ - -int main() -{ - int x = 1 + 1; - int y = x + x; - return y - 4; -} \ No newline at end of file diff --git a/openapi/out.log b/openapi/out.log deleted file mode 100644 index b42c21fe6..000000000 --- a/openapi/out.log +++ /dev/null @@ -1,189 +0,0 @@ - paths -> /v1/customers/{customer}/sources -> post -> requestBody -> required -> [ false :: true ] - paths -> /v1/charges/search -> get -> responses -> 200 -> content -> application/json -> schema -> required -> [ ["data","has_more","object","url"] :: ["data","has_more","next_page","object","url"] ] - paths -> /v1/products/search -> get -> responses -> 200 -> content -> application/json -> schema -> required -> [ ["data","has_more","object","url"] :: ["data","has_more","next_page","object","url"] ] - paths -> /v1/customers/search -> get -> responses -> 200 -> content -> application/json -> schema -> required -> [ ["data","has_more","object","url"] :: ["data","has_more","next_page","object","url"] ] - paths -> /v1/accounts/{account}/external_accounts -> post -> requestBody -> required -> [ false :: true ] - paths -> /v1/prices/search -> get -> responses -> 200 -> content -> application/json -> schema -> required -> [ ["data","has_more","object","url"] :: ["data","has_more","next_page","object","url"] ] - paths -> /v1/payment_intents/search -> get -> responses -> 200 -> content -> application/json -> schema -> required -> [ ["data","has_more","object","url"] :: ["data","has_more","next_page","object","url"] ] - paths -> /v1/subscriptions/search -> get -> responses -> 200 -> content -> application/json -> schema -> required -> [ ["data","has_more","object","url"] :: ["data","has_more","next_page","object","url"] ] - paths -> /v1/invoices/search -> get -> responses -> 200 -> content -> application/json -> schema -> required -> [ ["data","has_more","object","url"] :: ["data","has_more","next_page","object","url"] ] - components -> schemas -> payment_method_options_card_mandate_options -> required -> [ ["amount","amount_type","interval","reference","start_date"] :: ["amount","amount_type","description","end_date","interval","interval_count","reference","start_date","supported_types"] ] - components -> schemas -> mandate_acss_debit -> required -> [ ["payment_schedule","transaction_type"] :: ["interval_description","payment_schedule","transaction_type"] ] - components -> schemas -> payment_pages_checkout_session_automatic_tax -> required -> [ ["enabled"] :: ["enabled","status"] ] - components -> schemas -> payment_method_details_interac_present -> required -> [ ["exp_month","exp_year"] :: ["brand","cardholder_name","country","emv_auth_data","exp_month","exp_year","fingerprint","funding","generated_card","last4","network","preferred_locales","read_method","receipt"] ] - components -> schemas -> financial_connections.account -> required -> [ ["category","created","id","institution_name","livemode","object","status","subcategory","supported_payment_method_types"] :: ["account_holder","balance","balance_refresh","category","created","display_name","id","institution_name","last4","livemode","object","ownership","ownership_refresh","permissions","status","subcategory","supported_payment_method_types"] ] - components -> schemas -> charge_outcome -> required -> [ ["type"] :: ["network_status","reason","seller_message","type"] ] - components -> schemas -> reserve_transaction -> required -> [ ["amount","currency","id","object"] :: ["amount","currency","description","id","object"] ] - components -> schemas -> automatic_tax -> required -> [ ["enabled"] :: ["enabled","status"] ] - components -> schemas -> transfer -> required -> [ ["amount","amount_reversed","created","currency","id","livemode","metadata","object","reversals","reversed"] :: ["amount","amount_reversed","balance_transaction","created","currency","description","destination","id","livemode","metadata","object","reversals","reversed","source_transaction","transfer_group"] ] - components -> schemas -> source_mandate_notification -> required -> [ ["created","id","livemode","object","reason","source","status","type"] :: ["amount","created","id","livemode","object","reason","source","status","type"] ] - components -> schemas -> dispute -> required -> [ ["amount","balance_transactions","charge","created","currency","evidence","evidence_details","id","is_charge_refundable","livemode","metadata","object","reason","status"] :: ["amount","balance_transactions","charge","created","currency","evidence","evidence_details","id","is_charge_refundable","livemode","metadata","object","payment_intent","reason","status"] ] - components -> schemas -> terminal_reader_reader_resource_cart -> required -> [ ["currency","line_items","total"] :: ["currency","line_items","tax","total"] ] - components -> schemas -> apps.secret -> required -> [ ["created","id","livemode","name","object","scope"] :: ["created","expires_at","id","livemode","name","object","payload","scope"] ] - components -> schemas -> issuing_card_spending_limit -> required -> [ ["amount","interval"] :: ["amount","categories","interval"] ] - components -> schemas -> issuing_card_apple_pay -> required -> [ ["eligible"] :: ["eligible","ineligible_reason"] ] - components -> schemas -> fee_refund -> required -> [ ["amount","created","currency","fee","id","object"] :: ["amount","balance_transaction","created","currency","fee","id","metadata","object"] ] - components -> schemas -> reporting.report_type -> required -> [ ["data_available_end","data_available_start","id","livemode","name","object","updated","version"] :: ["data_available_end","data_available_start","default_columns","id","livemode","name","object","updated","version"] ] - components -> schemas -> payment_pages_checkout_session_total_details -> required -> [ ["amount_discount","amount_tax"] :: ["amount_discount","amount_shipping","amount_tax"] ] - components -> schemas -> treasury.inbound_transfer -> required -> [ ["amount","cancelable","created","currency","financial_account","id","linked_flows","livemode","metadata","object","origin_payment_method","statement_descriptor","status","status_transitions"] :: ["amount","cancelable","created","currency","description","failure_details","financial_account","hosted_regulatory_receipt_url","id","linked_flows","livemode","metadata","object","origin_payment_method","origin_payment_method_details","returned","statement_descriptor","status","status_transitions","transaction"] ] - components -> schemas -> payment_pages_checkout_session_shipping_cost -> required -> [ ["amount_subtotal","amount_tax","amount_total"] :: ["amount_subtotal","amount_tax","amount_total","shipping_rate"] ] - components -> schemas -> identity.verification_report -> required -> [ ["created","id","livemode","object","options","type"] :: ["created","id","livemode","object","options","type","verification_session"] ] - components -> schemas -> payment_method_details_card_installments_plan -> required -> [ ["type"] :: ["count","interval","type"] ] - components -> schemas -> treasury_shared_resource_billing_details -> required -> [ ["address"] :: ["address","email","name"] ] - components -> schemas -> payment_pages_checkout_session_after_expiration_recovery -> required -> [ ["allow_promotion_codes","enabled"] :: ["allow_promotion_codes","enabled","expires_at","url"] ] - components -> schemas -> recurring -> required -> [ ["interval","interval_count","usage_type"] :: ["aggregate_usage","interval","interval_count","trial_period_days","usage_type"] ] - components -> schemas -> quotes_resource_total_details -> required -> [ ["amount_discount","amount_tax"] :: ["amount_discount","amount_shipping","amount_tax"] ] - components -> schemas -> capability -> required -> [ ["account","id","object","requested","status"] :: ["account","id","object","requested","requested_at","status"] ] - components -> schemas -> payment_method_fpx -> required -> [ ["bank"] :: ["account_holder_type","bank"] ] - components -> schemas -> subscription_schedule -> required -> [ ["created","customer","default_settings","end_behavior","id","livemode","object","phases","status"] :: ["application","canceled_at","completed_at","created","current_phase","customer","default_settings","end_behavior","id","livemode","metadata","object","phases","released_at","released_subscription","status","subscription","test_clock"] ] - components -> schemas -> orders_v2_resource_transfer_data -> required -> [ ["destination"] :: ["amount","destination"] ] - components -> schemas -> token -> required -> [ ["created","id","livemode","object","type","used"] :: ["client_ip","created","id","livemode","object","type","used"] ] - components -> schemas -> credit_note_line_item -> required -> [ ["amount","discount_amount","discount_amounts","id","livemode","object","tax_amounts","tax_rates","type"] :: ["amount","amount_excluding_tax","description","discount_amount","discount_amounts","id","livemode","object","quantity","tax_amounts","tax_rates","type","unit_amount","unit_amount_decimal","unit_amount_excluding_tax"] ] - components -> schemas -> customer_tax_location -> required -> [ ["country","source"] :: ["country","source","state"] ] - components -> schemas -> dispute_evidence_details -> required -> [ ["has_evidence","past_due","submission_count"] :: ["due_by","has_evidence","past_due","submission_count"] ] - components -> schemas -> sku_inventory -> required -> [ ["type"] :: ["quantity","type","value"] ] - components -> schemas -> gelato_selfie_report -> required -> [ ["status"] :: ["document","error","selfie","status"] ] - components -> schemas -> topup -> required -> [ ["amount","created","currency","id","livemode","metadata","object","status"] :: ["amount","balance_transaction","created","currency","description","expected_availability_date","failure_code","failure_message","id","livemode","metadata","object","source","statement_descriptor","status","transfer_group"] ] - components -> schemas -> payment_intent_next_action_display_bank_transfer_instructions -> required -> [ ["type"] :: ["amount_remaining","currency","hosted_instructions_url","reference","type"] ] - components -> schemas -> issuing_cardholder_individual -> required -> [ ["first_name","last_name"] :: ["dob","first_name","last_name","verification"] ] - components -> schemas -> person_requirements -> required -> [ ["currently_due","errors","eventually_due","past_due","pending_verification"] :: ["alternatives","currently_due","errors","eventually_due","past_due","pending_verification"] ] - components -> schemas -> identity.verification_session -> required -> [ ["created","id","livemode","metadata","object","options","status","type"] :: ["client_secret","created","id","last_error","last_verification_report","livemode","metadata","object","options","redaction","status","type","url","verified_outputs"] ] - components -> schemas -> setup_attempt -> required -> [ ["created","id","livemode","object","payment_method","payment_method_details","setup_intent","status","usage"] :: ["application","created","customer","flow_directions","id","livemode","object","on_behalf_of","payment_method","payment_method_details","setup_error","setup_intent","status","usage"] ] - components -> schemas -> payment_pages_checkout_session_tax_id -> required -> [ ["type"] :: ["type","value"] ] - components -> schemas -> payment_intent_next_action_konbini -> required -> [ ["expires_at","stores"] :: ["expires_at","hosted_voucher_url","stores"] ] - components -> schemas -> subscription_schedule_add_invoice_item -> required -> [ ["price"] :: ["price","quantity"] ] - components -> schemas -> reporting.report_run -> required -> [ ["created","id","livemode","object","parameters","report_type","status"] :: ["created","error","id","livemode","object","parameters","report_type","result","status","succeeded_at"] ] - components -> schemas -> inbound_transfers_payment_method_details_us_bank_account -> required -> [ ["network"] :: ["account_holder_type","account_type","bank_name","fingerprint","last4","network","routing_number"] ] - components -> schemas -> treasury_outbound_payments_resource_outbound_payment_resource_end_user_details -> required -> [ ["present"] :: ["ip_address","present"] ] - components -> schemas -> line_item -> required -> [ ["amount","currency","discountable","id","livemode","metadata","object","period","proration","type"] :: ["amount","amount_excluding_tax","currency","description","discount_amounts","discountable","discounts","id","livemode","metadata","object","period","plan","price","proration","proration_details","quantity","subscription","type","unit_amount_excluding_tax"] ] - components -> schemas -> payment_method_details_card -> required -> [ ["exp_month","exp_year"] :: ["brand","checks","country","exp_month","exp_year","funding","installments","last4","mandate","network","three_d_secure","wallet"] ] - components -> schemas -> refund -> required -> [ ["amount","created","currency","id","object"] :: ["amount","balance_transaction","charge","created","currency","id","metadata","object","payment_intent","reason","receipt_number","source_transfer_reversal","status","transfer_reversal"] ] - components -> schemas -> usage_record_summary -> required -> [ ["id","livemode","object","period","subscription_item","total_usage"] :: ["id","invoice","livemode","object","period","subscription_item","total_usage"] ] - components -> schemas -> issuing_card_google_pay -> required -> [ ["eligible"] :: ["eligible","ineligible_reason"] ] - components -> schemas -> treasury_financial_accounts_resource_toggles_setting_status_details -> required -> [ ["code"] :: ["code","resolution"] ] - components -> schemas -> gelato_id_number_report -> required -> [ ["status"] :: ["dob","error","first_name","id_number","id_number_type","last_name","status"] ] - components -> schemas -> subscription -> required -> [ ["automatic_tax","billing_cycle_anchor","cancel_at_period_end","collection_method","created","currency","current_period_end","current_period_start","customer","id","items","livemode","metadata","object","start_date","status"] :: ["application","application_fee_percent","automatic_tax","billing_cycle_anchor","billing_thresholds","cancel_at","cancel_at_period_end","canceled_at","collection_method","created","currency","current_period_end","current_period_start","customer","days_until_due","default_payment_method","default_source","description","discount","ended_at","id","items","latest_invoice","livemode","metadata","next_pending_invoice_item_invoice","object","on_behalf_of","pause_collection","payment_settings","pending_invoice_item_interval","pending_setup_intent","pending_update","schedule","start_date","status","test_clock","transfer_data","trial_end","trial_start"] ] - components -> schemas -> deleted_application -> required -> [ ["deleted","id","object"] :: ["deleted","id","name","object"] ] - components -> schemas -> promotion_code -> required -> [ ["active","code","coupon","created","id","livemode","object","restrictions","times_redeemed"] :: ["active","code","coupon","created","customer","expires_at","id","livemode","max_redemptions","metadata","object","restrictions","times_redeemed"] ] - components -> schemas -> order -> required -> [ ["amount_subtotal","amount_total","created","currency","id","livemode","object","payment","status","total_details"] :: ["amount_subtotal","amount_total","application","billing_details","client_secret","created","currency","customer","description","discounts","id","ip_address","livemode","metadata","object","payment","shipping_cost","shipping_details","status","total_details"] ] - components -> schemas -> invoice_threshold_reason -> required -> [ ["item_reasons"] :: ["amount_gte","item_reasons"] ] - components -> schemas -> subscription_schedules_resource_default_settings -> required -> [ ["billing_cycle_anchor"] :: ["application_fee_percent","billing_cycle_anchor","billing_thresholds","collection_method","default_payment_method","description","invoice_settings","on_behalf_of","transfer_data"] ] - components -> schemas -> invoiceitem -> required -> [ ["amount","currency","customer","date","discountable","id","livemode","object","period","proration","quantity"] :: ["amount","currency","customer","date","description","discountable","discounts","id","invoice","livemode","metadata","object","period","plan","price","proration","quantity","subscription","tax_rates","test_clock","unit_amount","unit_amount_decimal"] ] - components -> schemas -> customer_balance_transaction -> required -> [ ["amount","created","currency","customer","ending_balance","id","livemode","object","type"] :: ["amount","created","credit_note","currency","customer","description","ending_balance","id","invoice","livemode","metadata","object","type"] ] - components -> schemas -> billing_portal.session -> required -> [ ["configuration","created","customer","id","livemode","object","url"] :: ["configuration","created","customer","id","livemode","locale","object","on_behalf_of","return_url","url"] ] - components -> schemas -> issuing_authorization_pending_request -> required -> [ ["amount","currency","is_amount_controllable","merchant_amount","merchant_currency"] :: ["amount","amount_details","currency","is_amount_controllable","merchant_amount","merchant_currency"] ] - components -> schemas -> invoice -> required -> [ ["amount_due","amount_paid","amount_remaining","attempt_count","attempted","automatic_tax","collection_method","created","currency","default_tax_rates","lines","livemode","object","paid","paid_out_of_band","payment_settings","period_end","period_start","post_payment_credit_notes_amount","pre_payment_credit_notes_amount","starting_balance","status_transitions","subtotal","total","total_tax_amounts"] :: ["account_country","account_name","account_tax_ids","amount_due","amount_paid","amount_remaining","application","application_fee_amount","attempt_count","attempted","automatic_tax","billing_reason","charge","collection_method","created","currency","custom_fields","customer","customer_address","customer_email","customer_name","customer_phone","customer_shipping","customer_tax_exempt","default_payment_method","default_source","default_tax_rates","description","discount","discounts","due_date","ending_balance","footer","from_invoice","last_finalization_error","latest_revision","lines","livemode","metadata","next_payment_attempt","number","object","on_behalf_of","paid","paid_out_of_band","payment_intent","payment_settings","period_end","period_start","post_payment_credit_notes_amount","pre_payment_credit_notes_amount","quote","receipt_number","rendering_options","starting_balance","statement_descriptor","status","status_transitions","subscription","subtotal","subtotal_excluding_tax","tax","test_clock","total","total_discount_amounts","total_excluding_tax","total_tax_amounts","transfer_data","webhooks_delivered_at"] ] - components -> schemas -> terminal.reader -> required -> [ ["device_type","id","label","livemode","metadata","object","serial_number"] :: ["action","device_sw_version","device_type","id","ip_address","label","livemode","location","metadata","object","serial_number","status"] ] - components -> schemas -> networks -> required -> [ ["available"] :: ["available","preferred"] ] - components -> schemas -> issuing_dispute_treasury -> required -> [ ["received_debit"] :: ["debit_reversal","received_debit"] ] - components -> schemas -> payment_method_card_wallet -> required -> [ ["type"] :: ["dynamic_last4","type"] ] - components -> schemas -> shipping_rate -> required -> [ ["active","created","id","livemode","metadata","object","type"] :: ["active","created","delivery_estimate","display_name","id","livemode","metadata","object","tax_behavior","tax_code","type"] ] - components -> schemas -> account_payout_settings -> required -> [ ["debit_negative_balances","schedule"] :: ["debit_negative_balances","schedule","statement_descriptor"] ] - components -> schemas -> subscription_schedule_phase_configuration -> required -> [ ["add_invoice_items","currency","end_date","items","proration_behavior","start_date"] :: ["add_invoice_items","application_fee_percent","billing_cycle_anchor","billing_thresholds","collection_method","coupon","currency","default_payment_method","description","end_date","invoice_settings","items","metadata","on_behalf_of","proration_behavior","start_date","transfer_data","trial_end"] ] - components -> schemas -> setup_intent_payment_method_options_card_mandate_options -> required -> [ ["amount","amount_type","currency","interval","reference","start_date"] :: ["amount","amount_type","currency","description","end_date","interval","interval_count","reference","start_date","supported_types"] ] - components -> schemas -> event -> required -> [ ["created","data","id","livemode","object","pending_webhooks","type"] :: ["api_version","created","data","id","livemode","object","pending_webhooks","request","type"] ] - components -> schemas -> outbound_payments_payment_method_details_us_bank_account -> required -> [ ["network"] :: ["account_holder_type","account_type","bank_name","fingerprint","last4","network","routing_number"] ] - components -> schemas -> application -> required -> [ ["id","object"] :: ["id","name","object"] ] - components -> schemas -> tax_id -> required -> [ ["created","id","livemode","object","type","value"] :: ["country","created","customer","id","livemode","object","type","value","verification"] ] - components -> schemas -> payment_intent -> required -> [ ["amount","capture_method","confirmation_method","created","currency","id","livemode","object","payment_method_types","status"] :: ["amount","amount_capturable","amount_received","application","application_fee_amount","automatic_payment_methods","canceled_at","cancellation_reason","capture_method","client_secret","confirmation_method","created","currency","customer","description","id","invoice","last_payment_error","livemode","metadata","next_action","object","on_behalf_of","payment_method","payment_method_options","payment_method_types","processing","receipt_email","review","setup_future_usage","shipping","source","statement_descriptor","statement_descriptor_suffix","status","transfer_data","transfer_group"] ] - components -> schemas -> card -> required -> [ ["brand","exp_month","exp_year","funding","id","last4","object"] :: ["address_city","address_country","address_line1","address_line1_check","address_line2","address_state","address_zip","address_zip_check","brand","country","cvc_check","dynamic_last4","exp_month","exp_year","funding","id","last4","metadata","name","object","tokenization_method"] ] - components -> schemas -> test_helpers.test_clock -> required -> [ ["created","deletes_after","frozen_time","id","livemode","object","status"] :: ["created","deletes_after","frozen_time","id","livemode","name","object","status"] ] - components -> schemas -> financial_connections.session -> required -> [ ["accounts","client_secret","id","livemode","object","permissions"] :: ["account_holder","accounts","client_secret","id","livemode","object","permissions"] ] - components -> schemas -> bank_account -> required -> [ ["country","currency","id","last4","object","status"] :: ["account_holder_name","account_holder_type","account_type","bank_name","country","currency","fingerprint","id","last4","object","routing_number","status"] ] - components -> schemas -> treasury.outbound_payment -> required -> [ ["amount","cancelable","created","currency","expected_arrival_date","financial_account","id","livemode","metadata","object","statement_descriptor","status","status_transitions","transaction"] :: ["amount","cancelable","created","currency","customer","description","destination_payment_method","destination_payment_method_details","end_user_details","expected_arrival_date","financial_account","hosted_regulatory_receipt_url","id","livemode","metadata","object","returned_details","statement_descriptor","status","status_transitions","transaction"] ] - components -> schemas -> customer_tax -> required -> [ ["automatic_tax"] :: ["automatic_tax","ip_address","location"] ] - components -> schemas -> orders_v2_resource_total_details -> required -> [ ["amount_discount","amount_tax"] :: ["amount_discount","amount_shipping","amount_tax"] ] - components -> schemas -> file -> required -> [ ["created","id","object","purpose","size"] :: ["created","expires_at","filename","id","object","purpose","size","title","type","url"] ] - components -> schemas -> treasury.received_credit -> required -> [ ["amount","created","currency","description","id","initiating_payment_method_details","linked_flows","livemode","network","object","status"] :: ["amount","created","currency","description","failure_code","financial_account","hosted_regulatory_receipt_url","id","initiating_payment_method_details","linked_flows","livemode","network","object","reversal_details","status","transaction"] ] - components -> schemas -> portal_login_page -> required -> [ ["enabled"] :: ["enabled","url"] ] - components -> schemas -> tax_rate -> required -> [ ["active","created","display_name","id","inclusive","livemode","object","percentage"] :: ["active","country","created","description","display_name","id","inclusive","jurisdiction","livemode","metadata","object","percentage","state","tax_type"] ] - components -> schemas -> scheduled_query_run -> required -> [ ["created","data_load_time","id","livemode","object","result_available_until","sql","status","title"] :: ["created","data_load_time","file","id","livemode","object","result_available_until","sql","status","title"] ] - components -> schemas -> treasury.received_debit -> required -> [ ["amount","created","currency","description","id","linked_flows","livemode","network","object","status"] :: ["amount","created","currency","description","failure_code","financial_account","hosted_regulatory_receipt_url","id","linked_flows","livemode","network","object","reversal_details","status","transaction"] ] - components -> schemas -> webhook_endpoint -> required -> [ ["created","enabled_events","id","livemode","metadata","object","status","url"] :: ["api_version","application","created","description","enabled_events","id","livemode","metadata","object","status","url"] ] - components -> schemas -> credit_note -> required -> [ ["amount","created","currency","customer","discount_amount","discount_amounts","id","invoice","lines","livemode","number","object","pdf","status","subtotal","tax_amounts","total","type"] :: ["amount","created","currency","customer","customer_balance_transaction","discount_amount","discount_amounts","id","invoice","lines","livemode","memo","metadata","number","object","out_of_band_amount","pdf","reason","refund","status","subtotal","subtotal_excluding_tax","tax_amounts","total","total_excluding_tax","type","voided_at"] ] - components -> schemas -> issuing_authorization_request -> required -> [ ["amount","approved","created","currency","merchant_amount","merchant_currency","reason"] :: ["amount","amount_details","approved","created","currency","merchant_amount","merchant_currency","reason","reason_message"] ] - components -> schemas -> setup_intent -> required -> [ ["created","id","livemode","object","payment_method_types","status","usage"] :: ["application","cancellation_reason","client_secret","created","customer","description","flow_directions","id","last_setup_error","latest_attempt","livemode","mandate","metadata","next_action","object","on_behalf_of","payment_method","payment_method_options","payment_method_types","single_use_mandate","status","usage"] ] - components -> schemas -> issuing_transaction_fuel_data -> required -> [ ["type","unit","unit_cost_decimal"] :: ["type","unit","unit_cost_decimal","volume_decimal"] ] - components -> schemas -> balance_transaction -> required -> [ ["amount","available_on","created","currency","fee","fee_details","id","net","object","reporting_category","status","type"] :: ["amount","available_on","created","currency","description","exchange_rate","fee","fee_details","id","net","object","reporting_category","source","status","type"] ] - components -> schemas -> quotes_resource_computed -> required -> [ ["upfront"] :: ["recurring","upfront"] ] - components -> schemas -> setup_intent_next_action_verify_with_microdeposits -> required -> [ ["arrival_date","hosted_verification_url"] :: ["arrival_date","hosted_verification_url","microdeposit_type"] ] - components -> schemas -> sku -> required -> [ ["active","attributes","created","currency","id","inventory","livemode","metadata","object","price","product","updated"] :: ["active","attributes","created","currency","id","image","inventory","livemode","metadata","object","package_dimensions","price","product","updated"] ] - components -> schemas -> treasury_financial_accounts_resource_aba_record -> required -> [ ["account_holder_name","account_number_last4","bank_name","routing_number"] :: ["account_holder_name","account_number","account_number_last4","bank_name","routing_number"] ] - components -> schemas -> terminal_reader_reader_resource_set_reader_display_action -> required -> [ ["type"] :: ["cart","type"] ] - components -> schemas -> billing_portal.configuration -> required -> [ ["active","business_profile","created","features","id","is_default","livemode","login_page","object","updated"] :: ["active","application","business_profile","created","default_return_url","features","id","is_default","livemode","login_page","metadata","object","updated"] ] - components -> schemas -> charge_transfer_data -> required -> [ ["destination"] :: ["amount","destination"] ] - components -> schemas -> customer -> required -> [ ["created","id","livemode","object"] :: ["created","default_source","description","email","id","livemode","object","shipping"] ] - components -> schemas -> deleted_discount -> required -> [ ["coupon","deleted","id","object","start"] :: ["checkout_session","coupon","customer","deleted","id","invoice","invoice_item","object","promotion_code","start","subscription"] ] - components -> schemas -> issuing.cardholder -> required -> [ ["billing","created","id","livemode","metadata","name","object","requirements","status","type"] :: ["billing","company","created","email","id","individual","livemode","metadata","name","object","phone_number","requirements","spending_controls","status","type"] ] - components -> schemas -> price -> required -> [ ["active","billing_scheme","created","currency","id","livemode","metadata","object","product","type"] :: ["active","billing_scheme","created","currency","custom_unit_amount","id","livemode","lookup_key","metadata","nickname","object","product","recurring","tax_behavior","tiers_mode","transform_quantity","type","unit_amount","unit_amount_decimal"] ] - components -> schemas -> payment_method_details_fpx -> required -> [ ["bank"] :: ["account_holder_type","bank","transaction_id"] ] - components -> schemas -> financial_connections.account_owner -> required -> [ ["id","name","object","ownership"] :: ["email","id","name","object","ownership","phone","raw_address","refreshed_at"] ] - components -> schemas -> payment_link -> required -> [ ["active","after_completion","allow_promotion_codes","automatic_tax","billing_address_collection","currency","customer_creation","id","livemode","metadata","object","payment_method_collection","phone_number_collection","shipping_options","submit_type","tax_id_collection","url"] :: ["active","after_completion","allow_promotion_codes","application_fee_amount","application_fee_percent","automatic_tax","billing_address_collection","consent_collection","currency","customer_creation","id","livemode","metadata","object","on_behalf_of","payment_intent_data","payment_method_collection","payment_method_types","phone_number_collection","shipping_address_collection","shipping_options","submit_type","subscription_data","tax_id_collection","transfer_data","url"] ] - components -> schemas -> quote -> required -> [ ["amount_subtotal","amount_total","automatic_tax","collection_method","computed","created","discounts","expires_at","id","livemode","metadata","object","status","status_transitions","subscription_data","total_details"] :: ["amount_subtotal","amount_total","application","application_fee_amount","application_fee_percent","automatic_tax","collection_method","computed","created","currency","customer","description","discounts","expires_at","footer","from_quote","header","id","invoice","invoice_settings","livemode","metadata","number","object","on_behalf_of","status","status_transitions","subscription","subscription_data","subscription_schedule","test_clock","total_details","transfer_data"] ] - components -> schemas -> checkout.session -> required -> [ ["automatic_tax","cancel_url","created","expires_at","id","livemode","mode","object","payment_method_types","payment_status","shipping_options","success_url"] :: ["after_expiration","allow_promotion_codes","amount_subtotal","amount_total","automatic_tax","billing_address_collection","cancel_url","client_reference_id","consent","consent_collection","created","currency","customer","customer_creation","customer_details","customer_email","expires_at","id","livemode","locale","metadata","mode","object","payment_intent","payment_link","payment_method_collection","payment_method_options","payment_method_types","payment_status","recovered_from","setup_intent","shipping_address_collection","shipping_cost","shipping_details","shipping_options","status","submit_type","subscription","success_url","total_details","url"] ] - components -> schemas -> treasury.transaction -> required -> [ ["amount","balance_impact","created","currency","description","financial_account","flow_type","id","livemode","object","status","status_transitions"] :: ["amount","balance_impact","created","currency","description","entries","financial_account","flow","flow_details","flow_type","id","livemode","object","status","status_transitions"] ] - components -> schemas -> person_future_requirements -> required -> [ ["currently_due","errors","eventually_due","past_due","pending_verification"] :: ["alternatives","currently_due","errors","eventually_due","past_due","pending_verification"] ] - components -> schemas -> subscription_schedule_configuration_item -> required -> [ ["price"] :: ["billing_thresholds","plan","price"] ] - components -> schemas -> source -> required -> [ ["client_secret","created","flow","id","livemode","object","status","type"] :: ["amount","client_secret","created","currency","flow","id","livemode","metadata","object","owner","statement_descriptor","status","type","usage"] ] - components -> schemas -> orders_v2_resource_shipping_cost -> required -> [ ["amount_subtotal","amount_tax","amount_total"] :: ["amount_subtotal","amount_tax","amount_total","shipping_rate"] ] - components -> schemas -> source_order -> required -> [ ["amount","currency"] :: ["amount","currency","items"] ] - components -> schemas -> payment_method_details_card_wallet -> required -> [ ["type"] :: ["dynamic_last4","type"] ] - components -> schemas -> customer_acceptance -> required -> [ ["type"] :: ["accepted_at","type"] ] - components -> schemas -> treasury.financial_account -> required -> [ ["balance","country","created","financial_addresses","id","livemode","object","status","status_details","supported_currencies"] :: ["balance","country","created","financial_addresses","id","livemode","metadata","object","status","status_details","supported_currencies"] ] - components -> schemas -> treasury.debit_reversal -> required -> [ ["amount","created","currency","id","livemode","metadata","network","object","received_debit","status","status_transitions"] :: ["amount","created","currency","financial_account","hosted_regulatory_receipt_url","id","linked_flows","livemode","metadata","network","object","received_debit","status","status_transitions","transaction"] ] - components -> schemas -> payment_links_resource_transfer_data -> required -> [ ["destination"] :: ["amount","destination"] ] - components -> schemas -> customer_balance_resource_cash_balance_transaction_resource_funded_transaction_resource_bank_transfer -> required -> [ ["type"] :: ["reference","type"] ] - components -> schemas -> tax_id_verification -> required -> [ ["status"] :: ["status","verified_address","verified_name"] ] - components -> schemas -> payment_method_card -> required -> [ ["brand","exp_month","exp_year","funding","last4"] :: ["brand","checks","country","exp_month","exp_year","funding","last4","networks","three_d_secure_usage","wallet"] ] - components -> schemas -> issuing_card_wallets -> required -> [ ["apple_pay","google_pay"] :: ["apple_pay","google_pay","primary_account_identifier"] ] - components -> schemas -> issuing.dispute -> required -> [ ["amount","created","currency","evidence","id","livemode","metadata","object","status","transaction"] :: ["amount","balance_transactions","created","currency","evidence","id","livemode","metadata","object","status","transaction"] ] - components -> schemas -> terminal.configuration -> required -> [ ["id","livemode","object"] :: ["id","is_account_default","livemode","object"] ] - components -> schemas -> source_receiver_flow -> required -> [ ["amount_charged","amount_received","amount_returned","refund_attributes_method","refund_attributes_status"] :: ["address","amount_charged","amount_received","amount_returned","refund_attributes_method","refund_attributes_status"] ] - components -> schemas -> portal_subscription_update -> required -> [ ["default_allowed_updates","enabled","proration_behavior"] :: ["default_allowed_updates","enabled","products","proration_behavior"] ] - components -> schemas -> fee -> required -> [ ["amount","currency","type"] :: ["amount","application","currency","description","type"] ] - components -> schemas -> treasury.transaction_entry -> required -> [ ["balance_impact","created","currency","effective_at","financial_account","flow_type","id","livemode","object","transaction","type"] :: ["balance_impact","created","currency","effective_at","financial_account","flow","flow_details","flow_type","id","livemode","object","transaction","type"] ] - components -> schemas -> orders_v2_resource_tax_details_resource_tax_id -> required -> [ ["type"] :: ["type","value"] ] - components -> schemas -> outbound_transfers_payment_method_details_us_bank_account -> required -> [ ["network"] :: ["account_holder_type","account_type","bank_name","fingerprint","last4","network","routing_number"] ] - components -> schemas -> promotion_codes_resource_restrictions -> required -> [ ["first_time_transaction"] :: ["first_time_transaction","minimum_amount","minimum_amount_currency"] ] - components -> schemas -> issuing_authorization_merchant_data -> required -> [ ["category","category_code","network_id"] :: ["category","category_code","city","country","name","network_id","postal_code","state"] ] - components -> schemas -> quotes_resource_automatic_tax -> required -> [ ["enabled"] :: ["enabled","status"] ] - components -> schemas -> issuing_authorization_treasury -> required -> [ ["received_credits","received_debits"] :: ["received_credits","received_debits","transaction"] ] - components -> schemas -> terminal_reader_reader_resource_reader_action -> required -> [ ["status","type"] :: ["failure_code","failure_message","status","type"] ] - components -> schemas -> review -> required -> [ ["created","id","livemode","object","open","opened_reason","reason"] :: ["billing_zip","charge","closed_reason","created","id","ip_address","ip_address_location","livemode","object","open","opened_reason","reason","session"] ] - components -> schemas -> quotes_resource_transfer_data -> required -> [ ["destination"] :: ["amount","amount_percent","destination"] ] - components -> schemas -> issuing.card -> required -> [ ["brand","cardholder","created","currency","exp_month","exp_year","id","last4","livemode","metadata","object","spending_controls","status","type"] :: ["brand","cancellation_reason","cardholder","created","currency","exp_month","exp_year","id","last4","livemode","metadata","object","replaced_by","replacement_for","replacement_reason","shipping","spending_controls","status","type","wallets"] ] - components -> schemas -> person -> required -> [ ["account","created","id","object"] :: ["created","id","object"] ] - components -> schemas -> payment_method -> required -> [ ["billing_details","created","id","livemode","object","type"] :: ["billing_details","created","customer","id","livemode","metadata","object","type"] ] - components -> schemas -> payment_intent_next_action_verify_with_microdeposits -> required -> [ ["arrival_date","hosted_verification_url"] :: ["arrival_date","hosted_verification_url","microdeposit_type"] ] - components -> schemas -> source_redirect_flow -> required -> [ ["return_url","status","url"] :: ["failure_reason","return_url","status","url"] ] - components -> schemas -> charge -> required -> [ ["amount","amount_captured","amount_refunded","billing_details","captured","created","currency","disputed","id","livemode","metadata","object","paid","refunded","status"] :: ["amount","amount_captured","amount_refunded","application","application_fee","application_fee_amount","balance_transaction","billing_details","calculated_statement_descriptor","captured","created","currency","customer","description","destination","dispute","disputed","failure_balance_transaction","failure_code","failure_message","fraud_details","id","invoice","livemode","metadata","object","on_behalf_of","outcome","paid","payment_intent","payment_method","payment_method_details","receipt_email","receipt_number","receipt_url","refunded","review","shipping","source","source_transfer","statement_descriptor","statement_descriptor_suffix","status","transfer_data","transfer_group"] ] - components -> schemas -> file_link -> required -> [ ["created","expired","file","id","livemode","metadata","object"] :: ["created","expired","expires_at","file","id","livemode","metadata","object","url"] ] - components -> schemas -> plan -> required -> [ ["active","billing_scheme","created","currency","id","interval","interval_count","livemode","object","usage_type"] :: ["active","aggregate_usage","amount","amount_decimal","billing_scheme","created","currency","id","interval","interval_count","livemode","metadata","nickname","object","product","tiers_mode","transform_usage","trial_period_days","usage_type"] ] - components -> schemas -> cash_balance -> required -> [ ["customer","livemode","object","settings"] :: ["available","customer","livemode","object","settings"] ] - components -> schemas -> subscription_item -> required -> [ ["created","id","metadata","object","price","subscription"] :: ["billing_thresholds","created","id","metadata","object","plan","price","subscription","tax_rates"] ] - components -> schemas -> product -> required -> [ ["active","created","id","images","livemode","metadata","name","object","updated"] :: ["active","attributes","created","description","id","images","livemode","metadata","name","object","package_dimensions","shippable","tax_code","type","updated","url"] ] - components -> schemas -> coupon -> required -> [ ["created","duration","id","livemode","object","times_redeemed","valid"] :: ["amount_off","created","currency","duration","duration_in_months","id","livemode","max_redemptions","metadata","name","object","percent_off","redeem_by","times_redeemed","valid"] ] - components -> schemas -> subscriptions_resource_pause_collection -> required -> [ ["behavior"] :: ["behavior","resumes_at"] ] - components -> schemas -> gelato_document_report -> required -> [ ["status"] :: ["address","dob","error","expiration_date","files","first_name","issued_date","issuing_country","last_name","number","status","type"] ] - components -> schemas -> subscription_transfer_data -> required -> [ ["destination"] :: ["amount_percent","destination"] ] - components -> schemas -> refund_next_action -> required -> [ ["type"] :: ["display_details","type"] ] - components -> schemas -> treasury.outbound_transfer -> required -> [ ["amount","cancelable","created","currency","destination_payment_method_details","expected_arrival_date","financial_account","id","livemode","metadata","object","statement_descriptor","status","status_transitions","transaction"] :: ["amount","cancelable","created","currency","description","destination_payment_method","destination_payment_method_details","expected_arrival_date","financial_account","hosted_regulatory_receipt_url","id","livemode","metadata","object","returned_details","statement_descriptor","status","status_transitions","transaction"] ] - components -> schemas -> account_capability_requirements -> required -> [ ["currently_due","errors","eventually_due","past_due","pending_verification"] :: ["alternatives","current_deadline","currently_due","disabled_reason","errors","eventually_due","past_due","pending_verification"] ] - components -> schemas -> item -> required -> [ ["amount_discount","amount_subtotal","amount_tax","amount_total","currency","description","id","object"] :: ["amount_discount","amount_subtotal","amount_tax","amount_total","currency","description","id","object","price","quantity"] ] - components -> schemas -> orders_v2_resource_automatic_tax -> required -> [ ["enabled"] :: ["enabled","status"] ] - components -> schemas -> us_bank_account_networks -> required -> [ ["supported"] :: ["preferred","supported"] ] - components -> schemas -> subscriptions_resource_pending_update -> required -> [ ["expires_at"] :: ["billing_cycle_anchor","expires_at","subscription_items","trial_end","trial_from_plan"] ] - components -> schemas -> issuing_card_shipping -> required -> [ ["address","name","service","type"] :: ["address","carrier","customs","eta","name","phone_number","require_signature","service","status","tracking_number","tracking_url","type"] ] - components -> schemas -> discount -> required -> [ ["coupon","id","object","start"] :: ["checkout_session","coupon","customer","end","id","invoice","invoice_item","object","promotion_code","start","subscription"] ] - components -> schemas -> payment_method_options_card_installments -> required -> [ ["enabled"] :: ["available_plans","enabled","plan"] ] - components -> schemas -> issuing.transaction -> required -> [ ["amount","card","created","currency","id","livemode","merchant_amount","merchant_currency","merchant_data","metadata","object","type"] :: ["amount","amount_details","authorization","balance_transaction","card","cardholder","created","currency","dispute","id","livemode","merchant_amount","merchant_currency","merchant_data","metadata","object","purchase_details","type","wallet"] ] - components -> schemas -> payment_method_details_card_present -> required -> [ ["exp_month","exp_year","incremental_authorization_supported","overcapture_supported"] :: ["amount_authorized","brand","cardholder_name","country","emv_auth_data","exp_month","exp_year","fingerprint","funding","generated_card","incremental_authorization_supported","last4","network","overcapture_supported","read_method","receipt"] ] - components -> schemas -> issuing.authorization -> required -> [ ["amount","approved","authorization_method","balance_transactions","card","created","currency","id","livemode","merchant_amount","merchant_currency","merchant_data","metadata","object","request_history","status","transactions","verification_data"] :: ["amount","amount_details","approved","authorization_method","balance_transactions","card","cardholder","created","currency","id","livemode","merchant_amount","merchant_currency","merchant_data","metadata","network_data","object","pending_request","request_history","status","transactions","verification_data","wallet"] ] - components -> schemas -> account_capability_future_requirements -> required -> [ ["currently_due","errors","eventually_due","past_due","pending_verification"] :: ["alternatives","current_deadline","currently_due","disabled_reason","errors","eventually_due","past_due","pending_verification"] ] - components -> schemas -> treasury.credit_reversal -> required -> [ ["amount","created","currency","financial_account","id","livemode","metadata","network","object","received_credit","status","status_transitions"] :: ["amount","created","currency","financial_account","hosted_regulatory_receipt_url","id","livemode","metadata","network","object","received_credit","status","status_transitions","transaction"] ] - components -> schemas -> transfer_reversal -> required -> [ ["amount","created","currency","id","object","transfer"] :: ["amount","balance_transaction","created","currency","destination_payment_refund","id","metadata","object","source_refund","transfer"] ] - components -> schemas -> issuing_cardholder_spending_limit -> required -> [ ["amount","interval"] :: ["amount","categories","interval"] ] - components -> schemas -> invoice_transfer_data -> required -> [ ["destination"] :: ["amount","destination"] ] - components -> schemas -> payout -> required -> [ ["amount","arrival_date","automatic","created","currency","id","livemode","method","object","source_type","status","type"] :: ["amount","arrival_date","automatic","balance_transaction","created","currency","description","destination","failure_balance_transaction","failure_code","failure_message","id","livemode","metadata","method","object","original_payout","reversed_by","source_type","statement_descriptor","status","type"] ] - components -> schemas -> application_fee -> required -> [ ["account","amount","amount_refunded","application","charge","created","currency","id","livemode","object","refunded","refunds"] :: ["account","amount","amount_refunded","application","balance_transaction","charge","created","currency","id","livemode","object","originating_transaction","refunded","refunds"] ] - components -> schemas -> invoices_resource_invoice_tax_id -> required -> [ ["type"] :: ["type","value"] ] diff --git a/openapi/src/codegen.rs b/openapi/src/codegen.rs index 4b1f85ac1..0d4935ad9 100644 --- a/openapi/src/codegen.rs +++ b/openapi/src/codegen.rs @@ -1,1590 +1,208 @@ -use std::borrow::Borrow; -use std::collections::{BTreeMap, BTreeSet, HashMap}; use std::fmt::Write as _; +use std::path::PathBuf; -use heck::{CamelCase, SnakeCase}; -use indoc::writedoc; -use openapiv3::{ - AdditionalProperties, Parameter, ParameterSchemaOrContent, PathStyle, ReferenceOr, Schema, - SchemaKind, Type, -}; -use tracing::trace; +use anyhow::Context; +use indoc::formatdoc; -use crate::spec::{ - as_any_of_first_item_title, as_data_array_item, as_enum_strings, as_first_enum_value, - as_object_enum_name, as_object_properties, as_object_type, err_schema_expected, - find_param_by_name, get_id_param, get_ok_response, get_ok_response_schema, - get_request_form_parameters, non_path_ref_params, ExpansionResources, -}; -use crate::util::{print_doc_from_schema, write_serde_rename}; -use crate::{ - file_generator::FileGenerator, - metadata::Metadata, - types::{ - InferredEnum, InferredObject, InferredParams, InferredStruct, InferredUnion, MethodTypes, - TypeError, - }, - url_finder::UrlFinder, - util::{infer_integer_type, print_doc_comment, write_out_field}, -}; - -#[tracing::instrument(skip_all, fields(name = %state.name))] -pub fn gen_struct( - out: &mut String, - state: &mut FileGenerator, - meta: &Metadata, - - shared_objects: &mut BTreeSet, - url_finder: &UrlFinder, -) { - let name = state.name.clone(); - let object = &name; - - let id_type = meta.schema_to_id_type(object); - let struct_name = meta.schema_to_rust_type(object); - let schema = meta.spec.get_schema_unwrapped(object).as_item().expect("Expected item"); - let obj = as_object_type(schema).expect("Expected object type"); - let schema_title = schema.schema_data.title.as_ref().unwrap_or_else(|| { - tracing::warn!("{} has no title", object); - &object - }); - - let deleted_schema = meta.spec.component_schemas().get(&format!("deleted_{}", object)); - let deleted_properties = - deleted_schema.and_then(|schema| schema.as_item()).and_then(as_object_properties); - - trace!("struct {} {{...}} ({})", struct_name, name); - - // Generate the struct type - out.push_str("/// The resource representing a Stripe \""); - out.push_str(schema_title); - out.push_str("\".\n"); - if let Some(doc_url) = url_finder.url_for_object(object) { - out.push_str("///\n"); - out.push_str("/// For more details see <"); - out.push_str(&doc_url); - out.push_str(">\n"); - } - out.push_str("#[derive(Clone, Debug, Default, Deserialize, Serialize)]\n"); - out.push_str("pub struct "); - out.push_str(&struct_name); - out.push_str(" {\n"); - if let Some((id_type, _)) = &id_type { - state.use_ids.insert(id_type.clone()); - if let Some(doc) = obj - .properties - .get("id") - .and_then(|id| id.as_item().and_then(|i| i.schema_data.description.as_ref())) - { - print_doc_comment(out, doc, 1); - } - if id_type == "InvoiceId" { - out.push_str(" #[serde(default = \"InvoiceId::none\")]"); - } - out.push_str(" pub id: "); - out.push_str(id_type); - out.push_str(",\n"); - } - - let mut did_emit_deleted = false; - for (key, field) in obj - .properties - .iter() - // we handle id and object separately - .filter(|(key, _)| !["id", "object"].contains(&key.as_str())) - { - // emit deleted in the appropirate place alphabetically - if !did_emit_deleted - && deleted_schema.is_some() - && key.as_str().cmp("deleted") == std::cmp::Ordering::Greater - { - out.push('\n'); - out.push_str(" // Always true for a deleted object\n"); - out.push_str(" #[serde(default)]\n"); - out.push_str(" pub deleted: bool,\n"); - did_emit_deleted = true; - } - - // in the required list and not in the deleted list - let required = obj.required.contains(key) - && deleted_properties.map(|map| map.contains_key(key)).unwrap_or(true); - - out.push('\n'); - out.push_str(&gen_field(state, meta, object, key, field, required, false, shared_objects)); - } - out.push_str("}\n"); -} - -#[tracing::instrument(skip_all)] -pub fn gen_prelude(state: &FileGenerator, meta: &Metadata) -> String { - let name = state.name.clone(); - let object = &name; - - let mut prelude = String::new(); - prelude.push_str("// ======================================\n"); - prelude.push_str("// This file was automatically generated.\n"); - prelude.push_str("// ======================================\n\n"); - if !state.use_config.is_empty() { - prelude.push_str("use crate::client::{"); - for (n, type_) in state.use_config.iter().enumerate() { - if n > 0 { - prelude.push_str(", "); - } - prelude.push_str(type_); - } - prelude.push_str("};\n"); - } - if !state.use_ids.is_empty() { - prelude.push_str("use crate::ids::{"); - for (n, type_) in state.use_ids.iter().enumerate() { - if n > 0 { - prelude.push_str(", "); - } - prelude.push_str(type_); - } - prelude.push_str("};\n"); - } - if !state.use_params.is_empty() { - prelude.push_str("use crate::params::{"); - for (n, type_) in state.use_params.iter().enumerate() { - if n > 0 { - prelude.push_str(", "); - } - prelude.push_str(type_); - } - prelude.push_str("};\n"); - } - if !state.use_resources.is_empty() { - prelude.push_str("use crate::resources::{"); - for (n, type_) in state - .use_resources - .iter() - .filter(|&x| { - state.generated_schemas.keys().all(|sch| x != &meta.schema_to_rust_type(sch)) - && !state.inferred_parameters.contains_key(x) - && !state.inferred_structs.contains_key(x) - && !state.inferred_unions.contains_key(x) - && !state.inferred_enums.contains_key(x) - && x != &meta.schema_to_rust_type(object) - }) - .enumerate() - { - if n > 0 { - prelude.push_str(", "); - } - prelude.push_str(type_); - } - prelude.push_str("};\n"); - } - prelude.push_str("use serde::{Deserialize, Serialize};\n"); - prelude.push('\n'); - prelude -} - -#[tracing::instrument(skip_all)] -pub fn gen_generated_schemas( - out: &mut String, - state: &mut FileGenerator, - meta: &Metadata, - shared_objects: &mut BTreeSet, -) { - while let Some(schema_name) = - state.generated_schemas.iter().find_map(|(k, &v)| if !v { Some(k) } else { None }).cloned() - { - let struct_name = meta.schema_to_rust_type(&schema_name); - trace!("struct {} {{...}} ({})", struct_name, schema_name); - out.push('\n'); - out.push_str("#[derive(Clone, Debug, Default, Deserialize, Serialize)]\n"); - out.push_str("pub struct "); - out.push_str(&struct_name); - out.push_str(" {\n"); - - let schema = meta.spec.get_schema_unwrapped(&schema_name).as_item().expect("Expected item"); - let obj_type = as_object_type(schema).expect("Expected object type schema"); - for (key, field) in &obj_type.properties { - let required = obj_type.required.contains(key); - out.push('\n'); - out.push_str(&gen_field( - state, - meta, - &schema_name, - key, - field, - required, - false, - shared_objects, - )); - } - out.push_str("}\n"); - - // Set the schema to generated - *state.generated_schemas.entry(schema_name).or_default() = true; - } -} - -#[tracing::instrument(skip_all)] -pub fn gen_multitype_params( - parent_struct_rust_type: &str, - param_name: &str, - param: &Parameter, - initializers: &mut Vec<(String, String, bool)>, - required: bool, - state: &mut FileGenerator, - meta: &Metadata, - out: &mut String, -) { - let member_schema = match ¶m.parameter_data_ref().format { - ParameterSchemaOrContent::Schema(ReferenceOr::Item(s)) => s, - _ => panic!("Expected schema content"), - }; - match gen_member_variable_string(member_schema) { - Ok(type_) => { - initializers.push((param_name.into(), type_.clone(), required)); - write_out_field(out, param_name, &type_, required); - } - Err(TypeError::NoType) => { - //Weird case, found with anyOf so only case we are handling - //at the current moment - if let SchemaKind::AnyOf { .. } = &member_schema.schema_kind { - let union_addition = format!("{param_name}_union"); - let mut new_type_name = parent_struct_rust_type.to_owned(); - new_type_name.push_str(&meta.schema_to_rust_type(&union_addition)); - - let inferred_object = InferredObject { - rust_type: new_type_name.clone(), - schema: member_schema.clone(), - }; - state.generated_objects.insert(new_type_name.clone(), inferred_object); - initializers.push((param_name.into(), new_type_name.clone(), required)); - write_out_field(out, param_name, &new_type_name, required); - } else { - panic!("Strange case, haven't handled this yet: {:#?}", member_schema); - } - } - Err(TypeError::IsObject) => { - let new_type_name = - member_schema.schema_data.title.as_ref().map(|s| s.to_camel_case()).unwrap_or_else( - || format!("{}{}Info", parent_struct_rust_type, param_name.to_camel_case()), - ); - - let inferred_object = - InferredObject { rust_type: new_type_name.clone(), schema: member_schema.clone() }; - state.generated_objects.insert(new_type_name.clone(), inferred_object); - initializers.push((param_name.into(), new_type_name.clone(), required)); - write_out_field(out, param_name, &new_type_name, required); - } - _ => { - panic!("Don't recognize this: {:#?}", member_schema); - } - } -} - -#[tracing::instrument(skip_all)] -pub fn gen_inferred_params( - out: &mut String, - state: &mut FileGenerator, - meta: &Metadata, - shared_objects: &mut BTreeSet, -) { - let object = state.name.clone(); - let id_type = meta.schema_to_id_type(&object); - let struct_name = meta.schema_to_rust_type(&object); - - for (_, params) in state.inferred_parameters.clone() { - let params_schema = params.rust_type.to_snake_case(); - - // Derive Default when no param is required - let can_derive_default = - params.parameters.iter().all(|param| !param.parameter_data_ref().required); - - out.push('\n'); - out.push_str(&format!("/// The parameters for `{}::{}`.\n", struct_name, params.method)); - - if can_derive_default { - out.push_str("#[derive(Clone, Debug, Serialize, Default)]\n"); - } else { - out.push_str("#[derive(Clone, Debug, Serialize)]\n"); - } - - trace!("struct {} {{...}}", ¶ms.rust_type); - - out.push_str("pub struct "); - out.push_str(¶ms.rust_type); - out.push_str("<'a> {\n"); - let mut initializers: Vec<(String, String, bool)> = Vec::new(); - for param in params.parameters.iter().filter(|p| matches!(p, Parameter::Query { .. })) { - let param_name = param.parameter_data_ref().name.as_str(); - let param_rename = match param_name { - "type" => "type_", - other => other, - }; - let print_doc = |out: &mut String| { - out.push('\n'); - if let Some(doc) = ¶m.parameter_data_ref().description { - print_doc_comment(out, doc, 1); - } - if param_rename != param_name { - write_serde_rename(out, param_name); - } - }; - let required = param.parameter_data_ref().required; - match param_name { - // TODO: Handle these unusual params - "bank_account" | "usage" => continue, - "destination" | "card" => { - print_doc(out); - gen_multitype_params( - ¶ms.rust_type, - param_name, - param, - &mut initializers, - required, - state, - meta, - out, - ); - } - "product" => { - print_doc(out); - initializers.push(( - "product".into(), - "IdOrCreate<'a, CreateProduct<'a>>".into(), - required, - )); - state.use_params.insert("IdOrCreate"); - state.use_resources.insert("CreateProduct".to_owned()); - write_out_field(out, "product", "IdOrCreate<'a, CreateProduct<'a>>", required); - } - "metadata" => { - print_doc(out); - initializers.push(("metadata".into(), "Metadata".into(), required)); - state.use_params.insert("Metadata"); - write_out_field(out, "metadata", "Metadata", required); - } - "expand" => { - print_doc(out); - initializers.push(("expand".into(), "&'a [&'a str]".into(), false)); - state.use_params.insert("Expand"); - out.push_str(" #[serde(skip_serializing_if = \"Expand::is_empty\")]\n"); - out.push_str(" pub expand: &'a [&'a str],\n"); - } - "limit" => { - print_doc(out); - initializers.push(("limit".into(), "u64".into(), false)); - write_out_field(out, "limit", "u64", required); - } - "ending_before" => { - print_doc(out); - let cursor_type = - id_type.as_ref().map(|(x, _)| x.as_str()).unwrap_or("&'a str"); - initializers.push(("ending_before".into(), cursor_type.into(), false)); - if required { - panic!("unexpected \"required\" `ending_before` parameter"); - } else { - write_out_field(out, "ending_before", cursor_type, false); - } - } - "starting_after" => { - print_doc(out); - let cursor_type = - id_type.as_ref().map(|(x, _)| x.as_str()).unwrap_or("&'a str"); - initializers.push(("starting_after".into(), cursor_type.into(), false)); - if required { - panic!("unexpected \"required\" `starting_after` parameter"); - } else { - write_out_field(out, "starting_after", cursor_type, false); - } - } - _ => { - let schema = match ¶m.parameter_data_ref().format { - ParameterSchemaOrContent::Schema(s) => s, - ParameterSchemaOrContent::Content(_) => panic!("Expected schema"), - }; - let kind = schema.as_item().map(|s| &s.schema_kind); - let is_string_schema = matches!(kind, Some(SchemaKind::Type(Type::String(_)))); - if let Some((use_path, rust_type)) = - meta.field_to_rust_type(params_schema.as_str(), param_name) - { - print_doc(out); - initializers.push((param_rename.into(), rust_type.to_string(), required)); - state.add_use(use_path); - if rust_type.starts_with("Option<") { - out.push_str( - " #[serde(skip_serializing_if = \"Option::is_none\")]\n", - ); - } - out.push_str(" pub "); - out.push_str(param_rename); - out.push_str(": "); - out.push_str(rust_type); - out.push_str(",\n"); - } else if meta.schema_to_id_type(param_name).is_some() - && is_string_schema - && param_name != "tax_id" - { - let (id_type, _) = meta.schema_to_id_type(param_name).unwrap(); - print_doc(out); - initializers.push((param_name.into(), id_type.clone(), required)); - state.use_ids.insert(id_type.clone()); - write_out_field(out, param_rename, &id_type, required); - } else if matches!(kind, Some(SchemaKind::Type(Type::Boolean { .. }))) { - print_doc(out); - initializers.push((param_rename.into(), "bool".into(), false)); - write_out_field(out, param_rename, "bool", required); - } else if let Some(SchemaKind::Type(Type::Integer(int_type))) = kind { - let rust_type = infer_integer_type(state, param_name, &int_type.format); - print_doc(out); - initializers.push((param_rename.into(), rust_type.clone(), required)); - write_out_field(out, param_rename, &rust_type, required); - } else if matches!(kind, Some(SchemaKind::Type(Type::Number(_)))) { - print_doc(out); - initializers.push((param_rename.into(), "f64".into(), required)); - write_out_field(out, param_rename, "f64", required); - } else if schema.as_item().and_then(as_any_of_first_item_title) - == Some("range_query_specs") - { - print_doc(out); - initializers.push(( - param_rename.into(), - "RangeQuery".into(), - required, - )); - state.use_params.insert("RangeQuery"); - state.use_params.insert("Timestamp"); - write_out_field(out, param_rename, "RangeQuery", required); - } else if let Some(enum_strings) = schema.as_item().and_then(as_enum_strings) { - let enum_schema = meta.schema_field(&object, param_rename); - let enum_name = meta.schema_to_rust_type(&enum_schema); - let enum_ = InferredEnum { - parent: params.rust_type.clone(), - field: param_rename.into(), - options: enum_strings, - }; - let inserted = state.try_insert_enum(enum_name.clone(), enum_.clone()); - let enum_name = if inserted.is_err() { - let enum_schema = format!("{}_filter", enum_schema); - let enum_name = meta.schema_to_rust_type(&enum_schema); - state.insert_enum(enum_name.clone(), enum_); - enum_name - } else { - enum_name - }; - - print_doc(out); - initializers.push((param_rename.into(), enum_name.clone(), required)); - write_out_field(out, param_rename, &enum_name, required); - } else if (param_name == "currency" || param_name.ends_with("_currency")) - && is_string_schema - { - print_doc(out); - initializers.push((param_rename.into(), "Currency".into(), required)); - state.use_resources.insert("Currency".into()); - write_out_field(out, param_rename, "Currency", required); - } else if is_string_schema { - print_doc(out); - initializers.push((param_rename.into(), "&'a str".into(), required)); - write_out_field(out, param_rename, "&'a str", required); - } else if schema.as_item().is_none() - || matches!( - kind, - Some( - SchemaKind::AnyOf { .. } - | SchemaKind::Type(Type::Object(_)) - | SchemaKind::Type(Type::Array(_)) - ) - ) - { - let rust_type = gen_field_rust_type( - state, - meta, - ¶ms.rust_type.to_snake_case(), - param_rename, - schema, - required, - false, - shared_objects, - ); - initializers.push((param_rename.into(), rust_type.clone(), required)); - - print_doc(out); - if !required { - out.push_str( - " #[serde(skip_serializing_if = \"Option::is_none\")]\n", - ); - } - out.push_str(" pub "); - out.push_str(param_rename); - out.push_str(": "); - out.push_str(&rust_type); - out.push_str(",\n"); - } else if required { - panic!("error: skipped required parameter: {} => {:?}", param_name, schema); - } else { - tracing::warn!("skipping optional parameter: {}", param_name); - } - } - } - } - out.push_str("}\n"); - out.push('\n'); - out.push_str("impl<'a> "); - out.push_str(¶ms.rust_type); - out.push_str("<'a> {\n"); - out.push_str(" pub fn new("); - let mut required_count = 0; - for (name, type_, required) in &initializers { - if *required { - if required_count > 0 { - out.push_str(", "); - } - out.push_str(name); - out.push_str(": "); - out.push_str(type_); - required_count += 1; - } - } - out.push_str(") -> Self {\n"); - out.push_str(" "); - out.push_str(¶ms.rust_type); - out.push_str(" {\n"); - for (name, _, required) in &initializers { - out.push_str(" "); - out.push_str(name); - if *required { - out.push_str(",\n"); - } else { - out.push_str(": Default::default(),\n"); - } - } - out.push_str(" }\n"); - out.push_str(" }\n"); - out.push_str("}\n"); - - // we implement paginate on lists that have an Id - if let ("list", Some(_)) = (params.method.as_str(), &id_type) { - state.use_params.insert("Paginable"); - - out.push_str("impl Paginable for "); - out.push_str(¶ms.rust_type); - out.push_str("<'_> {\n"); - out.push_str(" type O = "); - out.push_str(&struct_name); - out.push_str(";\n"); - out.push_str( - " fn set_last(&mut self, item: Self::O) { - self.starting_after = Some(item.id()); - }", - ); - out.push_str("}"); - } - } -} - -#[tracing::instrument(skip_all)] -pub fn gen_inferred_structs( - out: &mut String, - state: &mut FileGenerator, - meta: &Metadata, - shared_objects: &mut BTreeSet, -) { - let mut emitted_structs = BTreeSet::new(); - while state - .inferred_structs - .keys() - .cloned() - .collect::>() - .difference(&emitted_structs) - .any(|_| true) - { - for (struct_name, struct_) in state.inferred_structs.clone() { - if emitted_structs.contains(&struct_name) { - continue; - } else { - emitted_structs.insert(struct_name.clone()); - } - - let obj = match struct_.schema.schema_kind { - SchemaKind::Type(Type::Object(o)) => o, - _ => { - // TODO: Handle these objects - tracing::warn!("{} has no properties ({:#?})", struct_name, struct_.schema); - continue; - } - }; - - trace!("struct {} {{...}}", &struct_name.to_camel_case()); - - out.push('\n'); - out.push_str("#[derive(Clone, Debug, Default, Deserialize, Serialize)]\n"); - out.push_str("pub struct "); - out.push_str(&struct_name.to_camel_case()); - out.push_str(" {\n"); - - for (key, field) in &obj.properties { - let required = obj.required.contains(key); - out.push('\n'); - out.push_str(&gen_field( - state, - meta, - &struct_name.to_snake_case(), - key, - field, - required, - false, - shared_objects, - )); - } - out.push_str("}\n"); - } - } -} - -#[tracing::instrument(skip_all)] -pub fn gen_unions(out: &mut String, unions: &BTreeMap, meta: &Metadata) { - for (union_name, union_) in unions { - trace!("union {} {{ ... }}", union_name); - - out.push('\n'); - out.push_str("#[derive(Clone, Debug, Deserialize, Serialize)]\n"); - out.push_str("#[serde(untagged, rename_all = \"snake_case\")]\n"); - out.push_str("pub enum "); - out.push_str(&union_name.to_camel_case()); - out.push_str(" {\n"); - for variant_schema in &union_.schema_variants { - let schema = - meta.spec.get_schema_unwrapped(variant_schema).as_item().expect("Expected an item"); - let object_name = as_object_enum_name(schema) - .unwrap_or_else(|| schema.schema_data.title.clone().unwrap()); - let variant_name = meta.schema_to_rust_type(&object_name); - let type_name = meta.schema_to_rust_type(variant_schema); - if variant_to_serde_snake_case(&variant_name) != object_name { - write_serde_rename(out, &object_name); - } - out.push_str(" "); - out.push_str(&variant_name); - out.push('('); - out.push_str(&type_name); - out.push_str("),\n"); - } - out.push_str("}\n"); - - if let Some(first) = union_ - .schema_variants - .iter() - .filter_map(|var| match var.trim() { - "" => None, - n => Some(n), - }) - .map(|s| gen_variant_name(s, meta)) - .next() - { - let struct_name = union_name.to_camel_case(); - writedoc!( - out, - r" - impl std::default::Default for {struct_name} {{ - fn default() -> Self {{ - Self::{first}(Default::default()) - }} - }} - " - ) - .unwrap(); - } - } -} - -/// This code is taken from serde RenameRule::apply_to_variant -/// It differs in some cases from heck, so we need to make sure we -/// do exactly the same when figuring out whether we need a serde(rename) -/// e.g. heck_snake(Self_) = self -/// serde_snake(Self_) = self_ -pub fn variant_to_serde_snake_case(variant: &str) -> String { - let mut snake = String::new(); - for (i, ch) in variant.char_indices() { - if i > 0 && ch.is_uppercase() { - snake.push('_'); - } - snake.push(ch.to_ascii_lowercase()); - } - snake -} - -#[tracing::instrument(skip_all)] -pub fn gen_variant_name(wire_name: &str, meta: &Metadata) -> String { - match wire_name { - "*" => "All".to_string(), - "self" => "Self_".to_string(), - n => { - if n.chars().next().unwrap().is_digit(10) { - format!("V{}", n.to_string().replace('-', "_").replace('.', "_")) - } else { - meta.schema_to_rust_type(wire_name) - } - } - } -} - -#[tracing::instrument(skip_all)] -pub fn gen_enums(out: &mut String, enums: &BTreeMap, meta: &Metadata) { - for (enum_name, enum_) in enums { - trace!("enum {} {{ ... }}", enum_name); - - out.push('\n'); - out.push_str(&format!( - "/// An enum representing the possible values of an `{}`'s `{}` field.\n", - enum_.parent, enum_.field - )); - out.push_str("#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)]\n"); - out.push_str("#[serde(rename_all = \"snake_case\")]\n"); - out.push_str("pub enum "); - out.push_str(enum_name); - out.push_str(" {\n"); - for wire_name in &enum_.options { - if wire_name.trim().is_empty() { - continue; - } - let variant_name = gen_variant_name(wire_name.as_str(), meta); - if variant_name.trim().is_empty() { - panic!("unhandled enum variant: {:?}", wire_name) - } - if &variant_to_serde_snake_case(&variant_name) != wire_name { - write_serde_rename(out, wire_name); - } - out.push_str(" "); - out.push_str(&variant_name); - out.push_str(",\n"); - } - out.push_str("}\n"); - out.push('\n'); - out.push_str("impl "); - out.push_str(enum_name); - out.push_str(" {\n"); - out.push_str(" pub fn as_str(self) -> &'static str {\n"); - out.push_str(" match self {\n"); - for wire_name in &enum_.options { - if wire_name.trim().is_empty() { - continue; - } - let variant_name = gen_variant_name(wire_name.as_str(), meta); - out.push_str(" "); - out.push_str(enum_name); - out.push_str("::"); - out.push_str(&variant_name); - out.push_str(" => "); - out.push_str(&format!("{:?}", wire_name)); - out.push_str(",\n"); - } - out.push_str(" }\n"); - out.push_str(" }\n"); - out.push_str("}\n"); - out.push('\n'); - writedoc!( - out, - r" - impl AsRef for {enum_name} {{ - fn as_ref(&self) -> &str {{ - self.as_str() - }} - }} - - impl std::fmt::Display for {enum_name} {{ - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {{ - self.as_str().fmt(f) - }} - }} - " - ) - .unwrap(); - if let Some(first) = enum_ - .options - .iter() - .filter_map(|var| match var.trim() { - "" => None, - n => Some(n), - }) - .map(|s| gen_variant_name(s, meta)) - .next() - { - out.push_str("impl std::default::Default for "); - out.push_str(enum_name); - out.push_str(" {\n"); - out.push_str(" fn default() -> Self {\n"); - out.push_str(&format!(" Self::{}\n", first)); - out.push_str(" }\n"); - out.push_str("}\n"); - } - } -} - -#[tracing::instrument(skip_all)] -pub fn gen_member_variable_string(schema: &Schema) -> Result { - if let SchemaKind::Type(typ) = &schema.schema_kind { - match typ { - Type::String(_) => Ok("String".into()), - Type::Integer(_) => Ok("i32".into()), - Type::Boolean { .. } => Ok("bool".into()), - Type::Array(arr) => Ok(format!( - "Vec<{}>", - gen_member_variable_string(arr.items.as_ref().unwrap().as_item().unwrap()).unwrap() - )), - Type::Object(_) => Err(TypeError::IsObject), - _ => Err(TypeError::Unhandled), - } - } else { - Err(TypeError::NoType) - } -} - -#[tracing::instrument(skip_all)] -pub fn gen_objects(out: &mut String, objects: &BTreeMap) { - let mut generated_objects = objects.clone(); - while !generated_objects.is_empty() { - let key_str: String; - let value_obj: InferredObject; - { - let (key, value) = generated_objects.iter().next().unwrap(); - trace!("object: {} -- {:#?}", key, value); - key_str = key.clone(); - value_obj = value.clone(); - } - - //Okay, we need something more general for these common - //cases. Hopefully, they aren't too common. Right now, we - //don't have a clear way to handle 2nd level nested new types - if key_str == "Metadata" { - generated_objects.remove(&key_str); - continue; - } - - let schema = value_obj.schema.clone(); - out.push('\n'); - print_doc_from_schema(out, &schema, 0); - - match schema.schema_kind { - SchemaKind::Type(Type::Object(obj)) => { - trace!("struct {} {{...}}", key_str); - - out.push_str("#[derive(Clone, Debug, Default, Deserialize, Serialize)]\n"); - out.push_str(&format!("pub struct {} {{\n", key_str)); - let props = obj.properties.iter().flat_map(|(name, schema_or)| match schema_or { - ReferenceOr::Reference { .. } => None, - ReferenceOr::Item(schema) => Some((name, schema)), - }); - for (member_name, member_schema) in props { - let is_required = obj.required.contains(member_name); - print_doc_from_schema(out, member_schema, 1); - match gen_member_variable_string(member_schema) { - Ok(normal_var) => { - write_out_field(out, member_name, &normal_var, is_required) - } - Err(TypeError::IsObject) => { - let rust_type = member_name.to_camel_case(); - write_out_field(out, member_name, &rust_type, is_required); - let new_params = InferredObject { - rust_type: rust_type.clone(), - schema: *member_schema.clone(), - }; - generated_objects.insert(rust_type, new_params); - } - _ => { - panic!("Unhandled case, inspect: {:#?}", member_schema); - } - } - } - out.push_str("}\n"); - } - SchemaKind::AnyOf { any_of } => { - out.push_str("#[derive(Clone, Debug, Deserialize, Serialize)]\n"); - out.push_str("#[serde(untagged, rename_all = \"snake_case\")]\n"); - out.push_str(&format!("pub enum {} {{\n", key_str)); - - let mut variants = HashMap::new(); - - for value in any_of.iter().flat_map(|a| match a { - ReferenceOr::Reference { .. } => None, - ReferenceOr::Item(s) => Some(s), - }) { - let title = &value.schema_data.title; - let type_name = gen_member_variable_string(value).unwrap_or_else(|_| { - let type_name = title.as_ref().unwrap().to_camel_case(); - - generated_objects.insert( - type_name.clone(), - InferredObject { rust_type: type_name.clone(), schema: value.clone() }, - ); - - type_name - }); - - // if the title is not provided, the variant - // should have the same name as the type it contains - // with an optional suffix if there are clashes - let variant_name = - title.as_ref().map(|s| s.to_camel_case()).unwrap_or_else(|| { - let count = variants.entry(type_name.clone()).or_insert(0); - let suffix = - if *count == 0 { "".to_string() } else { count.to_string() }; - *count += 1; - - format!("{}{}", type_name, suffix) - }); - - out.push_str(&format!(" pub {}({}),\n", variant_name, type_name)); - } - out.push_str("}\n"); - } - other => panic!("Expected an object here got: {:?}", other), - } - generated_objects.remove(&key_str); - } -} - -#[tracing::instrument(skip_all, fields(object = object, field_name = field_name))] -pub fn gen_field>( - state: &mut FileGenerator, - meta: &Metadata, - object: &str, - field_name: &str, - field: &ReferenceOr, - required: bool, - default: bool, - shared_objects: &mut BTreeSet, -) -> String { - trace!("gen_field: {}::{} (required: {}, default: {})", object, field_name, required, default); - - let mut out = String::new(); - if let Some(doc) = field.as_item().and_then(|s| s.borrow().schema_data.description.as_deref()) { - print_doc_comment(&mut out, doc, 1); - } - let mut field_rename = field_name.to_snake_case(); - if field_rename == "type" { - field_rename = "type_".into(); - } - if field_rename != field_name { - write_serde_rename(&mut out, field_name); - } - let rust_type = gen_field_rust_type( - state, - meta, - object, - field_name, - field, - required, - default, - shared_objects, - ); - if !required { - if rust_type == "bool" || rust_type == "Metadata" || rust_type.starts_with("List<") { - out.push_str(" #[serde(default)]\n"); - } else if rust_type.starts_with("Option<") { - out.push_str(" #[serde(skip_serializing_if = \"Option::is_none\")]\n"); - } - } - out.push_str(" pub "); - out.push_str(&field_rename); - out.push_str(": "); - out.push_str(&rust_type); - out.push_str(",\n"); - out -} - -#[tracing::instrument(skip_all, fields(object = object, path = path))] -fn gen_schema_ref( - state: &mut FileGenerator, - meta: &Metadata, - object: &str, - path: &str, - shared_objects: &mut BTreeSet, -) -> String { - let schema_name = path.trim_start_matches("#/components/schemas/"); - let type_name = meta.schema_to_rust_type(schema_name); - if schema_name != object { - if meta.objects.contains(schema_name) { - state.use_resources.insert(type_name.clone()); - } else if meta.dependents.get(schema_name).map(|x| x.len()).unwrap_or(0) > 1 { - state.use_resources.insert(type_name.clone()); - shared_objects.insert(FileGenerator::new(schema_name.to_string())); - } else if !state.generated_schemas.contains_key(schema_name) { - // for some reason, this field causes clashes, so just skip it - // until the new codegen is ready - if schema_name != "invoice_setting_subscription_schedule_setting" { - state.generated_schemas.insert(schema_name.into(), false); - } - } - } - type_name -} - -fn gen_schema_or_ref_type>( - state: &mut FileGenerator, - meta: &Metadata, - object: &str, - field_name: &str, - field: &ReferenceOr, - required: bool, - default: bool, - shared_objects: &mut BTreeSet, -) -> String { - match field { - ReferenceOr::Reference { reference } => { - gen_schema_ref(state, meta, object, reference, shared_objects) - } - ReferenceOr::Item(schema) => gen_field_type( - state, - meta, - object, - field_name, - schema.borrow(), - required, - default, - shared_objects, - ), - } -} - -#[tracing::instrument(skip_all)] -fn gen_field_type( - state: &mut FileGenerator, - meta: &Metadata, - object: &str, - field_name: &str, - field: &Schema, - required: bool, - default: bool, - shared_objects: &mut BTreeSet, -) -> String { - match &field.schema_kind { - // N.B. return immediately; if we want to use `Default` for bool rather than `Option` - SchemaKind::Type(Type::Boolean(_)) => "bool".into(), - SchemaKind::Type(Type::Number(_)) => "f64".into(), - SchemaKind::Type(Type::Integer(format)) => { - infer_integer_type(state, field_name, &format.format) - } - SchemaKind::Type(Type::String(typ)) => { - let variants = typ.enumeration.iter().flatten().cloned().collect::>(); - if !variants.is_empty() { - let enum_schema = meta.schema_field(object, field_name); - let enum_name = meta.schema_to_rust_type(&enum_schema); - let parent_type = meta.schema_to_rust_type(object); - let enum_ = InferredEnum { - parent: parent_type, - field: field_name.into(), - options: variants, - }; - state.insert_enum(enum_name.clone(), enum_); - enum_name - } else { - "String".into() - } - } - SchemaKind::Type(Type::Array(typ)) => { - let element = typ.items.clone().unwrap().unbox(); - let element_type = gen_field_rust_type( - state, - meta, - object, - field_name, - &element, - true, - false, - shared_objects, - ); - format!("Vec<{}>", element_type) - } - SchemaKind::Type(Type::Object(typ)) => { - if as_object_enum_name(field).as_deref() == Some("list") { - state.use_params.insert("List"); - let element = as_data_array_item(typ).unwrap_or_else(|| { - panic!("Expected to find array item but found {:?}", field.schema_kind) - }); - let element_field_name = if field_name.ends_with('s') { - field_name[0..field_name.len() - 1].into() - } else if field_name.ends_with("ies") { - format!("{}y", &field_name[0..field_name.len() - 3]) - } else { - field_name.into() - }; - let element_type = gen_field_rust_type( - state, - meta, - object, - &element_field_name, - element, - true, - false, - shared_objects, - ); - - // N.B. return immediately; we use `Default` for list rather than `Option` - return format!("List<{}>", element_type); - } - - if let Some(AdditionalProperties::Schema(additional)) = &typ.additional_properties { - return gen_schema_or_ref_type( - state, - meta, - object, - field_name, - additional, - required, - default, - shared_objects, - ); - } - - let struct_schema = meta.schema_field(object, field_name); - let struct_name = meta.schema_to_rust_type(&struct_schema); - let struct_ = InferredStruct { field: field_name.into(), schema: field.clone() }; - state.insert_struct(struct_name.clone(), struct_); - struct_name - } - SchemaKind::AnyOf { .. } | SchemaKind::OneOf { .. } => { - let any_of = match &field.schema_kind { - SchemaKind::AnyOf { any_of } => any_of, - SchemaKind::OneOf { one_of } => one_of, - _ => unreachable!(), +use crate::components::{get_components, Components}; +use crate::crate_table::write_crate_table; +use crate::crates::{get_crate_doc_comment, Crate, ALL_CRATES}; +use crate::object_writing::{gen_obj, gen_requests}; +use crate::rust_object::{ObjectKind, ObjectMetadata}; +use crate::spec::Spec; +use crate::spec_inference::infer_doc_comment; +use crate::stripe_object::StripeObject; +use crate::templates::cargo_toml::gen_crate_toml; +use crate::templates::utils::write_top_level_doc_comment; +use crate::url_finder::UrlFinder; +use crate::utils::{append_to_file, write_to_file}; +use crate::webhook::write_generated_for_webhooks; + +pub struct CodeGen { + pub components: Components, + pub spec: Spec, +} + +impl CodeGen { + pub fn new(spec: Spec, url_finder: UrlFinder) -> anyhow::Result { + let mut components = get_components(&spec)?; + + // Attach doc urls for top-level components + for comp in components.components.values_mut() { + if let Some(doc_url) = url_finder.url_for_object(comp.path()) { + comp.stripe_doc_url = Some(doc_url); + } + } + + Ok(Self { components, spec }) + } + + fn write_api_version_file(&self) -> anyhow::Result<()> { + let base_path = Crate::SHARED.get_path(); + let mut mod_rs_contents = String::new(); + let mod_rs_path = base_path.join("mod.rs"); + + // Write the current API version + let version_file_content = format!( + "pub const VERSION: crate::ApiVersion = crate::ApiVersion::V{};", + self.spec.version().replace('-', "_") + ); + write_to_file(version_file_content, base_path.join("version.rs"))?; + let _ = writeln!(mod_rs_contents, "pub mod version;"); + + append_to_file(mod_rs_contents, mod_rs_path)?; + Ok(()) + } + + fn write_components(&self) -> anyhow::Result<()> { + for component in self.components.components.values() { + self.write_component(component)?; + } + + let crate_path = Crate::SHARED.get_path(); + let crate_mod_path = crate_path.join("mod.rs"); + for (ident, typ_info) in &self.components.extra_types { + let mut out = String::new(); + let metadata = ObjectMetadata::new(ident.clone(), ObjectKind::Type); + self.components.write_object(&typ_info.obj, &metadata, &mut out); + write_to_file(out, crate_path.join(format!("{}.rs", typ_info.mod_path)))?; + append_to_file( + format!("pub mod {0}; pub use {0}::{1};", typ_info.mod_path, ident), + &crate_mod_path, + )?; + } + Ok(()) + } + + pub fn write_files(&self) -> anyhow::Result<()> { + self.write_crate_base()?; + self.write_components()?; + self.write_api_version_file()?; + write_generated_for_webhooks(&self.components) + .context("Could not write webhook generated code")?; + write_crate_table(&self.components) + } + + fn write_crate_base(&self) -> anyhow::Result<()> { + let crate_graph = self.components.gen_crate_dep_graph(); + + for krate in &*ALL_CRATES { + let neighbors = crate_graph.neighbors(*krate); + let base_path = PathBuf::from(krate.generated_out_path()); + let request_features = self + .components + .get_crate_members(*krate) + .into_iter() + .filter(|c| !self.components.get(c).requests.is_empty() && *krate != Crate::SHARED) + .map(|c| self.components.get(c).mod_path()) + .collect(); + + let toml = gen_crate_toml(*krate, neighbors.collect(), request_features); + write_to_file(toml, base_path.join("Cargo.toml"))?; + + let crate_name = krate.name(); + let doc_comment = write_top_level_doc_comment(get_crate_doc_comment(*krate)); + + // We set up some things in the base `mod.rs` file: + // 1. Without this recursion limit increase, `cargo doc` fails + // 2. The `extern` allows generated code to use absolute paths starting with the crate name instead of `crate` + // 3. Allow some warnings that are not currently fixed, but could be. + let mod_rs = formatdoc! { + r#" + #![recursion_limit = "256"] + #![allow(clippy::large_enum_variant)] + #![allow(rustdoc::broken_intra_doc_links)] + #![allow(rustdoc::invalid_html_tags)] + + {doc_comment} + extern crate self as {crate_name}; + "# }; - if any_of.len() == 1 - || (any_of.len() == 2 - && any_of[1] - .as_item() - .and_then(as_first_enum_value) - .map(|v| v.is_empty()) - .unwrap_or_default()) - { - gen_field_rust_type( - state, - meta, - object, - field_name, - &any_of[0], - true, - false, - shared_objects, - ) - } else if let Some(resources) = field.schema_data.extensions.get("x-expansionResources") - { - let expansion_resources = - serde_json::from_value::(resources.clone()) - .expect("Could not deserialize expansion resources"); - let ty_ = gen_field_rust_type( - state, - meta, - object, - field_name, - &ReferenceOr::Item(Schema { - schema_data: Default::default(), - schema_kind: expansion_resources.into_schema_kind(), - }), - true, - false, - shared_objects, - ); - state.use_params.insert("Expandable"); - format!("Expandable<{}>", ty_) - } else if any_of[0].as_item().and_then(|s| s.schema_data.title.as_deref()) - == Some("range_query_specs") - { - state.use_params.insert("RangeQuery"); - state.use_params.insert("Timestamp"); - "RangeQuery".into() - } else { - trace!("object: {}, field_name: {}", object, field_name); - let union_addition = format!("{field_name}_union"); - let union_schema = meta.schema_field(object, &union_addition); - let union_name = meta.schema_to_rust_type(&union_schema); - trace!("union_schema: {}, union_name: {}", union_schema, union_name); - let union_ = InferredUnion { - field: field_name.into(), - schema_variants: any_of - .iter() - .map(|x| { - let schema_name = match &x { - ReferenceOr::Reference { reference } => { - reference.trim_start_matches("#/components/schemas/") - } - ReferenceOr::Item(_) => { - panic!( - "invalid union for `{}.{}`: {:#?}", - object, field_name, field - ) - } - }; - let type_name = meta.schema_to_rust_type(schema_name); - if meta.objects.contains(schema_name) - || meta.dependents.get(schema_name).map(|x| x.len()).unwrap_or(0) - > 1 - { - state.use_resources.insert(type_name); - } else if !state.generated_schemas.contains_key(schema_name) { - state.generated_schemas.insert(schema_name.into(), false); - } - schema_name.into() - }) - .collect(), - }; - state.inferred_unions.insert(union_name.clone(), union_); - union_name - } - } - _ => { - panic!("unhandled field type for `{}.{}`: {:#?}\n", object, field_name, field) + let mod_path = base_path.join("src/mod.rs"); + write_to_file(mod_rs, &mod_path)?; } + Ok(()) } -} -#[tracing::instrument(skip_all)] -pub fn gen_field_rust_type>( - state: &mut FileGenerator, - meta: &Metadata, - object: &str, - field_name: &str, - field: &ReferenceOr, - required: bool, - default: bool, - shared_objects: &mut BTreeSet, -) -> String { - let maybe_schema = field.as_item().map(|s| s.borrow()); - let is_nullable = maybe_schema.map(|s| s.schema_data.nullable).unwrap_or_default(); - if let Some((use_path, rust_type)) = meta.field_to_rust_type(object, field_name) { - state.add_use(use_path); - return rust_type.into(); - } - if field_name == "metadata" { - state.use_params.insert("Metadata"); - return if !required || is_nullable { - "Option".into() - } else { - "Metadata".into() - }; - } else if (field_name == "currency" || field_name.ends_with("_currency")) - && matches!(maybe_schema.map(|s| &s.schema_kind), Some(SchemaKind::Type(Type::String(_)))) - { - state.use_resources.insert("Currency".into()); - return if !required || is_nullable { - "Option".into() - } else { - "Currency".into() + fn write_component_requests(&self, comp: &StripeObject) -> anyhow::Result<()> { + let req_content = gen_requests(&comp.requests, &self.components); + write_to_file(req_content, comp.get_requests_content_path())?; + let feature_gate = comp.mod_path(); + let new_mod_file_content = formatdoc! { + r#" + #[cfg(feature = "{feature_gate}")] + mod requests; + #[cfg(feature = "{feature_gate}")] + pub use requests::*; + "# }; - } else if field_name == "created" { - state.use_params.insert("Timestamp"); - return if !required || is_nullable { - "Option".into() + append_to_file(new_mod_file_content, comp.get_requests_module_path()) + } + + #[tracing::instrument(level = "debug", skip_all, fields(path = %comp.path()))] + fn write_component(&self, comp: &StripeObject) -> anyhow::Result<()> { + let struct_defs = self.gen_struct_definitions_for_component(comp); + if !comp.has_requests() || comp.types_split_from_requests() { + write_to_file(struct_defs, comp.get_types_content_path())?; + append_to_file( + format!( + // NB: we add doc(hidden) and doc(inline) to hide the implementation details + // of these being public modules so that other generated crates can import them. It + // just keeps the already giant rustdoc page a bit cleaner + "#[doc(hidden)]\npub mod {0};#[doc(inline)]\npub use {0}::*;", + comp.mod_path() + ), + comp.types_crate().get_path_to_mod(), + )?; } else { - "Timestamp".into() - }; - } else if field_name == "type" && object == "event" { - state.use_resources.insert("EventType".into()); - return if !required || is_nullable { - "Option".into() - } else { - "EventType".into() - }; - } - - let ty = gen_schema_or_ref_type( - state, - meta, - object, - field_name, - field, - required, - default, - shared_objects, - ); - if ty == "bool" && default { - // N.B. return immediately; if we want to use `Default` for bool rather than `Option` - // Not sure why this is here, but we want to preserve it for now - return "bool".into(); - } - - // currency_options field is represented by an optional HashMap, where the String is the currency code in ISO 4217 format. - if field_name == "currency_options" { - state.use_params.insert("CurrencyMap"); - - if ty.contains("CurrencyMap<") { - return ty; - } - - return format!("Option>", ty); - } - - let optional = !required || is_nullable; - let should_box = ty.as_str() == "ApiErrors"; - - match (optional, should_box) { - (true, true) => format!("Option>", ty), - (true, false) => format!("Option<{}>", ty), - (false, true) => format!("Box<{}>", ty), - (false, false) => ty, - } -} - -#[tracing::instrument(skip_all, fields(name = %state.name))] -pub fn gen_impl_requests( - state: &mut FileGenerator, - meta: &Metadata, - object_id: Option<&str>, -) -> Option { - let name = state.name.clone(); - let object = &name; - let requests = meta.requests.get(object)?; - let rust_struct = meta.schema_to_rust_type(object); - trace!("impl {} {{ ... }}", rust_struct); - - let mut methods = BTreeMap::new(); - - for path in requests { - // Unwrapped is safe here to avoid dealing with an `Option` since these paths come - // from the spec already - let request = meta - .spec - .get_request_unwrapped(*path) - .as_item() - .expect("Expected item, not path reference"); - let segments = path.trim_start_matches("/v1/").split('/').collect::>(); - - if let Some(get_request) = &request.get { - let ok_resp = match get_ok_response(get_request) { - None => continue, - Some(s) => s, - }; - if !err_schema_expected(get_request) { - continue; // skip generating this unusual request (for now...) - } - let doc_comment = - get_request.description.as_ref().expect("No description in GET request"); - let body_schema = ok_resp - .as_item() - .and_then(|s| s.content.get("application/json")) - .and_then(|c| c.schema.as_ref()); - if body_schema - .as_ref() - .and_then(|s| s.as_item()) - .map(|s| as_object_enum_name(s).as_deref() == Some("list")) - .unwrap_or_default() - && !methods.contains_key(&MethodTypes::List) - { - let params_name = if rust_struct.ends_with('y') { - format!("List{}ies", &rust_struct[0..rust_struct.len() - 1]) - } else { - format!("List{}s", rust_struct) - }; - let params = InferredParams { - method: "list".into(), - rust_type: params_name.clone(), - parameters: non_path_ref_params(get_request), - }; - state.inferred_parameters.insert(params_name.to_snake_case(), params); - state.use_params.insert("List"); - - let mut out = String::new(); - out.push('\n'); - print_doc_comment(&mut out, doc_comment, 1); - - let query_path = segments.join("/"); - writedoc!(&mut out, r#" - pub fn list(client: &Client, params: &{params_name}<'_>) -> Response> {{ - client.get_query("/{query_path}", ¶ms) - }} - "#).unwrap(); - methods.insert(MethodTypes::List, out); - } else if segments.len() == 2 && !methods.contains_key(&MethodTypes::Retrieve) { - let id_param = match get_id_param(&get_request.parameters) { - Some(p) => p, - None => continue, - }; - let expand_param = find_param_by_name(get_request, "expand"); - if let Some(id_type) = &object_id { - assert!(id_param.parameter_data_ref().required); - assert!(matches!(id_param, Parameter::Path { style: PathStyle::Simple, .. })); - - let mut out = String::new(); - out.push('\n'); - print_doc_comment(&mut out, doc_comment, 1); - out.push_str(" pub fn retrieve(client: &Client, id: &"); - out.push_str(id_type); - if let Some(param) = expand_param { - state.use_params.insert("Expand"); - assert!(matches!(param, Parameter::Query { .. })); - out.push_str(", expand: &[&str]) -> Response<"); - out.push_str(&rust_struct); - out.push_str("> {\n"); - out.push_str(" client.get_query("); - out.push_str(&format!("&format!(\"/{}/{{}}\", id)", segments[0])); - out.push_str(", &Expand { expand })\n"); - } else { - out.push_str(") -> Response<"); - out.push_str(&rust_struct); - out.push_str("> {\n"); - out.push_str(" client.get(/"); - out.push_str(&format!("&format!(\"/{}/{{}}\", id)", segments[0])); - out.push_str(")\n"); - } - out.push_str(" }"); - methods.insert(MethodTypes::Retrieve, out); - } - } - } - - if let Some(post_request) = &request.post { - let return_type = match get_ok_response_schema(post_request) { - Some(ReferenceOr::Reference { reference }) => { - let schema = reference.trim_start_matches("#/components/schemas/"); - meta.schema_to_rust_type(schema) - } - _ => continue, + write_to_file(struct_defs, comp.get_types_content_path())?; + append_to_file("pub(crate) mod types;", comp.get_requests_module_path())?; + append_to_file( + format!("pub use {0}::types::*;", comp.mod_path()), + comp.req_crate().get_path_to_mod(), + )?; + } + + if !comp.requests.is_empty() { + append_to_file( + format!("pub mod {};", comp.mod_path()), + comp.req_crate().get_path_to_mod(), + )?; + self.write_component_requests(comp)?; + } + + // Reexport in this crate if we wrote types to `stripe_shared` instead of the + // component's base crate. + if comp.types_split_from_requests() { + append_to_file( + format!("pub use {}::{}::*;", Crate::SHARED, comp.mod_path()), + comp.req_crate().get_path_to_mod(), + )?; + } + + for (ident, obj) in &comp.deduplicated_objects { + let mut out = String::new(); + let metadata = ObjectMetadata::new(ident.clone(), obj.info.kind); + self.components.write_object(&obj.object, &metadata, &mut out); + let dst_file = match obj.info.kind { + ObjectKind::RequestParam | ObjectKind::RequestReturned => { + comp.get_requests_content_path() + } + ObjectKind::Type => comp.get_types_content_path(), }; - if !err_schema_expected(post_request) { - continue; // skip generating this unusual request (for now...) - } - let doc_comment = - post_request.description.as_ref().expect("No description for POST request"); - let parameter_count = post_request.parameters.len(); - - let create = doc_comment.contains("Create") - || doc_comment.contains("create") - || doc_comment.contains("Adds") - || doc_comment.contains("adds"); - - let update = doc_comment.contains("Update") || doc_comment.contains("update"); - - if !methods.contains_key(&MethodTypes::Create) && parameter_count == 0 && create { - // Construct `parameters` from the request body schema - let create_parameters = - get_request_form_parameters(post_request).unwrap_or_else(|err| { - panic!("Could not extract create parameters due to error {}", err) - }); - let params_name = format!("Create{}", rust_struct); - let params = InferredParams { - method: "create".into(), - rust_type: params_name.clone(), - parameters: create_parameters, - }; - state.inferred_parameters.insert(params_name.to_snake_case(), params); - - let mut out = String::new(); - out.push('\n'); - print_doc_comment(&mut out, doc_comment, 1); - out.push_str(" pub fn create(client: &Client, params: "); - out.push_str(¶ms_name); - out.push_str("<'_>) -> Response<"); - out.push_str(&return_type); - out.push_str("> {\n"); - out.push_str(" client.post_form(\"/"); - out.push_str(&segments.join("/")); - out.push_str("\", ¶ms)\n"); - out.push_str(" }"); - methods.insert(MethodTypes::Create, out); - } else if !methods.contains_key(&MethodTypes::Update) && parameter_count == 1 && update - { - // Get the id parameter - let id_param = match get_id_param(&post_request.parameters) { - Some(p) => p, - None => continue, - }; - - // Construct `parameters` from the request body schema - let update_parameters = - get_request_form_parameters(post_request).unwrap_or_else(|err| { - panic!("Could not extract update parameters due to error {}", err) - }); - let params_name = format!("Update{}", rust_struct); - let params = InferredParams { - method: "update".into(), - rust_type: params_name.clone(), - parameters: update_parameters, - }; - state.inferred_parameters.insert(params_name.to_snake_case(), params); - - if let Some(id_type) = &object_id { - assert!(id_param.parameter_data_ref().required); - assert!(matches!(id_param, Parameter::Path { style: PathStyle::Simple, .. })); - - let mut out = String::new(); - out.push('\n'); - print_doc_comment(&mut out, doc_comment, 1); - out.push_str(" pub fn update(client: &Client, id: &"); - out.push_str(id_type); - out.push_str(", params: "); - out.push_str(¶ms_name); - out.push_str("<'_>) -> Response<"); - out.push_str(&return_type); - out.push_str("> {\n"); - out.push_str(" client.post_form("); - out.push_str(&format!("&format!(\"/{}/{{}}\", id)", segments[0])); - out.push_str(", ¶ms)\n"); - out.push_str(" }"); - methods.insert(MethodTypes::Update, out); - } - } else { - tracing::warn!( - "unhandled {} for {rust_struct}: POST {path} (already have {:?})", - match (create, update) { - (true, _) => "CREATE", - (_, true) => "UPDATE", - _ => "UNKNOWN", - }, - methods.keys() - ); - } + append_to_file(out, dst_file)?; } - if let Some(delete_request) = &request.delete { - match get_ok_response_schema(delete_request) { - None => continue, - Some(s) => s, - }; - if !err_schema_expected(delete_request) { - continue; // skip generating this unusual request (for now...) - } - - let doc_comment = - delete_request.description.as_ref().expect("Missing DELETE description"); - if segments.len() == 2 && !methods.contains_key(&MethodTypes::Delete) { - let id_param = match get_id_param(&delete_request.parameters) { - Some(p) => p, - None => continue, - }; - if let Some(id_type) = &object_id { - state.use_params.insert("Deleted"); - assert!(id_param.parameter_data_ref().required); - assert!(matches!(id_param, Parameter::Path { style: PathStyle::Simple, .. })); - - let mut out = String::new(); - out.push('\n'); - print_doc_comment(&mut out, doc_comment, 1); - out.push_str(" pub fn delete(client: &Client, id: &"); - out.push_str(id_type); - out.push_str(") -> Response> {\n"); - out.push_str(" client.delete("); - out.push_str(&format!("&format!(\"/{}/{{}}\", id)", segments[0])); - out.push_str(")\n"); - out.push_str(" }"); - methods.insert(MethodTypes::Delete, out); - } - } else { - tracing::warn!("unhandled DELETE for {rust_struct}: {path}"); - } - } + Ok(()) } - if methods.is_empty() { - None - } else { - // Add imports - state.use_config.insert("Client"); - state.use_config.insert("Response"); + fn gen_struct_definitions_for_component(&self, comp: &StripeObject) -> String { + let base_obj = comp.rust_obj(); + let schema = self.spec.get_component_schema(comp.path()); + let doc_comment = infer_doc_comment(schema, comp.stripe_doc_url.as_deref()); + let meta = ObjectMetadata::new(comp.ident().clone(), ObjectKind::Type).doc(doc_comment); - // Output the impl block - Some(format!( - "impl {} {{\n{}\n}}\n", - rust_struct, - methods.values().map(String::as_str).collect::>().join("\n") - )) + gen_obj(base_obj, &meta, comp, &self.components) } } diff --git a/openapi/src/components.rs b/openapi/src/components.rs new file mode 100644 index 000000000..80ad8ef4b --- /dev/null +++ b/openapi/src/components.rs @@ -0,0 +1,366 @@ +use std::collections::HashMap; +use std::fmt::Debug; + +use anyhow::bail; +use indexmap::{IndexMap, IndexSet}; +use petgraph::Direction; +use tracing::{debug, info}; + +use crate::crate_inference::validate_crate_info; +use crate::crates::{infer_crate_by_package, maybe_infer_crate_by_path, Crate}; +use crate::deduplication::{deduplicate_types, DeduppedObject}; +use crate::overrides::Overrides; +use crate::printable::{PrintableContainer, PrintableType}; +use crate::requests::parse_requests; +use crate::rust_object::{ObjectKind, RustObject}; +use crate::rust_type::{Container, PathToType, RustType}; +use crate::spec::Spec; +use crate::stripe_object::{ + parse_stripe_schema_as_rust_object, CrateInfo, OperationType, RequestSpec, StripeObject, + StripeOperation, StripeResource, +}; +use crate::types::{ComponentPath, RustIdent}; +use crate::visitor::Visit; +use crate::webhook::WebhookObject; + +#[derive(Clone, Debug)] +pub struct TypeSpec { + pub obj: RustObject, + pub doc: Option, + pub ident: RustIdent, + pub mod_path: String, +} + +pub struct Components { + pub components: IndexMap, + pub webhook_objs: Vec, + pub extra_types: IndexMap, +} + +#[derive(Debug, Clone, Eq, PartialEq, Hash)] +pub struct PathInfo { + pub krate: Crate, + pub path: Option, +} + +impl PathInfo { + pub fn new(krate: Crate) -> Self { + Self { krate, path: None } + } +} + +impl Components { + #[track_caller] + pub fn get(&self, path: &ComponentPath) -> &StripeObject { + &self.components[path] + } + + #[track_caller] + pub fn get_mut(&mut self, path: &ComponentPath) -> &mut StripeObject { + &mut self.components[path] + } + + pub fn get_crate_members(&self, krate: Crate) -> IndexSet<&ComponentPath> { + let mut members = IndexSet::new(); + for (path, component) in &self.components { + let Some(component_krate) = component.krate() else { + continue; + }; + if component_krate.base() == krate || component_krate.for_types() == krate { + members.insert(path); + } + } + members + } + + pub fn construct_printable_type_from_path(&self, path: &ComponentPath) -> PrintableType { + let comp = self.get(path); + PrintableType::QualifiedPath { + path: Some(PathInfo::new(comp.krate_unwrapped().for_types())), + ident: comp.ident().clone(), + has_ref: false, + is_ref: false, + } + } + + pub fn construct_printable_type(&self, typ: &RustType) -> PrintableType { + match typ { + RustType::Object(obj, metadata) => PrintableType::QualifiedPath { + path: None, + has_ref: obj.has_reference(self), + is_ref: false, + ident: metadata.ident.clone(), + }, + RustType::Path { path: PathToType::Component(path), .. } => { + self.construct_printable_type_from_path(path) + } + RustType::Path { path: PathToType::ObjectId(path), is_ref } => { + let obj = self.get(path); + let krate = obj.krate_unwrapped().for_types(); + PrintableType::QualifiedPath { + path: Some(PathInfo::new(krate)), + ident: obj.id_type_ident(), + is_ref: *is_ref, + has_ref: false, + } + } + RustType::Path { path: PathToType::Deduplicated { path, ident }, is_ref } => { + let referred_typ = self.get_dedupped_type(ident, path); + let has_ref = referred_typ.object.has_reference(self); + let path = if referred_typ.info.kind == ObjectKind::Type { + Some(PathInfo { + krate: self.get(path).krate_unwrapped().for_types(), + path: None, + }) + } else { + // For now, deduplicated request types always can just reference + // the same file + None + }; + PrintableType::QualifiedPath { + path, + ident: ident.clone(), + is_ref: *is_ref, + has_ref, + } + } + RustType::Path { path: PathToType::Shared(ident), is_ref } => { + let referred_typ = self.get_extra_type(ident); + let has_ref = referred_typ.obj.has_reference(self); + PrintableType::QualifiedPath { + path: Some(PathInfo { krate: Crate::SHARED, path: None }), + ident: ident.clone(), + is_ref: *is_ref, + has_ref, + } + } + + RustType::Simple(typ) => PrintableType::Simple(*typ), + RustType::Container(typ) => { + let inner = Box::new(self.construct_printable_type(typ.value_typ())); + let printable = match typ { + Container::List(_) => PrintableContainer::List(inner), + Container::SearchList(_) => PrintableContainer::SearchList(inner), + Container::Vec(_) => PrintableContainer::Vec(inner), + Container::Slice(_) => PrintableContainer::Slice(inner), + Container::Expandable(_) => PrintableContainer::Expandable(inner), + Container::Option(_) => PrintableContainer::Option(inner), + Container::Box(_) => PrintableContainer::Box(inner), + Container::Map { key, is_ref, .. } => { + PrintableContainer::Map { key: *key, is_ref: *is_ref, value: inner } + } + }; + PrintableType::Container(printable) + } + } + } + + pub fn deps_for_webhooks(&self) -> IndexSet<&ComponentPath> { + let mut dep_collector = DependencyCollector::new(); + for obj in &self.webhook_objs { + dep_collector.visit_typ(&obj.typ); + } + dep_collector.deps + } + + pub fn deps_for_component<'a>( + &'a self, + path: &'a ComponentPath, + ) -> IndexSet<&'a ComponentPath> { + let mut dep_collector = DependencyCollector::new(); + let comp = self.get(path); + dep_collector.visit_stripe_object(comp); + dep_collector.deps + } + + pub fn filter_unused_components(&mut self) { + loop { + let mut unused = vec![]; + let webhook_deps = self.deps_for_webhooks(); + let graph = self.gen_component_dep_graph(); + for (path, component) in &self.components { + // The `error` component is a false positive since we don't include the error + // type in dependency calculations, but every requests depends on `error` + if path.as_ref() == "error" || webhook_deps.contains(path) { + continue; + } + + if component.requests.is_empty() + && graph.neighbors_directed(path, Direction::Incoming).count() == 0 + { + unused.push(path.clone()); + } + } + let done_filtering = unused.is_empty(); + if done_filtering { + break; + } + + debug!("Filtering unused components: {unused:#?}"); + for unused_mod in unused { + self.components.remove(unused_mod.as_ref()); + } + } + } + + pub fn get_request_spec(&self, src: RequestSource) -> Option<&RequestSpec> { + for comp in self.components.values() { + for req in &comp.requests { + if req.method_type == src.op && req.req_path == src.path { + return Some(req); + } + } + } + None + } + + fn run_deduplication_pass(&mut self) { + for comp in self.components.values_mut() { + let extra_typs = deduplicate_types(comp); + for (ident, typ) in extra_typs { + comp.deduplicated_objects.insert(ident, typ); + } + } + } + + #[tracing::instrument(level = "debug", skip(self))] + fn apply_overrides(&mut self) -> anyhow::Result<()> { + let mut overrides = Overrides::new(self)?; + for comp in self.components.values_mut() { + comp.visit_mut(&mut overrides); + } + for (obj, override_meta) in overrides.overrides { + self.extra_types.insert( + override_meta.metadata.ident.clone(), + TypeSpec { + obj, + doc: override_meta.metadata.doc, + ident: override_meta.metadata.ident, + mod_path: override_meta.mod_path, + }, + ); + } + + Ok(()) + } + + #[track_caller] + pub fn get_extra_type(&self, ident: &RustIdent) -> &TypeSpec { + &self.extra_types[ident] + } + + #[track_caller] + pub fn get_dedupped_type(&self, ident: &RustIdent, comp: &ComponentPath) -> &DeduppedObject { + &self.get(comp).deduplicated_objects[ident] + } +} + +pub fn get_components(spec: &Spec) -> anyhow::Result { + let mut webhook_objs = vec![]; + let mut components = IndexMap::with_capacity(spec.component_schemas().len()); + + let mut resource_map = HashMap::new(); + let mut obj_map = IndexMap::new(); + let mut id_map = HashMap::new(); + for path in spec.component_schemas().keys() { + let path = ComponentPath::new(path.clone()); + let schema = spec.get_component_schema(&path); + + if let Some(webhook_object) = WebhookObject::from_schema(schema)? { + webhook_objs.push(webhook_object); + continue; + }; + + let stripe_resource = StripeResource::from_schema(schema, path.clone())?; + let data = parse_stripe_schema_as_rust_object(schema, &path, stripe_resource.ident()); + if let Some(obj_name) = &data.object_name { + if let Some(id_typ) = data.id_type.as_ref().and_then(|t| t.as_id_or_opt_id_path()) { + // We will hit duplicate object names from e.g. `account` and `deleted_account`, but sanity check nothing + // worse can happen + if let Some(orig) = id_map.insert(obj_name.clone(), id_typ.clone()) { + if &orig != id_typ { + bail!("Mismatched object name and id type for {}", obj_name); + } + } + } + } + resource_map.insert(path.clone(), stripe_resource); + obj_map.insert(path, data); + } + + for (path, data) in obj_map { + let resource = resource_map.get(&path).unwrap(); + let schema = spec.get_component_schema(&path); + let stripe_reqs: Vec = + if let Some(val) = schema.schema_data.extensions.get("x-stripeOperations") { + serde_json::from_value(val.clone())? + } else { + vec![] + }; + + let inferred_krate = if let Some(package) = &resource.in_package { + Some(infer_crate_by_package(package)) + } else { + maybe_infer_crate_by_path(&path) + }; + let reqs = parse_requests(stripe_reqs, spec, resource.ident(), &id_map)?; + components.insert( + path, + StripeObject { + requests: reqs, + resource: resource.clone(), + data, + krate: inferred_krate.map(CrateInfo::new), + stripe_doc_url: None, + deduplicated_objects: IndexMap::default(), + }, + ); + } + + let mut components = Components { components, webhook_objs, extra_types: Default::default() }; + components.filter_unused_components(); + + validate_crate_info(&components)?; + components.infer_all_crate_assignments()?; + info!("Finished inferring crates"); + + components.apply_overrides()?; + debug!("Finished applying overrides"); + + components.run_deduplication_pass(); + info!("Finished deduplication pass"); + + Ok(components) +} + +#[derive(Debug, Copy, Clone)] +pub struct RequestSource { + pub path: &'static str, + pub op: OperationType, + pub field_name: &'static str, +} + +#[derive(Default)] +struct DependencyCollector<'a> { + deps: IndexSet<&'a ComponentPath>, +} + +impl<'a> DependencyCollector<'a> { + fn new() -> Self { + Self::default() + } +} + +impl<'a> Visit<'a> for DependencyCollector<'a> { + fn visit_typ(&mut self, typ: &'a RustType) + where + Self: Sized, + { + match typ { + RustType::Path { path: PathToType::Component(path), .. } => { + self.deps.insert(path); + } + _ => typ.visit(self), + } + } +} diff --git a/openapi/src/crate_inference.rs b/openapi/src/crate_inference.rs new file mode 100644 index 000000000..2f6afe2e1 --- /dev/null +++ b/openapi/src/crate_inference.rs @@ -0,0 +1,227 @@ +use anyhow::bail; +use indexmap::{IndexMap, IndexSet}; +use petgraph::algo::is_cyclic_directed; +use petgraph::Direction; +use tracing::{debug, error, trace}; + +use crate::components::Components; +use crate::crates::{Crate, CRATE_INFO}; +use crate::graph::ComponentGraph; +use crate::types::ComponentPath; + +/// Do some easy work to sanity check `gen_crates.toml` does not have any spurious or +/// misspelled entries. +pub fn validate_crate_info(components: &Components) -> anyhow::Result<()> { + for krate in &CRATE_INFO.crates { + for name in &krate.paths { + if !components.components.contains_key(name.as_str()) { + bail!("Crate info includes unrecognized {name}. Maybe it is misspelled?"); + } + } + } + Ok(()) +} + +impl Components { + pub fn infer_all_crate_assignments(&mut self) -> anyhow::Result<()> { + // If a component includes requests that have URLs building off another component, + // place with that component. This automates determinations like `external_account` + // ending up in the same crate as `account` since all its requests start with `/account`. + let mut new_assignments: IndexMap = IndexMap::new(); + for (path, component) in &self.components { + let krate = component.krate(); + if krate.is_some() { + continue; + } + let this_obj = self.get(path); + let words = path.split('_'); + let first_two = words.take(2).collect::>().join("_"); + let first_word = path.split_once('_').map(|f| f.0); + for (other_path, other_component) in &self.components { + let Some(krate) = other_component.krate() else { + continue; + }; + if this_obj.is_nested_resource_of(other_component) { + new_assignments.insert(path.clone(), krate.base()); + break; + } + + if other_path.as_ref() == first_two { + new_assignments.insert(path.clone(), krate.base()); + break; + } + if first_word == Some(other_path.as_ref()) { + new_assignments.insert(path.clone(), krate.base()); + break; + } + } + } + debug!("Inferred based on naming: {new_assignments:#?} "); + for (path, krate) in new_assignments { + self.get_mut(&path).assign_crate(krate); + } + + infer_crates_using_deps(self, Self::maybe_infer_crate_by_what_depends_on_it); + infer_crates_using_deps(self, Self::maybe_infer_crate_by_deps); + self.ensure_no_missing_crates()?; + self.assign_paths_required_to_share_types(); + self.validate_crate_assignment() + } + + /// If we find a component with no assigned crate, return an error with some + /// additional dependency graph information to help determine why. + fn ensure_no_missing_crates(&self) -> anyhow::Result<()> { + let missing_crates = self + .components + .iter() + .filter(|(_, comp)| comp.krate().is_none()) + .map(|(name, _)| name) + .collect::>(); + + // If we've got missing crates, also look at the dep graph to dump some + // helpful info + if !missing_crates.is_empty() { + let graph = self.gen_component_dep_graph(); + for missing in &missing_crates { + let depended_on = + graph.neighbors_directed(missing, Direction::Incoming).collect::>(); + let depended_crates = + depended_on.iter().map(|m| self.get(m).krate()).collect::>(); + error!("Could not infer crate for {missing}. Depended on by components {depended_on:?}, crates {depended_crates:?}") + } + bail!("Some components could not have their crate inferred: {:#?}", missing_crates); + } + + Ok(()) + } + + fn validate_crate_assignment(&self) -> anyhow::Result<()> { + let graph = self.gen_crate_dep_graph(); + let deps_for_shared_crate = graph.neighbors(Crate::SHARED).collect::>(); + if !deps_for_shared_crate.is_empty() { + bail!( + "Shared types crate should not have dependencies, but has dependencies {:#?}!", + deps_for_shared_crate + ); + } + if is_cyclic_directed(&graph) { + bail!("Crate dependency graph contains a cycle!"); + } + let requests_in_types = self + .components + .iter() + .filter(|(_, comp)| { + comp.krate_unwrapped().base() == Crate::SHARED && !comp.requests.is_empty() + }) + .map(|(path, _)| path) + .collect::>(); + if !requests_in_types.is_empty() { + bail!("Components have requests, not allowed in types crate: {requests_in_types:#?}"); + } + Ok(()) + } + + fn assign_paths_required_to_share_types(&mut self) { + // Paths for components required to live in the `stripe_shared` crate. Adding `event` is + // used for webhooks + const PATHS_IN_TYPES: &[&str] = &["event"]; + + loop { + let mut required = vec![]; + let graph = self.gen_component_dep_graph(); + for (path, component) in &self.components { + if component.krate_unwrapped().are_type_defs_shared() { + continue; + } + if PATHS_IN_TYPES.contains(&path.as_ref()) { + required.push(path.clone()); + continue; + } + let my_crate = component.krate_unwrapped().base(); + let depended_on = + graph.neighbors_directed(path, Direction::Incoming).collect::>(); + let depended_crates = depended_on + .iter() + .map(|m| self.get(m).krate_unwrapped().for_types()) + .filter(|c| *c != my_crate) + .collect::>(); + if !depended_crates.is_empty() + || depended_crates.iter().any(|d| *d == Crate::SHARED) + { + required.push(path.clone()); + } + } + + let done = required.is_empty(); + if done { + break; + } + for req in required { + self.get_mut(&req).krate_unwrapped_mut().set_share_type_defs(); + } + } + } + + fn maybe_infer_crate_by_what_depends_on_it( + &self, + path: &ComponentPath, + graph: &ComponentGraph, + ) -> Option { + let depended_on_by = graph + .neighbors_directed(path, Direction::Incoming) + .map(|n| self.get(n).krate().map(|krate| krate.base())) + .collect::>>()?; + + let first = depended_on_by.first()?; + if depended_on_by.iter().all(|d| d == first) { + Some(*first) + } else { + None + } + } + + fn maybe_infer_crate_by_deps( + &self, + path: &ComponentPath, + graph: &ComponentGraph, + ) -> Option { + let known_dependents = graph + .neighbors(path) + .map(|n| self.get(n).krate().map(|krate| krate.base())) + .collect::>>()?; + + let first = known_dependents.first()?; + if known_dependents.iter().all(|d| d == first) { + Some(*first) + } else { + None + } + } +} + +fn infer_crates_using_deps( + components: &mut Components, + infer_test: fn(&Components, &ComponentPath, &ComponentGraph) -> Option, +) { + loop { + let mut new_assignments: IndexMap = IndexMap::new(); + let graph = components.gen_component_dep_graph(); + for (path, component) in &components.components { + if component.krate().is_some() { + continue; + } + if let Some(assignment) = infer_test(components, path, &graph) { + new_assignments.insert(path.clone(), assignment); + } + } + let no_new_assignments = new_assignments.is_empty(); + + trace!("Inferred {new_assignments:#?}"); + for (mod_name, krate) in new_assignments { + components.get_mut(&mod_name).assign_crate(krate); + } + if no_new_assignments { + break; + } + } +} diff --git a/openapi/src/crate_table.rs b/openapi/src/crate_table.rs new file mode 100644 index 000000000..c92e748a1 --- /dev/null +++ b/openapi/src/crate_table.rs @@ -0,0 +1,47 @@ +use tabled::settings::Style; +use tabled::{Table, Tabled}; + +use crate::components::Components; +use crate::stripe_object::StripeObject; +use crate::utils::write_to_file; + +/// Write a table describing where all generated requests live +pub fn write_crate_table(components: &Components) -> anyhow::Result<()> { + #[derive(Tabled)] + struct CrateDisplay { + #[tabled(rename = "Name")] + name_cell: String, + #[tabled(rename = "Crate")] + krate: &'static str, + #[tabled(rename = "Feature Gate")] + feature_gate: String, + } + + let mut comps = vec![]; + for obj in components.components.values() { + if obj.requests.is_empty() { + continue; + } + comps.push(CrateDisplay { + krate: obj.krate_unwrapped().base().name(), + feature_gate: obj.mod_path(), + name_cell: name_cell(obj), + }) + } + // Cloning when sorting definitely inefficient, but not a hot path at all + comps.sort_unstable_by_key(|c| (c.krate, c.name_cell.clone())); + let mut table = Table::new(comps); + table.with(Style::markdown()); + let display = table.to_string(); + write_to_file(display, "crate_info.md")?; + Ok(()) +} + +fn name_cell(obj: &StripeObject) -> String { + let ident = obj.ident(); + if let Some(doc_url) = &obj.stripe_doc_url { + format!("[{ident}]({doc_url})") + } else { + ident.to_string() + } +} diff --git a/openapi/src/crates.rs b/openapi/src/crates.rs new file mode 100644 index 000000000..a5740b5a4 --- /dev/null +++ b/openapi/src/crates.rs @@ -0,0 +1,107 @@ +use std::fmt::{Display, Formatter}; +use std::fs::read_to_string; +use std::path::PathBuf; + +use lazy_static::lazy_static; +use serde::Deserialize; + +#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)] +pub struct Crate(&'static str); + +impl Crate { + pub const SHARED: Self = Self("stripe_shared"); + + pub fn generated_out_path(self) -> String { + format!("crates/{}", self.name()) + } + + pub fn name(self) -> &'static str { + self.0 + } + + fn generate_to(self) -> String { + let out_path = self.generated_out_path(); + format!("{out_path}/src") + } + + pub fn get_path(self) -> PathBuf { + PathBuf::from(self.generate_to()) + } + + pub fn get_path_to_mod(self) -> PathBuf { + self.get_path().join("mod.rs") + } +} + +impl Display for Crate { + fn fmt(&self, f: &mut Formatter<'_>) -> std::fmt::Result { + f.write_str(self.0) + } +} + +/// Information about an automatically generated crate. +#[derive(Deserialize)] +pub struct CrateGen { + /// Name of the crate + pub name: String, + /// Component paths which should live in this crate + #[serde(default)] + pub paths: Vec, + /// Package names which should live in this crate + #[serde(default)] + pub packages: Vec, + /// Used to generate a top-level comment for the crate. + pub description: String, +} + +#[derive(Deserialize)] +pub struct CrateInfo { + pub crates: Vec, +} + +fn load_crate_info() -> anyhow::Result { + let toml_str = read_to_string("gen_crates.toml")?; + let loaded = toml::from_str(&toml_str)?; + Ok(loaded) +} + +lazy_static! { + /// Content of `gen_crates.toml` + pub static ref CRATE_INFO: CrateInfo = load_crate_info().expect("Could not load crate info"); + /// All crate names + pub static ref ALL_CRATES: Vec = + CRATE_INFO.crates.iter().map(|c| Crate(&c.name)).collect(); +} + +#[track_caller] +fn crate_info_unwrapped(krate: Crate) -> &'static CrateGen { + CRATE_INFO.crates.iter().find(|k| k.name == krate.0).expect("Crate not found") +} + +pub fn get_crate_doc_comment(krate: Crate) -> &'static str { + &crate_info_unwrapped(krate).description +} + +/// Assign the crate a package should live in. Each package is expected to be +/// specified in `gen_crates.toml`, so the assignment is hardcoded. +pub fn infer_crate_by_package(package: &str) -> Crate { + for krate in &CRATE_INFO.crates { + if krate.packages.iter().any(|p| p == package) { + return Crate(&krate.name); + } + } + panic!("Package {} requires a mapping in gen_crates.toml", package); +} + +/// Use a hardcoded assignment if available to determine the crate we should assign +/// to this component. +pub fn maybe_infer_crate_by_path(path: &str) -> Option { + // Make sure deleted variants end up in the same place as the non-deleted version + let path = path.trim_start_matches("deleted_"); + for krate in &CRATE_INFO.crates { + if krate.paths.iter().any(|p| p == path) { + return Some(Crate(&krate.name)); + } + } + None +} diff --git a/openapi/src/deduplication.rs b/openapi/src/deduplication.rs new file mode 100644 index 000000000..8dc1930ba --- /dev/null +++ b/openapi/src/deduplication.rs @@ -0,0 +1,188 @@ +use indexmap::map::Entry; +use indexmap::IndexMap; +use tracing::debug; + +use crate::rust_object::{ObjectKind, ObjectMetadata, RustObject}; +use crate::rust_type::{PathToType, RustType}; +use crate::stripe_object::StripeObject; +use crate::types::{ComponentPath, RustIdent}; +use crate::visitor::{Visit, VisitMut}; + +#[derive(Debug, Default)] +struct CollectDuplicateObjects { + objs: IndexMap>, +} + +impl Visit<'_> for CollectDuplicateObjects { + fn visit_obj(&mut self, obj: &RustObject, meta: Option<&ObjectMetadata>) { + if let Some(meta) = meta { + match self.objs.entry(obj.clone()) { + Entry::Occupied(mut occ) => { + occ.get_mut().push(meta.clone()); + } + Entry::Vacant(entry) => { + entry.insert(vec![meta.clone()]); + } + } + }; + obj.visit(self); + } +} + +#[derive(Debug, Clone, Eq, PartialEq, Hash)] +pub struct DeduppedObjectInfo { + pub ident: RustIdent, + pub kind: ObjectKind, +} + +#[derive(Debug, Clone, Eq, PartialEq, Hash)] +pub struct DeduppedObject { + pub info: DeduppedObjectInfo, + pub object: RustObject, +} + +#[derive(Debug)] +struct DeduplicateObjects { + objs: IndexMap, + component_path: ComponentPath, +} + +impl DeduplicateObjects { + pub fn new(path: ComponentPath) -> Self { + Self { objs: Default::default(), component_path: path } + } +} + +impl VisitMut for DeduplicateObjects { + fn visit_typ_mut(&mut self, typ: &mut RustType) + where + Self: Sized, + { + if let Some((obj, _)) = typ.as_object_mut() { + if let Some(dedup_spec) = self.objs.get(obj) { + *typ = RustType::Path { + path: PathToType::Deduplicated { + path: self.component_path.clone(), + ident: dedup_spec.ident.clone(), + }, + is_ref: false, + } + } + } + typ.visit_mut(self); + } +} + +fn implied_name_from_meta_doc(metadata: &ObjectMetadata) -> Option<&str> { + let doc = metadata.doc.as_ref()?; + implied_name_from_doc(doc) +} + +fn implied_name_from_doc(doc: &str) -> Option<&str> { + let mut words = doc.split_ascii_whitespace(); + if words.next() != Some("The") { + return None; + } + let second_word = words.next(); + if words.next() != Some("of") { + return None; + } + second_word +} + +fn maybe_infer_by_field_name(meta: &[ObjectMetadata]) -> Option { + let type_data = meta.iter().find(|m| m.kind == ObjectKind::Type)?; + let parent = type_data.parent.as_ref()?; + let field_name = type_data.field_name.as_ref()?; + + if meta.iter().any(|m| m.field_name.as_ref() != Some(field_name)) { + return None; + } + Some(DeduppedObjectInfo { + ident: RustIdent::joined(parent, field_name), + kind: ObjectKind::Type, + }) +} + +/// Try to infer an identifier given metadata about identical objects +fn infer_dedupped_ident(meta: &[ObjectMetadata]) -> Option { + let first = meta.first().unwrap(); + if let Some(title) = &first.title { + // `param` is used very generally and will not be a helpful name to infer + if title != "param" && meta.iter().all(|m| m.title.as_ref() == Some(title)) { + return Some(RustIdent::create(title)); + } + } + + if let Some(doc_name) = implied_name_from_meta_doc(first) { + if let Some(parent) = &first.parent { + if meta.iter().all(|m| { + implied_name_from_meta_doc(m) == Some(doc_name) && m.parent.as_ref() == Some(parent) + }) { + return Some(RustIdent::joined(parent, doc_name)); + } + } + } + None +} + +fn infer_dedupped_object_for( + meta: &[ObjectMetadata], + obj: &RustObject, +) -> Option { + if matches!(obj, RustObject::FieldlessEnum(_)) { + if let Some(dedupped) = maybe_infer_by_field_name(meta) { + return Some(dedupped); + } + } + let ident = infer_dedupped_ident(meta)?; + let first_kind = meta.first().unwrap().kind; + if meta.iter().all(|m| m.kind == first_kind) { + return Some(DeduppedObjectInfo { ident, kind: first_kind }); + } + None +} + +#[tracing::instrument(level = "debug", skip(comp), fields(path = %comp.path()))] +pub fn deduplicate_types(comp: &mut StripeObject) -> IndexMap { + let mut objs = IndexMap::new(); + let comp_path = comp.path().clone(); + + // We run deduplication passes until there are no further changes since one round + // of deduplicating can enable another + loop { + let mut collector = CollectDuplicateObjects::default(); + comp.visit(&mut collector); + + let mut dedupper = DeduplicateObjects::new(comp_path.clone()); + for (obj, meta) in collector.objs { + // Nothing to deduplicate + if meta.len() < 2 { + continue; + } + if let Some(inferred) = infer_dedupped_object_for(&meta, &obj) { + let ident = &inferred.ident; + // Don't add another deduplicated type with the same name as an existing one + if dedupper.objs.values().all(|o| &o.ident != ident) && !objs.contains_key(ident) { + dedupper.objs.insert(obj, inferred); + } + } + } + // If we weren't able to deduplicate anything new, we're done + if dedupper.objs.is_empty() { + break; + } + + comp.visit_mut(&mut dedupper); + for (obj, info) in dedupper.objs { + let ident = info.ident.clone(); + if let Some(dup) = objs.insert(ident, DeduppedObject { info, object: obj }) { + panic!("Tried to add duplicate ident {}", dup.info.ident); + } + } + } + if !objs.is_empty() { + debug!("Deduplicated {} types", objs.len()); + } + objs +} diff --git a/openapi/src/file_generator.rs b/openapi/src/file_generator.rs deleted file mode 100644 index f0fe0cf62..000000000 --- a/openapi/src/file_generator.rs +++ /dev/null @@ -1,246 +0,0 @@ -use std::{ - collections::{btree_map::Entry, BTreeMap, BTreeSet}, - fs::write, - path::Path, -}; - -use anyhow::{Context, Result}; -use heck::SnakeCase; - -use crate::codegen::{gen_enums, gen_objects, gen_prelude, gen_unions}; -use crate::spec::{as_first_enum_value, as_object_properties}; -use crate::{ - codegen::gen_generated_schemas, - codegen::gen_impl_requests, - codegen::gen_inferred_params, - codegen::gen_inferred_structs, - codegen::gen_struct, - metadata::Metadata, - types::InferredEnum, - types::InferredObject, - types::InferredStruct, - types::InferredUnion, - types::{CopyOrClone, InferredParams}, - url_finder::UrlFinder, -}; - -/// -#[derive(Default, Debug)] -pub struct FileGenerator { - pub name: String, - - /// The ids that must be imported in this file. - pub use_ids: BTreeSet, - /// The config that must be imported in this file. - pub use_config: BTreeSet<&'static str>, - /// The params that must be imported in this file. - pub use_params: BTreeSet<&'static str>, - /// The resources that must be imported in this file. - pub use_resources: BTreeSet, - /// Extra (simple) enums that were / will be generated in this file. - pub inferred_enums: BTreeMap, - /// Extra (complex) enums that were / will be generated in this file. - pub inferred_unions: BTreeMap, - /// Extra structs that were / will be generated in this file. - pub inferred_structs: BTreeMap, - /// The request parameter structs that were / will be generated in this file. - pub inferred_parameters: BTreeMap, - /// The schemas that were / will be generated in this file. - pub generated_schemas: BTreeMap, - /// New experimental struct thatclear - /// will eventually do most of the general work - pub generated_objects: BTreeMap, -} - -impl FileGenerator { - pub fn new(object_name: String) -> Self { - Self { name: object_name, ..Default::default() } - } - - fn get_path(&self) -> String { - self.name.replace('.', "_").to_snake_case() + ".rs" - } - - /// Generates this file to the given Path, returning a set - /// of FileGenerators for the files this one depends on. - #[tracing::instrument(skip(self, meta, url_finder))] - pub fn write( - &mut self, - base: T, - meta: &Metadata, - url_finder: &UrlFinder, - ) -> Result> - where - T: AsRef + std::fmt::Debug, - { - let path = self.get_path(); - let (out, additional) = self.generate(meta, url_finder)?; - let pathbuf = base.as_ref().join(path); - tracing::debug!("writing object {} to {:?}", self.name, pathbuf); - write(&pathbuf, out.as_bytes())?; - Ok(additional) - } - - /// Generates this file, returning a set of FileGenerators - /// for the files this one depends on. - #[tracing::instrument(skip(self, meta, url_finder))] - pub fn generate( - &mut self, - meta: &Metadata, - url_finder: &UrlFinder, - ) -> Result<(String, BTreeSet)> { - let mut out = String::new(); - let mut shared_objects = BTreeSet::::new(); - - let id_type = meta.schema_to_id_type(&self.name); - let struct_name = meta.schema_to_rust_type(&self.name); - let properties = meta - .spec - .component_schemas() - .get(&self.name) - .and_then(|s| s.as_item()) - .and_then(as_object_properties) - .context("No properties")?; - - gen_struct(&mut out, self, meta, &mut shared_objects, url_finder); - - if let Some(object_literal) = - properties.get("object").and_then(|o| o.as_item()).and_then(|s| as_first_enum_value(s)) - { - self.gen_object_trait(meta, id_type, &mut out, struct_name, &object_literal); - } - - gen_generated_schemas(&mut out, self, meta, &mut shared_objects); - - gen_inferred_params(&mut out, self, meta, &mut shared_objects); - - gen_inferred_structs(&mut out, self, meta, &mut shared_objects); - - gen_unions(&mut out, &self.inferred_unions, meta); - - gen_enums(&mut out, &self.inferred_enums, meta); - - gen_objects(&mut out, &self.generated_objects); - - Ok((gen_prelude(self, meta) + &out, shared_objects)) - } - - fn gen_object_trait( - &mut self, - meta: &Metadata, - id_type: Option<(String, CopyOrClone)>, - out: &mut String, - struct_name: String, - object_literal: &str, - ) { - if let Some(impls) = - gen_impl_requests(self, meta, id_type.as_ref().map(|(x, _)| x.as_str())) - { - out.push('\n'); - out.push_str(&impls); - } - self.use_params.insert("Object"); - out.push('\n'); - out.push_str("impl Object for "); - out.push_str(&struct_name); - out.push_str(" {\n"); - out.push_str(" type Id = "); - if let Some((id_type, _)) = &id_type { - out.push_str(id_type); - out.push_str(";\n"); - out.push_str(" fn id(&self) -> Self::Id {\n self.id.clone()\n }\n"); - } else { - out.push_str("();\n"); - out.push_str(" fn id(&self) -> Self::Id {}\n"); - } - out.push_str(" fn object(&self) -> &'static str {\n \""); - out.push_str(object_literal); - out.push_str("\"\n }\n"); - out.push_str("}\n"); - } - - pub fn insert_enum(&mut self, name: impl Into, enum_: InferredEnum) { - if let Err(other) = self.try_insert_enum(name, enum_.clone()) { - panic!("conflicting enums are not compatible:\n\t{:?}\n\t!=\n\t{:?}", enum_, other); - } - } - - pub fn try_insert_enum( - &mut self, - name: impl Into, - enum_: InferredEnum, - ) -> Result<(), &InferredEnum> { - let name = name.into(); - let mut enum_ = enum_; - enum_.options.sort(); - if let Entry::Vacant(e) = self.inferred_enums.entry(name.clone()) { - e.insert(enum_); - return Ok(()); - } - if let Some(other) = self.inferred_enums.get(&name) { - if enum_.options != other.options { - return Err(other); - } - } - Ok(()) - } - - pub fn insert_struct(&mut self, name: impl Into, struct_: InferredStruct) { - if let Err(other) = self.try_insert_struct(name, struct_.clone()) { - panic!("conflicting structs are not compatible:\n\t{:?}\n\t!=\n\t{:?}", struct_, other); - } - } - - pub fn try_insert_struct( - &mut self, - name: impl Into, - struct_: InferredStruct, - ) -> Result<(), &InferredStruct> { - let name = name.into(); - if let Entry::Vacant(e) = self.inferred_structs.entry(name) { - e.insert(struct_); - return Ok(()); - } - Ok(()) - } - - pub fn add_use(&mut self, use_path: &str) { - for path in use_path.split(',') { - match path.into() { - "" | "String" => {} - "Metadata" => { - self.use_params.insert("Metadata"); - } - "Expandable" => { - self.use_params.insert("Expandable"); - } - path if path.ends_with("Id") && path != "TaxId" => { - self.use_ids.insert(path.into()); - } - path => { - self.use_resources.insert(path.into()); - } - } - } - } -} - -impl PartialEq for FileGenerator { - fn eq(&self, other: &Self) -> bool { - self.name == other.name - } -} - -impl Eq for FileGenerator {} - -impl PartialOrd for FileGenerator { - fn partial_cmp(&self, other: &Self) -> Option { - self.name.partial_cmp(&other.name) - } -} - -impl Ord for FileGenerator { - fn cmp(&self, other: &Self) -> std::cmp::Ordering { - self.name.cmp(&other.name) - } -} diff --git a/openapi/src/graph.rs b/openapi/src/graph.rs new file mode 100644 index 000000000..ecf421803 --- /dev/null +++ b/openapi/src/graph.rs @@ -0,0 +1,60 @@ +use indexmap::IndexSet; +use petgraph::prelude::DiGraphMap; + +use crate::components::Components; +use crate::crates::{Crate, ALL_CRATES}; +use crate::types::ComponentPath; + +pub type ComponentGraph<'a> = DiGraphMap<&'a ComponentPath, ()>; + +impl Components { + /// Generate a dependency graph with an edge from A to B implying that A depends on B + pub fn gen_component_dep_graph(&self) -> ComponentGraph { + let mut graph = DiGraphMap::new(); + for path in self.components.keys() { + graph.add_node(path); + } + + for path in self.components.keys() { + let deps = self.deps_for_component(path); + for dep in deps { + // Don't clutter with self edges since they aren't particularly meaningful + // in this context + if dep != path { + graph.add_edge(path, dep, ()); + } + } + } + graph + } + + pub fn gen_crate_dep_graph(&self) -> DiGraphMap { + let mut graph = DiGraphMap::new(); + + for krate in &*ALL_CRATES { + graph.add_node(*krate); + if *krate != Crate::SHARED { + // Everybody depends on `stripe_shared` because of reexports + graph.add_edge(*krate, Crate::SHARED, ()); + } + } + + for krate in &*ALL_CRATES { + let members = self.get_crate_members(*krate); + let mut deps = IndexSet::new(); + for member in members { + let comp_deps = self.deps_for_component(member); + deps.extend(comp_deps); + } + for dep in deps { + let dependent_crate = self.get(dep).krate_unwrapped().for_types(); + // Don't clutter with self edges since they aren't particularly meaningful + // in this context + if dependent_crate != *krate { + graph.add_edge(*krate, dependent_crate, ()); + } + } + } + graph + } +} diff --git a/openapi/src/ids.rs b/openapi/src/ids.rs new file mode 100644 index 000000000..da7286ae5 --- /dev/null +++ b/openapi/src/ids.rs @@ -0,0 +1,46 @@ +use std::collections::HashMap; +use std::fmt::Write; +use std::fs::File; + +use lazy_static::lazy_static; +use serde::Deserialize; + +use crate::types::{ComponentPath, RustIdent}; +use crate::STRIPE_TYPES; + +/// The kind of prefix an id is required to follow +#[derive(Deserialize)] +#[serde(untagged)] +enum IdPrefix { + /// Must start with given prefix + Single(String), + /// Must start with any of the given prefixes + Multi(Vec), +} + +fn load_id_prefixes() -> anyhow::Result> { + let prefixes = serde_json::from_reader(File::open("id_prefixes.json")?)?; + Ok(prefixes) +} + +lazy_static! { + /// Map of component_path to what the prefix for this id should be. + static ref ID_PREFIXES: HashMap = + load_id_prefixes().expect("Invalid id prefix file"); +} + +pub fn write_object_id(out: &mut String, path: &ComponentPath, ident: &RustIdent) { + match ID_PREFIXES.get(path.as_ref()) { + Some(IdPrefix::Single(prefix)) => { + let _ = writeln!(out, r#"{STRIPE_TYPES}::def_id!({ident}, "{prefix}_");"#); + } + Some(IdPrefix::Multi(prefixes)) => { + let prefix_arg = + prefixes.iter().map(|p| format!(r#""{p}_""#)).collect::>().join("|"); + let _ = writeln!(out, "{STRIPE_TYPES}::def_id!({ident}, {prefix_arg});"); + } + None => { + let _ = writeln!(out, "{STRIPE_TYPES}::def_id!({ident});"); + } + } +} diff --git a/openapi/src/lib.rs b/openapi/src/lib.rs new file mode 100644 index 000000000..34ed5740b --- /dev/null +++ b/openapi/src/lib.rs @@ -0,0 +1,26 @@ +pub mod codegen; +mod components; +mod crate_inference; +mod crate_table; +pub mod crates; +mod deduplication; +mod graph; +mod ids; +mod object_writing; +mod overrides; +mod printable; +mod requests; +mod rust_object; +mod rust_type; +pub mod spec; +pub mod spec_fetch; +mod spec_inference; +mod stripe_object; +mod templates; +mod types; +pub mod url_finder; +pub mod utils; +mod visitor; +mod webhook; + +pub const STRIPE_TYPES: &str = "stripe_types"; diff --git a/openapi/src/main.rs b/openapi/src/main.rs index 46d60ee74..086e76de8 100644 --- a/openapi/src/main.rs +++ b/openapi/src/main.rs @@ -1,77 +1,128 @@ -use std::{collections::BTreeSet, fs}; - -use anyhow::{Context, Result}; -use structopt::StructOpt; - -use crate::spec::Spec; -use crate::spec_fetch::fetch_spec; -use crate::{metadata::Metadata, url_finder::UrlFinder}; - -mod codegen; -mod file_generator; -mod mappings; -mod metadata; -mod spec; -mod spec_fetch; -mod types; -mod url_finder; -mod util; - -#[derive(Debug, StructOpt)] +use std::fmt::Debug; +use std::fs; +use std::fs::File; +use std::path::Path; + +use anyhow::{bail, Context, Result}; +use clap::Parser; +use petgraph::dot::{Config, Dot}; +use stripe_openapi_codegen::codegen::CodeGen; +use stripe_openapi_codegen::crates::ALL_CRATES; +use stripe_openapi_codegen::spec::Spec; +use stripe_openapi_codegen::spec_fetch; +use stripe_openapi_codegen::spec_fetch::fetch_spec; +use stripe_openapi_codegen::url_finder::{update_api_doc_data, UrlFinder}; +use stripe_openapi_codegen::utils::write_to_file; +use tracing::info; + +#[derive(Debug, Parser)] struct Command { - /// Input path for the OpenAPI spec, defaults to `spec3.json` - #[structopt(default_value = "spec3.json")] + /// Input path for the OpenAPI spec, defaults to `spec3.sdk.json` + #[arg(default_value = "spec3.sdk.json")] spec_path: String, /// Output directory for generated code, defaults to `out` - #[structopt(long, default_value = "out")] + #[arg(long, default_value = "out")] out: String, /// If not passed, skips the step of fetching the spec. Otherwise, `latest` for the /// newest spec release, `current` for the version used in the latest codegen update, /// or a specific version, such as `v171` - #[structopt(long, parse(try_from_str = spec_fetch::parse_spec_version))] + #[arg(long, value_parser = spec_fetch::parse_spec_version)] fetch: Option, + /// Instead of writing files, generate a graph of dependencies in `graphviz` `DOT` format. Writes + /// to `graph.txt` + #[arg(long)] + graph: bool, + /// Update the Stripe API docs instead of using the existing data in the repo + #[arg(long)] + update_api_docs: bool, + /// The URL to target for the stripe docs. + #[arg(long, default_value = "https://stripe.com/docs/api")] + api_docs_url: String, + /// Skip the step of copying the generated code from `out` to `generated/`. + #[arg(long)] + dry_run: bool, } fn main() -> Result<()> { tracing_subscriber::fmt::init(); - let args = Command::from_args(); + let args = Command::parse(); let in_path = args.spec_path; - let out_path = args.out; - fs::create_dir_all(&out_path).context("could not create out folder")?; + let out_path = Path::new(&args.out); + if out_path.exists() { + fs::remove_dir_all(out_path).context("could not remove out folder")?; + } + fs::create_dir_all(out_path).context("could not create out folder")?; - tracing::info!("generating code for {} to {}", in_path, out_path); + info!("generating code for {} to {}", in_path, out_path.display()); let spec = if let Some(version) = args.fetch { let raw = fetch_spec(version, &in_path)?; Spec::new(serde_json::from_value(raw)?) } else { - let raw = fs::File::open(in_path).context("failed to load the specfile. does it exist?")?; + let raw = File::open(in_path).context("failed to load the specfile. does it exist?")?; Spec::new(serde_json::from_reader(&raw).context("failed to read json from specfile")?) }; - tracing::info!("Finished parsing spec"); + info!("Finished parsing spec"); - let meta = Metadata::from_spec(&spec); let url_finder = UrlFinder::new().context("couldn't initialize url finder")?; + let codegen = CodeGen::new(spec, url_finder)?; + + if args.update_api_docs { + update_api_doc_data(&args.api_docs_url, &codegen.components)?; + return Ok(()); + } + + if args.graph { + let comp_graph = codegen.components.gen_component_dep_graph(); + let graph_txt = format!("{:?}", Dot::with_config(&comp_graph, &[Config::EdgeNoLabel])); + write_to_file(graph_txt, "graphs/components_graph.txt")?; - meta.write_placeholders(&out_path); - meta.write_version(&out_path); + let crate_graph = codegen.components.gen_crate_dep_graph(); + let graph_txt = format!("{:?}", Dot::with_config(&crate_graph, &[Config::EdgeNoLabel])); + write_to_file(graph_txt, "graphs/crate_graph.txt")?; + return Ok(()); + } - // write files and get those files referenced - let shared_objects = meta - .get_files() - .into_iter() - .flat_map(|mut f| f.write(&out_path, &meta, &url_finder)) - .flatten(); + codegen.write_files()?; - // write out the 'indirect' files - let extra_objects = shared_objects - .flat_map(|mut f| f.write(&out_path, &meta, &url_finder)) - .flatten() - .collect::>(); + let mut fmt_cmd = std::process::Command::new("cargo"); + fmt_cmd.arg("+nightly").arg("fmt").arg("--"); + for krate in &*ALL_CRATES { + fmt_cmd.arg(format!("out/{}/src/mod.rs", krate.generated_out_path())); + } + fmt_cmd.arg("out/stripe_webhook/mod.rs"); - // todo(arlyon): understand the implications of this - tracing::warn!("leftover objects: {:#?}", extra_objects); + if !args.dry_run { + info!("Formatting generated files"); + let out = fmt_cmd.output()?; + if !out.status.success() { + bail!("Rustfmt failed with outputs {:?}", out); + } + + info!("Copying generated files"); + run_rsync("out/crates/", "../generated/")?; + run_rsync("out/stripe_webhook/", "../stripe_webhook/src/generated/")?; + + std::process::Command::new("cp") + .arg("out/crate_info.md") + .arg("../crate_info.md") + .output()?; + } + Ok(()) +} +// --delete-during so that generated files don't stick around when not +// generated anymore, see https://github.com/arlyon/async-stripe/issues/229 +fn run_rsync(src: &str, dest: &str) -> Result<()> { + let out = std::process::Command::new("rsync") + .arg("-a") + .arg("--delete-during") + .arg(src) + .arg(dest) + .output()?; + if !out.status.success() { + bail!("rsync failed with outputs {:?}", out); + } Ok(()) } diff --git a/openapi/src/mappings.rs b/openapi/src/mappings.rs deleted file mode 100644 index 843bfc475..000000000 --- a/openapi/src/mappings.rs +++ /dev/null @@ -1,547 +0,0 @@ -use std::collections::BTreeMap; - -pub fn id_renames() -> BTreeMap<&'static str, &'static str> { - BTreeMap::from([ - ("fee_refund", "application_fee_refund"), - ("invoiceitem", "invoice_item"), - ("line_item", "invoice_line_item"), - ("source_transaction", "charge"), - ("item", "checkout_session_item"), - ]) -} - -pub type ObjectMap = BTreeMap<&'static str, &'static str>; - -#[rustfmt::skip] -pub fn object_mappings() -> ObjectMap { - BTreeMap::from([ - // Config for object types - ("account_business_profile", "business_profile"), - ("account_capabilities_card_issuing", "capability_status"), - ("account_capabilities_card_payments", "capability_status"), - ("account_capabilities_legacy_payments", "capability_status"), - ("account_capabilities_platform_payments", "capability_status"), - ("account_capabilities_jcb_payments", "capability_status"), - ("account_capabilities_au_becs_debit_payments", "capability_status"), - ("account_capabilities_tax_reporting_us_1099_k", "capability_status"), - ("account_capabilities_tax_reporting_us_1099_misc", "capability_status"), - ("account_capabilities_transfers", "capability_status"), - ("account_branding_settings", "branding_settings"), - ("account_card_payments_settings", "card_payments_settings"), - ("account_dashboard_settings", "dashboard_settings"), - ("account_decline_charge_on", "decline_charge_on"), - ("account_external_account_union", "external_account"), - ("account_payments_settings", "payments_settings"), - ("account_payout_settings", "payout_settings"), - ("account_tos_acceptance", "tos_acceptance"), - ("charge_fraud_details", "fraud_details"), - ("charge_transfer_data", "transfer_data"), - ("fee_refund", "application_fee_refund"), - ("issuing_authorization_merchant_data", "merchant_data"), - ("issuing_authorization_wallet_provider", "wallet_provider"), - ("item", "checkout_session_item"), - ("invoice_collection_method", "collection_method"), - ("invoices_resource_invoice_tax_id_type", "tax_id_type"), - ("invoice_tax_amount", "tax_amount"), - ("invoiceitem", "invoice_item"), - ("legal_entity_company", "company"), - ("legal_entity_japan_address", "address"), - ("legal_entity_company_verification", "company_verification"), - ("legal_entity_company_verification_document", "company_verification_document"), - ("legal_entity_person_verification", "person_verification"), - ("legal_entity_person_verification_document", "person_verification_document"), - ("line_item", "invoice_line_item"), - ("payment_method_card", "card_details"), - ("payment_method_card_present", "card_present"), - ("payment_method_card_wallet", "wallet_details"), - ("payment_method_card_wallet_amex_express_checkout", "wallet_amex_express_checkout"), - ("payment_method_card_wallet_apple_pay", "wallet_apple_pay"), - ("payment_method_card_wallet_google_pay", "wallet_google_pay"), - ("payment_method_card_wallet_masterpass", "wallet_masterpass"), - ("payment_method_card_wallet_samsung_pay", "wallet_samsung_pay"), - ("payment_method_card_wallet_visa_checkout", "wallet_visa_checkout"), - ("payment_method_card_wallet_type", "wallet_type"), - ("payment_pages_payment_page_resources_shipping_address_collection", "shipping_address_collection"), - ("tax_id_data_type", "tax_id_type"), - - // Config for `account` params - ("create_account_company", "company_params"), - ("update_account_company", "company_params"), - ("company_params_verification", "company_verification_params"), - ("person_verification_params_document", "verification_document_params"), - ("person_verification_params_additional_document", "verification_document_params"), - ("create_account_individual", "person_params"), - ("update_account_individual", "person_params"), - ("create_account_requested_capabilities", "requested_capability"), - ("update_account_requested_capabilities", "requested_capability"), - ("create_account_settings", "account_settings_params"), - ("update_account_settings", "account_settings_params"), - ("account_settings_params_branding", "branding_settings_params"), - ("account_settings_params_card_payments", "card_payments_settings_params"), - ("account_settings_params_payments", "payments_settings_params"), - ("account_settings_params_dashboard_settings", "dashboard_settings_params"), - ("account_settings_params_payouts", "payout_settings_params"), - ("create_account_tos_acceptance", "accept_tos"), - ("update_account_tos_acceptance", "accept_tos"), - ("card_payments_settings_params_decline_on", "decline_charge_on_params"), - ("payout_settings_params_schedule", "transfer_schedule_params"), - ("transfer_schedule_params_interval", "transfer_schedule_interval"), - ("invoice_setting_subscription_schedule_setting", "subscription_schedule_invoice_settings"), - ("create_token_person_verification", "person_verification_params"), - - // Config for `charge` params - ("create_charge_transfer_data", "transfer_data_params"), - ("update_charge_fraud_details", "fraud_details_params"), - - // Config for `customer` params - ("create_customer_invoice_settings", "customer_invoice_settings"), - ("update_customer_invoice_settings", "customer_invoice_settings"), - ("create_customer_tax_id_data", "tax_id_data"), - ("create_customer_tax_info", "tax_info_params"), - ("update_customer_tax_info", "tax_info_params"), - ("tax_info_params_type", "tax_info_type"), - - // Config for `invoiceitem` params - ("create_invoiceitem", "create_invoice_item"), - ("update_invoiceitem", "update_invoice_item"), - ("create_invoice_item_price_data", "invoice_item_price_data"), - ("update_invoice_item_price_data", "invoice_item_price_data"), - ("add_invoice_items_price_data", "invoice_item_price_data"), - - // Config for `payment_intent` params - ("create_order_items", "order_item_params"), - ("order_items_params_type", "order_item_type"), - - // Config for `source` params - ("create_source_mandate", "source_mandate_params"), - ("update_source_mandate", "source_mandate_params"), - // TODO: Maybe allow "union" if structs have optional params - /* - ("create_source_source_order", "source_order_params"), - ("update_source_source_order", "source_order_params"), - */ - ("source_mandate_params_acceptance", "source_acceptance_params"), - ("source_mandate_params_interval", "source_mandate_interval"), - ("source_mandate_params_notification_method", "source_mandate_notification_method"), - ("source_acceptance_params_offline", "source_acceptance_offline_params"), - ("source_acceptance_params_online", "source_acceptance_online_params"), - ("create_source_receiver_refund_attributes_method", "source_refund_notification_method"), - - // Config for `subscription_schedule` params - // TODO: Maybe allow "union" if structs have optional params - /* - ("create_subscription_schedule_phases", "subscription_schedule_phases_params"), - ("update_subscription_schedule_phases", "subscription_schedule_phases_params"), - */ - ("subscription_pending_invoice_item_interval_interval", "plan_interval"), - ("create_subscription_pending_invoice_item_interval_interval", "plan_interval"), - ("update_subscription_pending_invoice_item_interval_interval", "plan_interval"), - ("subscription_item_price_data_recurring_interval", "plan_interval"), - ("create_subscription_item_price_data", "subscription_item_price_data"), - ("update_subscription_item_price_data", "subscription_item_price_data"), - ("create_subscription_items_price_data", "subscription_item_price_data"), - ("update_subscription_items_price_data", "subscription_item_price_data"), - ("subscription_schedule_phases_plans_params_price_data", "subscription_item_price_data"), - ("subscription_item_payment_behavior", "subscription_payment_behavior"), - ("subscription_proration_behavior", "subscription_proration_behavior"), - ("subscription_item_proration_behavior", "subscription_proration_behavior"), - ("subscription_schedule_proration_behavior", "subscription_proration_behavior"), - ("subscription_schedule_phase_configuration_proration_behavior", "subscription_proration_behavior"), - ("create_subscription_schedule_phases_proration_behavior", "subscription_proration_behavior"), - ("update_subscription_schedule_phases_proration_behavior", "subscription_proration_behavior"), - ("create_subscription_schedule_phases_plans", "subscription_schedule_phases_plans_params"), - ("update_subscription_schedule_phases_plans", "subscription_schedule_phases_plans_params"), - ("create_subscription_schedule_phases_plans", "subscription_schedule_phases_plans_params"), - ("update_subscription_schedule_phases_plans", "subscription_schedule_phases_plans_params"), - ("create_subscription_schedule_invoice_settings", "subscription_schedule_invoice_settings"), - ("update_subscription_schedule_invoice_settings", "subscription_schedule_invoice_settings"), - ("create_subscription_schedule_phases_invoice_settings", "subscription_schedule_invoice_settings"), - ("update_subscription_schedule_phases_invoice_settings", "subscription_schedule_invoice_settings"), - ("create_subscription_schedule_renewal_interval", "subscription_schedule_renewal_interval_params"), - ("update_subscription_schedule_renewal_interval", "subscription_schedule_renewal_interval_params"), - ("create_subscription_schedule_renewal_interval", "subscription_schedule_renewal_interval_params"), - ("update_subscription_schedule_renewal_interval", "subscription_schedule_renewal_interval_params"), - ("create_subscription_schedule_default_settings", "subscription_schedule_default_settings_params"), - ("update_subscription_schedule_default_settings", "subscription_schedule_default_settings_params"), - ("create_subscription_add_invoice_items", "add_invoice_items"), - ("update_subscription_add_invoice_items", "add_invoice_items"), - ("create_subscription_schedule_phases_add_invoice_items", "add_invoice_items"), - ("update_subscription_schedule_phases_add_invoice_items", "add_invoice_items"), - ("subscription_schedule_end_behavior_filter", "subscription_schedule_renewal_behavior"), - ("subscription_schedules_resource_default_settings", "subscription_schedule_default_settings"), - ("subscription_schedule_default_settings_params_billing_thresholds", "subscription_schedule_billing_thresholds"), - - // Config for `webhook` params - ("webhook_endpoint_enabled_events", "event_filter"), - ("webhook_endpoint_api_version", "api_version"), - ("create_webhook_endpoint_enabled_events", "event_filter"), - ("update_webhook_endpoint_enabled_events", "event_filter"), - ]) -} - -pub type FieldMap = BTreeMap; -pub type FieldSpec = ( - &'static str, // schema name - &'static str, // field name -); -pub type ImportSpec = ( - &'static str, // "use" name - &'static str, // field type -); - -#[rustfmt::skip] -pub fn field_mappings() -> FieldMap { - BTreeMap::from([ - // Config for object types - (("account", "type"), ("AccountType", "Option")), - (("account", "external_account"), ("ExternalAccount", "ExternalAccount")), - (("balance_transaction", "status"), ("BalanceTransactionStatus", "BalanceTransactionStatus")), - (("balance_transaction", "source"), ("BalanceTransactionSourceUnion,Expandable", "Option>")), - (("bank_account", "status"), ("BankAccountStatus", "Option")), - (("fee", "type"), ("FeeType", "FeeType")), - (("charge", "source"), ("PaymentSource", "Option")), - (("customer", "default_source"), ("PaymentSource", "Option>")), - (("customer", "sources"), ("PaymentSource", "List")), - (("invoice", "billing"), ("", "Option")), - (("invoice", "default_source"), ("PaymentSource", "Option>")), - (("invoiceitem", "period"), ("Period", "Option")), - (("line_item", "period"), ("Period", "Option")), - ( - ("issuing_authorization", "authorization_method"), - ("IssuingAuthorizationMethod", "IssuingAuthorizationMethod"), - ), - ( - ("issuing_authorization", "wallet_provider"), - ("IssuingAuthorizationWalletProvider", "Option"), - ), - ( - ("issuing_authorization_request", "reason"), - ("IssuingAuthorizationReason", "IssuingAuthorizationReason"), - ), - ( - ("issuing_authorization_verification_data", "address_line1_check"), - ("IssuingAuthorizationCheck", "IssuingAuthorizationCheck"), - ), - ( - ("issuing_authorization_verification_data", "address_zip_check"), - ("IssuingAuthorizationCheck", "IssuingAuthorizationCheck"), - ), - ( - ("issuing_authorization_verification_data", "address_postal_code_check"), - ("IssuingAuthorizationCheck", "IssuingAuthorizationCheck"), - ), - ( - ("issuing_authorization_verification_data", "cvc_check"), - ("IssuingAuthorizationCheck", "IssuingAuthorizationCheck"), - ), - ( - ("issuing_authorization_verification_data", "expiry_check"), - ("IssuingAuthorizationCheck", "IssuingAuthorizationCheck"), - ), - (("issuing_card", "brand"), ("CardBrand", "CardBrand")), - (("issuing_card", "type"), ("IssuingCardType", "IssuingCardType")), - ( - ("issuing_card_authorization_controls", "allowed_categories"), - ("MerchantCategory", "Option>"), - ), - ( - ("issuing_card_authorization_controls", "blocked_categories"), - ("MerchantCategory", "Option>"), - ), - ( - ("issuing_cardholder_authorization_controls", "allowed_categories"), - ("MerchantCategory", "Option>"), - ), - ( - ("issuing_cardholder_authorization_controls", "blocked_categories"), - ("MerchantCategory", "Option>"), - ), - ( - ("issuing_card_pin", "status"), - ("IssuingCardPinStatus", "IssuingCardPinStatus"), - ), - ( - ("issuing_card_shipping", "type"), - ("IssuingCardShippingType", "IssuingCardShippingType"), - ), - ( - ("issuing_card_shipping", "status"), - ("IssuingCardShippingStatus", "Option"), - ), - ( - ("issuing_dispute", "reason"), - ("IssuingDisputeReason", "IssuingDisputeReason"), - ), - ( - ("issuing_dispute", "status"), - ("IssuingDisputeStatus", "IssuingDisputeStatus"), - ), - ( - ("issuing_transaction", "type"), - ("IssuingTransactionType", "IssuingTransactionType"), - ), - (("file", "purpose"), ("", "FilePurpose")), - (("payout", "destination"), ("PayoutDestinationUnion", "Option>")), - (("review", "reason"), ("ReviewReason", "ReviewReason")), - (("sku", "attributes"), ("Metadata", "Option")), - ( - ("subscription", "default_source"), - ("PaymentSource", "Option>"), - ), - (("source", "flow"), ("", "SourceFlow")), - (("source", "status"), ("SourceStatus", "SourceStatus")), - (("source", "usage"), ("SourceUsage", "Option")), - ( - ("source_redirect_flow", "failure_reason"), - ("SourceRedirectFlowFailureReason", "Option"), - ), - ( - ("source_redirect_flow", "status"), - ("SourceRedirectFlowStatus", "SourceRedirectFlowStatus"), - ), - ( - ("subscription", "billing"), - ("CollectionMethod", "Option"), - ), - ( - ("subscription", "collection_method"), - ("CollectionMethod", "Option"), - ), - ( - ("subscription_schedule", "billing"), - ("CollectionMethod", "Option"), - ), - ( - ("subscription_schedule", "collection_method"), - ("CollectionMethod", "Option"), - ), - ( - ("subscription_schedule_phase_configuration", "collection_method"), - ("CollectionMethod", "Option"), - ), - ( - ("subscription_schedule_renewal_interval", "interval"), - ("PlanInterval", "PlanInterval"), - ), - ( - ("subscription_schedule_default_settings", "collection_method"), - ("CollectionMethod", "Option"), - ), - ( - ("subscription_schedule_default_settings_params", "collection_method"), - ("CollectionMethod", "Option"), - ), - (("token", "type"), ("TokenType", "TokenType")), - (("transfer", "source_type"), ("", "Option")), - (("webhook_endpoint", "api_version"), ("ApiVersion", "Option")), - (("webhook_endpoint", "enabled_events"), ("", "Option>")), - (("webhook_endpoint", "status"), ("WebhookEndpointStatus", "Option")), - - // Config for `account` params - (("create_account", "business_profile"), ("BusinessProfile", "Option")), - (("update_account", "business_profile"), ("BusinessProfile", "Option")), - (("company_params", "address"), ("Address", "Option
")), - (("company_params", "address_kana"), ("Address", "Option
")), - (("company_params", "address_kanji"), ("Address", "Option
")), - // (("company_params", "verification"), ("CompanyVerificationParams", "Option")), - (("person_params", "address"), ("Address", "Option
")), - (("person_params", "address_kana"), ("Address", "Option
")), - (("person_params", "address_kanji"), ("Address", "Option
")), - (("person_params", "verification"), ("PersonVerificationParams", "Option")), - (("company_verification_params", "document"), ("VerificationDocumentParams", "Option")), - // (("person_verification_params", "document"), ("VerificationDocumentParams", "Option")), - // (("person_verification_params", "additional_document"), ("VerificationDocumentParams", "Option")), - - // Config for `charge` params - (("create_charge", "shipping"), ("Shipping", "Option")), - (("create_charge", "source"), ("ChargeSourceParams", "Option")), - (("update_charge", "shipping"), ("Shipping", "Option")), - - // Config for `customer` params - (("create_customer", "address"), ("Address", "Option
")), - (("update_customer", "address"), ("Address", "Option
")), - ( - ("update_customer", "default_alipay_account"), - ("AlipayAccountId", "Option"), - ), - (("update_customer", "default_bank_account"), ("BankAccountId", "Option")), - (("update_customer", "default_card"), ("CardId", "Option")), - (("create_customer", "default_source"), ("PaymentSourceId", "Option")), - (("update_customer", "default_source"), ("PaymentSourceId", "Option")), - (("create_customer", "source"), ("PaymentSourceParams", "Option")), - (("update_customer", "source"), ("PaymentSourceParams", "Option")), - (("update_customer", "trial_end"), ("Scheduled", "Option")), - - // Config for `invoice` params - (("list_invoices", "billing"), ("", "Option")), - (("create_invoice", "billing"), ("", "Option")), - - // Config for `invoiceitem` params - (("create_invoice_item", "period"), ("Period", "Option")), - (("update_invoice_item", "period"), ("Period", "Option")), - - // Config for `order` params - (("list_orders", "status"), ("OrderStatusFilter", "Option")), - - // Config for `payment_intent` params - (("payment_intent", "source"), ("PaymentSource", "Option>")), - (("payment_intent_next_action", "use_stripe_sdk"), ("", "Option")), - ( - ("create_payment_intent", "off_session"), - ("PaymentIntentOffSession", "Option"), - ), - (("create_setup_intent", "usage"), ("", "Option")), - (("setup_intent_next_action", "use_stripe_sdk"), ("", "Option")), - - // Config for `sku` params - (("list_skus", "attributes"), ("Metadata", "Option")), - (("create_sku", "attributes"), ("Metadata", "Option")), - (("update_sku", "attributes"), ("Metadata", "Option")), - (("create_sku", "inventory"), ("SkuInventory", "Option")), - (("update_sku", "inventory"), ("SkuInventory", "Option")), - (("create_sku", "package_dimensions"), ("PackageDimensions", "Option")), - (("update_sku", "package_dimensions"), ("PackageDimensions", "Option")), - - // Config for `source` params - (("create_source", "owner"), ("BillingDetails", "Option")), - (("update_source", "owner"), ("BillingDetails", "Option")), - - // Config for `subscription` params - ( - ("create_subscription", "billing_thresholds"), - ("SubscriptionBillingThresholds", "Option"), - ), - ( - ("update_subscription", "billing_thresholds"), - ("SubscriptionBillingThresholds", "Option"), - ), - ( - ("create_subscription_item", "billing_thresholds"), - ("SubscriptionItemBillingThresholds", "Option"), - ), - ( - ("update_subscription_item", "billing_thresholds"), - ("SubscriptionItemBillingThresholds", "Option"), - ), - ( - ("update_subscription_items", "billing_thresholds"), - ("SubscriptionItemBillingThresholds", "Option"), - ), - ( - ("subscription_schedule_phases_plans_params", "billing_thresholds"), - ("SubscriptionItemBillingThresholds", "Option"), - ), - ( - ("list_subscriptions", "billing"), - ("CollectionMethod", "Option"), - ), - ( - ("create_subscription", "billing"), - ("CollectionMethod", "Option"), - ), - ( - ("update_subscription", "billing"), - ("CollectionMethod", "Option"), - ), - ( - ("list_subscriptions", "collection_method"), - ("CollectionMethod", "Option"), - ), - ( - ("create_subscription", "collection_method"), - ("CollectionMethod", "Option"), - ), - ( - ("update_subscription", "collection_method"), - ("CollectionMethod", "Option"), - ), - (("create_subscription", "trial_end"), ("Scheduled", "Option")), - (("update_subscription", "trial_end"), ("Scheduled", "Option")), - - // Config for `subscription_schedule` params - (("create_subscription_schedule", "collection_method"), ("CollectionMethod", "Option")), - (("update_subscription_schedule", "collection_method"), ("CollectionMethod", "Option")), - (("create_subscription_schedule", "start_date"), ("Scheduled", "Option")), - (("update_subscription_schedule", "start_date"), ("Scheduled", "Option")), - ( - ("create_subscription_schedule", "billing_thresholds"), - ("SubscriptionBillingThresholds", "Option"), - ), - ( - ("update_subscription_schedule", "billing_thresholds"), - ("SubscriptionBillingThresholds", "Option"), - ), - ( - ("create_subscription_schedule", "billing"), - ("CollectionMethod", "Option"), - ), - ( - ("update_subscription_schedule", "billing"), - ("CollectionMethod", "Option"), - ), - ( - ("create_subscription_schedule_phases", "billing_thresholds"), - ("SubscriptionBillingThresholds", "Option"), - ), - ( - ("update_subscription_schedule_phases", "billing_thresholds"), - ("SubscriptionBillingThresholds", "Option"), - ), - ( - ("create_subscription_schedule_phases", "collection_method"), - ("CollectionMethod", "Option"), - ), - ( - ("update_subscription_schedule_phases", "collection_method"), - ("CollectionMethod", "Option"), - ), - (("create_subscription_schedule_phases", "start_date"), ("Scheduled", "Option")), - (("update_subscription_schedule_phases", "start_date"), ("Scheduled", "Option")), - (("create_subscription_schedule_phases", "end_date"), ("Scheduled", "Option")), - (("update_subscription_schedule_phases", "end_date"), ("Scheduled", "Option")), - (("create_subscription_schedule_phases", "trial_end"), ("Scheduled", "Option")), - (("update_subscription_schedule_phases", "trial_end"), ("Scheduled", "Option")), - ( - ("subscription_schedule_renewal_interval_params", "interval"), - ("PlanInterval", "PlanInterval"), - ), - ( - ("subscription_schedule_default_settings_params", "invoice_settings"), - ("SubscriptionScheduleInvoiceSettings", "Option"), - ), - - // Miscellaneous params - (("create_payment_method", "type"), ("", "Option")), - (("create_recipient", "type"), ("", "RecipientType")), - ( - ("update_payment_method", "billing_details"), - ("BillingDetails", "Option"), - ), - ( - ("create_product", "package_dimensions"), - ("PackageDimensions", "Option"), - ), - ( - ("update_product", "package_dimensions"), - ("PackageDimensions", "Option"), - ), - (("create_plan_tiers", "up_to"), ("UpTo", "Option")), - (("create_price_tiers", "up_to"), ("UpTo", "Option")), - (("create_price_currency_options_tiers", "up_to"), ("UpTo", "Option")), - (("update_price_currency_options_tiers", "up_to"), ("UpTo", "Option")), - (("create_product_default_price_data_currency_options_tiers", "up_to"), ("UpTo", "Option")), - (("update_file_link", "expires_at"), ("Scheduled", "Option")), - (("create_token_account", "company"), ("CompanyParams", "Option")), - (("create_token_account", "individual"), ("PersonParams", "Option")), - - (("create_token_person", "address"), ("Address", "Option
")), - (("create_token_person", "address_kana"), ("Address", "Option
")), - (("create_token_person", "address_kanji"), ("Address", "Option
")), - ( - ("create_payment_method", "billing_details"), - ("BillingDetails", "Option"), - ), - (("transfer_schedule_params", "delay_days"), ("DelayDays", "Option")), - (("create_webhook_endpoint", "api_version"), ("ApiVersion", "Option")), - ]) -} diff --git a/openapi/src/metadata.rs b/openapi/src/metadata.rs deleted file mode 100644 index af290c21b..000000000 --- a/openapi/src/metadata.rs +++ /dev/null @@ -1,318 +0,0 @@ -use std::collections::{BTreeMap, BTreeSet}; -use std::fs::write; -use std::path::Path; - -use heck::{CamelCase, SnakeCase}; -use openapiv3::{ReferenceOr, SchemaKind}; - -use crate::spec::{as_object_properties, Spec}; -use crate::{ - file_generator::FileGenerator, - mappings::{self, FieldMap, ObjectMap}, - metadata, - types::CopyOrClone, -}; - -/// Global metadata for the entire codegen process. -#[derive(Debug)] -pub struct Metadata<'a> { - pub spec: &'a Spec, - /// A map of `objects` to their rust id type - pub id_mappings: BTreeMap, - - pub feature_groups: BTreeMap<&'a str, &'a str>, - - /// The set of schemas which should implement `Object`. - /// These have both an `id` property and on `object` property. - pub objects: BTreeSet<&'a str>, - /// A one to many map of schema to depending types. - pub dependents: BTreeMap<&'a str, BTreeSet<&'a str>>, - /// How a particular schema should be renamed. - pub object_mappings: ObjectMap, - /// An override for the rust-type of a particular object/field pair. - pub field_mappings: FieldMap, - /// A one to many map of _objects_ to requests which should be - /// implemented for that object. - /// - /// This is typically determined by the first segment in the path. - pub requests: BTreeMap>, -} - -impl<'a> Metadata<'a> { - pub fn from_spec(spec: &'a Spec) -> Self { - let id_renames = mappings::id_renames(); - let object_mappings = mappings::object_mappings(); - let field_mappings = mappings::field_mappings(); - let feature_groups = metadata::feature_groups(); - - let mut objects = BTreeSet::new(); - let mut dependents: BTreeMap<_, BTreeSet<_>> = BTreeMap::new(); - let mut id_mappings = BTreeMap::new(); - - for (key, ref_or_schema) in spec.component_schemas() { - let schema_name = key.as_str(); - let properties = match ref_or_schema.as_item().and_then(as_object_properties) { - Some(props) => props, - None => continue, - }; - if properties.contains_key("object") { - objects.insert(schema_name); - if properties.contains_key("id") { - let id_type = id_renames - .get(&schema_name) - .unwrap_or(&schema_name) - .replace('.', "_") - .to_camel_case() - + "Id"; - - id_mappings.insert( - schema_name.replace('.', "_").to_owned(), - (id_type, CopyOrClone::Clone), - ); - } - } - for schema_or_ref in properties.values() { - match schema_or_ref { - ReferenceOr::Reference { reference } => { - let dep = reference.trim_start_matches("#/components/schemas/"); - dependents.entry(dep).or_default().insert(schema_name); - } - ReferenceOr::Item(schema) => { - if let SchemaKind::AnyOf { any_of } = &schema.schema_kind { - for ty in any_of { - if let ReferenceOr::Reference { reference } = ty { - let dep = reference.trim_start_matches("#/components/schemas/"); - dependents.entry(dep).or_default().insert(schema_name); - } - } - } - } - } - } - } - - Self { - spec, - requests: metadata_requests(spec, &objects), - objects, - dependents, - id_mappings, - object_mappings, - field_mappings, - feature_groups, - } - } - - /// generate placeholder types with stubs for potentially missing features - pub fn write_placeholders(&self, out_path: T) - where - T: AsRef, - { - let mut out = String::new(); - out.push_str("use crate::ids::*;\n"); - out.push_str("use crate::params::Object;\n"); - out.push_str("use serde::{Deserialize, Serialize};\n"); - - for (schema, feature) in self.feature_groups.iter() { - out.push('\n'); - let (id_type, c_c) = - self.schema_to_id_type(schema).unwrap_or_else(|| ("()".into(), CopyOrClone::Copy)); - let struct_type = self.schema_to_rust_type(schema); - out.push_str(&format!("#[cfg(not(feature = \"{}\"))]\n", feature)); - out.push_str("#[derive(Clone, Debug, Default, Deserialize, Serialize)]\n"); - out.push_str(&format!("pub struct {} {{\n", struct_type)); - out.push_str(&format!("\tpub id: {},\n", id_type)); - out.push_str("}\n\n"); - out.push_str(&format!("#[cfg(not(feature = \"{}\"))]\n", feature)); - out.push_str(&format!("impl Object for {} {{\n", struct_type)); - out.push_str(&format!("\ttype Id = {};\n", id_type)); - out.push_str(&format!( - "\tfn id(&self) -> Self::Id {{ self.id{} }}\n", - match c_c { - CopyOrClone::Clone => ".clone()", - CopyOrClone::Copy => "", - } - )); - out.push_str(&format!("\tfn object(&self) -> &'static str {{ \"{}\" }}\n", schema)); - out.push_str("}\n"); - } - - write(&out_path.as_ref().join("placeholders.rs"), out.as_bytes()).unwrap(); - } - - pub fn write_version(&self, out_path: T) - where - T: AsRef, - { - let mut out = String::new(); - out.push_str("use crate::ApiVersion;\n\n"); - out.push_str(&format!( - "pub const VERSION: ApiVersion = ApiVersion::V{};", - self.spec.version().replace('-', "_") - )); - - write(&out_path.as_ref().join("version.rs"), out.as_bytes()).unwrap(); - } - - #[tracing::instrument(skip_all)] - pub fn get_files(&self) -> Vec { - self.objects - .iter() - .filter(|o| !o.starts_with("deleted_")) - .map(|o| FileGenerator::new(o.to_string())) - .collect() - } - - pub fn schema_to_id_type(&self, schema: &str) -> Option<(String, CopyOrClone)> { - let schema = schema.replace('.', "_"); - self.id_mappings.get(schema.as_str()).map(ToOwned::to_owned) - } - - #[tracing::instrument(skip(self))] - pub fn schema_to_rust_type(&self, schema: &str) -> String { - let schema = schema.replace('.', "_"); - if let Some(rename) = self.object_mappings.get(schema.as_str()) { - rename.to_camel_case() - } else { - schema.to_camel_case() - } - } - - pub fn field_to_rust_type( - &self, - schema: &str, - field: &str, - ) -> Option<(&'static str, &'static str)> { - let schema = schema.replace('.', "_"); - self.field_mappings.get(&(schema.as_str(), field)).copied() - } - - pub fn schema_field(&self, parent: &str, field: &str) -> String { - let parent_type = self.schema_to_rust_type(parent); - format!("{}_{}", parent_type, field).to_snake_case() - } -} - -/// given a spec and a set of objects in that spec, metadatas a -/// map with the requests to implement for each of the types in the spec -pub fn metadata_requests<'a>( - spec: &'a Spec, - objects: &BTreeSet<&'a str>, -) -> BTreeMap> { - let mut requests = BTreeMap::>::new(); - for path in spec.paths() { - let mut seg_iterator = path.trim_start_matches("/v1/").split('/'); - let object = match (seg_iterator.next(), seg_iterator.next(), seg_iterator.next()) { - // handle special case for sessions - (Some(x), Some("sessions"), _) => format!("{}.session", x), - - // special case for usage_records - (_, _, Some("usage_records")) => "usage_records".to_string(), - - // special case: terminal is a resource, not an object - (Some("terminal"), Some(x), _) => format!("terminal.{}", x), - - (Some(x), _, _) => x.to_string(), - _ => { - // this should never happen - tracing::error!("path ignored: {path}"); - continue; - } - }; - - // This isn't documented in the API reference so let's skip it - if object == "account" { - continue; - } - - let seg_like = &object[0..object.len() - 1]; - if objects.contains(object.as_str()) { - requests.entry(object).or_default().insert(path.as_str()); - } else if object.ends_with('s') && objects.contains(seg_like) { - requests.entry(seg_like.to_string()).or_default().insert(path.as_str()); - } - } - requests -} - -#[rustfmt::skip] -pub fn feature_groups() -> BTreeMap<&'static str, &'static str> { - [ - // N.B. For now both `core` and `payment-methods` are always enabled. - /* - // Core Resources - ("balance", "core"), - ("balance_transaction", "core"), - ("charge", "core"), - ("customer", "core"), - ("dispute", "core"), - ("file", "core"), - ("file_link", "core"), - ("setup_intent", "core"), - ("payout", "core"), - ("platform_tax_fee", "core"), - ("product", "core"), - ("refund", "core"), - ("reserve_transaction", "core"), - ("token", "core"), - // Payment Methods - ("alipay_account", "payment-methods"), - ("bank_account", "payment-methods"), - ("payment_method", "payment-methods"), - ("source", "payment-methods"), - */ - - // Checkout - ("checkout_session", "checkout"), - - // Billing (aka. Subscriptions) - ("coupon", "billing"), - ("discount", "billing"), - ("invoice", "billing"), - ("invoiceitem", "billing"), - ("line_item", "billing"), - ("plan", "billing"), - ("subscription", "billing"), - ("subscription_item", "billing"), - ("subscription_schedule", "billing"), - ("subscription_schedule_revision", "billing"), - ("tax_id", "billing"), - ("tax_rate", "billing"), - - // Connect - ("account", "connect"), - ("application", "connect"), - ("application_fee", "connect"), - ("connect_collection_transfer", "connect"), - ("fee_refund", "connect"), - ("person", "connect"), - ("topup", "connect"), - ("transfer", "connect"), - ("transfer_reversal", "connect"), - - // Fraud - ("review", "fraud"), - - // Issuing - ("issuing.authorization", "issuing"), - ("issuing.card", "issuing"), - ("issuing.cardholder", "issuing"), - ("issuing.dispute", "issuing"), - ("issuing.transaction", "issuing"), - - // Orders - ("order", "orders"), - ("order_item", "orders"), - ("order_return", "orders"), - ("sku", "orders"), - - // Sigma - ("scheduled_query_run", "sigma"), - - // Webhooks Endpoints - ("webhook_endpoint", "webhook-endpoints"), - ] - .iter() - .copied() - .collect() -} diff --git a/openapi/src/object_writing.rs b/openapi/src/object_writing.rs new file mode 100644 index 000000000..ea3efe846 --- /dev/null +++ b/openapi/src/object_writing.rs @@ -0,0 +1,123 @@ +use std::fmt::Write; + +use crate::components::Components; +use crate::ids::write_object_id; +use crate::printable::Lifetime; +use crate::rust_object::{as_enum_of_objects, ObjectMetadata, RustObject}; +use crate::rust_type::RustType; +use crate::stripe_object::{RequestSpec, StripeObject}; +use crate::templates::object_trait::{write_object_trait, write_object_trait_for_enum}; +use crate::templates::utils::write_doc_comment; +use crate::templates::ObjectWriter; + +const ADD_UNKNOWN_VARIANT_THRESHOLD: usize = 12; + +impl Components { + fn write_rust_type_objs(&self, typ: &RustType, out: &mut String) { + let Some((obj, meta)) = typ.extract_object() else { + return; + }; + self.write_object(obj, meta, out); + } + + pub fn write_object(&self, obj: &RustObject, metadata: &ObjectMetadata, out: &mut String) { + if let Some(doc) = &metadata.doc { + let comment = write_doc_comment(doc, 0); + let _ = write!(out, "{comment}"); + } + + // If the object contains any references, we'll need to print with a lifetime + let has_ref = obj.has_reference(self); + let lifetime = if has_ref { Some(Lifetime) } else { None }; + let ident = &metadata.ident; + + let mut writer = ObjectWriter::new(self, ident, metadata.kind); + writer.lifetime(lifetime).derive_copy(obj.is_copy(self)); + + match obj { + RustObject::Struct(fields) => { + let should_derive_default = fields.iter().all(|field| field.rust_type.is_option()); + writer.derive_default(should_derive_default); + writer.write_struct(out, fields); + + for field in fields { + if let Some((obj, meta)) = field.rust_type.extract_object() { + self.write_object(obj, meta, out); + } + } + } + RustObject::FieldlessEnum(variants) => { + let provide_unknown_variant = variants.len() > ADD_UNKNOWN_VARIANT_THRESHOLD + && !variants.iter().any(|v| v.variant_name.as_ref() == "Unknown"); + writer.provide_unknown_variant(provide_unknown_variant); + writer.write_fieldless_enum_variants(out, variants); + } + RustObject::Enum(variants) => { + if let Some(objects) = as_enum_of_objects(self, variants) { + writer.write_enum_of_objects(out, &objects); + } else { + writer.write_enum_variants(out, variants); + } + for variant in variants { + if let Some(typ) = &variant.rust_type { + if let Some((obj, meta)) = typ.extract_object() { + self.write_object(obj, meta, out); + } + } + } + } + } + } +} + +pub fn gen_obj( + obj: &RustObject, + meta: &ObjectMetadata, + comp: &StripeObject, + components: &Components, +) -> String { + let mut out = String::with_capacity(128); + + components.write_object(obj, meta, &mut out); + + let ident = &meta.ident; + if let Some(id_typ) = comp.id_type() { + let id_type = components.construct_printable_type(id_typ); + match &obj { + RustObject::Struct(_) => write_object_trait(&mut out, ident, &id_type), + RustObject::Enum(variants) => { + let Some(object_names) = as_enum_of_objects(components, variants) else { + panic!("Object {} is an enum that is not a union of stripe objects", ident); + }; + write_object_trait_for_enum(components, &mut out, ident, &object_names) + } + RustObject::FieldlessEnum(_) => { + panic!("Did not expect enum to have an id"); + } + } + + if let Some(path) = id_typ.as_id_or_opt_id_path() { + // Only generate the id definition if the paths match - e.g. if we're generating + // `DeletedAccount`, we don't want to duplicate `AccountId` since `DeletedAccount` + // uses that same id + if path == comp.path() { + write_object_id(&mut out, path, &comp.id_type_ident()) + } + } + } + out +} + +pub fn gen_requests(specs: &[RequestSpec], components: &Components) -> String { + let mut out = String::with_capacity(128); + + for req in specs { + components.write_rust_type_objs(&req.params, &mut out); + + let req_body = req.gen(components); + let _ = write!(out, "{}", req_body); + + components.write_rust_type_objs(&req.returned, &mut out); + } + out +} diff --git a/openapi/src/overrides.rs b/openapi/src/overrides.rs new file mode 100644 index 000000000..7b37f3149 --- /dev/null +++ b/openapi/src/overrides.rs @@ -0,0 +1,78 @@ +use anyhow::Context; +use indexmap::IndexMap; + +use crate::components::{Components, RequestSource}; +use crate::rust_object::{ObjectKind, ObjectMetadata, RustObject}; +use crate::rust_type::{PathToType, RustType}; +use crate::stripe_object::OperationType; +use crate::types::RustIdent; +use crate::utils::get_request_param_field; +use crate::visitor::VisitMut; + +#[derive(Debug, Clone, Eq, PartialEq)] +pub struct OverrideMetadata { + pub metadata: ObjectMetadata, + pub mod_path: String, +} + +pub struct Overrides { + pub overrides: IndexMap, +} + +impl Overrides { + pub fn new(components: &Components) -> anyhow::Result { + let mut overrides = IndexMap::new(); + for override_ in OVERRIDES { + let (obj, meta) = get_override_object(components, override_).with_context(|| { + format!("Failed to construct override for source {override_:?}") + })?; + overrides.insert(obj, meta); + } + Ok(Self { overrides }) + } +} + +#[derive(Debug, Copy, Clone)] +pub struct OverrideData { + pub doc: &'static str, + pub mod_path: &'static str, + pub ident: &'static str, + pub source: RequestSource, +} + +const OVERRIDES: &[OverrideData] = &[OverrideData { + doc: "", + mod_path: "api_version", + ident: "ApiVersion", + source: RequestSource { + path: "/webhook_endpoints", + op: OperationType::Post, + field_name: "api_version", + }, +}]; + +fn get_override_object( + components: &Components, + data: &OverrideData, +) -> anyhow::Result<(RustObject, OverrideMetadata)> { + let req = components.get_request_spec(data.source).context("Request source not found")?; + let (obj, _) = get_request_param_field(req, data.source.field_name) + .context("Could not extract field")? + .extract_object() + .context("Not an object")?; + let metadata = ObjectMetadata::new(RustIdent::unchanged(data.ident), ObjectKind::Type) + .doc(data.doc.to_string()); + + Ok((obj.clone(), OverrideMetadata { metadata, mod_path: data.mod_path.to_string() })) +} + +impl VisitMut for Overrides { + fn visit_typ_mut(&mut self, typ: &mut RustType) { + if let Some((obj, _)) = typ.as_object_mut() { + if let Some(meta) = self.overrides.get(obj) { + *typ = RustType::path(PathToType::Shared(meta.metadata.ident.clone()), false); + } + } + typ.visit_mut(self); + } +} diff --git a/openapi/src/printable.rs b/openapi/src/printable.rs new file mode 100644 index 000000000..76537656f --- /dev/null +++ b/openapi/src/printable.rs @@ -0,0 +1,213 @@ +use std::fmt::{Display, Formatter, Write}; + +use crate::components::PathInfo; +use crate::rust_type::{MapKey, SimpleType}; +use crate::types::RustIdent; +use crate::STRIPE_TYPES; + +/// A `RustType` we can implement `Display` for. This requires converting the portions of `RustType` +/// we do not know how to print into other variants. For example, `RustType::Object` must be converted +/// to actual qualified paths and `RustType::Path` must be given information about crate + +/// path to import from. +#[derive(Debug, Clone, Eq, PartialEq, Hash)] +pub enum PrintableType { + QualifiedPath { + path: Option, + ident: RustIdent, + /// Does this contain references, e.g. do we need a lifetime when generating this type? + has_ref: bool, + /// Is this a reference? + is_ref: bool, + }, + Simple(SimpleType), + Container(PrintableContainer), +} + +/// A direct analogue of `Container`, but with `RustType` replaced by `PrintableType`. +#[derive(Debug, Clone, Eq, PartialEq, Hash)] +pub enum PrintableContainer { + List(Box), + SearchList(Box), + Vec(Box), + Slice(Box), + Expandable(Box), + Option(Box), + Box(Box), + Map { key: MapKey, value: Box, is_ref: bool }, +} + +impl<'a> Display for PrintableWithLifetime<'a> { + fn fmt(&self, f: &mut Formatter<'_>) -> std::fmt::Result { + let Some(lifetime) = self.lifetime else { + return write!(f, "{}", self.typ); + }; + + use PrintableContainer::*; + use PrintableType::*; + match &self.typ { + QualifiedPath { path, has_ref, is_ref, ident } => { + let full_path = PathWithIdent::new(path.as_ref(), ident); + if *is_ref { + write!(f, "&{lifetime} ")?; + } + if *has_ref { + write!(f, "{full_path}<{lifetime}>") + } else { + write!(f, "{full_path}") + } + } + Simple(typ) => { + if typ.is_reference() { + write!(f, "&{lifetime} ")?; + } + f.write_str(typ.ident()) + } + Container(typ) => match typ { + List(inner) => { + let inner = PrintableWithLifetime::new(inner, Some(lifetime)); + write!(f, "{STRIPE_TYPES}::List<{inner}>") + } + SearchList(inner) => { + let inner = PrintableWithLifetime::new(inner, Some(lifetime)); + write!(f, "{STRIPE_TYPES}::SearchList<{inner}>") + } + Vec(inner) => { + let inner = PrintableWithLifetime::new(inner, Some(lifetime)); + write!(f, "Vec<{inner}>") + } + Slice(inner) => { + let inner = PrintableWithLifetime::new(inner, Some(lifetime)); + write!(f, "&{lifetime} [{inner}]") + } + Expandable(inner) => { + let inner = PrintableWithLifetime::new(inner, Some(lifetime)); + write!(f, "{STRIPE_TYPES}::Expandable<{inner}>") + } + Option(inner) => { + let inner = PrintableWithLifetime::new(inner, Some(lifetime)); + write!(f, "Option<{inner}>") + } + Box(inner) => { + let inner = PrintableWithLifetime::new(inner, Some(lifetime)); + write!(f, "Box<{inner}>") + } + Map { key, value, is_ref } => { + let value = PrintableWithLifetime::new(value, Some(lifetime)); + if *is_ref { + write!(f, "&{lifetime} ")?; + } + write!(f, "std::collections::HashMap<{key}, {value}>") + } + }, + } + } +} + +impl Display for PrintableType { + fn fmt(&self, f: &mut Formatter<'_>) -> std::fmt::Result { + use PrintableContainer::*; + use PrintableType::*; + match self { + QualifiedPath { path, is_ref, ident, .. } => { + let full_path = PathWithIdent::new(path.as_ref(), ident); + if *is_ref { + f.write_char('&')?; + } + write!(f, "{full_path}") + } + Simple(typ) => { + if typ.is_reference() { + f.write_char('&')?; + } + f.write_str(typ.ident()) + } + Container(typ) => match typ { + List(inner) => { + write!(f, "{STRIPE_TYPES}::List<{inner}>") + } + SearchList(inner) => { + write!(f, "{STRIPE_TYPES}::SearchList<{inner}>") + } + Vec(inner) => { + write!(f, "Vec<{inner}>") + } + Slice(inner) => { + write!(f, "&[{inner}]") + } + Expandable(inner) => { + write!(f, "{STRIPE_TYPES}::Expandable<{inner}>") + } + Option(inner) => { + write!(f, "Option<{inner}>") + } + Box(inner) => { + write!(f, "Box<{inner}>") + } + Map { key, value, is_ref } => { + if *is_ref { + f.write_char('&')?; + } + write!(f, "std::collections::HashMap<{key}, {value}>") + } + }, + } + } +} + +/// For now, we only support a single lifetime, so always creates `'a` +#[derive(Debug, Copy, Clone, Eq, PartialEq)] +pub struct Lifetime; + +impl Lifetime { + pub fn as_str(self) -> &'static str { + "'a" + } + + pub fn as_param(self) -> &'static str { + "<'a>" + } +} + +impl Display for Lifetime { + fn fmt(&self, f: &mut Formatter<'_>) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +/// Wrapper to implement `Display` on a combination of a lifetime and a type. +#[derive(Copy, Clone)] +pub struct PrintableWithLifetime<'a> { + lifetime: Option, + typ: &'a PrintableType, +} + +impl<'a> PrintableWithLifetime<'a> { + pub fn new(typ: &'a PrintableType, lifetime: Option) -> Self { + Self { typ, lifetime } + } +} + +#[derive(Debug, Copy, Clone)] +struct PathWithIdent<'a> { + path: Option<&'a PathInfo>, + ident: &'a RustIdent, +} + +impl<'a> PathWithIdent<'a> { + fn new(path: Option<&'a PathInfo>, ident: &'a RustIdent) -> Self { + Self { path, ident } + } +} + +impl<'a> Display for PathWithIdent<'a> { + fn fmt(&self, f: &mut Formatter<'_>) -> std::fmt::Result { + if let Some(path) = self.path { + write!(f, "{}::", path.krate.name())?; + if let Some(path) = &path.path { + write!(f, "{path}::")?; + } + } + + write!(f, "{}", self.ident) + } +} diff --git a/openapi/src/requests.rs b/openapi/src/requests.rs new file mode 100644 index 000000000..c51f9427a --- /dev/null +++ b/openapi/src/requests.rs @@ -0,0 +1,335 @@ +use std::collections::HashMap; + +use anyhow::{bail, Context}; +use heck::ToSnakeCase; +use openapiv3::{Parameter, ParameterData, ParameterSchemaOrContent, ReferenceOr, Schema}; +use tracing::debug; + +use crate::rust_object::{ObjectKind, ObjectMetadata, RustObject}; +use crate::rust_type::{RustType, SimpleType}; +use crate::spec::{get_ok_response_schema, get_request_form_parameters, Spec}; +use crate::spec_inference::Inference; +use crate::stripe_object::{OperationType, PathParam, RequestSpec, StripeOperation}; +use crate::types::{ComponentPath, RustIdent}; + +/// Should we skip a currently unsupported request? +fn should_skip_request(op: &StripeOperation) -> bool { + // TODO: what is the relevance of the `method_on` field? A small number of requests + // use "collection" instead of "service", but the OpenAPI schema does not differentiate + // so we just end up with duplicate requests if we don't skip like this + op.method_on != "service" + // Skip PDF download (binary format response not supported by client yet) + || op.method_name == "pdf" + // Skip file upload (form/multipart not supported by client yet) + || (op.method_name == "create" && op.path == "/v1/files") +} + +#[derive(Copy, Clone, Eq, PartialEq, Hash, Debug)] +struct RequestKey<'a> { + path: &'a str, + method_type: OperationType, +} + +impl<'a> RequestKey<'a> { + pub fn from_op(op: &'a RequestDetails) -> Self { + Self { path: op.path, method_type: op.operation_type } + } +} + +fn infer_method_names<'a>(operations: &'a [RequestDetails]) -> HashMap, String> { + let mut names = HashMap::new(); + for op_spec in operations { + let has_path_params = !op_spec.path_params.is_empty(); + let method_name: String = match op_spec.base_method_name { + "retrieve" => { + if has_path_params { + "retrieve".into() + } else { + "retrieve_for_my_account".into() + } + } + name @ ("list" | "create") => { + if let Some(param) = op_spec.path_params.first() { + format!("{name}_{}", param.name) + } else { + name.into() + } + } + // Explicit conversion to snake case handles a single method_name "upcomingLines" - + // all other methods are already snake case + other => other.to_snake_case(), + }; + names.insert(RequestKey::from_op(op_spec), method_name); + } + + deduplicate_method_names(&names, operations) +} + +/// `BankAccount` and `Card` require deduplication of the update and delete methods, so +/// handle polymorphic cases like those here +fn deduplicate_method_names<'a>( + base_names: &HashMap, String>, + reqs: &'a [RequestDetails], +) -> HashMap, String> { + let mut dedupped = HashMap::new(); + for req in reqs { + let req_key = RequestKey::from_op(req); + let curr_name = &base_names[&req_key]; + let has_dup_name = + base_names.iter().any(|(&key, name)| key != req_key && name == curr_name); + if has_dup_name { + if req.path_params.is_empty() { + dbg!(req); + dbg!(curr_name); + dbg!(req_key); + dbg!(base_names); + } + let path_param = + req.path_params.first().expect("Expected path parameter on duplicate method"); + dedupped.insert(req_key, format!("{curr_name}_{}", path_param.name)); + } else { + dedupped.insert(req_key, curr_name.to_string()); + } + } + dedupped +} + +fn get_req_details<'a>( + op: &'a StripeOperation, + spec: &'a Spec, +) -> anyhow::Result> { + let operation = spec + .get_request_operation(&op.path, op.operation_type) + .context("Request path not found")?; + let mut path_params = vec![]; + let mut query_params = vec![]; + for param in &operation.parameters { + let param = param.as_item().context("Unexpected reference in parameter")?; + match param { + Parameter::Query { parameter_data, .. } => { + query_params.push(parameter_data); + } + Parameter::Path { parameter_data, .. } => { + if !parameter_data.required { + bail!("Expected path parameter to be required"); + } + path_params.push(parameter_data); + } + _ => bail!("Unexpected parameter type {param:?}"), + } + } + let form_params = get_request_form_parameters(operation); + let params = match op.operation_type { + OperationType::Get => { + assert!(form_params.is_none(), "Body parameters not supported for GET"); + RequestParams::Query(if query_params.is_empty() { None } else { Some(query_params) }) + } + OperationType::Post => { + assert!(query_params.is_empty(), "Unexpected query parameters for POST"); + RequestParams::Form(form_params) + } + OperationType::Delete => { + assert!(query_params.is_empty(), "Unexpected query parameters for DELETE"); + RequestParams::Form(form_params) + } + }; + + let return_schema = get_ok_response_schema(operation).context("Expected schema")?; + Ok(RequestDetails { + returned: return_schema, + path_params, + params, + description: operation.description.as_deref(), + operation_type: op.operation_type, + path: &op.path, + base_method_name: &op.method_name, + }) +} + +pub fn parse_requests( + operations: Vec, + spec: &Spec, + ident: &RustIdent, + path_id_map: &HashMap, +) -> anyhow::Result> { + let mut req_details = Vec::with_capacity(operations.len()); + for op in &operations { + if should_skip_request(op) { + debug!("Skipping request at path {} with name {}", op.path, op.method_name); + continue; + } + req_details.push(get_req_details(op, spec)?); + } + + let method_names = infer_method_names(&req_details); + + let mut requests = Vec::with_capacity(operations.len()); + for req in &req_details { + requests.push( + build_request(req, ident, &method_names[&RequestKey::from_op(req)], path_id_map) + .with_context(|| format!("Error generating request operation {req:?}"))?, + ); + } + Ok(requests) +} + +#[derive(Clone, Debug)] +enum RequestParams<'a> { + Form(Option<&'a ReferenceOr>), + Query(Option>), +} + +#[derive(Clone, Debug)] +struct RequestDetails<'a> { + returned: &'a ReferenceOr, + path_params: Vec<&'a ParameterData>, + params: RequestParams<'a>, + description: Option<&'a str>, + operation_type: OperationType, + path: &'a str, + base_method_name: &'a str, +} + +fn build_request( + req: &RequestDetails, + parent_ident: &RustIdent, + method_name: &str, + path_id_map: &HashMap, +) -> anyhow::Result { + let params_ident = RustIdent::joined(method_name, parent_ident); + let return_ident = RustIdent::joined(¶ms_ident, "returned"); + let return_type = Inference::new(&return_ident, ObjectKind::RequestReturned) + .required(true) + .infer_schema_or_ref_type(req.returned); + + let param_inference = + Inference::new(¶ms_ident, ObjectKind::RequestParam).can_borrow(true).required(true); + + let param_typ = match &req.params { + RequestParams::Form(schema) => schema.map(|s| param_inference.infer_schema_or_ref_type(s)), + RequestParams::Query(params) => match params { + None => None, + Some(params) => { + let mut struct_fields = Vec::with_capacity(params.len()); + for param in params { + let ParameterSchemaOrContent::Schema(schema) = ¶m.format else { + bail!("Expected query parameter to follow schema format"); + }; + + let struct_field = param_inference + .field_name(¶m.name) + .maybe_description(param.description.as_deref()) + .required(param.required) + .build_struct_field(¶m.name, schema); + struct_fields.push(struct_field); + } + Some(RustType::Object( + RustObject::Struct(struct_fields), + ObjectMetadata::new(params_ident.clone(), ObjectKind::RequestParam), + )) + } + }, + } + .unwrap_or_else(|| { + RustType::Object( + RustObject::Struct(vec![]), + ObjectMetadata::new(params_ident.clone(), ObjectKind::RequestParam), + ) + }); + + let req_path = req.path.trim_start_matches("/v1"); + + let mut path_params = vec![]; + for param in &req.path_params { + let ParameterSchemaOrContent::Schema(schema) = ¶m.format else { + bail!("Expected path parameter to follow schema format"); + }; + let base_param_typ = Inference::new(¶ms_ident, ObjectKind::RequestParam) + .can_borrow(true) + .required(param.required) + .maybe_description(param.description.as_deref()) + .field_name(¶m.name) + .infer_schema_or_ref_type(schema); + + if base_param_typ != RustType::Simple(SimpleType::Str) { + bail!("Expected path parameter to be a string"); + } + + let rust_type = if let Some(id_typ) = infer_id_path(¶m.name, req_path, path_id_map)? { + RustType::object_id(id_typ, true) + } else { + // NB: Assuming this is safe since we check earlier that this matches the path type. + RustType::Simple(SimpleType::Str) + }; + + path_params.push(PathParam { name: param.name.clone(), rust_type }) + } + Ok(RequestSpec { + path_params, + params: param_typ, + doc_comment: req.description.map(|d| d.to_string()), + req_path: req_path.to_string(), + returned: return_type, + method_name: method_name.into(), + method_type: req.operation_type, + }) +} + +/// Try our best to determine a specialized id type for this parameter, e.g. `AccountId`. +fn infer_id_path( + param_name: &str, + req_path: &str, + path_id_map: &HashMap, +) -> anyhow::Result> { + let pieces = req_path.trim_matches('/').split('/'); + + // For now we only infer the first parametrized piece as an idea, so collect everything + // that precedes it and return is this is not the first parameterized piece + let mut preceding_sections = vec![]; + for piece in pieces { + if piece.starts_with('{') { + if piece.trim_start_matches('{').trim_end_matches('}') == param_name { + break; + } else { + return Ok(None); + } + } else { + preceding_sections.push(piece); + } + } + + // Based on the request path, infer what it belongs to. Note that parameter names + // are used inconsistently so they are not used at all in inference + + // /accounts -> account + let obj_name = if preceding_sections.len() == 1 { + unpluralize(preceding_sections.first().unwrap()) + // /treasury/inbound_transfers/ -> treasury.inbound_transfer + } else if preceding_sections.len() == 2 { + let class = preceding_sections.first().unwrap(); + let item = preceding_sections.get(1).unwrap(); + format!("{class}.{}", unpluralize(item)) + // Some cases here, but mostly around test helpers, so not too urgent to handle + } else { + return Ok(None); + }; + + if let Some(comp) = path_id_map.get(&obj_name) { + Ok(Some(comp.clone())) + } else { + debug!("No id type for {}", req_path); + Ok(None) + } +} + +fn unpluralize(val: &str) -> String { + // A simple transformation covers the two cases we see in stripe request paths: + + // treasury_entries -> treasury_entry + if val.ends_with("ies") { + val.replace("ies", "y") + } else { + // accounts -> account + val.trim_end_matches('s').to_string() + } +} diff --git a/openapi/src/rust_object.rs b/openapi/src/rust_object.rs new file mode 100644 index 000000000..ef6f28003 --- /dev/null +++ b/openapi/src/rust_object.rs @@ -0,0 +1,264 @@ +use std::fmt::{Debug, Display, Formatter}; + +use indexmap::IndexMap; + +use crate::components::Components; +use crate::rust_type::RustType; +use crate::types::{ComponentPath, RustIdent}; +use crate::visitor::{Visit, VisitMut}; + +#[derive(Debug, Clone, Eq, PartialEq, Hash)] +pub enum RustObject { + /// A struct definition + Struct(Vec), + /// An enum definition. + Enum(Vec), + /// A definition of an enum, containing only fieldless variants, e.g. a C-like enum. + FieldlessEnum(Vec), +} + +/// Metadata about a `RustObject` - information related to documentation / naming, but +/// unrelated to the underlying type. +#[derive(Debug, Clone, Eq, PartialEq, Hash)] +pub struct ObjectMetadata { + /// The identifier for the object. + pub ident: RustIdent, + /// A doc comment for this object. + pub doc: Option, + /// The `title` field from the OpenAPI schema, used for deduplication purposes. + pub title: Option, + /// The name of the field in the OpenAPI schema + pub field_name: Option, + pub kind: ObjectKind, + pub parent: Option, +} + +impl ObjectMetadata { + pub fn new(ident: RustIdent, kind: ObjectKind) -> Self { + Self { ident, doc: None, title: None, field_name: None, kind, parent: None } + } + + /// Attach a doc comment. + pub fn doc(mut self, doc: String) -> Self { + self.doc = Some(doc); + self + } +} + +impl RustObject { + /// Can this derive `Copy`? + pub fn is_copy(&self, components: &Components) -> bool { + match self { + Self::Struct(fields) => fields.iter().all(|f| f.rust_type.is_copy(components)), + Self::FieldlessEnum(_) => true, + Self::Enum(variants) => variants.iter().all(|f| match &f.rust_type { + None => true, + Some(typ) => typ.is_copy(components), + }), + } + } + + pub fn visit<'a, T: Visit<'a>>(&'a self, visitor: &mut T) { + match self { + Self::Struct(fields) => { + for field in fields { + visitor.visit_typ(&field.rust_type); + } + } + Self::Enum(variants) => { + for variant in variants { + if let Some(typ) = &variant.rust_type { + visitor.visit_typ(typ); + } + } + } + Self::FieldlessEnum(_) => {} + } + } + + pub fn visit_mut(&mut self, visitor: &mut T) { + match self { + Self::Struct(fields) => { + for field in fields { + visitor.visit_typ_mut(&mut field.rust_type); + } + } + Self::Enum(variants) => { + for variant in variants { + if let Some(typ) = &mut variant.rust_type { + visitor.visit_typ_mut(typ); + } + } + } + Self::FieldlessEnum(_) => {} + } + } + + pub fn get_struct_field(&self, field_name: &str) -> Option<&RustType> { + match self { + Self::Struct(fields) => { + let field = fields.iter().find(|f| f.field_name == field_name); + field.map(|f| &f.rust_type) + } + _ => None, + } + } + + /// Does this contain a reference type? + pub fn has_reference(&self, components: &Components) -> bool { + match self { + Self::Struct(fields) => fields.iter().any(|f| f.rust_type.has_reference(components)), + Self::FieldlessEnum(_) => false, + Self::Enum(variants) => variants.iter().any(|v| match &v.rust_type { + None => false, + Some(typ) => typ.has_reference(components), + }), + } + } +} + +/// Specification of an enum variant that may or may not have fields. +#[derive(Debug, Clone, Eq, PartialEq, Hash)] +pub struct EnumVariant { + /// Identifier for this variant + pub variant: RustIdent, + /// The type of the single field. If `None`, no inner field + pub rust_type: Option, +} + +impl EnumVariant { + /// Make an enum variant with the given name and type. + pub fn new(variant: RustIdent, rust_type: RustType) -> Self { + Self { variant, rust_type: Some(rust_type) } + } + + /// Make a fieldless variant with the given name. + pub fn fieldless(variant: RustIdent) -> Self { + Self { variant, rust_type: None } + } +} + +/// Specification of a single field-less variant for an enum +#[derive(Debug, Clone, Eq, PartialEq, Hash)] +pub struct FieldlessVariant { + /// Raw string association of the enum, used for renaming and `as_str` implementations + pub wire_name: String, + /// Identifier for this variant + pub variant_name: RustIdent, +} + +impl FieldlessVariant { + pub fn new(wire: String, variant: RustIdent) -> Self { + Self { wire_name: wire, variant_name: variant } + } +} + +/// Visibility of a struct field +#[derive(Copy, Clone, Eq, PartialEq, Debug, Hash)] +pub enum Visibility { + /// `pub` + Public, + /// Private + Private, +} + +/// Specification for a field in a struct +#[derive(Clone, Eq, PartialEq, Hash)] +pub struct StructField { + /// Used to document this enum if provided + pub doc_comment: Option, + /// If provided, used to apply `serde(rename)` + pub rename_as: Option, + /// Name of this field + pub field_name: String, + /// Type for this field + pub rust_type: RustType, + /// Whether the field is required, affecting de/ser behavior. + pub required: bool, + /// Visibility of this field + pub vis: Visibility, +} + +// Manually implemented to avoid printing the `doc_comment`. +impl Debug for StructField { + fn fmt(&self, f: &mut Formatter<'_>) -> std::fmt::Result { + f.debug_struct("StructField") + .field("field_name", &self.field_name) + .field("rust_type", &self.rust_type) + .field("required", &self.required) + .field("vis", &self.vis) + .field("rename_as", &self.rename_as) + .finish() + } +} + +impl StructField { + pub fn new(field_name: T, rust_type: RustType, required: bool) -> Self { + Self { + field_name: field_name.to_string(), + doc_comment: None, + rename_as: None, + required, + vis: if rust_type.implies_private_field() { + Visibility::Private + } else { + Visibility::Public + }, + rust_type, + } + } + + /// Rename the field when de/serializing. + pub fn rename_as(mut self, rename: T) -> Self { + self.rename_as = Some(rename.to_string()); + self + } + + /// Attach a doc comment to the field + pub fn doc(mut self, doc_comment: T) -> Self { + self.doc_comment = Some(doc_comment.to_string()); + self + } +} + +pub fn as_enum_of_objects<'a>( + components: &'a Components, + variants: &'a [EnumVariant], +) -> Option> { + let mut object_map = IndexMap::new(); + for variant in variants { + let path = variant.rust_type.as_ref().and_then(|t| t.as_component_path())?; + let obj = components.get(path); + let name = obj.data.object_name.as_deref()?; + + // If we have duplicate object names, we cannot distinguish by the object tag, so give up here + if object_map.insert(name, path.clone()).is_some() { + return None; + } + } + Some(object_map) +} + +#[derive(Copy, Clone, Debug, Hash, Eq, PartialEq)] +pub enum ObjectKind { + /// Only used as a request parameter + RequestParam, + /// Only returned from a request + RequestReturned, + /// A core type potentially referenced anywhere + Type, +} + +impl ObjectKind { + pub fn is_request_param(self) -> bool { + matches!(self, Self::RequestParam) + } + + pub fn should_impl_serialize(self) -> bool { + true + } + + pub fn should_impl_deserialize(self) -> bool { + matches!(self, Self::RequestReturned | Self::Type) + } +} diff --git a/openapi/src/rust_type.rs b/openapi/src/rust_type.rs new file mode 100644 index 000000000..63f3bd2c2 --- /dev/null +++ b/openapi/src/rust_type.rs @@ -0,0 +1,467 @@ +use std::fmt::{Debug, Display, Formatter}; + +use crate::components::Components; +use crate::rust_object::{ObjectMetadata, RustObject}; +use crate::types::{ComponentPath, RustIdent}; +use crate::visitor::{Visit, VisitMut}; + +/// A path to a type defined elsewhere. +#[derive(Debug, Clone, Eq, PartialEq, Hash)] +pub enum PathToType { + /// A top-level component. + Component(ComponentPath), + /// The id for a top-level component. + ObjectId(ComponentPath), + Shared(RustIdent), + Deduplicated { + path: ComponentPath, + ident: RustIdent, + }, +} + +impl PathToType { + pub fn has_reference(&self, components: &Components) -> bool { + match self { + // NB: It would be more future-proof to query reference info + // directly, e.g. `components.get(path).rust_obj().has_reference(components)`, + // but this leads to infinite recursion because of the cyclical type definitions + // in the spec. For now, `false` is always accurate, so is an easy workaround + Self::Component(_) => false, + + // Always either backed by `String` or `smol_str::SmolStr` + Self::ObjectId(_) => false, + Self::Shared(ident) => components.get_extra_type(ident).obj.has_reference(components), + Self::Deduplicated { path, ident } => { + components.get_dedupped_type(ident, path).object.has_reference(components) + } + } + } + + pub fn is_copy(&self, components: &Components) -> bool { + match self { + Self::Component(comp) => components.get(comp).rust_obj().is_copy(components), + + // Always either backed by `String` or `smol_str::SmolStr` + Self::ObjectId(_) => false, + Self::Shared(ident) => components.get_extra_type(ident).obj.is_copy(components), + Self::Deduplicated { path, ident } => { + components.get_dedupped_type(ident, path).object.is_copy(components) + } + } + } +} + +#[derive(Debug, Clone, Eq, PartialEq, Hash)] +pub enum RustType { + Object(RustObject, ObjectMetadata), + /// A scalar type (meaning that does not contain another `RustType` internally, not that + /// it may not be a collection), not generated by codegen. + Simple(SimpleType), + Path { + path: PathToType, + is_ref: bool, + }, + /// Type containing an inner type. + Container(Container), +} + +impl RustType { + pub const fn bool() -> Self { + Self::Simple(SimpleType::Bool) + } + + pub const fn float() -> Self { + Self::Simple(SimpleType::Float) + } + + pub const fn string() -> Self { + Self::Simple(SimpleType::String) + } + + pub const fn int(typ: IntType) -> Self { + Self::Simple(SimpleType::Int(typ)) + } + + pub const fn ext(ext: ExtType) -> Self { + Self::Simple(SimpleType::Ext(ext)) + } + + pub fn option(typ: Self) -> Self { + Self::Container(Container::Option(Box::new(typ))) + } + + pub fn boxed(typ: Self) -> Self { + Self::Container(Container::Box(Box::new(typ))) + } + + pub fn list(typ: Self) -> Self { + Self::Container(Container::List(Box::new(typ))) + } + + pub fn search_list(typ: Self) -> Self { + Self::Container(Container::SearchList(Box::new(typ))) + } + + /// Construct an `Expandable<{typ}>`. + pub fn expandable(typ: Self) -> Self { + Self::Container(Container::Expandable(Box::new(typ))) + } + + /// Construct a `HashMap`. + pub fn str_map(value: Self, is_ref: bool) -> Self { + Self::Container(Container::Map { key: MapKey::String, value: Box::new(value), is_ref }) + } + + /// Construct a `HashMap`. + pub fn currency_map(typ: Self, is_ref: bool) -> Self { + Self::Container(Container::Map { key: MapKey::Currency, value: Box::new(typ), is_ref }) + } + + /// Construct a `Vec<{typ}>`. + pub fn vec(typ: Self) -> Self { + Self::Container(Container::Vec(Box::new(typ))) + } + + /// Construct a `&[{typ}]` + pub fn slice(typ: Self) -> Self { + Self::Container(Container::Slice(Box::new(typ))) + } + + pub fn path(path: PathToType, is_ref: bool) -> Self { + Self::Path { path, is_ref } + } + + /// Extract the component path from `{}Id` or `Option<{}Id>` + pub fn as_id_or_opt_id_path(&self) -> Option<&ComponentPath> { + match self { + Self::Path { path: PathToType::ObjectId(path), .. } => Some(path), + Self::Container(Container::Option(typ)) => match &**typ { + Self::Path { path: PathToType::ObjectId(path), .. } => Some(path), + _ => None, + }, + _ => None, + } + } + + pub fn as_component_path(&self) -> Option<&ComponentPath> { + match self { + Self::Path { path: PathToType::Component(path), .. } => Some(path), + _ => None, + } + } + + pub fn implies_private_field(&self) -> bool { + matches!(self, Self::Simple(SimpleType::Ext(ExtType::AlwaysTrue))) + } + + /// Is this type `Option<>`? + pub const fn is_option(&self) -> bool { + matches!(self, Self::Container(Container::Option(_))) + } + + /// Can this type derive `Copy`? + pub fn is_copy(&self, components: &Components) -> bool { + use Container::*; + + match self { + Self::Object(obj, ..) => obj.is_copy(components), + Self::Simple(typ) => typ.is_copy(), + Self::Path { path, is_ref } => *is_ref || path.is_copy(components), + Self::Container(typ) => match typ { + List(_) | Vec(_) | Expandable(_) | SearchList(_) => false, + Slice(_) => true, + Option(inner) | Box(inner) => inner.is_copy(components), + Map { is_ref, .. } => *is_ref, + }, + } + } + + /// Does this contain a reference? Primarily used for detecting types that may + /// require lifetimes. + pub fn has_reference(&self, components: &Components) -> bool { + match self { + Self::Object(obj, ..) => obj.has_reference(components), + Self::Simple(typ) => typ.is_reference(), + Self::Path { path, is_ref } => *is_ref || path.has_reference(components), + Self::Container(typ) => match typ { + Container::Slice(_) => true, + Container::Map { is_ref: true, .. } => true, + _ => typ.value_typ().has_reference(components), + }, + } + } + + pub fn component_path(path: ComponentPath) -> Self { + Self::path(PathToType::Component(path), false) + } + + pub fn serde_json_value(is_ref: bool) -> Self { + Self::Simple(SimpleType::Ext(ExtType::Value { is_ref })) + } + + pub fn object_id(id_path: ComponentPath, is_ref: bool) -> Self { + Self::path(PathToType::ObjectId(id_path), is_ref) + } + + pub fn into_nullable(self) -> Self { + match self { + Self::Container(Container::Option(_)) => self, + _ => Self::option(self), + } + } + + pub fn skip_serializing(&self) -> Option<&'static str> { + match self { + Self::Container(Container::Option(_)) => Some("Option::is_none"), + _ => None, + } + } + + /// Find any `RustObject` that may be contained in this type + pub fn extract_object(&self) -> Option<(&RustObject, &ObjectMetadata)> { + match self { + Self::Object(obj, meta) => Some((obj, meta)), + Self::Simple(_) | Self::Path { .. } => None, + Self::Container(typ) => typ.value_typ().extract_object(), + } + } + + pub fn as_object(&self) -> Option<(&RustObject, &ObjectMetadata)> { + match self { + Self::Object(obj, meta) => Some((obj, meta)), + _ => None, + } + } + + pub fn as_object_mut(&mut self) -> Option<(&mut RustObject, &ObjectMetadata)> { + match self { + Self::Object(obj, meta) => Some((obj, meta)), + _ => None, + } + } + + pub fn into_object(self) -> Option<(RustObject, ObjectMetadata)> { + match self { + Self::Object(obj, meta) => Some((obj, meta)), + _ => None, + } + } + + pub fn as_rust_object(&self) -> Option<&RustObject> { + self.as_object().map(|r| r.0) + } + + pub fn visit<'a, T: Visit<'a>>(&'a self, visitor: &mut T) { + use RustType::*; + match self { + Object(obj, meta) => { + visitor.visit_obj(obj, Some(meta)); + } + Simple(_) | Path { .. } => {} + Container(inner) => visitor.visit_typ(inner.value_typ()), + } + } + + pub fn visit_mut(&mut self, visitor: &mut T) { + use RustType::*; + match self { + Object(obj, meta) => { + visitor.visit_obj_mut(obj, Some(meta)); + } + Simple(_) | Path { .. } => {} + Container(inner) => visitor.visit_typ_mut(inner.value_typ_mut()), + } + } +} + +#[derive(Debug, Copy, Clone, Eq, PartialEq, Hash)] +pub enum MapKey { + String, + Currency, +} + +impl Display for MapKey { + fn fmt(&self, f: &mut Formatter<'_>) -> std::fmt::Result { + f.write_str(match self { + Self::String => "String", + Self::Currency => ExtType::Currency.ident(), + }) + } +} + +/// Representation of a type containing an inner type. +#[derive(Debug, Clone, Eq, PartialEq, Hash)] +pub enum Container { + /// List<{typ}> + List(Box), + /// SearchList<{typ}> + SearchList(Box), + /// Vec<{typ}> + Vec(Box), + /// &[{typ}] + Slice(Box), + /// Expandable<{typ}> + Expandable(Box), + /// Option<{typ}> + Option(Box), + /// Box<{typ}> + Box(Box), + /// HashMap<{key}, {typ}> + Map { + /// HashMap key type. + key: MapKey, + /// HashMap value type. + value: Box, + /// Are we a reference? + is_ref: bool, + }, +} + +impl Container { + /// Get a reference to the inner contained type. + pub fn value_typ(&self) -> &RustType { + use Container::*; + match self { + List(typ) => typ, + SearchList(typ) => typ, + Vec(typ) => typ, + Slice(typ) => typ, + Expandable(typ) => typ, + Option(typ) => typ, + Box(typ) => typ, + Map { value, .. } => value, + } + } + + /// Get a mutable reference to the inner contained type. + pub fn value_typ_mut(&mut self) -> &mut RustType { + use Container::*; + match self { + List(typ) => typ, + SearchList(typ) => typ, + Vec(typ) => typ, + Slice(typ) => typ, + Expandable(typ) => typ, + Option(typ) => typ, + Box(typ) => typ, + Map { value, .. } => value, + } + } +} + +/// Either a Rust defined scalar type, or a type predefined in `stripe_types`. +#[derive(Copy, Clone, Eq, PartialEq, Hash)] +pub enum SimpleType { + /// bool + Bool, + /// f64 + Float, + /// &str + Str, + /// String + String, + /// One of primitive rust integer types. + Int(IntType), + /// Type defined in `stripe_types`. + Ext(ExtType), +} + +impl SimpleType { + /// Does this type implement `Copy`? + pub const fn is_copy(self) -> bool { + !matches!(self, Self::String | Self::Ext(ExtType::Value { is_ref: false })) + } + + /// Is this type a reference? + pub const fn is_reference(self) -> bool { + matches!(self, Self::Str | Self::Ext(ExtType::Value { is_ref: true })) + } + + pub const fn ident(self) -> &'static str { + use SimpleType::*; + match self { + Bool => "bool", + Float => "f64", + String => "String", + Str => "str", + Int(typ) => typ.as_str(), + Ext(ext) => ext.ident(), + } + } + + /// Identifier we'll use when this type is part of an enum, e.g. + /// `Timestamp(stripe_types::Timestamp)` + pub const fn display_name(self) -> &'static str { + use SimpleType::*; + match self { + Ext(ext) => ext.display_name(), + typ => typ.ident(), + } + } +} + +impl Debug for SimpleType { + fn fmt(&self, f: &mut Formatter<'_>) -> std::fmt::Result { + f.write_str(self.ident()) + } +} + +#[derive(Debug, Copy, Clone, Eq, PartialEq, Hash)] +pub enum IntType { + U8, + U32, + U64, + I64, +} + +impl IntType { + pub const fn as_str(self) -> &'static str { + match self { + Self::U8 => "u8", + Self::U32 => "u32", + Self::U64 => "u64", + Self::I64 => "i64", + } + } +} + +impl Display for IntType { + fn fmt(&self, f: &mut Formatter<'_>) -> std::fmt::Result { + f.write_str(self.as_str()) + } +} + +/// Types defined outside of codegen. +#[derive(Debug, Copy, Clone, Eq, PartialEq, Hash)] +pub enum ExtType { + Currency, + RangeQueryTs, + Timestamp, + AlwaysTrue, + /// serde_json::Value + Value { + is_ref: bool, + }, +} + +impl ExtType { + pub const fn ident(self) -> &'static str { + match self { + Self::Currency => "stripe_types::Currency", + Self::RangeQueryTs => "stripe_types::RangeQueryTs", + Self::Timestamp => "stripe_types::Timestamp", + Self::AlwaysTrue => "stripe_types::AlwaysTrue", + Self::Value { .. } => "serde_json::Value", + } + } + + pub const fn display_name(self) -> &'static str { + match self { + Self::Currency => "Currency", + Self::RangeQueryTs => "RangeQueryTs", + Self::Timestamp => "Timestamp", + Self::AlwaysTrue => "AlwaysTrue", + Self::Value { .. } => "Value", + } + } +} diff --git a/openapi/src/spec.rs b/openapi/src/spec.rs index c229f22ce..aaa634b3c 100644 --- a/openapi/src/spec.rs +++ b/openapi/src/spec.rs @@ -1,10 +1,12 @@ -use anyhow::Context; use indexmap::IndexMap; use openapiv3::{ - Components, ObjectType, OpenAPI, Operation, Parameter, ParameterData, ParameterSchemaOrContent, - PathItem, QueryStyle, ReferenceOr, Response, Schema, SchemaKind, StatusCode, Type, + Components, ObjectType, OpenAPI, Operation, PathItem, ReferenceOr, Response, Schema, + SchemaKind, StatusCode, Type, }; +use crate::stripe_object::OperationType; +use crate::types::ComponentPath; + #[derive(Debug, Clone)] pub struct Spec(OpenAPI); @@ -21,24 +23,30 @@ impl Spec { self.0.components.as_ref().expect("Spec did not contain `components`!") } - /// Return an iterator over the paths to each endpoint - pub fn paths(&self) -> impl Iterator { - self.0.paths.paths.keys() + pub fn get_component_schema(&self, path: &ComponentPath) -> &Schema { + let schema_or_ref = + &self.components().schemas.get(path.as_ref()).expect("Schema not found"); + schema_or_ref.as_item().expect("Expected top level component to be an item") } pub fn component_schemas(&self) -> &IndexMap> { &self.components().schemas } - pub fn get_schema_unwrapped(&self, name: &str) -> &ReferenceOr { - self.component_schemas() - .get(name) - .as_ref() - .unwrap_or_else(|| panic!("Expected to find a schema with name = {}", name)) + pub fn get_request(&self, path: &str) -> Option<&ReferenceOr> { + self.0.paths.paths.get(path) } - pub fn get_request_unwrapped(&self, path: &str) -> &ReferenceOr { - self.0.paths.paths.get(path).expect("Path not found") + pub fn get_request_operation(&self, path: &str, op: OperationType) -> Option<&Operation> { + let item = self.get_request(path)?.as_item().expect("Expected Stripe requests to be items"); + let operation = match op { + OperationType::Get => &item.get, + OperationType::Post => &item.post, + OperationType::Delete => &item.delete, + } + .as_ref() + .expect("No operation found on request"); + Some(operation) } } @@ -69,6 +77,12 @@ pub fn as_enum_strings(schema: &Schema) -> Option> { } } +pub fn is_enum_with_just_empty_string(item: &ReferenceOr) -> bool { + let ReferenceOr::Item(item) = item else { return false }; + let Some(enum_strings) = as_enum_strings(item) else { return false }; + enum_strings.len() == 1 && enum_strings.first().unwrap().is_empty() +} + /// Untyped equivalent: `schema["enum"][0]` pub fn as_first_enum_value(schema: &Schema) -> Option { as_enum_strings(schema)?.first().cloned() @@ -98,85 +112,23 @@ pub fn get_ok_response_schema(operation: &Operation) -> Option<&ReferenceOr Option<&str> { - let any_of = match &schema.schema_kind { - SchemaKind::AnyOf { any_of } => any_of, - _ => return None, - }; - any_of.first()?.as_item()?.schema_data.title.as_deref() -} - -pub fn err_schema_expected(operation: &Operation) -> bool { - operation - .responses - .default - .as_ref() - .map(|err_schema| match err_schema { - ReferenceOr::Reference { reference } => reference == "#/components/schemas/error", - ReferenceOr::Item(_) => true, - }) - .unwrap_or_default() -} - -pub fn non_path_ref_params(operation: &Operation) -> Vec { - operation.parameters.iter().flat_map(|p| p.as_item()).cloned().collect() -} - -pub fn get_request_form_parameters(operation: &Operation) -> anyhow::Result> { - let form_schema = operation +pub fn get_request_form_parameters(operation: &Operation) -> Option<&ReferenceOr> { + let schema = operation .request_body - .as_ref() - .context("No request body")? - .as_item() - .context("Expected item")? + .as_ref()? + .as_item()? .content - .get("application/x-www-form-urlencoded") - .context("No form content found")? + .get("application/x-www-form-urlencoded")? .schema - .as_ref() - .context("No request schema")? - .as_item() - .context("Expected item")?; - let obj_type = as_object_type(form_schema).context("Expected object type schema")?; - let properties = &obj_type.properties; - Ok(properties - .iter() - .map(|(key, value)| { - let maybe_item = value.as_item(); - Parameter::Query { - parameter_data: ParameterData { - name: key.clone(), - description: maybe_item.and_then(|i| i.schema_data.description.clone()), - required: obj_type.required.iter().any(|v| v.as_str() == key), - deprecated: None, - format: ParameterSchemaOrContent::Schema(value.clone().unbox()), - example: None, - examples: Default::default(), - explode: None, - extensions: Default::default(), - }, - allow_reserved: false, - style: QueryStyle::DeepObject, - allow_empty_value: None, - } - }) - .collect()) -} + .as_ref(); -pub fn find_param_by_name<'a>(operation: &'a Operation, name: &str) -> Option<&'a Parameter> { - operation.parameters.iter().find_map(|p| { - p.as_item().and_then(|p| if p.parameter_data_ref().name == name { Some(p) } else { None }) - }) -} - -/// Untyped equivalent: -/// `params["parameters"].as_array().and_then(|arr| arr.iter().find(|p| p["in"].as_str() == Some("path")))` -pub fn get_id_param(params: &[ReferenceOr]) -> Option<&Parameter> { - params.iter().find_map(|p| match p { - ReferenceOr::Item(param @ Parameter::Path { .. }) => Some(param), - _ => None, - }) + // Treat empty object as `None` + if let Some(obj_type) = schema.and_then(|s| s.as_item().and_then(as_object_type)) { + if obj_type.properties.is_empty() { + return None; + } + } + schema } #[derive(Debug, Clone, serde::Deserialize)] diff --git a/openapi/src/spec_fetch.rs b/openapi/src/spec_fetch.rs index 1120ff232..dc67ba5d3 100644 --- a/openapi/src/spec_fetch.rs +++ b/openapi/src/spec_fetch.rs @@ -1,7 +1,7 @@ use std::fs; use anyhow::Context; -use regex::Regex; +use regex_lite::Regex; use reqwest::blocking::Client; use reqwest::header::USER_AGENT; use serde_json::Value; @@ -21,7 +21,7 @@ pub fn parse_spec_version(arg: &str) -> anyhow::Result { "latest" => Ok(SpecVersion::Latest), "current" => Ok(SpecVersion::Current), version => { - let re = Regex::new(r#"v[1-9]\d*"#).unwrap(); + let re = Regex::new(r"v[1-9]\d*").unwrap(); if re.is_match(version) { Ok(SpecVersion::Version(as_lower)) } else { diff --git a/openapi/src/spec_inference.rs b/openapi/src/spec_inference.rs new file mode 100644 index 000000000..af5fdd929 --- /dev/null +++ b/openapi/src/spec_inference.rs @@ -0,0 +1,481 @@ +use std::borrow::Borrow; +use std::fmt::Write; + +use anyhow::bail; +use heck::ToSnakeCase; +use openapiv3::{ + AdditionalProperties, IntegerFormat, ObjectType, ReferenceOr, Schema, SchemaKind, StringType, + Type, VariantOrUnknownOrEmpty, +}; + +use crate::rust_object::{ + EnumVariant, FieldlessVariant, ObjectKind, ObjectMetadata, RustObject, StructField, +}; +use crate::rust_type::{ExtType, IntType, RustType, SimpleType}; +use crate::spec::{ + as_data_array_item, as_object_enum_name, is_enum_with_just_empty_string, ExpansionResources, +}; +use crate::types::{ComponentPath, RustIdent}; + +#[derive(Copy, Clone, Debug)] +pub struct Inference<'a> { + can_borrow: bool, + id_path: Option<&'a ComponentPath>, + curr_ident: &'a RustIdent, + field_name: Option<&'a str>, + description: Option<&'a str>, + title: Option<&'a str>, + required: bool, + kind: ObjectKind, +} + +impl<'a> Inference<'a> { + pub fn new(ident: &'a RustIdent, kind: ObjectKind) -> Self { + Self { + can_borrow: false, + field_name: None, + description: None, + required: false, + curr_ident: ident, + id_path: None, + title: None, + kind, + } + } + + pub fn can_borrow(mut self, can_borrow: bool) -> Self { + self.can_borrow = can_borrow; + self + } + + pub fn field_name(mut self, name: &'a str) -> Self { + self.field_name = Some(name); + self + } + + pub fn maybe_description(mut self, desc: Option<&'a str>) -> Self { + self.description = desc; + self + } + + pub fn id_path(mut self, path: &'a ComponentPath) -> Self { + self.id_path = Some(path); + self + } + + pub fn title(mut self, title: Option<&'a str>) -> Self { + self.title = title; + self + } + + pub fn curr_ident(mut self, ident: &'a RustIdent) -> Self { + self.curr_ident = ident; + self + } + + pub fn required(mut self, is_required: bool) -> Self { + self.required = is_required; + self + } + + fn next_ident(&self) -> RustIdent { + if let Some(field_name) = self.field_name { + RustIdent::joined(self.curr_ident, field_name) + } else { + self.curr_ident.clone() + } + } + + fn build_object_type(self, data: RustObject) -> RustType { + let next_ident = self.next_ident(); + RustType::Object( + data, + ObjectMetadata { + ident: next_ident, + doc: self.description.map(|d| d.to_string()), + title: self.title.map(|t| t.to_string()), + field_name: self.field_name.map(|t| t.to_string()), + kind: self.kind, + parent: Some(self.curr_ident.clone()), + }, + ) + } + + pub fn infer_schema_type(&self, schema: &Schema) -> RustType { + let base_type = self.title(schema.schema_data.title.as_deref()).infer_base_type(schema); + let is_nullable = schema.schema_data.nullable; + if !self.required || is_nullable { + base_type.into_nullable() + } else { + base_type + } + } + + fn should_infer_as_id_type(&self) -> bool { + let Some(desc) = self.description else { + return false; + }; + if desc.starts_with("A cursor for use in pagination") + || desc.starts_with("An object ID cursor") + { + return true; + } + if self.field_name == Some("id") + && (desc.starts_with("Unique identifier") + || desc.starts_with("The ID of the") + || desc.starts_with("The identifier for the") + || desc.starts_with("The [ID of the")) + { + return true; + } + + false + } + + fn infer_bool_type(&self) -> RustType { + // NB: stripe actually includes an `enum` field with only `true` as a more reliable + // way to detect this case, but that is not exposed by the `openapi` crate + let Some(desc) = self.description else { + return RustType::bool(); + }; + if desc.contains("Always true for") { + return RustType::ext(ExtType::AlwaysTrue); + } + RustType::bool() + } + + fn infer_base_type(&self, field: &Schema) -> RustType { + match &field.schema_kind { + SchemaKind::Type(Type::Boolean(_)) => self.infer_bool_type(), + SchemaKind::Type(Type::Number(_)) => RustType::float(), + SchemaKind::Type(Type::Integer(format)) => self.infer_integer_type(&format.format), + SchemaKind::Type(Type::String(typ)) => self.infer_string_typ(typ), + SchemaKind::Type(Type::Array(typ)) => { + let element = typ.items.as_ref().expect("Array type had no items field"); + let element_type = self.required(true).infer_schema_or_ref_type(element); + if self.can_borrow { + RustType::slice(element_type) + } else { + RustType::vec(element_type) + } + } + SchemaKind::Type(Type::Object(typ)) => self.infer_object_typ(typ, field), + SchemaKind::AnyOf { any_of: fields } | SchemaKind::OneOf { one_of: fields } => { + self.infer_any_or_one_of(fields, field) + } + _ => { + panic!("unhandled field type"); + } + } + } + + fn infer_string_typ(&self, typ: &StringType) -> RustType { + let variants = build_enum_variants(&typ.enumeration); + + if !variants.is_empty() { + return self.build_object_type(RustObject::FieldlessEnum(variants)); + } + if let Some(f_name) = self.field_name { + if f_name == "currency" || f_name.ends_with("_currency") { + return RustType::ext(ExtType::Currency); + } + } + + if self.should_infer_as_id_type() { + if let Some(id_path) = self.id_path { + return RustType::object_id(id_path.clone(), self.can_borrow); + } + } + + if self.can_borrow { + RustType::Simple(SimpleType::Str) + } else { + RustType::string() + } + } + + fn infer_object_typ(&self, typ: &ObjectType, field: &Schema) -> RustType { + // Should we infer a `List` or `SearchList`? + if let Some(list_kind) = infer_list_container_kind(field) { + let element = as_data_array_item(typ).unwrap_or_else(|| { + panic!("Expected to find array item but found {:?}", field.schema_kind) + }); + let element_type = self.required(true).infer_schema_or_ref_type(element); + return match list_kind { + ListContainerKind::List => RustType::list(element_type), + ListContainerKind::SearchList => RustType::search_list(element_type), + }; + } + + if let Some(AdditionalProperties::Schema(additional)) = &typ.additional_properties { + let map_value_typ = + self.required(true).can_borrow(false).infer_schema_or_ref_type(additional); + return if should_infer_currency_key_from_desc(self.description) { + RustType::currency_map(map_value_typ, self.can_borrow) + } else { + RustType::str_map(map_value_typ, self.can_borrow) + }; + } + + // NB: There is some inconsistency between usage of properties: {} and not including + // the properties key in the OpenAPI spec where not including properties: {} seems + // to imply that any object might be valid (or too complex for the OpenAPI spec). Since + // we cannot distinguish between the 2 cases, we always default to serde_json::Value + // when there is no specification of object shape. + + // FIXME: The unfortunate `field_name.is_some()` is used to avoid substituting + // a serde_json::Value for a top level component type (see for example mandate_us_bank_account) + if typ.properties.is_empty() && self.field_name.is_some() { + return RustType::serde_json_value(self.can_borrow); + } + + // Generate the struct type + let mut fields = vec![]; + let next_ident = self.next_ident(); + for (prop_field_name, field_spec) in &typ.properties { + let is_required = typ.required.contains(prop_field_name); + let field_desc = + field_spec.as_item().and_then(|i| i.schema_data.description.as_deref()); + fields.push( + self.required(is_required) + .curr_ident(&next_ident) + .maybe_description(field_desc) + .build_struct_field(prop_field_name, field_spec), + ); + } + self.build_object_type(RustObject::Struct(fields)) + } + + fn infer_any_or_one_of(&self, fields: &[ReferenceOr], field: &Schema) -> RustType { + let fields = fields + .iter() + .filter(|field| !is_enum_with_just_empty_string(field)) + .collect::>(); + if fields.len() == 1 { + self.infer_schema_or_ref_type(fields[0]) + } else if let Some(resources) = field.schema_data.extensions.get("x-expansionResources") { + parse_expansion_resources(resources).expect("Failed to parse expansion resources") + } else if fields[0].as_item().and_then(|s| s.schema_data.title.as_deref()) + == Some("range_query_specs") + { + RustType::ext(ExtType::RangeQueryTs) + } else { + let enum_ = self.build_enum_variants(fields).expect("Could not build enum with fields"); + self.build_object_type(RustObject::Enum(enum_)) + } + } + + pub fn infer_schema_or_ref_type>(&self, field: &ReferenceOr) -> RustType { + match field { + ReferenceOr::Reference { reference } => { + let path = ComponentPath::from_reference(reference); + // Must box `ApiErrors`, otherwise we end up with an infinitely + // sized type + let should_box = path.as_ref() == "api_errors"; + let mut typ = RustType::component_path(path); + + if should_box { + typ = RustType::boxed(typ); + } + if !self.required { + typ = typ.into_nullable(); + } + typ + } + ReferenceOr::Item(schema) => { + let schema = schema.borrow(); + self.infer_schema_type(schema) + } + } + } + + pub fn build_struct_field>( + &self, + field_name: &str, + field: &ReferenceOr, + ) -> StructField { + let rust_type = self.field_name(field_name).infer_schema_or_ref_type(field); + let mut field_rename = field_name.to_snake_case(); + if field_rename == "type" { + field_rename = "type_".into(); + } + let mut struct_field = StructField::new(&field_rename, rust_type, self.required); + if let Some(doc) = self.description { + struct_field = struct_field.doc(doc); + } + if field_rename != field_name { + struct_field = struct_field.rename_as(field_name); + } + struct_field + } + + fn build_enum_variants( + &self, + fields: Vec<&ReferenceOr>, + ) -> anyhow::Result> { + let mut variants = Vec::with_capacity(fields.len()); + for option in fields { + match option { + ReferenceOr::Reference { reference } => { + let schema_path = ComponentPath::from_reference(reference); + variants.push(EnumVariant::new( + RustIdent::create(&schema_path), + RustType::component_path(schema_path), + )); + } + ReferenceOr::Item(item) => { + let mut ctx = self.required(true); + let inferred_name = infer_enum_variant_name(item); + if let Some(name) = inferred_name { + ctx = ctx.field_name(name); + } + let rust_type = ctx.required(true).infer_schema_type(item); + if let Some(RustObject::FieldlessEnum(fieldless_variants)) = + rust_type.as_rust_object() + { + for variant in fieldless_variants { + variants.push(EnumVariant::fieldless(variant.variant_name.clone())); + } + } else { + let variant_ident = if let Some(name) = inferred_name { + RustIdent::create(name) + } else if let RustType::Simple(typ) = &rust_type { + RustIdent::create(typ.display_name()) + } else { + bail!( + "Could not infer a variant name for {item:?} and type {:?}", + rust_type + ); + }; + variants.push(EnumVariant::new(variant_ident, rust_type)); + } + } + } + } + Ok(variants) + } + + fn infer_integer_type(&self, int_fmt: &VariantOrUnknownOrEmpty) -> RustType { + if matches!(int_fmt, VariantOrUnknownOrEmpty::Unknown(inner) if inner == "unix-time") { + return RustType::ext(ExtType::Timestamp); + } + + // Infer based on field name, otherwise default + let Some(name) = self.field_name else { return RustType::int(IntType::I64) }; + + let name_snake = name.to_snake_case(); + let name_words = name_snake.split('_').collect::>(); + if name_words.contains(&"date") { + RustType::ext(ExtType::Timestamp) + } else if name == "monthly_anchor" { + RustType::int(IntType::U8) + } else if name_words.contains(&"days") { + RustType::int(IntType::U32) + } else if name_words.contains(&"count") + || name_words.contains(&"size") + || name_words.contains(&"quantity") + { + RustType::int(IntType::U64) + } else { + RustType::int(IntType::I64) + } + } +} + +fn should_infer_currency_key_from_desc(desc: Option<&str>) -> bool { + let Some(desc) = desc else { + return false; + }; + desc.contains("Each key must be a three-letter [ISO currency code]") +} + +fn parse_expansion_resources(resources: &serde_json::Value) -> anyhow::Result { + let expansion_resources = serde_json::from_value::(resources.clone())?; + + let schema_kind = expansion_resources.into_schema_kind(); + let SchemaKind::OneOf { one_of } = schema_kind else { + bail!("Expected expansion resources to only contain `oneOf`"); + }; + if one_of.len() != 1 { + bail!("Expected a single specification in expansion resources"); + } + let ReferenceOr::Reference { reference } = one_of.first().unwrap() else { + bail!("Expected expansion resource to only contain a schema reference"); + }; + let path = ComponentPath::from_reference(reference); + Ok(RustType::expandable(RustType::component_path(path))) +} + +fn build_enum_variants(options: &[Option]) -> Vec { + let mut enum_variants = vec![]; + for wire_name in options.iter().flatten() { + if wire_name.trim().is_empty() { + continue; + } + let variant_name = match wire_name.as_str() { + "*" => RustIdent::create("all"), + "self" => RustIdent::unchanged("Self_"), + n => { + if n.chars().next().unwrap().is_ascii_digit() { + RustIdent::unchanged(format!("V{}", n.replace(['-', '.'], "_"))) + } else { + // Hit for the case of timezones, e.g. Etc+7 and Etc-7 + if wire_name.contains(['+', '-']) { + let cleaned = wire_name.replace('+', "Plus").replace('-', "Minus"); + RustIdent::create(&cleaned) + } else { + RustIdent::create(wire_name) + } + } + } + }; + enum_variants.push(FieldlessVariant::new(wire_name.clone(), variant_name)); + } + enum_variants +} + +fn infer_enum_variant_name(schema: &Schema) -> Option<&str> { + if let Some(title) = &schema.schema_data.title { + return Some(title); + } + if let Some(desc) = &schema.schema_data.description { + if desc.contains("The ID of") { + return Some("Id"); + } + } + None +} + +/// Try to generate the best doc comment we can using the information provided. `doc_url` +/// is the source for more info, currently provided by `UrlFinder`. +pub fn infer_doc_comment(schema: &Schema, doc_url: Option<&str>) -> String { + let mut doc_comment = if let Some(descr) = &schema.schema_data.description { + descr.clone() + } else if let Some(title) = &schema.schema_data.title { + format!("The resource representing a Stripe {title}") + } else { + // This case is rare, but possible + String::new() + }; + if let Some(doc) = doc_url { + let _ = writeln!(doc_comment, "\n\nFor more details see <{doc}>."); + } + doc_comment +} + +#[derive(Copy, Clone)] +enum ListContainerKind { + List, + SearchList, +} + +/// We can distinguish the `List` and `SearchList` types by the presence of a field named "object" +/// which is an enum with only the option of `list` or `search_result` +fn infer_list_container_kind(field: &Schema) -> Option { + let obj_enum_name = as_object_enum_name(field); + match obj_enum_name.as_deref() { + Some("list") => Some(ListContainerKind::List), + Some("search_result") => Some(ListContainerKind::SearchList), + _ => None, + } +} diff --git a/openapi/src/stripe_object.rs b/openapi/src/stripe_object.rs new file mode 100644 index 000000000..ee228025b --- /dev/null +++ b/openapi/src/stripe_object.rs @@ -0,0 +1,351 @@ +use std::collections::HashMap; +use std::path::PathBuf; + +use heck::ToSnakeCase; +use indexmap::IndexMap; +use lazy_static::lazy_static; +use openapiv3::Schema; +use serde::{Deserialize, Serialize}; + +use crate::crates::Crate; +use crate::deduplication::DeduppedObject; +use crate::rust_object::{ObjectKind, RustObject}; +use crate::rust_type::RustType; +use crate::spec_inference::Inference; +use crate::types::{ComponentPath, RustIdent}; +use crate::visitor::{Visit, VisitMut}; + +#[derive(Debug, Copy, Clone, Hash, Eq, PartialEq)] +pub struct CrateInfo { + krate: Crate, + type_defs_are_shared: bool, +} + +impl CrateInfo { + pub fn new(krate: Crate) -> Self { + Self { krate, type_defs_are_shared: false } + } + + pub fn set_share_type_defs(&mut self) { + self.type_defs_are_shared = true; + } + + pub fn are_type_defs_shared(&self) -> bool { + self.type_defs_are_shared || self.krate == Crate::SHARED + } + + pub fn for_types(&self) -> Crate { + if self.type_defs_are_shared { + Crate::SHARED + } else { + self.krate + } + } + + pub fn base(&self) -> Crate { + self.krate + } +} + +#[derive(Debug, Clone)] +pub struct StripeObject { + pub requests: Vec, + pub resource: StripeResource, + pub data: StripeObjectData, + pub krate: Option, + pub stripe_doc_url: Option, + pub deduplicated_objects: IndexMap, +} + +impl StripeObject { + pub fn krate(&self) -> Option { + self.krate + } + + #[track_caller] + pub fn krate_unwrapped(&self) -> CrateInfo { + let Some(krate) = self.krate() else { + panic!("Has no crate assigned: \n{:?}", self); + }; + krate + } + + #[track_caller] + pub fn krate_unwrapped_mut(&mut self) -> &mut CrateInfo { + self.krate.as_mut().expect("No crate assigned") + } + + pub fn assign_crate(&mut self, new_krate: Crate) { + self.krate = Some(CrateInfo::new(new_krate)); + } + + pub fn mod_path(&self) -> String { + self.resource.mod_path() + } + + pub fn types_split_from_requests(&self) -> bool { + self.types_are_shared() && self.krate_unwrapped().base() != Crate::SHARED + } + + /// Do schema definitions live in `stripe_shared`? + pub fn types_are_shared(&self) -> bool { + let krate = self.krate_unwrapped(); + krate.for_types() == Crate::SHARED + } + + /// The crate we write schema definitions to + pub fn types_crate(&self) -> Crate { + let krate = self.krate_unwrapped(); + krate.for_types() + } + + /// The crate we write request content to + pub fn req_crate(&self) -> Crate { + let krate = self.krate_unwrapped(); + krate.base() + } + + fn get_requests_folder_path(&self) -> PathBuf { + self.req_crate().get_path().join(self.mod_path()) + } + + pub fn get_requests_module_path(&self) -> PathBuf { + self.get_requests_folder_path().join("mod.rs") + } + + pub fn get_requests_content_path(&self) -> PathBuf { + self.get_requests_folder_path().join("requests.rs") + } + + pub fn get_types_content_path(&self) -> PathBuf { + if !self.has_requests() || self.types_split_from_requests() { + self.types_crate().get_path().join(format!("{}.rs", self.mod_path())) + } else { + self.get_requests_folder_path().join("types.rs") + } + } + + pub fn has_requests(&self) -> bool { + !self.requests.is_empty() + } + + pub fn path(&self) -> &ComponentPath { + &self.resource.path + } + + pub fn ident(&self) -> &RustIdent { + self.resource.ident() + } + + pub fn id_type_ident(&self) -> RustIdent { + RustIdent::create(format!("{}Id", self.ident())) + } + + pub fn id_type(&self) -> Option<&RustType> { + self.data.id_type.as_ref() + } + + pub fn rust_obj(&self) -> &RustObject { + &self.data.obj + } + + pub fn is_nested_resource_of(&self, other: &Self) -> bool { + if self.requests.is_empty() { + return false; + } + self.requests.iter().all(|r| { + let start = format!("/{}", other.path()); + r.req_path.starts_with(&start) + }) + } + + pub fn visit<'a, V: Visit<'a>>(&'a self, visitor: &mut V) { + visitor.visit_obj(&self.data.obj, None); + for req in &self.requests { + visitor.visit_req(req); + } + } + + pub fn visit_mut(&mut self, visitor: &mut V) { + visitor.visit_obj_mut(&mut self.data.obj, None); + for req in &mut self.requests { + visitor.visit_req_mut(req); + } + } +} + +#[derive(Debug, Clone)] +pub struct StripeObjectData { + pub obj: RustObject, + pub object_name: Option, + pub id_type: Option, +} + +pub fn parse_stripe_schema_as_rust_object( + schema: &Schema, + path: &ComponentPath, + ident: &RustIdent, +) -> StripeObjectData { + let not_deleted_path = path.as_not_deleted(); + let infer_ctx = + Inference::new(ident, ObjectKind::Type).id_path(¬_deleted_path).required(true); + let typ = infer_ctx.infer_schema_type(schema); + let Some((mut rust_obj, _)) = typ.into_object() else { + panic!("Unexpected top level schema type for {}", path); + }; + match &mut rust_obj { + RustObject::Struct(fields) => { + let mut id_type = None; + let mut object_name = None; + fields.retain(|field| { + if field.field_name == "id" && field.rust_type.as_id_or_opt_id_path().is_some() { + id_type = Some(field.rust_type.clone()); + } + if field.field_name == "object" { + if let Some(RustObject::FieldlessEnum(variants)) = + field.rust_type.as_rust_object() + { + if variants.len() == 1 { + let first = variants.first().unwrap(); + object_name = Some(first.wire_name.clone()); + // The object name is used purely as a discriminant, so is + // unnecessary to generate 1-enum type for. + return false; + } + } + } + true + }); + StripeObjectData { obj: rust_obj, object_name, id_type } + } + RustObject::Enum(_) => { + // TODO: could validate that this enum holds what we expect from a top-level component, + // namely a union of references to other components. We also are implicitly assuming + // these components have ids + StripeObjectData { obj: rust_obj, object_name: None, id_type: Some(RustType::string()) } + } + RustObject::FieldlessEnum(_) => panic!("Unexpected top level schema type"), + } +} + +#[derive(Debug, Clone, Eq, PartialEq, Serialize, Deserialize)] +pub struct StripeOperation { + pub method_name: String, + pub method_type: MethodType, + pub method_on: String, + #[serde(rename = "operation")] + pub operation_type: OperationType, + pub path: String, +} + +#[derive(Debug, Copy, Clone, Eq, PartialEq, Serialize, Deserialize)] +#[serde(rename_all = "lowercase")] +pub enum MethodType { + Retrieve, + List, + Create, + Update, + Delete, + Custom, +} + +#[derive(Debug, Copy, Clone, Eq, PartialEq, Serialize, Deserialize, Hash)] +#[serde(rename_all = "lowercase")] +pub enum OperationType { + Get, + Post, + Delete, +} + +#[derive(Debug, Clone, Deserialize, Default)] +struct BaseResource { + pub in_package: Option, +} + +#[derive(Debug, Clone)] +pub struct StripeResource { + pub path: ComponentPath, + base_ident: RustIdent, + pub in_package: Option, + pub requests: Vec, +} + +impl StripeResource { + pub fn mod_path(&self) -> String { + self.ident().to_snake_case() + } + + pub fn ident(&self) -> &RustIdent { + &self.base_ident + } +} + +impl StripeResource { + pub fn from_schema(schema: &Schema, path: ComponentPath) -> anyhow::Result { + let resource = + if let Some(stripe_resource) = schema.schema_data.extensions.get("x-stripeResource") { + serde_json::from_value(stripe_resource.clone())? + } else { + BaseResource::default() + }; + let mut in_package = None; + if let Some(package) = resource.in_package { + if !package.is_empty() { + in_package = Some(package.to_snake_case()); + } + } + + let ident = infer_object_ident(&path); + let requests = if let Some(val) = schema.schema_data.extensions.get("x-stripeOperations") { + serde_json::from_value(val.clone())? + } else { + vec![] + }; + Ok(Self { base_ident: ident, in_package, requests, path }) + } +} + +fn infer_object_ident(path: &ComponentPath) -> RustIdent { + lazy_static! { + static ref OBJECT_RENAMES: HashMap<&'static str, &'static str> = HashMap::from([ + ("invoiceitem", "invoice_item"), + ("item", "checkout_session_item"), + ("line_item", "invoice_line_item"), + ("fee_refund", "application_fee_refund"), + ]); + } + if let Some(renamed) = OBJECT_RENAMES.get(path.as_ref()) { + RustIdent::create(renamed) + } else { + RustIdent::create(path) + } +} + +#[derive(Debug, Clone)] +pub struct RequestSpec { + pub path_params: Vec, + pub params: RustType, + pub method_type: OperationType, + pub returned: RustType, + pub doc_comment: Option, + pub req_path: String, + pub method_name: String, +} + +impl RequestSpec { + pub fn visit<'a, V: Visit<'a>>(&'a self, visitor: &mut V) { + visitor.visit_typ(&self.returned); + visitor.visit_typ(&self.params); + } + + pub fn visit_mut(&mut self, visitor: &mut V) { + visitor.visit_typ_mut(&mut self.returned); + visitor.visit_typ_mut(&mut self.params); + } +} + +#[derive(Debug, Clone)] +pub struct PathParam { + pub name: String, + pub rust_type: RustType, +} diff --git a/openapi/src/templates/cargo_toml.rs b/openapi/src/templates/cargo_toml.rs new file mode 100644 index 000000000..586fdebbb --- /dev/null +++ b/openapi/src/templates/cargo_toml.rs @@ -0,0 +1,109 @@ +use std::fmt::Write; + +use indoc::formatdoc; + +use crate::crates::Crate; + +const CORE_FEATURES: &[&str] = &[ + "runtime-tokio-hyper", + "runtime-tokio-hyper-rustls", + "runtime-tokio-hyper-rustls-webpki", + "runtime-blocking", + "runtime-blocking-rustls", + "runtime-blocking-rustls-webpki", + "runtime-async-std-surf", +]; + +pub fn gen_crate_toml(krate: Crate, crate_deps: Vec, crate_features: Vec) -> String { + let mut crate_dep_section = String::new(); + for dep in crate_deps { + let dep_path = format!("../../generated/{}", dep.name()); + let _ = writeln!(crate_dep_section, r#"{} = {{path = "{}"}}"#, dep.name(), dep_path); + } + + // Dependencies only needed for libraries which implement Stripe requests + let request_deps = if krate == Crate::SHARED { + "".into() + } else { + formatdoc! { + r#" + http-types.workspace = true + async-stripe = {{path = "../../async-stripe"}} + "# + } + }; + + let features = + if krate == Crate::SHARED { "".into() } else { gen_feature_section(crate_features) }; + formatdoc! { + r#" + [package] + name = "{krate}" + version.workspace = true + description.workspace = true + edition.workspace = true + rust-version.workspace = true + authors.workspace = true + license.workspace = true + homepage.workspace = true + repository.workspace = true + keywords.workspace = true + categories.workspace = true + + [lib] + path = "src/mod.rs" + + [dependencies] + serde.workspace = true + smol_str.workspace = true + serde_json.workspace = true + stripe_types = {{path = "../../stripe_types"}} + + {request_deps} + + {crate_dep_section} + + {features} + "# + } +} + +fn gen_feature_section(mut crate_features: Vec) -> String { + let mut feature_section = String::new(); + for feature in CORE_FEATURES { + let _ = writeln!(feature_section, r#"{feature} = ["async-stripe/{feature}"]"#); + } + feature_section.push('\n'); + + crate_features.sort_unstable(); + for feature in &crate_features { + let _ = writeln!(feature_section, "{feature} = []"); + } + if !crate_features.is_empty() { + feature_section.push('\n'); + let _ = writeln!( + feature_section, + "full = [{}]", + crate_features + .iter() + .map(|feat| format!(r#""{feat}""#)) + .collect::>() + .join(",\n") + ); + } + + let mut docs_rs_features = String::from(r#"["runtime-tokio-hyper""#); + if !crate_features.is_empty() { + docs_rs_features.push_str(r#", "full""#); + } + docs_rs_features.push(']'); + formatdoc! { + r#" + [features] + {feature_section} + + [package.metadata.docs.rs] + features = {docs_rs_features} + "# + } +} diff --git a/openapi/src/templates/derives.rs b/openapi/src/templates/derives.rs new file mode 100644 index 000000000..fc837ba84 --- /dev/null +++ b/openapi/src/templates/derives.rs @@ -0,0 +1,42 @@ +#[derive(Debug, Copy, Clone, Eq, PartialEq, Hash)] +pub struct Derives { + pub copy: bool, + pub debug: bool, + pub default: bool, + pub eq: bool, + pub serialize: bool, + pub deserialize: bool, +} + +impl Derives { + pub const fn new() -> Self { + Self { + debug: true, + copy: false, + default: false, + eq: false, + serialize: false, + deserialize: false, + } + } + + pub fn debug(mut self, debug: bool) -> Self { + self.debug = debug; + self + } + + pub fn copy(mut self, copy: bool) -> Self { + self.copy = copy; + self + } + + pub fn default(mut self, default: bool) -> Self { + self.default = default; + self + } + + pub fn eq(mut self, eq: bool) -> Self { + self.eq = eq; + self + } +} diff --git a/openapi/src/templates/enums.rs b/openapi/src/templates/enums.rs new file mode 100644 index 000000000..5f1f03599 --- /dev/null +++ b/openapi/src/templates/enums.rs @@ -0,0 +1,189 @@ +use std::fmt::Write as _; + +use indexmap::IndexMap; +use indoc::writedoc; + +use crate::printable::PrintableWithLifetime; +use crate::rust_object::{EnumVariant, FieldlessVariant}; +use crate::templates::object_writer::{write_derives_line, ObjectWriter}; +use crate::templates::utils::write_serde_rename; +use crate::types::ComponentPath; + +impl<'a> ObjectWriter<'a> { + pub fn write_enum_variants(&self, out: &mut String, variants: &[EnumVariant]) { + let enum_name = self.ident; + + // Build the body of the enum definition + let mut enum_body = String::with_capacity(64); + for EnumVariant { variant, rust_type } in variants { + if let Some(typ) = rust_type { + let printable = self.components.construct_printable_type(typ); + let typ = PrintableWithLifetime::new(&printable, self.lifetime); + let _ = writeln!(enum_body, "{variant}({typ}),"); + } else { + let _ = writeln!(enum_body, "{variant},"); + } + } + self.write_automatic_derives(out); + let lifetime_str = self.lifetime_param(); + let _ = writedoc!( + out, + r#" + #[serde(untagged)] + pub enum {enum_name}{lifetime_str} {{ + {enum_body} + }} + "# + ); + } + + pub fn write_enum_of_objects(&self, out: &mut String, objects: &IndexMap<&str, ComponentPath>) { + if self.lifetime.is_some() { + unimplemented!(); + } + let enum_name = self.ident; + + // Build the body of the enum definition + let mut enum_body = String::with_capacity(64); + for (obj_name, obj_path) in objects { + let comp = self.components.get(obj_path); + let name = comp.ident(); + let printable = self.components.construct_printable_type_from_path(obj_path); + + write_serde_rename(&mut enum_body, obj_name); + let _ = writeln!(enum_body, "{name}({printable}),"); + } + if self.provide_unknown_variant { + let _ = writeln!(enum_body, "#[serde(other)]"); + let _ = writeln!(enum_body, "Unknown"); + } + + self.write_automatic_derives(out); + self.write_nonexhaustive_attr(out); + let _ = writedoc!( + out, + r#" + #[serde(tag = "object")] + pub enum {enum_name} {{ + {enum_body} + }} + "# + ); + } + + /// Generate the enum definition, along with the methods `as_str`, `as_ref`, `impl Display`, + /// and `impl Default`. + pub fn write_fieldless_enum_variants(&self, out: &mut String, variants: &[FieldlessVariant]) { + let enum_name = self.ident; + // Build the body of the enum definition + let mut enum_def_body = String::with_capacity(128); + for FieldlessVariant { variant_name, .. } in variants { + let _ = writeln!(enum_def_body, "{variant_name},"); + } + if self.provide_unknown_variant { + let _ = writedoc!( + enum_def_body, + r" + /// An unrecognized value from Stripe. Should not be used as a request parameter. + Unknown, + " + ); + } + + // Build the body of the `as_str` implementation + let mut as_str_body = String::with_capacity(32); + for FieldlessVariant { wire_name, variant_name } in variants { + let _ = writeln!(as_str_body, r#"{variant_name} => "{wire_name}","#); + } + if self.provide_unknown_variant { + let _ = writeln!(as_str_body, r#"Unknown => "unknown","#); + } + + // Build the body of the `from_str` implementation + let mut from_str_body = String::with_capacity(32); + for FieldlessVariant { wire_name, variant_name } in variants { + let _ = writeln!(from_str_body, r#""{wire_name}" => Ok({variant_name}),"#); + } + let _ = writeln!(from_str_body, "_ => Err(())"); + + // NB: we manually implement Debug, Serialize, Deserialize to avoid duplicating + // the (potentially many) strings in `as_str` and `from_str` used with the default derive. + // These derived implementations often show up running `llvm-lines`, so easy + // binary size + compile time win by doing this. + + write_derives_line(out, self.derives.eq(true).debug(false)); + self.write_nonexhaustive_attr(out); + let _ = writedoc!( + out, + r#" + pub enum {enum_name} {{ + {enum_def_body} + }} + impl {enum_name} {{ + pub fn as_str(self) -> &'static str {{ + use {enum_name}::*; + match self {{ + {as_str_body} + }} + }} + }} + + impl std::str::FromStr for {enum_name} {{ + type Err = (); + fn from_str(s: &str) -> Result {{ + use {enum_name}::*; + match s {{ + {from_str_body} + }} + }} + }} + impl std::fmt::Display for {enum_name} {{ + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {{ + f.write_str(self.as_str()) + }} + }} + + impl std::fmt::Debug for {enum_name} {{ + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {{ + f.write_str(self.as_str()) + }} + }} + "# + ); + + if self.obj_kind.should_impl_serialize() { + let _ = writedoc!( + out, + r#" + impl serde::Serialize for {enum_name} {{ + fn serialize(&self, serializer: S) -> Result where S: serde::Serializer {{ + serializer.serialize_str(self.as_str()) + }} + }} + "# + ); + } + + if self.obj_kind.should_impl_deserialize() { + let ret_line = if self.provide_unknown_variant { + format!("Ok(Self::from_str(&s).unwrap_or({enum_name}::Unknown))") + } else { + format!( + r#"Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for {enum_name}"))"# + ) + }; + let _ = writedoc!( + out, + r#" + impl<'de> serde::Deserialize<'de> for {enum_name} {{ + fn deserialize>(deserializer: D) -> Result {{ + use std::str::FromStr; + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + {ret_line} + }} + }} + "# + ); + } + } +} diff --git a/openapi/src/templates/mod.rs b/openapi/src/templates/mod.rs new file mode 100644 index 000000000..a382220c0 --- /dev/null +++ b/openapi/src/templates/mod.rs @@ -0,0 +1,10 @@ +//! This module holds methods relating to the generation of rust code. +pub mod cargo_toml; +pub mod derives; +pub mod enums; +pub mod object_trait; +pub mod object_writer; +pub mod requests; +pub mod structs; +pub mod utils; +pub use object_writer::ObjectWriter; diff --git a/openapi/src/templates/object_trait.rs b/openapi/src/templates/object_trait.rs new file mode 100644 index 000000000..9f6e7621e --- /dev/null +++ b/openapi/src/templates/object_trait.rs @@ -0,0 +1,50 @@ +use std::fmt::Write; + +use indexmap::IndexMap; +use indoc::writedoc; + +use crate::components::Components; +use crate::printable::PrintableType; +use crate::types::{ComponentPath, RustIdent}; +use crate::STRIPE_TYPES; + +pub fn write_object_trait(out: &mut String, ident: &RustIdent, id_type: &PrintableType) { + let _ = writedoc!( + out, + r#" + impl {STRIPE_TYPES}::Object for {ident} {{ + type Id = {id_type}; + fn id(&self) -> &Self::Id {{ + &self.id + }} + }} + "# + ); +} + +pub fn write_object_trait_for_enum( + components: &Components, + out: &mut String, + ident: &RustIdent, + variants: &IndexMap<&str, ComponentPath>, +) { + let mut match_inner = String::with_capacity(32); + for path in variants.values() { + let comp = components.get(path); + let ident = comp.ident(); + let _ = writeln!(match_inner, "Self::{ident}(v) => v.id.inner(),"); + } + let _ = writedoc!( + out, + r#" + impl {STRIPE_TYPES}::Object for {ident} {{ + type Id = smol_str::SmolStr; + fn id(&self) -> &Self::Id {{ + match self {{ + {match_inner} + }} + }} + }} + "# + ); +} diff --git a/openapi/src/templates/object_writer.rs b/openapi/src/templates/object_writer.rs new file mode 100644 index 000000000..ad69710ab --- /dev/null +++ b/openapi/src/templates/object_writer.rs @@ -0,0 +1,96 @@ +use std::fmt::Write; + +use crate::components::Components; +use crate::printable::{Lifetime, PrintableType}; +use crate::rust_object::ObjectKind; +use crate::rust_type::RustType; +use crate::templates::derives::Derives; +use crate::types::RustIdent; + +#[derive(Copy, Clone)] +pub struct ObjectWriter<'a> { + pub components: &'a Components, + pub derives: Derives, + pub lifetime: Option, + pub ident: &'a RustIdent, + pub provide_unknown_variant: bool, + pub obj_kind: ObjectKind, +} + +impl<'a> ObjectWriter<'a> { + pub fn new(components: &'a Components, ident: &'a RustIdent, obj_kind: ObjectKind) -> Self { + Self { + components, + derives: Derives::new(), + lifetime: None, + ident, + provide_unknown_variant: false, + obj_kind, + } + } + + pub fn lifetime(&mut self, lifetime: Option) -> &mut Self { + self.lifetime = lifetime; + self + } + + pub fn provide_unknown_variant(&mut self, unknown_variant: bool) -> &mut Self { + self.provide_unknown_variant = unknown_variant; + self + } + + pub fn derive_copy(&mut self, derive_copy: bool) -> &mut Self { + self.derives = self.derives.copy(derive_copy); + self + } + + pub fn derive_default(&mut self, derive_default: bool) -> &mut Self { + self.derives = self.derives.default(derive_default); + self + } + + pub fn get_printable(&self, typ: &RustType) -> PrintableType { + self.components.construct_printable_type(typ) + } + + pub fn lifetime_param(&self) -> &'static str { + self.lifetime.map(|l| l.as_param()).unwrap_or_default() + } + + pub fn write_nonexhaustive_attr(&self, out: &mut String) { + if self.provide_unknown_variant { + let _ = out.write_str("#[non_exhaustive]"); + } + } + + pub fn write_automatic_derives(&self, out: &mut String) { + let mut derives = self.derives; + derives.serialize = self.obj_kind.should_impl_serialize(); + derives.deserialize = self.obj_kind.should_impl_deserialize(); + write_derives_line(out, derives) + } +} + +pub fn write_derives_line(out: &mut String, derives: Derives) { + let _ = out.write_str("#[derive("); + if derives.copy { + let _ = write!(out, "Copy,"); + } + let _ = write!(out, "Clone,"); + if derives.debug { + let _ = write!(out, "Debug,"); + } + if derives.default { + let _ = write!(out, "Default,"); + } + if derives.eq { + let _ = write!(out, "Eq, PartialEq,"); + } + if derives.serialize { + let _ = write!(out, "serde::Serialize,"); + } + if derives.deserialize { + let _ = write!(out, "serde::Deserialize,"); + } + let _ = out.write_str(")]"); +} diff --git a/openapi/src/templates/requests.rs b/openapi/src/templates/requests.rs new file mode 100644 index 000000000..721347e62 --- /dev/null +++ b/openapi/src/templates/requests.rs @@ -0,0 +1,127 @@ +use std::fmt::Write; + +use indoc::{formatdoc, writedoc}; + +use crate::components::Components; +use crate::printable::{Lifetime, PrintableType}; +use crate::rust_type::{Container, RustType}; +use crate::stripe_object::{OperationType, RequestSpec}; +use crate::templates::utils::write_doc_comment; + +impl RequestSpec { + fn gen_path_arg(&self) -> String { + let req_path = &self.req_path; + + // Parameterized request path + if !self.path_params.is_empty() { + format!(r#"&format!("{req_path}")"#) + // Plain request path + } else { + format!(r#""{req_path}""#) + } + } + + fn gen_method_path_params(&self, components: &Components) -> String { + self.path_params + .iter() + .map(|p| format!("{}:{}", p.name, components.construct_printable_type(&p.rust_type))) + .collect::>() + .join(",") + } + + pub fn gen(&self, components: &Components) -> String { + let mut req_out = String::with_capacity(128); + self.write_req_body(&mut req_out, components); + + let lifetime_str = + if self.params.has_reference(components) { Lifetime.as_param() } else { "" }; + let impl_for = components.construct_printable_type(&self.params); + if let Some(pagination_kind) = as_pagination_kind(&self.returned) { + self.gen_paginate( + components.construct_printable_type(&self.returned), + pagination_kind, + &mut req_out, + components, + ) + } + formatdoc!( + r#" + impl{lifetime_str} {impl_for}{lifetime_str} {{ + {req_out} + }} + "# + ) + } + + fn write_req_body(&self, out: &mut String, components: &Components) { + let return_type = components.construct_printable_type(&self.returned); + let path_arg = self.gen_path_arg(); + let path_params = self.gen_method_path_params(components); + + let method_enum = match self.method_type { + OperationType::Get => "Get", + OperationType::Post => "Post", + OperationType::Delete => "Delete", + }; + let body = match self.method_type { + OperationType::Get => { + format!("client.get_query({path_arg}, self)") + } + OperationType::Post | OperationType::Delete => { + format!("client.send_form({path_arg}, self, http_types::Method::{method_enum})") + } + }; + if let Some(doc) = &self.doc_comment { + let comment = write_doc_comment(doc, 2); + let _ = write!(out, "{comment}"); + } + let _ = writedoc!( + out, + r#" + pub fn send(&self, client: &stripe::Client, {path_params}) -> stripe::Response<{return_type}> {{ + {body} + }} + "# + ); + } + + fn gen_paginate( + &self, + pagination_typ: PrintableType, + kind: PaginationKind, + out: &mut String, + components: &Components, + ) { + let path = self.gen_path_arg(); + let path_params = self.gen_method_path_params(components); + + let paginate_method_name = match kind { + PaginationKind::List => "from_list_params", + PaginationKind::Search => "from_search_params", + }; + let _ = writedoc!( + out, + r#" + pub fn paginate(self, {path_params}) -> stripe::ListPaginator<{pagination_typ}> {{ + stripe::ListPaginator::{paginate_method_name}({path}, self) + }} + "# + ); + } +} + +#[derive(Copy, Clone)] +enum PaginationKind { + /// List + List, + /// Search + Search, +} + +fn as_pagination_kind(typ: &RustType) -> Option { + match typ { + RustType::Container(Container::List(_)) => Some(PaginationKind::List), + RustType::Container(Container::SearchList(_)) => Some(PaginationKind::Search), + _ => None, + } +} diff --git a/openapi/src/templates/structs.rs b/openapi/src/templates/structs.rs new file mode 100644 index 000000000..fc6553b74 --- /dev/null +++ b/openapi/src/templates/structs.rs @@ -0,0 +1,98 @@ +use std::fmt::Write; + +use indoc::{formatdoc, writedoc}; + +use crate::printable::PrintableWithLifetime; +use crate::rust_object::{StructField, Visibility}; +use crate::templates::utils::{write_doc_comment, write_serde_rename}; +use crate::templates::ObjectWriter; + +impl<'a> ObjectWriter<'a> { + pub fn write_struct(&self, out: &mut String, fields: &[StructField]) { + let name = self.ident; + + let mut fields_str = String::with_capacity(64); + for field in fields { + self.write_struct_field(&mut fields_str, field); + } + + let lifetime_str = self.lifetime_param(); + self.write_automatic_derives(out); + let _ = writedoc!( + out, + r" + pub struct {name}{lifetime_str} {{ + {fields_str} + }} + " + ); + + if self.obj_kind.is_request_param() { + let cons_body = if self.derives.default { + r" + pub fn new() -> Self { + Self::default() + } + " + .into() + } else { + let mut cons_inner = String::new(); + let mut params = String::new(); + for field in fields { + if field.required { + let printable = self.get_printable(&field.rust_type); + let typ = PrintableWithLifetime::new(&printable, self.lifetime); + let _ = write!(params, "{}: {typ},", field.field_name); + let _ = write!(cons_inner, "{},", field.field_name); + } else { + // `Default::default()` would also evaluate to `None` for `Option` types, but nice to + // generate less code and maybe make things easier for the compiler since most + // of these types are `Option`. + let field_default_val = + if field.rust_type.is_option() { "None" } else { "Default::default()" }; + let _ = write!(cons_inner, "{}: {field_default_val},", field.field_name); + } + } + formatdoc! { + r" + pub fn new({params}) -> Self {{ + Self {{ + {cons_inner} + }} + }} + " + } + }; + let _ = writedoc!( + out, + r" + impl{lifetime_str} {name}{lifetime_str} {{ + {cons_body} + }} + " + ); + } + } + + fn write_struct_field(&self, out: &mut String, field: &StructField) { + if let Some(doc_comment) = &field.doc_comment { + let _ = writeln!(out, "{}", write_doc_comment(doc_comment, 1).trim_end()); + } + if let Some(renamer) = &field.rename_as { + write_serde_rename(out, renamer); + } + if !field.required { + if let Some(skip_ser) = field.rust_type.skip_serializing() { + let _ = writeln!(out, r#"#[serde(skip_serializing_if = "{skip_ser}")]"#); + } + } + + let printable = self.get_printable(&field.rust_type); + let typ = PrintableWithLifetime::new(&printable, self.lifetime); + let vis = match field.vis { + Visibility::Public => "pub ", + Visibility::Private => "", + }; + let _ = writeln!(out, "{vis}{}: {typ},", field.field_name); + } +} diff --git a/openapi/src/templates/utils.rs b/openapi/src/templates/utils.rs new file mode 100644 index 000000000..de1d2e706 --- /dev/null +++ b/openapi/src/templates/utils.rs @@ -0,0 +1,116 @@ +use std::fmt::Write; + +use lazy_static::lazy_static; +use regex_lite::Regex; + +lazy_static! { + /// Regex for a period followed by 1 or 2 whitespaces + static ref PERIOD_THEN_WHITESPACE: Regex = Regex::new(r"\.\s[\s]?").unwrap(); +} + +pub fn write_serde_rename(out: &mut String, rename: &str) { + let _ = writeln!(out, r#"#[serde(rename = "{rename}")]"#); +} + +/// Write a formatted doc comment. +/// +/// Where Stripe's description has reasonable line length, we follow their newline usage (happy, simple case). +/// When Stripe does not include newlines, we manually insert newlines on each sentence end. +pub fn write_doc_comment(description: &str, depth: u8) -> String { + if description.trim().is_empty() { + return String::new(); + } + let mut out = String::with_capacity(description.len()); + let doc = format_doc_comment(description); + + for (i, line) in doc.split('\n').enumerate() { + if i > 0 { + out.push('\n'); + } + print_indent(&mut out, depth); + if line.is_empty() { + out.push_str("///"); + continue; + } + // If a reasonable line, follow Stripe + if line.len() < 100 { + out.push_str("/// "); + out.push_str(line); + // If an unreasonable line, inject newlines after each sentence + } else { + for (i, part) in PERIOD_THEN_WHITESPACE.split(line).enumerate() { + if i > 0 { + out.push('\n'); + } + print_indent(&mut out, depth); + out.push_str("/// "); + out.push_str(part.trim()); + if !part.is_empty() && !out.ends_with('.') { + out.push('.'); + } + } + } + } + if !out.ends_with('\n') { + out.push('\n'); + } + out +} + +pub fn write_top_level_doc_comment(description: &str) -> String { + let doc = format_doc_comment(description); + + let mut out = String::new(); + for (i, line) in doc.split('\n').enumerate() { + if i > 0 { + out.push('\n'); + } + if !line.is_empty() { + out.push_str("//! "); + out.push_str(line); + } else { + out.push_str("//!"); + } + } + out.push('\n'); + out +} + +fn print_indent(out: &mut String, depth: u8) { + for _ in 0..depth { + out.push_str(" "); + } +} + +fn format_doc_comment(doc: &str) -> String { + lazy_static! { + static ref P_TAG: Regex = Regex::new("

|

").unwrap(); + static ref BR_TAG: Regex = Regex::new("
").unwrap(); + static ref A_DOC_TAG: Regex = Regex::new("([^<]+)").unwrap(); + static ref A_HASH_TAG: Regex = Regex::new("([^<]+)").unwrap(); + static ref A_HTTP_TAG: Regex = Regex::new("([^<]+)").unwrap(); + static ref CODE_TAG: Regex = Regex::new("|").unwrap(); + static ref EM_TAG: Regex = Regex::new("|||").unwrap(); + static ref STRONG_TAG: Regex = Regex::new("|||").unwrap(); + static ref AMOUNT_OPEN_TAG: Regex = Regex::new("").unwrap(); + static ref AMOUNT_CLOSE_TAG: Regex = Regex::new("").unwrap(); + static ref CURRENCY_OPEN_TAG: Regex = Regex::new("").unwrap(); + static ref CURRENCY_CLOSE_TAG: Regex = Regex::new("").unwrap(); + static ref HYPERLINK: Regex = Regex::new(r"([^\(])(https?://(www\.)?[-a-zA-Z0-9@:%._\+~#=]{1,256}\.[a-zA-Z0-9()]{1,6}\b([-a-zA-Z0-9()@:%_\+.~#?&//=]*))([^\)])").unwrap(); + } + let doc = P_TAG.replace_all(doc, ""); + let doc = BR_TAG.replace_all(&doc, "\n"); + let doc = A_DOC_TAG.replace_all(&doc, "[${2}](https://stripe.com/docs/${1})"); + let doc = A_HASH_TAG.replace_all(&doc, "[${2}](https://stripe.com/docs/api#${1})"); + let doc = A_HTTP_TAG.replace_all(&doc, "[$2]($1)"); + let doc = CODE_TAG.replace_all(&doc, "`"); + let doc = EM_TAG.replace_all(&doc, "_"); + let doc = STRONG_TAG.replace_all(&doc, "**"); + let doc = AMOUNT_OPEN_TAG.replace_all(&doc, ""); + let doc = AMOUNT_CLOSE_TAG.replace_all(&doc, "00"); // add cents to get correct "integer" argument + let doc = CURRENCY_OPEN_TAG.replace_all(&doc, "$"); // add locale formatting (we can only support one easily in our rust docs...) + let doc = CURRENCY_CLOSE_TAG.replace_all(&doc, ""); + let doc = HYPERLINK.replace_all(&doc, "$1<$2>$5"); // replace all hyperlinks that are not already in markdown with rust doc links + let doc = doc.replace("[Deprecated]", r"\[Deprecated\]"); // Otherwise rustdoc creates broken intra-doc links + doc.trim().into() +} diff --git a/openapi/src/types.rs b/openapi/src/types.rs index 9b3422812..754182f8d 100644 --- a/openapi/src/types.rs +++ b/openapi/src/types.rs @@ -1,55 +1,101 @@ -use openapiv3::Parameter; +use std::borrow::Borrow; +use std::fmt::{Debug, Display, Formatter}; +use std::ops::Deref; -#[derive(Clone, Copy, Debug)] -pub enum CopyOrClone { - Copy, - Clone, +use heck::ToUpperCamelCase; + +#[derive(Debug, Clone, Eq, PartialEq, Hash, Ord, PartialOrd)] +pub struct RustIdent(String); + +impl RustIdent { + /// Only to be used safely when `val` is known to be a valid + /// and we don't want to convert to camelcase since it strips + /// underscores (e.g. `ApiVersion`). + pub fn unchanged(val: T) -> Self { + Self(val.to_string()) + } + + pub fn create>(val: T) -> Self { + let val = val.as_ref(); + if val.contains('.') { + Self(val.replace('.', "_").to_upper_camel_case()) + } else { + Self(val.to_upper_camel_case()) + } + } + + pub fn joined(piece1: T, piece2: U) -> Self { + Self::create(format!("{piece1}_{piece2}")) + } +} + +impl Deref for RustIdent { + type Target = str; + + fn deref(&self) -> &Self::Target { + &self.0 + } +} + +impl AsRef for RustIdent { + fn as_ref(&self) -> &str { + &self.0 + } } -#[derive(Clone, Debug, Copy)] -pub enum TypeError { - IsObject, - NoType, - Unhandled, +impl Display for RustIdent { + fn fmt(&self, f: &mut Formatter<'_>) -> std::fmt::Result { + f.write_str(self.0.as_str()) + } } +#[derive(Clone, Eq, PartialEq, Hash, Ord, PartialOrd)] +pub struct ComponentPath(String); -#[derive(Clone, Debug, PartialEq)] -pub struct InferredEnum { - pub parent: String, - pub field: String, - pub options: Vec, +impl ComponentPath { + pub const fn new(path: String) -> Self { + Self(path) + } + + pub fn from_reference(reference: &str) -> Self { + let root_obj = reference.trim_start_matches("#/components/schemas/"); + Self::new(root_obj.into()) + } + + pub fn as_not_deleted(&self) -> Self { + Self::new(self.0.trim_start_matches("deleted_").to_string()) + } } -#[derive(Clone, Debug, PartialEq)] -pub struct InferredUnion { - pub field: String, - pub schema_variants: Vec, +// This is a bit silly...just done because `petgraph` prints graph labels using `Debug` so this +// is a hack to have the labels print more concisely while still using our `ComponentPath` newtype +impl Debug for ComponentPath { + fn fmt(&self, f: &mut Formatter<'_>) -> std::fmt::Result { + write!(f, "{}", self.0) + } } -#[derive(Clone, Debug, PartialEq)] -pub struct InferredStruct { - pub field: String, - pub schema: openapiv3::Schema, +impl Display for ComponentPath { + fn fmt(&self, f: &mut Formatter<'_>) -> std::fmt::Result { + write!(f, "{}", self.0) + } } -#[derive(Clone, Debug, PartialEq)] -pub struct InferredParams { - pub method: String, - pub rust_type: String, - pub parameters: Vec, +impl AsRef for ComponentPath { + fn as_ref(&self) -> &str { + &self.0 + } } -#[derive(Clone, Debug, PartialEq)] -pub struct InferredObject { - pub rust_type: String, - pub schema: openapiv3::Schema, +impl Deref for ComponentPath { + type Target = str; + + fn deref(&self) -> &Self::Target { + &self.0 + } } -#[derive(Eq, PartialEq, Hash, PartialOrd, Ord, Debug)] -pub enum MethodTypes { - List, - Create, - Retrieve, - Update, - Delete, +impl Borrow for ComponentPath { + fn borrow(&self) -> &str { + &self.0 + } } diff --git a/openapi/src/url_finder.rs b/openapi/src/url_finder.rs index f80651f81..fd4ee695b 100644 --- a/openapi/src/url_finder.rs +++ b/openapi/src/url_finder.rs @@ -1,104 +1,86 @@ use std::collections::HashMap; +use std::fs::File; -use anyhow::{anyhow, Result}; -use heck::SnakeCase; +use anyhow::{anyhow, bail, Result}; +use heck::ToSnakeCase; use reqwest::blocking::Client; +use tracing::{info, warn}; + +use crate::components::Components; // we use a common user agent, otherwise stripe rejects the connection const APP_USER_AGENT: &str = "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/97.0.4692.71 Safari/537.36"; #[derive(Debug)] pub struct UrlFinder { - url_lookup: HashMap, + /// Map of object name to stripe URL path (unprefixed) + doc_links: HashMap, } impl UrlFinder { pub fn new() -> Result { - let client = Client::builder().user_agent(APP_USER_AGENT).build()?; - let resp = client.get("https://stripe.com/docs/api").send()?; - - if resp.status().is_success() { - let text = resp.text()?; - if let Some(line) = text.lines().find(|l| l.contains("window.__INITIAL_STATE__ = ")) { - let initial_state: StripeInitialState = serde_json::from_str( - line.trim() - .trim_start_matches("window.__INITIAL_STATE__ = ") - .trim_end_matches(";"), - ) - .expect("should be valid json"); - Ok(Self { url_lookup: initial_state.into() }) - } else { - Err(anyhow!("stripe api returned unexpected document")) - } - } else { - tracing::error!("{}", resp.text()?); - Err(anyhow!("request to stripe api returned non-200 status code")) - } + let doc_links = serde_json::from_reader(File::open("doc_urls.json")?)?; + Ok(Self { doc_links }) } pub fn url_for_object(&self, object: &str) -> Option { - let object_name = object.replace('.', "_").to_snake_case(); - tracing::debug!("looking for {} in html", object_name); - let object_names = [format!("{}_object", object_name), object_name]; - for name in object_names { - if let Some(path) = self.url_lookup.get(&name) { - return Some(format!("https://stripe.com{}", path)); - } - } - - tracing::warn!("{} not in html", object); - None + let Some(unprefixed_link) = self.doc_links.get(object) else { + return None; + }; + Some(format!("https://stripe.com/docs/api{}", unprefixed_link)) } } -#[derive(Debug, serde::Deserialize)] -#[serde(rename_all = "camelCase")] -struct StripeInitialState { - article: Article, -} - -#[derive(Debug, serde::Deserialize)] -#[serde(rename_all = "camelCase")] -struct Article { - lazily_loaded_content: LazilyLoadedContent, +fn url_for_object( + object: &str, + raw_data: &serde_json::Map, +) -> Option { + let object_name = object.replace('.', "_").to_snake_case(); + let object_names = [format!("{}_object", object_name), object_name]; + for name in object_names { + if let Some(path) = raw_data + .get(&name) + .and_then(|o| o.as_object().expect("this should be an object").get("path")) + .and_then(|s| s.as_str()) + { + return Some(path.to_string()); + } + } + None } -impl From for HashMap { - fn from(value: StripeInitialState) -> Self { - value - .article - .lazily_loaded_content - .after - .into_iter() - .flat_map(|after| { - let routes = after.attributes.section_routes; - let anchors = after.attributes.anchors; - assert!(anchors.len() == routes.len()); +pub fn update_api_doc_data(api_url: &str, components: &Components) -> Result<()> { + let flattened = fetch_flattened_api_data(api_url)?; - // anchors have been rotated -1 so we need to cycle sectionRoutes to match - anchors.into_iter().zip(routes.into_iter().cycle().skip(1)) - }) - .collect() + let mut new_doc_data: HashMap = HashMap::new(); + for path in components.components.keys() { + if let Some(doc_url) = url_for_object(path.as_ref(), &flattened) { + new_doc_data.insert(path.to_string(), doc_url); + } else { + warn!("No doc url found for path `{path}`"); + } } -} -#[derive(Debug, serde::Deserialize)] -#[serde(rename_all = "camelCase")] -struct LazilyLoadedContent { - after: Vec, + serde_json::to_writer_pretty(File::create("doc_urls.json")?, &new_doc_data)?; + info!("Wrote updated data to `doc_urls.json`"); + Ok(()) } -#[derive(Debug, serde::Deserialize)] -#[serde(rename_all = "camelCase")] -struct AfterItem { - attributes: Attributes, -} +fn fetch_flattened_api_data(api_url: &str) -> Result> { + let client = Client::builder().user_agent(APP_USER_AGENT).build()?; + let resp = client.get(api_url).send()?; -#[derive(Debug, serde::Deserialize)] -#[serde(rename_all = "camelCase")] -struct Attributes { - #[serde(default)] - anchors: Vec, - #[serde(default)] - section_routes: Vec, + if resp.status().is_success() { + let text = resp.text()?; + let Some(line) = text.lines().find(|l| l.contains("flattenedAPISections: {")) else { + bail!("Unexpected Stripe API doc format") + }; + let api_sections = serde_json::from_str( + line.trim().trim_start_matches("flattenedAPISections: ").trim_end_matches(','), + )?; + Ok(api_sections) + } else { + tracing::error!("{}", resp.text()?); + Err(anyhow!("request to stripe api returned non-200 status code")) + } } diff --git a/openapi/src/util.rs b/openapi/src/util.rs deleted file mode 100644 index 13f965a27..000000000 --- a/openapi/src/util.rs +++ /dev/null @@ -1,133 +0,0 @@ -use std::fmt::Write as _; - -use heck::SnakeCase; -use lazy_static::lazy_static; -use openapiv3::{IntegerFormat, Schema, VariantOrUnknownOrEmpty}; -use regex::Regex; - -use crate::file_generator::FileGenerator; - -pub fn write_out_field(out: &mut String, var_name: &str, var_type: &str, required: bool) { - if required { - writeln!(out, " pub {var_name}: {var_type},").unwrap(); - } else { - out.push_str(" #[serde(skip_serializing_if = \"Option::is_none\")]\n"); - writeln!(out, " pub {var_name}: Option<{var_type}>,").unwrap(); - } -} - -pub fn write_serde_rename(out: &mut String, rename: &str) { - writeln!(out, r#" #[serde(rename = "{rename}")]"#).unwrap(); -} - -pub fn print_doc_from_schema(out: &mut String, schema: &Schema, print_level: u8) { - if let Some(description) = &schema.schema_data.description { - print_doc_comment(out, description, print_level); - } -} - -pub fn print_doc_comment(out: &mut String, description: &str, depth: u8) { - if description.trim().is_empty() { - return; - } - - let doc = format_doc_comment(description); - let mut doc_parts = doc.splitn(2, ". "); - let head = doc_parts.next().unwrap().trim(); - for (i, line) in head.split('\n').enumerate() { - if i > 0 { - out.push('\n'); - } - print_indent(out, depth); - if !line.is_empty() { - out.push_str("/// "); - out.push_str(line); - } else { - out.push_str("///"); - } - } - if !head.ends_with('.') { - out.push('.'); - } - out.push('\n'); - if let Some(tail) = doc_parts.next() { - print_indent(out, depth); - out.push_str("///\n"); - for part in tail.split(". ") { - print_indent(out, depth); - out.push_str("/// "); - out.push_str(part.replace('\n', " ").trim()); - if !part.ends_with('.') { - out.push('.'); - } - out.push('\n'); - } - } -} - -fn print_indent(out: &mut String, depth: u8) { - for _ in 0..depth { - out.push_str(" "); - } -} - -fn format_doc_comment(doc: &str) -> String { - lazy_static! { - static ref P_TAG: Regex = Regex::new("

|

").unwrap(); - static ref BR_TAG: Regex = Regex::new("
").unwrap(); - static ref A_DOC_TAG: Regex = Regex::new("([^<]+)").unwrap(); - static ref A_HASH_TAG: Regex = Regex::new("([^<]+)").unwrap(); - static ref A_HTTP_TAG: Regex = - Regex::new("([^<]+)").unwrap(); - static ref CODE_TAG: Regex = Regex::new("|").unwrap(); - static ref EM_TAG: Regex = Regex::new("|||").unwrap(); - static ref STRONG_TAG: Regex = Regex::new("|||").unwrap(); - static ref AMOUNT_OPEN_TAG: Regex = Regex::new("").unwrap(); - static ref AMOUNT_CLOSE_TAG: Regex = Regex::new("").unwrap(); - static ref CURRENCY_OPEN_TAG: Regex = Regex::new("").unwrap(); - static ref CURRENCY_CLOSE_TAG: Regex = Regex::new("").unwrap(); - static ref HYPERLINK: Regex = Regex::new(r#"([^\(])(https?://(www\.)?[-a-zA-Z0-9@:%._\+~#=]{1,256}\.[a-zA-Z0-9()]{1,6}\b([-a-zA-Z0-9()@:%_\+.~#?&//=]*))([^\)])"#).unwrap(); - } - let doc = P_TAG.replace_all(doc, ""); - let doc = BR_TAG.replace_all(&doc, "\n"); - let doc = A_DOC_TAG.replace_all(&doc, "[${2}](https://stripe.com/docs/${1})"); - let doc = A_HASH_TAG.replace_all(&doc, "[${2}](https://stripe.com/docs/api#${1})"); - let doc = A_HTTP_TAG.replace_all(&doc, "[$2]($1)"); - let doc = CODE_TAG.replace_all(&doc, "`"); - let doc = EM_TAG.replace_all(&doc, "_"); - let doc = STRONG_TAG.replace_all(&doc, "**"); - let doc = AMOUNT_OPEN_TAG.replace_all(&doc, ""); - let doc = AMOUNT_CLOSE_TAG.replace_all(&doc, "00"); // add cents to get correct "integer" argument - let doc = CURRENCY_OPEN_TAG.replace_all(&doc, "$"); // add locale formatting (we can only support one easily in our rust docs...) - let doc = CURRENCY_CLOSE_TAG.replace_all(&doc, ""); - let doc = HYPERLINK.replace_all(&doc, "$1<$2>$5"); // replace all hyperlinks that are not already in markdown with rust doc links - doc.trim().into() -} - -pub fn infer_integer_type( - state: &mut FileGenerator, - name: &str, - int_fmt: &VariantOrUnknownOrEmpty, -) -> String { - let is_unix_time_fmt = match int_fmt { - VariantOrUnknownOrEmpty::Unknown(val) => val == "unix-time", - _ => false, - }; - let name_snake = name.to_snake_case(); - let name_words = name_snake.split('_').collect::>(); - if is_unix_time_fmt || name_words.contains(&"date") { - state.use_params.insert("Timestamp"); - "Timestamp".into() - } else if name == "monthly_anchor" { - "u8".into() - } else if name_words.contains(&"days") { - "u32".into() - } else if name_words.contains(&"count") - || name_words.contains(&"size") - || name_words.contains(&"quantity") - { - "u64".into() - } else { - "i64".into() - } -} diff --git a/openapi/src/utils.rs b/openapi/src/utils.rs new file mode 100644 index 000000000..7d5f2cfa1 --- /dev/null +++ b/openapi/src/utils.rs @@ -0,0 +1,50 @@ +use std::fs::{create_dir_all, OpenOptions}; +use std::io::Write; +use std::path::{Path, PathBuf}; + +use anyhow::Context; + +use crate::rust_type::RustType; +use crate::stripe_object::RequestSpec; + +/// Write to a file, starting paths from the `out` directory and ensuring existence +/// of directories along the way. +pub fn write_to_file, P: AsRef>( + content: C, + out_path: P, +) -> anyhow::Result<()> { + let mut opts = OpenOptions::new(); + opts.truncate(true); + write_or_append_to_outfile(content, out_path, opts) +} + +/// Same as `write_to_file`, but appending instead of truncating if the file exists. +pub fn append_to_file, P: AsRef>( + content: C, + out_path: P, +) -> anyhow::Result<()> { + let mut opts = OpenOptions::new(); + opts.append(true); + write_or_append_to_outfile(content, out_path, opts) +} + +fn write_or_append_to_outfile, P: AsRef>( + content: C, + out_path: P, + mut opts: OpenOptions, +) -> anyhow::Result<()> { + let mut base = PathBuf::from("out"); + base.push(out_path); + create_dir_all(base.parent().unwrap()) + .with_context(|| format!("Could not create directories along path {}", base.display()))?; + opts.create(true) + .write(true) + .open(&base) + .with_context(|| format!("Could not create file at {}", base.display()))? + .write_all(content.as_ref())?; + Ok(()) +} + +pub fn get_request_param_field<'a>(req: &'a RequestSpec, field: &str) -> Option<&'a RustType> { + req.params.as_rust_object()?.get_struct_field(field) +} diff --git a/openapi/src/visitor.rs b/openapi/src/visitor.rs new file mode 100644 index 000000000..9d8ca25fb --- /dev/null +++ b/openapi/src/visitor.rs @@ -0,0 +1,63 @@ +use crate::rust_object::{ObjectMetadata, RustObject}; +use crate::rust_type::RustType; +use crate::stripe_object::{RequestSpec, StripeObject}; + +pub trait Visit<'a> { + fn visit_obj(&mut self, obj: &'a RustObject, _meta: Option<&'a ObjectMetadata>) + where + Self: Sized, + { + obj.visit(self); + } + + fn visit_typ(&mut self, typ: &'a RustType) + where + Self: Sized, + { + typ.visit(self); + } + + fn visit_req(&mut self, req: &'a RequestSpec) + where + Self: Sized, + { + req.visit(self); + } + + fn visit_stripe_object(&mut self, obj: &'a StripeObject) + where + Self: Sized, + { + obj.visit(self) + } +} + +pub trait VisitMut { + fn visit_obj_mut(&mut self, obj: &mut RustObject, _meta: Option<&ObjectMetadata>) + where + Self: Sized, + { + obj.visit_mut(self); + } + + fn visit_typ_mut(&mut self, typ: &mut RustType) + where + Self: Sized, + { + typ.visit_mut(self); + } + + fn visit_req_mut(&mut self, req: &mut RequestSpec) + where + Self: Sized, + { + req.visit_mut(self); + } + + fn visit_stripe_object_mut(&mut self, obj: &mut StripeObject) + where + Self: Sized, + { + obj.visit_mut(self) + } +} diff --git a/openapi/src/webhook.rs b/openapi/src/webhook.rs new file mode 100644 index 000000000..de6db1fcb --- /dev/null +++ b/openapi/src/webhook.rs @@ -0,0 +1,144 @@ +use std::fmt::Write; +use std::path::Path; + +use anyhow::{bail, ensure, Context}; +use indoc::writedoc; +use openapiv3::Schema; + +use crate::components::Components; +use crate::crates::Crate; +use crate::printable::PrintableType; +use crate::rust_object::{as_enum_of_objects, ObjectKind, RustObject}; +use crate::rust_type::RustType; +use crate::spec_inference::Inference; +use crate::templates::derives::Derives; +use crate::templates::object_writer::write_derives_line; +use crate::templates::utils::write_doc_comment; +use crate::templates::ObjectWriter; +use crate::types::RustIdent; +use crate::utils::append_to_file; + +pub fn write_generated_for_webhooks(components: &Components) -> anyhow::Result<()> { + let base = Path::new("stripe_webhook"); + write_event_object(components, base)?; + Ok(()) +} + +fn write_event_object(components: &Components, out_path: &Path) -> anyhow::Result<()> { + let mut out = String::new(); + let mut enum_body = String::new(); + let mut match_inner = String::new(); + for webhook_obj in &components.webhook_objs { + let ident = RustIdent::create(&webhook_obj.wire_name); + + let (printable, feature_gate) = if let Some(enum_objs) = + webhook_obj.typ.as_rust_object().and_then(|o| match o { + RustObject::Enum(variants) => as_enum_of_objects(components, variants), + _ => None, + }) { + ObjectWriter::new(components, &ident, ObjectKind::Type) + .write_enum_of_objects(&mut out, &enum_objs); + ( + PrintableType::QualifiedPath { + path: None, + ident: ident.clone(), + has_ref: false, + is_ref: false, + }, + None, + ) + } else { + let path = webhook_obj + .typ + .as_component_path() + .context("expected webhook data type to be enum of objects or component path")?; + let belonging_crate = components.get(path).krate_unwrapped().for_types(); + ( + components.construct_printable_type_from_path(path), + if belonging_crate != Crate::SHARED { Some(belonging_crate.name()) } else { None }, + ) + }; + + let comment = write_doc_comment(&webhook_obj.doc, 1); + let _ = write!(enum_body, "{comment}"); + if let Some(gate) = feature_gate { + let _ = writeln!(enum_body, r#"#[cfg(feature = "{gate}")]"#); + } + let _ = writeln!(enum_body, "{ident}({printable}),"); + + if let Some(gate) = feature_gate { + let _ = writeln!(match_inner, r#"#[cfg(feature = "{gate}")]"#); + } + let wire_name = &webhook_obj.wire_name; + let _ = writeln!( + match_inner, + r#""{wire_name}" => EventObject::{ident}(serde_json::from_value(data)?),"# + ); + } + let _ = writeln!(enum_body, "Unknown(serde_json::Value),"); + + write_derives_line(&mut out, Derives::new()); + let _ = writedoc! {out, r#" + #[non_exhaustive] + /// The event data for a webhook event. + pub enum EventObject {{ + {enum_body} + }} + "#}; + + let _ = writedoc! {out, r#" + impl EventObject {{ + pub(crate) fn from_raw_data(typ: &str, data: serde_json::Value) -> serde_json::Result {{ + Ok(match typ {{ + {match_inner} + _ => EventObject::Unknown(data), + }}) + }} + }} + "#}; + + append_to_file(out, out_path.join("mod.rs"))?; + Ok(()) +} + +#[derive(Debug, Clone, Eq, PartialEq, Hash)] +pub struct WebhookObject { + pub wire_name: String, + pub doc: String, + pub typ: RustType, +} + +impl WebhookObject { + pub fn from_schema(schema: &Schema) -> anyhow::Result> { + let Some(event_info) = schema.schema_data.extensions.get("x-stripeEvent") else { + return Ok(None); + }; + let event_type = + event_info.get("type").context("no type")?.as_str().context("expected string")?; + let desc = schema.schema_data.description.as_ref().context("expected description")?; + + let ident = RustIdent::create(event_type); + let infer_ctx = Inference::new(&ident, ObjectKind::Type); + let typ = infer_ctx.required(true).infer_schema_type(schema); + + Ok(Some(Self { + wire_name: event_type.to_string(), + doc: desc.to_string(), + typ: extract_object_type(typ)?, + })) + } +} + +/// Extract and validate the type of the object field +fn extract_object_type(typ: RustType) -> anyhow::Result { + let (obj, _) = typ.into_object().context("expected object")?; + + let RustObject::Struct(fields) = obj else { + bail!("expected struct"); + }; + ensure!(fields.len() == 1); + + let object_field = + fields.into_iter().find(|f| f.field_name == "object").context("no object field")?; + Ok(object_field.rust_type) +} diff --git a/openapi/test b/openapi/test deleted file mode 100755 index 53ddd9d16771479d8baaf5956fe0a140ac5ddcb6..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 24752 zcmeHPZ)_Y#6`woD`BU=8u}Nx3pqpTo#338s)iO>|)4kYdpCuNT^7B$S3NO(zFsEQmIIM;6tcdsX%E{0l_LI$9psH z-R-V-qo_haq#0@V?fmAwH#2Yk+|JIs`D%J}C?1Om4smfvV9aQ2!urJ~ zVTn(OonkE@Yv8hE3R3mN^mlQUz;r$FwE#uAPJEEm^3k0#CLjkDxP(Yit{E(PRP-_> zG8Jtq8Rc5>k>Y~t$2371FlD|*eg+CdFf2)!UQ#i^)GLR!Ic6$`V}~sH!1Oni-!-Bv zhvq`LDUzEaIi?qgpDEiDtBqGb*|WdJf*8gXRrh8)1?3h=Zjtzz4x$nWOfe4(6K}e? z50l?9l4~=h8qr4fWZI=*!IblR1mw^zcN(~v$0@(4c6g5L$&{kvK(R30*L$Ft+g~h{ zYK!|9`}_9y^_tbPnUqDqa`nK4eQNmVaS=ZwmJwt5n27n}af$(-VEq#ZEl-@}Umo!Fr%hhm6g)1{n<}LSG;+K;DYwt*M z?ndT?cOK5Xu+ox=y_9+Nmb*aUr_4|=wa9tZ>J#f7NnB0ShXXF`#>q*eL1E@%CZhJC5 zuxah*K@rAv&=$}Z&=$}Z&=$}Z&=$}Z&=$}Z&=$}Z`2V&5YzkwzM*h|8%Za|97&a;b z3q?ylZK8M=$$gCC>?bYPhJf*!@Z*$zlKi4^9f^U{|9-1p#`toJg+%#$1KqR6!l?AE zMtYsn@4*O!&nhB5LbQ|UHlj?{(Zf@ukMqU#Ertz>2$sK9SLK-_e%Oqbj;E zD4oRrYlQvE!!jHm7lT0QO$%L_IJfAZ%j!Oyqd-s9@v<0s9 z(Sdh3)fIcdNi_aPFhuPg#&ev~n1=Cif7yN;J=}*rLwzYs&lJg{^8$u2o?Vp2^uzLS zS$Eu~%v{z4<%#{zXTya=&%vZ<*wG+e1{NNJvUO{vRw@-rv&L*T8*D6LNX90wQ!16G z3#A}$Pk-W|;PJnfShvx^##ih4NA%F!sZR?D$f^Od!_=lwin8UlAEspPe9k&cEGlx zFa}wMU8-)Cyi+X9mJrtMsoN9gLOniH`}Fwq&&_(iZOohd^n9y-KjEEG|9*Dhn7|<4 zC-nP}vV;Ep9M->|dcC677<#<|)1zL0cI)-0TKDVk3HtjGzc1s_%WrXkUf*pmclQ9qozx zL%3gtN0<$#x_!U@!8XPHq9$+nd=r!bkf~kz6Li&L;B&a2>dYN!TJ^m57zgafQOBj?*SeMuaGI4f7w143BM4)e@6JV0RAH2 zF>$ZhX<1SQHWP+x5^opmFQQN({y};K?YlGH0*9`}U{{y@PZ-|~cv$)OM&L=Qr%im< zuvkTdhUu{+e}@SAV~hZfJLr5q9xM5xtu@8p3sEoB9i-g6p-4iu*01Fn^7kd|`Nq6+8l~EkHS}s+~tDA}vsB zkAUACAnq2jb|qgdXTA0H*W0{`3%g_!*>v)pqeSt?nKEbg2ZOitFt` zex886{E1S5-)?rUsEp>gc|150jkr+AtD-c!Q4|}FEEtT_dGJ$$0h!BJ;He58JGMIy zUPk3oz6z&O=F0YLu{`Y*?VMY#RBflWD6-}Gg<{^#=ggjP4toX~+jc4yX9>#fR+fZv z3Ch*x=a)dl6SJ{f_*n6bOy~wsG#txiU>_P!9ZB2iql30B?7>qLNH4{977V;Gr=C1}cT`Ry*s|A=NC6qcmvR}?2$UcXTVrFis1X(ERR)mQu zU(Q#m=qKil*pLQ8&_MxV%EFm$ei5cEY)nWiOG}ygIcmPS97u3XNvL*I68sG6ocRJw z?z1>!!_8bM!h=!<_7Ns@r+Mflsx-1frsKMm!gS4rF8Ch`_luy!?SsoJ&*ud5`N3TtUVMa~RbLo^m{*?H z4VU1341*!>&0A3Z1SH)ApII*dGL?Us{eGuNp3BXY`IvqM?5B7!TNs((y>mQ-gqyPPOC!j`xL2J)&AcP$n$%fLGqrX z$fXK`S)KS%K%U=EyT}o<;V()ORIP^mvn0>;=l4%xD3)M;Tz^*Z^ME|Rm$#987c&wK z=Kp*^zTdDUXTKqd$SKme2lIagQsAvw_CaLgbqb$v9pvXY)8B#&`r}e}Z>)<>(s|>| zhq^Ivoar9`!?tI6Ua#7-_VP4*F3nHkC%g^hJop&hT0t!(lu{Tt+JT*fD=lq#& zga@?k8R9UeEcrA_3SXlMkpE{9R-Z=SCml$PBP!BK0~^P25-zqI+jRqATz4g*?)~U& g4Pgr}%v4m?l^!L*VHzesd{S}A??xU0t~W#f23|M!wEzGB diff --git a/out.diff b/out.diff deleted file mode 100644 index 090081d23..000000000 --- a/out.diff +++ /dev/null @@ -1,32200 +0,0 @@ -72,81c72 -< "anyOf": [ -< { -< "$ref": "#/components/schemas/bank_account" -< }, -< { -< "$ref": "#/components/schemas/card" -< } -< ], -< "title": "Polymorphic", -< "x-stripeBypassValidation": true ---- -> "$ref": "#/components/schemas/external_account" -187c178,269 -< "x-resourceId": "account" ---- -> "x-resourceId": "account", -> "x-stripeOperations": [ -> { -> "method_name": "retrieve", -> "method_on": "service", -> "method_type": "retrieve", -> "operation": "get", -> "path": "/v1/account" -> }, -> { -> "method_name": "retrieve", -> "method_on": "service", -> "method_type": "retrieve", -> "operation": "get", -> "path": "/v1/accounts/{account}" -> }, -> { -> "method_name": "update", -> "method_on": "service", -> "method_type": "update", -> "operation": "post", -> "path": "/v1/accounts/{account}" -> }, -> { -> "method_name": "list", -> "method_on": "service", -> "method_type": "list", -> "operation": "get", -> "path": "/v1/accounts" -> }, -> { -> "method_name": "create", -> "method_on": "service", -> "method_type": "create", -> "operation": "post", -> "path": "/v1/accounts" -> }, -> { -> "method_name": "delete", -> "method_on": "service", -> "method_type": "delete", -> "operation": "delete", -> "path": "/v1/accounts/{account}" -> }, -> { -> "method_name": "reject", -> "method_on": "service", -> "method_type": "custom", -> "operation": "post", -> "path": "/v1/accounts/{account}/reject" -> }, -> { -> "method_name": "persons", -> "method_on": "service", -> "method_type": "custom", -> "operation": "get", -> "path": "/v1/accounts/{account}/persons" -> }, -> { -> "method_name": "capabilities", -> "method_on": "service", -> "method_type": "custom", -> "operation": "get", -> "path": "/v1/accounts/{account}/capabilities" -> } -> ], -> "x-stripeResource": { -> "class_name": "Account", -> "has_collection_class": true, -> "in_package": "", -> "inner_classes": [ -> "account_branding_settings", -> "account_business_profile", -> "account_capabilities", -> "account_card_payments_settings", -> "account_dashboard_settings", -> "account_decline_charge_on", -> "account_future_requirements", -> "account_payments_settings", -> "account_payout_settings", -> "account_requirements", -> "account_settings", -> "account_tos_acceptance", -> "account_unification_account_controller", -> "legal_entity_company", -> "transfer_schedule" -> ], -> "polymorphic_groups": [ -> "deleted_payment_source", -> "payment_source" -> ] -> } -200c282,286 -< "x-expandableFields": [] ---- -> "x-expandableFields": [], -> "x-stripeResource": { -> "class_name": "BacsDebitPayments", -> "in_class": "account_settings" -> } -257a344,349 -> "required": [ -> "icon", -> "logo", -> "primary_color", -> "secondary_color" -> ], -263c355,359 -< ] ---- -> ], -> "x-stripeResource": { -> "class_name": "SettingsBranding", -> "in_class": "account" -> } -319a416,424 -> "required": [ -> "mcc", -> "name", -> "support_address", -> "support_email", -> "support_phone", -> "support_url", -> "url" -> ], -324c429,433 -< ] ---- -> ], -> "x-stripeResource": { -> "class_name": "BusinessProfile", -> "in_class": "account" -> } -629c738,742 -< "x-expandableFields": [] ---- -> "x-expandableFields": [], -> "x-stripeResource": { -> "class_name": "Capabilities", -> "in_class": "account" -> } -694a808,809 -> "alternatives", -> "current_deadline", -695a811 -> "disabled_reason", -706c822,826 -< ] ---- -> ], -> "x-stripeResource": { -> "class_name": "FutureRequirements", -> "in_class": "capability" -> } -771a892,893 -> "alternatives", -> "current_deadline", -772a895 -> "disabled_reason", -783c906,910 -< ] ---- -> ], -> "x-stripeResource": { -> "class_name": "Requirements", -> "in_class": "capability" -> } -796c923,930 -< ] ---- -> ], -> "x-stripeResource": { -> "class_name": "SettingsCardIssuing", -> "in_class": "account_settings", -> "inner_classes": [ -> "card_issuing_account_terms_of_service" -> ] -> } -822a957,961 -> "required": [ -> "statement_descriptor_prefix", -> "statement_descriptor_prefix_kana", -> "statement_descriptor_prefix_kanji" -> ], -827c966,970 -< ] ---- -> ], -> "x-stripeResource": { -> "class_name": "SettingsCardPayments", -> "in_class": "account" -> } -844a988,991 -> "required": [ -> "display_name", -> "timezone" -> ], -847c994,998 -< "x-expandableFields": [] ---- -> "x-expandableFields": [], -> "x-stripeResource": { -> "class_name": "SettingsDashboard", -> "in_class": "account" -> } -867c1018,1022 -< "x-expandableFields": [] ---- -> "x-expandableFields": [], -> "x-stripeResource": { -> "class_name": "DeclineChargeOn", -> "in_class": "account" -> } -936a1092,1101 -> "required": [ -> "alternatives", -> "current_deadline", -> "currently_due", -> "disabled_reason", -> "errors", -> "eventually_due", -> "past_due", -> "pending_verification" -> ], -942c1107,1111 -< ] ---- -> ], -> "x-stripeResource": { -> "class_name": "FutureRequirements", -> "in_class": "account" -> } -979c1148,1161 -< "x-resourceId": "account_link" ---- -> "x-resourceId": "account_link", -> "x-stripeOperations": [ -> { -> "method_name": "create", -> "method_on": "service", -> "method_type": "create", -> "operation": "post", -> "path": "/v1/account_links" -> } -> ], -> "x-stripeResource": { -> "class_name": "AccountLink", -> "in_package": "" -> } -1014a1197,1203 -> "required": [ -> "statement_descriptor", -> "statement_descriptor_kana", -> "statement_descriptor_kanji", -> "statement_descriptor_prefix_kana", -> "statement_descriptor_prefix_kanji" -> ], -1017c1206,1210 -< "x-expandableFields": [] ---- -> "x-expandableFields": [], -> "x-stripeResource": { -> "class_name": "SettingsPayments", -> "in_class": "account" -> } -1038c1231,1232 -< "schedule" ---- -> "schedule", -> "statement_descriptor" -1044c1238,1242 -< ] ---- -> ], -> "x-stripeResource": { -> "class_name": "SettingsPayouts", -> "in_class": "account" -> } -1113a1312,1321 -> "required": [ -> "alternatives", -> "current_deadline", -> "currently_due", -> "disabled_reason", -> "errors", -> "eventually_due", -> "past_due", -> "pending_verification" -> ], -1119c1327,1335 -< ] ---- -> ], -> "x-stripeResource": { -> "class_name": "Requirements", -> "in_class": "account", -> "inner_classes": [ -> "account_requirements_alternative", -> "account_requirements_error" -> ] -> } -1147c1363,1367 -< "x-expandableFields": [] ---- -> "x-expandableFields": [], -> "x-stripeResource": { -> "class_name": "Alternative", -> "in_class": "account_requirements" -> } -1226c1446,1450 -< "x-expandableFields": [] ---- -> "x-expandableFields": [], -> "x-stripeResource": { -> "class_name": "Errors", -> "in_class": "account_requirements" -> } -1239c1463,1467 -< "x-expandableFields": [] ---- -> "x-expandableFields": [], -> "x-stripeResource": { -> "class_name": "SepaDebitPayments", -> "in_class": "account_settings" -> } -1290c1518,1528 -< ] ---- -> ], -> "x-stripeResource": { -> "class_name": "Settings", -> "in_class": "account", -> "inner_classes": [ -> "account_bacs_debit_payments_settings", -> "account_card_issuing_settings", -> "account_sepa_debit_payments_settings", -> "account_treasury_settings" -> ] -> } -1311a1550,1553 -> "required": [ -> "date", -> "ip" -> ], -1314c1556,1560 -< "x-expandableFields": [] ---- -> "x-expandableFields": [], -> "x-stripeResource": { -> "class_name": "TosAcceptance", -> "in_class": "account_treasury_settings" -> } -1345c1591,1595 -< "x-expandableFields": [] ---- -> "x-expandableFields": [], -> "x-stripeResource": { -> "class_name": "TosAcceptance", -> "in_class": "account" -> } -1358c1608,1615 -< ] ---- -> ], -> "x-stripeResource": { -> "class_name": "SettingsTreasury", -> "in_class": "account_settings", -> "inner_classes": [ -> "account_terms_of_service" -> ] -> } -1381c1638,1642 -< "x-expandableFields": [] ---- -> "x-expandableFields": [], -> "x-stripeResource": { -> "class_name": "Controller", -> "in_class": "account" -> } -1422a1684,1691 -> "required": [ -> "city", -> "country", -> "line1", -> "line2", -> "postal_code", -> "state" -> ], -1425c1694,1720 -< "x-expandableFields": [] ---- -> "x-expandableFields": [], -> "x-stripeResource": { -> "class_name": "Address", -> "in_package": "" -> } -> }, -> "alternate_statement_descriptors": { -> "description": "", -> "properties": { -> "kana": { -> "description": "The Kana variation of the descriptor.", -> "maxLength": 5000, -> "type": "string" -> }, -> "kanji": { -> "description": "The Kanji variation of the descriptor.", -> "maxLength": 5000, -> "type": "string" -> } -> }, -> "title": "AlternateStatementDescriptors", -> "type": "object", -> "x-expandableFields": [], -> "x-stripeResource": { -> "class_name": "AlternateStatementDescriptors", -> "in_class": "charge" -> } -1480,1491c1775 -< "anyOf": [ -< { -< "$ref": "#/components/schemas/bank_account" -< }, -< { -< "$ref": "#/components/schemas/card" -< }, -< { -< "$ref": "#/components/schemas/source" -< } -< ], -< "description": "The source object for errors returned on a request involving a source." ---- -> "$ref": "#/components/schemas/payment_source" -1514c1798,1802 -< ] ---- -> ], -> "x-stripeResource": { -> "class_name": "StripeError", -> "in_package": "" -> } -1555c1843,1878 -< "x-resourceId": "apple_pay_domain" ---- -> "x-resourceId": "apple_pay_domain", -> "x-stripeOperations": [ -> { -> "method_name": "list", -> "method_on": "service", -> "method_type": "list", -> "operation": "get", -> "path": "/v1/apple_pay/domains" -> }, -> { -> "method_name": "create", -> "method_on": "service", -> "method_type": "create", -> "operation": "post", -> "path": "/v1/apple_pay/domains" -> }, -> { -> "method_name": "retrieve", -> "method_on": "service", -> "method_type": "retrieve", -> "operation": "get", -> "path": "/v1/apple_pay/domains/{domain}" -> }, -> { -> "method_name": "delete", -> "method_on": "service", -> "method_type": "delete", -> "operation": "delete", -> "path": "/v1/apple_pay/domains/{domain}" -> } -> ], -> "x-stripeResource": { -> "class_name": "ApplePayDomain", -> "has_collection_class": true, -> "in_package": "" -> } -1580a1904 -> "name", -1585c1909,1913 -< "x-expandableFields": [] ---- -> "x-expandableFields": [], -> "x-stripeResource": { -> "class_name": "Application", -> "in_package": "" -> } -1768a2097 -> "balance_transaction", -1774a2104 -> "originating_transaction", -1788c2118,2142 -< "x-resourceId": "application_fee" ---- -> "x-resourceId": "application_fee", -> "x-stripeOperations": [ -> { -> "method_name": "list", -> "method_on": "service", -> "method_type": "list", -> "operation": "get", -> "path": "/v1/application_fees" -> }, -> { -> "method_name": "retrieve", -> "method_on": "service", -> "method_type": "retrieve", -> "operation": "get", -> "path": "/v1/application_fees/{id}" -> } -> ], -> "x-stripeResource": { -> "class_name": "ApplicationFee", -> "has_collection_class": true, -> "in_package": "", -> "polymorphic_groups": [ -> "balance_transaction_source" -> ] -> } -1840a2195 -> "expires_at", -1844a2200 -> "payload", -1852c2208,2246 -< "x-resourceId": "apps.secret" ---- -> "x-resourceId": "apps.secret", -> "x-stripeOperations": [ -> { -> "method_name": "find", -> "method_on": "service", -> "method_type": "custom", -> "operation": "get", -> "path": "/v1/apps/secrets/find" -> }, -> { -> "method_name": "create", -> "method_on": "service", -> "method_type": "create", -> "operation": "post", -> "path": "/v1/apps/secrets" -> }, -> { -> "method_name": "delete_where", -> "method_on": "service", -> "method_type": "custom", -> "operation": "post", -> "path": "/v1/apps/secrets/delete" -> }, -> { -> "method_name": "list", -> "method_on": "service", -> "method_type": "list", -> "operation": "get", -> "path": "/v1/apps/secrets" -> } -> ], -> "x-stripeResource": { -> "class_name": "Secret", -> "has_collection_class": true, -> "in_package": "Apps", -> "inner_classes": [ -> "secret_service_resource_scope" -> ] -> } -1873c2267,2268 -< "enabled" ---- -> "enabled", -> "status" -1877c2272,2276 -< "x-expandableFields": [] ---- -> "x-expandableFields": [], -> "x-stripeResource": { -> "class_name": "AutomaticTax", -> "in_class": "invoice" -> } -1940c2339,2356 -< "x-resourceId": "balance" ---- -> "x-resourceId": "balance", -> "x-stripeOperations": [ -> { -> "method_name": "retrieve", -> "method_on": "service", -> "method_type": "retrieve", -> "operation": "get", -> "path": "/v1/balance" -> } -> ], -> "x-stripeResource": { -> "class_name": "Balance", -> "in_package": "", -> "inner_classes": [ -> "balance_amount", -> "balance_detail" -> ] -> } -1965c2381,2388 -< ] ---- -> ], -> "x-stripeResource": { -> "class_name": "Money", -> "in_class": "balance", -> "inner_classes": [ -> "balance_amount_by_source_type" -> ] -> } -1985c2408,2412 -< "x-expandableFields": [] ---- -> "x-expandableFields": [], -> "x-stripeResource": { -> "class_name": "SourceTypes", -> "in_class": "balance_amount" -> } -2005c2432,2436 -< ] ---- -> ], -> "x-stripeResource": { -> "class_name": "Details", -> "in_class": "balance" -> } -2078,2123c2509 -< "$ref": "#/components/schemas/application_fee" -< }, -< { -< "$ref": "#/components/schemas/charge" -< }, -< { -< "$ref": "#/components/schemas/connect_collection_transfer" -< }, -< { -< "$ref": "#/components/schemas/dispute" -< }, -< { -< "$ref": "#/components/schemas/fee_refund" -< }, -< { -< "$ref": "#/components/schemas/issuing.authorization" -< }, -< { -< "$ref": "#/components/schemas/issuing.dispute" -< }, -< { -< "$ref": "#/components/schemas/issuing.transaction" -< }, -< { -< "$ref": "#/components/schemas/payout" -< }, -< { -< "$ref": "#/components/schemas/platform_tax_fee" -< }, -< { -< "$ref": "#/components/schemas/refund" -< }, -< { -< "$ref": "#/components/schemas/reserve_transaction" -< }, -< { -< "$ref": "#/components/schemas/tax_deducted_at_source" -< }, -< { -< "$ref": "#/components/schemas/topup" -< }, -< { -< "$ref": "#/components/schemas/transfer" -< }, -< { -< "$ref": "#/components/schemas/transfer_reversal" ---- -> "$ref": "#/components/schemas/balance_transaction_source" -2131,2176c2517 -< "$ref": "#/components/schemas/application_fee" -< }, -< { -< "$ref": "#/components/schemas/charge" -< }, -< { -< "$ref": "#/components/schemas/connect_collection_transfer" -< }, -< { -< "$ref": "#/components/schemas/dispute" -< }, -< { -< "$ref": "#/components/schemas/fee_refund" -< }, -< { -< "$ref": "#/components/schemas/issuing.authorization" -< }, -< { -< "$ref": "#/components/schemas/issuing.dispute" -< }, -< { -< "$ref": "#/components/schemas/issuing.transaction" -< }, -< { -< "$ref": "#/components/schemas/payout" -< }, -< { -< "$ref": "#/components/schemas/platform_tax_fee" -< }, -< { -< "$ref": "#/components/schemas/refund" -< }, -< { -< "$ref": "#/components/schemas/reserve_transaction" -< }, -< { -< "$ref": "#/components/schemas/tax_deducted_at_source" -< }, -< { -< "$ref": "#/components/schemas/topup" -< }, -< { -< "$ref": "#/components/schemas/transfer" -< }, -< { -< "$ref": "#/components/schemas/transfer_reversal" ---- -> "$ref": "#/components/schemas/balance_transaction_source" -2179,2180c2520 -< }, -< "x-stripeBypassValidation": true ---- -> } -2230a2571,2572 -> "description", -> "exchange_rate", -2236a2579 -> "source", -2246c2589,2670 -< "x-resourceId": "balance_transaction" ---- -> "x-resourceId": "balance_transaction", -> "x-stripeOperations": [ -> { -> "method_name": "list", -> "method_on": "service", -> "method_type": "list", -> "operation": "get", -> "path": "/v1/balance_transactions" -> }, -> { -> "method_name": "retrieve", -> "method_on": "service", -> "method_type": "retrieve", -> "operation": "get", -> "path": "/v1/balance_transactions/{id}" -> } -> ], -> "x-stripeResource": { -> "class_name": "BalanceTransaction", -> "has_collection_class": true, -> "in_package": "", -> "inner_classes": [ -> "fee" -> ] -> } -> }, -> "balance_transaction_source": { -> "anyOf": [ -> { -> "$ref": "#/components/schemas/application_fee" -> }, -> { -> "$ref": "#/components/schemas/charge" -> }, -> { -> "$ref": "#/components/schemas/connect_collection_transfer" -> }, -> { -> "$ref": "#/components/schemas/dispute" -> }, -> { -> "$ref": "#/components/schemas/fee_refund" -> }, -> { -> "$ref": "#/components/schemas/issuing.authorization" -> }, -> { -> "$ref": "#/components/schemas/issuing.dispute" -> }, -> { -> "$ref": "#/components/schemas/issuing.transaction" -> }, -> { -> "$ref": "#/components/schemas/payout" -> }, -> { -> "$ref": "#/components/schemas/platform_tax_fee" -> }, -> { -> "$ref": "#/components/schemas/refund" -> }, -> { -> "$ref": "#/components/schemas/reserve_transaction" -> }, -> { -> "$ref": "#/components/schemas/tax_deducted_at_source" -> }, -> { -> "$ref": "#/components/schemas/topup" -> }, -> { -> "$ref": "#/components/schemas/transfer" -> }, -> { -> "$ref": "#/components/schemas/transfer_reversal" -> } -> ], -> "title": "Polymorphic", -> "x-stripeBypassValidation": true, -> "x-stripeResource": { -> "class_name": "BalanceTransactionSource" -> } -2391a2816,2819 -> "account_holder_name", -> "account_holder_type", -> "account_type", -> "bank_name", -2393a2822 -> "fingerprint", -2396a2826 -> "routing_number", -2405c2835,2882 -< "x-resourceId": "bank_account" ---- -> "x-resourceId": "bank_account", -> "x-stripeOperations": [ -> { -> "method_name": "update", -> "method_on": "service", -> "method_type": "update", -> "operation": "post", -> "path": "/v1/customers/{customer}/sources/{id}" -> }, -> { -> "method_name": "delete", -> "method_on": "service", -> "method_type": "delete", -> "operation": "delete", -> "path": "/v1/customers/{customer}/sources/{id}" -> }, -> { -> "method_name": "verify", -> "method_on": "service", -> "method_type": "custom", -> "operation": "post", -> "path": "/v1/customers/{customer}/sources/{id}/verify" -> }, -> { -> "method_name": "update", -> "method_on": "service", -> "method_type": "update", -> "operation": "post", -> "path": "/v1/accounts/{account}/external_accounts/{id}" -> }, -> { -> "method_name": "delete", -> "method_on": "service", -> "method_type": "delete", -> "operation": "delete", -> "path": "/v1/accounts/{account}/external_accounts/{id}" -> } -> ], -> "x-stripeResource": { -> "class_name": "BankAccount", -> "in_package": "", -> "polymorphic_groups": [ -> "deleted_external_account", -> "deleted_payment_source", -> "external_account", -> "payment_source" -> ] -> } -2465c2942,2946 -< ] ---- -> ], -> "x-stripeResource": { -> "class_name": "AccountHolder", -> "in_class": "financial_connections.account" -> } -2507c2988,2996 -< ] ---- -> ], -> "x-stripeResource": { -> "class_name": "Balance", -> "in_class": "financial_connections.account", -> "inner_classes": [ -> "bank_connections_resource_balance_api_resource_cash_balance", -> "bank_connections_resource_balance_api_resource_credit_balance" -> ] -> } -2520a3010,3012 -> "required": [ -> "available" -> ], -2523c3015,3019 -< "x-expandableFields": [] ---- -> "x-expandableFields": [], -> "x-stripeResource": { -> "class_name": "CashBalance", -> "in_class": "bank_connections_resource_balance" -> } -2536a3033,3035 -> "required": [ -> "used" -> ], -2539c3038,3042 -< "x-expandableFields": [] ---- -> "x-expandableFields": [], -> "x-stripeResource": { -> "class_name": "CreditBalance", -> "in_class": "bank_connections_resource_balance" -> } -2565c3068,3072 -< "x-expandableFields": [] ---- -> "x-expandableFields": [], -> "x-stripeResource": { -> "class_name": "BalanceRefresh", -> "in_class": "financial_connections.account" -> } -2579a3087,3089 -> "required": [ -> "countries" -> ], -2582c3092,3096 -< "x-expandableFields": [] ---- -> "x-expandableFields": [], -> "x-stripeResource": { -> "class_name": "Filters", -> "in_class": "financial_connections.session" -> } -2608c3122,3126 -< "x-expandableFields": [] ---- -> "x-expandableFields": [], -> "x-stripeResource": { -> "class_name": "OwnershipRefresh", -> "in_class": "financial_connections.account" -> } -2640a3159,3164 -> "required": [ -> "address", -> "email", -> "name", -> "phone" -> ], -2645c3169,3173 -< ] ---- -> ], -> "x-stripeResource": { -> "class_name": "BillingDetails", -> "in_class": "payment_method" -> } -2736a3265 -> "application", -2738a3268 -> "default_return_url", -2743a3274 -> "metadata", -2755c3286,3326 -< "x-resourceId": "billing_portal.configuration" ---- -> "x-resourceId": "billing_portal.configuration", -> "x-stripeOperations": [ -> { -> "method_name": "list", -> "method_on": "service", -> "method_type": "list", -> "operation": "get", -> "path": "/v1/billing_portal/configurations" -> }, -> { -> "method_name": "create", -> "method_on": "service", -> "method_type": "create", -> "operation": "post", -> "path": "/v1/billing_portal/configurations" -> }, -> { -> "method_name": "update", -> "method_on": "service", -> "method_type": "update", -> "operation": "post", -> "path": "/v1/billing_portal/configurations/{configuration}" -> }, -> { -> "method_name": "retrieve", -> "method_on": "service", -> "method_type": "retrieve", -> "operation": "get", -> "path": "/v1/billing_portal/configurations/{configuration}" -> } -> ], -> "x-stripeResource": { -> "class_name": "Configuration", -> "has_collection_class": true, -> "in_package": "BillingPortal", -> "inner_classes": [ -> "portal_business_profile", -> "portal_features", -> "portal_login_page" -> ] -> } -2882a3454 -> "locale", -2883a3456,3457 -> "on_behalf_of", -> "return_url", -2891c3465,3478 -< "x-resourceId": "billing_portal.session" ---- -> "x-resourceId": "billing_portal.session", -> "x-stripeOperations": [ -> { -> "method_name": "create", -> "method_on": "service", -> "method_type": "create", -> "operation": "post", -> "path": "/v1/billing_portal/sessions" -> } -> ], -> "x-stripeResource": { -> "class_name": "Session", -> "in_package": "BillingPortal" -> } -2959a3547 -> "requested_at", -2969c3557,3603 -< "x-resourceId": "capability" ---- -> "x-resourceId": "capability", -> "x-stripeOperations": [ -> { -> "method_name": "list", -> "method_on": "collection", -> "method_type": "list", -> "operation": "get", -> "path": "/v1/accounts/{account}/capabilities" -> }, -> { -> "method_name": "list", -> "method_on": "service", -> "method_type": "list", -> "operation": "get", -> "path": "/v1/accounts/{account}/capabilities" -> }, -> { -> "method_name": "retrieve", -> "method_on": "collection", -> "method_type": "retrieve", -> "operation": "get", -> "path": "/v1/accounts/{account}/capabilities/{capability}" -> }, -> { -> "method_name": "retrieve", -> "method_on": "service", -> "method_type": "retrieve", -> "operation": "get", -> "path": "/v1/accounts/{account}/capabilities/{capability}" -> }, -> { -> "method_name": "update", -> "method_on": "service", -> "method_type": "update", -> "operation": "post", -> "path": "/v1/accounts/{account}/capabilities/{capability}" -> } -> ], -> "x-stripeResource": { -> "class_name": "Capability", -> "has_collection_class": true, -> "in_package": "", -> "inner_classes": [ -> "account_capability_future_requirements", -> "account_capability_requirements" -> ] -> } -3106a3741,3745 -> "description": { -> "description": "A high-level description of the type of cards issued in this range. (For internal use only and not typically available in standard API requests.)", -> "maxLength": 5000, -> "type": "string" -> }, -3136a3776,3785 -> "iin": { -> "description": "Issuer identification number of the card. (For internal use only and not typically available in standard API requests.)", -> "maxLength": 5000, -> "type": "string" -> }, -> "issuer": { -> "description": "The name of the card's issuing bank. (For internal use only and not typically available in standard API requests.)", -> "maxLength": 5000, -> "type": "string" -> }, -3177a3827,3834 -> "address_city", -> "address_country", -> "address_line1", -> "address_line1_check", -> "address_line2", -> "address_state", -> "address_zip", -> "address_zip_check", -3178a3836,3838 -> "country", -> "cvc_check", -> "dynamic_last4", -3184c3844,3847 -< "object" ---- -> "metadata", -> "name", -> "object", -> "tokenization_method" -3192,3213c3855,3895 -< "x-resourceId": "card" -< }, -< "card_generated_from_payment_method_details": { -< "description": "", -< "properties": { -< "card_present": { -< "$ref": "#/components/schemas/payment_method_details_card_present" -< }, -< "type": { -< "description": "The type of payment method transaction-specific details from the transaction that generated this `card` payment method. Always `card_present`.", -< "maxLength": 5000, -< "type": "string" -< } -< }, -< "required": [ -< "type" -< ], -< "title": "card_generated_from_payment_method_details", -< "type": "object", -< "x-expandableFields": [ -< "card_present" -< ] ---- -> "x-resourceId": "card", -> "x-stripeOperations": [ -> { -> "method_name": "update", -> "method_on": "service", -> "method_type": "update", -> "operation": "post", -> "path": "/v1/customers/{customer}/sources/{id}" -> }, -> { -> "method_name": "delete", -> "method_on": "service", -> "method_type": "delete", -> "operation": "delete", -> "path": "/v1/customers/{customer}/sources/{id}" -> }, -> { -> "method_name": "update", -> "method_on": "service", -> "method_type": "update", -> "operation": "post", -> "path": "/v1/accounts/{account}/external_accounts/{id}" -> }, -> { -> "method_name": "delete", -> "method_on": "service", -> "method_type": "delete", -> "operation": "delete", -> "path": "/v1/accounts/{account}/external_accounts/{id}" -> } -> ], -> "x-stripeResource": { -> "class_name": "Card", -> "in_package": "", -> "polymorphic_groups": [ -> "deleted_external_account", -> "deleted_payment_source", -> "external_account", -> "payment_source" -> ] -> } -3234a3917,3920 -> "required": [ -> "date", -> "ip" -> ], -3237c3923,3927 -< "x-expandableFields": [] ---- -> "x-expandableFields": [], -> "x-stripeResource": { -> "class_name": "TosAcceptance", -> "in_class": "account_card_issuing_settings" -> } -3244c3934,3938 -< "x-expandableFields": [] ---- -> "x-expandableFields": [], -> "x-stripeResource": { -> "class_name": "Card", -> "in_class": "mandate_payment_method_details" -> } -3277a3972 -> "available", -3288c3983,4006 -< "x-resourceId": "cash_balance" ---- -> "x-resourceId": "cash_balance", -> "x-stripeOperations": [ -> { -> "method_name": "retrieve", -> "method_on": "service", -> "method_type": "retrieve", -> "operation": "get", -> "path": "/v1/customers/{customer}/cash_balance" -> }, -> { -> "method_name": "update", -> "method_on": "service", -> "method_type": "update", -> "operation": "post", -> "path": "/v1/customers/{customer}/cash_balance" -> } -> ], -> "x-stripeResource": { -> "class_name": "CashBalance", -> "in_package": "", -> "inner_classes": [ -> "customer_balance_customer_balance_settings" -> ] -> } -3292a4011,4013 -> "alternate_statement_descriptors": { -> "$ref": "#/components/schemas/alternate_statement_descriptors" -> }, -3349a4071,4075 -> "authorization_code": { -> "description": "Authorization code on the charge.", -> "maxLength": 5000, -> "type": "string" -> }, -3423a4150,4189 -> "destination": { -> "anyOf": [ -> { -> "maxLength": 5000, -> "type": "string" -> }, -> { -> "$ref": "#/components/schemas/account" -> } -> ], -> "description": "ID of an existing, connected Stripe account to transfer funds to if `transfer_data` was specified in the charge request.", -> "nullable": true, -> "x-expansionResources": { -> "oneOf": [ -> { -> "$ref": "#/components/schemas/account" -> } -> ] -> } -> }, -> "dispute": { -> "anyOf": [ -> { -> "maxLength": 5000, -> "type": "string" -> }, -> { -> "$ref": "#/components/schemas/dispute" -> } -> ], -> "description": "Details about the dispute if the charge has been disputed.", -> "nullable": true, -> "x-expansionResources": { -> "oneOf": [ -> { -> "$ref": "#/components/schemas/dispute" -> } -> ] -> } -> }, -3493a4260,4262 -> "level3": { -> "$ref": "#/components/schemas/level3" -> }, -3673a4443,4451 -> "source": { -> "anyOf": [ -> { -> "$ref": "#/components/schemas/payment_source" -> } -> ], -> "description": "This is a legacy field that will be removed in the future. It contains the Source, Card, or BankAccount object used for the charge. For details about the payment method used for this charge, refer to `payment_method` or `payment_method_details` instead.", -> "nullable": true -> }, -3753a4532,4535 -> "application", -> "application_fee", -> "application_fee_amount", -> "balance_transaction", -3754a4537 -> "calculated_statement_descriptor", -3757a4541,4544 -> "customer", -> "description", -> "destination", -> "dispute", -3758a4546,4549 -> "failure_balance_transaction", -> "failure_code", -> "failure_message", -> "fraud_details", -3759a4551 -> "invoice", -3762a4555,4556 -> "on_behalf_of", -> "outcome", -3763a4558,4563 -> "payment_intent", -> "payment_method", -> "payment_method_details", -> "receipt_email", -> "receipt_number", -> "receipt_url", -3765c4565,4573 -< "status" ---- -> "review", -> "shipping", -> "source", -> "source_transfer", -> "statement_descriptor", -> "statement_descriptor_suffix", -> "status", -> "transfer_data", -> "transfer_group" -3769a4578 -> "alternate_statement_descriptors", -3774a4584,4585 -> "destination", -> "dispute", -3777a4589 -> "level3", -3785a4598 -> "source", -3790c4603,4665 -< "x-resourceId": "charge" ---- -> "x-resourceId": "charge", -> "x-stripeOperations": [ -> { -> "method_name": "search", -> "method_on": "service", -> "method_type": "custom", -> "operation": "get", -> "path": "/v1/charges/search" -> }, -> { -> "method_name": "list", -> "method_on": "service", -> "method_type": "list", -> "operation": "get", -> "path": "/v1/charges" -> }, -> { -> "method_name": "create", -> "method_on": "service", -> "method_type": "create", -> "operation": "post", -> "path": "/v1/charges" -> }, -> { -> "method_name": "retrieve", -> "method_on": "service", -> "method_type": "retrieve", -> "operation": "get", -> "path": "/v1/charges/{charge}" -> }, -> { -> "method_name": "update", -> "method_on": "service", -> "method_type": "update", -> "operation": "post", -> "path": "/v1/charges/{charge}" -> }, -> { -> "method_name": "capture", -> "method_on": "service", -> "method_type": "custom", -> "operation": "post", -> "path": "/v1/charges/{charge}/capture" -> } -> ], -> "x-stripeResource": { -> "class_name": "Charge", -> "has_collection_class": true, -> "has_search_result_class": true, -> "in_package": "", -> "inner_classes": [ -> "alternate_statement_descriptors", -> "charge_fraud_details", -> "charge_outcome", -> "charge_transfer_data", -> "level3", -> "payment_method_details", -> "radar_radar_options" -> ], -> "polymorphic_groups": [ -> "balance_transaction_source" -> ] -> } -3808c4683,4687 -< "x-expandableFields": [] ---- -> "x-expandableFields": [], -> "x-stripeResource": { -> "class_name": "FraudDetails", -> "in_class": "charge" -> } -3865a4745,4747 -> "network_status", -> "reason", -> "seller_message", -3872c4754,4758 -< ] ---- -> ], -> "x-stripeResource": { -> "class_name": "Outcome", -> "in_class": "charge" -> } -3902a4789 -> "amount", -3909c4796,4800 -< ] ---- -> ], -> "x-stripeResource": { -> "class_name": "TransferData", -> "in_class": "charge" -> } -4369a5261,5264 -> "after_expiration", -> "allow_promotion_codes", -> "amount_subtotal", -> "amount_total", -4370a5266 -> "billing_address_collection", -4371a5268,5270 -> "client_reference_id", -> "consent", -> "consent_collection", -4372a5272,5276 -> "currency", -> "customer", -> "customer_creation", -> "customer_details", -> "customer_email", -4375a5280,5281 -> "locale", -> "metadata", -4377a5284,5287 -> "payment_intent", -> "payment_link", -> "payment_method_collection", -> "payment_method_options", -4379a5290,5294 -> "recovered_from", -> "setup_intent", -> "shipping_address_collection", -> "shipping_cost", -> "shipping_details", -4381c5296,5301 -< "success_url" ---- -> "status", -> "submit_type", -> "subscription", -> "success_url", -> "total_details", -> "url" -4406c5326,5382 -< "x-resourceId": "checkout.session" ---- -> "x-resourceId": "checkout.session", -> "x-stripeOperations": [ -> { -> "method_name": "list", -> "method_on": "service", -> "method_type": "list", -> "operation": "get", -> "path": "/v1/checkout/sessions" -> }, -> { -> "method_name": "retrieve", -> "method_on": "service", -> "method_type": "retrieve", -> "operation": "get", -> "path": "/v1/checkout/sessions/{session}" -> }, -> { -> "method_name": "create", -> "method_on": "service", -> "method_type": "create", -> "operation": "post", -> "path": "/v1/checkout/sessions" -> }, -> { -> "method_name": "list_line_items", -> "method_on": "service", -> "method_type": "custom", -> "operation": "get", -> "path": "/v1/checkout/sessions/{session}/line_items" -> }, -> { -> "method_name": "expire", -> "method_on": "service", -> "method_type": "custom", -> "operation": "post", -> "path": "/v1/checkout/sessions/{session}/expire" -> } -> ], -> "x-stripeResource": { -> "class_name": "Session", -> "has_collection_class": true, -> "in_package": "Checkout", -> "inner_classes": [ -> "checkout_session_payment_method_options", -> "payment_pages_checkout_session_after_expiration", -> "payment_pages_checkout_session_automatic_tax", -> "payment_pages_checkout_session_consent", -> "payment_pages_checkout_session_consent_collection", -> "payment_pages_checkout_session_customer_details", -> "payment_pages_checkout_session_phone_number_collection", -> "payment_pages_checkout_session_shipping_address_collection", -> "payment_pages_checkout_session_shipping_cost", -> "payment_pages_checkout_session_shipping_option", -> "payment_pages_checkout_session_tax_id_collection", -> "payment_pages_checkout_session_total_details" -> ] -> } -4452a5429,5433 -> "required": [ -> "interval_description", -> "payment_schedule", -> "transaction_type" -> ], -4455c5436,5440 -< "x-expandableFields": [] ---- -> "x-expandableFields": [], -> "x-stripeResource": { -> "class_name": "MandateOptions", -> "in_class": "checkout_acss_debit_payment_method_options" -> } -4495c5480,5487 -< ] ---- -> ], -> "x-stripeResource": { -> "class_name": "AcssDebit", -> "in_class": "checkout_session_payment_method_options", -> "inner_classes": [ -> "checkout_acss_debit_mandate_options" -> ] -> } -4510c5502,5506 -< "x-expandableFields": [] ---- -> "x-expandableFields": [], -> "x-stripeResource": { -> "class_name": "Affirm", -> "in_class": "checkout_session_payment_method_options" -> } -4525c5521,5525 -< "x-expandableFields": [] ---- -> "x-expandableFields": [], -> "x-stripeResource": { -> "class_name": "AfterpayClearpay", -> "in_class": "checkout_session_payment_method_options" -> } -4540c5540,5544 -< "x-expandableFields": [] ---- -> "x-expandableFields": [], -> "x-stripeResource": { -> "class_name": "Alipay", -> "in_class": "checkout_session_payment_method_options" -> } -4555c5559,5563 -< "x-expandableFields": [] ---- -> "x-expandableFields": [], -> "x-stripeResource": { -> "class_name": "AuBecsDebit", -> "in_class": "checkout_session_payment_method_options" -> } -4572c5580,5584 -< "x-expandableFields": [] ---- -> "x-expandableFields": [], -> "x-stripeResource": { -> "class_name": "BacsDebit", -> "in_class": "checkout_session_payment_method_options" -> } -4587c5599,5603 -< "x-expandableFields": [] ---- -> "x-expandableFields": [], -> "x-stripeResource": { -> "class_name": "Bancontact", -> "in_class": "checkout_session_payment_method_options" -> } -4611c5627,5631 -< "x-expandableFields": [] ---- -> "x-expandableFields": [], -> "x-stripeResource": { -> "class_name": "Boleto", -> "in_class": "checkout_session_payment_method_options" -> } -4623c5643,5647 -< "x-expandableFields": [] ---- -> "x-expandableFields": [], -> "x-stripeResource": { -> "class_name": "Installments", -> "in_class": "checkout_card_payment_method_options" -> } -4655c5679,5686 -< ] ---- -> ], -> "x-stripeResource": { -> "class_name": "Card", -> "in_class": "checkout_session_payment_method_options", -> "inner_classes": [ -> "checkout_card_installments_options" -> ] -> } -4690a5722,5724 -> "required": [ -> "type" -> ], -4695c5729,5733 -< ] ---- -> ], -> "x-stripeResource": { -> "class_name": "BankTransfer", -> "in_class": "checkout_session_payment_method_options" -> } -4718a5757,5759 -> "required": [ -> "funding_type" -> ], -4723c5764,5768 -< ] ---- -> ], -> "x-stripeResource": { -> "class_name": "CustomerBalance", -> "in_class": "checkout_session_payment_method_options" -> } -4738c5783,5787 -< "x-expandableFields": [] ---- -> "x-expandableFields": [], -> "x-stripeResource": { -> "class_name": "Eps", -> "in_class": "checkout_session_payment_method_options" -> } -4753c5802,5806 -< "x-expandableFields": [] ---- -> "x-expandableFields": [], -> "x-stripeResource": { -> "class_name": "Fpx", -> "in_class": "checkout_session_payment_method_options" -> } -4768c5821,5825 -< "x-expandableFields": [] ---- -> "x-expandableFields": [], -> "x-stripeResource": { -> "class_name": "Giropay", -> "in_class": "checkout_session_payment_method_options" -> } -4783c5840,5844 -< "x-expandableFields": [] ---- -> "x-expandableFields": [], -> "x-stripeResource": { -> "class_name": "GrabPay", -> "in_class": "checkout_session_payment_method_options" -> } -4798c5859,5863 -< "x-expandableFields": [] ---- -> "x-expandableFields": [], -> "x-stripeResource": { -> "class_name": "Ideal", -> "in_class": "checkout_session_payment_method_options" -> } -4815c5880,5884 -< "x-expandableFields": [] ---- -> "x-expandableFields": [], -> "x-stripeResource": { -> "class_name": "Klarna", -> "in_class": "checkout_session_payment_method_options" -> } -4832a5902,5904 -> "required": [ -> "expires_after_days" -> ], -4835c5907,5911 -< "x-expandableFields": [] ---- -> "x-expandableFields": [], -> "x-stripeResource": { -> "class_name": "Konbini", -> "in_class": "checkout_session_payment_method_options" -> } -4857c5933,5937 -< "x-expandableFields": [] ---- -> "x-expandableFields": [], -> "x-stripeResource": { -> "class_name": "Oxxo", -> "in_class": "checkout_session_payment_method_options" -> } -4872c5952,5956 -< "x-expandableFields": [] ---- -> "x-expandableFields": [], -> "x-stripeResource": { -> "class_name": "P24", -> "in_class": "checkout_session_payment_method_options" -> } -4887c5971,5975 -< "x-expandableFields": [] ---- -> "x-expandableFields": [], -> "x-stripeResource": { -> "class_name": "Paynow", -> "in_class": "checkout_session_payment_method_options" -> } -4897a5986,5988 -> "required": [ -> "expires_after_seconds" -> ], -4900c5991,5995 -< "x-expandableFields": [] ---- -> "x-expandableFields": [], -> "x-stripeResource": { -> "class_name": "Pix", -> "in_class": "checkout_session_payment_method_options" -> } -4917c6012,6016 -< "x-expandableFields": [] ---- -> "x-expandableFields": [], -> "x-stripeResource": { -> "class_name": "SepaDebit", -> "in_class": "checkout_session_payment_method_options" -> } -5022c6121,6152 -< ] ---- -> ], -> "x-stripeResource": { -> "class_name": "PaymentMethodOptions", -> "in_class": "checkout.session", -> "inner_classes": [ -> "checkout_acss_debit_payment_method_options", -> "checkout_affirm_payment_method_options", -> "checkout_afterpay_clearpay_payment_method_options", -> "checkout_alipay_payment_method_options", -> "checkout_au_becs_debit_payment_method_options", -> "checkout_bacs_debit_payment_method_options", -> "checkout_bancontact_payment_method_options", -> "checkout_boleto_payment_method_options", -> "checkout_card_payment_method_options", -> "checkout_customer_balance_bank_transfer_payment_method_options", -> "checkout_customer_balance_payment_method_options", -> "checkout_eps_payment_method_options", -> "checkout_fpx_payment_method_options", -> "checkout_giropay_payment_method_options", -> "checkout_grab_pay_payment_method_options", -> "checkout_ideal_payment_method_options", -> "checkout_klarna_payment_method_options", -> "checkout_konbini_payment_method_options", -> "checkout_oxxo_payment_method_options", -> "checkout_p24_payment_method_options", -> "checkout_paynow_payment_method_options", -> "checkout_pix_payment_method_options", -> "checkout_sepa_debit_payment_method_options", -> "checkout_sofort_payment_method_options", -> "checkout_us_bank_account_payment_method_options" -> ] -> } -5037c6167,6171 -< "x-expandableFields": [] ---- -> "x-expandableFields": [], -> "x-stripeResource": { -> "class_name": "Sofort", -> "in_class": "checkout_session_payment_method_options" -> } -5068c6202,6206 -< ] ---- -> ], -> "x-stripeResource": { -> "class_name": "UsBankAccount", -> "in_class": "checkout_session_payment_method_options" -> } -5129c6267,6274 -< ] ---- -> ], -> "x-stripeResource": { -> "class_name": "ConnectCollectionTransfer", -> "in_package": "", -> "polymorphic_groups": [ -> "balance_transaction_source" -> ] -> } -5205c6350,6374 -< "x-resourceId": "country_spec" ---- -> "x-resourceId": "country_spec", -> "x-stripeOperations": [ -> { -> "method_name": "list", -> "method_on": "service", -> "method_type": "list", -> "operation": "get", -> "path": "/v1/country_specs" -> }, -> { -> "method_name": "retrieve", -> "method_on": "service", -> "method_type": "retrieve", -> "operation": "get", -> "path": "/v1/country_specs/{country}" -> } -> ], -> "x-stripeResource": { -> "class_name": "CountrySpec", -> "has_collection_class": true, -> "in_package": "", -> "inner_classes": [ -> "country_spec_verification_fields" -> ] -> } -5233c6402,6406 -< "x-expandableFields": [] ---- -> "x-expandableFields": [], -> "x-stripeResource": { -> "class_name": "Details", -> "in_class": "country_spec_verification_fields" -> } -5254c6427,6434 -< ] ---- -> ], -> "x-stripeResource": { -> "class_name": "VerificationFields", -> "in_class": "country_spec", -> "inner_classes": [ -> "country_spec_verification_field_details" -> ] -> } -5355a6536 -> "amount_off", -5356a6538 -> "currency", -5357a6540 -> "duration_in_months", -5359a6543,6545 -> "max_redemptions", -> "metadata", -> "name", -5360a6547,6548 -> "percent_off", -> "redeem_by", -5370c6558,6604 -< "x-resourceId": "coupon" ---- -> "x-resourceId": "coupon", -> "x-stripeOperations": [ -> { -> "method_name": "list", -> "method_on": "service", -> "method_type": "list", -> "operation": "get", -> "path": "/v1/coupons" -> }, -> { -> "method_name": "create", -> "method_on": "service", -> "method_type": "create", -> "operation": "post", -> "path": "/v1/coupons" -> }, -> { -> "method_name": "retrieve", -> "method_on": "service", -> "method_type": "retrieve", -> "operation": "get", -> "path": "/v1/coupons/{coupon}" -> }, -> { -> "method_name": "update", -> "method_on": "service", -> "method_type": "update", -> "operation": "post", -> "path": "/v1/coupons/{coupon}" -> }, -> { -> "method_name": "delete", -> "method_on": "service", -> "method_type": "delete", -> "operation": "delete", -> "path": "/v1/coupons/{coupon}" -> } -> ], -> "x-stripeResource": { -> "class_name": "Coupon", -> "has_collection_class": true, -> "in_package": "", -> "inner_classes": [ -> "coupon_applies_to", -> "coupon_currency_option" -> ] -> } -5389c6623,6627 -< "x-expandableFields": [] ---- -> "x-expandableFields": [], -> "x-stripeResource": { -> "class_name": "AppliesTo", -> "in_class": "coupon" -> } -5404c6642,6646 -< "x-expandableFields": [] ---- -> "x-expandableFields": [], -> "x-stripeResource": { -> "class_name": "CurrencyOption", -> "in_class": "coupon" -> } -5665a6908 -> "customer_balance_transaction", -5671a6915,6916 -> "memo", -> "metadata", -5673a6919 -> "out_of_band_amount", -5674a6921,6922 -> "reason", -> "refund", -5676a6925 -> "subtotal_excluding_tax", -5679c6928,6930 -< "type" ---- -> "total_excluding_tax", -> "type", -> "voided_at" -5692c6943,7002 -< "x-resourceId": "credit_note" ---- -> "x-resourceId": "credit_note", -> "x-stripeOperations": [ -> { -> "method_name": "create", -> "method_on": "service", -> "method_type": "create", -> "operation": "post", -> "path": "/v1/credit_notes" -> }, -> { -> "method_name": "preview", -> "method_on": "service", -> "method_type": "custom", -> "operation": "get", -> "path": "/v1/credit_notes/preview" -> }, -> { -> "method_name": "retrieve", -> "method_on": "service", -> "method_type": "retrieve", -> "operation": "get", -> "path": "/v1/credit_notes/{id}" -> }, -> { -> "method_name": "list", -> "method_on": "service", -> "method_type": "list", -> "operation": "get", -> "path": "/v1/credit_notes" -> }, -> { -> "method_name": "update", -> "method_on": "service", -> "method_type": "update", -> "operation": "post", -> "path": "/v1/credit_notes/{id}" -> }, -> { -> "method_name": "void_credit_note", -> "method_on": "service", -> "method_type": "custom", -> "operation": "post", -> "path": "/v1/credit_notes/{id}/void" -> }, -> { -> "method_name": "preview_lines", -> "method_on": "service", -> "method_type": "custom", -> "operation": "get", -> "path": "/v1/credit_notes/preview/lines" -> } -> ], -> "x-stripeResource": { -> "class_name": "CreditNote", -> "has_collection_class": true, -> "in_package": "", -> "inner_classes": [ -> "credit_note_tax_amount" -> ] -> } -5790a7101,7102 -> "amount_excluding_tax", -> "description", -5795a7108 -> "quantity", -5798c7111,7114 -< "type" ---- -> "type", -> "unit_amount", -> "unit_amount_decimal", -> "unit_amount_excluding_tax" -5807c7123,7144 -< "x-resourceId": "credit_note_line_item" ---- -> "x-resourceId": "credit_note_line_item", -> "x-stripeOperations": [ -> { -> "method_name": "list", -> "method_on": "collection", -> "method_type": "list", -> "operation": "get", -> "path": "/v1/credit_notes/{credit_note}/lines" -> }, -> { -> "method_name": "list", -> "method_on": "service", -> "method_type": "list", -> "operation": "get", -> "path": "/v1/credit_notes/{credit_note}/lines" -> } -> ], -> "x-stripeResource": { -> "class_name": "CreditNoteLineItem", -> "has_collection_class": true, -> "in_package": "" -> } -5849c7186,7190 -< ] ---- -> ], -> "x-stripeResource": { -> "class_name": "TaxAmount", -> "in_class": "credit_note" -> } -5891a7233,7238 -> "required": [ -> "custom_unit_amount", -> "tax_behavior", -> "unit_amount", -> "unit_amount_decimal" -> ], -5897c7244,7248 -< ] ---- -> ], -> "x-stripeResource": { -> "class_name": "CurrencyOption", -> "in_class": "price" -> } -5917a7269,7273 -> "required": [ -> "maximum", -> "minimum", -> "preset" -> ], -5920c7276,7280 -< "x-expandableFields": [] ---- -> "x-expandableFields": [], -> "x-stripeResource": { -> "class_name": "CustomUnitAmount", -> "in_class": "price" -> } -5965,5971c7325 -< "$ref": "#/components/schemas/bank_account" -< }, -< { -< "$ref": "#/components/schemas/card" -< }, -< { -< "$ref": "#/components/schemas/source" ---- -> "$ref": "#/components/schemas/payment_source" -5979,5985c7333 -< "$ref": "#/components/schemas/bank_account" -< }, -< { -< "$ref": "#/components/schemas/card" -< }, -< { -< "$ref": "#/components/schemas/source" ---- -> "$ref": "#/components/schemas/payment_source" -5988,5989c7336 -< }, -< "x-stripeBypassValidation": true ---- -> } -6097,6109c7444 -< "anyOf": [ -< { -< "$ref": "#/components/schemas/bank_account" -< }, -< { -< "$ref": "#/components/schemas/card" -< }, -< { -< "$ref": "#/components/schemas/source" -< } -< ], -< "title": "Polymorphic", -< "x-stripeBypassValidation": true ---- -> "$ref": "#/components/schemas/payment_source" -6255a7591,7593 -> "default_source", -> "description", -> "email", -6258c7596,7597 -< "object" ---- -> "object", -> "shipping" -6275c7614,7710 -< "x-resourceId": "customer" ---- -> "x-resourceId": "customer", -> "x-stripeOperations": [ -> { -> "method_name": "search", -> "method_on": "service", -> "method_type": "custom", -> "operation": "get", -> "path": "/v1/customers/search" -> }, -> { -> "method_name": "list", -> "method_on": "service", -> "method_type": "list", -> "operation": "get", -> "path": "/v1/customers" -> }, -> { -> "method_name": "create", -> "method_on": "service", -> "method_type": "create", -> "operation": "post", -> "path": "/v1/customers" -> }, -> { -> "method_name": "retrieve", -> "method_on": "service", -> "method_type": "retrieve", -> "operation": "get", -> "path": "/v1/customers/{customer}" -> }, -> { -> "method_name": "update", -> "method_on": "service", -> "method_type": "update", -> "operation": "post", -> "path": "/v1/customers/{customer}" -> }, -> { -> "method_name": "delete", -> "method_on": "service", -> "method_type": "delete", -> "operation": "delete", -> "path": "/v1/customers/{customer}" -> }, -> { -> "method_name": "list_payment_methods", -> "method_on": "service", -> "method_type": "custom", -> "operation": "get", -> "path": "/v1/customers/{customer}/payment_methods" -> }, -> { -> "method_name": "retrieve_payment_method", -> "method_on": "service", -> "method_type": "custom", -> "operation": "get", -> "path": "/v1/customers/{customer}/payment_methods/{payment_method}" -> }, -> { -> "method_name": "balance_transactions", -> "method_on": "service", -> "method_type": "custom", -> "operation": "get", -> "path": "/v1/customers/{customer}/balance_transactions" -> }, -> { -> "method_name": "fund_cash_balance", -> "method_on": "service", -> "method_type": "custom", -> "operation": "post", -> "path": "/v1/test_helpers/customers/{customer}/fund_cash_balance" -> }, -> { -> "method_name": "create_funding_instructions", -> "method_on": "service", -> "method_type": "custom", -> "operation": "post", -> "path": "/v1/customers/{customer}/funding_instructions" -> }, -> { -> "method_name": "delete_discount", -> "method_on": "service", -> "method_type": "custom", -> "operation": "delete", -> "path": "/v1/customers/{customer}/discount" -> } -> ], -> "x-stripeResource": { -> "class_name": "Customer", -> "has_collection_class": true, -> "has_search_result_class": true, -> "in_package": "", -> "inner_classes": [ -> "customer_tax", -> "invoice_setting_customer_setting" -> ] -> } -6301a7737 -> "accepted_at", -6309c7745,7753 -< ] ---- -> ], -> "x-stripeResource": { -> "class_name": "CustomerAcceptance", -> "in_class": "mandate", -> "inner_classes": [ -> "offline_acceptance", -> "online_acceptance" -> ] -> } -6328c7772,7776 -< "x-expandableFields": [] ---- -> "x-expandableFields": [], -> "x-stripeResource": { -> "class_name": "BalanceSettings", -> "in_class": "cash_balance" -> } -6360c7808,7812 -< ] ---- -> ], -> "x-stripeResource": { -> "class_name": "AppliedToPayment", -> "in_class": "customer_cash_balance_transaction" -> } -6376c7828,7835 -< ] ---- -> ], -> "x-stripeResource": { -> "class_name": "Funded", -> "in_class": "customer_cash_balance_transaction", -> "inner_classes": [ -> "customer_balance_resource_cash_balance_transaction_resource_funded_transaction_resource_bank_transfer" -> ] -> } -6402a7862 -> "reference", -6409c7869,7876 -< ] ---- -> ], -> "x-stripeResource": { -> "class_name": "BankTransfer", -> "in_class": "customer_balance_resource_cash_balance_transaction_resource_funded_transaction", -> "inner_classes": [ -> "customer_balance_resource_cash_balance_transaction_resource_funded_transaction_resource_bank_transfer_resource_eu_bank_transfer" -> ] -> } -6432a7900,7904 -> "required": [ -> "bic", -> "iban_last4", -> "sender_name" -> ], -6435c7907,7911 -< "x-expandableFields": [] ---- -> "x-expandableFields": [], -> "x-stripeResource": { -> "class_name": "EuBankTransfer", -> "in_class": "customer_balance_resource_cash_balance_transaction_resource_funded_transaction_resource_bank_transfer" -> } -6467c7943,7947 -< ] ---- -> ], -> "x-stripeResource": { -> "class_name": "RefundedFromPayment", -> "in_class": "customer_cash_balance_transaction" -> } -6499c7979,7983 -< ] ---- -> ], -> "x-stripeResource": { -> "class_name": "UnappliedFromPayment", -> "in_class": "customer_cash_balance_transaction" -> } -6629a8114 -> "credit_note", -6631a8117 -> "description", -6633a8120 -> "invoice", -6634a8122 -> "metadata", -6645c8133,8189 -< "x-resourceId": "customer_balance_transaction" ---- -> "x-resourceId": "customer_balance_transaction", -> "x-stripeOperations": [ -> { -> "method_name": "retrieve", -> "method_on": "collection", -> "method_type": "retrieve", -> "operation": "get", -> "path": "/v1/customers/{customer}/balance_transactions/{transaction}" -> }, -> { -> "method_name": "retrieve", -> "method_on": "service", -> "method_type": "retrieve", -> "operation": "get", -> "path": "/v1/customers/{customer}/balance_transactions/{transaction}" -> }, -> { -> "method_name": "list", -> "method_on": "collection", -> "method_type": "list", -> "operation": "get", -> "path": "/v1/customers/{customer}/balance_transactions" -> }, -> { -> "method_name": "list", -> "method_on": "service", -> "method_type": "list", -> "operation": "get", -> "path": "/v1/customers/{customer}/balance_transactions" -> }, -> { -> "method_name": "create", -> "method_on": "collection", -> "method_type": "create", -> "operation": "post", -> "path": "/v1/customers/{customer}/balance_transactions" -> }, -> { -> "method_name": "create", -> "method_on": "service", -> "method_type": "create", -> "operation": "post", -> "path": "/v1/customers/{customer}/balance_transactions" -> }, -> { -> "method_name": "update", -> "method_on": "service", -> "method_type": "update", -> "operation": "post", -> "path": "/v1/customers/{customer}/balance_transactions/{transaction}" -> } -> ], -> "x-stripeResource": { -> "class_name": "CustomerBalanceTransaction", -> "has_collection_class": true, -> "in_package": "" -> } -6748c8292,8333 -< "x-resourceId": "customer_cash_balance_transaction" ---- -> "x-resourceId": "customer_cash_balance_transaction", -> "x-stripeOperations": [ -> { -> "method_name": "retrieve", -> "method_on": "collection", -> "method_type": "retrieve", -> "operation": "get", -> "path": "/v1/customers/{customer}/cash_balance_transactions/{transaction}" -> }, -> { -> "method_name": "retrieve", -> "method_on": "service", -> "method_type": "retrieve", -> "operation": "get", -> "path": "/v1/customers/{customer}/cash_balance_transactions/{transaction}" -> }, -> { -> "method_name": "list", -> "method_on": "collection", -> "method_type": "list", -> "operation": "get", -> "path": "/v1/customers/{customer}/cash_balance_transactions" -> }, -> { -> "method_name": "list", -> "method_on": "service", -> "method_type": "list", -> "operation": "get", -> "path": "/v1/customers/{customer}/cash_balance_transactions" -> } -> ], -> "x-stripeResource": { -> "class_name": "CustomerCashBalanceTransaction", -> "has_collection_class": true, -> "in_package": "", -> "inner_classes": [ -> "customer_balance_resource_cash_balance_transaction_resource_applied_to_payment_transaction", -> "customer_balance_resource_cash_balance_transaction_resource_funded_transaction", -> "customer_balance_resource_cash_balance_transaction_resource_refunded_from_payment_transaction", -> "customer_balance_resource_cash_balance_transaction_resource_unapplied_from_payment_transaction" -> ] -> } -6780c8365,8367 -< "automatic_tax" ---- -> "automatic_tax", -> "ip_address", -> "location" -6786c8373,8380 -< ] ---- -> ], -> "x-stripeResource": { -> "class_name": "Tax", -> "in_class": "customer", -> "inner_classes": [ -> "customer_tax_location" -> ] -> } -6815c8409,8410 -< "source" ---- -> "source", -> "state" -6819c8414,8418 -< "x-expandableFields": [] ---- -> "x-expandableFields": [], -> "x-stripeResource": { -> "class_name": "Location", -> "in_class": "customer_tax" -> } -6852c8451,8455 -< "x-resourceId": "deleted_account" ---- -> "x-resourceId": "deleted_account", -> "x-stripeResource": { -> "class_name": "DeletedAccount", -> "in_package": "" -> } -6885c8488,8492 -< "x-resourceId": "deleted_apple_pay_domain" ---- -> "x-resourceId": "deleted_apple_pay_domain", -> "x-stripeResource": { -> "class_name": "DeletedApplePayDomain", -> "in_package": "" -> } -6918a8526 -> "name", -6923c8531,8535 -< "x-expandableFields": [] ---- -> "x-expandableFields": [], -> "x-stripeResource": { -> "class_name": "DeletedApplication", -> "in_package": "" -> } -6961c8573,8577 -< "x-expandableFields": [] ---- -> "x-expandableFields": [], -> "x-stripeResource": { -> "class_name": "DeletedBankAccount", -> "in_package": "" -> } -6999c8615,8619 -< "x-expandableFields": [] ---- -> "x-expandableFields": [], -> "x-stripeResource": { -> "class_name": "DeletedCard", -> "in_package": "" -> } -7032c8652,8656 -< "x-resourceId": "deleted_coupon" ---- -> "x-resourceId": "deleted_coupon", -> "x-stripeResource": { -> "class_name": "DeletedCoupon", -> "in_package": "" -> } -7065c8689,8693 -< "x-resourceId": "deleted_customer" ---- -> "x-resourceId": "deleted_customer", -> "x-stripeResource": { -> "class_name": "DeletedCustomer", -> "in_package": "" -> } -7168a8797 -> "checkout_session", -7169a8799 -> "customer", -7171a8802,8803 -> "invoice", -> "invoice_item", -7173c8805,8807 -< "start" ---- -> "promotion_code", -> "start", -> "subscription" -7182c8816,8820 -< "x-resourceId": "deleted_discount" ---- -> "x-resourceId": "deleted_discount", -> "x-stripeResource": { -> "class_name": "DeletedDiscount", -> "in_package": "" -> } -7195c8833,8836 -< "x-stripeBypassValidation": true ---- -> "x-stripeBypassValidation": true, -> "x-stripeResource": { -> "class_name": "DeletedExternalAccount" -> } -7228c8869,8873 -< "x-resourceId": "deleted_invoice" ---- -> "x-resourceId": "deleted_invoice", -> "x-stripeResource": { -> "class_name": "DeletedInvoice", -> "in_package": "" -> } -7261c8906,8910 -< "x-resourceId": "deleted_invoiceitem" ---- -> "x-resourceId": "deleted_invoiceitem", -> "x-stripeResource": { -> "class_name": "DeletedInvoiceItem", -> "in_package": "" -> } -7274c8923,8926 -< "x-stripeBypassValidation": true ---- -> "x-stripeBypassValidation": true, -> "x-stripeResource": { -> "class_name": "DeletedPaymentSource" -> } -7307c8959,8963 -< "x-resourceId": "deleted_person" ---- -> "x-resourceId": "deleted_person", -> "x-stripeResource": { -> "class_name": "DeletedPerson", -> "in_package": "" -> } -7340c8996,9000 -< "x-resourceId": "deleted_plan" ---- -> "x-resourceId": "deleted_plan", -> "x-stripeResource": { -> "class_name": "DeletedPlan", -> "in_package": "" -> } -7372c9032,9036 -< "x-expandableFields": [] ---- -> "x-expandableFields": [], -> "x-stripeResource": { -> "class_name": "DeletedPrice", -> "in_package": "" -> } -7405c9069,9073 -< "x-resourceId": "deleted_product" ---- -> "x-resourceId": "deleted_product", -> "x-stripeResource": { -> "class_name": "DeletedProduct", -> "in_package": "" -> } -7438c9106,9110 -< "x-resourceId": "deleted_radar.value_list" ---- -> "x-resourceId": "deleted_radar.value_list", -> "x-stripeResource": { -> "class_name": "DeletedValueList", -> "in_package": "Radar" -> } -7471c9143,9147 -< "x-resourceId": "deleted_radar.value_list_item" ---- -> "x-resourceId": "deleted_radar.value_list_item", -> "x-stripeResource": { -> "class_name": "DeletedValueListItem", -> "in_package": "Radar" -> } -7504c9180,9184 -< "x-resourceId": "deleted_sku" ---- -> "x-resourceId": "deleted_sku", -> "x-stripeResource": { -> "class_name": "DeletedSku", -> "in_package": "" -> } -7537c9217,9221 -< "x-resourceId": "deleted_subscription_item" ---- -> "x-resourceId": "deleted_subscription_item", -> "x-stripeResource": { -> "class_name": "DeletedSubscriptionItem", -> "in_package": "" -> } -7570c9254,9258 -< "x-resourceId": "deleted_tax_id" ---- -> "x-resourceId": "deleted_tax_id", -> "x-stripeResource": { -> "class_name": "DeletedTaxId", -> "in_package": "" -> } -7603c9291,9295 -< "x-resourceId": "deleted_terminal.configuration" ---- -> "x-resourceId": "deleted_terminal.configuration", -> "x-stripeResource": { -> "class_name": "DeletedConfiguration", -> "in_package": "Terminal" -> } -7636c9328,9332 -< "x-resourceId": "deleted_terminal.location" ---- -> "x-resourceId": "deleted_terminal.location", -> "x-stripeResource": { -> "class_name": "DeletedLocation", -> "in_package": "Terminal" -> } -7669c9365,9369 -< "x-resourceId": "deleted_terminal.reader" ---- -> "x-resourceId": "deleted_terminal.reader", -> "x-stripeResource": { -> "class_name": "DeletedReader", -> "in_package": "Terminal" -> } -7702c9402,9406 -< "x-resourceId": "deleted_test_helpers.test_clock" ---- -> "x-resourceId": "deleted_test_helpers.test_clock", -> "x-stripeResource": { -> "class_name": "DeletedTestClock", -> "in_package": "TestHelpers" -> } -7735c9439,9443 -< "x-resourceId": "deleted_webhook_endpoint" ---- -> "x-resourceId": "deleted_webhook_endpoint", -> "x-stripeResource": { -> "class_name": "DeletedWebhookEndpoint", -> "in_package": "" -> } -7837a9546 -> "checkout_session", -7838a9548,9549 -> "customer", -> "end", -7839a9551,9552 -> "invoice", -> "invoice_item", -7841c9554,9556 -< "start" ---- -> "promotion_code", -> "start", -> "subscription" -7850c9565,9568 -< "x-resourceId": "discount" ---- -> "x-stripeResource": { -> "class_name": "Discount", -> "in_package": "" -> } -7893c9611,9615 -< ] ---- -> ], -> "x-stripeResource": { -> "class_name": "DiscountAmount", -> "in_package": "" -> } -7963a9686,9691 -> "network_reason_code": { -> "description": "Network-dependent reason code for the dispute.", -> "maxLength": 5000, -> "nullable": true, -> "type": "string" -> }, -8023a9752 -> "payment_intent", -8036c9765,9807 -< "x-resourceId": "dispute" ---- -> "x-resourceId": "dispute", -> "x-stripeOperations": [ -> { -> "method_name": "list", -> "method_on": "service", -> "method_type": "list", -> "operation": "get", -> "path": "/v1/disputes" -> }, -> { -> "method_name": "retrieve", -> "method_on": "service", -> "method_type": "retrieve", -> "operation": "get", -> "path": "/v1/disputes/{dispute}" -> }, -> { -> "method_name": "update", -> "method_on": "service", -> "method_type": "update", -> "operation": "post", -> "path": "/v1/disputes/{dispute}" -> }, -> { -> "method_name": "close", -> "method_on": "service", -> "method_type": "custom", -> "operation": "post", -> "path": "/v1/disputes/{dispute}/close" -> } -> ], -> "x-stripeResource": { -> "class_name": "Dispute", -> "has_collection_class": true, -> "in_package": "", -> "inner_classes": [ -> "dispute_evidence", -> "dispute_evidence_details" -> ], -> "polymorphic_groups": [ -> "balance_transaction_source" -> ] -> } -8329a10101,10129 -> "required": [ -> "access_activity_log", -> "billing_address", -> "cancellation_policy", -> "cancellation_policy_disclosure", -> "cancellation_rebuttal", -> "customer_communication", -> "customer_email_address", -> "customer_name", -> "customer_purchase_ip", -> "customer_signature", -> "duplicate_charge_documentation", -> "duplicate_charge_explanation", -> "duplicate_charge_id", -> "product_description", -> "receipt", -> "refund_policy", -> "refund_policy_disclosure", -> "refund_refusal_explanation", -> "service_date", -> "service_documentation", -> "shipping_address", -> "shipping_carrier", -> "shipping_date", -> "shipping_documentation", -> "shipping_tracking_number", -> "uncategorized_file", -> "uncategorized_text" -> ], -8342c10142,10146 -< ] ---- -> ], -> "x-stripeResource": { -> "class_name": "Evidence", -> "in_class": "dispute" -> } -8366a10171 -> "due_by", -8373c10178,10182 -< "x-expandableFields": [] ---- -> "x-expandableFields": [], -> "x-stripeResource": { -> "class_name": "EvidenceDetails", -> "in_class": "dispute" -> } -8395c10204,10208 -< "x-expandableFields": [] ---- -> "x-expandableFields": [], -> "x-stripeResource": { -> "class_name": "EmailSent", -> "in_class": "refund_next_action_display_details" -> } -8442c10255,10275 -< "x-resourceId": "ephemeral_key" ---- -> "x-resourceId": "ephemeral_key", -> "x-stripeOperations": [ -> { -> "method_name": "create", -> "method_on": "service", -> "method_type": "create", -> "operation": "post", -> "path": "/v1/ephemeral_keys" -> }, -> { -> "method_name": "delete", -> "method_on": "service", -> "method_type": "delete", -> "operation": "delete", -> "path": "/v1/ephemeral_keys/{key}" -> } -> ], -> "x-stripeResource": { -> "class_name": "EphemeralKey", -> "in_package": "" -> } -8454c10287,10291 -< "type": "object" ---- -> "type": "object", -> "x-stripeResource": { -> "class_name": "StripeErrorResponse", -> "in_package": "" -> } -8513a10351 -> "api_version", -8519a10358 -> "request", -8528c10367,10388 -< "x-resourceId": "event" ---- -> "x-resourceId": "event", -> "x-stripeOperations": [ -> { -> "method_name": "list", -> "method_on": "service", -> "method_type": "list", -> "operation": "get", -> "path": "/v1/events" -> }, -> { -> "method_name": "retrieve", -> "method_on": "service", -> "method_type": "retrieve", -> "operation": "get", -> "path": "/v1/events/{id}" -> } -> ], -> "x-stripeResource": { -> "class_name": "Event", -> "has_collection_class": true, -> "in_package": "" -> } -8561c10421,10442 -< "x-resourceId": "exchange_rate" ---- -> "x-resourceId": "exchange_rate", -> "x-stripeOperations": [ -> { -> "method_name": "list", -> "method_on": "service", -> "method_type": "list", -> "operation": "get", -> "path": "/v1/exchange_rates" -> }, -> { -> "method_name": "retrieve", -> "method_on": "service", -> "method_type": "retrieve", -> "operation": "get", -> "path": "/v1/exchange_rates/{rate_id}" -> } -> ], -> "x-stripeResource": { -> "class_name": "ExchangeRate", -> "has_collection_class": true, -> "in_package": "" -> } -8574c10455,10517 -< "x-stripeBypassValidation": true ---- -> "x-stripeBypassValidation": true, -> "x-stripeOperations": [ -> { -> "method_name": "list", -> "method_on": "collection", -> "method_type": "list", -> "operation": "get", -> "path": "/v1/accounts/{account}/external_accounts" -> }, -> { -> "method_name": "list", -> "method_on": "service", -> "method_type": "list", -> "operation": "get", -> "path": "/v1/accounts/{account}/external_accounts" -> }, -> { -> "method_name": "retrieve", -> "method_on": "collection", -> "method_type": "retrieve", -> "operation": "get", -> "path": "/v1/accounts/{account}/external_accounts/{id}" -> }, -> { -> "method_name": "retrieve", -> "method_on": "service", -> "method_type": "retrieve", -> "operation": "get", -> "path": "/v1/accounts/{account}/external_accounts/{id}" -> }, -> { -> "method_name": "create", -> "method_on": "collection", -> "method_type": "create", -> "operation": "post", -> "path": "/v1/accounts/{account}/external_accounts" -> }, -> { -> "method_name": "create", -> "method_on": "service", -> "method_type": "create", -> "operation": "post", -> "path": "/v1/accounts/{account}/external_accounts" -> }, -> { -> "method_name": "update", -> "method_on": "service", -> "method_type": "update", -> "operation": "post", -> "path": "/v1/accounts/{account}/external_accounts/{id}" -> }, -> { -> "method_name": "delete", -> "method_on": "service", -> "method_type": "delete", -> "operation": "delete", -> "path": "/v1/accounts/{account}/external_accounts/{id}" -> } -> ], -> "x-stripeResource": { -> "class_name": "ExternalAccount", -> "has_collection_class": true -> } -8606a10550 -> "application", -8607a10552 -> "description", -8612c10557,10561 -< "x-expandableFields": [] ---- -> "x-expandableFields": [], -> "x-stripeResource": { -> "class_name": "Fee", -> "in_class": "balance_transaction" -> } -8692a10642 -> "balance_transaction", -8696a10647 -> "metadata", -8705c10656,10715 -< "x-resourceId": "fee_refund" ---- -> "x-resourceId": "fee_refund", -> "x-stripeOperations": [ -> { -> "method_name": "create", -> "method_on": "collection", -> "method_type": "create", -> "operation": "post", -> "path": "/v1/application_fees/{id}/refunds" -> }, -> { -> "method_name": "create", -> "method_on": "service", -> "method_type": "create", -> "operation": "post", -> "path": "/v1/application_fees/{id}/refunds" -> }, -> { -> "method_name": "list", -> "method_on": "collection", -> "method_type": "list", -> "operation": "get", -> "path": "/v1/application_fees/{id}/refunds" -> }, -> { -> "method_name": "list", -> "method_on": "service", -> "method_type": "list", -> "operation": "get", -> "path": "/v1/application_fees/{id}/refunds" -> }, -> { -> "method_name": "retrieve", -> "method_on": "collection", -> "method_type": "retrieve", -> "operation": "get", -> "path": "/v1/application_fees/{fee}/refunds/{id}" -> }, -> { -> "method_name": "retrieve", -> "method_on": "service", -> "method_type": "retrieve", -> "operation": "get", -> "path": "/v1/application_fees/{fee}/refunds/{id}" -> }, -> { -> "method_name": "update", -> "method_on": "service", -> "method_type": "update", -> "operation": "post", -> "path": "/v1/application_fees/{fee}/refunds/{id}" -> } -> ], -> "x-stripeResource": { -> "class_name": "FeeRefund", -> "has_collection_class": true, -> "in_package": "", -> "polymorphic_groups": [ -> "balance_transaction_source" -> ] -> } -8826a10837,10838 -> "expires_at", -> "filename", -8830c10842,10845 -< "size" ---- -> "size", -> "title", -> "type", -> "url" -8837c10852,10880 -< "x-resourceId": "file" ---- -> "x-resourceId": "file", -> "x-stripeOperations": [ -> { -> "method_name": "list", -> "method_on": "service", -> "method_type": "list", -> "operation": "get", -> "path": "/v1/files" -> }, -> { -> "method_name": "retrieve", -> "method_on": "service", -> "method_type": "retrieve", -> "operation": "get", -> "path": "/v1/files/{file}" -> }, -> { -> "method_name": "create", -> "method_on": "service", -> "method_type": "create", -> "operation": "post", -> "path": "/v1/files" -> } -> ], -> "x-stripeResource": { -> "class_name": "File", -> "has_collection_class": true, -> "in_package": "" -> } -8909a10953 -> "expires_at", -8914c10958,10959 -< "object" ---- -> "object", -> "url" -8921c10966,11001 -< "x-resourceId": "file_link" ---- -> "x-resourceId": "file_link", -> "x-stripeOperations": [ -> { -> "method_name": "retrieve", -> "method_on": "service", -> "method_type": "retrieve", -> "operation": "get", -> "path": "/v1/file_links/{link}" -> }, -> { -> "method_name": "create", -> "method_on": "service", -> "method_type": "create", -> "operation": "post", -> "path": "/v1/file_links" -> }, -> { -> "method_name": "update", -> "method_on": "service", -> "method_type": "update", -> "operation": "post", -> "path": "/v1/file_links/{link}" -> }, -> { -> "method_name": "list", -> "method_on": "service", -> "method_type": "list", -> "operation": "get", -> "path": "/v1/file_links" -> } -> ], -> "x-stripeResource": { -> "class_name": "FileLink", -> "has_collection_class": true, -> "in_package": "" -> } -9077a11158,11160 -> "account_holder", -> "balance", -> "balance_refresh", -9079a11163 -> "display_name", -9081a11166 -> "last4", -9083a11169,11171 -> "ownership", -> "ownership_refresh", -> "permissions", -9097c11185,11233 -< "x-resourceId": "financial_connections.account" ---- -> "x-resourceId": "financial_connections.account", -> "x-stripeOperations": [ -> { -> "method_name": "list", -> "method_on": "service", -> "method_type": "list", -> "operation": "get", -> "path": "/v1/financial_connections/accounts" -> }, -> { -> "method_name": "retrieve", -> "method_on": "service", -> "method_type": "retrieve", -> "operation": "get", -> "path": "/v1/financial_connections/accounts/{account}" -> }, -> { -> "method_name": "list_owners", -> "method_on": "service", -> "method_type": "custom", -> "operation": "get", -> "path": "/v1/financial_connections/accounts/{account}/owners" -> }, -> { -> "method_name": "refresh", -> "method_on": "service", -> "method_type": "custom", -> "operation": "post", -> "path": "/v1/financial_connections/accounts/{account}/refresh" -> }, -> { -> "method_name": "disconnect", -> "method_on": "service", -> "method_type": "custom", -> "operation": "post", -> "path": "/v1/financial_connections/accounts/{account}/disconnect" -> } -> ], -> "x-stripeResource": { -> "class_name": "Account", -> "has_collection_class": true, -> "in_package": "FinancialConnections", -> "inner_classes": [ -> "bank_connections_resource_accountholder", -> "bank_connections_resource_balance", -> "bank_connections_resource_balance_refresh", -> "bank_connections_resource_ownership_refresh" -> ] -> } -9149a11286 -> "email", -9153c11290,11293 -< "ownership" ---- -> "ownership", -> "phone", -> "raw_address", -> "refreshed_at" -9158c11298,11303 -< "x-resourceId": "financial_connections.account_owner" ---- -> "x-resourceId": "financial_connections.account_owner", -> "x-stripeResource": { -> "class_name": "AccountOwner", -> "has_collection_class": true, -> "in_package": "FinancialConnections" -> } -9230c11375,11379 -< ] ---- -> ], -> "x-stripeResource": { -> "class_name": "AccountOwnership", -> "in_package": "FinancialConnections" -> } -9328a11478 -> "account_holder", -9343c11493,11516 -< "x-resourceId": "financial_connections.session" ---- -> "x-resourceId": "financial_connections.session", -> "x-stripeOperations": [ -> { -> "method_name": "create", -> "method_on": "service", -> "method_type": "create", -> "operation": "post", -> "path": "/v1/financial_connections/sessions" -> }, -> { -> "method_name": "retrieve", -> "method_on": "service", -> "method_type": "retrieve", -> "operation": "get", -> "path": "/v1/financial_connections/sessions/{session}" -> } -> ], -> "x-stripeResource": { -> "class_name": "Session", -> "in_package": "FinancialConnections", -> "inner_classes": [ -> "bank_connections_resource_link_account_session_filters" -> ] -> } -9393c11566,11570 -< "x-expandableFields": [] ---- -> "x-expandableFields": [], -> "x-stripeResource": { -> "class_name": "Parameters", -> "in_class": "reporting.report_run" -> } -9437c11614,11621 -< "x-resourceId": "funding_instructions" ---- -> "x-resourceId": "funding_instructions", -> "x-stripeResource": { -> "class_name": "FundingInstructions", -> "in_package": "", -> "inner_classes": [ -> "funding_instructions_bank_transfer" -> ] -> } -9473c11657,11664 -< ] ---- -> ], -> "x-stripeResource": { -> "class_name": "BankTransfer", -> "in_class": "funding_instructions", -> "inner_classes": [ -> "funding_instructions_bank_transfer_financial_address" -> ] -> } -9527c11718,11728 -< ] ---- -> ], -> "x-stripeResource": { -> "class_name": "FinancialAddress", -> "in_class": "funding_instructions_bank_transfer", -> "inner_classes": [ -> "funding_instructions_bank_transfer_iban_record", -> "funding_instructions_bank_transfer_sort_code_record", -> "funding_instructions_bank_transfer_spei_record", -> "funding_instructions_bank_transfer_zengin_record" -> ] -> } -9561c11762,11766 -< "x-expandableFields": [] ---- -> "x-expandableFields": [], -> "x-stripeResource": { -> "class_name": "Iban", -> "in_class": "funding_instructions_bank_transfer_financial_address" -> } -9589c11794,11798 -< "x-expandableFields": [] ---- -> "x-expandableFields": [], -> "x-stripeResource": { -> "class_name": "SortCode", -> "in_class": "funding_instructions_bank_transfer_financial_address" -> } -9617c11826,11830 -< "x-expandableFields": [] ---- -> "x-expandableFields": [], -> "x-stripeResource": { -> "class_name": "Spei", -> "in_class": "funding_instructions_bank_transfer_financial_address" -> } -9664a11878,11886 -> "required": [ -> "account_holder_name", -> "account_number", -> "account_type", -> "bank_code", -> "bank_name", -> "branch_code", -> "branch_name" -> ], -9667c11889,11893 -< "x-expandableFields": [] ---- -> "x-expandableFields": [], -> "x-stripeResource": { -> "class_name": "Zengin", -> "in_class": "funding_instructions_bank_transfer_financial_address" -> } -9687a11914,11918 -> "required": [ -> "day", -> "month", -> "year" -> ], -9690c11921,11925 -< "x-expandableFields": [] ---- -> "x-expandableFields": [], -> "x-stripeResource": { -> "class_name": "DateOfBirth", -> "in_class": "gelato_document_report" -> } -9710a11946,11950 -> "required": [ -> "day", -> "month", -> "year" -> ], -9713c11953,11957 -< "x-expandableFields": [] ---- -> "x-expandableFields": [], -> "x-stripeResource": { -> "class_name": "ExpirationDate", -> "in_class": "gelato_document_report" -> } -9733a11978,11982 -> "required": [ -> "day", -> "month", -> "year" -> ], -9736c11985,11989 -< "x-expandableFields": [] ---- -> "x-expandableFields": [], -> "x-stripeResource": { -> "class_name": "IssuedDate", -> "in_class": "gelato_document_report" -> } -9756a12010,12014 -> "required": [ -> "day", -> "month", -> "year" -> ], -9759c12017,12021 -< "x-expandableFields": [] ---- -> "x-expandableFields": [], -> "x-stripeResource": { -> "class_name": "DateOfBirth", -> "in_class": "gelato_id_number_report" -> } -9779a12042,12046 -> "required": [ -> "day", -> "month", -> "year" -> ], -9782c12049,12053 -< "x-expandableFields": [] ---- -> "x-expandableFields": [], -> "x-stripeResource": { -> "class_name": "DateOfBirth", -> "in_class": "gelato_verified_outputs" -> } -9886c12157,12168 -< "status" ---- -> "address", -> "dob", -> "error", -> "expiration_date", -> "files", -> "first_name", -> "issued_date", -> "issuing_country", -> "last_name", -> "number", -> "status", -> "type" -9896c12178,12188 -< ] ---- -> ], -> "x-stripeResource": { -> "class_name": "Document", -> "in_class": "identity.verification_report", -> "inner_classes": [ -> "gelato_data_document_report_date_of_birth", -> "gelato_data_document_report_expiration_date", -> "gelato_data_document_report_issued_date", -> "gelato_document_report_error" -> ] -> } -9917a12210,12213 -> "required": [ -> "code", -> "reason" -> ], -9920c12216,12220 -< "x-expandableFields": [] ---- -> "x-expandableFields": [], -> "x-stripeResource": { -> "class_name": "DocumentCheckError", -> "in_class": "gelato_document_report" -> } -9981a12282,12287 -> "dob", -> "error", -> "first_name", -> "id_number", -> "id_number_type", -> "last_name", -9989c12295,12303 -< ] ---- -> ], -> "x-stripeResource": { -> "class_name": "IdNumber", -> "in_class": "identity.verification_report", -> "inner_classes": [ -> "gelato_data_id_number_report_date", -> "gelato_id_number_report_error" -> ] -> } -10010a12325,12328 -> "required": [ -> "code", -> "reason" -> ], -10013c12331,12335 -< "x-expandableFields": [] ---- -> "x-expandableFields": [], -> "x-stripeResource": { -> "class_name": "IdNumberCheckError", -> "in_class": "gelato_id_number_report" -> } -10045c12367,12371 -< "x-expandableFields": [] ---- -> "x-expandableFields": [], -> "x-stripeResource": { -> "class_name": "Document", -> "in_class": "gelato_verification_report_options" -> } -10052c12378,12382 -< "x-expandableFields": [] ---- -> "x-expandableFields": [], -> "x-stripeResource": { -> "class_name": "IdNumber", -> "in_class": "gelato_verification_report_options" -> } -10088a12419,12421 -> "document", -> "error", -> "selfie", -10095c12428,12435 -< ] ---- -> ], -> "x-stripeResource": { -> "class_name": "Selfie", -> "in_class": "identity.verification_report", -> "inner_classes": [ -> "gelato_selfie_report_error" -> ] -> } -10117a12458,12461 -> "required": [ -> "code", -> "reason" -> ], -10120c12464,12468 -< "x-expandableFields": [] ---- -> "x-expandableFields": [], -> "x-stripeResource": { -> "class_name": "SelfieCheckError", -> "in_class": "gelato_selfie_report" -> } -10152c12500,12504 -< "x-expandableFields": [] ---- -> "x-expandableFields": [], -> "x-stripeResource": { -> "class_name": "Document", -> "in_class": "gelato_verification_session_options" -> } -10159c12511,12515 -< "x-expandableFields": [] ---- -> "x-expandableFields": [], -> "x-stripeResource": { -> "class_name": "IdNumber", -> "in_class": "gelato_verification_session_options" -> } -10193a12550,12553 -> "required": [ -> "code", -> "reason" -> ], -10196c12556,12560 -< "x-expandableFields": [] ---- -> "x-expandableFields": [], -> "x-stripeResource": { -> "class_name": "LastError", -> "in_class": "identity.verification_session" -> } -10213c12577,12585 -< ] ---- -> ], -> "x-stripeResource": { -> "class_name": "Options", -> "in_class": "identity.verification_report", -> "inner_classes": [ -> "gelato_report_document_options", -> "gelato_report_id_number_options" -> ] -> } -10230c12602,12610 -< ] ---- -> ], -> "x-stripeResource": { -> "class_name": "Options", -> "in_class": "identity.verification_session", -> "inner_classes": [ -> "gelato_session_document_options", -> "gelato_session_id_number_options" -> ] -> } -10281a12662,12669 -> "required": [ -> "address", -> "dob", -> "first_name", -> "id_number", -> "id_number_type", -> "last_name" -> ], -10287c12675,12682 -< ] ---- -> ], -> "x-stripeResource": { -> "class_name": "VerifiedOutputs", -> "in_class": "identity.verification_session", -> "inner_classes": [ -> "gelato_data_verified_outputs_date" -> ] -> } -10347c12742,12743 -< "type" ---- -> "type", -> "verification_session" -10357c12753,12780 -< "x-resourceId": "identity.verification_report" ---- -> "x-resourceId": "identity.verification_report", -> "x-stripeOperations": [ -> { -> "method_name": "retrieve", -> "method_on": "service", -> "method_type": "retrieve", -> "operation": "get", -> "path": "/v1/identity/verification_reports/{report}" -> }, -> { -> "method_name": "list", -> "method_on": "service", -> "method_type": "list", -> "operation": "get", -> "path": "/v1/identity/verification_reports" -> } -> ], -> "x-stripeResource": { -> "class_name": "VerificationReport", -> "has_collection_class": true, -> "in_package": "Identity", -> "inner_classes": [ -> "gelato_document_report", -> "gelato_id_number_report", -> "gelato_selfie_report", -> "gelato_verification_report_options" -> ] -> } -10473a12897 -> "client_secret", -10475a12900,12901 -> "last_error", -> "last_verification_report", -10479a12906 -> "redaction", -10481c12908,12910 -< "type" ---- -> "type", -> "url", -> "verified_outputs" -10492c12921,12976 -< "x-resourceId": "identity.verification_session" ---- -> "x-resourceId": "identity.verification_session", -> "x-stripeOperations": [ -> { -> "method_name": "create", -> "method_on": "service", -> "method_type": "create", -> "operation": "post", -> "path": "/v1/identity/verification_sessions" -> }, -> { -> "method_name": "retrieve", -> "method_on": "service", -> "method_type": "retrieve", -> "operation": "get", -> "path": "/v1/identity/verification_sessions/{session}" -> }, -> { -> "method_name": "list", -> "method_on": "service", -> "method_type": "list", -> "operation": "get", -> "path": "/v1/identity/verification_sessions" -> }, -> { -> "method_name": "cancel", -> "method_on": "service", -> "method_type": "custom", -> "operation": "post", -> "path": "/v1/identity/verification_sessions/{session}/cancel" -> }, -> { -> "method_name": "redact", -> "method_on": "service", -> "method_type": "custom", -> "operation": "post", -> "path": "/v1/identity/verification_sessions/{session}/redact" -> }, -> { -> "method_name": "update", -> "method_on": "service", -> "method_type": "update", -> "operation": "post", -> "path": "/v1/identity/verification_sessions/{session}" -> } -> ], -> "x-stripeResource": { -> "class_name": "VerificationSession", -> "has_collection_class": true, -> "in_package": "Identity", -> "inner_classes": [ -> "gelato_session_last_error", -> "gelato_verification_session_options", -> "gelato_verified_outputs", -> "verification_session_redaction" -> ] -> } -10521c13005,13012 -< ] ---- -> ], -> "x-stripeResource": { -> "class_name": "OriginPaymentMethodDetails", -> "in_class": "treasury.inbound_transfer", -> "inner_classes": [ -> "inbound_transfers_payment_method_details_us_bank_account" -> ] -> } -10577c13068,13074 -< "network" ---- -> "account_holder_type", -> "account_type", -> "bank_name", -> "fingerprint", -> "last4", -> "network", -> "routing_number" -10581c13078,13082 -< "x-expandableFields": [] ---- -> "x-expandableFields": [], -> "x-stripeResource": { -> "class_name": "UsBankAccount", -> "in_class": "inbound_transfers" -> } -10853,10859c13354 -< "$ref": "#/components/schemas/bank_account" -< }, -< { -< "$ref": "#/components/schemas/card" -< }, -< { -< "$ref": "#/components/schemas/source" ---- -> "$ref": "#/components/schemas/payment_source" -10867,10873c13362 -< "$ref": "#/components/schemas/bank_account" -< }, -< { -< "$ref": "#/components/schemas/card" -< }, -< { -< "$ref": "#/components/schemas/source" ---- -> "$ref": "#/components/schemas/payment_source" -10876,10877c13365 -< }, -< "x-stripeBypassValidation": true ---- -> } -11304a13793,13795 -> "account_country", -> "account_name", -> "account_tax_ids", -11307a13799,13800 -> "application", -> "application_fee_amount", -11310a13804,13805 -> "billing_reason", -> "charge", -11313a13809,13818 -> "custom_fields", -> "customer", -> "customer_address", -> "customer_email", -> "customer_name", -> "customer_phone", -> "customer_shipping", -> "customer_tax_exempt", -> "default_payment_method", -> "default_source", -11314a13820,13828 -> "description", -> "discount", -> "discounts", -> "due_date", -> "ending_balance", -> "footer", -> "from_invoice", -> "last_finalization_error", -> "latest_revision", -11316a13831,13833 -> "metadata", -> "next_payment_attempt", -> "number", -11317a13835 -> "on_behalf_of", -11319a13838 -> "payment_intent", -11324a13844,13846 -> "quote", -> "receipt_number", -> "rendering_options", -11325a13848,13849 -> "statement_descriptor", -> "status", -11326a13851 -> "subscription", -11327a13853,13855 -> "subtotal_excluding_tax", -> "tax", -> "test_clock", -11329c13857,13861 -< "total_tax_amounts" ---- -> "total_discount_amounts", -> "total_excluding_tax", -> "total_tax_amounts", -> "transfer_data", -> "webhooks_delivered_at" -11365c13897,14010 -< "x-resourceId": "invoice" ---- -> "x-resourceId": "invoice", -> "x-stripeOperations": [ -> { -> "method_name": "search", -> "method_on": "service", -> "method_type": "custom", -> "operation": "get", -> "path": "/v1/invoices/search" -> }, -> { -> "method_name": "list", -> "method_on": "service", -> "method_type": "list", -> "operation": "get", -> "path": "/v1/invoices" -> }, -> { -> "method_name": "upcoming", -> "method_on": "service", -> "method_type": "custom", -> "operation": "get", -> "path": "/v1/invoices/upcoming" -> }, -> { -> "method_name": "create", -> "method_on": "service", -> "method_type": "create", -> "operation": "post", -> "path": "/v1/invoices" -> }, -> { -> "method_name": "retrieve", -> "method_on": "service", -> "method_type": "retrieve", -> "operation": "get", -> "path": "/v1/invoices/{invoice}" -> }, -> { -> "method_name": "update", -> "method_on": "service", -> "method_type": "update", -> "operation": "post", -> "path": "/v1/invoices/{invoice}" -> }, -> { -> "method_name": "delete", -> "method_on": "service", -> "method_type": "delete", -> "operation": "delete", -> "path": "/v1/invoices/{invoice}" -> }, -> { -> "method_name": "pay", -> "method_on": "service", -> "method_type": "custom", -> "operation": "post", -> "path": "/v1/invoices/{invoice}/pay" -> }, -> { -> "method_name": "finalize_invoice", -> "method_on": "service", -> "method_type": "custom", -> "operation": "post", -> "path": "/v1/invoices/{invoice}/finalize" -> }, -> { -> "method_name": "upcomingLines", -> "method_on": "service", -> "method_type": "custom", -> "operation": "get", -> "path": "/v1/invoices/upcoming/lines" -> }, -> { -> "method_name": "send_invoice", -> "method_on": "service", -> "method_type": "custom", -> "operation": "post", -> "path": "/v1/invoices/{invoice}/send" -> }, -> { -> "method_name": "mark_uncollectible", -> "method_on": "service", -> "method_type": "custom", -> "operation": "post", -> "path": "/v1/invoices/{invoice}/mark_uncollectible" -> }, -> { -> "method_name": "void_invoice", -> "method_on": "service", -> "method_type": "custom", -> "operation": "post", -> "path": "/v1/invoices/{invoice}/void" -> } -> ], -> "x-stripeResource": { -> "class_name": "Invoice", -> "has_collection_class": true, -> "has_search_result_class": true, -> "in_package": "", -> "inner_classes": [ -> "automatic_tax", -> "invoice_item_threshold_reason", -> "invoice_setting_custom_field", -> "invoice_setting_rendering_options", -> "invoice_tax_amount", -> "invoice_threshold_reason", -> "invoice_transfer_data", -> "invoices_from_invoice", -> "invoices_payment_method_options", -> "invoices_payment_settings", -> "invoices_resource_invoice_tax_id", -> "invoices_status_transitions" -> ] -> } -11375a14021,14023 -> "required": [ -> "enabled" -> ], -11378c14026,14030 -< "x-expandableFields": [] ---- -> "x-expandableFields": [], -> "x-stripeResource": { -> "class_name": "Installments", -> "in_class": "invoice_payment_method_options_card" -> } -11402c14054,14058 -< "x-expandableFields": [] ---- -> "x-expandableFields": [], -> "x-stripeResource": { -> "class_name": "ThresholdItemReason", -> "in_class": "invoice" -> } -11424c14080,14084 -< "x-expandableFields": [] ---- -> "x-expandableFields": [], -> "x-stripeResource": { -> "class_name": "InvoiceLineItemPeriod", -> "in_package": "" -> } -11449a14110,14114 -> "required": [ -> "amount", -> "amount_type", -> "description" -> ], -11452c14117,14121 -< "x-expandableFields": [] ---- -> "x-expandableFields": [], -> "x-stripeResource": { -> "class_name": "MandateOptions", -> "in_class": "subscription_payment_method_options_card" -> } -11475c14144,14151 -< ] ---- -> ], -> "x-stripeResource": { -> "class_name": "AcssDebit", -> "in_class": "invoices_payment_method_options", -> "inner_classes": [ -> "invoice_payment_method_options_acss_debit_mandate_options" -> ] -> } -11489a14166,14168 -> "required": [ -> "transaction_type" -> ], -11492c14171,14175 -< "x-expandableFields": [] ---- -> "x-expandableFields": [], -> "x-stripeResource": { -> "class_name": "MandateOptions", -> "in_class": "invoice_payment_method_options_acss_debit" -> } -11513c14196,14200 -< "x-expandableFields": [] ---- -> "x-expandableFields": [], -> "x-stripeResource": { -> "class_name": "Bancontact", -> "in_class": "invoices_payment_method_options" -> } -11530a14218,14220 -> "required": [ -> "request_three_d_secure" -> ], -11535c14225,14232 -< ] ---- -> ], -> "x-stripeResource": { -> "class_name": "Card", -> "in_class": "invoices_payment_method_options", -> "inner_classes": [ -> "invoice_installments_card" -> ] -> } -11551a14249,14251 -> "required": [ -> "funding_type" -> ], -11556c14256,14263 -< ] ---- -> ], -> "x-stripeResource": { -> "class_name": "CustomerBalance", -> "in_class": "invoices_payment_method_options", -> "inner_classes": [ -> "invoice_payment_method_options_customer_balance_bank_transfer" -> ] -> } -11569a14277,14279 -> "required": [ -> "type" -> ], -11574c14284,14291 -< ] ---- -> ], -> "x-stripeResource": { -> "class_name": "BankTransfer", -> "in_class": "invoice_payment_method_options_customer_balance", -> "inner_classes": [ -> "invoice_payment_method_options_customer_balance_bank_transfer_eu_bank_transfer" -> ] -> } -11596c14313,14317 -< "x-expandableFields": [] ---- -> "x-expandableFields": [], -> "x-stripeResource": { -> "class_name": "EuBankTransfer", -> "in_class": "invoice_payment_method_options_customer_balance_bank_transfer" -> } -11603c14324,14328 -< "x-expandableFields": [] ---- -> "x-expandableFields": [], -> "x-stripeResource": { -> "class_name": "Konbini", -> "in_class": "invoices_payment_method_options" -> } -11626c14351,14358 -< ] ---- -> ], -> "x-stripeResource": { -> "class_name": "UsBankAccount", -> "in_class": "invoices_payment_method_options", -> "inner_classes": [ -> "invoice_payment_method_options_us_bank_account_linked_account_options" -> ] -> } -11647c14379,14383 -< "x-expandableFields": [] ---- -> "x-expandableFields": [], -> "x-stripeResource": { -> "class_name": "FinancialConnections", -> "in_class": "invoice_payment_method_options_us_bank_account" -> } -11669c14405,14409 -< "x-expandableFields": [] ---- -> "x-expandableFields": [], -> "x-stripeResource": { -> "class_name": "CustomField", -> "in_class": "invoice" -> } -11717a14458,14463 -> "required": [ -> "custom_fields", -> "default_payment_method", -> "footer", -> "rendering_options" -> ], -11724c14470,14474 -< ] ---- -> ], -> "x-stripeResource": { -> "class_name": "InvoiceSettings", -> "in_class": "customer" -> } -11734a14485,14487 -> "required": [ -> "days_until_due" -> ], -11737c14490,14494 -< "x-expandableFields": [] ---- -> "x-expandableFields": [], -> "x-stripeResource": { -> "class_name": "InvoiceSettings", -> "in_class": "quote" -> } -11748a14506,14508 -> "required": [ -> "amount_tax_display" -> ], -11751c14511,14515 -< "x-expandableFields": [] ---- -> "x-expandableFields": [], -> "x-stripeResource": { -> "class_name": "RenderingOptions", -> "in_class": "invoice" -> } -11761a14526,14528 -> "required": [ -> "days_until_due" -> ], -11764c14531,14535 -< "x-expandableFields": [] ---- -> "x-expandableFields": [], -> "x-stripeResource": { -> "class_name": "InvoiceSettings", -> "in_class": "subscription_schedule" -> } -11806c14577,14581 -< ] ---- -> ], -> "x-stripeResource": { -> "class_name": "TaxAmount", -> "in_class": "invoice" -> } -11824a14600 -> "amount_gte", -11831c14607,14611 -< ] ---- -> ], -> "x-stripeResource": { -> "class_name": "ThresholdReason", -> "in_class": "invoice" -> } -11861a14642 -> "amount", -11868c14649,14653 -< ] ---- -> ], -> "x-stripeResource": { -> "class_name": "TransferData", -> "in_class": "invoice" -> } -11991a14777,14785 -> "plan": { -> "anyOf": [ -> { -> "$ref": "#/components/schemas/plan" -> } -> ], -> "description": "If the invoice item is a proration, the plan of the subscription that the proration was computed for.", -> "nullable": true -> }, -12078a14873 -> "description", -12079a14875 -> "discounts", -12080a14877 -> "invoice", -12081a14879 -> "metadata", -12083a14882,14883 -> "plan", -> "price", -12085c14885,14890 -< "quantity" ---- -> "quantity", -> "subscription", -> "tax_rates", -> "test_clock", -> "unit_amount", -> "unit_amount_decimal" -12093a14899 -> "plan", -12099c14905,14947 -< "x-resourceId": "invoiceitem" ---- -> "x-resourceId": "invoiceitem", -> "x-stripeOperations": [ -> { -> "method_name": "list", -> "method_on": "service", -> "method_type": "list", -> "operation": "get", -> "path": "/v1/invoiceitems" -> }, -> { -> "method_name": "create", -> "method_on": "service", -> "method_type": "create", -> "operation": "post", -> "path": "/v1/invoiceitems" -> }, -> { -> "method_name": "retrieve", -> "method_on": "service", -> "method_type": "retrieve", -> "operation": "get", -> "path": "/v1/invoiceitems/{invoiceitem}" -> }, -> { -> "method_name": "update", -> "method_on": "service", -> "method_type": "update", -> "operation": "post", -> "path": "/v1/invoiceitems/{invoiceitem}" -> }, -> { -> "method_name": "delete", -> "method_on": "service", -> "method_type": "delete", -> "operation": "delete", -> "path": "/v1/invoiceitems/{invoiceitem}" -> } -> ], -> "x-stripeResource": { -> "class_name": "InvoiceItem", -> "has_collection_class": true, -> "in_package": "" -> } -12137c14985,14989 -< ] ---- -> ], -> "x-stripeResource": { -> "class_name": "FromInvoice", -> "in_class": "invoice" -> } -12162c15014,15018 -< "x-expandableFields": [] ---- -> "x-expandableFields": [], -> "x-stripeResource": { -> "class_name": "CreditedItems", -> "in_package": "" -> } -12176a15033,15035 -> "required": [ -> "credited_items" -> ], -12181c15040,15044 -< ] ---- -> ], -> "x-stripeResource": { -> "class_name": "ProrationDetails", -> "in_package": "" -> } -12240a15104,15111 -> "required": [ -> "acss_debit", -> "bancontact", -> "card", -> "customer_balance", -> "konbini", -> "us_bank_account" -> ], -12250c15121,15133 -< ] ---- -> ], -> "x-stripeResource": { -> "class_name": "PaymentMethodOptions", -> "in_class": "invoice", -> "inner_classes": [ -> "invoice_payment_method_options_acss_debit", -> "invoice_payment_method_options_bancontact", -> "invoice_payment_method_options_card", -> "invoice_payment_method_options_customer_balance", -> "invoice_payment_method_options_konbini", -> "invoice_payment_method_options_us_bank_account" -> ] -> } -12290a15174 -> "sepa_credit_transfer", -12302a15187,15191 -> "required": [ -> "default_mandate", -> "payment_method_options", -> "payment_method_types" -> ], -12307c15196,15200 -< ] ---- -> ], -> "x-stripeResource": { -> "class_name": "PaymentSettings", -> "in_class": "invoice" -> } -12378c15271,15272 -< "type" ---- -> "type", -> "value" -12382c15276,15280 -< "x-expandableFields": [] ---- -> "x-expandableFields": [], -> "x-stripeResource": { -> "class_name": "CustomerTaxId", -> "in_class": "invoice" -> } -12411a15310,15315 -> "required": [ -> "finalized_at", -> "marked_uncollectible_at", -> "paid_at", -> "voided_at" -> ], -12414c15318,15322 -< "x-expandableFields": [] ---- -> "x-expandableFields": [], -> "x-stripeResource": { -> "class_name": "StatusTransitions", -> "in_class": "invoice" -> } -12582a15491 -> "amount_details", -12586a15496 -> "cardholder", -12594a15505 -> "network_data", -12595a15507 -> "pending_request", -12599c15511,15512 -< "verification_data" ---- -> "verification_data", -> "wallet" -12616c15529,15583 -< "x-resourceId": "issuing.authorization" ---- -> "x-resourceId": "issuing.authorization", -> "x-stripeOperations": [ -> { -> "method_name": "list", -> "method_on": "service", -> "method_type": "list", -> "operation": "get", -> "path": "/v1/issuing/authorizations" -> }, -> { -> "method_name": "retrieve", -> "method_on": "service", -> "method_type": "retrieve", -> "operation": "get", -> "path": "/v1/issuing/authorizations/{authorization}" -> }, -> { -> "method_name": "update", -> "method_on": "service", -> "method_type": "update", -> "operation": "post", -> "path": "/v1/issuing/authorizations/{authorization}" -> }, -> { -> "method_name": "approve", -> "method_on": "service", -> "method_type": "custom", -> "operation": "post", -> "path": "/v1/issuing/authorizations/{authorization}/approve" -> }, -> { -> "method_name": "decline", -> "method_on": "service", -> "method_type": "custom", -> "operation": "post", -> "path": "/v1/issuing/authorizations/{authorization}/decline" -> } -> ], -> "x-stripeResource": { -> "class_name": "Authorization", -> "has_collection_class": true, -> "in_package": "Issuing", -> "inner_classes": [ -> "issuing_authorization_amount_details", -> "issuing_authorization_merchant_data", -> "issuing_authorization_network_data", -> "issuing_authorization_pending_request", -> "issuing_authorization_request", -> "issuing_authorization_treasury", -> "issuing_authorization_verification_data" -> ], -> "polymorphic_groups": [ -> "balance_transaction_source" -> ] -> } -12794a15762 -> "cancellation_reason", -12804a15773,15776 -> "replaced_by", -> "replacement_for", -> "replacement_reason", -> "shipping", -12807c15779,15780 -< "type" ---- -> "type", -> "wallets" -12819c15792,15860 -< "x-resourceId": "issuing.card" ---- -> "x-resourceId": "issuing.card", -> "x-stripeOperations": [ -> { -> "method_name": "list", -> "method_on": "service", -> "method_type": "list", -> "operation": "get", -> "path": "/v1/issuing/cards" -> }, -> { -> "method_name": "create", -> "method_on": "service", -> "method_type": "create", -> "operation": "post", -> "path": "/v1/issuing/cards" -> }, -> { -> "method_name": "retrieve", -> "method_on": "service", -> "method_type": "retrieve", -> "operation": "get", -> "path": "/v1/issuing/cards/{card}" -> }, -> { -> "method_name": "update", -> "method_on": "service", -> "method_type": "update", -> "operation": "post", -> "path": "/v1/issuing/cards/{card}" -> }, -> { -> "method_name": "deliver_card", -> "method_on": "service", -> "method_type": "custom", -> "operation": "post", -> "path": "/v1/test_helpers/issuing/cards/{card}/shipping/deliver" -> }, -> { -> "method_name": "ship_card", -> "method_on": "service", -> "method_type": "custom", -> "operation": "post", -> "path": "/v1/test_helpers/issuing/cards/{card}/shipping/ship" -> }, -> { -> "method_name": "return_card", -> "method_on": "service", -> "method_type": "custom", -> "operation": "post", -> "path": "/v1/test_helpers/issuing/cards/{card}/shipping/return" -> }, -> { -> "method_name": "fail_card", -> "method_on": "service", -> "method_type": "custom", -> "operation": "post", -> "path": "/v1/test_helpers/issuing/cards/{card}/shipping/fail" -> } -> ], -> "x-stripeResource": { -> "class_name": "Card", -> "has_collection_class": true, -> "in_package": "Issuing", -> "inner_classes": [ -> "issuing_card_authorization_controls", -> "issuing_card_shipping", -> "issuing_card_wallets" -> ] -> } -12923a15965 -> "company", -12924a15967 -> "email", -12925a15969 -> "individual", -12929a15974 -> "phone_number", -12930a15976 -> "spending_controls", -12943c15989,16031 -< "x-resourceId": "issuing.cardholder" ---- -> "x-resourceId": "issuing.cardholder", -> "x-stripeOperations": [ -> { -> "method_name": "list", -> "method_on": "service", -> "method_type": "list", -> "operation": "get", -> "path": "/v1/issuing/cardholders" -> }, -> { -> "method_name": "create", -> "method_on": "service", -> "method_type": "create", -> "operation": "post", -> "path": "/v1/issuing/cardholders" -> }, -> { -> "method_name": "retrieve", -> "method_on": "service", -> "method_type": "retrieve", -> "operation": "get", -> "path": "/v1/issuing/cardholders/{cardholder}" -> }, -> { -> "method_name": "update", -> "method_on": "service", -> "method_type": "update", -> "operation": "post", -> "path": "/v1/issuing/cardholders/{cardholder}" -> } -> ], -> "x-stripeResource": { -> "class_name": "Cardholder", -> "has_collection_class": true, -> "in_package": "Issuing", -> "inner_classes": [ -> "issuing_cardholder_address", -> "issuing_cardholder_authorization_controls", -> "issuing_cardholder_company", -> "issuing_cardholder_individual", -> "issuing_cardholder_requirements" -> ] -> } -13037a16126 -> "balance_transactions", -13056,13162c16145,16194 -< "x-resourceId": "issuing.dispute" -< }, -< "issuing.settlement": { -< "description": "When a non-stripe BIN is used, any use of an [issued card](https://stripe.com/docs/issuing) must be settled directly with the card network. The net amount owed is represented by an Issuing `Settlement` object.", -< "properties": { -< "bin": { -< "description": "The Bank Identification Number reflecting this settlement record.", -< "maxLength": 5000, -< "type": "string" -< }, -< "clearing_date": { -< "description": "The date that the transactions are cleared and posted to user's accounts.", -< "type": "integer" -< }, -< "created": { -< "description": "Time at which the object was created. Measured in seconds since the Unix epoch.", -< "format": "unix-time", -< "type": "integer" -< }, -< "currency": { -< "description": "Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. Must be a [supported currency](https://stripe.com/docs/currencies).", -< "type": "string" -< }, -< "id": { -< "description": "Unique identifier for the object.", -< "maxLength": 5000, -< "type": "string" -< }, -< "interchange_fees": { -< "description": "The total interchange received as reimbursement for the transactions.", -< "type": "integer" -< }, -< "livemode": { -< "description": "Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode.", -< "type": "boolean" -< }, -< "metadata": { -< "additionalProperties": { -< "maxLength": 500, -< "type": "string" -< }, -< "description": "Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format.", -< "type": "object" -< }, -< "net_total": { -< "description": "The total net amount required to settle with the network.", -< "type": "integer" -< }, -< "network": { -< "description": "The card network for this settlement report. One of [\"visa\"]", -< "enum": [ -< "visa" -< ], -< "type": "string" -< }, -< "network_fees": { -< "description": "The total amount of fees owed to the network.", -< "type": "integer" -< }, -< "network_settlement_identifier": { -< "description": "The Settlement Identification Number assigned by the network.", -< "maxLength": 5000, -< "type": "string" -< }, -< "object": { -< "description": "String representing the object's type. Objects of the same type share the same value.", -< "enum": [ -< "issuing.settlement" -< ], -< "type": "string" -< }, -< "settlement_service": { -< "description": "One of `international` or `uk_national_net`.", -< "maxLength": 5000, -< "type": "string" -< }, -< "transaction_count": { -< "description": "The total number of transactions reflected in this settlement.", -< "type": "integer" -< }, -< "transaction_volume": { -< "description": "The total transaction amount reflected in this settlement.", -< "type": "integer" -< } -< }, -< "required": [ -< "bin", -< "clearing_date", -< "created", -< "currency", -< "id", -< "interchange_fees", -< "livemode", -< "metadata", -< "net_total", -< "network", -< "network_fees", -< "network_settlement_identifier", -< "object", -< "settlement_service", -< "transaction_count", -< "transaction_volume" -< ], -< "title": "IssuingSettlement", -< "type": "object", -< "x-expandableFields": [], -< "x-resourceId": "issuing.settlement" ---- -> "x-resourceId": "issuing.dispute", -> "x-stripeOperations": [ -> { -> "method_name": "list", -> "method_on": "service", -> "method_type": "list", -> "operation": "get", -> "path": "/v1/issuing/disputes" -> }, -> { -> "method_name": "create", -> "method_on": "service", -> "method_type": "create", -> "operation": "post", -> "path": "/v1/issuing/disputes" -> }, -> { -> "method_name": "update", -> "method_on": "service", -> "method_type": "update", -> "operation": "post", -> "path": "/v1/issuing/disputes/{dispute}" -> }, -> { -> "method_name": "retrieve", -> "method_on": "service", -> "method_type": "retrieve", -> "operation": "get", -> "path": "/v1/issuing/disputes/{dispute}" -> }, -> { -> "method_name": "submit", -> "method_on": "service", -> "method_type": "custom", -> "operation": "post", -> "path": "/v1/issuing/disputes/{dispute}/submit" -> } -> ], -> "x-stripeResource": { -> "class_name": "Dispute", -> "has_collection_class": true, -> "in_package": "Issuing", -> "inner_classes": [ -> "issuing_dispute_evidence", -> "issuing_dispute_treasury" -> ], -> "polymorphic_groups": [ -> "balance_transaction_source" -> ] -> } -13362a16395,16397 -> "amount_details", -> "authorization", -> "balance_transaction", -13363a16399 -> "cardholder", -13365a16402 -> "dispute", -13373c16410,16412 -< "type" ---- -> "purchase_details", -> "type", -> "wallet" -13388c16427,16463 -< "x-resourceId": "issuing.transaction" ---- -> "x-resourceId": "issuing.transaction", -> "x-stripeOperations": [ -> { -> "method_name": "list", -> "method_on": "service", -> "method_type": "list", -> "operation": "get", -> "path": "/v1/issuing/transactions" -> }, -> { -> "method_name": "retrieve", -> "method_on": "service", -> "method_type": "retrieve", -> "operation": "get", -> "path": "/v1/issuing/transactions/{transaction}" -> }, -> { -> "method_name": "update", -> "method_on": "service", -> "method_type": "update", -> "operation": "post", -> "path": "/v1/issuing/transactions/{transaction}" -> } -> ], -> "x-stripeResource": { -> "class_name": "Transaction", -> "has_collection_class": true, -> "in_package": "Issuing", -> "inner_classes": [ -> "issuing_transaction_amount_details", -> "issuing_transaction_purchase_details", -> "issuing_transaction_treasury" -> ], -> "polymorphic_groups": [ -> "balance_transaction_source" -> ] -> } -13398a16474,16476 -> "required": [ -> "atm_fee" -> ], -13401c16479,16483 -< "x-expandableFields": [] ---- -> "x-expandableFields": [], -> "x-stripeResource": { -> "class_name": "AmountDetails", -> "in_class": "issuing.authorization" -> } -13455c16537,16542 -< "network_id" ---- -> "city", -> "country", -> "name", -> "network_id", -> "postal_code", -> "state" -13459c16546,16550 -< "x-expandableFields": [] ---- -> "x-expandableFields": [], -> "x-stripeResource": { -> "class_name": "MerchantData", -> "in_class": "issuing.authorization" -> } -13470a16562,16564 -> "required": [ -> "acquiring_institution_id" -> ], -13473c16567,16571 -< "x-expandableFields": [] ---- -> "x-expandableFields": [], -> "x-stripeResource": { -> "class_name": "NetworkData", -> "in_class": "issuing.authorization" -> } -13509a16608 -> "amount_details", -13519c16618,16622 -< ] ---- -> ], -> "x-stripeResource": { -> "class_name": "PendingRequest", -> "in_class": "issuing.authorization" -> } -13589a16693 -> "amount_details", -13595c16699,16700 -< "reason" ---- -> "reason", -> "reason_message" -13601c16706,16710 -< ] ---- -> ], -> "x-stripeResource": { -> "class_name": "RequestHistory", -> "in_class": "issuing.authorization" -> } -13631c16740,16741 -< "received_debits" ---- -> "received_debits", -> "transaction" -13635c16745,16749 -< "x-expandableFields": [] ---- -> "x-expandableFields": [], -> "x-stripeResource": { -> "class_name": "Treasury", -> "in_class": "issuing.authorization" -> } -13685c16799,16803 -< "x-expandableFields": [] ---- -> "x-expandableFields": [], -> "x-stripeResource": { -> "class_name": "VerificationData", -> "in_class": "issuing.authorization" -> } -13706c16824,16825 -< "eligible" ---- -> "eligible", -> "ineligible_reason" -13710c16829,16833 -< "x-expandableFields": [] ---- -> "x-expandableFields": [], -> "x-stripeResource": { -> "class_name": "ApplePay", -> "in_class": "issuing_card_wallets" -> } -14324a17448,17453 -> "required": [ -> "allowed_categories", -> "blocked_categories", -> "spending_limits", -> "spending_limits_currency" -> ], -14329c17458,17465 -< ] ---- -> ], -> "x-stripeResource": { -> "class_name": "SpendingControls", -> "in_class": "issuing.card", -> "inner_classes": [ -> "issuing_card_spending_limit" -> ] -> } -14350c17486,17487 -< "eligible" ---- -> "eligible", -> "ineligible_reason" -14354c17491,17495 -< "x-expandableFields": [] ---- -> "x-expandableFields": [], -> "x-stripeResource": { -> "class_name": "GooglePay", -> "in_class": "issuing_card_wallets" -> } -14449a17591,17593 -> "carrier", -> "customs", -> "eta", -14450a17595,17596 -> "phone_number", -> "require_signature", -14451a17598,17600 -> "status", -> "tracking_number", -> "tracking_url", -14459c17608,17615 -< ] ---- -> ], -> "x-stripeResource": { -> "class_name": "Shipping", -> "in_class": "issuing.card", -> "inner_classes": [ -> "issuing_card_shipping_customs" -> ] -> } -14470a17627,17629 -> "required": [ -> "eori_number" -> ], -14473c17632,17636 -< "x-expandableFields": [] ---- -> "x-expandableFields": [], -> "x-stripeResource": { -> "class_name": "Customs", -> "in_class": "issuing_card_shipping" -> } -14794a17958 -> "categories", -14799c17963,17967 -< "x-expandableFields": [] ---- -> "x-expandableFields": [], -> "x-stripeResource": { -> "class_name": "SpendingLimit", -> "in_class": "issuing_card_authorization_controls" -> } -14819c17987,17988 -< "google_pay" ---- -> "google_pay", -> "primary_account_identifier" -14826c17995,18003 -< ] ---- -> ], -> "x-stripeResource": { -> "class_name": "Wallets", -> "in_class": "issuing.card", -> "inner_classes": [ -> "issuing_card_apple_pay", -> "issuing_card_google_pay" -> ] -> } -14842c18019,18023 -< ] ---- -> ], -> "x-stripeResource": { -> "class_name": "Billing", -> "in_class": "issuing.cardholder" -> } -15456a18638,18643 -> "required": [ -> "allowed_categories", -> "blocked_categories", -> "spending_limits", -> "spending_limits_currency" -> ], -15461c18648,18655 -< ] ---- -> ], -> "x-stripeResource": { -> "class_name": "SpendingControls", -> "in_class": "issuing.cardholder", -> "inner_classes": [ -> "issuing_cardholder_spending_limit" -> ] -> } -15476c18670,18674 -< "x-expandableFields": [] ---- -> "x-expandableFields": [], -> "x-stripeResource": { -> "class_name": "Company", -> "in_class": "issuing.cardholder" -> } -15521a18720,18723 -> "required": [ -> "back", -> "front" -> ], -15527c18729,18733 -< ] ---- -> ], -> "x-stripeResource": { -> "class_name": "Document", -> "in_class": "issuing_cardholder_verification" -> } -15561a18768 -> "dob", -15563c18770,18771 -< "last_name" ---- -> "last_name", -> "verification" -15570c18778,18786 -< ] ---- -> ], -> "x-stripeResource": { -> "class_name": "Individual", -> "in_class": "issuing.cardholder", -> "inner_classes": [ -> "issuing_cardholder_individual_dob", -> "issuing_cardholder_verification" -> ] -> } -15590a18807,18811 -> "required": [ -> "day", -> "month", -> "year" -> ], -15593c18814,18818 -< "x-expandableFields": [] ---- -> "x-expandableFields": [], -> "x-stripeResource": { -> "class_name": "DateOfBirth", -> "in_class": "issuing_cardholder_individual" -> } -15626a18852,18855 -> "required": [ -> "disabled_reason", -> "past_due" -> ], -15629c18858,18862 -< "x-expandableFields": [] ---- -> "x-expandableFields": [], -> "x-stripeResource": { -> "class_name": "Requirements", -> "in_class": "issuing.cardholder" -> } -15950a19184 -> "categories", -15955c19189,19193 -< "x-expandableFields": [] ---- -> "x-expandableFields": [], -> "x-stripeResource": { -> "class_name": "SpendingLimit", -> "in_class": "issuing_cardholder_authorization_controls" -> } -15969a19208,19210 -> "required": [ -> "document" -> ], -15974c19215,19222 -< ] ---- -> ], -> "x-stripeResource": { -> "class_name": "Verification", -> "in_class": "issuing_cardholder_individual", -> "inner_classes": [ -> "issuing_cardholder_id_document" -> ] -> } -16058a19307,19318 -> "required": [ -> "additional_documentation", -> "canceled_at", -> "cancellation_policy_provided", -> "cancellation_reason", -> "expected_at", -> "explanation", -> "product_description", -> "product_type", -> "return_status", -> "returned_at" -> ], -16063c19323,19327 -< ] ---- -> ], -> "x-stripeResource": { -> "class_name": "Canceled", -> "in_class": "issuing_dispute_evidence" -> } -16160a19425,19432 -> "required": [ -> "additional_documentation", -> "card_statement", -> "cash_receipt", -> "check_image", -> "explanation", -> "original_transaction" -> ], -16168c19440,19444 -< ] ---- -> ], -> "x-stripeResource": { -> "class_name": "Duplicate", -> "in_class": "issuing_dispute_evidence" -> } -16222c19498,19511 -< ] ---- -> ], -> "x-stripeResource": { -> "class_name": "Evidence", -> "in_class": "issuing.dispute", -> "inner_classes": [ -> "issuing_dispute_canceled_evidence", -> "issuing_dispute_duplicate_evidence", -> "issuing_dispute_fraudulent_evidence", -> "issuing_dispute_merchandise_not_as_described_evidence", -> "issuing_dispute_not_received_evidence", -> "issuing_dispute_other_evidence", -> "issuing_dispute_service_not_as_described_evidence" -> ] -> } -16253a19543,19546 -> "required": [ -> "additional_documentation", -> "explanation" -> ], -16258c19551,19555 -< ] ---- -> ], -> "x-stripeResource": { -> "class_name": "Fraudulent", -> "in_class": "issuing_dispute_evidence" -> } -16316a19614,19621 -> "required": [ -> "additional_documentation", -> "explanation", -> "received_at", -> "return_description", -> "return_status", -> "returned_at" -> ], -16321c19626,19630 -< ] ---- -> ], -> "x-stripeResource": { -> "class_name": "MerchandiseNotAsDescribed", -> "in_class": "issuing_dispute_evidence" -> } -16373a19683,19689 -> "required": [ -> "additional_documentation", -> "expected_at", -> "explanation", -> "product_description", -> "product_type" -> ], -16378c19694,19698 -< ] ---- -> ], -> "x-stripeResource": { -> "class_name": "NotReceived", -> "in_class": "issuing_dispute_evidence" -> } -16424a19745,19750 -> "required": [ -> "additional_documentation", -> "explanation", -> "product_description", -> "product_type" -> ], -16429c19755,19759 -< ] ---- -> ], -> "x-stripeResource": { -> "class_name": "Other", -> "in_class": "issuing_dispute_evidence" -> } -16478a19809,19815 -> "required": [ -> "additional_documentation", -> "canceled_at", -> "cancellation_reason", -> "explanation", -> "received_at" -> ], -16483c19820,19824 -< ] ---- -> ], -> "x-stripeResource": { -> "class_name": "ServiceNotAsDescribed", -> "in_class": "issuing_dispute_evidence" -> } -16500a19842 -> "debit_reversal", -16505c19847,19851 -< "x-expandableFields": [] ---- -> "x-expandableFields": [], -> "x-stripeResource": { -> "class_name": "Treasury", -> "in_class": "issuing.dispute" -> } -16515a19862,19864 -> "required": [ -> "atm_fee" -> ], -16518c19867,19871 -< "x-expandableFields": [] ---- -> "x-expandableFields": [], -> "x-stripeResource": { -> "class_name": "AmountDetails", -> "in_class": "issuing.transaction" -> } -16553a19907,19913 -> "required": [ -> "departure_at", -> "passenger_name", -> "refundable", -> "segments", -> "travel_agency" -> ], -16558c19918,19925 -< ] ---- -> ], -> "x-stripeResource": { -> "class_name": "Flight", -> "in_class": "issuing_transaction_purchase_details", -> "inner_classes": [ -> "issuing_transaction_flight_data_leg" -> ] -> } -16598a19966,19973 -> "required": [ -> "arrival_airport_code", -> "carrier", -> "departure_airport_code", -> "flight_number", -> "service_class", -> "stopover_allowed" -> ], -16601c19976,19980 -< "x-expandableFields": [] ---- -> "x-expandableFields": [], -> "x-stripeResource": { -> "class_name": "Segments", -> "in_class": "issuing_transaction_flight_data" -> } -16631c20010,20011 -< "unit_cost_decimal" ---- -> "unit_cost_decimal", -> "volume_decimal" -16635c20015,20019 -< "x-expandableFields": [] ---- -> "x-expandableFields": [], -> "x-stripeResource": { -> "class_name": "Fuel", -> "in_class": "issuing_transaction_purchase_details" -> } -16650a20035,20038 -> "required": [ -> "check_in_at", -> "nights" -> ], -16653c20041,20045 -< "x-expandableFields": [] ---- -> "x-expandableFields": [], -> "x-stripeResource": { -> "class_name": "Lodging", -> "in_class": "issuing_transaction_purchase_details" -> } -16699a20092,20098 -> "required": [ -> "flight", -> "fuel", -> "lodging", -> "receipt", -> "reference" -> ], -16707c20106,20116 -< ] ---- -> ], -> "x-stripeResource": { -> "class_name": "PurchaseDetails", -> "in_class": "issuing.transaction", -> "inner_classes": [ -> "issuing_transaction_flight_data", -> "issuing_transaction_fuel_data", -> "issuing_transaction_lodging_data", -> "issuing_transaction_receipt_data" -> ] -> } -16733a20143,20148 -> "required": [ -> "description", -> "quantity", -> "total", -> "unit_cost" -> ], -16736c20151,20155 -< "x-expandableFields": [] ---- -> "x-expandableFields": [], -> "x-stripeResource": { -> "class_name": "Receipt", -> "in_class": "issuing_transaction_purchase_details" -> } -16753a20173,20176 -> "required": [ -> "received_credit", -> "received_debit" -> ], -16756c20179,20183 -< "x-expandableFields": [] ---- -> "x-expandableFields": [], -> "x-stripeResource": { -> "class_name": "Treasury", -> "in_class": "issuing.transaction" -> } -16860c20287,20289 -< "object" ---- -> "object", -> "price", -> "quantity" -16870c20299,20308 -< "x-resourceId": "item" ---- -> "x-resourceId": "item", -> "x-stripeResource": { -> "class_name": "LineItem", -> "has_collection_class": true, -> "in_package": "", -> "inner_classes": [ -> "line_items_discount_amount", -> "line_items_tax_amount" -> ] -> } -16999c20437,20445 -< ] ---- -> ], -> "x-stripeResource": { -> "class_name": "Company", -> "in_class": "account", -> "inner_classes": [ -> "legal_entity_company_verification", -> "legal_entity_ubo_declaration" -> ] -> } -17015c20461,20468 -< ] ---- -> ], -> "x-stripeResource": { -> "class_name": "Verification", -> "in_class": "legal_entity_company", -> "inner_classes": [ -> "legal_entity_company_verification_document" -> ] -> } -17072a20526,20531 -> "required": [ -> "back", -> "details", -> "details_code", -> "front" -> ], -17078c20537,20541 -< ] ---- -> ], -> "x-stripeResource": { -> "class_name": "VerificationDocument", -> "in_class": "legal_entity_company_verification" -> } -17098a20562,20566 -> "required": [ -> "day", -> "month", -> "year" -> ], -17101c20569,20573 -< "x-expandableFields": [] ---- -> "x-expandableFields": [], -> "x-stripeResource": { -> "class_name": "DateOfBirth", -> "in_class": "person" -> } -17148a20621,20629 -> "required": [ -> "city", -> "country", -> "line1", -> "line2", -> "postal_code", -> "state", -> "town" -> ], -17151c20632,20636 -< "x-expandableFields": [] ---- -> "x-expandableFields": [], -> "x-stripeResource": { -> "class_name": "JapanAddress", -> "in_class": "person" -> } -17194c20679,20683 -< ] ---- -> ], -> "x-stripeResource": { -> "class_name": "Verification", -> "in_class": "person" -> } -17251a20741,20746 -> "required": [ -> "back", -> "details", -> "details_code", -> "front" -> ], -17257c20752,20756 -< ] ---- -> ], -> "x-stripeResource": { -> "class_name": "VerificationDocument", -> "in_class": "person" -> } -17280a20780,20784 -> "required": [ -> "date", -> "ip", -> "user_agent" -> ], -17283c20787,20881 -< "x-expandableFields": [] ---- -> "x-expandableFields": [], -> "x-stripeResource": { -> "class_name": "OwnershipDeclaration", -> "in_class": "legal_entity_company" -> } -> }, -> "level3": { -> "description": "", -> "properties": { -> "customer_reference": { -> "maxLength": 5000, -> "type": "string" -> }, -> "line_items": { -> "items": { -> "$ref": "#/components/schemas/level3_line_items" -> }, -> "type": "array" -> }, -> "merchant_reference": { -> "maxLength": 5000, -> "type": "string" -> }, -> "shipping_address_zip": { -> "maxLength": 5000, -> "type": "string" -> }, -> "shipping_amount": { -> "type": "integer" -> }, -> "shipping_from_zip": { -> "maxLength": 5000, -> "type": "string" -> } -> }, -> "required": [ -> "line_items", -> "merchant_reference" -> ], -> "title": "Level3", -> "type": "object", -> "x-expandableFields": [ -> "line_items" -> ], -> "x-stripeResource": { -> "class_name": "Level3", -> "in_class": "charge", -> "inner_classes": [ -> "level3_line_items" -> ] -> } -> }, -> "level3_line_items": { -> "description": "", -> "properties": { -> "discount_amount": { -> "nullable": true, -> "type": "integer" -> }, -> "product_code": { -> "maxLength": 5000, -> "type": "string" -> }, -> "product_description": { -> "maxLength": 5000, -> "type": "string" -> }, -> "quantity": { -> "nullable": true, -> "type": "integer" -> }, -> "tax_amount": { -> "nullable": true, -> "type": "integer" -> }, -> "unit_cost": { -> "nullable": true, -> "type": "integer" -> } -> }, -> "required": [ -> "discount_amount", -> "product_code", -> "product_description", -> "quantity", -> "tax_amount", -> "unit_cost" -> ], -> "title": "Level3LineItems", -> "type": "object", -> "x-expandableFields": [], -> "x-stripeResource": { -> "class_name": "LineItem", -> "in_class": "level3" -> } -17373a20972,20980 -> "plan": { -> "anyOf": [ -> { -> "$ref": "#/components/schemas/plan" -> } -> ], -> "description": "The plan of the subscription, if the line item is a subscription or a proration.", -> "nullable": true -> }, -17442a21050 -> "amount_excluding_tax", -17443a21052,21053 -> "description", -> "discount_amounts", -17444a21055 -> "discounts", -17449a21061,21062 -> "plan", -> "price", -17451c21064,21068 -< "type" ---- -> "proration_details", -> "quantity", -> "subscription", -> "type", -> "unit_amount_excluding_tax" -17458a21076 -> "plan", -17464c21082,21103 -< "x-resourceId": "line_item" ---- -> "x-resourceId": "line_item", -> "x-stripeOperations": [ -> { -> "method_name": "list", -> "method_on": "collection", -> "method_type": "list", -> "operation": "get", -> "path": "/v1/invoices/{invoice}/lines" -> }, -> { -> "method_name": "list", -> "method_on": "service", -> "method_type": "list", -> "operation": "get", -> "path": "/v1/invoices/{invoice}/lines" -> } -> ], -> "x-stripeResource": { -> "class_name": "InvoiceLineItem", -> "has_collection_class": true, -> "in_package": "" -> } -17485c21124,21128 -< ] ---- -> ], -> "x-stripeResource": { -> "class_name": "Discount", -> "in_class": "item" -> } -17506c21149,21153 -< ] ---- -> ], -> "x-stripeResource": { -> "class_name": "Tax", -> "in_class": "item" -> } -17532c21179,21183 -< "x-expandableFields": [] ---- -> "x-expandableFields": [], -> "x-stripeResource": { -> "class_name": "FinancialConnections", -> "in_class": "payment_intent_payment_method_options_us_bank_account" -> } -17563c21214,21227 -< "x-resourceId": "login_link" ---- -> "x-resourceId": "login_link", -> "x-stripeOperations": [ -> { -> "method_name": "create", -> "method_on": "service", -> "method_type": "custom", -> "operation": "post", -> "path": "/v1/accounts/{account}/login_links" -> } -> ], -> "x-stripeResource": { -> "class_name": "LoginLink", -> "in_package": "" -> } -17652c21316,21337 -< "x-resourceId": "mandate" ---- -> "x-resourceId": "mandate", -> "x-stripeOperations": [ -> { -> "method_name": "retrieve", -> "method_on": "service", -> "method_type": "retrieve", -> "operation": "get", -> "path": "/v1/mandates/{mandate}" -> } -> ], -> "x-stripeResource": { -> "class_name": "Mandate", -> "in_package": "", -> "inner_classes": [ -> "customer_acceptance", -> "mandate_au_becs_debit", -> "mandate_bacs_debit", -> "mandate_multi_use", -> "mandate_payment_method_details", -> "mandate_single_use" -> ] -> } -17692a21378 -> "interval_description", -17698c21384,21388 -< "x-expandableFields": [] ---- -> "x-expandableFields": [], -> "x-stripeResource": { -> "class_name": "AcssDebit", -> "in_class": "mandate_payment_method_details" -> } -17714c21404,21408 -< "x-expandableFields": [] ---- -> "x-expandableFields": [], -> "x-stripeResource": { -> "class_name": "AuBecsDebit", -> "in_class": "mandate" -> } -17747c21441,21445 -< "x-expandableFields": [] ---- -> "x-expandableFields": [], -> "x-stripeResource": { -> "class_name": "BacsDebit", -> "in_class": "mandate" -> } -17770a21469,21472 -> "required": [ -> "expires_after", -> "type" -> ], -17775c21477,21481 -< ] ---- -> ], -> "x-stripeResource": { -> "class_name": "Blik", -> "in_class": "mandate_payment_method_details" -> } -17782c21488,21492 -< "x-expandableFields": [] ---- -> "x-expandableFields": [], -> "x-stripeResource": { -> "class_name": "Link", -> "in_class": "mandate_payment_method_details" -> } -17789c21499,21503 -< "x-expandableFields": [] ---- -> "x-expandableFields": [], -> "x-stripeResource": { -> "class_name": "MultiUse", -> "in_class": "mandate" -> } -17821a21536,21541 -> "required": [ -> "amount", -> "currency", -> "interval", -> "interval_count" -> ], -17824c21544,21548 -< "x-expandableFields": [] ---- -> "x-expandableFields": [], -> "x-stripeResource": { -> "class_name": "BlikMandateOptionsOffSessionDetails", -> "in_class": "payment_intent_payment_method_options" -> } -17873c21597,21609 -< ] ---- -> ], -> "x-stripeResource": { -> "class_name": "PaymentMethodDetails", -> "in_class": "mandate", -> "inner_classes": [ -> "card_mandate_payment_method_details", -> "mandate_acss_debit", -> "mandate_blik", -> "mandate_link", -> "mandate_sepa_debit", -> "mandate_us_bank_account" -> ] -> } -17895c21631,21635 -< "x-expandableFields": [] ---- -> "x-expandableFields": [], -> "x-stripeResource": { -> "class_name": "SepaDebit", -> "in_class": "mandate_payment_method_details" -> } -17915c21655,21659 -< "x-expandableFields": [] ---- -> "x-expandableFields": [], -> "x-stripeResource": { -> "class_name": "SingleUse", -> "in_class": "mandate" -> } -17922c21666,21670 -< "x-expandableFields": [] ---- -> "x-expandableFields": [], -> "x-stripeResource": { -> "class_name": "UsBankAccount", -> "in_class": "mandate_payment_method_details" -> } -17943c21691,21692 -< "available" ---- -> "available", -> "preferred" -17947c21696,21700 -< "x-expandableFields": [] ---- -> "x-expandableFields": [], -> "x-stripeResource": { -> "class_name": "Networks", -> "in_class": "payment_method_card" -> } -17966c21719,21723 -< "x-expandableFields": [] ---- -> "x-expandableFields": [], -> "x-stripeResource": { -> "class_name": "EventData", -> "in_package": "" -> } -17983a21741,21744 -> "required": [ -> "id", -> "idempotency_key" -> ], -17986c21747,21751 -< "x-expandableFields": [] ---- -> "x-expandableFields": [], -> "x-stripeResource": { -> "class_name": "EventRequest", -> "in_package": "" -> } -17993c21758,21762 -< "x-expandableFields": [] ---- -> "x-expandableFields": [], -> "x-stripeResource": { -> "class_name": "Offline", -> "in_class": "customer_acceptance" -> } -18010a21780,21783 -> "required": [ -> "ip_address", -> "user_agent" -> ], -18013c21786,21790 -< "x-expandableFields": [] ---- -> "x-expandableFields": [], -> "x-stripeResource": { -> "class_name": "Online", -> "in_class": "customer_acceptance" -> } -18058,18066d21834 -< "client_permissions": { -< "anyOf": [ -< { -< "$ref": "#/components/schemas/orders_v2_resource_client_permissions" -< } -< ], -< "description": "The fields on the Order that can be updated from the client", -< "nullable": true -< }, -18248a22017,22019 -> "application", -> "billing_details", -> "client_secret", -18250a22022,22024 -> "customer", -> "description", -> "discounts", -18251a22026 -> "ip_address", -18252a22028 -> "metadata", -18254a22031,22032 -> "shipping_cost", -> "shipping_details", -18264d22041 -< "client_permissions", -18274c22051,22123 -< "x-resourceId": "order" ---- -> "x-resourceId": "order", -> "x-stripeOperations": [ -> { -> "method_name": "create", -> "method_on": "service", -> "method_type": "create", -> "operation": "post", -> "path": "/v1/orders" -> }, -> { -> "method_name": "list", -> "method_on": "service", -> "method_type": "list", -> "operation": "get", -> "path": "/v1/orders" -> }, -> { -> "method_name": "retrieve", -> "method_on": "service", -> "method_type": "retrieve", -> "operation": "get", -> "path": "/v1/orders/{id}" -> }, -> { -> "method_name": "update", -> "method_on": "service", -> "method_type": "update", -> "operation": "post", -> "path": "/v1/orders/{id}" -> }, -> { -> "method_name": "submit", -> "method_on": "service", -> "method_type": "custom", -> "operation": "post", -> "path": "/v1/orders/{id}/submit" -> }, -> { -> "method_name": "cancel", -> "method_on": "service", -> "method_type": "custom", -> "operation": "post", -> "path": "/v1/orders/{id}/cancel" -> }, -> { -> "method_name": "reopen", -> "method_on": "service", -> "method_type": "custom", -> "operation": "post", -> "path": "/v1/orders/{id}/reopen" -> }, -> { -> "method_name": "list_line_items", -> "method_on": "service", -> "method_type": "custom", -> "operation": "get", -> "path": "/v1/orders/{id}/line_items" -> } -> ], -> "x-stripeResource": { -> "class_name": "Order", -> "has_collection_class": true, -> "in_package": "", -> "inner_classes": [ -> "orders_v2_resource_automatic_tax", -> "orders_v2_resource_billing_details", -> "orders_v2_resource_payment", -> "orders_v2_resource_shipping_cost", -> "orders_v2_resource_shipping_details", -> "orders_v2_resource_tax_details", -> "orders_v2_resource_total_details" -> ] -> } -18300a22150,22152 -> "required": [ -> "reference" -> ], -18303c22155,22159 -< "x-expandableFields": [] ---- -> "x-expandableFields": [], -> "x-stripeResource": { -> "class_name": "AfterpayClearpay", -> "in_class": "orders_v2_resource_payment_method_options" -> } -18318c22174,22178 -< "x-expandableFields": [] ---- -> "x-expandableFields": [], -> "x-stripeResource": { -> "class_name": "AutomaticPaymentMethods", -> "in_class": "orders_v2_resource_payment_settings" -> } -18339c22199,22200 -< "enabled" ---- -> "enabled", -> "status" -18343c22204,22208 -< "x-expandableFields": [] ---- -> "x-expandableFields": [], -> "x-stripeResource": { -> "class_name": "AutomaticTax", -> "in_class": "order" -> } -18375a22241,22246 -> "required": [ -> "address", -> "email", -> "name", -> "phone" -> ], -18380c22251,22255 -< ] ---- -> ], -> "x-stripeResource": { -> "class_name": "BillingDetails", -> "in_class": "order" -> } -18408,18443c22283,22287 -< "x-expandableFields": [] -< }, -< "orders_v2_resource_client_permissions": { -< "description": "", -< "properties": { -< "billing_details": { -< "description": "Allows or disallows billing details to be set on an Order with a publishable key and Order client_secret", -< "enum": [ -< "allow", -< "disallow" -< ], -< "nullable": true, -< "type": "string" -< }, -< "promotion_codes": { -< "description": "Allows or disallows promotion codes to be set on an Order with a publishable key and Order client_secret", -< "enum": [ -< "allow", -< "disallow" -< ], -< "nullable": true, -< "type": "string" -< }, -< "shipping_details": { -< "description": "Allows or disallows shipping details to be set on an Order with a publishable key and Order client_secret", -< "enum": [ -< "allow", -< "disallow" -< ], -< "nullable": true, -< "type": "string" -< } -< }, -< "title": "OrdersV2ResourceClientPermissions", -< "type": "object", -< "x-expandableFields": [] ---- -> "x-expandableFields": [], -> "x-stripeResource": { -> "class_name": "Card", -> "in_class": "orders_v2_resource_payment_method_options" -> } -18492a22337,22341 -> "required": [ -> "payment_intent", -> "settings", -> "status" -> ], -18498c22347,22354 -< ] ---- -> ], -> "x-stripeResource": { -> "class_name": "Payment", -> "in_class": "order", -> "inner_classes": [ -> "orders_v2_resource_payment_settings" -> ] -> } -18567c22423,22431 -< ] ---- -> ], -> "x-stripeResource": { -> "class_name": "PaymentMethodOptions", -> "in_class": "orders_v2_resource_payment_settings", -> "inner_classes": [ -> "orders_payment_method_options_afterpay_clearpay", -> "orders_v2_resource_card_payment_method_options" -> ] -> } -18653a22518,22527 -> "required": [ -> "application_fee_amount", -> "automatic_payment_methods", -> "payment_method_options", -> "payment_method_types", -> "return_url", -> "statement_descriptor", -> "statement_descriptor_suffix", -> "transfer_data" -> ], -18660c22534,22543 -< ] ---- -> ], -> "x-stripeResource": { -> "class_name": "Settings", -> "in_class": "orders_v2_resource_payment", -> "inner_classes": [ -> "orders_v2_resource_automatic_payment_methods", -> "orders_v2_resource_payment_method_options", -> "orders_v2_resource_transfer_data" -> ] -> } -18708c22591,22592 -< "amount_total" ---- -> "amount_total", -> "shipping_rate" -18715c22599,22603 -< ] ---- -> ], -> "x-stripeResource": { -> "class_name": "ShippingCost", -> "in_class": "order" -> } -18741a22630,22634 -> "required": [ -> "address", -> "name", -> "phone" -> ], -18746c22639,22643 -< ] ---- -> ], -> "x-stripeResource": { -> "class_name": "ShippingDetails", -> "in_class": "order" -> } -18776c22673,22680 -< ] ---- -> ], -> "x-stripeResource": { -> "class_name": "TaxDetails", -> "in_class": "order", -> "inner_classes": [ -> "orders_v2_resource_tax_details_resource_tax_id" -> ] -> } -18847c22751,22752 -< "type" ---- -> "type", -> "value" -18851c22756,22760 -< "x-expandableFields": [] ---- -> "x-expandableFields": [], -> "x-stripeResource": { -> "class_name": "TaxID", -> "in_class": "orders_v2_resource_tax_details" -> } -18874a22784 -> "amount_shipping", -18881c22791,22798 -< ] ---- -> ], -> "x-stripeResource": { -> "class_name": "TotalDetails", -> "in_class": "order", -> "inner_classes": [ -> "orders_v2_resource_total_details_api_resource_breakdown" -> ] -> } -18910c22827,22831 -< ] ---- -> ], -> "x-stripeResource": { -> "class_name": "Breakdown", -> "in_class": "orders_v2_resource_total_details" -> } -18940a22862 -> "amount", -18947c22869,22873 -< ] ---- -> ], -> "x-stripeResource": { -> "class_name": "TransferData", -> "in_class": "orders_v2_resource_payment_settings" -> } -18980c22906,22914 -< ] ---- -> ], -> "x-stripeResource": { -> "class_name": "DestinationPaymentMethodDetails", -> "in_class": "treasury.outbound_payment", -> "inner_classes": [ -> "outbound_payments_payment_method_details_financial_account", -> "outbound_payments_payment_method_details_us_bank_account" -> ] -> } -19004c22938,22942 -< "x-expandableFields": [] ---- -> "x-expandableFields": [], -> "x-stripeResource": { -> "class_name": "FinancialAccount", -> "in_class": "outbound_payments_payment_method_details" -> } -19061c22999,23005 -< "network" ---- -> "account_holder_type", -> "account_type", -> "bank_name", -> "fingerprint", -> "last4", -> "network", -> "routing_number" -19065c23009,23013 -< "x-expandableFields": [] ---- -> "x-expandableFields": [], -> "x-stripeResource": { -> "class_name": "UsBankAccount", -> "in_class": "outbound_payments_payment_method_details" -> } -19094c23042,23049 -< ] ---- -> ], -> "x-stripeResource": { -> "class_name": "DestinationPaymentMethodDetails", -> "in_class": "treasury.outbound_transfer", -> "inner_classes": [ -> "outbound_transfers_payment_method_details_us_bank_account" -> ] -> } -19151c23106,23112 -< "network" ---- -> "account_holder_type", -> "account_type", -> "bank_name", -> "fingerprint", -> "last4", -> "network", -> "routing_number" -19155c23116,23120 -< "x-expandableFields": [] ---- -> "x-expandableFields": [], -> "x-stripeResource": { -> "class_name": "UsBankAccount", -> "in_class": "outbound_transfers_payment_method_details" -> } -19185c23150,23154 -< "x-expandableFields": [] ---- -> "x-expandableFields": [], -> "x-stripeResource": { -> "class_name": "PackageDimensions", -> "in_package": "" -> } -19198c23167,23174 -< ] ---- -> ], -> "x-stripeResource": { -> "class_name": "AmountDetails", -> "in_class": "payment_intent", -> "inner_classes": [ -> "payment_flows_amount_details_resource_tip" -> ] -> } -19210c23186,23190 -< "x-expandableFields": [] ---- -> "x-expandableFields": [], -> "x-stripeResource": { -> "class_name": "Tip", -> "in_class": "payment_flows_amount_details" -> } -19225c23205,23209 -< "x-expandableFields": [] ---- -> "x-expandableFields": [], -> "x-stripeResource": { -> "class_name": "AutomaticPaymentMethodsPaymentIntent", -> "in_package": "" -> } -19244c23228,23232 -< ] ---- -> ], -> "x-stripeResource": { -> "class_name": "Installments", -> "in_class": "payment_intent_type_specific_payment_method_options_client" -> } -19251c23239,23243 -< "x-expandableFields": [] ---- -> "x-expandableFields": [], -> "x-stripeResource": { -> "class_name": "Alipay", -> "in_class": "payment_method" -> } -19273a23266,23269 -> "required": [ -> "fingerprint", -> "transaction_id" -> ], -19276c23272,23276 -< "x-expandableFields": [] ---- -> "x-expandableFields": [], -> "x-stripeResource": { -> "class_name": "Alipay", -> "in_class": "payment_method_details" -> } -19296a23297,23301 -> "required": [ -> "day", -> "month", -> "year" -> ], -19299c23304,23308 -< "x-expandableFields": [] ---- -> "x-expandableFields": [], -> "x-stripeResource": { -> "class_name": "DateOfBirth", -> "in_class": "payment_method_klarna" -> } -19645a23655,23680 -> "source": { -> "anyOf": [ -> { -> "maxLength": 5000, -> "type": "string" -> }, -> { -> "$ref": "#/components/schemas/payment_source" -> }, -> { -> "$ref": "#/components/schemas/deleted_payment_source" -> } -> ], -> "description": "This is a legacy field that will be removed in the future. It is the ID of the Source object that is associated with this PaymentIntent, if one was supplied.", -> "nullable": true, -> "x-expansionResources": { -> "oneOf": [ -> { -> "$ref": "#/components/schemas/payment_source" -> }, -> { -> "$ref": "#/components/schemas/deleted_payment_source" -> } -> ] -> } -> }, -19688a23724,23730 -> "amount_capturable", -> "amount_received", -> "application", -> "application_fee_amount", -> "automatic_payment_methods", -> "canceled_at", -> "cancellation_reason", -19689a23732 -> "client_secret", -19692a23736,23737 -> "customer", -> "description", -19693a23739,23740 -> "invoice", -> "last_payment_error", -19694a23742,23743 -> "metadata", -> "next_action", -19695a23745,23747 -> "on_behalf_of", -> "payment_method", -> "payment_method_options", -19697c23749,23759 -< "status" ---- -> "processing", -> "receipt_email", -> "review", -> "setup_future_usage", -> "shipping", -> "source", -> "statement_descriptor", -> "statement_descriptor_suffix", -> "status", -> "transfer_data", -> "transfer_group" -19715a23778 -> "source", -19718c23781,23880 -< "x-resourceId": "payment_intent" ---- -> "x-resourceId": "payment_intent", -> "x-stripeOperations": [ -> { -> "method_name": "search", -> "method_on": "service", -> "method_type": "custom", -> "operation": "get", -> "path": "/v1/payment_intents/search" -> }, -> { -> "method_name": "create", -> "method_on": "service", -> "method_type": "create", -> "operation": "post", -> "path": "/v1/payment_intents" -> }, -> { -> "method_name": "list", -> "method_on": "service", -> "method_type": "list", -> "operation": "get", -> "path": "/v1/payment_intents" -> }, -> { -> "method_name": "retrieve", -> "method_on": "service", -> "method_type": "retrieve", -> "operation": "get", -> "path": "/v1/payment_intents/{intent}" -> }, -> { -> "method_name": "update", -> "method_on": "service", -> "method_type": "update", -> "operation": "post", -> "path": "/v1/payment_intents/{intent}" -> }, -> { -> "method_name": "confirm", -> "method_on": "service", -> "method_type": "custom", -> "operation": "post", -> "path": "/v1/payment_intents/{intent}/confirm" -> }, -> { -> "method_name": "cancel", -> "method_on": "service", -> "method_type": "custom", -> "operation": "post", -> "path": "/v1/payment_intents/{intent}/cancel" -> }, -> { -> "method_name": "capture", -> "method_on": "service", -> "method_type": "custom", -> "operation": "post", -> "path": "/v1/payment_intents/{intent}/capture" -> }, -> { -> "method_name": "increment_authorization", -> "method_on": "service", -> "method_type": "custom", -> "operation": "post", -> "path": "/v1/payment_intents/{intent}/increment_authorization" -> }, -> { -> "method_name": "verify_microdeposits", -> "method_on": "service", -> "method_type": "custom", -> "operation": "post", -> "path": "/v1/payment_intents/{intent}/verify_microdeposits" -> }, -> { -> "method_name": "apply_customer_balance", -> "method_on": "service", -> "method_type": "custom", -> "operation": "post", -> "path": "/v1/payment_intents/{intent}/apply_customer_balance" -> } -> ], -> "x-stripeResource": { -> "class_name": "PaymentIntent", -> "has_collection_class": true, -> "has_search_result_class": true, -> "in_package": "", -> "inner_classes": [ -> "payment_flows_amount_details", -> "payment_intent_next_action", -> "payment_intent_next_action_alipay_handle_redirect", -> "payment_intent_next_action_boleto", -> "payment_intent_next_action_card_await_notification", -> "payment_intent_next_action_display_bank_transfer_instructions", -> "payment_intent_next_action_display_oxxo_details", -> "payment_intent_next_action_konbini", -> "payment_intent_next_action_redirect_to_url", -> "payment_intent_payment_method_options", -> "payment_intent_processing", -> "transfer_data" -> ] -> } -19731c23893,23900 -< ] ---- -> ], -> "x-stripeResource": { -> "class_name": "Card", -> "in_class": "payment_intent_processing", -> "inner_classes": [ -> "payment_intent_processing_customer_notification" -> ] -> } -19808c23977,23990 -< ] ---- -> ], -> "x-stripeResource": { -> "class_name": "NextAction", -> "in_class": "payment_intent", -> "inner_classes": [ -> "payment_intent_next_action_paynow_display_qr_code", -> "payment_intent_next_action_pix_display_qr_code", -> "payment_intent_next_action_promptpay_display_qr_code", -> "payment_intent_next_action_verify_with_microdeposits", -> "payment_intent_next_action_wechat_pay_display_qr_code", -> "payment_intent_next_action_wechat_pay_redirect_to_android_app", -> "payment_intent_next_action_wechat_pay_redirect_to_ios_app" -> ] -> } -19837a24020,24025 -> "required": [ -> "native_data", -> "native_url", -> "return_url", -> "url" -> ], -19840c24028,24032 -< "x-expandableFields": [] ---- -> "x-expandableFields": [], -> "x-stripeResource": { -> "class_name": "NextActionAlipayHandleRedirect", -> "in_class": "payment_intent" -> } -19869a24062,24067 -> "required": [ -> "expires_at", -> "hosted_voucher_url", -> "number", -> "pdf" -> ], -19872c24070,24074 -< "x-expandableFields": [] ---- -> "x-expandableFields": [], -> "x-stripeResource": { -> "class_name": "NextActionDisplayBoletoDetails", -> "in_class": "payment_intent" -> } -19888a24091,24094 -> "required": [ -> "charge_attempt_at", -> "customer_approval_required" -> ], -19891c24097,24101 -< "x-expandableFields": [] ---- -> "x-expandableFields": [], -> "x-stripeResource": { -> "class_name": "NextActionCardAwaitNotification", -> "in_class": "payment_intent" -> } -19937a24148,24151 -> "amount_remaining", -> "currency", -> "hosted_instructions_url", -> "reference", -19944c24158,24162 -< ] ---- -> ], -> "x-stripeResource": { -> "class_name": "NextActionDisplayBankTransferInstructions", -> "in_class": "payment_intent" -> } -19967a24186,24190 -> "required": [ -> "expires_after", -> "hosted_voucher_url", -> "number" -> ], -19970c24193,24197 -< "x-expandableFields": [] ---- -> "x-expandableFields": [], -> "x-stripeResource": { -> "class_name": "NextActionOxxoDisplayDetails", -> "in_class": "payment_intent" -> } -19991a24219 -> "hosted_voucher_url", -19998c24226,24233 -< ] ---- -> ], -> "x-stripeResource": { -> "class_name": "NextActionKonbiniDisplayDetails", -> "in_class": "payment_intent", -> "inner_classes": [ -> "payment_intent_next_action_konbini_stores" -> ] -> } -20019c24254,24258 -< "x-expandableFields": [] ---- -> "x-expandableFields": [], -> "x-stripeResource": { -> "class_name": "Familymart", -> "in_class": "payment_intent_next_action_konbini_stores" -> } -20040c24279,24283 -< "x-expandableFields": [] ---- -> "x-expandableFields": [], -> "x-stripeResource": { -> "class_name": "Lawson", -> "in_class": "payment_intent_next_action_konbini_stores" -> } -20061c24304,24308 -< "x-expandableFields": [] ---- -> "x-expandableFields": [], -> "x-stripeResource": { -> "class_name": "Ministop", -> "in_class": "payment_intent_next_action_konbini_stores" -> } -20082c24329,24333 -< "x-expandableFields": [] ---- -> "x-expandableFields": [], -> "x-stripeResource": { -> "class_name": "Seicomart", -> "in_class": "payment_intent_next_action_konbini_stores" -> } -20123a24375,24380 -> "required": [ -> "familymart", -> "lawson", -> "ministop", -> "seicomart" -> ], -20131c24388,24398 -< ] ---- -> ], -> "x-stripeResource": { -> "class_name": "Stores", -> "in_class": "payment_intent_next_action_konbini", -> "inner_classes": [ -> "payment_intent_next_action_konbini_familymart", -> "payment_intent_next_action_konbini_lawson", -> "payment_intent_next_action_konbini_ministop", -> "payment_intent_next_action_konbini_seicomart" -> ] -> } -20159c24426,24430 -< "x-expandableFields": [] ---- -> "x-expandableFields": [], -> "x-stripeResource": { -> "class_name": "PaynowDisplayQrCode", -> "in_class": "payment_intent_next_action" -> } -20191c24462,24466 -< "x-expandableFields": [] ---- -> "x-expandableFields": [], -> "x-stripeResource": { -> "class_name": "PixDisplayQrCode", -> "in_class": "payment_intent_next_action" -> } -20225c24500,24504 -< "x-expandableFields": [] ---- -> "x-expandableFields": [], -> "x-stripeResource": { -> "class_name": "PromptpayDisplayQrCode", -> "in_class": "payment_intent_next_action" -> } -20242a24522,24525 -> "required": [ -> "return_url", -> "url" -> ], -20245c24528,24532 -< "x-expandableFields": [] ---- -> "x-expandableFields": [], -> "x-stripeResource": { -> "class_name": "NextActionRedirectToUrl", -> "in_class": "payment_intent" -> } -20272c24559,24560 -< "hosted_verification_url" ---- -> "hosted_verification_url", -> "microdeposit_type" -20276c24564,24568 -< "x-expandableFields": [] ---- -> "x-expandableFields": [], -> "x-stripeResource": { -> "class_name": "VerifyWithMicrodeposits", -> "in_class": "payment_intent_next_action" -> } -20310c24602,24606 -< "x-expandableFields": [] ---- -> "x-expandableFields": [], -> "x-stripeResource": { -> "class_name": "WechatPayDisplayQrCode", -> "in_class": "payment_intent_next_action" -> } -20362c24658,24662 -< "x-expandableFields": [] ---- -> "x-expandableFields": [], -> "x-stripeResource": { -> "class_name": "WechatPayRedirectToAndroidApp", -> "in_class": "payment_intent_next_action" -> } -20378c24678,24682 -< "x-expandableFields": [] ---- -> "x-expandableFields": [], -> "x-stripeResource": { -> "class_name": "WechatPayRedirectToIosApp", -> "in_class": "payment_intent_next_action" -> } -20384,20391c24688 -< "anyOf": [ -< { -< "$ref": "#/components/schemas/payment_intent_payment_method_options_acss_debit" -< }, -< { -< "$ref": "#/components/schemas/payment_intent_type_specific_payment_method_options_client" -< } -< ] ---- -> "$ref": "#/components/schemas/payment_intent_payment_method_options_acss_debit" -20394,20401c24691 -< "anyOf": [ -< { -< "$ref": "#/components/schemas/payment_method_options_affirm" -< }, -< { -< "$ref": "#/components/schemas/payment_intent_type_specific_payment_method_options_client" -< } -< ] ---- -> "$ref": "#/components/schemas/payment_method_options_affirm" -20404,20411c24694 -< "anyOf": [ -< { -< "$ref": "#/components/schemas/payment_method_options_afterpay_clearpay" -< }, -< { -< "$ref": "#/components/schemas/payment_intent_type_specific_payment_method_options_client" -< } -< ] ---- -> "$ref": "#/components/schemas/payment_method_options_afterpay_clearpay" -20414,20421c24697 -< "anyOf": [ -< { -< "$ref": "#/components/schemas/payment_method_options_alipay" -< }, -< { -< "$ref": "#/components/schemas/payment_intent_type_specific_payment_method_options_client" -< } -< ] ---- -> "$ref": "#/components/schemas/payment_method_options_alipay" -20424,20431c24700 -< "anyOf": [ -< { -< "$ref": "#/components/schemas/payment_intent_payment_method_options_au_becs_debit" -< }, -< { -< "$ref": "#/components/schemas/payment_intent_type_specific_payment_method_options_client" -< } -< ] ---- -> "$ref": "#/components/schemas/payment_intent_payment_method_options_au_becs_debit" -20434,20441c24703 -< "anyOf": [ -< { -< "$ref": "#/components/schemas/payment_method_options_bacs_debit" -< }, -< { -< "$ref": "#/components/schemas/payment_intent_type_specific_payment_method_options_client" -< } -< ] ---- -> "$ref": "#/components/schemas/payment_method_options_bacs_debit" -20444,20451c24706 -< "anyOf": [ -< { -< "$ref": "#/components/schemas/payment_method_options_bancontact" -< }, -< { -< "$ref": "#/components/schemas/payment_intent_type_specific_payment_method_options_client" -< } -< ] ---- -> "$ref": "#/components/schemas/payment_method_options_bancontact" -20454,20461c24709 -< "anyOf": [ -< { -< "$ref": "#/components/schemas/payment_intent_payment_method_options_blik" -< }, -< { -< "$ref": "#/components/schemas/payment_intent_type_specific_payment_method_options_client" -< } -< ] ---- -> "$ref": "#/components/schemas/payment_intent_payment_method_options_blik" -20464,20471c24712 -< "anyOf": [ -< { -< "$ref": "#/components/schemas/payment_method_options_boleto" -< }, -< { -< "$ref": "#/components/schemas/payment_intent_type_specific_payment_method_options_client" -< } -< ] ---- -> "$ref": "#/components/schemas/payment_method_options_boleto" -20474,20481c24715 -< "anyOf": [ -< { -< "$ref": "#/components/schemas/payment_intent_payment_method_options_card" -< }, -< { -< "$ref": "#/components/schemas/payment_intent_type_specific_payment_method_options_client" -< } -< ] ---- -> "$ref": "#/components/schemas/payment_intent_payment_method_options_card" -20484,20491c24718 -< "anyOf": [ -< { -< "$ref": "#/components/schemas/payment_method_options_card_present" -< }, -< { -< "$ref": "#/components/schemas/payment_intent_type_specific_payment_method_options_client" -< } -< ] ---- -> "$ref": "#/components/schemas/payment_method_options_card_present" -20494,20501c24721 -< "anyOf": [ -< { -< "$ref": "#/components/schemas/payment_method_options_customer_balance" -< }, -< { -< "$ref": "#/components/schemas/payment_intent_type_specific_payment_method_options_client" -< } -< ] ---- -> "$ref": "#/components/schemas/payment_method_options_customer_balance" -20504,20511c24724 -< "anyOf": [ -< { -< "$ref": "#/components/schemas/payment_intent_payment_method_options_eps" -< }, -< { -< "$ref": "#/components/schemas/payment_intent_type_specific_payment_method_options_client" -< } -< ] ---- -> "$ref": "#/components/schemas/payment_intent_payment_method_options_eps" -20514,20521c24727 -< "anyOf": [ -< { -< "$ref": "#/components/schemas/payment_method_options_fpx" -< }, -< { -< "$ref": "#/components/schemas/payment_intent_type_specific_payment_method_options_client" -< } -< ] ---- -> "$ref": "#/components/schemas/payment_method_options_fpx" -20524,20531c24730 -< "anyOf": [ -< { -< "$ref": "#/components/schemas/payment_method_options_giropay" -< }, -< { -< "$ref": "#/components/schemas/payment_intent_type_specific_payment_method_options_client" -< } -< ] ---- -> "$ref": "#/components/schemas/payment_method_options_giropay" -20534,20541c24733 -< "anyOf": [ -< { -< "$ref": "#/components/schemas/payment_method_options_grabpay" -< }, -< { -< "$ref": "#/components/schemas/payment_intent_type_specific_payment_method_options_client" -< } -< ] ---- -> "$ref": "#/components/schemas/payment_method_options_grabpay" -20544,20551c24736 -< "anyOf": [ -< { -< "$ref": "#/components/schemas/payment_method_options_ideal" -< }, -< { -< "$ref": "#/components/schemas/payment_intent_type_specific_payment_method_options_client" -< } -< ] ---- -> "$ref": "#/components/schemas/payment_method_options_ideal" -20554,20561c24739 -< "anyOf": [ -< { -< "$ref": "#/components/schemas/payment_method_options_interac_present" -< }, -< { -< "$ref": "#/components/schemas/payment_intent_type_specific_payment_method_options_client" -< } -< ] ---- -> "$ref": "#/components/schemas/payment_method_options_interac_present" -20564,20571c24742 -< "anyOf": [ -< { -< "$ref": "#/components/schemas/payment_method_options_klarna" -< }, -< { -< "$ref": "#/components/schemas/payment_intent_type_specific_payment_method_options_client" -< } -< ] ---- -> "$ref": "#/components/schemas/payment_method_options_klarna" -20574,20581c24745 -< "anyOf": [ -< { -< "$ref": "#/components/schemas/payment_method_options_konbini" -< }, -< { -< "$ref": "#/components/schemas/payment_intent_type_specific_payment_method_options_client" -< } -< ] ---- -> "$ref": "#/components/schemas/payment_method_options_konbini" -20584,20591c24748 -< "anyOf": [ -< { -< "$ref": "#/components/schemas/payment_intent_payment_method_options_link" -< }, -< { -< "$ref": "#/components/schemas/payment_intent_type_specific_payment_method_options_client" -< } -< ] ---- -> "$ref": "#/components/schemas/payment_intent_payment_method_options_link" -20594,20601c24751 -< "anyOf": [ -< { -< "$ref": "#/components/schemas/payment_method_options_oxxo" -< }, -< { -< "$ref": "#/components/schemas/payment_intent_type_specific_payment_method_options_client" -< } -< ] ---- -> "$ref": "#/components/schemas/payment_method_options_oxxo" -20604,20611c24754 -< "anyOf": [ -< { -< "$ref": "#/components/schemas/payment_method_options_p24" -< }, -< { -< "$ref": "#/components/schemas/payment_intent_type_specific_payment_method_options_client" -< } -< ] ---- -> "$ref": "#/components/schemas/payment_method_options_p24" -20614,20621c24757 -< "anyOf": [ -< { -< "$ref": "#/components/schemas/payment_method_options_paynow" -< }, -< { -< "$ref": "#/components/schemas/payment_intent_type_specific_payment_method_options_client" -< } -< ] ---- -> "$ref": "#/components/schemas/payment_method_options_paynow" -20624,20631c24760 -< "anyOf": [ -< { -< "$ref": "#/components/schemas/payment_method_options_pix" -< }, -< { -< "$ref": "#/components/schemas/payment_intent_type_specific_payment_method_options_client" -< } -< ] ---- -> "$ref": "#/components/schemas/payment_method_options_pix" -20634,20641c24763 -< "anyOf": [ -< { -< "$ref": "#/components/schemas/payment_method_options_promptpay" -< }, -< { -< "$ref": "#/components/schemas/payment_intent_type_specific_payment_method_options_client" -< } -< ] ---- -> "$ref": "#/components/schemas/payment_method_options_promptpay" -20644,20651c24766 -< "anyOf": [ -< { -< "$ref": "#/components/schemas/payment_intent_payment_method_options_sepa_debit" -< }, -< { -< "$ref": "#/components/schemas/payment_intent_type_specific_payment_method_options_client" -< } -< ] ---- -> "$ref": "#/components/schemas/payment_intent_payment_method_options_sepa_debit" -20654,20661c24769 -< "anyOf": [ -< { -< "$ref": "#/components/schemas/payment_method_options_sofort" -< }, -< { -< "$ref": "#/components/schemas/payment_intent_type_specific_payment_method_options_client" -< } -< ] ---- -> "$ref": "#/components/schemas/payment_method_options_sofort" -20664,20671c24772 -< "anyOf": [ -< { -< "$ref": "#/components/schemas/payment_intent_payment_method_options_us_bank_account" -< }, -< { -< "$ref": "#/components/schemas/payment_intent_type_specific_payment_method_options_client" -< } -< ] ---- -> "$ref": "#/components/schemas/payment_intent_payment_method_options_us_bank_account" -20674,20681c24775 -< "anyOf": [ -< { -< "$ref": "#/components/schemas/payment_method_options_wechat_pay" -< }, -< { -< "$ref": "#/components/schemas/payment_intent_type_specific_payment_method_options_client" -< } -< ] ---- -> "$ref": "#/components/schemas/payment_method_options_wechat_pay" -20717c24811,24851 -< ] ---- -> ], -> "x-stripeResource": { -> "class_name": "PaymentMethodOptions", -> "in_class": "payment_intent", -> "inner_classes": [ -> "mandate_options_off_session_details_blik", -> "payment_intent_payment_method_options_acss_debit", -> "payment_intent_payment_method_options_au_becs_debit", -> "payment_intent_payment_method_options_blik", -> "payment_intent_payment_method_options_card", -> "payment_intent_payment_method_options_eps", -> "payment_intent_payment_method_options_link", -> "payment_intent_payment_method_options_mandate_options_sepa_debit", -> "payment_intent_payment_method_options_sepa_debit", -> "payment_intent_payment_method_options_us_bank_account", -> "payment_method_options_affirm", -> "payment_method_options_afterpay_clearpay", -> "payment_method_options_alipay", -> "payment_method_options_bacs_debit", -> "payment_method_options_bancontact", -> "payment_method_options_boleto", -> "payment_method_options_card_present", -> "payment_method_options_customer_balance", -> "payment_method_options_customer_balance_bank_transfer", -> "payment_method_options_fpx", -> "payment_method_options_giropay", -> "payment_method_options_grabpay", -> "payment_method_options_ideal", -> "payment_method_options_interac_present", -> "payment_method_options_klarna", -> "payment_method_options_konbini", -> "payment_method_options_oxxo", -> "payment_method_options_p24", -> "payment_method_options_paynow", -> "payment_method_options_paypal", -> "payment_method_options_pix", -> "payment_method_options_promptpay", -> "payment_method_options_sofort", -> "payment_method_options_wechat_pay" -> ] -> } -20749c24883,24890 -< ] ---- -> ], -> "x-stripeResource": { -> "class_name": "AcssDebit", -> "in_class": "payment_intent_payment_method_options", -> "inner_classes": [ -> "payment_intent_payment_method_options_mandate_options_acss_debit" -> ] -> } -20766c24907,24911 -< "x-expandableFields": [] ---- -> "x-expandableFields": [], -> "x-stripeResource": { -> "class_name": "AuBecsDebit", -> "in_class": "payment_intent_payment_method_options" -> } -20773c24918,24922 -< "x-expandableFields": [] ---- -> "x-expandableFields": [], -> "x-stripeResource": { -> "class_name": "Blik", -> "in_class": "payment_intent_payment_method_options" -> } -20849a24999,25004 -> "required": [ -> "installments", -> "mandate_options", -> "network", -> "request_three_d_secure" -> ], -20855c25010,25018 -< ] ---- -> ], -> "x-stripeResource": { -> "class_name": "Card", -> "in_class": "payment_intent_payment_method_options", -> "inner_classes": [ -> "payment_method_options_card_installments", -> "payment_method_options_card_mandate_options" -> ] -> } -20870c25033,25037 -< "x-expandableFields": [] ---- -> "x-expandableFields": [], -> "x-stripeResource": { -> "class_name": "Eps", -> "in_class": "payment_intent_payment_method_options" -> } -20896a25064,25066 -> "required": [ -> "persistent_token" -> ], -20899c25069,25073 -< "x-expandableFields": [] ---- -> "x-expandableFields": [], -> "x-stripeResource": { -> "class_name": "Link", -> "in_class": "payment_intent_payment_method_options" -> } -20934a25109,25113 -> "required": [ -> "interval_description", -> "payment_schedule", -> "transaction_type" -> ], -20937c25116,25120 -< "x-expandableFields": [] ---- -> "x-expandableFields": [], -> "x-stripeResource": { -> "class_name": "MandateOptions", -> "in_class": "payment_intent_payment_method_options_acss_debit" -> } -20944c25127,25131 -< "x-expandableFields": [] ---- -> "x-expandableFields": [], -> "x-stripeResource": { -> "class_name": "SepaDebitMandateOptions", -> "in_class": "payment_intent_payment_method_options" -> } -20966c25153,25157 -< ] ---- -> ], -> "x-stripeResource": { -> "class_name": "SepaDebit", -> "in_class": "payment_intent_payment_method_options" -> } -20998c25189,25196 -< ] ---- -> ], -> "x-stripeResource": { -> "class_name": "UsBankAccount", -> "in_class": "payment_intent_payment_method_options", -> "inner_classes": [ -> "linked_account_options_us_bank_account" -> ] -> } -21021c25219,25226 -< ] ---- -> ], -> "x-stripeResource": { -> "class_name": "Processing", -> "in_class": "payment_intent", -> "inner_classes": [ -> "payment_intent_card_processing" -> ] -> } -21037a25243,25246 -> "required": [ -> "approval_requested", -> "completes_at" -> ], -21040c25249,25253 -< "x-expandableFields": [] ---- -> "x-expandableFields": [], -> "x-stripeResource": { -> "class_name": "CustomerNotification", -> "in_class": "payment_intent_card_processing" -> } -21079c25292,25299 -< ] ---- -> ], -> "x-stripeResource": { -> "class_name": "PaymentIntentTypeSpecificPaymentMethodOptionsClient", -> "in_package": "", -> "inner_classes": [ -> "payment_flows_installment_options" -> ] -> } -21332a25553,25554 -> "application_fee_amount", -> "application_fee_percent", -21334a25557 -> "consent_collection", -21340a25564,25565 -> "on_behalf_of", -> "payment_intent_data", -21341a25567 -> "payment_method_types", -21342a25569 -> "shipping_address_collection", -21344a25572 -> "subscription_data", -21345a25574 -> "transfer_data", -21364c25593,25647 -< "x-resourceId": "payment_link" ---- -> "x-resourceId": "payment_link", -> "x-stripeOperations": [ -> { -> "method_name": "list", -> "method_on": "service", -> "method_type": "list", -> "operation": "get", -> "path": "/v1/payment_links" -> }, -> { -> "method_name": "retrieve", -> "method_on": "service", -> "method_type": "retrieve", -> "operation": "get", -> "path": "/v1/payment_links/{payment_link}" -> }, -> { -> "method_name": "list_line_items", -> "method_on": "service", -> "method_type": "custom", -> "operation": "get", -> "path": "/v1/payment_links/{payment_link}/line_items" -> }, -> { -> "method_name": "create", -> "method_on": "service", -> "method_type": "create", -> "operation": "post", -> "path": "/v1/payment_links" -> }, -> { -> "method_name": "update", -> "method_on": "service", -> "method_type": "update", -> "operation": "post", -> "path": "/v1/payment_links/{payment_link}" -> } -> ], -> "x-stripeResource": { -> "class_name": "PaymentLink", -> "has_collection_class": true, -> "in_package": "", -> "inner_classes": [ -> "payment_links_resource_after_completion", -> "payment_links_resource_automatic_tax", -> "payment_links_resource_consent_collection", -> "payment_links_resource_payment_intent_data", -> "payment_links_resource_phone_number_collection", -> "payment_links_resource_shipping_address_collection", -> "payment_links_resource_shipping_option", -> "payment_links_resource_subscription_data", -> "payment_links_resource_tax_id_collection", -> "payment_links_resource_transfer_data" -> ] -> } -21392c25675,25683 -< ] ---- -> ], -> "x-stripeResource": { -> "class_name": "AfterCompletion", -> "in_class": "payment_link", -> "inner_classes": [ -> "payment_links_resource_completion_behavior_confirmation_page", -> "payment_links_resource_completion_behavior_redirect" -> ] -> } -21407c25698,25702 -< "x-expandableFields": [] ---- -> "x-expandableFields": [], -> "x-stripeResource": { -> "class_name": "AutomaticTax", -> "in_class": "payment_link" -> } -21418a25714,25716 -> "required": [ -> "custom_message" -> ], -21421c25719,25723 -< "x-expandableFields": [] ---- -> "x-expandableFields": [], -> "x-stripeResource": { -> "class_name": "HostedConfirmation", -> "in_class": "payment_links_resource_after_completion" -> } -21437c25739,25743 -< "x-expandableFields": [] ---- -> "x-expandableFields": [], -> "x-stripeResource": { -> "class_name": "Redirect", -> "in_class": "payment_links_resource_after_completion" -> } -21460a25767,25770 -> "required": [ -> "promotions", -> "terms_of_service" -> ], -21463c25773,25777 -< "x-expandableFields": [] ---- -> "x-expandableFields": [], -> "x-stripeResource": { -> "class_name": "ConsentCollection", -> "in_class": "payment_link" -> } -21486a25801,25804 -> "required": [ -> "capture_method", -> "setup_future_usage" -> ], -21489c25807,25811 -< "x-expandableFields": [] ---- -> "x-expandableFields": [], -> "x-stripeResource": { -> "class_name": "PaymentIntentData", -> "in_class": "payment_link" -> } -21504c25826,25830 -< "x-expandableFields": [] ---- -> "x-expandableFields": [], -> "x-stripeResource": { -> "class_name": "PhoneNumberCollection", -> "in_class": "payment_link" -> } -21761c26087,26091 -< "x-expandableFields": [] ---- -> "x-expandableFields": [], -> "x-stripeResource": { -> "class_name": "ShippingAddressCollection", -> "in_class": "payment_link" -> } -21798c26128,26132 -< ] ---- -> ], -> "x-stripeResource": { -> "class_name": "ShippingOption", -> "in_class": "payment_link" -> } -21814a26149,26152 -> "required": [ -> "description", -> "trial_period_days" -> ], -21817c26155,26159 -< "x-expandableFields": [] ---- -> "x-expandableFields": [], -> "x-stripeResource": { -> "class_name": "SubscriptionData", -> "in_class": "payment_link" -> } -21832c26174,26178 -< "x-expandableFields": [] ---- -> "x-expandableFields": [], -> "x-stripeResource": { -> "class_name": "TaxIdCollection", -> "in_class": "payment_link" -> } -21862a26209 -> "amount", -21869c26216,26220 -< ] ---- -> ], -> "x-stripeResource": { -> "class_name": "TransferData", -> "in_class": "payment_link" -> } -22060a26412 -> "customer", -22062a26415 -> "metadata", -22103c26456,26538 -< "x-resourceId": "payment_method" ---- -> "x-resourceId": "payment_method", -> "x-stripeOperations": [ -> { -> "method_name": "create", -> "method_on": "service", -> "method_type": "create", -> "operation": "post", -> "path": "/v1/payment_methods" -> }, -> { -> "method_name": "retrieve", -> "method_on": "service", -> "method_type": "retrieve", -> "operation": "get", -> "path": "/v1/payment_methods/{payment_method}" -> }, -> { -> "method_name": "update", -> "method_on": "service", -> "method_type": "update", -> "operation": "post", -> "path": "/v1/payment_methods/{payment_method}" -> }, -> { -> "method_name": "list", -> "method_on": "service", -> "method_type": "list", -> "operation": "get", -> "path": "/v1/payment_methods" -> }, -> { -> "method_name": "attach", -> "method_on": "service", -> "method_type": "custom", -> "operation": "post", -> "path": "/v1/payment_methods/{payment_method}/attach" -> }, -> { -> "method_name": "detach", -> "method_on": "service", -> "method_type": "custom", -> "operation": "post", -> "path": "/v1/payment_methods/{payment_method}/detach" -> } -> ], -> "x-stripeResource": { -> "class_name": "PaymentMethod", -> "has_collection_class": true, -> "in_package": "", -> "inner_classes": [ -> "billing_details", -> "payment_flows_private_payment_methods_alipay", -> "payment_method_acss_debit", -> "payment_method_affirm", -> "payment_method_afterpay_clearpay", -> "payment_method_au_becs_debit", -> "payment_method_bacs_debit", -> "payment_method_bancontact", -> "payment_method_blik", -> "payment_method_boleto", -> "payment_method_card", -> "payment_method_card_present", -> "payment_method_customer_balance", -> "payment_method_eps", -> "payment_method_fpx", -> "payment_method_giropay", -> "payment_method_grabpay", -> "payment_method_ideal", -> "payment_method_interac_present", -> "payment_method_klarna", -> "payment_method_konbini", -> "payment_method_link", -> "payment_method_oxxo", -> "payment_method_p24", -> "payment_method_paynow", -> "payment_method_pix", -> "payment_method_promptpay", -> "payment_method_sepa_debit", -> "payment_method_sofort", -> "payment_method_us_bank_account", -> "payment_method_wechat_pay" -> ] -> } -22138a26574,26580 -> "required": [ -> "bank_name", -> "fingerprint", -> "institution_number", -> "last4", -> "transit_number" -> ], -22141c26583,26587 -< "x-expandableFields": [] ---- -> "x-expandableFields": [], -> "x-stripeResource": { -> "class_name": "AcssDebit", -> "in_class": "payment_method" -> } -22148c26594,26598 -< "x-expandableFields": [] ---- -> "x-expandableFields": [], -> "x-stripeResource": { -> "class_name": "Affirm", -> "in_class": "payment_method" -> } -22155c26605,26609 -< "x-expandableFields": [] ---- -> "x-expandableFields": [], -> "x-stripeResource": { -> "class_name": "AfterpayClearpay", -> "in_class": "payment_method" -> } -22178a26633,26637 -> "required": [ -> "bsb_number", -> "fingerprint", -> "last4" -> ], -22181c26640,26644 -< "x-expandableFields": [] ---- -> "x-expandableFields": [], -> "x-stripeResource": { -> "class_name": "AuBecsDebit", -> "in_class": "payment_method" -> } -22204a26668,26672 -> "required": [ -> "fingerprint", -> "last4", -> "sort_code" -> ], -22207c26675,26679 -< "x-expandableFields": [] ---- -> "x-expandableFields": [], -> "x-stripeResource": { -> "class_name": "BacsDebit", -> "in_class": "payment_method" -> } -22214c26686,26690 -< "x-expandableFields": [] ---- -> "x-expandableFields": [], -> "x-stripeResource": { -> "class_name": "Bancontact", -> "in_class": "payment_method" -> } -22221c26697,26701 -< "x-expandableFields": [] ---- -> "x-expandableFields": [], -> "x-stripeResource": { -> "class_name": "Blik", -> "in_class": "payment_method" -> } -22237c26717,26721 -< "x-expandableFields": [] ---- -> "x-expandableFields": [], -> "x-stripeResource": { -> "class_name": "Boleto", -> "in_class": "payment_method" -> } -22261a26746,26751 -> "description": { -> "description": "A high-level description of the type of cards issued in this range. (For internal use only and not typically available in standard API requests.)", -> "maxLength": 5000, -> "nullable": true, -> "type": "string" -> }, -22281,22288c26771,26781 -< "generated_from": { -< "anyOf": [ -< { -< "$ref": "#/components/schemas/payment_method_card_generated_card" -< } -< ], -< "description": "Details of the original PaymentMethod that created this object.", -< "nullable": true ---- -> "iin": { -> "description": "Issuer identification number of the card. (For internal use only and not typically available in standard API requests.)", -> "maxLength": 5000, -> "nullable": true, -> "type": "string" -> }, -> "issuer": { -> "description": "The name of the card's issuing bank. (For internal use only and not typically available in standard API requests.)", -> "maxLength": 5000, -> "nullable": true, -> "type": "string" -22324a26818,26819 -> "checks", -> "country", -22328c26823,26826 -< "last4" ---- -> "last4", -> "networks", -> "three_d_secure_usage", -> "wallet" -22334d26831 -< "generated_from", -22338c26835,26845 -< ] ---- -> ], -> "x-stripeResource": { -> "class_name": "Card", -> "in_class": "payment_method", -> "inner_classes": [ -> "networks", -> "payment_method_card_checks", -> "payment_method_card_wallet", -> "three_d_secure_usage" -> ] -> } -22361a26869,26873 -> "required": [ -> "address_line1_check", -> "address_postal_code_check", -> "cvc_check" -> ], -22364,22410c26876,26880 -< "x-expandableFields": [] -< }, -< "payment_method_card_generated_card": { -< "description": "", -< "properties": { -< "charge": { -< "description": "The charge that created this object.", -< "maxLength": 5000, -< "nullable": true, -< "type": "string" -< }, -< "payment_method_details": { -< "anyOf": [ -< { -< "$ref": "#/components/schemas/card_generated_from_payment_method_details" -< } -< ], -< "description": "Transaction-specific details of the payment method used in the payment.", -< "nullable": true -< }, -< "setup_attempt": { -< "anyOf": [ -< { -< "maxLength": 5000, -< "type": "string" -< }, -< { -< "$ref": "#/components/schemas/setup_attempt" -< } -< ], -< "description": "The ID of the SetupAttempt that generated this PaymentMethod, if any.", -< "nullable": true, -< "x-expansionResources": { -< "oneOf": [ -< { -< "$ref": "#/components/schemas/setup_attempt" -< } -< ] -< } -< } -< }, -< "title": "payment_method_card_generated_card", -< "type": "object", -< "x-expandableFields": [ -< "payment_method_details", -< "setup_attempt" -< ] ---- -> "x-expandableFields": [], -> "x-stripeResource": { -> "class_name": "Checks", -> "in_class": "payment_method_card" -> } -22417c26887,26891 -< "x-expandableFields": [] ---- -> "x-expandableFields": [], -> "x-stripeResource": { -> "class_name": "CardPresent", -> "in_class": "payment_method" -> } -22459a26934 -> "dynamic_last4", -22471c26946,26958 -< ] ---- -> ], -> "x-stripeResource": { -> "class_name": "Wallet", -> "in_class": "payment_method_card", -> "inner_classes": [ -> "payment_method_card_wallet_amex_express_checkout", -> "payment_method_card_wallet_apple_pay", -> "payment_method_card_wallet_google_pay", -> "payment_method_card_wallet_masterpass", -> "payment_method_card_wallet_samsung_pay", -> "payment_method_card_wallet_visa_checkout" -> ] -> } -22478c26965,26969 -< "x-expandableFields": [] ---- -> "x-expandableFields": [], -> "x-stripeResource": { -> "class_name": "AmexExpressCheckout", -> "in_class": "payment_method_card_wallet" -> } -22485c26976,26980 -< "x-expandableFields": [] ---- -> "x-expandableFields": [], -> "x-stripeResource": { -> "class_name": "ApplePay", -> "in_class": "payment_method_card_wallet" -> } -22492c26987,26991 -< "x-expandableFields": [] ---- -> "x-expandableFields": [], -> "x-stripeResource": { -> "class_name": "GooglePay", -> "in_class": "payment_method_card_wallet" -> } -22527a27027,27032 -> "required": [ -> "billing_address", -> "email", -> "name", -> "shipping_address" -> ], -22533c27038,27042 -< ] ---- -> ], -> "x-stripeResource": { -> "class_name": "Masterpass", -> "in_class": "payment_method_card_wallet" -> } -22540c27049,27053 -< "x-expandableFields": [] ---- -> "x-expandableFields": [], -> "x-stripeResource": { -> "class_name": "SamsungPay", -> "in_class": "payment_method_card_wallet" -> } -22575a27089,27094 -> "required": [ -> "billing_address", -> "email", -> "name", -> "shipping_address" -> ], -22581c27100,27104 -< ] ---- -> ], -> "x-stripeResource": { -> "class_name": "VisaCheckout", -> "in_class": "payment_method_card_wallet" -> } -22588c27111,27115 -< "x-expandableFields": [] ---- -> "x-expandableFields": [], -> "x-stripeResource": { -> "class_name": "CustomerBalance", -> "in_class": "payment_method" -> } -22679a27207,27209 -> "sepa_credit_transfer": { -> "$ref": "#/components/schemas/payment_method_details_sepa_credit_transfer" -> }, -22738a27269 -> "sepa_credit_transfer", -22745c27276,27319 -< ] ---- -> ], -> "x-stripeResource": { -> "class_name": "PaymentMethodDetails", -> "in_class": "charge", -> "inner_classes": [ -> "payment_flows_private_payment_methods_alipay_details", -> "payment_method_details_ach_credit_transfer", -> "payment_method_details_ach_debit", -> "payment_method_details_acss_debit", -> "payment_method_details_affirm", -> "payment_method_details_afterpay_clearpay", -> "payment_method_details_au_becs_debit", -> "payment_method_details_bacs_debit", -> "payment_method_details_bancontact", -> "payment_method_details_blik", -> "payment_method_details_boleto", -> "payment_method_details_card", -> "payment_method_details_card_present", -> "payment_method_details_customer_balance", -> "payment_method_details_eps", -> "payment_method_details_fpx", -> "payment_method_details_giropay", -> "payment_method_details_grabpay", -> "payment_method_details_ideal", -> "payment_method_details_interac_present", -> "payment_method_details_klarna", -> "payment_method_details_konbini", -> "payment_method_details_konbini_store", -> "payment_method_details_link", -> "payment_method_details_multibanco", -> "payment_method_details_oxxo", -> "payment_method_details_p24", -> "payment_method_details_paynow", -> "payment_method_details_pix", -> "payment_method_details_promptpay", -> "payment_method_details_sepa_credit_transfer", -> "payment_method_details_sepa_debit", -> "payment_method_details_sofort", -> "payment_method_details_stripe_account", -> "payment_method_details_us_bank_account", -> "payment_method_details_wechat", -> "payment_method_details_wechat_pay" -> ] -> } -22774a27349,27354 -> "required": [ -> "account_number", -> "bank_name", -> "routing_number", -> "swift_code" -> ], -22777c27357,27361 -< "x-expandableFields": [] ---- -> "x-expandableFields": [], -> "x-stripeResource": { -> "class_name": "AchCreditTransfer", -> "in_class": "payment_method_details" -> } -22821a27406,27413 -> "required": [ -> "account_holder_type", -> "bank_name", -> "country", -> "fingerprint", -> "last4", -> "routing_number" -> ], -22824c27416,27420 -< "x-expandableFields": [] ---- -> "x-expandableFields": [], -> "x-stripeResource": { -> "class_name": "AchDebit", -> "in_class": "payment_method_details" -> } -22864a27461,27467 -> "required": [ -> "bank_name", -> "fingerprint", -> "institution_number", -> "last4", -> "transit_number" -> ], -22867c27470,27474 -< "x-expandableFields": [] ---- -> "x-expandableFields": [], -> "x-stripeResource": { -> "class_name": "AcssDebit", -> "in_class": "payment_method_details" -> } -22874c27481,27485 -< "x-expandableFields": [] ---- -> "x-expandableFields": [], -> "x-stripeResource": { -> "class_name": "Affirm", -> "in_class": "payment_method_details" -> } -22885a27497,27499 -> "required": [ -> "reference" -> ], -22888c27502,27506 -< "x-expandableFields": [] ---- -> "x-expandableFields": [], -> "x-stripeResource": { -> "class_name": "AfterpayClearpay", -> "in_class": "payment_method_details" -> } -22916a27535,27539 -> "required": [ -> "bsb_number", -> "fingerprint", -> "last4" -> ], -22919c27542,27546 -< "x-expandableFields": [] ---- -> "x-expandableFields": [], -> "x-stripeResource": { -> "class_name": "AuBecsDebit", -> "in_class": "payment_method_details" -> } -22948a27576,27581 -> "required": [ -> "fingerprint", -> "last4", -> "mandate", -> "sort_code" -> ], -22951c27584,27588 -< "x-expandableFields": [] ---- -> "x-expandableFields": [], -> "x-stripeResource": { -> "class_name": "BacsDebit", -> "in_class": "payment_method_details" -> } -23037a27675,27684 -> "required": [ -> "bank_code", -> "bank_name", -> "bic", -> "generated_sepa_debit", -> "generated_sepa_debit_mandate", -> "iban_last4", -> "preferred_language", -> "verified_name" -> ], -23043c27690,27694 -< ] ---- -> ], -> "x-stripeResource": { -> "class_name": "Bancontact", -> "in_class": "payment_method_details" -> } -23050c27701,27705 -< "x-expandableFields": [] ---- -> "x-expandableFields": [], -> "x-stripeResource": { -> "class_name": "Blik", -> "in_class": "payment_method_details" -> } -23066c27721,27725 -< "x-expandableFields": [] ---- -> "x-expandableFields": [], -> "x-stripeResource": { -> "class_name": "Boleto", -> "in_class": "payment_method_details" -> } -23091a27751,27756 -> "description": { -> "description": "A high-level description of the type of cards issued in this range. (For internal use only and not typically available in standard API requests.)", -> "maxLength": 5000, -> "nullable": true, -> "type": "string" -> }, -23111a27777,27782 -> "iin": { -> "description": "Issuer identification number of the card. (For internal use only and not typically available in standard API requests.)", -> "maxLength": 5000, -> "nullable": true, -> "type": "string" -> }, -23120a27792,27797 -> "issuer": { -> "description": "The name of the card's issuing bank. (For internal use only and not typically available in standard API requests.)", -> "maxLength": 5000, -> "nullable": true, -> "type": "string" -> }, -23132a27810,27814 -> "moto": { -> "description": "True if this payment was marked as MOTO and out of scope for SCA.", -> "nullable": true, -> "type": "boolean" -> }, -23158a27841,27843 -> "brand", -> "checks", -> "country", -23160c27845,27852 -< "exp_year" ---- -> "exp_year", -> "funding", -> "installments", -> "last4", -> "mandate", -> "network", -> "three_d_secure", -> "wallet" -23169c27861,27871 -< ] ---- -> ], -> "x-stripeResource": { -> "class_name": "Card", -> "in_class": "payment_method_details", -> "inner_classes": [ -> "payment_method_details_card_checks", -> "payment_method_details_card_installments", -> "payment_method_details_card_wallet", -> "three_d_secure_details" -> ] -> } -23192a27895,27899 -> "required": [ -> "address_line1_check", -> "address_postal_code_check", -> "cvc_check" -> ], -23195c27902,27906 -< "x-expandableFields": [] ---- -> "x-expandableFields": [], -> "x-stripeResource": { -> "class_name": "Checks", -> "in_class": "payment_method_details_card" -> } -23209a27921,27923 -> "required": [ -> "plan" -> ], -23214c27928,27932 -< ] ---- -> ], -> "x-stripeResource": { -> "class_name": "Installments", -> "in_class": "payment_method_details_card" -> } -23240a27959,27960 -> "count", -> "interval", -23245c27965,27969 -< "x-expandableFields": [] ---- -> "x-expandableFields": [], -> "x-stripeResource": { -> "class_name": "Plan", -> "in_class": "payment_method_options_card_installments" -> } -23277a28002,28007 -> "description": { -> "description": "A high-level description of the type of cards issued in this range. (For internal use only and not typically available in standard API requests.)", -> "maxLength": 5000, -> "nullable": true, -> "type": "string" -> }, -23309a28040,28045 -> "iin": { -> "description": "Issuer identification number of the card. (For internal use only and not typically available in standard API requests.)", -> "maxLength": 5000, -> "nullable": true, -> "type": "string" -> }, -23313a28050,28055 -> "issuer": { -> "description": "The name of the card's issuing bank. (For internal use only and not typically available in standard API requests.)", -> "maxLength": 5000, -> "nullable": true, -> "type": "string" -> }, -23352a28095,28099 -> "amount_authorized", -> "brand", -> "cardholder_name", -> "country", -> "emv_auth_data", -23354a28102,28104 -> "fingerprint", -> "funding", -> "generated_card", -23356c28106,28110 -< "overcapture_supported" ---- -> "last4", -> "network", -> "overcapture_supported", -> "read_method", -> "receipt" -23362c28116,28123 -< ] ---- -> ], -> "x-stripeResource": { -> "class_name": "CardPresent", -> "in_class": "payment_method_details", -> "inner_classes": [ -> "payment_method_details_card_present_receipt" -> ] -> } -23426a28188,28197 -> "required": [ -> "application_cryptogram", -> "application_preferred_name", -> "authorization_code", -> "authorization_response_code", -> "cardholder_verification_method", -> "dedicated_file_name", -> "terminal_verification_results", -> "transaction_status_information" -> ], -23429c28200,28204 -< "x-expandableFields": [] ---- -> "x-expandableFields": [], -> "x-stripeResource": { -> "class_name": "Receipt", -> "in_class": "payment_method_details_card_present" -> } -23471a28247 -> "dynamic_last4", -23483c28259,28271 -< ] ---- -> ], -> "x-stripeResource": { -> "class_name": "Wallet", -> "in_class": "payment_method_details_card", -> "inner_classes": [ -> "payment_method_details_card_wallet_amex_express_checkout", -> "payment_method_details_card_wallet_apple_pay", -> "payment_method_details_card_wallet_google_pay", -> "payment_method_details_card_wallet_masterpass", -> "payment_method_details_card_wallet_samsung_pay", -> "payment_method_details_card_wallet_visa_checkout" -> ] -> } -23490c28278,28282 -< "x-expandableFields": [] ---- -> "x-expandableFields": [], -> "x-stripeResource": { -> "class_name": "AmexExpressCheckout", -> "in_class": "payment_method_details_card_wallet" -> } -23497c28289,28293 -< "x-expandableFields": [] ---- -> "x-expandableFields": [], -> "x-stripeResource": { -> "class_name": "ApplePay", -> "in_class": "payment_method_details_card_wallet" -> } -23504c28300,28304 -< "x-expandableFields": [] ---- -> "x-expandableFields": [], -> "x-stripeResource": { -> "class_name": "GooglePay", -> "in_class": "payment_method_details_card_wallet" -> } -23539a28340,28345 -> "required": [ -> "billing_address", -> "email", -> "name", -> "shipping_address" -> ], -23545c28351,28355 -< ] ---- -> ], -> "x-stripeResource": { -> "class_name": "Masterpass", -> "in_class": "payment_method_details_card_wallet" -> } -23552c28362,28366 -< "x-expandableFields": [] ---- -> "x-expandableFields": [], -> "x-stripeResource": { -> "class_name": "SamsungPay", -> "in_class": "payment_method_details_card_wallet" -> } -23587a28402,28407 -> "required": [ -> "billing_address", -> "email", -> "name", -> "shipping_address" -> ], -23593c28413,28417 -< ] ---- -> ], -> "x-stripeResource": { -> "class_name": "VisaCheckout", -> "in_class": "payment_method_details_card_wallet" -> } -23600c28424,28428 -< "x-expandableFields": [] ---- -> "x-expandableFields": [], -> "x-stripeResource": { -> "class_name": "CustomerBalance", -> "in_class": "payment_method_details" -> } -23646a28475,28478 -> "required": [ -> "bank", -> "verified_name" -> ], -23649c28481,28485 -< "x-expandableFields": [] ---- -> "x-expandableFields": [], -> "x-stripeResource": { -> "class_name": "Eps", -> "in_class": "payment_method_details" -> } -23653a28490,28498 -> "account_holder_type": { -> "description": "Account holder type, if provided. Can be one of `individual` or `company`.", -> "enum": [ -> "company", -> "individual" -> ], -> "nullable": true, -> "type": "string" -> }, -23690c28535,28537 -< "bank" ---- -> "account_holder_type", -> "bank", -> "transaction_id" -23694c28541,28545 -< "x-expandableFields": [] ---- -> "x-expandableFields": [], -> "x-stripeResource": { -> "class_name": "Fpx", -> "in_class": "payment_method_details" -> } -23723a28575,28580 -> "required": [ -> "bank_code", -> "bank_name", -> "bic", -> "verified_name" -> ], -23726c28583,28587 -< "x-expandableFields": [] ---- -> "x-expandableFields": [], -> "x-stripeResource": { -> "class_name": "Giropay", -> "in_class": "payment_method_details" -> } -23737a28599,28601 -> "required": [ -> "transaction_id" -> ], -23740c28604,28608 -< "x-expandableFields": [] ---- -> "x-expandableFields": [], -> "x-stripeResource": { -> "class_name": "Grabpay", -> "in_class": "payment_method_details" -> } -23837a28706,28713 -> "required": [ -> "bank", -> "bic", -> "generated_sepa_debit", -> "generated_sepa_debit_mandate", -> "iban_last4", -> "verified_name" -> ], -23843c28719,28723 -< ] ---- -> ], -> "x-stripeResource": { -> "class_name": "Ideal", -> "in_class": "payment_method_details" -> } -23865a28746,28751 -> "description": { -> "description": "A high-level description of the type of cards issued in this range. (For internal use only and not typically available in standard API requests.)", -> "maxLength": 5000, -> "nullable": true, -> "type": "string" -> }, -23897a28784,28795 -> "iin": { -> "description": "Issuer identification number of the card. (For internal use only and not typically available in standard API requests.)", -> "maxLength": 5000, -> "nullable": true, -> "type": "string" -> }, -> "issuer": { -> "description": "The name of the card's issuing bank. (For internal use only and not typically available in standard API requests.)", -> "maxLength": 5000, -> "nullable": true, -> "type": "string" -> }, -23941a28840,28843 -> "brand", -> "cardholder_name", -> "country", -> "emv_auth_data", -23943c28845,28853 -< "exp_year" ---- -> "exp_year", -> "fingerprint", -> "funding", -> "generated_card", -> "last4", -> "network", -> "preferred_locales", -> "read_method", -> "receipt" -23949c28859,28866 -< ] ---- -> ], -> "x-stripeResource": { -> "class_name": "InteracPresent", -> "in_class": "payment_method_details", -> "inner_classes": [ -> "payment_method_details_interac_present_receipt" -> ] -> } -24012a28930,28939 -> "required": [ -> "application_cryptogram", -> "application_preferred_name", -> "authorization_code", -> "authorization_response_code", -> "cardholder_verification_method", -> "dedicated_file_name", -> "terminal_verification_results", -> "transaction_status_information" -> ], -24015c28942,28946 -< "x-expandableFields": [] ---- -> "x-expandableFields": [], -> "x-stripeResource": { -> "class_name": "Receipt", -> "in_class": "payment_method_details_interac_present" -> } -24032a28964,28967 -> "required": [ -> "payment_method_category", -> "preferred_locale" -> ], -24035c28970,28974 -< "x-expandableFields": [] ---- -> "x-expandableFields": [], -> "x-stripeResource": { -> "class_name": "Klarna", -> "in_class": "payment_method_details" -> } -24049a28989,28991 -> "required": [ -> "store" -> ], -24054c28996,29000 -< ] ---- -> ], -> "x-stripeResource": { -> "class_name": "Konbini", -> "in_class": "payment_method_details" -> } -24070a29017,29019 -> "required": [ -> "chain" -> ], -24073c29022,29026 -< "x-expandableFields": [] ---- -> "x-expandableFields": [], -> "x-stripeResource": { -> "class_name": "Store", -> "in_class": "payment_method_details" -> } -24080c29033,29037 -< "x-expandableFields": [] ---- -> "x-expandableFields": [], -> "x-stripeResource": { -> "class_name": "Link", -> "in_class": "payment_method_details" -> } -24097a29055,29058 -> "required": [ -> "entity", -> "reference" -> ], -24100c29061,29065 -< "x-expandableFields": [] ---- -> "x-expandableFields": [], -> "x-stripeResource": { -> "class_name": "Multibanco", -> "in_class": "payment_method_details" -> } -24111a29077,29079 -> "required": [ -> "number" -> ], -24114c29082,29086 -< "x-expandableFields": [] ---- -> "x-expandableFields": [], -> "x-stripeResource": { -> "class_name": "Oxxo", -> "in_class": "payment_method_details" -> } -24163a29136,29140 -> "required": [ -> "bank", -> "reference", -> "verified_name" -> ], -24166c29143,29147 -< "x-expandableFields": [] ---- -> "x-expandableFields": [], -> "x-stripeResource": { -> "class_name": "P24", -> "in_class": "payment_method_details" -> } -24177a29159,29161 -> "required": [ -> "reference" -> ], -24180c29164,29168 -< "x-expandableFields": [] ---- -> "x-expandableFields": [], -> "x-stripeResource": { -> "class_name": "Paynow", -> "in_class": "payment_method_details" -> } -24194c29182,29186 -< "x-expandableFields": [] ---- -> "x-expandableFields": [], -> "x-stripeResource": { -> "class_name": "Pix", -> "in_class": "payment_method_details" -> } -24205a29198,29200 -> "required": [ -> "reference" -> ], -24208c29203,29242 -< "x-expandableFields": [] ---- -> "x-expandableFields": [], -> "x-stripeResource": { -> "class_name": "Promptpay", -> "in_class": "payment_method_details" -> } -> }, -> "payment_method_details_sepa_credit_transfer": { -> "description": "", -> "properties": { -> "bank_name": { -> "description": "Name of the bank associated with the bank account.", -> "maxLength": 5000, -> "nullable": true, -> "type": "string" -> }, -> "bic": { -> "description": "Bank Identifier Code of the bank associated with the bank account.", -> "maxLength": 5000, -> "nullable": true, -> "type": "string" -> }, -> "iban": { -> "description": "IBAN of the bank account to transfer funds to.", -> "maxLength": 5000, -> "nullable": true, -> "type": "string" -> } -> }, -> "required": [ -> "bank_name", -> "bic", -> "iban" -> ], -> "title": "payment_method_details_sepa_credit_transfer", -> "type": "object", -> "x-expandableFields": [], -> "x-stripeResource": { -> "class_name": "SepaCreditTransfer", -> "in_class": "payment_method_details" -> } -24249a29284,29291 -> "required": [ -> "bank_code", -> "branch_code", -> "country", -> "fingerprint", -> "last4", -> "mandate" -> ], -24252c29294,29298 -< "x-expandableFields": [] ---- -> "x-expandableFields": [], -> "x-stripeResource": { -> "class_name": "SepaDebit", -> "in_class": "payment_method_details" -> } -24347a29394,29404 -> "required": [ -> "bank_code", -> "bank_name", -> "bic", -> "country", -> "generated_sepa_debit", -> "generated_sepa_debit_mandate", -> "iban_last4", -> "preferred_language", -> "verified_name" -> ], -24353c29410,29414 -< ] ---- -> ], -> "x-stripeResource": { -> "class_name": "Sofort", -> "in_class": "payment_method_details" -> } -24360c29421,29425 -< "x-expandableFields": [] ---- -> "x-expandableFields": [], -> "x-stripeResource": { -> "class_name": "StripeAccount", -> "in_class": "payment_method_details" -> } -24407a29473,29480 -> "required": [ -> "account_holder_type", -> "account_type", -> "bank_name", -> "fingerprint", -> "last4", -> "routing_number" -> ], -24410c29483,29487 -< "x-expandableFields": [] ---- -> "x-expandableFields": [], -> "x-stripeResource": { -> "class_name": "UsBankAccount", -> "in_class": "payment_method_details" -> } -24417c29494,29498 -< "x-expandableFields": [] ---- -> "x-expandableFields": [], -> "x-stripeResource": { -> "class_name": "Wechat", -> "in_class": "payment_method_details" -> } -24434a29516,29519 -> "required": [ -> "fingerprint", -> "transaction_id" -> ], -24437c29522,29526 -< "x-expandableFields": [] ---- -> "x-expandableFields": [], -> "x-stripeResource": { -> "class_name": "WechatPay", -> "in_class": "payment_method_details" -> } -24477a29567,29569 -> "required": [ -> "bank" -> ], -24480c29572,29576 -< "x-expandableFields": [] ---- -> "x-expandableFields": [], -> "x-stripeResource": { -> "class_name": "Eps", -> "in_class": "payment_method" -> } -24484a29581,29589 -> "account_holder_type": { -> "description": "Account holder type, if provided. Can be one of `individual` or `company`.", -> "enum": [ -> "company", -> "individual" -> ], -> "nullable": true, -> "type": "string" -> }, -24514a29620 -> "account_holder_type", -24519c29625,29629 -< "x-expandableFields": [] ---- -> "x-expandableFields": [], -> "x-stripeResource": { -> "class_name": "Fpx", -> "in_class": "payment_method" -> } -24526c29636,29640 -< "x-expandableFields": [] ---- -> "x-expandableFields": [], -> "x-stripeResource": { -> "class_name": "Giropay", -> "in_class": "payment_method" -> } -24533c29647,29651 -< "x-expandableFields": [] ---- -> "x-expandableFields": [], -> "x-stripeResource": { -> "class_name": "Grabpay", -> "in_class": "payment_method" -> } -24578a29697,29700 -> "required": [ -> "bank", -> "bic" -> ], -24581c29703,29707 -< "x-expandableFields": [] ---- -> "x-expandableFields": [], -> "x-stripeResource": { -> "class_name": "Ideal", -> "in_class": "payment_method" -> } -24588c29714,29718 -< "x-expandableFields": [] ---- -> "x-expandableFields": [], -> "x-stripeResource": { -> "class_name": "InteracPresent", -> "in_class": "payment_method" -> } -24602a29733,29735 -> "required": [ -> "dob" -> ], -24607c29740,29747 -< ] ---- -> ], -> "x-stripeResource": { -> "class_name": "Klarna", -> "in_class": "payment_method", -> "inner_classes": [ -> "payment_flows_private_payment_methods_klarna_dob" -> ] -> } -24614c29754,29758 -< "x-expandableFields": [] ---- -> "x-expandableFields": [], -> "x-stripeResource": { -> "class_name": "Konbini", -> "in_class": "payment_method" -> } -24630a29775,29777 -> "required": [ -> "email" -> ], -24633c29780,29784 -< "x-expandableFields": [] ---- -> "x-expandableFields": [], -> "x-stripeResource": { -> "class_name": "Link", -> "in_class": "payment_method" -> } -24655c29806,29810 -< "x-expandableFields": [] ---- -> "x-expandableFields": [], -> "x-stripeResource": { -> "class_name": "Affirm", -> "in_class": "payment_intent_payment_method_options" -> } -24681a29837,29839 -> "required": [ -> "reference" -> ], -24684c29842,29846 -< "x-expandableFields": [] ---- -> "x-expandableFields": [], -> "x-stripeResource": { -> "class_name": "AfterpayClearpay", -> "in_class": "payment_intent_payment_method_options" -> } -24700c29862,29866 -< "x-expandableFields": [] ---- -> "x-expandableFields": [], -> "x-stripeResource": { -> "class_name": "Alipay", -> "in_class": "payment_intent_payment_method_options" -> } -24717c29883,29887 -< "x-expandableFields": [] ---- -> "x-expandableFields": [], -> "x-stripeResource": { -> "class_name": "BacsDebit", -> "in_class": "payment_intent_payment_method_options" -> } -24746c29916,29920 -< "x-expandableFields": [] ---- -> "x-expandableFields": [], -> "x-stripeResource": { -> "class_name": "Bancontact", -> "in_class": "payment_intent_payment_method_options" -> } -24770c29944,29948 -< "x-expandableFields": [] ---- -> "x-expandableFields": [], -> "x-stripeResource": { -> "class_name": "Boleto", -> "in_class": "payment_intent_payment_method_options" -> } -24798c29976,29978 -< "enabled" ---- -> "available_plans", -> "enabled", -> "plan" -24805c29985,29992 -< ] ---- -> ], -> "x-stripeResource": { -> "class_name": "Installments", -> "in_class": "payment_intent_payment_method_options_card", -> "inner_classes": [ -> "payment_method_details_card_installments_plan" -> ] -> } -24874a30062,30063 -> "description", -> "end_date", -24875a30065 -> "interval_count", -24877c30067,30068 -< "start_date" ---- -> "start_date", -> "supported_types" -24881c30072,30076 -< "x-expandableFields": [] ---- -> "x-expandableFields": [], -> "x-stripeResource": { -> "class_name": "MandateOptions", -> "in_class": "payment_intent_payment_method_options_card" -> } -24896a30092,30095 -> "required": [ -> "request_extended_authorization", -> "request_incremental_authorization_support" -> ], -24899c30098,30102 -< "x-expandableFields": [] ---- -> "x-expandableFields": [], -> "x-stripeResource": { -> "class_name": "CardPresent", -> "in_class": "payment_intent_payment_method_options" -> } -24922a30126,30128 -> "required": [ -> "funding_type" -> ], -24927c30133,30137 -< ] ---- -> ], -> "x-stripeResource": { -> "class_name": "CustomerBalance", -> "in_class": "payment_intent_payment_method_options" -> } -24962a30173,30175 -> "required": [ -> "type" -> ], -24967c30180,30187 -< ] ---- -> ], -> "x-stripeResource": { -> "class_name": "BankTransfer", -> "in_class": "payment_intent_payment_method_options", -> "inner_classes": [ -> "payment_method_options_customer_balance_eu_bank_account" -> ] -> } -24989c30209,30213 -< "x-expandableFields": [] ---- -> "x-expandableFields": [], -> "x-stripeResource": { -> "class_name": "EuBankTransfer", -> "in_class": "payment_method_options_customer_balance_bank_transfer" -> } -25004c30228,30232 -< "x-expandableFields": [] ---- -> "x-expandableFields": [], -> "x-stripeResource": { -> "class_name": "Fpx", -> "in_class": "payment_intent_payment_method_options" -> } -25019c30247,30251 -< "x-expandableFields": [] ---- -> "x-expandableFields": [], -> "x-stripeResource": { -> "class_name": "Giropay", -> "in_class": "payment_intent_payment_method_options" -> } -25034c30266,30270 -< "x-expandableFields": [] ---- -> "x-expandableFields": [], -> "x-stripeResource": { -> "class_name": "Grabpay", -> "in_class": "payment_intent_payment_method_options" -> } -25050c30286,30290 -< "x-expandableFields": [] ---- -> "x-expandableFields": [], -> "x-stripeResource": { -> "class_name": "Ideal", -> "in_class": "payment_intent_payment_method_options" -> } -25057c30297,30301 -< "x-expandableFields": [] ---- -> "x-expandableFields": [], -> "x-stripeResource": { -> "class_name": "InteracPresent", -> "in_class": "payment_intent_payment_method_options" -> } -25082a30327,30329 -> "required": [ -> "preferred_locale" -> ], -25085c30332,30336 -< "x-expandableFields": [] ---- -> "x-expandableFields": [], -> "x-stripeResource": { -> "class_name": "Klarna", -> "in_class": "payment_intent_payment_method_options" -> } -25120a30372,30377 -> "required": [ -> "confirmation_number", -> "expires_after_days", -> "expires_at", -> "product_description" -> ], -25123c30380,30384 -< "x-expandableFields": [] ---- -> "x-expandableFields": [], -> "x-stripeResource": { -> "class_name": "Konbini", -> "in_class": "payment_intent_payment_method_options" -> } -25145c30406,30410 -< "x-expandableFields": [] ---- -> "x-expandableFields": [], -> "x-stripeResource": { -> "class_name": "Oxxo", -> "in_class": "payment_intent_payment_method_options" -> } -25160c30425,30429 -< "x-expandableFields": [] ---- -> "x-expandableFields": [], -> "x-stripeResource": { -> "class_name": "P24", -> "in_class": "payment_intent_payment_method_options" -> } -25175c30444,30448 -< "x-expandableFields": [] ---- -> "x-expandableFields": [], -> "x-stripeResource": { -> "class_name": "Paynow", -> "in_class": "payment_intent_payment_method_options" -> } -25193a30467,30469 -> "required": [ -> "preferred_locale" -> ], -25196c30472,30476 -< "x-expandableFields": [] ---- -> "x-expandableFields": [], -> "x-stripeResource": { -> "class_name": "Paypal", -> "in_class": "payment_intent_payment_method_options" -> } -25218a30499,30502 -> "required": [ -> "expires_after_seconds", -> "expires_at" -> ], -25221c30505,30509 -< "x-expandableFields": [] ---- -> "x-expandableFields": [], -> "x-stripeResource": { -> "class_name": "Pix", -> "in_class": "payment_intent_payment_method_options" -> } -25236c30524,30528 -< "x-expandableFields": [] ---- -> "x-expandableFields": [], -> "x-stripeResource": { -> "class_name": "Promptpay", -> "in_class": "payment_intent_payment_method_options" -> } -25263a30556,30558 -> "required": [ -> "preferred_language" -> ], -25266c30561,30565 -< "x-expandableFields": [] ---- -> "x-expandableFields": [], -> "x-stripeResource": { -> "class_name": "Sofort", -> "in_class": "payment_intent_payment_method_options" -> } -25295a30595,30598 -> "required": [ -> "app_id", -> "client" -> ], -25298c30601,30605 -< "x-expandableFields": [] ---- -> "x-expandableFields": [], -> "x-stripeResource": { -> "class_name": "WechatPay", -> "in_class": "payment_intent_payment_method_options" -> } -25305c30612,30616 -< "x-expandableFields": [] ---- -> "x-expandableFields": [], -> "x-stripeResource": { -> "class_name": "Oxxo", -> "in_class": "payment_method" -> } -25343a30655,30657 -> "required": [ -> "bank" -> ], -25346c30660,30664 -< "x-expandableFields": [] ---- -> "x-expandableFields": [], -> "x-stripeResource": { -> "class_name": "P24", -> "in_class": "payment_method" -> } -25353c30671,30675 -< "x-expandableFields": [] ---- -> "x-expandableFields": [], -> "x-stripeResource": { -> "class_name": "Paynow", -> "in_class": "payment_method" -> } -25360c30682,30686 -< "x-expandableFields": [] ---- -> "x-expandableFields": [], -> "x-stripeResource": { -> "class_name": "Pix", -> "in_class": "payment_method" -> } -25367c30693,30697 -< "x-expandableFields": [] ---- -> "x-expandableFields": [], -> "x-stripeResource": { -> "class_name": "Promptpay", -> "in_class": "payment_method" -> } -25411a30742,30749 -> "required": [ -> "bank_code", -> "branch_code", -> "country", -> "fingerprint", -> "generated_from", -> "last4" -> ], -25416c30754,30761 -< ] ---- -> ], -> "x-stripeResource": { -> "class_name": "SepaDebit", -> "in_class": "payment_method", -> "inner_classes": [ -> "sepa_debit_generated_from" -> ] -> } -25427a30773,30775 -> "required": [ -> "country" -> ], -25430c30778,30782 -< "x-expandableFields": [] ---- -> "x-expandableFields": [], -> "x-stripeResource": { -> "class_name": "Sofort", -> "in_class": "payment_method" -> } -25492a30845,30853 -> "required": [ -> "account_holder_type", -> "account_type", -> "bank_name", -> "fingerprint", -> "last4", -> "networks", -> "routing_number" -> ], -25497c30858,30865 -< ] ---- -> ], -> "x-stripeResource": { -> "class_name": "USBankAccount", -> "in_class": "payment_method", -> "inner_classes": [ -> "us_bank_account_networks" -> ] -> } -25504c30872,30876 -< "x-expandableFields": [] ---- -> "x-expandableFields": [], -> "x-stripeResource": { -> "class_name": "WechatPay", -> "in_class": "payment_method" -> } -25518a30891,30893 -> "required": [ -> "recovery" -> ], -25523c30898,30905 -< ] ---- -> ], -> "x-stripeResource": { -> "class_name": "AfterExpiration", -> "in_class": "checkout.session", -> "inner_classes": [ -> "payment_pages_checkout_session_after_expiration_recovery" -> ] -> } -25551c30933,30935 -< "enabled" ---- -> "enabled", -> "expires_at", -> "url" -25555c30939,30943 -< "x-expandableFields": [] ---- -> "x-expandableFields": [], -> "x-stripeResource": { -> "class_name": "Recovery", -> "in_class": "payment_pages_checkout_session_after_expiration" -> } -25576c30964,30965 -< "enabled" ---- -> "enabled", -> "status" -25580c30969,30973 -< "x-expandableFields": [] ---- -> "x-expandableFields": [], -> "x-stripeResource": { -> "class_name": "AutomaticTax", -> "in_class": "checkout.session" -> } -25603a30997,31000 -> "required": [ -> "promotions", -> "terms_of_service" -> ], -25606c31003,31007 -< "x-expandableFields": [] ---- -> "x-expandableFields": [], -> "x-stripeResource": { -> "class_name": "Consent", -> "in_class": "checkout.session" -> } -25629a31031,31034 -> "required": [ -> "promotions", -> "terms_of_service" -> ], -25632c31037,31041 -< "x-expandableFields": [] ---- -> "x-expandableFields": [], -> "x-stripeResource": { -> "class_name": "ConsentCollection", -> "in_class": "checkout.session" -> } -25682a31092,31099 -> "required": [ -> "address", -> "email", -> "name", -> "phone", -> "tax_exempt", -> "tax_ids" -> ], -25688c31105,31112 -< ] ---- -> ], -> "x-stripeResource": { -> "class_name": "CustomerDetails", -> "in_class": "checkout.session", -> "inner_classes": [ -> "payment_pages_checkout_session_tax_id" -> ] -> } -25703c31127,31131 -< "x-expandableFields": [] ---- -> "x-expandableFields": [], -> "x-stripeResource": { -> "class_name": "PhoneNumberCollection", -> "in_class": "checkout.session" -> } -25960c31388,31392 -< "x-expandableFields": [] ---- -> "x-expandableFields": [], -> "x-stripeResource": { -> "class_name": "ShippingAddressCollection", -> "in_class": "checkout.session" -> } -26008c31440,31441 -< "amount_total" ---- -> "amount_total", -> "shipping_rate" -26015c31448,31452 -< ] ---- -> ], -> "x-stripeResource": { -> "class_name": "ShippingCost", -> "in_class": "checkout.session" -> } -26052c31489,31493 -< ] ---- -> ], -> "x-stripeResource": { -> "class_name": "ShippingOption", -> "in_class": "checkout.session" -> } -26123c31564,31565 -< "type" ---- -> "type", -> "value" -26127c31569,31573 -< "x-expandableFields": [] ---- -> "x-expandableFields": [], -> "x-stripeResource": { -> "class_name": "TaxID", -> "in_class": "payment_pages_checkout_session_customer_details" -> } -26142c31588,31592 -< "x-expandableFields": [] ---- -> "x-expandableFields": [], -> "x-stripeResource": { -> "class_name": "TaxIDCollection", -> "in_class": "checkout.session" -> } -26165a31616 -> "amount_shipping", -26172c31623,31630 -< ] ---- -> ], -> "x-stripeResource": { -> "class_name": "TotalDetails", -> "in_class": "checkout.session", -> "inner_classes": [ -> "payment_pages_checkout_session_total_details_resource_breakdown" -> ] -> } -26201c31659,31663 -< ] ---- -> ], -> "x-stripeResource": { -> "class_name": "Breakdown", -> "in_class": "payment_pages_checkout_session_total_details" -> } -26220c31682,31730 -< "x-stripeBypassValidation": true ---- -> "x-stripeBypassValidation": true, -> "x-stripeOperations": [ -> { -> "method_name": "list", -> "method_on": "collection", -> "method_type": "list", -> "operation": "get", -> "path": "/v1/customers/{customer}/sources" -> }, -> { -> "method_name": "list", -> "method_on": "service", -> "method_type": "list", -> "operation": "get", -> "path": "/v1/customers/{customer}/sources" -> }, -> { -> "method_name": "retrieve", -> "method_on": "collection", -> "method_type": "retrieve", -> "operation": "get", -> "path": "/v1/customers/{customer}/sources/{id}" -> }, -> { -> "method_name": "retrieve", -> "method_on": "service", -> "method_type": "retrieve", -> "operation": "get", -> "path": "/v1/customers/{customer}/sources/{id}" -> }, -> { -> "method_name": "create", -> "method_on": "collection", -> "method_type": "create", -> "operation": "post", -> "path": "/v1/customers/{customer}/sources" -> }, -> { -> "method_name": "create", -> "method_on": "service", -> "method_type": "create", -> "operation": "post", -> "path": "/v1/customers/{customer}/sources" -> } -> ], -> "x-stripeResource": { -> "class_name": "PaymentSource", -> "has_collection_class": true -> } -26280,26283c31790 -< "$ref": "#/components/schemas/bank_account" -< }, -< { -< "$ref": "#/components/schemas/card" ---- -> "$ref": "#/components/schemas/external_account" -26286,26289c31793 -< "$ref": "#/components/schemas/deleted_bank_account" -< }, -< { -< "$ref": "#/components/schemas/deleted_card" ---- -> "$ref": "#/components/schemas/deleted_external_account" -26297,26303c31801 -< "$ref": "#/components/schemas/bank_account" -< }, -< { -< "$ref": "#/components/schemas/card" -< }, -< { -< "$ref": "#/components/schemas/deleted_bank_account" ---- -> "$ref": "#/components/schemas/external_account" -26306c31804 -< "$ref": "#/components/schemas/deleted_card" ---- -> "$ref": "#/components/schemas/deleted_external_account" -26309,26310c31807 -< }, -< "x-stripeBypassValidation": true ---- -> } -26443a31941 -> "balance_transaction", -26445a31944,31948 -> "description", -> "destination", -> "failure_balance_transaction", -> "failure_code", -> "failure_message", -26447a31951 -> "metadata", -26449a31954,31955 -> "original_payout", -> "reversed_by", -26450a31957 -> "statement_descriptor", -26463c31970,32022 -< "x-resourceId": "payout" ---- -> "x-resourceId": "payout", -> "x-stripeOperations": [ -> { -> "method_name": "retrieve", -> "method_on": "service", -> "method_type": "retrieve", -> "operation": "get", -> "path": "/v1/payouts/{payout}" -> }, -> { -> "method_name": "list", -> "method_on": "service", -> "method_type": "list", -> "operation": "get", -> "path": "/v1/payouts" -> }, -> { -> "method_name": "create", -> "method_on": "service", -> "method_type": "create", -> "operation": "post", -> "path": "/v1/payouts" -> }, -> { -> "method_name": "update", -> "method_on": "service", -> "method_type": "update", -> "operation": "post", -> "path": "/v1/payouts/{payout}" -> }, -> { -> "method_name": "cancel", -> "method_on": "service", -> "method_type": "custom", -> "operation": "post", -> "path": "/v1/payouts/{payout}/cancel" -> }, -> { -> "method_name": "reverse", -> "method_on": "service", -> "method_type": "custom", -> "operation": "post", -> "path": "/v1/payouts/{payout}/reverse" -> } -> ], -> "x-stripeResource": { -> "class_name": "Payout", -> "has_collection_class": true, -> "in_package": "", -> "polymorphic_groups": [ -> "balance_transaction_source" -> ] -> } -26480a32040,32043 -> "required": [ -> "end", -> "start" -> ], -26483c32046,32050 -< "x-expandableFields": [] ---- -> "x-expandableFields": [], -> "x-stripeResource": { -> "class_name": "Period", -> "in_class": "usage_record_summary" -> } -26501a32069 -> "description": "The Kana variation of the person's address (Japan only).", -26509a32078 -> "description": "The Kanji variation of the person's address (Japan only).", -26557a32127 -> "description": "Information about the upcoming new requirements for this person, including what information needs to be collected, and by when.", -26648a32219 -> "description": "Information about the requirements for this person, including what information needs to be collected, and by when.", -26660d32230 -< "account", -26678c32248,32320 -< "x-resourceId": "person" ---- -> "x-resourceId": "person", -> "x-stripeOperations": [ -> { -> "method_name": "list", -> "method_on": "collection", -> "method_type": "list", -> "operation": "get", -> "path": "/v1/accounts/{account}/persons" -> }, -> { -> "method_name": "list", -> "method_on": "service", -> "method_type": "list", -> "operation": "get", -> "path": "/v1/accounts/{account}/persons" -> }, -> { -> "method_name": "retrieve", -> "method_on": "collection", -> "method_type": "retrieve", -> "operation": "get", -> "path": "/v1/accounts/{account}/persons/{person}" -> }, -> { -> "method_name": "retrieve", -> "method_on": "service", -> "method_type": "retrieve", -> "operation": "get", -> "path": "/v1/accounts/{account}/persons/{person}" -> }, -> { -> "method_name": "create", -> "method_on": "collection", -> "method_type": "create", -> "operation": "post", -> "path": "/v1/accounts/{account}/persons" -> }, -> { -> "method_name": "create", -> "method_on": "service", -> "method_type": "create", -> "operation": "post", -> "path": "/v1/accounts/{account}/persons" -> }, -> { -> "method_name": "update", -> "method_on": "service", -> "method_type": "update", -> "operation": "post", -> "path": "/v1/accounts/{account}/persons/{person}" -> }, -> { -> "method_name": "delete", -> "method_on": "service", -> "method_type": "delete", -> "operation": "delete", -> "path": "/v1/accounts/{account}/persons/{person}" -> } -> ], -> "x-stripeResource": { -> "class_name": "Person", -> "has_collection_class": true, -> "in_package": "", -> "inner_classes": [ -> "legal_entity_dob", -> "legal_entity_japan_address", -> "legal_entity_person_verification", -> "legal_entity_person_verification_document", -> "person_future_requirements", -> "person_relationship", -> "person_requirements" -> ] -> } -26731a32374 -> "alternatives", -26743c32386,32390 -< ] ---- -> ], -> "x-stripeResource": { -> "class_name": "FutureRequirements", -> "in_class": "person" -> } -26779a32427,32434 -> "required": [ -> "director", -> "executive", -> "owner", -> "percent_ownership", -> "representative", -> "title" -> ], -26782c32437,32441 -< "x-expandableFields": [] ---- -> "x-expandableFields": [], -> "x-stripeResource": { -> "class_name": "Relationship", -> "in_class": "person" -> } -26835a32495 -> "alternatives", -26847c32507,32511 -< ] ---- -> ], -> "x-stripeResource": { -> "class_name": "Requirements", -> "in_class": "person" -> } -27006a32671,32673 -> "aggregate_usage", -> "amount", -> "amount_decimal", -27013a32681,32682 -> "metadata", -> "nickname", -27014a32684,32687 -> "product", -> "tiers_mode", -> "transform_usage", -> "trial_period_days", -27024c32697,32743 -< "x-resourceId": "plan" ---- -> "x-resourceId": "plan", -> "x-stripeOperations": [ -> { -> "method_name": "list", -> "method_on": "service", -> "method_type": "list", -> "operation": "get", -> "path": "/v1/plans" -> }, -> { -> "method_name": "create", -> "method_on": "service", -> "method_type": "create", -> "operation": "post", -> "path": "/v1/plans" -> }, -> { -> "method_name": "retrieve", -> "method_on": "service", -> "method_type": "retrieve", -> "operation": "get", -> "path": "/v1/plans/{plan}" -> }, -> { -> "method_name": "update", -> "method_on": "service", -> "method_type": "update", -> "operation": "post", -> "path": "/v1/plans/{plan}" -> }, -> { -> "method_name": "delete", -> "method_on": "service", -> "method_type": "delete", -> "operation": "delete", -> "path": "/v1/plans/{plan}" -> } -> ], -> "x-stripeResource": { -> "class_name": "Plan", -> "has_collection_class": true, -> "in_package": "", -> "inner_classes": [ -> "plan_tier", -> "transform_usage" -> ] -> } -27056a32776,32782 -> "required": [ -> "flat_amount", -> "flat_amount_decimal", -> "unit_amount", -> "unit_amount_decimal", -> "up_to" -> ], -27059c32785,32789 -< "x-expandableFields": [] ---- -> "x-expandableFields": [], -> "x-stripeResource": { -> "class_name": "Tier", -> "in_class": "plan" -> } -27101c32831,32838 -< "x-expandableFields": [] ---- -> "x-expandableFields": [], -> "x-stripeResource": { -> "class_name": "PlatformTaxFee", -> "in_package": "", -> "polymorphic_groups": [ -> "balance_transaction_source" -> ] -> } -27124a32862,32866 -> "required": [ -> "headline", -> "privacy_policy_url", -> "terms_of_service_url" -> ], -27127c32869,32873 -< "x-expandableFields": [] ---- -> "x-expandableFields": [], -> "x-stripeResource": { -> "class_name": "BusinessProfile", -> "in_class": "billing_portal.configuration" -> } -27142c32888,32889 -< "type": "string" ---- -> "type": "string", -> "x-stripeBypassValidation": true -27157c32904,32908 -< "x-expandableFields": [] ---- -> "x-expandableFields": [], -> "x-stripeResource": { -> "class_name": "CustomerUpdate", -> "in_class": "portal_features" -> } -27198c32949,32961 -< ] ---- -> ], -> "x-stripeResource": { -> "class_name": "Features", -> "in_class": "billing_portal.configuration", -> "inner_classes": [ -> "portal_customer_update", -> "portal_invoice_list", -> "portal_payment_method_update", -> "portal_subscription_cancel", -> "portal_subscription_pause", -> "portal_subscription_update" -> ] -> } -27213c32976,32980 -< "x-expandableFields": [] ---- -> "x-expandableFields": [], -> "x-stripeResource": { -> "class_name": "InvoiceHistory", -> "in_class": "portal_features" -> } -27230c32997,32998 -< "enabled" ---- -> "enabled", -> "url" -27234c33002,33006 -< "x-expandableFields": [] ---- -> "x-expandableFields": [], -> "x-stripeResource": { -> "class_name": "LoginPage", -> "in_class": "billing_portal.configuration" -> } -27249c33021,33025 -< "x-expandableFields": [] ---- -> "x-expandableFields": [], -> "x-stripeResource": { -> "class_name": "PaymentMethodUpdate", -> "in_class": "portal_features" -> } -27289c33065,33072 -< ] ---- -> ], -> "x-stripeResource": { -> "class_name": "SubscriptionCancel", -> "in_class": "portal_features", -> "inner_classes": [ -> "portal_subscription_cancellation_reason" -> ] -> } -27322c33105,33109 -< "x-expandableFields": [] ---- -> "x-expandableFields": [], -> "x-stripeResource": { -> "class_name": "CancellationReason", -> "in_class": "portal_subscription_cancel" -> } -27337c33124,33128 -< "x-expandableFields": [] ---- -> "x-expandableFields": [], -> "x-stripeResource": { -> "class_name": "SubscriptionPause", -> "in_class": "portal_features" -> } -27378a33170 -> "products", -27385c33177,33184 -< ] ---- -> ], -> "x-stripeResource": { -> "class_name": "SubscriptionUpdate", -> "in_class": "portal_features", -> "inner_classes": [ -> "portal_subscription_update_product" -> ] -> } -27410c33209,33213 -< "x-expandableFields": [] ---- -> "x-expandableFields": [], -> "x-stripeResource": { -> "class_name": "Product", -> "in_class": "portal_subscription_update" -> } -27581a33385 -> "custom_unit_amount", -27583a33388 -> "lookup_key", -27584a33390 -> "nickname", -27587c33393,33399 -< "type" ---- -> "recurring", -> "tax_behavior", -> "tiers_mode", -> "transform_quantity", -> "type", -> "unit_amount", -> "unit_amount_decimal" -27599c33411,33461 -< "x-resourceId": "price" ---- -> "x-resourceId": "price", -> "x-stripeOperations": [ -> { -> "method_name": "search", -> "method_on": "service", -> "method_type": "custom", -> "operation": "get", -> "path": "/v1/prices/search" -> }, -> { -> "method_name": "list", -> "method_on": "service", -> "method_type": "list", -> "operation": "get", -> "path": "/v1/prices" -> }, -> { -> "method_name": "create", -> "method_on": "service", -> "method_type": "create", -> "operation": "post", -> "path": "/v1/prices" -> }, -> { -> "method_name": "retrieve", -> "method_on": "service", -> "method_type": "retrieve", -> "operation": "get", -> "path": "/v1/prices/{price}" -> }, -> { -> "method_name": "update", -> "method_on": "service", -> "method_type": "update", -> "operation": "post", -> "path": "/v1/prices/{price}" -> } -> ], -> "x-stripeResource": { -> "class_name": "Price", -> "has_collection_class": true, -> "has_search_result_class": true, -> "in_package": "", -> "inner_classes": [ -> "currency_option", -> "custom_unit_amount", -> "price_tier", -> "recurring", -> "transform_quantity" -> ] -> } -27631a33494,33500 -> "required": [ -> "flat_amount", -> "flat_amount_decimal", -> "unit_amount", -> "unit_amount_decimal", -> "up_to" -> ], -27634c33503,33507 -< "x-expandableFields": [] ---- -> "x-expandableFields": [], -> "x-stripeResource": { -> "class_name": "Tier", -> "in_class": "price" -> } -27642a33516,33530 -> "attributes": { -> "description": "A list of up to 5 attributes that each SKU can provide values for (e.g., `[\"color\", \"size\"]`).", -> "items": { -> "maxLength": 5000, -> "type": "string" -> }, -> "nullable": true, -> "type": "array" -> }, -> "caption": { -> "description": "A short one-line description of the product, meant to be displayable to the customer. Only applicable to products of `type=good`.", -> "maxLength": 5000, -> "nullable": true, -> "type": "string" -> }, -27647a33536,33543 -> "deactivate_on": { -> "description": "An array of connect application identifiers that cannot purchase this product. Only applicable to products of `type=good`.", -> "items": { -> "maxLength": 5000, -> "type": "string" -> }, -> "type": "array" -> }, -27750a33647,33654 -> "type": { -> "description": "The type of the product. The product is either of type `good`, which is eligible for use with Orders and SKUs, or `service`, which is eligible for use with Subscriptions and Plans.", -> "enum": [ -> "good", -> "service" -> ], -> "type": "string" -> }, -27770a33675 -> "attributes", -27771a33677 -> "description", -27778c33684,33689 -< "updated" ---- -> "package_dimensions", -> "shippable", -> "tax_code", -> "type", -> "updated", -> "url" -27787c33698,33748 -< "x-resourceId": "product" ---- -> "x-resourceId": "product", -> "x-stripeOperations": [ -> { -> "method_name": "search", -> "method_on": "service", -> "method_type": "custom", -> "operation": "get", -> "path": "/v1/products/search" -> }, -> { -> "method_name": "create", -> "method_on": "service", -> "method_type": "create", -> "operation": "post", -> "path": "/v1/products" -> }, -> { -> "method_name": "retrieve", -> "method_on": "service", -> "method_type": "retrieve", -> "operation": "get", -> "path": "/v1/products/{id}" -> }, -> { -> "method_name": "update", -> "method_on": "service", -> "method_type": "update", -> "operation": "post", -> "path": "/v1/products/{id}" -> }, -> { -> "method_name": "list", -> "method_on": "service", -> "method_type": "list", -> "operation": "get", -> "path": "/v1/products" -> }, -> { -> "method_name": "delete", -> "method_on": "service", -> "method_type": "delete", -> "operation": "delete", -> "path": "/v1/products/{id}" -> } -> ], -> "x-stripeResource": { -> "class_name": "Product", -> "has_collection_class": true, -> "has_search_result_class": true, -> "in_package": "" -> } -27883a33845,33846 -> "customer", -> "expires_at", -27885a33849,33850 -> "max_redemptions", -> "metadata", -27897c33862,33901 -< "x-resourceId": "promotion_code" ---- -> "x-resourceId": "promotion_code", -> "x-stripeOperations": [ -> { -> "method_name": "retrieve", -> "method_on": "service", -> "method_type": "retrieve", -> "operation": "get", -> "path": "/v1/promotion_codes/{promotion_code}" -> }, -> { -> "method_name": "create", -> "method_on": "service", -> "method_type": "create", -> "operation": "post", -> "path": "/v1/promotion_codes" -> }, -> { -> "method_name": "update", -> "method_on": "service", -> "method_type": "update", -> "operation": "post", -> "path": "/v1/promotion_codes/{promotion_code}" -> }, -> { -> "method_name": "list", -> "method_on": "service", -> "method_type": "list", -> "operation": "get", -> "path": "/v1/promotion_codes" -> } -> ], -> "x-stripeResource": { -> "class_name": "PromotionCode", -> "has_collection_class": true, -> "in_package": "", -> "inner_classes": [ -> "promotion_code_currency_option", -> "promotion_codes_resource_restrictions" -> ] -> } -27912c33916,33920 -< "x-expandableFields": [] ---- -> "x-expandableFields": [], -> "x-stripeResource": { -> "class_name": "CurrencyOption", -> "in_class": "promotion_code" -> } -27941c33949,33951 -< "first_time_transaction" ---- -> "first_time_transaction", -> "minimum_amount", -> "minimum_amount_currency" -27947c33957,33961 -< ] ---- -> ], -> "x-stripeResource": { -> "class_name": "Restrictions", -> "in_class": "promotion_code" -> } -28338a34353,34355 -> "application", -> "application_fee_amount", -> "application_fee_percent", -28342a34360,34362 -> "currency", -> "customer", -> "description", -28344a34365,34367 -> "footer", -> "from_quote", -> "header", -28345a34369,34370 -> "invoice", -> "invoice_settings", -28347a34373 -> "number", -28348a34375 -> "on_behalf_of", -28350a34378 -> "subscription", -28352c34380,34383 -< "total_details" ---- -> "subscription_schedule", -> "test_clock", -> "total_details", -> "transfer_data" -28376c34407,34496 -< "x-resourceId": "quote" ---- -> "x-resourceId": "quote", -> "x-stripeOperations": [ -> { -> "method_name": "retrieve", -> "method_on": "service", -> "method_type": "retrieve", -> "operation": "get", -> "path": "/v1/quotes/{quote}" -> }, -> { -> "method_name": "create", -> "method_on": "service", -> "method_type": "create", -> "operation": "post", -> "path": "/v1/quotes" -> }, -> { -> "method_name": "update", -> "method_on": "service", -> "method_type": "update", -> "operation": "post", -> "path": "/v1/quotes/{quote}" -> }, -> { -> "method_name": "cancel", -> "method_on": "service", -> "method_type": "custom", -> "operation": "post", -> "path": "/v1/quotes/{quote}/cancel" -> }, -> { -> "method_name": "finalize_quote", -> "method_on": "service", -> "method_type": "custom", -> "operation": "post", -> "path": "/v1/quotes/{quote}/finalize" -> }, -> { -> "method_name": "accept", -> "method_on": "service", -> "method_type": "custom", -> "operation": "post", -> "path": "/v1/quotes/{quote}/accept" -> }, -> { -> "method_name": "list", -> "method_on": "service", -> "method_type": "list", -> "operation": "get", -> "path": "/v1/quotes" -> }, -> { -> "method_name": "list_line_items", -> "method_on": "service", -> "method_type": "custom", -> "operation": "get", -> "path": "/v1/quotes/{quote}/line_items" -> }, -> { -> "method_name": "list_computed_upfront_line_items", -> "method_on": "service", -> "method_type": "custom", -> "operation": "get", -> "path": "/v1/quotes/{quote}/computed_upfront_line_items" -> }, -> { -> "method_name": "pdf", -> "method_on": "service", -> "method_type": "custom", -> "operation": "get", -> "path": "/v1/quotes/{quote}/pdf" -> } -> ], -> "x-stripeResource": { -> "class_name": "Quote", -> "has_collection_class": true, -> "in_package": "", -> "inner_classes": [ -> "invoice_setting_quote_setting", -> "quotes_resource_automatic_tax", -> "quotes_resource_computed", -> "quotes_resource_from_quote", -> "quotes_resource_recurring", -> "quotes_resource_status_transitions", -> "quotes_resource_subscription_data", -> "quotes_resource_total_details", -> "quotes_resource_transfer_data", -> "quotes_resource_upfront" -> ] -> } -28397c34517,34518 -< "enabled" ---- -> "enabled", -> "status" -28401c34522,34526 -< "x-expandableFields": [] ---- -> "x-expandableFields": [], -> "x-stripeResource": { -> "class_name": "AutomaticTax", -> "in_class": "quote" -> } -28419a34545 -> "recurring", -28427c34553,34557 -< ] ---- -> ], -> "x-stripeResource": { -> "class_name": "Computed", -> "in_class": "quote" -> } -28464c34594,34598 -< ] ---- -> ], -> "x-stripeResource": { -> "class_name": "FromQuote", -> "in_class": "quote" -> } -28506c34640,34644 -< ] ---- -> ], -> "x-stripeResource": { -> "class_name": "Recurring", -> "in_class": "quote" -> } -28529a34668,34672 -> "required": [ -> "accepted_at", -> "canceled_at", -> "finalized_at" -> ], -28532c34675,34679 -< "x-expandableFields": [] ---- -> "x-expandableFields": [], -> "x-stripeResource": { -> "class_name": "StatusTransitions", -> "in_class": "quote" -> } -28554a34702,34706 -> "required": [ -> "description", -> "effective_date", -> "trial_period_days" -> ], -28557c34709,34713 -< "x-expandableFields": [] ---- -> "x-expandableFields": [], -> "x-stripeResource": { -> "class_name": "SubscriptionData", -> "in_class": "quote" -> } -28580a34737 -> "amount_shipping", -28587c34744,34751 -< ] ---- -> ], -> "x-stripeResource": { -> "class_name": "TotalDetails", -> "in_class": "quote", -> "inner_classes": [ -> "quotes_resource_total_details_resource_breakdown" -> ] -> } -28616c34780,34784 -< ] ---- -> ], -> "x-stripeResource": { -> "class_name": "Breakdown", -> "in_class": "quotes_resource_total_details" -> } -28651a34820,34821 -> "amount", -> "amount_percent", -28658c34828,34832 -< ] ---- -> ], -> "x-stripeResource": { -> "class_name": "TransferData", -> "in_class": "quote" -> } -28724c34898,34902 -< ] ---- -> ], -> "x-stripeResource": { -> "class_name": "Upfront", -> "in_class": "quote" -> } -28813c34991,35012 -< "x-resourceId": "radar.early_fraud_warning" ---- -> "x-resourceId": "radar.early_fraud_warning", -> "x-stripeOperations": [ -> { -> "method_name": "list", -> "method_on": "service", -> "method_type": "list", -> "operation": "get", -> "path": "/v1/radar/early_fraud_warnings" -> }, -> { -> "method_name": "retrieve", -> "method_on": "service", -> "method_type": "retrieve", -> "operation": "get", -> "path": "/v1/radar/early_fraud_warnings/{early_fraud_warning}" -> } -> ], -> "x-stripeResource": { -> "class_name": "EarlyFraudWarning", -> "has_collection_class": true, -> "in_package": "Radar" -> } -28933c35132,35174 -< "x-resourceId": "radar.value_list" ---- -> "x-resourceId": "radar.value_list", -> "x-stripeOperations": [ -> { -> "method_name": "list", -> "method_on": "service", -> "method_type": "list", -> "operation": "get", -> "path": "/v1/radar/value_lists" -> }, -> { -> "method_name": "retrieve", -> "method_on": "service", -> "method_type": "retrieve", -> "operation": "get", -> "path": "/v1/radar/value_lists/{value_list}" -> }, -> { -> "method_name": "create", -> "method_on": "service", -> "method_type": "create", -> "operation": "post", -> "path": "/v1/radar/value_lists" -> }, -> { -> "method_name": "update", -> "method_on": "service", -> "method_type": "update", -> "operation": "post", -> "path": "/v1/radar/value_lists/{value_list}" -> }, -> { -> "method_name": "delete", -> "method_on": "service", -> "method_type": "delete", -> "operation": "delete", -> "path": "/v1/radar/value_lists/{value_list}" -> } -> ], -> "x-stripeResource": { -> "class_name": "ValueList", -> "has_collection_class": true, -> "in_package": "Radar" -> } -28987c35228,35263 -< "x-resourceId": "radar.value_list_item" ---- -> "x-resourceId": "radar.value_list_item", -> "x-stripeOperations": [ -> { -> "method_name": "list", -> "method_on": "service", -> "method_type": "list", -> "operation": "get", -> "path": "/v1/radar/value_list_items" -> }, -> { -> "method_name": "retrieve", -> "method_on": "service", -> "method_type": "retrieve", -> "operation": "get", -> "path": "/v1/radar/value_list_items/{item}" -> }, -> { -> "method_name": "create", -> "method_on": "service", -> "method_type": "create", -> "operation": "post", -> "path": "/v1/radar/value_list_items" -> }, -> { -> "method_name": "delete", -> "method_on": "service", -> "method_type": "delete", -> "operation": "delete", -> "path": "/v1/radar/value_list_items/{item}" -> } -> ], -> "x-stripeResource": { -> "class_name": "ValueListItem", -> "has_collection_class": true, -> "in_package": "Radar" -> } -29000c35276,35280 -< "x-expandableFields": [] ---- -> "x-expandableFields": [], -> "x-stripeResource": { -> "class_name": "RadarOptions", -> "in_class": "charge" -> } -29033a35314,35320 -> "required": [ -> "city", -> "country", -> "latitude", -> "longitude", -> "region" -> ], -29036c35323,35327 -< "x-expandableFields": [] ---- -> "x-expandableFields": [], -> "x-stripeResource": { -> "class_name": "Location", -> "in_class": "review" -> } -29065a35357,35362 -> "required": [ -> "browser", -> "device", -> "platform", -> "version" -> ], -29068c35365,35369 -< "x-expandableFields": [] ---- -> "x-expandableFields": [], -> "x-stripeResource": { -> "class_name": "Session", -> "in_class": "review" -> } -29092c35393,35397 -< "x-expandableFields": [] ---- -> "x-expandableFields": [], -> "x-stripeResource": { -> "class_name": "FinancialAccount", -> "in_class": "treasury_shared_resource_initiating_payment_method_details_initiating_payment_method_details" -> } -29121a35427,35431 -> "trial_period_days": { -> "description": "Default number of trial days when subscribing a customer to this price using [`trial_from_plan=true`](https://stripe.com/docs/api#create_subscription-trial_from_plan).", -> "nullable": true, -> "type": "integer" -> }, -29131a35442 -> "aggregate_usage", -29133a35445 -> "trial_period_days", -29138c35450,35454 -< "x-expandableFields": [] ---- -> "x-expandableFields": [], -> "x-stripeResource": { -> "class_name": "Recurring", -> "in_class": "price" -> } -29340a35657,35658 -> "balance_transaction", -> "charge", -29344c35662,35669 -< "object" ---- -> "metadata", -> "object", -> "payment_intent", -> "reason", -> "receipt_number", -> "source_transfer_reversal", -> "status", -> "transfer_reversal" -29357c35682,35752 -< "x-resourceId": "refund" ---- -> "x-resourceId": "refund", -> "x-stripeOperations": [ -> { -> "method_name": "list", -> "method_on": "collection", -> "method_type": "list", -> "operation": "get", -> "path": "/v1/charges/{charge}/refunds" -> }, -> { -> "method_name": "retrieve", -> "method_on": "collection", -> "method_type": "retrieve", -> "operation": "get", -> "path": "/v1/charges/{charge}/refunds/{refund}" -> }, -> { -> "method_name": "list", -> "method_on": "service", -> "method_type": "list", -> "operation": "get", -> "path": "/v1/refunds" -> }, -> { -> "method_name": "create", -> "method_on": "service", -> "method_type": "create", -> "operation": "post", -> "path": "/v1/refunds" -> }, -> { -> "method_name": "retrieve", -> "method_on": "service", -> "method_type": "retrieve", -> "operation": "get", -> "path": "/v1/refunds/{refund}" -> }, -> { -> "method_name": "update", -> "method_on": "service", -> "method_type": "update", -> "operation": "post", -> "path": "/v1/refunds/{refund}" -> }, -> { -> "method_name": "cancel", -> "method_on": "service", -> "method_type": "custom", -> "operation": "post", -> "path": "/v1/refunds/{refund}/cancel" -> }, -> { -> "method_name": "expire", -> "method_on": "service", -> "method_type": "custom", -> "operation": "post", -> "path": "/v1/test_helpers/refunds/{refund}/expire" -> } -> ], -> "x-stripeResource": { -> "class_name": "Refund", -> "has_collection_class": true, -> "in_package": "", -> "inner_classes": [ -> "refund_next_action", -> "refund_next_action_display_details" -> ], -> "polymorphic_groups": [ -> "balance_transaction_source" -> ] -> } -29377a35773 -> "display_details", -29384c35780,35784 -< ] ---- -> ], -> "x-stripeResource": { -> "class_name": "NextAction", -> "in_class": "refund" -> } -29406c35806,35813 -< ] ---- -> ], -> "x-stripeResource": { -> "class_name": "NextActionDisplayDetails", -> "in_class": "refund", -> "inner_classes": [ -> "email_sent" -> ] -> } -29468a35876 -> "error", -29474c35882,35884 -< "status" ---- -> "result", -> "status", -> "succeeded_at" -29482c35892,35923 -< "x-resourceId": "reporting.report_run" ---- -> "x-resourceId": "reporting.report_run", -> "x-stripeOperations": [ -> { -> "method_name": "retrieve", -> "method_on": "service", -> "method_type": "retrieve", -> "operation": "get", -> "path": "/v1/reporting/report_runs/{report_run}" -> }, -> { -> "method_name": "create", -> "method_on": "service", -> "method_type": "create", -> "operation": "post", -> "path": "/v1/reporting/report_runs" -> }, -> { -> "method_name": "list", -> "method_on": "service", -> "method_type": "list", -> "operation": "get", -> "path": "/v1/reporting/report_runs" -> } -> ], -> "x-stripeResource": { -> "class_name": "ReportRun", -> "has_collection_class": true, -> "in_package": "Reporting", -> "inner_classes": [ -> "financial_reporting_finance_report_run_run_parameters" -> ] -> } -29539a35981 -> "default_columns", -29550c35992,36013 -< "x-resourceId": "reporting.report_type" ---- -> "x-resourceId": "reporting.report_type", -> "x-stripeOperations": [ -> { -> "method_name": "retrieve", -> "method_on": "service", -> "method_type": "retrieve", -> "operation": "get", -> "path": "/v1/reporting/report_types/{report_type}" -> }, -> { -> "method_name": "list", -> "method_on": "service", -> "method_type": "list", -> "operation": "get", -> "path": "/v1/reporting/report_types" -> } -> ], -> "x-stripeResource": { -> "class_name": "ReportType", -> "has_collection_class": true, -> "in_package": "Reporting" -> } -29583a36047 -> "description", -29589c36053,36060 -< "x-expandableFields": [] ---- -> "x-expandableFields": [], -> "x-stripeResource": { -> "class_name": "ReserveTransaction", -> "in_package": "", -> "polymorphic_groups": [ -> "balance_transaction_source" -> ] -> } -29714a36186,36188 -> "billing_zip", -> "charge", -> "closed_reason", -29716a36191,36192 -> "ip_address", -> "ip_address_location", -29721c36197,36198 -< "reason" ---- -> "reason", -> "session" -29731c36208,36240 -< "x-resourceId": "review" ---- -> "x-resourceId": "review", -> "x-stripeOperations": [ -> { -> "method_name": "list", -> "method_on": "service", -> "method_type": "list", -> "operation": "get", -> "path": "/v1/reviews" -> }, -> { -> "method_name": "retrieve", -> "method_on": "service", -> "method_type": "retrieve", -> "operation": "get", -> "path": "/v1/reviews/{review}" -> }, -> { -> "method_name": "approve", -> "method_on": "service", -> "method_type": "custom", -> "operation": "post", -> "path": "/v1/reviews/{review}/approve" -> } -> ], -> "x-stripeResource": { -> "class_name": "Review", -> "has_collection_class": true, -> "in_package": "", -> "inner_classes": [ -> "radar_review_resource_location", -> "radar_review_resource_session" -> ] -> } -29759c36268,36272 -< "x-expandableFields": [] ---- -> "x-expandableFields": [], -> "x-stripeResource": { -> "class_name": "Rule", -> "in_package": "Radar" -> } -29825a36339 -> "file", -29840c36354,36378 -< "x-resourceId": "scheduled_query_run" ---- -> "x-resourceId": "scheduled_query_run", -> "x-stripeOperations": [ -> { -> "method_name": "list", -> "method_on": "service", -> "method_type": "list", -> "operation": "get", -> "path": "/v1/sigma/scheduled_query_runs" -> }, -> { -> "method_name": "retrieve", -> "method_on": "service", -> "method_type": "retrieve", -> "operation": "get", -> "path": "/v1/sigma/scheduled_query_runs/{scheduled_query_run}" -> } -> ], -> "x-stripeResource": { -> "class_name": "ScheduledQueryRun", -> "has_collection_class": true, -> "in_package": "Sigma", -> "inner_classes": [ -> "sigma_scheduled_query_run_error" -> ] -> } -29855c36393,36397 -< "x-expandableFields": [] ---- -> "x-expandableFields": [], -> "x-stripeResource": { -> "class_name": "AutomaticTax", -> "in_class": "subscription_schedule_phase_configuration" -> } -29879c36421,36425 -< "x-expandableFields": [] ---- -> "x-expandableFields": [], -> "x-stripeResource": { -> "class_name": "Scope", -> "in_class": "apps.secret" -> } -29924a36471,36474 -> "required": [ -> "charge", -> "setup_attempt" -> ], -29930c36480,36484 -< ] ---- -> ], -> "x-stripeResource": { -> "class_name": "GeneratedFrom", -> "in_class": "payment_method_sepa_debit" -> } -30099a36654 -> "application", -30100a36656,36657 -> "customer", -> "flow_directions", -30103a36661 -> "on_behalf_of", -30105a36664 -> "setup_error", -30121c36680,36697 -< "x-resourceId": "setup_attempt" ---- -> "x-resourceId": "setup_attempt", -> "x-stripeOperations": [ -> { -> "method_name": "list", -> "method_on": "service", -> "method_type": "list", -> "operation": "get", -> "path": "/v1/setup_attempts" -> } -> ], -> "x-stripeResource": { -> "class_name": "SetupAttempt", -> "has_collection_class": true, -> "in_package": "", -> "inner_classes": [ -> "setup_attempt_payment_method_details" -> ] -> } -30194c36770,36790 -< ] ---- -> ], -> "x-stripeResource": { -> "class_name": "PaymentMethodDetails", -> "in_class": "setup_attempt", -> "inner_classes": [ -> "setup_attempt_payment_method_details_acss_debit", -> "setup_attempt_payment_method_details_au_becs_debit", -> "setup_attempt_payment_method_details_bacs_debit", -> "setup_attempt_payment_method_details_bancontact", -> "setup_attempt_payment_method_details_blik", -> "setup_attempt_payment_method_details_boleto", -> "setup_attempt_payment_method_details_card", -> "setup_attempt_payment_method_details_card_present", -> "setup_attempt_payment_method_details_ideal", -> "setup_attempt_payment_method_details_klarna", -> "setup_attempt_payment_method_details_link", -> "setup_attempt_payment_method_details_sepa_debit", -> "setup_attempt_payment_method_details_sofort", -> "setup_attempt_payment_method_details_us_bank_account" -> ] -> } -30201c36797,36801 -< "x-expandableFields": [] ---- -> "x-expandableFields": [], -> "x-stripeResource": { -> "class_name": "AcssDebit", -> "in_class": "setup_attempt_payment_method_details" -> } -30208c36808,36812 -< "x-expandableFields": [] ---- -> "x-expandableFields": [], -> "x-stripeResource": { -> "class_name": "AuBecsDebit", -> "in_class": "setup_attempt_payment_method_details" -> } -30215c36819,36823 -< "x-expandableFields": [] ---- -> "x-expandableFields": [], -> "x-stripeResource": { -> "class_name": "BacsDebit", -> "in_class": "setup_attempt_payment_method_details" -> } -30301a36910,36919 -> "required": [ -> "bank_code", -> "bank_name", -> "bic", -> "generated_sepa_debit", -> "generated_sepa_debit_mandate", -> "iban_last4", -> "preferred_language", -> "verified_name" -> ], -30307c36925,36929 -< ] ---- -> ], -> "x-stripeResource": { -> "class_name": "Bancontact", -> "in_class": "setup_attempt_payment_method_details" -> } -30314c36936,36940 -< "x-expandableFields": [] ---- -> "x-expandableFields": [], -> "x-stripeResource": { -> "class_name": "Blik", -> "in_class": "setup_attempt_payment_method_details" -> } -30321c36947,36951 -< "x-expandableFields": [] ---- -> "x-expandableFields": [], -> "x-stripeResource": { -> "class_name": "Boleto", -> "in_class": "setup_attempt_payment_method_details" -> } -30335a36966,36968 -> "required": [ -> "three_d_secure" -> ], -30340c36973,36977 -< ] ---- -> ], -> "x-stripeResource": { -> "class_name": "Card", -> "in_class": "setup_attempt_payment_method_details" -> } -30365a37003,37005 -> "required": [ -> "generated_card" -> ], -30370c37010,37014 -< ] ---- -> ], -> "x-stripeResource": { -> "class_name": "CardPresent", -> "in_class": "setup_attempt_payment_method_details" -> } -30467a37112,37119 -> "required": [ -> "bank", -> "bic", -> "generated_sepa_debit", -> "generated_sepa_debit_mandate", -> "iban_last4", -> "verified_name" -> ], -30473c37125,37129 -< ] ---- -> ], -> "x-stripeResource": { -> "class_name": "Ideal", -> "in_class": "setup_attempt_payment_method_details" -> } -30480c37136,37140 -< "x-expandableFields": [] ---- -> "x-expandableFields": [], -> "x-stripeResource": { -> "class_name": "Klarna", -> "in_class": "setup_attempt_payment_method_details" -> } -30487c37147,37151 -< "x-expandableFields": [] ---- -> "x-expandableFields": [], -> "x-stripeResource": { -> "class_name": "Link", -> "in_class": "setup_attempt_payment_method_details" -> } -30494c37158,37162 -< "x-expandableFields": [] ---- -> "x-expandableFields": [], -> "x-stripeResource": { -> "class_name": "SepaDebit", -> "in_class": "setup_attempt_payment_method_details" -> } -30580a37249,37258 -> "required": [ -> "bank_code", -> "bank_name", -> "bic", -> "generated_sepa_debit", -> "generated_sepa_debit_mandate", -> "iban_last4", -> "preferred_language", -> "verified_name" -> ], -30586c37264,37268 -< ] ---- -> ], -> "x-stripeResource": { -> "class_name": "Sofort", -> "in_class": "setup_attempt_payment_method_details" -> } -30593c37275,37279 -< "x-expandableFields": [] ---- -> "x-expandableFields": [], -> "x-stripeResource": { -> "class_name": "UsBankAccount", -> "in_class": "setup_attempt_payment_method_details" -> } -30865a37552,37554 -> "application", -> "cancellation_reason", -> "client_secret", -30866a37556,37558 -> "customer", -> "description", -> "flow_directions", -30867a37560,37561 -> "last_setup_error", -> "latest_attempt", -30868a37563,37565 -> "mandate", -> "metadata", -> "next_action", -30869a37567,37569 -> "on_behalf_of", -> "payment_method", -> "payment_method_options", -30870a37571 -> "single_use_mandate", -30888c37589,37650 -< "x-resourceId": "setup_intent" ---- -> "x-resourceId": "setup_intent", -> "x-stripeOperations": [ -> { -> "method_name": "create", -> "method_on": "service", -> "method_type": "create", -> "operation": "post", -> "path": "/v1/setup_intents" -> }, -> { -> "method_name": "list", -> "method_on": "service", -> "method_type": "list", -> "operation": "get", -> "path": "/v1/setup_intents" -> }, -> { -> "method_name": "retrieve", -> "method_on": "service", -> "method_type": "retrieve", -> "operation": "get", -> "path": "/v1/setup_intents/{intent}" -> }, -> { -> "method_name": "update", -> "method_on": "service", -> "method_type": "update", -> "operation": "post", -> "path": "/v1/setup_intents/{intent}" -> }, -> { -> "method_name": "confirm", -> "method_on": "service", -> "method_type": "custom", -> "operation": "post", -> "path": "/v1/setup_intents/{intent}/confirm" -> }, -> { -> "method_name": "cancel", -> "method_on": "service", -> "method_type": "custom", -> "operation": "post", -> "path": "/v1/setup_intents/{intent}/cancel" -> }, -> { -> "method_name": "verify_microdeposits", -> "method_on": "service", -> "method_type": "custom", -> "operation": "post", -> "path": "/v1/setup_intents/{intent}/verify_microdeposits" -> } -> ], -> "x-stripeResource": { -> "class_name": "SetupIntent", -> "has_collection_class": true, -> "in_package": "", -> "inner_classes": [ -> "setup_intent_next_action", -> "setup_intent_next_action_redirect_to_url", -> "setup_intent_payment_method_options" -> ] -> } -30917c37679,37686 -< ] ---- -> ], -> "x-stripeResource": { -> "class_name": "NextAction", -> "in_class": "setup_intent", -> "inner_classes": [ -> "setup_intent_next_action_verify_with_microdeposits" -> ] -> } -30934a37704,37707 -> "required": [ -> "return_url", -> "url" -> ], -30937c37710,37714 -< "x-expandableFields": [] ---- -> "x-expandableFields": [], -> "x-stripeResource": { -> "class_name": "NextActionRedirectToUrl", -> "in_class": "setup_intent" -> } -30964c37741,37742 -< "hosted_verification_url" ---- -> "hosted_verification_url", -> "microdeposit_type" -30968c37746,37750 -< "x-expandableFields": [] ---- -> "x-expandableFields": [], -> "x-stripeResource": { -> "class_name": "VerifyWithMicrodeposits", -> "in_class": "setup_intent_next_action" -> } -30974,30981c37756 -< "anyOf": [ -< { -< "$ref": "#/components/schemas/setup_intent_payment_method_options_acss_debit" -< }, -< { -< "$ref": "#/components/schemas/setup_intent_type_specific_payment_method_options_client" -< } -< ] ---- -> "$ref": "#/components/schemas/setup_intent_payment_method_options_acss_debit" -30984,30991c37759 -< "anyOf": [ -< { -< "$ref": "#/components/schemas/setup_intent_payment_method_options_blik" -< }, -< { -< "$ref": "#/components/schemas/setup_intent_type_specific_payment_method_options_client" -< } -< ] ---- -> "$ref": "#/components/schemas/setup_intent_payment_method_options_blik" -30997,31004c37765 -< "anyOf": [ -< { -< "$ref": "#/components/schemas/setup_intent_payment_method_options_link" -< }, -< { -< "$ref": "#/components/schemas/setup_intent_type_specific_payment_method_options_client" -< } -< ] ---- -> "$ref": "#/components/schemas/setup_intent_payment_method_options_link" -31007,31014c37768 -< "anyOf": [ -< { -< "$ref": "#/components/schemas/setup_intent_payment_method_options_sepa_debit" -< }, -< { -< "$ref": "#/components/schemas/setup_intent_type_specific_payment_method_options_client" -< } -< ] ---- -> "$ref": "#/components/schemas/setup_intent_payment_method_options_sepa_debit" -31017,31024c37771 -< "anyOf": [ -< { -< "$ref": "#/components/schemas/setup_intent_payment_method_options_us_bank_account" -< }, -< { -< "$ref": "#/components/schemas/setup_intent_type_specific_payment_method_options_client" -< } -< ] ---- -> "$ref": "#/components/schemas/setup_intent_payment_method_options_us_bank_account" -31036c37783,37797 -< ] ---- -> ], -> "x-stripeResource": { -> "class_name": "PaymentMethodOptions", -> "in_class": "setup_intent", -> "inner_classes": [ -> "setup_intent_payment_method_options_acss_debit", -> "setup_intent_payment_method_options_blik", -> "setup_intent_payment_method_options_card", -> "setup_intent_payment_method_options_link", -> "setup_intent_payment_method_options_mandate_options_blik", -> "setup_intent_payment_method_options_mandate_options_sepa_debit", -> "setup_intent_payment_method_options_sepa_debit", -> "setup_intent_payment_method_options_us_bank_account" -> ] -> } -31063a37825,37827 -> "required": [ -> "currency" -> ], -31068c37832,37839 -< ] ---- -> ], -> "x-stripeResource": { -> "class_name": "AcssDebit", -> "in_class": "setup_intent_payment_method_options", -> "inner_classes": [ -> "setup_intent_payment_method_options_mandate_options_acss_debit" -> ] -> } -31081c37852,37856 -< ] ---- -> ], -> "x-stripeResource": { -> "class_name": "Blik", -> "in_class": "setup_intent_payment_method_options" -> } -31122a37898,37902 -> "required": [ -> "mandate_options", -> "network", -> "request_three_d_secure" -> ], -31127c37907,37914 -< ] ---- -> ], -> "x-stripeResource": { -> "class_name": "Card", -> "in_class": "setup_intent_payment_method_options", -> "inner_classes": [ -> "setup_intent_payment_method_options_card_mandate_options" -> ] -> } -31201a37989,37990 -> "description", -> "end_date", -31202a37992 -> "interval_count", -31204c37994,37995 -< "start_date" ---- -> "start_date", -> "supported_types" -31208c37999,38003 -< "x-expandableFields": [] ---- -> "x-expandableFields": [], -> "x-stripeResource": { -> "class_name": "MandateOptions", -> "in_class": "setup_intent_payment_method_options_card" -> } -31219a38015,38017 -> "required": [ -> "persistent_token" -> ], -31222c38020,38024 -< "x-expandableFields": [] ---- -> "x-expandableFields": [], -> "x-stripeResource": { -> "class_name": "Link", -> "in_class": "setup_intent_payment_method_options" -> } -31268a38071,38075 -> "required": [ -> "interval_description", -> "payment_schedule", -> "transaction_type" -> ], -31271c38078,38082 -< "x-expandableFields": [] ---- -> "x-expandableFields": [], -> "x-stripeResource": { -> "class_name": "MandateOptions", -> "in_class": "setup_intent_payment_method_options_acss_debit" -> } -31294a38106,38109 -> "required": [ -> "expires_after", -> "type" -> ], -31299c38114,38118 -< ] ---- -> ], -> "x-stripeResource": { -> "class_name": "BlikMandateOptions", -> "in_class": "setup_intent_payment_method_options" -> } -31306c38125,38129 -< "x-expandableFields": [] ---- -> "x-expandableFields": [], -> "x-stripeResource": { -> "class_name": "SepaDebitMandateOptions", -> "in_class": "setup_intent_payment_method_options" -> } -31319c38142,38146 -< ] ---- -> ], -> "x-stripeResource": { -> "class_name": "SepaDebit", -> "in_class": "setup_intent_payment_method_options" -> } -31342c38169,38173 -< ] ---- -> ], -> "x-stripeResource": { -> "class_name": "UsBankAccount", -> "in_class": "setup_intent_payment_method_options" -> } -31360c38191,38195 -< "x-expandableFields": [] ---- -> "x-expandableFields": [], -> "x-stripeResource": { -> "class_name": "SetupIntentTypeSpecificPaymentMethodOptionsClient", -> "in_package": "" -> } -31396c38231,38235 -< ] ---- -> ], -> "x-stripeResource": { -> "class_name": "ShippingDetails", -> "in_package": "" -> } -31492a38332,38333 -> "delivery_estimate", -> "display_name", -31496a38338,38339 -> "tax_behavior", -> "tax_code", -31506c38349,38389 -< "x-resourceId": "shipping_rate" ---- -> "x-resourceId": "shipping_rate", -> "x-stripeOperations": [ -> { -> "method_name": "list", -> "method_on": "service", -> "method_type": "list", -> "operation": "get", -> "path": "/v1/shipping_rates" -> }, -> { -> "method_name": "retrieve", -> "method_on": "service", -> "method_type": "retrieve", -> "operation": "get", -> "path": "/v1/shipping_rates/{shipping_rate_token}" -> }, -> { -> "method_name": "create", -> "method_on": "service", -> "method_type": "create", -> "operation": "post", -> "path": "/v1/shipping_rates" -> }, -> { -> "method_name": "update", -> "method_on": "service", -> "method_type": "update", -> "operation": "post", -> "path": "/v1/shipping_rates/{shipping_rate_token}" -> } -> ], -> "x-stripeResource": { -> "class_name": "ShippingRate", -> "has_collection_class": true, -> "in_package": "", -> "inner_classes": [ -> "shipping_rate_currency_option", -> "shipping_rate_delivery_estimate", -> "shipping_rate_fixed_amount" -> ] -> } -31531c38414,38418 -< "x-expandableFields": [] ---- -> "x-expandableFields": [], -> "x-stripeResource": { -> "class_name": "CurrencyOption", -> "in_class": "shipping_rate" -> } -31554a38442,38445 -> "required": [ -> "maximum", -> "minimum" -> ], -31560c38451,38458 -< ] ---- -> ], -> "x-stripeResource": { -> "class_name": "DeliveryEstimate", -> "in_class": "shipping_rate", -> "inner_classes": [ -> "shipping_rate_delivery_estimate_bound" -> ] -> } -31587c38485,38489 -< "x-expandableFields": [] ---- -> "x-expandableFields": [], -> "x-stripeResource": { -> "class_name": "DeliveryEstimateBound", -> "in_class": "shipping_rate_delivery_estimate" -> } -31616c38518,38522 -< ] ---- -> ], -> "x-stripeResource": { -> "class_name": "FixedAmount", -> "in_class": "shipping_rate" -> } -31632c38538,38542 -< "x-expandableFields": [] ---- -> "x-expandableFields": [], -> "x-stripeResource": { -> "class_name": "RunError", -> "in_class": "scheduled_query_run" -> } -31734a38645 -> "image", -31738a38650 -> "package_dimensions", -31750c38662,38707 -< "x-resourceId": "sku" ---- -> "x-resourceId": "sku", -> "x-stripeOperations": [ -> { -> "method_name": "retrieve", -> "method_on": "service", -> "method_type": "retrieve", -> "operation": "get", -> "path": "/v1/skus/{id}" -> }, -> { -> "method_name": "list", -> "method_on": "service", -> "method_type": "list", -> "operation": "get", -> "path": "/v1/skus" -> }, -> { -> "method_name": "update", -> "method_on": "service", -> "method_type": "update", -> "operation": "post", -> "path": "/v1/skus/{id}" -> }, -> { -> "method_name": "create", -> "method_on": "service", -> "method_type": "create", -> "operation": "post", -> "path": "/v1/skus" -> }, -> { -> "method_name": "delete", -> "method_on": "service", -> "method_type": "delete", -> "operation": "delete", -> "path": "/v1/skus/{id}" -> } -> ], -> "x-stripeResource": { -> "class_name": "Sku", -> "has_collection_class": true, -> "in_package": "", -> "inner_classes": [ -> "sku_inventory" -> ] -> } -31773c38730,38732 -< "type" ---- -> "quantity", -> "type", -> "value" -31777c38736,38740 -< "x-expandableFields": [] ---- -> "x-expandableFields": [], -> "x-stripeResource": { -> "class_name": "Inventory", -> "in_class": "sku" -> } -31896a38860,38862 -> "sepa_credit_transfer": { -> "$ref": "#/components/schemas/source_type_sepa_credit_transfer" -> }, -31936a38903 -> "sepa_credit_transfer", -31955a38923 -> "amount", -31957a38926 -> "currency", -31960a38930 -> "metadata", -31961a38932,38933 -> "owner", -> "statement_descriptor", -31963c38935,38936 -< "type" ---- -> "type", -> "usage" -31974c38947,39026 -< "x-resourceId": "source" ---- -> "x-resourceId": "source", -> "x-stripeOperations": [ -> { -> "method_name": "detach", -> "method_on": "service", -> "method_type": "custom", -> "operation": "delete", -> "path": "/v1/customers/{customer}/sources/{id}" -> }, -> { -> "method_name": "retrieve", -> "method_on": "service", -> "method_type": "retrieve", -> "operation": "get", -> "path": "/v1/sources/{source}" -> }, -> { -> "method_name": "create", -> "method_on": "service", -> "method_type": "create", -> "operation": "post", -> "path": "/v1/sources" -> }, -> { -> "method_name": "update", -> "method_on": "service", -> "method_type": "update", -> "operation": "post", -> "path": "/v1/sources/{source}" -> }, -> { -> "method_name": "verify", -> "method_on": "service", -> "method_type": "custom", -> "operation": "post", -> "path": "/v1/sources/{source}/verify" -> }, -> { -> "method_name": "source_transactions", -> "method_on": "service", -> "method_type": "custom", -> "operation": "get", -> "path": "/v1/sources/{source}/source_transactions" -> } -> ], -> "x-stripeResource": { -> "class_name": "Source", -> "in_package": "", -> "inner_classes": [ -> "source_code_verification_flow", -> "source_order", -> "source_order_item", -> "source_owner", -> "source_receiver_flow", -> "source_redirect_flow", -> "source_type_ach_credit_transfer", -> "source_type_ach_debit", -> "source_type_acss_debit", -> "source_type_alipay", -> "source_type_au_becs_debit", -> "source_type_bancontact", -> "source_type_card", -> "source_type_card_present", -> "source_type_eps", -> "source_type_giropay", -> "source_type_ideal", -> "source_type_klarna", -> "source_type_multibanco", -> "source_type_p24", -> "source_type_sepa_credit_transfer", -> "source_type_sepa_debit", -> "source_type_sofort", -> "source_type_three_d_secure", -> "source_type_wechat" -> ], -> "polymorphic_groups": [ -> "deleted_payment_source", -> "payment_source" -> ] -> } -31995c39047,39051 -< "x-expandableFields": [] ---- -> "x-expandableFields": [], -> "x-stripeResource": { -> "class_name": "CodeVerificationFlow", -> "in_class": "source" -> } -32054a39111 -> "amount", -32072c39129,39137 -< "x-resourceId": "source_mandate_notification" ---- -> "x-stripeResource": { -> "class_name": "SourceMandateNotification", -> "in_package": "", -> "inner_classes": [ -> "source_mandate_notification_acss_debit_data", -> "source_mandate_notification_bacs_debit_data", -> "source_mandate_notification_sepa_debit_data" -> ] -> } -32085c39150,39154 -< "x-expandableFields": [] ---- -> "x-expandableFields": [], -> "x-stripeResource": { -> "class_name": "AcssDebitData", -> "in_class": "source_mandate_notification" -> } -32098c39167,39171 -< "x-expandableFields": [] ---- -> "x-expandableFields": [], -> "x-stripeResource": { -> "class_name": "BacsDebitData", -> "in_class": "source_mandate_notification" -> } -32121c39194,39198 -< "x-expandableFields": [] ---- -> "x-expandableFields": [], -> "x-stripeResource": { -> "class_name": "SepaDebitData", -> "in_class": "source_mandate_notification" -> } -32153c39230,39231 -< "currency" ---- -> "currency", -> "items" -32160c39238,39242 -< ] ---- -> ], -> "x-stripeResource": { -> "class_name": "Order", -> "in_class": "source" -> } -32198a39281,39287 -> "required": [ -> "amount", -> "currency", -> "description", -> "parent", -> "type" -> ], -32201c39290,39294 -< "x-expandableFields": [] ---- -> "x-expandableFields": [], -> "x-stripeResource": { -> "class_name": "OrderItem", -> "in_class": "source" -> } -32260a39354,39363 -> "required": [ -> "address", -> "email", -> "name", -> "phone", -> "verified_address", -> "verified_email", -> "verified_name", -> "verified_phone" -> ], -32266c39369,39373 -< ] ---- -> ], -> "x-stripeResource": { -> "class_name": "Owner", -> "in_class": "source" -> } -32300a39408 -> "address", -32309c39417,39421 -< "x-expandableFields": [] ---- -> "x-expandableFields": [], -> "x-stripeResource": { -> "class_name": "ReceiverFlow", -> "in_class": "source" -> } -32336a39449 -> "failure_reason", -32343c39456,39460 -< "x-expandableFields": [] ---- -> "x-expandableFields": [], -> "x-stripeResource": { -> "class_name": "RedirectFlow", -> "in_class": "source" -> } -32445c39562,39574 -< "x-resourceId": "source_transaction" ---- -> "x-resourceId": "source_transaction", -> "x-stripeResource": { -> "class_name": "SourceTransaction", -> "has_collection_class": true, -> "in_package": "", -> "inner_classes": [ -> "source_transaction_ach_credit_transfer_data", -> "source_transaction_chf_credit_transfer_data", -> "source_transaction_gbp_credit_transfer_data", -> "source_transaction_paper_check_data", -> "source_transaction_sepa_credit_transfer_data" -> ] -> } -32473c39602,39606 -< "x-expandableFields": [] ---- -> "x-expandableFields": [], -> "x-stripeResource": { -> "class_name": "AchCreditTransferData", -> "in_class": "source_transaction" -> } -32506c39639,39643 -< "x-expandableFields": [] ---- -> "x-expandableFields": [], -> "x-stripeResource": { -> "class_name": "ChfCreditTransferData", -> "in_class": "source_transaction" -> } -32549c39686,39690 -< "x-expandableFields": [] ---- -> "x-expandableFields": [], -> "x-stripeResource": { -> "class_name": "GbpCreditTransferData", -> "in_class": "source_transaction" -> } -32567c39708,39712 -< "x-expandableFields": [] ---- -> "x-expandableFields": [], -> "x-stripeResource": { -> "class_name": "PaperCheckData", -> "in_class": "source_transaction" -> } -32590c39735,39739 -< "x-expandableFields": [] ---- -> "x-expandableFields": [], -> "x-stripeResource": { -> "class_name": "SepaCreditTransferData", -> "in_class": "source_transaction" -> } -32627c39776,39780 -< "type": "object" ---- -> "type": "object", -> "x-stripeResource": { -> "class_name": "AchCreditTransfer", -> "in_class": "source" -> } -32656c39809,39813 -< "type": "object" ---- -> "type": "object", -> "x-stripeResource": { -> "class_name": "AchDebit", -> "in_class": "source" -> } -32701c39858,39862 -< "type": "object" ---- -> "type": "object", -> "x-stripeResource": { -> "class_name": "AcssDebit", -> "in_class": "source" -> } -32718c39879,39883 -< "type": "object" ---- -> "type": "object", -> "x-stripeResource": { -> "class_name": "Alipay", -> "in_class": "source" -> } -32735c39900,39904 -< "type": "object" ---- -> "type": "object", -> "x-stripeResource": { -> "class_name": "AuBecsDebit", -> "in_class": "source" -> } -32764c39933,39937 -< "type": "object" ---- -> "type": "object", -> "x-stripeResource": { -> "class_name": "Bancontact", -> "in_class": "source" -> } -32787a39961,39963 -> "description": { -> "type": "string" -> }, -32806a39983,39988 -> "iin": { -> "type": "string" -> }, -> "issuer": { -> "type": "string" -> }, -32823c40005,40009 -< "type": "object" ---- -> "type": "object", -> "x-stripeResource": { -> "class_name": "Card", -> "in_class": "source" -> } -32857a40044,40046 -> "description": { -> "type": "string" -> }, -32883a40073,40078 -> "iin": { -> "type": "string" -> }, -> "issuer": { -> "type": "string" -> }, -32910c40105,40109 -< "type": "object" ---- -> "type": "object", -> "x-stripeResource": { -> "class_name": "CardPresent", -> "in_class": "source" -> } -32923c40122,40126 -< "type": "object" ---- -> "type": "object", -> "x-stripeResource": { -> "class_name": "Eps", -> "in_class": "source" -> } -32944c40147,40151 -< "type": "object" ---- -> "type": "object", -> "x-stripeResource": { -> "class_name": "Giropay", -> "in_class": "source" -> } -32965c40172,40176 -< "type": "object" ---- -> "type": "object", -> "x-stripeResource": { -> "class_name": "Ideal", -> "in_class": "source" -> } -33049c40260,40264 -< "type": "object" ---- -> "type": "object", -> "x-stripeResource": { -> "class_name": "Klarna", -> "in_class": "source" -> } -33094c40309,40313 -< "type": "object" ---- -> "type": "object", -> "x-stripeResource": { -> "class_name": "Multibanco", -> "in_class": "source" -> } -33103c40322,40379 -< "type": "object" ---- -> "type": "object", -> "x-stripeResource": { -> "class_name": "P24", -> "in_class": "source" -> } -> }, -> "source_type_sepa_credit_transfer": { -> "properties": { -> "bank_name": { -> "nullable": true, -> "type": "string" -> }, -> "bic": { -> "nullable": true, -> "type": "string" -> }, -> "iban": { -> "nullable": true, -> "type": "string" -> }, -> "refund_account_holder_address_city": { -> "nullable": true, -> "type": "string" -> }, -> "refund_account_holder_address_country": { -> "nullable": true, -> "type": "string" -> }, -> "refund_account_holder_address_line1": { -> "nullable": true, -> "type": "string" -> }, -> "refund_account_holder_address_line2": { -> "nullable": true, -> "type": "string" -> }, -> "refund_account_holder_address_postal_code": { -> "nullable": true, -> "type": "string" -> }, -> "refund_account_holder_address_state": { -> "nullable": true, -> "type": "string" -> }, -> "refund_account_holder_name": { -> "nullable": true, -> "type": "string" -> }, -> "refund_iban": { -> "nullable": true, -> "type": "string" -> } -> }, -> "type": "object", -> "x-stripeResource": { -> "class_name": "SepaCreditTransfer", -> "in_class": "source" -> } -33136c40412,40416 -< "type": "object" ---- -> "type": "object", -> "x-stripeResource": { -> "class_name": "SepaDebit", -> "in_class": "source" -> } -33169c40449,40453 -< "type": "object" ---- -> "type": "object", -> "x-stripeResource": { -> "class_name": "Sofort", -> "in_class": "source" -> } -33204a40489,40491 -> "description": { -> "type": "string" -> }, -33223a40511,40516 -> "iin": { -> "type": "string" -> }, -> "issuer": { -> "type": "string" -> }, -33240c40533,40537 -< "type": "object" ---- -> "type": "object", -> "x-stripeResource": { -> "class_name": "ThreeDSecure", -> "in_class": "source" -> } -33255c40552,40556 -< "type": "object" ---- -> "type": "object", -> "x-stripeResource": { -> "class_name": "Wechat", -> "in_class": "source" -> } -33408,33414c40709 -< "$ref": "#/components/schemas/bank_account" -< }, -< { -< "$ref": "#/components/schemas/card" -< }, -< { -< "$ref": "#/components/schemas/source" ---- -> "$ref": "#/components/schemas/payment_source" -33422,33428c40717 -< "$ref": "#/components/schemas/bank_account" -< }, -< { -< "$ref": "#/components/schemas/card" -< }, -< { -< "$ref": "#/components/schemas/source" ---- -> "$ref": "#/components/schemas/payment_source" -33431,33432c40720 -< }, -< "x-stripeBypassValidation": true ---- -> } -33709a40998,40999 -> "application", -> "application_fee_percent", -33711a41002,41003 -> "billing_thresholds", -> "cancel_at", -33712a41005 -> "canceled_at", -33718a41012,41017 -> "days_until_due", -> "default_payment_method", -> "default_source", -> "description", -> "discount", -> "ended_at", -33720a41020 -> "latest_invoice", -33722a41023 -> "next_pending_invoice_item_invoice", -33723a41025,41031 -> "on_behalf_of", -> "pause_collection", -> "payment_settings", -> "pending_invoice_item_interval", -> "pending_setup_intent", -> "pending_update", -> "schedule", -33725c41033,41037 -< "status" ---- -> "status", -> "test_clock", -> "transfer_data", -> "trial_end", -> "trial_start" -33750c41062,41129 -< "x-resourceId": "subscription" ---- -> "x-resourceId": "subscription", -> "x-stripeOperations": [ -> { -> "method_name": "search", -> "method_on": "service", -> "method_type": "custom", -> "operation": "get", -> "path": "/v1/subscriptions/search" -> }, -> { -> "method_name": "list", -> "method_on": "service", -> "method_type": "list", -> "operation": "get", -> "path": "/v1/subscriptions" -> }, -> { -> "method_name": "create", -> "method_on": "service", -> "method_type": "create", -> "operation": "post", -> "path": "/v1/subscriptions" -> }, -> { -> "method_name": "update", -> "method_on": "service", -> "method_type": "update", -> "operation": "post", -> "path": "/v1/subscriptions/{subscription_exposed_id}" -> }, -> { -> "method_name": "retrieve", -> "method_on": "service", -> "method_type": "retrieve", -> "operation": "get", -> "path": "/v1/subscriptions/{subscription_exposed_id}" -> }, -> { -> "method_name": "cancel", -> "method_on": "service", -> "method_type": "custom", -> "operation": "delete", -> "path": "/v1/subscriptions/{subscription_exposed_id}" -> }, -> { -> "method_name": "delete_discount", -> "method_on": "service", -> "method_type": "custom", -> "operation": "delete", -> "path": "/v1/subscriptions/{subscription_exposed_id}/discount" -> } -> ], -> "x-stripeResource": { -> "class_name": "Subscription", -> "has_collection_class": true, -> "has_search_result_class": true, -> "in_package": "", -> "inner_classes": [ -> "subscription_automatic_tax", -> "subscription_billing_thresholds", -> "subscription_pending_invoice_item_interval", -> "subscription_transfer_data", -> "subscriptions_resource_pause_collection", -> "subscriptions_resource_payment_method_options", -> "subscriptions_resource_payment_settings", -> "subscriptions_resource_pending_update" -> ] -> } -33765c41144,41148 -< "x-expandableFields": [] ---- -> "x-expandableFields": [], -> "x-stripeResource": { -> "class_name": "AutomaticTax", -> "in_class": "subscription" -> } -33780a41164,41167 -> "required": [ -> "amount_gte", -> "reset_billing_cycle_anchor" -> ], -33783c41170,41174 -< "x-expandableFields": [] ---- -> "x-expandableFields": [], -> "x-stripeResource": { -> "class_name": "BillingThresholds", -> "in_class": "subscription" -> } -33820a41212,41214 -> "plan": { -> "$ref": "#/components/schemas/plan" -> }, -33842a41237 -> "billing_thresholds", -33846a41242 -> "plan", -33848c41244,41245 -< "subscription" ---- -> "subscription", -> "tax_rates" -33853a41251 -> "plan", -33857c41255,41307 -< "x-resourceId": "subscription_item" ---- -> "x-resourceId": "subscription_item", -> "x-stripeOperations": [ -> { -> "method_name": "list", -> "method_on": "service", -> "method_type": "list", -> "operation": "get", -> "path": "/v1/subscription_items" -> }, -> { -> "method_name": "retrieve", -> "method_on": "service", -> "method_type": "retrieve", -> "operation": "get", -> "path": "/v1/subscription_items/{item}" -> }, -> { -> "method_name": "create", -> "method_on": "service", -> "method_type": "create", -> "operation": "post", -> "path": "/v1/subscription_items" -> }, -> { -> "method_name": "update", -> "method_on": "service", -> "method_type": "update", -> "operation": "post", -> "path": "/v1/subscription_items/{item}" -> }, -> { -> "method_name": "delete", -> "method_on": "service", -> "method_type": "delete", -> "operation": "delete", -> "path": "/v1/subscription_items/{item}" -> }, -> { -> "method_name": "usage_record_summaries", -> "method_on": "service", -> "method_type": "custom", -> "operation": "get", -> "path": "/v1/subscription_items/{subscription_item}/usage_record_summaries" -> } -> ], -> "x-stripeResource": { -> "class_name": "SubscriptionItem", -> "has_collection_class": true, -> "in_package": "", -> "inner_classes": [ -> "subscription_item_billing_thresholds" -> ] -> } -33867a41318,41320 -> "required": [ -> "usage_gte" -> ], -33870c41323,41327 -< "x-expandableFields": [] ---- -> "x-expandableFields": [], -> "x-stripeResource": { -> "class_name": "BillingThresholds", -> "in_class": "subscription_item" -> } -33904a41362,41365 -> "required": [ -> "network", -> "request_three_d_secure" -> ], -33909c41370,41377 -< ] ---- -> ], -> "x-stripeResource": { -> "class_name": "Card", -> "in_class": "subscriptions_resource_payment_method_options", -> "inner_classes": [ -> "invoice_mandate_options_card" -> ] -> } -33935c41403,41407 -< "x-expandableFields": [] ---- -> "x-expandableFields": [], -> "x-stripeResource": { -> "class_name": "PendingInvoiceItemInterval", -> "in_class": "subscription" -> } -34126a41599,41601 -> "application", -> "canceled_at", -> "completed_at", -34127a41603 -> "current_phase", -34132a41609 -> "metadata", -34135c41612,41616 -< "status" ---- -> "released_at", -> "released_subscription", -> "status", -> "subscription", -> "test_clock" -34148c41629,41686 -< "x-resourceId": "subscription_schedule" ---- -> "x-resourceId": "subscription_schedule", -> "x-stripeOperations": [ -> { -> "method_name": "list", -> "method_on": "service", -> "method_type": "list", -> "operation": "get", -> "path": "/v1/subscription_schedules" -> }, -> { -> "method_name": "create", -> "method_on": "service", -> "method_type": "create", -> "operation": "post", -> "path": "/v1/subscription_schedules" -> }, -> { -> "method_name": "retrieve", -> "method_on": "service", -> "method_type": "retrieve", -> "operation": "get", -> "path": "/v1/subscription_schedules/{schedule}" -> }, -> { -> "method_name": "update", -> "method_on": "service", -> "method_type": "update", -> "operation": "post", -> "path": "/v1/subscription_schedules/{schedule}" -> }, -> { -> "method_name": "cancel", -> "method_on": "service", -> "method_type": "custom", -> "operation": "post", -> "path": "/v1/subscription_schedules/{schedule}/cancel" -> }, -> { -> "method_name": "release", -> "method_on": "service", -> "method_type": "custom", -> "operation": "post", -> "path": "/v1/subscription_schedules/{schedule}/release" -> } -> ], -> "x-stripeResource": { -> "class_name": "SubscriptionSchedule", -> "has_collection_class": true, -> "in_package": "", -> "inner_classes": [ -> "invoice_setting_subscription_schedule_setting", -> "subscription_schedule_add_invoice_item", -> "subscription_schedule_configuration_item", -> "subscription_schedule_current_phase", -> "subscription_schedule_phase_configuration", -> "subscription_schedules_resource_default_settings" -> ] -> } -34193c41731,41732 -< "price" ---- -> "price", -> "quantity" -34200c41739,41743 -< ] ---- -> ], -> "x-stripeResource": { -> "class_name": "AddInvoiceItem", -> "in_class": "subscription_schedule" -> } -34213a41757,41781 -> "plan": { -> "anyOf": [ -> { -> "maxLength": 5000, -> "type": "string" -> }, -> { -> "$ref": "#/components/schemas/plan" -> }, -> { -> "$ref": "#/components/schemas/deleted_plan" -> } -> ], -> "description": "ID of the plan to which the customer should be subscribed.", -> "x-expansionResources": { -> "oneOf": [ -> { -> "$ref": "#/components/schemas/plan" -> }, -> { -> "$ref": "#/components/schemas/deleted_plan" -> } -> ] -> } -> }, -34252a41821,41822 -> "billing_thresholds", -> "plan", -34258a41829 -> "plan", -34261c41832,41836 -< ] ---- -> ], -> "x-stripeResource": { -> "class_name": "PhaseItem", -> "in_class": "subscription_schedule" -> } -34283c41858,41862 -< "x-expandableFields": [] ---- -> "x-expandableFields": [], -> "x-stripeResource": { -> "class_name": "CurrentPhase", -> "in_class": "subscription_schedule" -> } -34475a42055,42059 -> "application_fee_percent", -> "billing_cycle_anchor", -> "billing_thresholds", -> "collection_method", -> "coupon", -34476a42061,42062 -> "default_payment_method", -> "description", -34477a42064 -> "invoice_settings", -34478a42066,42067 -> "metadata", -> "on_behalf_of", -34480c42069,42071 -< "start_date" ---- -> "start_date", -> "transfer_data", -> "trial_end" -34495c42086,42093 -< ] ---- -> ], -> "x-stripeResource": { -> "class_name": "Phase", -> "in_class": "subscription_schedule", -> "inner_classes": [ -> "schedules_phase_automatic_tax" -> ] -> } -34600c42198,42206 -< "billing_cycle_anchor" ---- -> "application_fee_percent", -> "billing_cycle_anchor", -> "billing_thresholds", -> "collection_method", -> "default_payment_method", -> "description", -> "invoice_settings", -> "on_behalf_of", -> "transfer_data" -34611c42217,42224 -< ] ---- -> ], -> "x-stripeResource": { -> "class_name": "DefaultSettings", -> "in_class": "subscription_schedule", -> "inner_classes": [ -> "subscription_schedules_resource_default_settings_automatic_tax" -> ] -> } -34626c42239,42243 -< "x-expandableFields": [] ---- -> "x-expandableFields": [], -> "x-stripeResource": { -> "class_name": "AutomaticTax", -> "in_class": "subscription_schedules_resource_default_settings" -> } -34656a42274 -> "amount_percent", -34663c42281,42285 -< ] ---- -> ], -> "x-stripeResource": { -> "class_name": "TransferData", -> "in_class": "subscription" -> } -34685c42307,42308 -< "behavior" ---- -> "behavior", -> "resumes_at" -34689c42312,42316 -< "x-expandableFields": [] ---- -> "x-expandableFields": [], -> "x-stripeResource": { -> "class_name": "PauseCollection", -> "in_class": "subscription" -> } -34748a42376,42383 -> "required": [ -> "acss_debit", -> "bancontact", -> "card", -> "customer_balance", -> "konbini", -> "us_bank_account" -> ], -34758c42393,42400 -< ] ---- -> ], -> "x-stripeResource": { -> "class_name": "PaymentMethodOptions", -> "in_class": "subscription", -> "inner_classes": [ -> "subscription_payment_method_options_card" -> ] -> } -34792a42435 -> "sepa_credit_transfer", -34813a42457,42461 -> "required": [ -> "payment_method_options", -> "payment_method_types", -> "save_default_payment_method" -> ], -34818c42466,42470 -< ] ---- -> ], -> "x-stripeResource": { -> "class_name": "PaymentSettings", -> "in_class": "subscription" -> } -34855c42507,42511 -< "expires_at" ---- -> "billing_cycle_anchor", -> "expires_at", -> "subscription_items", -> "trial_end", -> "trial_from_plan" -34861c42517,42521 -< ] ---- -> ], -> "x-stripeResource": { -> "class_name": "PendingUpdate", -> "in_class": "subscription" -> } -34898c42558,42579 -< "x-resourceId": "tax_code" ---- -> "x-resourceId": "tax_code", -> "x-stripeOperations": [ -> { -> "method_name": "list", -> "method_on": "service", -> "method_type": "list", -> "operation": "get", -> "path": "/v1/tax_codes" -> }, -> { -> "method_name": "retrieve", -> "method_on": "service", -> "method_type": "retrieve", -> "operation": "get", -> "path": "/v1/tax_codes/{id}" -> } -> ], -> "x-stripeResource": { -> "class_name": "TaxCode", -> "has_collection_class": true, -> "in_package": "" -> } -34940c42621,42628 -< "x-expandableFields": [] ---- -> "x-expandableFields": [], -> "x-stripeResource": { -> "class_name": "TaxDeductedAtSource", -> "in_package": "", -> "polymorphic_groups": [ -> "balance_transaction_source" -> ] -> } -35065a42754 -> "country", -35066a42756 -> "customer", -35071c42761,42762 -< "value" ---- -> "value", -> "verification" -35079c42770,42829 -< "x-resourceId": "tax_id" ---- -> "x-resourceId": "tax_id", -> "x-stripeOperations": [ -> { -> "method_name": "create", -> "method_on": "collection", -> "method_type": "create", -> "operation": "post", -> "path": "/v1/customers/{customer}/tax_ids" -> }, -> { -> "method_name": "create", -> "method_on": "service", -> "method_type": "create", -> "operation": "post", -> "path": "/v1/customers/{customer}/tax_ids" -> }, -> { -> "method_name": "retrieve", -> "method_on": "collection", -> "method_type": "retrieve", -> "operation": "get", -> "path": "/v1/customers/{customer}/tax_ids/{id}" -> }, -> { -> "method_name": "retrieve", -> "method_on": "service", -> "method_type": "retrieve", -> "operation": "get", -> "path": "/v1/customers/{customer}/tax_ids/{id}" -> }, -> { -> "method_name": "list", -> "method_on": "collection", -> "method_type": "list", -> "operation": "get", -> "path": "/v1/customers/{customer}/tax_ids" -> }, -> { -> "method_name": "list", -> "method_on": "service", -> "method_type": "list", -> "operation": "get", -> "path": "/v1/customers/{customer}/tax_ids" -> }, -> { -> "method_name": "delete", -> "method_on": "service", -> "method_type": "delete", -> "operation": "delete", -> "path": "/v1/customers/{customer}/tax_ids/{id}" -> } -> ], -> "x-stripeResource": { -> "class_name": "TaxId", -> "has_collection_class": true, -> "in_package": "", -> "inner_classes": [ -> "tax_id_verification" -> ] -> } -35108c42858,42860 -< "status" ---- -> "status", -> "verified_address", -> "verified_name" -35112c42864,42868 -< "x-expandableFields": [] ---- -> "x-expandableFields": [], -> "x-stripeResource": { -> "class_name": "Verification", -> "in_class": "tax_id" -> } -35205a42962 -> "country", -35206a42964 -> "description", -35209a42968 -> "jurisdiction", -35210a42970 -> "metadata", -35212c42972,42974 -< "percentage" ---- -> "percentage", -> "state", -> "tax_type" -35217c42979,43014 -< "x-resourceId": "tax_rate" ---- -> "x-resourceId": "tax_rate", -> "x-stripeOperations": [ -> { -> "method_name": "list", -> "method_on": "service", -> "method_type": "list", -> "operation": "get", -> "path": "/v1/tax_rates" -> }, -> { -> "method_name": "retrieve", -> "method_on": "service", -> "method_type": "retrieve", -> "operation": "get", -> "path": "/v1/tax_rates/{tax_rate}" -> }, -> { -> "method_name": "create", -> "method_on": "service", -> "method_type": "create", -> "operation": "post", -> "path": "/v1/tax_rates" -> }, -> { -> "method_name": "update", -> "method_on": "service", -> "method_type": "update", -> "operation": "post", -> "path": "/v1/tax_rates/{tax_rate}" -> } -> ], -> "x-stripeResource": { -> "class_name": "TaxRate", -> "has_collection_class": true, -> "in_package": "" -> } -35254a43052 -> "is_account_default", -35265c43063,43110 -< "x-resourceId": "terminal.configuration" ---- -> "x-resourceId": "terminal.configuration", -> "x-stripeOperations": [ -> { -> "method_name": "create", -> "method_on": "service", -> "method_type": "create", -> "operation": "post", -> "path": "/v1/terminal/configurations" -> }, -> { -> "method_name": "list", -> "method_on": "service", -> "method_type": "list", -> "operation": "get", -> "path": "/v1/terminal/configurations" -> }, -> { -> "method_name": "retrieve", -> "method_on": "service", -> "method_type": "retrieve", -> "operation": "get", -> "path": "/v1/terminal/configurations/{configuration}" -> }, -> { -> "method_name": "update", -> "method_on": "service", -> "method_type": "update", -> "operation": "post", -> "path": "/v1/terminal/configurations/{configuration}" -> }, -> { -> "method_name": "delete", -> "method_on": "service", -> "method_type": "delete", -> "operation": "delete", -> "path": "/v1/terminal/configurations/{configuration}" -> } -> ], -> "x-stripeResource": { -> "class_name": "Configuration", -> "has_collection_class": true, -> "in_package": "Terminal", -> "inner_classes": [ -> "terminal_configuration_configuration_resource_currency_specific_config", -> "terminal_configuration_configuration_resource_device_type_specific_config", -> "terminal_configuration_configuration_resource_tipping" -> ] -> } -35295c43140,43153 -< "x-resourceId": "terminal.connection_token" ---- -> "x-resourceId": "terminal.connection_token", -> "x-stripeOperations": [ -> { -> "method_name": "create", -> "method_on": "service", -> "method_type": "create", -> "operation": "post", -> "path": "/v1/terminal/connection_tokens" -> } -> ], -> "x-stripeResource": { -> "class_name": "ConnectionToken", -> "in_package": "Terminal" -> } -35351c43209,43251 -< "x-resourceId": "terminal.location" ---- -> "x-resourceId": "terminal.location", -> "x-stripeOperations": [ -> { -> "method_name": "retrieve", -> "method_on": "service", -> "method_type": "retrieve", -> "operation": "get", -> "path": "/v1/terminal/locations/{location}" -> }, -> { -> "method_name": "create", -> "method_on": "service", -> "method_type": "create", -> "operation": "post", -> "path": "/v1/terminal/locations" -> }, -> { -> "method_name": "update", -> "method_on": "service", -> "method_type": "update", -> "operation": "post", -> "path": "/v1/terminal/locations/{location}" -> }, -> { -> "method_name": "list", -> "method_on": "service", -> "method_type": "list", -> "operation": "get", -> "path": "/v1/terminal/locations" -> }, -> { -> "method_name": "delete", -> "method_on": "service", -> "method_type": "delete", -> "operation": "delete", -> "path": "/v1/terminal/locations/{location}" -> } -> ], -> "x-stripeResource": { -> "class_name": "Location", -> "has_collection_class": true, -> "in_package": "Terminal" -> } -35450a43351,43352 -> "action", -> "device_sw_version", -35452a43355 -> "ip_address", -35454a43358 -> "location", -35457c43361,43362 -< "serial_number" ---- -> "serial_number", -> "status" -35465c43370,43450 -< "x-resourceId": "terminal.reader" ---- -> "x-resourceId": "terminal.reader", -> "x-stripeOperations": [ -> { -> "method_name": "update", -> "method_on": "service", -> "method_type": "update", -> "operation": "post", -> "path": "/v1/terminal/readers/{reader}" -> }, -> { -> "method_name": "retrieve", -> "method_on": "service", -> "method_type": "retrieve", -> "operation": "get", -> "path": "/v1/terminal/readers/{reader}" -> }, -> { -> "method_name": "create", -> "method_on": "service", -> "method_type": "create", -> "operation": "post", -> "path": "/v1/terminal/readers" -> }, -> { -> "method_name": "list", -> "method_on": "service", -> "method_type": "list", -> "operation": "get", -> "path": "/v1/terminal/readers" -> }, -> { -> "method_name": "delete", -> "method_on": "service", -> "method_type": "delete", -> "operation": "delete", -> "path": "/v1/terminal/readers/{reader}" -> }, -> { -> "method_name": "process_payment_intent", -> "method_on": "service", -> "method_type": "custom", -> "operation": "post", -> "path": "/v1/terminal/readers/{reader}/process_payment_intent" -> }, -> { -> "method_name": "process_setup_intent", -> "method_on": "service", -> "method_type": "custom", -> "operation": "post", -> "path": "/v1/terminal/readers/{reader}/process_setup_intent" -> }, -> { -> "method_name": "cancel_action", -> "method_on": "service", -> "method_type": "custom", -> "operation": "post", -> "path": "/v1/terminal/readers/{reader}/cancel_action" -> }, -> { -> "method_name": "set_reader_display", -> "method_on": "service", -> "method_type": "custom", -> "operation": "post", -> "path": "/v1/terminal/readers/{reader}/set_reader_display" -> }, -> { -> "method_name": "present_payment_method", -> "method_on": "service", -> "method_type": "custom", -> "operation": "post", -> "path": "/v1/test_helpers/terminal/readers/{reader}/present_payment_method" -> } -> ], -> "x-stripeResource": { -> "class_name": "Reader", -> "has_collection_class": true, -> "in_package": "Terminal", -> "inner_classes": [ -> "terminal_reader_reader_resource_reader_action" -> ] -> } -35493c43478,43482 -< "x-expandableFields": [] ---- -> "x-expandableFields": [], -> "x-stripeResource": { -> "class_name": "CurrencySpecificConfig", -> "in_class": "terminal.configuration" -> } -35522c43511,43515 -< ] ---- -> ], -> "x-stripeResource": { -> "class_name": "DeviceTypeSpecificConfig", -> "in_class": "terminal.configuration" -> } -35587c43580,43584 -< ] ---- -> ], -> "x-stripeResource": { -> "class_name": "Tipping", -> "in_class": "terminal.configuration" -> } -35615a43613 -> "tax", -35622c43620,43627 -< ] ---- -> ], -> "x-stripeResource": { -> "class_name": "Cart", -> "in_class": "terminal_reader_reader_resource_set_reader_display_action", -> "inner_classes": [ -> "terminal_reader_reader_resource_line_item" -> ] -> } -35648c43653,43657 -< "x-expandableFields": [] ---- -> "x-expandableFields": [], -> "x-stripeResource": { -> "class_name": "LineItem", -> "in_class": "terminal_reader_reader_resource_cart" -> } -35665c43674,43678 -< ] ---- -> ], -> "x-stripeResource": { -> "class_name": "ProcessConfig", -> "in_class": "terminal_reader_reader_resource_process_payment_intent_action" -> } -35701c43714,43722 -< ] ---- -> ], -> "x-stripeResource": { -> "class_name": "ProcessPaymentIntentAction", -> "in_class": "terminal_reader_reader_resource_reader_action", -> "inner_classes": [ -> "terminal_reader_reader_resource_process_config", -> "terminal_reader_reader_resource_tipping_config" -> ] -> } -35738c43759,43763 -< ] ---- -> ], -> "x-stripeResource": { -> "class_name": "ProcessSetupIntentAction", -> "in_class": "terminal_reader_reader_resource_reader_action" -> } -35784a43810,43811 -> "failure_code", -> "failure_message", -35794c43821,43830 -< ] ---- -> ], -> "x-stripeResource": { -> "class_name": "ReaderAction", -> "in_class": "terminal.reader", -> "inner_classes": [ -> "terminal_reader_reader_resource_process_payment_intent_action", -> "terminal_reader_reader_resource_process_setup_intent_action", -> "terminal_reader_reader_resource_set_reader_display_action" -> ] -> } -35816a43853 -> "cart", -35823c43860,43867 -< ] ---- -> ], -> "x-stripeResource": { -> "class_name": "SetReaderDisplayAction", -> "in_class": "terminal_reader_reader_resource_reader_action", -> "inner_classes": [ -> "terminal_reader_reader_resource_cart" -> ] -> } -35835c43879,43883 -< "x-expandableFields": [] ---- -> "x-expandableFields": [], -> "x-stripeResource": { -> "class_name": "TippingConfig", -> "in_class": "terminal_reader_reader_resource_process_payment_intent_action" -> } -35892a43941 -> "name", -35899c43948,43990 -< "x-resourceId": "test_helpers.test_clock" ---- -> "x-resourceId": "test_helpers.test_clock", -> "x-stripeOperations": [ -> { -> "method_name": "retrieve", -> "method_on": "service", -> "method_type": "retrieve", -> "operation": "get", -> "path": "/v1/test_helpers/test_clocks/{test_clock}" -> }, -> { -> "method_name": "create", -> "method_on": "service", -> "method_type": "create", -> "operation": "post", -> "path": "/v1/test_helpers/test_clocks" -> }, -> { -> "method_name": "delete", -> "method_on": "service", -> "method_type": "delete", -> "operation": "delete", -> "path": "/v1/test_helpers/test_clocks/{test_clock}" -> }, -> { -> "method_name": "advance", -> "method_on": "service", -> "method_type": "custom", -> "operation": "post", -> "path": "/v1/test_helpers/test_clocks/{test_clock}/advance" -> }, -> { -> "method_name": "list", -> "method_on": "service", -> "method_type": "list", -> "operation": "get", -> "path": "/v1/test_helpers/test_clocks" -> } -> ], -> "x-stripeResource": { -> "class_name": "TestClock", -> "has_collection_class": true, -> "in_package": "TestHelpers" -> } -35951a44043,44048 -> "required": [ -> "authentication_flow", -> "result", -> "result_reason", -> "version" -> ], -35954c44051,44055 -< "x-expandableFields": [] ---- -> "x-expandableFields": [], -> "x-stripeResource": { -> "class_name": "ThreeDSecure", -> "in_class": "payment_method_details_card" -> } -35969c44070,44074 -< "x-expandableFields": [] ---- -> "x-expandableFields": [], -> "x-stripeResource": { -> "class_name": "ThreeDSecureUsage", -> "in_class": "payment_method_card" -> } -36017a44123 -> "client_ip", -36031c44137,44157 -< "x-resourceId": "token" ---- -> "x-resourceId": "token", -> "x-stripeOperations": [ -> { -> "method_name": "retrieve", -> "method_on": "service", -> "method_type": "retrieve", -> "operation": "get", -> "path": "/v1/tokens/{token}" -> }, -> { -> "method_name": "create", -> "method_on": "service", -> "method_type": "create", -> "operation": "post", -> "path": "/v1/tokens" -> } -> ], -> "x-stripeResource": { -> "class_name": "Token", -> "in_package": "" -> } -36151a44278 -> "balance_transaction", -36153a44281,44284 -> "description", -> "expected_availability_date", -> "failure_code", -> "failure_message", -36158c44289,44292 -< "status" ---- -> "source", -> "statement_descriptor", -> "status", -> "transfer_group" -36166c44300,44345 -< "x-resourceId": "topup" ---- -> "x-resourceId": "topup", -> "x-stripeOperations": [ -> { -> "method_name": "create", -> "method_on": "service", -> "method_type": "create", -> "operation": "post", -> "path": "/v1/topups" -> }, -> { -> "method_name": "list", -> "method_on": "service", -> "method_type": "list", -> "operation": "get", -> "path": "/v1/topups" -> }, -> { -> "method_name": "retrieve", -> "method_on": "service", -> "method_type": "retrieve", -> "operation": "get", -> "path": "/v1/topups/{topup}" -> }, -> { -> "method_name": "update", -> "method_on": "service", -> "method_type": "update", -> "operation": "post", -> "path": "/v1/topups/{topup}" -> }, -> { -> "method_name": "cancel", -> "method_on": "service", -> "method_type": "custom", -> "operation": "post", -> "path": "/v1/topups/{topup}/cancel" -> } -> ], -> "x-stripeResource": { -> "class_name": "Topup", -> "has_collection_class": true, -> "in_package": "", -> "polymorphic_groups": [ -> "balance_transaction_source" -> ] -> } -36354a44534 -> "balance_transaction", -36356a44537,44538 -> "description", -> "destination", -36362c44544,44546 -< "reversed" ---- -> "reversed", -> "source_transaction", -> "transfer_group" -36373c44557,44595 -< "x-resourceId": "transfer" ---- -> "x-resourceId": "transfer", -> "x-stripeOperations": [ -> { -> "method_name": "create", -> "method_on": "service", -> "method_type": "create", -> "operation": "post", -> "path": "/v1/transfers" -> }, -> { -> "method_name": "list", -> "method_on": "service", -> "method_type": "list", -> "operation": "get", -> "path": "/v1/transfers" -> }, -> { -> "method_name": "retrieve", -> "method_on": "service", -> "method_type": "retrieve", -> "operation": "get", -> "path": "/v1/transfers/{transfer}" -> }, -> { -> "method_name": "update", -> "method_on": "service", -> "method_type": "update", -> "operation": "post", -> "path": "/v1/transfers/{transfer}" -> } -> ], -> "x-stripeResource": { -> "class_name": "Transfer", -> "has_collection_class": true, -> "in_package": "", -> "polymorphic_groups": [ -> "balance_transaction_source" -> ] -> } -36409c44631,44635 -< ] ---- -> ], -> "x-stripeResource": { -> "class_name": "TransferData", -> "in_class": "payment_intent" -> } -36529a44756 -> "balance_transaction", -36531a44759 -> "destination_payment_refund", -36532a44761 -> "metadata", -36533a44763 -> "source_refund", -36544c44774,44833 -< "x-resourceId": "transfer_reversal" ---- -> "x-resourceId": "transfer_reversal", -> "x-stripeOperations": [ -> { -> "method_name": "create", -> "method_on": "collection", -> "method_type": "create", -> "operation": "post", -> "path": "/v1/transfers/{id}/reversals" -> }, -> { -> "method_name": "create", -> "method_on": "service", -> "method_type": "create", -> "operation": "post", -> "path": "/v1/transfers/{id}/reversals" -> }, -> { -> "method_name": "list", -> "method_on": "collection", -> "method_type": "list", -> "operation": "get", -> "path": "/v1/transfers/{id}/reversals" -> }, -> { -> "method_name": "list", -> "method_on": "service", -> "method_type": "list", -> "operation": "get", -> "path": "/v1/transfers/{id}/reversals" -> }, -> { -> "method_name": "retrieve", -> "method_on": "collection", -> "method_type": "retrieve", -> "operation": "get", -> "path": "/v1/transfers/{transfer}/reversals/{id}" -> }, -> { -> "method_name": "retrieve", -> "method_on": "service", -> "method_type": "retrieve", -> "operation": "get", -> "path": "/v1/transfers/{transfer}/reversals/{id}" -> }, -> { -> "method_name": "update", -> "method_on": "service", -> "method_type": "update", -> "operation": "post", -> "path": "/v1/transfers/{transfer}/reversals/{id}" -> } -> ], -> "x-stripeResource": { -> "class_name": "TransferReversal", -> "has_collection_class": true, -> "in_package": "", -> "polymorphic_groups": [ -> "balance_transaction_source" -> ] -> } -36574c44863,44867 -< "x-expandableFields": [] ---- -> "x-expandableFields": [], -> "x-stripeResource": { -> "class_name": "PayoutSchedule", -> "in_class": "account" -> } -36598c44891,44895 -< "x-expandableFields": [] ---- -> "x-expandableFields": [], -> "x-stripeResource": { -> "class_name": "TransformQuantity", -> "in_class": "price" -> } -36622c44919,44923 -< "x-expandableFields": [] ---- -> "x-expandableFields": [], -> "x-stripeResource": { -> "class_name": "TransformUsage", -> "in_class": "plan" -> } -36725a45027 -> "hosted_regulatory_receipt_url", -36733c45035,45036 -< "status_transitions" ---- -> "status_transitions", -> "transaction" -36741c45044,45072 -< "x-resourceId": "treasury.credit_reversal" ---- -> "x-resourceId": "treasury.credit_reversal", -> "x-stripeOperations": [ -> { -> "method_name": "list", -> "method_on": "service", -> "method_type": "list", -> "operation": "get", -> "path": "/v1/treasury/credit_reversals" -> }, -> { -> "method_name": "retrieve", -> "method_on": "service", -> "method_type": "retrieve", -> "operation": "get", -> "path": "/v1/treasury/credit_reversals/{credit_reversal}" -> }, -> { -> "method_name": "create", -> "method_on": "service", -> "method_type": "create", -> "operation": "post", -> "path": "/v1/treasury/credit_reversals" -> } -> ], -> "x-stripeResource": { -> "class_name": "CreditReversal", -> "has_collection_class": true, -> "in_package": "Treasury" -> } -36853a45185,45186 -> "financial_account", -> "hosted_regulatory_receipt_url", -36854a45188 -> "linked_flows", -36861c45195,45196 -< "status_transitions" ---- -> "status_transitions", -> "transaction" -36870c45205,45236 -< "x-resourceId": "treasury.debit_reversal" ---- -> "x-resourceId": "treasury.debit_reversal", -> "x-stripeOperations": [ -> { -> "method_name": "create", -> "method_on": "service", -> "method_type": "create", -> "operation": "post", -> "path": "/v1/treasury/debit_reversals" -> }, -> { -> "method_name": "retrieve", -> "method_on": "service", -> "method_type": "retrieve", -> "operation": "get", -> "path": "/v1/treasury/debit_reversals/{debit_reversal}" -> }, -> { -> "method_name": "list", -> "method_on": "service", -> "method_type": "list", -> "operation": "get", -> "path": "/v1/treasury/debit_reversals" -> } -> ], -> "x-stripeResource": { -> "class_name": "DebitReversal", -> "has_collection_class": true, -> "in_package": "Treasury", -> "inner_classes": [ -> "treasury_received_debits_resource_debit_reversal_linked_flows" -> ] -> } -37018a45385 -> "metadata", -37033c45400,45456 -< "x-resourceId": "treasury.financial_account" ---- -> "x-resourceId": "treasury.financial_account", -> "x-stripeOperations": [ -> { -> "method_name": "create", -> "method_on": "service", -> "method_type": "create", -> "operation": "post", -> "path": "/v1/treasury/financial_accounts" -> }, -> { -> "method_name": "update", -> "method_on": "service", -> "method_type": "update", -> "operation": "post", -> "path": "/v1/treasury/financial_accounts/{financial_account}" -> }, -> { -> "method_name": "update_features", -> "method_on": "service", -> "method_type": "custom", -> "operation": "post", -> "path": "/v1/treasury/financial_accounts/{financial_account}/features" -> }, -> { -> "method_name": "list", -> "method_on": "service", -> "method_type": "list", -> "operation": "get", -> "path": "/v1/treasury/financial_accounts" -> }, -> { -> "method_name": "retrieve", -> "method_on": "service", -> "method_type": "retrieve", -> "operation": "get", -> "path": "/v1/treasury/financial_accounts/{financial_account}" -> }, -> { -> "method_name": "retrieve_features", -> "method_on": "service", -> "method_type": "custom", -> "operation": "get", -> "path": "/v1/treasury/financial_accounts/{financial_account}/features" -> } -> ], -> "x-stripeResource": { -> "class_name": "FinancialAccount", -> "has_collection_class": true, -> "in_package": "Treasury", -> "inner_classes": [ -> "treasury_financial_accounts_resource_ach_toggle_settings", -> "treasury_financial_accounts_resource_balance", -> "treasury_financial_accounts_resource_financial_address", -> "treasury_financial_accounts_resource_status_details", -> "treasury_financial_accounts_resource_toggle_settings" -> ] -> } -37081c45504,45515 -< "x-resourceId": "treasury.financial_account_features" ---- -> "x-resourceId": "treasury.financial_account_features", -> "x-stripeResource": { -> "class_name": "FinancialAccountFeatures", -> "in_package": "Treasury", -> "inner_classes": [ -> "treasury_financial_accounts_resource_financial_addresses_features", -> "treasury_financial_accounts_resource_inbound_transfers", -> "treasury_financial_accounts_resource_outbound_payments", -> "treasury_financial_accounts_resource_outbound_transfers", -> "treasury_financial_accounts_resource_platform_restrictions" -> ] -> } -37218a45653,45654 -> "description", -> "failure_details", -37219a45656 -> "hosted_regulatory_receipt_url", -37225a45663,45664 -> "origin_payment_method_details", -> "returned", -37228c45667,45668 -< "status_transitions" ---- -> "status_transitions", -> "transaction" -37239c45679,45741 -< "x-resourceId": "treasury.inbound_transfer" ---- -> "x-resourceId": "treasury.inbound_transfer", -> "x-stripeOperations": [ -> { -> "method_name": "cancel", -> "method_on": "service", -> "method_type": "custom", -> "operation": "post", -> "path": "/v1/treasury/inbound_transfers/{inbound_transfer}/cancel" -> }, -> { -> "method_name": "create", -> "method_on": "service", -> "method_type": "create", -> "operation": "post", -> "path": "/v1/treasury/inbound_transfers" -> }, -> { -> "method_name": "retrieve", -> "method_on": "service", -> "method_type": "retrieve", -> "operation": "get", -> "path": "/v1/treasury/inbound_transfers/{id}" -> }, -> { -> "method_name": "list", -> "method_on": "service", -> "method_type": "list", -> "operation": "get", -> "path": "/v1/treasury/inbound_transfers" -> }, -> { -> "method_name": "succeed", -> "method_on": "service", -> "method_type": "custom", -> "operation": "post", -> "path": "/v1/test_helpers/treasury/inbound_transfers/{id}/succeed" -> }, -> { -> "method_name": "fail", -> "method_on": "service", -> "method_type": "custom", -> "operation": "post", -> "path": "/v1/test_helpers/treasury/inbound_transfers/{id}/fail" -> }, -> { -> "method_name": "return_inbound_transfer", -> "method_on": "service", -> "method_type": "custom", -> "operation": "post", -> "path": "/v1/test_helpers/treasury/inbound_transfers/{id}/return" -> } -> ], -> "x-stripeResource": { -> "class_name": "InboundTransfer", -> "has_collection_class": true, -> "in_package": "Treasury", -> "inner_classes": [ -> "inbound_transfers", -> "treasury_inbound_transfers_resource_failure_details", -> "treasury_inbound_transfers_resource_inbound_transfer_resource_linked_flows", -> "treasury_inbound_transfers_resource_inbound_transfer_resource_status_transitions" -> ] -> } -37389a45892,45896 -> "customer", -> "description", -> "destination_payment_method", -> "destination_payment_method_details", -> "end_user_details", -37391a45899 -> "hosted_regulatory_receipt_url", -37395a45904 -> "returned_details", -37410c45919,45981 -< "x-resourceId": "treasury.outbound_payment" ---- -> "x-resourceId": "treasury.outbound_payment", -> "x-stripeOperations": [ -> { -> "method_name": "create", -> "method_on": "service", -> "method_type": "create", -> "operation": "post", -> "path": "/v1/treasury/outbound_payments" -> }, -> { -> "method_name": "retrieve", -> "method_on": "service", -> "method_type": "retrieve", -> "operation": "get", -> "path": "/v1/treasury/outbound_payments/{id}" -> }, -> { -> "method_name": "list", -> "method_on": "service", -> "method_type": "list", -> "operation": "get", -> "path": "/v1/treasury/outbound_payments" -> }, -> { -> "method_name": "cancel", -> "method_on": "service", -> "method_type": "custom", -> "operation": "post", -> "path": "/v1/treasury/outbound_payments/{id}/cancel" -> }, -> { -> "method_name": "fail", -> "method_on": "service", -> "method_type": "custom", -> "operation": "post", -> "path": "/v1/test_helpers/treasury/outbound_payments/{id}/fail" -> }, -> { -> "method_name": "post", -> "method_on": "service", -> "method_type": "custom", -> "operation": "post", -> "path": "/v1/test_helpers/treasury/outbound_payments/{id}/post" -> }, -> { -> "method_name": "return_outbound_payment", -> "method_on": "service", -> "method_type": "custom", -> "operation": "post", -> "path": "/v1/test_helpers/treasury/outbound_payments/{id}/return" -> } -> ], -> "x-stripeResource": { -> "class_name": "OutboundPayment", -> "has_collection_class": true, -> "in_package": "Treasury", -> "inner_classes": [ -> "outbound_payments_payment_method_details", -> "treasury_outbound_payments_resource_outbound_payment_resource_end_user_details", -> "treasury_outbound_payments_resource_outbound_payment_resource_status_transitions", -> "treasury_outbound_payments_resource_returned_status" -> ] -> } -37539a46111,46112 -> "description", -> "destination_payment_method", -37542a46116 -> "hosted_regulatory_receipt_url", -37546a46121 -> "returned_details", -37560c46135,46196 -< "x-resourceId": "treasury.outbound_transfer" ---- -> "x-resourceId": "treasury.outbound_transfer", -> "x-stripeOperations": [ -> { -> "method_name": "create", -> "method_on": "service", -> "method_type": "create", -> "operation": "post", -> "path": "/v1/treasury/outbound_transfers" -> }, -> { -> "method_name": "retrieve", -> "method_on": "service", -> "method_type": "retrieve", -> "operation": "get", -> "path": "/v1/treasury/outbound_transfers/{outbound_transfer}" -> }, -> { -> "method_name": "list", -> "method_on": "service", -> "method_type": "list", -> "operation": "get", -> "path": "/v1/treasury/outbound_transfers" -> }, -> { -> "method_name": "cancel", -> "method_on": "service", -> "method_type": "custom", -> "operation": "post", -> "path": "/v1/treasury/outbound_transfers/{outbound_transfer}/cancel" -> }, -> { -> "method_name": "fail", -> "method_on": "service", -> "method_type": "custom", -> "operation": "post", -> "path": "/v1/test_helpers/treasury/outbound_transfers/{outbound_transfer}/fail" -> }, -> { -> "method_name": "post", -> "method_on": "service", -> "method_type": "custom", -> "operation": "post", -> "path": "/v1/test_helpers/treasury/outbound_transfers/{outbound_transfer}/post" -> }, -> { -> "method_name": "return_outbound_transfer", -> "method_on": "service", -> "method_type": "custom", -> "operation": "post", -> "path": "/v1/test_helpers/treasury/outbound_transfers/{outbound_transfer}/return" -> } -> ], -> "x-stripeResource": { -> "class_name": "OutboundTransfer", -> "has_collection_class": true, -> "in_package": "Treasury", -> "inner_classes": [ -> "outbound_transfers_payment_method_details", -> "treasury_outbound_transfers_resource_returned_details", -> "treasury_outbound_transfers_resource_status_transitions" -> ] -> } -37682a46319,46321 -> "failure_code", -> "financial_account", -> "hosted_regulatory_receipt_url", -37689c46328,46330 -< "status" ---- -> "reversal_details", -> "status", -> "transaction" -37699c46340,46374 -< "x-resourceId": "treasury.received_credit" ---- -> "x-resourceId": "treasury.received_credit", -> "x-stripeOperations": [ -> { -> "method_name": "list", -> "method_on": "service", -> "method_type": "list", -> "operation": "get", -> "path": "/v1/treasury/received_credits" -> }, -> { -> "method_name": "retrieve", -> "method_on": "service", -> "method_type": "retrieve", -> "operation": "get", -> "path": "/v1/treasury/received_credits/{id}" -> }, -> { -> "method_name": "create", -> "method_on": "service", -> "method_type": "create", -> "operation": "post", -> "path": "/v1/test_helpers/treasury/received_credits" -> } -> ], -> "x-stripeResource": { -> "class_name": "ReceivedCredit", -> "has_collection_class": true, -> "in_package": "Treasury", -> "inner_classes": [ -> "treasury_received_credits_resource_linked_flows", -> "treasury_received_credits_resource_reversal_details", -> "treasury_received_credits_resource_status_transitions", -> "treasury_shared_resource_initiating_payment_method_details_initiating_payment_method_details" -> ] -> } -37820a46496,46498 -> "failure_code", -> "financial_account", -> "hosted_regulatory_receipt_url", -37826c46504,46506 -< "status" ---- -> "reversal_details", -> "status", -> "transaction" -37836c46516,46549 -< "x-resourceId": "treasury.received_debit" ---- -> "x-resourceId": "treasury.received_debit", -> "x-stripeOperations": [ -> { -> "method_name": "list", -> "method_on": "service", -> "method_type": "list", -> "operation": "get", -> "path": "/v1/treasury/received_debits" -> }, -> { -> "method_name": "retrieve", -> "method_on": "service", -> "method_type": "retrieve", -> "operation": "get", -> "path": "/v1/treasury/received_debits/{id}" -> }, -> { -> "method_name": "create", -> "method_on": "service", -> "method_type": "create", -> "operation": "post", -> "path": "/v1/test_helpers/treasury/received_debits" -> } -> ], -> "x-stripeResource": { -> "class_name": "ReceivedDebit", -> "has_collection_class": true, -> "in_package": "Treasury", -> "inner_classes": [ -> "treasury_received_debits_resource_linked_flows", -> "treasury_received_debits_resource_reversal_details", -> "treasury_received_debits_resource_status_transitions" -> ] -> } -37972a46686 -> "entries", -37973a46688,46689 -> "flow", -> "flow_details", -37989c46705,46730 -< "x-resourceId": "treasury.transaction" ---- -> "x-resourceId": "treasury.transaction", -> "x-stripeOperations": [ -> { -> "method_name": "retrieve", -> "method_on": "service", -> "method_type": "retrieve", -> "operation": "get", -> "path": "/v1/treasury/transactions/{id}" -> }, -> { -> "method_name": "list", -> "method_on": "service", -> "method_type": "list", -> "operation": "get", -> "path": "/v1/treasury/transactions" -> } -> ], -> "x-stripeResource": { -> "class_name": "Transaction", -> "has_collection_class": true, -> "in_package": "Treasury", -> "inner_classes": [ -> "treasury_transactions_resource_abstract_transaction_resource_status_transitions", -> "treasury_transactions_resource_balance_impact" -> ] -> } -38113a46855,46856 -> "flow", -> "flow_details", -38128c46871,46892 -< "x-resourceId": "treasury.transaction_entry" ---- -> "x-resourceId": "treasury.transaction_entry", -> "x-stripeOperations": [ -> { -> "method_name": "retrieve", -> "method_on": "service", -> "method_type": "retrieve", -> "operation": "get", -> "path": "/v1/treasury/transaction_entries/{id}" -> }, -> { -> "method_name": "list", -> "method_on": "service", -> "method_type": "list", -> "operation": "get", -> "path": "/v1/treasury/transaction_entries" -> } -> ], -> "x-stripeResource": { -> "class_name": "TransactionEntry", -> "has_collection_class": true, -> "in_package": "Treasury" -> } -38161a46926 -> "account_number", -38168c46933,46937 -< "x-expandableFields": [] ---- -> "x-expandableFields": [], -> "x-stripeResource": { -> "class_name": "Aba", -> "in_class": "treasury_financial_accounts_resource_financial_address" -> } -38203c46972,46976 -< ] ---- -> ], -> "x-stripeResource": { -> "class_name": "AchToggleSettings", -> "in_class": "treasury.financial_account" -> } -38237c47010,47014 -< "x-expandableFields": [] ---- -> "x-expandableFields": [], -> "x-stripeResource": { -> "class_name": "Balance", -> "in_class": "treasury.financial_account" -> } -38260c47037,47041 -< "x-expandableFields": [] ---- -> "x-expandableFields": [], -> "x-stripeResource": { -> "class_name": "Closed", -> "in_class": "treasury_financial_accounts_resource_status_details" -> } -38296c47077,47084 -< ] ---- -> ], -> "x-stripeResource": { -> "class_name": "FinancialAddress", -> "in_class": "treasury.financial_account", -> "inner_classes": [ -> "treasury_financial_accounts_resource_aba_record" -> ] -> } -38309c47097,47101 -< ] ---- -> ], -> "x-stripeResource": { -> "class_name": "FinancialAddresses", -> "in_class": "treasury.financial_account_features" -> } -38322c47114,47118 -< ] ---- -> ], -> "x-stripeResource": { -> "class_name": "InboundTransfers", -> "in_class": "treasury.financial_account_features" -> } -38339c47135,47139 -< ] ---- -> ], -> "x-stripeResource": { -> "class_name": "OutboundPayments", -> "in_class": "treasury.financial_account_features" -> } -38356c47156,47160 -< ] ---- -> ], -> "x-stripeResource": { -> "class_name": "OutboundTransfers", -> "in_class": "treasury.financial_account_features" -> } -38379a47184,47187 -> "required": [ -> "inbound_flows", -> "outbound_flows" -> ], -38382c47190,47194 -< "x-expandableFields": [] ---- -> "x-expandableFields": [], -> "x-stripeResource": { -> "class_name": "PlatformRestriction", -> "in_class": "treasury.financial_account_features" -> } -38396a47209,47211 -> "required": [ -> "closed" -> ], -38401c47216,47223 -< ] ---- -> ], -> "x-stripeResource": { -> "class_name": "StatusDetails", -> "in_class": "treasury.financial_account", -> "inner_classes": [ -> "treasury_financial_accounts_resource_closed_status_details" -> ] -> } -38436c47258,47265 -< ] ---- -> ], -> "x-stripeResource": { -> "class_name": "ToggleSettings", -> "in_class": "treasury.financial_account", -> "inner_classes": [ -> "treasury_financial_accounts_resource_toggles_setting_status_details" -> ] -> } -38478c47307,47308 -< "code" ---- -> "code", -> "resolution" -38482,38483c47312,47317 -< "x-expandableFields": [] -< }, ---- -> "x-expandableFields": [], -> "x-stripeResource": { -> "class_name": "StatusDetails", -> "in_class": "treasury_financial_accounts_resource_toggle_settings" -> } -> }, -38512c47346,47350 -< "x-expandableFields": [] ---- -> "x-expandableFields": [], -> "x-stripeResource": { -> "class_name": "FailureDetails", -> "in_class": "treasury.inbound_transfer" -> } -38523a47362,47364 -> "required": [ -> "received_debit" -> ], -38526c47367,47371 -< "x-expandableFields": [] ---- -> "x-expandableFields": [], -> "x-stripeResource": { -> "class_name": "LinkedFlows", -> "in_class": "treasury.inbound_transfer" -> } -38549a47395,47398 -> "required": [ -> "failed_at", -> "succeeded_at" -> ], -38552c47401,47405 -< "x-expandableFields": [] ---- -> "x-expandableFields": [], -> "x-stripeResource": { -> "class_name": "StatusTransitions", -> "in_class": "treasury.inbound_transfer" -> } -38568a47422 -> "ip_address", -38573c47427,47431 -< "x-expandableFields": [] ---- -> "x-expandableFields": [], -> "x-stripeResource": { -> "class_name": "EndUserDetails", -> "in_class": "treasury.outbound_payment" -> } -38602a47461,47466 -> "required": [ -> "canceled_at", -> "failed_at", -> "posted_at", -> "returned_at" -> ], -38605c47469,47473 -< "x-expandableFields": [] ---- -> "x-expandableFields": [], -> "x-stripeResource": { -> "class_name": "StatusTransitions", -> "in_class": "treasury.outbound_payment" -> } -38654c47522,47526 -< ] ---- -> ], -> "x-stripeResource": { -> "class_name": "ReturnedDetails", -> "in_class": "treasury.outbound_payment" -> } -38703c47575,47579 -< ] ---- -> ], -> "x-stripeResource": { -> "class_name": "ReturnedDetails", -> "in_class": "treasury.outbound_transfer" -> } -38732a47609,47614 -> "required": [ -> "canceled_at", -> "failed_at", -> "posted_at", -> "returned_at" -> ], -38735c47617,47621 -< "x-expandableFields": [] ---- -> "x-expandableFields": [], -> "x-stripeResource": { -> "class_name": "StatusTransitions", -> "in_class": "treasury.outbound_transfer" -> } -38779a47666,47673 -> "required": [ -> "credit_reversal", -> "issuing_authorization", -> "issuing_transaction", -> "source_flow", -> "source_flow_details", -> "source_flow_type" -> ], -38784c47678,47685 -< ] ---- -> ], -> "x-stripeResource": { -> "class_name": "LinkedFlows", -> "in_class": "treasury.received_credit", -> "inner_classes": [ -> "treasury_received_credits_resource_source_flows_details" -> ] -> } -38807a47709,47712 -> "required": [ -> "deadline", -> "restricted_reason" -> ], -38810c47715,47719 -< "x-expandableFields": [] ---- -> "x-expandableFields": [], -> "x-stripeResource": { -> "class_name": "ReversalDetails", -> "in_class": "treasury.received_credit" -> } -38845c47754,47758 -< ] ---- -> ], -> "x-stripeResource": { -> "class_name": "SourceFlowDetails", -> "in_class": "treasury_received_credits_resource_linked_flows" -> } -38856a47770,47772 -> "required": [ -> "posted_at" -> ], -38859c47775,47779 -< "x-expandableFields": [] ---- -> "x-expandableFields": [], -> "x-stripeResource": { -> "class_name": "StatusTransitions", -> "in_class": "treasury.received_credit" -> } -38870a47791,47793 -> "required": [ -> "issuing_dispute" -> ], -38873c47796,47800 -< "x-expandableFields": [] ---- -> "x-expandableFields": [], -> "x-stripeResource": { -> "class_name": "LinkedFlows", -> "in_class": "treasury.debit_reversal" -> } -38902a47830,47835 -> "required": [ -> "debit_reversal", -> "inbound_transfer", -> "issuing_authorization", -> "issuing_transaction" -> ], -38905c47838,47842 -< "x-expandableFields": [] ---- -> "x-expandableFields": [], -> "x-stripeResource": { -> "class_name": "LinkedFlows", -> "in_class": "treasury.received_debit" -> } -38928a47866,47869 -> "required": [ -> "deadline", -> "restricted_reason" -> ], -38931c47872,47876 -< "x-expandableFields": [] ---- -> "x-expandableFields": [], -> "x-stripeResource": { -> "class_name": "ReversalDetails", -> "in_class": "treasury.received_debit" -> } -38942a47888,47890 -> "required": [ -> "completed_at" -> ], -38945c47893,47897 -< "x-expandableFields": [] ---- -> "x-expandableFields": [], -> "x-stripeResource": { -> "class_name": "StatusTransitions", -> "in_class": "treasury.received_debit" -> } -38967c47919,47921 -< "address" ---- -> "address", -> "email", -> "name" -38973c47927,47931 -< ] ---- -> ], -> "x-stripeResource": { -> "class_name": "BillingDetails", -> "in_class": "treasury_shared_resource_initiating_payment_method_details_initiating_payment_method_details" -> } -39022c47980,47989 -< ] ---- -> ], -> "x-stripeResource": { -> "class_name": "InitiatingPaymentMethodDetails", -> "in_class": "treasury.received_credit", -> "inner_classes": [ -> "received_payment_method_details_financial_account", -> "treasury_shared_resource_billing_details", -> "treasury_shared_resource_initiating_payment_method_details_us_bank_account" -> ] -> } -39045a48013,48017 -> "required": [ -> "bank_name", -> "last4", -> "routing_number" -> ], -39048c48020,48024 -< "x-expandableFields": [] ---- -> "x-expandableFields": [], -> "x-stripeResource": { -> "class_name": "UsBankAccount", -> "in_class": "treasury_shared_resource_initiating_payment_method_details_initiating_payment_method_details" -> } -39065a48042,48045 -> "required": [ -> "posted_at", -> "void_at" -> ], -39068c48048,48052 -< "x-expandableFields": [] ---- -> "x-expandableFields": [], -> "x-stripeResource": { -> "class_name": "StatusTransitions", -> "in_class": "treasury.transaction" -> } -39093c48077,48081 -< "x-expandableFields": [] ---- -> "x-expandableFields": [], -> "x-stripeResource": { -> "class_name": "BalanceImpact", -> "in_class": "treasury.transaction" -> } -39152c48140,48144 -< ] ---- -> ], -> "x-stripeResource": { -> "class_name": "FlowDetails", -> "in_package": "Treasury" -> } -39175a48168 -> "preferred", -39180c48173,48177 -< "x-expandableFields": [] ---- -> "x-expandableFields": [], -> "x-stripeResource": { -> "class_name": "Networks", -> "in_class": "payment_method_us_bank_account" -> } -39227c48224,48237 -< "x-resourceId": "usage_record" ---- -> "x-resourceId": "usage_record", -> "x-stripeOperations": [ -> { -> "method_name": "create", -> "method_on": "service", -> "method_type": "custom", -> "operation": "post", -> "path": "/v1/subscription_items/{subscription_item}/usage_records" -> } -> ], -> "x-stripeResource": { -> "class_name": "UsageRecord", -> "in_package": "" -> } -39268a48279 -> "invoice", -39280c48291,48308 -< "x-resourceId": "usage_record_summary" ---- -> "x-resourceId": "usage_record_summary", -> "x-stripeOperations": [ -> { -> "method_name": "list", -> "method_on": "service", -> "method_type": "list", -> "operation": "get", -> "path": "/v1/subscription_items/{subscription_item}/usage_record_summaries" -> } -> ], -> "x-stripeResource": { -> "class_name": "UsageRecordSummary", -> "has_collection_class": true, -> "in_package": "", -> "inner_classes": [ -> "period" -> ] -> } -39299c48327,48331 -< "x-expandableFields": [] ---- -> "x-expandableFields": [], -> "x-stripeResource": { -> "class_name": "Redaction", -> "in_class": "identity.verification_session" -> } -39375a48408,48409 -> "api_version", -> "application", -39376a48411 -> "description", -39388c48423,48465 -< "x-resourceId": "webhook_endpoint" ---- -> "x-resourceId": "webhook_endpoint", -> "x-stripeOperations": [ -> { -> "method_name": "list", -> "method_on": "service", -> "method_type": "list", -> "operation": "get", -> "path": "/v1/webhook_endpoints" -> }, -> { -> "method_name": "retrieve", -> "method_on": "service", -> "method_type": "retrieve", -> "operation": "get", -> "path": "/v1/webhook_endpoints/{webhook_endpoint}" -> }, -> { -> "method_name": "create", -> "method_on": "service", -> "method_type": "create", -> "operation": "post", -> "path": "/v1/webhook_endpoints" -> }, -> { -> "method_name": "update", -> "method_on": "service", -> "method_type": "update", -> "operation": "post", -> "path": "/v1/webhook_endpoints/{webhook_endpoint}" -> }, -> { -> "method_name": "delete", -> "method_on": "service", -> "method_type": "delete", -> "operation": "delete", -> "path": "/v1/webhook_endpoints/{webhook_endpoint}" -> } -> ], -> "x-stripeResource": { -> "class_name": "WebhookEndpoint", -> "has_collection_class": true, -> "in_package": "" -> } -39415c48492 -< "x-stripeSpecFilename": "spec3" ---- -> "x-stripeSpecFilename": "spec3.sdk" -39526c48603,48605 -< "account_update" ---- -> "account_update", -> "custom_account_update", -> "custom_account_verification" -39580a48660 -> "description": "Minimum value to filter by (exclusive)", -39583a48664 -> "description": "Minimum value to filter by (inclusive)", -39586a48668 -> "description": "Maximum value to filter by (exclusive)", -39589a48672 -> "description": "Maximum value to filter by (inclusive)", -39728,39731d48810 -< "bank_account": { -< "explode": true, -< "style": "deepObject" -< }, -39777,39839d48855 -< "bank_account": { -< "anyOf": [ -< { -< "properties": { -< "account_holder_name": { -< "maxLength": 5000, -< "type": "string" -< }, -< "account_holder_type": { -< "enum": [ -< "company", -< "individual" -< ], -< "maxLength": 5000, -< "type": "string" -< }, -< "account_number": { -< "maxLength": 5000, -< "type": "string" -< }, -< "account_type": { -< "enum": [ -< "checking", -< "futsu", -< "savings", -< "toza" -< ], -< "maxLength": 5000, -< "type": "string" -< }, -< "country": { -< "maxLength": 5000, -< "type": "string" -< }, -< "currency": { -< "type": "string" -< }, -< "object": { -< "enum": [ -< "bank_account" -< ], -< "maxLength": 5000, -< "type": "string" -< }, -< "routing_number": { -< "maxLength": 5000, -< "type": "string" -< } -< }, -< "required": [ -< "account_number", -< "country" -< ], -< "title": "external_account_payout_bank_account", -< "type": "object" -< }, -< { -< "maxLength": 5000, -< "type": "string" -< } -< ], -< "description": "Either a token, like the ones returned by [Stripe.js](https://stripe.com/docs/js), or a dictionary containing a user's bank account details." -< }, -39843a48860 -> "description": "[The merchant category code for the account](https://stripe.com/docs/connect/setting-mcc). MCCs are used to classify businesses based on the goods or services they provide.", -39847a48865 -> "description": "The customer-facing business name.", -39851a48870 -> "description": "Internal-only description of the product sold by, or service provided by, the business. Used by Stripe for risk and underwriting purposes.", -39855a48875 -> "description": "A publicly available mailing address for sending support issues to.", -39857a48878 -> "description": "City, district, suburb, town, or village.", -39861a48883 -> "description": "Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)).", -39865a48888 -> "description": "Address line 1 (e.g., street, PO Box, or company name).", -39869a48893 -> "description": "Address line 2 (e.g., apartment, suite, unit, or building).", -39873a48898 -> "description": "ZIP or postal code.", -39877a48903 -> "description": "State, county, province, or region.", -39885a48912 -> "description": "A publicly available email address for sending support issues to.", -39888a48916 -> "description": "A publicly available phone number to call with support issues.", -39903c48931,48932 -< ] ---- -> ], -> "description": "A publicly available website for handling support issues." -39905a48935 -> "description": "The business's publicly available website.", -39927a48958 -> "description": "The acss_debit_payments capability.", -39929a48961 -> "description": "Passing true requests the capability for the account, if it is not already requested. A requested capability may not immediately become active. Any requirements to activate the capability are returned in the `requirements` arrays.", -39936a48969 -> "description": "The affirm_payments capability.", -39938a48972 -> "description": "Passing true requests the capability for the account, if it is not already requested. A requested capability may not immediately become active. Any requirements to activate the capability are returned in the `requirements` arrays.", -39945a48980 -> "description": "The afterpay_clearpay_payments capability.", -39947a48983 -> "description": "Passing true requests the capability for the account, if it is not already requested. A requested capability may not immediately become active. Any requirements to activate the capability are returned in the `requirements` arrays.", -39954a48991 -> "description": "The au_becs_debit_payments capability.", -39956a48994 -> "description": "Passing true requests the capability for the account, if it is not already requested. A requested capability may not immediately become active. Any requirements to activate the capability are returned in the `requirements` arrays.", -39963a49002 -> "description": "The bacs_debit_payments capability.", -39965a49005 -> "description": "Passing true requests the capability for the account, if it is not already requested. A requested capability may not immediately become active. Any requirements to activate the capability are returned in the `requirements` arrays.", -39972a49013 -> "description": "The bancontact_payments capability.", -39974a49016 -> "description": "Passing true requests the capability for the account, if it is not already requested. A requested capability may not immediately become active. Any requirements to activate the capability are returned in the `requirements` arrays.", -39981a49024 -> "description": "The bank_transfer_payments capability.", -39983a49027 -> "description": "Passing true requests the capability for the account, if it is not already requested. A requested capability may not immediately become active. Any requirements to activate the capability are returned in the `requirements` arrays.", -39990a49035 -> "description": "The blik_payments capability.", -39992a49038 -> "description": "Passing true requests the capability for the account, if it is not already requested. A requested capability may not immediately become active. Any requirements to activate the capability are returned in the `requirements` arrays.", -39999a49046 -> "description": "The boleto_payments capability.", -40001a49049 -> "description": "Passing true requests the capability for the account, if it is not already requested. A requested capability may not immediately become active. Any requirements to activate the capability are returned in the `requirements` arrays.", -40008a49057 -> "description": "The card_issuing capability.", -40010a49060 -> "description": "Passing true requests the capability for the account, if it is not already requested. A requested capability may not immediately become active. Any requirements to activate the capability are returned in the `requirements` arrays.", -40017a49068 -> "description": "The card_payments capability.", -40019a49071 -> "description": "Passing true requests the capability for the account, if it is not already requested. A requested capability may not immediately become active. Any requirements to activate the capability are returned in the `requirements` arrays.", -40026a49079 -> "description": "The cartes_bancaires_payments capability.", -40028a49082 -> "description": "Passing true requests the capability for the account, if it is not already requested. A requested capability may not immediately become active. Any requirements to activate the capability are returned in the `requirements` arrays.", -40035a49090 -> "description": "The eps_payments capability.", -40037a49093 -> "description": "Passing true requests the capability for the account, if it is not already requested. A requested capability may not immediately become active. Any requirements to activate the capability are returned in the `requirements` arrays.", -40044a49101 -> "description": "The fpx_payments capability.", -40046a49104 -> "description": "Passing true requests the capability for the account, if it is not already requested. A requested capability may not immediately become active. Any requirements to activate the capability are returned in the `requirements` arrays.", -40053a49112 -> "description": "The giropay_payments capability.", -40055a49115 -> "description": "Passing true requests the capability for the account, if it is not already requested. A requested capability may not immediately become active. Any requirements to activate the capability are returned in the `requirements` arrays.", -40062a49123 -> "description": "The grabpay_payments capability.", -40064a49126 -> "description": "Passing true requests the capability for the account, if it is not already requested. A requested capability may not immediately become active. Any requirements to activate the capability are returned in the `requirements` arrays.", -40071a49134 -> "description": "The ideal_payments capability.", -40073a49137 -> "description": "Passing true requests the capability for the account, if it is not already requested. A requested capability may not immediately become active. Any requirements to activate the capability are returned in the `requirements` arrays.", -40080a49145 -> "description": "The jcb_payments capability.", -40082a49148 -> "description": "Passing true requests the capability for the account, if it is not already requested. A requested capability may not immediately become active. Any requirements to activate the capability are returned in the `requirements` arrays.", -40089a49156 -> "description": "The klarna_payments capability.", -40091a49159 -> "description": "Passing true requests the capability for the account, if it is not already requested. A requested capability may not immediately become active. Any requirements to activate the capability are returned in the `requirements` arrays.", -40098a49167 -> "description": "The konbini_payments capability.", -40100a49170 -> "description": "Passing true requests the capability for the account, if it is not already requested. A requested capability may not immediately become active. Any requirements to activate the capability are returned in the `requirements` arrays.", -40107a49178 -> "description": "The legacy_payments capability.", -40109a49181 -> "description": "Passing true requests the capability for the account, if it is not already requested. A requested capability may not immediately become active. Any requirements to activate the capability are returned in the `requirements` arrays.", -40116a49189 -> "description": "The link_payments capability.", -40118a49192 -> "description": "Passing true requests the capability for the account, if it is not already requested. A requested capability may not immediately become active. Any requirements to activate the capability are returned in the `requirements` arrays.", -40125a49200 -> "description": "The oxxo_payments capability.", -40127a49203 -> "description": "Passing true requests the capability for the account, if it is not already requested. A requested capability may not immediately become active. Any requirements to activate the capability are returned in the `requirements` arrays.", -40134a49211 -> "description": "The p24_payments capability.", -40136a49214 -> "description": "Passing true requests the capability for the account, if it is not already requested. A requested capability may not immediately become active. Any requirements to activate the capability are returned in the `requirements` arrays.", -40143a49222 -> "description": "The paynow_payments capability.", -40145a49225 -> "description": "Passing true requests the capability for the account, if it is not already requested. A requested capability may not immediately become active. Any requirements to activate the capability are returned in the `requirements` arrays.", -40152a49233 -> "description": "The promptpay_payments capability.", -40154a49236 -> "description": "Passing true requests the capability for the account, if it is not already requested. A requested capability may not immediately become active. Any requirements to activate the capability are returned in the `requirements` arrays.", -40161a49244 -> "description": "The sepa_debit_payments capability.", -40163a49247 -> "description": "Passing true requests the capability for the account, if it is not already requested. A requested capability may not immediately become active. Any requirements to activate the capability are returned in the `requirements` arrays.", -40170a49255 -> "description": "The sofort_payments capability.", -40172a49258 -> "description": "Passing true requests the capability for the account, if it is not already requested. A requested capability may not immediately become active. Any requirements to activate the capability are returned in the `requirements` arrays.", -40179a49266 -> "description": "The tax_reporting_us_1099_k capability.", -40181a49269 -> "description": "Passing true requests the capability for the account, if it is not already requested. A requested capability may not immediately become active. Any requirements to activate the capability are returned in the `requirements` arrays.", -40188a49277 -> "description": "The tax_reporting_us_1099_misc capability.", -40190a49280 -> "description": "Passing true requests the capability for the account, if it is not already requested. A requested capability may not immediately become active. Any requirements to activate the capability are returned in the `requirements` arrays.", -40197a49288 -> "description": "The transfers capability.", -40199a49291 -> "description": "Passing true requests the capability for the account, if it is not already requested. A requested capability may not immediately become active. Any requirements to activate the capability are returned in the `requirements` arrays.", -40206a49299 -> "description": "The treasury capability.", -40208a49302 -> "description": "Passing true requests the capability for the account, if it is not already requested. A requested capability may not immediately become active. Any requirements to activate the capability are returned in the `requirements` arrays.", -40215a49310 -> "description": "The us_bank_account_ach_payments capability.", -40217a49313 -> "description": "Passing true requests the capability for the account, if it is not already requested. A requested capability may not immediately become active. Any requirements to activate the capability are returned in the `requirements` arrays.", -40231a49328 -> "description": "The company's primary address.", -40233a49331 -> "description": "City, district, suburb, town, or village.", -40237a49336 -> "description": "Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)).", -40241a49341 -> "description": "Address line 1 (e.g., street, PO Box, or company name).", -40245a49346 -> "description": "Address line 2 (e.g., apartment, suite, unit, or building).", -40249a49351 -> "description": "ZIP or postal code.", -40253a49356 -> "description": "State, county, province, or region.", -40261a49365 -> "description": "The Kana variation of the company's primary address (Japan only).", -40263a49368 -> "description": "City or ward.", -40267a49373 -> "description": "Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)).", -40271a49378 -> "description": "Block or building number.", -40275a49383 -> "description": "Building details.", -40279a49388 -> "description": "Postal code.", -40283a49393 -> "description": "Prefecture.", -40287a49398 -> "description": "Town or cho-me.", -40295a49407 -> "description": "The Kanji variation of the company's primary address (Japan only).", -40297a49410 -> "description": "City or ward.", -40301a49415 -> "description": "Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)).", -40305a49420 -> "description": "Block or building number.", -40309a49425 -> "description": "Building details.", -40313a49430 -> "description": "Postal code.", -40317a49435 -> "description": "Prefecture.", -40321a49440 -> "description": "Town or cho-me.", -40329a49449 -> "description": "Whether the company's directors have been provided. Set this Boolean to `true` after creating all the company's directors with [the Persons API](https://stripe.com/docs/api/persons) for accounts with a `relationship.director` requirement. This value is not automatically set to `true` after creating directors, so it needs to be updated to indicate all directors have been provided.", -40332a49453 -> "description": "Whether the company's executives have been provided. Set this Boolean to `true` after creating all the company's executives with [the Persons API](https://stripe.com/docs/api/persons) for accounts with a `relationship.executive` requirement.", -40335a49457 -> "description": "The company's legal name.", -40339a49462 -> "description": "The Kana variation of the company's legal name (Japan only).", -40343a49467 -> "description": "The Kanji variation of the company's legal name (Japan only).", -40347a49472 -> "description": "Whether the company's owners have been provided. Set this Boolean to `true` after creating all the company's owners with [the Persons API](https://stripe.com/docs/api/persons) for accounts with a `relationship.owner` requirement.", -40350a49476 -> "description": "This hash is used to attest that the beneficial owner information provided to Stripe is both current and correct.", -40352a49479 -> "description": "The Unix timestamp marking when the beneficial owner attestation was made.", -40356a49484 -> "description": "The IP address from which the beneficial owner attestation was made.", -40359a49488 -> "description": "The user agent of the browser from which the beneficial owner attestation was made.", -40367a49497 -> "description": "The company's phone number (used for verification).", -40371a49502 -> "description": "The identification number given to a company when it is registered or incorporated, if distinct from the identification number used for filing taxes. (Examples are the CIN for companies and LLP IN for partnerships in India, and the Company Registration Number in Hong Kong).", -40375a49507 -> "description": "The category identifying the legal structure of the company or legal entity. See [Business structure](https://stripe.com/docs/connect/identity-verification#business-structure) for more details.", -40402a49535 -> "description": "The business ID number of the company, as appropriate for the company’s country. (Examples are an Employer ID Number in the U.S., a Business Number in Canada, or a Company Number in the UK.)", -40406a49540 -> "description": "The jurisdiction in which the `tax_id` is registered (Germany-based companies only).", -40410a49545 -> "description": "The VAT number of the company.", -40414a49550 -> "description": "Information on the verification state of the company.", -40416a49553 -> "description": "A document verifying the business.", -40418a49556 -> "description": "The back of a document returned by a [file upload](https://stripe.com/docs/api#create_file) with a `purpose` value of `additional_verification`. The uploaded file needs to be a color image (smaller than 8,000px by 8,000px), in JPG, PNG, or PDF format, and less than 10 MB in size.", -40422a49561 -> "description": "The front of a document returned by a [file upload](https://stripe.com/docs/api#create_file) with a `purpose` value of `additional_verification`. The uploaded file needs to be a color image (smaller than 8,000px by 8,000px), in JPG, PNG, or PDF format, and less than 10 MB in size.", -40450a49590 -> "description": "One or more documents that support the [Bank account ownership verification](https://support.stripe.com/questions/bank-account-ownership-verification) requirement. Must be a document associated with the account’s primary active bank account that displays the last 4 digits of the account number, either a statement or a voided check.", -40452a49593 -> "description": "One or more document ids returned by a [file upload](https://stripe.com/docs/api#create_file) with a `purpose` value of `account_requirement`.", -40463a49605 -> "description": "One or more documents that demonstrate proof of a company's license to operate.", -40465a49608 -> "description": "One or more document ids returned by a [file upload](https://stripe.com/docs/api#create_file) with a `purpose` value of `account_requirement`.", -40476a49620 -> "description": "One or more documents showing the company's Memorandum of Association.", -40478a49623 -> "description": "One or more document ids returned by a [file upload](https://stripe.com/docs/api#create_file) with a `purpose` value of `account_requirement`.", -40489a49635 -> "description": "(Certain countries only) One or more documents showing the ministerial decree legalizing the company's establishment.", -40491a49638 -> "description": "One or more document ids returned by a [file upload](https://stripe.com/docs/api#create_file) with a `purpose` value of `account_requirement`.", -40502a49650 -> "description": "One or more documents that demonstrate proof of a company's registration with the appropriate local authorities.", -40504a49653 -> "description": "One or more document ids returned by a [file upload](https://stripe.com/docs/api#create_file) with a `purpose` value of `account_requirement`.", -40515a49665 -> "description": "One or more documents that demonstrate proof of a company's tax ID.", -40517a49668 -> "description": "One or more document ids returned by a [file upload](https://stripe.com/docs/api#create_file) with a `purpose` value of `account_requirement`.", -40528a49680 -> "description": "One or more documents showing the company’s proof of registration with the national business registry.", -40530a49683 -> "description": "One or more document ids returned by a [file upload](https://stripe.com/docs/api#create_file) with a `purpose` value of `account_requirement`.", -40566a49720 -> "description": "The individual's primary address.", -40568a49723 -> "description": "City, district, suburb, town, or village.", -40572a49728 -> "description": "Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)).", -40576a49733 -> "description": "Address line 1 (e.g., street, PO Box, or company name).", -40580a49738 -> "description": "Address line 2 (e.g., apartment, suite, unit, or building).", -40584a49743 -> "description": "ZIP or postal code.", -40588a49748 -> "description": "State, county, province, or region.", -40596a49757 -> "description": "The Kana variation of the the individual's primary address (Japan only).", -40598a49760 -> "description": "City or ward.", -40602a49765 -> "description": "Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)).", -40606a49770 -> "description": "Block or building number.", -40610a49775 -> "description": "Building details.", -40614a49780 -> "description": "Postal code.", -40618a49785 -> "description": "Prefecture.", -40622a49790 -> "description": "Town or cho-me.", -40630a49799 -> "description": "The Kanji variation of the the individual's primary address (Japan only).", -40632a49802 -> "description": "City or ward.", -40636a49807 -> "description": "Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)).", -40640a49812 -> "description": "Block or building number.", -40644a49817 -> "description": "Building details.", -40648a49822 -> "description": "Postal code.", -40652a49827 -> "description": "Prefecture.", -40656a49832 -> "description": "Town or cho-me.", -40668a49845 -> "description": "The day of birth, between 1 and 31.", -40671a49849 -> "description": "The month of birth, between 1 and 12.", -40674a49853 -> "description": "The four-digit year of birth.", -40692c49871,49872 -< ] ---- -> ], -> "description": "The individual's date of birth." -40694a49875 -> "description": "The individual's email address.", -40697a49879 -> "description": "The individual's first name.", -40701a49884 -> "description": "The Kana variation of the the individual's first name (Japan only).", -40705a49889 -> "description": "The Kanji variation of the individual's first name (Japan only).", -40724c49908,49909 -< ] ---- -> ], -> "description": "A list of alternate names or aliases that the individual is known by." -40726a49912 -> "description": "The individual's gender (International regulations require either \"male\" or \"female\").", -40729a49916 -> "description": "The government-issued ID number of the individual, as appropriate for the representative’s country. (Examples are a Social Security Number in the U.S., or a Social Insurance Number in Canada). Instead of the number itself, you can also provide a [PII token created with Stripe.js](https://stripe.com/docs/js/tokens_sources/create_token?type=pii).", -40733a49921 -> "description": "The government-issued secondary ID number of the individual, as appropriate for the representative's country, will be used for enhanced verification checks. In Thailand, this would be the laser code found on the back of an ID card. Instead of the number itself, you can also provide a [PII token created with Stripe.js](https://stripe.com/docs/js/tokens_sources/create_token?type=pii).", -40737a49926 -> "description": "The individual's last name.", -40741a49931 -> "description": "The Kana variation of the individual's last name (Japan only).", -40745a49936 -> "description": "The Kanji variation of the individual's last name (Japan only).", -40749a49941 -> "description": "The individual's maiden name.", -40767c49959,49960 -< ] ---- -> ], -> "description": "Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`." -40769a49963 -> "description": "The individual's phone number.", -40772a49967 -> "description": "Indicates if the person or any of their representatives, family members, or other closely related persons, declares that they hold or have held an important public job or function, in any jurisdiction.", -40779a49975 -> "description": "The individual's registered address.", -40781a49978 -> "description": "City, district, suburb, town, or village.", -40785a49983 -> "description": "Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)).", -40789a49988 -> "description": "Address line 1 (e.g., street, PO Box, or company name).", -40793a49993 -> "description": "Address line 2 (e.g., apartment, suite, unit, or building).", -40797a49998 -> "description": "ZIP or postal code.", -40801a50003 -> "description": "State, county, province, or region.", -40809a50012 -> "description": "The last four digits of the individual's Social Security Number (U.S. only).", -40813a50017 -> "description": "The individual's verification document information.", -40815a50020 -> "description": "A document showing address, either a passport, local ID card, or utility bill from a well-known utility company.", -40817a50023 -> "description": "The back of an ID returned by a [file upload](https://stripe.com/docs/api#create_file) with a `purpose` value of `identity_document`. The uploaded file needs to be a color image (smaller than 8,000px by 8,000px), in JPG, PNG, or PDF format, and less than 10 MB in size.", -40821a50028 -> "description": "The front of an ID returned by a [file upload](https://stripe.com/docs/api#create_file) with a `purpose` value of `identity_document`. The uploaded file needs to be a color image (smaller than 8,000px by 8,000px), in JPG, PNG, or PDF format, and less than 10 MB in size.", -40829a50037 -> "description": "An identifying document, either a passport or local ID card.", -40831a50040 -> "description": "The back of an ID returned by a [file upload](https://stripe.com/docs/api#create_file) with a `purpose` value of `identity_document`. The uploaded file needs to be a color image (smaller than 8,000px by 8,000px), in JPG, PNG, or PDF format, and less than 10 MB in size.", -40835a50045 -> "description": "The front of an ID returned by a [file upload](https://stripe.com/docs/api#create_file) with a `purpose` value of `identity_document`. The uploaded file needs to be a color image (smaller than 8,000px by 8,000px), in JPG, PNG, or PDF format, and less than 10 MB in size.", -40871a50082 -> "description": "Settings used to apply the account's branding to email receipts, invoices, Checkout, and other products.", -40873a50085 -> "description": "(ID of a [file upload](https://stripe.com/docs/guides/file-upload)) An icon for the account. Must be square and at least 128px x 128px.", -40877a50090 -> "description": "(ID of a [file upload](https://stripe.com/docs/guides/file-upload)) A logo for the account that will be used in Checkout instead of the icon and without the account's name next to it if provided. Must be at least 128px x 128px.", -40881a50095 -> "description": "A CSS hex color value representing the primary branding color for this account.", -40885a50100 -> "description": "A CSS hex color value representing the secondary branding color for this account.", -40893a50109 -> "description": "Settings specific to the account's use of the Card Issuing product.", -40895a50112 -> "description": "Details on the account's acceptance of the [Stripe Issuing Terms and Disclosures](https://stripe.com/docs/issuing/connect/tos_acceptance).", -40897a50115 -> "description": "The Unix timestamp marking when the account representative accepted the service agreement.", -40901a50120 -> "description": "The IP address from which the account representative accepted the service agreement.", -40904a50124 -> "description": "The user agent of the browser from which the account representative accepted the service agreement.", -40916a50137 -> "description": "Settings specific to card charging on the account.", -40918a50140 -> "description": "Automatically declines certain charge types regardless of whether the card issuer accepted or declined the charge.", -40920a50143 -> "description": "Whether Stripe automatically declines charges with an incorrect ZIP or postal code. This setting only applies when a ZIP or postal code is provided and they fail bank verification.", -40923a50147 -> "description": "Whether Stripe automatically declines charges with an incorrect CVC. This setting only applies when a CVC is provided and it fails bank verification.", -40930a50155 -> "description": "The default text that appears on credit card statements when a charge is made. This field prefixes any dynamic `statement_descriptor` specified on the charge. `statement_descriptor_prefix` is useful for maximizing descriptor space for the dynamic portion.", -40946c50171,50172 -< ] ---- -> ], -> "description": "The Kana variation of the default text that appears on credit card statements when a charge is made (Japan only). This field prefixes any dynamic `statement_descriptor_suffix_kana` specified on the charge. `statement_descriptor_prefix_kana` is useful for maximizing descriptor space for the dynamic portion." -40960c50186,50187 -< ] ---- -> ], -> "description": "The Kanji variation of the default text that appears on credit card statements when a charge is made (Japan only). This field prefixes any dynamic `statement_descriptor_suffix_kanji` specified on the charge. `statement_descriptor_prefix_kanji` is useful for maximizing descriptor space for the dynamic portion." -40966a50194 -> "description": "Settings that apply across payment methods for charging on the account.", -40968a50197 -> "description": "The default text that appears on credit card statements when a charge is made. This field prefixes any dynamic `statement_descriptor` specified on the charge.", -40972a50202 -> "description": "The Kana variation of the default text that appears on credit card statements when a charge is made (Japan only).", -40976a50207 -> "description": "The Kanji variation of the default text that appears on credit card statements when a charge is made (Japan only).", -40984a50216 -> "description": "Settings specific to the account's payouts.", -40986a50219 -> "description": "A Boolean indicating whether Stripe should try to reclaim negative balances from an attached bank account. For details, see [Understanding Connect Account Balances](https://stripe.com/docs/connect/account-balances).", -40989a50223 -> "description": "Details on when funds from charges are available, and when they are paid out to an external account. For details, see our [Setting Bank and Debit Card Payouts](https://stripe.com/docs/connect/bank-transfers#payout-information) documentation.", -41003c50237,50238 -< ] ---- -> ], -> "description": "The number of days charge funds are held before being paid out. May also be set to `minimum`, representing the lowest available value for the account country. Default is `minimum`. The `delay_days` parameter does not apply when the `interval` is `manual`." -41005a50241 -> "description": "How frequently available funds are paid out. One of: `daily`, `manual`, `weekly`, or `monthly`. Default is `daily`.", -41016a50253 -> "description": "The day of the month when available funds are paid out, specified as a number between 1--31. Payouts nominally scheduled between the 29th and 31st of the month are instead sent on the last day of a shorter month. Required and applicable only if `interval` is `monthly`.", -41019a50257 -> "description": "The day of the week when available funds are paid out, specified as `monday`, `tuesday`, etc. (required and applicable only if `interval` is `weekly`.)", -41036a50275 -> "description": "The text that appears on the bank account statement for payouts. If not set, this defaults to the platform's bank descriptor as set in the Dashboard.", -41044a50284 -> "description": "Settings specific to the account's Treasury FinancialAccounts.", -41046a50287 -> "description": "Details on the account's acceptance of the Stripe Treasury Services Agreement.", -41048a50290 -> "description": "The Unix timestamp marking when the account representative accepted the service agreement.", -41052a50295 -> "description": "The IP address from which the account representative accepted the service agreement.", -41055a50299 -> "description": "The user agent of the browser from which the account representative accepted the service agreement.", -41074a50319 -> "description": "The Unix timestamp marking when the account representative accepted their service agreement.", -41078a50324 -> "description": "The IP address from which the account representative accepted their service agreement.", -41081a50328 -> "description": "The user's service agreement type.", -41085a50333 -> "description": "The user agent of the browser from which the account representative accepted their service agreement.", -41318a50567 -> "description": "[The merchant category code for the account](https://stripe.com/docs/connect/setting-mcc). MCCs are used to classify businesses based on the goods or services they provide.", -41322a50572 -> "description": "The customer-facing business name.", -41326a50577 -> "description": "Internal-only description of the product sold by, or service provided by, the business. Used by Stripe for risk and underwriting purposes.", -41330a50582 -> "description": "A publicly available mailing address for sending support issues to.", -41332a50585 -> "description": "City, district, suburb, town, or village.", -41336a50590 -> "description": "Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)).", -41340a50595 -> "description": "Address line 1 (e.g., street, PO Box, or company name).", -41344a50600 -> "description": "Address line 2 (e.g., apartment, suite, unit, or building).", -41348a50605 -> "description": "ZIP or postal code.", -41352a50610 -> "description": "State, county, province, or region.", -41360a50619 -> "description": "A publicly available email address for sending support issues to.", -41363a50623 -> "description": "A publicly available phone number to call with support issues.", -41378c50638,50639 -< ] ---- -> ], -> "description": "A publicly available website for handling support issues." -41380a50642 -> "description": "The business's publicly available website.", -41402a50665 -> "description": "The acss_debit_payments capability.", -41404a50668 -> "description": "Passing true requests the capability for the account, if it is not already requested. A requested capability may not immediately become active. Any requirements to activate the capability are returned in the `requirements` arrays.", -41411a50676 -> "description": "The affirm_payments capability.", -41413a50679 -> "description": "Passing true requests the capability for the account, if it is not already requested. A requested capability may not immediately become active. Any requirements to activate the capability are returned in the `requirements` arrays.", -41420a50687 -> "description": "The afterpay_clearpay_payments capability.", -41422a50690 -> "description": "Passing true requests the capability for the account, if it is not already requested. A requested capability may not immediately become active. Any requirements to activate the capability are returned in the `requirements` arrays.", -41429a50698 -> "description": "The au_becs_debit_payments capability.", -41431a50701 -> "description": "Passing true requests the capability for the account, if it is not already requested. A requested capability may not immediately become active. Any requirements to activate the capability are returned in the `requirements` arrays.", -41438a50709 -> "description": "The bacs_debit_payments capability.", -41440a50712 -> "description": "Passing true requests the capability for the account, if it is not already requested. A requested capability may not immediately become active. Any requirements to activate the capability are returned in the `requirements` arrays.", -41447a50720 -> "description": "The bancontact_payments capability.", -41449a50723 -> "description": "Passing true requests the capability for the account, if it is not already requested. A requested capability may not immediately become active. Any requirements to activate the capability are returned in the `requirements` arrays.", -41456a50731 -> "description": "The bank_transfer_payments capability.", -41458a50734 -> "description": "Passing true requests the capability for the account, if it is not already requested. A requested capability may not immediately become active. Any requirements to activate the capability are returned in the `requirements` arrays.", -41465a50742 -> "description": "The blik_payments capability.", -41467a50745 -> "description": "Passing true requests the capability for the account, if it is not already requested. A requested capability may not immediately become active. Any requirements to activate the capability are returned in the `requirements` arrays.", -41474a50753 -> "description": "The boleto_payments capability.", -41476a50756 -> "description": "Passing true requests the capability for the account, if it is not already requested. A requested capability may not immediately become active. Any requirements to activate the capability are returned in the `requirements` arrays.", -41483a50764 -> "description": "The card_issuing capability.", -41485a50767 -> "description": "Passing true requests the capability for the account, if it is not already requested. A requested capability may not immediately become active. Any requirements to activate the capability are returned in the `requirements` arrays.", -41492a50775 -> "description": "The card_payments capability.", -41494a50778 -> "description": "Passing true requests the capability for the account, if it is not already requested. A requested capability may not immediately become active. Any requirements to activate the capability are returned in the `requirements` arrays.", -41501a50786 -> "description": "The cartes_bancaires_payments capability.", -41503a50789 -> "description": "Passing true requests the capability for the account, if it is not already requested. A requested capability may not immediately become active. Any requirements to activate the capability are returned in the `requirements` arrays.", -41510a50797 -> "description": "The eps_payments capability.", -41512a50800 -> "description": "Passing true requests the capability for the account, if it is not already requested. A requested capability may not immediately become active. Any requirements to activate the capability are returned in the `requirements` arrays.", -41519a50808 -> "description": "The fpx_payments capability.", -41521a50811 -> "description": "Passing true requests the capability for the account, if it is not already requested. A requested capability may not immediately become active. Any requirements to activate the capability are returned in the `requirements` arrays.", -41528a50819 -> "description": "The giropay_payments capability.", -41530a50822 -> "description": "Passing true requests the capability for the account, if it is not already requested. A requested capability may not immediately become active. Any requirements to activate the capability are returned in the `requirements` arrays.", -41537a50830 -> "description": "The grabpay_payments capability.", -41539a50833 -> "description": "Passing true requests the capability for the account, if it is not already requested. A requested capability may not immediately become active. Any requirements to activate the capability are returned in the `requirements` arrays.", -41546a50841 -> "description": "The ideal_payments capability.", -41548a50844 -> "description": "Passing true requests the capability for the account, if it is not already requested. A requested capability may not immediately become active. Any requirements to activate the capability are returned in the `requirements` arrays.", -41555a50852 -> "description": "The jcb_payments capability.", -41557a50855 -> "description": "Passing true requests the capability for the account, if it is not already requested. A requested capability may not immediately become active. Any requirements to activate the capability are returned in the `requirements` arrays.", -41564a50863 -> "description": "The klarna_payments capability.", -41566a50866 -> "description": "Passing true requests the capability for the account, if it is not already requested. A requested capability may not immediately become active. Any requirements to activate the capability are returned in the `requirements` arrays.", -41573a50874 -> "description": "The konbini_payments capability.", -41575a50877 -> "description": "Passing true requests the capability for the account, if it is not already requested. A requested capability may not immediately become active. Any requirements to activate the capability are returned in the `requirements` arrays.", -41582a50885 -> "description": "The legacy_payments capability.", -41584a50888 -> "description": "Passing true requests the capability for the account, if it is not already requested. A requested capability may not immediately become active. Any requirements to activate the capability are returned in the `requirements` arrays.", -41591a50896 -> "description": "The link_payments capability.", -41593a50899 -> "description": "Passing true requests the capability for the account, if it is not already requested. A requested capability may not immediately become active. Any requirements to activate the capability are returned in the `requirements` arrays.", -41600a50907 -> "description": "The oxxo_payments capability.", -41602a50910 -> "description": "Passing true requests the capability for the account, if it is not already requested. A requested capability may not immediately become active. Any requirements to activate the capability are returned in the `requirements` arrays.", -41609a50918 -> "description": "The p24_payments capability.", -41611a50921 -> "description": "Passing true requests the capability for the account, if it is not already requested. A requested capability may not immediately become active. Any requirements to activate the capability are returned in the `requirements` arrays.", -41618a50929 -> "description": "The paynow_payments capability.", -41620a50932 -> "description": "Passing true requests the capability for the account, if it is not already requested. A requested capability may not immediately become active. Any requirements to activate the capability are returned in the `requirements` arrays.", -41627a50940 -> "description": "The promptpay_payments capability.", -41629a50943 -> "description": "Passing true requests the capability for the account, if it is not already requested. A requested capability may not immediately become active. Any requirements to activate the capability are returned in the `requirements` arrays.", -41636a50951 -> "description": "The sepa_debit_payments capability.", -41638a50954 -> "description": "Passing true requests the capability for the account, if it is not already requested. A requested capability may not immediately become active. Any requirements to activate the capability are returned in the `requirements` arrays.", -41645a50962 -> "description": "The sofort_payments capability.", -41647a50965 -> "description": "Passing true requests the capability for the account, if it is not already requested. A requested capability may not immediately become active. Any requirements to activate the capability are returned in the `requirements` arrays.", -41654a50973 -> "description": "The tax_reporting_us_1099_k capability.", -41656a50976 -> "description": "Passing true requests the capability for the account, if it is not already requested. A requested capability may not immediately become active. Any requirements to activate the capability are returned in the `requirements` arrays.", -41663a50984 -> "description": "The tax_reporting_us_1099_misc capability.", -41665a50987 -> "description": "Passing true requests the capability for the account, if it is not already requested. A requested capability may not immediately become active. Any requirements to activate the capability are returned in the `requirements` arrays.", -41672a50995 -> "description": "The transfers capability.", -41674a50998 -> "description": "Passing true requests the capability for the account, if it is not already requested. A requested capability may not immediately become active. Any requirements to activate the capability are returned in the `requirements` arrays.", -41681a51006 -> "description": "The treasury capability.", -41683a51009 -> "description": "Passing true requests the capability for the account, if it is not already requested. A requested capability may not immediately become active. Any requirements to activate the capability are returned in the `requirements` arrays.", -41690a51017 -> "description": "The us_bank_account_ach_payments capability.", -41692a51020 -> "description": "Passing true requests the capability for the account, if it is not already requested. A requested capability may not immediately become active. Any requirements to activate the capability are returned in the `requirements` arrays.", -41706a51035 -> "description": "The company's primary address.", -41708a51038 -> "description": "City, district, suburb, town, or village.", -41712a51043 -> "description": "Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)).", -41716a51048 -> "description": "Address line 1 (e.g., street, PO Box, or company name).", -41720a51053 -> "description": "Address line 2 (e.g., apartment, suite, unit, or building).", -41724a51058 -> "description": "ZIP or postal code.", -41728a51063 -> "description": "State, county, province, or region.", -41736a51072 -> "description": "The Kana variation of the company's primary address (Japan only).", -41738a51075 -> "description": "City or ward.", -41742a51080 -> "description": "Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)).", -41746a51085 -> "description": "Block or building number.", -41750a51090 -> "description": "Building details.", -41754a51095 -> "description": "Postal code.", -41758a51100 -> "description": "Prefecture.", -41762a51105 -> "description": "Town or cho-me.", -41770a51114 -> "description": "The Kanji variation of the company's primary address (Japan only).", -41772a51117 -> "description": "City or ward.", -41776a51122 -> "description": "Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)).", -41780a51127 -> "description": "Block or building number.", -41784a51132 -> "description": "Building details.", -41788a51137 -> "description": "Postal code.", -41792a51142 -> "description": "Prefecture.", -41796a51147 -> "description": "Town or cho-me.", -41804a51156 -> "description": "Whether the company's directors have been provided. Set this Boolean to `true` after creating all the company's directors with [the Persons API](https://stripe.com/docs/api/persons) for accounts with a `relationship.director` requirement. This value is not automatically set to `true` after creating directors, so it needs to be updated to indicate all directors have been provided.", -41807a51160 -> "description": "Whether the company's executives have been provided. Set this Boolean to `true` after creating all the company's executives with [the Persons API](https://stripe.com/docs/api/persons) for accounts with a `relationship.executive` requirement.", -41810a51164 -> "description": "The company's legal name.", -41814a51169 -> "description": "The Kana variation of the company's legal name (Japan only).", -41818a51174 -> "description": "The Kanji variation of the company's legal name (Japan only).", -41822a51179 -> "description": "Whether the company's owners have been provided. Set this Boolean to `true` after creating all the company's owners with [the Persons API](https://stripe.com/docs/api/persons) for accounts with a `relationship.owner` requirement.", -41825a51183 -> "description": "This hash is used to attest that the beneficial owner information provided to Stripe is both current and correct.", -41827a51186 -> "description": "The Unix timestamp marking when the beneficial owner attestation was made.", -41831a51191 -> "description": "The IP address from which the beneficial owner attestation was made.", -41834a51195 -> "description": "The user agent of the browser from which the beneficial owner attestation was made.", -41842a51204 -> "description": "The company's phone number (used for verification).", -41846a51209 -> "description": "The identification number given to a company when it is registered or incorporated, if distinct from the identification number used for filing taxes. (Examples are the CIN for companies and LLP IN for partnerships in India, and the Company Registration Number in Hong Kong).", -41850a51214 -> "description": "The category identifying the legal structure of the company or legal entity. See [Business structure](https://stripe.com/docs/connect/identity-verification#business-structure) for more details.", -41877a51242 -> "description": "The business ID number of the company, as appropriate for the company’s country. (Examples are an Employer ID Number in the U.S., a Business Number in Canada, or a Company Number in the UK.)", -41881a51247 -> "description": "The jurisdiction in which the `tax_id` is registered (Germany-based companies only).", -41885a51252 -> "description": "The VAT number of the company.", -41889a51257 -> "description": "Information on the verification state of the company.", -41891a51260 -> "description": "A document verifying the business.", -41893a51263 -> "description": "The back of a document returned by a [file upload](https://stripe.com/docs/api#create_file) with a `purpose` value of `additional_verification`. The uploaded file needs to be a color image (smaller than 8,000px by 8,000px), in JPG, PNG, or PDF format, and less than 10 MB in size.", -41897a51268 -> "description": "The front of a document returned by a [file upload](https://stripe.com/docs/api#create_file) with a `purpose` value of `additional_verification`. The uploaded file needs to be a color image (smaller than 8,000px by 8,000px), in JPG, PNG, or PDF format, and less than 10 MB in size.", -41920a51292 -> "description": "One or more documents that support the [Bank account ownership verification](https://support.stripe.com/questions/bank-account-ownership-verification) requirement. Must be a document associated with the account’s primary active bank account that displays the last 4 digits of the account number, either a statement or a voided check.", -41922a51295 -> "description": "One or more document ids returned by a [file upload](https://stripe.com/docs/api#create_file) with a `purpose` value of `account_requirement`.", -41933a51307 -> "description": "One or more documents that demonstrate proof of a company's license to operate.", -41935a51310 -> "description": "One or more document ids returned by a [file upload](https://stripe.com/docs/api#create_file) with a `purpose` value of `account_requirement`.", -41946a51322 -> "description": "One or more documents showing the company's Memorandum of Association.", -41948a51325 -> "description": "One or more document ids returned by a [file upload](https://stripe.com/docs/api#create_file) with a `purpose` value of `account_requirement`.", -41959a51337 -> "description": "(Certain countries only) One or more documents showing the ministerial decree legalizing the company's establishment.", -41961a51340 -> "description": "One or more document ids returned by a [file upload](https://stripe.com/docs/api#create_file) with a `purpose` value of `account_requirement`.", -41972a51352 -> "description": "One or more documents that demonstrate proof of a company's registration with the appropriate local authorities.", -41974a51355 -> "description": "One or more document ids returned by a [file upload](https://stripe.com/docs/api#create_file) with a `purpose` value of `account_requirement`.", -41985a51367 -> "description": "One or more documents that demonstrate proof of a company's tax ID.", -41987a51370 -> "description": "One or more document ids returned by a [file upload](https://stripe.com/docs/api#create_file) with a `purpose` value of `account_requirement`.", -41998a51382 -> "description": "One or more documents showing the company’s proof of registration with the national business registry.", -42000a51385 -> "description": "One or more document ids returned by a [file upload](https://stripe.com/docs/api#create_file) with a `purpose` value of `account_requirement`.", -42036a51422 -> "description": "The individual's primary address.", -42038a51425 -> "description": "City, district, suburb, town, or village.", -42042a51430 -> "description": "Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)).", -42046a51435 -> "description": "Address line 1 (e.g., street, PO Box, or company name).", -42050a51440 -> "description": "Address line 2 (e.g., apartment, suite, unit, or building).", -42054a51445 -> "description": "ZIP or postal code.", -42058a51450 -> "description": "State, county, province, or region.", -42066a51459 -> "description": "The Kana variation of the the individual's primary address (Japan only).", -42068a51462 -> "description": "City or ward.", -42072a51467 -> "description": "Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)).", -42076a51472 -> "description": "Block or building number.", -42080a51477 -> "description": "Building details.", -42084a51482 -> "description": "Postal code.", -42088a51487 -> "description": "Prefecture.", -42092a51492 -> "description": "Town or cho-me.", -42100a51501 -> "description": "The Kanji variation of the the individual's primary address (Japan only).", -42102a51504 -> "description": "City or ward.", -42106a51509 -> "description": "Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)).", -42110a51514 -> "description": "Block or building number.", -42114a51519 -> "description": "Building details.", -42118a51524 -> "description": "Postal code.", -42122a51529 -> "description": "Prefecture.", -42126a51534 -> "description": "Town or cho-me.", -42138a51547 -> "description": "The day of birth, between 1 and 31.", -42141a51551 -> "description": "The month of birth, between 1 and 12.", -42144a51555 -> "description": "The four-digit year of birth.", -42162c51573,51574 -< ] ---- -> ], -> "description": "The individual's date of birth." -42164a51577 -> "description": "The individual's email address.", -42167a51581 -> "description": "The individual's first name.", -42171a51586 -> "description": "The Kana variation of the the individual's first name (Japan only).", -42175a51591 -> "description": "The Kanji variation of the individual's first name (Japan only).", -42194c51610,51611 -< ] ---- -> ], -> "description": "A list of alternate names or aliases that the individual is known by." -42196a51614 -> "description": "The individual's gender (International regulations require either \"male\" or \"female\").", -42199a51618 -> "description": "The government-issued ID number of the individual, as appropriate for the representative’s country. (Examples are a Social Security Number in the U.S., or a Social Insurance Number in Canada). Instead of the number itself, you can also provide a [PII token created with Stripe.js](https://stripe.com/docs/js/tokens_sources/create_token?type=pii).", -42203a51623 -> "description": "The government-issued secondary ID number of the individual, as appropriate for the representative's country, will be used for enhanced verification checks. In Thailand, this would be the laser code found on the back of an ID card. Instead of the number itself, you can also provide a [PII token created with Stripe.js](https://stripe.com/docs/js/tokens_sources/create_token?type=pii).", -42207a51628 -> "description": "The individual's last name.", -42211a51633 -> "description": "The Kana variation of the individual's last name (Japan only).", -42215a51638 -> "description": "The Kanji variation of the individual's last name (Japan only).", -42219a51643 -> "description": "The individual's maiden name.", -42237c51661,51662 -< ] ---- -> ], -> "description": "Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`." -42239a51665 -> "description": "The individual's phone number.", -42242a51669 -> "description": "Indicates if the person or any of their representatives, family members, or other closely related persons, declares that they hold or have held an important public job or function, in any jurisdiction.", -42249a51677 -> "description": "The individual's registered address.", -42251a51680 -> "description": "City, district, suburb, town, or village.", -42255a51685 -> "description": "Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)).", -42259a51690 -> "description": "Address line 1 (e.g., street, PO Box, or company name).", -42263a51695 -> "description": "Address line 2 (e.g., apartment, suite, unit, or building).", -42267a51700 -> "description": "ZIP or postal code.", -42271a51705 -> "description": "State, county, province, or region.", -42279a51714 -> "description": "The last four digits of the individual's Social Security Number (U.S. only).", -42283a51719 -> "description": "The individual's verification document information.", -42285a51722 -> "description": "A document showing address, either a passport, local ID card, or utility bill from a well-known utility company.", -42287a51725 -> "description": "The back of an ID returned by a [file upload](https://stripe.com/docs/api#create_file) with a `purpose` value of `identity_document`. The uploaded file needs to be a color image (smaller than 8,000px by 8,000px), in JPG, PNG, or PDF format, and less than 10 MB in size.", -42291a51730 -> "description": "The front of an ID returned by a [file upload](https://stripe.com/docs/api#create_file) with a `purpose` value of `identity_document`. The uploaded file needs to be a color image (smaller than 8,000px by 8,000px), in JPG, PNG, or PDF format, and less than 10 MB in size.", -42299a51739 -> "description": "An identifying document, either a passport or local ID card.", -42301a51742 -> "description": "The back of an ID returned by a [file upload](https://stripe.com/docs/api#create_file) with a `purpose` value of `identity_document`. The uploaded file needs to be a color image (smaller than 8,000px by 8,000px), in JPG, PNG, or PDF format, and less than 10 MB in size.", -42305a51747 -> "description": "The front of an ID returned by a [file upload](https://stripe.com/docs/api#create_file) with a `purpose` value of `identity_document`. The uploaded file needs to be a color image (smaller than 8,000px by 8,000px), in JPG, PNG, or PDF format, and less than 10 MB in size.", -42341a51784 -> "description": "Settings used to apply the account's branding to email receipts, invoices, Checkout, and other products.", -42343a51787 -> "description": "(ID of a [file upload](https://stripe.com/docs/guides/file-upload)) An icon for the account. Must be square and at least 128px x 128px.", -42347a51792 -> "description": "(ID of a [file upload](https://stripe.com/docs/guides/file-upload)) A logo for the account that will be used in Checkout instead of the icon and without the account's name next to it if provided. Must be at least 128px x 128px.", -42351a51797 -> "description": "A CSS hex color value representing the primary branding color for this account.", -42355a51802 -> "description": "A CSS hex color value representing the secondary branding color for this account.", -42363a51811 -> "description": "Settings specific to the account's use of the Card Issuing product.", -42365a51814 -> "description": "Details on the account's acceptance of the [Stripe Issuing Terms and Disclosures](https://stripe.com/docs/issuing/connect/tos_acceptance).", -42367a51817 -> "description": "The Unix timestamp marking when the account representative accepted the service agreement.", -42371a51822 -> "description": "The IP address from which the account representative accepted the service agreement.", -42374a51826 -> "description": "The user agent of the browser from which the account representative accepted the service agreement.", -42386a51839 -> "description": "Settings specific to card charging on the account.", -42388a51842 -> "description": "Automatically declines certain charge types regardless of whether the card issuer accepted or declined the charge.", -42390a51845 -> "description": "Whether Stripe automatically declines charges with an incorrect ZIP or postal code. This setting only applies when a ZIP or postal code is provided and they fail bank verification.", -42393a51849 -> "description": "Whether Stripe automatically declines charges with an incorrect CVC. This setting only applies when a CVC is provided and it fails bank verification.", -42400a51857 -> "description": "The default text that appears on credit card statements when a charge is made. This field prefixes any dynamic `statement_descriptor` specified on the charge. `statement_descriptor_prefix` is useful for maximizing descriptor space for the dynamic portion.", -42416c51873,51874 -< ] ---- -> ], -> "description": "The Kana variation of the default text that appears on credit card statements when a charge is made (Japan only). This field prefixes any dynamic `statement_descriptor_suffix_kana` specified on the charge. `statement_descriptor_prefix_kana` is useful for maximizing descriptor space for the dynamic portion." -42430c51888,51889 -< ] ---- -> ], -> "description": "The Kanji variation of the default text that appears on credit card statements when a charge is made (Japan only). This field prefixes any dynamic `statement_descriptor_suffix_kanji` specified on the charge. `statement_descriptor_prefix_kanji` is useful for maximizing descriptor space for the dynamic portion." -42436a51896 -> "description": "Settings that apply across payment methods for charging on the account.", -42438a51899 -> "description": "The default text that appears on credit card statements when a charge is made. This field prefixes any dynamic `statement_descriptor` specified on the charge.", -42442a51904 -> "description": "The Kana variation of the default text that appears on credit card statements when a charge is made (Japan only).", -42446a51909 -> "description": "The Kanji variation of the default text that appears on credit card statements when a charge is made (Japan only).", -42454a51918 -> "description": "Settings specific to the account's payouts.", -42456a51921 -> "description": "A Boolean indicating whether Stripe should try to reclaim negative balances from an attached bank account. For details, see [Understanding Connect Account Balances](https://stripe.com/docs/connect/account-balances).", -42459a51925 -> "description": "Details on when funds from charges are available, and when they are paid out to an external account. For details, see our [Setting Bank and Debit Card Payouts](https://stripe.com/docs/connect/bank-transfers#payout-information) documentation.", -42473c51939,51940 -< ] ---- -> ], -> "description": "The number of days charge funds are held before being paid out. May also be set to `minimum`, representing the lowest available value for the account country. Default is `minimum`. The `delay_days` parameter does not apply when the `interval` is `manual`." -42475a51943 -> "description": "How frequently available funds are paid out. One of: `daily`, `manual`, `weekly`, or `monthly`. Default is `daily`.", -42486a51955 -> "description": "The day of the month when available funds are paid out, specified as a number between 1--31. Payouts nominally scheduled between the 29th and 31st of the month are instead sent on the last day of a shorter month. Required and applicable only if `interval` is `monthly`.", -42489a51959 -> "description": "The day of the week when available funds are paid out, specified as `monday`, `tuesday`, etc. (required and applicable only if `interval` is `weekly`.)", -42506a51977 -> "description": "The text that appears on the bank account statement for payouts. If not set, this defaults to the platform's bank descriptor as set in the Dashboard.", -42514a51986 -> "description": "Settings specific to the account's Treasury FinancialAccounts.", -42516a51989 -> "description": "Details on the account's acceptance of the Stripe Treasury Services Agreement.", -42518a51992 -> "description": "The Unix timestamp marking when the account representative accepted the service agreement.", -42522a51997 -> "description": "The IP address from which the account representative accepted the service agreement.", -42525a52001 -> "description": "The user agent of the browser from which the account representative accepted the service agreement.", -42544a52021 -> "description": "The Unix timestamp marking when the account representative accepted their service agreement.", -42548a52026 -> "description": "The IP address from which the account representative accepted their service agreement.", -42551a52030 -> "description": "The user's service agreement type.", -42555a52035 -> "description": "The user agent of the browser from which the account representative accepted their service agreement.", -42594,43055d52073 -< "/v1/accounts/{account}/bank_accounts": { -< "post": { -< "description": "

Create an external account for a given account.

", -< "operationId": "PostAccountsAccountBankAccounts", -< "parameters": [ -< { -< "in": "path", -< "name": "account", -< "required": true, -< "schema": { -< "maxLength": 5000, -< "type": "string" -< }, -< "style": "simple" -< } -< ], -< "requestBody": { -< "content": { -< "application/x-www-form-urlencoded": { -< "encoding": { -< "bank_account": { -< "explode": true, -< "style": "deepObject" -< }, -< "expand": { -< "explode": true, -< "style": "deepObject" -< }, -< "metadata": { -< "explode": true, -< "style": "deepObject" -< } -< }, -< "schema": { -< "additionalProperties": false, -< "properties": { -< "bank_account": { -< "anyOf": [ -< { -< "properties": { -< "account_holder_name": { -< "maxLength": 5000, -< "type": "string" -< }, -< "account_holder_type": { -< "enum": [ -< "company", -< "individual" -< ], -< "maxLength": 5000, -< "type": "string" -< }, -< "account_number": { -< "maxLength": 5000, -< "type": "string" -< }, -< "account_type": { -< "enum": [ -< "checking", -< "futsu", -< "savings", -< "toza" -< ], -< "maxLength": 5000, -< "type": "string" -< }, -< "country": { -< "maxLength": 5000, -< "type": "string" -< }, -< "currency": { -< "type": "string" -< }, -< "object": { -< "enum": [ -< "bank_account" -< ], -< "maxLength": 5000, -< "type": "string" -< }, -< "routing_number": { -< "maxLength": 5000, -< "type": "string" -< } -< }, -< "required": [ -< "account_number", -< "country" -< ], -< "title": "external_account_payout_bank_account", -< "type": "object" -< }, -< { -< "maxLength": 5000, -< "type": "string" -< } -< ], -< "description": "Either a token, like the ones returned by [Stripe.js](https://stripe.com/docs/js), or a dictionary containing a user's bank account details." -< }, -< "default_for_currency": { -< "description": "When set to true, or if this is the first external account added in this currency, this account becomes the default external account for its currency.", -< "type": "boolean" -< }, -< "expand": { -< "description": "Specifies which fields in the response should be expanded.", -< "items": { -< "maxLength": 5000, -< "type": "string" -< }, -< "type": "array" -< }, -< "external_account": { -< "description": "Please refer to full [documentation](https://stripe.com/docs/api) instead.", -< "maxLength": 5000, -< "type": "string", -< "x-stripeBypassValidation": true -< }, -< "metadata": { -< "additionalProperties": { -< "type": "string" -< }, -< "description": "Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`.", -< "type": "object" -< } -< }, -< "type": "object" -< } -< } -< }, -< "required": false -< }, -< "responses": { -< "200": { -< "content": { -< "application/json": { -< "schema": { -< "$ref": "#/components/schemas/external_account" -< } -< } -< }, -< "description": "Successful response." -< }, -< "default": { -< "content": { -< "application/json": { -< "schema": { -< "$ref": "#/components/schemas/error" -< } -< } -< }, -< "description": "Error response." -< } -< } -< } -< }, -< "/v1/accounts/{account}/bank_accounts/{id}": { -< "delete": { -< "description": "

Delete a specified external account for a given account.

", -< "operationId": "DeleteAccountsAccountBankAccountsId", -< "parameters": [ -< { -< "in": "path", -< "name": "account", -< "required": true, -< "schema": { -< "maxLength": 5000, -< "type": "string" -< }, -< "style": "simple" -< }, -< { -< "in": "path", -< "name": "id", -< "required": true, -< "schema": { -< "type": "string" -< }, -< "style": "simple" -< } -< ], -< "requestBody": { -< "content": { -< "application/x-www-form-urlencoded": { -< "encoding": {}, -< "schema": { -< "additionalProperties": false, -< "properties": {}, -< "type": "object" -< } -< } -< }, -< "required": false -< }, -< "responses": { -< "200": { -< "content": { -< "application/json": { -< "schema": { -< "$ref": "#/components/schemas/deleted_external_account" -< } -< } -< }, -< "description": "Successful response." -< }, -< "default": { -< "content": { -< "application/json": { -< "schema": { -< "$ref": "#/components/schemas/error" -< } -< } -< }, -< "description": "Error response." -< } -< } -< }, -< "get": { -< "description": "

Retrieve a specified external account for a given account.

", -< "operationId": "GetAccountsAccountBankAccountsId", -< "parameters": [ -< { -< "in": "path", -< "name": "account", -< "required": true, -< "schema": { -< "maxLength": 5000, -< "type": "string" -< }, -< "style": "simple" -< }, -< { -< "description": "Specifies which fields in the response should be expanded.", -< "explode": true, -< "in": "query", -< "name": "expand", -< "required": false, -< "schema": { -< "items": { -< "maxLength": 5000, -< "type": "string" -< }, -< "type": "array" -< }, -< "style": "deepObject" -< }, -< { -< "in": "path", -< "name": "id", -< "required": true, -< "schema": { -< "type": "string" -< }, -< "style": "simple" -< } -< ], -< "requestBody": { -< "content": { -< "application/x-www-form-urlencoded": { -< "encoding": {}, -< "schema": { -< "additionalProperties": false, -< "properties": {}, -< "type": "object" -< } -< } -< }, -< "required": false -< }, -< "responses": { -< "200": { -< "content": { -< "application/json": { -< "schema": { -< "$ref": "#/components/schemas/external_account" -< } -< } -< }, -< "description": "Successful response." -< }, -< "default": { -< "content": { -< "application/json": { -< "schema": { -< "$ref": "#/components/schemas/error" -< } -< } -< }, -< "description": "Error response." -< } -< } -< }, -< "post": { -< "description": "

Updates the metadata, account holder name, account holder type of a bank account belonging to a Custom account, and optionally sets it as the default for its currency. Other bank account details are not editable by design.

\n\n

You can re-enable a disabled bank account by performing an update call without providing any arguments or changes.

", -< "operationId": "PostAccountsAccountBankAccountsId", -< "parameters": [ -< { -< "in": "path", -< "name": "account", -< "required": true, -< "schema": { -< "maxLength": 5000, -< "type": "string" -< }, -< "style": "simple" -< }, -< { -< "in": "path", -< "name": "id", -< "required": true, -< "schema": { -< "type": "string" -< }, -< "style": "simple" -< } -< ], -< "requestBody": { -< "content": { -< "application/x-www-form-urlencoded": { -< "encoding": { -< "expand": { -< "explode": true, -< "style": "deepObject" -< }, -< "metadata": { -< "explode": true, -< "style": "deepObject" -< } -< }, -< "schema": { -< "additionalProperties": false, -< "properties": { -< "account_holder_name": { -< "description": "The name of the person or business that owns the bank account.", -< "maxLength": 5000, -< "type": "string" -< }, -< "account_holder_type": { -< "description": "The type of entity that holds the account. This can be either `individual` or `company`.", -< "enum": [ -< "", -< "company", -< "individual" -< ], -< "maxLength": 5000, -< "type": "string" -< }, -< "account_type": { -< "description": "The bank account type. This can only be `checking` or `savings` in most countries. In Japan, this can only be `futsu` or `toza`.", -< "enum": [ -< "checking", -< "futsu", -< "savings", -< "toza" -< ], -< "maxLength": 5000, -< "type": "string" -< }, -< "address_city": { -< "description": "City/District/Suburb/Town/Village.", -< "maxLength": 5000, -< "type": "string" -< }, -< "address_country": { -< "description": "Billing address country, if provided when creating card.", -< "maxLength": 5000, -< "type": "string" -< }, -< "address_line1": { -< "description": "Address line 1 (Street address/PO Box/Company name).", -< "maxLength": 5000, -< "type": "string" -< }, -< "address_line2": { -< "description": "Address line 2 (Apartment/Suite/Unit/Building).", -< "maxLength": 5000, -< "type": "string" -< }, -< "address_state": { -< "description": "State/County/Province/Region.", -< "maxLength": 5000, -< "type": "string" -< }, -< "address_zip": { -< "description": "ZIP or postal code.", -< "maxLength": 5000, -< "type": "string" -< }, -< "default_for_currency": { -< "description": "When set to true, this becomes the default external account for its currency.", -< "type": "boolean" -< }, -< "exp_month": { -< "description": "Two digit number representing the card’s expiration month.", -< "maxLength": 5000, -< "type": "string" -< }, -< "exp_year": { -< "description": "Four digit number representing the card’s expiration year.", -< "maxLength": 5000, -< "type": "string" -< }, -< "expand": { -< "description": "Specifies which fields in the response should be expanded.", -< "items": { -< "maxLength": 5000, -< "type": "string" -< }, -< "type": "array" -< }, -< "metadata": { -< "anyOf": [ -< { -< "additionalProperties": { -< "type": "string" -< }, -< "type": "object" -< }, -< { -< "enum": [ -< "" -< ], -< "type": "string" -< } -< ], -< "description": "Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`." -< }, -< "name": { -< "description": "Cardholder name.", -< "maxLength": 5000, -< "type": "string" -< } -< }, -< "type": "object" -< } -< } -< }, -< "required": false -< }, -< "responses": { -< "200": { -< "content": { -< "application/json": { -< "schema": { -< "$ref": "#/components/schemas/external_account" -< } -< } -< }, -< "description": "Successful response." -< }, -< "default": { -< "content": { -< "application/json": { -< "schema": { -< "$ref": "#/components/schemas/error" -< } -< } -< }, -< "description": "Error response." -< } -< } -< } -< }, -43398,43407c52416 -< "anyOf": [ -< { -< "$ref": "#/components/schemas/bank_account" -< }, -< { -< "$ref": "#/components/schemas/card" -< } -< ], -< "title": "Polymorphic", -< "x-stripeBypassValidation": true ---- -> "$ref": "#/components/schemas/external_account" -43475,43478d52483 -< "bank_account": { -< "explode": true, -< "style": "deepObject" -< }, -43491,43553d52495 -< "bank_account": { -< "anyOf": [ -< { -< "properties": { -< "account_holder_name": { -< "maxLength": 5000, -< "type": "string" -< }, -< "account_holder_type": { -< "enum": [ -< "company", -< "individual" -< ], -< "maxLength": 5000, -< "type": "string" -< }, -< "account_number": { -< "maxLength": 5000, -< "type": "string" -< }, -< "account_type": { -< "enum": [ -< "checking", -< "futsu", -< "savings", -< "toza" -< ], -< "maxLength": 5000, -< "type": "string" -< }, -< "country": { -< "maxLength": 5000, -< "type": "string" -< }, -< "currency": { -< "type": "string" -< }, -< "object": { -< "enum": [ -< "bank_account" -< ], -< "maxLength": 5000, -< "type": "string" -< }, -< "routing_number": { -< "maxLength": 5000, -< "type": "string" -< } -< }, -< "required": [ -< "account_number", -< "country" -< ], -< "title": "external_account_payout_bank_account", -< "type": "object" -< }, -< { -< "maxLength": 5000, -< "type": "string" -< } -< ], -< "description": "Either a token, like the ones returned by [Stripe.js](https://stripe.com/docs/js), or a dictionary containing a user's bank account details." -< }, -43579a52522,52524 -> "required": [ -> "external_account" -> ], -43584c52529 -< "required": false ---- -> "required": true -43984,45285d52928 -< "/v1/accounts/{account}/people": { -< "get": { -< "description": "

Returns a list of people associated with the account’s legal entity. The people are returned sorted by creation date, with the most recent people appearing first.

", -< "operationId": "GetAccountsAccountPeople", -< "parameters": [ -< { -< "in": "path", -< "name": "account", -< "required": true, -< "schema": { -< "maxLength": 5000, -< "type": "string" -< }, -< "style": "simple" -< }, -< { -< "description": "A cursor for use in pagination. `ending_before` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, starting with `obj_bar`, your subsequent call can include `ending_before=obj_bar` in order to fetch the previous page of the list.", -< "in": "query", -< "name": "ending_before", -< "required": false, -< "schema": { -< "maxLength": 5000, -< "type": "string" -< }, -< "style": "form" -< }, -< { -< "description": "Specifies which fields in the response should be expanded.", -< "explode": true, -< "in": "query", -< "name": "expand", -< "required": false, -< "schema": { -< "items": { -< "maxLength": 5000, -< "type": "string" -< }, -< "type": "array" -< }, -< "style": "deepObject" -< }, -< { -< "description": "A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 10.", -< "in": "query", -< "name": "limit", -< "required": false, -< "schema": { -< "type": "integer" -< }, -< "style": "form" -< }, -< { -< "description": "Filters on the list of people returned based on the person's relationship to the account's company.", -< "explode": true, -< "in": "query", -< "name": "relationship", -< "required": false, -< "schema": { -< "properties": { -< "director": { -< "type": "boolean" -< }, -< "executive": { -< "type": "boolean" -< }, -< "owner": { -< "type": "boolean" -< }, -< "representative": { -< "type": "boolean" -< } -< }, -< "title": "all_people_relationship_specs", -< "type": "object" -< }, -< "style": "deepObject" -< }, -< { -< "description": "A cursor for use in pagination. `starting_after` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with `obj_foo`, your subsequent call can include `starting_after=obj_foo` in order to fetch the next page of the list.", -< "in": "query", -< "name": "starting_after", -< "required": false, -< "schema": { -< "maxLength": 5000, -< "type": "string" -< }, -< "style": "form" -< } -< ], -< "requestBody": { -< "content": { -< "application/x-www-form-urlencoded": { -< "encoding": {}, -< "schema": { -< "additionalProperties": false, -< "properties": {}, -< "type": "object" -< } -< } -< }, -< "required": false -< }, -< "responses": { -< "200": { -< "content": { -< "application/json": { -< "schema": { -< "description": "", -< "properties": { -< "data": { -< "items": { -< "$ref": "#/components/schemas/person" -< }, -< "type": "array" -< }, -< "has_more": { -< "description": "True if this list has another page of items after this one that can be fetched.", -< "type": "boolean" -< }, -< "object": { -< "description": "String representing the object's type. Objects of the same type share the same value. Always has the value `list`.", -< "enum": [ -< "list" -< ], -< "type": "string" -< }, -< "url": { -< "description": "The URL where this list can be accessed.", -< "maxLength": 5000, -< "type": "string" -< } -< }, -< "required": [ -< "data", -< "has_more", -< "object", -< "url" -< ], -< "title": "PersonList", -< "type": "object", -< "x-expandableFields": [ -< "data" -< ] -< } -< } -< }, -< "description": "Successful response." -< }, -< "default": { -< "content": { -< "application/json": { -< "schema": { -< "$ref": "#/components/schemas/error" -< } -< } -< }, -< "description": "Error response." -< } -< } -< }, -< "post": { -< "description": "

Creates a new person.

", -< "operationId": "PostAccountsAccountPeople", -< "parameters": [ -< { -< "in": "path", -< "name": "account", -< "required": true, -< "schema": { -< "maxLength": 5000, -< "type": "string" -< }, -< "style": "simple" -< } -< ], -< "requestBody": { -< "content": { -< "application/x-www-form-urlencoded": { -< "encoding": { -< "address": { -< "explode": true, -< "style": "deepObject" -< }, -< "address_kana": { -< "explode": true, -< "style": "deepObject" -< }, -< "address_kanji": { -< "explode": true, -< "style": "deepObject" -< }, -< "dob": { -< "explode": true, -< "style": "deepObject" -< }, -< "documents": { -< "explode": true, -< "style": "deepObject" -< }, -< "expand": { -< "explode": true, -< "style": "deepObject" -< }, -< "full_name_aliases": { -< "explode": true, -< "style": "deepObject" -< }, -< "metadata": { -< "explode": true, -< "style": "deepObject" -< }, -< "registered_address": { -< "explode": true, -< "style": "deepObject" -< }, -< "relationship": { -< "explode": true, -< "style": "deepObject" -< }, -< "verification": { -< "explode": true, -< "style": "deepObject" -< } -< }, -< "schema": { -< "additionalProperties": false, -< "properties": { -< "address": { -< "description": "The person's address.", -< "properties": { -< "city": { -< "maxLength": 100, -< "type": "string" -< }, -< "country": { -< "maxLength": 5000, -< "type": "string" -< }, -< "line1": { -< "maxLength": 200, -< "type": "string" -< }, -< "line2": { -< "maxLength": 200, -< "type": "string" -< }, -< "postal_code": { -< "maxLength": 5000, -< "type": "string" -< }, -< "state": { -< "maxLength": 5000, -< "type": "string" -< } -< }, -< "title": "address_specs", -< "type": "object" -< }, -< "address_kana": { -< "description": "The Kana variation of the person's address (Japan only).", -< "properties": { -< "city": { -< "maxLength": 5000, -< "type": "string" -< }, -< "country": { -< "maxLength": 5000, -< "type": "string" -< }, -< "line1": { -< "maxLength": 5000, -< "type": "string" -< }, -< "line2": { -< "maxLength": 5000, -< "type": "string" -< }, -< "postal_code": { -< "maxLength": 5000, -< "type": "string" -< }, -< "state": { -< "maxLength": 5000, -< "type": "string" -< }, -< "town": { -< "maxLength": 5000, -< "type": "string" -< } -< }, -< "title": "japan_address_kana_specs", -< "type": "object" -< }, -< "address_kanji": { -< "description": "The Kanji variation of the person's address (Japan only).", -< "properties": { -< "city": { -< "maxLength": 5000, -< "type": "string" -< }, -< "country": { -< "maxLength": 5000, -< "type": "string" -< }, -< "line1": { -< "maxLength": 5000, -< "type": "string" -< }, -< "line2": { -< "maxLength": 5000, -< "type": "string" -< }, -< "postal_code": { -< "maxLength": 5000, -< "type": "string" -< }, -< "state": { -< "maxLength": 5000, -< "type": "string" -< }, -< "town": { -< "maxLength": 5000, -< "type": "string" -< } -< }, -< "title": "japan_address_kanji_specs", -< "type": "object" -< }, -< "dob": { -< "anyOf": [ -< { -< "properties": { -< "day": { -< "type": "integer" -< }, -< "month": { -< "type": "integer" -< }, -< "year": { -< "type": "integer" -< } -< }, -< "required": [ -< "day", -< "month", -< "year" -< ], -< "title": "date_of_birth_specs", -< "type": "object" -< }, -< { -< "enum": [ -< "" -< ], -< "type": "string" -< } -< ], -< "description": "The person's date of birth." -< }, -< "documents": { -< "description": "Documents that may be submitted to satisfy various informational requests.", -< "properties": { -< "company_authorization": { -< "properties": { -< "files": { -< "items": { -< "maxLength": 500, -< "type": "string" -< }, -< "type": "array" -< } -< }, -< "title": "documents_param", -< "type": "object" -< }, -< "passport": { -< "properties": { -< "files": { -< "items": { -< "maxLength": 500, -< "type": "string" -< }, -< "type": "array" -< } -< }, -< "title": "documents_param", -< "type": "object" -< }, -< "visa": { -< "properties": { -< "files": { -< "items": { -< "maxLength": 500, -< "type": "string" -< }, -< "type": "array" -< } -< }, -< "title": "documents_param", -< "type": "object" -< } -< }, -< "title": "person_documents_specs", -< "type": "object" -< }, -< "email": { -< "description": "The person's email address.", -< "type": "string" -< }, -< "expand": { -< "description": "Specifies which fields in the response should be expanded.", -< "items": { -< "maxLength": 5000, -< "type": "string" -< }, -< "type": "array" -< }, -< "first_name": { -< "description": "The person's first name.", -< "maxLength": 5000, -< "type": "string" -< }, -< "first_name_kana": { -< "description": "The Kana variation of the person's first name (Japan only).", -< "maxLength": 5000, -< "type": "string" -< }, -< "first_name_kanji": { -< "description": "The Kanji variation of the person's first name (Japan only).", -< "maxLength": 5000, -< "type": "string" -< }, -< "full_name_aliases": { -< "anyOf": [ -< { -< "items": { -< "maxLength": 5000, -< "type": "string" -< }, -< "type": "array" -< }, -< { -< "enum": [ -< "" -< ], -< "type": "string" -< } -< ], -< "description": "A list of alternate names or aliases that the person is known by." -< }, -< "gender": { -< "description": "The person's gender (International regulations require either \"male\" or \"female\").", -< "type": "string" -< }, -< "id_number": { -< "description": "The person's ID number, as appropriate for their country. For example, a social security number in the U.S., social insurance number in Canada, etc. Instead of the number itself, you can also provide a [PII token provided by Stripe.js](https://stripe.com/docs/js/tokens_sources/create_token?type=pii).", -< "maxLength": 5000, -< "type": "string" -< }, -< "id_number_secondary": { -< "description": "The person's secondary ID number, as appropriate for their country, will be used for enhanced verification checks. In Thailand, this would be the laser code found on the back of an ID card. Instead of the number itself, you can also provide a [PII token provided by Stripe.js](https://stripe.com/docs/js/tokens_sources/create_token?type=pii).", -< "maxLength": 5000, -< "type": "string" -< }, -< "last_name": { -< "description": "The person's last name.", -< "maxLength": 5000, -< "type": "string" -< }, -< "last_name_kana": { -< "description": "The Kana variation of the person's last name (Japan only).", -< "maxLength": 5000, -< "type": "string" -< }, -< "last_name_kanji": { -< "description": "The Kanji variation of the person's last name (Japan only).", -< "maxLength": 5000, -< "type": "string" -< }, -< "maiden_name": { -< "description": "The person's maiden name.", -< "maxLength": 5000, -< "type": "string" -< }, -< "metadata": { -< "anyOf": [ -< { -< "additionalProperties": { -< "type": "string" -< }, -< "type": "object" -< }, -< { -< "enum": [ -< "" -< ], -< "type": "string" -< } -< ], -< "description": "Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`." -< }, -< "nationality": { -< "description": "The country where the person is a national. Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)), or \"XX\" if unavailable.", -< "maxLength": 5000, -< "type": "string" -< }, -< "person_token": { -< "description": "A [person token](https://stripe.com/docs/connect/account-tokens), used to securely provide details to the person.", -< "maxLength": 5000, -< "type": "string" -< }, -< "phone": { -< "description": "The person's phone number.", -< "type": "string" -< }, -< "political_exposure": { -< "description": "Indicates if the person or any of their representatives, family members, or other closely related persons, declares that they hold or have held an important public job or function, in any jurisdiction.", -< "maxLength": 5000, -< "type": "string" -< }, -< "registered_address": { -< "description": "The person's registered address.", -< "properties": { -< "city": { -< "maxLength": 100, -< "type": "string" -< }, -< "country": { -< "maxLength": 5000, -< "type": "string" -< }, -< "line1": { -< "maxLength": 200, -< "type": "string" -< }, -< "line2": { -< "maxLength": 200, -< "type": "string" -< }, -< "postal_code": { -< "maxLength": 5000, -< "type": "string" -< }, -< "state": { -< "maxLength": 5000, -< "type": "string" -< } -< }, -< "title": "address_specs", -< "type": "object" -< }, -< "relationship": { -< "description": "The relationship that this person has with the account's legal entity.", -< "properties": { -< "director": { -< "type": "boolean" -< }, -< "executive": { -< "type": "boolean" -< }, -< "owner": { -< "type": "boolean" -< }, -< "percent_ownership": { -< "anyOf": [ -< { -< "type": "number" -< }, -< { -< "enum": [ -< "" -< ], -< "type": "string" -< } -< ] -< }, -< "representative": { -< "type": "boolean" -< }, -< "title": { -< "maxLength": 5000, -< "type": "string" -< } -< }, -< "title": "relationship_specs", -< "type": "object" -< }, -< "ssn_last_4": { -< "description": "The last four digits of the person's Social Security number (U.S. only).", -< "type": "string" -< }, -< "verification": { -< "description": "The person's verification status.", -< "properties": { -< "additional_document": { -< "properties": { -< "back": { -< "maxLength": 500, -< "type": "string" -< }, -< "front": { -< "maxLength": 500, -< "type": "string" -< } -< }, -< "title": "person_verification_document_specs", -< "type": "object" -< }, -< "document": { -< "properties": { -< "back": { -< "maxLength": 500, -< "type": "string" -< }, -< "front": { -< "maxLength": 500, -< "type": "string" -< } -< }, -< "title": "person_verification_document_specs", -< "type": "object" -< } -< }, -< "title": "person_verification_specs", -< "type": "object" -< } -< }, -< "type": "object" -< } -< } -< }, -< "required": false -< }, -< "responses": { -< "200": { -< "content": { -< "application/json": { -< "schema": { -< "$ref": "#/components/schemas/person" -< } -< } -< }, -< "description": "Successful response." -< }, -< "default": { -< "content": { -< "application/json": { -< "schema": { -< "$ref": "#/components/schemas/error" -< } -< } -< }, -< "description": "Error response." -< } -< } -< } -< }, -< "/v1/accounts/{account}/people/{person}": { -< "delete": { -< "description": "

Deletes an existing person’s relationship to the account’s legal entity. Any person with a relationship for an account can be deleted through the API, except if the person is the account_opener. If your integration is using the executive parameter, you cannot delete the only verified executive on file.

", -< "operationId": "DeleteAccountsAccountPeoplePerson", -< "parameters": [ -< { -< "in": "path", -< "name": "account", -< "required": true, -< "schema": { -< "maxLength": 5000, -< "type": "string" -< }, -< "style": "simple" -< }, -< { -< "in": "path", -< "name": "person", -< "required": true, -< "schema": { -< "maxLength": 5000, -< "type": "string" -< }, -< "style": "simple" -< } -< ], -< "requestBody": { -< "content": { -< "application/x-www-form-urlencoded": { -< "encoding": {}, -< "schema": { -< "additionalProperties": false, -< "properties": {}, -< "type": "object" -< } -< } -< }, -< "required": false -< }, -< "responses": { -< "200": { -< "content": { -< "application/json": { -< "schema": { -< "$ref": "#/components/schemas/deleted_person" -< } -< } -< }, -< "description": "Successful response." -< }, -< "default": { -< "content": { -< "application/json": { -< "schema": { -< "$ref": "#/components/schemas/error" -< } -< } -< }, -< "description": "Error response." -< } -< } -< }, -< "get": { -< "description": "

Retrieves an existing person.

", -< "operationId": "GetAccountsAccountPeoplePerson", -< "parameters": [ -< { -< "in": "path", -< "name": "account", -< "required": true, -< "schema": { -< "maxLength": 5000, -< "type": "string" -< }, -< "style": "simple" -< }, -< { -< "description": "Specifies which fields in the response should be expanded.", -< "explode": true, -< "in": "query", -< "name": "expand", -< "required": false, -< "schema": { -< "items": { -< "maxLength": 5000, -< "type": "string" -< }, -< "type": "array" -< }, -< "style": "deepObject" -< }, -< { -< "in": "path", -< "name": "person", -< "required": true, -< "schema": { -< "maxLength": 5000, -< "type": "string" -< }, -< "style": "simple" -< } -< ], -< "requestBody": { -< "content": { -< "application/x-www-form-urlencoded": { -< "encoding": {}, -< "schema": { -< "additionalProperties": false, -< "properties": {}, -< "type": "object" -< } -< } -< }, -< "required": false -< }, -< "responses": { -< "200": { -< "content": { -< "application/json": { -< "schema": { -< "$ref": "#/components/schemas/person" -< } -< } -< }, -< "description": "Successful response." -< }, -< "default": { -< "content": { -< "application/json": { -< "schema": { -< "$ref": "#/components/schemas/error" -< } -< } -< }, -< "description": "Error response." -< } -< } -< }, -< "post": { -< "description": "

Updates an existing person.

", -< "operationId": "PostAccountsAccountPeoplePerson", -< "parameters": [ -< { -< "in": "path", -< "name": "account", -< "required": true, -< "schema": { -< "maxLength": 5000, -< "type": "string" -< }, -< "style": "simple" -< }, -< { -< "in": "path", -< "name": "person", -< "required": true, -< "schema": { -< "maxLength": 5000, -< "type": "string" -< }, -< "style": "simple" -< } -< ], -< "requestBody": { -< "content": { -< "application/x-www-form-urlencoded": { -< "encoding": { -< "address": { -< "explode": true, -< "style": "deepObject" -< }, -< "address_kana": { -< "explode": true, -< "style": "deepObject" -< }, -< "address_kanji": { -< "explode": true, -< "style": "deepObject" -< }, -< "dob": { -< "explode": true, -< "style": "deepObject" -< }, -< "documents": { -< "explode": true, -< "style": "deepObject" -< }, -< "expand": { -< "explode": true, -< "style": "deepObject" -< }, -< "full_name_aliases": { -< "explode": true, -< "style": "deepObject" -< }, -< "metadata": { -< "explode": true, -< "style": "deepObject" -< }, -< "registered_address": { -< "explode": true, -< "style": "deepObject" -< }, -< "relationship": { -< "explode": true, -< "style": "deepObject" -< }, -< "verification": { -< "explode": true, -< "style": "deepObject" -< } -< }, -< "schema": { -< "additionalProperties": false, -< "properties": { -< "address": { -< "description": "The person's address.", -< "properties": { -< "city": { -< "maxLength": 100, -< "type": "string" -< }, -< "country": { -< "maxLength": 5000, -< "type": "string" -< }, -< "line1": { -< "maxLength": 200, -< "type": "string" -< }, -< "line2": { -< "maxLength": 200, -< "type": "string" -< }, -< "postal_code": { -< "maxLength": 5000, -< "type": "string" -< }, -< "state": { -< "maxLength": 5000, -< "type": "string" -< } -< }, -< "title": "address_specs", -< "type": "object" -< }, -< "address_kana": { -< "description": "The Kana variation of the person's address (Japan only).", -< "properties": { -< "city": { -< "maxLength": 5000, -< "type": "string" -< }, -< "country": { -< "maxLength": 5000, -< "type": "string" -< }, -< "line1": { -< "maxLength": 5000, -< "type": "string" -< }, -< "line2": { -< "maxLength": 5000, -< "type": "string" -< }, -< "postal_code": { -< "maxLength": 5000, -< "type": "string" -< }, -< "state": { -< "maxLength": 5000, -< "type": "string" -< }, -< "town": { -< "maxLength": 5000, -< "type": "string" -< } -< }, -< "title": "japan_address_kana_specs", -< "type": "object" -< }, -< "address_kanji": { -< "description": "The Kanji variation of the person's address (Japan only).", -< "properties": { -< "city": { -< "maxLength": 5000, -< "type": "string" -< }, -< "country": { -< "maxLength": 5000, -< "type": "string" -< }, -< "line1": { -< "maxLength": 5000, -< "type": "string" -< }, -< "line2": { -< "maxLength": 5000, -< "type": "string" -< }, -< "postal_code": { -< "maxLength": 5000, -< "type": "string" -< }, -< "state": { -< "maxLength": 5000, -< "type": "string" -< }, -< "town": { -< "maxLength": 5000, -< "type": "string" -< } -< }, -< "title": "japan_address_kanji_specs", -< "type": "object" -< }, -< "dob": { -< "anyOf": [ -< { -< "properties": { -< "day": { -< "type": "integer" -< }, -< "month": { -< "type": "integer" -< }, -< "year": { -< "type": "integer" -< } -< }, -< "required": [ -< "day", -< "month", -< "year" -< ], -< "title": "date_of_birth_specs", -< "type": "object" -< }, -< { -< "enum": [ -< "" -< ], -< "type": "string" -< } -< ], -< "description": "The person's date of birth." -< }, -< "documents": { -< "description": "Documents that may be submitted to satisfy various informational requests.", -< "properties": { -< "company_authorization": { -< "properties": { -< "files": { -< "items": { -< "maxLength": 500, -< "type": "string" -< }, -< "type": "array" -< } -< }, -< "title": "documents_param", -< "type": "object" -< }, -< "passport": { -< "properties": { -< "files": { -< "items": { -< "maxLength": 500, -< "type": "string" -< }, -< "type": "array" -< } -< }, -< "title": "documents_param", -< "type": "object" -< }, -< "visa": { -< "properties": { -< "files": { -< "items": { -< "maxLength": 500, -< "type": "string" -< }, -< "type": "array" -< } -< }, -< "title": "documents_param", -< "type": "object" -< } -< }, -< "title": "person_documents_specs", -< "type": "object" -< }, -< "email": { -< "description": "The person's email address.", -< "type": "string" -< }, -< "expand": { -< "description": "Specifies which fields in the response should be expanded.", -< "items": { -< "maxLength": 5000, -< "type": "string" -< }, -< "type": "array" -< }, -< "first_name": { -< "description": "The person's first name.", -< "maxLength": 5000, -< "type": "string" -< }, -< "first_name_kana": { -< "description": "The Kana variation of the person's first name (Japan only).", -< "maxLength": 5000, -< "type": "string" -< }, -< "first_name_kanji": { -< "description": "The Kanji variation of the person's first name (Japan only).", -< "maxLength": 5000, -< "type": "string" -< }, -< "full_name_aliases": { -< "anyOf": [ -< { -< "items": { -< "maxLength": 5000, -< "type": "string" -< }, -< "type": "array" -< }, -< { -< "enum": [ -< "" -< ], -< "type": "string" -< } -< ], -< "description": "A list of alternate names or aliases that the person is known by." -< }, -< "gender": { -< "description": "The person's gender (International regulations require either \"male\" or \"female\").", -< "type": "string" -< }, -< "id_number": { -< "description": "The person's ID number, as appropriate for their country. For example, a social security number in the U.S., social insurance number in Canada, etc. Instead of the number itself, you can also provide a [PII token provided by Stripe.js](https://stripe.com/docs/js/tokens_sources/create_token?type=pii).", -< "maxLength": 5000, -< "type": "string" -< }, -< "id_number_secondary": { -< "description": "The person's secondary ID number, as appropriate for their country, will be used for enhanced verification checks. In Thailand, this would be the laser code found on the back of an ID card. Instead of the number itself, you can also provide a [PII token provided by Stripe.js](https://stripe.com/docs/js/tokens_sources/create_token?type=pii).", -< "maxLength": 5000, -< "type": "string" -< }, -< "last_name": { -< "description": "The person's last name.", -< "maxLength": 5000, -< "type": "string" -< }, -< "last_name_kana": { -< "description": "The Kana variation of the person's last name (Japan only).", -< "maxLength": 5000, -< "type": "string" -< }, -< "last_name_kanji": { -< "description": "The Kanji variation of the person's last name (Japan only).", -< "maxLength": 5000, -< "type": "string" -< }, -< "maiden_name": { -< "description": "The person's maiden name.", -< "maxLength": 5000, -< "type": "string" -< }, -< "metadata": { -< "anyOf": [ -< { -< "additionalProperties": { -< "type": "string" -< }, -< "type": "object" -< }, -< { -< "enum": [ -< "" -< ], -< "type": "string" -< } -< ], -< "description": "Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`." -< }, -< "nationality": { -< "description": "The country where the person is a national. Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)), or \"XX\" if unavailable.", -< "maxLength": 5000, -< "type": "string" -< }, -< "person_token": { -< "description": "A [person token](https://stripe.com/docs/connect/account-tokens), used to securely provide details to the person.", -< "maxLength": 5000, -< "type": "string" -< }, -< "phone": { -< "description": "The person's phone number.", -< "type": "string" -< }, -< "political_exposure": { -< "description": "Indicates if the person or any of their representatives, family members, or other closely related persons, declares that they hold or have held an important public job or function, in any jurisdiction.", -< "maxLength": 5000, -< "type": "string" -< }, -< "registered_address": { -< "description": "The person's registered address.", -< "properties": { -< "city": { -< "maxLength": 100, -< "type": "string" -< }, -< "country": { -< "maxLength": 5000, -< "type": "string" -< }, -< "line1": { -< "maxLength": 200, -< "type": "string" -< }, -< "line2": { -< "maxLength": 200, -< "type": "string" -< }, -< "postal_code": { -< "maxLength": 5000, -< "type": "string" -< }, -< "state": { -< "maxLength": 5000, -< "type": "string" -< } -< }, -< "title": "address_specs", -< "type": "object" -< }, -< "relationship": { -< "description": "The relationship that this person has with the account's legal entity.", -< "properties": { -< "director": { -< "type": "boolean" -< }, -< "executive": { -< "type": "boolean" -< }, -< "owner": { -< "type": "boolean" -< }, -< "percent_ownership": { -< "anyOf": [ -< { -< "type": "number" -< }, -< { -< "enum": [ -< "" -< ], -< "type": "string" -< } -< ] -< }, -< "representative": { -< "type": "boolean" -< }, -< "title": { -< "maxLength": 5000, -< "type": "string" -< } -< }, -< "title": "relationship_specs", -< "type": "object" -< }, -< "ssn_last_4": { -< "description": "The last four digits of the person's Social Security number (U.S. only).", -< "type": "string" -< }, -< "verification": { -< "description": "The person's verification status.", -< "properties": { -< "additional_document": { -< "properties": { -< "back": { -< "maxLength": 500, -< "type": "string" -< }, -< "front": { -< "maxLength": 500, -< "type": "string" -< } -< }, -< "title": "person_verification_document_specs", -< "type": "object" -< }, -< "document": { -< "properties": { -< "back": { -< "maxLength": 500, -< "type": "string" -< }, -< "front": { -< "maxLength": 500, -< "type": "string" -< } -< }, -< "title": "person_verification_document_specs", -< "type": "object" -< } -< }, -< "title": "person_verification_specs", -< "type": "object" -< } -< }, -< "type": "object" -< } -< } -< }, -< "required": false -< }, -< "responses": { -< "200": { -< "content": { -< "application/json": { -< "schema": { -< "$ref": "#/components/schemas/person" -< } -< } -< }, -< "description": "Successful response." -< }, -< "default": { -< "content": { -< "application/json": { -< "schema": { -< "$ref": "#/components/schemas/error" -< } -< } -< }, -< "description": "Error response." -< } -< } -< } -< }, -45345a52989 -> "description": "A filter on the list of people returned based on whether these people are directors of the account's company.", -45348a52993 -> "description": "A filter on the list of people returned based on whether these people are executives of the account's company.", -45351a52997 -> "description": "A filter on the list of people returned based on whether these people are owners of the account's company.", -45354a53001 -> "description": "A filter on the list of people returned based on whether these people are the representative of the account's company.", -45516a53164 -> "description": "City, district, suburb, town, or village.", -45520a53169 -> "description": "Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)).", -45524a53174 -> "description": "Address line 1 (e.g., street, PO Box, or company name).", -45528a53179 -> "description": "Address line 2 (e.g., apartment, suite, unit, or building).", -45532a53184 -> "description": "ZIP or postal code.", -45536a53189 -> "description": "State, county, province, or region.", -45547a53201 -> "description": "City or ward.", -45551a53206 -> "description": "Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)).", -45555a53211 -> "description": "Block or building number.", -45559a53216 -> "description": "Building details.", -45563a53221 -> "description": "Postal code.", -45567a53226 -> "description": "Prefecture.", -45571a53231 -> "description": "Town or cho-me.", -45582a53243 -> "description": "City or ward.", -45586a53248 -> "description": "Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)).", -45590a53253 -> "description": "Block or building number.", -45594a53258 -> "description": "Building details.", -45598a53263 -> "description": "Postal code.", -45602a53268 -> "description": "Prefecture.", -45606a53273 -> "description": "Town or cho-me.", -45618a53286 -> "description": "The day of birth, between 1 and 31.", -45621a53290 -> "description": "The month of birth, between 1 and 12.", -45624a53294 -> "description": "The four-digit year of birth.", -45648a53319 -> "description": "One or more documents that demonstrate proof that this person is authorized to represent the company.", -45650a53322 -> "description": "One or more document ids returned by a [file upload](https://stripe.com/docs/api#create_file) with a `purpose` value of `account_requirement`.", -45661a53334 -> "description": "One or more documents showing the person's passport page with photo and personal data.", -45663a53337 -> "description": "One or more document ids returned by a [file upload](https://stripe.com/docs/api#create_file) with a `purpose` value of `account_requirement`.", -45674a53349 -> "description": "One or more documents showing the person's visa required for living in the country where they are residing.", -45676a53352 -> "description": "One or more document ids returned by a [file upload](https://stripe.com/docs/api#create_file) with a `purpose` value of `account_requirement`.", -45809a53486 -> "description": "City, district, suburb, town, or village.", -45813a53491 -> "description": "Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)).", -45817a53496 -> "description": "Address line 1 (e.g., street, PO Box, or company name).", -45821a53501 -> "description": "Address line 2 (e.g., apartment, suite, unit, or building).", -45825a53506 -> "description": "ZIP or postal code.", -45829a53511 -> "description": "State, county, province, or region.", -45840a53523 -> "description": "Whether the person is a director of the account's legal entity. Directors are typically members of the governing board of the company, or responsible for ensuring the company meets its regulatory obligations.", -45843a53527 -> "description": "Whether the person has significant responsibility to control, manage, or direct the organization.", -45846a53531 -> "description": "Whether the person is an owner of the account’s legal entity.", -45860c53545,53546 -< ] ---- -> ], -> "description": "The percent owned by the person of the account's legal entity." -45862a53549 -> "description": "Whether the person is authorized as the primary representative of the account. This is the person nominated by the business to provide information about themselves, and general information about the account. There can only be one representative at any given time. At the time the account is created, this person should be set to the person responsible for opening the account.", -45865a53553 -> "description": "The person's title (e.g., CEO, Support Engineer).", -45880a53569 -> "description": "A document showing address, either a passport, local ID card, or utility bill from a well-known utility company.", -45882a53572 -> "description": "The back of an ID returned by a [file upload](https://stripe.com/docs/api#create_file) with a `purpose` value of `identity_document`. The uploaded file needs to be a color image (smaller than 8,000px by 8,000px), in JPG, PNG, or PDF format, and less than 10 MB in size.", -45886a53577 -> "description": "The front of an ID returned by a [file upload](https://stripe.com/docs/api#create_file) with a `purpose` value of `identity_document`. The uploaded file needs to be a color image (smaller than 8,000px by 8,000px), in JPG, PNG, or PDF format, and less than 10 MB in size.", -45894a53586 -> "description": "An identifying document, either a passport or local ID card.", -45896a53589 -> "description": "The back of an ID returned by a [file upload](https://stripe.com/docs/api#create_file) with a `purpose` value of `identity_document`. The uploaded file needs to be a color image (smaller than 8,000px by 8,000px), in JPG, PNG, or PDF format, and less than 10 MB in size.", -45900a53594 -> "description": "The front of an ID returned by a [file upload](https://stripe.com/docs/api#create_file) with a `purpose` value of `identity_document`. The uploaded file needs to be a color image (smaller than 8,000px by 8,000px), in JPG, PNG, or PDF format, and less than 10 MB in size.", -46161a53856 -> "description": "City, district, suburb, town, or village.", -46165a53861 -> "description": "Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)).", -46169a53866 -> "description": "Address line 1 (e.g., street, PO Box, or company name).", -46173a53871 -> "description": "Address line 2 (e.g., apartment, suite, unit, or building).", -46177a53876 -> "description": "ZIP or postal code.", -46181a53881 -> "description": "State, county, province, or region.", -46192a53893 -> "description": "City or ward.", -46196a53898 -> "description": "Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)).", -46200a53903 -> "description": "Block or building number.", -46204a53908 -> "description": "Building details.", -46208a53913 -> "description": "Postal code.", -46212a53918 -> "description": "Prefecture.", -46216a53923 -> "description": "Town or cho-me.", -46227a53935 -> "description": "City or ward.", -46231a53940 -> "description": "Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)).", -46235a53945 -> "description": "Block or building number.", -46239a53950 -> "description": "Building details.", -46243a53955 -> "description": "Postal code.", -46247a53960 -> "description": "Prefecture.", -46251a53965 -> "description": "Town or cho-me.", -46263a53978 -> "description": "The day of birth, between 1 and 31.", -46266a53982 -> "description": "The month of birth, between 1 and 12.", -46269a53986 -> "description": "The four-digit year of birth.", -46293a54011 -> "description": "One or more documents that demonstrate proof that this person is authorized to represent the company.", -46295a54014 -> "description": "One or more document ids returned by a [file upload](https://stripe.com/docs/api#create_file) with a `purpose` value of `account_requirement`.", -46306a54026 -> "description": "One or more documents showing the person's passport page with photo and personal data.", -46308a54029 -> "description": "One or more document ids returned by a [file upload](https://stripe.com/docs/api#create_file) with a `purpose` value of `account_requirement`.", -46319a54041 -> "description": "One or more documents showing the person's visa required for living in the country where they are residing.", -46321a54044 -> "description": "One or more document ids returned by a [file upload](https://stripe.com/docs/api#create_file) with a `purpose` value of `account_requirement`.", -46454a54178 -> "description": "City, district, suburb, town, or village.", -46458a54183 -> "description": "Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)).", -46462a54188 -> "description": "Address line 1 (e.g., street, PO Box, or company name).", -46466a54193 -> "description": "Address line 2 (e.g., apartment, suite, unit, or building).", -46470a54198 -> "description": "ZIP or postal code.", -46474a54203 -> "description": "State, county, province, or region.", -46485a54215 -> "description": "Whether the person is a director of the account's legal entity. Directors are typically members of the governing board of the company, or responsible for ensuring the company meets its regulatory obligations.", -46488a54219 -> "description": "Whether the person has significant responsibility to control, manage, or direct the organization.", -46491a54223 -> "description": "Whether the person is an owner of the account’s legal entity.", -46505c54237,54238 -< ] ---- -> ], -> "description": "The percent owned by the person of the account's legal entity." -46507a54241 -> "description": "Whether the person is authorized as the primary representative of the account. This is the person nominated by the business to provide information about themselves, and general information about the account. There can only be one representative at any given time. At the time the account is created, this person should be set to the person responsible for opening the account.", -46510a54245 -> "description": "The person's title (e.g., CEO, Support Engineer).", -46525a54261 -> "description": "A document showing address, either a passport, local ID card, or utility bill from a well-known utility company.", -46527a54264 -> "description": "The back of an ID returned by a [file upload](https://stripe.com/docs/api#create_file) with a `purpose` value of `identity_document`. The uploaded file needs to be a color image (smaller than 8,000px by 8,000px), in JPG, PNG, or PDF format, and less than 10 MB in size.", -46531a54269 -> "description": "The front of an ID returned by a [file upload](https://stripe.com/docs/api#create_file) with a `purpose` value of `identity_document`. The uploaded file needs to be a color image (smaller than 8,000px by 8,000px), in JPG, PNG, or PDF format, and less than 10 MB in size.", -46539a54278 -> "description": "An identifying document, either a passport or local ID card.", -46541a54281 -> "description": "The back of an ID returned by a [file upload](https://stripe.com/docs/api#create_file) with a `purpose` value of `identity_document`. The uploaded file needs to be a color image (smaller than 8,000px by 8,000px), in JPG, PNG, or PDF format, and less than 10 MB in size.", -46545a54286 -> "description": "The front of an ID returned by a [file upload](https://stripe.com/docs/api#create_file) with a `purpose` value of `identity_document`. The uploaded file needs to be a color image (smaller than 8,000px by 8,000px), in JPG, PNG, or PDF format, and less than 10 MB in size.", -47002a54744 -> "description": "Minimum value to filter by (exclusive)", -47005a54748 -> "description": "Minimum value to filter by (inclusive)", -47008a54752 -> "description": "Maximum value to filter by (exclusive)", -47011a54756 -> "description": "Maximum value to filter by (inclusive)", -47388,47461d55132 -< "/v1/application_fees/{id}/refund": { -< "post": { -< "description": "", -< "operationId": "PostApplicationFeesIdRefund", -< "parameters": [ -< { -< "in": "path", -< "name": "id", -< "required": true, -< "schema": { -< "maxLength": 5000, -< "type": "string" -< }, -< "style": "simple" -< } -< ], -< "requestBody": { -< "content": { -< "application/x-www-form-urlencoded": { -< "encoding": { -< "expand": { -< "explode": true, -< "style": "deepObject" -< } -< }, -< "schema": { -< "additionalProperties": false, -< "properties": { -< "amount": { -< "type": "integer" -< }, -< "directive": { -< "maxLength": 5000, -< "type": "string" -< }, -< "expand": { -< "description": "Specifies which fields in the response should be expanded.", -< "items": { -< "maxLength": 5000, -< "type": "string" -< }, -< "type": "array" -< } -< }, -< "type": "object" -< } -< } -< }, -< "required": false -< }, -< "responses": { -< "200": { -< "content": { -< "application/json": { -< "schema": { -< "$ref": "#/components/schemas/application_fee" -< } -< } -< }, -< "description": "Successful response." -< }, -< "default": { -< "content": { -< "application/json": { -< "schema": { -< "$ref": "#/components/schemas/error" -< } -< } -< }, -< "description": "Error response." -< } -< } -< } -< }, -47727a55399 -> "description": "The secret scope type.", -47734a55407 -> "description": "The user ID. This field is required if `type` is set to `user`, and should not be provided if `type` is set to `account`.", -47876a55550 -> "description": "The secret scope type.", -47883a55558 -> "description": "The user ID. This field is required if `type` is set to `user`, and should not be provided if `type` is set to `account`.", -47966a55642 -> "description": "The secret scope type.", -47973a55650 -> "description": "The user ID. This field is required if `type` is set to `user`, and should not be provided if `type` is set to `account`.", -48058a55736 -> "description": "The secret scope type.", -48065a55744 -> "description": "The user ID. This field is required if `type` is set to `user`, and should not be provided if `type` is set to `account`.", -48174c55853 -< "/v1/balance/history": { ---- -> "/v1/balance_transactions": { -48177c55856 -< "operationId": "GetBalanceHistory", ---- -> "operationId": "GetBalanceTransactions", -48179a55859 -> "description": "This parameter is deprecated and we recommend listing by created and filtering in memory instead.", -48182c55862 -< "name": "created", ---- -> "name": "available_on", -48188a55869 -> "description": "Minimum value to filter by (exclusive)", -48191a55873 -> "description": "Minimum value to filter by (inclusive)", -48194a55877 -> "description": "Maximum value to filter by (exclusive)", -48197a55881 -> "description": "Maximum value to filter by (inclusive)", -48212,48448d55895 -< "description": "Only return transactions in a certain currency. Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. Must be a [supported currency](https://stripe.com/docs/currencies).", -< "in": "query", -< "name": "currency", -< "required": false, -< "schema": { -< "type": "string" -< }, -< "style": "form" -< }, -< { -< "description": "A cursor for use in pagination. `ending_before` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, starting with `obj_bar`, your subsequent call can include `ending_before=obj_bar` in order to fetch the previous page of the list.", -< "in": "query", -< "name": "ending_before", -< "required": false, -< "schema": { -< "maxLength": 5000, -< "type": "string" -< }, -< "style": "form" -< }, -< { -< "description": "Specifies which fields in the response should be expanded.", -< "explode": true, -< "in": "query", -< "name": "expand", -< "required": false, -< "schema": { -< "items": { -< "maxLength": 5000, -< "type": "string" -< }, -< "type": "array" -< }, -< "style": "deepObject" -< }, -< { -< "description": "A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 10.", -< "in": "query", -< "name": "limit", -< "required": false, -< "schema": { -< "type": "integer" -< }, -< "style": "form" -< }, -< { -< "description": "For automatic Stripe payouts only, only returns transactions that were paid out on the specified payout ID.", -< "in": "query", -< "name": "payout", -< "required": false, -< "schema": { -< "maxLength": 5000, -< "type": "string" -< }, -< "style": "form" -< }, -< { -< "description": "Only returns the original transaction.", -< "in": "query", -< "name": "source", -< "required": false, -< "schema": { -< "maxLength": 5000, -< "type": "string" -< }, -< "style": "form" -< }, -< { -< "description": "A cursor for use in pagination. `starting_after` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with `obj_foo`, your subsequent call can include `starting_after=obj_foo` in order to fetch the next page of the list.", -< "in": "query", -< "name": "starting_after", -< "required": false, -< "schema": { -< "maxLength": 5000, -< "type": "string" -< }, -< "style": "form" -< }, -< { -< "description": "Only returns transactions of the given type. One of: `adjustment`, `advance`, `advance_funding`, `anticipation_repayment`, `application_fee`, `application_fee_refund`, `charge`, `connect_collection_transfer`, `contribution`, `issuing_authorization_hold`, `issuing_authorization_release`, `issuing_dispute`, `issuing_transaction`, `payment`, `payment_failure_refund`, `payment_refund`, `payout`, `payout_cancel`, `payout_failure`, `refund`, `refund_failure`, `reserve_transaction`, `reserved_funds`, `stripe_fee`, `stripe_fx_fee`, `tax_fee`, `topup`, `topup_reversal`, `transfer`, `transfer_cancel`, `transfer_failure`, or `transfer_refund`.", -< "in": "query", -< "name": "type", -< "required": false, -< "schema": { -< "maxLength": 5000, -< "type": "string" -< }, -< "style": "form" -< } -< ], -< "requestBody": { -< "content": { -< "application/x-www-form-urlencoded": { -< "encoding": {}, -< "schema": { -< "additionalProperties": false, -< "properties": {}, -< "type": "object" -< } -< } -< }, -< "required": false -< }, -< "responses": { -< "200": { -< "content": { -< "application/json": { -< "schema": { -< "description": "", -< "properties": { -< "data": { -< "items": { -< "$ref": "#/components/schemas/balance_transaction" -< }, -< "type": "array" -< }, -< "has_more": { -< "description": "True if this list has another page of items after this one that can be fetched.", -< "type": "boolean" -< }, -< "object": { -< "description": "String representing the object's type. Objects of the same type share the same value. Always has the value `list`.", -< "enum": [ -< "list" -< ], -< "type": "string" -< }, -< "url": { -< "description": "The URL where this list can be accessed.", -< "maxLength": 5000, -< "pattern": "^/v1/balance_transactions", -< "type": "string" -< } -< }, -< "required": [ -< "data", -< "has_more", -< "object", -< "url" -< ], -< "title": "BalanceTransactionsList", -< "type": "object", -< "x-expandableFields": [ -< "data" -< ] -< } -< } -< }, -< "description": "Successful response." -< }, -< "default": { -< "content": { -< "application/json": { -< "schema": { -< "$ref": "#/components/schemas/error" -< } -< } -< }, -< "description": "Error response." -< } -< } -< } -< }, -< "/v1/balance/history/{id}": { -< "get": { -< "description": "

Retrieves the balance transaction with the given ID.

\n\n

Note that this endpoint previously used the path /v1/balance/history/:id.

", -< "operationId": "GetBalanceHistoryId", -< "parameters": [ -< { -< "description": "Specifies which fields in the response should be expanded.", -< "explode": true, -< "in": "query", -< "name": "expand", -< "required": false, -< "schema": { -< "items": { -< "maxLength": 5000, -< "type": "string" -< }, -< "type": "array" -< }, -< "style": "deepObject" -< }, -< { -< "in": "path", -< "name": "id", -< "required": true, -< "schema": { -< "maxLength": 5000, -< "type": "string" -< }, -< "style": "simple" -< } -< ], -< "requestBody": { -< "content": { -< "application/x-www-form-urlencoded": { -< "encoding": {}, -< "schema": { -< "additionalProperties": false, -< "properties": {}, -< "type": "object" -< } -< } -< }, -< "required": false -< }, -< "responses": { -< "200": { -< "content": { -< "application/json": { -< "schema": { -< "$ref": "#/components/schemas/balance_transaction" -< } -< } -< }, -< "description": "Successful response." -< }, -< "default": { -< "content": { -< "application/json": { -< "schema": { -< "$ref": "#/components/schemas/error" -< } -< } -< }, -< "description": "Error response." -< } -< } -< } -< }, -< "/v1/balance_transactions": { -< "get": { -< "description": "

Returns a list of transactions that have contributed to the Stripe account balance (e.g., charges, transfers, and so forth). The transactions are returned in sorted order, with the most recent transactions appearing first.

\n\n

Note that this endpoint was previously called “Balance history” and used the path /v1/balance/history.

", -< "operationId": "GetBalanceTransactions", -< "parameters": [ -< { -48457a55905 -> "description": "Minimum value to filter by (exclusive)", -48460a55909 -> "description": "Minimum value to filter by (inclusive)", -48463a55913 -> "description": "Maximum value to filter by (exclusive)", -48466a55917 -> "description": "Maximum value to filter by (inclusive)", -48895a56347 -> "description": "The messaging shown to customers in the portal.", -48899a56352 -> "description": "A link to the business’s publicly available privacy policy.", -48902a56356 -> "description": "A link to the business’s publicly available terms of service.", -48934a56389 -> "description": "Information about updating the customer details in the portal.", -48947c56402,56403 -< "type": "string" ---- -> "type": "string", -> "x-stripeBypassValidation": true -48957c56413,56414 -< ] ---- -> ], -> "description": "The types of customer updates that are supported. When empty, customers are not updateable." -48959a56417 -> "description": "Whether the feature is enabled.", -48969a56428 -> "description": "Information about showing the billing history in the portal.", -48971a56431 -> "description": "Whether the feature is enabled.", -48981a56442 -> "description": "Information about updating payment methods in the portal.", -48983a56445 -> "description": "Whether the feature is enabled.", -48993a56456 -> "description": "Information about canceling subscriptions in the portal.", -48995a56459 -> "description": "Whether the cancellation reasons will be collected in the portal and which options are exposed to the customer", -48997a56462 -> "description": "Whether the feature is enabled.", -49024c56489,56490 -< ] ---- -> ], -> "description": "Which cancellation reasons will be given as options to the customer." -49034a56501 -> "description": "Whether the feature is enabled.", -49037a56505 -> "description": "Whether to cancel subscriptions immediately or at the end of the billing period.", -49044a56513 -> "description": "Whether to create prorations when canceling subscriptions. Possible values are `none` and `create_prorations`, which is only compatible with `mode=immediately`. No prorations are generated when canceling a subscription at the end of its natural billing period.", -49059a56529 -> "description": "Information about pausing subscriptions in the portal.", -49061a56532 -> "description": "Whether the feature is enabled.", -49068a56540 -> "description": "Information about updating subscriptions in the portal.", -49089c56561,56562 -< ] ---- -> ], -> "description": "The types of subscription updates that are supported. When empty, subscriptions are not updateable." -49091a56565 -> "description": "Whether the feature is enabled.", -49099a56574 -> "description": "The list of price IDs for the product that a subscription can be updated to.", -49106a56582 -> "description": "The product id.", -49126c56602,56603 -< ] ---- -> ], -> "description": "The list of products that support subscription updates." -49128a56606 -> "description": "Determines how to handle prorations resulting from subscription updates. Valid values are `none`, `create_prorations`, and `always_invoice`.", -49152a56631 -> "description": "Set to `true` to generate a shareable URL [`login_page.url`](https://stripe.com/docs/api/customer_portal/configuration#portal_configuration_object-login_page-url) that will take your customers to a hosted login page for the customer portal.", -49325a56805 -> "description": "The messaging shown to customers in the portal.", -49340c56820,56821 -< ] ---- -> ], -> "description": "A link to the business’s publicly available privacy policy." -49353c56834,56835 -< ] ---- -> ], -> "description": "A link to the business’s publicly available terms of service." -49384a56867 -> "description": "Information about updating the customer details in the portal.", -49397c56880,56881 -< "type": "string" ---- -> "type": "string", -> "x-stripeBypassValidation": true -49407c56891,56892 -< ] ---- -> ], -> "description": "The types of customer updates that are supported. When empty, customers are not updateable." -49409a56895 -> "description": "Whether the feature is enabled.", -49416a56903 -> "description": "Information about showing the billing history in the portal.", -49418a56906 -> "description": "Whether the feature is enabled.", -49428a56917 -> "description": "Information about updating payment methods in the portal.", -49430a56920 -> "description": "Whether the feature is enabled.", -49440a56931 -> "description": "Information about canceling subscriptions in the portal.", -49442a56934 -> "description": "Whether the cancellation reasons will be collected in the portal and which options are exposed to the customer", -49444a56937 -> "description": "Whether the feature is enabled.", -49471c56964,56965 -< ] ---- -> ], -> "description": "Which cancellation reasons will be given as options to the customer." -49480a56975 -> "description": "Whether the feature is enabled.", -49483a56979 -> "description": "Whether to cancel subscriptions immediately or at the end of the billing period.", -49490a56987 -> "description": "Whether to create prorations when canceling subscriptions. Possible values are `none` and `create_prorations`, which is only compatible with `mode=immediately`. No prorations are generated when canceling a subscription at the end of its natural billing period.", -49502a57000 -> "description": "Information about pausing subscriptions in the portal.", -49504a57003 -> "description": "Whether the feature is enabled.", -49511a57011 -> "description": "Information about updating subscriptions in the portal.", -49532c57032,57033 -< ] ---- -> ], -> "description": "The types of subscription updates that are supported. When empty, subscriptions are not updateable." -49534a57036 -> "description": "Whether the feature is enabled.", -49542a57045 -> "description": "The list of price IDs for the product that a subscription can be updated to.", -49549a57053 -> "description": "The product id.", -49569c57073,57074 -< ] ---- -> ], -> "description": "The list of products that support subscription updates." -49571a57077 -> "description": "Determines how to handle prorations resulting from subscription updates. Valid values are `none`, `create_prorations`, and `always_invoice`.", -49590a57097 -> "description": "Set to `true` to generate a shareable URL [`login_page.url`](https://stripe.com/docs/api/customer_portal/configuration#portal_configuration_object-login_page-url) that will take your customers to a hosted login page for the customer portal.\n\nSet to `false` to deactivate the `login_page.url`.", -49791a57299 -> "description": "Minimum value to filter by (exclusive)", -49794a57303 -> "description": "Minimum value to filter by (inclusive)", -49797a57307 -> "description": "Maximum value to filter by (exclusive)", -49800a57311 -> "description": "Maximum value to filter by (inclusive)", -49972,49975d57482 -< "card": { -< "explode": true, -< "style": "deepObject" -< }, -50019,50094d57525 -< "card": { -< "anyOf": [ -< { -< "properties": { -< "address_city": { -< "maxLength": 5000, -< "type": "string" -< }, -< "address_country": { -< "maxLength": 5000, -< "type": "string" -< }, -< "address_line1": { -< "maxLength": 5000, -< "type": "string" -< }, -< "address_line2": { -< "maxLength": 5000, -< "type": "string" -< }, -< "address_state": { -< "maxLength": 5000, -< "type": "string" -< }, -< "address_zip": { -< "maxLength": 5000, -< "type": "string" -< }, -< "cvc": { -< "maxLength": 5000, -< "type": "string" -< }, -< "exp_month": { -< "type": "integer" -< }, -< "exp_year": { -< "type": "integer" -< }, -< "metadata": { -< "additionalProperties": { -< "type": "string" -< }, -< "type": "object" -< }, -< "name": { -< "maxLength": 5000, -< "type": "string" -< }, -< "number": { -< "maxLength": 5000, -< "type": "string" -< }, -< "object": { -< "enum": [ -< "card" -< ], -< "maxLength": 5000, -< "type": "string" -< } -< }, -< "required": [ -< "exp_month", -< "exp_year", -< "number" -< ], -< "title": "customer_payment_source_card", -< "type": "object" -< }, -< { -< "maxLength": 5000, -< "type": "string" -< } -< ], -< "description": "A token, like the ones returned by [Stripe.js](https://stripe.com/docs/js).", -< "x-stripeBypassValidation": true -< }, -50110,50127c57541,57544 -< "anyOf": [ -< { -< "properties": { -< "account": { -< "maxLength": 5000, -< "type": "string" -< }, -< "amount": { -< "type": "integer" -< } -< }, -< "required": [ -< "account" -< ], -< "title": "destination_specs", -< "type": "object" -< }, -< { ---- -> "properties": { -> "account": { -> "description": "ID of an existing, connected Stripe account.", -> "maxLength": 5000, -50128a57546,57549 -> }, -> "amount": { -> "description": "The amount to transfer to the destination account without creating an `Application Fee` object. Cannot be combined with the `application_fee` parameter. Must be less than or equal to the charge amount.", -> "type": "integer" -50130c57551,57556 -< ] ---- -> }, -> "required": [ -> "account" -> ], -> "title": "destination_specs", -> "type": "object" -50165a57592 -> "description": "A [Radar Session](https://stripe.com/docs/radar/radar-session) is a snapshot of the browser metadata and device details that help Radar make more accurate predictions on your payments.", -50180a57608 -> "description": "Shipping address.", -50182a57611 -> "description": "City, district, suburb, town, or village.", -50186a57616 -> "description": "Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)).", -50190a57621 -> "description": "Address line 1 (e.g., street, PO Box, or company name).", -50194a57626 -> "description": "Address line 2 (e.g., apartment, suite, unit, or building).", -50198a57631 -> "description": "ZIP or postal code.", -50202a57636 -> "description": "State, county, province, or region.", -50210a57645 -> "description": "The delivery service that shipped a physical product, such as Fedex, UPS, USPS, etc.", -50214a57650 -> "description": "Recipient name.", -50218a57655 -> "description": "Recipient phone (including extension).", -50222a57660 -> "description": "The tracking number for a physical product, obtained from the delivery service. If multiple tracking numbers were generated for this purchase, please separate them with commas.", -50253a57692 -> "description": "The amount transferred to the destination account, if specified. By default, the entire charge amount is transferred to the destination account.", -50256a57696 -> "description": "ID of an existing, connected Stripe account.", -50407a57848 -> "next_page", -50561a58003 -> "description": "Either `safe` or `fraudulent`.", -50602a58045 -> "description": "Shipping address.", -50604a58048 -> "description": "City, district, suburb, town, or village.", -50608a58053 -> "description": "Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)).", -50612a58058 -> "description": "Address line 1 (e.g., street, PO Box, or company name).", -50616a58063 -> "description": "Address line 2 (e.g., apartment, suite, unit, or building).", -50620a58068 -> "description": "ZIP or postal code.", -50624a58073 -> "description": "State, county, province, or region.", -50632a58082 -> "description": "The delivery service that shipped a physical product, such as Fedex, UPS, USPS, etc.", -50636a58087 -> "description": "Recipient name.", -50640a58092 -> "description": "Recipient phone (including extension).", -50644a58097 -> "description": "The tracking number for a physical product, obtained from the delivery service. If multiple tracking numbers were generated for this purchase, please separate them with commas.", -50760a58214 -> "description": "The amount transferred to the destination account, if specified. By default, the entire charge amount is transferred to the destination account.", -50802,51249d58255 -< "/v1/charges/{charge}/dispute": { -< "get": { -< "description": "

Retrieve a dispute for a specified charge.

", -< "operationId": "GetChargesChargeDispute", -< "parameters": [ -< { -< "in": "path", -< "name": "charge", -< "required": true, -< "schema": { -< "maxLength": 5000, -< "type": "string" -< }, -< "style": "simple" -< }, -< { -< "description": "Specifies which fields in the response should be expanded.", -< "explode": true, -< "in": "query", -< "name": "expand", -< "required": false, -< "schema": { -< "items": { -< "maxLength": 5000, -< "type": "string" -< }, -< "type": "array" -< }, -< "style": "deepObject" -< } -< ], -< "requestBody": { -< "content": { -< "application/x-www-form-urlencoded": { -< "encoding": {}, -< "schema": { -< "additionalProperties": false, -< "properties": {}, -< "type": "object" -< } -< } -< }, -< "required": false -< }, -< "responses": { -< "200": { -< "content": { -< "application/json": { -< "schema": { -< "$ref": "#/components/schemas/dispute" -< } -< } -< }, -< "description": "Successful response." -< }, -< "default": { -< "content": { -< "application/json": { -< "schema": { -< "$ref": "#/components/schemas/error" -< } -< } -< }, -< "description": "Error response." -< } -< } -< }, -< "post": { -< "description": "", -< "operationId": "PostChargesChargeDispute", -< "parameters": [ -< { -< "in": "path", -< "name": "charge", -< "required": true, -< "schema": { -< "maxLength": 5000, -< "type": "string" -< }, -< "style": "simple" -< } -< ], -< "requestBody": { -< "content": { -< "application/x-www-form-urlencoded": { -< "encoding": { -< "evidence": { -< "explode": true, -< "style": "deepObject" -< }, -< "expand": { -< "explode": true, -< "style": "deepObject" -< }, -< "metadata": { -< "explode": true, -< "style": "deepObject" -< } -< }, -< "schema": { -< "additionalProperties": false, -< "properties": { -< "evidence": { -< "description": "Evidence to upload, to respond to a dispute. Updating any field in the hash will submit all fields in the hash for review. The combined character count of all fields is limited to 150,000.", -< "properties": { -< "access_activity_log": { -< "maxLength": 20000, -< "type": "string" -< }, -< "billing_address": { -< "maxLength": 5000, -< "type": "string" -< }, -< "cancellation_policy": { -< "type": "string" -< }, -< "cancellation_policy_disclosure": { -< "maxLength": 20000, -< "type": "string" -< }, -< "cancellation_rebuttal": { -< "maxLength": 20000, -< "type": "string" -< }, -< "customer_communication": { -< "type": "string" -< }, -< "customer_email_address": { -< "maxLength": 5000, -< "type": "string" -< }, -< "customer_name": { -< "maxLength": 5000, -< "type": "string" -< }, -< "customer_purchase_ip": { -< "maxLength": 5000, -< "type": "string" -< }, -< "customer_signature": { -< "type": "string" -< }, -< "duplicate_charge_documentation": { -< "type": "string" -< }, -< "duplicate_charge_explanation": { -< "maxLength": 20000, -< "type": "string" -< }, -< "duplicate_charge_id": { -< "maxLength": 5000, -< "type": "string" -< }, -< "product_description": { -< "maxLength": 20000, -< "type": "string" -< }, -< "receipt": { -< "type": "string" -< }, -< "refund_policy": { -< "type": "string" -< }, -< "refund_policy_disclosure": { -< "maxLength": 20000, -< "type": "string" -< }, -< "refund_refusal_explanation": { -< "maxLength": 20000, -< "type": "string" -< }, -< "service_date": { -< "maxLength": 5000, -< "type": "string" -< }, -< "service_documentation": { -< "type": "string" -< }, -< "shipping_address": { -< "maxLength": 5000, -< "type": "string" -< }, -< "shipping_carrier": { -< "maxLength": 5000, -< "type": "string" -< }, -< "shipping_date": { -< "maxLength": 5000, -< "type": "string" -< }, -< "shipping_documentation": { -< "type": "string" -< }, -< "shipping_tracking_number": { -< "maxLength": 5000, -< "type": "string" -< }, -< "uncategorized_file": { -< "type": "string" -< }, -< "uncategorized_text": { -< "maxLength": 20000, -< "type": "string" -< } -< }, -< "title": "dispute_evidence_params", -< "type": "object" -< }, -< "expand": { -< "description": "Specifies which fields in the response should be expanded.", -< "items": { -< "maxLength": 5000, -< "type": "string" -< }, -< "type": "array" -< }, -< "metadata": { -< "anyOf": [ -< { -< "additionalProperties": { -< "type": "string" -< }, -< "type": "object" -< }, -< { -< "enum": [ -< "" -< ], -< "type": "string" -< } -< ], -< "description": "Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`." -< }, -< "submit": { -< "description": "Whether to immediately submit evidence to the bank. If `false`, evidence is staged on the dispute. Staged evidence is visible in the API and Dashboard, and can be submitted to the bank by making another request with this attribute set to `true` (the default).", -< "type": "boolean" -< } -< }, -< "type": "object" -< } -< } -< }, -< "required": false -< }, -< "responses": { -< "200": { -< "content": { -< "application/json": { -< "schema": { -< "$ref": "#/components/schemas/dispute" -< } -< } -< }, -< "description": "Successful response." -< }, -< "default": { -< "content": { -< "application/json": { -< "schema": { -< "$ref": "#/components/schemas/error" -< } -< } -< }, -< "description": "Error response." -< } -< } -< } -< }, -< "/v1/charges/{charge}/dispute/close": { -< "post": { -< "description": "", -< "operationId": "PostChargesChargeDisputeClose", -< "parameters": [ -< { -< "in": "path", -< "name": "charge", -< "required": true, -< "schema": { -< "maxLength": 5000, -< "type": "string" -< }, -< "style": "simple" -< } -< ], -< "requestBody": { -< "content": { -< "application/x-www-form-urlencoded": { -< "encoding": { -< "expand": { -< "explode": true, -< "style": "deepObject" -< } -< }, -< "schema": { -< "additionalProperties": false, -< "properties": { -< "expand": { -< "description": "Specifies which fields in the response should be expanded.", -< "items": { -< "maxLength": 5000, -< "type": "string" -< }, -< "type": "array" -< } -< }, -< "type": "object" -< } -< } -< }, -< "required": false -< }, -< "responses": { -< "200": { -< "content": { -< "application/json": { -< "schema": { -< "$ref": "#/components/schemas/dispute" -< } -< } -< }, -< "description": "Successful response." -< }, -< "default": { -< "content": { -< "application/json": { -< "schema": { -< "$ref": "#/components/schemas/error" -< } -< } -< }, -< "description": "Error response." -< } -< } -< } -< }, -< "/v1/charges/{charge}/refund": { -< "post": { -< "description": "

When you create a new refund, you must specify a Charge or a PaymentIntent object on which to create it.

\n\n

Creating a new refund will refund a charge that has previously been created but not yet refunded.\nFunds will be refunded to the credit or debit card that was originally charged.

\n\n

You can optionally refund only part of a charge.\nYou can do so multiple times, until the entire charge has been refunded.

\n\n

Once entirely refunded, a charge can’t be refunded again.\nThis method will raise an error when called on an already-refunded charge,\nor when trying to refund more money than is left on a charge.

", -< "operationId": "PostChargesChargeRefund", -< "parameters": [ -< { -< "in": "path", -< "name": "charge", -< "required": true, -< "schema": { -< "maxLength": 5000, -< "type": "string" -< }, -< "style": "simple" -< } -< ], -< "requestBody": { -< "content": { -< "application/x-www-form-urlencoded": { -< "encoding": { -< "expand": { -< "explode": true, -< "style": "deepObject" -< }, -< "metadata": { -< "explode": true, -< "style": "deepObject" -< } -< }, -< "schema": { -< "additionalProperties": false, -< "properties": { -< "amount": { -< "type": "integer" -< }, -< "expand": { -< "description": "Specifies which fields in the response should be expanded.", -< "items": { -< "maxLength": 5000, -< "type": "string" -< }, -< "type": "array" -< }, -< "instructions_email": { -< "type": "string" -< }, -< "metadata": { -< "anyOf": [ -< { -< "additionalProperties": { -< "type": "string" -< }, -< "type": "object" -< }, -< { -< "enum": [ -< "" -< ], -< "type": "string" -< } -< ], -< "description": "Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`." -< }, -< "payment_intent": { -< "maxLength": 5000, -< "type": "string" -< }, -< "reason": { -< "enum": [ -< "duplicate", -< "fraudulent", -< "requested_by_customer" -< ], -< "maxLength": 5000, -< "type": "string" -< }, -< "refund_application_fee": { -< "type": "boolean" -< }, -< "reverse_transfer": { -< "type": "boolean" -< } -< }, -< "type": "object" -< } -< } -< }, -< "required": false -< }, -< "responses": { -< "200": { -< "content": { -< "application/json": { -< "schema": { -< "$ref": "#/components/schemas/charge" -< } -< } -< }, -< "description": "Successful response." -< }, -< "default": { -< "content": { -< "application/json": { -< "schema": { -< "$ref": "#/components/schemas/error" -< } -< } -< }, -< "description": "Error response." -< } -< } -< } -< }, -51381,51509d58386 -< }, -< "post": { -< "description": "

Create a refund.

", -< "operationId": "PostChargesChargeRefunds", -< "parameters": [ -< { -< "in": "path", -< "name": "charge", -< "required": true, -< "schema": { -< "maxLength": 5000, -< "type": "string" -< }, -< "style": "simple" -< } -< ], -< "requestBody": { -< "content": { -< "application/x-www-form-urlencoded": { -< "encoding": { -< "expand": { -< "explode": true, -< "style": "deepObject" -< }, -< "metadata": { -< "explode": true, -< "style": "deepObject" -< } -< }, -< "schema": { -< "additionalProperties": false, -< "properties": { -< "amount": { -< "description": "A positive integer representing how much to refund.", -< "type": "integer" -< }, -< "currency": { -< "description": "Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. Must be a [supported currency](https://stripe.com/docs/currencies).", -< "type": "string" -< }, -< "customer": { -< "description": "Customer whose customer balance to refund from.", -< "maxLength": 5000, -< "type": "string" -< }, -< "expand": { -< "description": "Specifies which fields in the response should be expanded.", -< "items": { -< "maxLength": 5000, -< "type": "string" -< }, -< "type": "array" -< }, -< "instructions_email": { -< "description": "Address to send refund email, use customer email if not specified", -< "type": "string" -< }, -< "metadata": { -< "anyOf": [ -< { -< "additionalProperties": { -< "type": "string" -< }, -< "type": "object" -< }, -< { -< "enum": [ -< "" -< ], -< "type": "string" -< } -< ], -< "description": "Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`." -< }, -< "origin": { -< "description": "Origin of the refund", -< "enum": [ -< "customer_balance" -< ], -< "type": "string" -< }, -< "payment_intent": { -< "maxLength": 5000, -< "type": "string" -< }, -< "reason": { -< "enum": [ -< "duplicate", -< "fraudulent", -< "requested_by_customer" -< ], -< "maxLength": 5000, -< "type": "string" -< }, -< "refund_application_fee": { -< "type": "boolean" -< }, -< "reverse_transfer": { -< "type": "boolean" -< } -< }, -< "type": "object" -< } -< } -< }, -< "required": false -< }, -< "responses": { -< "200": { -< "content": { -< "application/json": { -< "schema": { -< "$ref": "#/components/schemas/refund" -< } -< } -< }, -< "description": "Successful response." -< }, -< "default": { -< "content": { -< "application/json": { -< "schema": { -< "$ref": "#/components/schemas/error" -< } -< } -< }, -< "description": "Error response." -< } -< } -51586,51678d58462 -< }, -< "post": { -< "description": "

Update a specified refund.

", -< "operationId": "PostChargesChargeRefundsRefund", -< "parameters": [ -< { -< "in": "path", -< "name": "charge", -< "required": true, -< "schema": { -< "type": "string" -< }, -< "style": "simple" -< }, -< { -< "in": "path", -< "name": "refund", -< "required": true, -< "schema": { -< "type": "string" -< }, -< "style": "simple" -< } -< ], -< "requestBody": { -< "content": { -< "application/x-www-form-urlencoded": { -< "encoding": { -< "expand": { -< "explode": true, -< "style": "deepObject" -< }, -< "metadata": { -< "explode": true, -< "style": "deepObject" -< } -< }, -< "schema": { -< "additionalProperties": false, -< "properties": { -< "expand": { -< "description": "Specifies which fields in the response should be expanded.", -< "items": { -< "maxLength": 5000, -< "type": "string" -< }, -< "type": "array" -< }, -< "metadata": { -< "anyOf": [ -< { -< "additionalProperties": { -< "type": "string" -< }, -< "type": "object" -< }, -< { -< "enum": [ -< "" -< ], -< "type": "string" -< } -< ] -< } -< }, -< "type": "object" -< } -< } -< }, -< "required": false -< }, -< "responses": { -< "200": { -< "content": { -< "application/json": { -< "schema": { -< "$ref": "#/components/schemas/refund" -< } -< } -< }, -< "description": "Successful response." -< }, -< "default": { -< "content": { -< "application/json": { -< "schema": { -< "$ref": "#/components/schemas/error" -< } -< } -< }, -< "description": "Error response." -< } -< } -51705a58490 -> "description": "Customer's email address.", -51924a58710,58713 -> "shipping_rates": { -> "explode": true, -> "style": "deepObject" -> }, -51940a58730 -> "description": "Configure a Checkout Session that can be used to recover an expired session.", -51942a58733 -> "description": "Enables user redeemable promotion codes on the recovered Checkout Sessions. Defaults to `false`", -51945a58737 -> "description": "If `true`, a recovery URL will be generated to recover this Checkout Session if it\nexpires before a successful transaction is completed. It will be attached to the\nCheckout Session object upon expiration.", -51966a58759 -> "description": "Set to true to enable automatic taxes.", -51997a58791 -> "description": "If set to `auto`, enables the collection of customer consent for promotional communications. The Checkout\nSession will determine whether to display an option to opt into promotional communication\nfrom the merchant depending on the customer's locale. Only available to US merchants.", -52004a58799 -> "description": "If set to `required`, it requires customers to check a terms of service checkbox before being able to pay.\nThere must be a valid terms of service URL set in your [Dashboard settings](https://dashboard.stripe.com/settings/public).", -52039a58835 -> "description": "Describes whether Checkout saves the billing address onto `customer.address`.\nTo always collect a full billing address, use `billing_address_collection`. Defaults to `never`.", -52047a58844 -> "description": "Describes whether Checkout saves the name onto `customer.name`. Defaults to `never`.", -52055a58853 -> "description": "Describes whether Checkout saves shipping information onto `customer.shipping`.\nTo collect shipping information, use `shipping_address_collection`. Defaults to `never`.", -52071a58870 -> "description": "The ID of the coupon to apply to this Session.", -52075a58875 -> "description": "The ID of a promotion code to apply to this Session.", -52102a58903 -> "description": "When set, provides configuration for this item’s quantity to be adjusted by the customer during Checkout.", -52104a58906 -> "description": "Set to true if the quantity can be adjusted to any non-negative integer. By default customers will be able to remove the line item by setting the quantity to 0.", -52107a58910 -> "description": "The maximum quantity the customer can purchase for the Checkout Session. By default this value is 99. You can specify a value up to 999999.", -52110a58914 -> "description": "The minimum quantity the customer must purchase for the Checkout Session. By default this value is 0.", -52119a58924,58936 -> "amount": { -> "description": "[Deprecated] The amount to be collected per unit of the line item. If specified, must also pass `currency` and `name`.", -> "type": "integer" -> }, -> "currency": { -> "description": "[Deprecated] Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. Must be a [supported currency](https://stripe.com/docs/currencies). Required if `amount` is passed.", -> "type": "string" -> }, -> "description": { -> "description": "[Deprecated] The description for the line item, to be displayed on the Checkout page.", -> "maxLength": 5000, -> "type": "string" -> }, -52120a58938 -> "description": "The [tax rates](https://stripe.com/docs/api/tax_rates) that will be applied to this line item depending on the customer's billing/shipping address. We currently support the following countries: US, GB, AU, and all countries in the EU.", -52126a58945,58957 -> "images": { -> "description": "[Deprecated] A list of image URLs representing this line item. Each image can be up to 5 MB in size. If passing `price` or `price_data`, specify images on the associated product instead.", -> "items": { -> "maxLength": 5000, -> "type": "string" -> }, -> "type": "array" -> }, -> "name": { -> "description": "[Deprecated] The name for the item to be displayed on the Checkout page. Required if `amount` is passed.", -> "maxLength": 5000, -> "type": "string" -> }, -52127a58959 -> "description": "The ID of the [Price](https://stripe.com/docs/api/prices) or [Plan](https://stripe.com/docs/api/plans) object. One of `price` or `price_data` is required.", -52131a58964 -> "description": "Data used to generate a new [Price](https://stripe.com/docs/api/prices) object inline. One of `price` or `price_data` is required.", -52133a58967 -> "description": "Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. Must be a [supported currency](https://stripe.com/docs/currencies).", -52136a58971 -> "description": "The ID of the product that this price will belong to. One of `product` or `product_data` is required.", -52140a58976 -> "description": "Data used to generate a new product object inline. One of `product` or `product_data` is required.", -52142a58979 -> "description": "The product's description, meant to be displayable to the customer. Use this field to optionally store a long form explanation of the product being sold for your own rendering purposes.", -52146a58984 -> "description": "A list of up to 8 URLs of images for this product, meant to be displayable to the customer.", -52155a58994 -> "description": "Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`.", -52158a58998 -> "description": "The product's name, meant to be displayable to the customer.", -52162a59003 -> "description": "A [tax code](https://stripe.com/docs/tax/tax-categories) ID.", -52173a59015 -> "description": "The recurring components of a price such as `interval` and `interval_count`.", -52175a59018 -> "description": "Specifies billing frequency. Either `day`, `week`, `month` or `year`.", -52184a59028 -> "description": "The number of intervals between subscription billings. For example, `interval=month` and `interval_count=3` bills every 3 months. Maximum of one year interval allowed (1 year, 12 months, or 52 weeks).", -52194a59039 -> "description": "Specifies whether the price is considered inclusive of taxes or exclusive of taxes. One of `inclusive`, `exclusive`, or `unspecified`. Once specified as either `inclusive` or `exclusive`, it cannot be changed.", -52202a59048 -> "description": "A non-negative integer in cents (or local equivalent) representing how much to charge. One of `unit_amount` or `unit_amount_decimal` is required.", -52205a59052 -> "description": "Same as `unit_amount`, but accepts a decimal value in cents (or local equivalent) with at most 12 decimal places. Only one of `unit_amount` and `unit_amount_decimal` can be set.", -52216a59064 -> "description": "The quantity of the line item being purchased. Quantity should not be defined when `recurring.usage_type=metered`.", -52219a59068 -> "description": "The [tax rates](https://stripe.com/docs/api/tax_rates) which apply to this line item.", -52299a59149 -> "description": "The amount of the application fee (if any) that will be requested to be applied to the payment and transferred to the application owner's Stripe account. The amount of the application fee collected will be capped at the total payment amount. For more information, see the PaymentIntents [use case for connected accounts](https://stripe.com/docs/payments/connected-accounts).", -52302a59153 -> "description": "Controls when the funds will be captured from the customer's account.", -52309a59161 -> "description": "An arbitrary string attached to the object. Often useful for displaying to users.", -52316a59169 -> "description": "Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`.", -52319a59173 -> "description": "The Stripe account ID for which these funds are intended. For details,\nsee the PaymentIntents [use case for connected\naccounts](/docs/payments/connected-accounts).", -52322a59177 -> "description": "Email address that the receipt for the resulting payment will be sent to. If `receipt_email` is specified for a payment in live mode, a receipt will be sent regardless of your [email settings](https://dashboard.stripe.com/account/emails).", -52325a59181 -> "description": "Indicates that you intend to [make future payments](https://stripe.com/docs/payments/payment-intents#future-usage) with the payment\nmethod collected by this Checkout Session.\n\nWhen setting this to `on_session`, Checkout will show a notice to the\ncustomer that their payment details will be saved.\n\nWhen setting this to `off_session`, Checkout will show a notice to the\ncustomer that their payment details will be saved and used for future\npayments.\n\nIf a Customer has been provided or Checkout creates a new Customer,\nCheckout will attach the payment method to the Customer.\n\nIf Checkout does not create a Customer, the payment method is not attached\nto a Customer. To reuse the payment method, you can retrieve it from the\nCheckout Session's PaymentIntent.\n\nWhen processing card payments, Checkout also uses `setup_future_usage`\nto dynamically optimize your payment flow and comply with regional\nlegislation and network rules, such as SCA.", -52332a59189 -> "description": "Shipping information for this payment.", -52334a59192 -> "description": "Shipping address.", -52336a59195 -> "description": "City, district, suburb, town, or village.", -52340a59200 -> "description": "Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)).", -52344a59205 -> "description": "Address line 1 (e.g., street, PO Box, or company name).", -52348a59210 -> "description": "Address line 2 (e.g., apartment, suite, unit, or building).", -52352a59215 -> "description": "ZIP or postal code.", -52356a59220 -> "description": "State, county, province, or region.", -52367a59232 -> "description": "The delivery service that shipped a physical product, such as Fedex, UPS, USPS, etc.", -52371a59237 -> "description": "Recipient name.", -52375a59242 -> "description": "Recipient phone (including extension).", -52379a59247 -> "description": "The tracking number for a physical product, obtained from the delivery service. If multiple tracking numbers were generated for this purchase, please separate them with commas.", -52391a59260 -> "description": "Extra information about the payment. This will appear on your\ncustomer's statement when this payment succeeds in creating a charge.", -52395a59265 -> "description": "Provides information about the charge that customers see on their statements. Concatenated with the\nprefix (shortened descriptor) or statement descriptor that’s set on the account to form the complete\nstatement descriptor. Maximum 22 characters for the concatenated descriptor.", -52399a59270 -> "description": "The parameters used to automatically create a Transfer when the payment succeeds.\nFor more information, see the PaymentIntents [use case for connected accounts](https://stripe.com/docs/payments/connected-accounts).", -52401a59273 -> "description": "The amount that will be transferred automatically when a charge succeeds.", -52404a59277 -> "description": "If specified, successful charges will be attributed to the destination\naccount for tax reporting, and the funds from charges will be transferred\nto the destination account. The ID of the resulting transfer will be\nreturned on the successful charge's `transfer` field.", -52414a59288 -> "description": "A string that identifies the resulting payment as part of a group. See the PaymentIntents [use case for connected accounts](https://stripe.com/docs/payments/connected-accounts) for details.", -52432a59307 -> "description": "contains details about the ACSS Debit payment method options.", -52434a59310 -> "description": "Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. Must be a [supported currency](https://stripe.com/docs/currencies). This is only accepted for Checkout Sessions in `setup` mode.", -52441a59318 -> "description": "Additional fields for Mandate creation", -52454c59331,59332 -< ] ---- -> ], -> "description": "A URL for custom mandate text to render during confirmation step.\nThe URL will be rendered with additional GET parameters `payment_intent` and `payment_intent_client_secret` when confirming a Payment Intent,\nor `setup_intent` and `setup_intent_client_secret` when confirming a Setup Intent." -52456a59335 -> "description": "List of Stripe products where this mandate can be selected automatically. Only usable in `setup` mode.", -52466a59346 -> "description": "Description of the mandate interval. Only required if 'payment_schedule' parameter is 'interval' or 'combined'.", -52470a59351 -> "description": "Payment schedule for the mandate.", -52478a59360 -> "description": "Transaction type of the mandate.", -52489a59372 -> "description": "Indicates that you intend to make future payments with this PaymentIntent's payment method.\n\nProviding this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes.\n\nWhen processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication).", -52497a59381 -> "description": "Verification method for the intent", -52510a59395 -> "description": "contains details about the Affirm payment method options.", -52512a59398 -> "description": "Indicates that you intend to make future payments with this PaymentIntent's payment method.\n\nProviding this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes.\n\nWhen processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication).", -52522a59409 -> "description": "contains details about the Afterpay Clearpay payment method options.", -52524a59412 -> "description": "Indicates that you intend to make future payments with this PaymentIntent's payment method.\n\nProviding this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes.\n\nWhen processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication).", -52534a59423 -> "description": "contains details about the Alipay payment method options.", -52536a59426 -> "description": "Indicates that you intend to make future payments with this PaymentIntent's payment method.\n\nProviding this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes.\n\nWhen processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication).", -52546a59437 -> "description": "contains details about the AU Becs Debit payment method options.", -52548a59440 -> "description": "Indicates that you intend to make future payments with this PaymentIntent's payment method.\n\nProviding this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes.\n\nWhen processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication).", -52558a59451 -> "description": "contains details about the Bacs Debit payment method options.", -52560a59454 -> "description": "Indicates that you intend to make future payments with this PaymentIntent's payment method.\n\nProviding this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes.\n\nWhen processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication).", -52572a59467 -> "description": "contains details about the Bancontact payment method options.", -52574a59470 -> "description": "Indicates that you intend to make future payments with this PaymentIntent's payment method.\n\nProviding this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes.\n\nWhen processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication).", -52584a59481 -> "description": "contains details about the Boleto payment method options.", -52586a59484 -> "description": "The number of calendar days before a Boleto voucher expires. For example, if you create a Boleto voucher on Monday and you set expires_after_days to 2, the Boleto invoice will expire on Wednesday at 23:59 America/Sao_Paulo time.", -52589a59488 -> "description": "Indicates that you intend to make future payments with this PaymentIntent's payment method.\n\nProviding this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes.\n\nWhen processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication).", -52601a59501 -> "description": "contains details about the Card payment method options.", -52603a59504 -> "description": "Installment options for card payments", -52605a59507 -> "description": "Setting to true enables installments for this Checkout Session.\nSetting to false will prevent any installment plan from applying to a payment.", -52612a59515 -> "description": "Indicates that you intend to make future payments with this PaymentIntent's payment method.\n\nProviding this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes.\n\nWhen processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication).", -52619a59523 -> "description": "Provides information about a card payment that customers see on their statements. Concatenated with the Kana prefix (shortened Kana descriptor) or Kana statement descriptor that’s set on the account to form the complete statement descriptor. Maximum 22 characters. On card statements, the *concatenation* of both prefix and suffix (including separators) will appear truncated to 22 characters.", -52623a59528 -> "description": "Provides information about a card payment that customers see on their statements. Concatenated with the Kanji prefix (shortened Kanji descriptor) or Kanji statement descriptor that’s set on the account to form the complete statement descriptor. Maximum 17 characters. On card statements, the *concatenation* of both prefix and suffix (including separators) will appear truncated to 17 characters.", -52631a59537 -> "description": "contains details about the Customer Balance payment method options.", -52633a59540 -> "description": "Configuration for the bank transfer funding type, if the `funding_type` is set to `bank_transfer`.", -52635a59543 -> "description": "Configuration for eu_bank_transfer funding type.", -52637a59546 -> "description": "The desired country code of the bank account information. Permitted values include: `DE`, `ES`, `FR`, `IE`, or `NL`.", -52648a59558 -> "description": "List of address types that should be returned in the financial_addresses response. If not specified, all valid types will be returned.\n\nPermitted values include: `sort_code`, `zengin`, `iban`, or `spei`.", -52662a59573 -> "description": "The list of bank transfer types that this PaymentIntent is allowed to use for funding. Permitted values include: `us_bank_account`, `eu_bank_account`, `id_bank_account`, `gb_bank_account`, `jp_bank_account`, `mx_bank_account`, `eu_bank_transfer`, `gb_bank_transfer`, `id_bank_transfer`, `jp_bank_transfer`, `mx_bank_transfer`, or `us_bank_transfer`.", -52679a59591 -> "description": "The funding method type to be used when there are not enough funds in the customer balance. Permitted values include: `bank_transfer`.", -52685a59598 -> "description": "Indicates that you intend to make future payments with this PaymentIntent's payment method.\n\nProviding this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes.\n\nWhen processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication).", -52695a59609 -> "description": "contains details about the EPS payment method options.", -52697a59612 -> "description": "Indicates that you intend to make future payments with this PaymentIntent's payment method.\n\nProviding this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes.\n\nWhen processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication).", -52707a59623 -> "description": "contains details about the FPX payment method options.", -52709a59626 -> "description": "Indicates that you intend to make future payments with this PaymentIntent's payment method.\n\nProviding this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes.\n\nWhen processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication).", -52719a59637 -> "description": "contains details about the Giropay payment method options.", -52721a59640 -> "description": "Indicates that you intend to make future payments with this PaymentIntent's payment method.\n\nProviding this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes.\n\nWhen processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication).", -52731a59651 -> "description": "contains details about the Grabpay payment method options.", -52733a59654 -> "description": "Indicates that you intend to make future payments with this PaymentIntent's payment method.\n\nProviding this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes.\n\nWhen processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication).", -52743a59665 -> "description": "contains details about the Ideal payment method options.", -52745a59668 -> "description": "Indicates that you intend to make future payments with this PaymentIntent's payment method.\n\nProviding this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes.\n\nWhen processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication).", -52755a59679 -> "description": "contains details about the Klarna payment method options.", -52757a59682 -> "description": "Indicates that you intend to make future payments with this PaymentIntent's payment method.\n\nProviding this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes.\n\nWhen processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication).", -52767a59693 -> "description": "contains details about the Konbini payment method options.", -52769a59696 -> "description": "The number of calendar days (between 1 and 60) after which Konbini payment instructions will expire. For example, if a PaymentIntent is confirmed with Konbini and `expires_after_days` set to 2 on Monday JST, the instructions will expire on Wednesday 23:59:59 JST. Defaults to 3 days.", -52772a59700 -> "description": "Indicates that you intend to make future payments with this PaymentIntent's payment method.\n\nProviding this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes.\n\nWhen processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication).", -52782a59711 -> "description": "contains details about the OXXO payment method options.", -52784a59714 -> "description": "The number of calendar days before an OXXO voucher expires. For example, if you create an OXXO voucher on Monday and you set expires_after_days to 2, the OXXO invoice will expire on Wednesday at 23:59 America/Mexico_City time.", -52787a59718 -> "description": "Indicates that you intend to make future payments with this PaymentIntent's payment method.\n\nProviding this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes.\n\nWhen processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication).", -52797a59729 -> "description": "contains details about the P24 payment method options.", -52799a59732 -> "description": "Indicates that you intend to make future payments with this PaymentIntent's payment method.\n\nProviding this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes.\n\nWhen processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication).", -52805a59739 -> "description": "Confirm that the payer has accepted the P24 terms and conditions.", -52812a59747 -> "description": "contains details about the PayNow payment method options.", -52814a59750 -> "description": "Indicates that you intend to make future payments with this PaymentIntent's payment method.\n\nProviding this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes.\n\nWhen processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication).", -52819,52821d59754 -< }, -< "tos_shown_and_accepted": { -< "type": "boolean" -52827a59761 -> "description": "contains details about the Pix payment method options.", -52829a59764 -> "description": "The number of seconds (between 10 and 1209600) after which Pix payment will expire. Defaults to 86400 seconds.", -52836a59772 -> "description": "contains details about the Sepa Debit payment method options.", -52838a59775 -> "description": "Indicates that you intend to make future payments with this PaymentIntent's payment method.\n\nProviding this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes.\n\nWhen processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication).", -52850a59788 -> "description": "contains details about the Sofort payment method options.", -52852a59791 -> "description": "Indicates that you intend to make future payments with this PaymentIntent's payment method.\n\nProviding this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes.\n\nWhen processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication).", -52862a59802 -> "description": "contains details about the Us Bank Account payment method options.", -52864a59805 -> "description": "Additional fields for Financial Connections Session creation", -52866a59808 -> "description": "The list of permissions to request. If this parameter is passed, the `payment_method` permission must be included. Valid permissions include: `balances`, `ownership`, `payment_method`, and `transactions`.", -52884a59827 -> "description": "Indicates that you intend to make future payments with this PaymentIntent's payment method.\n\nProviding this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes.\n\nWhen processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication).", -52892a59836 -> "description": "Verification method for the intent", -52904a59849 -> "description": "contains details about the WeChat Pay payment method options.", -52906a59852 -> "description": "The app ID registered with WeChat Pay. Only required when client is ios or android.", -52910a59857 -> "description": "The client type that the end customer will pay from", -52919a59867 -> "description": "Indicates that you intend to make future payments with this PaymentIntent's payment method.\n\nProviding this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes.\n\nWhen processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication).", -52976a59925 -> "description": "Set to `true` to enable phone number collection.", -52989a59939 -> "description": "An arbitrary string attached to the object. Often useful for displaying to users.", -52996a59947 -> "description": "Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`.", -52999a59951 -> "description": "The Stripe account for which the setup is intended.", -53009a59962 -> "description": "An array of two-letter ISO country codes representing which countries Checkout should provide as options for\nshipping locations. Unsupported country codes: `AS, CX, CC, CU, HM, IR, KP, MH, FM, NF, MP, PW, SD, SY, UM, VI`.", -53265a60219 -> "description": "The ID of the Shipping Rate to use for this shipping option.", -53269a60224 -> "description": "Parameters to be passed to Shipping Rate creation for this shipping option", -53271a60227 -> "description": "The estimated range for how long shipping will take, meant to be displayable to the customer. This will appear on CheckoutSessions.", -53273a60230 -> "description": "The upper bound of the estimated range. If empty, represents no upper bound i.e., infinite.", -53275a60233 -> "description": "A unit of time.", -53285a60244 -> "description": "Must be greater than 0.", -53296a60256 -> "description": "The lower bound of the estimated range. If empty, represents no lower bound.", -53298a60259 -> "description": "A unit of time.", -53308a60270 -> "description": "Must be greater than 0.", -53323a60286 -> "description": "The name of the shipping rate, meant to be displayable to the customer. This will appear on CheckoutSessions.", -53327a60291 -> "description": "Describes a fixed amount to charge for shipping. Must be present if type is `fixed_amount`.", -53329a60294 -> "description": "A non-negative integer in cents representing how much to charge.", -53332a60298 -> "description": "Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. Must be a [supported currency](https://stripe.com/docs/currencies).", -53338a60305 -> "description": "A non-negative integer in cents representing how much to charge.", -53341a60309 -> "description": "Specifies whether the rate is considered inclusive of taxes or exclusive of taxes. One of `inclusive`, `exclusive`, or `unspecified`.", -53355a60324 -> "description": "Shipping rates defined in each available currency option. Each key must be a three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html) and a [supported currency](https://stripe.com/docs/currencies).", -53369a60339 -> "description": "Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`.", -53372a60343 -> "description": "Specifies whether the rate is considered inclusive of taxes or exclusive of taxes. One of `inclusive`, `exclusive`, or `unspecified`.", -53380a60352 -> "description": "A [tax code](https://stripe.com/docs/tax/tax-categories) ID. The Shipping tax code is `txcd_92010001`.", -53383a60356 -> "description": "The type of calculation to use on the shipping rate. Can only be `fixed_amount` for now.", -53401a60375,60381 -> "shipping_rates": { -> "description": "[Deprecated] The shipping rate to apply to this Session. Only up to one may be specified.", -> "items": { -> "type": "string" -> }, -> "type": "array" -> }, -53415a60396 -> "description": "A non-negative decimal between 0 and 100, with at most two decimal places. This represents the percentage of the subscription invoice subtotal that will be transferred to the application owner's Stripe account. To use an application fee percent, the request must be made on behalf of another account, using the `Stripe-Account` header or an OAuth key. For more information, see the application fees [documentation](https://stripe.com/docs/connect/subscriptions#collecting-fees-on-subscriptions).", -53417a60399,60403 -> "coupon": { -> "description": "The ID of the coupon to apply to this subscription. A coupon applied to a subscription will only affect invoices created for that particular subscription.", -> "maxLength": 5000, -> "type": "string" -> }, -53418a60405 -> "description": "The tax rates that will apply to any subscription item that does not have\n`tax_rates` set. Invoices created will have their `default_tax_rates` populated\nfrom the subscription.", -53425a60413 -> "description": "The subscription's description, meant to be displayable to the customer.\nUse this field to optionally store an explanation of the subscription\nfor rendering in Stripe hosted surfaces.", -53428a60417,60446 -> "items": { -> "description": "This parameter is deprecated. Use the line_items parameter on the Session instead.", -> "items": { -> "properties": { -> "plan": { -> "description": "Plan ID for this item.", -> "maxLength": 5000, -> "type": "string" -> }, -> "quantity": { -> "description": "The quantity of the subscription item being purchased. Quantity should not be defined when `recurring.usage_type=metered`.", -> "type": "integer" -> }, -> "tax_rates": { -> "description": "The tax rates which apply to this item. When set, the `default_tax_rates`\non `subscription_data` do not apply to this item.", -> "items": { -> "maxLength": 5000, -> "type": "string" -> }, -> "type": "array" -> } -> }, -> "required": [ -> "plan" -> ], -> "title": "subscription_data_item_param", -> "type": "object" -> }, -> "type": "array" -> }, -53432a60451 -> "description": "Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`.", -53435a60455 -> "description": "The account on behalf of which to charge, for each of the subscription's invoices.", -53438a60459 -> "description": "If specified, the funds from the subscription's invoices will be transferred to the destination and the ID of the resulting transfers will be found on the resulting charges.", -53440a60462 -> "description": "A non-negative decimal between 0 and 100, with at most two decimal places. This represents the percentage of the subscription invoice subtotal that will be transferred to the destination account. By default, the entire amount is transferred to the destination.", -53443a60466 -> "description": "ID of an existing, connected Stripe account.", -53453a60477 -> "description": "Unix timestamp representing the end of the trial period the customer\nwill get before being charged for the first time. Has to be at least\n48 hours in the future.", -53456a60481,60484 -> "trial_from_plan": { -> "description": "Indicates if a plan’s `trial_period_days` should be applied to the subscription. Setting `trial_end` on `subscription_data` is preferred. Defaults to `false`.", -> "type": "boolean" -> }, -53457a60486 -> "description": "Integer representing the number of trial period days before the\ncustomer is charged for the first time. Has to be at least 1.", -53472a60502 -> "description": "Set to true to enable Tax ID collection.", -53997a61028 -> "description": "Minimum value to filter by (exclusive)", -54000a61032 -> "description": "Minimum value to filter by (inclusive)", -54003a61036 -> "description": "Maximum value to filter by (exclusive)", -54006a61040 -> "description": "Maximum value to filter by (inclusive)", -54174a61209 -> "description": "An array of Product IDs that this Coupon will apply to.", -54192a61228 -> "description": "A positive integer representing the amount to subtract from an invoice total.", -54454a61491 -> "description": "A positive integer representing the amount to subtract from an invoice total.", -54722a61760 -> "description": "The line item amount to credit. Only valid when `type` is `invoice_line_item`.", -54725a61764 -> "description": "The description of the credit note line item. Only valid when the `type` is `custom_line_item`.", -54729a61769 -> "description": "The invoice line item to credit. Only valid when the `type` is `invoice_line_item`.", -54733a61774 -> "description": "The line item quantity to credit.", -54751c61792,61793 -< ] ---- -> ], -> "description": "The tax rates which apply to the credit note line item. Only valid when the `type` is `custom_line_item`." -54753a61796 -> "description": "Type of the credit note line item, one of `invoice_line_item` or `custom_line_item`", -54760a61804 -> "description": "The integer unit amount in cents (or local equivalent) of the credit note line item. This `unit_amount` will be multiplied by the quantity to get the full amount to credit for this line item. Only valid when `type` is `custom_line_item`.", -54763a61808 -> "description": "Same as `unit_amount`, but accepts a decimal value in cents (or local equivalent) with at most 12 decimal places. Only one of `unit_amount` and `unit_amount_decimal` can be set.", -54904a61950 -> "description": "The line item amount to credit. Only valid when `type` is `invoice_line_item`.", -54907a61954 -> "description": "The description of the credit note line item. Only valid when the `type` is `custom_line_item`.", -54911a61959 -> "description": "The invoice line item to credit. Only valid when the `type` is `invoice_line_item`.", -54915a61964 -> "description": "The line item quantity to credit.", -54933c61982,61983 -< ] ---- -> ], -> "description": "The tax rates which apply to the credit note line item. Only valid when the `type` is `custom_line_item`." -54935a61986 -> "description": "Type of the credit note line item, one of `invoice_line_item` or `custom_line_item`", -54942a61994 -> "description": "The integer unit amount in cents (or local equivalent) of the credit note line item. This `unit_amount` will be multiplied by the quantity to get the full amount to credit for this line item. Only valid when `type` is `custom_line_item`.", -54945a61998 -> "description": "Same as `unit_amount`, but accepts a decimal value in cents (or local equivalent) with at most 12 decimal places. Only one of `unit_amount` and `unit_amount_decimal` can be set.", -55150a62204 -> "description": "The line item amount to credit. Only valid when `type` is `invoice_line_item`.", -55153a62208 -> "description": "The description of the credit note line item. Only valid when the `type` is `custom_line_item`.", -55157a62213 -> "description": "The invoice line item to credit. Only valid when the `type` is `invoice_line_item`.", -55161a62218 -> "description": "The line item quantity to credit.", -55179c62236,62237 -< ] ---- -> ], -> "description": "The tax rates which apply to the credit note line item. Only valid when the `type` is `custom_line_item`." -55181a62240 -> "description": "Type of the credit note line item, one of `invoice_line_item` or `custom_line_item`", -55188a62248 -> "description": "The integer unit amount in cents (or local equivalent) of the credit note line item. This `unit_amount` will be multiplied by the quantity to get the full amount to credit for this line item. Only valid when `type` is `custom_line_item`.", -55191a62252 -> "description": "Same as `unit_amount`, but accepts a decimal value in cents (or local equivalent) with at most 12 decimal places. Only one of `unit_amount` and `unit_amount_decimal` can be set.", -55728a62790 -> "description": "Minimum value to filter by (exclusive)", -55731a62794 -> "description": "Minimum value to filter by (inclusive)", -55734a62798 -> "description": "Maximum value to filter by (exclusive)", -55737a62802 -> "description": "Maximum value to filter by (inclusive)", -55944a63010 -> "description": "City, district, suburb, town, or village.", -55948a63015 -> "description": "Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)).", -55952a63020 -> "description": "Address line 1 (e.g., street, PO Box, or company name).", -55956a63025 -> "description": "Address line 2 (e.g., apartment, suite, unit, or building).", -55960a63030 -> "description": "ZIP or postal code.", -55964a63035 -> "description": "State, county, province, or region.", -55988a63060 -> "description": "Settings controlling the behavior of the customer's cash balance,\nsuch as reconciliation of funds received.", -55990a63063 -> "description": "Controls how funds transferred by the customer are applied to payment intents and invoices. Valid options are `automatic` or `manual`. For more information about these reconciliation modes, see [Reconciliation](https://stripe.com/docs/payments/customer-balance/reconciliation).", -56040a63114 -> "description": "The name of the custom field. This may be up to 30 characters.", -56044a63119 -> "description": "The value of the custom field. This may be up to 30 characters.", -56064c63139,63140 -< ] ---- -> ], -> "description": "Default custom fields to be displayed on invoices for this customer. When updating, pass an empty string to remove previously-defined fields." -56066a63143 -> "description": "ID of a payment method that's attached to the customer, to be used as the customer's default payment method for subscriptions and invoices.", -56070a63148 -> "description": "Default footer to be displayed on invoices for this customer.", -56078a63157 -> "description": "How line-item prices and amounts will be displayed with respect to tax on invoice PDFs. One of `exclude_tax` or `include_inclusive_tax`. `include_inclusive_tax` will include inclusive tax (and exclude exclusive tax) in invoice PDF amounts. `exclude_tax` will exclude all tax (inclusive and exclusive alike) from invoice PDF amounts.", -56096c63175,63176 -< ] ---- -> ], -> "description": "Default options for invoice PDF rendering for this customer." -56154a63235 -> "description": "Customer shipping address.", -56156a63238 -> "description": "City, district, suburb, town, or village.", -56160a63243 -> "description": "Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)).", -56164a63248 -> "description": "Address line 1 (e.g., street, PO Box, or company name).", -56168a63253 -> "description": "Address line 2 (e.g., apartment, suite, unit, or building).", -56172a63258 -> "description": "ZIP or postal code.", -56176a63263 -> "description": "State, county, province, or region.", -56184a63272 -> "description": "Customer name.", -56188a63277 -> "description": "Customer phone (including extension).", -56228c63317,63318 -< ] ---- -> ], -> "description": "A recent IP address of the customer used for tax reporting and tax location inference. Stripe recommends updating the IP address when a new PaymentMethod is attached or the address field on the customer is updated. We recommend against updating this field more frequently since it could result in unexpected tax location/reporting outcomes." -56248a63339 -> "description": "Type of the tax ID, one of `ae_trn`, `au_abn`, `au_arn`, `bg_uic`, `br_cnpj`, `br_cpf`, `ca_bn`, `ca_gst_hst`, `ca_pst_bc`, `ca_pst_mb`, `ca_pst_sk`, `ca_qst`, `ch_vat`, `cl_tin`, `eg_tin`, `es_cif`, `eu_oss_vat`, `eu_vat`, `gb_vat`, `ge_vat`, `hk_br`, `hu_tin`, `id_npwp`, `il_vat`, `in_gst`, `is_vat`, `jp_cn`, `jp_rn`, `jp_trn`, `ke_pin`, `kr_brn`, `li_uid`, `mx_rfc`, `my_frp`, `my_itn`, `my_sst`, `no_vat`, `nz_gst`, `ph_tin`, `ru_inn`, `ru_kpp`, `sa_vat`, `sg_gst`, `sg_uen`, `si_tin`, `th_vat`, `tr_tin`, `tw_vat`, `ua_vat`, `us_ein`, or `za_vat`", -56306a63398 -> "description": "Value of the tax ID.", -56322a63415,63417 -> }, -> "validate": { -> "type": "boolean" -56460a63556 -> "next_page", -56635,56642d63730 -< "bank_account": { -< "explode": true, -< "style": "deepObject" -< }, -< "card": { -< "explode": true, -< "style": "deepObject" -< }, -56679a63768 -> "description": "City, district, suburb, town, or village.", -56683a63773 -> "description": "Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)).", -56687a63778 -> "description": "Address line 1 (e.g., street, PO Box, or company name).", -56691a63783 -> "description": "Address line 2 (e.g., apartment, suite, unit, or building).", -56695a63788 -> "description": "ZIP or postal code.", -56699a63793 -> "description": "State, county, province, or region.", -56720,56848d63813 -< "bank_account": { -< "anyOf": [ -< { -< "properties": { -< "account_holder_name": { -< "maxLength": 5000, -< "type": "string" -< }, -< "account_holder_type": { -< "enum": [ -< "company", -< "individual" -< ], -< "maxLength": 5000, -< "type": "string" -< }, -< "account_number": { -< "maxLength": 5000, -< "type": "string" -< }, -< "country": { -< "maxLength": 5000, -< "type": "string" -< }, -< "currency": { -< "type": "string" -< }, -< "object": { -< "enum": [ -< "bank_account" -< ], -< "maxLength": 5000, -< "type": "string" -< }, -< "routing_number": { -< "maxLength": 5000, -< "type": "string" -< } -< }, -< "required": [ -< "account_number", -< "country" -< ], -< "title": "customer_payment_source_bank_account", -< "type": "object" -< }, -< { -< "maxLength": 5000, -< "type": "string" -< } -< ], -< "description": "Either a token, like the ones returned by [Stripe.js](https://stripe.com/docs/js), or a dictionary containing a user's bank account details." -< }, -< "card": { -< "anyOf": [ -< { -< "properties": { -< "address_city": { -< "maxLength": 5000, -< "type": "string" -< }, -< "address_country": { -< "maxLength": 5000, -< "type": "string" -< }, -< "address_line1": { -< "maxLength": 5000, -< "type": "string" -< }, -< "address_line2": { -< "maxLength": 5000, -< "type": "string" -< }, -< "address_state": { -< "maxLength": 5000, -< "type": "string" -< }, -< "address_zip": { -< "maxLength": 5000, -< "type": "string" -< }, -< "cvc": { -< "maxLength": 5000, -< "type": "string" -< }, -< "exp_month": { -< "type": "integer" -< }, -< "exp_year": { -< "type": "integer" -< }, -< "metadata": { -< "additionalProperties": { -< "type": "string" -< }, -< "type": "object" -< }, -< "name": { -< "maxLength": 5000, -< "type": "string" -< }, -< "number": { -< "maxLength": 5000, -< "type": "string" -< }, -< "object": { -< "enum": [ -< "card" -< ], -< "maxLength": 5000, -< "type": "string" -< } -< }, -< "required": [ -< "exp_month", -< "exp_year", -< "number" -< ], -< "title": "customer_payment_source_card", -< "type": "object" -< }, -< { -< "maxLength": 5000, -< "type": "string" -< } -< ], -< "description": "A token, like the ones returned by [Stripe.js](https://stripe.com/docs/js).", -< "x-stripeBypassValidation": true -< }, -56852a63818 -> "description": "Settings controlling the behavior of the customer's cash balance,\nsuch as reconciliation of funds received.", -56854a63821 -> "description": "Controls how funds transferred by the customer are applied to payment intents and invoices. Valid options are `automatic` or `manual`. For more information about these reconciliation modes, see [Reconciliation](https://stripe.com/docs/payments/customer-balance/reconciliation).", -56873,56887d63839 -< "default_alipay_account": { -< "description": "ID of Alipay account to make the customer's new default for invoice payments.", -< "maxLength": 500, -< "type": "string" -< }, -< "default_bank_account": { -< "description": "ID of bank account to make the customer's new default for invoice payments.", -< "maxLength": 500, -< "type": "string" -< }, -< "default_card": { -< "description": "ID of card to make the customer's new default for invoice payments.", -< "maxLength": 500, -< "type": "string" -< }, -56924a63877 -> "description": "The name of the custom field. This may be up to 30 characters.", -56928a63882 -> "description": "The value of the custom field. This may be up to 30 characters.", -56948c63902,63903 -< ] ---- -> ], -> "description": "Default custom fields to be displayed on invoices for this customer. When updating, pass an empty string to remove previously-defined fields." -56950a63906 -> "description": "ID of a payment method that's attached to the customer, to be used as the customer's default payment method for subscriptions and invoices.", -56954a63911 -> "description": "Default footer to be displayed on invoices for this customer.", -56962a63920 -> "description": "How line-item prices and amounts will be displayed with respect to tax on invoice PDFs. One of `exclude_tax` or `include_inclusive_tax`. `include_inclusive_tax` will include inclusive tax (and exclude exclusive tax) in invoice PDF amounts. `exclude_tax` will exclude all tax (inclusive and exclusive alike) from invoice PDF amounts.", -56980c63938,63939 -< ] ---- -> ], -> "description": "Default options for invoice PDF rendering for this customer." -57034a63994 -> "description": "Customer shipping address.", -57036a63997 -> "description": "City, district, suburb, town, or village.", -57040a64002 -> "description": "Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)).", -57044a64007 -> "description": "Address line 1 (e.g., street, PO Box, or company name).", -57048a64012 -> "description": "Address line 2 (e.g., apartment, suite, unit, or building).", -57052a64017 -> "description": "ZIP or postal code.", -57056a64022 -> "description": "State, county, province, or region.", -57064a64031 -> "description": "Customer name.", -57068a64036 -> "description": "Customer phone (including extension).", -57108c64076,64077 -< ] ---- -> ], -> "description": "A recent IP address of the customer used for tax reporting and tax location inference. Stripe recommends updating the IP address when a new PaymentMethod is attached or the address field on the customer is updated. We recommend against updating this field more frequently since it could result in unexpected tax location/reporting outcomes." -57122a64092,64094 -> }, -> "validate": { -> "type": "boolean" -57572,59128d64543 -< "/v1/customers/{customer}/bank_accounts": { -< "get": { -< "deprecated": true, -< "description": "

You can see a list of the bank accounts belonging to a Customer. Note that the 10 most recent sources are always available by default on the Customer. If you need more than those 10, you can use this API method and the limit and starting_after parameters to page through additional bank accounts.

", -< "operationId": "GetCustomersCustomerBankAccounts", -< "parameters": [ -< { -< "in": "path", -< "name": "customer", -< "required": true, -< "schema": { -< "maxLength": 5000, -< "type": "string" -< }, -< "style": "simple" -< }, -< { -< "description": "A cursor for use in pagination. `ending_before` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, starting with `obj_bar`, your subsequent call can include `ending_before=obj_bar` in order to fetch the previous page of the list.", -< "in": "query", -< "name": "ending_before", -< "required": false, -< "schema": { -< "type": "string" -< }, -< "style": "form" -< }, -< { -< "description": "Specifies which fields in the response should be expanded.", -< "explode": true, -< "in": "query", -< "name": "expand", -< "required": false, -< "schema": { -< "items": { -< "maxLength": 5000, -< "type": "string" -< }, -< "type": "array" -< }, -< "style": "deepObject" -< }, -< { -< "description": "A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 10.", -< "in": "query", -< "name": "limit", -< "required": false, -< "schema": { -< "type": "integer" -< }, -< "style": "form" -< }, -< { -< "description": "A cursor for use in pagination. `starting_after` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with `obj_foo`, your subsequent call can include `starting_after=obj_foo` in order to fetch the next page of the list.", -< "in": "query", -< "name": "starting_after", -< "required": false, -< "schema": { -< "type": "string" -< }, -< "style": "form" -< } -< ], -< "requestBody": { -< "content": { -< "application/x-www-form-urlencoded": { -< "encoding": {}, -< "schema": { -< "additionalProperties": false, -< "properties": {}, -< "type": "object" -< } -< } -< }, -< "required": false -< }, -< "responses": { -< "200": { -< "content": { -< "application/json": { -< "schema": { -< "description": "", -< "properties": { -< "data": { -< "description": "Details about each object.", -< "items": { -< "$ref": "#/components/schemas/bank_account" -< }, -< "type": "array" -< }, -< "has_more": { -< "description": "True if this list has another page of items after this one that can be fetched.", -< "type": "boolean" -< }, -< "object": { -< "description": "String representing the object's type. Objects of the same type share the same value. Always has the value `list`.", -< "enum": [ -< "list" -< ], -< "type": "string" -< }, -< "url": { -< "description": "The URL where this list can be accessed.", -< "maxLength": 5000, -< "type": "string" -< } -< }, -< "required": [ -< "data", -< "has_more", -< "object", -< "url" -< ], -< "title": "BankAccountList", -< "type": "object", -< "x-expandableFields": [ -< "data" -< ] -< } -< } -< }, -< "description": "Successful response." -< }, -< "default": { -< "content": { -< "application/json": { -< "schema": { -< "$ref": "#/components/schemas/error" -< } -< } -< }, -< "description": "Error response." -< } -< } -< }, -< "post": { -< "description": "

When you create a new credit card, you must specify a customer or recipient on which to create it.

\n\n

If the card’s owner has no default card, then the new card will become the default.\nHowever, if the owner already has a default, then it will not change.\nTo change the default, you should update the customer to have a new default_source.

", -< "operationId": "PostCustomersCustomerBankAccounts", -< "parameters": [ -< { -< "in": "path", -< "name": "customer", -< "required": true, -< "schema": { -< "maxLength": 5000, -< "type": "string" -< }, -< "style": "simple" -< } -< ], -< "requestBody": { -< "content": { -< "application/x-www-form-urlencoded": { -< "encoding": { -< "bank_account": { -< "explode": true, -< "style": "deepObject" -< }, -< "card": { -< "explode": true, -< "style": "deepObject" -< }, -< "expand": { -< "explode": true, -< "style": "deepObject" -< }, -< "metadata": { -< "explode": true, -< "style": "deepObject" -< } -< }, -< "schema": { -< "additionalProperties": false, -< "properties": { -< "alipay_account": { -< "description": "A token returned by [Stripe.js](https://stripe.com/docs/js) representing the user’s Alipay account details.", -< "maxLength": 5000, -< "type": "string" -< }, -< "bank_account": { -< "anyOf": [ -< { -< "properties": { -< "account_holder_name": { -< "maxLength": 5000, -< "type": "string" -< }, -< "account_holder_type": { -< "enum": [ -< "company", -< "individual" -< ], -< "maxLength": 5000, -< "type": "string" -< }, -< "account_number": { -< "maxLength": 5000, -< "type": "string" -< }, -< "country": { -< "maxLength": 5000, -< "type": "string" -< }, -< "currency": { -< "type": "string" -< }, -< "object": { -< "enum": [ -< "bank_account" -< ], -< "maxLength": 5000, -< "type": "string" -< }, -< "routing_number": { -< "maxLength": 5000, -< "type": "string" -< } -< }, -< "required": [ -< "account_number", -< "country" -< ], -< "title": "customer_payment_source_bank_account", -< "type": "object" -< }, -< { -< "maxLength": 5000, -< "type": "string" -< } -< ], -< "description": "Either a token, like the ones returned by [Stripe.js](https://stripe.com/docs/js), or a dictionary containing a user's bank account details." -< }, -< "card": { -< "anyOf": [ -< { -< "properties": { -< "address_city": { -< "maxLength": 5000, -< "type": "string" -< }, -< "address_country": { -< "maxLength": 5000, -< "type": "string" -< }, -< "address_line1": { -< "maxLength": 5000, -< "type": "string" -< }, -< "address_line2": { -< "maxLength": 5000, -< "type": "string" -< }, -< "address_state": { -< "maxLength": 5000, -< "type": "string" -< }, -< "address_zip": { -< "maxLength": 5000, -< "type": "string" -< }, -< "cvc": { -< "maxLength": 5000, -< "type": "string" -< }, -< "exp_month": { -< "type": "integer" -< }, -< "exp_year": { -< "type": "integer" -< }, -< "metadata": { -< "additionalProperties": { -< "type": "string" -< }, -< "type": "object" -< }, -< "name": { -< "maxLength": 5000, -< "type": "string" -< }, -< "number": { -< "maxLength": 5000, -< "type": "string" -< }, -< "object": { -< "enum": [ -< "card" -< ], -< "maxLength": 5000, -< "type": "string" -< } -< }, -< "required": [ -< "exp_month", -< "exp_year", -< "number" -< ], -< "title": "customer_payment_source_card", -< "type": "object" -< }, -< { -< "maxLength": 5000, -< "type": "string" -< } -< ], -< "description": "A token, like the ones returned by [Stripe.js](https://stripe.com/docs/js).", -< "x-stripeBypassValidation": true -< }, -< "expand": { -< "description": "Specifies which fields in the response should be expanded.", -< "items": { -< "maxLength": 5000, -< "type": "string" -< }, -< "type": "array" -< }, -< "metadata": { -< "additionalProperties": { -< "type": "string" -< }, -< "description": "Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`.", -< "type": "object" -< }, -< "source": { -< "description": "Please refer to full [documentation](https://stripe.com/docs/api) instead.", -< "maxLength": 5000, -< "type": "string", -< "x-stripeBypassValidation": true -< } -< }, -< "type": "object" -< } -< } -< }, -< "required": false -< }, -< "responses": { -< "200": { -< "content": { -< "application/json": { -< "schema": { -< "$ref": "#/components/schemas/payment_source" -< } -< } -< }, -< "description": "Successful response." -< }, -< "default": { -< "content": { -< "application/json": { -< "schema": { -< "$ref": "#/components/schemas/error" -< } -< } -< }, -< "description": "Error response." -< } -< } -< } -< }, -< "/v1/customers/{customer}/bank_accounts/{id}": { -< "delete": { -< "description": "

Delete a specified source for a given customer.

", -< "operationId": "DeleteCustomersCustomerBankAccountsId", -< "parameters": [ -< { -< "in": "path", -< "name": "customer", -< "required": true, -< "schema": { -< "maxLength": 5000, -< "type": "string" -< }, -< "style": "simple" -< }, -< { -< "in": "path", -< "name": "id", -< "required": true, -< "schema": { -< "type": "string" -< }, -< "style": "simple" -< } -< ], -< "requestBody": { -< "content": { -< "application/x-www-form-urlencoded": { -< "encoding": { -< "expand": { -< "explode": true, -< "style": "deepObject" -< } -< }, -< "schema": { -< "additionalProperties": false, -< "properties": { -< "expand": { -< "description": "Specifies which fields in the response should be expanded.", -< "items": { -< "maxLength": 5000, -< "type": "string" -< }, -< "type": "array" -< } -< }, -< "type": "object" -< } -< } -< }, -< "required": false -< }, -< "responses": { -< "200": { -< "content": { -< "application/json": { -< "schema": { -< "anyOf": [ -< { -< "$ref": "#/components/schemas/payment_source" -< }, -< { -< "$ref": "#/components/schemas/deleted_payment_source" -< } -< ] -< } -< } -< }, -< "description": "Successful response." -< }, -< "default": { -< "content": { -< "application/json": { -< "schema": { -< "$ref": "#/components/schemas/error" -< } -< } -< }, -< "description": "Error response." -< } -< } -< }, -< "get": { -< "deprecated": true, -< "description": "

By default, you can see the 10 most recent sources stored on a Customer directly on the object, but you can also retrieve details about a specific bank account stored on the Stripe account.

", -< "operationId": "GetCustomersCustomerBankAccountsId", -< "parameters": [ -< { -< "in": "path", -< "name": "customer", -< "required": true, -< "schema": { -< "maxLength": 5000, -< "type": "string" -< }, -< "style": "simple" -< }, -< { -< "description": "Specifies which fields in the response should be expanded.", -< "explode": true, -< "in": "query", -< "name": "expand", -< "required": false, -< "schema": { -< "items": { -< "maxLength": 5000, -< "type": "string" -< }, -< "type": "array" -< }, -< "style": "deepObject" -< }, -< { -< "in": "path", -< "name": "id", -< "required": true, -< "schema": { -< "maxLength": 5000, -< "type": "string" -< }, -< "style": "simple" -< } -< ], -< "requestBody": { -< "content": { -< "application/x-www-form-urlencoded": { -< "encoding": {}, -< "schema": { -< "additionalProperties": false, -< "properties": {}, -< "type": "object" -< } -< } -< }, -< "required": false -< }, -< "responses": { -< "200": { -< "content": { -< "application/json": { -< "schema": { -< "$ref": "#/components/schemas/bank_account" -< } -< } -< }, -< "description": "Successful response." -< }, -< "default": { -< "content": { -< "application/json": { -< "schema": { -< "$ref": "#/components/schemas/error" -< } -< } -< }, -< "description": "Error response." -< } -< } -< }, -< "post": { -< "description": "

Update a specified source for a given customer.

", -< "operationId": "PostCustomersCustomerBankAccountsId", -< "parameters": [ -< { -< "in": "path", -< "name": "customer", -< "required": true, -< "schema": { -< "maxLength": 5000, -< "type": "string" -< }, -< "style": "simple" -< }, -< { -< "in": "path", -< "name": "id", -< "required": true, -< "schema": { -< "maxLength": 5000, -< "type": "string" -< }, -< "style": "simple" -< } -< ], -< "requestBody": { -< "content": { -< "application/x-www-form-urlencoded": { -< "encoding": { -< "expand": { -< "explode": true, -< "style": "deepObject" -< }, -< "metadata": { -< "explode": true, -< "style": "deepObject" -< }, -< "owner": { -< "explode": true, -< "style": "deepObject" -< } -< }, -< "schema": { -< "additionalProperties": false, -< "properties": { -< "account_holder_name": { -< "description": "The name of the person or business that owns the bank account.", -< "maxLength": 5000, -< "type": "string" -< }, -< "account_holder_type": { -< "description": "The type of entity that holds the account. This can be either `individual` or `company`.", -< "enum": [ -< "company", -< "individual" -< ], -< "maxLength": 5000, -< "type": "string" -< }, -< "address_city": { -< "description": "City/District/Suburb/Town/Village.", -< "maxLength": 5000, -< "type": "string" -< }, -< "address_country": { -< "description": "Billing address country, if provided when creating card.", -< "maxLength": 5000, -< "type": "string" -< }, -< "address_line1": { -< "description": "Address line 1 (Street address/PO Box/Company name).", -< "maxLength": 5000, -< "type": "string" -< }, -< "address_line2": { -< "description": "Address line 2 (Apartment/Suite/Unit/Building).", -< "maxLength": 5000, -< "type": "string" -< }, -< "address_state": { -< "description": "State/County/Province/Region.", -< "maxLength": 5000, -< "type": "string" -< }, -< "address_zip": { -< "description": "ZIP or postal code.", -< "maxLength": 5000, -< "type": "string" -< }, -< "exp_month": { -< "description": "Two digit number representing the card’s expiration month.", -< "maxLength": 5000, -< "type": "string" -< }, -< "exp_year": { -< "description": "Four digit number representing the card’s expiration year.", -< "maxLength": 5000, -< "type": "string" -< }, -< "expand": { -< "description": "Specifies which fields in the response should be expanded.", -< "items": { -< "maxLength": 5000, -< "type": "string" -< }, -< "type": "array" -< }, -< "metadata": { -< "anyOf": [ -< { -< "additionalProperties": { -< "type": "string" -< }, -< "type": "object" -< }, -< { -< "enum": [ -< "" -< ], -< "type": "string" -< } -< ], -< "description": "Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`." -< }, -< "name": { -< "description": "Cardholder name.", -< "maxLength": 5000, -< "type": "string" -< }, -< "owner": { -< "properties": { -< "address": { -< "properties": { -< "city": { -< "maxLength": 5000, -< "type": "string" -< }, -< "country": { -< "maxLength": 5000, -< "type": "string" -< }, -< "line1": { -< "maxLength": 5000, -< "type": "string" -< }, -< "line2": { -< "maxLength": 5000, -< "type": "string" -< }, -< "postal_code": { -< "maxLength": 5000, -< "type": "string" -< }, -< "state": { -< "maxLength": 5000, -< "type": "string" -< } -< }, -< "title": "source_address", -< "type": "object" -< }, -< "email": { -< "type": "string" -< }, -< "name": { -< "maxLength": 5000, -< "type": "string" -< }, -< "phone": { -< "maxLength": 5000, -< "type": "string" -< } -< }, -< "title": "owner", -< "type": "object" -< } -< }, -< "type": "object" -< } -< } -< }, -< "required": false -< }, -< "responses": { -< "200": { -< "content": { -< "application/json": { -< "schema": { -< "anyOf": [ -< { -< "$ref": "#/components/schemas/card" -< }, -< { -< "$ref": "#/components/schemas/bank_account" -< }, -< { -< "$ref": "#/components/schemas/source" -< } -< ] -< } -< } -< }, -< "description": "Successful response." -< }, -< "default": { -< "content": { -< "application/json": { -< "schema": { -< "$ref": "#/components/schemas/error" -< } -< } -< }, -< "description": "Error response." -< } -< } -< } -< }, -< "/v1/customers/{customer}/bank_accounts/{id}/verify": { -< "post": { -< "description": "

Verify a specified bank account for a given customer.

", -< "operationId": "PostCustomersCustomerBankAccountsIdVerify", -< "parameters": [ -< { -< "in": "path", -< "name": "customer", -< "required": true, -< "schema": { -< "maxLength": 5000, -< "type": "string" -< }, -< "style": "simple" -< }, -< { -< "in": "path", -< "name": "id", -< "required": true, -< "schema": { -< "maxLength": 5000, -< "type": "string" -< }, -< "style": "simple" -< } -< ], -< "requestBody": { -< "content": { -< "application/x-www-form-urlencoded": { -< "encoding": { -< "amounts": { -< "explode": true, -< "style": "deepObject" -< }, -< "expand": { -< "explode": true, -< "style": "deepObject" -< } -< }, -< "schema": { -< "additionalProperties": false, -< "properties": { -< "amounts": { -< "description": "Two positive integers, in *cents*, equal to the values of the microdeposits sent to the bank account.", -< "items": { -< "type": "integer" -< }, -< "type": "array" -< }, -< "expand": { -< "description": "Specifies which fields in the response should be expanded.", -< "items": { -< "maxLength": 5000, -< "type": "string" -< }, -< "type": "array" -< } -< }, -< "type": "object" -< } -< } -< }, -< "required": false -< }, -< "responses": { -< "200": { -< "content": { -< "application/json": { -< "schema": { -< "$ref": "#/components/schemas/bank_account" -< } -< } -< }, -< "description": "Successful response." -< }, -< "default": { -< "content": { -< "application/json": { -< "schema": { -< "$ref": "#/components/schemas/error" -< } -< } -< }, -< "description": "Error response." -< } -< } -< } -< }, -< "/v1/customers/{customer}/cards": { -< "get": { -< "deprecated": true, -< "description": "

You can see a list of the cards belonging to a customer.\nNote that the 10 most recent sources are always available on the Customer object.\nIf you need more than those 10, you can use this API method and the limit and starting_after parameters to page through additional cards.

", -< "operationId": "GetCustomersCustomerCards", -< "parameters": [ -< { -< "in": "path", -< "name": "customer", -< "required": true, -< "schema": { -< "maxLength": 5000, -< "type": "string" -< }, -< "style": "simple" -< }, -< { -< "description": "A cursor for use in pagination. `ending_before` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, starting with `obj_bar`, your subsequent call can include `ending_before=obj_bar` in order to fetch the previous page of the list.", -< "in": "query", -< "name": "ending_before", -< "required": false, -< "schema": { -< "type": "string" -< }, -< "style": "form" -< }, -< { -< "description": "Specifies which fields in the response should be expanded.", -< "explode": true, -< "in": "query", -< "name": "expand", -< "required": false, -< "schema": { -< "items": { -< "maxLength": 5000, -< "type": "string" -< }, -< "type": "array" -< }, -< "style": "deepObject" -< }, -< { -< "description": "A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 10.", -< "in": "query", -< "name": "limit", -< "required": false, -< "schema": { -< "type": "integer" -< }, -< "style": "form" -< }, -< { -< "description": "A cursor for use in pagination. `starting_after` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with `obj_foo`, your subsequent call can include `starting_after=obj_foo` in order to fetch the next page of the list.", -< "in": "query", -< "name": "starting_after", -< "required": false, -< "schema": { -< "type": "string" -< }, -< "style": "form" -< } -< ], -< "requestBody": { -< "content": { -< "application/x-www-form-urlencoded": { -< "encoding": {}, -< "schema": { -< "additionalProperties": false, -< "properties": {}, -< "type": "object" -< } -< } -< }, -< "required": false -< }, -< "responses": { -< "200": { -< "content": { -< "application/json": { -< "schema": { -< "description": "", -< "properties": { -< "data": { -< "items": { -< "$ref": "#/components/schemas/card" -< }, -< "type": "array" -< }, -< "has_more": { -< "description": "True if this list has another page of items after this one that can be fetched.", -< "type": "boolean" -< }, -< "object": { -< "description": "String representing the object's type. Objects of the same type share the same value. Always has the value `list`.", -< "enum": [ -< "list" -< ], -< "type": "string" -< }, -< "url": { -< "description": "The URL where this list can be accessed.", -< "maxLength": 5000, -< "type": "string" -< } -< }, -< "required": [ -< "data", -< "has_more", -< "object", -< "url" -< ], -< "title": "CardList", -< "type": "object", -< "x-expandableFields": [ -< "data" -< ] -< } -< } -< }, -< "description": "Successful response." -< }, -< "default": { -< "content": { -< "application/json": { -< "schema": { -< "$ref": "#/components/schemas/error" -< } -< } -< }, -< "description": "Error response." -< } -< } -< }, -< "post": { -< "description": "

When you create a new credit card, you must specify a customer or recipient on which to create it.

\n\n

If the card’s owner has no default card, then the new card will become the default.\nHowever, if the owner already has a default, then it will not change.\nTo change the default, you should update the customer to have a new default_source.

", -< "operationId": "PostCustomersCustomerCards", -< "parameters": [ -< { -< "in": "path", -< "name": "customer", -< "required": true, -< "schema": { -< "maxLength": 5000, -< "type": "string" -< }, -< "style": "simple" -< } -< ], -< "requestBody": { -< "content": { -< "application/x-www-form-urlencoded": { -< "encoding": { -< "bank_account": { -< "explode": true, -< "style": "deepObject" -< }, -< "card": { -< "explode": true, -< "style": "deepObject" -< }, -< "expand": { -< "explode": true, -< "style": "deepObject" -< }, -< "metadata": { -< "explode": true, -< "style": "deepObject" -< } -< }, -< "schema": { -< "additionalProperties": false, -< "properties": { -< "alipay_account": { -< "description": "A token returned by [Stripe.js](https://stripe.com/docs/js) representing the user’s Alipay account details.", -< "maxLength": 5000, -< "type": "string" -< }, -< "bank_account": { -< "anyOf": [ -< { -< "properties": { -< "account_holder_name": { -< "maxLength": 5000, -< "type": "string" -< }, -< "account_holder_type": { -< "enum": [ -< "company", -< "individual" -< ], -< "maxLength": 5000, -< "type": "string" -< }, -< "account_number": { -< "maxLength": 5000, -< "type": "string" -< }, -< "country": { -< "maxLength": 5000, -< "type": "string" -< }, -< "currency": { -< "type": "string" -< }, -< "object": { -< "enum": [ -< "bank_account" -< ], -< "maxLength": 5000, -< "type": "string" -< }, -< "routing_number": { -< "maxLength": 5000, -< "type": "string" -< } -< }, -< "required": [ -< "account_number", -< "country" -< ], -< "title": "customer_payment_source_bank_account", -< "type": "object" -< }, -< { -< "maxLength": 5000, -< "type": "string" -< } -< ], -< "description": "Either a token, like the ones returned by [Stripe.js](https://stripe.com/docs/js), or a dictionary containing a user's bank account details." -< }, -< "card": { -< "anyOf": [ -< { -< "properties": { -< "address_city": { -< "maxLength": 5000, -< "type": "string" -< }, -< "address_country": { -< "maxLength": 5000, -< "type": "string" -< }, -< "address_line1": { -< "maxLength": 5000, -< "type": "string" -< }, -< "address_line2": { -< "maxLength": 5000, -< "type": "string" -< }, -< "address_state": { -< "maxLength": 5000, -< "type": "string" -< }, -< "address_zip": { -< "maxLength": 5000, -< "type": "string" -< }, -< "cvc": { -< "maxLength": 5000, -< "type": "string" -< }, -< "exp_month": { -< "type": "integer" -< }, -< "exp_year": { -< "type": "integer" -< }, -< "metadata": { -< "additionalProperties": { -< "type": "string" -< }, -< "type": "object" -< }, -< "name": { -< "maxLength": 5000, -< "type": "string" -< }, -< "number": { -< "maxLength": 5000, -< "type": "string" -< }, -< "object": { -< "enum": [ -< "card" -< ], -< "maxLength": 5000, -< "type": "string" -< } -< }, -< "required": [ -< "exp_month", -< "exp_year", -< "number" -< ], -< "title": "customer_payment_source_card", -< "type": "object" -< }, -< { -< "maxLength": 5000, -< "type": "string" -< } -< ], -< "description": "A token, like the ones returned by [Stripe.js](https://stripe.com/docs/js).", -< "x-stripeBypassValidation": true -< }, -< "expand": { -< "description": "Specifies which fields in the response should be expanded.", -< "items": { -< "maxLength": 5000, -< "type": "string" -< }, -< "type": "array" -< }, -< "metadata": { -< "additionalProperties": { -< "type": "string" -< }, -< "description": "Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`.", -< "type": "object" -< }, -< "source": { -< "description": "Please refer to full [documentation](https://stripe.com/docs/api) instead.", -< "maxLength": 5000, -< "type": "string", -< "x-stripeBypassValidation": true -< } -< }, -< "type": "object" -< } -< } -< }, -< "required": false -< }, -< "responses": { -< "200": { -< "content": { -< "application/json": { -< "schema": { -< "$ref": "#/components/schemas/payment_source" -< } -< } -< }, -< "description": "Successful response." -< }, -< "default": { -< "content": { -< "application/json": { -< "schema": { -< "$ref": "#/components/schemas/error" -< } -< } -< }, -< "description": "Error response." -< } -< } -< } -< }, -< "/v1/customers/{customer}/cards/{id}": { -< "delete": { -< "description": "

Delete a specified source for a given customer.

", -< "operationId": "DeleteCustomersCustomerCardsId", -< "parameters": [ -< { -< "in": "path", -< "name": "customer", -< "required": true, -< "schema": { -< "maxLength": 5000, -< "type": "string" -< }, -< "style": "simple" -< }, -< { -< "in": "path", -< "name": "id", -< "required": true, -< "schema": { -< "type": "string" -< }, -< "style": "simple" -< } -< ], -< "requestBody": { -< "content": { -< "application/x-www-form-urlencoded": { -< "encoding": { -< "expand": { -< "explode": true, -< "style": "deepObject" -< } -< }, -< "schema": { -< "additionalProperties": false, -< "properties": { -< "expand": { -< "description": "Specifies which fields in the response should be expanded.", -< "items": { -< "maxLength": 5000, -< "type": "string" -< }, -< "type": "array" -< } -< }, -< "type": "object" -< } -< } -< }, -< "required": false -< }, -< "responses": { -< "200": { -< "content": { -< "application/json": { -< "schema": { -< "anyOf": [ -< { -< "$ref": "#/components/schemas/payment_source" -< }, -< { -< "$ref": "#/components/schemas/deleted_payment_source" -< } -< ] -< } -< } -< }, -< "description": "Successful response." -< }, -< "default": { -< "content": { -< "application/json": { -< "schema": { -< "$ref": "#/components/schemas/error" -< } -< } -< }, -< "description": "Error response." -< } -< } -< }, -< "get": { -< "deprecated": true, -< "description": "

You can always see the 10 most recent cards directly on a customer; this method lets you retrieve details about a specific card stored on the customer.

", -< "operationId": "GetCustomersCustomerCardsId", -< "parameters": [ -< { -< "in": "path", -< "name": "customer", -< "required": true, -< "schema": { -< "maxLength": 5000, -< "type": "string" -< }, -< "style": "simple" -< }, -< { -< "description": "Specifies which fields in the response should be expanded.", -< "explode": true, -< "in": "query", -< "name": "expand", -< "required": false, -< "schema": { -< "items": { -< "maxLength": 5000, -< "type": "string" -< }, -< "type": "array" -< }, -< "style": "deepObject" -< }, -< { -< "in": "path", -< "name": "id", -< "required": true, -< "schema": { -< "maxLength": 5000, -< "type": "string" -< }, -< "style": "simple" -< } -< ], -< "requestBody": { -< "content": { -< "application/x-www-form-urlencoded": { -< "encoding": {}, -< "schema": { -< "additionalProperties": false, -< "properties": {}, -< "type": "object" -< } -< } -< }, -< "required": false -< }, -< "responses": { -< "200": { -< "content": { -< "application/json": { -< "schema": { -< "$ref": "#/components/schemas/card" -< } -< } -< }, -< "description": "Successful response." -< }, -< "default": { -< "content": { -< "application/json": { -< "schema": { -< "$ref": "#/components/schemas/error" -< } -< } -< }, -< "description": "Error response." -< } -< } -< }, -< "post": { -< "description": "

Update a specified source for a given customer.

", -< "operationId": "PostCustomersCustomerCardsId", -< "parameters": [ -< { -< "in": "path", -< "name": "customer", -< "required": true, -< "schema": { -< "maxLength": 5000, -< "type": "string" -< }, -< "style": "simple" -< }, -< { -< "in": "path", -< "name": "id", -< "required": true, -< "schema": { -< "maxLength": 5000, -< "type": "string" -< }, -< "style": "simple" -< } -< ], -< "requestBody": { -< "content": { -< "application/x-www-form-urlencoded": { -< "encoding": { -< "expand": { -< "explode": true, -< "style": "deepObject" -< }, -< "metadata": { -< "explode": true, -< "style": "deepObject" -< }, -< "owner": { -< "explode": true, -< "style": "deepObject" -< } -< }, -< "schema": { -< "additionalProperties": false, -< "properties": { -< "account_holder_name": { -< "description": "The name of the person or business that owns the bank account.", -< "maxLength": 5000, -< "type": "string" -< }, -< "account_holder_type": { -< "description": "The type of entity that holds the account. This can be either `individual` or `company`.", -< "enum": [ -< "company", -< "individual" -< ], -< "maxLength": 5000, -< "type": "string" -< }, -< "address_city": { -< "description": "City/District/Suburb/Town/Village.", -< "maxLength": 5000, -< "type": "string" -< }, -< "address_country": { -< "description": "Billing address country, if provided when creating card.", -< "maxLength": 5000, -< "type": "string" -< }, -< "address_line1": { -< "description": "Address line 1 (Street address/PO Box/Company name).", -< "maxLength": 5000, -< "type": "string" -< }, -< "address_line2": { -< "description": "Address line 2 (Apartment/Suite/Unit/Building).", -< "maxLength": 5000, -< "type": "string" -< }, -< "address_state": { -< "description": "State/County/Province/Region.", -< "maxLength": 5000, -< "type": "string" -< }, -< "address_zip": { -< "description": "ZIP or postal code.", -< "maxLength": 5000, -< "type": "string" -< }, -< "exp_month": { -< "description": "Two digit number representing the card’s expiration month.", -< "maxLength": 5000, -< "type": "string" -< }, -< "exp_year": { -< "description": "Four digit number representing the card’s expiration year.", -< "maxLength": 5000, -< "type": "string" -< }, -< "expand": { -< "description": "Specifies which fields in the response should be expanded.", -< "items": { -< "maxLength": 5000, -< "type": "string" -< }, -< "type": "array" -< }, -< "metadata": { -< "anyOf": [ -< { -< "additionalProperties": { -< "type": "string" -< }, -< "type": "object" -< }, -< { -< "enum": [ -< "" -< ], -< "type": "string" -< } -< ], -< "description": "Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`." -< }, -< "name": { -< "description": "Cardholder name.", -< "maxLength": 5000, -< "type": "string" -< }, -< "owner": { -< "properties": { -< "address": { -< "properties": { -< "city": { -< "maxLength": 5000, -< "type": "string" -< }, -< "country": { -< "maxLength": 5000, -< "type": "string" -< }, -< "line1": { -< "maxLength": 5000, -< "type": "string" -< }, -< "line2": { -< "maxLength": 5000, -< "type": "string" -< }, -< "postal_code": { -< "maxLength": 5000, -< "type": "string" -< }, -< "state": { -< "maxLength": 5000, -< "type": "string" -< } -< }, -< "title": "source_address", -< "type": "object" -< }, -< "email": { -< "type": "string" -< }, -< "name": { -< "maxLength": 5000, -< "type": "string" -< }, -< "phone": { -< "maxLength": 5000, -< "type": "string" -< } -< }, -< "title": "owner", -< "type": "object" -< } -< }, -< "type": "object" -< } -< } -< }, -< "required": false -< }, -< "responses": { -< "200": { -< "content": { -< "application/json": { -< "schema": { -< "anyOf": [ -< { -< "$ref": "#/components/schemas/card" -< }, -< { -< "$ref": "#/components/schemas/bank_account" -< }, -< { -< "$ref": "#/components/schemas/source" -< } -< ] -< } -< } -< }, -< "description": "Successful response." -< }, -< "default": { -< "content": { -< "application/json": { -< "schema": { -< "$ref": "#/components/schemas/error" -< } -< } -< }, -< "description": "Error response." -< } -< } -< } -< }, -59238a64654 -> "description": "Controls how funds transferred by the customer are applied to payment intents and invoices. Valid options are `automatic` or `manual`. For more information about these reconciliation modes, see [Reconciliation](https://stripe.com/docs/payments/customer-balance/reconciliation).", -59495,59547c64911,64912 -< "description": "

Removes the currently applied discount on a customer.

", -< "operationId": "DeleteCustomersCustomerDiscount", -< "parameters": [ -< { -< "in": "path", -< "name": "customer", -< "required": true, -< "schema": { -< "maxLength": 5000, -< "type": "string" -< }, -< "style": "simple" -< } -< ], -< "requestBody": { -< "content": { -< "application/x-www-form-urlencoded": { -< "encoding": {}, -< "schema": { -< "additionalProperties": false, -< "properties": {}, -< "type": "object" -< } -< } -< }, -< "required": false -< }, -< "responses": { -< "200": { -< "content": { -< "application/json": { -< "schema": { -< "$ref": "#/components/schemas/deleted_discount" -< } -< } -< }, -< "description": "Successful response." -< }, -< "default": { -< "content": { -< "application/json": { -< "schema": { -< "$ref": "#/components/schemas/error" -< } -< } -< }, -< "description": "Error response." -< } -< } -< }, -< "get": { -< "description": "", -< "operationId": "GetCustomersCustomerDiscount", ---- -> "description": "

Removes the currently applied discount on a customer.

", -> "operationId": "DeleteCustomersCustomerDiscount", -59558,59572d64922 -< }, -< { -< "description": "Specifies which fields in the response should be expanded.", -< "explode": true, -< "in": "query", -< "name": "expand", -< "required": false, -< "schema": { -< "items": { -< "maxLength": 5000, -< "type": "string" -< }, -< "type": "array" -< }, -< "style": "deepObject" -59593c64943 -< "$ref": "#/components/schemas/discount" ---- -> "$ref": "#/components/schemas/deleted_discount" -59647a64998 -> "description": "Configuration for eu_bank_transfer funding type.", -59649a65001 -> "description": "The desired country code of the bank account information. Permitted values include: `DE`, `ES`, `FR`, `IE`, or `NL`.", -59660a65013 -> "description": "List of address types that should be returned in the financial_addresses response. If not specified, all valid types will be returned.\n\nPermitted values include: `sort_code`, `zengin`, `iban`, or `spei`.", -59673a65027 -> "description": "The type of the `bank_transfer`", -59821a65176 -> "card_present", -60092,60104c65447 -< "anyOf": [ -< { -< "$ref": "#/components/schemas/bank_account" -< }, -< { -< "$ref": "#/components/schemas/card" -< }, -< { -< "$ref": "#/components/schemas/source" -< } -< ], -< "title": "Polymorphic", -< "x-stripeBypassValidation": true ---- -> "$ref": "#/components/schemas/payment_source" -60172,60179d65514 -< "bank_account": { -< "explode": true, -< "style": "deepObject" -< }, -< "card": { -< "explode": true, -< "style": "deepObject" -< }, -60192,60325d65526 -< "alipay_account": { -< "description": "A token returned by [Stripe.js](https://stripe.com/docs/js) representing the user’s Alipay account details.", -< "maxLength": 5000, -< "type": "string" -< }, -< "bank_account": { -< "anyOf": [ -< { -< "properties": { -< "account_holder_name": { -< "maxLength": 5000, -< "type": "string" -< }, -< "account_holder_type": { -< "enum": [ -< "company", -< "individual" -< ], -< "maxLength": 5000, -< "type": "string" -< }, -< "account_number": { -< "maxLength": 5000, -< "type": "string" -< }, -< "country": { -< "maxLength": 5000, -< "type": "string" -< }, -< "currency": { -< "type": "string" -< }, -< "object": { -< "enum": [ -< "bank_account" -< ], -< "maxLength": 5000, -< "type": "string" -< }, -< "routing_number": { -< "maxLength": 5000, -< "type": "string" -< } -< }, -< "required": [ -< "account_number", -< "country" -< ], -< "title": "customer_payment_source_bank_account", -< "type": "object" -< }, -< { -< "maxLength": 5000, -< "type": "string" -< } -< ], -< "description": "Either a token, like the ones returned by [Stripe.js](https://stripe.com/docs/js), or a dictionary containing a user's bank account details." -< }, -< "card": { -< "anyOf": [ -< { -< "properties": { -< "address_city": { -< "maxLength": 5000, -< "type": "string" -< }, -< "address_country": { -< "maxLength": 5000, -< "type": "string" -< }, -< "address_line1": { -< "maxLength": 5000, -< "type": "string" -< }, -< "address_line2": { -< "maxLength": 5000, -< "type": "string" -< }, -< "address_state": { -< "maxLength": 5000, -< "type": "string" -< }, -< "address_zip": { -< "maxLength": 5000, -< "type": "string" -< }, -< "cvc": { -< "maxLength": 5000, -< "type": "string" -< }, -< "exp_month": { -< "type": "integer" -< }, -< "exp_year": { -< "type": "integer" -< }, -< "metadata": { -< "additionalProperties": { -< "type": "string" -< }, -< "type": "object" -< }, -< "name": { -< "maxLength": 5000, -< "type": "string" -< }, -< "number": { -< "maxLength": 5000, -< "type": "string" -< }, -< "object": { -< "enum": [ -< "card" -< ], -< "maxLength": 5000, -< "type": "string" -< } -< }, -< "required": [ -< "exp_month", -< "exp_year", -< "number" -< ], -< "title": "customer_payment_source_card", -< "type": "object" -< }, -< { -< "maxLength": 5000, -< "type": "string" -< } -< ], -< "description": "A token, like the ones returned by [Stripe.js](https://stripe.com/docs/js).", -< "x-stripeBypassValidation": true -< }, -60345a65547,65549 -> }, -> "validate": { -> "type": "boolean" -60347a65552,65554 -> "required": [ -> "source" -> ], -60352c65559 -< "required": false ---- -> "required": true -60667a65875 -> "description": "Owner's address.", -60669a65878 -> "description": "City, district, suburb, town, or village.", -60673a65883 -> "description": "Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)).", -60677a65888 -> "description": "Address line 1 (e.g., street, PO Box, or company name).", -60681a65893 -> "description": "Address line 2 (e.g., apartment, suite, unit, or building).", -60685a65898 -> "description": "ZIP or postal code.", -60689a65903 -> "description": "State, county, province, or region.", -60697a65912 -> "description": "Owner's email address.", -60700a65916 -> "description": "Owner's full name.", -60704a65921 -> "description": "Owner's phone number.", -60841,62956d66057 -< "/v1/customers/{customer}/subscriptions": { -< "get": { -< "description": "

You can see a list of the customer’s active subscriptions. Note that the 10 most recent active subscriptions are always available by default on the customer object. If you need more than those 10, you can use the limit and starting_after parameters to page through additional subscriptions.

", -< "operationId": "GetCustomersCustomerSubscriptions", -< "parameters": [ -< { -< "in": "path", -< "name": "customer", -< "required": true, -< "schema": { -< "maxLength": 5000, -< "type": "string" -< }, -< "style": "simple" -< }, -< { -< "description": "A cursor for use in pagination. `ending_before` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, starting with `obj_bar`, your subsequent call can include `ending_before=obj_bar` in order to fetch the previous page of the list.", -< "in": "query", -< "name": "ending_before", -< "required": false, -< "schema": { -< "maxLength": 5000, -< "type": "string" -< }, -< "style": "form" -< }, -< { -< "description": "Specifies which fields in the response should be expanded.", -< "explode": true, -< "in": "query", -< "name": "expand", -< "required": false, -< "schema": { -< "items": { -< "maxLength": 5000, -< "type": "string" -< }, -< "type": "array" -< }, -< "style": "deepObject" -< }, -< { -< "description": "A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 10.", -< "in": "query", -< "name": "limit", -< "required": false, -< "schema": { -< "type": "integer" -< }, -< "style": "form" -< }, -< { -< "description": "A cursor for use in pagination. `starting_after` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with `obj_foo`, your subsequent call can include `starting_after=obj_foo` in order to fetch the next page of the list.", -< "in": "query", -< "name": "starting_after", -< "required": false, -< "schema": { -< "maxLength": 5000, -< "type": "string" -< }, -< "style": "form" -< } -< ], -< "requestBody": { -< "content": { -< "application/x-www-form-urlencoded": { -< "encoding": {}, -< "schema": { -< "additionalProperties": false, -< "properties": {}, -< "type": "object" -< } -< } -< }, -< "required": false -< }, -< "responses": { -< "200": { -< "content": { -< "application/json": { -< "schema": { -< "description": "", -< "properties": { -< "data": { -< "description": "Details about each object.", -< "items": { -< "$ref": "#/components/schemas/subscription" -< }, -< "type": "array" -< }, -< "has_more": { -< "description": "True if this list has another page of items after this one that can be fetched.", -< "type": "boolean" -< }, -< "object": { -< "description": "String representing the object's type. Objects of the same type share the same value. Always has the value `list`.", -< "enum": [ -< "list" -< ], -< "type": "string" -< }, -< "url": { -< "description": "The URL where this list can be accessed.", -< "maxLength": 5000, -< "type": "string" -< } -< }, -< "required": [ -< "data", -< "has_more", -< "object", -< "url" -< ], -< "title": "SubscriptionList", -< "type": "object", -< "x-expandableFields": [ -< "data" -< ] -< } -< } -< }, -< "description": "Successful response." -< }, -< "default": { -< "content": { -< "application/json": { -< "schema": { -< "$ref": "#/components/schemas/error" -< } -< } -< }, -< "description": "Error response." -< } -< } -< }, -< "post": { -< "description": "

Creates a new subscription on an existing customer.

", -< "operationId": "PostCustomersCustomerSubscriptions", -< "parameters": [ -< { -< "in": "path", -< "name": "customer", -< "required": true, -< "schema": { -< "maxLength": 5000, -< "type": "string" -< }, -< "style": "simple" -< } -< ], -< "requestBody": { -< "content": { -< "application/x-www-form-urlencoded": { -< "encoding": { -< "add_invoice_items": { -< "explode": true, -< "style": "deepObject" -< }, -< "automatic_tax": { -< "explode": true, -< "style": "deepObject" -< }, -< "billing_thresholds": { -< "explode": true, -< "style": "deepObject" -< }, -< "default_tax_rates": { -< "explode": true, -< "style": "deepObject" -< }, -< "expand": { -< "explode": true, -< "style": "deepObject" -< }, -< "items": { -< "explode": true, -< "style": "deepObject" -< }, -< "metadata": { -< "explode": true, -< "style": "deepObject" -< }, -< "payment_settings": { -< "explode": true, -< "style": "deepObject" -< }, -< "pending_invoice_item_interval": { -< "explode": true, -< "style": "deepObject" -< }, -< "transfer_data": { -< "explode": true, -< "style": "deepObject" -< }, -< "trial_end": { -< "explode": true, -< "style": "deepObject" -< } -< }, -< "schema": { -< "additionalProperties": false, -< "properties": { -< "add_invoice_items": { -< "description": "A list of prices and quantities that will generate invoice items appended to the next invoice for this subscription. You may pass up to 20 items.", -< "items": { -< "properties": { -< "price": { -< "maxLength": 5000, -< "type": "string" -< }, -< "price_data": { -< "properties": { -< "currency": { -< "type": "string" -< }, -< "product": { -< "maxLength": 5000, -< "type": "string" -< }, -< "tax_behavior": { -< "enum": [ -< "exclusive", -< "inclusive", -< "unspecified" -< ], -< "type": "string" -< }, -< "unit_amount": { -< "type": "integer" -< }, -< "unit_amount_decimal": { -< "format": "decimal", -< "type": "string" -< } -< }, -< "required": [ -< "currency", -< "product" -< ], -< "title": "one_time_price_data", -< "type": "object" -< }, -< "quantity": { -< "type": "integer" -< }, -< "tax_rates": { -< "anyOf": [ -< { -< "items": { -< "maxLength": 5000, -< "type": "string" -< }, -< "type": "array" -< }, -< { -< "enum": [ -< "" -< ], -< "type": "string" -< } -< ] -< } -< }, -< "title": "add_invoice_item_entry", -< "type": "object" -< }, -< "type": "array" -< }, -< "application_fee_percent": { -< "description": "A non-negative decimal between 0 and 100, with at most two decimal places. This represents the percentage of the subscription invoice subtotal that will be transferred to the application owner's Stripe account. The request must be made by a platform account on a connected account in order to set an application fee percentage. For more information, see the application fees [documentation](https://stripe.com/docs/connect/subscriptions#collecting-fees-on-subscriptions).", -< "type": "number" -< }, -< "automatic_tax": { -< "description": "Automatic tax settings for this subscription. We recommend you only include this parameter when the existing value is being changed.", -< "properties": { -< "enabled": { -< "type": "boolean" -< } -< }, -< "required": [ -< "enabled" -< ], -< "title": "automatic_tax_config", -< "type": "object" -< }, -< "backdate_start_date": { -< "description": "For new subscriptions, a past timestamp to backdate the subscription's start date to. If set, the first invoice will contain a proration for the timespan between the start date and the current time. Can be combined with trials and the billing cycle anchor.", -< "format": "unix-time", -< "type": "integer" -< }, -< "billing_cycle_anchor": { -< "description": "A future timestamp to anchor the subscription's [billing cycle](https://stripe.com/docs/subscriptions/billing-cycle). This is used to determine the date of the first full invoice, and, for plans with `month` or `year` intervals, the day of the month for subsequent invoices. The timestamp is in UTC format.", -< "format": "unix-time", -< "type": "integer", -< "x-stripeBypassValidation": true -< }, -< "billing_thresholds": { -< "anyOf": [ -< { -< "properties": { -< "amount_gte": { -< "type": "integer" -< }, -< "reset_billing_cycle_anchor": { -< "type": "boolean" -< } -< }, -< "title": "billing_thresholds_param", -< "type": "object" -< }, -< { -< "enum": [ -< "" -< ], -< "type": "string" -< } -< ], -< "description": "Define thresholds at which an invoice will be sent, and the subscription advanced to a new billing period. Pass an empty string to remove previously-defined thresholds." -< }, -< "cancel_at": { -< "description": "A timestamp at which the subscription should cancel. If set to a date before the current period ends, this will cause a proration if prorations have been enabled using `proration_behavior`. If set during a future period, this will always cause a proration for that period.", -< "format": "unix-time", -< "type": "integer" -< }, -< "cancel_at_period_end": { -< "description": "Boolean indicating whether this subscription should cancel at the end of the current period.", -< "type": "boolean" -< }, -< "collection_method": { -< "description": "Either `charge_automatically`, or `send_invoice`. When charging automatically, Stripe will attempt to pay this subscription at the end of the cycle using the default source attached to the customer. When sending an invoice, Stripe will email your customer an invoice with payment instructions and mark the subscription as `active`. Defaults to `charge_automatically`.", -< "enum": [ -< "charge_automatically", -< "send_invoice" -< ], -< "type": "string" -< }, -< "coupon": { -< "description": "The ID of the coupon to apply to this subscription. A coupon applied to a subscription will only affect invoices created for that particular subscription.", -< "maxLength": 5000, -< "type": "string" -< }, -< "currency": { -< "description": "Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. Must be a [supported currency](https://stripe.com/docs/currencies).", -< "type": "string" -< }, -< "days_until_due": { -< "description": "Number of days a customer has to pay invoices generated by this subscription. Valid only for subscriptions where `collection_method` is set to `send_invoice`.", -< "type": "integer" -< }, -< "default_payment_method": { -< "description": "ID of the default payment method for the subscription. It must belong to the customer associated with the subscription. This takes precedence over `default_source`. If neither are set, invoices will use the customer's [invoice_settings.default_payment_method](https://stripe.com/docs/api/customers/object#customer_object-invoice_settings-default_payment_method) or [default_source](https://stripe.com/docs/api/customers/object#customer_object-default_source).", -< "maxLength": 5000, -< "type": "string" -< }, -< "default_source": { -< "description": "ID of the default payment source for the subscription. It must belong to the customer associated with the subscription and be in a chargeable state. If `default_payment_method` is also set, `default_payment_method` will take precedence. If neither are set, invoices will use the customer's [invoice_settings.default_payment_method](https://stripe.com/docs/api/customers/object#customer_object-invoice_settings-default_payment_method) or [default_source](https://stripe.com/docs/api/customers/object#customer_object-default_source).", -< "maxLength": 5000, -< "type": "string" -< }, -< "default_tax_rates": { -< "anyOf": [ -< { -< "items": { -< "maxLength": 5000, -< "type": "string" -< }, -< "type": "array" -< }, -< { -< "enum": [ -< "" -< ], -< "type": "string" -< } -< ], -< "description": "The tax rates that will apply to any subscription item that does not have `tax_rates` set. Invoices created will have their `default_tax_rates` populated from the subscription." -< }, -< "expand": { -< "description": "Specifies which fields in the response should be expanded.", -< "items": { -< "maxLength": 5000, -< "type": "string" -< }, -< "type": "array" -< }, -< "items": { -< "description": "A list of up to 20 subscription items, each with an attached price.", -< "items": { -< "properties": { -< "billing_thresholds": { -< "anyOf": [ -< { -< "properties": { -< "usage_gte": { -< "type": "integer" -< } -< }, -< "required": [ -< "usage_gte" -< ], -< "title": "item_billing_thresholds_param", -< "type": "object" -< }, -< { -< "enum": [ -< "" -< ], -< "type": "string" -< } -< ] -< }, -< "metadata": { -< "additionalProperties": { -< "type": "string" -< }, -< "type": "object" -< }, -< "price": { -< "maxLength": 5000, -< "type": "string" -< }, -< "price_data": { -< "properties": { -< "currency": { -< "type": "string" -< }, -< "product": { -< "maxLength": 5000, -< "type": "string" -< }, -< "recurring": { -< "properties": { -< "interval": { -< "enum": [ -< "day", -< "month", -< "week", -< "year" -< ], -< "type": "string" -< }, -< "interval_count": { -< "type": "integer" -< } -< }, -< "required": [ -< "interval" -< ], -< "title": "recurring_adhoc", -< "type": "object" -< }, -< "tax_behavior": { -< "enum": [ -< "exclusive", -< "inclusive", -< "unspecified" -< ], -< "type": "string" -< }, -< "unit_amount": { -< "type": "integer" -< }, -< "unit_amount_decimal": { -< "format": "decimal", -< "type": "string" -< } -< }, -< "required": [ -< "currency", -< "product", -< "recurring" -< ], -< "title": "recurring_price_data", -< "type": "object" -< }, -< "quantity": { -< "type": "integer" -< }, -< "tax_rates": { -< "anyOf": [ -< { -< "items": { -< "maxLength": 5000, -< "type": "string" -< }, -< "type": "array" -< }, -< { -< "enum": [ -< "" -< ], -< "type": "string" -< } -< ] -< } -< }, -< "title": "subscription_item_create_params", -< "type": "object" -< }, -< "type": "array" -< }, -< "metadata": { -< "anyOf": [ -< { -< "additionalProperties": { -< "type": "string" -< }, -< "type": "object" -< }, -< { -< "enum": [ -< "" -< ], -< "type": "string" -< } -< ], -< "description": "Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`." -< }, -< "off_session": { -< "description": "Indicates if a customer is on or off-session while an invoice payment is attempted.", -< "type": "boolean" -< }, -< "payment_behavior": { -< "description": "Only applies to subscriptions with `collection_method=charge_automatically`.\n\nUse `allow_incomplete` to create subscriptions with `status=incomplete` if the first invoice cannot be paid. Creating subscriptions with this status allows you to manage scenarios where additional user actions are needed to pay a subscription's invoice. For example, SCA regulation may require 3DS authentication to complete payment. See the [SCA Migration Guide](https://stripe.com/docs/billing/migration/strong-customer-authentication) for Billing to learn more. This is the default behavior.\n\nUse `default_incomplete` to create Subscriptions with `status=incomplete` when the first invoice requires payment, otherwise start as active. Subscriptions transition to `status=active` when successfully confirming the payment intent on the first invoice. This allows simpler management of scenarios where additional user actions are needed to pay a subscription’s invoice. Such as failed payments, [SCA regulation](https://stripe.com/docs/billing/migration/strong-customer-authentication), or collecting a mandate for a bank debit payment method. If the payment intent is not confirmed within 23 hours subscriptions transition to `status=incomplete_expired`, which is a terminal state.\n\nUse `error_if_incomplete` if you want Stripe to return an HTTP 402 status code if a subscription's first invoice cannot be paid. For example, if a payment method requires 3DS authentication due to SCA regulation and further user action is needed, this parameter does not create a subscription and returns an error instead. This was the default behavior for API versions prior to 2019-03-14. See the [changelog](https://stripe.com/docs/upgrades#2019-03-14) to learn more.\n\n`pending_if_incomplete` is only used with updates and cannot be passed when creating a subscription.\n\nSubscriptions with `collection_method=send_invoice` are automatically activated regardless of the first invoice status.", -< "enum": [ -< "allow_incomplete", -< "default_incomplete", -< "error_if_incomplete", -< "pending_if_incomplete" -< ], -< "type": "string" -< }, -< "payment_settings": { -< "description": "Payment settings to pass to invoices created by the subscription.", -< "properties": { -< "payment_method_options": { -< "properties": { -< "acss_debit": { -< "anyOf": [ -< { -< "properties": { -< "mandate_options": { -< "properties": { -< "transaction_type": { -< "enum": [ -< "business", -< "personal" -< ], -< "type": "string" -< } -< }, -< "title": "mandate_options_param", -< "type": "object" -< }, -< "verification_method": { -< "enum": [ -< "automatic", -< "instant", -< "microdeposits" -< ], -< "type": "string", -< "x-stripeBypassValidation": true -< } -< }, -< "title": "invoice_payment_method_options_param", -< "type": "object" -< }, -< { -< "enum": [ -< "" -< ], -< "type": "string" -< } -< ] -< }, -< "bancontact": { -< "anyOf": [ -< { -< "properties": { -< "preferred_language": { -< "enum": [ -< "de", -< "en", -< "fr", -< "nl" -< ], -< "type": "string" -< } -< }, -< "title": "invoice_payment_method_options_param", -< "type": "object" -< }, -< { -< "enum": [ -< "" -< ], -< "type": "string" -< } -< ] -< }, -< "card": { -< "anyOf": [ -< { -< "properties": { -< "mandate_options": { -< "properties": { -< "amount": { -< "type": "integer" -< }, -< "amount_type": { -< "enum": [ -< "fixed", -< "maximum" -< ], -< "type": "string" -< }, -< "description": { -< "maxLength": 200, -< "type": "string" -< } -< }, -< "title": "mandate_options_param", -< "type": "object" -< }, -< "network": { -< "enum": [ -< "amex", -< "cartes_bancaires", -< "diners", -< "discover", -< "interac", -< "jcb", -< "mastercard", -< "unionpay", -< "unknown", -< "visa" -< ], -< "maxLength": 5000, -< "type": "string", -< "x-stripeBypassValidation": true -< }, -< "request_three_d_secure": { -< "enum": [ -< "any", -< "automatic" -< ], -< "type": "string" -< } -< }, -< "title": "subscription_payment_method_options_param", -< "type": "object" -< }, -< { -< "enum": [ -< "" -< ], -< "type": "string" -< } -< ] -< }, -< "customer_balance": { -< "anyOf": [ -< { -< "properties": { -< "bank_transfer": { -< "properties": { -< "eu_bank_transfer": { -< "properties": { -< "country": { -< "maxLength": 5000, -< "type": "string" -< } -< }, -< "required": [ -< "country" -< ], -< "title": "eu_bank_transfer_param", -< "type": "object" -< }, -< "type": { -< "type": "string" -< } -< }, -< "title": "bank_transfer_param", -< "type": "object" -< }, -< "funding_type": { -< "type": "string" -< } -< }, -< "title": "invoice_payment_method_options_param", -< "type": "object" -< }, -< { -< "enum": [ -< "" -< ], -< "type": "string" -< } -< ] -< }, -< "konbini": { -< "anyOf": [ -< { -< "properties": {}, -< "title": "invoice_payment_method_options_param", -< "type": "object" -< }, -< { -< "enum": [ -< "" -< ], -< "type": "string" -< } -< ] -< }, -< "us_bank_account": { -< "anyOf": [ -< { -< "properties": { -< "financial_connections": { -< "properties": { -< "permissions": { -< "items": { -< "enum": [ -< "balances", -< "ownership", -< "payment_method", -< "transactions" -< ], -< "maxLength": 5000, -< "type": "string", -< "x-stripeBypassValidation": true -< }, -< "type": "array" -< } -< }, -< "title": "invoice_linked_account_options_param", -< "type": "object" -< }, -< "verification_method": { -< "enum": [ -< "automatic", -< "instant", -< "microdeposits" -< ], -< "type": "string", -< "x-stripeBypassValidation": true -< } -< }, -< "title": "invoice_payment_method_options_param", -< "type": "object" -< }, -< { -< "enum": [ -< "" -< ], -< "type": "string" -< } -< ] -< } -< }, -< "title": "payment_method_options", -< "type": "object" -< }, -< "payment_method_types": { -< "anyOf": [ -< { -< "items": { -< "enum": [ -< "ach_credit_transfer", -< "ach_debit", -< "acss_debit", -< "au_becs_debit", -< "bacs_debit", -< "bancontact", -< "boleto", -< "card", -< "customer_balance", -< "fpx", -< "giropay", -< "grabpay", -< "ideal", -< "konbini", -< "link", -< "paynow", -< "promptpay", -< "sepa_debit", -< "sofort", -< "us_bank_account", -< "wechat_pay" -< ], -< "type": "string", -< "x-stripeBypassValidation": true -< }, -< "type": "array" -< }, -< { -< "enum": [ -< "" -< ], -< "type": "string" -< } -< ] -< }, -< "save_default_payment_method": { -< "enum": [ -< "off", -< "on_subscription" -< ], -< "type": "string" -< } -< }, -< "title": "payment_settings", -< "type": "object" -< }, -< "pending_invoice_item_interval": { -< "anyOf": [ -< { -< "properties": { -< "interval": { -< "enum": [ -< "day", -< "month", -< "week", -< "year" -< ], -< "type": "string" -< }, -< "interval_count": { -< "type": "integer" -< } -< }, -< "required": [ -< "interval" -< ], -< "title": "pending_invoice_item_interval_params", -< "type": "object" -< }, -< { -< "enum": [ -< "" -< ], -< "type": "string" -< } -< ], -< "description": "Specifies an interval for how often to bill for any pending invoice items. It is analogous to calling [Create an invoice](https://stripe.com/docs/api#create_invoice) for the given subscription at the specified interval." -< }, -< "promotion_code": { -< "description": "The API ID of a promotion code to apply to this subscription. A promotion code applied to a subscription will only affect invoices created for that particular subscription.", -< "maxLength": 5000, -< "type": "string" -< }, -< "proration_behavior": { -< "description": "Determines how to handle [prorations](https://stripe.com/docs/subscriptions/billing-cycle#prorations) resulting from the `billing_cycle_anchor`. If no value is passed, the default is `create_prorations`.", -< "enum": [ -< "always_invoice", -< "create_prorations", -< "none" -< ], -< "type": "string" -< }, -< "transfer_data": { -< "description": "If specified, the funds from the subscription's invoices will be transferred to the destination and the ID of the resulting transfers will be found on the resulting charges.", -< "properties": { -< "amount_percent": { -< "type": "number" -< }, -< "destination": { -< "type": "string" -< } -< }, -< "required": [ -< "destination" -< ], -< "title": "transfer_data_specs", -< "type": "object" -< }, -< "trial_end": { -< "anyOf": [ -< { -< "enum": [ -< "now" -< ], -< "maxLength": 5000, -< "type": "string" -< }, -< { -< "format": "unix-time", -< "type": "integer" -< } -< ], -< "description": "Unix timestamp representing the end of the trial period the customer will get before being charged for the first time. This will always overwrite any trials that might apply via a subscribed plan. If set, trial_end will override the default trial period of the plan the customer is being subscribed to. The special value `now` can be provided to end the customer's trial immediately. Can be at most two years from `billing_cycle_anchor`. See [Using trial periods on subscriptions](https://stripe.com/docs/billing/subscriptions/trials) to learn more." -< }, -< "trial_from_plan": { -< "description": "Indicates if a plan's `trial_period_days` should be applied to the subscription. Setting `trial_end` per subscription is preferred, and this defaults to `false`. Setting this flag to `true` together with `trial_end` is not allowed. See [Using trial periods on subscriptions](https://stripe.com/docs/billing/subscriptions/trials) to learn more.", -< "type": "boolean" -< }, -< "trial_period_days": { -< "description": "Integer representing the number of trial period days before the customer is charged for the first time. This will always overwrite any trials that might apply via a subscribed plan. See [Using trial periods on subscriptions](https://stripe.com/docs/billing/subscriptions/trials) to learn more.", -< "type": "integer" -< } -< }, -< "type": "object" -< } -< } -< }, -< "required": false -< }, -< "responses": { -< "200": { -< "content": { -< "application/json": { -< "schema": { -< "$ref": "#/components/schemas/subscription" -< } -< } -< }, -< "description": "Successful response." -< }, -< "default": { -< "content": { -< "application/json": { -< "schema": { -< "$ref": "#/components/schemas/error" -< } -< } -< }, -< "description": "Error response." -< } -< } -< } -< }, -< "/v1/customers/{customer}/subscriptions/{subscription_exposed_id}": { -< "delete": { -< "description": "

Cancels a customer’s subscription. If you set the at_period_end parameter to true, the subscription will remain active until the end of the period, at which point it will be canceled and not renewed. Otherwise, with the default false value, the subscription is terminated immediately. In either case, the customer will not be charged again for the subscription.

\n\n

Note, however, that any pending invoice items that you’ve created will still be charged for at the end of the period, unless manually deleted. If you’ve set the subscription to cancel at the end of the period, any pending prorations will also be left in place and collected at the end of the period. But if the subscription is set to cancel immediately, pending prorations will be removed.

\n\n

By default, upon subscription cancellation, Stripe will stop automatic collection of all finalized invoices for the customer. This is intended to prevent unexpected payment attempts after the customer has canceled a subscription. However, you can resume automatic collection of the invoices manually after subscription cancellation to have us proceed. Or, you could check for unpaid invoices before allowing the customer to cancel the subscription at all.

", -< "operationId": "DeleteCustomersCustomerSubscriptionsSubscriptionExposedId", -< "parameters": [ -< { -< "in": "path", -< "name": "customer", -< "required": true, -< "schema": { -< "maxLength": 5000, -< "type": "string" -< }, -< "style": "simple" -< }, -< { -< "in": "path", -< "name": "subscription_exposed_id", -< "required": true, -< "schema": { -< "maxLength": 5000, -< "type": "string" -< }, -< "style": "simple" -< } -< ], -< "requestBody": { -< "content": { -< "application/x-www-form-urlencoded": { -< "encoding": { -< "expand": { -< "explode": true, -< "style": "deepObject" -< } -< }, -< "schema": { -< "additionalProperties": false, -< "properties": { -< "expand": { -< "description": "Specifies which fields in the response should be expanded.", -< "items": { -< "maxLength": 5000, -< "type": "string" -< }, -< "type": "array" -< }, -< "invoice_now": { -< "description": "Can be set to `true` if `at_period_end` is not set to `true`. Will generate a final invoice that invoices for any un-invoiced metered usage and new/pending proration invoice items.", -< "type": "boolean" -< }, -< "prorate": { -< "description": "Can be set to `true` if `at_period_end` is not set to `true`. Will generate a proration invoice item that credits remaining unused time until the subscription period end.", -< "type": "boolean" -< } -< }, -< "type": "object" -< } -< } -< }, -< "required": false -< }, -< "responses": { -< "200": { -< "content": { -< "application/json": { -< "schema": { -< "$ref": "#/components/schemas/subscription" -< } -< } -< }, -< "description": "Successful response." -< }, -< "default": { -< "content": { -< "application/json": { -< "schema": { -< "$ref": "#/components/schemas/error" -< } -< } -< }, -< "description": "Error response." -< } -< } -< }, -< "get": { -< "description": "

Retrieves the subscription with the given ID.

", -< "operationId": "GetCustomersCustomerSubscriptionsSubscriptionExposedId", -< "parameters": [ -< { -< "in": "path", -< "name": "customer", -< "required": true, -< "schema": { -< "maxLength": 5000, -< "type": "string" -< }, -< "style": "simple" -< }, -< { -< "description": "Specifies which fields in the response should be expanded.", -< "explode": true, -< "in": "query", -< "name": "expand", -< "required": false, -< "schema": { -< "items": { -< "maxLength": 5000, -< "type": "string" -< }, -< "type": "array" -< }, -< "style": "deepObject" -< }, -< { -< "in": "path", -< "name": "subscription_exposed_id", -< "required": true, -< "schema": { -< "maxLength": 5000, -< "type": "string" -< }, -< "style": "simple" -< } -< ], -< "requestBody": { -< "content": { -< "application/x-www-form-urlencoded": { -< "encoding": {}, -< "schema": { -< "additionalProperties": false, -< "properties": {}, -< "type": "object" -< } -< } -< }, -< "required": false -< }, -< "responses": { -< "200": { -< "content": { -< "application/json": { -< "schema": { -< "$ref": "#/components/schemas/subscription" -< } -< } -< }, -< "description": "Successful response." -< }, -< "default": { -< "content": { -< "application/json": { -< "schema": { -< "$ref": "#/components/schemas/error" -< } -< } -< }, -< "description": "Error response." -< } -< } -< }, -< "post": { -< "description": "

Updates an existing subscription on a customer to match the specified parameters. When changing plans or quantities, we will optionally prorate the price we charge next month to make up for any price changes. To preview how the proration will be calculated, use the upcoming invoice endpoint.

", -< "operationId": "PostCustomersCustomerSubscriptionsSubscriptionExposedId", -< "parameters": [ -< { -< "in": "path", -< "name": "customer", -< "required": true, -< "schema": { -< "maxLength": 5000, -< "type": "string" -< }, -< "style": "simple" -< }, -< { -< "in": "path", -< "name": "subscription_exposed_id", -< "required": true, -< "schema": { -< "maxLength": 5000, -< "type": "string" -< }, -< "style": "simple" -< } -< ], -< "requestBody": { -< "content": { -< "application/x-www-form-urlencoded": { -< "encoding": { -< "add_invoice_items": { -< "explode": true, -< "style": "deepObject" -< }, -< "automatic_tax": { -< "explode": true, -< "style": "deepObject" -< }, -< "billing_thresholds": { -< "explode": true, -< "style": "deepObject" -< }, -< "cancel_at": { -< "explode": true, -< "style": "deepObject" -< }, -< "default_tax_rates": { -< "explode": true, -< "style": "deepObject" -< }, -< "expand": { -< "explode": true, -< "style": "deepObject" -< }, -< "items": { -< "explode": true, -< "style": "deepObject" -< }, -< "metadata": { -< "explode": true, -< "style": "deepObject" -< }, -< "pause_collection": { -< "explode": true, -< "style": "deepObject" -< }, -< "payment_settings": { -< "explode": true, -< "style": "deepObject" -< }, -< "pending_invoice_item_interval": { -< "explode": true, -< "style": "deepObject" -< }, -< "transfer_data": { -< "explode": true, -< "style": "deepObject" -< }, -< "trial_end": { -< "explode": true, -< "style": "deepObject" -< } -< }, -< "schema": { -< "additionalProperties": false, -< "properties": { -< "add_invoice_items": { -< "description": "A list of prices and quantities that will generate invoice items appended to the next invoice for this subscription. You may pass up to 20 items.", -< "items": { -< "properties": { -< "price": { -< "maxLength": 5000, -< "type": "string" -< }, -< "price_data": { -< "properties": { -< "currency": { -< "type": "string" -< }, -< "product": { -< "maxLength": 5000, -< "type": "string" -< }, -< "tax_behavior": { -< "enum": [ -< "exclusive", -< "inclusive", -< "unspecified" -< ], -< "type": "string" -< }, -< "unit_amount": { -< "type": "integer" -< }, -< "unit_amount_decimal": { -< "format": "decimal", -< "type": "string" -< } -< }, -< "required": [ -< "currency", -< "product" -< ], -< "title": "one_time_price_data", -< "type": "object" -< }, -< "quantity": { -< "type": "integer" -< }, -< "tax_rates": { -< "anyOf": [ -< { -< "items": { -< "maxLength": 5000, -< "type": "string" -< }, -< "type": "array" -< }, -< { -< "enum": [ -< "" -< ], -< "type": "string" -< } -< ] -< } -< }, -< "title": "add_invoice_item_entry", -< "type": "object" -< }, -< "type": "array" -< }, -< "application_fee_percent": { -< "description": "A non-negative decimal between 0 and 100, with at most two decimal places. This represents the percentage of the subscription invoice subtotal that will be transferred to the application owner's Stripe account. The request must be made by a platform account on a connected account in order to set an application fee percentage. For more information, see the application fees [documentation](https://stripe.com/docs/connect/subscriptions#collecting-fees-on-subscriptions).", -< "type": "number" -< }, -< "automatic_tax": { -< "description": "Automatic tax settings for this subscription. We recommend you only include this parameter when the existing value is being changed.", -< "properties": { -< "enabled": { -< "type": "boolean" -< } -< }, -< "required": [ -< "enabled" -< ], -< "title": "automatic_tax_config", -< "type": "object" -< }, -< "billing_cycle_anchor": { -< "description": "Either `now` or `unchanged`. Setting the value to `now` resets the subscription's billing cycle anchor to the current time. For more information, see the billing cycle [documentation](https://stripe.com/docs/billing/subscriptions/billing-cycle).", -< "enum": [ -< "now", -< "unchanged" -< ], -< "maxLength": 5000, -< "type": "string", -< "x-stripeBypassValidation": true -< }, -< "billing_thresholds": { -< "anyOf": [ -< { -< "properties": { -< "amount_gte": { -< "type": "integer" -< }, -< "reset_billing_cycle_anchor": { -< "type": "boolean" -< } -< }, -< "title": "billing_thresholds_param", -< "type": "object" -< }, -< { -< "enum": [ -< "" -< ], -< "type": "string" -< } -< ], -< "description": "Define thresholds at which an invoice will be sent, and the subscription advanced to a new billing period. Pass an empty string to remove previously-defined thresholds." -< }, -< "cancel_at": { -< "anyOf": [ -< { -< "format": "unix-time", -< "type": "integer" -< }, -< { -< "enum": [ -< "" -< ], -< "type": "string" -< } -< ], -< "description": "A timestamp at which the subscription should cancel. If set to a date before the current period ends, this will cause a proration if prorations have been enabled using `proration_behavior`. If set during a future period, this will always cause a proration for that period." -< }, -< "cancel_at_period_end": { -< "description": "Boolean indicating whether this subscription should cancel at the end of the current period.", -< "type": "boolean" -< }, -< "collection_method": { -< "description": "Either `charge_automatically`, or `send_invoice`. When charging automatically, Stripe will attempt to pay this subscription at the end of the cycle using the default source attached to the customer. When sending an invoice, Stripe will email your customer an invoice with payment instructions and mark the subscription as `active`. Defaults to `charge_automatically`.", -< "enum": [ -< "charge_automatically", -< "send_invoice" -< ], -< "type": "string" -< }, -< "coupon": { -< "description": "The ID of the coupon to apply to this subscription. A coupon applied to a subscription will only affect invoices created for that particular subscription.", -< "maxLength": 5000, -< "type": "string" -< }, -< "days_until_due": { -< "description": "Number of days a customer has to pay invoices generated by this subscription. Valid only for subscriptions where `collection_method` is set to `send_invoice`.", -< "type": "integer" -< }, -< "default_payment_method": { -< "description": "ID of the default payment method for the subscription. It must belong to the customer associated with the subscription. This takes precedence over `default_source`. If neither are set, invoices will use the customer's [invoice_settings.default_payment_method](https://stripe.com/docs/api/customers/object#customer_object-invoice_settings-default_payment_method) or [default_source](https://stripe.com/docs/api/customers/object#customer_object-default_source).", -< "maxLength": 5000, -< "type": "string" -< }, -< "default_source": { -< "description": "ID of the default payment source for the subscription. It must belong to the customer associated with the subscription and be in a chargeable state. If `default_payment_method` is also set, `default_payment_method` will take precedence. If neither are set, invoices will use the customer's [invoice_settings.default_payment_method](https://stripe.com/docs/api/customers/object#customer_object-invoice_settings-default_payment_method) or [default_source](https://stripe.com/docs/api/customers/object#customer_object-default_source).", -< "maxLength": 5000, -< "type": "string" -< }, -< "default_tax_rates": { -< "anyOf": [ -< { -< "items": { -< "maxLength": 5000, -< "type": "string" -< }, -< "type": "array" -< }, -< { -< "enum": [ -< "" -< ], -< "type": "string" -< } -< ], -< "description": "The tax rates that will apply to any subscription item that does not have `tax_rates` set. Invoices created will have their `default_tax_rates` populated from the subscription. Pass an empty string to remove previously-defined tax rates." -< }, -< "expand": { -< "description": "Specifies which fields in the response should be expanded.", -< "items": { -< "maxLength": 5000, -< "type": "string" -< }, -< "type": "array" -< }, -< "items": { -< "description": "A list of up to 20 subscription items, each with an attached price.", -< "items": { -< "properties": { -< "billing_thresholds": { -< "anyOf": [ -< { -< "properties": { -< "usage_gte": { -< "type": "integer" -< } -< }, -< "required": [ -< "usage_gte" -< ], -< "title": "item_billing_thresholds_param", -< "type": "object" -< }, -< { -< "enum": [ -< "" -< ], -< "type": "string" -< } -< ] -< }, -< "clear_usage": { -< "type": "boolean" -< }, -< "deleted": { -< "type": "boolean" -< }, -< "id": { -< "maxLength": 5000, -< "type": "string" -< }, -< "metadata": { -< "anyOf": [ -< { -< "additionalProperties": { -< "type": "string" -< }, -< "type": "object" -< }, -< { -< "enum": [ -< "" -< ], -< "type": "string" -< } -< ] -< }, -< "price": { -< "maxLength": 5000, -< "type": "string" -< }, -< "price_data": { -< "properties": { -< "currency": { -< "type": "string" -< }, -< "product": { -< "maxLength": 5000, -< "type": "string" -< }, -< "recurring": { -< "properties": { -< "interval": { -< "enum": [ -< "day", -< "month", -< "week", -< "year" -< ], -< "type": "string" -< }, -< "interval_count": { -< "type": "integer" -< } -< }, -< "required": [ -< "interval" -< ], -< "title": "recurring_adhoc", -< "type": "object" -< }, -< "tax_behavior": { -< "enum": [ -< "exclusive", -< "inclusive", -< "unspecified" -< ], -< "type": "string" -< }, -< "unit_amount": { -< "type": "integer" -< }, -< "unit_amount_decimal": { -< "format": "decimal", -< "type": "string" -< } -< }, -< "required": [ -< "currency", -< "product", -< "recurring" -< ], -< "title": "recurring_price_data", -< "type": "object" -< }, -< "quantity": { -< "type": "integer" -< }, -< "tax_rates": { -< "anyOf": [ -< { -< "items": { -< "maxLength": 5000, -< "type": "string" -< }, -< "type": "array" -< }, -< { -< "enum": [ -< "" -< ], -< "type": "string" -< } -< ] -< } -< }, -< "title": "subscription_item_update_params", -< "type": "object" -< }, -< "type": "array" -< }, -< "metadata": { -< "anyOf": [ -< { -< "additionalProperties": { -< "type": "string" -< }, -< "type": "object" -< }, -< { -< "enum": [ -< "" -< ], -< "type": "string" -< } -< ], -< "description": "Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`." -< }, -< "off_session": { -< "description": "Indicates if a customer is on or off-session while an invoice payment is attempted.", -< "type": "boolean" -< }, -< "pause_collection": { -< "anyOf": [ -< { -< "properties": { -< "behavior": { -< "enum": [ -< "keep_as_draft", -< "mark_uncollectible", -< "void" -< ], -< "type": "string" -< }, -< "resumes_at": { -< "format": "unix-time", -< "type": "integer" -< } -< }, -< "required": [ -< "behavior" -< ], -< "title": "pause_collection_param", -< "type": "object" -< }, -< { -< "enum": [ -< "" -< ], -< "type": "string" -< } -< ], -< "description": "If specified, payment collection for this subscription will be paused." -< }, -< "payment_behavior": { -< "description": "Use `allow_incomplete` to transition the subscription to `status=past_due` if a payment is required but cannot be paid. This allows you to manage scenarios where additional user actions are needed to pay a subscription's invoice. For example, SCA regulation may require 3DS authentication to complete payment. See the [SCA Migration Guide](https://stripe.com/docs/billing/migration/strong-customer-authentication) for Billing to learn more. This is the default behavior.\n\nUse `default_incomplete` to transition the subscription to `status=past_due` when payment is required and await explicit confirmation of the invoice's payment intent. This allows simpler management of scenarios where additional user actions are needed to pay a subscription’s invoice. Such as failed payments, [SCA regulation](https://stripe.com/docs/billing/migration/strong-customer-authentication), or collecting a mandate for a bank debit payment method.\n\nUse `pending_if_incomplete` to update the subscription using [pending updates](https://stripe.com/docs/billing/subscriptions/pending-updates). When you use `pending_if_incomplete` you can only pass the parameters [supported by pending updates](https://stripe.com/docs/billing/pending-updates-reference#supported-attributes).\n\nUse `error_if_incomplete` if you want Stripe to return an HTTP 402 status code if a subscription's invoice cannot be paid. For example, if a payment method requires 3DS authentication due to SCA regulation and further user action is needed, this parameter does not update the subscription and returns an error instead. This was the default behavior for API versions prior to 2019-03-14. See the [changelog](https://stripe.com/docs/upgrades#2019-03-14) to learn more.", -< "enum": [ -< "allow_incomplete", -< "default_incomplete", -< "error_if_incomplete", -< "pending_if_incomplete" -< ], -< "type": "string" -< }, -< "payment_settings": { -< "description": "Payment settings to pass to invoices created by the subscription.", -< "properties": { -< "payment_method_options": { -< "properties": { -< "acss_debit": { -< "anyOf": [ -< { -< "properties": { -< "mandate_options": { -< "properties": { -< "transaction_type": { -< "enum": [ -< "business", -< "personal" -< ], -< "type": "string" -< } -< }, -< "title": "mandate_options_param", -< "type": "object" -< }, -< "verification_method": { -< "enum": [ -< "automatic", -< "instant", -< "microdeposits" -< ], -< "type": "string", -< "x-stripeBypassValidation": true -< } -< }, -< "title": "invoice_payment_method_options_param", -< "type": "object" -< }, -< { -< "enum": [ -< "" -< ], -< "type": "string" -< } -< ] -< }, -< "bancontact": { -< "anyOf": [ -< { -< "properties": { -< "preferred_language": { -< "enum": [ -< "de", -< "en", -< "fr", -< "nl" -< ], -< "type": "string" -< } -< }, -< "title": "invoice_payment_method_options_param", -< "type": "object" -< }, -< { -< "enum": [ -< "" -< ], -< "type": "string" -< } -< ] -< }, -< "card": { -< "anyOf": [ -< { -< "properties": { -< "mandate_options": { -< "properties": { -< "amount": { -< "type": "integer" -< }, -< "amount_type": { -< "enum": [ -< "fixed", -< "maximum" -< ], -< "type": "string" -< }, -< "description": { -< "maxLength": 200, -< "type": "string" -< } -< }, -< "title": "mandate_options_param", -< "type": "object" -< }, -< "network": { -< "enum": [ -< "amex", -< "cartes_bancaires", -< "diners", -< "discover", -< "interac", -< "jcb", -< "mastercard", -< "unionpay", -< "unknown", -< "visa" -< ], -< "maxLength": 5000, -< "type": "string", -< "x-stripeBypassValidation": true -< }, -< "request_three_d_secure": { -< "enum": [ -< "any", -< "automatic" -< ], -< "type": "string" -< } -< }, -< "title": "subscription_payment_method_options_param", -< "type": "object" -< }, -< { -< "enum": [ -< "" -< ], -< "type": "string" -< } -< ] -< }, -< "customer_balance": { -< "anyOf": [ -< { -< "properties": { -< "bank_transfer": { -< "properties": { -< "eu_bank_transfer": { -< "properties": { -< "country": { -< "maxLength": 5000, -< "type": "string" -< } -< }, -< "required": [ -< "country" -< ], -< "title": "eu_bank_transfer_param", -< "type": "object" -< }, -< "type": { -< "type": "string" -< } -< }, -< "title": "bank_transfer_param", -< "type": "object" -< }, -< "funding_type": { -< "type": "string" -< } -< }, -< "title": "invoice_payment_method_options_param", -< "type": "object" -< }, -< { -< "enum": [ -< "" -< ], -< "type": "string" -< } -< ] -< }, -< "konbini": { -< "anyOf": [ -< { -< "properties": {}, -< "title": "invoice_payment_method_options_param", -< "type": "object" -< }, -< { -< "enum": [ -< "" -< ], -< "type": "string" -< } -< ] -< }, -< "us_bank_account": { -< "anyOf": [ -< { -< "properties": { -< "financial_connections": { -< "properties": { -< "permissions": { -< "items": { -< "enum": [ -< "balances", -< "ownership", -< "payment_method", -< "transactions" -< ], -< "maxLength": 5000, -< "type": "string", -< "x-stripeBypassValidation": true -< }, -< "type": "array" -< } -< }, -< "title": "invoice_linked_account_options_param", -< "type": "object" -< }, -< "verification_method": { -< "enum": [ -< "automatic", -< "instant", -< "microdeposits" -< ], -< "type": "string", -< "x-stripeBypassValidation": true -< } -< }, -< "title": "invoice_payment_method_options_param", -< "type": "object" -< }, -< { -< "enum": [ -< "" -< ], -< "type": "string" -< } -< ] -< } -< }, -< "title": "payment_method_options", -< "type": "object" -< }, -< "payment_method_types": { -< "anyOf": [ -< { -< "items": { -< "enum": [ -< "ach_credit_transfer", -< "ach_debit", -< "acss_debit", -< "au_becs_debit", -< "bacs_debit", -< "bancontact", -< "boleto", -< "card", -< "customer_balance", -< "fpx", -< "giropay", -< "grabpay", -< "ideal", -< "konbini", -< "link", -< "paynow", -< "promptpay", -< "sepa_debit", -< "sofort", -< "us_bank_account", -< "wechat_pay" -< ], -< "type": "string", -< "x-stripeBypassValidation": true -< }, -< "type": "array" -< }, -< { -< "enum": [ -< "" -< ], -< "type": "string" -< } -< ] -< }, -< "save_default_payment_method": { -< "enum": [ -< "off", -< "on_subscription" -< ], -< "type": "string" -< } -< }, -< "title": "payment_settings", -< "type": "object" -< }, -< "pending_invoice_item_interval": { -< "anyOf": [ -< { -< "properties": { -< "interval": { -< "enum": [ -< "day", -< "month", -< "week", -< "year" -< ], -< "type": "string" -< }, -< "interval_count": { -< "type": "integer" -< } -< }, -< "required": [ -< "interval" -< ], -< "title": "pending_invoice_item_interval_params", -< "type": "object" -< }, -< { -< "enum": [ -< "" -< ], -< "type": "string" -< } -< ], -< "description": "Specifies an interval for how often to bill for any pending invoice items. It is analogous to calling [Create an invoice](https://stripe.com/docs/api#create_invoice) for the given subscription at the specified interval." -< }, -< "promotion_code": { -< "description": "The promotion code to apply to this subscription. A promotion code applied to a subscription will only affect invoices created for that particular subscription.", -< "maxLength": 5000, -< "type": "string" -< }, -< "proration_behavior": { -< "description": "Determines how to handle [prorations](https://stripe.com/docs/subscriptions/billing-cycle#prorations) when the billing cycle changes (e.g., when switching plans, resetting `billing_cycle_anchor=now`, or starting a trial), or if an item's `quantity` changes.", -< "enum": [ -< "always_invoice", -< "create_prorations", -< "none" -< ], -< "type": "string" -< }, -< "proration_date": { -< "description": "If set, the proration will be calculated as though the subscription was updated at the given time. This can be used to apply exactly the same proration that was previewed with [upcoming invoice](https://stripe.com/docs/api#retrieve_customer_invoice) endpoint. It can also be used to implement custom proration logic, such as prorating by day instead of by second, by providing the time that you wish to use for proration calculations.", -< "format": "unix-time", -< "type": "integer" -< }, -< "transfer_data": { -< "anyOf": [ -< { -< "properties": { -< "amount_percent": { -< "type": "number" -< }, -< "destination": { -< "type": "string" -< } -< }, -< "required": [ -< "destination" -< ], -< "title": "transfer_data_specs", -< "type": "object" -< }, -< { -< "enum": [ -< "" -< ], -< "type": "string" -< } -< ], -< "description": "If specified, the funds from the subscription's invoices will be transferred to the destination and the ID of the resulting transfers will be found on the resulting charges. This will be unset if you POST an empty value." -< }, -< "trial_end": { -< "anyOf": [ -< { -< "enum": [ -< "now" -< ], -< "maxLength": 5000, -< "type": "string" -< }, -< { -< "format": "unix-time", -< "type": "integer" -< } -< ], -< "description": "Unix timestamp representing the end of the trial period the customer will get before being charged for the first time. This will always overwrite any trials that might apply via a subscribed plan. If set, trial_end will override the default trial period of the plan the customer is being subscribed to. The special value `now` can be provided to end the customer's trial immediately. Can be at most two years from `billing_cycle_anchor`." -< }, -< "trial_from_plan": { -< "description": "Indicates if a plan's `trial_period_days` should be applied to the subscription. Setting `trial_end` per subscription is preferred, and this defaults to `false`. Setting this flag to `true` together with `trial_end` is not allowed. See [Using trial periods on subscriptions](https://stripe.com/docs/billing/subscriptions/trials) to learn more.", -< "type": "boolean" -< } -< }, -< "type": "object" -< } -< } -< }, -< "required": false -< }, -< "responses": { -< "200": { -< "content": { -< "application/json": { -< "schema": { -< "$ref": "#/components/schemas/subscription" -< } -< } -< }, -< "description": "Successful response." -< }, -< "default": { -< "content": { -< "application/json": { -< "schema": { -< "$ref": "#/components/schemas/error" -< } -< } -< }, -< "description": "Error response." -< } -< } -< } -< }, -< "/v1/customers/{customer}/subscriptions/{subscription_exposed_id}/discount": { -< "delete": { -< "description": "

Removes the currently applied discount on a customer.

", -< "operationId": "DeleteCustomersCustomerSubscriptionsSubscriptionExposedIdDiscount", -< "parameters": [ -< { -< "in": "path", -< "name": "customer", -< "required": true, -< "schema": { -< "maxLength": 5000, -< "type": "string" -< }, -< "style": "simple" -< }, -< { -< "in": "path", -< "name": "subscription_exposed_id", -< "required": true, -< "schema": { -< "maxLength": 5000, -< "type": "string" -< }, -< "style": "simple" -< } -< ], -< "requestBody": { -< "content": { -< "application/x-www-form-urlencoded": { -< "encoding": {}, -< "schema": { -< "additionalProperties": false, -< "properties": {}, -< "type": "object" -< } -< } -< }, -< "required": false -< }, -< "responses": { -< "200": { -< "content": { -< "application/json": { -< "schema": { -< "$ref": "#/components/schemas/deleted_discount" -< } -< } -< }, -< "description": "Successful response." -< }, -< "default": { -< "content": { -< "application/json": { -< "schema": { -< "$ref": "#/components/schemas/error" -< } -< } -< }, -< "description": "Error response." -< } -< } -< }, -< "get": { -< "description": "", -< "operationId": "GetCustomersCustomerSubscriptionsSubscriptionExposedIdDiscount", -< "parameters": [ -< { -< "in": "path", -< "name": "customer", -< "required": true, -< "schema": { -< "maxLength": 5000, -< "type": "string" -< }, -< "style": "simple" -< }, -< { -< "description": "Specifies which fields in the response should be expanded.", -< "explode": true, -< "in": "query", -< "name": "expand", -< "required": false, -< "schema": { -< "items": { -< "maxLength": 5000, -< "type": "string" -< }, -< "type": "array" -< }, -< "style": "deepObject" -< }, -< { -< "in": "path", -< "name": "subscription_exposed_id", -< "required": true, -< "schema": { -< "maxLength": 5000, -< "type": "string" -< }, -< "style": "simple" -< } -< ], -< "requestBody": { -< "content": { -< "application/x-www-form-urlencoded": { -< "encoding": {}, -< "schema": { -< "additionalProperties": false, -< "properties": {}, -< "type": "object" -< } -< } -< }, -< "required": false -< }, -< "responses": { -< "200": { -< "content": { -< "application/json": { -< "schema": { -< "$ref": "#/components/schemas/discount" -< } -< } -< }, -< "description": "Successful response." -< }, -< "default": { -< "content": { -< "application/json": { -< "schema": { -< "$ref": "#/components/schemas/error" -< } -< } -< }, -< "description": "Error response." -< } -< } -< } -< }, -63387a66489 -> "description": "Minimum value to filter by (exclusive)", -63390a66493 -> "description": "Minimum value to filter by (inclusive)", -63393a66497 -> "description": "Maximum value to filter by (exclusive)", -63396a66501 -> "description": "Maximum value to filter by (inclusive)", -63647a66753 -> "description": "Any server or activity logs showing proof that the customer accessed or downloaded the purchased digital product. This information should include IP addresses, corresponding timestamps, and any detailed recorded activity. Has a maximum character count of 20,000.", -63651a66758 -> "description": "The billing address provided by the customer.", -63655a66763 -> "description": "(ID of a [file upload](https://stripe.com/docs/guides/file-upload)) Your subscription cancellation policy, as shown to the customer.", -63658a66767 -> "description": "An explanation of how and when the customer was shown your refund policy prior to purchase. Has a maximum character count of 20,000.", -63662a66772 -> "description": "A justification for why the customer's subscription was not canceled. Has a maximum character count of 20,000.", -63666a66777 -> "description": "(ID of a [file upload](https://stripe.com/docs/guides/file-upload)) Any communication with the customer that you feel is relevant to your case. Examples include emails proving that the customer received the product or service, or demonstrating their use of or satisfaction with the product or service.", -63669a66781 -> "description": "The email address of the customer.", -63673a66786 -> "description": "The name of the customer.", -63677a66791 -> "description": "The IP address that the customer used when making the purchase.", -63681a66796 -> "description": "(ID of a [file upload](https://stripe.com/docs/guides/file-upload)) A relevant document or contract showing the customer's signature.", -63684a66800 -> "description": "(ID of a [file upload](https://stripe.com/docs/guides/file-upload)) Documentation for the prior charge that can uniquely identify the charge, such as a receipt, shipping label, work order, etc. This document should be paired with a similar document from the disputed payment that proves the two payments are separate.", -63687a66804 -> "description": "An explanation of the difference between the disputed charge versus the prior charge that appears to be a duplicate. Has a maximum character count of 20,000.", -63691a66809 -> "description": "The Stripe ID for the prior charge which appears to be a duplicate of the disputed charge.", -63695a66814 -> "description": "A description of the product or service that was sold. Has a maximum character count of 20,000.", -63699a66819 -> "description": "(ID of a [file upload](https://stripe.com/docs/guides/file-upload)) Any receipt or message sent to the customer notifying them of the charge.", -63702a66823 -> "description": "(ID of a [file upload](https://stripe.com/docs/guides/file-upload)) Your refund policy, as shown to the customer.", -63705a66827 -> "description": "Documentation demonstrating that the customer was shown your refund policy prior to purchase. Has a maximum character count of 20,000.", -63709a66832 -> "description": "A justification for why the customer is not entitled to a refund. Has a maximum character count of 20,000.", -63713a66837 -> "description": "The date on which the customer received or began receiving the purchased service, in a clear human-readable format.", -63717a66842 -> "description": "(ID of a [file upload](https://stripe.com/docs/guides/file-upload)) Documentation showing proof that a service was provided to the customer. This could include a copy of a signed contract, work order, or other form of written agreement.", -63720a66846 -> "description": "The address to which a physical product was shipped. You should try to include as complete address information as possible.", -63724a66851 -> "description": "The delivery service that shipped a physical product, such as Fedex, UPS, USPS, etc. If multiple carriers were used for this purchase, please separate them with commas.", -63728a66856 -> "description": "The date on which a physical product began its route to the shipping address, in a clear human-readable format.", -63732a66861 -> "description": "(ID of a [file upload](https://stripe.com/docs/guides/file-upload)) Documentation showing proof that a product was shipped to the customer at the same address the customer provided to you. This could include a copy of the shipment receipt, shipping label, etc. It should show the customer's full shipping address, if possible.", -63735a66865 -> "description": "The tracking number for a physical product, obtained from the delivery service. If multiple tracking numbers were generated for this purchase, please separate them with commas.", -63739a66870 -> "description": "(ID of a [file upload](https://stripe.com/docs/guides/file-upload)) Any additional evidence or statements.", -63742a66874 -> "description": "Any additional evidence or statements. Has a maximum character count of 20,000.", -64023a67156 -> "description": "Minimum value to filter by (exclusive)", -64026a67160 -> "description": "Minimum value to filter by (inclusive)", -64029a67164 -> "description": "Maximum value to filter by (exclusive)", -64032a67168 -> "description": "Maximum value to filter by (inclusive)", -64479a67616 -> "description": "Minimum value to filter by (exclusive)", -64482a67620 -> "description": "Minimum value to filter by (inclusive)", -64485a67624 -> "description": "Maximum value to filter by (exclusive)", -64488a67628 -> "description": "Maximum value to filter by (inclusive)", -64922a68063 -> "description": "Minimum value to filter by (exclusive)", -64925a68067 -> "description": "Minimum value to filter by (inclusive)", -64928a68071 -> "description": "Maximum value to filter by (exclusive)", -64931a68075 -> "description": "Maximum value to filter by (inclusive)", -65128a68273 -> "description": "Set this to `true` to create a file link for the newly created file. Creating a link is only possible when the file's `purpose` is one of the following: `business_icon`, `business_logo`, `customer_signature`, `dispute_evidence`, `pci_document`, `tax_document_user_upload`, or `terminal_reader_splashscreen`.", -65131a68277 -> "description": "A future timestamp after which the link will no longer be usable.", -65149c68295,68296 -< ] ---- -> ], -> "description": "Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`." -65296a68444 -> "description": "The ID of the Stripe account whose accounts will be retrieved.", -65300a68449 -> "description": "The ID of the Stripe customer whose accounts will be retrieved.", -65842a68992 -> "description": "The ID of the Stripe account whose accounts will be retrieved. Should only be present if `type` is `account`.", -65846a68997 -> "description": "The ID of the Stripe customer whose accounts will be retrieved. Should only be present if `type` is `customer`.", -65850a69002 -> "description": "Type of account holder to collect accounts for.", -65875a69028 -> "description": "List of countries from which to collect accounts.", -66026a69180 -> "description": "Minimum value to filter by (exclusive)", -66029a69184 -> "description": "Minimum value to filter by (inclusive)", -66032a69188 -> "description": "Maximum value to filter by (exclusive)", -66035a69192 -> "description": "Maximum value to filter by (inclusive)", -66278a69436 -> "description": "Minimum value to filter by (exclusive)", -66281a69440 -> "description": "Minimum value to filter by (inclusive)", -66284a69444 -> "description": "Maximum value to filter by (exclusive)", -66287a69448 -> "description": "Maximum value to filter by (inclusive)", -66482a69644 -> "description": "Array of strings of allowed identity document types. If the provided identity document isn’t one of the allowed types, the verification check will fail with a document_type_not_allowed error code.", -66493a69656 -> "description": "Collect an ID number and perform an [ID number check](https://stripe.com/docs/identity/verification-checks?type=id-number) with the document’s extracted name and date of birth.", -66496a69660 -> "description": "Disable image uploads, identity document images have to be captured using the device’s camera.", -66499a69664 -> "description": "Capture a face image and perform a [selfie check](https://stripe.com/docs/identity/verification-checks?type=selfie) comparing a photo ID and a picture of your user’s face. [Learn more](https://stripe.com/docs/identity/selfie).", -66512c69677,69678 -< ] ---- -> ], -> "description": "Options that apply to the [document check](https://stripe.com/docs/identity/verification-checks?type=document)." -66689a69856 -> "description": "Array of strings of allowed identity document types. If the provided identity document isn’t one of the allowed types, the verification check will fail with a document_type_not_allowed error code.", -66700a69868 -> "description": "Collect an ID number and perform an [ID number check](https://stripe.com/docs/identity/verification-checks?type=id-number) with the document’s extracted name and date of birth.", -66703a69872 -> "description": "Disable image uploads, identity document images have to be captured using the device’s camera.", -66706a69876 -> "description": "Capture a face image and perform a [selfie check](https://stripe.com/docs/identity/verification-checks?type=selfie) comparing a photo ID and a picture of your user’s face. [Learn more](https://stripe.com/docs/identity/selfie).", -66719c69889,69890 -< ] ---- -> ], -> "description": "Options that apply to the [document check](https://stripe.com/docs/identity/verification-checks?type=document)." -66913a70085 -> "description": "Minimum value to filter by (exclusive)", -66916a70089 -> "description": "Minimum value to filter by (inclusive)", -66919a70093 -> "description": "Maximum value to filter by (exclusive)", -66922a70097 -> "description": "Maximum value to filter by (inclusive)", -67154a70330 -> "description": "ID of the coupon to create a new discount for.", -67158a70335 -> "description": "ID of an existing discount on the object (or one of its ancestors) to reuse.", -67210a70388 -> "description": "The end of the period, which must be greater than or equal to the start.", -67214a70393 -> "description": "The start of the period.", -67234a70414 -> "description": "Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. Must be a [supported currency](https://stripe.com/docs/currencies).", -67237a70418 -> "description": "The ID of the product that this price will belong to.", -67241a70423 -> "description": "Specifies whether the price is considered inclusive of taxes or exclusive of taxes. One of `inclusive`, `exclusive`, or `unspecified`. Once specified as either `inclusive` or `exclusive`, it cannot be changed.", -67249a70432 -> "description": "A positive integer in cents (or local equivalent) (or 0 for a free price) representing how much to charge.", -67252a70436 -> "description": "Same as `unit_amount`, but accepts a decimal value in cents (or local equivalent) with at most 12 decimal places. Only one of `unit_amount` and `unit_amount_decimal` can be set.", -67534a70719 -> "description": "ID of the coupon to create a new discount for.", -67538a70724 -> "description": "ID of an existing discount on the object (or one of its ancestors) to reuse.", -67585a70772 -> "description": "The end of the period, which must be greater than or equal to the start.", -67589a70777 -> "description": "The start of the period.", -67609a70798 -> "description": "Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. Must be a [supported currency](https://stripe.com/docs/currencies).", -67612a70802 -> "description": "The ID of the product that this price will belong to.", -67616a70807 -> "description": "Specifies whether the price is considered inclusive of taxes or exclusive of taxes. One of `inclusive`, `exclusive`, or `unspecified`. Once specified as either `inclusive` or `exclusive`, it cannot be changed.", -67624a70816 -> "description": "A positive integer in cents (or local equivalent) (or 0 for a free price) representing how much to charge.", -67627a70820 -> "description": "Same as `unit_amount`, but accepts a decimal value in cents (or local equivalent) with at most 12 decimal places. Only one of `unit_amount` and `unit_amount_decimal` can be set.", -67752a70946 -> "description": "Minimum value to filter by (exclusive)", -67755a70950 -> "description": "Minimum value to filter by (inclusive)", -67758a70954 -> "description": "Maximum value to filter by (exclusive)", -67761a70958 -> "description": "Maximum value to filter by (inclusive)", -67795a70993 -> "description": "Minimum value to filter by (exclusive)", -67798a70997 -> "description": "Minimum value to filter by (inclusive)", -67801a71001 -> "description": "Maximum value to filter by (exclusive)", -67804a71005 -> "description": "Maximum value to filter by (inclusive)", -68051a71253 -> "description": "Whether Stripe automatically computes tax on this invoice. Note that incompatible invoice items (invoice items with manually specified [tax rates](https://stripe.com/docs/api/tax_rates), negative amounts, or `tax_behavior=unspecified`) cannot be added to automatic tax invoices.", -68078a71281 -> "description": "The name of the custom field. This may be up to 30 characters.", -68082a71286 -> "description": "The value of the custom field. This may be up to 30 characters.", -68142a71347 -> "description": "ID of the coupon to create a new discount for.", -68146a71352 -> "description": "ID of an existing discount on the object (or one of its ancestors) to reuse.", -68186a71393 -> "description": "The relation between the new invoice and the original invoice. Currently, only 'revision' is permitted", -68193a71401 -> "description": "The `id` of the invoice that will be cloned.", -68229a71438 -> "description": "ID of the mandate to be used for this invoice. It must correspond to the payment method used to pay the invoice, including the invoice's default_payment_method or default_source, if set.", -68233a71443 -> "description": "Payment-method-specific configuration to provide to the invoice’s PaymentIntent.", -68239a71450 -> "description": "Additional fields for Mandate creation", -68241a71453 -> "description": "Transaction type of the mandate.", -68252a71465 -> "description": "Verification method for the intent", -68271c71484,71485 -< ] ---- -> ], -> "description": "If paying by `acss_debit`, this sub-hash contains details about the Canadian pre-authorized debit payment method options to pass to the invoice’s PaymentIntent." -68277a71492 -> "description": "Preferred language of the Bancontact authorization page that the customer is redirected to.", -68296c71511,71512 -< ] ---- -> ], -> "description": "If paying by `bancontact`, this sub-hash contains details about the Bancontact payment method options to pass to the invoice’s PaymentIntent." -68302a71519 -> "description": "Installment configuration for payments attempted on this invoice (Mexico Only).\n\nFor more information, see the [installments integration guide](https://stripe.com/docs/payments/installments).", -68304a71522 -> "description": "Setting to true enables installments for this invoice.\nSetting to false will prevent any selected plan from applying to a payment.", -68311a71530 -> "description": "For `fixed_count` installment plans, this is the number of installment payments your customer will make to their credit card.", -68314a71534 -> "description": "For `fixed_count` installment plans, this is the interval between installment payments your customer will make to their credit card.\nOne of `month`.", -68320a71541 -> "description": "Type of installment plan, one of `fixed_count`.", -68341c71562,71563 -< ] ---- -> ], -> "description": "The selected installment plan to use for this invoice." -68347a71570 -> "description": "We strongly recommend that you rely on our SCA Engine to automatically prompt your customers for authentication based on risk level and [other requirements](https://stripe.com/docs/strong-customer-authentication). However, if you wish to request 3D Secure based on logic from your own fraud engine, provide this option. Read our guide on [manually requesting 3D Secure](https://stripe.com/docs/payments/3d-secure#manual-three-ds) for more information on how this configuration interacts with Radar and our SCA Engine.", -68364c71587,71588 -< ] ---- -> ], -> "description": "If paying by `card`, this sub-hash contains details about the Card payment method options to pass to the invoice’s PaymentIntent." -68370a71595 -> "description": "Configuration for the bank transfer funding type, if the `funding_type` is set to `bank_transfer`.", -68372a71598 -> "description": "Configuration for eu_bank_transfer funding type.", -68374a71601 -> "description": "The desired country code of the bank account information. Permitted values include: `DE`, `ES`, `FR`, `IE`, or `NL`.", -68385a71613 -> "description": "The bank transfer type that can be used for funding. Permitted values include: `eu_bank_transfer`, `gb_bank_transfer`, `jp_bank_transfer`, or `mx_bank_transfer`.", -68392a71621 -> "description": "The funding method type to be used when there are not enough funds in the customer balance. Permitted values include: `bank_transfer`.", -68405c71634,71635 -< ] ---- -> ], -> "description": "If paying by `customer_balance`, this sub-hash contains details about the Bank transfer payment method options to pass to the invoice’s PaymentIntent." -68420c71650,71651 -< ] ---- -> ], -> "description": "If paying by `konbini`, this sub-hash contains details about the Konbini payment method options to pass to the invoice’s PaymentIntent." -68426a71658 -> "description": "Additional fields for Financial Connections Session creation", -68428a71661 -> "description": "The list of permissions to request. If this parameter is passed, the `payment_method` permission must be included. Valid permissions include: `balances`, `ownership`, `payment_method`, and `transactions`.", -68446a71680 -> "description": "Verification method for the intent", -68465c71699,71700 -< ] ---- -> ], -> "description": "If paying by `us_bank_account`, this sub-hash contains details about the ACH direct debit payment method options to pass to the invoice’s PaymentIntent." -68492a71728 -> "sepa_credit_transfer", -68509c71745,71746 -< ] ---- -> ], -> "description": "The list of payment method types (e.g. card) to provide to the invoice’s PaymentIntent. If not set, Stripe attempts to automatically determine the types to use by looking at the invoice’s default payment method, the subscription’s default payment method, the customer’s default payment method, and your [invoice template settings](https://dashboard.stripe.com/settings/billing/invoice)." -68528a71766 -> "description": "How line-item prices and amounts will be displayed with respect to tax on invoice PDFs. One of `exclude_tax` or `include_inclusive_tax`. `include_inclusive_tax` will include inclusive tax (and exclude exclusive tax) in invoice PDF amounts. `exclude_tax` will exclude all tax (inclusive and exclusive alike) from invoice PDF amounts.", -68562a71801 -> "description": "The amount that will be transferred automatically when the invoice is paid. If no amount is set, the full amount is transferred.", -68565a71805 -> "description": "ID of an existing, connected Stripe account.", -68711a71952 -> "next_page", -68751a71993 -> "description": "Whether Stripe automatically computes tax on this invoice. Note that incompatible invoice items (invoice items with manually specified [tax rates](https://stripe.com/docs/api/tax_rates), negative amounts, or `tax_behavior=unspecified`) cannot be added to automatic tax invoices.", -68807a72050 -> "description": "City, district, suburb, town, or village.", -68811a72055 -> "description": "Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)).", -68815a72060 -> "description": "Address line 1 (e.g., street, PO Box, or company name).", -68819a72065 -> "description": "Address line 2 (e.g., apartment, suite, unit, or building).", -68823a72070 -> "description": "ZIP or postal code.", -68827a72075 -> "description": "State, county, province, or region.", -68841c72089,72090 -< ] ---- -> ], -> "description": "The customer's address." -68847a72097 -> "description": "Customer shipping address.", -68849a72100 -> "description": "City, district, suburb, town, or village.", -68853a72105 -> "description": "Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)).", -68857a72110 -> "description": "Address line 1 (e.g., street, PO Box, or company name).", -68861a72115 -> "description": "Address line 2 (e.g., apartment, suite, unit, or building).", -68865a72120 -> "description": "ZIP or postal code.", -68869a72125 -> "description": "State, county, province, or region.", -68877a72134 -> "description": "Customer name.", -68881a72139 -> "description": "Customer phone (including extension).", -68899c72157,72158 -< ] ---- -> ], -> "description": "The customer's shipping information. Appears on invoices emailed to this customer." -68901a72161 -> "description": "Tax details about the customer.", -68914c72174,72175 -< ] ---- -> ], -> "description": "A recent IP address of the customer used for tax reporting and tax location inference. Stripe recommends updating the IP address when a new PaymentMethod is attached or the address field on the customer is updated. We recommend against updating this field more frequently since it could result in unexpected tax location/reporting outcomes." -68920a72182 -> "description": "The customer's tax exemption. One of `none`, `exempt`, or `reverse`.", -68929a72192 -> "description": "The customer's tax IDs.", -68932a72196 -> "description": "Type of the tax ID, one of `ae_trn`, `au_abn`, `au_arn`, `bg_uic`, `br_cnpj`, `br_cpf`, `ca_bn`, `ca_gst_hst`, `ca_pst_bc`, `ca_pst_mb`, `ca_pst_sk`, `ca_qst`, `ch_vat`, `cl_tin`, `eg_tin`, `es_cif`, `eu_oss_vat`, `eu_vat`, `gb_vat`, `ge_vat`, `hk_br`, `hu_tin`, `id_npwp`, `il_vat`, `in_gst`, `is_vat`, `jp_cn`, `jp_rn`, `jp_trn`, `ke_pin`, `kr_brn`, `li_uid`, `mx_rfc`, `my_frp`, `my_itn`, `my_sst`, `no_vat`, `nz_gst`, `ph_tin`, `ru_inn`, `ru_kpp`, `sa_vat`, `sg_gst`, `sg_uen`, `si_tin`, `th_vat`, `tr_tin`, `tw_vat`, `ua_vat`, `us_ein`, or `za_vat`", -68990a72255 -> "description": "Value of the tax ID.", -69020a72286 -> "description": "ID of the coupon to create a new discount for.", -69024a72291 -> "description": "ID of an existing discount on the object (or one of its ancestors) to reuse.", -69068a72336 -> "description": "The integer amount in cents (or local equivalent) of previewed invoice item.", -69071a72340 -> "description": "Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. Must be a [supported currency](https://stripe.com/docs/currencies). Only applicable to new invoice items.", -69074a72344 -> "description": "An arbitrary string which you can attach to the invoice item. The description is displayed in the invoice for easy tracking.", -69078a72349 -> "description": "Explicitly controls whether discounts apply to this invoice item. Defaults to true, except for negative invoice items.", -69086a72358 -> "description": "ID of the coupon to create a new discount for.", -69090a72363 -> "description": "ID of an existing discount on the object (or one of its ancestors) to reuse.", -69106c72379,72380 -< ] ---- -> ], -> "description": "The coupons to redeem into discounts for the invoice item in the preview." -69108a72383 -> "description": "The ID of the invoice item to update in preview. If not specified, a new invoice item will be added to the preview of the upcoming invoice.", -69126c72401,72402 -< ] ---- -> ], -> "description": "Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`." -69128a72405 -> "description": "The period associated with this invoice item. When set to different values, the period will be rendered on the invoice.", -69130a72408 -> "description": "The end of the period, which must be greater than or equal to the start.", -69134a72413 -> "description": "The start of the period.", -69146a72426 -> "description": "The ID of the price object.", -69150a72431 -> "description": "Data used to generate a new [Price](https://stripe.com/docs/api/prices) object inline.", -69152a72434 -> "description": "Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. Must be a [supported currency](https://stripe.com/docs/currencies).", -69155a72438 -> "description": "The ID of the product that this price will belong to.", -69159a72443 -> "description": "Specifies whether the price is considered inclusive of taxes or exclusive of taxes. One of `inclusive`, `exclusive`, or `unspecified`. Once specified as either `inclusive` or `exclusive`, it cannot be changed.", -69167a72452 -> "description": "A positive integer in cents (or local equivalent) (or 0 for a free price) representing how much to charge.", -69170a72456 -> "description": "Same as `unit_amount`, but accepts a decimal value in cents (or local equivalent) with at most 12 decimal places. Only one of `unit_amount` and `unit_amount_decimal` can be set.", -69182a72469 -> "description": "Non-negative integer. The quantity of units for the invoice item.", -69185a72473 -> "description": "Specifies whether the price is considered inclusive of taxes or exclusive of taxes. One of `inclusive`, `exclusive`, or `unspecified`. Once specified as either `inclusive` or `exclusive`, it cannot be changed.", -69204c72492,72493 -< ] ---- -> ], -> "description": "A [tax code](https://stripe.com/docs/tax/tax-categories) ID." -69221c72510,72511 -< ] ---- -> ], -> "description": "The tax rates that apply to the item. When set, any `default_tax_rates` do not apply to this item." -69223a72514 -> "description": "The integer unit amount in cents (or local equivalent) of the charge to be applied to the upcoming invoice. This unit_amount will be multiplied by the quantity to get the full amount. If you want to apply a credit to the customer's account, pass a negative unit_amount.", -69226a72518 -> "description": "Same as `unit_amount`, but accepts a decimal value in cents (or local equivalent) with at most 12 decimal places. Only one of `unit_amount` and `unit_amount_decimal` can be set.", -69364a72657 -> "description": "Usage threshold that triggers the subscription to advance to a new billing period", -69380c72673,72674 -< ] ---- -> ], -> "description": "Define thresholds at which an invoice will be sent, and the subscription advanced to a new billing period. When updating, pass an empty string to remove previously-defined thresholds." -69382a72677 -> "description": "Delete all usage for a given subscription item. Allowed only when `deleted` is set to `true` and the current plan's `usage_type` is `metered`.", -69385a72681 -> "description": "A flag that, if set to `true`, will delete the specified item.", -69388a72685 -> "description": "Subscription item to update.", -69406c72703,72709 -< ] ---- -> ], -> "description": "Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`." -> }, -> "plan": { -> "description": "Plan ID for this item, as a string.", -> "maxLength": 5000, -> "type": "string" -69408a72712 -> "description": "The ID of the price object. When changing a subscription item's price, `quantity` is set to 1 unless a `quantity` parameter is provided.", -69412a72717 -> "description": "Data used to generate a new [Price](https://stripe.com/docs/api/prices) object inline.", -69414a72720 -> "description": "Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. Must be a [supported currency](https://stripe.com/docs/currencies).", -69417a72724 -> "description": "The ID of the product that this price will belong to.", -69421a72729 -> "description": "The recurring components of a price such as `interval` and `interval_count`.", -69423a72732 -> "description": "Specifies billing frequency. Either `day`, `week`, `month` or `year`.", -69432a72742 -> "description": "The number of intervals between subscription billings. For example, `interval=month` and `interval_count=3` bills every 3 months. Maximum of one year interval allowed (1 year, 12 months, or 52 weeks).", -69442a72753 -> "description": "Specifies whether the price is considered inclusive of taxes or exclusive of taxes. One of `inclusive`, `exclusive`, or `unspecified`. Once specified as either `inclusive` or `exclusive`, it cannot be changed.", -69450a72762 -> "description": "A positive integer in cents (or local equivalent) (or 0 for a free price) representing how much to charge.", -69453a72766 -> "description": "Same as `unit_amount`, but accepts a decimal value in cents (or local equivalent) with at most 12 decimal places. Only one of `unit_amount` and `unit_amount_decimal` can be set.", -69466a72780 -> "description": "Quantity for this item.", -69484c72798,72799 -< ] ---- -> ], -> "description": "A list of [Tax Rate](https://stripe.com/docs/api/tax_rates) ids. These Tax Rates will override the [`default_tax_rates`](https://stripe.com/docs/api/subscriptions/create#create_subscription-default_tax_rates) on the Subscription. When updating, pass an empty string to remove previously-defined tax rates." -69615a72931 -> "description": "Whether Stripe automatically computes tax on this invoice. Note that incompatible invoice items (invoice items with manually specified [tax rates](https://stripe.com/docs/api/tax_rates), negative amounts, or `tax_behavior=unspecified`) cannot be added to automatic tax invoices.", -69671a72988 -> "description": "City, district, suburb, town, or village.", -69675a72993 -> "description": "Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)).", -69679a72998 -> "description": "Address line 1 (e.g., street, PO Box, or company name).", -69683a73003 -> "description": "Address line 2 (e.g., apartment, suite, unit, or building).", -69687a73008 -> "description": "ZIP or postal code.", -69691a73013 -> "description": "State, county, province, or region.", -69705c73027,73028 -< ] ---- -> ], -> "description": "The customer's address." -69711a73035 -> "description": "Customer shipping address.", -69713a73038 -> "description": "City, district, suburb, town, or village.", -69717a73043 -> "description": "Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)).", -69721a73048 -> "description": "Address line 1 (e.g., street, PO Box, or company name).", -69725a73053 -> "description": "Address line 2 (e.g., apartment, suite, unit, or building).", -69729a73058 -> "description": "ZIP or postal code.", -69733a73063 -> "description": "State, county, province, or region.", -69741a73072 -> "description": "Customer name.", -69745a73077 -> "description": "Customer phone (including extension).", -69763c73095,73096 -< ] ---- -> ], -> "description": "The customer's shipping information. Appears on invoices emailed to this customer." -69765a73099 -> "description": "Tax details about the customer.", -69778c73112,73113 -< ] ---- -> ], -> "description": "A recent IP address of the customer used for tax reporting and tax location inference. Stripe recommends updating the IP address when a new PaymentMethod is attached or the address field on the customer is updated. We recommend against updating this field more frequently since it could result in unexpected tax location/reporting outcomes." -69784a73120 -> "description": "The customer's tax exemption. One of `none`, `exempt`, or `reverse`.", -69793a73130 -> "description": "The customer's tax IDs.", -69796a73134 -> "description": "Type of the tax ID, one of `ae_trn`, `au_abn`, `au_arn`, `bg_uic`, `br_cnpj`, `br_cpf`, `ca_bn`, `ca_gst_hst`, `ca_pst_bc`, `ca_pst_mb`, `ca_pst_sk`, `ca_qst`, `ch_vat`, `cl_tin`, `eg_tin`, `es_cif`, `eu_oss_vat`, `eu_vat`, `gb_vat`, `ge_vat`, `hk_br`, `hu_tin`, `id_npwp`, `il_vat`, `in_gst`, `is_vat`, `jp_cn`, `jp_rn`, `jp_trn`, `ke_pin`, `kr_brn`, `li_uid`, `mx_rfc`, `my_frp`, `my_itn`, `my_sst`, `no_vat`, `nz_gst`, `ph_tin`, `ru_inn`, `ru_kpp`, `sa_vat`, `sg_gst`, `sg_uen`, `si_tin`, `th_vat`, `tr_tin`, `tw_vat`, `ua_vat`, `us_ein`, or `za_vat`", -69854a73193 -> "description": "Value of the tax ID.", -69884a73224 -> "description": "ID of the coupon to create a new discount for.", -69888a73229 -> "description": "ID of an existing discount on the object (or one of its ancestors) to reuse.", -69943a73285 -> "description": "The integer amount in cents (or local equivalent) of previewed invoice item.", -69946a73289 -> "description": "Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. Must be a [supported currency](https://stripe.com/docs/currencies). Only applicable to new invoice items.", -69949a73293 -> "description": "An arbitrary string which you can attach to the invoice item. The description is displayed in the invoice for easy tracking.", -69953a73298 -> "description": "Explicitly controls whether discounts apply to this invoice item. Defaults to true, except for negative invoice items.", -69961a73307 -> "description": "ID of the coupon to create a new discount for.", -69965a73312 -> "description": "ID of an existing discount on the object (or one of its ancestors) to reuse.", -69981c73328,73329 -< ] ---- -> ], -> "description": "The coupons to redeem into discounts for the invoice item in the preview." -69983a73332 -> "description": "The ID of the invoice item to update in preview. If not specified, a new invoice item will be added to the preview of the upcoming invoice.", -70001c73350,73351 -< ] ---- -> ], -> "description": "Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`." -70003a73354 -> "description": "The period associated with this invoice item. When set to different values, the period will be rendered on the invoice.", -70005a73357 -> "description": "The end of the period, which must be greater than or equal to the start.", -70009a73362 -> "description": "The start of the period.", -70021a73375 -> "description": "The ID of the price object.", -70025a73380 -> "description": "Data used to generate a new [Price](https://stripe.com/docs/api/prices) object inline.", -70027a73383 -> "description": "Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. Must be a [supported currency](https://stripe.com/docs/currencies).", -70030a73387 -> "description": "The ID of the product that this price will belong to.", -70034a73392 -> "description": "Specifies whether the price is considered inclusive of taxes or exclusive of taxes. One of `inclusive`, `exclusive`, or `unspecified`. Once specified as either `inclusive` or `exclusive`, it cannot be changed.", -70042a73401 -> "description": "A positive integer in cents (or local equivalent) (or 0 for a free price) representing how much to charge.", -70045a73405 -> "description": "Same as `unit_amount`, but accepts a decimal value in cents (or local equivalent) with at most 12 decimal places. Only one of `unit_amount` and `unit_amount_decimal` can be set.", -70057a73418 -> "description": "Non-negative integer. The quantity of units for the invoice item.", -70060a73422 -> "description": "Specifies whether the price is considered inclusive of taxes or exclusive of taxes. One of `inclusive`, `exclusive`, or `unspecified`. Once specified as either `inclusive` or `exclusive`, it cannot be changed.", -70079c73441,73442 -< ] ---- -> ], -> "description": "A [tax code](https://stripe.com/docs/tax/tax-categories) ID." -70096c73459,73460 -< ] ---- -> ], -> "description": "The tax rates that apply to the item. When set, any `default_tax_rates` do not apply to this item." -70098a73463 -> "description": "The integer unit amount in cents (or local equivalent) of the charge to be applied to the upcoming invoice. This unit_amount will be multiplied by the quantity to get the full amount. If you want to apply a credit to the customer's account, pass a negative unit_amount.", -70101a73467 -> "description": "Same as `unit_amount`, but accepts a decimal value in cents (or local equivalent) with at most 12 decimal places. Only one of `unit_amount` and `unit_amount_decimal` can be set.", -70260a73627 -> "description": "Usage threshold that triggers the subscription to advance to a new billing period", -70276c73643,73644 -< ] ---- -> ], -> "description": "Define thresholds at which an invoice will be sent, and the subscription advanced to a new billing period. When updating, pass an empty string to remove previously-defined thresholds." -70278a73647 -> "description": "Delete all usage for a given subscription item. Allowed only when `deleted` is set to `true` and the current plan's `usage_type` is `metered`.", -70281a73651 -> "description": "A flag that, if set to `true`, will delete the specified item.", -70284a73655 -> "description": "Subscription item to update.", -70302c73673,73679 -< ] ---- -> ], -> "description": "Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`." -> }, -> "plan": { -> "description": "Plan ID for this item, as a string.", -> "maxLength": 5000, -> "type": "string" -70304a73682 -> "description": "The ID of the price object. When changing a subscription item's price, `quantity` is set to 1 unless a `quantity` parameter is provided.", -70308a73687 -> "description": "Data used to generate a new [Price](https://stripe.com/docs/api/prices) object inline.", -70310a73690 -> "description": "Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. Must be a [supported currency](https://stripe.com/docs/currencies).", -70313a73694 -> "description": "The ID of the product that this price will belong to.", -70317a73699 -> "description": "The recurring components of a price such as `interval` and `interval_count`.", -70319a73702 -> "description": "Specifies billing frequency. Either `day`, `week`, `month` or `year`.", -70328a73712 -> "description": "The number of intervals between subscription billings. For example, `interval=month` and `interval_count=3` bills every 3 months. Maximum of one year interval allowed (1 year, 12 months, or 52 weeks).", -70338a73723 -> "description": "Specifies whether the price is considered inclusive of taxes or exclusive of taxes. One of `inclusive`, `exclusive`, or `unspecified`. Once specified as either `inclusive` or `exclusive`, it cannot be changed.", -70346a73732 -> "description": "A positive integer in cents (or local equivalent) (or 0 for a free price) representing how much to charge.", -70349a73736 -> "description": "Same as `unit_amount`, but accepts a decimal value in cents (or local equivalent) with at most 12 decimal places. Only one of `unit_amount` and `unit_amount_decimal` can be set.", -70362a73750 -> "description": "Quantity for this item.", -70380c73768,73769 -< ] ---- -> ], -> "description": "A list of [Tax Rate](https://stripe.com/docs/api/tax_rates) ids. These Tax Rates will override the [`default_tax_rates`](https://stripe.com/docs/api/subscriptions/create#create_subscription-default_tax_rates) on the Subscription. When updating, pass an empty string to remove previously-defined tax rates." -70748a74138 -> "description": "Whether Stripe automatically computes tax on this invoice. Note that incompatible invoice items (invoice items with manually specified [tax rates](https://stripe.com/docs/api/tax_rates), negative amounts, or `tax_behavior=unspecified`) cannot be added to automatic tax invoices.", -70771a74162 -> "description": "The name of the custom field. This may be up to 30 characters.", -70775a74167 -> "description": "The value of the custom field. This may be up to 30 characters.", -70840a74233 -> "description": "ID of the coupon to create a new discount for.", -70844a74238 -> "description": "ID of an existing discount on the object (or one of its ancestors) to reuse.", -70915a74310 -> "description": "ID of the mandate to be used for this invoice. It must correspond to the payment method used to pay the invoice, including the invoice's default_payment_method or default_source, if set.", -70919a74315 -> "description": "Payment-method-specific configuration to provide to the invoice’s PaymentIntent.", -70925a74322 -> "description": "Additional fields for Mandate creation", -70927a74325 -> "description": "Transaction type of the mandate.", -70938a74337 -> "description": "Verification method for the intent", -70957c74356,74357 -< ] ---- -> ], -> "description": "If paying by `acss_debit`, this sub-hash contains details about the Canadian pre-authorized debit payment method options to pass to the invoice’s PaymentIntent." -70963a74364 -> "description": "Preferred language of the Bancontact authorization page that the customer is redirected to.", -70982c74383,74384 -< ] ---- -> ], -> "description": "If paying by `bancontact`, this sub-hash contains details about the Bancontact payment method options to pass to the invoice’s PaymentIntent." -70988a74391 -> "description": "Installment configuration for payments attempted on this invoice (Mexico Only).\n\nFor more information, see the [installments integration guide](https://stripe.com/docs/payments/installments).", -70990a74394 -> "description": "Setting to true enables installments for this invoice.\nSetting to false will prevent any selected plan from applying to a payment.", -70997a74402 -> "description": "For `fixed_count` installment plans, this is the number of installment payments your customer will make to their credit card.", -71000a74406 -> "description": "For `fixed_count` installment plans, this is the interval between installment payments your customer will make to their credit card.\nOne of `month`.", -71006a74413 -> "description": "Type of installment plan, one of `fixed_count`.", -71027c74434,74435 -< ] ---- -> ], -> "description": "The selected installment plan to use for this invoice." -71033a74442 -> "description": "We strongly recommend that you rely on our SCA Engine to automatically prompt your customers for authentication based on risk level and [other requirements](https://stripe.com/docs/strong-customer-authentication). However, if you wish to request 3D Secure based on logic from your own fraud engine, provide this option. Read our guide on [manually requesting 3D Secure](https://stripe.com/docs/payments/3d-secure#manual-three-ds) for more information on how this configuration interacts with Radar and our SCA Engine.", -71050c74459,74460 -< ] ---- -> ], -> "description": "If paying by `card`, this sub-hash contains details about the Card payment method options to pass to the invoice’s PaymentIntent." -71056a74467 -> "description": "Configuration for the bank transfer funding type, if the `funding_type` is set to `bank_transfer`.", -71058a74470 -> "description": "Configuration for eu_bank_transfer funding type.", -71060a74473 -> "description": "The desired country code of the bank account information. Permitted values include: `DE`, `ES`, `FR`, `IE`, or `NL`.", -71071a74485 -> "description": "The bank transfer type that can be used for funding. Permitted values include: `eu_bank_transfer`, `gb_bank_transfer`, `jp_bank_transfer`, or `mx_bank_transfer`.", -71078a74493 -> "description": "The funding method type to be used when there are not enough funds in the customer balance. Permitted values include: `bank_transfer`.", -71091c74506,74507 -< ] ---- -> ], -> "description": "If paying by `customer_balance`, this sub-hash contains details about the Bank transfer payment method options to pass to the invoice’s PaymentIntent." -71106c74522,74523 -< ] ---- -> ], -> "description": "If paying by `konbini`, this sub-hash contains details about the Konbini payment method options to pass to the invoice’s PaymentIntent." -71112a74530 -> "description": "Additional fields for Financial Connections Session creation", -71114a74533 -> "description": "The list of permissions to request. If this parameter is passed, the `payment_method` permission must be included. Valid permissions include: `balances`, `ownership`, `payment_method`, and `transactions`.", -71132a74552 -> "description": "Verification method for the intent", -71151c74571,74572 -< ] ---- -> ], -> "description": "If paying by `us_bank_account`, this sub-hash contains details about the ACH direct debit payment method options to pass to the invoice’s PaymentIntent." -71178a74600 -> "sepa_credit_transfer", -71195c74617,74618 -< ] ---- -> ], -> "description": "The list of payment method types (e.g. card) to provide to the invoice’s PaymentIntent. If not set, Stripe attempts to automatically determine the types to use by looking at the invoice’s default payment method, the subscription’s default payment method, the customer’s default payment method, and your [invoice template settings](https://dashboard.stripe.com/settings/billing/invoice)." -71205a74629 -> "description": "How line-item prices and amounts will be displayed with respect to tax on invoice PDFs. One of `exclude_tax` or `include_inclusive_tax`. `include_inclusive_tax` will include inclusive tax (and exclude exclusive tax) in invoice PDF amounts. `exclude_tax` will exclude all tax (inclusive and exclusive alike) from invoice PDF amounts.", -71235a74660 -> "description": "The amount that will be transferred automatically when the invoice is paid. If no amount is set, the full amount is transferred.", -71238a74664 -> "description": "ID of an existing, connected Stripe account.", -71827a75254 -> "description": "Minimum value to filter by (exclusive)", -71830a75258 -> "description": "Minimum value to filter by (inclusive)", -71833a75262 -> "description": "Maximum value to filter by (exclusive)", -71836a75266 -> "description": "Maximum value to filter by (inclusive)", -72335a75766 -> "description": "Minimum value to filter by (exclusive)", -72338a75770 -> "description": "Minimum value to filter by (inclusive)", -72341a75774 -> "description": "Maximum value to filter by (exclusive)", -72344a75778 -> "description": "Maximum value to filter by (inclusive)", -72566a76001 -> "description": "The cardholder’s billing address.", -72568a76004 -> "description": "City, district, suburb, town, or village.", -72572a76009 -> "description": "Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)).", -72576a76014 -> "description": "Address line 1 (e.g., street, PO Box, or company name).", -72580a76019 -> "description": "Address line 2 (e.g., apartment, suite, unit, or building).", -72584a76024 -> "description": "ZIP or postal code.", -72588a76029 -> "description": "State, county, province, or region.", -72612a76054 -> "description": "The entity's business ID number.", -72635a76078 -> "description": "The date of birth of this cardholder.", -72637a76081 -> "description": "The day of birth, between 1 and 31.", -72640a76085 -> "description": "The month of birth, between 1 and 12.", -72643a76089 -> "description": "The four-digit year of birth.", -72655a76102 -> "description": "The first name of this cardholder. This field cannot contain any special characters or numbers.", -72658a76106 -> "description": "The last name of this cardholder. This field cannot contain any special characters or numbers.", -72661a76110 -> "description": "Government-issued ID document for this cardholder.", -72663a76113 -> "description": "An identifying document, either a passport or local ID card.", -72665a76116 -> "description": "The back of an ID returned by a [file upload](https://stripe.com/docs/api#create_file) with a `purpose` value of `identity_document`.", -72669a76121 -> "description": "The front of an ID returned by a [file upload](https://stripe.com/docs/api#create_file) with a `purpose` value of `identity_document`.", -72707a76160 -> "description": "Array of strings containing [categories](https://stripe.com/docs/api#issuing_authorization_object-merchant_data-category) of authorizations to allow. All other categories will be blocked. Cannot be set with `blocked_categories`.", -73004a76458 -> "description": "Array of strings containing [categories](https://stripe.com/docs/api#issuing_authorization_object-merchant_data-category) of authorizations to decline. All other categories will be allowed. Cannot be set with `allowed_categories`.", -73301a76756 -> "description": "Limit spending with amount-based rules that apply across this cardholder's cards.", -73304a76760 -> "description": "Maximum amount allowed to spend per interval.", -73307a76764 -> "description": "Array of strings containing [categories](https://stripe.com/docs/api#issuing_authorization_object-merchant_data-category) this limit applies to. Omitting this field will apply the limit to all categories.", -73604a77062 -> "description": "Interval (or event) to which the amount applies.", -73625a77084 -> "description": "Currency of amounts within `spending_limits`. Defaults to your merchant country's currency.", -73802a77262 -> "description": "The cardholder’s billing address.", -73804a77265 -> "description": "City, district, suburb, town, or village.", -73808a77270 -> "description": "Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)).", -73812a77275 -> "description": "Address line 1 (e.g., street, PO Box, or company name).", -73816a77280 -> "description": "Address line 2 (e.g., apartment, suite, unit, or building).", -73820a77285 -> "description": "ZIP or postal code.", -73824a77290 -> "description": "State, county, province, or region.", -73848a77315 -> "description": "The entity's business ID number.", -73871a77339 -> "description": "The date of birth of this cardholder.", -73873a77342 -> "description": "The day of birth, between 1 and 31.", -73876a77346 -> "description": "The month of birth, between 1 and 12.", -73879a77350 -> "description": "The four-digit year of birth.", -73891a77363 -> "description": "The first name of this cardholder. This field cannot contain any special characters or numbers.", -73894a77367 -> "description": "The last name of this cardholder. This field cannot contain any special characters or numbers.", -73897a77371 -> "description": "Government-issued ID document for this cardholder.", -73899a77374 -> "description": "An identifying document, either a passport or local ID card.", -73901a77377 -> "description": "The back of an ID returned by a [file upload](https://stripe.com/docs/api#create_file) with a `purpose` value of `identity_document`.", -73905a77382 -> "description": "The front of an ID returned by a [file upload](https://stripe.com/docs/api#create_file) with a `purpose` value of `identity_document`.", -73939a77417 -> "description": "Array of strings containing [categories](https://stripe.com/docs/api#issuing_authorization_object-merchant_data-category) of authorizations to allow. All other categories will be blocked. Cannot be set with `blocked_categories`.", -74236a77715 -> "description": "Array of strings containing [categories](https://stripe.com/docs/api#issuing_authorization_object-merchant_data-category) of authorizations to decline. All other categories will be allowed. Cannot be set with `allowed_categories`.", -74533a78013 -> "description": "Limit spending with amount-based rules that apply across this cardholder's cards.", -74536a78017 -> "description": "Maximum amount allowed to spend per interval.", -74539a78021 -> "description": "Array of strings containing [categories](https://stripe.com/docs/api#issuing_authorization_object-merchant_data-category) this limit applies to. Omitting this field will apply the limit to all categories.", -74836a78319 -> "description": "Interval (or event) to which the amount applies.", -74857a78341 -> "description": "Currency of amounts within `spending_limits`. Defaults to your merchant country's currency.", -74929a78414 -> "description": "Minimum value to filter by (exclusive)", -74932a78418 -> "description": "Minimum value to filter by (inclusive)", -74935a78422 -> "description": "Maximum value to filter by (exclusive)", -74938a78426 -> "description": "Maximum value to filter by (inclusive)", -75206a78695 -> "description": "The address that the card is shipped to.", -75208a78698 -> "description": "City, district, suburb, town, or village.", -75212a78703 -> "description": "Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)).", -75216a78708 -> "description": "Address line 1 (e.g., street, PO Box, or company name).", -75220a78713 -> "description": "Address line 2 (e.g., apartment, suite, unit, or building).", -75224a78718 -> "description": "ZIP or postal code.", -75228a78723 -> "description": "State, county, province, or region.", -75242a78738 -> "description": "Customs information for the shipment.", -75244a78741 -> "description": "The Economic Operators Registration and Identification (EORI) number to use for Customs. Required for bulk shipments to Europe.", -75252a78750 -> "description": "The name printed on the shipping label when shipping the card.", -75256a78755 -> "description": "Phone number of the recipient of the shipment.", -75259a78759 -> "description": "Whether a signature is required for card delivery.", -75262a78763 -> "description": "Shipment service.", -75271a78773 -> "description": "Packaging options.", -75289a78792 -> "description": "Array of strings containing [categories](https://stripe.com/docs/api#issuing_authorization_object-merchant_data-category) of authorizations to allow. All other categories will be blocked. Cannot be set with `blocked_categories`.", -75586a79090 -> "description": "Array of strings containing [categories](https://stripe.com/docs/api#issuing_authorization_object-merchant_data-category) of authorizations to decline. All other categories will be allowed. Cannot be set with `allowed_categories`.", -75883a79388 -> "description": "Limit spending with amount-based rules that apply across any cards this card replaced (i.e., its `replacement_for` card and _that_ card's `replacement_for` card, up the chain).", -75886a79392 -> "description": "Maximum amount allowed to spend per interval.", -75889a79396 -> "description": "Array of strings containing [categories](https://stripe.com/docs/api#issuing_authorization_object-merchant_data-category) this limit applies to. Omitting this field will apply the limit to all categories.", -76186a79694 -> "description": "Interval (or event) to which the amount applies.", -76404a79913 -> "description": "The card's desired new PIN, encrypted under Stripe's public key.", -76415a79925 -> "description": "Array of strings containing [categories](https://stripe.com/docs/api#issuing_authorization_object-merchant_data-category) of authorizations to allow. All other categories will be blocked. Cannot be set with `blocked_categories`.", -76712a80223 -> "description": "Array of strings containing [categories](https://stripe.com/docs/api#issuing_authorization_object-merchant_data-category) of authorizations to decline. All other categories will be allowed. Cannot be set with `allowed_categories`.", -77009a80521 -> "description": "Limit spending with amount-based rules that apply across any cards this card replaced (i.e., its `replacement_for` card and _that_ card's `replacement_for` card, up the chain).", -77012a80525 -> "description": "Maximum amount allowed to spend per interval.", -77015a80529 -> "description": "Array of strings containing [categories](https://stripe.com/docs/api#issuing_authorization_object-merchant_data-category) this limit applies to. Omitting this field will apply the limit to all categories.", -77312a80827 -> "description": "Interval (or event) to which the amount applies.", -77393a80909 -> "description": "Minimum value to filter by (exclusive)", -77396a80913 -> "description": "Minimum value to filter by (inclusive)", -77399a80917 -> "description": "Maximum value to filter by (exclusive)", -77402a80921 -> "description": "Maximum value to filter by (inclusive)", -77613c81132,81133 -< ] ---- -> ], -> "description": "(ID of a [file upload](https://stripe.com/docs/guides/file-upload)) Additional documentation supporting the dispute." -77627c81147,81148 -< ] ---- -> ], -> "description": "Date when order was canceled." -77640c81161,81162 -< ] ---- -> ], -> "description": "Whether the cardholder was provided with a cancellation policy." -77642a81165 -> "description": "Reason for canceling the order.", -77658c81181,81182 -< ] ---- -> ], -> "description": "Date when the cardholder expected to receive the product." -77660a81185 -> "description": "Explanation of why the cardholder is disputing this transaction.", -77664a81190 -> "description": "Description of the merchandise or service that was purchased.", -77668a81195 -> "description": "Whether the product was a merchandise or service.", -77676a81204 -> "description": "Result of cardholder's attempt to return the product.", -77696c81224,81225 -< ] ---- -> ], -> "description": "Date when the product was returned or attempted to be returned." -77708c81237,81238 -< ] ---- -> ], -> "description": "Evidence provided when `reason` is 'canceled'." -77725c81255,81256 -< ] ---- -> ], -> "description": "(ID of a [file upload](https://stripe.com/docs/guides/file-upload)) Additional documentation supporting the dispute." -77738c81269,81270 -< ] ---- -> ], -> "description": "(ID of a [file upload](https://stripe.com/docs/guides/file-upload)) Copy of the card statement showing that the product had already been paid for." -77751c81283,81284 -< ] ---- -> ], -> "description": "(ID of a [file upload](https://stripe.com/docs/guides/file-upload)) Copy of the receipt showing that the product had been paid for in cash." -77764c81297,81298 -< ] ---- -> ], -> "description": "(ID of a [file upload](https://stripe.com/docs/guides/file-upload)) Image of the front and back of the check that was used to pay for the product." -77766a81301 -> "description": "Explanation of why the cardholder is disputing this transaction.", -77770a81306 -> "description": "Transaction (e.g., ipi_...) that the disputed transaction is a duplicate of. Of the two or more transactions that are copies of each other, this is original undisputed one.", -77784c81320,81321 -< ] ---- -> ], -> "description": "Evidence provided when `reason` is 'duplicate'." -77801c81338,81339 -< ] ---- -> ], -> "description": "(ID of a [file upload](https://stripe.com/docs/guides/file-upload)) Additional documentation supporting the dispute." -77803a81342 -> "description": "Explanation of why the cardholder is disputing this transaction.", -77817c81356,81357 -< ] ---- -> ], -> "description": "Evidence provided when `reason` is 'fraudulent'." -77834c81374,81375 -< ] ---- -> ], -> "description": "(ID of a [file upload](https://stripe.com/docs/guides/file-upload)) Additional documentation supporting the dispute." -77836a81378 -> "description": "Explanation of why the cardholder is disputing this transaction.", -77852c81394,81395 -< ] ---- -> ], -> "description": "Date when the product was received." -77854a81398 -> "description": "Description of the cardholder's attempt to return the product.", -77858a81403 -> "description": "Result of cardholder's attempt to return the product.", -77878c81423,81424 -< ] ---- -> ], -> "description": "Date when the product was returned or attempted to be returned." -77890c81436,81437 -< ] ---- -> ], -> "description": "Evidence provided when `reason` is 'merchandise_not_as_described'." -77907c81454,81455 -< ] ---- -> ], -> "description": "(ID of a [file upload](https://stripe.com/docs/guides/file-upload)) Additional documentation supporting the dispute." -77921c81469,81470 -< ] ---- -> ], -> "description": "Date when the cardholder expected to receive the product." -77923a81473 -> "description": "Explanation of why the cardholder is disputing this transaction.", -77927a81478 -> "description": "Description of the merchandise or service that was purchased.", -77931a81483 -> "description": "Whether the product was a merchandise or service.", -77949c81501,81502 -< ] ---- -> ], -> "description": "Evidence provided when `reason` is 'not_received'." -77966c81519,81520 -< ] ---- -> ], -> "description": "(ID of a [file upload](https://stripe.com/docs/guides/file-upload)) Additional documentation supporting the dispute." -77968a81523 -> "description": "Explanation of why the cardholder is disputing this transaction.", -77972a81528 -> "description": "Description of the merchandise or service that was purchased.", -77976a81533 -> "description": "Whether the product was a merchandise or service.", -77994c81551,81552 -< ] ---- -> ], -> "description": "Evidence provided when `reason` is 'other'." -77996a81555 -> "description": "The reason for filing the dispute. The evidence should be submitted in the field of the same name.", -78024c81583,81584 -< ] ---- -> ], -> "description": "(ID of a [file upload](https://stripe.com/docs/guides/file-upload)) Additional documentation supporting the dispute." -78038c81598,81599 -< ] ---- -> ], -> "description": "Date when order was canceled." -78040a81602 -> "description": "Reason for canceling the order.", -78044a81607 -> "description": "Explanation of why the cardholder is disputing this transaction.", -78060c81623,81624 -< ] ---- -> ], -> "description": "Date when the product was received." -78072c81636,81637 -< ] ---- -> ], -> "description": "Evidence provided when `reason` is 'service_not_as_described'." -78101a81667 -> "description": "The ID of the ReceivedDebit to initiate an Issuings dispute for.", -78267c81833,81834 -< ] ---- -> ], -> "description": "(ID of a [file upload](https://stripe.com/docs/guides/file-upload)) Additional documentation supporting the dispute." -78281c81848,81849 -< ] ---- -> ], -> "description": "Date when order was canceled." -78294c81862,81863 -< ] ---- -> ], -> "description": "Whether the cardholder was provided with a cancellation policy." -78296a81866 -> "description": "Reason for canceling the order.", -78312c81882,81883 -< ] ---- -> ], -> "description": "Date when the cardholder expected to receive the product." -78314a81886 -> "description": "Explanation of why the cardholder is disputing this transaction.", -78318a81891 -> "description": "Description of the merchandise or service that was purchased.", -78322a81896 -> "description": "Whether the product was a merchandise or service.", -78330a81905 -> "description": "Result of cardholder's attempt to return the product.", -78350c81925,81926 -< ] ---- -> ], -> "description": "Date when the product was returned or attempted to be returned." -78362c81938,81939 -< ] ---- -> ], -> "description": "Evidence provided when `reason` is 'canceled'." -78379c81956,81957 -< ] ---- -> ], -> "description": "(ID of a [file upload](https://stripe.com/docs/guides/file-upload)) Additional documentation supporting the dispute." -78392c81970,81971 -< ] ---- -> ], -> "description": "(ID of a [file upload](https://stripe.com/docs/guides/file-upload)) Copy of the card statement showing that the product had already been paid for." -78405c81984,81985 -< ] ---- -> ], -> "description": "(ID of a [file upload](https://stripe.com/docs/guides/file-upload)) Copy of the receipt showing that the product had been paid for in cash." -78418c81998,81999 -< ] ---- -> ], -> "description": "(ID of a [file upload](https://stripe.com/docs/guides/file-upload)) Image of the front and back of the check that was used to pay for the product." -78420a82002 -> "description": "Explanation of why the cardholder is disputing this transaction.", -78424a82007 -> "description": "Transaction (e.g., ipi_...) that the disputed transaction is a duplicate of. Of the two or more transactions that are copies of each other, this is original undisputed one.", -78438c82021,82022 -< ] ---- -> ], -> "description": "Evidence provided when `reason` is 'duplicate'." -78455c82039,82040 -< ] ---- -> ], -> "description": "(ID of a [file upload](https://stripe.com/docs/guides/file-upload)) Additional documentation supporting the dispute." -78457a82043 -> "description": "Explanation of why the cardholder is disputing this transaction.", -78471c82057,82058 -< ] ---- -> ], -> "description": "Evidence provided when `reason` is 'fraudulent'." -78488c82075,82076 -< ] ---- -> ], -> "description": "(ID of a [file upload](https://stripe.com/docs/guides/file-upload)) Additional documentation supporting the dispute." -78490a82079 -> "description": "Explanation of why the cardholder is disputing this transaction.", -78506c82095,82096 -< ] ---- -> ], -> "description": "Date when the product was received." -78508a82099 -> "description": "Description of the cardholder's attempt to return the product.", -78512a82104 -> "description": "Result of cardholder's attempt to return the product.", -78532c82124,82125 -< ] ---- -> ], -> "description": "Date when the product was returned or attempted to be returned." -78544c82137,82138 -< ] ---- -> ], -> "description": "Evidence provided when `reason` is 'merchandise_not_as_described'." -78561c82155,82156 -< ] ---- -> ], -> "description": "(ID of a [file upload](https://stripe.com/docs/guides/file-upload)) Additional documentation supporting the dispute." -78575c82170,82171 -< ] ---- -> ], -> "description": "Date when the cardholder expected to receive the product." -78577a82174 -> "description": "Explanation of why the cardholder is disputing this transaction.", -78581a82179 -> "description": "Description of the merchandise or service that was purchased.", -78585a82184 -> "description": "Whether the product was a merchandise or service.", -78603c82202,82203 -< ] ---- -> ], -> "description": "Evidence provided when `reason` is 'not_received'." -78620c82220,82221 -< ] ---- -> ], -> "description": "(ID of a [file upload](https://stripe.com/docs/guides/file-upload)) Additional documentation supporting the dispute." -78622a82224 -> "description": "Explanation of why the cardholder is disputing this transaction.", -78626a82229 -> "description": "Description of the merchandise or service that was purchased.", -78630a82234 -> "description": "Whether the product was a merchandise or service.", -78648c82252,82253 -< ] ---- -> ], -> "description": "Evidence provided when `reason` is 'other'." -78650a82256 -> "description": "The reason for filing the dispute. The evidence should be submitted in the field of the same name.", -78678c82284,82285 -< ] ---- -> ], -> "description": "(ID of a [file upload](https://stripe.com/docs/guides/file-upload)) Additional documentation supporting the dispute." -78692c82299,82300 -< ] ---- -> ], -> "description": "Date when order was canceled." -78694a82303 -> "description": "Reason for canceling the order.", -78698a82308 -> "description": "Explanation of why the cardholder is disputing this transaction.", -78714c82324,82325 -< ] ---- -> ], -> "description": "Date when the product was received." -78726c82337,82338 -< ] ---- -> ], -> "description": "Evidence provided when `reason` is 'service_not_as_described'." -78876,79178d82487 -< "/v1/issuing/settlements": { -< "get": { -< "description": "

Returns a list of Issuing Settlement objects. The objects are sorted in descending order by creation date, with the most recently created object appearing first.

", -< "operationId": "GetIssuingSettlements", -< "parameters": [ -< { -< "description": "Only return issuing settlements that were created during the given date interval.", -< "explode": true, -< "in": "query", -< "name": "created", -< "required": false, -< "schema": { -< "anyOf": [ -< { -< "properties": { -< "gt": { -< "type": "integer" -< }, -< "gte": { -< "type": "integer" -< }, -< "lt": { -< "type": "integer" -< }, -< "lte": { -< "type": "integer" -< } -< }, -< "title": "range_query_specs", -< "type": "object" -< }, -< { -< "type": "integer" -< } -< ] -< }, -< "style": "deepObject" -< }, -< { -< "description": "A cursor for use in pagination. `ending_before` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, starting with `obj_bar`, your subsequent call can include `ending_before=obj_bar` in order to fetch the previous page of the list.", -< "in": "query", -< "name": "ending_before", -< "required": false, -< "schema": { -< "maxLength": 5000, -< "type": "string" -< }, -< "style": "form" -< }, -< { -< "description": "Specifies which fields in the response should be expanded.", -< "explode": true, -< "in": "query", -< "name": "expand", -< "required": false, -< "schema": { -< "items": { -< "maxLength": 5000, -< "type": "string" -< }, -< "type": "array" -< }, -< "style": "deepObject" -< }, -< { -< "description": "A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 10.", -< "in": "query", -< "name": "limit", -< "required": false, -< "schema": { -< "type": "integer" -< }, -< "style": "form" -< }, -< { -< "description": "A cursor for use in pagination. `starting_after` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with `obj_foo`, your subsequent call can include `starting_after=obj_foo` in order to fetch the next page of the list.", -< "in": "query", -< "name": "starting_after", -< "required": false, -< "schema": { -< "maxLength": 5000, -< "type": "string" -< }, -< "style": "form" -< } -< ], -< "requestBody": { -< "content": { -< "application/x-www-form-urlencoded": { -< "encoding": {}, -< "schema": { -< "additionalProperties": false, -< "properties": {}, -< "type": "object" -< } -< } -< }, -< "required": false -< }, -< "responses": { -< "200": { -< "content": { -< "application/json": { -< "schema": { -< "description": "", -< "properties": { -< "data": { -< "items": { -< "$ref": "#/components/schemas/issuing.settlement" -< }, -< "type": "array" -< }, -< "has_more": { -< "description": "True if this list has another page of items after this one that can be fetched.", -< "type": "boolean" -< }, -< "object": { -< "description": "String representing the object's type. Objects of the same type share the same value. Always has the value `list`.", -< "enum": [ -< "list" -< ], -< "type": "string" -< }, -< "url": { -< "description": "The URL where this list can be accessed.", -< "maxLength": 5000, -< "pattern": "^/v1/issuing/settlements", -< "type": "string" -< } -< }, -< "required": [ -< "data", -< "has_more", -< "object", -< "url" -< ], -< "title": "IssuingSettlementList", -< "type": "object", -< "x-expandableFields": [ -< "data" -< ] -< } -< } -< }, -< "description": "Successful response." -< }, -< "default": { -< "content": { -< "application/json": { -< "schema": { -< "$ref": "#/components/schemas/error" -< } -< } -< }, -< "description": "Error response." -< } -< } -< } -< }, -< "/v1/issuing/settlements/{settlement}": { -< "get": { -< "description": "

Retrieves an Issuing Settlement object.

", -< "operationId": "GetIssuingSettlementsSettlement", -< "parameters": [ -< { -< "description": "Specifies which fields in the response should be expanded.", -< "explode": true, -< "in": "query", -< "name": "expand", -< "required": false, -< "schema": { -< "items": { -< "maxLength": 5000, -< "type": "string" -< }, -< "type": "array" -< }, -< "style": "deepObject" -< }, -< { -< "in": "path", -< "name": "settlement", -< "required": true, -< "schema": { -< "maxLength": 5000, -< "type": "string" -< }, -< "style": "simple" -< } -< ], -< "requestBody": { -< "content": { -< "application/x-www-form-urlencoded": { -< "encoding": {}, -< "schema": { -< "additionalProperties": false, -< "properties": {}, -< "type": "object" -< } -< } -< }, -< "required": false -< }, -< "responses": { -< "200": { -< "content": { -< "application/json": { -< "schema": { -< "$ref": "#/components/schemas/issuing.settlement" -< } -< } -< }, -< "description": "Successful response." -< }, -< "default": { -< "content": { -< "application/json": { -< "schema": { -< "$ref": "#/components/schemas/error" -< } -< } -< }, -< "description": "Error response." -< } -< } -< }, -< "post": { -< "description": "

Updates the specified Issuing Settlement object by setting the values of the parameters passed. Any parameters not provided will be left unchanged.

", -< "operationId": "PostIssuingSettlementsSettlement", -< "parameters": [ -< { -< "in": "path", -< "name": "settlement", -< "required": true, -< "schema": { -< "maxLength": 5000, -< "type": "string" -< }, -< "style": "simple" -< } -< ], -< "requestBody": { -< "content": { -< "application/x-www-form-urlencoded": { -< "encoding": { -< "expand": { -< "explode": true, -< "style": "deepObject" -< }, -< "metadata": { -< "explode": true, -< "style": "deepObject" -< } -< }, -< "schema": { -< "additionalProperties": false, -< "properties": { -< "expand": { -< "description": "Specifies which fields in the response should be expanded.", -< "items": { -< "maxLength": 5000, -< "type": "string" -< }, -< "type": "array" -< }, -< "metadata": { -< "additionalProperties": { -< "type": "string" -< }, -< "description": "Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`.", -< "type": "object" -< } -< }, -< "type": "object" -< } -< } -< }, -< "required": false -< }, -< "responses": { -< "200": { -< "content": { -< "application/json": { -< "schema": { -< "$ref": "#/components/schemas/issuing.settlement" -< } -< } -< }, -< "description": "Successful response." -< }, -< "default": { -< "content": { -< "application/json": { -< "schema": { -< "$ref": "#/components/schemas/error" -< } -< } -< }, -< "description": "Error response." -< } -< } -< } -< }, -79216a82526 -> "description": "Minimum value to filter by (exclusive)", -79219a82530 -> "description": "Minimum value to filter by (inclusive)", -79222a82534 -> "description": "Maximum value to filter by (exclusive)", -79225a82538 -> "description": "Maximum value to filter by (inclusive)", -79528,80256d82840 -< "/v1/link_account_sessions": { -< "post": { -< "description": "

To launch the Financial Connections authorization flow, create a Session. The session’s client_secret can be used to launch the flow using Stripe.js.

", -< "operationId": "PostLinkAccountSessions", -< "requestBody": { -< "content": { -< "application/x-www-form-urlencoded": { -< "encoding": { -< "account_holder": { -< "explode": true, -< "style": "deepObject" -< }, -< "expand": { -< "explode": true, -< "style": "deepObject" -< }, -< "filters": { -< "explode": true, -< "style": "deepObject" -< }, -< "permissions": { -< "explode": true, -< "style": "deepObject" -< } -< }, -< "schema": { -< "additionalProperties": false, -< "properties": { -< "account_holder": { -< "description": "The account holder to link accounts for.", -< "properties": { -< "account": { -< "maxLength": 5000, -< "type": "string" -< }, -< "customer": { -< "maxLength": 5000, -< "type": "string" -< }, -< "type": { -< "enum": [ -< "account", -< "customer" -< ], -< "type": "string" -< } -< }, -< "required": [ -< "type" -< ], -< "title": "accountholder_params", -< "type": "object" -< }, -< "expand": { -< "description": "Specifies which fields in the response should be expanded.", -< "items": { -< "maxLength": 5000, -< "type": "string" -< }, -< "type": "array" -< }, -< "filters": { -< "description": "Filters to restrict the kinds of accounts to collect.", -< "properties": { -< "countries": { -< "items": { -< "maxLength": 5000, -< "type": "string" -< }, -< "type": "array" -< } -< }, -< "required": [ -< "countries" -< ], -< "title": "filters_params", -< "type": "object" -< }, -< "permissions": { -< "description": "List of data features that you would like to request access to.\n\nPossible values are `balances`, `transactions`, `ownership`, and `payment_method`.", -< "items": { -< "enum": [ -< "balances", -< "ownership", -< "payment_method", -< "transactions" -< ], -< "maxLength": 5000, -< "type": "string", -< "x-stripeBypassValidation": true -< }, -< "type": "array" -< }, -< "return_url": { -< "description": "For webview integrations only. Upon completing OAuth login in the native browser, the user will be redirected to this URL to return to your app.", -< "maxLength": 5000, -< "type": "string" -< } -< }, -< "required": [ -< "account_holder", -< "permissions" -< ], -< "type": "object" -< } -< } -< }, -< "required": true -< }, -< "responses": { -< "200": { -< "content": { -< "application/json": { -< "schema": { -< "$ref": "#/components/schemas/financial_connections.session" -< } -< } -< }, -< "description": "Successful response." -< }, -< "default": { -< "content": { -< "application/json": { -< "schema": { -< "$ref": "#/components/schemas/error" -< } -< } -< }, -< "description": "Error response." -< } -< } -< } -< }, -< "/v1/link_account_sessions/{session}": { -< "get": { -< "description": "

Retrieves the details of a Financial Connections Session

", -< "operationId": "GetLinkAccountSessionsSession", -< "parameters": [ -< { -< "description": "Specifies which fields in the response should be expanded.", -< "explode": true, -< "in": "query", -< "name": "expand", -< "required": false, -< "schema": { -< "items": { -< "maxLength": 5000, -< "type": "string" -< }, -< "type": "array" -< }, -< "style": "deepObject" -< }, -< { -< "in": "path", -< "name": "session", -< "required": true, -< "schema": { -< "maxLength": 5000, -< "type": "string" -< }, -< "style": "simple" -< } -< ], -< "requestBody": { -< "content": { -< "application/x-www-form-urlencoded": { -< "encoding": {}, -< "schema": { -< "additionalProperties": false, -< "properties": {}, -< "type": "object" -< } -< } -< }, -< "required": false -< }, -< "responses": { -< "200": { -< "content": { -< "application/json": { -< "schema": { -< "$ref": "#/components/schemas/financial_connections.session" -< } -< } -< }, -< "description": "Successful response." -< }, -< "default": { -< "content": { -< "application/json": { -< "schema": { -< "$ref": "#/components/schemas/error" -< } -< } -< }, -< "description": "Error response." -< } -< } -< } -< }, -< "/v1/linked_accounts": { -< "get": { -< "description": "

Returns a list of Financial Connections Account objects.

", -< "operationId": "GetLinkedAccounts", -< "parameters": [ -< { -< "description": "If present, only return accounts that belong to the specified account holder. `account_holder[customer]` and `account_holder[account]` are mutually exclusive.", -< "explode": true, -< "in": "query", -< "name": "account_holder", -< "required": false, -< "schema": { -< "properties": { -< "account": { -< "maxLength": 5000, -< "type": "string" -< }, -< "customer": { -< "maxLength": 5000, -< "type": "string" -< } -< }, -< "title": "accountholder_params", -< "type": "object" -< }, -< "style": "deepObject" -< }, -< { -< "description": "A cursor for use in pagination. `ending_before` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, starting with `obj_bar`, your subsequent call can include `ending_before=obj_bar` in order to fetch the previous page of the list.", -< "in": "query", -< "name": "ending_before", -< "required": false, -< "schema": { -< "maxLength": 5000, -< "type": "string" -< }, -< "style": "form" -< }, -< { -< "description": "Specifies which fields in the response should be expanded.", -< "explode": true, -< "in": "query", -< "name": "expand", -< "required": false, -< "schema": { -< "items": { -< "maxLength": 5000, -< "type": "string" -< }, -< "type": "array" -< }, -< "style": "deepObject" -< }, -< { -< "description": "A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 10.", -< "in": "query", -< "name": "limit", -< "required": false, -< "schema": { -< "type": "integer" -< }, -< "style": "form" -< }, -< { -< "description": "If present, only return accounts that were collected as part of the given session.", -< "in": "query", -< "name": "session", -< "required": false, -< "schema": { -< "maxLength": 5000, -< "type": "string" -< }, -< "style": "form" -< }, -< { -< "description": "A cursor for use in pagination. `starting_after` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with `obj_foo`, your subsequent call can include `starting_after=obj_foo` in order to fetch the next page of the list.", -< "in": "query", -< "name": "starting_after", -< "required": false, -< "schema": { -< "maxLength": 5000, -< "type": "string" -< }, -< "style": "form" -< } -< ], -< "requestBody": { -< "content": { -< "application/x-www-form-urlencoded": { -< "encoding": {}, -< "schema": { -< "additionalProperties": false, -< "properties": {}, -< "type": "object" -< } -< } -< }, -< "required": false -< }, -< "responses": { -< "200": { -< "content": { -< "application/json": { -< "schema": { -< "description": "", -< "properties": { -< "data": { -< "description": "Details about each object.", -< "items": { -< "$ref": "#/components/schemas/financial_connections.account" -< }, -< "type": "array" -< }, -< "has_more": { -< "description": "True if this list has another page of items after this one that can be fetched.", -< "type": "boolean" -< }, -< "object": { -< "description": "String representing the object's type. Objects of the same type share the same value. Always has the value `list`.", -< "enum": [ -< "list" -< ], -< "type": "string" -< }, -< "url": { -< "description": "The URL where this list can be accessed.", -< "maxLength": 5000, -< "pattern": "^/v1/financial_connections/accounts", -< "type": "string" -< } -< }, -< "required": [ -< "data", -< "has_more", -< "object", -< "url" -< ], -< "title": "BankConnectionsResourceLinkedAccountList", -< "type": "object", -< "x-expandableFields": [ -< "data" -< ] -< } -< } -< }, -< "description": "Successful response." -< }, -< "default": { -< "content": { -< "application/json": { -< "schema": { -< "$ref": "#/components/schemas/error" -< } -< } -< }, -< "description": "Error response." -< } -< } -< } -< }, -< "/v1/linked_accounts/{account}": { -< "get": { -< "description": "

Retrieves the details of an Financial Connections Account.

", -< "operationId": "GetLinkedAccountsAccount", -< "parameters": [ -< { -< "in": "path", -< "name": "account", -< "required": true, -< "schema": { -< "maxLength": 5000, -< "type": "string" -< }, -< "style": "simple" -< }, -< { -< "description": "Specifies which fields in the response should be expanded.", -< "explode": true, -< "in": "query", -< "name": "expand", -< "required": false, -< "schema": { -< "items": { -< "maxLength": 5000, -< "type": "string" -< }, -< "type": "array" -< }, -< "style": "deepObject" -< } -< ], -< "requestBody": { -< "content": { -< "application/x-www-form-urlencoded": { -< "encoding": {}, -< "schema": { -< "additionalProperties": false, -< "properties": {}, -< "type": "object" -< } -< } -< }, -< "required": false -< }, -< "responses": { -< "200": { -< "content": { -< "application/json": { -< "schema": { -< "$ref": "#/components/schemas/financial_connections.account" -< } -< } -< }, -< "description": "Successful response." -< }, -< "default": { -< "content": { -< "application/json": { -< "schema": { -< "$ref": "#/components/schemas/error" -< } -< } -< }, -< "description": "Error response." -< } -< } -< } -< }, -< "/v1/linked_accounts/{account}/disconnect": { -< "post": { -< "description": "

Disables your access to a Financial Connections Account. You will no longer be able to access data associated with the account (e.g. balances, transactions).

", -< "operationId": "PostLinkedAccountsAccountDisconnect", -< "parameters": [ -< { -< "in": "path", -< "name": "account", -< "required": true, -< "schema": { -< "maxLength": 5000, -< "type": "string" -< }, -< "style": "simple" -< } -< ], -< "requestBody": { -< "content": { -< "application/x-www-form-urlencoded": { -< "encoding": { -< "expand": { -< "explode": true, -< "style": "deepObject" -< } -< }, -< "schema": { -< "additionalProperties": false, -< "properties": { -< "expand": { -< "description": "Specifies which fields in the response should be expanded.", -< "items": { -< "maxLength": 5000, -< "type": "string" -< }, -< "type": "array" -< } -< }, -< "type": "object" -< } -< } -< }, -< "required": false -< }, -< "responses": { -< "200": { -< "content": { -< "application/json": { -< "schema": { -< "$ref": "#/components/schemas/financial_connections.account" -< } -< } -< }, -< "description": "Successful response." -< }, -< "default": { -< "content": { -< "application/json": { -< "schema": { -< "$ref": "#/components/schemas/error" -< } -< } -< }, -< "description": "Error response." -< } -< } -< } -< }, -< "/v1/linked_accounts/{account}/owners": { -< "get": { -< "description": "

Lists all owners for a given Account

", -< "operationId": "GetLinkedAccountsAccountOwners", -< "parameters": [ -< { -< "in": "path", -< "name": "account", -< "required": true, -< "schema": { -< "maxLength": 5000, -< "type": "string" -< }, -< "style": "simple" -< }, -< { -< "description": "A cursor for use in pagination. `ending_before` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, starting with `obj_bar`, your subsequent call can include `ending_before=obj_bar` in order to fetch the previous page of the list.", -< "in": "query", -< "name": "ending_before", -< "required": false, -< "schema": { -< "maxLength": 5000, -< "type": "string" -< }, -< "style": "form" -< }, -< { -< "description": "Specifies which fields in the response should be expanded.", -< "explode": true, -< "in": "query", -< "name": "expand", -< "required": false, -< "schema": { -< "items": { -< "maxLength": 5000, -< "type": "string" -< }, -< "type": "array" -< }, -< "style": "deepObject" -< }, -< { -< "description": "A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 10.", -< "in": "query", -< "name": "limit", -< "required": false, -< "schema": { -< "type": "integer" -< }, -< "style": "form" -< }, -< { -< "description": "The ID of the ownership object to fetch owners from.", -< "in": "query", -< "name": "ownership", -< "required": true, -< "schema": { -< "maxLength": 5000, -< "type": "string" -< }, -< "style": "form" -< }, -< { -< "description": "A cursor for use in pagination. `starting_after` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with `obj_foo`, your subsequent call can include `starting_after=obj_foo` in order to fetch the next page of the list.", -< "in": "query", -< "name": "starting_after", -< "required": false, -< "schema": { -< "maxLength": 5000, -< "type": "string" -< }, -< "style": "form" -< } -< ], -< "requestBody": { -< "content": { -< "application/x-www-form-urlencoded": { -< "encoding": {}, -< "schema": { -< "additionalProperties": false, -< "properties": {}, -< "type": "object" -< } -< } -< }, -< "required": false -< }, -< "responses": { -< "200": { -< "content": { -< "application/json": { -< "schema": { -< "description": "", -< "properties": { -< "data": { -< "description": "Details about each object.", -< "items": { -< "$ref": "#/components/schemas/financial_connections.account_owner" -< }, -< "type": "array" -< }, -< "has_more": { -< "description": "True if this list has another page of items after this one that can be fetched.", -< "type": "boolean" -< }, -< "object": { -< "description": "String representing the object's type. Objects of the same type share the same value. Always has the value `list`.", -< "enum": [ -< "list" -< ], -< "type": "string" -< }, -< "url": { -< "description": "The URL where this list can be accessed.", -< "maxLength": 5000, -< "type": "string" -< } -< }, -< "required": [ -< "data", -< "has_more", -< "object", -< "url" -< ], -< "title": "BankConnectionsResourceOwnerList", -< "type": "object", -< "x-expandableFields": [ -< "data" -< ] -< } -< } -< }, -< "description": "Successful response." -< }, -< "default": { -< "content": { -< "application/json": { -< "schema": { -< "$ref": "#/components/schemas/error" -< } -< } -< }, -< "description": "Error response." -< } -< } -< } -< }, -< "/v1/linked_accounts/{account}/refresh": { -< "post": { -< "description": "

Refreshes the data associated with a Financial Connections Account.

", -< "operationId": "PostLinkedAccountsAccountRefresh", -< "parameters": [ -< { -< "in": "path", -< "name": "account", -< "required": true, -< "schema": { -< "maxLength": 5000, -< "type": "string" -< }, -< "style": "simple" -< } -< ], -< "requestBody": { -< "content": { -< "application/x-www-form-urlencoded": { -< "encoding": { -< "expand": { -< "explode": true, -< "style": "deepObject" -< }, -< "features": { -< "explode": true, -< "style": "deepObject" -< } -< }, -< "schema": { -< "additionalProperties": false, -< "properties": { -< "expand": { -< "description": "Specifies which fields in the response should be expanded.", -< "items": { -< "maxLength": 5000, -< "type": "string" -< }, -< "type": "array" -< }, -< "features": { -< "description": "The list of account features that you would like to refresh.", -< "items": { -< "enum": [ -< "balance", -< "ownership" -< ], -< "type": "string", -< "x-stripeBypassValidation": true -< }, -< "type": "array" -< } -< }, -< "required": [ -< "features" -< ], -< "type": "object" -< } -< } -< }, -< "required": true -< }, -< "responses": { -< "200": { -< "content": { -< "application/json": { -< "schema": { -< "$ref": "#/components/schemas/financial_connections.account" -< } -< } -< }, -< "description": "Successful response." -< }, -< "default": { -< "content": { -< "application/json": { -< "schema": { -< "$ref": "#/components/schemas/error" -< } -< } -< }, -< "description": "Error response." -< } -< } -< } -< }, -80473,80476d83056 -< "client_permissions": { -< "explode": true, -< "style": "deepObject" -< }, -80516a83097 -> "description": "Enable automatic tax calculation which will automatically compute tax rates on this order.", -80530a83112 -> "description": "The billing address provided by the customer.", -80532a83115 -> "description": "City, district, suburb, town, or village.", -80536a83120 -> "description": "Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)).", -80540a83125 -> "description": "Address line 1 (e.g., street, PO Box, or company name).", -80544a83130 -> "description": "Address line 2 (e.g., apartment, suite, unit, or building).", -80548a83135 -> "description": "ZIP or postal code.", -80552a83140 -> "description": "State/province as an [ISO 3166-2](https://en.wikipedia.org/wiki/ISO_3166-2) subdivision code, without country prefix. Example: \"NY\" or \"TX\".", -80560a83149 -> "description": "The billing email provided by the customer.", -80563a83153 -> "description": "The billing name provided by the customer.", -80567a83158 -> "description": "The billing phone number provided by the customer.", -80584,80611d83174 -< "client_permissions": { -< "description": "The fields on the order that are allowed to be updated from your frontend application with a publishable key and order client secret.", -< "properties": { -< "billing_details": { -< "enum": [ -< "allow", -< "disallow" -< ], -< "type": "string" -< }, -< "promotion_codes": { -< "enum": [ -< "allow", -< "disallow" -< ], -< "type": "string" -< }, -< "shipping_details": { -< "enum": [ -< "allow", -< "disallow" -< ], -< "type": "string" -< } -< }, -< "title": "client_permissions", -< "type": "object" -< }, -80631a83195 -> "description": "ID of the coupon to create a new discount for.", -80635a83200 -> "description": "ID of an existing discount on the object (or one of its ancestors) to reuse.", -80639a83205 -> "description": "ID of the promotion code to create a new discount for.", -80674a83241 -> "description": "The description for the line item. Will default to the name of the associated product.", -80683a83251 -> "description": "ID of the coupon to create a new discount for.", -80687a83256 -> "description": "ID of an existing discount on the object (or one of its ancestors) to reuse.", -80703c83272,83273 -< ] ---- -> ], -> "description": "The discounts applied to this line item." -80705a83276 -> "description": "The ID of a [Price](https://stripe.com/docs/api/prices) to add to the Order.\n\nThe `price` parameter is an alternative to using the `product` parameter. If each of your products are sold at a single price, you can set `Product.default_price` and then pass the `product` parameter when creating a line item. If your products are sold at several possible prices, use the `price` parameter to explicitly specify which one to use.", -80709a83281 -> "description": "Data used to generate a new Price object inline.\n\nThe `price_data` parameter is an alternative to using the `product` or `price` parameters. If you create products upfront and configure a `Product.default_price`, pass the `product` parameter when creating a line item. If you prefer not to define products upfront, or if you charge variable prices, pass the `price_data` parameter to describe the price for this line item.\n\nEach time you pass `price_data` we create a Price for the product. This Price is hidden in both the Dashboard and API lists and cannot be reused.", -80711a83284 -> "description": "Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. Must be a [supported currency](https://stripe.com/docs/currencies).", -80714a83288 -> "description": "ID of the product this price belongs to.\n\nUse this to implement a variable-pricing model in your integration. This is required if `product_data` is not specifed.", -80718a83293 -> "description": "Specifies whether the price is considered inclusive of taxes or exclusive of taxes. One of `inclusive`, `exclusive`, or `unspecified`. Once specified as either `inclusive` or `exclusive`, it cannot be changed.", -80726a83302 -> "description": "A positive integer in cents (or local equivalent) (or 0 for a free price) representing how much to charge.", -80729a83306 -> "description": "Same as `unit_amount`, but accepts a decimal value in cents (or local equivalent) with at most 12 decimal places. Only one of `unit_amount` and `unit_amount_decimal` can be set.", -80737a83315 -> "description": "The ID of a [Product](https://stripe.com/docs/api/products) to add to the Order.\n\nThe product must have a `default_price` specified. Otherwise, specify the price by passing the `price` or `price_data` parameter.", -80741a83320 -> "description": "Defines a Product inline and adds it to the Order.\n\n`product_data` is an alternative to the `product` parameter. If you created a Product upfront, use the `product` parameter to refer to the existing Product. But if you prefer not to create Products upfront, pass the `product_data` parameter to define a Product inline as part of configuring the Order.\n\n`product_data` automatically creates a Product, just as if you had manually created the Product. If a Product with the same ID already exists, then `product_data` re-uses it to avoid duplicates.", -80743a83323 -> "description": "The product's description, meant to be displayable to the customer. Use this field to optionally store a long form explanation of the product being sold for your own rendering purposes.", -80747a83328 -> "description": "A unique identifier for this product.\n\n`product_data` automatically creates a Product with this ID. If a Product with the same ID already exists, then `product_data` re-uses it to avoid duplicates. If any of the fields in the existing Product are different from the values in `product_data`, `product_data` updates the existing Product with the new information. So set `product_data[id]` to the same string every time you sell the same product, but don't re-use the same string for different products.", -80765c83346,83347 -< ] ---- -> ], -> "description": "A list of up to 8 URLs of images for this product, meant to be displayable to the customer." -80781c83363,83364 -< ] ---- -> ], -> "description": "Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`." -80783a83367 -> "description": "The product's name, meant to be displayable to the customer.", -80791a83376 -> "description": "Height, in inches. Maximum precision is 2 decimal places.", -80794a83380 -> "description": "Length, in inches. Maximum precision is 2 decimal places.", -80797a83384 -> "description": "Weight, in ounces. Maximum precision is 2 decimal places.", -80800a83388 -> "description": "Width, in inches. Maximum precision is 2 decimal places.", -80819c83407,83408 -< ] ---- -> ], -> "description": "The dimensions of this product for shipping purposes." -80821a83411 -> "description": "Whether this product is shipped (i.e., physical goods).", -80824a83415 -> "description": "A [tax code](https://stripe.com/docs/tax/tax-categories) ID.", -80839c83430,83431 -< ] ---- -> ], -> "description": "A URL of a publicly-accessible webpage for this product." -80849a83442 -> "description": "The quantity of the line item.", -80867c83460,83461 -< ] ---- -> ], -> "description": "The tax rates applied to this line item." -80885a83480 -> "description": "Settings describing how the order should configure generated PaymentIntents.", -80887a83483 -> "description": "The amount of the application fee (if any) that will be requested to be applied to the payment and transferred to the application owner's Stripe account.", -80890a83487 -> "description": "PaymentMethod-specific configuration to provide to the order's PaymentIntent.", -80892a83490 -> "description": "If paying by `acss_debit`, this sub-hash contains details about the ACSS Debit payment method options to pass to the order's PaymentIntent.", -80894a83493 -> "description": "Additional fields for Mandate creation", -80907c83506,83507 -< ] ---- -> ], -> "description": "A URL for custom mandate text to render during confirmation step.\nThe URL will be rendered with additional GET parameters `payment_intent` and `payment_intent_client_secret` when confirming a Payment Intent,\nor `setup_intent` and `setup_intent_client_secret` when confirming a Setup Intent." -80909a83510 -> "description": "Description of the mandate interval. Only required if 'payment_schedule' parameter is 'interval' or 'combined'.", -80913a83515 -> "description": "Payment schedule for the mandate.", -80921a83524 -> "description": "Transaction type of the mandate.", -80932a83536 -> "description": "Indicates that you intend to make future payments with this PaymentIntent's payment method.\n\nProviding this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes.\n\nWhen processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication).\n\nIf `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`.", -80941a83546 -> "description": "Verification method for the intent", -80954a83560 -> "description": "If paying by `afterpay_clearpay`, this sub-hash contains details about the AfterpayClearpay payment method options to pass to the order's PaymentIntent.", -80956a83563 -> "description": "Controls when the funds will be captured from the customer's account.\n\nIf provided, this parameter will override the top-level `capture_method` when finalizing the payment with this payment method type.\n\nIf `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter will unset the stored value for this payment method type.", -80963a83571 -> "description": "Order identifier shown to the customer in Afterpay’s online portal. We recommend using a value that helps you answer any questions a customer might have about\nthe payment. The identifier is limited to 128 characters and may contain only letters, digits, underscores, backslashes and dashes.", -80967a83576 -> "description": "Indicates that you intend to make future payments with the payment method.\n\nProviding this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the order's Customer, if present, after the order's PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes.\n\nWhen processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication).\n\nIf `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`.", -80977a83587 -> "description": "If paying by `alipay`, this sub-hash contains details about the Alipay payment method options to pass to the order's PaymentIntent.", -80979a83590 -> "description": "Indicates that you intend to make future payments with this PaymentIntent's payment method.\n\nProviding this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes.\n\nWhen processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication).\n\nIf `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`.", -80991a83603 -> "description": "If paying by `bancontact`, this sub-hash contains details about the Bancontact payment method options to pass to the order's PaymentIntent.", -80993a83606 -> "description": "Preferred language of the Bancontact authorization page that the customer is redirected to.", -81002a83616 -> "description": "Indicates that you intend to make future payments with this PaymentIntent's payment method.\n\nProviding this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes.\n\nWhen processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication).\n\nIf `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`.", -81014a83629 -> "description": "If paying by `card`, this sub-hash contains details about the Card payment method options to pass to the order's PaymentIntent.", -81016a83632 -> "description": "Controls when the funds will be captured from the customer's account.", -81023a83640 -> "description": "Indicates that you intend to make future payments with the payment method.\n\nProviding this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the order's Customer, if present, after the order's PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes.\n\nWhen processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication).\n\nIf `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`.", -81035a83653 -> "description": "If paying by `customer_balance`, this sub-hash contains details about the Customer Balance payment method options to pass to the order's PaymentIntent.", -81037a83656 -> "description": "Configuration for the bank transfer funding type, if the `funding_type` is set to `bank_transfer`.", -81041a83661 -> "description": "The desired country code of the bank account information. Permitted values include: `DE`, `ES`, `FR`, `IE`, or `NL`.", -81052a83673 -> "description": "List of address types that should be returned in the financial_addresses response. If not specified, all valid types will be returned.\n\nPermitted values include: `sort_code`, `zengin`, `iban`, or `spei`.", -81066a83688 -> "description": "The list of bank transfer types that this PaymentIntent is allowed to use for funding Permitted values include: `eu_bank_transfer`, `gb_bank_transfer`, `jp_bank_transfer`, or `mx_bank_transfer`.", -81083a83706 -> "description": "The funding method type to be used when there are not enough funds in the customer balance. Permitted values include: `bank_transfer`.", -81089a83713 -> "description": "Indicates that you intend to make future payments with this PaymentIntent's payment method.\n\nProviding this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes.\n\nWhen processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication).\n\nIf `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`.", -81099a83724 -> "description": "If paying by `ideal`, this sub-hash contains details about the iDEAL payment method options to pass to the order's PaymentIntent.", -81101a83727 -> "description": "Indicates that you intend to make future payments with this PaymentIntent's payment method.\n\nProviding this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes.\n\nWhen processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication).\n\nIf `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`.", -81113a83740 -> "description": "If paying by `klarna`, this sub-hash contains details about the Klarna payment method options to pass to the order's PaymentIntent.", -81115a83743 -> "description": "Controls when the funds will be captured from the customer's account.\n\nIf provided, this parameter will override the top-level `capture_method` when finalizing the payment with this payment method type.\n\nIf `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter will unset the stored value for this payment method type.", -81122a83751 -> "description": "Preferred language of the Klarna authorization page that the customer is redirected to", -81168a83798 -> "description": "Indicates that you intend to make future payments with this PaymentIntent's payment method.\n\nProviding this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes.\n\nWhen processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication).\n\nIf `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`.", -81178a83809 -> "description": "If paying by `link`, this sub-hash contains details about the Link payment method options to pass to the order's PaymentIntent.", -81180a83812 -> "description": "Controls when the funds will be captured from the customer's account.\n\nIf provided, this parameter will override the top-level `capture_method` when finalizing the payment with this payment method type.\n\nIf `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter will unset the stored value for this payment method type.", -81187a83820 -> "description": "Token used for persistent Link logins.", -81191a83825 -> "description": "Indicates that you intend to make future payments with this PaymentIntent's payment method.\n\nProviding this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes.\n\nWhen processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication).\n\nIf `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`.", -81203a83838 -> "description": "If paying by `oxxo`, this sub-hash contains details about the OXXO payment method options to pass to the order's PaymentIntent.", -81205a83841 -> "description": "The number of calendar days before an OXXO voucher expires. For example, if you create an OXXO voucher on Monday and you set expires_after_days to 2, the OXXO invoice will expire on Wednesday at 23:59 America/Mexico_City time.", -81208a83845 -> "description": "Indicates that you intend to make future payments with this PaymentIntent's payment method.\n\nProviding this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes.\n\nWhen processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication).\n\nIf `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`.", -81218a83856 -> "description": "If paying by `p24`, this sub-hash contains details about the P24 payment method options to pass to the order's PaymentIntent.", -81220a83859 -> "description": "Indicates that you intend to make future payments with this PaymentIntent's payment method.\n\nProviding this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes.\n\nWhen processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication).\n\nIf `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`.", -81226a83866 -> "description": "Confirm that the payer has accepted the P24 terms and conditions.", -81233a83874 -> "description": "If paying by `sepa_debit`, this sub-hash contains details about the SEPA Debit payment method options to pass to the order's PaymentIntent.", -81235a83877 -> "description": "Additional fields for Mandate creation", -81240a83883 -> "description": "Indicates that you intend to make future payments with this PaymentIntent's payment method.\n\nProviding this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes.\n\nWhen processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication).\n\nIf `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`.", -81253a83897 -> "description": "If paying by `sofort`, this sub-hash contains details about the Sofort payment method options to pass to the order's PaymentIntent.", -81255a83900 -> "description": "Language shown to the payer on redirect.", -81268a83914 -> "description": "Indicates that you intend to make future payments with this PaymentIntent's payment method.\n\nProviding this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes.\n\nWhen processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication).\n\nIf `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`.", -81280a83927 -> "description": "If paying by `wechat_pay`, this sub-hash contains details about the WeChat Pay payment method options to pass to the order's PaymentIntent.", -81282a83930 -> "description": "The app ID registered with WeChat Pay. Only required when client is ios or android.", -81286a83935 -> "description": "The client type that the end customer will pay from", -81295a83945 -> "description": "Indicates that you intend to make future payments with this PaymentIntent's payment method.\n\nProviding this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes.\n\nWhen processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication).\n\nIf `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`.", -81312a83963 -> "description": "The list of [payment method types](https://stripe.com/docs/payments/payment-methods/overview) to provide to the order's PaymentIntent. Do not include this attribute if you prefer to manage your payment methods from the [Stripe Dashboard](https://dashboard.stripe.com/settings/payment_methods).", -81341a83993 -> "description": "The URL to redirect the customer to after they authenticate their payment.", -81344a83997 -> "description": "For non-card charges, you can use this value as the complete description that appears on your customers' statements. Must contain at least one letter, maximum 22 characters.", -81348a84002 -> "description": "Provides information about a card payment that customers see on their statements. Concatenated with the prefix (shortened descriptor) or statement descriptor that’s set on the account to form the complete statement descriptor. Maximum 22 characters for the concatenated descriptor.", -81352a84007 -> "description": "Provides configuration for completing a transfer for the order after it is paid.", -81354a84010 -> "description": "The amount that will be transferred automatically when the order is paid. If no amount is set, the full amount is transferred. There cannot be any line items with recurring prices when using this field.", -81357a84014 -> "description": "ID of the Connected account receiving the transfer.", -81382a84040 -> "description": "The ID of the shipping rate to use for this order.", -81386a84045 -> "description": "Parameters to create a new ad-hoc shipping rate for this order.", -81388a84048 -> "description": "The estimated range for how long shipping will take, meant to be displayable to the customer. This will appear on CheckoutSessions.", -81390a84051 -> "description": "The upper bound of the estimated range. If empty, represents no upper bound i.e., infinite.", -81392a84054 -> "description": "A unit of time.", -81402a84065 -> "description": "Must be greater than 0.", -81413a84077 -> "description": "The lower bound of the estimated range. If empty, represents no lower bound.", -81415a84080 -> "description": "A unit of time.", -81425a84091 -> "description": "Must be greater than 0.", -81440a84107 -> "description": "The name of the shipping rate, meant to be displayable to the customer. This will appear on CheckoutSessions.", -81444a84112 -> "description": "Describes a fixed amount to charge for shipping. Must be present if type is `fixed_amount`.", -81446a84115 -> "description": "A non-negative integer in cents representing how much to charge.", -81449a84119 -> "description": "Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. Must be a [supported currency](https://stripe.com/docs/currencies).", -81455a84126 -> "description": "A non-negative integer in cents representing how much to charge.", -81458a84130 -> "description": "Specifies whether the rate is considered inclusive of taxes or exclusive of taxes. One of `inclusive`, `exclusive`, or `unspecified`.", -81472a84145 -> "description": "Shipping rates defined in each available currency option. Each key must be a three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html) and a [supported currency](https://stripe.com/docs/currencies).", -81486a84160 -> "description": "Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`.", -81489a84164 -> "description": "Specifies whether the rate is considered inclusive of taxes or exclusive of taxes. One of `inclusive`, `exclusive`, or `unspecified`.", -81497a84173 -> "description": "A [tax code](https://stripe.com/docs/tax/tax-categories) ID. The Shipping tax code is `txcd_92010001`.", -81500a84177 -> "description": "The type of calculation to use on the shipping rate. Can only be `fixed_amount` for now.", -81530a84208 -> "description": "The shipping address for the order.", -81532a84211 -> "description": "City, district, suburb, town, or village.", -81536a84216 -> "description": "Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)).", -81540a84221 -> "description": "Address line 1 (e.g., street, PO Box, or company name).", -81544a84226 -> "description": "Address line 2 (e.g., apartment, suite, unit, or building).", -81548a84231 -> "description": "ZIP or postal code.", -81552a84236 -> "description": "State/province as an [ISO 3166-2](https://en.wikipedia.org/wiki/ISO_3166-2) subdivision code, without country prefix. Example: \"NY\" or \"TX\".", -81560a84245 -> "description": "The name of the recipient of the order.", -81564a84250 -> "description": "The phone number (including extension) for the recipient of the order.", -81588a84275 -> "description": "The purchaser's tax exemption status. One of `none`, `exempt`, or `reverse`.", -81597a84285 -> "description": "The purchaser's tax IDs to be used for this order.", -81600a84289 -> "description": "Type of the tax ID, one of `ae_trn`, `au_abn`, `au_arn`, `bg_uic`, `br_cnpj`, `br_cpf`, `ca_bn`, `ca_gst_hst`, `ca_pst_bc`, `ca_pst_mb`, `ca_pst_sk`, `ca_qst`, `ch_vat`, `cl_tin`, `eg_tin`, `es_cif`, `eu_oss_vat`, `eu_vat`, `gb_vat`, `ge_vat`, `hk_br`, `hu_tin`, `id_npwp`, `il_vat`, `in_gst`, `is_vat`, `jp_cn`, `jp_rn`, `jp_trn`, `ke_pin`, `kr_brn`, `li_uid`, `mx_rfc`, `my_frp`, `my_itn`, `my_sst`, `no_vat`, `nz_gst`, `ph_tin`, `ru_inn`, `ru_kpp`, `sa_vat`, `sg_gst`, `sg_uen`, `si_tin`, `th_vat`, `tr_tin`, `tw_vat`, `ua_vat`, `us_ein`, or `za_vat`", -81658a84348 -> "description": "Value of the tax ID.", -81804,81807d84493 -< "client_permissions": { -< "explode": true, -< "style": "deepObject" -< }, -81847a84534 -> "description": "Enable automatic tax calculation which will automatically compute tax rates on this order.", -81861a84549 -> "description": "The billing address provided by the customer.", -81863a84552 -> "description": "City, district, suburb, town, or village.", -81867a84557 -> "description": "Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)).", -81871a84562 -> "description": "Address line 1 (e.g., street, PO Box, or company name).", -81875a84567 -> "description": "Address line 2 (e.g., apartment, suite, unit, or building).", -81879a84572 -> "description": "ZIP or postal code.", -81883a84577 -> "description": "State/province as an [ISO 3166-2](https://en.wikipedia.org/wiki/ISO_3166-2) subdivision code, without country prefix. Example: \"NY\" or \"TX\".", -81891a84586 -> "description": "The billing email provided by the customer.", -81894a84590 -> "description": "The billing name provided by the customer.", -81898a84595 -> "description": "The billing phone number provided by the customer.", -81915,81942d84611 -< "client_permissions": { -< "description": "The fields on the order that are allowed to be updated from your frontend application with a publishable key and order client secret.", -< "properties": { -< "billing_details": { -< "enum": [ -< "allow", -< "disallow" -< ], -< "type": "string" -< }, -< "promotion_codes": { -< "enum": [ -< "allow", -< "disallow" -< ], -< "type": "string" -< }, -< "shipping_details": { -< "enum": [ -< "allow", -< "disallow" -< ], -< "type": "string" -< } -< }, -< "title": "client_permissions", -< "type": "object" -< }, -81962a84632 -> "description": "ID of the coupon to create a new discount for.", -81966a84637 -> "description": "ID of an existing discount on the object (or one of its ancestors) to reuse.", -81970a84642 -> "description": "ID of the promotion code to create a new discount for.", -82005a84678 -> "description": "The description for the line item. Will default to the name of the associated product.", -82014a84688 -> "description": "ID of the coupon to create a new discount for.", -82018a84693 -> "description": "ID of an existing discount on the object (or one of its ancestors) to reuse.", -82034c84709,84710 -< ] ---- -> ], -> "description": "The discounts applied to this line item." -82036a84713 -> "description": "The ID of an existing line item on the order.", -82040a84718 -> "description": "The ID of a [Price](https://stripe.com/docs/api/prices) to add to the Order.\n\nThe `price` parameter is an alternative to using the `product` parameter. If each of your products are sold at a single price, you can set `Product.default_price` and then pass the `product` parameter when creating a line item. If your products are sold at several possible prices, use the `price` parameter to explicitly specify which one to use.", -82044a84723 -> "description": "Data used to generate a new Price object inline.\n\nThe `price_data` parameter is an alternative to using the `product` or `price` parameters. If you create products upfront and configure a `Product.default_price`, pass the `product` parameter when creating a line item. If you prefer not to define products upfront, or if you charge variable prices, pass the `price_data` parameter to describe the price for this line item.\n\nEach time you pass `price_data` we create a Price for the product. This Price is hidden in both the Dashboard and API lists and cannot be reused.", -82046a84726 -> "description": "Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. Must be a [supported currency](https://stripe.com/docs/currencies).", -82049a84730 -> "description": "ID of the product this price belongs to.\n\nUse this to implement a variable-pricing model in your integration. This is required if `product_data` is not specifed.", -82053a84735 -> "description": "Specifies whether the price is considered inclusive of taxes or exclusive of taxes. One of `inclusive`, `exclusive`, or `unspecified`. Once specified as either `inclusive` or `exclusive`, it cannot be changed.", -82061a84744 -> "description": "A positive integer in cents (or local equivalent) (or 0 for a free price) representing how much to charge.", -82064a84748 -> "description": "Same as `unit_amount`, but accepts a decimal value in cents (or local equivalent) with at most 12 decimal places. Only one of `unit_amount` and `unit_amount_decimal` can be set.", -82072a84757 -> "description": "The ID of a [Product](https://stripe.com/docs/api/products) to add to the Order.\n\nThe product must have a `default_price` specified. Otherwise, specify the price by passing the `price` or `price_data` parameter.", -82076a84762 -> "description": "Defines a Product inline and adds it to the Order.\n\n`product_data` is an alternative to the `product` parameter. If you created a Product upfront, use the `product` parameter to refer to the existing Product. But if you prefer not to create Products upfront, pass the `product_data` parameter to define a Product inline as part of configuring the Order.\n\n`product_data` automatically creates a Product, just as if you had manually created the Product. If a Product with the same ID already exists, then `product_data` re-uses it to avoid duplicates.", -82078a84765 -> "description": "The product's description, meant to be displayable to the customer. Use this field to optionally store a long form explanation of the product being sold for your own rendering purposes.", -82082a84770 -> "description": "A unique identifier for this product.\n\n`product_data` automatically creates a Product with this ID. If a Product with the same ID already exists, then `product_data` re-uses it to avoid duplicates. If any of the fields in the existing Product are different from the values in `product_data`, `product_data` updates the existing Product with the new information. So set `product_data[id]` to the same string every time you sell the same product, but don't re-use the same string for different products.", -82100c84788,84789 -< ] ---- -> ], -> "description": "A list of up to 8 URLs of images for this product, meant to be displayable to the customer." -82116c84805,84806 -< ] ---- -> ], -> "description": "Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`." -82118a84809 -> "description": "The product's name, meant to be displayable to the customer.", -82126a84818 -> "description": "Height, in inches. Maximum precision is 2 decimal places.", -82129a84822 -> "description": "Length, in inches. Maximum precision is 2 decimal places.", -82132a84826 -> "description": "Weight, in ounces. Maximum precision is 2 decimal places.", -82135a84830 -> "description": "Width, in inches. Maximum precision is 2 decimal places.", -82154c84849,84850 -< ] ---- -> ], -> "description": "The dimensions of this product for shipping purposes." -82156a84853 -> "description": "Whether this product is shipped (i.e., physical goods).", -82159a84857 -> "description": "A [tax code](https://stripe.com/docs/tax/tax-categories) ID.", -82174c84872,84873 -< ] ---- -> ], -> "description": "A URL of a publicly-accessible webpage for this product." -82184a84884 -> "description": "The quantity of the line item.", -82202c84902,84903 -< ] ---- -> ], -> "description": "The tax rates applied to this line item." -82230a84932 -> "description": "Settings describing how the order should configure generated PaymentIntents.", -82243c84945,84946 -< ] ---- -> ], -> "description": "The amount of the application fee (if any) that will be requested to be applied to the payment and transferred to the application owner's Stripe account." -82245a84949 -> "description": "PaymentMethod-specific configuration to provide to the order's PaymentIntent.", -82251a84956 -> "description": "Additional fields for Mandate creation", -82264c84969,84970 -< ] ---- -> ], -> "description": "A URL for custom mandate text to render during confirmation step.\nThe URL will be rendered with additional GET parameters `payment_intent` and `payment_intent_client_secret` when confirming a Payment Intent,\nor `setup_intent` and `setup_intent_client_secret` when confirming a Setup Intent." -82266a84973 -> "description": "Description of the mandate interval. Only required if 'payment_schedule' parameter is 'interval' or 'combined'.", -82270a84978 -> "description": "Payment schedule for the mandate.", -82278a84987 -> "description": "Transaction type of the mandate.", -82289a84999 -> "description": "Indicates that you intend to make future payments with this PaymentIntent's payment method.\n\nProviding this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes.\n\nWhen processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication).\n\nIf `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`.", -82298a85009 -> "description": "Verification method for the intent", -82317c85028,85029 -< ] ---- -> ], -> "description": "If paying by `acss_debit`, this sub-hash contains details about the ACSS Debit payment method options to pass to the order's PaymentIntent." -82323a85036 -> "description": "Controls when the funds will be captured from the customer's account.\n\nIf provided, this parameter will override the top-level `capture_method` when finalizing the payment with this payment method type.\n\nIf `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter will unset the stored value for this payment method type.", -82330a85044 -> "description": "Order identifier shown to the customer in Afterpay’s online portal. We recommend using a value that helps you answer any questions a customer might have about\nthe payment. The identifier is limited to 128 characters and may contain only letters, digits, underscores, backslashes and dashes.", -82334a85049 -> "description": "Indicates that you intend to make future payments with the payment method.\n\nProviding this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the order's Customer, if present, after the order's PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes.\n\nWhen processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication).\n\nIf `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`.", -82350c85065,85066 -< ] ---- -> ], -> "description": "If paying by `afterpay_clearpay`, this sub-hash contains details about the AfterpayClearpay payment method options to pass to the order's PaymentIntent." -82356a85073 -> "description": "Indicates that you intend to make future payments with this PaymentIntent's payment method.\n\nProviding this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes.\n\nWhen processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication).\n\nIf `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`.", -82374c85091,85092 -< ] ---- -> ], -> "description": "If paying by `alipay`, this sub-hash contains details about the Alipay payment method options to pass to the order's PaymentIntent." -82380a85099 -> "description": "Preferred language of the Bancontact authorization page that the customer is redirected to.", -82389a85109 -> "description": "Indicates that you intend to make future payments with this PaymentIntent's payment method.\n\nProviding this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes.\n\nWhen processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication).\n\nIf `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`.", -82407c85127,85128 -< ] ---- -> ], -> "description": "If paying by `bancontact`, this sub-hash contains details about the Bancontact payment method options to pass to the order's PaymentIntent." -82413a85135 -> "description": "Controls when the funds will be captured from the customer's account.", -82420a85143 -> "description": "Indicates that you intend to make future payments with the payment method.\n\nProviding this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the order's Customer, if present, after the order's PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes.\n\nWhen processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication).\n\nIf `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`.", -82438c85161,85162 -< ] ---- -> ], -> "description": "If paying by `card`, this sub-hash contains details about the Card payment method options to pass to the order's PaymentIntent." -82444a85169 -> "description": "Configuration for the bank transfer funding type, if the `funding_type` is set to `bank_transfer`.", -82448a85174 -> "description": "The desired country code of the bank account information. Permitted values include: `DE`, `ES`, `FR`, `IE`, or `NL`.", -82459a85186 -> "description": "List of address types that should be returned in the financial_addresses response. If not specified, all valid types will be returned.\n\nPermitted values include: `sort_code`, `zengin`, `iban`, or `spei`.", -82473a85201 -> "description": "The list of bank transfer types that this PaymentIntent is allowed to use for funding Permitted values include: `eu_bank_transfer`, `gb_bank_transfer`, `jp_bank_transfer`, or `mx_bank_transfer`.", -82490a85219 -> "description": "The funding method type to be used when there are not enough funds in the customer balance. Permitted values include: `bank_transfer`.", -82496a85226 -> "description": "Indicates that you intend to make future payments with this PaymentIntent's payment method.\n\nProviding this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes.\n\nWhen processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication).\n\nIf `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`.", -82512c85242,85243 -< ] ---- -> ], -> "description": "If paying by `customer_balance`, this sub-hash contains details about the Customer Balance payment method options to pass to the order's PaymentIntent." -82518a85250 -> "description": "Indicates that you intend to make future payments with this PaymentIntent's payment method.\n\nProviding this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes.\n\nWhen processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication).\n\nIf `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`.", -82536c85268,85269 -< ] ---- -> ], -> "description": "If paying by `ideal`, this sub-hash contains details about the iDEAL payment method options to pass to the order's PaymentIntent." -82542a85276 -> "description": "Controls when the funds will be captured from the customer's account.\n\nIf provided, this parameter will override the top-level `capture_method` when finalizing the payment with this payment method type.\n\nIf `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter will unset the stored value for this payment method type.", -82549a85284 -> "description": "Preferred language of the Klarna authorization page that the customer is redirected to", -82595a85331 -> "description": "Indicates that you intend to make future payments with this PaymentIntent's payment method.\n\nProviding this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes.\n\nWhen processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication).\n\nIf `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`.", -82611c85347,85348 -< ] ---- -> ], -> "description": "If paying by `klarna`, this sub-hash contains details about the Klarna payment method options to pass to the order's PaymentIntent." -82617a85355 -> "description": "Controls when the funds will be captured from the customer's account.\n\nIf provided, this parameter will override the top-level `capture_method` when finalizing the payment with this payment method type.\n\nIf `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter will unset the stored value for this payment method type.", -82624a85363 -> "description": "Token used for persistent Link logins.", -82628a85368 -> "description": "Indicates that you intend to make future payments with this PaymentIntent's payment method.\n\nProviding this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes.\n\nWhen processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication).\n\nIf `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`.", -82646c85386,85387 -< ] ---- -> ], -> "description": "If paying by `link`, this sub-hash contains details about the Link payment method options to pass to the order's PaymentIntent." -82652a85394 -> "description": "The number of calendar days before an OXXO voucher expires. For example, if you create an OXXO voucher on Monday and you set expires_after_days to 2, the OXXO invoice will expire on Wednesday at 23:59 America/Mexico_City time.", -82655a85398 -> "description": "Indicates that you intend to make future payments with this PaymentIntent's payment method.\n\nProviding this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes.\n\nWhen processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication).\n\nIf `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`.", -82671c85414,85415 -< ] ---- -> ], -> "description": "If paying by `oxxo`, this sub-hash contains details about the OXXO payment method options to pass to the order's PaymentIntent." -82677a85422 -> "description": "Indicates that you intend to make future payments with this PaymentIntent's payment method.\n\nProviding this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes.\n\nWhen processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication).\n\nIf `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`.", -82683a85429 -> "description": "Confirm that the payer has accepted the P24 terms and conditions.", -82696c85442,85443 -< ] ---- -> ], -> "description": "If paying by `p24`, this sub-hash contains details about the P24 payment method options to pass to the order's PaymentIntent." -82702a85450 -> "description": "Additional fields for Mandate creation", -82707a85456 -> "description": "Indicates that you intend to make future payments with this PaymentIntent's payment method.\n\nProviding this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes.\n\nWhen processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication).\n\nIf `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`.", -82726c85475,85476 -< ] ---- -> ], -> "description": "If paying by `sepa_debit`, this sub-hash contains details about the SEPA Debit payment method options to pass to the order's PaymentIntent." -82732a85483 -> "description": "Language shown to the payer on redirect.", -82745a85497 -> "description": "Indicates that you intend to make future payments with this PaymentIntent's payment method.\n\nProviding this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes.\n\nWhen processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication).\n\nIf `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`.", -82763c85515,85516 -< ] ---- -> ], -> "description": "If paying by `sofort`, this sub-hash contains details about the Sofort payment method options to pass to the order's PaymentIntent." -82769a85523 -> "description": "The app ID registered with WeChat Pay. Only required when client is ios or android.", -82773a85528 -> "description": "The client type that the end customer will pay from", -82782a85538 -> "description": "Indicates that you intend to make future payments with this PaymentIntent's payment method.\n\nProviding this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes.\n\nWhen processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication).\n\nIf `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`.", -82801c85557,85558 -< ] ---- -> ], -> "description": "If paying by `wechat_pay`, this sub-hash contains details about the WeChat Pay payment method options to pass to the order's PaymentIntent." -82807a85565 -> "description": "The list of [payment method types](https://stripe.com/docs/payments/payment-methods/overview) to provide to the order's PaymentIntent. Do not include this attribute if you prefer to manage your payment methods from the [Stripe Dashboard](https://dashboard.stripe.com/settings/payment_methods).", -82847c85605,85606 -< ] ---- -> ], -> "description": "The URL to redirect the customer to after they authenticate their payment." -82849a85609 -> "description": "For non-card charges, you can use this value as the complete description that appears on your customers' statements. Must contain at least one letter, maximum 22 characters.", -82853a85614 -> "description": "Provides information about a card payment that customers see on their statements. Concatenated with the prefix (shortened descriptor) or statement descriptor that’s set on the account to form the complete statement descriptor. Maximum 22 characters for the concatenated descriptor.", -82861a85623 -> "description": "The amount that will be transferred automatically when the order is paid. If no amount is set, the full amount is transferred. There cannot be any line items with recurring prices when using this field.", -82864a85627 -> "description": "ID of the Connected account receiving the transfer.", -82880c85643,85644 -< ] ---- -> ], -> "description": "Provides configuration for completing a transfer for the order after it is paid." -82897a85662 -> "description": "The ID of the shipping rate to use for this order.", -82901a85667 -> "description": "Parameters to create a new ad-hoc shipping rate for this order.", -82903a85670 -> "description": "The estimated range for how long shipping will take, meant to be displayable to the customer. This will appear on CheckoutSessions.", -82905a85673 -> "description": "The upper bound of the estimated range. If empty, represents no upper bound i.e., infinite.", -82907a85676 -> "description": "A unit of time.", -82917a85687 -> "description": "Must be greater than 0.", -82928a85699 -> "description": "The lower bound of the estimated range. If empty, represents no lower bound.", -82930a85702 -> "description": "A unit of time.", -82940a85713 -> "description": "Must be greater than 0.", -82955a85729 -> "description": "The name of the shipping rate, meant to be displayable to the customer. This will appear on CheckoutSessions.", -82959a85734 -> "description": "Describes a fixed amount to charge for shipping. Must be present if type is `fixed_amount`.", -82961a85737 -> "description": "A non-negative integer in cents representing how much to charge.", -82964a85741 -> "description": "Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. Must be a [supported currency](https://stripe.com/docs/currencies).", -82970a85748 -> "description": "A non-negative integer in cents representing how much to charge.", -82973a85752 -> "description": "Specifies whether the rate is considered inclusive of taxes or exclusive of taxes. One of `inclusive`, `exclusive`, or `unspecified`.", -82987a85767 -> "description": "Shipping rates defined in each available currency option. Each key must be a three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html) and a [supported currency](https://stripe.com/docs/currencies).", -83001a85782 -> "description": "Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`.", -83004a85786 -> "description": "Specifies whether the rate is considered inclusive of taxes or exclusive of taxes. One of `inclusive`, `exclusive`, or `unspecified`.", -83012a85795 -> "description": "A [tax code](https://stripe.com/docs/tax/tax-categories) ID. The Shipping tax code is `txcd_92010001`.", -83015a85799 -> "description": "The type of calculation to use on the shipping rate. Can only be `fixed_amount` for now.", -83045a85830 -> "description": "The shipping address for the order.", -83047a85833 -> "description": "City, district, suburb, town, or village.", -83051a85838 -> "description": "Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)).", -83055a85843 -> "description": "Address line 1 (e.g., street, PO Box, or company name).", -83059a85848 -> "description": "Address line 2 (e.g., apartment, suite, unit, or building).", -83063a85853 -> "description": "ZIP or postal code.", -83067a85858 -> "description": "State/province as an [ISO 3166-2](https://en.wikipedia.org/wiki/ISO_3166-2) subdivision code, without country prefix. Example: \"NY\" or \"TX\".", -83075a85867 -> "description": "The name of the recipient of the order.", -83079a85872 -> "description": "The phone number (including extension) for the recipient of the order.", -83103a85897 -> "description": "The purchaser's tax exemption status. One of `none`, `exempt`, or `reverse`.", -83112a85907 -> "description": "The purchaser's tax IDs to be used for this order.", -83115a85911 -> "description": "Type of the tax ID, one of `ae_trn`, `au_abn`, `au_arn`, `bg_uic`, `br_cnpj`, `br_cpf`, `ca_bn`, `ca_gst_hst`, `ca_pst_bc`, `ca_pst_mb`, `ca_pst_sk`, `ca_qst`, `ch_vat`, `cl_tin`, `eg_tin`, `es_cif`, `eu_oss_vat`, `eu_vat`, `gb_vat`, `ge_vat`, `hk_br`, `hu_tin`, `id_npwp`, `il_vat`, `in_gst`, `is_vat`, `jp_cn`, `jp_rn`, `jp_trn`, `ke_pin`, `kr_brn`, `li_uid`, `mx_rfc`, `my_frp`, `my_itn`, `my_sst`, `no_vat`, `nz_gst`, `ph_tin`, `ru_inn`, `ru_kpp`, `sa_vat`, `sg_gst`, `sg_uen`, `si_tin`, `th_vat`, `tr_tin`, `tw_vat`, `ua_vat`, `us_ein`, or `za_vat`", -83173a85970 -> "description": "Value of the tax ID.", -83580a86378 -> "description": "Minimum value to filter by (exclusive)", -83583a86382 -> "description": "Minimum value to filter by (inclusive)", -83586a86386 -> "description": "Maximum value to filter by (exclusive)", -83589a86390 -> "description": "Maximum value to filter by (inclusive)", -83800a86602 -> "description": "Whether this feature is enabled.", -83863a86666 -> "description": "This hash contains details about the customer acceptance of the Mandate.", -83865a86669 -> "description": "The time at which the customer accepted the Mandate.", -83869a86674 -> "description": "If this is a Mandate accepted offline, this hash contains details about the offline acceptance.", -83874a86680 -> "description": "If this is a Mandate accepted online, this hash contains details about the online acceptance.", -83876a86683 -> "description": "The IP address from which the Mandate was accepted by the customer.", -83879a86687 -> "description": "The user agent of the browser from which the Mandate was accepted by the customer.", -83891a86700 -> "description": "The type of customer acceptance information included with the Mandate. One of `online` or `offline`.", -83941c86750 -< "description": "ID of the payment method (a PaymentMethod, Card, or [compatible Source](https://stripe.com/docs/payments/payment-methods/transitioning#compatibility) object) to attach to this PaymentIntent.\n\nIf this parameter is omitted with `confirm=true`, `customer.default_source` will be attached as this PaymentIntent's payment instrument to improve the migration experience for users of the Charges API. We recommend that you explicitly provide the `payment_method` going forward.", ---- -> "description": "ID of the payment method (a PaymentMethod, Card, or [compatible Source](https://stripe.com/docs/payments/payment-methods#compatibility) object) to attach to this PaymentIntent.\n\nIf neither the `payment_method` parameter nor the `source` parameter are provided with `confirm=true`, `source` will be automatically populated with `customer.default_source` to improve the migration experience for users of the Charges API. We recommend that you explicitly provide the `payment_method` going forward.", -83948a86758 -> "description": "If this is an `acss_debit` PaymentMethod, this hash contains details about the ACSS Debit payment method.", -83950a86761 -> "description": "Customer's bank account number.", -83954a86766 -> "description": "Institution number of the customer's bank.", -83958a86771 -> "description": "Transit number of the customer's bank.", -83971a86785 -> "description": "If this is an `affirm` PaymentMethod, this hash contains details about the Affirm payment method.", -83976a86791 -> "description": "If this is an `AfterpayClearpay` PaymentMethod, this hash contains details about the AfterpayClearpay payment method.", -83981a86797 -> "description": "If this is an `Alipay` PaymentMethod, this hash contains details about the Alipay payment method.", -83986a86803 -> "description": "If this is an `au_becs_debit` PaymentMethod, this hash contains details about the bank account.", -83988a86806 -> "description": "The account number for the bank account.", -83992a86811 -> "description": "Bank-State-Branch number of the bank account.", -84004a86824 -> "description": "If this is a `bacs_debit` PaymentMethod, this hash contains details about the Bacs Direct Debit bank account.", -84006a86827 -> "description": "Account number of the bank account that the funds will be debited from.", -84010a86832 -> "description": "Sort code of the bank account. (e.g., `10-20-30`)", -84018a86841 -> "description": "If this is a `bancontact` PaymentMethod, this hash contains details about the Bancontact payment method.", -84023a86847 -> "description": "Billing information associated with the PaymentMethod that may be used or required by particular types of payment methods.", -84029a86854 -> "description": "City, district, suburb, town, or village.", -84033a86859 -> "description": "Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)).", -84037a86864 -> "description": "Address line 1 (e.g., street, PO Box, or company name).", -84041a86869 -> "description": "Address line 2 (e.g., apartment, suite, unit, or building).", -84045a86874 -> "description": "ZIP or postal code.", -84049a86879 -> "description": "State, county, province, or region.", -84063c86893,86894 -< ] ---- -> ], -> "description": "Billing address." -84076c86907,86908 -< ] ---- -> ], -> "description": "Email address." -84078a86911 -> "description": "Full name.", -84082a86916 -> "description": "Billing phone number (including extension).", -84090a86925 -> "description": "If this is a `blik` PaymentMethod, this hash contains details about the BLIK payment method.", -84095a86931 -> "description": "If this is a `boleto` PaymentMethod, this hash contains details about the Boleto payment method.", -84097a86934 -> "description": "The tax ID of the customer (CPF for individual consumers or CNPJ for businesses consumers)", -84108a86946 -> "description": "If this is a `customer_balance` PaymentMethod, this hash contains details about the CustomerBalance payment method.", -84113a86952 -> "description": "If this is an `eps` PaymentMethod, this hash contains details about the EPS payment method.", -84115a86955 -> "description": "The customer's bank.", -84153a86994 -> "description": "If this is an `fpx` PaymentMethod, this hash contains details about the FPX payment method.", -84154a86996,87004 -> "account_holder_type": { -> "description": "Account holder type for FPX transaction", -> "enum": [ -> "company", -> "individual" -> ], -> "maxLength": 5000, -> "type": "string" -> }, -84155a87006 -> "description": "The customer's bank.", -84191a87043 -> "description": "If this is a `giropay` PaymentMethod, this hash contains details about the Giropay payment method.", -84196a87049 -> "description": "If this is a `grabpay` PaymentMethod, this hash contains details about the GrabPay payment method.", -84201a87055 -> "description": "If this is an `ideal` PaymentMethod, this hash contains details about the iDEAL payment method.", -84203a87058 -> "description": "The customer's bank.", -84226a87082 -> "description": "If this is an `interac_present` PaymentMethod, this hash contains details about the Interac Present payment method.", -84231a87088 -> "description": "If this is a `klarna` PaymentMethod, this hash contains details about the Klarna payment method.", -84233a87091 -> "description": "Customer's date of birth", -84235a87094 -> "description": "The day of birth, between 1 and 31.", -84238a87098 -> "description": "The month of birth, between 1 and 12.", -84241a87102 -> "description": "The four-digit year of birth.", -84257a87119 -> "description": "If this is a `konbini` PaymentMethod, this hash contains details about the Konbini payment method.", -84262a87125 -> "description": "If this is an `Link` PaymentMethod, this hash contains details about the Link payment method.", -84270a87134 -> "description": "Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`.", -84273a87138 -> "description": "If this is an `oxxo` PaymentMethod, this hash contains details about the OXXO payment method.", -84278a87144 -> "description": "If this is a `p24` PaymentMethod, this hash contains details about the P24 payment method.", -84280a87147 -> "description": "The customer's bank.", -84315a87183 -> "description": "If this is a `paynow` PaymentMethod, this hash contains details about the PayNow payment method.", -84320a87189 -> "description": "If this is a `pix` PaymentMethod, this hash contains details about the Pix payment method.", -84325a87195 -> "description": "If this is a `promptpay` PaymentMethod, this hash contains details about the PromptPay payment method.", -84330a87201 -> "description": "Options to configure Radar. See [Radar Session](https://stripe.com/docs/radar/radar-session) for more information.", -84332a87204 -> "description": "A [Radar Session](https://stripe.com/docs/radar/radar-session) is a snapshot of the browser metadata and device details that help Radar make more accurate predictions on your payments.", -84340a87213 -> "description": "If this is a `sepa_debit` PaymentMethod, this hash contains details about the SEPA debit bank account.", -84342a87216 -> "description": "IBAN of the bank account.", -84353a87228 -> "description": "If this is a `sofort` PaymentMethod, this hash contains details about the SOFORT payment method.", -84355a87231 -> "description": "Two-letter ISO code representing the country the bank account is located in.", -84373a87250 -> "description": "The type of the PaymentMethod. An additional hash is included on the PaymentMethod with a name matching this value. It contains additional information specific to the PaymentMethod type.", -84406a87284 -> "description": "If this is an `us_bank_account` PaymentMethod, this hash contains details about the US bank account payment method.", -84408a87287 -> "description": "Account holder type: individual or company.", -84415a87295 -> "description": "Account number of the bank account.", -84419a87300 -> "description": "Account type: checkings or savings. Defaults to checking if omitted.", -84426a87308 -> "description": "The ID of a Financial Connections Account to use as a payment method.", -84430a87313 -> "description": "Routing number of the bank account.", -84438a87322 -> "description": "If this is an `wechat_pay` PaymentMethod, this hash contains details about the wechat_pay payment method.", -84457a87342 -> "description": "Additional fields for Mandate creation", -84470c87355,87356 -< ] ---- -> ], -> "description": "A URL for custom mandate text to render during confirmation step.\nThe URL will be rendered with additional GET parameters `payment_intent` and `payment_intent_client_secret` when confirming a Payment Intent,\nor `setup_intent` and `setup_intent_client_secret` when confirming a Setup Intent." -84472a87359 -> "description": "Description of the mandate interval. Only required if 'payment_schedule' parameter is 'interval' or 'combined'.", -84476a87364 -> "description": "Payment schedule for the mandate.", -84484a87373 -> "description": "Transaction type of the mandate.", -84495a87385 -> "description": "Indicates that you intend to make future payments with this PaymentIntent's payment method.\n\nProviding this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes.\n\nWhen processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication).\n\nIf `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`.", -84504a87395 -> "description": "Verification method for the intent", -84523c87414,87415 -< ] ---- -> ], -> "description": "If this is a `acss_debit` PaymentMethod, this sub-hash contains details about the ACSS Debit payment method options." -84529a87422 -> "description": "Controls when the funds will be captured from the customer's account.\n\nIf provided, this parameter will override the top-level `capture_method` when finalizing the payment with this payment method type.\n\nIf `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter will unset the stored value for this payment method type.", -84536a87430 -> "description": "Indicates that you intend to make future payments with this PaymentIntent's payment method.\n\nProviding this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes.\n\nWhen processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication).\n\nIf `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`.", -84552c87446,87447 -< ] ---- -> ], -> "description": "If this is an `affirm` PaymentMethod, this sub-hash contains details about the Affirm payment method options." -84558a87454 -> "description": "Controls when the funds will be captured from the customer's account.\n\nIf provided, this parameter will override the top-level `capture_method` when finalizing the payment with this payment method type.\n\nIf `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter will unset the stored value for this payment method type.", -84565a87462 -> "description": "Order identifier shown to the customer in Afterpay’s online portal. We recommend using a value that helps you answer any questions a customer might have about\nthe payment. The identifier is limited to 128 characters and may contain only letters, digits, underscores, backslashes and dashes.", -84569a87467 -> "description": "Indicates that you intend to make future payments with this PaymentIntent's payment method.\n\nProviding this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes.\n\nWhen processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication).\n\nIf `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`.", -84586c87484,87485 -< ] ---- -> ], -> "description": "If this is a `afterpay_clearpay` PaymentMethod, this sub-hash contains details about the Afterpay Clearpay payment method options." -84592a87492 -> "description": "Indicates that you intend to make future payments with this PaymentIntent's payment method.\n\nProviding this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes.\n\nWhen processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication).\n\nIf `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`.", -84610c87510,87511 -< ] ---- -> ], -> "description": "If this is a `alipay` PaymentMethod, this sub-hash contains details about the Alipay payment method options." -84616a87518 -> "description": "Indicates that you intend to make future payments with this PaymentIntent's payment method.\n\nProviding this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes.\n\nWhen processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication).\n\nIf `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`.", -84635c87537,87538 -< ] ---- -> ], -> "description": "If this is a `au_becs_debit` PaymentMethod, this sub-hash contains details about the AU BECS Direct Debit payment method options." -84641a87545 -> "description": "Indicates that you intend to make future payments with this PaymentIntent's payment method.\n\nProviding this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes.\n\nWhen processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication).\n\nIf `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`.", -84660c87564,87565 -< ] ---- -> ], -> "description": "If this is a `bacs_debit` PaymentMethod, this sub-hash contains details about the BACS Debit payment method options." -84666a87572 -> "description": "Preferred language of the Bancontact authorization page that the customer is redirected to.", -84675a87582 -> "description": "Indicates that you intend to make future payments with this PaymentIntent's payment method.\n\nProviding this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes.\n\nWhen processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication).\n\nIf `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`.", -84693c87600,87601 -< ] ---- -> ], -> "description": "If this is a `bancontact` PaymentMethod, this sub-hash contains details about the Bancontact payment method options." -84699a87608 -> "description": "The 6-digit BLIK code that a customer has generated using their banking application. Can only be set on confirmation.", -84713c87622,87623 -< ] ---- -> ], -> "description": "If this is a `blik` PaymentMethod, this sub-hash contains details about the BLIK payment method options." -84719a87630 -> "description": "The number of calendar days before a Boleto voucher expires. For example, if you create a Boleto voucher on Monday and you set expires_after_days to 2, the Boleto invoice will expire on Wednesday at 23:59 America/Sao_Paulo time.", -84722a87634 -> "description": "Indicates that you intend to make future payments with this PaymentIntent's payment method.\n\nProviding this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes.\n\nWhen processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication).\n\nIf `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`.", -84741c87653,87654 -< ] ---- -> ], -> "description": "If this is a `boleto` PaymentMethod, this sub-hash contains details about the Boleto payment method options." -84747a87661 -> "description": "Controls when the funds will be captured from the customer's account.\n\nIf provided, this parameter will override the top-level `capture_method` when finalizing the payment with this payment method type.\n\nIf `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter will unset the stored value for this payment method type.", -84754a87669 -> "description": "A single-use `cvc_update` Token that represents a card CVC value. When provided, the CVC value will be verified during the card payment attempt. This parameter can only be provided during confirmation.", -84758a87674 -> "description": "Installment configuration for payments attempted on this PaymentIntent (Mexico Only).\n\nFor more information, see the [installments integration guide](https://stripe.com/docs/payments/installments).", -84760a87677 -> "description": "Setting to true enables installments for this PaymentIntent.\nThis will cause the response to contain a list of available installment plans.\nSetting to false will prevent any selected plan from applying to a charge.", -84767a87685 -> "description": "For `fixed_count` installment plans, this is the number of installment payments your customer will make to their credit card.", -84770a87689 -> "description": "For `fixed_count` installment plans, this is the interval between installment payments your customer will make to their credit card.\nOne of `month`.", -84776a87696 -> "description": "Type of installment plan, one of `fixed_count`.", -84797c87717,87718 -< ] ---- -> ], -> "description": "The selected installment plan to use for this payment attempt.\nThis parameter can only be provided during confirmation." -84803a87725 -> "description": "Configuration options for setting up an eMandate for cards issued in India.", -84805a87728 -> "description": "Amount to be charged for future payments.", -84808a87732 -> "description": "One of `fixed` or `maximum`. If `fixed`, the `amount` param refers to the exact amount to be charged in future payments. If `maximum`, the amount charged can be up to the value passed for the `amount` param.", -84815a87740 -> "description": "A description of the mandate or subscription that is meant to be displayed to the customer.", -84819a87745 -> "description": "End date of the mandate or subscription. If not provided, the mandate will be active until canceled. If provided, end date should be after start date.", -84823a87750 -> "description": "Specifies payment frequency. One of `day`, `week`, `month`, `year`, or `sporadic`.", -84833a87761 -> "description": "The number of intervals between payments. For example, `interval=month` and `interval_count=3` indicates one payment every three months. Maximum of one year interval allowed (1 year, 12 months, or 52 weeks). This parameter is optional when `interval=sporadic`.", -84836a87765 -> "description": "Unique identifier for the mandate or subscription.", -84840a87770 -> "description": "Start date of the mandate or subscription. Start date should not be lesser than yesterday.", -84844a87775 -> "description": "Specifies the type of mandates supported. Possible values are `india`.", -84863a87795,87798 -> "moto": { -> "description": "When specified, this parameter indicates that a transaction will be marked\nas MOTO (Mail Order Telephone Order) and thus out of scope for SCA. This\nparameter can only be provided during confirmation.", -> "type": "boolean" -> }, -84864a87800 -> "description": "Selected network to process this PaymentIntent on. Depends on the available networks of the card attached to the PaymentIntent. Can be only set confirm-time.", -84881a87818 -> "description": "We strongly recommend that you rely on our SCA Engine to automatically prompt your customers for authentication based on risk level and [other requirements](https://stripe.com/docs/strong-customer-authentication). However, if you wish to request 3D Secure based on logic from your own fraud engine, provide this option. Permitted values include: `automatic` or `any`. If not provided, defaults to `automatic`. Read our guide on [manually requesting 3D Secure](https://stripe.com/docs/payments/3d-secure#manual-three-ds) for more information on how this configuration interacts with Radar and our SCA Engine.", -84890a87828 -> "description": "Indicates that you intend to make future payments with this PaymentIntent's payment method.\n\nProviding this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes.\n\nWhen processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication).\n\nIf `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`.", -84911c87849,87850 -< ] ---- -> ], -> "description": "Provides information about a card payment that customers see on their statements. Concatenated with the Kana prefix (shortened Kana descriptor) or Kana statement descriptor that’s set on the account to form the complete statement descriptor. Maximum 22 characters. On card statements, the *concatenation* of both prefix and suffix (including separators) will appear truncated to 22 characters." -84925c87864,87865 -< ] ---- -> ], -> "description": "Provides information about a card payment that customers see on their statements. Concatenated with the Kanji prefix (shortened Kanji descriptor) or Kanji statement descriptor that’s set on the account to form the complete statement descriptor. Maximum 17 characters. On card statements, the *concatenation* of both prefix and suffix (including separators) will appear truncated to 17 characters." -84937c87877,87878 -< ] ---- -> ], -> "description": "Configuration for any card payments attempted on this PaymentIntent." -84943a87885 -> "description": "Request ability to capture this payment beyond the standard [authorization validity window](https://stripe.com/docs/terminal/features/extended-authorizations#authorization-validity)", -84946a87889 -> "description": "Request ability to [increment](https://stripe.com/docs/terminal/features/incremental-authorizations) this PaymentIntent if the combination of MCC and card brand is eligible. Check [incremental_authorization_supported](https://stripe.com/docs/api/charges/object#charge_object-payment_method_details-card_present-incremental_authorization_supported) in the [Confirm](https://stripe.com/docs/api/payment_intents/confirm) response to verify support.", -84959c87902,87903 -< ] ---- -> ], -> "description": "If this is a `card_present` PaymentMethod, this sub-hash contains details about the Card Present payment method options." -84965a87910 -> "description": "Configuration for the bank transfer funding type, if the `funding_type` is set to `bank_transfer`.", -84969a87915 -> "description": "The desired country code of the bank account information. Permitted values include: `DE`, `ES`, `FR`, `IE`, or `NL`.", -84980a87927 -> "description": "List of address types that should be returned in the financial_addresses response. If not specified, all valid types will be returned.\n\nPermitted values include: `sort_code`, `zengin`, `iban`, or `spei`.", -84994a87942 -> "description": "The list of bank transfer types that this PaymentIntent is allowed to use for funding Permitted values include: `eu_bank_transfer`, `gb_bank_transfer`, `jp_bank_transfer`, or `mx_bank_transfer`.", -85011a87960 -> "description": "The funding method type to be used when there are not enough funds in the customer balance. Permitted values include: `bank_transfer`.", -85017a87967 -> "description": "Indicates that you intend to make future payments with this PaymentIntent's payment method.\n\nProviding this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes.\n\nWhen processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication).\n\nIf `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`.", -85033c87983,87984 -< ] ---- -> ], -> "description": "If this is a `customer balance` PaymentMethod, this sub-hash contains details about the customer balance payment method options." -85039a87991 -> "description": "Indicates that you intend to make future payments with this PaymentIntent's payment method.\n\nProviding this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes.\n\nWhen processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication).\n\nIf `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`.", -85055c88007,88008 -< ] ---- -> ], -> "description": "If this is a `eps` PaymentMethod, this sub-hash contains details about the EPS payment method options." -85061a88015 -> "description": "Indicates that you intend to make future payments with this PaymentIntent's payment method.\n\nProviding this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes.\n\nWhen processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication).\n\nIf `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`.", -85077c88031,88032 -< ] ---- -> ], -> "description": "If this is a `fpx` PaymentMethod, this sub-hash contains details about the FPX payment method options." -85083a88039 -> "description": "Indicates that you intend to make future payments with this PaymentIntent's payment method.\n\nProviding this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes.\n\nWhen processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication).\n\nIf `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`.", -85099c88055,88056 -< ] ---- -> ], -> "description": "If this is a `giropay` PaymentMethod, this sub-hash contains details about the Giropay payment method options." -85105a88063 -> "description": "Indicates that you intend to make future payments with this PaymentIntent's payment method.\n\nProviding this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes.\n\nWhen processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication).\n\nIf `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`.", -85121c88079,88080 -< ] ---- -> ], -> "description": "If this is a `grabpay` PaymentMethod, this sub-hash contains details about the Grabpay payment method options." -85127a88087 -> "description": "Indicates that you intend to make future payments with this PaymentIntent's payment method.\n\nProviding this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes.\n\nWhen processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication).\n\nIf `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`.", -85145c88105,88106 -< ] ---- -> ], -> "description": "If this is a `ideal` PaymentMethod, this sub-hash contains details about the Ideal payment method options." -85160c88121,88122 -< ] ---- -> ], -> "description": "If this is a `interac_present` PaymentMethod, this sub-hash contains details about the Card Present payment method options." -85166a88129 -> "description": "Controls when the funds will be captured from the customer's account.\n\nIf provided, this parameter will override the top-level `capture_method` when finalizing the payment with this payment method type.\n\nIf `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter will unset the stored value for this payment method type.", -85173a88137 -> "description": "Preferred language of the Klarna authorization page that the customer is redirected to", -85219a88184 -> "description": "Indicates that you intend to make future payments with this PaymentIntent's payment method.\n\nProviding this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes.\n\nWhen processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication).\n\nIf `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`.", -85235c88200,88201 -< ] ---- -> ], -> "description": "If this is a `klarna` PaymentMethod, this sub-hash contains details about the Klarna payment method options." -85241a88208 -> "description": "An optional 10 to 11 digit numeric-only string determining the confirmation code at applicable convenience stores. Must not consist of only zeroes and could be rejected in case of insufficient uniqueness. We recommend to use the customer's phone number.", -85256c88223,88224 -< ] ---- -> ], -> "description": "The number of calendar days (between 1 and 60) after which Konbini payment instructions will expire. For example, if a PaymentIntent is confirmed with Konbini and `expires_after_days` set to 2 on Monday JST, the instructions will expire on Wednesday 23:59:59 JST. Defaults to 3 days." -85270c88238,88239 -< ] ---- -> ], -> "description": "The timestamp at which the Konbini payment instructions will expire. Only one of `expires_after_days` or `expires_at` may be set." -85272a88242 -> "description": "A product descriptor of up to 22 characters, which will appear to customers at the convenience store.", -85276a88247 -> "description": "Indicates that you intend to make future payments with this PaymentIntent's payment method.\n\nProviding this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes.\n\nWhen processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication).\n\nIf `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`.", -85292c88263,88264 -< ] ---- -> ], -> "description": "If this is a `konbini` PaymentMethod, this sub-hash contains details about the Konbini payment method options." -85298a88271 -> "description": "Controls when the funds will be captured from the customer's account.\n\nIf provided, this parameter will override the top-level `capture_method` when finalizing the payment with this payment method type.\n\nIf `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter will unset the stored value for this payment method type.", -85305a88279 -> "description": "Token used for persistent Link logins.", -85309a88284 -> "description": "Indicates that you intend to make future payments with this PaymentIntent's payment method.\n\nProviding this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes.\n\nWhen processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication).\n\nIf `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`.", -85327c88302,88303 -< ] ---- -> ], -> "description": "If this is a `link` PaymentMethod, this sub-hash contains details about the Link payment method options." -85333a88310 -> "description": "The number of calendar days before an OXXO voucher expires. For example, if you create an OXXO voucher on Monday and you set expires_after_days to 2, the OXXO invoice will expire on Wednesday at 23:59 America/Mexico_City time.", -85336a88314 -> "description": "Indicates that you intend to make future payments with this PaymentIntent's payment method.\n\nProviding this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes.\n\nWhen processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication).\n\nIf `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`.", -85352c88330,88331 -< ] ---- -> ], -> "description": "If this is a `oxxo` PaymentMethod, this sub-hash contains details about the OXXO payment method options." -85358a88338 -> "description": "Indicates that you intend to make future payments with this PaymentIntent's payment method.\n\nProviding this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes.\n\nWhen processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication).\n\nIf `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`.", -85364a88345 -> "description": "Confirm that the payer has accepted the P24 terms and conditions.", -85377c88358,88359 -< ] ---- -> ], -> "description": "If this is a `p24` PaymentMethod, this sub-hash contains details about the Przelewy24 payment method options." -85383a88366 -> "description": "Indicates that you intend to make future payments with this PaymentIntent's payment method.\n\nProviding this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes.\n\nWhen processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication).\n\nIf `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`.", -85399c88382,88383 -< ] ---- -> ], -> "description": "If this is a `paynow` PaymentMethod, this sub-hash contains details about the PayNow payment method options." -85405a88390 -> "description": "The number of seconds (between 10 and 1209600) after which Pix payment will expire. Defaults to 86400 seconds.", -85408a88394 -> "description": "The timestamp at which the Pix expires (between 10 and 1209600 seconds in the future). Defaults to 1 day in the future.", -85412a88399 -> "description": "Indicates that you intend to make future payments with this PaymentIntent's payment method.\n\nProviding this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes.\n\nWhen processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication).\n\nIf `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`.", -85428c88415,88416 -< ] ---- -> ], -> "description": "If this is a `pix` PaymentMethod, this sub-hash contains details about the Pix payment method options." -85434a88423 -> "description": "Indicates that you intend to make future payments with this PaymentIntent's payment method.\n\nProviding this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes.\n\nWhen processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication).\n\nIf `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`.", -85450c88439,88440 -< ] ---- -> ], -> "description": "If this is a `promptpay` PaymentMethod, this sub-hash contains details about the PromptPay payment method options." -85456a88447 -> "description": "Additional fields for Mandate creation", -85461a88453 -> "description": "Indicates that you intend to make future payments with this PaymentIntent's payment method.\n\nProviding this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes.\n\nWhen processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication).\n\nIf `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`.", -85480c88472,88473 -< ] ---- -> ], -> "description": "If this is a `sepa_debit` PaymentIntent, this sub-hash contains details about the SEPA Debit payment method options." -85486a88480 -> "description": "Language shown to the payer on redirect.", -85499a88494 -> "description": "Indicates that you intend to make future payments with this PaymentIntent's payment method.\n\nProviding this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes.\n\nWhen processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication).\n\nIf `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`.", -85517c88512,88513 -< ] ---- -> ], -> "description": "If this is a `sofort` PaymentMethod, this sub-hash contains details about the SOFORT payment method options." -85523a88520 -> "description": "Additional fields for Financial Connections Session creation", -85525a88523 -> "description": "The list of permissions to request. If this parameter is passed, the `payment_method` permission must be included. Valid permissions include: `balances`, `ownership`, `payment_method`, and `transactions`.", -85539a88538 -> "description": "For webview integrations only. Upon completing OAuth login in the native browser, the user will be redirected to this URL to return to your app.", -85547a88547 -> "description": "Additional fields for network related functions", -85549a88550 -> "description": "Triggers validations to run across the selected networks", -85563a88565 -> "description": "Indicates that you intend to make future payments with this PaymentIntent's payment method.\n\nProviding this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes.\n\nWhen processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication).\n\nIf `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`.", -85572a88575 -> "description": "Verification method for the intent", -85591c88594,88595 -< ] ---- -> ], -> "description": "If this is a `us_bank_account` PaymentMethod, this sub-hash contains details about the US bank account payment method options." -85597a88602 -> "description": "The app ID registered with WeChat Pay. Only required when client is ios or android.", -85601a88607 -> "description": "The client type that the end customer will pay from", -85610a88617 -> "description": "Indicates that you intend to make future payments with this PaymentIntent's payment method.\n\nProviding this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes.\n\nWhen processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication).\n\nIf `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`.", -85629c88636,88637 -< ] ---- -> ], -> "description": "If this is a `wechat_pay` PaymentMethod, this sub-hash contains details about the WeChat Pay payment method options." -85646a88655 -> "description": "A [Radar Session](https://stripe.com/docs/radar/radar-session) is a snapshot of the browser metadata and device details that help Radar make more accurate predictions on your payments.", -85673a88683 -> "description": "Shipping address.", -85675a88686 -> "description": "City, district, suburb, town, or village.", -85679a88691 -> "description": "Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)).", -85683a88696 -> "description": "Address line 1 (e.g., street, PO Box, or company name).", -85687a88701 -> "description": "Address line 2 (e.g., apartment, suite, unit, or building).", -85691a88706 -> "description": "ZIP or postal code.", -85695a88711 -> "description": "State, county, province, or region.", -85703a88720 -> "description": "The delivery service that shipped a physical product, such as Fedex, UPS, USPS, etc.", -85707a88725 -> "description": "Recipient name.", -85711a88730 -> "description": "Recipient phone (including extension).", -85715a88735 -> "description": "The tracking number for a physical product, obtained from the delivery service. If multiple tracking numbers were generated for this purchase, please separate them with commas.", -85740a88761 -> "description": "The amount that will be transferred automatically when a charge succeeds.\nThe amount is capped at the total transaction amount and if no amount is set,\nthe full amount is transferred.\n\nIf you intend to collect a fee and you need a more robust reporting experience, using\n[application_fee_amount](https://stripe.com/docs/api/payment_intents/create#create_payment_intent-application_fee_amount)\nmight be a better fit for your integration.", -85743a88765 -> "description": "If specified, successful charges will be attributed to the destination\naccount for tax reporting, and the funds from charges will be transferred\nto the destination account. The ID of the resulting transfer will be\nreturned on the successful charge's `transfer` field.", -85901a88924 -> "next_page", -86138a89162 -> "description": "If this is an `acss_debit` PaymentMethod, this hash contains details about the ACSS Debit payment method.", -86140a89165 -> "description": "Customer's bank account number.", -86144a89170 -> "description": "Institution number of the customer's bank.", -86148a89175 -> "description": "Transit number of the customer's bank.", -86161a89189 -> "description": "If this is an `affirm` PaymentMethod, this hash contains details about the Affirm payment method.", -86166a89195 -> "description": "If this is an `AfterpayClearpay` PaymentMethod, this hash contains details about the AfterpayClearpay payment method.", -86171a89201 -> "description": "If this is an `Alipay` PaymentMethod, this hash contains details about the Alipay payment method.", -86176a89207 -> "description": "If this is an `au_becs_debit` PaymentMethod, this hash contains details about the bank account.", -86178a89210 -> "description": "The account number for the bank account.", -86182a89215 -> "description": "Bank-State-Branch number of the bank account.", -86194a89228 -> "description": "If this is a `bacs_debit` PaymentMethod, this hash contains details about the Bacs Direct Debit bank account.", -86196a89231 -> "description": "Account number of the bank account that the funds will be debited from.", -86200a89236 -> "description": "Sort code of the bank account. (e.g., `10-20-30`)", -86208a89245 -> "description": "If this is a `bancontact` PaymentMethod, this hash contains details about the Bancontact payment method.", -86213a89251 -> "description": "Billing information associated with the PaymentMethod that may be used or required by particular types of payment methods.", -86219a89258 -> "description": "City, district, suburb, town, or village.", -86223a89263 -> "description": "Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)).", -86227a89268 -> "description": "Address line 1 (e.g., street, PO Box, or company name).", -86231a89273 -> "description": "Address line 2 (e.g., apartment, suite, unit, or building).", -86235a89278 -> "description": "ZIP or postal code.", -86239a89283 -> "description": "State, county, province, or region.", -86253c89297,89298 -< ] ---- -> ], -> "description": "Billing address." -86266c89311,89312 -< ] ---- -> ], -> "description": "Email address." -86268a89315 -> "description": "Full name.", -86272a89320 -> "description": "Billing phone number (including extension).", -86280a89329 -> "description": "If this is a `blik` PaymentMethod, this hash contains details about the BLIK payment method.", -86285a89335 -> "description": "If this is a `boleto` PaymentMethod, this hash contains details about the Boleto payment method.", -86287a89338 -> "description": "The tax ID of the customer (CPF for individual consumers or CNPJ for businesses consumers)", -86298a89350 -> "description": "If this is a `customer_balance` PaymentMethod, this hash contains details about the CustomerBalance payment method.", -86303a89356 -> "description": "If this is an `eps` PaymentMethod, this hash contains details about the EPS payment method.", -86305a89359 -> "description": "The customer's bank.", -86343a89398 -> "description": "If this is an `fpx` PaymentMethod, this hash contains details about the FPX payment method.", -86344a89400,89408 -> "account_holder_type": { -> "description": "Account holder type for FPX transaction", -> "enum": [ -> "company", -> "individual" -> ], -> "maxLength": 5000, -> "type": "string" -> }, -86345a89410 -> "description": "The customer's bank.", -86381a89447 -> "description": "If this is a `giropay` PaymentMethod, this hash contains details about the Giropay payment method.", -86386a89453 -> "description": "If this is a `grabpay` PaymentMethod, this hash contains details about the GrabPay payment method.", -86391a89459 -> "description": "If this is an `ideal` PaymentMethod, this hash contains details about the iDEAL payment method.", -86393a89462 -> "description": "The customer's bank.", -86416a89486 -> "description": "If this is an `interac_present` PaymentMethod, this hash contains details about the Interac Present payment method.", -86421a89492 -> "description": "If this is a `klarna` PaymentMethod, this hash contains details about the Klarna payment method.", -86423a89495 -> "description": "Customer's date of birth", -86425a89498 -> "description": "The day of birth, between 1 and 31.", -86428a89502 -> "description": "The month of birth, between 1 and 12.", -86431a89506 -> "description": "The four-digit year of birth.", -86447a89523 -> "description": "If this is a `konbini` PaymentMethod, this hash contains details about the Konbini payment method.", -86452a89529 -> "description": "If this is an `Link` PaymentMethod, this hash contains details about the Link payment method.", -86460a89538 -> "description": "Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`.", -86463a89542 -> "description": "If this is an `oxxo` PaymentMethod, this hash contains details about the OXXO payment method.", -86468a89548 -> "description": "If this is a `p24` PaymentMethod, this hash contains details about the P24 payment method.", -86470a89551 -> "description": "The customer's bank.", -86505a89587 -> "description": "If this is a `paynow` PaymentMethod, this hash contains details about the PayNow payment method.", -86510a89593 -> "description": "If this is a `pix` PaymentMethod, this hash contains details about the Pix payment method.", -86515a89599 -> "description": "If this is a `promptpay` PaymentMethod, this hash contains details about the PromptPay payment method.", -86520a89605 -> "description": "Options to configure Radar. See [Radar Session](https://stripe.com/docs/radar/radar-session) for more information.", -86522a89608 -> "description": "A [Radar Session](https://stripe.com/docs/radar/radar-session) is a snapshot of the browser metadata and device details that help Radar make more accurate predictions on your payments.", -86530a89617 -> "description": "If this is a `sepa_debit` PaymentMethod, this hash contains details about the SEPA debit bank account.", -86532a89620 -> "description": "IBAN of the bank account.", -86543a89632 -> "description": "If this is a `sofort` PaymentMethod, this hash contains details about the SOFORT payment method.", -86545a89635 -> "description": "Two-letter ISO code representing the country the bank account is located in.", -86563a89654 -> "description": "The type of the PaymentMethod. An additional hash is included on the PaymentMethod with a name matching this value. It contains additional information specific to the PaymentMethod type.", -86596a89688 -> "description": "If this is an `us_bank_account` PaymentMethod, this hash contains details about the US bank account payment method.", -86598a89691 -> "description": "Account holder type: individual or company.", -86605a89699 -> "description": "Account number of the bank account.", -86609a89704 -> "description": "Account type: checkings or savings. Defaults to checking if omitted.", -86616a89712 -> "description": "The ID of a Financial Connections Account to use as a payment method.", -86620a89717 -> "description": "Routing number of the bank account.", -86628a89726 -> "description": "If this is an `wechat_pay` PaymentMethod, this hash contains details about the wechat_pay payment method.", -86647a89746 -> "description": "Additional fields for Mandate creation", -86660c89759,89760 -< ] ---- -> ], -> "description": "A URL for custom mandate text to render during confirmation step.\nThe URL will be rendered with additional GET parameters `payment_intent` and `payment_intent_client_secret` when confirming a Payment Intent,\nor `setup_intent` and `setup_intent_client_secret` when confirming a Setup Intent." -86662a89763 -> "description": "Description of the mandate interval. Only required if 'payment_schedule' parameter is 'interval' or 'combined'.", -86666a89768 -> "description": "Payment schedule for the mandate.", -86674a89777 -> "description": "Transaction type of the mandate.", -86685a89789 -> "description": "Indicates that you intend to make future payments with this PaymentIntent's payment method.\n\nProviding this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes.\n\nWhen processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication).\n\nIf `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`.", -86694a89799 -> "description": "Verification method for the intent", -86713c89818,89819 -< ] ---- -> ], -> "description": "If this is a `acss_debit` PaymentMethod, this sub-hash contains details about the ACSS Debit payment method options." -86719a89826 -> "description": "Controls when the funds will be captured from the customer's account.\n\nIf provided, this parameter will override the top-level `capture_method` when finalizing the payment with this payment method type.\n\nIf `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter will unset the stored value for this payment method type.", -86726a89834 -> "description": "Indicates that you intend to make future payments with this PaymentIntent's payment method.\n\nProviding this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes.\n\nWhen processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication).\n\nIf `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`.", -86742c89850,89851 -< ] ---- -> ], -> "description": "If this is an `affirm` PaymentMethod, this sub-hash contains details about the Affirm payment method options." -86748a89858 -> "description": "Controls when the funds will be captured from the customer's account.\n\nIf provided, this parameter will override the top-level `capture_method` when finalizing the payment with this payment method type.\n\nIf `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter will unset the stored value for this payment method type.", -86755a89866 -> "description": "Order identifier shown to the customer in Afterpay’s online portal. We recommend using a value that helps you answer any questions a customer might have about\nthe payment. The identifier is limited to 128 characters and may contain only letters, digits, underscores, backslashes and dashes.", -86759a89871 -> "description": "Indicates that you intend to make future payments with this PaymentIntent's payment method.\n\nProviding this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes.\n\nWhen processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication).\n\nIf `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`.", -86776c89888,89889 -< ] ---- -> ], -> "description": "If this is a `afterpay_clearpay` PaymentMethod, this sub-hash contains details about the Afterpay Clearpay payment method options." -86782a89896 -> "description": "Indicates that you intend to make future payments with this PaymentIntent's payment method.\n\nProviding this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes.\n\nWhen processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication).\n\nIf `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`.", -86800c89914,89915 -< ] ---- -> ], -> "description": "If this is a `alipay` PaymentMethod, this sub-hash contains details about the Alipay payment method options." -86806a89922 -> "description": "Indicates that you intend to make future payments with this PaymentIntent's payment method.\n\nProviding this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes.\n\nWhen processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication).\n\nIf `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`.", -86825c89941,89942 -< ] ---- -> ], -> "description": "If this is a `au_becs_debit` PaymentMethod, this sub-hash contains details about the AU BECS Direct Debit payment method options." -86831a89949 -> "description": "Indicates that you intend to make future payments with this PaymentIntent's payment method.\n\nProviding this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes.\n\nWhen processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication).\n\nIf `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`.", -86850c89968,89969 -< ] ---- -> ], -> "description": "If this is a `bacs_debit` PaymentMethod, this sub-hash contains details about the BACS Debit payment method options." -86856a89976 -> "description": "Preferred language of the Bancontact authorization page that the customer is redirected to.", -86865a89986 -> "description": "Indicates that you intend to make future payments with this PaymentIntent's payment method.\n\nProviding this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes.\n\nWhen processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication).\n\nIf `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`.", -86883c90004,90005 -< ] ---- -> ], -> "description": "If this is a `bancontact` PaymentMethod, this sub-hash contains details about the Bancontact payment method options." -86889a90012 -> "description": "The 6-digit BLIK code that a customer has generated using their banking application. Can only be set on confirmation.", -86903c90026,90027 -< ] ---- -> ], -> "description": "If this is a `blik` PaymentMethod, this sub-hash contains details about the BLIK payment method options." -86909a90034 -> "description": "The number of calendar days before a Boleto voucher expires. For example, if you create a Boleto voucher on Monday and you set expires_after_days to 2, the Boleto invoice will expire on Wednesday at 23:59 America/Sao_Paulo time.", -86912a90038 -> "description": "Indicates that you intend to make future payments with this PaymentIntent's payment method.\n\nProviding this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes.\n\nWhen processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication).\n\nIf `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`.", -86931c90057,90058 -< ] ---- -> ], -> "description": "If this is a `boleto` PaymentMethod, this sub-hash contains details about the Boleto payment method options." -86937a90065 -> "description": "Controls when the funds will be captured from the customer's account.\n\nIf provided, this parameter will override the top-level `capture_method` when finalizing the payment with this payment method type.\n\nIf `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter will unset the stored value for this payment method type.", -86944a90073 -> "description": "A single-use `cvc_update` Token that represents a card CVC value. When provided, the CVC value will be verified during the card payment attempt. This parameter can only be provided during confirmation.", -86948a90078 -> "description": "Installment configuration for payments attempted on this PaymentIntent (Mexico Only).\n\nFor more information, see the [installments integration guide](https://stripe.com/docs/payments/installments).", -86950a90081 -> "description": "Setting to true enables installments for this PaymentIntent.\nThis will cause the response to contain a list of available installment plans.\nSetting to false will prevent any selected plan from applying to a charge.", -86957a90089 -> "description": "For `fixed_count` installment plans, this is the number of installment payments your customer will make to their credit card.", -86960a90093 -> "description": "For `fixed_count` installment plans, this is the interval between installment payments your customer will make to their credit card.\nOne of `month`.", -86966a90100 -> "description": "Type of installment plan, one of `fixed_count`.", -86987c90121,90122 -< ] ---- -> ], -> "description": "The selected installment plan to use for this payment attempt.\nThis parameter can only be provided during confirmation." -86993a90129 -> "description": "Configuration options for setting up an eMandate for cards issued in India.", -86995a90132 -> "description": "Amount to be charged for future payments.", -86998a90136 -> "description": "One of `fixed` or `maximum`. If `fixed`, the `amount` param refers to the exact amount to be charged in future payments. If `maximum`, the amount charged can be up to the value passed for the `amount` param.", -87005a90144 -> "description": "A description of the mandate or subscription that is meant to be displayed to the customer.", -87009a90149 -> "description": "End date of the mandate or subscription. If not provided, the mandate will be active until canceled. If provided, end date should be after start date.", -87013a90154 -> "description": "Specifies payment frequency. One of `day`, `week`, `month`, `year`, or `sporadic`.", -87023a90165 -> "description": "The number of intervals between payments. For example, `interval=month` and `interval_count=3` indicates one payment every three months. Maximum of one year interval allowed (1 year, 12 months, or 52 weeks). This parameter is optional when `interval=sporadic`.", -87026a90169 -> "description": "Unique identifier for the mandate or subscription.", -87030a90174 -> "description": "Start date of the mandate or subscription. Start date should not be lesser than yesterday.", -87034a90179 -> "description": "Specifies the type of mandates supported. Possible values are `india`.", -87053a90199,90202 -> "moto": { -> "description": "When specified, this parameter indicates that a transaction will be marked\nas MOTO (Mail Order Telephone Order) and thus out of scope for SCA. This\nparameter can only be provided during confirmation.", -> "type": "boolean" -> }, -87054a90204 -> "description": "Selected network to process this PaymentIntent on. Depends on the available networks of the card attached to the PaymentIntent. Can be only set confirm-time.", -87071a90222 -> "description": "We strongly recommend that you rely on our SCA Engine to automatically prompt your customers for authentication based on risk level and [other requirements](https://stripe.com/docs/strong-customer-authentication). However, if you wish to request 3D Secure based on logic from your own fraud engine, provide this option. Permitted values include: `automatic` or `any`. If not provided, defaults to `automatic`. Read our guide on [manually requesting 3D Secure](https://stripe.com/docs/payments/3d-secure#manual-three-ds) for more information on how this configuration interacts with Radar and our SCA Engine.", -87080a90232 -> "description": "Indicates that you intend to make future payments with this PaymentIntent's payment method.\n\nProviding this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes.\n\nWhen processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication).\n\nIf `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`.", -87101c90253,90254 -< ] ---- -> ], -> "description": "Provides information about a card payment that customers see on their statements. Concatenated with the Kana prefix (shortened Kana descriptor) or Kana statement descriptor that’s set on the account to form the complete statement descriptor. Maximum 22 characters. On card statements, the *concatenation* of both prefix and suffix (including separators) will appear truncated to 22 characters." -87115c90268,90269 -< ] ---- -> ], -> "description": "Provides information about a card payment that customers see on their statements. Concatenated with the Kanji prefix (shortened Kanji descriptor) or Kanji statement descriptor that’s set on the account to form the complete statement descriptor. Maximum 17 characters. On card statements, the *concatenation* of both prefix and suffix (including separators) will appear truncated to 17 characters." -87127c90281,90282 -< ] ---- -> ], -> "description": "Configuration for any card payments attempted on this PaymentIntent." -87133a90289 -> "description": "Request ability to capture this payment beyond the standard [authorization validity window](https://stripe.com/docs/terminal/features/extended-authorizations#authorization-validity)", -87136a90293 -> "description": "Request ability to [increment](https://stripe.com/docs/terminal/features/incremental-authorizations) this PaymentIntent if the combination of MCC and card brand is eligible. Check [incremental_authorization_supported](https://stripe.com/docs/api/charges/object#charge_object-payment_method_details-card_present-incremental_authorization_supported) in the [Confirm](https://stripe.com/docs/api/payment_intents/confirm) response to verify support.", -87149c90306,90307 -< ] ---- -> ], -> "description": "If this is a `card_present` PaymentMethod, this sub-hash contains details about the Card Present payment method options." -87155a90314 -> "description": "Configuration for the bank transfer funding type, if the `funding_type` is set to `bank_transfer`.", -87159a90319 -> "description": "The desired country code of the bank account information. Permitted values include: `DE`, `ES`, `FR`, `IE`, or `NL`.", -87170a90331 -> "description": "List of address types that should be returned in the financial_addresses response. If not specified, all valid types will be returned.\n\nPermitted values include: `sort_code`, `zengin`, `iban`, or `spei`.", -87184a90346 -> "description": "The list of bank transfer types that this PaymentIntent is allowed to use for funding Permitted values include: `eu_bank_transfer`, `gb_bank_transfer`, `jp_bank_transfer`, or `mx_bank_transfer`.", -87201a90364 -> "description": "The funding method type to be used when there are not enough funds in the customer balance. Permitted values include: `bank_transfer`.", -87207a90371 -> "description": "Indicates that you intend to make future payments with this PaymentIntent's payment method.\n\nProviding this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes.\n\nWhen processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication).\n\nIf `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`.", -87223c90387,90388 -< ] ---- -> ], -> "description": "If this is a `customer balance` PaymentMethod, this sub-hash contains details about the customer balance payment method options." -87229a90395 -> "description": "Indicates that you intend to make future payments with this PaymentIntent's payment method.\n\nProviding this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes.\n\nWhen processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication).\n\nIf `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`.", -87245c90411,90412 -< ] ---- -> ], -> "description": "If this is a `eps` PaymentMethod, this sub-hash contains details about the EPS payment method options." -87251a90419 -> "description": "Indicates that you intend to make future payments with this PaymentIntent's payment method.\n\nProviding this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes.\n\nWhen processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication).\n\nIf `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`.", -87267c90435,90436 -< ] ---- -> ], -> "description": "If this is a `fpx` PaymentMethod, this sub-hash contains details about the FPX payment method options." -87273a90443 -> "description": "Indicates that you intend to make future payments with this PaymentIntent's payment method.\n\nProviding this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes.\n\nWhen processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication).\n\nIf `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`.", -87289c90459,90460 -< ] ---- -> ], -> "description": "If this is a `giropay` PaymentMethod, this sub-hash contains details about the Giropay payment method options." -87295a90467 -> "description": "Indicates that you intend to make future payments with this PaymentIntent's payment method.\n\nProviding this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes.\n\nWhen processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication).\n\nIf `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`.", -87311c90483,90484 -< ] ---- -> ], -> "description": "If this is a `grabpay` PaymentMethod, this sub-hash contains details about the Grabpay payment method options." -87317a90491 -> "description": "Indicates that you intend to make future payments with this PaymentIntent's payment method.\n\nProviding this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes.\n\nWhen processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication).\n\nIf `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`.", -87335c90509,90510 -< ] ---- -> ], -> "description": "If this is a `ideal` PaymentMethod, this sub-hash contains details about the Ideal payment method options." -87350c90525,90526 -< ] ---- -> ], -> "description": "If this is a `interac_present` PaymentMethod, this sub-hash contains details about the Card Present payment method options." -87356a90533 -> "description": "Controls when the funds will be captured from the customer's account.\n\nIf provided, this parameter will override the top-level `capture_method` when finalizing the payment with this payment method type.\n\nIf `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter will unset the stored value for this payment method type.", -87363a90541 -> "description": "Preferred language of the Klarna authorization page that the customer is redirected to", -87409a90588 -> "description": "Indicates that you intend to make future payments with this PaymentIntent's payment method.\n\nProviding this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes.\n\nWhen processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication).\n\nIf `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`.", -87425c90604,90605 -< ] ---- -> ], -> "description": "If this is a `klarna` PaymentMethod, this sub-hash contains details about the Klarna payment method options." -87431a90612 -> "description": "An optional 10 to 11 digit numeric-only string determining the confirmation code at applicable convenience stores. Must not consist of only zeroes and could be rejected in case of insufficient uniqueness. We recommend to use the customer's phone number.", -87446c90627,90628 -< ] ---- -> ], -> "description": "The number of calendar days (between 1 and 60) after which Konbini payment instructions will expire. For example, if a PaymentIntent is confirmed with Konbini and `expires_after_days` set to 2 on Monday JST, the instructions will expire on Wednesday 23:59:59 JST. Defaults to 3 days." -87460c90642,90643 -< ] ---- -> ], -> "description": "The timestamp at which the Konbini payment instructions will expire. Only one of `expires_after_days` or `expires_at` may be set." -87462a90646 -> "description": "A product descriptor of up to 22 characters, which will appear to customers at the convenience store.", -87466a90651 -> "description": "Indicates that you intend to make future payments with this PaymentIntent's payment method.\n\nProviding this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes.\n\nWhen processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication).\n\nIf `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`.", -87482c90667,90668 -< ] ---- -> ], -> "description": "If this is a `konbini` PaymentMethod, this sub-hash contains details about the Konbini payment method options." -87488a90675 -> "description": "Controls when the funds will be captured from the customer's account.\n\nIf provided, this parameter will override the top-level `capture_method` when finalizing the payment with this payment method type.\n\nIf `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter will unset the stored value for this payment method type.", -87495a90683 -> "description": "Token used for persistent Link logins.", -87499a90688 -> "description": "Indicates that you intend to make future payments with this PaymentIntent's payment method.\n\nProviding this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes.\n\nWhen processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication).\n\nIf `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`.", -87517c90706,90707 -< ] ---- -> ], -> "description": "If this is a `link` PaymentMethod, this sub-hash contains details about the Link payment method options." -87523a90714 -> "description": "The number of calendar days before an OXXO voucher expires. For example, if you create an OXXO voucher on Monday and you set expires_after_days to 2, the OXXO invoice will expire on Wednesday at 23:59 America/Mexico_City time.", -87526a90718 -> "description": "Indicates that you intend to make future payments with this PaymentIntent's payment method.\n\nProviding this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes.\n\nWhen processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication).\n\nIf `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`.", -87542c90734,90735 -< ] ---- -> ], -> "description": "If this is a `oxxo` PaymentMethod, this sub-hash contains details about the OXXO payment method options." -87548a90742 -> "description": "Indicates that you intend to make future payments with this PaymentIntent's payment method.\n\nProviding this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes.\n\nWhen processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication).\n\nIf `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`.", -87554a90749 -> "description": "Confirm that the payer has accepted the P24 terms and conditions.", -87567c90762,90763 -< ] ---- -> ], -> "description": "If this is a `p24` PaymentMethod, this sub-hash contains details about the Przelewy24 payment method options." -87573a90770 -> "description": "Indicates that you intend to make future payments with this PaymentIntent's payment method.\n\nProviding this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes.\n\nWhen processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication).\n\nIf `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`.", -87589c90786,90787 -< ] ---- -> ], -> "description": "If this is a `paynow` PaymentMethod, this sub-hash contains details about the PayNow payment method options." -87595a90794 -> "description": "The number of seconds (between 10 and 1209600) after which Pix payment will expire. Defaults to 86400 seconds.", -87598a90798 -> "description": "The timestamp at which the Pix expires (between 10 and 1209600 seconds in the future). Defaults to 1 day in the future.", -87602a90803 -> "description": "Indicates that you intend to make future payments with this PaymentIntent's payment method.\n\nProviding this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes.\n\nWhen processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication).\n\nIf `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`.", -87618c90819,90820 -< ] ---- -> ], -> "description": "If this is a `pix` PaymentMethod, this sub-hash contains details about the Pix payment method options." -87624a90827 -> "description": "Indicates that you intend to make future payments with this PaymentIntent's payment method.\n\nProviding this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes.\n\nWhen processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication).\n\nIf `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`.", -87640c90843,90844 -< ] ---- -> ], -> "description": "If this is a `promptpay` PaymentMethod, this sub-hash contains details about the PromptPay payment method options." -87646a90851 -> "description": "Additional fields for Mandate creation", -87651a90857 -> "description": "Indicates that you intend to make future payments with this PaymentIntent's payment method.\n\nProviding this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes.\n\nWhen processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication).\n\nIf `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`.", -87670c90876,90877 -< ] ---- -> ], -> "description": "If this is a `sepa_debit` PaymentIntent, this sub-hash contains details about the SEPA Debit payment method options." -87676a90884 -> "description": "Language shown to the payer on redirect.", -87689a90898 -> "description": "Indicates that you intend to make future payments with this PaymentIntent's payment method.\n\nProviding this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes.\n\nWhen processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication).\n\nIf `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`.", -87707c90916,90917 -< ] ---- -> ], -> "description": "If this is a `sofort` PaymentMethod, this sub-hash contains details about the SOFORT payment method options." -87713a90924 -> "description": "Additional fields for Financial Connections Session creation", -87715a90927 -> "description": "The list of permissions to request. If this parameter is passed, the `payment_method` permission must be included. Valid permissions include: `balances`, `ownership`, `payment_method`, and `transactions`.", -87729a90942 -> "description": "For webview integrations only. Upon completing OAuth login in the native browser, the user will be redirected to this URL to return to your app.", -87737a90951 -> "description": "Additional fields for network related functions", -87739a90954 -> "description": "Triggers validations to run across the selected networks", -87753a90969 -> "description": "Indicates that you intend to make future payments with this PaymentIntent's payment method.\n\nProviding this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes.\n\nWhen processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication).\n\nIf `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`.", -87762a90979 -> "description": "Verification method for the intent", -87781c90998,90999 -< ] ---- -> ], -> "description": "If this is a `us_bank_account` PaymentMethod, this sub-hash contains details about the US bank account payment method options." -87787a91006 -> "description": "The app ID registered with WeChat Pay. Only required when client is ios or android.", -87791a91011 -> "description": "The client type that the end customer will pay from", -87800a91021 -> "description": "Indicates that you intend to make future payments with this PaymentIntent's payment method.\n\nProviding this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes.\n\nWhen processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication).\n\nIf `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`.", -87819c91040,91041 -< ] ---- -> ], -> "description": "If this is a `wechat_pay` PaymentMethod, this sub-hash contains details about the WeChat Pay payment method options." -87860a91083 -> "description": "Shipping address.", -87862a91086 -> "description": "City, district, suburb, town, or village.", -87866a91091 -> "description": "Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)).", -87870a91096 -> "description": "Address line 1 (e.g., street, PO Box, or company name).", -87874a91101 -> "description": "Address line 2 (e.g., apartment, suite, unit, or building).", -87878a91106 -> "description": "ZIP or postal code.", -87882a91111 -> "description": "State, county, province, or region.", -87890a91120 -> "description": "The delivery service that shipped a physical product, such as Fedex, UPS, USPS, etc.", -87894a91125 -> "description": "Recipient name.", -87898a91130 -> "description": "Recipient phone (including extension).", -87902a91135 -> "description": "The tracking number for a physical product, obtained from the delivery service. If multiple tracking numbers were generated for this purchase, please separate them with commas.", -87936a91170 -> "description": "The amount that will be transferred automatically when a charge succeeds.", -88193a91428 -> "description": "The amount that will be transferred automatically when a charge succeeds.", -88271,88274d91505 -< "payment_method_types": { -< "explode": true, -< "style": "deepObject" -< }, -88299,88303d91529 -< "client_secret": { -< "description": "The client secret of the PaymentIntent.", -< "maxLength": 5000, -< "type": "string" -< }, -88325a91552 -> "description": "This hash contains details about the customer acceptance of the Mandate.", -88327a91555 -> "description": "The time at which the customer accepted the Mandate.", -88331a91560 -> "description": "If this is a Mandate accepted offline, this hash contains details about the offline acceptance.", -88336a91566 -> "description": "If this is a Mandate accepted online, this hash contains details about the online acceptance.", -88338a91569 -> "description": "The IP address from which the Mandate was accepted by the customer.", -88341a91573 -> "description": "The user agent of the browser from which the Mandate was accepted by the customer.", -88353a91586 -> "description": "The type of customer acceptance information included with the Mandate. One of `online` or `offline`.", -88377a91611 -> "description": "This hash contains details about the customer acceptance of the Mandate.", -88379a91614 -> "description": "If this is a Mandate accepted online, this hash contains details about the online acceptance.", -88381a91617 -> "description": "The IP address from which the Mandate was accepted by the customer.", -88384a91621 -> "description": "The user agent of the browser from which the Mandate was accepted by the customer.", -88392a91630 -> "description": "The type of customer acceptance information included with the Mandate.", -88412c91650,91653 -< "type": "object" ---- -> "type": "object", -> "x-stripeParam": { -> "class_name": "MandateDataPublishableKey" -> } -88441a91683 -> "description": "If this is an `acss_debit` PaymentMethod, this hash contains details about the ACSS Debit payment method.", -88443a91686 -> "description": "Customer's bank account number.", -88447a91691 -> "description": "Institution number of the customer's bank.", -88451a91696 -> "description": "Transit number of the customer's bank.", -88464a91710 -> "description": "If this is an `affirm` PaymentMethod, this hash contains details about the Affirm payment method.", -88469a91716 -> "description": "If this is an `AfterpayClearpay` PaymentMethod, this hash contains details about the AfterpayClearpay payment method.", -88474a91722 -> "description": "If this is an `Alipay` PaymentMethod, this hash contains details about the Alipay payment method.", -88479a91728 -> "description": "If this is an `au_becs_debit` PaymentMethod, this hash contains details about the bank account.", -88481a91731 -> "description": "The account number for the bank account.", -88485a91736 -> "description": "Bank-State-Branch number of the bank account.", -88497a91749 -> "description": "If this is a `bacs_debit` PaymentMethod, this hash contains details about the Bacs Direct Debit bank account.", -88499a91752 -> "description": "Account number of the bank account that the funds will be debited from.", -88503a91757 -> "description": "Sort code of the bank account. (e.g., `10-20-30`)", -88511a91766 -> "description": "If this is a `bancontact` PaymentMethod, this hash contains details about the Bancontact payment method.", -88516a91772 -> "description": "Billing information associated with the PaymentMethod that may be used or required by particular types of payment methods.", -88522a91779 -> "description": "City, district, suburb, town, or village.", -88526a91784 -> "description": "Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)).", -88530a91789 -> "description": "Address line 1 (e.g., street, PO Box, or company name).", -88534a91794 -> "description": "Address line 2 (e.g., apartment, suite, unit, or building).", -88538a91799 -> "description": "ZIP or postal code.", -88542a91804 -> "description": "State, county, province, or region.", -88556c91818,91819 -< ] ---- -> ], -> "description": "Billing address." -88569c91832,91833 -< ] ---- -> ], -> "description": "Email address." -88571a91836 -> "description": "Full name.", -88575a91841 -> "description": "Billing phone number (including extension).", -88583a91850 -> "description": "If this is a `blik` PaymentMethod, this hash contains details about the BLIK payment method.", -88588a91856 -> "description": "If this is a `boleto` PaymentMethod, this hash contains details about the Boleto payment method.", -88590a91859 -> "description": "The tax ID of the customer (CPF for individual consumers or CNPJ for businesses consumers)", -88601a91871 -> "description": "If this is a `customer_balance` PaymentMethod, this hash contains details about the CustomerBalance payment method.", -88606a91877 -> "description": "If this is an `eps` PaymentMethod, this hash contains details about the EPS payment method.", -88608a91880 -> "description": "The customer's bank.", -88646a91919 -> "description": "If this is an `fpx` PaymentMethod, this hash contains details about the FPX payment method.", -88647a91921,91929 -> "account_holder_type": { -> "description": "Account holder type for FPX transaction", -> "enum": [ -> "company", -> "individual" -> ], -> "maxLength": 5000, -> "type": "string" -> }, -88648a91931 -> "description": "The customer's bank.", -88684a91968 -> "description": "If this is a `giropay` PaymentMethod, this hash contains details about the Giropay payment method.", -88689a91974 -> "description": "If this is a `grabpay` PaymentMethod, this hash contains details about the GrabPay payment method.", -88694a91980 -> "description": "If this is an `ideal` PaymentMethod, this hash contains details about the iDEAL payment method.", -88696a91983 -> "description": "The customer's bank.", -88719a92007 -> "description": "If this is an `interac_present` PaymentMethod, this hash contains details about the Interac Present payment method.", -88724a92013 -> "description": "If this is a `klarna` PaymentMethod, this hash contains details about the Klarna payment method.", -88726a92016 -> "description": "Customer's date of birth", -88728a92019 -> "description": "The day of birth, between 1 and 31.", -88731a92023 -> "description": "The month of birth, between 1 and 12.", -88734a92027 -> "description": "The four-digit year of birth.", -88750a92044 -> "description": "If this is a `konbini` PaymentMethod, this hash contains details about the Konbini payment method.", -88755a92050 -> "description": "If this is an `Link` PaymentMethod, this hash contains details about the Link payment method.", -88763a92059 -> "description": "Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`.", -88766a92063 -> "description": "If this is an `oxxo` PaymentMethod, this hash contains details about the OXXO payment method.", -88771a92069 -> "description": "If this is a `p24` PaymentMethod, this hash contains details about the P24 payment method.", -88773a92072 -> "description": "The customer's bank.", -88808a92108 -> "description": "If this is a `paynow` PaymentMethod, this hash contains details about the PayNow payment method.", -88813a92114 -> "description": "If this is a `pix` PaymentMethod, this hash contains details about the Pix payment method.", -88818a92120 -> "description": "If this is a `promptpay` PaymentMethod, this hash contains details about the PromptPay payment method.", -88823a92126 -> "description": "Options to configure Radar. See [Radar Session](https://stripe.com/docs/radar/radar-session) for more information.", -88825a92129 -> "description": "A [Radar Session](https://stripe.com/docs/radar/radar-session) is a snapshot of the browser metadata and device details that help Radar make more accurate predictions on your payments.", -88833a92138 -> "description": "If this is a `sepa_debit` PaymentMethod, this hash contains details about the SEPA debit bank account.", -88835a92141 -> "description": "IBAN of the bank account.", -88846a92153 -> "description": "If this is a `sofort` PaymentMethod, this hash contains details about the SOFORT payment method.", -88848a92156 -> "description": "Two-letter ISO code representing the country the bank account is located in.", -88866a92175 -> "description": "The type of the PaymentMethod. An additional hash is included on the PaymentMethod with a name matching this value. It contains additional information specific to the PaymentMethod type.", -88899a92209 -> "description": "If this is an `us_bank_account` PaymentMethod, this hash contains details about the US bank account payment method.", -88901a92212 -> "description": "Account holder type: individual or company.", -88908a92220 -> "description": "Account number of the bank account.", -88912a92225 -> "description": "Account type: checkings or savings. Defaults to checking if omitted.", -88919a92233 -> "description": "The ID of a Financial Connections Account to use as a payment method.", -88923a92238 -> "description": "Routing number of the bank account.", -88931a92247 -> "description": "If this is an `wechat_pay` PaymentMethod, this hash contains details about the wechat_pay payment method.", -88950a92267 -> "description": "Additional fields for Mandate creation", -88963c92280,92281 -< ] ---- -> ], -> "description": "A URL for custom mandate text to render during confirmation step.\nThe URL will be rendered with additional GET parameters `payment_intent` and `payment_intent_client_secret` when confirming a Payment Intent,\nor `setup_intent` and `setup_intent_client_secret` when confirming a Setup Intent." -88965a92284 -> "description": "Description of the mandate interval. Only required if 'payment_schedule' parameter is 'interval' or 'combined'.", -88969a92289 -> "description": "Payment schedule for the mandate.", -88977a92298 -> "description": "Transaction type of the mandate.", -88988a92310 -> "description": "Indicates that you intend to make future payments with this PaymentIntent's payment method.\n\nProviding this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes.\n\nWhen processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication).\n\nIf `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`.", -88997a92320 -> "description": "Verification method for the intent", -89016c92339,92340 -< ] ---- -> ], -> "description": "If this is a `acss_debit` PaymentMethod, this sub-hash contains details about the ACSS Debit payment method options." -89022a92347 -> "description": "Controls when the funds will be captured from the customer's account.\n\nIf provided, this parameter will override the top-level `capture_method` when finalizing the payment with this payment method type.\n\nIf `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter will unset the stored value for this payment method type.", -89029a92355 -> "description": "Indicates that you intend to make future payments with this PaymentIntent's payment method.\n\nProviding this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes.\n\nWhen processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication).\n\nIf `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`.", -89045c92371,92372 -< ] ---- -> ], -> "description": "If this is an `affirm` PaymentMethod, this sub-hash contains details about the Affirm payment method options." -89051a92379 -> "description": "Controls when the funds will be captured from the customer's account.\n\nIf provided, this parameter will override the top-level `capture_method` when finalizing the payment with this payment method type.\n\nIf `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter will unset the stored value for this payment method type.", -89058a92387 -> "description": "Order identifier shown to the customer in Afterpay’s online portal. We recommend using a value that helps you answer any questions a customer might have about\nthe payment. The identifier is limited to 128 characters and may contain only letters, digits, underscores, backslashes and dashes.", -89062a92392 -> "description": "Indicates that you intend to make future payments with this PaymentIntent's payment method.\n\nProviding this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes.\n\nWhen processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication).\n\nIf `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`.", -89079c92409,92410 -< ] ---- -> ], -> "description": "If this is a `afterpay_clearpay` PaymentMethod, this sub-hash contains details about the Afterpay Clearpay payment method options." -89085a92417 -> "description": "Indicates that you intend to make future payments with this PaymentIntent's payment method.\n\nProviding this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes.\n\nWhen processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication).\n\nIf `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`.", -89103c92435,92436 -< ] ---- -> ], -> "description": "If this is a `alipay` PaymentMethod, this sub-hash contains details about the Alipay payment method options." -89109a92443 -> "description": "Indicates that you intend to make future payments with this PaymentIntent's payment method.\n\nProviding this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes.\n\nWhen processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication).\n\nIf `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`.", -89128c92462,92463 -< ] ---- -> ], -> "description": "If this is a `au_becs_debit` PaymentMethod, this sub-hash contains details about the AU BECS Direct Debit payment method options." -89134a92470 -> "description": "Indicates that you intend to make future payments with this PaymentIntent's payment method.\n\nProviding this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes.\n\nWhen processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication).\n\nIf `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`.", -89153c92489,92490 -< ] ---- -> ], -> "description": "If this is a `bacs_debit` PaymentMethod, this sub-hash contains details about the BACS Debit payment method options." -89159a92497 -> "description": "Preferred language of the Bancontact authorization page that the customer is redirected to.", -89168a92507 -> "description": "Indicates that you intend to make future payments with this PaymentIntent's payment method.\n\nProviding this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes.\n\nWhen processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication).\n\nIf `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`.", -89186c92525,92526 -< ] ---- -> ], -> "description": "If this is a `bancontact` PaymentMethod, this sub-hash contains details about the Bancontact payment method options." -89192a92533 -> "description": "The 6-digit BLIK code that a customer has generated using their banking application. Can only be set on confirmation.", -89206c92547,92548 -< ] ---- -> ], -> "description": "If this is a `blik` PaymentMethod, this sub-hash contains details about the BLIK payment method options." -89212a92555 -> "description": "The number of calendar days before a Boleto voucher expires. For example, if you create a Boleto voucher on Monday and you set expires_after_days to 2, the Boleto invoice will expire on Wednesday at 23:59 America/Sao_Paulo time.", -89215a92559 -> "description": "Indicates that you intend to make future payments with this PaymentIntent's payment method.\n\nProviding this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes.\n\nWhen processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication).\n\nIf `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`.", -89234c92578,92579 -< ] ---- -> ], -> "description": "If this is a `boleto` PaymentMethod, this sub-hash contains details about the Boleto payment method options." -89240a92586 -> "description": "Controls when the funds will be captured from the customer's account.\n\nIf provided, this parameter will override the top-level `capture_method` when finalizing the payment with this payment method type.\n\nIf `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter will unset the stored value for this payment method type.", -89247a92594 -> "description": "A single-use `cvc_update` Token that represents a card CVC value. When provided, the CVC value will be verified during the card payment attempt. This parameter can only be provided during confirmation.", -89251a92599 -> "description": "Installment configuration for payments attempted on this PaymentIntent (Mexico Only).\n\nFor more information, see the [installments integration guide](https://stripe.com/docs/payments/installments).", -89253a92602 -> "description": "Setting to true enables installments for this PaymentIntent.\nThis will cause the response to contain a list of available installment plans.\nSetting to false will prevent any selected plan from applying to a charge.", -89260a92610 -> "description": "For `fixed_count` installment plans, this is the number of installment payments your customer will make to their credit card.", -89263a92614 -> "description": "For `fixed_count` installment plans, this is the interval between installment payments your customer will make to their credit card.\nOne of `month`.", -89269a92621 -> "description": "Type of installment plan, one of `fixed_count`.", -89290c92642,92643 -< ] ---- -> ], -> "description": "The selected installment plan to use for this payment attempt.\nThis parameter can only be provided during confirmation." -89296a92650 -> "description": "Configuration options for setting up an eMandate for cards issued in India.", -89298a92653 -> "description": "Amount to be charged for future payments.", -89301a92657 -> "description": "One of `fixed` or `maximum`. If `fixed`, the `amount` param refers to the exact amount to be charged in future payments. If `maximum`, the amount charged can be up to the value passed for the `amount` param.", -89308a92665 -> "description": "A description of the mandate or subscription that is meant to be displayed to the customer.", -89312a92670 -> "description": "End date of the mandate or subscription. If not provided, the mandate will be active until canceled. If provided, end date should be after start date.", -89316a92675 -> "description": "Specifies payment frequency. One of `day`, `week`, `month`, `year`, or `sporadic`.", -89326a92686 -> "description": "The number of intervals between payments. For example, `interval=month` and `interval_count=3` indicates one payment every three months. Maximum of one year interval allowed (1 year, 12 months, or 52 weeks). This parameter is optional when `interval=sporadic`.", -89329a92690 -> "description": "Unique identifier for the mandate or subscription.", -89333a92695 -> "description": "Start date of the mandate or subscription. Start date should not be lesser than yesterday.", -89337a92700 -> "description": "Specifies the type of mandates supported. Possible values are `india`.", -89356a92720,92723 -> "moto": { -> "description": "When specified, this parameter indicates that a transaction will be marked\nas MOTO (Mail Order Telephone Order) and thus out of scope for SCA. This\nparameter can only be provided during confirmation.", -> "type": "boolean" -> }, -89357a92725 -> "description": "Selected network to process this PaymentIntent on. Depends on the available networks of the card attached to the PaymentIntent. Can be only set confirm-time.", -89374a92743 -> "description": "We strongly recommend that you rely on our SCA Engine to automatically prompt your customers for authentication based on risk level and [other requirements](https://stripe.com/docs/strong-customer-authentication). However, if you wish to request 3D Secure based on logic from your own fraud engine, provide this option. Permitted values include: `automatic` or `any`. If not provided, defaults to `automatic`. Read our guide on [manually requesting 3D Secure](https://stripe.com/docs/payments/3d-secure#manual-three-ds) for more information on how this configuration interacts with Radar and our SCA Engine.", -89383a92753 -> "description": "Indicates that you intend to make future payments with this PaymentIntent's payment method.\n\nProviding this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes.\n\nWhen processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication).\n\nIf `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`.", -89404c92774,92775 -< ] ---- -> ], -> "description": "Provides information about a card payment that customers see on their statements. Concatenated with the Kana prefix (shortened Kana descriptor) or Kana statement descriptor that’s set on the account to form the complete statement descriptor. Maximum 22 characters. On card statements, the *concatenation* of both prefix and suffix (including separators) will appear truncated to 22 characters." -89418c92789,92790 -< ] ---- -> ], -> "description": "Provides information about a card payment that customers see on their statements. Concatenated with the Kanji prefix (shortened Kanji descriptor) or Kanji statement descriptor that’s set on the account to form the complete statement descriptor. Maximum 17 characters. On card statements, the *concatenation* of both prefix and suffix (including separators) will appear truncated to 17 characters." -89430c92802,92803 -< ] ---- -> ], -> "description": "Configuration for any card payments attempted on this PaymentIntent." -89436a92810 -> "description": "Request ability to capture this payment beyond the standard [authorization validity window](https://stripe.com/docs/terminal/features/extended-authorizations#authorization-validity)", -89439a92814 -> "description": "Request ability to [increment](https://stripe.com/docs/terminal/features/incremental-authorizations) this PaymentIntent if the combination of MCC and card brand is eligible. Check [incremental_authorization_supported](https://stripe.com/docs/api/charges/object#charge_object-payment_method_details-card_present-incremental_authorization_supported) in the [Confirm](https://stripe.com/docs/api/payment_intents/confirm) response to verify support.", -89452c92827,92828 -< ] ---- -> ], -> "description": "If this is a `card_present` PaymentMethod, this sub-hash contains details about the Card Present payment method options." -89458a92835 -> "description": "Configuration for the bank transfer funding type, if the `funding_type` is set to `bank_transfer`.", -89462a92840 -> "description": "The desired country code of the bank account information. Permitted values include: `DE`, `ES`, `FR`, `IE`, or `NL`.", -89473a92852 -> "description": "List of address types that should be returned in the financial_addresses response. If not specified, all valid types will be returned.\n\nPermitted values include: `sort_code`, `zengin`, `iban`, or `spei`.", -89487a92867 -> "description": "The list of bank transfer types that this PaymentIntent is allowed to use for funding Permitted values include: `eu_bank_transfer`, `gb_bank_transfer`, `jp_bank_transfer`, or `mx_bank_transfer`.", -89504a92885 -> "description": "The funding method type to be used when there are not enough funds in the customer balance. Permitted values include: `bank_transfer`.", -89510a92892 -> "description": "Indicates that you intend to make future payments with this PaymentIntent's payment method.\n\nProviding this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes.\n\nWhen processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication).\n\nIf `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`.", -89526c92908,92909 -< ] ---- -> ], -> "description": "If this is a `customer balance` PaymentMethod, this sub-hash contains details about the customer balance payment method options." -89532a92916 -> "description": "Indicates that you intend to make future payments with this PaymentIntent's payment method.\n\nProviding this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes.\n\nWhen processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication).\n\nIf `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`.", -89548c92932,92933 -< ] ---- -> ], -> "description": "If this is a `eps` PaymentMethod, this sub-hash contains details about the EPS payment method options." -89554a92940 -> "description": "Indicates that you intend to make future payments with this PaymentIntent's payment method.\n\nProviding this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes.\n\nWhen processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication).\n\nIf `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`.", -89570c92956,92957 -< ] ---- -> ], -> "description": "If this is a `fpx` PaymentMethod, this sub-hash contains details about the FPX payment method options." -89576a92964 -> "description": "Indicates that you intend to make future payments with this PaymentIntent's payment method.\n\nProviding this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes.\n\nWhen processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication).\n\nIf `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`.", -89592c92980,92981 -< ] ---- -> ], -> "description": "If this is a `giropay` PaymentMethod, this sub-hash contains details about the Giropay payment method options." -89598a92988 -> "description": "Indicates that you intend to make future payments with this PaymentIntent's payment method.\n\nProviding this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes.\n\nWhen processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication).\n\nIf `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`.", -89614c93004,93005 -< ] ---- -> ], -> "description": "If this is a `grabpay` PaymentMethod, this sub-hash contains details about the Grabpay payment method options." -89620a93012 -> "description": "Indicates that you intend to make future payments with this PaymentIntent's payment method.\n\nProviding this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes.\n\nWhen processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication).\n\nIf `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`.", -89638c93030,93031 -< ] ---- -> ], -> "description": "If this is a `ideal` PaymentMethod, this sub-hash contains details about the Ideal payment method options." -89653c93046,93047 -< ] ---- -> ], -> "description": "If this is a `interac_present` PaymentMethod, this sub-hash contains details about the Card Present payment method options." -89659a93054 -> "description": "Controls when the funds will be captured from the customer's account.\n\nIf provided, this parameter will override the top-level `capture_method` when finalizing the payment with this payment method type.\n\nIf `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter will unset the stored value for this payment method type.", -89666a93062 -> "description": "Preferred language of the Klarna authorization page that the customer is redirected to", -89712a93109 -> "description": "Indicates that you intend to make future payments with this PaymentIntent's payment method.\n\nProviding this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes.\n\nWhen processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication).\n\nIf `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`.", -89728c93125,93126 -< ] ---- -> ], -> "description": "If this is a `klarna` PaymentMethod, this sub-hash contains details about the Klarna payment method options." -89734a93133 -> "description": "An optional 10 to 11 digit numeric-only string determining the confirmation code at applicable convenience stores. Must not consist of only zeroes and could be rejected in case of insufficient uniqueness. We recommend to use the customer's phone number.", -89749c93148,93149 -< ] ---- -> ], -> "description": "The number of calendar days (between 1 and 60) after which Konbini payment instructions will expire. For example, if a PaymentIntent is confirmed with Konbini and `expires_after_days` set to 2 on Monday JST, the instructions will expire on Wednesday 23:59:59 JST. Defaults to 3 days." -89763c93163,93164 -< ] ---- -> ], -> "description": "The timestamp at which the Konbini payment instructions will expire. Only one of `expires_after_days` or `expires_at` may be set." -89765a93167 -> "description": "A product descriptor of up to 22 characters, which will appear to customers at the convenience store.", -89769a93172 -> "description": "Indicates that you intend to make future payments with this PaymentIntent's payment method.\n\nProviding this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes.\n\nWhen processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication).\n\nIf `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`.", -89785c93188,93189 -< ] ---- -> ], -> "description": "If this is a `konbini` PaymentMethod, this sub-hash contains details about the Konbini payment method options." -89791a93196 -> "description": "Controls when the funds will be captured from the customer's account.\n\nIf provided, this parameter will override the top-level `capture_method` when finalizing the payment with this payment method type.\n\nIf `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter will unset the stored value for this payment method type.", -89798a93204 -> "description": "Token used for persistent Link logins.", -89802a93209 -> "description": "Indicates that you intend to make future payments with this PaymentIntent's payment method.\n\nProviding this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes.\n\nWhen processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication).\n\nIf `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`.", -89820c93227,93228 -< ] ---- -> ], -> "description": "If this is a `link` PaymentMethod, this sub-hash contains details about the Link payment method options." -89826a93235 -> "description": "The number of calendar days before an OXXO voucher expires. For example, if you create an OXXO voucher on Monday and you set expires_after_days to 2, the OXXO invoice will expire on Wednesday at 23:59 America/Mexico_City time.", -89829a93239 -> "description": "Indicates that you intend to make future payments with this PaymentIntent's payment method.\n\nProviding this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes.\n\nWhen processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication).\n\nIf `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`.", -89845c93255,93256 -< ] ---- -> ], -> "description": "If this is a `oxxo` PaymentMethod, this sub-hash contains details about the OXXO payment method options." -89851a93263 -> "description": "Indicates that you intend to make future payments with this PaymentIntent's payment method.\n\nProviding this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes.\n\nWhen processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication).\n\nIf `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`.", -89857a93270 -> "description": "Confirm that the payer has accepted the P24 terms and conditions.", -89870c93283,93284 -< ] ---- -> ], -> "description": "If this is a `p24` PaymentMethod, this sub-hash contains details about the Przelewy24 payment method options." -89876a93291 -> "description": "Indicates that you intend to make future payments with this PaymentIntent's payment method.\n\nProviding this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes.\n\nWhen processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication).\n\nIf `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`.", -89892c93307,93308 -< ] ---- -> ], -> "description": "If this is a `paynow` PaymentMethod, this sub-hash contains details about the PayNow payment method options." -89898a93315 -> "description": "The number of seconds (between 10 and 1209600) after which Pix payment will expire. Defaults to 86400 seconds.", -89901a93319 -> "description": "The timestamp at which the Pix expires (between 10 and 1209600 seconds in the future). Defaults to 1 day in the future.", -89905a93324 -> "description": "Indicates that you intend to make future payments with this PaymentIntent's payment method.\n\nProviding this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes.\n\nWhen processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication).\n\nIf `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`.", -89921c93340,93341 -< ] ---- -> ], -> "description": "If this is a `pix` PaymentMethod, this sub-hash contains details about the Pix payment method options." -89927a93348 -> "description": "Indicates that you intend to make future payments with this PaymentIntent's payment method.\n\nProviding this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes.\n\nWhen processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication).\n\nIf `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`.", -89943c93364,93365 -< ] ---- -> ], -> "description": "If this is a `promptpay` PaymentMethod, this sub-hash contains details about the PromptPay payment method options." -89949a93372 -> "description": "Additional fields for Mandate creation", -89954a93378 -> "description": "Indicates that you intend to make future payments with this PaymentIntent's payment method.\n\nProviding this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes.\n\nWhen processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication).\n\nIf `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`.", -89973c93397,93398 -< ] ---- -> ], -> "description": "If this is a `sepa_debit` PaymentIntent, this sub-hash contains details about the SEPA Debit payment method options." -89979a93405 -> "description": "Language shown to the payer on redirect.", -89992a93419 -> "description": "Indicates that you intend to make future payments with this PaymentIntent's payment method.\n\nProviding this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes.\n\nWhen processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication).\n\nIf `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`.", -90010c93437,93438 -< ] ---- -> ], -> "description": "If this is a `sofort` PaymentMethod, this sub-hash contains details about the SOFORT payment method options." -90016a93445 -> "description": "Additional fields for Financial Connections Session creation", -90018a93448 -> "description": "The list of permissions to request. If this parameter is passed, the `payment_method` permission must be included. Valid permissions include: `balances`, `ownership`, `payment_method`, and `transactions`.", -90032a93463 -> "description": "For webview integrations only. Upon completing OAuth login in the native browser, the user will be redirected to this URL to return to your app.", -90040a93472 -> "description": "Additional fields for network related functions", -90042a93475 -> "description": "Triggers validations to run across the selected networks", -90056a93490 -> "description": "Indicates that you intend to make future payments with this PaymentIntent's payment method.\n\nProviding this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes.\n\nWhen processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication).\n\nIf `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`.", -90065a93500 -> "description": "Verification method for the intent", -90084c93519,93520 -< ] ---- -> ], -> "description": "If this is a `us_bank_account` PaymentMethod, this sub-hash contains details about the US bank account payment method options." -90090a93527 -> "description": "The app ID registered with WeChat Pay. Only required when client is ios or android.", -90094a93532 -> "description": "The client type that the end customer will pay from", -90103a93542 -> "description": "Indicates that you intend to make future payments with this PaymentIntent's payment method.\n\nProviding this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes.\n\nWhen processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication).\n\nIf `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`.", -90122c93561,93562 -< ] ---- -> ], -> "description": "If this is a `wechat_pay` PaymentMethod, this sub-hash contains details about the WeChat Pay payment method options." -90128,90135d93567 -< "payment_method_types": { -< "description": "The list of payment method types (e.g. card) that this PaymentIntent is allowed to use. Use automatic_payment_methods to manage payment methods from the [Stripe Dashboard](https://dashboard.stripe.com/settings/payment_methods).", -< "items": { -< "maxLength": 5000, -< "type": "string" -< }, -< "type": "array" -< }, -90139a93572 -> "description": "A [Radar Session](https://stripe.com/docs/radar/radar-session) is a snapshot of the browser metadata and device details that help Radar make more accurate predictions on your payments.", -90178a93612 -> "description": "Shipping address.", -90180a93615 -> "description": "City, district, suburb, town, or village.", -90184a93620 -> "description": "Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)).", -90188a93625 -> "description": "Address line 1 (e.g., street, PO Box, or company name).", -90192a93630 -> "description": "Address line 2 (e.g., apartment, suite, unit, or building).", -90196a93635 -> "description": "ZIP or postal code.", -90200a93640 -> "description": "State, county, province, or region.", -90208a93649 -> "description": "The delivery service that shipped a physical product, such as Fedex, UPS, USPS, etc.", -90212a93654 -> "description": "Recipient name.", -90216a93659 -> "description": "Recipient phone (including extension).", -90220a93664 -> "description": "The tracking number for a physical product, obtained from the delivery service. If multiple tracking numbers were generated for this purchase, please separate them with commas.", -90348a93793 -> "description": "The amount that will be transferred automatically when a charge succeeds.", -90428,90432d93872 -< "client_secret": { -< "description": "The client secret of the PaymentIntent.", -< "maxLength": 5000, -< "type": "string" -< }, -90682a94123 -> "description": "Configuration when `type=hosted_confirmation`.", -90684a94126 -> "description": "A custom message to display to the customer after the purchase is complete.", -90692a94135 -> "description": "Configuration when `type=redirect`.", -90694a94138 -> "description": "The URL the customer will be redirected to after the purchase is complete. You can embed `{CHECKOUT_SESSION_ID}` into the URL to have the `id` of the completed [checkout session](https://stripe.com/docs/api/checkout/sessions/object#checkout_session_object-id) included.", -90705a94150 -> "description": "The specified behavior after the purchase is complete. Either `redirect` or `hosted_confirmation`.", -90734a94180 -> "description": "If `true`, tax will be calculated automatically using the customer's location.", -90755a94202 -> "description": "If set to `auto`, enables the collection of customer consent for promotional communications. The Checkout\nSession will determine whether to display an option to opt into promotional communication\nfrom the merchant depending on the customer's locale. Only available to US merchants.", -90762a94210 -> "description": "If set to `required`, it requires customers to check a terms of service checkbox before being able to pay.\nThere must be a valid terms of service URL set in your [Dashboard settings](https://dashboard.stripe.com/settings/public).", -90797a94246 -> "description": "When set, provides configuration for this item’s quantity to be adjusted by the customer during checkout.", -90799a94249 -> "description": "Set to true if the quantity can be adjusted to any non-negative Integer.", -90802a94253 -> "description": "The maximum quantity the customer can purchase. By default this value is 99. You can specify a value up to 99.", -90805a94257 -> "description": "The minimum quantity the customer can purchase. By default this value is 0. You can specify a value up to 98. If there is only one item in the cart then that item's quantity cannot go down to 0.", -90815a94268 -> "description": "The ID of the [Price](https://stripe.com/docs/api/prices) or [Plan](https://stripe.com/docs/api/plans) object.", -90819a94273 -> "description": "The quantity of the line item being purchased.", -90846a94301 -> "description": "Controls when the funds will be captured from the customer's account.", -90853a94309 -> "description": "Indicates that you intend to [make future payments](https://stripe.com/docs/payments/payment-intents#future-usage) with the payment method collected by this Checkout Session.\n\nWhen setting this to `on_session`, Checkout will show a notice to the customer that their payment details will be saved.\n\nWhen setting this to `off_session`, Checkout will show a notice to the customer that their payment details will be saved and used for future payments.\n\nIf a Customer has been provided or Checkout creates a new Customer,Checkout will attach the payment method to the Customer.\n\nIf Checkout does not create a Customer, the payment method is not attached to a Customer. To reuse the payment method, you can retrieve it from the Checkout Session's PaymentIntent.\n\nWhen processing card payments, Checkout also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as SCA.", -90910a94367 -> "description": "Set to `true` to enable phone number collection.", -90923a94381 -> "description": "An array of two-letter ISO country codes representing which countries Checkout should provide as options for\nshipping locations. Unsupported country codes: `AS, CX, CC, CU, HM, IR, KP, MH, FM, NF, MP, PW, SD, SY, UM, VI`.", -91179a94638 -> "description": "The ID of the Shipping Rate to use for this shipping option.", -91202a94662 -> "description": "The subscription's description, meant to be displayable to the customer. Use this field to optionally store an explanation of the subscription.", -91206a94667 -> "description": "Integer representing the number of trial period days before the customer is charged for the first time. Has to be at least 1.", -91216a94678 -> "description": "Set to `true` to enable tax ID collection.", -91229a94692 -> "description": "The amount that will be transferred automatically when a charge succeeds.", -91232a94696 -> "description": "If specified, successful charges will be attributed to the destination\naccount for tax reporting, and the funds from charges will be transferred\nto the destination account. The ID of the resulting transfer will be\nreturned on the successful charge's `transfer` field.", -91401a94866 -> "description": "Configuration when `type=hosted_confirmation`.", -91403a94869 -> "description": "A custom message to display to the customer after the purchase is complete.", -91411a94878 -> "description": "Configuration when `type=redirect`.", -91413a94881 -> "description": "The URL the customer will be redirected to after the purchase is complete. You can embed `{CHECKOUT_SESSION_ID}` into the URL to have the `id` of the completed [checkout session](https://stripe.com/docs/api/checkout/sessions/object#checkout_session_object-id) included.", -91424a94893 -> "description": "The specified behavior after the purchase is complete. Either `redirect` or `hosted_confirmation`.", -91445a94915 -> "description": "If `true`, tax will be calculated automatically using the customer's location.", -91483a94954 -> "description": "When set, provides configuration for this item’s quantity to be adjusted by the customer during checkout.", -91485a94957 -> "description": "Set to true if the quantity can be adjusted to any non-negative Integer.", -91488a94961 -> "description": "The maximum quantity the customer can purchase. By default this value is 99. You can specify a value up to 99.", -91491a94965 -> "description": "The minimum quantity the customer can purchase. By default this value is 0. You can specify a value up to 98. If there is only one item in the cart then that item's quantity cannot go down to 0.", -91501a94976 -> "description": "The ID of an existing line item on the payment link.", -91505a94981 -> "description": "The quantity of the line item being purchased.", -91581a95058 -> "description": "An array of two-letter ISO country codes representing which countries Checkout should provide as options for\nshipping locations. Unsupported country codes: `AS, CX, CC, CU, HM, IR, KP, MH, FM, NF, MP, PW, SD, SY, UM, VI`.", -92011c95488 -< "description": "

Returns a list of PaymentMethods attached to the StripeAccount. For listing a customer’s payment methods, you should use List a Customer’s PaymentMethods

", ---- -> "description": "

Returns a list of PaymentMethods for Treasury flows. If you want to list the PaymentMethods attached to a Customer for payments, you should use the List a Customer’s PaymentMethods API instead.

", -92086a95564 -> "card_present", -92330a95809 -> "description": "Customer's bank account number.", -92334a95814 -> "description": "Institution number of the customer's bank.", -92338a95819 -> "description": "Transit number of the customer's bank.", -92372a95854 -> "description": "The account number for the bank account.", -92376a95859 -> "description": "Bank-State-Branch number of the bank account.", -92391a95875 -> "description": "Account number of the bank account that the funds will be debited from.", -92395a95880 -> "description": "Sort code of the bank account. (e.g., `10-20-30`)", -92416a95902 -> "description": "City, district, suburb, town, or village.", -92420a95907 -> "description": "Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)).", -92424a95912 -> "description": "Address line 1 (e.g., street, PO Box, or company name).", -92428a95917 -> "description": "Address line 2 (e.g., apartment, suite, unit, or building).", -92432a95922 -> "description": "ZIP or postal code.", -92436a95927 -> "description": "State, county, province, or region.", -92450c95941,95942 -< ] ---- -> ], -> "description": "Billing address." -92463c95955,95956 -< ] ---- -> ], -> "description": "Email address." -92465a95959 -> "description": "Full name.", -92469a95964 -> "description": "Billing phone number (including extension).", -92486a95982 -> "description": "The tax ID of the customer (CPF for individual consumers or CNPJ for businesses consumers)", -92501a95998 -> "description": "The card's CVC. It is highly recommended to always include this value.", -92505a96003 -> "description": "Two-digit number representing the card's expiration month.", -92508a96007 -> "description": "Four-digit number representing the card's expiration year.", -92511a96011 -> "description": "The card number, as a string without any separators.", -92522c96022,96025 -< "type": "object" ---- -> "type": "object", -> "x-stripeParam": { -> "class_name": "CardDetails" -> } -92535c96038,96041 -< "type": "object" ---- -> "type": "object", -> "x-stripeParam": { -> "class_name": "Token" -> } -92555a96062 -> "description": "The customer's bank.", -92603a96111,96119 -> "account_holder_type": { -> "description": "Account holder type for FPX transaction", -> "enum": [ -> "company", -> "individual" -> ], -> "maxLength": 5000, -> "type": "string" -> }, -92604a96121 -> "description": "The customer's bank.", -92655a96173 -> "description": "The customer's bank.", -92687a96206 -> "description": "Customer's date of birth", -92689a96209 -> "description": "The day of birth, between 1 and 31.", -92692a96213 -> "description": "The month of birth, between 1 and 12.", -92695a96217 -> "description": "The four-digit year of birth.", -92739a96262 -> "description": "The customer's bank.", -92800a96324 -> "description": "A [Radar Session](https://stripe.com/docs/radar/radar-session) is a snapshot of the browser metadata and device details that help Radar make more accurate predictions on your payments.", -92811a96336 -> "description": "IBAN of the bank account.", -92825a96351 -> "description": "Two-letter ISO code representing the country the bank account is located in.", -92881a96408 -> "description": "Account holder type: individual or company.", -92888a96416 -> "description": "Account number of the bank account.", -92892a96421 -> "description": "Account type: checkings or savings. Defaults to checking if omitted.", -92899a96429 -> "description": "The ID of a Financial Connections Account to use as a payment method.", -92903a96434 -> "description": "Routing number of the bank account.", -93033a96565,96580 -> "acss_debit": { -> "explode": true, -> "style": "deepObject" -> }, -> "affirm": { -> "explode": true, -> "style": "deepObject" -> }, -> "au_becs_debit": { -> "explode": true, -> "style": "deepObject" -> }, -> "bacs_debit": { -> "explode": true, -> "style": "deepObject" -> }, -93037a96585,96588 -> "blik": { -> "explode": true, -> "style": "deepObject" -> }, -93053a96605,96608 -> "sepa_debit": { -> "explode": true, -> "style": "deepObject" -> }, -93061a96617,96640 -> "acss_debit": { -> "description": "This is a legacy parameter that will be removed in the future. It is a hash that does not accept any keys.", -> "properties": {}, -> "title": "update_param", -> "type": "object" -> }, -> "affirm": { -> "description": "This is a legacy parameter that will be removed in the future. It is a hash that does not accept any keys.", -> "properties": {}, -> "title": "param", -> "type": "object" -> }, -> "au_becs_debit": { -> "description": "This is a legacy parameter that will be removed in the future. It is a hash that does not accept any keys.", -> "properties": {}, -> "title": "update_param", -> "type": "object" -> }, -> "bacs_debit": { -> "description": "This is a legacy parameter that will be removed in the future. It is a hash that does not accept any keys.", -> "properties": {}, -> "title": "update_param", -> "type": "object" -> }, -93069a96649 -> "description": "City, district, suburb, town, or village.", -93073a96654 -> "description": "Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)).", -93077a96659 -> "description": "Address line 1 (e.g., street, PO Box, or company name).", -93081a96664 -> "description": "Address line 2 (e.g., apartment, suite, unit, or building).", -93085a96669 -> "description": "ZIP or postal code.", -93089a96674 -> "description": "State, county, province, or region.", -93103c96688,96689 -< ] ---- -> ], -> "description": "Billing address." -93116c96702,96703 -< ] ---- -> ], -> "description": "Email address." -93118a96706 -> "description": "Full name.", -93122a96711 -> "description": "Billing phone number (including extension).", -93129a96719,96724 -> "blik": { -> "description": "This is a legacy parameter that will be removed in the future. It is a hash that does not accept any keys.", -> "properties": {}, -> "title": "param", -> "type": "object" -> }, -93133a96729 -> "description": "Two-digit number representing the card's expiration month.", -93136a96733 -> "description": "Four-digit number representing the card's expiration year.", -93173a96771,96776 -> "sepa_debit": { -> "description": "This is a legacy parameter that will be removed in the future. It is a hash that does not accept any keys.", -> "properties": {}, -> "title": "update_param", -> "type": "object" -> }, -93177a96781 -> "description": "Bank account type.", -93375a96980 -> "description": "Minimum value to filter by (exclusive)", -93378a96984 -> "description": "Minimum value to filter by (inclusive)", -93381a96988 -> "description": "Maximum value to filter by (exclusive)", -93384a96992 -> "description": "Maximum value to filter by (inclusive)", -93407a97016 -> "description": "Minimum value to filter by (exclusive)", -93410a97020 -> "description": "Minimum value to filter by (inclusive)", -93413a97024 -> "description": "Maximum value to filter by (exclusive)", -93416a97028 -> "description": "Maximum value to filter by (inclusive)", -94008a97621 -> "description": "Minimum value to filter by (exclusive)", -94011a97625 -> "description": "Minimum value to filter by (inclusive)", -94014a97629 -> "description": "Maximum value to filter by (exclusive)", -94017a97633 -> "description": "Maximum value to filter by (inclusive)", -94283a97900 -> "description": "Whether the product is currently available for purchase. Defaults to `true`.", -94286a97904 -> "description": "The identifier for the product. Must be unique. If not provided, an identifier will be randomly generated.", -94293a97912 -> "description": "Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`.", -94296a97916 -> "description": "The product's name, meant to be displayable to the customer.", -94300a97921 -> "description": "An arbitrary string to be displayed on your customer's credit card or bank statement. While most banks display this information consistently, some may display it incorrectly or not at all.\n\nThis may be up to 22 characters. The statement description may not include `<`, `>`, `\\`, `\"`, `'` characters, and will appear on your customer's statement in capital letters. Non-ASCII characters are automatically stripped.", -94304a97926 -> "description": "A [tax code](https://stripe.com/docs/tax/tax-categories) ID.", -94308a97931 -> "description": "A label that represents units of this product in Stripe and on customers’ receipts and invoices. When set, this will be included in associated invoice line item descriptions.", -94330a97954 -> "description": "The flat billing amount for an entire tier, regardless of the number of units in the tier.", -94333a97958 -> "description": "Same as `flat_amount`, but accepts a decimal value representing an integer in the minor units of the currency. Only one of `flat_amount` and `flat_amount_decimal` can be set.", -94337a97963 -> "description": "The per unit billing amount for each individual unit for which this tier applies.", -94340a97967 -> "description": "Same as `unit_amount`, but accepts a decimal value in cents (or local equivalent) with at most 12 decimal places. Only one of `unit_amount` and `unit_amount_decimal` can be set.", -94356c97983,97984 -< ] ---- -> ], -> "description": "Specifies the upper bound of this tier. The lower bound of a tier is the upper bound of the previous tier adding one. Use `inf` to define a fallback tier." -94378a98007 -> "description": "Divide usage by this number.", -94381a98011 -> "description": "After division, either round the result `up` or `down`.", -94691a98322 -> "description": "Minimum value to filter by (exclusive)", -94694a98326 -> "description": "Minimum value to filter by (inclusive)", -94697a98330 -> "description": "Maximum value to filter by (exclusive)", -94700a98334 -> "description": "Maximum value to filter by (inclusive)", -94794a98429 -> "description": "Filter by billing frequency. Either `day`, `week`, `month` or `year`.", -94803a98439 -> "description": "Filter by the usage type for this price. Can be either `metered` or `licensed`.", -94977a98614 -> "description": "When set, provides configuration for the amount to be adjusted by the customer during Checkout Sessions and Payment Links.", -94979a98617 -> "description": "Pass in `true` to enable `custom_unit_amount`, otherwise omit `custom_unit_amount`.", -94982a98621 -> "description": "The maximum unit amount the customer can specify for this item.", -94985a98625 -> "description": "The minimum unit amount the customer can specify for this item. Must be at least the minimum charge amount.", -94988a98629 -> "description": "The starting unit amount which can be updated by the customer.", -94998a98640 -> "description": "Specifies whether the price is considered inclusive of taxes or exclusive of taxes. One of `inclusive`, `exclusive`, or `unspecified`. Once specified as either `inclusive` or `exclusive`, it cannot be changed.", -95006a98649 -> "description": "Each element represents a pricing tier. This parameter requires `billing_scheme` to be set to `tiered`. See also the documentation for `billing_scheme`.", -95009a98653 -> "description": "The flat billing amount for an entire tier, regardless of the number of units in the tier.", -95012a98657 -> "description": "Same as `flat_amount`, but accepts a decimal value representing an integer in the minor units of the currency. Only one of `flat_amount` and `flat_amount_decimal` can be set.", -95016a98662 -> "description": "The per unit billing amount for each individual unit for which this tier applies.", -95019a98666 -> "description": "Same as `unit_amount`, but accepts a decimal value in cents (or local equivalent) with at most 12 decimal places. Only one of `unit_amount` and `unit_amount_decimal` can be set.", -95035c98682,98683 -< ] ---- -> ], -> "description": "Specifies the upper bound of this tier. The lower bound of a tier is the upper bound of the previous tier adding one. Use `inf` to define a fallback tier." -95046a98695 -> "description": "A positive integer in cents (or local equivalent) (or 0 for a free price) representing how much to charge.", -95049a98699 -> "description": "Same as `unit_amount`, but accepts a decimal value in cents (or local equivalent) with at most 12 decimal places. Only one of `unit_amount` and `unit_amount_decimal` can be set.", -95063a98714 -> "description": "Pass in `true` to enable `custom_unit_amount`, otherwise omit `custom_unit_amount`.", -95066a98718 -> "description": "The maximum unit amount the customer can specify for this item.", -95069a98722 -> "description": "The minimum unit amount the customer can specify for this item. Must be at least the minimum charge amount.", -95072a98726 -> "description": "The starting unit amount which can be updated by the customer.", -95115a98770 -> "description": "Whether the product is currently available for purchase. Defaults to `true`.", -95118a98774 -> "description": "The identifier for the product. Must be unique. If not provided, an identifier will be randomly generated.", -95125a98782 -> "description": "Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`.", -95128a98786 -> "description": "The product's name, meant to be displayable to the customer.", -95132a98791 -> "description": "An arbitrary string to be displayed on your customer's credit card or bank statement. While most banks display this information consistently, some may display it incorrectly or not at all.\n\nThis may be up to 22 characters. The statement description may not include `<`, `>`, `\\`, `\"`, `'` characters, and will appear on your customer's statement in capital letters. Non-ASCII characters are automatically stripped.", -95136a98796 -> "description": "A [tax code](https://stripe.com/docs/tax/tax-categories) ID.", -95140a98801 -> "description": "A label that represents units of this product in Stripe and on customers’ receipts and invoices. When set, this will be included in associated invoice line item descriptions.", -95154a98816 -> "description": "Specifies a usage aggregation strategy for prices of `usage_type=metered`. Allowed values are `sum` for summing up all usage during a period, `last_during_period` for using the last usage record reported within a period, `last_ever` for using the last usage record ever (across period bounds) or `max` which uses the usage record with the maximum reported usage during a period. Defaults to `sum`.", -95163a98826 -> "description": "Specifies billing frequency. Either `day`, `week`, `month` or `year`.", -95172a98836,98840 -> "description": "The number of intervals between subscription billings. For example, `interval=month` and `interval_count=3` bills every 3 months. Maximum of one year interval allowed (1 year, 12 months, or 52 weeks).", -> "type": "integer" -> }, -> "trial_period_days": { -> "description": "Default number of trial days when subscribing a customer to this price using [`trial_from_plan=true`](https://stripe.com/docs/api#create_subscription-trial_from_plan).", -95175a98844 -> "description": "Configures how the quantity per period should be determined. Can be either `metered` or `licensed`. `licensed` automatically bills the `quantity` set when adding it to a subscription. `metered` aggregates the total usage based on usage records. Defaults to `licensed`.", -95202a98872 -> "description": "The flat billing amount for an entire tier, regardless of the number of units in the tier.", -95205a98876 -> "description": "Same as `flat_amount`, but accepts a decimal value representing an integer in the minor units of the currency. Only one of `flat_amount` and `flat_amount_decimal` can be set.", -95209a98881 -> "description": "The per unit billing amount for each individual unit for which this tier applies.", -95212a98885 -> "description": "Same as `unit_amount`, but accepts a decimal value in cents (or local equivalent) with at most 12 decimal places. Only one of `unit_amount` and `unit_amount_decimal` can be set.", -95228c98901,98902 -< ] ---- -> ], -> "description": "Specifies the upper bound of this tier. The lower bound of a tier is the upper bound of the previous tier adding one. Use `inf` to define a fallback tier." -95254a98929 -> "description": "Divide usage by this number.", -95257a98933 -> "description": "After division, either round the result `up` or `down`.", -95420a99097 -> "next_page", -95543a99221,99224 -> }, -> "recurring": { -> "explode": true, -> "style": "deepObject" -95558a99240 -> "description": "When set, provides configuration for the amount to be adjusted by the customer during Checkout Sessions and Payment Links.", -95560a99243 -> "description": "Pass in `true` to enable `custom_unit_amount`, otherwise omit `custom_unit_amount`.", -95563a99247 -> "description": "The maximum unit amount the customer can specify for this item.", -95566a99251 -> "description": "The minimum unit amount the customer can specify for this item. Must be at least the minimum charge amount.", -95569a99255 -> "description": "The starting unit amount which can be updated by the customer.", -95579a99266 -> "description": "Specifies whether the price is considered inclusive of taxes or exclusive of taxes. One of `inclusive`, `exclusive`, or `unspecified`. Once specified as either `inclusive` or `exclusive`, it cannot be changed.", -95587a99275 -> "description": "Each element represents a pricing tier. This parameter requires `billing_scheme` to be set to `tiered`. See also the documentation for `billing_scheme`.", -95590a99279 -> "description": "The flat billing amount for an entire tier, regardless of the number of units in the tier.", -95593a99283 -> "description": "Same as `flat_amount`, but accepts a decimal value representing an integer in the minor units of the currency. Only one of `flat_amount` and `flat_amount_decimal` can be set.", -95597a99288 -> "description": "The per unit billing amount for each individual unit for which this tier applies.", -95600a99292 -> "description": "Same as `unit_amount`, but accepts a decimal value in cents (or local equivalent) with at most 12 decimal places. Only one of `unit_amount` and `unit_amount_decimal` can be set.", -95616c99308,99309 -< ] ---- -> ], -> "description": "Specifies the upper bound of this tier. The lower bound of a tier is the upper bound of the previous tier adding one. Use `inf` to define a fallback tier." -95627a99321 -> "description": "A positive integer in cents (or local equivalent) (or 0 for a free price) representing how much to charge.", -95630a99325 -> "description": "Same as `unit_amount`, but accepts a decimal value in cents (or local equivalent) with at most 12 decimal places. Only one of `unit_amount` and `unit_amount_decimal` can be set.", -95683a99379,99399 -> "recurring": { -> "anyOf": [ -> { -> "properties": { -> "trial_period_days": { -> "description": "Default number of trial days when subscribing a customer to this plan using [`trial_from_plan=true`](https://stripe.com/docs/api#create_subscription-trial_from_plan).", -> "type": "integer" -> } -> }, -> "title": "update_recurring_params", -> "type": "object" -> }, -> { -> "enum": [ -> "" -> ], -> "type": "string" -> } -> ], -> "description": "The recurring components of a price such as `interval` and `usage_type`." -> }, -95753a99470 -> "description": "Minimum value to filter by (exclusive)", -95756a99474 -> "description": "Minimum value to filter by (inclusive)", -95759a99478 -> "description": "Maximum value to filter by (exclusive)", -95762a99482 -> "description": "Maximum value to filter by (inclusive)", -95848a99569,99582 -> "description": "Only return products of this type.", -> "in": "query", -> "name": "type", -> "required": false, -> "schema": { -> "enum": [ -> "good", -> "service" -> ], -> "type": "string" -> }, -> "style": "form" -> }, -> { -95939a99674,99681 -> "attributes": { -> "explode": true, -> "style": "deepObject" -> }, -> "deactivate_on": { -> "explode": true, -> "style": "deepObject" -> }, -95967a99710,99730 -> "attributes": { -> "description": "A list of up to 5 alphanumeric attributes. Should only be set if type=`good`.", -> "items": { -> "maxLength": 5000, -> "type": "string" -> }, -> "type": "array" -> }, -> "caption": { -> "description": "A short one-line description of the product, meant to be displayable to the customer. May only be set if type=`good`.", -> "maxLength": 5000, -> "type": "string" -> }, -> "deactivate_on": { -> "description": "An array of Connect application names or identifiers that should not be able to order the SKUs for this product. May only be set if type=`good`.", -> "items": { -> "maxLength": 5000, -> "type": "string" -> }, -> "type": "array" -> }, -95971a99735 -> "description": "Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. Must be a [supported currency](https://stripe.com/docs/currencies).", -95977a99742 -> "description": "When set, provides configuration for the amount to be adjusted by the customer during Checkout Sessions and Payment Links.", -95979a99745 -> "description": "Pass in `true` to enable `custom_unit_amount`, otherwise omit `custom_unit_amount`.", -95982a99749 -> "description": "The maximum unit amount the customer can specify for this item.", -95985a99753 -> "description": "The minimum unit amount the customer can specify for this item. Must be at least the minimum charge amount.", -95988a99757 -> "description": "The starting unit amount which can be updated by the customer.", -95998a99768 -> "description": "Specifies whether the price is considered inclusive of taxes or exclusive of taxes. One of `inclusive`, `exclusive`, or `unspecified`. Once specified as either `inclusive` or `exclusive`, it cannot be changed.", -96006a99777 -> "description": "Each element represents a pricing tier. This parameter requires `billing_scheme` to be set to `tiered`. See also the documentation for `billing_scheme`.", -96009a99781 -> "description": "The flat billing amount for an entire tier, regardless of the number of units in the tier.", -96012a99785 -> "description": "Same as `flat_amount`, but accepts a decimal value representing an integer in the minor units of the currency. Only one of `flat_amount` and `flat_amount_decimal` can be set.", -96016a99790 -> "description": "The per unit billing amount for each individual unit for which this tier applies.", -96019a99794 -> "description": "Same as `unit_amount`, but accepts a decimal value in cents (or local equivalent) with at most 12 decimal places. Only one of `unit_amount` and `unit_amount_decimal` can be set.", -96035c99810,99811 -< ] ---- -> ], -> "description": "Specifies the upper bound of this tier. The lower bound of a tier is the upper bound of the previous tier adding one. Use `inf` to define a fallback tier." -96046a99823 -> "description": "A positive integer in cents (or local equivalent) (or 0 for a free price) representing how much to charge.", -96049a99827 -> "description": "Same as `unit_amount`, but accepts a decimal value in cents (or local equivalent) with at most 12 decimal places. Only one of `unit_amount` and `unit_amount_decimal` can be set.", -96056a99835 -> "description": "Prices defined in each available currency option. Each key must be a three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html) and a [supported currency](https://stripe.com/docs/currencies).", -96059a99839 -> "description": "The recurring components of a price such as `interval` and `interval_count`.", -96061a99842 -> "description": "Specifies billing frequency. Either `day`, `week`, `month` or `year`.", -96070a99852 -> "description": "The number of intervals between subscription billings. For example, `interval=month` and `interval_count=3` bills every 3 months. Maximum of one year interval allowed (1 year, 12 months, or 52 weeks).", -96080a99863 -> "description": "Specifies whether the price is considered inclusive of taxes or exclusive of taxes. One of `inclusive`, `exclusive`, or `unspecified`. Once specified as either `inclusive` or `exclusive`, it cannot be changed.", -96088a99872 -> "description": "A positive integer in cents (or local equivalent) (or 0 for a free price) representing how much to charge. One of `unit_amount` or `unit_amount_decimal` is required.", -96091a99876 -> "description": "Same as `unit_amount`, but accepts a decimal value in cents (or local equivalent) with at most 12 decimal places. Only one of `unit_amount` and `unit_amount_decimal` can be set.", -96142a99928 -> "description": "Height, in inches. Maximum precision is 2 decimal places.", -96145a99932 -> "description": "Length, in inches. Maximum precision is 2 decimal places.", -96148a99936 -> "description": "Weight, in ounces. Maximum precision is 2 decimal places.", -96151a99940 -> "description": "Width, in inches. Maximum precision is 2 decimal places.", -96176a99966,99973 -> "type": { -> "description": "The type of the product. Defaults to `service` if not explicitly specified, enabling use of this product with Subscriptions and Plans. Set this parameter to `good` to use this product with Orders and SKUs. On API versions before `2018-02-05`, this field defaults to `good` for compatibility reasons.", -> "enum": [ -> "good", -> "service" -> ], -> "type": "string" -> }, -96326a100124 -> "next_page", -96489a100288,100295 -> "attributes": { -> "explode": true, -> "style": "deepObject" -> }, -> "deactivate_on": { -> "explode": true, -> "style": "deepObject" -> }, -96521a100328,100358 -> "attributes": { -> "anyOf": [ -> { -> "items": { -> "maxLength": 5000, -> "type": "string" -> }, -> "type": "array" -> }, -> { -> "enum": [ -> "" -> ], -> "type": "string" -> } -> ], -> "description": "A list of up to 5 alphanumeric attributes that each SKU can provide values for (e.g., `[\"color\", \"size\"]`). If a value for `attributes` is specified, the list specified will replace the existing attributes list on this product. Any attributes not present after the update will be deleted from the SKUs for this product." -> }, -> "caption": { -> "description": "A short one-line description of the product, meant to be displayable to the customer. May only be set if `type=good`.", -> "maxLength": 5000, -> "type": "string" -> }, -> "deactivate_on": { -> "description": "An array of Connect application names or identifiers that should not be able to order the SKUs for this product. May only be set if `type=good`.", -> "items": { -> "maxLength": 5000, -> "type": "string" -> }, -> "type": "array" -> }, -96583a100421 -> "description": "Height, in inches. Maximum precision is 2 decimal places.", -96586a100425 -> "description": "Length, in inches. Maximum precision is 2 decimal places.", -96589a100429 -> "description": "Weight, in ounces. Maximum precision is 2 decimal places.", -96592a100433 -> "description": "Width, in inches. Maximum precision is 2 decimal places.", -96734a100576 -> "description": "Minimum value to filter by (exclusive)", -96737a100580 -> "description": "Minimum value to filter by (inclusive)", -96740a100584 -> "description": "Maximum value to filter by (exclusive)", -96743a100588 -> "description": "Maximum value to filter by (inclusive)", -96960a100806 -> "description": "Minimum amount required to redeem this Promotion Code into a Coupon (e.g., a purchase must be $100 or more to work).", -96966a100813 -> "description": "Promotion codes defined in each available currency option. Each key must be a three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html) and a [supported currency](https://stripe.com/docs/currencies).", -96969a100817 -> "description": "A Boolean indicating if the Promotion Code should only be redeemed for Customers without any successful payments or invoices", -96972a100821 -> "description": "Minimum amount required to redeem this Promotion Code into a Coupon (e.g., a purchase must be $100 or more to work).", -96975a100825 -> "description": "Three-letter [ISO code](https://stripe.com/docs/currencies) for minimum_amount", -97153a101004 -> "description": "Minimum amount required to redeem this Promotion Code into a Coupon (e.g., a purchase must be $100 or more to work).", -97159a101011 -> "description": "Promotion codes defined in each available currency option. Each key must be a three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html) and a [supported currency](https://stripe.com/docs/currencies).", -97454a101307 -> "description": "Controls whether Stripe will automatically compute tax on the resulting invoices or subscriptions as well as the quote itself.", -97505a101359 -> "description": "ID of the coupon to create a new discount for.", -97509a101364 -> "description": "ID of an existing discount on the object (or one of its ancestors) to reuse.", -97549a101405 -> "description": "Whether this quote is a revision of the previous quote.", -97552a101409 -> "description": "The `id` of the quote that will be cloned.", -97571a101429 -> "description": "Number of days within which a customer must pay the invoice generated by this quote. This value will be `null` for quotes where `collection_method=charge_automatically`.", -97582a101441 -> "description": "The ID of the price object. One of `price` or `price_data` is required.", -97586a101446 -> "description": "Data used to generate a new [Price](https://stripe.com/docs/api/prices) object inline. One of `price` or `price_data` is required.", -97588a101449 -> "description": "Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. Must be a [supported currency](https://stripe.com/docs/currencies).", -97591a101453 -> "description": "The ID of the product that this price will belong to.", -97595a101458 -> "description": "The recurring components of a price such as `interval` and `interval_count`.", -97597a101461 -> "description": "Specifies billing frequency. Either `day`, `week`, `month` or `year`.", -97606a101471 -> "description": "The number of intervals between subscription billings. For example, `interval=month` and `interval_count=3` bills every 3 months. Maximum of one year interval allowed (1 year, 12 months, or 52 weeks).", -97616a101482 -> "description": "Specifies whether the price is considered inclusive of taxes or exclusive of taxes. One of `inclusive`, `exclusive`, or `unspecified`. Once specified as either `inclusive` or `exclusive`, it cannot be changed.", -97624a101491 -> "description": "A positive integer in cents (or local equivalent) (or 0 for a free price) representing how much to charge.", -97627a101495 -> "description": "Same as `unit_amount`, but accepts a decimal value in cents (or local equivalent) with at most 12 decimal places. Only one of `unit_amount` and `unit_amount_decimal` can be set.", -97639a101508 -> "description": "The quantity of the line item.", -97657c101526,101527 -< ] ---- -> ], -> "description": "The tax rates which apply to the line item. When set, the `default_tax_rates` on the quote do not apply to this line item." -97689a101560 -> "description": "The subscription's description, meant to be displayable to the customer. Use this field to optionally store an explanation of the subscription.", -97712c101583,101584 -< ] ---- -> ], -> "description": "When creating a new subscription, the date of which the subscription schedule will start after the quote is accepted. When updating a subscription, the date of which the subscription will be updated using a subscription schedule. The special value `current_period_end` can be provided to update a subscription at the end of its current period. The `effective_date` is ignored if it is in the past when the quote is accepted." -97725c101597,101598 -< ] ---- -> ], -> "description": "Integer representing the number of trial period days before the customer is charged for the first time." -97740a101614 -> "description": "The amount that will be transferred automatically when the invoice is paid. If no amount is set, the full amount is transferred. There cannot be any line items with recurring prices when using this field.", -97743a101618 -> "description": "A non-negative decimal between 0 and 100, with at most two decimal places. This represents the percentage of the subscription invoice subtotal that will be transferred to the destination account. By default, the entire amount is transferred to the destination. There must be at least 1 line item with a recurring price to use this field.", -97746a101622 -> "description": "ID of an existing, connected Stripe account.", -97965a101842 -> "description": "Controls whether Stripe will automatically compute tax on the resulting invoices or subscriptions as well as the quote itself.", -98016a101894 -> "description": "ID of the coupon to create a new discount for.", -98020a101899 -> "description": "ID of an existing discount on the object (or one of its ancestors) to reuse.", -98065a101945 -> "description": "Number of days within which a customer must pay the invoice generated by this quote. This value will be `null` for quotes where `collection_method=charge_automatically`.", -98076a101957 -> "description": "The ID of an existing line item on the quote.", -98080a101962 -> "description": "The ID of the price object. One of `price` or `price_data` is required.", -98084a101967 -> "description": "Data used to generate a new [Price](https://stripe.com/docs/api/prices) object inline. One of `price` or `price_data` is required.", -98086a101970 -> "description": "Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. Must be a [supported currency](https://stripe.com/docs/currencies).", -98089a101974 -> "description": "The ID of the product that this price will belong to.", -98093a101979 -> "description": "The recurring components of a price such as `interval` and `interval_count`.", -98095a101982 -> "description": "Specifies billing frequency. Either `day`, `week`, `month` or `year`.", -98104a101992 -> "description": "The number of intervals between subscription billings. For example, `interval=month` and `interval_count=3` bills every 3 months. Maximum of one year interval allowed (1 year, 12 months, or 52 weeks).", -98114a102003 -> "description": "Specifies whether the price is considered inclusive of taxes or exclusive of taxes. One of `inclusive`, `exclusive`, or `unspecified`. Once specified as either `inclusive` or `exclusive`, it cannot be changed.", -98122a102012 -> "description": "A positive integer in cents (or local equivalent) (or 0 for a free price) representing how much to charge.", -98125a102016 -> "description": "Same as `unit_amount`, but accepts a decimal value in cents (or local equivalent) with at most 12 decimal places. Only one of `unit_amount` and `unit_amount_decimal` can be set.", -98137a102029 -> "description": "The quantity of the line item.", -98155c102047,102048 -< ] ---- -> ], -> "description": "The tax rates which apply to the line item. When set, the `default_tax_rates` on the quote do not apply to this line item." -98187a102081 -> "description": "The subscription's description, meant to be displayable to the customer. Use this field to optionally store an explanation of the subscription.", -98210c102104,102105 -< ] ---- -> ], -> "description": "When creating a new subscription, the date of which the subscription schedule will start after the quote is accepted. When updating a subscription, the date of which the subscription will be updated using a subscription schedule. The special value `current_period_end` can be provided to update a subscription at the end of its current period. The `effective_date` is ignored if it is in the past when the quote is accepted." -98223c102118,102119 -< ] ---- -> ], -> "description": "Integer representing the number of trial period days before the customer is charged for the first time." -98233a102130 -> "description": "The amount that will be transferred automatically when the invoice is paid. If no amount is set, the full amount is transferred. There cannot be any line items with recurring prices when using this field.", -98236a102134 -> "description": "A non-negative decimal between 0 and 100, with at most two decimal places. This represents the percentage of the subscription invoice subtotal that will be transferred to the destination account. By default, the entire amount is transferred to the destination. There must be at least 1 line item with a recurring price to use this field.", -98239a102138 -> "description": "ID of an existing, connected Stripe account.", -99065a102965 -> "description": "Minimum value to filter by (exclusive)", -99068a102969 -> "description": "Minimum value to filter by (inclusive)", -99071a102973 -> "description": "Maximum value to filter by (exclusive)", -99074a102977 -> "description": "Maximum value to filter by (inclusive)", -99453a103357 -> "description": "Minimum value to filter by (exclusive)", -99456a103361 -> "description": "Minimum value to filter by (inclusive)", -99459a103365 -> "description": "Maximum value to filter by (exclusive)", -99462a103369 -> "description": "Maximum value to filter by (inclusive)", -99919a103827 -> "description": "Minimum value to filter by (exclusive)", -99922a103831 -> "description": "Minimum value to filter by (inclusive)", -99925a103835 -> "description": "Maximum value to filter by (exclusive)", -99928a103839 -> "description": "Maximum value to filter by (inclusive)", -100425a104337 -> "description": "Minimum value to filter by (exclusive)", -100428a104341 -> "description": "Minimum value to filter by (inclusive)", -100431a104345 -> "description": "Maximum value to filter by (exclusive)", -100434a104349 -> "description": "Maximum value to filter by (inclusive)", -100598a104514 -> "description": "The set of report columns to include in the report output. If omitted, the Report Type is run with its default column set.", -100605a104522 -> "description": "Connected account ID to filter for in the report run.", -100608a104526 -> "description": "Currency of objects to be included in the report run.", -100611a104530 -> "description": "Ending timestamp of data to be included in the report run (exclusive).", -100615a104535 -> "description": "Starting timestamp of data to be included in the report run.", -100619a104540 -> "description": "Payout ID by which to filter the report run.", -100622a104544 -> "description": "Category of balance transactions to be included in the report run.", -100663a104586 -> "description": "Defaults to `Etc/UTC`. The output timezone for all timestamps in the report. A list of possible time zone values is maintained at the [IANA Time Zone Database](http://www.iana.org/time-zones). Has no effect on `interval_start` or `interval_end`.", -101550a105474 -> "description": "Minimum value to filter by (exclusive)", -101553a105478 -> "description": "Minimum value to filter by (inclusive)", -101556a105482 -> "description": "Maximum value to filter by (exclusive)", -101559a105486 -> "description": "Maximum value to filter by (inclusive)", -101843a105771 -> "description": "Minimum value to filter by (exclusive)", -101846a105775 -> "description": "Minimum value to filter by (inclusive)", -101849a105779 -> "description": "Maximum value to filter by (exclusive)", -101852a105783 -> "description": "Maximum value to filter by (inclusive)", -102023a105955 -> "description": "Minimum value to filter by (exclusive)", -102026a105959 -> "description": "Minimum value to filter by (inclusive)", -102029a105963 -> "description": "Maximum value to filter by (exclusive)", -102032a105967 -> "description": "Maximum value to filter by (inclusive)", -102271a106207 -> "description": "This hash contains details about the customer acceptance of the Mandate.", -102273a106210 -> "description": "The time at which the customer accepted the Mandate.", -102277a106215 -> "description": "If this is a Mandate accepted offline, this hash contains details about the offline acceptance.", -102282a106221 -> "description": "If this is a Mandate accepted online, this hash contains details about the online acceptance.", -102284a106224 -> "description": "The IP address from which the Mandate was accepted by the customer.", -102287a106228 -> "description": "The user agent of the browser from which the Mandate was accepted by the customer.", -102299a106241 -> "description": "The type of customer acceptance information included with the Mandate. One of `online` or `offline`.", -102340a106283 -> "description": "If this is an `acss_debit` PaymentMethod, this hash contains details about the ACSS Debit payment method.", -102342a106286 -> "description": "Customer's bank account number.", -102346a106291 -> "description": "Institution number of the customer's bank.", -102350a106296 -> "description": "Transit number of the customer's bank.", -102363a106310 -> "description": "If this is an `affirm` PaymentMethod, this hash contains details about the Affirm payment method.", -102368a106316 -> "description": "If this is an `AfterpayClearpay` PaymentMethod, this hash contains details about the AfterpayClearpay payment method.", -102373a106322 -> "description": "If this is an `Alipay` PaymentMethod, this hash contains details about the Alipay payment method.", -102378a106328 -> "description": "If this is an `au_becs_debit` PaymentMethod, this hash contains details about the bank account.", -102380a106331 -> "description": "The account number for the bank account.", -102384a106336 -> "description": "Bank-State-Branch number of the bank account.", -102396a106349 -> "description": "If this is a `bacs_debit` PaymentMethod, this hash contains details about the Bacs Direct Debit bank account.", -102398a106352 -> "description": "Account number of the bank account that the funds will be debited from.", -102402a106357 -> "description": "Sort code of the bank account. (e.g., `10-20-30`)", -102410a106366 -> "description": "If this is a `bancontact` PaymentMethod, this hash contains details about the Bancontact payment method.", -102415a106372 -> "description": "Billing information associated with the PaymentMethod that may be used or required by particular types of payment methods.", -102421a106379 -> "description": "City, district, suburb, town, or village.", -102425a106384 -> "description": "Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)).", -102429a106389 -> "description": "Address line 1 (e.g., street, PO Box, or company name).", -102433a106394 -> "description": "Address line 2 (e.g., apartment, suite, unit, or building).", -102437a106399 -> "description": "ZIP or postal code.", -102441a106404 -> "description": "State, county, province, or region.", -102455c106418,106419 -< ] ---- -> ], -> "description": "Billing address." -102468c106432,106433 -< ] ---- -> ], -> "description": "Email address." -102470a106436 -> "description": "Full name.", -102474a106441 -> "description": "Billing phone number (including extension).", -102482a106450 -> "description": "If this is a `blik` PaymentMethod, this hash contains details about the BLIK payment method.", -102487a106456 -> "description": "If this is a `boleto` PaymentMethod, this hash contains details about the Boleto payment method.", -102489a106459 -> "description": "The tax ID of the customer (CPF for individual consumers or CNPJ for businesses consumers)", -102500a106471 -> "description": "If this is a `customer_balance` PaymentMethod, this hash contains details about the CustomerBalance payment method.", -102505a106477 -> "description": "If this is an `eps` PaymentMethod, this hash contains details about the EPS payment method.", -102507a106480 -> "description": "The customer's bank.", -102545a106519 -> "description": "If this is an `fpx` PaymentMethod, this hash contains details about the FPX payment method.", -102546a106521,106529 -> "account_holder_type": { -> "description": "Account holder type for FPX transaction", -> "enum": [ -> "company", -> "individual" -> ], -> "maxLength": 5000, -> "type": "string" -> }, -102547a106531 -> "description": "The customer's bank.", -102583a106568 -> "description": "If this is a `giropay` PaymentMethod, this hash contains details about the Giropay payment method.", -102588a106574 -> "description": "If this is a `grabpay` PaymentMethod, this hash contains details about the GrabPay payment method.", -102593a106580 -> "description": "If this is an `ideal` PaymentMethod, this hash contains details about the iDEAL payment method.", -102595a106583 -> "description": "The customer's bank.", -102618a106607 -> "description": "If this is an `interac_present` PaymentMethod, this hash contains details about the Interac Present payment method.", -102623a106613 -> "description": "If this is a `klarna` PaymentMethod, this hash contains details about the Klarna payment method.", -102625a106616 -> "description": "Customer's date of birth", -102627a106619 -> "description": "The day of birth, between 1 and 31.", -102630a106623 -> "description": "The month of birth, between 1 and 12.", -102633a106627 -> "description": "The four-digit year of birth.", -102649a106644 -> "description": "If this is a `konbini` PaymentMethod, this hash contains details about the Konbini payment method.", -102654a106650 -> "description": "If this is an `Link` PaymentMethod, this hash contains details about the Link payment method.", -102662a106659 -> "description": "Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`.", -102665a106663 -> "description": "If this is an `oxxo` PaymentMethod, this hash contains details about the OXXO payment method.", -102670a106669 -> "description": "If this is a `p24` PaymentMethod, this hash contains details about the P24 payment method.", -102672a106672 -> "description": "The customer's bank.", -102707a106708 -> "description": "If this is a `paynow` PaymentMethod, this hash contains details about the PayNow payment method.", -102712a106714 -> "description": "If this is a `pix` PaymentMethod, this hash contains details about the Pix payment method.", -102717a106720 -> "description": "If this is a `promptpay` PaymentMethod, this hash contains details about the PromptPay payment method.", -102722a106726 -> "description": "Options to configure Radar. See [Radar Session](https://stripe.com/docs/radar/radar-session) for more information.", -102724a106729 -> "description": "A [Radar Session](https://stripe.com/docs/radar/radar-session) is a snapshot of the browser metadata and device details that help Radar make more accurate predictions on your payments.", -102732a106738 -> "description": "If this is a `sepa_debit` PaymentMethod, this hash contains details about the SEPA debit bank account.", -102734a106741 -> "description": "IBAN of the bank account.", -102745a106753 -> "description": "If this is a `sofort` PaymentMethod, this hash contains details about the SOFORT payment method.", -102747a106756 -> "description": "Two-letter ISO code representing the country the bank account is located in.", -102765a106775 -> "description": "The type of the PaymentMethod. An additional hash is included on the PaymentMethod with a name matching this value. It contains additional information specific to the PaymentMethod type.", -102798a106809 -> "description": "If this is an `us_bank_account` PaymentMethod, this hash contains details about the US bank account payment method.", -102800a106812 -> "description": "Account holder type: individual or company.", -102807a106820 -> "description": "Account number of the bank account.", -102811a106825 -> "description": "Account type: checkings or savings. Defaults to checking if omitted.", -102818a106833 -> "description": "The ID of a Financial Connections Account to use as a payment method.", -102822a106838 -> "description": "Routing number of the bank account.", -102830a106847 -> "description": "If this is an `wechat_pay` PaymentMethod, this hash contains details about the wechat_pay payment method.", -102845a106863 -> "description": "If this is a `acss_debit` SetupIntent, this sub-hash contains details about the ACSS Debit payment method options.", -102847a106866 -> "description": "Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. Must be a [supported currency](https://stripe.com/docs/currencies).", -102854a106874 -> "description": "Additional fields for Mandate creation", -102867c106887,106888 -< ] ---- -> ], -> "description": "A URL for custom mandate text to render during confirmation step.\nThe URL will be rendered with additional GET parameters `payment_intent` and `payment_intent_client_secret` when confirming a Payment Intent,\nor `setup_intent` and `setup_intent_client_secret` when confirming a Setup Intent." -102869a106891 -> "description": "List of Stripe products where this mandate can be selected automatically.", -102879a106902 -> "description": "Description of the mandate interval. Only required if 'payment_schedule' parameter is 'interval' or 'combined'.", -102883a106907 -> "description": "Payment schedule for the mandate.", -102891a106916 -> "description": "Transaction type of the mandate.", -102902a106928 -> "description": "Verification method for the intent", -102915a106942 -> "description": "If this is a `blik` PaymentMethod, this hash contains details about the BLIK payment method.", -102917a106945 -> "description": "The 6-digit BLIK code that a customer has generated using their banking application. Can only be set on confirmation.", -102925a106954 -> "description": "Configuration for any card setup attempted on this SetupIntent.", -102927a106957 -> "description": "Configuration options for setting up an eMandate for cards issued in India.", -102929a106960 -> "description": "Amount to be charged for future payments.", -102932a106964 -> "description": "One of `fixed` or `maximum`. If `fixed`, the `amount` param refers to the exact amount to be charged in future payments. If `maximum`, the amount charged can be up to the value passed for the `amount` param.", -102939a106972 -> "description": "Currency in which future payments will be charged. Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. Must be a [supported currency](https://stripe.com/docs/currencies).", -102942a106976 -> "description": "A description of the mandate or subscription that is meant to be displayed to the customer.", -102946a106981 -> "description": "End date of the mandate or subscription. If not provided, the mandate will be active until canceled. If provided, end date should be after start date.", -102950a106986 -> "description": "Specifies payment frequency. One of `day`, `week`, `month`, `year`, or `sporadic`.", -102960a106997 -> "description": "The number of intervals between payments. For example, `interval=month` and `interval_count=3` indicates one payment every three months. Maximum of one year interval allowed (1 year, 12 months, or 52 weeks). This parameter is optional when `interval=sporadic`.", -102963a107001 -> "description": "Unique identifier for the mandate or subscription.", -102967a107006 -> "description": "Start date of the mandate or subscription. Start date should not be lesser than yesterday.", -102971a107011 -> "description": "Specifies the type of mandates supported. Possible values are `india`.", -102991a107032,107035 -> "moto": { -> "description": "When specified, this parameter signals that a card has been collected\nas MOTO (Mail Order Telephone Order) and thus out of scope for SCA. This\nparameter can only be provided during confirmation.", -> "type": "boolean" -> }, -102992a107037 -> "description": "Selected network to process this SetupIntent on. Depends on the available networks of the card attached to the SetupIntent. Can be only set confirm-time.", -103009a107055 -> "description": "We strongly recommend that you rely on our SCA Engine to automatically prompt your customers for authentication based on risk level and [other requirements](https://stripe.com/docs/strong-customer-authentication). However, if you wish to request 3D Secure based on logic from your own fraud engine, provide this option. Permitted values include: `automatic` or `any`. If not provided, defaults to `automatic`. Read our guide on [manually requesting 3D Secure](https://stripe.com/docs/payments/3d-secure#manual-three-ds) for more information on how this configuration interacts with Radar and our SCA Engine.", -103022a107069 -> "description": "If this is a `link` PaymentMethod, this sub-hash contains details about the Link payment method options.", -103024a107072 -> "description": "Token used for persistent Link logins.", -103032a107081 -> "description": "If this is a `sepa_debit` SetupIntent, this sub-hash contains details about the SEPA Debit payment method options.", -103034a107084 -> "description": "Additional fields for Mandate creation", -103043a107094 -> "description": "If this is a `us_bank_account` SetupIntent, this sub-hash contains details about the US bank account payment method options.", -103045a107097 -> "description": "Additional fields for Financial Connections Session creation", -103047a107100 -> "description": "The list of permissions to request. If this parameter is passed, the `payment_method` permission must be included. Valid permissions include: `balances`, `ownership`, `payment_method`, and `transactions`.", -103061a107115 -> "description": "For webview integrations only. Upon completing OAuth login in the native browser, the user will be redirected to this URL to return to your app.", -103069a107124 -> "description": "Additional fields for network related functions", -103071a107127 -> "description": "Triggers validations to run across the selected networks", -103085a107142 -> "description": "Verification method for the intent", -103117a107175 -> "description": "Amount the customer is granting permission to collect later. A positive integer representing how much to charge in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal) (e.g., 100 cents to charge $1.00 or 100 to charge ¥100, a zero-decimal currency). The minimum amount is $0.50 US or [equivalent in charge currency](https://stripe.com/docs/currencies#minimum-and-maximum-charge-amounts). The amount value supports up to eight digits (e.g., a value of 99999999 for a USD charge of $999,999.99).", -103120a107179 -> "description": "Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. Must be a [supported currency](https://stripe.com/docs/currencies).", -103353a107413 -> "description": "If this is an `acss_debit` PaymentMethod, this hash contains details about the ACSS Debit payment method.", -103355a107416 -> "description": "Customer's bank account number.", -103359a107421 -> "description": "Institution number of the customer's bank.", -103363a107426 -> "description": "Transit number of the customer's bank.", -103376a107440 -> "description": "If this is an `affirm` PaymentMethod, this hash contains details about the Affirm payment method.", -103381a107446 -> "description": "If this is an `AfterpayClearpay` PaymentMethod, this hash contains details about the AfterpayClearpay payment method.", -103386a107452 -> "description": "If this is an `Alipay` PaymentMethod, this hash contains details about the Alipay payment method.", -103391a107458 -> "description": "If this is an `au_becs_debit` PaymentMethod, this hash contains details about the bank account.", -103393a107461 -> "description": "The account number for the bank account.", -103397a107466 -> "description": "Bank-State-Branch number of the bank account.", -103409a107479 -> "description": "If this is a `bacs_debit` PaymentMethod, this hash contains details about the Bacs Direct Debit bank account.", -103411a107482 -> "description": "Account number of the bank account that the funds will be debited from.", -103415a107487 -> "description": "Sort code of the bank account. (e.g., `10-20-30`)", -103423a107496 -> "description": "If this is a `bancontact` PaymentMethod, this hash contains details about the Bancontact payment method.", -103428a107502 -> "description": "Billing information associated with the PaymentMethod that may be used or required by particular types of payment methods.", -103434a107509 -> "description": "City, district, suburb, town, or village.", -103438a107514 -> "description": "Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)).", -103442a107519 -> "description": "Address line 1 (e.g., street, PO Box, or company name).", -103446a107524 -> "description": "Address line 2 (e.g., apartment, suite, unit, or building).", -103450a107529 -> "description": "ZIP or postal code.", -103454a107534 -> "description": "State, county, province, or region.", -103468c107548,107549 -< ] ---- -> ], -> "description": "Billing address." -103481c107562,107563 -< ] ---- -> ], -> "description": "Email address." -103483a107566 -> "description": "Full name.", -103487a107571 -> "description": "Billing phone number (including extension).", -103495a107580 -> "description": "If this is a `blik` PaymentMethod, this hash contains details about the BLIK payment method.", -103500a107586 -> "description": "If this is a `boleto` PaymentMethod, this hash contains details about the Boleto payment method.", -103502a107589 -> "description": "The tax ID of the customer (CPF for individual consumers or CNPJ for businesses consumers)", -103513a107601 -> "description": "If this is a `customer_balance` PaymentMethod, this hash contains details about the CustomerBalance payment method.", -103518a107607 -> "description": "If this is an `eps` PaymentMethod, this hash contains details about the EPS payment method.", -103520a107610 -> "description": "The customer's bank.", -103558a107649 -> "description": "If this is an `fpx` PaymentMethod, this hash contains details about the FPX payment method.", -103559a107651,107659 -> "account_holder_type": { -> "description": "Account holder type for FPX transaction", -> "enum": [ -> "company", -> "individual" -> ], -> "maxLength": 5000, -> "type": "string" -> }, -103560a107661 -> "description": "The customer's bank.", -103596a107698 -> "description": "If this is a `giropay` PaymentMethod, this hash contains details about the Giropay payment method.", -103601a107704 -> "description": "If this is a `grabpay` PaymentMethod, this hash contains details about the GrabPay payment method.", -103606a107710 -> "description": "If this is an `ideal` PaymentMethod, this hash contains details about the iDEAL payment method.", -103608a107713 -> "description": "The customer's bank.", -103631a107737 -> "description": "If this is an `interac_present` PaymentMethod, this hash contains details about the Interac Present payment method.", -103636a107743 -> "description": "If this is a `klarna` PaymentMethod, this hash contains details about the Klarna payment method.", -103638a107746 -> "description": "Customer's date of birth", -103640a107749 -> "description": "The day of birth, between 1 and 31.", -103643a107753 -> "description": "The month of birth, between 1 and 12.", -103646a107757 -> "description": "The four-digit year of birth.", -103662a107774 -> "description": "If this is a `konbini` PaymentMethod, this hash contains details about the Konbini payment method.", -103667a107780 -> "description": "If this is an `Link` PaymentMethod, this hash contains details about the Link payment method.", -103675a107789 -> "description": "Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`.", -103678a107793 -> "description": "If this is an `oxxo` PaymentMethod, this hash contains details about the OXXO payment method.", -103683a107799 -> "description": "If this is a `p24` PaymentMethod, this hash contains details about the P24 payment method.", -103685a107802 -> "description": "The customer's bank.", -103720a107838 -> "description": "If this is a `paynow` PaymentMethod, this hash contains details about the PayNow payment method.", -103725a107844 -> "description": "If this is a `pix` PaymentMethod, this hash contains details about the Pix payment method.", -103730a107850 -> "description": "If this is a `promptpay` PaymentMethod, this hash contains details about the PromptPay payment method.", -103735a107856 -> "description": "Options to configure Radar. See [Radar Session](https://stripe.com/docs/radar/radar-session) for more information.", -103737a107859 -> "description": "A [Radar Session](https://stripe.com/docs/radar/radar-session) is a snapshot of the browser metadata and device details that help Radar make more accurate predictions on your payments.", -103745a107868 -> "description": "If this is a `sepa_debit` PaymentMethod, this hash contains details about the SEPA debit bank account.", -103747a107871 -> "description": "IBAN of the bank account.", -103758a107883 -> "description": "If this is a `sofort` PaymentMethod, this hash contains details about the SOFORT payment method.", -103760a107886 -> "description": "Two-letter ISO code representing the country the bank account is located in.", -103778a107905 -> "description": "The type of the PaymentMethod. An additional hash is included on the PaymentMethod with a name matching this value. It contains additional information specific to the PaymentMethod type.", -103811a107939 -> "description": "If this is an `us_bank_account` PaymentMethod, this hash contains details about the US bank account payment method.", -103813a107942 -> "description": "Account holder type: individual or company.", -103820a107950 -> "description": "Account number of the bank account.", -103824a107955 -> "description": "Account type: checkings or savings. Defaults to checking if omitted.", -103831a107963 -> "description": "The ID of a Financial Connections Account to use as a payment method.", -103835a107968 -> "description": "Routing number of the bank account.", -103843a107977 -> "description": "If this is an `wechat_pay` PaymentMethod, this hash contains details about the wechat_pay payment method.", -103858a107993 -> "description": "If this is a `acss_debit` SetupIntent, this sub-hash contains details about the ACSS Debit payment method options.", -103860a107996 -> "description": "Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. Must be a [supported currency](https://stripe.com/docs/currencies).", -103867a108004 -> "description": "Additional fields for Mandate creation", -103880c108017,108018 -< ] ---- -> ], -> "description": "A URL for custom mandate text to render during confirmation step.\nThe URL will be rendered with additional GET parameters `payment_intent` and `payment_intent_client_secret` when confirming a Payment Intent,\nor `setup_intent` and `setup_intent_client_secret` when confirming a Setup Intent." -103882a108021 -> "description": "List of Stripe products where this mandate can be selected automatically.", -103892a108032 -> "description": "Description of the mandate interval. Only required if 'payment_schedule' parameter is 'interval' or 'combined'.", -103896a108037 -> "description": "Payment schedule for the mandate.", -103904a108046 -> "description": "Transaction type of the mandate.", -103915a108058 -> "description": "Verification method for the intent", -103928a108072 -> "description": "If this is a `blik` PaymentMethod, this hash contains details about the BLIK payment method.", -103930a108075 -> "description": "The 6-digit BLIK code that a customer has generated using their banking application. Can only be set on confirmation.", -103938a108084 -> "description": "Configuration for any card setup attempted on this SetupIntent.", -103940a108087 -> "description": "Configuration options for setting up an eMandate for cards issued in India.", -103942a108090 -> "description": "Amount to be charged for future payments.", -103945a108094 -> "description": "One of `fixed` or `maximum`. If `fixed`, the `amount` param refers to the exact amount to be charged in future payments. If `maximum`, the amount charged can be up to the value passed for the `amount` param.", -103952a108102 -> "description": "Currency in which future payments will be charged. Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. Must be a [supported currency](https://stripe.com/docs/currencies).", -103955a108106 -> "description": "A description of the mandate or subscription that is meant to be displayed to the customer.", -103959a108111 -> "description": "End date of the mandate or subscription. If not provided, the mandate will be active until canceled. If provided, end date should be after start date.", -103963a108116 -> "description": "Specifies payment frequency. One of `day`, `week`, `month`, `year`, or `sporadic`.", -103973a108127 -> "description": "The number of intervals between payments. For example, `interval=month` and `interval_count=3` indicates one payment every three months. Maximum of one year interval allowed (1 year, 12 months, or 52 weeks). This parameter is optional when `interval=sporadic`.", -103976a108131 -> "description": "Unique identifier for the mandate or subscription.", -103980a108136 -> "description": "Start date of the mandate or subscription. Start date should not be lesser than yesterday.", -103984a108141 -> "description": "Specifies the type of mandates supported. Possible values are `india`.", -104004a108162,108165 -> "moto": { -> "description": "When specified, this parameter signals that a card has been collected\nas MOTO (Mail Order Telephone Order) and thus out of scope for SCA. This\nparameter can only be provided during confirmation.", -> "type": "boolean" -> }, -104005a108167 -> "description": "Selected network to process this SetupIntent on. Depends on the available networks of the card attached to the SetupIntent. Can be only set confirm-time.", -104022a108185 -> "description": "We strongly recommend that you rely on our SCA Engine to automatically prompt your customers for authentication based on risk level and [other requirements](https://stripe.com/docs/strong-customer-authentication). However, if you wish to request 3D Secure based on logic from your own fraud engine, provide this option. Permitted values include: `automatic` or `any`. If not provided, defaults to `automatic`. Read our guide on [manually requesting 3D Secure](https://stripe.com/docs/payments/3d-secure#manual-three-ds) for more information on how this configuration interacts with Radar and our SCA Engine.", -104035a108199 -> "description": "If this is a `link` PaymentMethod, this sub-hash contains details about the Link payment method options.", -104037a108202 -> "description": "Token used for persistent Link logins.", -104045a108211 -> "description": "If this is a `sepa_debit` SetupIntent, this sub-hash contains details about the SEPA Debit payment method options.", -104047a108214 -> "description": "Additional fields for Mandate creation", -104056a108224 -> "description": "If this is a `us_bank_account` SetupIntent, this sub-hash contains details about the US bank account payment method options.", -104058a108227 -> "description": "Additional fields for Financial Connections Session creation", -104060a108230 -> "description": "The list of permissions to request. If this parameter is passed, the `payment_method` permission must be included. Valid permissions include: `balances`, `ownership`, `payment_method`, and `transactions`.", -104074a108245 -> "description": "For webview integrations only. Upon completing OAuth login in the native browser, the user will be redirected to this URL to return to your app.", -104082a108254 -> "description": "Additional fields for network related functions", -104084a108257 -> "description": "Triggers validations to run across the selected networks", -104098a108272 -> "description": "Verification method for the intent", -104271,104275d108444 -< "client_secret": { -< "description": "The client secret of the SetupIntent.", -< "maxLength": 5000, -< "type": "string" -< }, -104288a108458 -> "description": "This hash contains details about the customer acceptance of the Mandate.", -104290a108461 -> "description": "The time at which the customer accepted the Mandate.", -104294a108466 -> "description": "If this is a Mandate accepted offline, this hash contains details about the offline acceptance.", -104299a108472 -> "description": "If this is a Mandate accepted online, this hash contains details about the online acceptance.", -104301a108475 -> "description": "The IP address from which the Mandate was accepted by the customer.", -104304a108479 -> "description": "The user agent of the browser from which the Mandate was accepted by the customer.", -104316a108492 -> "description": "The type of customer acceptance information included with the Mandate. One of `online` or `offline`.", -104340a108517 -> "description": "This hash contains details about the customer acceptance of the Mandate.", -104342a108520 -> "description": "If this is a Mandate accepted online, this hash contains details about the online acceptance.", -104344a108523 -> "description": "The IP address from which the Mandate was accepted by the customer.", -104347a108527 -> "description": "The user agent of the browser from which the Mandate was accepted by the customer.", -104355a108536 -> "description": "The type of customer acceptance information included with the Mandate.", -104375c108556,108559 -< "type": "object" ---- -> "type": "object", -> "x-stripeParam": { -> "class_name": "MandateDataPublishableKey" -> } -104388a108573 -> "description": "If this is an `acss_debit` PaymentMethod, this hash contains details about the ACSS Debit payment method.", -104390a108576 -> "description": "Customer's bank account number.", -104394a108581 -> "description": "Institution number of the customer's bank.", -104398a108586 -> "description": "Transit number of the customer's bank.", -104411a108600 -> "description": "If this is an `affirm` PaymentMethod, this hash contains details about the Affirm payment method.", -104416a108606 -> "description": "If this is an `AfterpayClearpay` PaymentMethod, this hash contains details about the AfterpayClearpay payment method.", -104421a108612 -> "description": "If this is an `Alipay` PaymentMethod, this hash contains details about the Alipay payment method.", -104426a108618 -> "description": "If this is an `au_becs_debit` PaymentMethod, this hash contains details about the bank account.", -104428a108621 -> "description": "The account number for the bank account.", -104432a108626 -> "description": "Bank-State-Branch number of the bank account.", -104444a108639 -> "description": "If this is a `bacs_debit` PaymentMethod, this hash contains details about the Bacs Direct Debit bank account.", -104446a108642 -> "description": "Account number of the bank account that the funds will be debited from.", -104450a108647 -> "description": "Sort code of the bank account. (e.g., `10-20-30`)", -104458a108656 -> "description": "If this is a `bancontact` PaymentMethod, this hash contains details about the Bancontact payment method.", -104463a108662 -> "description": "Billing information associated with the PaymentMethod that may be used or required by particular types of payment methods.", -104469a108669 -> "description": "City, district, suburb, town, or village.", -104473a108674 -> "description": "Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)).", -104477a108679 -> "description": "Address line 1 (e.g., street, PO Box, or company name).", -104481a108684 -> "description": "Address line 2 (e.g., apartment, suite, unit, or building).", -104485a108689 -> "description": "ZIP or postal code.", -104489a108694 -> "description": "State, county, province, or region.", -104503c108708,108709 -< ] ---- -> ], -> "description": "Billing address." -104516c108722,108723 -< ] ---- -> ], -> "description": "Email address." -104518a108726 -> "description": "Full name.", -104522a108731 -> "description": "Billing phone number (including extension).", -104530a108740 -> "description": "If this is a `blik` PaymentMethod, this hash contains details about the BLIK payment method.", -104535a108746 -> "description": "If this is a `boleto` PaymentMethod, this hash contains details about the Boleto payment method.", -104537a108749 -> "description": "The tax ID of the customer (CPF for individual consumers or CNPJ for businesses consumers)", -104548a108761 -> "description": "If this is a `customer_balance` PaymentMethod, this hash contains details about the CustomerBalance payment method.", -104553a108767 -> "description": "If this is an `eps` PaymentMethod, this hash contains details about the EPS payment method.", -104555a108770 -> "description": "The customer's bank.", -104593a108809 -> "description": "If this is an `fpx` PaymentMethod, this hash contains details about the FPX payment method.", -104594a108811,108819 -> "account_holder_type": { -> "description": "Account holder type for FPX transaction", -> "enum": [ -> "company", -> "individual" -> ], -> "maxLength": 5000, -> "type": "string" -> }, -104595a108821 -> "description": "The customer's bank.", -104631a108858 -> "description": "If this is a `giropay` PaymentMethod, this hash contains details about the Giropay payment method.", -104636a108864 -> "description": "If this is a `grabpay` PaymentMethod, this hash contains details about the GrabPay payment method.", -104641a108870 -> "description": "If this is an `ideal` PaymentMethod, this hash contains details about the iDEAL payment method.", -104643a108873 -> "description": "The customer's bank.", -104666a108897 -> "description": "If this is an `interac_present` PaymentMethod, this hash contains details about the Interac Present payment method.", -104671a108903 -> "description": "If this is a `klarna` PaymentMethod, this hash contains details about the Klarna payment method.", -104673a108906 -> "description": "Customer's date of birth", -104675a108909 -> "description": "The day of birth, between 1 and 31.", -104678a108913 -> "description": "The month of birth, between 1 and 12.", -104681a108917 -> "description": "The four-digit year of birth.", -104697a108934 -> "description": "If this is a `konbini` PaymentMethod, this hash contains details about the Konbini payment method.", -104702a108940 -> "description": "If this is an `Link` PaymentMethod, this hash contains details about the Link payment method.", -104710a108949 -> "description": "Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`.", -104713a108953 -> "description": "If this is an `oxxo` PaymentMethod, this hash contains details about the OXXO payment method.", -104718a108959 -> "description": "If this is a `p24` PaymentMethod, this hash contains details about the P24 payment method.", -104720a108962 -> "description": "The customer's bank.", -104755a108998 -> "description": "If this is a `paynow` PaymentMethod, this hash contains details about the PayNow payment method.", -104760a109004 -> "description": "If this is a `pix` PaymentMethod, this hash contains details about the Pix payment method.", -104765a109010 -> "description": "If this is a `promptpay` PaymentMethod, this hash contains details about the PromptPay payment method.", -104770a109016 -> "description": "Options to configure Radar. See [Radar Session](https://stripe.com/docs/radar/radar-session) for more information.", -104772a109019 -> "description": "A [Radar Session](https://stripe.com/docs/radar/radar-session) is a snapshot of the browser metadata and device details that help Radar make more accurate predictions on your payments.", -104780a109028 -> "description": "If this is a `sepa_debit` PaymentMethod, this hash contains details about the SEPA debit bank account.", -104782a109031 -> "description": "IBAN of the bank account.", -104793a109043 -> "description": "If this is a `sofort` PaymentMethod, this hash contains details about the SOFORT payment method.", -104795a109046 -> "description": "Two-letter ISO code representing the country the bank account is located in.", -104813a109065 -> "description": "The type of the PaymentMethod. An additional hash is included on the PaymentMethod with a name matching this value. It contains additional information specific to the PaymentMethod type.", -104846a109099 -> "description": "If this is an `us_bank_account` PaymentMethod, this hash contains details about the US bank account payment method.", -104848a109102 -> "description": "Account holder type: individual or company.", -104855a109110 -> "description": "Account number of the bank account.", -104859a109115 -> "description": "Account type: checkings or savings. Defaults to checking if omitted.", -104866a109123 -> "description": "The ID of a Financial Connections Account to use as a payment method.", -104870a109128 -> "description": "Routing number of the bank account.", -104878a109137 -> "description": "If this is an `wechat_pay` PaymentMethod, this hash contains details about the wechat_pay payment method.", -104893a109153 -> "description": "If this is a `acss_debit` SetupIntent, this sub-hash contains details about the ACSS Debit payment method options.", -104895a109156 -> "description": "Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. Must be a [supported currency](https://stripe.com/docs/currencies).", -104902a109164 -> "description": "Additional fields for Mandate creation", -104915c109177,109178 -< ] ---- -> ], -> "description": "A URL for custom mandate text to render during confirmation step.\nThe URL will be rendered with additional GET parameters `payment_intent` and `payment_intent_client_secret` when confirming a Payment Intent,\nor `setup_intent` and `setup_intent_client_secret` when confirming a Setup Intent." -104917a109181 -> "description": "List of Stripe products where this mandate can be selected automatically.", -104927a109192 -> "description": "Description of the mandate interval. Only required if 'payment_schedule' parameter is 'interval' or 'combined'.", -104931a109197 -> "description": "Payment schedule for the mandate.", -104939a109206 -> "description": "Transaction type of the mandate.", -104950a109218 -> "description": "Verification method for the intent", -104963a109232 -> "description": "If this is a `blik` PaymentMethod, this hash contains details about the BLIK payment method.", -104965a109235 -> "description": "The 6-digit BLIK code that a customer has generated using their banking application. Can only be set on confirmation.", -104973a109244 -> "description": "Configuration for any card setup attempted on this SetupIntent.", -104975a109247 -> "description": "Configuration options for setting up an eMandate for cards issued in India.", -104977a109250 -> "description": "Amount to be charged for future payments.", -104980a109254 -> "description": "One of `fixed` or `maximum`. If `fixed`, the `amount` param refers to the exact amount to be charged in future payments. If `maximum`, the amount charged can be up to the value passed for the `amount` param.", -104987a109262 -> "description": "Currency in which future payments will be charged. Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. Must be a [supported currency](https://stripe.com/docs/currencies).", -104990a109266 -> "description": "A description of the mandate or subscription that is meant to be displayed to the customer.", -104994a109271 -> "description": "End date of the mandate or subscription. If not provided, the mandate will be active until canceled. If provided, end date should be after start date.", -104998a109276 -> "description": "Specifies payment frequency. One of `day`, `week`, `month`, `year`, or `sporadic`.", -105008a109287 -> "description": "The number of intervals between payments. For example, `interval=month` and `interval_count=3` indicates one payment every three months. Maximum of one year interval allowed (1 year, 12 months, or 52 weeks). This parameter is optional when `interval=sporadic`.", -105011a109291 -> "description": "Unique identifier for the mandate or subscription.", -105015a109296 -> "description": "Start date of the mandate or subscription. Start date should not be lesser than yesterday.", -105019a109301 -> "description": "Specifies the type of mandates supported. Possible values are `india`.", -105039a109322,109325 -> "moto": { -> "description": "When specified, this parameter signals that a card has been collected\nas MOTO (Mail Order Telephone Order) and thus out of scope for SCA. This\nparameter can only be provided during confirmation.", -> "type": "boolean" -> }, -105040a109327 -> "description": "Selected network to process this SetupIntent on. Depends on the available networks of the card attached to the SetupIntent. Can be only set confirm-time.", -105057a109345 -> "description": "We strongly recommend that you rely on our SCA Engine to automatically prompt your customers for authentication based on risk level and [other requirements](https://stripe.com/docs/strong-customer-authentication). However, if you wish to request 3D Secure based on logic from your own fraud engine, provide this option. Permitted values include: `automatic` or `any`. If not provided, defaults to `automatic`. Read our guide on [manually requesting 3D Secure](https://stripe.com/docs/payments/3d-secure#manual-three-ds) for more information on how this configuration interacts with Radar and our SCA Engine.", -105070a109359 -> "description": "If this is a `link` PaymentMethod, this sub-hash contains details about the Link payment method options.", -105072a109362 -> "description": "Token used for persistent Link logins.", -105080a109371 -> "description": "If this is a `sepa_debit` SetupIntent, this sub-hash contains details about the SEPA Debit payment method options.", -105082a109374 -> "description": "Additional fields for Mandate creation", -105091a109384 -> "description": "If this is a `us_bank_account` SetupIntent, this sub-hash contains details about the US bank account payment method options.", -105093a109387 -> "description": "Additional fields for Financial Connections Session creation", -105095a109390 -> "description": "The list of permissions to request. If this parameter is passed, the `payment_method` permission must be included. Valid permissions include: `balances`, `ownership`, `payment_method`, and `transactions`.", -105109a109405 -> "description": "For webview integrations only. Upon completing OAuth login in the native browser, the user will be redirected to this URL to return to your app.", -105117a109414 -> "description": "Additional fields for network related functions", -105119a109417 -> "description": "Triggers validations to run across the selected networks", -105133a109432 -> "description": "Verification method for the intent", -105224,105228d109522 -< "client_secret": { -< "description": "The client secret of the SetupIntent.", -< "maxLength": 5000, -< "type": "string" -< }, -105298a109593 -> "description": "Minimum value to filter by (exclusive)", -105301a109597 -> "description": "Minimum value to filter by (inclusive)", -105304a109601 -> "description": "Maximum value to filter by (exclusive)", -105307a109605 -> "description": "Maximum value to filter by (inclusive)", -105481a109780 -> "description": "The upper bound of the estimated range. If empty, represents no upper bound i.e., infinite.", -105483a109783 -> "description": "A unit of time.", -105493a109794 -> "description": "Must be greater than 0.", -105504a109806 -> "description": "The lower bound of the estimated range. If empty, represents no lower bound.", -105506a109809 -> "description": "A unit of time.", -105516a109820 -> "description": "Must be greater than 0.", -105547a109852 -> "description": "A non-negative integer in cents representing how much to charge.", -105550a109856 -> "description": "Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. Must be a [supported currency](https://stripe.com/docs/currencies).", -105556a109863 -> "description": "A non-negative integer in cents representing how much to charge.", -105559a109867 -> "description": "Specifies whether the rate is considered inclusive of taxes or exclusive of taxes. One of `inclusive`, `exclusive`, or `unspecified`.", -105573a109882 -> "description": "Shipping rates defined in each available currency option. Each key must be a three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html) and a [supported currency](https://stripe.com/docs/currencies).", -105765a110075 -> "description": "A non-negative integer in cents representing how much to charge.", -105768a110079 -> "description": "Specifies whether the rate is considered inclusive of taxes or exclusive of taxes. One of `inclusive`, `exclusive`, or `unspecified`.", -105779a110091 -> "description": "Shipping rates defined in each available currency option. Each key must be a three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html) and a [supported currency](https://stripe.com/docs/currencies).", -106290a110603 -> "description": "The count of inventory available. Required if `type` is `finite`.", -106293a110607 -> "description": "Inventory type. Possible values are `finite`, `bucket` (not quantified), and `infinite`.", -106301a110616 -> "description": "An indicator of the inventory available. Possible values are `in_stock`, `limited`, and `out_of_stock`. Will be present if and only if `type` is `bucket`.", -106327a110643 -> "description": "Height, in inches. Maximum precision is 2 decimal places.", -106330a110647 -> "description": "Length, in inches. Maximum precision is 2 decimal places.", -106333a110651 -> "description": "Weight, in ounces. Maximum precision is 2 decimal places.", -106336a110655 -> "description": "Width, in inches. Maximum precision is 2 decimal places.", -106595a110915 -> "description": "The count of inventory available. Required if `type` is `finite`.", -106598a110919 -> "description": "Inventory type. Possible values are `finite`, `bucket` (not quantified), and `infinite`.", -106606a110928 -> "description": "An indicator of the inventory available. Possible values are `in_stock`, `limited`, and `out_of_stock`. Will be present if and only if `type` is `bucket`.", -106640a110963 -> "description": "Height, in inches. Maximum precision is 2 decimal places.", -106643a110967 -> "description": "Length, in inches. Maximum precision is 2 decimal places.", -106646a110971 -> "description": "Weight, in ounces. Maximum precision is 2 decimal places.", -106649a110975 -> "description": "Width, in inches. Maximum precision is 2 decimal places.", -106786a111113 -> "description": "The parameters required to notify Stripe of a mandate acceptance or refusal by the customer.", -106788a111116 -> "description": "The Unix timestamp (in seconds) when the mandate was accepted or refused by the customer.", -106792a111121 -> "description": "The IP address from which the mandate was accepted or refused by the customer.", -106795a111125 -> "description": "The parameters required to store a mandate accepted offline. Should only be set if `mandate[type]` is `offline`", -106797a111128 -> "description": "An email to contact you with if a copy of the mandate is requested, required if `type` is `offline`.", -106807a111139 -> "description": "The parameters required to store a mandate accepted online. Should only be set if `mandate[type]` is `online`", -106809a111142 -> "description": "The Unix timestamp (in seconds) when the mandate was accepted or refused by the customer.", -106813a111147 -> "description": "The IP address from which the mandate was accepted or refused by the customer.", -106816a111151 -> "description": "The user agent of the browser from which the mandate was accepted or refused by the customer.", -106824a111160 -> "description": "The status of the mandate acceptance. Either `accepted` (the mandate was accepted) or `refused` (the mandate was refused).", -106834a111171 -> "description": "The type of acceptance information included with the mandate. Either `online` or `offline`", -106842a111180 -> "description": "The user agent of the browser from which the mandate was accepted or refused by the customer.", -106864c111202,111203 -< ] ---- -> ], -> "description": "The amount specified by the mandate. (Leave null for a mandate covering all amounts)" -106866a111206 -> "description": "The currency specified by the mandate. (Must match `currency` of the source)", -106869a111210 -> "description": "The interval of debits permitted by the mandate. Either `one_time` (just permitting a single debit), `scheduled` (with debits on an agreed schedule or for clearly-defined events), or `variable`(for debits with any frequency)", -106878a111220 -> "description": "The method Stripe should use to notify the customer of upcoming debit instructions and/or mandate confirmation as required by the underlying debit network. Either `email` (an email is sent directly to the customer), `manual` (a `source.mandate_notification` event is sent to your webhooks endpoint and you should handle the notification) or `none` (the underlying debit network does not require any notification).", -106907a111250 -> "description": "Owner's address.", -106909a111253 -> "description": "City, district, suburb, town, or village.", -106913a111258 -> "description": "Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)).", -106917a111263 -> "description": "Address line 1 (e.g., street, PO Box, or company name).", -106921a111268 -> "description": "Address line 2 (e.g., apartment, suite, unit, or building).", -106925a111273 -> "description": "ZIP or postal code.", -106929a111278 -> "description": "State, county, province, or region.", -106937a111287 -> "description": "Owner's email address.", -106940a111291 -> "description": "Owner's full name.", -106944a111296 -> "description": "Owner's phone number.", -106955a111308 -> "description": "The method Stripe should use to request information needed to process a refund or mispayment. Either `email` (an email is sent directly to the customer) or `manual` (a `source.refund_attributes_required` event is sent to your webhooks endpoint). Refer to each payment method's documentation to learn which refund attributes may be required.", -106971a111325 -> "description": "The URL you provide to redirect the customer back to you after they authenticated their payment. It can use your application URI scheme in the context of a mobile application.", -106984a111339 -> "description": "List of items constituting the order.", -106997a111353 -> "description": "The ID of the SKU being ordered.", -107001a111358 -> "description": "The quantity of this order item. When type is `sku`, this is the number of instances of the SKU to be ordered.", -107020a111378 -> "description": "Shipping address for the order. Required if any of the SKUs are for products that have `shippable` set to true.", -107022a111381 -> "description": "Shipping address.", -107024a111384 -> "description": "City, district, suburb, town, or village.", -107028a111389 -> "description": "Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)).", -107032a111394 -> "description": "Address line 1 (e.g., street, PO Box, or company name).", -107036a111399 -> "description": "Address line 2 (e.g., apartment, suite, unit, or building).", -107040a111404 -> "description": "ZIP or postal code.", -107044a111409 -> "description": "State, county, province, or region.", -107055a111421 -> "description": "The delivery service that shipped a physical product, such as Fedex, UPS, USPS, etc.", -107059a111426 -> "description": "Recipient name.", -107063a111431 -> "description": "Recipient phone (including extension).", -107067a111436 -> "description": "The tracking number for a physical product, obtained from the delivery service. If multiple tracking numbers were generated for this purchase, please separate them with commas.", -107272a111642 -> "description": "The parameters required to notify Stripe of a mandate acceptance or refusal by the customer.", -107274a111645 -> "description": "The Unix timestamp (in seconds) when the mandate was accepted or refused by the customer.", -107278a111650 -> "description": "The IP address from which the mandate was accepted or refused by the customer.", -107281a111654 -> "description": "The parameters required to store a mandate accepted offline. Should only be set if `mandate[type]` is `offline`", -107283a111657 -> "description": "An email to contact you with if a copy of the mandate is requested, required if `type` is `offline`.", -107293a111668 -> "description": "The parameters required to store a mandate accepted online. Should only be set if `mandate[type]` is `online`", -107295a111671 -> "description": "The Unix timestamp (in seconds) when the mandate was accepted or refused by the customer.", -107299a111676 -> "description": "The IP address from which the mandate was accepted or refused by the customer.", -107302a111680 -> "description": "The user agent of the browser from which the mandate was accepted or refused by the customer.", -107310a111689 -> "description": "The status of the mandate acceptance. Either `accepted` (the mandate was accepted) or `refused` (the mandate was refused).", -107320a111700 -> "description": "The type of acceptance information included with the mandate. Either `online` or `offline`", -107328a111709 -> "description": "The user agent of the browser from which the mandate was accepted or refused by the customer.", -107350c111731,111732 -< ] ---- -> ], -> "description": "The amount specified by the mandate. (Leave null for a mandate covering all amounts)" -107352a111735 -> "description": "The currency specified by the mandate. (Must match `currency` of the source)", -107355a111739 -> "description": "The interval of debits permitted by the mandate. Either `one_time` (just permitting a single debit), `scheduled` (with debits on an agreed schedule or for clearly-defined events), or `variable`(for debits with any frequency)", -107364a111749 -> "description": "The method Stripe should use to notify the customer of upcoming debit instructions and/or mandate confirmation as required by the underlying debit network. Either `email` (an email is sent directly to the customer), `manual` (a `source.mandate_notification` event is sent to your webhooks endpoint and you should handle the notification) or `none` (the underlying debit network does not require any notification).", -107399a111785 -> "description": "Owner's address.", -107401a111788 -> "description": "City, district, suburb, town, or village.", -107405a111793 -> "description": "Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)).", -107409a111798 -> "description": "Address line 1 (e.g., street, PO Box, or company name).", -107413a111803 -> "description": "Address line 2 (e.g., apartment, suite, unit, or building).", -107417a111808 -> "description": "ZIP or postal code.", -107421a111813 -> "description": "State, county, province, or region.", -107429a111822 -> "description": "Owner's email address.", -107432a111826 -> "description": "Owner's full name.", -107436a111831 -> "description": "Owner's phone number.", -107447a111843 -> "description": "List of items constituting the order.", -107460a111857 -> "description": "The ID of the SKU being ordered.", -107464a111862 -> "description": "The quantity of this order item. When type is `sku`, this is the number of instances of the SKU to be ordered.", -107483a111882 -> "description": "Shipping address for the order. Required if any of the SKUs are for products that have `shippable` set to true.", -107485a111885 -> "description": "Shipping address.", -107487a111888 -> "description": "City, district, suburb, town, or village.", -107491a111893 -> "description": "Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)).", -107495a111898 -> "description": "Address line 1 (e.g., street, PO Box, or company name).", -107499a111903 -> "description": "Address line 2 (e.g., apartment, suite, unit, or building).", -107503a111908 -> "description": "ZIP or postal code.", -107507a111913 -> "description": "State, county, province, or region.", -107518a111925 -> "description": "The delivery service that shipped a physical product, such as Fedex, UPS, USPS, etc.", -107522a111930 -> "description": "Recipient name.", -107526a111935 -> "description": "Recipient phone (including extension).", -107530a111940 -> "description": "The tracking number for a physical product, obtained from the delivery service. If multiple tracking numbers were generated for this purchase, please separate them with commas.", -107576,107653d111985 -< "/v1/sources/{source}/mandate_notifications/{mandate_notification}": { -< "get": { -< "description": "

Retrieves a new Source MandateNotification.

", -< "operationId": "GetSourcesSourceMandateNotificationsMandateNotification", -< "parameters": [ -< { -< "description": "Specifies which fields in the response should be expanded.", -< "explode": true, -< "in": "query", -< "name": "expand", -< "required": false, -< "schema": { -< "items": { -< "maxLength": 5000, -< "type": "string" -< }, -< "type": "array" -< }, -< "style": "deepObject" -< }, -< { -< "in": "path", -< "name": "mandate_notification", -< "required": true, -< "schema": { -< "maxLength": 5000, -< "type": "string" -< }, -< "style": "simple" -< }, -< { -< "in": "path", -< "name": "source", -< "required": true, -< "schema": { -< "maxLength": 5000, -< "type": "string" -< }, -< "style": "simple" -< } -< ], -< "requestBody": { -< "content": { -< "application/x-www-form-urlencoded": { -< "encoding": {}, -< "schema": { -< "additionalProperties": false, -< "properties": {}, -< "type": "object" -< } -< } -< }, -< "required": false -< }, -< "responses": { -< "200": { -< "content": { -< "application/json": { -< "schema": { -< "$ref": "#/components/schemas/source_mandate_notification" -< } -< } -< }, -< "description": "Successful response." -< }, -< "default": { -< "content": { -< "application/json": { -< "schema": { -< "$ref": "#/components/schemas/error" -< } -< } -< }, -< "description": "Error response." -< } -< } -< } -< }, -107789,107866d112120 -< "/v1/sources/{source}/source_transactions/{source_transaction}": { -< "get": { -< "description": "

Retrieve an existing source transaction object. Supply the unique source ID from a source creation request and the source transaction ID and Stripe will return the corresponding up-to-date source object information.

", -< "operationId": "GetSourcesSourceSourceTransactionsSourceTransaction", -< "parameters": [ -< { -< "description": "Specifies which fields in the response should be expanded.", -< "explode": true, -< "in": "query", -< "name": "expand", -< "required": false, -< "schema": { -< "items": { -< "maxLength": 5000, -< "type": "string" -< }, -< "type": "array" -< }, -< "style": "deepObject" -< }, -< { -< "in": "path", -< "name": "source", -< "required": true, -< "schema": { -< "maxLength": 5000, -< "type": "string" -< }, -< "style": "simple" -< }, -< { -< "in": "path", -< "name": "source_transaction", -< "required": true, -< "schema": { -< "maxLength": 5000, -< "type": "string" -< }, -< "style": "simple" -< } -< ], -< "requestBody": { -< "content": { -< "application/x-www-form-urlencoded": { -< "encoding": {}, -< "schema": { -< "additionalProperties": false, -< "properties": {}, -< "type": "object" -< } -< } -< }, -< "required": false -< }, -< "responses": { -< "200": { -< "content": { -< "application/json": { -< "schema": { -< "$ref": "#/components/schemas/source_transaction" -< } -< } -< }, -< "description": "Successful response." -< }, -< "default": { -< "content": { -< "application/json": { -< "schema": { -< "$ref": "#/components/schemas/error" -< } -< } -< }, -< "description": "Error response." -< } -< } -< } -< }, -108118a112373 -> "description": "Usage threshold that triggers the subscription to advance to a new billing period", -108161a112417,112421 -> "plan": { -> "description": "The identifier of the plan to add to the subscription.", -> "maxLength": 5000, -> "type": "string" -> }, -108170a112431 -> "description": "Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. Must be a [supported currency](https://stripe.com/docs/currencies).", -108173a112435 -> "description": "The ID of the product that this price will belong to.", -108177a112440 -> "description": "The recurring components of a price such as `interval` and `interval_count`.", -108179a112443 -> "description": "Specifies billing frequency. Either `day`, `week`, `month` or `year`.", -108188a112453 -> "description": "The number of intervals between subscription billings. For example, `interval=month` and `interval_count=3` bills every 3 months. Maximum of one year interval allowed (1 year, 12 months, or 52 weeks).", -108198a112464 -> "description": "Specifies whether the price is considered inclusive of taxes or exclusive of taxes. One of `inclusive`, `exclusive`, or `unspecified`. Once specified as either `inclusive` or `exclusive`, it cannot be changed.", -108206a112473 -> "description": "A positive integer in cents (or local equivalent) (or 0 for a free price) representing how much to charge.", -108209a112477 -> "description": "Same as `unit_amount`, but accepts a decimal value in cents (or local equivalent) with at most 12 decimal places. Only one of `unit_amount` and `unit_amount_decimal` can be set.", -108481a112750 -> "description": "Usage threshold that triggers the subscription to advance to a new billing period", -108538a112808,112812 -> "plan": { -> "description": "The identifier of the new plan for this subscription item.", -> "maxLength": 5000, -> "type": "string" -> }, -108547a112822 -> "description": "Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. Must be a [supported currency](https://stripe.com/docs/currencies).", -108550a112826 -> "description": "The ID of the product that this price will belong to.", -108554a112831 -> "description": "The recurring components of a price such as `interval` and `interval_count`.", -108556a112834 -> "description": "Specifies billing frequency. Either `day`, `week`, `month` or `year`.", -108565a112844 -> "description": "The number of intervals between subscription billings. For example, `interval=month` and `interval_count=3` bills every 3 months. Maximum of one year interval allowed (1 year, 12 months, or 52 weeks).", -108575a112855 -> "description": "Specifies whether the price is considered inclusive of taxes or exclusive of taxes. One of `inclusive`, `exclusive`, or `unspecified`. Once specified as either `inclusive` or `exclusive`, it cannot be changed.", -108583a112864 -> "description": "A positive integer in cents (or local equivalent) (or 0 for a free price) representing how much to charge.", -108586a112868 -> "description": "Same as `unit_amount`, but accepts a decimal value in cents (or local equivalent) with at most 12 decimal places. Only one of `unit_amount` and `unit_amount_decimal` can be set.", -108915a113198 -> "description": "Minimum value to filter by (exclusive)", -108918a113202 -> "description": "Minimum value to filter by (inclusive)", -108921a113206 -> "description": "Maximum value to filter by (exclusive)", -108924a113210 -> "description": "Maximum value to filter by (inclusive)", -108948a113235 -> "description": "Minimum value to filter by (exclusive)", -108951a113239 -> "description": "Minimum value to filter by (inclusive)", -108954a113243 -> "description": "Maximum value to filter by (exclusive)", -108957a113247 -> "description": "Maximum value to filter by (inclusive)", -108981a113272 -> "description": "Minimum value to filter by (exclusive)", -108984a113276 -> "description": "Minimum value to filter by (inclusive)", -108987a113280 -> "description": "Maximum value to filter by (exclusive)", -108990a113284 -> "description": "Maximum value to filter by (inclusive)", -109061a113356 -> "description": "Minimum value to filter by (exclusive)", -109064a113360 -> "description": "Minimum value to filter by (inclusive)", -109067a113364 -> "description": "Maximum value to filter by (exclusive)", -109070a113368 -> "description": "Maximum value to filter by (inclusive)", -109217a113516 -> "description": "A non-negative decimal between 0 and 100, with at most two decimal places. This represents the percentage of the subscription invoice subtotal that will be transferred to the application owner's Stripe account. The request must be made by a platform account on a connected account in order to set an application fee percentage. For more information, see the application fees [documentation](https://stripe.com/docs/connect/subscriptions#collecting-fees-on-subscriptions).", -109220a113520 -> "description": "Default settings for automatic tax computation.", -109222a113523 -> "description": "Enabled automatic tax calculation which will automatically compute tax rates on all invoices generated by the subscription.", -109232a113534 -> "description": "Can be set to `phase_start` to set the anchor to the start of the phase or `automatic` to automatically change it if needed. Cannot be set to `phase_start` if this phase specifies a trial. For more information, see the billing cycle [documentation](https://stripe.com/docs/billing/subscriptions/billing-cycle).", -109243a113546 -> "description": "Monetary threshold that triggers the subscription to advance to a new billing period", -109246a113550 -> "description": "Indicates if the `billing_cycle_anchor` should be reset when a threshold is reached. If true, `billing_cycle_anchor` will be updated to the date/time the threshold was last reached; otherwise, the value will remain unchanged.", -109259c113563,113564 -< ] ---- -> ], -> "description": "Define thresholds at which an invoice will be sent, and the subscription advanced to a new billing period. Pass an empty string to remove previously-defined thresholds." -109261a113567 -> "description": "Either `charge_automatically`, or `send_invoice`. When charging automatically, Stripe will attempt to pay the underlying subscription at the end of each billing cycle using the default source attached to the customer. When sending an invoice, Stripe will email your customer an invoice with payment instructions and mark the subscription as `active`. Defaults to `charge_automatically` on creation.", -109268a113575 -> "description": "ID of the default payment method for the subscription schedule. It must belong to the customer associated with the subscription schedule. If not set, invoices will use the default payment method in the customer's invoice settings.", -109272a113580 -> "description": "Subscription description, meant to be displayable to the customer. Use this field to optionally store an explanation of the subscription.", -109276a113585 -> "description": "All invoices will be billed using the specified settings.", -109278a113588 -> "description": "Number of days within which a customer must pay invoices generated by this subscription schedule. This value will be `null` for subscription schedules where `billing=charge_automatically`.", -109296c113606,113607 -< ] ---- -> ], -> "description": "The account on behalf of which to charge, for each of the associated subscription's invoices." -109302a113614 -> "description": "A non-negative decimal between 0 and 100, with at most two decimal places. This represents the percentage of the subscription invoice subtotal that will be transferred to the destination account. By default, the entire amount is transferred to the destination.", -109305a113618 -> "description": "ID of an existing, connected Stripe account.", -109321c113634,113635 -< ] ---- -> ], -> "description": "The data with which to automatically create a Transfer for each of the associated subscription's invoices." -109371a113686 -> "description": "A list of prices and quantities that will generate invoice items appended to the next invoice for this phase. You may pass up to 20 items.", -109374a113690 -> "description": "The ID of the price object.", -109378a113695 -> "description": "Data used to generate a new [Price](https://stripe.com/docs/api/prices) object inline.", -109380a113698 -> "description": "Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. Must be a [supported currency](https://stripe.com/docs/currencies).", -109383a113702 -> "description": "The ID of the product that this price will belong to.", -109387a113707 -> "description": "Specifies whether the price is considered inclusive of taxes or exclusive of taxes. One of `inclusive`, `exclusive`, or `unspecified`. Once specified as either `inclusive` or `exclusive`, it cannot be changed.", -109395a113716 -> "description": "A positive integer in cents (or local equivalent) (or 0 for a free price) representing how much to charge.", -109398a113720 -> "description": "Same as `unit_amount`, but accepts a decimal value in cents (or local equivalent) with at most 12 decimal places. Only one of `unit_amount` and `unit_amount_decimal` can be set.", -109410a113733 -> "description": "Quantity for this item. Defaults to 1.", -109428c113751,113752 -< ] ---- -> ], -> "description": "The tax rates which apply to the item. When set, the `default_tax_rates` do not apply to this item." -109432c113756,113759 -< "type": "object" ---- -> "type": "object", -> "x-stripeParam": { -> "class_name": "AddInvoiceItem" -> } -109436a113764 -> "description": "A non-negative decimal between 0 and 100, with at most two decimal places. This represents the percentage of the subscription invoice subtotal that will be transferred to the application owner's Stripe account. The request must be made by a platform account on a connected account in order to set an application fee percentage. For more information, see the application fees [documentation](https://stripe.com/docs/connect/subscriptions#collecting-fees-on-subscriptions).", -109439a113768 -> "description": "Automatic tax settings for this phase.", -109441a113771 -> "description": "Enabled automatic tax calculation which will automatically compute tax rates on all invoices generated by the subscription.", -109451a113782 -> "description": "Can be set to `phase_start` to set the anchor to the start of the phase or `automatic` to automatically change it if needed. Cannot be set to `phase_start` if this phase specifies a trial. For more information, see the billing cycle [documentation](https://stripe.com/docs/billing/subscriptions/billing-cycle).", -109462a113794 -> "description": "Monetary threshold that triggers the subscription to advance to a new billing period", -109465a113798 -> "description": "Indicates if the `billing_cycle_anchor` should be reset when a threshold is reached. If true, `billing_cycle_anchor` will be updated to the date/time the threshold was last reached; otherwise, the value will remain unchanged.", -109478c113811,113812 -< ] ---- -> ], -> "description": "Define thresholds at which an invoice will be sent, and the subscription advanced to a new billing period. Pass an empty string to remove previously-defined thresholds." -109480a113815 -> "description": "Either `charge_automatically`, or `send_invoice`. When charging automatically, Stripe will attempt to pay the underlying subscription at the end of each billing cycle using the default source attached to the customer. When sending an invoice, Stripe will email your customer an invoice with payment instructions and mark the subscription as `active`. Defaults to `charge_automatically` on creation.", -109487a113823 -> "description": "The identifier of the coupon to apply to this phase of the subscription schedule.", -109491a113828 -> "description": "Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. Must be a [supported currency](https://stripe.com/docs/currencies).", -109494a113832 -> "description": "ID of the default payment method for the subscription schedule. It must belong to the customer associated with the subscription schedule. If not set, invoices will use the default payment method in the customer's invoice settings.", -109513c113851,113852 -< ] ---- -> ], -> "description": "A list of [Tax Rate](https://stripe.com/docs/api/tax_rates) ids. These Tax Rates will set the Subscription's [`default_tax_rates`](https://stripe.com/docs/api/subscriptions/create#create_subscription-default_tax_rates), which means they will be the Invoice's [`default_tax_rates`](https://stripe.com/docs/api/invoices/create#create_invoice-default_tax_rates) for any Invoices issued by the Subscription during this Phase." -109515a113855 -> "description": "Subscription description, meant to be displayable to the customer. Use this field to optionally store an explanation of the subscription.", -109519a113860 -> "description": "The date at which this phase of the subscription schedule ends. If set, `iterations` must not be set.", -109523a113865 -> "description": "All invoices will be billed using the specified settings.", -109525a113868 -> "description": "Number of days within which a customer must pay invoices generated by this subscription schedule. This value will be `null` for subscription schedules where `billing=charge_automatically`.", -109532a113876 -> "description": "List of configuration items, each with an attached price, to apply during this phase of the subscription schedule.", -109539a113884 -> "description": "Usage threshold that triggers the subscription to advance to a new billing period", -109555c113900,113906 -< ] ---- -> ], -> "description": "Define thresholds at which an invoice will be sent, and the subscription advanced to a new billing period. When updating, pass an empty string to remove previously-defined thresholds." -> }, -> "plan": { -> "description": "The plan ID to subscribe to. You may specify the same ID in `plan` and `price`.", -> "maxLength": 5000, -> "type": "string" -109557a113909 -> "description": "The ID of the price object.", -109561a113914 -> "description": "Data used to generate a new [Price](https://stripe.com/docs/api/prices) object inline.", -109563a113917 -> "description": "Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. Must be a [supported currency](https://stripe.com/docs/currencies).", -109566a113921 -> "description": "The ID of the product that this price will belong to.", -109570a113926 -> "description": "The recurring components of a price such as `interval` and `interval_count`.", -109572a113929 -> "description": "Specifies billing frequency. Either `day`, `week`, `month` or `year`.", -109581a113939 -> "description": "The number of intervals between subscription billings. For example, `interval=month` and `interval_count=3` bills every 3 months. Maximum of one year interval allowed (1 year, 12 months, or 52 weeks).", -109591a113950 -> "description": "Specifies whether the price is considered inclusive of taxes or exclusive of taxes. One of `inclusive`, `exclusive`, or `unspecified`. Once specified as either `inclusive` or `exclusive`, it cannot be changed.", -109599a113959 -> "description": "A positive integer in cents (or local equivalent) (or 0 for a free price) representing how much to charge.", -109602a113963 -> "description": "Same as `unit_amount`, but accepts a decimal value in cents (or local equivalent) with at most 12 decimal places. Only one of `unit_amount` and `unit_amount_decimal` can be set.", -109615a113977 -> "description": "Quantity for the given price. Can be set only if the price's `usage_type` is `licensed` and not `metered`.", -109633c113995,113996 -< ] ---- -> ], -> "description": "A list of [Tax Rate](https://stripe.com/docs/api/tax_rates) ids. These Tax Rates will override the [`default_tax_rates`](https://stripe.com/docs/api/subscriptions/create#create_subscription-default_tax_rates) on the Subscription. When updating, pass an empty string to remove previously-defined tax rates." -109641a114005 -> "description": "Integer representing the multiplier applied to the price interval. For example, `iterations=2` applied to a price with `interval=month` and `interval_count=3` results in a phase of duration `2 * 3 months = 6 months`. If set, `end_date` must not be set.", -109647a114012 -> "description": "Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to a phase. Metadata on a schedule's phase will update the underlying subscription's `metadata` when the phase is entered, adding new keys and replacing existing keys in the subscription's `metadata`. Individual keys in the subscription's `metadata` can be unset by posting an empty value to them in the phase's `metadata`. To unset all keys in the subscription's `metadata`, update the subscription directly or unset every key individually from the phase's `metadata`.", -109650a114016 -> "description": "The account on behalf of which to charge, for each of the associated subscription's invoices.", -109653a114020 -> "description": "Whether the subscription schedule will create [prorations](https://stripe.com/docs/billing/subscriptions/prorations) when transitioning to this phase. The default value is `create_prorations`.", -109661a114029 -> "description": "The data with which to automatically create a Transfer for each of the associated subscription's invoices.", -109663a114032 -> "description": "A non-negative decimal between 0 and 100, with at most two decimal places. This represents the percentage of the subscription invoice subtotal that will be transferred to the destination account. By default, the entire amount is transferred to the destination.", -109666a114036 -> "description": "ID of an existing, connected Stripe account.", -109676a114047 -> "description": "If set to true the entire phase is counted as a trial and the customer will not be charged for any fees.", -109679a114051 -> "description": "Sets the phase to trialing from the start date to this date. Must be before the phase end date, can not be combined with `trial`", -109847a114220 -> "description": "A non-negative decimal between 0 and 100, with at most two decimal places. This represents the percentage of the subscription invoice subtotal that will be transferred to the application owner's Stripe account. The request must be made by a platform account on a connected account in order to set an application fee percentage. For more information, see the application fees [documentation](https://stripe.com/docs/connect/subscriptions#collecting-fees-on-subscriptions).", -109850a114224 -> "description": "Default settings for automatic tax computation.", -109852a114227 -> "description": "Enabled automatic tax calculation which will automatically compute tax rates on all invoices generated by the subscription.", -109862a114238 -> "description": "Can be set to `phase_start` to set the anchor to the start of the phase or `automatic` to automatically change it if needed. Cannot be set to `phase_start` if this phase specifies a trial. For more information, see the billing cycle [documentation](https://stripe.com/docs/billing/subscriptions/billing-cycle).", -109873a114250 -> "description": "Monetary threshold that triggers the subscription to advance to a new billing period", -109876a114254 -> "description": "Indicates if the `billing_cycle_anchor` should be reset when a threshold is reached. If true, `billing_cycle_anchor` will be updated to the date/time the threshold was last reached; otherwise, the value will remain unchanged.", -109889c114267,114268 -< ] ---- -> ], -> "description": "Define thresholds at which an invoice will be sent, and the subscription advanced to a new billing period. Pass an empty string to remove previously-defined thresholds." -109891a114271 -> "description": "Either `charge_automatically`, or `send_invoice`. When charging automatically, Stripe will attempt to pay the underlying subscription at the end of each billing cycle using the default source attached to the customer. When sending an invoice, Stripe will email your customer an invoice with payment instructions and mark the subscription as `active`. Defaults to `charge_automatically` on creation.", -109898a114279 -> "description": "ID of the default payment method for the subscription schedule. It must belong to the customer associated with the subscription schedule. If not set, invoices will use the default payment method in the customer's invoice settings.", -109902a114284 -> "description": "Subscription description, meant to be displayable to the customer. Use this field to optionally store an explanation of the subscription.", -109906a114289 -> "description": "All invoices will be billed using the specified settings.", -109908a114292 -> "description": "Number of days within which a customer must pay invoices generated by this subscription schedule. This value will be `null` for subscription schedules where `billing=charge_automatically`.", -109926c114310,114311 -< ] ---- -> ], -> "description": "The account on behalf of which to charge, for each of the associated subscription's invoices." -109932a114318 -> "description": "A non-negative decimal between 0 and 100, with at most two decimal places. This represents the percentage of the subscription invoice subtotal that will be transferred to the destination account. By default, the entire amount is transferred to the destination.", -109935a114322 -> "description": "ID of an existing, connected Stripe account.", -109951c114338,114339 -< ] ---- -> ], -> "description": "The data with which to automatically create a Transfer for each of the associated subscription's invoices." -109996a114385 -> "description": "A list of prices and quantities that will generate invoice items appended to the next invoice for this phase. You may pass up to 20 items.", -109999a114389 -> "description": "The ID of the price object.", -110003a114394 -> "description": "Data used to generate a new [Price](https://stripe.com/docs/api/prices) object inline.", -110005a114397 -> "description": "Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. Must be a [supported currency](https://stripe.com/docs/currencies).", -110008a114401 -> "description": "The ID of the product that this price will belong to.", -110012a114406 -> "description": "Specifies whether the price is considered inclusive of taxes or exclusive of taxes. One of `inclusive`, `exclusive`, or `unspecified`. Once specified as either `inclusive` or `exclusive`, it cannot be changed.", -110020a114415 -> "description": "A positive integer in cents (or local equivalent) (or 0 for a free price) representing how much to charge.", -110023a114419 -> "description": "Same as `unit_amount`, but accepts a decimal value in cents (or local equivalent) with at most 12 decimal places. Only one of `unit_amount` and `unit_amount_decimal` can be set.", -110035a114432 -> "description": "Quantity for this item. Defaults to 1.", -110053c114450,114451 -< ] ---- -> ], -> "description": "The tax rates which apply to the item. When set, the `default_tax_rates` do not apply to this item." -110057c114455,114458 -< "type": "object" ---- -> "type": "object", -> "x-stripeParam": { -> "class_name": "AddInvoiceItem" -> } -110061a114463 -> "description": "A non-negative decimal between 0 and 100, with at most two decimal places. This represents the percentage of the subscription invoice subtotal that will be transferred to the application owner's Stripe account. The request must be made by a platform account on a connected account in order to set an application fee percentage. For more information, see the application fees [documentation](https://stripe.com/docs/connect/subscriptions#collecting-fees-on-subscriptions).", -110064a114467 -> "description": "Automatic tax settings for this phase.", -110066a114470 -> "description": "Enabled automatic tax calculation which will automatically compute tax rates on all invoices generated by the subscription.", -110076a114481 -> "description": "Can be set to `phase_start` to set the anchor to the start of the phase or `automatic` to automatically change it if needed. Cannot be set to `phase_start` if this phase specifies a trial. For more information, see the billing cycle [documentation](https://stripe.com/docs/billing/subscriptions/billing-cycle).", -110087a114493 -> "description": "Monetary threshold that triggers the subscription to advance to a new billing period", -110090a114497 -> "description": "Indicates if the `billing_cycle_anchor` should be reset when a threshold is reached. If true, `billing_cycle_anchor` will be updated to the date/time the threshold was last reached; otherwise, the value will remain unchanged.", -110103c114510,114511 -< ] ---- -> ], -> "description": "Define thresholds at which an invoice will be sent, and the subscription advanced to a new billing period. Pass an empty string to remove previously-defined thresholds." -110105a114514 -> "description": "Either `charge_automatically`, or `send_invoice`. When charging automatically, Stripe will attempt to pay the underlying subscription at the end of each billing cycle using the default source attached to the customer. When sending an invoice, Stripe will email your customer an invoice with payment instructions and mark the subscription as `active`. Defaults to `charge_automatically` on creation.", -110112a114522 -> "description": "The identifier of the coupon to apply to this phase of the subscription schedule.", -110115a114526,114529 -> "currency": { -> "description": "Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. Must be a [supported currency](https://stripe.com/docs/currencies).", -> "type": "string" -> }, -110116a114531 -> "description": "ID of the default payment method for the subscription schedule. It must belong to the customer associated with the subscription schedule. If not set, invoices will use the default payment method in the customer's invoice settings.", -110135c114550,114551 -< ] ---- -> ], -> "description": "A list of [Tax Rate](https://stripe.com/docs/api/tax_rates) ids. These Tax Rates will set the Subscription's [`default_tax_rates`](https://stripe.com/docs/api/subscriptions/create#create_subscription-default_tax_rates), which means they will be the Invoice's [`default_tax_rates`](https://stripe.com/docs/api/invoices/create#create_invoice-default_tax_rates) for any Invoices issued by the Subscription during this Phase." -110137a114554 -> "description": "Subscription description, meant to be displayable to the customer. Use this field to optionally store an explanation of the subscription.", -110153c114570,114571 -< ] ---- -> ], -> "description": "The date at which this phase of the subscription schedule ends. If set, `iterations` must not be set." -110155a114574 -> "description": "All invoices will be billed using the specified settings.", -110157a114577 -> "description": "Number of days within which a customer must pay invoices generated by this subscription schedule. This value will be `null` for subscription schedules where `billing=charge_automatically`.", -110164a114585 -> "description": "List of configuration items, each with an attached price, to apply during this phase of the subscription schedule.", -110171a114593 -> "description": "Usage threshold that triggers the subscription to advance to a new billing period", -110187c114609,114615 -< ] ---- -> ], -> "description": "Define thresholds at which an invoice will be sent, and the subscription advanced to a new billing period. When updating, pass an empty string to remove previously-defined thresholds." -> }, -> "plan": { -> "description": "The plan ID to subscribe to. You may specify the same ID in `plan` and `price`.", -> "maxLength": 5000, -> "type": "string" -110189a114618 -> "description": "The ID of the price object.", -110193a114623 -> "description": "Data used to generate a new [Price](https://stripe.com/docs/api/prices) object inline.", -110195a114626 -> "description": "Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. Must be a [supported currency](https://stripe.com/docs/currencies).", -110198a114630 -> "description": "The ID of the product that this price will belong to.", -110202a114635 -> "description": "The recurring components of a price such as `interval` and `interval_count`.", -110204a114638 -> "description": "Specifies billing frequency. Either `day`, `week`, `month` or `year`.", -110213a114648 -> "description": "The number of intervals between subscription billings. For example, `interval=month` and `interval_count=3` bills every 3 months. Maximum of one year interval allowed (1 year, 12 months, or 52 weeks).", -110223a114659 -> "description": "Specifies whether the price is considered inclusive of taxes or exclusive of taxes. One of `inclusive`, `exclusive`, or `unspecified`. Once specified as either `inclusive` or `exclusive`, it cannot be changed.", -110231a114668 -> "description": "A positive integer in cents (or local equivalent) (or 0 for a free price) representing how much to charge.", -110234a114672 -> "description": "Same as `unit_amount`, but accepts a decimal value in cents (or local equivalent) with at most 12 decimal places. Only one of `unit_amount` and `unit_amount_decimal` can be set.", -110247a114686 -> "description": "Quantity for the given price. Can be set only if the price's `usage_type` is `licensed` and not `metered`.", -110265c114704,114705 -< ] ---- -> ], -> "description": "A list of [Tax Rate](https://stripe.com/docs/api/tax_rates) ids. These Tax Rates will override the [`default_tax_rates`](https://stripe.com/docs/api/subscriptions/create#create_subscription-default_tax_rates) on the Subscription. When updating, pass an empty string to remove previously-defined tax rates." -110273a114714 -> "description": "Integer representing the multiplier applied to the price interval. For example, `iterations=2` applied to a price with `interval=month` and `interval_count=3` results in a phase of duration `2 * 3 months = 6 months`. If set, `end_date` must not be set.", -110279a114721 -> "description": "Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to a phase. Metadata on a schedule's phase will update the underlying subscription's `metadata` when the phase is entered, adding new keys and replacing existing keys in the subscription's `metadata`. Individual keys in the subscription's `metadata` can be unset by posting an empty value to them in the phase's `metadata`. To unset all keys in the subscription's `metadata`, update the subscription directly or unset every key individually from the phase's `metadata`.", -110282a114725 -> "description": "The account on behalf of which to charge, for each of the associated subscription's invoices.", -110285a114729 -> "description": "Whether the subscription schedule will create [prorations](https://stripe.com/docs/billing/subscriptions/prorations) when transitioning to this phase. The default value is `create_prorations`.", -110305c114749,114750 -< ] ---- -> ], -> "description": "The date at which this phase of the subscription schedule starts or `now`. Must be set on the first phase." -110307a114753 -> "description": "The data with which to automatically create a Transfer for each of the associated subscription's invoices.", -110309a114756 -> "description": "A non-negative decimal between 0 and 100, with at most two decimal places. This represents the percentage of the subscription invoice subtotal that will be transferred to the destination account. By default, the entire amount is transferred to the destination.", -110312a114760 -> "description": "ID of an existing, connected Stripe account.", -110322a114771 -> "description": "If set to true the entire phase is counted as a trial and the customer will not be charged for any fees.", -110337c114786,114787 -< ] ---- -> ], -> "description": "Sets the phase to trialing from the start date to this date. Must be before the phase end date, can not be combined with `trial`" -110562a115013 -> "description": "Minimum value to filter by (exclusive)", -110565a115017 -> "description": "Minimum value to filter by (inclusive)", -110568a115021 -> "description": "Maximum value to filter by (exclusive)", -110571a115025 -> "description": "Maximum value to filter by (inclusive)", -110594a115049 -> "description": "Minimum value to filter by (exclusive)", -110597a115053 -> "description": "Minimum value to filter by (inclusive)", -110600a115057 -> "description": "Maximum value to filter by (exclusive)", -110603a115061 -> "description": "Maximum value to filter by (inclusive)", -110626a115085 -> "description": "Minimum value to filter by (exclusive)", -110629a115089 -> "description": "Minimum value to filter by (inclusive)", -110632a115093 -> "description": "Maximum value to filter by (exclusive)", -110635a115097 -> "description": "Maximum value to filter by (inclusive)", -110696a115159,115169 -> "description": "The ID of the plan whose subscriptions will be retrieved.", -> "in": "query", -> "name": "plan", -> "required": false, -> "schema": { -> "maxLength": 5000, -> "type": "string" -> }, -> "style": "form" -> }, -> { -110887a115361 -> "description": "The ID of the price object.", -110891a115366 -> "description": "Data used to generate a new [Price](https://stripe.com/docs/api/prices) object inline.", -110893a115369 -> "description": "Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. Must be a [supported currency](https://stripe.com/docs/currencies).", -110896a115373 -> "description": "The ID of the product that this price will belong to.", -110900a115378 -> "description": "Specifies whether the price is considered inclusive of taxes or exclusive of taxes. One of `inclusive`, `exclusive`, or `unspecified`. Once specified as either `inclusive` or `exclusive`, it cannot be changed.", -110908a115387 -> "description": "A positive integer in cents (or local equivalent) (or 0 for a free price) representing how much to charge.", -110911a115391 -> "description": "Same as `unit_amount`, but accepts a decimal value in cents (or local equivalent) with at most 12 decimal places. Only one of `unit_amount` and `unit_amount_decimal` can be set.", -110923a115404 -> "description": "Quantity for this item. Defaults to 1.", -110941c115422,115423 -< ] ---- -> ], -> "description": "The tax rates which apply to the item. When set, the `default_tax_rates` do not apply to this item." -110945c115427,115430 -< "type": "object" ---- -> "type": "object", -> "x-stripeParam": { -> "class_name": "AddInvoiceItem" -> } -110956a115442 -> "description": "Enabled automatic tax calculation which will automatically compute tax rates on all invoices generated by the subscription.", -110981a115468 -> "description": "Monetary threshold that triggers the subscription to advance to a new billing period", -110984a115472 -> "description": "Indicates if the `billing_cycle_anchor` should be reset when a threshold is reached. If true, `billing_cycle_anchor` will be updated to the date/time the threshold was last reached; otherwise, the value will remain unchanged.", -111084a115573 -> "description": "Usage threshold that triggers the subscription to advance to a new billing period", -111100c115589,115590 -< ] ---- -> ], -> "description": "Define thresholds at which an invoice will be sent, and the subscription advanced to a new billing period. When updating, pass an empty string to remove previously-defined thresholds." -111105a115596 -> "description": "Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`.", -111107a115599,115603 -> "plan": { -> "description": "Plan ID for this item, as a string.", -> "maxLength": 5000, -> "type": "string" -> }, -111108a115605 -> "description": "The ID of the price object.", -111112a115610 -> "description": "Data used to generate a new [Price](https://stripe.com/docs/api/prices) object inline.", -111114a115613 -> "description": "Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. Must be a [supported currency](https://stripe.com/docs/currencies).", -111117a115617 -> "description": "The ID of the product that this price will belong to.", -111121a115622 -> "description": "The recurring components of a price such as `interval` and `interval_count`.", -111123a115625 -> "description": "Specifies billing frequency. Either `day`, `week`, `month` or `year`.", -111132a115635 -> "description": "The number of intervals between subscription billings. For example, `interval=month` and `interval_count=3` bills every 3 months. Maximum of one year interval allowed (1 year, 12 months, or 52 weeks).", -111142a115646 -> "description": "Specifies whether the price is considered inclusive of taxes or exclusive of taxes. One of `inclusive`, `exclusive`, or `unspecified`. Once specified as either `inclusive` or `exclusive`, it cannot be changed.", -111150a115655 -> "description": "A positive integer in cents (or local equivalent) (or 0 for a free price) representing how much to charge.", -111153a115659 -> "description": "Same as `unit_amount`, but accepts a decimal value in cents (or local equivalent) with at most 12 decimal places. Only one of `unit_amount` and `unit_amount_decimal` can be set.", -111166a115673 -> "description": "Quantity for this item.", -111184c115691,115692 -< ] ---- -> ], -> "description": "A list of [Tax Rate](https://stripe.com/docs/api/tax_rates) ids. These Tax Rates will override the [`default_tax_rates`](https://stripe.com/docs/api/subscriptions/create#create_subscription-default_tax_rates) on the Subscription. When updating, pass an empty string to remove previously-defined tax rates." -111240a115749 -> "description": "Payment-method-specific configuration to provide to invoices created by the subscription.", -111246a115756 -> "description": "Additional fields for Mandate creation", -111248a115759 -> "description": "Transaction type of the mandate.", -111259a115771 -> "description": "Verification method for the intent", -111278c115790,115791 -< ] ---- -> ], -> "description": "This sub-hash contains details about the Canadian pre-authorized debit payment method options to pass to the invoice’s PaymentIntent." -111284a115798 -> "description": "Preferred language of the Bancontact authorization page that the customer is redirected to.", -111303c115817,115818 -< ] ---- -> ], -> "description": "This sub-hash contains details about the Bancontact payment method options to pass to the invoice’s PaymentIntent." -111309a115825 -> "description": "Configuration options for setting up an eMandate for cards issued in India.", -111311a115828 -> "description": "Amount to be charged for future payments.", -111314a115832 -> "description": "One of `fixed` or `maximum`. If `fixed`, the `amount` param refers to the exact amount to be charged in future payments. If `maximum`, the amount charged can be up to the value passed for the `amount` param.", -111321a115840 -> "description": "A description of the mandate or subscription that is meant to be displayed to the customer.", -111329a115849 -> "description": "Selected network to process this Subscription on. Depends on the available networks of the card attached to the Subscription. Can be only set confirm-time.", -111346a115867 -> "description": "We strongly recommend that you rely on our SCA Engine to automatically prompt your customers for authentication based on risk level and [other requirements](https://stripe.com/docs/strong-customer-authentication). However, if you wish to request 3D Secure based on logic from your own fraud engine, provide this option. Read our guide on [manually requesting 3D Secure](https://stripe.com/docs/payments/3d-secure#manual-three-ds) for more information on how this configuration interacts with Radar and our SCA Engine.", -111363c115884,115885 -< ] ---- -> ], -> "description": "This sub-hash contains details about the Card payment method options to pass to the invoice’s PaymentIntent." -111369a115892 -> "description": "Configuration for the bank transfer funding type, if the `funding_type` is set to `bank_transfer`.", -111371a115895 -> "description": "Configuration for eu_bank_transfer funding type.", -111373a115898 -> "description": "The desired country code of the bank account information. Permitted values include: `DE`, `ES`, `FR`, `IE`, or `NL`.", -111384a115910 -> "description": "The bank transfer type that can be used for funding. Permitted values include: `eu_bank_transfer`, `gb_bank_transfer`, `jp_bank_transfer`, or `mx_bank_transfer`.", -111391a115918 -> "description": "The funding method type to be used when there are not enough funds in the customer balance. Permitted values include: `bank_transfer`.", -111404c115931,115932 -< ] ---- -> ], -> "description": "This sub-hash contains details about the Bank transfer payment method options to pass to the invoice’s PaymentIntent." -111419c115947,115948 -< ] ---- -> ], -> "description": "This sub-hash contains details about the Konbini payment method options to pass to the invoice’s PaymentIntent." -111425a115955 -> "description": "Additional fields for Financial Connections Session creation", -111427a115958 -> "description": "The list of permissions to request. If this parameter is passed, the `payment_method` permission must be included. Valid permissions include: `balances`, `ownership`, `payment_method`, and `transactions`.", -111445a115977 -> "description": "Verification method for the intent", -111464c115996,115997 -< ] ---- -> ], -> "description": "This sub-hash contains details about the ACH direct debit payment method options to pass to the invoice’s PaymentIntent." -111491a116025 -> "sepa_credit_transfer", -111508c116042,116043 -< ] ---- -> ], -> "description": "The list of payment method types (e.g. card) to provide to the invoice’s PaymentIntent. If not set, Stripe attempts to automatically determine the types to use by looking at the invoice’s default payment method, the subscription’s default payment method, the customer’s default payment method, and your [invoice template settings](https://dashboard.stripe.com/settings/billing/invoice)." -111510a116046 -> "description": "Either `off`, or `on_subscription`. With `on_subscription` Stripe updates `subscription.default_payment_method` when a subscription payment succeeds.", -111525a116062 -> "description": "Specifies invoicing frequency. Either `day`, `week`, `month` or `year`.", -111534a116072 -> "description": "The number of intervals between invoices. For example, `interval=month` and `interval_count=3` bills every 3 months. Maximum of one year interval allowed (1 year, 12 months, or 52 weeks).", -111570a116109 -> "description": "A non-negative decimal between 0 and 100, with at most two decimal places. This represents the percentage of the subscription invoice subtotal that will be transferred to the destination account. By default, the entire amount is transferred to the destination.", -111573a116113 -> "description": "ID of an existing, connected Stripe account.", -111746a116287 -> "next_page", -111996a116538 -> "description": "The ID of the price object.", -112000a116543 -> "description": "Data used to generate a new [Price](https://stripe.com/docs/api/prices) object inline.", -112002a116546 -> "description": "Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. Must be a [supported currency](https://stripe.com/docs/currencies).", -112005a116550 -> "description": "The ID of the product that this price will belong to.", -112009a116555 -> "description": "Specifies whether the price is considered inclusive of taxes or exclusive of taxes. One of `inclusive`, `exclusive`, or `unspecified`. Once specified as either `inclusive` or `exclusive`, it cannot be changed.", -112017a116564 -> "description": "A positive integer in cents (or local equivalent) (or 0 for a free price) representing how much to charge.", -112020a116568 -> "description": "Same as `unit_amount`, but accepts a decimal value in cents (or local equivalent) with at most 12 decimal places. Only one of `unit_amount` and `unit_amount_decimal` can be set.", -112032a116581 -> "description": "Quantity for this item. Defaults to 1.", -112050c116599,116600 -< ] ---- -> ], -> "description": "The tax rates which apply to the item. When set, the `default_tax_rates` do not apply to this item." -112054c116604,116607 -< "type": "object" ---- -> "type": "object", -> "x-stripeParam": { -> "class_name": "AddInvoiceItem" -> } -112065a116619 -> "description": "Enabled automatic tax calculation which will automatically compute tax rates on all invoices generated by the subscription.", -112089a116644 -> "description": "Monetary threshold that triggers the subscription to advance to a new billing period", -112092a116648 -> "description": "Indicates if the `billing_cycle_anchor` should be reset when a threshold is reached. If true, `billing_cycle_anchor` will be updated to the date/time the threshold was last reached; otherwise, the value will remain unchanged.", -112193a116750 -> "description": "Usage threshold that triggers the subscription to advance to a new billing period", -112209c116766,116767 -< ] ---- -> ], -> "description": "Define thresholds at which an invoice will be sent, and the subscription advanced to a new billing period. When updating, pass an empty string to remove previously-defined thresholds." -112211a116770 -> "description": "Delete all usage for a given subscription item. Allowed only when `deleted` is set to `true` and the current plan's `usage_type` is `metered`.", -112214a116774 -> "description": "A flag that, if set to `true`, will delete the specified item.", -112217a116778 -> "description": "Subscription item to update.", -112235c116796,116802 -< ] ---- -> ], -> "description": "Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`." -> }, -> "plan": { -> "description": "Plan ID for this item, as a string.", -> "maxLength": 5000, -> "type": "string" -112237a116805 -> "description": "The ID of the price object. When changing a subscription item's price, `quantity` is set to 1 unless a `quantity` parameter is provided.", -112241a116810 -> "description": "Data used to generate a new [Price](https://stripe.com/docs/api/prices) object inline.", -112243a116813 -> "description": "Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. Must be a [supported currency](https://stripe.com/docs/currencies).", -112246a116817 -> "description": "The ID of the product that this price will belong to.", -112250a116822 -> "description": "The recurring components of a price such as `interval` and `interval_count`.", -112252a116825 -> "description": "Specifies billing frequency. Either `day`, `week`, `month` or `year`.", -112261a116835 -> "description": "The number of intervals between subscription billings. For example, `interval=month` and `interval_count=3` bills every 3 months. Maximum of one year interval allowed (1 year, 12 months, or 52 weeks).", -112271a116846 -> "description": "Specifies whether the price is considered inclusive of taxes or exclusive of taxes. One of `inclusive`, `exclusive`, or `unspecified`. Once specified as either `inclusive` or `exclusive`, it cannot be changed.", -112279a116855 -> "description": "A positive integer in cents (or local equivalent) (or 0 for a free price) representing how much to charge.", -112282a116859 -> "description": "Same as `unit_amount`, but accepts a decimal value in cents (or local equivalent) with at most 12 decimal places. Only one of `unit_amount` and `unit_amount_decimal` can be set.", -112295a116873 -> "description": "Quantity for this item.", -112313c116891,116892 -< ] ---- -> ], -> "description": "A list of [Tax Rate](https://stripe.com/docs/api/tax_rates) ids. These Tax Rates will override the [`default_tax_rates`](https://stripe.com/docs/api/subscriptions/create#create_subscription-default_tax_rates) on the Subscription. When updating, pass an empty string to remove previously-defined tax rates." -112360a116940 -> "description": "The payment collection behavior for this subscription while paused. One of `keep_as_draft`, `mark_uncollectible`, or `void`.", -112368a116949 -> "description": "The time after which the subscription will resume collecting payments.", -112401a116983 -> "description": "Payment-method-specific configuration to provide to invoices created by the subscription.", -112407a116990 -> "description": "Additional fields for Mandate creation", -112409a116993 -> "description": "Transaction type of the mandate.", -112420a117005 -> "description": "Verification method for the intent", -112439c117024,117025 -< ] ---- -> ], -> "description": "This sub-hash contains details about the Canadian pre-authorized debit payment method options to pass to the invoice’s PaymentIntent." -112445a117032 -> "description": "Preferred language of the Bancontact authorization page that the customer is redirected to.", -112464c117051,117052 -< ] ---- -> ], -> "description": "This sub-hash contains details about the Bancontact payment method options to pass to the invoice’s PaymentIntent." -112470a117059 -> "description": "Configuration options for setting up an eMandate for cards issued in India.", -112472a117062 -> "description": "Amount to be charged for future payments.", -112475a117066 -> "description": "One of `fixed` or `maximum`. If `fixed`, the `amount` param refers to the exact amount to be charged in future payments. If `maximum`, the amount charged can be up to the value passed for the `amount` param.", -112482a117074 -> "description": "A description of the mandate or subscription that is meant to be displayed to the customer.", -112490a117083 -> "description": "Selected network to process this Subscription on. Depends on the available networks of the card attached to the Subscription. Can be only set confirm-time.", -112507a117101 -> "description": "We strongly recommend that you rely on our SCA Engine to automatically prompt your customers for authentication based on risk level and [other requirements](https://stripe.com/docs/strong-customer-authentication). However, if you wish to request 3D Secure based on logic from your own fraud engine, provide this option. Read our guide on [manually requesting 3D Secure](https://stripe.com/docs/payments/3d-secure#manual-three-ds) for more information on how this configuration interacts with Radar and our SCA Engine.", -112524c117118,117119 -< ] ---- -> ], -> "description": "This sub-hash contains details about the Card payment method options to pass to the invoice’s PaymentIntent." -112530a117126 -> "description": "Configuration for the bank transfer funding type, if the `funding_type` is set to `bank_transfer`.", -112532a117129 -> "description": "Configuration for eu_bank_transfer funding type.", -112534a117132 -> "description": "The desired country code of the bank account information. Permitted values include: `DE`, `ES`, `FR`, `IE`, or `NL`.", -112545a117144 -> "description": "The bank transfer type that can be used for funding. Permitted values include: `eu_bank_transfer`, `gb_bank_transfer`, `jp_bank_transfer`, or `mx_bank_transfer`.", -112552a117152 -> "description": "The funding method type to be used when there are not enough funds in the customer balance. Permitted values include: `bank_transfer`.", -112565c117165,117166 -< ] ---- -> ], -> "description": "This sub-hash contains details about the Bank transfer payment method options to pass to the invoice’s PaymentIntent." -112580c117181,117182 -< ] ---- -> ], -> "description": "This sub-hash contains details about the Konbini payment method options to pass to the invoice’s PaymentIntent." -112586a117189 -> "description": "Additional fields for Financial Connections Session creation", -112588a117192 -> "description": "The list of permissions to request. If this parameter is passed, the `payment_method` permission must be included. Valid permissions include: `balances`, `ownership`, `payment_method`, and `transactions`.", -112606a117211 -> "description": "Verification method for the intent", -112625c117230,117231 -< ] ---- -> ], -> "description": "This sub-hash contains details about the ACH direct debit payment method options to pass to the invoice’s PaymentIntent." -112652a117259 -> "sepa_credit_transfer", -112669c117276,117277 -< ] ---- -> ], -> "description": "The list of payment method types (e.g. card) to provide to the invoice’s PaymentIntent. If not set, Stripe attempts to automatically determine the types to use by looking at the invoice’s default payment method, the subscription’s default payment method, the customer’s default payment method, and your [invoice template settings](https://dashboard.stripe.com/settings/billing/invoice)." -112671a117280 -> "description": "Either `off`, or `on_subscription`. With `on_subscription` Stripe updates `subscription.default_payment_method` when a subscription payment succeeds.", -112686a117296 -> "description": "Specifies invoicing frequency. Either `day`, `week`, `month` or `year`.", -112695a117306 -> "description": "The number of intervals between invoices. For example, `interval=month` and `interval_count=3` bills every 3 months. Maximum of one year interval allowed (1 year, 12 months, or 52 weeks).", -112737a117349 -> "description": "A non-negative decimal between 0 and 100, with at most two decimal places. This represents the percentage of the subscription invoice subtotal that will be transferred to the destination account. By default, the entire amount is transferred to the destination.", -112740a117353 -> "description": "ID of an existing, connected Stripe account.", -113079a117693 -> "description": "Minimum value to filter by (exclusive)", -113082a117697 -> "description": "Minimum value to filter by (inclusive)", -113085a117701 -> "description": "Maximum value to filter by (exclusive)", -113088a117705 -> "description": "Maximum value to filter by (inclusive)", -113726c118343,118344 -< ] ---- -> ], -> "description": "A File ID representing an image you would like displayed on the reader." -113744a118363 -> "description": "Tipping configuration for AUD", -113746a118366 -> "description": "Fixed amounts displayed when collecting a tip", -113752a118373 -> "description": "Percentages displayed when collecting a tip", -113758a118380 -> "description": "Below this amount, fixed amounts will be displayed; above it, percentages will be displayed", -113765a118388 -> "description": "Tipping configuration for CAD", -113767a118391 -> "description": "Fixed amounts displayed when collecting a tip", -113773a118398 -> "description": "Percentages displayed when collecting a tip", -113779a118405 -> "description": "Below this amount, fixed amounts will be displayed; above it, percentages will be displayed", -113786a118413 -> "description": "Tipping configuration for CHF", -113788a118416 -> "description": "Fixed amounts displayed when collecting a tip", -113794a118423 -> "description": "Percentages displayed when collecting a tip", -113800a118430 -> "description": "Below this amount, fixed amounts will be displayed; above it, percentages will be displayed", -113807a118438 -> "description": "Tipping configuration for CZK", -113809a118441 -> "description": "Fixed amounts displayed when collecting a tip", -113815a118448 -> "description": "Percentages displayed when collecting a tip", -113821a118455 -> "description": "Below this amount, fixed amounts will be displayed; above it, percentages will be displayed", -113828a118463 -> "description": "Tipping configuration for DKK", -113830a118466 -> "description": "Fixed amounts displayed when collecting a tip", -113836a118473 -> "description": "Percentages displayed when collecting a tip", -113842a118480 -> "description": "Below this amount, fixed amounts will be displayed; above it, percentages will be displayed", -113849a118488 -> "description": "Tipping configuration for EUR", -113851a118491 -> "description": "Fixed amounts displayed when collecting a tip", -113857a118498 -> "description": "Percentages displayed when collecting a tip", -113863a118505 -> "description": "Below this amount, fixed amounts will be displayed; above it, percentages will be displayed", -113870a118513 -> "description": "Tipping configuration for GBP", -113872a118516 -> "description": "Fixed amounts displayed when collecting a tip", -113878a118523 -> "description": "Percentages displayed when collecting a tip", -113884a118530 -> "description": "Below this amount, fixed amounts will be displayed; above it, percentages will be displayed", -113891a118538 -> "description": "Tipping configuration for HKD", -113893a118541 -> "description": "Fixed amounts displayed when collecting a tip", -113899a118548 -> "description": "Percentages displayed when collecting a tip", -113905a118555 -> "description": "Below this amount, fixed amounts will be displayed; above it, percentages will be displayed", -113912a118563 -> "description": "Tipping configuration for MYR", -113914a118566 -> "description": "Fixed amounts displayed when collecting a tip", -113920a118573 -> "description": "Percentages displayed when collecting a tip", -113926a118580 -> "description": "Below this amount, fixed amounts will be displayed; above it, percentages will be displayed", -113933a118588 -> "description": "Tipping configuration for NOK", -113935a118591 -> "description": "Fixed amounts displayed when collecting a tip", -113941a118598 -> "description": "Percentages displayed when collecting a tip", -113947a118605 -> "description": "Below this amount, fixed amounts will be displayed; above it, percentages will be displayed", -113954a118613 -> "description": "Tipping configuration for NZD", -113956a118616 -> "description": "Fixed amounts displayed when collecting a tip", -113962a118623 -> "description": "Percentages displayed when collecting a tip", -113968a118630 -> "description": "Below this amount, fixed amounts will be displayed; above it, percentages will be displayed", -113975a118638 -> "description": "Tipping configuration for SEK", -113977a118641 -> "description": "Fixed amounts displayed when collecting a tip", -113983a118648 -> "description": "Percentages displayed when collecting a tip", -113989a118655 -> "description": "Below this amount, fixed amounts will be displayed; above it, percentages will be displayed", -113996a118663 -> "description": "Tipping configuration for SGD", -113998a118666 -> "description": "Fixed amounts displayed when collecting a tip", -114004a118673 -> "description": "Percentages displayed when collecting a tip", -114010a118680 -> "description": "Below this amount, fixed amounts will be displayed; above it, percentages will be displayed", -114017a118688 -> "description": "Tipping configuration for USD", -114019a118691 -> "description": "Fixed amounts displayed when collecting a tip", -114025a118698 -> "description": "Percentages displayed when collecting a tip", -114031a118705 -> "description": "Below this amount, fixed amounts will be displayed; above it, percentages will be displayed", -114065c118739,118740 -< ] ---- -> ], -> "description": "A File ID representing an image you would like displayed on the reader." -114281c118956,118957 -< ] ---- -> ], -> "description": "A File ID representing an image you would like displayed on the reader." -114308a118985 -> "description": "Tipping configuration for AUD", -114310a118988 -> "description": "Fixed amounts displayed when collecting a tip", -114316a118995 -> "description": "Percentages displayed when collecting a tip", -114322a119002 -> "description": "Below this amount, fixed amounts will be displayed; above it, percentages will be displayed", -114329a119010 -> "description": "Tipping configuration for CAD", -114331a119013 -> "description": "Fixed amounts displayed when collecting a tip", -114337a119020 -> "description": "Percentages displayed when collecting a tip", -114343a119027 -> "description": "Below this amount, fixed amounts will be displayed; above it, percentages will be displayed", -114350a119035 -> "description": "Tipping configuration for CHF", -114352a119038 -> "description": "Fixed amounts displayed when collecting a tip", -114358a119045 -> "description": "Percentages displayed when collecting a tip", -114364a119052 -> "description": "Below this amount, fixed amounts will be displayed; above it, percentages will be displayed", -114371a119060 -> "description": "Tipping configuration for CZK", -114373a119063 -> "description": "Fixed amounts displayed when collecting a tip", -114379a119070 -> "description": "Percentages displayed when collecting a tip", -114385a119077 -> "description": "Below this amount, fixed amounts will be displayed; above it, percentages will be displayed", -114392a119085 -> "description": "Tipping configuration for DKK", -114394a119088 -> "description": "Fixed amounts displayed when collecting a tip", -114400a119095 -> "description": "Percentages displayed when collecting a tip", -114406a119102 -> "description": "Below this amount, fixed amounts will be displayed; above it, percentages will be displayed", -114413a119110 -> "description": "Tipping configuration for EUR", -114415a119113 -> "description": "Fixed amounts displayed when collecting a tip", -114421a119120 -> "description": "Percentages displayed when collecting a tip", -114427a119127 -> "description": "Below this amount, fixed amounts will be displayed; above it, percentages will be displayed", -114434a119135 -> "description": "Tipping configuration for GBP", -114436a119138 -> "description": "Fixed amounts displayed when collecting a tip", -114442a119145 -> "description": "Percentages displayed when collecting a tip", -114448a119152 -> "description": "Below this amount, fixed amounts will be displayed; above it, percentages will be displayed", -114455a119160 -> "description": "Tipping configuration for HKD", -114457a119163 -> "description": "Fixed amounts displayed when collecting a tip", -114463a119170 -> "description": "Percentages displayed when collecting a tip", -114469a119177 -> "description": "Below this amount, fixed amounts will be displayed; above it, percentages will be displayed", -114476a119185 -> "description": "Tipping configuration for MYR", -114478a119188 -> "description": "Fixed amounts displayed when collecting a tip", -114484a119195 -> "description": "Percentages displayed when collecting a tip", -114490a119202 -> "description": "Below this amount, fixed amounts will be displayed; above it, percentages will be displayed", -114497a119210 -> "description": "Tipping configuration for NOK", -114499a119213 -> "description": "Fixed amounts displayed when collecting a tip", -114505a119220 -> "description": "Percentages displayed when collecting a tip", -114511a119227 -> "description": "Below this amount, fixed amounts will be displayed; above it, percentages will be displayed", -114518a119235 -> "description": "Tipping configuration for NZD", -114520a119238 -> "description": "Fixed amounts displayed when collecting a tip", -114526a119245 -> "description": "Percentages displayed when collecting a tip", -114532a119252 -> "description": "Below this amount, fixed amounts will be displayed; above it, percentages will be displayed", -114539a119260 -> "description": "Tipping configuration for SEK", -114541a119263 -> "description": "Fixed amounts displayed when collecting a tip", -114547a119270 -> "description": "Percentages displayed when collecting a tip", -114553a119277 -> "description": "Below this amount, fixed amounts will be displayed; above it, percentages will be displayed", -114560a119285 -> "description": "Tipping configuration for SGD", -114562a119288 -> "description": "Fixed amounts displayed when collecting a tip", -114568a119295 -> "description": "Percentages displayed when collecting a tip", -114574a119302 -> "description": "Below this amount, fixed amounts will be displayed; above it, percentages will be displayed", -114581a119310 -> "description": "Tipping configuration for USD", -114583a119313 -> "description": "Fixed amounts displayed when collecting a tip", -114589a119320 -> "description": "Percentages displayed when collecting a tip", -114595a119327 -> "description": "Below this amount, fixed amounts will be displayed; above it, percentages will be displayed", -114630c119362,119363 -< ] ---- -> ], -> "description": "A File ID representing an image you would like displayed on the reader." -114894a119628 -> "description": "City, district, suburb, town, or village.", -114898a119633 -> "description": "Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)).", -114902a119638 -> "description": "Address line 1 (e.g., street, PO Box, or company name).", -114906a119643 -> "description": "Address line 2 (e.g., apartment, suite, unit, or building).", -114910a119648 -> "description": "ZIP or postal code.", -114914a119653 -> "description": "State, county, province, or region.", -115158a119898 -> "description": "City, district, suburb, town, or village.", -115162a119903 -> "description": "Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)).", -115166a119908 -> "description": "Address line 1 (e.g., street, PO Box, or company name).", -115170a119913 -> "description": "Address line 2 (e.g., apartment, suite, unit, or building).", -115174a119918 -> "description": "ZIP or postal code.", -115178a119923 -> "description": "State, county, province, or region.", -115860a120606 -> "description": "Override showing a tipping selection screen on this transaction.", -115863a120610 -> "description": "Tipping configuration for this transaction.", -115865a120613 -> "description": "Amount used to calculate tip suggestions on tipping selection screen for this transaction. Must be a positive integer in the smallest currency unit (e.g., 100 cents to represent $1.00 or 100 to represent ¥100, a zero-decimal currency).", -116025a120774 -> "description": "Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. Must be a [supported currency](https://stripe.com/docs/currencies).", -116028a120778 -> "description": "Array of line items that were purchased.", -116031a120782 -> "description": "The price of the item in cents.", -116034a120786 -> "description": "The description or name of the item.", -116038a120791 -> "description": "The quantity of the line item being purchased.", -116052a120806 -> "description": "The amount of tax in cents.", -116055a120810 -> "description": "Total balance of cart due in cents.", -116569a121325 -> "description": "Card Number", -117053a121810 -> "description": "Reason for the failure.", -117417a122175 -> "description": "The return code to be set on the OutboundPayment object.", -117644a122403 -> "description": "Reason for the return.", -117742a122502 -> "description": "The source type.", -117748a122509 -> "description": "Optional fields for `us_bank_account`.", -117750a122512 -> "description": "The bank account holder's name.", -117754a122517 -> "description": "The bank account number.", -117758a122522 -> "description": "The bank account's routing number.", -117866a122631 -> "description": "The source type.", -117872a122638 -> "description": "Optional fields for `us_bank_account`.", -117874a122641 -> "description": "The bank account holder's name.", -117878a122646 -> "description": "The bank account number.", -117882a122651 -> "description": "The bank account's routing number.", -117984a122754 -> "description": "The business type.", -117994a122765 -> "description": "Information about the company or business.", -117996a122768 -> "description": "The company's primary address.", -117998a122771 -> "description": "City, district, suburb, town, or village.", -118002a122776 -> "description": "Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)).", -118006a122781 -> "description": "Address line 1 (e.g., street, PO Box, or company name).", -118010a122786 -> "description": "Address line 2 (e.g., apartment, suite, unit, or building).", -118014a122791 -> "description": "ZIP or postal code.", -118018a122796 -> "description": "State, county, province, or region.", -118026a122805 -> "description": "The Kana variation of the company's primary address (Japan only).", -118028a122808 -> "description": "City or ward.", -118032a122813 -> "description": "Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)).", -118036a122818 -> "description": "Block or building number.", -118040a122823 -> "description": "Building details.", -118044a122828 -> "description": "Postal code.", -118048a122833 -> "description": "Prefecture.", -118052a122838 -> "description": "Town or cho-me.", -118060a122847 -> "description": "The Kanji variation of the company's primary address (Japan only).", -118062a122850 -> "description": "City or ward.", -118066a122855 -> "description": "Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)).", -118070a122860 -> "description": "Block or building number.", -118074a122865 -> "description": "Building details.", -118078a122870 -> "description": "Postal code.", -118082a122875 -> "description": "Prefecture.", -118086a122880 -> "description": "Town or cho-me.", -118094a122889 -> "description": "Whether the company's directors have been provided. Set this Boolean to `true` after creating all the company's directors with [the Persons API](https://stripe.com/docs/api/persons) for accounts with a `relationship.director` requirement. This value is not automatically set to `true` after creating directors, so it needs to be updated to indicate all directors have been provided.", -118097a122893 -> "description": "Whether the company's executives have been provided. Set this Boolean to `true` after creating all the company's executives with [the Persons API](https://stripe.com/docs/api/persons) for accounts with a `relationship.executive` requirement.", -118100a122897 -> "description": "The company's legal name.", -118104a122902 -> "description": "The Kana variation of the company's legal name (Japan only).", -118108a122907 -> "description": "The Kanji variation of the company's legal name (Japan only).", -118112a122912 -> "description": "Whether the company's owners have been provided. Set this Boolean to `true` after creating all the company's owners with [the Persons API](https://stripe.com/docs/api/persons) for accounts with a `relationship.owner` requirement.", -118115a122916 -> "description": "This hash is used to attest that the beneficial owner information provided to Stripe is both current and correct.", -118117a122919 -> "description": "The Unix timestamp marking when the beneficial owner attestation was made.", -118121a122924 -> "description": "The IP address from which the beneficial owner attestation was made.", -118124a122928 -> "description": "The user agent of the browser from which the beneficial owner attestation was made.", -118132a122937 -> "description": "Whether the user described by the data in the token has been shown the Ownership Declaration and indicated that it is correct.", -118135a122941 -> "description": "The company's phone number (used for verification).", -118139a122946 -> "description": "The identification number given to a company when it is registered or incorporated, if distinct from the identification number used for filing taxes. (Examples are the CIN for companies and LLP IN for partnerships in India, and the Company Registration Number in Hong Kong).", -118143a122951 -> "description": "The category identifying the legal structure of the company or legal entity. See [Business structure](https://stripe.com/docs/connect/identity-verification#business-structure) for more details.", -118170a122979 -> "description": "The business ID number of the company, as appropriate for the company’s country. (Examples are an Employer ID Number in the U.S., a Business Number in Canada, or a Company Number in the UK.)", -118174a122984 -> "description": "The jurisdiction in which the `tax_id` is registered (Germany-based companies only).", -118178a122989 -> "description": "The VAT number of the company.", -118182a122994 -> "description": "Information on the verification state of the company.", -118184a122997 -> "description": "A document verifying the business.", -118186a123000 -> "description": "The back of a document returned by a [file upload](https://stripe.com/docs/api#create_file) with a `purpose` value of `additional_verification`. The uploaded file needs to be a color image (smaller than 8,000px by 8,000px), in JPG, PNG, or PDF format, and less than 10 MB in size.", -118190a123005 -> "description": "The front of a document returned by a [file upload](https://stripe.com/docs/api#create_file) with a `purpose` value of `additional_verification`. The uploaded file needs to be a color image (smaller than 8,000px by 8,000px), in JPG, PNG, or PDF format, and less than 10 MB in size.", -118206a123022 -> "description": "Information about the person represented by the account.", -118208a123025 -> "description": "The individual's primary address.", -118210a123028 -> "description": "City, district, suburb, town, or village.", -118214a123033 -> "description": "Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)).", -118218a123038 -> "description": "Address line 1 (e.g., street, PO Box, or company name).", -118222a123043 -> "description": "Address line 2 (e.g., apartment, suite, unit, or building).", -118226a123048 -> "description": "ZIP or postal code.", -118230a123053 -> "description": "State, county, province, or region.", -118238a123062 -> "description": "The Kana variation of the the individual's primary address (Japan only).", -118240a123065 -> "description": "City or ward.", -118244a123070 -> "description": "Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)).", -118248a123075 -> "description": "Block or building number.", -118252a123080 -> "description": "Building details.", -118256a123085 -> "description": "Postal code.", -118260a123090 -> "description": "Prefecture.", -118264a123095 -> "description": "Town or cho-me.", -118272a123104 -> "description": "The Kanji variation of the the individual's primary address (Japan only).", -118274a123107 -> "description": "City or ward.", -118278a123112 -> "description": "Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)).", -118282a123117 -> "description": "Block or building number.", -118286a123122 -> "description": "Building details.", -118290a123127 -> "description": "Postal code.", -118294a123132 -> "description": "Prefecture.", -118298a123137 -> "description": "Town or cho-me.", -118310a123150 -> "description": "The day of birth, between 1 and 31.", -118313a123154 -> "description": "The month of birth, between 1 and 12.", -118316a123158 -> "description": "The four-digit year of birth.", -118334c123176,123177 -< ] ---- -> ], -> "description": "The individual's date of birth." -118336a123180 -> "description": "The individual's email address.", -118339a123184 -> "description": "The individual's first name.", -118343a123189 -> "description": "The Kana variation of the the individual's first name (Japan only).", -118347a123194 -> "description": "The Kanji variation of the individual's first name (Japan only).", -118366c123213,123214 -< ] ---- -> ], -> "description": "A list of alternate names or aliases that the individual is known by." -118368a123217 -> "description": "The individual's gender (International regulations require either \"male\" or \"female\").", -118371a123221 -> "description": "The government-issued ID number of the individual, as appropriate for the representative’s country. (Examples are a Social Security Number in the U.S., or a Social Insurance Number in Canada). Instead of the number itself, you can also provide a [PII token created with Stripe.js](https://stripe.com/docs/js/tokens_sources/create_token?type=pii).", -118375a123226 -> "description": "The government-issued secondary ID number of the individual, as appropriate for the representative's country, will be used for enhanced verification checks. In Thailand, this would be the laser code found on the back of an ID card. Instead of the number itself, you can also provide a [PII token created with Stripe.js](https://stripe.com/docs/js/tokens_sources/create_token?type=pii).", -118379a123231 -> "description": "The individual's last name.", -118383a123236 -> "description": "The Kana variation of the individual's last name (Japan only).", -118387a123241 -> "description": "The Kanji variation of the individual's last name (Japan only).", -118391a123246 -> "description": "The individual's maiden name.", -118409c123264,123265 -< ] ---- -> ], -> "description": "Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`." -118411a123268 -> "description": "The individual's phone number.", -118414a123272 -> "description": "Indicates if the person or any of their representatives, family members, or other closely related persons, declares that they hold or have held an important public job or function, in any jurisdiction.", -118421a123280 -> "description": "The individual's registered address.", -118423a123283 -> "description": "City, district, suburb, town, or village.", -118427a123288 -> "description": "Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)).", -118431a123293 -> "description": "Address line 1 (e.g., street, PO Box, or company name).", -118435a123298 -> "description": "Address line 2 (e.g., apartment, suite, unit, or building).", -118439a123303 -> "description": "ZIP or postal code.", -118443a123308 -> "description": "State, county, province, or region.", -118451a123317 -> "description": "The last four digits of the individual's Social Security Number (U.S. only).", -118455a123322 -> "description": "The individual's verification document information.", -118457a123325 -> "description": "A document showing address, either a passport, local ID card, or utility bill from a well-known utility company.", -118459a123328 -> "description": "The back of an ID returned by a [file upload](https://stripe.com/docs/api#create_file) with a `purpose` value of `identity_document`. The uploaded file needs to be a color image (smaller than 8,000px by 8,000px), in JPG, PNG, or PDF format, and less than 10 MB in size.", -118463a123333 -> "description": "The front of an ID returned by a [file upload](https://stripe.com/docs/api#create_file) with a `purpose` value of `identity_document`. The uploaded file needs to be a color image (smaller than 8,000px by 8,000px), in JPG, PNG, or PDF format, and less than 10 MB in size.", -118471a123342 -> "description": "An identifying document, either a passport or local ID card.", -118473a123345 -> "description": "The back of an ID returned by a [file upload](https://stripe.com/docs/api#create_file) with a `purpose` value of `identity_document`. The uploaded file needs to be a color image (smaller than 8,000px by 8,000px), in JPG, PNG, or PDF format, and less than 10 MB in size.", -118477a123350 -> "description": "The front of an ID returned by a [file upload](https://stripe.com/docs/api#create_file) with a `purpose` value of `identity_document`. The uploaded file needs to be a color image (smaller than 8,000px by 8,000px), in JPG, PNG, or PDF format, and less than 10 MB in size.", -118493a123367 -> "description": "Whether the user described by the data in the token has been shown [the Stripe Connected Account Agreement](https://stripe.com/docs/connect/account-tokens#stripe-connected-account-agreement). When creating an account token to create a new Connect account, this value must be `true`.", -118503a123378 -> "description": "The name of the person or business that owns the bank account.This field is required when attaching the bank account to a `Customer` object.", -118507a123383 -> "description": "The type of entity that holds the account. It can be `company` or `individual`. This field is required when attaching the bank account to a `Customer` object.", -118515a123392 -> "description": "The account number for the bank account, in string form. Must be a checking account.", -118519a123397 -> "description": "The bank account type. This can only be `checking` or `savings` in most countries. In Japan, this can only be `futsu` or `toza`.", -118529a123408 -> "description": "The country in which the bank account is located.", -118533a123413 -> "description": "The currency the bank account is in. This must be a country/currency pairing that [Stripe supports.](https://stripe.com/docs/payouts)", -118536a123417 -> "description": "The routing number, sort code, or other country-appropriateinstitution number for the bank account. For US bank accounts, this is required and should bethe ACH routing number, not the wire routing number. If you are providing an IBAN for`account_number`, this field is not required.", -118608c123489,123492 -< "type": "object" ---- -> "type": "object", -> "x-stripeParam": { -> "class_name": "Card" -> } -118625a123510 -> "description": "The CVC value, in string form.", -118647a123533 -> "description": "The person's address.", -118649a123536 -> "description": "City, district, suburb, town, or village.", -118653a123541 -> "description": "Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)).", -118657a123546 -> "description": "Address line 1 (e.g., street, PO Box, or company name).", -118661a123551 -> "description": "Address line 2 (e.g., apartment, suite, unit, or building).", -118665a123556 -> "description": "ZIP or postal code.", -118669a123561 -> "description": "State, county, province, or region.", -118677a123570 -> "description": "The Kana variation of the person's address (Japan only).", -118679a123573 -> "description": "City or ward.", -118683a123578 -> "description": "Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)).", -118687a123583 -> "description": "Block or building number.", -118691a123588 -> "description": "Building details.", -118695a123593 -> "description": "Postal code.", -118699a123598 -> "description": "Prefecture.", -118703a123603 -> "description": "Town or cho-me.", -118711a123612 -> "description": "The Kanji variation of the person's address (Japan only).", -118713a123615 -> "description": "City or ward.", -118717a123620 -> "description": "Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)).", -118721a123625 -> "description": "Block or building number.", -118725a123630 -> "description": "Building details.", -118729a123635 -> "description": "Postal code.", -118733a123640 -> "description": "Prefecture.", -118737a123645 -> "description": "Town or cho-me.", -118749a123658 -> "description": "The day of birth, between 1 and 31.", -118752a123662 -> "description": "The month of birth, between 1 and 12.", -118755a123666 -> "description": "The four-digit year of birth.", -118773c123684,123685 -< ] ---- -> ], -> "description": "The person's date of birth." -118775a123688 -> "description": "Documents that may be submitted to satisfy various informational requests.", -118777a123691 -> "description": "One or more documents that demonstrate proof that this person is authorized to represent the company.", -118779a123694 -> "description": "One or more document ids returned by a [file upload](https://stripe.com/docs/api#create_file) with a `purpose` value of `account_requirement`.", -118790a123706 -> "description": "One or more documents showing the person's passport page with photo and personal data.", -118792a123709 -> "description": "One or more document ids returned by a [file upload](https://stripe.com/docs/api#create_file) with a `purpose` value of `account_requirement`.", -118803a123721 -> "description": "One or more documents showing the person's visa required for living in the country where they are residing.", -118805a123724 -> "description": "One or more document ids returned by a [file upload](https://stripe.com/docs/api#create_file) with a `purpose` value of `account_requirement`.", -118820a123740 -> "description": "The person's email address.", -118823a123744 -> "description": "The person's first name.", -118827a123749 -> "description": "The Kana variation of the person's first name (Japan only).", -118831a123754 -> "description": "The Kanji variation of the person's first name (Japan only).", -118850c123773,123774 -< ] ---- -> ], -> "description": "A list of alternate names or aliases that the person is known by." -118852a123777 -> "description": "The person's gender (International regulations require either \"male\" or \"female\").", -118855a123781 -> "description": "The person's ID number, as appropriate for their country. For example, a social security number in the U.S., social insurance number in Canada, etc. Instead of the number itself, you can also provide a [PII token provided by Stripe.js](https://stripe.com/docs/js/tokens_sources/create_token?type=pii).", -118859a123786 -> "description": "The person's secondary ID number, as appropriate for their country, will be used for enhanced verification checks. In Thailand, this would be the laser code found on the back of an ID card. Instead of the number itself, you can also provide a [PII token provided by Stripe.js](https://stripe.com/docs/js/tokens_sources/create_token?type=pii).", -118863a123791 -> "description": "The person's last name.", -118867a123796 -> "description": "The Kana variation of the person's last name (Japan only).", -118871a123801 -> "description": "The Kanji variation of the person's last name (Japan only).", -118875a123806 -> "description": "The person's maiden name.", -118893c123824,123825 -< ] ---- -> ], -> "description": "Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`." -118895a123828 -> "description": "The country where the person is a national. Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)), or \"XX\" if unavailable.", -118899a123833 -> "description": "The person's phone number.", -118902a123837 -> "description": "Indicates if the person or any of their representatives, family members, or other closely related persons, declares that they hold or have held an important public job or function, in any jurisdiction.", -118906a123842 -> "description": "The person's registered address.", -118908a123845 -> "description": "City, district, suburb, town, or village.", -118912a123850 -> "description": "Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)).", -118916a123855 -> "description": "Address line 1 (e.g., street, PO Box, or company name).", -118920a123860 -> "description": "Address line 2 (e.g., apartment, suite, unit, or building).", -118924a123865 -> "description": "ZIP or postal code.", -118928a123870 -> "description": "State, county, province, or region.", -118936a123879 -> "description": "The relationship that this person has with the account's legal entity.", -118938a123882 -> "description": "Whether the person is a director of the account's legal entity. Directors are typically members of the governing board of the company, or responsible for ensuring the company meets its regulatory obligations.", -118941a123886 -> "description": "Whether the person has significant responsibility to control, manage, or direct the organization.", -118944a123890 -> "description": "Whether the person is an owner of the account’s legal entity.", -118958c123904,123905 -< ] ---- -> ], -> "description": "The percent owned by the person of the account's legal entity." -118960a123908 -> "description": "Whether the person is authorized as the primary representative of the account. This is the person nominated by the business to provide information about themselves, and general information about the account. There can only be one representative at any given time. At the time the account is created, this person should be set to the person responsible for opening the account.", -118963a123912 -> "description": "The person's title (e.g., CEO, Support Engineer).", -118971a123921 -> "description": "The last four digits of the person's Social Security number (U.S. only).", -118974a123925 -> "description": "The person's verification status.", -118976a123928 -> "description": "A document showing address, either a passport, local ID card, or utility bill from a well-known utility company.", -118978a123931 -> "description": "The back of an ID returned by a [file upload](https://stripe.com/docs/api#create_file) with a `purpose` value of `identity_document`. The uploaded file needs to be a color image (smaller than 8,000px by 8,000px), in JPG, PNG, or PDF format, and less than 10 MB in size.", -118982a123936 -> "description": "The front of an ID returned by a [file upload](https://stripe.com/docs/api#create_file) with a `purpose` value of `identity_document`. The uploaded file needs to be a color image (smaller than 8,000px by 8,000px), in JPG, PNG, or PDF format, and less than 10 MB in size.", -118990a123945 -> "description": "An identifying document, either a passport or local ID card.", -118992a123948 -> "description": "The back of an ID returned by a [file upload](https://stripe.com/docs/api#create_file) with a `purpose` value of `identity_document`. The uploaded file needs to be a color image (smaller than 8,000px by 8,000px), in JPG, PNG, or PDF format, and less than 10 MB in size.", -118996a123953 -> "description": "The front of an ID returned by a [file upload](https://stripe.com/docs/api#create_file) with a `purpose` value of `identity_document`. The uploaded file needs to be a color image (smaller than 8,000px by 8,000px), in JPG, PNG, or PDF format, and less than 10 MB in size.", -119015a123973 -> "description": "The `id_number` for the PII, in string form.", -119137a124096 -> "description": "Minimum value to filter by (exclusive)", -119140a124100 -> "description": "Minimum value to filter by (inclusive)", -119143a124104 -> "description": "Maximum value to filter by (exclusive)", -119146a124108 -> "description": "Maximum value to filter by (inclusive)", -119170a124133 -> "description": "Minimum value to filter by (exclusive)", -119173a124137 -> "description": "Minimum value to filter by (inclusive)", -119176a124141 -> "description": "Maximum value to filter by (exclusive)", -119179a124145 -> "description": "Maximum value to filter by (inclusive)", -119676a124643 -> "description": "Minimum value to filter by (exclusive)", -119679a124647 -> "description": "Minimum value to filter by (inclusive)", -119682a124651 -> "description": "Maximum value to filter by (exclusive)", -119685a124655 -> "description": "Maximum value to filter by (inclusive)", -121147a126118 -> "description": "Minimum value to filter by (exclusive)", -121150a126122 -> "description": "Minimum value to filter by (inclusive)", -121153a126126 -> "description": "Maximum value to filter by (exclusive)", -121156a126130 -> "description": "Maximum value to filter by (inclusive)", -121332a126307 -> "description": "Encodes the FinancialAccount's ability to be used with the Issuing product, including attaching cards to and drawing funds from the FinancialAccount.", -121334a126310 -> "description": "Whether the FinancialAccount should have the Feature.", -121344a126321 -> "description": "Represents whether this FinancialAccount is eligible for deposit insurance. Various factors determine the insurance amount.", -121346a126324 -> "description": "Whether the FinancialAccount should have the Feature.", -121356a126335 -> "description": "Contains Features that add FinancialAddresses to the FinancialAccount.", -121358a126338 -> "description": "Adds an ABA FinancialAddress to the FinancialAccount.", -121360a126341 -> "description": "Whether the FinancialAccount should have the Feature.", -121374a126356 -> "description": "Contains settings related to adding funds to a FinancialAccount from another Account with the same owner.", -121376a126359 -> "description": "Enables ACH Debits via the InboundTransfers API.", -121378a126362 -> "description": "Whether the FinancialAccount should have the Feature.", -121392a126377 -> "description": "Represents the ability for the FinancialAccount to send money to, or receive money from other FinancialAccounts (for example, via OutboundPayment).", -121394a126380 -> "description": "Whether the FinancialAccount should have the Feature.", -121404a126391 -> "description": "Includes Features related to initiating money movement out of the FinancialAccount to someone else's bucket of money.", -121406a126394 -> "description": "Enables ACH transfers via the OutboundPayments API.", -121408a126397 -> "description": "Whether the FinancialAccount should have the Feature.", -121418a126408 -> "description": "Enables US domestic wire tranfers via the OutboundPayments API.", -121420a126411 -> "description": "Whether the FinancialAccount should have the Feature.", -121434a126426 -> "description": "Contains a Feature and settings related to moving money out of the FinancialAccount into another Account with the same owner.", -121436a126429 -> "description": "Enables ACH transfers via the OutboundTransfers API.", -121438a126432 -> "description": "Whether the FinancialAccount should have the Feature.", -121448a126443 -> "description": "Enables US domestic wire tranfers via the OutboundTransfers API.", -121450a126446 -> "description": "Whether the FinancialAccount should have the Feature.", -121478a126475 -> "description": "Restricts all inbound money movement.", -121485a126483 -> "description": "Restricts all outbound money movement.", -121655a126654 -> "description": "Encodes the FinancialAccount's ability to be used with the Issuing product, including attaching cards to and drawing funds from the FinancialAccount.", -121657a126657 -> "description": "Whether the FinancialAccount should have the Feature.", -121667a126668 -> "description": "Represents whether this FinancialAccount is eligible for deposit insurance. Various factors determine the insurance amount.", -121669a126671 -> "description": "Whether the FinancialAccount should have the Feature.", -121679a126682 -> "description": "Contains Features that add FinancialAddresses to the FinancialAccount.", -121681a126685 -> "description": "Adds an ABA FinancialAddress to the FinancialAccount.", -121683a126688 -> "description": "Whether the FinancialAccount should have the Feature.", -121697a126703 -> "description": "Contains settings related to adding funds to a FinancialAccount from another Account with the same owner.", -121699a126706 -> "description": "Enables ACH Debits via the InboundTransfers API.", -121701a126709 -> "description": "Whether the FinancialAccount should have the Feature.", -121715a126724 -> "description": "Represents the ability for the FinancialAccount to send money to, or receive money from other FinancialAccounts (for example, via OutboundPayment).", -121717a126727 -> "description": "Whether the FinancialAccount should have the Feature.", -121727a126738 -> "description": "Includes Features related to initiating money movement out of the FinancialAccount to someone else's bucket of money.", -121729a126741 -> "description": "Enables ACH transfers via the OutboundPayments API.", -121731a126744 -> "description": "Whether the FinancialAccount should have the Feature.", -121741a126755 -> "description": "Enables US domestic wire tranfers via the OutboundPayments API.", -121743a126758 -> "description": "Whether the FinancialAccount should have the Feature.", -121757a126773 -> "description": "Contains a Feature and settings related to moving money out of the FinancialAccount into another Account with the same owner.", -121759a126776 -> "description": "Enables ACH transfers via the OutboundTransfers API.", -121761a126779 -> "description": "Whether the FinancialAccount should have the Feature.", -121771a126790 -> "description": "Enables US domestic wire tranfers via the OutboundTransfers API.", -121773a126793 -> "description": "Whether the FinancialAccount should have the Feature.", -121801a126822 -> "description": "Restricts all inbound money movement.", -121808a126830 -> "description": "Restricts all outbound money movement.", -121975a126998 -> "description": "Whether the FinancialAccount should have the Feature.", -121988a127012 -> "description": "Whether the FinancialAccount should have the Feature.", -122009a127034 -> "description": "Adds an ABA FinancialAddress to the FinancialAccount.", -122011a127037 -> "description": "Whether the FinancialAccount should have the Feature.", -122028a127055 -> "description": "Enables ACH Debits via the InboundTransfers API.", -122030a127058 -> "description": "Whether the FinancialAccount should have the Feature.", -122047a127076 -> "description": "Whether the FinancialAccount should have the Feature.", -122060a127090 -> "description": "Enables ACH transfers via the OutboundPayments API.", -122062a127093 -> "description": "Whether the FinancialAccount should have the Feature.", -122072a127104 -> "description": "Enables US domestic wire tranfers via the OutboundPayments API.", -122074a127107 -> "description": "Whether the FinancialAccount should have the Feature.", -122091a127125 -> "description": "Enables ACH transfers via the OutboundTransfers API.", -122093a127128 -> "description": "Whether the FinancialAccount should have the Feature.", -122103a127139 -> "description": "Enables US domestic wire tranfers via the OutboundTransfers API.", -122105a127142 -> "description": "Whether the FinancialAccount should have the Feature.", -122755a127793 -> "description": "Billing information associated with the PaymentMethod that may be used or required by particular types of payment methods.", -122761a127800 -> "description": "City, district, suburb, town, or village.", -122765a127805 -> "description": "Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)).", -122769a127810 -> "description": "Address line 1 (e.g., street, PO Box, or company name).", -122773a127815 -> "description": "Address line 2 (e.g., apartment, suite, unit, or building).", -122777a127820 -> "description": "ZIP or postal code.", -122781a127825 -> "description": "State, county, province, or region.", -122795c127839,127840 -< ] ---- -> ], -> "description": "Billing address." -122808c127853,127854 -< ] ---- -> ], -> "description": "Email address." -122810a127857 -> "description": "Full name.", -122814a127862 -> "description": "Billing phone number (including extension).", -122822a127871 -> "description": "Required if type is set to `financial_account`. The FinancialAccount ID to send funds to.", -122828a127878 -> "description": "Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`.", -122831a127882 -> "description": "The type of the PaymentMethod. An additional hash is included on the PaymentMethod with a name matching this value. It contains additional information specific to the PaymentMethod type.", -122838a127890 -> "description": "Required hash if type is set to `us_bank_account`.", -122840a127893 -> "description": "Account holder type: individual or company.", -122847a127901 -> "description": "Account number of the bank account.", -122851a127906 -> "description": "Account type: checkings or savings. Defaults to checking if omitted.", -122858a127914 -> "description": "The ID of a Financial Connections Account to use as a payment method.", -122862a127919 -> "description": "Routing number of the bank account.", -122884a127942 -> "description": "The US bank account network that must be used for this OutboundPayment. If not set, we will default to the PaymentMethod's preferred network.", -122901c127959,127960 -< ] ---- -> ], -> "description": "Optional fields for `us_bank_account`." -122910a127970 -> "description": "IP address of the user initiating the OutboundPayment. Must be supplied if `present` is set to `true`.", -122913a127974 -> "description": "`True` if the OutboundPayment creation request is being made on behalf of an end user by a platform. Otherwise, `false`.", -123318a128380 -> "description": "Designate the OutboundTransfer as using a US bank account network configuration.", -123335c128397,128398 -< ] ---- -> ], -> "description": "Optional fields for `us_bank_account`." -123595a128659 -> "description": "The source flow type.", -124015a129080 -> "description": "Minimum value to filter by (exclusive)", -124018a129084 -> "description": "Minimum value to filter by (inclusive)", -124021a129088 -> "description": "Maximum value to filter by (exclusive)", -124024a129092 -> "description": "Maximum value to filter by (inclusive)", -124047a129116 -> "description": "Minimum value to filter by (exclusive)", -124050a129120 -> "description": "Minimum value to filter by (inclusive)", -124053a129124 -> "description": "Maximum value to filter by (exclusive)", -124056a129128 -> "description": "Maximum value to filter by (inclusive)", -124309a129382 -> "description": "Minimum value to filter by (exclusive)", -124312a129386 -> "description": "Minimum value to filter by (inclusive)", -124315a129390 -> "description": "Maximum value to filter by (exclusive)", -124318a129394 -> "description": "Maximum value to filter by (inclusive)", -124431a129508 -> "description": "Minimum value to filter by (exclusive)", -124434a129512 -> "description": "Minimum value to filter by (inclusive)", -124437a129516 -> "description": "Maximum value to filter by (exclusive)", -124440a129520 -> "description": "Maximum value to filter by (inclusive)", -124450c129530,129531 -< ] ---- -> ], -> "description": "Returns Transactions with `posted_at` within the specified range." diff --git a/out.log b/out.log deleted file mode 100644 index 3ee3b9f8c..000000000 --- a/out.log +++ /dev/null @@ -1,236 +0,0 @@ -[cargo-make] INFO - cargo make 0.35.0 -[cargo-make] INFO - Project: async-stripe -[cargo-make] INFO - Build File: Makefile.toml -[cargo-make] INFO - Task: openapi-install -[cargo-make] INFO - Profile: development -[cargo-make] INFO - Running Task: legacy-migration -[cargo-make] INFO - Execute Command: "rm" "-rf" "spec3.sdk.json" "out" -[cargo-make] INFO - Execute Command: "cargo" "run" "spec3.sdk.json" "--fetch" "current" -2023-03-06T20:20:30.089552Z  INFO stripe_openapi_codegen: generating code for spec3.sdk.json to out -2023-03-06T20:20:30.107468Z  INFO stripe_openapi_codegen::spec_fetch: Fetching OpenAPI spec version v223 -2023-03-06T20:20:34.462535Z  INFO stripe_openapi_codegen::spec_fetch: Wrote OpenAPI spec to spec3.sdk.json -2023-03-06T20:20:34.870998Z  INFO stripe_openapi_codegen: Finished parsing spec - flattenedAPISections: {"intro":{"title":"Introduction","group_title":"Topics","group_anchor":"topics","anchor":"intro","section_anchor":"intro","subsection_anchors":[],"path":"/","gate":false,"display_on_load":true,"data":{"merchant":false,"test_key":"sk_test_4eC39HqLyjWDarjtT1zdp7dc","user_email":null,"login_as":null,"section_type":"override","section_tag":"intro","version":null}},"authentication":{"title":"Authentication","group_title":"Topics","group_anchor":"topics","anchor":"authentication","section_anchor":"authentication","subsection_anchors":[],"path":"/authentication","gate":false,"display_on_load":true,"data":{"example_explicit_api_key":"","merchant":false,"request":"curl https://api.stripe.com/v1/charges \\\n -u sk_test_4eC39HqLyjWDarjtT1zdp7dc:\n# The colon prevents curl from asking for a password.","test_key":"sk_test_4eC39HqLyjWDarjtT1zdp7dc","section_type":"override","section_tag":"authentication","version":null}},"connected_accounts":{"title":"Connected Accounts","group_title":"Topics","group_anchor":"topics","anchor":"connected_accounts","section_anchor":"connected_accounts","subsection_anchors":[],"path":"/connected_accounts","gate":false,"display_on_load":true,"data":{"example_explicit_account":"curl https://api.stripe.com/v1/charges/ch_3Mik892eZvKYlo2C1PpFTUfK \\\n -u sk_test_4eC39HqLyjWDarjtT1zdp7dc: \\\n -H \"Stripe-Account: acct_1032D82eZvKYlo2C\" \\\n -G \n","section_type":"override","section_tag":"connected_accounts","version":null}},"errors":{"title":"Errors","group_title":"Topics","group_anchor":"topics","anchor":"errors","section_anchor":"errors","subsection_anchors":["error_handling"],"path":"/errors","gate":false,"display_on_load":true,"data":{"changes":{},"specs":{"type":{"name":"type","check":"string","validation":"string","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"The type of error returned. One of `api_error`, `card_error`, `idempotency_error`, or `invalid_request_error`","undocumented":false,"html":"The type of error returned. One of \u003Ccode\u003Eapi_error\u003C/code\u003E, \u003Ccode\u003Ecard_error\u003C/code\u003E, \u003Ccode\u003Eidempotency_error\u003C/code\u003E, or \u003Ccode\u003Einvalid_request_error\u003C/code\u003E"},"gate":false,"hide_unset_desc":null,"required":true,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"object_type":"type"},"charge":{"name":"charge","check":"string","validation":"string","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"For card errors, the ID of the failed charge.","undocumented":false,"html":"For card errors, the ID of the failed charge."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"object_type":"charge","less_common":true},"code":{"name":"code","check":"string","validation":"string","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"For some errors that could be handled programmatically, a short string indicating the [error code](/docs/error-codes) reported.","undocumented":false,"html":"For some errors that could be handled programmatically, a short string indicating the \u003Ca href=\"/docs/error-codes\"\u003Eerror code\u003C/a\u003E reported."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"object_type":"code"},"decline_code":{"name":"decline_code","check":"string","validation":"string","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"For card errors resulting from a card issuer decline, a short string indicating the [card issuer's reason for the decline](/docs/declines#issuer-declines) if they provide one.","undocumented":false,"html":"For card errors resulting from a card issuer decline, a short string indicating the \u003Ca href=\"/docs/declines#issuer-declines\"\u003Ecard issuer’s reason for the decline\u003C/a\u003E if they provide one."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"object_type":"decline_code"},"doc_url":{"name":"doc_url","check":"string","validation":"string","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"A URL to more information about the [error code](/docs/error-codes) reported.","undocumented":false,"html":"A URL to more information about the \u003Ca href=\"/docs/error-codes\"\u003Eerror code\u003C/a\u003E reported."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"object_type":"doc_url","less_common":true},"message":{"name":"message","check":"string","validation":"string","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"A human-readable message providing more details about the error. For card errors, these messages can be shown to your users.","undocumented":false,"html":"A human-readable message providing more details about the error. For card errors, these messages can be shown to your users."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"object_type":"message"},"param":{"name":"param","check":"string","validation":"string","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"If the error is parameter-specific, the parameter related to the error. For example, you can use this to display a message near the correct form field.","undocumented":false,"html":"If the error is parameter-specific, the parameter related to the error. For example, you can use this to display a message near the correct form field."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"object_type":"param"},"payment_intent":{"name":"payment_intent","check":"hash","validation":"hash","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"The PaymentIntent object for errors returned on a request involving a PaymentIntent.","undocumented":false,"html":"The PaymentIntent object for errors returned on a request involving a PaymentIntent."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"object_type":"payment_intent","subspec":{"id":{"name":"id","check":"string","validation":"string","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"Unique identifier for the object.","undocumented":false,"html":"Unique identifier for the object."},"gate":false,"hide_unset_desc":null,"required":true,"default":null,"badge_text":"retrievable with publishable key","requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"object_type":"id"},"object":{"name":"object","check":"string","validation":"string","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"String representing the object's type. Objects of the same type share the same value.","undocumented":false,"html":"String representing the object’s type. Objects of the same type share the same value."},"gate":false,"hide_unset_desc":null,"required":true,"default":null,"badge_text":"retrievable with publishable key","requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"object_type":"object","less_common":true},"amount":{"name":"amount","check":"integer","validation":"integer","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"Amount intended to be collected by this PaymentIntent. A positive integer representing how much to charge in the [smallest currency unit](/docs/currencies#zero-decimal) (e.g., 100 cents to charge $1.00 or 100 to charge ¥100, a zero-decimal currency). The minimum amount is $0.50 US or [equivalent in charge currency](/docs/currencies#minimum-and-maximum-charge-amounts). The amount value supports up to eight digits (e.g., a value of 99999999 for a USD charge of $999,999.99).","undocumented":false,"html":"Amount intended to be collected by this PaymentIntent. A positive integer representing how much to charge in the \u003Ca href=\"/docs/currencies#zero-decimal\"\u003Esmallest currency unit\u003C/a\u003E (e.g., 100 cents to charge $1.00 or 100 to charge ¥100, a zero-decimal currency). The minimum amount is $0.50 US or \u003Ca href=\"/docs/currencies#minimum-and-maximum-charge-amounts\"\u003Eequivalent in charge currency\u003C/a\u003E. The amount value supports up to eight digits (e.g., a value of 99999999 for a USD charge of $999,999.99)."},"gate":false,"hide_unset_desc":null,"required":true,"default":null,"badge_text":"retrievable with publishable key","requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"object_type":"amount"},"amount_capturable":{"name":"amount_capturable","check":"integer","validation":"integer","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"Amount that can be captured from this PaymentIntent.","undocumented":false,"html":"Amount that can be captured from this PaymentIntent."},"gate":false,"hide_unset_desc":null,"required":true,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"object_type":"amount_capturable","less_common":true},"amount_details":{"name":"amount_details","check":"hash","validation":"hash","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"Details about items included in the amount","undocumented":false,"html":"Details about items included in the amount"},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"subspec":{"tip":{"name":"tip","check":"hash","validation":"hash","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"Portion of the amount that corresponds to a tip.\n","undocumented":false,"html":"Portion of the amount that corresponds to a tip."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"subspec":{"amount":{"name":"amount","check":"nonnegative_integer","validation":"positive integer or zero","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"Portion of the amount that corresponds to a tip.\n","undocumented":false,"html":"Portion of the amount that corresponds to a tip."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"object_type":"amount"}},"object_type":"tip"}},"object_type":"amount_details","less_common":true},"amount_received":{"name":"amount_received","check":"integer","validation":"integer","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"Amount that was collected by this PaymentIntent.","undocumented":false,"html":"Amount that was collected by this PaymentIntent."},"gate":false,"hide_unset_desc":null,"required":true,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"object_type":"amount_received","less_common":true},"application":{"name":"application","check":"string","validation":"string","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"ID of the Connect application that created the PaymentIntent.","undocumented":false,"html":"ID of the Connect application that created the PaymentIntent."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":"Connect only","requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"user_expandable":["application"],"object_type":"application","less_common":true},"application_fee_amount":{"name":"application_fee_amount","check":"integer","validation":"integer","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"The amount of the application fee (if any) that will be requested to be applied to the payment and transferred to the application owner's Stripe account. The amount of the application fee collected will be capped at the total payment amount. For more information, see the PaymentIntents [use case for connected accounts](/docs/payments/connected-accounts).\n","undocumented":false,"html":"The amount of the application fee (if any) that will be requested to be applied to the payment and transferred to the application owner’s Stripe account. The amount of the application fee collected will be capped at the total payment amount. For more information, see the PaymentIntents \u003Ca href=\"/docs/payments/connected-accounts\"\u003Euse case for connected accounts\u003C/a\u003E."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":"Connect only","requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"object_type":"application_fee_amount","less_common":true},"automatic_payment_methods":{"name":"automatic_payment_methods","check":"hash","validation":"hash","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"Settings to configure compatible payment methods from the [Stripe Dashboard](https://dashboard.stripe.com/settings/payment_methods)","undocumented":false,"html":"Settings to configure compatible payment methods from the \u003Ca href=\"https://dashboard.stripe.com/settings/payment_methods\"\u003EStripe Dashboard\u003C/a\u003E"},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":"retrievable with publishable key","requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"subspec":{"enabled":{"name":"enabled","check":"boolean","validation":"boolean","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"Automatically calculates compatible payment methods","undocumented":false,"html":"Automatically calculates compatible payment methods"},"gate":false,"hide_unset_desc":null,"required":true,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"object_type":"enabled"}},"object_type":"automatic_payment_methods"},"canceled_at":{"name":"canceled_at","check":"timestamp","validation":"timestamp","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"Populated when `status` is `canceled`, this is the time at which the PaymentIntent was canceled. Measured in seconds since the Unix epoch.","undocumented":false,"html":"Populated when \u003Ccode\u003Estatus\u003C/code\u003E is \u003Ccode\u003Ecanceled\u003C/code\u003E, this is the time at which the PaymentIntent was canceled. Measured in seconds since the Unix epoch."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":"retrievable with publishable key","requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"object_type":"canceled_at","less_common":true},"cancellation_reason":{"name":"cancellation_reason","check":"string","validation":"string","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"Reason for cancellation of this PaymentIntent, either user-provided (`duplicate`, `fraudulent`, `requested_by_customer`, or `abandoned`) or generated by Stripe internally (`failed_invoice`, `void_invoice`, or `automatic`).","undocumented":false,"html":"Reason for cancellation of this PaymentIntent, either user-provided (\u003Ccode\u003Eduplicate\u003C/code\u003E, \u003Ccode\u003Efraudulent\u003C/code\u003E, \u003Ccode\u003Erequested_by_customer\u003C/code\u003E, or \u003Ccode\u003Eabandoned\u003C/code\u003E) or generated by Stripe internally (\u003Ccode\u003Efailed_invoice\u003C/code\u003E, \u003Ccode\u003Evoid_invoice\u003C/code\u003E, or \u003Ccode\u003Eautomatic\u003C/code\u003E)."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":"retrievable with publishable key","requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"object_type":"cancellation_reason","less_common":true},"capture_method":{"name":"capture_method","check":"string","validation":"string","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"Controls when the funds will be captured from the customer's account.\n","undocumented":false,"html":"Controls when the funds will be captured from the customer’s account."},"gate":false,"hide_unset_desc":null,"required":true,"default":null,"badge_text":"retrievable with publishable key","requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"enum_values":{"automatic":{"documentation":{"gate_specific":{},"localize_terms":[],"markdown":"(Default) Stripe automatically captures funds when the customer authorizes the payment.","undocumented":false,"html":"(Default) Stripe automatically captures funds when the customer authorizes the payment."}},"manual":{"documentation":{"gate_specific":{},"localize_terms":[],"markdown":"Place a hold on the funds when the customer authorizes the payment, but [don't capture the funds until later](/docs/payments/capture-later). (Not all payment methods support this.)","undocumented":false,"html":"Place a hold on the funds when the customer authorizes the payment, but \u003Ca href=\"/docs/payments/capture-later\"\u003Edon’t capture the funds until later\u003C/a\u003E. (Not all payment methods support this.)"}}},"object_type":"capture_method","less_common":true},"client_secret":{"name":"client_secret","check":"string","validation":"string","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"The client secret of this PaymentIntent. Used for client-side retrieval using a publishable key. \n\nThe client secret can be used to complete a payment from your frontend. It should not be stored, logged, or exposed to anyone other than the customer. Make sure that you have TLS enabled on any page that includes the client secret.\n\nRefer to our docs to [accept a payment](/docs/payments/accept-a-payment?ui=elements) and learn about how `client_secret` should be handled.","undocumented":false,"html":"The client secret of this PaymentIntent. Used for client-side retrieval using a publishable key. \u003C/p\u003E\n\n\u003Cp\u003EThe client secret can be used to complete a payment from your frontend. It should not be stored, logged, or exposed to anyone other than the customer. Make sure that you have TLS enabled on any page that includes the client secret.\u003C/p\u003E\n\n\u003Cp\u003ERefer to our docs to \u003Ca href=\"/docs/payments/accept-a-payment?ui=elements\"\u003Eaccept a payment\u003C/a\u003E and learn about how \u003Ccode\u003Eclient_secret\u003C/code\u003E should be handled."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":"retrievable with publishable key","requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"object_type":"client_secret"},"confirmation_method":{"name":"confirmation_method","check":"string","validation":"string","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"","undocumented":false,"html":""},"gate":false,"hide_unset_desc":null,"required":true,"default":null,"badge_text":"retrievable with publishable key","requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"enum_values":{"automatic":{"documentation":{"gate_specific":{},"localize_terms":[],"markdown":"(Default) PaymentIntent can be confirmed using a publishable key. After `next_action`s are handled, no additional confirmation is required to complete the payment.","undocumented":false,"html":"(Default) PaymentIntent can be confirmed using a publishable key. After \u003Ccode\u003Enext_action\u003C/code\u003Es are handled, no additional confirmation is required to complete the payment."}},"manual":{"documentation":{"gate_specific":{},"localize_terms":[],"markdown":"All payment attempts must be made using a secret key. The PaymentIntent returns to the `requires_confirmation` state after handling `next_action`s, and requires your server to initiate each payment attempt with an explicit confirmation.","undocumented":false,"html":"All payment attempts must be made using a secret key. The PaymentIntent returns to the \u003Ccode\u003Erequires_confirmation\u003C/code\u003E state after handling \u003Ccode\u003Enext_action\u003C/code\u003Es, and requires your server to initiate each payment attempt with an explicit confirmation."}}},"object_type":"confirmation_method","less_common":true},"created":{"name":"created","check":"timestamp","validation":"timestamp","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"Time at which the object was created. Measured in seconds since the Unix epoch.","undocumented":false,"html":"Time at which the object was created. Measured in seconds since the Unix epoch."},"gate":false,"hide_unset_desc":null,"required":true,"default":null,"badge_text":"retrievable with publishable key","requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"object_type":"created","less_common":true},"currency":{"name":"currency","check":"currency","validation":"currency","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. Must be a [supported currency](https://stripe.com/docs/currencies).","undocumented":false,"html":"Three-letter \u003Ca href=\"https://www.iso.org/iso-4217-currency-codes.html\"\u003EISO currency code\u003C/a\u003E, in lowercase. Must be a \u003Ca href=\"https://stripe.com/docs/currencies\"\u003Esupported currency\u003C/a\u003E."},"gate":false,"hide_unset_desc":null,"required":true,"default":null,"badge_text":"retrievable with publishable key","requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"object_type":"currency"},"customer":{"name":"customer","check":"string","validation":"string","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"ID of the Customer this PaymentIntent belongs to, if one exists.\n\nPayment methods attached to other Customers cannot be used with this PaymentIntent.\n\nIf present in combination with [setup_future_usage](#payment_intent_object-setup_future_usage), this PaymentIntent's payment method will be attached to the Customer after the PaymentIntent has been confirmed and any required actions from the user are complete.\n","undocumented":false,"html":"ID of the Customer this PaymentIntent belongs to, if one exists.\u003C/p\u003E\n\n\u003Cp\u003EPayment methods attached to other Customers cannot be used with this PaymentIntent.\u003C/p\u003E\n\n\u003Cp\u003EIf present in combination with \u003Ca href=\"#payment_intent_object-setup_future_usage\"\u003Esetup_future_usage\u003C/a\u003E, this PaymentIntent’s payment method will be attached to the Customer after the PaymentIntent has been confirmed and any required actions from the user are complete."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"user_expandable":["customer"],"object_type":"customer"},"description":{"name":"description","check":"string","validation":"string","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"An arbitrary string attached to the object. Often useful for displaying to users.","undocumented":false,"html":"An arbitrary string attached to the object. Often useful for displaying to users."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":"retrievable with publishable key","requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"object_type":"description"},"invoice":{"name":"invoice","check":"string","validation":"string","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"ID of the invoice that created this PaymentIntent, if it exists.","undocumented":false,"html":"ID of the invoice that created this PaymentIntent, if it exists."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"user_expandable":["invoice"],"object_type":"invoice","less_common":true},"last_payment_error":{"name":"last_payment_error","check":"hash","validation":"hash","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"The payment error encountered in the previous PaymentIntent confirmation. It will be cleared if the PaymentIntent is later updated for any reason.","undocumented":false,"html":"The payment error encountered in the previous PaymentIntent confirmation. It will be cleared if the PaymentIntent is later updated for any reason."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":"retrievable with publishable key","requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"subspec":{"type":{"name":"type","check":"string","validation":"string","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"The type of error returned. One of `api_error`, `card_error`, `idempotency_error`, or `invalid_request_error`","undocumented":false,"html":"The type of error returned. One of \u003Ccode\u003Eapi_error\u003C/code\u003E, \u003Ccode\u003Ecard_error\u003C/code\u003E, \u003Ccode\u003Eidempotency_error\u003C/code\u003E, or \u003Ccode\u003Einvalid_request_error\u003C/code\u003E"},"gate":false,"hide_unset_desc":null,"required":true,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"object_type":"type"},"charge":{"name":"charge","check":"string","validation":"string","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"For card errors, the ID of the failed charge.","undocumented":false,"html":"For card errors, the ID of the failed charge."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"object_type":"charge","less_common":true},"code":{"name":"code","check":"string","validation":"string","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"For some errors that could be handled programmatically, a short string indicating the [error code](/docs/error-codes) reported.","undocumented":false,"html":"For some errors that could be handled programmatically, a short string indicating the \u003Ca href=\"/docs/error-codes\"\u003Eerror code\u003C/a\u003E reported."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"object_type":"code"},"decline_code":{"name":"decline_code","check":"string","validation":"string","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"For card errors resulting from a card issuer decline, a short string indicating the [card issuer's reason for the decline](/docs/declines#issuer-declines) if they provide one.","undocumented":false,"html":"For card errors resulting from a card issuer decline, a short string indicating the \u003Ca href=\"/docs/declines#issuer-declines\"\u003Ecard issuer’s reason for the decline\u003C/a\u003E if they provide one."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"object_type":"decline_code"},"doc_url":{"name":"doc_url","check":"string","validation":"string","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"A URL to more information about the [error code](/docs/error-codes) reported.","undocumented":false,"html":"A URL to more information about the \u003Ca href=\"/docs/error-codes\"\u003Eerror code\u003C/a\u003E reported."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"object_type":"doc_url","less_common":true},"message":{"name":"message","check":"string","validation":"string","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"A human-readable message providing more details about the error. For card errors, these messages can be shown to your users.","undocumented":false,"html":"A human-readable message providing more details about the error. For card errors, these messages can be shown to your users."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"object_type":"message"},"param":{"name":"param","check":"string","validation":"string","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"If the error is parameter-specific, the parameter related to the error. For example, you can use this to display a message near the correct form field.","undocumented":false,"html":"If the error is parameter-specific, the parameter related to the error. For example, you can use this to display a message near the correct form field."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"object_type":"param"},"payment_method":{"name":"payment_method","check":"hash","validation":"hash","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"The PaymentMethod object for errors returned on a request involving a PaymentMethod.","undocumented":false,"html":"The PaymentMethod object for errors returned on a request involving a PaymentMethod."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"subspec":{"id":{"name":"id","check":"string","validation":"string","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"Unique identifier for the object.","undocumented":false,"html":"Unique identifier for the object."},"gate":false,"hide_unset_desc":null,"required":true,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"object_type":"id"},"object":{"name":"object","check":"string","validation":"string","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"String representing the object's type. Objects of the same type share the same value.","undocumented":false,"html":"String representing the object’s type. Objects of the same type share the same value."},"gate":false,"hide_unset_desc":null,"required":true,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"object_type":"object","less_common":true},"acss_debit":{"name":"acss_debit","check":"hash","validation":"hash","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"If this is an `acss_debit` PaymentMethod, this hash contains details about the ACSS Debit payment method.","undocumented":false,"html":"If this is an \u003Ccode\u003Eacss_debit\u003C/code\u003E PaymentMethod, this hash contains details about the ACSS Debit payment method."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"subspec":{"bank_name":{"name":"bank_name","check":"string","validation":"string","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"Name of the bank associated with the bank account.","undocumented":false,"html":"Name of the bank associated with the bank account."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"object_type":"bank_name"},"fingerprint":{"name":"fingerprint","check":"string","validation":"string","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"Uniquely identifies this particular bank account. You can use this attribute to check whether two bank accounts are the same.","undocumented":false,"html":"Uniquely identifies this particular bank account. You can use this attribute to check whether two bank accounts are the same."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"object_type":"fingerprint"},"institution_number":{"name":"institution_number","check":"string","validation":"string","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"Institution number of the bank account.","undocumented":false,"html":"Institution number of the bank account."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"object_type":"institution_number"},"last4":{"name":"last4","check":"string","validation":"string","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"Last four digits of the bank account number.","undocumented":false,"html":"Last four digits of the bank account number."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"object_type":"last4"},"transit_number":{"name":"transit_number","check":"string","validation":"string","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"Transit number of the bank account.","undocumented":false,"html":"Transit number of the bank account."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"object_type":"transit_number"}},"object_type":"acss_debit","less_common":true},"affirm":{"name":"affirm","check":"hash","validation":"hash","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"If this is an `affirm` PaymentMethod, this hash contains details about the Affirm payment method.","undocumented":false,"html":"If this is an \u003Ccode\u003Eaffirm\u003C/code\u003E PaymentMethod, this hash contains details about the Affirm payment method."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"subspec":{},"object_type":"affirm","less_common":true},"afterpay_clearpay":{"name":"afterpay_clearpay","check":"hash","validation":"hash","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"If this is an `AfterpayClearpay` PaymentMethod, this hash contains details about the AfterpayClearpay payment method.","undocumented":false,"html":"If this is an \u003Ccode\u003EAfterpayClearpay\u003C/code\u003E PaymentMethod, this hash contains details about the AfterpayClearpay payment method."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"subspec":{},"object_type":"afterpay_clearpay","less_common":true},"alipay":{"name":"alipay","check":"hash","validation":"hash","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"If this is an `Alipay` PaymentMethod, this hash contains details about the Alipay payment method.","undocumented":false,"html":"If this is an \u003Ccode\u003EAlipay\u003C/code\u003E PaymentMethod, this hash contains details about the Alipay payment method."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"subspec":{},"object_type":"alipay","less_common":true},"au_becs_debit":{"name":"au_becs_debit","check":"hash","validation":"hash","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"If this is an `au_becs_debit` PaymentMethod, this hash contains details about the bank account.","undocumented":false,"html":"If this is an \u003Ccode\u003Eau_becs_debit\u003C/code\u003E PaymentMethod, this hash contains details about the bank account."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"subspec":{"bsb_number":{"name":"bsb_number","check":"string","validation":"string","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"Six-digit number identifying bank and branch associated with this bank account.","undocumented":false,"html":"Six-digit number identifying bank and branch associated with this bank account."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"object_type":"bsb_number"},"fingerprint":{"name":"fingerprint","check":"string","validation":"string","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"Uniquely identifies this particular bank account. You can use this attribute to check whether two bank accounts are the same.","undocumented":false,"html":"Uniquely identifies this particular bank account. You can use this attribute to check whether two bank accounts are the same."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"object_type":"fingerprint"},"last4":{"name":"last4","check":"string","validation":"string","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"Last four digits of the bank account number.","undocumented":false,"html":"Last four digits of the bank account number."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"object_type":"last4"}},"object_type":"au_becs_debit","less_common":true},"bacs_debit":{"name":"bacs_debit","check":"hash","validation":"hash","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"If this is a `bacs_debit` PaymentMethod, this hash contains details about the Bacs Direct Debit bank account.","undocumented":false,"html":"If this is a \u003Ccode\u003Ebacs_debit\u003C/code\u003E PaymentMethod, this hash contains details about the Bacs Direct Debit bank account."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"subspec":{"fingerprint":{"name":"fingerprint","check":"string","validation":"string","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"Uniquely identifies this particular bank account. You can use this attribute to check whether two bank accounts are the same.","undocumented":false,"html":"Uniquely identifies this particular bank account. You can use this attribute to check whether two bank accounts are the same."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"object_type":"fingerprint"},"last4":{"name":"last4","check":"string","validation":"string","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"Last four digits of the bank account number.","undocumented":false,"html":"Last four digits of the bank account number."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"object_type":"last4"},"sort_code":{"name":"sort_code","check":"string","validation":"string","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"Sort code of the bank account. (e.g., `10-20-30`)","undocumented":false,"html":"Sort code of the bank account. (e.g., \u003Ccode\u003E10-20-30\u003C/code\u003E)"},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"object_type":"sort_code"}},"object_type":"bacs_debit","less_common":true},"bancontact":{"name":"bancontact","check":"hash","validation":"hash","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"If this is a `bancontact` PaymentMethod, this hash contains details about the Bancontact payment method.","undocumented":false,"html":"If this is a \u003Ccode\u003Ebancontact\u003C/code\u003E PaymentMethod, this hash contains details about the Bancontact payment method."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"subspec":{},"object_type":"bancontact","less_common":true},"billing_details":{"name":"billing_details","check":"hash","validation":"hash","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"Billing information associated with the PaymentMethod that may be used or required by particular types of payment methods.","undocumented":false,"html":"Billing information associated with the PaymentMethod that may be used or required by particular types of payment methods."},"gate":false,"hide_unset_desc":null,"required":true,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"subspec":{"address":{"name":"address","check":"hash","validation":"hash","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"Billing address.","undocumented":false,"html":"Billing address."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"subspec":{"city":{"name":"city","check":"string","validation":"string","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"City, district, suburb, town, or village.","undocumented":false,"html":"City, district, suburb, town, or village."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"object_type":"city"},"country":{"name":"country","check":"string","validation":"string","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)).","undocumented":false,"html":"Two-letter country code (\u003Ca href=\"https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2\"\u003EISO 3166-1 alpha-2\u003C/a\u003E)."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"object_type":"country"},"line1":{"name":"line1","check":"string","validation":"string","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"Address line 1 (e.g., street, PO Box, or company name).","undocumented":false,"html":"Address line 1 (e.g., street, PO Box, or company name)."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"object_type":"line1"},"line2":{"name":"line2","check":"string","validation":"string","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"Address line 2 (e.g., apartment, suite, unit, or building).","undocumented":false,"html":"Address line 2 (e.g., apartment, suite, unit, or building)."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"object_type":"line2"},"postal_code":{"name":"postal_code","check":"string","validation":"string","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"ZIP or postal code.","undocumented":false,"html":"ZIP or postal code."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"object_type":"postal_code"},"state":{"name":"state","check":"string","validation":"string","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"State, county, province, or region.","undocumented":false,"html":"State, county, province, or region."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"object_type":"state"}},"object_type":"address"},"email":{"name":"email","check":"string","validation":"string","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"Email address.","undocumented":false,"html":"Email address."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"object_type":"email"},"name":{"name":"name","check":"string","validation":"string","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"Full name.","undocumented":false,"html":"Full name."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"object_type":"name"},"phone":{"name":"phone","check":"string","validation":"string","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"Billing phone number (including extension).","undocumented":false,"html":"Billing phone number (including extension)."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"object_type":"phone"}},"object_type":"billing_details"},"blik":{"name":"blik","check":"hash","validation":"hash","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"If this is a `blik` PaymentMethod, this hash contains details about the BLIK payment method.","undocumented":false,"html":"If this is a \u003Ccode\u003Eblik\u003C/code\u003E PaymentMethod, this hash contains details about the BLIK payment method."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"subspec":{},"object_type":"blik","less_common":true},"boleto":{"name":"boleto","check":"hash","validation":"hash","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"If this is a `boleto` PaymentMethod, this hash contains details about the Boleto payment method.","undocumented":false,"html":"If this is a \u003Ccode\u003Eboleto\u003C/code\u003E PaymentMethod, this hash contains details about the Boleto payment method."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"subspec":{"fingerprint":{"name":"fingerprint","check":"string","validation":"string","documentation":null,"gate":true,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"object_type":"fingerprint"},"tax_id":{"name":"tax_id","check":"string","validation":"string","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"Uniquely identifies the customer tax id (CNPJ or CPF)","undocumented":false,"html":"Uniquely identifies the customer tax id (CNPJ or CPF)"},"gate":false,"hide_unset_desc":null,"required":true,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"object_type":"tax_id"}},"object_type":"boleto","less_common":true},"card":{"name":"card","check":"hash","validation":"hash","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"If this is a `card` PaymentMethod, this hash contains the user's card details.","undocumented":false,"html":"If this is a \u003Ccode\u003Ecard\u003C/code\u003E PaymentMethod, this hash contains the user’s card details."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"subspec":{"brand":{"name":"brand","check":"string","validation":"string","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"Card brand. Can be `amex`, `diners`, `discover`, `jcb`, `mastercard`, `unionpay`, `visa`, or `unknown`.","undocumented":false,"html":"Card brand. Can be \u003Ccode\u003Eamex\u003C/code\u003E, \u003Ccode\u003Ediners\u003C/code\u003E, \u003Ccode\u003Ediscover\u003C/code\u003E, \u003Ccode\u003Ejcb\u003C/code\u003E, \u003Ccode\u003Emastercard\u003C/code\u003E, \u003Ccode\u003Eunionpay\u003C/code\u003E, \u003Ccode\u003Evisa\u003C/code\u003E, or \u003Ccode\u003Eunknown\u003C/code\u003E."},"gate":false,"hide_unset_desc":null,"required":true,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"object_type":"brand"},"checks":{"name":"checks","check":"hash","validation":"hash","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"Checks on Card address and CVC if provided.","undocumented":false,"html":"Checks on Card address and CVC if provided."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"subspec":{"address_line1_check":{"name":"address_line1_check","check":"string","validation":"string","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"If a address line1 was provided, results of the check, one of `pass`, `fail`, `unavailable`, or `unchecked`.","undocumented":false,"html":"If a address line1 was provided, results of the check, one of \u003Ccode\u003Epass\u003C/code\u003E, \u003Ccode\u003Efail\u003C/code\u003E, \u003Ccode\u003Eunavailable\u003C/code\u003E, or \u003Ccode\u003Eunchecked\u003C/code\u003E."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"object_type":"address_line1_check"},"address_postal_code_check":{"name":"address_postal_code_check","check":"string","validation":"string","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"If a address postal code was provided, results of the check, one of `pass`, `fail`, `unavailable`, or `unchecked`.","undocumented":false,"html":"If a address postal code was provided, results of the check, one of \u003Ccode\u003Epass\u003C/code\u003E, \u003Ccode\u003Efail\u003C/code\u003E, \u003Ccode\u003Eunavailable\u003C/code\u003E, or \u003Ccode\u003Eunchecked\u003C/code\u003E."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"object_type":"address_postal_code_check"},"cvc_check":{"name":"cvc_check","check":"string","validation":"string","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"If a CVC was provided, results of the check, one of `pass`, `fail`, `unavailable`, or `unchecked`.","undocumented":false,"html":"If a CVC was provided, results of the check, one of \u003Ccode\u003Epass\u003C/code\u003E, \u003Ccode\u003Efail\u003C/code\u003E, \u003Ccode\u003Eunavailable\u003C/code\u003E, or \u003Ccode\u003Eunchecked\u003C/code\u003E."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"object_type":"cvc_check"}},"object_type":"checks"},"country":{"name":"country","check":"string","validation":"string","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"Two-letter ISO code representing the country of the card. You could use this attribute to get a sense of the international breakdown of cards you've collected.","undocumented":false,"html":"Two-letter ISO code representing the country of the card. You could use this attribute to get a sense of the international breakdown of cards you’ve collected."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"object_type":"country"},"exp_month":{"name":"exp_month","check":"integer","validation":"integer","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"Two-digit number representing the card's expiration month.","undocumented":false,"html":"Two-digit number representing the card’s expiration month."},"gate":false,"hide_unset_desc":null,"required":true,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"object_type":"exp_month"},"exp_year":{"name":"exp_year","check":"integer","validation":"integer","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"Four-digit number representing the card's expiration year.","undocumented":false,"html":"Four-digit number representing the card’s expiration year."},"gate":false,"hide_unset_desc":null,"required":true,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"object_type":"exp_year"},"fingerprint":{"name":"fingerprint","check":"string","validation":"string","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"Uniquely identifies this particular card number. You can use this attribute to check whether two customers who’ve signed up with you are using the same card number, for example. For payment methods that tokenize card information (Apple Pay, Google Pay), the tokenized number might be provided instead of the underlying card number.\n\n*Starting May 1, 2021, card fingerprint in India for Connect will change to allow two fingerprints for the same card --- one for India and one for the rest of the world.*\n","undocumented":false,"html":"Uniquely identifies this particular card number. You can use this attribute to check whether two customers who’ve signed up with you are using the same card number, for example. For payment methods that tokenize card information (Apple Pay, Google Pay), the tokenized number might be provided instead of the underlying card number.\u003C/p\u003E\n\n\u003Cp\u003E\u003Cem\u003EStarting May 1, 2021, card fingerprint in India for Connect will change to allow two fingerprints for the same card — one for India and one for the rest of the world.\u003C/em\u003E"},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":"card_fingerprint_read","hide_nil":null,"is_country_specific":false,"includable":null,"object_type":"fingerprint"},"funding":{"name":"funding","check":"string","validation":"string","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"Card funding type. Can be `credit`, `debit`, `prepaid`, or `unknown`.","undocumented":false,"html":"Card funding type. Can be \u003Ccode\u003Ecredit\u003C/code\u003E, \u003Ccode\u003Edebit\u003C/code\u003E, \u003Ccode\u003Eprepaid\u003C/code\u003E, or \u003Ccode\u003Eunknown\u003C/code\u003E."},"gate":false,"hide_unset_desc":null,"required":true,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"object_type":"funding"},"generated_from":{"name":"generated_from","check":"hash","validation":"hash","documentation":{"gate_specific":{"sdk_client_public":{"gate_specific":{},"localize_terms":[],"undocumented":true,"html":null}},"localize_terms":[],"markdown":"Details of the original PaymentMethod that created this object.","undocumented":false,"html":"Details of the original PaymentMethod that created this object."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"subspec":{"charge":{"name":"charge","check":"string","validation":"string","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"The charge that created this object.","undocumented":false,"html":"The charge that created this object."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"object_type":"charge"},"payment_method_details":{"name":"payment_method_details","check":"hash","validation":"hash","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"Transaction-specific details of the payment method used in the payment.","undocumented":false,"html":"Transaction-specific details of the payment method used in the payment."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"subspec":{"card_present":{"name":"card_present","check":"hash","validation":"hash","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"This hash contains the snapshot of the `card_present` transaction-specific details which generated this `card` payment method.","undocumented":false,"html":"This hash contains the snapshot of the \u003Ccode\u003Ecard_present\u003C/code\u003E transaction-specific details which generated this \u003Ccode\u003Ecard\u003C/code\u003E payment method."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"subspec":{"amount_authorized":{"name":"amount_authorized","check":"integer","validation":"integer","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"The authorized amount","undocumented":false,"html":"The authorized amount"},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"object_type":"amount_authorized"},"brand":{"name":"brand","check":"string","validation":"string","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"Card brand. Can be `amex`, `diners`, `discover`, `jcb`, `mastercard`, `unionpay`, `visa`, or `unknown`.","undocumented":false,"html":"Card brand. Can be \u003Ccode\u003Eamex\u003C/code\u003E, \u003Ccode\u003Ediners\u003C/code\u003E, \u003Ccode\u003Ediscover\u003C/code\u003E, \u003Ccode\u003Ejcb\u003C/code\u003E, \u003Ccode\u003Emastercard\u003C/code\u003E, \u003Ccode\u003Eunionpay\u003C/code\u003E, \u003Ccode\u003Evisa\u003C/code\u003E, or \u003Ccode\u003Eunknown\u003C/code\u003E."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"object_type":"brand"},"capture_before":{"name":"capture_before","check":"timestamp","validation":"timestamp","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"When using manual capture, a future timestamp after which the charge will be automatically refunded if uncaptured.","undocumented":false,"html":"When using manual capture, a future timestamp after which the charge will be automatically refunded if uncaptured."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"object_type":"capture_before"},"cardholder_name":{"name":"cardholder_name","check":"string","validation":"string","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"The cardholder name as read from the card, in [ISO 7813](https://en.wikipedia.org/wiki/ISO/IEC_7813) format. May include alphanumeric characters, special characters and first/last name separator (`/`). In some cases, the cardholder name may not be available depending on how the issuer has configured the card. Cardholder name is typically not available on swipe or contactless payments, such as those made with Apple Pay and Google Pay.","undocumented":false,"html":"The cardholder name as read from the card, in \u003Ca href=\"https://en.wikipedia.org/wiki/ISO/IEC_7813\"\u003EISO 7813\u003C/a\u003E format. May include alphanumeric characters, special characters and first/last name separator (\u003Ccode\u003E/\u003C/code\u003E). In some cases, the cardholder name may not be available depending on how the issuer has configured the card. Cardholder name is typically not available on swipe or contactless payments, such as those made with Apple Pay and Google Pay."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"object_type":"cardholder_name"},"country":{"name":"country","check":"string","validation":"string","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"Two-letter ISO code representing the country of the card. You could use this attribute to get a sense of the international breakdown of cards you've collected.","undocumented":false,"html":"Two-letter ISO code representing the country of the card. You could use this attribute to get a sense of the international breakdown of cards you’ve collected."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"object_type":"country"},"emv_auth_data":{"name":"emv_auth_data","check":"string","validation":"string","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"Authorization response cryptogram.","undocumented":false,"html":"Authorization response cryptogram."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"object_type":"emv_auth_data"},"exp_month":{"name":"exp_month","check":"integer","validation":"integer","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"Two-digit number representing the card's expiration month.","undocumented":false,"html":"Two-digit number representing the card’s expiration month."},"gate":false,"hide_unset_desc":null,"required":true,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"object_type":"exp_month"},"exp_year":{"name":"exp_year","check":"integer","validation":"integer","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"Four-digit number representing the card's expiration year.","undocumented":false,"html":"Four-digit number representing the card’s expiration year."},"gate":false,"hide_unset_desc":null,"required":true,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"object_type":"exp_year"},"fingerprint":{"name":"fingerprint","check":"string","validation":"string","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"Uniquely identifies this particular card number. You can use this attribute to check whether two customers who’ve signed up with you are using the same card number, for example. For payment methods that tokenize card information (Apple Pay, Google Pay), the tokenized number might be provided instead of the underlying card number.\n\n*Starting May 1, 2021, card fingerprint in India for Connect will change to allow two fingerprints for the same card --- one for India and one for the rest of the world.*\n","undocumented":false,"html":"Uniquely identifies this particular card number. You can use this attribute to check whether two customers who’ve signed up with you are using the same card number, for example. For payment methods that tokenize card information (Apple Pay, Google Pay), the tokenized number might be provided instead of the underlying card number.\u003C/p\u003E\n\n\u003Cp\u003E\u003Cem\u003EStarting May 1, 2021, card fingerprint in India for Connect will change to allow two fingerprints for the same card — one for India and one for the rest of the world.\u003C/em\u003E"},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"object_type":"fingerprint"},"funding":{"name":"funding","check":"string","validation":"string","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"Card funding type. Can be `credit`, `debit`, `prepaid`, or `unknown`.","undocumented":false,"html":"Card funding type. Can be \u003Ccode\u003Ecredit\u003C/code\u003E, \u003Ccode\u003Edebit\u003C/code\u003E, \u003Ccode\u003Eprepaid\u003C/code\u003E, or \u003Ccode\u003Eunknown\u003C/code\u003E."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"object_type":"funding"},"generated_card":{"name":"generated_card","check":"string","validation":"string","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"ID of a card PaymentMethod generated from the card_present PaymentMethod that may be attached to a Customer for future transactions. Only present if it was possible to generate a card PaymentMethod.","undocumented":false,"html":"ID of a card PaymentMethod generated from the card_present PaymentMethod that may be attached to a Customer for future transactions. Only present if it was possible to generate a card PaymentMethod."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"object_type":"generated_card"},"incremental_authorization_supported":{"name":"incremental_authorization_supported","check":"boolean","validation":"boolean","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"Whether this [PaymentIntent](/docs/api/payment_intents) is eligible for incremental authorizations. Request support using [request_incremental_authorization_support](/docs/api/payment_intents/create#create_payment_intent-payment_method_options-card_present-request_incremental_authorization_support).","undocumented":false,"html":"Whether this \u003Ca href=\"/docs/api/payment_intents\"\u003EPaymentIntent\u003C/a\u003E is eligible for incremental authorizations. Request support using \u003Ca href=\"/docs/api/payment_intents/create#create_payment_intent-payment_method_options-card_present-request_incremental_authorization_support\"\u003Erequest_incremental_authorization_support\u003C/a\u003E."},"gate":false,"hide_unset_desc":null,"required":true,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"object_type":"incremental_authorization_supported"},"last4":{"name":"last4","check":"string","validation":"string","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"The last four digits of the card.","undocumented":false,"html":"The last four digits of the card."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"object_type":"last4"},"network":{"name":"network","check":"string","validation":"string","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"Identifies which network this charge was processed on. Can be `amex`, `cartes_bancaires`, `diners`, `discover`, `interac`, `jcb`, `mastercard`, `unionpay`, `visa`, or `unknown`.","undocumented":false,"html":"Identifies which network this charge was processed on. Can be \u003Ccode\u003Eamex\u003C/code\u003E, \u003Ccode\u003Ecartes_bancaires\u003C/code\u003E, \u003Ccode\u003Ediners\u003C/code\u003E, \u003Ccode\u003Ediscover\u003C/code\u003E, \u003Ccode\u003Einterac\u003C/code\u003E, \u003Ccode\u003Ejcb\u003C/code\u003E, \u003Ccode\u003Emastercard\u003C/code\u003E, \u003Ccode\u003Eunionpay\u003C/code\u003E, \u003Ccode\u003Evisa\u003C/code\u003E, or \u003Ccode\u003Eunknown\u003C/code\u003E."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"object_type":"network"},"overcapture_supported":{"name":"overcapture_supported","check":"boolean","validation":"boolean","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"Defines whether the authorized amount can be over-captured or not","undocumented":false,"html":"Defines whether the authorized amount can be over-captured or not"},"gate":false,"hide_unset_desc":null,"required":true,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"object_type":"overcapture_supported"},"read_method":{"name":"read_method","check":"string","validation":"string","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"How card details were read in this transaction.","undocumented":false,"html":"How card details were read in this transaction."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"enum_values":{"contact_emv":{"documentation":{"gate_specific":{},"localize_terms":[],"markdown":"Inserting a chip card into the card reader.","undocumented":false,"html":"Inserting a chip card into the card reader."}},"contactless_emv":{"documentation":{"gate_specific":{},"localize_terms":[],"markdown":"Tapping a contactless-enabled chip card or mobile wallet.","undocumented":false,"html":"Tapping a contactless-enabled chip card or mobile wallet."}},"magnetic_stripe_track2":{"documentation":{"gate_specific":{},"localize_terms":[],"markdown":"Swiping a card using the magnetic stripe reader.","undocumented":false,"html":"Swiping a card using the magnetic stripe reader."}},"magnetic_stripe_fallback":{"documentation":{"gate_specific":{},"localize_terms":[],"markdown":"When inserting a chip card fails three times in a row, fallback to a magnetic stripe read.","undocumented":false,"html":"When inserting a chip card fails three times in a row, fallback to a magnetic stripe read."}},"contactless_magstripe_mode":{"documentation":{"gate_specific":{},"localize_terms":[],"markdown":"Older standard for contactless payments that emulated a magnetic stripe read.","undocumented":false,"html":"Older standard for contactless payments that emulated a magnetic stripe read."}}},"object_type":"read_method"},"receipt":{"name":"receipt","check":"hash","validation":"hash","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"A collection of fields required to be displayed on receipts. Only required for EMV transactions.","undocumented":false,"html":"A collection of fields required to be displayed on receipts. Only required for EMV transactions."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"subspec":{"account_type":{"name":"account_type","check":"string","validation":"string","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"The type of account being debited or credited","undocumented":false,"html":"The type of account being debited or credited"},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"enum_values":{"credit":{"documentation":{"gate_specific":{},"localize_terms":[],"markdown":"A credit account, as when using a credit card","undocumented":false,"html":"A credit account, as when using a credit card"}},"checking":{"documentation":{"gate_specific":{},"localize_terms":[],"markdown":"A checking account, as when using a debit card","undocumented":false,"html":"A checking account, as when using a debit card"}},"prepaid":{"documentation":{"gate_specific":{},"localize_terms":[],"markdown":"A prepaid account, as when using a debit gift card","undocumented":false,"html":"A prepaid account, as when using a debit gift card"}},"unknown":{"documentation":{"gate_specific":{},"localize_terms":[],"markdown":"An unknown account","undocumented":false,"html":"An unknown account"}}},"object_type":"account_type"},"application_cryptogram":{"name":"application_cryptogram","check":"string","validation":"string","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"EMV tag 9F26, cryptogram generated by the integrated circuit chip.","undocumented":false,"html":"EMV tag 9F26, cryptogram generated by the integrated circuit chip."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"object_type":"application_cryptogram"},"application_preferred_name":{"name":"application_preferred_name","check":"string","validation":"string","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"Mnenomic of the Application Identifier.","undocumented":false,"html":"Mnenomic of the Application Identifier."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"object_type":"application_preferred_name"},"authorization_code":{"name":"authorization_code","check":"string","validation":"string","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"Identifier for this transaction.","undocumented":false,"html":"Identifier for this transaction."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"object_type":"authorization_code"},"authorization_response_code":{"name":"authorization_response_code","check":"string","validation":"string","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"EMV tag 8A. A code returned by the card issuer.","undocumented":false,"html":"EMV tag 8A. A code returned by the card issuer."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"object_type":"authorization_response_code"},"cardholder_verification_method":{"name":"cardholder_verification_method","check":"string","validation":"string","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"How the cardholder verified ownership of the card.","undocumented":false,"html":"How the cardholder verified ownership of the card."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"object_type":"cardholder_verification_method"},"dedicated_file_name":{"name":"dedicated_file_name","check":"string","validation":"string","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"EMV tag 84. Similar to the application identifier stored on the integrated circuit chip.","undocumented":false,"html":"EMV tag 84. Similar to the application identifier stored on the integrated circuit chip."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"object_type":"dedicated_file_name"},"terminal_verification_results":{"name":"terminal_verification_results","check":"string","validation":"string","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"The outcome of a series of EMV functions performed by the card reader.","undocumented":false,"html":"The outcome of a series of EMV functions performed by the card reader."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"object_type":"terminal_verification_results"},"transaction_status_information":{"name":"transaction_status_information","check":"string","validation":"string","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"An indication of various EMV functions performed during the transaction.","undocumented":false,"html":"An indication of various EMV functions performed during the transaction."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"object_type":"transaction_status_information"}},"object_type":"receipt"}},"object_type":"card_present"},"type":{"name":"type","check":"string","validation":"string","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"The type of payment method transaction-specific details from the transaction that generated this `card` payment method. Always `card_present`.","undocumented":false,"html":"The type of payment method transaction-specific details from the transaction that generated this \u003Ccode\u003Ecard\u003C/code\u003E payment method. Always \u003Ccode\u003Ecard_present\u003C/code\u003E."},"gate":false,"hide_unset_desc":null,"required":true,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"object_type":"type"}},"object_type":"payment_method_details"},"setup_attempt":{"name":"setup_attempt","check":"string","validation":"string","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"The ID of the SetupAttempt that generated this PaymentMethod, if any.","undocumented":false,"html":"The ID of the SetupAttempt that generated this PaymentMethod, if any."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"user_expandable":["setup_attempt"],"object_type":"setup_attempt"}},"object_type":"generated_from"},"last4":{"name":"last4","check":"string","validation":"string","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"The last four digits of the card.","undocumented":false,"html":"The last four digits of the card."},"gate":false,"hide_unset_desc":null,"required":true,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"object_type":"last4"},"networks":{"name":"networks","check":"hash","validation":"hash","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"Contains information about card networks that can be used to process the payment.","undocumented":false,"html":"Contains information about card networks that can be used to process the payment."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"subspec":{"available":{"name":"available","check":"string_array","validation":"array containing strings","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"All available networks for the card.","undocumented":false,"html":"All available networks for the card."},"gate":false,"hide_unset_desc":null,"required":true,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"object_type":"available"},"preferred":{"name":"preferred","check":"string","validation":"string","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"The preferred network for the card.","undocumented":false,"html":"The preferred network for the card."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"object_type":"preferred"}},"object_type":"networks"},"three_d_secure_usage":{"name":"three_d_secure_usage","check":"hash","validation":"hash","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"Contains details on how this Card may be used for 3D Secure authentication.","undocumented":false,"html":"Contains details on how this Card may be used for 3D Secure authentication."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"subspec":{"supported":{"name":"supported","check":"boolean","validation":"boolean","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"Whether 3D Secure is supported on this card.","undocumented":false,"html":"Whether 3D Secure is supported on this card."},"gate":false,"hide_unset_desc":null,"required":true,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"object_type":"supported"}},"object_type":"three_d_secure_usage"},"wallet":{"name":"wallet","check":"hash","validation":"hash","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"If this Card is part of a card wallet, this contains the details of the card wallet.","undocumented":false,"html":"If this Card is part of a card wallet, this contains the details of the card wallet."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"subspec":{"amex_express_checkout":{"name":"amex_express_checkout","check":"hash","validation":"hash","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"If this is a `amex_express_checkout` card wallet, this hash contains details about the wallet.","undocumented":false,"html":"If this is a \u003Ccode\u003Eamex_express_checkout\u003C/code\u003E card wallet, this hash contains details about the wallet."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"subspec":{},"object_type":"amex_express_checkout"},"apple_pay":{"name":"apple_pay","check":"hash","validation":"hash","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"If this is a `apple_pay` card wallet, this hash contains details about the wallet.","undocumented":false,"html":"If this is a \u003Ccode\u003Eapple_pay\u003C/code\u003E card wallet, this hash contains details about the wallet."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"subspec":{},"object_type":"apple_pay"},"dynamic_last4":{"name":"dynamic_last4","check":"string","validation":"string","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"(For tokenized numbers only.) The last four digits of the device account number.","undocumented":false,"html":"(For tokenized numbers only.) The last four digits of the device account number."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"object_type":"dynamic_last4"},"google_pay":{"name":"google_pay","check":"hash","validation":"hash","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"If this is a `google_pay` card wallet, this hash contains details about the wallet.","undocumented":false,"html":"If this is a \u003Ccode\u003Egoogle_pay\u003C/code\u003E card wallet, this hash contains details about the wallet."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"subspec":{},"object_type":"google_pay"},"masterpass":{"name":"masterpass","check":"hash","validation":"hash","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"If this is a `masterpass` card wallet, this hash contains details about the wallet.","undocumented":false,"html":"If this is a \u003Ccode\u003Emasterpass\u003C/code\u003E card wallet, this hash contains details about the wallet."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"subspec":{"billing_address":{"name":"billing_address","check":"hash","validation":"hash","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"Owner's verified billing address. Values are verified or provided by the wallet directly (if supported) at the time of authorization or settlement. They cannot be set or mutated.","undocumented":false,"html":"Owner’s verified billing address. Values are verified or provided by the wallet directly (if supported) at the time of authorization or settlement. They cannot be set or mutated."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"subspec":{"city":{"name":"city","check":"string","validation":"string","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"City, district, suburb, town, or village.","undocumented":false,"html":"City, district, suburb, town, or village."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"object_type":"city"},"country":{"name":"country","check":"string","validation":"string","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)).","undocumented":false,"html":"Two-letter country code (\u003Ca href=\"https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2\"\u003EISO 3166-1 alpha-2\u003C/a\u003E)."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"object_type":"country"},"line1":{"name":"line1","check":"string","validation":"string","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"Address line 1 (e.g., street, PO Box, or company name).","undocumented":false,"html":"Address line 1 (e.g., street, PO Box, or company name)."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"object_type":"line1"},"line2":{"name":"line2","check":"string","validation":"string","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"Address line 2 (e.g., apartment, suite, unit, or building).","undocumented":false,"html":"Address line 2 (e.g., apartment, suite, unit, or building)."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"object_type":"line2"},"postal_code":{"name":"postal_code","check":"string","validation":"string","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"ZIP or postal code.","undocumented":false,"html":"ZIP or postal code."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"object_type":"postal_code"},"state":{"name":"state","check":"string","validation":"string","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"State, county, province, or region.","undocumented":false,"html":"State, county, province, or region."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"object_type":"state"}},"object_type":"billing_address"},"email":{"name":"email","check":"string","validation":"string","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"Owner's verified email. Values are verified or provided by the wallet directly (if supported) at the time of authorization or settlement. They cannot be set or mutated.","undocumented":false,"html":"Owner’s verified email. Values are verified or provided by the wallet directly (if supported) at the time of authorization or settlement. They cannot be set or mutated."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"object_type":"email"},"name":{"name":"name","check":"string","validation":"string","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"Owner's verified full name. Values are verified or provided by the wallet directly (if supported) at the time of authorization or settlement. They cannot be set or mutated.","undocumented":false,"html":"Owner’s verified full name. Values are verified or provided by the wallet directly (if supported) at the time of authorization or settlement. They cannot be set or mutated."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"object_type":"name"},"shipping_address":{"name":"shipping_address","check":"hash","validation":"hash","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"Owner's verified shipping address. Values are verified or provided by the wallet directly (if supported) at the time of authorization or settlement. They cannot be set or mutated.","undocumented":false,"html":"Owner’s verified shipping address. Values are verified or provided by the wallet directly (if supported) at the time of authorization or settlement. They cannot be set or mutated."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"subspec":{"city":{"name":"city","check":"string","validation":"string","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"City, district, suburb, town, or village.","undocumented":false,"html":"City, district, suburb, town, or village."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"object_type":"city"},"country":{"name":"country","check":"string","validation":"string","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)).","undocumented":false,"html":"Two-letter country code (\u003Ca href=\"https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2\"\u003EISO 3166-1 alpha-2\u003C/a\u003E)."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"object_type":"country"},"line1":{"name":"line1","check":"string","validation":"string","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"Address line 1 (e.g., street, PO Box, or company name).","undocumented":false,"html":"Address line 1 (e.g., street, PO Box, or company name)."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"object_type":"line1"},"line2":{"name":"line2","check":"string","validation":"string","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"Address line 2 (e.g., apartment, suite, unit, or building).","undocumented":false,"html":"Address line 2 (e.g., apartment, suite, unit, or building)."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"object_type":"line2"},"postal_code":{"name":"postal_code","check":"string","validation":"string","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"ZIP or postal code.","undocumented":false,"html":"ZIP or postal code."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"object_type":"postal_code"},"state":{"name":"state","check":"string","validation":"string","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"State, county, province, or region.","undocumented":false,"html":"State, county, province, or region."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"object_type":"state"}},"object_type":"shipping_address"}},"object_type":"masterpass"},"samsung_pay":{"name":"samsung_pay","check":"hash","validation":"hash","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"If this is a `samsung_pay` card wallet, this hash contains details about the wallet.","undocumented":false,"html":"If this is a \u003Ccode\u003Esamsung_pay\u003C/code\u003E card wallet, this hash contains details about the wallet."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"subspec":{},"object_type":"samsung_pay"},"type":{"name":"type","check":"string","validation":"string","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"The type of the card wallet, one of `amex_express_checkout`, `apple_pay`, `google_pay`, `masterpass`, `samsung_pay`, or `visa_checkout`. An additional hash is included on the Wallet subhash with a name matching this value. It contains additional information specific to the card wallet type.","undocumented":false,"html":"The type of the card wallet, one of \u003Ccode\u003Eamex_express_checkout\u003C/code\u003E, \u003Ccode\u003Eapple_pay\u003C/code\u003E, \u003Ccode\u003Egoogle_pay\u003C/code\u003E, \u003Ccode\u003Emasterpass\u003C/code\u003E, \u003Ccode\u003Esamsung_pay\u003C/code\u003E, or \u003Ccode\u003Evisa_checkout\u003C/code\u003E. An additional hash is included on the Wallet subhash with a name matching this value. It contains additional information specific to the card wallet type."},"gate":false,"hide_unset_desc":null,"required":true,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"object_type":"type"},"visa_checkout":{"name":"visa_checkout","check":"hash","validation":"hash","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"If this is a `visa_checkout` card wallet, this hash contains details about the wallet.","undocumented":false,"html":"If this is a \u003Ccode\u003Evisa_checkout\u003C/code\u003E card wallet, this hash contains details about the wallet."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"subspec":{"billing_address":{"name":"billing_address","check":"hash","validation":"hash","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"Owner's verified billing address. Values are verified or provided by the wallet directly (if supported) at the time of authorization or settlement. They cannot be set or mutated.","undocumented":false,"html":"Owner’s verified billing address. Values are verified or provided by the wallet directly (if supported) at the time of authorization or settlement. They cannot be set or mutated."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"subspec":{"city":{"name":"city","check":"string","validation":"string","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"City, district, suburb, town, or village.","undocumented":false,"html":"City, district, suburb, town, or village."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"object_type":"city"},"country":{"name":"country","check":"string","validation":"string","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)).","undocumented":false,"html":"Two-letter country code (\u003Ca href=\"https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2\"\u003EISO 3166-1 alpha-2\u003C/a\u003E)."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"object_type":"country"},"line1":{"name":"line1","check":"string","validation":"string","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"Address line 1 (e.g., street, PO Box, or company name).","undocumented":false,"html":"Address line 1 (e.g., street, PO Box, or company name)."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"object_type":"line1"},"line2":{"name":"line2","check":"string","validation":"string","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"Address line 2 (e.g., apartment, suite, unit, or building).","undocumented":false,"html":"Address line 2 (e.g., apartment, suite, unit, or building)."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"object_type":"line2"},"postal_code":{"name":"postal_code","check":"string","validation":"string","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"ZIP or postal code.","undocumented":false,"html":"ZIP or postal code."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"object_type":"postal_code"},"state":{"name":"state","check":"string","validation":"string","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"State, county, province, or region.","undocumented":false,"html":"State, county, province, or region."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"object_type":"state"}},"object_type":"billing_address"},"email":{"name":"email","check":"string","validation":"string","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"Owner's verified email. Values are verified or provided by the wallet directly (if supported) at the time of authorization or settlement. They cannot be set or mutated.","undocumented":false,"html":"Owner’s verified email. Values are verified or provided by the wallet directly (if supported) at the time of authorization or settlement. They cannot be set or mutated."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"object_type":"email"},"name":{"name":"name","check":"string","validation":"string","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"Owner's verified full name. Values are verified or provided by the wallet directly (if supported) at the time of authorization or settlement. They cannot be set or mutated.","undocumented":false,"html":"Owner’s verified full name. Values are verified or provided by the wallet directly (if supported) at the time of authorization or settlement. They cannot be set or mutated."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"object_type":"name"},"shipping_address":{"name":"shipping_address","check":"hash","validation":"hash","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"Owner's verified shipping address. Values are verified or provided by the wallet directly (if supported) at the time of authorization or settlement. They cannot be set or mutated.","undocumented":false,"html":"Owner’s verified shipping address. Values are verified or provided by the wallet directly (if supported) at the time of authorization or settlement. They cannot be set or mutated."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"subspec":{"city":{"name":"city","check":"string","validation":"string","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"City, district, suburb, town, or village.","undocumented":false,"html":"City, district, suburb, town, or village."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"object_type":"city"},"country":{"name":"country","check":"string","validation":"string","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)).","undocumented":false,"html":"Two-letter country code (\u003Ca href=\"https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2\"\u003EISO 3166-1 alpha-2\u003C/a\u003E)."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"object_type":"country"},"line1":{"name":"line1","check":"string","validation":"string","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"Address line 1 (e.g., street, PO Box, or company name).","undocumented":false,"html":"Address line 1 (e.g., street, PO Box, or company name)."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"object_type":"line1"},"line2":{"name":"line2","check":"string","validation":"string","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"Address line 2 (e.g., apartment, suite, unit, or building).","undocumented":false,"html":"Address line 2 (e.g., apartment, suite, unit, or building)."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"object_type":"line2"},"postal_code":{"name":"postal_code","check":"string","validation":"string","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"ZIP or postal code.","undocumented":false,"html":"ZIP or postal code."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"object_type":"postal_code"},"state":{"name":"state","check":"string","validation":"string","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"State, county, province, or region.","undocumented":false,"html":"State, county, province, or region."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"object_type":"state"}},"object_type":"shipping_address"}},"object_type":"visa_checkout"}},"object_type":"wallet"}},"object_type":"card","less_common":true},"card_present":{"name":"card_present","check":"hash","validation":"hash","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"If this is a `card_present` PaymentMethod, this hash contains details about the Card Present payment method.","undocumented":false,"html":"If this is a \u003Ccode\u003Ecard_present\u003C/code\u003E PaymentMethod, this hash contains details about the Card Present payment method."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"subspec":{"brand":{"name":"brand","check":"string","validation":"string","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"Card brand. Can be `amex`, `diners`, `discover`, `jcb`, `mastercard`, `unionpay`, `visa`, or `unknown`.","undocumented":false,"html":"Card brand. Can be \u003Ccode\u003Eamex\u003C/code\u003E, \u003Ccode\u003Ediners\u003C/code\u003E, \u003Ccode\u003Ediscover\u003C/code\u003E, \u003Ccode\u003Ejcb\u003C/code\u003E, \u003Ccode\u003Emastercard\u003C/code\u003E, \u003Ccode\u003Eunionpay\u003C/code\u003E, \u003Ccode\u003Evisa\u003C/code\u003E, or \u003Ccode\u003Eunknown\u003C/code\u003E."},"gate":true,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"object_type":"brand"},"cardholder_name":{"name":"cardholder_name","check":"string","validation":"string","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"The cardholder name as read from the card, in [ISO 7813](https://en.wikipedia.org/wiki/ISO/IEC_7813) format. May include alphanumeric characters, special characters and first/last name separator (`/`). In some cases, the cardholder name may not be available depending on how the issuer has configured the card. Cardholder name is typically not available on swipe or contactless payments, such as those made with Apple Pay and Google Pay.","undocumented":false,"html":"The cardholder name as read from the card, in \u003Ca href=\"https://en.wikipedia.org/wiki/ISO/IEC_7813\"\u003EISO 7813\u003C/a\u003E format. May include alphanumeric characters, special characters and first/last name separator (\u003Ccode\u003E/\u003C/code\u003E). In some cases, the cardholder name may not be available depending on how the issuer has configured the card. Cardholder name is typically not available on swipe or contactless payments, such as those made with Apple Pay and Google Pay."},"gate":true,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"object_type":"cardholder_name"},"country":{"name":"country","check":"string","validation":"string","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"Two-letter ISO code representing the country of the card. You could use this attribute to get a sense of the international breakdown of cards you've collected.","undocumented":false,"html":"Two-letter ISO code representing the country of the card. You could use this attribute to get a sense of the international breakdown of cards you’ve collected."},"gate":true,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"object_type":"country"},"exp_month":{"name":"exp_month","check":"integer","validation":"integer","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"Two-digit number representing the card's expiration month.","undocumented":false,"html":"Two-digit number representing the card’s expiration month."},"gate":true,"hide_unset_desc":null,"required":true,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"object_type":"exp_month"},"exp_year":{"name":"exp_year","check":"integer","validation":"integer","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"Four-digit number representing the card's expiration year.","undocumented":false,"html":"Four-digit number representing the card’s expiration year."},"gate":true,"hide_unset_desc":null,"required":true,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"object_type":"exp_year"},"fingerprint":{"name":"fingerprint","check":"string","validation":"string","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"Uniquely identifies this particular card number. You can use this attribute to check whether two customers who’ve signed up with you are using the same card number, for example. For payment methods that tokenize card information (Apple Pay, Google Pay), the tokenized number might be provided instead of the underlying card number.\n\n*Starting May 1, 2021, card fingerprint in India for Connect will change to allow two fingerprints for the same card --- one for India and one for the rest of the world.*\n","undocumented":false,"html":"Uniquely identifies this particular card number. You can use this attribute to check whether two customers who’ve signed up with you are using the same card number, for example. For payment methods that tokenize card information (Apple Pay, Google Pay), the tokenized number might be provided instead of the underlying card number.\u003C/p\u003E\n\n\u003Cp\u003E\u003Cem\u003EStarting May 1, 2021, card fingerprint in India for Connect will change to allow two fingerprints for the same card — one for India and one for the rest of the world.\u003C/em\u003E"},"gate":true,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"object_type":"fingerprint"},"funding":{"name":"funding","check":"string","validation":"string","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"Card funding type. Can be `credit`, `debit`, `prepaid`, or `unknown`.","undocumented":false,"html":"Card funding type. Can be \u003Ccode\u003Ecredit\u003C/code\u003E, \u003Ccode\u003Edebit\u003C/code\u003E, \u003Ccode\u003Eprepaid\u003C/code\u003E, or \u003Ccode\u003Eunknown\u003C/code\u003E."},"gate":true,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"object_type":"funding"},"last4":{"name":"last4","check":"string","validation":"string","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"The last four digits of the card.","undocumented":false,"html":"The last four digits of the card."},"gate":true,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"object_type":"last4"},"networks":{"name":"networks","check":"hash","validation":"hash","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"Contains information about card networks that can be used to process the payment.","undocumented":false,"html":"Contains information about card networks that can be used to process the payment."},"gate":true,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"subspec":{"available":{"name":"available","check":"string_array","validation":"array containing strings","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"All available networks for the card.","undocumented":false,"html":"All available networks for the card."},"gate":false,"hide_unset_desc":null,"required":true,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"object_type":"available"},"preferred":{"name":"preferred","check":"string","validation":"string","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"The preferred network for the card.","undocumented":false,"html":"The preferred network for the card."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"object_type":"preferred"}},"object_type":"networks"},"read_method":{"name":"read_method","check":"string","validation":"string","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"How card details were read in this transaction.","undocumented":false,"html":"How card details were read in this transaction."},"gate":true,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"enum_values":{"contact_emv":{"documentation":{"gate_specific":{},"localize_terms":[],"markdown":"Inserting a chip card into the card reader.","undocumented":false,"html":"Inserting a chip card into the card reader."}},"contactless_emv":{"documentation":{"gate_specific":{},"localize_terms":[],"markdown":"Tapping a contactless-enabled chip card or mobile wallet.","undocumented":false,"html":"Tapping a contactless-enabled chip card or mobile wallet."}},"magnetic_stripe_track2":{"documentation":{"gate_specific":{},"localize_terms":[],"markdown":"Swiping a card using the magnetic stripe reader.","undocumented":false,"html":"Swiping a card using the magnetic stripe reader."}},"magnetic_stripe_fallback":{"documentation":{"gate_specific":{},"localize_terms":[],"markdown":"When inserting a chip card fails three times in a row, fallback to a magnetic stripe read.","undocumented":false,"html":"When inserting a chip card fails three times in a row, fallback to a magnetic stripe read."}},"contactless_magstripe_mode":{"documentation":{"gate_specific":{},"localize_terms":[],"markdown":"Older standard for contactless payments that emulated a magnetic stripe read.","undocumented":false,"html":"Older standard for contactless payments that emulated a magnetic stripe read."}}},"object_type":"read_method"}},"object_type":"card_present","less_common":true},"created":{"name":"created","check":"timestamp","validation":"timestamp","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"Time at which the object was created. Measured in seconds since the Unix epoch.","undocumented":false,"html":"Time at which the object was created. Measured in seconds since the Unix epoch."},"gate":false,"hide_unset_desc":null,"required":true,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"object_type":"created","less_common":true},"customer":{"name":"customer","check":"string","validation":"string","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"The ID of the Customer to which this PaymentMethod is saved. This will not be set when the PaymentMethod has not been saved to a Customer.","undocumented":false,"html":"The ID of the Customer to which this PaymentMethod is saved. This will not be set when the PaymentMethod has not been saved to a Customer."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"user_expandable":["customer"],"object_type":"customer"},"customer_balance":{"name":"customer_balance","check":"hash","validation":"hash","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"If this is a `customer_balance` PaymentMethod, this hash contains details about the CustomerBalance payment method.","undocumented":false,"html":"If this is a \u003Ccode\u003Ecustomer_balance\u003C/code\u003E PaymentMethod, this hash contains details about the CustomerBalance payment method."},"gate":true,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"subspec":{},"object_type":"customer_balance","less_common":true},"eps":{"name":"eps","check":"hash","validation":"hash","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"If this is an `eps` PaymentMethod, this hash contains details about the EPS payment method.","undocumented":false,"html":"If this is an \u003Ccode\u003Eeps\u003C/code\u003E PaymentMethod, this hash contains details about the EPS payment method."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"subspec":{"bank":{"name":"bank","check":"string","validation":"string","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"The customer's bank. Should be one of `arzte_und_apotheker_bank`, `austrian_anadi_bank_ag`, `bank_austria`, `bankhaus_carl_spangler`, `bankhaus_schelhammer_und_schattera_ag`, `bawag_psk_ag`, `bks_bank_ag`, `brull_kallmus_bank_ag`, `btv_vier_lander_bank`, `capital_bank_grawe_gruppe_ag`, `deutsche_bank_ag`, `dolomitenbank`, `easybank_ag`, `erste_bank_und_sparkassen`, `hypo_alpeadriabank_international_ag`, `hypo_noe_lb_fur_niederosterreich_u_wien`, `hypo_oberosterreich_salzburg_steiermark`, `hypo_tirol_bank_ag`, `hypo_vorarlberg_bank_ag`, `hypo_bank_burgenland_aktiengesellschaft`, `marchfelder_bank`, `oberbank_ag`, `raiffeisen_bankengruppe_osterreich`, `schoellerbank_ag`, `sparda_bank_wien`, `volksbank_gruppe`, `volkskreditbank_ag`, or `vr_bank_braunau`.","undocumented":false,"html":"The customer’s bank. Should be one of \u003Ccode\u003Earzte_und_apotheker_bank\u003C/code\u003E, \u003Ccode\u003Eaustrian_anadi_bank_ag\u003C/code\u003E, \u003Ccode\u003Ebank_austria\u003C/code\u003E, \u003Ccode\u003Ebankhaus_carl_spangler\u003C/code\u003E, \u003Ccode\u003Ebankhaus_schelhammer_und_schattera_ag\u003C/code\u003E, \u003Ccode\u003Ebawag_psk_ag\u003C/code\u003E, \u003Ccode\u003Ebks_bank_ag\u003C/code\u003E, \u003Ccode\u003Ebrull_kallmus_bank_ag\u003C/code\u003E, \u003Ccode\u003Ebtv_vier_lander_bank\u003C/code\u003E, \u003Ccode\u003Ecapital_bank_grawe_gruppe_ag\u003C/code\u003E, \u003Ccode\u003Edeutsche_bank_ag\u003C/code\u003E, \u003Ccode\u003Edolomitenbank\u003C/code\u003E, \u003Ccode\u003Eeasybank_ag\u003C/code\u003E, \u003Ccode\u003Eerste_bank_und_sparkassen\u003C/code\u003E, \u003Ccode\u003Ehypo_alpeadriabank_international_ag\u003C/code\u003E, \u003Ccode\u003Ehypo_noe_lb_fur_niederosterreich_u_wien\u003C/code\u003E, \u003Ccode\u003Ehypo_oberosterreich_salzburg_steiermark\u003C/code\u003E, \u003Ccode\u003Ehypo_tirol_bank_ag\u003C/code\u003E, \u003Ccode\u003Ehypo_vorarlberg_bank_ag\u003C/code\u003E, \u003Ccode\u003Ehypo_bank_burgenland_aktiengesellschaft\u003C/code\u003E, \u003Ccode\u003Emarchfelder_bank\u003C/code\u003E, \u003Ccode\u003Eoberbank_ag\u003C/code\u003E, \u003Ccode\u003Eraiffeisen_bankengruppe_osterreich\u003C/code\u003E, \u003Ccode\u003Eschoellerbank_ag\u003C/code\u003E, \u003Ccode\u003Esparda_bank_wien\u003C/code\u003E, \u003Ccode\u003Evolksbank_gruppe\u003C/code\u003E, \u003Ccode\u003Evolkskreditbank_ag\u003C/code\u003E, or \u003Ccode\u003Evr_bank_braunau\u003C/code\u003E."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"object_type":"bank"}},"object_type":"eps","less_common":true},"fpx":{"name":"fpx","check":"hash","validation":"hash","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"If this is an `fpx` PaymentMethod, this hash contains details about the FPX payment method.","undocumented":false,"html":"If this is an \u003Ccode\u003Efpx\u003C/code\u003E PaymentMethod, this hash contains details about the FPX payment method."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"subspec":{"bank":{"name":"bank","check":"string","validation":"string","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"The customer's bank, if provided. Can be one of `affin_bank`, `agrobank`, `alliance_bank`, `ambank`, `bank_islam`, `bank_muamalat`, `bank_rakyat`, `bsn`, `cimb`, `hong_leong_bank`, `hsbc`, `kfh`, `maybank2u`, `ocbc`, `public_bank`, `rhb`, `standard_chartered`, `uob`, `deutsche_bank`, `maybank2e`, `pb_enterprise`, or `bank_of_china`.","undocumented":false,"html":"The customer’s bank, if provided. Can be one of \u003Ccode\u003Eaffin_bank\u003C/code\u003E, \u003Ccode\u003Eagrobank\u003C/code\u003E, \u003Ccode\u003Ealliance_bank\u003C/code\u003E, \u003Ccode\u003Eambank\u003C/code\u003E, \u003Ccode\u003Ebank_islam\u003C/code\u003E, \u003Ccode\u003Ebank_muamalat\u003C/code\u003E, \u003Ccode\u003Ebank_rakyat\u003C/code\u003E, \u003Ccode\u003Ebsn\u003C/code\u003E, \u003Ccode\u003Ecimb\u003C/code\u003E, \u003Ccode\u003Ehong_leong_bank\u003C/code\u003E, \u003Ccode\u003Ehsbc\u003C/code\u003E, \u003Ccode\u003Ekfh\u003C/code\u003E, \u003Ccode\u003Emaybank2u\u003C/code\u003E, \u003Ccode\u003Eocbc\u003C/code\u003E, \u003Ccode\u003Epublic_bank\u003C/code\u003E, \u003Ccode\u003Erhb\u003C/code\u003E, \u003Ccode\u003Estandard_chartered\u003C/code\u003E, \u003Ccode\u003Euob\u003C/code\u003E, \u003Ccode\u003Edeutsche_bank\u003C/code\u003E, \u003Ccode\u003Emaybank2e\u003C/code\u003E, \u003Ccode\u003Epb_enterprise\u003C/code\u003E, or \u003Ccode\u003Ebank_of_china\u003C/code\u003E."},"gate":false,"hide_unset_desc":null,"required":true,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"object_type":"bank"}},"object_type":"fpx","less_common":true},"giropay":{"name":"giropay","check":"hash","validation":"hash","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"If this is a `giropay` PaymentMethod, this hash contains details about the Giropay payment method.","undocumented":false,"html":"If this is a \u003Ccode\u003Egiropay\u003C/code\u003E PaymentMethod, this hash contains details about the Giropay payment method."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"subspec":{},"object_type":"giropay","less_common":true},"grabpay":{"name":"grabpay","check":"hash","validation":"hash","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"If this is a `grabpay` PaymentMethod, this hash contains details about the GrabPay payment method.","undocumented":false,"html":"If this is a \u003Ccode\u003Egrabpay\u003C/code\u003E PaymentMethod, this hash contains details about the GrabPay payment method."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"subspec":{},"object_type":"grabpay","less_common":true},"ideal":{"name":"ideal","check":"hash","validation":"hash","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"If this is an `ideal` PaymentMethod, this hash contains details about the iDEAL payment method.","undocumented":false,"html":"If this is an \u003Ccode\u003Eideal\u003C/code\u003E PaymentMethod, this hash contains details about the iDEAL payment method."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"subspec":{"bank":{"name":"bank","check":"string","validation":"string","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"The customer's bank, if provided. Can be one of `abn_amro`, `asn_bank`, `bunq`, `handelsbanken`, `ing`, `knab`, `moneyou`, `rabobank`, `regiobank`, `revolut`, `sns_bank`, `triodos_bank`, `van_lanschot`, or `yoursafe`.","undocumented":false,"html":"The customer’s bank, if provided. Can be one of \u003Ccode\u003Eabn_amro\u003C/code\u003E, \u003Ccode\u003Easn_bank\u003C/code\u003E, \u003Ccode\u003Ebunq\u003C/code\u003E, \u003Ccode\u003Ehandelsbanken\u003C/code\u003E, \u003Ccode\u003Eing\u003C/code\u003E, \u003Ccode\u003Eknab\u003C/code\u003E, \u003Ccode\u003Emoneyou\u003C/code\u003E, \u003Ccode\u003Erabobank\u003C/code\u003E, \u003Ccode\u003Eregiobank\u003C/code\u003E, \u003Ccode\u003Erevolut\u003C/code\u003E, \u003Ccode\u003Esns_bank\u003C/code\u003E, \u003Ccode\u003Etriodos_bank\u003C/code\u003E, \u003Ccode\u003Evan_lanschot\u003C/code\u003E, or \u003Ccode\u003Eyoursafe\u003C/code\u003E."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"object_type":"bank"},"bic":{"name":"bic","check":"string","validation":"string","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"The Bank Identifier Code of the customer's bank, if the bank was provided.","undocumented":false,"html":"The Bank Identifier Code of the customer’s bank, if the bank was provided."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"object_type":"bic"}},"object_type":"ideal","less_common":true},"interac_present":{"name":"interac_present","check":"hash","validation":"hash","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"If this is an `interac_present` PaymentMethod, this hash contains details about the Interac Present payment method.","undocumented":false,"html":"If this is an \u003Ccode\u003Einterac_present\u003C/code\u003E PaymentMethod, this hash contains details about the Interac Present payment method."},"gate":true,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"subspec":{"brand":{"name":"brand","check":"string","validation":"string","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"Card brand. Can be `interac`, `mastercard` or `visa`.","undocumented":false,"html":"Card brand. Can be \u003Ccode\u003Einterac\u003C/code\u003E, \u003Ccode\u003Emastercard\u003C/code\u003E or \u003Ccode\u003Evisa\u003C/code\u003E."},"gate":true,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"object_type":"brand"},"cardholder_name":{"name":"cardholder_name","check":"string","validation":"string","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"The cardholder name as read from the card, in [ISO 7813](https://en.wikipedia.org/wiki/ISO/IEC_7813) format. May include alphanumeric characters, special characters and first/last name separator (`/`). In some cases, the cardholder name may not be available depending on how the issuer has configured the card. Cardholder name is typically not available on swipe or contactless payments, such as those made with Apple Pay and Google Pay.","undocumented":false,"html":"The cardholder name as read from the card, in \u003Ca href=\"https://en.wikipedia.org/wiki/ISO/IEC_7813\"\u003EISO 7813\u003C/a\u003E format. May include alphanumeric characters, special characters and first/last name separator (\u003Ccode\u003E/\u003C/code\u003E). In some cases, the cardholder name may not be available depending on how the issuer has configured the card. Cardholder name is typically not available on swipe or contactless payments, such as those made with Apple Pay and Google Pay."},"gate":true,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"object_type":"cardholder_name"},"country":{"name":"country","check":"string","validation":"string","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"Two-letter ISO code representing the country of the card. You could use this attribute to get a sense of the international breakdown of cards you've collected.","undocumented":false,"html":"Two-letter ISO code representing the country of the card. You could use this attribute to get a sense of the international breakdown of cards you’ve collected."},"gate":true,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"object_type":"country"},"exp_month":{"name":"exp_month","check":"integer","validation":"integer","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"Two-digit number representing the card's expiration month.","undocumented":false,"html":"Two-digit number representing the card’s expiration month."},"gate":true,"hide_unset_desc":null,"required":true,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"object_type":"exp_month"},"exp_year":{"name":"exp_year","check":"integer","validation":"integer","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"Four-digit number representing the card's expiration year.","undocumented":false,"html":"Four-digit number representing the card’s expiration year."},"gate":true,"hide_unset_desc":null,"required":true,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"object_type":"exp_year"},"fingerprint":{"name":"fingerprint","check":"string","validation":"string","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"Uniquely identifies this particular card number. You can use this attribute to check whether two customers who’ve signed up with you are using the same card number, for example. For payment methods that tokenize card information (Apple Pay, Google Pay), the tokenized number might be provided instead of the underlying card number.\n\n*Starting May 1, 2021, card fingerprint in India for Connect will change to allow two fingerprints for the same card --- one for India and one for the rest of the world.*\n","undocumented":false,"html":"Uniquely identifies this particular card number. You can use this attribute to check whether two customers who’ve signed up with you are using the same card number, for example. For payment methods that tokenize card information (Apple Pay, Google Pay), the tokenized number might be provided instead of the underlying card number.\u003C/p\u003E\n\n\u003Cp\u003E\u003Cem\u003EStarting May 1, 2021, card fingerprint in India for Connect will change to allow two fingerprints for the same card — one for India and one for the rest of the world.\u003C/em\u003E"},"gate":true,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"object_type":"fingerprint"},"funding":{"name":"funding","check":"string","validation":"string","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"Card funding type. Can be `credit`, `debit`, `prepaid`, or `unknown`.","undocumented":false,"html":"Card funding type. Can be \u003Ccode\u003Ecredit\u003C/code\u003E, \u003Ccode\u003Edebit\u003C/code\u003E, \u003Ccode\u003Eprepaid\u003C/code\u003E, or \u003Ccode\u003Eunknown\u003C/code\u003E."},"gate":true,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"object_type":"funding"},"last4":{"name":"last4","check":"string","validation":"string","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"The last four digits of the card.","undocumented":false,"html":"The last four digits of the card."},"gate":true,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"object_type":"last4"},"networks":{"name":"networks","check":"hash","validation":"hash","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"Contains information about card networks that can be used to process the payment.","undocumented":false,"html":"Contains information about card networks that can be used to process the payment."},"gate":true,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"subspec":{"available":{"name":"available","check":"string_array","validation":"array containing strings","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"All available networks for the card.","undocumented":false,"html":"All available networks for the card."},"gate":false,"hide_unset_desc":null,"required":true,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"object_type":"available"},"preferred":{"name":"preferred","check":"string","validation":"string","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"The preferred network for the card.","undocumented":false,"html":"The preferred network for the card."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"object_type":"preferred"}},"object_type":"networks"},"preferred_locales":{"name":"preferred_locales","check":"string_array","validation":"array containing strings","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"EMV tag 5F2D. Preferred languages specified by the integrated circuit chip.","undocumented":false,"html":"EMV tag 5F2D. Preferred languages specified by the integrated circuit chip."},"gate":true,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"object_type":"preferred_locales"},"read_method":{"name":"read_method","check":"string","validation":"string","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"How card details were read in this transaction.","undocumented":false,"html":"How card details were read in this transaction."},"gate":true,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"enum_values":{"contact_emv":{"documentation":{"gate_specific":{},"localize_terms":[],"markdown":"Inserting a chip card into the card reader.","undocumented":false,"html":"Inserting a chip card into the card reader."}},"contactless_emv":{"documentation":{"gate_specific":{},"localize_terms":[],"markdown":"Tapping a contactless-enabled chip card or mobile wallet.","undocumented":false,"html":"Tapping a contactless-enabled chip card or mobile wallet."}},"magnetic_stripe_track2":{"documentation":{"gate_specific":{},"localize_terms":[],"markdown":"Swiping a card using the magnetic stripe reader.","undocumented":false,"html":"Swiping a card using the magnetic stripe reader."}},"magnetic_stripe_fallback":{"documentation":{"gate_specific":{},"localize_terms":[],"markdown":"When inserting a chip card fails three times in a row, fallback to a magnetic stripe read.","undocumented":false,"html":"When inserting a chip card fails three times in a row, fallback to a magnetic stripe read."}},"contactless_magstripe_mode":{"documentation":{"gate_specific":{},"localize_terms":[],"markdown":"Older standard for contactless payments that emulated a magnetic stripe read.","undocumented":false,"html":"Older standard for contactless payments that emulated a magnetic stripe read."}}},"object_type":"read_method"}},"object_type":"interac_present","less_common":true},"klarna":{"name":"klarna","check":"hash","validation":"hash","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"If this is a `klarna` PaymentMethod, this hash contains details about the Klarna payment method.","undocumented":false,"html":"If this is a \u003Ccode\u003Eklarna\u003C/code\u003E PaymentMethod, this hash contains details about the Klarna payment method."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"subspec":{"dob":{"name":"dob","check":"hash","validation":"hash","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"The customer's date of birth, if provided.","undocumented":false,"html":"The customer’s date of birth, if provided."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":true,"subspec":{"day":{"name":"day","check":"positive_integer","validation":"positive integer","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"The day of birth, between 1 and 31.","undocumented":false,"html":"The day of birth, between 1 and 31."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"object_type":"day"},"month":{"name":"month","check":"positive_integer","validation":"positive integer","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"The month of birth, between 1 and 12.","undocumented":false,"html":"The month of birth, between 1 and 12."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"object_type":"month"},"year":{"name":"year","check":"positive_integer","validation":"positive integer","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"The four-digit year of birth.","undocumented":false,"html":"The four-digit year of birth."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"object_type":"year"}},"object_type":"dob"}},"object_type":"klarna","less_common":true},"konbini":{"name":"konbini","check":"hash","validation":"hash","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"If this is a `konbini` PaymentMethod, this hash contains details about the Konbini payment method.","undocumented":false,"html":"If this is a \u003Ccode\u003Ekonbini\u003C/code\u003E PaymentMethod, this hash contains details about the Konbini payment method."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"subspec":{},"object_type":"konbini","less_common":true},"link":{"name":"link","check":"hash","validation":"hash","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"If this is an `Link` PaymentMethod, this hash contains details about the Link payment method.","undocumented":false,"html":"If this is an \u003Ccode\u003ELink\u003C/code\u003E PaymentMethod, this hash contains details about the Link payment method."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"subspec":{"email":{"name":"email","check":"string","validation":"string","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"Account owner's email address.","undocumented":false,"html":"Account owner’s email address."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"object_type":"email"},"persistent_token":{"name":"persistent_token","check":"string","validation":"string","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"Token used for persistent Link logins.","undocumented":false,"html":"Token used for persistent Link logins."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"object_type":"persistent_token"}},"object_type":"link","less_common":true},"livemode":{"name":"livemode","check":"boolean","validation":"boolean","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode.","undocumented":false,"html":"Has the value \u003Ccode\u003Etrue\u003C/code\u003E if the object exists in live mode or the value \u003Ccode\u003Efalse\u003C/code\u003E if the object exists in test mode."},"gate":false,"hide_unset_desc":null,"required":true,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"object_type":"livemode","less_common":true},"metadata":{"name":"metadata","check":"hash","validation":"hash","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"Set of [key-value pairs](/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format.","undocumented":false,"html":"Set of \u003Ca href=\"/docs/api/metadata\"\u003Ekey-value pairs\u003C/a\u003E that you can attach to an object. This can be useful for storing additional information about the object in a structured format."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"object_type":"metadata"},"oxxo":{"name":"oxxo","check":"hash","validation":"hash","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"If this is an `oxxo` PaymentMethod, this hash contains details about the OXXO payment method.","undocumented":false,"html":"If this is an \u003Ccode\u003Eoxxo\u003C/code\u003E PaymentMethod, this hash contains details about the OXXO payment method."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"subspec":{},"object_type":"oxxo","less_common":true},"p24":{"name":"p24","check":"hash","validation":"hash","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"If this is a `p24` PaymentMethod, this hash contains details about the P24 payment method.","undocumented":false,"html":"If this is a \u003Ccode\u003Ep24\u003C/code\u003E PaymentMethod, this hash contains details about the P24 payment method."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"subspec":{"bank":{"name":"bank","check":"string","validation":"string","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"The customer's bank, if provided.","undocumented":false,"html":"The customer’s bank, if provided."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"enum_values":{"ing":{"documentation":null},"citi_handlowy":{"documentation":null},"tmobile_usbugi_bankowe":{"documentation":null},"plus_bank":{"documentation":null},"etransfer_pocztowy24":{"documentation":null},"banki_spbdzielcze":{"documentation":null},"bank_nowy_bfg_sa":{"documentation":null},"getin_bank":{"documentation":null},"blik":{"documentation":null},"noble_pay":{"documentation":null},"ideabank":{"documentation":null},"envelobank":{"documentation":null},"santander_przelew24":{"documentation":null},"nest_przelew":{"documentation":null},"mbank_mtransfer":{"documentation":null},"inteligo":{"documentation":null},"pbac_z_ipko":{"documentation":null},"bnp_paribas":{"documentation":null},"credit_agricole":{"documentation":null},"toyota_bank":{"documentation":null},"bank_pekao_sa":{"documentation":null},"volkswagen_bank":{"documentation":null},"bank_millennium":{"documentation":null},"alior_bank":{"documentation":null},"boz":{"documentation":null}},"object_type":"bank"}},"object_type":"p24","less_common":true},"paynow":{"name":"paynow","check":"hash","validation":"hash","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"If this is a `paynow` PaymentMethod, this hash contains details about the PayNow payment method.","undocumented":false,"html":"If this is a \u003Ccode\u003Epaynow\u003C/code\u003E PaymentMethod, this hash contains details about the PayNow payment method."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"subspec":{},"object_type":"paynow","less_common":true},"pix":{"name":"pix","check":"hash","validation":"hash","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"If this is a `pix` PaymentMethod, this hash contains details about the Pix payment method.","undocumented":false,"html":"If this is a \u003Ccode\u003Epix\u003C/code\u003E PaymentMethod, this hash contains details about the Pix payment method."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"subspec":{},"object_type":"pix","less_common":true},"promptpay":{"name":"promptpay","check":"hash","validation":"hash","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"If this is a `promptpay` PaymentMethod, this hash contains details about the PromptPay payment method.","undocumented":false,"html":"If this is a \u003Ccode\u003Epromptpay\u003C/code\u003E PaymentMethod, this hash contains details about the PromptPay payment method."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"subspec":{},"object_type":"promptpay","less_common":true},"radar_options":{"name":"radar_options","check":"hash","validation":"hash","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"Options to configure Radar. See [Radar Session](/docs/radar/radar-session) for more information.","undocumented":false,"html":"Options to configure Radar. See \u003Ca href=\"/docs/radar/radar-session\"\u003ERadar Session\u003C/a\u003E for more information."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"subspec":{"session":{"name":"session","check":"string","validation":"string","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"A [Radar Session](/docs/radar/radar-session) is a snapshot of the browser metadata and device details that help Radar make more accurate predictions on your payments.","undocumented":false,"html":"A \u003Ca href=\"/docs/radar/radar-session\"\u003ERadar Session\u003C/a\u003E is a snapshot of the browser metadata and device details that help Radar make more accurate predictions on your payments."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"object_type":"session"}},"object_type":"radar_options","less_common":true},"sepa_debit":{"name":"sepa_debit","check":"hash","validation":"hash","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"If this is a `sepa_debit` PaymentMethod, this hash contains details about the SEPA debit bank account.","undocumented":false,"html":"If this is a \u003Ccode\u003Esepa_debit\u003C/code\u003E PaymentMethod, this hash contains details about the SEPA debit bank account."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"subspec":{"bank_code":{"name":"bank_code","check":"string","validation":"string","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"Bank code of bank associated with the bank account.","undocumented":false,"html":"Bank code of bank associated with the bank account."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"object_type":"bank_code"},"branch_code":{"name":"branch_code","check":"string","validation":"string","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"Branch code of bank associated with the bank account.","undocumented":false,"html":"Branch code of bank associated with the bank account."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"object_type":"branch_code"},"country":{"name":"country","check":"string","validation":"string","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"Two-letter ISO code representing the country the bank account is located in.","undocumented":false,"html":"Two-letter ISO code representing the country the bank account is located in."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"object_type":"country"},"fingerprint":{"name":"fingerprint","check":"string","validation":"string","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"Uniquely identifies this particular bank account. You can use this attribute to check whether two bank accounts are the same.","undocumented":false,"html":"Uniquely identifies this particular bank account. You can use this attribute to check whether two bank accounts are the same."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"object_type":"fingerprint"},"generated_from":{"name":"generated_from","check":"hash","validation":"hash","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"Information about the object that generated this PaymentMethod.","undocumented":false,"html":"Information about the object that generated this PaymentMethod."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"subspec":{"charge":{"name":"charge","check":"string","validation":"string","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"The ID of the Charge that generated this PaymentMethod, if any.","undocumented":false,"html":"The ID of the Charge that generated this PaymentMethod, if any."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"user_expandable":["charge"],"object_type":"charge"},"setup_attempt":{"name":"setup_attempt","check":"string","validation":"string","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"The ID of the SetupAttempt that generated this PaymentMethod, if any.","undocumented":false,"html":"The ID of the SetupAttempt that generated this PaymentMethod, if any."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"user_expandable":["setup_attempt"],"object_type":"setup_attempt"}},"object_type":"generated_from"},"last4":{"name":"last4","check":"string","validation":"string","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"Last four characters of the IBAN.","undocumented":false,"html":"Last four characters of the IBAN."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"object_type":"last4"}},"object_type":"sepa_debit","less_common":true},"sofort":{"name":"sofort","check":"hash","validation":"hash","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"If this is a `sofort` PaymentMethod, this hash contains details about the SOFORT payment method.","undocumented":false,"html":"If this is a \u003Ccode\u003Esofort\u003C/code\u003E PaymentMethod, this hash contains details about the SOFORT payment method."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"subspec":{"country":{"name":"country","check":"string","validation":"string","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"Two-letter ISO code representing the country the bank account is located in.","undocumented":false,"html":"Two-letter ISO code representing the country the bank account is located in."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"object_type":"country"}},"object_type":"sofort","less_common":true},"type":{"name":"type","check":"string","validation":"string","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"The type of the PaymentMethod. An additional hash is included on the PaymentMethod with a name matching this value. It contains additional information specific to the PaymentMethod type.","undocumented":false,"html":"The type of the PaymentMethod. An additional hash is included on the PaymentMethod with a name matching this value. It contains additional information specific to the PaymentMethod type."},"gate":false,"hide_unset_desc":null,"required":true,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"enum_values":{"acss_debit":{"documentation":{"gate_specific":{},"localize_terms":[],"markdown":"[Pre-authorized debit payments](/docs/payments/acss-debit) are used to debit Canadian bank accounts through the Automated Clearing Settlement System (ACSS).","undocumented":false,"html":"\u003Ca href=\"/docs/payments/acss-debit\"\u003EPre-authorized debit payments\u003C/a\u003E are used to debit Canadian bank accounts through the Automated Clearing Settlement System (ACSS)."}},"affirm":{"documentation":{"gate_specific":{},"localize_terms":[],"markdown":"[Affirm](/docs/payments/affirm) is a buy now, pay later payment method in the US.","undocumented":false,"html":"\u003Ca href=\"/docs/payments/affirm\"\u003EAffirm\u003C/a\u003E is a buy now, pay later payment method in the US."}},"afterpay_clearpay":{"documentation":{"gate_specific":{},"localize_terms":[],"markdown":"[Afterpay / Clearpay](/docs/payments/afterpay-clearpay) is a buy now, pay later payment method used in Australia, Canada, France, New Zealand, Spain, the UK, and the US.","undocumented":false,"html":"\u003Ca href=\"/docs/payments/afterpay-clearpay\"\u003EAfterpay / Clearpay\u003C/a\u003E is a buy now, pay later payment method used in Australia, Canada, France, New Zealand, Spain, the UK, and the US."}},"alipay":{"documentation":{"gate_specific":{},"localize_terms":[],"markdown":"[Alipay](/docs/payments/alipay) is a digital wallet payment method used in China.","undocumented":false,"html":"\u003Ca href=\"/docs/payments/alipay\"\u003EAlipay\u003C/a\u003E is a digital wallet payment method used in China."}},"au_becs_debit":{"documentation":{"gate_specific":{},"localize_terms":[],"markdown":"[BECS Direct Debit](/docs/payments/au-becs-debit) is used to debit Australian bank accounts through the Bulk Electronic Clearing System (BECS).","undocumented":false,"html":"\u003Ca href=\"/docs/payments/au-becs-debit\"\u003EBECS Direct Debit\u003C/a\u003E is used to debit Australian bank accounts through the Bulk Electronic Clearing System (BECS)."}},"bacs_debit":{"documentation":{"gate_specific":{},"localize_terms":[],"markdown":"[Bacs Direct Debit](/docs/payments/payment-methods/bacs-debit) is used to debit UK bank accounts.","undocumented":false,"html":"\u003Ca href=\"/docs/payments/payment-methods/bacs-debit\"\u003EBacs Direct Debit\u003C/a\u003E is used to debit UK bank accounts."}},"bancontact":{"documentation":{"gate_specific":{},"localize_terms":[],"markdown":"[Bancontact](/docs/payments/bancontact) is a bank redirect payment method used in Belgium.","undocumented":false,"html":"\u003Ca href=\"/docs/payments/bancontact\"\u003EBancontact\u003C/a\u003E is a bank redirect payment method used in Belgium."}},"blik":{"documentation":{"gate_specific":{},"localize_terms":[],"markdown":"[BLIK](/docs/payments/blik) is a single-use payment method common in Poland.","undocumented":false,"html":"\u003Ca href=\"/docs/payments/blik\"\u003EBLIK\u003C/a\u003E is a single-use payment method common in Poland."}},"boleto":{"documentation":{"gate_specific":{},"localize_terms":[],"markdown":"[Boleto](/docs/payments/boleto) is a voucher-based payment method used in Brazil.","undocumented":false,"html":"\u003Ca href=\"/docs/payments/boleto\"\u003EBoleto\u003C/a\u003E is a voucher-based payment method used in Brazil."}},"card":{"documentation":{"gate_specific":{},"localize_terms":[],"markdown":"[Card payments](/docs/payments/payment-methods/overview#cards) are supported through many networks and card brands.","undocumented":false,"html":"\u003Ca href=\"/docs/payments/payment-methods/overview#cards\"\u003ECard payments\u003C/a\u003E are supported through many networks and card brands."}},"card_present":{"documentation":{"gate_specific":{},"localize_terms":[],"markdown":"[Stripe Terminal](/docs/terminal/payments/collect-payment) is used to collect in-person card payments.","undocumented":false,"html":"\u003Ca href=\"/docs/terminal/payments/collect-payment\"\u003EStripe Terminal\u003C/a\u003E is used to collect in-person card payments."}},"customer_balance":{"documentation":{"gate_specific":{},"localize_terms":[],"markdown":"Uses a customer’s [cash balance](/docs/payments/customer-balance) for the payment.","undocumented":false,"html":"Uses a customer’s \u003Ca href=\"/docs/payments/customer-balance\"\u003Ecash balance\u003C/a\u003E for the payment."}},"eps":{"documentation":{"gate_specific":{},"localize_terms":[],"markdown":"[EPS](/docs/payments/eps) is an Austria-based bank redirect payment method.","undocumented":false,"html":"\u003Ca href=\"/docs/payments/eps\"\u003EEPS\u003C/a\u003E is an Austria-based bank redirect payment method."}},"fpx":{"documentation":{"gate_specific":{},"localize_terms":[],"markdown":"[FPX](/docs/payments/fpx) is a Malaysia-based bank redirect payment method.","undocumented":false,"html":"\u003Ca href=\"/docs/payments/fpx\"\u003EFPX\u003C/a\u003E is a Malaysia-based bank redirect payment method."}},"giropay":{"documentation":{"gate_specific":{},"localize_terms":[],"markdown":"[giropay](/docs/payments/giropay) is a German bank redirect payment method.","undocumented":false,"html":"\u003Ca href=\"/docs/payments/giropay\"\u003Egiropay\u003C/a\u003E is a German bank redirect payment method."}},"grabpay":{"documentation":{"gate_specific":{},"localize_terms":[],"markdown":"[GrabPay](/docs/payments/grabpay) is a digital wallet payment method used in Southeast Asia.","undocumented":false,"html":"\u003Ca href=\"/docs/payments/grabpay\"\u003EGrabPay\u003C/a\u003E is a digital wallet payment method used in Southeast Asia."}},"ideal":{"documentation":{"gate_specific":{},"localize_terms":[],"markdown":"[iDEAL](/docs/payments/ideal) is a Netherlands-based bank redirect payment method.","undocumented":false,"html":"\u003Ca href=\"/docs/payments/ideal\"\u003EiDEAL\u003C/a\u003E is a Netherlands-based bank redirect payment method."}},"interac_present":{"documentation":{"gate_specific":{},"localize_terms":[],"markdown":"[Stripe Terminal](/docs/terminal/payments/collect-payment) accepts [Interac](/docs/terminal/payments/regional?integration-country=CA#interac-payments) debit cards for in-person payments in Canada.","undocumented":false,"html":"\u003Ca href=\"/docs/terminal/payments/collect-payment\"\u003EStripe Terminal\u003C/a\u003E accepts \u003Ca href=\"/docs/terminal/payments/regional?integration-country=CA#interac-payments\"\u003EInterac\u003C/a\u003E debit cards for in-person payments in Canada."}},"klarna":{"documentation":{"gate_specific":{},"localize_terms":[],"markdown":"[Klarna](/docs/payments/klarna) is a global buy now, pay later payment method.","undocumented":false,"html":"\u003Ca href=\"/docs/payments/klarna\"\u003EKlarna\u003C/a\u003E is a global buy now, pay later payment method."}},"konbini":{"documentation":{"gate_specific":{},"localize_terms":[],"markdown":"[Konbini](/docs/payments/konbini) is a cash-based voucher payment method used in Japan.","undocumented":false,"html":"\u003Ca href=\"/docs/payments/konbini\"\u003EKonbini\u003C/a\u003E is a cash-based voucher payment method used in Japan."}},"link":{"documentation":{"gate_specific":{},"localize_terms":[],"markdown":"[Link](/docs/payments/link) allows customers to pay with their saved payment details.","undocumented":false,"html":"\u003Ca href=\"/docs/payments/link\"\u003ELink\u003C/a\u003E allows customers to pay with their saved payment details."}},"oxxo":{"documentation":{"gate_specific":{},"localize_terms":[],"markdown":"[OXXO](/docs/payments/oxxo) is a cash-based voucher payment method used in Mexico.","undocumented":false,"html":"\u003Ca href=\"/docs/payments/oxxo\"\u003EOXXO\u003C/a\u003E is a cash-based voucher payment method used in Mexico."}},"p24":{"documentation":{"gate_specific":{},"localize_terms":[],"markdown":"[Przelewy24](/docs/payments/p24) is a bank redirect payment method used in Poland.","undocumented":false,"html":"\u003Ca href=\"/docs/payments/p24\"\u003EPrzelewy24\u003C/a\u003E is a bank redirect payment method used in Poland."}},"paynow":{"documentation":{"gate_specific":{},"localize_terms":[],"markdown":"[PayNow](/docs/payments/paynow) is a QR code payment method used in Singapore.","undocumented":false,"html":"\u003Ca href=\"/docs/payments/paynow\"\u003EPayNow\u003C/a\u003E is a QR code payment method used in Singapore."}},"pix":{"documentation":{"gate_specific":{},"localize_terms":[],"markdown":"[Pix](/docs/payments/pix) is an instant bank transfer payment method in Brazil.","undocumented":false,"html":"\u003Ca href=\"/docs/payments/pix\"\u003EPix\u003C/a\u003E is an instant bank transfer payment method in Brazil."}},"promptpay":{"documentation":{"gate_specific":{},"localize_terms":[],"markdown":"[PromptPay](/docs/payments/promptpay) is an instant funds transfer service popular in Thailand.","undocumented":false,"html":"\u003Ca href=\"/docs/payments/promptpay\"\u003EPromptPay\u003C/a\u003E is an instant funds transfer service popular in Thailand."}},"sepa_debit":{"documentation":{"gate_specific":{},"localize_terms":[],"markdown":"[SEPA Direct Debit](/docs/payments/sepa-debit) is used to debit bank accounts within the Single Euro Payments Area (SEPA) region.","undocumented":false,"html":"\u003Ca href=\"/docs/payments/sepa-debit\"\u003ESEPA Direct Debit\u003C/a\u003E is used to debit bank accounts within the Single Euro Payments Area (SEPA) region."}},"sofort":{"documentation":{"gate_specific":{},"localize_terms":[],"markdown":"[Sofort](/docs/payments/sofort) is a bank redirect payment method used in Europe.","undocumented":false,"html":"\u003Ca href=\"/docs/payments/sofort\"\u003ESofort\u003C/a\u003E is a bank redirect payment method used in Europe."}},"us_bank_account":{"documentation":{"gate_specific":{},"localize_terms":[],"markdown":"[ACH Direct Debit](/docs/payments/ach-debit) is used to debit US bank accounts through the Automated Clearing House (ACH) payments system.","undocumented":false,"html":"\u003Ca href=\"/docs/payments/ach-debit\"\u003EACH Direct Debit\u003C/a\u003E is used to debit US bank accounts through the Automated Clearing House (ACH) payments system."}},"wechat_pay":{"documentation":{"gate_specific":{},"localize_terms":[],"markdown":"[WeChat Pay](/docs/payments/wechat-pay) is a digital wallet payment method based in China.","undocumented":false,"html":"\u003Ca href=\"/docs/payments/wechat-pay\"\u003EWeChat Pay\u003C/a\u003E is a digital wallet payment method based in China."}}},"object_type":"type"},"us_bank_account":{"name":"us_bank_account","check":"hash","validation":"hash","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"If this is an `us_bank_account` PaymentMethod, this hash contains details about the US bank account payment method.","undocumented":false,"html":"If this is an \u003Ccode\u003Eus_bank_account\u003C/code\u003E PaymentMethod, this hash contains details about the US bank account payment method."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"subspec":{"account_holder_type":{"name":"account_holder_type","check":"string","validation":"string","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"Account holder type: individual or company.","undocumented":false,"html":"Account holder type: individual or company."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"enum_values":{"individual":{"documentation":{"gate_specific":{},"localize_terms":[],"markdown":"Account belongs to an individual","undocumented":false,"html":"Account belongs to an individual"}},"company":{"documentation":{"gate_specific":{},"localize_terms":[],"markdown":"Account belongs to a company","undocumented":false,"html":"Account belongs to a company"}}},"object_type":"account_holder_type"},"account_type":{"name":"account_type","check":"string","validation":"string","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"Account type: checkings or savings. Defaults to checking if omitted.","undocumented":false,"html":"Account type: checkings or savings. Defaults to checking if omitted."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"enum_values":{"checking":{"documentation":{"gate_specific":{},"localize_terms":[],"markdown":"Bank account type is checking","undocumented":false,"html":"Bank account type is checking"}},"savings":{"documentation":{"gate_specific":{},"localize_terms":[],"markdown":"Bank account type is savings","undocumented":false,"html":"Bank account type is savings"}}},"object_type":"account_type"},"bank_name":{"name":"bank_name","check":"string","validation":"string","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"The name of the bank.","undocumented":false,"html":"The name of the bank."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"object_type":"bank_name"},"financial_connections_account":{"name":"financial_connections_account","check":"string","validation":"string","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"The ID of the Financial Connections Account used to create the payment method.","undocumented":false,"html":"The ID of the Financial Connections Account used to create the payment method."},"gate":true,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"object_type":"financial_connections_account"},"fingerprint":{"name":"fingerprint","check":"string","validation":"string","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"Uniquely identifies this particular bank account. You can use this attribute to check whether two bank accounts are the same.","undocumented":false,"html":"Uniquely identifies this particular bank account. You can use this attribute to check whether two bank accounts are the same."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"object_type":"fingerprint"},"last4":{"name":"last4","check":"string","validation":"string","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"Last four digits of the bank account number.","undocumented":false,"html":"Last four digits of the bank account number."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"object_type":"last4"},"networks":{"name":"networks","check":"hash","validation":"hash","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"Contains information about US bank account networks that can be used.","undocumented":false,"html":"Contains information about US bank account networks that can be used."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"subspec":{"preferred":{"name":"preferred","check":"string","validation":"string","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"The preferred network.","undocumented":false,"html":"The preferred network."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"object_type":"preferred"},"supported":{"name":"supported","check":"array","validation":"array","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"All supported networks.","undocumented":false,"html":"All supported networks."},"gate":false,"hide_unset_desc":null,"required":true,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"object_type":"supported"}},"object_type":"networks"},"routing_number":{"name":"routing_number","check":"string","validation":"string","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"Routing number of the bank account.","undocumented":false,"html":"Routing number of the bank account."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"object_type":"routing_number"}},"object_type":"us_bank_account","less_common":true},"wechat_pay":{"name":"wechat_pay","check":"hash","validation":"hash","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"If this is an `wechat_pay` PaymentMethod, this hash contains details about the wechat_pay payment method.","undocumented":false,"html":"If this is an \u003Ccode\u003Ewechat_pay\u003C/code\u003E PaymentMethod, this hash contains details about the wechat_pay payment method."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"subspec":{},"object_type":"wechat_pay","less_common":true}},"object_type":"payment_method","less_common":true},"payment_method_type":{"name":"payment_method_type","check":"string","validation":"string","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"If the error is specific to the type of payment method, the payment method type that had a problem. This field is only populated for invoice-related errors.","undocumented":false,"html":"If the error is specific to the type of payment method, the payment method type that had a problem. This field is only populated for invoice-related errors."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"object_type":"payment_method_type","less_common":true}},"object_type":"last_payment_error"},"latest_charge":{"name":"latest_charge","check":"string","validation":"string","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"The latest charge created by this payment intent.","undocumented":false,"html":"The latest charge created by this payment intent."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"user_expandable":["charge"],"object_type":"latest_charge"},"livemode":{"name":"livemode","check":"boolean","validation":"boolean","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode.","undocumented":false,"html":"Has the value \u003Ccode\u003Etrue\u003C/code\u003E if the object exists in live mode or the value \u003Ccode\u003Efalse\u003C/code\u003E if the object exists in test mode."},"gate":false,"hide_unset_desc":null,"required":true,"default":null,"badge_text":"retrievable with publishable key","requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"object_type":"livemode","less_common":true},"metadata":{"name":"metadata","check":"hash","validation":"hash","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"Set of [key-value pairs](/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. For more information, see the [documentation](/docs/payments/payment-intents/creating-payment-intents#storing-information-in-metadata).","undocumented":false,"html":"Set of \u003Ca href=\"/docs/api/metadata\"\u003Ekey-value pairs\u003C/a\u003E that you can attach to an object. This can be useful for storing additional information about the object in a structured format. For more information, see the \u003Ca href=\"/docs/payments/payment-intents/creating-payment-intents#storing-information-in-metadata\"\u003Edocumentation\u003C/a\u003E."},"gate":false,"hide_unset_desc":null,"required":true,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"object_type":"metadata"},"next_action":{"name":"next_action","check":"hash","validation":"hash","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"If present, this property tells you what actions you need to take in order for your customer to fulfill a payment using the provided source.","undocumented":false,"html":"If present, this property tells you what actions you need to take in order for your customer to fulfill a payment using the provided source."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":"retrievable with publishable key","requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"subspec":{"alipay_handle_redirect":{"name":"alipay_handle_redirect","check":"hash","validation":"hash","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"Contains instructions for authenticating a payment by redirecting your customer to Alipay App or website.","undocumented":false,"html":"Contains instructions for authenticating a payment by redirecting your customer to Alipay App or website."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"subspec":{"native_data":{"name":"native_data","check":"string","validation":"string","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"The native data to be used with Alipay SDK you must redirect your customer to in order to authenticate the payment in an Android App.","undocumented":false,"html":"The native data to be used with Alipay SDK you must redirect your customer to in order to authenticate the payment in an Android App."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"object_type":"native_data"},"native_url":{"name":"native_url","check":"string","validation":"string","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"The native URL you must redirect your customer to in order to authenticate the payment in an iOS App.","undocumented":false,"html":"The native URL you must redirect your customer to in order to authenticate the payment in an iOS App."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"object_type":"native_url"},"return_url":{"name":"return_url","check":"string","validation":"string","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"If the customer does not exit their browser while authenticating, they will be redirected to this specified URL after completion.","undocumented":false,"html":"If the customer does not exit their browser while authenticating, they will be redirected to this specified URL after completion."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"object_type":"return_url"},"url":{"name":"url","check":"string","validation":"string","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"The URL you must redirect your customer to in order to authenticate the payment.","undocumented":false,"html":"The URL you must redirect your customer to in order to authenticate the payment."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"object_type":"url"}},"object_type":"alipay_handle_redirect"},"boleto_display_details":{"name":"boleto_display_details","check":"hash","validation":"hash","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"Contains Boleto details necessary for the customer to complete the payment.","undocumented":false,"html":"Contains Boleto details necessary for the customer to complete the payment."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"subspec":{"expires_at":{"name":"expires_at","check":"timestamp","validation":"timestamp","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"The timestamp after which the boleto expires.","undocumented":false,"html":"The timestamp after which the boleto expires."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"object_type":"expires_at"},"hosted_voucher_url":{"name":"hosted_voucher_url","check":"string","validation":"string","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"The URL to the hosted boleto voucher page, which allows customers to view the boleto voucher.","undocumented":false,"html":"The URL to the hosted boleto voucher page, which allows customers to view the boleto voucher."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"object_type":"hosted_voucher_url"},"number":{"name":"number","check":"string","validation":"string","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"The boleto number.","undocumented":false,"html":"The boleto number."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"object_type":"number"},"pdf":{"name":"pdf","check":"string","validation":"string","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"The URL to the downloadable boleto voucher PDF.","undocumented":false,"html":"The URL to the downloadable boleto voucher PDF."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"object_type":"pdf"}},"object_type":"boleto_display_details"},"card_await_notification":{"name":"card_await_notification","check":"hash","validation":"hash","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"Contains instructions for processing off session recurring payments with Indian issued cards.","undocumented":false,"html":"Contains instructions for processing off session recurring payments with Indian issued cards."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"subspec":{"charge_attempt_at":{"name":"charge_attempt_at","check":"timestamp","validation":"timestamp","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"The time that payment will be attempted. If customer approval is required, they need to provide approval before this time.","undocumented":false,"html":"The time that payment will be attempted. If customer approval is required, they need to provide approval before this time."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"object_type":"charge_attempt_at"},"customer_approval_required":{"name":"customer_approval_required","check":"boolean","validation":"boolean","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"For payments greater than INR 15000, the customer must provide explicit approval of the payment with their bank. For payments of lower amount, no customer action is required.","undocumented":false,"html":"For payments greater than INR 15000, the customer must provide explicit approval of the payment with their bank. For payments of lower amount, no customer action is required."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"object_type":"customer_approval_required"}},"object_type":"card_await_notification"},"display_bank_transfer_instructions":{"name":"display_bank_transfer_instructions","check":"hash","validation":"hash","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"Contains the bank transfer details necessary for the customer to complete the payment.","undocumented":false,"html":"Contains the bank transfer details necessary for the customer to complete the payment."},"gate":true,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"subspec":{"amount_remaining":{"name":"amount_remaining","check":"integer","validation":"integer","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"The remaining amount that needs to be transferred to complete the payment.","undocumented":false,"html":"The remaining amount that needs to be transferred to complete the payment."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"object_type":"amount_remaining"},"currency":{"name":"currency","check":"currency","validation":"currency","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. Must be a [supported currency](https://stripe.com/docs/currencies).","undocumented":false,"html":"Three-letter \u003Ca href=\"https://www.iso.org/iso-4217-currency-codes.html\"\u003EISO currency code\u003C/a\u003E, in lowercase. Must be a \u003Ca href=\"https://stripe.com/docs/currencies\"\u003Esupported currency\u003C/a\u003E."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"object_type":"currency"},"financial_addresses":{"name":"financial_addresses","check":"array","validation":"array","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"A list of financial addresses that can be used to fund the customer balance","undocumented":false,"html":"A list of financial addresses that can be used to fund the customer balance"},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"subspec":{"iban":{"name":"iban","check":"hash","validation":"hash","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"An IBAN-based FinancialAddress","undocumented":false,"html":"An IBAN-based FinancialAddress"},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"subspec":{"account_holder_name":{"name":"account_holder_name","check":"string","validation":"string","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"The name of the person or business that owns the bank account","undocumented":false,"html":"The name of the person or business that owns the bank account"},"gate":false,"hide_unset_desc":null,"required":true,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"object_type":"account_holder_name"},"bic":{"name":"bic","check":"string","validation":"string","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"The BIC/SWIFT code of the account.","undocumented":false,"html":"The BIC/SWIFT code of the account."},"gate":false,"hide_unset_desc":null,"required":true,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"object_type":"bic"},"country":{"name":"country","check":"string","validation":"string","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)).","undocumented":false,"html":"Two-letter country code (\u003Ca href=\"https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2\"\u003EISO 3166-1 alpha-2\u003C/a\u003E)."},"gate":false,"hide_unset_desc":null,"required":true,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"object_type":"country"},"iban":{"name":"iban","check":"string","validation":"string","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"The IBAN of the account.","undocumented":false,"html":"The IBAN of the account."},"gate":false,"hide_unset_desc":null,"required":true,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"object_type":"iban"}},"object_type":"iban"},"sort_code":{"name":"sort_code","check":"hash","validation":"hash","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"An account number and sort code-based FinancialAddress","undocumented":false,"html":"An account number and sort code-based FinancialAddress"},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"subspec":{"account_holder_name":{"name":"account_holder_name","check":"string","validation":"string","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"The name of the person or business that owns the bank account","undocumented":false,"html":"The name of the person or business that owns the bank account"},"gate":false,"hide_unset_desc":null,"required":true,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"object_type":"account_holder_name"},"account_number":{"name":"account_number","check":"string","validation":"string","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"The account number","undocumented":false,"html":"The account number"},"gate":false,"hide_unset_desc":null,"required":true,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"object_type":"account_number"},"sort_code":{"name":"sort_code","check":"string","validation":"string","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"The six-digit sort code","undocumented":false,"html":"The six-digit sort code"},"gate":false,"hide_unset_desc":null,"required":true,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"object_type":"sort_code"}},"object_type":"sort_code"},"spei":{"name":"spei","check":"hash","validation":"hash","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"A SPEI-based FinancialAddress","undocumented":false,"html":"A SPEI-based FinancialAddress"},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"subspec":{"bank_code":{"name":"bank_code","check":"string","validation":"string","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"The three-digit bank code","undocumented":false,"html":"The three-digit bank code"},"gate":false,"hide_unset_desc":null,"required":true,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"object_type":"bank_code"},"bank_name":{"name":"bank_name","check":"string","validation":"string","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"The short banking institution name","undocumented":false,"html":"The short banking institution name"},"gate":false,"hide_unset_desc":null,"required":true,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"object_type":"bank_name"},"clabe":{"name":"clabe","check":"string","validation":"string","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"The CLABE number","undocumented":false,"html":"The CLABE number"},"gate":false,"hide_unset_desc":null,"required":true,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"object_type":"clabe"}},"object_type":"spei"},"supported_networks":{"name":"supported_networks","check":"array","validation":"array","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"The payment networks supported by this FinancialAddress","undocumented":false,"html":"The payment networks supported by this FinancialAddress"},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"enum_values":{"bacs":{"documentation":null},"fps":{"documentation":null},"sepa":{"documentation":null},"spei":{"documentation":null},"zengin":{"documentation":null}},"object_type":"supported_networks"},"type":{"name":"type","check":"string","validation":"string","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"The type of financial address","undocumented":false,"html":"The type of financial address"},"gate":false,"hide_unset_desc":null,"required":true,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"enum_values":{"iban":{"documentation":null},"sort_code":{"documentation":null},"spei":{"documentation":null},"zengin":{"documentation":null}},"object_type":"type"},"zengin":{"name":"zengin","check":"hash","validation":"hash","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"A Zengin-based FinancialAddress","undocumented":false,"html":"A Zengin-based FinancialAddress"},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"subspec":{"account_holder_name":{"name":"account_holder_name","check":"string","validation":"string","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"The account holder name","undocumented":false,"html":"The account holder name"},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"object_type":"account_holder_name"},"account_number":{"name":"account_number","check":"string","validation":"string","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"The account number","undocumented":false,"html":"The account number"},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"object_type":"account_number"},"account_type":{"name":"account_type","check":"string","validation":"string","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"The bank account type. In Japan, this can only be `futsu` or `toza`.","undocumented":false,"html":"The bank account type. In Japan, this can only be \u003Ccode\u003Efutsu\u003C/code\u003E or \u003Ccode\u003Etoza\u003C/code\u003E."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"object_type":"account_type"},"bank_code":{"name":"bank_code","check":"string","validation":"string","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"The bank code of the account","undocumented":false,"html":"The bank code of the account"},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"object_type":"bank_code"},"bank_name":{"name":"bank_name","check":"string","validation":"string","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"The bank name of the account","undocumented":false,"html":"The bank name of the account"},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"object_type":"bank_name"},"branch_code":{"name":"branch_code","check":"string","validation":"string","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"The branch code of the account","undocumented":false,"html":"The branch code of the account"},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"object_type":"branch_code"},"branch_name":{"name":"branch_name","check":"string","validation":"string","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"The branch name of the account","undocumented":false,"html":"The branch name of the account"},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"object_type":"branch_name"}},"object_type":"zengin"}},"object_type":"financial_addresses"},"hosted_instructions_url":{"name":"hosted_instructions_url","check":"string","validation":"string","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"A link to a hosted page that guides your customer through completing the transfer.","undocumented":false,"html":"A link to a hosted page that guides your customer through completing the transfer."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"object_type":"hosted_instructions_url"},"reference":{"name":"reference","check":"string","validation":"string","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"A string identifying this payment. Instruct your customer to include this code in the reference or memo field of their bank transfer.","undocumented":false,"html":"A string identifying this payment. Instruct your customer to include this code in the reference or memo field of their bank transfer."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"object_type":"reference"},"type":{"name":"type","check":"string","validation":"string","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"Type of bank transfer","undocumented":false,"html":"Type of bank transfer"},"gate":false,"hide_unset_desc":null,"required":true,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"enum_values":{"eu_bank_transfer":{"documentation":{"gate_specific":{},"localize_terms":[],"markdown":"A bank transfer of type eu_bank_transfer","undocumented":false,"html":"A bank transfer of type eu_bank_transfer"}},"gb_bank_transfer":{"documentation":{"gate_specific":{},"localize_terms":[],"markdown":"A bank transfer of type gb_bank_transfer","undocumented":false,"html":"A bank transfer of type gb_bank_transfer"}},"jp_bank_transfer":{"documentation":{"gate_specific":{},"localize_terms":[],"markdown":"A bank transfer of type jp_bank_transfer","undocumented":false,"html":"A bank transfer of type jp_bank_transfer"}},"mx_bank_transfer":{"documentation":{"gate_specific":{},"localize_terms":[],"markdown":"A bank transfer of type mx_bank_transfer","undocumented":false,"html":"A bank transfer of type mx_bank_transfer"}}},"object_type":"type"}},"object_type":"display_bank_transfer_instructions"},"konbini_display_details":{"name":"konbini_display_details","check":"hash","validation":"hash","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"Contains Konbini details necessary for the customer to complete the payment.","undocumented":false,"html":"Contains Konbini details necessary for the customer to complete the payment."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"subspec":{"expires_at":{"name":"expires_at","check":"timestamp","validation":"timestamp","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"The timestamp at which the pending Konbini payment expires.","undocumented":false,"html":"The timestamp at which the pending Konbini payment expires."},"gate":false,"hide_unset_desc":null,"required":true,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"object_type":"expires_at"},"hosted_voucher_url":{"name":"hosted_voucher_url","check":"string","validation":"string","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"The URL for the Konbini payment instructions page, which allows customers to view and print a Konbini voucher.","undocumented":false,"html":"The URL for the Konbini payment instructions page, which allows customers to view and print a Konbini voucher."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"object_type":"hosted_voucher_url"},"stores":{"name":"stores","check":"hash","validation":"hash","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"Payment instruction details grouped by convenience store chain.","undocumented":false,"html":"Payment instruction details grouped by convenience store chain."},"gate":false,"hide_unset_desc":null,"required":true,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"subspec":{"familymart":{"name":"familymart","check":"hash","validation":"hash","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"FamilyMart instruction details.","undocumented":false,"html":"FamilyMart instruction details."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"subspec":{"confirmation_number":{"name":"confirmation_number","check":"string","validation":"string","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"The confirmation number.","undocumented":false,"html":"The confirmation number."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"object_type":"confirmation_number"},"payment_code":{"name":"payment_code","check":"string","validation":"string","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"The payment code.","undocumented":false,"html":"The payment code."},"gate":false,"hide_unset_desc":null,"required":true,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"object_type":"payment_code"}},"object_type":"familymart"},"lawson":{"name":"lawson","check":"hash","validation":"hash","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"Lawson instruction details.","undocumented":false,"html":"Lawson instruction details."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"subspec":{"confirmation_number":{"name":"confirmation_number","check":"string","validation":"string","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"The confirmation number.","undocumented":false,"html":"The confirmation number."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"object_type":"confirmation_number"},"payment_code":{"name":"payment_code","check":"string","validation":"string","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"The payment code.","undocumented":false,"html":"The payment code."},"gate":false,"hide_unset_desc":null,"required":true,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"object_type":"payment_code"}},"object_type":"lawson"},"ministop":{"name":"ministop","check":"hash","validation":"hash","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"Ministop instruction details.","undocumented":false,"html":"Ministop instruction details."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"subspec":{"confirmation_number":{"name":"confirmation_number","check":"string","validation":"string","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"The confirmation number.","undocumented":false,"html":"The confirmation number."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"object_type":"confirmation_number"},"payment_code":{"name":"payment_code","check":"string","validation":"string","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"The payment code.","undocumented":false,"html":"The payment code."},"gate":false,"hide_unset_desc":null,"required":true,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"object_type":"payment_code"}},"object_type":"ministop"},"seicomart":{"name":"seicomart","check":"hash","validation":"hash","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"Seicomart instruction details.","undocumented":false,"html":"Seicomart instruction details."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"subspec":{"confirmation_number":{"name":"confirmation_number","check":"string","validation":"string","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"The confirmation number.","undocumented":false,"html":"The confirmation number."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"object_type":"confirmation_number"},"payment_code":{"name":"payment_code","check":"string","validation":"string","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"The payment code.","undocumented":false,"html":"The payment code."},"gate":false,"hide_unset_desc":null,"required":true,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"object_type":"payment_code"}},"object_type":"seicomart"}},"object_type":"stores"}},"object_type":"konbini_display_details"},"oxxo_display_details":{"name":"oxxo_display_details","check":"hash","validation":"hash","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"Contains OXXO details necessary for the customer to complete the payment.","undocumented":false,"html":"Contains OXXO details necessary for the customer to complete the payment."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"subspec":{"expires_after":{"name":"expires_after","check":"timestamp","validation":"timestamp","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"The timestamp after which the OXXO voucher expires.","undocumented":false,"html":"The timestamp after which the OXXO voucher expires."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"object_type":"expires_after"},"hosted_voucher_url":{"name":"hosted_voucher_url","check":"string","validation":"string","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"The URL for the hosted OXXO voucher page, which allows customers to view and print an OXXO voucher.","undocumented":false,"html":"The URL for the hosted OXXO voucher page, which allows customers to view and print an OXXO voucher."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"object_type":"hosted_voucher_url"},"number":{"name":"number","check":"string","validation":"string","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"OXXO reference number.","undocumented":false,"html":"OXXO reference number."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"object_type":"number"}},"object_type":"oxxo_display_details"},"paynow_display_qr_code":{"name":"paynow_display_qr_code","check":"hash","validation":"hash","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"The field that contains PayNow QR code info","undocumented":false,"html":"The field that contains PayNow QR code info"},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"subspec":{"data":{"name":"data","check":"string","validation":"string","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"The raw data string used to generate QR code, it should be used together with QR code library.","undocumented":false,"html":"The raw data string used to generate QR code, it should be used together with QR code library."},"gate":false,"hide_unset_desc":null,"required":true,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"object_type":"data"},"hosted_instructions_url":{"name":"hosted_instructions_url","check":"string","validation":"string","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"The URL to the hosted PayNow instructions page, which allows customers to view the PayNow QR code.","undocumented":false,"html":"The URL to the hosted PayNow instructions page, which allows customers to view the PayNow QR code."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"object_type":"hosted_instructions_url"},"image_url_png":{"name":"image_url_png","check":"string","validation":"string","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"The image_url_png string used to render QR code","undocumented":false,"html":"The image_url_png string used to render QR code"},"gate":false,"hide_unset_desc":null,"required":true,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"object_type":"image_url_png"},"image_url_svg":{"name":"image_url_svg","check":"string","validation":"string","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"The image_url_svg string used to render QR code","undocumented":false,"html":"The image_url_svg string used to render QR code"},"gate":false,"hide_unset_desc":null,"required":true,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"object_type":"image_url_svg"}},"object_type":"paynow_display_qr_code"},"pix_display_qr_code":{"name":"pix_display_qr_code","check":"hash","validation":"hash","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"The field that contains Pix QR code info","undocumented":false,"html":"The field that contains Pix QR code info"},"gate":true,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"subspec":{"data":{"name":"data","check":"string","validation":"string","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"The raw data string used to generate QR code, it should be used together with QR code library.","undocumented":false,"html":"The raw data string used to generate QR code, it should be used together with QR code library."},"gate":true,"hide_unset_desc":null,"required":true,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"object_type":"data"},"expires_at":{"name":"expires_at","check":"integer","validation":"integer","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"The date (unix timestamp) when the PIX expires.","undocumented":false,"html":"The date (unix timestamp) when the PIX expires."},"gate":true,"hide_unset_desc":null,"required":true,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"object_type":"expires_at"},"hosted_instructions_url":{"name":"hosted_instructions_url","check":"string","validation":"string","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"The URL to the hosted pix instructions page, which allows customers to view the pix QR code.","undocumented":false,"html":"The URL to the hosted pix instructions page, which allows customers to view the pix QR code."},"gate":true,"hide_unset_desc":null,"required":true,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"object_type":"hosted_instructions_url"},"image_url_png":{"name":"image_url_png","check":"string","validation":"string","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"The image_url_png string used to render png QR code","undocumented":false,"html":"The image_url_png string used to render png QR code"},"gate":true,"hide_unset_desc":null,"required":true,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"object_type":"image_url_png"},"image_url_svg":{"name":"image_url_svg","check":"string","validation":"string","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"The image_url_svg string used to render svg QR code","undocumented":false,"html":"The image_url_svg string used to render svg QR code"},"gate":true,"hide_unset_desc":null,"required":true,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"object_type":"image_url_svg"}},"object_type":"pix_display_qr_code"},"promptpay_display_qr_code":{"name":"promptpay_display_qr_code","check":"hash","validation":"hash","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"The field that contains PromptPay QR code info","undocumented":false,"html":"The field that contains PromptPay QR code info"},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"subspec":{"data":{"name":"data","check":"string","validation":"string","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"The raw data string used to generate QR code, it should be used together with QR code library.","undocumented":false,"html":"The raw data string used to generate QR code, it should be used together with QR code library."},"gate":false,"hide_unset_desc":null,"required":true,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"object_type":"data"},"hosted_instructions_url":{"name":"hosted_instructions_url","check":"string","validation":"string","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"The URL to the hosted PromptPay instructions page, which allows customers to view the PromptPay QR code.","undocumented":false,"html":"The URL to the hosted PromptPay instructions page, which allows customers to view the PromptPay QR code."},"gate":false,"hide_unset_desc":null,"required":true,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"object_type":"hosted_instructions_url"},"image_url_png":{"name":"image_url_png","check":"string","validation":"string","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"The PNG path used to render the QR code, can be used as the source in an HTML img tag","undocumented":false,"html":"The PNG path used to render the QR code, can be used as the source in an HTML img tag"},"gate":false,"hide_unset_desc":null,"required":true,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"object_type":"image_url_png"},"image_url_svg":{"name":"image_url_svg","check":"string","validation":"string","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"The SVG path used to render the QR code, can be used as the source in an HTML img tag","undocumented":false,"html":"The SVG path used to render the QR code, can be used as the source in an HTML img tag"},"gate":false,"hide_unset_desc":null,"required":true,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"object_type":"image_url_svg"}},"object_type":"promptpay_display_qr_code"},"redirect_to_url":{"name":"redirect_to_url","check":"hash","validation":"hash","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"Contains instructions for authenticating a payment by redirecting your customer to another page or application.","undocumented":false,"html":"Contains instructions for authenticating a payment by redirecting your customer to another page or application."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"subspec":{"return_url":{"name":"return_url","check":"string","validation":"string","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"If the customer does not exit their browser while authenticating, they will be redirected to this specified URL after completion.","undocumented":false,"html":"If the customer does not exit their browser while authenticating, they will be redirected to this specified URL after completion."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"object_type":"return_url"},"url":{"name":"url","check":"string","validation":"string","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"The URL you must redirect your customer to in order to authenticate the payment.","undocumented":false,"html":"The URL you must redirect your customer to in order to authenticate the payment."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"object_type":"url"}},"object_type":"redirect_to_url"},"type":{"name":"type","check":"string","validation":"string","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"Type of the next action to perform, one of `redirect_to_url`, `use_stripe_sdk`, `alipay_handle_redirect`, `oxxo_display_details`, or `verify_with_microdeposits`.","undocumented":false,"html":"Type of the next action to perform, one of \u003Ccode\u003Eredirect_to_url\u003C/code\u003E, \u003Ccode\u003Euse_stripe_sdk\u003C/code\u003E, \u003Ccode\u003Ealipay_handle_redirect\u003C/code\u003E, \u003Ccode\u003Eoxxo_display_details\u003C/code\u003E, or \u003Ccode\u003Everify_with_microdeposits\u003C/code\u003E."},"gate":false,"hide_unset_desc":null,"required":true,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"object_type":"type"},"use_stripe_sdk":{"name":"use_stripe_sdk","check":"hash","validation":"hash","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"When confirming a PaymentIntent with Stripe.js, Stripe.js depends on the contents of this \u003Ctranslate\u003Edictionary\u003C/translate\u003E to invoke authentication flows. The shape of the contents is subject to change and is only intended to be used by Stripe.js.","undocumented":false,"html":"When confirming a PaymentIntent with Stripe.js, Stripe.js depends on the contents of this \u003Ctranslate\u003Edictionary\u003C/translate\u003E to invoke authentication flows. The shape of the contents is subject to change and is only intended to be used by Stripe.js."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"object_type":"use_stripe_sdk"},"verify_with_microdeposits":{"name":"verify_with_microdeposits","check":"hash","validation":"hash","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"Contains details describing microdeposits verification flow.","undocumented":false,"html":"Contains details describing microdeposits verification flow."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"subspec":{"arrival_date":{"name":"arrival_date","check":"timestamp","validation":"timestamp","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"The timestamp when the microdeposits are expected to land.","undocumented":false,"html":"The timestamp when the microdeposits are expected to land."},"gate":false,"hide_unset_desc":null,"required":true,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"object_type":"arrival_date"},"hosted_verification_url":{"name":"hosted_verification_url","check":"string","validation":"string","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"The URL for the hosted verification page, which allows customers to verify their bank account.","undocumented":false,"html":"The URL for the hosted verification page, which allows customers to verify their bank account."},"gate":false,"hide_unset_desc":null,"required":true,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"object_type":"hosted_verification_url"},"microdeposit_type":{"name":"microdeposit_type","check":"string","validation":"string","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"The type of the microdeposit sent to the customer. Used to distinguish between different verification methods.","undocumented":false,"html":"The type of the microdeposit sent to the customer. Used to distinguish between different verification methods."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"enum_values":{"descriptor_code":{"documentation":null},"amounts":{"documentation":null}},"object_type":"microdeposit_type"}},"object_type":"verify_with_microdeposits"},"wechat_pay_display_qr_code":{"name":"wechat_pay_display_qr_code","check":"hash","validation":"hash","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"The field that contains WeChat Pay QR code info","undocumented":false,"html":"The field that contains WeChat Pay QR code info"},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"subspec":{"data":{"name":"data","check":"string","validation":"string","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"The data being used to generate QR code","undocumented":false,"html":"The data being used to generate QR code"},"gate":false,"hide_unset_desc":null,"required":true,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"object_type":"data"},"hosted_instructions_url":{"name":"hosted_instructions_url","check":"string","validation":"string","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"The URL to the hosted WeChat Pay instructions page, which allows customers to view the WeChat Pay QR code.","undocumented":false,"html":"The URL to the hosted WeChat Pay instructions page, which allows customers to view the WeChat Pay QR code."},"gate":false,"hide_unset_desc":null,"required":true,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"object_type":"hosted_instructions_url"},"image_data_url":{"name":"image_data_url","check":"string","validation":"string","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"The base64 image data for a pre-generated QR code","undocumented":false,"html":"The base64 image data for a pre-generated QR code"},"gate":false,"hide_unset_desc":null,"required":true,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"object_type":"image_data_url"},"image_url_png":{"name":"image_url_png","check":"string","validation":"string","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"The image_url_png string used to render QR code","undocumented":false,"html":"The image_url_png string used to render QR code"},"gate":false,"hide_unset_desc":null,"required":true,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"object_type":"image_url_png"},"image_url_svg":{"name":"image_url_svg","check":"string","validation":"string","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"The image_url_svg string used to render QR code","undocumented":false,"html":"The image_url_svg string used to render QR code"},"gate":false,"hide_unset_desc":null,"required":true,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"object_type":"image_url_svg"}},"object_type":"wechat_pay_display_qr_code"},"wechat_pay_redirect_to_android_app":{"name":"wechat_pay_redirect_to_android_app","check":"hash","validation":"hash","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"Info required for android app to app redirect","undocumented":false,"html":"Info required for android app to app redirect"},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"subspec":{"app_id":{"name":"app_id","check":"string","validation":"string","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"app_id is the APP ID registered on WeChat open platform","undocumented":false,"html":"app_id is the APP ID registered on WeChat open platform"},"gate":false,"hide_unset_desc":null,"required":true,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"object_type":"app_id"},"nonce_str":{"name":"nonce_str","check":"string","validation":"string","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"nonce_str is a random string","undocumented":false,"html":"nonce_str is a random string"},"gate":false,"hide_unset_desc":null,"required":true,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"object_type":"nonce_str"},"package":{"name":"package","check":"string","validation":"string","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"package is static value","undocumented":false,"html":"package is static value"},"gate":false,"hide_unset_desc":null,"required":true,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"object_type":"package"},"partner_id":{"name":"partner_id","check":"string","validation":"string","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"an unique merchant ID assigned by WeChat Pay","undocumented":false,"html":"an unique merchant ID assigned by WeChat Pay"},"gate":false,"hide_unset_desc":null,"required":true,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"object_type":"partner_id"},"prepay_id":{"name":"prepay_id","check":"string","validation":"string","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"an unique trading ID assigned by WeChat Pay","undocumented":false,"html":"an unique trading ID assigned by WeChat Pay"},"gate":false,"hide_unset_desc":null,"required":true,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"object_type":"prepay_id"},"sign":{"name":"sign","check":"string","validation":"string","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"A signature","undocumented":false,"html":"A signature"},"gate":false,"hide_unset_desc":null,"required":true,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"object_type":"sign"},"timestamp":{"name":"timestamp","check":"string","validation":"string","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"Specifies the current time in epoch format","undocumented":false,"html":"Specifies the current time in epoch format"},"gate":false,"hide_unset_desc":null,"required":true,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"object_type":"timestamp"}},"object_type":"wechat_pay_redirect_to_android_app"},"wechat_pay_redirect_to_ios_app":{"name":"wechat_pay_redirect_to_ios_app","check":"hash","validation":"hash","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"Info required for iOS app to app redirect","undocumented":false,"html":"Info required for iOS app to app redirect"},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"subspec":{"native_url":{"name":"native_url","check":"string","validation":"string","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"An universal link that redirect to WeChat Pay app","undocumented":false,"html":"An universal link that redirect to WeChat Pay app"},"gate":false,"hide_unset_desc":null,"required":true,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"object_type":"native_url"}},"object_type":"wechat_pay_redirect_to_ios_app"}},"object_type":"next_action"},"on_behalf_of":{"name":"on_behalf_of","check":"string","validation":"string","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"The account (if any) for which the funds of the PaymentIntent are intended. See the PaymentIntents [use case for connected accounts](/docs/payments/connected-accounts) for details.","undocumented":false,"html":"The account (if any) for which the funds of the PaymentIntent are intended. See the PaymentIntents \u003Ca href=\"/docs/payments/connected-accounts\"\u003Euse case for connected accounts\u003C/a\u003E for details."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":"Connect only","requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"user_expandable":["account"],"object_type":"on_behalf_of","less_common":true},"payment_method":{"name":"payment_method","check":"string","validation":"string","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"ID of the payment method used in this PaymentIntent.","undocumented":false,"html":"ID of the payment method used in this PaymentIntent."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":"retrievable with publishable key","requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"user_expandable":["payment_method"],"object_type":"payment_method"},"payment_method_options":{"name":"payment_method_options","check":"hash","validation":"hash","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"Payment-method-specific configuration for this PaymentIntent.","undocumented":false,"html":"Payment-method-specific configuration for this PaymentIntent."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"subspec":{"acss_debit":{"name":"acss_debit","check":"hash","validation":"hash","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"If the PaymentIntent's payment_method_types includes `acss_debit`, this hash contains the configurations that will be applied to each payment attempt of that type.\n","undocumented":false,"html":"If the PaymentIntent’s payment_method_types includes \u003Ccode\u003Eacss_debit\u003C/code\u003E, this hash contains the configurations that will be applied to each payment attempt of that type."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"subspec":{"mandate_options":{"name":"mandate_options","check":"hash","validation":"hash","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"Additional fields for Mandate creation","undocumented":false,"html":"Additional fields for Mandate creation"},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"subspec":{"custom_mandate_url":{"name":"custom_mandate_url","check":"string","validation":"string","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"A URL for custom mandate text","undocumented":false,"html":"A URL for custom mandate text"},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"object_type":"custom_mandate_url"},"interval_description":{"name":"interval_description","check":"string","validation":"string","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"Description of the interval. Only required if the 'payment_schedule' parameter is 'interval' or 'combined'.","undocumented":false,"html":"Description of the interval. Only required if the ‘payment_schedule’ parameter is ‘interval’ or ‘combined’."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"object_type":"interval_description"},"payment_schedule":{"name":"payment_schedule","check":"string","validation":"string","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"Payment schedule for the mandate.","undocumented":false,"html":"Payment schedule for the mandate."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"enum_values":{"interval":{"documentation":{"gate_specific":{},"localize_terms":[],"markdown":"Payments are initiated at a regular pre-defined interval","undocumented":false,"html":"Payments are initiated at a regular pre-defined interval"}},"sporadic":{"documentation":{"gate_specific":{},"localize_terms":[],"markdown":"Payments are initiated sporadically","undocumented":false,"html":"Payments are initiated sporadically"}},"combined":{"documentation":{"gate_specific":{},"localize_terms":[],"markdown":"Payments can be initiated at a pre-defined interval or sporadically","undocumented":false,"html":"Payments can be initiated at a pre-defined interval or sporadically"}}},"object_type":"payment_schedule"},"transaction_type":{"name":"transaction_type","check":"string","validation":"string","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"Transaction type of the mandate.","undocumented":false,"html":"Transaction type of the mandate."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"enum_values":{"personal":{"documentation":{"gate_specific":{},"localize_terms":[],"markdown":"Transactions are made for personal reasons","undocumented":false,"html":"Transactions are made for personal reasons"}},"business":{"documentation":{"gate_specific":{},"localize_terms":[],"markdown":"Transactions are made for business reasons","undocumented":false,"html":"Transactions are made for business reasons"}}},"object_type":"transaction_type"}},"object_type":"mandate_options"},"setup_future_usage":{"name":"setup_future_usage","check":"string","validation":"string","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"Indicates that you intend to make future payments with this PaymentIntent's payment method.\n\nProviding this parameter will [attach the payment method](/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](/docs/api/payment_methods/attach) to a Customer after the transaction completes.\n\nWhen processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](/docs/strong-customer-authentication).\n","undocumented":false,"html":"Indicates that you intend to make future payments with this PaymentIntent’s payment method.\u003C/p\u003E\n\n\u003Cp\u003EProviding this parameter will \u003Ca href=\"/docs/payments/save-during-payment\"\u003Eattach the payment method\u003C/a\u003E to the PaymentIntent’s Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be \u003Ca href=\"/docs/api/payment_methods/attach\"\u003Eattached\u003C/a\u003E to a Customer after the transaction completes.\u003C/p\u003E\n\n\u003Cp\u003EWhen processing card payments, Stripe also uses \u003Ccode\u003Esetup_future_usage\u003C/code\u003E to dynamically optimize your payment flow and comply with regional legislation and network rules, such as \u003Ca href=\"/docs/strong-customer-authentication\"\u003ESCA\u003C/a\u003E."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"enum_values":{"on_session":{"documentation":{"gate_specific":{},"localize_terms":[],"markdown":"Use `on_session` if you intend to only reuse the payment method when your customer is present in your checkout flow.","undocumented":false,"html":"Use \u003Ccode\u003Eon_session\u003C/code\u003E if you intend to only reuse the payment method when your customer is present in your checkout flow."}},"off_session":{"documentation":{"gate_specific":{},"localize_terms":[],"markdown":"Use `off_session` if your customer may or may not be present in your checkout flow.","undocumented":false,"html":"Use \u003Ccode\u003Eoff_session\u003C/code\u003E if your customer may or may not be present in your checkout flow."}},"none":{"documentation":{"gate_specific":{},"localize_terms":[],"markdown":"Use `none` if you do not intend to reuse this payment method and want to override the top-level `setup_future_usage` value for this payment method.","undocumented":false,"html":"Use \u003Ccode\u003Enone\u003C/code\u003E if you do not intend to reuse this payment method and want to override the top-level \u003Ccode\u003Esetup_future_usage\u003C/code\u003E value for this payment method."}}},"object_type":"setup_future_usage"},"verification_method":{"name":"verification_method","check":"string","validation":"string","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"Bank account verification method.","undocumented":false,"html":"Bank account verification method."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"enum_values":{"automatic":{"documentation":{"gate_specific":{},"localize_terms":[],"markdown":"Instant verification with fallback to microdeposits.","undocumented":false,"html":"Instant verification with fallback to microdeposits."}},"instant":{"documentation":{"gate_specific":{},"localize_terms":[],"markdown":"Instant verification.","undocumented":false,"html":"Instant verification."}},"microdeposits":{"documentation":{"gate_specific":{},"localize_terms":[],"markdown":"Verification using microdeposits.","undocumented":false,"html":"Verification using microdeposits."}}},"object_type":"verification_method"}},"object_type":"acss_debit"},"affirm":{"name":"affirm","check":"hash","validation":"hash","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"If the PaymentIntent's payment_method_types includes `affirm`, this hash contains the configurations that will be applied to each payment attempt of that type.\n","undocumented":false,"html":"If the PaymentIntent’s payment_method_types includes \u003Ccode\u003Eaffirm\u003C/code\u003E, this hash contains the configurations that will be applied to each payment attempt of that type."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"subspec":{"capture_method":{"name":"capture_method","check":"string","validation":"string","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"Controls when the funds will be captured from the customer's account.\n","undocumented":false,"html":"Controls when the funds will be captured from the customer’s account."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"enum_values":{"manual":{"documentation":{"gate_specific":{},"localize_terms":[],"markdown":"Use `manual` if you intend to place the funds on hold and want to override the top-level `capture_method` value for this payment method.","undocumented":false,"html":"Use \u003Ccode\u003Emanual\u003C/code\u003E if you intend to place the funds on hold and want to override the top-level \u003Ccode\u003Ecapture_method\u003C/code\u003E value for this payment method."}}},"object_type":"capture_method"},"setup_future_usage":{"name":"setup_future_usage","check":"string","validation":"string","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"Indicates that you intend to make future payments with this PaymentIntent's payment method.\n\nProviding this parameter will [attach the payment method](/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](/docs/api/payment_methods/attach) to a Customer after the transaction completes.\n\nWhen processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](/docs/strong-customer-authentication).\n","undocumented":false,"html":"Indicates that you intend to make future payments with this PaymentIntent’s payment method.\u003C/p\u003E\n\n\u003Cp\u003EProviding this parameter will \u003Ca href=\"/docs/payments/save-during-payment\"\u003Eattach the payment method\u003C/a\u003E to the PaymentIntent’s Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be \u003Ca href=\"/docs/api/payment_methods/attach\"\u003Eattached\u003C/a\u003E to a Customer after the transaction completes.\u003C/p\u003E\n\n\u003Cp\u003EWhen processing card payments, Stripe also uses \u003Ccode\u003Esetup_future_usage\u003C/code\u003E to dynamically optimize your payment flow and comply with regional legislation and network rules, such as \u003Ca href=\"/docs/strong-customer-authentication\"\u003ESCA\u003C/a\u003E."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"enum_values":{"none":{"documentation":{"gate_specific":{},"localize_terms":[],"markdown":"Use `none` if you do not intend to reuse this payment method and want to override the top-level `setup_future_usage` value for this payment method.","undocumented":false,"html":"Use \u003Ccode\u003Enone\u003C/code\u003E if you do not intend to reuse this payment method and want to override the top-level \u003Ccode\u003Esetup_future_usage\u003C/code\u003E value for this payment method."}}},"object_type":"setup_future_usage"}},"object_type":"affirm"},"afterpay_clearpay":{"name":"afterpay_clearpay","check":"hash","validation":"hash","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"If the PaymentIntent's payment_method_types includes `afterpay_clearpay`, this hash contains the configurations that will be applied to each payment attempt of that type.\n","undocumented":false,"html":"If the PaymentIntent’s payment_method_types includes \u003Ccode\u003Eafterpay_clearpay\u003C/code\u003E, this hash contains the configurations that will be applied to each payment attempt of that type."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"subspec":{"capture_method":{"name":"capture_method","check":"string","validation":"string","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"Controls when the funds will be captured from the customer's account.\n","undocumented":false,"html":"Controls when the funds will be captured from the customer’s account."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"enum_values":{"manual":{"documentation":{"gate_specific":{},"localize_terms":[],"markdown":"Use `manual` if you intend to place the funds on hold and want to override the top-level `capture_method` value for this payment method.","undocumented":false,"html":"Use \u003Ccode\u003Emanual\u003C/code\u003E if you intend to place the funds on hold and want to override the top-level \u003Ccode\u003Ecapture_method\u003C/code\u003E value for this payment method."}}},"object_type":"capture_method"},"reference":{"name":"reference","check":"string","validation":"string","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"Order identifier shown to the customer in Afterpay’s online portal. We recommend using a value that helps you answer any questions a customer might have about\nthe payment. The identifier is limited to 128 characters and may contain only letters, digits, underscores, backslashes and dashes.\n","undocumented":false,"html":"Order identifier shown to the customer in Afterpay’s online portal. We recommend using a value that helps you answer any questions a customer might have about\nthe payment. The identifier is limited to 128 characters and may contain only letters, digits, underscores, backslashes and dashes."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"object_type":"reference"},"setup_future_usage":{"name":"setup_future_usage","check":"string","validation":"string","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"Indicates that you intend to make future payments with this PaymentIntent's payment method.\n\nProviding this parameter will [attach the payment method](/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](/docs/api/payment_methods/attach) to a Customer after the transaction completes.\n\nWhen processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](/docs/strong-customer-authentication).\n","undocumented":false,"html":"Indicates that you intend to make future payments with this PaymentIntent’s payment method.\u003C/p\u003E\n\n\u003Cp\u003EProviding this parameter will \u003Ca href=\"/docs/payments/save-during-payment\"\u003Eattach the payment method\u003C/a\u003E to the PaymentIntent’s Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be \u003Ca href=\"/docs/api/payment_methods/attach\"\u003Eattached\u003C/a\u003E to a Customer after the transaction completes.\u003C/p\u003E\n\n\u003Cp\u003EWhen processing card payments, Stripe also uses \u003Ccode\u003Esetup_future_usage\u003C/code\u003E to dynamically optimize your payment flow and comply with regional legislation and network rules, such as \u003Ca href=\"/docs/strong-customer-authentication\"\u003ESCA\u003C/a\u003E."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"enum_values":{"none":{"documentation":{"gate_specific":{},"localize_terms":[],"markdown":"Use `none` if you do not intend to reuse this payment method and want to override the top-level `setup_future_usage` value for this payment method.","undocumented":false,"html":"Use \u003Ccode\u003Enone\u003C/code\u003E if you do not intend to reuse this payment method and want to override the top-level \u003Ccode\u003Esetup_future_usage\u003C/code\u003E value for this payment method."}}},"object_type":"setup_future_usage"}},"object_type":"afterpay_clearpay"},"alipay":{"name":"alipay","check":"hash","validation":"hash","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"If the PaymentIntent's payment_method_types includes `alipay`, this hash contains the configurations that will be applied to each payment attempt of that type.\n","undocumented":false,"html":"If the PaymentIntent’s payment_method_types includes \u003Ccode\u003Ealipay\u003C/code\u003E, this hash contains the configurations that will be applied to each payment attempt of that type."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"subspec":{"setup_future_usage":{"name":"setup_future_usage","check":"string","validation":"string","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"Indicates that you intend to make future payments with this PaymentIntent's payment method.\n\nProviding this parameter will [attach the payment method](/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](/docs/api/payment_methods/attach) to a Customer after the transaction completes.\n\nWhen processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](/docs/strong-customer-authentication).\n","undocumented":false,"html":"Indicates that you intend to make future payments with this PaymentIntent’s payment method.\u003C/p\u003E\n\n\u003Cp\u003EProviding this parameter will \u003Ca href=\"/docs/payments/save-during-payment\"\u003Eattach the payment method\u003C/a\u003E to the PaymentIntent’s Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be \u003Ca href=\"/docs/api/payment_methods/attach\"\u003Eattached\u003C/a\u003E to a Customer after the transaction completes.\u003C/p\u003E\n\n\u003Cp\u003EWhen processing card payments, Stripe also uses \u003Ccode\u003Esetup_future_usage\u003C/code\u003E to dynamically optimize your payment flow and comply with regional legislation and network rules, such as \u003Ca href=\"/docs/strong-customer-authentication\"\u003ESCA\u003C/a\u003E."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"enum_values":{"off_session":{"documentation":{"gate_specific":{},"localize_terms":[],"markdown":"Use `off_session` if your customer may or may not be present in your checkout flow.","undocumented":false,"html":"Use \u003Ccode\u003Eoff_session\u003C/code\u003E if your customer may or may not be present in your checkout flow."}},"none":{"documentation":{"gate_specific":{},"localize_terms":[],"markdown":"Use `none` if you do not intend to reuse this payment method and want to override the top-level `setup_future_usage` value for this payment method.","undocumented":false,"html":"Use \u003Ccode\u003Enone\u003C/code\u003E if you do not intend to reuse this payment method and want to override the top-level \u003Ccode\u003Esetup_future_usage\u003C/code\u003E value for this payment method."}}},"object_type":"setup_future_usage"}},"object_type":"alipay"},"au_becs_debit":{"name":"au_becs_debit","check":"hash","validation":"hash","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"If the PaymentIntent's payment_method_types includes `au_becs_debit`, this hash contains the configurations that will be applied to each payment attempt of that type.\n","undocumented":false,"html":"If the PaymentIntent’s payment_method_types includes \u003Ccode\u003Eau_becs_debit\u003C/code\u003E, this hash contains the configurations that will be applied to each payment attempt of that type."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"subspec":{"setup_future_usage":{"name":"setup_future_usage","check":"string","validation":"string","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"Indicates that you intend to make future payments with this PaymentIntent's payment method.\n\nProviding this parameter will [attach the payment method](/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](/docs/api/payment_methods/attach) to a Customer after the transaction completes.\n\nWhen processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](/docs/strong-customer-authentication).\n","undocumented":false,"html":"Indicates that you intend to make future payments with this PaymentIntent’s payment method.\u003C/p\u003E\n\n\u003Cp\u003EProviding this parameter will \u003Ca href=\"/docs/payments/save-during-payment\"\u003Eattach the payment method\u003C/a\u003E to the PaymentIntent’s Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be \u003Ca href=\"/docs/api/payment_methods/attach\"\u003Eattached\u003C/a\u003E to a Customer after the transaction completes.\u003C/p\u003E\n\n\u003Cp\u003EWhen processing card payments, Stripe also uses \u003Ccode\u003Esetup_future_usage\u003C/code\u003E to dynamically optimize your payment flow and comply with regional legislation and network rules, such as \u003Ca href=\"/docs/strong-customer-authentication\"\u003ESCA\u003C/a\u003E."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"enum_values":{"on_session":{"documentation":{"gate_specific":{},"localize_terms":[],"markdown":"Use `on_session` if you intend to only reuse the payment method when your customer is present in your checkout flow.","undocumented":false,"html":"Use \u003Ccode\u003Eon_session\u003C/code\u003E if you intend to only reuse the payment method when your customer is present in your checkout flow."}},"off_session":{"documentation":{"gate_specific":{},"localize_terms":[],"markdown":"Use `off_session` if your customer may or may not be present in your checkout flow.","undocumented":false,"html":"Use \u003Ccode\u003Eoff_session\u003C/code\u003E if your customer may or may not be present in your checkout flow."}},"none":{"documentation":{"gate_specific":{},"localize_terms":[],"markdown":"Use `none` if you do not intend to reuse this payment method and want to override the top-level `setup_future_usage` value for this payment method.","undocumented":false,"html":"Use \u003Ccode\u003Enone\u003C/code\u003E if you do not intend to reuse this payment method and want to override the top-level \u003Ccode\u003Esetup_future_usage\u003C/code\u003E value for this payment method."}}},"object_type":"setup_future_usage"}},"object_type":"au_becs_debit"},"bacs_debit":{"name":"bacs_debit","check":"hash","validation":"hash","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"If the PaymentIntent's payment_method_types includes `bacs_debit`, this hash contains the configurations that will be applied to each payment attempt of that type.\n","undocumented":false,"html":"If the PaymentIntent’s payment_method_types includes \u003Ccode\u003Ebacs_debit\u003C/code\u003E, this hash contains the configurations that will be applied to each payment attempt of that type."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"subspec":{"setup_future_usage":{"name":"setup_future_usage","check":"string","validation":"string","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"Indicates that you intend to make future payments with this PaymentIntent's payment method.\n\nProviding this parameter will [attach the payment method](/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](/docs/api/payment_methods/attach) to a Customer after the transaction completes.\n\nWhen processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](/docs/strong-customer-authentication).\n","undocumented":false,"html":"Indicates that you intend to make future payments with this PaymentIntent’s payment method.\u003C/p\u003E\n\n\u003Cp\u003EProviding this parameter will \u003Ca href=\"/docs/payments/save-during-payment\"\u003Eattach the payment method\u003C/a\u003E to the PaymentIntent’s Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be \u003Ca href=\"/docs/api/payment_methods/attach\"\u003Eattached\u003C/a\u003E to a Customer after the transaction completes.\u003C/p\u003E\n\n\u003Cp\u003EWhen processing card payments, Stripe also uses \u003Ccode\u003Esetup_future_usage\u003C/code\u003E to dynamically optimize your payment flow and comply with regional legislation and network rules, such as \u003Ca href=\"/docs/strong-customer-authentication\"\u003ESCA\u003C/a\u003E."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"enum_values":{"on_session":{"documentation":{"gate_specific":{},"localize_terms":[],"markdown":"Use `on_session` if you intend to only reuse the payment method when your customer is present in your checkout flow.","undocumented":false,"html":"Use \u003Ccode\u003Eon_session\u003C/code\u003E if you intend to only reuse the payment method when your customer is present in your checkout flow."}},"off_session":{"documentation":{"gate_specific":{},"localize_terms":[],"markdown":"Use `off_session` if your customer may or may not be present in your checkout flow.","undocumented":false,"html":"Use \u003Ccode\u003Eoff_session\u003C/code\u003E if your customer may or may not be present in your checkout flow."}},"none":{"documentation":{"gate_specific":{},"localize_terms":[],"markdown":"Use `none` if you do not intend to reuse this payment method and want to override the top-level `setup_future_usage` value for this payment method.","undocumented":false,"html":"Use \u003Ccode\u003Enone\u003C/code\u003E if you do not intend to reuse this payment method and want to override the top-level \u003Ccode\u003Esetup_future_usage\u003C/code\u003E value for this payment method."}}},"object_type":"setup_future_usage"}},"object_type":"bacs_debit"},"bancontact":{"name":"bancontact","check":"hash","validation":"hash","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"If the PaymentIntent's payment_method_types includes `bancontact`, this hash contains the configurations that will be applied to each payment attempt of that type.\n","undocumented":false,"html":"If the PaymentIntent’s payment_method_types includes \u003Ccode\u003Ebancontact\u003C/code\u003E, this hash contains the configurations that will be applied to each payment attempt of that type."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"subspec":{"preferred_language":{"name":"preferred_language","check":"string","validation":"string","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"Preferred language of the Bancontact authorization page that the customer is redirected to.","undocumented":false,"html":"Preferred language of the Bancontact authorization page that the customer is redirected to."},"gate":false,"hide_unset_desc":null,"required":true,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"object_type":"preferred_language"},"setup_future_usage":{"name":"setup_future_usage","check":"string","validation":"string","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"Indicates that you intend to make future payments with this PaymentIntent's payment method.\n\nProviding this parameter will [attach the payment method](/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](/docs/api/payment_methods/attach) to a Customer after the transaction completes.\n\nWhen processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](/docs/strong-customer-authentication).\n","undocumented":false,"html":"Indicates that you intend to make future payments with this PaymentIntent’s payment method.\u003C/p\u003E\n\n\u003Cp\u003EProviding this parameter will \u003Ca href=\"/docs/payments/save-during-payment\"\u003Eattach the payment method\u003C/a\u003E to the PaymentIntent’s Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be \u003Ca href=\"/docs/api/payment_methods/attach\"\u003Eattached\u003C/a\u003E to a Customer after the transaction completes.\u003C/p\u003E\n\n\u003Cp\u003EWhen processing card payments, Stripe also uses \u003Ccode\u003Esetup_future_usage\u003C/code\u003E to dynamically optimize your payment flow and comply with regional legislation and network rules, such as \u003Ca href=\"/docs/strong-customer-authentication\"\u003ESCA\u003C/a\u003E."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"enum_values":{"off_session":{"documentation":{"gate_specific":{},"localize_terms":[],"markdown":"Use `off_session` if your customer may or may not be present in your checkout flow.","undocumented":false,"html":"Use \u003Ccode\u003Eoff_session\u003C/code\u003E if your customer may or may not be present in your checkout flow."}},"none":{"documentation":{"gate_specific":{},"localize_terms":[],"markdown":"Use `none` if you do not intend to reuse this payment method and want to override the top-level `setup_future_usage` value for this payment method.","undocumented":false,"html":"Use \u003Ccode\u003Enone\u003C/code\u003E if you do not intend to reuse this payment method and want to override the top-level \u003Ccode\u003Esetup_future_usage\u003C/code\u003E value for this payment method."}}},"object_type":"setup_future_usage"}},"object_type":"bancontact"},"blik":{"name":"blik","check":"hash","validation":"hash","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"If the PaymentIntent's payment_method_types includes `blik`, this hash contains the configurations that will be applied to each payment attempt of that type.\n","undocumented":false,"html":"If the PaymentIntent’s payment_method_types includes \u003Ccode\u003Eblik\u003C/code\u003E, this hash contains the configurations that will be applied to each payment attempt of that type."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"subspec":{},"object_type":"blik"},"boleto":{"name":"boleto","check":"hash","validation":"hash","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"If the PaymentIntent's payment_method_types includes `boleto`, this hash contains the configurations that will be applied to each payment attempt of that type.\n","undocumented":false,"html":"If the PaymentIntent’s payment_method_types includes \u003Ccode\u003Eboleto\u003C/code\u003E, this hash contains the configurations that will be applied to each payment attempt of that type."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"subspec":{"expires_after_days":{"name":"expires_after_days","check":"integer","validation":"integer","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"The number of calendar days before a Boleto voucher expires. For example, if you create a Boleto voucher on Monday and you set expires_after_days to 2, the Boleto voucher will expire on Wednesday at 23:59 America/Sao_Paulo time.","undocumented":false,"html":"The number of calendar days before a Boleto voucher expires. For example, if you create a Boleto voucher on Monday and you set expires_after_days to 2, the Boleto voucher will expire on Wednesday at 23:59 America/Sao_Paulo time."},"gate":false,"hide_unset_desc":null,"required":true,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"object_type":"expires_after_days"},"setup_future_usage":{"name":"setup_future_usage","check":"string","validation":"string","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"Indicates that you intend to make future payments with this PaymentIntent's payment method.\n\nProviding this parameter will [attach the payment method](/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](/docs/api/payment_methods/attach) to a Customer after the transaction completes.\n\nWhen processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](/docs/strong-customer-authentication).\n","undocumented":false,"html":"Indicates that you intend to make future payments with this PaymentIntent’s payment method.\u003C/p\u003E\n\n\u003Cp\u003EProviding this parameter will \u003Ca href=\"/docs/payments/save-during-payment\"\u003Eattach the payment method\u003C/a\u003E to the PaymentIntent’s Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be \u003Ca href=\"/docs/api/payment_methods/attach\"\u003Eattached\u003C/a\u003E to a Customer after the transaction completes.\u003C/p\u003E\n\n\u003Cp\u003EWhen processing card payments, Stripe also uses \u003Ccode\u003Esetup_future_usage\u003C/code\u003E to dynamically optimize your payment flow and comply with regional legislation and network rules, such as \u003Ca href=\"/docs/strong-customer-authentication\"\u003ESCA\u003C/a\u003E."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"enum_values":{"on_session":{"documentation":{"gate_specific":{},"localize_terms":[],"markdown":"Use `on_session` if you intend to only reuse the payment method when your customer is present in your checkout flow.","undocumented":false,"html":"Use \u003Ccode\u003Eon_session\u003C/code\u003E if you intend to only reuse the payment method when your customer is present in your checkout flow."}},"off_session":{"documentation":{"gate_specific":{},"localize_terms":[],"markdown":"Use `off_session` if your customer may or may not be present in your checkout flow.","undocumented":false,"html":"Use \u003Ccode\u003Eoff_session\u003C/code\u003E if your customer may or may not be present in your checkout flow."}},"none":{"documentation":{"gate_specific":{},"localize_terms":[],"markdown":"Use `none` if you do not intend to reuse this payment method and want to override the top-level `setup_future_usage` value for this payment method.","undocumented":false,"html":"Use \u003Ccode\u003Enone\u003C/code\u003E if you do not intend to reuse this payment method and want to override the top-level \u003Ccode\u003Esetup_future_usage\u003C/code\u003E value for this payment method."}}},"object_type":"setup_future_usage"}},"object_type":"boleto"},"card":{"name":"card","check":"hash","validation":"hash","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"If the PaymentIntent's payment_method_types includes `card`, this hash contains the configurations that will be applied to each payment attempt of that type.\n","undocumented":false,"html":"If the PaymentIntent’s payment_method_types includes \u003Ccode\u003Ecard\u003C/code\u003E, this hash contains the configurations that will be applied to each payment attempt of that type."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"subspec":{"capture_method":{"name":"capture_method","check":"string","validation":"string","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"Controls when the funds will be captured from the customer's account.\n","undocumented":false,"html":"Controls when the funds will be captured from the customer’s account."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"enum_values":{"manual":{"documentation":{"gate_specific":{},"localize_terms":[],"markdown":"Use `manual` if you intend to place the funds on hold and want to override the top-level `capture_method` value for this payment method.","undocumented":false,"html":"Use \u003Ccode\u003Emanual\u003C/code\u003E if you intend to place the funds on hold and want to override the top-level \u003Ccode\u003Ecapture_method\u003C/code\u003E value for this payment method."}}},"object_type":"capture_method"},"installments":{"name":"installments","check":"hash","validation":"hash","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"Installment details for this payment (Mexico only).\n\nFor more information, see the [installments integration guide](/docs/payments/installments).\n","undocumented":false,"html":"Installment details for this payment (Mexico only).\u003C/p\u003E\n\n\u003Cp\u003EFor more information, see the \u003Ca href=\"/docs/payments/installments\"\u003Einstallments integration guide\u003C/a\u003E."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"subspec":{"available_plans":{"name":"available_plans","check":"array","validation":"array","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"Installment plans that may be selected for this PaymentIntent.","undocumented":false,"html":"Installment plans that may be selected for this PaymentIntent."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"subspec":{"count":{"name":"count","check":"integer","validation":"integer","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"For `fixed_count` installment plans, this is the number of installment payments your customer will make to their credit card.","undocumented":false,"html":"For \u003Ccode\u003Efixed_count\u003C/code\u003E installment plans, this is the number of installment payments your customer will make to their credit card."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"object_type":"count"},"interval":{"name":"interval","check":"string","validation":"string","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"For `fixed_count` installment plans, this is the interval between installment payments your customer will make to their credit card.\nOne of `month`.\n","undocumented":false,"html":"For \u003Ccode\u003Efixed_count\u003C/code\u003E installment plans, this is the interval between installment payments your customer will make to their credit card.\nOne of \u003Ccode\u003Emonth\u003C/code\u003E."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"object_type":"interval"},"type":{"name":"type","check":"string","validation":"string","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"Type of installment plan, one of `fixed_count`.","undocumented":false,"html":"Type of installment plan, one of \u003Ccode\u003Efixed_count\u003C/code\u003E."},"gate":false,"hide_unset_desc":null,"required":true,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"object_type":"type"}},"object_type":"available_plans"},"enabled":{"name":"enabled","check":"boolean","validation":"boolean","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"Whether Installments are enabled for this PaymentIntent.","undocumented":false,"html":"Whether Installments are enabled for this PaymentIntent."},"gate":false,"hide_unset_desc":null,"required":true,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"object_type":"enabled"},"plan":{"name":"plan","check":"hash","validation":"hash","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"Installment plan selected for this PaymentIntent.","undocumented":false,"html":"Installment plan selected for this PaymentIntent."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"subspec":{"count":{"name":"count","check":"integer","validation":"integer","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"For `fixed_count` installment plans, this is the number of installment payments your customer will make to their credit card.","undocumented":false,"html":"For \u003Ccode\u003Efixed_count\u003C/code\u003E installment plans, this is the number of installment payments your customer will make to their credit card."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"object_type":"count"},"interval":{"name":"interval","check":"string","validation":"string","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"For `fixed_count` installment plans, this is the interval between installment payments your customer will make to their credit card.\nOne of `month`.\n","undocumented":false,"html":"For \u003Ccode\u003Efixed_count\u003C/code\u003E installment plans, this is the interval between installment payments your customer will make to their credit card.\nOne of \u003Ccode\u003Emonth\u003C/code\u003E."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"object_type":"interval"},"type":{"name":"type","check":"string","validation":"string","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"Type of installment plan, one of `fixed_count`.","undocumented":false,"html":"Type of installment plan, one of \u003Ccode\u003Efixed_count\u003C/code\u003E."},"gate":false,"hide_unset_desc":null,"required":true,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"object_type":"type"}},"object_type":"plan"}},"object_type":"installments"},"mandate_options":{"name":"mandate_options","check":"hash","validation":"hash","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"Configuration options for setting up an eMandate for cards issued in India.","undocumented":false,"html":"Configuration options for setting up an eMandate for cards issued in India."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"subspec":{"amount":{"name":"amount","check":"positive_integer","validation":"positive integer","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"Amount to be charged for future payments.","undocumented":false,"html":"Amount to be charged for future payments."},"gate":false,"hide_unset_desc":null,"required":true,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"object_type":"amount"},"amount_type":{"name":"amount_type","check":"string","validation":"string","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"One of `fixed` or `maximum`. If `fixed`, the `amount` param refers to the exact amount to be charged in future payments. If `maximum`, the amount charged can be up to the value passed for the `amount` param.\n","undocumented":false,"html":"One of \u003Ccode\u003Efixed\u003C/code\u003E or \u003Ccode\u003Emaximum\u003C/code\u003E. If \u003Ccode\u003Efixed\u003C/code\u003E, the \u003Ccode\u003Eamount\u003C/code\u003E param refers to the exact amount to be charged in future payments. If \u003Ccode\u003Emaximum\u003C/code\u003E, the amount charged can be up to the value passed for the \u003Ccode\u003Eamount\u003C/code\u003E param."},"gate":false,"hide_unset_desc":null,"required":true,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"object_type":"amount_type"},"description":{"name":"description","check":"string","validation":"string","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"A description of the mandate or subscription that is meant to be displayed to the customer.","undocumented":false,"html":"A description of the mandate or subscription that is meant to be displayed to the customer."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"object_type":"description"},"end_date":{"name":"end_date","check":"timestamp","validation":"timestamp","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"End date of the mandate or subscription. If not provided, the mandate will be active until canceled. If provided, end date should be after start date.\n","undocumented":false,"html":"End date of the mandate or subscription. If not provided, the mandate will be active until canceled. If provided, end date should be after start date."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"object_type":"end_date"},"interval":{"name":"interval","check":"string","validation":"string","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"Specifies payment frequency. One of `day`, `week`, `month`, `year`, or `sporadic`.\n","undocumented":false,"html":"Specifies payment frequency. One of \u003Ccode\u003Eday\u003C/code\u003E, \u003Ccode\u003Eweek\u003C/code\u003E, \u003Ccode\u003Emonth\u003C/code\u003E, \u003Ccode\u003Eyear\u003C/code\u003E, or \u003Ccode\u003Esporadic\u003C/code\u003E."},"gate":false,"hide_unset_desc":null,"required":true,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"object_type":"interval"},"interval_count":{"name":"interval_count","check":"positive_integer","validation":"positive integer","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"The number of intervals between payments. For example, `interval=month` and `interval_count=3` indicates one payment every three months. Maximum of one year interval allowed (1 year, 12 months, or 52 weeks). This parameter is optional when `interval=sporadic`.\n","undocumented":false,"html":"The number of intervals between payments. For example, \u003Ccode\u003Einterval=month\u003C/code\u003E and \u003Ccode\u003Einterval_count=3\u003C/code\u003E indicates one payment every three months. Maximum of one year interval allowed (1 year, 12 months, or 52 weeks). This parameter is optional when \u003Ccode\u003Einterval=sporadic\u003C/code\u003E."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"object_type":"interval_count"},"reference":{"name":"reference","check":"string","validation":"string","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"Unique identifier for the mandate or subscription.","undocumented":false,"html":"Unique identifier for the mandate or subscription."},"gate":false,"hide_unset_desc":null,"required":true,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"object_type":"reference"},"start_date":{"name":"start_date","check":"timestamp","validation":"timestamp","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"Start date of the mandate or subscription. Start date should not be lesser than yesterday.\n","undocumented":false,"html":"Start date of the mandate or subscription. Start date should not be lesser than yesterday."},"gate":false,"hide_unset_desc":null,"required":true,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"object_type":"start_date"},"supported_types":{"name":"supported_types","check":"array","validation":"array","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"Specifies the type of mandates supported. Possible values are `india`.\n","undocumented":false,"html":"Specifies the type of mandates supported. Possible values are \u003Ccode\u003Eindia\u003C/code\u003E."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"object_type":"supported_types"}},"object_type":"mandate_options"},"network":{"name":"network","check":"string","validation":"string","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"Selected network to process this payment intent on. Depends on the available networks of the card attached to the payment intent. Can be only set confirm-time.","undocumented":false,"html":"Selected network to process this payment intent on. Depends on the available networks of the card attached to the payment intent. Can be only set confirm-time."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"object_type":"network"},"request_three_d_secure":{"name":"request_three_d_secure","check":"string","validation":"string","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"We strongly recommend that you rely on our SCA Engine to automatically prompt your customers for authentication based on risk level and [other requirements](/docs/strong-customer-authentication). However, if you wish to request 3D Secure based on logic from your own fraud engine, provide this option. Permitted values include: `automatic` or `any`. If not provided, defaults to `automatic`. Read our guide on [manually requesting 3D Secure](/docs/payments/3d-secure#manual-three-ds) for more information on how this configuration interacts with Radar and our SCA Engine.","undocumented":false,"html":"We strongly recommend that you rely on our SCA Engine to automatically prompt your customers for authentication based on risk level and \u003Ca href=\"/docs/strong-customer-authentication\"\u003Eother requirements\u003C/a\u003E. However, if you wish to request 3D Secure based on logic from your own fraud engine, provide this option. Permitted values include: \u003Ccode\u003Eautomatic\u003C/code\u003E or \u003Ccode\u003Eany\u003C/code\u003E. If not provided, defaults to \u003Ccode\u003Eautomatic\u003C/code\u003E. Read our guide on \u003Ca href=\"/docs/payments/3d-secure#manual-three-ds\"\u003Emanually requesting 3D Secure\u003C/a\u003E for more information on how this configuration interacts with Radar and our SCA Engine."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":"advanced","requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"object_type":"request_three_d_secure"},"setup_future_usage":{"name":"setup_future_usage","check":"string","validation":"string","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"Indicates that you intend to make future payments with this PaymentIntent's payment method.\n\nProviding this parameter will [attach the payment method](/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](/docs/api/payment_methods/attach) to a Customer after the transaction completes.\n\nWhen processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](/docs/strong-customer-authentication).\n","undocumented":false,"html":"Indicates that you intend to make future payments with this PaymentIntent’s payment method.\u003C/p\u003E\n\n\u003Cp\u003EProviding this parameter will \u003Ca href=\"/docs/payments/save-during-payment\"\u003Eattach the payment method\u003C/a\u003E to the PaymentIntent’s Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be \u003Ca href=\"/docs/api/payment_methods/attach\"\u003Eattached\u003C/a\u003E to a Customer after the transaction completes.\u003C/p\u003E\n\n\u003Cp\u003EWhen processing card payments, Stripe also uses \u003Ccode\u003Esetup_future_usage\u003C/code\u003E to dynamically optimize your payment flow and comply with regional legislation and network rules, such as \u003Ca href=\"/docs/strong-customer-authentication\"\u003ESCA\u003C/a\u003E."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"enum_values":{"on_session":{"documentation":{"gate_specific":{},"localize_terms":[],"markdown":"Use `on_session` if you intend to only reuse the payment method when your customer is present in your checkout flow.","undocumented":false,"html":"Use \u003Ccode\u003Eon_session\u003C/code\u003E if you intend to only reuse the payment method when your customer is present in your checkout flow."}},"off_session":{"documentation":{"gate_specific":{},"localize_terms":[],"markdown":"Use `off_session` if your customer may or may not be present in your checkout flow.","undocumented":false,"html":"Use \u003Ccode\u003Eoff_session\u003C/code\u003E if your customer may or may not be present in your checkout flow."}},"none":{"documentation":{"gate_specific":{},"localize_terms":[],"markdown":"Use `none` if you do not intend to reuse this payment method and want to override the top-level `setup_future_usage` value for this payment method.","undocumented":false,"html":"Use \u003Ccode\u003Enone\u003C/code\u003E if you do not intend to reuse this payment method and want to override the top-level \u003Ccode\u003Esetup_future_usage\u003C/code\u003E value for this payment method."}}},"object_type":"setup_future_usage"},"statement_descriptor_suffix_kana":{"name":"statement_descriptor_suffix_kana","check":"string","validation":"string","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"Provides information about a card payment that customers see on their statements. Concatenated with the Kana prefix (shortened Kana descriptor) or Kana statement descriptor that’s set on the account to form the complete statement descriptor. Maximum 22 characters. On card statements, the *concatenation* of both prefix and suffix (including separators) will appear truncated to 22 characters.","undocumented":false,"html":"Provides information about a card payment that customers see on their statements. Concatenated with the Kana prefix (shortened Kana descriptor) or Kana statement descriptor that’s set on the account to form the complete statement descriptor. Maximum 22 characters. On card statements, the \u003Cem\u003Econcatenation\u003C/em\u003E of both prefix and suffix (including separators) will appear truncated to 22 characters."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"object_type":"statement_descriptor_suffix_kana"},"statement_descriptor_suffix_kanji":{"name":"statement_descriptor_suffix_kanji","check":"string","validation":"string","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"Provides information about a card payment that customers see on their statements. Concatenated with the Kanji prefix (shortened Kanji descriptor) or Kanji statement descriptor that’s set on the account to form the complete statement descriptor. Maximum 17 characters. On card statements, the *concatenation* of both prefix and suffix (including separators) will appear truncated to 17 characters.","undocumented":false,"html":"Provides information about a card payment that customers see on their statements. Concatenated with the Kanji prefix (shortened Kanji descriptor) or Kanji statement descriptor that’s set on the account to form the complete statement descriptor. Maximum 17 characters. On card statements, the \u003Cem\u003Econcatenation\u003C/em\u003E of both prefix and suffix (including separators) will appear truncated to 17 characters."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"object_type":"statement_descriptor_suffix_kanji"}},"object_type":"card"},"card_present":{"name":"card_present","check":"hash","validation":"hash","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"If the PaymentIntent's payment_method_types includes `card_present`, this hash contains the configurations that will be applied to each payment attempt of that type.\n","undocumented":false,"html":"If the PaymentIntent’s payment_method_types includes \u003Ccode\u003Ecard_present\u003C/code\u003E, this hash contains the configurations that will be applied to each payment attempt of that type."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"subspec":{"capture_method":{"name":"capture_method","check":"string","validation":"string","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"Controls when the funds will be captured from the customer's account.\n","undocumented":false,"html":"Controls when the funds will be captured from the customer’s account."},"gate":true,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"enum_values":{"manual_preferred":{"documentation":{"gate_specific":{},"localize_terms":[],"markdown":"Use `manual_preferred` if you prefer `manual` capture_method but support falling back to `automatic` based on the presented payment method.","undocumented":false,"html":"Use \u003Ccode\u003Emanual_preferred\u003C/code\u003E if you prefer \u003Ccode\u003Emanual\u003C/code\u003E capture_method but support falling back to \u003Ccode\u003Eautomatic\u003C/code\u003E based on the presented payment method."}}},"object_type":"capture_method"},"request_extended_authorization":{"name":"request_extended_authorization","check":"boolean","validation":"boolean","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"Request ability to capture this payment beyond the standard [authorization validity window](/docs/terminal/features/extended-authorizations#authorization-validity)","undocumented":false,"html":"Request ability to capture this payment beyond the standard \u003Ca href=\"/docs/terminal/features/extended-authorizations#authorization-validity\"\u003Eauthorization validity window\u003C/a\u003E"},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"object_type":"request_extended_authorization"},"request_incremental_authorization_support":{"name":"request_incremental_authorization_support","check":"boolean","validation":"boolean","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"Request ability to [increment](/docs/terminal/features/incremental-authorizations) this PaymentIntent if the combination of MCC and card brand is eligible. Check [incremental_authorization_supported](/docs/api/charges/object#charge_object-payment_method_details-card_present-incremental_authorization_supported) in the [Confirm](/docs/api/payment_intents/confirm) response to verify support.","undocumented":false,"html":"Request ability to \u003Ca href=\"/docs/terminal/features/incremental-authorizations\"\u003Eincrement\u003C/a\u003E this PaymentIntent if the combination of MCC and card brand is eligible. Check \u003Ca href=\"/docs/api/charges/object#charge_object-payment_method_details-card_present-incremental_authorization_supported\"\u003Eincremental_authorization_supported\u003C/a\u003E in the \u003Ca href=\"/docs/api/payment_intents/confirm\"\u003EConfirm\u003C/a\u003E response to verify support."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"object_type":"request_incremental_authorization_support"},"routing":{"name":"routing","check":"hash","validation":"hash","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"Network routing priority on co-branded EMV cards supporting domestic debit and international card schemes.","undocumented":false,"html":"Network routing priority on co-branded EMV cards supporting domestic debit and international card schemes."},"gate":true,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"subspec":{"requested_priority":{"name":"requested_priority","check":"string","validation":"string","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"Requested routing priority","undocumented":false,"html":"Requested routing priority"},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"enum_values":{"domestic":{"documentation":{"gate_specific":{},"localize_terms":[],"markdown":"Prioritize domestic debit network routing on payment method collection","undocumented":false,"html":"Prioritize domestic debit network routing on payment method collection"}},"international":{"documentation":{"gate_specific":{},"localize_terms":[],"markdown":"Prioritize international network routing on payment method collection","undocumented":false,"html":"Prioritize international network routing on payment method collection"}}},"object_type":"requested_priority"}},"object_type":"routing"}},"object_type":"card_present"},"customer_balance":{"name":"customer_balance","check":"hash","validation":"hash","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"If the PaymentIntent's payment_method_types includes `customer_balance`, this hash contains the configurations that will be applied to each payment attempt of that type.\n","undocumented":false,"html":"If the PaymentIntent’s payment_method_types includes \u003Ccode\u003Ecustomer_balance\u003C/code\u003E, this hash contains the configurations that will be applied to each payment attempt of that type."},"gate":true,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"subspec":{"bank_transfer":{"name":"bank_transfer","check":"hash","validation":"hash","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"Configuration for the bank transfer funding type, if the `funding_type` is set to `bank_transfer`.\n","undocumented":false,"html":"Configuration for the bank transfer funding type, if the \u003Ccode\u003Efunding_type\u003C/code\u003E is set to \u003Ccode\u003Ebank_transfer\u003C/code\u003E."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"subspec":{"eu_bank_transfer":{"name":"eu_bank_transfer","check":"hash","validation":"hash","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"Configuration for eu_bank_transfer","undocumented":false,"html":"Configuration for eu_bank_transfer"},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"subspec":{"country":{"name":"country","check":"string","validation":"string","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"The desired country code of the bank account information. Permitted values include: `BE`, `DE`, `ES`, `FR`, `IE`, or `NL`.\n","undocumented":false,"html":"The desired country code of the bank account information. Permitted values include: \u003Ccode\u003EBE\u003C/code\u003E, \u003Ccode\u003EDE\u003C/code\u003E, \u003Ccode\u003EES\u003C/code\u003E, \u003Ccode\u003EFR\u003C/code\u003E, \u003Ccode\u003EIE\u003C/code\u003E, or \u003Ccode\u003ENL\u003C/code\u003E."},"gate":false,"hide_unset_desc":null,"required":true,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"object_type":"country"}},"object_type":"eu_bank_transfer"},"requested_address_types":{"name":"requested_address_types","check":"array","validation":"array","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"List of address types that should be returned in the financial_addresses response. If not specified, all valid types will be returned.\n\nPermitted values include: `sort_code`, `zengin`, `iban`, or `spei`.\n","undocumented":false,"html":"List of address types that should be returned in the financial_addresses response. If not specified, all valid types will be returned.\u003C/p\u003E\n\n\u003Cp\u003EPermitted values include: \u003Ccode\u003Esort_code\u003C/code\u003E, \u003Ccode\u003Ezengin\u003C/code\u003E, \u003Ccode\u003Eiban\u003C/code\u003E, or \u003Ccode\u003Espei\u003C/code\u003E."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"enum_values":{"sort_code":{"documentation":{"gate_specific":{},"localize_terms":[],"markdown":"sort_code bank account address type","undocumented":false,"html":"sort_code bank account address type"}},"zengin":{"documentation":{"gate_specific":{},"localize_terms":[],"markdown":"zengin bank account address type","undocumented":false,"html":"zengin bank account address type"}},"sepa":{"documentation":{"gate_specific":{},"localize_terms":[],"markdown":"sepa bank account address type","undocumented":false,"html":"sepa bank account address type"}},"spei":{"documentation":{"gate_specific":{},"localize_terms":[],"markdown":"spei bank account address type","undocumented":false,"html":"spei bank account address type"}},"iban":{"documentation":{"gate_specific":{},"localize_terms":[],"markdown":"iban bank account address type","undocumented":false,"html":"iban bank account address type"}}},"object_type":"requested_address_types"},"type":{"name":"type","check":"string","validation":"string","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"The bank transfer type that this PaymentIntent is allowed to use for funding Permitted values include: `eu_bank_transfer`, `gb_bank_transfer`, `jp_bank_transfer`, or `mx_bank_transfer`.\n","undocumented":false,"html":"The bank transfer type that this PaymentIntent is allowed to use for funding Permitted values include: \u003Ccode\u003Eeu_bank_transfer\u003C/code\u003E, \u003Ccode\u003Egb_bank_transfer\u003C/code\u003E, \u003Ccode\u003Ejp_bank_transfer\u003C/code\u003E, or \u003Ccode\u003Emx_bank_transfer\u003C/code\u003E."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"enum_values":{"eu_bank_transfer":{"documentation":{"gate_specific":{},"localize_terms":[],"markdown":"A bank transfer of type eu_bank_transfer","undocumented":false,"html":"A bank transfer of type eu_bank_transfer"}},"gb_bank_transfer":{"documentation":{"gate_specific":{},"localize_terms":[],"markdown":"A bank transfer of type gb_bank_transfer","undocumented":false,"html":"A bank transfer of type gb_bank_transfer"}},"jp_bank_transfer":{"documentation":{"gate_specific":{},"localize_terms":[],"markdown":"A bank transfer of type jp_bank_transfer","undocumented":false,"html":"A bank transfer of type jp_bank_transfer"}},"mx_bank_transfer":{"documentation":{"gate_specific":{},"localize_terms":[],"markdown":"A bank transfer of type mx_bank_transfer","undocumented":false,"html":"A bank transfer of type mx_bank_transfer"}}},"object_type":"type"}},"object_type":"bank_transfer"},"funding_type":{"name":"funding_type","check":"string","validation":"string","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"The funding method type to be used when there are not enough funds in the customer balance. Permitted values include: `bank_transfer`.\n","undocumented":false,"html":"The funding method type to be used when there are not enough funds in the customer balance. Permitted values include: \u003Ccode\u003Ebank_transfer\u003C/code\u003E."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"object_type":"funding_type"},"setup_future_usage":{"name":"setup_future_usage","check":"string","validation":"string","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"Indicates that you intend to make future payments with this PaymentIntent's payment method.\n\nProviding this parameter will [attach the payment method](/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](/docs/api/payment_methods/attach) to a Customer after the transaction completes.\n\nWhen processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](/docs/strong-customer-authentication).\n","undocumented":false,"html":"Indicates that you intend to make future payments with this PaymentIntent’s payment method.\u003C/p\u003E\n\n\u003Cp\u003EProviding this parameter will \u003Ca href=\"/docs/payments/save-during-payment\"\u003Eattach the payment method\u003C/a\u003E to the PaymentIntent’s Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be \u003Ca href=\"/docs/api/payment_methods/attach\"\u003Eattached\u003C/a\u003E to a Customer after the transaction completes.\u003C/p\u003E\n\n\u003Cp\u003EWhen processing card payments, Stripe also uses \u003Ccode\u003Esetup_future_usage\u003C/code\u003E to dynamically optimize your payment flow and comply with regional legislation and network rules, such as \u003Ca href=\"/docs/strong-customer-authentication\"\u003ESCA\u003C/a\u003E."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"enum_values":{"none":{"documentation":{"gate_specific":{},"localize_terms":[],"markdown":"Use `none` if you do not intend to reuse this payment method and want to override the top-level `setup_future_usage` value for this payment method.","undocumented":false,"html":"Use \u003Ccode\u003Enone\u003C/code\u003E if you do not intend to reuse this payment method and want to override the top-level \u003Ccode\u003Esetup_future_usage\u003C/code\u003E value for this payment method."}}},"object_type":"setup_future_usage"}},"object_type":"customer_balance"},"eps":{"name":"eps","check":"hash","validation":"hash","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"If the PaymentIntent's payment_method_types includes `eps`, this hash contains the configurations that will be applied to each payment attempt of that type.\n","undocumented":false,"html":"If the PaymentIntent’s payment_method_types includes \u003Ccode\u003Eeps\u003C/code\u003E, this hash contains the configurations that will be applied to each payment attempt of that type."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"subspec":{"setup_future_usage":{"name":"setup_future_usage","check":"string","validation":"string","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"Indicates that you intend to make future payments with this PaymentIntent's payment method.\n\nProviding this parameter will [attach the payment method](/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](/docs/api/payment_methods/attach) to a Customer after the transaction completes.\n\nWhen processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](/docs/strong-customer-authentication).\n","undocumented":false,"html":"Indicates that you intend to make future payments with this PaymentIntent’s payment method.\u003C/p\u003E\n\n\u003Cp\u003EProviding this parameter will \u003Ca href=\"/docs/payments/save-during-payment\"\u003Eattach the payment method\u003C/a\u003E to the PaymentIntent’s Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be \u003Ca href=\"/docs/api/payment_methods/attach\"\u003Eattached\u003C/a\u003E to a Customer after the transaction completes.\u003C/p\u003E\n\n\u003Cp\u003EWhen processing card payments, Stripe also uses \u003Ccode\u003Esetup_future_usage\u003C/code\u003E to dynamically optimize your payment flow and comply with regional legislation and network rules, such as \u003Ca href=\"/docs/strong-customer-authentication\"\u003ESCA\u003C/a\u003E."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"enum_values":{"none":{"documentation":{"gate_specific":{},"localize_terms":[],"markdown":"Use `none` if you do not intend to reuse this payment method and want to override the top-level `setup_future_usage` value for this payment method.","undocumented":false,"html":"Use \u003Ccode\u003Enone\u003C/code\u003E if you do not intend to reuse this payment method and want to override the top-level \u003Ccode\u003Esetup_future_usage\u003C/code\u003E value for this payment method."}}},"object_type":"setup_future_usage"}},"object_type":"eps"},"fpx":{"name":"fpx","check":"hash","validation":"hash","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"If the PaymentIntent's payment_method_types includes `fpx`, this hash contains the configurations that will be applied to each payment attempt of that type.\n","undocumented":false,"html":"If the PaymentIntent’s payment_method_types includes \u003Ccode\u003Efpx\u003C/code\u003E, this hash contains the configurations that will be applied to each payment attempt of that type."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"subspec":{"setup_future_usage":{"name":"setup_future_usage","check":"string","validation":"string","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"Indicates that you intend to make future payments with this PaymentIntent's payment method.\n\nProviding this parameter will [attach the payment method](/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](/docs/api/payment_methods/attach) to a Customer after the transaction completes.\n\nWhen processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](/docs/strong-customer-authentication).\n","undocumented":false,"html":"Indicates that you intend to make future payments with this PaymentIntent’s payment method.\u003C/p\u003E\n\n\u003Cp\u003EProviding this parameter will \u003Ca href=\"/docs/payments/save-during-payment\"\u003Eattach the payment method\u003C/a\u003E to the PaymentIntent’s Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be \u003Ca href=\"/docs/api/payment_methods/attach\"\u003Eattached\u003C/a\u003E to a Customer after the transaction completes.\u003C/p\u003E\n\n\u003Cp\u003EWhen processing card payments, Stripe also uses \u003Ccode\u003Esetup_future_usage\u003C/code\u003E to dynamically optimize your payment flow and comply with regional legislation and network rules, such as \u003Ca href=\"/docs/strong-customer-authentication\"\u003ESCA\u003C/a\u003E."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"enum_values":{"none":{"documentation":{"gate_specific":{},"localize_terms":[],"markdown":"Use `none` if you do not intend to reuse this payment method and want to override the top-level `setup_future_usage` value for this payment method.","undocumented":false,"html":"Use \u003Ccode\u003Enone\u003C/code\u003E if you do not intend to reuse this payment method and want to override the top-level \u003Ccode\u003Esetup_future_usage\u003C/code\u003E value for this payment method."}}},"object_type":"setup_future_usage"}},"object_type":"fpx"},"giropay":{"name":"giropay","check":"hash","validation":"hash","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"If the PaymentIntent's payment_method_types includes `giropay`, this hash contains the configurations that will be applied to each payment attempt of that type.\n","undocumented":false,"html":"If the PaymentIntent’s payment_method_types includes \u003Ccode\u003Egiropay\u003C/code\u003E, this hash contains the configurations that will be applied to each payment attempt of that type."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"subspec":{"setup_future_usage":{"name":"setup_future_usage","check":"string","validation":"string","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"Indicates that you intend to make future payments with this PaymentIntent's payment method.\n\nProviding this parameter will [attach the payment method](/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](/docs/api/payment_methods/attach) to a Customer after the transaction completes.\n\nWhen processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](/docs/strong-customer-authentication).\n","undocumented":false,"html":"Indicates that you intend to make future payments with this PaymentIntent’s payment method.\u003C/p\u003E\n\n\u003Cp\u003EProviding this parameter will \u003Ca href=\"/docs/payments/save-during-payment\"\u003Eattach the payment method\u003C/a\u003E to the PaymentIntent’s Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be \u003Ca href=\"/docs/api/payment_methods/attach\"\u003Eattached\u003C/a\u003E to a Customer after the transaction completes.\u003C/p\u003E\n\n\u003Cp\u003EWhen processing card payments, Stripe also uses \u003Ccode\u003Esetup_future_usage\u003C/code\u003E to dynamically optimize your payment flow and comply with regional legislation and network rules, such as \u003Ca href=\"/docs/strong-customer-authentication\"\u003ESCA\u003C/a\u003E."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"enum_values":{"none":{"documentation":{"gate_specific":{},"localize_terms":[],"markdown":"Use `none` if you do not intend to reuse this payment method and want to override the top-level `setup_future_usage` value for this payment method.","undocumented":false,"html":"Use \u003Ccode\u003Enone\u003C/code\u003E if you do not intend to reuse this payment method and want to override the top-level \u003Ccode\u003Esetup_future_usage\u003C/code\u003E value for this payment method."}}},"object_type":"setup_future_usage"}},"object_type":"giropay"},"grabpay":{"name":"grabpay","check":"hash","validation":"hash","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"If the PaymentIntent's payment_method_types includes `grabpay`, this hash contains the configurations that will be applied to each payment attempt of that type.\n","undocumented":false,"html":"If the PaymentIntent’s payment_method_types includes \u003Ccode\u003Egrabpay\u003C/code\u003E, this hash contains the configurations that will be applied to each payment attempt of that type."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"subspec":{"setup_future_usage":{"name":"setup_future_usage","check":"string","validation":"string","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"Indicates that you intend to make future payments with this PaymentIntent's payment method.\n\nProviding this parameter will [attach the payment method](/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](/docs/api/payment_methods/attach) to a Customer after the transaction completes.\n\nWhen processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](/docs/strong-customer-authentication).\n","undocumented":false,"html":"Indicates that you intend to make future payments with this PaymentIntent’s payment method.\u003C/p\u003E\n\n\u003Cp\u003EProviding this parameter will \u003Ca href=\"/docs/payments/save-during-payment\"\u003Eattach the payment method\u003C/a\u003E to the PaymentIntent’s Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be \u003Ca href=\"/docs/api/payment_methods/attach\"\u003Eattached\u003C/a\u003E to a Customer after the transaction completes.\u003C/p\u003E\n\n\u003Cp\u003EWhen processing card payments, Stripe also uses \u003Ccode\u003Esetup_future_usage\u003C/code\u003E to dynamically optimize your payment flow and comply with regional legislation and network rules, such as \u003Ca href=\"/docs/strong-customer-authentication\"\u003ESCA\u003C/a\u003E."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"enum_values":{"none":{"documentation":{"gate_specific":{},"localize_terms":[],"markdown":"Use `none` if you do not intend to reuse this payment method and want to override the top-level `setup_future_usage` value for this payment method.","undocumented":false,"html":"Use \u003Ccode\u003Enone\u003C/code\u003E if you do not intend to reuse this payment method and want to override the top-level \u003Ccode\u003Esetup_future_usage\u003C/code\u003E value for this payment method."}}},"object_type":"setup_future_usage"}},"object_type":"grabpay"},"ideal":{"name":"ideal","check":"hash","validation":"hash","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"If the PaymentIntent's payment_method_types includes `ideal`, this hash contains the configurations that will be applied to each payment attempt of that type.\n","undocumented":false,"html":"If the PaymentIntent’s payment_method_types includes \u003Ccode\u003Eideal\u003C/code\u003E, this hash contains the configurations that will be applied to each payment attempt of that type."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"subspec":{"setup_future_usage":{"name":"setup_future_usage","check":"string","validation":"string","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"Indicates that you intend to make future payments with this PaymentIntent's payment method.\n\nProviding this parameter will [attach the payment method](/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](/docs/api/payment_methods/attach) to a Customer after the transaction completes.\n\nWhen processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](/docs/strong-customer-authentication).\n","undocumented":false,"html":"Indicates that you intend to make future payments with this PaymentIntent’s payment method.\u003C/p\u003E\n\n\u003Cp\u003EProviding this parameter will \u003Ca href=\"/docs/payments/save-during-payment\"\u003Eattach the payment method\u003C/a\u003E to the PaymentIntent’s Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be \u003Ca href=\"/docs/api/payment_methods/attach\"\u003Eattached\u003C/a\u003E to a Customer after the transaction completes.\u003C/p\u003E\n\n\u003Cp\u003EWhen processing card payments, Stripe also uses \u003Ccode\u003Esetup_future_usage\u003C/code\u003E to dynamically optimize your payment flow and comply with regional legislation and network rules, such as \u003Ca href=\"/docs/strong-customer-authentication\"\u003ESCA\u003C/a\u003E."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"enum_values":{"off_session":{"documentation":{"gate_specific":{},"localize_terms":[],"markdown":"Use `off_session` if your customer may or may not be present in your checkout flow.","undocumented":false,"html":"Use \u003Ccode\u003Eoff_session\u003C/code\u003E if your customer may or may not be present in your checkout flow."}},"none":{"documentation":{"gate_specific":{},"localize_terms":[],"markdown":"Use `none` if you do not intend to reuse this payment method and want to override the top-level `setup_future_usage` value for this payment method.","undocumented":false,"html":"Use \u003Ccode\u003Enone\u003C/code\u003E if you do not intend to reuse this payment method and want to override the top-level \u003Ccode\u003Esetup_future_usage\u003C/code\u003E value for this payment method."}}},"object_type":"setup_future_usage"}},"object_type":"ideal"},"interac_present":{"name":"interac_present","check":"hash","validation":"hash","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"If the PaymentIntent's payment_method_types includes `interac_present`, this hash contains the configurations that will be applied to each payment attempt of that type.\n","undocumented":false,"html":"If the PaymentIntent’s payment_method_types includes \u003Ccode\u003Einterac_present\u003C/code\u003E, this hash contains the configurations that will be applied to each payment attempt of that type."},"gate":true,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"subspec":{},"object_type":"interac_present"},"klarna":{"name":"klarna","check":"hash","validation":"hash","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"If the PaymentIntent's payment_method_types includes `klarna`, this hash contains the configurations that will be applied to each payment attempt of that type.\n","undocumented":false,"html":"If the PaymentIntent’s payment_method_types includes \u003Ccode\u003Eklarna\u003C/code\u003E, this hash contains the configurations that will be applied to each payment attempt of that type."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"subspec":{"capture_method":{"name":"capture_method","check":"string","validation":"string","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"Controls when the funds will be captured from the customer's account.\n","undocumented":false,"html":"Controls when the funds will be captured from the customer’s account."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"enum_values":{"manual":{"documentation":{"gate_specific":{},"localize_terms":[],"markdown":"Use `manual` if you intend to place the funds on hold and want to override the top-level `capture_method` value for this payment method.","undocumented":false,"html":"Use \u003Ccode\u003Emanual\u003C/code\u003E if you intend to place the funds on hold and want to override the top-level \u003Ccode\u003Ecapture_method\u003C/code\u003E value for this payment method."}}},"object_type":"capture_method"},"preferred_locale":{"name":"preferred_locale","check":"string","validation":"string","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"Preferred locale of the Klarna checkout page that the customer is redirected to.","undocumented":false,"html":"Preferred locale of the Klarna checkout page that the customer is redirected to."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"object_type":"preferred_locale"},"setup_future_usage":{"name":"setup_future_usage","check":"string","validation":"string","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"Indicates that you intend to make future payments with this PaymentIntent's payment method.\n\nProviding this parameter will [attach the payment method](/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](/docs/api/payment_methods/attach) to a Customer after the transaction completes.\n\nWhen processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](/docs/strong-customer-authentication).\n","undocumented":false,"html":"Indicates that you intend to make future payments with this PaymentIntent’s payment method.\u003C/p\u003E\n\n\u003Cp\u003EProviding this parameter will \u003Ca href=\"/docs/payments/save-during-payment\"\u003Eattach the payment method\u003C/a\u003E to the PaymentIntent’s Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be \u003Ca href=\"/docs/api/payment_methods/attach\"\u003Eattached\u003C/a\u003E to a Customer after the transaction completes.\u003C/p\u003E\n\n\u003Cp\u003EWhen processing card payments, Stripe also uses \u003Ccode\u003Esetup_future_usage\u003C/code\u003E to dynamically optimize your payment flow and comply with regional legislation and network rules, such as \u003Ca href=\"/docs/strong-customer-authentication\"\u003ESCA\u003C/a\u003E."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"enum_values":{"none":{"documentation":{"gate_specific":{},"localize_terms":[],"markdown":"Use `none` if you do not intend to reuse this payment method and want to override the top-level `setup_future_usage` value for this payment method.","undocumented":false,"html":"Use \u003Ccode\u003Enone\u003C/code\u003E if you do not intend to reuse this payment method and want to override the top-level \u003Ccode\u003Esetup_future_usage\u003C/code\u003E value for this payment method."}}},"object_type":"setup_future_usage"}},"object_type":"klarna"},"konbini":{"name":"konbini","check":"hash","validation":"hash","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"If the PaymentIntent's payment_method_types includes `konbini`, this hash contains the configurations that will be applied to each payment attempt of that type.\n","undocumented":false,"html":"If the PaymentIntent’s payment_method_types includes \u003Ccode\u003Ekonbini\u003C/code\u003E, this hash contains the configurations that will be applied to each payment attempt of that type."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"subspec":{"confirmation_number":{"name":"confirmation_number","check":"string","validation":"string","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"An optional 10 to 11 digit numeric-only string determining the confirmation code at applicable convenience stores.","undocumented":false,"html":"An optional 10 to 11 digit numeric-only string determining the confirmation code at applicable convenience stores."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"object_type":"confirmation_number"},"expires_after_days":{"name":"expires_after_days","check":"integer","validation":"integer","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"The number of calendar days (between 1 and 60) after which Konbini payment instructions will expire. For example, if a PaymentIntent is confirmed with Konbini and `expires_after_days` set to 2 on Monday JST, the instructions will expire on Wednesday 23:59:59 JST.","undocumented":false,"html":"The number of calendar days (between 1 and 60) after which Konbini payment instructions will expire. For example, if a PaymentIntent is confirmed with Konbini and \u003Ccode\u003Eexpires_after_days\u003C/code\u003E set to 2 on Monday JST, the instructions will expire on Wednesday 23:59:59 JST."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"object_type":"expires_after_days"},"expires_at":{"name":"expires_at","check":"timestamp","validation":"timestamp","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"The timestamp at which the Konbini payment instructions will expire. Only one of `expires_after_days` or `expires_at` may be set.","undocumented":false,"html":"The timestamp at which the Konbini payment instructions will expire. Only one of \u003Ccode\u003Eexpires_after_days\u003C/code\u003E or \u003Ccode\u003Eexpires_at\u003C/code\u003E may be set."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"object_type":"expires_at"},"product_description":{"name":"product_description","check":"string","validation":"string","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"A product descriptor of up to 22 characters, which will appear to customers at the convenience store.","undocumented":false,"html":"A product descriptor of up to 22 characters, which will appear to customers at the convenience store."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"object_type":"product_description"},"setup_future_usage":{"name":"setup_future_usage","check":"string","validation":"string","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"Indicates that you intend to make future payments with this PaymentIntent's payment method.\n\nProviding this parameter will [attach the payment method](/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](/docs/api/payment_methods/attach) to a Customer after the transaction completes.\n\nWhen processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](/docs/strong-customer-authentication).\n","undocumented":false,"html":"Indicates that you intend to make future payments with this PaymentIntent’s payment method.\u003C/p\u003E\n\n\u003Cp\u003EProviding this parameter will \u003Ca href=\"/docs/payments/save-during-payment\"\u003Eattach the payment method\u003C/a\u003E to the PaymentIntent’s Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be \u003Ca href=\"/docs/api/payment_methods/attach\"\u003Eattached\u003C/a\u003E to a Customer after the transaction completes.\u003C/p\u003E\n\n\u003Cp\u003EWhen processing card payments, Stripe also uses \u003Ccode\u003Esetup_future_usage\u003C/code\u003E to dynamically optimize your payment flow and comply with regional legislation and network rules, such as \u003Ca href=\"/docs/strong-customer-authentication\"\u003ESCA\u003C/a\u003E."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"enum_values":{"none":{"documentation":{"gate_specific":{},"localize_terms":[],"markdown":"Use `none` if you do not intend to reuse this payment method and want to override the top-level `setup_future_usage` value for this payment method.","undocumented":false,"html":"Use \u003Ccode\u003Enone\u003C/code\u003E if you do not intend to reuse this payment method and want to override the top-level \u003Ccode\u003Esetup_future_usage\u003C/code\u003E value for this payment method."}}},"object_type":"setup_future_usage"}},"object_type":"konbini"},"link":{"name":"link","check":"hash","validation":"hash","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"If the PaymentIntent's payment_method_types includes `link`, this hash contains the configurations that will be applied to each payment attempt of that type.\n","undocumented":false,"html":"If the PaymentIntent’s payment_method_types includes \u003Ccode\u003Elink\u003C/code\u003E, this hash contains the configurations that will be applied to each payment attempt of that type."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"subspec":{"capture_method":{"name":"capture_method","check":"string","validation":"string","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"Controls when the funds will be captured from the customer's account.\n","undocumented":false,"html":"Controls when the funds will be captured from the customer’s account."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"enum_values":{"manual":{"documentation":{"gate_specific":{},"localize_terms":[],"markdown":"Use `manual` if you intend to place the funds on hold and want to override the top-level `capture_method` value for this payment method.","undocumented":false,"html":"Use \u003Ccode\u003Emanual\u003C/code\u003E if you intend to place the funds on hold and want to override the top-level \u003Ccode\u003Ecapture_method\u003C/code\u003E value for this payment method."}}},"object_type":"capture_method"},"persistent_token":{"name":"persistent_token","check":"string","validation":"string","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"Token used for persistent Link logins.","undocumented":false,"html":"Token used for persistent Link logins."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"object_type":"persistent_token"},"setup_future_usage":{"name":"setup_future_usage","check":"string","validation":"string","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"Indicates that you intend to make future payments with this PaymentIntent's payment method.\n\nProviding this parameter will [attach the payment method](/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](/docs/api/payment_methods/attach) to a Customer after the transaction completes.\n\nWhen processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](/docs/strong-customer-authentication).\n","undocumented":false,"html":"Indicates that you intend to make future payments with this PaymentIntent’s payment method.\u003C/p\u003E\n\n\u003Cp\u003EProviding this parameter will \u003Ca href=\"/docs/payments/save-during-payment\"\u003Eattach the payment method\u003C/a\u003E to the PaymentIntent’s Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be \u003Ca href=\"/docs/api/payment_methods/attach\"\u003Eattached\u003C/a\u003E to a Customer after the transaction completes.\u003C/p\u003E\n\n\u003Cp\u003EWhen processing card payments, Stripe also uses \u003Ccode\u003Esetup_future_usage\u003C/code\u003E to dynamically optimize your payment flow and comply with regional legislation and network rules, such as \u003Ca href=\"/docs/strong-customer-authentication\"\u003ESCA\u003C/a\u003E."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"enum_values":{"off_session":{"documentation":{"gate_specific":{},"localize_terms":[],"markdown":"Use `off_session` if your customer may or may not be present in your checkout flow.","undocumented":false,"html":"Use \u003Ccode\u003Eoff_session\u003C/code\u003E if your customer may or may not be present in your checkout flow."}},"none":{"documentation":{"gate_specific":{},"localize_terms":[],"markdown":"Use `none` if you do not intend to reuse this payment method and want to override the top-level `setup_future_usage` value for this payment method.","undocumented":false,"html":"Use \u003Ccode\u003Enone\u003C/code\u003E if you do not intend to reuse this payment method and want to override the top-level \u003Ccode\u003Esetup_future_usage\u003C/code\u003E value for this payment method."}}},"object_type":"setup_future_usage"}},"object_type":"link"},"oxxo":{"name":"oxxo","check":"hash","validation":"hash","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"If the PaymentIntent's payment_method_types includes `oxxo`, this hash contains the configurations that will be applied to each payment attempt of that type.\n","undocumented":false,"html":"If the PaymentIntent’s payment_method_types includes \u003Ccode\u003Eoxxo\u003C/code\u003E, this hash contains the configurations that will be applied to each payment attempt of that type."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"subspec":{"expires_after_days":{"name":"expires_after_days","check":"integer","validation":"integer","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"The number of calendar days before an OXXO invoice expires. For example, if you create an OXXO invoice on Monday and you set expires_after_days to 2, the OXXO invoice will expire on Wednesday at 23:59 America/Mexico_City time.","undocumented":false,"html":"The number of calendar days before an OXXO invoice expires. For example, if you create an OXXO invoice on Monday and you set expires_after_days to 2, the OXXO invoice will expire on Wednesday at 23:59 America/Mexico_City time."},"gate":false,"hide_unset_desc":null,"required":true,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"object_type":"expires_after_days"},"setup_future_usage":{"name":"setup_future_usage","check":"string","validation":"string","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"Indicates that you intend to make future payments with this PaymentIntent's payment method.\n\nProviding this parameter will [attach the payment method](/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](/docs/api/payment_methods/attach) to a Customer after the transaction completes.\n\nWhen processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](/docs/strong-customer-authentication).\n","undocumented":false,"html":"Indicates that you intend to make future payments with this PaymentIntent’s payment method.\u003C/p\u003E\n\n\u003Cp\u003EProviding this parameter will \u003Ca href=\"/docs/payments/save-during-payment\"\u003Eattach the payment method\u003C/a\u003E to the PaymentIntent’s Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be \u003Ca href=\"/docs/api/payment_methods/attach\"\u003Eattached\u003C/a\u003E to a Customer after the transaction completes.\u003C/p\u003E\n\n\u003Cp\u003EWhen processing card payments, Stripe also uses \u003Ccode\u003Esetup_future_usage\u003C/code\u003E to dynamically optimize your payment flow and comply with regional legislation and network rules, such as \u003Ca href=\"/docs/strong-customer-authentication\"\u003ESCA\u003C/a\u003E."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"enum_values":{"none":{"documentation":{"gate_specific":{},"localize_terms":[],"markdown":"Use `none` if you do not intend to reuse this payment method and want to override the top-level `setup_future_usage` value for this payment method.","undocumented":false,"html":"Use \u003Ccode\u003Enone\u003C/code\u003E if you do not intend to reuse this payment method and want to override the top-level \u003Ccode\u003Esetup_future_usage\u003C/code\u003E value for this payment method."}}},"object_type":"setup_future_usage"}},"object_type":"oxxo"},"p24":{"name":"p24","check":"hash","validation":"hash","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"If the PaymentIntent's payment_method_types includes `p24`, this hash contains the configurations that will be applied to each payment attempt of that type.\n","undocumented":false,"html":"If the PaymentIntent’s payment_method_types includes \u003Ccode\u003Ep24\u003C/code\u003E, this hash contains the configurations that will be applied to each payment attempt of that type."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"subspec":{"setup_future_usage":{"name":"setup_future_usage","check":"string","validation":"string","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"Indicates that you intend to make future payments with this PaymentIntent's payment method.\n\nProviding this parameter will [attach the payment method](/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](/docs/api/payment_methods/attach) to a Customer after the transaction completes.\n\nWhen processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](/docs/strong-customer-authentication).\n","undocumented":false,"html":"Indicates that you intend to make future payments with this PaymentIntent’s payment method.\u003C/p\u003E\n\n\u003Cp\u003EProviding this parameter will \u003Ca href=\"/docs/payments/save-during-payment\"\u003Eattach the payment method\u003C/a\u003E to the PaymentIntent’s Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be \u003Ca href=\"/docs/api/payment_methods/attach\"\u003Eattached\u003C/a\u003E to a Customer after the transaction completes.\u003C/p\u003E\n\n\u003Cp\u003EWhen processing card payments, Stripe also uses \u003Ccode\u003Esetup_future_usage\u003C/code\u003E to dynamically optimize your payment flow and comply with regional legislation and network rules, such as \u003Ca href=\"/docs/strong-customer-authentication\"\u003ESCA\u003C/a\u003E."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"enum_values":{"none":{"documentation":{"gate_specific":{},"localize_terms":[],"markdown":"Use `none` if you do not intend to reuse this payment method and want to override the top-level `setup_future_usage` value for this payment method.","undocumented":false,"html":"Use \u003Ccode\u003Enone\u003C/code\u003E if you do not intend to reuse this payment method and want to override the top-level \u003Ccode\u003Esetup_future_usage\u003C/code\u003E value for this payment method."}}},"object_type":"setup_future_usage"}},"object_type":"p24"},"paynow":{"name":"paynow","check":"hash","validation":"hash","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"If the PaymentIntent's payment_method_types includes `paynow`, this hash contains the configurations that will be applied to each payment attempt of that type.\n","undocumented":false,"html":"If the PaymentIntent’s payment_method_types includes \u003Ccode\u003Epaynow\u003C/code\u003E, this hash contains the configurations that will be applied to each payment attempt of that type."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"subspec":{"setup_future_usage":{"name":"setup_future_usage","check":"string","validation":"string","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"Indicates that you intend to make future payments with this PaymentIntent's payment method.\n\nProviding this parameter will [attach the payment method](/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](/docs/api/payment_methods/attach) to a Customer after the transaction completes.\n\nWhen processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](/docs/strong-customer-authentication).\n","undocumented":false,"html":"Indicates that you intend to make future payments with this PaymentIntent’s payment method.\u003C/p\u003E\n\n\u003Cp\u003EProviding this parameter will \u003Ca href=\"/docs/payments/save-during-payment\"\u003Eattach the payment method\u003C/a\u003E to the PaymentIntent’s Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be \u003Ca href=\"/docs/api/payment_methods/attach\"\u003Eattached\u003C/a\u003E to a Customer after the transaction completes.\u003C/p\u003E\n\n\u003Cp\u003EWhen processing card payments, Stripe also uses \u003Ccode\u003Esetup_future_usage\u003C/code\u003E to dynamically optimize your payment flow and comply with regional legislation and network rules, such as \u003Ca href=\"/docs/strong-customer-authentication\"\u003ESCA\u003C/a\u003E."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"enum_values":{"none":{"documentation":{"gate_specific":{},"localize_terms":[],"markdown":"Use `none` if you do not intend to reuse this payment method and want to override the top-level `setup_future_usage` value for this payment method.","undocumented":false,"html":"Use \u003Ccode\u003Enone\u003C/code\u003E if you do not intend to reuse this payment method and want to override the top-level \u003Ccode\u003Esetup_future_usage\u003C/code\u003E value for this payment method."}}},"object_type":"setup_future_usage"}},"object_type":"paynow"},"pix":{"name":"pix","check":"hash","validation":"hash","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"If the PaymentIntent's payment_method_types includes `pix`, this hash contains the configurations that will be applied to each payment attempt of that type.\n","undocumented":false,"html":"If the PaymentIntent’s payment_method_types includes \u003Ccode\u003Epix\u003C/code\u003E, this hash contains the configurations that will be applied to each payment attempt of that type."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"subspec":{"expires_after_seconds":{"name":"expires_after_seconds","check":"integer","validation":"integer","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"The number of seconds (between 10 and 1209600) after which Pix payment will expire.","undocumented":false,"html":"The number of seconds (between 10 and 1209600) after which Pix payment will expire."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"object_type":"expires_after_seconds"},"expires_at":{"name":"expires_at","check":"integer","validation":"integer","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"The timestamp at which the Pix expires.","undocumented":false,"html":"The timestamp at which the Pix expires."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"object_type":"expires_at"},"setup_future_usage":{"name":"setup_future_usage","check":"string","validation":"string","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"Indicates that you intend to make future payments with this PaymentIntent's payment method.\n\nProviding this parameter will [attach the payment method](/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](/docs/api/payment_methods/attach) to a Customer after the transaction completes.\n\nWhen processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](/docs/strong-customer-authentication).\n","undocumented":false,"html":"Indicates that you intend to make future payments with this PaymentIntent’s payment method.\u003C/p\u003E\n\n\u003Cp\u003EProviding this parameter will \u003Ca href=\"/docs/payments/save-during-payment\"\u003Eattach the payment method\u003C/a\u003E to the PaymentIntent’s Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be \u003Ca href=\"/docs/api/payment_methods/attach\"\u003Eattached\u003C/a\u003E to a Customer after the transaction completes.\u003C/p\u003E\n\n\u003Cp\u003EWhen processing card payments, Stripe also uses \u003Ccode\u003Esetup_future_usage\u003C/code\u003E to dynamically optimize your payment flow and comply with regional legislation and network rules, such as \u003Ca href=\"/docs/strong-customer-authentication\"\u003ESCA\u003C/a\u003E."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"enum_values":{"none":{"documentation":{"gate_specific":{},"localize_terms":[],"markdown":"Use `none` if you do not intend to reuse this payment method and want to override the top-level `setup_future_usage` value for this payment method.","undocumented":false,"html":"Use \u003Ccode\u003Enone\u003C/code\u003E if you do not intend to reuse this payment method and want to override the top-level \u003Ccode\u003Esetup_future_usage\u003C/code\u003E value for this payment method."}}},"object_type":"setup_future_usage"}},"object_type":"pix"},"promptpay":{"name":"promptpay","check":"hash","validation":"hash","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"If the PaymentIntent's payment_method_types includes `promptpay`, this hash contains the configurations that will be applied to each payment attempt of that type.\n","undocumented":false,"html":"If the PaymentIntent’s payment_method_types includes \u003Ccode\u003Epromptpay\u003C/code\u003E, this hash contains the configurations that will be applied to each payment attempt of that type."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"subspec":{"setup_future_usage":{"name":"setup_future_usage","check":"string","validation":"string","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"Indicates that you intend to make future payments with this PaymentIntent's payment method.\n\nProviding this parameter will [attach the payment method](/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](/docs/api/payment_methods/attach) to a Customer after the transaction completes.\n\nWhen processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](/docs/strong-customer-authentication).\n","undocumented":false,"html":"Indicates that you intend to make future payments with this PaymentIntent’s payment method.\u003C/p\u003E\n\n\u003Cp\u003EProviding this parameter will \u003Ca href=\"/docs/payments/save-during-payment\"\u003Eattach the payment method\u003C/a\u003E to the PaymentIntent’s Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be \u003Ca href=\"/docs/api/payment_methods/attach\"\u003Eattached\u003C/a\u003E to a Customer after the transaction completes.\u003C/p\u003E\n\n\u003Cp\u003EWhen processing card payments, Stripe also uses \u003Ccode\u003Esetup_future_usage\u003C/code\u003E to dynamically optimize your payment flow and comply with regional legislation and network rules, such as \u003Ca href=\"/docs/strong-customer-authentication\"\u003ESCA\u003C/a\u003E."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"enum_values":{"none":{"documentation":{"gate_specific":{},"localize_terms":[],"markdown":"Use `none` if you do not intend to reuse this payment method and want to override the top-level `setup_future_usage` value for this payment method.","undocumented":false,"html":"Use \u003Ccode\u003Enone\u003C/code\u003E if you do not intend to reuse this payment method and want to override the top-level \u003Ccode\u003Esetup_future_usage\u003C/code\u003E value for this payment method."}}},"object_type":"setup_future_usage"}},"object_type":"promptpay"},"sepa_debit":{"name":"sepa_debit","check":"hash","validation":"hash","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"If the PaymentIntent's payment_method_types includes `sepa_debit`, this hash contains the configurations that will be applied to each payment attempt of that type.\n","undocumented":false,"html":"If the PaymentIntent’s payment_method_types includes \u003Ccode\u003Esepa_debit\u003C/code\u003E, this hash contains the configurations that will be applied to each payment attempt of that type."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"subspec":{"mandate_options":{"name":"mandate_options","check":"hash","validation":"hash","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"Additional fields for Mandate creation","undocumented":false,"html":"Additional fields for Mandate creation"},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"subspec":{},"object_type":"mandate_options"},"setup_future_usage":{"name":"setup_future_usage","check":"string","validation":"string","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"Indicates that you intend to make future payments with this PaymentIntent's payment method.\n\nProviding this parameter will [attach the payment method](/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](/docs/api/payment_methods/attach) to a Customer after the transaction completes.\n\nWhen processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](/docs/strong-customer-authentication).\n","undocumented":false,"html":"Indicates that you intend to make future payments with this PaymentIntent’s payment method.\u003C/p\u003E\n\n\u003Cp\u003EProviding this parameter will \u003Ca href=\"/docs/payments/save-during-payment\"\u003Eattach the payment method\u003C/a\u003E to the PaymentIntent’s Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be \u003Ca href=\"/docs/api/payment_methods/attach\"\u003Eattached\u003C/a\u003E to a Customer after the transaction completes.\u003C/p\u003E\n\n\u003Cp\u003EWhen processing card payments, Stripe also uses \u003Ccode\u003Esetup_future_usage\u003C/code\u003E to dynamically optimize your payment flow and comply with regional legislation and network rules, such as \u003Ca href=\"/docs/strong-customer-authentication\"\u003ESCA\u003C/a\u003E."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"enum_values":{"on_session":{"documentation":{"gate_specific":{},"localize_terms":[],"markdown":"Use `on_session` if you intend to only reuse the payment method when your customer is present in your checkout flow.","undocumented":false,"html":"Use \u003Ccode\u003Eon_session\u003C/code\u003E if you intend to only reuse the payment method when your customer is present in your checkout flow."}},"off_session":{"documentation":{"gate_specific":{},"localize_terms":[],"markdown":"Use `off_session` if your customer may or may not be present in your checkout flow.","undocumented":false,"html":"Use \u003Ccode\u003Eoff_session\u003C/code\u003E if your customer may or may not be present in your checkout flow."}},"none":{"documentation":{"gate_specific":{},"localize_terms":[],"markdown":"Use `none` if you do not intend to reuse this payment method and want to override the top-level `setup_future_usage` value for this payment method.","undocumented":false,"html":"Use \u003Ccode\u003Enone\u003C/code\u003E if you do not intend to reuse this payment method and want to override the top-level \u003Ccode\u003Esetup_future_usage\u003C/code\u003E value for this payment method."}}},"object_type":"setup_future_usage"}},"object_type":"sepa_debit"},"sofort":{"name":"sofort","check":"hash","validation":"hash","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"If the PaymentIntent's payment_method_types includes `sofort`, this hash contains the configurations that will be applied to each payment attempt of that type.\n","undocumented":false,"html":"If the PaymentIntent’s payment_method_types includes \u003Ccode\u003Esofort\u003C/code\u003E, this hash contains the configurations that will be applied to each payment attempt of that type."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"subspec":{"preferred_language":{"name":"preferred_language","check":"string","validation":"string","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"Preferred language of the SOFORT authorization page that the customer is redirected to.","undocumented":false,"html":"Preferred language of the SOFORT authorization page that the customer is redirected to."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"object_type":"preferred_language"},"setup_future_usage":{"name":"setup_future_usage","check":"string","validation":"string","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"Indicates that you intend to make future payments with this PaymentIntent's payment method.\n\nProviding this parameter will [attach the payment method](/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](/docs/api/payment_methods/attach) to a Customer after the transaction completes.\n\nWhen processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](/docs/strong-customer-authentication).\n","undocumented":false,"html":"Indicates that you intend to make future payments with this PaymentIntent’s payment method.\u003C/p\u003E\n\n\u003Cp\u003EProviding this parameter will \u003Ca href=\"/docs/payments/save-during-payment\"\u003Eattach the payment method\u003C/a\u003E to the PaymentIntent’s Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be \u003Ca href=\"/docs/api/payment_methods/attach\"\u003Eattached\u003C/a\u003E to a Customer after the transaction completes.\u003C/p\u003E\n\n\u003Cp\u003EWhen processing card payments, Stripe also uses \u003Ccode\u003Esetup_future_usage\u003C/code\u003E to dynamically optimize your payment flow and comply with regional legislation and network rules, such as \u003Ca href=\"/docs/strong-customer-authentication\"\u003ESCA\u003C/a\u003E."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"enum_values":{"off_session":{"documentation":{"gate_specific":{},"localize_terms":[],"markdown":"Use `off_session` if your customer may or may not be present in your checkout flow.","undocumented":false,"html":"Use \u003Ccode\u003Eoff_session\u003C/code\u003E if your customer may or may not be present in your checkout flow."}},"none":{"documentation":{"gate_specific":{},"localize_terms":[],"markdown":"Use `none` if you do not intend to reuse this payment method and want to override the top-level `setup_future_usage` value for this payment method.","undocumented":false,"html":"Use \u003Ccode\u003Enone\u003C/code\u003E if you do not intend to reuse this payment method and want to override the top-level \u003Ccode\u003Esetup_future_usage\u003C/code\u003E value for this payment method."}}},"object_type":"setup_future_usage"}},"object_type":"sofort"},"us_bank_account":{"name":"us_bank_account","check":"hash","validation":"hash","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"If the PaymentIntent's payment_method_types includes `us_bank_account`, this hash contains the configurations that will be applied to each payment attempt of that type.\n","undocumented":false,"html":"If the PaymentIntent’s payment_method_types includes \u003Ccode\u003Eus_bank_account\u003C/code\u003E, this hash contains the configurations that will be applied to each payment attempt of that type."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"subspec":{"financial_connections":{"name":"financial_connections","check":"hash","validation":"hash","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"Additional fields for Financial Connections Session creation","undocumented":false,"html":"Additional fields for Financial Connections Session creation"},"gate":true,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"subspec":{"permissions":{"name":"permissions","check":"array","validation":"array","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"The list of permissions to request. The `payment_method` permission must be included.","undocumented":false,"html":"The list of permissions to request. The \u003Ccode\u003Epayment_method\u003C/code\u003E permission must be included."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"enum_values":{"payment_method":{"documentation":{"gate_specific":{},"localize_terms":[],"markdown":"Allows the creation of a payment method from the account.","undocumented":false,"html":"Allows the creation of a payment method from the account."}},"balances":{"documentation":{"gate_specific":{},"localize_terms":[],"markdown":"Allows accessing balance data from the account.","undocumented":false,"html":"Allows accessing balance data from the account."}},"transactions":{"documentation":{"gate_specific":{},"localize_terms":[],"markdown":"Allows accessing transactions data from the account.","undocumented":false,"html":"Allows accessing transactions data from the account."}},"ownership":{"documentation":{"gate_specific":{},"localize_terms":[],"markdown":"Allows accessing ownership data from the account.","undocumented":false,"html":"Allows accessing ownership data from the account."}}},"object_type":"permissions"}},"object_type":"financial_connections"},"setup_future_usage":{"name":"setup_future_usage","check":"string","validation":"string","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"Indicates that you intend to make future payments with this PaymentIntent's payment method.\n\nProviding this parameter will [attach the payment method](/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](/docs/api/payment_methods/attach) to a Customer after the transaction completes.\n\nWhen processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](/docs/strong-customer-authentication).\n","undocumented":false,"html":"Indicates that you intend to make future payments with this PaymentIntent’s payment method.\u003C/p\u003E\n\n\u003Cp\u003EProviding this parameter will \u003Ca href=\"/docs/payments/save-during-payment\"\u003Eattach the payment method\u003C/a\u003E to the PaymentIntent’s Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be \u003Ca href=\"/docs/api/payment_methods/attach\"\u003Eattached\u003C/a\u003E to a Customer after the transaction completes.\u003C/p\u003E\n\n\u003Cp\u003EWhen processing card payments, Stripe also uses \u003Ccode\u003Esetup_future_usage\u003C/code\u003E to dynamically optimize your payment flow and comply with regional legislation and network rules, such as \u003Ca href=\"/docs/strong-customer-authentication\"\u003ESCA\u003C/a\u003E."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"enum_values":{"on_session":{"documentation":{"gate_specific":{},"localize_terms":[],"markdown":"Use `on_session` if you intend to only reuse the payment method when your customer is present in your checkout flow.","undocumented":false,"html":"Use \u003Ccode\u003Eon_session\u003C/code\u003E if you intend to only reuse the payment method when your customer is present in your checkout flow."}},"off_session":{"documentation":{"gate_specific":{},"localize_terms":[],"markdown":"Use `off_session` if your customer may or may not be present in your checkout flow.","undocumented":false,"html":"Use \u003Ccode\u003Eoff_session\u003C/code\u003E if your customer may or may not be present in your checkout flow."}},"none":{"documentation":{"gate_specific":{},"localize_terms":[],"markdown":"Use `none` if you do not intend to reuse this payment method and want to override the top-level `setup_future_usage` value for this payment method.","undocumented":false,"html":"Use \u003Ccode\u003Enone\u003C/code\u003E if you do not intend to reuse this payment method and want to override the top-level \u003Ccode\u003Esetup_future_usage\u003C/code\u003E value for this payment method."}}},"object_type":"setup_future_usage"},"verification_method":{"name":"verification_method","check":"string","validation":"string","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"Bank account verification method.","undocumented":false,"html":"Bank account verification method."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"enum_values":{"automatic":{"documentation":{"gate_specific":{},"localize_terms":[],"markdown":"Instant verification with fallback to microdeposits.","undocumented":false,"html":"Instant verification with fallback to microdeposits."}},"instant":{"documentation":{"gate_specific":{},"localize_terms":[],"markdown":"Instant verification only.","undocumented":false,"html":"Instant verification only."}},"microdeposits":{"documentation":{"gate_specific":{},"localize_terms":[],"markdown":"Verification using microdeposits. Cannot be used with Stripe Checkout or Hosted Invoices.","undocumented":false,"html":"Verification using microdeposits. Cannot be used with Stripe Checkout or Hosted Invoices."}}},"object_type":"verification_method"}},"object_type":"us_bank_account"},"wechat_pay":{"name":"wechat_pay","check":"hash","validation":"hash","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"If the PaymentIntent's payment_method_types includes `wechat_pay`, this hash contains the configurations that will be applied to each payment attempt of that type.\n","undocumented":false,"html":"If the PaymentIntent’s payment_method_types includes \u003Ccode\u003Ewechat_pay\u003C/code\u003E, this hash contains the configurations that will be applied to each payment attempt of that type."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"subspec":{"app_id":{"name":"app_id","check":"string","validation":"string","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"The app ID registered with WeChat Pay. Only required when client is ios or android.","undocumented":false,"html":"The app ID registered with WeChat Pay. Only required when client is ios or android."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"object_type":"app_id"},"client":{"name":"client","check":"string","validation":"string","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"The client type that the end customer will pay from","undocumented":false,"html":"The client type that the end customer will pay from"},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"enum_values":{"web":{"documentation":{"gate_specific":{},"localize_terms":[],"markdown":"The end customer will pay from web browser","undocumented":false,"html":"The end customer will pay from web browser"}},"ios":{"documentation":{"gate_specific":{},"localize_terms":[],"markdown":"The end customer will pay from an iOS app","undocumented":false,"html":"The end customer will pay from an iOS app"}},"android":{"documentation":{"gate_specific":{},"localize_terms":[],"markdown":"The end customer will pay from an Android app","undocumented":false,"html":"The end customer will pay from an Android app"}}},"object_type":"client"},"setup_future_usage":{"name":"setup_future_usage","check":"string","validation":"string","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"Indicates that you intend to make future payments with this PaymentIntent's payment method.\n\nProviding this parameter will [attach the payment method](/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](/docs/api/payment_methods/attach) to a Customer after the transaction completes.\n\nWhen processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](/docs/strong-customer-authentication).\n","undocumented":false,"html":"Indicates that you intend to make future payments with this PaymentIntent’s payment method.\u003C/p\u003E\n\n\u003Cp\u003EProviding this parameter will \u003Ca href=\"/docs/payments/save-during-payment\"\u003Eattach the payment method\u003C/a\u003E to the PaymentIntent’s Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be \u003Ca href=\"/docs/api/payment_methods/attach\"\u003Eattached\u003C/a\u003E to a Customer after the transaction completes.\u003C/p\u003E\n\n\u003Cp\u003EWhen processing card payments, Stripe also uses \u003Ccode\u003Esetup_future_usage\u003C/code\u003E to dynamically optimize your payment flow and comply with regional legislation and network rules, such as \u003Ca href=\"/docs/strong-customer-authentication\"\u003ESCA\u003C/a\u003E."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"enum_values":{"none":{"documentation":{"gate_specific":{},"localize_terms":[],"markdown":"Use `none` if you do not intend to reuse this payment method and want to override the top-level `setup_future_usage` value for this payment method.","undocumented":false,"html":"Use \u003Ccode\u003Enone\u003C/code\u003E if you do not intend to reuse this payment method and want to override the top-level \u003Ccode\u003Esetup_future_usage\u003C/code\u003E value for this payment method."}}},"object_type":"setup_future_usage"}},"object_type":"wechat_pay"}},"object_type":"payment_method_options","less_common":true},"payment_method_types":{"name":"payment_method_types","check":"string_array","validation":"array containing strings","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"The list of payment method types (e.g. card) that this PaymentIntent is allowed to use.","undocumented":false,"html":"The list of payment method types (e.g. card) that this PaymentIntent is allowed to use."},"gate":false,"hide_unset_desc":null,"required":true,"default":null,"badge_text":"retrievable with publishable key","requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"object_type":"payment_method_types","less_common":true},"processing":{"name":"processing","check":"hash","validation":"hash","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"If present, this property tells you about the processing state of the payment.","undocumented":false,"html":"If present, this property tells you about the processing state of the payment."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":"retrievable with publishable key","requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"subspec":{"card":{"name":"card","check":"hash","validation":"hash","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"If the PaymentIntent's payment_method_types includes `card`, this hash contains the details on the `processing` state of the payment.\n","undocumented":false,"html":"If the PaymentIntent’s payment_method_types includes \u003Ccode\u003Ecard\u003C/code\u003E, this hash contains the details on the \u003Ccode\u003Eprocessing\u003C/code\u003E state of the payment."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"subspec":{"customer_notification":{"name":"customer_notification","check":"hash","validation":"hash","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"For recurring payments of Indian cards, this hash contains details on whether customer approval is required, and until when the payment will be in `processing` state","undocumented":false,"html":"For recurring payments of Indian cards, this hash contains details on whether customer approval is required, and until when the payment will be in \u003Ccode\u003Eprocessing\u003C/code\u003E state"},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"subspec":{"approval_requested":{"name":"approval_requested","check":"boolean","validation":"boolean","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"Whether customer approval has been requested for this payment. For payments greater than INR 15000 or mandate amount, the customer must provide explicit approval of the payment with their bank.","undocumented":false,"html":"Whether customer approval has been requested for this payment. For payments greater than INR 15000 or mandate amount, the customer must provide explicit approval of the payment with their bank."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"object_type":"approval_requested"},"completes_at":{"name":"completes_at","check":"timestamp","validation":"timestamp","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"If customer approval is required, they need to provide approval before this time.","undocumented":false,"html":"If customer approval is required, they need to provide approval before this time."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"object_type":"completes_at"}},"object_type":"customer_notification"}},"object_type":"card"},"type":{"name":"type","check":"string","validation":"string","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"Type of the payment method for which payment is in `processing` state, one of `card`.","undocumented":false,"html":"Type of the payment method for which payment is in \u003Ccode\u003Eprocessing\u003C/code\u003E state, one of \u003Ccode\u003Ecard\u003C/code\u003E."},"gate":false,"hide_unset_desc":null,"required":true,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"object_type":"type"}},"object_type":"processing","less_common":true},"receipt_email":{"name":"receipt_email","check":"string","validation":"string","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"Email address that the receipt for the resulting payment will be sent to. If `receipt_email` is specified for a payment in live mode, a receipt will be sent regardless of your [email settings](https://dashboard.stripe.com/account/emails).","undocumented":false,"html":"Email address that the receipt for the resulting payment will be sent to. If \u003Ccode\u003Ereceipt_email\u003C/code\u003E is specified for a payment in live mode, a receipt will be sent regardless of your \u003Ca href=\"https://dashboard.stripe.com/account/emails\"\u003Eemail settings\u003C/a\u003E."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":"retrievable with publishable key","requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"object_type":"receipt_email"},"review":{"name":"review","check":"string","validation":"string","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"ID of the review associated with this PaymentIntent, if any.","undocumented":false,"html":"ID of the review associated with this PaymentIntent, if any."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"user_expandable":["review"],"object_type":"review","less_common":true},"setup_future_usage":{"name":"setup_future_usage","check":"string","validation":"string","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"Indicates that you intend to make future payments with this PaymentIntent's payment method.\n\nProviding this parameter will [attach the payment method](/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](/docs/api/payment_methods/attach) to a Customer after the transaction completes.\n\nWhen processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](/docs/strong-customer-authentication).\n","undocumented":false,"html":"Indicates that you intend to make future payments with this PaymentIntent’s payment method.\u003C/p\u003E\n\n\u003Cp\u003EProviding this parameter will \u003Ca href=\"/docs/payments/save-during-payment\"\u003Eattach the payment method\u003C/a\u003E to the PaymentIntent’s Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be \u003Ca href=\"/docs/api/payment_methods/attach\"\u003Eattached\u003C/a\u003E to a Customer after the transaction completes.\u003C/p\u003E\n\n\u003Cp\u003EWhen processing card payments, Stripe also uses \u003Ccode\u003Esetup_future_usage\u003C/code\u003E to dynamically optimize your payment flow and comply with regional legislation and network rules, such as \u003Ca href=\"/docs/strong-customer-authentication\"\u003ESCA\u003C/a\u003E."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":"retrievable with publishable key","requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"enum_values":{"on_session":{"documentation":{"gate_specific":{},"localize_terms":[],"markdown":"Use `on_session` if you intend to only reuse the payment method when your customer is present in your checkout flow.","undocumented":false,"html":"Use \u003Ccode\u003Eon_session\u003C/code\u003E if you intend to only reuse the payment method when your customer is present in your checkout flow."}},"off_session":{"documentation":{"gate_specific":{},"localize_terms":[],"markdown":"Use `off_session` if your customer may or may not be present in your checkout flow.","undocumented":false,"html":"Use \u003Ccode\u003Eoff_session\u003C/code\u003E if your customer may or may not be present in your checkout flow."}}},"object_type":"setup_future_usage"},"shipping":{"name":"shipping","check":"hash","validation":"hash","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"Shipping information for this PaymentIntent.","undocumented":false,"html":"Shipping information for this PaymentIntent."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":"retrievable with publishable key","requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"subspec":{"address":{"name":"address","check":"hash","validation":"hash","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"Shipping address.","undocumented":false,"html":"Shipping address."},"gate":false,"hide_unset_desc":null,"required":true,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"subspec":{"city":{"name":"city","check":"string","validation":"string","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"City, district, suburb, town, or village.","undocumented":false,"html":"City, district, suburb, town, or village."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"object_type":"city"},"country":{"name":"country","check":"string","validation":"string","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)).","undocumented":false,"html":"Two-letter country code (\u003Ca href=\"https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2\"\u003EISO 3166-1 alpha-2\u003C/a\u003E)."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"object_type":"country"},"line1":{"name":"line1","check":"string","validation":"string","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"Address line 1 (e.g., street, PO Box, or company name).","undocumented":false,"html":"Address line 1 (e.g., street, PO Box, or company name)."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"object_type":"line1"},"line2":{"name":"line2","check":"string","validation":"string","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"Address line 2 (e.g., apartment, suite, unit, or building).","undocumented":false,"html":"Address line 2 (e.g., apartment, suite, unit, or building)."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"object_type":"line2"},"postal_code":{"name":"postal_code","check":"string","validation":"string","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"ZIP or postal code.","undocumented":false,"html":"ZIP or postal code."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"object_type":"postal_code"},"state":{"name":"state","check":"string","validation":"string","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"State, county, province, or region.","undocumented":false,"html":"State, county, province, or region."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"object_type":"state"}},"object_type":"address"},"carrier":{"name":"carrier","check":"string","validation":"string","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"The delivery service that shipped a physical product, such as Fedex, UPS, USPS, etc.","undocumented":false,"html":"The delivery service that shipped a physical product, such as Fedex, UPS, USPS, etc."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"object_type":"carrier"},"name":{"name":"name","check":"string","validation":"string","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"Recipient name.","undocumented":false,"html":"Recipient name."},"gate":false,"hide_unset_desc":null,"required":true,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"object_type":"name"},"phone":{"name":"phone","check":"string","validation":"string","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"Recipient phone (including extension).","undocumented":false,"html":"Recipient phone (including extension)."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"object_type":"phone"},"tracking_number":{"name":"tracking_number","check":"string","validation":"string","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"The tracking number for a physical product, obtained from the delivery service. If multiple tracking numbers were generated for this purchase, please separate them with commas.","undocumented":false,"html":"The tracking number for a physical product, obtained from the delivery service. If multiple tracking numbers were generated for this purchase, please separate them with commas."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"object_type":"tracking_number"}},"object_type":"shipping"},"statement_descriptor":{"name":"statement_descriptor","check":"string","validation":"string","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"For non-card charges, you can use this value as the complete description that appears on your customers’ statements. Must contain at least one letter, maximum 22 characters.","undocumented":false,"html":"For non-card charges, you can use this value as the complete description that appears on your customers’ statements. Must contain at least one letter, maximum 22 characters."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"object_type":"statement_descriptor"},"statement_descriptor_suffix":{"name":"statement_descriptor_suffix","check":"string","validation":"string","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"Provides information about a card payment that customers see on their statements. Concatenated with the prefix (shortened descriptor) or statement descriptor that’s set on the account to form the complete statement descriptor. Maximum 22 characters for the concatenated descriptor.","undocumented":false,"html":"Provides information about a card payment that customers see on their statements. Concatenated with the prefix (shortened descriptor) or statement descriptor that’s set on the account to form the complete statement descriptor. Maximum 22 characters for the concatenated descriptor."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"object_type":"statement_descriptor_suffix"},"status":{"name":"status","check":"string","validation":"string","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"Status of this PaymentIntent, one of `requires_payment_method`, `requires_confirmation`, `requires_action`, `processing`, `requires_capture`, `canceled`, or `succeeded`. Read more about each PaymentIntent [status](/docs/payments/intents#intent-statuses).","undocumented":false,"html":"Status of this PaymentIntent, one of \u003Ccode\u003Erequires_payment_method\u003C/code\u003E, \u003Ccode\u003Erequires_confirmation\u003C/code\u003E, \u003Ccode\u003Erequires_action\u003C/code\u003E, \u003Ccode\u003Eprocessing\u003C/code\u003E, \u003Ccode\u003Erequires_capture\u003C/code\u003E, \u003Ccode\u003Ecanceled\u003C/code\u003E, or \u003Ccode\u003Esucceeded\u003C/code\u003E. Read more about each PaymentIntent \u003Ca href=\"/docs/payments/intents#intent-statuses\"\u003Estatus\u003C/a\u003E."},"gate":false,"hide_unset_desc":null,"required":true,"default":null,"badge_text":"retrievable with publishable key","requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"object_type":"status"},"transfer_data":{"name":"transfer_data","check":"hash","validation":"hash","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"The data with which to automatically create a Transfer when the payment is finalized. See the PaymentIntents [use case for connected accounts](/docs/payments/connected-accounts) for details.","undocumented":false,"html":"The data with which to automatically create a Transfer when the payment is finalized. See the PaymentIntents \u003Ca href=\"/docs/payments/connected-accounts\"\u003Euse case for connected accounts\u003C/a\u003E for details."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":"Connect only","requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"subspec":{"amount":{"name":"amount","check":"integer","validation":"integer","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"Amount intended to be collected by this PaymentIntent. A positive integer representing how much to charge in the [smallest currency unit](/docs/currencies#zero-decimal) (e.g., 100 cents to charge $1.00 or 100 to charge ¥100, a zero-decimal currency). The minimum amount is $0.50 US or [equivalent in charge currency](/docs/currencies#minimum-and-maximum-charge-amounts). The amount value supports up to eight digits (e.g., a value of 99999999 for a USD charge of $999,999.99).","undocumented":false,"html":"Amount intended to be collected by this PaymentIntent. A positive integer representing how much to charge in the \u003Ca href=\"/docs/currencies#zero-decimal\"\u003Esmallest currency unit\u003C/a\u003E (e.g., 100 cents to charge $1.00 or 100 to charge ¥100, a zero-decimal currency). The minimum amount is $0.50 US or \u003Ca href=\"/docs/currencies#minimum-and-maximum-charge-amounts\"\u003Eequivalent in charge currency\u003C/a\u003E. The amount value supports up to eight digits (e.g., a value of 99999999 for a USD charge of $999,999.99)."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"object_type":"amount"},"destination":{"name":"destination","check":"string","validation":"string","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"The account (if any) the payment will be attributed to for tax\nreporting, and where funds from the payment will be transferred to upon\npayment success.\n","undocumented":false,"html":"The account (if any) the payment will be attributed to for tax\nreporting, and where funds from the payment will be transferred to upon\npayment success."},"gate":false,"hide_unset_desc":null,"required":true,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"user_expandable":["account"],"object_type":"destination"}},"object_type":"transfer_data","less_common":true},"transfer_group":{"name":"transfer_group","check":"string","validation":"string","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"A string that identifies the resulting payment as part of a group. See the PaymentIntents [use case for connected accounts](/docs/payments/connected-accounts) for details.","undocumented":false,"html":"A string that identifies the resulting payment as part of a group. See the PaymentIntents \u003Ca href=\"/docs/payments/connected-accounts\"\u003Euse case for connected accounts\u003C/a\u003E for details."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":"Connect only","requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"object_type":"transfer_group","less_common":true}}},"payment_method":{"name":"payment_method","check":"hash","validation":"hash","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"The PaymentMethod object for errors returned on a request involving a PaymentMethod.","undocumented":false,"html":"The PaymentMethod object for errors returned on a request involving a PaymentMethod."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"subspec":{"id":{"name":"id","check":"string","validation":"string","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"Unique identifier for the object.","undocumented":false,"html":"Unique identifier for the object."},"gate":false,"hide_unset_desc":null,"required":true,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"object_type":"id"},"object":{"name":"object","check":"string","validation":"string","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"String representing the object's type. Objects of the same type share the same value.","undocumented":false,"html":"String representing the object’s type. Objects of the same type share the same value."},"gate":false,"hide_unset_desc":null,"required":true,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"object_type":"object","less_common":true},"acss_debit":{"name":"acss_debit","check":"hash","validation":"hash","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"If this is an `acss_debit` PaymentMethod, this hash contains details about the ACSS Debit payment method.","undocumented":false,"html":"If this is an \u003Ccode\u003Eacss_debit\u003C/code\u003E PaymentMethod, this hash contains details about the ACSS Debit payment method."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"subspec":{"bank_name":{"name":"bank_name","check":"string","validation":"string","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"Name of the bank associated with the bank account.","undocumented":false,"html":"Name of the bank associated with the bank account."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"object_type":"bank_name"},"fingerprint":{"name":"fingerprint","check":"string","validation":"string","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"Uniquely identifies this particular bank account. You can use this attribute to check whether two bank accounts are the same.","undocumented":false,"html":"Uniquely identifies this particular bank account. You can use this attribute to check whether two bank accounts are the same."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"object_type":"fingerprint"},"institution_number":{"name":"institution_number","check":"string","validation":"string","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"Institution number of the bank account.","undocumented":false,"html":"Institution number of the bank account."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"object_type":"institution_number"},"last4":{"name":"last4","check":"string","validation":"string","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"Last four digits of the bank account number.","undocumented":false,"html":"Last four digits of the bank account number."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"object_type":"last4"},"transit_number":{"name":"transit_number","check":"string","validation":"string","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"Transit number of the bank account.","undocumented":false,"html":"Transit number of the bank account."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"object_type":"transit_number"}},"object_type":"acss_debit","less_common":true},"affirm":{"name":"affirm","check":"hash","validation":"hash","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"If this is an `affirm` PaymentMethod, this hash contains details about the Affirm payment method.","undocumented":false,"html":"If this is an \u003Ccode\u003Eaffirm\u003C/code\u003E PaymentMethod, this hash contains details about the Affirm payment method."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"subspec":{},"object_type":"affirm","less_common":true},"afterpay_clearpay":{"name":"afterpay_clearpay","check":"hash","validation":"hash","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"If this is an `AfterpayClearpay` PaymentMethod, this hash contains details about the AfterpayClearpay payment method.","undocumented":false,"html":"If this is an \u003Ccode\u003EAfterpayClearpay\u003C/code\u003E PaymentMethod, this hash contains details about the AfterpayClearpay payment method."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"subspec":{},"object_type":"afterpay_clearpay","less_common":true},"alipay":{"name":"alipay","check":"hash","validation":"hash","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"If this is an `Alipay` PaymentMethod, this hash contains details about the Alipay payment method.","undocumented":false,"html":"If this is an \u003Ccode\u003EAlipay\u003C/code\u003E PaymentMethod, this hash contains details about the Alipay payment method."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"subspec":{},"object_type":"alipay","less_common":true},"au_becs_debit":{"name":"au_becs_debit","check":"hash","validation":"hash","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"If this is an `au_becs_debit` PaymentMethod, this hash contains details about the bank account.","undocumented":false,"html":"If this is an \u003Ccode\u003Eau_becs_debit\u003C/code\u003E PaymentMethod, this hash contains details about the bank account."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"subspec":{"bsb_number":{"name":"bsb_number","check":"string","validation":"string","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"Six-digit number identifying bank and branch associated with this bank account.","undocumented":false,"html":"Six-digit number identifying bank and branch associated with this bank account."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"object_type":"bsb_number"},"fingerprint":{"name":"fingerprint","check":"string","validation":"string","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"Uniquely identifies this particular bank account. You can use this attribute to check whether two bank accounts are the same.","undocumented":false,"html":"Uniquely identifies this particular bank account. You can use this attribute to check whether two bank accounts are the same."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"object_type":"fingerprint"},"last4":{"name":"last4","check":"string","validation":"string","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"Last four digits of the bank account number.","undocumented":false,"html":"Last four digits of the bank account number."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"object_type":"last4"}},"object_type":"au_becs_debit","less_common":true},"bacs_debit":{"name":"bacs_debit","check":"hash","validation":"hash","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"If this is a `bacs_debit` PaymentMethod, this hash contains details about the Bacs Direct Debit bank account.","undocumented":false,"html":"If this is a \u003Ccode\u003Ebacs_debit\u003C/code\u003E PaymentMethod, this hash contains details about the Bacs Direct Debit bank account."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"subspec":{"fingerprint":{"name":"fingerprint","check":"string","validation":"string","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"Uniquely identifies this particular bank account. You can use this attribute to check whether two bank accounts are the same.","undocumented":false,"html":"Uniquely identifies this particular bank account. You can use this attribute to check whether two bank accounts are the same."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"object_type":"fingerprint"},"last4":{"name":"last4","check":"string","validation":"string","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"Last four digits of the bank account number.","undocumented":false,"html":"Last four digits of the bank account number."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"object_type":"last4"},"sort_code":{"name":"sort_code","check":"string","validation":"string","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"Sort code of the bank account. (e.g., `10-20-30`)","undocumented":false,"html":"Sort code of the bank account. (e.g., \u003Ccode\u003E10-20-30\u003C/code\u003E)"},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"object_type":"sort_code"}},"object_type":"bacs_debit","less_common":true},"bancontact":{"name":"bancontact","check":"hash","validation":"hash","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"If this is a `bancontact` PaymentMethod, this hash contains details about the Bancontact payment method.","undocumented":false,"html":"If this is a \u003Ccode\u003Ebancontact\u003C/code\u003E PaymentMethod, this hash contains details about the Bancontact payment method."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"subspec":{},"object_type":"bancontact","less_common":true},"billing_details":{"name":"billing_details","check":"hash","validation":"hash","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"Billing information associated with the PaymentMethod that may be used or required by particular types of payment methods.","undocumented":false,"html":"Billing information associated with the PaymentMethod that may be used or required by particular types of payment methods."},"gate":false,"hide_unset_desc":null,"required":true,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"subspec":{"address":{"name":"address","check":"hash","validation":"hash","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"Billing address.","undocumented":false,"html":"Billing address."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"subspec":{"city":{"name":"city","check":"string","validation":"string","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"City, district, suburb, town, or village.","undocumented":false,"html":"City, district, suburb, town, or village."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"object_type":"city"},"country":{"name":"country","check":"string","validation":"string","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)).","undocumented":false,"html":"Two-letter country code (\u003Ca href=\"https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2\"\u003EISO 3166-1 alpha-2\u003C/a\u003E)."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"object_type":"country"},"line1":{"name":"line1","check":"string","validation":"string","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"Address line 1 (e.g., street, PO Box, or company name).","undocumented":false,"html":"Address line 1 (e.g., street, PO Box, or company name)."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"object_type":"line1"},"line2":{"name":"line2","check":"string","validation":"string","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"Address line 2 (e.g., apartment, suite, unit, or building).","undocumented":false,"html":"Address line 2 (e.g., apartment, suite, unit, or building)."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"object_type":"line2"},"postal_code":{"name":"postal_code","check":"string","validation":"string","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"ZIP or postal code.","undocumented":false,"html":"ZIP or postal code."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"object_type":"postal_code"},"state":{"name":"state","check":"string","validation":"string","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"State, county, province, or region.","undocumented":false,"html":"State, county, province, or region."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"object_type":"state"}},"object_type":"address"},"email":{"name":"email","check":"string","validation":"string","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"Email address.","undocumented":false,"html":"Email address."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"object_type":"email"},"name":{"name":"name","check":"string","validation":"string","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"Full name.","undocumented":false,"html":"Full name."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"object_type":"name"},"phone":{"name":"phone","check":"string","validation":"string","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"Billing phone number (including extension).","undocumented":false,"html":"Billing phone number (including extension)."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"object_type":"phone"}},"object_type":"billing_details"},"blik":{"name":"blik","check":"hash","validation":"hash","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"If this is a `blik` PaymentMethod, this hash contains details about the BLIK payment method.","undocumented":false,"html":"If this is a \u003Ccode\u003Eblik\u003C/code\u003E PaymentMethod, this hash contains details about the BLIK payment method."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"subspec":{},"object_type":"blik","less_common":true},"boleto":{"name":"boleto","check":"hash","validation":"hash","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"If this is a `boleto` PaymentMethod, this hash contains details about the Boleto payment method.","undocumented":false,"html":"If this is a \u003Ccode\u003Eboleto\u003C/code\u003E PaymentMethod, this hash contains details about the Boleto payment method."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"subspec":{"fingerprint":{"name":"fingerprint","check":"string","validation":"string","documentation":null,"gate":true,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"object_type":"fingerprint"},"tax_id":{"name":"tax_id","check":"string","validation":"string","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"Uniquely identifies the customer tax id (CNPJ or CPF)","undocumented":false,"html":"Uniquely identifies the customer tax id (CNPJ or CPF)"},"gate":false,"hide_unset_desc":null,"required":true,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"object_type":"tax_id"}},"object_type":"boleto","less_common":true},"card":{"name":"card","check":"hash","validation":"hash","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"If this is a `card` PaymentMethod, this hash contains the user's card details.","undocumented":false,"html":"If this is a \u003Ccode\u003Ecard\u003C/code\u003E PaymentMethod, this hash contains the user’s card details."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"subspec":{"brand":{"name":"brand","check":"string","validation":"string","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"Card brand. Can be `amex`, `diners`, `discover`, `jcb`, `mastercard`, `unionpay`, `visa`, or `unknown`.","undocumented":false,"html":"Card brand. Can be \u003Ccode\u003Eamex\u003C/code\u003E, \u003Ccode\u003Ediners\u003C/code\u003E, \u003Ccode\u003Ediscover\u003C/code\u003E, \u003Ccode\u003Ejcb\u003C/code\u003E, \u003Ccode\u003Emastercard\u003C/code\u003E, \u003Ccode\u003Eunionpay\u003C/code\u003E, \u003Ccode\u003Evisa\u003C/code\u003E, or \u003Ccode\u003Eunknown\u003C/code\u003E."},"gate":false,"hide_unset_desc":null,"required":true,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"object_type":"brand"},"checks":{"name":"checks","check":"hash","validation":"hash","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"Checks on Card address and CVC if provided.","undocumented":false,"html":"Checks on Card address and CVC if provided."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"subspec":{"address_line1_check":{"name":"address_line1_check","check":"string","validation":"string","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"If a address line1 was provided, results of the check, one of `pass`, `fail`, `unavailable`, or `unchecked`.","undocumented":false,"html":"If a address line1 was provided, results of the check, one of \u003Ccode\u003Epass\u003C/code\u003E, \u003Ccode\u003Efail\u003C/code\u003E, \u003Ccode\u003Eunavailable\u003C/code\u003E, or \u003Ccode\u003Eunchecked\u003C/code\u003E."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"object_type":"address_line1_check"},"address_postal_code_check":{"name":"address_postal_code_check","check":"string","validation":"string","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"If a address postal code was provided, results of the check, one of `pass`, `fail`, `unavailable`, or `unchecked`.","undocumented":false,"html":"If a address postal code was provided, results of the check, one of \u003Ccode\u003Epass\u003C/code\u003E, \u003Ccode\u003Efail\u003C/code\u003E, \u003Ccode\u003Eunavailable\u003C/code\u003E, or \u003Ccode\u003Eunchecked\u003C/code\u003E."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"object_type":"address_postal_code_check"},"cvc_check":{"name":"cvc_check","check":"string","validation":"string","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"If a CVC was provided, results of the check, one of `pass`, `fail`, `unavailable`, or `unchecked`.","undocumented":false,"html":"If a CVC was provided, results of the check, one of \u003Ccode\u003Epass\u003C/code\u003E, \u003Ccode\u003Efail\u003C/code\u003E, \u003Ccode\u003Eunavailable\u003C/code\u003E, or \u003Ccode\u003Eunchecked\u003C/code\u003E."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"object_type":"cvc_check"}},"object_type":"checks"},"country":{"name":"country","check":"string","validation":"string","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"Two-letter ISO code representing the country of the card. You could use this attribute to get a sense of the international breakdown of cards you've collected.","undocumented":false,"html":"Two-letter ISO code representing the country of the card. You could use this attribute to get a sense of the international breakdown of cards you’ve collected."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"object_type":"country"},"exp_month":{"name":"exp_month","check":"integer","validation":"integer","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"Two-digit number representing the card's expiration month.","undocumented":false,"html":"Two-digit number representing the card’s expiration month."},"gate":false,"hide_unset_desc":null,"required":true,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"object_type":"exp_month"},"exp_year":{"name":"exp_year","check":"integer","validation":"integer","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"Four-digit number representing the card's expiration year.","undocumented":false,"html":"Four-digit number representing the card’s expiration year."},"gate":false,"hide_unset_desc":null,"required":true,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"object_type":"exp_year"},"fingerprint":{"name":"fingerprint","check":"string","validation":"string","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"Uniquely identifies this particular card number. You can use this attribute to check whether two customers who’ve signed up with you are using the same card number, for example. For payment methods that tokenize card information (Apple Pay, Google Pay), the tokenized number might be provided instead of the underlying card number.\n\n*Starting May 1, 2021, card fingerprint in India for Connect will change to allow two fingerprints for the same card --- one for India and one for the rest of the world.*\n","undocumented":false,"html":"Uniquely identifies this particular card number. You can use this attribute to check whether two customers who’ve signed up with you are using the same card number, for example. For payment methods that tokenize card information (Apple Pay, Google Pay), the tokenized number might be provided instead of the underlying card number.\u003C/p\u003E\n\n\u003Cp\u003E\u003Cem\u003EStarting May 1, 2021, card fingerprint in India for Connect will change to allow two fingerprints for the same card — one for India and one for the rest of the world.\u003C/em\u003E"},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":"card_fingerprint_read","hide_nil":null,"is_country_specific":false,"includable":null,"object_type":"fingerprint"},"funding":{"name":"funding","check":"string","validation":"string","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"Card funding type. Can be `credit`, `debit`, `prepaid`, or `unknown`.","undocumented":false,"html":"Card funding type. Can be \u003Ccode\u003Ecredit\u003C/code\u003E, \u003Ccode\u003Edebit\u003C/code\u003E, \u003Ccode\u003Eprepaid\u003C/code\u003E, or \u003Ccode\u003Eunknown\u003C/code\u003E."},"gate":false,"hide_unset_desc":null,"required":true,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"object_type":"funding"},"generated_from":{"name":"generated_from","check":"hash","validation":"hash","documentation":{"gate_specific":{"sdk_client_public":{"gate_specific":{},"localize_terms":[],"undocumented":true,"html":null}},"localize_terms":[],"markdown":"Details of the original PaymentMethod that created this object.","undocumented":false,"html":"Details of the original PaymentMethod that created this object."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"subspec":{"charge":{"name":"charge","check":"string","validation":"string","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"The charge that created this object.","undocumented":false,"html":"The charge that created this object."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"object_type":"charge"},"payment_method_details":{"name":"payment_method_details","check":"hash","validation":"hash","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"Transaction-specific details of the payment method used in the payment.","undocumented":false,"html":"Transaction-specific details of the payment method used in the payment."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"subspec":{"card_present":{"name":"card_present","check":"hash","validation":"hash","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"This hash contains the snapshot of the `card_present` transaction-specific details which generated this `card` payment method.","undocumented":false,"html":"This hash contains the snapshot of the \u003Ccode\u003Ecard_present\u003C/code\u003E transaction-specific details which generated this \u003Ccode\u003Ecard\u003C/code\u003E payment method."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"subspec":{"amount_authorized":{"name":"amount_authorized","check":"integer","validation":"integer","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"The authorized amount","undocumented":false,"html":"The authorized amount"},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"object_type":"amount_authorized"},"brand":{"name":"brand","check":"string","validation":"string","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"Card brand. Can be `amex`, `diners`, `discover`, `jcb`, `mastercard`, `unionpay`, `visa`, or `unknown`.","undocumented":false,"html":"Card brand. Can be \u003Ccode\u003Eamex\u003C/code\u003E, \u003Ccode\u003Ediners\u003C/code\u003E, \u003Ccode\u003Ediscover\u003C/code\u003E, \u003Ccode\u003Ejcb\u003C/code\u003E, \u003Ccode\u003Emastercard\u003C/code\u003E, \u003Ccode\u003Eunionpay\u003C/code\u003E, \u003Ccode\u003Evisa\u003C/code\u003E, or \u003Ccode\u003Eunknown\u003C/code\u003E."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"object_type":"brand"},"capture_before":{"name":"capture_before","check":"timestamp","validation":"timestamp","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"When using manual capture, a future timestamp after which the charge will be automatically refunded if uncaptured.","undocumented":false,"html":"When using manual capture, a future timestamp after which the charge will be automatically refunded if uncaptured."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"object_type":"capture_before"},"cardholder_name":{"name":"cardholder_name","check":"string","validation":"string","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"The cardholder name as read from the card, in [ISO 7813](https://en.wikipedia.org/wiki/ISO/IEC_7813) format. May include alphanumeric characters, special characters and first/last name separator (`/`). In some cases, the cardholder name may not be available depending on how the issuer has configured the card. Cardholder name is typically not available on swipe or contactless payments, such as those made with Apple Pay and Google Pay.","undocumented":false,"html":"The cardholder name as read from the card, in \u003Ca href=\"https://en.wikipedia.org/wiki/ISO/IEC_7813\"\u003EISO 7813\u003C/a\u003E format. May include alphanumeric characters, special characters and first/last name separator (\u003Ccode\u003E/\u003C/code\u003E). In some cases, the cardholder name may not be available depending on how the issuer has configured the card. Cardholder name is typically not available on swipe or contactless payments, such as those made with Apple Pay and Google Pay."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"object_type":"cardholder_name"},"country":{"name":"country","check":"string","validation":"string","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"Two-letter ISO code representing the country of the card. You could use this attribute to get a sense of the international breakdown of cards you've collected.","undocumented":false,"html":"Two-letter ISO code representing the country of the card. You could use this attribute to get a sense of the international breakdown of cards you’ve collected."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"object_type":"country"},"emv_auth_data":{"name":"emv_auth_data","check":"string","validation":"string","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"Authorization response cryptogram.","undocumented":false,"html":"Authorization response cryptogram."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"object_type":"emv_auth_data"},"exp_month":{"name":"exp_month","check":"integer","validation":"integer","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"Two-digit number representing the card's expiration month.","undocumented":false,"html":"Two-digit number representing the card’s expiration month."},"gate":false,"hide_unset_desc":null,"required":true,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"object_type":"exp_month"},"exp_year":{"name":"exp_year","check":"integer","validation":"integer","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"Four-digit number representing the card's expiration year.","undocumented":false,"html":"Four-digit number representing the card’s expiration year."},"gate":false,"hide_unset_desc":null,"required":true,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"object_type":"exp_year"},"fingerprint":{"name":"fingerprint","check":"string","validation":"string","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"Uniquely identifies this particular card number. You can use this attribute to check whether two customers who’ve signed up with you are using the same card number, for example. For payment methods that tokenize card information (Apple Pay, Google Pay), the tokenized number might be provided instead of the underlying card number.\n\n*Starting May 1, 2021, card fingerprint in India for Connect will change to allow two fingerprints for the same card --- one for India and one for the rest of the world.*\n","undocumented":false,"html":"Uniquely identifies this particular card number. You can use this attribute to check whether two customers who’ve signed up with you are using the same card number, for example. For payment methods that tokenize card information (Apple Pay, Google Pay), the tokenized number might be provided instead of the underlying card number.\u003C/p\u003E\n\n\u003Cp\u003E\u003Cem\u003EStarting May 1, 2021, card fingerprint in India for Connect will change to allow two fingerprints for the same card — one for India and one for the rest of the world.\u003C/em\u003E"},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"object_type":"fingerprint"},"funding":{"name":"funding","check":"string","validation":"string","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"Card funding type. Can be `credit`, `debit`, `prepaid`, or `unknown`.","undocumented":false,"html":"Card funding type. Can be \u003Ccode\u003Ecredit\u003C/code\u003E, \u003Ccode\u003Edebit\u003C/code\u003E, \u003Ccode\u003Eprepaid\u003C/code\u003E, or \u003Ccode\u003Eunknown\u003C/code\u003E."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"object_type":"funding"},"generated_card":{"name":"generated_card","check":"string","validation":"string","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"ID of a card PaymentMethod generated from the card_present PaymentMethod that may be attached to a Customer for future transactions. Only present if it was possible to generate a card PaymentMethod.","undocumented":false,"html":"ID of a card PaymentMethod generated from the card_present PaymentMethod that may be attached to a Customer for future transactions. Only present if it was possible to generate a card PaymentMethod."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"object_type":"generated_card"},"incremental_authorization_supported":{"name":"incremental_authorization_supported","check":"boolean","validation":"boolean","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"Whether this [PaymentIntent](/docs/api/payment_intents) is eligible for incremental authorizations. Request support using [request_incremental_authorization_support](/docs/api/payment_intents/create#create_payment_intent-payment_method_options-card_present-request_incremental_authorization_support).","undocumented":false,"html":"Whether this \u003Ca href=\"/docs/api/payment_intents\"\u003EPaymentIntent\u003C/a\u003E is eligible for incremental authorizations. Request support using \u003Ca href=\"/docs/api/payment_intents/create#create_payment_intent-payment_method_options-card_present-request_incremental_authorization_support\"\u003Erequest_incremental_authorization_support\u003C/a\u003E."},"gate":false,"hide_unset_desc":null,"required":true,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"object_type":"incremental_authorization_supported"},"last4":{"name":"last4","check":"string","validation":"string","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"The last four digits of the card.","undocumented":false,"html":"The last four digits of the card."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"object_type":"last4"},"network":{"name":"network","check":"string","validation":"string","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"Identifies which network this charge was processed on. Can be `amex`, `cartes_bancaires`, `diners`, `discover`, `interac`, `jcb`, `mastercard`, `unionpay`, `visa`, or `unknown`.","undocumented":false,"html":"Identifies which network this charge was processed on. Can be \u003Ccode\u003Eamex\u003C/code\u003E, \u003Ccode\u003Ecartes_bancaires\u003C/code\u003E, \u003Ccode\u003Ediners\u003C/code\u003E, \u003Ccode\u003Ediscover\u003C/code\u003E, \u003Ccode\u003Einterac\u003C/code\u003E, \u003Ccode\u003Ejcb\u003C/code\u003E, \u003Ccode\u003Emastercard\u003C/code\u003E, \u003Ccode\u003Eunionpay\u003C/code\u003E, \u003Ccode\u003Evisa\u003C/code\u003E, or \u003Ccode\u003Eunknown\u003C/code\u003E."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"object_type":"network"},"overcapture_supported":{"name":"overcapture_supported","check":"boolean","validation":"boolean","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"Defines whether the authorized amount can be over-captured or not","undocumented":false,"html":"Defines whether the authorized amount can be over-captured or not"},"gate":false,"hide_unset_desc":null,"required":true,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"object_type":"overcapture_supported"},"read_method":{"name":"read_method","check":"string","validation":"string","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"How card details were read in this transaction.","undocumented":false,"html":"How card details were read in this transaction."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"enum_values":{"contact_emv":{"documentation":{"gate_specific":{},"localize_terms":[],"markdown":"Inserting a chip card into the card reader.","undocumented":false,"html":"Inserting a chip card into the card reader."}},"contactless_emv":{"documentation":{"gate_specific":{},"localize_terms":[],"markdown":"Tapping a contactless-enabled chip card or mobile wallet.","undocumented":false,"html":"Tapping a contactless-enabled chip card or mobile wallet."}},"magnetic_stripe_track2":{"documentation":{"gate_specific":{},"localize_terms":[],"markdown":"Swiping a card using the magnetic stripe reader.","undocumented":false,"html":"Swiping a card using the magnetic stripe reader."}},"magnetic_stripe_fallback":{"documentation":{"gate_specific":{},"localize_terms":[],"markdown":"When inserting a chip card fails three times in a row, fallback to a magnetic stripe read.","undocumented":false,"html":"When inserting a chip card fails three times in a row, fallback to a magnetic stripe read."}},"contactless_magstripe_mode":{"documentation":{"gate_specific":{},"localize_terms":[],"markdown":"Older standard for contactless payments that emulated a magnetic stripe read.","undocumented":false,"html":"Older standard for contactless payments that emulated a magnetic stripe read."}}},"object_type":"read_method"},"receipt":{"name":"receipt","check":"hash","validation":"hash","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"A collection of fields required to be displayed on receipts. Only required for EMV transactions.","undocumented":false,"html":"A collection of fields required to be displayed on receipts. Only required for EMV transactions."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"subspec":{"account_type":{"name":"account_type","check":"string","validation":"string","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"The type of account being debited or credited","undocumented":false,"html":"The type of account being debited or credited"},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"enum_values":{"credit":{"documentation":{"gate_specific":{},"localize_terms":[],"markdown":"A credit account, as when using a credit card","undocumented":false,"html":"A credit account, as when using a credit card"}},"checking":{"documentation":{"gate_specific":{},"localize_terms":[],"markdown":"A checking account, as when using a debit card","undocumented":false,"html":"A checking account, as when using a debit card"}},"prepaid":{"documentation":{"gate_specific":{},"localize_terms":[],"markdown":"A prepaid account, as when using a debit gift card","undocumented":false,"html":"A prepaid account, as when using a debit gift card"}},"unknown":{"documentation":{"gate_specific":{},"localize_terms":[],"markdown":"An unknown account","undocumented":false,"html":"An unknown account"}}},"object_type":"account_type"},"application_cryptogram":{"name":"application_cryptogram","check":"string","validation":"string","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"EMV tag 9F26, cryptogram generated by the integrated circuit chip.","undocumented":false,"html":"EMV tag 9F26, cryptogram generated by the integrated circuit chip."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"object_type":"application_cryptogram"},"application_preferred_name":{"name":"application_preferred_name","check":"string","validation":"string","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"Mnenomic of the Application Identifier.","undocumented":false,"html":"Mnenomic of the Application Identifier."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"object_type":"application_preferred_name"},"authorization_code":{"name":"authorization_code","check":"string","validation":"string","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"Identifier for this transaction.","undocumented":false,"html":"Identifier for this transaction."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"object_type":"authorization_code"},"authorization_response_code":{"name":"authorization_response_code","check":"string","validation":"string","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"EMV tag 8A. A code returned by the card issuer.","undocumented":false,"html":"EMV tag 8A. A code returned by the card issuer."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"object_type":"authorization_response_code"},"cardholder_verification_method":{"name":"cardholder_verification_method","check":"string","validation":"string","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"How the cardholder verified ownership of the card.","undocumented":false,"html":"How the cardholder verified ownership of the card."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"object_type":"cardholder_verification_method"},"dedicated_file_name":{"name":"dedicated_file_name","check":"string","validation":"string","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"EMV tag 84. Similar to the application identifier stored on the integrated circuit chip.","undocumented":false,"html":"EMV tag 84. Similar to the application identifier stored on the integrated circuit chip."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"object_type":"dedicated_file_name"},"terminal_verification_results":{"name":"terminal_verification_results","check":"string","validation":"string","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"The outcome of a series of EMV functions performed by the card reader.","undocumented":false,"html":"The outcome of a series of EMV functions performed by the card reader."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"object_type":"terminal_verification_results"},"transaction_status_information":{"name":"transaction_status_information","check":"string","validation":"string","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"An indication of various EMV functions performed during the transaction.","undocumented":false,"html":"An indication of various EMV functions performed during the transaction."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"object_type":"transaction_status_information"}},"object_type":"receipt"}},"object_type":"card_present"},"type":{"name":"type","check":"string","validation":"string","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"The type of payment method transaction-specific details from the transaction that generated this `card` payment method. Always `card_present`.","undocumented":false,"html":"The type of payment method transaction-specific details from the transaction that generated this \u003Ccode\u003Ecard\u003C/code\u003E payment method. Always \u003Ccode\u003Ecard_present\u003C/code\u003E."},"gate":false,"hide_unset_desc":null,"required":true,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"object_type":"type"}},"object_type":"payment_method_details"},"setup_attempt":{"name":"setup_attempt","check":"string","validation":"string","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"The ID of the SetupAttempt that generated this PaymentMethod, if any.","undocumented":false,"html":"The ID of the SetupAttempt that generated this PaymentMethod, if any."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"user_expandable":["setup_attempt"],"object_type":"setup_attempt"}},"object_type":"generated_from"},"last4":{"name":"last4","check":"string","validation":"string","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"The last four digits of the card.","undocumented":false,"html":"The last four digits of the card."},"gate":false,"hide_unset_desc":null,"required":true,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"object_type":"last4"},"networks":{"name":"networks","check":"hash","validation":"hash","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"Contains information about card networks that can be used to process the payment.","undocumented":false,"html":"Contains information about card networks that can be used to process the payment."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"subspec":{"available":{"name":"available","check":"string_array","validation":"array containing strings","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"All available networks for the card.","undocumented":false,"html":"All available networks for the card."},"gate":false,"hide_unset_desc":null,"required":true,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"object_type":"available"},"preferred":{"name":"preferred","check":"string","validation":"string","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"The preferred network for the card.","undocumented":false,"html":"The preferred network for the card."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"object_type":"preferred"}},"object_type":"networks"},"three_d_secure_usage":{"name":"three_d_secure_usage","check":"hash","validation":"hash","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"Contains details on how this Card may be used for 3D Secure authentication.","undocumented":false,"html":"Contains details on how this Card may be used for 3D Secure authentication."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"subspec":{"supported":{"name":"supported","check":"boolean","validation":"boolean","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"Whether 3D Secure is supported on this card.","undocumented":false,"html":"Whether 3D Secure is supported on this card."},"gate":false,"hide_unset_desc":null,"required":true,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"object_type":"supported"}},"object_type":"three_d_secure_usage"},"wallet":{"name":"wallet","check":"hash","validation":"hash","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"If this Card is part of a card wallet, this contains the details of the card wallet.","undocumented":false,"html":"If this Card is part of a card wallet, this contains the details of the card wallet."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"subspec":{"amex_express_checkout":{"name":"amex_express_checkout","check":"hash","validation":"hash","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"If this is a `amex_express_checkout` card wallet, this hash contains details about the wallet.","undocumented":false,"html":"If this is a \u003Ccode\u003Eamex_express_checkout\u003C/code\u003E card wallet, this hash contains details about the wallet."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"subspec":{},"object_type":"amex_express_checkout"},"apple_pay":{"name":"apple_pay","check":"hash","validation":"hash","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"If this is a `apple_pay` card wallet, this hash contains details about the wallet.","undocumented":false,"html":"If this is a \u003Ccode\u003Eapple_pay\u003C/code\u003E card wallet, this hash contains details about the wallet."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"subspec":{},"object_type":"apple_pay"},"dynamic_last4":{"name":"dynamic_last4","check":"string","validation":"string","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"(For tokenized numbers only.) The last four digits of the device account number.","undocumented":false,"html":"(For tokenized numbers only.) The last four digits of the device account number."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"object_type":"dynamic_last4"},"google_pay":{"name":"google_pay","check":"hash","validation":"hash","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"If this is a `google_pay` card wallet, this hash contains details about the wallet.","undocumented":false,"html":"If this is a \u003Ccode\u003Egoogle_pay\u003C/code\u003E card wallet, this hash contains details about the wallet."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"subspec":{},"object_type":"google_pay"},"masterpass":{"name":"masterpass","check":"hash","validation":"hash","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"If this is a `masterpass` card wallet, this hash contains details about the wallet.","undocumented":false,"html":"If this is a \u003Ccode\u003Emasterpass\u003C/code\u003E card wallet, this hash contains details about the wallet."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"subspec":{"billing_address":{"name":"billing_address","check":"hash","validation":"hash","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"Owner's verified billing address. Values are verified or provided by the wallet directly (if supported) at the time of authorization or settlement. They cannot be set or mutated.","undocumented":false,"html":"Owner’s verified billing address. Values are verified or provided by the wallet directly (if supported) at the time of authorization or settlement. They cannot be set or mutated."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"subspec":{"city":{"name":"city","check":"string","validation":"string","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"City, district, suburb, town, or village.","undocumented":false,"html":"City, district, suburb, town, or village."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"object_type":"city"},"country":{"name":"country","check":"string","validation":"string","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)).","undocumented":false,"html":"Two-letter country code (\u003Ca href=\"https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2\"\u003EISO 3166-1 alpha-2\u003C/a\u003E)."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"object_type":"country"},"line1":{"name":"line1","check":"string","validation":"string","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"Address line 1 (e.g., street, PO Box, or company name).","undocumented":false,"html":"Address line 1 (e.g., street, PO Box, or company name)."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"object_type":"line1"},"line2":{"name":"line2","check":"string","validation":"string","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"Address line 2 (e.g., apartment, suite, unit, or building).","undocumented":false,"html":"Address line 2 (e.g., apartment, suite, unit, or building)."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"object_type":"line2"},"postal_code":{"name":"postal_code","check":"string","validation":"string","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"ZIP or postal code.","undocumented":false,"html":"ZIP or postal code."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"object_type":"postal_code"},"state":{"name":"state","check":"string","validation":"string","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"State, county, province, or region.","undocumented":false,"html":"State, county, province, or region."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"object_type":"state"}},"object_type":"billing_address"},"email":{"name":"email","check":"string","validation":"string","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"Owner's verified email. Values are verified or provided by the wallet directly (if supported) at the time of authorization or settlement. They cannot be set or mutated.","undocumented":false,"html":"Owner’s verified email. Values are verified or provided by the wallet directly (if supported) at the time of authorization or settlement. They cannot be set or mutated."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"object_type":"email"},"name":{"name":"name","check":"string","validation":"string","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"Owner's verified full name. Values are verified or provided by the wallet directly (if supported) at the time of authorization or settlement. They cannot be set or mutated.","undocumented":false,"html":"Owner’s verified full name. Values are verified or provided by the wallet directly (if supported) at the time of authorization or settlement. They cannot be set or mutated."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"object_type":"name"},"shipping_address":{"name":"shipping_address","check":"hash","validation":"hash","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"Owner's verified shipping address. Values are verified or provided by the wallet directly (if supported) at the time of authorization or settlement. They cannot be set or mutated.","undocumented":false,"html":"Owner’s verified shipping address. Values are verified or provided by the wallet directly (if supported) at the time of authorization or settlement. They cannot be set or mutated."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"subspec":{"city":{"name":"city","check":"string","validation":"string","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"City, district, suburb, town, or village.","undocumented":false,"html":"City, district, suburb, town, or village."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"object_type":"city"},"country":{"name":"country","check":"string","validation":"string","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)).","undocumented":false,"html":"Two-letter country code (\u003Ca href=\"https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2\"\u003EISO 3166-1 alpha-2\u003C/a\u003E)."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"object_type":"country"},"line1":{"name":"line1","check":"string","validation":"string","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"Address line 1 (e.g., street, PO Box, or company name).","undocumented":false,"html":"Address line 1 (e.g., street, PO Box, or company name)."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"object_type":"line1"},"line2":{"name":"line2","check":"string","validation":"string","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"Address line 2 (e.g., apartment, suite, unit, or building).","undocumented":false,"html":"Address line 2 (e.g., apartment, suite, unit, or building)."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"object_type":"line2"},"postal_code":{"name":"postal_code","check":"string","validation":"string","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"ZIP or postal code.","undocumented":false,"html":"ZIP or postal code."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"object_type":"postal_code"},"state":{"name":"state","check":"string","validation":"string","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"State, county, province, or region.","undocumented":false,"html":"State, county, province, or region."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"object_type":"state"}},"object_type":"shipping_address"}},"object_type":"masterpass"},"samsung_pay":{"name":"samsung_pay","check":"hash","validation":"hash","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"If this is a `samsung_pay` card wallet, this hash contains details about the wallet.","undocumented":false,"html":"If this is a \u003Ccode\u003Esamsung_pay\u003C/code\u003E card wallet, this hash contains details about the wallet."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"subspec":{},"object_type":"samsung_pay"},"type":{"name":"type","check":"string","validation":"string","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"The type of the card wallet, one of `amex_express_checkout`, `apple_pay`, `google_pay`, `masterpass`, `samsung_pay`, or `visa_checkout`. An additional hash is included on the Wallet subhash with a name matching this value. It contains additional information specific to the card wallet type.","undocumented":false,"html":"The type of the card wallet, one of \u003Ccode\u003Eamex_express_checkout\u003C/code\u003E, \u003Ccode\u003Eapple_pay\u003C/code\u003E, \u003Ccode\u003Egoogle_pay\u003C/code\u003E, \u003Ccode\u003Emasterpass\u003C/code\u003E, \u003Ccode\u003Esamsung_pay\u003C/code\u003E, or \u003Ccode\u003Evisa_checkout\u003C/code\u003E. An additional hash is included on the Wallet subhash with a name matching this value. It contains additional information specific to the card wallet type."},"gate":false,"hide_unset_desc":null,"required":true,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"object_type":"type"},"visa_checkout":{"name":"visa_checkout","check":"hash","validation":"hash","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"If this is a `visa_checkout` card wallet, this hash contains details about the wallet.","undocumented":false,"html":"If this is a \u003Ccode\u003Evisa_checkout\u003C/code\u003E card wallet, this hash contains details about the wallet."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"subspec":{"billing_address":{"name":"billing_address","check":"hash","validation":"hash","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"Owner's verified billing address. Values are verified or provided by the wallet directly (if supported) at the time of authorization or settlement. They cannot be set or mutated.","undocumented":false,"html":"Owner’s verified billing address. Values are verified or provided by the wallet directly (if supported) at the time of authorization or settlement. They cannot be set or mutated."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"subspec":{"city":{"name":"city","check":"string","validation":"string","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"City, district, suburb, town, or village.","undocumented":false,"html":"City, district, suburb, town, or village."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"object_type":"city"},"country":{"name":"country","check":"string","validation":"string","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)).","undocumented":false,"html":"Two-letter country code (\u003Ca href=\"https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2\"\u003EISO 3166-1 alpha-2\u003C/a\u003E)."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"object_type":"country"},"line1":{"name":"line1","check":"string","validation":"string","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"Address line 1 (e.g., street, PO Box, or company name).","undocumented":false,"html":"Address line 1 (e.g., street, PO Box, or company name)."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"object_type":"line1"},"line2":{"name":"line2","check":"string","validation":"string","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"Address line 2 (e.g., apartment, suite, unit, or building).","undocumented":false,"html":"Address line 2 (e.g., apartment, suite, unit, or building)."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"object_type":"line2"},"postal_code":{"name":"postal_code","check":"string","validation":"string","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"ZIP or postal code.","undocumented":false,"html":"ZIP or postal code."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"object_type":"postal_code"},"state":{"name":"state","check":"string","validation":"string","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"State, county, province, or region.","undocumented":false,"html":"State, county, province, or region."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"object_type":"state"}},"object_type":"billing_address"},"email":{"name":"email","check":"string","validation":"string","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"Owner's verified email. Values are verified or provided by the wallet directly (if supported) at the time of authorization or settlement. They cannot be set or mutated.","undocumented":false,"html":"Owner’s verified email. Values are verified or provided by the wallet directly (if supported) at the time of authorization or settlement. They cannot be set or mutated."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"object_type":"email"},"name":{"name":"name","check":"string","validation":"string","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"Owner's verified full name. Values are verified or provided by the wallet directly (if supported) at the time of authorization or settlement. They cannot be set or mutated.","undocumented":false,"html":"Owner’s verified full name. Values are verified or provided by the wallet directly (if supported) at the time of authorization or settlement. They cannot be set or mutated."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"object_type":"name"},"shipping_address":{"name":"shipping_address","check":"hash","validation":"hash","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"Owner's verified shipping address. Values are verified or provided by the wallet directly (if supported) at the time of authorization or settlement. They cannot be set or mutated.","undocumented":false,"html":"Owner’s verified shipping address. Values are verified or provided by the wallet directly (if supported) at the time of authorization or settlement. They cannot be set or mutated."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"subspec":{"city":{"name":"city","check":"string","validation":"string","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"City, district, suburb, town, or village.","undocumented":false,"html":"City, district, suburb, town, or village."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"object_type":"city"},"country":{"name":"country","check":"string","validation":"string","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)).","undocumented":false,"html":"Two-letter country code (\u003Ca href=\"https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2\"\u003EISO 3166-1 alpha-2\u003C/a\u003E)."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"object_type":"country"},"line1":{"name":"line1","check":"string","validation":"string","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"Address line 1 (e.g., street, PO Box, or company name).","undocumented":false,"html":"Address line 1 (e.g., street, PO Box, or company name)."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"object_type":"line1"},"line2":{"name":"line2","check":"string","validation":"string","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"Address line 2 (e.g., apartment, suite, unit, or building).","undocumented":false,"html":"Address line 2 (e.g., apartment, suite, unit, or building)."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"object_type":"line2"},"postal_code":{"name":"postal_code","check":"string","validation":"string","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"ZIP or postal code.","undocumented":false,"html":"ZIP or postal code."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"object_type":"postal_code"},"state":{"name":"state","check":"string","validation":"string","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"State, county, province, or region.","undocumented":false,"html":"State, county, province, or region."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"object_type":"state"}},"object_type":"shipping_address"}},"object_type":"visa_checkout"}},"object_type":"wallet"}},"object_type":"card","less_common":true},"card_present":{"name":"card_present","check":"hash","validation":"hash","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"If this is a `card_present` PaymentMethod, this hash contains details about the Card Present payment method.","undocumented":false,"html":"If this is a \u003Ccode\u003Ecard_present\u003C/code\u003E PaymentMethod, this hash contains details about the Card Present payment method."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"subspec":{"brand":{"name":"brand","check":"string","validation":"string","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"Card brand. Can be `amex`, `diners`, `discover`, `jcb`, `mastercard`, `unionpay`, `visa`, or `unknown`.","undocumented":false,"html":"Card brand. Can be \u003Ccode\u003Eamex\u003C/code\u003E, \u003Ccode\u003Ediners\u003C/code\u003E, \u003Ccode\u003Ediscover\u003C/code\u003E, \u003Ccode\u003Ejcb\u003C/code\u003E, \u003Ccode\u003Emastercard\u003C/code\u003E, \u003Ccode\u003Eunionpay\u003C/code\u003E, \u003Ccode\u003Evisa\u003C/code\u003E, or \u003Ccode\u003Eunknown\u003C/code\u003E."},"gate":true,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"object_type":"brand"},"cardholder_name":{"name":"cardholder_name","check":"string","validation":"string","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"The cardholder name as read from the card, in [ISO 7813](https://en.wikipedia.org/wiki/ISO/IEC_7813) format. May include alphanumeric characters, special characters and first/last name separator (`/`). In some cases, the cardholder name may not be available depending on how the issuer has configured the card. Cardholder name is typically not available on swipe or contactless payments, such as those made with Apple Pay and Google Pay.","undocumented":false,"html":"The cardholder name as read from the card, in \u003Ca href=\"https://en.wikipedia.org/wiki/ISO/IEC_7813\"\u003EISO 7813\u003C/a\u003E format. May include alphanumeric characters, special characters and first/last name separator (\u003Ccode\u003E/\u003C/code\u003E). In some cases, the cardholder name may not be available depending on how the issuer has configured the card. Cardholder name is typically not available on swipe or contactless payments, such as those made with Apple Pay and Google Pay."},"gate":true,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"object_type":"cardholder_name"},"country":{"name":"country","check":"string","validation":"string","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"Two-letter ISO code representing the country of the card. You could use this attribute to get a sense of the international breakdown of cards you've collected.","undocumented":false,"html":"Two-letter ISO code representing the country of the card. You could use this attribute to get a sense of the international breakdown of cards you’ve collected."},"gate":true,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"object_type":"country"},"exp_month":{"name":"exp_month","check":"integer","validation":"integer","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"Two-digit number representing the card's expiration month.","undocumented":false,"html":"Two-digit number representing the card’s expiration month."},"gate":true,"hide_unset_desc":null,"required":true,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"object_type":"exp_month"},"exp_year":{"name":"exp_year","check":"integer","validation":"integer","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"Four-digit number representing the card's expiration year.","undocumented":false,"html":"Four-digit number representing the card’s expiration year."},"gate":true,"hide_unset_desc":null,"required":true,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"object_type":"exp_year"},"fingerprint":{"name":"fingerprint","check":"string","validation":"string","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"Uniquely identifies this particular card number. You can use this attribute to check whether two customers who’ve signed up with you are using the same card number, for example. For payment methods that tokenize card information (Apple Pay, Google Pay), the tokenized number might be provided instead of the underlying card number.\n\n*Starting May 1, 2021, card fingerprint in India for Connect will change to allow two fingerprints for the same card --- one for India and one for the rest of the world.*\n","undocumented":false,"html":"Uniquely identifies this particular card number. You can use this attribute to check whether two customers who’ve signed up with you are using the same card number, for example. For payment methods that tokenize card information (Apple Pay, Google Pay), the tokenized number might be provided instead of the underlying card number.\u003C/p\u003E\n\n\u003Cp\u003E\u003Cem\u003EStarting May 1, 2021, card fingerprint in India for Connect will change to allow two fingerprints for the same card — one for India and one for the rest of the world.\u003C/em\u003E"},"gate":true,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"object_type":"fingerprint"},"funding":{"name":"funding","check":"string","validation":"string","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"Card funding type. Can be `credit`, `debit`, `prepaid`, or `unknown`.","undocumented":false,"html":"Card funding type. Can be \u003Ccode\u003Ecredit\u003C/code\u003E, \u003Ccode\u003Edebit\u003C/code\u003E, \u003Ccode\u003Eprepaid\u003C/code\u003E, or \u003Ccode\u003Eunknown\u003C/code\u003E."},"gate":true,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"object_type":"funding"},"last4":{"name":"last4","check":"string","validation":"string","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"The last four digits of the card.","undocumented":false,"html":"The last four digits of the card."},"gate":true,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"object_type":"last4"},"networks":{"name":"networks","check":"hash","validation":"hash","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"Contains information about card networks that can be used to process the payment.","undocumented":false,"html":"Contains information about card networks that can be used to process the payment."},"gate":true,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"subspec":{"available":{"name":"available","check":"string_array","validation":"array containing strings","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"All available networks for the card.","undocumented":false,"html":"All available networks for the card."},"gate":false,"hide_unset_desc":null,"required":true,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"object_type":"available"},"preferred":{"name":"preferred","check":"string","validation":"string","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"The preferred network for the card.","undocumented":false,"html":"The preferred network for the card."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"object_type":"preferred"}},"object_type":"networks"},"read_method":{"name":"read_method","check":"string","validation":"string","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"How card details were read in this transaction.","undocumented":false,"html":"How card details were read in this transaction."},"gate":true,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"enum_values":{"contact_emv":{"documentation":{"gate_specific":{},"localize_terms":[],"markdown":"Inserting a chip card into the card reader.","undocumented":false,"html":"Inserting a chip card into the card reader."}},"contactless_emv":{"documentation":{"gate_specific":{},"localize_terms":[],"markdown":"Tapping a contactless-enabled chip card or mobile wallet.","undocumented":false,"html":"Tapping a contactless-enabled chip card or mobile wallet."}},"magnetic_stripe_track2":{"documentation":{"gate_specific":{},"localize_terms":[],"markdown":"Swiping a card using the magnetic stripe reader.","undocumented":false,"html":"Swiping a card using the magnetic stripe reader."}},"magnetic_stripe_fallback":{"documentation":{"gate_specific":{},"localize_terms":[],"markdown":"When inserting a chip card fails three times in a row, fallback to a magnetic stripe read.","undocumented":false,"html":"When inserting a chip card fails three times in a row, fallback to a magnetic stripe read."}},"contactless_magstripe_mode":{"documentation":{"gate_specific":{},"localize_terms":[],"markdown":"Older standard for contactless payments that emulated a magnetic stripe read.","undocumented":false,"html":"Older standard for contactless payments that emulated a magnetic stripe read."}}},"object_type":"read_method"}},"object_type":"card_present","less_common":true},"created":{"name":"created","check":"timestamp","validation":"timestamp","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"Time at which the object was created. Measured in seconds since the Unix epoch.","undocumented":false,"html":"Time at which the object was created. Measured in seconds since the Unix epoch."},"gate":false,"hide_unset_desc":null,"required":true,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"object_type":"created","less_common":true},"customer":{"name":"customer","check":"string","validation":"string","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"The ID of the Customer to which this PaymentMethod is saved. This will not be set when the PaymentMethod has not been saved to a Customer.","undocumented":false,"html":"The ID of the Customer to which this PaymentMethod is saved. This will not be set when the PaymentMethod has not been saved to a Customer."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"user_expandable":["customer"],"object_type":"customer"},"customer_balance":{"name":"customer_balance","check":"hash","validation":"hash","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"If this is a `customer_balance` PaymentMethod, this hash contains details about the CustomerBalance payment method.","undocumented":false,"html":"If this is a \u003Ccode\u003Ecustomer_balance\u003C/code\u003E PaymentMethod, this hash contains details about the CustomerBalance payment method."},"gate":true,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"subspec":{},"object_type":"customer_balance","less_common":true},"eps":{"name":"eps","check":"hash","validation":"hash","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"If this is an `eps` PaymentMethod, this hash contains details about the EPS payment method.","undocumented":false,"html":"If this is an \u003Ccode\u003Eeps\u003C/code\u003E PaymentMethod, this hash contains details about the EPS payment method."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"subspec":{"bank":{"name":"bank","check":"string","validation":"string","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"The customer's bank. Should be one of `arzte_und_apotheker_bank`, `austrian_anadi_bank_ag`, `bank_austria`, `bankhaus_carl_spangler`, `bankhaus_schelhammer_und_schattera_ag`, `bawag_psk_ag`, `bks_bank_ag`, `brull_kallmus_bank_ag`, `btv_vier_lander_bank`, `capital_bank_grawe_gruppe_ag`, `deutsche_bank_ag`, `dolomitenbank`, `easybank_ag`, `erste_bank_und_sparkassen`, `hypo_alpeadriabank_international_ag`, `hypo_noe_lb_fur_niederosterreich_u_wien`, `hypo_oberosterreich_salzburg_steiermark`, `hypo_tirol_bank_ag`, `hypo_vorarlberg_bank_ag`, `hypo_bank_burgenland_aktiengesellschaft`, `marchfelder_bank`, `oberbank_ag`, `raiffeisen_bankengruppe_osterreich`, `schoellerbank_ag`, `sparda_bank_wien`, `volksbank_gruppe`, `volkskreditbank_ag`, or `vr_bank_braunau`.","undocumented":false,"html":"The customer’s bank. Should be one of \u003Ccode\u003Earzte_und_apotheker_bank\u003C/code\u003E, \u003Ccode\u003Eaustrian_anadi_bank_ag\u003C/code\u003E, \u003Ccode\u003Ebank_austria\u003C/code\u003E, \u003Ccode\u003Ebankhaus_carl_spangler\u003C/code\u003E, \u003Ccode\u003Ebankhaus_schelhammer_und_schattera_ag\u003C/code\u003E, \u003Ccode\u003Ebawag_psk_ag\u003C/code\u003E, \u003Ccode\u003Ebks_bank_ag\u003C/code\u003E, \u003Ccode\u003Ebrull_kallmus_bank_ag\u003C/code\u003E, \u003Ccode\u003Ebtv_vier_lander_bank\u003C/code\u003E, \u003Ccode\u003Ecapital_bank_grawe_gruppe_ag\u003C/code\u003E, \u003Ccode\u003Edeutsche_bank_ag\u003C/code\u003E, \u003Ccode\u003Edolomitenbank\u003C/code\u003E, \u003Ccode\u003Eeasybank_ag\u003C/code\u003E, \u003Ccode\u003Eerste_bank_und_sparkassen\u003C/code\u003E, \u003Ccode\u003Ehypo_alpeadriabank_international_ag\u003C/code\u003E, \u003Ccode\u003Ehypo_noe_lb_fur_niederosterreich_u_wien\u003C/code\u003E, \u003Ccode\u003Ehypo_oberosterreich_salzburg_steiermark\u003C/code\u003E, \u003Ccode\u003Ehypo_tirol_bank_ag\u003C/code\u003E, \u003Ccode\u003Ehypo_vorarlberg_bank_ag\u003C/code\u003E, \u003Ccode\u003Ehypo_bank_burgenland_aktiengesellschaft\u003C/code\u003E, \u003Ccode\u003Emarchfelder_bank\u003C/code\u003E, \u003Ccode\u003Eoberbank_ag\u003C/code\u003E, \u003Ccode\u003Eraiffeisen_bankengruppe_osterreich\u003C/code\u003E, \u003Ccode\u003Eschoellerbank_ag\u003C/code\u003E, \u003Ccode\u003Esparda_bank_wien\u003C/code\u003E, \u003Ccode\u003Evolksbank_gruppe\u003C/code\u003E, \u003Ccode\u003Evolkskreditbank_ag\u003C/code\u003E, or \u003Ccode\u003Evr_bank_braunau\u003C/code\u003E."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"object_type":"bank"}},"object_type":"eps","less_common":true},"fpx":{"name":"fpx","check":"hash","validation":"hash","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"If this is an `fpx` PaymentMethod, this hash contains details about the FPX payment method.","undocumented":false,"html":"If this is an \u003Ccode\u003Efpx\u003C/code\u003E PaymentMethod, this hash contains details about the FPX payment method."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"subspec":{"bank":{"name":"bank","check":"string","validation":"string","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"The customer's bank, if provided. Can be one of `affin_bank`, `agrobank`, `alliance_bank`, `ambank`, `bank_islam`, `bank_muamalat`, `bank_rakyat`, `bsn`, `cimb`, `hong_leong_bank`, `hsbc`, `kfh`, `maybank2u`, `ocbc`, `public_bank`, `rhb`, `standard_chartered`, `uob`, `deutsche_bank`, `maybank2e`, `pb_enterprise`, or `bank_of_china`.","undocumented":false,"html":"The customer’s bank, if provided. Can be one of \u003Ccode\u003Eaffin_bank\u003C/code\u003E, \u003Ccode\u003Eagrobank\u003C/code\u003E, \u003Ccode\u003Ealliance_bank\u003C/code\u003E, \u003Ccode\u003Eambank\u003C/code\u003E, \u003Ccode\u003Ebank_islam\u003C/code\u003E, \u003Ccode\u003Ebank_muamalat\u003C/code\u003E, \u003Ccode\u003Ebank_rakyat\u003C/code\u003E, \u003Ccode\u003Ebsn\u003C/code\u003E, \u003Ccode\u003Ecimb\u003C/code\u003E, \u003Ccode\u003Ehong_leong_bank\u003C/code\u003E, \u003Ccode\u003Ehsbc\u003C/code\u003E, \u003Ccode\u003Ekfh\u003C/code\u003E, \u003Ccode\u003Emaybank2u\u003C/code\u003E, \u003Ccode\u003Eocbc\u003C/code\u003E, \u003Ccode\u003Epublic_bank\u003C/code\u003E, \u003Ccode\u003Erhb\u003C/code\u003E, \u003Ccode\u003Estandard_chartered\u003C/code\u003E, \u003Ccode\u003Euob\u003C/code\u003E, \u003Ccode\u003Edeutsche_bank\u003C/code\u003E, \u003Ccode\u003Emaybank2e\u003C/code\u003E, \u003Ccode\u003Epb_enterprise\u003C/code\u003E, or \u003Ccode\u003Ebank_of_china\u003C/code\u003E."},"gate":false,"hide_unset_desc":null,"required":true,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"object_type":"bank"}},"object_type":"fpx","less_common":true},"giropay":{"name":"giropay","check":"hash","validation":"hash","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"If this is a `giropay` PaymentMethod, this hash contains details about the Giropay payment method.","undocumented":false,"html":"If this is a \u003Ccode\u003Egiropay\u003C/code\u003E PaymentMethod, this hash contains details about the Giropay payment method."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"subspec":{},"object_type":"giropay","less_common":true},"grabpay":{"name":"grabpay","check":"hash","validation":"hash","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"If this is a `grabpay` PaymentMethod, this hash contains details about the GrabPay payment method.","undocumented":false,"html":"If this is a \u003Ccode\u003Egrabpay\u003C/code\u003E PaymentMethod, this hash contains details about the GrabPay payment method."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"subspec":{},"object_type":"grabpay","less_common":true},"ideal":{"name":"ideal","check":"hash","validation":"hash","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"If this is an `ideal` PaymentMethod, this hash contains details about the iDEAL payment method.","undocumented":false,"html":"If this is an \u003Ccode\u003Eideal\u003C/code\u003E PaymentMethod, this hash contains details about the iDEAL payment method."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"subspec":{"bank":{"name":"bank","check":"string","validation":"string","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"The customer's bank, if provided. Can be one of `abn_amro`, `asn_bank`, `bunq`, `handelsbanken`, `ing`, `knab`, `moneyou`, `rabobank`, `regiobank`, `revolut`, `sns_bank`, `triodos_bank`, `van_lanschot`, or `yoursafe`.","undocumented":false,"html":"The customer’s bank, if provided. Can be one of \u003Ccode\u003Eabn_amro\u003C/code\u003E, \u003Ccode\u003Easn_bank\u003C/code\u003E, \u003Ccode\u003Ebunq\u003C/code\u003E, \u003Ccode\u003Ehandelsbanken\u003C/code\u003E, \u003Ccode\u003Eing\u003C/code\u003E, \u003Ccode\u003Eknab\u003C/code\u003E, \u003Ccode\u003Emoneyou\u003C/code\u003E, \u003Ccode\u003Erabobank\u003C/code\u003E, \u003Ccode\u003Eregiobank\u003C/code\u003E, \u003Ccode\u003Erevolut\u003C/code\u003E, \u003Ccode\u003Esns_bank\u003C/code\u003E, \u003Ccode\u003Etriodos_bank\u003C/code\u003E, \u003Ccode\u003Evan_lanschot\u003C/code\u003E, or \u003Ccode\u003Eyoursafe\u003C/code\u003E."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"object_type":"bank"},"bic":{"name":"bic","check":"string","validation":"string","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"The Bank Identifier Code of the customer's bank, if the bank was provided.","undocumented":false,"html":"The Bank Identifier Code of the customer’s bank, if the bank was provided."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"object_type":"bic"}},"object_type":"ideal","less_common":true},"interac_present":{"name":"interac_present","check":"hash","validation":"hash","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"If this is an `interac_present` PaymentMethod, this hash contains details about the Interac Present payment method.","undocumented":false,"html":"If this is an \u003Ccode\u003Einterac_present\u003C/code\u003E PaymentMethod, this hash contains details about the Interac Present payment method."},"gate":true,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"subspec":{"brand":{"name":"brand","check":"string","validation":"string","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"Card brand. Can be `interac`, `mastercard` or `visa`.","undocumented":false,"html":"Card brand. Can be \u003Ccode\u003Einterac\u003C/code\u003E, \u003Ccode\u003Emastercard\u003C/code\u003E or \u003Ccode\u003Evisa\u003C/code\u003E."},"gate":true,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"object_type":"brand"},"cardholder_name":{"name":"cardholder_name","check":"string","validation":"string","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"The cardholder name as read from the card, in [ISO 7813](https://en.wikipedia.org/wiki/ISO/IEC_7813) format. May include alphanumeric characters, special characters and first/last name separator (`/`). In some cases, the cardholder name may not be available depending on how the issuer has configured the card. Cardholder name is typically not available on swipe or contactless payments, such as those made with Apple Pay and Google Pay.","undocumented":false,"html":"The cardholder name as read from the card, in \u003Ca href=\"https://en.wikipedia.org/wiki/ISO/IEC_7813\"\u003EISO 7813\u003C/a\u003E format. May include alphanumeric characters, special characters and first/last name separator (\u003Ccode\u003E/\u003C/code\u003E). In some cases, the cardholder name may not be available depending on how the issuer has configured the card. Cardholder name is typically not available on swipe or contactless payments, such as those made with Apple Pay and Google Pay."},"gate":true,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"object_type":"cardholder_name"},"country":{"name":"country","check":"string","validation":"string","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"Two-letter ISO code representing the country of the card. You could use this attribute to get a sense of the international breakdown of cards you've collected.","undocumented":false,"html":"Two-letter ISO code representing the country of the card. You could use this attribute to get a sense of the international breakdown of cards you’ve collected."},"gate":true,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"object_type":"country"},"exp_month":{"name":"exp_month","check":"integer","validation":"integer","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"Two-digit number representing the card's expiration month.","undocumented":false,"html":"Two-digit number representing the card’s expiration month."},"gate":true,"hide_unset_desc":null,"required":true,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"object_type":"exp_month"},"exp_year":{"name":"exp_year","check":"integer","validation":"integer","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"Four-digit number representing the card's expiration year.","undocumented":false,"html":"Four-digit number representing the card’s expiration year."},"gate":true,"hide_unset_desc":null,"required":true,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"object_type":"exp_year"},"fingerprint":{"name":"fingerprint","check":"string","validation":"string","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"Uniquely identifies this particular card number. You can use this attribute to check whether two customers who’ve signed up with you are using the same card number, for example. For payment methods that tokenize card information (Apple Pay, Google Pay), the tokenized number might be provided instead of the underlying card number.\n\n*Starting May 1, 2021, card fingerprint in India for Connect will change to allow two fingerprints for the same card --- one for India and one for the rest of the world.*\n","undocumented":false,"html":"Uniquely identifies this particular card number. You can use this attribute to check whether two customers who’ve signed up with you are using the same card number, for example. For payment methods that tokenize card information (Apple Pay, Google Pay), the tokenized number might be provided instead of the underlying card number.\u003C/p\u003E\n\n\u003Cp\u003E\u003Cem\u003EStarting May 1, 2021, card fingerprint in India for Connect will change to allow two fingerprints for the same card — one for India and one for the rest of the world.\u003C/em\u003E"},"gate":true,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"object_type":"fingerprint"},"funding":{"name":"funding","check":"string","validation":"string","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"Card funding type. Can be `credit`, `debit`, `prepaid`, or `unknown`.","undocumented":false,"html":"Card funding type. Can be \u003Ccode\u003Ecredit\u003C/code\u003E, \u003Ccode\u003Edebit\u003C/code\u003E, \u003Ccode\u003Eprepaid\u003C/code\u003E, or \u003Ccode\u003Eunknown\u003C/code\u003E."},"gate":true,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"object_type":"funding"},"last4":{"name":"last4","check":"string","validation":"string","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"The last four digits of the card.","undocumented":false,"html":"The last four digits of the card."},"gate":true,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"object_type":"last4"},"networks":{"name":"networks","check":"hash","validation":"hash","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"Contains information about card networks that can be used to process the payment.","undocumented":false,"html":"Contains information about card networks that can be used to process the payment."},"gate":true,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"subspec":{"available":{"name":"available","check":"string_array","validation":"array containing strings","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"All available networks for the card.","undocumented":false,"html":"All available networks for the card."},"gate":false,"hide_unset_desc":null,"required":true,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"object_type":"available"},"preferred":{"name":"preferred","check":"string","validation":"string","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"The preferred network for the card.","undocumented":false,"html":"The preferred network for the card."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"object_type":"preferred"}},"object_type":"networks"},"preferred_locales":{"name":"preferred_locales","check":"string_array","validation":"array containing strings","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"EMV tag 5F2D. Preferred languages specified by the integrated circuit chip.","undocumented":false,"html":"EMV tag 5F2D. Preferred languages specified by the integrated circuit chip."},"gate":true,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"object_type":"preferred_locales"},"read_method":{"name":"read_method","check":"string","validation":"string","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"How card details were read in this transaction.","undocumented":false,"html":"How card details were read in this transaction."},"gate":true,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"enum_values":{"contact_emv":{"documentation":{"gate_specific":{},"localize_terms":[],"markdown":"Inserting a chip card into the card reader.","undocumented":false,"html":"Inserting a chip card into the card reader."}},"contactless_emv":{"documentation":{"gate_specific":{},"localize_terms":[],"markdown":"Tapping a contactless-enabled chip card or mobile wallet.","undocumented":false,"html":"Tapping a contactless-enabled chip card or mobile wallet."}},"magnetic_stripe_track2":{"documentation":{"gate_specific":{},"localize_terms":[],"markdown":"Swiping a card using the magnetic stripe reader.","undocumented":false,"html":"Swiping a card using the magnetic stripe reader."}},"magnetic_stripe_fallback":{"documentation":{"gate_specific":{},"localize_terms":[],"markdown":"When inserting a chip card fails three times in a row, fallback to a magnetic stripe read.","undocumented":false,"html":"When inserting a chip card fails three times in a row, fallback to a magnetic stripe read."}},"contactless_magstripe_mode":{"documentation":{"gate_specific":{},"localize_terms":[],"markdown":"Older standard for contactless payments that emulated a magnetic stripe read.","undocumented":false,"html":"Older standard for contactless payments that emulated a magnetic stripe read."}}},"object_type":"read_method"}},"object_type":"interac_present","less_common":true},"klarna":{"name":"klarna","check":"hash","validation":"hash","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"If this is a `klarna` PaymentMethod, this hash contains details about the Klarna payment method.","undocumented":false,"html":"If this is a \u003Ccode\u003Eklarna\u003C/code\u003E PaymentMethod, this hash contains details about the Klarna payment method."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"subspec":{"dob":{"name":"dob","check":"hash","validation":"hash","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"The customer's date of birth, if provided.","undocumented":false,"html":"The customer’s date of birth, if provided."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":true,"subspec":{"day":{"name":"day","check":"positive_integer","validation":"positive integer","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"The day of birth, between 1 and 31.","undocumented":false,"html":"The day of birth, between 1 and 31."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"object_type":"day"},"month":{"name":"month","check":"positive_integer","validation":"positive integer","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"The month of birth, between 1 and 12.","undocumented":false,"html":"The month of birth, between 1 and 12."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"object_type":"month"},"year":{"name":"year","check":"positive_integer","validation":"positive integer","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"The four-digit year of birth.","undocumented":false,"html":"The four-digit year of birth."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"object_type":"year"}},"object_type":"dob"}},"object_type":"klarna","less_common":true},"konbini":{"name":"konbini","check":"hash","validation":"hash","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"If this is a `konbini` PaymentMethod, this hash contains details about the Konbini payment method.","undocumented":false,"html":"If this is a \u003Ccode\u003Ekonbini\u003C/code\u003E PaymentMethod, this hash contains details about the Konbini payment method."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"subspec":{},"object_type":"konbini","less_common":true},"link":{"name":"link","check":"hash","validation":"hash","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"If this is an `Link` PaymentMethod, this hash contains details about the Link payment method.","undocumented":false,"html":"If this is an \u003Ccode\u003ELink\u003C/code\u003E PaymentMethod, this hash contains details about the Link payment method."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"subspec":{"email":{"name":"email","check":"string","validation":"string","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"Account owner's email address.","undocumented":false,"html":"Account owner’s email address."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"object_type":"email"},"persistent_token":{"name":"persistent_token","check":"string","validation":"string","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"Token used for persistent Link logins.","undocumented":false,"html":"Token used for persistent Link logins."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"object_type":"persistent_token"}},"object_type":"link","less_common":true},"livemode":{"name":"livemode","check":"boolean","validation":"boolean","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode.","undocumented":false,"html":"Has the value \u003Ccode\u003Etrue\u003C/code\u003E if the object exists in live mode or the value \u003Ccode\u003Efalse\u003C/code\u003E if the object exists in test mode."},"gate":false,"hide_unset_desc":null,"required":true,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"object_type":"livemode","less_common":true},"metadata":{"name":"metadata","check":"hash","validation":"hash","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"Set of [key-value pairs](/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format.","undocumented":false,"html":"Set of \u003Ca href=\"/docs/api/metadata\"\u003Ekey-value pairs\u003C/a\u003E that you can attach to an object. This can be useful for storing additional information about the object in a structured format."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"object_type":"metadata"},"oxxo":{"name":"oxxo","check":"hash","validation":"hash","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"If this is an `oxxo` PaymentMethod, this hash contains details about the OXXO payment method.","undocumented":false,"html":"If this is an \u003Ccode\u003Eoxxo\u003C/code\u003E PaymentMethod, this hash contains details about the OXXO payment method."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"subspec":{},"object_type":"oxxo","less_common":true},"p24":{"name":"p24","check":"hash","validation":"hash","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"If this is a `p24` PaymentMethod, this hash contains details about the P24 payment method.","undocumented":false,"html":"If this is a \u003Ccode\u003Ep24\u003C/code\u003E PaymentMethod, this hash contains details about the P24 payment method."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"subspec":{"bank":{"name":"bank","check":"string","validation":"string","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"The customer's bank, if provided.","undocumented":false,"html":"The customer’s bank, if provided."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"enum_values":{"ing":{"documentation":null},"citi_handlowy":{"documentation":null},"tmobile_usbugi_bankowe":{"documentation":null},"plus_bank":{"documentation":null},"etransfer_pocztowy24":{"documentation":null},"banki_spbdzielcze":{"documentation":null},"bank_nowy_bfg_sa":{"documentation":null},"getin_bank":{"documentation":null},"blik":{"documentation":null},"noble_pay":{"documentation":null},"ideabank":{"documentation":null},"envelobank":{"documentation":null},"santander_przelew24":{"documentation":null},"nest_przelew":{"documentation":null},"mbank_mtransfer":{"documentation":null},"inteligo":{"documentation":null},"pbac_z_ipko":{"documentation":null},"bnp_paribas":{"documentation":null},"credit_agricole":{"documentation":null},"toyota_bank":{"documentation":null},"bank_pekao_sa":{"documentation":null},"volkswagen_bank":{"documentation":null},"bank_millennium":{"documentation":null},"alior_bank":{"documentation":null},"boz":{"documentation":null}},"object_type":"bank"}},"object_type":"p24","less_common":true},"paynow":{"name":"paynow","check":"hash","validation":"hash","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"If this is a `paynow` PaymentMethod, this hash contains details about the PayNow payment method.","undocumented":false,"html":"If this is a \u003Ccode\u003Epaynow\u003C/code\u003E PaymentMethod, this hash contains details about the PayNow payment method."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"subspec":{},"object_type":"paynow","less_common":true},"pix":{"name":"pix","check":"hash","validation":"hash","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"If this is a `pix` PaymentMethod, this hash contains details about the Pix payment method.","undocumented":false,"html":"If this is a \u003Ccode\u003Epix\u003C/code\u003E PaymentMethod, this hash contains details about the Pix payment method."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"subspec":{},"object_type":"pix","less_common":true},"promptpay":{"name":"promptpay","check":"hash","validation":"hash","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"If this is a `promptpay` PaymentMethod, this hash contains details about the PromptPay payment method.","undocumented":false,"html":"If this is a \u003Ccode\u003Epromptpay\u003C/code\u003E PaymentMethod, this hash contains details about the PromptPay payment method."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"subspec":{},"object_type":"promptpay","less_common":true},"radar_options":{"name":"radar_options","check":"hash","validation":"hash","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"Options to configure Radar. See [Radar Session](/docs/radar/radar-session) for more information.","undocumented":false,"html":"Options to configure Radar. See \u003Ca href=\"/docs/radar/radar-session\"\u003ERadar Session\u003C/a\u003E for more information."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"subspec":{"session":{"name":"session","check":"string","validation":"string","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"A [Radar Session](/docs/radar/radar-session) is a snapshot of the browser metadata and device details that help Radar make more accurate predictions on your payments.","undocumented":false,"html":"A \u003Ca href=\"/docs/radar/radar-session\"\u003ERadar Session\u003C/a\u003E is a snapshot of the browser metadata and device details that help Radar make more accurate predictions on your payments."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"object_type":"session"}},"object_type":"radar_options","less_common":true},"sepa_debit":{"name":"sepa_debit","check":"hash","validation":"hash","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"If this is a `sepa_debit` PaymentMethod, this hash contains details about the SEPA debit bank account.","undocumented":false,"html":"If this is a \u003Ccode\u003Esepa_debit\u003C/code\u003E PaymentMethod, this hash contains details about the SEPA debit bank account."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"subspec":{"bank_code":{"name":"bank_code","check":"string","validation":"string","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"Bank code of bank associated with the bank account.","undocumented":false,"html":"Bank code of bank associated with the bank account."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"object_type":"bank_code"},"branch_code":{"name":"branch_code","check":"string","validation":"string","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"Branch code of bank associated with the bank account.","undocumented":false,"html":"Branch code of bank associated with the bank account."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"object_type":"branch_code"},"country":{"name":"country","check":"string","validation":"string","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"Two-letter ISO code representing the country the bank account is located in.","undocumented":false,"html":"Two-letter ISO code representing the country the bank account is located in."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"object_type":"country"},"fingerprint":{"name":"fingerprint","check":"string","validation":"string","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"Uniquely identifies this particular bank account. You can use this attribute to check whether two bank accounts are the same.","undocumented":false,"html":"Uniquely identifies this particular bank account. You can use this attribute to check whether two bank accounts are the same."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"object_type":"fingerprint"},"generated_from":{"name":"generated_from","check":"hash","validation":"hash","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"Information about the object that generated this PaymentMethod.","undocumented":false,"html":"Information about the object that generated this PaymentMethod."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"subspec":{"charge":{"name":"charge","check":"string","validation":"string","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"The ID of the Charge that generated this PaymentMethod, if any.","undocumented":false,"html":"The ID of the Charge that generated this PaymentMethod, if any."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"user_expandable":["charge"],"object_type":"charge"},"setup_attempt":{"name":"setup_attempt","check":"string","validation":"string","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"The ID of the SetupAttempt that generated this PaymentMethod, if any.","undocumented":false,"html":"The ID of the SetupAttempt that generated this PaymentMethod, if any."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"user_expandable":["setup_attempt"],"object_type":"setup_attempt"}},"object_type":"generated_from"},"last4":{"name":"last4","check":"string","validation":"string","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"Last four characters of the IBAN.","undocumented":false,"html":"Last four characters of the IBAN."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"object_type":"last4"}},"object_type":"sepa_debit","less_common":true},"sofort":{"name":"sofort","check":"hash","validation":"hash","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"If this is a `sofort` PaymentMethod, this hash contains details about the SOFORT payment method.","undocumented":false,"html":"If this is a \u003Ccode\u003Esofort\u003C/code\u003E PaymentMethod, this hash contains details about the SOFORT payment method."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"subspec":{"country":{"name":"country","check":"string","validation":"string","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"Two-letter ISO code representing the country the bank account is located in.","undocumented":false,"html":"Two-letter ISO code representing the country the bank account is located in."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"object_type":"country"}},"object_type":"sofort","less_common":true},"type":{"name":"type","check":"string","validation":"string","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"The type of the PaymentMethod. An additional hash is included on the PaymentMethod with a name matching this value. It contains additional information specific to the PaymentMethod type.","undocumented":false,"html":"The type of the PaymentMethod. An additional hash is included on the PaymentMethod with a name matching this value. It contains additional information specific to the PaymentMethod type."},"gate":false,"hide_unset_desc":null,"required":true,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"enum_values":{"acss_debit":{"documentation":{"gate_specific":{},"localize_terms":[],"markdown":"[Pre-authorized debit payments](/docs/payments/acss-debit) are used to debit Canadian bank accounts through the Automated Clearing Settlement System (ACSS).","undocumented":false,"html":"\u003Ca href=\"/docs/payments/acss-debit\"\u003EPre-authorized debit payments\u003C/a\u003E are used to debit Canadian bank accounts through the Automated Clearing Settlement System (ACSS)."}},"affirm":{"documentation":{"gate_specific":{},"localize_terms":[],"markdown":"[Affirm](/docs/payments/affirm) is a buy now, pay later payment method in the US.","undocumented":false,"html":"\u003Ca href=\"/docs/payments/affirm\"\u003EAffirm\u003C/a\u003E is a buy now, pay later payment method in the US."}},"afterpay_clearpay":{"documentation":{"gate_specific":{},"localize_terms":[],"markdown":"[Afterpay / Clearpay](/docs/payments/afterpay-clearpay) is a buy now, pay later payment method used in Australia, Canada, France, New Zealand, Spain, the UK, and the US.","undocumented":false,"html":"\u003Ca href=\"/docs/payments/afterpay-clearpay\"\u003EAfterpay / Clearpay\u003C/a\u003E is a buy now, pay later payment method used in Australia, Canada, France, New Zealand, Spain, the UK, and the US."}},"alipay":{"documentation":{"gate_specific":{},"localize_terms":[],"markdown":"[Alipay](/docs/payments/alipay) is a digital wallet payment method used in China.","undocumented":false,"html":"\u003Ca href=\"/docs/payments/alipay\"\u003EAlipay\u003C/a\u003E is a digital wallet payment method used in China."}},"au_becs_debit":{"documentation":{"gate_specific":{},"localize_terms":[],"markdown":"[BECS Direct Debit](/docs/payments/au-becs-debit) is used to debit Australian bank accounts through the Bulk Electronic Clearing System (BECS).","undocumented":false,"html":"\u003Ca href=\"/docs/payments/au-becs-debit\"\u003EBECS Direct Debit\u003C/a\u003E is used to debit Australian bank accounts through the Bulk Electronic Clearing System (BECS)."}},"bacs_debit":{"documentation":{"gate_specific":{},"localize_terms":[],"markdown":"[Bacs Direct Debit](/docs/payments/payment-methods/bacs-debit) is used to debit UK bank accounts.","undocumented":false,"html":"\u003Ca href=\"/docs/payments/payment-methods/bacs-debit\"\u003EBacs Direct Debit\u003C/a\u003E is used to debit UK bank accounts."}},"bancontact":{"documentation":{"gate_specific":{},"localize_terms":[],"markdown":"[Bancontact](/docs/payments/bancontact) is a bank redirect payment method used in Belgium.","undocumented":false,"html":"\u003Ca href=\"/docs/payments/bancontact\"\u003EBancontact\u003C/a\u003E is a bank redirect payment method used in Belgium."}},"blik":{"documentation":{"gate_specific":{},"localize_terms":[],"markdown":"[BLIK](/docs/payments/blik) is a single-use payment method common in Poland.","undocumented":false,"html":"\u003Ca href=\"/docs/payments/blik\"\u003EBLIK\u003C/a\u003E is a single-use payment method common in Poland."}},"boleto":{"documentation":{"gate_specific":{},"localize_terms":[],"markdown":"[Boleto](/docs/payments/boleto) is a voucher-based payment method used in Brazil.","undocumented":false,"html":"\u003Ca href=\"/docs/payments/boleto\"\u003EBoleto\u003C/a\u003E is a voucher-based payment method used in Brazil."}},"card":{"documentation":{"gate_specific":{},"localize_terms":[],"markdown":"[Card payments](/docs/payments/payment-methods/overview#cards) are supported through many networks and card brands.","undocumented":false,"html":"\u003Ca href=\"/docs/payments/payment-methods/overview#cards\"\u003ECard payments\u003C/a\u003E are supported through many networks and card brands."}},"card_present":{"documentation":{"gate_specific":{},"localize_terms":[],"markdown":"[Stripe Terminal](/docs/terminal/payments/collect-payment) is used to collect in-person card payments.","undocumented":false,"html":"\u003Ca href=\"/docs/terminal/payments/collect-payment\"\u003EStripe Terminal\u003C/a\u003E is used to collect in-person card payments."}},"customer_balance":{"documentation":{"gate_specific":{},"localize_terms":[],"markdown":"Uses a customer’s [cash balance](/docs/payments/customer-balance) for the payment.","undocumented":false,"html":"Uses a customer’s \u003Ca href=\"/docs/payments/customer-balance\"\u003Ecash balance\u003C/a\u003E for the payment."}},"eps":{"documentation":{"gate_specific":{},"localize_terms":[],"markdown":"[EPS](/docs/payments/eps) is an Austria-based bank redirect payment method.","undocumented":false,"html":"\u003Ca href=\"/docs/payments/eps\"\u003EEPS\u003C/a\u003E is an Austria-based bank redirect payment method."}},"fpx":{"documentation":{"gate_specific":{},"localize_terms":[],"markdown":"[FPX](/docs/payments/fpx) is a Malaysia-based bank redirect payment method.","undocumented":false,"html":"\u003Ca href=\"/docs/payments/fpx\"\u003EFPX\u003C/a\u003E is a Malaysia-based bank redirect payment method."}},"giropay":{"documentation":{"gate_specific":{},"localize_terms":[],"markdown":"[giropay](/docs/payments/giropay) is a German bank redirect payment method.","undocumented":false,"html":"\u003Ca href=\"/docs/payments/giropay\"\u003Egiropay\u003C/a\u003E is a German bank redirect payment method."}},"grabpay":{"documentation":{"gate_specific":{},"localize_terms":[],"markdown":"[GrabPay](/docs/payments/grabpay) is a digital wallet payment method used in Southeast Asia.","undocumented":false,"html":"\u003Ca href=\"/docs/payments/grabpay\"\u003EGrabPay\u003C/a\u003E is a digital wallet payment method used in Southeast Asia."}},"ideal":{"documentation":{"gate_specific":{},"localize_terms":[],"markdown":"[iDEAL](/docs/payments/ideal) is a Netherlands-based bank redirect payment method.","undocumented":false,"html":"\u003Ca href=\"/docs/payments/ideal\"\u003EiDEAL\u003C/a\u003E is a Netherlands-based bank redirect payment method."}},"interac_present":{"documentation":{"gate_specific":{},"localize_terms":[],"markdown":"[Stripe Terminal](/docs/terminal/payments/collect-payment) accepts [Interac](/docs/terminal/payments/regional?integration-country=CA#interac-payments) debit cards for in-person payments in Canada.","undocumented":false,"html":"\u003Ca href=\"/docs/terminal/payments/collect-payment\"\u003EStripe Terminal\u003C/a\u003E accepts \u003Ca href=\"/docs/terminal/payments/regional?integration-country=CA#interac-payments\"\u003EInterac\u003C/a\u003E debit cards for in-person payments in Canada."}},"klarna":{"documentation":{"gate_specific":{},"localize_terms":[],"markdown":"[Klarna](/docs/payments/klarna) is a global buy now, pay later payment method.","undocumented":false,"html":"\u003Ca href=\"/docs/payments/klarna\"\u003EKlarna\u003C/a\u003E is a global buy now, pay later payment method."}},"konbini":{"documentation":{"gate_specific":{},"localize_terms":[],"markdown":"[Konbini](/docs/payments/konbini) is a cash-based voucher payment method used in Japan.","undocumented":false,"html":"\u003Ca href=\"/docs/payments/konbini\"\u003EKonbini\u003C/a\u003E is a cash-based voucher payment method used in Japan."}},"link":{"documentation":{"gate_specific":{},"localize_terms":[],"markdown":"[Link](/docs/payments/link) allows customers to pay with their saved payment details.","undocumented":false,"html":"\u003Ca href=\"/docs/payments/link\"\u003ELink\u003C/a\u003E allows customers to pay with their saved payment details."}},"oxxo":{"documentation":{"gate_specific":{},"localize_terms":[],"markdown":"[OXXO](/docs/payments/oxxo) is a cash-based voucher payment method used in Mexico.","undocumented":false,"html":"\u003Ca href=\"/docs/payments/oxxo\"\u003EOXXO\u003C/a\u003E is a cash-based voucher payment method used in Mexico."}},"p24":{"documentation":{"gate_specific":{},"localize_terms":[],"markdown":"[Przelewy24](/docs/payments/p24) is a bank redirect payment method used in Poland.","undocumented":false,"html":"\u003Ca href=\"/docs/payments/p24\"\u003EPrzelewy24\u003C/a\u003E is a bank redirect payment method used in Poland."}},"paynow":{"documentation":{"gate_specific":{},"localize_terms":[],"markdown":"[PayNow](/docs/payments/paynow) is a QR code payment method used in Singapore.","undocumented":false,"html":"\u003Ca href=\"/docs/payments/paynow\"\u003EPayNow\u003C/a\u003E is a QR code payment method used in Singapore."}},"pix":{"documentation":{"gate_specific":{},"localize_terms":[],"markdown":"[Pix](/docs/payments/pix) is an instant bank transfer payment method in Brazil.","undocumented":false,"html":"\u003Ca href=\"/docs/payments/pix\"\u003EPix\u003C/a\u003E is an instant bank transfer payment method in Brazil."}},"promptpay":{"documentation":{"gate_specific":{},"localize_terms":[],"markdown":"[PromptPay](/docs/payments/promptpay) is an instant funds transfer service popular in Thailand.","undocumented":false,"html":"\u003Ca href=\"/docs/payments/promptpay\"\u003EPromptPay\u003C/a\u003E is an instant funds transfer service popular in Thailand."}},"sepa_debit":{"documentation":{"gate_specific":{},"localize_terms":[],"markdown":"[SEPA Direct Debit](/docs/payments/sepa-debit) is used to debit bank accounts within the Single Euro Payments Area (SEPA) region.","undocumented":false,"html":"\u003Ca href=\"/docs/payments/sepa-debit\"\u003ESEPA Direct Debit\u003C/a\u003E is used to debit bank accounts within the Single Euro Payments Area (SEPA) region."}},"sofort":{"documentation":{"gate_specific":{},"localize_terms":[],"markdown":"[Sofort](/docs/payments/sofort) is a bank redirect payment method used in Europe.","undocumented":false,"html":"\u003Ca href=\"/docs/payments/sofort\"\u003ESofort\u003C/a\u003E is a bank redirect payment method used in Europe."}},"us_bank_account":{"documentation":{"gate_specific":{},"localize_terms":[],"markdown":"[ACH Direct Debit](/docs/payments/ach-debit) is used to debit US bank accounts through the Automated Clearing House (ACH) payments system.","undocumented":false,"html":"\u003Ca href=\"/docs/payments/ach-debit\"\u003EACH Direct Debit\u003C/a\u003E is used to debit US bank accounts through the Automated Clearing House (ACH) payments system."}},"wechat_pay":{"documentation":{"gate_specific":{},"localize_terms":[],"markdown":"[WeChat Pay](/docs/payments/wechat-pay) is a digital wallet payment method based in China.","undocumented":false,"html":"\u003Ca href=\"/docs/payments/wechat-pay\"\u003EWeChat Pay\u003C/a\u003E is a digital wallet payment method based in China."}}},"object_type":"type"},"us_bank_account":{"name":"us_bank_account","check":"hash","validation":"hash","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"If this is an `us_bank_account` PaymentMethod, this hash contains details about the US bank account payment method.","undocumented":false,"html":"If this is an \u003Ccode\u003Eus_bank_account\u003C/code\u003E PaymentMethod, this hash contains details about the US bank account payment method."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"subspec":{"account_holder_type":{"name":"account_holder_type","check":"string","validation":"string","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"Account holder type: individual or company.","undocumented":false,"html":"Account holder type: individual or company."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"enum_values":{"individual":{"documentation":{"gate_specific":{},"localize_terms":[],"markdown":"Account belongs to an individual","undocumented":false,"html":"Account belongs to an individual"}},"company":{"documentation":{"gate_specific":{},"localize_terms":[],"markdown":"Account belongs to a company","undocumented":false,"html":"Account belongs to a company"}}},"object_type":"account_holder_type"},"account_type":{"name":"account_type","check":"string","validation":"string","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"Account type: checkings or savings. Defaults to checking if omitted.","undocumented":false,"html":"Account type: checkings or savings. Defaults to checking if omitted."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"enum_values":{"checking":{"documentation":{"gate_specific":{},"localize_terms":[],"markdown":"Bank account type is checking","undocumented":false,"html":"Bank account type is checking"}},"savings":{"documentation":{"gate_specific":{},"localize_terms":[],"markdown":"Bank account type is savings","undocumented":false,"html":"Bank account type is savings"}}},"object_type":"account_type"},"bank_name":{"name":"bank_name","check":"string","validation":"string","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"The name of the bank.","undocumented":false,"html":"The name of the bank."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"object_type":"bank_name"},"financial_connections_account":{"name":"financial_connections_account","check":"string","validation":"string","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"The ID of the Financial Connections Account used to create the payment method.","undocumented":false,"html":"The ID of the Financial Connections Account used to create the payment method."},"gate":true,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"object_type":"financial_connections_account"},"fingerprint":{"name":"fingerprint","check":"string","validation":"string","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"Uniquely identifies this particular bank account. You can use this attribute to check whether two bank accounts are the same.","undocumented":false,"html":"Uniquely identifies this particular bank account. You can use this attribute to check whether two bank accounts are the same."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"object_type":"fingerprint"},"last4":{"name":"last4","check":"string","validation":"string","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"Last four digits of the bank account number.","undocumented":false,"html":"Last four digits of the bank account number."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"object_type":"last4"},"networks":{"name":"networks","check":"hash","validation":"hash","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"Contains information about US bank account networks that can be used.","undocumented":false,"html":"Contains information about US bank account networks that can be used."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"subspec":{"preferred":{"name":"preferred","check":"string","validation":"string","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"The preferred network.","undocumented":false,"html":"The preferred network."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"object_type":"preferred"},"supported":{"name":"supported","check":"array","validation":"array","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"All supported networks.","undocumented":false,"html":"All supported networks."},"gate":false,"hide_unset_desc":null,"required":true,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"object_type":"supported"}},"object_type":"networks"},"routing_number":{"name":"routing_number","check":"string","validation":"string","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"Routing number of the bank account.","undocumented":false,"html":"Routing number of the bank account."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"object_type":"routing_number"}},"object_type":"us_bank_account","less_common":true},"wechat_pay":{"name":"wechat_pay","check":"hash","validation":"hash","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"If this is an `wechat_pay` PaymentMethod, this hash contains details about the wechat_pay payment method.","undocumented":false,"html":"If this is an \u003Ccode\u003Ewechat_pay\u003C/code\u003E PaymentMethod, this hash contains details about the wechat_pay payment method."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"subspec":{},"object_type":"wechat_pay","less_common":true}},"object_type":"payment_method","less_common":true},"payment_method_type":{"name":"payment_method_type","check":"string","validation":"string","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"If the error is specific to the type of payment method, the payment method type that had a problem. This field is only populated for invoice-related errors.","undocumented":false,"html":"If the error is specific to the type of payment method, the payment method type that had a problem. This field is only populated for invoice-related errors."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"object_type":"payment_method_type","less_common":true},"request_log_url":{"name":"request_log_url","check":"string","validation":"string","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"A URL to the request log entry in your dashboard.","undocumented":false,"html":"A URL to the request log entry in your dashboard."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"object_type":"request_log_url","less_common":true},"setup_intent":{"name":"setup_intent","check":"hash","validation":"hash","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"The SetupIntent object for errors returned on a request involving a SetupIntent.","undocumented":false,"html":"The SetupIntent object for errors returned on a request involving a SetupIntent."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"object_type":"setup_intent","less_common":true,"subspec":{"id":{"name":"id","check":"string","validation":"string","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"Unique identifier for the object.","undocumented":false,"html":"Unique identifier for the object."},"gate":false,"hide_unset_desc":null,"required":true,"default":null,"badge_text":"retrievable with publishable key","requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"object_type":"id"},"object":{"name":"object","check":"string","validation":"string","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"String representing the object's type. Objects of the same type share the same value.","undocumented":false,"html":"String representing the object’s type. Objects of the same type share the same value."},"gate":false,"hide_unset_desc":null,"required":true,"default":null,"badge_text":"retrievable with publishable key","requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"object_type":"object","less_common":true},"application":{"name":"application","check":"string","validation":"string","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"ID of the Connect application that created the SetupIntent.\n","undocumented":false,"html":"ID of the Connect application that created the SetupIntent."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":"Connect only","requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"user_expandable":["application"],"object_type":"application","less_common":true},"attach_to_self":{"name":"attach_to_self","check":"boolean","validation":"boolean","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"If present, the SetupIntent's payment method will be attached to the in-context Stripe Account.\n\nIt can only be used for this Stripe Account’s own money movement flows like InboundTransfer and OutboundTransfers. It cannot be set to true when setting up a PaymentMethod for a Customer, and defaults to false when attaching a PaymentMethod to a Customer.\n","undocumented":false,"html":"If present, the SetupIntent’s payment method will be attached to the in-context Stripe Account.\u003C/p\u003E\n\n\u003Cp\u003EIt can only be used for this Stripe Account’s own money movement flows like InboundTransfer and OutboundTransfers. It cannot be set to true when setting up a PaymentMethod for a Customer, and defaults to false when attaching a PaymentMethod to a Customer."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"object_type":"attach_to_self","less_common":true},"cancellation_reason":{"name":"cancellation_reason","check":"string","validation":"string","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"Reason for cancellation of this SetupIntent, one of `abandoned`, `requested_by_customer`, or `duplicate`.","undocumented":false,"html":"Reason for cancellation of this SetupIntent, one of \u003Ccode\u003Eabandoned\u003C/code\u003E, \u003Ccode\u003Erequested_by_customer\u003C/code\u003E, or \u003Ccode\u003Eduplicate\u003C/code\u003E."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":"retrievable with publishable key","requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"object_type":"cancellation_reason","less_common":true},"client_secret":{"name":"client_secret","check":"string","validation":"string","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"The client secret of this SetupIntent. Used for client-side retrieval using a publishable key.\n\nThe client secret can be used to complete payment setup from your frontend. It should not be stored, logged, or exposed to anyone other than the customer. Make sure that you have TLS enabled on any page that includes the client secret.","undocumented":false,"html":"The client secret of this SetupIntent. Used for client-side retrieval using a publishable key.\u003C/p\u003E\n\n\u003Cp\u003EThe client secret can be used to complete payment setup from your frontend. It should not be stored, logged, or exposed to anyone other than the customer. Make sure that you have TLS enabled on any page that includes the client secret."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":"retrievable with publishable key","requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"object_type":"client_secret"},"created":{"name":"created","check":"timestamp","validation":"timestamp","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"Time at which the object was created. Measured in seconds since the Unix epoch.","undocumented":false,"html":"Time at which the object was created. Measured in seconds since the Unix epoch."},"gate":false,"hide_unset_desc":null,"required":true,"default":null,"badge_text":"retrievable with publishable key","requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"object_type":"created","less_common":true},"customer":{"name":"customer","check":"string","validation":"string","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"ID of the Customer this SetupIntent belongs to, if one exists.\n\nIf present, the SetupIntent's payment method will be attached to the Customer on successful setup. Payment methods attached to other Customers cannot be used with this SetupIntent.\n","undocumented":false,"html":"ID of the Customer this SetupIntent belongs to, if one exists.\u003C/p\u003E\n\n\u003Cp\u003EIf present, the SetupIntent’s payment method will be attached to the Customer on successful setup. Payment methods attached to other Customers cannot be used with this SetupIntent."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"user_expandable":["customer"],"object_type":"customer"},"description":{"name":"description","check":"string","validation":"string","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"An arbitrary string attached to the object. Often useful for displaying to users.","undocumented":false,"html":"An arbitrary string attached to the object. Often useful for displaying to users."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":"retrievable with publishable key","requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"object_type":"description"},"flow_directions":{"name":"flow_directions","check":"array","validation":"array","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"Indicates the directions of money movement for which this payment method is intended to be used.\n\nInclude `inbound` if you intend to use the payment method as the origin to pull funds from. Include `outbound` if you intend to use the payment method as the destination to send funds to. You can include both if you intend to use the payment method for both purposes.\n","undocumented":false,"html":"Indicates the directions of money movement for which this payment method is intended to be used.\u003C/p\u003E\n\n\u003Cp\u003EInclude \u003Ccode\u003Einbound\u003C/code\u003E if you intend to use the payment method as the origin to pull funds from. Include \u003Ccode\u003Eoutbound\u003C/code\u003E if you intend to use the payment method as the destination to send funds to. You can include both if you intend to use the payment method for both purposes."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"object_type":"flow_directions","less_common":true},"last_setup_error":{"name":"last_setup_error","check":"hash","validation":"hash","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"The error encountered in the previous SetupIntent confirmation.","undocumented":false,"html":"The error encountered in the previous SetupIntent confirmation."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":"retrievable with publishable key","requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"subspec":{"type":{"name":"type","check":"string","validation":"string","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"The type of error returned. One of `api_error`, `card_error`, `idempotency_error`, or `invalid_request_error`","undocumented":false,"html":"The type of error returned. One of \u003Ccode\u003Eapi_error\u003C/code\u003E, \u003Ccode\u003Ecard_error\u003C/code\u003E, \u003Ccode\u003Eidempotency_error\u003C/code\u003E, or \u003Ccode\u003Einvalid_request_error\u003C/code\u003E"},"gate":false,"hide_unset_desc":null,"required":true,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"object_type":"type"},"code":{"name":"code","check":"string","validation":"string","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"For some errors that could be handled programmatically, a short string indicating the [error code](/docs/error-codes) reported.","undocumented":false,"html":"For some errors that could be handled programmatically, a short string indicating the \u003Ca href=\"/docs/error-codes\"\u003Eerror code\u003C/a\u003E reported."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"object_type":"code"},"decline_code":{"name":"decline_code","check":"string","validation":"string","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"For card errors resulting from a card issuer decline, a short string indicating the [card issuer's reason for the decline](/docs/declines#issuer-declines) if they provide one.","undocumented":false,"html":"For card errors resulting from a card issuer decline, a short string indicating the \u003Ca href=\"/docs/declines#issuer-declines\"\u003Ecard issuer’s reason for the decline\u003C/a\u003E if they provide one."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"object_type":"decline_code"},"doc_url":{"name":"doc_url","check":"string","validation":"string","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"A URL to more information about the [error code](/docs/error-codes) reported.","undocumented":false,"html":"A URL to more information about the \u003Ca href=\"/docs/error-codes\"\u003Eerror code\u003C/a\u003E reported."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"object_type":"doc_url","less_common":true},"message":{"name":"message","check":"string","validation":"string","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"A human-readable message providing more details about the error. For card errors, these messages can be shown to your users.","undocumented":false,"html":"A human-readable message providing more details about the error. For card errors, these messages can be shown to your users."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"object_type":"message"},"param":{"name":"param","check":"string","validation":"string","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"If the error is parameter-specific, the parameter related to the error. For example, you can use this to display a message near the correct form field.","undocumented":false,"html":"If the error is parameter-specific, the parameter related to the error. For example, you can use this to display a message near the correct form field."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"object_type":"param"},"payment_method":{"name":"payment_method","check":"hash","validation":"hash","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"The PaymentMethod object for errors returned on a request involving a PaymentMethod.","undocumented":false,"html":"The PaymentMethod object for errors returned on a request involving a PaymentMethod."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"subspec":{"id":{"name":"id","check":"string","validation":"string","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"Unique identifier for the object.","undocumented":false,"html":"Unique identifier for the object."},"gate":false,"hide_unset_desc":null,"required":true,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"object_type":"id"},"object":{"name":"object","check":"string","validation":"string","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"String representing the object's type. Objects of the same type share the same value.","undocumented":false,"html":"String representing the object’s type. Objects of the same type share the same value."},"gate":false,"hide_unset_desc":null,"required":true,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"object_type":"object","less_common":true},"acss_debit":{"name":"acss_debit","check":"hash","validation":"hash","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"If this is an `acss_debit` PaymentMethod, this hash contains details about the ACSS Debit payment method.","undocumented":false,"html":"If this is an \u003Ccode\u003Eacss_debit\u003C/code\u003E PaymentMethod, this hash contains details about the ACSS Debit payment method."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"subspec":{"bank_name":{"name":"bank_name","check":"string","validation":"string","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"Name of the bank associated with the bank account.","undocumented":false,"html":"Name of the bank associated with the bank account."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"object_type":"bank_name"},"fingerprint":{"name":"fingerprint","check":"string","validation":"string","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"Uniquely identifies this particular bank account. You can use this attribute to check whether two bank accounts are the same.","undocumented":false,"html":"Uniquely identifies this particular bank account. You can use this attribute to check whether two bank accounts are the same."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"object_type":"fingerprint"},"institution_number":{"name":"institution_number","check":"string","validation":"string","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"Institution number of the bank account.","undocumented":false,"html":"Institution number of the bank account."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"object_type":"institution_number"},"last4":{"name":"last4","check":"string","validation":"string","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"Last four digits of the bank account number.","undocumented":false,"html":"Last four digits of the bank account number."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"object_type":"last4"},"transit_number":{"name":"transit_number","check":"string","validation":"string","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"Transit number of the bank account.","undocumented":false,"html":"Transit number of the bank account."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"object_type":"transit_number"}},"object_type":"acss_debit","less_common":true},"affirm":{"name":"affirm","check":"hash","validation":"hash","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"If this is an `affirm` PaymentMethod, this hash contains details about the Affirm payment method.","undocumented":false,"html":"If this is an \u003Ccode\u003Eaffirm\u003C/code\u003E PaymentMethod, this hash contains details about the Affirm payment method."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"subspec":{},"object_type":"affirm","less_common":true},"afterpay_clearpay":{"name":"afterpay_clearpay","check":"hash","validation":"hash","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"If this is an `AfterpayClearpay` PaymentMethod, this hash contains details about the AfterpayClearpay payment method.","undocumented":false,"html":"If this is an \u003Ccode\u003EAfterpayClearpay\u003C/code\u003E PaymentMethod, this hash contains details about the AfterpayClearpay payment method."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"subspec":{},"object_type":"afterpay_clearpay","less_common":true},"alipay":{"name":"alipay","check":"hash","validation":"hash","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"If this is an `Alipay` PaymentMethod, this hash contains details about the Alipay payment method.","undocumented":false,"html":"If this is an \u003Ccode\u003EAlipay\u003C/code\u003E PaymentMethod, this hash contains details about the Alipay payment method."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"subspec":{},"object_type":"alipay","less_common":true},"au_becs_debit":{"name":"au_becs_debit","check":"hash","validation":"hash","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"If this is an `au_becs_debit` PaymentMethod, this hash contains details about the bank account.","undocumented":false,"html":"If this is an \u003Ccode\u003Eau_becs_debit\u003C/code\u003E PaymentMethod, this hash contains details about the bank account."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"subspec":{"bsb_number":{"name":"bsb_number","check":"string","validation":"string","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"Six-digit number identifying bank and branch associated with this bank account.","undocumented":false,"html":"Six-digit number identifying bank and branch associated with this bank account."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"object_type":"bsb_number"},"fingerprint":{"name":"fingerprint","check":"string","validation":"string","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"Uniquely identifies this particular bank account. You can use this attribute to check whether two bank accounts are the same.","undocumented":false,"html":"Uniquely identifies this particular bank account. You can use this attribute to check whether two bank accounts are the same."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"object_type":"fingerprint"},"last4":{"name":"last4","check":"string","validation":"string","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"Last four digits of the bank account number.","undocumented":false,"html":"Last four digits of the bank account number."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"object_type":"last4"}},"object_type":"au_becs_debit","less_common":true},"bacs_debit":{"name":"bacs_debit","check":"hash","validation":"hash","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"If this is a `bacs_debit` PaymentMethod, this hash contains details about the Bacs Direct Debit bank account.","undocumented":false,"html":"If this is a \u003Ccode\u003Ebacs_debit\u003C/code\u003E PaymentMethod, this hash contains details about the Bacs Direct Debit bank account."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"subspec":{"fingerprint":{"name":"fingerprint","check":"string","validation":"string","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"Uniquely identifies this particular bank account. You can use this attribute to check whether two bank accounts are the same.","undocumented":false,"html":"Uniquely identifies this particular bank account. You can use this attribute to check whether two bank accounts are the same."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"object_type":"fingerprint"},"last4":{"name":"last4","check":"string","validation":"string","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"Last four digits of the bank account number.","undocumented":false,"html":"Last four digits of the bank account number."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"object_type":"last4"},"sort_code":{"name":"sort_code","check":"string","validation":"string","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"Sort code of the bank account. (e.g., `10-20-30`)","undocumented":false,"html":"Sort code of the bank account. (e.g., \u003Ccode\u003E10-20-30\u003C/code\u003E)"},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"object_type":"sort_code"}},"object_type":"bacs_debit","less_common":true},"bancontact":{"name":"bancontact","check":"hash","validation":"hash","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"If this is a `bancontact` PaymentMethod, this hash contains details about the Bancontact payment method.","undocumented":false,"html":"If this is a \u003Ccode\u003Ebancontact\u003C/code\u003E PaymentMethod, this hash contains details about the Bancontact payment method."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"subspec":{},"object_type":"bancontact","less_common":true},"billing_details":{"name":"billing_details","check":"hash","validation":"hash","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"Billing information associated with the PaymentMethod that may be used or required by particular types of payment methods.","undocumented":false,"html":"Billing information associated with the PaymentMethod that may be used or required by particular types of payment methods."},"gate":false,"hide_unset_desc":null,"required":true,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"subspec":{"address":{"name":"address","check":"hash","validation":"hash","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"Billing address.","undocumented":false,"html":"Billing address."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"subspec":{"city":{"name":"city","check":"string","validation":"string","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"City, district, suburb, town, or village.","undocumented":false,"html":"City, district, suburb, town, or village."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"object_type":"city"},"country":{"name":"country","check":"string","validation":"string","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)).","undocumented":false,"html":"Two-letter country code (\u003Ca href=\"https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2\"\u003EISO 3166-1 alpha-2\u003C/a\u003E)."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"object_type":"country"},"line1":{"name":"line1","check":"string","validation":"string","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"Address line 1 (e.g., street, PO Box, or company name).","undocumented":false,"html":"Address line 1 (e.g., street, PO Box, or company name)."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"object_type":"line1"},"line2":{"name":"line2","check":"string","validation":"string","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"Address line 2 (e.g., apartment, suite, unit, or building).","undocumented":false,"html":"Address line 2 (e.g., apartment, suite, unit, or building)."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"object_type":"line2"},"postal_code":{"name":"postal_code","check":"string","validation":"string","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"ZIP or postal code.","undocumented":false,"html":"ZIP or postal code."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"object_type":"postal_code"},"state":{"name":"state","check":"string","validation":"string","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"State, county, province, or region.","undocumented":false,"html":"State, county, province, or region."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"object_type":"state"}},"object_type":"address"},"email":{"name":"email","check":"string","validation":"string","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"Email address.","undocumented":false,"html":"Email address."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"object_type":"email"},"name":{"name":"name","check":"string","validation":"string","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"Full name.","undocumented":false,"html":"Full name."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"object_type":"name"},"phone":{"name":"phone","check":"string","validation":"string","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"Billing phone number (including extension).","undocumented":false,"html":"Billing phone number (including extension)."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"object_type":"phone"}},"object_type":"billing_details"},"blik":{"name":"blik","check":"hash","validation":"hash","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"If this is a `blik` PaymentMethod, this hash contains details about the BLIK payment method.","undocumented":false,"html":"If this is a \u003Ccode\u003Eblik\u003C/code\u003E PaymentMethod, this hash contains details about the BLIK payment method."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"subspec":{},"object_type":"blik","less_common":true},"boleto":{"name":"boleto","check":"hash","validation":"hash","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"If this is a `boleto` PaymentMethod, this hash contains details about the Boleto payment method.","undocumented":false,"html":"If this is a \u003Ccode\u003Eboleto\u003C/code\u003E PaymentMethod, this hash contains details about the Boleto payment method."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"subspec":{"fingerprint":{"name":"fingerprint","check":"string","validation":"string","documentation":null,"gate":true,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"object_type":"fingerprint"},"tax_id":{"name":"tax_id","check":"string","validation":"string","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"Uniquely identifies the customer tax id (CNPJ or CPF)","undocumented":false,"html":"Uniquely identifies the customer tax id (CNPJ or CPF)"},"gate":false,"hide_unset_desc":null,"required":true,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"object_type":"tax_id"}},"object_type":"boleto","less_common":true},"card":{"name":"card","check":"hash","validation":"hash","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"If this is a `card` PaymentMethod, this hash contains the user's card details.","undocumented":false,"html":"If this is a \u003Ccode\u003Ecard\u003C/code\u003E PaymentMethod, this hash contains the user’s card details."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"subspec":{"brand":{"name":"brand","check":"string","validation":"string","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"Card brand. Can be `amex`, `diners`, `discover`, `jcb`, `mastercard`, `unionpay`, `visa`, or `unknown`.","undocumented":false,"html":"Card brand. Can be \u003Ccode\u003Eamex\u003C/code\u003E, \u003Ccode\u003Ediners\u003C/code\u003E, \u003Ccode\u003Ediscover\u003C/code\u003E, \u003Ccode\u003Ejcb\u003C/code\u003E, \u003Ccode\u003Emastercard\u003C/code\u003E, \u003Ccode\u003Eunionpay\u003C/code\u003E, \u003Ccode\u003Evisa\u003C/code\u003E, or \u003Ccode\u003Eunknown\u003C/code\u003E."},"gate":false,"hide_unset_desc":null,"required":true,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"object_type":"brand"},"checks":{"name":"checks","check":"hash","validation":"hash","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"Checks on Card address and CVC if provided.","undocumented":false,"html":"Checks on Card address and CVC if provided."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"subspec":{"address_line1_check":{"name":"address_line1_check","check":"string","validation":"string","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"If a address line1 was provided, results of the check, one of `pass`, `fail`, `unavailable`, or `unchecked`.","undocumented":false,"html":"If a address line1 was provided, results of the check, one of \u003Ccode\u003Epass\u003C/code\u003E, \u003Ccode\u003Efail\u003C/code\u003E, \u003Ccode\u003Eunavailable\u003C/code\u003E, or \u003Ccode\u003Eunchecked\u003C/code\u003E."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"object_type":"address_line1_check"},"address_postal_code_check":{"name":"address_postal_code_check","check":"string","validation":"string","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"If a address postal code was provided, results of the check, one of `pass`, `fail`, `unavailable`, or `unchecked`.","undocumented":false,"html":"If a address postal code was provided, results of the check, one of \u003Ccode\u003Epass\u003C/code\u003E, \u003Ccode\u003Efail\u003C/code\u003E, \u003Ccode\u003Eunavailable\u003C/code\u003E, or \u003Ccode\u003Eunchecked\u003C/code\u003E."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"object_type":"address_postal_code_check"},"cvc_check":{"name":"cvc_check","check":"string","validation":"string","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"If a CVC was provided, results of the check, one of `pass`, `fail`, `unavailable`, or `unchecked`.","undocumented":false,"html":"If a CVC was provided, results of the check, one of \u003Ccode\u003Epass\u003C/code\u003E, \u003Ccode\u003Efail\u003C/code\u003E, \u003Ccode\u003Eunavailable\u003C/code\u003E, or \u003Ccode\u003Eunchecked\u003C/code\u003E."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"object_type":"cvc_check"}},"object_type":"checks"},"country":{"name":"country","check":"string","validation":"string","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"Two-letter ISO code representing the country of the card. You could use this attribute to get a sense of the international breakdown of cards you've collected.","undocumented":false,"html":"Two-letter ISO code representing the country of the card. You could use this attribute to get a sense of the international breakdown of cards you’ve collected."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"object_type":"country"},"exp_month":{"name":"exp_month","check":"integer","validation":"integer","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"Two-digit number representing the card's expiration month.","undocumented":false,"html":"Two-digit number representing the card’s expiration month."},"gate":false,"hide_unset_desc":null,"required":true,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"object_type":"exp_month"},"exp_year":{"name":"exp_year","check":"integer","validation":"integer","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"Four-digit number representing the card's expiration year.","undocumented":false,"html":"Four-digit number representing the card’s expiration year."},"gate":false,"hide_unset_desc":null,"required":true,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"object_type":"exp_year"},"fingerprint":{"name":"fingerprint","check":"string","validation":"string","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"Uniquely identifies this particular card number. You can use this attribute to check whether two customers who’ve signed up with you are using the same card number, for example. For payment methods that tokenize card information (Apple Pay, Google Pay), the tokenized number might be provided instead of the underlying card number.\n\n*Starting May 1, 2021, card fingerprint in India for Connect will change to allow two fingerprints for the same card --- one for India and one for the rest of the world.*\n","undocumented":false,"html":"Uniquely identifies this particular card number. You can use this attribute to check whether two customers who’ve signed up with you are using the same card number, for example. For payment methods that tokenize card information (Apple Pay, Google Pay), the tokenized number might be provided instead of the underlying card number.\u003C/p\u003E\n\n\u003Cp\u003E\u003Cem\u003EStarting May 1, 2021, card fingerprint in India for Connect will change to allow two fingerprints for the same card — one for India and one for the rest of the world.\u003C/em\u003E"},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":"card_fingerprint_read","hide_nil":null,"is_country_specific":false,"includable":null,"object_type":"fingerprint"},"funding":{"name":"funding","check":"string","validation":"string","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"Card funding type. Can be `credit`, `debit`, `prepaid`, or `unknown`.","undocumented":false,"html":"Card funding type. Can be \u003Ccode\u003Ecredit\u003C/code\u003E, \u003Ccode\u003Edebit\u003C/code\u003E, \u003Ccode\u003Eprepaid\u003C/code\u003E, or \u003Ccode\u003Eunknown\u003C/code\u003E."},"gate":false,"hide_unset_desc":null,"required":true,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"object_type":"funding"},"generated_from":{"name":"generated_from","check":"hash","validation":"hash","documentation":{"gate_specific":{"sdk_client_public":{"gate_specific":{},"localize_terms":[],"undocumented":true,"html":null}},"localize_terms":[],"markdown":"Details of the original PaymentMethod that created this object.","undocumented":false,"html":"Details of the original PaymentMethod that created this object."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"subspec":{"charge":{"name":"charge","check":"string","validation":"string","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"The charge that created this object.","undocumented":false,"html":"The charge that created this object."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"object_type":"charge"},"payment_method_details":{"name":"payment_method_details","check":"hash","validation":"hash","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"Transaction-specific details of the payment method used in the payment.","undocumented":false,"html":"Transaction-specific details of the payment method used in the payment."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"subspec":{"card_present":{"name":"card_present","check":"hash","validation":"hash","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"This hash contains the snapshot of the `card_present` transaction-specific details which generated this `card` payment method.","undocumented":false,"html":"This hash contains the snapshot of the \u003Ccode\u003Ecard_present\u003C/code\u003E transaction-specific details which generated this \u003Ccode\u003Ecard\u003C/code\u003E payment method."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"subspec":{"amount_authorized":{"name":"amount_authorized","check":"integer","validation":"integer","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"The authorized amount","undocumented":false,"html":"The authorized amount"},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"object_type":"amount_authorized"},"brand":{"name":"brand","check":"string","validation":"string","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"Card brand. Can be `amex`, `diners`, `discover`, `jcb`, `mastercard`, `unionpay`, `visa`, or `unknown`.","undocumented":false,"html":"Card brand. Can be \u003Ccode\u003Eamex\u003C/code\u003E, \u003Ccode\u003Ediners\u003C/code\u003E, \u003Ccode\u003Ediscover\u003C/code\u003E, \u003Ccode\u003Ejcb\u003C/code\u003E, \u003Ccode\u003Emastercard\u003C/code\u003E, \u003Ccode\u003Eunionpay\u003C/code\u003E, \u003Ccode\u003Evisa\u003C/code\u003E, or \u003Ccode\u003Eunknown\u003C/code\u003E."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"object_type":"brand"},"capture_before":{"name":"capture_before","check":"timestamp","validation":"timestamp","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"When using manual capture, a future timestamp after which the charge will be automatically refunded if uncaptured.","undocumented":false,"html":"When using manual capture, a future timestamp after which the charge will be automatically refunded if uncaptured."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"object_type":"capture_before"},"cardholder_name":{"name":"cardholder_name","check":"string","validation":"string","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"The cardholder name as read from the card, in [ISO 7813](https://en.wikipedia.org/wiki/ISO/IEC_7813) format. May include alphanumeric characters, special characters and first/last name separator (`/`). In some cases, the cardholder name may not be available depending on how the issuer has configured the card. Cardholder name is typically not available on swipe or contactless payments, such as those made with Apple Pay and Google Pay.","undocumented":false,"html":"The cardholder name as read from the card, in \u003Ca href=\"https://en.wikipedia.org/wiki/ISO/IEC_7813\"\u003EISO 7813\u003C/a\u003E format. May include alphanumeric characters, special characters and first/last name separator (\u003Ccode\u003E/\u003C/code\u003E). In some cases, the cardholder name may not be available depending on how the issuer has configured the card. Cardholder name is typically not available on swipe or contactless payments, such as those made with Apple Pay and Google Pay."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"object_type":"cardholder_name"},"country":{"name":"country","check":"string","validation":"string","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"Two-letter ISO code representing the country of the card. You could use this attribute to get a sense of the international breakdown of cards you've collected.","undocumented":false,"html":"Two-letter ISO code representing the country of the card. You could use this attribute to get a sense of the international breakdown of cards you’ve collected."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"object_type":"country"},"emv_auth_data":{"name":"emv_auth_data","check":"string","validation":"string","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"Authorization response cryptogram.","undocumented":false,"html":"Authorization response cryptogram."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"object_type":"emv_auth_data"},"exp_month":{"name":"exp_month","check":"integer","validation":"integer","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"Two-digit number representing the card's expiration month.","undocumented":false,"html":"Two-digit number representing the card’s expiration month."},"gate":false,"hide_unset_desc":null,"required":true,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"object_type":"exp_month"},"exp_year":{"name":"exp_year","check":"integer","validation":"integer","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"Four-digit number representing the card's expiration year.","undocumented":false,"html":"Four-digit number representing the card’s expiration year."},"gate":false,"hide_unset_desc":null,"required":true,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"object_type":"exp_year"},"fingerprint":{"name":"fingerprint","check":"string","validation":"string","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"Uniquely identifies this particular card number. You can use this attribute to check whether two customers who’ve signed up with you are using the same card number, for example. For payment methods that tokenize card information (Apple Pay, Google Pay), the tokenized number might be provided instead of the underlying card number.\n\n*Starting May 1, 2021, card fingerprint in India for Connect will change to allow two fingerprints for the same card --- one for India and one for the rest of the world.*\n","undocumented":false,"html":"Uniquely identifies this particular card number. You can use this attribute to check whether two customers who’ve signed up with you are using the same card number, for example. For payment methods that tokenize card information (Apple Pay, Google Pay), the tokenized number might be provided instead of the underlying card number.\u003C/p\u003E\n\n\u003Cp\u003E\u003Cem\u003EStarting May 1, 2021, card fingerprint in India for Connect will change to allow two fingerprints for the same card — one for India and one for the rest of the world.\u003C/em\u003E"},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"object_type":"fingerprint"},"funding":{"name":"funding","check":"string","validation":"string","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"Card funding type. Can be `credit`, `debit`, `prepaid`, or `unknown`.","undocumented":false,"html":"Card funding type. Can be \u003Ccode\u003Ecredit\u003C/code\u003E, \u003Ccode\u003Edebit\u003C/code\u003E, \u003Ccode\u003Eprepaid\u003C/code\u003E, or \u003Ccode\u003Eunknown\u003C/code\u003E."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"object_type":"funding"},"generated_card":{"name":"generated_card","check":"string","validation":"string","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"ID of a card PaymentMethod generated from the card_present PaymentMethod that may be attached to a Customer for future transactions. Only present if it was possible to generate a card PaymentMethod.","undocumented":false,"html":"ID of a card PaymentMethod generated from the card_present PaymentMethod that may be attached to a Customer for future transactions. Only present if it was possible to generate a card PaymentMethod."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"object_type":"generated_card"},"incremental_authorization_supported":{"name":"incremental_authorization_supported","check":"boolean","validation":"boolean","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"Whether this [PaymentIntent](/docs/api/payment_intents) is eligible for incremental authorizations. Request support using [request_incremental_authorization_support](/docs/api/payment_intents/create#create_payment_intent-payment_method_options-card_present-request_incremental_authorization_support).","undocumented":false,"html":"Whether this \u003Ca href=\"/docs/api/payment_intents\"\u003EPaymentIntent\u003C/a\u003E is eligible for incremental authorizations. Request support using \u003Ca href=\"/docs/api/payment_intents/create#create_payment_intent-payment_method_options-card_present-request_incremental_authorization_support\"\u003Erequest_incremental_authorization_support\u003C/a\u003E."},"gate":false,"hide_unset_desc":null,"required":true,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"object_type":"incremental_authorization_supported"},"last4":{"name":"last4","check":"string","validation":"string","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"The last four digits of the card.","undocumented":false,"html":"The last four digits of the card."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"object_type":"last4"},"network":{"name":"network","check":"string","validation":"string","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"Identifies which network this charge was processed on. Can be `amex`, `cartes_bancaires`, `diners`, `discover`, `interac`, `jcb`, `mastercard`, `unionpay`, `visa`, or `unknown`.","undocumented":false,"html":"Identifies which network this charge was processed on. Can be \u003Ccode\u003Eamex\u003C/code\u003E, \u003Ccode\u003Ecartes_bancaires\u003C/code\u003E, \u003Ccode\u003Ediners\u003C/code\u003E, \u003Ccode\u003Ediscover\u003C/code\u003E, \u003Ccode\u003Einterac\u003C/code\u003E, \u003Ccode\u003Ejcb\u003C/code\u003E, \u003Ccode\u003Emastercard\u003C/code\u003E, \u003Ccode\u003Eunionpay\u003C/code\u003E, \u003Ccode\u003Evisa\u003C/code\u003E, or \u003Ccode\u003Eunknown\u003C/code\u003E."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"object_type":"network"},"overcapture_supported":{"name":"overcapture_supported","check":"boolean","validation":"boolean","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"Defines whether the authorized amount can be over-captured or not","undocumented":false,"html":"Defines whether the authorized amount can be over-captured or not"},"gate":false,"hide_unset_desc":null,"required":true,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"object_type":"overcapture_supported"},"read_method":{"name":"read_method","check":"string","validation":"string","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"How card details were read in this transaction.","undocumented":false,"html":"How card details were read in this transaction."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"enum_values":{"contact_emv":{"documentation":{"gate_specific":{},"localize_terms":[],"markdown":"Inserting a chip card into the card reader.","undocumented":false,"html":"Inserting a chip card into the card reader."}},"contactless_emv":{"documentation":{"gate_specific":{},"localize_terms":[],"markdown":"Tapping a contactless-enabled chip card or mobile wallet.","undocumented":false,"html":"Tapping a contactless-enabled chip card or mobile wallet."}},"magnetic_stripe_track2":{"documentation":{"gate_specific":{},"localize_terms":[],"markdown":"Swiping a card using the magnetic stripe reader.","undocumented":false,"html":"Swiping a card using the magnetic stripe reader."}},"magnetic_stripe_fallback":{"documentation":{"gate_specific":{},"localize_terms":[],"markdown":"When inserting a chip card fails three times in a row, fallback to a magnetic stripe read.","undocumented":false,"html":"When inserting a chip card fails three times in a row, fallback to a magnetic stripe read."}},"contactless_magstripe_mode":{"documentation":{"gate_specific":{},"localize_terms":[],"markdown":"Older standard for contactless payments that emulated a magnetic stripe read.","undocumented":false,"html":"Older standard for contactless payments that emulated a magnetic stripe read."}}},"object_type":"read_method"},"receipt":{"name":"receipt","check":"hash","validation":"hash","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"A collection of fields required to be displayed on receipts. Only required for EMV transactions.","undocumented":false,"html":"A collection of fields required to be displayed on receipts. Only required for EMV transactions."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"subspec":{"account_type":{"name":"account_type","check":"string","validation":"string","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"The type of account being debited or credited","undocumented":false,"html":"The type of account being debited or credited"},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"enum_values":{"credit":{"documentation":{"gate_specific":{},"localize_terms":[],"markdown":"A credit account, as when using a credit card","undocumented":false,"html":"A credit account, as when using a credit card"}},"checking":{"documentation":{"gate_specific":{},"localize_terms":[],"markdown":"A checking account, as when using a debit card","undocumented":false,"html":"A checking account, as when using a debit card"}},"prepaid":{"documentation":{"gate_specific":{},"localize_terms":[],"markdown":"A prepaid account, as when using a debit gift card","undocumented":false,"html":"A prepaid account, as when using a debit gift card"}},"unknown":{"documentation":{"gate_specific":{},"localize_terms":[],"markdown":"An unknown account","undocumented":false,"html":"An unknown account"}}},"object_type":"account_type"},"application_cryptogram":{"name":"application_cryptogram","check":"string","validation":"string","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"EMV tag 9F26, cryptogram generated by the integrated circuit chip.","undocumented":false,"html":"EMV tag 9F26, cryptogram generated by the integrated circuit chip."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"object_type":"application_cryptogram"},"application_preferred_name":{"name":"application_preferred_name","check":"string","validation":"string","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"Mnenomic of the Application Identifier.","undocumented":false,"html":"Mnenomic of the Application Identifier."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"object_type":"application_preferred_name"},"authorization_code":{"name":"authorization_code","check":"string","validation":"string","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"Identifier for this transaction.","undocumented":false,"html":"Identifier for this transaction."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"object_type":"authorization_code"},"authorization_response_code":{"name":"authorization_response_code","check":"string","validation":"string","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"EMV tag 8A. A code returned by the card issuer.","undocumented":false,"html":"EMV tag 8A. A code returned by the card issuer."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"object_type":"authorization_response_code"},"cardholder_verification_method":{"name":"cardholder_verification_method","check":"string","validation":"string","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"How the cardholder verified ownership of the card.","undocumented":false,"html":"How the cardholder verified ownership of the card."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"object_type":"cardholder_verification_method"},"dedicated_file_name":{"name":"dedicated_file_name","check":"string","validation":"string","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"EMV tag 84. Similar to the application identifier stored on the integrated circuit chip.","undocumented":false,"html":"EMV tag 84. Similar to the application identifier stored on the integrated circuit chip."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"object_type":"dedicated_file_name"},"terminal_verification_results":{"name":"terminal_verification_results","check":"string","validation":"string","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"The outcome of a series of EMV functions performed by the card reader.","undocumented":false,"html":"The outcome of a series of EMV functions performed by the card reader."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"object_type":"terminal_verification_results"},"transaction_status_information":{"name":"transaction_status_information","check":"string","validation":"string","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"An indication of various EMV functions performed during the transaction.","undocumented":false,"html":"An indication of various EMV functions performed during the transaction."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"object_type":"transaction_status_information"}},"object_type":"receipt"}},"object_type":"card_present"},"type":{"name":"type","check":"string","validation":"string","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"The type of payment method transaction-specific details from the transaction that generated this `card` payment method. Always `card_present`.","undocumented":false,"html":"The type of payment method transaction-specific details from the transaction that generated this \u003Ccode\u003Ecard\u003C/code\u003E payment method. Always \u003Ccode\u003Ecard_present\u003C/code\u003E."},"gate":false,"hide_unset_desc":null,"required":true,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"object_type":"type"}},"object_type":"payment_method_details"},"setup_attempt":{"name":"setup_attempt","check":"string","validation":"string","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"The ID of the SetupAttempt that generated this PaymentMethod, if any.","undocumented":false,"html":"The ID of the SetupAttempt that generated this PaymentMethod, if any."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"user_expandable":["setup_attempt"],"object_type":"setup_attempt"}},"object_type":"generated_from"},"last4":{"name":"last4","check":"string","validation":"string","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"The last four digits of the card.","undocumented":false,"html":"The last four digits of the card."},"gate":false,"hide_unset_desc":null,"required":true,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"object_type":"last4"},"networks":{"name":"networks","check":"hash","validation":"hash","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"Contains information about card networks that can be used to process the payment.","undocumented":false,"html":"Contains information about card networks that can be used to process the payment."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"subspec":{"available":{"name":"available","check":"string_array","validation":"array containing strings","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"All available networks for the card.","undocumented":false,"html":"All available networks for the card."},"gate":false,"hide_unset_desc":null,"required":true,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"object_type":"available"},"preferred":{"name":"preferred","check":"string","validation":"string","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"The preferred network for the card.","undocumented":false,"html":"The preferred network for the card."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"object_type":"preferred"}},"object_type":"networks"},"three_d_secure_usage":{"name":"three_d_secure_usage","check":"hash","validation":"hash","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"Contains details on how this Card may be used for 3D Secure authentication.","undocumented":false,"html":"Contains details on how this Card may be used for 3D Secure authentication."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"subspec":{"supported":{"name":"supported","check":"boolean","validation":"boolean","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"Whether 3D Secure is supported on this card.","undocumented":false,"html":"Whether 3D Secure is supported on this card."},"gate":false,"hide_unset_desc":null,"required":true,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"object_type":"supported"}},"object_type":"three_d_secure_usage"},"wallet":{"name":"wallet","check":"hash","validation":"hash","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"If this Card is part of a card wallet, this contains the details of the card wallet.","undocumented":false,"html":"If this Card is part of a card wallet, this contains the details of the card wallet."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"subspec":{"amex_express_checkout":{"name":"amex_express_checkout","check":"hash","validation":"hash","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"If this is a `amex_express_checkout` card wallet, this hash contains details about the wallet.","undocumented":false,"html":"If this is a \u003Ccode\u003Eamex_express_checkout\u003C/code\u003E card wallet, this hash contains details about the wallet."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"subspec":{},"object_type":"amex_express_checkout"},"apple_pay":{"name":"apple_pay","check":"hash","validation":"hash","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"If this is a `apple_pay` card wallet, this hash contains details about the wallet.","undocumented":false,"html":"If this is a \u003Ccode\u003Eapple_pay\u003C/code\u003E card wallet, this hash contains details about the wallet."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"subspec":{},"object_type":"apple_pay"},"dynamic_last4":{"name":"dynamic_last4","check":"string","validation":"string","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"(For tokenized numbers only.) The last four digits of the device account number.","undocumented":false,"html":"(For tokenized numbers only.) The last four digits of the device account number."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"object_type":"dynamic_last4"},"google_pay":{"name":"google_pay","check":"hash","validation":"hash","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"If this is a `google_pay` card wallet, this hash contains details about the wallet.","undocumented":false,"html":"If this is a \u003Ccode\u003Egoogle_pay\u003C/code\u003E card wallet, this hash contains details about the wallet."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"subspec":{},"object_type":"google_pay"},"masterpass":{"name":"masterpass","check":"hash","validation":"hash","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"If this is a `masterpass` card wallet, this hash contains details about the wallet.","undocumented":false,"html":"If this is a \u003Ccode\u003Emasterpass\u003C/code\u003E card wallet, this hash contains details about the wallet."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"subspec":{"billing_address":{"name":"billing_address","check":"hash","validation":"hash","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"Owner's verified billing address. Values are verified or provided by the wallet directly (if supported) at the time of authorization or settlement. They cannot be set or mutated.","undocumented":false,"html":"Owner’s verified billing address. Values are verified or provided by the wallet directly (if supported) at the time of authorization or settlement. They cannot be set or mutated."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"subspec":{"city":{"name":"city","check":"string","validation":"string","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"City, district, suburb, town, or village.","undocumented":false,"html":"City, district, suburb, town, or village."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"object_type":"city"},"country":{"name":"country","check":"string","validation":"string","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)).","undocumented":false,"html":"Two-letter country code (\u003Ca href=\"https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2\"\u003EISO 3166-1 alpha-2\u003C/a\u003E)."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"object_type":"country"},"line1":{"name":"line1","check":"string","validation":"string","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"Address line 1 (e.g., street, PO Box, or company name).","undocumented":false,"html":"Address line 1 (e.g., street, PO Box, or company name)."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"object_type":"line1"},"line2":{"name":"line2","check":"string","validation":"string","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"Address line 2 (e.g., apartment, suite, unit, or building).","undocumented":false,"html":"Address line 2 (e.g., apartment, suite, unit, or building)."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"object_type":"line2"},"postal_code":{"name":"postal_code","check":"string","validation":"string","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"ZIP or postal code.","undocumented":false,"html":"ZIP or postal code."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"object_type":"postal_code"},"state":{"name":"state","check":"string","validation":"string","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"State, county, province, or region.","undocumented":false,"html":"State, county, province, or region."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"object_type":"state"}},"object_type":"billing_address"},"email":{"name":"email","check":"string","validation":"string","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"Owner's verified email. Values are verified or provided by the wallet directly (if supported) at the time of authorization or settlement. They cannot be set or mutated.","undocumented":false,"html":"Owner’s verified email. Values are verified or provided by the wallet directly (if supported) at the time of authorization or settlement. They cannot be set or mutated."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"object_type":"email"},"name":{"name":"name","check":"string","validation":"string","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"Owner's verified full name. Values are verified or provided by the wallet directly (if supported) at the time of authorization or settlement. They cannot be set or mutated.","undocumented":false,"html":"Owner’s verified full name. Values are verified or provided by the wallet directly (if supported) at the time of authorization or settlement. They cannot be set or mutated."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"object_type":"name"},"shipping_address":{"name":"shipping_address","check":"hash","validation":"hash","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"Owner's verified shipping address. Values are verified or provided by the wallet directly (if supported) at the time of authorization or settlement. They cannot be set or mutated.","undocumented":false,"html":"Owner’s verified shipping address. Values are verified or provided by the wallet directly (if supported) at the time of authorization or settlement. They cannot be set or mutated."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"subspec":{"city":{"name":"city","check":"string","validation":"string","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"City, district, suburb, town, or village.","undocumented":false,"html":"City, district, suburb, town, or village."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"object_type":"city"},"country":{"name":"country","check":"string","validation":"string","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)).","undocumented":false,"html":"Two-letter country code (\u003Ca href=\"https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2\"\u003EISO 3166-1 alpha-2\u003C/a\u003E)."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"object_type":"country"},"line1":{"name":"line1","check":"string","validation":"string","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"Address line 1 (e.g., street, PO Box, or company name).","undocumented":false,"html":"Address line 1 (e.g., street, PO Box, or company name)."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"object_type":"line1"},"line2":{"name":"line2","check":"string","validation":"string","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"Address line 2 (e.g., apartment, suite, unit, or building).","undocumented":false,"html":"Address line 2 (e.g., apartment, suite, unit, or building)."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"object_type":"line2"},"postal_code":{"name":"postal_code","check":"string","validation":"string","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"ZIP or postal code.","undocumented":false,"html":"ZIP or postal code."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"object_type":"postal_code"},"state":{"name":"state","check":"string","validation":"string","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"State, county, province, or region.","undocumented":false,"html":"State, county, province, or region."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"object_type":"state"}},"object_type":"shipping_address"}},"object_type":"masterpass"},"samsung_pay":{"name":"samsung_pay","check":"hash","validation":"hash","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"If this is a `samsung_pay` card wallet, this hash contains details about the wallet.","undocumented":false,"html":"If this is a \u003Ccode\u003Esamsung_pay\u003C/code\u003E card wallet, this hash contains details about the wallet."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"subspec":{},"object_type":"samsung_pay"},"type":{"name":"type","check":"string","validation":"string","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"The type of the card wallet, one of `amex_express_checkout`, `apple_pay`, `google_pay`, `masterpass`, `samsung_pay`, or `visa_checkout`. An additional hash is included on the Wallet subhash with a name matching this value. It contains additional information specific to the card wallet type.","undocumented":false,"html":"The type of the card wallet, one of \u003Ccode\u003Eamex_express_checkout\u003C/code\u003E, \u003Ccode\u003Eapple_pay\u003C/code\u003E, \u003Ccode\u003Egoogle_pay\u003C/code\u003E, \u003Ccode\u003Emasterpass\u003C/code\u003E, \u003Ccode\u003Esamsung_pay\u003C/code\u003E, or \u003Ccode\u003Evisa_checkout\u003C/code\u003E. An additional hash is included on the Wallet subhash with a name matching this value. It contains additional information specific to the card wallet type."},"gate":false,"hide_unset_desc":null,"required":true,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"object_type":"type"},"visa_checkout":{"name":"visa_checkout","check":"hash","validation":"hash","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"If this is a `visa_checkout` card wallet, this hash contains details about the wallet.","undocumented":false,"html":"If this is a \u003Ccode\u003Evisa_checkout\u003C/code\u003E card wallet, this hash contains details about the wallet."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"subspec":{"billing_address":{"name":"billing_address","check":"hash","validation":"hash","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"Owner's verified billing address. Values are verified or provided by the wallet directly (if supported) at the time of authorization or settlement. They cannot be set or mutated.","undocumented":false,"html":"Owner’s verified billing address. Values are verified or provided by the wallet directly (if supported) at the time of authorization or settlement. They cannot be set or mutated."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"subspec":{"city":{"name":"city","check":"string","validation":"string","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"City, district, suburb, town, or village.","undocumented":false,"html":"City, district, suburb, town, or village."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"object_type":"city"},"country":{"name":"country","check":"string","validation":"string","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)).","undocumented":false,"html":"Two-letter country code (\u003Ca href=\"https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2\"\u003EISO 3166-1 alpha-2\u003C/a\u003E)."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"object_type":"country"},"line1":{"name":"line1","check":"string","validation":"string","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"Address line 1 (e.g., street, PO Box, or company name).","undocumented":false,"html":"Address line 1 (e.g., street, PO Box, or company name)."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"object_type":"line1"},"line2":{"name":"line2","check":"string","validation":"string","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"Address line 2 (e.g., apartment, suite, unit, or building).","undocumented":false,"html":"Address line 2 (e.g., apartment, suite, unit, or building)."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"object_type":"line2"},"postal_code":{"name":"postal_code","check":"string","validation":"string","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"ZIP or postal code.","undocumented":false,"html":"ZIP or postal code."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"object_type":"postal_code"},"state":{"name":"state","check":"string","validation":"string","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"State, county, province, or region.","undocumented":false,"html":"State, county, province, or region."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"object_type":"state"}},"object_type":"billing_address"},"email":{"name":"email","check":"string","validation":"string","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"Owner's verified email. Values are verified or provided by the wallet directly (if supported) at the time of authorization or settlement. They cannot be set or mutated.","undocumented":false,"html":"Owner’s verified email. Values are verified or provided by the wallet directly (if supported) at the time of authorization or settlement. They cannot be set or mutated."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"object_type":"email"},"name":{"name":"name","check":"string","validation":"string","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"Owner's verified full name. Values are verified or provided by the wallet directly (if supported) at the time of authorization or settlement. They cannot be set or mutated.","undocumented":false,"html":"Owner’s verified full name. Values are verified or provided by the wallet directly (if supported) at the time of authorization or settlement. They cannot be set or mutated."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"object_type":"name"},"shipping_address":{"name":"shipping_address","check":"hash","validation":"hash","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"Owner's verified shipping address. Values are verified or provided by the wallet directly (if supported) at the time of authorization or settlement. They cannot be set or mutated.","undocumented":false,"html":"Owner’s verified shipping address. Values are verified or provided by the wallet directly (if supported) at the time of authorization or settlement. They cannot be set or mutated."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"subspec":{"city":{"name":"city","check":"string","validation":"string","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"City, district, suburb, town, or village.","undocumented":false,"html":"City, district, suburb, town, or village."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"object_type":"city"},"country":{"name":"country","check":"string","validation":"string","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)).","undocumented":false,"html":"Two-letter country code (\u003Ca href=\"https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2\"\u003EISO 3166-1 alpha-2\u003C/a\u003E)."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"object_type":"country"},"line1":{"name":"line1","check":"string","validation":"string","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"Address line 1 (e.g., street, PO Box, or company name).","undocumented":false,"html":"Address line 1 (e.g., street, PO Box, or company name)."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"object_type":"line1"},"line2":{"name":"line2","check":"string","validation":"string","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"Address line 2 (e.g., apartment, suite, unit, or building).","undocumented":false,"html":"Address line 2 (e.g., apartment, suite, unit, or building)."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"object_type":"line2"},"postal_code":{"name":"postal_code","check":"string","validation":"string","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"ZIP or postal code.","undocumented":false,"html":"ZIP or postal code."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"object_type":"postal_code"},"state":{"name":"state","check":"string","validation":"string","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"State, county, province, or region.","undocumented":false,"html":"State, county, province, or region."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"object_type":"state"}},"object_type":"shipping_address"}},"object_type":"visa_checkout"}},"object_type":"wallet"}},"object_type":"card","less_common":true},"card_present":{"name":"card_present","check":"hash","validation":"hash","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"If this is a `card_present` PaymentMethod, this hash contains details about the Card Present payment method.","undocumented":false,"html":"If this is a \u003Ccode\u003Ecard_present\u003C/code\u003E PaymentMethod, this hash contains details about the Card Present payment method."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"subspec":{"brand":{"name":"brand","check":"string","validation":"string","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"Card brand. Can be `amex`, `diners`, `discover`, `jcb`, `mastercard`, `unionpay`, `visa`, or `unknown`.","undocumented":false,"html":"Card brand. Can be \u003Ccode\u003Eamex\u003C/code\u003E, \u003Ccode\u003Ediners\u003C/code\u003E, \u003Ccode\u003Ediscover\u003C/code\u003E, \u003Ccode\u003Ejcb\u003C/code\u003E, \u003Ccode\u003Emastercard\u003C/code\u003E, \u003Ccode\u003Eunionpay\u003C/code\u003E, \u003Ccode\u003Evisa\u003C/code\u003E, or \u003Ccode\u003Eunknown\u003C/code\u003E."},"gate":true,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"object_type":"brand"},"cardholder_name":{"name":"cardholder_name","check":"string","validation":"string","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"The cardholder name as read from the card, in [ISO 7813](https://en.wikipedia.org/wiki/ISO/IEC_7813) format. May include alphanumeric characters, special characters and first/last name separator (`/`). In some cases, the cardholder name may not be available depending on how the issuer has configured the card. Cardholder name is typically not available on swipe or contactless payments, such as those made with Apple Pay and Google Pay.","undocumented":false,"html":"The cardholder name as read from the card, in \u003Ca href=\"https://en.wikipedia.org/wiki/ISO/IEC_7813\"\u003EISO 7813\u003C/a\u003E format. May include alphanumeric characters, special characters and first/last name separator (\u003Ccode\u003E/\u003C/code\u003E). In some cases, the cardholder name may not be available depending on how the issuer has configured the card. Cardholder name is typically not available on swipe or contactless payments, such as those made with Apple Pay and Google Pay."},"gate":true,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"object_type":"cardholder_name"},"country":{"name":"country","check":"string","validation":"string","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"Two-letter ISO code representing the country of the card. You could use this attribute to get a sense of the international breakdown of cards you've collected.","undocumented":false,"html":"Two-letter ISO code representing the country of the card. You could use this attribute to get a sense of the international breakdown of cards you’ve collected."},"gate":true,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"object_type":"country"},"exp_month":{"name":"exp_month","check":"integer","validation":"integer","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"Two-digit number representing the card's expiration month.","undocumented":false,"html":"Two-digit number representing the card’s expiration month."},"gate":true,"hide_unset_desc":null,"required":true,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"object_type":"exp_month"},"exp_year":{"name":"exp_year","check":"integer","validation":"integer","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"Four-digit number representing the card's expiration year.","undocumented":false,"html":"Four-digit number representing the card’s expiration year."},"gate":true,"hide_unset_desc":null,"required":true,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"object_type":"exp_year"},"fingerprint":{"name":"fingerprint","check":"string","validation":"string","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"Uniquely identifies this particular card number. You can use this attribute to check whether two customers who’ve signed up with you are using the same card number, for example. For payment methods that tokenize card information (Apple Pay, Google Pay), the tokenized number might be provided instead of the underlying card number.\n\n*Starting May 1, 2021, card fingerprint in India for Connect will change to allow two fingerprints for the same card --- one for India and one for the rest of the world.*\n","undocumented":false,"html":"Uniquely identifies this particular card number. You can use this attribute to check whether two customers who’ve signed up with you are using the same card number, for example. For payment methods that tokenize card information (Apple Pay, Google Pay), the tokenized number might be provided instead of the underlying card number.\u003C/p\u003E\n\n\u003Cp\u003E\u003Cem\u003EStarting May 1, 2021, card fingerprint in India for Connect will change to allow two fingerprints for the same card — one for India and one for the rest of the world.\u003C/em\u003E"},"gate":true,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"object_type":"fingerprint"},"funding":{"name":"funding","check":"string","validation":"string","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"Card funding type. Can be `credit`, `debit`, `prepaid`, or `unknown`.","undocumented":false,"html":"Card funding type. Can be \u003Ccode\u003Ecredit\u003C/code\u003E, \u003Ccode\u003Edebit\u003C/code\u003E, \u003Ccode\u003Eprepaid\u003C/code\u003E, or \u003Ccode\u003Eunknown\u003C/code\u003E."},"gate":true,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"object_type":"funding"},"last4":{"name":"last4","check":"string","validation":"string","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"The last four digits of the card.","undocumented":false,"html":"The last four digits of the card."},"gate":true,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"object_type":"last4"},"networks":{"name":"networks","check":"hash","validation":"hash","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"Contains information about card networks that can be used to process the payment.","undocumented":false,"html":"Contains information about card networks that can be used to process the payment."},"gate":true,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"subspec":{"available":{"name":"available","check":"string_array","validation":"array containing strings","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"All available networks for the card.","undocumented":false,"html":"All available networks for the card."},"gate":false,"hide_unset_desc":null,"required":true,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"object_type":"available"},"preferred":{"name":"preferred","check":"string","validation":"string","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"The preferred network for the card.","undocumented":false,"html":"The preferred network for the card."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"object_type":"preferred"}},"object_type":"networks"},"read_method":{"name":"read_method","check":"string","validation":"string","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"How card details were read in this transaction.","undocumented":false,"html":"How card details were read in this transaction."},"gate":true,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"enum_values":{"contact_emv":{"documentation":{"gate_specific":{},"localize_terms":[],"markdown":"Inserting a chip card into the card reader.","undocumented":false,"html":"Inserting a chip card into the card reader."}},"contactless_emv":{"documentation":{"gate_specific":{},"localize_terms":[],"markdown":"Tapping a contactless-enabled chip card or mobile wallet.","undocumented":false,"html":"Tapping a contactless-enabled chip card or mobile wallet."}},"magnetic_stripe_track2":{"documentation":{"gate_specific":{},"localize_terms":[],"markdown":"Swiping a card using the magnetic stripe reader.","undocumented":false,"html":"Swiping a card using the magnetic stripe reader."}},"magnetic_stripe_fallback":{"documentation":{"gate_specific":{},"localize_terms":[],"markdown":"When inserting a chip card fails three times in a row, fallback to a magnetic stripe read.","undocumented":false,"html":"When inserting a chip card fails three times in a row, fallback to a magnetic stripe read."}},"contactless_magstripe_mode":{"documentation":{"gate_specific":{},"localize_terms":[],"markdown":"Older standard for contactless payments that emulated a magnetic stripe read.","undocumented":false,"html":"Older standard for contactless payments that emulated a magnetic stripe read."}}},"object_type":"read_method"}},"object_type":"card_present","less_common":true},"created":{"name":"created","check":"timestamp","validation":"timestamp","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"Time at which the object was created. Measured in seconds since the Unix epoch.","undocumented":false,"html":"Time at which the object was created. Measured in seconds since the Unix epoch."},"gate":false,"hide_unset_desc":null,"required":true,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"object_type":"created","less_common":true},"customer":{"name":"customer","check":"string","validation":"string","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"The ID of the Customer to which this PaymentMethod is saved. This will not be set when the PaymentMethod has not been saved to a Customer.","undocumented":false,"html":"The ID of the Customer to which this PaymentMethod is saved. This will not be set when the PaymentMethod has not been saved to a Customer."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"user_expandable":["customer"],"object_type":"customer"},"customer_balance":{"name":"customer_balance","check":"hash","validation":"hash","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"If this is a `customer_balance` PaymentMethod, this hash contains details about the CustomerBalance payment method.","undocumented":false,"html":"If this is a \u003Ccode\u003Ecustomer_balance\u003C/code\u003E PaymentMethod, this hash contains details about the CustomerBalance payment method."},"gate":true,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"subspec":{},"object_type":"customer_balance","less_common":true},"eps":{"name":"eps","check":"hash","validation":"hash","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"If this is an `eps` PaymentMethod, this hash contains details about the EPS payment method.","undocumented":false,"html":"If this is an \u003Ccode\u003Eeps\u003C/code\u003E PaymentMethod, this hash contains details about the EPS payment method."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"subspec":{"bank":{"name":"bank","check":"string","validation":"string","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"The customer's bank. Should be one of `arzte_und_apotheker_bank`, `austrian_anadi_bank_ag`, `bank_austria`, `bankhaus_carl_spangler`, `bankhaus_schelhammer_und_schattera_ag`, `bawag_psk_ag`, `bks_bank_ag`, `brull_kallmus_bank_ag`, `btv_vier_lander_bank`, `capital_bank_grawe_gruppe_ag`, `deutsche_bank_ag`, `dolomitenbank`, `easybank_ag`, `erste_bank_und_sparkassen`, `hypo_alpeadriabank_international_ag`, `hypo_noe_lb_fur_niederosterreich_u_wien`, `hypo_oberosterreich_salzburg_steiermark`, `hypo_tirol_bank_ag`, `hypo_vorarlberg_bank_ag`, `hypo_bank_burgenland_aktiengesellschaft`, `marchfelder_bank`, `oberbank_ag`, `raiffeisen_bankengruppe_osterreich`, `schoellerbank_ag`, `sparda_bank_wien`, `volksbank_gruppe`, `volkskreditbank_ag`, or `vr_bank_braunau`.","undocumented":false,"html":"The customer’s bank. Should be one of \u003Ccode\u003Earzte_und_apotheker_bank\u003C/code\u003E, \u003Ccode\u003Eaustrian_anadi_bank_ag\u003C/code\u003E, \u003Ccode\u003Ebank_austria\u003C/code\u003E, \u003Ccode\u003Ebankhaus_carl_spangler\u003C/code\u003E, \u003Ccode\u003Ebankhaus_schelhammer_und_schattera_ag\u003C/code\u003E, \u003Ccode\u003Ebawag_psk_ag\u003C/code\u003E, \u003Ccode\u003Ebks_bank_ag\u003C/code\u003E, \u003Ccode\u003Ebrull_kallmus_bank_ag\u003C/code\u003E, \u003Ccode\u003Ebtv_vier_lander_bank\u003C/code\u003E, \u003Ccode\u003Ecapital_bank_grawe_gruppe_ag\u003C/code\u003E, \u003Ccode\u003Edeutsche_bank_ag\u003C/code\u003E, \u003Ccode\u003Edolomitenbank\u003C/code\u003E, \u003Ccode\u003Eeasybank_ag\u003C/code\u003E, \u003Ccode\u003Eerste_bank_und_sparkassen\u003C/code\u003E, \u003Ccode\u003Ehypo_alpeadriabank_international_ag\u003C/code\u003E, \u003Ccode\u003Ehypo_noe_lb_fur_niederosterreich_u_wien\u003C/code\u003E, \u003Ccode\u003Ehypo_oberosterreich_salzburg_steiermark\u003C/code\u003E, \u003Ccode\u003Ehypo_tirol_bank_ag\u003C/code\u003E, \u003Ccode\u003Ehypo_vorarlberg_bank_ag\u003C/code\u003E, \u003Ccode\u003Ehypo_bank_burgenland_aktiengesellschaft\u003C/code\u003E, \u003Ccode\u003Emarchfelder_bank\u003C/code\u003E, \u003Ccode\u003Eoberbank_ag\u003C/code\u003E, \u003Ccode\u003Eraiffeisen_bankengruppe_osterreich\u003C/code\u003E, \u003Ccode\u003Eschoellerbank_ag\u003C/code\u003E, \u003Ccode\u003Esparda_bank_wien\u003C/code\u003E, \u003Ccode\u003Evolksbank_gruppe\u003C/code\u003E, \u003Ccode\u003Evolkskreditbank_ag\u003C/code\u003E, or \u003Ccode\u003Evr_bank_braunau\u003C/code\u003E."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"object_type":"bank"}},"object_type":"eps","less_common":true},"fpx":{"name":"fpx","check":"hash","validation":"hash","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"If this is an `fpx` PaymentMethod, this hash contains details about the FPX payment method.","undocumented":false,"html":"If this is an \u003Ccode\u003Efpx\u003C/code\u003E PaymentMethod, this hash contains details about the FPX payment method."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"subspec":{"bank":{"name":"bank","check":"string","validation":"string","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"The customer's bank, if provided. Can be one of `affin_bank`, `agrobank`, `alliance_bank`, `ambank`, `bank_islam`, `bank_muamalat`, `bank_rakyat`, `bsn`, `cimb`, `hong_leong_bank`, `hsbc`, `kfh`, `maybank2u`, `ocbc`, `public_bank`, `rhb`, `standard_chartered`, `uob`, `deutsche_bank`, `maybank2e`, `pb_enterprise`, or `bank_of_china`.","undocumented":false,"html":"The customer’s bank, if provided. Can be one of \u003Ccode\u003Eaffin_bank\u003C/code\u003E, \u003Ccode\u003Eagrobank\u003C/code\u003E, \u003Ccode\u003Ealliance_bank\u003C/code\u003E, \u003Ccode\u003Eambank\u003C/code\u003E, \u003Ccode\u003Ebank_islam\u003C/code\u003E, \u003Ccode\u003Ebank_muamalat\u003C/code\u003E, \u003Ccode\u003Ebank_rakyat\u003C/code\u003E, \u003Ccode\u003Ebsn\u003C/code\u003E, \u003Ccode\u003Ecimb\u003C/code\u003E, \u003Ccode\u003Ehong_leong_bank\u003C/code\u003E, \u003Ccode\u003Ehsbc\u003C/code\u003E, \u003Ccode\u003Ekfh\u003C/code\u003E, \u003Ccode\u003Emaybank2u\u003C/code\u003E, \u003Ccode\u003Eocbc\u003C/code\u003E, \u003Ccode\u003Epublic_bank\u003C/code\u003E, \u003Ccode\u003Erhb\u003C/code\u003E, \u003Ccode\u003Estandard_chartered\u003C/code\u003E, \u003Ccode\u003Euob\u003C/code\u003E, \u003Ccode\u003Edeutsche_bank\u003C/code\u003E, \u003Ccode\u003Emaybank2e\u003C/code\u003E, \u003Ccode\u003Epb_enterprise\u003C/code\u003E, or \u003Ccode\u003Ebank_of_china\u003C/code\u003E."},"gate":false,"hide_unset_desc":null,"required":true,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"object_type":"bank"}},"object_type":"fpx","less_common":true},"giropay":{"name":"giropay","check":"hash","validation":"hash","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"If this is a `giropay` PaymentMethod, this hash contains details about the Giropay payment method.","undocumented":false,"html":"If this is a \u003Ccode\u003Egiropay\u003C/code\u003E PaymentMethod, this hash contains details about the Giropay payment method."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"subspec":{},"object_type":"giropay","less_common":true},"grabpay":{"name":"grabpay","check":"hash","validation":"hash","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"If this is a `grabpay` PaymentMethod, this hash contains details about the GrabPay payment method.","undocumented":false,"html":"If this is a \u003Ccode\u003Egrabpay\u003C/code\u003E PaymentMethod, this hash contains details about the GrabPay payment method."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"subspec":{},"object_type":"grabpay","less_common":true},"ideal":{"name":"ideal","check":"hash","validation":"hash","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"If this is an `ideal` PaymentMethod, this hash contains details about the iDEAL payment method.","undocumented":false,"html":"If this is an \u003Ccode\u003Eideal\u003C/code\u003E PaymentMethod, this hash contains details about the iDEAL payment method."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"subspec":{"bank":{"name":"bank","check":"string","validation":"string","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"The customer's bank, if provided. Can be one of `abn_amro`, `asn_bank`, `bunq`, `handelsbanken`, `ing`, `knab`, `moneyou`, `rabobank`, `regiobank`, `revolut`, `sns_bank`, `triodos_bank`, `van_lanschot`, or `yoursafe`.","undocumented":false,"html":"The customer’s bank, if provided. Can be one of \u003Ccode\u003Eabn_amro\u003C/code\u003E, \u003Ccode\u003Easn_bank\u003C/code\u003E, \u003Ccode\u003Ebunq\u003C/code\u003E, \u003Ccode\u003Ehandelsbanken\u003C/code\u003E, \u003Ccode\u003Eing\u003C/code\u003E, \u003Ccode\u003Eknab\u003C/code\u003E, \u003Ccode\u003Emoneyou\u003C/code\u003E, \u003Ccode\u003Erabobank\u003C/code\u003E, \u003Ccode\u003Eregiobank\u003C/code\u003E, \u003Ccode\u003Erevolut\u003C/code\u003E, \u003Ccode\u003Esns_bank\u003C/code\u003E, \u003Ccode\u003Etriodos_bank\u003C/code\u003E, \u003Ccode\u003Evan_lanschot\u003C/code\u003E, or \u003Ccode\u003Eyoursafe\u003C/code\u003E."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"object_type":"bank"},"bic":{"name":"bic","check":"string","validation":"string","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"The Bank Identifier Code of the customer's bank, if the bank was provided.","undocumented":false,"html":"The Bank Identifier Code of the customer’s bank, if the bank was provided."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"object_type":"bic"}},"object_type":"ideal","less_common":true},"interac_present":{"name":"interac_present","check":"hash","validation":"hash","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"If this is an `interac_present` PaymentMethod, this hash contains details about the Interac Present payment method.","undocumented":false,"html":"If this is an \u003Ccode\u003Einterac_present\u003C/code\u003E PaymentMethod, this hash contains details about the Interac Present payment method."},"gate":true,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"subspec":{"brand":{"name":"brand","check":"string","validation":"string","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"Card brand. Can be `interac`, `mastercard` or `visa`.","undocumented":false,"html":"Card brand. Can be \u003Ccode\u003Einterac\u003C/code\u003E, \u003Ccode\u003Emastercard\u003C/code\u003E or \u003Ccode\u003Evisa\u003C/code\u003E."},"gate":true,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"object_type":"brand"},"cardholder_name":{"name":"cardholder_name","check":"string","validation":"string","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"The cardholder name as read from the card, in [ISO 7813](https://en.wikipedia.org/wiki/ISO/IEC_7813) format. May include alphanumeric characters, special characters and first/last name separator (`/`). In some cases, the cardholder name may not be available depending on how the issuer has configured the card. Cardholder name is typically not available on swipe or contactless payments, such as those made with Apple Pay and Google Pay.","undocumented":false,"html":"The cardholder name as read from the card, in \u003Ca href=\"https://en.wikipedia.org/wiki/ISO/IEC_7813\"\u003EISO 7813\u003C/a\u003E format. May include alphanumeric characters, special characters and first/last name separator (\u003Ccode\u003E/\u003C/code\u003E). In some cases, the cardholder name may not be available depending on how the issuer has configured the card. Cardholder name is typically not available on swipe or contactless payments, such as those made with Apple Pay and Google Pay."},"gate":true,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"object_type":"cardholder_name"},"country":{"name":"country","check":"string","validation":"string","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"Two-letter ISO code representing the country of the card. You could use this attribute to get a sense of the international breakdown of cards you've collected.","undocumented":false,"html":"Two-letter ISO code representing the country of the card. You could use this attribute to get a sense of the international breakdown of cards you’ve collected."},"gate":true,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"object_type":"country"},"exp_month":{"name":"exp_month","check":"integer","validation":"integer","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"Two-digit number representing the card's expiration month.","undocumented":false,"html":"Two-digit number representing the card’s expiration month."},"gate":true,"hide_unset_desc":null,"required":true,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"object_type":"exp_month"},"exp_year":{"name":"exp_year","check":"integer","validation":"integer","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"Four-digit number representing the card's expiration year.","undocumented":false,"html":"Four-digit number representing the card’s expiration year."},"gate":true,"hide_unset_desc":null,"required":true,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"object_type":"exp_year"},"fingerprint":{"name":"fingerprint","check":"string","validation":"string","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"Uniquely identifies this particular card number. You can use this attribute to check whether two customers who’ve signed up with you are using the same card number, for example. For payment methods that tokenize card information (Apple Pay, Google Pay), the tokenized number might be provided instead of the underlying card number.\n\n*Starting May 1, 2021, card fingerprint in India for Connect will change to allow two fingerprints for the same card --- one for India and one for the rest of the world.*\n","undocumented":false,"html":"Uniquely identifies this particular card number. You can use this attribute to check whether two customers who’ve signed up with you are using the same card number, for example. For payment methods that tokenize card information (Apple Pay, Google Pay), the tokenized number might be provided instead of the underlying card number.\u003C/p\u003E\n\n\u003Cp\u003E\u003Cem\u003EStarting May 1, 2021, card fingerprint in India for Connect will change to allow two fingerprints for the same card — one for India and one for the rest of the world.\u003C/em\u003E"},"gate":true,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"object_type":"fingerprint"},"funding":{"name":"funding","check":"string","validation":"string","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"Card funding type. Can be `credit`, `debit`, `prepaid`, or `unknown`.","undocumented":false,"html":"Card funding type. Can be \u003Ccode\u003Ecredit\u003C/code\u003E, \u003Ccode\u003Edebit\u003C/code\u003E, \u003Ccode\u003Eprepaid\u003C/code\u003E, or \u003Ccode\u003Eunknown\u003C/code\u003E."},"gate":true,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"object_type":"funding"},"last4":{"name":"last4","check":"string","validation":"string","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"The last four digits of the card.","undocumented":false,"html":"The last four digits of the card."},"gate":true,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"object_type":"last4"},"networks":{"name":"networks","check":"hash","validation":"hash","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"Contains information about card networks that can be used to process the payment.","undocumented":false,"html":"Contains information about card networks that can be used to process the payment."},"gate":true,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"subspec":{"available":{"name":"available","check":"string_array","validation":"array containing strings","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"All available networks for the card.","undocumented":false,"html":"All available networks for the card."},"gate":false,"hide_unset_desc":null,"required":true,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"object_type":"available"},"preferred":{"name":"preferred","check":"string","validation":"string","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"The preferred network for the card.","undocumented":false,"html":"The preferred network for the card."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"object_type":"preferred"}},"object_type":"networks"},"preferred_locales":{"name":"preferred_locales","check":"string_array","validation":"array containing strings","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"EMV tag 5F2D. Preferred languages specified by the integrated circuit chip.","undocumented":false,"html":"EMV tag 5F2D. Preferred languages specified by the integrated circuit chip."},"gate":true,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"object_type":"preferred_locales"},"read_method":{"name":"read_method","check":"string","validation":"string","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"How card details were read in this transaction.","undocumented":false,"html":"How card details were read in this transaction."},"gate":true,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"enum_values":{"contact_emv":{"documentation":{"gate_specific":{},"localize_terms":[],"markdown":"Inserting a chip card into the card reader.","undocumented":false,"html":"Inserting a chip card into the card reader."}},"contactless_emv":{"documentation":{"gate_specific":{},"localize_terms":[],"markdown":"Tapping a contactless-enabled chip card or mobile wallet.","undocumented":false,"html":"Tapping a contactless-enabled chip card or mobile wallet."}},"magnetic_stripe_track2":{"documentation":{"gate_specific":{},"localize_terms":[],"markdown":"Swiping a card using the magnetic stripe reader.","undocumented":false,"html":"Swiping a card using the magnetic stripe reader."}},"magnetic_stripe_fallback":{"documentation":{"gate_specific":{},"localize_terms":[],"markdown":"When inserting a chip card fails three times in a row, fallback to a magnetic stripe read.","undocumented":false,"html":"When inserting a chip card fails three times in a row, fallback to a magnetic stripe read."}},"contactless_magstripe_mode":{"documentation":{"gate_specific":{},"localize_terms":[],"markdown":"Older standard for contactless payments that emulated a magnetic stripe read.","undocumented":false,"html":"Older standard for contactless payments that emulated a magnetic stripe read."}}},"object_type":"read_method"}},"object_type":"interac_present","less_common":true},"klarna":{"name":"klarna","check":"hash","validation":"hash","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"If this is a `klarna` PaymentMethod, this hash contains details about the Klarna payment method.","undocumented":false,"html":"If this is a \u003Ccode\u003Eklarna\u003C/code\u003E PaymentMethod, this hash contains details about the Klarna payment method."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"subspec":{"dob":{"name":"dob","check":"hash","validation":"hash","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"The customer's date of birth, if provided.","undocumented":false,"html":"The customer’s date of birth, if provided."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":true,"subspec":{"day":{"name":"day","check":"positive_integer","validation":"positive integer","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"The day of birth, between 1 and 31.","undocumented":false,"html":"The day of birth, between 1 and 31."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"object_type":"day"},"month":{"name":"month","check":"positive_integer","validation":"positive integer","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"The month of birth, between 1 and 12.","undocumented":false,"html":"The month of birth, between 1 and 12."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"object_type":"month"},"year":{"name":"year","check":"positive_integer","validation":"positive integer","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"The four-digit year of birth.","undocumented":false,"html":"The four-digit year of birth."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"object_type":"year"}},"object_type":"dob"}},"object_type":"klarna","less_common":true},"konbini":{"name":"konbini","check":"hash","validation":"hash","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"If this is a `konbini` PaymentMethod, this hash contains details about the Konbini payment method.","undocumented":false,"html":"If this is a \u003Ccode\u003Ekonbini\u003C/code\u003E PaymentMethod, this hash contains details about the Konbini payment method."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"subspec":{},"object_type":"konbini","less_common":true},"link":{"name":"link","check":"hash","validation":"hash","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"If this is an `Link` PaymentMethod, this hash contains details about the Link payment method.","undocumented":false,"html":"If this is an \u003Ccode\u003ELink\u003C/code\u003E PaymentMethod, this hash contains details about the Link payment method."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"subspec":{"email":{"name":"email","check":"string","validation":"string","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"Account owner's email address.","undocumented":false,"html":"Account owner’s email address."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"object_type":"email"},"persistent_token":{"name":"persistent_token","check":"string","validation":"string","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"Token used for persistent Link logins.","undocumented":false,"html":"Token used for persistent Link logins."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"object_type":"persistent_token"}},"object_type":"link","less_common":true},"livemode":{"name":"livemode","check":"boolean","validation":"boolean","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode.","undocumented":false,"html":"Has the value \u003Ccode\u003Etrue\u003C/code\u003E if the object exists in live mode or the value \u003Ccode\u003Efalse\u003C/code\u003E if the object exists in test mode."},"gate":false,"hide_unset_desc":null,"required":true,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"object_type":"livemode","less_common":true},"metadata":{"name":"metadata","check":"hash","validation":"hash","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"Set of [key-value pairs](/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format.","undocumented":false,"html":"Set of \u003Ca href=\"/docs/api/metadata\"\u003Ekey-value pairs\u003C/a\u003E that you can attach to an object. This can be useful for storing additional information about the object in a structured format."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"object_type":"metadata"},"oxxo":{"name":"oxxo","check":"hash","validation":"hash","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"If this is an `oxxo` PaymentMethod, this hash contains details about the OXXO payment method.","undocumented":false,"html":"If this is an \u003Ccode\u003Eoxxo\u003C/code\u003E PaymentMethod, this hash contains details about the OXXO payment method."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"subspec":{},"object_type":"oxxo","less_common":true},"p24":{"name":"p24","check":"hash","validation":"hash","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"If this is a `p24` PaymentMethod, this hash contains details about the P24 payment method.","undocumented":false,"html":"If this is a \u003Ccode\u003Ep24\u003C/code\u003E PaymentMethod, this hash contains details about the P24 payment method."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"subspec":{"bank":{"name":"bank","check":"string","validation":"string","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"The customer's bank, if provided.","undocumented":false,"html":"The customer’s bank, if provided."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"enum_values":{"ing":{"documentation":null},"citi_handlowy":{"documentation":null},"tmobile_usbugi_bankowe":{"documentation":null},"plus_bank":{"documentation":null},"etransfer_pocztowy24":{"documentation":null},"banki_spbdzielcze":{"documentation":null},"bank_nowy_bfg_sa":{"documentation":null},"getin_bank":{"documentation":null},"blik":{"documentation":null},"noble_pay":{"documentation":null},"ideabank":{"documentation":null},"envelobank":{"documentation":null},"santander_przelew24":{"documentation":null},"nest_przelew":{"documentation":null},"mbank_mtransfer":{"documentation":null},"inteligo":{"documentation":null},"pbac_z_ipko":{"documentation":null},"bnp_paribas":{"documentation":null},"credit_agricole":{"documentation":null},"toyota_bank":{"documentation":null},"bank_pekao_sa":{"documentation":null},"volkswagen_bank":{"documentation":null},"bank_millennium":{"documentation":null},"alior_bank":{"documentation":null},"boz":{"documentation":null}},"object_type":"bank"}},"object_type":"p24","less_common":true},"paynow":{"name":"paynow","check":"hash","validation":"hash","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"If this is a `paynow` PaymentMethod, this hash contains details about the PayNow payment method.","undocumented":false,"html":"If this is a \u003Ccode\u003Epaynow\u003C/code\u003E PaymentMethod, this hash contains details about the PayNow payment method."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"subspec":{},"object_type":"paynow","less_common":true},"pix":{"name":"pix","check":"hash","validation":"hash","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"If this is a `pix` PaymentMethod, this hash contains details about the Pix payment method.","undocumented":false,"html":"If this is a \u003Ccode\u003Epix\u003C/code\u003E PaymentMethod, this hash contains details about the Pix payment method."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"subspec":{},"object_type":"pix","less_common":true},"promptpay":{"name":"promptpay","check":"hash","validation":"hash","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"If this is a `promptpay` PaymentMethod, this hash contains details about the PromptPay payment method.","undocumented":false,"html":"If this is a \u003Ccode\u003Epromptpay\u003C/code\u003E PaymentMethod, this hash contains details about the PromptPay payment method."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"subspec":{},"object_type":"promptpay","less_common":true},"radar_options":{"name":"radar_options","check":"hash","validation":"hash","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"Options to configure Radar. See [Radar Session](/docs/radar/radar-session) for more information.","undocumented":false,"html":"Options to configure Radar. See \u003Ca href=\"/docs/radar/radar-session\"\u003ERadar Session\u003C/a\u003E for more information."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"subspec":{"session":{"name":"session","check":"string","validation":"string","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"A [Radar Session](/docs/radar/radar-session) is a snapshot of the browser metadata and device details that help Radar make more accurate predictions on your payments.","undocumented":false,"html":"A \u003Ca href=\"/docs/radar/radar-session\"\u003ERadar Session\u003C/a\u003E is a snapshot of the browser metadata and device details that help Radar make more accurate predictions on your payments."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"object_type":"session"}},"object_type":"radar_options","less_common":true},"sepa_debit":{"name":"sepa_debit","check":"hash","validation":"hash","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"If this is a `sepa_debit` PaymentMethod, this hash contains details about the SEPA debit bank account.","undocumented":false,"html":"If this is a \u003Ccode\u003Esepa_debit\u003C/code\u003E PaymentMethod, this hash contains details about the SEPA debit bank account."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"subspec":{"bank_code":{"name":"bank_code","check":"string","validation":"string","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"Bank code of bank associated with the bank account.","undocumented":false,"html":"Bank code of bank associated with the bank account."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"object_type":"bank_code"},"branch_code":{"name":"branch_code","check":"string","validation":"string","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"Branch code of bank associated with the bank account.","undocumented":false,"html":"Branch code of bank associated with the bank account."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"object_type":"branch_code"},"country":{"name":"country","check":"string","validation":"string","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"Two-letter ISO code representing the country the bank account is located in.","undocumented":false,"html":"Two-letter ISO code representing the country the bank account is located in."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"object_type":"country"},"fingerprint":{"name":"fingerprint","check":"string","validation":"string","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"Uniquely identifies this particular bank account. You can use this attribute to check whether two bank accounts are the same.","undocumented":false,"html":"Uniquely identifies this particular bank account. You can use this attribute to check whether two bank accounts are the same."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"object_type":"fingerprint"},"generated_from":{"name":"generated_from","check":"hash","validation":"hash","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"Information about the object that generated this PaymentMethod.","undocumented":false,"html":"Information about the object that generated this PaymentMethod."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"subspec":{"charge":{"name":"charge","check":"string","validation":"string","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"The ID of the Charge that generated this PaymentMethod, if any.","undocumented":false,"html":"The ID of the Charge that generated this PaymentMethod, if any."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"user_expandable":["charge"],"object_type":"charge"},"setup_attempt":{"name":"setup_attempt","check":"string","validation":"string","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"The ID of the SetupAttempt that generated this PaymentMethod, if any.","undocumented":false,"html":"The ID of the SetupAttempt that generated this PaymentMethod, if any."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"user_expandable":["setup_attempt"],"object_type":"setup_attempt"}},"object_type":"generated_from"},"last4":{"name":"last4","check":"string","validation":"string","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"Last four characters of the IBAN.","undocumented":false,"html":"Last four characters of the IBAN."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"object_type":"last4"}},"object_type":"sepa_debit","less_common":true},"sofort":{"name":"sofort","check":"hash","validation":"hash","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"If this is a `sofort` PaymentMethod, this hash contains details about the SOFORT payment method.","undocumented":false,"html":"If this is a \u003Ccode\u003Esofort\u003C/code\u003E PaymentMethod, this hash contains details about the SOFORT payment method."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"subspec":{"country":{"name":"country","check":"string","validation":"string","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"Two-letter ISO code representing the country the bank account is located in.","undocumented":false,"html":"Two-letter ISO code representing the country the bank account is located in."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"object_type":"country"}},"object_type":"sofort","less_common":true},"type":{"name":"type","check":"string","validation":"string","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"The type of the PaymentMethod. An additional hash is included on the PaymentMethod with a name matching this value. It contains additional information specific to the PaymentMethod type.","undocumented":false,"html":"The type of the PaymentMethod. An additional hash is included on the PaymentMethod with a name matching this value. It contains additional information specific to the PaymentMethod type."},"gate":false,"hide_unset_desc":null,"required":true,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"enum_values":{"acss_debit":{"documentation":{"gate_specific":{},"localize_terms":[],"markdown":"[Pre-authorized debit payments](/docs/payments/acss-debit) are used to debit Canadian bank accounts through the Automated Clearing Settlement System (ACSS).","undocumented":false,"html":"\u003Ca href=\"/docs/payments/acss-debit\"\u003EPre-authorized debit payments\u003C/a\u003E are used to debit Canadian bank accounts through the Automated Clearing Settlement System (ACSS)."}},"affirm":{"documentation":{"gate_specific":{},"localize_terms":[],"markdown":"[Affirm](/docs/payments/affirm) is a buy now, pay later payment method in the US.","undocumented":false,"html":"\u003Ca href=\"/docs/payments/affirm\"\u003EAffirm\u003C/a\u003E is a buy now, pay later payment method in the US."}},"afterpay_clearpay":{"documentation":{"gate_specific":{},"localize_terms":[],"markdown":"[Afterpay / Clearpay](/docs/payments/afterpay-clearpay) is a buy now, pay later payment method used in Australia, Canada, France, New Zealand, Spain, the UK, and the US.","undocumented":false,"html":"\u003Ca href=\"/docs/payments/afterpay-clearpay\"\u003EAfterpay / Clearpay\u003C/a\u003E is a buy now, pay later payment method used in Australia, Canada, France, New Zealand, Spain, the UK, and the US."}},"alipay":{"documentation":{"gate_specific":{},"localize_terms":[],"markdown":"[Alipay](/docs/payments/alipay) is a digital wallet payment method used in China.","undocumented":false,"html":"\u003Ca href=\"/docs/payments/alipay\"\u003EAlipay\u003C/a\u003E is a digital wallet payment method used in China."}},"au_becs_debit":{"documentation":{"gate_specific":{},"localize_terms":[],"markdown":"[BECS Direct Debit](/docs/payments/au-becs-debit) is used to debit Australian bank accounts through the Bulk Electronic Clearing System (BECS).","undocumented":false,"html":"\u003Ca href=\"/docs/payments/au-becs-debit\"\u003EBECS Direct Debit\u003C/a\u003E is used to debit Australian bank accounts through the Bulk Electronic Clearing System (BECS)."}},"bacs_debit":{"documentation":{"gate_specific":{},"localize_terms":[],"markdown":"[Bacs Direct Debit](/docs/payments/payment-methods/bacs-debit) is used to debit UK bank accounts.","undocumented":false,"html":"\u003Ca href=\"/docs/payments/payment-methods/bacs-debit\"\u003EBacs Direct Debit\u003C/a\u003E is used to debit UK bank accounts."}},"bancontact":{"documentation":{"gate_specific":{},"localize_terms":[],"markdown":"[Bancontact](/docs/payments/bancontact) is a bank redirect payment method used in Belgium.","undocumented":false,"html":"\u003Ca href=\"/docs/payments/bancontact\"\u003EBancontact\u003C/a\u003E is a bank redirect payment method used in Belgium."}},"blik":{"documentation":{"gate_specific":{},"localize_terms":[],"markdown":"[BLIK](/docs/payments/blik) is a single-use payment method common in Poland.","undocumented":false,"html":"\u003Ca href=\"/docs/payments/blik\"\u003EBLIK\u003C/a\u003E is a single-use payment method common in Poland."}},"boleto":{"documentation":{"gate_specific":{},"localize_terms":[],"markdown":"[Boleto](/docs/payments/boleto) is a voucher-based payment method used in Brazil.","undocumented":false,"html":"\u003Ca href=\"/docs/payments/boleto\"\u003EBoleto\u003C/a\u003E is a voucher-based payment method used in Brazil."}},"card":{"documentation":{"gate_specific":{},"localize_terms":[],"markdown":"[Card payments](/docs/payments/payment-methods/overview#cards) are supported through many networks and card brands.","undocumented":false,"html":"\u003Ca href=\"/docs/payments/payment-methods/overview#cards\"\u003ECard payments\u003C/a\u003E are supported through many networks and card brands."}},"card_present":{"documentation":{"gate_specific":{},"localize_terms":[],"markdown":"[Stripe Terminal](/docs/terminal/payments/collect-payment) is used to collect in-person card payments.","undocumented":false,"html":"\u003Ca href=\"/docs/terminal/payments/collect-payment\"\u003EStripe Terminal\u003C/a\u003E is used to collect in-person card payments."}},"customer_balance":{"documentation":{"gate_specific":{},"localize_terms":[],"markdown":"Uses a customer’s [cash balance](/docs/payments/customer-balance) for the payment.","undocumented":false,"html":"Uses a customer’s \u003Ca href=\"/docs/payments/customer-balance\"\u003Ecash balance\u003C/a\u003E for the payment."}},"eps":{"documentation":{"gate_specific":{},"localize_terms":[],"markdown":"[EPS](/docs/payments/eps) is an Austria-based bank redirect payment method.","undocumented":false,"html":"\u003Ca href=\"/docs/payments/eps\"\u003EEPS\u003C/a\u003E is an Austria-based bank redirect payment method."}},"fpx":{"documentation":{"gate_specific":{},"localize_terms":[],"markdown":"[FPX](/docs/payments/fpx) is a Malaysia-based bank redirect payment method.","undocumented":false,"html":"\u003Ca href=\"/docs/payments/fpx\"\u003EFPX\u003C/a\u003E is a Malaysia-based bank redirect payment method."}},"giropay":{"documentation":{"gate_specific":{},"localize_terms":[],"markdown":"[giropay](/docs/payments/giropay) is a German bank redirect payment method.","undocumented":false,"html":"\u003Ca href=\"/docs/payments/giropay\"\u003Egiropay\u003C/a\u003E is a German bank redirect payment method."}},"grabpay":{"documentation":{"gate_specific":{},"localize_terms":[],"markdown":"[GrabPay](/docs/payments/grabpay) is a digital wallet payment method used in Southeast Asia.","undocumented":false,"html":"\u003Ca href=\"/docs/payments/grabpay\"\u003EGrabPay\u003C/a\u003E is a digital wallet payment method used in Southeast Asia."}},"ideal":{"documentation":{"gate_specific":{},"localize_terms":[],"markdown":"[iDEAL](/docs/payments/ideal) is a Netherlands-based bank redirect payment method.","undocumented":false,"html":"\u003Ca href=\"/docs/payments/ideal\"\u003EiDEAL\u003C/a\u003E is a Netherlands-based bank redirect payment method."}},"interac_present":{"documentation":{"gate_specific":{},"localize_terms":[],"markdown":"[Stripe Terminal](/docs/terminal/payments/collect-payment) accepts [Interac](/docs/terminal/payments/regional?integration-country=CA#interac-payments) debit cards for in-person payments in Canada.","undocumented":false,"html":"\u003Ca href=\"/docs/terminal/payments/collect-payment\"\u003EStripe Terminal\u003C/a\u003E accepts \u003Ca href=\"/docs/terminal/payments/regional?integration-country=CA#interac-payments\"\u003EInterac\u003C/a\u003E debit cards for in-person payments in Canada."}},"klarna":{"documentation":{"gate_specific":{},"localize_terms":[],"markdown":"[Klarna](/docs/payments/klarna) is a global buy now, pay later payment method.","undocumented":false,"html":"\u003Ca href=\"/docs/payments/klarna\"\u003EKlarna\u003C/a\u003E is a global buy now, pay later payment method."}},"konbini":{"documentation":{"gate_specific":{},"localize_terms":[],"markdown":"[Konbini](/docs/payments/konbini) is a cash-based voucher payment method used in Japan.","undocumented":false,"html":"\u003Ca href=\"/docs/payments/konbini\"\u003EKonbini\u003C/a\u003E is a cash-based voucher payment method used in Japan."}},"link":{"documentation":{"gate_specific":{},"localize_terms":[],"markdown":"[Link](/docs/payments/link) allows customers to pay with their saved payment details.","undocumented":false,"html":"\u003Ca href=\"/docs/payments/link\"\u003ELink\u003C/a\u003E allows customers to pay with their saved payment details."}},"oxxo":{"documentation":{"gate_specific":{},"localize_terms":[],"markdown":"[OXXO](/docs/payments/oxxo) is a cash-based voucher payment method used in Mexico.","undocumented":false,"html":"\u003Ca href=\"/docs/payments/oxxo\"\u003EOXXO\u003C/a\u003E is a cash-based voucher payment method used in Mexico."}},"p24":{"documentation":{"gate_specific":{},"localize_terms":[],"markdown":"[Przelewy24](/docs/payments/p24) is a bank redirect payment method used in Poland.","undocumented":false,"html":"\u003Ca href=\"/docs/payments/p24\"\u003EPrzelewy24\u003C/a\u003E is a bank redirect payment method used in Poland."}},"paynow":{"documentation":{"gate_specific":{},"localize_terms":[],"markdown":"[PayNow](/docs/payments/paynow) is a QR code payment method used in Singapore.","undocumented":false,"html":"\u003Ca href=\"/docs/payments/paynow\"\u003EPayNow\u003C/a\u003E is a QR code payment method used in Singapore."}},"pix":{"documentation":{"gate_specific":{},"localize_terms":[],"markdown":"[Pix](/docs/payments/pix) is an instant bank transfer payment method in Brazil.","undocumented":false,"html":"\u003Ca href=\"/docs/payments/pix\"\u003EPix\u003C/a\u003E is an instant bank transfer payment method in Brazil."}},"promptpay":{"documentation":{"gate_specific":{},"localize_terms":[],"markdown":"[PromptPay](/docs/payments/promptpay) is an instant funds transfer service popular in Thailand.","undocumented":false,"html":"\u003Ca href=\"/docs/payments/promptpay\"\u003EPromptPay\u003C/a\u003E is an instant funds transfer service popular in Thailand."}},"sepa_debit":{"documentation":{"gate_specific":{},"localize_terms":[],"markdown":"[SEPA Direct Debit](/docs/payments/sepa-debit) is used to debit bank accounts within the Single Euro Payments Area (SEPA) region.","undocumented":false,"html":"\u003Ca href=\"/docs/payments/sepa-debit\"\u003ESEPA Direct Debit\u003C/a\u003E is used to debit bank accounts within the Single Euro Payments Area (SEPA) region."}},"sofort":{"documentation":{"gate_specific":{},"localize_terms":[],"markdown":"[Sofort](/docs/payments/sofort) is a bank redirect payment method used in Europe.","undocumented":false,"html":"\u003Ca href=\"/docs/payments/sofort\"\u003ESofort\u003C/a\u003E is a bank redirect payment method used in Europe."}},"us_bank_account":{"documentation":{"gate_specific":{},"localize_terms":[],"markdown":"[ACH Direct Debit](/docs/payments/ach-debit) is used to debit US bank accounts through the Automated Clearing House (ACH) payments system.","undocumented":false,"html":"\u003Ca href=\"/docs/payments/ach-debit\"\u003EACH Direct Debit\u003C/a\u003E is used to debit US bank accounts through the Automated Clearing House (ACH) payments system."}},"wechat_pay":{"documentation":{"gate_specific":{},"localize_terms":[],"markdown":"[WeChat Pay](/docs/payments/wechat-pay) is a digital wallet payment method based in China.","undocumented":false,"html":"\u003Ca href=\"/docs/payments/wechat-pay\"\u003EWeChat Pay\u003C/a\u003E is a digital wallet payment method based in China."}}},"object_type":"type"},"us_bank_account":{"name":"us_bank_account","check":"hash","validation":"hash","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"If this is an `us_bank_account` PaymentMethod, this hash contains details about the US bank account payment method.","undocumented":false,"html":"If this is an \u003Ccode\u003Eus_bank_account\u003C/code\u003E PaymentMethod, this hash contains details about the US bank account payment method."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"subspec":{"account_holder_type":{"name":"account_holder_type","check":"string","validation":"string","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"Account holder type: individual or company.","undocumented":false,"html":"Account holder type: individual or company."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"enum_values":{"individual":{"documentation":{"gate_specific":{},"localize_terms":[],"markdown":"Account belongs to an individual","undocumented":false,"html":"Account belongs to an individual"}},"company":{"documentation":{"gate_specific":{},"localize_terms":[],"markdown":"Account belongs to a company","undocumented":false,"html":"Account belongs to a company"}}},"object_type":"account_holder_type"},"account_type":{"name":"account_type","check":"string","validation":"string","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"Account type: checkings or savings. Defaults to checking if omitted.","undocumented":false,"html":"Account type: checkings or savings. Defaults to checking if omitted."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"enum_values":{"checking":{"documentation":{"gate_specific":{},"localize_terms":[],"markdown":"Bank account type is checking","undocumented":false,"html":"Bank account type is checking"}},"savings":{"documentation":{"gate_specific":{},"localize_terms":[],"markdown":"Bank account type is savings","undocumented":false,"html":"Bank account type is savings"}}},"object_type":"account_type"},"bank_name":{"name":"bank_name","check":"string","validation":"string","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"The name of the bank.","undocumented":false,"html":"The name of the bank."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"object_type":"bank_name"},"financial_connections_account":{"name":"financial_connections_account","check":"string","validation":"string","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"The ID of the Financial Connections Account used to create the payment method.","undocumented":false,"html":"The ID of the Financial Connections Account used to create the payment method."},"gate":true,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"object_type":"financial_connections_account"},"fingerprint":{"name":"fingerprint","check":"string","validation":"string","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"Uniquely identifies this particular bank account. You can use this attribute to check whether two bank accounts are the same.","undocumented":false,"html":"Uniquely identifies this particular bank account. You can use this attribute to check whether two bank accounts are the same."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"object_type":"fingerprint"},"last4":{"name":"last4","check":"string","validation":"string","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"Last four digits of the bank account number.","undocumented":false,"html":"Last four digits of the bank account number."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"object_type":"last4"},"networks":{"name":"networks","check":"hash","validation":"hash","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"Contains information about US bank account networks that can be used.","undocumented":false,"html":"Contains information about US bank account networks that can be used."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"subspec":{"preferred":{"name":"preferred","check":"string","validation":"string","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"The preferred network.","undocumented":false,"html":"The preferred network."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"object_type":"preferred"},"supported":{"name":"supported","check":"array","validation":"array","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"All supported networks.","undocumented":false,"html":"All supported networks."},"gate":false,"hide_unset_desc":null,"required":true,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"object_type":"supported"}},"object_type":"networks"},"routing_number":{"name":"routing_number","check":"string","validation":"string","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"Routing number of the bank account.","undocumented":false,"html":"Routing number of the bank account."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"object_type":"routing_number"}},"object_type":"us_bank_account","less_common":true},"wechat_pay":{"name":"wechat_pay","check":"hash","validation":"hash","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"If this is an `wechat_pay` PaymentMethod, this hash contains details about the wechat_pay payment method.","undocumented":false,"html":"If this is an \u003Ccode\u003Ewechat_pay\u003C/code\u003E PaymentMethod, this hash contains details about the wechat_pay payment method."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"subspec":{},"object_type":"wechat_pay","less_common":true}},"object_type":"payment_method","less_common":true},"payment_method_type":{"name":"payment_method_type","check":"string","validation":"string","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"If the error is specific to the type of payment method, the payment method type that had a problem. This field is only populated for invoice-related errors.","undocumented":false,"html":"If the error is specific to the type of payment method, the payment method type that had a problem. This field is only populated for invoice-related errors."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"object_type":"payment_method_type","less_common":true}},"object_type":"last_setup_error"},"latest_attempt":{"name":"latest_attempt","check":"string","validation":"string","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"The most recent SetupAttempt for this SetupIntent.\n","undocumented":false,"html":"The most recent SetupAttempt for this SetupIntent."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"user_expandable":["setup_attempt"],"object_type":"latest_attempt","less_common":true},"livemode":{"name":"livemode","check":"boolean","validation":"boolean","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode.","undocumented":false,"html":"Has the value \u003Ccode\u003Etrue\u003C/code\u003E if the object exists in live mode or the value \u003Ccode\u003Efalse\u003C/code\u003E if the object exists in test mode."},"gate":false,"hide_unset_desc":null,"required":true,"default":null,"badge_text":"retrievable with publishable key","requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"object_type":"livemode","less_common":true},"mandate":{"name":"mandate","check":"string","validation":"string","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"ID of the multi use Mandate generated by the SetupIntent.\n","undocumented":false,"html":"ID of the multi use Mandate generated by the SetupIntent."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"user_expandable":["mandate"],"object_type":"mandate","less_common":true},"metadata":{"name":"metadata","check":"hash","validation":"hash","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"Set of [key-value pairs](/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format.","undocumented":false,"html":"Set of \u003Ca href=\"/docs/api/metadata\"\u003Ekey-value pairs\u003C/a\u003E that you can attach to an object. This can be useful for storing additional information about the object in a structured format."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"object_type":"metadata"},"next_action":{"name":"next_action","check":"hash","validation":"hash","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"If present, this property tells you what actions you need to take in order for your customer to continue payment setup.","undocumented":false,"html":"If present, this property tells you what actions you need to take in order for your customer to continue payment setup."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":"retrievable with publishable key","requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"subspec":{"redirect_to_url":{"name":"redirect_to_url","check":"hash","validation":"hash","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"Contains instructions for authenticating a payment by redirecting your customer to another page or application.","undocumented":false,"html":"Contains instructions for authenticating a payment by redirecting your customer to another page or application."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"subspec":{"return_url":{"name":"return_url","check":"string","validation":"string","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"If the customer does not exit their browser while authenticating, they will be redirected to this specified URL after completion.","undocumented":false,"html":"If the customer does not exit their browser while authenticating, they will be redirected to this specified URL after completion."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"object_type":"return_url"},"url":{"name":"url","check":"string","validation":"string","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"The URL you must redirect your customer to in order to authenticate.","undocumented":false,"html":"The URL you must redirect your customer to in order to authenticate."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"object_type":"url"}},"object_type":"redirect_to_url"},"type":{"name":"type","check":"string","validation":"string","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"Type of the next action to perform, one of `redirect_to_url`, `use_stripe_sdk`, `alipay_handle_redirect`, `oxxo_display_details`, or `verify_with_microdeposits`.","undocumented":false,"html":"Type of the next action to perform, one of \u003Ccode\u003Eredirect_to_url\u003C/code\u003E, \u003Ccode\u003Euse_stripe_sdk\u003C/code\u003E, \u003Ccode\u003Ealipay_handle_redirect\u003C/code\u003E, \u003Ccode\u003Eoxxo_display_details\u003C/code\u003E, or \u003Ccode\u003Everify_with_microdeposits\u003C/code\u003E."},"gate":false,"hide_unset_desc":null,"required":true,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"object_type":"type"},"use_stripe_sdk":{"name":"use_stripe_sdk","check":"hash","validation":"hash","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"When confirming a SetupIntent with Stripe.js, Stripe.js depends on the contents of this \u003Ctranslate\u003Edictionary\u003C/translate\u003E to invoke authentication flows. The shape of the contents is subject to change and is only intended to be used by Stripe.js.","undocumented":false,"html":"When confirming a SetupIntent with Stripe.js, Stripe.js depends on the contents of this \u003Ctranslate\u003Edictionary\u003C/translate\u003E to invoke authentication flows. The shape of the contents is subject to change and is only intended to be used by Stripe.js."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"object_type":"use_stripe_sdk"},"verify_with_microdeposits":{"name":"verify_with_microdeposits","check":"hash","validation":"hash","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"Contains details describing microdeposits verification flow.","undocumented":false,"html":"Contains details describing microdeposits verification flow."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"subspec":{"arrival_date":{"name":"arrival_date","check":"timestamp","validation":"timestamp","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"The timestamp when the microdeposits are expected to land.","undocumented":false,"html":"The timestamp when the microdeposits are expected to land."},"gate":false,"hide_unset_desc":null,"required":true,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"object_type":"arrival_date"},"hosted_verification_url":{"name":"hosted_verification_url","check":"string","validation":"string","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"The URL for the hosted verification page, which allows customers to verify their bank account.","undocumented":false,"html":"The URL for the hosted verification page, which allows customers to verify their bank account."},"gate":false,"hide_unset_desc":null,"required":true,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"object_type":"hosted_verification_url"},"microdeposit_type":{"name":"microdeposit_type","check":"string","validation":"string","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"The type of the microdeposit sent to the customer. Used to distinguish between different verification methods.","undocumented":false,"html":"The type of the microdeposit sent to the customer. Used to distinguish between different verification methods."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"enum_values":{"descriptor_code":{"documentation":null},"amounts":{"documentation":null}},"object_type":"microdeposit_type"}},"object_type":"verify_with_microdeposits"}},"object_type":"next_action"},"on_behalf_of":{"name":"on_behalf_of","check":"string","validation":"string","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"The account (if any) for which the setup is intended.\n","undocumented":false,"html":"The account (if any) for which the setup is intended."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":"Connect only","requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"user_expandable":["account"],"object_type":"on_behalf_of","less_common":true},"payment_method":{"name":"payment_method","check":"string","validation":"string","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"ID of the payment method used with this SetupIntent.","undocumented":false,"html":"ID of the payment method used with this SetupIntent."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":"retrievable with publishable key","requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"user_expandable":["payment_method"],"object_type":"payment_method"},"payment_method_options":{"name":"payment_method_options","check":"hash","validation":"hash","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"Payment-method-specific configuration for this SetupIntent.","undocumented":false,"html":"Payment-method-specific configuration for this SetupIntent."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"subspec":{"acss_debit":{"name":"acss_debit","check":"hash","validation":"hash","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"If the SetupIntent's payment_method_types includes `acss_debit`, this hash contains the configurations that will be applied to each setup attempt of that type.\n","undocumented":false,"html":"If the SetupIntent’s payment_method_types includes \u003Ccode\u003Eacss_debit\u003C/code\u003E, this hash contains the configurations that will be applied to each setup attempt of that type."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"subspec":{"currency":{"name":"currency","check":"string","validation":"string","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"Currency supported by the bank account","undocumented":false,"html":"Currency supported by the bank account"},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"enum_values":{"cad":{"documentation":{"gate_specific":{},"localize_terms":[],"markdown":"Canadian dollars","undocumented":false,"html":"Canadian dollars"}},"usd":{"documentation":{"gate_specific":{},"localize_terms":[],"markdown":"US dollars","undocumented":false,"html":"US dollars"}}},"object_type":"currency"},"mandate_options":{"name":"mandate_options","check":"hash","validation":"hash","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"Additional fields for Mandate creation","undocumented":false,"html":"Additional fields for Mandate creation"},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"subspec":{"custom_mandate_url":{"name":"custom_mandate_url","check":"string","validation":"string","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"A URL for custom mandate text","undocumented":false,"html":"A URL for custom mandate text"},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"object_type":"custom_mandate_url"},"default_for":{"name":"default_for","check":"array","validation":"array","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"List of Stripe products where this mandate can be selected automatically.","undocumented":false,"html":"List of Stripe products where this mandate can be selected automatically."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"enum_values":{"invoice":{"documentation":{"gate_specific":{},"localize_terms":[],"markdown":"Enables payments for Stripe Invoices. 'subscription' must also be provided.","undocumented":false,"html":"Enables payments for Stripe Invoices. ‘subscription’ must also be provided."}},"subscription":{"documentation":{"gate_specific":{},"localize_terms":[],"markdown":"Enables payments for Stripe Subscriptions. 'invoice' must also be provided.","undocumented":false,"html":"Enables payments for Stripe Subscriptions. ‘invoice’ must also be provided."}}},"object_type":"default_for"},"interval_description":{"name":"interval_description","check":"string","validation":"string","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"Description of the interval. Only required if the 'payment_schedule' parameter is 'interval' or 'combined'.","undocumented":false,"html":"Description of the interval. Only required if the ‘payment_schedule’ parameter is ‘interval’ or ‘combined’."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"object_type":"interval_description"},"payment_schedule":{"name":"payment_schedule","check":"string","validation":"string","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"Payment schedule for the mandate.","undocumented":false,"html":"Payment schedule for the mandate."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"enum_values":{"interval":{"documentation":{"gate_specific":{},"localize_terms":[],"markdown":"Payments are initiated at a regular pre-defined interval","undocumented":false,"html":"Payments are initiated at a regular pre-defined interval"}},"sporadic":{"documentation":{"gate_specific":{},"localize_terms":[],"markdown":"Payments are initiated sporadically","undocumented":false,"html":"Payments are initiated sporadically"}},"combined":{"documentation":{"gate_specific":{},"localize_terms":[],"markdown":"Payments can be initiated at a pre-defined interval or sporadically","undocumented":false,"html":"Payments can be initiated at a pre-defined interval or sporadically"}}},"object_type":"payment_schedule"},"transaction_type":{"name":"transaction_type","check":"string","validation":"string","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"Transaction type of the mandate.","undocumented":false,"html":"Transaction type of the mandate."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"enum_values":{"personal":{"documentation":{"gate_specific":{},"localize_terms":[],"markdown":"Transactions are made for personal reasons","undocumented":false,"html":"Transactions are made for personal reasons"}},"business":{"documentation":{"gate_specific":{},"localize_terms":[],"markdown":"Transactions are made for business reasons","undocumented":false,"html":"Transactions are made for business reasons"}}},"object_type":"transaction_type"}},"object_type":"mandate_options"},"verification_method":{"name":"verification_method","check":"string","validation":"string","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"Bank account verification method.","undocumented":false,"html":"Bank account verification method."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"enum_values":{"automatic":{"documentation":{"gate_specific":{},"localize_terms":[],"markdown":"Instant verification with fallback to microdeposits.","undocumented":false,"html":"Instant verification with fallback to microdeposits."}},"instant":{"documentation":{"gate_specific":{},"localize_terms":[],"markdown":"Instant verification.","undocumented":false,"html":"Instant verification."}},"microdeposits":{"documentation":{"gate_specific":{},"localize_terms":[],"markdown":"Verification using microdeposits.","undocumented":false,"html":"Verification using microdeposits."}}},"object_type":"verification_method"}},"object_type":"acss_debit"},"blik":{"name":"blik","check":"hash","validation":"hash","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"If the SetupIntent's payment_method_types includes `blik`, this hash contains the configurations that will be applied to each setup attempt of that type.\n","undocumented":false,"html":"If the SetupIntent’s payment_method_types includes \u003Ccode\u003Eblik\u003C/code\u003E, this hash contains the configurations that will be applied to each setup attempt of that type."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"subspec":{"mandate_options":{"name":"mandate_options","check":"hash","validation":"hash","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"Details of the reusable mandate.","undocumented":false,"html":"Details of the reusable mandate."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"subspec":{"expires_after":{"name":"expires_after","check":"timestamp","validation":"timestamp","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"Date at which the mandate expires.","undocumented":false,"html":"Date at which the mandate expires."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"object_type":"expires_after"},"off_session":{"name":"off_session","check":"hash","validation":"hash","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"Details for off-session mandates.","undocumented":false,"html":"Details for off-session mandates."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"subspec":{"amount":{"name":"amount","check":"integer","validation":"integer","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"Amount of each recurring payment.","undocumented":false,"html":"Amount of each recurring payment."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"object_type":"amount"},"currency":{"name":"currency","check":"string","validation":"string","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"Currency of each recurring payment.","undocumented":false,"html":"Currency of each recurring payment."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"object_type":"currency"},"interval":{"name":"interval","check":"string","validation":"string","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"Frequency interval of each recurring payment.","undocumented":false,"html":"Frequency interval of each recurring payment."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"enum_values":{"day":{"documentation":{"gate_specific":{},"localize_terms":[],"markdown":"Payments recur every day.","undocumented":false,"html":"Payments recur every day."}},"week":{"documentation":{"gate_specific":{},"localize_terms":[],"markdown":"Payments recur every week.","undocumented":false,"html":"Payments recur every week."}},"month":{"documentation":{"gate_specific":{},"localize_terms":[],"markdown":"Payments recur every month.","undocumented":false,"html":"Payments recur every month."}},"year":{"documentation":{"gate_specific":{},"localize_terms":[],"markdown":"Payments recur every year.","undocumented":false,"html":"Payments recur every year."}}},"object_type":"interval"},"interval_count":{"name":"interval_count","check":"integer","validation":"integer","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"Frequency indicator of each recurring payment.","undocumented":false,"html":"Frequency indicator of each recurring payment."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"object_type":"interval_count"}},"object_type":"off_session"},"type":{"name":"type","check":"string","validation":"string","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"Type of the mandate.","undocumented":false,"html":"Type of the mandate."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"enum_values":{"on_session":{"documentation":{"gate_specific":{},"localize_terms":[],"markdown":"Mandate for on-session payments.","undocumented":false,"html":"Mandate for on-session payments."}},"off_session":{"documentation":{"gate_specific":{},"localize_terms":[],"markdown":"Mandate for off-session payments.","undocumented":false,"html":"Mandate for off-session payments."}}},"object_type":"type"}},"object_type":"mandate_options"}},"object_type":"blik"},"card":{"name":"card","check":"hash","validation":"hash","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"If the SetupIntent's payment_method_types includes `card`, this hash contains the configurations that will be applied to each setup attempt of that type.\n","undocumented":false,"html":"If the SetupIntent’s payment_method_types includes \u003Ccode\u003Ecard\u003C/code\u003E, this hash contains the configurations that will be applied to each setup attempt of that type."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"subspec":{"mandate_options":{"name":"mandate_options","check":"hash","validation":"hash","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"Configuration options for setting up an eMandate for cards issued in India.","undocumented":false,"html":"Configuration options for setting up an eMandate for cards issued in India."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"subspec":{"amount":{"name":"amount","check":"positive_integer","validation":"positive integer","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"Amount to be charged for future payments.","undocumented":false,"html":"Amount to be charged for future payments."},"gate":false,"hide_unset_desc":null,"required":true,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"object_type":"amount"},"amount_type":{"name":"amount_type","check":"string","validation":"string","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"One of `fixed` or `maximum`. If `fixed`, the `amount` param refers to the exact amount to be charged in future payments. If `maximum`, the amount charged can be up to the value passed for the `amount` param.\n","undocumented":false,"html":"One of \u003Ccode\u003Efixed\u003C/code\u003E or \u003Ccode\u003Emaximum\u003C/code\u003E. If \u003Ccode\u003Efixed\u003C/code\u003E, the \u003Ccode\u003Eamount\u003C/code\u003E param refers to the exact amount to be charged in future payments. If \u003Ccode\u003Emaximum\u003C/code\u003E, the amount charged can be up to the value passed for the \u003Ccode\u003Eamount\u003C/code\u003E param."},"gate":false,"hide_unset_desc":null,"required":true,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"object_type":"amount_type"},"currency":{"name":"currency","check":"currency","validation":"currency","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. Must be a [supported currency](https://stripe.com/docs/currencies).","undocumented":false,"html":"Three-letter \u003Ca href=\"https://www.iso.org/iso-4217-currency-codes.html\"\u003EISO currency code\u003C/a\u003E, in lowercase. Must be a \u003Ca href=\"https://stripe.com/docs/currencies\"\u003Esupported currency\u003C/a\u003E."},"gate":false,"hide_unset_desc":null,"required":true,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"object_type":"currency"},"description":{"name":"description","check":"string","validation":"string","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"A description of the mandate or subscription that is meant to be displayed to the customer.","undocumented":false,"html":"A description of the mandate or subscription that is meant to be displayed to the customer."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"object_type":"description"},"end_date":{"name":"end_date","check":"timestamp","validation":"timestamp","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"End date of the mandate or subscription. If not provided, the mandate will be active until canceled. If provided, end date should be after start date.\n","undocumented":false,"html":"End date of the mandate or subscription. If not provided, the mandate will be active until canceled. If provided, end date should be after start date."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"object_type":"end_date"},"interval":{"name":"interval","check":"string","validation":"string","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"Specifies payment frequency. One of `day`, `week`, `month`, `year`, or `sporadic`.\n","undocumented":false,"html":"Specifies payment frequency. One of \u003Ccode\u003Eday\u003C/code\u003E, \u003Ccode\u003Eweek\u003C/code\u003E, \u003Ccode\u003Emonth\u003C/code\u003E, \u003Ccode\u003Eyear\u003C/code\u003E, or \u003Ccode\u003Esporadic\u003C/code\u003E."},"gate":false,"hide_unset_desc":null,"required":true,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"object_type":"interval"},"interval_count":{"name":"interval_count","check":"positive_integer","validation":"positive integer","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"The number of intervals between payments. For example, `interval=month` and `interval_count=3` indicates one payment every three months. Maximum of one year interval allowed (1 year, 12 months, or 52 weeks). This parameter is optional when `interval=sporadic`.\n","undocumented":false,"html":"The number of intervals between payments. For example, \u003Ccode\u003Einterval=month\u003C/code\u003E and \u003Ccode\u003Einterval_count=3\u003C/code\u003E indicates one payment every three months. Maximum of one year interval allowed (1 year, 12 months, or 52 weeks). This parameter is optional when \u003Ccode\u003Einterval=sporadic\u003C/code\u003E."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"object_type":"interval_count"},"reference":{"name":"reference","check":"string","validation":"string","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"Unique identifier for the mandate or subscription.","undocumented":false,"html":"Unique identifier for the mandate or subscription."},"gate":false,"hide_unset_desc":null,"required":true,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"object_type":"reference"},"start_date":{"name":"start_date","check":"timestamp","validation":"timestamp","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"Start date of the mandate or subscription. Start date should not be lesser than yesterday.\n","undocumented":false,"html":"Start date of the mandate or subscription. Start date should not be lesser than yesterday."},"gate":false,"hide_unset_desc":null,"required":true,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"object_type":"start_date"},"supported_types":{"name":"supported_types","check":"array","validation":"array","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"Specifies the type of mandates supported. Possible values are `india`.\n","undocumented":false,"html":"Specifies the type of mandates supported. Possible values are \u003Ccode\u003Eindia\u003C/code\u003E."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"object_type":"supported_types"}},"object_type":"mandate_options"},"network":{"name":"network","check":"string","validation":"string","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"Selected network to process this SetupIntent on. Depends on the available networks of the card attached to the setup intent. Can be only set confirm-time.","undocumented":false,"html":"Selected network to process this SetupIntent on. Depends on the available networks of the card attached to the setup intent. Can be only set confirm-time."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"object_type":"network"},"request_three_d_secure":{"name":"request_three_d_secure","check":"string","validation":"string","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"We strongly recommend that you rely on our SCA Engine to automatically prompt your customers for authentication based on risk level and [other requirements](/docs/strong-customer-authentication). However, if you wish to request 3D Secure based on logic from your own fraud engine, provide this option. Permitted values include: `automatic` or `any`. If not provided, defaults to `automatic`. Read our guide on [manually requesting 3D Secure](/docs/payments/3d-secure#manual-three-ds) for more information on how this configuration interacts with Radar and our SCA Engine.","undocumented":false,"html":"We strongly recommend that you rely on our SCA Engine to automatically prompt your customers for authentication based on risk level and \u003Ca href=\"/docs/strong-customer-authentication\"\u003Eother requirements\u003C/a\u003E. However, if you wish to request 3D Secure based on logic from your own fraud engine, provide this option. Permitted values include: \u003Ccode\u003Eautomatic\u003C/code\u003E or \u003Ccode\u003Eany\u003C/code\u003E. If not provided, defaults to \u003Ccode\u003Eautomatic\u003C/code\u003E. Read our guide on \u003Ca href=\"/docs/payments/3d-secure#manual-three-ds\"\u003Emanually requesting 3D Secure\u003C/a\u003E for more information on how this configuration interacts with Radar and our SCA Engine."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":"advanced","requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"object_type":"request_three_d_secure"}},"object_type":"card"},"link":{"name":"link","check":"hash","validation":"hash","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"If the SetupIntent's payment_method_types includes `link`, this hash contains the configurations that will be applied to each setup attempt of that type.\n","undocumented":false,"html":"If the SetupIntent’s payment_method_types includes \u003Ccode\u003Elink\u003C/code\u003E, this hash contains the configurations that will be applied to each setup attempt of that type."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"subspec":{"persistent_token":{"name":"persistent_token","check":"string","validation":"string","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"Token used for persistent Link logins.","undocumented":false,"html":"Token used for persistent Link logins."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"object_type":"persistent_token"}},"object_type":"link"},"sepa_debit":{"name":"sepa_debit","check":"hash","validation":"hash","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"If the SetupIntent's payment_method_types includes `sepa_debit`, this hash contains the configurations that will be applied to each setup attempt of that type.\n","undocumented":false,"html":"If the SetupIntent’s payment_method_types includes \u003Ccode\u003Esepa_debit\u003C/code\u003E, this hash contains the configurations that will be applied to each setup attempt of that type."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"subspec":{"mandate_options":{"name":"mandate_options","check":"hash","validation":"hash","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"Additional fields for Mandate creation","undocumented":false,"html":"Additional fields for Mandate creation"},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"subspec":{},"object_type":"mandate_options"}},"object_type":"sepa_debit"},"us_bank_account":{"name":"us_bank_account","check":"hash","validation":"hash","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"If the SetupIntent's payment_method_types includes `us_bank_account`, this hash contains the configurations that will be applied to each setup attempt of that type.\n","undocumented":false,"html":"If the SetupIntent’s payment_method_types includes \u003Ccode\u003Eus_bank_account\u003C/code\u003E, this hash contains the configurations that will be applied to each setup attempt of that type."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"subspec":{"financial_connections":{"name":"financial_connections","check":"hash","validation":"hash","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"Additional fields for Financial Connections Session creation","undocumented":false,"html":"Additional fields for Financial Connections Session creation"},"gate":true,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"subspec":{"permissions":{"name":"permissions","check":"array","validation":"array","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"The list of permissions to request. The `payment_method` permission must be included.","undocumented":false,"html":"The list of permissions to request. The \u003Ccode\u003Epayment_method\u003C/code\u003E permission must be included."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"enum_values":{"payment_method":{"documentation":{"gate_specific":{},"localize_terms":[],"markdown":"Allows the creation of a payment method from the account.","undocumented":false,"html":"Allows the creation of a payment method from the account."}},"balances":{"documentation":{"gate_specific":{},"localize_terms":[],"markdown":"Allows accessing balance data from the account.","undocumented":false,"html":"Allows accessing balance data from the account."}},"transactions":{"documentation":{"gate_specific":{},"localize_terms":[],"markdown":"Allows accessing transactions data from the account.","undocumented":false,"html":"Allows accessing transactions data from the account."}},"ownership":{"documentation":{"gate_specific":{},"localize_terms":[],"markdown":"Allows accessing ownership data from the account.","undocumented":false,"html":"Allows accessing ownership data from the account."}}},"object_type":"permissions"}},"object_type":"financial_connections"},"verification_method":{"name":"verification_method","check":"string","validation":"string","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"Bank account verification method.","undocumented":false,"html":"Bank account verification method."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"enum_values":{"automatic":{"documentation":{"gate_specific":{},"localize_terms":[],"markdown":"Instant verification with fallback to microdeposits.","undocumented":false,"html":"Instant verification with fallback to microdeposits."}},"instant":{"documentation":{"gate_specific":{},"localize_terms":[],"markdown":"Instant verification only.","undocumented":false,"html":"Instant verification only."}},"microdeposits":{"documentation":{"gate_specific":{},"localize_terms":[],"markdown":"Verification using microdeposits. Cannot be used with Stripe Checkout or Hosted Invoices.","undocumented":false,"html":"Verification using microdeposits. Cannot be used with Stripe Checkout or Hosted Invoices."}}},"object_type":"verification_method"}},"object_type":"us_bank_account"}},"object_type":"payment_method_options","less_common":true},"payment_method_types":{"name":"payment_method_types","check":"string_array","validation":"array containing strings","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"The list of payment method types (e.g. card) that this SetupIntent is allowed to set up.","undocumented":false,"html":"The list of payment method types (e.g. card) that this SetupIntent is allowed to set up."},"gate":false,"hide_unset_desc":null,"required":true,"default":null,"badge_text":"retrievable with publishable key","requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"object_type":"payment_method_types"},"single_use_mandate":{"name":"single_use_mandate","check":"string","validation":"string","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"ID of the single_use Mandate generated by the SetupIntent.\n","undocumented":false,"html":"ID of the single_use Mandate generated by the SetupIntent."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"user_expandable":["mandate"],"object_type":"single_use_mandate","less_common":true},"status":{"name":"status","check":"string","validation":"string","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"[Status](/docs/payments/intents#intent-statuses) of this SetupIntent, one of `requires_payment_method`, `requires_confirmation`, `requires_action`, `processing`, `canceled`, or `succeeded`. ","undocumented":false,"html":"\u003Ca href=\"/docs/payments/intents#intent-statuses\"\u003EStatus\u003C/a\u003E of this SetupIntent, one of \u003Ccode\u003Erequires_payment_method\u003C/code\u003E, \u003Ccode\u003Erequires_confirmation\u003C/code\u003E, \u003Ccode\u003Erequires_action\u003C/code\u003E, \u003Ccode\u003Eprocessing\u003C/code\u003E, \u003Ccode\u003Ecanceled\u003C/code\u003E, or \u003Ccode\u003Esucceeded\u003C/code\u003E. "},"gate":false,"hide_unset_desc":null,"required":true,"default":null,"badge_text":"retrievable with publishable key","requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"object_type":"status"},"usage":{"name":"usage","check":"string","validation":"string","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"Indicates how the payment method is intended to be used in the future.\n\nUse `on_session` if you intend to only reuse the payment method when the customer is in your checkout flow. Use `off_session` if your customer may or may not be in your checkout flow. If not provided, this value defaults to `off_session`.\n","undocumented":false,"html":"Indicates how the payment method is intended to be used in the future.\u003C/p\u003E\n\n\u003Cp\u003EUse \u003Ccode\u003Eon_session\u003C/code\u003E if you intend to only reuse the payment method when the customer is in your checkout flow. Use \u003Ccode\u003Eoff_session\u003C/code\u003E if your customer may or may not be in your checkout flow. If not provided, this value defaults to \u003Ccode\u003Eoff_session\u003C/code\u003E."},"gate":false,"hide_unset_desc":null,"required":true,"default":null,"badge_text":"retrievable with publishable key","requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"object_type":"usage"}}},"source":{"name":"source","check":"hash","validation":"hash","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"The source object for errors returned on a request involving a source.","undocumented":false,"html":"The source object for errors returned on a request involving a source."},"gate":false,"hide_unset_desc":null,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"includable":null,"object_type":"source","less_common":true}},"status_codes":{"200 - OK":"Everything worked as expected.","400 - Bad Request":"The request was unacceptable, often due to missing a required\n parameter.","401 - Unauthorized":"No valid API key provided.","402 - Request Failed":"The parameters were valid but the request failed.","403 - Forbidden":"The API key doesn't have permissions to perform the request.","404 - Not Found":"The requested resource doesn't exist.","409 - Conflict":"The request conflicts with another request (perhaps due to\n using the same idempotent key).","429 - Too Many Requests":"Too many requests hit the API too quickly. We recommend an\n exponential backoff of your requests.","500, 502, 503, 504 - Server Errors":"Something went wrong on Stripe's end. (These are rare.)"},"error_types":{"api_error":"API errors cover any other type of problem (e.g., a temporary\n problem with Stripe's servers), and are extremely\n uncommon.","card_error":"Card errors are the most common type of error you should\n expect to handle. They result when the user enters a card that\n can't be charged for some reason.","idempotency_error":"Idempotency errors occur when an `Idempotency-Key`\n is re-used on a request that does not match the first request's\n API endpoint and parameters.","invalid_request_error":"Invalid request errors arise when your request has invalid\n parameters."},"section_type":"override","section_tag":"errors","version":null}},"error_handling":{"title":"Handling errors","group_title":"Topics","group_anchor":"topics","anchor":"error_handling","section_anchor":"errors","subsection_anchors":null,"path":"/errors/handling","gate":false,"display_on_load":true,"data":{"catching_errors":"# Select a client library to see examples of handling different kinds of errors.","section_type":"override","section_tag":"error_handling","version":null}},"expanding_objects":{"title":"Expanding Responses","group_title":"Topics","group_anchor":"topics","anchor":"expanding_objects","section_anchor":"expanding_objects","subsection_anchors":[],"path":"/expanding_objects","gate":false,"display_on_load":true,"data":{"request":"curl https://api.stripe.com/v1/charges/ch_3Mik892eZvKYlo2C1PpFTUfK \\\n -u sk_test_4eC39HqLyjWDarjtT1zdp7dc: \\\n -d \"expand[]\"=customer \\\n -d \"expand[]\"=\"invoice.subscription\" \\\n -G \n","response":"{\n \"id\": \"ch_3Mik892eZvKYlo2C1PpFTUfK\",\n \"object\": \"charge\",\n \"customer\": {\n \"id\": \"cu_14HOtK2eZvKYlo2CPM0hlYU6\",\n \"object\": \"customer\",\n ...\n },\n \"invoice\": {\n \"id\": \"in_1Mik892eZvKYlo2C6e4R3n4D\",\n \"object\": \"invoice\",\n \"subscription\": {\n \"id\": \"su_1MihCv2eZvKYlo2Cu6plHncm\",\n \"object\": \"subscription\",\n ...\n },\n ...\n },\n ...\n}\n","section_type":"override","section_tag":"expanding_objects","version":null}},"idempotent_requests":{"title":"Idempotent Requests","group_title":"Topics","group_anchor":"topics","anchor":"idempotent_requests","section_anchor":"idempotent_requests","subsection_anchors":[],"path":"/idempotent_requests","gate":false,"display_on_load":true,"data":{"request":"curl https://api.stripe.com/v1/charges \\\n -u sk_test_4eC39HqLyjWDarjtT1zdp7dc: \\\n -H \"Idempotency-Key: ouFLBvhzM9XtR0C0\" \\\n -d amount=2000 \\\n -d currency=usd \\\n -d description=\"My First Test Charge (created for API docs at https://www.stripe.com/docs/api)\" \\\n -d source=tok_amex\n","section_type":"override","section_tag":"idempotent_requests","version":null}},"metadata":{"title":"Metadata","group_title":"Topics","group_anchor":"topics","anchor":"metadata","section_anchor":"metadata","subsection_anchors":[],"path":"/metadata","gate":false,"display_on_load":true,"data":{"max_metadata_hash_length":50,"max_metadata_key_length":40,"max_metadata_val_length":500,"request":"curl https://api.stripe.com/v1/charges \\\n -u sk_test_4eC39HqLyjWDarjtT1zdp7dc: \\\n -d amount=2000 \\\n -d currency=usd \\\n -d source=tok_visa \\\n -d \"metadata[order_id]\"=6735\n","response":"{\n \"id\": \"ch_3Mik892eZvKYlo2C1PpFTUfK\",\n \"object\": \"charge\",\n \"amount\": 100,\n \"amount_captured\": 0,\n \"amount_refunded\": 0,\n \"application\": null,\n \"application_fee\": null,\n \"application_fee_amount\": null,\n \"balance_transaction\": \"txn_1032HU2eZvKYlo2CEPtcnUvl\",\n \"billing_details\": {\n \"address\": {\n \"city\": null,\n \"country\": null,\n \"line1\": null,\n \"line2\": null,\n \"postal_code\": null,\n \"state\": null\n },\n \"email\": null,\n \"name\": \"Jenny Rosen\",\n \"phone\": null\n },\n \"calculated_statement_descriptor\": null,\n \"captured\": false,\n \"created\": 1678132533,\n \"currency\": \"usd\",\n \"customer\": null,\n \"description\": \"My First Test Charge (created for API docs)\",\n \"disputed\": false,\n \"failure_balance_transaction\": null,\n \"failure_code\": null,\n \"failure_message\": null,\n \"fraud_details\": {\n },\n \"invoice\": null,\n \"livemode\": false,\n \"metadata\": {\n \"order_id\": \"6735\"\n },\n \"on_behalf_of\": null,\n \"outcome\": null,\n \"paid\": true,\n \"payment_intent\": null,\n \"payment_method\": \"card_19yUNL2eZvKYlo2CNGsN6EWH\",\n \"payment_method_details\": {\n \"card\": {\n \"brand\": \"visa\",\n \"checks\": {\n \"address_line1_check\": null,\n \"address_postal_code_check\": null,\n \"cvc_check\": \"unchecked\"\n },\n \"country\": \"US\",\n \"exp_month\": 12,\n \"exp_year\": 2020,\n \"fingerprint\": \"Xt5EWLLDS7FJjR1c\",\n \"funding\": \"credit\",\n \"installments\": null,\n \"last4\": \"4242\",\n \"mandate\": null,\n \"moto\": null,\n \"network\": \"visa\",\n \"three_d_secure\": null,\n \"wallet\": null\n },\n \"type\": \"card\"\n },\n \"receipt_email\": null,\n \"receipt_number\": null,\n \"receipt_url\": \"https://pay.stripe.com/receipts/payment/CAcaFwoVYWNjdF8xMDMyRDgyZVp2S1lsbzJDKLWKmaAGMgbi8srRiIc6LBb_Gl7ONY6nM3pN9__h6y8_JcMHRQI4GIqBjXuFW-2D2qAiU4S8k7hU0SQw\",\n \"redaction\": null,\n \"refunded\": false,\n \"refunds\": {\n \"object\": \"list\",\n \"data\": [\n\n ],\n \"has_more\": false,\n \"url\": \"/v1/charges/ch_3Mik892eZvKYlo2C1PpFTUfK/refunds\"\n },\n \"review\": null,\n \"shipping\": null,\n \"source_transfer\": null,\n \"statement_descriptor\": null,\n \"statement_descriptor_suffix\": null,\n \"status\": \"succeeded\",\n \"transfer_data\": null,\n \"transfer_group\": null\n}","section_type":"override","section_tag":"metadata","version":null}},"pagination":{"title":"Pagination","group_title":"Topics","group_anchor":"topics","anchor":"pagination","section_anchor":"pagination","subsection_anchors":["search_pagination","auto_pagination"],"path":"/pagination","gate":false,"display_on_load":true,"data":{"example_auto_pagination":"# The auto-pagination feature is specific to Stripe's\n # libraries and cannot be used directly with curl.\n","request_data":{"test_key":"sk_test_4eC39HqLyjWDarjtT1zdp7dc","action_type":"list","action_name":null,"action_path":null,"resource_name":"customer","parent_resource_name":null,"namespace":null,"test_helper":false,"request_params":{"limit":3},"url_params":{},"overridden_languages":[],"preamble_comment":null},"response":"{\n \"object\": \"list\",\n \"url\": \"/v1/customers\",\n \"has_more\": false,\n \"data\": [\n {\n \"id\": \"cus_4QFOF3xrvBT2nU\",\n \"object\": \"customer\",\n \"address\": {\n \"city\": \"City9debc82d-10b2-42e2-87ec-3316c9e7acc5\",\n \"country\": \"Country2bde78f1-d28b-4c80-8e99-836828661c29\",\n \"line1\": \"Line136e8abc0-92e2-4b91-aa83-b07ee5305ef0\",\n \"line2\": \"Line2139281af-fd20-4e7e-8a99-2a09c32dbe1e\",\n \"postal_code\": \"PostalCode190108c3-177d-4b5c-9c5a-89ef946e36b5\",\n \"state\": \"State8618eae4-ad11-4577-b227-ae6667c2e41e\"\n },\n \"balance\": 0,\n \"created\": 1405641986,\n \"currency\": \"usd\",\n \"default_source\": \"card_14HOtJ2eZvKYlo2CD2lt4r4W\",\n \"delinquent\": false,\n \"description\": \"someone@example.com for Coderwall\",\n \"discount\": null,\n \"email\": \"namee97851f5-1cf1-48f6-b694-497e641661e8@test.com\",\n \"invoice_prefix\": \"93EC0E1\",\n \"invoice_settings\": {\n \"custom_fields\": null,\n \"default_payment_method\": \"pm_1MWFdw2eZvKYlo2CvWcM1Btd\",\n \"footer\": null,\n \"rendering_options\": null\n },\n \"livemode\": false,\n \"metadata\": {\n \"CustomerReferenceId\": \"16527612\",\n \"CustomerReferenceType\": \"reedonline\",\n \"tag-key\": \"tag-value\",\n \"meta-key\": \"meta-value\",\n \"order_id\": \"6735\",\n \"order_id_1\": \"6735\",\n \"email\": \"test@test.com\",\n \"adress\": \"testadress\",\n \"address\": \"testadress\",\n \"Address\": \"testadress\",\n \"order_id2\": \"6735\"\n },\n \"name\": \"namee97851f5-1cf1-48f6-b694-497e641661e8\",\n \"next_invoice_sequence\": 932993,\n \"phone\": null,\n \"preferred_locales\": [\n \n ],\n \"shipping\": null,\n \"tax_exempt\": \"none\",\n \"test_clock\": null\n },\n {...},\n {...}\n ]\n}\n","section_type":"override","section_tag":"pagination","version":null}},"search_pagination":{"title":"Search","group_title":"Topics","group_anchor":"topics","anchor":"search_pagination","section_anchor":"pagination","subsection_anchors":null,"path":"/pagination/search","gate":false,"display_on_load":true,"data":{"section_type":"override","title":"Search customers","description":"Search for customers you’ve previously created using Stripe’s \u003Ca href=\"/docs/search#search-query-language\"\u003ESearch Query Language\u003C/a\u003E.\nDon’t use search in read-after-write flows where strict consistency is necessary. Under normal operating\nconditions, data is searchable in less than a minute. Occasionally, propagation of new or updated data can be up\nto an hour behind during outages. Search functionality is not available to merchants in India.","top_level_changes":[],"changes":{},"version":null,"returns":"A dictionary with a \u003Ccode\u003Edata\u003C/code\u003E property that contains an array of up to \u003Ccode\u003Elimit\u003C/code\u003E customers. If no objects match the\nquery, the resulting array will be empty. See the related guide on \u003Ca href=\"/docs/expand#lists\"\u003Eexpanding properties in lists\u003C/a\u003E.","section_tag":"search_pagination","specs":{"query":{"name":"query","check":null,"validation":"","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"The search query string. See [search query language](/docs/search#search-query-language) and the list of supported [query fields for customers](/docs/search#query-fields-for-customers).","undocumented":false,"html":"The search query string. See \u003Ca href=\"/docs/search#search-query-language\"\u003Esearch query language\u003C/a\u003E and the list of supported \u003Ca href=\"/docs/search#query-fields-for-customers\"\u003Equery fields for customers\u003C/a\u003E."},"gate":false,"hide_unset_desc":false,"required":true,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"deprecated_allow_empty":false,"object_type":"query"},"limit":{"name":"limit","check":null,"validation":"","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 10.","undocumented":false,"html":"A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 10."},"gate":false,"hide_unset_desc":false,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"object_type":"limit"},"page":{"name":"page","check":null,"validation":"","documentation":{"gate_specific":{},"localize_terms":[],"markdown":"A cursor for pagination across multiple pages of results. Don't include this parameter on the first call. Use the next_page value returned in a previous response to request subsequent results.","undocumented":false,"html":"A cursor for pagination across multiple pages of results. Don’t include this parameter on the first call. Use the next_page value returned in a previous response to request subsequent results."},"gate":false,"hide_unset_desc":false,"required":false,"default":null,"badge_text":null,"requirement_text":null,"permission":null,"hide_nil":null,"is_country_specific":false,"deprecated_allow_empty":false,"object_type":"page"}},"supported_languages":null,"action":"method","curl_definition":"GET /v1/customers/search","request":"curl https://api.stripe.com/v1/customers/search \\\n -u sk_test_4eC39HqLyjWDarjtT1zdp7dc: \\\n --data-urlencode query=\"name:'fakename' AND metadata['foo']:'bar'\" \\\n -G\n","request_data":{"test_key":"sk_test_4eC39HqLyjWDarjtT1zdp7dc","action_type":"custom","action_name":"search","action_path":"search","resource_name":"customer","parent_resource_name":null,"namespace":null,"test_helper":false,"request_params":{"query":"name:'fakename' AND metadata['foo']:'bar'"},"url_params":{},"overridden_languages":["curl","java","go"],"preamble_comment":null},"response":"{\n \"object\": \"search_result\",\n \"url\": \"/v1/customers/search\",\n \"has_more\": false,\n \"data\": [\n {\n \"id\": \"cus_4QFOF3xrvBT2nU\",\n \"object\": \"customer\",\n \"address\": {\n \"city\": \"City9debc82d-10b2-42e2-87ec-3316c9e7acc5\",\n \"country\": \"Country2bde78f1-d28b-4c80-8e99-836828661c29\",\n \"line1\": \"Line136e8abc0-92e2-4b91-aa83-b07ee5305ef0\",\n \"line2\": \"Line2139281af-fd20-4e7e-8a99-2a09c32dbe1e\",\n \"postal_code\": \"PostalCode190108c3-177d-4b5c-9c5a-89ef946e36b5\",\n \"state\": \"State8618eae4-ad11-4577-b227-ae6667c2e41e\"\n },\n \"balance\": 0,\n \"created\": 1405641986,\n \"currency\": \"usd\",\n \"default_source\": \"card_14HOtJ2eZvKYlo2CD2lt4r4W\",\n \"delinquent\": false,\n \"description\": \"someone@example.com for Coderwall\",\n \"discount\": null,\n \"email\": \"namee97851f5-1cf1-48f6-b694-497e641661e8@test.com\",\n \"invoice_prefix\": \"93EC0E1\",\n \"invoice_settings\": {\n \"custom_fields\": null,\n \"default_payment_method\": \"pm_1MWFdw2eZvKYlo2CvWcM1Btd\",\n \"footer\": null,\n \"rendering_options\": null\n },\n \"livemode\": false,\n \"metadata\": {\n \"foo\": \"bar\"\n },\n \"name\": \"fakename\",\n \"next_invoice_sequence\": 932993,\n \"phone\": null,\n \"preferred_locales\": [\n \n ],\n \"shipping\": null,\n \"tax_exempt\": \"none\",\n \"test_clock\": null\n },\n {...},\n {...}\n ]\n}\n"}},"auto_pagination":{"title":"Auto-pagination","group_title":"Topics","group_anchor":"topics","anchor":"auto_pagination","section_anchor":"pagination","subsection_anchors":null,"path":"/pagination/auto","gate":false,"display_on_load":true,"data":{"request":"# The auto-pagination feature is specific to Stripe's\n # libraries and cannot be used directly with curl.\n","section_type":"override","section_tag":"auto_pagination","version":null}},"request_ids":{"title":"Request IDs","group_title":"Topics","group_anchor":"topics","anchor":"request_ids","section_anchor":"request_ids","subsection_anchors":[],"path":"/request_ids","gate":false,"display_on_load":true,"data":{"request":"curl https://api.stripe.com/v1/customers \\\n -u sk_test_4eC39HqLyjWDarjtT1zdp7dc: \\\n -D \"-\" \\\n -X POST\n","section_type":"override","section_tag":"request_ids","version":null}},"versioning":{"title":"Versioning","group_title":"Topics","group_anchor":"topics","anchor":"versioning","section_anchor":"versioning","subsection_anchors":[],"path":"/versioning","gate":false,"display_on_load":true,"data":{"current_version":"2022-11-15","example_version_on_request":"","merchant":false,"request":"curl https://api.stripe.com/v1/charges \\\n -u sk_test_4eC39HqLyjWDarjtT1zdp7dc: \\\n -H \"Stripe-Version: 2022-11-15\"\n","section_type":"override","section_tag":"versioning","version":null}},"balance":{"title":"Balance","group_title":"Core Resources","group_anchor":"core_resources","anchor":"balance","section_anchor":"balance","subsection_anchors":["balance_object","retrieve_balance"],"path":"/balance","gate":false,"display_on_load":false,"data":{"section_type":"resource","title":"Balance","description":"This is an object representing your Stripe balance. You can retrieve it to see\nthe balance currently on your Stripe account.\n\nYou can also retrieve the balance history, which contains a list of\n[transactions](/docs/reporting/balance-transaction-types) that contributed to the balance\n(charges, payouts, and so forth).\n\nThe available and pending amounts for each currency are broken down further by\npayment source types.\n\nRelated guide: [Understanding Connect Account Balances](/docs/connect/account-balances).\n","section_tag":"balance","subsection_summaries":[{"anchor":"balance_object","curl_definition":null},{"anchor":"retrieve_balance","curl_definition":"GET /v1/balance"}]}},"balance_object":{"title":"The balance object","group_title":"Core Resources","group_anchor":"core_resources","anchor":"balance_object","section_anchor":"balance","subsection_anchors":null,"path":"/balance/balance_object","gate":false,"display_on_load":false},"retrieve_balance":{"title":"Retrieve balance","group_title":"Core Resources","group_anchor":"core_resources","anchor":"retrieve_balance","section_anchor":"balance","subsection_anchors":null,"path":"/balance/balance_retrieve","gate":false,"display_on_load":false},"balance_transactions":{"title":"Balance Transactions","group_title":"Core Resources","group_anchor":"core_resources","anchor":"balance_transactions","section_anchor":"balance_transactions","subsection_anchors":["balance_transaction_object","balance_transaction_retrieve","balance_transaction_list"],"path":"/balance_transactions","gate":false,"display_on_load":false,"data":{"section_type":"resource","title":"Balance Transactions","description":"Balance transactions represent funds moving through your Stripe account.\nThey're created for every type of transaction that comes into or flows out of your Stripe account balance.\n\nRelated guide: [Balance Transaction Types](/docs/reports/balance-transaction-types).\n","section_tag":"balance_transactions","subsection_summaries":[{"anchor":"balance_transaction_object","curl_definition":null},{"anchor":"balance_transaction_retrieve","curl_definition":"GET /v1/balance_transactions/:id"},{"anchor":"balance_transaction_list","curl_definition":"GET /v1/balance_transactions"}]}},"balance_transaction_object":{"title":"The balance transaction object","group_title":"Core Resources","group_anchor":"core_resources","anchor":"balance_transaction_object","section_anchor":"balance_transactions","subsection_anchors":null,"path":"/balance_transactions/object","gate":false,"display_on_load":false},"balance_transaction_retrieve":{"title":"Retrieve a balance transaction","group_title":"Core Resources","group_anchor":"core_resources","anchor":"balance_transaction_retrieve","section_anchor":"balance_transactions","subsection_anchors":null,"path":"/balance_transactions/retrieve","gate":false,"display_on_load":false},"balance_transaction_list":{"title":"List all balance transactions","group_title":"Core Resources","group_anchor":"core_resources","anchor":"balance_transaction_list","section_anchor":"balance_transactions","subsection_anchors":null,"path":"/balance_transactions/list","gate":false,"display_on_load":false},"charges":{"title":"Charges","group_title":"Core Resources","group_anchor":"core_resources","anchor":"charges","section_anchor":"charges","subsection_anchors":["charge_object","create_charge","retrieve_charge","update_charge","capture_charge","list_charges","search_charges"],"path":"/charges","gate":false,"display_on_load":false,"data":{"section_type":"resource","title":"Charges","description":"To charge a credit or a debit card, you create a `Charge` object. You can\nretrieve and refund individual charges as well as list all charges. Charges\nare identified by a unique, random ID.\n\nRelated guide: [Accept a payment with the Charges API](/docs/payments/accept-a-payment-charges).\n","section_tag":"charges","subsection_summaries":[{"anchor":"charge_object","curl_definition":null},{"anchor":"create_charge","curl_definition":"POST /v1/charges"},{"anchor":"retrieve_charge","curl_definition":"GET /v1/charges/:id"},{"anchor":"update_charge","curl_definition":"POST /v1/charges/:id"},{"anchor":"capture_charge","curl_definition":"POST /v1/charges/:id/capture"},{"anchor":"list_charges","curl_definition":"GET /v1/charges"},{"anchor":"search_charges","curl_definition":"GET /v1/charges/search"}]}},"charge_object":{"title":"The charge object","group_title":"Core Resources","group_anchor":"core_resources","anchor":"charge_object","section_anchor":"charges","subsection_anchors":null,"path":"/charges/object","gate":false,"display_on_load":false},"create_charge":{"title":"Create a charge","group_title":"Core Resources","group_anchor":"core_resources","anchor":"create_charge","section_anchor":"charges","subsection_anchors":null,"path":"/charges/create","gate":false,"display_on_load":false},"retrieve_charge":{"title":"Retrieve a charge","group_title":"Core Resources","group_anchor":"core_resources","anchor":"retrieve_charge","section_anchor":"charges","subsection_anchors":null,"path":"/charges/retrieve","gate":false,"display_on_load":false},"update_charge":{"title":"Update a charge","group_title":"Core Resources","group_anchor":"core_resources","anchor":"update_charge","section_anchor":"charges","subsection_anchors":null,"path":"/charges/update","gate":false,"display_on_load":false},"capture_charge":{"title":"Capture a charge","group_title":"Core Resources","group_anchor":"core_resources","anchor":"capture_charge","section_anchor":"charges","subsection_anchors":null,"path":"/charges/capture","gate":false,"display_on_load":false},"list_charges":{"title":"List all charges","group_title":"Core Resources","group_anchor":"core_resources","anchor":"list_charges","section_anchor":"charges","subsection_anchors":null,"path":"/charges/list","gate":false,"display_on_load":false},"search_charges":{"title":"Search charges","group_title":"Core Resources","group_anchor":"core_resources","anchor":"search_charges","section_anchor":"charges","subsection_anchors":null,"path":"/charges/search","gate":false,"display_on_load":false},"customers":{"title":"Customers","group_title":"Core Resources","group_anchor":"core_resources","anchor":"customers","section_anchor":"customers","subsection_anchors":["customer_object","create_customer","retrieve_customer","update_customer","delete_customer","list_customers","search_customers"],"path":"/customers","gate":false,"display_on_load":false,"data":{"section_type":"resource","title":"Customers","description":"This object represents a customer of your business. It lets you create recurring charges and track payments that belong to the same customer.\n\nRelated guide: [Save a card during payment](/docs/payments/save-during-payment).\n","section_tag":"customers","subsection_summaries":[{"anchor":"customer_object","curl_definition":null},{"anchor":"create_customer","curl_definition":"POST /v1/customers"},{"anchor":"retrieve_customer","curl_definition":"GET /v1/customers/:id"},{"anchor":"update_customer","curl_definition":"POST /v1/customers/:id"},{"anchor":"delete_customer","curl_definition":"DELETE /v1/customers/:id"},{"anchor":"list_customers","curl_definition":"GET /v1/customers"},{"anchor":"search_customers","curl_definition":"GET /v1/customers/search"}]}},"customer_object":{"title":"The customer object","group_title":"Core Resources","group_anchor":"core_resources","anchor":"customer_object","section_anchor":"customers","subsection_anchors":null,"path":"/customers/object","gate":false,"display_on_load":false},"create_customer":{"title":"Create a customer","group_title":"Core Resources","group_anchor":"core_resources","anchor":"create_customer","section_anchor":"customers","subsection_anchors":null,"path":"/customers/create","gate":false,"display_on_load":false},"retrieve_customer":{"title":"Retrieve a customer","group_title":"Core Resources","group_anchor":"core_resources","anchor":"retrieve_customer","section_anchor":"customers","subsection_anchors":null,"path":"/customers/retrieve","gate":false,"display_on_load":false},"update_customer":{"title":"Update a customer","group_title":"Core Resources","group_anchor":"core_resources","anchor":"update_customer","section_anchor":"customers","subsection_anchors":null,"path":"/customers/update","gate":false,"display_on_load":false},"delete_customer":{"title":"Delete a customer","group_title":"Core Resources","group_anchor":"core_resources","anchor":"delete_customer","section_anchor":"customers","subsection_anchors":null,"path":"/customers/delete","gate":false,"display_on_load":false},"list_customers":{"title":"List all customers","group_title":"Core Resources","group_anchor":"core_resources","anchor":"list_customers","section_anchor":"customers","subsection_anchors":null,"path":"/customers/list","gate":false,"display_on_load":false},"search_customers":{"title":"Search customers","group_title":"Core Resources","group_anchor":"core_resources","anchor":"search_customers","section_anchor":"customers","subsection_anchors":null,"path":"/customers/search","gate":false,"display_on_load":false},"disputes":{"title":"Disputes","group_title":"Core Resources","group_anchor":"core_resources","anchor":"disputes","section_anchor":"disputes","subsection_anchors":["dispute_object","dispute_evidence_object","retrieve_dispute","update_dispute","close_dispute","list_disputes"],"path":"/disputes","gate":false,"display_on_load":false,"data":{"section_type":"resource","title":"Disputes","description":"A dispute occurs when a customer questions your charge with their card issuer.\nWhen this happens, you're given the opportunity to respond to the dispute with\nevidence that shows that the charge is legitimate. You can find more\ninformation about the dispute process in our [Disputes and\nFraud](/docs/disputes) documentation.\n\nRelated guide: [Disputes and Fraud](/docs/disputes).\n","section_tag":"disputes","subsection_summaries":[{"anchor":"dispute_object","curl_definition":null},{"anchor":"dispute_evidence_object","curl_definition":null},{"anchor":"retrieve_dispute","curl_definition":"GET /v1/disputes/:id"},{"anchor":"update_dispute","curl_definition":"POST /v1/disputes/:id"},{"anchor":"close_dispute","curl_definition":"POST /v1/disputes/:id/close"},{"anchor":"list_disputes","curl_definition":"GET /v1/disputes"}]}},"dispute_object":{"title":"The dispute object","group_title":"Core Resources","group_anchor":"core_resources","anchor":"dispute_object","section_anchor":"disputes","subsection_anchors":null,"path":"/disputes/object","gate":false,"display_on_load":false},"dispute_evidence_object":{"title":"The dispute evidence object","group_title":"Core Resources","group_anchor":"core_resources","anchor":"dispute_evidence_object","section_anchor":"disputes","subsection_anchors":null,"path":"/disputes/evidence_object","gate":false,"display_on_load":false},"retrieve_dispute":{"title":"Retrieve a dispute","group_title":"Core Resources","group_anchor":"core_resources","anchor":"retrieve_dispute","section_anchor":"disputes","subsection_anchors":null,"path":"/disputes/retrieve","gate":false,"display_on_load":false},"update_dispute":{"title":"Update a dispute","group_title":"Core Resources","group_anchor":"core_resources","anchor":"update_dispute","section_anchor":"disputes","subsection_anchors":null,"path":"/disputes/update","gate":false,"display_on_load":false},"close_dispute":{"title":"Close a dispute","group_title":"Core Resources","group_anchor":"core_resources","anchor":"close_dispute","section_anchor":"disputes","subsection_anchors":null,"path":"/disputes/close","gate":false,"display_on_load":false},"list_disputes":{"title":"List all disputes","group_title":"Core Resources","group_anchor":"core_resources","anchor":"list_disputes","section_anchor":"disputes","subsection_anchors":null,"path":"/disputes/list","gate":false,"display_on_load":false},"events":{"title":"Events","group_title":"Core Resources","group_anchor":"core_resources","anchor":"events","section_anchor":"events","subsection_anchors":["event_object","retrieve_event","list_events","event_types"],"path":"/events","gate":false,"display_on_load":false,"data":{"section_type":"resource","title":"Events","description":"Events are our way of letting you know when something interesting happens in\nyour account. When an interesting event occurs, we create a new `Event`\nobject. For example, when a charge succeeds, we create a `charge.succeeded`\nevent; and when an invoice payment attempt fails, we create an\n`invoice.payment_failed` event. Note that many API requests may cause multiple\nevents to be created. For example, if you create a new subscription for a\ncustomer, you will receive both a `customer.subscription.created` event and a\n`charge.succeeded` event.\n\nEvents occur when the state of another API resource changes. The state of that\nresource at the time of the change is embedded in the event's data field. For\nexample, a `charge.succeeded` event will contain a charge, and an\n`invoice.payment_failed` event will contain an invoice.\n\nAs with other API resources, you can use endpoints to retrieve an\n[individual event](#retrieve_event) or a [list of events](#list_events)\nfrom the API. We also have a separate\n[webhooks](http://en.wikipedia.org/wiki/Webhook) system for sending the\n`Event` objects directly to an endpoint on your server. Webhooks are managed\nin your\n[account settings](https://dashboard.stripe.com/account/webhooks),\nand our [Using Webhooks](/docs/webhooks) guide will help you get set up.\n\nWhen using [Connect](/docs/connect), you can also receive notifications of\nevents that occur in connected accounts. For these events, there will be an\nadditional `account` attribute in the received `Event` object.\n\n**NOTE:** Right now, access to events through the [Retrieve Event API](#retrieve_event) is\nguaranteed only for 30 days.\n","section_tag":"events","subsection_summaries":[{"anchor":"event_object","curl_definition":null},{"anchor":"retrieve_event","curl_definition":"GET /v1/events/:id"},{"anchor":"list_events","curl_definition":"GET /v1/events"},{"anchor":"event_types","curl_definition":null}]}},"event_object":{"title":"The event object","group_title":"Core Resources","group_anchor":"core_resources","anchor":"event_object","section_anchor":"events","subsection_anchors":null,"path":"/events/object","gate":false,"display_on_load":false},"retrieve_event":{"title":"Retrieve an event","group_title":"Core Resources","group_anchor":"core_resources","anchor":"retrieve_event","section_anchor":"events","subsection_anchors":null,"path":"/events/retrieve","gate":false,"display_on_load":false},"list_events":{"title":"List all events","group_title":"Core Resources","group_anchor":"core_resources","anchor":"list_events","section_anchor":"events","subsection_anchors":null,"path":"/events/list","gate":false,"display_on_load":false},"event_types":{"title":"Types of events","group_title":"Core Resources","group_anchor":"core_resources","anchor":"event_types","section_anchor":"events","subsection_anchors":null,"path":"/events/types","gate":false,"display_on_load":false},"files":{"title":"Files","group_title":"Core Resources","group_anchor":"core_resources","anchor":"files","section_anchor":"files","subsection_anchors":["file_object","create_file","retrieve_file","list_files"],"path":"/files","gate":false,"display_on_load":false,"data":{"section_type":"resource","title":"Files","description":"This is an object representing a file hosted on Stripe's servers. The\nfile may have been uploaded by yourself using the [create file](#create_file)\nrequest (for example, when uploading dispute evidence) or it may have\nbeen created by Stripe (for example, the results of a [Sigma scheduled\nquery](#scheduled_queries)).\n\nRelated guide: [File Upload Guide](/docs/file-upload).\n","section_tag":"files","subsection_summaries":[{"anchor":"file_object","curl_definition":null},{"anchor":"create_file","curl_definition":"POST https://files.stripe.com/v1/files"},{"anchor":"retrieve_file","curl_definition":"GET /v1/files/:id"},{"anchor":"list_files","curl_definition":"GET /v1/files"}]}},"file_object":{"title":"The file object","group_title":"Core Resources","group_anchor":"core_resources","anchor":"file_object","section_anchor":"files","subsection_anchors":null,"path":"/files/object","gate":false,"display_on_load":false},"create_file":{"title":"Create a file","group_title":"Core Resources","group_anchor":"core_resources","anchor":"create_file","section_anchor":"files","subsection_anchors":null,"path":"/files/create","gate":false,"display_on_load":false},"retrieve_file":{"title":"Retrieve a file","group_title":"Core Resources","group_anchor":"core_resources","anchor":"retrieve_file","section_anchor":"files","subsection_anchors":null,"path":"/files/retrieve","gate":false,"display_on_load":false},"list_files":{"title":"List all files","group_title":"Core Resources","group_anchor":"core_resources","anchor":"list_files","section_anchor":"files","subsection_anchors":null,"path":"/files/list","gate":false,"display_on_load":false},"file_links":{"title":"File Links","group_title":"Core Resources","group_anchor":"core_resources","anchor":"file_links","section_anchor":"file_links","subsection_anchors":["file_link_object","create_file_link","retrieve_file_link","update_file_link","list_file_links"],"path":"/file_links","gate":false,"display_on_load":false,"data":{"section_type":"resource","title":"File Links","description":"To share the contents of a `File` object with non-Stripe users, you can\ncreate a `FileLink`. `FileLink`s contain a URL that can be used to\nretrieve the contents of the file without authentication.\n","section_tag":"file_links","subsection_summaries":[{"anchor":"file_link_object","curl_definition":null},{"anchor":"create_file_link","curl_definition":"POST /v1/file_links"},{"anchor":"retrieve_file_link","curl_definition":"GET /v1/file_links/:id"},{"anchor":"update_file_link","curl_definition":"POST /v1/file_links/:id"},{"anchor":"list_file_links","curl_definition":"GET /v1/file_links"}]}},"file_link_object":{"title":"The file link object","group_title":"Core Resources","group_anchor":"core_resources","anchor":"file_link_object","section_anchor":"file_links","subsection_anchors":null,"path":"/file_links/object","gate":false,"display_on_load":false},"create_file_link":{"title":"Create a file link","group_title":"Core Resources","group_anchor":"core_resources","anchor":"create_file_link","section_anchor":"file_links","subsection_anchors":null,"path":"/file_links/create","gate":false,"display_on_load":false},"retrieve_file_link":{"title":"Retrieve a file link","group_title":"Core Resources","group_anchor":"core_resources","anchor":"retrieve_file_link","section_anchor":"file_links","subsection_anchors":null,"path":"/file_links/retrieve","gate":false,"display_on_load":false},"update_file_link":{"title":"Update a file link","group_title":"Core Resources","group_anchor":"core_resources","anchor":"update_file_link","section_anchor":"file_links","subsection_anchors":null,"path":"/file_links/update","gate":false,"display_on_load":false},"list_file_links":{"title":"List all file links","group_title":"Core Resources","group_anchor":"core_resources","anchor":"list_file_links","section_anchor":"file_links","subsection_anchors":null,"path":"/file_links/list","gate":false,"display_on_load":false},"mandates":{"title":"Mandates","group_title":"Core Resources","group_anchor":"core_resources","anchor":"mandates","section_anchor":"mandates","subsection_anchors":["mandate_object","retrieve_mandate"],"path":"/mandates","gate":false,"display_on_load":false,"data":{"section_type":"resource","title":"Mandates","description":"A Mandate is a record of the permission a customer has given you to debit their payment method.\n","section_tag":"mandates","subsection_summaries":[{"anchor":"mandate_object","curl_definition":null},{"anchor":"retrieve_mandate","curl_definition":"GET /v1/mandates/:id"}]}},"mandate_object":{"title":"The Mandates object","group_title":"Core Resources","group_anchor":"core_resources","anchor":"mandate_object","section_anchor":"mandates","subsection_anchors":null,"path":"/mandates/object","gate":false,"display_on_load":false},"retrieve_mandate":{"title":"Retrieve a Mandate","group_title":"Core Resources","group_anchor":"core_resources","anchor":"retrieve_mandate","section_anchor":"mandates","subsection_anchors":null,"path":"/mandates/retrieve","gate":false,"display_on_load":false},"payment_intents":{"title":"PaymentIntents","group_title":"Core Resources","group_anchor":"core_resources","anchor":"payment_intents","section_anchor":"payment_intents","subsection_anchors":["payment_intent_object","create_payment_intent","retrieve_payment_intent","update_payment_intent","confirm_payment_intent","capture_payment_intent","cancel_payment_intent","list_payment_intents","increment_authorization","search_payment_intents","verify_microdeposits_payment_intent","apply_customer_balance"],"path":"/payment_intents","gate":false,"display_on_load":false,"data":{"section_type":"resource","title":"PaymentIntents","description":"A PaymentIntent guides you through the process of collecting a payment from your customer.\nWe recommend that you create exactly one PaymentIntent for each order or\ncustomer session in your system. You can reference the PaymentIntent later to\nsee the history of payment attempts for a particular session.\n\nA PaymentIntent transitions through\n[multiple statuses](/docs/payments/intents#intent-statuses)\nthroughout its lifetime as it interfaces with Stripe.js to perform\nauthentication flows and ultimately creates at most one successful charge.\n\nRelated guide: [Payment Intents API](/docs/payments/payment-intents).\n","section_tag":"payment_intents","subsection_summaries":[{"anchor":"payment_intent_object","curl_definition":null},{"anchor":"create_payment_intent","curl_definition":"POST /v1/payment_intents"},{"anchor":"retrieve_payment_intent","curl_definition":"GET /v1/payment_intents/:id"},{"anchor":"update_payment_intent","curl_definition":"POST /v1/payment_intents/:id"},{"anchor":"confirm_payment_intent","curl_definition":"POST /v1/payment_intents/:id/confirm"},{"anchor":"capture_payment_intent","curl_definition":"POST /v1/payment_intents/:id/capture"},{"anchor":"cancel_payment_intent","curl_definition":"POST /v1/payment_intents/:id/cancel"},{"anchor":"list_payment_intents","curl_definition":"GET /v1/payment_intents"},{"anchor":"increment_authorization","curl_definition":"POST /v1/payment_intents/:id/increment_authorization"},{"anchor":"search_payment_intents","curl_definition":"GET /v1/payment_intents/search"},{"anchor":"verify_microdeposits_payment_intent","curl_definition":"POST /v1/payment_intents/:id/verify_microdeposits"},{"anchor":"apply_customer_balance","curl_definition":"POST /v1/payment_intents/:id/apply_customer_balance"}]}},"payment_intent_object":{"title":"The PaymentIntent object","group_title":"Core Resources","group_anchor":"core_resources","anchor":"payment_intent_object","section_anchor":"payment_intents","subsection_anchors":null,"path":"/payment_intents/object","gate":false,"display_on_load":false},"create_payment_intent":{"title":"Create a PaymentIntent","group_title":"Core Resources","group_anchor":"core_resources","anchor":"create_payment_intent","section_anchor":"payment_intents","subsection_anchors":null,"path":"/payment_intents/create","gate":false,"display_on_load":false},"retrieve_payment_intent":{"title":"Retrieve a PaymentIntent","group_title":"Core Resources","group_anchor":"core_resources","anchor":"retrieve_payment_intent","section_anchor":"payment_intents","subsection_anchors":null,"path":"/payment_intents/retrieve","gate":false,"display_on_load":false},"update_payment_intent":{"title":"Update a PaymentIntent","group_title":"Core Resources","group_anchor":"core_resources","anchor":"update_payment_intent","section_anchor":"payment_intents","subsection_anchors":null,"path":"/payment_intents/update","gate":false,"display_on_load":false},"confirm_payment_intent":{"title":"Confirm a PaymentIntent","group_title":"Core Resources","group_anchor":"core_resources","anchor":"confirm_payment_intent","section_anchor":"payment_intents","subsection_anchors":null,"path":"/payment_intents/confirm","gate":false,"display_on_load":false},"capture_payment_intent":{"title":"Capture a PaymentIntent","group_title":"Core Resources","group_anchor":"core_resources","anchor":"capture_payment_intent","section_anchor":"payment_intents","subsection_anchors":null,"path":"/payment_intents/capture","gate":false,"display_on_load":false},"cancel_payment_intent":{"title":"Cancel a PaymentIntent","group_title":"Core Resources","group_anchor":"core_resources","anchor":"cancel_payment_intent","section_anchor":"payment_intents","subsection_anchors":null,"path":"/payment_intents/cancel","gate":false,"display_on_load":false},"list_payment_intents":{"title":"List all PaymentIntents","group_title":"Core Resources","group_anchor":"core_resources","anchor":"list_payment_intents","section_anchor":"payment_intents","subsection_anchors":null,"path":"/payment_intents/list","gate":false,"display_on_load":false},"increment_authorization":{"title":"Increment an authorization","group_title":"Core Resources","group_anchor":"core_resources","anchor":"increment_authorization","section_anchor":"payment_intents","subsection_anchors":null,"path":"/payment_intents/increment_authorization","gate":false,"display_on_load":false},"search_payment_intents":{"title":"Search PaymentIntents","group_title":"Core Resources","group_anchor":"core_resources","anchor":"search_payment_intents","section_anchor":"payment_intents","subsection_anchors":null,"path":"/payment_intents/search","gate":false,"display_on_load":false},"verify_microdeposits_payment_intent":{"title":"Verify microdeposits on a PaymentIntent","group_title":"Core Resources","group_anchor":"core_resources","anchor":"verify_microdeposits_payment_intent","section_anchor":"payment_intents","subsection_anchors":null,"path":"/payment_intents/verify_microdeposits","gate":false,"display_on_load":false},"apply_customer_balance":{"title":"Reconcile a customer_balance PaymentIntent","group_title":"Core Resources","group_anchor":"core_resources","anchor":"apply_customer_balance","section_anchor":"payment_intents","subsection_anchors":null,"path":"/payment_intents/apply_customer_balance","gate":false,"display_on_load":false},"setup_intents":{"title":"SetupIntents","group_title":"Core Resources","group_anchor":"core_resources","anchor":"setup_intents","section_anchor":"setup_intents","subsection_anchors":["setup_intent_object","create_setup_intent","retrieve_setup_intent","update_setup_intent","confirm_setup_intent","cancel_setup_intent","list_setup_intents","verify_microdeposits_setup_intent"],"path":"/setup_intents","gate":false,"display_on_load":false,"data":{"section_type":"resource","title":"SetupIntents","description":"A SetupIntent guides you through the process of setting up and saving a customer's payment credentials for future payments.\nFor example, you could use a SetupIntent to set up and save your customer's card without immediately collecting a payment.\nLater, you can use [PaymentIntents](#payment_intents) to drive the payment flow.\n\nCreate a SetupIntent as soon as you're ready to collect your customer's payment credentials.\nDo not maintain long-lived, unconfirmed SetupIntents as they may no longer be valid.\nThe SetupIntent then transitions through multiple [statuses](/docs/payments/intents#intent-statuses) as it guides\nyou through the setup process.\n\nSuccessful SetupIntents result in payment credentials that are optimized for future payments.\nFor example, cardholders in [certain regions](/guides/strong-customer-authentication) may need to be run through\n[Strong Customer Authentication](/docs/strong-customer-authentication) at the time of payment method collection\nin order to streamline later [off-session payments](/docs/payments/setup-intents).\nIf the SetupIntent is used with a [Customer](#setup_intent_object-customer), upon success,\nit will automatically attach the resulting payment method to that Customer.\nWe recommend using SetupIntents or [setup_future_usage](#payment_intent_object-setup_future_usage) on\nPaymentIntents to save payment methods in order to prevent saving invalid or unoptimized payment methods.\n\nBy using SetupIntents, you ensure that your customers experience the minimum set of required friction,\neven as regulations change over time.\n\nRelated guide: [Setup Intents API](/docs/payments/setup-intents).\n","section_tag":"setup_intents","subsection_summaries":[{"anchor":"setup_intent_object","curl_definition":null},{"anchor":"create_setup_intent","curl_definition":"POST /v1/setup_intents"},{"anchor":"retrieve_setup_intent","curl_definition":"GET /v1/setup_intents/:id"},{"anchor":"update_setup_intent","curl_definition":"POST /v1/setup_intents/:id"},{"anchor":"confirm_setup_intent","curl_definition":"POST /v1/setup_intents/:id/confirm"},{"anchor":"cancel_setup_intent","curl_definition":"POST /v1/setup_intents/:id/cancel"},{"anchor":"list_setup_intents","curl_definition":"GET /v1/setup_intents"},{"anchor":"verify_microdeposits_setup_intent","curl_definition":"POST /v1/setup_intents/:id/verify_microdeposits"}]}},"setup_intent_object":{"title":"The SetupIntent object","group_title":"Core Resources","group_anchor":"core_resources","anchor":"setup_intent_object","section_anchor":"setup_intents","subsection_anchors":null,"path":"/setup_intents/object","gate":false,"display_on_load":false},"create_setup_intent":{"title":"Create a SetupIntent","group_title":"Core Resources","group_anchor":"core_resources","anchor":"create_setup_intent","section_anchor":"setup_intents","subsection_anchors":null,"path":"/setup_intents/create","gate":false,"display_on_load":false},"retrieve_setup_intent":{"title":"Retrieve a SetupIntent","group_title":"Core Resources","group_anchor":"core_resources","anchor":"retrieve_setup_intent","section_anchor":"setup_intents","subsection_anchors":null,"path":"/setup_intents/retrieve","gate":false,"display_on_load":false},"update_setup_intent":{"title":"Update a SetupIntent","group_title":"Core Resources","group_anchor":"core_resources","anchor":"update_setup_intent","section_anchor":"setup_intents","subsection_anchors":null,"path":"/setup_intents/update","gate":false,"display_on_load":false},"confirm_setup_intent":{"title":"Confirm a SetupIntent","group_title":"Core Resources","group_anchor":"core_resources","anchor":"confirm_setup_intent","section_anchor":"setup_intents","subsection_anchors":null,"path":"/setup_intents/confirm","gate":false,"display_on_load":false},"cancel_setup_intent":{"title":"Cancel a SetupIntent","group_title":"Core Resources","group_anchor":"core_resources","anchor":"cancel_setup_intent","section_anchor":"setup_intents","subsection_anchors":null,"path":"/setup_intents/cancel","gate":false,"display_on_load":false},"list_setup_intents":{"title":"List all SetupIntents","group_title":"Core Resources","group_anchor":"core_resources","anchor":"list_setup_intents","section_anchor":"setup_intents","subsection_anchors":null,"path":"/setup_intents/list","gate":false,"display_on_load":false},"verify_microdeposits_setup_intent":{"title":"Verify microdeposits on a SetupIntent","group_title":"Core Resources","group_anchor":"core_resources","anchor":"verify_microdeposits_setup_intent","section_anchor":"setup_intents","subsection_anchors":null,"path":"/setup_intents/verify_microdeposits","gate":false,"display_on_load":false},"setup_attempts":{"title":"SetupAttempts","group_title":"Core Resources","group_anchor":"core_resources","anchor":"setup_attempts","section_anchor":"setup_attempts","subsection_anchors":["setup_attempt_object","list_setup_attempts"],"path":"/setup_attempts","gate":false,"display_on_load":false,"data":{"section_type":"resource","title":"SetupAttempts","description":"A SetupAttempt describes one attempted confirmation of a SetupIntent,\nwhether that confirmation was successful or unsuccessful. You can use\nSetupAttempts to inspect details of a specific attempt at setting up a\npayment method using a SetupIntent.\n","section_tag":"setup_attempts","subsection_summaries":[{"anchor":"setup_attempt_object","curl_definition":null},{"anchor":"list_setup_attempts","curl_definition":"GET /v1/setup_attempts"}]}},"setup_attempt_object":{"title":"The SetupAttempt object","group_title":"Core Resources","group_anchor":"core_resources","anchor":"setup_attempt_object","section_anchor":"setup_attempts","subsection_anchors":null,"path":"/setup_attempts/object","gate":false,"display_on_load":false},"list_setup_attempts":{"title":"List all SetupAttempts","group_title":"Core Resources","group_anchor":"core_resources","anchor":"list_setup_attempts","section_anchor":"setup_attempts","subsection_anchors":null,"path":"/setup_attempts/list","gate":false,"display_on_load":false},"payouts":{"title":"Payouts","group_title":"Core Resources","group_anchor":"core_resources","anchor":"payouts","section_anchor":"payouts","subsection_anchors":["payout_object","create_payout","retrieve_payout","update_payout","list_payouts","cancel_payout","reverse_payout","payout_failures"],"path":"/payouts","gate":false,"display_on_load":false,"data":{"section_type":"resource","title":"Payouts","description":"A `Payout` object is created when you receive funds from Stripe, or when you\ninitiate a payout to either a bank account or debit card of a [connected\nStripe account](/docs/connect/bank-debit-card-payouts). You can retrieve individual payouts,\nas well as list all payouts. Payouts are made on [varying\nschedules](/docs/connect/manage-payout-schedule), depending on your country and\nindustry.\n\nRelated guide: [Receiving Payouts](/docs/payouts).\n","section_tag":"payouts","subsection_summaries":[{"anchor":"payout_object","curl_definition":null},{"anchor":"create_payout","curl_definition":"POST /v1/payouts"},{"anchor":"retrieve_payout","curl_definition":"GET /v1/payouts/:id"},{"anchor":"update_payout","curl_definition":"POST /v1/payouts/:id"},{"anchor":"list_payouts","curl_definition":"GET /v1/payouts"},{"anchor":"cancel_payout","curl_definition":"POST /v1/payouts/:id/cancel"},{"anchor":"reverse_payout","curl_definition":"POST /v1/payouts/:id/reverse"},{"anchor":"payout_failures","curl_definition":null}]}},"payout_object":{"title":"The payout object","group_title":"Core Resources","group_anchor":"core_resources","anchor":"payout_object","section_anchor":"payouts","subsection_anchors":null,"path":"/payouts/object","gate":false,"display_on_load":false},"create_payout":{"title":"Create a payout","group_title":"Core Resources","group_anchor":"core_resources","anchor":"create_payout","section_anchor":"payouts","subsection_anchors":null,"path":"/payouts/create","gate":false,"display_on_load":false},"retrieve_payout":{"title":"Retrieve a payout","group_title":"Core Resources","group_anchor":"core_resources","anchor":"retrieve_payout","section_anchor":"payouts","subsection_anchors":null,"path":"/payouts/retrieve","gate":false,"display_on_load":false},"update_payout":{"title":"Update a payout","group_title":"Core Resources","group_anchor":"core_resources","anchor":"update_payout","section_anchor":"payouts","subsection_anchors":null,"path":"/payouts/update","gate":false,"display_on_load":false},"list_payouts":{"title":"List all payouts","group_title":"Core Resources","group_anchor":"core_resources","anchor":"list_payouts","section_anchor":"payouts","subsection_anchors":null,"path":"/payouts/list","gate":false,"display_on_load":false},"cancel_payout":{"title":"Cancel a payout","group_title":"Core Resources","group_anchor":"core_resources","anchor":"cancel_payout","section_anchor":"payouts","subsection_anchors":null,"path":"/payouts/cancel","gate":false,"display_on_load":false},"reverse_payout":{"title":"Reverse a payout","group_title":"Core Resources","group_anchor":"core_resources","anchor":"reverse_payout","section_anchor":"payouts","subsection_anchors":null,"path":"/payouts/reverse","gate":false,"display_on_load":false},"payout_failures":{"title":"Types of payout failures","group_title":"Core Resources","group_anchor":"core_resources","anchor":"payout_failures","section_anchor":"payouts","subsection_anchors":null,"path":"/payouts/failures","gate":false,"display_on_load":false},"refunds":{"title":"Refunds","group_title":"Core Resources","group_anchor":"core_resources","anchor":"refunds","section_anchor":"refunds","subsection_anchors":["refund_object","create_refund","retrieve_refund","update_refund","cancel_refund","list_refunds"],"path":"/refunds","gate":false,"display_on_load":false,"data":{"section_type":"resource","title":"Refunds","description":"`Refund` objects allow you to refund a charge that has previously been created\nbut not yet refunded. Funds will be refunded to the credit or debit card that\nwas originally charged.\n\nRelated guide: [Refunds](/docs/refunds).\n","section_tag":"refunds","subsection_summaries":[{"anchor":"refund_object","curl_definition":null},{"anchor":"create_refund","curl_definition":"POST /v1/refunds"},{"anchor":"retrieve_refund","curl_definition":"GET /v1/refunds/:id"},{"anchor":"update_refund","curl_definition":"POST /v1/refunds/:id"},{"anchor":"cancel_refund","curl_definition":"POST /v1/refunds/:id/cancel"},{"anchor":"list_refunds","curl_definition":"GET /v1/refunds"}]}},"refund_object":{"title":"The refund object","group_title":"Core Resources","group_anchor":"core_resources","anchor":"refund_object","section_anchor":"refunds","subsection_anchors":null,"path":"/refunds/object","gate":false,"display_on_load":false},"create_refund":{"title":"Create a refund","group_title":"Core Resources","group_anchor":"core_resources","anchor":"create_refund","section_anchor":"refunds","subsection_anchors":null,"path":"/refunds/create","gate":false,"display_on_load":false},"retrieve_refund":{"title":"Retrieve a refund","group_title":"Core Resources","group_anchor":"core_resources","anchor":"retrieve_refund","section_anchor":"refunds","subsection_anchors":null,"path":"/refunds/retrieve","gate":false,"display_on_load":false},"update_refund":{"title":"Update a refund","group_title":"Core Resources","group_anchor":"core_resources","anchor":"update_refund","section_anchor":"refunds","subsection_anchors":null,"path":"/refunds/update","gate":false,"display_on_load":false},"cancel_refund":{"title":"Cancel a refund","group_title":"Core Resources","group_anchor":"core_resources","anchor":"cancel_refund","section_anchor":"refunds","subsection_anchors":null,"path":"/refunds/cancel","gate":false,"display_on_load":false},"list_refunds":{"title":"List all refunds","group_title":"Core Resources","group_anchor":"core_resources","anchor":"list_refunds","section_anchor":"refunds","subsection_anchors":null,"path":"/refunds/list","gate":false,"display_on_load":false},"tokens":{"title":"Tokens","group_title":"Core Resources","group_anchor":"core_resources","anchor":"tokens","section_anchor":"tokens","subsection_anchors":["token_object","create_card_token","create_bank_account_token","create_pii_token","create_account_token","create_person_token","create_cvc_update_token","retrieve_token"],"path":"/tokens","gate":false,"display_on_load":false,"data":{"section_type":"resource","title":"Tokens","description":"Tokenization is the process Stripe uses to collect sensitive card or bank\naccount details, or personally identifiable information (PII), directly from\nyour customers in a secure manner. A token representing this information is\nreturned to your server to use. You should use our\n[recommended payments integrations](/docs/payments) to perform this process\nclient-side. This ensures that no sensitive card data touches your server,\nand allows your integration to operate in a PCI-compliant way.\n\nIf you cannot use client-side tokenization, you can also create tokens using\nthe API with either your publishable or secret API key. Keep in mind that if\nyour integration uses this method, you are responsible for any PCI compliance\nthat may be required, and you must keep your secret API key safe. Unlike with\nclient-side tokenization, your customer's information is not sent directly to\nStripe, so we cannot determine how it is handled or stored.\n\nTokens cannot be stored or used more than once. To store card or bank account\ninformation for later use, you can create [Customer](/docs/api#customers)\nobjects or [Custom accounts](/docs/api#external_accounts). Note that\n[Radar](/docs/radar), our integrated solution for automatic fraud protection,\nperforms best with integrations that use client-side tokenization.\n\nRelated guide: [Accept a payment](/docs/payments/accept-a-payment-charges#web-create-token)\n","section_tag":"tokens","subsection_summaries":[{"anchor":"token_object","curl_definition":null},{"anchor":"create_card_token","curl_definition":"POST /v1/tokens"},{"anchor":"create_bank_account_token","curl_definition":"POST /v1/tokens"},{"anchor":"create_pii_token","curl_definition":"POST /v1/tokens"},{"anchor":"create_account_token","curl_definition":"POST /v1/tokens"},{"anchor":"create_person_token","curl_definition":"POST /v1/tokens"},{"anchor":"create_cvc_update_token","curl_definition":"POST /v1/tokens"},{"anchor":"retrieve_token","curl_definition":"GET /v1/tokens/:id"}]}},"token_object":{"title":"The token object","group_title":"Core Resources","group_anchor":"core_resources","anchor":"token_object","section_anchor":"tokens","subsection_anchors":null,"path":"/tokens/object","gate":false,"display_on_load":false},"create_card_token":{"title":"Create a card token","group_title":"Core Resources","group_anchor":"core_resources","anchor":"create_card_token","section_anchor":"tokens","subsection_anchors":null,"path":"/tokens/create_card","gate":false,"display_on_load":false},"create_bank_account_token":{"title":"Create a bank account token","group_title":"Core Resources","group_anchor":"core_resources","anchor":"create_bank_account_token","section_anchor":"tokens","subsection_anchors":null,"path":"/tokens/create_bank_account","gate":false,"display_on_load":false},"create_pii_token":{"title":"Create a PII token","group_title":"Core Resources","group_anchor":"core_resources","anchor":"create_pii_token","section_anchor":"tokens","subsection_anchors":null,"path":"/tokens/create_pii","gate":false,"display_on_load":false},"create_account_token":{"title":"Create an account token","group_title":"Core Resources","group_anchor":"core_resources","anchor":"create_account_token","section_anchor":"tokens","subsection_anchors":null,"path":"/tokens/create_account","gate":false,"display_on_load":false},"create_person_token":{"title":"Create a person token","group_title":"Core Resources","group_anchor":"core_resources","anchor":"create_person_token","section_anchor":"tokens","subsection_anchors":null,"path":"/tokens/create_person","gate":false,"display_on_load":false},"create_cvc_update_token":{"title":"Create a CVC update token","group_title":"Core Resources","group_anchor":"core_resources","anchor":"create_cvc_update_token","section_anchor":"tokens","subsection_anchors":null,"path":"/tokens/create_cvc_update","gate":false,"display_on_load":false},"retrieve_token":{"title":"Retrieve a token","group_title":"Core Resources","group_anchor":"core_resources","anchor":"retrieve_token","section_anchor":"tokens","subsection_anchors":null,"path":"/tokens/retrieve","gate":false,"display_on_load":false},"payment_methods":{"title":"PaymentMethods","group_title":"Payment Methods","group_anchor":"payment_methods_heading","anchor":"payment_methods","section_anchor":"payment_methods","subsection_anchors":["payment_method_object","create_payment_method","retrieve_payment_method","retrieve_customer_payment_method","update_payment_method","list_payment_methods","list_customer_payment_methods","customer_attach_payment_method","customer_detach_payment_method"],"path":"/payment_methods","gate":false,"display_on_load":false,"data":{"section_type":"resource","title":"PaymentMethods","description":"PaymentMethod objects represent your customer's payment instruments.\nYou can use them with [PaymentIntents](/docs/payments/payment-intents) to collect payments or save them to\nCustomer objects to store instrument details for future payments.\n\nRelated guides: [Payment Methods](/docs/payments/payment-methods) and [More Payment Scenarios](/docs/payments/more-payment-scenarios).\n","section_tag":"payment_methods","subsection_summaries":[{"anchor":"payment_method_object","curl_definition":null},{"anchor":"create_payment_method","curl_definition":"POST /v1/payment_methods"},{"anchor":"retrieve_payment_method","curl_definition":"GET /v1/payment_methods/:id"},{"anchor":"retrieve_customer_payment_method","curl_definition":"GET /v1/customers/:customer/payment_methods/:payment_method"},{"anchor":"update_payment_method","curl_definition":"POST /v1/payment_methods/:id"},{"anchor":"list_payment_methods","curl_definition":"GET /v1/payment_methods"},{"anchor":"list_customer_payment_methods","curl_definition":"GET /v1/customers/:customer/payment_methods"},{"anchor":"customer_attach_payment_method","curl_definition":"POST /v1/payment_methods/:id/attach"},{"anchor":"customer_detach_payment_method","curl_definition":"POST /v1/payment_methods/:id/detach"}]}},"payment_method_object":{"title":"The PaymentMethod object","group_title":"Payment Methods","group_anchor":"payment_methods_heading","anchor":"payment_method_object","section_anchor":"payment_methods","subsection_anchors":null,"path":"/payment_methods/object","gate":false,"display_on_load":false},"create_payment_method":{"title":"Create a PaymentMethod","group_title":"Payment Methods","group_anchor":"payment_methods_heading","anchor":"create_payment_method","section_anchor":"payment_methods","subsection_anchors":null,"path":"/payment_methods/create","gate":false,"display_on_load":false},"retrieve_payment_method":{"title":"Retrieve a PaymentMethod","group_title":"Payment Methods","group_anchor":"payment_methods_heading","anchor":"retrieve_payment_method","section_anchor":"payment_methods","subsection_anchors":null,"path":"/payment_methods/retrieve","gate":false,"display_on_load":false},"retrieve_customer_payment_method":{"title":"Retrieve a Customer's PaymentMethod","group_title":"Payment Methods","group_anchor":"payment_methods_heading","anchor":"retrieve_customer_payment_method","section_anchor":"payment_methods","subsection_anchors":null,"path":"/payment_methods/customer","gate":false,"display_on_load":false},"update_payment_method":{"title":"Update a PaymentMethod","group_title":"Payment Methods","group_anchor":"payment_methods_heading","anchor":"update_payment_method","section_anchor":"payment_methods","subsection_anchors":null,"path":"/payment_methods/update","gate":false,"display_on_load":false},"list_payment_methods":{"title":"List PaymentMethods","group_title":"Payment Methods","group_anchor":"payment_methods_heading","anchor":"list_payment_methods","section_anchor":"payment_methods","subsection_anchors":null,"path":"/payment_methods/list","gate":false,"display_on_load":false},"list_customer_payment_methods":{"title":"List a Customer's PaymentMethods","group_title":"Payment Methods","group_anchor":"payment_methods_heading","anchor":"list_customer_payment_methods","section_anchor":"payment_methods","subsection_anchors":null,"path":"/payment_methods/customer_list","gate":false,"display_on_load":false},"customer_attach_payment_method":{"title":"Attach a PaymentMethod to a Customer","group_title":"Payment Methods","group_anchor":"payment_methods_heading","anchor":"customer_attach_payment_method","section_anchor":"payment_methods","subsection_anchors":null,"path":"/payment_methods/attach","gate":false,"display_on_load":false},"customer_detach_payment_method":{"title":"Detach a PaymentMethod from a Customer","group_title":"Payment Methods","group_anchor":"payment_methods_heading","anchor":"customer_detach_payment_method","section_anchor":"payment_methods","subsection_anchors":null,"path":"/payment_methods/detach","gate":false,"display_on_load":false},"bank_accounts":{"title":"Bank Accounts","group_title":"Payment Methods","group_anchor":"payment_methods_heading","anchor":"bank_accounts","section_anchor":"bank_accounts","subsection_anchors":["customer_bank_account_object","customer_create_bank_account","customer_retrieve_bank_account","customer_update_bank_account","customer_verify_bank_account","customer_delete_bank_account","customer_list_bank_accounts"],"path":"/customer_bank_accounts","gate":false,"display_on_load":false,"data":{"section_type":"resource","title":"Bank Accounts","description":"These bank accounts are payment methods on `Customer` objects.\n\nOn the other hand [External Accounts](/docs/api#external_accounts) are transfer\ndestinations on `Account` objects for [Custom accounts](/docs/connect/custom-accounts).\nThey can be bank accounts or debit cards as well, and are documented in the links above.\n\nRelated guide: [Bank Debits and Transfers](/docs/payments/bank-debits-transfers).\n","section_tag":"bank_accounts","subsection_summaries":[{"anchor":"customer_bank_account_object","curl_definition":null},{"anchor":"customer_create_bank_account","curl_definition":"POST /v1/customers/:id/sources"},{"anchor":"customer_retrieve_bank_account","curl_definition":"GET /v1/customers/:id/sources/:id"},{"anchor":"customer_update_bank_account","curl_definition":"POST /v1/customers/:id/sources/:id"},{"anchor":"customer_verify_bank_account","curl_definition":"POST /v1/customers/:id/sources/:id/verify"},{"anchor":"customer_delete_bank_account","curl_definition":"DELETE /v1/customers/:id/sources/:id"},{"anchor":"customer_list_bank_accounts","curl_definition":"GET /v1/customers/:id/sources?object=bank_account"}]}},"customer_bank_account_object":{"title":"The bank account object","group_title":"Payment Methods","group_anchor":"payment_methods_heading","anchor":"customer_bank_account_object","section_anchor":"bank_accounts","subsection_anchors":null,"path":"/customer_bank_accounts/object","gate":false,"display_on_load":false},"customer_create_bank_account":{"title":"Create a bank account","group_title":"Payment Methods","group_anchor":"payment_methods_heading","anchor":"customer_create_bank_account","section_anchor":"bank_accounts","subsection_anchors":null,"path":"/customer_bank_accounts/create","gate":false,"display_on_load":false},"customer_retrieve_bank_account":{"title":"Retrieve a bank account","group_title":"Payment Methods","group_anchor":"payment_methods_heading","anchor":"customer_retrieve_bank_account","section_anchor":"bank_accounts","subsection_anchors":null,"path":"/customer_bank_accounts/retrieve","gate":false,"display_on_load":false},"customer_update_bank_account":{"title":"Update a bank account","group_title":"Payment Methods","group_anchor":"payment_methods_heading","anchor":"customer_update_bank_account","section_anchor":"bank_accounts","subsection_anchors":null,"path":"/customer_bank_accounts/update","gate":false,"display_on_load":false},"customer_verify_bank_account":{"title":"Verify a bank account","group_title":"Payment Methods","group_anchor":"payment_methods_heading","anchor":"customer_verify_bank_account","section_anchor":"bank_accounts","subsection_anchors":null,"path":"/customer_bank_accounts/verify","gate":false,"display_on_load":false},"customer_delete_bank_account":{"title":"Delete a bank account","group_title":"Payment Methods","group_anchor":"payment_methods_heading","anchor":"customer_delete_bank_account","section_anchor":"bank_accounts","subsection_anchors":null,"path":"/customer_bank_accounts/delete","gate":false,"display_on_load":false},"customer_list_bank_accounts":{"title":"List all bank accounts","group_title":"Payment Methods","group_anchor":"payment_methods_heading","anchor":"customer_list_bank_accounts","section_anchor":"bank_accounts","subsection_anchors":null,"path":"/customer_bank_accounts/list","gate":false,"display_on_load":false},"cash_balance":{"title":"Cash Balance","group_title":"Payment Methods","group_anchor":"payment_methods_heading","anchor":"cash_balance","section_anchor":"cash_balance","subsection_anchors":["cash_balance_object","retrieve_cash_balance","update_cash_balance","customer_cash_balance_transaction_object","retrieve_cash_balance_transaction","list_cash_balance_transactions","fund_cash_balance"],"path":"/cash_balance","gate":false,"display_on_load":false,"data":{"section_type":"resource","title":"Cash balance","description":"A customer's `Cash balance` represents real funds. Customers can add funds to their cash balance by sending a bank transfer. These funds can be used for payment and can eventually be paid out to your bank account.\n","section_tag":"cash_balance","subsection_summaries":[{"anchor":"cash_balance_object","curl_definition":null},{"anchor":"retrieve_cash_balance","curl_definition":"GET /v1/customers/:id/cash_balance"},{"anchor":"update_cash_balance","curl_definition":"POST /v1/customers/:id/cash_balance"},{"anchor":"customer_cash_balance_transaction_object","curl_definition":null},{"anchor":"retrieve_cash_balance_transaction","curl_definition":"GET /v1/customers/:id/cash_balance_transactions/:id"},{"anchor":"list_cash_balance_transactions","curl_definition":"GET /v1/customers/:id/cash_balance_transactions"},{"anchor":"fund_cash_balance","curl_definition":"POST /v1/test_helpers/customers/{:customer}/fund_cash_balance"}]}},"cash_balance_object":{"title":"The cash balance object","group_title":"Payment Methods","group_anchor":"payment_methods_heading","anchor":"cash_balance_object","section_anchor":"cash_balance","subsection_anchors":null,"path":"/cash_balance/object","gate":false,"display_on_load":false},"retrieve_cash_balance":{"title":"Retrieve a cash balance","group_title":"Payment Methods","group_anchor":"payment_methods_heading","anchor":"retrieve_cash_balance","section_anchor":"cash_balance","subsection_anchors":null,"path":"/cash_balance/retrieve","gate":true,"display_on_load":false},"update_cash_balance":{"title":"Update a cash balance's settings","group_title":"Payment Methods","group_anchor":"payment_methods_heading","anchor":"update_cash_balance","section_anchor":"cash_balance","subsection_anchors":null,"path":"/cash_balance/update","gate":true,"display_on_load":false},"customer_cash_balance_transaction_object":{"title":"The cash balance transaction object","group_title":"Payment Methods","group_anchor":"payment_methods_heading","anchor":"customer_cash_balance_transaction_object","section_anchor":"cash_balance","subsection_anchors":null,"path":"/cash_balance_transactions/object","gate":false,"display_on_load":false},"retrieve_cash_balance_transaction":{"title":"Retrieve a cash balance transaction","group_title":"Payment Methods","group_anchor":"payment_methods_heading","anchor":"retrieve_cash_balance_transaction","section_anchor":"cash_balance","subsection_anchors":null,"path":"/cash_balance_transactions/retrieve","gate":false,"display_on_load":false},"list_cash_balance_transactions":{"title":"List cash balance transactions","group_title":"Payment Methods","group_anchor":"payment_methods_heading","anchor":"list_cash_balance_transactions","section_anchor":"cash_balance","subsection_anchors":null,"path":"/cash_balance_transactions/list","gate":false,"display_on_load":false},"fund_cash_balance":{"title":"Fund a test mode cash balance","group_title":"Payment Methods","group_anchor":"payment_methods_heading","anchor":"fund_cash_balance","section_anchor":"cash_balance","subsection_anchors":null,"path":"/cash_balance_transactions/fund_cash_balance","gate":false,"display_on_load":false},"cards":{"title":"Cards","group_title":"Payment Methods","group_anchor":"payment_methods_heading","anchor":"cards","section_anchor":"cards","subsection_anchors":["card_object","create_card","retrieve_card","update_card","delete_card","list_cards"],"path":"/cards","gate":false,"display_on_load":false,"data":{"section_type":"resource","title":"Cards","description":"You can store multiple cards on a customer in order to charge the customer\nlater. You can also store multiple debit cards on a recipient in order to\ntransfer to those cards later.\n\nRelated guide: [Card Payments with Sources](/docs/sources/cards).\n","section_tag":"cards","subsection_summaries":[{"anchor":"card_object","curl_definition":null},{"anchor":"create_card","curl_definition":"POST /v1/customers/:id/sources"},{"anchor":"retrieve_card","curl_definition":"GET /v1/customers/:id/sources/:id"},{"anchor":"update_card","curl_definition":"POST /v1/customers/:id/sources/:id"},{"anchor":"delete_card","curl_definition":"DELETE /v1/customers/:id/sources/:id"},{"anchor":"list_cards","curl_definition":"GET /v1/customers/:id/sources?object=card"}]}},"card_object":{"title":"The card object","group_title":"Payment Methods","group_anchor":"payment_methods_heading","anchor":"card_object","section_anchor":"cards","subsection_anchors":null,"path":"/cards/object","gate":false,"display_on_load":false},"create_card":{"title":"Create a card","group_title":"Payment Methods","group_anchor":"payment_methods_heading","anchor":"create_card","section_anchor":"cards","subsection_anchors":null,"path":"/cards/create","gate":false,"display_on_load":false},"retrieve_card":{"title":"Retrieve a card","group_title":"Payment Methods","group_anchor":"payment_methods_heading","anchor":"retrieve_card","section_anchor":"cards","subsection_anchors":null,"path":"/cards/retrieve","gate":false,"display_on_load":false},"update_card":{"title":"Update a card","group_title":"Payment Methods","group_anchor":"payment_methods_heading","anchor":"update_card","section_anchor":"cards","subsection_anchors":null,"path":"/cards/update","gate":false,"display_on_load":false},"delete_card":{"title":"Delete a card","group_title":"Payment Methods","group_anchor":"payment_methods_heading","anchor":"delete_card","section_anchor":"cards","subsection_anchors":null,"path":"/cards/delete","gate":false,"display_on_load":false},"list_cards":{"title":"List all cards","group_title":"Payment Methods","group_anchor":"payment_methods_heading","anchor":"list_cards","section_anchor":"cards","subsection_anchors":null,"path":"/cards/list","gate":false,"display_on_load":false},"sources":{"title":"Sources","group_title":"Payment Methods","group_anchor":"payment_methods_heading","anchor":"sources","section_anchor":"sources","subsection_anchors":["source_object","create_source","retrieve_source","update_source","attach_source","detach_source"],"path":"/sources","gate":false,"display_on_load":false,"data":{"section_type":"resource","title":"Sources","description":"`Source` objects allow you to accept a variety of payment methods. They\nrepresent a customer's payment instrument, and can be used with the Stripe API\njust like a `Card` object: once chargeable, they can be charged, or can be\nattached to customers.\n\nStripe doesn't recommend using the deprecated [Sources API](/docs/api/sources).\nWe recommend that you adopt the [PaymentMethods API](/docs/api/payment_methods).\nThis newer API provides access to our latest features and payment method types.\n\nRelated guides: [Sources API](/docs/sources) and [Sources \u0026 Customers](/docs/sources/customers).\n","section_tag":"sources","subsection_summaries":[{"anchor":"source_object","curl_definition":null},{"anchor":"create_source","curl_definition":"POST /v1/sources"},{"anchor":"retrieve_source","curl_definition":"GET /v1/sources/:id"},{"anchor":"update_source","curl_definition":"POST /v1/sources/:id"},{"anchor":"attach_source","curl_definition":"POST /v1/customers/:id/sources"},{"anchor":"detach_source","curl_definition":"DELETE /v1/customers/:id/sources/:id"}]}},"source_object":{"title":"The source object","group_title":"Payment Methods","group_anchor":"payment_methods_heading","anchor":"source_object","section_anchor":"sources","subsection_anchors":null,"path":"/sources/object","gate":false,"display_on_load":false},"create_source":{"title":"Create a source","group_title":"Payment Methods","group_anchor":"payment_methods_heading","anchor":"create_source","section_anchor":"sources","subsection_anchors":null,"path":"/sources/create","gate":false,"display_on_load":false},"retrieve_source":{"title":"Retrieve a source","group_title":"Payment Methods","group_anchor":"payment_methods_heading","anchor":"retrieve_source","section_anchor":"sources","subsection_anchors":null,"path":"/sources/retrieve","gate":false,"display_on_load":false},"update_source":{"title":"Update a source","group_title":"Payment Methods","group_anchor":"payment_methods_heading","anchor":"update_source","section_anchor":"sources","subsection_anchors":null,"path":"/sources/update","gate":false,"display_on_load":false},"attach_source":{"title":"Attach a source","group_title":"Payment Methods","group_anchor":"payment_methods_heading","anchor":"attach_source","section_anchor":"sources","subsection_anchors":null,"path":"/sources/attach","gate":false,"display_on_load":false},"detach_source":{"title":"Detach a source","group_title":"Payment Methods","group_anchor":"payment_methods_heading","anchor":"detach_source","section_anchor":"sources","subsection_anchors":null,"path":"/sources/detach","gate":false,"display_on_load":false},"products":{"title":"Products","group_title":"Products","group_anchor":"products_section","anchor":"products","section_anchor":"products","subsection_anchors":["product_object","create_product","retrieve_product","update_product","list_products","delete_product","search_products"],"path":"/products","gate":false,"display_on_load":false,"data":{"section_type":"resource","title":"Products","description":"Products describe the specific goods or services you offer to your customers.\nFor example, you might offer a Standard and Premium version of your goods or service; each version would be a separate Product.\nThey can be used in conjunction with [Prices](#prices) to configure pricing in Payment Links, Checkout, and Subscriptions.\n\nRelated guides: [Set up a subscription](/docs/billing/subscriptions/set-up-subscription),\n[share a Payment Link](/docs/payments/payment-links/overview),\n[accept payments with Checkout](/docs/payments/accept-a-payment#create-product-prices-upfront),\nand more about [Products and Prices](/docs/products-prices/overview)\n","section_tag":"products","subsection_summaries":[{"anchor":"product_object","curl_definition":null},{"anchor":"create_product","curl_definition":"POST /v1/products"},{"anchor":"retrieve_product","curl_definition":"GET /v1/products/:id"},{"anchor":"update_product","curl_definition":"POST /v1/products/:id"},{"anchor":"list_products","curl_definition":"GET /v1/products"},{"anchor":"delete_product","curl_definition":"DELETE /v1/products/:id"},{"anchor":"search_products","curl_definition":"GET /v1/products/search"}]}},"product_object":{"title":"The product object","group_title":"Products","group_anchor":"products_section","anchor":"product_object","section_anchor":"products","subsection_anchors":null,"path":"/products/object","gate":false,"display_on_load":false},"create_product":{"title":"Create a product","group_title":"Products","group_anchor":"products_section","anchor":"create_product","section_anchor":"products","subsection_anchors":null,"path":"/products/create","gate":false,"display_on_load":false},"retrieve_product":{"title":"Retrieve a product","group_title":"Products","group_anchor":"products_section","anchor":"retrieve_product","section_anchor":"products","subsection_anchors":null,"path":"/products/retrieve","gate":false,"display_on_load":false},"update_product":{"title":"Update a product","group_title":"Products","group_anchor":"products_section","anchor":"update_product","section_anchor":"products","subsection_anchors":null,"path":"/products/update","gate":false,"display_on_load":false},"list_products":{"title":"List all products","group_title":"Products","group_anchor":"products_section","anchor":"list_products","section_anchor":"products","subsection_anchors":null,"path":"/products/list","gate":false,"display_on_load":false},"delete_product":{"title":"Delete a product","group_title":"Products","group_anchor":"products_section","anchor":"delete_product","section_anchor":"products","subsection_anchors":null,"path":"/products/delete","gate":false,"display_on_load":false},"search_products":{"title":"Search products","group_title":"Products","group_anchor":"products_section","anchor":"search_products","section_anchor":"products","subsection_anchors":null,"path":"/products/search","gate":false,"display_on_load":false},"prices":{"title":"Prices","group_title":"Products","group_anchor":"products_section","anchor":"prices","section_anchor":"prices","subsection_anchors":["price_object","create_price","retrieve_price","update_price","list_prices","search_prices"],"path":"/prices","gate":false,"display_on_load":false,"data":{"section_type":"resource","title":"Prices","description":"Prices define the unit cost, currency, and (optional) billing cycle for both recurring and one-time purchases of products.\n[Products](#products) help you track inventory or provisioning, and prices help you track payment terms. Different physical goods or levels of service should be represented by products, and pricing options should be represented by prices. This approach lets you change prices without having to change your provisioning scheme.\n\nFor example, you might have a single \"gold\" product that has prices for $10/month, $100/year, and €9 once.\n\nRelated guides: [Set up a subscription](/docs/billing/subscriptions/set-up-subscription), [create an invoice](/docs/billing/invoices/create), and more about [products and prices](/docs/products-prices/overview).\n","section_tag":"prices","subsection_summaries":[{"anchor":"price_object","curl_definition":null},{"anchor":"create_price","curl_definition":"POST /v1/prices"},{"anchor":"retrieve_price","curl_definition":"GET /v1/prices/:id"},{"anchor":"update_price","curl_definition":"POST /v1/prices/:id"},{"anchor":"list_prices","curl_definition":"GET /v1/prices"},{"anchor":"search_prices","curl_definition":"GET /v1/prices/search"}]}},"price_object":{"title":"The price object","group_title":"Products","group_anchor":"products_section","anchor":"price_object","section_anchor":"prices","subsection_anchors":null,"path":"/prices/object","gate":false,"display_on_load":false},"create_price":{"title":"Create a price","group_title":"Products","group_anchor":"products_section","anchor":"create_price","section_anchor":"prices","subsection_anchors":null,"path":"/prices/create","gate":false,"display_on_load":false},"retrieve_price":{"title":"Retrieve a price","group_title":"Products","group_anchor":"products_section","anchor":"retrieve_price","section_anchor":"prices","subsection_anchors":null,"path":"/prices/retrieve","gate":false,"display_on_load":false},"update_price":{"title":"Update a price","group_title":"Products","group_anchor":"products_section","anchor":"update_price","section_anchor":"prices","subsection_anchors":null,"path":"/prices/update","gate":false,"display_on_load":false},"list_prices":{"title":"List all prices","group_title":"Products","group_anchor":"products_section","anchor":"list_prices","section_anchor":"prices","subsection_anchors":null,"path":"/prices/list","gate":false,"display_on_load":false},"search_prices":{"title":"Search prices","group_title":"Products","group_anchor":"products_section","anchor":"search_prices","section_anchor":"prices","subsection_anchors":null,"path":"/prices/search","gate":false,"display_on_load":false},"coupons":{"title":"Coupons","group_title":"Products","group_anchor":"products_section","anchor":"coupons","section_anchor":"coupons","subsection_anchors":["coupon_object","create_coupon","retrieve_coupon","update_coupon","delete_coupon","list_coupons"],"path":"/coupons","gate":false,"display_on_load":false,"data":{"section_type":"resource","title":"Coupons","description":"A coupon contains information about a percent-off or amount-off discount you\nmight want to apply to a customer. Coupons may be applied to [subscriptions](#subscriptions), [invoices](#invoices),\n[checkout sessions](/docs/api/checkout/sessions), [quotes](#quotes), and more. Coupons do not work with conventional one-off [charges](#create_charge) or [payment intents](/docs/api/payment_intents).\n","section_tag":"coupons","subsection_summaries":[{"anchor":"coupon_object","curl_definition":null},{"anchor":"create_coupon","curl_definition":"POST /v1/coupons"},{"anchor":"retrieve_coupon","curl_definition":"GET /v1/coupons/:id"},{"anchor":"update_coupon","curl_definition":"POST /v1/coupons/:id"},{"anchor":"delete_coupon","curl_definition":"DELETE /v1/coupons/:id"},{"anchor":"list_coupons","curl_definition":"GET /v1/coupons"}]}},"coupon_object":{"title":"The coupon object","group_title":"Products","group_anchor":"products_section","anchor":"coupon_object","section_anchor":"coupons","subsection_anchors":null,"path":"/coupons/object","gate":false,"display_on_load":false},"create_coupon":{"title":"Create a coupon","group_title":"Products","group_anchor":"products_section","anchor":"create_coupon","section_anchor":"coupons","subsection_anchors":null,"path":"/coupons/create","gate":false,"display_on_load":false},"retrieve_coupon":{"title":"Retrieve a coupon","group_title":"Products","group_anchor":"products_section","anchor":"retrieve_coupon","section_anchor":"coupons","subsection_anchors":null,"path":"/coupons/retrieve","gate":false,"display_on_load":false},"update_coupon":{"title":"Update a coupon","group_title":"Products","group_anchor":"products_section","anchor":"update_coupon","section_anchor":"coupons","subsection_anchors":null,"path":"/coupons/update","gate":false,"display_on_load":false},"delete_coupon":{"title":"Delete a coupon","group_title":"Products","group_anchor":"products_section","anchor":"delete_coupon","section_anchor":"coupons","subsection_anchors":null,"path":"/coupons/delete","gate":false,"display_on_load":false},"list_coupons":{"title":"List all coupons","group_title":"Products","group_anchor":"products_section","anchor":"list_coupons","section_anchor":"coupons","subsection_anchors":null,"path":"/coupons/list","gate":false,"display_on_load":false},"promotion_codes":{"title":"Promotion Codes","group_title":"Products","group_anchor":"products_section","anchor":"promotion_codes","section_anchor":"promotion_codes","subsection_anchors":["promotion_code_object","create_promotion_code","update_promotion_code","retrieve_promotion_code","list_promotion_code"],"path":"/promotion_codes","gate":false,"display_on_load":false,"data":{"section_type":"resource","title":"Promotion Code","description":"A Promotion Code represents a customer-redeemable code for a [coupon](#coupons). It can be used to\ncreate multiple codes for a single coupon.\n","section_tag":"promotion_codes","subsection_summaries":[{"anchor":"promotion_code_object","curl_definition":null},{"anchor":"create_promotion_code","curl_definition":"POST /v1/promotion_codes"},{"anchor":"update_promotion_code","curl_definition":"POST /v1/promotion_codes/:id"},{"anchor":"retrieve_promotion_code","curl_definition":"GET /v1/promotion_codes/:id"},{"anchor":"list_promotion_code","curl_definition":"GET /v1/promotion_codes"}]}},"promotion_code_object":{"title":"The promotion code object","group_title":"Products","group_anchor":"products_section","anchor":"promotion_code_object","section_anchor":"promotion_codes","subsection_anchors":null,"path":"/promotion_codes/object","gate":false,"display_on_load":false},"create_promotion_code":{"title":"Create a promotion code","group_title":"Products","group_anchor":"products_section","anchor":"create_promotion_code","section_anchor":"promotion_codes","subsection_anchors":null,"path":"/promotion_codes/create","gate":false,"display_on_load":false},"update_promotion_code":{"title":"Update a promotion code","group_title":"Products","group_anchor":"products_section","anchor":"update_promotion_code","section_anchor":"promotion_codes","subsection_anchors":null,"path":"/promotion_codes/update","gate":false,"display_on_load":false},"retrieve_promotion_code":{"title":"Retrieve a promotion code","group_title":"Products","group_anchor":"products_section","anchor":"retrieve_promotion_code","section_anchor":"promotion_codes","subsection_anchors":null,"path":"/promotion_codes/retrieve","gate":false,"display_on_load":false},"list_promotion_code":{"title":"List all promotion codes","group_title":"Products","group_anchor":"products_section","anchor":"list_promotion_code","section_anchor":"promotion_codes","subsection_anchors":null,"path":"/promotion_codes/list","gate":false,"display_on_load":false},"discounts":{"title":"Discounts","group_title":"Products","group_anchor":"products_section","anchor":"discounts","section_anchor":"discounts","subsection_anchors":["discount_object","delete_discount","delete_subscription_discount"],"path":"/discounts","gate":false,"display_on_load":false,"data":{"section_type":"resource","title":"Discounts","description":"A discount represents the actual application of a [coupon](#coupons) or [promotion code](#promotion_codes).\nIt contains information about when the discount began, when it will end, and what it is applied to.\n\nRelated guide: [Applying Discounts to Subscriptions](/docs/billing/subscriptions/discounts).\n","section_tag":"discounts","subsection_summaries":[{"anchor":"discount_object","curl_definition":null},{"anchor":"delete_discount","curl_definition":"DELETE /v1/customers/:id/discount"},{"anchor":"delete_subscription_discount","curl_definition":"DELETE /v1/subscriptions/:id/discount"}]}},"discount_object":{"title":"The discount object","group_title":"Products","group_anchor":"products_section","anchor":"discount_object","section_anchor":"discounts","subsection_anchors":null,"path":"/discounts/object","gate":false,"display_on_load":false},"delete_discount":{"title":"Delete a customer discount","group_title":"Products","group_anchor":"products_section","anchor":"delete_discount","section_anchor":"discounts","subsection_anchors":null,"path":"/discounts/delete","gate":false,"display_on_load":false},"delete_subscription_discount":{"title":"Delete a subscription discount","group_title":"Products","group_anchor":"products_section","anchor":"delete_subscription_discount","section_anchor":"discounts","subsection_anchors":null,"path":"/discounts/subscription_delete","gate":false,"display_on_load":false},"tax_codes":{"title":"Tax Codes","group_title":"Products","group_anchor":"products_section","anchor":"tax_codes","section_anchor":"tax_codes","subsection_anchors":["tax_code_object","list_tax_codes","retrieve_taxcode"],"path":"/tax_codes","gate":false,"display_on_load":false,"data":{"section_type":"resource","title":"Tax Code","description":"[Tax codes](https://stripe.com/docs/tax/tax-categories) classify goods and services for tax purposes.\n","section_tag":"tax_codes","subsection_summaries":[{"anchor":"tax_code_object","curl_definition":null},{"anchor":"list_tax_codes","curl_definition":"GET /v1/tax_codes"},{"anchor":"retrieve_taxcode","curl_definition":"GET /v1/tax_codes/:id"}]}},"tax_code_object":{"title":"The tax code object","group_title":"Products","group_anchor":"products_section","anchor":"tax_code_object","section_anchor":"tax_codes","subsection_anchors":null,"path":"/tax_codes/object","gate":false,"display_on_load":false},"list_tax_codes":{"title":"List all tax codes","group_title":"Products","group_anchor":"products_section","anchor":"list_tax_codes","section_anchor":"tax_codes","subsection_anchors":null,"path":"/tax_codes/list","gate":false,"display_on_load":false},"retrieve_taxcode":{"title":"Retrieve a tax code","group_title":"Products","group_anchor":"products_section","anchor":"retrieve_taxcode","section_anchor":"tax_codes","subsection_anchors":null,"path":"/tax_codes/retrieve","gate":false,"display_on_load":false},"tax_rates":{"title":"Tax Rates","group_title":"Products","group_anchor":"products_section","anchor":"tax_rates","section_anchor":"tax_rates","subsection_anchors":["tax_rate_object","create_tax_rate","retrieve_tax_rate","update_tax_rate","list_tax_rates"],"path":"/tax_rates","gate":false,"display_on_load":false,"data":{"section_type":"resource","title":"Tax Rate","description":"Tax rates can be applied to [invoices](/docs/billing/invoices/tax-rates), [subscriptions](/docs/billing/subscriptions/taxes) and [Checkout Sessions](/docs/payments/checkout/set-up-a-subscription#tax-rates) to collect tax.\n\nRelated guide: [Tax Rates](/docs/billing/taxes/tax-rates).\n","section_tag":"tax_rates","subsection_summaries":[{"anchor":"tax_rate_object","curl_definition":null},{"anchor":"create_tax_rate","curl_definition":"POST /v1/tax_rates"},{"anchor":"retrieve_tax_rate","curl_definition":"GET /v1/tax_rates/:id"},{"anchor":"update_tax_rate","curl_definition":"POST /v1/tax_rates/:id"},{"anchor":"list_tax_rates","curl_definition":"GET /v1/tax_rates"}]}},"tax_rate_object":{"title":"The tax rate object","group_title":"Products","group_anchor":"products_section","anchor":"tax_rate_object","section_anchor":"tax_rates","subsection_anchors":null,"path":"/tax_rates/object","gate":false,"display_on_load":false},"create_tax_rate":{"title":"Create a tax rate","group_title":"Products","group_anchor":"products_section","anchor":"create_tax_rate","section_anchor":"tax_rates","subsection_anchors":null,"path":"/tax_rates/create","gate":false,"display_on_load":false},"retrieve_tax_rate":{"title":"Retrieves a tax rate","group_title":"Products","group_anchor":"products_section","anchor":"retrieve_tax_rate","section_anchor":"tax_rates","subsection_anchors":null,"path":"/tax_rates/retrieve","gate":false,"display_on_load":false},"update_tax_rate":{"title":"Update a tax rate","group_title":"Products","group_anchor":"products_section","anchor":"update_tax_rate","section_anchor":"tax_rates","subsection_anchors":null,"path":"/tax_rates/update","gate":false,"display_on_load":false},"list_tax_rates":{"title":"List all tax rates","group_title":"Products","group_anchor":"products_section","anchor":"list_tax_rates","section_anchor":"tax_rates","subsection_anchors":null,"path":"/tax_rates/list","gate":false,"display_on_load":false},"shipping_rates":{"title":"Shipping Rates","group_title":"Products","group_anchor":"products_section","anchor":"shipping_rates","section_anchor":"shipping_rates","subsection_anchors":["shipping_rate_object","create_shipping_rate","retrieve_shipping_rate","update_shipping_rate","list_shipping_rates"],"path":"/shipping_rates","gate":false,"display_on_load":false,"data":{"section_type":"resource","title":"Shipping Rates","description":"Shipping rates describe the price of shipping presented to your customers and can be\napplied to [Checkout Sessions](/docs/payments/checkout/shipping)\nand [Orders](/docs/orders/shipping) to collect shipping costs.\n","section_tag":"shipping_rates","subsection_summaries":[{"anchor":"shipping_rate_object","curl_definition":null},{"anchor":"create_shipping_rate","curl_definition":"POST /v1/shipping_rates"},{"anchor":"retrieve_shipping_rate","curl_definition":"GET /v1/shipping_rates/:id"},{"anchor":"update_shipping_rate","curl_definition":"POST /v1/shipping_rates/:id"},{"anchor":"list_shipping_rates","curl_definition":"GET /v1/shipping_rates"}]}},"shipping_rate_object":{"title":"The shipping rate object","group_title":"Products","group_anchor":"products_section","anchor":"shipping_rate_object","section_anchor":"shipping_rates","subsection_anchors":null,"path":"/shipping_rates/object","gate":false,"display_on_load":false},"create_shipping_rate":{"title":"Create a shipping rate","group_title":"Products","group_anchor":"products_section","anchor":"create_shipping_rate","section_anchor":"shipping_rates","subsection_anchors":null,"path":"/shipping_rates/create","gate":false,"display_on_load":false},"retrieve_shipping_rate":{"title":"Retrieve a shipping rate","group_title":"Products","group_anchor":"products_section","anchor":"retrieve_shipping_rate","section_anchor":"shipping_rates","subsection_anchors":null,"path":"/shipping_rates/retrieve","gate":false,"display_on_load":false},"update_shipping_rate":{"title":"Update a shipping rate","group_title":"Products","group_anchor":"products_section","anchor":"update_shipping_rate","section_anchor":"shipping_rates","subsection_anchors":null,"path":"/shipping_rates/update","gate":false,"display_on_load":false},"list_shipping_rates":{"title":"List all shipping rates","group_title":"Products","group_anchor":"products_section","anchor":"list_shipping_rates","section_anchor":"shipping_rates","subsection_anchors":null,"path":"/shipping_rates/list","gate":false,"display_on_load":false},"checkout_sessions":{"title":"Checkout Sessions","group_title":"Checkout","group_anchor":"checkout","anchor":"checkout_sessions","section_anchor":"checkout_sessions","subsection_anchors":["checkout_session_object","create_checkout_session","expire_checkout_session","retrieve_checkout_session","list_checkout_sessions","retrieve_checkout_session_line_items"],"path":"/checkout/sessions","gate":false,"display_on_load":false,"data":{"section_type":"resource","title":"Sessions","description":"A Checkout Session represents your customer's session as they pay for\none-time purchases or subscriptions through [Checkout](/docs/payments/checkout)\nor [Payment Links](/docs/payments/payment-links). We recommend creating a\nnew Session each time your customer attempts to pay.\n\nOnce payment is successful, the Checkout Session will contain a reference\nto the [Customer](/docs/api/customers), and either the successful\n[PaymentIntent](/docs/api/payment_intents) or an active\n[Subscription](/docs/api/subscriptions).\n\nYou can create a Checkout Session on your server and redirect to its URL\nto begin Checkout.\n\nRelated guide: [Checkout Quickstart](/docs/checkout/quickstart).\n","section_tag":"checkout_sessions","subsection_summaries":[{"anchor":"checkout_session_object","curl_definition":null},{"anchor":"create_checkout_session","curl_definition":"POST /v1/checkout/sessions"},{"anchor":"expire_checkout_session","curl_definition":"POST /v1/checkout/sessions/:id/expire"},{"anchor":"retrieve_checkout_session","curl_definition":"GET /v1/checkout/sessions/:id"},{"anchor":"list_checkout_sessions","curl_definition":"GET /v1/checkout/sessions"},{"anchor":"retrieve_checkout_session_line_items","curl_definition":"GET /v1/checkout/sessions/:id/line_items"}]}},"checkout_session_object":{"title":"The Checkout Session object","group_title":"Checkout","group_anchor":"checkout","anchor":"checkout_session_object","section_anchor":"checkout_sessions","subsection_anchors":null,"path":"/checkout/sessions/object","gate":false,"display_on_load":false},"create_checkout_session":{"title":"Create a Checkout Session","group_title":"Checkout","group_anchor":"checkout","anchor":"create_checkout_session","section_anchor":"checkout_sessions","subsection_anchors":null,"path":"/checkout/sessions/create","gate":false,"display_on_load":false},"expire_checkout_session":{"title":"Expire a Checkout Session","group_title":"Checkout","group_anchor":"checkout","anchor":"expire_checkout_session","section_anchor":"checkout_sessions","subsection_anchors":null,"path":"/checkout/sessions/expire","gate":false,"display_on_load":false},"retrieve_checkout_session":{"title":"Retrieve a Checkout Session","group_title":"Checkout","group_anchor":"checkout","anchor":"retrieve_checkout_session","section_anchor":"checkout_sessions","subsection_anchors":null,"path":"/checkout/sessions/retrieve","gate":false,"display_on_load":false},"list_checkout_sessions":{"title":"List all Checkout Sessions","group_title":"Checkout","group_anchor":"checkout","anchor":"list_checkout_sessions","section_anchor":"checkout_sessions","subsection_anchors":null,"path":"/checkout/sessions/list","gate":false,"display_on_load":false},"retrieve_checkout_session_line_items":{"title":"Retrieve a Checkout Session's line items","group_title":"Checkout","group_anchor":"checkout","anchor":"retrieve_checkout_session_line_items","section_anchor":"checkout_sessions","subsection_anchors":null,"path":"/checkout/sessions/line_items","gate":false,"display_on_load":false},"payment_links":{"title":"Payment Links","group_title":"Payment Links","group_anchor":"payment_links_section","anchor":"payment_links","section_anchor":"payment_links","subsection_anchors":["payment_link_object","create_payment_link","retrieve_payment_link","update_payment_link","list_payment_link","retrieve_payment_link_line_items"],"path":"/payment_links/payment_links","gate":false,"display_on_load":false,"data":{"section_type":"resource","title":"Payment Link","description":"A payment link is a shareable URL that will take your customers to a hosted payment page. A payment link can be shared and used multiple times.\n\nWhen a customer opens a payment link it will open a new [checkout session](/docs/api/checkout/sessions) to render the payment page. You can use [checkout session events](/docs/api/events/types#event_types-checkout.session.completed) to track payments through payment links.\n\nRelated guide: [Payment Links API](/docs/payments/payment-links/api)\n","section_tag":"payment_links","subsection_summaries":[{"anchor":"payment_link_object","curl_definition":null},{"anchor":"create_payment_link","curl_definition":"POST /v1/payment_links"},{"anchor":"retrieve_payment_link","curl_definition":"GET /v1/payment_links/:id"},{"anchor":"update_payment_link","curl_definition":"POST /v1/payment_links/:id"},{"anchor":"list_payment_link","curl_definition":"GET /v1/payment_links"},{"anchor":"retrieve_payment_link_line_items","curl_definition":"GET /v1/payment_links/:id/line_items"}]}},"payment_link_object":{"title":"The payment link object","group_title":"Payment Links","group_anchor":"payment_links_section","anchor":"payment_link_object","section_anchor":"payment_links","subsection_anchors":null,"path":"/payment_links/payment_links/object","gate":false,"display_on_load":false},"create_payment_link":{"title":"Create a payment link","group_title":"Payment Links","group_anchor":"payment_links_section","anchor":"create_payment_link","section_anchor":"payment_links","subsection_anchors":null,"path":"/payment_links/payment_links/create","gate":false,"display_on_load":false},"retrieve_payment_link":{"title":"Retrieve payment link","group_title":"Payment Links","group_anchor":"payment_links_section","anchor":"retrieve_payment_link","section_anchor":"payment_links","subsection_anchors":null,"path":"/payment_links/payment_links/retrieve","gate":false,"display_on_load":false},"update_payment_link":{"title":"Update a payment link","group_title":"Payment Links","group_anchor":"payment_links_section","anchor":"update_payment_link","section_anchor":"payment_links","subsection_anchors":null,"path":"/payment_links/payment_links/update","gate":false,"display_on_load":false},"list_payment_link":{"title":"List all payment links","group_title":"Payment Links","group_anchor":"payment_links_section","anchor":"list_payment_link","section_anchor":"payment_links","subsection_anchors":null,"path":"/payment_links/payment_links/list","gate":false,"display_on_load":false},"retrieve_payment_link_line_items":{"title":"Retrieve a payment link's line items","group_title":"Payment Links","group_anchor":"payment_links_section","anchor":"retrieve_payment_link_line_items","section_anchor":"payment_links","subsection_anchors":null,"path":"/payment_links/line_items","gate":false,"display_on_load":false},"credit_notes":{"title":"Credit Notes","group_title":"Billing","group_anchor":"billing","anchor":"credit_notes","section_anchor":"credit_notes","subsection_anchors":["credit_note_object","credit_note_line_item_object","preview_credit_note","create_credit_note","retrieve_credit_note","update_credit_note","credit_note_lines","credit_note_preview_lines","void_credit_note","list_credit_notes"],"path":"/credit_notes","gate":false,"display_on_load":false,"data":{"section_type":"resource","title":"Credit Note","description":"Issue a credit note to adjust an invoice's amount after the invoice is finalized.\n\nRelated guide: [Credit Notes](/docs/billing/invoices/credit-notes).\n","section_tag":"credit_notes","subsection_summaries":[{"anchor":"credit_note_object","curl_definition":null},{"anchor":"credit_note_line_item_object","curl_definition":null},{"anchor":"preview_credit_note","curl_definition":"GET /v1/credit_notes/preview"},{"anchor":"create_credit_note","curl_definition":"POST /v1/credit_notes"},{"anchor":"retrieve_credit_note","curl_definition":"GET /v1/credit_notes/:id"},{"anchor":"update_credit_note","curl_definition":"POST /v1/credit_notes/:id"},{"anchor":"credit_note_lines","curl_definition":"GET /v1/credit_notes/:credit_note/lines"},{"anchor":"credit_note_preview_lines","curl_definition":"GET /v1/credit_notes/preview/lines"},{"anchor":"void_credit_note","curl_definition":"POST /v1/credit_notes/:id/void"},{"anchor":"list_credit_notes","curl_definition":"GET /v1/credit_notes"}]}},"credit_note_object":{"title":"The credit note object","group_title":"Billing","group_anchor":"billing","anchor":"credit_note_object","section_anchor":"credit_notes","subsection_anchors":null,"path":"/credit_notes/object","gate":false,"display_on_load":false},"credit_note_line_item_object":{"title":"The (Credit Note) line item object","group_title":"Billing","group_anchor":"billing","anchor":"credit_note_line_item_object","section_anchor":"credit_notes","subsection_anchors":null,"path":"/credit_notes/line_item","gate":false,"display_on_load":false},"preview_credit_note":{"title":"Preview a credit note","group_title":"Billing","group_anchor":"billing","anchor":"preview_credit_note","section_anchor":"credit_notes","subsection_anchors":null,"path":"/credit_notes/preview","gate":false,"display_on_load":false},"create_credit_note":{"title":"Create a credit note","group_title":"Billing","group_anchor":"billing","anchor":"create_credit_note","section_anchor":"credit_notes","subsection_anchors":null,"path":"/credit_notes/create","gate":false,"display_on_load":false},"retrieve_credit_note":{"title":"Retrieve a credit note","group_title":"Billing","group_anchor":"billing","anchor":"retrieve_credit_note","section_anchor":"credit_notes","subsection_anchors":null,"path":"/credit_notes/retrieve","gate":false,"display_on_load":false},"update_credit_note":{"title":"Update a credit note","group_title":"Billing","group_anchor":"billing","anchor":"update_credit_note","section_anchor":"credit_notes","subsection_anchors":null,"path":"/credit_notes/update","gate":false,"display_on_load":false},"credit_note_lines":{"title":"Retrieve a credit note's line items","group_title":"Billing","group_anchor":"billing","anchor":"credit_note_lines","section_anchor":"credit_notes","subsection_anchors":null,"path":"/credit_notes/lines","gate":false,"display_on_load":false},"credit_note_preview_lines":{"title":"Retrieve a credit note preview's line items","group_title":"Billing","group_anchor":"billing","anchor":"credit_note_preview_lines","section_anchor":"credit_notes","subsection_anchors":null,"path":"/credit_notes/preview_lines","gate":false,"display_on_load":false},"void_credit_note":{"title":"Void a credit note","group_title":"Billing","group_anchor":"billing","anchor":"void_credit_note","section_anchor":"credit_notes","subsection_anchors":null,"path":"/credit_notes/void","gate":false,"display_on_load":false},"list_credit_notes":{"title":"List all credit notes","group_title":"Billing","group_anchor":"billing","anchor":"list_credit_notes","section_anchor":"credit_notes","subsection_anchors":null,"path":"/credit_notes/list","gate":false,"display_on_load":false},"customer_balance_transactions":{"title":"Customer Balance Transactions","group_title":"Billing","group_anchor":"billing","anchor":"customer_balance_transactions","section_anchor":"customer_balance_transactions","subsection_anchors":["customer_balance_transaction_object","create_customer_balance_transaction","retrieve_customer_balance_transaction","update_customer_balance_transaction","list_customer_balance_transactions"],"path":"/customer_balance_transactions","gate":false,"display_on_load":false,"data":{"section_type":"resource","title":"Customer Balance Transaction","description":"Each customer has a [`balance`](/docs/api/customers/object#customer_object-balance) value,\nwhich denotes a debit or credit that's automatically applied to their next invoice upon finalization.\nYou may modify the value directly by using the [update customer API](/docs/api/customers/update),\nor by creating a Customer Balance Transaction, which increments or decrements the customer's `balance` by the specified `amount`.\n\nRelated guide: [Customer Balance](/docs/billing/customer/balance) to learn more.\n","section_tag":"customer_balance_transactions","subsection_summaries":[{"anchor":"customer_balance_transaction_object","curl_definition":null},{"anchor":"create_customer_balance_transaction","curl_definition":"POST /v1/customers/:id/balance_transactions"},{"anchor":"retrieve_customer_balance_transaction","curl_definition":"GET /v1/customers/:id/balance_transactions/:id"},{"anchor":"update_customer_balance_transaction","curl_definition":"POST /v1/customers/:id/balance_transactions/:id"},{"anchor":"list_customer_balance_transactions","curl_definition":"GET /v1/customers/:id/balance_transactions"}]}},"customer_balance_transaction_object":{"title":"The customer balance transaction object","group_title":"Billing","group_anchor":"billing","anchor":"customer_balance_transaction_object","section_anchor":"customer_balance_transactions","subsection_anchors":null,"path":"/customer_balance_transactions/object","gate":false,"display_on_load":false},"create_customer_balance_transaction":{"title":"Create a customer balance transaction","group_title":"Billing","group_anchor":"billing","anchor":"create_customer_balance_transaction","section_anchor":"customer_balance_transactions","subsection_anchors":null,"path":"/customer_balance_transactions/create","gate":false,"display_on_load":false},"retrieve_customer_balance_transaction":{"title":"Retrieve a customer balance transaction","group_title":"Billing","group_anchor":"billing","anchor":"retrieve_customer_balance_transaction","section_anchor":"customer_balance_transactions","subsection_anchors":null,"path":"/customer_balance_transactions/retrieve","gate":false,"display_on_load":false},"update_customer_balance_transaction":{"title":"Update a customer credit balance transaction","group_title":"Billing","group_anchor":"billing","anchor":"update_customer_balance_transaction","section_anchor":"customer_balance_transactions","subsection_anchors":null,"path":"/customer_balance_transactions/update","gate":false,"display_on_load":false},"list_customer_balance_transactions":{"title":"List customer balance transactions","group_title":"Billing","group_anchor":"billing","anchor":"list_customer_balance_transactions","section_anchor":"customer_balance_transactions","subsection_anchors":null,"path":"/customer_balance_transactions/list","gate":false,"display_on_load":false},"customer_portal":{"title":"Customer Portal","group_title":"Billing","group_anchor":"billing","anchor":"customer_portal","section_anchor":"customer_portal","subsection_anchors":["portal_session_object","portal_configuration_object","create_portal_session","create_portal_configuration","update_portal_configuration","retrieve_portal_configuration","all_portal_configurations"],"path":"/customer_portal","gate":false,"display_on_load":false,"data":{"section_type":"resource","title":"Customer Portal","description":"The Billing customer portal is a Stripe-hosted UI for subscription and\nbilling management.\n\nA portal configuration describes the functionality and features that you\nwant to provide to your customers through the portal.\n\nA portal session describes the instantiation of the customer portal for\na particular customer. By visiting the session's URL, the customer\ncan manage their subscriptions and billing details. For security reasons,\nsessions are short-lived and will expire if the customer does not visit the URL.\nCreate sessions on-demand when customers intend to manage their subscriptions\nand billing details.\n\nLearn more in the [integration guide](/docs/billing/subscriptions/integrating-customer-portal).\n","section_tag":"customer_portal","subsection_summaries":[{"anchor":"portal_session_object","curl_definition":null},{"anchor":"portal_configuration_object","curl_definition":null},{"anchor":"create_portal_session","curl_definition":"POST /v1/billing_portal/sessions"},{"anchor":"create_portal_configuration","curl_definition":"POST /v1/billing_portal/configurations"},{"anchor":"update_portal_configuration","curl_definition":"POST /v1/billing_portal/configurations/:id"},{"anchor":"retrieve_portal_configuration","curl_definition":"GET /v1/billing_portal/configurations/:id"},{"anchor":"all_portal_configurations","curl_definition":"GET /v1/billing_portal/configurations"}]}},"portal_session_object":{"title":"The portal session object","group_title":"Billing","group_anchor":"billing","anchor":"portal_session_object","section_anchor":"customer_portal","subsection_anchors":null,"path":"/customer_portal/session","gate":false,"display_on_load":false},"portal_configuration_object":{"title":"The portal configuration object","group_title":"Billing","group_anchor":"billing","anchor":"portal_configuration_object","section_anchor":"customer_portal","subsection_anchors":null,"path":"/customer_portal/configuration","gate":false,"display_on_load":false},"create_portal_session":{"title":"Create a portal session","group_title":"Billing","group_anchor":"billing","anchor":"create_portal_session","section_anchor":"customer_portal","subsection_anchors":null,"path":"/customer_portal/sessions/create","gate":false,"display_on_load":false},"create_portal_configuration":{"title":"Create a portal configuration","group_title":"Billing","group_anchor":"billing","anchor":"create_portal_configuration","section_anchor":"customer_portal","subsection_anchors":null,"path":"/customer_portal/configurations/create","gate":false,"display_on_load":false},"update_portal_configuration":{"title":"Update a portal configuration","group_title":"Billing","group_anchor":"billing","anchor":"update_portal_configuration","section_anchor":"customer_portal","subsection_anchors":null,"path":"/customer_portal/configurations/update","gate":false,"display_on_load":false},"retrieve_portal_configuration":{"title":"Retrieve a portal configuration","group_title":"Billing","group_anchor":"billing","anchor":"retrieve_portal_configuration","section_anchor":"customer_portal","subsection_anchors":null,"path":"/customer_portal/configurations/retrieve","gate":false,"display_on_load":false},"all_portal_configurations":{"title":"List portal configurations","group_title":"Billing","group_anchor":"billing","anchor":"all_portal_configurations","section_anchor":"customer_portal","subsection_anchors":null,"path":"/customer_portal/configurations/list","gate":false,"display_on_load":false},"customer_tax_ids":{"title":"Customer Tax IDs","group_title":"Billing","group_anchor":"billing","anchor":"customer_tax_ids","section_anchor":"customer_tax_ids","subsection_anchors":["tax_id_object","create_tax_id","retrieve_tax_id","delete_tax_id","list_tax_ids"],"path":"/customer_tax_ids","gate":false,"display_on_load":false,"data":{"section_type":"resource","title":"Customer Tax IDs","description":"You can add one or multiple tax IDs to a [customer](/docs/api/customers).\nA customer's tax IDs are displayed on invoices and credit notes issued for the customer.\n\nRelated guide: [Customer Tax Identification Numbers](/docs/billing/taxes/tax-ids).\n","section_tag":"customer_tax_ids","subsection_summaries":[{"anchor":"tax_id_object","curl_definition":null},{"anchor":"create_tax_id","curl_definition":"POST /v1/customers/:id/tax_ids"},{"anchor":"retrieve_tax_id","curl_definition":"GET /v1/customers/:id/tax_ids/:id"},{"anchor":"delete_tax_id","curl_definition":"DELETE /v1/customers/:id/tax_ids/:id"},{"anchor":"list_tax_ids","curl_definition":"GET /v1/customers/:id/tax_ids"}]}},"tax_id_object":{"title":"The tax ID object","group_title":"Billing","group_anchor":"billing","anchor":"tax_id_object","section_anchor":"customer_tax_ids","subsection_anchors":null,"path":"/customer_tax_ids/object","gate":false,"display_on_load":false},"create_tax_id":{"title":"Create a tax ID","group_title":"Billing","group_anchor":"billing","anchor":"create_tax_id","section_anchor":"customer_tax_ids","subsection_anchors":null,"path":"/customer_tax_ids/create","gate":false,"display_on_load":false},"retrieve_tax_id":{"title":"Retrieve a tax ID","group_title":"Billing","group_anchor":"billing","anchor":"retrieve_tax_id","section_anchor":"customer_tax_ids","subsection_anchors":null,"path":"/customer_tax_ids/retrieve","gate":false,"display_on_load":false},"delete_tax_id":{"title":"Delete a tax ID","group_title":"Billing","group_anchor":"billing","anchor":"delete_tax_id","section_anchor":"customer_tax_ids","subsection_anchors":null,"path":"/customer_tax_ids/delete","gate":false,"display_on_load":false},"list_tax_ids":{"title":"List all tax IDs","group_title":"Billing","group_anchor":"billing","anchor":"list_tax_ids","section_anchor":"customer_tax_ids","subsection_anchors":null,"path":"/customer_tax_ids/list","gate":false,"display_on_load":false},"invoices":{"title":"Invoices","group_title":"Billing","group_anchor":"billing","anchor":"invoices","section_anchor":"invoices","subsection_anchors":["invoice_object","invoice_line_item_object","create_invoice","retrieve_invoice","update_invoice","delete_invoice","finalize_invoice","pay_invoice","send_invoice","void_invoice","mark_uncollectible_invoice","invoice_lines","upcoming_invoice","upcoming_invoice_lines","list_invoices","search_invoices"],"path":"/invoices","gate":false,"display_on_load":false,"data":{"section_type":"resource","title":"Invoices","description":"Invoices are statements of amounts owed by a customer, and are either\ngenerated one-off, or generated periodically from a subscription.\n\nThey contain [invoice items](#invoiceitems), and proration adjustments\nthat may be caused by subscription upgrades/downgrades (if necessary).\n\nIf your invoice is configured to be billed through automatic charges,\nStripe automatically finalizes your invoice and attempts payment. Note\nthat finalizing the invoice,\n[when automatic](/docs/billing/invoices/workflow/#auto_advance), does\nnot happen immediately as the invoice is created. Stripe waits\nuntil one hour after the last webhook was successfully sent (or the last\nwebhook timed out after failing). If you (and the platforms you may have\nconnected to) have no webhooks configured, Stripe waits one hour after\ncreation to finalize the invoice.\n\nIf your invoice is configured to be billed by sending an email, then based on your\n[email settings](https://dashboard.stripe.com/account/billing/automatic),\nStripe will email the invoice to your customer and await payment. These\nemails can contain a link to a hosted page to pay the invoice.\n\nStripe applies any customer credit on the account before determining the\namount due for the invoice (i.e., the amount that will be actually\ncharged). If the amount due for the invoice is less than Stripe's [minimum allowed charge\nper currency](/docs/currencies#minimum-and-maximum-charge-amounts), the\ninvoice is automatically marked paid, and we add the amount due to the\ncustomer's credit balance which is applied to the next invoice.\n\nMore details on the customer's credit balance are\n[here](/docs/billing/customer/balance).\n\nRelated guide: [Send Invoices to Customers](/docs/billing/invoices/sending).\n","section_tag":"invoices","subsection_summaries":[{"anchor":"invoice_object","curl_definition":null},{"anchor":"invoice_line_item_object","curl_definition":null},{"anchor":"create_invoice","curl_definition":"POST /v1/invoices"},{"anchor":"retrieve_invoice","curl_definition":"GET /v1/invoices/:id"},{"anchor":"update_invoice","curl_definition":"POST /v1/invoices/:id"},{"anchor":"delete_invoice","curl_definition":"DELETE /v1/invoices/:id"},{"anchor":"finalize_invoice","curl_definition":"POST /v1/invoices/:id/finalize"},{"anchor":"pay_invoice","curl_definition":"POST /v1/invoices/:id/pay"},{"anchor":"send_invoice","curl_definition":"POST /v1/invoices/:id/send"},{"anchor":"void_invoice","curl_definition":"POST /v1/invoices/:id/void"},{"anchor":"mark_uncollectible_invoice","curl_definition":"POST /v1/invoices/:id/mark_uncollectible"},{"anchor":"invoice_lines","curl_definition":"GET /v1/invoices/:id/lines"},{"anchor":"upcoming_invoice","curl_definition":"GET /v1/invoices/upcoming"},{"anchor":"upcoming_invoice_lines","curl_definition":"GET /v1/invoices/upcoming/lines"},{"anchor":"list_invoices","curl_definition":"GET /v1/invoices"},{"anchor":"search_invoices","curl_definition":"GET /v1/invoices/search"}]}},"invoice_object":{"title":"The Invoice object","group_title":"Billing","group_anchor":"billing","anchor":"invoice_object","section_anchor":"invoices","subsection_anchors":null,"path":"/invoices/object","gate":false,"display_on_load":false},"invoice_line_item_object":{"title":"The (Invoice) Line Item object","group_title":"Billing","group_anchor":"billing","anchor":"invoice_line_item_object","section_anchor":"invoices","subsection_anchors":null,"path":"/invoices/line_item","gate":false,"display_on_load":false},"create_invoice":{"title":"Create an invoice","group_title":"Billing","group_anchor":"billing","anchor":"create_invoice","section_anchor":"invoices","subsection_anchors":null,"path":"/invoices/create","gate":false,"display_on_load":false},"retrieve_invoice":{"title":"Retrieve an invoice","group_title":"Billing","group_anchor":"billing","anchor":"retrieve_invoice","section_anchor":"invoices","subsection_anchors":null,"path":"/invoices/retrieve","gate":false,"display_on_load":false},"update_invoice":{"title":"Update an invoice","group_title":"Billing","group_anchor":"billing","anchor":"update_invoice","section_anchor":"invoices","subsection_anchors":null,"path":"/invoices/update","gate":false,"display_on_load":false},"delete_invoice":{"title":"Delete a draft invoice","group_title":"Billing","group_anchor":"billing","anchor":"delete_invoice","section_anchor":"invoices","subsection_anchors":null,"path":"/invoices/delete","gate":false,"display_on_load":false},"finalize_invoice":{"title":"Finalize an invoice","group_title":"Billing","group_anchor":"billing","anchor":"finalize_invoice","section_anchor":"invoices","subsection_anchors":null,"path":"/invoices/finalize","gate":false,"display_on_load":false},"pay_invoice":{"title":"Pay an invoice","group_title":"Billing","group_anchor":"billing","anchor":"pay_invoice","section_anchor":"invoices","subsection_anchors":null,"path":"/invoices/pay","gate":false,"display_on_load":false},"send_invoice":{"title":"Send an invoice for manual payment","group_title":"Billing","group_anchor":"billing","anchor":"send_invoice","section_anchor":"invoices","subsection_anchors":null,"path":"/invoices/send","gate":false,"display_on_load":false},"void_invoice":{"title":"Void an invoice","group_title":"Billing","group_anchor":"billing","anchor":"void_invoice","section_anchor":"invoices","subsection_anchors":null,"path":"/invoices/void","gate":false,"display_on_load":false},"mark_uncollectible_invoice":{"title":"Mark an invoice as uncollectible","group_title":"Billing","group_anchor":"billing","anchor":"mark_uncollectible_invoice","section_anchor":"invoices","subsection_anchors":null,"path":"/invoices/mark_uncollectible","gate":false,"display_on_load":false},"invoice_lines":{"title":"Retrieve an invoice's line items","group_title":"Billing","group_anchor":"billing","anchor":"invoice_lines","section_anchor":"invoices","subsection_anchors":null,"path":"/invoices/invoice_lines","gate":false,"display_on_load":false},"upcoming_invoice":{"title":"Retrieve an upcoming invoice","group_title":"Billing","group_anchor":"billing","anchor":"upcoming_invoice","section_anchor":"invoices","subsection_anchors":null,"path":"/invoices/upcoming","gate":false,"display_on_load":false},"upcoming_invoice_lines":{"title":"Retrieve an upcoming invoice's line items","group_title":"Billing","group_anchor":"billing","anchor":"upcoming_invoice_lines","section_anchor":"invoices","subsection_anchors":null,"path":"/invoices/upcoming_invoice_lines","gate":false,"display_on_load":false},"list_invoices":{"title":"List all invoices","group_title":"Billing","group_anchor":"billing","anchor":"list_invoices","section_anchor":"invoices","subsection_anchors":null,"path":"/invoices/list","gate":false,"display_on_load":false},"search_invoices":{"title":"Search invoices","group_title":"Billing","group_anchor":"billing","anchor":"search_invoices","section_anchor":"invoices","subsection_anchors":null,"path":"/invoices/search","gate":false,"display_on_load":false},"invoiceitems":{"title":"Invoice Items","group_title":"Billing","group_anchor":"billing","anchor":"invoiceitems","section_anchor":"invoiceitems","subsection_anchors":["invoiceitem_object","create_invoiceitem","retrieve_invoiceitem","update_invoiceitem","delete_invoiceitem","list_invoiceitems"],"path":"/invoiceitems","gate":false,"display_on_load":false,"data":{"section_type":"resource","title":"Invoice Items","description":"Invoice Items represent the component lines of an [invoice](/docs/api/invoices). An invoice item is added to an\ninvoice by creating or updating it with an `invoice` field, at which point it will be included as\n[an invoice line item](/docs/api/invoices/line_item) within\n[invoice.lines](/docs/api/invoices/object#invoice_object-lines).\n\nInvoice Items can be created before you are ready to actually send the invoice. This can be particularly useful when combined\nwith a [subscription](/docs/api/subscriptions). Sometimes you want to add a charge or credit to a customer, but actually charge\nor credit the customer’s card only at the end of a regular billing cycle. This is useful for combining several charges\n(to minimize per-transaction fees), or for having Stripe tabulate your usage-based billing totals.\n\nRelated guides: [Integrate with the Invoicing API](/docs/invoicing/integration), [Subscription Invoices](/docs/billing/invoices/subscription#adding-upcoming-invoice-items).\n","section_tag":"invoiceitems","subsection_summaries":[{"anchor":"invoiceitem_object","curl_definition":null},{"anchor":"create_invoiceitem","curl_definition":"POST /v1/invoiceitems"},{"anchor":"retrieve_invoiceitem","curl_definition":"GET /v1/invoiceitems/:id"},{"anchor":"update_invoiceitem","curl_definition":"POST /v1/invoiceitems/:id"},{"anchor":"delete_invoiceitem","curl_definition":"DELETE /v1/invoiceitems/:id"},{"anchor":"list_invoiceitems","curl_definition":"GET /v1/invoiceitems"}]}},"invoiceitem_object":{"title":"The invoiceitem object","group_title":"Billing","group_anchor":"billing","anchor":"invoiceitem_object","section_anchor":"invoiceitems","subsection_anchors":null,"path":"/invoiceitems/object","gate":false,"display_on_load":false},"create_invoiceitem":{"title":"Create an invoice item","group_title":"Billing","group_anchor":"billing","anchor":"create_invoiceitem","section_anchor":"invoiceitems","subsection_anchors":null,"path":"/invoiceitems/create","gate":false,"display_on_load":false},"retrieve_invoiceitem":{"title":"Retrieve an invoice item","group_title":"Billing","group_anchor":"billing","anchor":"retrieve_invoiceitem","section_anchor":"invoiceitems","subsection_anchors":null,"path":"/invoiceitems/retrieve","gate":false,"display_on_load":false},"update_invoiceitem":{"title":"Update an invoice item","group_title":"Billing","group_anchor":"billing","anchor":"update_invoiceitem","section_anchor":"invoiceitems","subsection_anchors":null,"path":"/invoiceitems/update","gate":false,"display_on_load":false},"delete_invoiceitem":{"title":"Delete an invoice item","group_title":"Billing","group_anchor":"billing","anchor":"delete_invoiceitem","section_anchor":"invoiceitems","subsection_anchors":null,"path":"/invoiceitems/delete","gate":false,"display_on_load":false},"list_invoiceitems":{"title":"List all invoice items","group_title":"Billing","group_anchor":"billing","anchor":"list_invoiceitems","section_anchor":"invoiceitems","subsection_anchors":null,"path":"/invoiceitems/list","gate":false,"display_on_load":false},"plans":{"title":"Plans","group_title":"Billing","group_anchor":"billing","anchor":"plans","section_anchor":"plans","subsection_anchors":["plan_object","create_plan","retrieve_plan","update_plan","delete_plan","list_plans"],"path":"/plans","gate":false,"display_on_load":false,"data":{"section_type":"resource","title":"Plans","description":"You can now model subscriptions more flexibly using the [Prices API](#prices). It replaces the Plans API and is backwards compatible to simplify your migration.\n\nPlans define the base price, currency, and billing cycle for recurring purchases of products.\n[Products](#products) help you track inventory or provisioning, and plans help you track pricing. Different physical goods or levels of service should be represented by products, and pricing options should be represented by plans. This approach lets you change prices without having to change your provisioning scheme.\n\nFor example, you might have a single \"gold\" product that has plans for $10/month, $100/year, €9/month, and €90/year.\n\nRelated guides: [Set up a subscription](/docs/billing/subscriptions/set-up-subscription) and more about [products and prices](/docs/products-prices/overview).\n","section_tag":"plans","subsection_summaries":[{"anchor":"plan_object","curl_definition":null},{"anchor":"create_plan","curl_definition":"POST /v1/plans"},{"anchor":"retrieve_plan","curl_definition":"GET /v1/plans/:id"},{"anchor":"update_plan","curl_definition":"POST /v1/plans/:id"},{"anchor":"delete_plan","curl_definition":"DELETE /v1/plans/:id"},{"anchor":"list_plans","curl_definition":"GET /v1/plans"}]}},"plan_object":{"title":"The plan object","group_title":"Billing","group_anchor":"billing","anchor":"plan_object","section_anchor":"plans","subsection_anchors":null,"path":"/plans/object","gate":false,"display_on_load":false},"create_plan":{"title":"Create a plan","group_title":"Billing","group_anchor":"billing","anchor":"create_plan","section_anchor":"plans","subsection_anchors":null,"path":"/plans/create","gate":false,"display_on_load":false},"retrieve_plan":{"title":"Retrieve a plan","group_title":"Billing","group_anchor":"billing","anchor":"retrieve_plan","section_anchor":"plans","subsection_anchors":null,"path":"/plans/retrieve","gate":false,"display_on_load":false},"update_plan":{"title":"Update a plan","group_title":"Billing","group_anchor":"billing","anchor":"update_plan","section_anchor":"plans","subsection_anchors":null,"path":"/plans/update","gate":false,"display_on_load":false},"delete_plan":{"title":"Delete a plan","group_title":"Billing","group_anchor":"billing","anchor":"delete_plan","section_anchor":"plans","subsection_anchors":null,"path":"/plans/delete","gate":false,"display_on_load":false},"list_plans":{"title":"List all plans","group_title":"Billing","group_anchor":"billing","anchor":"list_plans","section_anchor":"plans","subsection_anchors":null,"path":"/plans/list","gate":false,"display_on_load":false},"quotes":{"title":"Quotes","group_title":"Billing","group_anchor":"billing","anchor":"quotes","section_anchor":"quotes","subsection_anchors":["quote_object","create_quote","retrieve_quote","update_quote","finalize_quote","accept_quote","cancel_quote","download_pdf_method","list_line_item","list_upfront_line_item","list_quote"],"path":"/quotes","gate":false,"display_on_load":false,"data":{"section_type":"resource","title":"Quote","description":"A Quote is a way to model prices that you'd like to provide to a customer.\nOnce accepted, it will automatically create an invoice, subscription or subscription schedule.\n","section_tag":"quotes","subsection_summaries":[{"anchor":"quote_object","curl_definition":null},{"anchor":"create_quote","curl_definition":"POST /v1/quotes"},{"anchor":"retrieve_quote","curl_definition":"GET /v1/quotes/:id"},{"anchor":"update_quote","curl_definition":"POST /v1/quotes/:id"},{"anchor":"finalize_quote","curl_definition":"POST /v1/quotes/:id/finalize"},{"anchor":"accept_quote","curl_definition":"POST /v1/quotes/:id/accept"},{"anchor":"cancel_quote","curl_definition":"POST /v1/quotes/:id/cancel"},{"anchor":"download_pdf_method","curl_definition":"GET https://files.stripe.com/v1/quotes/:id/pdf"},{"anchor":"list_line_item","curl_definition":"GET /v1/quotes/:id/line_items"},{"anchor":"list_upfront_line_item","curl_definition":"GET /v1/quotes/:id/computed_upfront_line_items"},{"anchor":"list_quote","curl_definition":"GET /v1/quotes"}]}},"quote_object":{"title":"The quote object","group_title":"Billing","group_anchor":"billing","anchor":"quote_object","section_anchor":"quotes","subsection_anchors":null,"path":"/quotes/object","gate":false,"display_on_load":false},"create_quote":{"title":"Create a quote","group_title":"Billing","group_anchor":"billing","anchor":"create_quote","section_anchor":"quotes","subsection_anchors":null,"path":"/quotes/create","gate":false,"display_on_load":false},"retrieve_quote":{"title":"Retrieve a quote","group_title":"Billing","group_anchor":"billing","anchor":"retrieve_quote","section_anchor":"quotes","subsection_anchors":null,"path":"/quotes/retrieve","gate":false,"display_on_load":false},"update_quote":{"title":"Update a quote","group_title":"Billing","group_anchor":"billing","anchor":"update_quote","section_anchor":"quotes","subsection_anchors":null,"path":"/quotes/update","gate":false,"display_on_load":false},"finalize_quote":{"title":"Finalize a quote","group_title":"Billing","group_anchor":"billing","anchor":"finalize_quote","section_anchor":"quotes","subsection_anchors":null,"path":"/quotes/finalize","gate":false,"display_on_load":false},"accept_quote":{"title":"Accept a quote","group_title":"Billing","group_anchor":"billing","anchor":"accept_quote","section_anchor":"quotes","subsection_anchors":null,"path":"/quotes/accept","gate":false,"display_on_load":false},"cancel_quote":{"title":"Cancel a quote","group_title":"Billing","group_anchor":"billing","anchor":"cancel_quote","section_anchor":"quotes","subsection_anchors":null,"path":"/quotes/cancel","gate":false,"display_on_load":false},"download_pdf_method":{"title":"Download quote PDF","group_title":"Billing","group_anchor":"billing","anchor":"download_pdf_method","section_anchor":"quotes","subsection_anchors":null,"path":"/quotes/pdf","gate":false,"display_on_load":false},"list_line_item":{"title":"Retrieve a quote's line items","group_title":"Billing","group_anchor":"billing","anchor":"list_line_item","section_anchor":"quotes","subsection_anchors":null,"path":"/quotes/line_items/list","gate":false,"display_on_load":false},"list_upfront_line_item":{"title":"Retrieve a quote's upfront line items","group_title":"Billing","group_anchor":"billing","anchor":"list_upfront_line_item","section_anchor":"quotes","subsection_anchors":null,"path":"/quotes/line_items/upfront/list","gate":false,"display_on_load":false},"list_quote":{"title":"List all quotes","group_title":"Billing","group_anchor":"billing","anchor":"list_quote","section_anchor":"quotes","subsection_anchors":null,"path":"/quotes/list","gate":false,"display_on_load":false},"subscriptions":{"title":"Subscriptions","group_title":"Billing","group_anchor":"billing","anchor":"subscriptions","section_anchor":"subscriptions","subsection_anchors":["subscription_object","create_subscription","retrieve_subscription","update_subscription","resume_subscription","cancel_subscription","list_subscriptions","subscriptions_search"],"path":"/subscriptions","gate":false,"display_on_load":false,"data":{"section_type":"resource","title":"Subscriptions","description":"Subscriptions allow you to charge a customer on a recurring basis.\n\nRelated guide: [Creating Subscriptions](/docs/billing/subscriptions/creating).\n","section_tag":"subscriptions","subsection_summaries":[{"anchor":"subscription_object","curl_definition":null},{"anchor":"create_subscription","curl_definition":"POST /v1/subscriptions"},{"anchor":"retrieve_subscription","curl_definition":"GET /v1/subscriptions/:id"},{"anchor":"update_subscription","curl_definition":"POST /v1/subscriptions/:id"},{"anchor":"resume_subscription","curl_definition":"POST /v1/subscriptions/:id/resume"},{"anchor":"cancel_subscription","curl_definition":"DELETE /v1/subscriptions/:id"},{"anchor":"list_subscriptions","curl_definition":"GET /v1/subscriptions"},{"anchor":"subscriptions_search","curl_definition":"GET /v1/subscriptions/search"}]}},"subscription_object":{"title":"The subscription object","group_title":"Billing","group_anchor":"billing","anchor":"subscription_object","section_anchor":"subscriptions","subsection_anchors":null,"path":"/subscriptions/object","gate":false,"display_on_load":false},"create_subscription":{"title":"Create a subscription","group_title":"Billing","group_anchor":"billing","anchor":"create_subscription","section_anchor":"subscriptions","subsection_anchors":null,"path":"/subscriptions/create","gate":false,"display_on_load":false},"retrieve_subscription":{"title":"Retrieve a subscription","group_title":"Billing","group_anchor":"billing","anchor":"retrieve_subscription","section_anchor":"subscriptions","subsection_anchors":null,"path":"/subscriptions/retrieve","gate":false,"display_on_load":false},"update_subscription":{"title":"Update a subscription","group_title":"Billing","group_anchor":"billing","anchor":"update_subscription","section_anchor":"subscriptions","subsection_anchors":null,"path":"/subscriptions/update","gate":false,"display_on_load":false},"resume_subscription":{"title":"Resume a subscription","group_title":"Billing","group_anchor":"billing","anchor":"resume_subscription","section_anchor":"subscriptions","subsection_anchors":null,"path":"/subscriptions/resume","gate":false,"display_on_load":false},"cancel_subscription":{"title":"Cancel a subscription","group_title":"Billing","group_anchor":"billing","anchor":"cancel_subscription","section_anchor":"subscriptions","subsection_anchors":null,"path":"/subscriptions/cancel","gate":false,"display_on_load":false},"list_subscriptions":{"title":"List subscriptions","group_title":"Billing","group_anchor":"billing","anchor":"list_subscriptions","section_anchor":"subscriptions","subsection_anchors":null,"path":"/subscriptions/list","gate":false,"display_on_load":false},"subscriptions_search":{"title":"Search subscriptions","group_title":"Billing","group_anchor":"billing","anchor":"subscriptions_search","section_anchor":"subscriptions","subsection_anchors":null,"path":"/subscriptions/search","gate":false,"display_on_load":false},"subscription_items":{"title":"Subscription Items","group_title":"Billing","group_anchor":"billing","anchor":"subscription_items","section_anchor":"subscription_items","subsection_anchors":["subscription_item_object","create_subscription_item","retrieve_subscription_item","update_subscription_item","delete_subscription_item","list_subscription_items"],"path":"/subscription_items","gate":false,"display_on_load":false,"data":{"section_type":"resource","title":"Subscription Items","description":"Subscription items allow you to create customer subscriptions with more than\none plan, making it easy to represent complex billing relationships.\n","section_tag":"subscription_items","subsection_summaries":[{"anchor":"subscription_item_object","curl_definition":null},{"anchor":"create_subscription_item","curl_definition":"POST /v1/subscription_items"},{"anchor":"retrieve_subscription_item","curl_definition":"GET /v1/subscription_items/:id"},{"anchor":"update_subscription_item","curl_definition":"POST /v1/subscription_items/:id"},{"anchor":"delete_subscription_item","curl_definition":"DELETE /v1/subscription_items/:id"},{"anchor":"list_subscription_items","curl_definition":"GET /v1/subscription_items"}]}},"subscription_item_object":{"title":"The subscription item object","group_title":"Billing","group_anchor":"billing","anchor":"subscription_item_object","section_anchor":"subscription_items","subsection_anchors":null,"path":"/subscription_items/object","gate":false,"display_on_load":false},"create_subscription_item":{"title":"Create a subscription item","group_title":"Billing","group_anchor":"billing","anchor":"create_subscription_item","section_anchor":"subscription_items","subsection_anchors":null,"path":"/subscription_items/create","gate":false,"display_on_load":false},"retrieve_subscription_item":{"title":"Retrieve a subscription item","group_title":"Billing","group_anchor":"billing","anchor":"retrieve_subscription_item","section_anchor":"subscription_items","subsection_anchors":null,"path":"/subscription_items/retrieve","gate":false,"display_on_load":false},"update_subscription_item":{"title":"Update a subscription item","group_title":"Billing","group_anchor":"billing","anchor":"update_subscription_item","section_anchor":"subscription_items","subsection_anchors":null,"path":"/subscription_items/update","gate":false,"display_on_load":false},"delete_subscription_item":{"title":"Delete a subscription item","group_title":"Billing","group_anchor":"billing","anchor":"delete_subscription_item","section_anchor":"subscription_items","subsection_anchors":null,"path":"/subscription_items/delete","gate":false,"display_on_load":false},"list_subscription_items":{"title":"List all subscription items","group_title":"Billing","group_anchor":"billing","anchor":"list_subscription_items","section_anchor":"subscription_items","subsection_anchors":null,"path":"/subscription_items/list","gate":false,"display_on_load":false},"subscription_schedules":{"title":"Subscription Schedules","group_title":"Billing","group_anchor":"billing","anchor":"subscription_schedules","section_anchor":"subscription_schedules","subsection_anchors":["subscription_schedule_object","create_subscription_schedule","retrieve_subscription_schedule","update_subscription_schedule","cancel_subscription_schedule","release_subscription_schedule","list_subscription_schedules"],"path":"/subscription_schedules","gate":false,"display_on_load":false,"data":{"section_type":"resource","title":"Subscription Schedule","description":"A subscription schedule allows you to create and manage the lifecycle of a subscription by predefining expected changes.\n\nRelated guide: [Subscription Schedules](/docs/billing/subscriptions/subscription-schedules).\n","section_tag":"subscription_schedules","subsection_summaries":[{"anchor":"subscription_schedule_object","curl_definition":null},{"anchor":"create_subscription_schedule","curl_definition":"POST /v1/subscription_schedules"},{"anchor":"retrieve_subscription_schedule","curl_definition":"GET /v1/subscription_schedules/:id"},{"anchor":"update_subscription_schedule","curl_definition":"POST /v1/subscription_schedules/:id"},{"anchor":"cancel_subscription_schedule","curl_definition":"POST /v1/subscription_schedules/:id/cancel"},{"anchor":"release_subscription_schedule","curl_definition":"POST /v1/subscription_schedules/:id/release"},{"anchor":"list_subscription_schedules","curl_definition":"GET /v1/subscription_schedules"}]}},"subscription_schedule_object":{"title":"The schedule object","group_title":"Billing","group_anchor":"billing","anchor":"subscription_schedule_object","section_anchor":"subscription_schedules","subsection_anchors":null,"path":"/subscription_schedules/object","gate":false,"display_on_load":false},"create_subscription_schedule":{"title":"Create a schedule","group_title":"Billing","group_anchor":"billing","anchor":"create_subscription_schedule","section_anchor":"subscription_schedules","subsection_anchors":null,"path":"/subscription_schedules/create","gate":false,"display_on_load":false},"retrieve_subscription_schedule":{"title":"Retrieve a schedule","group_title":"Billing","group_anchor":"billing","anchor":"retrieve_subscription_schedule","section_anchor":"subscription_schedules","subsection_anchors":null,"path":"/subscription_schedules/retrieve","gate":false,"display_on_load":false},"update_subscription_schedule":{"title":"Update a schedule","group_title":"Billing","group_anchor":"billing","anchor":"update_subscription_schedule","section_anchor":"subscription_schedules","subsection_anchors":null,"path":"/subscription_schedules/update","gate":false,"display_on_load":false},"cancel_subscription_schedule":{"title":"Cancel a schedule","group_title":"Billing","group_anchor":"billing","anchor":"cancel_subscription_schedule","section_anchor":"subscription_schedules","subsection_anchors":null,"path":"/subscription_schedules/cancel","gate":false,"display_on_load":false},"release_subscription_schedule":{"title":"Release a schedule","group_title":"Billing","group_anchor":"billing","anchor":"release_subscription_schedule","section_anchor":"subscription_schedules","subsection_anchors":null,"path":"/subscription_schedules/release","gate":false,"display_on_load":false},"list_subscription_schedules":{"title":"List all schedules","group_title":"Billing","group_anchor":"billing","anchor":"list_subscription_schedules","section_anchor":"subscription_schedules","subsection_anchors":null,"path":"/subscription_schedules/list","gate":false,"display_on_load":false},"test_clocks":{"title":"Test Clocks","group_title":"Billing","group_anchor":"billing","anchor":"test_clocks","section_anchor":"test_clocks","subsection_anchors":["test_clock_object","create_test_clock","retrieve_test_clock","delete_test_clock","advance_test_clock","list_test_clocks"],"path":"/test_clocks","gate":false,"display_on_load":false,"data":{"section_type":"resource","title":"Test Clocks","description":"A test clock enables deterministic control over objects in testmode. With a test clock, you can create\nobjects at a frozen time in the past or future, and advance to a specific future time to observe webhooks and state changes. After the clock advances,\nyou can either validate the current state of your scenario (and test your assumptions), change the current state of your scenario (and test more complex scenarios), or keep advancing forward in time.\n","section_tag":"test_clocks","subsection_summaries":[{"anchor":"test_clock_object","curl_definition":null},{"anchor":"create_test_clock","curl_definition":"POST /v1/test_helpers/test_clocks"},{"anchor":"retrieve_test_clock","curl_definition":"GET /v1/test_helpers/test_clocks/:id"},{"anchor":"delete_test_clock","curl_definition":"DELETE /v1/test_helpers/test_clocks/:id"},{"anchor":"advance_test_clock","curl_definition":"POST /v1/test_helpers/test_clocks/:id/advance"},{"anchor":"list_test_clocks","curl_definition":"GET /v1/test_helpers/test_clocks"}]}},"test_clock_object":{"title":"The test clock object","group_title":"Billing","group_anchor":"billing","anchor":"test_clock_object","section_anchor":"test_clocks","subsection_anchors":null,"path":"/test_clocks/object","gate":false,"display_on_load":false},"create_test_clock":{"title":"Create a test clock","group_title":"Billing","group_anchor":"billing","anchor":"create_test_clock","section_anchor":"test_clocks","subsection_anchors":null,"path":"/test_clocks/create","gate":false,"display_on_load":false},"retrieve_test_clock":{"title":"Retrieve a test clock","group_title":"Billing","group_anchor":"billing","anchor":"retrieve_test_clock","section_anchor":"test_clocks","subsection_anchors":null,"path":"/test_clocks/retrieve","gate":false,"display_on_load":false},"delete_test_clock":{"title":"Delete a test clock","group_title":"Billing","group_anchor":"billing","anchor":"delete_test_clock","section_anchor":"test_clocks","subsection_anchors":null,"path":"/test_clocks/delete","gate":false,"display_on_load":false},"advance_test_clock":{"title":"Advance a test clock","group_title":"Billing","group_anchor":"billing","anchor":"advance_test_clock","section_anchor":"test_clocks","subsection_anchors":null,"path":"/test_clocks/advance","gate":false,"display_on_load":false},"list_test_clocks":{"title":"List all test clocks","group_title":"Billing","group_anchor":"billing","anchor":"list_test_clocks","section_anchor":"test_clocks","subsection_anchors":null,"path":"/test_clocks/list","gate":false,"display_on_load":false},"usage_records":{"title":"Usage Records","group_title":"Billing","group_anchor":"billing","anchor":"usage_records","section_anchor":"usage_records","subsection_anchors":["usage_record_object","usage_record_create","usage_record_summary_all"],"path":"/usage_records","gate":false,"display_on_load":false,"data":{"section_type":"resource","title":"Usage Records","description":"Usage records allow you to report customer usage and metrics to Stripe for\nmetered billing of subscription prices.\n\nRelated guide: [Metered Billing](/docs/billing/subscriptions/metered-billing).\n","section_tag":"usage_records","subsection_summaries":[{"anchor":"usage_record_object","curl_definition":null},{"anchor":"usage_record_create","curl_definition":"POST /v1/subscription_items/:id/usage_records"},{"anchor":"usage_record_summary_all","curl_definition":"GET /v1/subscription_items/:id/usage_record_summaries"}]}},"usage_record_object":{"title":"The usage record object","group_title":"Billing","group_anchor":"billing","anchor":"usage_record_object","section_anchor":"usage_records","subsection_anchors":null,"path":"/usage_records/object","gate":false,"display_on_load":false},"usage_record_create":{"title":"Create a usage record","group_title":"Billing","group_anchor":"billing","anchor":"usage_record_create","section_anchor":"usage_records","subsection_anchors":null,"path":"/usage_records/create","gate":false,"display_on_load":false},"usage_record_summary_all":{"title":"List all subscription item period summaries","group_title":"Billing","group_anchor":"billing","anchor":"usage_record_summary_all","section_anchor":"usage_records","subsection_anchors":null,"path":"/usage_records/subscription_item_summary_list","gate":false,"display_on_load":false},"accounts":{"title":"Accounts","group_title":"Connect","group_anchor":"connect","anchor":"accounts","section_anchor":"accounts","subsection_anchors":["account_object","create_account","retrieve_account","update_account","delete_account","reject_account","list_accounts","login_link_object","create_login_link"],"path":"/accounts","gate":false,"display_on_load":false,"data":{"section_type":"resource","title":"Accounts","description":"This is an object representing a Stripe account. You can retrieve it to see\nproperties on the account like its current requirements or if the account is\nenabled to make live charges or receive payouts.\n\nFor Custom accounts, the properties below are always returned. For other accounts, some properties are returned until that\naccount has started to go through Connect Onboarding. Once you create an [Account Link](/docs/api/account_links)\nfor a Standard or Express account, some parameters are no longer returned. These are marked as **Custom Only** or **Custom and Express**\nbelow. Learn about the differences [between accounts](/docs/connect/accounts).\n","section_tag":"accounts","subsection_summaries":[{"anchor":"account_object","curl_definition":null},{"anchor":"create_account","curl_definition":"POST /v1/accounts"},{"anchor":"retrieve_account","curl_definition":"GET /v1/accounts/:id"},{"anchor":"update_account","curl_definition":"POST /v1/accounts/:id"},{"anchor":"delete_account","curl_definition":"DELETE /v1/accounts/:id"},{"anchor":"reject_account","curl_definition":"POST /v1/accounts/:id/reject"},{"anchor":"list_accounts","curl_definition":"GET /v1/accounts"},{"anchor":"login_link_object","curl_definition":null},{"anchor":"create_login_link","curl_definition":"POST /v1/accounts/:id/login_links"}]}},"account_object":{"title":"The account object","group_title":"Connect","group_anchor":"connect","anchor":"account_object","section_anchor":"accounts","subsection_anchors":null,"path":"/accounts/object","gate":false,"display_on_load":false},"create_account":{"title":"Create an account","group_title":"Connect","group_anchor":"connect","anchor":"create_account","section_anchor":"accounts","subsection_anchors":null,"path":"/accounts/create","gate":false,"display_on_load":false},"retrieve_account":{"title":"Retrieve account","group_title":"Connect","group_anchor":"connect","anchor":"retrieve_account","section_anchor":"accounts","subsection_anchors":null,"path":"/accounts/retrieve","gate":false,"display_on_load":false},"update_account":{"title":"Update an account","group_title":"Connect","group_anchor":"connect","anchor":"update_account","section_anchor":"accounts","subsection_anchors":null,"path":"/accounts/update","gate":false,"display_on_load":false},"delete_account":{"title":"Delete an account","group_title":"Connect","group_anchor":"connect","anchor":"delete_account","section_anchor":"accounts","subsection_anchors":null,"path":"/accounts/delete","gate":false,"display_on_load":false},"reject_account":{"title":"Reject an account","group_title":"Connect","group_anchor":"connect","anchor":"reject_account","section_anchor":"accounts","subsection_anchors":null,"path":"/account/reject","gate":false,"display_on_load":false},"list_accounts":{"title":"List all connected accounts","group_title":"Connect","group_anchor":"connect","anchor":"list_accounts","section_anchor":"accounts","subsection_anchors":null,"path":"/accounts/list","gate":false,"display_on_load":false},"login_link_object":{"title":"The login link object","group_title":"Connect","group_anchor":"connect","anchor":"login_link_object","section_anchor":"accounts","subsection_anchors":null,"path":"/account/login_link","gate":false,"display_on_load":false},"create_login_link":{"title":"Create a login link","group_title":"Connect","group_anchor":"connect","anchor":"create_login_link","section_anchor":"accounts","subsection_anchors":null,"path":"/account/create_login_link","gate":false,"display_on_load":false},"account_links":{"title":"Account Links","group_title":"Connect","group_anchor":"connect","anchor":"account_links","section_anchor":"account_links","subsection_anchors":["account_link_object","create_account_link"],"path":"/account_links","gate":false,"display_on_load":false,"data":{"section_type":"resource","title":"Account Links","description":"Account Links are the means by which a Connect platform grants a connected account permission to access\nStripe-hosted applications, such as Connect Onboarding.\n\nRelated guide: [Connect Onboarding](/docs/connect/connect-onboarding).\n","section_tag":"account_links","subsection_summaries":[{"anchor":"account_link_object","curl_definition":null},{"anchor":"create_account_link","curl_definition":"POST /v1/account_links"}]}},"account_link_object":{"title":"The account link object","group_title":"Connect","group_anchor":"connect","anchor":"account_link_object","section_anchor":"account_links","subsection_anchors":null,"path":"/account_links/object","gate":false,"display_on_load":false},"create_account_link":{"title":"Create an account link","group_title":"Connect","group_anchor":"connect","anchor":"create_account_link","section_anchor":"account_links","subsection_anchors":null,"path":"/account_links/create","gate":false,"display_on_load":false},"account_sessions":{"title":"Account Sessions","group_title":"Connect","group_anchor":"connect","anchor":"account_sessions","section_anchor":"account_sessions","subsection_anchors":["account_session_object","create_account_session"],"path":"/account_sessions","gate":true,"display_on_load":false,"data":{"section_type":"resource","title":"Account Session","description":"An AccountSession allows a Connect platform to grant access to a connected account in Connect embedded UIs.\n\nWe recommend that you create an AccountSession each time you need to display an embedded UI\nto your user. Do not save AccountSessions to your database as they expire relatively\nquickly, and cannot be used more than once.\n\nRelated guide: [Connect embedded UIs](/docs/connect/get-started-connect-embedded-uis).\n","section_tag":"account_sessions","subsection_summaries":[{"anchor":"account_session_object","curl_definition":null},{"anchor":"create_account_session","curl_definition":"POST /v1/account_sessions"}]}},"account_session_object":{"title":"The account session object","group_title":"Connect","group_anchor":"connect","anchor":"account_session_object","section_anchor":"account_sessions","subsection_anchors":null,"path":"/account_sessions/object","gate":false,"display_on_load":false},"create_account_session":{"title":"Create an Account Session","group_title":"Connect","group_anchor":"connect","anchor":"create_account_session","section_anchor":"account_sessions","subsection_anchors":null,"path":"/account_sessions/create","gate":false,"display_on_load":false},"application_fees":{"title":"Application Fees","group_title":"Connect","group_anchor":"connect","anchor":"application_fees","section_anchor":"application_fees","subsection_anchors":["application_fee_object","retrieve_application_fee","list_application_fees"],"path":"/application_fees","gate":false,"display_on_load":false,"data":{"section_type":"resource","title":"Application Fees","description":"When you collect a transaction fee on top of a charge made for your user\n(using [Connect](/docs/connect)), an `Application Fee` object is created in\nyour account. You can list, retrieve, and refund application fees.\n\nRelated guide: [Collecting Application Fees](/docs/connect/direct-charges#collecting-fees).\n","section_tag":"application_fees","subsection_summaries":[{"anchor":"application_fee_object","curl_definition":null},{"anchor":"retrieve_application_fee","curl_definition":"GET /v1/application_fees/:id"},{"anchor":"list_application_fees","curl_definition":"GET /v1/application_fees"}]}},"application_fee_object":{"title":"The application fee object","group_title":"Connect","group_anchor":"connect","anchor":"application_fee_object","section_anchor":"application_fees","subsection_anchors":null,"path":"/application_fees/object","gate":false,"display_on_load":false},"retrieve_application_fee":{"title":"Retrieve an application fee","group_title":"Connect","group_anchor":"connect","anchor":"retrieve_application_fee","section_anchor":"application_fees","subsection_anchors":null,"path":"/application_fees/retrieve","gate":false,"display_on_load":false},"list_application_fees":{"title":"List all application fees","group_title":"Connect","group_anchor":"connect","anchor":"list_application_fees","section_anchor":"application_fees","subsection_anchors":null,"path":"/application_fees/list","gate":false,"display_on_load":false},"fee_refunds":{"title":"Application Fee Refunds","group_title":"Connect","group_anchor":"connect","anchor":"fee_refunds","section_anchor":"fee_refunds","subsection_anchors":["fee_refund_object","create_fee_refund","retrieve_fee_refund","update_fee_refund","list_fee_refunds"],"path":"/fee_refunds","gate":false,"display_on_load":false,"data":{"section_type":"resource","title":"Application Fee Refunds","description":"`Application Fee Refund` objects allow you to refund an application fee that\nhas previously been created but not yet refunded. Funds will be refunded to\nthe Stripe account from which the fee was originally collected.\n\nRelated guide: [Refunding Application Fees](/docs/connect/destination-charges#refunding-app-fee).\n","section_tag":"fee_refunds","subsection_summaries":[{"anchor":"fee_refund_object","curl_definition":null},{"anchor":"create_fee_refund","curl_definition":"POST /v1/application_fees/:id/refunds"},{"anchor":"retrieve_fee_refund","curl_definition":"GET /v1/application_fees/:id/refunds/:id"},{"anchor":"update_fee_refund","curl_definition":"POST /v1/application_fees/:id/refunds/:id"},{"anchor":"list_fee_refunds","curl_definition":"GET /v1/application_fees/:id/refunds"}]}},"fee_refund_object":{"title":"The application fee refund object","group_title":"Connect","group_anchor":"connect","anchor":"fee_refund_object","section_anchor":"fee_refunds","subsection_anchors":null,"path":"/fee_refunds/object","gate":false,"display_on_load":false},"create_fee_refund":{"title":"Create an application fee refund","group_title":"Connect","group_anchor":"connect","anchor":"create_fee_refund","section_anchor":"fee_refunds","subsection_anchors":null,"path":"/fee_refunds/create","gate":false,"display_on_load":false},"retrieve_fee_refund":{"title":"Retrieve an application fee refund","group_title":"Connect","group_anchor":"connect","anchor":"retrieve_fee_refund","section_anchor":"fee_refunds","subsection_anchors":null,"path":"/fee_refunds/retrieve","gate":false,"display_on_load":false},"update_fee_refund":{"title":"Update an application fee refund","group_title":"Connect","group_anchor":"connect","anchor":"update_fee_refund","section_anchor":"fee_refunds","subsection_anchors":null,"path":"/fee_refunds/update","gate":false,"display_on_load":false},"list_fee_refunds":{"title":"List all application fee refunds","group_title":"Connect","group_anchor":"connect","anchor":"list_fee_refunds","section_anchor":"fee_refunds","subsection_anchors":null,"path":"/fee_refunds/list","gate":false,"display_on_load":false},"capabilities":{"title":"Capabilities","group_title":"Connect","group_anchor":"connect","anchor":"capabilities","section_anchor":"capabilities","subsection_anchors":["capability_object","retrieve_capability","update_capability","list_capability"],"path":"/capabilities","gate":false,"display_on_load":false,"data":{"section_type":"resource","title":"Capabilities","description":"This is an object representing a capability for a Stripe account.\n\nRelated guide: [Account capabilities](/docs/connect/account-capabilities).\n","section_tag":"capabilities","subsection_summaries":[{"anchor":"capability_object","curl_definition":null},{"anchor":"retrieve_capability","curl_definition":"GET /v1/accounts/:id/capabilities/:id"},{"anchor":"update_capability","curl_definition":"POST /v1/accounts/:id/capabilities/:id"},{"anchor":"list_capability","curl_definition":"GET /v1/accounts/:id/capabilities"}]}},"capability_object":{"title":"The capability object","group_title":"Connect","group_anchor":"connect","anchor":"capability_object","section_anchor":"capabilities","subsection_anchors":null,"path":"/capabilities/object","gate":false,"display_on_load":false},"retrieve_capability":{"title":"Retrieve an Account Capability","group_title":"Connect","group_anchor":"connect","anchor":"retrieve_capability","section_anchor":"capabilities","subsection_anchors":null,"path":"/capabilities/retrieve","gate":false,"display_on_load":false},"update_capability":{"title":"Update an Account Capability","group_title":"Connect","group_anchor":"connect","anchor":"update_capability","section_anchor":"capabilities","subsection_anchors":null,"path":"/capabilities/update","gate":false,"display_on_load":false},"list_capability":{"title":"List all account capabilities","group_title":"Connect","group_anchor":"connect","anchor":"list_capability","section_anchor":"capabilities","subsection_anchors":null,"path":"/capabilities/list","gate":false,"display_on_load":false},"country_specs":{"title":"Country Specs","group_title":"Connect","group_anchor":"connect","anchor":"country_specs","section_anchor":"country_specs","subsection_anchors":["country_spec_object","list_country_specs","retrieve_country_spec"],"path":"/country_specs","gate":false,"display_on_load":false,"data":{"section_type":"resource","title":"Country Specs","description":"Stripe needs to collect certain pieces of information about each account\ncreated. These requirements can differ depending on the account's country. The\nCountry Specs API makes these rules available to your integration.\n\nYou can also view the information from this API call as [an online\nguide](/docs/connect/required-verification-information).\n","section_tag":"country_specs","subsection_summaries":[{"anchor":"country_spec_object","curl_definition":null},{"anchor":"list_country_specs","curl_definition":"GET /v1/country_specs"},{"anchor":"retrieve_country_spec","curl_definition":"GET /v1/country_specs/:id"}]}},"country_spec_object":{"title":"The country spec object","group_title":"Connect","group_anchor":"connect","anchor":"country_spec_object","section_anchor":"country_specs","subsection_anchors":null,"path":"/country_specs/object","gate":false,"display_on_load":false},"list_country_specs":{"title":"List Country Specs","group_title":"Connect","group_anchor":"connect","anchor":"list_country_specs","section_anchor":"country_specs","subsection_anchors":null,"path":"/country_specs/list","gate":false,"display_on_load":false},"retrieve_country_spec":{"title":"Retrieve a Country Spec","group_title":"Connect","group_anchor":"connect","anchor":"retrieve_country_spec","section_anchor":"country_specs","subsection_anchors":null,"path":"/country_specs/retrieve","gate":false,"display_on_load":false},"external_accounts":{"title":"External Accounts","group_title":"Connect","group_anchor":"connect","anchor":"external_accounts","section_anchor":"external_accounts","subsection_anchors":["account_bank_account_object","account_create_bank_account","account_retrieve_bank_account","account_update_bank_account","account_delete_bank_account","account_list_bank_accounts","account_card_object","account_create_card","account_retrieve_card","account_update_card","account_delete_card","account_list_cards"],"path":"/external_accounts","gate":false,"display_on_load":false,"data":{"section_type":"resource","title":"External Accounts","description":"External Accounts are transfer destinations on `Account` objects for\n[connected accounts](/docs/connect/accounts). They can be bank accounts or\ndebit cards.\n\n[Bank accounts](/docs/api#customer_bank_account_object) and [debit\ncards](/docs/api#card_object) can also be used as payment sources\non regular charges, and are documented in the links above.\n\nRelated guide: [Setting Bank and Debit Card Payouts](/docs/connect/bank-debit-card-payouts).\n","section_tag":"external_accounts","subsection_summaries":[{"anchor":"account_bank_account_object","curl_definition":null},{"anchor":"account_create_bank_account","curl_definition":"POST /v1/accounts/:id/external_accounts"},{"anchor":"account_retrieve_bank_account","curl_definition":"GET /v1/accounts/:id/external_accounts/:id"},{"anchor":"account_update_bank_account","curl_definition":"POST /v1/accounts/:id/external_accounts/:id"},{"anchor":"account_delete_bank_account","curl_definition":"DELETE /v1/accounts/:id/external_accounts/:id"},{"anchor":"account_list_bank_accounts","curl_definition":"GET /v1/accounts/:id/external_accounts?object=bank_account"},{"anchor":"account_card_object","curl_definition":null},{"anchor":"account_create_card","curl_definition":"POST /v1/accounts/:id/external_accounts"},{"anchor":"account_retrieve_card","curl_definition":"GET /v1/accounts/:id/external_accounts/:id"},{"anchor":"account_update_card","curl_definition":"POST /v1/accounts/:id/external_accounts/:id"},{"anchor":"account_delete_card","curl_definition":"DELETE /v1/accounts/:id/external_accounts/:id"},{"anchor":"account_list_cards","curl_definition":"GET /v1/accounts/:id/external_accounts?object=card"}]}},"account_bank_account_object":{"title":"The (account) bank account object","group_title":"Connect","group_anchor":"connect","anchor":"account_bank_account_object","section_anchor":"external_accounts","subsection_anchors":null,"path":"/external_account_bank_accounts/object","gate":false,"display_on_load":false},"account_create_bank_account":{"title":"Create a bank account","group_title":"Connect","group_anchor":"connect","anchor":"account_create_bank_account","section_anchor":"external_accounts","subsection_anchors":null,"path":"/external_account_bank_accounts/create","gate":false,"display_on_load":false},"account_retrieve_bank_account":{"title":"Retrieve a bank account","group_title":"Connect","group_anchor":"connect","anchor":"account_retrieve_bank_account","section_anchor":"external_accounts","subsection_anchors":null,"path":"/external_account_bank_accounts/retrieve","gate":false,"display_on_load":false},"account_update_bank_account":{"title":"Update a bank account","group_title":"Connect","group_anchor":"connect","anchor":"account_update_bank_account","section_anchor":"external_accounts","subsection_anchors":null,"path":"/external_account_bank_accounts/update","gate":false,"display_on_load":false},"account_delete_bank_account":{"title":"Delete a bank account","group_title":"Connect","group_anchor":"connect","anchor":"account_delete_bank_account","section_anchor":"external_accounts","subsection_anchors":null,"path":"/external_account_bank_accounts/delete","gate":false,"display_on_load":false},"account_list_bank_accounts":{"title":"List all bank accounts","group_title":"Connect","group_anchor":"connect","anchor":"account_list_bank_accounts","section_anchor":"external_accounts","subsection_anchors":null,"path":"/external_account_bank_accounts/list","gate":false,"display_on_load":false},"account_card_object":{"title":"The (account) card object","group_title":"Connect","group_anchor":"connect","anchor":"account_card_object","section_anchor":"external_accounts","subsection_anchors":null,"path":"/external_account_cards/object","gate":false,"display_on_load":false},"account_create_card":{"title":"Create a card","group_title":"Connect","group_anchor":"connect","anchor":"account_create_card","section_anchor":"external_accounts","subsection_anchors":null,"path":"/external_account_cards/create","gate":false,"display_on_load":false},"account_retrieve_card":{"title":"Retrieve a card","group_title":"Connect","group_anchor":"connect","anchor":"account_retrieve_card","section_anchor":"external_accounts","subsection_anchors":null,"path":"/external_account_cards/retrieve","gate":false,"display_on_load":false},"account_update_card":{"title":"Update a card","group_title":"Connect","group_anchor":"connect","anchor":"account_update_card","section_anchor":"external_accounts","subsection_anchors":null,"path":"/external_account_cards/update","gate":false,"display_on_load":false},"account_delete_card":{"title":"Delete a card","group_title":"Connect","group_anchor":"connect","anchor":"account_delete_card","section_anchor":"external_accounts","subsection_anchors":null,"path":"/external_account_cards/delete","gate":false,"display_on_load":false},"account_list_cards":{"title":"List all cards","group_title":"Connect","group_anchor":"connect","anchor":"account_list_cards","section_anchor":"external_accounts","subsection_anchors":null,"path":"/external_account_cards/list","gate":false,"display_on_load":false},"persons":{"title":"Persons","group_title":"Connect","group_anchor":"connect","anchor":"persons","section_anchor":"persons","subsection_anchors":["person_object","create_person","retrieve_person","update_person","delete_person","list_person"],"path":"/persons","gate":false,"display_on_load":false,"data":{"section_type":"resource","title":"Person","description":"This is an object representing a person associated with a Stripe account.\n\nA platform cannot access a Standard or Express account's persons after the account starts onboarding, such as after generating an account link for the account.\nSee the [Standard onboarding](/docs/connect/standard-accounts) or [Express onboarding documentation](/docs/connect/express-accounts) for information about platform pre-filling and account onboarding steps.\n\nRelated guide: [Handling Identity Verification with the API](/docs/connect/identity-verification-api#person-information).\n","section_tag":"persons","subsection_summaries":[{"anchor":"person_object","curl_definition":null},{"anchor":"create_person","curl_definition":"POST /v1/accounts/:id/persons"},{"anchor":"retrieve_person","curl_definition":"GET /v1/accounts/:id/persons/:id"},{"anchor":"update_person","curl_definition":"POST /v1/accounts/:id/persons/:id"},{"anchor":"delete_person","curl_definition":"DELETE /v1/accounts/:id/persons/:id"},{"anchor":"list_person","curl_definition":"GET /v1/accounts/:id/persons"}]}},"person_object":{"title":"The person object","group_title":"Connect","group_anchor":"connect","anchor":"person_object","section_anchor":"persons","subsection_anchors":null,"path":"/persons/object","gate":false,"display_on_load":false},"create_person":{"title":"Create a person","group_title":"Connect","group_anchor":"connect","anchor":"create_person","section_anchor":"persons","subsection_anchors":null,"path":"/persons/create","gate":false,"display_on_load":false},"retrieve_person":{"title":"Retrieve a person","group_title":"Connect","group_anchor":"connect","anchor":"retrieve_person","section_anchor":"persons","subsection_anchors":null,"path":"/persons/retrieve","gate":false,"display_on_load":false},"update_person":{"title":"Update a person","group_title":"Connect","group_anchor":"connect","anchor":"update_person","section_anchor":"persons","subsection_anchors":null,"path":"/persons/update","gate":false,"display_on_load":false},"delete_person":{"title":"Delete a person","group_title":"Connect","group_anchor":"connect","anchor":"delete_person","section_anchor":"persons","subsection_anchors":null,"path":"/persons/delete","gate":false,"display_on_load":false},"list_person":{"title":"List all persons","group_title":"Connect","group_anchor":"connect","anchor":"list_person","section_anchor":"persons","subsection_anchors":null,"path":"/persons/list","gate":false,"display_on_load":false},"topups":{"title":"Top-ups","group_title":"Connect","group_anchor":"connect","anchor":"topups","section_anchor":"topups","subsection_anchors":["topup_object","create_topup","retrieve_topup","update_topup","list_topups","cancel_topup"],"path":"/topups","gate":false,"display_on_load":false,"data":{"section_type":"resource","title":"Top-ups","description":"To top up your Stripe balance, you create a top-up object. You can retrieve\nindividual top-ups, as well as list all top-ups. Top-ups are identified by a\nunique, random ID.\n\nRelated guide: [Topping Up your Platform Account](/docs/connect/top-ups).\n","section_tag":"topups","subsection_summaries":[{"anchor":"topup_object","curl_definition":null},{"anchor":"create_topup","curl_definition":"POST /v1/topups"},{"anchor":"retrieve_topup","curl_definition":"GET /v1/topups/:id"},{"anchor":"update_topup","curl_definition":"POST /v1/topups/:id"},{"anchor":"list_topups","curl_definition":"GET /v1/topups"},{"anchor":"cancel_topup","curl_definition":"POST /v1/topups/:id/cancel"}]}},"topup_object":{"title":"The top-up object","group_title":"Connect","group_anchor":"connect","anchor":"topup_object","section_anchor":"topups","subsection_anchors":null,"path":"/topups/object","gate":false,"display_on_load":false},"create_topup":{"title":"Create a top-up","group_title":"Connect","group_anchor":"connect","anchor":"create_topup","section_anchor":"topups","subsection_anchors":null,"path":"/topups/create","gate":false,"display_on_load":false},"retrieve_topup":{"title":"Retrieve a top-up","group_title":"Connect","group_anchor":"connect","anchor":"retrieve_topup","section_anchor":"topups","subsection_anchors":null,"path":"/topups/retrieve","gate":false,"display_on_load":false},"update_topup":{"title":"Update a top-up","group_title":"Connect","group_anchor":"connect","anchor":"update_topup","section_anchor":"topups","subsection_anchors":null,"path":"/topups/update","gate":false,"display_on_load":false},"list_topups":{"title":"List all top-ups","group_title":"Connect","group_anchor":"connect","anchor":"list_topups","section_anchor":"topups","subsection_anchors":null,"path":"/topups/list","gate":false,"display_on_load":false},"cancel_topup":{"title":"Cancel a top-up","group_title":"Connect","group_anchor":"connect","anchor":"cancel_topup","section_anchor":"topups","subsection_anchors":null,"path":"/topups/cancel","gate":false,"display_on_load":false},"transfers":{"title":"Transfers","group_title":"Connect","group_anchor":"connect","anchor":"transfers","section_anchor":"transfers","subsection_anchors":["transfer_object","create_transfer","retrieve_transfer","update_transfer","list_transfers"],"path":"/transfers","gate":false,"display_on_load":false,"data":{"section_type":"resource","title":"Transfers","description":"A `Transfer` object is created when you move funds between Stripe accounts as\npart of Connect.\n\nBefore April 6, 2017, transfers also represented movement of funds from a\nStripe account to a card or bank account. This behavior has since been split\nout into a [Payout](#payout_object) object, with corresponding payout endpoints. For more\ninformation, read about the\n[transfer/payout split](/docs/transfer-payout-split).\n\nRelated guide: [Creating Separate Charges and Transfers](/docs/connect/charges-transfers).\n","section_tag":"transfers","subsection_summaries":[{"anchor":"transfer_object","curl_definition":null},{"anchor":"create_transfer","curl_definition":"POST /v1/transfers"},{"anchor":"retrieve_transfer","curl_definition":"GET /v1/transfers/:id"},{"anchor":"update_transfer","curl_definition":"POST /v1/transfers/:id"},{"anchor":"list_transfers","curl_definition":"GET /v1/transfers"}]}},"transfer_object":{"title":"The transfer object","group_title":"Connect","group_anchor":"connect","anchor":"transfer_object","section_anchor":"transfers","subsection_anchors":null,"path":"/transfers/object","gate":false,"display_on_load":false},"create_transfer":{"title":"Create a transfer","group_title":"Connect","group_anchor":"connect","anchor":"create_transfer","section_anchor":"transfers","subsection_anchors":null,"path":"/transfers/create","gate":false,"display_on_load":false},"retrieve_transfer":{"title":"Retrieve a transfer","group_title":"Connect","group_anchor":"connect","anchor":"retrieve_transfer","section_anchor":"transfers","subsection_anchors":null,"path":"/transfers/retrieve","gate":false,"display_on_load":false},"update_transfer":{"title":"Update a transfer","group_title":"Connect","group_anchor":"connect","anchor":"update_transfer","section_anchor":"transfers","subsection_anchors":null,"path":"/transfers/update","gate":false,"display_on_load":false},"list_transfers":{"title":"List all transfers","group_title":"Connect","group_anchor":"connect","anchor":"list_transfers","section_anchor":"transfers","subsection_anchors":null,"path":"/transfers/list","gate":false,"display_on_load":false},"transfer_reversals":{"title":"Transfer Reversals","group_title":"Connect","group_anchor":"connect","anchor":"transfer_reversals","section_anchor":"transfer_reversals","subsection_anchors":["transfer_reversal_object","create_transfer_reversal","retrieve_transfer_reversal","update_transfer_reversal","list_transfer_reversals"],"path":"/transfer_reversals","gate":false,"display_on_load":false,"data":{"section_type":"resource","title":"Transfer Reversals","description":"[Stripe Connect](/docs/connect) platforms can reverse transfers made to a\nconnected account, either entirely or partially, and can also specify whether\nto refund any related application fees. Transfer reversals add to the\nplatform's balance and subtract from the destination account's balance.\n\nReversing a transfer that was made for a [destination\ncharge](/docs/connect/destination-charges) is allowed only up to the amount of\nthe charge. It is possible to reverse a\n[transfer_group](/docs/connect/charges-transfers#transfer-options)\ntransfer only if the destination account has enough balance to cover the\nreversal.\n\nRelated guide: [Reversing Transfers](/docs/connect/charges-transfers#reversing-transfers).\n","section_tag":"transfer_reversals","subsection_summaries":[{"anchor":"transfer_reversal_object","curl_definition":null},{"anchor":"create_transfer_reversal","curl_definition":"POST /v1/transfers/:id/reversals"},{"anchor":"retrieve_transfer_reversal","curl_definition":"GET /v1/transfers/:id/reversals/:id"},{"anchor":"update_transfer_reversal","curl_definition":"POST /v1/transfers/:id/reversals/:id"},{"anchor":"list_transfer_reversals","curl_definition":"GET /v1/transfers/:id/reversals"}]}},"transfer_reversal_object":{"title":"The transfer reversal object","group_title":"Connect","group_anchor":"connect","anchor":"transfer_reversal_object","section_anchor":"transfer_reversals","subsection_anchors":null,"path":"/transfer_reversals/object","gate":false,"display_on_load":false},"create_transfer_reversal":{"title":"Create a transfer reversal","group_title":"Connect","group_anchor":"connect","anchor":"create_transfer_reversal","section_anchor":"transfer_reversals","subsection_anchors":null,"path":"/transfer_reversals/create","gate":false,"display_on_load":false},"retrieve_transfer_reversal":{"title":"Retrieve a reversal","group_title":"Connect","group_anchor":"connect","anchor":"retrieve_transfer_reversal","section_anchor":"transfer_reversals","subsection_anchors":null,"path":"/transfer_reversals/retrieve","gate":false,"display_on_load":false},"update_transfer_reversal":{"title":"Update a reversal","group_title":"Connect","group_anchor":"connect","anchor":"update_transfer_reversal","section_anchor":"transfer_reversals","subsection_anchors":null,"path":"/transfer_reversals/update","gate":false,"display_on_load":false},"list_transfer_reversals":{"title":"List all reversals","group_title":"Connect","group_anchor":"connect","anchor":"list_transfer_reversals","section_anchor":"transfer_reversals","subsection_anchors":null,"path":"/transfer_reversals/list","gate":false,"display_on_load":false},"secret_management":{"title":"Secret Management","group_title":"Connect","group_anchor":"connect","anchor":"secret_management","section_anchor":"secret_management","subsection_anchors":["secret_object","set_secret","find_secret","delete_secret","list_secret"],"path":"/secret_management","gate":false,"display_on_load":false,"data":{"section_type":"resource","title":"Secrets","description":"Secret Store is an API that allows Stripe Apps developers to securely persist secrets for use by UI Extensions and app backends.\n\nThe primary resource in Secret Store is a `secret`. Other apps can't view secrets created by an app. Additionally, secrets are scoped to provide further permission control.\n\nAll Dashboard users and the app backend share `account` scoped secrets. Use the `account` scope for secrets that don't change per-user, like a third-party API key.\n\nA `user` scoped secret is accessible by the app backend and one specific Dashboard user. Use the `user` scope for per-user secrets like per-user OAuth tokens, where different users might have different permissions.\n\nRelated guide: [Store data between page reloads](/docs/stripe-apps/store-auth-data-custom-objects).\n","section_tag":"secret_management","subsection_summaries":[{"anchor":"secret_object","curl_definition":null},{"anchor":"set_secret","curl_definition":"POST /v1/apps/secrets"},{"anchor":"find_secret","curl_definition":"GET /v1/apps/secrets/find"},{"anchor":"delete_secret","curl_definition":"POST /v1/apps/secrets/delete"},{"anchor":"list_secret","curl_definition":"GET /v1/apps/secrets"}]}},"secret_object":{"title":"The Secret object","group_title":"Connect","group_anchor":"connect","anchor":"secret_object","section_anchor":"secret_management","subsection_anchors":null,"path":"/apps/secret_store/secret_resource","gate":false,"display_on_load":false},"set_secret":{"title":"Set a secret","group_title":"Connect","group_anchor":"connect","anchor":"set_secret","section_anchor":"secret_management","subsection_anchors":null,"path":"/apps/secret_store/set","gate":false,"display_on_load":false},"find_secret":{"title":"Find a secret","group_title":"Connect","group_anchor":"connect","anchor":"find_secret","section_anchor":"secret_management","subsection_anchors":null,"path":"/apps/secret_store/find","gate":false,"display_on_load":false},"delete_secret":{"title":"Delete a secret","group_title":"Connect","group_anchor":"connect","anchor":"delete_secret","section_anchor":"secret_management","subsection_anchors":null,"path":"/apps/secret_store/delete","gate":false,"display_on_load":false},"list_secret":{"title":"List secrets","group_title":"Connect","group_anchor":"connect","anchor":"list_secret","section_anchor":"secret_management","subsection_anchors":null,"path":"/apps/secret_store/list","gate":false,"display_on_load":false},"early_fraud_warnings":{"title":"Early Fraud Warnings","group_title":"Fraud","group_anchor":"fraud","anchor":"early_fraud_warnings","section_anchor":"early_fraud_warnings","subsection_anchors":["early_fraud_warning_object","retrieve_early_fraud_warning","list_early_fraud_warnings"],"path":"/radar/early_fraud_warnings","gate":false,"display_on_load":false,"data":{"section_type":"resource","title":"Early Fraud Warning","description":"An early fraud warning indicates that the card issuer has notified us that a\ncharge may be fraudulent.\n\nRelated guide: [Early Fraud Warnings](/docs/disputes/measuring#early-fraud-warnings).\n","section_tag":"early_fraud_warnings","subsection_summaries":[{"anchor":"early_fraud_warning_object","curl_definition":null},{"anchor":"retrieve_early_fraud_warning","curl_definition":"GET /v1/radar/early_fraud_warnings/:id"},{"anchor":"list_early_fraud_warnings","curl_definition":"GET /v1/radar/early_fraud_warnings"}]}},"early_fraud_warning_object":{"title":"The early fraud warning object","group_title":"Fraud","group_anchor":"fraud","anchor":"early_fraud_warning_object","section_anchor":"early_fraud_warnings","subsection_anchors":null,"path":"/radar/early_fraud_warnings/object","gate":false,"display_on_load":false},"retrieve_early_fraud_warning":{"title":"Retrieve an early fraud warning","group_title":"Fraud","group_anchor":"fraud","anchor":"retrieve_early_fraud_warning","section_anchor":"early_fraud_warnings","subsection_anchors":null,"path":"/radar/early_fraud_warnings/retrieve","gate":false,"display_on_load":false},"list_early_fraud_warnings":{"title":"List all early fraud warnings","group_title":"Fraud","group_anchor":"fraud","anchor":"list_early_fraud_warnings","section_anchor":"early_fraud_warnings","subsection_anchors":null,"path":"/radar/early_fraud_warnings/list","gate":false,"display_on_load":false},"reviews":{"title":"Reviews","group_title":"Fraud","group_anchor":"fraud","anchor":"reviews","section_anchor":"reviews","subsection_anchors":["review_object","approve_review","retrieve_review","list_reviews"],"path":"/radar/reviews","gate":false,"display_on_load":false,"data":{"section_type":"resource","title":"Reviews","description":"Reviews can be used to supplement automated fraud detection with human expertise.\n\nLearn more about [Radar](/radar) and reviewing payments\n[here](/docs/radar/reviews).\n","section_tag":"reviews","subsection_summaries":[{"anchor":"review_object","curl_definition":null},{"anchor":"approve_review","curl_definition":"POST /v1/reviews/:id/approve"},{"anchor":"retrieve_review","curl_definition":"GET /v1/reviews/:id"},{"anchor":"list_reviews","curl_definition":"GET /v1/reviews"}]}},"review_object":{"title":"The review object","group_title":"Fraud","group_anchor":"fraud","anchor":"review_object","section_anchor":"reviews","subsection_anchors":null,"path":"/radar/reviews/object","gate":false,"display_on_load":false},"approve_review":{"title":"Approve a review","group_title":"Fraud","group_anchor":"fraud","anchor":"approve_review","section_anchor":"reviews","subsection_anchors":null,"path":"/radar/reviews/approve","gate":false,"display_on_load":false},"retrieve_review":{"title":"Retrieve a review","group_title":"Fraud","group_anchor":"fraud","anchor":"retrieve_review","section_anchor":"reviews","subsection_anchors":null,"path":"/radar/reviews/retrieve","gate":false,"display_on_load":false},"list_reviews":{"title":"List all open reviews","group_title":"Fraud","group_anchor":"fraud","anchor":"list_reviews","section_anchor":"reviews","subsection_anchors":null,"path":"/radar/reviews/list","gate":false,"display_on_load":false},"value_lists":{"title":"Value Lists","group_title":"Fraud","group_anchor":"fraud","anchor":"value_lists","section_anchor":"value_lists","subsection_anchors":["radar_value_list_object","create_value_list","retrieve_value_list","update_value_list","delete_value_list","list_value_lists"],"path":"/radar/value_lists","gate":false,"display_on_load":false,"data":{"section_type":"resource","title":"Value Lists","description":"Value lists allow you to group values together which can then be referenced in rules.\n\nRelated guide: [Default Stripe Lists](/docs/radar/lists#managing-list-items).\n","section_tag":"value_lists","subsection_summaries":[{"anchor":"radar_value_list_object","curl_definition":null},{"anchor":"create_value_list","curl_definition":"POST /v1/radar/value_lists"},{"anchor":"retrieve_value_list","curl_definition":"GET /v1/radar/value_lists/:id"},{"anchor":"update_value_list","curl_definition":"POST /v1/radar/value_lists/:id"},{"anchor":"delete_value_list","curl_definition":"DELETE /v1/radar/value_lists/:id"},{"anchor":"list_value_lists","curl_definition":"GET /v1/radar/value_lists"}]}},"radar_value_list_object":{"title":"The value list object","group_title":"Fraud","group_anchor":"fraud","anchor":"radar_value_list_object","section_anchor":"value_lists","subsection_anchors":null,"path":"/radar/value_lists/object","gate":false,"display_on_load":false},"create_value_list":{"title":"Create a value list","group_title":"Fraud","group_anchor":"fraud","anchor":"create_value_list","section_anchor":"value_lists","subsection_anchors":null,"path":"/radar/value_lists/create","gate":false,"display_on_load":false},"retrieve_value_list":{"title":"Retrieve a value list","group_title":"Fraud","group_anchor":"fraud","anchor":"retrieve_value_list","section_anchor":"value_lists","subsection_anchors":null,"path":"/radar/value_lists/retrieve","gate":false,"display_on_load":false},"update_value_list":{"title":"Update a value list","group_title":"Fraud","group_anchor":"fraud","anchor":"update_value_list","section_anchor":"value_lists","subsection_anchors":null,"path":"/radar/value_lists/update","gate":false,"display_on_load":false},"delete_value_list":{"title":"Delete a value list","group_title":"Fraud","group_anchor":"fraud","anchor":"delete_value_list","section_anchor":"value_lists","subsection_anchors":null,"path":"/radar/value_lists/delete","gate":false,"display_on_load":false},"list_value_lists":{"title":"List all value lists","group_title":"Fraud","group_anchor":"fraud","anchor":"list_value_lists","section_anchor":"value_lists","subsection_anchors":null,"path":"/radar/value_lists/list","gate":false,"display_on_load":false},"value_list_items":{"title":"Value List Items","group_title":"Fraud","group_anchor":"fraud","anchor":"value_list_items","section_anchor":"value_list_items","subsection_anchors":["radar_value_list_item_object","create_value_list_item","retrieve_value_list_item","delete_value_list_item","list_value_list_items"],"path":"/radar/value_list_items","gate":false,"display_on_load":false,"data":{"section_type":"resource","title":"Value List Items","description":"Value list items allow you to add specific values to a given Radar value list, which can then be used in rules.\n\nRelated guide: [Managing List Items](/docs/radar/lists#managing-list-items).\n","section_tag":"value_list_items","subsection_summaries":[{"anchor":"radar_value_list_item_object","curl_definition":null},{"anchor":"create_value_list_item","curl_definition":"POST /v1/radar/value_list_items"},{"anchor":"retrieve_value_list_item","curl_definition":"GET /v1/radar/value_list_items/:id"},{"anchor":"delete_value_list_item","curl_definition":"DELETE /v1/radar/value_list_items/:id"},{"anchor":"list_value_list_items","curl_definition":"GET /v1/radar/value_list_items"}]}},"radar_value_list_item_object":{"title":"The value list item object","group_title":"Fraud","group_anchor":"fraud","anchor":"radar_value_list_item_object","section_anchor":"value_list_items","subsection_anchors":null,"path":"/radar/value_list_items/object","gate":false,"display_on_load":false},"create_value_list_item":{"title":"Create a value list item","group_title":"Fraud","group_anchor":"fraud","anchor":"create_value_list_item","section_anchor":"value_list_items","subsection_anchors":null,"path":"/radar/value_list_items/create","gate":false,"display_on_load":false},"retrieve_value_list_item":{"title":"Retrieve a value list item","group_title":"Fraud","group_anchor":"fraud","anchor":"retrieve_value_list_item","section_anchor":"value_list_items","subsection_anchors":null,"path":"/radar/value_list_items/retrieve","gate":false,"display_on_load":false},"delete_value_list_item":{"title":"Delete a value list item","group_title":"Fraud","group_anchor":"fraud","anchor":"delete_value_list_item","section_anchor":"value_list_items","subsection_anchors":null,"path":"/radar/value_list_items/delete","gate":false,"display_on_load":false},"list_value_list_items":{"title":"List all value list items","group_title":"Fraud","group_anchor":"fraud","anchor":"list_value_list_items","section_anchor":"value_list_items","subsection_anchors":null,"path":"/radar/value_list_items/list","gate":false,"display_on_load":false},"issuing_authorizations":{"title":"Authorizations","group_title":"Issuing","group_anchor":"issuing","anchor":"issuing_authorizations","section_anchor":"issuing_authorizations","subsection_anchors":["issuing_authorization_object","retrieve_issuing_authorization","update_issuing_authorization","approve_issuing_authorization","decline_issuing_authorization","list_issuing_authorizations"],"path":"/issuing/authorizations","gate":false,"display_on_load":false,"data":{"section_type":"resource","title":"Authorizations","description":"When an [issued card](/docs/issuing) is used to make a purchase, an Issuing `Authorization`\nobject is created. [Authorizations](/docs/issuing/purchases/authorizations) must be approved for the\npurchase to be completed successfully.\n\nRelated guide: [Issued Card Authorizations](/docs/issuing/purchases/authorizations).\n","section_tag":"issuing_authorizations","subsection_summaries":[{"anchor":"issuing_authorization_object","curl_definition":null},{"anchor":"retrieve_issuing_authorization","curl_definition":"GET /v1/issuing/authorizations/:id"},{"anchor":"update_issuing_authorization","curl_definition":"POST /v1/issuing/authorizations/:id"},{"anchor":"approve_issuing_authorization","curl_definition":"POST /v1/issuing/authorizations/:id/approve"},{"anchor":"decline_issuing_authorization","curl_definition":"POST /v1/issuing/authorizations/:id/decline"},{"anchor":"list_issuing_authorizations","curl_definition":"GET /v1/issuing/authorizations"}]}},"issuing_authorization_object":{"title":"The Authorization object","group_title":"Issuing","group_anchor":"issuing","anchor":"issuing_authorization_object","section_anchor":"issuing_authorizations","subsection_anchors":null,"path":"/issuing/authorizations/object","gate":false,"display_on_load":false},"retrieve_issuing_authorization":{"title":"Retrieve an authorization","group_title":"Issuing","group_anchor":"issuing","anchor":"retrieve_issuing_authorization","section_anchor":"issuing_authorizations","subsection_anchors":null,"path":"/issuing/authorizations/retrieve","gate":false,"display_on_load":false},"update_issuing_authorization":{"title":"Update an authorization","group_title":"Issuing","group_anchor":"issuing","anchor":"update_issuing_authorization","section_anchor":"issuing_authorizations","subsection_anchors":null,"path":"/issuing/authorizations/update","gate":false,"display_on_load":false},"approve_issuing_authorization":{"title":"Approve an authorization","group_title":"Issuing","group_anchor":"issuing","anchor":"approve_issuing_authorization","section_anchor":"issuing_authorizations","subsection_anchors":null,"path":"/issuing/authorizations/approve","gate":false,"display_on_load":false},"decline_issuing_authorization":{"title":"Decline an authorization","group_title":"Issuing","group_anchor":"issuing","anchor":"decline_issuing_authorization","section_anchor":"issuing_authorizations","subsection_anchors":null,"path":"/issuing/authorizations/decline","gate":false,"display_on_load":false},"list_issuing_authorizations":{"title":"List all authorizations","group_title":"Issuing","group_anchor":"issuing","anchor":"list_issuing_authorizations","section_anchor":"issuing_authorizations","subsection_anchors":null,"path":"/issuing/authorizations/list","gate":false,"display_on_load":false},"issuing_cardholders":{"title":"Cardholders","group_title":"Issuing","group_anchor":"issuing","anchor":"issuing_cardholders","section_anchor":"issuing_cardholders","subsection_anchors":["issuing_cardholder_object","create_issuing_cardholder","retrieve_issuing_cardholder","update_issuing_cardholder","list_issuing_cardholders"],"path":"/issuing/cardholders","gate":false,"display_on_load":false,"data":{"section_type":"resource","title":"Cardholders","description":"An Issuing `Cardholder` object represents an individual or business entity who is [issued](/docs/issuing) cards.\n\nRelated guide: [How to create a Cardholder](/docs/issuing/cards#create-cardholder)\n","section_tag":"issuing_cardholders","subsection_summaries":[{"anchor":"issuing_cardholder_object","curl_definition":null},{"anchor":"create_issuing_cardholder","curl_definition":"POST /v1/issuing/cardholders"},{"anchor":"retrieve_issuing_cardholder","curl_definition":"GET /v1/issuing/cardholders/:id"},{"anchor":"update_issuing_cardholder","curl_definition":"POST /v1/issuing/cardholders/:id"},{"anchor":"list_issuing_cardholders","curl_definition":"GET /v1/issuing/cardholders"}]}},"issuing_cardholder_object":{"title":"The Cardholder object","group_title":"Issuing","group_anchor":"issuing","anchor":"issuing_cardholder_object","section_anchor":"issuing_cardholders","subsection_anchors":null,"path":"/issuing/cardholders/object","gate":false,"display_on_load":false},"create_issuing_cardholder":{"title":"Create a cardholder","group_title":"Issuing","group_anchor":"issuing","anchor":"create_issuing_cardholder","section_anchor":"issuing_cardholders","subsection_anchors":null,"path":"/issuing/cardholders/create","gate":false,"display_on_load":false},"retrieve_issuing_cardholder":{"title":"Retrieve a cardholder","group_title":"Issuing","group_anchor":"issuing","anchor":"retrieve_issuing_cardholder","section_anchor":"issuing_cardholders","subsection_anchors":null,"path":"/issuing/cardholders/retrieve","gate":false,"display_on_load":false},"update_issuing_cardholder":{"title":"Update a cardholder","group_title":"Issuing","group_anchor":"issuing","anchor":"update_issuing_cardholder","section_anchor":"issuing_cardholders","subsection_anchors":null,"path":"/issuing/cardholders/update","gate":false,"display_on_load":false},"list_issuing_cardholders":{"title":"List all cardholders","group_title":"Issuing","group_anchor":"issuing","anchor":"list_issuing_cardholders","section_anchor":"issuing_cardholders","subsection_anchors":null,"path":"/issuing/cardholders/list","gate":false,"display_on_load":false},"issuing_cards":{"title":"Cards","group_title":"Issuing","group_anchor":"issuing","anchor":"issuing_cards","section_anchor":"issuing_cards","subsection_anchors":["issuing_card_object","create_issuing_card","retrieve_issuing_card","update_issuing_card","list_issuing_cards","test_mode_ship_physical_card","test_mode_deliver_physical_card","test_mode_return_physical_card","test_mode_fail_physical_card"],"path":"/issuing/cards","gate":false,"display_on_load":false,"data":{"section_type":"resource","title":"Cards","description":"You can [create physical or virtual cards](/docs/issuing/cards) that are issued to cardholders.","section_tag":"issuing_cards","subsection_summaries":[{"anchor":"issuing_card_object","curl_definition":null},{"anchor":"create_issuing_card","curl_definition":"POST /v1/issuing/cards"},{"anchor":"retrieve_issuing_card","curl_definition":"GET /v1/issuing/cards/:id"},{"anchor":"update_issuing_card","curl_definition":"POST /v1/issuing/cards/:id"},{"anchor":"list_issuing_cards","curl_definition":"GET /v1/issuing/cards"},{"anchor":"test_mode_ship_physical_card","curl_definition":"POST /v1/test_helpers/issuing/cards/{:card}/shipping/ship"},{"anchor":"test_mode_deliver_physical_card","curl_definition":"POST /v1/test_helpers/issuing/cards/{:card}/shipping/deliver"},{"anchor":"test_mode_return_physical_card","curl_definition":"POST /v1/test_helpers/issuing/cards/{:card}/shipping/return"},{"anchor":"test_mode_fail_physical_card","curl_definition":"POST /v1/test_helpers/issuing/cards/{:card}/shipping/fail"}]}},"issuing_card_object":{"title":"The Card object","group_title":"Issuing","group_anchor":"issuing","anchor":"issuing_card_object","section_anchor":"issuing_cards","subsection_anchors":null,"path":"/issuing/cards/object","gate":false,"display_on_load":false},"create_issuing_card":{"title":"Create a card","group_title":"Issuing","group_anchor":"issuing","anchor":"create_issuing_card","section_anchor":"issuing_cards","subsection_anchors":null,"path":"/issuing/cards/create","gate":false,"display_on_load":false},"retrieve_issuing_card":{"title":"Retrieve a card","group_title":"Issuing","group_anchor":"issuing","anchor":"retrieve_issuing_card","section_anchor":"issuing_cards","subsection_anchors":null,"path":"/issuing/cards/retrieve","gate":false,"display_on_load":false},"update_issuing_card":{"title":"Update a card","group_title":"Issuing","group_anchor":"issuing","anchor":"update_issuing_card","section_anchor":"issuing_cards","subsection_anchors":null,"path":"/issuing/cards/update","gate":false,"display_on_load":false},"list_issuing_cards":{"title":"List all cards","group_title":"Issuing","group_anchor":"issuing","anchor":"list_issuing_cards","section_anchor":"issuing_cards","subsection_anchors":null,"path":"/issuing/cards/list","gate":false,"display_on_load":false},"test_mode_ship_physical_card":{"title":"Ship a testmode card","group_title":"Issuing","group_anchor":"issuing","anchor":"test_mode_ship_physical_card","section_anchor":"issuing_cards","subsection_anchors":null,"path":"/issuing/cards/test_mode_ship","gate":false,"display_on_load":false},"test_mode_deliver_physical_card":{"title":"Deliver a testmode card","group_title":"Issuing","group_anchor":"issuing","anchor":"test_mode_deliver_physical_card","section_anchor":"issuing_cards","subsection_anchors":null,"path":"/issuing/cards/test_mode_deliver","gate":false,"display_on_load":false},"test_mode_return_physical_card":{"title":"Return a testmode card","group_title":"Issuing","group_anchor":"issuing","anchor":"test_mode_return_physical_card","section_anchor":"issuing_cards","subsection_anchors":null,"path":"/issuing/cards/test_mode_return","gate":false,"display_on_load":false},"test_mode_fail_physical_card":{"title":"Fail a testmode card","group_title":"Issuing","group_anchor":"issuing","anchor":"test_mode_fail_physical_card","section_anchor":"issuing_cards","subsection_anchors":null,"path":"/issuing/cards/test_mode_fail","gate":false,"display_on_load":false},"issuing_disputes":{"title":"Disputes","group_title":"Issuing","group_anchor":"issuing","anchor":"issuing_disputes","section_anchor":"issuing_disputes","subsection_anchors":["issuing_dispute_object","create_issuing_dispute","submit_issuing_dispute","retrieve_issuing_dispute","update_issuing_dispute","list_issuing_disputes"],"path":"/issuing/disputes","gate":false,"display_on_load":false,"data":{"section_type":"resource","title":"Disputes","description":"As a [card issuer](/docs/issuing), you can dispute transactions that the cardholder does not recognize, suspects to be fraudulent, or has other issues with.\n\nRelated guide: [Disputing Transactions](/docs/issuing/purchases/disputes)\n","section_tag":"issuing_disputes","subsection_summaries":[{"anchor":"issuing_dispute_object","curl_definition":null},{"anchor":"create_issuing_dispute","curl_definition":"POST /v1/issuing/disputes"},{"anchor":"submit_issuing_dispute","curl_definition":"POST /v1/issuing/disputes/:id/submit"},{"anchor":"retrieve_issuing_dispute","curl_definition":"GET /v1/issuing/disputes/:id"},{"anchor":"update_issuing_dispute","curl_definition":"POST /v1/issuing/disputes/:id"},{"anchor":"list_issuing_disputes","curl_definition":"GET /v1/issuing/disputes"}]}},"issuing_dispute_object":{"title":"The Dispute object","group_title":"Issuing","group_anchor":"issuing","anchor":"issuing_dispute_object","section_anchor":"issuing_disputes","subsection_anchors":null,"path":"/issuing/disputes/object","gate":false,"display_on_load":false},"create_issuing_dispute":{"title":"Create a dispute","group_title":"Issuing","group_anchor":"issuing","anchor":"create_issuing_dispute","section_anchor":"issuing_disputes","subsection_anchors":null,"path":"/issuing/disputes/create","gate":false,"display_on_load":false},"submit_issuing_dispute":{"title":"Submit a dispute","group_title":"Issuing","group_anchor":"issuing","anchor":"submit_issuing_dispute","section_anchor":"issuing_disputes","subsection_anchors":null,"path":"/issuing/dispute/submit","gate":false,"display_on_load":false},"retrieve_issuing_dispute":{"title":"Retrieve a dispute","group_title":"Issuing","group_anchor":"issuing","anchor":"retrieve_issuing_dispute","section_anchor":"issuing_disputes","subsection_anchors":null,"path":"/issuing/disputes/retrieve","gate":false,"display_on_load":false},"update_issuing_dispute":{"title":"Update a dispute","group_title":"Issuing","group_anchor":"issuing","anchor":"update_issuing_dispute","section_anchor":"issuing_disputes","subsection_anchors":null,"path":"/issuing/disputes/update","gate":false,"display_on_load":false},"list_issuing_disputes":{"title":"List all disputes","group_title":"Issuing","group_anchor":"issuing","anchor":"list_issuing_disputes","section_anchor":"issuing_disputes","subsection_anchors":null,"path":"/issuing/disputes/list","gate":false,"display_on_load":false},"issuing_funding_instructions":{"title":"Funding Instructions","group_title":"Issuing","group_anchor":"issuing","anchor":"issuing_funding_instructions","section_anchor":"issuing_funding_instructions","subsection_anchors":["issuing_funding_instructions_object","create_issuing_funding_instructions","list_issuing_funding_instructions","fund_issuing_funding_instruction"],"path":"/issuing/funding_instructions","gate":false,"display_on_load":false,"data":{"section_type":"resource","title":"Funding Instructions","description":"Funding Instructions contain reusable bank account and routing information. Push funds\nto these addresses via bank transfer to [top up Issuing Balances](/docs/issuing/funding/balance).\n","section_tag":"issuing_funding_instructions","subsection_summaries":[{"anchor":"issuing_funding_instructions_object","curl_definition":null},{"anchor":"create_issuing_funding_instructions","curl_definition":"POST /v1/issuing/funding_instructions"},{"anchor":"list_issuing_funding_instructions","curl_definition":"GET /v1/issuing/funding_instructions"},{"anchor":"fund_issuing_funding_instruction","curl_definition":"POST /v1/test_helpers/issuing/fund_balance"}]}},"issuing_funding_instructions_object":{"title":"The FundingInstruction object","group_title":"Issuing","group_anchor":"issuing","anchor":"issuing_funding_instructions_object","section_anchor":"issuing_funding_instructions","subsection_anchors":null,"path":"/issuing/funding_instructions/object","gate":false,"display_on_load":false},"create_issuing_funding_instructions":{"title":"Create funding instructions","group_title":"Issuing","group_anchor":"issuing","anchor":"create_issuing_funding_instructions","section_anchor":"issuing_funding_instructions","subsection_anchors":null,"path":"/issuing/funding_instructions/create","gate":false,"display_on_load":false},"list_issuing_funding_instructions":{"title":"List all funding instructions","group_title":"Issuing","group_anchor":"issuing","anchor":"list_issuing_funding_instructions","section_anchor":"issuing_funding_instructions","subsection_anchors":null,"path":"/issuing/funding_instructions/list","gate":false,"display_on_load":false},"fund_issuing_funding_instruction":{"title":"Simulate a top up","group_title":"Issuing","group_anchor":"issuing","anchor":"fund_issuing_funding_instruction","section_anchor":"issuing_funding_instructions","subsection_anchors":null,"path":"/issuing/funding_instructions/fund","gate":false,"display_on_load":false},"issuing_transactions":{"title":"Transactions","group_title":"Issuing","group_anchor":"issuing","anchor":"issuing_transactions","section_anchor":"issuing_transactions","subsection_anchors":["issuing_transaction_object","retrieve_issuing_transaction","update_issuing_transaction","list_issuing_transactions"],"path":"/issuing/transactions","gate":false,"display_on_load":false,"data":{"section_type":"resource","title":"Transactions","description":"Any use of an [issued card](/docs/issuing) that results in funds entering or leaving\nyour Stripe account, such as a completed purchase or refund, is represented by an Issuing\n`Transaction` object.\n\nRelated guide: [Issued Card Transactions](/docs/issuing/purchases/transactions).\n","section_tag":"issuing_transactions","subsection_summaries":[{"anchor":"issuing_transaction_object","curl_definition":null},{"anchor":"retrieve_issuing_transaction","curl_definition":"GET /v1/issuing/transactions/:id"},{"anchor":"update_issuing_transaction","curl_definition":"POST /v1/issuing/transactions/:id"},{"anchor":"list_issuing_transactions","curl_definition":"GET /v1/issuing/transactions"}]}},"issuing_transaction_object":{"title":"The Transaction object","group_title":"Issuing","group_anchor":"issuing","anchor":"issuing_transaction_object","section_anchor":"issuing_transactions","subsection_anchors":null,"path":"/issuing/transactions/object","gate":false,"display_on_load":false},"retrieve_issuing_transaction":{"title":"Retrieve a transaction","group_title":"Issuing","group_anchor":"issuing","anchor":"retrieve_issuing_transaction","section_anchor":"issuing_transactions","subsection_anchors":null,"path":"/issuing/transactions/retrieve","gate":false,"display_on_load":false},"update_issuing_transaction":{"title":"Update a transaction","group_title":"Issuing","group_anchor":"issuing","anchor":"update_issuing_transaction","section_anchor":"issuing_transactions","subsection_anchors":null,"path":"/issuing/transactions/update","gate":false,"display_on_load":false},"list_issuing_transactions":{"title":"List all transactions","group_title":"Issuing","group_anchor":"issuing","anchor":"list_issuing_transactions","section_anchor":"issuing_transactions","subsection_anchors":null,"path":"/issuing/transactions/list","gate":false,"display_on_load":false},"terminal_connection_tokens":{"title":"Connection Tokens","group_title":"Terminal","group_anchor":"terminal","anchor":"terminal_connection_tokens","section_anchor":"terminal_connection_tokens","subsection_anchors":["terminal_connection_token_object","create_terminal_connection_token"],"path":"/terminal/connection_tokens","gate":false,"display_on_load":false,"data":{"section_type":"resource","title":"Connection Token","description":"A Connection Token is used by the Stripe Terminal SDK to connect to a reader.\n\nRelated guide: [Fleet Management](/docs/terminal/fleet/locations).\n","section_tag":"terminal_connection_tokens","subsection_summaries":[{"anchor":"terminal_connection_token_object","curl_definition":null},{"anchor":"create_terminal_connection_token","curl_definition":"POST /v1/terminal/connection_tokens"}]}},"terminal_connection_token_object":{"title":"The connection token object","group_title":"Terminal","group_anchor":"terminal","anchor":"terminal_connection_token_object","section_anchor":"terminal_connection_tokens","subsection_anchors":null,"path":"/terminal/connection_tokens/object","gate":false,"display_on_load":false},"create_terminal_connection_token":{"title":"Create a Connection Token","group_title":"Terminal","group_anchor":"terminal","anchor":"create_terminal_connection_token","section_anchor":"terminal_connection_tokens","subsection_anchors":null,"path":"/terminal/connection_tokens/create","gate":false,"display_on_load":false},"terminal_locations":{"title":"Locations","group_title":"Terminal","group_anchor":"terminal","anchor":"terminal_locations","section_anchor":"terminal_locations","subsection_anchors":["terminal_location_object","create_terminal_location","retrieve_terminal_location","update_terminal_location","delete_terminal_location","list_terminal_locations"],"path":"/terminal/locations","gate":false,"display_on_load":false,"data":{"section_type":"resource","title":"Location","description":"A Location represents a grouping of readers.\n\nRelated guide: [Fleet Management](/docs/terminal/fleet/locations).\n","section_tag":"terminal_locations","subsection_summaries":[{"anchor":"terminal_location_object","curl_definition":null},{"anchor":"create_terminal_location","curl_definition":"POST /v1/terminal/locations"},{"anchor":"retrieve_terminal_location","curl_definition":"GET /v1/terminal/locations/:id"},{"anchor":"update_terminal_location","curl_definition":"POST /v1/terminal/locations/:id"},{"anchor":"delete_terminal_location","curl_definition":"DELETE /v1/terminal/locations/:id"},{"anchor":"list_terminal_locations","curl_definition":"GET /v1/terminal/locations"}]}},"terminal_location_object":{"title":"The location object","group_title":"Terminal","group_anchor":"terminal","anchor":"terminal_location_object","section_anchor":"terminal_locations","subsection_anchors":null,"path":"/terminal/locations/object","gate":false,"display_on_load":false},"create_terminal_location":{"title":"Create a Location","group_title":"Terminal","group_anchor":"terminal","anchor":"create_terminal_location","section_anchor":"terminal_locations","subsection_anchors":null,"path":"/terminal/locations/create","gate":false,"display_on_load":false},"retrieve_terminal_location":{"title":"Retrieve a Location","group_title":"Terminal","group_anchor":"terminal","anchor":"retrieve_terminal_location","section_anchor":"terminal_locations","subsection_anchors":null,"path":"/terminal/locations/retrieve","gate":false,"display_on_load":false},"update_terminal_location":{"title":"Update a Location","group_title":"Terminal","group_anchor":"terminal","anchor":"update_terminal_location","section_anchor":"terminal_locations","subsection_anchors":null,"path":"/terminal/locations/update","gate":false,"display_on_load":false},"delete_terminal_location":{"title":"Delete a Location","group_title":"Terminal","group_anchor":"terminal","anchor":"delete_terminal_location","section_anchor":"terminal_locations","subsection_anchors":null,"path":"/terminal/locations/delete","gate":false,"display_on_load":false},"list_terminal_locations":{"title":"List all Locations","group_title":"Terminal","group_anchor":"terminal","anchor":"list_terminal_locations","section_anchor":"terminal_locations","subsection_anchors":null,"path":"/terminal/locations/list","gate":false,"display_on_load":false},"terminal_readers":{"title":"Readers","group_title":"Terminal","group_anchor":"terminal","anchor":"terminal_readers","section_anchor":"terminal_readers","subsection_anchors":["terminal_reader_object","create_terminal_reader","retrieve_terminal_reader","update_terminal_reader","delete_terminal_reader","list_terminal_reader","process_payment_intent","process_setup_intent","set_reader_display","refund_payment","cancel_action","present_payment_method"],"path":"/terminal/readers","gate":false,"display_on_load":false,"data":{"section_type":"resource","title":"Reader","description":"A Reader represents a physical device for accepting payment details.\n\nRelated guide: [Connecting to a Reader](/docs/terminal/payments/connect-reader).\n","section_tag":"terminal_readers","subsection_summaries":[{"anchor":"terminal_reader_object","curl_definition":null},{"anchor":"create_terminal_reader","curl_definition":"POST /v1/terminal/readers"},{"anchor":"retrieve_terminal_reader","curl_definition":"GET /v1/terminal/readers/:id"},{"anchor":"update_terminal_reader","curl_definition":"POST /v1/terminal/readers/:id"},{"anchor":"delete_terminal_reader","curl_definition":"DELETE /v1/terminal/readers/:id"},{"anchor":"list_terminal_reader","curl_definition":"GET /v1/terminal/readers"},{"anchor":"process_payment_intent","curl_definition":"POST /v1/terminal/readers/:id/process_payment_intent"},{"anchor":"process_setup_intent","curl_definition":"POST /v1/terminal/readers/:id/process_setup_intent"},{"anchor":"set_reader_display","curl_definition":"POST /v1/terminal/readers/:id/set_reader_display"},{"anchor":"refund_payment","curl_definition":"POST /v1/terminal/readers/:id/refund_payment"},{"anchor":"cancel_action","curl_definition":"POST /v1/terminal/readers/:id/cancel_action"},{"anchor":"present_payment_method","curl_definition":"POST /v1/test_helpers/terminal/readers/:id/present_payment_method"}]}},"terminal_reader_object":{"title":"The reader object","group_title":"Terminal","group_anchor":"terminal","anchor":"terminal_reader_object","section_anchor":"terminal_readers","subsection_anchors":null,"path":"/terminal/readers/object","gate":false,"display_on_load":false},"create_terminal_reader":{"title":"Create a Reader","group_title":"Terminal","group_anchor":"terminal","anchor":"create_terminal_reader","section_anchor":"terminal_readers","subsection_anchors":null,"path":"/terminal/readers/create","gate":false,"display_on_load":false},"retrieve_terminal_reader":{"title":"Retrieve a Reader","group_title":"Terminal","group_anchor":"terminal","anchor":"retrieve_terminal_reader","section_anchor":"terminal_readers","subsection_anchors":null,"path":"/terminal/readers/retrieve","gate":false,"display_on_load":false},"update_terminal_reader":{"title":"Update a Reader","group_title":"Terminal","group_anchor":"terminal","anchor":"update_terminal_reader","section_anchor":"terminal_readers","subsection_anchors":null,"path":"/terminal/readers/update","gate":false,"display_on_load":false},"delete_terminal_reader":{"title":"Delete a Reader","group_title":"Terminal","group_anchor":"terminal","anchor":"delete_terminal_reader","section_anchor":"terminal_readers","subsection_anchors":null,"path":"/terminal/readers/delete","gate":false,"display_on_load":false},"list_terminal_reader":{"title":"List all Readers","group_title":"Terminal","group_anchor":"terminal","anchor":"list_terminal_reader","section_anchor":"terminal_readers","subsection_anchors":null,"path":"/terminal/readers/list","gate":false,"display_on_load":false},"process_payment_intent":{"title":"Hand-off a PaymentIntent to a Reader","group_title":"Terminal","group_anchor":"terminal","anchor":"process_payment_intent","section_anchor":"terminal_readers","subsection_anchors":null,"path":"/terminal/readers/process_payment_intent","gate":false,"display_on_load":false},"process_setup_intent":{"title":"Hand-off a SetupIntent to a Reader","group_title":"Terminal","group_anchor":"terminal","anchor":"process_setup_intent","section_anchor":"terminal_readers","subsection_anchors":null,"path":"/terminal/readers/process_setup_intent","gate":false,"display_on_load":false},"set_reader_display":{"title":"Set reader display","group_title":"Terminal","group_anchor":"terminal","anchor":"set_reader_display","section_anchor":"terminal_readers","subsection_anchors":null,"path":"/terminal/readers/set_reader_display","gate":false,"display_on_load":false},"refund_payment":{"title":"Refund a Charge or a PaymentIntent in-person","group_title":"Terminal","group_anchor":"terminal","anchor":"refund_payment","section_anchor":"terminal_readers","subsection_anchors":null,"path":"/terminal/readers/refund_payment","gate":false,"display_on_load":false},"cancel_action":{"title":"Cancel the current reader action","group_title":"Terminal","group_anchor":"terminal","anchor":"cancel_action","section_anchor":"terminal_readers","subsection_anchors":null,"path":"/terminal/readers/cancel_action","gate":false,"display_on_load":false},"present_payment_method":{"title":"Simulate presenting a payment method","group_title":"Terminal","group_anchor":"terminal","anchor":"present_payment_method","section_anchor":"terminal_readers","subsection_anchors":null,"path":"/terminal/readers/present_payment_method","gate":false,"display_on_load":false},"terminal_configuration":{"title":"Configurations","group_title":"Terminal","group_anchor":"terminal","anchor":"terminal_configuration","section_anchor":"terminal_configuration","subsection_anchors":["terminal_configuration_object","create_configuration","retrieve_configuration","update_configuration","delete_configuration","list_configuration"],"path":"/terminal/configuration","gate":false,"display_on_load":false,"data":{"section_type":"resource","title":"Configuration","description":"A Configurations object represents how features should be configured for terminal readers.\n","section_tag":"terminal_configuration","subsection_summaries":[{"anchor":"terminal_configuration_object","curl_definition":null},{"anchor":"create_configuration","curl_definition":"POST /v1/terminal/configurations"},{"anchor":"retrieve_configuration","curl_definition":"GET /v1/terminal/configurations/:id"},{"anchor":"update_configuration","curl_definition":"POST /v1/terminal/configurations/:id"},{"anchor":"delete_configuration","curl_definition":"DELETE /v1/terminal/configurations/:id"},{"anchor":"list_configuration","curl_definition":"GET /v1/terminal/configurations"}]}},"terminal_configuration_object":{"title":"The Configuration object","group_title":"Terminal","group_anchor":"terminal","anchor":"terminal_configuration_object","section_anchor":"terminal_configuration","subsection_anchors":null,"path":"/terminal/configuration/object","gate":false,"display_on_load":false},"create_configuration":{"title":"Create a Configuration","group_title":"Terminal","group_anchor":"terminal","anchor":"create_configuration","section_anchor":"terminal_configuration","subsection_anchors":null,"path":"/terminal/configuration/create","gate":false,"display_on_load":false},"retrieve_configuration":{"title":"Retrieve a Configuration","group_title":"Terminal","group_anchor":"terminal","anchor":"retrieve_configuration","section_anchor":"terminal_configuration","subsection_anchors":null,"path":"/terminal/configuration/retrieve","gate":false,"display_on_load":false},"update_configuration":{"title":"Update a Configuration","group_title":"Terminal","group_anchor":"terminal","anchor":"update_configuration","section_anchor":"terminal_configuration","subsection_anchors":null,"path":"/terminal/configuration/update","gate":false,"display_on_load":false},"delete_configuration":{"title":"Delete a Configuration","group_title":"Terminal","group_anchor":"terminal","anchor":"delete_configuration","section_anchor":"terminal_configuration","subsection_anchors":null,"path":"/terminal/configuration/delete","gate":false,"display_on_load":false},"list_configuration":{"title":"List all Configurations","group_title":"Terminal","group_anchor":"terminal","anchor":"list_configuration","section_anchor":"terminal_configuration","subsection_anchors":null,"path":"/terminal/configuration/list","gate":false,"display_on_load":false},"financial_accounts":{"title":"FinancialAccounts","group_title":"Treasury","group_anchor":"treasury","anchor":"financial_accounts","section_anchor":"financial_accounts","subsection_anchors":["financial_account_object","create_financial_account","update_financial_account","retrieve_financial_account","list_financial_account"],"path":"/treasury/financial_accounts","gate":false,"display_on_load":false,"data":{"section_type":"resource","title":"FinancialAccounts","description":"Stripe Treasury provides users with a container for money called a FinancialAccount that is separate from their Payments balance.\nFinancialAccounts serve as the source and destination of Treasury’s money movement APIs.\n","section_tag":"financial_accounts","subsection_summaries":[{"anchor":"financial_account_object","curl_definition":null},{"anchor":"create_financial_account","curl_definition":"POST /v1/treasury/financial_accounts"},{"anchor":"update_financial_account","curl_definition":"POST /v1/treasury/financial_accounts/:id"},{"anchor":"retrieve_financial_account","curl_definition":"GET /v1/treasury/financial_accounts/:id"},{"anchor":"list_financial_account","curl_definition":"GET /v1/treasury/financial_accounts"}]}},"financial_account_object":{"title":"The FinancialAccount object","group_title":"Treasury","group_anchor":"treasury","anchor":"financial_account_object","section_anchor":"financial_accounts","subsection_anchors":null,"path":"/treasury/financial_accounts/object","gate":false,"display_on_load":false},"create_financial_account":{"title":"Create a FinancialAccount","group_title":"Treasury","group_anchor":"treasury","anchor":"create_financial_account","section_anchor":"financial_accounts","subsection_anchors":null,"path":"/treasury/financial_accounts/create","gate":false,"display_on_load":false},"update_financial_account":{"title":"Update a FinancialAccount","group_title":"Treasury","group_anchor":"treasury","anchor":"update_financial_account","section_anchor":"financial_accounts","subsection_anchors":null,"path":"/treasury/financial_accounts/update","gate":false,"display_on_load":false},"retrieve_financial_account":{"title":"Retrieve a FinancialAccount","group_title":"Treasury","group_anchor":"treasury","anchor":"retrieve_financial_account","section_anchor":"financial_accounts","subsection_anchors":null,"path":"/treasury/financial_accounts/retrieve","gate":false,"display_on_load":false},"list_financial_account":{"title":"List all FinancialAccounts","group_title":"Treasury","group_anchor":"treasury","anchor":"list_financial_account","section_anchor":"financial_accounts","subsection_anchors":null,"path":"/treasury/financial_accounts/list","gate":false,"display_on_load":false},"financial_account_features":{"title":"FinancialAccount Features","group_title":"Treasury","group_anchor":"treasury","anchor":"financial_account_features","section_anchor":"financial_account_features","subsection_anchors":["financial_account_features_object","update_financial_acccount_features","retrieve_financial_account_features"],"path":"/treasury/financial_account_features","gate":false,"display_on_load":false,"data":{"section_type":"resource","title":"FinancialAccount Features","description":"Encodes whether a FinancialAccount has access to a particular Feature, with a `status` enum and associated `status_details`.\nStripe or the platform can control Features via the requested field.\n","section_tag":"financial_account_features","subsection_summaries":[{"anchor":"financial_account_features_object","curl_definition":null},{"anchor":"update_financial_acccount_features","curl_definition":"POST /v1/treasury/financial_accounts/:id/features"},{"anchor":"retrieve_financial_account_features","curl_definition":"GET /v1/treasury/financial_accounts/:id/features"}]}},"financial_account_features_object":{"title":"The FinancialAccount Feature object","group_title":"Treasury","group_anchor":"treasury","anchor":"financial_account_features_object","section_anchor":"financial_account_features","subsection_anchors":null,"path":"/treasury/financial_account_features/object","gate":false,"display_on_load":false},"update_financial_acccount_features":{"title":"Update FinancialAccount Features","group_title":"Treasury","group_anchor":"treasury","anchor":"update_financial_acccount_features","section_anchor":"financial_account_features","subsection_anchors":null,"path":"/treasury/financial_account_features/update","gate":false,"display_on_load":false},"retrieve_financial_account_features":{"title":"Retrieve FinancialAccount Features","group_title":"Treasury","group_anchor":"treasury","anchor":"retrieve_financial_account_features","section_anchor":"financial_account_features","subsection_anchors":null,"path":"/treasury/financial_account_features/retrieve","gate":false,"display_on_load":false},"transactions":{"title":"Transactions","group_title":"Treasury","group_anchor":"treasury","anchor":"transactions","section_anchor":"transactions","subsection_anchors":["transaction_object","retrieve_transaction","list_transactions"],"path":"/treasury/transactions","gate":false,"display_on_load":false,"data":{"section_type":"resource","title":"Transactions","description":"Transactions represent changes to a [FinancialAccount's](#financial_accounts) balance.\n","section_tag":"transactions","subsection_summaries":[{"anchor":"transaction_object","curl_definition":null},{"anchor":"retrieve_transaction","curl_definition":"GET /v1/treasury/transactions/:id"},{"anchor":"list_transactions","curl_definition":"GET /v1/treasury/transactions"}]}},"transaction_object":{"title":"The Transaction object","group_title":"Treasury","group_anchor":"treasury","anchor":"transaction_object","section_anchor":"transactions","subsection_anchors":null,"path":"/treasury/transactions/object","gate":false,"display_on_load":false},"retrieve_transaction":{"title":"Retrieve a Transaction","group_title":"Treasury","group_anchor":"treasury","anchor":"retrieve_transaction","section_anchor":"transactions","subsection_anchors":null,"path":"/treasury/transactions/retrieve","gate":false,"display_on_load":false},"list_transactions":{"title":"List all Transactions","group_title":"Treasury","group_anchor":"treasury","anchor":"list_transactions","section_anchor":"transactions","subsection_anchors":null,"path":"/treasury/transactions/list","gate":false,"display_on_load":false},"transaction_entries":{"title":"TransactionEntries","group_title":"Treasury","group_anchor":"treasury","anchor":"transaction_entries","section_anchor":"transaction_entries","subsection_anchors":["transaction_entry_object","retrieve_transaction_entry","list_transaction_entries"],"path":"/treasury/transaction_entries","gate":false,"display_on_load":false,"data":{"section_type":"resource","title":"TransactionEntries","description":"TransactionEntries represent individual units of money movements within a single [Transaction](#transactions).\n","section_tag":"transaction_entries","subsection_summaries":[{"anchor":"transaction_entry_object","curl_definition":null},{"anchor":"retrieve_transaction_entry","curl_definition":"GET /v1/treasury/transaction_entries/:id"},{"anchor":"list_transaction_entries","curl_definition":"GET /v1/treasury/transaction_entries"}]}},"transaction_entry_object":{"title":"The TransactionEntry object","group_title":"Treasury","group_anchor":"treasury","anchor":"transaction_entry_object","section_anchor":"transaction_entries","subsection_anchors":null,"path":"/treasury/transaction_entries/object","gate":false,"display_on_load":false},"retrieve_transaction_entry":{"title":"Retrieve a TransactionEntry","group_title":"Treasury","group_anchor":"treasury","anchor":"retrieve_transaction_entry","section_anchor":"transaction_entries","subsection_anchors":null,"path":"/treasury/transaction_entries/retrieve","gate":false,"display_on_load":false},"list_transaction_entries":{"title":"List all TransactionEntries","group_title":"Treasury","group_anchor":"treasury","anchor":"list_transaction_entries","section_anchor":"transaction_entries","subsection_anchors":null,"path":"/treasury/transaction_entries/list","gate":false,"display_on_load":false},"outbound_transfers":{"title":"OutboundTransfers","group_title":"Treasury","group_anchor":"treasury","anchor":"outbound_transfers","section_anchor":"outbound_transfers","subsection_anchors":["outbound_transfer_object","create_outbound_transfer","cancel_outbound_transfer","retrieve_outbound_transfer","list_outbound_transfers","test_mode_post_outbound_transfer","test_mode_return_outbound_transfer","test_mode_fail_outbound_transfer"],"path":"/treasury/outbound_transfers","gate":false,"display_on_load":false,"data":{"section_type":"resource","title":"OutboundTransfers","description":"Use OutboundTransfers to transfer funds from a [FinancialAccount](#financial_accounts) to a PaymentMethod belonging to the same entity. To send funds to a different party, use [OutboundPayments](#outbound_payments) instead. You can send funds over ACH rails or through a domestic wire transfer to a user's own external bank account.\n\nSimulate OutboundTransfer state changes with the `/v1/test_helpers/treasury/outbound_transfers` endpoints. These methods can only be called on test mode objects.\n","section_tag":"outbound_transfers","subsection_summaries":[{"anchor":"outbound_transfer_object","curl_definition":null},{"anchor":"create_outbound_transfer","curl_definition":"POST /v1/treasury/outbound_transfers"},{"anchor":"cancel_outbound_transfer","curl_definition":"POST /v1/treasury/outbound_transfers/:id/cancel"},{"anchor":"retrieve_outbound_transfer","curl_definition":"GET /v1/treasury/outbound_transfers/:id"},{"anchor":"list_outbound_transfers","curl_definition":"GET /v1/treasury/outbound_transfers"},{"anchor":"test_mode_post_outbound_transfer","curl_definition":"POST /v1/test_helpers/treasury/outbound_transfers/:id/post"},{"anchor":"test_mode_return_outbound_transfer","curl_definition":"POST /v1/test_helpers/treasury/outbound_transfers/:id/return"},{"anchor":"test_mode_fail_outbound_transfer","curl_definition":"POST /v1/test_helpers/treasury/outbound_transfers/:id/fail"}]}},"outbound_transfer_object":{"title":"The OutboundTransfer object","group_title":"Treasury","group_anchor":"treasury","anchor":"outbound_transfer_object","section_anchor":"outbound_transfers","subsection_anchors":null,"path":"/treasury/outbound_transfers/object","gate":false,"display_on_load":false},"create_outbound_transfer":{"title":"Create an OutboundTransfer","group_title":"Treasury","group_anchor":"treasury","anchor":"create_outbound_transfer","section_anchor":"outbound_transfers","subsection_anchors":null,"path":"/treasury/outbound_transfers/create","gate":false,"display_on_load":false},"cancel_outbound_transfer":{"title":"Cancel an OutboundTransfer","group_title":"Treasury","group_anchor":"treasury","anchor":"cancel_outbound_transfer","section_anchor":"outbound_transfers","subsection_anchors":null,"path":"/treasury/outbound_transfers/cancel","gate":false,"display_on_load":false},"retrieve_outbound_transfer":{"title":"Retrieve an OutboundTransfer","group_title":"Treasury","group_anchor":"treasury","anchor":"retrieve_outbound_transfer","section_anchor":"outbound_transfers","subsection_anchors":null,"path":"/treasury/outbound_transfers/retrieve","gate":false,"display_on_load":false},"list_outbound_transfers":{"title":"List all OutboundTransfers","group_title":"Treasury","group_anchor":"treasury","anchor":"list_outbound_transfers","section_anchor":"outbound_transfers","subsection_anchors":null,"path":"/treasury/outbound_transfers/list","gate":false,"display_on_load":false},"test_mode_post_outbound_transfer":{"title":"Test mode: Post an OutboundTransfer","group_title":"Treasury","group_anchor":"treasury","anchor":"test_mode_post_outbound_transfer","section_anchor":"outbound_transfers","subsection_anchors":null,"path":"/treasury/outbound_transfers/test_mode_post","gate":false,"display_on_load":false},"test_mode_return_outbound_transfer":{"title":"Test mode: Return an OutboundTransfer","group_title":"Treasury","group_anchor":"treasury","anchor":"test_mode_return_outbound_transfer","section_anchor":"outbound_transfers","subsection_anchors":null,"path":"/treasury/outbound_transfers/test_mode_return","gate":false,"display_on_load":false},"test_mode_fail_outbound_transfer":{"title":"Test mode: Fail an OutboundTransfer","group_title":"Treasury","group_anchor":"treasury","anchor":"test_mode_fail_outbound_transfer","section_anchor":"outbound_transfers","subsection_anchors":null,"path":"/treasury/outbound_transfers/test_mode_fail","gate":false,"display_on_load":false},"outbound_payments":{"title":"OutboundPayments","group_title":"Treasury","group_anchor":"treasury","anchor":"outbound_payments","section_anchor":"outbound_payments","subsection_anchors":["outbound_payment_object","create_outbound_payment","cancel_outbound_payment","retrieve_outbound_payment","list_outbound_payment","test_mode_outbound_payment_post","test_mode_outbound_payment_return","test_mode_outbound_payment_fail"],"path":"/treasury/outbound_payments","gate":false,"display_on_load":false,"data":{"section_type":"resource","title":"Outbound Payments","description":"Use OutboundPayments to send funds to another party's external bank account or [FinancialAccount](#financial_accounts). To send money to an account belonging to the same user, use an [OutboundTransfer](#outbound_transfers).\n\nSimulate OutboundPayment state changes with the `/v1/test_helpers/treasury/outbound_payments` endpoints. These methods can only be called on test mode objects.\n","section_tag":"outbound_payments","subsection_summaries":[{"anchor":"outbound_payment_object","curl_definition":null},{"anchor":"create_outbound_payment","curl_definition":"POST /v1/treasury/outbound_payments"},{"anchor":"cancel_outbound_payment","curl_definition":"POST /v1/treasury/outbound_payments/:id/cancel"},{"anchor":"retrieve_outbound_payment","curl_definition":"GET /v1/treasury/outbound_payments/:id"},{"anchor":"list_outbound_payment","curl_definition":"GET /v1/treasury/outbound_payments"},{"anchor":"test_mode_outbound_payment_post","curl_definition":"POST /v1/test_helpers/treasury/outbound_payments/:id/post"},{"anchor":"test_mode_outbound_payment_return","curl_definition":"POST /v1/test_helpers/treasury/outbound_payments/:id/return"},{"anchor":"test_mode_outbound_payment_fail","curl_definition":"POST /v1/test_helpers/treasury/outbound_payments/:id/fail"}]}},"outbound_payment_object":{"title":"The OutboundPayment object","group_title":"Treasury","group_anchor":"treasury","anchor":"outbound_payment_object","section_anchor":"outbound_payments","subsection_anchors":null,"path":"/treasury/outbound_payments/object","gate":false,"display_on_load":false},"create_outbound_payment":{"title":"Create an OutboundPayment","group_title":"Treasury","group_anchor":"treasury","anchor":"create_outbound_payment","section_anchor":"outbound_payments","subsection_anchors":null,"path":"/treasury/outbound_payments/create","gate":false,"display_on_load":false},"cancel_outbound_payment":{"title":"Cancel an OutboundPayment","group_title":"Treasury","group_anchor":"treasury","anchor":"cancel_outbound_payment","section_anchor":"outbound_payments","subsection_anchors":null,"path":"/treasury/outbound_payments/cancel","gate":false,"display_on_load":false},"retrieve_outbound_payment":{"title":"Retrieve an OutboundPayment","group_title":"Treasury","group_anchor":"treasury","anchor":"retrieve_outbound_payment","section_anchor":"outbound_payments","subsection_anchors":null,"path":"/treasury/outbound_payments/retrieve","gate":false,"display_on_load":false},"list_outbound_payment":{"title":"List all OutboundPayments","group_title":"Treasury","group_anchor":"treasury","anchor":"list_outbound_payment","section_anchor":"outbound_payments","subsection_anchors":null,"path":"/treasury/outbound_payments/list","gate":false,"display_on_load":false},"test_mode_outbound_payment_post":{"title":"Test mode: Post an OutboundPayment","group_title":"Treasury","group_anchor":"treasury","anchor":"test_mode_outbound_payment_post","section_anchor":"outbound_payments","subsection_anchors":null,"path":"/treasury/outbound_payments/test_mode_post","gate":false,"display_on_load":false},"test_mode_outbound_payment_return":{"title":"Test mode: Return an OutboundPayment","group_title":"Treasury","group_anchor":"treasury","anchor":"test_mode_outbound_payment_return","section_anchor":"outbound_payments","subsection_anchors":null,"path":"/treasury/outbound_payments/test_mode_return","gate":false,"display_on_load":false},"test_mode_outbound_payment_fail":{"title":"Test mode: Fail an OutboundPayment","group_title":"Treasury","group_anchor":"treasury","anchor":"test_mode_outbound_payment_fail","section_anchor":"outbound_payments","subsection_anchors":null,"path":"/treasury/outbound_payments/test_mode_fail","gate":false,"display_on_load":false},"inbound_transfers":{"title":"InboundTransfers","group_title":"Treasury","group_anchor":"treasury","anchor":"inbound_transfers","section_anchor":"inbound_transfers","subsection_anchors":["inbound_transfer_object","create_inbound_transfer","cancel_inbound_transfer","retrieve_inbound_transfer","list_inbound_transfer","test_mode_inbound_transfer_fail","test_mode_inbound_transfer_return","test_mode_inbound_transfer_succeed"],"path":"/treasury/inbound_transfers","gate":false,"display_on_load":false,"data":{"section_type":"resource","title":"InboundTransfers","description":"Use [InboundTransfers](/docs/treasury/moving-money/financial-accounts/into/inbound-transfers) to add funds to your [FinancialAccount](#financial_accounts) via a PaymentMethod that is owned by you. The funds will be transferred via an ACH debit.\n","section_tag":"inbound_transfers","subsection_summaries":[{"anchor":"inbound_transfer_object","curl_definition":null},{"anchor":"create_inbound_transfer","curl_definition":"POST /v1/treasury/inbound_transfers"},{"anchor":"cancel_inbound_transfer","curl_definition":"POST /v1/treasury/inbound_transfers/:id/cancel"},{"anchor":"retrieve_inbound_transfer","curl_definition":"GET /v1/treasury/inbound_transfers/:id"},{"anchor":"list_inbound_transfer","curl_definition":"GET /v1/treasury/inbound_transfers"},{"anchor":"test_mode_inbound_transfer_fail","curl_definition":"POST /v1/test_helpers/treasury/inbound_transfers/:id/fail"},{"anchor":"test_mode_inbound_transfer_return","curl_definition":"POST /v1/test_helpers/treasury/inbound_transfers/:id/return"},{"anchor":"test_mode_inbound_transfer_succeed","curl_definition":"POST /v1/test_helpers/treasury/inbound_transfers/:id/succeed"}]}},"inbound_transfer_object":{"title":"The InboundTransfer object","group_title":"Treasury","group_anchor":"treasury","anchor":"inbound_transfer_object","section_anchor":"inbound_transfers","subsection_anchors":null,"path":"/treasury/inbound_transfers/object","gate":false,"display_on_load":false},"create_inbound_transfer":{"title":"Create an InboundTransfer","group_title":"Treasury","group_anchor":"treasury","anchor":"create_inbound_transfer","section_anchor":"inbound_transfers","subsection_anchors":null,"path":"/treasury/inbound_transfers/create","gate":false,"display_on_load":false},"cancel_inbound_transfer":{"title":"Cancel an InboundTransfer","group_title":"Treasury","group_anchor":"treasury","anchor":"cancel_inbound_transfer","section_anchor":"inbound_transfers","subsection_anchors":null,"path":"/treasury/inbound_transfers/cancel","gate":false,"display_on_load":false},"retrieve_inbound_transfer":{"title":"Retrieve an InboundTransfer","group_title":"Treasury","group_anchor":"treasury","anchor":"retrieve_inbound_transfer","section_anchor":"inbound_transfers","subsection_anchors":null,"path":"/treasury/inbound_transfers/retrieve","gate":false,"display_on_load":false},"list_inbound_transfer":{"title":"List all InboundTransfers","group_title":"Treasury","group_anchor":"treasury","anchor":"list_inbound_transfer","section_anchor":"inbound_transfers","subsection_anchors":null,"path":"/treasury/inbound_transfers/list","gate":false,"display_on_load":false},"test_mode_inbound_transfer_fail":{"title":"Test mode: Fail an InboundTransfer","group_title":"Treasury","group_anchor":"treasury","anchor":"test_mode_inbound_transfer_fail","section_anchor":"inbound_transfers","subsection_anchors":null,"path":"/treasury/inbound_transfers/test_mode_fail","gate":false,"display_on_load":false},"test_mode_inbound_transfer_return":{"title":"Test mode: Return an InboundTransfer","group_title":"Treasury","group_anchor":"treasury","anchor":"test_mode_inbound_transfer_return","section_anchor":"inbound_transfers","subsection_anchors":null,"path":"/treasury/inbound_transfers/test_mode_return","gate":false,"display_on_load":false},"test_mode_inbound_transfer_succeed":{"title":"Test mode: Succeed an InboundTransfer","group_title":"Treasury","group_anchor":"treasury","anchor":"test_mode_inbound_transfer_succeed","section_anchor":"inbound_transfers","subsection_anchors":null,"path":"/treasury/inbound_transfers/test_mode_succeed","gate":false,"display_on_load":false},"received_credits":{"title":"ReceivedCredits","group_title":"Treasury","group_anchor":"treasury","anchor":"received_credits","section_anchor":"received_credits","subsection_anchors":["received_credit_object","retrieve_received_credit","list_received_credit","test_mode_create_received_credit"],"path":"/treasury/received_credits","gate":false,"display_on_load":false,"data":{"section_type":"resource","title":"ReceivedCredits","description":"ReceivedCredits represent funds sent to a [FinancialAccount](#financial_accounts) (for example, via ACH or wire). These money movements are not initiated from the FinancialAccount.\n","section_tag":"received_credits","subsection_summaries":[{"anchor":"received_credit_object","curl_definition":null},{"anchor":"retrieve_received_credit","curl_definition":"GET /v1/treasury/received_credits/:id"},{"anchor":"list_received_credit","curl_definition":"GET /v1/treasury/received_credits"},{"anchor":"test_mode_create_received_credit","curl_definition":"POST /v1/test_helpers/treasury/received_credits"}]}},"received_credit_object":{"title":"The ReceivedCredit object","group_title":"Treasury","group_anchor":"treasury","anchor":"received_credit_object","section_anchor":"received_credits","subsection_anchors":null,"path":"/treasury/received_credits/object","gate":false,"display_on_load":false},"retrieve_received_credit":{"title":"Retrieve a ReceivedCredit","group_title":"Treasury","group_anchor":"treasury","anchor":"retrieve_received_credit","section_anchor":"received_credits","subsection_anchors":null,"path":"/treasury/received_credits/retrieve","gate":false,"display_on_load":false},"list_received_credit":{"title":"List all ReceivedCredits","group_title":"Treasury","group_anchor":"treasury","anchor":"list_received_credit","section_anchor":"received_credits","subsection_anchors":null,"path":"/treasury/received_credits/list","gate":false,"display_on_load":false},"test_mode_create_received_credit":{"title":"Test mode: Create a ReceivedCredit","group_title":"Treasury","group_anchor":"treasury","anchor":"test_mode_create_received_credit","section_anchor":"received_credits","subsection_anchors":null,"path":"/treasury/received_credits/test_mode_create","gate":false,"display_on_load":false},"received_debits":{"title":"ReceivedDebits","group_title":"Treasury","group_anchor":"treasury","anchor":"received_debits","section_anchor":"received_debits","subsection_anchors":["received_debit_object","retrieve_received_debit","list_received_debit","test_mode_create_received_debit"],"path":"/treasury/received_debits","gate":false,"display_on_load":false,"data":{"section_type":"resource","title":"ReceivedDebits","description":"ReceivedDebits represent funds pulled from a [FinancialAccount](#financial_accounts). These are not initiated from the FinancialAccount.\n","section_tag":"received_debits","subsection_summaries":[{"anchor":"received_debit_object","curl_definition":null},{"anchor":"retrieve_received_debit","curl_definition":"GET /v1/treasury/received_debits/:id"},{"anchor":"list_received_debit","curl_definition":"GET /v1/treasury/received_debits"},{"anchor":"test_mode_create_received_debit","curl_definition":"POST /v1/test_helpers/treasury/received_debits"}]}},"received_debit_object":{"title":"The ReceivedDebit object","group_title":"Treasury","group_anchor":"treasury","anchor":"received_debit_object","section_anchor":"received_debits","subsection_anchors":null,"path":"/treasury/received_debits/object","gate":false,"display_on_load":false},"retrieve_received_debit":{"title":"Retrieve a ReceivedDebit","group_title":"Treasury","group_anchor":"treasury","anchor":"retrieve_received_debit","section_anchor":"received_debits","subsection_anchors":null,"path":"/treasury/received_debits/retrieve","gate":false,"display_on_load":false},"list_received_debit":{"title":"List all ReceivedDebits","group_title":"Treasury","group_anchor":"treasury","anchor":"list_received_debit","section_anchor":"received_debits","subsection_anchors":null,"path":"/treasury/received_debits/list","gate":false,"display_on_load":false},"test_mode_create_received_debit":{"title":"Test mode: Create a ReceivedDebit","group_title":"Treasury","group_anchor":"treasury","anchor":"test_mode_create_received_debit","section_anchor":"received_debits","subsection_anchors":null,"path":"/treasury/received_debits/test_mode_create","gate":false,"display_on_load":false},"credit_reversals":{"title":"CreditReversals","group_title":"Treasury","group_anchor":"treasury","anchor":"credit_reversals","section_anchor":"credit_reversals","subsection_anchors":["credit_reversal_object","create_credit_reversal","retrieve_credit_reversal","list_credit_reversal"],"path":"/treasury/credit_reversals","gate":false,"display_on_load":false,"data":{"section_type":"resource","title":"CreditReversals","description":"You can reverse some [ReceivedCredits](#received_credits) depending on their network and source flow. Reversing a ReceivedCredit leads to the creation of a new object known as a CreditReversal.\n","section_tag":"credit_reversals","subsection_summaries":[{"anchor":"credit_reversal_object","curl_definition":null},{"anchor":"create_credit_reversal","curl_definition":"POST /v1/treasury/credit_reversals"},{"anchor":"retrieve_credit_reversal","curl_definition":"GET /v1/treasury/credit_reversals/:id"},{"anchor":"list_credit_reversal","curl_definition":"GET /v1/treasury/credit_reversals"}]}},"credit_reversal_object":{"title":"The CreditReversal object","group_title":"Treasury","group_anchor":"treasury","anchor":"credit_reversal_object","section_anchor":"credit_reversals","subsection_anchors":null,"path":"/treasury/credit_reversals/object","gate":false,"display_on_load":false},"create_credit_reversal":{"title":"Create a CreditReversal","group_title":"Treasury","group_anchor":"treasury","anchor":"create_credit_reversal","section_anchor":"credit_reversals","subsection_anchors":null,"path":"/treasury/credit_reversals/create","gate":false,"display_on_load":false},"retrieve_credit_reversal":{"title":"Retrieve a CreditReversal","group_title":"Treasury","group_anchor":"treasury","anchor":"retrieve_credit_reversal","section_anchor":"credit_reversals","subsection_anchors":null,"path":"/treasury/credit_reversals/retrieve","gate":false,"display_on_load":false},"list_credit_reversal":{"title":"List all CreditReversals","group_title":"Treasury","group_anchor":"treasury","anchor":"list_credit_reversal","section_anchor":"credit_reversals","subsection_anchors":null,"path":"/treasury/credit_reversals/list","gate":false,"display_on_load":false},"debit_reversals":{"title":"DebitReversals","group_title":"Treasury","group_anchor":"treasury","anchor":"debit_reversals","section_anchor":"debit_reversals","subsection_anchors":["debit_reversal_object","create_debit_reversal","retrieve_debit_reversal","list_debit_reversal"],"path":"/treasury/debit_reversals","gate":false,"display_on_load":false,"data":{"section_type":"resource","title":"DebitReversals","description":"You can reverse some [ReceivedDebits](#received_debits) depending on their network and source flow. Reversing a ReceivedDebit leads to the creation of a new object known as a DebitReversal.\n","section_tag":"debit_reversals","subsection_summaries":[{"anchor":"debit_reversal_object","curl_definition":null},{"anchor":"create_debit_reversal","curl_definition":"POST /v1/treasury/debit_reversals"},{"anchor":"retrieve_debit_reversal","curl_definition":"GET /v1/treasury/debit_reversals/:id"},{"anchor":"list_debit_reversal","curl_definition":"GET /v1/treasury/debit_reversals"}]}},"debit_reversal_object":{"title":"The DebitReversal object","group_title":"Treasury","group_anchor":"treasury","anchor":"debit_reversal_object","section_anchor":"debit_reversals","subsection_anchors":null,"path":"/treasury/debit_reversals/object","gate":false,"display_on_load":false},"create_debit_reversal":{"title":"Create a DebitReversal","group_title":"Treasury","group_anchor":"treasury","anchor":"create_debit_reversal","section_anchor":"debit_reversals","subsection_anchors":null,"path":"/treasury/debit_reversals/create","gate":false,"display_on_load":false},"retrieve_debit_reversal":{"title":"Retrieve a DebitReversal","group_title":"Treasury","group_anchor":"treasury","anchor":"retrieve_debit_reversal","section_anchor":"debit_reversals","subsection_anchors":null,"path":"/treasury/debit_reversals/retrieve","gate":false,"display_on_load":false},"list_debit_reversal":{"title":"List all DebitReversals","group_title":"Treasury","group_anchor":"treasury","anchor":"list_debit_reversal","section_anchor":"debit_reversals","subsection_anchors":null,"path":"/treasury/debit_reversals/list","gate":false,"display_on_load":false},"scheduled_queries":{"title":"Scheduled Queries","group_title":"Sigma","group_anchor":"sigma","anchor":"scheduled_queries","section_anchor":"scheduled_queries","subsection_anchors":["scheduled_query_run_object","retrieve_scheduled_query_run","list_scheduled_query_run"],"path":"/sigma/scheduled_queries","gate":false,"display_on_load":false,"data":{"section_type":"resource","title":"Scheduled Queries","description":"If you have [scheduled a Sigma query](/docs/sigma/scheduled-queries), you'll\nreceive a `sigma.scheduled_query_run.created` webhook each time the query\nruns. The webhook contains a `ScheduledQueryRun` object, which you can use to\nretrieve the query results.\n","section_tag":"scheduled_queries","subsection_summaries":[{"anchor":"scheduled_query_run_object","curl_definition":null},{"anchor":"retrieve_scheduled_query_run","curl_definition":"GET /v1/sigma/scheduled_query_runs/:id"},{"anchor":"list_scheduled_query_run","curl_definition":"GET /v1/sigma/scheduled_query_runs"}]}},"scheduled_query_run_object":{"title":"The scheduled query run object","group_title":"Sigma","group_anchor":"sigma","anchor":"scheduled_query_run_object","section_anchor":"scheduled_queries","subsection_anchors":null,"path":"/sigma/scheduled_queries/object","gate":false,"display_on_load":false},"retrieve_scheduled_query_run":{"title":"Retrieve a scheduled query run","group_title":"Sigma","group_anchor":"sigma","anchor":"retrieve_scheduled_query_run","section_anchor":"scheduled_queries","subsection_anchors":null,"path":"/sigma/scheduled_queries/retrieve","gate":false,"display_on_load":false},"list_scheduled_query_run":{"title":"List all scheduled query runs","group_title":"Sigma","group_anchor":"sigma","anchor":"list_scheduled_query_run","section_anchor":"scheduled_queries","subsection_anchors":null,"path":"/sigma/scheduled_queries/list","gate":false,"display_on_load":false},"reporting_report_run":{"title":"Report Runs","group_title":"Reporting","group_anchor":"reporting","anchor":"reporting_report_run","section_anchor":"reporting_report_run","subsection_anchors":["reporting_report_run_object","create_reporting_report_run","retrieve_reporting_report_run","list_reporting_report_run"],"path":"/reporting/report_run","gate":false,"display_on_load":false,"data":{"section_type":"resource","title":"Report Runs","description":"The Report Run object represents an instance of a report type generated with\nspecific run parameters. Once the object is created, Stripe begins processing the report.\nWhen the report has finished running, it will give you a reference to a file\nwhere you can retrieve your results. For an overview, see\n[API Access to Reports](/docs/reporting/statements/api).\n\nNote that certain report types can only be run based on your live-mode data (not test-mode\ndata), and will error when queried without a [live-mode API key](/docs/keys#test-live-modes).\n","section_tag":"reporting_report_run","subsection_summaries":[{"anchor":"reporting_report_run_object","curl_definition":null},{"anchor":"create_reporting_report_run","curl_definition":"POST /v1/reporting/report_runs"},{"anchor":"retrieve_reporting_report_run","curl_definition":"GET /v1/reporting/report_runs/:id"},{"anchor":"list_reporting_report_run","curl_definition":"GET /v1/reporting/report_runs"}]}},"reporting_report_run_object":{"title":"The Report Run object","group_title":"Reporting","group_anchor":"reporting","anchor":"reporting_report_run_object","section_anchor":"reporting_report_run","subsection_anchors":null,"path":"/reporting/report_run/object","gate":false,"display_on_load":false},"create_reporting_report_run":{"title":"Create a Report Run","group_title":"Reporting","group_anchor":"reporting","anchor":"create_reporting_report_run","section_anchor":"reporting_report_run","subsection_anchors":null,"path":"/reporting/report_run/create","gate":false,"display_on_load":false},"retrieve_reporting_report_run":{"title":"Retrieve a Report Run","group_title":"Reporting","group_anchor":"reporting","anchor":"retrieve_reporting_report_run","section_anchor":"reporting_report_run","subsection_anchors":null,"path":"/reporting/report_run/retrieve","gate":false,"display_on_load":false},"list_reporting_report_run":{"title":"List all Report Runs","group_title":"Reporting","group_anchor":"reporting","anchor":"list_reporting_report_run","section_anchor":"reporting_report_run","subsection_anchors":null,"path":"/reporting/report_run/list","gate":false,"display_on_load":false},"reporting_report_type":{"title":"Report Types","group_title":"Reporting","group_anchor":"reporting","anchor":"reporting_report_type","section_anchor":"reporting_report_type","subsection_anchors":["reporting_report_type_object","retrieve_reporting_report_type","list_reporting_report_type"],"path":"/reporting/report_type","gate":false,"display_on_load":false,"data":{"section_type":"resource","title":"Report Types","description":"The Report Type resource corresponds to a particular type of report, such as\nthe \"Activity summary\" or \"Itemized payouts\" reports. These objects are\nidentified by an ID belonging to a set of enumerated values. See\n[API Access to Reports documentation](/docs/reporting/statements/api)\nfor those Report Type IDs, along with required and optional parameters.\n\nNote that certain report types can only be run based on your live-mode data (not test-mode\ndata), and will error when queried without a [live-mode API key](/docs/keys#test-live-modes).\n","section_tag":"reporting_report_type","subsection_summaries":[{"anchor":"reporting_report_type_object","curl_definition":null},{"anchor":"retrieve_reporting_report_type","curl_definition":"GET /v1/reporting/report_types/:id"},{"anchor":"list_reporting_report_type","curl_definition":"GET /v1/reporting/report_types"}]}},"reporting_report_type_object":{"title":"The Report Type object","group_title":"Reporting","group_anchor":"reporting","anchor":"reporting_report_type_object","section_anchor":"reporting_report_type","subsection_anchors":null,"path":"/reporting/report_type/object","gate":false,"display_on_load":false},"retrieve_reporting_report_type":{"title":"Retrieve a Report Type","group_title":"Reporting","group_anchor":"reporting","anchor":"retrieve_reporting_report_type","section_anchor":"reporting_report_type","subsection_anchors":null,"path":"/reporting/report_type/retrieve","gate":false,"display_on_load":false},"list_reporting_report_type":{"title":"List all Report Types","group_title":"Reporting","group_anchor":"reporting","anchor":"list_reporting_report_type","section_anchor":"reporting_report_type","subsection_anchors":null,"path":"/reporting/report_type/list","gate":false,"display_on_load":false},"financial_connections_accounts":{"title":"Accounts","group_title":"Financial Connections","group_anchor":"financial_connections","anchor":"financial_connections_accounts","section_anchor":"financial_connections_accounts","subsection_anchors":["financial_connections_account_object","financial_connections_retrieve_account","financial_connections_refresh_account","financial_connections_subscribe_account","financial_connections_unsubscribe_account","financial_connections_disconnect_account","financial_connections_list_accounts"],"path":"/financial_connections/accounts","gate":false,"display_on_load":false,"data":{"section_type":"resource","title":"Accounts","description":"A Financial Connections Account represents an account that exists outside of Stripe, to which you have been granted some degree of access.\n","section_tag":"financial_connections_accounts","subsection_summaries":[{"anchor":"financial_connections_account_object","curl_definition":null},{"anchor":"financial_connections_retrieve_account","curl_definition":"GET /v1/financial_connections/accounts/:id"},{"anchor":"financial_connections_refresh_account","curl_definition":"POST /v1/financial_connections/accounts/:id/refresh"},{"anchor":"financial_connections_subscribe_account","curl_definition":"POST /v1/financial_connections/accounts/:id/subscribe"},{"anchor":"financial_connections_unsubscribe_account","curl_definition":"POST /v1/financial_connections/accounts/:id/unsubscribe"},{"anchor":"financial_connections_disconnect_account","curl_definition":"POST /v1/financial_connections/accounts/:id/disconnect"},{"anchor":"financial_connections_list_accounts","curl_definition":"GET /v1/financial_connections/accounts"}]}},"financial_connections_account_object":{"title":"The Account object","group_title":"Financial Connections","group_anchor":"financial_connections","anchor":"financial_connections_account_object","section_anchor":"financial_connections_accounts","subsection_anchors":null,"path":"/financial_connections/accounts/object","gate":false,"display_on_load":false},"financial_connections_retrieve_account":{"title":"Retrieve an Account","group_title":"Financial Connections","group_anchor":"financial_connections","anchor":"financial_connections_retrieve_account","section_anchor":"financial_connections_accounts","subsection_anchors":null,"path":"/financial_connections/accounts/retrieve","gate":false,"display_on_load":false},"financial_connections_refresh_account":{"title":"Refresh Account data","group_title":"Financial Connections","group_anchor":"financial_connections","anchor":"financial_connections_refresh_account","section_anchor":"financial_connections_accounts","subsection_anchors":null,"path":"/financial_connections/accounts/refresh","gate":false,"display_on_load":false},"financial_connections_subscribe_account":{"title":"Subscribe to data refreshes for an Account","group_title":"Financial Connections","group_anchor":"financial_connections","anchor":"financial_connections_subscribe_account","section_anchor":"financial_connections_accounts","subsection_anchors":null,"path":"/financial_connections/accounts/subscribe","gate":false,"display_on_load":false},"financial_connections_unsubscribe_account":{"title":"Unsubscribe from data refreshes for an Account","group_title":"Financial Connections","group_anchor":"financial_connections","anchor":"financial_connections_unsubscribe_account","section_anchor":"financial_connections_accounts","subsection_anchors":null,"path":"/financial_connections/accounts/unsubscribe","gate":false,"display_on_load":false},"financial_connections_disconnect_account":{"title":"Disconnect an Account","group_title":"Financial Connections","group_anchor":"financial_connections","anchor":"financial_connections_disconnect_account","section_anchor":"financial_connections_accounts","subsection_anchors":null,"path":"/financial_connections/accounts/disconnect","gate":false,"display_on_load":false},"financial_connections_list_accounts":{"title":"List Accounts","group_title":"Financial Connections","group_anchor":"financial_connections","anchor":"financial_connections_list_accounts","section_anchor":"financial_connections_accounts","subsection_anchors":null,"path":"/financial_connections/accounts/list","gate":false,"display_on_load":false},"financial_connections_ownership":{"title":"Account Ownership","group_title":"Financial Connections","group_anchor":"financial_connections","anchor":"financial_connections_ownership","section_anchor":"financial_connections_ownership","subsection_anchors":["financial_connections_ownership_object","financial_connections_owner_object","financial_connections_list_account_owners"],"path":"/financial_connections/ownership","gate":false,"display_on_load":false,"data":{"section_type":"resource","title":"Account Ownership","description":"Describes a snapshot of the owners of an account at a particular point in time.","section_tag":"financial_connections_ownership","subsection_summaries":[{"anchor":"financial_connections_ownership_object","curl_definition":null},{"anchor":"financial_connections_owner_object","curl_definition":null},{"anchor":"financial_connections_list_account_owners","curl_definition":"GET /v1/financial_connections/accounts/:id/owners?ownership=:ownership_id"}]}},"financial_connections_ownership_object":{"title":"The Account Ownership object","group_title":"Financial Connections","group_anchor":"financial_connections","anchor":"financial_connections_ownership_object","section_anchor":"financial_connections_ownership","subsection_anchors":null,"path":"/financial_connections/ownership/object","gate":false,"display_on_load":false},"financial_connections_owner_object":{"title":"The Account Owner object","group_title":"Financial Connections","group_anchor":"financial_connections","anchor":"financial_connections_owner_object","section_anchor":"financial_connections_ownership","subsection_anchors":null,"path":"/financial_connections/ownership/owner-object","gate":false,"display_on_load":false},"financial_connections_list_account_owners":{"title":"List Account Owners","group_title":"Financial Connections","group_anchor":"financial_connections","anchor":"financial_connections_list_account_owners","section_anchor":"financial_connections_ownership","subsection_anchors":null,"path":"/financial_connections/ownership/list","gate":false,"display_on_load":false},"financial_connections_session":{"title":"Sessions","group_title":"Financial Connections","group_anchor":"financial_connections","anchor":"financial_connections_session","section_anchor":"financial_connections_session","subsection_anchors":["financial_connections_session_object","financial_connections_create_session","financial_connections_retrieve_session"],"path":"/financial_connections/session","gate":false,"display_on_load":false,"data":{"section_type":"resource","title":"Session","description":"A Financial Connections Session is the secure way to programmatically launch the client-side Stripe.js modal that lets your users link their accounts.\n","section_tag":"financial_connections_session","subsection_summaries":[{"anchor":"financial_connections_session_object","curl_definition":null},{"anchor":"financial_connections_create_session","curl_definition":"POST /v1/financial_connections/sessions"},{"anchor":"financial_connections_retrieve_session","curl_definition":"GET /v1/financial_connections/sessions/:id"}]}},"financial_connections_session_object":{"title":"The Session object","group_title":"Financial Connections","group_anchor":"financial_connections","anchor":"financial_connections_session_object","section_anchor":"financial_connections_session","subsection_anchors":null,"path":"/financial_connections/sessions/object","gate":false,"display_on_load":false},"financial_connections_create_session":{"title":"Create a Session","group_title":"Financial Connections","group_anchor":"financial_connections","anchor":"financial_connections_create_session","section_anchor":"financial_connections_session","subsection_anchors":null,"path":"/financial_connections/sessions/create","gate":false,"display_on_load":false},"financial_connections_retrieve_session":{"title":"Retrieve a Session","group_title":"Financial Connections","group_anchor":"financial_connections","anchor":"financial_connections_retrieve_session","section_anchor":"financial_connections_session","subsection_anchors":null,"path":"/financial_connections/sessions/retrieve","gate":false,"display_on_load":false},"financial_connections_transaction":{"title":"Transactions","group_title":"Financial Connections","group_anchor":"financial_connections","anchor":"financial_connections_transaction","section_anchor":"financial_connections_transaction","subsection_anchors":["financial_connections_transaction_object","financial_connections_list_transactions"],"path":"/financial_connections/transaction","gate":false,"display_on_load":false,"data":{"section_type":"resource","title":"Transactions","description":"A Transaction represents a real transaction that affects a Financial Connections Account balance.\n","section_tag":"financial_connections_transaction","subsection_summaries":[{"anchor":"financial_connections_transaction_object","curl_definition":null},{"anchor":"financial_connections_list_transactions","curl_definition":"GET /v1/financial_connections/transactions"}]}},"financial_connections_transaction_object":{"title":"The Transaction object","group_title":"Financial Connections","group_anchor":"financial_connections","anchor":"financial_connections_transaction_object","section_anchor":"financial_connections_transaction","subsection_anchors":null,"path":"/financial_connections/transactions/object","gate":false,"display_on_load":false},"financial_connections_list_transactions":{"title":"List Transactions","group_title":"Financial Connections","group_anchor":"financial_connections","anchor":"financial_connections_list_transactions","section_anchor":"financial_connections_transaction","subsection_anchors":null,"path":"/financial_connections/transactions/list","gate":false,"display_on_load":false},"identity_verification_sessions":{"title":"VerificationSessions","group_title":"Identity","group_anchor":"identity","anchor":"identity_verification_sessions","section_anchor":"identity_verification_sessions","subsection_anchors":["identity_verification_session_object","create_identity_verification_session","list_identity_verification_session","retrieve_identity_verification_session","update_identity_verification_session","cancel_identity_verification_session","redact_identity_verification_session"],"path":"/identity/verification_sessions","gate":false,"display_on_load":false,"data":{"section_type":"resource","title":"VerificationSession","description":"A VerificationSession guides you through the process of collecting and verifying the identities\nof your users. It contains details about the type of verification, such as what [verification\ncheck](/docs/identity/verification-checks) to perform. Only create one VerificationSession for\neach verification in your system.\n\nA VerificationSession transitions through [multiple\nstatuses](/docs/identity/how-sessions-work) throughout its lifetime as it progresses through\nthe verification flow. The VerificationSession contains the user's verified data after\nverification checks are complete.\n\nRelated guide: [The Verification Sessions API](/docs/identity/verification-sessions)\n","section_tag":"identity_verification_sessions","subsection_summaries":[{"anchor":"identity_verification_session_object","curl_definition":null},{"anchor":"create_identity_verification_session","curl_definition":"POST /v1/identity/verification_sessions"},{"anchor":"list_identity_verification_session","curl_definition":"GET /v1/identity/verification_sessions"},{"anchor":"retrieve_identity_verification_session","curl_definition":"GET /v1/identity/verification_sessions/:id"},{"anchor":"update_identity_verification_session","curl_definition":"POST /v1/identity/verification_sessions/:id"},{"anchor":"cancel_identity_verification_session","curl_definition":"POST /v1/identity/verification_sessions/:id/cancel"},{"anchor":"redact_identity_verification_session","curl_definition":"POST /v1/identity/verification_sessions/:id/redact"}]}},"identity_verification_session_object":{"title":"The VerificationSession object","group_title":"Identity","group_anchor":"identity","anchor":"identity_verification_session_object","section_anchor":"identity_verification_sessions","subsection_anchors":null,"path":"/identity/verification_sessions/object","gate":false,"display_on_load":false},"create_identity_verification_session":{"title":"Create a VerificationSession","group_title":"Identity","group_anchor":"identity","anchor":"create_identity_verification_session","section_anchor":"identity_verification_sessions","subsection_anchors":null,"path":"/identity/verification_sessions/create","gate":false,"display_on_load":false},"list_identity_verification_session":{"title":"List VerificationSessions","group_title":"Identity","group_anchor":"identity","anchor":"list_identity_verification_session","section_anchor":"identity_verification_sessions","subsection_anchors":null,"path":"/identity/verification_sessions/list","gate":false,"display_on_load":false},"retrieve_identity_verification_session":{"title":"Retrieve a VerificationSession","group_title":"Identity","group_anchor":"identity","anchor":"retrieve_identity_verification_session","section_anchor":"identity_verification_sessions","subsection_anchors":null,"path":"/identity/verification_sessions/retrieve","gate":false,"display_on_load":false},"update_identity_verification_session":{"title":"Update a VerificationSession","group_title":"Identity","group_anchor":"identity","anchor":"update_identity_verification_session","section_anchor":"identity_verification_sessions","subsection_anchors":null,"path":"/identity/verification_sessions/update","gate":false,"display_on_load":false},"cancel_identity_verification_session":{"title":"Cancel a VerificationSession","group_title":"Identity","group_anchor":"identity","anchor":"cancel_identity_verification_session","section_anchor":"identity_verification_sessions","subsection_anchors":null,"path":"/identity/verification_sessions/cancel","gate":false,"display_on_load":false},"redact_identity_verification_session":{"title":"Redact a VerificationSession","group_title":"Identity","group_anchor":"identity","anchor":"redact_identity_verification_session","section_anchor":"identity_verification_sessions","subsection_anchors":null,"path":"/identity/verification_sessions/redact","gate":false,"display_on_load":false},"identity_verification_reports":{"title":"VerificationReports","group_title":"Identity","group_anchor":"identity","anchor":"identity_verification_reports","section_anchor":"identity_verification_reports","subsection_anchors":["identity_verification_report_object","retrieve_identity_verification_report","list_identity_verification_report"],"path":"/identity/verification_reports","gate":false,"display_on_load":false,"data":{"section_type":"resource","title":"VerificationReport","description":"A VerificationReport is the result of an attempt to collect and verify data from a user.\nThe collection of verification checks performed is determined from the `type` and `options`\nparameters used. You can find the result of each verification check performed in the\nappropriate sub-resource: `document`, `id_number`, `selfie`.\n\nEach VerificationReport contains a copy of any data collected by the user as well as\nreference IDs which can be used to access collected images through the [FileUpload](/docs/api/files)\nAPI. To configure and create VerificationReports, use the\n[VerificationSession](/docs/api/identity/verification_sessions) API.\n\nRelated guides: [Accessing verification results](/docs/identity/verification-sessions#results).\n","section_tag":"identity_verification_reports","subsection_summaries":[{"anchor":"identity_verification_report_object","curl_definition":null},{"anchor":"retrieve_identity_verification_report","curl_definition":"GET /v1/identity/verification_reports/:id"},{"anchor":"list_identity_verification_report","curl_definition":"GET /v1/identity/verification_reports"}]}},"identity_verification_report_object":{"title":"The VerificationReport object","group_title":"Identity","group_anchor":"identity","anchor":"identity_verification_report_object","section_anchor":"identity_verification_reports","subsection_anchors":null,"path":"/identity/verification_reports/object","gate":false,"display_on_load":false},"retrieve_identity_verification_report":{"title":"Retrieve a VerificationReport","group_title":"Identity","group_anchor":"identity","anchor":"retrieve_identity_verification_report","section_anchor":"identity_verification_reports","subsection_anchors":null,"path":"/identity/verification_reports/retrieve","gate":false,"display_on_load":false},"list_identity_verification_report":{"title":"List VerificationReports","group_title":"Identity","group_anchor":"identity","anchor":"list_identity_verification_report","section_anchor":"identity_verification_reports","subsection_anchors":null,"path":"/identity/verification_reports/list","gate":false,"display_on_load":false},"webhook_endpoints":{"title":"Webhook Endpoints","group_title":"Webhooks","group_anchor":"webhooks","anchor":"webhook_endpoints","section_anchor":"webhook_endpoints","subsection_anchors":["webhook_endpoint_object","create_webhook_endpoint","retrieve_webhook_endpoint","update_webhook_endpoint","list_webhook_endpoints","delete_webhook_endpoints"],"path":"/webhook_endpoints","gate":false,"display_on_load":false,"data":{"section_type":"resource","title":"Webhook Endpoints","description":"You can configure [webhook endpoints](/docs/webhooks/) via the API to be\nnotified about events that happen in your Stripe account or connected\naccounts.\n\nMost users configure webhooks from [the dashboard](https://dashboard.stripe.com/webhooks), which provides a user interface for registering and testing your webhook endpoints.\n\nRelated guide: [Setting up Webhooks](/docs/webhooks/configure).\n","section_tag":"webhook_endpoints","subsection_summaries":[{"anchor":"webhook_endpoint_object","curl_definition":null},{"anchor":"create_webhook_endpoint","curl_definition":"POST /v1/webhook_endpoints"},{"anchor":"retrieve_webhook_endpoint","curl_definition":"GET /v1/webhook_endpoints/:id"},{"anchor":"update_webhook_endpoint","curl_definition":"POST /v1/webhook_endpoints/:id"},{"anchor":"list_webhook_endpoints","curl_definition":"GET /v1/webhook_endpoints"},{"anchor":"delete_webhook_endpoints","curl_definition":"DELETE /v1/webhook_endpoints/:id"}]}},"webhook_endpoint_object":{"title":"The webhook endpoint object","group_title":"Webhooks","group_anchor":"webhooks","anchor":"webhook_endpoint_object","section_anchor":"webhook_endpoints","subsection_anchors":null,"path":"/webhook_endpoints/object","gate":false,"display_on_load":false},"create_webhook_endpoint":{"title":"Create a webhook endpoint","group_title":"Webhooks","group_anchor":"webhooks","anchor":"create_webhook_endpoint","section_anchor":"webhook_endpoints","subsection_anchors":null,"path":"/webhook_endpoints/create","gate":false,"display_on_load":false},"retrieve_webhook_endpoint":{"title":"Retrieve a webhook endpoint","group_title":"Webhooks","group_anchor":"webhooks","anchor":"retrieve_webhook_endpoint","section_anchor":"webhook_endpoints","subsection_anchors":null,"path":"/webhook_endpoints/retrieve","gate":false,"display_on_load":false},"update_webhook_endpoint":{"title":"Update a webhook endpoint","group_title":"Webhooks","group_anchor":"webhooks","anchor":"update_webhook_endpoint","section_anchor":"webhook_endpoints","subsection_anchors":null,"path":"/webhook_endpoints/update","gate":false,"display_on_load":false},"list_webhook_endpoints":{"title":"List all webhook endpoints","group_title":"Webhooks","group_anchor":"webhooks","anchor":"list_webhook_endpoints","section_anchor":"webhook_endpoints","subsection_anchors":null,"path":"/webhook_endpoints/list","gate":false,"display_on_load":false},"delete_webhook_endpoints":{"title":"Delete a webhook endpoint","group_title":"Webhooks","group_anchor":"webhooks","anchor":"delete_webhook_endpoints","section_anchor":"webhook_endpoints","subsection_anchors":null,"path":"/webhook_endpoints/delete","gate":false,"display_on_load":false}}, -2023-03-06T20:20:37.131333Z  WARN write{base="out"}:generate:gen_impl_requests{name=account}: stripe_openapi_codegen::codegen: unhandled UPDATE for Account: POST /v1/accounts/{account}/capabilities/{capability} (already have [List, Create, Retrieve, Update, Delete]) -2023-03-06T20:20:37.131409Z  WARN write{base="out"}:generate:gen_impl_requests{name=account}: stripe_openapi_codegen::codegen: unhandled CREATE for Account: POST /v1/accounts/{account}/external_accounts (already have [List, Create, Retrieve, Update, Delete]) -2023-03-06T20:20:37.131457Z  WARN write{base="out"}:generate:gen_impl_requests{name=account}: stripe_openapi_codegen::codegen: unhandled UPDATE for Account: POST /v1/accounts/{account}/external_accounts/{id} (already have [List, Create, Retrieve, Update, Delete]) -2023-03-06T20:20:37.131481Z  WARN write{base="out"}:generate:gen_impl_requests{name=account}: stripe_openapi_codegen::codegen: unhandled DELETE for Account: /v1/accounts/{account}/external_accounts/{id} -2023-03-06T20:20:37.131514Z  WARN write{base="out"}:generate:gen_impl_requests{name=account}: stripe_openapi_codegen::codegen: unhandled CREATE for Account: POST /v1/accounts/{account}/login_links (already have [List, Create, Retrieve, Update, Delete]) -2023-03-06T20:20:37.131571Z  WARN write{base="out"}:generate:gen_impl_requests{name=account}: stripe_openapi_codegen::codegen: unhandled CREATE for Account: POST /v1/accounts/{account}/persons (already have [List, Create, Retrieve, Update, Delete]) -2023-03-06T20:20:37.131612Z  WARN write{base="out"}:generate:gen_impl_requests{name=account}: stripe_openapi_codegen::codegen: unhandled UPDATE for Account: POST /v1/accounts/{account}/persons/{person} (already have [List, Create, Retrieve, Update, Delete]) -2023-03-06T20:20:37.131661Z  WARN write{base="out"}:generate:gen_impl_requests{name=account}: stripe_openapi_codegen::codegen: unhandled DELETE for Account: /v1/accounts/{account}/persons/{person} -2023-03-06T20:20:37.131699Z  WARN write{base="out"}:generate:gen_impl_requests{name=account}: stripe_openapi_codegen::codegen: unhandled CREATE for Account: POST /v1/accounts/{account}/reject (already have [List, Create, Retrieve, Update, Delete]) -2023-03-06T20:20:37.178296Z  WARN write{base="out"}:generate:gen_struct{name=address}: stripe_openapi_codegen::url_finder: address not in html -2023-03-06T20:20:37.179001Z  WARN write{base="out"}:generate:gen_struct{name=legal_entity_japan_address}: stripe_openapi_codegen::url_finder: legal_entity_japan_address not in html -2023-03-06T20:20:37.180512Z  WARN write{base="out"}:generate:gen_struct{name=apple_pay_domain}: stripe_openapi_codegen::url_finder: apple_pay_domain not in html -2023-03-06T20:20:37.180925Z  WARN write{base="out"}:generate:gen_struct{name=application}: stripe_openapi_codegen::url_finder: application not in html -2023-03-06T20:20:37.182285Z  WARN write{base="out"}:generate:gen_impl_requests{name=application_fee}: stripe_openapi_codegen::codegen: unhandled UPDATE for ApplicationFee: POST /v1/application_fees/{fee}/refunds/{id} (already have [List]) -2023-03-06T20:20:37.182396Z  WARN write{base="out"}:generate:gen_impl_requests{name=application_fee}: stripe_openapi_codegen::codegen: unhandled UNKNOWN for ApplicationFee: POST /v1/application_fees/{id}/refunds (already have [List, Retrieve]) -2023-03-06T20:20:37.182827Z  WARN write{base="out"}:generate:gen_struct{name=apps.secret}: stripe_openapi_codegen::url_finder: apps.secret not in html -2023-03-06T20:20:37.187385Z  WARN write{base="out"}:generate:gen_struct{name=bank_account}: stripe_openapi_codegen::url_finder: bank_account not in html -2023-03-06T20:20:37.188678Z  WARN write{base="out"}:generate:gen_struct{name=billing_portal.configuration}: stripe_openapi_codegen::url_finder: billing_portal.configuration not in html -2023-03-06T20:20:37.192093Z  WARN write{base="out"}:generate:gen_struct{name=billing_portal.session}: stripe_openapi_codegen::url_finder: billing_portal.session not in html -2023-03-06T20:20:37.208136Z  WARN write{base="out"}:generate:gen_impl_requests{name=charge}: stripe_openapi_codegen::codegen: unhandled CREATE for Charge: POST /v1/charges/{charge}/capture (already have [List, Create, Retrieve, Update]) -2023-03-06T20:20:37.244007Z  WARN write{base="out"}:generate:gen_struct{name=address}: stripe_openapi_codegen::url_finder: address not in html -2023-03-06T20:20:37.244834Z  WARN write{base="out"}:generate:gen_struct{name=billing_details}: stripe_openapi_codegen::url_finder: billing_details not in html -2023-03-06T20:20:37.245352Z  WARN write{base="out"}:generate:gen_struct{name=payment_method_details_card_installments_plan}: stripe_openapi_codegen::url_finder: payment_method_details_card_installments_plan not in html -2023-03-06T20:20:37.246003Z  WARN write{base="out"}:generate:gen_struct{name=radar_radar_options}: stripe_openapi_codegen::url_finder: radar_radar_options not in html -2023-03-06T20:20:37.246293Z  WARN write{base="out"}:generate:gen_struct{name=shipping}: stripe_openapi_codegen::url_finder: shipping not in html -2023-03-06T20:20:37.246819Z  WARN write{base="out"}:generate:gen_struct{name=three_d_secure_details}: stripe_openapi_codegen::url_finder: three_d_secure_details not in html -2023-03-06T20:20:37.253021Z  WARN write{base="out"}:generate:gen_impl_requests{name=checkout.session}: stripe_openapi_codegen::codegen: unhandled UNKNOWN for CheckoutSession: POST /v1/checkout/sessions/{session}/expire (already have [List, Create]) -2023-03-06T20:20:37.346687Z  WARN write{base="out"}:generate:gen_struct{name=address}: stripe_openapi_codegen::url_finder: address not in html -2023-03-06T20:20:37.348100Z  WARN write{base="out"}:generate:gen_struct{name=invoice_setting_rendering_options}: stripe_openapi_codegen::url_finder: invoice_setting_rendering_options not in html -2023-03-06T20:20:37.348603Z  WARN write{base="out"}:generate:gen_struct{name=linked_account_options_us_bank_account}: stripe_openapi_codegen::url_finder: linked_account_options_us_bank_account not in html -2023-03-06T20:20:37.349543Z  WARN write{base="out"}:generate:gen_struct{name=payment_method_options_customer_balance_eu_bank_account}: stripe_openapi_codegen::url_finder: payment_method_options_customer_balance_eu_bank_account not in html -2023-03-06T20:20:37.350332Z  WARN write{base="out"}:generate:gen_struct{name=shipping}: stripe_openapi_codegen::url_finder: shipping not in html -2023-03-06T20:20:37.351137Z  WARN write{base="out"}:generate:gen_struct{name=connect_collection_transfer}: stripe_openapi_codegen::url_finder: connect_collection_transfer not in html -2023-03-06T20:20:37.361767Z  WARN write{base="out"}:generate:gen_impl_requests{name=credit_note}: stripe_openapi_codegen::codegen: unhandled UNKNOWN for CreditNote: POST /v1/credit_notes/{id}/void (already have [List, Create, Retrieve, Update]) -2023-03-06T20:20:37.365947Z  WARN write{base="out"}:generate:gen_struct{name=invoices_shipping_cost}: stripe_openapi_codegen::url_finder: invoices_shipping_cost not in html -2023-03-06T20:20:37.373066Z  WARN write{base="out"}:generate:gen_impl_requests{name=customer}: stripe_openapi_codegen::codegen: unhandled CREATE for Customer: POST /v1/customers/{customer}/balance_transactions (already have [List, Create, Retrieve, Update, Delete]) -2023-03-06T20:20:37.373159Z  WARN write{base="out"}:generate:gen_impl_requests{name=customer}: stripe_openapi_codegen::codegen: unhandled UPDATE for Customer: POST /v1/customers/{customer}/balance_transactions/{transaction} (already have [List, Create, Retrieve, Update, Delete]) -2023-03-06T20:20:37.373231Z  WARN write{base="out"}:generate:gen_impl_requests{name=customer}: stripe_openapi_codegen::codegen: unhandled UNKNOWN for Customer: POST /v1/customers/{customer}/cash_balance (already have [List, Create, Retrieve, Update, Delete]) -2023-03-06T20:20:37.373286Z  WARN write{base="out"}:generate:gen_impl_requests{name=customer}: stripe_openapi_codegen::codegen: unhandled DELETE for Customer: /v1/customers/{customer}/discount -2023-03-06T20:20:37.373339Z  WARN write{base="out"}:generate:gen_impl_requests{name=customer}: stripe_openapi_codegen::codegen: unhandled CREATE for Customer: POST /v1/customers/{customer}/funding_instructions (already have [List, Create, Retrieve, Update, Delete]) -2023-03-06T20:20:37.373410Z  WARN write{base="out"}:generate:gen_impl_requests{name=customer}: stripe_openapi_codegen::codegen: unhandled CREATE for Customer: POST /v1/customers/{customer}/sources (already have [List, Create, Retrieve, Update, Delete]) -2023-03-06T20:20:37.373468Z  WARN write{base="out"}:generate:gen_impl_requests{name=customer}: stripe_openapi_codegen::codegen: unhandled UNKNOWN for Customer: POST /v1/customers/{customer}/sources/{id}/verify (already have [List, Create, Retrieve, Update, Delete]) -2023-03-06T20:20:37.373521Z  WARN write{base="out"}:generate:gen_impl_requests{name=customer}: stripe_openapi_codegen::codegen: unhandled CREATE for Customer: POST /v1/customers/{customer}/tax_ids (already have [List, Create, Retrieve, Update, Delete]) -2023-03-06T20:20:37.373575Z  WARN write{base="out"}:generate:gen_impl_requests{name=customer}: stripe_openapi_codegen::codegen: unhandled DELETE for Customer: /v1/customers/{customer}/tax_ids/{id} -2023-03-06T20:20:37.385760Z  WARN write{base="out"}:generate:gen_struct{name=address}: stripe_openapi_codegen::url_finder: address not in html -2023-03-06T20:20:37.386533Z  WARN write{base="out"}:generate:gen_struct{name=invoice_setting_rendering_options}: stripe_openapi_codegen::url_finder: invoice_setting_rendering_options not in html -2023-03-06T20:20:37.386871Z  WARN write{base="out"}:generate:gen_struct{name=shipping}: stripe_openapi_codegen::url_finder: shipping not in html -2023-03-06T20:20:37.396502Z  WARN write{base="out"}:generate:gen_impl_requests{name=dispute}: stripe_openapi_codegen::codegen: unhandled UNKNOWN for Dispute: POST /v1/disputes/{dispute} (already have [List, Retrieve]) -2023-03-06T20:20:37.396599Z  WARN write{base="out"}:generate:gen_impl_requests{name=dispute}: stripe_openapi_codegen::codegen: unhandled UNKNOWN for Dispute: POST /v1/disputes/{dispute}/close (already have [List, Retrieve]) -2023-03-06T20:20:37.401782Z  WARN write{base="out"}:generate:gen_struct{name=ephemeral_key}: stripe_openapi_codegen::url_finder: ephemeral_key not in html -2023-03-06T20:20:37.404672Z  WARN write{base="out"}:generate:gen_struct{name=exchange_rate}: stripe_openapi_codegen::url_finder: exchange_rate not in html -2023-03-06T20:20:37.407368Z  WARN write{base="out"}:generate:gen_impl_requests{name=file}: stripe_openapi_codegen::codegen: unhandled UNKNOWN for File: POST /v1/files (already have [List]) -2023-03-06T20:20:37.415881Z  WARN write{base="out"}:generate:gen_struct{name=bank_connections_resource_accountholder}: stripe_openapi_codegen::url_finder: bank_connections_resource_accountholder not in html -2023-03-06T20:20:37.416800Z  WARN write{base="out"}:generate:gen_struct{name=financial_connections.account_owner}: stripe_openapi_codegen::url_finder: financial_connections.account_owner not in html -2023-03-06T20:20:37.417563Z  WARN write{base="out"}:generate:gen_struct{name=financial_connections.account_ownership}: stripe_openapi_codegen::url_finder: financial_connections.account_ownership not in html -2023-03-06T20:20:37.421322Z  WARN write{base="out"}:generate:gen_struct{name=bank_connections_resource_accountholder}: stripe_openapi_codegen::url_finder: bank_connections_resource_accountholder not in html -2023-03-06T20:20:37.422167Z  WARN write{base="out"}:generate:gen_struct{name=funding_instructions}: stripe_openapi_codegen::url_finder: funding_instructions not in html -2023-03-06T20:20:37.432821Z  WARN write{base="out"}:generate:gen_struct{name=address}: stripe_openapi_codegen::url_finder: address not in html -2023-03-06T20:20:37.437849Z  WARN write{base="out"}:generate:gen_struct{name=address}: stripe_openapi_codegen::url_finder: address not in html -2023-03-06T20:20:37.448519Z  WARN write{base="out"}:generate:gen_impl_requests{name=invoice}: stripe_openapi_codegen::codegen: unhandled UNKNOWN for Invoice: POST /v1/invoices/{invoice} (already have [List, Create, Retrieve]) -2023-03-06T20:20:37.448747Z  WARN write{base="out"}:generate:gen_impl_requests{name=invoice}: stripe_openapi_codegen::codegen: unhandled UNKNOWN for Invoice: POST /v1/invoices/{invoice}/finalize (already have [List, Create, Retrieve, Delete]) -2023-03-06T20:20:37.448833Z  WARN write{base="out"}:generate:gen_impl_requests{name=invoice}: stripe_openapi_codegen::codegen: unhandled UNKNOWN for Invoice: POST /v1/invoices/{invoice}/mark_uncollectible (already have [List, Create, Retrieve, Delete]) -2023-03-06T20:20:37.448893Z  WARN write{base="out"}:generate:gen_impl_requests{name=invoice}: stripe_openapi_codegen::codegen: unhandled CREATE for Invoice: POST /v1/invoices/{invoice}/pay (already have [List, Create, Retrieve, Delete]) -2023-03-06T20:20:37.448954Z  WARN write{base="out"}:generate:gen_impl_requests{name=invoice}: stripe_openapi_codegen::codegen: unhandled UNKNOWN for Invoice: POST /v1/invoices/{invoice}/send (already have [List, Create, Retrieve, Delete]) -2023-03-06T20:20:37.449021Z  WARN write{base="out"}:generate:gen_impl_requests{name=invoice}: stripe_openapi_codegen::codegen: unhandled UNKNOWN for Invoice: POST /v1/invoices/{invoice}/void (already have [List, Create, Retrieve, Delete]) -2023-03-06T20:20:37.476117Z  WARN write{base="out"}:generate:gen_struct{name=address}: stripe_openapi_codegen::url_finder: address not in html -2023-03-06T20:20:37.477447Z  WARN write{base="out"}:generate:gen_struct{name=api_errors}: stripe_openapi_codegen::url_finder: api_errors not in html -2023-03-06T20:20:37.479342Z  WARN write{base="out"}:generate:gen_struct{name=invoice_payment_method_options_acss_debit}: stripe_openapi_codegen::url_finder: invoice_payment_method_options_acss_debit not in html -2023-03-06T20:20:37.480732Z  WARN write{base="out"}:generate:gen_struct{name=invoice_payment_method_options_bancontact}: stripe_openapi_codegen::url_finder: invoice_payment_method_options_bancontact not in html -2023-03-06T20:20:37.481393Z  WARN write{base="out"}:generate:gen_struct{name=invoice_payment_method_options_customer_balance}: stripe_openapi_codegen::url_finder: invoice_payment_method_options_customer_balance not in html -2023-03-06T20:20:37.482584Z  WARN write{base="out"}:generate:gen_struct{name=invoice_payment_method_options_konbini}: stripe_openapi_codegen::url_finder: invoice_payment_method_options_konbini not in html -2023-03-06T20:20:37.482865Z  WARN write{base="out"}:generate:gen_struct{name=invoice_payment_method_options_us_bank_account}: stripe_openapi_codegen::url_finder: invoice_payment_method_options_us_bank_account not in html -2023-03-06T20:20:37.483775Z  WARN write{base="out"}:generate:gen_struct{name=invoice_setting_rendering_options}: stripe_openapi_codegen::url_finder: invoice_setting_rendering_options not in html -2023-03-06T20:20:37.484111Z  WARN write{base="out"}:generate:gen_struct{name=invoices_shipping_cost}: stripe_openapi_codegen::url_finder: invoices_shipping_cost not in html -2023-03-06T20:20:37.484942Z  WARN write{base="out"}:generate:gen_struct{name=shipping}: stripe_openapi_codegen::url_finder: shipping not in html -2023-03-06T20:20:37.495305Z  WARN write{base="out"}:generate:gen_struct{name=issuing_authorization_amount_details}: stripe_openapi_codegen::url_finder: issuing_authorization_amount_details not in html -2023-03-06T20:20:37.495643Z  WARN write{base="out"}:generate:gen_struct{name=issuing_authorization_merchant_data}: stripe_openapi_codegen::url_finder: issuing_authorization_merchant_data not in html -2023-03-06T20:20:37.519118Z  WARN write{base="out"}:generate:gen_struct{name=address}: stripe_openapi_codegen::url_finder: address not in html -2023-03-06T20:20:37.547180Z  WARN write{base="out"}:generate:gen_struct{name=address}: stripe_openapi_codegen::url_finder: address not in html -2023-03-06T20:20:37.559909Z  WARN write{base="out"}:generate:gen_struct{name=issuing_authorization_merchant_data}: stripe_openapi_codegen::url_finder: issuing_authorization_merchant_data not in html -2023-03-06T20:20:37.560884Z  WARN write{base="out"}:generate:gen_struct{name=item}: stripe_openapi_codegen::url_finder: item not in html -2023-03-06T20:20:37.562118Z  WARN write{base="out"}:generate:gen_struct{name=line_item}: stripe_openapi_codegen::url_finder: line_item not in html -2023-03-06T20:20:37.568334Z  WARN write{base="out"}:generate:gen_struct{name=mandate_options_off_session_details_blik}: stripe_openapi_codegen::url_finder: mandate_options_off_session_details_blik not in html -2023-03-06T20:20:37.568950Z  WARN write{base="out"}:generate:gen_struct{name=notification_event_data}: stripe_openapi_codegen::url_finder: notification_event_data not in html -2023-03-06T20:20:37.573511Z  WARN write{base="out"}:generate:gen_impl_requests{name=payment_intent}: stripe_openapi_codegen::codegen: unhandled UNKNOWN for PaymentIntent: POST /v1/payment_intents/{intent}/apply_customer_balance (already have [List, Create, Retrieve, Update]) -2023-03-06T20:20:37.573576Z  WARN write{base="out"}:generate:gen_impl_requests{name=payment_intent}: stripe_openapi_codegen::codegen: unhandled UNKNOWN for PaymentIntent: POST /v1/payment_intents/{intent}/cancel (already have [List, Create, Retrieve, Update]) -2023-03-06T20:20:37.573617Z  WARN write{base="out"}:generate:gen_impl_requests{name=payment_intent}: stripe_openapi_codegen::codegen: unhandled CREATE for PaymentIntent: POST /v1/payment_intents/{intent}/capture (already have [List, Create, Retrieve, Update]) -2023-03-06T20:20:37.573687Z  WARN write{base="out"}:generate:gen_impl_requests{name=payment_intent}: stripe_openapi_codegen::codegen: unhandled UNKNOWN for PaymentIntent: POST /v1/payment_intents/{intent}/confirm (already have [List, Create, Retrieve, Update]) -2023-03-06T20:20:37.573747Z  WARN write{base="out"}:generate:gen_impl_requests{name=payment_intent}: stripe_openapi_codegen::codegen: unhandled UPDATE for PaymentIntent: POST /v1/payment_intents/{intent}/increment_authorization (already have [List, Create, Retrieve, Update]) -2023-03-06T20:20:37.573784Z  WARN write{base="out"}:generate:gen_impl_requests{name=payment_intent}: stripe_openapi_codegen::codegen: unhandled UNKNOWN for PaymentIntent: POST /v1/payment_intents/{intent}/verify_microdeposits (already have [List, Create, Retrieve, Update]) -2023-03-06T20:20:37.696303Z  WARN write{base="out"}:generate:gen_struct{name=api_errors}: stripe_openapi_codegen::url_finder: api_errors not in html -2023-03-06T20:20:37.698222Z  WARN write{base="out"}:generate:gen_struct{name=linked_account_options_us_bank_account}: stripe_openapi_codegen::url_finder: linked_account_options_us_bank_account not in html -2023-03-06T20:20:37.698868Z  WARN write{base="out"}:generate:gen_struct{name=payment_method_details_card_installments_plan}: stripe_openapi_codegen::url_finder: payment_method_details_card_installments_plan not in html -2023-03-06T20:20:37.699513Z  WARN write{base="out"}:generate:gen_struct{name=payment_method_options_customer_balance_eu_bank_account}: stripe_openapi_codegen::url_finder: payment_method_options_customer_balance_eu_bank_account not in html -2023-03-06T20:20:37.699999Z  WARN write{base="out"}:generate:gen_struct{name=shipping}: stripe_openapi_codegen::url_finder: shipping not in html -2023-03-06T20:20:37.739709Z  WARN write{base="out"}:generate:gen_struct{name=invoice_setting_rendering_options}: stripe_openapi_codegen::url_finder: invoice_setting_rendering_options not in html -2023-03-06T20:20:37.743309Z  WARN write{base="out"}:generate:gen_impl_requests{name=payment_method}: stripe_openapi_codegen::codegen: unhandled CREATE for PaymentMethod: POST /v1/payment_methods/{payment_method}/attach (already have [List, Create, Retrieve, Update]) -2023-03-06T20:20:37.743437Z  WARN write{base="out"}:generate:gen_impl_requests{name=payment_method}: stripe_openapi_codegen::codegen: unhandled UNKNOWN for PaymentMethod: POST /v1/payment_methods/{payment_method}/detach (already have [List, Create, Retrieve, Update]) -2023-03-06T20:20:37.769801Z  WARN write{base="out"}:generate:gen_struct{name=address}: stripe_openapi_codegen::url_finder: address not in html -2023-03-06T20:20:37.770432Z  WARN write{base="out"}:generate:gen_struct{name=billing_details}: stripe_openapi_codegen::url_finder: billing_details not in html -2023-03-06T20:20:37.770924Z  WARN write{base="out"}:generate:gen_struct{name=radar_radar_options}: stripe_openapi_codegen::url_finder: radar_radar_options not in html -2023-03-06T20:20:37.773014Z  WARN write{base="out"}:generate:gen_impl_requests{name=payout}: stripe_openapi_codegen::codegen: unhandled CREATE for Payout: POST /v1/payouts/{payout}/cancel (already have [List, Create, Retrieve, Update]) -2023-03-06T20:20:37.773073Z  WARN write{base="out"}:generate:gen_impl_requests{name=payout}: stripe_openapi_codegen::codegen: unhandled UNKNOWN for Payout: POST /v1/payouts/{payout}/reverse (already have [List, Create, Retrieve, Update]) -2023-03-06T20:20:37.782416Z  WARN write{base="out"}:generate:gen_struct{name=address}: stripe_openapi_codegen::url_finder: address not in html -2023-03-06T20:20:37.783135Z  WARN write{base="out"}:generate:gen_struct{name=legal_entity_japan_address}: stripe_openapi_codegen::url_finder: legal_entity_japan_address not in html -2023-03-06T20:20:37.785333Z  WARN write{base="out"}:generate:gen_impl_requests{name=plan}: stripe_openapi_codegen::codegen: unhandled UNKNOWN for Plan: POST /v1/plans (already have [List]) -2023-03-06T20:20:37.786975Z  WARN write{base="out"}:generate:gen_struct{name=platform_tax_fee}: stripe_openapi_codegen::url_finder: platform_tax_fee not in html -2023-03-06T20:20:37.801176Z  WARN write{base="out"}:generate:gen_struct{name=custom_unit_amount}: stripe_openapi_codegen::url_finder: custom_unit_amount not in html -2023-03-06T20:20:37.808476Z  WARN write{base="out"}:generate:gen_impl_requests{name=promotion_code}: stripe_openapi_codegen::codegen: unhandled UNKNOWN for PromotionCode: POST /v1/promotion_codes (already have [List]) -2023-03-06T20:20:37.812566Z  WARN write{base="out"}:generate:gen_impl_requests{name=quote}: stripe_openapi_codegen::codegen: unhandled UNKNOWN for Quote: POST /v1/quotes (already have [List]) -2023-03-06T20:20:37.812656Z  WARN write{base="out"}:generate:gen_impl_requests{name=quote}: stripe_openapi_codegen::codegen: unhandled UNKNOWN for Quote: POST /v1/quotes/{quote} (already have [List, Retrieve]) -2023-03-06T20:20:37.812699Z  WARN write{base="out"}:generate:gen_impl_requests{name=quote}: stripe_openapi_codegen::codegen: unhandled UNKNOWN for Quote: POST /v1/quotes/{quote}/accept (already have [List, Retrieve]) -2023-03-06T20:20:37.812733Z  WARN write{base="out"}:generate:gen_impl_requests{name=quote}: stripe_openapi_codegen::codegen: unhandled UNKNOWN for Quote: POST /v1/quotes/{quote}/cancel (already have [List, Retrieve]) -2023-03-06T20:20:37.812789Z  WARN write{base="out"}:generate:gen_impl_requests{name=quote}: stripe_openapi_codegen::codegen: unhandled UNKNOWN for Quote: POST /v1/quotes/{quote}/finalize (already have [List, Retrieve]) -2023-03-06T20:20:37.816344Z  WARN write{base="out"}:generate:gen_struct{name=quotes_resource_total_details}: stripe_openapi_codegen::url_finder: quotes_resource_total_details not in html -2023-03-06T20:20:37.817186Z  WARN write{base="out"}:generate:gen_struct{name=radar.early_fraud_warning}: stripe_openapi_codegen::url_finder: radar.early_fraud_warning not in html -2023-03-06T20:20:37.820683Z  WARN write{base="out"}:generate:gen_impl_requests{name=refund}: stripe_openapi_codegen::codegen: unhandled UNKNOWN for Refund: POST /v1/refunds/{refund}/cancel (already have [List, Create, Retrieve, Update]) -2023-03-06T20:20:37.823804Z  WARN write{base="out"}:generate:gen_struct{name=reserve_transaction}: stripe_openapi_codegen::url_finder: reserve_transaction not in html -2023-03-06T20:20:37.825132Z  WARN write{base="out"}:generate:gen_impl_requests{name=review}: stripe_openapi_codegen::codegen: unhandled UNKNOWN for Review: POST /v1/reviews/{review}/approve (already have [List, Retrieve]) -2023-03-06T20:20:37.833540Z  WARN write{base="out"}:generate:gen_struct{name=api_errors}: stripe_openapi_codegen::url_finder: api_errors not in html -2023-03-06T20:20:37.834531Z  WARN write{base="out"}:generate:gen_struct{name=three_d_secure_details}: stripe_openapi_codegen::url_finder: three_d_secure_details not in html -2023-03-06T20:20:37.838162Z  WARN write{base="out"}:generate:gen_impl_requests{name=setup_intent}: stripe_openapi_codegen::codegen: unhandled UNKNOWN for SetupIntent: POST /v1/setup_intents/{intent}/cancel (already have [List, Create, Retrieve, Update]) -2023-03-06T20:20:37.838224Z  WARN write{base="out"}:generate:gen_impl_requests{name=setup_intent}: stripe_openapi_codegen::codegen: unhandled UNKNOWN for SetupIntent: POST /v1/setup_intents/{intent}/confirm (already have [List, Create, Retrieve, Update]) -2023-03-06T20:20:37.838264Z  WARN write{base="out"}:generate:gen_impl_requests{name=setup_intent}: stripe_openapi_codegen::codegen: unhandled UNKNOWN for SetupIntent: POST /v1/setup_intents/{intent}/verify_microdeposits (already have [List, Create, Retrieve, Update]) -2023-03-06T20:20:37.887160Z  WARN write{base="out"}:generate:gen_struct{name=api_errors}: stripe_openapi_codegen::url_finder: api_errors not in html -2023-03-06T20:20:37.888536Z  WARN write{base="out"}:generate:gen_struct{name=linked_account_options_us_bank_account}: stripe_openapi_codegen::url_finder: linked_account_options_us_bank_account not in html -2023-03-06T20:20:37.889146Z  WARN write{base="out"}:generate:gen_struct{name=mandate_options_off_session_details_blik}: stripe_openapi_codegen::url_finder: mandate_options_off_session_details_blik not in html -2023-03-06T20:20:37.897870Z  WARN write{base="out"}:generate:gen_impl_requests{name=source}: stripe_openapi_codegen::codegen: unhandled UNKNOWN for Source: POST /v1/sources/{source}/verify (already have [List, Create, Retrieve, Update]) -2023-03-06T20:20:37.914196Z  WARN write{base="out"}:generate:gen_struct{name=address}: stripe_openapi_codegen::url_finder: address not in html -2023-03-06T20:20:37.914752Z  WARN write{base="out"}:generate:gen_struct{name=shipping}: stripe_openapi_codegen::url_finder: shipping not in html -2023-03-06T20:20:37.915214Z  WARN write{base="out"}:generate:gen_struct{name=source_mandate_notification}: stripe_openapi_codegen::url_finder: source_mandate_notification not in html -2023-03-06T20:20:37.916275Z  WARN write{base="out"}:generate:gen_struct{name=source_transaction}: stripe_openapi_codegen::url_finder: source_transaction not in html -2023-03-06T20:20:37.922479Z  WARN write{base="out"}:generate:gen_impl_requests{name=subscription}: stripe_openapi_codegen::codegen: unhandled DELETE for Subscription: /v1/subscriptions/{subscription_exposed_id}/discount -2023-03-06T20:20:37.922536Z  WARN write{base="out"}:generate:gen_impl_requests{name=subscription}: stripe_openapi_codegen::codegen: unhandled UNKNOWN for Subscription: POST /v1/subscriptions/{subscription}/resume (already have [List, Create, Retrieve, Update, Delete]) -2023-03-06T20:20:37.953646Z  WARN write{base="out"}:generate:gen_struct{name=invoice_payment_method_options_acss_debit}: stripe_openapi_codegen::url_finder: invoice_payment_method_options_acss_debit not in html -2023-03-06T20:20:37.954518Z  WARN write{base="out"}:generate:gen_struct{name=invoice_payment_method_options_bancontact}: stripe_openapi_codegen::url_finder: invoice_payment_method_options_bancontact not in html -2023-03-06T20:20:37.954993Z  WARN write{base="out"}:generate:gen_struct{name=invoice_payment_method_options_customer_balance}: stripe_openapi_codegen::url_finder: invoice_payment_method_options_customer_balance not in html -2023-03-06T20:20:37.955942Z  WARN write{base="out"}:generate:gen_struct{name=invoice_payment_method_options_konbini}: stripe_openapi_codegen::url_finder: invoice_payment_method_options_konbini not in html -2023-03-06T20:20:37.956183Z  WARN write{base="out"}:generate:gen_struct{name=invoice_payment_method_options_us_bank_account}: stripe_openapi_codegen::url_finder: invoice_payment_method_options_us_bank_account not in html -2023-03-06T20:20:37.957090Z  WARN write{base="out"}:generate:gen_struct{name=subscription_billing_thresholds}: stripe_openapi_codegen::url_finder: subscription_billing_thresholds not in html -2023-03-06T20:20:37.957491Z  WARN write{base="out"}:generate:gen_struct{name=subscription_transfer_data}: stripe_openapi_codegen::url_finder: subscription_transfer_data not in html -2023-03-06T20:20:37.961766Z  WARN write{base="out"}:generate:gen_struct{name=subscription_item_billing_thresholds}: stripe_openapi_codegen::url_finder: subscription_item_billing_thresholds not in html -2023-03-06T20:20:37.963852Z  WARN write{base="out"}:generate:gen_impl_requests{name=subscription_schedule}: stripe_openapi_codegen::codegen: unhandled UNKNOWN for SubscriptionSchedule: POST /v1/subscription_schedules/{schedule}/cancel (already have [List, Create, Retrieve, Update]) -2023-03-06T20:20:37.963915Z  WARN write{base="out"}:generate:gen_impl_requests{name=subscription_schedule}: stripe_openapi_codegen::codegen: unhandled UNKNOWN for SubscriptionSchedule: POST /v1/subscription_schedules/{schedule}/release (already have [List, Create, Retrieve, Update]) -2023-03-06T20:20:37.982834Z  WARN write{base="out"}:generate:gen_struct{name=invoice_setting_subscription_schedule_setting}: stripe_openapi_codegen::url_finder: invoice_setting_subscription_schedule_setting not in html -2023-03-06T20:20:37.983149Z  WARN write{base="out"}:generate:gen_struct{name=subscription_billing_thresholds}: stripe_openapi_codegen::url_finder: subscription_billing_thresholds not in html -2023-03-06T20:20:37.983556Z  WARN write{base="out"}:generate:gen_struct{name=subscription_item_billing_thresholds}: stripe_openapi_codegen::url_finder: subscription_item_billing_thresholds not in html -2023-03-06T20:20:37.983840Z  WARN write{base="out"}:generate:gen_struct{name=subscription_transfer_data}: stripe_openapi_codegen::url_finder: subscription_transfer_data not in html -2023-03-06T20:20:37.984920Z  WARN write{base="out"}:generate:gen_struct{name=tax_deducted_at_source}: stripe_openapi_codegen::url_finder: tax_deducted_at_source not in html -2023-03-06T20:20:37.991799Z  WARN write{base="out"}:generate:gen_struct{name=address}: stripe_openapi_codegen::url_finder: address not in html -2023-03-06T20:20:37.995728Z  WARN write{base="out"}:generate:gen_struct{name=test_helpers.test_clock}: stripe_openapi_codegen::url_finder: test_helpers.test_clock not in html -2023-03-06T20:20:38.004716Z  WARN write{base="out"}:generate:gen_impl_requests{name=topup}: stripe_openapi_codegen::codegen: unhandled UNKNOWN for Topup: POST /v1/topups (already have [List]) -2023-03-06T20:20:38.004869Z  WARN write{base="out"}:generate:gen_impl_requests{name=topup}: stripe_openapi_codegen::codegen: unhandled UNKNOWN for Topup: POST /v1/topups/{topup}/cancel (already have [List, Retrieve, Update]) -2023-03-06T20:20:38.006890Z  WARN write{base="out"}:generate:gen_impl_requests{name=transfer}: stripe_openapi_codegen::codegen: unhandled CREATE for Transfer: POST /v1/transfers/{id}/reversals (already have [List, Create]) -2023-03-06T20:20:38.007052Z  WARN write{base="out"}:generate:gen_impl_requests{name=transfer}: stripe_openapi_codegen::codegen: unhandled UPDATE for Transfer: POST /v1/transfers/{transfer}/reversals/{id} (already have [List, Create, Retrieve, Update]) -2023-03-06T20:20:38.008856Z  WARN write{base="out"}:generate:gen_struct{name=treasury.credit_reversal}: stripe_openapi_codegen::url_finder: treasury.credit_reversal not in html -2023-03-06T20:20:38.010190Z  WARN write{base="out"}:generate:gen_struct{name=treasury.debit_reversal}: stripe_openapi_codegen::url_finder: treasury.debit_reversal not in html -2023-03-06T20:20:38.011637Z  WARN write{base="out"}:generate:gen_struct{name=treasury.financial_account}: stripe_openapi_codegen::url_finder: treasury.financial_account not in html -2023-03-06T20:20:38.015847Z  WARN write{base="out"}:generate:gen_struct{name=treasury.financial_account_features}: stripe_openapi_codegen::url_finder: treasury.financial_account_features not in html -2023-03-06T20:20:38.016926Z  WARN write{base="out"}:generate:gen_struct{name=treasury_financial_accounts_resource_ach_toggle_settings}: stripe_openapi_codegen::url_finder: treasury_financial_accounts_resource_ach_toggle_settings not in html -2023-03-06T20:20:38.018467Z  WARN write{base="out"}:generate:gen_struct{name=treasury_financial_accounts_resource_toggle_settings}: stripe_openapi_codegen::url_finder: treasury_financial_accounts_resource_toggle_settings not in html -2023-03-06T20:20:38.019970Z  WARN write{base="out"}:generate:gen_struct{name=treasury.inbound_transfer}: stripe_openapi_codegen::url_finder: treasury.inbound_transfer not in html -2023-03-06T20:20:38.023535Z  WARN write{base="out"}:generate:gen_struct{name=treasury_shared_resource_billing_details}: stripe_openapi_codegen::url_finder: treasury_shared_resource_billing_details not in html -2023-03-06T20:20:38.023928Z  WARN write{base="out"}:generate:gen_struct{name=treasury.outbound_payment}: stripe_openapi_codegen::url_finder: treasury.outbound_payment not in html -2023-03-06T20:20:38.028232Z  WARN write{base="out"}:generate:gen_struct{name=treasury_shared_resource_billing_details}: stripe_openapi_codegen::url_finder: treasury_shared_resource_billing_details not in html -2023-03-06T20:20:38.028625Z  WARN write{base="out"}:generate:gen_struct{name=treasury.outbound_transfer}: stripe_openapi_codegen::url_finder: treasury.outbound_transfer not in html -2023-03-06T20:20:38.032130Z  WARN write{base="out"}:generate:gen_struct{name=treasury_shared_resource_billing_details}: stripe_openapi_codegen::url_finder: treasury_shared_resource_billing_details not in html -2023-03-06T20:20:38.032510Z  WARN write{base="out"}:generate:gen_struct{name=treasury.received_credit}: stripe_openapi_codegen::url_finder: treasury.received_credit not in html -2023-03-06T20:20:38.035534Z  WARN write{base="out"}:generate:gen_struct{name=treasury_shared_resource_initiating_payment_method_details_initiating_payment_method_details}: stripe_openapi_codegen::url_finder: treasury_shared_resource_initiating_payment_method_details_initiating_payment_method_details not in html -2023-03-06T20:20:38.036951Z  WARN write{base="out"}:generate:gen_struct{name=treasury.received_debit}: stripe_openapi_codegen::url_finder: treasury.received_debit not in html -2023-03-06T20:20:38.039211Z  WARN write{base="out"}:generate:gen_struct{name=treasury_shared_resource_initiating_payment_method_details_initiating_payment_method_details}: stripe_openapi_codegen::url_finder: treasury_shared_resource_initiating_payment_method_details_initiating_payment_method_details not in html -2023-03-06T20:20:38.040678Z  WARN write{base="out"}:generate:gen_struct{name=treasury.transaction}: stripe_openapi_codegen::url_finder: treasury.transaction not in html -2023-03-06T20:20:38.042395Z  WARN write{base="out"}:generate:gen_struct{name=treasury_transactions_resource_balance_impact}: stripe_openapi_codegen::url_finder: treasury_transactions_resource_balance_impact not in html -2023-03-06T20:20:38.042831Z  WARN write{base="out"}:generate:gen_struct{name=treasury_transactions_resource_flow_details}: stripe_openapi_codegen::url_finder: treasury_transactions_resource_flow_details not in html -2023-03-06T20:20:38.043838Z  WARN write{base="out"}:generate:gen_struct{name=treasury.transaction_entry}: stripe_openapi_codegen::url_finder: treasury.transaction_entry not in html -2023-03-06T20:20:38.045892Z  WARN write{base="out"}:generate:gen_struct{name=treasury_transactions_resource_balance_impact}: stripe_openapi_codegen::url_finder: treasury_transactions_resource_balance_impact not in html -2023-03-06T20:20:38.046299Z  WARN write{base="out"}:generate:gen_struct{name=treasury_transactions_resource_flow_details}: stripe_openapi_codegen::url_finder: treasury_transactions_resource_flow_details not in html -2023-03-06T20:20:38.047569Z  WARN write{base="out"}:generate:gen_impl_requests{name=usage_record}: stripe_openapi_codegen::codegen: unhandled CREATE for UsageRecord: POST /v1/subscription_items/{subscription_item}/usage_records (already have []) -2023-03-06T20:20:38.047801Z  WARN write{base="out"}:generate:gen_struct{name=usage_record_summary}: stripe_openapi_codegen::url_finder: usage_record_summary not in html -2023-03-06T20:20:38.059087Z  WARN stripe_openapi_codegen: leftover objects: { - FileGenerator { - name: "address", - use_ids: {}, - use_config: {}, - use_params: {}, - use_resources: {}, - inferred_enums: {}, - inferred_unions: {}, - inferred_structs: {}, - inferred_parameters: {}, - generated_schemas: {}, - generated_objects: {}, - }, - FileGenerator { - name: "payment_source", - use_ids: {}, - use_config: {}, - use_params: {}, - use_resources: {}, - inferred_enums: {}, - inferred_unions: {}, - inferred_structs: {}, - inferred_parameters: {}, - generated_schemas: {}, - generated_objects: {}, - }, - FileGenerator { - name: "treasury_shared_resource_billing_details", - use_ids: {}, - use_config: {}, - use_params: {}, - use_resources: {}, - inferred_enums: {}, - inferred_unions: {}, - inferred_structs: {}, - inferred_parameters: {}, - generated_schemas: {}, - generated_objects: {}, - }, -} -[cargo-make] INFO - Execute Command: "rsync" "-a" "--delete-during" "out/" "../src/resources/generated" -[cargo-make] INFO - Execute Command: "rustup" "run" "nightly" "cargo" "fmt" -[cargo-make] INFO - Build Done in 8.82 seconds. diff --git a/src/error.rs b/src/error.rs deleted file mode 100644 index 014672470..000000000 --- a/src/error.rs +++ /dev/null @@ -1,217 +0,0 @@ -use std::num::ParseIntError; - -use serde::{Deserialize, Serialize}; -use thiserror::Error; - -use crate::params::to_snakecase; - -/// An error encountered when communicating with the Stripe API. -#[derive(Debug, Error)] -pub enum StripeError { - #[error("error reported by stripe: {0}")] - Stripe(#[from] RequestError), - #[error("error serializing or deserializing a querystring: {0}")] - QueryStringSerialize(#[from] serde_path_to_error::Error), - #[error("error serializing or deserializing a request")] - JSONSerialize(#[from] serde_path_to_error::Error), - #[error("attempted to access an unsupported version of the api")] - UnsupportedVersion, - #[error("error communicating with stripe: {0}")] - ClientError(String), - #[error("timeout communicating with stripe")] - Timeout, -} - -#[cfg(feature = "hyper")] -impl From for StripeError { - fn from(err: hyper::Error) -> StripeError { - StripeError::ClientError(err.to_string()) - } -} - -impl From for StripeError { - fn from(err: http_types::Error) -> StripeError { - StripeError::ClientError(err.to_string()) - } -} - -/// The list of possible values for a RequestError's type. -#[derive(Debug, PartialEq, Deserialize)] -pub enum ErrorType { - #[serde(skip_deserializing)] - Unknown, - #[serde(rename = "api_error")] - Api, - #[serde(rename = "api_connection_error")] - Connection, - #[serde(rename = "authentication_error")] - Authentication, - #[serde(rename = "card_error")] - Card, - #[serde(rename = "idempotency_error")] - IdempotencyError, - #[serde(rename = "invalid_request_error")] - InvalidRequest, - #[serde(rename = "rate_limit_error")] - RateLimit, - #[serde(rename = "validation_error")] - Validation, -} - -impl Default for ErrorType { - fn default() -> Self { - ErrorType::Unknown - } -} - -impl std::fmt::Display for ErrorType { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - write!(f, "{}", to_snakecase(&format!("{:?}Error", self))) - } -} - -/// The list of possible values for a RequestError's code. -#[derive(Clone, Copy, Debug, Deserialize, Serialize, Eq, PartialEq, Hash)] -#[serde(rename_all = "snake_case")] -#[non_exhaustive] -pub enum ErrorCode { - AccountAlreadyExists, - AccountCountryInvalidAddress, - AccountInvalid, - AccountNumberInvalid, - AlipayUpgradeRequired, - AmountTooLarge, - AmountTooSmall, - ApiKeyExpired, - BalanceInsufficient, - BankAccountExists, - BankAccountUnusable, - BankAccountUnverified, - BankAccountVerificationFailed, - BitcoinUpgradeRequired, - CardDeclined, - ChargeAlreadyCaptured, - ChargeAlreadyRefunded, - ChargeDisputed, - ChargeExpiredForCapture, - CountryUnsupported, - CouponExpired, - CustomerMaxSubscriptions, - EmailInvalid, - ExpiredCard, - IdempotencyKeyInUse, - IncorrectAddress, - IncorrectCvc, - IncorrectNumber, - IncorrectZip, - InstantPayoutsUnsupported, - InvalidCardType, - InvalidChargeAmount, - InvalidCvc, - InvalidExpiryMonth, - InvalidExpiryYear, - InvalidNumber, - InvalidSourceUsage, - InvoiceNoCustomerLineItems, - InvoiceNoSubscriptionLineItems, - InvoiceNotEditable, - InvoiceUpcomingNone, - LivemodeMismatch, - Missing, - OrderCreationFailed, - OrderRequiredSettings, - OrderStatusInvalid, - OrderUpstreamTimeout, - OutOfInventory, - ParameterInvalidEmpty, - ParameterInvalidInteger, - ParameterInvalidStringBlank, - ParameterInvalidStringEmpty, - ParameterMissing, - ParameterUnknown, - PaymentMethodUnactivated, - PaymentIntentUnexpectedState, - PayoutsNotAllowed, - PlatformApiKeyExpired, - PostalCodeInvalid, - ProcessingError, - ProductInactive, - RateLimit, - ResourceAlreadyExists, - ResourceMissing, - RoutingNumberInvalid, - SecretKeyRequired, - SepaUnsupportedAccount, - ShippingCalculationFailed, - SkuInactive, - StateUnsupported, - TaxIdInvalid, - TaxesCalculationFailed, - TestmodeChargesOnly, - TlsVersionUnsupported, - TokenAlreadyUsed, - TokenInUse, - TransfersNotAllowed, - UpstreamOrderCreationFailed, - UrlInvalid, -} - -impl std::fmt::Display for ErrorCode { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - write!(f, "{}", to_snakecase(&format!("{:?}", self))) - } -} - -/// An error reported by stripe in a request's response. -/// -/// For more details see . -#[derive(Debug, Default, Deserialize, Error)] -#[error("{error_type} ({http_status}){}", message.as_ref().map(|msg| { - format!(" with message: {msg:?}") -}).unwrap_or_default())] -pub struct RequestError { - /// The HTTP status in the response. - #[serde(skip_deserializing)] - pub http_status: u16, - - /// The type of error returned. - #[serde(rename = "type")] - pub error_type: ErrorType, - - /// A human-readable message providing more details about the error. - /// For card errors, these messages can be shown to end users. - #[serde(default)] - pub message: Option, - - /// For card errors, a value describing the kind of card error that occured. - pub code: Option, - - /// For card errors resulting from a bank decline, a string indicating the - /// bank's reason for the decline if they provide one. - pub decline_code: Option, - - /// The ID of the failed charge, if applicable. - pub charge: Option, -} - -/// The structure of the json body when an error is included in -/// the response from Stripe. -#[derive(Deserialize)] -pub struct ErrorResponse { - pub error: RequestError, -} - -/// An error encountered when communicating with the Stripe API webhooks. -#[derive(Debug, Error)] -pub enum WebhookError { - #[error("invalid key length")] - BadKey, - #[error("error parsing timestamp")] - BadHeader(#[from] ParseIntError), - #[error("error comparing signatures")] - BadSignature, - #[error("error comparing timestamps - over tolerance")] - BadTimestamp(i64), - #[error("error parsing event object")] - BadParse(#[from] serde_json::Error), -} diff --git a/src/ids.rs b/src/ids.rs deleted file mode 100644 index 3b03fd414..000000000 --- a/src/ids.rs +++ /dev/null @@ -1,758 +0,0 @@ -use smart_default::SmartDefault; - -macro_rules! def_id_serde_impls { - ($struct_name:ident) => { - impl serde::Serialize for $struct_name { - fn serialize(&self, serializer: S) -> Result - where - S: serde::ser::Serializer, - { - self.as_str().serialize(serializer) - } - } - - impl<'de> serde::Deserialize<'de> for $struct_name { - fn deserialize(deserializer: D) -> Result - where - D: serde::de::Deserializer<'de>, - { - let s: String = serde::Deserialize::deserialize(deserializer)?; - s.parse::().map_err(::serde::de::Error::custom) - } - } - }; - ($struct_name:ident, _) => {}; -} - -macro_rules! def_id { - ($struct_name:ident: String) => { - #[derive(Clone, Debug, Default, Eq, PartialEq, Hash)] - pub struct $struct_name(smol_str::SmolStr); - - impl $struct_name { - /// Extracts a string slice containing the entire id. - #[inline(always)] - pub fn as_str(&self) -> &str { - self.0.as_str() - } - } - - impl PartialEq for $struct_name { - fn eq(&self, other: &str) -> bool { - self.as_str() == other - } - } - - impl PartialEq<&str> for $struct_name { - fn eq(&self, other: &&str) -> bool { - self.as_str() == *other - } - } - - impl PartialEq for $struct_name { - fn eq(&self, other: &String) -> bool { - self.as_str() == other - } - } - - impl PartialOrd for $struct_name { - fn partial_cmp(&self, other: &Self) -> Option { - Some(self.cmp(other)) - } - } - - impl Ord for $struct_name { - fn cmp(&self, other: &Self) -> std::cmp::Ordering { - self.as_str().cmp(other.as_str()) - } - } - - impl AsRef for $struct_name { - fn as_ref(&self) -> &str { - self.as_str() - } - } - - impl crate::params::AsCursor for $struct_name {} - - impl std::ops::Deref for $struct_name { - type Target = str; - - fn deref(&self) -> &str { - self.as_str() - } - } - - impl std::fmt::Display for $struct_name { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - self.0.fmt(f) - } - } - - impl std::str::FromStr for $struct_name { - type Err = ParseIdError; - - fn from_str(s: &str) -> Result { - Ok($struct_name(s.into())) - } - } - - impl serde::Serialize for $struct_name { - fn serialize(&self, serializer: S) -> Result - where S: serde::ser::Serializer - { - self.as_str().serialize(serializer) - } - } - - impl<'de> serde::Deserialize<'de> for $struct_name { - fn deserialize(deserializer: D) -> Result - where D: serde::de::Deserializer<'de> - { - let s: String = serde::Deserialize::deserialize(deserializer)?; - s.parse::().map_err(::serde::de::Error::custom) - } - } - }; - ($struct_name:ident, $prefix:literal $(| $alt_prefix:literal)* $(, { $generate_hint:tt })?) => { - /// An id for the corresponding object type. - /// - /// This type _typically_ will not allocate and - /// therefore is usually cheaply clonable. - #[derive(Clone, Debug, Default, Eq, PartialEq, Hash)] - pub struct $struct_name(smol_str::SmolStr); - - impl $struct_name { - /// The prefix of the id type (e.g. `cus_` for a `CustomerId`). - #[inline(always)] - #[deprecated(note = "Please use prefixes or is_valid_prefix")] - pub fn prefix() -> &'static str { - $prefix - } - - /// The valid prefixes of the id type (e.g. [`ch_`, `py_`\ for a `ChargeId`). - #[inline(always)] - pub fn prefixes() -> &'static [&'static str] { - &[$prefix$(, $alt_prefix)*] - } - - /// Extracts a string slice containing the entire id. - #[inline(always)] - pub fn as_str(&self) -> &str { - self.0.as_str() - } - - /// Check is provided prefix would be a valid prefix for id's of this type - pub fn is_valid_prefix(prefix: &str) -> bool { - prefix == $prefix $( || prefix == $alt_prefix )* - } - } - - impl PartialEq for $struct_name { - fn eq(&self, other: &str) -> bool { - self.as_str() == other - } - } - - impl PartialEq<&str> for $struct_name { - fn eq(&self, other: &&str) -> bool { - self.as_str() == *other - } - } - - impl PartialEq for $struct_name { - fn eq(&self, other: &String) -> bool { - self.as_str() == other - } - } - - impl PartialOrd for $struct_name { - fn partial_cmp(&self, other: &Self) -> Option { - Some(self.cmp(other)) - } - } - - impl Ord for $struct_name { - fn cmp(&self, other: &Self) -> std::cmp::Ordering { - self.as_str().cmp(other.as_str()) - } - } - - impl AsRef for $struct_name { - fn as_ref(&self) -> &str { - self.as_str() - } - } - - impl crate::params::AsCursor for $struct_name {} - - impl std::ops::Deref for $struct_name { - type Target = str; - - fn deref(&self) -> &str { - self.as_str() - } - } - - impl std::fmt::Display for $struct_name { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - self.0.fmt(f) - } - } - - impl std::str::FromStr for $struct_name { - type Err = ParseIdError; - - fn from_str(s: &str) -> Result { - if !s.starts_with($prefix) $( - && !s.starts_with($alt_prefix) - )* { - // N.B. For debugging - eprintln!("bad id is: {} (expected: {:?}) for {}", s, $prefix, stringify!($struct_name)); - - Err(ParseIdError { - typename: stringify!($struct_name), - expected: stringify!(id to start with $prefix $(or $alt_prefix)*), - }) - } else { - Ok($struct_name(s.into())) - } - } - } - - def_id_serde_impls!($struct_name $(, $generate_hint )*); - }; - (#[optional] enum $enum_name:ident { $( $variant_name:ident($($variant_type:tt)*) ),* $(,)* }) => { - #[derive(Clone, Debug, Eq, PartialEq, Ord, PartialOrd, Hash)] - pub enum $enum_name { - None, - $( $variant_name($($variant_type)*), )* - } - - impl $enum_name { - pub fn as_str(&self) -> &str { - match *self { - $enum_name::None => "", - $( $enum_name::$variant_name(ref id) => id.as_str(), )* - } - } - } - - impl PartialEq for $enum_name { - fn eq(&self, other: &str) -> bool { - self.as_str() == other - } - } - - impl PartialEq<&str> for $enum_name { - fn eq(&self, other: &&str) -> bool { - self.as_str() == *other - } - } - - impl PartialEq for $enum_name { - fn eq(&self, other: &String) -> bool { - self.as_str() == other - } - } - - impl AsRef for $enum_name { - fn as_ref(&self) -> &str { - self.as_str() - } - } - - impl crate::params::AsCursor for $enum_name {} - - impl std::ops::Deref for $enum_name { - type Target = str; - - fn deref(&self) -> &str { - self.as_str() - } - } - - impl std::fmt::Display for $enum_name { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - match *self { - $enum_name::None => Ok(()), - $( $enum_name::$variant_name(ref id) => id.fmt(f), )* - } - } - } - - impl std::default::Default for $enum_name { - fn default() -> Self { - $enum_name::None - } - } - - impl std::str::FromStr for $enum_name { - type Err = ParseIdError; - - fn from_str(s: &str) -> Result { - let prefix = s.find('_') - .map(|i| &s[0..=i]) - .ok_or_else(|| ParseIdError { - typename: stringify!($enum_name), - expected: "id to start with a prefix (as in 'prefix_')" - })?; - - match prefix { - $(_ if $($variant_type)*::is_valid_prefix(prefix) => { - Ok($enum_name::$variant_name(s.parse()?)) - })* - _ => { - Err(ParseIdError { - typename: stringify!($enum_name), - expected: "unknown id prefix", - }) - } - } - } - } - - impl serde::Serialize for $enum_name { - fn serialize(&self, serializer: S) -> Result - where S: serde::ser::Serializer - { - self.as_str().serialize(serializer) - } - } - - impl<'de> serde::Deserialize<'de> for $enum_name { - fn deserialize(deserializer: D) -> Result - where D: serde::de::Deserializer<'de> - { - let s: String = serde::Deserialize::deserialize(deserializer)?; - s.parse::().map_err(::serde::de::Error::custom) - } - } - - $( - impl From<$($variant_type)*> for $enum_name { - fn from(id: $($variant_type)*) -> Self { - $enum_name::$variant_name(id) - } - } - )* - }; - (enum $enum_name:ident { $( $(#[$test:meta])? $variant_name:ident($($variant_type:tt)*) ),+ $(,)? }) => { - #[derive(Clone, Debug, Eq, PartialEq, Ord, PartialOrd, Hash)] - #[derive(SmartDefault)] - pub enum $enum_name { - $( $(#[$test])* $variant_name($($variant_type)*), )* - } - - impl $enum_name { - pub fn as_str(&self) -> &str { - match *self { - $( $enum_name::$variant_name(ref id) => id.as_str(), )* - } - } - } - - impl PartialEq for $enum_name { - fn eq(&self, other: &str) -> bool { - self.as_str() == other - } - } - - impl PartialEq<&str> for $enum_name { - fn eq(&self, other: &&str) -> bool { - self.as_str() == *other - } - } - - impl PartialEq for $enum_name { - fn eq(&self, other: &String) -> bool { - self.as_str() == other - } - } - - impl AsRef for $enum_name { - fn as_ref(&self) -> &str { - self.as_str() - } - } - - impl crate::params::AsCursor for $enum_name {} - - impl std::ops::Deref for $enum_name { - type Target = str; - - fn deref(&self) -> &str { - self.as_str() - } - } - - impl std::fmt::Display for $enum_name { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - match *self { - $( $enum_name::$variant_name(ref id) => id.fmt(f), )* - } - } - } - - impl std::str::FromStr for $enum_name { - type Err = ParseIdError; - - fn from_str(s: &str) -> Result { - let prefix = s.find('_') - .map(|i| &s[0..=i]) - .ok_or_else(|| ParseIdError { - typename: stringify!($enum_name), - expected: "id to start with a prefix (as in 'prefix_')" - })?; - - match prefix { - $(_ if $($variant_type)*::is_valid_prefix(prefix) => { - Ok($enum_name::$variant_name(s.parse()?)) - })* - _ => { - Err(ParseIdError { - typename: stringify!($enum_name), - expected: "unknown id prefix", - }) - } - } - } - } - - impl serde::Serialize for $enum_name { - fn serialize(&self, serializer: S) -> Result - where S: serde::ser::Serializer - { - self.as_str().serialize(serializer) - } - } - - impl<'de> serde::Deserialize<'de> for $enum_name { - fn deserialize(deserializer: D) -> Result - where D: serde::de::Deserializer<'de> - { - let s: String = serde::Deserialize::deserialize(deserializer)?; - s.parse::().map_err(::serde::de::Error::custom) - } - } - - $( - impl From<$($variant_type)*> for $enum_name { - fn from(id: $($variant_type)*) -> Self { - $enum_name::$variant_name(id) - } - } - )* - }; -} - -#[derive(Clone, Debug)] -pub struct ParseIdError { - typename: &'static str, - expected: &'static str, -} - -impl std::fmt::Display for ParseIdError { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - write!(f, "invalid `{}`, expected {}", self.typename, self.expected) - } -} - -impl std::error::Error for ParseIdError { - fn description(&self) -> &str { - "error parsing an id" - } -} - -def_id!(AccountId, "acct_"); -def_id!(AlipayAccountId, "aliacc_"); -def_id!(ApplicationFeeId, "fee_"); -def_id!(ApplicationId, "ca_"); -def_id!(ApplicationFeeRefundId, "fr_"); -def_id!(BalanceTransactionId, "txn_"); -def_id!(BankAccountId, "ba_" | "card_"); -def_id!(BillingPortalSessionId, "bps_"); -def_id!(BillingPortalConfigurationId, "bpc_"); -def_id!(BankTokenId, "btok_"); -def_id!( - #[optional] - enum BalanceTransactionSourceId { - ApplicationFee(ApplicationFeeId), - Charge(ChargeId), - Dispute(DisputeId), - ApplicationFeeRefund(ApplicationFeeRefundId), - IssuingAuthorization(IssuingAuthorizationId), - IssuingDispute(IssuingDisputeId), - IssuingTransaction(IssuingTransactionId), - Payout(PayoutId), - Refund(RefundId), - Topup(TopupId), - Transfer(TransferId), - TransferReversal(TransferReversalId), - } -); -def_id!(CardId, "card_"); -def_id!(CardTokenId, "tok_"); -def_id!(ChargeId, "ch_" | "py_"); // TODO: Understand (and then document) why "py_" is a valid charge id -def_id!(CheckoutSessionId, "cs_"); -def_id!(CheckoutSessionItemId, "li_"); -def_id!(ConnectCollectionTransferId, "connct_"); -def_id!(ConnectTokenId, "ct_"); -def_id!(CouponId: String); // N.B. A coupon id can be user-provided so can be any arbitrary string -def_id!(CreditNoteId, "cn_"); -def_id!(CreditNoteLineItemId, "cnli_"); -def_id!(CustomerBalanceTransactionId, "cbtxn_"); -def_id!(CustomerId, "cus_"); -def_id!(DiscountId, "di_"); -def_id!(DisputeId, "dp_" | "du_" | "pdp_"); -def_id!(EphemeralKeyId, "ephkey_"); -def_id!(EventId, "evt_"); -def_id!(FileId, "file_"); -def_id!(FileLinkId, "link_"); -def_id!(InvoiceId, "in_", { _ }); -def_id!(InvoiceItemId, "ii_"); -def_id!(InvoiceLineItemIdWebhook, "il_"); - -def_id!( - enum InvoiceLineItemId { - #[default] - Item(InvoiceItemId), - Subscription(SubscriptionLineId), - InvoiceLineItemIdWebhook(InvoiceLineItemIdWebhook), - } -); -def_id!(IssuingAuthorizationId, "iauth_"); -def_id!(IssuingCardId, "ic_"); -def_id!(IssuingCardholderId, "ich_"); -def_id!(IssuingDisputeId, "idp_"); -def_id!(IssuingTransactionId, "ipi_"); -def_id!(IssuingTokenId: String); -def_id!(OrderId, "or_"); -def_id!(OrderReturnId, "orret_"); -def_id!(MandateId, "mandate_"); -def_id!(PaymentMethodConfigurationId: String); -def_id!(PaymentIntentId, "pi_"); -def_id!(PaymentLinkId, "plink_"); -def_id!(PaymentMethodId, "pm_" | "card_" | "src_" | "ba_"); -def_id!( - enum PaymentSourceId { - #[default] - Account(AccountId), - AlipayAccount(AlipayAccountId), - BankAccount(BankAccountId), - Card(CardId), - Source(SourceId), - } -); -def_id!(PayoutId, "po_"); -def_id!( - enum PayoutDestinationId { - #[default] - BankAccount(BankAccountId), - Card(CardId), - } -); -def_id!(PersonId, "person_"); -def_id!(PlanId: String); // N.B. A plan id can be user-provided so can be any arbitrary string -def_id!(PlatformTaxFeeId, "ptf"); -def_id!(PriceId, "price_" | "plan_"); // see #470 -def_id!(ProductId: String); // N.B. A product id can be user-provided so can be any arbitrary string -def_id!(PromotionCodeId, "promo_"); -def_id!(QuoteId, "qt_"); -def_id!(RecipientId: String); // FIXME: This doesn't seem to be documented yet -def_id!(RefundId, "re_" | "pyr_"); -def_id!(ReserveTransactionId, "rtx"); -def_id!(ReviewId, "prv_"); -def_id!(ScheduledQueryRunId, "sqr_"); -def_id!(SetupAttemptId, "setatt_"); -def_id!(SetupIntentId, "seti_"); -def_id!(SkuId, "sku_"); -def_id!(ShippingRateId, "shr_"); -def_id!(SourceId, "src_"); -def_id!(SubscriptionId, "sub_"); -def_id!(SubscriptionItemId, "si_"); -def_id!(SubscriptionLineId, "sli_"); -def_id!(SubscriptionScheduleId, "sub_sched_"); -def_id!(TaxIdId, "txi_" | "atxi_"); -def_id!(TaxCalculationId: String); -def_id!(TaxCalculationLineItemId: String); -def_id!(TaxCodeId, "txcd_"); -def_id!(TaxDeductedAtSourceId, "itds"); -def_id!(TaxRateId, "txr_"); -def_id!(TerminalConfigurationId, "tmc_"); -def_id!(TerminalLocationId, "tml_"); -def_id!(TerminalReaderId, "tmr_"); -def_id!(TestHelpersTestClockId, "clock_"); -def_id!( - enum TokenId { - #[default] - Card(CardTokenId), - Bank(BankTokenId), - Connect(ConnectTokenId), - } -); -def_id!(TopupId, "tu_"); -def_id!(TransferId, "tr_"); -def_id!(TransferReversalId, "trr_"); -def_id!(UsageRecordId, "mbur_"); -def_id!(UsageRecordSummaryId, "urs_" | "sis_"); -def_id!(WebhookEndpointId, "we_"); - -impl InvoiceId { - pub(crate) fn none() -> Self { - Self("".into()) - } - - /// An InvoiceId may have a `None` representation when - /// received from Stripe if the Invoice is an upcoming invoice. - pub fn is_none(&self) -> bool { - self.0.is_empty() - } -} -impl serde::Serialize for InvoiceId { - fn serialize(&self, serializer: S) -> Result - where - S: serde::ser::Serializer, - { - if self.0.is_empty() { - let val: Option<&str> = None; - val.serialize(serializer) - } else { - self.as_str().serialize(serializer) - } - } -} -impl<'de> serde::Deserialize<'de> for InvoiceId { - fn deserialize(deserializer: D) -> Result - where - D: serde::de::Deserializer<'de>, - { - let s: Option = serde::Deserialize::deserialize(deserializer)?; - match s { - None => Ok(InvoiceId::none()), - Some(s) => { - if s.is_empty() { - Ok(InvoiceId::none()) - } else { - s.parse::().map_err(::serde::de::Error::custom) - } - } - } - } -} - -#[cfg(test)] -mod tests { - use std::fmt::{Debug, Display}; - use std::str::FromStr; - - use serde::de::DeserializeOwned; - use serde::{Deserialize, Serialize}; - use serde_json::json; - - use super::*; - - fn assert_ser_de_roundtrip(id: &str) - where - T: DeserializeOwned + Serialize + FromStr + Display + Debug, - ::Err: Debug, - { - let parsed_id = T::from_str(id).expect("Could not parse id"); - let ser = serde_json::to_string(&parsed_id).expect("Could not serialize id"); - let deser: T = serde_json::from_str(&ser).expect("Could not deserialize id"); - assert_eq!(deser.to_string(), id.to_string()); - } - - fn assert_deser_err(id: &str) { - let json_str = format!(r#""{}""#, id); - let deser: Result = serde_json::from_str(&json_str); - assert!(deser.is_err(), "Expected error, got {:?}", deser); - } - - #[test] - fn test_empty_invoice_id_default() { - #[derive(Deserialize)] - struct WithInvoiceId { - id: InvoiceId, - } - - for body in [json!({"id": ""}), json!({})] { - let deser: WithInvoiceId = serde_json::from_value(body).expect("Could not deser"); - assert_eq!(deser.id, InvoiceId::none()); - } - } - - #[test] - fn test_ser_de_roundtrip() { - // InvoiceId special cased - for id in ["in_12345", "in_"] { - assert_ser_de_roundtrip::(id); - } - - // Single prefix - assert_ser_de_roundtrip::("price_abc"); - - // Case where multiple possible prefixes - for id in ["re_bcd", "pyr_123"] { - assert_ser_de_roundtrip::(id); - } - - // Case where id can be anything - for id in ["anything", ""] { - assert_ser_de_roundtrip::(id); - } - - // Case where enum id - for id in ["tok_123", "btok_456"] { - assert_ser_de_roundtrip::(id); - } - } - - #[test] - fn test_deser_err() { - // InvoiceId special cased - assert_deser_err::("in"); - - // Single prefix - for id in ["sub", ""] { - assert_deser_err::(id); - } - - // Case where multiple possible prefixes - for id in ["abc_bcd", "pyr_123"] { - assert_deser_err::(id); - } - - // Case where enum id - for id in ["tok_123", "btok_456"] { - assert_deser_err::(id); - } - } - - #[test] - fn test_parse_customer() { - assert!("cus_123".parse::().is_ok()); - let bad_parse = "zzz_123".parse::(); - assert!(bad_parse.is_err()); - if let Err(err) = bad_parse { - assert_eq!( - format!("{}", err), - "invalid `CustomerId`, expected id to start with \"cus_\"" - ); - } - } - - #[test] - fn test_parse_charge() { - assert!("ch_123".parse::().is_ok()); - assert!("py_123".parse::().is_ok()); - let bad_parse = "zz_123".parse::(); - assert!(bad_parse.is_err()); - if let Err(err) = bad_parse { - assert_eq!( - format!("{}", err), - "invalid `ChargeId`, expected id to start with \"ch_\" or \"py_\"" - ); - } - } -} diff --git a/src/params.rs b/src/params.rs deleted file mode 100644 index 224cd6e23..000000000 --- a/src/params.rs +++ /dev/null @@ -1,920 +0,0 @@ -use std::collections::HashMap; - -use serde::de::DeserializeOwned; -use serde::{Deserialize, Serialize}; - -use crate::error::StripeError; -use crate::resources::{ApiVersion, Currency}; -use crate::{ - client::{ - config::{err, ok}, - Client, Response, - }, - AccountId, ApplicationId, -}; - -#[derive(Clone, Default)] -pub struct AppInfo { - pub name: String, - pub url: Option, - pub version: Option, -} - -impl ToString for AppInfo { - /// Formats a plugin's 'App Info' into a string that can be added to the end of an User-Agent string. - /// - /// This formatting matches that of other libraries, and if changed then it should be changed everywhere. - fn to_string(&self) -> String { - match (&self.version, &self.url) { - (Some(a), Some(b)) => format!("{}/{} ({})", &self.name, a, b), - (Some(a), None) => format!("{}/{}", &self.name, a), - (None, Some(b)) => format!("{} ({})", &self.name, b), - _ => self.name.to_string(), - } - } -} - -#[derive(Clone)] -pub struct Headers { - pub stripe_version: ApiVersion, - pub user_agent: String, - - pub client_id: Option, - pub stripe_account: Option, -} - -impl Headers { - pub fn to_array(&self) -> [(&str, Option<&str>); 4] { - [ - ("Client-Id", self.client_id.as_deref()), - ("Stripe-Account", self.stripe_account.as_deref()), - ("Stripe-Version", Some(self.stripe_version.as_str())), - ("User-Agent", Some(&self.user_agent)), - ] - } -} - -/// Implemented by types which represent stripe objects. -pub trait Object { - /// The canonical id type for this object. - type Id; - /// The id of the object. - fn id(&self) -> Self::Id; - /// The object's type, typically represented in wire format as the `object` property. - fn object(&self) -> &'static str; -} - -/// A deleted object. -#[derive(Clone, Debug, Deserialize, Serialize)] -pub struct Deleted { - /// Unique identifier for the object. - pub id: T, - /// Always true for a deleted object. - pub deleted: bool, -} - -/// The `Expand` struct is used to serialize `expand` arguments in retrieve and list apis. -#[doc(hidden)] -#[derive(Serialize)] -pub struct Expand<'a> { - #[serde(skip_serializing_if = "Expand::is_empty")] - pub expand: &'a [&'a str], -} - -impl Expand<'_> { - pub(crate) fn is_empty(expand: &[&str]) -> bool { - expand.is_empty() - } -} - -/// An id or object. -/// -/// By default stripe will return an id for most fields, but if more detail is -/// necessary the `expand` parameter can be provided to ask for the id to be -/// loaded as an object instead: -/// -/// ```rust,ignore -/// Charge::retrieve(&client, &charge_id, &["invoice.customer"]) -/// ``` -/// -/// For more details see . -#[derive(Clone, Debug, Serialize, Deserialize)] // TODO: Implement deserialize by hand for better error messages -#[serde(untagged)] -pub enum Expandable { - Id(T::Id), - Object(Box), -} - -impl Expandable -where - T: Object, - T::Id: Clone + Default, -{ - pub fn id(&self) -> T::Id { - match self { - Expandable::Id(id) => id.clone(), - Expandable::Object(obj) => obj.id(), - } - } -} - -impl Default for Expandable -where - T::Id: Default, -{ - fn default() -> Self { - Expandable::Id(Default::default()) - } -} - -impl Expandable { - pub fn is_object(&self) -> bool { - match self { - Expandable::Id(_) => false, - Expandable::Object(_) => true, - } - } - - pub fn as_object(&self) -> Option<&T> { - match self { - Expandable::Id(_) => None, - Expandable::Object(obj) => Some(obj), - } - } - - pub fn into_object(self) -> Option { - match self { - Expandable::Id(_) => None, - Expandable::Object(obj) => Some(*obj), - } - } -} - -/// Implemented by types which support cursor-based pagination, -/// typically with an id, allowing them to be fetched using a `List` -/// returned by the corresponding "list" api request. -pub trait Paginate { - type Cursor: AsCursor; - fn cursor(&self) -> Self::Cursor; -} - -pub trait AsCursor: AsRef {} - -impl<'a> AsCursor for &'a str {} -impl AsCursor for String {} - -impl Paginate for T -where - T: Object, - T::Id: AsCursor, -{ - type Cursor = T::Id; - fn cursor(&self) -> Self::Cursor { - self.id() - } -} - -pub trait Paginable { - type O: Object + Send; - fn set_last(&mut self, item: Self::O); -} - -pub trait PaginableList { - type O: Paginate + DeserializeOwned + Send + Sync + 'static + Clone + std::fmt::Debug; - fn new(data: Vec, url: String, has_more: bool, total_count: Option) -> Self; - fn get_data_mut(&mut self) -> &mut Vec; - fn get_data(&self) -> &Vec; - fn get_url(&self) -> String; - fn get_total_count(&self) -> Option; - fn has_more(&self) -> bool; -} - -/// A single page of a cursor-paginated list of a search object. -/// -/// For more details, see -#[derive(Debug, Clone, Deserialize, Serialize)] -pub struct SearchList { - pub object: String, - pub url: String, - pub has_more: bool, - pub data: Vec, - pub next_page: Option, - pub total_count: Option, -} - -impl Default for SearchList { - fn default() -> Self { - SearchList { - object: String::new(), - data: Vec::new(), - has_more: false, - total_count: None, - url: String::new(), - next_page: None, - } - } -} - -impl PaginableList - for SearchList -{ - type O = T; - - fn new( - data: Vec, - url: String, - has_more: bool, - total_count: Option, - ) -> SearchList { - Self { object: "".to_string(), url, has_more, data, next_page: None, total_count } - } - - fn get_data_mut(&mut self) -> &mut Vec { - &mut self.data - } - - fn get_data(&self) -> &Vec { - &self.data - } - fn get_url(&self) -> String { - self.url.clone() - } - fn get_total_count(&self) -> Option { - self.total_count - } - fn has_more(&self) -> bool { - self.has_more - } -} - -impl PaginableList - for List -{ - type O = T; - - fn new(data: Vec, url: String, has_more: bool, total_count: Option) -> List { - Self { url, has_more, data, total_count } - } - - fn get_data_mut(&mut self) -> &mut Vec { - &mut self.data - } - - fn get_data(&self) -> &Vec { - &self.data - } - - fn get_url(&self) -> String { - self.url.clone() - } - fn get_total_count(&self) -> Option { - self.total_count - } - fn has_more(&self) -> bool { - self.has_more - } -} - -impl SearchList { - pub fn paginate

(self, params: P) -> ListPaginator, P> { - ListPaginator { page: self, params } - } -} - -/// A single page of a cursor-paginated list of an object. -/// -/// For more details, see -#[derive(Debug, Clone, Deserialize, Serialize)] -pub struct List { - pub data: Vec, - pub has_more: bool, - pub total_count: Option, - pub url: String, -} - -impl Default for List { - fn default() -> Self { - List { data: Vec::new(), has_more: false, total_count: None, url: String::new() } - } -} - -impl List { - pub fn paginate

(self, params: P) -> ListPaginator, P> { - ListPaginator { page: self, params } - } -} - -#[derive(Debug)] -pub struct ListPaginator { - pub page: T, - pub params: P, -} - -impl< - T: PaginableList + Send + DeserializeOwned + 'static, - P: Clone + Serialize + Send + 'static + std::fmt::Debug, - > ListPaginator -where - P: Paginable, -{ - /// Repeatedly queries Stripe for more data until all elements in list are fetched, using - /// Stripe's default page size. - /// - /// Requires `feature = "blocking"`. - #[cfg(feature = "blocking")] - pub fn get_all(self, client: &Client) -> Response> { - let mut data = Vec::with_capacity(self.page.get_total_count().unwrap_or(0) as usize); - let mut paginator = self; - loop { - if !paginator.page.has_more() { - data.extend(paginator.page.get_data_mut().drain(..)); - break; - } - let next_paginator = paginator.next(client)?; - data.extend(paginator.page.get_data_mut().drain(..)); - paginator = next_paginator - } - Ok(data) - } - - /// Get all values in this List, consuming self and lazily paginating until all values are fetched. - /// - /// This function repeatedly queries Stripe for more data until all elements in list are fetched, using - /// the page size specified in params, or Stripe's default page size if none is specified. - /// - /// ```no_run - /// # use stripe::{Customer, ListCustomers, StripeError, Client}; - /// # use futures_util::TryStreamExt; - /// # async fn run() -> Result<(), StripeError> { - /// # let client = Client::new("sk_test_123"); - /// # let params = ListCustomers { ..Default::default() }; - /// - /// let list = Customer::list(&client, ¶ms).await.unwrap().paginate(params); - /// let mut stream = list.stream(&client); - /// - /// // take a value out from the stream - /// if let Some(val) = stream.try_next().await? { - /// println!("GOT = {:?}", val); - /// } - /// - /// // alternatively, you can use stream combinators - /// let all_values = stream.try_collect::>().await?; - /// - /// # Ok(()) - /// # } - /// ``` - /// - /// Requires `feature = ["async", "stream"]`. - #[cfg(all(feature = "async", feature = "stream"))] - pub fn stream( - mut self, - client: &Client, - ) -> impl futures_util::Stream> + Unpin { - // We are going to be popping items off the end of the list, so we need to reverse it. - self.page.get_data_mut().reverse(); - - Box::pin(futures_util::stream::unfold(Some((self, client.clone())), Self::unfold_stream)) - } - - /// unfold a single item from the stream - #[cfg(all(feature = "async", feature = "stream"))] - async fn unfold_stream( - state: Option<(Self, Client)>, - ) -> Option<(Result, Option<(Self, Client)>)> { - let (mut paginator, client) = state?; // If none, we sent the last item in the last iteration - - if paginator.page.get_data().len() > 1 { - return Some((Ok(paginator.page.get_data_mut().pop()?), Some((paginator, client)))); - // We have more data on this page - } - - if !paginator.page.has_more() { - return Some((Ok(paginator.page.get_data_mut().pop()?), None)); // Final value of the stream, no errors - } - - match paginator.next(&client).await { - Ok(mut next_paginator) => { - let data = paginator.page.get_data_mut().pop()?; - next_paginator.page.get_data_mut().reverse(); - - // Yield last value of thimuts page, the next page (and client) becomes the state - Some((Ok(data), Some((next_paginator, client)))) - } - Err(e) => Some((Err(e), None)), // We ran into an error. The last value of the stream will be the error. - } - } - - /// Fetch an additional page of data from stripe. - pub fn next(&self, client: &Client) -> Response { - if let Some(last) = self.page.get_data().last() { - if self.page.get_url().starts_with("/v1/") { - let path = self.page.get_url().trim_start_matches("/v1/").to_string(); // the url we get back is prefixed - - // clone the params and set the cursor - let params_next = { - let mut p = self.params.clone(); - p.set_last(last.clone()); - p - }; - - let page = client.get_query(&path, ¶ms_next); - - ListPaginator::create_paginator(page, params_next) - } else { - err(StripeError::UnsupportedVersion) - } - } else { - ok(ListPaginator { - page: T::new(Vec::new(), self.page.get_url(), false, self.page.get_total_count()), - params: self.params.clone(), - }) - } - } - - /// Pin a new future which maps the result inside the page future into - /// a ListPaginator - #[cfg(feature = "async")] - fn create_paginator(page: Response, params: P) -> Response { - use futures_util::FutureExt; - Box::pin(page.map(|page| page.map(|page| ListPaginator { page, params }))) - } - - #[cfg(feature = "blocking")] - fn create_paginator(page: Response, params: P) -> Response { - page.map(|page| ListPaginator { page, params }) - } -} - -pub type CurrencyMap = HashMap; -pub type Metadata = HashMap; -pub type Timestamp = i64; - -#[derive(Clone, Debug, Deserialize, Serialize)] -#[serde(rename_all = "lowercase")] -pub struct RangeBounds { - pub gt: Option, - pub gte: Option, - pub lt: Option, - pub lte: Option, -} - -impl Default for RangeBounds { - fn default() -> Self { - RangeBounds { gt: None, gte: None, lt: None, lte: None } - } -} - -/// A set of generic request parameters that can be used on -/// list endpoints to filter their results by some timestamp. -#[derive(Clone, Debug, Deserialize, Serialize)] -#[serde(untagged)] -pub enum RangeQuery { - Exact(T), - Bounds(RangeBounds), -} - -impl RangeQuery { - /// Filter results to exactly match a given value - pub fn eq(value: T) -> RangeQuery { - RangeQuery::Exact(value) - } - - /// Filter results to be after a given value - pub fn gt(value: T) -> RangeQuery { - RangeQuery::Bounds(RangeBounds { gt: Some(value), ..Default::default() }) - } - - /// Filter results to be after or equal to a given value - pub fn gte(value: T) -> RangeQuery { - RangeQuery::Bounds(RangeBounds { gte: Some(value), ..Default::default() }) - } - - /// Filter results to be before to a given value - pub fn lt(value: T) -> RangeQuery { - RangeQuery::Bounds(RangeBounds { lt: Some(value), ..Default::default() }) - } - - /// Filter results to be before or equal to a given value - pub fn lte(value: T) -> RangeQuery { - RangeQuery::Bounds(RangeBounds { lte: Some(value), ..Default::default() }) - } -} - -#[derive(Clone, Debug, Serialize)] -#[serde(untagged)] -pub enum IdOrCreate<'a, T> { - Id(&'a str), - Create(&'a T), -} - -// NOTE: Only intended to handle conversion from ASCII CamelCase to SnakeCase -// This function is used to convert static Rust identifiers to snakecase -// TODO: pub(crate) fn -pub fn to_snakecase(camel: &str) -> String { - let mut i = 0; - let mut snake = String::new(); - let mut chars = camel.chars().peekable(); - while let Some(ch) = chars.next() { - if ch.is_uppercase() { - if i > 0 && !chars.peek().unwrap_or(&'A').is_uppercase() { - snake.push('_'); - } - snake.push(ch.to_lowercase().next().unwrap_or(ch)); - } else { - snake.push(ch); - } - i += 1; - } - - snake -} - -#[cfg(test)] -mod tests { - #[test] - fn to_snakecase() { - use super::to_snakecase; - - assert_eq!(to_snakecase("snake_case").as_str(), "snake_case"); - assert_eq!(to_snakecase("CamelCase").as_str(), "camel_case"); - assert_eq!(to_snakecase("XMLHttpRequest").as_str(), "xml_http_request"); - assert_eq!(to_snakecase("UPPER").as_str(), "upper"); - assert_eq!(to_snakecase("lower").as_str(), "lower"); - } - - #[cfg(feature = "async")] - #[tokio::test] - async fn list() { - use httpmock::Method::GET; - use httpmock::MockServer; - - use crate::Client; - use crate::{Customer, ListCustomers}; - - // Start a lightweight mock server. - let server = MockServer::start_async().await; - - let client = Client::from_url(&*server.url("/"), "fake_key"); - - let next_item = server.mock(|when, then| { - when.method(GET).path("/v1/customers").query_param("starting_after", "cus_1"); - then.status(200).body( - r#"{"object": "list", "data": [{ - "id": "cus_2", - "object": "customer", - "balance": 0, - "created": 1649316731, - "currency": "gbp", - "delinquent": false, - "email": null, - "invoice_prefix": "4AF7482", - "invoice_settings": {}, - "livemode": false, - "metadata": {}, - "preferred_locales": [], - "tax_exempt": "none" - }], "has_more": false, "url": "/v1/customers"}"#, - ); - }); - - let first_item = server.mock(|when, then| { - when.method(GET).path("/v1/customers"); - then.status(200).body( - r#"{"object": "list", "data": [{ - "id": "cus_1", - "object": "customer", - "balance": 0, - "created": 1649316731, - "currency": "gbp", - "delinquent": false, - "invoice_prefix": "4AF7482", - "invoice_settings": {}, - "livemode": false, - "metadata": {}, - "preferred_locales": [], - "tax_exempt": "none" - }], "has_more": true, "url": "/v1/customers"}"#, - ); - }); - - let params = ListCustomers::new(); - let res = Customer::list(&client, ¶ms).await.unwrap().paginate(params); - - println!("{:?}", res); - - let res2 = res.next(&client).await.unwrap(); - - println!("{:?}", res2); - - first_item.assert_hits_async(1).await; - next_item.assert_hits_async(1).await; - } - - #[cfg(feature = "blocking")] - #[test] - fn get_all() { - use httpmock::Method::GET; - use httpmock::MockServer; - - use crate::Client; - use crate::{Customer, ListCustomers}; - - // Start a lightweight mock server. - let server = MockServer::start(); - - let client = Client::from_url(&*server.url("/"), "fake_key"); - - let next_item = server.mock(|when, then| { - when.method(GET).path("/v1/customers").query_param("starting_after", "cus_2"); - then.status(200).body( - r#"{"object": "list", "data": [{ - "id": "cus_2", - "object": "customer", - "balance": 0, - "created": 1649316733, - "currency": "gbp", - "delinquent": false, - "email": null, - "invoice_prefix": "4AF7482", - "invoice_settings": {}, - "livemode": false, - "metadata": {}, - "preferred_locales": [], - "tax_exempt": "none" - }], "has_more": false, "url": "/v1/customers"}"#, - ); - }); - - let first_item = server.mock(|when, then| { - when.method(GET).path("/v1/customers"); - then.status(200).body( - r#"{"object": "list", "data": [{ - "id": "cus_1", - "object": "customer", - "balance": 0, - "created": 1649316732, - "currency": "gbp", - "delinquent": false, - "invoice_prefix": "4AF7482", - "invoice_settings": {}, - "livemode": false, - "metadata": {}, - "preferred_locales": [], - "tax_exempt": "none" - }, { - "id": "cus_2", - "object": "customer", - "balance": 0, - "created": 1649316733, - "currency": "gbp", - "delinquent": false, - "invoice_prefix": "4AF7482", - "invoice_settings": {}, - "livemode": false, - "metadata": {}, - "preferred_locales": [], - "tax_exempt": "none" - }], "has_more": true, "url": "/v1/customers"}"#, - ); - }); - - let params = ListCustomers::new(); - let res = Customer::list(&client, ¶ms).unwrap().paginate(params); - - let customers = res.get_all(&client).unwrap(); - - println!("{:?}", customers); - - assert_eq!(customers.len(), 3); - first_item.assert_hits(1); - next_item.assert_hits(1); - } - - #[cfg(feature = "async")] - #[tokio::test] - async fn list_multiple() { - use httpmock::Method::GET; - use httpmock::MockServer; - - use crate::Client; - use crate::{Customer, ListCustomers}; - - // Start a lightweight mock server. - let server = MockServer::start_async().await; - - let client = Client::from_url(&*server.url("/"), "fake_key"); - - let next_item = server.mock(|when, then| { - when.method(GET).path("/v1/customers").query_param("starting_after", "cus_2"); - then.status(200).body( - r#"{"object": "list", "data": [{ - "id": "cus_2", - "object": "customer", - "balance": 0, - "created": 1649316733, - "currency": "gbp", - "delinquent": false, - "email": null, - "invoice_prefix": "4AF7482", - "invoice_settings": {}, - "livemode": false, - "metadata": {}, - "preferred_locales": [], - "tax_exempt": "none" - }], "has_more": false, "url": "/v1/customers"}"#, - ); - }); - - let first_item = server.mock(|when, then| { - when.method(GET).path("/v1/customers"); - then.status(200).body( - r#"{"object": "list", "data": [{ - "id": "cus_1", - "object": "customer", - "balance": 0, - "created": 1649316732, - "currency": "gbp", - "delinquent": false, - "invoice_prefix": "4AF7482", - "invoice_settings": {}, - "livemode": false, - "metadata": {}, - "preferred_locales": [], - "tax_exempt": "none" - }, { - "id": "cus_2", - "object": "customer", - "balance": 0, - "created": 1649316733, - "currency": "gbp", - "delinquent": false, - "invoice_prefix": "4AF7482", - "invoice_settings": {}, - "livemode": false, - "metadata": {}, - "preferred_locales": [], - "tax_exempt": "none" - }], "has_more": true, "url": "/v1/customers"}"#, - ); - }); - - let params = ListCustomers::new(); - let res = Customer::list(&client, ¶ms).await.unwrap().paginate(params); - - let res2 = res.next(&client).await.unwrap(); - - println!("{:?}", res2); - - first_item.assert_hits_async(1).await; - next_item.assert_hits_async(1).await; - } - - #[cfg(all(feature = "async", feature = "stream"))] - #[tokio::test] - async fn stream() { - use futures_util::StreamExt; - use httpmock::Method::GET; - use httpmock::MockServer; - - use crate::Client; - use crate::{Customer, ListCustomers}; - - // Start a lightweight mock server. - let server = MockServer::start_async().await; - - let client = Client::from_url(&*server.url("/"), "fake_key"); - - let next_item = server.mock(|when, then| { - when.method(GET).path("/v1/customers").query_param("starting_after", "cus_1"); - then.status(200).body( - r#"{"object": "list", "data": [{ - "id": "cus_2", - "object": "customer", - "balance": 0, - "created": 1649316731, - "currency": "gbp", - "delinquent": false, - "email": null, - "invoice_prefix": "4AF7482", - "invoice_settings": {}, - "livemode": false, - "metadata": {}, - "preferred_locales": [], - "tax_exempt": "none" - }], "has_more": false, "url": "/v1/customers"}"#, - ); - }); - - let first_item = server.mock(|when, then| { - when.method(GET).path("/v1/customers"); - then.status(200).body( - r#"{"object": "list", "data": [{ - "id": "cus_1", - "object": "customer", - "balance": 0, - "created": 1649316731, - "currency": "gbp", - "delinquent": false, - "invoice_prefix": "4AF7482", - "invoice_settings": {}, - "livemode": false, - "metadata": {}, - "preferred_locales": [], - "tax_exempt": "none" - }], "has_more": true, "url": "/v1/customers"}"#, - ); - }); - - let params = ListCustomers::new(); - let res = Customer::list(&client, ¶ms).await.unwrap().paginate(params); - - let stream = res.stream(&client).collect::>().await; - - println!("{:#?}", stream); - assert_eq!(stream.len(), 2); - - first_item.assert_hits_async(1).await; - next_item.assert_hits_async(1).await; - } - - #[cfg(all(feature = "async", feature = "stream"))] - #[tokio::test] - async fn stream_multiple() { - use futures_util::StreamExt; - use httpmock::Method::GET; - use httpmock::MockServer; - - use crate::Client; - use crate::{Customer, ListCustomers}; - - // Start a lightweight mock server. - let server = MockServer::start_async().await; - - let client = Client::from_url(&*server.url("/"), "fake_key"); - - let next_item = server.mock(|when, then| { - when.method(GET).path("/v1/customers").query_param("starting_after", "cus_2"); - then.status(200).body( - r#"{"object": "list", "data": [{ - "id": "cus_3", - "object": "customer", - "balance": 0, - "created": 1649316734, - "currency": "gbp", - "delinquent": false, - "email": null, - "invoice_prefix": "4AF7482", - "invoice_settings": {}, - "livemode": false, - "metadata": {}, - "preferred_locales": [], - "tax_exempt": "none" - }], "has_more": false, "url": "/v1/customers"}"#, - ); - }); - - let items = server.mock(|when, then| { - when.method(GET).path("/v1/customers"); - then.status(200).body( - r#"{"object": "list", "data": [{ - "id": "cus_1", - "object": "customer", - "balance": 0, - "created": 1649316732, - "currency": "gbp", - "delinquent": false, - "invoice_prefix": "4AF7482", - "invoice_settings": {}, - "livemode": false, - "metadata": {}, - "preferred_locales": [], - "tax_exempt": "none" - }, { - "id": "cus_2", - "object": "customer", - "balance": 0, - "created": 1649316733, - "currency": "gbp", - "delinquent": false, - "invoice_prefix": "4AF7482", - "invoice_settings": {}, - "livemode": false, - "metadata": {}, - "preferred_locales": [], - "tax_exempt": "none" - }], "has_more": true, "url": "/v1/customers"}"#, - ); - }); - - let params = ListCustomers::default(); - let res = Customer::list(&client, ¶ms).await.unwrap().paginate(params); - - let stream = res.stream(&client).collect::>().await; - - println!("{:#?}", stream.len()); - assert_eq!(stream.len(), 3); - - items.assert_hits_async(1).await; - next_item.assert_hits_async(1).await; - } -} diff --git a/src/resources.rs b/src/resources.rs deleted file mode 100644 index 42ced2ae0..000000000 --- a/src/resources.rs +++ /dev/null @@ -1,369 +0,0 @@ -//! resources module -//! -//! This module exposes various elements of the -//! stripe api depending on the features exposed. -//! -//! Some of these modules are hand-written, and -//! some are generated. - -mod currency; -pub mod generated; -mod placeholders; -mod types; - -#[path = "resources"] -mod core { - pub mod account_ext; - pub mod balance_ext; - pub mod balance_transaction_ext; - pub mod charge_ext; - pub mod customer_ext; - pub mod payment_intent_ext; - pub mod payment_source; - pub mod payout_ext; - pub mod placeholders; - pub mod setup_intent_ext; - pub mod token_ext; - pub mod transfer_reversal_ext; -} - -#[path = "resources"] -mod payment { - pub mod bank_account_ext; - pub mod card; - pub mod payment_method_ext; - pub mod source_ext; -} - -#[cfg(feature = "events")] -mod webhook_events; - -#[path = "resources"] -#[cfg(feature = "billing")] -mod billing { - pub mod credit_note_ext; - pub mod customer_balance_transaction_ext; - pub mod invoice_ext; - pub mod line_item_ext; - pub mod subscription_ext; - pub mod usage_record_ext; -} - -#[path = "resources"] -#[cfg(feature = "products")] -mod products { - pub mod price_ext; - pub mod product_ext; -} - -#[path = "resources"] -#[cfg(feature = "checkout")] -mod checkout { - pub mod checkout_session_ext; -} - -#[path = "resources"] -#[cfg(feature = "connect")] -mod connect { - pub mod login_links_ext; -} - -#[path = "resources"] -#[cfg(feature = "fraud")] -mod fraud { - pub mod review_ext; -} - -#[path = "resources"] -#[cfg(feature = "issuing")] -mod issuing { - pub mod issuing_authorization_ext; - pub mod issuing_card_ext; - pub mod issuing_dispute_ext; - pub mod issuing_merchant_data; - pub mod issuing_transaction_ext; -} - -#[path = "resources"] -#[cfg(feature = "orders")] -mod orders { - pub mod order_ext; -} - -#[path = "resources"] -#[cfg(feature = "webhook-endpoints")] -mod webhook_endpoints { - pub mod webhook_endpoint_ext; -} - -#[rustfmt::skip] -pub use { - currency::*, - types::*, - - self::core::{ - account_ext::*, - balance_transaction_ext::*, - charge_ext::*, - transfer_reversal_ext::*, - customer_ext::*, - payment_intent_ext::*, - payment_source::*, - placeholders::*, - payout_ext::*, - token_ext::*, - setup_intent_ext::*, - }, - generated::core::{ - address::*, - balance::*, - balance_amount_by_source_type::*, - balance_transaction::*, - billing_details::*, - charge::*, - connect_account_reference::*, - customer::*, - custom_unit_amount::*, - cash_balance::*, - dispute::*, - ephemeral_key::*, - file::*, - file_link::*, - invoice_setting_rendering_options::*, - mandate::*, - payment_intent::*, - payment_intent_next_action_cashapp_handle_redirect_or_display_qr_code::*, - linked_account_options_us_bank_account::*, - payment_method_details_card_wallet_apple_pay::*, - payment_method_details_card_wallet_google_pay::*, - payment_method_options_customer_balance_eu_bank_account::*, - payment_method_options_us_bank_account_mandate_options::*, - payment_method_config_biz_payment_method_configuration_details::*, - payout::*, - platform_tax_fee::*, - price::*, - product::*, - radar_radar_options::*, - refund::*, - reserve_transaction::*, - setup_attempt::*, - setup_intent::*, - shipping::*, - shipping_rate::*, - tax_code::*, - tax_deducted_at_source::*, - test_helpers_test_clock::*, - token::*, - api_errors::*, - }, - - payment::{ - bank_account_ext::*, - card::*, - payment_method_ext::*, - source_ext::* - }, - generated::payment::{ - card::*, - bank_account::*, - payment_method::*, - payment_method_card_present_networks::*, - source::*, - }, -}; - -#[rustfmt::skip] -#[cfg(feature = "events")] -pub use { - webhook_events::*, - webhook_events::NotificationEventData, - generated::event::*, -}; - -#[rustfmt::skip] -#[cfg(feature = "checkout")] -pub use { - checkout::checkout_session_ext::*, - generated::checkout::{ - checkout_session::*, - payment_link::*, - item::* - }, -}; - -#[rustfmt::skip] -#[cfg(feature = "products")] -pub use { - products::{ - product_ext::*, - price_ext::*, - } -}; - -#[rustfmt::skip] -#[cfg(feature = "billing")] -pub use { - billing::{ - customer_balance_transaction_ext::*, - invoice_ext::*, - line_item_ext::*, - subscription_ext::*, - usage_record_ext::*, - }, - generated::billing::{ - billing_portal_session::*, - billing_portal_configuration::*, - coupon::*, - credit_note::*, - credit_note_line_item::*, - customer_balance_transaction::*, - discount::*, - invoice::*, - invoice_payment_method_options_acss_debit::*, - invoice_payment_method_options_bancontact::*, - invoice_payment_method_options_konbini::*, - invoice_payment_method_options_customer_balance::*, - invoice_payment_method_options_us_bank_account::*, - invoiceitem::*, - invoices_shipping_cost::*, - line_item::*, - plan::*, - plan::PlanInterval, - promotion_code::*, - quote::*, - quotes_resource_total_details::*, - subscription_item::*, - subscription_item::PlanInterval as SubscriptionItemInterval, - subscription_item::SubscriptionItemPriceDataRecurring as SubscriptionItemPriceDataRecurring, - subscription_item::SubscriptionItemPriceData as SubscriptionItemPriceData, - subscription_item::SubscriptionPaymentBehavior as SubscriptionItemPaymentBehavior, - // need to import this afterwards so that the SubscriptionItemPriceDataRecurring - // isn't silently ignored - subscription::*, - subscriptions_trials_resource_trial_settings::*, - subscription::PlanInterval as SubscriptionInterval, - subscription::SubscriptionItemPriceDataRecurring as SubscriptionPriceDataRecurring, - subscription::SubscriptionItemPriceData as SubscriptionPriceData, - subscription::SubscriptionPaymentBehavior as SubscriptionPaymentBehavior, - subscription_schedule::*, - subscription_billing_thresholds::*, - subscription_item_billing_thresholds::*, - tax_id::*, - tax_rate::*, - usage_record::*, - usage_record_summary::*, - }, -}; - -#[rustfmt::skip] -#[cfg(feature = "tax-calculation")] -pub use { - generated::tax_calculation::{ - tax_calculation::*, - tax_calculation_line_item::*, - tax_product_resource_customer_details::*, - } -}; - -#[rustfmt::skip] -#[cfg(feature = "connect")] -pub use { - connect::{ - login_links_ext::*, - }, - generated::connect::{ - account_link::*, - account::*, - application::*, - application_fee::*, - connect_collection_transfer::*, - fee_refund::*, - login_link::*, - person::*, - topup::*, - transfer::*, - transfer_reversal::*, - } -}; - -#[rustfmt::skip] -#[cfg(feature = "fraud")] -pub use { - fraud::review_ext::*, - generated::fraud::review::* -}; - -#[rustfmt::skip] -#[cfg(feature = "issuing")] -pub use { - issuing::{ - issuing_authorization_ext::*, - issuing_card_ext::*, - issuing_dispute_ext::*, - issuing_merchant_data::*, - issuing_transaction_ext::*, - }, - generated::issuing::{ - issuing_authorization::*, - issuing_card::*, - issuing_token::*, - issuing_cardholder::*, - issuing_dispute::*, - issuing_transaction::*, - }, -}; - -#[rustfmt::skip] -#[cfg(feature = "orders")] -pub use { - orders::order_ext::*, -}; - -#[rustfmt::skip] -#[cfg(feature = "sigma")] -pub use { - generated::scheduled_query_run::*, -}; - -#[rustfmt::skip] -#[cfg(feature = "terminal")] -pub use { - generated::terminal::{ - terminal_configuration::*, - terminal_connection_token::*, - terminal_location::*, - terminal_reader::*, - }, -}; - -#[rustfmt::skip] -#[cfg(feature = "webhook-endpoints")] -pub use { - webhook_endpoints::webhook_endpoint_ext::*, - generated::webhook_endpoints::webhook_endpoint::*, -}; - -#[cfg(not(feature = "full"))] -pub use generated::placeholders::*; - -/// this struct is just a stub for code not using the "connect" feature -/// see https://github.com/arlyon/async-stripe/issues/49 for more context -/// if there are more features that requires a fully fledged CompanyParams -/// we probably need to update the code generation and move to a shared place -#[cfg(not(feature = "connect"))] -#[derive(Clone, Debug, serde::Deserialize, serde::Serialize)] -pub struct CompanyParams { - #[serde(default)] - pub metadata: crate::params::Metadata, -} - -/// this struct is just a stub for code not using the "connect" feature -/// see https://github.com/arlyon/async-stripe/issues/49 for more context -/// if there are more features that requires a fully fledged PersonParams -/// we probably need to update the code generation and move to a shared place -#[cfg(not(feature = "connect"))] -#[derive(Clone, Debug, serde::Deserialize, serde::Serialize)] -pub struct PersonParams { - #[serde(default)] - pub metadata: crate::params::Metadata, -} diff --git a/src/resources/account_ext.rs b/src/resources/account_ext.rs deleted file mode 100644 index 24ccfe3ee..000000000 --- a/src/resources/account_ext.rs +++ /dev/null @@ -1,15 +0,0 @@ -use serde::{Deserialize, Serialize}; - -use crate::resources::{BankAccount, Card}; - -#[derive(Clone, Debug, Deserialize, Serialize)] -#[serde(untagged, rename_all = "snake_case")] -pub enum ExternalAccount { - BankAccount(BankAccount), - Card(Card), -} -impl std::default::Default for ExternalAccount { - fn default() -> Self { - Self::BankAccount(Default::default()) - } -} diff --git a/src/resources/balance_ext.rs b/src/resources/balance_ext.rs deleted file mode 100644 index 28345fc4e..000000000 --- a/src/resources/balance_ext.rs +++ /dev/null @@ -1,15 +0,0 @@ -use crate::client::{Client, Response}; -use crate::ids::AccountId; -use crate::resources::Balance; - -impl Balance { - /// Retrieves balance object by AccountId. Does not change stripe_account of the client. - /// - /// For more details see . - pub fn retrieve(client: &Client, account_id: Option) -> Response { - match account_id { - Some(account_id) => client.clone().with_stripe_account(account_id).get("/balance"), - None => client.get("/balance"), - } - } -} diff --git a/src/resources/balance_transaction_ext.rs b/src/resources/balance_transaction_ext.rs deleted file mode 100644 index 31450aef2..000000000 --- a/src/resources/balance_transaction_ext.rs +++ /dev/null @@ -1,159 +0,0 @@ -use serde::{Deserialize, Serialize}; - -use crate::ids::BalanceTransactionSourceId; -use crate::params::Object; -use crate::resources::{ - ApplicationFee, ApplicationFeeRefund, Charge, ConnectCollectionTransfer, Dispute, - IssuingAuthorization, IssuingDispute, IssuingTransaction, Payout, PlatformTaxFee, Refund, - ReserveTransaction, TaxDeductedAtSource, Topup, Transfer, TransferReversal, -}; - -#[derive(Clone, Debug, Deserialize, Serialize)] -#[serde(untagged, rename_all = "snake_case")] -pub enum BalanceTransactionSourceUnion { - ApplicationFee(ApplicationFee), - Charge(Charge), - ConnectCollectionTransfer(ConnectCollectionTransfer), - Dispute(Dispute), - #[serde(rename = "fee_refund")] - ApplicationFeeRefund(ApplicationFeeRefund), - #[serde(rename = "issuing.authorization")] - IssuingAuthorization(IssuingAuthorization), - #[serde(rename = "issuing.dispute")] - IssuingDispute(IssuingDispute), - #[serde(rename = "issuing.transaction")] - IssuingTransaction(IssuingTransaction), - Payout(Payout), - PlatformTaxFee(PlatformTaxFee), - Refund(Refund), - ReserveTransaction(ReserveTransaction), - TaxDeductedAtSource(TaxDeductedAtSource), - Topup(Topup), - Transfer(Transfer), - TransferReversal(TransferReversal), -} -impl std::default::Default for BalanceTransactionSourceUnion { - fn default() -> Self { - Self::ApplicationFee(Default::default()) - } -} -impl Object for BalanceTransactionSourceUnion { - type Id = BalanceTransactionSourceId; - fn id(&self) -> Self::Id { - use BalanceTransactionSourceId as Id; - use BalanceTransactionSourceUnion as Source; - - match self { - Source::ApplicationFee(x) => Id::ApplicationFee(x.id()), - Source::ApplicationFeeRefund(x) => Id::ApplicationFeeRefund(x.id()), - Source::Charge(x) => Id::Charge(x.id()), - Source::ConnectCollectionTransfer(_) => Id::None, - Source::Dispute(x) => Id::Dispute(x.id()), - Source::IssuingAuthorization(x) => Id::IssuingAuthorization(x.id()), - Source::IssuingDispute(x) => Id::IssuingDispute(x.id()), - Source::IssuingTransaction(x) => Id::IssuingTransaction(x.id()), - Source::PlatformTaxFee(_) => Id::None, - Source::Payout(x) => Id::Payout(x.id()), - Source::Refund(x) => Id::Refund(x.id()), - Source::ReserveTransaction(_) => Id::None, - Source::TaxDeductedAtSource(_) => Id::None, - Source::Topup(x) => Id::Topup(x.id()), - Source::Transfer(x) => Id::Transfer(x.id()), - Source::TransferReversal(x) => Id::TransferReversal(x.id()), - } - } - fn object(&self) -> &'static str { - use BalanceTransactionSourceUnion as Source; - - match self { - Source::ApplicationFee(x) => x.object(), - Source::ApplicationFeeRefund(x) => x.object(), - Source::Charge(x) => x.object(), - Source::ConnectCollectionTransfer(x) => x.object(), - Source::Dispute(x) => x.object(), - Source::IssuingAuthorization(x) => x.object(), - Source::IssuingDispute(x) => x.object(), - Source::IssuingTransaction(x) => x.object(), - Source::PlatformTaxFee(x) => x.object(), - Source::Payout(x) => x.object(), - Source::Refund(x) => x.object(), - Source::ReserveTransaction(x) => x.object(), - Source::TaxDeductedAtSource(x) => x.object(), - Source::Topup(x) => x.object(), - Source::Transfer(x) => x.object(), - Source::TransferReversal(x) => x.object(), - } - } -} - -/// An enum representing the possible values of an `BalanceTransaction`'s `status` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum BalanceTransactionStatus { - Available, - Pending, -} - -impl BalanceTransactionStatus { - pub fn as_str(self) -> &'static str { - match self { - BalanceTransactionStatus::Available => "available", - BalanceTransactionStatus::Pending => "pending", - } - } -} - -impl AsRef for BalanceTransactionStatus { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for BalanceTransactionStatus { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} - -impl std::default::Default for BalanceTransactionStatus { - fn default() -> Self { - Self::Pending - } -} - -/// An enum representing the possible values of an `Fee`'s `type` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum FeeType { - ApplicationFee, - StripeFee, - Tax, -} - -impl FeeType { - pub fn as_str(self) -> &'static str { - match self { - FeeType::ApplicationFee => "application_fee", - FeeType::StripeFee => "stripe_fee", - FeeType::Tax => "tax", - } - } -} - -impl AsRef for FeeType { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for FeeType { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} - -impl std::default::Default for FeeType { - fn default() -> Self { - FeeType::ApplicationFee - } -} diff --git a/src/resources/bank_account_ext.rs b/src/resources/bank_account_ext.rs deleted file mode 100644 index 0da15346d..000000000 --- a/src/resources/bank_account_ext.rs +++ /dev/null @@ -1,36 +0,0 @@ -use serde::{Deserialize, Serialize}; - -/// An enum representing the possible values of an `BankAccount`'s `status` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum BankAccountStatus { - Errored, - New, - Validated, - VerificationFailed, - Verified, -} - -impl BankAccountStatus { - pub fn as_str(self) -> &'static str { - match self { - BankAccountStatus::Errored => "errored", - BankAccountStatus::New => "new", - BankAccountStatus::Validated => "validated", - BankAccountStatus::VerificationFailed => "verification_failed", - BankAccountStatus::Verified => "verified", - } - } -} - -impl AsRef for BankAccountStatus { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for BankAccountStatus { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} diff --git a/src/resources/card.rs b/src/resources/card.rs deleted file mode 100644 index f8f40a652..000000000 --- a/src/resources/card.rs +++ /dev/null @@ -1,55 +0,0 @@ -use serde::{Deserialize, Serialize}; - -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -pub enum CardBrand { - #[serde(rename = "American Express")] - AmericanExpress, - #[serde(rename = "Diners Club")] - DinersClub, - #[serde(rename = "Discover")] - Discover, - #[serde(rename = "JCB")] - JCB, - #[serde(rename = "Visa")] - Visa, - #[serde(rename = "MasterCard")] - MasterCard, - #[serde(rename = "UnionPay")] - UnionPay, - - /// An unknown card brand. - /// - /// May also be a variant not yet supported by the library. - #[serde(other)] - #[serde(rename = "Unknown")] - Unknown, -} - -impl std::default::Default for CardBrand { - fn default() -> Self { - Self::Unknown - } -} - -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -pub enum CardType { - #[serde(rename = "credit")] - Credit, - #[serde(rename = "debit")] - Debit, - #[serde(rename = "prepaid")] - Prepaid, - - /// An unknown card type. - /// - /// May also be a variant not yet supported by the library. - #[serde(other)] - #[serde(rename = "unknown")] - Unknown, -} - -impl std::default::Default for CardType { - fn default() -> Self { - Self::Unknown - } -} diff --git a/src/resources/charge_ext.rs b/src/resources/charge_ext.rs deleted file mode 100644 index f6669b46c..000000000 --- a/src/resources/charge_ext.rs +++ /dev/null @@ -1,80 +0,0 @@ -use serde::{Deserialize, Serialize}; - -use crate::client::{Client, Response}; -use crate::ids::{AccountId, BankAccountId, CardId, ChargeId, SourceId, TokenId}; -use crate::params::{Object, SearchList}; -use crate::resources::{Charge, Rule}; - -/// The set of PaymentSource parameters that can be used to create a charge. -/// -/// For more details see . -#[derive(Clone, Debug, Deserialize, Serialize)] -#[serde(untagged)] -pub enum ChargeSourceParams { - Token(TokenId), - Source(SourceId), - Card(CardId), - BankAccount(BankAccountId), - Account(AccountId), -} - -/// The set of parameters that can be used when capturing a charge object. -/// -/// For more details see . -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CaptureCharge<'a> { - #[serde(skip_serializing_if = "Option::is_none")] - pub amount: Option, - #[serde(skip_serializing_if = "Option::is_none")] - pub application_fee: Option, - #[serde(skip_serializing_if = "Option::is_none")] - pub receipt_email: Option<&'a str>, - #[serde(skip_serializing_if = "Option::is_none")] - pub statement_descriptor: Option<&'a str>, -} - -impl Charge { - /// Capture captures a previously created charge with capture set to false. - /// - /// For more details see . - pub fn capture( - client: &Client, - charge_id: &ChargeId, - params: CaptureCharge<'_>, - ) -> Response { - client.post_form(&format!("/charges/{}/capture", charge_id), params) - } - - /// Searches for a charge. - /// - /// For more details see . - pub fn search(client: &Client, params: ChargeSearchParams) -> Response> { - client.get_query("/charges/search", params) - } -} - -impl Object for Rule { - type Id = String; - fn id(&self) -> Self::Id { - self.id.clone() - } - fn object(&self) -> &'static str { - "" - } -} - -#[derive(Clone, Debug, Default, Serialize)] -pub struct ChargeSearchParams<'a> { - pub query: String, - #[serde(skip_serializing_if = "Option::is_none")] - pub limit: Option, - #[serde(skip_serializing_if = "Option::is_none")] - pub page: Option, - pub expand: &'a [&'a str], -} - -impl<'a> ChargeSearchParams<'a> { - pub fn new() -> ChargeSearchParams<'a> { - ChargeSearchParams { query: String::new(), limit: None, page: None, expand: &[] } - } -} diff --git a/src/resources/checkout_session_ext.rs b/src/resources/checkout_session_ext.rs deleted file mode 100644 index 9d6d00e78..000000000 --- a/src/resources/checkout_session_ext.rs +++ /dev/null @@ -1,24 +0,0 @@ -use crate::client::{Client, Response}; -use crate::ids::CheckoutSessionId; -use crate::params::Expand; -use crate::resources::CheckoutSession; - -impl CheckoutSession { - /// Retrieves a Session object. - /// - /// For more details see . - pub fn retrieve( - client: &Client, - id: &CheckoutSessionId, - expand: &[&str], - ) -> Response { - client.get_query(&format!("/checkout/sessions/{}", id), &Expand { expand }) - } - - /// Expires a checkout session. - /// - /// For more details see . - pub fn expire(client: &Client, id: &CheckoutSessionId) -> Response { - client.post(&format!("/checkout/sessions/{}/expire", id)) - } -} diff --git a/src/resources/credit_note_ext.rs b/src/resources/credit_note_ext.rs deleted file mode 100644 index 48c85d573..000000000 --- a/src/resources/credit_note_ext.rs +++ /dev/null @@ -1,12 +0,0 @@ -use crate::client::{Client, Response}; -use crate::ids::CreditNoteId; -use crate::resources::CreditNote; - -impl CreditNote { - /// Marks a credit note as void. - /// - /// You can only void a credit note if the associated invoice is open. - pub fn void(client: &Client, id: &CreditNoteId) -> Response { - client.post(&format!("/credit_notes/{}/void", id)) - } -} diff --git a/src/resources/customer_balance_transaction_ext.rs b/src/resources/customer_balance_transaction_ext.rs deleted file mode 100644 index 0b5a4875a..000000000 --- a/src/resources/customer_balance_transaction_ext.rs +++ /dev/null @@ -1,137 +0,0 @@ -use serde::Serialize; - -use crate::client::{Client, Response}; -use crate::ids::{CustomerBalanceTransactionId, CustomerId}; -use crate::params::{Expand, List, Metadata, Paginable}; -use crate::resources::{Currency, Customer, CustomerBalanceTransaction}; - -/// The parameters for `CustomerBalanceTransaction::list`. -#[derive(Clone, Debug, Serialize, Default)] -pub struct ListCustomerBalanceTransactions<'a> { - /// Specifies which fields in the response should be expanded. - #[serde(skip_serializing_if = "Expand::is_empty")] - pub expand: &'a [&'a str], - - /// A cursor for use in pagination. - /// - /// `ending_before` is an object ID that defines your place in the list. - /// For instance, if you make a list request and receive 100 objects, - /// starting with `obj_bar`, your subsequent call can include - /// `ending_before=obj_bar` in order to fetch the previous page of the list. - #[serde(skip_serializing_if = "Option::is_none")] - pub ending_before: Option, - - /// A limit on the number of objects to be returned. - /// - /// Limit can range between 1 and 100, and the default is 10. - #[serde(skip_serializing_if = "Option::is_none")] - pub limit: Option, - - /// A cursor for use in pagination. - /// - /// `starting_after` is an object ID that defines your place in the list. - /// For instance, if you make a list request and receive 100 objects, - /// ending with `obj_foo`, your subsequent call can include - /// `starting_after=obj_foo` in order to fetch the next page of the list. - #[serde(skip_serializing_if = "Option::is_none")] - pub starting_after: Option, -} - -impl Paginable for ListCustomerBalanceTransactions<'_> { - type O = CustomerBalanceTransaction; - fn set_last(&mut self, item: Self::O) { - self.starting_after = Some(item.id); - } -} - -/// The parameters that can be used when creating or updating a [`CustomerBalanceTransaction`]. -#[derive(Clone, Debug, Serialize)] -pub struct CreateCustomerBalanceTransaction<'a> { - /// The integer amount in cents to apply to the customer’s credit balance. - pub amount: i64, - /// Three-letter ISO currency code, in lowercase. - /// - /// Must be a supported currency. Specifies the invoice_credit_balance that this - /// transaction will apply to. If the customer’s currency is not set, it will be - /// updated to this value. - pub currency: Currency, - /// An arbitrary string attached to the object. Often useful for displaying to users. - #[serde(skip_serializing_if = "Option::is_none")] - pub description: Option<&'a str>, - /// Set of key-value pairs that you can attach to an object. - /// - /// This can be useful for storing additional information about the object in a - /// structured format. Individual keys can be unset by posting an empty value to - /// them. All keys can be unset by posting an empty value to metadata. - #[serde(skip_serializing_if = "Option::is_none")] - pub metadata: Option, -} - -impl CreateCustomerBalanceTransaction<'_> { - pub fn new(amount: i64, currency: Currency) -> Self { - Self { amount, currency, description: Default::default(), metadata: Default::default() } - } -} - -/// The parameters that can be used when creating or updating a [`CustomerBalanceTransaction`]. -/// -/// Only the description and metadata fields can be updated. -#[derive(Clone, Debug, Default, Serialize)] -pub struct UpdateCustomerBalanceTransaction<'a> { - /// An arbitrary string attached to the object. Often useful for displaying to users. - #[serde(skip_serializing_if = "Option::is_none")] - pub description: Option<&'a str>, - /// Set of key-value pairs that you can attach to an object. - /// - /// This can be useful for storing additional information about the object in a - /// structured format. Individual keys can be unset by posting an empty value to - /// them. All keys can be unset by posting an empty value to metadata. - #[serde(skip_serializing_if = "Option::is_none")] - pub metadata: Option, -} - -impl Customer { - /// List all of a customer's balance transactions. - pub fn list_balance_transactions( - client: &Client, - customer_id: &CustomerId, - params: ListCustomerBalanceTransactions<'_>, - ) -> Response> { - client.get_query(&format!("/customers/{}/balance_transactions", customer_id), ¶ms) - } - - /// Create a new customer balance transaction. - pub fn create_balance_transaction( - client: &Client, - customer_id: &CustomerId, - params: CreateCustomerBalanceTransaction<'_>, - ) -> Response { - client.post_form(&format!("/customers/{}/balance_transactions", customer_id), ¶ms) - } - - /// Retrieve a customer balance transaction. - pub fn retrieve_balance_transaction( - client: &Client, - customer_id: &CustomerId, - id: &CustomerBalanceTransactionId, - expand: &[&str], - ) -> Response { - client.get_query( - &format!("/customers/{}/balance_transactions/{}", customer_id, id), - &Expand { expand }, - ) - } - - /// Update a customer balance transaction. - /// - /// Only the description and metadata fields can be updated. - pub fn update_balance_transaction( - client: &Client, - customer_id: &CustomerId, - id: &CustomerBalanceTransactionId, - params: UpdateCustomerBalanceTransaction<'_>, - ) -> Response { - client - .post_form(&format!("/customers/{}/balance_transactions/{}", customer_id, id), ¶ms) - } -} diff --git a/src/resources/customer_ext.rs b/src/resources/customer_ext.rs deleted file mode 100644 index 5e1b03215..000000000 --- a/src/resources/customer_ext.rs +++ /dev/null @@ -1,183 +0,0 @@ -use serde::{Deserialize, Serialize}; - -use crate::client::{Client, Response}; -use crate::ids::{BankAccountId, CardId, CustomerId, PaymentSourceId}; -use crate::params::{Deleted, Expand, List, SearchList}; -use crate::resources::{ - BankAccount, Customer, PaymentMethod, PaymentSource, PaymentSourceParams, Source, -}; - -#[derive(Clone, Debug, Serialize, Eq, PartialEq)] -pub struct CustomerPaymentMethodRetrieval<'a> { - ///A cursor for use in pagination. `ending_before` is an object ID that defines your place in the list. - ///For instance, if you make a list request and receive 100 objects, starting with `obj_bar`, - ///your subsequent call can include `ending_before=obj_bar` in order to fetch the previous page of the list. - #[serde(skip_serializing_if = "Option::is_none")] - pub ending_before: Option, - - ///Specifies which fields in the response should be expanded. - #[serde(skip_serializing_if = "Expand::is_empty")] - pub expand: &'a [&'a str], - - ///A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 10. - #[serde(skip_serializing_if = "Option::is_none")] - pub limit: Option, - - ///A cursor for use in pagination. `starting_after` is an object ID that defines your place in the list. - ///For instance, if you make a list request and receive 100 objects, ending with `obj_foo`, - ///your subsequent call can include `starting_after=obj_foo` in order to fetch the next page of the list. - #[serde(skip_serializing_if = "Option::is_none")] - pub starting_after: Option, - - ///A required filter on the list, based on the object `type` field. - #[serde(rename = "type")] - pub type_: CustomerPaymentMethodRetrievalType, -} - -impl<'a> CustomerPaymentMethodRetrieval<'a> { - pub fn new(the_type: CustomerPaymentMethodRetrievalType) -> Self { - CustomerPaymentMethodRetrieval { - ending_before: None, - expand: &[], - limit: None, - starting_after: None, - type_: the_type, - } - } -} - -#[derive(Copy, Clone, Debug, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CustomerPaymentMethodRetrievalType { - AcssDebit, - AfterpayClearpay, - Alipay, - AuBecsDebit, - BacsDebit, - Bancontact, - Boleto, - Card, - Eps, - Fpx, - Giropay, - Grabpay, - Ideal, - Klarna, - Oxxo, - P24, - SepaDebit, - Sofort, - WechatPay, -} - -#[derive(Clone, Debug, Default, Serialize)] -pub struct CustomerSearchParams<'a> { - pub query: String, - #[serde(skip_serializing_if = "Option::is_none")] - pub limit: Option, - #[serde(skip_serializing_if = "Option::is_none")] - pub page: Option, - pub expand: &'a [&'a str], -} - -impl<'a> CustomerSearchParams<'a> { - pub fn new() -> CustomerSearchParams<'a> { - CustomerSearchParams { query: String::new(), limit: None, page: None, expand: &[] } - } -} - -impl Customer { - /// Attaches a source to a customer, does not change default Source for the Customer - /// - /// For more details see . - pub fn attach_source( - client: &Client, - customer_id: &CustomerId, - source: PaymentSourceParams, - ) -> Response { - #[derive(Serialize)] - struct AttachSource { - source: PaymentSourceParams, - } - let params = AttachSource { source }; - client.post_form(&format!("/customers/{}/sources", customer_id), params) - } - - /// Detaches a source from a customer - /// - /// For more details see . - pub fn detach_source( - client: &Client, - customer_id: &CustomerId, - source_id: &PaymentSourceId, - ) -> Response { - client.delete(&format!("/customers/{}/sources/{}", customer_id, source_id)) - } - - /// Retrieves a Card, BankAccount, or Source for a Customer - pub fn retrieve_source( - client: &Client, - customer_id: &CustomerId, - source_id: &PaymentSourceId, - ) -> Response { - client.get(&format!("/customers/{}/sources/{}", customer_id, source_id)) - } - - /// Verifies a Bank Account for a Customer. - /// - /// For more details see . - pub fn verify_bank_account( - client: &Client, - customer_id: &CustomerId, - bank_account_id: &BankAccountId, - params: VerifyBankAccount<'_>, - ) -> Response { - client.post_form( - &format!("/customers/{}/sources/{}/verify", customer_id, bank_account_id), - params, - ) - } - - ///Returns a list of PaymentMethods for a given Customer - /// - ///For more details see - pub fn retrieve_payment_methods( - client: &Client, - customer_id: &CustomerId, - params: CustomerPaymentMethodRetrieval<'_>, - ) -> Response> { - client.get_query(&format!("/customers/{}/payment_methods", customer_id), ¶ms) - } - - /// Searches for a customer. - /// - /// For more details see . - pub fn search(client: &Client, params: CustomerSearchParams) -> Response> { - client.get_query("/customers/search", params) - } -} - -/// The set of parameters that can be used when verifying a Bank Account. -/// -/// For more details see . -#[derive(Clone, Debug, Default, Serialize)] -pub struct VerifyBankAccount<'a> { - #[serde(skip_serializing_if = "Option::is_none")] - pub amounts: Option>, - #[serde(skip_serializing_if = "Option::is_none")] - pub verification_method: Option<&'a str>, -} - -impl VerifyBankAccount<'_> { - pub fn new() -> Self { - VerifyBankAccount { amounts: None, verification_method: None } - } -} - -#[derive(Clone, Debug, Deserialize, Serialize)] -#[serde(tag = "object", rename_all = "snake_case")] -pub enum DetachedSource { - BankAccount(Deleted), - Card(Deleted), - Source(Source), -} diff --git a/src/resources/generated.rs b/src/resources/generated.rs deleted file mode 100644 index 2656f058f..000000000 --- a/src/resources/generated.rs +++ /dev/null @@ -1,172 +0,0 @@ -//! generated module -//! -//! Contains the generated impls we use. This code -//! is automatically generated from the openapi spec -//! and should not be changed manually. To update the -//! spec, use cargo make. -//! -//! It is possible more files are generated than are -//! listed as modules here. These are modules that -//! have not yet been exposed by the client. - -#[path = "generated"] -pub mod core { - pub mod address; - pub mod api_errors; - pub mod balance; - pub mod balance_amount_by_source_type; - pub mod balance_transaction; - pub mod billing_details; - pub mod cash_balance; - pub mod charge; - pub mod connect_account_reference; - pub mod custom_unit_amount; - pub mod customer; - pub mod dispute; - pub mod ephemeral_key; - pub mod file; - pub mod file_link; - pub mod invoice_setting_rendering_options; - pub mod linked_account_options_us_bank_account; - pub mod mandate; - pub mod payment_intent; - pub mod payment_intent_next_action_cashapp_handle_redirect_or_display_qr_code; - pub mod payment_method_config_biz_payment_method_configuration_details; - pub mod payment_method_details_card_wallet_apple_pay; - pub mod payment_method_details_card_wallet_google_pay; - pub mod payment_method_options_customer_balance_eu_bank_account; - pub mod payment_method_options_us_bank_account_mandate_options; - pub mod payout; - pub mod platform_tax_fee; - pub mod price; - pub mod product; - pub mod radar_radar_options; - pub mod refund; - pub mod reserve_transaction; - pub mod setup_attempt; - pub mod setup_intent; - pub mod shipping; - pub mod shipping_rate; - pub mod tax_code; - pub mod tax_deducted_at_source; - pub mod test_helpers_test_clock; - pub mod token; - pub mod version; -} - -#[path = "generated"] -pub mod payment { - pub mod bank_account; - pub mod card; - pub mod payment_method; - pub mod payment_method_card_present_networks; - pub mod source; -} - -#[path = "generated"] -#[cfg(feature = "checkout")] -pub mod checkout { - pub mod checkout_session; - pub mod item; - pub mod payment_link; -} - -#[path = "generated"] -#[cfg(feature = "tax-calculation")] -pub mod tax_calculation { - pub mod tax_calculation; - pub mod tax_calculation_line_item; - pub mod tax_product_resource_customer_details; -} - -#[path = "generated"] -#[cfg(feature = "billing")] -pub mod billing { - pub mod billing_portal_configuration; - pub mod billing_portal_session; - pub mod coupon; - pub mod credit_note; - pub mod credit_note_line_item; - pub mod customer_balance_transaction; - pub mod discount; - pub mod invoice; - pub mod invoice_payment_method_options_acss_debit; - pub mod invoice_payment_method_options_bancontact; - pub mod invoice_payment_method_options_customer_balance; - pub mod invoice_payment_method_options_konbini; - pub mod invoice_payment_method_options_us_bank_account; - pub mod invoiceitem; - pub mod invoices_shipping_cost; - pub mod line_item; - pub mod plan; - pub mod promotion_code; - pub mod quote; - pub mod quotes_resource_total_details; - pub mod subscription; - pub mod subscription_billing_thresholds; - pub mod subscription_item; - pub mod subscription_item_billing_thresholds; - pub mod subscription_schedule; - pub mod subscriptions_trials_resource_trial_settings; - pub mod tax_id; - pub mod tax_rate; - pub mod usage_record; - pub mod usage_record_summary; -} - -#[path = "generated"] -#[cfg(feature = "connect")] -pub mod connect { - pub mod account; - pub mod account_link; - pub mod application; - pub mod application_fee; - pub mod connect_collection_transfer; - pub mod fee_refund; - pub mod login_link; - pub mod person; - pub mod topup; - pub mod transfer; - pub mod transfer_reversal; -} - -#[path = "generated"] -#[cfg(feature = "fraud")] -pub mod fraud { - pub mod review; -} - -#[path = "generated"] -#[cfg(feature = "issuing")] -pub mod issuing { - pub mod issuing_authorization; - pub mod issuing_card; - pub mod issuing_cardholder; - pub mod issuing_dispute; - pub mod issuing_token; - pub mod issuing_transaction; -} - -#[cfg(feature = "sigma")] -pub mod scheduled_query_run; - -#[path = "generated"] -#[cfg(feature = "terminal")] -pub mod terminal { - pub mod terminal_configuration; - pub mod terminal_connection_token; - pub mod terminal_location; - pub mod terminal_reader; -} - -#[cfg(feature = "events")] -pub mod event; - -#[path = "generated"] -#[cfg(feature = "webhook-endpoints")] -pub mod webhook_endpoints { - pub mod webhook_endpoint; -} - -#[cfg(not(feature = "full"))] -pub mod placeholders; diff --git a/src/resources/generated/account.rs b/src/resources/generated/account.rs deleted file mode 100644 index 54178eda9..000000000 --- a/src/resources/generated/account.rs +++ /dev/null @@ -1,4635 +0,0 @@ -// ====================================== -// This file was automatically generated. -// ====================================== - -use serde::{Deserialize, Serialize}; - -use crate::client::{Client, Response}; -use crate::ids::AccountId; -use crate::params::{ - Deleted, Expand, Expandable, List, Metadata, Object, Paginable, RangeQuery, Timestamp, -}; -use crate::resources::{ - Address, Currency, DelayDays, ExternalAccount, File, Person, PersonVerificationParams, TaxId, - VerificationDocumentParams, -}; - -/// The resource representing a Stripe "Account". -/// -/// For more details see -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct Account { - /// Unique identifier for the object. - pub id: AccountId, - - /// Business information about the account. - #[serde(skip_serializing_if = "Option::is_none")] - pub business_profile: Option, - - /// The business type. - /// - /// Once you create an [Account Link](https://stripe.com/docs/api/account_links) or [Account Session](https://stripe.com/docs/api/account_sessions), this property is only returned for Custom accounts. - #[serde(skip_serializing_if = "Option::is_none")] - pub business_type: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub capabilities: Option, - - /// Whether the account can create live charges. - #[serde(skip_serializing_if = "Option::is_none")] - pub charges_enabled: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub company: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub controller: Option, - - /// The account's country. - #[serde(skip_serializing_if = "Option::is_none")] - pub country: Option, - - /// Time at which the account was connected. - /// - /// Measured in seconds since the Unix epoch. - #[serde(skip_serializing_if = "Option::is_none")] - pub created: Option, - - /// Three-letter ISO currency code representing the default currency for the account. - /// - /// This must be a currency that [Stripe supports in the account's country](https://stripe.com/docs/payouts). - #[serde(skip_serializing_if = "Option::is_none")] - pub default_currency: Option, - - // Always true for a deleted object - #[serde(default)] - pub deleted: bool, - - /// Whether account details have been submitted. - /// - /// Standard accounts cannot receive payouts before this is true. - #[serde(skip_serializing_if = "Option::is_none")] - pub details_submitted: Option, - - /// An email address associated with the account. - /// - /// It's not used for authentication and Stripe doesn't market to this field without explicit approval from the platform. - #[serde(skip_serializing_if = "Option::is_none")] - pub email: Option, - - /// External accounts (bank accounts and debit cards) currently attached to this account. - /// - /// External accounts are only returned for requests where `controller[is_controller]` is true. - #[serde(skip_serializing_if = "Option::is_none")] - pub external_accounts: Option>, - - #[serde(skip_serializing_if = "Option::is_none")] - pub future_requirements: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub individual: Option, - - /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. - /// - /// This can be useful for storing additional information about the object in a structured format. - #[serde(skip_serializing_if = "Option::is_none")] - pub metadata: Option, - - /// Whether Stripe can send payouts to this account. - #[serde(skip_serializing_if = "Option::is_none")] - pub payouts_enabled: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub requirements: Option, - - /// Options for customizing how the account functions within Stripe. - #[serde(skip_serializing_if = "Option::is_none")] - pub settings: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub tos_acceptance: Option, - - /// The Stripe account type. - /// - /// Can be `standard`, `express`, or `custom`. - #[serde(rename = "type")] - #[serde(skip_serializing_if = "Option::is_none")] - pub type_: Option, -} - -impl Account { - /// Returns a list of accounts connected to your platform via [Connect](https://stripe.com/docs/connect). - /// - /// If you’re not a platform, the list is empty. - pub fn list(client: &Client, params: &ListAccounts<'_>) -> Response> { - client.get_query("/accounts", ¶ms) - } - - /// With [Connect](https://stripe.com/docs/connect), you can create Stripe accounts for your users. - /// To do this, you’ll first need to [register your platform](https://dashboard.stripe.com/account/applications/settings). - /// - /// If you’ve already collected information for your connected accounts, you [can prefill that information](https://stripe.com/docs/connect/best-practices#onboarding) when - /// creating the account. - /// - /// Connect Onboarding won’t ask for the prefilled information during account onboarding. You can prefill any information on the account. - pub fn create(client: &Client, params: CreateAccount<'_>) -> Response { - client.post_form("/accounts", ¶ms) - } - - /// Retrieves the details of an account. - pub fn retrieve(client: &Client, id: &AccountId, expand: &[&str]) -> Response { - client.get_query(&format!("/accounts/{}", id), &Expand { expand }) - } - - /// Updates a [connected account](https://stripe.com/docs/connect/accounts) by setting the values of the parameters passed. - /// - /// Any parameters not provided are left unchanged. For Custom accounts, you can update any information on the account. - /// For other accounts, you can update all information until that account has started to go through Connect Onboarding. - /// Once you create an [Account Link](https://stripe.com/docs/api/account_links) or [Account Session](https://stripe.com/docs/api/account_sessions), some properties can only be changed or updated for Custom accounts. To update your own account, use the [Dashboard](https://dashboard.stripe.com/settings/account). - /// Refer to our [Connect](https://stripe.com/docs/connect/updating-accounts) documentation to learn more about updating accounts. - pub fn update(client: &Client, id: &AccountId, params: UpdateAccount<'_>) -> Response { - client.post_form(&format!("/accounts/{}", id), ¶ms) - } - - /// With [Connect](https://stripe.com/docs/connect), you can delete accounts you manage. - /// - /// Accounts created using test-mode keys can be deleted at any time. - /// - /// Standard accounts created using live-mode keys cannot be deleted. - /// Custom or Express accounts created using live-mode keys can only be deleted once all balances are zero. If you want to delete your own account, use the [account information tab in your account settings](https://dashboard.stripe.com/settings/account) instead. - pub fn delete(client: &Client, id: &AccountId) -> Response> { - client.delete(&format!("/accounts/{}", id)) - } -} - -impl Object for Account { - type Id = AccountId; - fn id(&self) -> Self::Id { - self.id.clone() - } - fn object(&self) -> &'static str { - "account" - } -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct BusinessProfile { - /// The applicant's gross annual revenue for its preceding fiscal year. - pub annual_revenue: Option, - - /// An estimated upper bound of employees, contractors, vendors, etc. - /// - /// currently working for the business. - pub estimated_worker_count: Option, - - /// [The merchant category code for the account](https://stripe.com/docs/connect/setting-mcc). - /// - /// MCCs are used to classify businesses based on the goods or services they provide. - pub mcc: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub monthly_estimated_revenue: Option, - - /// The customer-facing business name. - pub name: Option, - - /// Internal-only description of the product sold or service provided by the business. - /// - /// It's used by Stripe for risk and underwriting purposes. - #[serde(skip_serializing_if = "Option::is_none")] - pub product_description: Option, - - /// A publicly available mailing address for sending support issues to. - pub support_address: Option

, - - /// A publicly available email address for sending support issues to. - pub support_email: Option, - - /// A publicly available phone number to call with support issues. - pub support_phone: Option, - - /// A publicly available website for handling support issues. - pub support_url: Option, - - /// The business's publicly available website. - pub url: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct AccountAnnualRevenue { - /// A non-negative integer representing the amount in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal). - pub amount: Option, - - /// Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. - /// - /// Must be a [supported currency](https://stripe.com/docs/currencies). - pub currency: Option, - - /// The close-out date of the preceding fiscal year in ISO 8601 format. - /// - /// E.g. - /// 2023-12-31 for the 31st of December, 2023. - pub fiscal_year_end: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct AccountCapabilities { - /// The status of the Canadian pre-authorized debits payments capability of the account, or whether the account can directly process Canadian pre-authorized debits charges. - #[serde(skip_serializing_if = "Option::is_none")] - pub acss_debit_payments: Option, - - /// The status of the Affirm capability of the account, or whether the account can directly process Affirm charges. - #[serde(skip_serializing_if = "Option::is_none")] - pub affirm_payments: Option, - - /// The status of the Afterpay Clearpay capability of the account, or whether the account can directly process Afterpay Clearpay charges. - #[serde(skip_serializing_if = "Option::is_none")] - pub afterpay_clearpay_payments: Option, - - /// The status of the BECS Direct Debit (AU) payments capability of the account, or whether the account can directly process BECS Direct Debit (AU) charges. - #[serde(skip_serializing_if = "Option::is_none")] - pub au_becs_debit_payments: Option, - - /// The status of the Bacs Direct Debits payments capability of the account, or whether the account can directly process Bacs Direct Debits charges. - #[serde(skip_serializing_if = "Option::is_none")] - pub bacs_debit_payments: Option, - - /// The status of the Bancontact payments capability of the account, or whether the account can directly process Bancontact charges. - #[serde(skip_serializing_if = "Option::is_none")] - pub bancontact_payments: Option, - - /// The status of the customer_balance payments capability of the account, or whether the account can directly process customer_balance charges. - #[serde(skip_serializing_if = "Option::is_none")] - pub bank_transfer_payments: Option, - - /// The status of the blik payments capability of the account, or whether the account can directly process blik charges. - #[serde(skip_serializing_if = "Option::is_none")] - pub blik_payments: Option, - - /// The status of the boleto payments capability of the account, or whether the account can directly process boleto charges. - #[serde(skip_serializing_if = "Option::is_none")] - pub boleto_payments: Option, - - /// The status of the card issuing capability of the account, or whether you can use Issuing to distribute funds on cards. - #[serde(skip_serializing_if = "Option::is_none")] - pub card_issuing: Option, - - /// The status of the card payments capability of the account, or whether the account can directly process credit and debit card charges. - #[serde(skip_serializing_if = "Option::is_none")] - pub card_payments: Option, - - /// The status of the Cartes Bancaires payments capability of the account, or whether the account can directly process Cartes Bancaires card charges in EUR currency. - #[serde(skip_serializing_if = "Option::is_none")] - pub cartes_bancaires_payments: Option, - - /// The status of the Cash App Pay capability of the account, or whether the account can directly process Cash App Pay payments. - #[serde(skip_serializing_if = "Option::is_none")] - pub cashapp_payments: Option, - - /// The status of the EPS payments capability of the account, or whether the account can directly process EPS charges. - #[serde(skip_serializing_if = "Option::is_none")] - pub eps_payments: Option, - - /// The status of the FPX payments capability of the account, or whether the account can directly process FPX charges. - #[serde(skip_serializing_if = "Option::is_none")] - pub fpx_payments: Option, - - /// The status of the giropay payments capability of the account, or whether the account can directly process giropay charges. - #[serde(skip_serializing_if = "Option::is_none")] - pub giropay_payments: Option, - - /// The status of the GrabPay payments capability of the account, or whether the account can directly process GrabPay charges. - #[serde(skip_serializing_if = "Option::is_none")] - pub grabpay_payments: Option, - - /// The status of the iDEAL payments capability of the account, or whether the account can directly process iDEAL charges. - #[serde(skip_serializing_if = "Option::is_none")] - pub ideal_payments: Option, - - /// The status of the india_international_payments capability of the account, or whether the account can process international charges (non INR) in India. - #[serde(skip_serializing_if = "Option::is_none")] - pub india_international_payments: Option, - - /// The status of the JCB payments capability of the account, or whether the account (Japan only) can directly process JCB credit card charges in JPY currency. - #[serde(skip_serializing_if = "Option::is_none")] - pub jcb_payments: Option, - - /// The status of the Klarna payments capability of the account, or whether the account can directly process Klarna charges. - #[serde(skip_serializing_if = "Option::is_none")] - pub klarna_payments: Option, - - /// The status of the konbini payments capability of the account, or whether the account can directly process konbini charges. - #[serde(skip_serializing_if = "Option::is_none")] - pub konbini_payments: Option, - - /// The status of the legacy payments capability of the account. - #[serde(skip_serializing_if = "Option::is_none")] - pub legacy_payments: Option, - - /// The status of the link_payments capability of the account, or whether the account can directly process Link charges. - #[serde(skip_serializing_if = "Option::is_none")] - pub link_payments: Option, - - /// The status of the OXXO payments capability of the account, or whether the account can directly process OXXO charges. - #[serde(skip_serializing_if = "Option::is_none")] - pub oxxo_payments: Option, - - /// The status of the P24 payments capability of the account, or whether the account can directly process P24 charges. - #[serde(skip_serializing_if = "Option::is_none")] - pub p24_payments: Option, - - /// The status of the paynow payments capability of the account, or whether the account can directly process paynow charges. - #[serde(skip_serializing_if = "Option::is_none")] - pub paynow_payments: Option, - - /// The status of the promptpay payments capability of the account, or whether the account can directly process promptpay charges. - #[serde(skip_serializing_if = "Option::is_none")] - pub promptpay_payments: Option, - - /// The status of the RevolutPay capability of the account, or whether the account can directly process RevolutPay payments. - #[serde(skip_serializing_if = "Option::is_none")] - pub revolut_pay_payments: Option, - - /// The status of the SEPA Direct Debits payments capability of the account, or whether the account can directly process SEPA Direct Debits charges. - #[serde(skip_serializing_if = "Option::is_none")] - pub sepa_debit_payments: Option, - - /// The status of the Sofort payments capability of the account, or whether the account can directly process Sofort charges. - #[serde(skip_serializing_if = "Option::is_none")] - pub sofort_payments: Option, - - /// The status of the Swish capability of the account, or whether the account can directly process Swish payments. - #[serde(skip_serializing_if = "Option::is_none")] - pub swish_payments: Option, - - /// The status of the tax reporting 1099-K (US) capability of the account. - #[serde(skip_serializing_if = "Option::is_none")] - pub tax_reporting_us_1099_k: Option, - - /// The status of the tax reporting 1099-MISC (US) capability of the account. - #[serde(skip_serializing_if = "Option::is_none")] - pub tax_reporting_us_1099_misc: Option, - - /// The status of the transfers capability of the account, or whether your platform can transfer funds to the account. - #[serde(skip_serializing_if = "Option::is_none")] - pub transfers: Option, - - /// The status of the banking capability, or whether the account can have bank accounts. - #[serde(skip_serializing_if = "Option::is_none")] - pub treasury: Option, - - /// The status of the US bank account ACH payments capability of the account, or whether the account can directly process US bank account charges. - #[serde(skip_serializing_if = "Option::is_none")] - pub us_bank_account_ach_payments: Option, - - /// The status of the Zip capability of the account, or whether the account can directly process Zip charges. - #[serde(skip_serializing_if = "Option::is_none")] - pub zip_payments: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct AccountFutureRequirements { - /// Fields that are due and can be satisfied by providing the corresponding alternative fields instead. - pub alternatives: Option>, - - /// Date on which `future_requirements` merges with the main `requirements` hash and `future_requirements` becomes empty. - /// - /// After the transition, `currently_due` requirements may immediately become `past_due`, but the account may also be given a grace period depending on its enablement state prior to transitioning. - pub current_deadline: Option, - - /// Fields that need to be collected to keep the account enabled. - /// - /// If not collected by `future_requirements[current_deadline]`, these fields will transition to the main `requirements` hash. - pub currently_due: Option>, - - /// This is typed as a string for consistency with `requirements.disabled_reason`. - pub disabled_reason: Option, - - /// Fields that are `currently_due` and need to be collected again because validation or verification failed. - pub errors: Option>, - - /// Fields that need to be collected assuming all volume thresholds are reached. - /// - /// As they become required, they appear in `currently_due` as well. - pub eventually_due: Option>, - - /// Fields that weren't collected by `requirements.current_deadline`. - /// - /// These fields need to be collected to enable the capability on the account. - /// New fields will never appear here; `future_requirements.past_due` will always be a subset of `requirements.past_due`. - pub past_due: Option>, - - /// Fields that may become required depending on the results of verification or review. - /// - /// Will be an empty array unless an asynchronous verification is pending. - /// If verification fails, these fields move to `eventually_due` or `currently_due`. - pub pending_verification: Option>, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct AccountMonthlyEstimatedRevenue { - /// A non-negative integer representing how much to charge in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal). - pub amount: i64, - - /// Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. - /// - /// Must be a [supported currency](https://stripe.com/docs/currencies). - pub currency: Currency, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct AccountRequirements { - /// Fields that are due and can be satisfied by providing the corresponding alternative fields instead. - pub alternatives: Option>, - - /// Date by which the fields in `currently_due` must be collected to keep the account enabled. - /// - /// These fields may disable the account sooner if the next threshold is reached before they are collected. - pub current_deadline: Option, - - /// Fields that need to be collected to keep the account enabled. - /// - /// If not collected by `current_deadline`, these fields appear in `past_due` as well, and the account is disabled. - pub currently_due: Option>, - - /// If the account is disabled, this string describes why. - /// - /// [Learn more about handling verification issues](https://stripe.com/docs/connect/handling-api-verification). - /// Can be `action_required.requested_capabilities`, `requirements.past_due`, `requirements.pending_verification`, `listed`, `platform_paused`, `rejected.fraud`, `rejected.incomplete_verification`, `rejected.listed`, `rejected.other`, `rejected.terms_of_service`, `under_review`, or `other`. - pub disabled_reason: Option, - - /// Fields that are `currently_due` and need to be collected again because validation or verification failed. - pub errors: Option>, - - /// Fields that need to be collected assuming all volume thresholds are reached. - /// - /// As they become required, they appear in `currently_due` as well, and `current_deadline` becomes set. - pub eventually_due: Option>, - - /// Fields that weren't collected by `current_deadline`. - /// - /// These fields need to be collected to enable the account. - pub past_due: Option>, - - /// Fields that may become required depending on the results of verification or review. - /// - /// Will be an empty array unless an asynchronous verification is pending. - /// If verification fails, these fields move to `eventually_due`, `currently_due`, or `past_due`. - pub pending_verification: Option>, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct AccountRequirementsAlternative { - /// Fields that can be provided to satisfy all fields in `original_fields_due`. - pub alternative_fields_due: Vec, - - /// Fields that are due and can be satisfied by providing all fields in `alternative_fields_due`. - pub original_fields_due: Vec, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct AccountRequirementsError { - /// The code for the type of error. - pub code: AccountRequirementsErrorCode, - - /// An informative message that indicates the error type and provides additional details about the error. - pub reason: String, - - /// The specific user onboarding requirement field (in the requirements hash) that needs to be resolved. - pub requirement: String, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct AccountSettings { - #[serde(skip_serializing_if = "Option::is_none")] - pub bacs_debit_payments: Option, - - pub branding: BrandingSettings, - - #[serde(skip_serializing_if = "Option::is_none")] - pub card_issuing: Option, - - pub card_payments: CardPaymentsSettings, - - pub dashboard: DashboardSettings, - - #[serde(skip_serializing_if = "Option::is_none")] - pub invoices: Option, - - pub payments: PaymentsSettings, - - #[serde(skip_serializing_if = "Option::is_none")] - pub payouts: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub sepa_debit_payments: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub treasury: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct AccountBacsDebitPaymentsSettings { - /// The Bacs Direct Debit display name for this account. - /// - /// For payments made with Bacs Direct Debit, this name appears on the mandate as the statement descriptor. - /// Mobile banking apps display it as the name of the business. - /// To use custom branding, set the Bacs Direct Debit Display Name during or right after creation. - /// Custom branding incurs an additional monthly fee for the platform. - /// The fee appears 5 business days after requesting Bacs. - /// If you don't set the display name before requesting Bacs capability, it's automatically set as "Stripe" and the account is onboarded to Stripe branding, which is free. - pub display_name: Option, - - /// The Bacs Direct Debit Service user number for this account. - /// - /// For payments made with Bacs Direct Debit, this number is a unique identifier of the account with our banking partners. - pub service_user_number: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct BrandingSettings { - /// (ID of a [file upload](https://stripe.com/docs/guides/file-upload)) An icon for the account. - /// - /// Must be square and at least 128px x 128px. - pub icon: Option>, - - /// (ID of a [file upload](https://stripe.com/docs/guides/file-upload)) A logo for the account that will be used in Checkout instead of the icon and without the account's name next to it if provided. - /// - /// Must be at least 128px x 128px. - pub logo: Option>, - - /// A CSS hex color value representing the primary branding color for this account. - pub primary_color: Option, - - /// A CSS hex color value representing the secondary branding color for this account. - pub secondary_color: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct AccountCardIssuingSettings { - #[serde(skip_serializing_if = "Option::is_none")] - pub tos_acceptance: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CardPaymentsSettings { - #[serde(skip_serializing_if = "Option::is_none")] - pub decline_on: Option, - - /// The default text that appears on credit card statements when a charge is made. - /// - /// This field prefixes any dynamic `statement_descriptor` specified on the charge. - /// `statement_descriptor_prefix` is useful for maximizing descriptor space for the dynamic portion. - pub statement_descriptor_prefix: Option, - - /// The Kana variation of the default text that appears on credit card statements when a charge is made (Japan only). - /// - /// This field prefixes any dynamic `statement_descriptor_suffix_kana` specified on the charge. - /// `statement_descriptor_prefix_kana` is useful for maximizing descriptor space for the dynamic portion. - pub statement_descriptor_prefix_kana: Option, - - /// The Kanji variation of the default text that appears on credit card statements when a charge is made (Japan only). - /// - /// This field prefixes any dynamic `statement_descriptor_suffix_kanji` specified on the charge. - /// `statement_descriptor_prefix_kanji` is useful for maximizing descriptor space for the dynamic portion. - pub statement_descriptor_prefix_kanji: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct DashboardSettings { - /// The display name for this account. - /// - /// This is used on the Stripe Dashboard to differentiate between accounts. - pub display_name: Option, - - /// The timezone used in the Stripe Dashboard for this account. - /// - /// A list of possible time zone values is maintained at the [IANA Time Zone Database](http://www.iana.org/time-zones). - pub timezone: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct DeclineChargeOn { - /// Whether Stripe automatically declines charges with an incorrect ZIP or postal code. - /// - /// This setting only applies when a ZIP or postal code is provided and they fail bank verification. - pub avs_failure: bool, - - /// Whether Stripe automatically declines charges with an incorrect CVC. - /// - /// This setting only applies when a CVC is provided and it fails bank verification. - pub cvc_failure: bool, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct AccountInvoicesSettings { - /// The list of default Account Tax IDs to automatically include on invoices. - /// - /// Account Tax IDs get added when an invoice is finalized. - pub default_account_tax_ids: Option>>, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct PaymentsSettings { - /// The default text that appears on credit card statements when a charge is made. - /// - /// This field prefixes any dynamic `statement_descriptor` specified on the charge. - pub statement_descriptor: Option, - - /// The Kana variation of the default text that appears on credit card statements when a charge is made (Japan only). - pub statement_descriptor_kana: Option, - - /// The Kanji variation of the default text that appears on credit card statements when a charge is made (Japan only). - pub statement_descriptor_kanji: Option, - - /// The Kana variation of the default text that appears on credit card statements when a charge is made (Japan only). - /// - /// This field prefixes any dynamic `statement_descriptor_suffix_kana` specified on the charge. - /// `statement_descriptor_prefix_kana` is useful for maximizing descriptor space for the dynamic portion. - pub statement_descriptor_prefix_kana: Option, - - /// The Kanji variation of the default text that appears on credit card statements when a charge is made (Japan only). - /// - /// This field prefixes any dynamic `statement_descriptor_suffix_kanji` specified on the charge. - /// `statement_descriptor_prefix_kanji` is useful for maximizing descriptor space for the dynamic portion. - pub statement_descriptor_prefix_kanji: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct PayoutSettings { - /// A Boolean indicating if Stripe should try to reclaim negative balances from an attached bank account. - /// - /// See our [Understanding Connect Account Balances](https://stripe.com/docs/connect/account-balances) documentation for details. - /// Default value is `false` for Custom accounts, otherwise `true`. - pub debit_negative_balances: bool, - - pub schedule: TransferSchedule, - - /// The text that appears on the bank account statement for payouts. - /// - /// If not set, this defaults to the platform's bank descriptor as set in the Dashboard. - pub statement_descriptor: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct AccountSepaDebitPaymentsSettings { - /// SEPA creditor identifier that identifies the company making the payment. - #[serde(skip_serializing_if = "Option::is_none")] - pub creditor_id: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct TosAcceptance { - /// The Unix timestamp marking when the account representative accepted their service agreement. - #[serde(skip_serializing_if = "Option::is_none")] - pub date: Option, - - /// The IP address from which the account representative accepted their service agreement. - #[serde(skip_serializing_if = "Option::is_none")] - pub ip: Option, - - /// The user's service agreement type. - #[serde(skip_serializing_if = "Option::is_none")] - pub service_agreement: Option, - - /// The user agent of the browser from which the account representative accepted their service agreement. - #[serde(skip_serializing_if = "Option::is_none")] - pub user_agent: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct AccountTreasurySettings { - #[serde(skip_serializing_if = "Option::is_none")] - pub tos_acceptance: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct AccountTermsOfService { - /// The Unix timestamp marking when the account representative accepted the service agreement. - pub date: Option, - - /// The IP address from which the account representative accepted the service agreement. - pub ip: Option, - - /// The user agent of the browser from which the account representative accepted the service agreement. - #[serde(skip_serializing_if = "Option::is_none")] - pub user_agent: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct AccountUnificationAccountController { - /// `true` if the Connect application retrieving the resource controls the account and can therefore exercise [platform controls](https://stripe.com/docs/connect/platform-controls-for-standard-accounts). - /// - /// Otherwise, this field is null. - #[serde(skip_serializing_if = "Option::is_none")] - pub is_controller: Option, - - /// The controller type. - /// - /// Can be `application`, if a Connect application controls the account, or `account`, if the account controls itself. - #[serde(rename = "type")] - pub type_: AccountUnificationAccountControllerType, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CardIssuingAccountTermsOfService { - /// The Unix timestamp marking when the account representative accepted the service agreement. - pub date: Option, - - /// The IP address from which the account representative accepted the service agreement. - pub ip: Option, - - /// The user agent of the browser from which the account representative accepted the service agreement. - #[serde(skip_serializing_if = "Option::is_none")] - pub user_agent: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct Company { - #[serde(skip_serializing_if = "Option::is_none")] - pub address: Option
, - - /// The Kana variation of the company's primary address (Japan only). - #[serde(skip_serializing_if = "Option::is_none")] - pub address_kana: Option
, - - /// The Kanji variation of the company's primary address (Japan only). - #[serde(skip_serializing_if = "Option::is_none")] - pub address_kanji: Option
, - - /// Whether the company's directors have been provided. - /// - /// This Boolean will be `true` if you've manually indicated that all directors are provided via [the `directors_provided` parameter](https://stripe.com/docs/api/accounts/update#update_account-company-directors_provided). - #[serde(skip_serializing_if = "Option::is_none")] - pub directors_provided: Option, - - /// Whether the company's executives have been provided. - /// - /// This Boolean will be `true` if you've manually indicated that all executives are provided via [the `executives_provided` parameter](https://stripe.com/docs/api/accounts/update#update_account-company-executives_provided), or if Stripe determined that sufficient executives were provided. - #[serde(skip_serializing_if = "Option::is_none")] - pub executives_provided: Option, - - /// The export license ID number of the company, also referred as Import Export Code (India only). - #[serde(skip_serializing_if = "Option::is_none")] - pub export_license_id: Option, - - /// The purpose code to use for export transactions (India only). - #[serde(skip_serializing_if = "Option::is_none")] - pub export_purpose_code: Option, - - /// The company's legal name. - #[serde(skip_serializing_if = "Option::is_none")] - pub name: Option, - - /// The Kana variation of the company's legal name (Japan only). - #[serde(skip_serializing_if = "Option::is_none")] - pub name_kana: Option, - - /// The Kanji variation of the company's legal name (Japan only). - #[serde(skip_serializing_if = "Option::is_none")] - pub name_kanji: Option, - - /// Whether the company's owners have been provided. - /// - /// This Boolean will be `true` if you've manually indicated that all owners are provided via [the `owners_provided` parameter](https://stripe.com/docs/api/accounts/update#update_account-company-owners_provided), or if Stripe determined that sufficient owners were provided. - /// Stripe determines ownership requirements using both the number of owners provided and their total percent ownership (calculated by adding the `percent_ownership` of each owner together). - #[serde(skip_serializing_if = "Option::is_none")] - pub owners_provided: Option, - - /// This hash is used to attest that the beneficial owner information provided to Stripe is both current and correct. - #[serde(skip_serializing_if = "Option::is_none")] - pub ownership_declaration: Option, - - /// The company's phone number (used for verification). - #[serde(skip_serializing_if = "Option::is_none")] - pub phone: Option, - - /// The category identifying the legal structure of the company or legal entity. - /// - /// See [Business structure](https://stripe.com/docs/connect/identity-verification#business-structure) for more details. - #[serde(skip_serializing_if = "Option::is_none")] - pub structure: Option, - - /// Whether the company's business ID number was provided. - #[serde(skip_serializing_if = "Option::is_none")] - pub tax_id_provided: Option, - - /// The jurisdiction in which the `tax_id` is registered (Germany-based companies only). - #[serde(skip_serializing_if = "Option::is_none")] - pub tax_id_registrar: Option, - - /// Whether the company's business VAT number was provided. - #[serde(skip_serializing_if = "Option::is_none")] - pub vat_id_provided: Option, - - /// Information on the verification state of the company. - #[serde(skip_serializing_if = "Option::is_none")] - pub verification: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CompanyVerification { - pub document: CompanyVerificationDocument, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CompanyVerificationDocument { - /// The back of a document returned by a [file upload](https://stripe.com/docs/api#create_file) with a `purpose` value of `additional_verification`. - pub back: Option>, - - /// A user-displayable string describing the verification state of this document. - pub details: Option, - - /// One of `document_corrupt`, `document_expired`, `document_failed_copy`, `document_failed_greyscale`, `document_failed_other`, `document_failed_test_mode`, `document_fraudulent`, `document_incomplete`, `document_invalid`, `document_manipulated`, `document_not_readable`, `document_not_uploaded`, `document_type_not_supported`, or `document_too_large`. - /// - /// A machine-readable code specifying the verification state for this document. - pub details_code: Option, - - /// The front of a document returned by a [file upload](https://stripe.com/docs/api#create_file) with a `purpose` value of `additional_verification`. - pub front: Option>, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct LegalEntityUboDeclaration { - /// The Unix timestamp marking when the beneficial owner attestation was made. - pub date: Option, - - /// The IP address from which the beneficial owner attestation was made. - pub ip: Option, - - /// The user-agent string from the browser where the beneficial owner attestation was made. - pub user_agent: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct TransferSchedule { - /// The number of days charges for the account will be held before being paid out. - pub delay_days: u32, - - /// How frequently funds will be paid out. - /// - /// One of `manual` (payouts only created via API call), `daily`, `weekly`, or `monthly`. - pub interval: String, - - /// The day of the month funds will be paid out. - /// - /// Only shown if `interval` is monthly. - /// Payouts scheduled between the 29th and 31st of the month are sent on the last day of shorter months. - #[serde(skip_serializing_if = "Option::is_none")] - pub monthly_anchor: Option, - - /// The day of the week funds will be paid out, of the style 'monday', 'tuesday', etc. - /// - /// Only shown if `interval` is weekly. - #[serde(skip_serializing_if = "Option::is_none")] - pub weekly_anchor: Option, -} - -/// The parameters for `Account::create`. -#[derive(Clone, Debug, Serialize, Default)] -pub struct CreateAccount<'a> { - /// An [account token](https://stripe.com/docs/api#create_account_token), used to securely provide details to the account. - #[serde(skip_serializing_if = "Option::is_none")] - pub account_token: Option<&'a str>, - - /// Business information about the account. - #[serde(skip_serializing_if = "Option::is_none")] - pub business_profile: Option, - - /// The business type. - /// - /// Once you create an [Account Link](https://stripe.com/docs/api/account_links) or [Account Session](https://stripe.com/docs/api/account_sessions), this property can only be updated for Custom accounts. - #[serde(skip_serializing_if = "Option::is_none")] - pub business_type: Option, - - /// Each key of the dictionary represents a capability, and each capability maps to its settings (e.g. - /// - /// whether it has been requested or not). - /// Each capability will be inactive until you have provided its specific requirements and Stripe has verified them. - /// An account may have some of its requested capabilities be active and some be inactive. - #[serde(skip_serializing_if = "Option::is_none")] - pub capabilities: Option, - - /// Information about the company or business. - /// - /// This field is available for any `business_type`. - /// Once you create an [Account Link](https://stripe.com/docs/api/account_links) or [Account Session](https://stripe.com/docs/api/account_sessions), this property can only be updated for Custom accounts. - #[serde(skip_serializing_if = "Option::is_none")] - pub company: Option, - - /// The country in which the account holder resides, or in which the business is legally established. - /// - /// This should be an ISO 3166-1 alpha-2 country code. - /// For example, if you are in the United States and the business for which you're creating an account is legally represented in Canada, you would use `CA` as the country for the account being created. - /// Available countries include [Stripe's global markets](https://stripe.com/global) as well as countries where [cross-border payouts](https://stripe.com/docs/connect/cross-border-payouts) are supported. - #[serde(skip_serializing_if = "Option::is_none")] - pub country: Option<&'a str>, - - /// Three-letter ISO currency code representing the default currency for the account. - /// - /// This must be a currency that [Stripe supports in the account's country](https://stripe.com/docs/payouts). - #[serde(skip_serializing_if = "Option::is_none")] - pub default_currency: Option, - - /// Documents that may be submitted to satisfy various informational requests. - #[serde(skip_serializing_if = "Option::is_none")] - pub documents: Option, - - /// The email address of the account holder. - /// - /// This is only to make the account easier to identify to you. - /// Stripe only emails Custom accounts with your consent. - #[serde(skip_serializing_if = "Option::is_none")] - pub email: Option<&'a str>, - - /// Specifies which fields in the response should be expanded. - #[serde(skip_serializing_if = "Expand::is_empty")] - pub expand: &'a [&'a str], - - /// A card or bank account to attach to the account for receiving [payouts](https://stripe.com/docs/connect/bank-debit-card-payouts) (you won’t be able to use it for top-ups). - /// - /// You can provide either a token, like the ones returned by [Stripe.js](https://stripe.com/docs/js), or a dictionary, as documented in the `external_account` parameter for [bank account](https://stripe.com/docs/api#account_create_bank_account) creation. - /// By default, providing an external account sets it as the new default external account for its currency, and deletes the old default if one exists. - /// To add additional external accounts without replacing the existing default for the currency, use the [bank account](https://stripe.com/docs/api#account_create_bank_account) or [card creation](https://stripe.com/docs/api#account_create_card) APIs. - /// After you create an [Account Link](https://stripe.com/docs/api/account_links) or [Account Session](https://stripe.com/docs/api/account_sessions), this property can only be updated for Custom accounts. - #[serde(skip_serializing_if = "Option::is_none")] - pub external_account: Option<&'a str>, - - /// Information about the person represented by the account. - /// - /// This field is null unless `business_type` is set to `individual`. - /// Once you create an [Account Link](https://stripe.com/docs/api/account_links) or [Account Session](https://stripe.com/docs/api/account_sessions), this property can only be updated for Custom accounts. - #[serde(skip_serializing_if = "Option::is_none")] - pub individual: Option, - - /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. - /// - /// This can be useful for storing additional information about the object in a structured format. - /// Individual keys can be unset by posting an empty value to them. - /// All keys can be unset by posting an empty value to `metadata`. - #[serde(skip_serializing_if = "Option::is_none")] - pub metadata: Option, - - /// Options for customizing how the account functions within Stripe. - #[serde(skip_serializing_if = "Option::is_none")] - pub settings: Option, - - /// Details on the account's acceptance of the [Stripe Services Agreement](https://stripe.com/docs/connect/updating-accounts#tos-acceptance) This property can only be updated for Custom accounts. - #[serde(skip_serializing_if = "Option::is_none")] - pub tos_acceptance: Option, - - /// The type of Stripe account to create. - /// - /// May be one of `custom`, `express` or `standard`. - #[serde(rename = "type")] - #[serde(skip_serializing_if = "Option::is_none")] - pub type_: Option, -} - -impl<'a> CreateAccount<'a> { - pub fn new() -> Self { - CreateAccount { - account_token: Default::default(), - business_profile: Default::default(), - business_type: Default::default(), - capabilities: Default::default(), - company: Default::default(), - country: Default::default(), - default_currency: Default::default(), - documents: Default::default(), - email: Default::default(), - expand: Default::default(), - external_account: Default::default(), - individual: Default::default(), - metadata: Default::default(), - settings: Default::default(), - tos_acceptance: Default::default(), - type_: Default::default(), - } - } -} - -/// The parameters for `Account::list`. -#[derive(Clone, Debug, Serialize, Default)] -pub struct ListAccounts<'a> { - #[serde(skip_serializing_if = "Option::is_none")] - pub created: Option>, - - /// A cursor for use in pagination. - /// - /// `ending_before` is an object ID that defines your place in the list. - /// For instance, if you make a list request and receive 100 objects, starting with `obj_bar`, your subsequent call can include `ending_before=obj_bar` in order to fetch the previous page of the list. - #[serde(skip_serializing_if = "Option::is_none")] - pub ending_before: Option, - - /// Specifies which fields in the response should be expanded. - #[serde(skip_serializing_if = "Expand::is_empty")] - pub expand: &'a [&'a str], - - /// A limit on the number of objects to be returned. - /// - /// Limit can range between 1 and 100, and the default is 10. - #[serde(skip_serializing_if = "Option::is_none")] - pub limit: Option, - - /// A cursor for use in pagination. - /// - /// `starting_after` is an object ID that defines your place in the list. - /// For instance, if you make a list request and receive 100 objects, ending with `obj_foo`, your subsequent call can include `starting_after=obj_foo` in order to fetch the next page of the list. - #[serde(skip_serializing_if = "Option::is_none")] - pub starting_after: Option, -} - -impl<'a> ListAccounts<'a> { - pub fn new() -> Self { - ListAccounts { - created: Default::default(), - ending_before: Default::default(), - expand: Default::default(), - limit: Default::default(), - starting_after: Default::default(), - } - } -} -impl Paginable for ListAccounts<'_> { - type O = Account; - fn set_last(&mut self, item: Self::O) { - self.starting_after = Some(item.id()); - } -} -/// The parameters for `Account::update`. -#[derive(Clone, Debug, Serialize, Default)] -pub struct UpdateAccount<'a> { - /// An [account token](https://stripe.com/docs/api#create_account_token), used to securely provide details to the account. - #[serde(skip_serializing_if = "Option::is_none")] - pub account_token: Option<&'a str>, - - /// Business information about the account. - #[serde(skip_serializing_if = "Option::is_none")] - pub business_profile: Option, - - /// The business type. - /// - /// Once you create an [Account Link](https://stripe.com/docs/api/account_links) or [Account Session](https://stripe.com/docs/api/account_sessions), this property can only be updated for Custom accounts. - #[serde(skip_serializing_if = "Option::is_none")] - pub business_type: Option, - - /// Each key of the dictionary represents a capability, and each capability maps to its settings (e.g. - /// - /// whether it has been requested or not). - /// Each capability will be inactive until you have provided its specific requirements and Stripe has verified them. - /// An account may have some of its requested capabilities be active and some be inactive. - #[serde(skip_serializing_if = "Option::is_none")] - pub capabilities: Option, - - /// Information about the company or business. - /// - /// This field is available for any `business_type`. - /// Once you create an [Account Link](https://stripe.com/docs/api/account_links) or [Account Session](https://stripe.com/docs/api/account_sessions), this property can only be updated for Custom accounts. - #[serde(skip_serializing_if = "Option::is_none")] - pub company: Option, - - /// Three-letter ISO currency code representing the default currency for the account. - /// - /// This must be a currency that [Stripe supports in the account's country](https://stripe.com/docs/payouts). - #[serde(skip_serializing_if = "Option::is_none")] - pub default_currency: Option, - - /// Documents that may be submitted to satisfy various informational requests. - #[serde(skip_serializing_if = "Option::is_none")] - pub documents: Option, - - /// The email address of the account holder. - /// - /// This is only to make the account easier to identify to you. - /// Stripe only emails Custom accounts with your consent. - #[serde(skip_serializing_if = "Option::is_none")] - pub email: Option<&'a str>, - - /// Specifies which fields in the response should be expanded. - #[serde(skip_serializing_if = "Expand::is_empty")] - pub expand: &'a [&'a str], - - /// A card or bank account to attach to the account for receiving [payouts](https://stripe.com/docs/connect/bank-debit-card-payouts) (you won’t be able to use it for top-ups). - /// - /// You can provide either a token, like the ones returned by [Stripe.js](https://stripe.com/docs/js), or a dictionary, as documented in the `external_account` parameter for [bank account](https://stripe.com/docs/api#account_create_bank_account) creation. - /// By default, providing an external account sets it as the new default external account for its currency, and deletes the old default if one exists. - /// To add additional external accounts without replacing the existing default for the currency, use the [bank account](https://stripe.com/docs/api#account_create_bank_account) or [card creation](https://stripe.com/docs/api#account_create_card) APIs. - /// After you create an [Account Link](https://stripe.com/docs/api/account_links) or [Account Session](https://stripe.com/docs/api/account_sessions), this property can only be updated for Custom accounts. - #[serde(skip_serializing_if = "Option::is_none")] - pub external_account: Option<&'a str>, - - /// Information about the person represented by the account. - /// - /// This field is null unless `business_type` is set to `individual`. - /// Once you create an [Account Link](https://stripe.com/docs/api/account_links) or [Account Session](https://stripe.com/docs/api/account_sessions), this property can only be updated for Custom accounts. - #[serde(skip_serializing_if = "Option::is_none")] - pub individual: Option, - - /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. - /// - /// This can be useful for storing additional information about the object in a structured format. - /// Individual keys can be unset by posting an empty value to them. - /// All keys can be unset by posting an empty value to `metadata`. - #[serde(skip_serializing_if = "Option::is_none")] - pub metadata: Option, - - /// Options for customizing how the account functions within Stripe. - #[serde(skip_serializing_if = "Option::is_none")] - pub settings: Option, - - /// Details on the account's acceptance of the [Stripe Services Agreement](https://stripe.com/docs/connect/updating-accounts#tos-acceptance) This property can only be updated for Custom accounts. - #[serde(skip_serializing_if = "Option::is_none")] - pub tos_acceptance: Option, -} - -impl<'a> UpdateAccount<'a> { - pub fn new() -> Self { - UpdateAccount { - account_token: Default::default(), - business_profile: Default::default(), - business_type: Default::default(), - capabilities: Default::default(), - company: Default::default(), - default_currency: Default::default(), - documents: Default::default(), - email: Default::default(), - expand: Default::default(), - external_account: Default::default(), - individual: Default::default(), - metadata: Default::default(), - settings: Default::default(), - tos_acceptance: Default::default(), - } - } -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct AcceptTos { - /// The Unix timestamp marking when the account representative accepted their service agreement. - #[serde(skip_serializing_if = "Option::is_none")] - pub date: Option, - - /// The IP address from which the account representative accepted their service agreement. - #[serde(skip_serializing_if = "Option::is_none")] - pub ip: Option, - - /// The user's service agreement type. - #[serde(skip_serializing_if = "Option::is_none")] - pub service_agreement: Option, - - /// The user agent of the browser from which the account representative accepted their service agreement. - #[serde(skip_serializing_if = "Option::is_none")] - pub user_agent: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct AccountSettingsParams { - /// Settings specific to Bacs Direct Debit. - #[serde(skip_serializing_if = "Option::is_none")] - pub bacs_debit_payments: Option, - - /// Settings used to apply the account's branding to email receipts, invoices, Checkout, and other products. - #[serde(skip_serializing_if = "Option::is_none")] - pub branding: Option, - - /// Settings specific to the account's use of the Card Issuing product. - #[serde(skip_serializing_if = "Option::is_none")] - pub card_issuing: Option, - - /// Settings specific to card charging on the account. - #[serde(skip_serializing_if = "Option::is_none")] - pub card_payments: Option, - - /// Settings that apply across payment methods for charging on the account. - #[serde(skip_serializing_if = "Option::is_none")] - pub payments: Option, - - /// Settings specific to the account's payouts. - #[serde(skip_serializing_if = "Option::is_none")] - pub payouts: Option, - - /// Settings specific to the account's Treasury FinancialAccounts. - #[serde(skip_serializing_if = "Option::is_none")] - pub treasury: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CompanyParams { - /// The company's primary address. - #[serde(skip_serializing_if = "Option::is_none")] - pub address: Option
, - - /// The Kana variation of the company's primary address (Japan only). - #[serde(skip_serializing_if = "Option::is_none")] - pub address_kana: Option
, - - /// The Kanji variation of the company's primary address (Japan only). - #[serde(skip_serializing_if = "Option::is_none")] - pub address_kanji: Option
, - - /// Whether the company's directors have been provided. - /// - /// Set this Boolean to `true` after creating all the company's directors with [the Persons API](https://stripe.com/docs/api/persons) for accounts with a `relationship.director` requirement. - /// This value is not automatically set to `true` after creating directors, so it needs to be updated to indicate all directors have been provided. - #[serde(skip_serializing_if = "Option::is_none")] - pub directors_provided: Option, - - /// Whether the company's executives have been provided. - /// - /// Set this Boolean to `true` after creating all the company's executives with [the Persons API](https://stripe.com/docs/api/persons) for accounts with a `relationship.executive` requirement. - #[serde(skip_serializing_if = "Option::is_none")] - pub executives_provided: Option, - - /// The export license ID number of the company, also referred as Import Export Code (India only). - #[serde(skip_serializing_if = "Option::is_none")] - pub export_license_id: Option, - - /// The purpose code to use for export transactions (India only). - #[serde(skip_serializing_if = "Option::is_none")] - pub export_purpose_code: Option, - - /// The company's legal name. - #[serde(skip_serializing_if = "Option::is_none")] - pub name: Option, - - /// The Kana variation of the company's legal name (Japan only). - #[serde(skip_serializing_if = "Option::is_none")] - pub name_kana: Option, - - /// The Kanji variation of the company's legal name (Japan only). - #[serde(skip_serializing_if = "Option::is_none")] - pub name_kanji: Option, - - /// Whether the company's owners have been provided. - /// - /// Set this Boolean to `true` after creating all the company's owners with [the Persons API](https://stripe.com/docs/api/persons) for accounts with a `relationship.owner` requirement. - #[serde(skip_serializing_if = "Option::is_none")] - pub owners_provided: Option, - - /// This hash is used to attest that the beneficial owner information provided to Stripe is both current and correct. - #[serde(skip_serializing_if = "Option::is_none")] - pub ownership_declaration: Option, - - /// The company's phone number (used for verification). - #[serde(skip_serializing_if = "Option::is_none")] - pub phone: Option, - - /// The identification number given to a company when it is registered or incorporated, if distinct from the identification number used for filing taxes. - /// - /// (Examples are the CIN for companies and LLP IN for partnerships in India, and the Company Registration Number in Hong Kong). - #[serde(skip_serializing_if = "Option::is_none")] - pub registration_number: Option, - - /// The category identifying the legal structure of the company or legal entity. - /// - /// See [Business structure](https://stripe.com/docs/connect/identity-verification#business-structure) for more details. - /// Pass an empty string to unset this value. - #[serde(skip_serializing_if = "Option::is_none")] - pub structure: Option, - - /// The business ID number of the company, as appropriate for the company’s country. - /// - /// (Examples are an Employer ID Number in the U.S., a Business Number in Canada, or a Company Number in the UK.). - #[serde(skip_serializing_if = "Option::is_none")] - pub tax_id: Option, - - /// The jurisdiction in which the `tax_id` is registered (Germany-based companies only). - #[serde(skip_serializing_if = "Option::is_none")] - pub tax_id_registrar: Option, - - /// The VAT number of the company. - #[serde(skip_serializing_if = "Option::is_none")] - pub vat_id: Option, - - /// Information on the verification state of the company. - #[serde(skip_serializing_if = "Option::is_none")] - pub verification: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreateAccountCapabilities { - /// The acss_debit_payments capability. - #[serde(skip_serializing_if = "Option::is_none")] - pub acss_debit_payments: Option, - - /// The affirm_payments capability. - #[serde(skip_serializing_if = "Option::is_none")] - pub affirm_payments: Option, - - /// The afterpay_clearpay_payments capability. - #[serde(skip_serializing_if = "Option::is_none")] - pub afterpay_clearpay_payments: Option, - - /// The au_becs_debit_payments capability. - #[serde(skip_serializing_if = "Option::is_none")] - pub au_becs_debit_payments: Option, - - /// The bacs_debit_payments capability. - #[serde(skip_serializing_if = "Option::is_none")] - pub bacs_debit_payments: Option, - - /// The bancontact_payments capability. - #[serde(skip_serializing_if = "Option::is_none")] - pub bancontact_payments: Option, - - /// The bank_transfer_payments capability. - #[serde(skip_serializing_if = "Option::is_none")] - pub bank_transfer_payments: Option, - - /// The blik_payments capability. - #[serde(skip_serializing_if = "Option::is_none")] - pub blik_payments: Option, - - /// The boleto_payments capability. - #[serde(skip_serializing_if = "Option::is_none")] - pub boleto_payments: Option, - - /// The card_issuing capability. - #[serde(skip_serializing_if = "Option::is_none")] - pub card_issuing: Option, - - /// The card_payments capability. - #[serde(skip_serializing_if = "Option::is_none")] - pub card_payments: Option, - - /// The cartes_bancaires_payments capability. - #[serde(skip_serializing_if = "Option::is_none")] - pub cartes_bancaires_payments: Option, - - /// The cashapp_payments capability. - #[serde(skip_serializing_if = "Option::is_none")] - pub cashapp_payments: Option, - - /// The eps_payments capability. - #[serde(skip_serializing_if = "Option::is_none")] - pub eps_payments: Option, - - /// The fpx_payments capability. - #[serde(skip_serializing_if = "Option::is_none")] - pub fpx_payments: Option, - - /// The giropay_payments capability. - #[serde(skip_serializing_if = "Option::is_none")] - pub giropay_payments: Option, - - /// The grabpay_payments capability. - #[serde(skip_serializing_if = "Option::is_none")] - pub grabpay_payments: Option, - - /// The ideal_payments capability. - #[serde(skip_serializing_if = "Option::is_none")] - pub ideal_payments: Option, - - /// The india_international_payments capability. - #[serde(skip_serializing_if = "Option::is_none")] - pub india_international_payments: Option, - - /// The jcb_payments capability. - #[serde(skip_serializing_if = "Option::is_none")] - pub jcb_payments: Option, - - /// The klarna_payments capability. - #[serde(skip_serializing_if = "Option::is_none")] - pub klarna_payments: Option, - - /// The konbini_payments capability. - #[serde(skip_serializing_if = "Option::is_none")] - pub konbini_payments: Option, - - /// The legacy_payments capability. - #[serde(skip_serializing_if = "Option::is_none")] - pub legacy_payments: Option, - - /// The link_payments capability. - #[serde(skip_serializing_if = "Option::is_none")] - pub link_payments: Option, - - /// The oxxo_payments capability. - #[serde(skip_serializing_if = "Option::is_none")] - pub oxxo_payments: Option, - - /// The p24_payments capability. - #[serde(skip_serializing_if = "Option::is_none")] - pub p24_payments: Option, - - /// The paynow_payments capability. - #[serde(skip_serializing_if = "Option::is_none")] - pub paynow_payments: Option, - - /// The promptpay_payments capability. - #[serde(skip_serializing_if = "Option::is_none")] - pub promptpay_payments: Option, - - /// The revolut_pay_payments capability. - #[serde(skip_serializing_if = "Option::is_none")] - pub revolut_pay_payments: Option, - - /// The sepa_debit_payments capability. - #[serde(skip_serializing_if = "Option::is_none")] - pub sepa_debit_payments: Option, - - /// The sofort_payments capability. - #[serde(skip_serializing_if = "Option::is_none")] - pub sofort_payments: Option, - - /// The swish_payments capability. - #[serde(skip_serializing_if = "Option::is_none")] - pub swish_payments: Option, - - /// The tax_reporting_us_1099_k capability. - #[serde(skip_serializing_if = "Option::is_none")] - pub tax_reporting_us_1099_k: Option, - - /// The tax_reporting_us_1099_misc capability. - #[serde(skip_serializing_if = "Option::is_none")] - pub tax_reporting_us_1099_misc: Option, - - /// The transfers capability. - #[serde(skip_serializing_if = "Option::is_none")] - pub transfers: Option, - - /// The treasury capability. - #[serde(skip_serializing_if = "Option::is_none")] - pub treasury: Option, - - /// The us_bank_account_ach_payments capability. - #[serde(skip_serializing_if = "Option::is_none")] - pub us_bank_account_ach_payments: Option, - - /// The zip_payments capability. - #[serde(skip_serializing_if = "Option::is_none")] - pub zip_payments: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreateAccountDocuments { - /// One or more documents that support the [Bank account ownership verification](https://support.stripe.com/questions/bank-account-ownership-verification) requirement. - /// - /// Must be a document associated with the account’s primary active bank account that displays the last 4 digits of the account number, either a statement or a voided check. - #[serde(skip_serializing_if = "Option::is_none")] - pub bank_account_ownership_verification: - Option, - - /// One or more documents that demonstrate proof of a company's license to operate. - #[serde(skip_serializing_if = "Option::is_none")] - pub company_license: Option, - - /// One or more documents showing the company's Memorandum of Association. - #[serde(skip_serializing_if = "Option::is_none")] - pub company_memorandum_of_association: - Option, - - /// (Certain countries only) One or more documents showing the ministerial decree legalizing the company's establishment. - #[serde(skip_serializing_if = "Option::is_none")] - pub company_ministerial_decree: Option, - - /// One or more documents that demonstrate proof of a company's registration with the appropriate local authorities. - #[serde(skip_serializing_if = "Option::is_none")] - pub company_registration_verification: - Option, - - /// One or more documents that demonstrate proof of a company's tax ID. - #[serde(skip_serializing_if = "Option::is_none")] - pub company_tax_id_verification: Option, - - /// One or more documents showing the company’s proof of registration with the national business registry. - #[serde(skip_serializing_if = "Option::is_none")] - pub proof_of_registration: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct PersonParams { - /// The individual's primary address. - #[serde(skip_serializing_if = "Option::is_none")] - pub address: Option
, - - /// The Kana variation of the the individual's primary address (Japan only). - #[serde(skip_serializing_if = "Option::is_none")] - pub address_kana: Option
, - - /// The Kanji variation of the the individual's primary address (Japan only). - #[serde(skip_serializing_if = "Option::is_none")] - pub address_kanji: Option
, - - /// The individual's date of birth. - #[serde(skip_serializing_if = "Option::is_none")] - pub dob: Option, - - /// The individual's email address. - #[serde(skip_serializing_if = "Option::is_none")] - pub email: Option, - - /// The individual's first name. - #[serde(skip_serializing_if = "Option::is_none")] - pub first_name: Option, - - /// The Kana variation of the the individual's first name (Japan only). - #[serde(skip_serializing_if = "Option::is_none")] - pub first_name_kana: Option, - - /// The Kanji variation of the individual's first name (Japan only). - #[serde(skip_serializing_if = "Option::is_none")] - pub first_name_kanji: Option, - - /// A list of alternate names or aliases that the individual is known by. - #[serde(skip_serializing_if = "Option::is_none")] - pub full_name_aliases: Option>, - - /// The individual's gender (International regulations require either "male" or "female"). - #[serde(skip_serializing_if = "Option::is_none")] - pub gender: Option, - - /// The government-issued ID number of the individual, as appropriate for the representative's country. - /// - /// (Examples are a Social Security Number in the U.S., or a Social Insurance Number in Canada). - /// Instead of the number itself, you can also provide a [PII token created with Stripe.js](https://stripe.com/docs/js/tokens/create_token?type=pii). - #[serde(skip_serializing_if = "Option::is_none")] - pub id_number: Option, - - /// The government-issued secondary ID number of the individual, as appropriate for the representative's country, will be used for enhanced verification checks. - /// - /// In Thailand, this would be the laser code found on the back of an ID card. - /// Instead of the number itself, you can also provide a [PII token created with Stripe.js](https://stripe.com/docs/js/tokens/create_token?type=pii). - #[serde(skip_serializing_if = "Option::is_none")] - pub id_number_secondary: Option, - - /// The individual's last name. - #[serde(skip_serializing_if = "Option::is_none")] - pub last_name: Option, - - /// The Kana variation of the individual's last name (Japan only). - #[serde(skip_serializing_if = "Option::is_none")] - pub last_name_kana: Option, - - /// The Kanji variation of the individual's last name (Japan only). - #[serde(skip_serializing_if = "Option::is_none")] - pub last_name_kanji: Option, - - /// The individual's maiden name. - #[serde(skip_serializing_if = "Option::is_none")] - pub maiden_name: Option, - - /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. - /// - /// This can be useful for storing additional information about the object in a structured format. - /// Individual keys can be unset by posting an empty value to them. - /// All keys can be unset by posting an empty value to `metadata`. - #[serde(skip_serializing_if = "Option::is_none")] - pub metadata: Option, - - /// The individual's phone number. - #[serde(skip_serializing_if = "Option::is_none")] - pub phone: Option, - - /// Indicates if the person or any of their representatives, family members, or other closely related persons, declares that they hold or have held an important public job or function, in any jurisdiction. - #[serde(skip_serializing_if = "Option::is_none")] - pub political_exposure: Option, - - /// The individual's registered address. - #[serde(skip_serializing_if = "Option::is_none")] - pub registered_address: Option, - - /// Describes the person’s relationship to the account. - #[serde(skip_serializing_if = "Option::is_none")] - pub relationship: Option, - - /// The last four digits of the individual's Social Security Number (U.S. - /// - /// only). - #[serde(skip_serializing_if = "Option::is_none")] - pub ssn_last_4: Option, - - /// The individual's verification document information. - #[serde(skip_serializing_if = "Option::is_none")] - pub verification: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UpdateAccountCapabilities { - /// The acss_debit_payments capability. - #[serde(skip_serializing_if = "Option::is_none")] - pub acss_debit_payments: Option, - - /// The affirm_payments capability. - #[serde(skip_serializing_if = "Option::is_none")] - pub affirm_payments: Option, - - /// The afterpay_clearpay_payments capability. - #[serde(skip_serializing_if = "Option::is_none")] - pub afterpay_clearpay_payments: Option, - - /// The au_becs_debit_payments capability. - #[serde(skip_serializing_if = "Option::is_none")] - pub au_becs_debit_payments: Option, - - /// The bacs_debit_payments capability. - #[serde(skip_serializing_if = "Option::is_none")] - pub bacs_debit_payments: Option, - - /// The bancontact_payments capability. - #[serde(skip_serializing_if = "Option::is_none")] - pub bancontact_payments: Option, - - /// The bank_transfer_payments capability. - #[serde(skip_serializing_if = "Option::is_none")] - pub bank_transfer_payments: Option, - - /// The blik_payments capability. - #[serde(skip_serializing_if = "Option::is_none")] - pub blik_payments: Option, - - /// The boleto_payments capability. - #[serde(skip_serializing_if = "Option::is_none")] - pub boleto_payments: Option, - - /// The card_issuing capability. - #[serde(skip_serializing_if = "Option::is_none")] - pub card_issuing: Option, - - /// The card_payments capability. - #[serde(skip_serializing_if = "Option::is_none")] - pub card_payments: Option, - - /// The cartes_bancaires_payments capability. - #[serde(skip_serializing_if = "Option::is_none")] - pub cartes_bancaires_payments: Option, - - /// The cashapp_payments capability. - #[serde(skip_serializing_if = "Option::is_none")] - pub cashapp_payments: Option, - - /// The eps_payments capability. - #[serde(skip_serializing_if = "Option::is_none")] - pub eps_payments: Option, - - /// The fpx_payments capability. - #[serde(skip_serializing_if = "Option::is_none")] - pub fpx_payments: Option, - - /// The giropay_payments capability. - #[serde(skip_serializing_if = "Option::is_none")] - pub giropay_payments: Option, - - /// The grabpay_payments capability. - #[serde(skip_serializing_if = "Option::is_none")] - pub grabpay_payments: Option, - - /// The ideal_payments capability. - #[serde(skip_serializing_if = "Option::is_none")] - pub ideal_payments: Option, - - /// The india_international_payments capability. - #[serde(skip_serializing_if = "Option::is_none")] - pub india_international_payments: Option, - - /// The jcb_payments capability. - #[serde(skip_serializing_if = "Option::is_none")] - pub jcb_payments: Option, - - /// The klarna_payments capability. - #[serde(skip_serializing_if = "Option::is_none")] - pub klarna_payments: Option, - - /// The konbini_payments capability. - #[serde(skip_serializing_if = "Option::is_none")] - pub konbini_payments: Option, - - /// The legacy_payments capability. - #[serde(skip_serializing_if = "Option::is_none")] - pub legacy_payments: Option, - - /// The link_payments capability. - #[serde(skip_serializing_if = "Option::is_none")] - pub link_payments: Option, - - /// The oxxo_payments capability. - #[serde(skip_serializing_if = "Option::is_none")] - pub oxxo_payments: Option, - - /// The p24_payments capability. - #[serde(skip_serializing_if = "Option::is_none")] - pub p24_payments: Option, - - /// The paynow_payments capability. - #[serde(skip_serializing_if = "Option::is_none")] - pub paynow_payments: Option, - - /// The promptpay_payments capability. - #[serde(skip_serializing_if = "Option::is_none")] - pub promptpay_payments: Option, - - /// The revolut_pay_payments capability. - #[serde(skip_serializing_if = "Option::is_none")] - pub revolut_pay_payments: Option, - - /// The sepa_debit_payments capability. - #[serde(skip_serializing_if = "Option::is_none")] - pub sepa_debit_payments: Option, - - /// The sofort_payments capability. - #[serde(skip_serializing_if = "Option::is_none")] - pub sofort_payments: Option, - - /// The swish_payments capability. - #[serde(skip_serializing_if = "Option::is_none")] - pub swish_payments: Option, - - /// The tax_reporting_us_1099_k capability. - #[serde(skip_serializing_if = "Option::is_none")] - pub tax_reporting_us_1099_k: Option, - - /// The tax_reporting_us_1099_misc capability. - #[serde(skip_serializing_if = "Option::is_none")] - pub tax_reporting_us_1099_misc: Option, - - /// The transfers capability. - #[serde(skip_serializing_if = "Option::is_none")] - pub transfers: Option, - - /// The treasury capability. - #[serde(skip_serializing_if = "Option::is_none")] - pub treasury: Option, - - /// The us_bank_account_ach_payments capability. - #[serde(skip_serializing_if = "Option::is_none")] - pub us_bank_account_ach_payments: Option, - - /// The zip_payments capability. - #[serde(skip_serializing_if = "Option::is_none")] - pub zip_payments: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UpdateAccountDocuments { - /// One or more documents that support the [Bank account ownership verification](https://support.stripe.com/questions/bank-account-ownership-verification) requirement. - /// - /// Must be a document associated with the account’s primary active bank account that displays the last 4 digits of the account number, either a statement or a voided check. - #[serde(skip_serializing_if = "Option::is_none")] - pub bank_account_ownership_verification: - Option, - - /// One or more documents that demonstrate proof of a company's license to operate. - #[serde(skip_serializing_if = "Option::is_none")] - pub company_license: Option, - - /// One or more documents showing the company's Memorandum of Association. - #[serde(skip_serializing_if = "Option::is_none")] - pub company_memorandum_of_association: - Option, - - /// (Certain countries only) One or more documents showing the ministerial decree legalizing the company's establishment. - #[serde(skip_serializing_if = "Option::is_none")] - pub company_ministerial_decree: Option, - - /// One or more documents that demonstrate proof of a company's registration with the appropriate local authorities. - #[serde(skip_serializing_if = "Option::is_none")] - pub company_registration_verification: - Option, - - /// One or more documents that demonstrate proof of a company's tax ID. - #[serde(skip_serializing_if = "Option::is_none")] - pub company_tax_id_verification: Option, - - /// One or more documents showing the company’s proof of registration with the national business registry. - #[serde(skip_serializing_if = "Option::is_none")] - pub proof_of_registration: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct AccountSettingsParamsBacsDebitPayments { - /// The Bacs Direct Debit Display Name for this account. - /// - /// For payments made with Bacs Direct Debit, this name appears on the mandate as the statement descriptor. - /// Mobile banking apps display it as the name of the business. - /// To use custom branding, set the Bacs Direct Debit Display Name during or right after creation. - /// Custom branding incurs an additional monthly fee for the platform. - /// If you don't set the display name before requesting Bacs capability, it's automatically set as "Stripe" and the account is onboarded to Stripe branding, which is free. - #[serde(skip_serializing_if = "Option::is_none")] - pub display_name: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct AccountSettingsParamsCardIssuing { - /// Details on the account's acceptance of the [Stripe Issuing Terms and Disclosures](https://stripe.com/docs/issuing/connect/tos_acceptance). - #[serde(skip_serializing_if = "Option::is_none")] - pub tos_acceptance: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct AccountSettingsParamsTreasury { - /// Details on the account's acceptance of the Stripe Treasury Services Agreement. - #[serde(skip_serializing_if = "Option::is_none")] - pub tos_acceptance: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct BrandingSettingsParams { - /// (ID of a [file upload](https://stripe.com/docs/guides/file-upload)) An icon for the account. - /// - /// Must be square and at least 128px x 128px. - #[serde(skip_serializing_if = "Option::is_none")] - pub icon: Option, - - /// (ID of a [file upload](https://stripe.com/docs/guides/file-upload)) A logo for the account that will be used in Checkout instead of the icon and without the account's name next to it if provided. - /// - /// Must be at least 128px x 128px. - #[serde(skip_serializing_if = "Option::is_none")] - pub logo: Option, - - /// A CSS hex color value representing the primary branding color for this account. - #[serde(skip_serializing_if = "Option::is_none")] - pub primary_color: Option, - - /// A CSS hex color value representing the secondary branding color for this account. - #[serde(skip_serializing_if = "Option::is_none")] - pub secondary_color: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CardPaymentsSettingsParams { - /// Automatically declines certain charge types regardless of whether the card issuer accepted or declined the charge. - #[serde(skip_serializing_if = "Option::is_none")] - pub decline_on: Option, - - /// The default text that appears on credit card statements when a charge is made. - /// - /// This field prefixes any dynamic `statement_descriptor` specified on the charge. - /// `statement_descriptor_prefix` is useful for maximizing descriptor space for the dynamic portion. - #[serde(skip_serializing_if = "Option::is_none")] - pub statement_descriptor_prefix: Option, - - /// The Kana variation of the default text that appears on credit card statements when a charge is made (Japan only). - /// - /// This field prefixes any dynamic `statement_descriptor_suffix_kana` specified on the charge. - /// `statement_descriptor_prefix_kana` is useful for maximizing descriptor space for the dynamic portion. - #[serde(skip_serializing_if = "Option::is_none")] - pub statement_descriptor_prefix_kana: Option, - - /// The Kanji variation of the default text that appears on credit card statements when a charge is made (Japan only). - /// - /// This field prefixes any dynamic `statement_descriptor_suffix_kanji` specified on the charge. - /// `statement_descriptor_prefix_kanji` is useful for maximizing descriptor space for the dynamic portion. - #[serde(skip_serializing_if = "Option::is_none")] - pub statement_descriptor_prefix_kanji: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CompanyParamsOwnershipDeclaration { - /// The Unix timestamp marking when the beneficial owner attestation was made. - #[serde(skip_serializing_if = "Option::is_none")] - pub date: Option, - - /// The IP address from which the beneficial owner attestation was made. - #[serde(skip_serializing_if = "Option::is_none")] - pub ip: Option, - - /// The user agent of the browser from which the beneficial owner attestation was made. - #[serde(skip_serializing_if = "Option::is_none")] - pub user_agent: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CompanyVerificationParams { - /// A document verifying the business. - #[serde(skip_serializing_if = "Option::is_none")] - pub document: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreateAccountCapabilitiesAcssDebitPayments { - /// Passing true requests the capability for the account, if it is not already requested. - /// - /// A requested capability may not immediately become active. - /// Any requirements to activate the capability are returned in the `requirements` arrays. - #[serde(skip_serializing_if = "Option::is_none")] - pub requested: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreateAccountCapabilitiesAffirmPayments { - /// Passing true requests the capability for the account, if it is not already requested. - /// - /// A requested capability may not immediately become active. - /// Any requirements to activate the capability are returned in the `requirements` arrays. - #[serde(skip_serializing_if = "Option::is_none")] - pub requested: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreateAccountCapabilitiesAfterpayClearpayPayments { - /// Passing true requests the capability for the account, if it is not already requested. - /// - /// A requested capability may not immediately become active. - /// Any requirements to activate the capability are returned in the `requirements` arrays. - #[serde(skip_serializing_if = "Option::is_none")] - pub requested: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreateAccountCapabilitiesAuBecsDebitPayments { - /// Passing true requests the capability for the account, if it is not already requested. - /// - /// A requested capability may not immediately become active. - /// Any requirements to activate the capability are returned in the `requirements` arrays. - #[serde(skip_serializing_if = "Option::is_none")] - pub requested: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreateAccountCapabilitiesBacsDebitPayments { - /// Passing true requests the capability for the account, if it is not already requested. - /// - /// A requested capability may not immediately become active. - /// Any requirements to activate the capability are returned in the `requirements` arrays. - #[serde(skip_serializing_if = "Option::is_none")] - pub requested: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreateAccountCapabilitiesBancontactPayments { - /// Passing true requests the capability for the account, if it is not already requested. - /// - /// A requested capability may not immediately become active. - /// Any requirements to activate the capability are returned in the `requirements` arrays. - #[serde(skip_serializing_if = "Option::is_none")] - pub requested: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreateAccountCapabilitiesBankTransferPayments { - /// Passing true requests the capability for the account, if it is not already requested. - /// - /// A requested capability may not immediately become active. - /// Any requirements to activate the capability are returned in the `requirements` arrays. - #[serde(skip_serializing_if = "Option::is_none")] - pub requested: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreateAccountCapabilitiesBlikPayments { - /// Passing true requests the capability for the account, if it is not already requested. - /// - /// A requested capability may not immediately become active. - /// Any requirements to activate the capability are returned in the `requirements` arrays. - #[serde(skip_serializing_if = "Option::is_none")] - pub requested: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreateAccountCapabilitiesBoletoPayments { - /// Passing true requests the capability for the account, if it is not already requested. - /// - /// A requested capability may not immediately become active. - /// Any requirements to activate the capability are returned in the `requirements` arrays. - #[serde(skip_serializing_if = "Option::is_none")] - pub requested: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreateAccountCapabilitiesCardIssuing { - /// Passing true requests the capability for the account, if it is not already requested. - /// - /// A requested capability may not immediately become active. - /// Any requirements to activate the capability are returned in the `requirements` arrays. - #[serde(skip_serializing_if = "Option::is_none")] - pub requested: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreateAccountCapabilitiesCardPayments { - /// Passing true requests the capability for the account, if it is not already requested. - /// - /// A requested capability may not immediately become active. - /// Any requirements to activate the capability are returned in the `requirements` arrays. - #[serde(skip_serializing_if = "Option::is_none")] - pub requested: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreateAccountCapabilitiesCartesBancairesPayments { - /// Passing true requests the capability for the account, if it is not already requested. - /// - /// A requested capability may not immediately become active. - /// Any requirements to activate the capability are returned in the `requirements` arrays. - #[serde(skip_serializing_if = "Option::is_none")] - pub requested: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreateAccountCapabilitiesCashappPayments { - /// Passing true requests the capability for the account, if it is not already requested. - /// - /// A requested capability may not immediately become active. - /// Any requirements to activate the capability are returned in the `requirements` arrays. - #[serde(skip_serializing_if = "Option::is_none")] - pub requested: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreateAccountCapabilitiesEpsPayments { - /// Passing true requests the capability for the account, if it is not already requested. - /// - /// A requested capability may not immediately become active. - /// Any requirements to activate the capability are returned in the `requirements` arrays. - #[serde(skip_serializing_if = "Option::is_none")] - pub requested: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreateAccountCapabilitiesFpxPayments { - /// Passing true requests the capability for the account, if it is not already requested. - /// - /// A requested capability may not immediately become active. - /// Any requirements to activate the capability are returned in the `requirements` arrays. - #[serde(skip_serializing_if = "Option::is_none")] - pub requested: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreateAccountCapabilitiesGiropayPayments { - /// Passing true requests the capability for the account, if it is not already requested. - /// - /// A requested capability may not immediately become active. - /// Any requirements to activate the capability are returned in the `requirements` arrays. - #[serde(skip_serializing_if = "Option::is_none")] - pub requested: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreateAccountCapabilitiesGrabpayPayments { - /// Passing true requests the capability for the account, if it is not already requested. - /// - /// A requested capability may not immediately become active. - /// Any requirements to activate the capability are returned in the `requirements` arrays. - #[serde(skip_serializing_if = "Option::is_none")] - pub requested: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreateAccountCapabilitiesIdealPayments { - /// Passing true requests the capability for the account, if it is not already requested. - /// - /// A requested capability may not immediately become active. - /// Any requirements to activate the capability are returned in the `requirements` arrays. - #[serde(skip_serializing_if = "Option::is_none")] - pub requested: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreateAccountCapabilitiesIndiaInternationalPayments { - /// Passing true requests the capability for the account, if it is not already requested. - /// - /// A requested capability may not immediately become active. - /// Any requirements to activate the capability are returned in the `requirements` arrays. - #[serde(skip_serializing_if = "Option::is_none")] - pub requested: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreateAccountCapabilitiesJcbPayments { - /// Passing true requests the capability for the account, if it is not already requested. - /// - /// A requested capability may not immediately become active. - /// Any requirements to activate the capability are returned in the `requirements` arrays. - #[serde(skip_serializing_if = "Option::is_none")] - pub requested: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreateAccountCapabilitiesKlarnaPayments { - /// Passing true requests the capability for the account, if it is not already requested. - /// - /// A requested capability may not immediately become active. - /// Any requirements to activate the capability are returned in the `requirements` arrays. - #[serde(skip_serializing_if = "Option::is_none")] - pub requested: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreateAccountCapabilitiesKonbiniPayments { - /// Passing true requests the capability for the account, if it is not already requested. - /// - /// A requested capability may not immediately become active. - /// Any requirements to activate the capability are returned in the `requirements` arrays. - #[serde(skip_serializing_if = "Option::is_none")] - pub requested: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreateAccountCapabilitiesLegacyPayments { - /// Passing true requests the capability for the account, if it is not already requested. - /// - /// A requested capability may not immediately become active. - /// Any requirements to activate the capability are returned in the `requirements` arrays. - #[serde(skip_serializing_if = "Option::is_none")] - pub requested: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreateAccountCapabilitiesLinkPayments { - /// Passing true requests the capability for the account, if it is not already requested. - /// - /// A requested capability may not immediately become active. - /// Any requirements to activate the capability are returned in the `requirements` arrays. - #[serde(skip_serializing_if = "Option::is_none")] - pub requested: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreateAccountCapabilitiesOxxoPayments { - /// Passing true requests the capability for the account, if it is not already requested. - /// - /// A requested capability may not immediately become active. - /// Any requirements to activate the capability are returned in the `requirements` arrays. - #[serde(skip_serializing_if = "Option::is_none")] - pub requested: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreateAccountCapabilitiesP24Payments { - /// Passing true requests the capability for the account, if it is not already requested. - /// - /// A requested capability may not immediately become active. - /// Any requirements to activate the capability are returned in the `requirements` arrays. - #[serde(skip_serializing_if = "Option::is_none")] - pub requested: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreateAccountCapabilitiesPaynowPayments { - /// Passing true requests the capability for the account, if it is not already requested. - /// - /// A requested capability may not immediately become active. - /// Any requirements to activate the capability are returned in the `requirements` arrays. - #[serde(skip_serializing_if = "Option::is_none")] - pub requested: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreateAccountCapabilitiesPromptpayPayments { - /// Passing true requests the capability for the account, if it is not already requested. - /// - /// A requested capability may not immediately become active. - /// Any requirements to activate the capability are returned in the `requirements` arrays. - #[serde(skip_serializing_if = "Option::is_none")] - pub requested: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreateAccountCapabilitiesRevolutPayPayments { - /// Passing true requests the capability for the account, if it is not already requested. - /// - /// A requested capability may not immediately become active. - /// Any requirements to activate the capability are returned in the `requirements` arrays. - #[serde(skip_serializing_if = "Option::is_none")] - pub requested: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreateAccountCapabilitiesSepaDebitPayments { - /// Passing true requests the capability for the account, if it is not already requested. - /// - /// A requested capability may not immediately become active. - /// Any requirements to activate the capability are returned in the `requirements` arrays. - #[serde(skip_serializing_if = "Option::is_none")] - pub requested: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreateAccountCapabilitiesSofortPayments { - /// Passing true requests the capability for the account, if it is not already requested. - /// - /// A requested capability may not immediately become active. - /// Any requirements to activate the capability are returned in the `requirements` arrays. - #[serde(skip_serializing_if = "Option::is_none")] - pub requested: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreateAccountCapabilitiesSwishPayments { - /// Passing true requests the capability for the account, if it is not already requested. - /// - /// A requested capability may not immediately become active. - /// Any requirements to activate the capability are returned in the `requirements` arrays. - #[serde(skip_serializing_if = "Option::is_none")] - pub requested: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreateAccountCapabilitiesTaxReportingUs1099K { - /// Passing true requests the capability for the account, if it is not already requested. - /// - /// A requested capability may not immediately become active. - /// Any requirements to activate the capability are returned in the `requirements` arrays. - #[serde(skip_serializing_if = "Option::is_none")] - pub requested: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreateAccountCapabilitiesTaxReportingUs1099Misc { - /// Passing true requests the capability for the account, if it is not already requested. - /// - /// A requested capability may not immediately become active. - /// Any requirements to activate the capability are returned in the `requirements` arrays. - #[serde(skip_serializing_if = "Option::is_none")] - pub requested: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreateAccountCapabilitiesTransfers { - /// Passing true requests the capability for the account, if it is not already requested. - /// - /// A requested capability may not immediately become active. - /// Any requirements to activate the capability are returned in the `requirements` arrays. - #[serde(skip_serializing_if = "Option::is_none")] - pub requested: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreateAccountCapabilitiesTreasury { - /// Passing true requests the capability for the account, if it is not already requested. - /// - /// A requested capability may not immediately become active. - /// Any requirements to activate the capability are returned in the `requirements` arrays. - #[serde(skip_serializing_if = "Option::is_none")] - pub requested: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreateAccountCapabilitiesUsBankAccountAchPayments { - /// Passing true requests the capability for the account, if it is not already requested. - /// - /// A requested capability may not immediately become active. - /// Any requirements to activate the capability are returned in the `requirements` arrays. - #[serde(skip_serializing_if = "Option::is_none")] - pub requested: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreateAccountCapabilitiesZipPayments { - /// Passing true requests the capability for the account, if it is not already requested. - /// - /// A requested capability may not immediately become active. - /// Any requirements to activate the capability are returned in the `requirements` arrays. - #[serde(skip_serializing_if = "Option::is_none")] - pub requested: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreateAccountDocumentsBankAccountOwnershipVerification { - /// One or more document ids returned by a [file upload](https://stripe.com/docs/api#create_file) with a `purpose` value of `account_requirement`. - #[serde(skip_serializing_if = "Option::is_none")] - pub files: Option>, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreateAccountDocumentsCompanyLicense { - /// One or more document ids returned by a [file upload](https://stripe.com/docs/api#create_file) with a `purpose` value of `account_requirement`. - #[serde(skip_serializing_if = "Option::is_none")] - pub files: Option>, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreateAccountDocumentsCompanyMemorandumOfAssociation { - /// One or more document ids returned by a [file upload](https://stripe.com/docs/api#create_file) with a `purpose` value of `account_requirement`. - #[serde(skip_serializing_if = "Option::is_none")] - pub files: Option>, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreateAccountDocumentsCompanyMinisterialDecree { - /// One or more document ids returned by a [file upload](https://stripe.com/docs/api#create_file) with a `purpose` value of `account_requirement`. - #[serde(skip_serializing_if = "Option::is_none")] - pub files: Option>, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreateAccountDocumentsCompanyRegistrationVerification { - /// One or more document ids returned by a [file upload](https://stripe.com/docs/api#create_file) with a `purpose` value of `account_requirement`. - #[serde(skip_serializing_if = "Option::is_none")] - pub files: Option>, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreateAccountDocumentsCompanyTaxIdVerification { - /// One or more document ids returned by a [file upload](https://stripe.com/docs/api#create_file) with a `purpose` value of `account_requirement`. - #[serde(skip_serializing_if = "Option::is_none")] - pub files: Option>, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreateAccountDocumentsProofOfRegistration { - /// One or more document ids returned by a [file upload](https://stripe.com/docs/api#create_file) with a `purpose` value of `account_requirement`. - #[serde(skip_serializing_if = "Option::is_none")] - pub files: Option>, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct PaymentsSettingsParams { - /// The default text that appears on credit card statements when a charge is made. - /// - /// This field prefixes any dynamic `statement_descriptor` specified on the charge. - #[serde(skip_serializing_if = "Option::is_none")] - pub statement_descriptor: Option, - - /// The Kana variation of the default text that appears on credit card statements when a charge is made (Japan only). - #[serde(skip_serializing_if = "Option::is_none")] - pub statement_descriptor_kana: Option, - - /// The Kanji variation of the default text that appears on credit card statements when a charge is made (Japan only). - #[serde(skip_serializing_if = "Option::is_none")] - pub statement_descriptor_kanji: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct PayoutSettingsParams { - /// A Boolean indicating whether Stripe should try to reclaim negative balances from an attached bank account. - /// - /// For details, see [Understanding Connect Account Balances](https://stripe.com/docs/connect/account-balances). - #[serde(skip_serializing_if = "Option::is_none")] - pub debit_negative_balances: Option, - - /// Details on when funds from charges are available, and when they are paid out to an external account. - /// - /// For details, see our [Setting Bank and Debit Card Payouts](https://stripe.com/docs/connect/bank-transfers#payout-information) documentation. - #[serde(skip_serializing_if = "Option::is_none")] - pub schedule: Option, - - /// The text that appears on the bank account statement for payouts. - /// - /// If not set, this defaults to the platform's bank descriptor as set in the Dashboard. - #[serde(skip_serializing_if = "Option::is_none")] - pub statement_descriptor: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct PersonParamsDob { - /// The day of birth, between 1 and 31. - pub day: i64, - - /// The month of birth, between 1 and 12. - pub month: i64, - - /// The four-digit year of birth. - pub year: i64, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct PersonParamsRegisteredAddress { - /// City, district, suburb, town, or village. - #[serde(skip_serializing_if = "Option::is_none")] - pub city: Option, - - /// Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). - #[serde(skip_serializing_if = "Option::is_none")] - pub country: Option, - - /// Address line 1 (e.g., street, PO Box, or company name). - #[serde(skip_serializing_if = "Option::is_none")] - pub line1: Option, - - /// Address line 2 (e.g., apartment, suite, unit, or building). - #[serde(skip_serializing_if = "Option::is_none")] - pub line2: Option, - - /// ZIP or postal code. - #[serde(skip_serializing_if = "Option::is_none")] - pub postal_code: Option, - - /// State, county, province, or region. - #[serde(skip_serializing_if = "Option::is_none")] - pub state: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct PersonParamsRelationship { - /// Whether the person is a director of the account's legal entity. - /// - /// Directors are typically members of the governing board of the company, or responsible for ensuring the company meets its regulatory obligations. - #[serde(skip_serializing_if = "Option::is_none")] - pub director: Option, - - /// Whether the person has significant responsibility to control, manage, or direct the organization. - #[serde(skip_serializing_if = "Option::is_none")] - pub executive: Option, - - /// Whether the person is an owner of the account’s legal entity. - #[serde(skip_serializing_if = "Option::is_none")] - pub owner: Option, - - /// The percent owned by the person of the account's legal entity. - #[serde(skip_serializing_if = "Option::is_none")] - pub percent_ownership: Option, - - /// The person's title (e.g., CEO, Support Engineer). - #[serde(skip_serializing_if = "Option::is_none")] - pub title: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UpdateAccountCapabilitiesAcssDebitPayments { - /// Passing true requests the capability for the account, if it is not already requested. - /// - /// A requested capability may not immediately become active. - /// Any requirements to activate the capability are returned in the `requirements` arrays. - #[serde(skip_serializing_if = "Option::is_none")] - pub requested: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UpdateAccountCapabilitiesAffirmPayments { - /// Passing true requests the capability for the account, if it is not already requested. - /// - /// A requested capability may not immediately become active. - /// Any requirements to activate the capability are returned in the `requirements` arrays. - #[serde(skip_serializing_if = "Option::is_none")] - pub requested: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UpdateAccountCapabilitiesAfterpayClearpayPayments { - /// Passing true requests the capability for the account, if it is not already requested. - /// - /// A requested capability may not immediately become active. - /// Any requirements to activate the capability are returned in the `requirements` arrays. - #[serde(skip_serializing_if = "Option::is_none")] - pub requested: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UpdateAccountCapabilitiesAuBecsDebitPayments { - /// Passing true requests the capability for the account, if it is not already requested. - /// - /// A requested capability may not immediately become active. - /// Any requirements to activate the capability are returned in the `requirements` arrays. - #[serde(skip_serializing_if = "Option::is_none")] - pub requested: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UpdateAccountCapabilitiesBacsDebitPayments { - /// Passing true requests the capability for the account, if it is not already requested. - /// - /// A requested capability may not immediately become active. - /// Any requirements to activate the capability are returned in the `requirements` arrays. - #[serde(skip_serializing_if = "Option::is_none")] - pub requested: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UpdateAccountCapabilitiesBancontactPayments { - /// Passing true requests the capability for the account, if it is not already requested. - /// - /// A requested capability may not immediately become active. - /// Any requirements to activate the capability are returned in the `requirements` arrays. - #[serde(skip_serializing_if = "Option::is_none")] - pub requested: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UpdateAccountCapabilitiesBankTransferPayments { - /// Passing true requests the capability for the account, if it is not already requested. - /// - /// A requested capability may not immediately become active. - /// Any requirements to activate the capability are returned in the `requirements` arrays. - #[serde(skip_serializing_if = "Option::is_none")] - pub requested: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UpdateAccountCapabilitiesBlikPayments { - /// Passing true requests the capability for the account, if it is not already requested. - /// - /// A requested capability may not immediately become active. - /// Any requirements to activate the capability are returned in the `requirements` arrays. - #[serde(skip_serializing_if = "Option::is_none")] - pub requested: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UpdateAccountCapabilitiesBoletoPayments { - /// Passing true requests the capability for the account, if it is not already requested. - /// - /// A requested capability may not immediately become active. - /// Any requirements to activate the capability are returned in the `requirements` arrays. - #[serde(skip_serializing_if = "Option::is_none")] - pub requested: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UpdateAccountCapabilitiesCardIssuing { - /// Passing true requests the capability for the account, if it is not already requested. - /// - /// A requested capability may not immediately become active. - /// Any requirements to activate the capability are returned in the `requirements` arrays. - #[serde(skip_serializing_if = "Option::is_none")] - pub requested: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UpdateAccountCapabilitiesCardPayments { - /// Passing true requests the capability for the account, if it is not already requested. - /// - /// A requested capability may not immediately become active. - /// Any requirements to activate the capability are returned in the `requirements` arrays. - #[serde(skip_serializing_if = "Option::is_none")] - pub requested: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UpdateAccountCapabilitiesCartesBancairesPayments { - /// Passing true requests the capability for the account, if it is not already requested. - /// - /// A requested capability may not immediately become active. - /// Any requirements to activate the capability are returned in the `requirements` arrays. - #[serde(skip_serializing_if = "Option::is_none")] - pub requested: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UpdateAccountCapabilitiesCashappPayments { - /// Passing true requests the capability for the account, if it is not already requested. - /// - /// A requested capability may not immediately become active. - /// Any requirements to activate the capability are returned in the `requirements` arrays. - #[serde(skip_serializing_if = "Option::is_none")] - pub requested: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UpdateAccountCapabilitiesEpsPayments { - /// Passing true requests the capability for the account, if it is not already requested. - /// - /// A requested capability may not immediately become active. - /// Any requirements to activate the capability are returned in the `requirements` arrays. - #[serde(skip_serializing_if = "Option::is_none")] - pub requested: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UpdateAccountCapabilitiesFpxPayments { - /// Passing true requests the capability for the account, if it is not already requested. - /// - /// A requested capability may not immediately become active. - /// Any requirements to activate the capability are returned in the `requirements` arrays. - #[serde(skip_serializing_if = "Option::is_none")] - pub requested: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UpdateAccountCapabilitiesGiropayPayments { - /// Passing true requests the capability for the account, if it is not already requested. - /// - /// A requested capability may not immediately become active. - /// Any requirements to activate the capability are returned in the `requirements` arrays. - #[serde(skip_serializing_if = "Option::is_none")] - pub requested: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UpdateAccountCapabilitiesGrabpayPayments { - /// Passing true requests the capability for the account, if it is not already requested. - /// - /// A requested capability may not immediately become active. - /// Any requirements to activate the capability are returned in the `requirements` arrays. - #[serde(skip_serializing_if = "Option::is_none")] - pub requested: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UpdateAccountCapabilitiesIdealPayments { - /// Passing true requests the capability for the account, if it is not already requested. - /// - /// A requested capability may not immediately become active. - /// Any requirements to activate the capability are returned in the `requirements` arrays. - #[serde(skip_serializing_if = "Option::is_none")] - pub requested: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UpdateAccountCapabilitiesIndiaInternationalPayments { - /// Passing true requests the capability for the account, if it is not already requested. - /// - /// A requested capability may not immediately become active. - /// Any requirements to activate the capability are returned in the `requirements` arrays. - #[serde(skip_serializing_if = "Option::is_none")] - pub requested: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UpdateAccountCapabilitiesJcbPayments { - /// Passing true requests the capability for the account, if it is not already requested. - /// - /// A requested capability may not immediately become active. - /// Any requirements to activate the capability are returned in the `requirements` arrays. - #[serde(skip_serializing_if = "Option::is_none")] - pub requested: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UpdateAccountCapabilitiesKlarnaPayments { - /// Passing true requests the capability for the account, if it is not already requested. - /// - /// A requested capability may not immediately become active. - /// Any requirements to activate the capability are returned in the `requirements` arrays. - #[serde(skip_serializing_if = "Option::is_none")] - pub requested: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UpdateAccountCapabilitiesKonbiniPayments { - /// Passing true requests the capability for the account, if it is not already requested. - /// - /// A requested capability may not immediately become active. - /// Any requirements to activate the capability are returned in the `requirements` arrays. - #[serde(skip_serializing_if = "Option::is_none")] - pub requested: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UpdateAccountCapabilitiesLegacyPayments { - /// Passing true requests the capability for the account, if it is not already requested. - /// - /// A requested capability may not immediately become active. - /// Any requirements to activate the capability are returned in the `requirements` arrays. - #[serde(skip_serializing_if = "Option::is_none")] - pub requested: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UpdateAccountCapabilitiesLinkPayments { - /// Passing true requests the capability for the account, if it is not already requested. - /// - /// A requested capability may not immediately become active. - /// Any requirements to activate the capability are returned in the `requirements` arrays. - #[serde(skip_serializing_if = "Option::is_none")] - pub requested: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UpdateAccountCapabilitiesOxxoPayments { - /// Passing true requests the capability for the account, if it is not already requested. - /// - /// A requested capability may not immediately become active. - /// Any requirements to activate the capability are returned in the `requirements` arrays. - #[serde(skip_serializing_if = "Option::is_none")] - pub requested: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UpdateAccountCapabilitiesP24Payments { - /// Passing true requests the capability for the account, if it is not already requested. - /// - /// A requested capability may not immediately become active. - /// Any requirements to activate the capability are returned in the `requirements` arrays. - #[serde(skip_serializing_if = "Option::is_none")] - pub requested: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UpdateAccountCapabilitiesPaynowPayments { - /// Passing true requests the capability for the account, if it is not already requested. - /// - /// A requested capability may not immediately become active. - /// Any requirements to activate the capability are returned in the `requirements` arrays. - #[serde(skip_serializing_if = "Option::is_none")] - pub requested: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UpdateAccountCapabilitiesPromptpayPayments { - /// Passing true requests the capability for the account, if it is not already requested. - /// - /// A requested capability may not immediately become active. - /// Any requirements to activate the capability are returned in the `requirements` arrays. - #[serde(skip_serializing_if = "Option::is_none")] - pub requested: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UpdateAccountCapabilitiesRevolutPayPayments { - /// Passing true requests the capability for the account, if it is not already requested. - /// - /// A requested capability may not immediately become active. - /// Any requirements to activate the capability are returned in the `requirements` arrays. - #[serde(skip_serializing_if = "Option::is_none")] - pub requested: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UpdateAccountCapabilitiesSepaDebitPayments { - /// Passing true requests the capability for the account, if it is not already requested. - /// - /// A requested capability may not immediately become active. - /// Any requirements to activate the capability are returned in the `requirements` arrays. - #[serde(skip_serializing_if = "Option::is_none")] - pub requested: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UpdateAccountCapabilitiesSofortPayments { - /// Passing true requests the capability for the account, if it is not already requested. - /// - /// A requested capability may not immediately become active. - /// Any requirements to activate the capability are returned in the `requirements` arrays. - #[serde(skip_serializing_if = "Option::is_none")] - pub requested: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UpdateAccountCapabilitiesSwishPayments { - /// Passing true requests the capability for the account, if it is not already requested. - /// - /// A requested capability may not immediately become active. - /// Any requirements to activate the capability are returned in the `requirements` arrays. - #[serde(skip_serializing_if = "Option::is_none")] - pub requested: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UpdateAccountCapabilitiesTaxReportingUs1099K { - /// Passing true requests the capability for the account, if it is not already requested. - /// - /// A requested capability may not immediately become active. - /// Any requirements to activate the capability are returned in the `requirements` arrays. - #[serde(skip_serializing_if = "Option::is_none")] - pub requested: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UpdateAccountCapabilitiesTaxReportingUs1099Misc { - /// Passing true requests the capability for the account, if it is not already requested. - /// - /// A requested capability may not immediately become active. - /// Any requirements to activate the capability are returned in the `requirements` arrays. - #[serde(skip_serializing_if = "Option::is_none")] - pub requested: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UpdateAccountCapabilitiesTransfers { - /// Passing true requests the capability for the account, if it is not already requested. - /// - /// A requested capability may not immediately become active. - /// Any requirements to activate the capability are returned in the `requirements` arrays. - #[serde(skip_serializing_if = "Option::is_none")] - pub requested: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UpdateAccountCapabilitiesTreasury { - /// Passing true requests the capability for the account, if it is not already requested. - /// - /// A requested capability may not immediately become active. - /// Any requirements to activate the capability are returned in the `requirements` arrays. - #[serde(skip_serializing_if = "Option::is_none")] - pub requested: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UpdateAccountCapabilitiesUsBankAccountAchPayments { - /// Passing true requests the capability for the account, if it is not already requested. - /// - /// A requested capability may not immediately become active. - /// Any requirements to activate the capability are returned in the `requirements` arrays. - #[serde(skip_serializing_if = "Option::is_none")] - pub requested: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UpdateAccountCapabilitiesZipPayments { - /// Passing true requests the capability for the account, if it is not already requested. - /// - /// A requested capability may not immediately become active. - /// Any requirements to activate the capability are returned in the `requirements` arrays. - #[serde(skip_serializing_if = "Option::is_none")] - pub requested: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UpdateAccountDocumentsBankAccountOwnershipVerification { - /// One or more document ids returned by a [file upload](https://stripe.com/docs/api#create_file) with a `purpose` value of `account_requirement`. - #[serde(skip_serializing_if = "Option::is_none")] - pub files: Option>, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UpdateAccountDocumentsCompanyLicense { - /// One or more document ids returned by a [file upload](https://stripe.com/docs/api#create_file) with a `purpose` value of `account_requirement`. - #[serde(skip_serializing_if = "Option::is_none")] - pub files: Option>, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UpdateAccountDocumentsCompanyMemorandumOfAssociation { - /// One or more document ids returned by a [file upload](https://stripe.com/docs/api#create_file) with a `purpose` value of `account_requirement`. - #[serde(skip_serializing_if = "Option::is_none")] - pub files: Option>, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UpdateAccountDocumentsCompanyMinisterialDecree { - /// One or more document ids returned by a [file upload](https://stripe.com/docs/api#create_file) with a `purpose` value of `account_requirement`. - #[serde(skip_serializing_if = "Option::is_none")] - pub files: Option>, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UpdateAccountDocumentsCompanyRegistrationVerification { - /// One or more document ids returned by a [file upload](https://stripe.com/docs/api#create_file) with a `purpose` value of `account_requirement`. - #[serde(skip_serializing_if = "Option::is_none")] - pub files: Option>, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UpdateAccountDocumentsCompanyTaxIdVerification { - /// One or more document ids returned by a [file upload](https://stripe.com/docs/api#create_file) with a `purpose` value of `account_requirement`. - #[serde(skip_serializing_if = "Option::is_none")] - pub files: Option>, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UpdateAccountDocumentsProofOfRegistration { - /// One or more document ids returned by a [file upload](https://stripe.com/docs/api#create_file) with a `purpose` value of `account_requirement`. - #[serde(skip_serializing_if = "Option::is_none")] - pub files: Option>, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct AccountSettingsParamsCardIssuingTosAcceptance { - /// The Unix timestamp marking when the account representative accepted the service agreement. - #[serde(skip_serializing_if = "Option::is_none")] - pub date: Option, - - /// The IP address from which the account representative accepted the service agreement. - #[serde(skip_serializing_if = "Option::is_none")] - pub ip: Option, - - /// The user agent of the browser from which the account representative accepted the service agreement. - #[serde(skip_serializing_if = "Option::is_none")] - pub user_agent: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct AccountSettingsParamsTreasuryTosAcceptance { - /// The Unix timestamp marking when the account representative accepted the service agreement. - #[serde(skip_serializing_if = "Option::is_none")] - pub date: Option, - - /// The IP address from which the account representative accepted the service agreement. - #[serde(skip_serializing_if = "Option::is_none")] - pub ip: Option, - - /// The user agent of the browser from which the account representative accepted the service agreement. - #[serde(skip_serializing_if = "Option::is_none")] - pub user_agent: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct DeclineChargeOnParams { - /// Whether Stripe automatically declines charges with an incorrect ZIP or postal code. - /// - /// This setting only applies when a ZIP or postal code is provided and they fail bank verification. - #[serde(skip_serializing_if = "Option::is_none")] - pub avs_failure: Option, - - /// Whether Stripe automatically declines charges with an incorrect CVC. - /// - /// This setting only applies when a CVC is provided and it fails bank verification. - #[serde(skip_serializing_if = "Option::is_none")] - pub cvc_failure: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct TransferScheduleParams { - /// The number of days charge funds are held before being paid out. - /// - /// May also be set to `minimum`, representing the lowest available value for the account country. - /// Default is `minimum`. - /// The `delay_days` parameter remains at the last configured value if `interval` is `manual`. - /// [Learn more about controlling payout delay days](https://stripe.com/docs/connect/manage-payout-schedule). - #[serde(skip_serializing_if = "Option::is_none")] - pub delay_days: Option, - - /// How frequently available funds are paid out. - /// - /// One of: `daily`, `manual`, `weekly`, or `monthly`. - /// Default is `daily`. - #[serde(skip_serializing_if = "Option::is_none")] - pub interval: Option, - - /// The day of the month when available funds are paid out, specified as a number between 1--31. - /// - /// Payouts nominally scheduled between the 29th and 31st of the month are instead sent on the last day of a shorter month. - /// Required and applicable only if `interval` is `monthly`. - #[serde(skip_serializing_if = "Option::is_none")] - pub monthly_anchor: Option, - - /// The day of the week when available funds are paid out, specified as `monday`, `tuesday`, etc. - /// - /// (required and applicable only if `interval` is `weekly`.). - #[serde(skip_serializing_if = "Option::is_none")] - pub weekly_anchor: Option, -} - -/// An enum representing the possible values of an `Account`'s `business_type` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum AccountBusinessType { - Company, - GovernmentEntity, - Individual, - NonProfit, -} - -impl AccountBusinessType { - pub fn as_str(self) -> &'static str { - match self { - AccountBusinessType::Company => "company", - AccountBusinessType::GovernmentEntity => "government_entity", - AccountBusinessType::Individual => "individual", - AccountBusinessType::NonProfit => "non_profit", - } - } -} - -impl AsRef for AccountBusinessType { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for AccountBusinessType { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for AccountBusinessType { - fn default() -> Self { - Self::Company - } -} - -/// An enum representing the possible values of an `AccountCapabilities`'s `acss_debit_payments` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum AccountCapabilitiesAcssDebitPayments { - Active, - Inactive, - Pending, -} - -impl AccountCapabilitiesAcssDebitPayments { - pub fn as_str(self) -> &'static str { - match self { - AccountCapabilitiesAcssDebitPayments::Active => "active", - AccountCapabilitiesAcssDebitPayments::Inactive => "inactive", - AccountCapabilitiesAcssDebitPayments::Pending => "pending", - } - } -} - -impl AsRef for AccountCapabilitiesAcssDebitPayments { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for AccountCapabilitiesAcssDebitPayments { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for AccountCapabilitiesAcssDebitPayments { - fn default() -> Self { - Self::Active - } -} - -/// An enum representing the possible values of an `AccountCapabilities`'s `affirm_payments` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum AccountCapabilitiesAffirmPayments { - Active, - Inactive, - Pending, -} - -impl AccountCapabilitiesAffirmPayments { - pub fn as_str(self) -> &'static str { - match self { - AccountCapabilitiesAffirmPayments::Active => "active", - AccountCapabilitiesAffirmPayments::Inactive => "inactive", - AccountCapabilitiesAffirmPayments::Pending => "pending", - } - } -} - -impl AsRef for AccountCapabilitiesAffirmPayments { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for AccountCapabilitiesAffirmPayments { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for AccountCapabilitiesAffirmPayments { - fn default() -> Self { - Self::Active - } -} - -/// An enum representing the possible values of an `AccountCapabilities`'s `afterpay_clearpay_payments` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum AccountCapabilitiesAfterpayClearpayPayments { - Active, - Inactive, - Pending, -} - -impl AccountCapabilitiesAfterpayClearpayPayments { - pub fn as_str(self) -> &'static str { - match self { - AccountCapabilitiesAfterpayClearpayPayments::Active => "active", - AccountCapabilitiesAfterpayClearpayPayments::Inactive => "inactive", - AccountCapabilitiesAfterpayClearpayPayments::Pending => "pending", - } - } -} - -impl AsRef for AccountCapabilitiesAfterpayClearpayPayments { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for AccountCapabilitiesAfterpayClearpayPayments { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for AccountCapabilitiesAfterpayClearpayPayments { - fn default() -> Self { - Self::Active - } -} - -/// An enum representing the possible values of an `AccountCapabilities`'s `bacs_debit_payments` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum AccountCapabilitiesBacsDebitPayments { - Active, - Inactive, - Pending, -} - -impl AccountCapabilitiesBacsDebitPayments { - pub fn as_str(self) -> &'static str { - match self { - AccountCapabilitiesBacsDebitPayments::Active => "active", - AccountCapabilitiesBacsDebitPayments::Inactive => "inactive", - AccountCapabilitiesBacsDebitPayments::Pending => "pending", - } - } -} - -impl AsRef for AccountCapabilitiesBacsDebitPayments { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for AccountCapabilitiesBacsDebitPayments { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for AccountCapabilitiesBacsDebitPayments { - fn default() -> Self { - Self::Active - } -} - -/// An enum representing the possible values of an `AccountCapabilities`'s `bancontact_payments` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum AccountCapabilitiesBancontactPayments { - Active, - Inactive, - Pending, -} - -impl AccountCapabilitiesBancontactPayments { - pub fn as_str(self) -> &'static str { - match self { - AccountCapabilitiesBancontactPayments::Active => "active", - AccountCapabilitiesBancontactPayments::Inactive => "inactive", - AccountCapabilitiesBancontactPayments::Pending => "pending", - } - } -} - -impl AsRef for AccountCapabilitiesBancontactPayments { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for AccountCapabilitiesBancontactPayments { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for AccountCapabilitiesBancontactPayments { - fn default() -> Self { - Self::Active - } -} - -/// An enum representing the possible values of an `AccountCapabilities`'s `bank_transfer_payments` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum AccountCapabilitiesBankTransferPayments { - Active, - Inactive, - Pending, -} - -impl AccountCapabilitiesBankTransferPayments { - pub fn as_str(self) -> &'static str { - match self { - AccountCapabilitiesBankTransferPayments::Active => "active", - AccountCapabilitiesBankTransferPayments::Inactive => "inactive", - AccountCapabilitiesBankTransferPayments::Pending => "pending", - } - } -} - -impl AsRef for AccountCapabilitiesBankTransferPayments { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for AccountCapabilitiesBankTransferPayments { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for AccountCapabilitiesBankTransferPayments { - fn default() -> Self { - Self::Active - } -} - -/// An enum representing the possible values of an `AccountCapabilities`'s `blik_payments` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum AccountCapabilitiesBlikPayments { - Active, - Inactive, - Pending, -} - -impl AccountCapabilitiesBlikPayments { - pub fn as_str(self) -> &'static str { - match self { - AccountCapabilitiesBlikPayments::Active => "active", - AccountCapabilitiesBlikPayments::Inactive => "inactive", - AccountCapabilitiesBlikPayments::Pending => "pending", - } - } -} - -impl AsRef for AccountCapabilitiesBlikPayments { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for AccountCapabilitiesBlikPayments { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for AccountCapabilitiesBlikPayments { - fn default() -> Self { - Self::Active - } -} - -/// An enum representing the possible values of an `AccountCapabilities`'s `boleto_payments` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum AccountCapabilitiesBoletoPayments { - Active, - Inactive, - Pending, -} - -impl AccountCapabilitiesBoletoPayments { - pub fn as_str(self) -> &'static str { - match self { - AccountCapabilitiesBoletoPayments::Active => "active", - AccountCapabilitiesBoletoPayments::Inactive => "inactive", - AccountCapabilitiesBoletoPayments::Pending => "pending", - } - } -} - -impl AsRef for AccountCapabilitiesBoletoPayments { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for AccountCapabilitiesBoletoPayments { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for AccountCapabilitiesBoletoPayments { - fn default() -> Self { - Self::Active - } -} - -/// An enum representing the possible values of an `AccountCapabilities`'s `cartes_bancaires_payments` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum AccountCapabilitiesCartesBancairesPayments { - Active, - Inactive, - Pending, -} - -impl AccountCapabilitiesCartesBancairesPayments { - pub fn as_str(self) -> &'static str { - match self { - AccountCapabilitiesCartesBancairesPayments::Active => "active", - AccountCapabilitiesCartesBancairesPayments::Inactive => "inactive", - AccountCapabilitiesCartesBancairesPayments::Pending => "pending", - } - } -} - -impl AsRef for AccountCapabilitiesCartesBancairesPayments { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for AccountCapabilitiesCartesBancairesPayments { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for AccountCapabilitiesCartesBancairesPayments { - fn default() -> Self { - Self::Active - } -} - -/// An enum representing the possible values of an `AccountCapabilities`'s `cashapp_payments` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum AccountCapabilitiesCashappPayments { - Active, - Inactive, - Pending, -} - -impl AccountCapabilitiesCashappPayments { - pub fn as_str(self) -> &'static str { - match self { - AccountCapabilitiesCashappPayments::Active => "active", - AccountCapabilitiesCashappPayments::Inactive => "inactive", - AccountCapabilitiesCashappPayments::Pending => "pending", - } - } -} - -impl AsRef for AccountCapabilitiesCashappPayments { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for AccountCapabilitiesCashappPayments { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for AccountCapabilitiesCashappPayments { - fn default() -> Self { - Self::Active - } -} - -/// An enum representing the possible values of an `AccountCapabilities`'s `eps_payments` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum AccountCapabilitiesEpsPayments { - Active, - Inactive, - Pending, -} - -impl AccountCapabilitiesEpsPayments { - pub fn as_str(self) -> &'static str { - match self { - AccountCapabilitiesEpsPayments::Active => "active", - AccountCapabilitiesEpsPayments::Inactive => "inactive", - AccountCapabilitiesEpsPayments::Pending => "pending", - } - } -} - -impl AsRef for AccountCapabilitiesEpsPayments { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for AccountCapabilitiesEpsPayments { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for AccountCapabilitiesEpsPayments { - fn default() -> Self { - Self::Active - } -} - -/// An enum representing the possible values of an `AccountCapabilities`'s `fpx_payments` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum AccountCapabilitiesFpxPayments { - Active, - Inactive, - Pending, -} - -impl AccountCapabilitiesFpxPayments { - pub fn as_str(self) -> &'static str { - match self { - AccountCapabilitiesFpxPayments::Active => "active", - AccountCapabilitiesFpxPayments::Inactive => "inactive", - AccountCapabilitiesFpxPayments::Pending => "pending", - } - } -} - -impl AsRef for AccountCapabilitiesFpxPayments { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for AccountCapabilitiesFpxPayments { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for AccountCapabilitiesFpxPayments { - fn default() -> Self { - Self::Active - } -} - -/// An enum representing the possible values of an `AccountCapabilities`'s `giropay_payments` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum AccountCapabilitiesGiropayPayments { - Active, - Inactive, - Pending, -} - -impl AccountCapabilitiesGiropayPayments { - pub fn as_str(self) -> &'static str { - match self { - AccountCapabilitiesGiropayPayments::Active => "active", - AccountCapabilitiesGiropayPayments::Inactive => "inactive", - AccountCapabilitiesGiropayPayments::Pending => "pending", - } - } -} - -impl AsRef for AccountCapabilitiesGiropayPayments { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for AccountCapabilitiesGiropayPayments { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for AccountCapabilitiesGiropayPayments { - fn default() -> Self { - Self::Active - } -} - -/// An enum representing the possible values of an `AccountCapabilities`'s `grabpay_payments` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum AccountCapabilitiesGrabpayPayments { - Active, - Inactive, - Pending, -} - -impl AccountCapabilitiesGrabpayPayments { - pub fn as_str(self) -> &'static str { - match self { - AccountCapabilitiesGrabpayPayments::Active => "active", - AccountCapabilitiesGrabpayPayments::Inactive => "inactive", - AccountCapabilitiesGrabpayPayments::Pending => "pending", - } - } -} - -impl AsRef for AccountCapabilitiesGrabpayPayments { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for AccountCapabilitiesGrabpayPayments { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for AccountCapabilitiesGrabpayPayments { - fn default() -> Self { - Self::Active - } -} - -/// An enum representing the possible values of an `AccountCapabilities`'s `ideal_payments` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum AccountCapabilitiesIdealPayments { - Active, - Inactive, - Pending, -} - -impl AccountCapabilitiesIdealPayments { - pub fn as_str(self) -> &'static str { - match self { - AccountCapabilitiesIdealPayments::Active => "active", - AccountCapabilitiesIdealPayments::Inactive => "inactive", - AccountCapabilitiesIdealPayments::Pending => "pending", - } - } -} - -impl AsRef for AccountCapabilitiesIdealPayments { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for AccountCapabilitiesIdealPayments { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for AccountCapabilitiesIdealPayments { - fn default() -> Self { - Self::Active - } -} - -/// An enum representing the possible values of an `AccountCapabilities`'s `india_international_payments` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum AccountCapabilitiesIndiaInternationalPayments { - Active, - Inactive, - Pending, -} - -impl AccountCapabilitiesIndiaInternationalPayments { - pub fn as_str(self) -> &'static str { - match self { - AccountCapabilitiesIndiaInternationalPayments::Active => "active", - AccountCapabilitiesIndiaInternationalPayments::Inactive => "inactive", - AccountCapabilitiesIndiaInternationalPayments::Pending => "pending", - } - } -} - -impl AsRef for AccountCapabilitiesIndiaInternationalPayments { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for AccountCapabilitiesIndiaInternationalPayments { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for AccountCapabilitiesIndiaInternationalPayments { - fn default() -> Self { - Self::Active - } -} - -/// An enum representing the possible values of an `AccountCapabilities`'s `klarna_payments` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum AccountCapabilitiesKlarnaPayments { - Active, - Inactive, - Pending, -} - -impl AccountCapabilitiesKlarnaPayments { - pub fn as_str(self) -> &'static str { - match self { - AccountCapabilitiesKlarnaPayments::Active => "active", - AccountCapabilitiesKlarnaPayments::Inactive => "inactive", - AccountCapabilitiesKlarnaPayments::Pending => "pending", - } - } -} - -impl AsRef for AccountCapabilitiesKlarnaPayments { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for AccountCapabilitiesKlarnaPayments { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for AccountCapabilitiesKlarnaPayments { - fn default() -> Self { - Self::Active - } -} - -/// An enum representing the possible values of an `AccountCapabilities`'s `konbini_payments` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum AccountCapabilitiesKonbiniPayments { - Active, - Inactive, - Pending, -} - -impl AccountCapabilitiesKonbiniPayments { - pub fn as_str(self) -> &'static str { - match self { - AccountCapabilitiesKonbiniPayments::Active => "active", - AccountCapabilitiesKonbiniPayments::Inactive => "inactive", - AccountCapabilitiesKonbiniPayments::Pending => "pending", - } - } -} - -impl AsRef for AccountCapabilitiesKonbiniPayments { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for AccountCapabilitiesKonbiniPayments { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for AccountCapabilitiesKonbiniPayments { - fn default() -> Self { - Self::Active - } -} - -/// An enum representing the possible values of an `AccountCapabilities`'s `link_payments` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum AccountCapabilitiesLinkPayments { - Active, - Inactive, - Pending, -} - -impl AccountCapabilitiesLinkPayments { - pub fn as_str(self) -> &'static str { - match self { - AccountCapabilitiesLinkPayments::Active => "active", - AccountCapabilitiesLinkPayments::Inactive => "inactive", - AccountCapabilitiesLinkPayments::Pending => "pending", - } - } -} - -impl AsRef for AccountCapabilitiesLinkPayments { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for AccountCapabilitiesLinkPayments { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for AccountCapabilitiesLinkPayments { - fn default() -> Self { - Self::Active - } -} - -/// An enum representing the possible values of an `AccountCapabilities`'s `oxxo_payments` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum AccountCapabilitiesOxxoPayments { - Active, - Inactive, - Pending, -} - -impl AccountCapabilitiesOxxoPayments { - pub fn as_str(self) -> &'static str { - match self { - AccountCapabilitiesOxxoPayments::Active => "active", - AccountCapabilitiesOxxoPayments::Inactive => "inactive", - AccountCapabilitiesOxxoPayments::Pending => "pending", - } - } -} - -impl AsRef for AccountCapabilitiesOxxoPayments { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for AccountCapabilitiesOxxoPayments { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for AccountCapabilitiesOxxoPayments { - fn default() -> Self { - Self::Active - } -} - -/// An enum representing the possible values of an `AccountCapabilities`'s `p24_payments` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum AccountCapabilitiesP24Payments { - Active, - Inactive, - Pending, -} - -impl AccountCapabilitiesP24Payments { - pub fn as_str(self) -> &'static str { - match self { - AccountCapabilitiesP24Payments::Active => "active", - AccountCapabilitiesP24Payments::Inactive => "inactive", - AccountCapabilitiesP24Payments::Pending => "pending", - } - } -} - -impl AsRef for AccountCapabilitiesP24Payments { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for AccountCapabilitiesP24Payments { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for AccountCapabilitiesP24Payments { - fn default() -> Self { - Self::Active - } -} - -/// An enum representing the possible values of an `AccountCapabilities`'s `paynow_payments` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum AccountCapabilitiesPaynowPayments { - Active, - Inactive, - Pending, -} - -impl AccountCapabilitiesPaynowPayments { - pub fn as_str(self) -> &'static str { - match self { - AccountCapabilitiesPaynowPayments::Active => "active", - AccountCapabilitiesPaynowPayments::Inactive => "inactive", - AccountCapabilitiesPaynowPayments::Pending => "pending", - } - } -} - -impl AsRef for AccountCapabilitiesPaynowPayments { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for AccountCapabilitiesPaynowPayments { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for AccountCapabilitiesPaynowPayments { - fn default() -> Self { - Self::Active - } -} - -/// An enum representing the possible values of an `AccountCapabilities`'s `promptpay_payments` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum AccountCapabilitiesPromptpayPayments { - Active, - Inactive, - Pending, -} - -impl AccountCapabilitiesPromptpayPayments { - pub fn as_str(self) -> &'static str { - match self { - AccountCapabilitiesPromptpayPayments::Active => "active", - AccountCapabilitiesPromptpayPayments::Inactive => "inactive", - AccountCapabilitiesPromptpayPayments::Pending => "pending", - } - } -} - -impl AsRef for AccountCapabilitiesPromptpayPayments { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for AccountCapabilitiesPromptpayPayments { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for AccountCapabilitiesPromptpayPayments { - fn default() -> Self { - Self::Active - } -} - -/// An enum representing the possible values of an `AccountCapabilities`'s `revolut_pay_payments` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum AccountCapabilitiesRevolutPayPayments { - Active, - Inactive, - Pending, -} - -impl AccountCapabilitiesRevolutPayPayments { - pub fn as_str(self) -> &'static str { - match self { - AccountCapabilitiesRevolutPayPayments::Active => "active", - AccountCapabilitiesRevolutPayPayments::Inactive => "inactive", - AccountCapabilitiesRevolutPayPayments::Pending => "pending", - } - } -} - -impl AsRef for AccountCapabilitiesRevolutPayPayments { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for AccountCapabilitiesRevolutPayPayments { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for AccountCapabilitiesRevolutPayPayments { - fn default() -> Self { - Self::Active - } -} - -/// An enum representing the possible values of an `AccountCapabilities`'s `sepa_debit_payments` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum AccountCapabilitiesSepaDebitPayments { - Active, - Inactive, - Pending, -} - -impl AccountCapabilitiesSepaDebitPayments { - pub fn as_str(self) -> &'static str { - match self { - AccountCapabilitiesSepaDebitPayments::Active => "active", - AccountCapabilitiesSepaDebitPayments::Inactive => "inactive", - AccountCapabilitiesSepaDebitPayments::Pending => "pending", - } - } -} - -impl AsRef for AccountCapabilitiesSepaDebitPayments { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for AccountCapabilitiesSepaDebitPayments { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for AccountCapabilitiesSepaDebitPayments { - fn default() -> Self { - Self::Active - } -} - -/// An enum representing the possible values of an `AccountCapabilities`'s `sofort_payments` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum AccountCapabilitiesSofortPayments { - Active, - Inactive, - Pending, -} - -impl AccountCapabilitiesSofortPayments { - pub fn as_str(self) -> &'static str { - match self { - AccountCapabilitiesSofortPayments::Active => "active", - AccountCapabilitiesSofortPayments::Inactive => "inactive", - AccountCapabilitiesSofortPayments::Pending => "pending", - } - } -} - -impl AsRef for AccountCapabilitiesSofortPayments { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for AccountCapabilitiesSofortPayments { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for AccountCapabilitiesSofortPayments { - fn default() -> Self { - Self::Active - } -} - -/// An enum representing the possible values of an `AccountCapabilities`'s `swish_payments` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum AccountCapabilitiesSwishPayments { - Active, - Inactive, - Pending, -} - -impl AccountCapabilitiesSwishPayments { - pub fn as_str(self) -> &'static str { - match self { - AccountCapabilitiesSwishPayments::Active => "active", - AccountCapabilitiesSwishPayments::Inactive => "inactive", - AccountCapabilitiesSwishPayments::Pending => "pending", - } - } -} - -impl AsRef for AccountCapabilitiesSwishPayments { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for AccountCapabilitiesSwishPayments { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for AccountCapabilitiesSwishPayments { - fn default() -> Self { - Self::Active - } -} - -/// An enum representing the possible values of an `AccountCapabilities`'s `treasury` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum AccountCapabilitiesTreasury { - Active, - Inactive, - Pending, -} - -impl AccountCapabilitiesTreasury { - pub fn as_str(self) -> &'static str { - match self { - AccountCapabilitiesTreasury::Active => "active", - AccountCapabilitiesTreasury::Inactive => "inactive", - AccountCapabilitiesTreasury::Pending => "pending", - } - } -} - -impl AsRef for AccountCapabilitiesTreasury { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for AccountCapabilitiesTreasury { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for AccountCapabilitiesTreasury { - fn default() -> Self { - Self::Active - } -} - -/// An enum representing the possible values of an `AccountCapabilities`'s `us_bank_account_ach_payments` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum AccountCapabilitiesUsBankAccountAchPayments { - Active, - Inactive, - Pending, -} - -impl AccountCapabilitiesUsBankAccountAchPayments { - pub fn as_str(self) -> &'static str { - match self { - AccountCapabilitiesUsBankAccountAchPayments::Active => "active", - AccountCapabilitiesUsBankAccountAchPayments::Inactive => "inactive", - AccountCapabilitiesUsBankAccountAchPayments::Pending => "pending", - } - } -} - -impl AsRef for AccountCapabilitiesUsBankAccountAchPayments { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for AccountCapabilitiesUsBankAccountAchPayments { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for AccountCapabilitiesUsBankAccountAchPayments { - fn default() -> Self { - Self::Active - } -} - -/// An enum representing the possible values of an `AccountCapabilities`'s `zip_payments` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum AccountCapabilitiesZipPayments { - Active, - Inactive, - Pending, -} - -impl AccountCapabilitiesZipPayments { - pub fn as_str(self) -> &'static str { - match self { - AccountCapabilitiesZipPayments::Active => "active", - AccountCapabilitiesZipPayments::Inactive => "inactive", - AccountCapabilitiesZipPayments::Pending => "pending", - } - } -} - -impl AsRef for AccountCapabilitiesZipPayments { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for AccountCapabilitiesZipPayments { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for AccountCapabilitiesZipPayments { - fn default() -> Self { - Self::Active - } -} - -/// An enum representing the possible values of an `AccountRequirementsError`'s `code` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum AccountRequirementsErrorCode { - InvalidAddressCityStatePostalCode, - InvalidAddressHighwayContractBox, - InvalidAddressPrivateMailbox, - InvalidBusinessProfileName, - InvalidBusinessProfileNameDenylisted, - InvalidCompanyNameDenylisted, - InvalidDobAgeOverMaximum, - #[serde(rename = "invalid_dob_age_under_18")] - InvalidDobAgeUnder18, - InvalidDobAgeUnderMinimum, - InvalidProductDescriptionLength, - InvalidProductDescriptionUrlMatch, - InvalidRepresentativeCountry, - InvalidStatementDescriptorBusinessMismatch, - InvalidStatementDescriptorDenylisted, - InvalidStatementDescriptorLength, - InvalidStatementDescriptorPrefixDenylisted, - InvalidStatementDescriptorPrefixMismatch, - InvalidStreetAddress, - InvalidTaxId, - InvalidTaxIdFormat, - InvalidTosAcceptance, - InvalidUrlDenylisted, - InvalidUrlFormat, - InvalidUrlLength, - InvalidUrlWebPresenceDetected, - InvalidUrlWebsiteBusinessInformationMismatch, - InvalidUrlWebsiteEmpty, - InvalidUrlWebsiteInaccessible, - InvalidUrlWebsiteInaccessibleGeoblocked, - InvalidUrlWebsiteInaccessiblePasswordProtected, - InvalidUrlWebsiteIncomplete, - InvalidUrlWebsiteIncompleteCancellationPolicy, - InvalidUrlWebsiteIncompleteCustomerServiceDetails, - InvalidUrlWebsiteIncompleteLegalRestrictions, - InvalidUrlWebsiteIncompleteRefundPolicy, - InvalidUrlWebsiteIncompleteReturnPolicy, - InvalidUrlWebsiteIncompleteTermsAndConditions, - InvalidUrlWebsiteIncompleteUnderConstruction, - InvalidUrlWebsiteOther, - InvalidValueOther, - VerificationDirectorsMismatch, - VerificationDocumentAddressMismatch, - VerificationDocumentAddressMissing, - VerificationDocumentCorrupt, - VerificationDocumentCountryNotSupported, - VerificationDocumentDirectorsMismatch, - VerificationDocumentDobMismatch, - VerificationDocumentDuplicateType, - VerificationDocumentExpired, - VerificationDocumentFailedCopy, - VerificationDocumentFailedGreyscale, - VerificationDocumentFailedOther, - VerificationDocumentFailedTestMode, - VerificationDocumentFraudulent, - VerificationDocumentIdNumberMismatch, - VerificationDocumentIdNumberMissing, - VerificationDocumentIncomplete, - VerificationDocumentInvalid, - VerificationDocumentIssueOrExpiryDateMissing, - VerificationDocumentManipulated, - VerificationDocumentMissingBack, - VerificationDocumentMissingFront, - VerificationDocumentNameMismatch, - VerificationDocumentNameMissing, - VerificationDocumentNationalityMismatch, - VerificationDocumentNotReadable, - VerificationDocumentNotSigned, - VerificationDocumentNotUploaded, - VerificationDocumentPhotoMismatch, - VerificationDocumentTooLarge, - VerificationDocumentTypeNotSupported, - VerificationExtraneousDirectors, - VerificationFailedAddressMatch, - VerificationFailedBusinessIecNumber, - VerificationFailedDocumentMatch, - VerificationFailedIdNumberMatch, - VerificationFailedKeyedIdentity, - VerificationFailedKeyedMatch, - VerificationFailedNameMatch, - VerificationFailedOther, - VerificationFailedResidentialAddress, - VerificationFailedTaxIdMatch, - VerificationFailedTaxIdNotIssued, - VerificationMissingDirectors, - VerificationMissingExecutives, - VerificationMissingOwners, - VerificationRequiresAdditionalMemorandumOfAssociations, -} - -impl AccountRequirementsErrorCode { - pub fn as_str(self) -> &'static str { - match self { - AccountRequirementsErrorCode::InvalidAddressCityStatePostalCode => "invalid_address_city_state_postal_code", - AccountRequirementsErrorCode::InvalidAddressHighwayContractBox => "invalid_address_highway_contract_box", - AccountRequirementsErrorCode::InvalidAddressPrivateMailbox => "invalid_address_private_mailbox", - AccountRequirementsErrorCode::InvalidBusinessProfileName => "invalid_business_profile_name", - AccountRequirementsErrorCode::InvalidBusinessProfileNameDenylisted => "invalid_business_profile_name_denylisted", - AccountRequirementsErrorCode::InvalidCompanyNameDenylisted => "invalid_company_name_denylisted", - AccountRequirementsErrorCode::InvalidDobAgeOverMaximum => "invalid_dob_age_over_maximum", - AccountRequirementsErrorCode::InvalidDobAgeUnder18 => "invalid_dob_age_under_18", - AccountRequirementsErrorCode::InvalidDobAgeUnderMinimum => "invalid_dob_age_under_minimum", - AccountRequirementsErrorCode::InvalidProductDescriptionLength => "invalid_product_description_length", - AccountRequirementsErrorCode::InvalidProductDescriptionUrlMatch => "invalid_product_description_url_match", - AccountRequirementsErrorCode::InvalidRepresentativeCountry => "invalid_representative_country", - AccountRequirementsErrorCode::InvalidStatementDescriptorBusinessMismatch => "invalid_statement_descriptor_business_mismatch", - AccountRequirementsErrorCode::InvalidStatementDescriptorDenylisted => "invalid_statement_descriptor_denylisted", - AccountRequirementsErrorCode::InvalidStatementDescriptorLength => "invalid_statement_descriptor_length", - AccountRequirementsErrorCode::InvalidStatementDescriptorPrefixDenylisted => "invalid_statement_descriptor_prefix_denylisted", - AccountRequirementsErrorCode::InvalidStatementDescriptorPrefixMismatch => "invalid_statement_descriptor_prefix_mismatch", - AccountRequirementsErrorCode::InvalidStreetAddress => "invalid_street_address", - AccountRequirementsErrorCode::InvalidTaxId => "invalid_tax_id", - AccountRequirementsErrorCode::InvalidTaxIdFormat => "invalid_tax_id_format", - AccountRequirementsErrorCode::InvalidTosAcceptance => "invalid_tos_acceptance", - AccountRequirementsErrorCode::InvalidUrlDenylisted => "invalid_url_denylisted", - AccountRequirementsErrorCode::InvalidUrlFormat => "invalid_url_format", - AccountRequirementsErrorCode::InvalidUrlLength => "invalid_url_length", - AccountRequirementsErrorCode::InvalidUrlWebPresenceDetected => "invalid_url_web_presence_detected", - AccountRequirementsErrorCode::InvalidUrlWebsiteBusinessInformationMismatch => "invalid_url_website_business_information_mismatch", - AccountRequirementsErrorCode::InvalidUrlWebsiteEmpty => "invalid_url_website_empty", - AccountRequirementsErrorCode::InvalidUrlWebsiteInaccessible => "invalid_url_website_inaccessible", - AccountRequirementsErrorCode::InvalidUrlWebsiteInaccessibleGeoblocked => "invalid_url_website_inaccessible_geoblocked", - AccountRequirementsErrorCode::InvalidUrlWebsiteInaccessiblePasswordProtected => "invalid_url_website_inaccessible_password_protected", - AccountRequirementsErrorCode::InvalidUrlWebsiteIncomplete => "invalid_url_website_incomplete", - AccountRequirementsErrorCode::InvalidUrlWebsiteIncompleteCancellationPolicy => "invalid_url_website_incomplete_cancellation_policy", - AccountRequirementsErrorCode::InvalidUrlWebsiteIncompleteCustomerServiceDetails => "invalid_url_website_incomplete_customer_service_details", - AccountRequirementsErrorCode::InvalidUrlWebsiteIncompleteLegalRestrictions => "invalid_url_website_incomplete_legal_restrictions", - AccountRequirementsErrorCode::InvalidUrlWebsiteIncompleteRefundPolicy => "invalid_url_website_incomplete_refund_policy", - AccountRequirementsErrorCode::InvalidUrlWebsiteIncompleteReturnPolicy => "invalid_url_website_incomplete_return_policy", - AccountRequirementsErrorCode::InvalidUrlWebsiteIncompleteTermsAndConditions => "invalid_url_website_incomplete_terms_and_conditions", - AccountRequirementsErrorCode::InvalidUrlWebsiteIncompleteUnderConstruction => "invalid_url_website_incomplete_under_construction", - AccountRequirementsErrorCode::InvalidUrlWebsiteOther => "invalid_url_website_other", - AccountRequirementsErrorCode::InvalidValueOther => "invalid_value_other", - AccountRequirementsErrorCode::VerificationDirectorsMismatch => "verification_directors_mismatch", - AccountRequirementsErrorCode::VerificationDocumentAddressMismatch => "verification_document_address_mismatch", - AccountRequirementsErrorCode::VerificationDocumentAddressMissing => "verification_document_address_missing", - AccountRequirementsErrorCode::VerificationDocumentCorrupt => "verification_document_corrupt", - AccountRequirementsErrorCode::VerificationDocumentCountryNotSupported => "verification_document_country_not_supported", - AccountRequirementsErrorCode::VerificationDocumentDirectorsMismatch => "verification_document_directors_mismatch", - AccountRequirementsErrorCode::VerificationDocumentDobMismatch => "verification_document_dob_mismatch", - AccountRequirementsErrorCode::VerificationDocumentDuplicateType => "verification_document_duplicate_type", - AccountRequirementsErrorCode::VerificationDocumentExpired => "verification_document_expired", - AccountRequirementsErrorCode::VerificationDocumentFailedCopy => "verification_document_failed_copy", - AccountRequirementsErrorCode::VerificationDocumentFailedGreyscale => "verification_document_failed_greyscale", - AccountRequirementsErrorCode::VerificationDocumentFailedOther => "verification_document_failed_other", - AccountRequirementsErrorCode::VerificationDocumentFailedTestMode => "verification_document_failed_test_mode", - AccountRequirementsErrorCode::VerificationDocumentFraudulent => "verification_document_fraudulent", - AccountRequirementsErrorCode::VerificationDocumentIdNumberMismatch => "verification_document_id_number_mismatch", - AccountRequirementsErrorCode::VerificationDocumentIdNumberMissing => "verification_document_id_number_missing", - AccountRequirementsErrorCode::VerificationDocumentIncomplete => "verification_document_incomplete", - AccountRequirementsErrorCode::VerificationDocumentInvalid => "verification_document_invalid", - AccountRequirementsErrorCode::VerificationDocumentIssueOrExpiryDateMissing => "verification_document_issue_or_expiry_date_missing", - AccountRequirementsErrorCode::VerificationDocumentManipulated => "verification_document_manipulated", - AccountRequirementsErrorCode::VerificationDocumentMissingBack => "verification_document_missing_back", - AccountRequirementsErrorCode::VerificationDocumentMissingFront => "verification_document_missing_front", - AccountRequirementsErrorCode::VerificationDocumentNameMismatch => "verification_document_name_mismatch", - AccountRequirementsErrorCode::VerificationDocumentNameMissing => "verification_document_name_missing", - AccountRequirementsErrorCode::VerificationDocumentNationalityMismatch => "verification_document_nationality_mismatch", - AccountRequirementsErrorCode::VerificationDocumentNotReadable => "verification_document_not_readable", - AccountRequirementsErrorCode::VerificationDocumentNotSigned => "verification_document_not_signed", - AccountRequirementsErrorCode::VerificationDocumentNotUploaded => "verification_document_not_uploaded", - AccountRequirementsErrorCode::VerificationDocumentPhotoMismatch => "verification_document_photo_mismatch", - AccountRequirementsErrorCode::VerificationDocumentTooLarge => "verification_document_too_large", - AccountRequirementsErrorCode::VerificationDocumentTypeNotSupported => "verification_document_type_not_supported", - AccountRequirementsErrorCode::VerificationExtraneousDirectors => "verification_extraneous_directors", - AccountRequirementsErrorCode::VerificationFailedAddressMatch => "verification_failed_address_match", - AccountRequirementsErrorCode::VerificationFailedBusinessIecNumber => "verification_failed_business_iec_number", - AccountRequirementsErrorCode::VerificationFailedDocumentMatch => "verification_failed_document_match", - AccountRequirementsErrorCode::VerificationFailedIdNumberMatch => "verification_failed_id_number_match", - AccountRequirementsErrorCode::VerificationFailedKeyedIdentity => "verification_failed_keyed_identity", - AccountRequirementsErrorCode::VerificationFailedKeyedMatch => "verification_failed_keyed_match", - AccountRequirementsErrorCode::VerificationFailedNameMatch => "verification_failed_name_match", - AccountRequirementsErrorCode::VerificationFailedOther => "verification_failed_other", - AccountRequirementsErrorCode::VerificationFailedResidentialAddress => "verification_failed_residential_address", - AccountRequirementsErrorCode::VerificationFailedTaxIdMatch => "verification_failed_tax_id_match", - AccountRequirementsErrorCode::VerificationFailedTaxIdNotIssued => "verification_failed_tax_id_not_issued", - AccountRequirementsErrorCode::VerificationMissingDirectors => "verification_missing_directors", - AccountRequirementsErrorCode::VerificationMissingExecutives => "verification_missing_executives", - AccountRequirementsErrorCode::VerificationMissingOwners => "verification_missing_owners", - AccountRequirementsErrorCode::VerificationRequiresAdditionalMemorandumOfAssociations => "verification_requires_additional_memorandum_of_associations", - } - } -} - -impl AsRef for AccountRequirementsErrorCode { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for AccountRequirementsErrorCode { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for AccountRequirementsErrorCode { - fn default() -> Self { - Self::InvalidAddressCityStatePostalCode - } -} - -/// An enum representing the possible values of an `CreateAccount`'s `type_` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum AccountType { - Custom, - Express, - Standard, -} - -impl AccountType { - pub fn as_str(self) -> &'static str { - match self { - AccountType::Custom => "custom", - AccountType::Express => "express", - AccountType::Standard => "standard", - } - } -} - -impl AsRef for AccountType { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for AccountType { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for AccountType { - fn default() -> Self { - Self::Custom - } -} - -/// An enum representing the possible values of an `AccountUnificationAccountController`'s `type` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum AccountUnificationAccountControllerType { - Account, - Application, -} - -impl AccountUnificationAccountControllerType { - pub fn as_str(self) -> &'static str { - match self { - AccountUnificationAccountControllerType::Account => "account", - AccountUnificationAccountControllerType::Application => "application", - } - } -} - -impl AsRef for AccountUnificationAccountControllerType { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for AccountUnificationAccountControllerType { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for AccountUnificationAccountControllerType { - fn default() -> Self { - Self::Account - } -} - -/// An enum representing the possible values of an `AccountCapabilities`'s `au_becs_debit_payments` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CapabilityStatus { - Active, - Inactive, - Pending, -} - -impl CapabilityStatus { - pub fn as_str(self) -> &'static str { - match self { - CapabilityStatus::Active => "active", - CapabilityStatus::Inactive => "inactive", - CapabilityStatus::Pending => "pending", - } - } -} - -impl AsRef for CapabilityStatus { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for CapabilityStatus { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for CapabilityStatus { - fn default() -> Self { - Self::Active - } -} - -/// An enum representing the possible values of an `CompanyParams`'s `structure` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CompanyParamsStructure { - FreeZoneEstablishment, - FreeZoneLlc, - GovernmentInstrumentality, - GovernmentalUnit, - IncorporatedNonProfit, - IncorporatedPartnership, - LimitedLiabilityPartnership, - Llc, - MultiMemberLlc, - PrivateCompany, - PrivateCorporation, - PrivatePartnership, - PublicCompany, - PublicCorporation, - PublicPartnership, - RegisteredCharity, - SingleMemberLlc, - SoleEstablishment, - SoleProprietorship, - TaxExemptGovernmentInstrumentality, - UnincorporatedAssociation, - UnincorporatedNonProfit, - UnincorporatedPartnership, -} - -impl CompanyParamsStructure { - pub fn as_str(self) -> &'static str { - match self { - CompanyParamsStructure::FreeZoneEstablishment => "free_zone_establishment", - CompanyParamsStructure::FreeZoneLlc => "free_zone_llc", - CompanyParamsStructure::GovernmentInstrumentality => "government_instrumentality", - CompanyParamsStructure::GovernmentalUnit => "governmental_unit", - CompanyParamsStructure::IncorporatedNonProfit => "incorporated_non_profit", - CompanyParamsStructure::IncorporatedPartnership => "incorporated_partnership", - CompanyParamsStructure::LimitedLiabilityPartnership => "limited_liability_partnership", - CompanyParamsStructure::Llc => "llc", - CompanyParamsStructure::MultiMemberLlc => "multi_member_llc", - CompanyParamsStructure::PrivateCompany => "private_company", - CompanyParamsStructure::PrivateCorporation => "private_corporation", - CompanyParamsStructure::PrivatePartnership => "private_partnership", - CompanyParamsStructure::PublicCompany => "public_company", - CompanyParamsStructure::PublicCorporation => "public_corporation", - CompanyParamsStructure::PublicPartnership => "public_partnership", - CompanyParamsStructure::RegisteredCharity => "registered_charity", - CompanyParamsStructure::SingleMemberLlc => "single_member_llc", - CompanyParamsStructure::SoleEstablishment => "sole_establishment", - CompanyParamsStructure::SoleProprietorship => "sole_proprietorship", - CompanyParamsStructure::TaxExemptGovernmentInstrumentality => { - "tax_exempt_government_instrumentality" - } - CompanyParamsStructure::UnincorporatedAssociation => "unincorporated_association", - CompanyParamsStructure::UnincorporatedNonProfit => "unincorporated_non_profit", - CompanyParamsStructure::UnincorporatedPartnership => "unincorporated_partnership", - } - } -} - -impl AsRef for CompanyParamsStructure { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for CompanyParamsStructure { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for CompanyParamsStructure { - fn default() -> Self { - Self::FreeZoneEstablishment - } -} - -/// An enum representing the possible values of an `Company`'s `structure` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CompanyStructure { - FreeZoneEstablishment, - FreeZoneLlc, - GovernmentInstrumentality, - GovernmentalUnit, - IncorporatedNonProfit, - IncorporatedPartnership, - LimitedLiabilityPartnership, - Llc, - MultiMemberLlc, - PrivateCompany, - PrivateCorporation, - PrivatePartnership, - PublicCompany, - PublicCorporation, - PublicPartnership, - RegisteredCharity, - SingleMemberLlc, - SoleEstablishment, - SoleProprietorship, - TaxExemptGovernmentInstrumentality, - UnincorporatedAssociation, - UnincorporatedNonProfit, - UnincorporatedPartnership, -} - -impl CompanyStructure { - pub fn as_str(self) -> &'static str { - match self { - CompanyStructure::FreeZoneEstablishment => "free_zone_establishment", - CompanyStructure::FreeZoneLlc => "free_zone_llc", - CompanyStructure::GovernmentInstrumentality => "government_instrumentality", - CompanyStructure::GovernmentalUnit => "governmental_unit", - CompanyStructure::IncorporatedNonProfit => "incorporated_non_profit", - CompanyStructure::IncorporatedPartnership => "incorporated_partnership", - CompanyStructure::LimitedLiabilityPartnership => "limited_liability_partnership", - CompanyStructure::Llc => "llc", - CompanyStructure::MultiMemberLlc => "multi_member_llc", - CompanyStructure::PrivateCompany => "private_company", - CompanyStructure::PrivateCorporation => "private_corporation", - CompanyStructure::PrivatePartnership => "private_partnership", - CompanyStructure::PublicCompany => "public_company", - CompanyStructure::PublicCorporation => "public_corporation", - CompanyStructure::PublicPartnership => "public_partnership", - CompanyStructure::RegisteredCharity => "registered_charity", - CompanyStructure::SingleMemberLlc => "single_member_llc", - CompanyStructure::SoleEstablishment => "sole_establishment", - CompanyStructure::SoleProprietorship => "sole_proprietorship", - CompanyStructure::TaxExemptGovernmentInstrumentality => { - "tax_exempt_government_instrumentality" - } - CompanyStructure::UnincorporatedAssociation => "unincorporated_association", - CompanyStructure::UnincorporatedNonProfit => "unincorporated_non_profit", - CompanyStructure::UnincorporatedPartnership => "unincorporated_partnership", - } - } -} - -impl AsRef for CompanyStructure { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for CompanyStructure { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for CompanyStructure { - fn default() -> Self { - Self::FreeZoneEstablishment - } -} - -/// An enum representing the possible values of an `PersonParams`'s `political_exposure` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum PersonParamsPoliticalExposure { - Existing, - None, -} - -impl PersonParamsPoliticalExposure { - pub fn as_str(self) -> &'static str { - match self { - PersonParamsPoliticalExposure::Existing => "existing", - PersonParamsPoliticalExposure::None => "none", - } - } -} - -impl AsRef for PersonParamsPoliticalExposure { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for PersonParamsPoliticalExposure { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for PersonParamsPoliticalExposure { - fn default() -> Self { - Self::Existing - } -} - -/// An enum representing the possible values of an `TransferScheduleParams`'s `interval` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum TransferScheduleInterval { - Daily, - Manual, - Monthly, - Weekly, -} - -impl TransferScheduleInterval { - pub fn as_str(self) -> &'static str { - match self { - TransferScheduleInterval::Daily => "daily", - TransferScheduleInterval::Manual => "manual", - TransferScheduleInterval::Monthly => "monthly", - TransferScheduleInterval::Weekly => "weekly", - } - } -} - -impl AsRef for TransferScheduleInterval { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for TransferScheduleInterval { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for TransferScheduleInterval { - fn default() -> Self { - Self::Daily - } -} - -/// An enum representing the possible values of an `TransferScheduleParams`'s `weekly_anchor` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum TransferScheduleParamsWeeklyAnchor { - Friday, - Monday, - Saturday, - Sunday, - Thursday, - Tuesday, - Wednesday, -} - -impl TransferScheduleParamsWeeklyAnchor { - pub fn as_str(self) -> &'static str { - match self { - TransferScheduleParamsWeeklyAnchor::Friday => "friday", - TransferScheduleParamsWeeklyAnchor::Monday => "monday", - TransferScheduleParamsWeeklyAnchor::Saturday => "saturday", - TransferScheduleParamsWeeklyAnchor::Sunday => "sunday", - TransferScheduleParamsWeeklyAnchor::Thursday => "thursday", - TransferScheduleParamsWeeklyAnchor::Tuesday => "tuesday", - TransferScheduleParamsWeeklyAnchor::Wednesday => "wednesday", - } - } -} - -impl AsRef for TransferScheduleParamsWeeklyAnchor { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for TransferScheduleParamsWeeklyAnchor { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for TransferScheduleParamsWeeklyAnchor { - fn default() -> Self { - Self::Friday - } -} diff --git a/src/resources/generated/account_application_authorized.rs b/src/resources/generated/account_application_authorized.rs deleted file mode 100644 index d0000a5b2..000000000 --- a/src/resources/generated/account_application_authorized.rs +++ /dev/null @@ -1,10 +0,0 @@ -// ====================================== -// This file was automatically generated. -// ====================================== - -use serde::{Deserialize, Serialize}; - -/// The resource representing a Stripe "account.application.authorized". -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct AccountApplicationAuthorized { -} diff --git a/src/resources/generated/account_application_deauthorized.rs b/src/resources/generated/account_application_deauthorized.rs deleted file mode 100644 index 5d26faa69..000000000 --- a/src/resources/generated/account_application_deauthorized.rs +++ /dev/null @@ -1,10 +0,0 @@ -// ====================================== -// This file was automatically generated. -// ====================================== - -use serde::{Deserialize, Serialize}; - -/// The resource representing a Stripe "account.application.deauthorized". -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct AccountApplicationDeauthorized { -} diff --git a/src/resources/generated/account_external_account_created.rs b/src/resources/generated/account_external_account_created.rs deleted file mode 100644 index 98a615285..000000000 --- a/src/resources/generated/account_external_account_created.rs +++ /dev/null @@ -1,10 +0,0 @@ -// ====================================== -// This file was automatically generated. -// ====================================== - -use serde::{Deserialize, Serialize}; - -/// The resource representing a Stripe "account.external_account.created". -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct AccountExternalAccountCreated { -} diff --git a/src/resources/generated/account_external_account_deleted.rs b/src/resources/generated/account_external_account_deleted.rs deleted file mode 100644 index ad51527c6..000000000 --- a/src/resources/generated/account_external_account_deleted.rs +++ /dev/null @@ -1,10 +0,0 @@ -// ====================================== -// This file was automatically generated. -// ====================================== - -use serde::{Deserialize, Serialize}; - -/// The resource representing a Stripe "account.external_account.deleted". -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct AccountExternalAccountDeleted { -} diff --git a/src/resources/generated/account_external_account_updated.rs b/src/resources/generated/account_external_account_updated.rs deleted file mode 100644 index 341ecbd1e..000000000 --- a/src/resources/generated/account_external_account_updated.rs +++ /dev/null @@ -1,10 +0,0 @@ -// ====================================== -// This file was automatically generated. -// ====================================== - -use serde::{Deserialize, Serialize}; - -/// The resource representing a Stripe "account.external_account.updated". -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct AccountExternalAccountUpdated { -} diff --git a/src/resources/generated/account_link.rs b/src/resources/generated/account_link.rs deleted file mode 100644 index 487d6b4bb..000000000 --- a/src/resources/generated/account_link.rs +++ /dev/null @@ -1,243 +0,0 @@ -// ====================================== -// This file was automatically generated. -// ====================================== - -use serde::{Deserialize, Serialize}; - -use crate::client::{Client, Response}; -use crate::ids::AccountId; -use crate::params::{Expand, Object, Timestamp}; - -/// The resource representing a Stripe "AccountLink". -/// -/// For more details see -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct AccountLink { - /// Time at which the object was created. - /// - /// Measured in seconds since the Unix epoch. - pub created: Timestamp, - - /// The timestamp at which this account link will expire. - pub expires_at: Timestamp, - - /// The URL for the account link. - pub url: String, -} - -impl AccountLink { - /// Creates an AccountLink object that includes a single-use Stripe URL that the platform can redirect their user to in order to take them through the Connect Onboarding flow. - pub fn create(client: &Client, params: CreateAccountLink<'_>) -> Response { - client.post_form("/account_links", ¶ms) - } -} - -impl Object for AccountLink { - type Id = (); - fn id(&self) -> Self::Id {} - fn object(&self) -> &'static str { - "account_link" - } -} - -/// The parameters for `AccountLink::create`. -#[derive(Clone, Debug, Serialize)] -pub struct CreateAccountLink<'a> { - /// The identifier of the account to create an account link for. - pub account: AccountId, - - /// The collect parameter is deprecated. - /// - /// Use `collection_options` instead. - #[serde(skip_serializing_if = "Option::is_none")] - pub collect: Option, - - /// Specifies the requirements that Stripe collects from connected accounts in the Connect Onboarding flow. - #[serde(skip_serializing_if = "Option::is_none")] - pub collection_options: Option, - - /// Specifies which fields in the response should be expanded. - #[serde(skip_serializing_if = "Expand::is_empty")] - pub expand: &'a [&'a str], - - /// The URL the user will be redirected to if the account link is expired, has been previously-visited, or is otherwise invalid. - /// - /// The URL you specify should attempt to generate a new account link with the same parameters used to create the original account link, then redirect the user to the new account link's URL so they can continue with Connect Onboarding. - /// If a new account link cannot be generated or the redirect fails you should display a useful error to the user. - #[serde(skip_serializing_if = "Option::is_none")] - pub refresh_url: Option<&'a str>, - - /// The URL that the user will be redirected to upon leaving or completing the linked flow. - #[serde(skip_serializing_if = "Option::is_none")] - pub return_url: Option<&'a str>, - - /// The type of account link the user is requesting. - /// - /// Possible values are `account_onboarding` or `account_update`. - #[serde(rename = "type")] - pub type_: AccountLinkType, -} - -impl<'a> CreateAccountLink<'a> { - pub fn new(account: AccountId, type_: AccountLinkType) -> Self { - CreateAccountLink { - account, - collect: Default::default(), - collection_options: Default::default(), - expand: Default::default(), - refresh_url: Default::default(), - return_url: Default::default(), - type_, - } - } -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreateAccountLinkCollectionOptions { - /// Specifies whether the platform collects only currently_due requirements (`currently_due`) or both currently_due and eventually_due requirements (`eventually_due`). - /// - /// If you don't specify `collection_options`, the default value is `currently_due`. - pub fields: CreateAccountLinkCollectionOptionsFields, - - /// Specifies whether the platform collects future_requirements in addition to requirements in Connect Onboarding. - /// - /// The default value is `omit`. - #[serde(skip_serializing_if = "Option::is_none")] - pub future_requirements: Option, -} - -/// An enum representing the possible values of an `CreateAccountLink`'s `collect` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum AccountLinkCollect { - CurrentlyDue, - EventuallyDue, -} - -impl AccountLinkCollect { - pub fn as_str(self) -> &'static str { - match self { - AccountLinkCollect::CurrentlyDue => "currently_due", - AccountLinkCollect::EventuallyDue => "eventually_due", - } - } -} - -impl AsRef for AccountLinkCollect { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for AccountLinkCollect { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for AccountLinkCollect { - fn default() -> Self { - Self::CurrentlyDue - } -} - -/// An enum representing the possible values of an `CreateAccountLink`'s `type_` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum AccountLinkType { - AccountOnboarding, - AccountUpdate, -} - -impl AccountLinkType { - pub fn as_str(self) -> &'static str { - match self { - AccountLinkType::AccountOnboarding => "account_onboarding", - AccountLinkType::AccountUpdate => "account_update", - } - } -} - -impl AsRef for AccountLinkType { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for AccountLinkType { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for AccountLinkType { - fn default() -> Self { - Self::AccountOnboarding - } -} - -/// An enum representing the possible values of an `CreateAccountLinkCollectionOptions`'s `fields` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CreateAccountLinkCollectionOptionsFields { - CurrentlyDue, - EventuallyDue, -} - -impl CreateAccountLinkCollectionOptionsFields { - pub fn as_str(self) -> &'static str { - match self { - CreateAccountLinkCollectionOptionsFields::CurrentlyDue => "currently_due", - CreateAccountLinkCollectionOptionsFields::EventuallyDue => "eventually_due", - } - } -} - -impl AsRef for CreateAccountLinkCollectionOptionsFields { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for CreateAccountLinkCollectionOptionsFields { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for CreateAccountLinkCollectionOptionsFields { - fn default() -> Self { - Self::CurrentlyDue - } -} - -/// An enum representing the possible values of an `CreateAccountLinkCollectionOptions`'s `future_requirements` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CreateAccountLinkCollectionOptionsFutureRequirements { - Include, - Omit, -} - -impl CreateAccountLinkCollectionOptionsFutureRequirements { - pub fn as_str(self) -> &'static str { - match self { - CreateAccountLinkCollectionOptionsFutureRequirements::Include => "include", - CreateAccountLinkCollectionOptionsFutureRequirements::Omit => "omit", - } - } -} - -impl AsRef for CreateAccountLinkCollectionOptionsFutureRequirements { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for CreateAccountLinkCollectionOptionsFutureRequirements { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for CreateAccountLinkCollectionOptionsFutureRequirements { - fn default() -> Self { - Self::Include - } -} diff --git a/src/resources/generated/account_session.rs b/src/resources/generated/account_session.rs deleted file mode 100644 index f80d3ed9c..000000000 --- a/src/resources/generated/account_session.rs +++ /dev/null @@ -1,291 +0,0 @@ -// ====================================== -// This file was automatically generated. -// ====================================== - -use crate::client::{Client, Response}; -use crate::ids::{AccountId}; -use crate::params::{Expand, Object, Timestamp}; -use serde::{Deserialize, Serialize}; - -/// The resource representing a Stripe "ConnectEmbeddedMethodAccountSessionCreateMethodAccountSession". -/// -/// For more details see -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct AccountSession { - - /// The ID of the account the AccountSession was created for. - pub account: String, - - /// The client secret of this AccountSession. - /// - /// Used on the client to set up secure access to the given `account`. The client secret can be used to provide access to `account` from your frontend. - /// It should not be stored, logged, or exposed to anyone other than the connected account. - /// Make sure that you have TLS enabled on any page that includes the client secret. Refer to our docs to [setup Connect embedded components](https://stripe.com/docs/connect/get-started-connect-embedded-components) and learn about how `client_secret` should be handled. - pub client_secret: String, - - pub components: ConnectEmbeddedAccountSessionCreateComponents, - - /// The timestamp at which this AccountSession will expire. - pub expires_at: Timestamp, - - /// Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. - pub livemode: bool, -} - -impl AccountSession { - - /// Creates a AccountSession object that includes a single-use token that the platform can use on their front-end to grant client-side API access. - pub fn create(client: &Client, params: CreateAccountSession<'_>) -> Response { - client.post_form("/account_sessions", ¶ms) - } -} - -impl Object for AccountSession { - type Id = (); - fn id(&self) -> Self::Id {} - fn object(&self) -> &'static str { - "account_session" - } -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct ConnectEmbeddedAccountSessionCreateComponents { - - pub account_onboarding: ConnectEmbeddedBaseConfigClaim, - - pub payment_details: ConnectEmbeddedPaymentsConfig, - - pub payments: ConnectEmbeddedPaymentsConfig, - - pub payouts: ConnectEmbeddedPayoutsConfig, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct ConnectEmbeddedBaseConfigClaim { - - /// Whether the embedded component is enabled. - pub enabled: bool, - - pub features: ConnectEmbeddedBaseFeatures, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct ConnectEmbeddedBaseFeatures { -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct ConnectEmbeddedPaymentsConfig { - - /// Whether the embedded component is enabled. - pub enabled: bool, - - pub features: ConnectEmbeddedPaymentsFeatures, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct ConnectEmbeddedPaymentsFeatures { - - /// Whether to allow capturing and cancelling payment intents. - /// - /// This is `true` by default. - pub capture_payments: bool, - - /// Whether to allow responding to disputes, including submitting evidence and accepting disputes. - /// - /// This is `true` by default. - pub dispute_management: bool, - - /// Whether to allow sending refunds. - /// - /// This is `true` by default. - pub refund_management: bool, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct ConnectEmbeddedPayoutsConfig { - - /// Whether the embedded component is enabled. - pub enabled: bool, - - pub features: ConnectEmbeddedPayoutsFeatures, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct ConnectEmbeddedPayoutsFeatures { - - /// Whether to allow payout schedule to be changed. - /// - /// Default `true` when Stripe owns Loss Liability, default `false` otherwise. - pub edit_payout_schedule: bool, - - /// Whether to allow creation of instant payouts. - /// - /// Default `true` when Stripe owns Loss Liability, default `false` otherwise. - pub instant_payouts: bool, - - /// Whether to allow creation of standard payouts. - /// - /// Default `true` when Stripe owns Loss Liability, default `false` otherwise. - pub standard_payouts: bool, -} - -/// The parameters for `AccountSession::create`. -#[derive(Clone, Debug, Serialize)] -pub struct CreateAccountSession<'a> { - - /// The identifier of the account to create an Account Session for. - pub account: AccountId, - - /// Each key of the dictionary represents an embedded component, and each embedded component maps to its configuration (e.g. - /// - /// whether it has been enabled or not). - pub components: CreateAccountSessionComponents, - - /// Specifies which fields in the response should be expanded. - #[serde(skip_serializing_if = "Expand::is_empty")] - pub expand: &'a [&'a str], -} - -impl<'a> CreateAccountSession<'a> { - pub fn new(account: AccountId, components: CreateAccountSessionComponents) -> Self { - CreateAccountSession { - account, - components, - expand: Default::default(), - } - } -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreateAccountSessionComponents { - - /// Configuration for the account onboarding embedded component. - #[serde(skip_serializing_if = "Option::is_none")] - pub account_onboarding: Option, - - /// Configuration for the payment details embedded component. - #[serde(skip_serializing_if = "Option::is_none")] - pub payment_details: Option, - - /// Configuration for the payments embedded component. - #[serde(skip_serializing_if = "Option::is_none")] - pub payments: Option, - - /// Configuration for the payouts embedded component. - #[serde(skip_serializing_if = "Option::is_none")] - pub payouts: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreateAccountSessionComponentsAccountOnboarding { - - /// Whether the embedded component is enabled. - pub enabled: bool, - - /// The list of features enabled in the embedded component. - #[serde(skip_serializing_if = "Option::is_none")] - pub features: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreateAccountSessionComponentsPaymentDetails { - - /// Whether the embedded component is enabled. - pub enabled: bool, - - /// The list of features enabled in the embedded component. - #[serde(skip_serializing_if = "Option::is_none")] - pub features: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreateAccountSessionComponentsPayments { - - /// Whether the embedded component is enabled. - pub enabled: bool, - - /// The list of features enabled in the embedded component. - #[serde(skip_serializing_if = "Option::is_none")] - pub features: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreateAccountSessionComponentsPayouts { - - /// Whether the embedded component is enabled. - pub enabled: bool, - - /// The list of features enabled in the embedded component. - #[serde(skip_serializing_if = "Option::is_none")] - pub features: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreateAccountSessionComponentsAccountOnboardingFeatures { -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreateAccountSessionComponentsPaymentDetailsFeatures { - - /// Whether to allow capturing and cancelling payment intents. - /// - /// This is `true` by default. - #[serde(skip_serializing_if = "Option::is_none")] - pub capture_payments: Option, - - /// Whether to allow responding to disputes, including submitting evidence and accepting disputes. - /// - /// This is `true` by default. - #[serde(skip_serializing_if = "Option::is_none")] - pub dispute_management: Option, - - /// Whether to allow sending refunds. - /// - /// This is `true` by default. - #[serde(skip_serializing_if = "Option::is_none")] - pub refund_management: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreateAccountSessionComponentsPaymentsFeatures { - - /// Whether to allow capturing and cancelling payment intents. - /// - /// This is `true` by default. - #[serde(skip_serializing_if = "Option::is_none")] - pub capture_payments: Option, - - /// Whether to allow responding to disputes, including submitting evidence and accepting disputes. - /// - /// This is `true` by default. - #[serde(skip_serializing_if = "Option::is_none")] - pub dispute_management: Option, - - /// Whether to allow sending refunds. - /// - /// This is `true` by default. - #[serde(skip_serializing_if = "Option::is_none")] - pub refund_management: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreateAccountSessionComponentsPayoutsFeatures { - - /// Whether to allow payout schedule to be changed. - /// - /// Default `true` when Stripe owns Loss Liability, default `false` otherwise. - #[serde(skip_serializing_if = "Option::is_none")] - pub edit_payout_schedule: Option, - - /// Whether to allow creation of instant payouts. - /// - /// Default `true` when Stripe owns Loss Liability, default `false` otherwise. - #[serde(skip_serializing_if = "Option::is_none")] - pub instant_payouts: Option, - - /// Whether to allow creation of standard payouts. - /// - /// Default `true` when Stripe owns Loss Liability, default `false` otherwise. - #[serde(skip_serializing_if = "Option::is_none")] - pub standard_payouts: Option, -} diff --git a/src/resources/generated/account_updated.rs b/src/resources/generated/account_updated.rs deleted file mode 100644 index eb06d9d80..000000000 --- a/src/resources/generated/account_updated.rs +++ /dev/null @@ -1,10 +0,0 @@ -// ====================================== -// This file was automatically generated. -// ====================================== - -use serde::{Deserialize, Serialize}; - -/// The resource representing a Stripe "account.updated". -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct AccountUpdated { -} diff --git a/src/resources/generated/api_errors.rs b/src/resources/generated/api_errors.rs deleted file mode 100644 index ba4195c7b..000000000 --- a/src/resources/generated/api_errors.rs +++ /dev/null @@ -1,507 +0,0 @@ -// ====================================== -// This file was automatically generated. -// ====================================== - -use serde::{Deserialize, Serialize}; - -use crate::resources::{PaymentIntent, PaymentMethod, PaymentSource, SetupIntent}; - -/// The resource representing a Stripe "APIErrors". -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct ApiErrors { - /// For card errors, the ID of the failed charge. - #[serde(skip_serializing_if = "Option::is_none")] - pub charge: Option, - - /// For some errors that could be handled programmatically, a short string indicating the [error code](https://stripe.com/docs/error-codes) reported. - #[serde(skip_serializing_if = "Option::is_none")] - pub code: Option, - - /// For card errors resulting from a card issuer decline, a short string indicating the [card issuer's reason for the decline](https://stripe.com/docs/declines#issuer-declines) if they provide one. - #[serde(skip_serializing_if = "Option::is_none")] - pub decline_code: Option, - - /// A URL to more information about the [error code](https://stripe.com/docs/error-codes) reported. - #[serde(skip_serializing_if = "Option::is_none")] - pub doc_url: Option, - - /// A human-readable message providing more details about the error. - /// - /// For card errors, these messages can be shown to your users. - #[serde(skip_serializing_if = "Option::is_none")] - pub message: Option, - - /// If the error is parameter-specific, the parameter related to the error. - /// - /// For example, you can use this to display a message near the correct form field. - #[serde(skip_serializing_if = "Option::is_none")] - pub param: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub payment_intent: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub payment_method: Option, - - /// If the error is specific to the type of payment method, the payment method type that had a problem. - /// - /// This field is only populated for invoice-related errors. - #[serde(skip_serializing_if = "Option::is_none")] - pub payment_method_type: Option, - - /// A URL to the request log entry in your dashboard. - #[serde(skip_serializing_if = "Option::is_none")] - pub request_log_url: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub setup_intent: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub source: Option, - - /// The type of error returned. - /// - /// One of `api_error`, `card_error`, `idempotency_error`, or `invalid_request_error`. - #[serde(rename = "type")] - pub type_: ApiErrorsType, -} - -/// An enum representing the possible values of an `ApiErrors`'s `code` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum ApiErrorsCode { - AccountClosed, - AccountCountryInvalidAddress, - AccountErrorCountryChangeRequiresAdditionalSteps, - AccountInformationMismatch, - AccountInvalid, - AccountNumberInvalid, - AcssDebitSessionIncomplete, - AlipayUpgradeRequired, - AmountTooLarge, - AmountTooSmall, - ApiKeyExpired, - ApplicationFeesNotAllowed, - AuthenticationRequired, - BalanceInsufficient, - BalanceInvalidParameter, - BankAccountBadRoutingNumbers, - BankAccountDeclined, - BankAccountExists, - BankAccountRestricted, - BankAccountUnusable, - BankAccountUnverified, - BankAccountVerificationFailed, - BillingInvalidMandate, - BitcoinUpgradeRequired, - CaptureChargeAuthorizationExpired, - CaptureUnauthorizedPayment, - CardDeclineRateLimitExceeded, - CardDeclined, - CardholderPhoneNumberRequired, - ChargeAlreadyCaptured, - ChargeAlreadyRefunded, - ChargeDisputed, - ChargeExceedsSourceLimit, - ChargeExpiredForCapture, - ChargeInvalidParameter, - ChargeNotRefundable, - ClearingCodeUnsupported, - CountryCodeInvalid, - CountryUnsupported, - CouponExpired, - CustomerMaxPaymentMethods, - CustomerMaxSubscriptions, - CustomerTaxLocationInvalid, - DebitNotAuthorized, - EmailInvalid, - ExpiredCard, - FinancialConnectionsAccountInactive, - FinancialConnectionsNoSuccessfulTransactionRefresh, - IdempotencyKeyInUse, - IncorrectAddress, - IncorrectCvc, - IncorrectNumber, - IncorrectZip, - InstantPayoutsConfigDisabled, - InstantPayoutsCurrencyDisabled, - InstantPayoutsLimitExceeded, - InstantPayoutsUnsupported, - InsufficientFunds, - IntentInvalidState, - IntentVerificationMethodMissing, - InvalidCardType, - InvalidCharacters, - InvalidChargeAmount, - InvalidCvc, - InvalidExpiryMonth, - InvalidExpiryYear, - InvalidNumber, - InvalidSourceUsage, - InvalidTaxLocation, - InvoiceNoCustomerLineItems, - InvoiceNoPaymentMethodTypes, - InvoiceNoSubscriptionLineItems, - InvoiceNotEditable, - InvoiceOnBehalfOfNotEditable, - InvoicePaymentIntentRequiresAction, - InvoiceUpcomingNone, - LivemodeMismatch, - LockTimeout, - Missing, - NoAccount, - NotAllowedOnStandardAccount, - OutOfInventory, - OwnershipDeclarationNotAllowed, - ParameterInvalidEmpty, - ParameterInvalidInteger, - ParameterInvalidStringBlank, - ParameterInvalidStringEmpty, - ParameterMissing, - ParameterUnknown, - ParametersExclusive, - PaymentIntentActionRequired, - PaymentIntentAuthenticationFailure, - PaymentIntentIncompatiblePaymentMethod, - PaymentIntentInvalidParameter, - PaymentIntentKonbiniRejectedConfirmationNumber, - PaymentIntentMandateInvalid, - PaymentIntentPaymentAttemptExpired, - PaymentIntentPaymentAttemptFailed, - PaymentIntentUnexpectedState, - PaymentMethodBankAccountAlreadyVerified, - PaymentMethodBankAccountBlocked, - PaymentMethodBillingDetailsAddressMissing, - PaymentMethodConfigurationFailures, - PaymentMethodCurrencyMismatch, - PaymentMethodCustomerDecline, - PaymentMethodInvalidParameter, - PaymentMethodInvalidParameterTestmode, - PaymentMethodMicrodepositFailed, - PaymentMethodMicrodepositVerificationAmountsInvalid, - PaymentMethodMicrodepositVerificationAmountsMismatch, - PaymentMethodMicrodepositVerificationAttemptsExceeded, - PaymentMethodMicrodepositVerificationDescriptorCodeMismatch, - PaymentMethodMicrodepositVerificationTimeout, - PaymentMethodNotAvailable, - PaymentMethodProviderDecline, - PaymentMethodProviderTimeout, - PaymentMethodUnactivated, - PaymentMethodUnexpectedState, - PaymentMethodUnsupportedType, - PayoutReconciliationNotReady, - PayoutsLimitExceeded, - PayoutsNotAllowed, - PlatformAccountRequired, - PlatformApiKeyExpired, - PostalCodeInvalid, - ProcessingError, - ProductInactive, - ProgressiveOnboardingLimitExceeded, - RateLimit, - ReferToCustomer, - RefundDisputedPayment, - ResourceAlreadyExists, - ResourceMissing, - ReturnIntentAlreadyProcessed, - RoutingNumberInvalid, - SecretKeyRequired, - SepaUnsupportedAccount, - SetupAttemptFailed, - SetupIntentAuthenticationFailure, - SetupIntentInvalidParameter, - SetupIntentMandateInvalid, - SetupIntentSetupAttemptExpired, - SetupIntentUnexpectedState, - ShippingCalculationFailed, - SkuInactive, - StateUnsupported, - StatusTransitionInvalid, - StripeTaxInactive, - TaxIdInvalid, - TaxesCalculationFailed, - TerminalLocationCountryUnsupported, - TerminalReaderBusy, - TerminalReaderHardwareFault, - TerminalReaderOffline, - TerminalReaderTimeout, - TestmodeChargesOnly, - TlsVersionUnsupported, - TokenAlreadyUsed, - TokenCardNetworkInvalid, - TokenInUse, - TransferSourceBalanceParametersMismatch, - TransfersNotAllowed, - UrlInvalid, -} - -impl ApiErrorsCode { - pub fn as_str(self) -> &'static str { - match self { - ApiErrorsCode::AccountClosed => "account_closed", - ApiErrorsCode::AccountCountryInvalidAddress => "account_country_invalid_address", - ApiErrorsCode::AccountErrorCountryChangeRequiresAdditionalSteps => { - "account_error_country_change_requires_additional_steps" - } - ApiErrorsCode::AccountInformationMismatch => "account_information_mismatch", - ApiErrorsCode::AccountInvalid => "account_invalid", - ApiErrorsCode::AccountNumberInvalid => "account_number_invalid", - ApiErrorsCode::AcssDebitSessionIncomplete => "acss_debit_session_incomplete", - ApiErrorsCode::AlipayUpgradeRequired => "alipay_upgrade_required", - ApiErrorsCode::AmountTooLarge => "amount_too_large", - ApiErrorsCode::AmountTooSmall => "amount_too_small", - ApiErrorsCode::ApiKeyExpired => "api_key_expired", - ApiErrorsCode::ApplicationFeesNotAllowed => "application_fees_not_allowed", - ApiErrorsCode::AuthenticationRequired => "authentication_required", - ApiErrorsCode::BalanceInsufficient => "balance_insufficient", - ApiErrorsCode::BalanceInvalidParameter => "balance_invalid_parameter", - ApiErrorsCode::BankAccountBadRoutingNumbers => "bank_account_bad_routing_numbers", - ApiErrorsCode::BankAccountDeclined => "bank_account_declined", - ApiErrorsCode::BankAccountExists => "bank_account_exists", - ApiErrorsCode::BankAccountRestricted => "bank_account_restricted", - ApiErrorsCode::BankAccountUnusable => "bank_account_unusable", - ApiErrorsCode::BankAccountUnverified => "bank_account_unverified", - ApiErrorsCode::BankAccountVerificationFailed => "bank_account_verification_failed", - ApiErrorsCode::BillingInvalidMandate => "billing_invalid_mandate", - ApiErrorsCode::BitcoinUpgradeRequired => "bitcoin_upgrade_required", - ApiErrorsCode::CaptureChargeAuthorizationExpired => { - "capture_charge_authorization_expired" - } - ApiErrorsCode::CaptureUnauthorizedPayment => "capture_unauthorized_payment", - ApiErrorsCode::CardDeclineRateLimitExceeded => "card_decline_rate_limit_exceeded", - ApiErrorsCode::CardDeclined => "card_declined", - ApiErrorsCode::CardholderPhoneNumberRequired => "cardholder_phone_number_required", - ApiErrorsCode::ChargeAlreadyCaptured => "charge_already_captured", - ApiErrorsCode::ChargeAlreadyRefunded => "charge_already_refunded", - ApiErrorsCode::ChargeDisputed => "charge_disputed", - ApiErrorsCode::ChargeExceedsSourceLimit => "charge_exceeds_source_limit", - ApiErrorsCode::ChargeExpiredForCapture => "charge_expired_for_capture", - ApiErrorsCode::ChargeInvalidParameter => "charge_invalid_parameter", - ApiErrorsCode::ChargeNotRefundable => "charge_not_refundable", - ApiErrorsCode::ClearingCodeUnsupported => "clearing_code_unsupported", - ApiErrorsCode::CountryCodeInvalid => "country_code_invalid", - ApiErrorsCode::CountryUnsupported => "country_unsupported", - ApiErrorsCode::CouponExpired => "coupon_expired", - ApiErrorsCode::CustomerMaxPaymentMethods => "customer_max_payment_methods", - ApiErrorsCode::CustomerMaxSubscriptions => "customer_max_subscriptions", - ApiErrorsCode::CustomerTaxLocationInvalid => "customer_tax_location_invalid", - ApiErrorsCode::DebitNotAuthorized => "debit_not_authorized", - ApiErrorsCode::EmailInvalid => "email_invalid", - ApiErrorsCode::ExpiredCard => "expired_card", - ApiErrorsCode::FinancialConnectionsAccountInactive => { - "financial_connections_account_inactive" - } - ApiErrorsCode::FinancialConnectionsNoSuccessfulTransactionRefresh => { - "financial_connections_no_successful_transaction_refresh" - } - ApiErrorsCode::IdempotencyKeyInUse => "idempotency_key_in_use", - ApiErrorsCode::IncorrectAddress => "incorrect_address", - ApiErrorsCode::IncorrectCvc => "incorrect_cvc", - ApiErrorsCode::IncorrectNumber => "incorrect_number", - ApiErrorsCode::IncorrectZip => "incorrect_zip", - ApiErrorsCode::InstantPayoutsConfigDisabled => "instant_payouts_config_disabled", - ApiErrorsCode::InstantPayoutsCurrencyDisabled => "instant_payouts_currency_disabled", - ApiErrorsCode::InstantPayoutsLimitExceeded => "instant_payouts_limit_exceeded", - ApiErrorsCode::InstantPayoutsUnsupported => "instant_payouts_unsupported", - ApiErrorsCode::InsufficientFunds => "insufficient_funds", - ApiErrorsCode::IntentInvalidState => "intent_invalid_state", - ApiErrorsCode::IntentVerificationMethodMissing => "intent_verification_method_missing", - ApiErrorsCode::InvalidCardType => "invalid_card_type", - ApiErrorsCode::InvalidCharacters => "invalid_characters", - ApiErrorsCode::InvalidChargeAmount => "invalid_charge_amount", - ApiErrorsCode::InvalidCvc => "invalid_cvc", - ApiErrorsCode::InvalidExpiryMonth => "invalid_expiry_month", - ApiErrorsCode::InvalidExpiryYear => "invalid_expiry_year", - ApiErrorsCode::InvalidNumber => "invalid_number", - ApiErrorsCode::InvalidSourceUsage => "invalid_source_usage", - ApiErrorsCode::InvalidTaxLocation => "invalid_tax_location", - ApiErrorsCode::InvoiceNoCustomerLineItems => "invoice_no_customer_line_items", - ApiErrorsCode::InvoiceNoPaymentMethodTypes => "invoice_no_payment_method_types", - ApiErrorsCode::InvoiceNoSubscriptionLineItems => "invoice_no_subscription_line_items", - ApiErrorsCode::InvoiceNotEditable => "invoice_not_editable", - ApiErrorsCode::InvoiceOnBehalfOfNotEditable => "invoice_on_behalf_of_not_editable", - ApiErrorsCode::InvoicePaymentIntentRequiresAction => { - "invoice_payment_intent_requires_action" - } - ApiErrorsCode::InvoiceUpcomingNone => "invoice_upcoming_none", - ApiErrorsCode::LivemodeMismatch => "livemode_mismatch", - ApiErrorsCode::LockTimeout => "lock_timeout", - ApiErrorsCode::Missing => "missing", - ApiErrorsCode::NoAccount => "no_account", - ApiErrorsCode::NotAllowedOnStandardAccount => "not_allowed_on_standard_account", - ApiErrorsCode::OutOfInventory => "out_of_inventory", - ApiErrorsCode::OwnershipDeclarationNotAllowed => "ownership_declaration_not_allowed", - ApiErrorsCode::ParameterInvalidEmpty => "parameter_invalid_empty", - ApiErrorsCode::ParameterInvalidInteger => "parameter_invalid_integer", - ApiErrorsCode::ParameterInvalidStringBlank => "parameter_invalid_string_blank", - ApiErrorsCode::ParameterInvalidStringEmpty => "parameter_invalid_string_empty", - ApiErrorsCode::ParameterMissing => "parameter_missing", - ApiErrorsCode::ParameterUnknown => "parameter_unknown", - ApiErrorsCode::ParametersExclusive => "parameters_exclusive", - ApiErrorsCode::PaymentIntentActionRequired => "payment_intent_action_required", - ApiErrorsCode::PaymentIntentAuthenticationFailure => { - "payment_intent_authentication_failure" - } - ApiErrorsCode::PaymentIntentIncompatiblePaymentMethod => { - "payment_intent_incompatible_payment_method" - } - ApiErrorsCode::PaymentIntentInvalidParameter => "payment_intent_invalid_parameter", - ApiErrorsCode::PaymentIntentKonbiniRejectedConfirmationNumber => { - "payment_intent_konbini_rejected_confirmation_number" - } - ApiErrorsCode::PaymentIntentMandateInvalid => "payment_intent_mandate_invalid", - ApiErrorsCode::PaymentIntentPaymentAttemptExpired => { - "payment_intent_payment_attempt_expired" - } - ApiErrorsCode::PaymentIntentPaymentAttemptFailed => { - "payment_intent_payment_attempt_failed" - } - ApiErrorsCode::PaymentIntentUnexpectedState => "payment_intent_unexpected_state", - ApiErrorsCode::PaymentMethodBankAccountAlreadyVerified => { - "payment_method_bank_account_already_verified" - } - ApiErrorsCode::PaymentMethodBankAccountBlocked => "payment_method_bank_account_blocked", - ApiErrorsCode::PaymentMethodBillingDetailsAddressMissing => { - "payment_method_billing_details_address_missing" - } - ApiErrorsCode::PaymentMethodConfigurationFailures => { - "payment_method_configuration_failures" - } - ApiErrorsCode::PaymentMethodCurrencyMismatch => "payment_method_currency_mismatch", - ApiErrorsCode::PaymentMethodCustomerDecline => "payment_method_customer_decline", - ApiErrorsCode::PaymentMethodInvalidParameter => "payment_method_invalid_parameter", - ApiErrorsCode::PaymentMethodInvalidParameterTestmode => { - "payment_method_invalid_parameter_testmode" - } - ApiErrorsCode::PaymentMethodMicrodepositFailed => "payment_method_microdeposit_failed", - ApiErrorsCode::PaymentMethodMicrodepositVerificationAmountsInvalid => { - "payment_method_microdeposit_verification_amounts_invalid" - } - ApiErrorsCode::PaymentMethodMicrodepositVerificationAmountsMismatch => { - "payment_method_microdeposit_verification_amounts_mismatch" - } - ApiErrorsCode::PaymentMethodMicrodepositVerificationAttemptsExceeded => { - "payment_method_microdeposit_verification_attempts_exceeded" - } - ApiErrorsCode::PaymentMethodMicrodepositVerificationDescriptorCodeMismatch => { - "payment_method_microdeposit_verification_descriptor_code_mismatch" - } - ApiErrorsCode::PaymentMethodMicrodepositVerificationTimeout => { - "payment_method_microdeposit_verification_timeout" - } - ApiErrorsCode::PaymentMethodNotAvailable => "payment_method_not_available", - ApiErrorsCode::PaymentMethodProviderDecline => "payment_method_provider_decline", - ApiErrorsCode::PaymentMethodProviderTimeout => "payment_method_provider_timeout", - ApiErrorsCode::PaymentMethodUnactivated => "payment_method_unactivated", - ApiErrorsCode::PaymentMethodUnexpectedState => "payment_method_unexpected_state", - ApiErrorsCode::PaymentMethodUnsupportedType => "payment_method_unsupported_type", - ApiErrorsCode::PayoutReconciliationNotReady => "payout_reconciliation_not_ready", - ApiErrorsCode::PayoutsLimitExceeded => "payouts_limit_exceeded", - ApiErrorsCode::PayoutsNotAllowed => "payouts_not_allowed", - ApiErrorsCode::PlatformAccountRequired => "platform_account_required", - ApiErrorsCode::PlatformApiKeyExpired => "platform_api_key_expired", - ApiErrorsCode::PostalCodeInvalid => "postal_code_invalid", - ApiErrorsCode::ProcessingError => "processing_error", - ApiErrorsCode::ProductInactive => "product_inactive", - ApiErrorsCode::ProgressiveOnboardingLimitExceeded => { - "progressive_onboarding_limit_exceeded" - } - ApiErrorsCode::RateLimit => "rate_limit", - ApiErrorsCode::ReferToCustomer => "refer_to_customer", - ApiErrorsCode::RefundDisputedPayment => "refund_disputed_payment", - ApiErrorsCode::ResourceAlreadyExists => "resource_already_exists", - ApiErrorsCode::ResourceMissing => "resource_missing", - ApiErrorsCode::ReturnIntentAlreadyProcessed => "return_intent_already_processed", - ApiErrorsCode::RoutingNumberInvalid => "routing_number_invalid", - ApiErrorsCode::SecretKeyRequired => "secret_key_required", - ApiErrorsCode::SepaUnsupportedAccount => "sepa_unsupported_account", - ApiErrorsCode::SetupAttemptFailed => "setup_attempt_failed", - ApiErrorsCode::SetupIntentAuthenticationFailure => { - "setup_intent_authentication_failure" - } - ApiErrorsCode::SetupIntentInvalidParameter => "setup_intent_invalid_parameter", - ApiErrorsCode::SetupIntentMandateInvalid => "setup_intent_mandate_invalid", - ApiErrorsCode::SetupIntentSetupAttemptExpired => "setup_intent_setup_attempt_expired", - ApiErrorsCode::SetupIntentUnexpectedState => "setup_intent_unexpected_state", - ApiErrorsCode::ShippingCalculationFailed => "shipping_calculation_failed", - ApiErrorsCode::SkuInactive => "sku_inactive", - ApiErrorsCode::StateUnsupported => "state_unsupported", - ApiErrorsCode::StatusTransitionInvalid => "status_transition_invalid", - ApiErrorsCode::StripeTaxInactive => "stripe_tax_inactive", - ApiErrorsCode::TaxIdInvalid => "tax_id_invalid", - ApiErrorsCode::TaxesCalculationFailed => "taxes_calculation_failed", - ApiErrorsCode::TerminalLocationCountryUnsupported => { - "terminal_location_country_unsupported" - } - ApiErrorsCode::TerminalReaderBusy => "terminal_reader_busy", - ApiErrorsCode::TerminalReaderHardwareFault => "terminal_reader_hardware_fault", - ApiErrorsCode::TerminalReaderOffline => "terminal_reader_offline", - ApiErrorsCode::TerminalReaderTimeout => "terminal_reader_timeout", - ApiErrorsCode::TestmodeChargesOnly => "testmode_charges_only", - ApiErrorsCode::TlsVersionUnsupported => "tls_version_unsupported", - ApiErrorsCode::TokenAlreadyUsed => "token_already_used", - ApiErrorsCode::TokenCardNetworkInvalid => "token_card_network_invalid", - ApiErrorsCode::TokenInUse => "token_in_use", - ApiErrorsCode::TransferSourceBalanceParametersMismatch => { - "transfer_source_balance_parameters_mismatch" - } - ApiErrorsCode::TransfersNotAllowed => "transfers_not_allowed", - ApiErrorsCode::UrlInvalid => "url_invalid", - } - } -} - -impl AsRef for ApiErrorsCode { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for ApiErrorsCode { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for ApiErrorsCode { - fn default() -> Self { - Self::AccountClosed - } -} - -/// An enum representing the possible values of an `ApiErrors`'s `type` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum ApiErrorsType { - ApiError, - CardError, - IdempotencyError, - InvalidRequestError, -} - -impl ApiErrorsType { - pub fn as_str(self) -> &'static str { - match self { - ApiErrorsType::ApiError => "api_error", - ApiErrorsType::CardError => "card_error", - ApiErrorsType::IdempotencyError => "idempotency_error", - ApiErrorsType::InvalidRequestError => "invalid_request_error", - } - } -} - -impl AsRef for ApiErrorsType { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for ApiErrorsType { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for ApiErrorsType { - fn default() -> Self { - Self::ApiError - } -} diff --git a/src/resources/generated/apple_pay_domain.rs b/src/resources/generated/apple_pay_domain.rs deleted file mode 100644 index 4c5dd9344..000000000 --- a/src/resources/generated/apple_pay_domain.rs +++ /dev/null @@ -1,41 +0,0 @@ -// ====================================== -// This file was automatically generated. -// ====================================== - -use crate::ids::{ApplePayDomainId}; -use crate::params::{Object, Timestamp}; -use serde::{Deserialize, Serialize}; - -/// The resource representing a Stripe "ApplePayDomain". -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct ApplePayDomain { - /// Unique identifier for the object. - pub id: ApplePayDomainId, - - /// Time at which the object was created. - /// - /// Measured in seconds since the Unix epoch. - #[serde(skip_serializing_if = "Option::is_none")] - pub created: Option, - - // Always true for a deleted object - #[serde(default)] - pub deleted: bool, - - #[serde(skip_serializing_if = "Option::is_none")] - pub domain_name: Option, - - /// Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. - #[serde(skip_serializing_if = "Option::is_none")] - pub livemode: Option, -} - -impl Object for ApplePayDomain { - type Id = ApplePayDomainId; - fn id(&self) -> Self::Id { - self.id.clone() - } - fn object(&self) -> &'static str { - "apple_pay_domain" - } -} diff --git a/src/resources/generated/application.rs b/src/resources/generated/application.rs deleted file mode 100644 index 1ce12ce2c..000000000 --- a/src/resources/generated/application.rs +++ /dev/null @@ -1,32 +0,0 @@ -// ====================================== -// This file was automatically generated. -// ====================================== - -use serde::{Deserialize, Serialize}; - -use crate::ids::ApplicationId; -use crate::params::Object; - -/// The resource representing a Stripe "Application". -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct Application { - /// Unique identifier for the object. - pub id: ApplicationId, - - // Always true for a deleted object - #[serde(default)] - pub deleted: bool, - - /// The name of the application. - pub name: Option, -} - -impl Object for Application { - type Id = ApplicationId; - fn id(&self) -> Self::Id { - self.id.clone() - } - fn object(&self) -> &'static str { - "application" - } -} diff --git a/src/resources/generated/application_fee.rs b/src/resources/generated/application_fee.rs deleted file mode 100644 index 507ba112d..000000000 --- a/src/resources/generated/application_fee.rs +++ /dev/null @@ -1,150 +0,0 @@ -// ====================================== -// This file was automatically generated. -// ====================================== - -use serde::{Deserialize, Serialize}; - -use crate::client::{Client, Response}; -use crate::ids::{ApplicationFeeId, ChargeId}; -use crate::params::{Expand, Expandable, List, Object, Paginable, RangeQuery, Timestamp}; -use crate::resources::{ - Account, Application, ApplicationFeeRefund, BalanceTransaction, Charge, Currency, -}; - -/// The resource representing a Stripe "PlatformFee". -/// -/// For more details see -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct ApplicationFee { - /// Unique identifier for the object. - pub id: ApplicationFeeId, - - /// ID of the Stripe account this fee was taken from. - pub account: Expandable, - - /// Amount earned, in cents (or local equivalent). - pub amount: i64, - - /// Amount in cents (or local equivalent) refunded (can be less than the amount attribute on the fee if a partial refund was issued). - pub amount_refunded: i64, - - /// ID of the Connect application that earned the fee. - pub application: Expandable, - - /// Balance transaction that describes the impact of this collected application fee on your account balance (not including refunds). - pub balance_transaction: Option>, - - /// ID of the charge that the application fee was taken from. - pub charge: Expandable, - - /// Time at which the object was created. - /// - /// Measured in seconds since the Unix epoch. - pub created: Timestamp, - - /// Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. - /// - /// Must be a [supported currency](https://stripe.com/docs/currencies). - pub currency: Currency, - - /// Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. - pub livemode: bool, - - /// ID of the corresponding charge on the platform account, if this fee was the result of a charge using the `destination` parameter. - pub originating_transaction: Option>, - - /// Whether the fee has been fully refunded. - /// - /// If the fee is only partially refunded, this attribute will still be false. - pub refunded: bool, - - /// A list of refunds that have been applied to the fee. - pub refunds: List, -} - -impl ApplicationFee { - /// Returns a list of application fees you’ve previously collected. - /// - /// The application fees are returned in sorted order, with the most recent fees appearing first. - pub fn list( - client: &Client, - params: &ListApplicationFees<'_>, - ) -> Response> { - client.get_query("/application_fees", ¶ms) - } - - /// Retrieves the details of an application fee that your account has collected. - /// - /// The same information is returned when refunding the application fee. - pub fn retrieve( - client: &Client, - id: &ApplicationFeeId, - expand: &[&str], - ) -> Response { - client.get_query(&format!("/application_fees/{}", id), &Expand { expand }) - } -} - -impl Object for ApplicationFee { - type Id = ApplicationFeeId; - fn id(&self) -> Self::Id { - self.id.clone() - } - fn object(&self) -> &'static str { - "application_fee" - } -} - -/// The parameters for `ApplicationFee::list`. -#[derive(Clone, Debug, Serialize, Default)] -pub struct ListApplicationFees<'a> { - /// Only return application fees for the charge specified by this charge ID. - #[serde(skip_serializing_if = "Option::is_none")] - pub charge: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub created: Option>, - - /// A cursor for use in pagination. - /// - /// `ending_before` is an object ID that defines your place in the list. - /// For instance, if you make a list request and receive 100 objects, starting with `obj_bar`, your subsequent call can include `ending_before=obj_bar` in order to fetch the previous page of the list. - #[serde(skip_serializing_if = "Option::is_none")] - pub ending_before: Option, - - /// Specifies which fields in the response should be expanded. - #[serde(skip_serializing_if = "Expand::is_empty")] - pub expand: &'a [&'a str], - - /// A limit on the number of objects to be returned. - /// - /// Limit can range between 1 and 100, and the default is 10. - #[serde(skip_serializing_if = "Option::is_none")] - pub limit: Option, - - /// A cursor for use in pagination. - /// - /// `starting_after` is an object ID that defines your place in the list. - /// For instance, if you make a list request and receive 100 objects, ending with `obj_foo`, your subsequent call can include `starting_after=obj_foo` in order to fetch the next page of the list. - #[serde(skip_serializing_if = "Option::is_none")] - pub starting_after: Option, -} - -impl<'a> ListApplicationFees<'a> { - pub fn new() -> Self { - ListApplicationFees { - charge: Default::default(), - created: Default::default(), - ending_before: Default::default(), - expand: Default::default(), - limit: Default::default(), - starting_after: Default::default(), - } - } -} -impl Paginable for ListApplicationFees<'_> { - type O = ApplicationFee; - fn set_last(&mut self, item: Self::O) { - self.starting_after = Some(item.id()); - } -} diff --git a/src/resources/generated/application_fee_created.rs b/src/resources/generated/application_fee_created.rs deleted file mode 100644 index 54d84eafd..000000000 --- a/src/resources/generated/application_fee_created.rs +++ /dev/null @@ -1,10 +0,0 @@ -// ====================================== -// This file was automatically generated. -// ====================================== - -use serde::{Deserialize, Serialize}; - -/// The resource representing a Stripe "application_fee.created". -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct ApplicationFeeCreated { -} diff --git a/src/resources/generated/application_fee_refund_updated.rs b/src/resources/generated/application_fee_refund_updated.rs deleted file mode 100644 index bda112ec4..000000000 --- a/src/resources/generated/application_fee_refund_updated.rs +++ /dev/null @@ -1,10 +0,0 @@ -// ====================================== -// This file was automatically generated. -// ====================================== - -use serde::{Deserialize, Serialize}; - -/// The resource representing a Stripe "application_fee.refund.updated". -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct ApplicationFeeRefundUpdated { -} diff --git a/src/resources/generated/application_fee_refunded.rs b/src/resources/generated/application_fee_refunded.rs deleted file mode 100644 index 6f99b224d..000000000 --- a/src/resources/generated/application_fee_refunded.rs +++ /dev/null @@ -1,10 +0,0 @@ -// ====================================== -// This file was automatically generated. -// ====================================== - -use serde::{Deserialize, Serialize}; - -/// The resource representing a Stripe "application_fee.refunded". -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct ApplicationFeeRefunded { -} diff --git a/src/resources/generated/apps_secret.rs b/src/resources/generated/apps_secret.rs deleted file mode 100644 index 41af70203..000000000 --- a/src/resources/generated/apps_secret.rs +++ /dev/null @@ -1,93 +0,0 @@ -// ====================================== -// This file was automatically generated. -// ====================================== - -use crate::ids::{AppsSecretId}; -use crate::params::{Object, Timestamp}; -use serde::{Deserialize, Serialize}; - -/// The resource representing a Stripe "SecretServiceResourceSecret". -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct AppsSecret { - /// Unique identifier for the object. - pub id: AppsSecretId, - - /// Time at which the object was created. - /// - /// Measured in seconds since the Unix epoch. - pub created: Timestamp, - - /// If true, indicates that this secret has been deleted. - #[serde(skip_serializing_if = "Option::is_none")] - pub deleted: Option, - - /// The Unix timestamp for the expiry time of the secret, after which the secret deletes. - pub expires_at: Option, - - /// Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. - pub livemode: bool, - - /// A name for the secret that's unique within the scope. - pub name: String, - - /// The plaintext secret value to be stored. - pub payload: Option, - - pub scope: SecretServiceResourceScope, -} - -impl Object for AppsSecret { - type Id = AppsSecretId; - fn id(&self) -> Self::Id { - self.id.clone() - } - fn object(&self) -> &'static str { - "apps.secret" - } -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct SecretServiceResourceScope { - - /// The secret scope type. - #[serde(rename = "type")] - pub type_: SecretServiceResourceScopeType, - - /// The user ID, if type is set to "user". - #[serde(skip_serializing_if = "Option::is_none")] - pub user: Option, -} - -/// An enum representing the possible values of an `SecretServiceResourceScope`'s `type` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum SecretServiceResourceScopeType { - Account, - User, -} - -impl SecretServiceResourceScopeType { - pub fn as_str(self) -> &'static str { - match self { - SecretServiceResourceScopeType::Account => "account", - SecretServiceResourceScopeType::User => "user", - } - } -} - -impl AsRef for SecretServiceResourceScopeType { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for SecretServiceResourceScopeType { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for SecretServiceResourceScopeType { - fn default() -> Self { - Self::Account - } -} diff --git a/src/resources/generated/balance.rs b/src/resources/generated/balance.rs deleted file mode 100644 index fa9738044..000000000 --- a/src/resources/generated/balance.rs +++ /dev/null @@ -1,82 +0,0 @@ -// ====================================== -// This file was automatically generated. -// ====================================== - -use serde::{Deserialize, Serialize}; - -use crate::params::Object; -use crate::resources::{BalanceAmountBySourceType, Currency}; - -/// The resource representing a Stripe "Balance". -/// -/// For more details see -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct Balance { - /// Available funds that you can transfer or pay out automatically by Stripe or explicitly through the [Transfers API](https://stripe.com/docs/api#transfers) or [Payouts API](https://stripe.com/docs/api#payouts). - /// - /// You can find the available balance for each currency and payment type in the `source_types` property. - pub available: Vec, - - /// Funds held due to negative balances on connected Custom accounts. - /// - /// You can find the connect reserve balance for each currency and payment type in the `source_types` property. - #[serde(skip_serializing_if = "Option::is_none")] - pub connect_reserved: Option>, - - /// Funds that you can pay out using Instant Payouts. - #[serde(skip_serializing_if = "Option::is_none")] - pub instant_available: Option>, - - #[serde(skip_serializing_if = "Option::is_none")] - pub issuing: Option, - - /// Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. - pub livemode: bool, - - /// Funds that aren't available in the balance yet. - /// - /// You can find the pending balance for each currency and each payment type in the `source_types` property. - pub pending: Vec, -} - -impl Object for Balance { - type Id = (); - fn id(&self) -> Self::Id {} - fn object(&self) -> &'static str { - "balance" - } -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct BalanceAmount { - /// Balance amount. - pub amount: i64, - - /// Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. - /// - /// Must be a [supported currency](https://stripe.com/docs/currencies). - pub currency: Currency, - - #[serde(skip_serializing_if = "Option::is_none")] - pub source_types: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct BalanceAmountNet { - /// Balance amount. - pub amount: i64, - - /// Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. - /// - /// Must be a [supported currency](https://stripe.com/docs/currencies). - pub currency: Currency, - - #[serde(skip_serializing_if = "Option::is_none")] - pub source_types: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct BalanceDetail { - /// Funds that are available for use. - pub available: Vec, -} diff --git a/src/resources/generated/balance_available.rs b/src/resources/generated/balance_available.rs deleted file mode 100644 index fc21819cc..000000000 --- a/src/resources/generated/balance_available.rs +++ /dev/null @@ -1,10 +0,0 @@ -// ====================================== -// This file was automatically generated. -// ====================================== - -use serde::{Deserialize, Serialize}; - -/// The resource representing a Stripe "balance.available". -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct BalanceAvailable { -} diff --git a/src/resources/generated/balance_transaction.rs b/src/resources/generated/balance_transaction.rs deleted file mode 100644 index 17b9c5274..000000000 --- a/src/resources/generated/balance_transaction.rs +++ /dev/null @@ -1,323 +0,0 @@ -// ====================================== -// This file was automatically generated. -// ====================================== - -use serde::{Deserialize, Serialize}; - -use crate::client::{Client, Response}; -use crate::ids::{BalanceTransactionId, PayoutId, SourceId}; -use crate::params::{Expand, Expandable, List, Object, Paginable, RangeQuery, Timestamp}; -use crate::resources::{ - BalanceTransactionSourceUnion, BalanceTransactionStatus, Currency, FeeType, -}; - -/// The resource representing a Stripe "BalanceTransaction". -/// -/// For more details see -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct BalanceTransaction { - /// Unique identifier for the object. - pub id: BalanceTransactionId, - - /// Gross amount of this transaction (in cents (or local equivalent)). - /// - /// A positive value represents funds charged to another party, and a negative value represents funds sent to another party. - pub amount: i64, - - /// The date that the transaction's net funds become available in the Stripe balance. - pub available_on: Timestamp, - - /// Time at which the object was created. - /// - /// Measured in seconds since the Unix epoch. - pub created: Timestamp, - - /// Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. - /// - /// Must be a [supported currency](https://stripe.com/docs/currencies). - pub currency: Currency, - - /// An arbitrary string attached to the object. - /// - /// Often useful for displaying to users. - pub description: Option, - - /// If applicable, this transaction uses an exchange rate. - /// - /// If money converts from currency A to currency B, then the `amount` in currency A, multipled by the `exchange_rate`, equals the `amount` in currency B. - /// For example, if you charge a customer 10.00 EUR, the PaymentIntent's `amount` is `1000` and `currency` is `eur`. - /// If this converts to 12.34 USD in your Stripe account, the BalanceTransaction's `amount` is `1234`, its `currency` is `usd`, and the `exchange_rate` is `1.234`. - pub exchange_rate: Option, - - /// Fees (in cents (or local equivalent)) paid for this transaction. - /// - /// Represented as a positive integer when assessed. - pub fee: i64, - - /// Detailed breakdown of fees (in cents (or local equivalent)) paid for this transaction. - pub fee_details: Vec, - - /// Net impact to a Stripe balance (in cents (or local equivalent)). - /// - /// A positive value represents incrementing a Stripe balance, and a negative value decrementing a Stripe balance. - /// You can calculate the net impact of a transaction on a balance by `amount` - `fee`. - pub net: i64, - - /// Learn more about how [reporting categories](https://stripe.com/docs/reports/reporting-categories) can help you understand balance transactions from an accounting perspective. - pub reporting_category: String, - - /// This transaction relates to the Stripe object. - pub source: Option>, - - /// The transaction's net funds status in the Stripe balance, which are either `available` or `pending`. - pub status: BalanceTransactionStatus, - - /// Transaction type: `adjustment`, `advance`, `advance_funding`, `anticipation_repayment`, `application_fee`, `application_fee_refund`, `charge`, `climate_order_purchase`, `climate_order_refund`, `connect_collection_transfer`, `contribution`, `issuing_authorization_hold`, `issuing_authorization_release`, `issuing_dispute`, `issuing_transaction`, `obligation_outbound`, `obligation_reversal_inbound`, `payment`, `payment_failure_refund`, `payment_network_reserve_hold`, `payment_network_reserve_release`, `payment_refund`, `payment_reversal`, `payment_unreconciled`, `payout`, `payout_cancel`, `payout_failure`, `refund`, `refund_failure`, `reserve_transaction`, `reserved_funds`, `stripe_fee`, `stripe_fx_fee`, `tax_fee`, `topup`, `topup_reversal`, `transfer`, `transfer_cancel`, `transfer_failure`, or `transfer_refund`. - /// - /// Learn more about [balance transaction types and what they represent](https://stripe.com/docs/reports/balance-transaction-types). - /// To classify transactions for accounting purposes, consider `reporting_category` instead. - #[serde(rename = "type")] - pub type_: BalanceTransactionType, -} - -impl BalanceTransaction { - /// Returns a list of transactions that have contributed to the Stripe account balance (e.g., charges, transfers, and so forth). - /// - /// The transactions are returned in sorted order, with the most recent transactions appearing first. Note that this endpoint was previously called “Balance history” and used the path `/v1/balance/history`. - pub fn list( - client: &Client, - params: &ListBalanceTransactions<'_>, - ) -> Response> { - client.get_query("/balance_transactions", ¶ms) - } - - /// Retrieves the balance transaction with the given ID. - /// - /// Note that this endpoint previously used the path `/v1/balance/history/:id`. - pub fn retrieve( - client: &Client, - id: &BalanceTransactionId, - expand: &[&str], - ) -> Response { - client.get_query(&format!("/balance_transactions/{}", id), &Expand { expand }) - } -} - -impl Object for BalanceTransaction { - type Id = BalanceTransactionId; - fn id(&self) -> Self::Id { - self.id.clone() - } - fn object(&self) -> &'static str { - "balance_transaction" - } -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct Fee { - /// Amount of the fee, in cents. - pub amount: i64, - - /// ID of the Connect application that earned the fee. - pub application: Option, - - /// Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. - /// - /// Must be a [supported currency](https://stripe.com/docs/currencies). - pub currency: Currency, - - /// An arbitrary string attached to the object. - /// - /// Often useful for displaying to users. - pub description: Option, - - /// Type of the fee, one of: `application_fee`, `stripe_fee` or `tax`. - #[serde(rename = "type")] - pub type_: FeeType, -} - -/// The parameters for `BalanceTransaction::list`. -#[derive(Clone, Debug, Serialize, Default)] -pub struct ListBalanceTransactions<'a> { - #[serde(skip_serializing_if = "Option::is_none")] - pub created: Option>, - - /// Only return transactions in a certain currency. - /// - /// Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. - /// Must be a [supported currency](https://stripe.com/docs/currencies). - #[serde(skip_serializing_if = "Option::is_none")] - pub currency: Option, - - /// A cursor for use in pagination. - /// - /// `ending_before` is an object ID that defines your place in the list. - /// For instance, if you make a list request and receive 100 objects, starting with `obj_bar`, your subsequent call can include `ending_before=obj_bar` in order to fetch the previous page of the list. - #[serde(skip_serializing_if = "Option::is_none")] - pub ending_before: Option, - - /// Specifies which fields in the response should be expanded. - #[serde(skip_serializing_if = "Expand::is_empty")] - pub expand: &'a [&'a str], - - /// A limit on the number of objects to be returned. - /// - /// Limit can range between 1 and 100, and the default is 10. - #[serde(skip_serializing_if = "Option::is_none")] - pub limit: Option, - - /// For automatic Stripe payouts only, only returns transactions that were paid out on the specified payout ID. - #[serde(skip_serializing_if = "Option::is_none")] - pub payout: Option, - - /// Only returns the original transaction. - #[serde(skip_serializing_if = "Option::is_none")] - pub source: Option, - - /// A cursor for use in pagination. - /// - /// `starting_after` is an object ID that defines your place in the list. - /// For instance, if you make a list request and receive 100 objects, ending with `obj_foo`, your subsequent call can include `starting_after=obj_foo` in order to fetch the next page of the list. - #[serde(skip_serializing_if = "Option::is_none")] - pub starting_after: Option, - - /// Only returns transactions of the given type. - /// - /// One of: `adjustment`, `advance`, `advance_funding`, `anticipation_repayment`, `application_fee`, `application_fee_refund`, `charge`, `climate_order_purchase`, `climate_order_refund`, `connect_collection_transfer`, `contribution`, `issuing_authorization_hold`, `issuing_authorization_release`, `issuing_dispute`, `issuing_transaction`, `obligation_outbound`, `obligation_reversal_inbound`, `payment`, `payment_failure_refund`, `payment_network_reserve_hold`, `payment_network_reserve_release`, `payment_refund`, `payment_reversal`, `payment_unreconciled`, `payout`, `payout_cancel`, `payout_failure`, `refund`, `refund_failure`, `reserve_transaction`, `reserved_funds`, `stripe_fee`, `stripe_fx_fee`, `tax_fee`, `topup`, `topup_reversal`, `transfer`, `transfer_cancel`, `transfer_failure`, or `transfer_refund`. - #[serde(rename = "type")] - #[serde(skip_serializing_if = "Option::is_none")] - pub type_: Option<&'a str>, -} - -impl<'a> ListBalanceTransactions<'a> { - pub fn new() -> Self { - ListBalanceTransactions { - created: Default::default(), - currency: Default::default(), - ending_before: Default::default(), - expand: Default::default(), - limit: Default::default(), - payout: Default::default(), - source: Default::default(), - starting_after: Default::default(), - type_: Default::default(), - } - } -} -impl Paginable for ListBalanceTransactions<'_> { - type O = BalanceTransaction; - fn set_last(&mut self, item: Self::O) { - self.starting_after = Some(item.id()); - } -} -/// An enum representing the possible values of an `BalanceTransaction`'s `type` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum BalanceTransactionType { - Adjustment, - Advance, - AdvanceFunding, - AnticipationRepayment, - ApplicationFee, - ApplicationFeeRefund, - Charge, - ClimateOrderPurchase, - ClimateOrderRefund, - ConnectCollectionTransfer, - Contribution, - IssuingAuthorizationHold, - IssuingAuthorizationRelease, - IssuingDispute, - IssuingTransaction, - ObligationOutbound, - ObligationReversalInbound, - Payment, - PaymentFailureRefund, - PaymentNetworkReserveHold, - PaymentNetworkReserveRelease, - PaymentRefund, - PaymentReversal, - PaymentUnreconciled, - Payout, - PayoutCancel, - PayoutFailure, - Refund, - RefundFailure, - ReserveTransaction, - ReservedFunds, - StripeFee, - StripeFxFee, - TaxFee, - Topup, - TopupReversal, - Transfer, - TransferCancel, - TransferFailure, - TransferRefund, -} - -impl BalanceTransactionType { - pub fn as_str(self) -> &'static str { - match self { - BalanceTransactionType::Adjustment => "adjustment", - BalanceTransactionType::Advance => "advance", - BalanceTransactionType::AdvanceFunding => "advance_funding", - BalanceTransactionType::AnticipationRepayment => "anticipation_repayment", - BalanceTransactionType::ApplicationFee => "application_fee", - BalanceTransactionType::ApplicationFeeRefund => "application_fee_refund", - BalanceTransactionType::Charge => "charge", - BalanceTransactionType::ClimateOrderPurchase => "climate_order_purchase", - BalanceTransactionType::ClimateOrderRefund => "climate_order_refund", - BalanceTransactionType::ConnectCollectionTransfer => "connect_collection_transfer", - BalanceTransactionType::Contribution => "contribution", - BalanceTransactionType::IssuingAuthorizationHold => "issuing_authorization_hold", - BalanceTransactionType::IssuingAuthorizationRelease => "issuing_authorization_release", - BalanceTransactionType::IssuingDispute => "issuing_dispute", - BalanceTransactionType::IssuingTransaction => "issuing_transaction", - BalanceTransactionType::ObligationOutbound => "obligation_outbound", - BalanceTransactionType::ObligationReversalInbound => "obligation_reversal_inbound", - BalanceTransactionType::Payment => "payment", - BalanceTransactionType::PaymentFailureRefund => "payment_failure_refund", - BalanceTransactionType::PaymentNetworkReserveHold => "payment_network_reserve_hold", - BalanceTransactionType::PaymentNetworkReserveRelease => { - "payment_network_reserve_release" - } - BalanceTransactionType::PaymentRefund => "payment_refund", - BalanceTransactionType::PaymentReversal => "payment_reversal", - BalanceTransactionType::PaymentUnreconciled => "payment_unreconciled", - BalanceTransactionType::Payout => "payout", - BalanceTransactionType::PayoutCancel => "payout_cancel", - BalanceTransactionType::PayoutFailure => "payout_failure", - BalanceTransactionType::Refund => "refund", - BalanceTransactionType::RefundFailure => "refund_failure", - BalanceTransactionType::ReserveTransaction => "reserve_transaction", - BalanceTransactionType::ReservedFunds => "reserved_funds", - BalanceTransactionType::StripeFee => "stripe_fee", - BalanceTransactionType::StripeFxFee => "stripe_fx_fee", - BalanceTransactionType::TaxFee => "tax_fee", - BalanceTransactionType::Topup => "topup", - BalanceTransactionType::TopupReversal => "topup_reversal", - BalanceTransactionType::Transfer => "transfer", - BalanceTransactionType::TransferCancel => "transfer_cancel", - BalanceTransactionType::TransferFailure => "transfer_failure", - BalanceTransactionType::TransferRefund => "transfer_refund", - } - } -} - -impl AsRef for BalanceTransactionType { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for BalanceTransactionType { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for BalanceTransactionType { - fn default() -> Self { - Self::Adjustment - } -} diff --git a/src/resources/generated/bank_account.rs b/src/resources/generated/bank_account.rs deleted file mode 100644 index 5a845ec68..000000000 --- a/src/resources/generated/bank_account.rs +++ /dev/null @@ -1,392 +0,0 @@ -// ====================================== -// This file was automatically generated. -// ====================================== - -use serde::{Deserialize, Serialize}; - -use crate::ids::BankAccountId; -use crate::params::{Expandable, Metadata, Object}; -use crate::resources::{Account, BankAccountStatus, Currency, Customer}; - -/// The resource representing a Stripe "BankAccount". -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct BankAccount { - /// Unique identifier for the object. - pub id: BankAccountId, - - /// The ID of the account that the bank account is associated with. - #[serde(skip_serializing_if = "Option::is_none")] - pub account: Option>, - - /// The name of the person or business that owns the bank account. - #[serde(skip_serializing_if = "Option::is_none")] - pub account_holder_name: Option, - - /// The type of entity that holds the account. - /// - /// This can be either `individual` or `company`. - #[serde(skip_serializing_if = "Option::is_none")] - pub account_holder_type: Option, - - /// The bank account type. - /// - /// This can only be `checking` or `savings` in most countries. - /// In Japan, this can only be `futsu` or `toza`. - #[serde(skip_serializing_if = "Option::is_none")] - pub account_type: Option, - - /// A set of available payout methods for this bank account. - /// - /// Only values from this set should be passed as the `method` when creating a payout. - #[serde(skip_serializing_if = "Option::is_none")] - pub available_payout_methods: Option>, - - /// Name of the bank associated with the routing number (e.g., `WELLS FARGO`). - #[serde(skip_serializing_if = "Option::is_none")] - pub bank_name: Option, - - /// Two-letter ISO code representing the country the bank account is located in. - #[serde(skip_serializing_if = "Option::is_none")] - pub country: Option, - - /// Three-letter [ISO code for the currency](https://stripe.com/docs/payouts) paid out to the bank account. - pub currency: Currency, - - /// The ID of the customer that the bank account is associated with. - #[serde(skip_serializing_if = "Option::is_none")] - pub customer: Option>, - - /// Whether this bank account is the default external account for its currency. - #[serde(skip_serializing_if = "Option::is_none")] - pub default_for_currency: Option, - - // Always true for a deleted object - #[serde(default)] - pub deleted: bool, - - /// Uniquely identifies this particular bank account. - /// - /// You can use this attribute to check whether two bank accounts are the same. - #[serde(skip_serializing_if = "Option::is_none")] - pub fingerprint: Option, - - /// Information about the [upcoming new requirements for the bank account](https://stripe.com/docs/connect/custom-accounts/future-requirements), including what information needs to be collected, and by when. - #[serde(skip_serializing_if = "Option::is_none")] - pub future_requirements: Option, - - /// The last four digits of the bank account number. - #[serde(skip_serializing_if = "Option::is_none")] - pub last4: Option, - - /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. - /// - /// This can be useful for storing additional information about the object in a structured format. - #[serde(skip_serializing_if = "Option::is_none")] - pub metadata: Option, - - /// Information about the requirements for the bank account, including what information needs to be collected. - #[serde(skip_serializing_if = "Option::is_none")] - pub requirements: Option, - - /// The routing transit number for the bank account. - #[serde(skip_serializing_if = "Option::is_none")] - pub routing_number: Option, - - /// For bank accounts, possible values are `new`, `validated`, `verified`, `verification_failed`, or `errored`. - /// - /// A bank account that hasn't had any activity or validation performed is `new`. - /// If Stripe can determine that the bank account exists, its status will be `validated`. - /// Note that there often isn’t enough information to know (e.g., for smaller credit unions), and the validation is not always run. - /// If customer bank account verification has succeeded, the bank account status will be `verified`. - /// If the verification failed for any reason, such as microdeposit failure, the status will be `verification_failed`. - /// If a payout sent to this bank account fails, we'll set the status to `errored` and will not continue to send [scheduled payouts](https://stripe.com/docs/payouts#payout-schedule) until the bank details are updated. For external accounts, possible values are `new`, `errored` and `verification_failed`. - /// If a payouts fails, the status is set to `errored` and scheduled payouts are stopped until account details are updated. - /// In India, if we can't [verify the owner of the bank account](https://support.stripe.com/questions/bank-account-ownership-verification), we'll set the status to `verification_failed`. - /// Other validations aren't run against external accounts because they're only used for payouts. - /// This means the other statuses don't apply. - #[serde(skip_serializing_if = "Option::is_none")] - pub status: Option, -} - -impl Object for BankAccount { - type Id = BankAccountId; - fn id(&self) -> Self::Id { - self.id.clone() - } - fn object(&self) -> &'static str { - "bank_account" - } -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct ExternalAccountRequirements { - /// Fields that need to be collected to keep the external account enabled. - /// - /// If not collected by `current_deadline`, these fields appear in `past_due` as well, and the account is disabled. - pub currently_due: Option>, - - /// Fields that are `currently_due` and need to be collected again because validation or verification failed. - pub errors: Option>, - - /// Fields that weren't collected by `current_deadline`. - /// - /// These fields need to be collected to enable the external account. - pub past_due: Option>, - - /// Fields that may become required depending on the results of verification or review. - /// - /// Will be an empty array unless an asynchronous verification is pending. - /// If verification fails, these fields move to `eventually_due`, `currently_due`, or `past_due`. - pub pending_verification: Option>, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct AccountRequirementsError { - /// The code for the type of error. - pub code: AccountRequirementsErrorCode, - - /// An informative message that indicates the error type and provides additional details about the error. - pub reason: String, - - /// The specific user onboarding requirement field (in the requirements hash) that needs to be resolved. - pub requirement: String, -} - -/// An enum representing the possible values of an `AccountRequirementsError`'s `code` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum AccountRequirementsErrorCode { - InvalidAddressCityStatePostalCode, - InvalidAddressHighwayContractBox, - InvalidAddressPrivateMailbox, - InvalidBusinessProfileName, - InvalidBusinessProfileNameDenylisted, - InvalidCompanyNameDenylisted, - InvalidDobAgeOverMaximum, - #[serde(rename = "invalid_dob_age_under_18")] - InvalidDobAgeUnder18, - InvalidDobAgeUnderMinimum, - InvalidProductDescriptionLength, - InvalidProductDescriptionUrlMatch, - InvalidRepresentativeCountry, - InvalidStatementDescriptorBusinessMismatch, - InvalidStatementDescriptorDenylisted, - InvalidStatementDescriptorLength, - InvalidStatementDescriptorPrefixDenylisted, - InvalidStatementDescriptorPrefixMismatch, - InvalidStreetAddress, - InvalidTaxId, - InvalidTaxIdFormat, - InvalidTosAcceptance, - InvalidUrlDenylisted, - InvalidUrlFormat, - InvalidUrlLength, - InvalidUrlWebPresenceDetected, - InvalidUrlWebsiteBusinessInformationMismatch, - InvalidUrlWebsiteEmpty, - InvalidUrlWebsiteInaccessible, - InvalidUrlWebsiteInaccessibleGeoblocked, - InvalidUrlWebsiteInaccessiblePasswordProtected, - InvalidUrlWebsiteIncomplete, - InvalidUrlWebsiteIncompleteCancellationPolicy, - InvalidUrlWebsiteIncompleteCustomerServiceDetails, - InvalidUrlWebsiteIncompleteLegalRestrictions, - InvalidUrlWebsiteIncompleteRefundPolicy, - InvalidUrlWebsiteIncompleteReturnPolicy, - InvalidUrlWebsiteIncompleteTermsAndConditions, - InvalidUrlWebsiteIncompleteUnderConstruction, - InvalidUrlWebsiteOther, - InvalidValueOther, - VerificationDirectorsMismatch, - VerificationDocumentAddressMismatch, - VerificationDocumentAddressMissing, - VerificationDocumentCorrupt, - VerificationDocumentCountryNotSupported, - VerificationDocumentDirectorsMismatch, - VerificationDocumentDobMismatch, - VerificationDocumentDuplicateType, - VerificationDocumentExpired, - VerificationDocumentFailedCopy, - VerificationDocumentFailedGreyscale, - VerificationDocumentFailedOther, - VerificationDocumentFailedTestMode, - VerificationDocumentFraudulent, - VerificationDocumentIdNumberMismatch, - VerificationDocumentIdNumberMissing, - VerificationDocumentIncomplete, - VerificationDocumentInvalid, - VerificationDocumentIssueOrExpiryDateMissing, - VerificationDocumentManipulated, - VerificationDocumentMissingBack, - VerificationDocumentMissingFront, - VerificationDocumentNameMismatch, - VerificationDocumentNameMissing, - VerificationDocumentNationalityMismatch, - VerificationDocumentNotReadable, - VerificationDocumentNotSigned, - VerificationDocumentNotUploaded, - VerificationDocumentPhotoMismatch, - VerificationDocumentTooLarge, - VerificationDocumentTypeNotSupported, - VerificationExtraneousDirectors, - VerificationFailedAddressMatch, - VerificationFailedBusinessIecNumber, - VerificationFailedDocumentMatch, - VerificationFailedIdNumberMatch, - VerificationFailedKeyedIdentity, - VerificationFailedKeyedMatch, - VerificationFailedNameMatch, - VerificationFailedOther, - VerificationFailedResidentialAddress, - VerificationFailedTaxIdMatch, - VerificationFailedTaxIdNotIssued, - VerificationMissingDirectors, - VerificationMissingExecutives, - VerificationMissingOwners, - VerificationRequiresAdditionalMemorandumOfAssociations, -} - -impl AccountRequirementsErrorCode { - pub fn as_str(self) -> &'static str { - match self { - AccountRequirementsErrorCode::InvalidAddressCityStatePostalCode => "invalid_address_city_state_postal_code", - AccountRequirementsErrorCode::InvalidAddressHighwayContractBox => "invalid_address_highway_contract_box", - AccountRequirementsErrorCode::InvalidAddressPrivateMailbox => "invalid_address_private_mailbox", - AccountRequirementsErrorCode::InvalidBusinessProfileName => "invalid_business_profile_name", - AccountRequirementsErrorCode::InvalidBusinessProfileNameDenylisted => "invalid_business_profile_name_denylisted", - AccountRequirementsErrorCode::InvalidCompanyNameDenylisted => "invalid_company_name_denylisted", - AccountRequirementsErrorCode::InvalidDobAgeOverMaximum => "invalid_dob_age_over_maximum", - AccountRequirementsErrorCode::InvalidDobAgeUnder18 => "invalid_dob_age_under_18", - AccountRequirementsErrorCode::InvalidDobAgeUnderMinimum => "invalid_dob_age_under_minimum", - AccountRequirementsErrorCode::InvalidProductDescriptionLength => "invalid_product_description_length", - AccountRequirementsErrorCode::InvalidProductDescriptionUrlMatch => "invalid_product_description_url_match", - AccountRequirementsErrorCode::InvalidRepresentativeCountry => "invalid_representative_country", - AccountRequirementsErrorCode::InvalidStatementDescriptorBusinessMismatch => "invalid_statement_descriptor_business_mismatch", - AccountRequirementsErrorCode::InvalidStatementDescriptorDenylisted => "invalid_statement_descriptor_denylisted", - AccountRequirementsErrorCode::InvalidStatementDescriptorLength => "invalid_statement_descriptor_length", - AccountRequirementsErrorCode::InvalidStatementDescriptorPrefixDenylisted => "invalid_statement_descriptor_prefix_denylisted", - AccountRequirementsErrorCode::InvalidStatementDescriptorPrefixMismatch => "invalid_statement_descriptor_prefix_mismatch", - AccountRequirementsErrorCode::InvalidStreetAddress => "invalid_street_address", - AccountRequirementsErrorCode::InvalidTaxId => "invalid_tax_id", - AccountRequirementsErrorCode::InvalidTaxIdFormat => "invalid_tax_id_format", - AccountRequirementsErrorCode::InvalidTosAcceptance => "invalid_tos_acceptance", - AccountRequirementsErrorCode::InvalidUrlDenylisted => "invalid_url_denylisted", - AccountRequirementsErrorCode::InvalidUrlFormat => "invalid_url_format", - AccountRequirementsErrorCode::InvalidUrlLength => "invalid_url_length", - AccountRequirementsErrorCode::InvalidUrlWebPresenceDetected => "invalid_url_web_presence_detected", - AccountRequirementsErrorCode::InvalidUrlWebsiteBusinessInformationMismatch => "invalid_url_website_business_information_mismatch", - AccountRequirementsErrorCode::InvalidUrlWebsiteEmpty => "invalid_url_website_empty", - AccountRequirementsErrorCode::InvalidUrlWebsiteInaccessible => "invalid_url_website_inaccessible", - AccountRequirementsErrorCode::InvalidUrlWebsiteInaccessibleGeoblocked => "invalid_url_website_inaccessible_geoblocked", - AccountRequirementsErrorCode::InvalidUrlWebsiteInaccessiblePasswordProtected => "invalid_url_website_inaccessible_password_protected", - AccountRequirementsErrorCode::InvalidUrlWebsiteIncomplete => "invalid_url_website_incomplete", - AccountRequirementsErrorCode::InvalidUrlWebsiteIncompleteCancellationPolicy => "invalid_url_website_incomplete_cancellation_policy", - AccountRequirementsErrorCode::InvalidUrlWebsiteIncompleteCustomerServiceDetails => "invalid_url_website_incomplete_customer_service_details", - AccountRequirementsErrorCode::InvalidUrlWebsiteIncompleteLegalRestrictions => "invalid_url_website_incomplete_legal_restrictions", - AccountRequirementsErrorCode::InvalidUrlWebsiteIncompleteRefundPolicy => "invalid_url_website_incomplete_refund_policy", - AccountRequirementsErrorCode::InvalidUrlWebsiteIncompleteReturnPolicy => "invalid_url_website_incomplete_return_policy", - AccountRequirementsErrorCode::InvalidUrlWebsiteIncompleteTermsAndConditions => "invalid_url_website_incomplete_terms_and_conditions", - AccountRequirementsErrorCode::InvalidUrlWebsiteIncompleteUnderConstruction => "invalid_url_website_incomplete_under_construction", - AccountRequirementsErrorCode::InvalidUrlWebsiteOther => "invalid_url_website_other", - AccountRequirementsErrorCode::InvalidValueOther => "invalid_value_other", - AccountRequirementsErrorCode::VerificationDirectorsMismatch => "verification_directors_mismatch", - AccountRequirementsErrorCode::VerificationDocumentAddressMismatch => "verification_document_address_mismatch", - AccountRequirementsErrorCode::VerificationDocumentAddressMissing => "verification_document_address_missing", - AccountRequirementsErrorCode::VerificationDocumentCorrupt => "verification_document_corrupt", - AccountRequirementsErrorCode::VerificationDocumentCountryNotSupported => "verification_document_country_not_supported", - AccountRequirementsErrorCode::VerificationDocumentDirectorsMismatch => "verification_document_directors_mismatch", - AccountRequirementsErrorCode::VerificationDocumentDobMismatch => "verification_document_dob_mismatch", - AccountRequirementsErrorCode::VerificationDocumentDuplicateType => "verification_document_duplicate_type", - AccountRequirementsErrorCode::VerificationDocumentExpired => "verification_document_expired", - AccountRequirementsErrorCode::VerificationDocumentFailedCopy => "verification_document_failed_copy", - AccountRequirementsErrorCode::VerificationDocumentFailedGreyscale => "verification_document_failed_greyscale", - AccountRequirementsErrorCode::VerificationDocumentFailedOther => "verification_document_failed_other", - AccountRequirementsErrorCode::VerificationDocumentFailedTestMode => "verification_document_failed_test_mode", - AccountRequirementsErrorCode::VerificationDocumentFraudulent => "verification_document_fraudulent", - AccountRequirementsErrorCode::VerificationDocumentIdNumberMismatch => "verification_document_id_number_mismatch", - AccountRequirementsErrorCode::VerificationDocumentIdNumberMissing => "verification_document_id_number_missing", - AccountRequirementsErrorCode::VerificationDocumentIncomplete => "verification_document_incomplete", - AccountRequirementsErrorCode::VerificationDocumentInvalid => "verification_document_invalid", - AccountRequirementsErrorCode::VerificationDocumentIssueOrExpiryDateMissing => "verification_document_issue_or_expiry_date_missing", - AccountRequirementsErrorCode::VerificationDocumentManipulated => "verification_document_manipulated", - AccountRequirementsErrorCode::VerificationDocumentMissingBack => "verification_document_missing_back", - AccountRequirementsErrorCode::VerificationDocumentMissingFront => "verification_document_missing_front", - AccountRequirementsErrorCode::VerificationDocumentNameMismatch => "verification_document_name_mismatch", - AccountRequirementsErrorCode::VerificationDocumentNameMissing => "verification_document_name_missing", - AccountRequirementsErrorCode::VerificationDocumentNationalityMismatch => "verification_document_nationality_mismatch", - AccountRequirementsErrorCode::VerificationDocumentNotReadable => "verification_document_not_readable", - AccountRequirementsErrorCode::VerificationDocumentNotSigned => "verification_document_not_signed", - AccountRequirementsErrorCode::VerificationDocumentNotUploaded => "verification_document_not_uploaded", - AccountRequirementsErrorCode::VerificationDocumentPhotoMismatch => "verification_document_photo_mismatch", - AccountRequirementsErrorCode::VerificationDocumentTooLarge => "verification_document_too_large", - AccountRequirementsErrorCode::VerificationDocumentTypeNotSupported => "verification_document_type_not_supported", - AccountRequirementsErrorCode::VerificationExtraneousDirectors => "verification_extraneous_directors", - AccountRequirementsErrorCode::VerificationFailedAddressMatch => "verification_failed_address_match", - AccountRequirementsErrorCode::VerificationFailedBusinessIecNumber => "verification_failed_business_iec_number", - AccountRequirementsErrorCode::VerificationFailedDocumentMatch => "verification_failed_document_match", - AccountRequirementsErrorCode::VerificationFailedIdNumberMatch => "verification_failed_id_number_match", - AccountRequirementsErrorCode::VerificationFailedKeyedIdentity => "verification_failed_keyed_identity", - AccountRequirementsErrorCode::VerificationFailedKeyedMatch => "verification_failed_keyed_match", - AccountRequirementsErrorCode::VerificationFailedNameMatch => "verification_failed_name_match", - AccountRequirementsErrorCode::VerificationFailedOther => "verification_failed_other", - AccountRequirementsErrorCode::VerificationFailedResidentialAddress => "verification_failed_residential_address", - AccountRequirementsErrorCode::VerificationFailedTaxIdMatch => "verification_failed_tax_id_match", - AccountRequirementsErrorCode::VerificationFailedTaxIdNotIssued => "verification_failed_tax_id_not_issued", - AccountRequirementsErrorCode::VerificationMissingDirectors => "verification_missing_directors", - AccountRequirementsErrorCode::VerificationMissingExecutives => "verification_missing_executives", - AccountRequirementsErrorCode::VerificationMissingOwners => "verification_missing_owners", - AccountRequirementsErrorCode::VerificationRequiresAdditionalMemorandumOfAssociations => "verification_requires_additional_memorandum_of_associations", - } - } -} - -impl AsRef for AccountRequirementsErrorCode { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for AccountRequirementsErrorCode { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for AccountRequirementsErrorCode { - fn default() -> Self { - Self::InvalidAddressCityStatePostalCode - } -} - -/// An enum representing the possible values of an `BankAccount`'s `available_payout_methods` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum BankAccountAvailablePayoutMethods { - Instant, - Standard, -} - -impl BankAccountAvailablePayoutMethods { - pub fn as_str(self) -> &'static str { - match self { - BankAccountAvailablePayoutMethods::Instant => "instant", - BankAccountAvailablePayoutMethods::Standard => "standard", - } - } -} - -impl AsRef for BankAccountAvailablePayoutMethods { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for BankAccountAvailablePayoutMethods { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for BankAccountAvailablePayoutMethods { - fn default() -> Self { - Self::Instant - } -} diff --git a/src/resources/generated/bank_connections_resource_accountholder.rs b/src/resources/generated/bank_connections_resource_accountholder.rs deleted file mode 100644 index 35f3ac826..000000000 --- a/src/resources/generated/bank_connections_resource_accountholder.rs +++ /dev/null @@ -1,62 +0,0 @@ -// ====================================== -// This file was automatically generated. -// ====================================== - -use crate::params::{Expandable}; -use crate::resources::{Account, Customer}; -use serde::{Deserialize, Serialize}; - -/// The resource representing a Stripe "BankConnectionsResourceAccountholder". -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct BankConnectionsResourceAccountholder { - - /// The ID of the Stripe account this account belongs to. - /// - /// Should only be present if `account_holder.type` is `account`. - #[serde(skip_serializing_if = "Option::is_none")] - pub account: Option>, - - /// ID of the Stripe customer this account belongs to. - /// - /// Present if and only if `account_holder.type` is `customer`. - #[serde(skip_serializing_if = "Option::is_none")] - pub customer: Option>, - - /// Type of account holder that this account belongs to. - #[serde(rename = "type")] - pub type_: BankConnectionsResourceAccountholderType, -} - -/// An enum representing the possible values of an `BankConnectionsResourceAccountholder`'s `type` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum BankConnectionsResourceAccountholderType { - Account, - Customer, -} - -impl BankConnectionsResourceAccountholderType { - pub fn as_str(self) -> &'static str { - match self { - BankConnectionsResourceAccountholderType::Account => "account", - BankConnectionsResourceAccountholderType::Customer => "customer", - } - } -} - -impl AsRef for BankConnectionsResourceAccountholderType { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for BankConnectionsResourceAccountholderType { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for BankConnectionsResourceAccountholderType { - fn default() -> Self { - Self::Account - } -} diff --git a/src/resources/generated/billing_details.rs b/src/resources/generated/billing_details.rs deleted file mode 100644 index 76f9626cb..000000000 --- a/src/resources/generated/billing_details.rs +++ /dev/null @@ -1,23 +0,0 @@ -// ====================================== -// This file was automatically generated. -// ====================================== - -use serde::{Deserialize, Serialize}; - -use crate::resources::Address; - -/// The resource representing a Stripe "billing_details". -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct BillingDetails { - /// Billing address. - pub address: Option
, - - /// Email address. - pub email: Option, - - /// Full name. - pub name: Option, - - /// Billing phone number (including extension). - pub phone: Option, -} diff --git a/src/resources/generated/billing_portal_configuration.rs b/src/resources/generated/billing_portal_configuration.rs deleted file mode 100644 index 6a27997c3..000000000 --- a/src/resources/generated/billing_portal_configuration.rs +++ /dev/null @@ -1,418 +0,0 @@ -// ====================================== -// This file was automatically generated. -// ====================================== - -use serde::{Deserialize, Serialize}; - -use crate::ids::BillingPortalConfigurationId; -use crate::params::{Expandable, Metadata, Object, Timestamp}; -use crate::resources::Application; - -/// The resource representing a Stripe "PortalConfiguration". -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct BillingPortalConfiguration { - /// Unique identifier for the object. - pub id: BillingPortalConfigurationId, - - /// Whether the configuration is active and can be used to create portal sessions. - pub active: bool, - - /// ID of the Connect Application that created the configuration. - pub application: Option>, - - pub business_profile: PortalBusinessProfile, - - /// Time at which the object was created. - /// - /// Measured in seconds since the Unix epoch. - pub created: Timestamp, - - /// The default URL to redirect customers to when they click on the portal's link to return to your website. - /// - /// This can be [overriden](https://stripe.com/docs/api/customer_portal/sessions/create#create_portal_session-return_url) when creating the session. - pub default_return_url: Option, - - pub features: PortalFeatures, - - /// Whether the configuration is the default. - /// - /// If `true`, this configuration can be managed in the Dashboard and portal sessions will use this configuration unless it is overriden when creating the session. - pub is_default: bool, - - /// Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. - pub livemode: bool, - - pub login_page: PortalLoginPage, - - /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. - /// - /// This can be useful for storing additional information about the object in a structured format. - pub metadata: Option, - - /// Time at which the object was last updated. - /// - /// Measured in seconds since the Unix epoch. - pub updated: Timestamp, -} - -impl Object for BillingPortalConfiguration { - type Id = BillingPortalConfigurationId; - fn id(&self) -> Self::Id { - self.id.clone() - } - fn object(&self) -> &'static str { - "billing_portal.configuration" - } -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct PortalBusinessProfile { - /// The messaging shown to customers in the portal. - pub headline: Option, - - /// A link to the business’s publicly available privacy policy. - pub privacy_policy_url: Option, - - /// A link to the business’s publicly available terms of service. - pub terms_of_service_url: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct PortalFeatures { - pub customer_update: PortalCustomerUpdate, - - pub invoice_history: PortalInvoiceList, - - pub payment_method_update: PortalPaymentMethodUpdate, - - pub subscription_cancel: PortalSubscriptionCancel, - - pub subscription_pause: PortalSubscriptionPause, - - pub subscription_update: PortalSubscriptionUpdate, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct PortalCustomerUpdate { - /// The types of customer updates that are supported. - /// - /// When empty, customers are not updateable. - pub allowed_updates: Vec, - - /// Whether the feature is enabled. - pub enabled: bool, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct PortalInvoiceList { - /// Whether the feature is enabled. - pub enabled: bool, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct PortalLoginPage { - /// If `true`, a shareable `url` will be generated that will take your customers to a hosted login page for the customer portal. - /// - /// If `false`, the previously generated `url`, if any, will be deactivated. - pub enabled: bool, - - /// A shareable URL to the hosted portal login page. - /// - /// Your customers will be able to log in with their [email](https://stripe.com/docs/api/customers/object#customer_object-email) and receive a link to their customer portal. - pub url: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct PortalPaymentMethodUpdate { - /// Whether the feature is enabled. - pub enabled: bool, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct PortalSubscriptionCancel { - pub cancellation_reason: PortalSubscriptionCancellationReason, - - /// Whether the feature is enabled. - pub enabled: bool, - - /// Whether to cancel subscriptions immediately or at the end of the billing period. - pub mode: PortalSubscriptionCancelMode, - - /// Whether to create prorations when canceling subscriptions. - /// - /// Possible values are `none` and `create_prorations`. - pub proration_behavior: PortalSubscriptionCancelProrationBehavior, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct PortalSubscriptionCancellationReason { - /// Whether the feature is enabled. - pub enabled: bool, - - /// Which cancellation reasons will be given as options to the customer. - pub options: Vec, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct PortalSubscriptionPause { - /// Whether the feature is enabled. - pub enabled: bool, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct PortalSubscriptionUpdate { - /// The types of subscription updates that are supported for items listed in the `products` attribute. - /// - /// When empty, subscriptions are not updateable. - pub default_allowed_updates: Vec, - - /// Whether the feature is enabled. - pub enabled: bool, - - /// The list of up to 10 products that support subscription updates. - pub products: Option>, - - /// Determines how to handle prorations resulting from subscription updates. - /// - /// Valid values are `none`, `create_prorations`, and `always_invoice`. - pub proration_behavior: PortalSubscriptionUpdateProrationBehavior, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct PortalSubscriptionUpdateProduct { - /// The list of price IDs which, when subscribed to, a subscription can be updated. - pub prices: Vec, - - /// The product ID. - pub product: String, -} - -/// An enum representing the possible values of an `PortalCustomerUpdate`'s `allowed_updates` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum PortalCustomerUpdateAllowedUpdates { - Address, - Email, - Name, - Phone, - Shipping, - TaxId, -} - -impl PortalCustomerUpdateAllowedUpdates { - pub fn as_str(self) -> &'static str { - match self { - PortalCustomerUpdateAllowedUpdates::Address => "address", - PortalCustomerUpdateAllowedUpdates::Email => "email", - PortalCustomerUpdateAllowedUpdates::Name => "name", - PortalCustomerUpdateAllowedUpdates::Phone => "phone", - PortalCustomerUpdateAllowedUpdates::Shipping => "shipping", - PortalCustomerUpdateAllowedUpdates::TaxId => "tax_id", - } - } -} - -impl AsRef for PortalCustomerUpdateAllowedUpdates { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for PortalCustomerUpdateAllowedUpdates { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for PortalCustomerUpdateAllowedUpdates { - fn default() -> Self { - Self::Address - } -} - -/// An enum representing the possible values of an `PortalSubscriptionCancel`'s `mode` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum PortalSubscriptionCancelMode { - AtPeriodEnd, - Immediately, -} - -impl PortalSubscriptionCancelMode { - pub fn as_str(self) -> &'static str { - match self { - PortalSubscriptionCancelMode::AtPeriodEnd => "at_period_end", - PortalSubscriptionCancelMode::Immediately => "immediately", - } - } -} - -impl AsRef for PortalSubscriptionCancelMode { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for PortalSubscriptionCancelMode { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for PortalSubscriptionCancelMode { - fn default() -> Self { - Self::AtPeriodEnd - } -} - -/// An enum representing the possible values of an `PortalSubscriptionCancel`'s `proration_behavior` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum PortalSubscriptionCancelProrationBehavior { - AlwaysInvoice, - CreateProrations, - None, -} - -impl PortalSubscriptionCancelProrationBehavior { - pub fn as_str(self) -> &'static str { - match self { - PortalSubscriptionCancelProrationBehavior::AlwaysInvoice => "always_invoice", - PortalSubscriptionCancelProrationBehavior::CreateProrations => "create_prorations", - PortalSubscriptionCancelProrationBehavior::None => "none", - } - } -} - -impl AsRef for PortalSubscriptionCancelProrationBehavior { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for PortalSubscriptionCancelProrationBehavior { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for PortalSubscriptionCancelProrationBehavior { - fn default() -> Self { - Self::AlwaysInvoice - } -} - -/// An enum representing the possible values of an `PortalSubscriptionCancellationReason`'s `options` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum PortalSubscriptionCancellationReasonOptions { - CustomerService, - LowQuality, - MissingFeatures, - Other, - SwitchedService, - TooComplex, - TooExpensive, - Unused, -} - -impl PortalSubscriptionCancellationReasonOptions { - pub fn as_str(self) -> &'static str { - match self { - PortalSubscriptionCancellationReasonOptions::CustomerService => "customer_service", - PortalSubscriptionCancellationReasonOptions::LowQuality => "low_quality", - PortalSubscriptionCancellationReasonOptions::MissingFeatures => "missing_features", - PortalSubscriptionCancellationReasonOptions::Other => "other", - PortalSubscriptionCancellationReasonOptions::SwitchedService => "switched_service", - PortalSubscriptionCancellationReasonOptions::TooComplex => "too_complex", - PortalSubscriptionCancellationReasonOptions::TooExpensive => "too_expensive", - PortalSubscriptionCancellationReasonOptions::Unused => "unused", - } - } -} - -impl AsRef for PortalSubscriptionCancellationReasonOptions { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for PortalSubscriptionCancellationReasonOptions { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for PortalSubscriptionCancellationReasonOptions { - fn default() -> Self { - Self::CustomerService - } -} - -/// An enum representing the possible values of an `PortalSubscriptionUpdate`'s `default_allowed_updates` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum PortalSubscriptionUpdateDefaultAllowedUpdates { - Price, - PromotionCode, - Quantity, -} - -impl PortalSubscriptionUpdateDefaultAllowedUpdates { - pub fn as_str(self) -> &'static str { - match self { - PortalSubscriptionUpdateDefaultAllowedUpdates::Price => "price", - PortalSubscriptionUpdateDefaultAllowedUpdates::PromotionCode => "promotion_code", - PortalSubscriptionUpdateDefaultAllowedUpdates::Quantity => "quantity", - } - } -} - -impl AsRef for PortalSubscriptionUpdateDefaultAllowedUpdates { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for PortalSubscriptionUpdateDefaultAllowedUpdates { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for PortalSubscriptionUpdateDefaultAllowedUpdates { - fn default() -> Self { - Self::Price - } -} - -/// An enum representing the possible values of an `PortalSubscriptionUpdate`'s `proration_behavior` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum PortalSubscriptionUpdateProrationBehavior { - AlwaysInvoice, - CreateProrations, - None, -} - -impl PortalSubscriptionUpdateProrationBehavior { - pub fn as_str(self) -> &'static str { - match self { - PortalSubscriptionUpdateProrationBehavior::AlwaysInvoice => "always_invoice", - PortalSubscriptionUpdateProrationBehavior::CreateProrations => "create_prorations", - PortalSubscriptionUpdateProrationBehavior::None => "none", - } - } -} - -impl AsRef for PortalSubscriptionUpdateProrationBehavior { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for PortalSubscriptionUpdateProrationBehavior { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for PortalSubscriptionUpdateProrationBehavior { - fn default() -> Self { - Self::AlwaysInvoice - } -} diff --git a/src/resources/generated/billing_portal_configuration_created.rs b/src/resources/generated/billing_portal_configuration_created.rs deleted file mode 100644 index 7f9d7ce2b..000000000 --- a/src/resources/generated/billing_portal_configuration_created.rs +++ /dev/null @@ -1,10 +0,0 @@ -// ====================================== -// This file was automatically generated. -// ====================================== - -use serde::{Deserialize, Serialize}; - -/// The resource representing a Stripe "billing_portal.configuration.created". -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct BillingPortalConfigurationCreated { -} diff --git a/src/resources/generated/billing_portal_configuration_updated.rs b/src/resources/generated/billing_portal_configuration_updated.rs deleted file mode 100644 index 26f14bc10..000000000 --- a/src/resources/generated/billing_portal_configuration_updated.rs +++ /dev/null @@ -1,10 +0,0 @@ -// ====================================== -// This file was automatically generated. -// ====================================== - -use serde::{Deserialize, Serialize}; - -/// The resource representing a Stripe "billing_portal.configuration.updated". -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct BillingPortalConfigurationUpdated { -} diff --git a/src/resources/generated/billing_portal_session.rs b/src/resources/generated/billing_portal_session.rs deleted file mode 100644 index f8cc2e323..000000000 --- a/src/resources/generated/billing_portal_session.rs +++ /dev/null @@ -1,729 +0,0 @@ -// ====================================== -// This file was automatically generated. -// ====================================== - -use serde::{Deserialize, Serialize}; - -use crate::client::{Client, Response}; -use crate::ids::{BillingPortalSessionId, CustomerId}; -use crate::params::{Expand, Expandable, Object, Timestamp}; -use crate::resources::BillingPortalConfiguration; - -/// The resource representing a Stripe "PortalSession". -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct BillingPortalSession { - /// Unique identifier for the object. - pub id: BillingPortalSessionId, - - /// The configuration used by this session, describing the features available. - pub configuration: Expandable, - - /// Time at which the object was created. - /// - /// Measured in seconds since the Unix epoch. - pub created: Timestamp, - - /// The ID of the customer for this session. - pub customer: String, - - /// Information about a specific flow for the customer to go through. - /// - /// See the [docs](https://stripe.com/docs/customer-management/portal-deep-links) to learn more about using customer portal deep links and flows. - pub flow: Option, - - /// Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. - pub livemode: bool, - - /// The IETF language tag of the locale Customer Portal is displayed in. - /// - /// If blank or auto, the customer’s `preferred_locales` or browser’s locale is used. - pub locale: Option, - - /// The account for which the session was created on behalf of. - /// - /// When specified, only subscriptions and invoices with this `on_behalf_of` account appear in the portal. - /// For more information, see the [docs](https://stripe.com/docs/connect/separate-charges-and-transfers#on-behalf-of). - /// Use the [Accounts API](https://stripe.com/docs/api/accounts/object#account_object-settings-branding) to modify the `on_behalf_of` account's branding settings, which the portal displays. - pub on_behalf_of: Option, - - /// The URL to redirect customers to when they click on the portal's link to return to your website. - pub return_url: Option, - - /// The short-lived URL of the session that gives customers access to the customer portal. - pub url: String, -} - -impl BillingPortalSession { - /// Creates a session of the customer portal. - pub fn create( - client: &Client, - params: CreateBillingPortalSession<'_>, - ) -> Response { - client.post_form("/billing_portal/sessions", ¶ms) - } -} - -impl Object for BillingPortalSession { - type Id = BillingPortalSessionId; - fn id(&self) -> Self::Id { - self.id.clone() - } - fn object(&self) -> &'static str { - "billing_portal.session" - } -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct PortalFlowsFlow { - pub after_completion: PortalFlowsFlowAfterCompletion, - - /// Configuration when `flow.type=subscription_cancel`. - pub subscription_cancel: Option, - - /// Configuration when `flow.type=subscription_update`. - pub subscription_update: Option, - - /// Configuration when `flow.type=subscription_update_confirm`. - pub subscription_update_confirm: Option, - - /// Type of flow that the customer will go through. - #[serde(rename = "type")] - pub type_: PortalFlowsFlowType, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct PortalFlowsFlowAfterCompletion { - /// Configuration when `after_completion.type=hosted_confirmation`. - pub hosted_confirmation: Option, - - /// Configuration when `after_completion.type=redirect`. - pub redirect: Option, - - /// The specified type of behavior after the flow is completed. - #[serde(rename = "type")] - pub type_: PortalFlowsFlowAfterCompletionType, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct PortalFlowsAfterCompletionHostedConfirmation { - /// A custom message to display to the customer after the flow is completed. - pub custom_message: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct PortalFlowsAfterCompletionRedirect { - /// The URL the customer will be redirected to after the flow is completed. - pub return_url: String, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct PortalFlowsFlowSubscriptionCancel { - /// Specify a retention strategy to be used in the cancellation flow. - pub retention: Option, - - /// The ID of the subscription to be canceled. - pub subscription: String, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct PortalFlowsFlowSubscriptionUpdate { - /// The ID of the subscription to be updated. - pub subscription: String, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct PortalFlowsFlowSubscriptionUpdateConfirm { - /// The coupon or promotion code to apply to this subscription update. - /// - /// Currently, only up to one may be specified. - pub discounts: Option>, - - /// The [subscription item](https://stripe.com/docs/api/subscription_items) to be updated through this flow. - /// - /// Currently, only up to one may be specified and subscriptions with multiple items are not updatable. - pub items: Vec, - - /// The ID of the subscription to be updated. - pub subscription: String, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct PortalFlowsRetention { - /// Configuration when `retention.type=coupon_offer`. - pub coupon_offer: Option, - - /// Type of retention strategy that will be used. - #[serde(rename = "type")] - pub type_: PortalFlowsRetentionType, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct PortalFlowsCouponOffer { - /// The ID of the coupon to be offered. - pub coupon: String, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct PortalFlowsSubscriptionUpdateConfirmDiscount { - /// The ID of the coupon to apply to this subscription update. - pub coupon: Option, - - /// The ID of a promotion code to apply to this subscription update. - pub promotion_code: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct PortalFlowsSubscriptionUpdateConfirmItem { - /// The ID of the [subscription item](https://stripe.com/docs/api/subscriptions/object#subscription_object-items-data-id) to be updated. - pub id: Option, - - /// The price the customer should subscribe to through this flow. - /// - /// The price must also be included in the configuration's [`features.subscription_update.products`](https://stripe.com/docs/api/customer_portal/configuration#portal_configuration_object-features-subscription_update-products). - pub price: Option, - - /// [Quantity](https://stripe.com/docs/subscriptions/quantities) for this item that the customer should subscribe to through this flow. - #[serde(skip_serializing_if = "Option::is_none")] - pub quantity: Option, -} - -/// The parameters for `BillingPortalSession::create`. -#[derive(Clone, Debug, Serialize)] -pub struct CreateBillingPortalSession<'a> { - /// The ID of an existing [configuration](https://stripe.com/docs/api/customer_portal/configuration) to use for this session, describing its functionality and features. - /// - /// If not specified, the session uses the default configuration. - #[serde(skip_serializing_if = "Option::is_none")] - pub configuration: Option<&'a str>, - - /// The ID of an existing customer. - pub customer: CustomerId, - - /// Specifies which fields in the response should be expanded. - #[serde(skip_serializing_if = "Expand::is_empty")] - pub expand: &'a [&'a str], - - /// Information about a specific flow for the customer to go through. - /// - /// See the [docs](https://stripe.com/docs/customer-management/portal-deep-links) to learn more about using customer portal deep links and flows. - #[serde(skip_serializing_if = "Option::is_none")] - pub flow_data: Option, - - /// The IETF language tag of the locale customer portal is displayed in. - /// - /// If blank or auto, the customer’s `preferred_locales` or browser’s locale is used. - #[serde(skip_serializing_if = "Option::is_none")] - pub locale: Option, - - /// The `on_behalf_of` account to use for this session. - /// - /// When specified, only subscriptions and invoices with this `on_behalf_of` account appear in the portal. - /// For more information, see the [docs](https://stripe.com/docs/connect/separate-charges-and-transfers#on-behalf-of). - /// Use the [Accounts API](https://stripe.com/docs/api/accounts/object#account_object-settings-branding) to modify the `on_behalf_of` account's branding settings, which the portal displays. - #[serde(skip_serializing_if = "Option::is_none")] - pub on_behalf_of: Option<&'a str>, - - /// The default URL to redirect customers to when they click on the portal's link to return to your website. - #[serde(skip_serializing_if = "Option::is_none")] - pub return_url: Option<&'a str>, -} - -impl<'a> CreateBillingPortalSession<'a> { - pub fn new(customer: CustomerId) -> Self { - CreateBillingPortalSession { - configuration: Default::default(), - customer, - expand: Default::default(), - flow_data: Default::default(), - locale: Default::default(), - on_behalf_of: Default::default(), - return_url: Default::default(), - } - } -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreateBillingPortalSessionFlowData { - /// Behavior after the flow is completed. - #[serde(skip_serializing_if = "Option::is_none")] - pub after_completion: Option, - - /// Configuration when `flow_data.type=subscription_cancel`. - #[serde(skip_serializing_if = "Option::is_none")] - pub subscription_cancel: Option, - - /// Configuration when `flow_data.type=subscription_update`. - #[serde(skip_serializing_if = "Option::is_none")] - pub subscription_update: Option, - - /// Configuration when `flow_data.type=subscription_update_confirm`. - #[serde(skip_serializing_if = "Option::is_none")] - pub subscription_update_confirm: - Option, - - /// Type of flow that the customer will go through. - #[serde(rename = "type")] - pub type_: CreateBillingPortalSessionFlowDataType, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreateBillingPortalSessionFlowDataAfterCompletion { - /// Configuration when `after_completion.type=hosted_confirmation`. - #[serde(skip_serializing_if = "Option::is_none")] - pub hosted_confirmation: - Option, - - /// Configuration when `after_completion.type=redirect`. - #[serde(skip_serializing_if = "Option::is_none")] - pub redirect: Option, - - /// The specified behavior after the flow is completed. - #[serde(rename = "type")] - pub type_: CreateBillingPortalSessionFlowDataAfterCompletionType, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreateBillingPortalSessionFlowDataSubscriptionCancel { - /// Specify a retention strategy to be used in the cancellation flow. - #[serde(skip_serializing_if = "Option::is_none")] - pub retention: Option, - - /// The ID of the subscription to be canceled. - pub subscription: String, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreateBillingPortalSessionFlowDataSubscriptionUpdate { - /// The ID of the subscription to be updated. - pub subscription: String, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreateBillingPortalSessionFlowDataSubscriptionUpdateConfirm { - /// The coupon or promotion code to apply to this subscription update. - /// - /// Currently, only up to one may be specified. - #[serde(skip_serializing_if = "Option::is_none")] - pub discounts: - Option>, - - /// The [subscription item](https://stripe.com/docs/api/subscription_items) to be updated through this flow. - /// - /// Currently, only up to one may be specified and subscriptions with multiple items are not updatable. - pub items: Vec, - - /// The ID of the subscription to be updated. - pub subscription: String, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreateBillingPortalSessionFlowDataAfterCompletionHostedConfirmation { - /// A custom message to display to the customer after the flow is completed. - #[serde(skip_serializing_if = "Option::is_none")] - pub custom_message: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreateBillingPortalSessionFlowDataAfterCompletionRedirect { - /// The URL the customer will be redirected to after the flow is completed. - pub return_url: String, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreateBillingPortalSessionFlowDataSubscriptionCancelRetention { - /// Configuration when `retention.type=coupon_offer`. - pub coupon_offer: CreateBillingPortalSessionFlowDataSubscriptionCancelRetentionCouponOffer, - - /// Type of retention strategy to use with the customer. - #[serde(rename = "type")] - pub type_: CreateBillingPortalSessionFlowDataSubscriptionCancelRetentionType, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreateBillingPortalSessionFlowDataSubscriptionUpdateConfirmDiscounts { - /// The ID of the coupon to apply to this subscription update. - #[serde(skip_serializing_if = "Option::is_none")] - pub coupon: Option, - - /// The ID of a promotion code to apply to this subscription update. - #[serde(skip_serializing_if = "Option::is_none")] - pub promotion_code: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreateBillingPortalSessionFlowDataSubscriptionUpdateConfirmItems { - /// The ID of the [subscription item](https://stripe.com/docs/api/subscriptions/object#subscription_object-items-data-id) to be updated. - pub id: String, - - /// The price the customer should subscribe to through this flow. - /// - /// The price must also be included in the configuration's [`features.subscription_update.products`](https://stripe.com/docs/api/customer_portal/configuration#portal_configuration_object-features-subscription_update-products). - #[serde(skip_serializing_if = "Option::is_none")] - pub price: Option, - - /// [Quantity](https://stripe.com/docs/subscriptions/quantities) for this item that the customer should subscribe to through this flow. - #[serde(skip_serializing_if = "Option::is_none")] - pub quantity: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreateBillingPortalSessionFlowDataSubscriptionCancelRetentionCouponOffer { - /// The ID of the coupon to be offered. - pub coupon: String, -} - -/// An enum representing the possible values of an `BillingPortalSession`'s `locale` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum BillingPortalSessionLocale { - Auto, - Bg, - Cs, - Da, - De, - El, - En, - #[serde(rename = "en-AU")] - EnAu, - #[serde(rename = "en-CA")] - EnCa, - #[serde(rename = "en-GB")] - EnGb, - #[serde(rename = "en-IE")] - EnIe, - #[serde(rename = "en-IN")] - EnIn, - #[serde(rename = "en-NZ")] - EnNz, - #[serde(rename = "en-SG")] - EnSg, - Es, - #[serde(rename = "es-419")] - Es419, - Et, - Fi, - Fil, - Fr, - #[serde(rename = "fr-CA")] - FrCa, - Hr, - Hu, - Id, - It, - Ja, - Ko, - Lt, - Lv, - Ms, - Mt, - Nb, - Nl, - Pl, - Pt, - #[serde(rename = "pt-BR")] - PtBr, - Ro, - Ru, - Sk, - Sl, - Sv, - Th, - Tr, - Vi, - Zh, - #[serde(rename = "zh-HK")] - ZhHk, - #[serde(rename = "zh-TW")] - ZhTw, -} - -impl BillingPortalSessionLocale { - pub fn as_str(self) -> &'static str { - match self { - BillingPortalSessionLocale::Auto => "auto", - BillingPortalSessionLocale::Bg => "bg", - BillingPortalSessionLocale::Cs => "cs", - BillingPortalSessionLocale::Da => "da", - BillingPortalSessionLocale::De => "de", - BillingPortalSessionLocale::El => "el", - BillingPortalSessionLocale::En => "en", - BillingPortalSessionLocale::EnAu => "en-AU", - BillingPortalSessionLocale::EnCa => "en-CA", - BillingPortalSessionLocale::EnGb => "en-GB", - BillingPortalSessionLocale::EnIe => "en-IE", - BillingPortalSessionLocale::EnIn => "en-IN", - BillingPortalSessionLocale::EnNz => "en-NZ", - BillingPortalSessionLocale::EnSg => "en-SG", - BillingPortalSessionLocale::Es => "es", - BillingPortalSessionLocale::Es419 => "es-419", - BillingPortalSessionLocale::Et => "et", - BillingPortalSessionLocale::Fi => "fi", - BillingPortalSessionLocale::Fil => "fil", - BillingPortalSessionLocale::Fr => "fr", - BillingPortalSessionLocale::FrCa => "fr-CA", - BillingPortalSessionLocale::Hr => "hr", - BillingPortalSessionLocale::Hu => "hu", - BillingPortalSessionLocale::Id => "id", - BillingPortalSessionLocale::It => "it", - BillingPortalSessionLocale::Ja => "ja", - BillingPortalSessionLocale::Ko => "ko", - BillingPortalSessionLocale::Lt => "lt", - BillingPortalSessionLocale::Lv => "lv", - BillingPortalSessionLocale::Ms => "ms", - BillingPortalSessionLocale::Mt => "mt", - BillingPortalSessionLocale::Nb => "nb", - BillingPortalSessionLocale::Nl => "nl", - BillingPortalSessionLocale::Pl => "pl", - BillingPortalSessionLocale::Pt => "pt", - BillingPortalSessionLocale::PtBr => "pt-BR", - BillingPortalSessionLocale::Ro => "ro", - BillingPortalSessionLocale::Ru => "ru", - BillingPortalSessionLocale::Sk => "sk", - BillingPortalSessionLocale::Sl => "sl", - BillingPortalSessionLocale::Sv => "sv", - BillingPortalSessionLocale::Th => "th", - BillingPortalSessionLocale::Tr => "tr", - BillingPortalSessionLocale::Vi => "vi", - BillingPortalSessionLocale::Zh => "zh", - BillingPortalSessionLocale::ZhHk => "zh-HK", - BillingPortalSessionLocale::ZhTw => "zh-TW", - } - } -} - -impl AsRef for BillingPortalSessionLocale { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for BillingPortalSessionLocale { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for BillingPortalSessionLocale { - fn default() -> Self { - Self::Auto - } -} - -/// An enum representing the possible values of an `CreateBillingPortalSessionFlowDataAfterCompletion`'s `type` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CreateBillingPortalSessionFlowDataAfterCompletionType { - HostedConfirmation, - PortalHomepage, - Redirect, -} - -impl CreateBillingPortalSessionFlowDataAfterCompletionType { - pub fn as_str(self) -> &'static str { - match self { - CreateBillingPortalSessionFlowDataAfterCompletionType::HostedConfirmation => { - "hosted_confirmation" - } - CreateBillingPortalSessionFlowDataAfterCompletionType::PortalHomepage => { - "portal_homepage" - } - CreateBillingPortalSessionFlowDataAfterCompletionType::Redirect => "redirect", - } - } -} - -impl AsRef for CreateBillingPortalSessionFlowDataAfterCompletionType { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for CreateBillingPortalSessionFlowDataAfterCompletionType { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for CreateBillingPortalSessionFlowDataAfterCompletionType { - fn default() -> Self { - Self::HostedConfirmation - } -} - -/// An enum representing the possible values of an `CreateBillingPortalSessionFlowDataSubscriptionCancelRetention`'s `type` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CreateBillingPortalSessionFlowDataSubscriptionCancelRetentionType { - CouponOffer, -} - -impl CreateBillingPortalSessionFlowDataSubscriptionCancelRetentionType { - pub fn as_str(self) -> &'static str { - match self { - CreateBillingPortalSessionFlowDataSubscriptionCancelRetentionType::CouponOffer => { - "coupon_offer" - } - } - } -} - -impl AsRef for CreateBillingPortalSessionFlowDataSubscriptionCancelRetentionType { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for CreateBillingPortalSessionFlowDataSubscriptionCancelRetentionType { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for CreateBillingPortalSessionFlowDataSubscriptionCancelRetentionType { - fn default() -> Self { - Self::CouponOffer - } -} - -/// An enum representing the possible values of an `CreateBillingPortalSessionFlowData`'s `type` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CreateBillingPortalSessionFlowDataType { - PaymentMethodUpdate, - SubscriptionCancel, - SubscriptionUpdate, - SubscriptionUpdateConfirm, -} - -impl CreateBillingPortalSessionFlowDataType { - pub fn as_str(self) -> &'static str { - match self { - CreateBillingPortalSessionFlowDataType::PaymentMethodUpdate => "payment_method_update", - CreateBillingPortalSessionFlowDataType::SubscriptionCancel => "subscription_cancel", - CreateBillingPortalSessionFlowDataType::SubscriptionUpdate => "subscription_update", - CreateBillingPortalSessionFlowDataType::SubscriptionUpdateConfirm => { - "subscription_update_confirm" - } - } - } -} - -impl AsRef for CreateBillingPortalSessionFlowDataType { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for CreateBillingPortalSessionFlowDataType { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for CreateBillingPortalSessionFlowDataType { - fn default() -> Self { - Self::PaymentMethodUpdate - } -} - -/// An enum representing the possible values of an `PortalFlowsFlowAfterCompletion`'s `type` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum PortalFlowsFlowAfterCompletionType { - HostedConfirmation, - PortalHomepage, - Redirect, -} - -impl PortalFlowsFlowAfterCompletionType { - pub fn as_str(self) -> &'static str { - match self { - PortalFlowsFlowAfterCompletionType::HostedConfirmation => "hosted_confirmation", - PortalFlowsFlowAfterCompletionType::PortalHomepage => "portal_homepage", - PortalFlowsFlowAfterCompletionType::Redirect => "redirect", - } - } -} - -impl AsRef for PortalFlowsFlowAfterCompletionType { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for PortalFlowsFlowAfterCompletionType { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for PortalFlowsFlowAfterCompletionType { - fn default() -> Self { - Self::HostedConfirmation - } -} - -/// An enum representing the possible values of an `PortalFlowsFlow`'s `type` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum PortalFlowsFlowType { - PaymentMethodUpdate, - SubscriptionCancel, - SubscriptionUpdate, - SubscriptionUpdateConfirm, -} - -impl PortalFlowsFlowType { - pub fn as_str(self) -> &'static str { - match self { - PortalFlowsFlowType::PaymentMethodUpdate => "payment_method_update", - PortalFlowsFlowType::SubscriptionCancel => "subscription_cancel", - PortalFlowsFlowType::SubscriptionUpdate => "subscription_update", - PortalFlowsFlowType::SubscriptionUpdateConfirm => "subscription_update_confirm", - } - } -} - -impl AsRef for PortalFlowsFlowType { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for PortalFlowsFlowType { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for PortalFlowsFlowType { - fn default() -> Self { - Self::PaymentMethodUpdate - } -} - -/// An enum representing the possible values of an `PortalFlowsRetention`'s `type` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum PortalFlowsRetentionType { - CouponOffer, -} - -impl PortalFlowsRetentionType { - pub fn as_str(self) -> &'static str { - match self { - PortalFlowsRetentionType::CouponOffer => "coupon_offer", - } - } -} - -impl AsRef for PortalFlowsRetentionType { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for PortalFlowsRetentionType { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for PortalFlowsRetentionType { - fn default() -> Self { - Self::CouponOffer - } -} diff --git a/src/resources/generated/billing_portal_session_created.rs b/src/resources/generated/billing_portal_session_created.rs deleted file mode 100644 index f4c43a3db..000000000 --- a/src/resources/generated/billing_portal_session_created.rs +++ /dev/null @@ -1,10 +0,0 @@ -// ====================================== -// This file was automatically generated. -// ====================================== - -use serde::{Deserialize, Serialize}; - -/// The resource representing a Stripe "billing_portal.session.created". -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct BillingPortalSessionCreated { -} diff --git a/src/resources/generated/capability.rs b/src/resources/generated/capability.rs deleted file mode 100644 index c3b906ebb..000000000 --- a/src/resources/generated/capability.rs +++ /dev/null @@ -1,399 +0,0 @@ -// ====================================== -// This file was automatically generated. -// ====================================== - -use crate::ids::{CapabilityId}; -use crate::params::{Expandable, Object, Timestamp}; -use crate::resources::{Account}; -use serde::{Deserialize, Serialize}; - -/// The resource representing a Stripe "AccountCapability". -/// -/// For more details see -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct Capability { - /// The identifier for the capability. - pub id: CapabilityId, - - /// The account for which the capability enables functionality. - pub account: Expandable, - - #[serde(skip_serializing_if = "Option::is_none")] - pub future_requirements: Option, - - /// Whether the capability has been requested. - pub requested: bool, - - /// Time at which the capability was requested. - /// - /// Measured in seconds since the Unix epoch. - pub requested_at: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub requirements: Option, - - /// The status of the capability. - /// - /// Can be `active`, `inactive`, `pending`, or `unrequested`. - pub status: CapabilityStatus, -} - -impl Object for Capability { - type Id = CapabilityId; - fn id(&self) -> Self::Id { - self.id.clone() - } - fn object(&self) -> &'static str { - "capability" - } -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct AccountCapabilityFutureRequirements { - - /// Fields that are due and can be satisfied by providing the corresponding alternative fields instead. - pub alternatives: Option>, - - /// Date on which `future_requirements` merges with the main `requirements` hash and `future_requirements` becomes empty. - /// - /// After the transition, `currently_due` requirements may immediately become `past_due`, but the account may also be given a grace period depending on the capability's enablement state prior to transitioning. - pub current_deadline: Option, - - /// Fields that need to be collected to keep the capability enabled. - /// - /// If not collected by `future_requirements[current_deadline]`, these fields will transition to the main `requirements` hash. - pub currently_due: Vec, - - /// This is typed as a string for consistency with `requirements.disabled_reason`, but it safe to assume `future_requirements.disabled_reason` is empty because fields in `future_requirements` will never disable the account. - pub disabled_reason: Option, - - /// Fields that are `currently_due` and need to be collected again because validation or verification failed. - pub errors: Vec, - - /// Fields that need to be collected assuming all volume thresholds are reached. - /// - /// As they become required, they appear in `currently_due` as well. - pub eventually_due: Vec, - - /// Fields that weren't collected by `requirements.current_deadline`. - /// - /// These fields need to be collected to enable the capability on the account. - /// New fields will never appear here; `future_requirements.past_due` will always be a subset of `requirements.past_due`. - pub past_due: Vec, - - /// Fields that may become required depending on the results of verification or review. - /// - /// Will be an empty array unless an asynchronous verification is pending. - /// If verification fails, these fields move to `eventually_due` or `currently_due`. - pub pending_verification: Vec, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct AccountCapabilityRequirements { - - /// Fields that are due and can be satisfied by providing the corresponding alternative fields instead. - pub alternatives: Option>, - - /// Date by which the fields in `currently_due` must be collected to keep the capability enabled for the account. - /// - /// These fields may disable the capability sooner if the next threshold is reached before they are collected. - pub current_deadline: Option, - - /// Fields that need to be collected to keep the capability enabled. - /// - /// If not collected by `current_deadline`, these fields appear in `past_due` as well, and the capability is disabled. - pub currently_due: Vec, - - /// If the capability is disabled, this string describes why. - /// - /// Can be `requirements.past_due`, `requirements.pending_verification`, `listed`, `platform_paused`, `rejected.fraud`, `rejected.listed`, `rejected.terms_of_service`, `rejected.other`, `under_review`, or `other`. `rejected.unsupported_business` means that the account's business is not supported by the capability. - /// For example, payment methods may restrict the businesses they support in their terms of service: - [Afterpay Clearpay's terms of service](/afterpay-clearpay/legal#restricted-businesses) If you believe that the rejection is in error, please contact support at for assistance. - pub disabled_reason: Option, - - /// Fields that are `currently_due` and need to be collected again because validation or verification failed. - pub errors: Vec, - - /// Fields that need to be collected assuming all volume thresholds are reached. - /// - /// As they become required, they appear in `currently_due` as well, and `current_deadline` becomes set. - pub eventually_due: Vec, - - /// Fields that weren't collected by `current_deadline`. - /// - /// These fields need to be collected to enable the capability on the account. - pub past_due: Vec, - - /// Fields that may become required depending on the results of verification or review. - /// - /// Will be an empty array unless an asynchronous verification is pending. - /// If verification fails, these fields move to `eventually_due`, `currently_due`, or `past_due`. - pub pending_verification: Vec, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct AccountRequirementsAlternative { - - /// Fields that can be provided to satisfy all fields in `original_fields_due`. - pub alternative_fields_due: Vec, - - /// Fields that are due and can be satisfied by providing all fields in `alternative_fields_due`. - pub original_fields_due: Vec, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct AccountRequirementsError { - - /// The code for the type of error. - pub code: AccountRequirementsErrorCode, - - /// An informative message that indicates the error type and provides additional details about the error. - pub reason: String, - - /// The specific user onboarding requirement field (in the requirements hash) that needs to be resolved. - pub requirement: String, -} - -/// An enum representing the possible values of an `AccountRequirementsError`'s `code` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum AccountRequirementsErrorCode { - InvalidAddressCityStatePostalCode, - InvalidAddressHighwayContractBox, - InvalidAddressPrivateMailbox, - InvalidBusinessProfileName, - InvalidBusinessProfileNameDenylisted, - InvalidCompanyNameDenylisted, - InvalidDobAgeOverMaximum, - #[serde(rename = "invalid_dob_age_under_18")] - InvalidDobAgeUnder18, - InvalidDobAgeUnderMinimum, - InvalidProductDescriptionLength, - InvalidProductDescriptionUrlMatch, - InvalidRepresentativeCountry, - InvalidStatementDescriptorBusinessMismatch, - InvalidStatementDescriptorDenylisted, - InvalidStatementDescriptorLength, - InvalidStatementDescriptorPrefixDenylisted, - InvalidStatementDescriptorPrefixMismatch, - InvalidStreetAddress, - InvalidTaxId, - InvalidTaxIdFormat, - InvalidTosAcceptance, - InvalidUrlDenylisted, - InvalidUrlFormat, - InvalidUrlLength, - InvalidUrlWebPresenceDetected, - InvalidUrlWebsiteBusinessInformationMismatch, - InvalidUrlWebsiteEmpty, - InvalidUrlWebsiteInaccessible, - InvalidUrlWebsiteInaccessibleGeoblocked, - InvalidUrlWebsiteInaccessiblePasswordProtected, - InvalidUrlWebsiteIncomplete, - InvalidUrlWebsiteIncompleteCancellationPolicy, - InvalidUrlWebsiteIncompleteCustomerServiceDetails, - InvalidUrlWebsiteIncompleteLegalRestrictions, - InvalidUrlWebsiteIncompleteRefundPolicy, - InvalidUrlWebsiteIncompleteReturnPolicy, - InvalidUrlWebsiteIncompleteTermsAndConditions, - InvalidUrlWebsiteIncompleteUnderConstruction, - InvalidUrlWebsiteOther, - InvalidValueOther, - VerificationDirectorsMismatch, - VerificationDocumentAddressMismatch, - VerificationDocumentAddressMissing, - VerificationDocumentCorrupt, - VerificationDocumentCountryNotSupported, - VerificationDocumentDirectorsMismatch, - VerificationDocumentDobMismatch, - VerificationDocumentDuplicateType, - VerificationDocumentExpired, - VerificationDocumentFailedCopy, - VerificationDocumentFailedGreyscale, - VerificationDocumentFailedOther, - VerificationDocumentFailedTestMode, - VerificationDocumentFraudulent, - VerificationDocumentIdNumberMismatch, - VerificationDocumentIdNumberMissing, - VerificationDocumentIncomplete, - VerificationDocumentInvalid, - VerificationDocumentIssueOrExpiryDateMissing, - VerificationDocumentManipulated, - VerificationDocumentMissingBack, - VerificationDocumentMissingFront, - VerificationDocumentNameMismatch, - VerificationDocumentNameMissing, - VerificationDocumentNationalityMismatch, - VerificationDocumentNotReadable, - VerificationDocumentNotSigned, - VerificationDocumentNotUploaded, - VerificationDocumentPhotoMismatch, - VerificationDocumentTooLarge, - VerificationDocumentTypeNotSupported, - VerificationExtraneousDirectors, - VerificationFailedAddressMatch, - VerificationFailedBusinessIecNumber, - VerificationFailedDocumentMatch, - VerificationFailedIdNumberMatch, - VerificationFailedKeyedIdentity, - VerificationFailedKeyedMatch, - VerificationFailedNameMatch, - VerificationFailedOther, - VerificationFailedResidentialAddress, - VerificationFailedTaxIdMatch, - VerificationFailedTaxIdNotIssued, - VerificationMissingDirectors, - VerificationMissingExecutives, - VerificationMissingOwners, - VerificationRequiresAdditionalMemorandumOfAssociations, -} - -impl AccountRequirementsErrorCode { - pub fn as_str(self) -> &'static str { - match self { - AccountRequirementsErrorCode::InvalidAddressCityStatePostalCode => "invalid_address_city_state_postal_code", - AccountRequirementsErrorCode::InvalidAddressHighwayContractBox => "invalid_address_highway_contract_box", - AccountRequirementsErrorCode::InvalidAddressPrivateMailbox => "invalid_address_private_mailbox", - AccountRequirementsErrorCode::InvalidBusinessProfileName => "invalid_business_profile_name", - AccountRequirementsErrorCode::InvalidBusinessProfileNameDenylisted => "invalid_business_profile_name_denylisted", - AccountRequirementsErrorCode::InvalidCompanyNameDenylisted => "invalid_company_name_denylisted", - AccountRequirementsErrorCode::InvalidDobAgeOverMaximum => "invalid_dob_age_over_maximum", - AccountRequirementsErrorCode::InvalidDobAgeUnder18 => "invalid_dob_age_under_18", - AccountRequirementsErrorCode::InvalidDobAgeUnderMinimum => "invalid_dob_age_under_minimum", - AccountRequirementsErrorCode::InvalidProductDescriptionLength => "invalid_product_description_length", - AccountRequirementsErrorCode::InvalidProductDescriptionUrlMatch => "invalid_product_description_url_match", - AccountRequirementsErrorCode::InvalidRepresentativeCountry => "invalid_representative_country", - AccountRequirementsErrorCode::InvalidStatementDescriptorBusinessMismatch => "invalid_statement_descriptor_business_mismatch", - AccountRequirementsErrorCode::InvalidStatementDescriptorDenylisted => "invalid_statement_descriptor_denylisted", - AccountRequirementsErrorCode::InvalidStatementDescriptorLength => "invalid_statement_descriptor_length", - AccountRequirementsErrorCode::InvalidStatementDescriptorPrefixDenylisted => "invalid_statement_descriptor_prefix_denylisted", - AccountRequirementsErrorCode::InvalidStatementDescriptorPrefixMismatch => "invalid_statement_descriptor_prefix_mismatch", - AccountRequirementsErrorCode::InvalidStreetAddress => "invalid_street_address", - AccountRequirementsErrorCode::InvalidTaxId => "invalid_tax_id", - AccountRequirementsErrorCode::InvalidTaxIdFormat => "invalid_tax_id_format", - AccountRequirementsErrorCode::InvalidTosAcceptance => "invalid_tos_acceptance", - AccountRequirementsErrorCode::InvalidUrlDenylisted => "invalid_url_denylisted", - AccountRequirementsErrorCode::InvalidUrlFormat => "invalid_url_format", - AccountRequirementsErrorCode::InvalidUrlLength => "invalid_url_length", - AccountRequirementsErrorCode::InvalidUrlWebPresenceDetected => "invalid_url_web_presence_detected", - AccountRequirementsErrorCode::InvalidUrlWebsiteBusinessInformationMismatch => "invalid_url_website_business_information_mismatch", - AccountRequirementsErrorCode::InvalidUrlWebsiteEmpty => "invalid_url_website_empty", - AccountRequirementsErrorCode::InvalidUrlWebsiteInaccessible => "invalid_url_website_inaccessible", - AccountRequirementsErrorCode::InvalidUrlWebsiteInaccessibleGeoblocked => "invalid_url_website_inaccessible_geoblocked", - AccountRequirementsErrorCode::InvalidUrlWebsiteInaccessiblePasswordProtected => "invalid_url_website_inaccessible_password_protected", - AccountRequirementsErrorCode::InvalidUrlWebsiteIncomplete => "invalid_url_website_incomplete", - AccountRequirementsErrorCode::InvalidUrlWebsiteIncompleteCancellationPolicy => "invalid_url_website_incomplete_cancellation_policy", - AccountRequirementsErrorCode::InvalidUrlWebsiteIncompleteCustomerServiceDetails => "invalid_url_website_incomplete_customer_service_details", - AccountRequirementsErrorCode::InvalidUrlWebsiteIncompleteLegalRestrictions => "invalid_url_website_incomplete_legal_restrictions", - AccountRequirementsErrorCode::InvalidUrlWebsiteIncompleteRefundPolicy => "invalid_url_website_incomplete_refund_policy", - AccountRequirementsErrorCode::InvalidUrlWebsiteIncompleteReturnPolicy => "invalid_url_website_incomplete_return_policy", - AccountRequirementsErrorCode::InvalidUrlWebsiteIncompleteTermsAndConditions => "invalid_url_website_incomplete_terms_and_conditions", - AccountRequirementsErrorCode::InvalidUrlWebsiteIncompleteUnderConstruction => "invalid_url_website_incomplete_under_construction", - AccountRequirementsErrorCode::InvalidUrlWebsiteOther => "invalid_url_website_other", - AccountRequirementsErrorCode::InvalidValueOther => "invalid_value_other", - AccountRequirementsErrorCode::VerificationDirectorsMismatch => "verification_directors_mismatch", - AccountRequirementsErrorCode::VerificationDocumentAddressMismatch => "verification_document_address_mismatch", - AccountRequirementsErrorCode::VerificationDocumentAddressMissing => "verification_document_address_missing", - AccountRequirementsErrorCode::VerificationDocumentCorrupt => "verification_document_corrupt", - AccountRequirementsErrorCode::VerificationDocumentCountryNotSupported => "verification_document_country_not_supported", - AccountRequirementsErrorCode::VerificationDocumentDirectorsMismatch => "verification_document_directors_mismatch", - AccountRequirementsErrorCode::VerificationDocumentDobMismatch => "verification_document_dob_mismatch", - AccountRequirementsErrorCode::VerificationDocumentDuplicateType => "verification_document_duplicate_type", - AccountRequirementsErrorCode::VerificationDocumentExpired => "verification_document_expired", - AccountRequirementsErrorCode::VerificationDocumentFailedCopy => "verification_document_failed_copy", - AccountRequirementsErrorCode::VerificationDocumentFailedGreyscale => "verification_document_failed_greyscale", - AccountRequirementsErrorCode::VerificationDocumentFailedOther => "verification_document_failed_other", - AccountRequirementsErrorCode::VerificationDocumentFailedTestMode => "verification_document_failed_test_mode", - AccountRequirementsErrorCode::VerificationDocumentFraudulent => "verification_document_fraudulent", - AccountRequirementsErrorCode::VerificationDocumentIdNumberMismatch => "verification_document_id_number_mismatch", - AccountRequirementsErrorCode::VerificationDocumentIdNumberMissing => "verification_document_id_number_missing", - AccountRequirementsErrorCode::VerificationDocumentIncomplete => "verification_document_incomplete", - AccountRequirementsErrorCode::VerificationDocumentInvalid => "verification_document_invalid", - AccountRequirementsErrorCode::VerificationDocumentIssueOrExpiryDateMissing => "verification_document_issue_or_expiry_date_missing", - AccountRequirementsErrorCode::VerificationDocumentManipulated => "verification_document_manipulated", - AccountRequirementsErrorCode::VerificationDocumentMissingBack => "verification_document_missing_back", - AccountRequirementsErrorCode::VerificationDocumentMissingFront => "verification_document_missing_front", - AccountRequirementsErrorCode::VerificationDocumentNameMismatch => "verification_document_name_mismatch", - AccountRequirementsErrorCode::VerificationDocumentNameMissing => "verification_document_name_missing", - AccountRequirementsErrorCode::VerificationDocumentNationalityMismatch => "verification_document_nationality_mismatch", - AccountRequirementsErrorCode::VerificationDocumentNotReadable => "verification_document_not_readable", - AccountRequirementsErrorCode::VerificationDocumentNotSigned => "verification_document_not_signed", - AccountRequirementsErrorCode::VerificationDocumentNotUploaded => "verification_document_not_uploaded", - AccountRequirementsErrorCode::VerificationDocumentPhotoMismatch => "verification_document_photo_mismatch", - AccountRequirementsErrorCode::VerificationDocumentTooLarge => "verification_document_too_large", - AccountRequirementsErrorCode::VerificationDocumentTypeNotSupported => "verification_document_type_not_supported", - AccountRequirementsErrorCode::VerificationExtraneousDirectors => "verification_extraneous_directors", - AccountRequirementsErrorCode::VerificationFailedAddressMatch => "verification_failed_address_match", - AccountRequirementsErrorCode::VerificationFailedBusinessIecNumber => "verification_failed_business_iec_number", - AccountRequirementsErrorCode::VerificationFailedDocumentMatch => "verification_failed_document_match", - AccountRequirementsErrorCode::VerificationFailedIdNumberMatch => "verification_failed_id_number_match", - AccountRequirementsErrorCode::VerificationFailedKeyedIdentity => "verification_failed_keyed_identity", - AccountRequirementsErrorCode::VerificationFailedKeyedMatch => "verification_failed_keyed_match", - AccountRequirementsErrorCode::VerificationFailedNameMatch => "verification_failed_name_match", - AccountRequirementsErrorCode::VerificationFailedOther => "verification_failed_other", - AccountRequirementsErrorCode::VerificationFailedResidentialAddress => "verification_failed_residential_address", - AccountRequirementsErrorCode::VerificationFailedTaxIdMatch => "verification_failed_tax_id_match", - AccountRequirementsErrorCode::VerificationFailedTaxIdNotIssued => "verification_failed_tax_id_not_issued", - AccountRequirementsErrorCode::VerificationMissingDirectors => "verification_missing_directors", - AccountRequirementsErrorCode::VerificationMissingExecutives => "verification_missing_executives", - AccountRequirementsErrorCode::VerificationMissingOwners => "verification_missing_owners", - AccountRequirementsErrorCode::VerificationRequiresAdditionalMemorandumOfAssociations => "verification_requires_additional_memorandum_of_associations", - } - } -} - -impl AsRef for AccountRequirementsErrorCode { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for AccountRequirementsErrorCode { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for AccountRequirementsErrorCode { - fn default() -> Self { - Self::InvalidAddressCityStatePostalCode - } -} - -/// An enum representing the possible values of an `Capability`'s `status` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CapabilityStatus { - Active, - Disabled, - Inactive, - Pending, - Unrequested, -} - -impl CapabilityStatus { - pub fn as_str(self) -> &'static str { - match self { - CapabilityStatus::Active => "active", - CapabilityStatus::Disabled => "disabled", - CapabilityStatus::Inactive => "inactive", - CapabilityStatus::Pending => "pending", - CapabilityStatus::Unrequested => "unrequested", - } - } -} - -impl AsRef for CapabilityStatus { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for CapabilityStatus { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for CapabilityStatus { - fn default() -> Self { - Self::Active - } -} diff --git a/src/resources/generated/capability_updated.rs b/src/resources/generated/capability_updated.rs deleted file mode 100644 index adc2fdab1..000000000 --- a/src/resources/generated/capability_updated.rs +++ /dev/null @@ -1,10 +0,0 @@ -// ====================================== -// This file was automatically generated. -// ====================================== - -use serde::{Deserialize, Serialize}; - -/// The resource representing a Stripe "capability.updated". -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CapabilityUpdated { -} diff --git a/src/resources/generated/cash_balance.rs b/src/resources/generated/cash_balance.rs deleted file mode 100644 index d92f14760..000000000 --- a/src/resources/generated/cash_balance.rs +++ /dev/null @@ -1,78 +0,0 @@ -// ====================================== -// This file was automatically generated. -// ====================================== - -use serde::{Deserialize, Serialize}; - -use crate::params::Object; - -/// The resource representing a Stripe "cash_balance". -/// -/// For more details see -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CashBalance { - /// A hash of all cash balances available to this customer. - /// - /// You cannot delete a customer with any cash balances, even if the balance is 0. - /// Amounts are represented in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal). - pub available: Option, - - /// The ID of the customer whose cash balance this object represents. - pub customer: String, - - /// Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. - pub livemode: bool, - - pub settings: CustomerBalanceCustomerBalanceSettings, -} - -impl Object for CashBalance { - type Id = (); - fn id(&self) -> Self::Id {} - fn object(&self) -> &'static str { - "cash_balance" - } -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CustomerBalanceCustomerBalanceSettings { - /// The configuration for how funds that land in the customer cash balance are reconciled. - pub reconciliation_mode: CustomerBalanceCustomerBalanceSettingsReconciliationMode, - - /// A flag to indicate if reconciliation mode returned is the user's default or is specific to this customer cash balance. - pub using_merchant_default: bool, -} - -/// An enum representing the possible values of an `CustomerBalanceCustomerBalanceSettings`'s `reconciliation_mode` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CustomerBalanceCustomerBalanceSettingsReconciliationMode { - Automatic, - Manual, -} - -impl CustomerBalanceCustomerBalanceSettingsReconciliationMode { - pub fn as_str(self) -> &'static str { - match self { - CustomerBalanceCustomerBalanceSettingsReconciliationMode::Automatic => "automatic", - CustomerBalanceCustomerBalanceSettingsReconciliationMode::Manual => "manual", - } - } -} - -impl AsRef for CustomerBalanceCustomerBalanceSettingsReconciliationMode { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for CustomerBalanceCustomerBalanceSettingsReconciliationMode { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for CustomerBalanceCustomerBalanceSettingsReconciliationMode { - fn default() -> Self { - Self::Automatic - } -} diff --git a/src/resources/generated/cash_balance_funds_available.rs b/src/resources/generated/cash_balance_funds_available.rs deleted file mode 100644 index 58ff78121..000000000 --- a/src/resources/generated/cash_balance_funds_available.rs +++ /dev/null @@ -1,10 +0,0 @@ -// ====================================== -// This file was automatically generated. -// ====================================== - -use serde::{Deserialize, Serialize}; - -/// The resource representing a Stripe "cash_balance.funds_available". -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CashBalanceFundsAvailable { -} diff --git a/src/resources/generated/charge.rs b/src/resources/generated/charge.rs deleted file mode 100644 index 2a627f6d2..000000000 --- a/src/resources/generated/charge.rs +++ /dev/null @@ -1,3261 +0,0 @@ -// ====================================== -// This file was automatically generated. -// ====================================== - -use serde::{Deserialize, Serialize}; - -use crate::client::{Client, Response}; -use crate::ids::{ChargeId, CustomerId, PaymentIntentId}; -use crate::params::{Expand, Expandable, List, Metadata, Object, Paginable, RangeQuery, Timestamp}; -use crate::resources::{ - Account, Address, Application, ApplicationFee, BalanceTransaction, BillingDetails, - ChargeSourceParams, Currency, Customer, Invoice, Mandate, PaymentIntent, PaymentMethod, - PaymentMethodDetailsCardInstallmentsPlan, PaymentMethodDetailsCardWalletApplePay, - PaymentMethodDetailsCardWalletGooglePay, PaymentSource, RadarRadarOptions, Refund, Review, - Shipping, Transfer, -}; - -/// The resource representing a Stripe "Charge". -/// -/// For more details see -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct Charge { - /// Unique identifier for the object. - pub id: ChargeId, - - /// Amount intended to be collected by this payment. - /// - /// A positive integer representing how much to charge in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal) (e.g., 100 cents to charge $1.00 or 100 to charge ¥100, a zero-decimal currency). - /// The minimum amount is $0.50 US or [equivalent in charge currency](https://stripe.com/docs/currencies#minimum-and-maximum-charge-amounts). - /// The amount value supports up to eight digits (e.g., a value of 99999999 for a USD charge of $999,999.99). - pub amount: i64, - - /// Amount in cents (or local equivalent) captured (can be less than the amount attribute on the charge if a partial capture was made). - pub amount_captured: i64, - - /// Amount in cents (or local equivalent) refunded (can be less than the amount attribute on the charge if a partial refund was issued). - pub amount_refunded: i64, - - /// ID of the Connect application that created the charge. - pub application: Option>, - - /// The application fee (if any) for the charge. - /// - /// [See the Connect documentation](https://stripe.com/docs/connect/direct-charges#collecting-fees) for details. - pub application_fee: Option>, - - /// The amount of the application fee (if any) requested for the charge. - /// - /// [See the Connect documentation](https://stripe.com/docs/connect/direct-charges#collecting-fees) for details. - pub application_fee_amount: Option, - - /// Authorization code on the charge. - #[serde(skip_serializing_if = "Option::is_none")] - pub authorization_code: Option, - - /// ID of the balance transaction that describes the impact of this charge on your account balance (not including refunds or disputes). - pub balance_transaction: Option>, - - pub billing_details: BillingDetails, - - /// The full statement descriptor that is passed to card networks, and that is displayed on your customers' credit card and bank statements. - /// - /// Allows you to see what the statement descriptor looks like after the static and dynamic portions are combined. - pub calculated_statement_descriptor: Option, - - /// If the charge was created without capturing, this Boolean represents whether it is still uncaptured or has since been captured. - pub captured: bool, - - /// Time at which the object was created. - /// - /// Measured in seconds since the Unix epoch. - pub created: Timestamp, - - /// Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. - /// - /// Must be a [supported currency](https://stripe.com/docs/currencies). - pub currency: Currency, - - /// ID of the customer this charge is for if one exists. - pub customer: Option>, - - /// An arbitrary string attached to the object. - /// - /// Often useful for displaying to users. - pub description: Option, - - /// Whether the charge has been disputed. - pub disputed: bool, - - /// ID of the balance transaction that describes the reversal of the balance on your account due to payment failure. - pub failure_balance_transaction: Option>, - - /// Error code explaining reason for charge failure if available (see [the errors section](https://stripe.com/docs/error-codes) for a list of codes). - pub failure_code: Option, - - /// Message to user further explaining reason for charge failure if available. - pub failure_message: Option, - - /// Information on fraud assessments for the charge. - pub fraud_details: Option, - - /// ID of the invoice this charge is for if one exists. - pub invoice: Option>, - - #[serde(skip_serializing_if = "Option::is_none")] - pub level3: Option, - - /// Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. - pub livemode: bool, - - /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. - /// - /// This can be useful for storing additional information about the object in a structured format. - pub metadata: Metadata, - - /// The account (if any) the charge was made on behalf of without triggering an automatic transfer. - /// - /// See the [Connect documentation](https://stripe.com/docs/connect/separate-charges-and-transfers) for details. - pub on_behalf_of: Option>, - - /// Details about whether the payment was accepted, and why. - /// - /// See [understanding declines](https://stripe.com/docs/declines) for details. - pub outcome: Option, - - /// `true` if the charge succeeded, or was successfully authorized for later capture. - pub paid: bool, - - /// ID of the PaymentIntent associated with this charge, if one exists. - pub payment_intent: Option>, - - /// ID of the payment method used in this charge. - pub payment_method: Option, - - /// Details about the payment method at the time of the transaction. - pub payment_method_details: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub radar_options: Option, - - /// This is the email address that the receipt for this charge was sent to. - pub receipt_email: Option, - - /// This is the transaction number that appears on email receipts sent for this charge. - /// - /// This attribute will be `null` until a receipt has been sent. - pub receipt_number: Option, - - /// This is the URL to view the receipt for this charge. - /// - /// The receipt is kept up-to-date to the latest state of the charge, including any refunds. - /// If the charge is for an Invoice, the receipt will be stylized as an Invoice receipt. - pub receipt_url: Option, - - /// Whether the charge has been fully refunded. - /// - /// If the charge is only partially refunded, this attribute will still be false. - pub refunded: bool, - - /// A list of refunds that have been applied to the charge. - pub refunds: Option>, - - /// ID of the review associated with this charge if one exists. - pub review: Option>, - - /// Shipping information for the charge. - pub shipping: Option, - - /// This is a legacy field that will be removed in the future. - /// - /// It contains the Source, Card, or BankAccount object used for the charge. - /// For details about the payment method used for this charge, refer to `payment_method` or `payment_method_details` instead. - pub source: Option, - - /// The transfer ID which created this charge. - /// - /// Only present if the charge came from another Stripe account. - /// [See the Connect documentation](https://stripe.com/docs/connect/destination-charges) for details. - pub source_transfer: Option>, - - /// For card charges, use `statement_descriptor_suffix` instead. - /// - /// Otherwise, you can use this value as the complete description of a charge on your customers’ statements. - /// Must contain at least one letter, maximum 22 characters. - pub statement_descriptor: Option, - - /// Provides information about the charge that customers see on their statements. - /// - /// Concatenated with the prefix (shortened descriptor) or statement descriptor that’s set on the account to form the complete statement descriptor. - /// Maximum 22 characters for the concatenated descriptor. - pub statement_descriptor_suffix: Option, - - /// The status of the payment is either `succeeded`, `pending`, or `failed`. - pub status: ChargeStatus, - - /// ID of the transfer to the `destination` account (only applicable if the charge was created using the `destination` parameter). - #[serde(skip_serializing_if = "Option::is_none")] - pub transfer: Option>, - - /// An optional dictionary including the account to automatically transfer to as part of a destination charge. - /// - /// [See the Connect documentation](https://stripe.com/docs/connect/destination-charges) for details. - pub transfer_data: Option, - - /// A string that identifies this transaction as part of a group. - /// - /// See the [Connect documentation](https://stripe.com/docs/connect/separate-charges-and-transfers#transfer-options) for details. - pub transfer_group: Option, -} - -impl Charge { - /// Returns a list of charges you’ve previously created. - /// - /// The charges are returned in sorted order, with the most recent charges appearing first. - pub fn list(client: &Client, params: &ListCharges<'_>) -> Response> { - client.get_query("/charges", ¶ms) - } - - /// This method is no longer recommended—use the [Payment Intents API](https://stripe.com/docs/api/payment_intents) - /// to initiate a new payment instead. - /// - /// Confirmation of the PaymentIntent creates the `Charge` object used to request payment. - pub fn create(client: &Client, params: CreateCharge<'_>) -> Response { - client.post_form("/charges", ¶ms) - } - - /// Retrieves the details of a charge that has previously been created. - /// - /// Supply the unique charge ID that was returned from your previous request, and Stripe will return the corresponding charge information. - /// The same information is returned when creating or refunding the charge. - pub fn retrieve(client: &Client, id: &ChargeId, expand: &[&str]) -> Response { - client.get_query(&format!("/charges/{}", id), &Expand { expand }) - } - - /// Updates the specified charge by setting the values of the parameters passed. - /// - /// Any parameters not provided will be left unchanged. - pub fn update(client: &Client, id: &ChargeId, params: UpdateCharge<'_>) -> Response { - client.post_form(&format!("/charges/{}", id), ¶ms) - } -} - -impl Object for Charge { - type Id = ChargeId; - fn id(&self) -> Self::Id { - self.id.clone() - } - fn object(&self) -> &'static str { - "charge" - } -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct FraudDetails { - /// Assessments from Stripe. - /// - /// If set, the value is `fraudulent`. - #[serde(skip_serializing_if = "Option::is_none")] - pub stripe_report: Option, - - /// Assessments reported by you. - /// - /// If set, possible values of are `safe` and `fraudulent`. - #[serde(skip_serializing_if = "Option::is_none")] - pub user_report: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct ChargeOutcome { - /// Possible values are `approved_by_network`, `declined_by_network`, `not_sent_to_network`, and `reversed_after_approval`. - /// - /// The value `reversed_after_approval` indicates the payment was [blocked by Stripe](https://stripe.com/docs/declines#blocked-payments) after bank authorization, and may temporarily appear as "pending" on a cardholder's statement. - pub network_status: Option, - - /// An enumerated value providing a more detailed explanation of the outcome's `type`. - /// - /// Charges blocked by Radar's default block rule have the value `highest_risk_level`. - /// Charges placed in review by Radar's default review rule have the value `elevated_risk_level`. - /// Charges authorized, blocked, or placed in review by custom rules have the value `rule`. - /// See [understanding declines](https://stripe.com/docs/declines) for more details. - pub reason: Option, - - /// Stripe Radar's evaluation of the riskiness of the payment. - /// - /// Possible values for evaluated payments are `normal`, `elevated`, `highest`. - /// For non-card payments, and card-based payments predating the public assignment of risk levels, this field will have the value `not_assessed`. - /// In the event of an error in the evaluation, this field will have the value `unknown`. - /// This field is only available with Radar. - #[serde(skip_serializing_if = "Option::is_none")] - pub risk_level: Option, - - /// Stripe Radar's evaluation of the riskiness of the payment. - /// - /// Possible values for evaluated payments are between 0 and 100. - /// For non-card payments, card-based payments predating the public assignment of risk scores, or in the event of an error during evaluation, this field will not be present. - /// This field is only available with Radar for Fraud Teams. - #[serde(skip_serializing_if = "Option::is_none")] - pub risk_score: Option, - - /// The ID of the Radar rule that matched the payment, if applicable. - #[serde(skip_serializing_if = "Option::is_none")] - pub rule: Option>, - - /// A human-readable description of the outcome type and reason, designed for you (the recipient of the payment), not your customer. - pub seller_message: Option, - - /// Possible values are `authorized`, `manual_review`, `issuer_declined`, `blocked`, and `invalid`. - /// - /// See [understanding declines](https://stripe.com/docs/declines) and [Radar reviews](https://stripe.com/docs/radar/reviews) for details. - #[serde(rename = "type")] - pub type_: String, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct TransferData { - /// The amount transferred to the destination account, if specified. - /// - /// By default, the entire charge amount is transferred to the destination account. - pub amount: Option, - - /// ID of an existing, connected Stripe account to transfer funds to if `transfer_data` was specified in the charge request. - pub destination: Expandable, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct Level3 { - #[serde(skip_serializing_if = "Option::is_none")] - pub customer_reference: Option, - - pub line_items: Vec, - - pub merchant_reference: String, - - #[serde(skip_serializing_if = "Option::is_none")] - pub shipping_address_zip: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub shipping_amount: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub shipping_from_zip: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct Level3LineItems { - pub discount_amount: Option, - - pub product_code: String, - - pub product_description: String, - - pub quantity: Option, - - pub tax_amount: Option, - - pub unit_cost: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct PaymentMethodDetails { - #[serde(skip_serializing_if = "Option::is_none")] - pub ach_credit_transfer: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub ach_debit: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub acss_debit: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub affirm: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub afterpay_clearpay: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub alipay: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub au_becs_debit: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub bacs_debit: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub bancontact: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub blik: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub boleto: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub card: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub card_present: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub cashapp: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub customer_balance: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub eps: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub fpx: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub giropay: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub grabpay: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub ideal: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub interac_present: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub klarna: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub konbini: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub link: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub multibanco: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub oxxo: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub p24: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub paynow: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub paypal: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub pix: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub promptpay: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub revolut_pay: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub sepa_credit_transfer: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub sepa_debit: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub sofort: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub stripe_account: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub swish: Option, - - /// The type of transaction-specific details of the payment method used in the payment, one of `ach_credit_transfer`, `ach_debit`, `acss_debit`, `alipay`, `au_becs_debit`, `bancontact`, `card`, `card_present`, `eps`, `giropay`, `ideal`, `klarna`, `multibanco`, `p24`, `sepa_debit`, `sofort`, `stripe_account`, or `wechat`. - /// An additional hash is included on `payment_method_details` with a name matching this value. - /// It contains information specific to the payment method. - #[serde(rename = "type")] - pub type_: String, - - #[serde(skip_serializing_if = "Option::is_none")] - pub us_bank_account: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub wechat: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub wechat_pay: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub zip: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct PaymentFlowsPrivatePaymentMethodsAlipayDetails { - /// Uniquely identifies this particular Alipay account. - /// - /// You can use this attribute to check whether two Alipay accounts are the same. - #[serde(skip_serializing_if = "Option::is_none")] - pub buyer_id: Option, - - /// Uniquely identifies this particular Alipay account. - /// - /// You can use this attribute to check whether two Alipay accounts are the same. - pub fingerprint: Option, - - /// Transaction ID of this particular Alipay transaction. - pub transaction_id: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct PaymentMethodDetailsAchCreditTransfer { - /// Account number to transfer funds to. - pub account_number: Option, - - /// Name of the bank associated with the routing number. - pub bank_name: Option, - - /// Routing transit number for the bank account to transfer funds to. - pub routing_number: Option, - - /// SWIFT code of the bank associated with the routing number. - pub swift_code: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct PaymentMethodDetailsAchDebit { - /// Type of entity that holds the account. - /// - /// This can be either `individual` or `company`. - pub account_holder_type: Option, - - /// Name of the bank associated with the bank account. - pub bank_name: Option, - - /// Two-letter ISO code representing the country the bank account is located in. - pub country: Option, - - /// Uniquely identifies this particular bank account. - /// - /// You can use this attribute to check whether two bank accounts are the same. - pub fingerprint: Option, - - /// Last four digits of the bank account number. - pub last4: Option, - - /// Routing transit number of the bank account. - pub routing_number: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct PaymentMethodDetailsAcssDebit { - /// Name of the bank associated with the bank account. - pub bank_name: Option, - - /// Uniquely identifies this particular bank account. - /// - /// You can use this attribute to check whether two bank accounts are the same. - pub fingerprint: Option, - - /// Institution number of the bank account. - pub institution_number: Option, - - /// Last four digits of the bank account number. - pub last4: Option, - - /// ID of the mandate used to make this payment. - #[serde(skip_serializing_if = "Option::is_none")] - pub mandate: Option, - - /// Transit number of the bank account. - pub transit_number: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct PaymentMethodDetailsAffirm {} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct PaymentMethodDetailsAfterpayClearpay { - /// The Afterpay order ID associated with this payment intent. - pub order_id: Option, - - /// Order identifier shown to the merchant in Afterpay’s online portal. - pub reference: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct PaymentMethodDetailsAuBecsDebit { - /// Bank-State-Branch number of the bank account. - pub bsb_number: Option, - - /// Uniquely identifies this particular bank account. - /// - /// You can use this attribute to check whether two bank accounts are the same. - pub fingerprint: Option, - - /// Last four digits of the bank account number. - pub last4: Option, - - /// ID of the mandate used to make this payment. - #[serde(skip_serializing_if = "Option::is_none")] - pub mandate: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct PaymentMethodDetailsBacsDebit { - /// Uniquely identifies this particular bank account. - /// - /// You can use this attribute to check whether two bank accounts are the same. - pub fingerprint: Option, - - /// Last four digits of the bank account number. - pub last4: Option, - - /// ID of the mandate used to make this payment. - pub mandate: Option, - - /// Sort code of the bank account. - /// - /// (e.g., `10-20-30`). - pub sort_code: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct PaymentMethodDetailsBancontact { - /// Bank code of bank associated with the bank account. - pub bank_code: Option, - - /// Name of the bank associated with the bank account. - pub bank_name: Option, - - /// Bank Identifier Code of the bank associated with the bank account. - pub bic: Option, - - /// The ID of the SEPA Direct Debit PaymentMethod which was generated by this Charge. - pub generated_sepa_debit: Option>, - - /// The mandate for the SEPA Direct Debit PaymentMethod which was generated by this Charge. - pub generated_sepa_debit_mandate: Option>, - - /// Last four characters of the IBAN. - pub iban_last4: Option, - - /// Preferred language of the Bancontact authorization page that the customer is redirected to. - /// Can be one of `en`, `de`, `fr`, or `nl`. - pub preferred_language: Option, - - /// Owner's verified full name. - /// - /// Values are verified or provided by Bancontact directly (if supported) at the time of authorization or settlement. - /// They cannot be set or mutated. - pub verified_name: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct PaymentMethodDetailsBlik {} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct PaymentMethodDetailsBoleto { - /// The tax ID of the customer (CPF for individuals consumers or CNPJ for businesses consumers). - pub tax_id: String, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct PaymentMethodDetailsCard { - - /// The authorized amount. - pub amount_authorized: Option, - - /// Card brand. - /// - /// Can be `amex`, `diners`, `discover`, `eftpos_au`, `jcb`, `mastercard`, `unionpay`, `visa`, or `unknown`. - pub brand: Option, - - /// When using manual capture, a future timestamp at which the charge will be automatically refunded if uncaptured. - #[serde(skip_serializing_if = "Option::is_none")] - pub capture_before: Option, - - /// Check results by Card networks on Card address and CVC at time of payment. - pub checks: Option, - - /// Two-letter ISO code representing the country of the card. - /// - /// You could use this attribute to get a sense of the international breakdown of cards you've collected. - pub country: Option, - - /// A high-level description of the type of cards issued in this range. - /// - /// (For internal use only and not typically available in standard API requests.). - #[serde(skip_serializing_if = "Option::is_none")] - pub description: Option, - - /// Two-digit number representing the card's expiration month. - pub exp_month: i64, - - /// Four-digit number representing the card's expiration year. - pub exp_year: i64, - - #[serde(skip_serializing_if = "Option::is_none")] - pub extended_authorization: Option, - - /// Uniquely identifies this particular card number. - /// - /// You can use this attribute to check whether two customers who’ve signed up with you are using the same card number, for example. - /// For payment methods that tokenize card information (Apple Pay, Google Pay), the tokenized number might be provided instead of the underlying card number. *As of May 1, 2021, card fingerprint in India for Connect changed to allow two fingerprints for the same card---one for India and one for the rest of the world.*. - #[serde(skip_serializing_if = "Option::is_none")] - pub fingerprint: Option, - - /// Card funding type. - /// - /// Can be `credit`, `debit`, `prepaid`, or `unknown`. - pub funding: Option, - - /// Issuer identification number of the card. - /// - /// (For internal use only and not typically available in standard API requests.). - #[serde(skip_serializing_if = "Option::is_none")] - pub iin: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub incremental_authorization: Option, - - /// Installment details for this payment (Mexico only). - /// - /// For more information, see the [installments integration guide](https://stripe.com/docs/payments/installments). - pub installments: Option, - - /// The name of the card's issuing bank. - /// - /// (For internal use only and not typically available in standard API requests.). - #[serde(skip_serializing_if = "Option::is_none")] - pub issuer: Option, - - /// The last four digits of the card. - pub last4: Option, - - /// ID of the mandate used to make this payment or created by it. - pub mandate: Option, - - /// True if this payment was marked as MOTO and out of scope for SCA. - #[serde(skip_serializing_if = "Option::is_none")] - pub moto: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub multicapture: Option, - - /// Identifies which network this charge was processed on. - /// - /// Can be `amex`, `cartes_bancaires`, `diners`, `discover`, `eftpos_au`, `interac`, `jcb`, `mastercard`, `unionpay`, `visa`, or `unknown`. - pub network: Option, - - /// If this card has network token credentials, this contains the details of the network token credentials. - #[serde(skip_serializing_if = "Option::is_none")] - pub network_token: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub overcapture: Option, - - /// Populated if this transaction used 3D Secure authentication. - pub three_d_secure: Option, - - /// If this Card is part of a card wallet, this contains the details of the card wallet. - pub wallet: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct PaymentFlowsPrivatePaymentMethodsCardDetailsApiResourceEnterpriseFeaturesExtendedAuthorizationExtendedAuthorization { - - /// Indicates whether or not the capture window is extended beyond the standard authorization. - pub status: PaymentFlowsPrivatePaymentMethodsCardDetailsApiResourceEnterpriseFeaturesExtendedAuthorizationExtendedAuthorizationStatus, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct PaymentFlowsPrivatePaymentMethodsCardDetailsApiResourceEnterpriseFeaturesIncrementalAuthorizationIncrementalAuthorization { - - /// Indicates whether or not the incremental authorization feature is supported. - pub status: PaymentFlowsPrivatePaymentMethodsCardDetailsApiResourceEnterpriseFeaturesIncrementalAuthorizationIncrementalAuthorizationStatus, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct PaymentFlowsPrivatePaymentMethodsCardDetailsApiResourceEnterpriseFeaturesOvercaptureOvercapture { - - /// The maximum amount that can be captured. - pub maximum_amount_capturable: i64, - - /// Indicates whether or not the authorized amount can be over-captured. - pub status: PaymentFlowsPrivatePaymentMethodsCardDetailsApiResourceEnterpriseFeaturesOvercaptureOvercaptureStatus, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct PaymentFlowsPrivatePaymentMethodsCardDetailsApiResourceMulticapture { - /// Indicates whether or not multiple captures are supported. - pub status: PaymentFlowsPrivatePaymentMethodsCardDetailsApiResourceMulticaptureStatus, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct PaymentMethodDetailsCardChecks { - /// If a address line1 was provided, results of the check, one of `pass`, `fail`, `unavailable`, or `unchecked`. - pub address_line1_check: Option, - - /// If a address postal code was provided, results of the check, one of `pass`, `fail`, `unavailable`, or `unchecked`. - pub address_postal_code_check: Option, - - /// If a CVC was provided, results of the check, one of `pass`, `fail`, `unavailable`, or `unchecked`. - pub cvc_check: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct PaymentMethodDetailsCardInstallments { - /// Installment plan selected for the payment. - pub plan: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct PaymentMethodDetailsCardNetworkToken { - /// Indicates if Stripe used a network token, either user provided or Stripe managed when processing the transaction. - pub used: bool, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct PaymentMethodDetailsCardPresent { - /// The authorized amount. - pub amount_authorized: Option, - - /// Card brand. - /// - /// Can be `amex`, `diners`, `discover`, `eftpos_au`, `jcb`, `mastercard`, `unionpay`, `visa`, or `unknown`. - pub brand: Option, - - /// When using manual capture, a future timestamp after which the charge will be automatically refunded if uncaptured. - #[serde(skip_serializing_if = "Option::is_none")] - pub capture_before: Option, - - /// The cardholder name as read from the card, in [ISO 7813](https://en.wikipedia.org/wiki/ISO/IEC_7813) format. - /// - /// May include alphanumeric characters, special characters and first/last name separator (`/`). - /// In some cases, the cardholder name may not be available depending on how the issuer has configured the card. - /// Cardholder name is typically not available on swipe or contactless payments, such as those made with Apple Pay and Google Pay. - pub cardholder_name: Option, - - /// Two-letter ISO code representing the country of the card. - /// - /// You could use this attribute to get a sense of the international breakdown of cards you've collected. - pub country: Option, - - /// A high-level description of the type of cards issued in this range. - /// - /// (For internal use only and not typically available in standard API requests.). - #[serde(skip_serializing_if = "Option::is_none")] - pub description: Option, - - /// Authorization response cryptogram. - pub emv_auth_data: Option, - - /// Two-digit number representing the card's expiration month. - pub exp_month: i64, - - /// Four-digit number representing the card's expiration year. - pub exp_year: i64, - - /// Uniquely identifies this particular card number. - /// - /// You can use this attribute to check whether two customers who’ve signed up with you are using the same card number, for example. - /// For payment methods that tokenize card information (Apple Pay, Google Pay), the tokenized number might be provided instead of the underlying card number. *As of May 1, 2021, card fingerprint in India for Connect changed to allow two fingerprints for the same card---one for India and one for the rest of the world.*. - pub fingerprint: Option, - - /// Card funding type. - /// - /// Can be `credit`, `debit`, `prepaid`, or `unknown`. - pub funding: Option, - - /// ID of a card PaymentMethod generated from the card_present PaymentMethod that may be attached to a Customer for future transactions. - /// - /// Only present if it was possible to generate a card PaymentMethod. - pub generated_card: Option, - - /// Issuer identification number of the card. - /// - /// (For internal use only and not typically available in standard API requests.). - #[serde(skip_serializing_if = "Option::is_none")] - pub iin: Option, - - /// Whether this [PaymentIntent](https://stripe.com/docs/api/payment_intents) is eligible for incremental authorizations. - /// - /// Request support using [request_incremental_authorization_support](https://stripe.com/docs/api/payment_intents/create#create_payment_intent-payment_method_options-card_present-request_incremental_authorization_support). - pub incremental_authorization_supported: bool, - - /// The name of the card's issuing bank. - /// - /// (For internal use only and not typically available in standard API requests.). - #[serde(skip_serializing_if = "Option::is_none")] - pub issuer: Option, - - /// The last four digits of the card. - pub last4: Option, - - /// Identifies which network this charge was processed on. - /// - /// Can be `amex`, `cartes_bancaires`, `diners`, `discover`, `eftpos_au`, `interac`, `jcb`, `mastercard`, `unionpay`, `visa`, or `unknown`. - pub network: Option, - - /// Details about payments collected offline. - pub offline: Option, - - /// Defines whether the authorized amount can be over-captured or not. - pub overcapture_supported: bool, - - /// How card details were read in this transaction. - pub read_method: Option, - - /// A collection of fields required to be displayed on receipts. - /// - /// Only required for EMV transactions. - pub receipt: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct PaymentMethodDetailsCardPresentOffline { - /// Time at which the payment was collected while offline. - pub stored_at: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct PaymentMethodDetailsCardPresentReceipt { - /// The type of account being debited or credited. - #[serde(skip_serializing_if = "Option::is_none")] - pub account_type: Option, - - /// EMV tag 9F26, cryptogram generated by the integrated circuit chip. - pub application_cryptogram: Option, - - /// Mnenomic of the Application Identifier. - pub application_preferred_name: Option, - - /// Identifier for this transaction. - pub authorization_code: Option, - - /// EMV tag 8A. - /// - /// A code returned by the card issuer. - pub authorization_response_code: Option, - - /// How the cardholder verified ownership of the card. - pub cardholder_verification_method: Option, - - /// EMV tag 84. - /// - /// Similar to the application identifier stored on the integrated circuit chip. - pub dedicated_file_name: Option, - - /// The outcome of a series of EMV functions performed by the card reader. - pub terminal_verification_results: Option, - - /// An indication of various EMV functions performed during the transaction. - pub transaction_status_information: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct PaymentMethodDetailsCardWallet { - #[serde(skip_serializing_if = "Option::is_none")] - pub amex_express_checkout: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub apple_pay: Option, - - /// (For tokenized numbers only.) The last four digits of the device account number. - pub dynamic_last4: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub google_pay: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub link: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub masterpass: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub samsung_pay: Option, - - /// The type of the card wallet, one of `amex_express_checkout`, `apple_pay`, `google_pay`, `masterpass`, `samsung_pay`, `visa_checkout`, or `link`. - /// - /// An additional hash is included on the Wallet subhash with a name matching this value. - /// It contains additional information specific to the card wallet type. - #[serde(rename = "type")] - pub type_: PaymentMethodDetailsCardWalletType, - - #[serde(skip_serializing_if = "Option::is_none")] - pub visa_checkout: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct PaymentMethodDetailsCardWalletAmexExpressCheckout {} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct PaymentMethodDetailsCardWalletLink {} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct PaymentMethodDetailsCardWalletMasterpass { - /// Owner's verified billing address. - /// - /// Values are verified or provided by the wallet directly (if supported) at the time of authorization or settlement. - /// They cannot be set or mutated. - pub billing_address: Option
, - - /// Owner's verified email. - /// - /// Values are verified or provided by the wallet directly (if supported) at the time of authorization or settlement. - /// They cannot be set or mutated. - pub email: Option, - - /// Owner's verified full name. - /// - /// Values are verified or provided by the wallet directly (if supported) at the time of authorization or settlement. - /// They cannot be set or mutated. - pub name: Option, - - /// Owner's verified shipping address. - /// - /// Values are verified or provided by the wallet directly (if supported) at the time of authorization or settlement. - /// They cannot be set or mutated. - pub shipping_address: Option
, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct PaymentMethodDetailsCardWalletSamsungPay {} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct PaymentMethodDetailsCardWalletVisaCheckout { - /// Owner's verified billing address. - /// - /// Values are verified or provided by the wallet directly (if supported) at the time of authorization or settlement. - /// They cannot be set or mutated. - pub billing_address: Option
, - - /// Owner's verified email. - /// - /// Values are verified or provided by the wallet directly (if supported) at the time of authorization or settlement. - /// They cannot be set or mutated. - pub email: Option, - - /// Owner's verified full name. - /// - /// Values are verified or provided by the wallet directly (if supported) at the time of authorization or settlement. - /// They cannot be set or mutated. - pub name: Option, - - /// Owner's verified shipping address. - /// - /// Values are verified or provided by the wallet directly (if supported) at the time of authorization or settlement. - /// They cannot be set or mutated. - pub shipping_address: Option
, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct PaymentMethodDetailsCashapp { - /// A unique and immutable identifier assigned by Cash App to every buyer. - pub buyer_id: Option, - - /// A public identifier for buyers using Cash App. - pub cashtag: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct PaymentMethodDetailsCustomerBalance {} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct PaymentMethodDetailsEps { - /// The customer's bank. - /// - /// Should be one of `arzte_und_apotheker_bank`, `austrian_anadi_bank_ag`, `bank_austria`, `bankhaus_carl_spangler`, `bankhaus_schelhammer_und_schattera_ag`, `bawag_psk_ag`, `bks_bank_ag`, `brull_kallmus_bank_ag`, `btv_vier_lander_bank`, `capital_bank_grawe_gruppe_ag`, `deutsche_bank_ag`, `dolomitenbank`, `easybank_ag`, `erste_bank_und_sparkassen`, `hypo_alpeadriabank_international_ag`, `hypo_noe_lb_fur_niederosterreich_u_wien`, `hypo_oberosterreich_salzburg_steiermark`, `hypo_tirol_bank_ag`, `hypo_vorarlberg_bank_ag`, `hypo_bank_burgenland_aktiengesellschaft`, `marchfelder_bank`, `oberbank_ag`, `raiffeisen_bankengruppe_osterreich`, `schoellerbank_ag`, `sparda_bank_wien`, `volksbank_gruppe`, `volkskreditbank_ag`, or `vr_bank_braunau`. - pub bank: Option, - - /// Owner's verified full name. - /// - /// Values are verified or provided by EPS directly (if supported) at the time of authorization or settlement. - /// They cannot be set or mutated. EPS rarely provides this information so the attribute is usually empty. - pub verified_name: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct PaymentMethodDetailsFpx { - /// Account holder type, if provided. - /// - /// Can be one of `individual` or `company`. - pub account_holder_type: Option, - - /// The customer's bank. - /// - /// Can be one of `affin_bank`, `agrobank`, `alliance_bank`, `ambank`, `bank_islam`, `bank_muamalat`, `bank_rakyat`, `bsn`, `cimb`, `hong_leong_bank`, `hsbc`, `kfh`, `maybank2u`, `ocbc`, `public_bank`, `rhb`, `standard_chartered`, `uob`, `deutsche_bank`, `maybank2e`, `pb_enterprise`, or `bank_of_china`. - pub bank: PaymentMethodDetailsFpxBank, - - /// Unique transaction id generated by FPX for every request from the merchant. - pub transaction_id: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct PaymentMethodDetailsGiropay { - /// Bank code of bank associated with the bank account. - pub bank_code: Option, - - /// Name of the bank associated with the bank account. - pub bank_name: Option, - - /// Bank Identifier Code of the bank associated with the bank account. - pub bic: Option, - - /// Owner's verified full name. - /// - /// Values are verified or provided by Giropay directly (if supported) at the time of authorization or settlement. - /// They cannot be set or mutated. Giropay rarely provides this information so the attribute is usually empty. - pub verified_name: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct PaymentMethodDetailsGrabpay { - /// Unique transaction id generated by GrabPay. - pub transaction_id: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct PaymentMethodDetailsIdeal { - /// The customer's bank. - /// - /// Can be one of `abn_amro`, `asn_bank`, `bunq`, `handelsbanken`, `ing`, `knab`, `moneyou`, `n26`, `nn`, `rabobank`, `regiobank`, `revolut`, `sns_bank`, `triodos_bank`, `van_lanschot`, or `yoursafe`. - pub bank: Option, - - /// The Bank Identifier Code of the customer's bank. - pub bic: Option, - - /// The ID of the SEPA Direct Debit PaymentMethod which was generated by this Charge. - pub generated_sepa_debit: Option>, - - /// The mandate for the SEPA Direct Debit PaymentMethod which was generated by this Charge. - pub generated_sepa_debit_mandate: Option>, - - /// Last four characters of the IBAN. - pub iban_last4: Option, - - /// Owner's verified full name. - /// - /// Values are verified or provided by iDEAL directly (if supported) at the time of authorization or settlement. - /// They cannot be set or mutated. - pub verified_name: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct PaymentMethodDetailsInteracPresent { - /// Card brand. - /// - /// Can be `interac`, `mastercard` or `visa`. - pub brand: Option, - - /// The cardholder name as read from the card, in [ISO 7813](https://en.wikipedia.org/wiki/ISO/IEC_7813) format. - /// - /// May include alphanumeric characters, special characters and first/last name separator (`/`). - /// In some cases, the cardholder name may not be available depending on how the issuer has configured the card. - /// Cardholder name is typically not available on swipe or contactless payments, such as those made with Apple Pay and Google Pay. - pub cardholder_name: Option, - - /// Two-letter ISO code representing the country of the card. - /// - /// You could use this attribute to get a sense of the international breakdown of cards you've collected. - pub country: Option, - - /// A high-level description of the type of cards issued in this range. - /// - /// (For internal use only and not typically available in standard API requests.). - #[serde(skip_serializing_if = "Option::is_none")] - pub description: Option, - - /// Authorization response cryptogram. - pub emv_auth_data: Option, - - /// Two-digit number representing the card's expiration month. - pub exp_month: i64, - - /// Four-digit number representing the card's expiration year. - pub exp_year: i64, - - /// Uniquely identifies this particular card number. - /// - /// You can use this attribute to check whether two customers who’ve signed up with you are using the same card number, for example. - /// For payment methods that tokenize card information (Apple Pay, Google Pay), the tokenized number might be provided instead of the underlying card number. *As of May 1, 2021, card fingerprint in India for Connect changed to allow two fingerprints for the same card---one for India and one for the rest of the world.*. - pub fingerprint: Option, - - /// Card funding type. - /// - /// Can be `credit`, `debit`, `prepaid`, or `unknown`. - pub funding: Option, - - /// ID of a card PaymentMethod generated from the card_present PaymentMethod that may be attached to a Customer for future transactions. - /// - /// Only present if it was possible to generate a card PaymentMethod. - pub generated_card: Option, - - /// Issuer identification number of the card. - /// - /// (For internal use only and not typically available in standard API requests.). - #[serde(skip_serializing_if = "Option::is_none")] - pub iin: Option, - - /// The name of the card's issuing bank. - /// - /// (For internal use only and not typically available in standard API requests.). - #[serde(skip_serializing_if = "Option::is_none")] - pub issuer: Option, - - /// The last four digits of the card. - pub last4: Option, - - /// Identifies which network this charge was processed on. - /// - /// Can be `amex`, `cartes_bancaires`, `diners`, `discover`, `eftpos_au`, `interac`, `jcb`, `mastercard`, `unionpay`, `visa`, or `unknown`. - pub network: Option, - - /// EMV tag 5F2D. - /// - /// Preferred languages specified by the integrated circuit chip. - pub preferred_locales: Option>, - - /// How card details were read in this transaction. - pub read_method: Option, - - /// A collection of fields required to be displayed on receipts. - /// - /// Only required for EMV transactions. - pub receipt: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct PaymentMethodDetailsInteracPresentReceipt { - /// The type of account being debited or credited. - #[serde(skip_serializing_if = "Option::is_none")] - pub account_type: Option, - - /// EMV tag 9F26, cryptogram generated by the integrated circuit chip. - pub application_cryptogram: Option, - - /// Mnenomic of the Application Identifier. - pub application_preferred_name: Option, - - /// Identifier for this transaction. - pub authorization_code: Option, - - /// EMV tag 8A. - /// - /// A code returned by the card issuer. - pub authorization_response_code: Option, - - /// How the cardholder verified ownership of the card. - pub cardholder_verification_method: Option, - - /// EMV tag 84. - /// - /// Similar to the application identifier stored on the integrated circuit chip. - pub dedicated_file_name: Option, - - /// The outcome of a series of EMV functions performed by the card reader. - pub terminal_verification_results: Option, - - /// An indication of various EMV functions performed during the transaction. - pub transaction_status_information: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct PaymentMethodDetailsKlarna { - /// The Klarna payment method used for this transaction. - /// Can be one of `pay_later`, `pay_now`, `pay_with_financing`, or `pay_in_installments`. - pub payment_method_category: Option, - - /// Preferred language of the Klarna authorization page that the customer is redirected to. - /// Can be one of `de-AT`, `en-AT`, `nl-BE`, `fr-BE`, `en-BE`, `de-DE`, `en-DE`, `da-DK`, `en-DK`, `es-ES`, `en-ES`, `fi-FI`, `sv-FI`, `en-FI`, `en-GB`, `en-IE`, `it-IT`, `en-IT`, `nl-NL`, `en-NL`, `nb-NO`, `en-NO`, `sv-SE`, `en-SE`, `en-US`, `es-US`, `fr-FR`, `en-FR`, `cs-CZ`, `en-CZ`, `el-GR`, `en-GR`, `en-AU`, `en-NZ`, `en-CA`, `fr-CA`, `pl-PL`, `en-PL`, `pt-PT`, `en-PT`, `de-CH`, `fr-CH`, `it-CH`, or `en-CH`. - pub preferred_locale: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct PaymentMethodDetailsKonbini { - /// If the payment succeeded, this contains the details of the convenience store where the payment was completed. - pub store: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct PaymentMethodDetailsKonbiniStore { - /// The name of the convenience store chain where the payment was completed. - pub chain: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct PaymentMethodDetailsLink { - /// Two-letter ISO code representing the funding source country beneath the Link payment. - /// You could use this attribute to get a sense of international fees. - pub country: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct PaymentMethodDetailsMultibanco { - /// Entity number associated with this Multibanco payment. - pub entity: Option, - - /// Reference number associated with this Multibanco payment. - pub reference: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct PaymentMethodDetailsOxxo { - /// OXXO reference number. - pub number: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct PaymentMethodDetailsP24 { - /// The customer's bank. - /// - /// Can be one of `ing`, `citi_handlowy`, `tmobile_usbugi_bankowe`, `plus_bank`, `etransfer_pocztowy24`, `banki_spbdzielcze`, `bank_nowy_bfg_sa`, `getin_bank`, `velobank`, `blik`, `noble_pay`, `ideabank`, `envelobank`, `santander_przelew24`, `nest_przelew`, `mbank_mtransfer`, `inteligo`, `pbac_z_ipko`, `bnp_paribas`, `credit_agricole`, `toyota_bank`, `bank_pekao_sa`, `volkswagen_bank`, `bank_millennium`, `alior_bank`, or `boz`. - pub bank: Option, - - /// Unique reference for this Przelewy24 payment. - pub reference: Option, - - /// Owner's verified full name. - /// - /// Values are verified or provided by Przelewy24 directly (if supported) at the time of authorization or settlement. - /// They cannot be set or mutated. Przelewy24 rarely provides this information so the attribute is usually empty. - pub verified_name: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct PaymentMethodDetailsPaynow { - /// Reference number associated with this PayNow payment. - pub reference: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct PaymentMethodDetailsPaypal { - /// Owner's email. - /// - /// Values are provided by PayPal directly (if supported) at the time of authorization or settlement. - /// They cannot be set or mutated. - pub payer_email: Option, - - /// PayPal account PayerID. - /// - /// This identifier uniquely identifies the PayPal customer. - pub payer_id: Option, - - /// Owner's full name. - /// - /// Values provided by PayPal directly (if supported) at the time of authorization or settlement. - /// They cannot be set or mutated. - pub payer_name: Option, - - /// The level of protection offered as defined by PayPal Seller Protection for Merchants, for this transaction. - pub seller_protection: Option, - - /// A unique ID generated by PayPal for this transaction. - pub transaction_id: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct PaymentMethodDetailsPix { - /// Unique transaction id generated by BCB. - #[serde(skip_serializing_if = "Option::is_none")] - pub bank_transaction_id: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct PaymentMethodDetailsPromptpay { - /// Bill reference generated by PromptPay. - pub reference: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct PaymentMethodDetailsRevolutPay {} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct PaymentMethodDetailsSepaCreditTransfer { - /// Name of the bank associated with the bank account. - pub bank_name: Option, - - /// Bank Identifier Code of the bank associated with the bank account. - pub bic: Option, - - /// IBAN of the bank account to transfer funds to. - pub iban: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct PaymentMethodDetailsSepaDebit { - /// Bank code of bank associated with the bank account. - pub bank_code: Option, - - /// Branch code of bank associated with the bank account. - pub branch_code: Option, - - /// Two-letter ISO code representing the country the bank account is located in. - pub country: Option, - - /// Uniquely identifies this particular bank account. - /// - /// You can use this attribute to check whether two bank accounts are the same. - pub fingerprint: Option, - - /// Last four characters of the IBAN. - pub last4: Option, - - /// Find the ID of the mandate used for this payment under the [payment_method_details.sepa_debit.mandate](https://stripe.com/docs/api/charges/object#charge_object-payment_method_details-sepa_debit-mandate) property on the Charge. - /// - /// Use this mandate ID to [retrieve the Mandate](https://stripe.com/docs/api/mandates/retrieve). - pub mandate: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct PaymentMethodDetailsSofort { - /// Bank code of bank associated with the bank account. - pub bank_code: Option, - - /// Name of the bank associated with the bank account. - pub bank_name: Option, - - /// Bank Identifier Code of the bank associated with the bank account. - pub bic: Option, - - /// Two-letter ISO code representing the country the bank account is located in. - pub country: Option, - - /// The ID of the SEPA Direct Debit PaymentMethod which was generated by this Charge. - pub generated_sepa_debit: Option>, - - /// The mandate for the SEPA Direct Debit PaymentMethod which was generated by this Charge. - pub generated_sepa_debit_mandate: Option>, - - /// Last four characters of the IBAN. - pub iban_last4: Option, - - /// Preferred language of the SOFORT authorization page that the customer is redirected to. - /// Can be one of `de`, `en`, `es`, `fr`, `it`, `nl`, or `pl`. - pub preferred_language: Option, - - /// Owner's verified full name. - /// - /// Values are verified or provided by SOFORT directly (if supported) at the time of authorization or settlement. - /// They cannot be set or mutated. - pub verified_name: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct PaymentMethodDetailsStripeAccount {} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct PaymentMethodDetailsSwish { - /// Uniquely identifies the payer's Swish account. - /// - /// You can use this attribute to check whether two Swish transactions were paid for by the same payer. - pub fingerprint: Option, - - /// Payer bank reference number for the payment. - pub payment_reference: Option, - - /// The last four digits of the Swish account phone number. - pub verified_phone_last4: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct PaymentMethodDetailsUsBankAccount { - /// Account holder type: individual or company. - pub account_holder_type: Option, - - /// Account type: checkings or savings. - /// - /// Defaults to checking if omitted. - pub account_type: Option, - - /// Name of the bank associated with the bank account. - pub bank_name: Option, - - /// Uniquely identifies this particular bank account. - /// - /// You can use this attribute to check whether two bank accounts are the same. - pub fingerprint: Option, - - /// Last four digits of the bank account number. - pub last4: Option, - - /// Routing number of the bank account. - pub routing_number: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct PaymentMethodDetailsWechat {} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct PaymentMethodDetailsWechatPay { - /// Uniquely identifies this particular WeChat Pay account. - /// - /// You can use this attribute to check whether two WeChat accounts are the same. - pub fingerprint: Option, - - /// Transaction ID of this particular WeChat Pay transaction. - pub transaction_id: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct PaymentMethodDetailsZip {} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct PaypalSellerProtection { - /// An array of conditions that are covered for the transaction, if applicable. - pub dispute_categories: Option>, - - /// Indicates whether the transaction is eligible for PayPal's seller protection. - pub status: PaypalSellerProtectionStatus, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct Rule { - /// The action taken on the payment. - pub action: String, - - /// Unique identifier for the object. - pub id: String, - - /// The predicate to evaluate the payment against. - pub predicate: String, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct ThreeDSecureDetailsCharge { - /// For authenticated transactions: how the customer was authenticated by - /// the issuing bank. - pub authentication_flow: Option, - - /// The Electronic Commerce Indicator (ECI). - /// - /// A protocol-level field indicating what degree of authentication was performed. - pub electronic_commerce_indicator: Option, - - /// The exemption requested via 3DS and accepted by the issuer at authentication time. - pub exemption_indicator: Option, - - /// Whether Stripe requested the value of `exemption_indicator` in the transaction. - /// - /// This will depend on the outcome of Stripe's internal risk assessment. - #[serde(skip_serializing_if = "Option::is_none")] - pub exemption_indicator_applied: Option, - - /// Indicates the outcome of 3D Secure authentication. - pub result: Option, - - /// Additional information about why 3D Secure succeeded or failed based - /// on the `result`. - pub result_reason: Option, - - /// The 3D Secure 1 XID or 3D Secure 2 Directory Server Transaction ID - /// (dsTransId) for this payment. - pub transaction_id: Option, - - /// The version of 3D Secure that was used. - pub version: Option, -} - -/// The parameters for `Charge::create`. -#[derive(Clone, Debug, Serialize, Default)] -pub struct CreateCharge<'a> { - /// Amount intended to be collected by this payment. - /// - /// A positive integer representing how much to charge in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal) (e.g., 100 cents to charge $1.00 or 100 to charge ¥100, a zero-decimal currency). - /// The minimum amount is $0.50 US or [equivalent in charge currency](https://stripe.com/docs/currencies#minimum-and-maximum-charge-amounts). - /// The amount value supports up to eight digits (e.g., a value of 99999999 for a USD charge of $999,999.99). - #[serde(skip_serializing_if = "Option::is_none")] - pub amount: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub application_fee: Option, - - /// A fee in cents (or local equivalent) that will be applied to the charge and transferred to the application owner's Stripe account. - /// - /// The request must be made with an OAuth key or the `Stripe-Account` header in order to take an application fee. - /// For more information, see the application fees [documentation](https://stripe.com/docs/connect/direct-charges#collecting-fees). - #[serde(skip_serializing_if = "Option::is_none")] - pub application_fee_amount: Option, - - /// Whether to immediately capture the charge. - /// - /// Defaults to `true`. - /// When `false`, the charge issues an authorization (or pre-authorization), and will need to be [captured](https://stripe.com/docs/api#capture_charge) later. - /// Uncaptured charges expire after a set number of days (7 by default). - /// For more information, see the [authorizing charges and settling later](https://stripe.com/docs/charges/placing-a-hold) documentation. - #[serde(skip_serializing_if = "Option::is_none")] - pub capture: Option, - - /// Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. - /// - /// Must be a [supported currency](https://stripe.com/docs/currencies). - #[serde(skip_serializing_if = "Option::is_none")] - pub currency: Option, - - /// The ID of an existing customer that will be charged in this request. - #[serde(skip_serializing_if = "Option::is_none")] - pub customer: Option, - - /// An arbitrary string which you can attach to a `Charge` object. - /// - /// It is displayed when in the web interface alongside the charge. - /// Note that if you use Stripe to send automatic email receipts to your customers, your receipt emails will include the `description` of the charge(s) that they are describing. - #[serde(skip_serializing_if = "Option::is_none")] - pub description: Option<&'a str>, - - #[serde(skip_serializing_if = "Option::is_none")] - pub destination: Option, - - /// Specifies which fields in the response should be expanded. - #[serde(skip_serializing_if = "Expand::is_empty")] - pub expand: &'a [&'a str], - - /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. - /// - /// This can be useful for storing additional information about the object in a structured format. - /// Individual keys can be unset by posting an empty value to them. - /// All keys can be unset by posting an empty value to `metadata`. - #[serde(skip_serializing_if = "Option::is_none")] - pub metadata: Option, - - /// The Stripe account ID for which these funds are intended. - /// - /// Automatically set if you use the `destination` parameter. - /// For details, see [Creating Separate Charges and Transfers](https://stripe.com/docs/connect/separate-charges-and-transfers#on-behalf-of). - #[serde(skip_serializing_if = "Option::is_none")] - pub on_behalf_of: Option<&'a str>, - - /// Options to configure Radar. - /// - /// See [Radar Session](https://stripe.com/docs/radar/radar-session) for more information. - #[serde(skip_serializing_if = "Option::is_none")] - pub radar_options: Option, - - /// The email address to which this charge's [receipt](https://stripe.com/docs/dashboard/receipts) will be sent. - /// - /// The receipt will not be sent until the charge is paid, and no receipts will be sent for test mode charges. - /// If this charge is for a [Customer](https://stripe.com/docs/api/customers/object), the email address specified here will override the customer's email address. - /// If `receipt_email` is specified for a charge in live mode, a receipt will be sent regardless of your [email settings](https://dashboard.stripe.com/account/emails). - #[serde(skip_serializing_if = "Option::is_none")] - pub receipt_email: Option<&'a str>, - - /// Shipping information for the charge. - /// - /// Helps prevent fraud on charges for physical goods. - #[serde(skip_serializing_if = "Option::is_none")] - pub shipping: Option, - - /// A payment source to be charged. - /// - /// This can be the ID of a [card](https://stripe.com/docs/api#cards) (i.e., credit or debit card), a [bank account](https://stripe.com/docs/api#bank_accounts), a [source](https://stripe.com/docs/api#sources), a [token](https://stripe.com/docs/api#tokens), or a [connected account](https://stripe.com/docs/connect/account-debits#charging-a-connected-account). - /// For certain sources---namely, [cards](https://stripe.com/docs/api#cards), [bank accounts](https://stripe.com/docs/api#bank_accounts), and attached [sources](https://stripe.com/docs/api#sources)---you must also pass the ID of the associated customer. - #[serde(skip_serializing_if = "Option::is_none")] - pub source: Option, - - /// For card charges, use `statement_descriptor_suffix` instead. - /// - /// Otherwise, you can use this value as the complete description of a charge on your customers’ statements. - /// Must contain at least one letter, maximum 22 characters. - #[serde(skip_serializing_if = "Option::is_none")] - pub statement_descriptor: Option<&'a str>, - - /// Provides information about the charge that customers see on their statements. - /// - /// Concatenated with the prefix (shortened descriptor) or statement descriptor that’s set on the account to form the complete statement descriptor. - /// Maximum 22 characters for the concatenated descriptor. - #[serde(skip_serializing_if = "Option::is_none")] - pub statement_descriptor_suffix: Option<&'a str>, - - /// An optional dictionary including the account to automatically transfer to as part of a destination charge. - /// - /// [See the Connect documentation](https://stripe.com/docs/connect/destination-charges) for details. - #[serde(skip_serializing_if = "Option::is_none")] - pub transfer_data: Option, - - /// A string that identifies this transaction as part of a group. - /// - /// For details, see [Grouping transactions](https://stripe.com/docs/connect/separate-charges-and-transfers#transfer-options). - #[serde(skip_serializing_if = "Option::is_none")] - pub transfer_group: Option<&'a str>, -} - -impl<'a> CreateCharge<'a> { - pub fn new() -> Self { - CreateCharge { - amount: Default::default(), - application_fee: Default::default(), - application_fee_amount: Default::default(), - capture: Default::default(), - currency: Default::default(), - customer: Default::default(), - description: Default::default(), - destination: Default::default(), - expand: Default::default(), - metadata: Default::default(), - on_behalf_of: Default::default(), - radar_options: Default::default(), - receipt_email: Default::default(), - shipping: Default::default(), - source: Default::default(), - statement_descriptor: Default::default(), - statement_descriptor_suffix: Default::default(), - transfer_data: Default::default(), - transfer_group: Default::default(), - } - } -} - -/// The parameters for `Charge::list`. -#[derive(Clone, Debug, Serialize, Default)] -pub struct ListCharges<'a> { - #[serde(skip_serializing_if = "Option::is_none")] - pub created: Option>, - - /// Only return charges for the customer specified by this customer ID. - #[serde(skip_serializing_if = "Option::is_none")] - pub customer: Option, - - /// A cursor for use in pagination. - /// - /// `ending_before` is an object ID that defines your place in the list. - /// For instance, if you make a list request and receive 100 objects, starting with `obj_bar`, your subsequent call can include `ending_before=obj_bar` in order to fetch the previous page of the list. - #[serde(skip_serializing_if = "Option::is_none")] - pub ending_before: Option, - - /// Specifies which fields in the response should be expanded. - #[serde(skip_serializing_if = "Expand::is_empty")] - pub expand: &'a [&'a str], - - /// A limit on the number of objects to be returned. - /// - /// Limit can range between 1 and 100, and the default is 10. - #[serde(skip_serializing_if = "Option::is_none")] - pub limit: Option, - - /// Only return charges that were created by the PaymentIntent specified by this PaymentIntent ID. - #[serde(skip_serializing_if = "Option::is_none")] - pub payment_intent: Option, - - /// A cursor for use in pagination. - /// - /// `starting_after` is an object ID that defines your place in the list. - /// For instance, if you make a list request and receive 100 objects, ending with `obj_foo`, your subsequent call can include `starting_after=obj_foo` in order to fetch the next page of the list. - #[serde(skip_serializing_if = "Option::is_none")] - pub starting_after: Option, - - /// Only return charges for this transfer group. - #[serde(skip_serializing_if = "Option::is_none")] - pub transfer_group: Option<&'a str>, -} - -impl<'a> ListCharges<'a> { - pub fn new() -> Self { - ListCharges { - created: Default::default(), - customer: Default::default(), - ending_before: Default::default(), - expand: Default::default(), - limit: Default::default(), - payment_intent: Default::default(), - starting_after: Default::default(), - transfer_group: Default::default(), - } - } -} -impl Paginable for ListCharges<'_> { - type O = Charge; - fn set_last(&mut self, item: Self::O) { - self.starting_after = Some(item.id()); - } -} -/// The parameters for `Charge::update`. -#[derive(Clone, Debug, Serialize, Default)] -pub struct UpdateCharge<'a> { - /// The ID of an existing customer that will be associated with this request. - /// - /// This field may only be updated if there is no existing associated customer with this charge. - #[serde(skip_serializing_if = "Option::is_none")] - pub customer: Option, - - /// An arbitrary string which you can attach to a charge object. - /// - /// It is displayed when in the web interface alongside the charge. - /// Note that if you use Stripe to send automatic email receipts to your customers, your receipt emails will include the `description` of the charge(s) that they are describing. - #[serde(skip_serializing_if = "Option::is_none")] - pub description: Option<&'a str>, - - /// Specifies which fields in the response should be expanded. - #[serde(skip_serializing_if = "Expand::is_empty")] - pub expand: &'a [&'a str], - - /// A set of key-value pairs you can attach to a charge giving information about its riskiness. - /// - /// If you believe a charge is fraudulent, include a `user_report` key with a value of `fraudulent`. - /// If you believe a charge is safe, include a `user_report` key with a value of `safe`. - /// Stripe will use the information you send to improve our fraud detection algorithms. - #[serde(skip_serializing_if = "Option::is_none")] - pub fraud_details: Option, - - /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. - /// - /// This can be useful for storing additional information about the object in a structured format. - /// Individual keys can be unset by posting an empty value to them. - /// All keys can be unset by posting an empty value to `metadata`. - #[serde(skip_serializing_if = "Option::is_none")] - pub metadata: Option, - - /// This is the email address that the receipt for this charge will be sent to. - /// - /// If this field is updated, then a new email receipt will be sent to the updated address. - #[serde(skip_serializing_if = "Option::is_none")] - pub receipt_email: Option<&'a str>, - - /// Shipping information for the charge. - /// - /// Helps prevent fraud on charges for physical goods. - #[serde(skip_serializing_if = "Option::is_none")] - pub shipping: Option, - - /// A string that identifies this transaction as part of a group. - /// - /// `transfer_group` may only be provided if it has not been set. - /// See the [Connect documentation](https://stripe.com/docs/connect/separate-charges-and-transfers#transfer-options) for details. - #[serde(skip_serializing_if = "Option::is_none")] - pub transfer_group: Option<&'a str>, -} - -impl<'a> UpdateCharge<'a> { - pub fn new() -> Self { - UpdateCharge { - customer: Default::default(), - description: Default::default(), - expand: Default::default(), - fraud_details: Default::default(), - metadata: Default::default(), - receipt_email: Default::default(), - shipping: Default::default(), - transfer_group: Default::default(), - } - } -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreateChargeRadarOptions { - /// A [Radar Session](https://stripe.com/docs/radar/radar-session) is a snapshot of the browser metadata and device details that help Radar make more accurate predictions on your payments. - #[serde(skip_serializing_if = "Option::is_none")] - pub session: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct FraudDetailsParams { - /// Either `safe` or `fraudulent`. - pub user_report: FraudDetailsParamsUserReport, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct TransferDataParams { - /// The amount transferred to the destination account, if specified. - /// - /// By default, the entire charge amount is transferred to the destination account. - #[serde(skip_serializing_if = "Option::is_none")] - pub amount: Option, - - /// ID of an existing, connected Stripe account. - pub destination: String, -} - -/// An enum representing the possible values of an `Charge`'s `status` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum ChargeStatus { - Failed, - Pending, - Succeeded, -} - -impl ChargeStatus { - pub fn as_str(self) -> &'static str { - match self { - ChargeStatus::Failed => "failed", - ChargeStatus::Pending => "pending", - ChargeStatus::Succeeded => "succeeded", - } - } -} - -impl AsRef for ChargeStatus { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for ChargeStatus { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for ChargeStatus { - fn default() -> Self { - Self::Failed - } -} - -/// An enum representing the possible values of an `FraudDetailsParams`'s `user_report` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum FraudDetailsParamsUserReport { - Fraudulent, - Safe, -} - -impl FraudDetailsParamsUserReport { - pub fn as_str(self) -> &'static str { - match self { - FraudDetailsParamsUserReport::Fraudulent => "fraudulent", - FraudDetailsParamsUserReport::Safe => "safe", - } - } -} - -impl AsRef for FraudDetailsParamsUserReport { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for FraudDetailsParamsUserReport { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for FraudDetailsParamsUserReport { - fn default() -> Self { - Self::Fraudulent - } -} - -/// An enum representing the possible values of an `PaymentFlowsPrivatePaymentMethodsCardDetailsApiResourceEnterpriseFeaturesExtendedAuthorizationExtendedAuthorization`'s `status` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum PaymentFlowsPrivatePaymentMethodsCardDetailsApiResourceEnterpriseFeaturesExtendedAuthorizationExtendedAuthorizationStatus -{ - Disabled, - Enabled, -} - -impl PaymentFlowsPrivatePaymentMethodsCardDetailsApiResourceEnterpriseFeaturesExtendedAuthorizationExtendedAuthorizationStatus { - pub fn as_str(self) -> &'static str { - match self { - PaymentFlowsPrivatePaymentMethodsCardDetailsApiResourceEnterpriseFeaturesExtendedAuthorizationExtendedAuthorizationStatus::Disabled => "disabled", - PaymentFlowsPrivatePaymentMethodsCardDetailsApiResourceEnterpriseFeaturesExtendedAuthorizationExtendedAuthorizationStatus::Enabled => "enabled", - } - } -} - -impl AsRef for PaymentFlowsPrivatePaymentMethodsCardDetailsApiResourceEnterpriseFeaturesExtendedAuthorizationExtendedAuthorizationStatus { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for PaymentFlowsPrivatePaymentMethodsCardDetailsApiResourceEnterpriseFeaturesExtendedAuthorizationExtendedAuthorizationStatus { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for PaymentFlowsPrivatePaymentMethodsCardDetailsApiResourceEnterpriseFeaturesExtendedAuthorizationExtendedAuthorizationStatus { - fn default() -> Self { - Self::Disabled - } -} - -/// An enum representing the possible values of an `PaymentFlowsPrivatePaymentMethodsCardDetailsApiResourceEnterpriseFeaturesIncrementalAuthorizationIncrementalAuthorization`'s `status` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum PaymentFlowsPrivatePaymentMethodsCardDetailsApiResourceEnterpriseFeaturesIncrementalAuthorizationIncrementalAuthorizationStatus -{ - Available, - Unavailable, -} - -impl PaymentFlowsPrivatePaymentMethodsCardDetailsApiResourceEnterpriseFeaturesIncrementalAuthorizationIncrementalAuthorizationStatus { - pub fn as_str(self) -> &'static str { - match self { - PaymentFlowsPrivatePaymentMethodsCardDetailsApiResourceEnterpriseFeaturesIncrementalAuthorizationIncrementalAuthorizationStatus::Available => "available", - PaymentFlowsPrivatePaymentMethodsCardDetailsApiResourceEnterpriseFeaturesIncrementalAuthorizationIncrementalAuthorizationStatus::Unavailable => "unavailable", - } - } -} - -impl AsRef for PaymentFlowsPrivatePaymentMethodsCardDetailsApiResourceEnterpriseFeaturesIncrementalAuthorizationIncrementalAuthorizationStatus { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for PaymentFlowsPrivatePaymentMethodsCardDetailsApiResourceEnterpriseFeaturesIncrementalAuthorizationIncrementalAuthorizationStatus { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for PaymentFlowsPrivatePaymentMethodsCardDetailsApiResourceEnterpriseFeaturesIncrementalAuthorizationIncrementalAuthorizationStatus { - fn default() -> Self { - Self::Available - } -} - -/// An enum representing the possible values of an `PaymentFlowsPrivatePaymentMethodsCardDetailsApiResourceEnterpriseFeaturesOvercaptureOvercapture`'s `status` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum PaymentFlowsPrivatePaymentMethodsCardDetailsApiResourceEnterpriseFeaturesOvercaptureOvercaptureStatus -{ - Available, - Unavailable, -} - -impl PaymentFlowsPrivatePaymentMethodsCardDetailsApiResourceEnterpriseFeaturesOvercaptureOvercaptureStatus { - pub fn as_str(self) -> &'static str { - match self { - PaymentFlowsPrivatePaymentMethodsCardDetailsApiResourceEnterpriseFeaturesOvercaptureOvercaptureStatus::Available => "available", - PaymentFlowsPrivatePaymentMethodsCardDetailsApiResourceEnterpriseFeaturesOvercaptureOvercaptureStatus::Unavailable => "unavailable", - } - } -} - -impl AsRef for PaymentFlowsPrivatePaymentMethodsCardDetailsApiResourceEnterpriseFeaturesOvercaptureOvercaptureStatus { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for PaymentFlowsPrivatePaymentMethodsCardDetailsApiResourceEnterpriseFeaturesOvercaptureOvercaptureStatus { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for PaymentFlowsPrivatePaymentMethodsCardDetailsApiResourceEnterpriseFeaturesOvercaptureOvercaptureStatus { - fn default() -> Self { - Self::Available - } -} - -/// An enum representing the possible values of an `PaymentFlowsPrivatePaymentMethodsCardDetailsApiResourceMulticapture`'s `status` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum PaymentFlowsPrivatePaymentMethodsCardDetailsApiResourceMulticaptureStatus { - Available, - Unavailable, -} - -impl PaymentFlowsPrivatePaymentMethodsCardDetailsApiResourceMulticaptureStatus { - pub fn as_str(self) -> &'static str { - match self { - PaymentFlowsPrivatePaymentMethodsCardDetailsApiResourceMulticaptureStatus::Available => "available", - PaymentFlowsPrivatePaymentMethodsCardDetailsApiResourceMulticaptureStatus::Unavailable => "unavailable", - } - } -} - -impl AsRef for PaymentFlowsPrivatePaymentMethodsCardDetailsApiResourceMulticaptureStatus { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display - for PaymentFlowsPrivatePaymentMethodsCardDetailsApiResourceMulticaptureStatus -{ - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default - for PaymentFlowsPrivatePaymentMethodsCardDetailsApiResourceMulticaptureStatus -{ - fn default() -> Self { - Self::Available - } -} - -/// An enum representing the possible values of an `PaymentMethodDetailsAchDebit`'s `account_holder_type` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum PaymentMethodDetailsAchDebitAccountHolderType { - Company, - Individual, -} - -impl PaymentMethodDetailsAchDebitAccountHolderType { - pub fn as_str(self) -> &'static str { - match self { - PaymentMethodDetailsAchDebitAccountHolderType::Company => "company", - PaymentMethodDetailsAchDebitAccountHolderType::Individual => "individual", - } - } -} - -impl AsRef for PaymentMethodDetailsAchDebitAccountHolderType { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for PaymentMethodDetailsAchDebitAccountHolderType { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for PaymentMethodDetailsAchDebitAccountHolderType { - fn default() -> Self { - Self::Company - } -} - -/// An enum representing the possible values of an `PaymentMethodDetailsBancontact`'s `preferred_language` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum PaymentMethodDetailsBancontactPreferredLanguage { - De, - En, - Fr, - Nl, -} - -impl PaymentMethodDetailsBancontactPreferredLanguage { - pub fn as_str(self) -> &'static str { - match self { - PaymentMethodDetailsBancontactPreferredLanguage::De => "de", - PaymentMethodDetailsBancontactPreferredLanguage::En => "en", - PaymentMethodDetailsBancontactPreferredLanguage::Fr => "fr", - PaymentMethodDetailsBancontactPreferredLanguage::Nl => "nl", - } - } -} - -impl AsRef for PaymentMethodDetailsBancontactPreferredLanguage { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for PaymentMethodDetailsBancontactPreferredLanguage { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for PaymentMethodDetailsBancontactPreferredLanguage { - fn default() -> Self { - Self::De - } -} - -/// An enum representing the possible values of an `PaymentMethodDetailsCardPresent`'s `read_method` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum PaymentMethodDetailsCardPresentReadMethod { - ContactEmv, - ContactlessEmv, - ContactlessMagstripeMode, - MagneticStripeFallback, - MagneticStripeTrack2, -} - -impl PaymentMethodDetailsCardPresentReadMethod { - pub fn as_str(self) -> &'static str { - match self { - PaymentMethodDetailsCardPresentReadMethod::ContactEmv => "contact_emv", - PaymentMethodDetailsCardPresentReadMethod::ContactlessEmv => "contactless_emv", - PaymentMethodDetailsCardPresentReadMethod::ContactlessMagstripeMode => { - "contactless_magstripe_mode" - } - PaymentMethodDetailsCardPresentReadMethod::MagneticStripeFallback => { - "magnetic_stripe_fallback" - } - PaymentMethodDetailsCardPresentReadMethod::MagneticStripeTrack2 => { - "magnetic_stripe_track2" - } - } - } -} - -impl AsRef for PaymentMethodDetailsCardPresentReadMethod { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for PaymentMethodDetailsCardPresentReadMethod { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for PaymentMethodDetailsCardPresentReadMethod { - fn default() -> Self { - Self::ContactEmv - } -} - -/// An enum representing the possible values of an `PaymentMethodDetailsCardPresentReceipt`'s `account_type` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum PaymentMethodDetailsCardPresentReceiptAccountType { - Checking, - Credit, - Prepaid, - Unknown, -} - -impl PaymentMethodDetailsCardPresentReceiptAccountType { - pub fn as_str(self) -> &'static str { - match self { - PaymentMethodDetailsCardPresentReceiptAccountType::Checking => "checking", - PaymentMethodDetailsCardPresentReceiptAccountType::Credit => "credit", - PaymentMethodDetailsCardPresentReceiptAccountType::Prepaid => "prepaid", - PaymentMethodDetailsCardPresentReceiptAccountType::Unknown => "unknown", - } - } -} - -impl AsRef for PaymentMethodDetailsCardPresentReceiptAccountType { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for PaymentMethodDetailsCardPresentReceiptAccountType { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for PaymentMethodDetailsCardPresentReceiptAccountType { - fn default() -> Self { - Self::Checking - } -} - -/// An enum representing the possible values of an `PaymentMethodDetailsCardWallet`'s `type` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum PaymentMethodDetailsCardWalletType { - AmexExpressCheckout, - ApplePay, - GooglePay, - Link, - Masterpass, - SamsungPay, - VisaCheckout, -} - -impl PaymentMethodDetailsCardWalletType { - pub fn as_str(self) -> &'static str { - match self { - PaymentMethodDetailsCardWalletType::AmexExpressCheckout => "amex_express_checkout", - PaymentMethodDetailsCardWalletType::ApplePay => "apple_pay", - PaymentMethodDetailsCardWalletType::GooglePay => "google_pay", - PaymentMethodDetailsCardWalletType::Link => "link", - PaymentMethodDetailsCardWalletType::Masterpass => "masterpass", - PaymentMethodDetailsCardWalletType::SamsungPay => "samsung_pay", - PaymentMethodDetailsCardWalletType::VisaCheckout => "visa_checkout", - } - } -} - -impl AsRef for PaymentMethodDetailsCardWalletType { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for PaymentMethodDetailsCardWalletType { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for PaymentMethodDetailsCardWalletType { - fn default() -> Self { - Self::AmexExpressCheckout - } -} - -/// An enum representing the possible values of an `PaymentMethodDetailsEps`'s `bank` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum PaymentMethodDetailsEpsBank { - ArzteUndApothekerBank, - AustrianAnadiBankAg, - BankAustria, - BankhausCarlSpangler, - BankhausSchelhammerUndSchatteraAg, - BawagPskAg, - BksBankAg, - BrullKallmusBankAg, - BtvVierLanderBank, - CapitalBankGraweGruppeAg, - DeutscheBankAg, - Dolomitenbank, - EasybankAg, - ErsteBankUndSparkassen, - HypoAlpeadriabankInternationalAg, - HypoBankBurgenlandAktiengesellschaft, - HypoNoeLbFurNiederosterreichUWien, - HypoOberosterreichSalzburgSteiermark, - HypoTirolBankAg, - HypoVorarlbergBankAg, - MarchfelderBank, - OberbankAg, - RaiffeisenBankengruppeOsterreich, - SchoellerbankAg, - SpardaBankWien, - VolksbankGruppe, - VolkskreditbankAg, - VrBankBraunau, -} - -impl PaymentMethodDetailsEpsBank { - pub fn as_str(self) -> &'static str { - match self { - PaymentMethodDetailsEpsBank::ArzteUndApothekerBank => "arzte_und_apotheker_bank", - PaymentMethodDetailsEpsBank::AustrianAnadiBankAg => "austrian_anadi_bank_ag", - PaymentMethodDetailsEpsBank::BankAustria => "bank_austria", - PaymentMethodDetailsEpsBank::BankhausCarlSpangler => "bankhaus_carl_spangler", - PaymentMethodDetailsEpsBank::BankhausSchelhammerUndSchatteraAg => { - "bankhaus_schelhammer_und_schattera_ag" - } - PaymentMethodDetailsEpsBank::BawagPskAg => "bawag_psk_ag", - PaymentMethodDetailsEpsBank::BksBankAg => "bks_bank_ag", - PaymentMethodDetailsEpsBank::BrullKallmusBankAg => "brull_kallmus_bank_ag", - PaymentMethodDetailsEpsBank::BtvVierLanderBank => "btv_vier_lander_bank", - PaymentMethodDetailsEpsBank::CapitalBankGraweGruppeAg => "capital_bank_grawe_gruppe_ag", - PaymentMethodDetailsEpsBank::DeutscheBankAg => "deutsche_bank_ag", - PaymentMethodDetailsEpsBank::Dolomitenbank => "dolomitenbank", - PaymentMethodDetailsEpsBank::EasybankAg => "easybank_ag", - PaymentMethodDetailsEpsBank::ErsteBankUndSparkassen => "erste_bank_und_sparkassen", - PaymentMethodDetailsEpsBank::HypoAlpeadriabankInternationalAg => { - "hypo_alpeadriabank_international_ag" - } - PaymentMethodDetailsEpsBank::HypoBankBurgenlandAktiengesellschaft => { - "hypo_bank_burgenland_aktiengesellschaft" - } - PaymentMethodDetailsEpsBank::HypoNoeLbFurNiederosterreichUWien => { - "hypo_noe_lb_fur_niederosterreich_u_wien" - } - PaymentMethodDetailsEpsBank::HypoOberosterreichSalzburgSteiermark => { - "hypo_oberosterreich_salzburg_steiermark" - } - PaymentMethodDetailsEpsBank::HypoTirolBankAg => "hypo_tirol_bank_ag", - PaymentMethodDetailsEpsBank::HypoVorarlbergBankAg => "hypo_vorarlberg_bank_ag", - PaymentMethodDetailsEpsBank::MarchfelderBank => "marchfelder_bank", - PaymentMethodDetailsEpsBank::OberbankAg => "oberbank_ag", - PaymentMethodDetailsEpsBank::RaiffeisenBankengruppeOsterreich => { - "raiffeisen_bankengruppe_osterreich" - } - PaymentMethodDetailsEpsBank::SchoellerbankAg => "schoellerbank_ag", - PaymentMethodDetailsEpsBank::SpardaBankWien => "sparda_bank_wien", - PaymentMethodDetailsEpsBank::VolksbankGruppe => "volksbank_gruppe", - PaymentMethodDetailsEpsBank::VolkskreditbankAg => "volkskreditbank_ag", - PaymentMethodDetailsEpsBank::VrBankBraunau => "vr_bank_braunau", - } - } -} - -impl AsRef for PaymentMethodDetailsEpsBank { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for PaymentMethodDetailsEpsBank { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for PaymentMethodDetailsEpsBank { - fn default() -> Self { - Self::ArzteUndApothekerBank - } -} - -/// An enum representing the possible values of an `PaymentMethodDetailsFpx`'s `account_holder_type` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum PaymentMethodDetailsFpxAccountHolderType { - Company, - Individual, -} - -impl PaymentMethodDetailsFpxAccountHolderType { - pub fn as_str(self) -> &'static str { - match self { - PaymentMethodDetailsFpxAccountHolderType::Company => "company", - PaymentMethodDetailsFpxAccountHolderType::Individual => "individual", - } - } -} - -impl AsRef for PaymentMethodDetailsFpxAccountHolderType { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for PaymentMethodDetailsFpxAccountHolderType { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for PaymentMethodDetailsFpxAccountHolderType { - fn default() -> Self { - Self::Company - } -} - -/// An enum representing the possible values of an `PaymentMethodDetailsFpx`'s `bank` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum PaymentMethodDetailsFpxBank { - AffinBank, - Agrobank, - AllianceBank, - Ambank, - BankIslam, - BankMuamalat, - BankOfChina, - BankRakyat, - Bsn, - Cimb, - DeutscheBank, - HongLeongBank, - Hsbc, - Kfh, - Maybank2e, - Maybank2u, - Ocbc, - PbEnterprise, - PublicBank, - Rhb, - StandardChartered, - Uob, -} - -impl PaymentMethodDetailsFpxBank { - pub fn as_str(self) -> &'static str { - match self { - PaymentMethodDetailsFpxBank::AffinBank => "affin_bank", - PaymentMethodDetailsFpxBank::Agrobank => "agrobank", - PaymentMethodDetailsFpxBank::AllianceBank => "alliance_bank", - PaymentMethodDetailsFpxBank::Ambank => "ambank", - PaymentMethodDetailsFpxBank::BankIslam => "bank_islam", - PaymentMethodDetailsFpxBank::BankMuamalat => "bank_muamalat", - PaymentMethodDetailsFpxBank::BankOfChina => "bank_of_china", - PaymentMethodDetailsFpxBank::BankRakyat => "bank_rakyat", - PaymentMethodDetailsFpxBank::Bsn => "bsn", - PaymentMethodDetailsFpxBank::Cimb => "cimb", - PaymentMethodDetailsFpxBank::DeutscheBank => "deutsche_bank", - PaymentMethodDetailsFpxBank::HongLeongBank => "hong_leong_bank", - PaymentMethodDetailsFpxBank::Hsbc => "hsbc", - PaymentMethodDetailsFpxBank::Kfh => "kfh", - PaymentMethodDetailsFpxBank::Maybank2e => "maybank2e", - PaymentMethodDetailsFpxBank::Maybank2u => "maybank2u", - PaymentMethodDetailsFpxBank::Ocbc => "ocbc", - PaymentMethodDetailsFpxBank::PbEnterprise => "pb_enterprise", - PaymentMethodDetailsFpxBank::PublicBank => "public_bank", - PaymentMethodDetailsFpxBank::Rhb => "rhb", - PaymentMethodDetailsFpxBank::StandardChartered => "standard_chartered", - PaymentMethodDetailsFpxBank::Uob => "uob", - } - } -} - -impl AsRef for PaymentMethodDetailsFpxBank { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for PaymentMethodDetailsFpxBank { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for PaymentMethodDetailsFpxBank { - fn default() -> Self { - Self::AffinBank - } -} - -/// An enum representing the possible values of an `PaymentMethodDetailsIdeal`'s `bank` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum PaymentMethodDetailsIdealBank { - AbnAmro, - AsnBank, - Bunq, - Handelsbanken, - Ing, - Knab, - Moneyou, - N26, - Nn, - Rabobank, - Regiobank, - Revolut, - SnsBank, - TriodosBank, - VanLanschot, - Yoursafe, -} - -impl PaymentMethodDetailsIdealBank { - pub fn as_str(self) -> &'static str { - match self { - PaymentMethodDetailsIdealBank::AbnAmro => "abn_amro", - PaymentMethodDetailsIdealBank::AsnBank => "asn_bank", - PaymentMethodDetailsIdealBank::Bunq => "bunq", - PaymentMethodDetailsIdealBank::Handelsbanken => "handelsbanken", - PaymentMethodDetailsIdealBank::Ing => "ing", - PaymentMethodDetailsIdealBank::Knab => "knab", - PaymentMethodDetailsIdealBank::Moneyou => "moneyou", - PaymentMethodDetailsIdealBank::N26 => "n26", - PaymentMethodDetailsIdealBank::Nn => "nn", - PaymentMethodDetailsIdealBank::Rabobank => "rabobank", - PaymentMethodDetailsIdealBank::Regiobank => "regiobank", - PaymentMethodDetailsIdealBank::Revolut => "revolut", - PaymentMethodDetailsIdealBank::SnsBank => "sns_bank", - PaymentMethodDetailsIdealBank::TriodosBank => "triodos_bank", - PaymentMethodDetailsIdealBank::VanLanschot => "van_lanschot", - PaymentMethodDetailsIdealBank::Yoursafe => "yoursafe", - } - } -} - -impl AsRef for PaymentMethodDetailsIdealBank { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for PaymentMethodDetailsIdealBank { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for PaymentMethodDetailsIdealBank { - fn default() -> Self { - Self::AbnAmro - } -} - -/// An enum representing the possible values of an `PaymentMethodDetailsIdeal`'s `bic` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum PaymentMethodDetailsIdealBic { - #[serde(rename = "ABNANL2A")] - Abnanl2a, - #[serde(rename = "ASNBNL21")] - Asnbnl21, - #[serde(rename = "BITSNL2A")] - Bitsnl2a, - #[serde(rename = "BUNQNL2A")] - Bunqnl2a, - #[serde(rename = "FVLBNL22")] - Fvlbnl22, - #[serde(rename = "HANDNL2A")] - Handnl2a, - #[serde(rename = "INGBNL2A")] - Ingbnl2a, - #[serde(rename = "KNABNL2H")] - Knabnl2h, - #[serde(rename = "MOYONL21")] - Moyonl21, - #[serde(rename = "NNBANL2G")] - Nnbanl2g, - #[serde(rename = "NTSBDEB1")] - Ntsbdeb1, - #[serde(rename = "RABONL2U")] - Rabonl2u, - #[serde(rename = "RBRBNL21")] - Rbrbnl21, - #[serde(rename = "REVOIE23")] - Revoie23, - #[serde(rename = "REVOLT21")] - Revolt21, - #[serde(rename = "SNSBNL2A")] - Snsbnl2a, - #[serde(rename = "TRIONL2U")] - Trionl2u, -} - -impl PaymentMethodDetailsIdealBic { - pub fn as_str(self) -> &'static str { - match self { - PaymentMethodDetailsIdealBic::Abnanl2a => "ABNANL2A", - PaymentMethodDetailsIdealBic::Asnbnl21 => "ASNBNL21", - PaymentMethodDetailsIdealBic::Bitsnl2a => "BITSNL2A", - PaymentMethodDetailsIdealBic::Bunqnl2a => "BUNQNL2A", - PaymentMethodDetailsIdealBic::Fvlbnl22 => "FVLBNL22", - PaymentMethodDetailsIdealBic::Handnl2a => "HANDNL2A", - PaymentMethodDetailsIdealBic::Ingbnl2a => "INGBNL2A", - PaymentMethodDetailsIdealBic::Knabnl2h => "KNABNL2H", - PaymentMethodDetailsIdealBic::Moyonl21 => "MOYONL21", - PaymentMethodDetailsIdealBic::Nnbanl2g => "NNBANL2G", - PaymentMethodDetailsIdealBic::Ntsbdeb1 => "NTSBDEB1", - PaymentMethodDetailsIdealBic::Rabonl2u => "RABONL2U", - PaymentMethodDetailsIdealBic::Rbrbnl21 => "RBRBNL21", - PaymentMethodDetailsIdealBic::Revoie23 => "REVOIE23", - PaymentMethodDetailsIdealBic::Revolt21 => "REVOLT21", - PaymentMethodDetailsIdealBic::Snsbnl2a => "SNSBNL2A", - PaymentMethodDetailsIdealBic::Trionl2u => "TRIONL2U", - } - } -} - -impl AsRef for PaymentMethodDetailsIdealBic { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for PaymentMethodDetailsIdealBic { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for PaymentMethodDetailsIdealBic { - fn default() -> Self { - Self::Abnanl2a - } -} - -/// An enum representing the possible values of an `PaymentMethodDetailsInteracPresent`'s `read_method` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum PaymentMethodDetailsInteracPresentReadMethod { - ContactEmv, - ContactlessEmv, - ContactlessMagstripeMode, - MagneticStripeFallback, - MagneticStripeTrack2, -} - -impl PaymentMethodDetailsInteracPresentReadMethod { - pub fn as_str(self) -> &'static str { - match self { - PaymentMethodDetailsInteracPresentReadMethod::ContactEmv => "contact_emv", - PaymentMethodDetailsInteracPresentReadMethod::ContactlessEmv => "contactless_emv", - PaymentMethodDetailsInteracPresentReadMethod::ContactlessMagstripeMode => { - "contactless_magstripe_mode" - } - PaymentMethodDetailsInteracPresentReadMethod::MagneticStripeFallback => { - "magnetic_stripe_fallback" - } - PaymentMethodDetailsInteracPresentReadMethod::MagneticStripeTrack2 => { - "magnetic_stripe_track2" - } - } - } -} - -impl AsRef for PaymentMethodDetailsInteracPresentReadMethod { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for PaymentMethodDetailsInteracPresentReadMethod { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for PaymentMethodDetailsInteracPresentReadMethod { - fn default() -> Self { - Self::ContactEmv - } -} - -/// An enum representing the possible values of an `PaymentMethodDetailsInteracPresentReceipt`'s `account_type` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum PaymentMethodDetailsInteracPresentReceiptAccountType { - Checking, - Savings, - Unknown, -} - -impl PaymentMethodDetailsInteracPresentReceiptAccountType { - pub fn as_str(self) -> &'static str { - match self { - PaymentMethodDetailsInteracPresentReceiptAccountType::Checking => "checking", - PaymentMethodDetailsInteracPresentReceiptAccountType::Savings => "savings", - PaymentMethodDetailsInteracPresentReceiptAccountType::Unknown => "unknown", - } - } -} - -impl AsRef for PaymentMethodDetailsInteracPresentReceiptAccountType { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for PaymentMethodDetailsInteracPresentReceiptAccountType { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for PaymentMethodDetailsInteracPresentReceiptAccountType { - fn default() -> Self { - Self::Checking - } -} - -/// An enum representing the possible values of an `PaymentMethodDetailsKonbiniStore`'s `chain` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum PaymentMethodDetailsKonbiniStoreChain { - Familymart, - Lawson, - Ministop, - Seicomart, -} - -impl PaymentMethodDetailsKonbiniStoreChain { - pub fn as_str(self) -> &'static str { - match self { - PaymentMethodDetailsKonbiniStoreChain::Familymart => "familymart", - PaymentMethodDetailsKonbiniStoreChain::Lawson => "lawson", - PaymentMethodDetailsKonbiniStoreChain::Ministop => "ministop", - PaymentMethodDetailsKonbiniStoreChain::Seicomart => "seicomart", - } - } -} - -impl AsRef for PaymentMethodDetailsKonbiniStoreChain { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for PaymentMethodDetailsKonbiniStoreChain { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for PaymentMethodDetailsKonbiniStoreChain { - fn default() -> Self { - Self::Familymart - } -} - -/// An enum representing the possible values of an `PaymentMethodDetailsP24`'s `bank` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum PaymentMethodDetailsP24Bank { - AliorBank, - BankMillennium, - BankNowyBfgSa, - BankPekaoSa, - BankiSpbdzielcze, - Blik, - BnpParibas, - Boz, - CitiHandlowy, - CreditAgricole, - Envelobank, - EtransferPocztowy24, - GetinBank, - Ideabank, - Ing, - Inteligo, - MbankMtransfer, - NestPrzelew, - NoblePay, - PbacZIpko, - PlusBank, - SantanderPrzelew24, - TmobileUsbugiBankowe, - ToyotaBank, - Velobank, - VolkswagenBank, -} - -impl PaymentMethodDetailsP24Bank { - pub fn as_str(self) -> &'static str { - match self { - PaymentMethodDetailsP24Bank::AliorBank => "alior_bank", - PaymentMethodDetailsP24Bank::BankMillennium => "bank_millennium", - PaymentMethodDetailsP24Bank::BankNowyBfgSa => "bank_nowy_bfg_sa", - PaymentMethodDetailsP24Bank::BankPekaoSa => "bank_pekao_sa", - PaymentMethodDetailsP24Bank::BankiSpbdzielcze => "banki_spbdzielcze", - PaymentMethodDetailsP24Bank::Blik => "blik", - PaymentMethodDetailsP24Bank::BnpParibas => "bnp_paribas", - PaymentMethodDetailsP24Bank::Boz => "boz", - PaymentMethodDetailsP24Bank::CitiHandlowy => "citi_handlowy", - PaymentMethodDetailsP24Bank::CreditAgricole => "credit_agricole", - PaymentMethodDetailsP24Bank::Envelobank => "envelobank", - PaymentMethodDetailsP24Bank::EtransferPocztowy24 => "etransfer_pocztowy24", - PaymentMethodDetailsP24Bank::GetinBank => "getin_bank", - PaymentMethodDetailsP24Bank::Ideabank => "ideabank", - PaymentMethodDetailsP24Bank::Ing => "ing", - PaymentMethodDetailsP24Bank::Inteligo => "inteligo", - PaymentMethodDetailsP24Bank::MbankMtransfer => "mbank_mtransfer", - PaymentMethodDetailsP24Bank::NestPrzelew => "nest_przelew", - PaymentMethodDetailsP24Bank::NoblePay => "noble_pay", - PaymentMethodDetailsP24Bank::PbacZIpko => "pbac_z_ipko", - PaymentMethodDetailsP24Bank::PlusBank => "plus_bank", - PaymentMethodDetailsP24Bank::SantanderPrzelew24 => "santander_przelew24", - PaymentMethodDetailsP24Bank::TmobileUsbugiBankowe => "tmobile_usbugi_bankowe", - PaymentMethodDetailsP24Bank::ToyotaBank => "toyota_bank", - PaymentMethodDetailsP24Bank::Velobank => "velobank", - PaymentMethodDetailsP24Bank::VolkswagenBank => "volkswagen_bank", - } - } -} - -impl AsRef for PaymentMethodDetailsP24Bank { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for PaymentMethodDetailsP24Bank { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for PaymentMethodDetailsP24Bank { - fn default() -> Self { - Self::AliorBank - } -} - -/// An enum representing the possible values of an `PaymentMethodDetailsSofort`'s `preferred_language` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum PaymentMethodDetailsSofortPreferredLanguage { - De, - En, - Es, - Fr, - It, - Nl, - Pl, -} - -impl PaymentMethodDetailsSofortPreferredLanguage { - pub fn as_str(self) -> &'static str { - match self { - PaymentMethodDetailsSofortPreferredLanguage::De => "de", - PaymentMethodDetailsSofortPreferredLanguage::En => "en", - PaymentMethodDetailsSofortPreferredLanguage::Es => "es", - PaymentMethodDetailsSofortPreferredLanguage::Fr => "fr", - PaymentMethodDetailsSofortPreferredLanguage::It => "it", - PaymentMethodDetailsSofortPreferredLanguage::Nl => "nl", - PaymentMethodDetailsSofortPreferredLanguage::Pl => "pl", - } - } -} - -impl AsRef for PaymentMethodDetailsSofortPreferredLanguage { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for PaymentMethodDetailsSofortPreferredLanguage { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for PaymentMethodDetailsSofortPreferredLanguage { - fn default() -> Self { - Self::De - } -} - -/// An enum representing the possible values of an `PaymentMethodDetailsUsBankAccount`'s `account_holder_type` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum PaymentMethodDetailsUsBankAccountAccountHolderType { - Company, - Individual, -} - -impl PaymentMethodDetailsUsBankAccountAccountHolderType { - pub fn as_str(self) -> &'static str { - match self { - PaymentMethodDetailsUsBankAccountAccountHolderType::Company => "company", - PaymentMethodDetailsUsBankAccountAccountHolderType::Individual => "individual", - } - } -} - -impl AsRef for PaymentMethodDetailsUsBankAccountAccountHolderType { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for PaymentMethodDetailsUsBankAccountAccountHolderType { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for PaymentMethodDetailsUsBankAccountAccountHolderType { - fn default() -> Self { - Self::Company - } -} - -/// An enum representing the possible values of an `PaymentMethodDetailsUsBankAccount`'s `account_type` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum PaymentMethodDetailsUsBankAccountAccountType { - Checking, - Savings, -} - -impl PaymentMethodDetailsUsBankAccountAccountType { - pub fn as_str(self) -> &'static str { - match self { - PaymentMethodDetailsUsBankAccountAccountType::Checking => "checking", - PaymentMethodDetailsUsBankAccountAccountType::Savings => "savings", - } - } -} - -impl AsRef for PaymentMethodDetailsUsBankAccountAccountType { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for PaymentMethodDetailsUsBankAccountAccountType { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for PaymentMethodDetailsUsBankAccountAccountType { - fn default() -> Self { - Self::Checking - } -} - -/// An enum representing the possible values of an `PaypalSellerProtection`'s `dispute_categories` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum PaypalSellerProtectionDisputeCategories { - Fraudulent, - ProductNotReceived, -} - -impl PaypalSellerProtectionDisputeCategories { - pub fn as_str(self) -> &'static str { - match self { - PaypalSellerProtectionDisputeCategories::Fraudulent => "fraudulent", - PaypalSellerProtectionDisputeCategories::ProductNotReceived => "product_not_received", - } - } -} - -impl AsRef for PaypalSellerProtectionDisputeCategories { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for PaypalSellerProtectionDisputeCategories { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for PaypalSellerProtectionDisputeCategories { - fn default() -> Self { - Self::Fraudulent - } -} - -/// An enum representing the possible values of an `PaypalSellerProtection`'s `status` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum PaypalSellerProtectionStatus { - Eligible, - NotEligible, - PartiallyEligible, -} - -impl PaypalSellerProtectionStatus { - pub fn as_str(self) -> &'static str { - match self { - PaypalSellerProtectionStatus::Eligible => "eligible", - PaypalSellerProtectionStatus::NotEligible => "not_eligible", - PaypalSellerProtectionStatus::PartiallyEligible => "partially_eligible", - } - } -} - -impl AsRef for PaypalSellerProtectionStatus { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for PaypalSellerProtectionStatus { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for PaypalSellerProtectionStatus { - fn default() -> Self { - Self::Eligible - } -} - -/// An enum representing the possible values of an `ThreeDSecureDetailsCharge`'s `authentication_flow` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum ThreeDSecureDetailsChargeAuthenticationFlow { - Challenge, - Frictionless, -} - -impl ThreeDSecureDetailsChargeAuthenticationFlow { - pub fn as_str(self) -> &'static str { - match self { - ThreeDSecureDetailsChargeAuthenticationFlow::Challenge => "challenge", - ThreeDSecureDetailsChargeAuthenticationFlow::Frictionless => "frictionless", - } - } -} - -impl AsRef for ThreeDSecureDetailsChargeAuthenticationFlow { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for ThreeDSecureDetailsChargeAuthenticationFlow { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for ThreeDSecureDetailsChargeAuthenticationFlow { - fn default() -> Self { - Self::Challenge - } -} - -/// An enum representing the possible values of an `ThreeDSecureDetailsCharge`'s `electronic_commerce_indicator` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum ThreeDSecureDetailsChargeElectronicCommerceIndicator { - #[serde(rename = "01")] - V01, - #[serde(rename = "02")] - V02, - #[serde(rename = "05")] - V05, - #[serde(rename = "06")] - V06, - #[serde(rename = "07")] - V07, -} - -impl ThreeDSecureDetailsChargeElectronicCommerceIndicator { - pub fn as_str(self) -> &'static str { - match self { - ThreeDSecureDetailsChargeElectronicCommerceIndicator::V01 => "01", - ThreeDSecureDetailsChargeElectronicCommerceIndicator::V02 => "02", - ThreeDSecureDetailsChargeElectronicCommerceIndicator::V05 => "05", - ThreeDSecureDetailsChargeElectronicCommerceIndicator::V06 => "06", - ThreeDSecureDetailsChargeElectronicCommerceIndicator::V07 => "07", - } - } -} - -impl AsRef for ThreeDSecureDetailsChargeElectronicCommerceIndicator { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for ThreeDSecureDetailsChargeElectronicCommerceIndicator { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for ThreeDSecureDetailsChargeElectronicCommerceIndicator { - fn default() -> Self { - Self::V01 - } -} - -/// An enum representing the possible values of an `ThreeDSecureDetailsCharge`'s `exemption_indicator` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum ThreeDSecureDetailsChargeExemptionIndicator { - LowRisk, - None, -} - -impl ThreeDSecureDetailsChargeExemptionIndicator { - pub fn as_str(self) -> &'static str { - match self { - ThreeDSecureDetailsChargeExemptionIndicator::LowRisk => "low_risk", - ThreeDSecureDetailsChargeExemptionIndicator::None => "none", - } - } -} - -impl AsRef for ThreeDSecureDetailsChargeExemptionIndicator { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for ThreeDSecureDetailsChargeExemptionIndicator { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for ThreeDSecureDetailsChargeExemptionIndicator { - fn default() -> Self { - Self::LowRisk - } -} - -/// An enum representing the possible values of an `ThreeDSecureDetailsCharge`'s `result` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum ThreeDSecureDetailsChargeResult { - AttemptAcknowledged, - Authenticated, - Exempted, - Failed, - NotSupported, - ProcessingError, -} - -impl ThreeDSecureDetailsChargeResult { - pub fn as_str(self) -> &'static str { - match self { - ThreeDSecureDetailsChargeResult::AttemptAcknowledged => "attempt_acknowledged", - ThreeDSecureDetailsChargeResult::Authenticated => "authenticated", - ThreeDSecureDetailsChargeResult::Exempted => "exempted", - ThreeDSecureDetailsChargeResult::Failed => "failed", - ThreeDSecureDetailsChargeResult::NotSupported => "not_supported", - ThreeDSecureDetailsChargeResult::ProcessingError => "processing_error", - } - } -} - -impl AsRef for ThreeDSecureDetailsChargeResult { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for ThreeDSecureDetailsChargeResult { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for ThreeDSecureDetailsChargeResult { - fn default() -> Self { - Self::AttemptAcknowledged - } -} - -/// An enum representing the possible values of an `ThreeDSecureDetailsCharge`'s `result_reason` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum ThreeDSecureDetailsChargeResultReason { - Abandoned, - Bypassed, - Canceled, - CardNotEnrolled, - NetworkNotSupported, - ProtocolError, - Rejected, -} - -impl ThreeDSecureDetailsChargeResultReason { - pub fn as_str(self) -> &'static str { - match self { - ThreeDSecureDetailsChargeResultReason::Abandoned => "abandoned", - ThreeDSecureDetailsChargeResultReason::Bypassed => "bypassed", - ThreeDSecureDetailsChargeResultReason::Canceled => "canceled", - ThreeDSecureDetailsChargeResultReason::CardNotEnrolled => "card_not_enrolled", - ThreeDSecureDetailsChargeResultReason::NetworkNotSupported => "network_not_supported", - ThreeDSecureDetailsChargeResultReason::ProtocolError => "protocol_error", - ThreeDSecureDetailsChargeResultReason::Rejected => "rejected", - } - } -} - -impl AsRef for ThreeDSecureDetailsChargeResultReason { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for ThreeDSecureDetailsChargeResultReason { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for ThreeDSecureDetailsChargeResultReason { - fn default() -> Self { - Self::Abandoned - } -} - -/// An enum representing the possible values of an `ThreeDSecureDetailsCharge`'s `version` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum ThreeDSecureDetailsChargeVersion { - #[serde(rename = "1.0.2")] - V1_0_2, - #[serde(rename = "2.1.0")] - V2_1_0, - #[serde(rename = "2.2.0")] - V2_2_0, -} - -impl ThreeDSecureDetailsChargeVersion { - pub fn as_str(self) -> &'static str { - match self { - ThreeDSecureDetailsChargeVersion::V1_0_2 => "1.0.2", - ThreeDSecureDetailsChargeVersion::V2_1_0 => "2.1.0", - ThreeDSecureDetailsChargeVersion::V2_2_0 => "2.2.0", - } - } -} - -impl AsRef for ThreeDSecureDetailsChargeVersion { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for ThreeDSecureDetailsChargeVersion { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for ThreeDSecureDetailsChargeVersion { - fn default() -> Self { - Self::V1_0_2 - } -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct DestinationSpecs { - /// ID of an existing, connected Stripe account. - pub account: String, - /// The amount to transfer to the destination account without creating an `Application Fee` object. - /// - /// Cannot be combined with the `application_fee` parameter. - /// Must be less than or equal to the charge amount. - #[serde(skip_serializing_if = "Option::is_none")] - pub amount: Option, -} diff --git a/src/resources/generated/charge_captured.rs b/src/resources/generated/charge_captured.rs deleted file mode 100644 index 293b522c7..000000000 --- a/src/resources/generated/charge_captured.rs +++ /dev/null @@ -1,10 +0,0 @@ -// ====================================== -// This file was automatically generated. -// ====================================== - -use serde::{Deserialize, Serialize}; - -/// The resource representing a Stripe "charge.captured". -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct ChargeCaptured { -} diff --git a/src/resources/generated/charge_dispute_closed.rs b/src/resources/generated/charge_dispute_closed.rs deleted file mode 100644 index 244851bba..000000000 --- a/src/resources/generated/charge_dispute_closed.rs +++ /dev/null @@ -1,10 +0,0 @@ -// ====================================== -// This file was automatically generated. -// ====================================== - -use serde::{Deserialize, Serialize}; - -/// The resource representing a Stripe "charge.dispute.closed". -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct ChargeDisputeClosed { -} diff --git a/src/resources/generated/charge_dispute_created.rs b/src/resources/generated/charge_dispute_created.rs deleted file mode 100644 index 97b1781c0..000000000 --- a/src/resources/generated/charge_dispute_created.rs +++ /dev/null @@ -1,10 +0,0 @@ -// ====================================== -// This file was automatically generated. -// ====================================== - -use serde::{Deserialize, Serialize}; - -/// The resource representing a Stripe "charge.dispute.created". -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct ChargeDisputeCreated { -} diff --git a/src/resources/generated/charge_dispute_funds_reinstated.rs b/src/resources/generated/charge_dispute_funds_reinstated.rs deleted file mode 100644 index 0e45d95a9..000000000 --- a/src/resources/generated/charge_dispute_funds_reinstated.rs +++ /dev/null @@ -1,10 +0,0 @@ -// ====================================== -// This file was automatically generated. -// ====================================== - -use serde::{Deserialize, Serialize}; - -/// The resource representing a Stripe "charge.dispute.funds_reinstated". -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct ChargeDisputeFundsReinstated { -} diff --git a/src/resources/generated/charge_dispute_funds_withdrawn.rs b/src/resources/generated/charge_dispute_funds_withdrawn.rs deleted file mode 100644 index c4adb5dd2..000000000 --- a/src/resources/generated/charge_dispute_funds_withdrawn.rs +++ /dev/null @@ -1,10 +0,0 @@ -// ====================================== -// This file was automatically generated. -// ====================================== - -use serde::{Deserialize, Serialize}; - -/// The resource representing a Stripe "charge.dispute.funds_withdrawn". -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct ChargeDisputeFundsWithdrawn { -} diff --git a/src/resources/generated/charge_dispute_updated.rs b/src/resources/generated/charge_dispute_updated.rs deleted file mode 100644 index 77ed8d8d4..000000000 --- a/src/resources/generated/charge_dispute_updated.rs +++ /dev/null @@ -1,10 +0,0 @@ -// ====================================== -// This file was automatically generated. -// ====================================== - -use serde::{Deserialize, Serialize}; - -/// The resource representing a Stripe "charge.dispute.updated". -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct ChargeDisputeUpdated { -} diff --git a/src/resources/generated/charge_expired.rs b/src/resources/generated/charge_expired.rs deleted file mode 100644 index 5a75680d2..000000000 --- a/src/resources/generated/charge_expired.rs +++ /dev/null @@ -1,10 +0,0 @@ -// ====================================== -// This file was automatically generated. -// ====================================== - -use serde::{Deserialize, Serialize}; - -/// The resource representing a Stripe "charge.expired". -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct ChargeExpired { -} diff --git a/src/resources/generated/charge_failed.rs b/src/resources/generated/charge_failed.rs deleted file mode 100644 index 226f43825..000000000 --- a/src/resources/generated/charge_failed.rs +++ /dev/null @@ -1,10 +0,0 @@ -// ====================================== -// This file was automatically generated. -// ====================================== - -use serde::{Deserialize, Serialize}; - -/// The resource representing a Stripe "charge.failed". -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct ChargeFailed { -} diff --git a/src/resources/generated/charge_pending.rs b/src/resources/generated/charge_pending.rs deleted file mode 100644 index d47e0b316..000000000 --- a/src/resources/generated/charge_pending.rs +++ /dev/null @@ -1,10 +0,0 @@ -// ====================================== -// This file was automatically generated. -// ====================================== - -use serde::{Deserialize, Serialize}; - -/// The resource representing a Stripe "charge.pending". -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct ChargePending { -} diff --git a/src/resources/generated/charge_refund_updated.rs b/src/resources/generated/charge_refund_updated.rs deleted file mode 100644 index 7e4f1406f..000000000 --- a/src/resources/generated/charge_refund_updated.rs +++ /dev/null @@ -1,10 +0,0 @@ -// ====================================== -// This file was automatically generated. -// ====================================== - -use serde::{Deserialize, Serialize}; - -/// The resource representing a Stripe "charge.refund.updated". -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct ChargeRefundUpdated { -} diff --git a/src/resources/generated/charge_refunded.rs b/src/resources/generated/charge_refunded.rs deleted file mode 100644 index 208ba169a..000000000 --- a/src/resources/generated/charge_refunded.rs +++ /dev/null @@ -1,10 +0,0 @@ -// ====================================== -// This file was automatically generated. -// ====================================== - -use serde::{Deserialize, Serialize}; - -/// The resource representing a Stripe "charge.refunded". -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct ChargeRefunded { -} diff --git a/src/resources/generated/charge_succeeded.rs b/src/resources/generated/charge_succeeded.rs deleted file mode 100644 index 8954fca61..000000000 --- a/src/resources/generated/charge_succeeded.rs +++ /dev/null @@ -1,10 +0,0 @@ -// ====================================== -// This file was automatically generated. -// ====================================== - -use serde::{Deserialize, Serialize}; - -/// The resource representing a Stripe "charge.succeeded". -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct ChargeSucceeded { -} diff --git a/src/resources/generated/charge_updated.rs b/src/resources/generated/charge_updated.rs deleted file mode 100644 index bda7ce76d..000000000 --- a/src/resources/generated/charge_updated.rs +++ /dev/null @@ -1,10 +0,0 @@ -// ====================================== -// This file was automatically generated. -// ====================================== - -use serde::{Deserialize, Serialize}; - -/// The resource representing a Stripe "charge.updated". -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct ChargeUpdated { -} diff --git a/src/resources/generated/checkout_session.rs b/src/resources/generated/checkout_session.rs deleted file mode 100644 index b0988c132..000000000 --- a/src/resources/generated/checkout_session.rs +++ /dev/null @@ -1,9245 +0,0 @@ -// ====================================== -// This file was automatically generated. -// ====================================== - -use serde::{Deserialize, Serialize}; - -use crate::client::{Client, Response}; -use crate::ids::{ - CheckoutSessionId, CustomerId, PaymentIntentId, PaymentLinkId, PaymentMethodConfigurationId, - SubscriptionId, -}; -use crate::params::{ - CurrencyMap, Expand, Expandable, List, Metadata, Object, Paginable, RangeQuery, Timestamp, -}; -use crate::resources::{ - Address, CheckoutSessionItem, ConnectAccountReference, Currency, Customer, Discount, Invoice, - InvoiceSettingRenderingOptions, LinkedAccountOptionsUsBankAccount, PaymentIntent, PaymentLink, - PaymentMethodConfigBizPaymentMethodConfigurationDetails, - PaymentMethodOptionsCustomerBalanceEuBankAccount, SetupIntent, Shipping, ShippingRate, - Subscription, TaxId, TaxRate, -}; - -/// The resource representing a Stripe "Session". -/// -/// For more details see -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CheckoutSession { - /// Unique identifier for the object. - pub id: CheckoutSessionId, - - /// When set, provides configuration for actions to take if this Checkout Session expires. - pub after_expiration: Option, - - /// Enables user redeemable promotion codes. - pub allow_promotion_codes: Option, - - /// Total of all items before discounts or taxes are applied. - pub amount_subtotal: Option, - - /// Total of all items after discounts and taxes are applied. - pub amount_total: Option, - - pub automatic_tax: PaymentPagesCheckoutSessionAutomaticTax, - - /// Describes whether Checkout should collect the customer's billing address. - pub billing_address_collection: Option, - - /// If set, Checkout displays a back button and customers will be directed to this URL if they decide to cancel payment and return to your website. - pub cancel_url: Option, - - /// A unique string to reference the Checkout Session. - /// - /// This can be a customer ID, a cart ID, or similar, and can be used to reconcile the Session with your internal systems. - pub client_reference_id: Option, - - /// Client secret to be used when initializing Stripe.js embedded checkout. - pub client_secret: Option, - - /// Results of `consent_collection` for this session. - pub consent: Option, - - /// When set, provides configuration for the Checkout Session to gather active consent from customers. - pub consent_collection: Option, - - /// Time at which the object was created. - /// - /// Measured in seconds since the Unix epoch. - pub created: Timestamp, - - /// Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. - /// - /// Must be a [supported currency](https://stripe.com/docs/currencies). - pub currency: Option, - - /// Currency conversion details for automatic currency conversion sessions. - pub currency_conversion: Option, - - /// Collect additional information from your customer using custom fields. - /// - /// Up to 3 fields are supported. - pub custom_fields: Vec, - - pub custom_text: PaymentPagesCheckoutSessionCustomText, - - /// The ID of the customer for this Session. - /// For Checkout Sessions in `subscription` mode or Checkout Sessions with `customer_creation` set as `always` in `payment` mode, Checkout - /// will create a new customer object based on information provided - /// during the payment flow unless an existing customer was provided when - /// the Session was created. - pub customer: Option>, - - /// Configure whether a Checkout Session creates a Customer when the Checkout Session completes. - pub customer_creation: Option, - - /// The customer details including the customer's tax exempt status and the customer's tax IDs. - /// - /// Only the customer's email is present on Sessions in `setup` mode. - pub customer_details: Option, - - /// If provided, this value will be used when the Customer object is created. - /// If not provided, customers will be asked to enter their email address. - /// Use this parameter to prefill customer data if you already have an email - /// on file. - /// - /// To access information about the customer once the payment flow is complete, use the `customer` attribute. - pub customer_email: Option, - - /// The timestamp at which the Checkout Session will expire. - pub expires_at: Timestamp, - - /// ID of the invoice created by the Checkout Session, if it exists. - pub invoice: Option>, - - /// Details on the state of invoice creation for the Checkout Session. - pub invoice_creation: Option, - - /// The line items purchased by the customer. - #[serde(skip_serializing_if = "Option::is_none")] - pub line_items: Option>, - - /// Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. - pub livemode: bool, - - /// The IETF language tag of the locale Checkout is displayed in. - /// - /// If blank or `auto`, the browser's locale is used. - pub locale: Option, - - /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. - /// - /// This can be useful for storing additional information about the object in a structured format. - pub metadata: Option, - - /// The mode of the Checkout Session. - pub mode: CheckoutSessionMode, - - /// The ID of the PaymentIntent for Checkout Sessions in `payment` mode. - pub payment_intent: Option>, - - /// The ID of the Payment Link that created this Session. - pub payment_link: Option>, - - /// Configure whether a Checkout Session should collect a payment method. - pub payment_method_collection: Option, - - /// Information about the payment method configuration used for this Checkout session if using dynamic payment methods. - pub payment_method_configuration_details: - Option, - - /// Payment-method-specific configuration for the PaymentIntent or SetupIntent of this CheckoutSession. - pub payment_method_options: Option, - - /// A list of the types of payment methods (e.g. - /// - /// card) this Checkout Session is allowed to accept. - pub payment_method_types: Vec, - - /// The payment status of the Checkout Session, one of `paid`, `unpaid`, or `no_payment_required`. - /// You can use this value to decide when to fulfill your customer's order. - pub payment_status: CheckoutSessionPaymentStatus, - - #[serde(skip_serializing_if = "Option::is_none")] - pub phone_number_collection: Option, - - /// The ID of the original expired Checkout Session that triggered the recovery flow. - pub recovered_from: Option, - - /// Applies to Checkout Sessions with `ui_mode: embedded`. - /// - /// By default, Stripe will always redirect to your return_url after a successful confirmation. - /// If you set `redirect_on_completion: 'if_required'`, then we will only redirect if your user chooses a redirect-based payment method. - #[serde(skip_serializing_if = "Option::is_none")] - pub redirect_on_completion: Option, - - /// Applies to Checkout Sessions with `ui_mode: embedded`. - /// - /// The URL to redirect your customer back to after they authenticate or cancel their payment on the payment method's app or site. - #[serde(skip_serializing_if = "Option::is_none")] - pub return_url: Option, - - /// The ID of the SetupIntent for Checkout Sessions in `setup` mode. - pub setup_intent: Option>, - - /// When set, provides configuration for Checkout to collect a shipping address from a customer. - pub shipping_address_collection: Option, - - /// The details of the customer cost of shipping, including the customer chosen ShippingRate. - pub shipping_cost: Option, - - /// Shipping information for this Checkout Session. - pub shipping_details: Option, - - /// The shipping rate options applied to this Session. - pub shipping_options: Vec, - - /// The status of the Checkout Session, one of `open`, `complete`, or `expired`. - pub status: Option, - - /// Describes the type of transaction being performed by Checkout in order to customize - /// relevant text on the page, such as the submit button. - /// - /// `submit_type` can only be specified on Checkout Sessions in `payment` mode. - /// If blank or `auto`, `pay` is used. - pub submit_type: Option, - - /// The ID of the subscription for Checkout Sessions in `subscription` mode. - pub subscription: Option>, - - /// The URL the customer will be directed to after the payment or - /// subscription creation is successful. - pub success_url: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub tax_id_collection: Option, - - /// Tax and discount details for the computed total amount. - pub total_details: Option, - - /// The UI mode of the Session. - /// - /// Can be `hosted` (default) or `embedded`. - pub ui_mode: Option, - - /// The URL to the Checkout Session. - /// - /// Redirect customers to this URL to take them to Checkout. - /// If you’re using [Custom Domains](https://stripe.com/docs/payments/checkout/custom-domains), the URL will use your subdomain. - /// Otherwise, it’ll use `checkout.stripe.com.` This value is only present when the session is active. - pub url: Option, -} - -impl CheckoutSession { - /// Returns a list of Checkout Sessions. - pub fn list( - client: &Client, - params: &ListCheckoutSessions<'_>, - ) -> Response> { - client.get_query("/checkout/sessions", ¶ms) - } - - /// Creates a Session object. - pub fn create(client: &Client, params: CreateCheckoutSession<'_>) -> Response { - client.post_form("/checkout/sessions", ¶ms) - } -} - -impl Object for CheckoutSession { - type Id = CheckoutSessionId; - fn id(&self) -> Self::Id { - self.id.clone() - } - fn object(&self) -> &'static str { - "checkout.session" - } -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CheckoutSessionPaymentMethodOptions { - #[serde(skip_serializing_if = "Option::is_none")] - pub acss_debit: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub affirm: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub afterpay_clearpay: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub alipay: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub au_becs_debit: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub bacs_debit: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub bancontact: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub boleto: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub card: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub cashapp: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub customer_balance: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub eps: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub fpx: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub giropay: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub grabpay: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub ideal: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub klarna: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub konbini: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub link: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub oxxo: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub p24: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub paynow: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub paypal: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub pix: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub revolut_pay: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub sepa_debit: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub sofort: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub swish: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub us_bank_account: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CheckoutAcssDebitPaymentMethodOptions { - /// Currency supported by the bank account. - /// - /// Returned when the Session is in `setup` mode. - #[serde(skip_serializing_if = "Option::is_none")] - pub currency: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub mandate_options: Option, - - /// Indicates that you intend to make future payments with this PaymentIntent's payment method. - /// - /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. - /// - /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). - #[serde(skip_serializing_if = "Option::is_none")] - pub setup_future_usage: Option, - - /// Bank account verification method. - #[serde(skip_serializing_if = "Option::is_none")] - pub verification_method: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CheckoutAcssDebitMandateOptions { - /// A URL for custom mandate text. - #[serde(skip_serializing_if = "Option::is_none")] - pub custom_mandate_url: Option, - - /// List of Stripe products where this mandate can be selected automatically. - /// - /// Returned when the Session is in `setup` mode. - #[serde(skip_serializing_if = "Option::is_none")] - pub default_for: Option>, - - /// Description of the interval. - /// - /// Only required if the 'payment_schedule' parameter is 'interval' or 'combined'. - pub interval_description: Option, - - /// Payment schedule for the mandate. - pub payment_schedule: Option, - - /// Transaction type of the mandate. - pub transaction_type: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CheckoutAffirmPaymentMethodOptions { - /// Indicates that you intend to make future payments with this PaymentIntent's payment method. - /// - /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. - /// - /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). - #[serde(skip_serializing_if = "Option::is_none")] - pub setup_future_usage: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CheckoutAfterpayClearpayPaymentMethodOptions { - /// Indicates that you intend to make future payments with this PaymentIntent's payment method. - /// - /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. - /// - /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). - #[serde(skip_serializing_if = "Option::is_none")] - pub setup_future_usage: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CheckoutAlipayPaymentMethodOptions { - /// Indicates that you intend to make future payments with this PaymentIntent's payment method. - /// - /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. - /// - /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). - #[serde(skip_serializing_if = "Option::is_none")] - pub setup_future_usage: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CheckoutAuBecsDebitPaymentMethodOptions { - /// Indicates that you intend to make future payments with this PaymentIntent's payment method. - /// - /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. - /// - /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). - #[serde(skip_serializing_if = "Option::is_none")] - pub setup_future_usage: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CheckoutBacsDebitPaymentMethodOptions { - /// Indicates that you intend to make future payments with this PaymentIntent's payment method. - /// - /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. - /// - /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). - #[serde(skip_serializing_if = "Option::is_none")] - pub setup_future_usage: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CheckoutBancontactPaymentMethodOptions { - /// Indicates that you intend to make future payments with this PaymentIntent's payment method. - /// - /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. - /// - /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). - #[serde(skip_serializing_if = "Option::is_none")] - pub setup_future_usage: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CheckoutBoletoPaymentMethodOptions { - /// The number of calendar days before a Boleto voucher expires. - /// - /// For example, if you create a Boleto voucher on Monday and you set expires_after_days to 2, the Boleto voucher will expire on Wednesday at 23:59 America/Sao_Paulo time. - pub expires_after_days: u32, - - /// Indicates that you intend to make future payments with this PaymentIntent's payment method. - /// - /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. - /// - /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). - #[serde(skip_serializing_if = "Option::is_none")] - pub setup_future_usage: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CheckoutCardPaymentMethodOptions { - #[serde(skip_serializing_if = "Option::is_none")] - pub installments: Option, - - /// Indicates that you intend to make future payments with this PaymentIntent's payment method. - /// - /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. - /// - /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). - #[serde(skip_serializing_if = "Option::is_none")] - pub setup_future_usage: Option, - - /// Provides information about a card payment that customers see on their statements. - /// - /// Concatenated with the Kana prefix (shortened Kana descriptor) or Kana statement descriptor that’s set on the account to form the complete statement descriptor. - /// Maximum 22 characters. - /// On card statements, the *concatenation* of both prefix and suffix (including separators) will appear truncated to 22 characters. - #[serde(skip_serializing_if = "Option::is_none")] - pub statement_descriptor_suffix_kana: Option, - - /// Provides information about a card payment that customers see on their statements. - /// - /// Concatenated with the Kanji prefix (shortened Kanji descriptor) or Kanji statement descriptor that’s set on the account to form the complete statement descriptor. - /// Maximum 17 characters. - /// On card statements, the *concatenation* of both prefix and suffix (including separators) will appear truncated to 17 characters. - #[serde(skip_serializing_if = "Option::is_none")] - pub statement_descriptor_suffix_kanji: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CheckoutCardInstallmentsOptions { - /// Indicates if installments are enabled. - #[serde(skip_serializing_if = "Option::is_none")] - pub enabled: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CheckoutCashappPaymentMethodOptions { - /// Indicates that you intend to make future payments with this PaymentIntent's payment method. - /// - /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. - /// - /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). - #[serde(skip_serializing_if = "Option::is_none")] - pub setup_future_usage: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CheckoutCustomerBalancePaymentMethodOptions { - #[serde(skip_serializing_if = "Option::is_none")] - pub bank_transfer: Option, - - /// The funding method type to be used when there are not enough funds in the customer balance. - /// - /// Permitted values include: `bank_transfer`. - pub funding_type: Option, - - /// Indicates that you intend to make future payments with this PaymentIntent's payment method. - /// - /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. - /// - /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). - #[serde(skip_serializing_if = "Option::is_none")] - pub setup_future_usage: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CheckoutCustomerBalanceBankTransferPaymentMethodOptions { - #[serde(skip_serializing_if = "Option::is_none")] - pub eu_bank_transfer: Option, - - /// List of address types that should be returned in the financial_addresses response. - /// - /// If not specified, all valid types will be returned. Permitted values include: `sort_code`, `zengin`, `iban`, or `spei`. - #[serde(skip_serializing_if = "Option::is_none")] - pub requested_address_types: - Option>, - - /// The bank transfer type that this PaymentIntent is allowed to use for funding Permitted values include: `eu_bank_transfer`, `gb_bank_transfer`, `jp_bank_transfer`, `mx_bank_transfer`, or `us_bank_transfer`. - #[serde(rename = "type")] - pub type_: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CheckoutEpsPaymentMethodOptions { - /// Indicates that you intend to make future payments with this PaymentIntent's payment method. - /// - /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. - /// - /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). - #[serde(skip_serializing_if = "Option::is_none")] - pub setup_future_usage: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CheckoutFpxPaymentMethodOptions { - /// Indicates that you intend to make future payments with this PaymentIntent's payment method. - /// - /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. - /// - /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). - #[serde(skip_serializing_if = "Option::is_none")] - pub setup_future_usage: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CheckoutGiropayPaymentMethodOptions { - /// Indicates that you intend to make future payments with this PaymentIntent's payment method. - /// - /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. - /// - /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). - #[serde(skip_serializing_if = "Option::is_none")] - pub setup_future_usage: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CheckoutGrabPayPaymentMethodOptions { - /// Indicates that you intend to make future payments with this PaymentIntent's payment method. - /// - /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. - /// - /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). - #[serde(skip_serializing_if = "Option::is_none")] - pub setup_future_usage: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CheckoutIdealPaymentMethodOptions { - /// Indicates that you intend to make future payments with this PaymentIntent's payment method. - /// - /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. - /// - /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). - #[serde(skip_serializing_if = "Option::is_none")] - pub setup_future_usage: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CheckoutKlarnaPaymentMethodOptions { - /// Indicates that you intend to make future payments with this PaymentIntent's payment method. - /// - /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. - /// - /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). - #[serde(skip_serializing_if = "Option::is_none")] - pub setup_future_usage: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CheckoutKonbiniPaymentMethodOptions { - /// The number of calendar days (between 1 and 60) after which Konbini payment instructions will expire. - /// - /// For example, if a PaymentIntent is confirmed with Konbini and `expires_after_days` set to 2 on Monday JST, the instructions will expire on Wednesday 23:59:59 JST. - pub expires_after_days: Option, - - /// Indicates that you intend to make future payments with this PaymentIntent's payment method. - /// - /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. - /// - /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). - #[serde(skip_serializing_if = "Option::is_none")] - pub setup_future_usage: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CheckoutLinkPaymentMethodOptions { - /// Indicates that you intend to make future payments with this PaymentIntent's payment method. - /// - /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. - /// - /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). - #[serde(skip_serializing_if = "Option::is_none")] - pub setup_future_usage: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CheckoutOxxoPaymentMethodOptions { - /// The number of calendar days before an OXXO invoice expires. - /// - /// For example, if you create an OXXO invoice on Monday and you set expires_after_days to 2, the OXXO invoice will expire on Wednesday at 23:59 America/Mexico_City time. - pub expires_after_days: u32, - - /// Indicates that you intend to make future payments with this PaymentIntent's payment method. - /// - /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. - /// - /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). - #[serde(skip_serializing_if = "Option::is_none")] - pub setup_future_usage: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CheckoutP24PaymentMethodOptions { - /// Indicates that you intend to make future payments with this PaymentIntent's payment method. - /// - /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. - /// - /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). - #[serde(skip_serializing_if = "Option::is_none")] - pub setup_future_usage: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CheckoutPaynowPaymentMethodOptions { - /// Indicates that you intend to make future payments with this PaymentIntent's payment method. - /// - /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. - /// - /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). - #[serde(skip_serializing_if = "Option::is_none")] - pub setup_future_usage: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CheckoutPaypalPaymentMethodOptions { - /// Controls when the funds will be captured from the customer's account. - #[serde(skip_serializing_if = "Option::is_none")] - pub capture_method: Option, - - /// Preferred locale of the PayPal checkout page that the customer is redirected to. - pub preferred_locale: Option, - - /// A reference of the PayPal transaction visible to customer which is mapped to PayPal's invoice ID. - /// - /// This must be a globally unique ID if you have configured in your PayPal settings to block multiple payments per invoice ID. - pub reference: Option, - - /// Indicates that you intend to make future payments with this PaymentIntent's payment method. - /// - /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. - /// - /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). - #[serde(skip_serializing_if = "Option::is_none")] - pub setup_future_usage: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CheckoutPixPaymentMethodOptions { - /// The number of seconds after which Pix payment will expire. - pub expires_after_seconds: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CheckoutRevolutPayPaymentMethodOptions {} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CheckoutSepaDebitPaymentMethodOptions { - /// Indicates that you intend to make future payments with this PaymentIntent's payment method. - /// - /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. - /// - /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). - #[serde(skip_serializing_if = "Option::is_none")] - pub setup_future_usage: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CheckoutSofortPaymentMethodOptions { - /// Indicates that you intend to make future payments with this PaymentIntent's payment method. - /// - /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. - /// - /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). - #[serde(skip_serializing_if = "Option::is_none")] - pub setup_future_usage: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CheckoutSwishPaymentMethodOptions { - /// The order reference that will be displayed to customers in the Swish application. - /// - /// Defaults to the `id` of the Payment Intent. - pub reference: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CheckoutUsBankAccountPaymentMethodOptions { - #[serde(skip_serializing_if = "Option::is_none")] - pub financial_connections: Option, - - /// Indicates that you intend to make future payments with this PaymentIntent's payment method. - /// - /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. - /// - /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). - #[serde(skip_serializing_if = "Option::is_none")] - pub setup_future_usage: Option, - - /// Bank account verification method. - #[serde(skip_serializing_if = "Option::is_none")] - pub verification_method: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct PaymentPagesCheckoutSessionAfterExpiration { - /// When set, configuration used to recover the Checkout Session on expiry. - pub recovery: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct PaymentPagesCheckoutSessionAfterExpirationRecovery { - /// Enables user redeemable promotion codes on the recovered Checkout Sessions. - /// - /// Defaults to `false`. - pub allow_promotion_codes: bool, - - /// If `true`, a recovery url will be generated to recover this Checkout Session if it - /// expires before a transaction is completed. - /// - /// It will be attached to the Checkout Session object upon expiration. - pub enabled: bool, - - /// The timestamp at which the recovery URL will expire. - pub expires_at: Option, - - /// URL that creates a new Checkout Session when clicked that is a copy of this expired Checkout Session. - pub url: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct PaymentPagesCheckoutSessionAutomaticTax { - /// Indicates whether automatic tax is enabled for the session. - pub enabled: bool, - - /// The account that's liable for tax. - /// - /// If set, the business address and tax registrations required to perform the tax calculation are loaded from this account. - /// The tax transaction is returned in the report of the connected account. - pub liability: Option, - - /// The status of the most recent automated tax calculation for this session. - pub status: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct PaymentPagesCheckoutSessionConsent { - /// If `opt_in`, the customer consents to receiving promotional communications - /// from the merchant about this Checkout Session. - pub promotions: Option, - - /// If `accepted`, the customer in this Checkout Session has agreed to the merchant's terms of service. - pub terms_of_service: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct PaymentPagesCheckoutSessionConsentCollection { - /// If set to `hidden`, it will hide legal text related to the reuse of a payment method. - pub payment_method_reuse_agreement: - Option, - - /// If set to `auto`, enables the collection of customer consent for promotional communications. - /// - /// The Checkout Session will determine whether to display an option to opt into promotional communication from the merchant depending on the customer's locale. - /// Only available to US merchants. - pub promotions: Option, - - /// If set to `required`, it requires customers to accept the terms of service before being able to pay. - pub terms_of_service: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct PaymentPagesCheckoutSessionCurrencyConversion { - /// Total of all items in source currency before discounts or taxes are applied. - pub amount_subtotal: i64, - - /// Total of all items in source currency after discounts and taxes are applied. - pub amount_total: i64, - - /// Exchange rate used to convert source currency amounts to customer currency amounts. - pub fx_rate: String, - - /// Creation currency of the CheckoutSession before localization. - pub source_currency: Currency, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct PaymentPagesCheckoutSessionCustomFields { - #[serde(skip_serializing_if = "Option::is_none")] - pub dropdown: Option, - - /// String of your choice that your integration can use to reconcile this field. - /// - /// Must be unique to this field, alphanumeric, and up to 200 characters. - pub key: String, - - pub label: PaymentPagesCheckoutSessionCustomFieldsLabel, - - #[serde(skip_serializing_if = "Option::is_none")] - pub numeric: Option, - - /// Whether the customer is required to complete the field before completing the Checkout Session. - /// - /// Defaults to `false`. - pub optional: bool, - - #[serde(skip_serializing_if = "Option::is_none")] - pub text: Option, - - /// The type of the field. - #[serde(rename = "type")] - pub type_: PaymentPagesCheckoutSessionCustomFieldsType, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct PaymentPagesCheckoutSessionCustomFieldsDropdown { - /// The options available for the customer to select. - /// - /// Up to 200 options allowed. - pub options: Vec, - - /// The option selected by the customer. - /// - /// This will be the `value` for the option. - pub value: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct PaymentPagesCheckoutSessionCustomFieldsLabel { - /// Custom text for the label, displayed to the customer. - /// - /// Up to 50 characters. - pub custom: Option, - - /// The type of the label. - #[serde(rename = "type")] - pub type_: PaymentPagesCheckoutSessionCustomFieldsLabelType, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct PaymentPagesCheckoutSessionCustomFieldsNumeric { - /// The maximum character length constraint for the customer's input. - pub maximum_length: Option, - - /// The minimum character length requirement for the customer's input. - pub minimum_length: Option, - - /// The value entered by the customer, containing only digits. - pub value: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct PaymentPagesCheckoutSessionCustomFieldsOption { - /// The label for the option, displayed to the customer. - /// - /// Up to 100 characters. - pub label: String, - - /// The value for this option, not displayed to the customer, used by your integration to reconcile the option selected by the customer. - /// - /// Must be unique to this option, alphanumeric, and up to 100 characters. - pub value: String, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct PaymentPagesCheckoutSessionCustomFieldsText { - /// The maximum character length constraint for the customer's input. - pub maximum_length: Option, - - /// The minimum character length requirement for the customer's input. - pub minimum_length: Option, - - /// The value entered by the customer. - pub value: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct PaymentPagesCheckoutSessionCustomText { - /// Custom text that should be displayed after the payment confirmation button. - pub after_submit: Option, - - /// Custom text that should be displayed alongside shipping address collection. - pub shipping_address: Option, - - /// Custom text that should be displayed alongside the payment confirmation button. - pub submit: Option, - - /// Custom text that should be displayed in place of the default terms of service agreement text. - pub terms_of_service_acceptance: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct PaymentPagesCheckoutSessionCustomTextPosition { - /// Text may be up to 1200 characters in length. - pub message: String, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct PaymentPagesCheckoutSessionCustomerDetails { - /// The customer's address after a completed Checkout Session. - /// - /// Note: This property is populated only for sessions on or after March 30, 2022. - pub address: Option
, - - /// The email associated with the Customer, if one exists, on the Checkout Session after a completed Checkout Session or at time of session expiry. - /// Otherwise, if the customer has consented to promotional content, this value is the most recent valid email provided by the customer on the Checkout form. - pub email: Option, - - /// The customer's name after a completed Checkout Session. - /// - /// Note: This property is populated only for sessions on or after March 30, 2022. - pub name: Option, - - /// The customer's phone number after a completed Checkout Session. - pub phone: Option, - - /// The customer’s tax exempt status after a completed Checkout Session. - pub tax_exempt: Option, - - /// The customer’s tax IDs after a completed Checkout Session. - pub tax_ids: Option>, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct PaymentPagesCheckoutSessionInvoiceCreation { - /// Indicates whether invoice creation is enabled for the Checkout Session. - pub enabled: bool, - - pub invoice_data: PaymentPagesCheckoutSessionInvoiceSettings, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct PaymentPagesCheckoutSessionInvoiceSettings { - /// The account tax IDs associated with the invoice. - pub account_tax_ids: Option>>, - - /// Custom fields displayed on the invoice. - pub custom_fields: Option>, - - /// An arbitrary string attached to the object. - /// - /// Often useful for displaying to users. - pub description: Option, - - /// Footer displayed on the invoice. - pub footer: Option, - - /// The connected account that issues the invoice. - /// - /// The invoice is presented with the branding and support information of the specified account. - pub issuer: Option, - - /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. - /// - /// This can be useful for storing additional information about the object in a structured format. - pub metadata: Option, - - /// Options for invoice PDF rendering. - pub rendering_options: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct InvoiceSettingCustomField { - /// The name of the custom field. - pub name: String, - - /// The value of the custom field. - pub value: String, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct PaymentPagesCheckoutSessionPaymentMethodReuseAgreement { - /// Determines the position and visibility of the payment method reuse agreement in the UI. - /// - /// When set to `auto`, Stripe's defaults will be used. When set to `hidden`, the payment method reuse agreement text will always be hidden in the UI. - pub position: PaymentPagesCheckoutSessionPaymentMethodReuseAgreementPosition, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct PaymentPagesCheckoutSessionPhoneNumberCollection { - /// Indicates whether phone number collection is enabled for the session. - pub enabled: bool, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct PaymentPagesCheckoutSessionShippingAddressCollection { - /// An array of two-letter ISO country codes representing which countries Checkout should provide as options for - /// shipping locations. - /// - /// Unsupported country codes: `AS, CX, CC, CU, HM, IR, KP, MH, FM, NF, MP, PW, SD, SY, UM, VI`. - pub allowed_countries: - Vec, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct PaymentPagesCheckoutSessionShippingCost { - /// Total shipping cost before any discounts or taxes are applied. - pub amount_subtotal: i64, - - /// Total tax amount applied due to shipping costs. - /// - /// If no tax was applied, defaults to 0. - pub amount_tax: i64, - - /// Total shipping cost after discounts and taxes are applied. - pub amount_total: i64, - - /// The ID of the ShippingRate for this order. - pub shipping_rate: Option>, - - /// The taxes applied to the shipping rate. - #[serde(skip_serializing_if = "Option::is_none")] - pub taxes: Option>, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct LineItemsTaxAmount { - /// Amount of tax applied for this rate. - pub amount: i64, - - pub rate: TaxRate, - - /// The reasoning behind this tax, for example, if the product is tax exempt. - /// - /// The possible values for this field may be extended as new tax rules are supported. - pub taxability_reason: Option, - - /// The amount on which tax is calculated, in cents (or local equivalent). - pub taxable_amount: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct PaymentPagesCheckoutSessionShippingOption { - /// A non-negative integer in cents representing how much to charge. - pub shipping_amount: i64, - - /// The shipping rate. - pub shipping_rate: Expandable, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct PaymentPagesCheckoutSessionTaxId { - /// The type of the tax ID, one of `ad_nrt`, `ar_cuit`, `eu_vat`, `bo_tin`, `br_cnpj`, `br_cpf`, `cn_tin`, `co_nit`, `cr_tin`, `do_rcn`, `ec_ruc`, `eu_oss_vat`, `pe_ruc`, `ro_tin`, `rs_pib`, `sv_nit`, `uy_ruc`, `ve_rif`, `vn_tin`, `gb_vat`, `nz_gst`, `au_abn`, `au_arn`, `in_gst`, `no_vat`, `za_vat`, `ch_vat`, `mx_rfc`, `sg_uen`, `ru_inn`, `ru_kpp`, `ca_bn`, `hk_br`, `es_cif`, `tw_vat`, `th_vat`, `jp_cn`, `jp_rn`, `jp_trn`, `li_uid`, `my_itn`, `us_ein`, `kr_brn`, `ca_qst`, `ca_gst_hst`, `ca_pst_bc`, `ca_pst_mb`, `ca_pst_sk`, `my_sst`, `sg_gst`, `ae_trn`, `cl_tin`, `sa_vat`, `id_npwp`, `my_frp`, `il_vat`, `ge_vat`, `ua_vat`, `is_vat`, `bg_uic`, `hu_tin`, `si_tin`, `ke_pin`, `tr_tin`, `eg_tin`, `ph_tin`, or `unknown`. - #[serde(rename = "type")] - pub type_: PaymentPagesCheckoutSessionTaxIdType, - - /// The value of the tax ID. - pub value: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct PaymentPagesCheckoutSessionTaxIdCollection { - /// Indicates whether tax ID collection is enabled for the session. - pub enabled: bool, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct PaymentPagesCheckoutSessionTotalDetails { - /// This is the sum of all the discounts. - pub amount_discount: i64, - - /// This is the sum of all the shipping amounts. - pub amount_shipping: Option, - - /// This is the sum of all the tax amounts. - pub amount_tax: i64, - - #[serde(skip_serializing_if = "Option::is_none")] - pub breakdown: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct PaymentPagesCheckoutSessionTotalDetailsResourceBreakdown { - /// The aggregated discounts. - pub discounts: Vec, - - /// The aggregated tax amounts by rate. - pub taxes: Vec, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct LineItemsDiscountAmount { - /// The amount discounted. - pub amount: i64, - - pub discount: Discount, -} - -/// The parameters for `CheckoutSession::create`. -#[derive(Clone, Debug, Serialize, Default)] -pub struct CreateCheckoutSession<'a> { - /// Configure actions after a Checkout Session has expired. - #[serde(skip_serializing_if = "Option::is_none")] - pub after_expiration: Option, - - /// Enables user redeemable promotion codes. - #[serde(skip_serializing_if = "Option::is_none")] - pub allow_promotion_codes: Option, - - /// Settings for automatic tax lookup for this session and resulting payments, invoices, and subscriptions. - #[serde(skip_serializing_if = "Option::is_none")] - pub automatic_tax: Option, - - /// Specify whether Checkout should collect the customer's billing address. - #[serde(skip_serializing_if = "Option::is_none")] - pub billing_address_collection: Option, - - /// If set, Checkout displays a back button and customers will be directed to this URL if they decide to cancel payment and return to your website. - #[serde(skip_serializing_if = "Option::is_none")] - pub cancel_url: Option<&'a str>, - - /// A unique string to reference the Checkout Session. - /// - /// This can be a customer ID, a cart ID, or similar, and can be used to reconcile the session with your internal systems. - #[serde(skip_serializing_if = "Option::is_none")] - pub client_reference_id: Option<&'a str>, - - /// Configure fields for the Checkout Session to gather active consent from customers. - #[serde(skip_serializing_if = "Option::is_none")] - pub consent_collection: Option, - - /// Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. - /// - /// Must be a [supported currency](https://stripe.com/docs/currencies). - /// Required in `setup` mode when `payment_method_types` is not set. - #[serde(skip_serializing_if = "Option::is_none")] - pub currency: Option, - - /// Collect additional information from your customer using custom fields. - /// - /// Up to 3 fields are supported. - #[serde(skip_serializing_if = "Option::is_none")] - pub custom_fields: Option>, - - /// Display additional text for your customers using custom text. - #[serde(skip_serializing_if = "Option::is_none")] - pub custom_text: Option, - - /// ID of an existing Customer, if one exists. - /// - /// In `payment` mode, the customer’s most recently saved card payment method will be used to prefill the email, name, card details, and billing address on the Checkout page. - /// In `subscription` mode, the customer’s [default payment method](https://stripe.com/docs/api/customers/update#update_customer-invoice_settings-default_payment_method) will be used if it’s a card, otherwise the most recently saved card will be used. - /// A valid billing address, billing name and billing email are required on the payment method for Checkout to prefill the customer's card details. If the Customer already has a valid [email](https://stripe.com/docs/api/customers/object#customer_object-email) set, the email will be prefilled and not editable in Checkout. If the Customer does not have a valid `email`, Checkout will set the email entered during the session on the Customer. If blank for Checkout Sessions in `subscription` mode or with `customer_creation` set as `always` in `payment` mode, Checkout will create a new Customer object based on information provided during the payment flow. You can set [`payment_intent_data.setup_future_usage`](https://stripe.com/docs/api/checkout/sessions/create#create_checkout_session-payment_intent_data-setup_future_usage) to have Checkout automatically attach the payment method to the Customer you pass in for future reuse. - #[serde(skip_serializing_if = "Option::is_none")] - pub customer: Option, - - /// Configure whether a Checkout Session creates a [Customer](https://stripe.com/docs/api/customers) during Session confirmation. - /// - /// When a Customer is not created, you can still retrieve email, address, and other customer data entered in Checkout - /// with [customer_details](https://stripe.com/docs/api/checkout/sessions/object#checkout_session_object-customer_details). - /// - /// Sessions that don't create Customers instead are grouped by [guest customers](https://stripe.com/docs/payments/checkout/guest-customers) - /// in the Dashboard. - /// - /// Promotion codes limited to first time customers will return invalid for these Sessions. Can only be set in `payment` and `setup` mode. - #[serde(skip_serializing_if = "Option::is_none")] - pub customer_creation: Option, - - /// If provided, this value will be used when the Customer object is created. - /// If not provided, customers will be asked to enter their email address. - /// Use this parameter to prefill customer data if you already have an email - /// on file. - /// - /// To access information about the customer once a session is complete, use the `customer` field. - #[serde(skip_serializing_if = "Option::is_none")] - pub customer_email: Option<&'a str>, - - /// Controls what fields on Customer can be updated by the Checkout Session. - /// - /// Can only be provided when `customer` is provided. - #[serde(skip_serializing_if = "Option::is_none")] - pub customer_update: Option, - - /// The coupon or promotion code to apply to this Session. - /// - /// Currently, only up to one may be specified. - #[serde(skip_serializing_if = "Option::is_none")] - pub discounts: Option>, - - /// Specifies which fields in the response should be expanded. - #[serde(skip_serializing_if = "Expand::is_empty")] - pub expand: &'a [&'a str], - - /// The Epoch time in seconds at which the Checkout Session will expire. - /// - /// It can be anywhere from 30 minutes to 24 hours after Checkout Session creation. - /// By default, this value is 24 hours from creation. - #[serde(skip_serializing_if = "Option::is_none")] - pub expires_at: Option, - - /// Generate a post-purchase Invoice for one-time payments. - #[serde(skip_serializing_if = "Option::is_none")] - pub invoice_creation: Option, - - /// A list of items the customer is purchasing. - /// - /// Use this parameter to pass one-time or recurring [Prices](https://stripe.com/docs/api/prices). For `payment` mode, there is a maximum of 100 line items, however it is recommended to consolidate line items if there are more than a few dozen. For `subscription` mode, there is a maximum of 20 line items with recurring Prices and 20 line items with one-time Prices. - /// Line items with one-time Prices will be on the initial invoice only. - #[serde(skip_serializing_if = "Option::is_none")] - pub line_items: Option>, - - /// The IETF language tag of the locale Checkout is displayed in. - /// - /// If blank or `auto`, the browser's locale is used. - #[serde(skip_serializing_if = "Option::is_none")] - pub locale: Option, - - /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. - /// - /// This can be useful for storing additional information about the object in a structured format. - /// Individual keys can be unset by posting an empty value to them. - /// All keys can be unset by posting an empty value to `metadata`. - #[serde(skip_serializing_if = "Option::is_none")] - pub metadata: Option, - - /// The mode of the Checkout Session. - /// - /// Pass `subscription` if the Checkout Session includes at least one recurring item. - #[serde(skip_serializing_if = "Option::is_none")] - pub mode: Option, - - /// A subset of parameters to be passed to PaymentIntent creation for Checkout Sessions in `payment` mode. - #[serde(skip_serializing_if = "Option::is_none")] - pub payment_intent_data: Option, - - /// Specify whether Checkout should collect a payment method. - /// - /// When set to `if_required`, Checkout will not collect a payment method when the total due for the session is 0. This may occur if the Checkout Session includes a free trial or a discount. Can only be set in `subscription` mode. If you'd like information on how to collect a payment method outside of Checkout, read the guide on configuring [subscriptions with a free trial](https://stripe.com/docs/payments/checkout/free-trials). - #[serde(skip_serializing_if = "Option::is_none")] - pub payment_method_collection: Option, - - /// The ID of the payment method configuration to use with this Checkout session. - #[serde(skip_serializing_if = "Option::is_none")] - pub payment_method_configuration: Option, - - /// Payment-method-specific configuration. - #[serde(skip_serializing_if = "Option::is_none")] - pub payment_method_options: Option, - - /// A list of the types of payment methods (e.g., `card`) this Checkout Session can accept. - /// - /// You can omit this attribute to manage your payment methods from the [Stripe Dashboard](https://dashboard.stripe.com/settings/payment_methods). - /// See [Dynamic Payment Methods](https://stripe.com/docs/payments/payment-methods/integration-options#using-dynamic-payment-methods) for more details. - /// - /// Read more about the supported payment methods and their requirements in our [payment - /// method details guide](/docs/payments/checkout/payment-methods). - /// - /// If multiple payment methods are passed, Checkout will dynamically reorder them to - /// prioritize the most relevant payment methods based on the customer's location and - /// other characteristics. - #[serde(skip_serializing_if = "Option::is_none")] - pub payment_method_types: Option>, - - /// Controls phone number collection settings for the session. - /// - /// We recommend that you review your privacy policy and check with your legal contacts - /// before using this feature. - /// - /// Learn more about [collecting phone numbers with Checkout](https://stripe.com/docs/payments/checkout/phone-numbers). - #[serde(skip_serializing_if = "Option::is_none")] - pub phone_number_collection: Option, - - /// This parameter applies to `ui_mode: embedded`. - /// - /// By default, Stripe will always redirect to your return_url after a successful confirmation. - /// If you set `redirect_on_completion: 'if_required'`, then we will only redirect if your user chooses a redirect-based payment method. - #[serde(skip_serializing_if = "Option::is_none")] - pub redirect_on_completion: Option, - - /// The URL to redirect your customer back to after they authenticate or cancel their payment on the - /// payment method's app or site. - /// - /// This parameter is required if ui_mode is `embedded` and redirect-based payment methods are enabled on the session. - #[serde(skip_serializing_if = "Option::is_none")] - pub return_url: Option<&'a str>, - - /// A subset of parameters to be passed to SetupIntent creation for Checkout Sessions in `setup` mode. - #[serde(skip_serializing_if = "Option::is_none")] - pub setup_intent_data: Option, - - /// When set, provides configuration for Checkout to collect a shipping address from a customer. - #[serde(skip_serializing_if = "Option::is_none")] - pub shipping_address_collection: Option, - - /// The shipping rate options to apply to this Session. - /// - /// Up to a maximum of 5. - #[serde(skip_serializing_if = "Option::is_none")] - pub shipping_options: Option>, - - /// Describes the type of transaction being performed by Checkout in order to customize - /// relevant text on the page, such as the submit button. - /// - /// `submit_type` can only be specified on Checkout Sessions in `payment` mode. - /// If blank or `auto`, `pay` is used. - #[serde(skip_serializing_if = "Option::is_none")] - pub submit_type: Option, - - /// A subset of parameters to be passed to subscription creation for Checkout Sessions in `subscription` mode. - #[serde(skip_serializing_if = "Option::is_none")] - pub subscription_data: Option, - - /// The URL to which Stripe should send customers when payment or setup - /// is complete. - /// This parameter is not allowed if ui_mode is `embedded`. - /// - /// If you’d like to use information from the successful Checkout Session on your page, read the guide on [customizing your success page](https://stripe.com/docs/payments/checkout/custom-success-page). - #[serde(skip_serializing_if = "Option::is_none")] - pub success_url: Option<&'a str>, - - /// Controls tax ID collection settings for the session. - #[serde(skip_serializing_if = "Option::is_none")] - pub tax_id_collection: Option, - - /// `ui_mode` can be `hosted` or `embedded`. - /// - /// The default is `hosted`. - #[serde(skip_serializing_if = "Option::is_none")] - pub ui_mode: Option, -} - -impl<'a> CreateCheckoutSession<'a> { - pub fn new() -> Self { - CreateCheckoutSession { - after_expiration: Default::default(), - allow_promotion_codes: Default::default(), - automatic_tax: Default::default(), - billing_address_collection: Default::default(), - cancel_url: Default::default(), - client_reference_id: Default::default(), - consent_collection: Default::default(), - currency: Default::default(), - custom_fields: Default::default(), - custom_text: Default::default(), - customer: Default::default(), - customer_creation: Default::default(), - customer_email: Default::default(), - customer_update: Default::default(), - discounts: Default::default(), - expand: Default::default(), - expires_at: Default::default(), - invoice_creation: Default::default(), - line_items: Default::default(), - locale: Default::default(), - metadata: Default::default(), - mode: Default::default(), - payment_intent_data: Default::default(), - payment_method_collection: Default::default(), - payment_method_configuration: Default::default(), - payment_method_options: Default::default(), - payment_method_types: Default::default(), - phone_number_collection: Default::default(), - redirect_on_completion: Default::default(), - return_url: Default::default(), - setup_intent_data: Default::default(), - shipping_address_collection: Default::default(), - shipping_options: Default::default(), - submit_type: Default::default(), - subscription_data: Default::default(), - success_url: Default::default(), - tax_id_collection: Default::default(), - ui_mode: Default::default(), - } - } -} - -/// The parameters for `CheckoutSession::list`. -#[derive(Clone, Debug, Serialize, Default)] -pub struct ListCheckoutSessions<'a> { - /// Only return the Checkout Sessions that were created during the given date interval. - #[serde(skip_serializing_if = "Option::is_none")] - pub created: Option>, - - /// Only return the Checkout Sessions for the Customer specified. - #[serde(skip_serializing_if = "Option::is_none")] - pub customer: Option, - - /// Only return the Checkout Sessions for the Customer details specified. - #[serde(skip_serializing_if = "Option::is_none")] - pub customer_details: Option, - - /// A cursor for use in pagination. - /// - /// `ending_before` is an object ID that defines your place in the list. - /// For instance, if you make a list request and receive 100 objects, starting with `obj_bar`, your subsequent call can include `ending_before=obj_bar` in order to fetch the previous page of the list. - #[serde(skip_serializing_if = "Option::is_none")] - pub ending_before: Option, - - /// Specifies which fields in the response should be expanded. - #[serde(skip_serializing_if = "Expand::is_empty")] - pub expand: &'a [&'a str], - - /// A limit on the number of objects to be returned. - /// - /// Limit can range between 1 and 100, and the default is 10. - #[serde(skip_serializing_if = "Option::is_none")] - pub limit: Option, - - /// Only return the Checkout Session for the PaymentIntent specified. - #[serde(skip_serializing_if = "Option::is_none")] - pub payment_intent: Option, - - /// Only return the Checkout Sessions for the Payment Link specified. - #[serde(skip_serializing_if = "Option::is_none")] - pub payment_link: Option, - - /// A cursor for use in pagination. - /// - /// `starting_after` is an object ID that defines your place in the list. - /// For instance, if you make a list request and receive 100 objects, ending with `obj_foo`, your subsequent call can include `starting_after=obj_foo` in order to fetch the next page of the list. - #[serde(skip_serializing_if = "Option::is_none")] - pub starting_after: Option, - - /// Only return the Checkout Sessions matching the given status. - #[serde(skip_serializing_if = "Option::is_none")] - pub status: Option, - - /// Only return the Checkout Session for the subscription specified. - #[serde(skip_serializing_if = "Option::is_none")] - pub subscription: Option, -} - -impl<'a> ListCheckoutSessions<'a> { - pub fn new() -> Self { - ListCheckoutSessions { - created: Default::default(), - customer: Default::default(), - customer_details: Default::default(), - ending_before: Default::default(), - expand: Default::default(), - limit: Default::default(), - payment_intent: Default::default(), - payment_link: Default::default(), - starting_after: Default::default(), - status: Default::default(), - subscription: Default::default(), - } - } -} -impl Paginable for ListCheckoutSessions<'_> { - type O = CheckoutSession; - fn set_last(&mut self, item: Self::O) { - self.starting_after = Some(item.id()); - } -} -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreateCheckoutSessionAfterExpiration { - /// Configure a Checkout Session that can be used to recover an expired session. - #[serde(skip_serializing_if = "Option::is_none")] - pub recovery: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreateCheckoutSessionAutomaticTax { - /// Set to true to enable automatic taxes. - pub enabled: bool, - - /// The account that's liable for tax. - /// - /// If set, the business address and tax registrations required to perform the tax calculation are loaded from this account. - /// The tax transaction is returned in the report of the connected account. - #[serde(skip_serializing_if = "Option::is_none")] - pub liability: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreateCheckoutSessionConsentCollection { - /// Determines the display of payment method reuse agreement text in the UI. - /// - /// If set to `hidden`, it will hide legal text related to the reuse of a payment method. - #[serde(skip_serializing_if = "Option::is_none")] - pub payment_method_reuse_agreement: - Option, - - /// If set to `auto`, enables the collection of customer consent for promotional communications. - /// - /// The Checkout Session will determine whether to display an option to opt into promotional communication from the merchant depending on the customer's locale. - /// Only available to US merchants. - #[serde(skip_serializing_if = "Option::is_none")] - pub promotions: Option, - - /// If set to `required`, it requires customers to check a terms of service checkbox before being able to pay. - /// There must be a valid terms of service URL set in your [Dashboard settings](https://dashboard.stripe.com/settings/public). - #[serde(skip_serializing_if = "Option::is_none")] - pub terms_of_service: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreateCheckoutSessionCustomFields { - /// Configuration for `type=dropdown` fields. - #[serde(skip_serializing_if = "Option::is_none")] - pub dropdown: Option, - - /// String of your choice that your integration can use to reconcile this field. - /// - /// Must be unique to this field, alphanumeric, and up to 200 characters. - pub key: String, - - /// The label for the field, displayed to the customer. - pub label: CreateCheckoutSessionCustomFieldsLabel, - - /// Configuration for `type=numeric` fields. - #[serde(skip_serializing_if = "Option::is_none")] - pub numeric: Option, - - /// Whether the customer is required to complete the field before completing the Checkout Session. - /// - /// Defaults to `false`. - #[serde(skip_serializing_if = "Option::is_none")] - pub optional: Option, - - /// Configuration for `type=text` fields. - #[serde(skip_serializing_if = "Option::is_none")] - pub text: Option, - - /// The type of the field. - #[serde(rename = "type")] - pub type_: CreateCheckoutSessionCustomFieldsType, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreateCheckoutSessionCustomText { - /// Custom text that should be displayed after the payment confirmation button. - #[serde(skip_serializing_if = "Option::is_none")] - pub after_submit: Option, - - /// Custom text that should be displayed alongside shipping address collection. - #[serde(skip_serializing_if = "Option::is_none")] - pub shipping_address: Option, - - /// Custom text that should be displayed alongside the payment confirmation button. - #[serde(skip_serializing_if = "Option::is_none")] - pub submit: Option, - - /// Custom text that should be displayed in place of the default terms of service agreement text. - #[serde(skip_serializing_if = "Option::is_none")] - pub terms_of_service_acceptance: - Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreateCheckoutSessionCustomerUpdate { - /// Describes whether Checkout saves the billing address onto `customer.address`. - /// To always collect a full billing address, use `billing_address_collection`. - /// - /// Defaults to `never`. - #[serde(skip_serializing_if = "Option::is_none")] - pub address: Option, - - /// Describes whether Checkout saves the name onto `customer.name`. - /// - /// Defaults to `never`. - #[serde(skip_serializing_if = "Option::is_none")] - pub name: Option, - - /// Describes whether Checkout saves shipping information onto `customer.shipping`. - /// To collect shipping information, use `shipping_address_collection`. - /// - /// Defaults to `never`. - #[serde(skip_serializing_if = "Option::is_none")] - pub shipping: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreateCheckoutSessionDiscounts { - /// The ID of the coupon to apply to this Session. - #[serde(skip_serializing_if = "Option::is_none")] - pub coupon: Option, - - /// The ID of a promotion code to apply to this Session. - #[serde(skip_serializing_if = "Option::is_none")] - pub promotion_code: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreateCheckoutSessionInvoiceCreation { - /// Set to `true` to enable invoice creation. - pub enabled: bool, - - /// Parameters passed when creating invoices for payment-mode Checkout Sessions. - #[serde(skip_serializing_if = "Option::is_none")] - pub invoice_data: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreateCheckoutSessionLineItems { - /// When set, provides configuration for this item’s quantity to be adjusted by the customer during Checkout. - #[serde(skip_serializing_if = "Option::is_none")] - pub adjustable_quantity: Option, - - /// The [tax rates](https://stripe.com/docs/api/tax_rates) that will be applied to this line item depending on the customer's billing/shipping address. - /// - /// We currently support the following countries: US, GB, AU, and all countries in the EU. - #[serde(skip_serializing_if = "Option::is_none")] - pub dynamic_tax_rates: Option>, - - /// The ID of the [Price](https://stripe.com/docs/api/prices) or [Plan](https://stripe.com/docs/api/plans) object. - /// - /// One of `price` or `price_data` is required. - #[serde(skip_serializing_if = "Option::is_none")] - pub price: Option, - - /// Data used to generate a new [Price](https://stripe.com/docs/api/prices) object inline. - /// - /// One of `price` or `price_data` is required. - #[serde(skip_serializing_if = "Option::is_none")] - pub price_data: Option, - - /// The quantity of the line item being purchased. - /// - /// Quantity should not be defined when `recurring.usage_type=metered`. - #[serde(skip_serializing_if = "Option::is_none")] - pub quantity: Option, - - /// The [tax rates](https://stripe.com/docs/api/tax_rates) which apply to this line item. - #[serde(skip_serializing_if = "Option::is_none")] - pub tax_rates: Option>, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreateCheckoutSessionPaymentIntentData { - /// The amount of the application fee (if any) that will be requested to be applied to the payment and transferred to the application owner's Stripe account. - /// - /// The amount of the application fee collected will be capped at the total payment amount. - /// For more information, see the PaymentIntents [use case for connected accounts](https://stripe.com/docs/payments/connected-accounts). - #[serde(skip_serializing_if = "Option::is_none")] - pub application_fee_amount: Option, - - /// Controls when the funds will be captured from the customer's account. - #[serde(skip_serializing_if = "Option::is_none")] - pub capture_method: Option, - - /// An arbitrary string attached to the object. - /// - /// Often useful for displaying to users. - #[serde(skip_serializing_if = "Option::is_none")] - pub description: Option, - - /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. - /// - /// This can be useful for storing additional information about the object in a structured format. - /// Individual keys can be unset by posting an empty value to them. - /// All keys can be unset by posting an empty value to `metadata`. - #[serde(skip_serializing_if = "Option::is_none")] - pub metadata: Option, - - /// The Stripe account ID for which these funds are intended. - /// - /// For details, see the PaymentIntents [use case for connected accounts](/docs/payments/connected-accounts). - #[serde(skip_serializing_if = "Option::is_none")] - pub on_behalf_of: Option, - - /// Email address that the receipt for the resulting payment will be sent to. - /// - /// If `receipt_email` is specified for a payment in live mode, a receipt will be sent regardless of your [email settings](https://dashboard.stripe.com/account/emails). - #[serde(skip_serializing_if = "Option::is_none")] - pub receipt_email: Option, - - /// Indicates that you intend to [make future payments](https://stripe.com/docs/payments/payment-intents#future-usage) with the payment - /// method collected by this Checkout Session. - /// - /// When setting this to `on_session`, Checkout will show a notice to the - /// customer that their payment details will be saved. - /// - /// When setting this to `off_session`, Checkout will show a notice to the - /// customer that their payment details will be saved and used for future - /// payments. - /// - /// If a Customer has been provided or Checkout creates a new Customer, - /// Checkout will attach the payment method to the Customer. - /// - /// If Checkout does not create a Customer, the payment method is not attached - /// to a Customer. - /// - /// To reuse the payment method, you can retrieve it from the Checkout Session's PaymentIntent. When processing card payments, Checkout also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as SCA. - #[serde(skip_serializing_if = "Option::is_none")] - pub setup_future_usage: Option, - - /// Shipping information for this payment. - #[serde(skip_serializing_if = "Option::is_none")] - pub shipping: Option, - - /// Extra information about the payment. - /// - /// This will appear on your customer's statement when this payment succeeds in creating a charge. - #[serde(skip_serializing_if = "Option::is_none")] - pub statement_descriptor: Option, - - /// Provides information about the charge that customers see on their statements. - /// - /// Concatenated with the prefix (shortened descriptor) or statement descriptor that’s set on the account to form the complete statement descriptor. - /// Maximum 22 characters for the concatenated descriptor. - #[serde(skip_serializing_if = "Option::is_none")] - pub statement_descriptor_suffix: Option, - - /// The parameters used to automatically create a Transfer when the payment succeeds. - /// For more information, see the PaymentIntents [use case for connected accounts](https://stripe.com/docs/payments/connected-accounts). - #[serde(skip_serializing_if = "Option::is_none")] - pub transfer_data: Option, - - /// A string that identifies the resulting payment as part of a group. - /// - /// See the PaymentIntents [use case for connected accounts](https://stripe.com/docs/connect/separate-charges-and-transfers) for details. - #[serde(skip_serializing_if = "Option::is_none")] - pub transfer_group: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreateCheckoutSessionPaymentMethodOptions { - /// contains details about the ACSS Debit payment method options. - #[serde(skip_serializing_if = "Option::is_none")] - pub acss_debit: Option, - - /// contains details about the Affirm payment method options. - #[serde(skip_serializing_if = "Option::is_none")] - pub affirm: Option, - - /// contains details about the Afterpay Clearpay payment method options. - #[serde(skip_serializing_if = "Option::is_none")] - pub afterpay_clearpay: Option, - - /// contains details about the Alipay payment method options. - #[serde(skip_serializing_if = "Option::is_none")] - pub alipay: Option, - - /// contains details about the AU Becs Debit payment method options. - #[serde(skip_serializing_if = "Option::is_none")] - pub au_becs_debit: Option, - - /// contains details about the Bacs Debit payment method options. - #[serde(skip_serializing_if = "Option::is_none")] - pub bacs_debit: Option, - - /// contains details about the Bancontact payment method options. - #[serde(skip_serializing_if = "Option::is_none")] - pub bancontact: Option, - - /// contains details about the Boleto payment method options. - #[serde(skip_serializing_if = "Option::is_none")] - pub boleto: Option, - - /// contains details about the Card payment method options. - #[serde(skip_serializing_if = "Option::is_none")] - pub card: Option, - - /// contains details about the Cashapp Pay payment method options. - #[serde(skip_serializing_if = "Option::is_none")] - pub cashapp: Option, - - /// contains details about the Customer Balance payment method options. - #[serde(skip_serializing_if = "Option::is_none")] - pub customer_balance: Option, - - /// contains details about the EPS payment method options. - #[serde(skip_serializing_if = "Option::is_none")] - pub eps: Option, - - /// contains details about the FPX payment method options. - #[serde(skip_serializing_if = "Option::is_none")] - pub fpx: Option, - - /// contains details about the Giropay payment method options. - #[serde(skip_serializing_if = "Option::is_none")] - pub giropay: Option, - - /// contains details about the Grabpay payment method options. - #[serde(skip_serializing_if = "Option::is_none")] - pub grabpay: Option, - - /// contains details about the Ideal payment method options. - #[serde(skip_serializing_if = "Option::is_none")] - pub ideal: Option, - - /// contains details about the Klarna payment method options. - #[serde(skip_serializing_if = "Option::is_none")] - pub klarna: Option, - - /// contains details about the Konbini payment method options. - #[serde(skip_serializing_if = "Option::is_none")] - pub konbini: Option, - - /// contains details about the Link payment method options. - #[serde(skip_serializing_if = "Option::is_none")] - pub link: Option, - - /// contains details about the OXXO payment method options. - #[serde(skip_serializing_if = "Option::is_none")] - pub oxxo: Option, - - /// contains details about the P24 payment method options. - #[serde(skip_serializing_if = "Option::is_none")] - pub p24: Option, - - /// contains details about the PayNow payment method options. - #[serde(skip_serializing_if = "Option::is_none")] - pub paynow: Option, - - /// contains details about the PayPal payment method options. - #[serde(skip_serializing_if = "Option::is_none")] - pub paypal: Option, - - /// contains details about the Pix payment method options. - #[serde(skip_serializing_if = "Option::is_none")] - pub pix: Option, - - /// contains details about the RevolutPay payment method options. - #[serde(skip_serializing_if = "Option::is_none")] - pub revolut_pay: Option, - - /// contains details about the Sepa Debit payment method options. - #[serde(skip_serializing_if = "Option::is_none")] - pub sepa_debit: Option, - - /// contains details about the Sofort payment method options. - #[serde(skip_serializing_if = "Option::is_none")] - pub sofort: Option, - - /// contains details about the Swish payment method options. - #[serde(skip_serializing_if = "Option::is_none")] - pub swish: Option, - - /// contains details about the Us Bank Account payment method options. - #[serde(skip_serializing_if = "Option::is_none")] - pub us_bank_account: Option, - - /// contains details about the WeChat Pay payment method options. - #[serde(skip_serializing_if = "Option::is_none")] - pub wechat_pay: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreateCheckoutSessionPhoneNumberCollection { - /// Set to `true` to enable phone number collection. - pub enabled: bool, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreateCheckoutSessionSetupIntentData { - /// An arbitrary string attached to the object. - /// - /// Often useful for displaying to users. - #[serde(skip_serializing_if = "Option::is_none")] - pub description: Option, - - /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. - /// - /// This can be useful for storing additional information about the object in a structured format. - /// Individual keys can be unset by posting an empty value to them. - /// All keys can be unset by posting an empty value to `metadata`. - #[serde(skip_serializing_if = "Option::is_none")] - pub metadata: Option, - - /// The Stripe account for which the setup is intended. - #[serde(skip_serializing_if = "Option::is_none")] - pub on_behalf_of: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreateCheckoutSessionShippingAddressCollection { - /// An array of two-letter ISO country codes representing which countries Checkout should provide as options for - /// shipping locations. - /// - /// Unsupported country codes: `AS, CX, CC, CU, HM, IR, KP, MH, FM, NF, MP, PW, SD, SY, UM, VI`. - pub allowed_countries: Vec, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreateCheckoutSessionShippingOptions { - /// The ID of the Shipping Rate to use for this shipping option. - #[serde(skip_serializing_if = "Option::is_none")] - pub shipping_rate: Option, - - /// Parameters to be passed to Shipping Rate creation for this shipping option. - #[serde(skip_serializing_if = "Option::is_none")] - pub shipping_rate_data: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreateCheckoutSessionSubscriptionData { - /// A non-negative decimal between 0 and 100, with at most two decimal places. - /// - /// This represents the percentage of the subscription invoice total that will be transferred to the application owner's Stripe account. - /// To use an application fee percent, the request must be made on behalf of another account, using the `Stripe-Account` header or an OAuth key. - /// For more information, see the application fees [documentation](https://stripe.com/docs/connect/subscriptions#collecting-fees-on-subscriptions). - #[serde(skip_serializing_if = "Option::is_none")] - pub application_fee_percent: Option, - - /// A future timestamp to anchor the subscription's billing cycle for new subscriptions. - #[serde(skip_serializing_if = "Option::is_none")] - pub billing_cycle_anchor: Option, - - /// The tax rates that will apply to any subscription item that does not have - /// `tax_rates` set. - /// - /// Invoices created will have their `default_tax_rates` populated from the subscription. - #[serde(skip_serializing_if = "Option::is_none")] - pub default_tax_rates: Option>, - - /// The subscription's description, meant to be displayable to the customer. - /// Use this field to optionally store an explanation of the subscription - /// for rendering in the [customer portal](https://stripe.com/docs/customer-management). - #[serde(skip_serializing_if = "Option::is_none")] - pub description: Option, - - /// All invoices will be billed using the specified settings. - #[serde(skip_serializing_if = "Option::is_none")] - pub invoice_settings: Option, - - /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. - /// - /// This can be useful for storing additional information about the object in a structured format. - /// Individual keys can be unset by posting an empty value to them. - /// All keys can be unset by posting an empty value to `metadata`. - #[serde(skip_serializing_if = "Option::is_none")] - pub metadata: Option, - - /// The account on behalf of which to charge, for each of the subscription's invoices. - #[serde(skip_serializing_if = "Option::is_none")] - pub on_behalf_of: Option, - - /// Determines how to handle prorations resulting from the `billing_cycle_anchor`. - /// - /// If no value is passed, the default is `create_prorations`. - #[serde(skip_serializing_if = "Option::is_none")] - pub proration_behavior: Option, - - /// If specified, the funds from the subscription's invoices will be transferred to the destination and the ID of the resulting transfers will be found on the resulting charges. - #[serde(skip_serializing_if = "Option::is_none")] - pub transfer_data: Option, - - /// Unix timestamp representing the end of the trial period the customer - /// will get before being charged for the first time. - /// - /// Has to be at least 48 hours in the future. - #[serde(skip_serializing_if = "Option::is_none")] - pub trial_end: Option, - - /// Integer representing the number of trial period days before the - /// customer is charged for the first time. - /// - /// Has to be at least 1. - #[serde(skip_serializing_if = "Option::is_none")] - pub trial_period_days: Option, - - /// Settings related to subscription trials. - #[serde(skip_serializing_if = "Option::is_none")] - pub trial_settings: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreateCheckoutSessionTaxIdCollection { - /// Set to true to enable Tax ID collection. - pub enabled: bool, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct ListCheckoutSessionsCustomerDetails { - /// Customer's email address. - pub email: String, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreateCheckoutSessionAfterExpirationRecovery { - /// Enables user redeemable promotion codes on the recovered Checkout Sessions. - /// - /// Defaults to `false`. - #[serde(skip_serializing_if = "Option::is_none")] - pub allow_promotion_codes: Option, - - /// If `true`, a recovery URL will be generated to recover this Checkout Session if it - /// expires before a successful transaction is completed. - /// - /// It will be attached to the Checkout Session object upon expiration. - pub enabled: bool, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreateCheckoutSessionAutomaticTaxLiability { - /// The connected account being referenced when `type` is `account`. - #[serde(skip_serializing_if = "Option::is_none")] - pub account: Option, - - /// Type of the account referenced in the request. - #[serde(rename = "type")] - pub type_: CreateCheckoutSessionAutomaticTaxLiabilityType, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreateCheckoutSessionConsentCollectionPaymentMethodReuseAgreement { - /// Determines the position and visibility of the payment method reuse agreement in the UI. - /// - /// When set to `auto`, Stripe's defaults will be used. - /// When set to `hidden`, the payment method reuse agreement text will always be hidden in the UI. - pub position: CreateCheckoutSessionConsentCollectionPaymentMethodReuseAgreementPosition, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreateCheckoutSessionCustomFieldsDropdown { - /// The options available for the customer to select. - /// - /// Up to 200 options allowed. - pub options: Vec, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreateCheckoutSessionCustomFieldsLabel { - /// Custom text for the label, displayed to the customer. - /// - /// Up to 50 characters. - pub custom: String, - - /// The type of the label. - #[serde(rename = "type")] - pub type_: CreateCheckoutSessionCustomFieldsLabelType, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreateCheckoutSessionCustomFieldsNumeric { - /// The maximum character length constraint for the customer's input. - #[serde(skip_serializing_if = "Option::is_none")] - pub maximum_length: Option, - - /// The minimum character length requirement for the customer's input. - #[serde(skip_serializing_if = "Option::is_none")] - pub minimum_length: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreateCheckoutSessionCustomFieldsText { - /// The maximum character length constraint for the customer's input. - #[serde(skip_serializing_if = "Option::is_none")] - pub maximum_length: Option, - - /// The minimum character length requirement for the customer's input. - #[serde(skip_serializing_if = "Option::is_none")] - pub minimum_length: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreateCheckoutSessionCustomTextAfterSubmit { - /// Text may be up to 1200 characters in length. - pub message: String, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreateCheckoutSessionCustomTextShippingAddress { - /// Text may be up to 1200 characters in length. - pub message: String, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreateCheckoutSessionCustomTextSubmit { - /// Text may be up to 1200 characters in length. - pub message: String, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreateCheckoutSessionCustomTextTermsOfServiceAcceptance { - /// Text may be up to 1200 characters in length. - pub message: String, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreateCheckoutSessionInvoiceCreationInvoiceData { - /// The account tax IDs associated with the invoice. - #[serde(skip_serializing_if = "Option::is_none")] - pub account_tax_ids: Option>, - - /// Default custom fields to be displayed on invoices for this customer. - #[serde(skip_serializing_if = "Option::is_none")] - pub custom_fields: Option>, - - /// An arbitrary string attached to the object. - /// - /// Often useful for displaying to users. - #[serde(skip_serializing_if = "Option::is_none")] - pub description: Option, - - /// Default footer to be displayed on invoices for this customer. - #[serde(skip_serializing_if = "Option::is_none")] - pub footer: Option, - - /// The connected account that issues the invoice. - /// - /// The invoice is presented with the branding and support information of the specified account. - #[serde(skip_serializing_if = "Option::is_none")] - pub issuer: Option, - - /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. - /// - /// This can be useful for storing additional information about the object in a structured format. - /// Individual keys can be unset by posting an empty value to them. - /// All keys can be unset by posting an empty value to `metadata`. - #[serde(skip_serializing_if = "Option::is_none")] - pub metadata: Option, - - /// Default options for invoice PDF rendering for this customer. - #[serde(skip_serializing_if = "Option::is_none")] - pub rendering_options: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreateCheckoutSessionLineItemsAdjustableQuantity { - /// Set to true if the quantity can be adjusted to any non-negative integer. - /// - /// By default customers will be able to remove the line item by setting the quantity to 0. - pub enabled: bool, - - /// The maximum quantity the customer can purchase for the Checkout Session. - /// - /// By default this value is 99. - /// You can specify a value up to 999999. - #[serde(skip_serializing_if = "Option::is_none")] - pub maximum: Option, - - /// The minimum quantity the customer must purchase for the Checkout Session. - /// - /// By default this value is 0. - #[serde(skip_serializing_if = "Option::is_none")] - pub minimum: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreateCheckoutSessionLineItemsPriceData { - /// Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. - /// - /// Must be a [supported currency](https://stripe.com/docs/currencies). - pub currency: Currency, - - /// The ID of the product that this price will belong to. - /// - /// One of `product` or `product_data` is required. - #[serde(skip_serializing_if = "Option::is_none")] - pub product: Option, - - /// Data used to generate a new product object inline. - /// - /// One of `product` or `product_data` is required. - #[serde(skip_serializing_if = "Option::is_none")] - pub product_data: Option, - - /// The recurring components of a price such as `interval` and `interval_count`. - #[serde(skip_serializing_if = "Option::is_none")] - pub recurring: Option, - - /// Only required if a [default tax behavior](https://stripe.com/docs/tax/products-prices-tax-categories-tax-behavior#setting-a-default-tax-behavior-(recommended)) was not provided in the Stripe Tax settings. - /// - /// Specifies whether the price is considered inclusive of taxes or exclusive of taxes. - /// One of `inclusive`, `exclusive`, or `unspecified`. - /// Once specified as either `inclusive` or `exclusive`, it cannot be changed. - #[serde(skip_serializing_if = "Option::is_none")] - pub tax_behavior: Option, - - /// A non-negative integer in cents (or local equivalent) representing how much to charge. - /// - /// One of `unit_amount` or `unit_amount_decimal` is required. - #[serde(skip_serializing_if = "Option::is_none")] - pub unit_amount: Option, - - /// Same as `unit_amount`, but accepts a decimal value in cents (or local equivalent) with at most 12 decimal places. - /// - /// Only one of `unit_amount` and `unit_amount_decimal` can be set. - #[serde(skip_serializing_if = "Option::is_none")] - pub unit_amount_decimal: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreateCheckoutSessionPaymentIntentDataShipping { - /// Shipping address. - pub address: CreateCheckoutSessionPaymentIntentDataShippingAddress, - - /// The delivery service that shipped a physical product, such as Fedex, UPS, USPS, etc. - #[serde(skip_serializing_if = "Option::is_none")] - pub carrier: Option, - - /// Recipient name. - pub name: String, - - /// Recipient phone (including extension). - #[serde(skip_serializing_if = "Option::is_none")] - pub phone: Option, - - /// The tracking number for a physical product, obtained from the delivery service. - /// - /// If multiple tracking numbers were generated for this purchase, please separate them with commas. - #[serde(skip_serializing_if = "Option::is_none")] - pub tracking_number: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreateCheckoutSessionPaymentIntentDataTransferData { - /// The amount that will be transferred automatically when a charge succeeds. - #[serde(skip_serializing_if = "Option::is_none")] - pub amount: Option, - - /// If specified, successful charges will be attributed to the destination - /// account for tax reporting, and the funds from charges will be transferred - /// to the destination account. - /// - /// The ID of the resulting transfer will be returned on the successful charge's `transfer` field. - pub destination: String, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreateCheckoutSessionPaymentMethodOptionsAcssDebit { - /// Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. - /// - /// Must be a [supported currency](https://stripe.com/docs/currencies). - /// This is only accepted for Checkout Sessions in `setup` mode. - #[serde(skip_serializing_if = "Option::is_none")] - pub currency: Option, - - /// Additional fields for Mandate creation. - #[serde(skip_serializing_if = "Option::is_none")] - pub mandate_options: Option, - - /// Indicates that you intend to make future payments with this PaymentIntent's payment method. - /// - /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. - /// - /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). - #[serde(skip_serializing_if = "Option::is_none")] - pub setup_future_usage: - Option, - - /// Verification method for the intent. - #[serde(skip_serializing_if = "Option::is_none")] - pub verification_method: - Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreateCheckoutSessionPaymentMethodOptionsAffirm { - /// Indicates that you intend to make future payments with this PaymentIntent's payment method. - /// - /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. - /// - /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). - #[serde(skip_serializing_if = "Option::is_none")] - pub setup_future_usage: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreateCheckoutSessionPaymentMethodOptionsAfterpayClearpay { - /// Indicates that you intend to make future payments with this PaymentIntent's payment method. - /// - /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. - /// - /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). - #[serde(skip_serializing_if = "Option::is_none")] - pub setup_future_usage: - Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreateCheckoutSessionPaymentMethodOptionsAlipay { - /// Indicates that you intend to make future payments with this PaymentIntent's payment method. - /// - /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. - /// - /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). - #[serde(skip_serializing_if = "Option::is_none")] - pub setup_future_usage: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreateCheckoutSessionPaymentMethodOptionsAuBecsDebit { - /// Indicates that you intend to make future payments with this PaymentIntent's payment method. - /// - /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. - /// - /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). - #[serde(skip_serializing_if = "Option::is_none")] - pub setup_future_usage: - Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreateCheckoutSessionPaymentMethodOptionsBacsDebit { - /// Indicates that you intend to make future payments with this PaymentIntent's payment method. - /// - /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. - /// - /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). - #[serde(skip_serializing_if = "Option::is_none")] - pub setup_future_usage: - Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreateCheckoutSessionPaymentMethodOptionsBancontact { - /// Indicates that you intend to make future payments with this PaymentIntent's payment method. - /// - /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. - /// - /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). - #[serde(skip_serializing_if = "Option::is_none")] - pub setup_future_usage: - Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreateCheckoutSessionPaymentMethodOptionsBoleto { - /// The number of calendar days before a Boleto voucher expires. - /// - /// For example, if you create a Boleto voucher on Monday and you set expires_after_days to 2, the Boleto invoice will expire on Wednesday at 23:59 America/Sao_Paulo time. - #[serde(skip_serializing_if = "Option::is_none")] - pub expires_after_days: Option, - - /// Indicates that you intend to make future payments with this PaymentIntent's payment method. - /// - /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. - /// - /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). - #[serde(skip_serializing_if = "Option::is_none")] - pub setup_future_usage: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreateCheckoutSessionPaymentMethodOptionsCard { - /// Installment options for card payments. - #[serde(skip_serializing_if = "Option::is_none")] - pub installments: Option, - - /// Indicates that you intend to make future payments with this PaymentIntent's payment method. - /// - /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. - /// - /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). - #[serde(skip_serializing_if = "Option::is_none")] - pub setup_future_usage: Option, - - /// Provides information about a card payment that customers see on their statements. - /// - /// Concatenated with the Kana prefix (shortened Kana descriptor) or Kana statement descriptor that’s set on the account to form the complete statement descriptor. - /// Maximum 22 characters. - /// On card statements, the *concatenation* of both prefix and suffix (including separators) will appear truncated to 22 characters. - #[serde(skip_serializing_if = "Option::is_none")] - pub statement_descriptor_suffix_kana: Option, - - /// Provides information about a card payment that customers see on their statements. - /// - /// Concatenated with the Kanji prefix (shortened Kanji descriptor) or Kanji statement descriptor that’s set on the account to form the complete statement descriptor. - /// Maximum 17 characters. - /// On card statements, the *concatenation* of both prefix and suffix (including separators) will appear truncated to 17 characters. - #[serde(skip_serializing_if = "Option::is_none")] - pub statement_descriptor_suffix_kanji: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreateCheckoutSessionPaymentMethodOptionsCashapp { - /// Indicates that you intend to make future payments with this PaymentIntent's payment method. - /// - /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. - /// - /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). - #[serde(skip_serializing_if = "Option::is_none")] - pub setup_future_usage: - Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreateCheckoutSessionPaymentMethodOptionsCustomerBalance { - /// Configuration for the bank transfer funding type, if the `funding_type` is set to `bank_transfer`. - #[serde(skip_serializing_if = "Option::is_none")] - pub bank_transfer: Option, - - /// The funding method type to be used when there are not enough funds in the customer balance. - /// - /// Permitted values include: `bank_transfer`. - #[serde(skip_serializing_if = "Option::is_none")] - pub funding_type: Option, - - /// Indicates that you intend to make future payments with this PaymentIntent's payment method. - /// - /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. - /// - /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). - #[serde(skip_serializing_if = "Option::is_none")] - pub setup_future_usage: - Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreateCheckoutSessionPaymentMethodOptionsEps { - /// Indicates that you intend to make future payments with this PaymentIntent's payment method. - /// - /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. - /// - /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). - #[serde(skip_serializing_if = "Option::is_none")] - pub setup_future_usage: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreateCheckoutSessionPaymentMethodOptionsFpx { - /// Indicates that you intend to make future payments with this PaymentIntent's payment method. - /// - /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. - /// - /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). - #[serde(skip_serializing_if = "Option::is_none")] - pub setup_future_usage: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreateCheckoutSessionPaymentMethodOptionsGiropay { - /// Indicates that you intend to make future payments with this PaymentIntent's payment method. - /// - /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. - /// - /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). - #[serde(skip_serializing_if = "Option::is_none")] - pub setup_future_usage: - Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreateCheckoutSessionPaymentMethodOptionsGrabpay { - /// Indicates that you intend to make future payments with this PaymentIntent's payment method. - /// - /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. - /// - /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). - #[serde(skip_serializing_if = "Option::is_none")] - pub setup_future_usage: - Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreateCheckoutSessionPaymentMethodOptionsIdeal { - /// Indicates that you intend to make future payments with this PaymentIntent's payment method. - /// - /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. - /// - /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). - #[serde(skip_serializing_if = "Option::is_none")] - pub setup_future_usage: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreateCheckoutSessionPaymentMethodOptionsKlarna { - /// Indicates that you intend to make future payments with this PaymentIntent's payment method. - /// - /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. - /// - /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). - #[serde(skip_serializing_if = "Option::is_none")] - pub setup_future_usage: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreateCheckoutSessionPaymentMethodOptionsKonbini { - /// The number of calendar days (between 1 and 60) after which Konbini payment instructions will expire. - /// - /// For example, if a PaymentIntent is confirmed with Konbini and `expires_after_days` set to 2 on Monday JST, the instructions will expire on Wednesday 23:59:59 JST. - /// Defaults to 3 days. - #[serde(skip_serializing_if = "Option::is_none")] - pub expires_after_days: Option, - - /// Indicates that you intend to make future payments with this PaymentIntent's payment method. - /// - /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. - /// - /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). - #[serde(skip_serializing_if = "Option::is_none")] - pub setup_future_usage: - Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreateCheckoutSessionPaymentMethodOptionsLink { - /// Indicates that you intend to make future payments with this PaymentIntent's payment method. - /// - /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. - /// - /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). - #[serde(skip_serializing_if = "Option::is_none")] - pub setup_future_usage: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreateCheckoutSessionPaymentMethodOptionsOxxo { - /// The number of calendar days before an OXXO voucher expires. - /// - /// For example, if you create an OXXO voucher on Monday and you set expires_after_days to 2, the OXXO invoice will expire on Wednesday at 23:59 America/Mexico_City time. - #[serde(skip_serializing_if = "Option::is_none")] - pub expires_after_days: Option, - - /// Indicates that you intend to make future payments with this PaymentIntent's payment method. - /// - /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. - /// - /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). - #[serde(skip_serializing_if = "Option::is_none")] - pub setup_future_usage: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreateCheckoutSessionPaymentMethodOptionsP24 { - /// Indicates that you intend to make future payments with this PaymentIntent's payment method. - /// - /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. - /// - /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). - #[serde(skip_serializing_if = "Option::is_none")] - pub setup_future_usage: Option, - - /// Confirm that the payer has accepted the P24 terms and conditions. - #[serde(skip_serializing_if = "Option::is_none")] - pub tos_shown_and_accepted: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreateCheckoutSessionPaymentMethodOptionsPaynow { - /// Indicates that you intend to make future payments with this PaymentIntent's payment method. - /// - /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. - /// - /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). - #[serde(skip_serializing_if = "Option::is_none")] - pub setup_future_usage: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreateCheckoutSessionPaymentMethodOptionsPaypal { - /// Controls when the funds will be captured from the customer's account. - #[serde(skip_serializing_if = "Option::is_none")] - pub capture_method: Option, - - /// [Preferred locale](https://stripe.com/docs/payments/paypal/supported-locales) of the PayPal checkout page that the customer is redirected to. - #[serde(skip_serializing_if = "Option::is_none")] - pub preferred_locale: Option, - - /// A reference of the PayPal transaction visible to customer which is mapped to PayPal's invoice ID. - /// - /// This must be a globally unique ID if you have configured in your PayPal settings to block multiple payments per invoice ID. - #[serde(skip_serializing_if = "Option::is_none")] - pub reference: Option, - - /// The risk correlation ID for an on-session payment using a saved PayPal payment method. - #[serde(skip_serializing_if = "Option::is_none")] - pub risk_correlation_id: Option, - - /// Indicates that you intend to make future payments with this PaymentIntent's payment method. - /// - /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. - /// - /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. - #[serde(skip_serializing_if = "Option::is_none")] - pub setup_future_usage: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreateCheckoutSessionPaymentMethodOptionsPix { - /// The number of seconds (between 10 and 1209600) after which Pix payment will expire. - /// - /// Defaults to 86400 seconds. - #[serde(skip_serializing_if = "Option::is_none")] - pub expires_after_seconds: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreateCheckoutSessionPaymentMethodOptionsRevolutPay { - /// Indicates that you intend to make future payments with this PaymentIntent's payment method. - /// - /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. - /// - /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). - #[serde(skip_serializing_if = "Option::is_none")] - pub setup_future_usage: - Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreateCheckoutSessionPaymentMethodOptionsSepaDebit { - /// Indicates that you intend to make future payments with this PaymentIntent's payment method. - /// - /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. - /// - /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). - #[serde(skip_serializing_if = "Option::is_none")] - pub setup_future_usage: - Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreateCheckoutSessionPaymentMethodOptionsSofort { - /// Indicates that you intend to make future payments with this PaymentIntent's payment method. - /// - /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. - /// - /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). - #[serde(skip_serializing_if = "Option::is_none")] - pub setup_future_usage: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreateCheckoutSessionPaymentMethodOptionsSwish { - /// The order reference that will be displayed to customers in the Swish application. - /// - /// Defaults to the `id` of the Payment Intent. - #[serde(skip_serializing_if = "Option::is_none")] - pub reference: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreateCheckoutSessionPaymentMethodOptionsUsBankAccount { - /// Additional fields for Financial Connections Session creation. - #[serde(skip_serializing_if = "Option::is_none")] - pub financial_connections: - Option, - - /// Indicates that you intend to make future payments with this PaymentIntent's payment method. - /// - /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. - /// - /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). - #[serde(skip_serializing_if = "Option::is_none")] - pub setup_future_usage: - Option, - - /// Verification method for the intent. - #[serde(skip_serializing_if = "Option::is_none")] - pub verification_method: - Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreateCheckoutSessionPaymentMethodOptionsWechatPay { - /// The app ID registered with WeChat Pay. - /// - /// Only required when client is ios or android. - #[serde(skip_serializing_if = "Option::is_none")] - pub app_id: Option, - - /// The client type that the end customer will pay from. - pub client: CreateCheckoutSessionPaymentMethodOptionsWechatPayClient, - - /// Indicates that you intend to make future payments with this PaymentIntent's payment method. - /// - /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. - /// - /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). - #[serde(skip_serializing_if = "Option::is_none")] - pub setup_future_usage: - Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreateCheckoutSessionShippingOptionsShippingRateData { - /// The estimated range for how long shipping will take, meant to be displayable to the customer. - /// - /// This will appear on CheckoutSessions. - #[serde(skip_serializing_if = "Option::is_none")] - pub delivery_estimate: - Option, - - /// The name of the shipping rate, meant to be displayable to the customer. - /// - /// This will appear on CheckoutSessions. - pub display_name: String, - - /// Describes a fixed amount to charge for shipping. - /// - /// Must be present if type is `fixed_amount`. - #[serde(skip_serializing_if = "Option::is_none")] - pub fixed_amount: Option, - - /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. - /// - /// This can be useful for storing additional information about the object in a structured format. - /// Individual keys can be unset by posting an empty value to them. - /// All keys can be unset by posting an empty value to `metadata`. - #[serde(skip_serializing_if = "Option::is_none")] - pub metadata: Option, - - /// Specifies whether the rate is considered inclusive of taxes or exclusive of taxes. - /// - /// One of `inclusive`, `exclusive`, or `unspecified`. - #[serde(skip_serializing_if = "Option::is_none")] - pub tax_behavior: Option, - - /// A [tax code](https://stripe.com/docs/tax/tax-categories) ID. - /// - /// The Shipping tax code is `txcd_92010001`. - #[serde(skip_serializing_if = "Option::is_none")] - pub tax_code: Option, - - /// The type of calculation to use on the shipping rate. - /// - /// Can only be `fixed_amount` for now. - #[serde(rename = "type")] - #[serde(skip_serializing_if = "Option::is_none")] - pub type_: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreateCheckoutSessionSubscriptionDataInvoiceSettings { - /// The connected account that issues the invoice. - /// - /// The invoice is presented with the branding and support information of the specified account. - #[serde(skip_serializing_if = "Option::is_none")] - pub issuer: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreateCheckoutSessionSubscriptionDataTransferData { - /// A non-negative decimal between 0 and 100, with at most two decimal places. - /// - /// This represents the percentage of the subscription invoice total that will be transferred to the destination account. - /// By default, the entire amount is transferred to the destination. - #[serde(skip_serializing_if = "Option::is_none")] - pub amount_percent: Option, - - /// ID of an existing, connected Stripe account. - pub destination: String, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreateCheckoutSessionSubscriptionDataTrialSettings { - /// Defines how the subscription should behave when the user's free trial ends. - pub end_behavior: CreateCheckoutSessionSubscriptionDataTrialSettingsEndBehavior, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreateCheckoutSessionCustomFieldsDropdownOptions { - /// The label for the option, displayed to the customer. - /// - /// Up to 100 characters. - pub label: String, - - /// The value for this option, not displayed to the customer, used by your integration to reconcile the option selected by the customer. - /// - /// Must be unique to this option, alphanumeric, and up to 100 characters. - pub value: String, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreateCheckoutSessionInvoiceCreationInvoiceDataCustomFields { - /// The name of the custom field. - /// - /// This may be up to 30 characters. - pub name: String, - - /// The value of the custom field. - /// - /// This may be up to 30 characters. - pub value: String, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreateCheckoutSessionInvoiceCreationInvoiceDataIssuer { - /// The connected account being referenced when `type` is `account`. - #[serde(skip_serializing_if = "Option::is_none")] - pub account: Option, - - /// Type of the account referenced in the request. - #[serde(rename = "type")] - pub type_: CreateCheckoutSessionInvoiceCreationInvoiceDataIssuerType, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreateCheckoutSessionInvoiceCreationInvoiceDataRenderingOptions { - /// How line-item prices and amounts will be displayed with respect to tax on invoice PDFs. - /// - /// One of `exclude_tax` or `include_inclusive_tax`. - /// `include_inclusive_tax` will include inclusive tax (and exclude exclusive tax) in invoice PDF amounts. - /// `exclude_tax` will exclude all tax (inclusive and exclusive alike) from invoice PDF amounts. - #[serde(skip_serializing_if = "Option::is_none")] - pub amount_tax_display: - Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreateCheckoutSessionLineItemsPriceDataProductData { - /// The product's description, meant to be displayable to the customer. - /// - /// Use this field to optionally store a long form explanation of the product being sold for your own rendering purposes. - #[serde(skip_serializing_if = "Option::is_none")] - pub description: Option, - - /// A list of up to 8 URLs of images for this product, meant to be displayable to the customer. - #[serde(skip_serializing_if = "Option::is_none")] - pub images: Option>, - - /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. - /// - /// This can be useful for storing additional information about the object in a structured format. - /// Individual keys can be unset by posting an empty value to them. - /// All keys can be unset by posting an empty value to `metadata`. - #[serde(skip_serializing_if = "Option::is_none")] - pub metadata: Option, - - /// The product's name, meant to be displayable to the customer. - pub name: String, - - /// A [tax code](https://stripe.com/docs/tax/tax-categories) ID. - #[serde(skip_serializing_if = "Option::is_none")] - pub tax_code: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreateCheckoutSessionLineItemsPriceDataRecurring { - /// Specifies billing frequency. - /// - /// Either `day`, `week`, `month` or `year`. - pub interval: CreateCheckoutSessionLineItemsPriceDataRecurringInterval, - - /// The number of intervals between subscription billings. - /// - /// For example, `interval=month` and `interval_count=3` bills every 3 months. - /// Maximum of three years interval allowed (3 years, 36 months, or 156 weeks). - #[serde(skip_serializing_if = "Option::is_none")] - pub interval_count: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreateCheckoutSessionPaymentIntentDataShippingAddress { - /// City, district, suburb, town, or village. - #[serde(skip_serializing_if = "Option::is_none")] - pub city: Option, - - /// Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). - #[serde(skip_serializing_if = "Option::is_none")] - pub country: Option, - - /// Address line 1 (e.g., street, PO Box, or company name). - pub line1: String, - - /// Address line 2 (e.g., apartment, suite, unit, or building). - #[serde(skip_serializing_if = "Option::is_none")] - pub line2: Option, - - /// ZIP or postal code. - #[serde(skip_serializing_if = "Option::is_none")] - pub postal_code: Option, - - /// State, county, province, or region. - #[serde(skip_serializing_if = "Option::is_none")] - pub state: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreateCheckoutSessionPaymentMethodOptionsAcssDebitMandateOptions { - /// A URL for custom mandate text to render during confirmation step. - /// The URL will be rendered with additional GET parameters `payment_intent` and `payment_intent_client_secret` when confirming a Payment Intent, - /// or `setup_intent` and `setup_intent_client_secret` when confirming a Setup Intent. - #[serde(skip_serializing_if = "Option::is_none")] - pub custom_mandate_url: Option, - - /// List of Stripe products where this mandate can be selected automatically. - /// - /// Only usable in `setup` mode. - #[serde(skip_serializing_if = "Option::is_none")] - pub default_for: - Option>, - - /// Description of the mandate interval. - /// - /// Only required if 'payment_schedule' parameter is 'interval' or 'combined'. - #[serde(skip_serializing_if = "Option::is_none")] - pub interval_description: Option, - - /// Payment schedule for the mandate. - #[serde(skip_serializing_if = "Option::is_none")] - pub payment_schedule: - Option, - - /// Transaction type of the mandate. - #[serde(skip_serializing_if = "Option::is_none")] - pub transaction_type: - Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreateCheckoutSessionPaymentMethodOptionsCardInstallments { - /// Setting to true enables installments for this Checkout Session. - /// Setting to false will prevent any installment plan from applying to a payment. - #[serde(skip_serializing_if = "Option::is_none")] - pub enabled: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreateCheckoutSessionPaymentMethodOptionsCustomerBalanceBankTransfer { - - /// Configuration for eu_bank_transfer funding type. - #[serde(skip_serializing_if = "Option::is_none")] - pub eu_bank_transfer: Option, - - /// List of address types that should be returned in the financial_addresses response. - /// - /// If not specified, all valid types will be returned. Permitted values include: `sort_code`, `zengin`, `iban`, or `spei`. - #[serde(skip_serializing_if = "Option::is_none")] - pub requested_address_types: Option>, - - /// The list of bank transfer types that this PaymentIntent is allowed to use for funding. - #[serde(rename = "type")] - pub type_: CreateCheckoutSessionPaymentMethodOptionsCustomerBalanceBankTransferType, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreateCheckoutSessionPaymentMethodOptionsUsBankAccountFinancialConnections { - /// The list of permissions to request. - /// - /// If this parameter is passed, the `payment_method` permission must be included. - /// Valid permissions include: `balances`, `ownership`, `payment_method`, and `transactions`. - #[serde(skip_serializing_if = "Option::is_none")] - pub permissions: Option< - Vec, - >, - - /// List of data features that you would like to retrieve upon account creation. - #[serde(skip_serializing_if = "Option::is_none")] - pub prefetch: Option< - Vec, - >, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreateCheckoutSessionShippingOptionsShippingRateDataDeliveryEstimate { - /// The upper bound of the estimated range. - /// - /// If empty, represents no upper bound i.e., infinite. - #[serde(skip_serializing_if = "Option::is_none")] - pub maximum: - Option, - - /// The lower bound of the estimated range. - /// - /// If empty, represents no lower bound. - #[serde(skip_serializing_if = "Option::is_none")] - pub minimum: - Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreateCheckoutSessionShippingOptionsShippingRateDataFixedAmount { - /// A non-negative integer in cents representing how much to charge. - pub amount: i64, - - /// Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. - /// - /// Must be a [supported currency](https://stripe.com/docs/currencies). - pub currency: Currency, - - /// Shipping rates defined in each available currency option. - /// - /// Each key must be a three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html) and a [supported currency](https://stripe.com/docs/currencies). - #[serde(skip_serializing_if = "Option::is_none")] - pub currency_options: Option< - CurrencyMap, - >, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreateCheckoutSessionSubscriptionDataInvoiceSettingsIssuer { - /// The connected account being referenced when `type` is `account`. - #[serde(skip_serializing_if = "Option::is_none")] - pub account: Option, - - /// Type of the account referenced in the request. - #[serde(rename = "type")] - pub type_: CreateCheckoutSessionSubscriptionDataInvoiceSettingsIssuerType, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreateCheckoutSessionSubscriptionDataTrialSettingsEndBehavior { - /// Indicates how the subscription should change when the trial ends if the user did not provide a payment method. - pub missing_payment_method: - CreateCheckoutSessionSubscriptionDataTrialSettingsEndBehaviorMissingPaymentMethod, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreateCheckoutSessionPaymentMethodOptionsCustomerBalanceBankTransferEuBankTransfer { - /// The desired country code of the bank account information. - /// - /// Permitted values include: `BE`, `DE`, `ES`, `FR`, `IE`, or `NL`. - pub country: String, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreateCheckoutSessionShippingOptionsShippingRateDataDeliveryEstimateMaximum { - /// A unit of time. - pub unit: CreateCheckoutSessionShippingOptionsShippingRateDataDeliveryEstimateMaximumUnit, - - /// Must be greater than 0. - pub value: i64, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreateCheckoutSessionShippingOptionsShippingRateDataDeliveryEstimateMinimum { - /// A unit of time. - pub unit: CreateCheckoutSessionShippingOptionsShippingRateDataDeliveryEstimateMinimumUnit, - - /// Must be greater than 0. - pub value: i64, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreateCheckoutSessionShippingOptionsShippingRateDataFixedAmountCurrencyOptions { - /// A non-negative integer in cents representing how much to charge. - pub amount: i64, - - /// Specifies whether the rate is considered inclusive of taxes or exclusive of taxes. - /// - /// One of `inclusive`, `exclusive`, or `unspecified`. - #[serde(skip_serializing_if = "Option::is_none")] - pub tax_behavior: Option< - CreateCheckoutSessionShippingOptionsShippingRateDataFixedAmountCurrencyOptionsTaxBehavior, - >, -} - -/// An enum representing the possible values of an `CheckoutAcssDebitMandateOptions`'s `default_for` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CheckoutAcssDebitMandateOptionsDefaultFor { - Invoice, - Subscription, -} - -impl CheckoutAcssDebitMandateOptionsDefaultFor { - pub fn as_str(self) -> &'static str { - match self { - CheckoutAcssDebitMandateOptionsDefaultFor::Invoice => "invoice", - CheckoutAcssDebitMandateOptionsDefaultFor::Subscription => "subscription", - } - } -} - -impl AsRef for CheckoutAcssDebitMandateOptionsDefaultFor { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for CheckoutAcssDebitMandateOptionsDefaultFor { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for CheckoutAcssDebitMandateOptionsDefaultFor { - fn default() -> Self { - Self::Invoice - } -} - -/// An enum representing the possible values of an `CheckoutAcssDebitMandateOptions`'s `payment_schedule` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CheckoutAcssDebitMandateOptionsPaymentSchedule { - Combined, - Interval, - Sporadic, -} - -impl CheckoutAcssDebitMandateOptionsPaymentSchedule { - pub fn as_str(self) -> &'static str { - match self { - CheckoutAcssDebitMandateOptionsPaymentSchedule::Combined => "combined", - CheckoutAcssDebitMandateOptionsPaymentSchedule::Interval => "interval", - CheckoutAcssDebitMandateOptionsPaymentSchedule::Sporadic => "sporadic", - } - } -} - -impl AsRef for CheckoutAcssDebitMandateOptionsPaymentSchedule { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for CheckoutAcssDebitMandateOptionsPaymentSchedule { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for CheckoutAcssDebitMandateOptionsPaymentSchedule { - fn default() -> Self { - Self::Combined - } -} - -/// An enum representing the possible values of an `CheckoutAcssDebitMandateOptions`'s `transaction_type` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CheckoutAcssDebitMandateOptionsTransactionType { - Business, - Personal, -} - -impl CheckoutAcssDebitMandateOptionsTransactionType { - pub fn as_str(self) -> &'static str { - match self { - CheckoutAcssDebitMandateOptionsTransactionType::Business => "business", - CheckoutAcssDebitMandateOptionsTransactionType::Personal => "personal", - } - } -} - -impl AsRef for CheckoutAcssDebitMandateOptionsTransactionType { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for CheckoutAcssDebitMandateOptionsTransactionType { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for CheckoutAcssDebitMandateOptionsTransactionType { - fn default() -> Self { - Self::Business - } -} - -/// An enum representing the possible values of an `CheckoutAcssDebitPaymentMethodOptions`'s `setup_future_usage` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CheckoutAcssDebitPaymentMethodOptionsSetupFutureUsage { - None, - OffSession, - OnSession, -} - -impl CheckoutAcssDebitPaymentMethodOptionsSetupFutureUsage { - pub fn as_str(self) -> &'static str { - match self { - CheckoutAcssDebitPaymentMethodOptionsSetupFutureUsage::None => "none", - CheckoutAcssDebitPaymentMethodOptionsSetupFutureUsage::OffSession => "off_session", - CheckoutAcssDebitPaymentMethodOptionsSetupFutureUsage::OnSession => "on_session", - } - } -} - -impl AsRef for CheckoutAcssDebitPaymentMethodOptionsSetupFutureUsage { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for CheckoutAcssDebitPaymentMethodOptionsSetupFutureUsage { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for CheckoutAcssDebitPaymentMethodOptionsSetupFutureUsage { - fn default() -> Self { - Self::None - } -} - -/// An enum representing the possible values of an `CheckoutAcssDebitPaymentMethodOptions`'s `verification_method` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CheckoutAcssDebitPaymentMethodOptionsVerificationMethod { - Automatic, - Instant, - Microdeposits, -} - -impl CheckoutAcssDebitPaymentMethodOptionsVerificationMethod { - pub fn as_str(self) -> &'static str { - match self { - CheckoutAcssDebitPaymentMethodOptionsVerificationMethod::Automatic => "automatic", - CheckoutAcssDebitPaymentMethodOptionsVerificationMethod::Instant => "instant", - CheckoutAcssDebitPaymentMethodOptionsVerificationMethod::Microdeposits => { - "microdeposits" - } - } - } -} - -impl AsRef for CheckoutAcssDebitPaymentMethodOptionsVerificationMethod { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for CheckoutAcssDebitPaymentMethodOptionsVerificationMethod { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for CheckoutAcssDebitPaymentMethodOptionsVerificationMethod { - fn default() -> Self { - Self::Automatic - } -} - -/// An enum representing the possible values of an `CheckoutAffirmPaymentMethodOptions`'s `setup_future_usage` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CheckoutAffirmPaymentMethodOptionsSetupFutureUsage { - None, -} - -impl CheckoutAffirmPaymentMethodOptionsSetupFutureUsage { - pub fn as_str(self) -> &'static str { - match self { - CheckoutAffirmPaymentMethodOptionsSetupFutureUsage::None => "none", - } - } -} - -impl AsRef for CheckoutAffirmPaymentMethodOptionsSetupFutureUsage { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for CheckoutAffirmPaymentMethodOptionsSetupFutureUsage { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for CheckoutAffirmPaymentMethodOptionsSetupFutureUsage { - fn default() -> Self { - Self::None - } -} - -/// An enum representing the possible values of an `CheckoutAfterpayClearpayPaymentMethodOptions`'s `setup_future_usage` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CheckoutAfterpayClearpayPaymentMethodOptionsSetupFutureUsage { - None, -} - -impl CheckoutAfterpayClearpayPaymentMethodOptionsSetupFutureUsage { - pub fn as_str(self) -> &'static str { - match self { - CheckoutAfterpayClearpayPaymentMethodOptionsSetupFutureUsage::None => "none", - } - } -} - -impl AsRef for CheckoutAfterpayClearpayPaymentMethodOptionsSetupFutureUsage { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for CheckoutAfterpayClearpayPaymentMethodOptionsSetupFutureUsage { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for CheckoutAfterpayClearpayPaymentMethodOptionsSetupFutureUsage { - fn default() -> Self { - Self::None - } -} - -/// An enum representing the possible values of an `CheckoutAlipayPaymentMethodOptions`'s `setup_future_usage` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CheckoutAlipayPaymentMethodOptionsSetupFutureUsage { - None, -} - -impl CheckoutAlipayPaymentMethodOptionsSetupFutureUsage { - pub fn as_str(self) -> &'static str { - match self { - CheckoutAlipayPaymentMethodOptionsSetupFutureUsage::None => "none", - } - } -} - -impl AsRef for CheckoutAlipayPaymentMethodOptionsSetupFutureUsage { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for CheckoutAlipayPaymentMethodOptionsSetupFutureUsage { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for CheckoutAlipayPaymentMethodOptionsSetupFutureUsage { - fn default() -> Self { - Self::None - } -} - -/// An enum representing the possible values of an `CheckoutAuBecsDebitPaymentMethodOptions`'s `setup_future_usage` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CheckoutAuBecsDebitPaymentMethodOptionsSetupFutureUsage { - None, -} - -impl CheckoutAuBecsDebitPaymentMethodOptionsSetupFutureUsage { - pub fn as_str(self) -> &'static str { - match self { - CheckoutAuBecsDebitPaymentMethodOptionsSetupFutureUsage::None => "none", - } - } -} - -impl AsRef for CheckoutAuBecsDebitPaymentMethodOptionsSetupFutureUsage { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for CheckoutAuBecsDebitPaymentMethodOptionsSetupFutureUsage { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for CheckoutAuBecsDebitPaymentMethodOptionsSetupFutureUsage { - fn default() -> Self { - Self::None - } -} - -/// An enum representing the possible values of an `CheckoutBacsDebitPaymentMethodOptions`'s `setup_future_usage` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CheckoutBacsDebitPaymentMethodOptionsSetupFutureUsage { - None, - OffSession, - OnSession, -} - -impl CheckoutBacsDebitPaymentMethodOptionsSetupFutureUsage { - pub fn as_str(self) -> &'static str { - match self { - CheckoutBacsDebitPaymentMethodOptionsSetupFutureUsage::None => "none", - CheckoutBacsDebitPaymentMethodOptionsSetupFutureUsage::OffSession => "off_session", - CheckoutBacsDebitPaymentMethodOptionsSetupFutureUsage::OnSession => "on_session", - } - } -} - -impl AsRef for CheckoutBacsDebitPaymentMethodOptionsSetupFutureUsage { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for CheckoutBacsDebitPaymentMethodOptionsSetupFutureUsage { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for CheckoutBacsDebitPaymentMethodOptionsSetupFutureUsage { - fn default() -> Self { - Self::None - } -} - -/// An enum representing the possible values of an `CheckoutBancontactPaymentMethodOptions`'s `setup_future_usage` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CheckoutBancontactPaymentMethodOptionsSetupFutureUsage { - None, -} - -impl CheckoutBancontactPaymentMethodOptionsSetupFutureUsage { - pub fn as_str(self) -> &'static str { - match self { - CheckoutBancontactPaymentMethodOptionsSetupFutureUsage::None => "none", - } - } -} - -impl AsRef for CheckoutBancontactPaymentMethodOptionsSetupFutureUsage { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for CheckoutBancontactPaymentMethodOptionsSetupFutureUsage { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for CheckoutBancontactPaymentMethodOptionsSetupFutureUsage { - fn default() -> Self { - Self::None - } -} - -/// An enum representing the possible values of an `CheckoutBoletoPaymentMethodOptions`'s `setup_future_usage` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CheckoutBoletoPaymentMethodOptionsSetupFutureUsage { - None, - OffSession, - OnSession, -} - -impl CheckoutBoletoPaymentMethodOptionsSetupFutureUsage { - pub fn as_str(self) -> &'static str { - match self { - CheckoutBoletoPaymentMethodOptionsSetupFutureUsage::None => "none", - CheckoutBoletoPaymentMethodOptionsSetupFutureUsage::OffSession => "off_session", - CheckoutBoletoPaymentMethodOptionsSetupFutureUsage::OnSession => "on_session", - } - } -} - -impl AsRef for CheckoutBoletoPaymentMethodOptionsSetupFutureUsage { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for CheckoutBoletoPaymentMethodOptionsSetupFutureUsage { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for CheckoutBoletoPaymentMethodOptionsSetupFutureUsage { - fn default() -> Self { - Self::None - } -} - -/// An enum representing the possible values of an `CheckoutCardPaymentMethodOptions`'s `setup_future_usage` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CheckoutCardPaymentMethodOptionsSetupFutureUsage { - None, - OffSession, - OnSession, -} - -impl CheckoutCardPaymentMethodOptionsSetupFutureUsage { - pub fn as_str(self) -> &'static str { - match self { - CheckoutCardPaymentMethodOptionsSetupFutureUsage::None => "none", - CheckoutCardPaymentMethodOptionsSetupFutureUsage::OffSession => "off_session", - CheckoutCardPaymentMethodOptionsSetupFutureUsage::OnSession => "on_session", - } - } -} - -impl AsRef for CheckoutCardPaymentMethodOptionsSetupFutureUsage { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for CheckoutCardPaymentMethodOptionsSetupFutureUsage { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for CheckoutCardPaymentMethodOptionsSetupFutureUsage { - fn default() -> Self { - Self::None - } -} - -/// An enum representing the possible values of an `CheckoutCashappPaymentMethodOptions`'s `setup_future_usage` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CheckoutCashappPaymentMethodOptionsSetupFutureUsage { - None, -} - -impl CheckoutCashappPaymentMethodOptionsSetupFutureUsage { - pub fn as_str(self) -> &'static str { - match self { - CheckoutCashappPaymentMethodOptionsSetupFutureUsage::None => "none", - } - } -} - -impl AsRef for CheckoutCashappPaymentMethodOptionsSetupFutureUsage { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for CheckoutCashappPaymentMethodOptionsSetupFutureUsage { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for CheckoutCashappPaymentMethodOptionsSetupFutureUsage { - fn default() -> Self { - Self::None - } -} - -/// An enum representing the possible values of an `CheckoutCustomerBalanceBankTransferPaymentMethodOptions`'s `requested_address_types` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CheckoutCustomerBalanceBankTransferPaymentMethodOptionsRequestedAddressTypes { - Aba, - Iban, - Sepa, - SortCode, - Spei, - Swift, - Zengin, -} - -impl CheckoutCustomerBalanceBankTransferPaymentMethodOptionsRequestedAddressTypes { - pub fn as_str(self) -> &'static str { - match self { - CheckoutCustomerBalanceBankTransferPaymentMethodOptionsRequestedAddressTypes::Aba => "aba", - CheckoutCustomerBalanceBankTransferPaymentMethodOptionsRequestedAddressTypes::Iban => "iban", - CheckoutCustomerBalanceBankTransferPaymentMethodOptionsRequestedAddressTypes::Sepa => "sepa", - CheckoutCustomerBalanceBankTransferPaymentMethodOptionsRequestedAddressTypes::SortCode => "sort_code", - CheckoutCustomerBalanceBankTransferPaymentMethodOptionsRequestedAddressTypes::Spei => "spei", - CheckoutCustomerBalanceBankTransferPaymentMethodOptionsRequestedAddressTypes::Swift => "swift", - CheckoutCustomerBalanceBankTransferPaymentMethodOptionsRequestedAddressTypes::Zengin => "zengin", - } - } -} - -impl AsRef for CheckoutCustomerBalanceBankTransferPaymentMethodOptionsRequestedAddressTypes { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display - for CheckoutCustomerBalanceBankTransferPaymentMethodOptionsRequestedAddressTypes -{ - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default - for CheckoutCustomerBalanceBankTransferPaymentMethodOptionsRequestedAddressTypes -{ - fn default() -> Self { - Self::Aba - } -} - -/// An enum representing the possible values of an `CheckoutCustomerBalanceBankTransferPaymentMethodOptions`'s `type` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CheckoutCustomerBalanceBankTransferPaymentMethodOptionsType { - EuBankTransfer, - GbBankTransfer, - JpBankTransfer, - MxBankTransfer, - UsBankTransfer, -} - -impl CheckoutCustomerBalanceBankTransferPaymentMethodOptionsType { - pub fn as_str(self) -> &'static str { - match self { - CheckoutCustomerBalanceBankTransferPaymentMethodOptionsType::EuBankTransfer => { - "eu_bank_transfer" - } - CheckoutCustomerBalanceBankTransferPaymentMethodOptionsType::GbBankTransfer => { - "gb_bank_transfer" - } - CheckoutCustomerBalanceBankTransferPaymentMethodOptionsType::JpBankTransfer => { - "jp_bank_transfer" - } - CheckoutCustomerBalanceBankTransferPaymentMethodOptionsType::MxBankTransfer => { - "mx_bank_transfer" - } - CheckoutCustomerBalanceBankTransferPaymentMethodOptionsType::UsBankTransfer => { - "us_bank_transfer" - } - } - } -} - -impl AsRef for CheckoutCustomerBalanceBankTransferPaymentMethodOptionsType { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for CheckoutCustomerBalanceBankTransferPaymentMethodOptionsType { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for CheckoutCustomerBalanceBankTransferPaymentMethodOptionsType { - fn default() -> Self { - Self::EuBankTransfer - } -} - -/// An enum representing the possible values of an `CheckoutCustomerBalancePaymentMethodOptions`'s `funding_type` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CheckoutCustomerBalancePaymentMethodOptionsFundingType { - BankTransfer, -} - -impl CheckoutCustomerBalancePaymentMethodOptionsFundingType { - pub fn as_str(self) -> &'static str { - match self { - CheckoutCustomerBalancePaymentMethodOptionsFundingType::BankTransfer => "bank_transfer", - } - } -} - -impl AsRef for CheckoutCustomerBalancePaymentMethodOptionsFundingType { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for CheckoutCustomerBalancePaymentMethodOptionsFundingType { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for CheckoutCustomerBalancePaymentMethodOptionsFundingType { - fn default() -> Self { - Self::BankTransfer - } -} - -/// An enum representing the possible values of an `CheckoutCustomerBalancePaymentMethodOptions`'s `setup_future_usage` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CheckoutCustomerBalancePaymentMethodOptionsSetupFutureUsage { - None, -} - -impl CheckoutCustomerBalancePaymentMethodOptionsSetupFutureUsage { - pub fn as_str(self) -> &'static str { - match self { - CheckoutCustomerBalancePaymentMethodOptionsSetupFutureUsage::None => "none", - } - } -} - -impl AsRef for CheckoutCustomerBalancePaymentMethodOptionsSetupFutureUsage { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for CheckoutCustomerBalancePaymentMethodOptionsSetupFutureUsage { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for CheckoutCustomerBalancePaymentMethodOptionsSetupFutureUsage { - fn default() -> Self { - Self::None - } -} - -/// An enum representing the possible values of an `CheckoutEpsPaymentMethodOptions`'s `setup_future_usage` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CheckoutEpsPaymentMethodOptionsSetupFutureUsage { - None, -} - -impl CheckoutEpsPaymentMethodOptionsSetupFutureUsage { - pub fn as_str(self) -> &'static str { - match self { - CheckoutEpsPaymentMethodOptionsSetupFutureUsage::None => "none", - } - } -} - -impl AsRef for CheckoutEpsPaymentMethodOptionsSetupFutureUsage { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for CheckoutEpsPaymentMethodOptionsSetupFutureUsage { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for CheckoutEpsPaymentMethodOptionsSetupFutureUsage { - fn default() -> Self { - Self::None - } -} - -/// An enum representing the possible values of an `CheckoutFpxPaymentMethodOptions`'s `setup_future_usage` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CheckoutFpxPaymentMethodOptionsSetupFutureUsage { - None, -} - -impl CheckoutFpxPaymentMethodOptionsSetupFutureUsage { - pub fn as_str(self) -> &'static str { - match self { - CheckoutFpxPaymentMethodOptionsSetupFutureUsage::None => "none", - } - } -} - -impl AsRef for CheckoutFpxPaymentMethodOptionsSetupFutureUsage { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for CheckoutFpxPaymentMethodOptionsSetupFutureUsage { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for CheckoutFpxPaymentMethodOptionsSetupFutureUsage { - fn default() -> Self { - Self::None - } -} - -/// An enum representing the possible values of an `CheckoutGiropayPaymentMethodOptions`'s `setup_future_usage` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CheckoutGiropayPaymentMethodOptionsSetupFutureUsage { - None, -} - -impl CheckoutGiropayPaymentMethodOptionsSetupFutureUsage { - pub fn as_str(self) -> &'static str { - match self { - CheckoutGiropayPaymentMethodOptionsSetupFutureUsage::None => "none", - } - } -} - -impl AsRef for CheckoutGiropayPaymentMethodOptionsSetupFutureUsage { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for CheckoutGiropayPaymentMethodOptionsSetupFutureUsage { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for CheckoutGiropayPaymentMethodOptionsSetupFutureUsage { - fn default() -> Self { - Self::None - } -} - -/// An enum representing the possible values of an `CheckoutGrabPayPaymentMethodOptions`'s `setup_future_usage` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CheckoutGrabPayPaymentMethodOptionsSetupFutureUsage { - None, -} - -impl CheckoutGrabPayPaymentMethodOptionsSetupFutureUsage { - pub fn as_str(self) -> &'static str { - match self { - CheckoutGrabPayPaymentMethodOptionsSetupFutureUsage::None => "none", - } - } -} - -impl AsRef for CheckoutGrabPayPaymentMethodOptionsSetupFutureUsage { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for CheckoutGrabPayPaymentMethodOptionsSetupFutureUsage { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for CheckoutGrabPayPaymentMethodOptionsSetupFutureUsage { - fn default() -> Self { - Self::None - } -} - -/// An enum representing the possible values of an `CheckoutIdealPaymentMethodOptions`'s `setup_future_usage` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CheckoutIdealPaymentMethodOptionsSetupFutureUsage { - None, -} - -impl CheckoutIdealPaymentMethodOptionsSetupFutureUsage { - pub fn as_str(self) -> &'static str { - match self { - CheckoutIdealPaymentMethodOptionsSetupFutureUsage::None => "none", - } - } -} - -impl AsRef for CheckoutIdealPaymentMethodOptionsSetupFutureUsage { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for CheckoutIdealPaymentMethodOptionsSetupFutureUsage { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for CheckoutIdealPaymentMethodOptionsSetupFutureUsage { - fn default() -> Self { - Self::None - } -} - -/// An enum representing the possible values of an `CheckoutKlarnaPaymentMethodOptions`'s `setup_future_usage` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CheckoutKlarnaPaymentMethodOptionsSetupFutureUsage { - None, - OffSession, - OnSession, -} - -impl CheckoutKlarnaPaymentMethodOptionsSetupFutureUsage { - pub fn as_str(self) -> &'static str { - match self { - CheckoutKlarnaPaymentMethodOptionsSetupFutureUsage::None => "none", - CheckoutKlarnaPaymentMethodOptionsSetupFutureUsage::OffSession => "off_session", - CheckoutKlarnaPaymentMethodOptionsSetupFutureUsage::OnSession => "on_session", - } - } -} - -impl AsRef for CheckoutKlarnaPaymentMethodOptionsSetupFutureUsage { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for CheckoutKlarnaPaymentMethodOptionsSetupFutureUsage { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for CheckoutKlarnaPaymentMethodOptionsSetupFutureUsage { - fn default() -> Self { - Self::None - } -} - -/// An enum representing the possible values of an `CheckoutKonbiniPaymentMethodOptions`'s `setup_future_usage` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CheckoutKonbiniPaymentMethodOptionsSetupFutureUsage { - None, -} - -impl CheckoutKonbiniPaymentMethodOptionsSetupFutureUsage { - pub fn as_str(self) -> &'static str { - match self { - CheckoutKonbiniPaymentMethodOptionsSetupFutureUsage::None => "none", - } - } -} - -impl AsRef for CheckoutKonbiniPaymentMethodOptionsSetupFutureUsage { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for CheckoutKonbiniPaymentMethodOptionsSetupFutureUsage { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for CheckoutKonbiniPaymentMethodOptionsSetupFutureUsage { - fn default() -> Self { - Self::None - } -} - -/// An enum representing the possible values of an `CheckoutLinkPaymentMethodOptions`'s `setup_future_usage` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CheckoutLinkPaymentMethodOptionsSetupFutureUsage { - None, - OffSession, -} - -impl CheckoutLinkPaymentMethodOptionsSetupFutureUsage { - pub fn as_str(self) -> &'static str { - match self { - CheckoutLinkPaymentMethodOptionsSetupFutureUsage::None => "none", - CheckoutLinkPaymentMethodOptionsSetupFutureUsage::OffSession => "off_session", - } - } -} - -impl AsRef for CheckoutLinkPaymentMethodOptionsSetupFutureUsage { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for CheckoutLinkPaymentMethodOptionsSetupFutureUsage { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for CheckoutLinkPaymentMethodOptionsSetupFutureUsage { - fn default() -> Self { - Self::None - } -} - -/// An enum representing the possible values of an `CheckoutOxxoPaymentMethodOptions`'s `setup_future_usage` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CheckoutOxxoPaymentMethodOptionsSetupFutureUsage { - None, -} - -impl CheckoutOxxoPaymentMethodOptionsSetupFutureUsage { - pub fn as_str(self) -> &'static str { - match self { - CheckoutOxxoPaymentMethodOptionsSetupFutureUsage::None => "none", - } - } -} - -impl AsRef for CheckoutOxxoPaymentMethodOptionsSetupFutureUsage { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for CheckoutOxxoPaymentMethodOptionsSetupFutureUsage { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for CheckoutOxxoPaymentMethodOptionsSetupFutureUsage { - fn default() -> Self { - Self::None - } -} - -/// An enum representing the possible values of an `CheckoutP24PaymentMethodOptions`'s `setup_future_usage` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CheckoutP24PaymentMethodOptionsSetupFutureUsage { - None, -} - -impl CheckoutP24PaymentMethodOptionsSetupFutureUsage { - pub fn as_str(self) -> &'static str { - match self { - CheckoutP24PaymentMethodOptionsSetupFutureUsage::None => "none", - } - } -} - -impl AsRef for CheckoutP24PaymentMethodOptionsSetupFutureUsage { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for CheckoutP24PaymentMethodOptionsSetupFutureUsage { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for CheckoutP24PaymentMethodOptionsSetupFutureUsage { - fn default() -> Self { - Self::None - } -} - -/// An enum representing the possible values of an `CheckoutPaynowPaymentMethodOptions`'s `setup_future_usage` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CheckoutPaynowPaymentMethodOptionsSetupFutureUsage { - None, -} - -impl CheckoutPaynowPaymentMethodOptionsSetupFutureUsage { - pub fn as_str(self) -> &'static str { - match self { - CheckoutPaynowPaymentMethodOptionsSetupFutureUsage::None => "none", - } - } -} - -impl AsRef for CheckoutPaynowPaymentMethodOptionsSetupFutureUsage { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for CheckoutPaynowPaymentMethodOptionsSetupFutureUsage { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for CheckoutPaynowPaymentMethodOptionsSetupFutureUsage { - fn default() -> Self { - Self::None - } -} - -/// An enum representing the possible values of an `CheckoutPaypalPaymentMethodOptions`'s `capture_method` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CheckoutPaypalPaymentMethodOptionsCaptureMethod { - Manual, -} - -impl CheckoutPaypalPaymentMethodOptionsCaptureMethod { - pub fn as_str(self) -> &'static str { - match self { - CheckoutPaypalPaymentMethodOptionsCaptureMethod::Manual => "manual", - } - } -} - -impl AsRef for CheckoutPaypalPaymentMethodOptionsCaptureMethod { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for CheckoutPaypalPaymentMethodOptionsCaptureMethod { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for CheckoutPaypalPaymentMethodOptionsCaptureMethod { - fn default() -> Self { - Self::Manual - } -} - -/// An enum representing the possible values of an `CheckoutPaypalPaymentMethodOptions`'s `setup_future_usage` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CheckoutPaypalPaymentMethodOptionsSetupFutureUsage { - None, - OffSession, -} - -impl CheckoutPaypalPaymentMethodOptionsSetupFutureUsage { - pub fn as_str(self) -> &'static str { - match self { - CheckoutPaypalPaymentMethodOptionsSetupFutureUsage::None => "none", - CheckoutPaypalPaymentMethodOptionsSetupFutureUsage::OffSession => "off_session", - } - } -} - -impl AsRef for CheckoutPaypalPaymentMethodOptionsSetupFutureUsage { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for CheckoutPaypalPaymentMethodOptionsSetupFutureUsage { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for CheckoutPaypalPaymentMethodOptionsSetupFutureUsage { - fn default() -> Self { - Self::None - } -} - -/// An enum representing the possible values of an `CheckoutSepaDebitPaymentMethodOptions`'s `setup_future_usage` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CheckoutSepaDebitPaymentMethodOptionsSetupFutureUsage { - None, - OffSession, - OnSession, -} - -impl CheckoutSepaDebitPaymentMethodOptionsSetupFutureUsage { - pub fn as_str(self) -> &'static str { - match self { - CheckoutSepaDebitPaymentMethodOptionsSetupFutureUsage::None => "none", - CheckoutSepaDebitPaymentMethodOptionsSetupFutureUsage::OffSession => "off_session", - CheckoutSepaDebitPaymentMethodOptionsSetupFutureUsage::OnSession => "on_session", - } - } -} - -impl AsRef for CheckoutSepaDebitPaymentMethodOptionsSetupFutureUsage { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for CheckoutSepaDebitPaymentMethodOptionsSetupFutureUsage { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for CheckoutSepaDebitPaymentMethodOptionsSetupFutureUsage { - fn default() -> Self { - Self::None - } -} - -/// An enum representing the possible values of an `CheckoutSession`'s `billing_address_collection` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CheckoutSessionBillingAddressCollection { - Auto, - Required, -} - -impl CheckoutSessionBillingAddressCollection { - pub fn as_str(self) -> &'static str { - match self { - CheckoutSessionBillingAddressCollection::Auto => "auto", - CheckoutSessionBillingAddressCollection::Required => "required", - } - } -} - -impl AsRef for CheckoutSessionBillingAddressCollection { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for CheckoutSessionBillingAddressCollection { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for CheckoutSessionBillingAddressCollection { - fn default() -> Self { - Self::Auto - } -} - -/// An enum representing the possible values of an `CheckoutSession`'s `customer_creation` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CheckoutSessionCustomerCreation { - Always, - IfRequired, -} - -impl CheckoutSessionCustomerCreation { - pub fn as_str(self) -> &'static str { - match self { - CheckoutSessionCustomerCreation::Always => "always", - CheckoutSessionCustomerCreation::IfRequired => "if_required", - } - } -} - -impl AsRef for CheckoutSessionCustomerCreation { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for CheckoutSessionCustomerCreation { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for CheckoutSessionCustomerCreation { - fn default() -> Self { - Self::Always - } -} - -/// An enum representing the possible values of an `CheckoutSession`'s `locale` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CheckoutSessionLocale { - Auto, - Bg, - Cs, - Da, - De, - El, - En, - #[serde(rename = "en-GB")] - EnGb, - Es, - #[serde(rename = "es-419")] - Es419, - Et, - Fi, - Fil, - Fr, - #[serde(rename = "fr-CA")] - FrCa, - Hr, - Hu, - Id, - It, - Ja, - Ko, - Lt, - Lv, - Ms, - Mt, - Nb, - Nl, - Pl, - Pt, - #[serde(rename = "pt-BR")] - PtBr, - Ro, - Ru, - Sk, - Sl, - Sv, - Th, - Tr, - Vi, - Zh, - #[serde(rename = "zh-HK")] - ZhHk, - #[serde(rename = "zh-TW")] - ZhTw, -} - -impl CheckoutSessionLocale { - pub fn as_str(self) -> &'static str { - match self { - CheckoutSessionLocale::Auto => "auto", - CheckoutSessionLocale::Bg => "bg", - CheckoutSessionLocale::Cs => "cs", - CheckoutSessionLocale::Da => "da", - CheckoutSessionLocale::De => "de", - CheckoutSessionLocale::El => "el", - CheckoutSessionLocale::En => "en", - CheckoutSessionLocale::EnGb => "en-GB", - CheckoutSessionLocale::Es => "es", - CheckoutSessionLocale::Es419 => "es-419", - CheckoutSessionLocale::Et => "et", - CheckoutSessionLocale::Fi => "fi", - CheckoutSessionLocale::Fil => "fil", - CheckoutSessionLocale::Fr => "fr", - CheckoutSessionLocale::FrCa => "fr-CA", - CheckoutSessionLocale::Hr => "hr", - CheckoutSessionLocale::Hu => "hu", - CheckoutSessionLocale::Id => "id", - CheckoutSessionLocale::It => "it", - CheckoutSessionLocale::Ja => "ja", - CheckoutSessionLocale::Ko => "ko", - CheckoutSessionLocale::Lt => "lt", - CheckoutSessionLocale::Lv => "lv", - CheckoutSessionLocale::Ms => "ms", - CheckoutSessionLocale::Mt => "mt", - CheckoutSessionLocale::Nb => "nb", - CheckoutSessionLocale::Nl => "nl", - CheckoutSessionLocale::Pl => "pl", - CheckoutSessionLocale::Pt => "pt", - CheckoutSessionLocale::PtBr => "pt-BR", - CheckoutSessionLocale::Ro => "ro", - CheckoutSessionLocale::Ru => "ru", - CheckoutSessionLocale::Sk => "sk", - CheckoutSessionLocale::Sl => "sl", - CheckoutSessionLocale::Sv => "sv", - CheckoutSessionLocale::Th => "th", - CheckoutSessionLocale::Tr => "tr", - CheckoutSessionLocale::Vi => "vi", - CheckoutSessionLocale::Zh => "zh", - CheckoutSessionLocale::ZhHk => "zh-HK", - CheckoutSessionLocale::ZhTw => "zh-TW", - } - } -} - -impl AsRef for CheckoutSessionLocale { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for CheckoutSessionLocale { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for CheckoutSessionLocale { - fn default() -> Self { - Self::Auto - } -} - -/// An enum representing the possible values of an `CheckoutSession`'s `mode` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CheckoutSessionMode { - Payment, - Setup, - Subscription, -} - -impl CheckoutSessionMode { - pub fn as_str(self) -> &'static str { - match self { - CheckoutSessionMode::Payment => "payment", - CheckoutSessionMode::Setup => "setup", - CheckoutSessionMode::Subscription => "subscription", - } - } -} - -impl AsRef for CheckoutSessionMode { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for CheckoutSessionMode { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for CheckoutSessionMode { - fn default() -> Self { - Self::Payment - } -} - -/// An enum representing the possible values of an `CheckoutSession`'s `payment_method_collection` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CheckoutSessionPaymentMethodCollection { - Always, - IfRequired, -} - -impl CheckoutSessionPaymentMethodCollection { - pub fn as_str(self) -> &'static str { - match self { - CheckoutSessionPaymentMethodCollection::Always => "always", - CheckoutSessionPaymentMethodCollection::IfRequired => "if_required", - } - } -} - -impl AsRef for CheckoutSessionPaymentMethodCollection { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for CheckoutSessionPaymentMethodCollection { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for CheckoutSessionPaymentMethodCollection { - fn default() -> Self { - Self::Always - } -} - -/// An enum representing the possible values of an `CheckoutSession`'s `payment_status` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CheckoutSessionPaymentStatus { - NoPaymentRequired, - Paid, - Unpaid, -} - -impl CheckoutSessionPaymentStatus { - pub fn as_str(self) -> &'static str { - match self { - CheckoutSessionPaymentStatus::NoPaymentRequired => "no_payment_required", - CheckoutSessionPaymentStatus::Paid => "paid", - CheckoutSessionPaymentStatus::Unpaid => "unpaid", - } - } -} - -impl AsRef for CheckoutSessionPaymentStatus { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for CheckoutSessionPaymentStatus { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for CheckoutSessionPaymentStatus { - fn default() -> Self { - Self::NoPaymentRequired - } -} - -/// An enum representing the possible values of an `CheckoutSession`'s `redirect_on_completion` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CheckoutSessionRedirectOnCompletion { - Always, - IfRequired, - Never, -} - -impl CheckoutSessionRedirectOnCompletion { - pub fn as_str(self) -> &'static str { - match self { - CheckoutSessionRedirectOnCompletion::Always => "always", - CheckoutSessionRedirectOnCompletion::IfRequired => "if_required", - CheckoutSessionRedirectOnCompletion::Never => "never", - } - } -} - -impl AsRef for CheckoutSessionRedirectOnCompletion { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for CheckoutSessionRedirectOnCompletion { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for CheckoutSessionRedirectOnCompletion { - fn default() -> Self { - Self::Always - } -} - -/// An enum representing the possible values of an `CheckoutSession`'s `status` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CheckoutSessionStatus { - Complete, - Expired, - Open, -} - -impl CheckoutSessionStatus { - pub fn as_str(self) -> &'static str { - match self { - CheckoutSessionStatus::Complete => "complete", - CheckoutSessionStatus::Expired => "expired", - CheckoutSessionStatus::Open => "open", - } - } -} - -impl AsRef for CheckoutSessionStatus { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for CheckoutSessionStatus { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for CheckoutSessionStatus { - fn default() -> Self { - Self::Complete - } -} - -/// An enum representing the possible values of an `CheckoutSession`'s `submit_type` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CheckoutSessionSubmitType { - Auto, - Book, - Donate, - Pay, -} - -impl CheckoutSessionSubmitType { - pub fn as_str(self) -> &'static str { - match self { - CheckoutSessionSubmitType::Auto => "auto", - CheckoutSessionSubmitType::Book => "book", - CheckoutSessionSubmitType::Donate => "donate", - CheckoutSessionSubmitType::Pay => "pay", - } - } -} - -impl AsRef for CheckoutSessionSubmitType { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for CheckoutSessionSubmitType { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for CheckoutSessionSubmitType { - fn default() -> Self { - Self::Auto - } -} - -/// An enum representing the possible values of an `CheckoutSession`'s `ui_mode` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CheckoutSessionUiMode { - Embedded, - Hosted, -} - -impl CheckoutSessionUiMode { - pub fn as_str(self) -> &'static str { - match self { - CheckoutSessionUiMode::Embedded => "embedded", - CheckoutSessionUiMode::Hosted => "hosted", - } - } -} - -impl AsRef for CheckoutSessionUiMode { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for CheckoutSessionUiMode { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for CheckoutSessionUiMode { - fn default() -> Self { - Self::Embedded - } -} - -/// An enum representing the possible values of an `CheckoutSofortPaymentMethodOptions`'s `setup_future_usage` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CheckoutSofortPaymentMethodOptionsSetupFutureUsage { - None, -} - -impl CheckoutSofortPaymentMethodOptionsSetupFutureUsage { - pub fn as_str(self) -> &'static str { - match self { - CheckoutSofortPaymentMethodOptionsSetupFutureUsage::None => "none", - } - } -} - -impl AsRef for CheckoutSofortPaymentMethodOptionsSetupFutureUsage { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for CheckoutSofortPaymentMethodOptionsSetupFutureUsage { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for CheckoutSofortPaymentMethodOptionsSetupFutureUsage { - fn default() -> Self { - Self::None - } -} - -/// An enum representing the possible values of an `CheckoutUsBankAccountPaymentMethodOptions`'s `setup_future_usage` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CheckoutUsBankAccountPaymentMethodOptionsSetupFutureUsage { - None, - OffSession, - OnSession, -} - -impl CheckoutUsBankAccountPaymentMethodOptionsSetupFutureUsage { - pub fn as_str(self) -> &'static str { - match self { - CheckoutUsBankAccountPaymentMethodOptionsSetupFutureUsage::None => "none", - CheckoutUsBankAccountPaymentMethodOptionsSetupFutureUsage::OffSession => "off_session", - CheckoutUsBankAccountPaymentMethodOptionsSetupFutureUsage::OnSession => "on_session", - } - } -} - -impl AsRef for CheckoutUsBankAccountPaymentMethodOptionsSetupFutureUsage { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for CheckoutUsBankAccountPaymentMethodOptionsSetupFutureUsage { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for CheckoutUsBankAccountPaymentMethodOptionsSetupFutureUsage { - fn default() -> Self { - Self::None - } -} - -/// An enum representing the possible values of an `CheckoutUsBankAccountPaymentMethodOptions`'s `verification_method` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CheckoutUsBankAccountPaymentMethodOptionsVerificationMethod { - Automatic, - Instant, -} - -impl CheckoutUsBankAccountPaymentMethodOptionsVerificationMethod { - pub fn as_str(self) -> &'static str { - match self { - CheckoutUsBankAccountPaymentMethodOptionsVerificationMethod::Automatic => "automatic", - CheckoutUsBankAccountPaymentMethodOptionsVerificationMethod::Instant => "instant", - } - } -} - -impl AsRef for CheckoutUsBankAccountPaymentMethodOptionsVerificationMethod { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for CheckoutUsBankAccountPaymentMethodOptionsVerificationMethod { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for CheckoutUsBankAccountPaymentMethodOptionsVerificationMethod { - fn default() -> Self { - Self::Automatic - } -} - -/// An enum representing the possible values of an `CreateCheckoutSessionAutomaticTaxLiability`'s `type` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CreateCheckoutSessionAutomaticTaxLiabilityType { - Account, - #[serde(rename = "self")] - Self_, -} - -impl CreateCheckoutSessionAutomaticTaxLiabilityType { - pub fn as_str(self) -> &'static str { - match self { - CreateCheckoutSessionAutomaticTaxLiabilityType::Account => "account", - CreateCheckoutSessionAutomaticTaxLiabilityType::Self_ => "self", - } - } -} - -impl AsRef for CreateCheckoutSessionAutomaticTaxLiabilityType { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for CreateCheckoutSessionAutomaticTaxLiabilityType { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for CreateCheckoutSessionAutomaticTaxLiabilityType { - fn default() -> Self { - Self::Account - } -} - -/// An enum representing the possible values of an `CreateCheckoutSessionConsentCollectionPaymentMethodReuseAgreement`'s `position` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CreateCheckoutSessionConsentCollectionPaymentMethodReuseAgreementPosition { - Auto, - Hidden, -} - -impl CreateCheckoutSessionConsentCollectionPaymentMethodReuseAgreementPosition { - pub fn as_str(self) -> &'static str { - match self { - CreateCheckoutSessionConsentCollectionPaymentMethodReuseAgreementPosition::Auto => { - "auto" - } - CreateCheckoutSessionConsentCollectionPaymentMethodReuseAgreementPosition::Hidden => { - "hidden" - } - } - } -} - -impl AsRef for CreateCheckoutSessionConsentCollectionPaymentMethodReuseAgreementPosition { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display - for CreateCheckoutSessionConsentCollectionPaymentMethodReuseAgreementPosition -{ - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default - for CreateCheckoutSessionConsentCollectionPaymentMethodReuseAgreementPosition -{ - fn default() -> Self { - Self::Auto - } -} - -/// An enum representing the possible values of an `CreateCheckoutSessionConsentCollection`'s `promotions` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CreateCheckoutSessionConsentCollectionPromotions { - Auto, - None, -} - -impl CreateCheckoutSessionConsentCollectionPromotions { - pub fn as_str(self) -> &'static str { - match self { - CreateCheckoutSessionConsentCollectionPromotions::Auto => "auto", - CreateCheckoutSessionConsentCollectionPromotions::None => "none", - } - } -} - -impl AsRef for CreateCheckoutSessionConsentCollectionPromotions { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for CreateCheckoutSessionConsentCollectionPromotions { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for CreateCheckoutSessionConsentCollectionPromotions { - fn default() -> Self { - Self::Auto - } -} - -/// An enum representing the possible values of an `CreateCheckoutSessionConsentCollection`'s `terms_of_service` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CreateCheckoutSessionConsentCollectionTermsOfService { - None, - Required, -} - -impl CreateCheckoutSessionConsentCollectionTermsOfService { - pub fn as_str(self) -> &'static str { - match self { - CreateCheckoutSessionConsentCollectionTermsOfService::None => "none", - CreateCheckoutSessionConsentCollectionTermsOfService::Required => "required", - } - } -} - -impl AsRef for CreateCheckoutSessionConsentCollectionTermsOfService { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for CreateCheckoutSessionConsentCollectionTermsOfService { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for CreateCheckoutSessionConsentCollectionTermsOfService { - fn default() -> Self { - Self::None - } -} - -/// An enum representing the possible values of an `CreateCheckoutSessionCustomFieldsLabel`'s `type` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CreateCheckoutSessionCustomFieldsLabelType { - Custom, -} - -impl CreateCheckoutSessionCustomFieldsLabelType { - pub fn as_str(self) -> &'static str { - match self { - CreateCheckoutSessionCustomFieldsLabelType::Custom => "custom", - } - } -} - -impl AsRef for CreateCheckoutSessionCustomFieldsLabelType { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for CreateCheckoutSessionCustomFieldsLabelType { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for CreateCheckoutSessionCustomFieldsLabelType { - fn default() -> Self { - Self::Custom - } -} - -/// An enum representing the possible values of an `CreateCheckoutSessionCustomFields`'s `type` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CreateCheckoutSessionCustomFieldsType { - Dropdown, - Numeric, - Text, -} - -impl CreateCheckoutSessionCustomFieldsType { - pub fn as_str(self) -> &'static str { - match self { - CreateCheckoutSessionCustomFieldsType::Dropdown => "dropdown", - CreateCheckoutSessionCustomFieldsType::Numeric => "numeric", - CreateCheckoutSessionCustomFieldsType::Text => "text", - } - } -} - -impl AsRef for CreateCheckoutSessionCustomFieldsType { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for CreateCheckoutSessionCustomFieldsType { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for CreateCheckoutSessionCustomFieldsType { - fn default() -> Self { - Self::Dropdown - } -} - -/// An enum representing the possible values of an `CreateCheckoutSessionCustomerUpdate`'s `address` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CreateCheckoutSessionCustomerUpdateAddress { - Auto, - Never, -} - -impl CreateCheckoutSessionCustomerUpdateAddress { - pub fn as_str(self) -> &'static str { - match self { - CreateCheckoutSessionCustomerUpdateAddress::Auto => "auto", - CreateCheckoutSessionCustomerUpdateAddress::Never => "never", - } - } -} - -impl AsRef for CreateCheckoutSessionCustomerUpdateAddress { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for CreateCheckoutSessionCustomerUpdateAddress { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for CreateCheckoutSessionCustomerUpdateAddress { - fn default() -> Self { - Self::Auto - } -} - -/// An enum representing the possible values of an `CreateCheckoutSessionCustomerUpdate`'s `name` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CreateCheckoutSessionCustomerUpdateName { - Auto, - Never, -} - -impl CreateCheckoutSessionCustomerUpdateName { - pub fn as_str(self) -> &'static str { - match self { - CreateCheckoutSessionCustomerUpdateName::Auto => "auto", - CreateCheckoutSessionCustomerUpdateName::Never => "never", - } - } -} - -impl AsRef for CreateCheckoutSessionCustomerUpdateName { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for CreateCheckoutSessionCustomerUpdateName { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for CreateCheckoutSessionCustomerUpdateName { - fn default() -> Self { - Self::Auto - } -} - -/// An enum representing the possible values of an `CreateCheckoutSessionCustomerUpdate`'s `shipping` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CreateCheckoutSessionCustomerUpdateShipping { - Auto, - Never, -} - -impl CreateCheckoutSessionCustomerUpdateShipping { - pub fn as_str(self) -> &'static str { - match self { - CreateCheckoutSessionCustomerUpdateShipping::Auto => "auto", - CreateCheckoutSessionCustomerUpdateShipping::Never => "never", - } - } -} - -impl AsRef for CreateCheckoutSessionCustomerUpdateShipping { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for CreateCheckoutSessionCustomerUpdateShipping { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for CreateCheckoutSessionCustomerUpdateShipping { - fn default() -> Self { - Self::Auto - } -} - -/// An enum representing the possible values of an `CreateCheckoutSessionInvoiceCreationInvoiceDataIssuer`'s `type` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CreateCheckoutSessionInvoiceCreationInvoiceDataIssuerType { - Account, - #[serde(rename = "self")] - Self_, -} - -impl CreateCheckoutSessionInvoiceCreationInvoiceDataIssuerType { - pub fn as_str(self) -> &'static str { - match self { - CreateCheckoutSessionInvoiceCreationInvoiceDataIssuerType::Account => "account", - CreateCheckoutSessionInvoiceCreationInvoiceDataIssuerType::Self_ => "self", - } - } -} - -impl AsRef for CreateCheckoutSessionInvoiceCreationInvoiceDataIssuerType { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for CreateCheckoutSessionInvoiceCreationInvoiceDataIssuerType { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for CreateCheckoutSessionInvoiceCreationInvoiceDataIssuerType { - fn default() -> Self { - Self::Account - } -} - -/// An enum representing the possible values of an `CreateCheckoutSessionInvoiceCreationInvoiceDataRenderingOptions`'s `amount_tax_display` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CreateCheckoutSessionInvoiceCreationInvoiceDataRenderingOptionsAmountTaxDisplay { - ExcludeTax, - IncludeInclusiveTax, -} - -impl CreateCheckoutSessionInvoiceCreationInvoiceDataRenderingOptionsAmountTaxDisplay { - pub fn as_str(self) -> &'static str { - match self { - CreateCheckoutSessionInvoiceCreationInvoiceDataRenderingOptionsAmountTaxDisplay::ExcludeTax => "exclude_tax", - CreateCheckoutSessionInvoiceCreationInvoiceDataRenderingOptionsAmountTaxDisplay::IncludeInclusiveTax => "include_inclusive_tax", - } - } -} - -impl AsRef - for CreateCheckoutSessionInvoiceCreationInvoiceDataRenderingOptionsAmountTaxDisplay -{ - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display - for CreateCheckoutSessionInvoiceCreationInvoiceDataRenderingOptionsAmountTaxDisplay -{ - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default - for CreateCheckoutSessionInvoiceCreationInvoiceDataRenderingOptionsAmountTaxDisplay -{ - fn default() -> Self { - Self::ExcludeTax - } -} - -/// An enum representing the possible values of an `CreateCheckoutSessionLineItemsPriceDataRecurring`'s `interval` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CreateCheckoutSessionLineItemsPriceDataRecurringInterval { - Day, - Month, - Week, - Year, -} - -impl CreateCheckoutSessionLineItemsPriceDataRecurringInterval { - pub fn as_str(self) -> &'static str { - match self { - CreateCheckoutSessionLineItemsPriceDataRecurringInterval::Day => "day", - CreateCheckoutSessionLineItemsPriceDataRecurringInterval::Month => "month", - CreateCheckoutSessionLineItemsPriceDataRecurringInterval::Week => "week", - CreateCheckoutSessionLineItemsPriceDataRecurringInterval::Year => "year", - } - } -} - -impl AsRef for CreateCheckoutSessionLineItemsPriceDataRecurringInterval { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for CreateCheckoutSessionLineItemsPriceDataRecurringInterval { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for CreateCheckoutSessionLineItemsPriceDataRecurringInterval { - fn default() -> Self { - Self::Day - } -} - -/// An enum representing the possible values of an `CreateCheckoutSessionLineItemsPriceData`'s `tax_behavior` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CreateCheckoutSessionLineItemsPriceDataTaxBehavior { - Exclusive, - Inclusive, - Unspecified, -} - -impl CreateCheckoutSessionLineItemsPriceDataTaxBehavior { - pub fn as_str(self) -> &'static str { - match self { - CreateCheckoutSessionLineItemsPriceDataTaxBehavior::Exclusive => "exclusive", - CreateCheckoutSessionLineItemsPriceDataTaxBehavior::Inclusive => "inclusive", - CreateCheckoutSessionLineItemsPriceDataTaxBehavior::Unspecified => "unspecified", - } - } -} - -impl AsRef for CreateCheckoutSessionLineItemsPriceDataTaxBehavior { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for CreateCheckoutSessionLineItemsPriceDataTaxBehavior { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for CreateCheckoutSessionLineItemsPriceDataTaxBehavior { - fn default() -> Self { - Self::Exclusive - } -} - -/// An enum representing the possible values of an `CreateCheckoutSessionPaymentIntentData`'s `capture_method` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CreateCheckoutSessionPaymentIntentDataCaptureMethod { - Automatic, - AutomaticAsync, - Manual, -} - -impl CreateCheckoutSessionPaymentIntentDataCaptureMethod { - pub fn as_str(self) -> &'static str { - match self { - CreateCheckoutSessionPaymentIntentDataCaptureMethod::Automatic => "automatic", - CreateCheckoutSessionPaymentIntentDataCaptureMethod::AutomaticAsync => { - "automatic_async" - } - CreateCheckoutSessionPaymentIntentDataCaptureMethod::Manual => "manual", - } - } -} - -impl AsRef for CreateCheckoutSessionPaymentIntentDataCaptureMethod { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for CreateCheckoutSessionPaymentIntentDataCaptureMethod { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for CreateCheckoutSessionPaymentIntentDataCaptureMethod { - fn default() -> Self { - Self::Automatic - } -} - -/// An enum representing the possible values of an `CreateCheckoutSessionPaymentIntentData`'s `setup_future_usage` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CreateCheckoutSessionPaymentIntentDataSetupFutureUsage { - OffSession, - OnSession, -} - -impl CreateCheckoutSessionPaymentIntentDataSetupFutureUsage { - pub fn as_str(self) -> &'static str { - match self { - CreateCheckoutSessionPaymentIntentDataSetupFutureUsage::OffSession => "off_session", - CreateCheckoutSessionPaymentIntentDataSetupFutureUsage::OnSession => "on_session", - } - } -} - -impl AsRef for CreateCheckoutSessionPaymentIntentDataSetupFutureUsage { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for CreateCheckoutSessionPaymentIntentDataSetupFutureUsage { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for CreateCheckoutSessionPaymentIntentDataSetupFutureUsage { - fn default() -> Self { - Self::OffSession - } -} - -/// An enum representing the possible values of an `CreateCheckoutSessionPaymentMethodOptionsAcssDebitMandateOptions`'s `default_for` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CreateCheckoutSessionPaymentMethodOptionsAcssDebitMandateOptionsDefaultFor { - Invoice, - Subscription, -} - -impl CreateCheckoutSessionPaymentMethodOptionsAcssDebitMandateOptionsDefaultFor { - pub fn as_str(self) -> &'static str { - match self { - CreateCheckoutSessionPaymentMethodOptionsAcssDebitMandateOptionsDefaultFor::Invoice => "invoice", - CreateCheckoutSessionPaymentMethodOptionsAcssDebitMandateOptionsDefaultFor::Subscription => "subscription", - } - } -} - -impl AsRef for CreateCheckoutSessionPaymentMethodOptionsAcssDebitMandateOptionsDefaultFor { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display - for CreateCheckoutSessionPaymentMethodOptionsAcssDebitMandateOptionsDefaultFor -{ - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default - for CreateCheckoutSessionPaymentMethodOptionsAcssDebitMandateOptionsDefaultFor -{ - fn default() -> Self { - Self::Invoice - } -} - -/// An enum representing the possible values of an `CreateCheckoutSessionPaymentMethodOptionsAcssDebitMandateOptions`'s `payment_schedule` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CreateCheckoutSessionPaymentMethodOptionsAcssDebitMandateOptionsPaymentSchedule { - Combined, - Interval, - Sporadic, -} - -impl CreateCheckoutSessionPaymentMethodOptionsAcssDebitMandateOptionsPaymentSchedule { - pub fn as_str(self) -> &'static str { - match self { - CreateCheckoutSessionPaymentMethodOptionsAcssDebitMandateOptionsPaymentSchedule::Combined => "combined", - CreateCheckoutSessionPaymentMethodOptionsAcssDebitMandateOptionsPaymentSchedule::Interval => "interval", - CreateCheckoutSessionPaymentMethodOptionsAcssDebitMandateOptionsPaymentSchedule::Sporadic => "sporadic", - } - } -} - -impl AsRef - for CreateCheckoutSessionPaymentMethodOptionsAcssDebitMandateOptionsPaymentSchedule -{ - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display - for CreateCheckoutSessionPaymentMethodOptionsAcssDebitMandateOptionsPaymentSchedule -{ - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default - for CreateCheckoutSessionPaymentMethodOptionsAcssDebitMandateOptionsPaymentSchedule -{ - fn default() -> Self { - Self::Combined - } -} - -/// An enum representing the possible values of an `CreateCheckoutSessionPaymentMethodOptionsAcssDebitMandateOptions`'s `transaction_type` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CreateCheckoutSessionPaymentMethodOptionsAcssDebitMandateOptionsTransactionType { - Business, - Personal, -} - -impl CreateCheckoutSessionPaymentMethodOptionsAcssDebitMandateOptionsTransactionType { - pub fn as_str(self) -> &'static str { - match self { - CreateCheckoutSessionPaymentMethodOptionsAcssDebitMandateOptionsTransactionType::Business => "business", - CreateCheckoutSessionPaymentMethodOptionsAcssDebitMandateOptionsTransactionType::Personal => "personal", - } - } -} - -impl AsRef - for CreateCheckoutSessionPaymentMethodOptionsAcssDebitMandateOptionsTransactionType -{ - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display - for CreateCheckoutSessionPaymentMethodOptionsAcssDebitMandateOptionsTransactionType -{ - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default - for CreateCheckoutSessionPaymentMethodOptionsAcssDebitMandateOptionsTransactionType -{ - fn default() -> Self { - Self::Business - } -} - -/// An enum representing the possible values of an `CreateCheckoutSessionPaymentMethodOptionsAcssDebit`'s `setup_future_usage` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CreateCheckoutSessionPaymentMethodOptionsAcssDebitSetupFutureUsage { - None, - OffSession, - OnSession, -} - -impl CreateCheckoutSessionPaymentMethodOptionsAcssDebitSetupFutureUsage { - pub fn as_str(self) -> &'static str { - match self { - CreateCheckoutSessionPaymentMethodOptionsAcssDebitSetupFutureUsage::None => "none", - CreateCheckoutSessionPaymentMethodOptionsAcssDebitSetupFutureUsage::OffSession => { - "off_session" - } - CreateCheckoutSessionPaymentMethodOptionsAcssDebitSetupFutureUsage::OnSession => { - "on_session" - } - } - } -} - -impl AsRef for CreateCheckoutSessionPaymentMethodOptionsAcssDebitSetupFutureUsage { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for CreateCheckoutSessionPaymentMethodOptionsAcssDebitSetupFutureUsage { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for CreateCheckoutSessionPaymentMethodOptionsAcssDebitSetupFutureUsage { - fn default() -> Self { - Self::None - } -} - -/// An enum representing the possible values of an `CreateCheckoutSessionPaymentMethodOptionsAcssDebit`'s `verification_method` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CreateCheckoutSessionPaymentMethodOptionsAcssDebitVerificationMethod { - Automatic, - Instant, - Microdeposits, -} - -impl CreateCheckoutSessionPaymentMethodOptionsAcssDebitVerificationMethod { - pub fn as_str(self) -> &'static str { - match self { - CreateCheckoutSessionPaymentMethodOptionsAcssDebitVerificationMethod::Automatic => { - "automatic" - } - CreateCheckoutSessionPaymentMethodOptionsAcssDebitVerificationMethod::Instant => { - "instant" - } - CreateCheckoutSessionPaymentMethodOptionsAcssDebitVerificationMethod::Microdeposits => { - "microdeposits" - } - } - } -} - -impl AsRef for CreateCheckoutSessionPaymentMethodOptionsAcssDebitVerificationMethod { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for CreateCheckoutSessionPaymentMethodOptionsAcssDebitVerificationMethod { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default - for CreateCheckoutSessionPaymentMethodOptionsAcssDebitVerificationMethod -{ - fn default() -> Self { - Self::Automatic - } -} - -/// An enum representing the possible values of an `CreateCheckoutSessionPaymentMethodOptionsAffirm`'s `setup_future_usage` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CreateCheckoutSessionPaymentMethodOptionsAffirmSetupFutureUsage { - None, -} - -impl CreateCheckoutSessionPaymentMethodOptionsAffirmSetupFutureUsage { - pub fn as_str(self) -> &'static str { - match self { - CreateCheckoutSessionPaymentMethodOptionsAffirmSetupFutureUsage::None => "none", - } - } -} - -impl AsRef for CreateCheckoutSessionPaymentMethodOptionsAffirmSetupFutureUsage { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for CreateCheckoutSessionPaymentMethodOptionsAffirmSetupFutureUsage { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for CreateCheckoutSessionPaymentMethodOptionsAffirmSetupFutureUsage { - fn default() -> Self { - Self::None - } -} - -/// An enum representing the possible values of an `CreateCheckoutSessionPaymentMethodOptionsAfterpayClearpay`'s `setup_future_usage` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CreateCheckoutSessionPaymentMethodOptionsAfterpayClearpaySetupFutureUsage { - None, -} - -impl CreateCheckoutSessionPaymentMethodOptionsAfterpayClearpaySetupFutureUsage { - pub fn as_str(self) -> &'static str { - match self { - CreateCheckoutSessionPaymentMethodOptionsAfterpayClearpaySetupFutureUsage::None => { - "none" - } - } - } -} - -impl AsRef for CreateCheckoutSessionPaymentMethodOptionsAfterpayClearpaySetupFutureUsage { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display - for CreateCheckoutSessionPaymentMethodOptionsAfterpayClearpaySetupFutureUsage -{ - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default - for CreateCheckoutSessionPaymentMethodOptionsAfterpayClearpaySetupFutureUsage -{ - fn default() -> Self { - Self::None - } -} - -/// An enum representing the possible values of an `CreateCheckoutSessionPaymentMethodOptionsAlipay`'s `setup_future_usage` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CreateCheckoutSessionPaymentMethodOptionsAlipaySetupFutureUsage { - None, -} - -impl CreateCheckoutSessionPaymentMethodOptionsAlipaySetupFutureUsage { - pub fn as_str(self) -> &'static str { - match self { - CreateCheckoutSessionPaymentMethodOptionsAlipaySetupFutureUsage::None => "none", - } - } -} - -impl AsRef for CreateCheckoutSessionPaymentMethodOptionsAlipaySetupFutureUsage { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for CreateCheckoutSessionPaymentMethodOptionsAlipaySetupFutureUsage { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for CreateCheckoutSessionPaymentMethodOptionsAlipaySetupFutureUsage { - fn default() -> Self { - Self::None - } -} - -/// An enum representing the possible values of an `CreateCheckoutSessionPaymentMethodOptionsAuBecsDebit`'s `setup_future_usage` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CreateCheckoutSessionPaymentMethodOptionsAuBecsDebitSetupFutureUsage { - None, -} - -impl CreateCheckoutSessionPaymentMethodOptionsAuBecsDebitSetupFutureUsage { - pub fn as_str(self) -> &'static str { - match self { - CreateCheckoutSessionPaymentMethodOptionsAuBecsDebitSetupFutureUsage::None => "none", - } - } -} - -impl AsRef for CreateCheckoutSessionPaymentMethodOptionsAuBecsDebitSetupFutureUsage { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for CreateCheckoutSessionPaymentMethodOptionsAuBecsDebitSetupFutureUsage { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default - for CreateCheckoutSessionPaymentMethodOptionsAuBecsDebitSetupFutureUsage -{ - fn default() -> Self { - Self::None - } -} - -/// An enum representing the possible values of an `CreateCheckoutSessionPaymentMethodOptionsBacsDebit`'s `setup_future_usage` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CreateCheckoutSessionPaymentMethodOptionsBacsDebitSetupFutureUsage { - None, - OffSession, - OnSession, -} - -impl CreateCheckoutSessionPaymentMethodOptionsBacsDebitSetupFutureUsage { - pub fn as_str(self) -> &'static str { - match self { - CreateCheckoutSessionPaymentMethodOptionsBacsDebitSetupFutureUsage::None => "none", - CreateCheckoutSessionPaymentMethodOptionsBacsDebitSetupFutureUsage::OffSession => { - "off_session" - } - CreateCheckoutSessionPaymentMethodOptionsBacsDebitSetupFutureUsage::OnSession => { - "on_session" - } - } - } -} - -impl AsRef for CreateCheckoutSessionPaymentMethodOptionsBacsDebitSetupFutureUsage { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for CreateCheckoutSessionPaymentMethodOptionsBacsDebitSetupFutureUsage { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for CreateCheckoutSessionPaymentMethodOptionsBacsDebitSetupFutureUsage { - fn default() -> Self { - Self::None - } -} - -/// An enum representing the possible values of an `CreateCheckoutSessionPaymentMethodOptionsBancontact`'s `setup_future_usage` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CreateCheckoutSessionPaymentMethodOptionsBancontactSetupFutureUsage { - None, -} - -impl CreateCheckoutSessionPaymentMethodOptionsBancontactSetupFutureUsage { - pub fn as_str(self) -> &'static str { - match self { - CreateCheckoutSessionPaymentMethodOptionsBancontactSetupFutureUsage::None => "none", - } - } -} - -impl AsRef for CreateCheckoutSessionPaymentMethodOptionsBancontactSetupFutureUsage { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for CreateCheckoutSessionPaymentMethodOptionsBancontactSetupFutureUsage { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for CreateCheckoutSessionPaymentMethodOptionsBancontactSetupFutureUsage { - fn default() -> Self { - Self::None - } -} - -/// An enum representing the possible values of an `CreateCheckoutSessionPaymentMethodOptionsBoleto`'s `setup_future_usage` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CreateCheckoutSessionPaymentMethodOptionsBoletoSetupFutureUsage { - None, - OffSession, - OnSession, -} - -impl CreateCheckoutSessionPaymentMethodOptionsBoletoSetupFutureUsage { - pub fn as_str(self) -> &'static str { - match self { - CreateCheckoutSessionPaymentMethodOptionsBoletoSetupFutureUsage::None => "none", - CreateCheckoutSessionPaymentMethodOptionsBoletoSetupFutureUsage::OffSession => { - "off_session" - } - CreateCheckoutSessionPaymentMethodOptionsBoletoSetupFutureUsage::OnSession => { - "on_session" - } - } - } -} - -impl AsRef for CreateCheckoutSessionPaymentMethodOptionsBoletoSetupFutureUsage { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for CreateCheckoutSessionPaymentMethodOptionsBoletoSetupFutureUsage { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for CreateCheckoutSessionPaymentMethodOptionsBoletoSetupFutureUsage { - fn default() -> Self { - Self::None - } -} - -/// An enum representing the possible values of an `CreateCheckoutSessionPaymentMethodOptionsCard`'s `setup_future_usage` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CreateCheckoutSessionPaymentMethodOptionsCardSetupFutureUsage { - OffSession, - OnSession, -} - -impl CreateCheckoutSessionPaymentMethodOptionsCardSetupFutureUsage { - pub fn as_str(self) -> &'static str { - match self { - CreateCheckoutSessionPaymentMethodOptionsCardSetupFutureUsage::OffSession => { - "off_session" - } - CreateCheckoutSessionPaymentMethodOptionsCardSetupFutureUsage::OnSession => { - "on_session" - } - } - } -} - -impl AsRef for CreateCheckoutSessionPaymentMethodOptionsCardSetupFutureUsage { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for CreateCheckoutSessionPaymentMethodOptionsCardSetupFutureUsage { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for CreateCheckoutSessionPaymentMethodOptionsCardSetupFutureUsage { - fn default() -> Self { - Self::OffSession - } -} - -/// An enum representing the possible values of an `CreateCheckoutSessionPaymentMethodOptionsCashapp`'s `setup_future_usage` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CreateCheckoutSessionPaymentMethodOptionsCashappSetupFutureUsage { - None, - OffSession, - OnSession, -} - -impl CreateCheckoutSessionPaymentMethodOptionsCashappSetupFutureUsage { - pub fn as_str(self) -> &'static str { - match self { - CreateCheckoutSessionPaymentMethodOptionsCashappSetupFutureUsage::None => "none", - CreateCheckoutSessionPaymentMethodOptionsCashappSetupFutureUsage::OffSession => { - "off_session" - } - CreateCheckoutSessionPaymentMethodOptionsCashappSetupFutureUsage::OnSession => { - "on_session" - } - } - } -} - -impl AsRef for CreateCheckoutSessionPaymentMethodOptionsCashappSetupFutureUsage { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for CreateCheckoutSessionPaymentMethodOptionsCashappSetupFutureUsage { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for CreateCheckoutSessionPaymentMethodOptionsCashappSetupFutureUsage { - fn default() -> Self { - Self::None - } -} - -/// An enum representing the possible values of an `CreateCheckoutSessionPaymentMethodOptionsCustomerBalanceBankTransfer`'s `requested_address_types` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CreateCheckoutSessionPaymentMethodOptionsCustomerBalanceBankTransferRequestedAddressTypes { - Aba, - Iban, - Sepa, - SortCode, - Spei, - Swift, - Zengin, -} - -impl CreateCheckoutSessionPaymentMethodOptionsCustomerBalanceBankTransferRequestedAddressTypes { - pub fn as_str(self) -> &'static str { - match self { - CreateCheckoutSessionPaymentMethodOptionsCustomerBalanceBankTransferRequestedAddressTypes::Aba => "aba", - CreateCheckoutSessionPaymentMethodOptionsCustomerBalanceBankTransferRequestedAddressTypes::Iban => "iban", - CreateCheckoutSessionPaymentMethodOptionsCustomerBalanceBankTransferRequestedAddressTypes::Sepa => "sepa", - CreateCheckoutSessionPaymentMethodOptionsCustomerBalanceBankTransferRequestedAddressTypes::SortCode => "sort_code", - CreateCheckoutSessionPaymentMethodOptionsCustomerBalanceBankTransferRequestedAddressTypes::Spei => "spei", - CreateCheckoutSessionPaymentMethodOptionsCustomerBalanceBankTransferRequestedAddressTypes::Swift => "swift", - CreateCheckoutSessionPaymentMethodOptionsCustomerBalanceBankTransferRequestedAddressTypes::Zengin => "zengin", - } - } -} - -impl AsRef - for CreateCheckoutSessionPaymentMethodOptionsCustomerBalanceBankTransferRequestedAddressTypes -{ - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display - for CreateCheckoutSessionPaymentMethodOptionsCustomerBalanceBankTransferRequestedAddressTypes -{ - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default - for CreateCheckoutSessionPaymentMethodOptionsCustomerBalanceBankTransferRequestedAddressTypes -{ - fn default() -> Self { - Self::Aba - } -} - -/// An enum representing the possible values of an `CreateCheckoutSessionPaymentMethodOptionsCustomerBalanceBankTransfer`'s `type` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CreateCheckoutSessionPaymentMethodOptionsCustomerBalanceBankTransferType { - EuBankTransfer, - GbBankTransfer, - JpBankTransfer, - MxBankTransfer, - UsBankTransfer, -} - -impl CreateCheckoutSessionPaymentMethodOptionsCustomerBalanceBankTransferType { - pub fn as_str(self) -> &'static str { - match self { - CreateCheckoutSessionPaymentMethodOptionsCustomerBalanceBankTransferType::EuBankTransfer => "eu_bank_transfer", - CreateCheckoutSessionPaymentMethodOptionsCustomerBalanceBankTransferType::GbBankTransfer => "gb_bank_transfer", - CreateCheckoutSessionPaymentMethodOptionsCustomerBalanceBankTransferType::JpBankTransfer => "jp_bank_transfer", - CreateCheckoutSessionPaymentMethodOptionsCustomerBalanceBankTransferType::MxBankTransfer => "mx_bank_transfer", - CreateCheckoutSessionPaymentMethodOptionsCustomerBalanceBankTransferType::UsBankTransfer => "us_bank_transfer", - } - } -} - -impl AsRef for CreateCheckoutSessionPaymentMethodOptionsCustomerBalanceBankTransferType { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display - for CreateCheckoutSessionPaymentMethodOptionsCustomerBalanceBankTransferType -{ - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default - for CreateCheckoutSessionPaymentMethodOptionsCustomerBalanceBankTransferType -{ - fn default() -> Self { - Self::EuBankTransfer - } -} - -/// An enum representing the possible values of an `CreateCheckoutSessionPaymentMethodOptionsCustomerBalance`'s `funding_type` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CreateCheckoutSessionPaymentMethodOptionsCustomerBalanceFundingType { - BankTransfer, -} - -impl CreateCheckoutSessionPaymentMethodOptionsCustomerBalanceFundingType { - pub fn as_str(self) -> &'static str { - match self { - CreateCheckoutSessionPaymentMethodOptionsCustomerBalanceFundingType::BankTransfer => { - "bank_transfer" - } - } - } -} - -impl AsRef for CreateCheckoutSessionPaymentMethodOptionsCustomerBalanceFundingType { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for CreateCheckoutSessionPaymentMethodOptionsCustomerBalanceFundingType { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for CreateCheckoutSessionPaymentMethodOptionsCustomerBalanceFundingType { - fn default() -> Self { - Self::BankTransfer - } -} - -/// An enum representing the possible values of an `CreateCheckoutSessionPaymentMethodOptionsCustomerBalance`'s `setup_future_usage` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CreateCheckoutSessionPaymentMethodOptionsCustomerBalanceSetupFutureUsage { - None, -} - -impl CreateCheckoutSessionPaymentMethodOptionsCustomerBalanceSetupFutureUsage { - pub fn as_str(self) -> &'static str { - match self { - CreateCheckoutSessionPaymentMethodOptionsCustomerBalanceSetupFutureUsage::None => { - "none" - } - } - } -} - -impl AsRef for CreateCheckoutSessionPaymentMethodOptionsCustomerBalanceSetupFutureUsage { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display - for CreateCheckoutSessionPaymentMethodOptionsCustomerBalanceSetupFutureUsage -{ - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default - for CreateCheckoutSessionPaymentMethodOptionsCustomerBalanceSetupFutureUsage -{ - fn default() -> Self { - Self::None - } -} - -/// An enum representing the possible values of an `CreateCheckoutSessionPaymentMethodOptionsEps`'s `setup_future_usage` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CreateCheckoutSessionPaymentMethodOptionsEpsSetupFutureUsage { - None, -} - -impl CreateCheckoutSessionPaymentMethodOptionsEpsSetupFutureUsage { - pub fn as_str(self) -> &'static str { - match self { - CreateCheckoutSessionPaymentMethodOptionsEpsSetupFutureUsage::None => "none", - } - } -} - -impl AsRef for CreateCheckoutSessionPaymentMethodOptionsEpsSetupFutureUsage { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for CreateCheckoutSessionPaymentMethodOptionsEpsSetupFutureUsage { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for CreateCheckoutSessionPaymentMethodOptionsEpsSetupFutureUsage { - fn default() -> Self { - Self::None - } -} - -/// An enum representing the possible values of an `CreateCheckoutSessionPaymentMethodOptionsFpx`'s `setup_future_usage` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CreateCheckoutSessionPaymentMethodOptionsFpxSetupFutureUsage { - None, -} - -impl CreateCheckoutSessionPaymentMethodOptionsFpxSetupFutureUsage { - pub fn as_str(self) -> &'static str { - match self { - CreateCheckoutSessionPaymentMethodOptionsFpxSetupFutureUsage::None => "none", - } - } -} - -impl AsRef for CreateCheckoutSessionPaymentMethodOptionsFpxSetupFutureUsage { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for CreateCheckoutSessionPaymentMethodOptionsFpxSetupFutureUsage { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for CreateCheckoutSessionPaymentMethodOptionsFpxSetupFutureUsage { - fn default() -> Self { - Self::None - } -} - -/// An enum representing the possible values of an `CreateCheckoutSessionPaymentMethodOptionsGiropay`'s `setup_future_usage` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CreateCheckoutSessionPaymentMethodOptionsGiropaySetupFutureUsage { - None, -} - -impl CreateCheckoutSessionPaymentMethodOptionsGiropaySetupFutureUsage { - pub fn as_str(self) -> &'static str { - match self { - CreateCheckoutSessionPaymentMethodOptionsGiropaySetupFutureUsage::None => "none", - } - } -} - -impl AsRef for CreateCheckoutSessionPaymentMethodOptionsGiropaySetupFutureUsage { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for CreateCheckoutSessionPaymentMethodOptionsGiropaySetupFutureUsage { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for CreateCheckoutSessionPaymentMethodOptionsGiropaySetupFutureUsage { - fn default() -> Self { - Self::None - } -} - -/// An enum representing the possible values of an `CreateCheckoutSessionPaymentMethodOptionsGrabpay`'s `setup_future_usage` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CreateCheckoutSessionPaymentMethodOptionsGrabpaySetupFutureUsage { - None, -} - -impl CreateCheckoutSessionPaymentMethodOptionsGrabpaySetupFutureUsage { - pub fn as_str(self) -> &'static str { - match self { - CreateCheckoutSessionPaymentMethodOptionsGrabpaySetupFutureUsage::None => "none", - } - } -} - -impl AsRef for CreateCheckoutSessionPaymentMethodOptionsGrabpaySetupFutureUsage { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for CreateCheckoutSessionPaymentMethodOptionsGrabpaySetupFutureUsage { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for CreateCheckoutSessionPaymentMethodOptionsGrabpaySetupFutureUsage { - fn default() -> Self { - Self::None - } -} - -/// An enum representing the possible values of an `CreateCheckoutSessionPaymentMethodOptionsIdeal`'s `setup_future_usage` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CreateCheckoutSessionPaymentMethodOptionsIdealSetupFutureUsage { - None, -} - -impl CreateCheckoutSessionPaymentMethodOptionsIdealSetupFutureUsage { - pub fn as_str(self) -> &'static str { - match self { - CreateCheckoutSessionPaymentMethodOptionsIdealSetupFutureUsage::None => "none", - } - } -} - -impl AsRef for CreateCheckoutSessionPaymentMethodOptionsIdealSetupFutureUsage { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for CreateCheckoutSessionPaymentMethodOptionsIdealSetupFutureUsage { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for CreateCheckoutSessionPaymentMethodOptionsIdealSetupFutureUsage { - fn default() -> Self { - Self::None - } -} - -/// An enum representing the possible values of an `CreateCheckoutSessionPaymentMethodOptionsKlarna`'s `setup_future_usage` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CreateCheckoutSessionPaymentMethodOptionsKlarnaSetupFutureUsage { - None, -} - -impl CreateCheckoutSessionPaymentMethodOptionsKlarnaSetupFutureUsage { - pub fn as_str(self) -> &'static str { - match self { - CreateCheckoutSessionPaymentMethodOptionsKlarnaSetupFutureUsage::None => "none", - } - } -} - -impl AsRef for CreateCheckoutSessionPaymentMethodOptionsKlarnaSetupFutureUsage { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for CreateCheckoutSessionPaymentMethodOptionsKlarnaSetupFutureUsage { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for CreateCheckoutSessionPaymentMethodOptionsKlarnaSetupFutureUsage { - fn default() -> Self { - Self::None - } -} - -/// An enum representing the possible values of an `CreateCheckoutSessionPaymentMethodOptionsKonbini`'s `setup_future_usage` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CreateCheckoutSessionPaymentMethodOptionsKonbiniSetupFutureUsage { - None, -} - -impl CreateCheckoutSessionPaymentMethodOptionsKonbiniSetupFutureUsage { - pub fn as_str(self) -> &'static str { - match self { - CreateCheckoutSessionPaymentMethodOptionsKonbiniSetupFutureUsage::None => "none", - } - } -} - -impl AsRef for CreateCheckoutSessionPaymentMethodOptionsKonbiniSetupFutureUsage { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for CreateCheckoutSessionPaymentMethodOptionsKonbiniSetupFutureUsage { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for CreateCheckoutSessionPaymentMethodOptionsKonbiniSetupFutureUsage { - fn default() -> Self { - Self::None - } -} - -/// An enum representing the possible values of an `CreateCheckoutSessionPaymentMethodOptionsLink`'s `setup_future_usage` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CreateCheckoutSessionPaymentMethodOptionsLinkSetupFutureUsage { - None, - OffSession, -} - -impl CreateCheckoutSessionPaymentMethodOptionsLinkSetupFutureUsage { - pub fn as_str(self) -> &'static str { - match self { - CreateCheckoutSessionPaymentMethodOptionsLinkSetupFutureUsage::None => "none", - CreateCheckoutSessionPaymentMethodOptionsLinkSetupFutureUsage::OffSession => { - "off_session" - } - } - } -} - -impl AsRef for CreateCheckoutSessionPaymentMethodOptionsLinkSetupFutureUsage { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for CreateCheckoutSessionPaymentMethodOptionsLinkSetupFutureUsage { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for CreateCheckoutSessionPaymentMethodOptionsLinkSetupFutureUsage { - fn default() -> Self { - Self::None - } -} - -/// An enum representing the possible values of an `CreateCheckoutSessionPaymentMethodOptionsOxxo`'s `setup_future_usage` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CreateCheckoutSessionPaymentMethodOptionsOxxoSetupFutureUsage { - None, -} - -impl CreateCheckoutSessionPaymentMethodOptionsOxxoSetupFutureUsage { - pub fn as_str(self) -> &'static str { - match self { - CreateCheckoutSessionPaymentMethodOptionsOxxoSetupFutureUsage::None => "none", - } - } -} - -impl AsRef for CreateCheckoutSessionPaymentMethodOptionsOxxoSetupFutureUsage { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for CreateCheckoutSessionPaymentMethodOptionsOxxoSetupFutureUsage { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for CreateCheckoutSessionPaymentMethodOptionsOxxoSetupFutureUsage { - fn default() -> Self { - Self::None - } -} - -/// An enum representing the possible values of an `CreateCheckoutSessionPaymentMethodOptionsP24`'s `setup_future_usage` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CreateCheckoutSessionPaymentMethodOptionsP24SetupFutureUsage { - None, -} - -impl CreateCheckoutSessionPaymentMethodOptionsP24SetupFutureUsage { - pub fn as_str(self) -> &'static str { - match self { - CreateCheckoutSessionPaymentMethodOptionsP24SetupFutureUsage::None => "none", - } - } -} - -impl AsRef for CreateCheckoutSessionPaymentMethodOptionsP24SetupFutureUsage { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for CreateCheckoutSessionPaymentMethodOptionsP24SetupFutureUsage { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for CreateCheckoutSessionPaymentMethodOptionsP24SetupFutureUsage { - fn default() -> Self { - Self::None - } -} - -/// An enum representing the possible values of an `CreateCheckoutSessionPaymentMethodOptionsPaynow`'s `setup_future_usage` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CreateCheckoutSessionPaymentMethodOptionsPaynowSetupFutureUsage { - None, -} - -impl CreateCheckoutSessionPaymentMethodOptionsPaynowSetupFutureUsage { - pub fn as_str(self) -> &'static str { - match self { - CreateCheckoutSessionPaymentMethodOptionsPaynowSetupFutureUsage::None => "none", - } - } -} - -impl AsRef for CreateCheckoutSessionPaymentMethodOptionsPaynowSetupFutureUsage { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for CreateCheckoutSessionPaymentMethodOptionsPaynowSetupFutureUsage { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for CreateCheckoutSessionPaymentMethodOptionsPaynowSetupFutureUsage { - fn default() -> Self { - Self::None - } -} - -/// An enum representing the possible values of an `CreateCheckoutSessionPaymentMethodOptionsPaypal`'s `capture_method` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CreateCheckoutSessionPaymentMethodOptionsPaypalCaptureMethod { - Manual, -} - -impl CreateCheckoutSessionPaymentMethodOptionsPaypalCaptureMethod { - pub fn as_str(self) -> &'static str { - match self { - CreateCheckoutSessionPaymentMethodOptionsPaypalCaptureMethod::Manual => "manual", - } - } -} - -impl AsRef for CreateCheckoutSessionPaymentMethodOptionsPaypalCaptureMethod { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for CreateCheckoutSessionPaymentMethodOptionsPaypalCaptureMethod { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for CreateCheckoutSessionPaymentMethodOptionsPaypalCaptureMethod { - fn default() -> Self { - Self::Manual - } -} - -/// An enum representing the possible values of an `CreateCheckoutSessionPaymentMethodOptionsPaypal`'s `preferred_locale` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CreateCheckoutSessionPaymentMethodOptionsPaypalPreferredLocale { - #[serde(rename = "cs-CZ")] - CsCz, - #[serde(rename = "da-DK")] - DaDk, - #[serde(rename = "de-AT")] - DeAt, - #[serde(rename = "de-DE")] - DeDe, - #[serde(rename = "de-LU")] - DeLu, - #[serde(rename = "el-GR")] - ElGr, - #[serde(rename = "en-GB")] - EnGb, - #[serde(rename = "en-US")] - EnUs, - #[serde(rename = "es-ES")] - EsEs, - #[serde(rename = "fi-FI")] - FiFi, - #[serde(rename = "fr-BE")] - FrBe, - #[serde(rename = "fr-FR")] - FrFr, - #[serde(rename = "fr-LU")] - FrLu, - #[serde(rename = "hu-HU")] - HuHu, - #[serde(rename = "it-IT")] - ItIt, - #[serde(rename = "nl-BE")] - NlBe, - #[serde(rename = "nl-NL")] - NlNl, - #[serde(rename = "pl-PL")] - PlPl, - #[serde(rename = "pt-PT")] - PtPt, - #[serde(rename = "sk-SK")] - SkSk, - #[serde(rename = "sv-SE")] - SvSe, -} - -impl CreateCheckoutSessionPaymentMethodOptionsPaypalPreferredLocale { - pub fn as_str(self) -> &'static str { - match self { - CreateCheckoutSessionPaymentMethodOptionsPaypalPreferredLocale::CsCz => "cs-CZ", - CreateCheckoutSessionPaymentMethodOptionsPaypalPreferredLocale::DaDk => "da-DK", - CreateCheckoutSessionPaymentMethodOptionsPaypalPreferredLocale::DeAt => "de-AT", - CreateCheckoutSessionPaymentMethodOptionsPaypalPreferredLocale::DeDe => "de-DE", - CreateCheckoutSessionPaymentMethodOptionsPaypalPreferredLocale::DeLu => "de-LU", - CreateCheckoutSessionPaymentMethodOptionsPaypalPreferredLocale::ElGr => "el-GR", - CreateCheckoutSessionPaymentMethodOptionsPaypalPreferredLocale::EnGb => "en-GB", - CreateCheckoutSessionPaymentMethodOptionsPaypalPreferredLocale::EnUs => "en-US", - CreateCheckoutSessionPaymentMethodOptionsPaypalPreferredLocale::EsEs => "es-ES", - CreateCheckoutSessionPaymentMethodOptionsPaypalPreferredLocale::FiFi => "fi-FI", - CreateCheckoutSessionPaymentMethodOptionsPaypalPreferredLocale::FrBe => "fr-BE", - CreateCheckoutSessionPaymentMethodOptionsPaypalPreferredLocale::FrFr => "fr-FR", - CreateCheckoutSessionPaymentMethodOptionsPaypalPreferredLocale::FrLu => "fr-LU", - CreateCheckoutSessionPaymentMethodOptionsPaypalPreferredLocale::HuHu => "hu-HU", - CreateCheckoutSessionPaymentMethodOptionsPaypalPreferredLocale::ItIt => "it-IT", - CreateCheckoutSessionPaymentMethodOptionsPaypalPreferredLocale::NlBe => "nl-BE", - CreateCheckoutSessionPaymentMethodOptionsPaypalPreferredLocale::NlNl => "nl-NL", - CreateCheckoutSessionPaymentMethodOptionsPaypalPreferredLocale::PlPl => "pl-PL", - CreateCheckoutSessionPaymentMethodOptionsPaypalPreferredLocale::PtPt => "pt-PT", - CreateCheckoutSessionPaymentMethodOptionsPaypalPreferredLocale::SkSk => "sk-SK", - CreateCheckoutSessionPaymentMethodOptionsPaypalPreferredLocale::SvSe => "sv-SE", - } - } -} - -impl AsRef for CreateCheckoutSessionPaymentMethodOptionsPaypalPreferredLocale { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for CreateCheckoutSessionPaymentMethodOptionsPaypalPreferredLocale { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for CreateCheckoutSessionPaymentMethodOptionsPaypalPreferredLocale { - fn default() -> Self { - Self::CsCz - } -} - -/// An enum representing the possible values of an `CreateCheckoutSessionPaymentMethodOptionsPaypal`'s `setup_future_usage` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CreateCheckoutSessionPaymentMethodOptionsPaypalSetupFutureUsage { - None, - OffSession, -} - -impl CreateCheckoutSessionPaymentMethodOptionsPaypalSetupFutureUsage { - pub fn as_str(self) -> &'static str { - match self { - CreateCheckoutSessionPaymentMethodOptionsPaypalSetupFutureUsage::None => "none", - CreateCheckoutSessionPaymentMethodOptionsPaypalSetupFutureUsage::OffSession => { - "off_session" - } - } - } -} - -impl AsRef for CreateCheckoutSessionPaymentMethodOptionsPaypalSetupFutureUsage { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for CreateCheckoutSessionPaymentMethodOptionsPaypalSetupFutureUsage { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for CreateCheckoutSessionPaymentMethodOptionsPaypalSetupFutureUsage { - fn default() -> Self { - Self::None - } -} - -/// An enum representing the possible values of an `CreateCheckoutSessionPaymentMethodOptionsRevolutPay`'s `setup_future_usage` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CreateCheckoutSessionPaymentMethodOptionsRevolutPaySetupFutureUsage { - None, - OffSession, -} - -impl CreateCheckoutSessionPaymentMethodOptionsRevolutPaySetupFutureUsage { - pub fn as_str(self) -> &'static str { - match self { - CreateCheckoutSessionPaymentMethodOptionsRevolutPaySetupFutureUsage::None => "none", - CreateCheckoutSessionPaymentMethodOptionsRevolutPaySetupFutureUsage::OffSession => { - "off_session" - } - } - } -} - -impl AsRef for CreateCheckoutSessionPaymentMethodOptionsRevolutPaySetupFutureUsage { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for CreateCheckoutSessionPaymentMethodOptionsRevolutPaySetupFutureUsage { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for CreateCheckoutSessionPaymentMethodOptionsRevolutPaySetupFutureUsage { - fn default() -> Self { - Self::None - } -} - -/// An enum representing the possible values of an `CreateCheckoutSessionPaymentMethodOptionsSepaDebit`'s `setup_future_usage` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CreateCheckoutSessionPaymentMethodOptionsSepaDebitSetupFutureUsage { - None, - OffSession, - OnSession, -} - -impl CreateCheckoutSessionPaymentMethodOptionsSepaDebitSetupFutureUsage { - pub fn as_str(self) -> &'static str { - match self { - CreateCheckoutSessionPaymentMethodOptionsSepaDebitSetupFutureUsage::None => "none", - CreateCheckoutSessionPaymentMethodOptionsSepaDebitSetupFutureUsage::OffSession => { - "off_session" - } - CreateCheckoutSessionPaymentMethodOptionsSepaDebitSetupFutureUsage::OnSession => { - "on_session" - } - } - } -} - -impl AsRef for CreateCheckoutSessionPaymentMethodOptionsSepaDebitSetupFutureUsage { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for CreateCheckoutSessionPaymentMethodOptionsSepaDebitSetupFutureUsage { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for CreateCheckoutSessionPaymentMethodOptionsSepaDebitSetupFutureUsage { - fn default() -> Self { - Self::None - } -} - -/// An enum representing the possible values of an `CreateCheckoutSessionPaymentMethodOptionsSofort`'s `setup_future_usage` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CreateCheckoutSessionPaymentMethodOptionsSofortSetupFutureUsage { - None, -} - -impl CreateCheckoutSessionPaymentMethodOptionsSofortSetupFutureUsage { - pub fn as_str(self) -> &'static str { - match self { - CreateCheckoutSessionPaymentMethodOptionsSofortSetupFutureUsage::None => "none", - } - } -} - -impl AsRef for CreateCheckoutSessionPaymentMethodOptionsSofortSetupFutureUsage { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for CreateCheckoutSessionPaymentMethodOptionsSofortSetupFutureUsage { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for CreateCheckoutSessionPaymentMethodOptionsSofortSetupFutureUsage { - fn default() -> Self { - Self::None - } -} - -/// An enum representing the possible values of an `CreateCheckoutSessionPaymentMethodOptionsUsBankAccountFinancialConnections`'s `permissions` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CreateCheckoutSessionPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions { - Balances, - Ownership, - PaymentMethod, - Transactions, -} - -impl CreateCheckoutSessionPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions { - pub fn as_str(self) -> &'static str { - match self { - CreateCheckoutSessionPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions::Balances => "balances", - CreateCheckoutSessionPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions::Ownership => "ownership", - CreateCheckoutSessionPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions::PaymentMethod => "payment_method", - CreateCheckoutSessionPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions::Transactions => "transactions", - } - } -} - -impl AsRef - for CreateCheckoutSessionPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions -{ - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display - for CreateCheckoutSessionPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions -{ - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default - for CreateCheckoutSessionPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions -{ - fn default() -> Self { - Self::Balances - } -} - -/// An enum representing the possible values of an `CreateCheckoutSessionPaymentMethodOptionsUsBankAccountFinancialConnections`'s `prefetch` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CreateCheckoutSessionPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch { - Balances, - Transactions, -} - -impl CreateCheckoutSessionPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch { - pub fn as_str(self) -> &'static str { - match self { - CreateCheckoutSessionPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch::Balances => "balances", - CreateCheckoutSessionPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch::Transactions => "transactions", - } - } -} - -impl AsRef - for CreateCheckoutSessionPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch -{ - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display - for CreateCheckoutSessionPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch -{ - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default - for CreateCheckoutSessionPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch -{ - fn default() -> Self { - Self::Balances - } -} - -/// An enum representing the possible values of an `CreateCheckoutSessionPaymentMethodOptionsUsBankAccount`'s `setup_future_usage` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CreateCheckoutSessionPaymentMethodOptionsUsBankAccountSetupFutureUsage { - None, - OffSession, - OnSession, -} - -impl CreateCheckoutSessionPaymentMethodOptionsUsBankAccountSetupFutureUsage { - pub fn as_str(self) -> &'static str { - match self { - CreateCheckoutSessionPaymentMethodOptionsUsBankAccountSetupFutureUsage::None => "none", - CreateCheckoutSessionPaymentMethodOptionsUsBankAccountSetupFutureUsage::OffSession => { - "off_session" - } - CreateCheckoutSessionPaymentMethodOptionsUsBankAccountSetupFutureUsage::OnSession => { - "on_session" - } - } - } -} - -impl AsRef for CreateCheckoutSessionPaymentMethodOptionsUsBankAccountSetupFutureUsage { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for CreateCheckoutSessionPaymentMethodOptionsUsBankAccountSetupFutureUsage { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default - for CreateCheckoutSessionPaymentMethodOptionsUsBankAccountSetupFutureUsage -{ - fn default() -> Self { - Self::None - } -} - -/// An enum representing the possible values of an `CreateCheckoutSessionPaymentMethodOptionsUsBankAccount`'s `verification_method` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CreateCheckoutSessionPaymentMethodOptionsUsBankAccountVerificationMethod { - Automatic, - Instant, -} - -impl CreateCheckoutSessionPaymentMethodOptionsUsBankAccountVerificationMethod { - pub fn as_str(self) -> &'static str { - match self { - CreateCheckoutSessionPaymentMethodOptionsUsBankAccountVerificationMethod::Automatic => { - "automatic" - } - CreateCheckoutSessionPaymentMethodOptionsUsBankAccountVerificationMethod::Instant => { - "instant" - } - } - } -} - -impl AsRef for CreateCheckoutSessionPaymentMethodOptionsUsBankAccountVerificationMethod { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display - for CreateCheckoutSessionPaymentMethodOptionsUsBankAccountVerificationMethod -{ - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default - for CreateCheckoutSessionPaymentMethodOptionsUsBankAccountVerificationMethod -{ - fn default() -> Self { - Self::Automatic - } -} - -/// An enum representing the possible values of an `CreateCheckoutSessionPaymentMethodOptionsWechatPay`'s `client` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CreateCheckoutSessionPaymentMethodOptionsWechatPayClient { - Android, - Ios, - Web, -} - -impl CreateCheckoutSessionPaymentMethodOptionsWechatPayClient { - pub fn as_str(self) -> &'static str { - match self { - CreateCheckoutSessionPaymentMethodOptionsWechatPayClient::Android => "android", - CreateCheckoutSessionPaymentMethodOptionsWechatPayClient::Ios => "ios", - CreateCheckoutSessionPaymentMethodOptionsWechatPayClient::Web => "web", - } - } -} - -impl AsRef for CreateCheckoutSessionPaymentMethodOptionsWechatPayClient { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for CreateCheckoutSessionPaymentMethodOptionsWechatPayClient { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for CreateCheckoutSessionPaymentMethodOptionsWechatPayClient { - fn default() -> Self { - Self::Android - } -} - -/// An enum representing the possible values of an `CreateCheckoutSessionPaymentMethodOptionsWechatPay`'s `setup_future_usage` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CreateCheckoutSessionPaymentMethodOptionsWechatPaySetupFutureUsage { - None, -} - -impl CreateCheckoutSessionPaymentMethodOptionsWechatPaySetupFutureUsage { - pub fn as_str(self) -> &'static str { - match self { - CreateCheckoutSessionPaymentMethodOptionsWechatPaySetupFutureUsage::None => "none", - } - } -} - -impl AsRef for CreateCheckoutSessionPaymentMethodOptionsWechatPaySetupFutureUsage { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for CreateCheckoutSessionPaymentMethodOptionsWechatPaySetupFutureUsage { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for CreateCheckoutSessionPaymentMethodOptionsWechatPaySetupFutureUsage { - fn default() -> Self { - Self::None - } -} - -/// An enum representing the possible values of an `CreateCheckoutSession`'s `payment_method_types` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CreateCheckoutSessionPaymentMethodTypes { - AcssDebit, - Affirm, - AfterpayClearpay, - Alipay, - AuBecsDebit, - BacsDebit, - Bancontact, - Blik, - Boleto, - Card, - Cashapp, - CustomerBalance, - Eps, - Fpx, - Giropay, - Grabpay, - Ideal, - Klarna, - Konbini, - Link, - Oxxo, - P24, - Paynow, - Paypal, - Pix, - Promptpay, - RevolutPay, - SepaDebit, - Sofort, - Swish, - UsBankAccount, - WechatPay, - Zip, -} - -impl CreateCheckoutSessionPaymentMethodTypes { - pub fn as_str(self) -> &'static str { - match self { - CreateCheckoutSessionPaymentMethodTypes::AcssDebit => "acss_debit", - CreateCheckoutSessionPaymentMethodTypes::Affirm => "affirm", - CreateCheckoutSessionPaymentMethodTypes::AfterpayClearpay => "afterpay_clearpay", - CreateCheckoutSessionPaymentMethodTypes::Alipay => "alipay", - CreateCheckoutSessionPaymentMethodTypes::AuBecsDebit => "au_becs_debit", - CreateCheckoutSessionPaymentMethodTypes::BacsDebit => "bacs_debit", - CreateCheckoutSessionPaymentMethodTypes::Bancontact => "bancontact", - CreateCheckoutSessionPaymentMethodTypes::Blik => "blik", - CreateCheckoutSessionPaymentMethodTypes::Boleto => "boleto", - CreateCheckoutSessionPaymentMethodTypes::Card => "card", - CreateCheckoutSessionPaymentMethodTypes::Cashapp => "cashapp", - CreateCheckoutSessionPaymentMethodTypes::CustomerBalance => "customer_balance", - CreateCheckoutSessionPaymentMethodTypes::Eps => "eps", - CreateCheckoutSessionPaymentMethodTypes::Fpx => "fpx", - CreateCheckoutSessionPaymentMethodTypes::Giropay => "giropay", - CreateCheckoutSessionPaymentMethodTypes::Grabpay => "grabpay", - CreateCheckoutSessionPaymentMethodTypes::Ideal => "ideal", - CreateCheckoutSessionPaymentMethodTypes::Klarna => "klarna", - CreateCheckoutSessionPaymentMethodTypes::Konbini => "konbini", - CreateCheckoutSessionPaymentMethodTypes::Link => "link", - CreateCheckoutSessionPaymentMethodTypes::Oxxo => "oxxo", - CreateCheckoutSessionPaymentMethodTypes::P24 => "p24", - CreateCheckoutSessionPaymentMethodTypes::Paynow => "paynow", - CreateCheckoutSessionPaymentMethodTypes::Paypal => "paypal", - CreateCheckoutSessionPaymentMethodTypes::Pix => "pix", - CreateCheckoutSessionPaymentMethodTypes::Promptpay => "promptpay", - CreateCheckoutSessionPaymentMethodTypes::RevolutPay => "revolut_pay", - CreateCheckoutSessionPaymentMethodTypes::SepaDebit => "sepa_debit", - CreateCheckoutSessionPaymentMethodTypes::Sofort => "sofort", - CreateCheckoutSessionPaymentMethodTypes::Swish => "swish", - CreateCheckoutSessionPaymentMethodTypes::UsBankAccount => "us_bank_account", - CreateCheckoutSessionPaymentMethodTypes::WechatPay => "wechat_pay", - CreateCheckoutSessionPaymentMethodTypes::Zip => "zip", - } - } -} - -impl AsRef for CreateCheckoutSessionPaymentMethodTypes { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for CreateCheckoutSessionPaymentMethodTypes { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for CreateCheckoutSessionPaymentMethodTypes { - fn default() -> Self { - Self::AcssDebit - } -} - -/// An enum representing the possible values of an `CreateCheckoutSessionShippingAddressCollection`'s `allowed_countries` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CreateCheckoutSessionShippingAddressCollectionAllowedCountries { - #[serde(rename = "AC")] - Ac, - #[serde(rename = "AD")] - Ad, - #[serde(rename = "AE")] - Ae, - #[serde(rename = "AF")] - Af, - #[serde(rename = "AG")] - Ag, - #[serde(rename = "AI")] - Ai, - #[serde(rename = "AL")] - Al, - #[serde(rename = "AM")] - Am, - #[serde(rename = "AO")] - Ao, - #[serde(rename = "AQ")] - Aq, - #[serde(rename = "AR")] - Ar, - #[serde(rename = "AT")] - At, - #[serde(rename = "AU")] - Au, - #[serde(rename = "AW")] - Aw, - #[serde(rename = "AX")] - Ax, - #[serde(rename = "AZ")] - Az, - #[serde(rename = "BA")] - Ba, - #[serde(rename = "BB")] - Bb, - #[serde(rename = "BD")] - Bd, - #[serde(rename = "BE")] - Be, - #[serde(rename = "BF")] - Bf, - #[serde(rename = "BG")] - Bg, - #[serde(rename = "BH")] - Bh, - #[serde(rename = "BI")] - Bi, - #[serde(rename = "BJ")] - Bj, - #[serde(rename = "BL")] - Bl, - #[serde(rename = "BM")] - Bm, - #[serde(rename = "BN")] - Bn, - #[serde(rename = "BO")] - Bo, - #[serde(rename = "BQ")] - Bq, - #[serde(rename = "BR")] - Br, - #[serde(rename = "BS")] - Bs, - #[serde(rename = "BT")] - Bt, - #[serde(rename = "BV")] - Bv, - #[serde(rename = "BW")] - Bw, - #[serde(rename = "BY")] - By, - #[serde(rename = "BZ")] - Bz, - #[serde(rename = "CA")] - Ca, - #[serde(rename = "CD")] - Cd, - #[serde(rename = "CF")] - Cf, - #[serde(rename = "CG")] - Cg, - #[serde(rename = "CH")] - Ch, - #[serde(rename = "CI")] - Ci, - #[serde(rename = "CK")] - Ck, - #[serde(rename = "CL")] - Cl, - #[serde(rename = "CM")] - Cm, - #[serde(rename = "CN")] - Cn, - #[serde(rename = "CO")] - Co, - #[serde(rename = "CR")] - Cr, - #[serde(rename = "CV")] - Cv, - #[serde(rename = "CW")] - Cw, - #[serde(rename = "CY")] - Cy, - #[serde(rename = "CZ")] - Cz, - #[serde(rename = "DE")] - De, - #[serde(rename = "DJ")] - Dj, - #[serde(rename = "DK")] - Dk, - #[serde(rename = "DM")] - Dm, - #[serde(rename = "DO")] - Do, - #[serde(rename = "DZ")] - Dz, - #[serde(rename = "EC")] - Ec, - #[serde(rename = "EE")] - Ee, - #[serde(rename = "EG")] - Eg, - #[serde(rename = "EH")] - Eh, - #[serde(rename = "ER")] - Er, - #[serde(rename = "ES")] - Es, - #[serde(rename = "ET")] - Et, - #[serde(rename = "FI")] - Fi, - #[serde(rename = "FJ")] - Fj, - #[serde(rename = "FK")] - Fk, - #[serde(rename = "FO")] - Fo, - #[serde(rename = "FR")] - Fr, - #[serde(rename = "GA")] - Ga, - #[serde(rename = "GB")] - Gb, - #[serde(rename = "GD")] - Gd, - #[serde(rename = "GE")] - Ge, - #[serde(rename = "GF")] - Gf, - #[serde(rename = "GG")] - Gg, - #[serde(rename = "GH")] - Gh, - #[serde(rename = "GI")] - Gi, - #[serde(rename = "GL")] - Gl, - #[serde(rename = "GM")] - Gm, - #[serde(rename = "GN")] - Gn, - #[serde(rename = "GP")] - Gp, - #[serde(rename = "GQ")] - Gq, - #[serde(rename = "GR")] - Gr, - #[serde(rename = "GS")] - Gs, - #[serde(rename = "GT")] - Gt, - #[serde(rename = "GU")] - Gu, - #[serde(rename = "GW")] - Gw, - #[serde(rename = "GY")] - Gy, - #[serde(rename = "HK")] - Hk, - #[serde(rename = "HN")] - Hn, - #[serde(rename = "HR")] - Hr, - #[serde(rename = "HT")] - Ht, - #[serde(rename = "HU")] - Hu, - #[serde(rename = "ID")] - Id, - #[serde(rename = "IE")] - Ie, - #[serde(rename = "IL")] - Il, - #[serde(rename = "IM")] - Im, - #[serde(rename = "IN")] - In, - #[serde(rename = "IO")] - Io, - #[serde(rename = "IQ")] - Iq, - #[serde(rename = "IS")] - Is, - #[serde(rename = "IT")] - It, - #[serde(rename = "JE")] - Je, - #[serde(rename = "JM")] - Jm, - #[serde(rename = "JO")] - Jo, - #[serde(rename = "JP")] - Jp, - #[serde(rename = "KE")] - Ke, - #[serde(rename = "KG")] - Kg, - #[serde(rename = "KH")] - Kh, - #[serde(rename = "KI")] - Ki, - #[serde(rename = "KM")] - Km, - #[serde(rename = "KN")] - Kn, - #[serde(rename = "KR")] - Kr, - #[serde(rename = "KW")] - Kw, - #[serde(rename = "KY")] - Ky, - #[serde(rename = "KZ")] - Kz, - #[serde(rename = "LA")] - La, - #[serde(rename = "LB")] - Lb, - #[serde(rename = "LC")] - Lc, - #[serde(rename = "LI")] - Li, - #[serde(rename = "LK")] - Lk, - #[serde(rename = "LR")] - Lr, - #[serde(rename = "LS")] - Ls, - #[serde(rename = "LT")] - Lt, - #[serde(rename = "LU")] - Lu, - #[serde(rename = "LV")] - Lv, - #[serde(rename = "LY")] - Ly, - #[serde(rename = "MA")] - Ma, - #[serde(rename = "MC")] - Mc, - #[serde(rename = "MD")] - Md, - #[serde(rename = "ME")] - Me, - #[serde(rename = "MF")] - Mf, - #[serde(rename = "MG")] - Mg, - #[serde(rename = "MK")] - Mk, - #[serde(rename = "ML")] - Ml, - #[serde(rename = "MM")] - Mm, - #[serde(rename = "MN")] - Mn, - #[serde(rename = "MO")] - Mo, - #[serde(rename = "MQ")] - Mq, - #[serde(rename = "MR")] - Mr, - #[serde(rename = "MS")] - Ms, - #[serde(rename = "MT")] - Mt, - #[serde(rename = "MU")] - Mu, - #[serde(rename = "MV")] - Mv, - #[serde(rename = "MW")] - Mw, - #[serde(rename = "MX")] - Mx, - #[serde(rename = "MY")] - My, - #[serde(rename = "MZ")] - Mz, - #[serde(rename = "NA")] - Na, - #[serde(rename = "NC")] - Nc, - #[serde(rename = "NE")] - Ne, - #[serde(rename = "NG")] - Ng, - #[serde(rename = "NI")] - Ni, - #[serde(rename = "NL")] - Nl, - #[serde(rename = "NO")] - No, - #[serde(rename = "NP")] - Np, - #[serde(rename = "NR")] - Nr, - #[serde(rename = "NU")] - Nu, - #[serde(rename = "NZ")] - Nz, - #[serde(rename = "OM")] - Om, - #[serde(rename = "PA")] - Pa, - #[serde(rename = "PE")] - Pe, - #[serde(rename = "PF")] - Pf, - #[serde(rename = "PG")] - Pg, - #[serde(rename = "PH")] - Ph, - #[serde(rename = "PK")] - Pk, - #[serde(rename = "PL")] - Pl, - #[serde(rename = "PM")] - Pm, - #[serde(rename = "PN")] - Pn, - #[serde(rename = "PR")] - Pr, - #[serde(rename = "PS")] - Ps, - #[serde(rename = "PT")] - Pt, - #[serde(rename = "PY")] - Py, - #[serde(rename = "QA")] - Qa, - #[serde(rename = "RE")] - Re, - #[serde(rename = "RO")] - Ro, - #[serde(rename = "RS")] - Rs, - #[serde(rename = "RU")] - Ru, - #[serde(rename = "RW")] - Rw, - #[serde(rename = "SA")] - Sa, - #[serde(rename = "SB")] - Sb, - #[serde(rename = "SC")] - Sc, - #[serde(rename = "SE")] - Se, - #[serde(rename = "SG")] - Sg, - #[serde(rename = "SH")] - Sh, - #[serde(rename = "SI")] - Si, - #[serde(rename = "SJ")] - Sj, - #[serde(rename = "SK")] - Sk, - #[serde(rename = "SL")] - Sl, - #[serde(rename = "SM")] - Sm, - #[serde(rename = "SN")] - Sn, - #[serde(rename = "SO")] - So, - #[serde(rename = "SR")] - Sr, - #[serde(rename = "SS")] - Ss, - #[serde(rename = "ST")] - St, - #[serde(rename = "SV")] - Sv, - #[serde(rename = "SX")] - Sx, - #[serde(rename = "SZ")] - Sz, - #[serde(rename = "TA")] - Ta, - #[serde(rename = "TC")] - Tc, - #[serde(rename = "TD")] - Td, - #[serde(rename = "TF")] - Tf, - #[serde(rename = "TG")] - Tg, - #[serde(rename = "TH")] - Th, - #[serde(rename = "TJ")] - Tj, - #[serde(rename = "TK")] - Tk, - #[serde(rename = "TL")] - Tl, - #[serde(rename = "TM")] - Tm, - #[serde(rename = "TN")] - Tn, - #[serde(rename = "TO")] - To, - #[serde(rename = "TR")] - Tr, - #[serde(rename = "TT")] - Tt, - #[serde(rename = "TV")] - Tv, - #[serde(rename = "TW")] - Tw, - #[serde(rename = "TZ")] - Tz, - #[serde(rename = "UA")] - Ua, - #[serde(rename = "UG")] - Ug, - #[serde(rename = "US")] - Us, - #[serde(rename = "UY")] - Uy, - #[serde(rename = "UZ")] - Uz, - #[serde(rename = "VA")] - Va, - #[serde(rename = "VC")] - Vc, - #[serde(rename = "VE")] - Ve, - #[serde(rename = "VG")] - Vg, - #[serde(rename = "VN")] - Vn, - #[serde(rename = "VU")] - Vu, - #[serde(rename = "WF")] - Wf, - #[serde(rename = "WS")] - Ws, - #[serde(rename = "XK")] - Xk, - #[serde(rename = "YE")] - Ye, - #[serde(rename = "YT")] - Yt, - #[serde(rename = "ZA")] - Za, - #[serde(rename = "ZM")] - Zm, - #[serde(rename = "ZW")] - Zw, - #[serde(rename = "ZZ")] - Zz, -} - -impl CreateCheckoutSessionShippingAddressCollectionAllowedCountries { - pub fn as_str(self) -> &'static str { - match self { - CreateCheckoutSessionShippingAddressCollectionAllowedCountries::Ac => "AC", - CreateCheckoutSessionShippingAddressCollectionAllowedCountries::Ad => "AD", - CreateCheckoutSessionShippingAddressCollectionAllowedCountries::Ae => "AE", - CreateCheckoutSessionShippingAddressCollectionAllowedCountries::Af => "AF", - CreateCheckoutSessionShippingAddressCollectionAllowedCountries::Ag => "AG", - CreateCheckoutSessionShippingAddressCollectionAllowedCountries::Ai => "AI", - CreateCheckoutSessionShippingAddressCollectionAllowedCountries::Al => "AL", - CreateCheckoutSessionShippingAddressCollectionAllowedCountries::Am => "AM", - CreateCheckoutSessionShippingAddressCollectionAllowedCountries::Ao => "AO", - CreateCheckoutSessionShippingAddressCollectionAllowedCountries::Aq => "AQ", - CreateCheckoutSessionShippingAddressCollectionAllowedCountries::Ar => "AR", - CreateCheckoutSessionShippingAddressCollectionAllowedCountries::At => "AT", - CreateCheckoutSessionShippingAddressCollectionAllowedCountries::Au => "AU", - CreateCheckoutSessionShippingAddressCollectionAllowedCountries::Aw => "AW", - CreateCheckoutSessionShippingAddressCollectionAllowedCountries::Ax => "AX", - CreateCheckoutSessionShippingAddressCollectionAllowedCountries::Az => "AZ", - CreateCheckoutSessionShippingAddressCollectionAllowedCountries::Ba => "BA", - CreateCheckoutSessionShippingAddressCollectionAllowedCountries::Bb => "BB", - CreateCheckoutSessionShippingAddressCollectionAllowedCountries::Bd => "BD", - CreateCheckoutSessionShippingAddressCollectionAllowedCountries::Be => "BE", - CreateCheckoutSessionShippingAddressCollectionAllowedCountries::Bf => "BF", - CreateCheckoutSessionShippingAddressCollectionAllowedCountries::Bg => "BG", - CreateCheckoutSessionShippingAddressCollectionAllowedCountries::Bh => "BH", - CreateCheckoutSessionShippingAddressCollectionAllowedCountries::Bi => "BI", - CreateCheckoutSessionShippingAddressCollectionAllowedCountries::Bj => "BJ", - CreateCheckoutSessionShippingAddressCollectionAllowedCountries::Bl => "BL", - CreateCheckoutSessionShippingAddressCollectionAllowedCountries::Bm => "BM", - CreateCheckoutSessionShippingAddressCollectionAllowedCountries::Bn => "BN", - CreateCheckoutSessionShippingAddressCollectionAllowedCountries::Bo => "BO", - CreateCheckoutSessionShippingAddressCollectionAllowedCountries::Bq => "BQ", - CreateCheckoutSessionShippingAddressCollectionAllowedCountries::Br => "BR", - CreateCheckoutSessionShippingAddressCollectionAllowedCountries::Bs => "BS", - CreateCheckoutSessionShippingAddressCollectionAllowedCountries::Bt => "BT", - CreateCheckoutSessionShippingAddressCollectionAllowedCountries::Bv => "BV", - CreateCheckoutSessionShippingAddressCollectionAllowedCountries::Bw => "BW", - CreateCheckoutSessionShippingAddressCollectionAllowedCountries::By => "BY", - CreateCheckoutSessionShippingAddressCollectionAllowedCountries::Bz => "BZ", - CreateCheckoutSessionShippingAddressCollectionAllowedCountries::Ca => "CA", - CreateCheckoutSessionShippingAddressCollectionAllowedCountries::Cd => "CD", - CreateCheckoutSessionShippingAddressCollectionAllowedCountries::Cf => "CF", - CreateCheckoutSessionShippingAddressCollectionAllowedCountries::Cg => "CG", - CreateCheckoutSessionShippingAddressCollectionAllowedCountries::Ch => "CH", - CreateCheckoutSessionShippingAddressCollectionAllowedCountries::Ci => "CI", - CreateCheckoutSessionShippingAddressCollectionAllowedCountries::Ck => "CK", - CreateCheckoutSessionShippingAddressCollectionAllowedCountries::Cl => "CL", - CreateCheckoutSessionShippingAddressCollectionAllowedCountries::Cm => "CM", - CreateCheckoutSessionShippingAddressCollectionAllowedCountries::Cn => "CN", - CreateCheckoutSessionShippingAddressCollectionAllowedCountries::Co => "CO", - CreateCheckoutSessionShippingAddressCollectionAllowedCountries::Cr => "CR", - CreateCheckoutSessionShippingAddressCollectionAllowedCountries::Cv => "CV", - CreateCheckoutSessionShippingAddressCollectionAllowedCountries::Cw => "CW", - CreateCheckoutSessionShippingAddressCollectionAllowedCountries::Cy => "CY", - CreateCheckoutSessionShippingAddressCollectionAllowedCountries::Cz => "CZ", - CreateCheckoutSessionShippingAddressCollectionAllowedCountries::De => "DE", - CreateCheckoutSessionShippingAddressCollectionAllowedCountries::Dj => "DJ", - CreateCheckoutSessionShippingAddressCollectionAllowedCountries::Dk => "DK", - CreateCheckoutSessionShippingAddressCollectionAllowedCountries::Dm => "DM", - CreateCheckoutSessionShippingAddressCollectionAllowedCountries::Do => "DO", - CreateCheckoutSessionShippingAddressCollectionAllowedCountries::Dz => "DZ", - CreateCheckoutSessionShippingAddressCollectionAllowedCountries::Ec => "EC", - CreateCheckoutSessionShippingAddressCollectionAllowedCountries::Ee => "EE", - CreateCheckoutSessionShippingAddressCollectionAllowedCountries::Eg => "EG", - CreateCheckoutSessionShippingAddressCollectionAllowedCountries::Eh => "EH", - CreateCheckoutSessionShippingAddressCollectionAllowedCountries::Er => "ER", - CreateCheckoutSessionShippingAddressCollectionAllowedCountries::Es => "ES", - CreateCheckoutSessionShippingAddressCollectionAllowedCountries::Et => "ET", - CreateCheckoutSessionShippingAddressCollectionAllowedCountries::Fi => "FI", - CreateCheckoutSessionShippingAddressCollectionAllowedCountries::Fj => "FJ", - CreateCheckoutSessionShippingAddressCollectionAllowedCountries::Fk => "FK", - CreateCheckoutSessionShippingAddressCollectionAllowedCountries::Fo => "FO", - CreateCheckoutSessionShippingAddressCollectionAllowedCountries::Fr => "FR", - CreateCheckoutSessionShippingAddressCollectionAllowedCountries::Ga => "GA", - CreateCheckoutSessionShippingAddressCollectionAllowedCountries::Gb => "GB", - CreateCheckoutSessionShippingAddressCollectionAllowedCountries::Gd => "GD", - CreateCheckoutSessionShippingAddressCollectionAllowedCountries::Ge => "GE", - CreateCheckoutSessionShippingAddressCollectionAllowedCountries::Gf => "GF", - CreateCheckoutSessionShippingAddressCollectionAllowedCountries::Gg => "GG", - CreateCheckoutSessionShippingAddressCollectionAllowedCountries::Gh => "GH", - CreateCheckoutSessionShippingAddressCollectionAllowedCountries::Gi => "GI", - CreateCheckoutSessionShippingAddressCollectionAllowedCountries::Gl => "GL", - CreateCheckoutSessionShippingAddressCollectionAllowedCountries::Gm => "GM", - CreateCheckoutSessionShippingAddressCollectionAllowedCountries::Gn => "GN", - CreateCheckoutSessionShippingAddressCollectionAllowedCountries::Gp => "GP", - CreateCheckoutSessionShippingAddressCollectionAllowedCountries::Gq => "GQ", - CreateCheckoutSessionShippingAddressCollectionAllowedCountries::Gr => "GR", - CreateCheckoutSessionShippingAddressCollectionAllowedCountries::Gs => "GS", - CreateCheckoutSessionShippingAddressCollectionAllowedCountries::Gt => "GT", - CreateCheckoutSessionShippingAddressCollectionAllowedCountries::Gu => "GU", - CreateCheckoutSessionShippingAddressCollectionAllowedCountries::Gw => "GW", - CreateCheckoutSessionShippingAddressCollectionAllowedCountries::Gy => "GY", - CreateCheckoutSessionShippingAddressCollectionAllowedCountries::Hk => "HK", - CreateCheckoutSessionShippingAddressCollectionAllowedCountries::Hn => "HN", - CreateCheckoutSessionShippingAddressCollectionAllowedCountries::Hr => "HR", - CreateCheckoutSessionShippingAddressCollectionAllowedCountries::Ht => "HT", - CreateCheckoutSessionShippingAddressCollectionAllowedCountries::Hu => "HU", - CreateCheckoutSessionShippingAddressCollectionAllowedCountries::Id => "ID", - CreateCheckoutSessionShippingAddressCollectionAllowedCountries::Ie => "IE", - CreateCheckoutSessionShippingAddressCollectionAllowedCountries::Il => "IL", - CreateCheckoutSessionShippingAddressCollectionAllowedCountries::Im => "IM", - CreateCheckoutSessionShippingAddressCollectionAllowedCountries::In => "IN", - CreateCheckoutSessionShippingAddressCollectionAllowedCountries::Io => "IO", - CreateCheckoutSessionShippingAddressCollectionAllowedCountries::Iq => "IQ", - CreateCheckoutSessionShippingAddressCollectionAllowedCountries::Is => "IS", - CreateCheckoutSessionShippingAddressCollectionAllowedCountries::It => "IT", - CreateCheckoutSessionShippingAddressCollectionAllowedCountries::Je => "JE", - CreateCheckoutSessionShippingAddressCollectionAllowedCountries::Jm => "JM", - CreateCheckoutSessionShippingAddressCollectionAllowedCountries::Jo => "JO", - CreateCheckoutSessionShippingAddressCollectionAllowedCountries::Jp => "JP", - CreateCheckoutSessionShippingAddressCollectionAllowedCountries::Ke => "KE", - CreateCheckoutSessionShippingAddressCollectionAllowedCountries::Kg => "KG", - CreateCheckoutSessionShippingAddressCollectionAllowedCountries::Kh => "KH", - CreateCheckoutSessionShippingAddressCollectionAllowedCountries::Ki => "KI", - CreateCheckoutSessionShippingAddressCollectionAllowedCountries::Km => "KM", - CreateCheckoutSessionShippingAddressCollectionAllowedCountries::Kn => "KN", - CreateCheckoutSessionShippingAddressCollectionAllowedCountries::Kr => "KR", - CreateCheckoutSessionShippingAddressCollectionAllowedCountries::Kw => "KW", - CreateCheckoutSessionShippingAddressCollectionAllowedCountries::Ky => "KY", - CreateCheckoutSessionShippingAddressCollectionAllowedCountries::Kz => "KZ", - CreateCheckoutSessionShippingAddressCollectionAllowedCountries::La => "LA", - CreateCheckoutSessionShippingAddressCollectionAllowedCountries::Lb => "LB", - CreateCheckoutSessionShippingAddressCollectionAllowedCountries::Lc => "LC", - CreateCheckoutSessionShippingAddressCollectionAllowedCountries::Li => "LI", - CreateCheckoutSessionShippingAddressCollectionAllowedCountries::Lk => "LK", - CreateCheckoutSessionShippingAddressCollectionAllowedCountries::Lr => "LR", - CreateCheckoutSessionShippingAddressCollectionAllowedCountries::Ls => "LS", - CreateCheckoutSessionShippingAddressCollectionAllowedCountries::Lt => "LT", - CreateCheckoutSessionShippingAddressCollectionAllowedCountries::Lu => "LU", - CreateCheckoutSessionShippingAddressCollectionAllowedCountries::Lv => "LV", - CreateCheckoutSessionShippingAddressCollectionAllowedCountries::Ly => "LY", - CreateCheckoutSessionShippingAddressCollectionAllowedCountries::Ma => "MA", - CreateCheckoutSessionShippingAddressCollectionAllowedCountries::Mc => "MC", - CreateCheckoutSessionShippingAddressCollectionAllowedCountries::Md => "MD", - CreateCheckoutSessionShippingAddressCollectionAllowedCountries::Me => "ME", - CreateCheckoutSessionShippingAddressCollectionAllowedCountries::Mf => "MF", - CreateCheckoutSessionShippingAddressCollectionAllowedCountries::Mg => "MG", - CreateCheckoutSessionShippingAddressCollectionAllowedCountries::Mk => "MK", - CreateCheckoutSessionShippingAddressCollectionAllowedCountries::Ml => "ML", - CreateCheckoutSessionShippingAddressCollectionAllowedCountries::Mm => "MM", - CreateCheckoutSessionShippingAddressCollectionAllowedCountries::Mn => "MN", - CreateCheckoutSessionShippingAddressCollectionAllowedCountries::Mo => "MO", - CreateCheckoutSessionShippingAddressCollectionAllowedCountries::Mq => "MQ", - CreateCheckoutSessionShippingAddressCollectionAllowedCountries::Mr => "MR", - CreateCheckoutSessionShippingAddressCollectionAllowedCountries::Ms => "MS", - CreateCheckoutSessionShippingAddressCollectionAllowedCountries::Mt => "MT", - CreateCheckoutSessionShippingAddressCollectionAllowedCountries::Mu => "MU", - CreateCheckoutSessionShippingAddressCollectionAllowedCountries::Mv => "MV", - CreateCheckoutSessionShippingAddressCollectionAllowedCountries::Mw => "MW", - CreateCheckoutSessionShippingAddressCollectionAllowedCountries::Mx => "MX", - CreateCheckoutSessionShippingAddressCollectionAllowedCountries::My => "MY", - CreateCheckoutSessionShippingAddressCollectionAllowedCountries::Mz => "MZ", - CreateCheckoutSessionShippingAddressCollectionAllowedCountries::Na => "NA", - CreateCheckoutSessionShippingAddressCollectionAllowedCountries::Nc => "NC", - CreateCheckoutSessionShippingAddressCollectionAllowedCountries::Ne => "NE", - CreateCheckoutSessionShippingAddressCollectionAllowedCountries::Ng => "NG", - CreateCheckoutSessionShippingAddressCollectionAllowedCountries::Ni => "NI", - CreateCheckoutSessionShippingAddressCollectionAllowedCountries::Nl => "NL", - CreateCheckoutSessionShippingAddressCollectionAllowedCountries::No => "NO", - CreateCheckoutSessionShippingAddressCollectionAllowedCountries::Np => "NP", - CreateCheckoutSessionShippingAddressCollectionAllowedCountries::Nr => "NR", - CreateCheckoutSessionShippingAddressCollectionAllowedCountries::Nu => "NU", - CreateCheckoutSessionShippingAddressCollectionAllowedCountries::Nz => "NZ", - CreateCheckoutSessionShippingAddressCollectionAllowedCountries::Om => "OM", - CreateCheckoutSessionShippingAddressCollectionAllowedCountries::Pa => "PA", - CreateCheckoutSessionShippingAddressCollectionAllowedCountries::Pe => "PE", - CreateCheckoutSessionShippingAddressCollectionAllowedCountries::Pf => "PF", - CreateCheckoutSessionShippingAddressCollectionAllowedCountries::Pg => "PG", - CreateCheckoutSessionShippingAddressCollectionAllowedCountries::Ph => "PH", - CreateCheckoutSessionShippingAddressCollectionAllowedCountries::Pk => "PK", - CreateCheckoutSessionShippingAddressCollectionAllowedCountries::Pl => "PL", - CreateCheckoutSessionShippingAddressCollectionAllowedCountries::Pm => "PM", - CreateCheckoutSessionShippingAddressCollectionAllowedCountries::Pn => "PN", - CreateCheckoutSessionShippingAddressCollectionAllowedCountries::Pr => "PR", - CreateCheckoutSessionShippingAddressCollectionAllowedCountries::Ps => "PS", - CreateCheckoutSessionShippingAddressCollectionAllowedCountries::Pt => "PT", - CreateCheckoutSessionShippingAddressCollectionAllowedCountries::Py => "PY", - CreateCheckoutSessionShippingAddressCollectionAllowedCountries::Qa => "QA", - CreateCheckoutSessionShippingAddressCollectionAllowedCountries::Re => "RE", - CreateCheckoutSessionShippingAddressCollectionAllowedCountries::Ro => "RO", - CreateCheckoutSessionShippingAddressCollectionAllowedCountries::Rs => "RS", - CreateCheckoutSessionShippingAddressCollectionAllowedCountries::Ru => "RU", - CreateCheckoutSessionShippingAddressCollectionAllowedCountries::Rw => "RW", - CreateCheckoutSessionShippingAddressCollectionAllowedCountries::Sa => "SA", - CreateCheckoutSessionShippingAddressCollectionAllowedCountries::Sb => "SB", - CreateCheckoutSessionShippingAddressCollectionAllowedCountries::Sc => "SC", - CreateCheckoutSessionShippingAddressCollectionAllowedCountries::Se => "SE", - CreateCheckoutSessionShippingAddressCollectionAllowedCountries::Sg => "SG", - CreateCheckoutSessionShippingAddressCollectionAllowedCountries::Sh => "SH", - CreateCheckoutSessionShippingAddressCollectionAllowedCountries::Si => "SI", - CreateCheckoutSessionShippingAddressCollectionAllowedCountries::Sj => "SJ", - CreateCheckoutSessionShippingAddressCollectionAllowedCountries::Sk => "SK", - CreateCheckoutSessionShippingAddressCollectionAllowedCountries::Sl => "SL", - CreateCheckoutSessionShippingAddressCollectionAllowedCountries::Sm => "SM", - CreateCheckoutSessionShippingAddressCollectionAllowedCountries::Sn => "SN", - CreateCheckoutSessionShippingAddressCollectionAllowedCountries::So => "SO", - CreateCheckoutSessionShippingAddressCollectionAllowedCountries::Sr => "SR", - CreateCheckoutSessionShippingAddressCollectionAllowedCountries::Ss => "SS", - CreateCheckoutSessionShippingAddressCollectionAllowedCountries::St => "ST", - CreateCheckoutSessionShippingAddressCollectionAllowedCountries::Sv => "SV", - CreateCheckoutSessionShippingAddressCollectionAllowedCountries::Sx => "SX", - CreateCheckoutSessionShippingAddressCollectionAllowedCountries::Sz => "SZ", - CreateCheckoutSessionShippingAddressCollectionAllowedCountries::Ta => "TA", - CreateCheckoutSessionShippingAddressCollectionAllowedCountries::Tc => "TC", - CreateCheckoutSessionShippingAddressCollectionAllowedCountries::Td => "TD", - CreateCheckoutSessionShippingAddressCollectionAllowedCountries::Tf => "TF", - CreateCheckoutSessionShippingAddressCollectionAllowedCountries::Tg => "TG", - CreateCheckoutSessionShippingAddressCollectionAllowedCountries::Th => "TH", - CreateCheckoutSessionShippingAddressCollectionAllowedCountries::Tj => "TJ", - CreateCheckoutSessionShippingAddressCollectionAllowedCountries::Tk => "TK", - CreateCheckoutSessionShippingAddressCollectionAllowedCountries::Tl => "TL", - CreateCheckoutSessionShippingAddressCollectionAllowedCountries::Tm => "TM", - CreateCheckoutSessionShippingAddressCollectionAllowedCountries::Tn => "TN", - CreateCheckoutSessionShippingAddressCollectionAllowedCountries::To => "TO", - CreateCheckoutSessionShippingAddressCollectionAllowedCountries::Tr => "TR", - CreateCheckoutSessionShippingAddressCollectionAllowedCountries::Tt => "TT", - CreateCheckoutSessionShippingAddressCollectionAllowedCountries::Tv => "TV", - CreateCheckoutSessionShippingAddressCollectionAllowedCountries::Tw => "TW", - CreateCheckoutSessionShippingAddressCollectionAllowedCountries::Tz => "TZ", - CreateCheckoutSessionShippingAddressCollectionAllowedCountries::Ua => "UA", - CreateCheckoutSessionShippingAddressCollectionAllowedCountries::Ug => "UG", - CreateCheckoutSessionShippingAddressCollectionAllowedCountries::Us => "US", - CreateCheckoutSessionShippingAddressCollectionAllowedCountries::Uy => "UY", - CreateCheckoutSessionShippingAddressCollectionAllowedCountries::Uz => "UZ", - CreateCheckoutSessionShippingAddressCollectionAllowedCountries::Va => "VA", - CreateCheckoutSessionShippingAddressCollectionAllowedCountries::Vc => "VC", - CreateCheckoutSessionShippingAddressCollectionAllowedCountries::Ve => "VE", - CreateCheckoutSessionShippingAddressCollectionAllowedCountries::Vg => "VG", - CreateCheckoutSessionShippingAddressCollectionAllowedCountries::Vn => "VN", - CreateCheckoutSessionShippingAddressCollectionAllowedCountries::Vu => "VU", - CreateCheckoutSessionShippingAddressCollectionAllowedCountries::Wf => "WF", - CreateCheckoutSessionShippingAddressCollectionAllowedCountries::Ws => "WS", - CreateCheckoutSessionShippingAddressCollectionAllowedCountries::Xk => "XK", - CreateCheckoutSessionShippingAddressCollectionAllowedCountries::Ye => "YE", - CreateCheckoutSessionShippingAddressCollectionAllowedCountries::Yt => "YT", - CreateCheckoutSessionShippingAddressCollectionAllowedCountries::Za => "ZA", - CreateCheckoutSessionShippingAddressCollectionAllowedCountries::Zm => "ZM", - CreateCheckoutSessionShippingAddressCollectionAllowedCountries::Zw => "ZW", - CreateCheckoutSessionShippingAddressCollectionAllowedCountries::Zz => "ZZ", - } - } -} - -impl AsRef for CreateCheckoutSessionShippingAddressCollectionAllowedCountries { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for CreateCheckoutSessionShippingAddressCollectionAllowedCountries { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for CreateCheckoutSessionShippingAddressCollectionAllowedCountries { - fn default() -> Self { - Self::Ac - } -} - -/// An enum representing the possible values of an `CreateCheckoutSessionShippingOptionsShippingRateDataDeliveryEstimateMaximum`'s `unit` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CreateCheckoutSessionShippingOptionsShippingRateDataDeliveryEstimateMaximumUnit { - BusinessDay, - Day, - Hour, - Month, - Week, -} - -impl CreateCheckoutSessionShippingOptionsShippingRateDataDeliveryEstimateMaximumUnit { - pub fn as_str(self) -> &'static str { - match self { - CreateCheckoutSessionShippingOptionsShippingRateDataDeliveryEstimateMaximumUnit::BusinessDay => "business_day", - CreateCheckoutSessionShippingOptionsShippingRateDataDeliveryEstimateMaximumUnit::Day => "day", - CreateCheckoutSessionShippingOptionsShippingRateDataDeliveryEstimateMaximumUnit::Hour => "hour", - CreateCheckoutSessionShippingOptionsShippingRateDataDeliveryEstimateMaximumUnit::Month => "month", - CreateCheckoutSessionShippingOptionsShippingRateDataDeliveryEstimateMaximumUnit::Week => "week", - } - } -} - -impl AsRef - for CreateCheckoutSessionShippingOptionsShippingRateDataDeliveryEstimateMaximumUnit -{ - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display - for CreateCheckoutSessionShippingOptionsShippingRateDataDeliveryEstimateMaximumUnit -{ - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default - for CreateCheckoutSessionShippingOptionsShippingRateDataDeliveryEstimateMaximumUnit -{ - fn default() -> Self { - Self::BusinessDay - } -} - -/// An enum representing the possible values of an `CreateCheckoutSessionShippingOptionsShippingRateDataDeliveryEstimateMinimum`'s `unit` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CreateCheckoutSessionShippingOptionsShippingRateDataDeliveryEstimateMinimumUnit { - BusinessDay, - Day, - Hour, - Month, - Week, -} - -impl CreateCheckoutSessionShippingOptionsShippingRateDataDeliveryEstimateMinimumUnit { - pub fn as_str(self) -> &'static str { - match self { - CreateCheckoutSessionShippingOptionsShippingRateDataDeliveryEstimateMinimumUnit::BusinessDay => "business_day", - CreateCheckoutSessionShippingOptionsShippingRateDataDeliveryEstimateMinimumUnit::Day => "day", - CreateCheckoutSessionShippingOptionsShippingRateDataDeliveryEstimateMinimumUnit::Hour => "hour", - CreateCheckoutSessionShippingOptionsShippingRateDataDeliveryEstimateMinimumUnit::Month => "month", - CreateCheckoutSessionShippingOptionsShippingRateDataDeliveryEstimateMinimumUnit::Week => "week", - } - } -} - -impl AsRef - for CreateCheckoutSessionShippingOptionsShippingRateDataDeliveryEstimateMinimumUnit -{ - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display - for CreateCheckoutSessionShippingOptionsShippingRateDataDeliveryEstimateMinimumUnit -{ - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default - for CreateCheckoutSessionShippingOptionsShippingRateDataDeliveryEstimateMinimumUnit -{ - fn default() -> Self { - Self::BusinessDay - } -} - -/// An enum representing the possible values of an `CreateCheckoutSessionShippingOptionsShippingRateDataFixedAmountCurrencyOptions`'s `tax_behavior` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CreateCheckoutSessionShippingOptionsShippingRateDataFixedAmountCurrencyOptionsTaxBehavior { - Exclusive, - Inclusive, - Unspecified, -} - -impl CreateCheckoutSessionShippingOptionsShippingRateDataFixedAmountCurrencyOptionsTaxBehavior { - pub fn as_str(self) -> &'static str { - match self { - CreateCheckoutSessionShippingOptionsShippingRateDataFixedAmountCurrencyOptionsTaxBehavior::Exclusive => "exclusive", - CreateCheckoutSessionShippingOptionsShippingRateDataFixedAmountCurrencyOptionsTaxBehavior::Inclusive => "inclusive", - CreateCheckoutSessionShippingOptionsShippingRateDataFixedAmountCurrencyOptionsTaxBehavior::Unspecified => "unspecified", - } - } -} - -impl AsRef - for CreateCheckoutSessionShippingOptionsShippingRateDataFixedAmountCurrencyOptionsTaxBehavior -{ - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display - for CreateCheckoutSessionShippingOptionsShippingRateDataFixedAmountCurrencyOptionsTaxBehavior -{ - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default - for CreateCheckoutSessionShippingOptionsShippingRateDataFixedAmountCurrencyOptionsTaxBehavior -{ - fn default() -> Self { - Self::Exclusive - } -} - -/// An enum representing the possible values of an `CreateCheckoutSessionShippingOptionsShippingRateData`'s `tax_behavior` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CreateCheckoutSessionShippingOptionsShippingRateDataTaxBehavior { - Exclusive, - Inclusive, - Unspecified, -} - -impl CreateCheckoutSessionShippingOptionsShippingRateDataTaxBehavior { - pub fn as_str(self) -> &'static str { - match self { - CreateCheckoutSessionShippingOptionsShippingRateDataTaxBehavior::Exclusive => { - "exclusive" - } - CreateCheckoutSessionShippingOptionsShippingRateDataTaxBehavior::Inclusive => { - "inclusive" - } - CreateCheckoutSessionShippingOptionsShippingRateDataTaxBehavior::Unspecified => { - "unspecified" - } - } - } -} - -impl AsRef for CreateCheckoutSessionShippingOptionsShippingRateDataTaxBehavior { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for CreateCheckoutSessionShippingOptionsShippingRateDataTaxBehavior { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for CreateCheckoutSessionShippingOptionsShippingRateDataTaxBehavior { - fn default() -> Self { - Self::Exclusive - } -} - -/// An enum representing the possible values of an `CreateCheckoutSessionShippingOptionsShippingRateData`'s `type` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CreateCheckoutSessionShippingOptionsShippingRateDataType { - FixedAmount, -} - -impl CreateCheckoutSessionShippingOptionsShippingRateDataType { - pub fn as_str(self) -> &'static str { - match self { - CreateCheckoutSessionShippingOptionsShippingRateDataType::FixedAmount => "fixed_amount", - } - } -} - -impl AsRef for CreateCheckoutSessionShippingOptionsShippingRateDataType { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for CreateCheckoutSessionShippingOptionsShippingRateDataType { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for CreateCheckoutSessionShippingOptionsShippingRateDataType { - fn default() -> Self { - Self::FixedAmount - } -} - -/// An enum representing the possible values of an `CreateCheckoutSessionSubscriptionDataInvoiceSettingsIssuer`'s `type` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CreateCheckoutSessionSubscriptionDataInvoiceSettingsIssuerType { - Account, - #[serde(rename = "self")] - Self_, -} - -impl CreateCheckoutSessionSubscriptionDataInvoiceSettingsIssuerType { - pub fn as_str(self) -> &'static str { - match self { - CreateCheckoutSessionSubscriptionDataInvoiceSettingsIssuerType::Account => "account", - CreateCheckoutSessionSubscriptionDataInvoiceSettingsIssuerType::Self_ => "self", - } - } -} - -impl AsRef for CreateCheckoutSessionSubscriptionDataInvoiceSettingsIssuerType { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for CreateCheckoutSessionSubscriptionDataInvoiceSettingsIssuerType { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for CreateCheckoutSessionSubscriptionDataInvoiceSettingsIssuerType { - fn default() -> Self { - Self::Account - } -} - -/// An enum representing the possible values of an `CreateCheckoutSessionSubscriptionData`'s `proration_behavior` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CreateCheckoutSessionSubscriptionDataProrationBehavior { - CreateProrations, - None, -} - -impl CreateCheckoutSessionSubscriptionDataProrationBehavior { - pub fn as_str(self) -> &'static str { - match self { - CreateCheckoutSessionSubscriptionDataProrationBehavior::CreateProrations => { - "create_prorations" - } - CreateCheckoutSessionSubscriptionDataProrationBehavior::None => "none", - } - } -} - -impl AsRef for CreateCheckoutSessionSubscriptionDataProrationBehavior { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for CreateCheckoutSessionSubscriptionDataProrationBehavior { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for CreateCheckoutSessionSubscriptionDataProrationBehavior { - fn default() -> Self { - Self::CreateProrations - } -} - -/// An enum representing the possible values of an `CreateCheckoutSessionSubscriptionDataTrialSettingsEndBehavior`'s `missing_payment_method` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CreateCheckoutSessionSubscriptionDataTrialSettingsEndBehaviorMissingPaymentMethod { - Cancel, - CreateInvoice, - Pause, -} - -impl CreateCheckoutSessionSubscriptionDataTrialSettingsEndBehaviorMissingPaymentMethod { - pub fn as_str(self) -> &'static str { - match self { - CreateCheckoutSessionSubscriptionDataTrialSettingsEndBehaviorMissingPaymentMethod::Cancel => "cancel", - CreateCheckoutSessionSubscriptionDataTrialSettingsEndBehaviorMissingPaymentMethod::CreateInvoice => "create_invoice", - CreateCheckoutSessionSubscriptionDataTrialSettingsEndBehaviorMissingPaymentMethod::Pause => "pause", - } - } -} - -impl AsRef - for CreateCheckoutSessionSubscriptionDataTrialSettingsEndBehaviorMissingPaymentMethod -{ - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display - for CreateCheckoutSessionSubscriptionDataTrialSettingsEndBehaviorMissingPaymentMethod -{ - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default - for CreateCheckoutSessionSubscriptionDataTrialSettingsEndBehaviorMissingPaymentMethod -{ - fn default() -> Self { - Self::Cancel - } -} - -/// An enum representing the possible values of an `LineItemsTaxAmount`'s `taxability_reason` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum LineItemsTaxAmountTaxabilityReason { - CustomerExempt, - NotCollecting, - NotSubjectToTax, - NotSupported, - PortionProductExempt, - PortionReducedRated, - PortionStandardRated, - ProductExempt, - ProductExemptHoliday, - ProportionallyRated, - ReducedRated, - ReverseCharge, - StandardRated, - TaxableBasisReduced, - ZeroRated, -} - -impl LineItemsTaxAmountTaxabilityReason { - pub fn as_str(self) -> &'static str { - match self { - LineItemsTaxAmountTaxabilityReason::CustomerExempt => "customer_exempt", - LineItemsTaxAmountTaxabilityReason::NotCollecting => "not_collecting", - LineItemsTaxAmountTaxabilityReason::NotSubjectToTax => "not_subject_to_tax", - LineItemsTaxAmountTaxabilityReason::NotSupported => "not_supported", - LineItemsTaxAmountTaxabilityReason::PortionProductExempt => "portion_product_exempt", - LineItemsTaxAmountTaxabilityReason::PortionReducedRated => "portion_reduced_rated", - LineItemsTaxAmountTaxabilityReason::PortionStandardRated => "portion_standard_rated", - LineItemsTaxAmountTaxabilityReason::ProductExempt => "product_exempt", - LineItemsTaxAmountTaxabilityReason::ProductExemptHoliday => "product_exempt_holiday", - LineItemsTaxAmountTaxabilityReason::ProportionallyRated => "proportionally_rated", - LineItemsTaxAmountTaxabilityReason::ReducedRated => "reduced_rated", - LineItemsTaxAmountTaxabilityReason::ReverseCharge => "reverse_charge", - LineItemsTaxAmountTaxabilityReason::StandardRated => "standard_rated", - LineItemsTaxAmountTaxabilityReason::TaxableBasisReduced => "taxable_basis_reduced", - LineItemsTaxAmountTaxabilityReason::ZeroRated => "zero_rated", - } - } -} - -impl AsRef for LineItemsTaxAmountTaxabilityReason { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for LineItemsTaxAmountTaxabilityReason { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for LineItemsTaxAmountTaxabilityReason { - fn default() -> Self { - Self::CustomerExempt - } -} - -/// An enum representing the possible values of an `PaymentPagesCheckoutSessionAutomaticTax`'s `status` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum PaymentPagesCheckoutSessionAutomaticTaxStatus { - Complete, - Failed, - RequiresLocationInputs, -} - -impl PaymentPagesCheckoutSessionAutomaticTaxStatus { - pub fn as_str(self) -> &'static str { - match self { - PaymentPagesCheckoutSessionAutomaticTaxStatus::Complete => "complete", - PaymentPagesCheckoutSessionAutomaticTaxStatus::Failed => "failed", - PaymentPagesCheckoutSessionAutomaticTaxStatus::RequiresLocationInputs => { - "requires_location_inputs" - } - } - } -} - -impl AsRef for PaymentPagesCheckoutSessionAutomaticTaxStatus { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for PaymentPagesCheckoutSessionAutomaticTaxStatus { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for PaymentPagesCheckoutSessionAutomaticTaxStatus { - fn default() -> Self { - Self::Complete - } -} - -/// An enum representing the possible values of an `PaymentPagesCheckoutSessionConsentCollection`'s `promotions` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum PaymentPagesCheckoutSessionConsentCollectionPromotions { - Auto, - None, -} - -impl PaymentPagesCheckoutSessionConsentCollectionPromotions { - pub fn as_str(self) -> &'static str { - match self { - PaymentPagesCheckoutSessionConsentCollectionPromotions::Auto => "auto", - PaymentPagesCheckoutSessionConsentCollectionPromotions::None => "none", - } - } -} - -impl AsRef for PaymentPagesCheckoutSessionConsentCollectionPromotions { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for PaymentPagesCheckoutSessionConsentCollectionPromotions { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for PaymentPagesCheckoutSessionConsentCollectionPromotions { - fn default() -> Self { - Self::Auto - } -} - -/// An enum representing the possible values of an `PaymentPagesCheckoutSessionConsentCollection`'s `terms_of_service` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum PaymentPagesCheckoutSessionConsentCollectionTermsOfService { - None, - Required, -} - -impl PaymentPagesCheckoutSessionConsentCollectionTermsOfService { - pub fn as_str(self) -> &'static str { - match self { - PaymentPagesCheckoutSessionConsentCollectionTermsOfService::None => "none", - PaymentPagesCheckoutSessionConsentCollectionTermsOfService::Required => "required", - } - } -} - -impl AsRef for PaymentPagesCheckoutSessionConsentCollectionTermsOfService { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for PaymentPagesCheckoutSessionConsentCollectionTermsOfService { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for PaymentPagesCheckoutSessionConsentCollectionTermsOfService { - fn default() -> Self { - Self::None - } -} - -/// An enum representing the possible values of an `PaymentPagesCheckoutSessionConsent`'s `promotions` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum PaymentPagesCheckoutSessionConsentPromotions { - OptIn, - OptOut, -} - -impl PaymentPagesCheckoutSessionConsentPromotions { - pub fn as_str(self) -> &'static str { - match self { - PaymentPagesCheckoutSessionConsentPromotions::OptIn => "opt_in", - PaymentPagesCheckoutSessionConsentPromotions::OptOut => "opt_out", - } - } -} - -impl AsRef for PaymentPagesCheckoutSessionConsentPromotions { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for PaymentPagesCheckoutSessionConsentPromotions { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for PaymentPagesCheckoutSessionConsentPromotions { - fn default() -> Self { - Self::OptIn - } -} - -/// An enum representing the possible values of an `PaymentPagesCheckoutSessionConsent`'s `terms_of_service` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum PaymentPagesCheckoutSessionConsentTermsOfService { - Accepted, -} - -impl PaymentPagesCheckoutSessionConsentTermsOfService { - pub fn as_str(self) -> &'static str { - match self { - PaymentPagesCheckoutSessionConsentTermsOfService::Accepted => "accepted", - } - } -} - -impl AsRef for PaymentPagesCheckoutSessionConsentTermsOfService { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for PaymentPagesCheckoutSessionConsentTermsOfService { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for PaymentPagesCheckoutSessionConsentTermsOfService { - fn default() -> Self { - Self::Accepted - } -} - -/// An enum representing the possible values of an `PaymentPagesCheckoutSessionCustomFieldsLabel`'s `type` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum PaymentPagesCheckoutSessionCustomFieldsLabelType { - Custom, -} - -impl PaymentPagesCheckoutSessionCustomFieldsLabelType { - pub fn as_str(self) -> &'static str { - match self { - PaymentPagesCheckoutSessionCustomFieldsLabelType::Custom => "custom", - } - } -} - -impl AsRef for PaymentPagesCheckoutSessionCustomFieldsLabelType { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for PaymentPagesCheckoutSessionCustomFieldsLabelType { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for PaymentPagesCheckoutSessionCustomFieldsLabelType { - fn default() -> Self { - Self::Custom - } -} - -/// An enum representing the possible values of an `PaymentPagesCheckoutSessionCustomFields`'s `type` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum PaymentPagesCheckoutSessionCustomFieldsType { - Dropdown, - Numeric, - Text, -} - -impl PaymentPagesCheckoutSessionCustomFieldsType { - pub fn as_str(self) -> &'static str { - match self { - PaymentPagesCheckoutSessionCustomFieldsType::Dropdown => "dropdown", - PaymentPagesCheckoutSessionCustomFieldsType::Numeric => "numeric", - PaymentPagesCheckoutSessionCustomFieldsType::Text => "text", - } - } -} - -impl AsRef for PaymentPagesCheckoutSessionCustomFieldsType { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for PaymentPagesCheckoutSessionCustomFieldsType { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for PaymentPagesCheckoutSessionCustomFieldsType { - fn default() -> Self { - Self::Dropdown - } -} - -/// An enum representing the possible values of an `PaymentPagesCheckoutSessionCustomerDetails`'s `tax_exempt` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum PaymentPagesCheckoutSessionCustomerDetailsTaxExempt { - Exempt, - None, - Reverse, -} - -impl PaymentPagesCheckoutSessionCustomerDetailsTaxExempt { - pub fn as_str(self) -> &'static str { - match self { - PaymentPagesCheckoutSessionCustomerDetailsTaxExempt::Exempt => "exempt", - PaymentPagesCheckoutSessionCustomerDetailsTaxExempt::None => "none", - PaymentPagesCheckoutSessionCustomerDetailsTaxExempt::Reverse => "reverse", - } - } -} - -impl AsRef for PaymentPagesCheckoutSessionCustomerDetailsTaxExempt { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for PaymentPagesCheckoutSessionCustomerDetailsTaxExempt { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for PaymentPagesCheckoutSessionCustomerDetailsTaxExempt { - fn default() -> Self { - Self::Exempt - } -} - -/// An enum representing the possible values of an `PaymentPagesCheckoutSessionPaymentMethodReuseAgreement`'s `position` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum PaymentPagesCheckoutSessionPaymentMethodReuseAgreementPosition { - Auto, - Hidden, -} - -impl PaymentPagesCheckoutSessionPaymentMethodReuseAgreementPosition { - pub fn as_str(self) -> &'static str { - match self { - PaymentPagesCheckoutSessionPaymentMethodReuseAgreementPosition::Auto => "auto", - PaymentPagesCheckoutSessionPaymentMethodReuseAgreementPosition::Hidden => "hidden", - } - } -} - -impl AsRef for PaymentPagesCheckoutSessionPaymentMethodReuseAgreementPosition { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for PaymentPagesCheckoutSessionPaymentMethodReuseAgreementPosition { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for PaymentPagesCheckoutSessionPaymentMethodReuseAgreementPosition { - fn default() -> Self { - Self::Auto - } -} - -/// An enum representing the possible values of an `PaymentPagesCheckoutSessionShippingAddressCollection`'s `allowed_countries` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum PaymentPagesCheckoutSessionShippingAddressCollectionAllowedCountries { - #[serde(rename = "AC")] - Ac, - #[serde(rename = "AD")] - Ad, - #[serde(rename = "AE")] - Ae, - #[serde(rename = "AF")] - Af, - #[serde(rename = "AG")] - Ag, - #[serde(rename = "AI")] - Ai, - #[serde(rename = "AL")] - Al, - #[serde(rename = "AM")] - Am, - #[serde(rename = "AO")] - Ao, - #[serde(rename = "AQ")] - Aq, - #[serde(rename = "AR")] - Ar, - #[serde(rename = "AT")] - At, - #[serde(rename = "AU")] - Au, - #[serde(rename = "AW")] - Aw, - #[serde(rename = "AX")] - Ax, - #[serde(rename = "AZ")] - Az, - #[serde(rename = "BA")] - Ba, - #[serde(rename = "BB")] - Bb, - #[serde(rename = "BD")] - Bd, - #[serde(rename = "BE")] - Be, - #[serde(rename = "BF")] - Bf, - #[serde(rename = "BG")] - Bg, - #[serde(rename = "BH")] - Bh, - #[serde(rename = "BI")] - Bi, - #[serde(rename = "BJ")] - Bj, - #[serde(rename = "BL")] - Bl, - #[serde(rename = "BM")] - Bm, - #[serde(rename = "BN")] - Bn, - #[serde(rename = "BO")] - Bo, - #[serde(rename = "BQ")] - Bq, - #[serde(rename = "BR")] - Br, - #[serde(rename = "BS")] - Bs, - #[serde(rename = "BT")] - Bt, - #[serde(rename = "BV")] - Bv, - #[serde(rename = "BW")] - Bw, - #[serde(rename = "BY")] - By, - #[serde(rename = "BZ")] - Bz, - #[serde(rename = "CA")] - Ca, - #[serde(rename = "CD")] - Cd, - #[serde(rename = "CF")] - Cf, - #[serde(rename = "CG")] - Cg, - #[serde(rename = "CH")] - Ch, - #[serde(rename = "CI")] - Ci, - #[serde(rename = "CK")] - Ck, - #[serde(rename = "CL")] - Cl, - #[serde(rename = "CM")] - Cm, - #[serde(rename = "CN")] - Cn, - #[serde(rename = "CO")] - Co, - #[serde(rename = "CR")] - Cr, - #[serde(rename = "CV")] - Cv, - #[serde(rename = "CW")] - Cw, - #[serde(rename = "CY")] - Cy, - #[serde(rename = "CZ")] - Cz, - #[serde(rename = "DE")] - De, - #[serde(rename = "DJ")] - Dj, - #[serde(rename = "DK")] - Dk, - #[serde(rename = "DM")] - Dm, - #[serde(rename = "DO")] - Do, - #[serde(rename = "DZ")] - Dz, - #[serde(rename = "EC")] - Ec, - #[serde(rename = "EE")] - Ee, - #[serde(rename = "EG")] - Eg, - #[serde(rename = "EH")] - Eh, - #[serde(rename = "ER")] - Er, - #[serde(rename = "ES")] - Es, - #[serde(rename = "ET")] - Et, - #[serde(rename = "FI")] - Fi, - #[serde(rename = "FJ")] - Fj, - #[serde(rename = "FK")] - Fk, - #[serde(rename = "FO")] - Fo, - #[serde(rename = "FR")] - Fr, - #[serde(rename = "GA")] - Ga, - #[serde(rename = "GB")] - Gb, - #[serde(rename = "GD")] - Gd, - #[serde(rename = "GE")] - Ge, - #[serde(rename = "GF")] - Gf, - #[serde(rename = "GG")] - Gg, - #[serde(rename = "GH")] - Gh, - #[serde(rename = "GI")] - Gi, - #[serde(rename = "GL")] - Gl, - #[serde(rename = "GM")] - Gm, - #[serde(rename = "GN")] - Gn, - #[serde(rename = "GP")] - Gp, - #[serde(rename = "GQ")] - Gq, - #[serde(rename = "GR")] - Gr, - #[serde(rename = "GS")] - Gs, - #[serde(rename = "GT")] - Gt, - #[serde(rename = "GU")] - Gu, - #[serde(rename = "GW")] - Gw, - #[serde(rename = "GY")] - Gy, - #[serde(rename = "HK")] - Hk, - #[serde(rename = "HN")] - Hn, - #[serde(rename = "HR")] - Hr, - #[serde(rename = "HT")] - Ht, - #[serde(rename = "HU")] - Hu, - #[serde(rename = "ID")] - Id, - #[serde(rename = "IE")] - Ie, - #[serde(rename = "IL")] - Il, - #[serde(rename = "IM")] - Im, - #[serde(rename = "IN")] - In, - #[serde(rename = "IO")] - Io, - #[serde(rename = "IQ")] - Iq, - #[serde(rename = "IS")] - Is, - #[serde(rename = "IT")] - It, - #[serde(rename = "JE")] - Je, - #[serde(rename = "JM")] - Jm, - #[serde(rename = "JO")] - Jo, - #[serde(rename = "JP")] - Jp, - #[serde(rename = "KE")] - Ke, - #[serde(rename = "KG")] - Kg, - #[serde(rename = "KH")] - Kh, - #[serde(rename = "KI")] - Ki, - #[serde(rename = "KM")] - Km, - #[serde(rename = "KN")] - Kn, - #[serde(rename = "KR")] - Kr, - #[serde(rename = "KW")] - Kw, - #[serde(rename = "KY")] - Ky, - #[serde(rename = "KZ")] - Kz, - #[serde(rename = "LA")] - La, - #[serde(rename = "LB")] - Lb, - #[serde(rename = "LC")] - Lc, - #[serde(rename = "LI")] - Li, - #[serde(rename = "LK")] - Lk, - #[serde(rename = "LR")] - Lr, - #[serde(rename = "LS")] - Ls, - #[serde(rename = "LT")] - Lt, - #[serde(rename = "LU")] - Lu, - #[serde(rename = "LV")] - Lv, - #[serde(rename = "LY")] - Ly, - #[serde(rename = "MA")] - Ma, - #[serde(rename = "MC")] - Mc, - #[serde(rename = "MD")] - Md, - #[serde(rename = "ME")] - Me, - #[serde(rename = "MF")] - Mf, - #[serde(rename = "MG")] - Mg, - #[serde(rename = "MK")] - Mk, - #[serde(rename = "ML")] - Ml, - #[serde(rename = "MM")] - Mm, - #[serde(rename = "MN")] - Mn, - #[serde(rename = "MO")] - Mo, - #[serde(rename = "MQ")] - Mq, - #[serde(rename = "MR")] - Mr, - #[serde(rename = "MS")] - Ms, - #[serde(rename = "MT")] - Mt, - #[serde(rename = "MU")] - Mu, - #[serde(rename = "MV")] - Mv, - #[serde(rename = "MW")] - Mw, - #[serde(rename = "MX")] - Mx, - #[serde(rename = "MY")] - My, - #[serde(rename = "MZ")] - Mz, - #[serde(rename = "NA")] - Na, - #[serde(rename = "NC")] - Nc, - #[serde(rename = "NE")] - Ne, - #[serde(rename = "NG")] - Ng, - #[serde(rename = "NI")] - Ni, - #[serde(rename = "NL")] - Nl, - #[serde(rename = "NO")] - No, - #[serde(rename = "NP")] - Np, - #[serde(rename = "NR")] - Nr, - #[serde(rename = "NU")] - Nu, - #[serde(rename = "NZ")] - Nz, - #[serde(rename = "OM")] - Om, - #[serde(rename = "PA")] - Pa, - #[serde(rename = "PE")] - Pe, - #[serde(rename = "PF")] - Pf, - #[serde(rename = "PG")] - Pg, - #[serde(rename = "PH")] - Ph, - #[serde(rename = "PK")] - Pk, - #[serde(rename = "PL")] - Pl, - #[serde(rename = "PM")] - Pm, - #[serde(rename = "PN")] - Pn, - #[serde(rename = "PR")] - Pr, - #[serde(rename = "PS")] - Ps, - #[serde(rename = "PT")] - Pt, - #[serde(rename = "PY")] - Py, - #[serde(rename = "QA")] - Qa, - #[serde(rename = "RE")] - Re, - #[serde(rename = "RO")] - Ro, - #[serde(rename = "RS")] - Rs, - #[serde(rename = "RU")] - Ru, - #[serde(rename = "RW")] - Rw, - #[serde(rename = "SA")] - Sa, - #[serde(rename = "SB")] - Sb, - #[serde(rename = "SC")] - Sc, - #[serde(rename = "SE")] - Se, - #[serde(rename = "SG")] - Sg, - #[serde(rename = "SH")] - Sh, - #[serde(rename = "SI")] - Si, - #[serde(rename = "SJ")] - Sj, - #[serde(rename = "SK")] - Sk, - #[serde(rename = "SL")] - Sl, - #[serde(rename = "SM")] - Sm, - #[serde(rename = "SN")] - Sn, - #[serde(rename = "SO")] - So, - #[serde(rename = "SR")] - Sr, - #[serde(rename = "SS")] - Ss, - #[serde(rename = "ST")] - St, - #[serde(rename = "SV")] - Sv, - #[serde(rename = "SX")] - Sx, - #[serde(rename = "SZ")] - Sz, - #[serde(rename = "TA")] - Ta, - #[serde(rename = "TC")] - Tc, - #[serde(rename = "TD")] - Td, - #[serde(rename = "TF")] - Tf, - #[serde(rename = "TG")] - Tg, - #[serde(rename = "TH")] - Th, - #[serde(rename = "TJ")] - Tj, - #[serde(rename = "TK")] - Tk, - #[serde(rename = "TL")] - Tl, - #[serde(rename = "TM")] - Tm, - #[serde(rename = "TN")] - Tn, - #[serde(rename = "TO")] - To, - #[serde(rename = "TR")] - Tr, - #[serde(rename = "TT")] - Tt, - #[serde(rename = "TV")] - Tv, - #[serde(rename = "TW")] - Tw, - #[serde(rename = "TZ")] - Tz, - #[serde(rename = "UA")] - Ua, - #[serde(rename = "UG")] - Ug, - #[serde(rename = "US")] - Us, - #[serde(rename = "UY")] - Uy, - #[serde(rename = "UZ")] - Uz, - #[serde(rename = "VA")] - Va, - #[serde(rename = "VC")] - Vc, - #[serde(rename = "VE")] - Ve, - #[serde(rename = "VG")] - Vg, - #[serde(rename = "VN")] - Vn, - #[serde(rename = "VU")] - Vu, - #[serde(rename = "WF")] - Wf, - #[serde(rename = "WS")] - Ws, - #[serde(rename = "XK")] - Xk, - #[serde(rename = "YE")] - Ye, - #[serde(rename = "YT")] - Yt, - #[serde(rename = "ZA")] - Za, - #[serde(rename = "ZM")] - Zm, - #[serde(rename = "ZW")] - Zw, - #[serde(rename = "ZZ")] - Zz, -} - -impl PaymentPagesCheckoutSessionShippingAddressCollectionAllowedCountries { - pub fn as_str(self) -> &'static str { - match self { - PaymentPagesCheckoutSessionShippingAddressCollectionAllowedCountries::Ac => "AC", - PaymentPagesCheckoutSessionShippingAddressCollectionAllowedCountries::Ad => "AD", - PaymentPagesCheckoutSessionShippingAddressCollectionAllowedCountries::Ae => "AE", - PaymentPagesCheckoutSessionShippingAddressCollectionAllowedCountries::Af => "AF", - PaymentPagesCheckoutSessionShippingAddressCollectionAllowedCountries::Ag => "AG", - PaymentPagesCheckoutSessionShippingAddressCollectionAllowedCountries::Ai => "AI", - PaymentPagesCheckoutSessionShippingAddressCollectionAllowedCountries::Al => "AL", - PaymentPagesCheckoutSessionShippingAddressCollectionAllowedCountries::Am => "AM", - PaymentPagesCheckoutSessionShippingAddressCollectionAllowedCountries::Ao => "AO", - PaymentPagesCheckoutSessionShippingAddressCollectionAllowedCountries::Aq => "AQ", - PaymentPagesCheckoutSessionShippingAddressCollectionAllowedCountries::Ar => "AR", - PaymentPagesCheckoutSessionShippingAddressCollectionAllowedCountries::At => "AT", - PaymentPagesCheckoutSessionShippingAddressCollectionAllowedCountries::Au => "AU", - PaymentPagesCheckoutSessionShippingAddressCollectionAllowedCountries::Aw => "AW", - PaymentPagesCheckoutSessionShippingAddressCollectionAllowedCountries::Ax => "AX", - PaymentPagesCheckoutSessionShippingAddressCollectionAllowedCountries::Az => "AZ", - PaymentPagesCheckoutSessionShippingAddressCollectionAllowedCountries::Ba => "BA", - PaymentPagesCheckoutSessionShippingAddressCollectionAllowedCountries::Bb => "BB", - PaymentPagesCheckoutSessionShippingAddressCollectionAllowedCountries::Bd => "BD", - PaymentPagesCheckoutSessionShippingAddressCollectionAllowedCountries::Be => "BE", - PaymentPagesCheckoutSessionShippingAddressCollectionAllowedCountries::Bf => "BF", - PaymentPagesCheckoutSessionShippingAddressCollectionAllowedCountries::Bg => "BG", - PaymentPagesCheckoutSessionShippingAddressCollectionAllowedCountries::Bh => "BH", - PaymentPagesCheckoutSessionShippingAddressCollectionAllowedCountries::Bi => "BI", - PaymentPagesCheckoutSessionShippingAddressCollectionAllowedCountries::Bj => "BJ", - PaymentPagesCheckoutSessionShippingAddressCollectionAllowedCountries::Bl => "BL", - PaymentPagesCheckoutSessionShippingAddressCollectionAllowedCountries::Bm => "BM", - PaymentPagesCheckoutSessionShippingAddressCollectionAllowedCountries::Bn => "BN", - PaymentPagesCheckoutSessionShippingAddressCollectionAllowedCountries::Bo => "BO", - PaymentPagesCheckoutSessionShippingAddressCollectionAllowedCountries::Bq => "BQ", - PaymentPagesCheckoutSessionShippingAddressCollectionAllowedCountries::Br => "BR", - PaymentPagesCheckoutSessionShippingAddressCollectionAllowedCountries::Bs => "BS", - PaymentPagesCheckoutSessionShippingAddressCollectionAllowedCountries::Bt => "BT", - PaymentPagesCheckoutSessionShippingAddressCollectionAllowedCountries::Bv => "BV", - PaymentPagesCheckoutSessionShippingAddressCollectionAllowedCountries::Bw => "BW", - PaymentPagesCheckoutSessionShippingAddressCollectionAllowedCountries::By => "BY", - PaymentPagesCheckoutSessionShippingAddressCollectionAllowedCountries::Bz => "BZ", - PaymentPagesCheckoutSessionShippingAddressCollectionAllowedCountries::Ca => "CA", - PaymentPagesCheckoutSessionShippingAddressCollectionAllowedCountries::Cd => "CD", - PaymentPagesCheckoutSessionShippingAddressCollectionAllowedCountries::Cf => "CF", - PaymentPagesCheckoutSessionShippingAddressCollectionAllowedCountries::Cg => "CG", - PaymentPagesCheckoutSessionShippingAddressCollectionAllowedCountries::Ch => "CH", - PaymentPagesCheckoutSessionShippingAddressCollectionAllowedCountries::Ci => "CI", - PaymentPagesCheckoutSessionShippingAddressCollectionAllowedCountries::Ck => "CK", - PaymentPagesCheckoutSessionShippingAddressCollectionAllowedCountries::Cl => "CL", - PaymentPagesCheckoutSessionShippingAddressCollectionAllowedCountries::Cm => "CM", - PaymentPagesCheckoutSessionShippingAddressCollectionAllowedCountries::Cn => "CN", - PaymentPagesCheckoutSessionShippingAddressCollectionAllowedCountries::Co => "CO", - PaymentPagesCheckoutSessionShippingAddressCollectionAllowedCountries::Cr => "CR", - PaymentPagesCheckoutSessionShippingAddressCollectionAllowedCountries::Cv => "CV", - PaymentPagesCheckoutSessionShippingAddressCollectionAllowedCountries::Cw => "CW", - PaymentPagesCheckoutSessionShippingAddressCollectionAllowedCountries::Cy => "CY", - PaymentPagesCheckoutSessionShippingAddressCollectionAllowedCountries::Cz => "CZ", - PaymentPagesCheckoutSessionShippingAddressCollectionAllowedCountries::De => "DE", - PaymentPagesCheckoutSessionShippingAddressCollectionAllowedCountries::Dj => "DJ", - PaymentPagesCheckoutSessionShippingAddressCollectionAllowedCountries::Dk => "DK", - PaymentPagesCheckoutSessionShippingAddressCollectionAllowedCountries::Dm => "DM", - PaymentPagesCheckoutSessionShippingAddressCollectionAllowedCountries::Do => "DO", - PaymentPagesCheckoutSessionShippingAddressCollectionAllowedCountries::Dz => "DZ", - PaymentPagesCheckoutSessionShippingAddressCollectionAllowedCountries::Ec => "EC", - PaymentPagesCheckoutSessionShippingAddressCollectionAllowedCountries::Ee => "EE", - PaymentPagesCheckoutSessionShippingAddressCollectionAllowedCountries::Eg => "EG", - PaymentPagesCheckoutSessionShippingAddressCollectionAllowedCountries::Eh => "EH", - PaymentPagesCheckoutSessionShippingAddressCollectionAllowedCountries::Er => "ER", - PaymentPagesCheckoutSessionShippingAddressCollectionAllowedCountries::Es => "ES", - PaymentPagesCheckoutSessionShippingAddressCollectionAllowedCountries::Et => "ET", - PaymentPagesCheckoutSessionShippingAddressCollectionAllowedCountries::Fi => "FI", - PaymentPagesCheckoutSessionShippingAddressCollectionAllowedCountries::Fj => "FJ", - PaymentPagesCheckoutSessionShippingAddressCollectionAllowedCountries::Fk => "FK", - PaymentPagesCheckoutSessionShippingAddressCollectionAllowedCountries::Fo => "FO", - PaymentPagesCheckoutSessionShippingAddressCollectionAllowedCountries::Fr => "FR", - PaymentPagesCheckoutSessionShippingAddressCollectionAllowedCountries::Ga => "GA", - PaymentPagesCheckoutSessionShippingAddressCollectionAllowedCountries::Gb => "GB", - PaymentPagesCheckoutSessionShippingAddressCollectionAllowedCountries::Gd => "GD", - PaymentPagesCheckoutSessionShippingAddressCollectionAllowedCountries::Ge => "GE", - PaymentPagesCheckoutSessionShippingAddressCollectionAllowedCountries::Gf => "GF", - PaymentPagesCheckoutSessionShippingAddressCollectionAllowedCountries::Gg => "GG", - PaymentPagesCheckoutSessionShippingAddressCollectionAllowedCountries::Gh => "GH", - PaymentPagesCheckoutSessionShippingAddressCollectionAllowedCountries::Gi => "GI", - PaymentPagesCheckoutSessionShippingAddressCollectionAllowedCountries::Gl => "GL", - PaymentPagesCheckoutSessionShippingAddressCollectionAllowedCountries::Gm => "GM", - PaymentPagesCheckoutSessionShippingAddressCollectionAllowedCountries::Gn => "GN", - PaymentPagesCheckoutSessionShippingAddressCollectionAllowedCountries::Gp => "GP", - PaymentPagesCheckoutSessionShippingAddressCollectionAllowedCountries::Gq => "GQ", - PaymentPagesCheckoutSessionShippingAddressCollectionAllowedCountries::Gr => "GR", - PaymentPagesCheckoutSessionShippingAddressCollectionAllowedCountries::Gs => "GS", - PaymentPagesCheckoutSessionShippingAddressCollectionAllowedCountries::Gt => "GT", - PaymentPagesCheckoutSessionShippingAddressCollectionAllowedCountries::Gu => "GU", - PaymentPagesCheckoutSessionShippingAddressCollectionAllowedCountries::Gw => "GW", - PaymentPagesCheckoutSessionShippingAddressCollectionAllowedCountries::Gy => "GY", - PaymentPagesCheckoutSessionShippingAddressCollectionAllowedCountries::Hk => "HK", - PaymentPagesCheckoutSessionShippingAddressCollectionAllowedCountries::Hn => "HN", - PaymentPagesCheckoutSessionShippingAddressCollectionAllowedCountries::Hr => "HR", - PaymentPagesCheckoutSessionShippingAddressCollectionAllowedCountries::Ht => "HT", - PaymentPagesCheckoutSessionShippingAddressCollectionAllowedCountries::Hu => "HU", - PaymentPagesCheckoutSessionShippingAddressCollectionAllowedCountries::Id => "ID", - PaymentPagesCheckoutSessionShippingAddressCollectionAllowedCountries::Ie => "IE", - PaymentPagesCheckoutSessionShippingAddressCollectionAllowedCountries::Il => "IL", - PaymentPagesCheckoutSessionShippingAddressCollectionAllowedCountries::Im => "IM", - PaymentPagesCheckoutSessionShippingAddressCollectionAllowedCountries::In => "IN", - PaymentPagesCheckoutSessionShippingAddressCollectionAllowedCountries::Io => "IO", - PaymentPagesCheckoutSessionShippingAddressCollectionAllowedCountries::Iq => "IQ", - PaymentPagesCheckoutSessionShippingAddressCollectionAllowedCountries::Is => "IS", - PaymentPagesCheckoutSessionShippingAddressCollectionAllowedCountries::It => "IT", - PaymentPagesCheckoutSessionShippingAddressCollectionAllowedCountries::Je => "JE", - PaymentPagesCheckoutSessionShippingAddressCollectionAllowedCountries::Jm => "JM", - PaymentPagesCheckoutSessionShippingAddressCollectionAllowedCountries::Jo => "JO", - PaymentPagesCheckoutSessionShippingAddressCollectionAllowedCountries::Jp => "JP", - PaymentPagesCheckoutSessionShippingAddressCollectionAllowedCountries::Ke => "KE", - PaymentPagesCheckoutSessionShippingAddressCollectionAllowedCountries::Kg => "KG", - PaymentPagesCheckoutSessionShippingAddressCollectionAllowedCountries::Kh => "KH", - PaymentPagesCheckoutSessionShippingAddressCollectionAllowedCountries::Ki => "KI", - PaymentPagesCheckoutSessionShippingAddressCollectionAllowedCountries::Km => "KM", - PaymentPagesCheckoutSessionShippingAddressCollectionAllowedCountries::Kn => "KN", - PaymentPagesCheckoutSessionShippingAddressCollectionAllowedCountries::Kr => "KR", - PaymentPagesCheckoutSessionShippingAddressCollectionAllowedCountries::Kw => "KW", - PaymentPagesCheckoutSessionShippingAddressCollectionAllowedCountries::Ky => "KY", - PaymentPagesCheckoutSessionShippingAddressCollectionAllowedCountries::Kz => "KZ", - PaymentPagesCheckoutSessionShippingAddressCollectionAllowedCountries::La => "LA", - PaymentPagesCheckoutSessionShippingAddressCollectionAllowedCountries::Lb => "LB", - PaymentPagesCheckoutSessionShippingAddressCollectionAllowedCountries::Lc => "LC", - PaymentPagesCheckoutSessionShippingAddressCollectionAllowedCountries::Li => "LI", - PaymentPagesCheckoutSessionShippingAddressCollectionAllowedCountries::Lk => "LK", - PaymentPagesCheckoutSessionShippingAddressCollectionAllowedCountries::Lr => "LR", - PaymentPagesCheckoutSessionShippingAddressCollectionAllowedCountries::Ls => "LS", - PaymentPagesCheckoutSessionShippingAddressCollectionAllowedCountries::Lt => "LT", - PaymentPagesCheckoutSessionShippingAddressCollectionAllowedCountries::Lu => "LU", - PaymentPagesCheckoutSessionShippingAddressCollectionAllowedCountries::Lv => "LV", - PaymentPagesCheckoutSessionShippingAddressCollectionAllowedCountries::Ly => "LY", - PaymentPagesCheckoutSessionShippingAddressCollectionAllowedCountries::Ma => "MA", - PaymentPagesCheckoutSessionShippingAddressCollectionAllowedCountries::Mc => "MC", - PaymentPagesCheckoutSessionShippingAddressCollectionAllowedCountries::Md => "MD", - PaymentPagesCheckoutSessionShippingAddressCollectionAllowedCountries::Me => "ME", - PaymentPagesCheckoutSessionShippingAddressCollectionAllowedCountries::Mf => "MF", - PaymentPagesCheckoutSessionShippingAddressCollectionAllowedCountries::Mg => "MG", - PaymentPagesCheckoutSessionShippingAddressCollectionAllowedCountries::Mk => "MK", - PaymentPagesCheckoutSessionShippingAddressCollectionAllowedCountries::Ml => "ML", - PaymentPagesCheckoutSessionShippingAddressCollectionAllowedCountries::Mm => "MM", - PaymentPagesCheckoutSessionShippingAddressCollectionAllowedCountries::Mn => "MN", - PaymentPagesCheckoutSessionShippingAddressCollectionAllowedCountries::Mo => "MO", - PaymentPagesCheckoutSessionShippingAddressCollectionAllowedCountries::Mq => "MQ", - PaymentPagesCheckoutSessionShippingAddressCollectionAllowedCountries::Mr => "MR", - PaymentPagesCheckoutSessionShippingAddressCollectionAllowedCountries::Ms => "MS", - PaymentPagesCheckoutSessionShippingAddressCollectionAllowedCountries::Mt => "MT", - PaymentPagesCheckoutSessionShippingAddressCollectionAllowedCountries::Mu => "MU", - PaymentPagesCheckoutSessionShippingAddressCollectionAllowedCountries::Mv => "MV", - PaymentPagesCheckoutSessionShippingAddressCollectionAllowedCountries::Mw => "MW", - PaymentPagesCheckoutSessionShippingAddressCollectionAllowedCountries::Mx => "MX", - PaymentPagesCheckoutSessionShippingAddressCollectionAllowedCountries::My => "MY", - PaymentPagesCheckoutSessionShippingAddressCollectionAllowedCountries::Mz => "MZ", - PaymentPagesCheckoutSessionShippingAddressCollectionAllowedCountries::Na => "NA", - PaymentPagesCheckoutSessionShippingAddressCollectionAllowedCountries::Nc => "NC", - PaymentPagesCheckoutSessionShippingAddressCollectionAllowedCountries::Ne => "NE", - PaymentPagesCheckoutSessionShippingAddressCollectionAllowedCountries::Ng => "NG", - PaymentPagesCheckoutSessionShippingAddressCollectionAllowedCountries::Ni => "NI", - PaymentPagesCheckoutSessionShippingAddressCollectionAllowedCountries::Nl => "NL", - PaymentPagesCheckoutSessionShippingAddressCollectionAllowedCountries::No => "NO", - PaymentPagesCheckoutSessionShippingAddressCollectionAllowedCountries::Np => "NP", - PaymentPagesCheckoutSessionShippingAddressCollectionAllowedCountries::Nr => "NR", - PaymentPagesCheckoutSessionShippingAddressCollectionAllowedCountries::Nu => "NU", - PaymentPagesCheckoutSessionShippingAddressCollectionAllowedCountries::Nz => "NZ", - PaymentPagesCheckoutSessionShippingAddressCollectionAllowedCountries::Om => "OM", - PaymentPagesCheckoutSessionShippingAddressCollectionAllowedCountries::Pa => "PA", - PaymentPagesCheckoutSessionShippingAddressCollectionAllowedCountries::Pe => "PE", - PaymentPagesCheckoutSessionShippingAddressCollectionAllowedCountries::Pf => "PF", - PaymentPagesCheckoutSessionShippingAddressCollectionAllowedCountries::Pg => "PG", - PaymentPagesCheckoutSessionShippingAddressCollectionAllowedCountries::Ph => "PH", - PaymentPagesCheckoutSessionShippingAddressCollectionAllowedCountries::Pk => "PK", - PaymentPagesCheckoutSessionShippingAddressCollectionAllowedCountries::Pl => "PL", - PaymentPagesCheckoutSessionShippingAddressCollectionAllowedCountries::Pm => "PM", - PaymentPagesCheckoutSessionShippingAddressCollectionAllowedCountries::Pn => "PN", - PaymentPagesCheckoutSessionShippingAddressCollectionAllowedCountries::Pr => "PR", - PaymentPagesCheckoutSessionShippingAddressCollectionAllowedCountries::Ps => "PS", - PaymentPagesCheckoutSessionShippingAddressCollectionAllowedCountries::Pt => "PT", - PaymentPagesCheckoutSessionShippingAddressCollectionAllowedCountries::Py => "PY", - PaymentPagesCheckoutSessionShippingAddressCollectionAllowedCountries::Qa => "QA", - PaymentPagesCheckoutSessionShippingAddressCollectionAllowedCountries::Re => "RE", - PaymentPagesCheckoutSessionShippingAddressCollectionAllowedCountries::Ro => "RO", - PaymentPagesCheckoutSessionShippingAddressCollectionAllowedCountries::Rs => "RS", - PaymentPagesCheckoutSessionShippingAddressCollectionAllowedCountries::Ru => "RU", - PaymentPagesCheckoutSessionShippingAddressCollectionAllowedCountries::Rw => "RW", - PaymentPagesCheckoutSessionShippingAddressCollectionAllowedCountries::Sa => "SA", - PaymentPagesCheckoutSessionShippingAddressCollectionAllowedCountries::Sb => "SB", - PaymentPagesCheckoutSessionShippingAddressCollectionAllowedCountries::Sc => "SC", - PaymentPagesCheckoutSessionShippingAddressCollectionAllowedCountries::Se => "SE", - PaymentPagesCheckoutSessionShippingAddressCollectionAllowedCountries::Sg => "SG", - PaymentPagesCheckoutSessionShippingAddressCollectionAllowedCountries::Sh => "SH", - PaymentPagesCheckoutSessionShippingAddressCollectionAllowedCountries::Si => "SI", - PaymentPagesCheckoutSessionShippingAddressCollectionAllowedCountries::Sj => "SJ", - PaymentPagesCheckoutSessionShippingAddressCollectionAllowedCountries::Sk => "SK", - PaymentPagesCheckoutSessionShippingAddressCollectionAllowedCountries::Sl => "SL", - PaymentPagesCheckoutSessionShippingAddressCollectionAllowedCountries::Sm => "SM", - PaymentPagesCheckoutSessionShippingAddressCollectionAllowedCountries::Sn => "SN", - PaymentPagesCheckoutSessionShippingAddressCollectionAllowedCountries::So => "SO", - PaymentPagesCheckoutSessionShippingAddressCollectionAllowedCountries::Sr => "SR", - PaymentPagesCheckoutSessionShippingAddressCollectionAllowedCountries::Ss => "SS", - PaymentPagesCheckoutSessionShippingAddressCollectionAllowedCountries::St => "ST", - PaymentPagesCheckoutSessionShippingAddressCollectionAllowedCountries::Sv => "SV", - PaymentPagesCheckoutSessionShippingAddressCollectionAllowedCountries::Sx => "SX", - PaymentPagesCheckoutSessionShippingAddressCollectionAllowedCountries::Sz => "SZ", - PaymentPagesCheckoutSessionShippingAddressCollectionAllowedCountries::Ta => "TA", - PaymentPagesCheckoutSessionShippingAddressCollectionAllowedCountries::Tc => "TC", - PaymentPagesCheckoutSessionShippingAddressCollectionAllowedCountries::Td => "TD", - PaymentPagesCheckoutSessionShippingAddressCollectionAllowedCountries::Tf => "TF", - PaymentPagesCheckoutSessionShippingAddressCollectionAllowedCountries::Tg => "TG", - PaymentPagesCheckoutSessionShippingAddressCollectionAllowedCountries::Th => "TH", - PaymentPagesCheckoutSessionShippingAddressCollectionAllowedCountries::Tj => "TJ", - PaymentPagesCheckoutSessionShippingAddressCollectionAllowedCountries::Tk => "TK", - PaymentPagesCheckoutSessionShippingAddressCollectionAllowedCountries::Tl => "TL", - PaymentPagesCheckoutSessionShippingAddressCollectionAllowedCountries::Tm => "TM", - PaymentPagesCheckoutSessionShippingAddressCollectionAllowedCountries::Tn => "TN", - PaymentPagesCheckoutSessionShippingAddressCollectionAllowedCountries::To => "TO", - PaymentPagesCheckoutSessionShippingAddressCollectionAllowedCountries::Tr => "TR", - PaymentPagesCheckoutSessionShippingAddressCollectionAllowedCountries::Tt => "TT", - PaymentPagesCheckoutSessionShippingAddressCollectionAllowedCountries::Tv => "TV", - PaymentPagesCheckoutSessionShippingAddressCollectionAllowedCountries::Tw => "TW", - PaymentPagesCheckoutSessionShippingAddressCollectionAllowedCountries::Tz => "TZ", - PaymentPagesCheckoutSessionShippingAddressCollectionAllowedCountries::Ua => "UA", - PaymentPagesCheckoutSessionShippingAddressCollectionAllowedCountries::Ug => "UG", - PaymentPagesCheckoutSessionShippingAddressCollectionAllowedCountries::Us => "US", - PaymentPagesCheckoutSessionShippingAddressCollectionAllowedCountries::Uy => "UY", - PaymentPagesCheckoutSessionShippingAddressCollectionAllowedCountries::Uz => "UZ", - PaymentPagesCheckoutSessionShippingAddressCollectionAllowedCountries::Va => "VA", - PaymentPagesCheckoutSessionShippingAddressCollectionAllowedCountries::Vc => "VC", - PaymentPagesCheckoutSessionShippingAddressCollectionAllowedCountries::Ve => "VE", - PaymentPagesCheckoutSessionShippingAddressCollectionAllowedCountries::Vg => "VG", - PaymentPagesCheckoutSessionShippingAddressCollectionAllowedCountries::Vn => "VN", - PaymentPagesCheckoutSessionShippingAddressCollectionAllowedCountries::Vu => "VU", - PaymentPagesCheckoutSessionShippingAddressCollectionAllowedCountries::Wf => "WF", - PaymentPagesCheckoutSessionShippingAddressCollectionAllowedCountries::Ws => "WS", - PaymentPagesCheckoutSessionShippingAddressCollectionAllowedCountries::Xk => "XK", - PaymentPagesCheckoutSessionShippingAddressCollectionAllowedCountries::Ye => "YE", - PaymentPagesCheckoutSessionShippingAddressCollectionAllowedCountries::Yt => "YT", - PaymentPagesCheckoutSessionShippingAddressCollectionAllowedCountries::Za => "ZA", - PaymentPagesCheckoutSessionShippingAddressCollectionAllowedCountries::Zm => "ZM", - PaymentPagesCheckoutSessionShippingAddressCollectionAllowedCountries::Zw => "ZW", - PaymentPagesCheckoutSessionShippingAddressCollectionAllowedCountries::Zz => "ZZ", - } - } -} - -impl AsRef for PaymentPagesCheckoutSessionShippingAddressCollectionAllowedCountries { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for PaymentPagesCheckoutSessionShippingAddressCollectionAllowedCountries { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default - for PaymentPagesCheckoutSessionShippingAddressCollectionAllowedCountries -{ - fn default() -> Self { - Self::Ac - } -} - -/// An enum representing the possible values of an `PaymentPagesCheckoutSessionTaxId`'s `type` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum PaymentPagesCheckoutSessionTaxIdType { - AdNrt, - AeTrn, - ArCuit, - AuAbn, - AuArn, - BgUic, - BoTin, - BrCnpj, - BrCpf, - CaBn, - CaGstHst, - CaPstBc, - CaPstMb, - CaPstSk, - CaQst, - ChVat, - ClTin, - CnTin, - CoNit, - CrTin, - DoRcn, - EcRuc, - EgTin, - EsCif, - EuOssVat, - EuVat, - GbVat, - GeVat, - HkBr, - HuTin, - IdNpwp, - IlVat, - InGst, - IsVat, - JpCn, - JpRn, - JpTrn, - KePin, - KrBrn, - LiUid, - MxRfc, - MyFrp, - MyItn, - MySst, - NoVat, - NzGst, - PeRuc, - PhTin, - RoTin, - RsPib, - RuInn, - RuKpp, - SaVat, - SgGst, - SgUen, - SiTin, - SvNit, - ThVat, - TrTin, - TwVat, - UaVat, - Unknown, - UsEin, - UyRuc, - VeRif, - VnTin, - ZaVat, -} - -impl PaymentPagesCheckoutSessionTaxIdType { - pub fn as_str(self) -> &'static str { - match self { - PaymentPagesCheckoutSessionTaxIdType::AdNrt => "ad_nrt", - PaymentPagesCheckoutSessionTaxIdType::AeTrn => "ae_trn", - PaymentPagesCheckoutSessionTaxIdType::ArCuit => "ar_cuit", - PaymentPagesCheckoutSessionTaxIdType::AuAbn => "au_abn", - PaymentPagesCheckoutSessionTaxIdType::AuArn => "au_arn", - PaymentPagesCheckoutSessionTaxIdType::BgUic => "bg_uic", - PaymentPagesCheckoutSessionTaxIdType::BoTin => "bo_tin", - PaymentPagesCheckoutSessionTaxIdType::BrCnpj => "br_cnpj", - PaymentPagesCheckoutSessionTaxIdType::BrCpf => "br_cpf", - PaymentPagesCheckoutSessionTaxIdType::CaBn => "ca_bn", - PaymentPagesCheckoutSessionTaxIdType::CaGstHst => "ca_gst_hst", - PaymentPagesCheckoutSessionTaxIdType::CaPstBc => "ca_pst_bc", - PaymentPagesCheckoutSessionTaxIdType::CaPstMb => "ca_pst_mb", - PaymentPagesCheckoutSessionTaxIdType::CaPstSk => "ca_pst_sk", - PaymentPagesCheckoutSessionTaxIdType::CaQst => "ca_qst", - PaymentPagesCheckoutSessionTaxIdType::ChVat => "ch_vat", - PaymentPagesCheckoutSessionTaxIdType::ClTin => "cl_tin", - PaymentPagesCheckoutSessionTaxIdType::CnTin => "cn_tin", - PaymentPagesCheckoutSessionTaxIdType::CoNit => "co_nit", - PaymentPagesCheckoutSessionTaxIdType::CrTin => "cr_tin", - PaymentPagesCheckoutSessionTaxIdType::DoRcn => "do_rcn", - PaymentPagesCheckoutSessionTaxIdType::EcRuc => "ec_ruc", - PaymentPagesCheckoutSessionTaxIdType::EgTin => "eg_tin", - PaymentPagesCheckoutSessionTaxIdType::EsCif => "es_cif", - PaymentPagesCheckoutSessionTaxIdType::EuOssVat => "eu_oss_vat", - PaymentPagesCheckoutSessionTaxIdType::EuVat => "eu_vat", - PaymentPagesCheckoutSessionTaxIdType::GbVat => "gb_vat", - PaymentPagesCheckoutSessionTaxIdType::GeVat => "ge_vat", - PaymentPagesCheckoutSessionTaxIdType::HkBr => "hk_br", - PaymentPagesCheckoutSessionTaxIdType::HuTin => "hu_tin", - PaymentPagesCheckoutSessionTaxIdType::IdNpwp => "id_npwp", - PaymentPagesCheckoutSessionTaxIdType::IlVat => "il_vat", - PaymentPagesCheckoutSessionTaxIdType::InGst => "in_gst", - PaymentPagesCheckoutSessionTaxIdType::IsVat => "is_vat", - PaymentPagesCheckoutSessionTaxIdType::JpCn => "jp_cn", - PaymentPagesCheckoutSessionTaxIdType::JpRn => "jp_rn", - PaymentPagesCheckoutSessionTaxIdType::JpTrn => "jp_trn", - PaymentPagesCheckoutSessionTaxIdType::KePin => "ke_pin", - PaymentPagesCheckoutSessionTaxIdType::KrBrn => "kr_brn", - PaymentPagesCheckoutSessionTaxIdType::LiUid => "li_uid", - PaymentPagesCheckoutSessionTaxIdType::MxRfc => "mx_rfc", - PaymentPagesCheckoutSessionTaxIdType::MyFrp => "my_frp", - PaymentPagesCheckoutSessionTaxIdType::MyItn => "my_itn", - PaymentPagesCheckoutSessionTaxIdType::MySst => "my_sst", - PaymentPagesCheckoutSessionTaxIdType::NoVat => "no_vat", - PaymentPagesCheckoutSessionTaxIdType::NzGst => "nz_gst", - PaymentPagesCheckoutSessionTaxIdType::PeRuc => "pe_ruc", - PaymentPagesCheckoutSessionTaxIdType::PhTin => "ph_tin", - PaymentPagesCheckoutSessionTaxIdType::RoTin => "ro_tin", - PaymentPagesCheckoutSessionTaxIdType::RsPib => "rs_pib", - PaymentPagesCheckoutSessionTaxIdType::RuInn => "ru_inn", - PaymentPagesCheckoutSessionTaxIdType::RuKpp => "ru_kpp", - PaymentPagesCheckoutSessionTaxIdType::SaVat => "sa_vat", - PaymentPagesCheckoutSessionTaxIdType::SgGst => "sg_gst", - PaymentPagesCheckoutSessionTaxIdType::SgUen => "sg_uen", - PaymentPagesCheckoutSessionTaxIdType::SiTin => "si_tin", - PaymentPagesCheckoutSessionTaxIdType::SvNit => "sv_nit", - PaymentPagesCheckoutSessionTaxIdType::ThVat => "th_vat", - PaymentPagesCheckoutSessionTaxIdType::TrTin => "tr_tin", - PaymentPagesCheckoutSessionTaxIdType::TwVat => "tw_vat", - PaymentPagesCheckoutSessionTaxIdType::UaVat => "ua_vat", - PaymentPagesCheckoutSessionTaxIdType::Unknown => "unknown", - PaymentPagesCheckoutSessionTaxIdType::UsEin => "us_ein", - PaymentPagesCheckoutSessionTaxIdType::UyRuc => "uy_ruc", - PaymentPagesCheckoutSessionTaxIdType::VeRif => "ve_rif", - PaymentPagesCheckoutSessionTaxIdType::VnTin => "vn_tin", - PaymentPagesCheckoutSessionTaxIdType::ZaVat => "za_vat", - } - } -} - -impl AsRef for PaymentPagesCheckoutSessionTaxIdType { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for PaymentPagesCheckoutSessionTaxIdType { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for PaymentPagesCheckoutSessionTaxIdType { - fn default() -> Self { - Self::AdNrt - } -} diff --git a/src/resources/generated/checkout_session_async_payment_failed.rs b/src/resources/generated/checkout_session_async_payment_failed.rs deleted file mode 100644 index a31cafda5..000000000 --- a/src/resources/generated/checkout_session_async_payment_failed.rs +++ /dev/null @@ -1,10 +0,0 @@ -// ====================================== -// This file was automatically generated. -// ====================================== - -use serde::{Deserialize, Serialize}; - -/// The resource representing a Stripe "checkout.session.async_payment_failed". -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CheckoutSessionAsyncPaymentFailed { -} diff --git a/src/resources/generated/checkout_session_async_payment_succeeded.rs b/src/resources/generated/checkout_session_async_payment_succeeded.rs deleted file mode 100644 index 807f042ef..000000000 --- a/src/resources/generated/checkout_session_async_payment_succeeded.rs +++ /dev/null @@ -1,10 +0,0 @@ -// ====================================== -// This file was automatically generated. -// ====================================== - -use serde::{Deserialize, Serialize}; - -/// The resource representing a Stripe "checkout.session.async_payment_succeeded". -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CheckoutSessionAsyncPaymentSucceeded { -} diff --git a/src/resources/generated/checkout_session_completed.rs b/src/resources/generated/checkout_session_completed.rs deleted file mode 100644 index 85838160c..000000000 --- a/src/resources/generated/checkout_session_completed.rs +++ /dev/null @@ -1,10 +0,0 @@ -// ====================================== -// This file was automatically generated. -// ====================================== - -use serde::{Deserialize, Serialize}; - -/// The resource representing a Stripe "checkout.session.completed". -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CheckoutSessionCompleted { -} diff --git a/src/resources/generated/checkout_session_expired.rs b/src/resources/generated/checkout_session_expired.rs deleted file mode 100644 index ab6e98351..000000000 --- a/src/resources/generated/checkout_session_expired.rs +++ /dev/null @@ -1,10 +0,0 @@ -// ====================================== -// This file was automatically generated. -// ====================================== - -use serde::{Deserialize, Serialize}; - -/// The resource representing a Stripe "checkout.session.expired". -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CheckoutSessionExpired { -} diff --git a/src/resources/generated/climate_order.rs b/src/resources/generated/climate_order.rs deleted file mode 100644 index 39ab394e4..000000000 --- a/src/resources/generated/climate_order.rs +++ /dev/null @@ -1,223 +0,0 @@ -// ====================================== -// This file was automatically generated. -// ====================================== - -use crate::ids::{ClimateOrderId}; -use crate::params::{Expandable, Metadata, Object, Timestamp}; -use crate::resources::{ClimateProduct, ClimateSupplier, Currency}; -use serde::{Deserialize, Serialize}; - -/// The resource representing a Stripe "ClimateRemovalsOrders". -/// -/// For more details see -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct ClimateOrder { - /// Unique identifier for the object. - pub id: ClimateOrderId, - - /// Total amount of [Frontier](https://frontierclimate.com/)'s service fees in the currency's smallest unit. - pub amount_fees: i64, - - /// Total amount of the carbon removal in the currency's smallest unit. - pub amount_subtotal: i64, - - /// Total amount of the order including fees in the currency's smallest unit. - pub amount_total: i64, - - #[serde(skip_serializing_if = "Option::is_none")] - pub beneficiary: Option, - - /// Time at which the order was canceled. - /// - /// Measured in seconds since the Unix epoch. - pub canceled_at: Option, - - /// Reason for the cancellation of this order. - pub cancellation_reason: Option, - - /// For delivered orders, a URL to a delivery certificate for the order. - pub certificate: Option, - - /// Time at which the order was confirmed. - /// - /// Measured in seconds since the Unix epoch. - pub confirmed_at: Option, - - /// Time at which the object was created. - /// - /// Measured in seconds since the Unix epoch. - pub created: Timestamp, - - /// Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase, representing the currency for this order. - pub currency: Currency, - - /// Time at which the order's expected_delivery_year was delayed. - /// - /// Measured in seconds since the Unix epoch. - pub delayed_at: Option, - - /// Time at which the order was delivered. - /// - /// Measured in seconds since the Unix epoch. - pub delivered_at: Option, - - /// Details about the delivery of carbon removal for this order. - pub delivery_details: Vec, - - /// The year this order is expected to be delivered. - pub expected_delivery_year: i64, - - /// Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. - pub livemode: bool, - - /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. - /// - /// This can be useful for storing additional information about the object in a structured format. - pub metadata: Metadata, - - /// Quantity of carbon removal that is included in this order. - pub metric_tons: String, - - /// Unique ID for the Climate `Product` this order is purchasing. - pub product: Expandable, - - /// Time at which the order's product was substituted for a different product. - /// - /// Measured in seconds since the Unix epoch. - pub product_substituted_at: Option, - - /// The current status of this order. - pub status: ClimateOrderStatus, -} - -impl Object for ClimateOrder { - type Id = ClimateOrderId; - fn id(&self) -> Self::Id { - self.id.clone() - } - fn object(&self) -> &'static str { - "climate.order" - } -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct ClimateRemovalsBeneficiary { - - /// Publicly displayable name for the end beneficiary of carbon removal. - pub public_name: String, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct ClimateRemovalsOrderDeliveries { - - /// Time at which the delivery occurred. - /// - /// Measured in seconds since the Unix epoch. - pub delivered_at: Timestamp, - - /// Specific location of this delivery. - pub location: Option, - - /// Quantity of carbon removal supplied by this delivery. - pub metric_tons: String, - - /// Once retired, a URL to the registry entry for the tons from this delivery. - pub registry_url: Option, - - pub supplier: ClimateSupplier, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct ClimateRemovalsLocation { - - /// The city where the supplier is located. - pub city: Option, - - /// Two-letter ISO code representing the country where the supplier is located. - pub country: String, - - /// The geographic latitude where the supplier is located. - pub latitude: Option, - - /// The geographic longitude where the supplier is located. - pub longitude: Option, - - /// The state/county/province/region where the supplier is located. - pub region: Option, -} - -/// An enum representing the possible values of an `ClimateOrder`'s `cancellation_reason` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum ClimateOrderCancellationReason { - Expired, - ProductUnavailable, - Requested, -} - -impl ClimateOrderCancellationReason { - pub fn as_str(self) -> &'static str { - match self { - ClimateOrderCancellationReason::Expired => "expired", - ClimateOrderCancellationReason::ProductUnavailable => "product_unavailable", - ClimateOrderCancellationReason::Requested => "requested", - } - } -} - -impl AsRef for ClimateOrderCancellationReason { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for ClimateOrderCancellationReason { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for ClimateOrderCancellationReason { - fn default() -> Self { - Self::Expired - } -} - -/// An enum representing the possible values of an `ClimateOrder`'s `status` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum ClimateOrderStatus { - AwaitingFunds, - Canceled, - Confirmed, - Delivered, - Open, -} - -impl ClimateOrderStatus { - pub fn as_str(self) -> &'static str { - match self { - ClimateOrderStatus::AwaitingFunds => "awaiting_funds", - ClimateOrderStatus::Canceled => "canceled", - ClimateOrderStatus::Confirmed => "confirmed", - ClimateOrderStatus::Delivered => "delivered", - ClimateOrderStatus::Open => "open", - } - } -} - -impl AsRef for ClimateOrderStatus { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for ClimateOrderStatus { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for ClimateOrderStatus { - fn default() -> Self { - Self::AwaitingFunds - } -} diff --git a/src/resources/generated/climate_order_canceled.rs b/src/resources/generated/climate_order_canceled.rs deleted file mode 100644 index 8d2dc03df..000000000 --- a/src/resources/generated/climate_order_canceled.rs +++ /dev/null @@ -1,10 +0,0 @@ -// ====================================== -// This file was automatically generated. -// ====================================== - -use serde::{Deserialize, Serialize}; - -/// The resource representing a Stripe "climate.order.canceled". -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct ClimateOrderCanceled { -} diff --git a/src/resources/generated/climate_order_created.rs b/src/resources/generated/climate_order_created.rs deleted file mode 100644 index f8420335a..000000000 --- a/src/resources/generated/climate_order_created.rs +++ /dev/null @@ -1,10 +0,0 @@ -// ====================================== -// This file was automatically generated. -// ====================================== - -use serde::{Deserialize, Serialize}; - -/// The resource representing a Stripe "climate.order.created". -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct ClimateOrderCreated { -} diff --git a/src/resources/generated/climate_order_delayed.rs b/src/resources/generated/climate_order_delayed.rs deleted file mode 100644 index 839244cb5..000000000 --- a/src/resources/generated/climate_order_delayed.rs +++ /dev/null @@ -1,10 +0,0 @@ -// ====================================== -// This file was automatically generated. -// ====================================== - -use serde::{Deserialize, Serialize}; - -/// The resource representing a Stripe "climate.order.delayed". -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct ClimateOrderDelayed { -} diff --git a/src/resources/generated/climate_order_delivered.rs b/src/resources/generated/climate_order_delivered.rs deleted file mode 100644 index d75604800..000000000 --- a/src/resources/generated/climate_order_delivered.rs +++ /dev/null @@ -1,10 +0,0 @@ -// ====================================== -// This file was automatically generated. -// ====================================== - -use serde::{Deserialize, Serialize}; - -/// The resource representing a Stripe "climate.order.delivered". -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct ClimateOrderDelivered { -} diff --git a/src/resources/generated/climate_order_product_substituted.rs b/src/resources/generated/climate_order_product_substituted.rs deleted file mode 100644 index dcb8f293f..000000000 --- a/src/resources/generated/climate_order_product_substituted.rs +++ /dev/null @@ -1,10 +0,0 @@ -// ====================================== -// This file was automatically generated. -// ====================================== - -use serde::{Deserialize, Serialize}; - -/// The resource representing a Stripe "climate.order.product_substituted". -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct ClimateOrderProductSubstituted { -} diff --git a/src/resources/generated/climate_product.rs b/src/resources/generated/climate_product.rs deleted file mode 100644 index dbad036af..000000000 --- a/src/resources/generated/climate_product.rs +++ /dev/null @@ -1,66 +0,0 @@ -// ====================================== -// This file was automatically generated. -// ====================================== - -use crate::ids::{ClimateProductId}; -use crate::params::{Object, Timestamp}; -use crate::resources::{ClimateSupplier}; -use serde::{Deserialize, Serialize}; - -/// The resource representing a Stripe "ClimateRemovalsProducts". -/// -/// For more details see -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct ClimateProduct { - /// Unique identifier for the object. - /// - /// For convenience, Climate product IDs are human-readable strings that start with `climsku_`. - /// See [carbon removal inventory](https://stripe.com/docs/climate/orders/carbon-removal-inventory) for a list of available carbon removal products. - pub id: ClimateProductId, - - /// Time at which the object was created. - /// - /// Measured in seconds since the Unix epoch. - pub created: Timestamp, - - /// Current prices for a metric ton of carbon removal in a currency's smallest unit. - pub current_prices_per_metric_ton: ClimateRemovalsProductsPrice, - - /// The year in which the carbon removal is expected to be delivered. - pub delivery_year: Option, - - /// Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. - pub livemode: bool, - - /// The quantity of metric tons available for reservation. - pub metric_tons_available: String, - - /// The Climate product's name. - pub name: String, - - /// The carbon removal suppliers that fulfill orders for this Climate product. - pub suppliers: Vec, -} - -impl Object for ClimateProduct { - type Id = ClimateProductId; - fn id(&self) -> Self::Id { - self.id.clone() - } - fn object(&self) -> &'static str { - "climate.product" - } -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct ClimateRemovalsProductsPrice { - - /// Fees for one metric ton of carbon removal in the currency's smallest unit. - pub amount_fees: i64, - - /// Subtotal for one metric ton of carbon removal (excluding fees) in the currency's smallest unit. - pub amount_subtotal: i64, - - /// Total for one metric ton of carbon removal (including fees) in the currency's smallest unit. - pub amount_total: i64, -} diff --git a/src/resources/generated/climate_product_created.rs b/src/resources/generated/climate_product_created.rs deleted file mode 100644 index 068a1ce41..000000000 --- a/src/resources/generated/climate_product_created.rs +++ /dev/null @@ -1,10 +0,0 @@ -// ====================================== -// This file was automatically generated. -// ====================================== - -use serde::{Deserialize, Serialize}; - -/// The resource representing a Stripe "climate.product.created". -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct ClimateProductCreated { -} diff --git a/src/resources/generated/climate_product_pricing_updated.rs b/src/resources/generated/climate_product_pricing_updated.rs deleted file mode 100644 index 7930fd9b9..000000000 --- a/src/resources/generated/climate_product_pricing_updated.rs +++ /dev/null @@ -1,10 +0,0 @@ -// ====================================== -// This file was automatically generated. -// ====================================== - -use serde::{Deserialize, Serialize}; - -/// The resource representing a Stripe "climate.product.pricing_updated". -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct ClimateProductPricingUpdated { -} diff --git a/src/resources/generated/climate_supplier.rs b/src/resources/generated/climate_supplier.rs deleted file mode 100644 index 77f347a43..000000000 --- a/src/resources/generated/climate_supplier.rs +++ /dev/null @@ -1,96 +0,0 @@ -// ====================================== -// This file was automatically generated. -// ====================================== - -use crate::ids::{ClimateSupplierId}; -use crate::params::{Object}; -use serde::{Deserialize, Serialize}; - -/// The resource representing a Stripe "ClimateRemovalsSuppliers". -/// -/// For more details see -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct ClimateSupplier { - /// Unique identifier for the object. - pub id: ClimateSupplierId, - - /// Link to a webpage to learn more about the supplier. - pub info_url: String, - - /// Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. - pub livemode: bool, - - /// The locations in which this supplier operates. - pub locations: Vec, - - /// Name of this carbon removal supplier. - pub name: String, - - /// The scientific pathway used for carbon removal. - pub removal_pathway: ClimateSupplierRemovalPathway, -} - -impl Object for ClimateSupplier { - type Id = ClimateSupplierId; - fn id(&self) -> Self::Id { - self.id.clone() - } - fn object(&self) -> &'static str { - "climate.supplier" - } -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct ClimateRemovalsLocation { - - /// The city where the supplier is located. - pub city: Option, - - /// Two-letter ISO code representing the country where the supplier is located. - pub country: String, - - /// The geographic latitude where the supplier is located. - pub latitude: Option, - - /// The geographic longitude where the supplier is located. - pub longitude: Option, - - /// The state/county/province/region where the supplier is located. - pub region: Option, -} - -/// An enum representing the possible values of an `ClimateSupplier`'s `removal_pathway` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum ClimateSupplierRemovalPathway { - BiomassCarbonRemovalAndStorage, - DirectAirCapture, - EnhancedWeathering, -} - -impl ClimateSupplierRemovalPathway { - pub fn as_str(self) -> &'static str { - match self { - ClimateSupplierRemovalPathway::BiomassCarbonRemovalAndStorage => "biomass_carbon_removal_and_storage", - ClimateSupplierRemovalPathway::DirectAirCapture => "direct_air_capture", - ClimateSupplierRemovalPathway::EnhancedWeathering => "enhanced_weathering", - } - } -} - -impl AsRef for ClimateSupplierRemovalPathway { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for ClimateSupplierRemovalPathway { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for ClimateSupplierRemovalPathway { - fn default() -> Self { - Self::BiomassCarbonRemovalAndStorage - } -} diff --git a/src/resources/generated/connect_account_reference.rs b/src/resources/generated/connect_account_reference.rs deleted file mode 100644 index c54d9d7b8..000000000 --- a/src/resources/generated/connect_account_reference.rs +++ /dev/null @@ -1,55 +0,0 @@ -// ====================================== -// This file was automatically generated. -// ====================================== - -use serde::{Deserialize, Serialize}; - -use crate::params::Expandable; -use crate::resources::Account; - -/// The resource representing a Stripe "ConnectAccountReference". -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct ConnectAccountReference { - /// The connected account being referenced when `type` is `account`. - #[serde(skip_serializing_if = "Option::is_none")] - pub account: Option>, - - /// Type of the account referenced. - #[serde(rename = "type")] - pub type_: ConnectAccountReferenceType, -} - -/// An enum representing the possible values of an `ConnectAccountReference`'s `type` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum ConnectAccountReferenceType { - Account, - #[serde(rename = "self")] - Self_, -} - -impl ConnectAccountReferenceType { - pub fn as_str(self) -> &'static str { - match self { - ConnectAccountReferenceType::Account => "account", - ConnectAccountReferenceType::Self_ => "self", - } - } -} - -impl AsRef for ConnectAccountReferenceType { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for ConnectAccountReferenceType { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for ConnectAccountReferenceType { - fn default() -> Self { - Self::Account - } -} diff --git a/src/resources/generated/connect_collection_transfer.rs b/src/resources/generated/connect_collection_transfer.rs deleted file mode 100644 index ab8344dac..000000000 --- a/src/resources/generated/connect_collection_transfer.rs +++ /dev/null @@ -1,40 +0,0 @@ -// ====================================== -// This file was automatically generated. -// ====================================== - -use serde::{Deserialize, Serialize}; - -use crate::ids::ConnectCollectionTransferId; -use crate::params::{Expandable, Object}; -use crate::resources::{Account, Currency}; - -/// The resource representing a Stripe "ConnectCollectionTransfer". -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct ConnectCollectionTransfer { - /// Unique identifier for the object. - pub id: ConnectCollectionTransferId, - - /// Amount transferred, in cents (or local equivalent). - pub amount: i64, - - /// Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. - /// - /// Must be a [supported currency](https://stripe.com/docs/currencies). - pub currency: Currency, - - /// ID of the account that funds are being collected for. - pub destination: Expandable, - - /// Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. - pub livemode: bool, -} - -impl Object for ConnectCollectionTransfer { - type Id = ConnectCollectionTransferId; - fn id(&self) -> Self::Id { - self.id.clone() - } - fn object(&self) -> &'static str { - "connect_collection_transfer" - } -} diff --git a/src/resources/generated/country_spec.rs b/src/resources/generated/country_spec.rs deleted file mode 100644 index 2392888f0..000000000 --- a/src/resources/generated/country_spec.rs +++ /dev/null @@ -1,129 +0,0 @@ -// ====================================== -// This file was automatically generated. -// ====================================== - -use crate::client::{Client, Response}; -use crate::ids::{CountrySpecId}; -use crate::params::{Expand, List, Object, Paginable}; -use crate::resources::{Currency}; -use serde::{Deserialize, Serialize}; - -/// The resource representing a Stripe "CountrySpec". -/// -/// For more details see -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CountrySpec { - /// Unique identifier for the object. - /// - /// Represented as the ISO country code for this country. - pub id: CountrySpecId, - - /// The default currency for this country. - /// - /// This applies to both payment methods and bank accounts. - pub default_currency: Currency, - - /// Currencies that can be accepted in the specific country (for transfers). - pub supported_bank_account_currencies: Vec, - - /// Currencies that can be accepted in the specified country (for payments). - pub supported_payment_currencies: Vec, - - /// Payment methods available in the specified country. - /// - /// You may need to enable some payment methods (e.g., [ACH](https://stripe.com/docs/ach)) on your account before they appear in this list. - /// The `stripe` payment method refers to [charging through your platform](https://stripe.com/docs/connect/destination-charges). - pub supported_payment_methods: Vec, - - /// Countries that can accept transfers from the specified country. - pub supported_transfer_countries: Vec, - - pub verification_fields: CountrySpecVerificationFields, -} - -impl CountrySpec { - - /// Lists all Country Spec objects available in the API. -pub fn list(client: &Client, params: &ListCountrySpecs<'_>) -> Response> { - client.get_query("/country_specs", ¶ms) -} - - - /// Returns a Country Spec for a given Country code. - pub fn retrieve(client: &Client, id: &CountrySpecId, expand: &[&str]) -> Response { - client.get_query(&format!("/country_specs/{}", id), &Expand { expand }) - } -} - -impl Object for CountrySpec { - type Id = CountrySpecId; - fn id(&self) -> Self::Id { - self.id.clone() - } - fn object(&self) -> &'static str { - "country_spec" - } -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CountrySpecVerificationFields { - - pub company: CountrySpecVerificationFieldDetails, - - pub individual: CountrySpecVerificationFieldDetails, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CountrySpecVerificationFieldDetails { - - /// Additional fields which are only required for some users. - pub additional: Vec, - - /// Fields which every account must eventually provide. - pub minimum: Vec, -} - -/// The parameters for `CountrySpec::list`. -#[derive(Clone, Debug, Serialize, Default)] -pub struct ListCountrySpecs<'a> { - - /// A cursor for use in pagination. - /// - /// `ending_before` is an object ID that defines your place in the list. - /// For instance, if you make a list request and receive 100 objects, starting with `obj_bar`, your subsequent call can include `ending_before=obj_bar` in order to fetch the previous page of the list. - #[serde(skip_serializing_if = "Option::is_none")] - pub ending_before: Option, - - /// Specifies which fields in the response should be expanded. - #[serde(skip_serializing_if = "Expand::is_empty")] - pub expand: &'a [&'a str], - - /// A limit on the number of objects to be returned. - /// - /// Limit can range between 1 and 100, and the default is 10. - #[serde(skip_serializing_if = "Option::is_none")] - pub limit: Option, - - /// A cursor for use in pagination. - /// - /// `starting_after` is an object ID that defines your place in the list. - /// For instance, if you make a list request and receive 100 objects, ending with `obj_foo`, your subsequent call can include `starting_after=obj_foo` in order to fetch the next page of the list. - #[serde(skip_serializing_if = "Option::is_none")] - pub starting_after: Option, -} - -impl<'a> ListCountrySpecs<'a> { - pub fn new() -> Self { - ListCountrySpecs { - ending_before: Default::default(), - expand: Default::default(), - limit: Default::default(), - starting_after: Default::default(), - } - } -} -impl Paginable for ListCountrySpecs<'_> { - type O = CountrySpec; - fn set_last(&mut self, item: Self::O) { - self.starting_after = Some(item.id()); - }} \ No newline at end of file diff --git a/src/resources/generated/coupon.rs b/src/resources/generated/coupon.rs deleted file mode 100644 index b32bb4f38..000000000 --- a/src/resources/generated/coupon.rs +++ /dev/null @@ -1,391 +0,0 @@ -// ====================================== -// This file was automatically generated. -// ====================================== - -use serde::{Deserialize, Serialize}; - -use crate::client::{Client, Response}; -use crate::ids::CouponId; -use crate::params::{ - CurrencyMap, Deleted, Expand, List, Metadata, Object, Paginable, RangeQuery, Timestamp, -}; -use crate::resources::Currency; - -/// The resource representing a Stripe "Coupon". -/// -/// For more details see -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct Coupon { - /// Unique identifier for the object. - pub id: CouponId, - - /// Amount (in the `currency` specified) that will be taken off the subtotal of any invoices for this customer. - #[serde(skip_serializing_if = "Option::is_none")] - pub amount_off: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub applies_to: Option, - - /// Time at which the object was created. - /// - /// Measured in seconds since the Unix epoch. - #[serde(skip_serializing_if = "Option::is_none")] - pub created: Option, - - /// If `amount_off` has been set, the three-letter [ISO code for the currency](https://stripe.com/docs/currencies) of the amount to take off. - #[serde(skip_serializing_if = "Option::is_none")] - pub currency: Option, - - /// Coupons defined in each available currency option. - /// - /// Each key must be a three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html) and a [supported currency](https://stripe.com/docs/currencies). - #[serde(skip_serializing_if = "Option::is_none")] - pub currency_options: Option>, - - // Always true for a deleted object - #[serde(default)] - pub deleted: bool, - - /// One of `forever`, `once`, and `repeating`. - /// - /// Describes how long a customer who applies this coupon will get the discount. - #[serde(skip_serializing_if = "Option::is_none")] - pub duration: Option, - - /// If `duration` is `repeating`, the number of months the coupon applies. - /// - /// Null if coupon `duration` is `forever` or `once`. - #[serde(skip_serializing_if = "Option::is_none")] - pub duration_in_months: Option, - - /// Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. - #[serde(skip_serializing_if = "Option::is_none")] - pub livemode: Option, - - /// Maximum number of times this coupon can be redeemed, in total, across all customers, before it is no longer valid. - #[serde(skip_serializing_if = "Option::is_none")] - pub max_redemptions: Option, - - /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. - /// - /// This can be useful for storing additional information about the object in a structured format. - #[serde(skip_serializing_if = "Option::is_none")] - pub metadata: Option, - - /// Name of the coupon displayed to customers on for instance invoices or receipts. - #[serde(skip_serializing_if = "Option::is_none")] - pub name: Option, - - /// Percent that will be taken off the subtotal of any invoices for this customer for the duration of the coupon. - /// - /// For example, a coupon with percent_off of 50 will make a $ (or local equivalent)100 invoice $ (or local equivalent)50 instead. - #[serde(skip_serializing_if = "Option::is_none")] - pub percent_off: Option, - - /// Date after which the coupon can no longer be redeemed. - #[serde(skip_serializing_if = "Option::is_none")] - pub redeem_by: Option, - - /// Number of times this coupon has been applied to a customer. - #[serde(skip_serializing_if = "Option::is_none")] - pub times_redeemed: Option, - - /// Taking account of the above properties, whether this coupon can still be applied to a customer. - #[serde(skip_serializing_if = "Option::is_none")] - pub valid: Option, -} - -impl Coupon { - /// Returns a list of your coupons. - pub fn list(client: &Client, params: &ListCoupons<'_>) -> Response> { - client.get_query("/coupons", ¶ms) - } - - /// You can create coupons easily via the [coupon management](https://dashboard.stripe.com/coupons) page of the Stripe dashboard. - /// - /// Coupon creation is also accessible via the API if you need to create coupons on the fly. A coupon has either a `percent_off` or an `amount_off` and `currency`. - /// If you set an `amount_off`, that amount will be subtracted from any invoice’s subtotal. - /// For example, an invoice with a subtotal of $100 will have a final total of $0 if a coupon with an `amount_off` of 20000 is applied to it and an invoice with a subtotal of $300 will have a final total of $100 if a coupon with an `amount_off` of 20000 is applied to it. - pub fn create(client: &Client, params: CreateCoupon<'_>) -> Response { - client.post_form("/coupons", ¶ms) - } - - /// Retrieves the coupon with the given ID. - pub fn retrieve(client: &Client, id: &CouponId, expand: &[&str]) -> Response { - client.get_query(&format!("/coupons/{}", id), &Expand { expand }) - } - - /// Updates the metadata of a coupon. - /// - /// Other coupon details (currency, duration, amount_off) are, by design, not editable. - pub fn update(client: &Client, id: &CouponId, params: UpdateCoupon<'_>) -> Response { - client.post_form(&format!("/coupons/{}", id), ¶ms) - } - - /// You can delete coupons via the [coupon management](https://dashboard.stripe.com/coupons) page of the Stripe dashboard. - /// - /// However, deleting a coupon does not affect any customers who have already applied the coupon; it means that new customers can’t redeem the coupon. - /// You can also delete coupons via the API. - pub fn delete(client: &Client, id: &CouponId) -> Response> { - client.delete(&format!("/coupons/{}", id)) - } -} - -impl Object for Coupon { - type Id = CouponId; - fn id(&self) -> Self::Id { - self.id.clone() - } - fn object(&self) -> &'static str { - "coupon" - } -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CouponAppliesTo { - /// A list of product IDs this coupon applies to. - pub products: Vec, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CouponCurrencyOption { - /// Amount (in the `currency` specified) that will be taken off the subtotal of any invoices for this customer. - pub amount_off: i64, -} - -/// The parameters for `Coupon::create`. -#[derive(Clone, Debug, Serialize, Default)] -pub struct CreateCoupon<'a> { - /// A positive integer representing the amount to subtract from an invoice total (required if `percent_off` is not passed). - #[serde(skip_serializing_if = "Option::is_none")] - pub amount_off: Option, - - /// A hash containing directions for what this Coupon will apply discounts to. - #[serde(skip_serializing_if = "Option::is_none")] - pub applies_to: Option, - - /// Three-letter [ISO code for the currency](https://stripe.com/docs/currencies) of the `amount_off` parameter (required if `amount_off` is passed). - #[serde(skip_serializing_if = "Option::is_none")] - pub currency: Option, - - /// Coupons defined in each available currency option (only supported if `amount_off` is passed). - /// - /// Each key must be a three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html) and a [supported currency](https://stripe.com/docs/currencies). - #[serde(skip_serializing_if = "Option::is_none")] - pub currency_options: Option>, - - /// Specifies how long the discount will be in effect if used on a subscription. - /// - /// Defaults to `once`. - #[serde(skip_serializing_if = "Option::is_none")] - pub duration: Option, - - /// Required only if `duration` is `repeating`, in which case it must be a positive integer that specifies the number of months the discount will be in effect. - #[serde(skip_serializing_if = "Option::is_none")] - pub duration_in_months: Option, - - /// Specifies which fields in the response should be expanded. - #[serde(skip_serializing_if = "Expand::is_empty")] - pub expand: &'a [&'a str], - - /// Unique string of your choice that will be used to identify this coupon when applying it to a customer. - /// - /// If you don't want to specify a particular code, you can leave the ID blank and we'll generate a random code for you. - #[serde(skip_serializing_if = "Option::is_none")] - pub id: Option<&'a str>, - - /// A positive integer specifying the number of times the coupon can be redeemed before it's no longer valid. - /// - /// For example, you might have a 50% off coupon that the first 20 readers of your blog can use. - #[serde(skip_serializing_if = "Option::is_none")] - pub max_redemptions: Option, - - /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. - /// - /// This can be useful for storing additional information about the object in a structured format. - /// Individual keys can be unset by posting an empty value to them. - /// All keys can be unset by posting an empty value to `metadata`. - #[serde(skip_serializing_if = "Option::is_none")] - pub metadata: Option, - - /// Name of the coupon displayed to customers on, for instance invoices, or receipts. - /// - /// By default the `id` is shown if `name` is not set. - #[serde(skip_serializing_if = "Option::is_none")] - pub name: Option<&'a str>, - - /// A positive float larger than 0, and smaller or equal to 100, that represents the discount the coupon will apply (required if `amount_off` is not passed). - #[serde(skip_serializing_if = "Option::is_none")] - pub percent_off: Option, - - /// Unix timestamp specifying the last time at which the coupon can be redeemed. - /// - /// After the redeem_by date, the coupon can no longer be applied to new customers. - #[serde(skip_serializing_if = "Option::is_none")] - pub redeem_by: Option, -} - -impl<'a> CreateCoupon<'a> { - pub fn new() -> Self { - CreateCoupon { - amount_off: Default::default(), - applies_to: Default::default(), - currency: Default::default(), - currency_options: Default::default(), - duration: Default::default(), - duration_in_months: Default::default(), - expand: Default::default(), - id: Default::default(), - max_redemptions: Default::default(), - metadata: Default::default(), - name: Default::default(), - percent_off: Default::default(), - redeem_by: Default::default(), - } - } -} - -/// The parameters for `Coupon::list`. -#[derive(Clone, Debug, Serialize, Default)] -pub struct ListCoupons<'a> { - /// A filter on the list, based on the object `created` field. - /// - /// The value can be a string with an integer Unix timestamp, or it can be a dictionary with a number of different query options. - #[serde(skip_serializing_if = "Option::is_none")] - pub created: Option>, - - /// A cursor for use in pagination. - /// - /// `ending_before` is an object ID that defines your place in the list. - /// For instance, if you make a list request and receive 100 objects, starting with `obj_bar`, your subsequent call can include `ending_before=obj_bar` in order to fetch the previous page of the list. - #[serde(skip_serializing_if = "Option::is_none")] - pub ending_before: Option, - - /// Specifies which fields in the response should be expanded. - #[serde(skip_serializing_if = "Expand::is_empty")] - pub expand: &'a [&'a str], - - /// A limit on the number of objects to be returned. - /// - /// Limit can range between 1 and 100, and the default is 10. - #[serde(skip_serializing_if = "Option::is_none")] - pub limit: Option, - - /// A cursor for use in pagination. - /// - /// `starting_after` is an object ID that defines your place in the list. - /// For instance, if you make a list request and receive 100 objects, ending with `obj_foo`, your subsequent call can include `starting_after=obj_foo` in order to fetch the next page of the list. - #[serde(skip_serializing_if = "Option::is_none")] - pub starting_after: Option, -} - -impl<'a> ListCoupons<'a> { - pub fn new() -> Self { - ListCoupons { - created: Default::default(), - ending_before: Default::default(), - expand: Default::default(), - limit: Default::default(), - starting_after: Default::default(), - } - } -} -impl Paginable for ListCoupons<'_> { - type O = Coupon; - fn set_last(&mut self, item: Self::O) { - self.starting_after = Some(item.id()); - } -} -/// The parameters for `Coupon::update`. -#[derive(Clone, Debug, Serialize, Default)] -pub struct UpdateCoupon<'a> { - /// Coupons defined in each available currency option (only supported if the coupon is amount-based). - /// - /// Each key must be a three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html) and a [supported currency](https://stripe.com/docs/currencies). - #[serde(skip_serializing_if = "Option::is_none")] - pub currency_options: Option>, - - /// Specifies which fields in the response should be expanded. - #[serde(skip_serializing_if = "Expand::is_empty")] - pub expand: &'a [&'a str], - - /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. - /// - /// This can be useful for storing additional information about the object in a structured format. - /// Individual keys can be unset by posting an empty value to them. - /// All keys can be unset by posting an empty value to `metadata`. - #[serde(skip_serializing_if = "Option::is_none")] - pub metadata: Option, - - /// Name of the coupon displayed to customers on, for instance invoices, or receipts. - /// - /// By default the `id` is shown if `name` is not set. - #[serde(skip_serializing_if = "Option::is_none")] - pub name: Option<&'a str>, -} - -impl<'a> UpdateCoupon<'a> { - pub fn new() -> Self { - UpdateCoupon { - currency_options: Default::default(), - expand: Default::default(), - metadata: Default::default(), - name: Default::default(), - } - } -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreateCouponAppliesTo { - /// An array of Product IDs that this Coupon will apply to. - #[serde(skip_serializing_if = "Option::is_none")] - pub products: Option>, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreateCouponCurrencyOptions { - /// A positive integer representing the amount to subtract from an invoice total. - pub amount_off: i64, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UpdateCouponCurrencyOptions { - /// A positive integer representing the amount to subtract from an invoice total. - pub amount_off: i64, -} - -/// An enum representing the possible values of an `Coupon`'s `duration` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CouponDuration { - Forever, - Once, - Repeating, -} - -impl CouponDuration { - pub fn as_str(self) -> &'static str { - match self { - CouponDuration::Forever => "forever", - CouponDuration::Once => "once", - CouponDuration::Repeating => "repeating", - } - } -} - -impl AsRef for CouponDuration { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for CouponDuration { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for CouponDuration { - fn default() -> Self { - Self::Forever - } -} diff --git a/src/resources/generated/coupon_created.rs b/src/resources/generated/coupon_created.rs deleted file mode 100644 index c69faa21a..000000000 --- a/src/resources/generated/coupon_created.rs +++ /dev/null @@ -1,10 +0,0 @@ -// ====================================== -// This file was automatically generated. -// ====================================== - -use serde::{Deserialize, Serialize}; - -/// The resource representing a Stripe "coupon.created". -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CouponCreated { -} diff --git a/src/resources/generated/coupon_deleted.rs b/src/resources/generated/coupon_deleted.rs deleted file mode 100644 index 0723b0189..000000000 --- a/src/resources/generated/coupon_deleted.rs +++ /dev/null @@ -1,10 +0,0 @@ -// ====================================== -// This file was automatically generated. -// ====================================== - -use serde::{Deserialize, Serialize}; - -/// The resource representing a Stripe "coupon.deleted". -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CouponDeleted { -} diff --git a/src/resources/generated/coupon_updated.rs b/src/resources/generated/coupon_updated.rs deleted file mode 100644 index 467f27e43..000000000 --- a/src/resources/generated/coupon_updated.rs +++ /dev/null @@ -1,10 +0,0 @@ -// ====================================== -// This file was automatically generated. -// ====================================== - -use serde::{Deserialize, Serialize}; - -/// The resource representing a Stripe "coupon.updated". -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CouponUpdated { -} diff --git a/src/resources/generated/credit_note.rs b/src/resources/generated/credit_note.rs deleted file mode 100644 index 2d3847d8a..000000000 --- a/src/resources/generated/credit_note.rs +++ /dev/null @@ -1,634 +0,0 @@ -// ====================================== -// This file was automatically generated. -// ====================================== - -use serde::{Deserialize, Serialize}; - -use crate::client::{Client, Response}; -use crate::ids::{CreditNoteId, CustomerId, InvoiceId, RefundId}; -use crate::params::{Expand, Expandable, List, Metadata, Object, Paginable, Timestamp}; -use crate::resources::{ - CreditNoteLineItem, Currency, Customer, CustomerBalanceTransaction, Discount, Invoice, - InvoicesShippingCost, Refund, TaxRate, -}; - -/// The resource representing a Stripe "CreditNote". -/// -/// For more details see -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreditNote { - /// Unique identifier for the object. - pub id: CreditNoteId, - - /// The integer amount in cents (or local equivalent) representing the total amount of the credit note, including tax. - pub amount: i64, - - /// This is the sum of all the shipping amounts. - pub amount_shipping: i64, - - /// Time at which the object was created. - /// - /// Measured in seconds since the Unix epoch. - pub created: Timestamp, - - /// Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. - /// - /// Must be a [supported currency](https://stripe.com/docs/currencies). - pub currency: Currency, - - /// ID of the customer. - pub customer: Expandable, - - /// Customer balance transaction related to this credit note. - pub customer_balance_transaction: Option>, - - /// The integer amount in cents (or local equivalent) representing the total amount of discount that was credited. - pub discount_amount: i64, - - /// The aggregate amounts calculated per discount for all line items. - pub discount_amounts: Vec, - - /// The date when this credit note is in effect. - /// - /// Same as `created` unless overwritten. - /// When defined, this value replaces the system-generated 'Date of issue' printed on the credit note PDF. - pub effective_at: Option, - - /// ID of the invoice. - pub invoice: Expandable, - - /// Line items that make up the credit note. - pub lines: List, - - /// Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. - pub livemode: bool, - - /// Customer-facing text that appears on the credit note PDF. - pub memo: Option, - - /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. - /// - /// This can be useful for storing additional information about the object in a structured format. - pub metadata: Option, - - /// A unique number that identifies this particular credit note and appears on the PDF of the credit note and its associated invoice. - pub number: String, - - /// Amount that was credited outside of Stripe. - pub out_of_band_amount: Option, - - /// The link to download the PDF of the credit note. - pub pdf: String, - - /// Reason for issuing this credit note, one of `duplicate`, `fraudulent`, `order_change`, or `product_unsatisfactory`. - pub reason: Option, - - /// Refund related to this credit note. - pub refund: Option>, - - /// The details of the cost of shipping, including the ShippingRate applied to the invoice. - pub shipping_cost: Option, - - /// Status of this credit note, one of `issued` or `void`. - /// - /// Learn more about [voiding credit notes](https://stripe.com/docs/billing/invoices/credit-notes#voiding). - pub status: CreditNoteStatus, - - /// The integer amount in cents (or local equivalent) representing the amount of the credit note, excluding exclusive tax and invoice level discounts. - pub subtotal: i64, - - /// The integer amount in cents (or local equivalent) representing the amount of the credit note, excluding all tax and invoice level discounts. - pub subtotal_excluding_tax: Option, - - /// The aggregate amounts calculated per tax rate for all line items. - pub tax_amounts: Vec, - - /// The integer amount in cents (or local equivalent) representing the total amount of the credit note, including tax and all discount. - pub total: i64, - - /// The integer amount in cents (or local equivalent) representing the total amount of the credit note, excluding tax, but including discounts. - pub total_excluding_tax: Option, - - /// Type of this credit note, one of `pre_payment` or `post_payment`. - /// - /// A `pre_payment` credit note means it was issued when the invoice was open. - /// A `post_payment` credit note means it was issued when the invoice was paid. - #[serde(rename = "type")] - pub type_: CreditNoteType, - - /// The time that the credit note was voided. - pub voided_at: Option, -} - -impl CreditNote { - /// Returns a list of credit notes. - pub fn list(client: &Client, params: &ListCreditNotes<'_>) -> Response> { - client.get_query("/credit_notes", ¶ms) - } - - /// Issue a credit note to adjust the amount of a finalized invoice. - /// - /// For a `status=open` invoice, a credit note reduces its `amount_due`. - /// For a `status=paid` invoice, a credit note does not affect its `amount_due`. - /// Instead, it can result in any combination of the following:
  • Refund: create a new refund (using `refund_amount`) or link an existing refund (using `refund`).
  • Customer balance credit: credit the customer’s balance (using `credit_amount`) which will be automatically applied to their next invoice when it’s finalized.
  • Outside of Stripe credit: record the amount that is or will be credited outside of Stripe (using `out_of_band_amount`).
For post-payment credit notes the sum of the refund, credit and outside of Stripe amounts must equal the credit note total. You may issue multiple credit notes for an invoice. - /// Each credit note will increment the invoice’s `pre_payment_credit_notes_amount` or `post_payment_credit_notes_amount` depending on its `status` at the time of credit note creation. - pub fn create(client: &Client, params: CreateCreditNote<'_>) -> Response { - client.post_form("/credit_notes", ¶ms) - } - - /// Retrieves the credit note object with the given identifier. - pub fn retrieve(client: &Client, id: &CreditNoteId, expand: &[&str]) -> Response { - client.get_query(&format!("/credit_notes/{}", id), &Expand { expand }) - } - - /// Updates an existing credit note. - pub fn update( - client: &Client, - id: &CreditNoteId, - params: UpdateCreditNote<'_>, - ) -> Response { - client.post_form(&format!("/credit_notes/{}", id), ¶ms) - } -} - -impl Object for CreditNote { - type Id = CreditNoteId; - fn id(&self) -> Self::Id { - self.id.clone() - } - fn object(&self) -> &'static str { - "credit_note" - } -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreditNoteTaxAmount { - /// The amount, in cents (or local equivalent), of the tax. - pub amount: i64, - - /// Whether this tax amount is inclusive or exclusive. - pub inclusive: bool, - - /// The tax rate that was applied to get this tax amount. - pub tax_rate: Expandable, - - /// The reasoning behind this tax, for example, if the product is tax exempt. - /// - /// The possible values for this field may be extended as new tax rules are supported. - pub taxability_reason: Option, - - /// The amount on which tax is calculated, in cents (or local equivalent). - pub taxable_amount: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct DiscountsResourceDiscountAmount { - /// The amount, in cents (or local equivalent), of the discount. - pub amount: i64, - - /// The discount that was applied to get this discount amount. - pub discount: Expandable, -} - -/// The parameters for `CreditNote::create`. -#[derive(Clone, Debug, Serialize)] -pub struct CreateCreditNote<'a> { - /// The integer amount in cents (or local equivalent) representing the total amount of the credit note. - #[serde(skip_serializing_if = "Option::is_none")] - pub amount: Option, - - /// The integer amount in cents (or local equivalent) representing the amount to credit the customer's balance, which will be automatically applied to their next invoice. - #[serde(skip_serializing_if = "Option::is_none")] - pub credit_amount: Option, - - /// The date when this credit note is in effect. - /// - /// Same as `created` unless overwritten. - /// When defined, this value replaces the system-generated 'Date of issue' printed on the credit note PDF. - #[serde(skip_serializing_if = "Option::is_none")] - pub effective_at: Option, - - /// Specifies which fields in the response should be expanded. - #[serde(skip_serializing_if = "Expand::is_empty")] - pub expand: &'a [&'a str], - - /// ID of the invoice. - pub invoice: InvoiceId, - - /// Line items that make up the credit note. - #[serde(skip_serializing_if = "Option::is_none")] - pub lines: Option>, - - /// The credit note's memo appears on the credit note PDF. - #[serde(skip_serializing_if = "Option::is_none")] - pub memo: Option<&'a str>, - - /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. - /// - /// This can be useful for storing additional information about the object in a structured format. - /// Individual keys can be unset by posting an empty value to them. - /// All keys can be unset by posting an empty value to `metadata`. - #[serde(skip_serializing_if = "Option::is_none")] - pub metadata: Option, - - /// The integer amount in cents (or local equivalent) representing the amount that is credited outside of Stripe. - #[serde(skip_serializing_if = "Option::is_none")] - pub out_of_band_amount: Option, - - /// Reason for issuing this credit note, one of `duplicate`, `fraudulent`, `order_change`, or `product_unsatisfactory`. - #[serde(skip_serializing_if = "Option::is_none")] - pub reason: Option, - - /// ID of an existing refund to link this credit note to. - #[serde(skip_serializing_if = "Option::is_none")] - pub refund: Option, - - /// The integer amount in cents (or local equivalent) representing the amount to refund. - /// - /// If set, a refund will be created for the charge associated with the invoice. - #[serde(skip_serializing_if = "Option::is_none")] - pub refund_amount: Option, - - /// When shipping_cost contains the shipping_rate from the invoice, the shipping_cost is included in the credit note. - #[serde(skip_serializing_if = "Option::is_none")] - pub shipping_cost: Option, -} - -impl<'a> CreateCreditNote<'a> { - pub fn new(invoice: InvoiceId) -> Self { - CreateCreditNote { - amount: Default::default(), - credit_amount: Default::default(), - effective_at: Default::default(), - expand: Default::default(), - invoice, - lines: Default::default(), - memo: Default::default(), - metadata: Default::default(), - out_of_band_amount: Default::default(), - reason: Default::default(), - refund: Default::default(), - refund_amount: Default::default(), - shipping_cost: Default::default(), - } - } -} - -/// The parameters for `CreditNote::list`. -#[derive(Clone, Debug, Serialize, Default)] -pub struct ListCreditNotes<'a> { - /// Only return credit notes for the customer specified by this customer ID. - #[serde(skip_serializing_if = "Option::is_none")] - pub customer: Option, - - /// A cursor for use in pagination. - /// - /// `ending_before` is an object ID that defines your place in the list. - /// For instance, if you make a list request and receive 100 objects, starting with `obj_bar`, your subsequent call can include `ending_before=obj_bar` in order to fetch the previous page of the list. - #[serde(skip_serializing_if = "Option::is_none")] - pub ending_before: Option, - - /// Specifies which fields in the response should be expanded. - #[serde(skip_serializing_if = "Expand::is_empty")] - pub expand: &'a [&'a str], - - /// Only return credit notes for the invoice specified by this invoice ID. - #[serde(skip_serializing_if = "Option::is_none")] - pub invoice: Option, - - /// A limit on the number of objects to be returned. - /// - /// Limit can range between 1 and 100, and the default is 10. - #[serde(skip_serializing_if = "Option::is_none")] - pub limit: Option, - - /// A cursor for use in pagination. - /// - /// `starting_after` is an object ID that defines your place in the list. - /// For instance, if you make a list request and receive 100 objects, ending with `obj_foo`, your subsequent call can include `starting_after=obj_foo` in order to fetch the next page of the list. - #[serde(skip_serializing_if = "Option::is_none")] - pub starting_after: Option, -} - -impl<'a> ListCreditNotes<'a> { - pub fn new() -> Self { - ListCreditNotes { - customer: Default::default(), - ending_before: Default::default(), - expand: Default::default(), - invoice: Default::default(), - limit: Default::default(), - starting_after: Default::default(), - } - } -} -impl Paginable for ListCreditNotes<'_> { - type O = CreditNote; - fn set_last(&mut self, item: Self::O) { - self.starting_after = Some(item.id()); - } -} -/// The parameters for `CreditNote::update`. -#[derive(Clone, Debug, Serialize, Default)] -pub struct UpdateCreditNote<'a> { - /// Specifies which fields in the response should be expanded. - #[serde(skip_serializing_if = "Expand::is_empty")] - pub expand: &'a [&'a str], - - /// Credit note memo. - #[serde(skip_serializing_if = "Option::is_none")] - pub memo: Option<&'a str>, - - /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. - /// - /// This can be useful for storing additional information about the object in a structured format. - /// Individual keys can be unset by posting an empty value to them. - /// All keys can be unset by posting an empty value to `metadata`. - #[serde(skip_serializing_if = "Option::is_none")] - pub metadata: Option, -} - -impl<'a> UpdateCreditNote<'a> { - pub fn new() -> Self { - UpdateCreditNote { - expand: Default::default(), - memo: Default::default(), - metadata: Default::default(), - } - } -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreateCreditNoteLines { - /// The line item amount to credit. - /// - /// Only valid when `type` is `invoice_line_item`. - #[serde(skip_serializing_if = "Option::is_none")] - pub amount: Option, - - /// The description of the credit note line item. - /// - /// Only valid when the `type` is `custom_line_item`. - #[serde(skip_serializing_if = "Option::is_none")] - pub description: Option, - - /// The invoice line item to credit. - /// - /// Only valid when the `type` is `invoice_line_item`. - #[serde(skip_serializing_if = "Option::is_none")] - pub invoice_line_item: Option, - - /// The line item quantity to credit. - #[serde(skip_serializing_if = "Option::is_none")] - pub quantity: Option, - - /// A list of up to 10 tax amounts for the credit note line item. - /// - /// Cannot be mixed with `tax_rates`. - #[serde(skip_serializing_if = "Option::is_none")] - pub tax_amounts: Option>, - - /// The tax rates which apply to the credit note line item. - /// - /// Only valid when the `type` is `custom_line_item` and cannot be mixed with `tax_amounts`. - #[serde(skip_serializing_if = "Option::is_none")] - pub tax_rates: Option>, - - /// Type of the credit note line item, one of `invoice_line_item` or `custom_line_item`. - #[serde(rename = "type")] - pub type_: CreateCreditNoteLinesType, - - /// The integer unit amount in cents (or local equivalent) of the credit note line item. - /// - /// This `unit_amount` will be multiplied by the quantity to get the full amount to credit for this line item. - /// Only valid when `type` is `custom_line_item`. - #[serde(skip_serializing_if = "Option::is_none")] - pub unit_amount: Option, - - /// Same as `unit_amount`, but accepts a decimal value in cents (or local equivalent) with at most 12 decimal places. - /// - /// Only one of `unit_amount` and `unit_amount_decimal` can be set. - #[serde(skip_serializing_if = "Option::is_none")] - pub unit_amount_decimal: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreateCreditNoteShippingCost { - /// The ID of the shipping rate to use for this order. - #[serde(skip_serializing_if = "Option::is_none")] - pub shipping_rate: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreateCreditNoteLinesTaxAmounts { - /// The amount, in cents (or local equivalent), of the tax. - pub amount: i64, - - /// The id of the tax rate for this tax amount. - /// - /// The tax rate must have been automatically created by Stripe. - pub tax_rate: String, - - /// The amount on which tax is calculated, in cents (or local equivalent). - pub taxable_amount: i64, -} - -/// An enum representing the possible values of an `CreateCreditNoteLines`'s `type` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CreateCreditNoteLinesType { - CustomLineItem, - InvoiceLineItem, -} - -impl CreateCreditNoteLinesType { - pub fn as_str(self) -> &'static str { - match self { - CreateCreditNoteLinesType::CustomLineItem => "custom_line_item", - CreateCreditNoteLinesType::InvoiceLineItem => "invoice_line_item", - } - } -} - -impl AsRef for CreateCreditNoteLinesType { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for CreateCreditNoteLinesType { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for CreateCreditNoteLinesType { - fn default() -> Self { - Self::CustomLineItem - } -} - -/// An enum representing the possible values of an `CreditNote`'s `reason` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CreditNoteReason { - Duplicate, - Fraudulent, - OrderChange, - ProductUnsatisfactory, -} - -impl CreditNoteReason { - pub fn as_str(self) -> &'static str { - match self { - CreditNoteReason::Duplicate => "duplicate", - CreditNoteReason::Fraudulent => "fraudulent", - CreditNoteReason::OrderChange => "order_change", - CreditNoteReason::ProductUnsatisfactory => "product_unsatisfactory", - } - } -} - -impl AsRef for CreditNoteReason { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for CreditNoteReason { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for CreditNoteReason { - fn default() -> Self { - Self::Duplicate - } -} - -/// An enum representing the possible values of an `CreditNote`'s `status` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CreditNoteStatus { - Issued, - Void, -} - -impl CreditNoteStatus { - pub fn as_str(self) -> &'static str { - match self { - CreditNoteStatus::Issued => "issued", - CreditNoteStatus::Void => "void", - } - } -} - -impl AsRef for CreditNoteStatus { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for CreditNoteStatus { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for CreditNoteStatus { - fn default() -> Self { - Self::Issued - } -} - -/// An enum representing the possible values of an `CreditNoteTaxAmount`'s `taxability_reason` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CreditNoteTaxAmountTaxabilityReason { - CustomerExempt, - NotCollecting, - NotSubjectToTax, - NotSupported, - PortionProductExempt, - PortionReducedRated, - PortionStandardRated, - ProductExempt, - ProductExemptHoliday, - ProportionallyRated, - ReducedRated, - ReverseCharge, - StandardRated, - TaxableBasisReduced, - ZeroRated, -} - -impl CreditNoteTaxAmountTaxabilityReason { - pub fn as_str(self) -> &'static str { - match self { - CreditNoteTaxAmountTaxabilityReason::CustomerExempt => "customer_exempt", - CreditNoteTaxAmountTaxabilityReason::NotCollecting => "not_collecting", - CreditNoteTaxAmountTaxabilityReason::NotSubjectToTax => "not_subject_to_tax", - CreditNoteTaxAmountTaxabilityReason::NotSupported => "not_supported", - CreditNoteTaxAmountTaxabilityReason::PortionProductExempt => "portion_product_exempt", - CreditNoteTaxAmountTaxabilityReason::PortionReducedRated => "portion_reduced_rated", - CreditNoteTaxAmountTaxabilityReason::PortionStandardRated => "portion_standard_rated", - CreditNoteTaxAmountTaxabilityReason::ProductExempt => "product_exempt", - CreditNoteTaxAmountTaxabilityReason::ProductExemptHoliday => "product_exempt_holiday", - CreditNoteTaxAmountTaxabilityReason::ProportionallyRated => "proportionally_rated", - CreditNoteTaxAmountTaxabilityReason::ReducedRated => "reduced_rated", - CreditNoteTaxAmountTaxabilityReason::ReverseCharge => "reverse_charge", - CreditNoteTaxAmountTaxabilityReason::StandardRated => "standard_rated", - CreditNoteTaxAmountTaxabilityReason::TaxableBasisReduced => "taxable_basis_reduced", - CreditNoteTaxAmountTaxabilityReason::ZeroRated => "zero_rated", - } - } -} - -impl AsRef for CreditNoteTaxAmountTaxabilityReason { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for CreditNoteTaxAmountTaxabilityReason { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for CreditNoteTaxAmountTaxabilityReason { - fn default() -> Self { - Self::CustomerExempt - } -} - -/// An enum representing the possible values of an `CreditNote`'s `type` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CreditNoteType { - PostPayment, - PrePayment, -} - -impl CreditNoteType { - pub fn as_str(self) -> &'static str { - match self { - CreditNoteType::PostPayment => "post_payment", - CreditNoteType::PrePayment => "pre_payment", - } - } -} - -impl AsRef for CreditNoteType { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for CreditNoteType { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for CreditNoteType { - fn default() -> Self { - Self::PostPayment - } -} diff --git a/src/resources/generated/credit_note_created.rs b/src/resources/generated/credit_note_created.rs deleted file mode 100644 index ee5b3001f..000000000 --- a/src/resources/generated/credit_note_created.rs +++ /dev/null @@ -1,10 +0,0 @@ -// ====================================== -// This file was automatically generated. -// ====================================== - -use serde::{Deserialize, Serialize}; - -/// The resource representing a Stripe "credit_note.created". -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreditNoteCreated { -} diff --git a/src/resources/generated/credit_note_line_item.rs b/src/resources/generated/credit_note_line_item.rs deleted file mode 100644 index 4461be9d3..000000000 --- a/src/resources/generated/credit_note_line_item.rs +++ /dev/null @@ -1,197 +0,0 @@ -// ====================================== -// This file was automatically generated. -// ====================================== - -use serde::{Deserialize, Serialize}; - -use crate::ids::CreditNoteLineItemId; -use crate::params::{Expandable, Object}; -use crate::resources::{Discount, TaxRate}; - -/// The resource representing a Stripe "CreditNoteLineItem". -/// -/// For more details see -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreditNoteLineItem { - /// Unique identifier for the object. - pub id: CreditNoteLineItemId, - - /// The integer amount in cents (or local equivalent) representing the gross amount being credited for this line item, excluding (exclusive) tax and discounts. - pub amount: i64, - - /// The integer amount in cents (or local equivalent) representing the amount being credited for this line item, excluding all tax and discounts. - pub amount_excluding_tax: Option, - - /// Description of the item being credited. - pub description: Option, - - /// The integer amount in cents (or local equivalent) representing the discount being credited for this line item. - pub discount_amount: i64, - - /// The amount of discount calculated per discount for this line item. - pub discount_amounts: Vec, - - /// ID of the invoice line item being credited. - #[serde(skip_serializing_if = "Option::is_none")] - pub invoice_line_item: Option, - - /// Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. - pub livemode: bool, - - /// The number of units of product being credited. - pub quantity: Option, - - /// The amount of tax calculated per tax rate for this line item. - pub tax_amounts: Vec, - - /// The tax rates which apply to the line item. - pub tax_rates: Vec, - - /// The type of the credit note line item, one of `invoice_line_item` or `custom_line_item`. - /// - /// When the type is `invoice_line_item` there is an additional `invoice_line_item` property on the resource the value of which is the id of the credited line item on the invoice. - #[serde(rename = "type")] - pub type_: CreditNoteLineItemType, - - /// The cost of each unit of product being credited. - pub unit_amount: Option, - - /// Same as `unit_amount`, but contains a decimal value with at most 12 decimal places. - pub unit_amount_decimal: Option, - - /// The amount in cents (or local equivalent) representing the unit amount being credited for this line item, excluding all tax and discounts. - pub unit_amount_excluding_tax: Option, -} - -impl Object for CreditNoteLineItem { - type Id = CreditNoteLineItemId; - fn id(&self) -> Self::Id { - self.id.clone() - } - fn object(&self) -> &'static str { - "credit_note_line_item" - } -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreditNoteTaxAmount { - /// The amount, in cents (or local equivalent), of the tax. - pub amount: i64, - - /// Whether this tax amount is inclusive or exclusive. - pub inclusive: bool, - - /// The tax rate that was applied to get this tax amount. - pub tax_rate: Expandable, - - /// The reasoning behind this tax, for example, if the product is tax exempt. - /// - /// The possible values for this field may be extended as new tax rules are supported. - pub taxability_reason: Option, - - /// The amount on which tax is calculated, in cents (or local equivalent). - pub taxable_amount: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct DiscountsResourceDiscountAmount { - /// The amount, in cents (or local equivalent), of the discount. - pub amount: i64, - - /// The discount that was applied to get this discount amount. - pub discount: Expandable, -} - -/// An enum representing the possible values of an `CreditNoteLineItem`'s `type` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CreditNoteLineItemType { - CustomLineItem, - InvoiceLineItem, -} - -impl CreditNoteLineItemType { - pub fn as_str(self) -> &'static str { - match self { - CreditNoteLineItemType::CustomLineItem => "custom_line_item", - CreditNoteLineItemType::InvoiceLineItem => "invoice_line_item", - } - } -} - -impl AsRef for CreditNoteLineItemType { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for CreditNoteLineItemType { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for CreditNoteLineItemType { - fn default() -> Self { - Self::CustomLineItem - } -} - -/// An enum representing the possible values of an `CreditNoteTaxAmount`'s `taxability_reason` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CreditNoteTaxAmountTaxabilityReason { - CustomerExempt, - NotCollecting, - NotSubjectToTax, - NotSupported, - PortionProductExempt, - PortionReducedRated, - PortionStandardRated, - ProductExempt, - ProductExemptHoliday, - ProportionallyRated, - ReducedRated, - ReverseCharge, - StandardRated, - TaxableBasisReduced, - ZeroRated, -} - -impl CreditNoteTaxAmountTaxabilityReason { - pub fn as_str(self) -> &'static str { - match self { - CreditNoteTaxAmountTaxabilityReason::CustomerExempt => "customer_exempt", - CreditNoteTaxAmountTaxabilityReason::NotCollecting => "not_collecting", - CreditNoteTaxAmountTaxabilityReason::NotSubjectToTax => "not_subject_to_tax", - CreditNoteTaxAmountTaxabilityReason::NotSupported => "not_supported", - CreditNoteTaxAmountTaxabilityReason::PortionProductExempt => "portion_product_exempt", - CreditNoteTaxAmountTaxabilityReason::PortionReducedRated => "portion_reduced_rated", - CreditNoteTaxAmountTaxabilityReason::PortionStandardRated => "portion_standard_rated", - CreditNoteTaxAmountTaxabilityReason::ProductExempt => "product_exempt", - CreditNoteTaxAmountTaxabilityReason::ProductExemptHoliday => "product_exempt_holiday", - CreditNoteTaxAmountTaxabilityReason::ProportionallyRated => "proportionally_rated", - CreditNoteTaxAmountTaxabilityReason::ReducedRated => "reduced_rated", - CreditNoteTaxAmountTaxabilityReason::ReverseCharge => "reverse_charge", - CreditNoteTaxAmountTaxabilityReason::StandardRated => "standard_rated", - CreditNoteTaxAmountTaxabilityReason::TaxableBasisReduced => "taxable_basis_reduced", - CreditNoteTaxAmountTaxabilityReason::ZeroRated => "zero_rated", - } - } -} - -impl AsRef for CreditNoteTaxAmountTaxabilityReason { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for CreditNoteTaxAmountTaxabilityReason { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for CreditNoteTaxAmountTaxabilityReason { - fn default() -> Self { - Self::CustomerExempt - } -} diff --git a/src/resources/generated/credit_note_updated.rs b/src/resources/generated/credit_note_updated.rs deleted file mode 100644 index 570b02723..000000000 --- a/src/resources/generated/credit_note_updated.rs +++ /dev/null @@ -1,10 +0,0 @@ -// ====================================== -// This file was automatically generated. -// ====================================== - -use serde::{Deserialize, Serialize}; - -/// The resource representing a Stripe "credit_note.updated". -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreditNoteUpdated { -} diff --git a/src/resources/generated/credit_note_voided.rs b/src/resources/generated/credit_note_voided.rs deleted file mode 100644 index e6e836fcc..000000000 --- a/src/resources/generated/credit_note_voided.rs +++ /dev/null @@ -1,10 +0,0 @@ -// ====================================== -// This file was automatically generated. -// ====================================== - -use serde::{Deserialize, Serialize}; - -/// The resource representing a Stripe "credit_note.voided". -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreditNoteVoided { -} diff --git a/src/resources/generated/customer.rs b/src/resources/generated/customer.rs deleted file mode 100644 index 74290612c..000000000 --- a/src/resources/generated/customer.rs +++ /dev/null @@ -1,1299 +0,0 @@ -// ====================================== -// This file was automatically generated. -// ====================================== - -use serde::{Deserialize, Serialize}; - -use crate::client::{Client, Response}; -use crate::ids::{CouponId, CustomerId, PaymentMethodId, PaymentSourceId, PromotionCodeId}; -use crate::params::{ - Deleted, Expand, Expandable, List, Metadata, Object, Paginable, RangeQuery, Timestamp, -}; -use crate::resources::{ - Address, CashBalance, Currency, Discount, InvoiceSettingRenderingOptions, PaymentMethod, - PaymentSource, PaymentSourceParams, Shipping, Subscription, TaxId, TestHelpersTestClock, -}; - -/// The resource representing a Stripe "Customer". -/// -/// For more details see -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct Customer { - /// Unique identifier for the object. - pub id: CustomerId, - - /// The customer's address. - #[serde(skip_serializing_if = "Option::is_none")] - pub address: Option
, - - /// The current balance, if any, that's stored on the customer. - /// - /// If negative, the customer has credit to apply to their next invoice. - /// If positive, the customer has an amount owed that's added to their next invoice. - /// The balance only considers amounts that Stripe hasn't successfully applied to any invoice. - /// It doesn't reflect unpaid invoices. - /// This balance is only taken into account after invoices finalize. - #[serde(skip_serializing_if = "Option::is_none")] - pub balance: Option, - - /// The current funds being held by Stripe on behalf of the customer. - /// - /// You can apply these funds towards payment intents when the source is "cash_balance". - /// The `settings[reconciliation_mode]` field describes if these funds apply to these payment intents manually or automatically. - #[serde(skip_serializing_if = "Option::is_none")] - pub cash_balance: Option, - - /// Time at which the object was created. - /// - /// Measured in seconds since the Unix epoch. - #[serde(skip_serializing_if = "Option::is_none")] - pub created: Option, - - /// Three-letter [ISO code for the currency](https://stripe.com/docs/currencies) the customer can be charged in for recurring billing purposes. - #[serde(skip_serializing_if = "Option::is_none")] - pub currency: Option, - - /// ID of the default payment source for the customer. - /// - /// If you use payment methods created through the PaymentMethods API, see the [invoice_settings.default_payment_method](https://stripe.com/docs/api/customers/object#customer_object-invoice_settings-default_payment_method) field instead. - #[serde(skip_serializing_if = "Option::is_none")] - pub default_source: Option>, - - // Always true for a deleted object - #[serde(default)] - pub deleted: bool, - - /// Tracks the most recent state change on any invoice belonging to the customer. - /// - /// Paying an invoice or marking it uncollectible via the API will set this field to false. - /// An automatic payment failure or passing the `invoice.due_date` will set this field to `true`. If an invoice becomes uncollectible by [dunning](https://stripe.com/docs/billing/automatic-collection), `delinquent` doesn't reset to `false`. If you care whether the customer has paid their most recent subscription invoice, use `subscription.status` instead. - /// Paying or marking uncollectible any customer invoice regardless of whether it is the latest invoice for a subscription will always set this field to `false`. - #[serde(skip_serializing_if = "Option::is_none")] - pub delinquent: Option, - - /// An arbitrary string attached to the object. - /// - /// Often useful for displaying to users. - #[serde(skip_serializing_if = "Option::is_none")] - pub description: Option, - - /// Describes the current discount active on the customer, if there is one. - #[serde(skip_serializing_if = "Option::is_none")] - pub discount: Option, - - /// The customer's email address. - #[serde(skip_serializing_if = "Option::is_none")] - pub email: Option, - - /// The current multi-currency balances, if any, that's stored on the customer. - /// - /// If positive in a currency, the customer has a credit to apply to their next invoice denominated in that currency. - /// If negative, the customer has an amount owed that's added to their next invoice denominated in that currency. - /// These balances don't apply to unpaid invoices. - /// They solely track amounts that Stripe hasn't successfully applied to any invoice. - /// Stripe only applies a balance in a specific currency to an invoice after that invoice (which is in the same currency) finalizes. - #[serde(skip_serializing_if = "Option::is_none")] - pub invoice_credit_balance: Option, - - /// The prefix for the customer used to generate unique invoice numbers. - #[serde(skip_serializing_if = "Option::is_none")] - pub invoice_prefix: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub invoice_settings: Option, - - /// Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. - #[serde(skip_serializing_if = "Option::is_none")] - pub livemode: Option, - - /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. - /// - /// This can be useful for storing additional information about the object in a structured format. - #[serde(skip_serializing_if = "Option::is_none")] - pub metadata: Option, - - /// The customer's full name or business name. - #[serde(skip_serializing_if = "Option::is_none")] - pub name: Option, - - /// The suffix of the customer's next invoice number (for example, 0001). - #[serde(skip_serializing_if = "Option::is_none")] - pub next_invoice_sequence: Option, - - /// The customer's phone number. - #[serde(skip_serializing_if = "Option::is_none")] - pub phone: Option, - - /// The customer's preferred locales (languages), ordered by preference. - #[serde(skip_serializing_if = "Option::is_none")] - pub preferred_locales: Option>, - - /// Mailing and shipping address for the customer. - /// - /// Appears on invoices emailed to this customer. - #[serde(skip_serializing_if = "Option::is_none")] - pub shipping: Option, - - /// The customer's payment sources, if any. - #[serde(default)] - pub sources: List, - - /// The customer's current subscriptions, if any. - #[serde(skip_serializing_if = "Option::is_none")] - pub subscriptions: Option>, - - #[serde(skip_serializing_if = "Option::is_none")] - pub tax: Option, - - /// Describes the customer's tax exemption status, which is `none`, `exempt`, or `reverse`. - /// - /// When set to `reverse`, invoice and receipt PDFs include the following text: **"Reverse charge"**. - #[serde(skip_serializing_if = "Option::is_none")] - pub tax_exempt: Option, - - /// The customer's tax IDs. - #[serde(skip_serializing_if = "Option::is_none")] - pub tax_ids: Option>, - - /// ID of the test clock that this customer belongs to. - #[serde(skip_serializing_if = "Option::is_none")] - pub test_clock: Option>, -} - -impl Customer { - /// Returns a list of your customers. - /// - /// The customers are returned sorted by creation date, with the most recent customers appearing first. - pub fn list(client: &Client, params: &ListCustomers<'_>) -> Response> { - client.get_query("/customers", ¶ms) - } - - /// Creates a new customer object. - pub fn create(client: &Client, params: CreateCustomer<'_>) -> Response { - client.post_form("/customers", ¶ms) - } - - /// Retrieves a Customer object. - pub fn retrieve(client: &Client, id: &CustomerId, expand: &[&str]) -> Response { - client.get_query(&format!("/customers/{}", id), &Expand { expand }) - } - - /// Updates the specified customer by setting the values of the parameters passed. - /// - /// Any parameters not provided will be left unchanged. - /// For example, if you pass the **source** parameter, that becomes the customer’s active source (e.g., a card) to be used for all charges in the future. - /// When you update a customer to a new valid card source by passing the **source** parameter: for each of the customer’s current subscriptions, if the subscription bills automatically and is in the `past_due` state, then the latest open invoice for the subscription with automatic collection enabled will be retried. - /// This retry will not count as an automatic retry, and will not affect the next regularly scheduled payment for the invoice. - /// Changing the **default_source** for a customer will not trigger this behavior. This request accepts mostly the same arguments as the customer creation call. - pub fn update( - client: &Client, - id: &CustomerId, - params: UpdateCustomer<'_>, - ) -> Response { - client.post_form(&format!("/customers/{}", id), ¶ms) - } - - /// Permanently deletes a customer. - /// - /// It cannot be undone. - /// Also immediately cancels any active subscriptions on the customer. - pub fn delete(client: &Client, id: &CustomerId) -> Response> { - client.delete(&format!("/customers/{}", id)) - } -} - -impl Object for Customer { - type Id = CustomerId; - fn id(&self) -> Self::Id { - self.id.clone() - } - fn object(&self) -> &'static str { - "customer" - } -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CustomerTax { - /// Surfaces if automatic tax computation is possible given the current customer location information. - pub automatic_tax: CustomerTaxAutomaticTax, - - /// A recent IP address of the customer used for tax reporting and tax location inference. - pub ip_address: Option, - - /// The customer's location as identified by Stripe Tax. - pub location: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CustomerTaxLocation { - /// The customer's country as identified by Stripe Tax. - pub country: String, - - /// The data source used to infer the customer's location. - pub source: CustomerTaxLocationSource, - - /// The customer's state, county, province, or region as identified by Stripe Tax. - pub state: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct InvoiceSettingCustomerSetting { - /// Default custom fields to be displayed on invoices for this customer. - pub custom_fields: Option>, - - /// ID of a payment method that's attached to the customer, to be used as the customer's default payment method for subscriptions and invoices. - pub default_payment_method: Option>, - - /// Default footer to be displayed on invoices for this customer. - pub footer: Option, - - /// Default options for invoice PDF rendering for this customer. - pub rendering_options: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct InvoiceSettingCustomField { - /// The name of the custom field. - pub name: String, - - /// The value of the custom field. - pub value: String, -} - -/// The parameters for `Customer::create`. -#[derive(Clone, Debug, Serialize, Default)] -pub struct CreateCustomer<'a> { - /// The customer's address. - #[serde(skip_serializing_if = "Option::is_none")] - pub address: Option
, - - /// An integer amount in cents (or local equivalent) that represents the customer's current balance, which affect the customer's future invoices. - /// - /// A negative amount represents a credit that decreases the amount due on an invoice; a positive amount increases the amount due on an invoice. - #[serde(skip_serializing_if = "Option::is_none")] - pub balance: Option, - - /// Balance information and default balance settings for this customer. - #[serde(skip_serializing_if = "Option::is_none")] - pub cash_balance: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub coupon: Option, - - /// An arbitrary string that you can attach to a customer object. - /// - /// It is displayed alongside the customer in the dashboard. - #[serde(skip_serializing_if = "Option::is_none")] - pub description: Option<&'a str>, - - /// Customer's email address. - /// - /// It's displayed alongside the customer in your dashboard and can be useful for searching and tracking. - /// This may be up to *512 characters*. - #[serde(skip_serializing_if = "Option::is_none")] - pub email: Option<&'a str>, - - /// Specifies which fields in the response should be expanded. - #[serde(skip_serializing_if = "Expand::is_empty")] - pub expand: &'a [&'a str], - - /// The prefix for the customer used to generate unique invoice numbers. - /// - /// Must be 3–12 uppercase letters or numbers. - #[serde(skip_serializing_if = "Option::is_none")] - pub invoice_prefix: Option<&'a str>, - - /// Default invoice settings for this customer. - #[serde(skip_serializing_if = "Option::is_none")] - pub invoice_settings: Option, - - /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. - /// - /// This can be useful for storing additional information about the object in a structured format. - /// Individual keys can be unset by posting an empty value to them. - /// All keys can be unset by posting an empty value to `metadata`. - #[serde(skip_serializing_if = "Option::is_none")] - pub metadata: Option, - - /// The customer's full name or business name. - #[serde(skip_serializing_if = "Option::is_none")] - pub name: Option<&'a str>, - - /// The sequence to be used on the customer's next invoice. - /// - /// Defaults to 1. - #[serde(skip_serializing_if = "Option::is_none")] - pub next_invoice_sequence: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub payment_method: Option, - - /// The customer's phone number. - #[serde(skip_serializing_if = "Option::is_none")] - pub phone: Option<&'a str>, - - /// Customer's preferred languages, ordered by preference. - #[serde(skip_serializing_if = "Option::is_none")] - pub preferred_locales: Option>, - - /// The API ID of a promotion code to apply to the customer. - /// - /// The customer will have a discount applied on all recurring payments. - /// Charges you create through the API will not have the discount. - #[serde(skip_serializing_if = "Option::is_none")] - pub promotion_code: Option, - - /// The customer's shipping information. - /// - /// Appears on invoices emailed to this customer. - #[serde(skip_serializing_if = "Option::is_none")] - pub shipping: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub source: Option, - - /// Tax details about the customer. - #[serde(skip_serializing_if = "Option::is_none")] - pub tax: Option, - - /// The customer's tax exemption. - /// - /// One of `none`, `exempt`, or `reverse`. - #[serde(skip_serializing_if = "Option::is_none")] - pub tax_exempt: Option, - - /// The customer's tax IDs. - #[serde(skip_serializing_if = "Option::is_none")] - pub tax_id_data: Option>, - - /// ID of the test clock to attach to the customer. - #[serde(skip_serializing_if = "Option::is_none")] - pub test_clock: Option<&'a str>, - - #[serde(skip_serializing_if = "Option::is_none")] - pub validate: Option, -} - -impl<'a> CreateCustomer<'a> { - pub fn new() -> Self { - CreateCustomer { - address: Default::default(), - balance: Default::default(), - cash_balance: Default::default(), - coupon: Default::default(), - description: Default::default(), - email: Default::default(), - expand: Default::default(), - invoice_prefix: Default::default(), - invoice_settings: Default::default(), - metadata: Default::default(), - name: Default::default(), - next_invoice_sequence: Default::default(), - payment_method: Default::default(), - phone: Default::default(), - preferred_locales: Default::default(), - promotion_code: Default::default(), - shipping: Default::default(), - source: Default::default(), - tax: Default::default(), - tax_exempt: Default::default(), - tax_id_data: Default::default(), - test_clock: Default::default(), - validate: Default::default(), - } - } -} - -/// The parameters for `Customer::list`. -#[derive(Clone, Debug, Serialize, Default)] -pub struct ListCustomers<'a> { - #[serde(skip_serializing_if = "Option::is_none")] - pub created: Option>, - - /// A case-sensitive filter on the list based on the customer's `email` field. - /// - /// The value must be a string. - #[serde(skip_serializing_if = "Option::is_none")] - pub email: Option<&'a str>, - - /// A cursor for use in pagination. - /// - /// `ending_before` is an object ID that defines your place in the list. - /// For instance, if you make a list request and receive 100 objects, starting with `obj_bar`, your subsequent call can include `ending_before=obj_bar` in order to fetch the previous page of the list. - #[serde(skip_serializing_if = "Option::is_none")] - pub ending_before: Option, - - /// Specifies which fields in the response should be expanded. - #[serde(skip_serializing_if = "Expand::is_empty")] - pub expand: &'a [&'a str], - - /// A limit on the number of objects to be returned. - /// - /// Limit can range between 1 and 100, and the default is 10. - #[serde(skip_serializing_if = "Option::is_none")] - pub limit: Option, - - /// A cursor for use in pagination. - /// - /// `starting_after` is an object ID that defines your place in the list. - /// For instance, if you make a list request and receive 100 objects, ending with `obj_foo`, your subsequent call can include `starting_after=obj_foo` in order to fetch the next page of the list. - #[serde(skip_serializing_if = "Option::is_none")] - pub starting_after: Option, - - /// Provides a list of customers that are associated with the specified test clock. - /// - /// The response will not include customers with test clocks if this parameter is not set. - #[serde(skip_serializing_if = "Option::is_none")] - pub test_clock: Option<&'a str>, -} - -impl<'a> ListCustomers<'a> { - pub fn new() -> Self { - ListCustomers { - created: Default::default(), - email: Default::default(), - ending_before: Default::default(), - expand: Default::default(), - limit: Default::default(), - starting_after: Default::default(), - test_clock: Default::default(), - } - } -} -impl Paginable for ListCustomers<'_> { - type O = Customer; - fn set_last(&mut self, item: Self::O) { - self.starting_after = Some(item.id()); - } -} -/// The parameters for `Customer::update`. -#[derive(Clone, Debug, Serialize, Default)] -pub struct UpdateCustomer<'a> { - /// The customer's address. - #[serde(skip_serializing_if = "Option::is_none")] - pub address: Option
, - - /// An integer amount in cents (or local equivalent) that represents the customer's current balance, which affect the customer's future invoices. - /// - /// A negative amount represents a credit that decreases the amount due on an invoice; a positive amount increases the amount due on an invoice. - #[serde(skip_serializing_if = "Option::is_none")] - pub balance: Option, - - /// Balance information and default balance settings for this customer. - #[serde(skip_serializing_if = "Option::is_none")] - pub cash_balance: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub coupon: Option, - - /// If you are using payment methods created via the PaymentMethods API, see the [invoice_settings.default_payment_method](https://stripe.com/docs/api/customers/update#update_customer-invoice_settings-default_payment_method) parameter. - /// - /// Provide the ID of a payment source already attached to this customer to make it this customer's default payment source. - /// - /// If you want to add a new payment source and make it the default, see the [source](https://stripe.com/docs/api/customers/update#update_customer-source) property. - #[serde(skip_serializing_if = "Option::is_none")] - pub default_source: Option, - - /// An arbitrary string that you can attach to a customer object. - /// - /// It is displayed alongside the customer in the dashboard. - #[serde(skip_serializing_if = "Option::is_none")] - pub description: Option<&'a str>, - - /// Customer's email address. - /// - /// It's displayed alongside the customer in your dashboard and can be useful for searching and tracking. - /// This may be up to *512 characters*. - #[serde(skip_serializing_if = "Option::is_none")] - pub email: Option<&'a str>, - - /// Specifies which fields in the response should be expanded. - #[serde(skip_serializing_if = "Expand::is_empty")] - pub expand: &'a [&'a str], - - /// The prefix for the customer used to generate unique invoice numbers. - /// - /// Must be 3–12 uppercase letters or numbers. - #[serde(skip_serializing_if = "Option::is_none")] - pub invoice_prefix: Option<&'a str>, - - /// Default invoice settings for this customer. - #[serde(skip_serializing_if = "Option::is_none")] - pub invoice_settings: Option, - - /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. - /// - /// This can be useful for storing additional information about the object in a structured format. - /// Individual keys can be unset by posting an empty value to them. - /// All keys can be unset by posting an empty value to `metadata`. - #[serde(skip_serializing_if = "Option::is_none")] - pub metadata: Option, - - /// The customer's full name or business name. - #[serde(skip_serializing_if = "Option::is_none")] - pub name: Option<&'a str>, - - /// The sequence to be used on the customer's next invoice. - /// - /// Defaults to 1. - #[serde(skip_serializing_if = "Option::is_none")] - pub next_invoice_sequence: Option, - - /// The customer's phone number. - #[serde(skip_serializing_if = "Option::is_none")] - pub phone: Option<&'a str>, - - /// Customer's preferred languages, ordered by preference. - #[serde(skip_serializing_if = "Option::is_none")] - pub preferred_locales: Option>, - - /// The API ID of a promotion code to apply to the customer. - /// - /// The customer will have a discount applied on all recurring payments. - /// Charges you create through the API will not have the discount. - #[serde(skip_serializing_if = "Option::is_none")] - pub promotion_code: Option, - - /// The customer's shipping information. - /// - /// Appears on invoices emailed to this customer. - #[serde(skip_serializing_if = "Option::is_none")] - pub shipping: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub source: Option, - - /// Tax details about the customer. - #[serde(skip_serializing_if = "Option::is_none")] - pub tax: Option, - - /// The customer's tax exemption. - /// - /// One of `none`, `exempt`, or `reverse`. - #[serde(skip_serializing_if = "Option::is_none")] - pub tax_exempt: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub validate: Option, -} - -impl<'a> UpdateCustomer<'a> { - pub fn new() -> Self { - UpdateCustomer { - address: Default::default(), - balance: Default::default(), - cash_balance: Default::default(), - coupon: Default::default(), - default_source: Default::default(), - description: Default::default(), - email: Default::default(), - expand: Default::default(), - invoice_prefix: Default::default(), - invoice_settings: Default::default(), - metadata: Default::default(), - name: Default::default(), - next_invoice_sequence: Default::default(), - phone: Default::default(), - preferred_locales: Default::default(), - promotion_code: Default::default(), - shipping: Default::default(), - source: Default::default(), - tax: Default::default(), - tax_exempt: Default::default(), - validate: Default::default(), - } - } -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreateCustomerCashBalance { - /// Settings controlling the behavior of the customer's cash balance, - /// such as reconciliation of funds received. - #[serde(skip_serializing_if = "Option::is_none")] - pub settings: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreateCustomerShipping { - /// Customer shipping address. - pub address: CreateCustomerShippingAddress, - - /// Customer name. - pub name: String, - - /// Customer phone (including extension). - #[serde(skip_serializing_if = "Option::is_none")] - pub phone: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreateCustomerTax { - /// A recent IP address of the customer used for tax reporting and tax location inference. - /// - /// Stripe recommends updating the IP address when a new PaymentMethod is attached or the address field on the customer is updated. - /// We recommend against updating this field more frequently since it could result in unexpected tax location/reporting outcomes. - #[serde(skip_serializing_if = "Option::is_none")] - pub ip_address: Option, - - /// A flag that indicates when Stripe should validate the customer tax location. - /// - /// Defaults to `deferred`. - #[serde(skip_serializing_if = "Option::is_none")] - pub validate_location: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CustomerInvoiceSettings { - /// The list of up to 4 default custom fields to be displayed on invoices for this customer. - /// - /// When updating, pass an empty string to remove previously-defined fields. - #[serde(skip_serializing_if = "Option::is_none")] - pub custom_fields: Option>, - - /// ID of a payment method that's attached to the customer, to be used as the customer's default payment method for subscriptions and invoices. - #[serde(skip_serializing_if = "Option::is_none")] - pub default_payment_method: Option, - - /// Default footer to be displayed on invoices for this customer. - #[serde(skip_serializing_if = "Option::is_none")] - pub footer: Option, - - /// Default options for invoice PDF rendering for this customer. - #[serde(skip_serializing_if = "Option::is_none")] - pub rendering_options: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct TaxIdData { - /// Type of the tax ID, one of `ad_nrt`, `ae_trn`, `ar_cuit`, `au_abn`, `au_arn`, `bg_uic`, `bo_tin`, `br_cnpj`, `br_cpf`, `ca_bn`, `ca_gst_hst`, `ca_pst_bc`, `ca_pst_mb`, `ca_pst_sk`, `ca_qst`, `ch_vat`, `cl_tin`, `cn_tin`, `co_nit`, `cr_tin`, `do_rcn`, `ec_ruc`, `eg_tin`, `es_cif`, `eu_oss_vat`, `eu_vat`, `gb_vat`, `ge_vat`, `hk_br`, `hu_tin`, `id_npwp`, `il_vat`, `in_gst`, `is_vat`, `jp_cn`, `jp_rn`, `jp_trn`, `ke_pin`, `kr_brn`, `li_uid`, `mx_rfc`, `my_frp`, `my_itn`, `my_sst`, `no_vat`, `nz_gst`, `pe_ruc`, `ph_tin`, `ro_tin`, `rs_pib`, `ru_inn`, `ru_kpp`, `sa_vat`, `sg_gst`, `sg_uen`, `si_tin`, `sv_nit`, `th_vat`, `tr_tin`, `tw_vat`, `ua_vat`, `us_ein`, `uy_ruc`, `ve_rif`, `vn_tin`, or `za_vat`. - #[serde(rename = "type")] - pub type_: TaxIdType, - - /// Value of the tax ID. - pub value: String, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UpdateCustomerCashBalance { - /// Settings controlling the behavior of the customer's cash balance, - /// such as reconciliation of funds received. - #[serde(skip_serializing_if = "Option::is_none")] - pub settings: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UpdateCustomerShipping { - /// Customer shipping address. - pub address: UpdateCustomerShippingAddress, - - /// Customer name. - pub name: String, - - /// Customer phone (including extension). - #[serde(skip_serializing_if = "Option::is_none")] - pub phone: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UpdateCustomerTax { - /// A recent IP address of the customer used for tax reporting and tax location inference. - /// - /// Stripe recommends updating the IP address when a new PaymentMethod is attached or the address field on the customer is updated. - /// We recommend against updating this field more frequently since it could result in unexpected tax location/reporting outcomes. - #[serde(skip_serializing_if = "Option::is_none")] - pub ip_address: Option, - - /// A flag that indicates when Stripe should validate the customer tax location. - /// - /// Defaults to `deferred`. - #[serde(skip_serializing_if = "Option::is_none")] - pub validate_location: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreateCustomerCashBalanceSettings { - /// Controls how funds transferred by the customer are applied to payment intents and invoices. - /// - /// Valid options are `automatic`, `manual`, or `merchant_default`. - /// For more information about these reconciliation modes, see [Reconciliation](https://stripe.com/docs/payments/customer-balance/reconciliation). - #[serde(skip_serializing_if = "Option::is_none")] - pub reconciliation_mode: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreateCustomerShippingAddress { - /// City, district, suburb, town, or village. - #[serde(skip_serializing_if = "Option::is_none")] - pub city: Option, - - /// Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). - #[serde(skip_serializing_if = "Option::is_none")] - pub country: Option, - - /// Address line 1 (e.g., street, PO Box, or company name). - #[serde(skip_serializing_if = "Option::is_none")] - pub line1: Option, - - /// Address line 2 (e.g., apartment, suite, unit, or building). - #[serde(skip_serializing_if = "Option::is_none")] - pub line2: Option, - - /// ZIP or postal code. - #[serde(skip_serializing_if = "Option::is_none")] - pub postal_code: Option, - - /// State, county, province, or region. - #[serde(skip_serializing_if = "Option::is_none")] - pub state: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CustomerInvoiceSettingsCustomFields { - /// The name of the custom field. - /// - /// This may be up to 30 characters. - pub name: String, - - /// The value of the custom field. - /// - /// This may be up to 30 characters. - pub value: String, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CustomerInvoiceSettingsRenderingOptions { - /// How line-item prices and amounts will be displayed with respect to tax on invoice PDFs. - /// - /// One of `exclude_tax` or `include_inclusive_tax`. - /// `include_inclusive_tax` will include inclusive tax (and exclude exclusive tax) in invoice PDF amounts. - /// `exclude_tax` will exclude all tax (inclusive and exclusive alike) from invoice PDF amounts. - #[serde(skip_serializing_if = "Option::is_none")] - pub amount_tax_display: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UpdateCustomerCashBalanceSettings { - /// Controls how funds transferred by the customer are applied to payment intents and invoices. - /// - /// Valid options are `automatic`, `manual`, or `merchant_default`. - /// For more information about these reconciliation modes, see [Reconciliation](https://stripe.com/docs/payments/customer-balance/reconciliation). - #[serde(skip_serializing_if = "Option::is_none")] - pub reconciliation_mode: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UpdateCustomerShippingAddress { - /// City, district, suburb, town, or village. - #[serde(skip_serializing_if = "Option::is_none")] - pub city: Option, - - /// Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). - #[serde(skip_serializing_if = "Option::is_none")] - pub country: Option, - - /// Address line 1 (e.g., street, PO Box, or company name). - #[serde(skip_serializing_if = "Option::is_none")] - pub line1: Option, - - /// Address line 2 (e.g., apartment, suite, unit, or building). - #[serde(skip_serializing_if = "Option::is_none")] - pub line2: Option, - - /// ZIP or postal code. - #[serde(skip_serializing_if = "Option::is_none")] - pub postal_code: Option, - - /// State, county, province, or region. - #[serde(skip_serializing_if = "Option::is_none")] - pub state: Option, -} - -/// An enum representing the possible values of an `CreateCustomerCashBalanceSettings`'s `reconciliation_mode` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CreateCustomerCashBalanceSettingsReconciliationMode { - Automatic, - Manual, - MerchantDefault, -} - -impl CreateCustomerCashBalanceSettingsReconciliationMode { - pub fn as_str(self) -> &'static str { - match self { - CreateCustomerCashBalanceSettingsReconciliationMode::Automatic => "automatic", - CreateCustomerCashBalanceSettingsReconciliationMode::Manual => "manual", - CreateCustomerCashBalanceSettingsReconciliationMode::MerchantDefault => { - "merchant_default" - } - } - } -} - -impl AsRef for CreateCustomerCashBalanceSettingsReconciliationMode { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for CreateCustomerCashBalanceSettingsReconciliationMode { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for CreateCustomerCashBalanceSettingsReconciliationMode { - fn default() -> Self { - Self::Automatic - } -} - -/// An enum representing the possible values of an `CreateCustomerTax`'s `validate_location` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CreateCustomerTaxValidateLocation { - Deferred, - Immediately, -} - -impl CreateCustomerTaxValidateLocation { - pub fn as_str(self) -> &'static str { - match self { - CreateCustomerTaxValidateLocation::Deferred => "deferred", - CreateCustomerTaxValidateLocation::Immediately => "immediately", - } - } -} - -impl AsRef for CreateCustomerTaxValidateLocation { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for CreateCustomerTaxValidateLocation { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for CreateCustomerTaxValidateLocation { - fn default() -> Self { - Self::Deferred - } -} - -/// An enum representing the possible values of an `CustomerInvoiceSettingsRenderingOptions`'s `amount_tax_display` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CustomerInvoiceSettingsRenderingOptionsAmountTaxDisplay { - ExcludeTax, - IncludeInclusiveTax, -} - -impl CustomerInvoiceSettingsRenderingOptionsAmountTaxDisplay { - pub fn as_str(self) -> &'static str { - match self { - CustomerInvoiceSettingsRenderingOptionsAmountTaxDisplay::ExcludeTax => "exclude_tax", - CustomerInvoiceSettingsRenderingOptionsAmountTaxDisplay::IncludeInclusiveTax => { - "include_inclusive_tax" - } - } - } -} - -impl AsRef for CustomerInvoiceSettingsRenderingOptionsAmountTaxDisplay { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for CustomerInvoiceSettingsRenderingOptionsAmountTaxDisplay { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for CustomerInvoiceSettingsRenderingOptionsAmountTaxDisplay { - fn default() -> Self { - Self::ExcludeTax - } -} - -/// An enum representing the possible values of an `CustomerTax`'s `automatic_tax` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CustomerTaxAutomaticTax { - Failed, - NotCollecting, - Supported, - UnrecognizedLocation, -} - -impl CustomerTaxAutomaticTax { - pub fn as_str(self) -> &'static str { - match self { - CustomerTaxAutomaticTax::Failed => "failed", - CustomerTaxAutomaticTax::NotCollecting => "not_collecting", - CustomerTaxAutomaticTax::Supported => "supported", - CustomerTaxAutomaticTax::UnrecognizedLocation => "unrecognized_location", - } - } -} - -impl AsRef for CustomerTaxAutomaticTax { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for CustomerTaxAutomaticTax { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for CustomerTaxAutomaticTax { - fn default() -> Self { - Self::Failed - } -} - -/// An enum representing the possible values of an `Customer`'s `tax_exempt` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CustomerTaxExempt { - Exempt, - None, - Reverse, -} - -impl CustomerTaxExempt { - pub fn as_str(self) -> &'static str { - match self { - CustomerTaxExempt::Exempt => "exempt", - CustomerTaxExempt::None => "none", - CustomerTaxExempt::Reverse => "reverse", - } - } -} - -impl AsRef for CustomerTaxExempt { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for CustomerTaxExempt { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for CustomerTaxExempt { - fn default() -> Self { - Self::Exempt - } -} - -/// An enum representing the possible values of an `CreateCustomer`'s `tax_exempt` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CustomerTaxExemptFilter { - Exempt, - None, - Reverse, -} - -impl CustomerTaxExemptFilter { - pub fn as_str(self) -> &'static str { - match self { - CustomerTaxExemptFilter::Exempt => "exempt", - CustomerTaxExemptFilter::None => "none", - CustomerTaxExemptFilter::Reverse => "reverse", - } - } -} - -impl AsRef for CustomerTaxExemptFilter { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for CustomerTaxExemptFilter { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for CustomerTaxExemptFilter { - fn default() -> Self { - Self::Exempt - } -} - -/// An enum representing the possible values of an `CustomerTaxLocation`'s `source` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CustomerTaxLocationSource { - BillingAddress, - IpAddress, - PaymentMethod, - ShippingDestination, -} - -impl CustomerTaxLocationSource { - pub fn as_str(self) -> &'static str { - match self { - CustomerTaxLocationSource::BillingAddress => "billing_address", - CustomerTaxLocationSource::IpAddress => "ip_address", - CustomerTaxLocationSource::PaymentMethod => "payment_method", - CustomerTaxLocationSource::ShippingDestination => "shipping_destination", - } - } -} - -impl AsRef for CustomerTaxLocationSource { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for CustomerTaxLocationSource { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for CustomerTaxLocationSource { - fn default() -> Self { - Self::BillingAddress - } -} - -/// An enum representing the possible values of an `TaxIdData`'s `type` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum TaxIdType { - AdNrt, - AeTrn, - ArCuit, - AuAbn, - AuArn, - BgUic, - BoTin, - BrCnpj, - BrCpf, - CaBn, - CaGstHst, - CaPstBc, - CaPstMb, - CaPstSk, - CaQst, - ChVat, - ClTin, - CnTin, - CoNit, - CrTin, - DoRcn, - EcRuc, - EgTin, - EsCif, - EuOssVat, - EuVat, - GbVat, - GeVat, - HkBr, - HuTin, - IdNpwp, - IlVat, - InGst, - IsVat, - JpCn, - JpRn, - JpTrn, - KePin, - KrBrn, - LiUid, - MxRfc, - MyFrp, - MyItn, - MySst, - NoVat, - NzGst, - PeRuc, - PhTin, - RoTin, - RsPib, - RuInn, - RuKpp, - SaVat, - SgGst, - SgUen, - SiTin, - SvNit, - ThVat, - TrTin, - TwVat, - UaVat, - UsEin, - UyRuc, - VeRif, - VnTin, - ZaVat, -} - -impl TaxIdType { - pub fn as_str(self) -> &'static str { - match self { - TaxIdType::AdNrt => "ad_nrt", - TaxIdType::AeTrn => "ae_trn", - TaxIdType::ArCuit => "ar_cuit", - TaxIdType::AuAbn => "au_abn", - TaxIdType::AuArn => "au_arn", - TaxIdType::BgUic => "bg_uic", - TaxIdType::BoTin => "bo_tin", - TaxIdType::BrCnpj => "br_cnpj", - TaxIdType::BrCpf => "br_cpf", - TaxIdType::CaBn => "ca_bn", - TaxIdType::CaGstHst => "ca_gst_hst", - TaxIdType::CaPstBc => "ca_pst_bc", - TaxIdType::CaPstMb => "ca_pst_mb", - TaxIdType::CaPstSk => "ca_pst_sk", - TaxIdType::CaQst => "ca_qst", - TaxIdType::ChVat => "ch_vat", - TaxIdType::ClTin => "cl_tin", - TaxIdType::CnTin => "cn_tin", - TaxIdType::CoNit => "co_nit", - TaxIdType::CrTin => "cr_tin", - TaxIdType::DoRcn => "do_rcn", - TaxIdType::EcRuc => "ec_ruc", - TaxIdType::EgTin => "eg_tin", - TaxIdType::EsCif => "es_cif", - TaxIdType::EuOssVat => "eu_oss_vat", - TaxIdType::EuVat => "eu_vat", - TaxIdType::GbVat => "gb_vat", - TaxIdType::GeVat => "ge_vat", - TaxIdType::HkBr => "hk_br", - TaxIdType::HuTin => "hu_tin", - TaxIdType::IdNpwp => "id_npwp", - TaxIdType::IlVat => "il_vat", - TaxIdType::InGst => "in_gst", - TaxIdType::IsVat => "is_vat", - TaxIdType::JpCn => "jp_cn", - TaxIdType::JpRn => "jp_rn", - TaxIdType::JpTrn => "jp_trn", - TaxIdType::KePin => "ke_pin", - TaxIdType::KrBrn => "kr_brn", - TaxIdType::LiUid => "li_uid", - TaxIdType::MxRfc => "mx_rfc", - TaxIdType::MyFrp => "my_frp", - TaxIdType::MyItn => "my_itn", - TaxIdType::MySst => "my_sst", - TaxIdType::NoVat => "no_vat", - TaxIdType::NzGst => "nz_gst", - TaxIdType::PeRuc => "pe_ruc", - TaxIdType::PhTin => "ph_tin", - TaxIdType::RoTin => "ro_tin", - TaxIdType::RsPib => "rs_pib", - TaxIdType::RuInn => "ru_inn", - TaxIdType::RuKpp => "ru_kpp", - TaxIdType::SaVat => "sa_vat", - TaxIdType::SgGst => "sg_gst", - TaxIdType::SgUen => "sg_uen", - TaxIdType::SiTin => "si_tin", - TaxIdType::SvNit => "sv_nit", - TaxIdType::ThVat => "th_vat", - TaxIdType::TrTin => "tr_tin", - TaxIdType::TwVat => "tw_vat", - TaxIdType::UaVat => "ua_vat", - TaxIdType::UsEin => "us_ein", - TaxIdType::UyRuc => "uy_ruc", - TaxIdType::VeRif => "ve_rif", - TaxIdType::VnTin => "vn_tin", - TaxIdType::ZaVat => "za_vat", - } - } -} - -impl AsRef for TaxIdType { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for TaxIdType { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for TaxIdType { - fn default() -> Self { - Self::AdNrt - } -} - -/// An enum representing the possible values of an `UpdateCustomerCashBalanceSettings`'s `reconciliation_mode` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum UpdateCustomerCashBalanceSettingsReconciliationMode { - Automatic, - Manual, - MerchantDefault, -} - -impl UpdateCustomerCashBalanceSettingsReconciliationMode { - pub fn as_str(self) -> &'static str { - match self { - UpdateCustomerCashBalanceSettingsReconciliationMode::Automatic => "automatic", - UpdateCustomerCashBalanceSettingsReconciliationMode::Manual => "manual", - UpdateCustomerCashBalanceSettingsReconciliationMode::MerchantDefault => { - "merchant_default" - } - } - } -} - -impl AsRef for UpdateCustomerCashBalanceSettingsReconciliationMode { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for UpdateCustomerCashBalanceSettingsReconciliationMode { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for UpdateCustomerCashBalanceSettingsReconciliationMode { - fn default() -> Self { - Self::Automatic - } -} - -/// An enum representing the possible values of an `UpdateCustomerTax`'s `validate_location` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum UpdateCustomerTaxValidateLocation { - Deferred, - Immediately, -} - -impl UpdateCustomerTaxValidateLocation { - pub fn as_str(self) -> &'static str { - match self { - UpdateCustomerTaxValidateLocation::Deferred => "deferred", - UpdateCustomerTaxValidateLocation::Immediately => "immediately", - } - } -} - -impl AsRef for UpdateCustomerTaxValidateLocation { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for UpdateCustomerTaxValidateLocation { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for UpdateCustomerTaxValidateLocation { - fn default() -> Self { - Self::Deferred - } -} diff --git a/src/resources/generated/customer_balance_transaction.rs b/src/resources/generated/customer_balance_transaction.rs deleted file mode 100644 index 8b102c8a8..000000000 --- a/src/resources/generated/customer_balance_transaction.rs +++ /dev/null @@ -1,127 +0,0 @@ -// ====================================== -// This file was automatically generated. -// ====================================== - -use serde::{Deserialize, Serialize}; - -use crate::ids::CustomerBalanceTransactionId; -use crate::params::{Expandable, Metadata, Object, Timestamp}; -use crate::resources::{CreditNote, Currency, Customer, Invoice}; - -/// The resource representing a Stripe "CustomerBalanceTransaction". -/// -/// For more details see -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CustomerBalanceTransaction { - /// Unique identifier for the object. - pub id: CustomerBalanceTransactionId, - - /// The amount of the transaction. - /// - /// A negative value is a credit for the customer's balance, and a positive value is a debit to the customer's `balance`. - pub amount: i64, - - /// Time at which the object was created. - /// - /// Measured in seconds since the Unix epoch. - pub created: Timestamp, - - /// The ID of the credit note (if any) related to the transaction. - pub credit_note: Option>, - - /// Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. - /// - /// Must be a [supported currency](https://stripe.com/docs/currencies). - pub currency: Currency, - - /// The ID of the customer the transaction belongs to. - pub customer: Expandable, - - /// An arbitrary string attached to the object. - /// - /// Often useful for displaying to users. - pub description: Option, - - /// The customer's `balance` after the transaction was applied. - /// - /// A negative value decreases the amount due on the customer's next invoice. - /// A positive value increases the amount due on the customer's next invoice. - pub ending_balance: i64, - - /// The ID of the invoice (if any) related to the transaction. - pub invoice: Option>, - - /// Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. - pub livemode: bool, - - /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. - /// - /// This can be useful for storing additional information about the object in a structured format. - pub metadata: Option, - - /// Transaction type: `adjustment`, `applied_to_invoice`, `credit_note`, `initial`, `invoice_overpaid`, `invoice_too_large`, `invoice_too_small`, `unspent_receiver_credit`, or `unapplied_from_invoice`. - /// - /// See the [Customer Balance page](https://stripe.com/docs/billing/customer/balance#types) to learn more about transaction types. - #[serde(rename = "type")] - pub type_: CustomerBalanceTransactionType, -} - -impl Object for CustomerBalanceTransaction { - type Id = CustomerBalanceTransactionId; - fn id(&self) -> Self::Id { - self.id.clone() - } - fn object(&self) -> &'static str { - "customer_balance_transaction" - } -} - -/// An enum representing the possible values of an `CustomerBalanceTransaction`'s `type` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CustomerBalanceTransactionType { - Adjustment, - AppliedToInvoice, - CreditNote, - Initial, - InvoiceOverpaid, - InvoiceTooLarge, - InvoiceTooSmall, - Migration, - UnappliedFromInvoice, - UnspentReceiverCredit, -} - -impl CustomerBalanceTransactionType { - pub fn as_str(self) -> &'static str { - match self { - CustomerBalanceTransactionType::Adjustment => "adjustment", - CustomerBalanceTransactionType::AppliedToInvoice => "applied_to_invoice", - CustomerBalanceTransactionType::CreditNote => "credit_note", - CustomerBalanceTransactionType::Initial => "initial", - CustomerBalanceTransactionType::InvoiceOverpaid => "invoice_overpaid", - CustomerBalanceTransactionType::InvoiceTooLarge => "invoice_too_large", - CustomerBalanceTransactionType::InvoiceTooSmall => "invoice_too_small", - CustomerBalanceTransactionType::Migration => "migration", - CustomerBalanceTransactionType::UnappliedFromInvoice => "unapplied_from_invoice", - CustomerBalanceTransactionType::UnspentReceiverCredit => "unspent_receiver_credit", - } - } -} - -impl AsRef for CustomerBalanceTransactionType { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for CustomerBalanceTransactionType { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for CustomerBalanceTransactionType { - fn default() -> Self { - Self::Adjustment - } -} diff --git a/src/resources/generated/customer_cash_balance_transaction.rs b/src/resources/generated/customer_cash_balance_transaction.rs deleted file mode 100644 index 6bcf9a755..000000000 --- a/src/resources/generated/customer_cash_balance_transaction.rs +++ /dev/null @@ -1,321 +0,0 @@ -// ====================================== -// This file was automatically generated. -// ====================================== - -use crate::ids::{CustomerCashBalanceTransactionId}; -use crate::params::{Expandable, Object, Timestamp}; -use crate::resources::{BalanceTransaction, Currency, Customer, PaymentIntent, Refund}; -use serde::{Deserialize, Serialize}; - -/// The resource representing a Stripe "CustomerCashBalanceTransaction". -/// -/// For more details see -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CustomerCashBalanceTransaction { - /// Unique identifier for the object. - pub id: CustomerCashBalanceTransactionId, - - #[serde(skip_serializing_if = "Option::is_none")] - pub adjusted_for_overdraft: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub applied_to_payment: Option, - - /// Time at which the object was created. - /// - /// Measured in seconds since the Unix epoch. - pub created: Timestamp, - - /// Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. - /// - /// Must be a [supported currency](https://stripe.com/docs/currencies). - pub currency: Currency, - - /// The customer whose available cash balance changed as a result of this transaction. - pub customer: Expandable, - - /// The total available cash balance for the specified currency after this transaction was applied. - /// - /// Represented in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal). - pub ending_balance: i64, - - #[serde(skip_serializing_if = "Option::is_none")] - pub funded: Option, - - /// Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. - pub livemode: bool, - - /// The amount by which the cash balance changed, represented in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal). - /// - /// A positive value represents funds being added to the cash balance, a negative value represents funds being removed from the cash balance. - pub net_amount: i64, - - #[serde(skip_serializing_if = "Option::is_none")] - pub refunded_from_payment: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub transferred_to_balance: Option, - - /// The type of the cash balance transaction. - /// - /// New types may be added in future. - /// See [Customer Balance](https://stripe.com/docs/payments/customer-balance#types) to learn more about these types. - #[serde(rename = "type")] - pub type_: CustomerCashBalanceTransactionType, - - #[serde(skip_serializing_if = "Option::is_none")] - pub unapplied_from_payment: Option, -} - -impl Object for CustomerCashBalanceTransaction { - type Id = CustomerCashBalanceTransactionId; - fn id(&self) -> Self::Id { - self.id.clone() - } - fn object(&self) -> &'static str { - "customer_cash_balance_transaction" - } -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CustomerBalanceResourceCashBalanceTransactionResourceAdjustedForOverdraft { - - /// The [Balance Transaction](https://stripe.com/docs/api/balance_transactions/object) that corresponds to funds taken out of your Stripe balance. - pub balance_transaction: Expandable, - - /// The [Cash Balance Transaction](https://stripe.com/docs/api/cash_balance_transactions/object) that brought the customer balance negative, triggering the clawback of funds. - pub linked_transaction: Expandable, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CustomerBalanceResourceCashBalanceTransactionResourceAppliedToPaymentTransaction { - - /// The [Payment Intent](https://stripe.com/docs/api/payment_intents/object) that funds were applied to. - pub payment_intent: Expandable, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CustomerBalanceResourceCashBalanceTransactionResourceFundedTransaction { - - pub bank_transfer: CustomerBalanceResourceCashBalanceTransactionResourceFundedTransactionResourceBankTransfer, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CustomerBalanceResourceCashBalanceTransactionResourceFundedTransactionResourceBankTransfer { - - #[serde(skip_serializing_if = "Option::is_none")] - pub eu_bank_transfer: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub gb_bank_transfer: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub jp_bank_transfer: Option, - - /// The user-supplied reference field on the bank transfer. - pub reference: Option, - - /// The funding method type used to fund the customer balance. - /// - /// Permitted values include: `eu_bank_transfer`, `gb_bank_transfer`, `jp_bank_transfer`, `mx_bank_transfer`, or `us_bank_transfer`. - #[serde(rename = "type")] - pub type_: CustomerBalanceResourceCashBalanceTransactionResourceFundedTransactionResourceBankTransferType, - - #[serde(skip_serializing_if = "Option::is_none")] - pub us_bank_transfer: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CustomerBalanceResourceCashBalanceTransactionResourceFundedTransactionResourceBankTransferResourceEuBankTransfer { - - /// The BIC of the bank of the sender of the funding. - pub bic: Option, - - /// The last 4 digits of the IBAN of the sender of the funding. - pub iban_last4: Option, - - /// The full name of the sender, as supplied by the sending bank. - pub sender_name: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CustomerBalanceResourceCashBalanceTransactionResourceFundedTransactionResourceBankTransferResourceGbBankTransfer { - - /// The last 4 digits of the account number of the sender of the funding. - pub account_number_last4: Option, - - /// The full name of the sender, as supplied by the sending bank. - pub sender_name: Option, - - /// The sort code of the bank of the sender of the funding. - pub sort_code: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CustomerBalanceResourceCashBalanceTransactionResourceFundedTransactionResourceBankTransferResourceJpBankTransfer { - - /// The name of the bank of the sender of the funding. - pub sender_bank: Option, - - /// The name of the bank branch of the sender of the funding. - pub sender_branch: Option, - - /// The full name of the sender, as supplied by the sending bank. - pub sender_name: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CustomerBalanceResourceCashBalanceTransactionResourceFundedTransactionResourceBankTransferResourceUsBankTransfer { - - /// The banking network used for this funding. - #[serde(skip_serializing_if = "Option::is_none")] - pub network: Option, - - /// The full name of the sender, as supplied by the sending bank. - pub sender_name: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CustomerBalanceResourceCashBalanceTransactionResourceRefundedFromPaymentTransaction { - - /// The [Refund](https://stripe.com/docs/api/refunds/object) that moved these funds into the customer's cash balance. - pub refund: Expandable, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CustomerBalanceResourceCashBalanceTransactionResourceTransferredToBalance { - - /// The [Balance Transaction](https://stripe.com/docs/api/balance_transactions/object) that corresponds to funds transferred to your Stripe balance. - pub balance_transaction: Expandable, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CustomerBalanceResourceCashBalanceTransactionResourceUnappliedFromPaymentTransaction { - - /// The [Payment Intent](https://stripe.com/docs/api/payment_intents/object) that funds were unapplied from. - pub payment_intent: Expandable, -} - -/// An enum representing the possible values of an `CustomerBalanceResourceCashBalanceTransactionResourceFundedTransactionResourceBankTransferResourceUsBankTransfer`'s `network` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CustomerBalanceResourceCashBalanceTransactionResourceFundedTransactionResourceBankTransferResourceUsBankTransferNetwork { - Ach, - DomesticWireUs, - Swift, -} - -impl CustomerBalanceResourceCashBalanceTransactionResourceFundedTransactionResourceBankTransferResourceUsBankTransferNetwork { - pub fn as_str(self) -> &'static str { - match self { - CustomerBalanceResourceCashBalanceTransactionResourceFundedTransactionResourceBankTransferResourceUsBankTransferNetwork::Ach => "ach", - CustomerBalanceResourceCashBalanceTransactionResourceFundedTransactionResourceBankTransferResourceUsBankTransferNetwork::DomesticWireUs => "domestic_wire_us", - CustomerBalanceResourceCashBalanceTransactionResourceFundedTransactionResourceBankTransferResourceUsBankTransferNetwork::Swift => "swift", - } - } -} - -impl AsRef for CustomerBalanceResourceCashBalanceTransactionResourceFundedTransactionResourceBankTransferResourceUsBankTransferNetwork { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for CustomerBalanceResourceCashBalanceTransactionResourceFundedTransactionResourceBankTransferResourceUsBankTransferNetwork { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for CustomerBalanceResourceCashBalanceTransactionResourceFundedTransactionResourceBankTransferResourceUsBankTransferNetwork { - fn default() -> Self { - Self::Ach - } -} - -/// An enum representing the possible values of an `CustomerBalanceResourceCashBalanceTransactionResourceFundedTransactionResourceBankTransfer`'s `type` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CustomerBalanceResourceCashBalanceTransactionResourceFundedTransactionResourceBankTransferType { - EuBankTransfer, - GbBankTransfer, - JpBankTransfer, - MxBankTransfer, - UsBankTransfer, -} - -impl CustomerBalanceResourceCashBalanceTransactionResourceFundedTransactionResourceBankTransferType { - pub fn as_str(self) -> &'static str { - match self { - CustomerBalanceResourceCashBalanceTransactionResourceFundedTransactionResourceBankTransferType::EuBankTransfer => "eu_bank_transfer", - CustomerBalanceResourceCashBalanceTransactionResourceFundedTransactionResourceBankTransferType::GbBankTransfer => "gb_bank_transfer", - CustomerBalanceResourceCashBalanceTransactionResourceFundedTransactionResourceBankTransferType::JpBankTransfer => "jp_bank_transfer", - CustomerBalanceResourceCashBalanceTransactionResourceFundedTransactionResourceBankTransferType::MxBankTransfer => "mx_bank_transfer", - CustomerBalanceResourceCashBalanceTransactionResourceFundedTransactionResourceBankTransferType::UsBankTransfer => "us_bank_transfer", - } - } -} - -impl AsRef for CustomerBalanceResourceCashBalanceTransactionResourceFundedTransactionResourceBankTransferType { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for CustomerBalanceResourceCashBalanceTransactionResourceFundedTransactionResourceBankTransferType { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for CustomerBalanceResourceCashBalanceTransactionResourceFundedTransactionResourceBankTransferType { - fn default() -> Self { - Self::EuBankTransfer - } -} - -/// An enum representing the possible values of an `CustomerCashBalanceTransaction`'s `type` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CustomerCashBalanceTransactionType { - AdjustedForOverdraft, - AppliedToPayment, - Funded, - FundingReversed, - RefundedFromPayment, - ReturnCanceled, - ReturnInitiated, - TransferredToBalance, - UnappliedFromPayment, -} - -impl CustomerCashBalanceTransactionType { - pub fn as_str(self) -> &'static str { - match self { - CustomerCashBalanceTransactionType::AdjustedForOverdraft => "adjusted_for_overdraft", - CustomerCashBalanceTransactionType::AppliedToPayment => "applied_to_payment", - CustomerCashBalanceTransactionType::Funded => "funded", - CustomerCashBalanceTransactionType::FundingReversed => "funding_reversed", - CustomerCashBalanceTransactionType::RefundedFromPayment => "refunded_from_payment", - CustomerCashBalanceTransactionType::ReturnCanceled => "return_canceled", - CustomerCashBalanceTransactionType::ReturnInitiated => "return_initiated", - CustomerCashBalanceTransactionType::TransferredToBalance => "transferred_to_balance", - CustomerCashBalanceTransactionType::UnappliedFromPayment => "unapplied_from_payment", - } - } -} - -impl AsRef for CustomerCashBalanceTransactionType { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for CustomerCashBalanceTransactionType { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for CustomerCashBalanceTransactionType { - fn default() -> Self { - Self::AdjustedForOverdraft - } -} diff --git a/src/resources/generated/customer_cash_balance_transaction_created.rs b/src/resources/generated/customer_cash_balance_transaction_created.rs deleted file mode 100644 index e9b734898..000000000 --- a/src/resources/generated/customer_cash_balance_transaction_created.rs +++ /dev/null @@ -1,10 +0,0 @@ -// ====================================== -// This file was automatically generated. -// ====================================== - -use serde::{Deserialize, Serialize}; - -/// The resource representing a Stripe "customer_cash_balance_transaction.created". -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CustomerCashBalanceTransactionCreated { -} diff --git a/src/resources/generated/customer_created.rs b/src/resources/generated/customer_created.rs deleted file mode 100644 index 968ba95d0..000000000 --- a/src/resources/generated/customer_created.rs +++ /dev/null @@ -1,10 +0,0 @@ -// ====================================== -// This file was automatically generated. -// ====================================== - -use serde::{Deserialize, Serialize}; - -/// The resource representing a Stripe "customer.created". -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CustomerCreated { -} diff --git a/src/resources/generated/customer_deleted.rs b/src/resources/generated/customer_deleted.rs deleted file mode 100644 index 86ed70ec8..000000000 --- a/src/resources/generated/customer_deleted.rs +++ /dev/null @@ -1,10 +0,0 @@ -// ====================================== -// This file was automatically generated. -// ====================================== - -use serde::{Deserialize, Serialize}; - -/// The resource representing a Stripe "customer.deleted". -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CustomerDeleted { -} diff --git a/src/resources/generated/customer_discount_created.rs b/src/resources/generated/customer_discount_created.rs deleted file mode 100644 index de4fe6852..000000000 --- a/src/resources/generated/customer_discount_created.rs +++ /dev/null @@ -1,10 +0,0 @@ -// ====================================== -// This file was automatically generated. -// ====================================== - -use serde::{Deserialize, Serialize}; - -/// The resource representing a Stripe "customer.discount.created". -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CustomerDiscountCreated { -} diff --git a/src/resources/generated/customer_discount_deleted.rs b/src/resources/generated/customer_discount_deleted.rs deleted file mode 100644 index 68edd4264..000000000 --- a/src/resources/generated/customer_discount_deleted.rs +++ /dev/null @@ -1,10 +0,0 @@ -// ====================================== -// This file was automatically generated. -// ====================================== - -use serde::{Deserialize, Serialize}; - -/// The resource representing a Stripe "customer.discount.deleted". -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CustomerDiscountDeleted { -} diff --git a/src/resources/generated/customer_discount_updated.rs b/src/resources/generated/customer_discount_updated.rs deleted file mode 100644 index 4201b1d08..000000000 --- a/src/resources/generated/customer_discount_updated.rs +++ /dev/null @@ -1,10 +0,0 @@ -// ====================================== -// This file was automatically generated. -// ====================================== - -use serde::{Deserialize, Serialize}; - -/// The resource representing a Stripe "customer.discount.updated". -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CustomerDiscountUpdated { -} diff --git a/src/resources/generated/customer_session.rs b/src/resources/generated/customer_session.rs deleted file mode 100644 index 13bd934d7..000000000 --- a/src/resources/generated/customer_session.rs +++ /dev/null @@ -1,131 +0,0 @@ -// ====================================== -// This file was automatically generated. -// ====================================== - -use crate::client::{Client, Response}; -use crate::ids::{CustomerId}; -use crate::params::{Expand, Expandable, Object, Timestamp}; -use crate::resources::{Customer}; -use serde::{Deserialize, Serialize}; - -/// The resource representing a Stripe "CustomerSessionResourceCustomerSession". -/// -/// For more details see -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CustomerSession { - - /// The client secret of this customer session. - /// - /// Used on the client to set up secure access to the given `customer`. The client secret can be used to provide access to `customer` from your frontend. - /// It should not be stored, logged, or exposed to anyone other than the relevant customer. - /// Make sure that you have TLS enabled on any page that includes the client secret. - pub client_secret: String, - - #[serde(skip_serializing_if = "Option::is_none")] - pub components: Option, - - /// Time at which the object was created. - /// - /// Measured in seconds since the Unix epoch. - pub created: Timestamp, - - /// The customer the customer session was created for. - pub customer: Expandable, - - /// The timestamp at which this customer session will expire. - pub expires_at: Timestamp, - - /// Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. - pub livemode: bool, -} - -impl CustomerSession { - - /// Creates a customer session object that includes a single-use client secret that you can use on your front-end to grant client-side API access for certain customer resources. - pub fn create(client: &Client, params: CreateCustomerSession<'_>) -> Response { - client.post_form("/customer_sessions", ¶ms) - } -} - -impl Object for CustomerSession { - type Id = (); - fn id(&self) -> Self::Id {} - fn object(&self) -> &'static str { - "customer_session" - } -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CustomerSessionResourceComponents { - - pub buy_button: CustomerSessionResourceComponentsResourceBuyButton, - - pub pricing_table: CustomerSessionResourceComponentsResourcePricingTable, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CustomerSessionResourceComponentsResourceBuyButton { - - /// Whether the buy button is enabled. - pub enabled: bool, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CustomerSessionResourceComponentsResourcePricingTable { - - /// Whether the pricing table is enabled. - pub enabled: bool, -} - -/// The parameters for `CustomerSession::create`. -#[derive(Clone, Debug, Serialize)] -pub struct CreateCustomerSession<'a> { - - /// Configuration for each component. - /// - /// Exactly 1 component must be enabled. - pub components: CreateCustomerSessionComponents, - - /// The ID of an existing customer for which to create the customer session. - pub customer: CustomerId, - - /// Specifies which fields in the response should be expanded. - #[serde(skip_serializing_if = "Expand::is_empty")] - pub expand: &'a [&'a str], -} - -impl<'a> CreateCustomerSession<'a> { - pub fn new(components: CreateCustomerSessionComponents, customer: CustomerId) -> Self { - CreateCustomerSession { - components, - customer, - expand: Default::default(), - } - } -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreateCustomerSessionComponents { - - /// Configuration for buy button. - #[serde(skip_serializing_if = "Option::is_none")] - pub buy_button: Option, - - /// Configuration for the pricing table. - #[serde(skip_serializing_if = "Option::is_none")] - pub pricing_table: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreateCustomerSessionComponentsBuyButton { - - /// Whether the buy button is enabled. - pub enabled: bool, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreateCustomerSessionComponentsPricingTable { - - /// Whether the pricing table is enabled. - pub enabled: bool, -} diff --git a/src/resources/generated/customer_source_created.rs b/src/resources/generated/customer_source_created.rs deleted file mode 100644 index e757832b2..000000000 --- a/src/resources/generated/customer_source_created.rs +++ /dev/null @@ -1,10 +0,0 @@ -// ====================================== -// This file was automatically generated. -// ====================================== - -use serde::{Deserialize, Serialize}; - -/// The resource representing a Stripe "customer.source.created". -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CustomerSourceCreated { -} diff --git a/src/resources/generated/customer_source_deleted.rs b/src/resources/generated/customer_source_deleted.rs deleted file mode 100644 index 8d99da828..000000000 --- a/src/resources/generated/customer_source_deleted.rs +++ /dev/null @@ -1,10 +0,0 @@ -// ====================================== -// This file was automatically generated. -// ====================================== - -use serde::{Deserialize, Serialize}; - -/// The resource representing a Stripe "customer.source.deleted". -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CustomerSourceDeleted { -} diff --git a/src/resources/generated/customer_source_expiring.rs b/src/resources/generated/customer_source_expiring.rs deleted file mode 100644 index 35f49664f..000000000 --- a/src/resources/generated/customer_source_expiring.rs +++ /dev/null @@ -1,10 +0,0 @@ -// ====================================== -// This file was automatically generated. -// ====================================== - -use serde::{Deserialize, Serialize}; - -/// The resource representing a Stripe "customer.source.expiring". -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CustomerSourceExpiring { -} diff --git a/src/resources/generated/customer_source_updated.rs b/src/resources/generated/customer_source_updated.rs deleted file mode 100644 index c5a70d947..000000000 --- a/src/resources/generated/customer_source_updated.rs +++ /dev/null @@ -1,10 +0,0 @@ -// ====================================== -// This file was automatically generated. -// ====================================== - -use serde::{Deserialize, Serialize}; - -/// The resource representing a Stripe "customer.source.updated". -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CustomerSourceUpdated { -} diff --git a/src/resources/generated/customer_subscription_created.rs b/src/resources/generated/customer_subscription_created.rs deleted file mode 100644 index 7762b2bed..000000000 --- a/src/resources/generated/customer_subscription_created.rs +++ /dev/null @@ -1,10 +0,0 @@ -// ====================================== -// This file was automatically generated. -// ====================================== - -use serde::{Deserialize, Serialize}; - -/// The resource representing a Stripe "customer.subscription.created". -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CustomerSubscriptionCreated { -} diff --git a/src/resources/generated/customer_subscription_deleted.rs b/src/resources/generated/customer_subscription_deleted.rs deleted file mode 100644 index 1d88697d6..000000000 --- a/src/resources/generated/customer_subscription_deleted.rs +++ /dev/null @@ -1,10 +0,0 @@ -// ====================================== -// This file was automatically generated. -// ====================================== - -use serde::{Deserialize, Serialize}; - -/// The resource representing a Stripe "customer.subscription.deleted". -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CustomerSubscriptionDeleted { -} diff --git a/src/resources/generated/customer_subscription_paused.rs b/src/resources/generated/customer_subscription_paused.rs deleted file mode 100644 index ba985baf7..000000000 --- a/src/resources/generated/customer_subscription_paused.rs +++ /dev/null @@ -1,10 +0,0 @@ -// ====================================== -// This file was automatically generated. -// ====================================== - -use serde::{Deserialize, Serialize}; - -/// The resource representing a Stripe "customer.subscription.paused". -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CustomerSubscriptionPaused { -} diff --git a/src/resources/generated/customer_subscription_pending_update_applied.rs b/src/resources/generated/customer_subscription_pending_update_applied.rs deleted file mode 100644 index ca27601fc..000000000 --- a/src/resources/generated/customer_subscription_pending_update_applied.rs +++ /dev/null @@ -1,10 +0,0 @@ -// ====================================== -// This file was automatically generated. -// ====================================== - -use serde::{Deserialize, Serialize}; - -/// The resource representing a Stripe "customer.subscription.pending_update_applied". -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CustomerSubscriptionPendingUpdateApplied { -} diff --git a/src/resources/generated/customer_subscription_pending_update_expired.rs b/src/resources/generated/customer_subscription_pending_update_expired.rs deleted file mode 100644 index e4c5ed616..000000000 --- a/src/resources/generated/customer_subscription_pending_update_expired.rs +++ /dev/null @@ -1,10 +0,0 @@ -// ====================================== -// This file was automatically generated. -// ====================================== - -use serde::{Deserialize, Serialize}; - -/// The resource representing a Stripe "customer.subscription.pending_update_expired". -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CustomerSubscriptionPendingUpdateExpired { -} diff --git a/src/resources/generated/customer_subscription_resumed.rs b/src/resources/generated/customer_subscription_resumed.rs deleted file mode 100644 index 4502e84fd..000000000 --- a/src/resources/generated/customer_subscription_resumed.rs +++ /dev/null @@ -1,10 +0,0 @@ -// ====================================== -// This file was automatically generated. -// ====================================== - -use serde::{Deserialize, Serialize}; - -/// The resource representing a Stripe "customer.subscription.resumed". -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CustomerSubscriptionResumed { -} diff --git a/src/resources/generated/customer_subscription_trial_will_end.rs b/src/resources/generated/customer_subscription_trial_will_end.rs deleted file mode 100644 index 2db88dde8..000000000 --- a/src/resources/generated/customer_subscription_trial_will_end.rs +++ /dev/null @@ -1,10 +0,0 @@ -// ====================================== -// This file was automatically generated. -// ====================================== - -use serde::{Deserialize, Serialize}; - -/// The resource representing a Stripe "customer.subscription.trial_will_end". -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CustomerSubscriptionTrialWillEnd { -} diff --git a/src/resources/generated/customer_subscription_updated.rs b/src/resources/generated/customer_subscription_updated.rs deleted file mode 100644 index 0b3e01330..000000000 --- a/src/resources/generated/customer_subscription_updated.rs +++ /dev/null @@ -1,10 +0,0 @@ -// ====================================== -// This file was automatically generated. -// ====================================== - -use serde::{Deserialize, Serialize}; - -/// The resource representing a Stripe "customer.subscription.updated". -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CustomerSubscriptionUpdated { -} diff --git a/src/resources/generated/customer_tax_id_created.rs b/src/resources/generated/customer_tax_id_created.rs deleted file mode 100644 index e71ba322e..000000000 --- a/src/resources/generated/customer_tax_id_created.rs +++ /dev/null @@ -1,10 +0,0 @@ -// ====================================== -// This file was automatically generated. -// ====================================== - -use serde::{Deserialize, Serialize}; - -/// The resource representing a Stripe "customer.tax_id.created". -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CustomerTaxIdCreated { -} diff --git a/src/resources/generated/customer_tax_id_deleted.rs b/src/resources/generated/customer_tax_id_deleted.rs deleted file mode 100644 index 96bc37d29..000000000 --- a/src/resources/generated/customer_tax_id_deleted.rs +++ /dev/null @@ -1,10 +0,0 @@ -// ====================================== -// This file was automatically generated. -// ====================================== - -use serde::{Deserialize, Serialize}; - -/// The resource representing a Stripe "customer.tax_id.deleted". -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CustomerTaxIdDeleted { -} diff --git a/src/resources/generated/customer_tax_id_updated.rs b/src/resources/generated/customer_tax_id_updated.rs deleted file mode 100644 index 2ebf97239..000000000 --- a/src/resources/generated/customer_tax_id_updated.rs +++ /dev/null @@ -1,10 +0,0 @@ -// ====================================== -// This file was automatically generated. -// ====================================== - -use serde::{Deserialize, Serialize}; - -/// The resource representing a Stripe "customer.tax_id.updated". -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CustomerTaxIdUpdated { -} diff --git a/src/resources/generated/customer_updated.rs b/src/resources/generated/customer_updated.rs deleted file mode 100644 index fea1eba07..000000000 --- a/src/resources/generated/customer_updated.rs +++ /dev/null @@ -1,10 +0,0 @@ -// ====================================== -// This file was automatically generated. -// ====================================== - -use serde::{Deserialize, Serialize}; - -/// The resource representing a Stripe "customer.updated". -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CustomerUpdated { -} diff --git a/src/resources/generated/dispute.rs b/src/resources/generated/dispute.rs deleted file mode 100644 index 129291a98..000000000 --- a/src/resources/generated/dispute.rs +++ /dev/null @@ -1,380 +0,0 @@ -// ====================================== -// This file was automatically generated. -// ====================================== - -use serde::{Deserialize, Serialize}; - -use crate::client::{Client, Response}; -use crate::ids::{ChargeId, DisputeId, PaymentIntentId}; -use crate::params::{Expand, Expandable, List, Metadata, Object, Paginable, RangeQuery, Timestamp}; -use crate::resources::{BalanceTransaction, Charge, Currency, File, PaymentIntent}; - -/// The resource representing a Stripe "Dispute". -/// -/// For more details see -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct Dispute { - /// Unique identifier for the object. - pub id: DisputeId, - - /// Disputed amount. - /// - /// Usually the amount of the charge, but it can differ (usually because of currency fluctuation or because only part of the order is disputed). - pub amount: i64, - - /// List of zero, one, or two balance transactions that show funds withdrawn and reinstated to your Stripe account as a result of this dispute. - pub balance_transactions: Vec, - - /// ID of the charge that's disputed. - pub charge: Expandable, - - /// Time at which the object was created. - /// - /// Measured in seconds since the Unix epoch. - pub created: Timestamp, - - /// Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. - /// - /// Must be a [supported currency](https://stripe.com/docs/currencies). - pub currency: Currency, - - pub evidence: DisputeEvidence, - - pub evidence_details: DisputeEvidenceDetails, - - /// If true, it's still possible to refund the disputed payment. - /// - /// After the payment has been fully refunded, no further funds are withdrawn from your Stripe account as a result of this dispute. - pub is_charge_refundable: bool, - - /// Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. - pub livemode: bool, - - /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. - /// - /// This can be useful for storing additional information about the object in a structured format. - pub metadata: Metadata, - - /// Network-dependent reason code for the dispute. - #[serde(skip_serializing_if = "Option::is_none")] - pub network_reason_code: Option, - - /// ID of the PaymentIntent that's disputed. - pub payment_intent: Option>, - - #[serde(skip_serializing_if = "Option::is_none")] - pub payment_method_details: Option, - - /// Reason given by cardholder for dispute. - /// - /// Possible values are `bank_cannot_process`, `check_returned`, `credit_not_processed`, `customer_initiated`, `debit_not_authorized`, `duplicate`, `fraudulent`, `general`, `incorrect_account_details`, `insufficient_funds`, `product_not_received`, `product_unacceptable`, `subscription_canceled`, or `unrecognized`. - /// Learn more about [dispute reasons](https://stripe.com/docs/disputes/categories). - pub reason: String, - - /// Current status of dispute. - /// - /// Possible values are `warning_needs_response`, `warning_under_review`, `warning_closed`, `needs_response`, `under_review`, `won`, or `lost`. - pub status: DisputeStatus, -} - -impl Dispute { - /// Returns a list of your disputes. - pub fn list(client: &Client, params: &ListDisputes<'_>) -> Response> { - client.get_query("/disputes", ¶ms) - } - - /// Retrieves the dispute with the given ID. - pub fn retrieve(client: &Client, id: &DisputeId, expand: &[&str]) -> Response { - client.get_query(&format!("/disputes/{}", id), &Expand { expand }) - } -} - -impl Object for Dispute { - type Id = DisputeId; - fn id(&self) -> Self::Id { - self.id.clone() - } - fn object(&self) -> &'static str { - "dispute" - } -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct DisputeEvidence { - /// Any server or activity logs showing proof that the customer accessed or downloaded the purchased digital product. - /// - /// This information should include IP addresses, corresponding timestamps, and any detailed recorded activity. - pub access_activity_log: Option, - - /// The billing address provided by the customer. - pub billing_address: Option, - - /// (ID of a [file upload](https://stripe.com/docs/guides/file-upload)) Your subscription cancellation policy, as shown to the customer. - pub cancellation_policy: Option>, - - /// An explanation of how and when the customer was shown your refund policy prior to purchase. - pub cancellation_policy_disclosure: Option, - - /// A justification for why the customer's subscription was not canceled. - pub cancellation_rebuttal: Option, - - /// (ID of a [file upload](https://stripe.com/docs/guides/file-upload)) Any communication with the customer that you feel is relevant to your case. - /// - /// Examples include emails proving that the customer received the product or service, or demonstrating their use of or satisfaction with the product or service. - pub customer_communication: Option>, - - /// The email address of the customer. - pub customer_email_address: Option, - - /// The name of the customer. - pub customer_name: Option, - - /// The IP address that the customer used when making the purchase. - pub customer_purchase_ip: Option, - - /// (ID of a [file upload](https://stripe.com/docs/guides/file-upload)) A relevant document or contract showing the customer's signature. - pub customer_signature: Option>, - - /// (ID of a [file upload](https://stripe.com/docs/guides/file-upload)) Documentation for the prior charge that can uniquely identify the charge, such as a receipt, shipping label, work order, etc. - /// - /// This document should be paired with a similar document from the disputed payment that proves the two payments are separate. - pub duplicate_charge_documentation: Option>, - - /// An explanation of the difference between the disputed charge versus the prior charge that appears to be a duplicate. - pub duplicate_charge_explanation: Option, - - /// The Stripe ID for the prior charge which appears to be a duplicate of the disputed charge. - pub duplicate_charge_id: Option, - - /// A description of the product or service that was sold. - pub product_description: Option, - - /// (ID of a [file upload](https://stripe.com/docs/guides/file-upload)) Any receipt or message sent to the customer notifying them of the charge. - pub receipt: Option>, - - /// (ID of a [file upload](https://stripe.com/docs/guides/file-upload)) Your refund policy, as shown to the customer. - pub refund_policy: Option>, - - /// Documentation demonstrating that the customer was shown your refund policy prior to purchase. - pub refund_policy_disclosure: Option, - - /// A justification for why the customer is not entitled to a refund. - pub refund_refusal_explanation: Option, - - /// The date on which the customer received or began receiving the purchased service, in a clear human-readable format. - pub service_date: Option, - - /// (ID of a [file upload](https://stripe.com/docs/guides/file-upload)) Documentation showing proof that a service was provided to the customer. - /// - /// This could include a copy of a signed contract, work order, or other form of written agreement. - pub service_documentation: Option>, - - /// The address to which a physical product was shipped. - /// - /// You should try to include as complete address information as possible. - pub shipping_address: Option, - - /// The delivery service that shipped a physical product, such as Fedex, UPS, USPS, etc. - /// - /// If multiple carriers were used for this purchase, please separate them with commas. - pub shipping_carrier: Option, - - /// The date on which a physical product began its route to the shipping address, in a clear human-readable format. - pub shipping_date: Option, - - /// (ID of a [file upload](https://stripe.com/docs/guides/file-upload)) Documentation showing proof that a product was shipped to the customer at the same address the customer provided to you. - /// - /// This could include a copy of the shipment receipt, shipping label, etc. - /// It should show the customer's full shipping address, if possible. - pub shipping_documentation: Option>, - - /// The tracking number for a physical product, obtained from the delivery service. - /// - /// If multiple tracking numbers were generated for this purchase, please separate them with commas. - pub shipping_tracking_number: Option, - - /// (ID of a [file upload](https://stripe.com/docs/guides/file-upload)) Any additional evidence or statements. - pub uncategorized_file: Option>, - - /// Any additional evidence or statements. - pub uncategorized_text: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct DisputeEvidenceDetails { - /// Date by which evidence must be submitted in order to successfully challenge dispute. - /// - /// Will be 0 if the customer's bank or credit card company doesn't allow a response for this particular dispute. - pub due_by: Option, - - /// Whether evidence has been staged for this dispute. - pub has_evidence: bool, - - /// Whether the last evidence submission was submitted past the due date. - /// - /// Defaults to `false` if no evidence submissions have occurred. - /// If `true`, then delivery of the latest evidence is *not* guaranteed. - pub past_due: bool, - - /// The number of times evidence has been submitted. - /// - /// Typically, you may only submit evidence once. - pub submission_count: u64, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct DisputePaymentMethodDetails { - /// Card specific dispute details. - pub card: Option, - - /// Payment method type. - #[serde(rename = "type")] - pub type_: DisputePaymentMethodDetailsType, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct DisputePaymentMethodDetailsCard { - /// Card brand. - /// - /// Can be `amex`, `diners`, `discover`, `eftpos_au`, `jcb`, `mastercard`, `unionpay`, `visa`, or `unknown`. - pub brand: String, - - /// The card network's specific dispute reason code, which maps to one of Stripe's primary dispute categories to simplify response guidance. - /// - /// The [Network code map](https://stripe.com/docs/disputes/categories#network-code-map) lists all available dispute reason codes by network. - pub network_reason_code: Option, -} - -/// The parameters for `Dispute::list`. -#[derive(Clone, Debug, Serialize, Default)] -pub struct ListDisputes<'a> { - /// Only return disputes associated to the charge specified by this charge ID. - #[serde(skip_serializing_if = "Option::is_none")] - pub charge: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub created: Option>, - - /// A cursor for use in pagination. - /// - /// `ending_before` is an object ID that defines your place in the list. - /// For instance, if you make a list request and receive 100 objects, starting with `obj_bar`, your subsequent call can include `ending_before=obj_bar` in order to fetch the previous page of the list. - #[serde(skip_serializing_if = "Option::is_none")] - pub ending_before: Option, - - /// Specifies which fields in the response should be expanded. - #[serde(skip_serializing_if = "Expand::is_empty")] - pub expand: &'a [&'a str], - - /// A limit on the number of objects to be returned. - /// - /// Limit can range between 1 and 100, and the default is 10. - #[serde(skip_serializing_if = "Option::is_none")] - pub limit: Option, - - /// Only return disputes associated to the PaymentIntent specified by this PaymentIntent ID. - #[serde(skip_serializing_if = "Option::is_none")] - pub payment_intent: Option, - - /// A cursor for use in pagination. - /// - /// `starting_after` is an object ID that defines your place in the list. - /// For instance, if you make a list request and receive 100 objects, ending with `obj_foo`, your subsequent call can include `starting_after=obj_foo` in order to fetch the next page of the list. - #[serde(skip_serializing_if = "Option::is_none")] - pub starting_after: Option, -} - -impl<'a> ListDisputes<'a> { - pub fn new() -> Self { - ListDisputes { - charge: Default::default(), - created: Default::default(), - ending_before: Default::default(), - expand: Default::default(), - limit: Default::default(), - payment_intent: Default::default(), - starting_after: Default::default(), - } - } -} -impl Paginable for ListDisputes<'_> { - type O = Dispute; - fn set_last(&mut self, item: Self::O) { - self.starting_after = Some(item.id()); - } -} -/// An enum representing the possible values of an `DisputePaymentMethodDetails`'s `type` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum DisputePaymentMethodDetailsType { - Card, -} - -impl DisputePaymentMethodDetailsType { - pub fn as_str(self) -> &'static str { - match self { - DisputePaymentMethodDetailsType::Card => "card", - } - } -} - -impl AsRef for DisputePaymentMethodDetailsType { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for DisputePaymentMethodDetailsType { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for DisputePaymentMethodDetailsType { - fn default() -> Self { - Self::Card - } -} - -/// An enum representing the possible values of an `Dispute`'s `status` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum DisputeStatus { - Lost, - NeedsResponse, - UnderReview, - WarningClosed, - WarningNeedsResponse, - WarningUnderReview, - Won, -} - -impl DisputeStatus { - pub fn as_str(self) -> &'static str { - match self { - DisputeStatus::Lost => "lost", - DisputeStatus::NeedsResponse => "needs_response", - DisputeStatus::UnderReview => "under_review", - DisputeStatus::WarningClosed => "warning_closed", - DisputeStatus::WarningNeedsResponse => "warning_needs_response", - DisputeStatus::WarningUnderReview => "warning_under_review", - DisputeStatus::Won => "won", - } - } -} - -impl AsRef for DisputeStatus { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for DisputeStatus { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for DisputeStatus { - fn default() -> Self { - Self::Lost - } -} diff --git a/src/resources/generated/ephemeral_key.rs b/src/resources/generated/ephemeral_key.rs deleted file mode 100644 index a9ee6c0fc..000000000 --- a/src/resources/generated/ephemeral_key.rs +++ /dev/null @@ -1,93 +0,0 @@ -// ====================================== -// This file was automatically generated. -// ====================================== - -use serde::{Deserialize, Serialize}; - -use crate::client::{Client, Response}; -use crate::ids::{CustomerId, EphemeralKeyId, IssuingCardId}; -use crate::params::{Deleted, Expand, Object, Timestamp}; - -/// The resource representing a Stripe "EphemeralKey". -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct EphemeralKey { - /// Unique identifier for the object. - pub id: EphemeralKeyId, - - /// Time at which the object was created. - /// - /// Measured in seconds since the Unix epoch. - pub created: Timestamp, - - /// Time at which the key will expire. - /// - /// Measured in seconds since the Unix epoch. - pub expires: Timestamp, - - /// Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. - pub livemode: bool, - - /// The key's secret. - /// - /// You can use this value to make authorized requests to the Stripe API. - #[serde(skip_serializing_if = "Option::is_none")] - pub secret: Option, -} - -impl EphemeralKey { - /// Creates a short-lived API key for a given resource. - pub fn create(client: &Client, params: CreateEphemeralKey<'_>) -> Response { - client.post_form("/ephemeral_keys", ¶ms) - } - - /// Invalidates a short-lived API key for a given resource. - pub fn delete(client: &Client, id: &EphemeralKeyId) -> Response> { - client.delete(&format!("/ephemeral_keys/{}", id)) - } -} - -impl Object for EphemeralKey { - type Id = EphemeralKeyId; - fn id(&self) -> Self::Id { - self.id.clone() - } - fn object(&self) -> &'static str { - "ephemeral_key" - } -} - -/// The parameters for `EphemeralKey::create`. -#[derive(Clone, Debug, Serialize, Default)] -pub struct CreateEphemeralKey<'a> { - /// The ID of the Customer you'd like to modify using the resulting ephemeral key. - #[serde(skip_serializing_if = "Option::is_none")] - pub customer: Option, - - /// Specifies which fields in the response should be expanded. - #[serde(skip_serializing_if = "Expand::is_empty")] - pub expand: &'a [&'a str], - - /// The ID of the Issuing Card you'd like to access using the resulting ephemeral key. - #[serde(skip_serializing_if = "Option::is_none")] - pub issuing_card: Option, - - /// A single-use token, created by Stripe.js, used for creating ephemeral keys for Issuing Cards without exchanging sensitive information. - #[serde(skip_serializing_if = "Option::is_none")] - pub nonce: Option<&'a str>, - - /// The ID of the Identity VerificationSession you'd like to access using the resulting ephemeral key. - #[serde(skip_serializing_if = "Option::is_none")] - pub verification_session: Option<&'a str>, -} - -impl<'a> CreateEphemeralKey<'a> { - pub fn new() -> Self { - CreateEphemeralKey { - customer: Default::default(), - expand: Default::default(), - issuing_card: Default::default(), - nonce: Default::default(), - verification_session: Default::default(), - } - } -} diff --git a/src/resources/generated/event.rs b/src/resources/generated/event.rs deleted file mode 100644 index a3a85e112..000000000 --- a/src/resources/generated/event.rs +++ /dev/null @@ -1,160 +0,0 @@ -// ====================================== -// This file was automatically generated. -// ====================================== - -use serde::{Deserialize, Serialize}; - -use crate::client::{Client, Response}; -use crate::ids::EventId; -use crate::params::{Expand, List, Object, Paginable, RangeQuery, Timestamp}; -use crate::resources::{EventType, NotificationEventData}; - -/// The resource representing a Stripe "NotificationEvent". -/// -/// For more details see -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct Event { - /// Unique identifier for the object. - pub id: EventId, - - /// The connected account that originates the event. - #[serde(skip_serializing_if = "Option::is_none")] - pub account: Option, - - /// The Stripe API version used to render `data`. - /// - /// This property is populated only for events on or after October 31, 2014. - pub api_version: Option, - - /// Time at which the object was created. - /// - /// Measured in seconds since the Unix epoch. - pub created: Timestamp, - - pub data: NotificationEventData, - - /// Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. - pub livemode: bool, - - /// Number of webhooks that haven't been successfully delivered (for example, to return a 20x response) to the URLs you specify. - pub pending_webhooks: i64, - - /// Information on the API request that triggers the event. - pub request: Option, - - /// Description of the event (for example, `invoice.created` or `charge.refunded`). - #[serde(rename = "type")] - pub type_: EventType, -} - -impl Event { - /// List events, going back up to 30 days. - /// - /// Each event data is rendered according to Stripe API version at its creation time, specified in [event object](https://stripe.com/docs/api/events/object) `api_version` attribute (not according to your current Stripe API version or `Stripe-Version` header). - pub fn list(client: &Client, params: &ListEvents<'_>) -> Response> { - client.get_query("/events", ¶ms) - } - - /// Retrieves the details of an event. - /// - /// Supply the unique identifier of the event, which you might have received in a webhook. - pub fn retrieve(client: &Client, id: &EventId, expand: &[&str]) -> Response { - client.get_query(&format!("/events/{}", id), &Expand { expand }) - } -} - -impl Object for Event { - type Id = EventId; - fn id(&self) -> Self::Id { - self.id.clone() - } - fn object(&self) -> &'static str { - "event" - } -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct NotificationEventRequest { - /// ID of the API request that caused the event. - /// - /// If null, the event was automatic (e.g., Stripe's automatic subscription handling). - /// Request logs are available in the [dashboard](https://dashboard.stripe.com/logs), but currently not in the API. - pub id: Option, - - /// The idempotency key transmitted during the request, if any. - /// - /// *Note: This property is populated only for events on or after May 23, 2017*. - pub idempotency_key: Option, -} - -/// The parameters for `Event::list`. -#[derive(Clone, Debug, Serialize, Default)] -pub struct ListEvents<'a> { - #[serde(skip_serializing_if = "Option::is_none")] - pub created: Option>, - - /// Filter events by whether all webhooks were successfully delivered. - /// - /// If false, events which are still pending or have failed all delivery attempts to a webhook endpoint will be returned. - #[serde(skip_serializing_if = "Option::is_none")] - pub delivery_success: Option, - - /// A cursor for use in pagination. - /// - /// `ending_before` is an object ID that defines your place in the list. - /// For instance, if you make a list request and receive 100 objects, starting with `obj_bar`, your subsequent call can include `ending_before=obj_bar` in order to fetch the previous page of the list. - #[serde(skip_serializing_if = "Option::is_none")] - pub ending_before: Option, - - /// Specifies which fields in the response should be expanded. - #[serde(skip_serializing_if = "Expand::is_empty")] - pub expand: &'a [&'a str], - - /// A limit on the number of objects to be returned. - /// - /// Limit can range between 1 and 100, and the default is 10. - #[serde(skip_serializing_if = "Option::is_none")] - pub limit: Option, - - /// A cursor for use in pagination. - /// - /// `starting_after` is an object ID that defines your place in the list. - /// For instance, if you make a list request and receive 100 objects, ending with `obj_foo`, your subsequent call can include `starting_after=obj_foo` in order to fetch the next page of the list. - #[serde(skip_serializing_if = "Option::is_none")] - pub starting_after: Option, - - /// A string containing a specific event name, or group of events using * as a wildcard. - /// - /// The list will be filtered to include only events with a matching event property. - #[serde(rename = "type")] - #[serde(skip_serializing_if = "Option::is_none")] - pub type_: Option<&'a str>, - - /// An array of up to 20 strings containing specific event names. - /// - /// The list will be filtered to include only events with a matching event property. - /// You may pass either `type` or `types`, but not both. - #[serde(skip_serializing_if = "Option::is_none")] - pub types: Option>, -} - -impl<'a> ListEvents<'a> { - pub fn new() -> Self { - ListEvents { - created: Default::default(), - delivery_success: Default::default(), - ending_before: Default::default(), - expand: Default::default(), - limit: Default::default(), - starting_after: Default::default(), - type_: Default::default(), - types: Default::default(), - } - } -} -impl Paginable for ListEvents<'_> { - type O = Event; - fn set_last(&mut self, item: Self::O) { - self.starting_after = Some(item.id()); - } -} diff --git a/src/resources/generated/exchange_rate.rs b/src/resources/generated/exchange_rate.rs deleted file mode 100644 index 52f13cf58..000000000 --- a/src/resources/generated/exchange_rate.rs +++ /dev/null @@ -1,91 +0,0 @@ -// ====================================== -// This file was automatically generated. -// ====================================== - -use crate::client::{Client, Response}; -use crate::ids::{ExchangeRateId}; -use crate::params::{Expand, List, Object, Paginable}; -use serde::{Deserialize, Serialize}; - -/// The resource representing a Stripe "ExchangeRate". -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct ExchangeRate { - /// Unique identifier for the object. - /// - /// Represented as the three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html) in lowercase. - pub id: ExchangeRateId, - - /// Hash where the keys are supported currencies and the values are the exchange rate at which the base id currency converts to the key currency. - pub rates: f64, -} - -impl ExchangeRate { - - /// Returns a list of objects that contain the rates at which foreign currencies are converted to one another. - /// - /// Only shows the currencies for which Stripe supports. -pub fn list(client: &Client, params: &ListExchangeRates<'_>) -> Response> { - client.get_query("/exchange_rates", ¶ms) -} - - - /// Retrieves the exchange rates from the given currency to every supported currency. - pub fn retrieve(client: &Client, id: &ExchangeRateId, expand: &[&str]) -> Response { - client.get_query(&format!("/exchange_rates/{}", id), &Expand { expand }) - } -} - -impl Object for ExchangeRate { - type Id = ExchangeRateId; - fn id(&self) -> Self::Id { - self.id.clone() - } - fn object(&self) -> &'static str { - "exchange_rate" - } -} - -/// The parameters for `ExchangeRate::list`. -#[derive(Clone, Debug, Serialize, Default)] -pub struct ListExchangeRates<'a> { - - /// A cursor for use in pagination. - /// - /// `ending_before` is the currency that defines your place in the list. - /// For instance, if you make a list request and receive 100 objects, starting with the exchange rate for currency X your subsequent call can include `ending_before=obj_bar` in order to fetch the previous page of the list. - #[serde(skip_serializing_if = "Option::is_none")] - pub ending_before: Option, - - /// Specifies which fields in the response should be expanded. - #[serde(skip_serializing_if = "Expand::is_empty")] - pub expand: &'a [&'a str], - - /// A limit on the number of objects to be returned. - /// - /// Limit can range between 1 and total number of supported payout currencies, and the default is the max. - #[serde(skip_serializing_if = "Option::is_none")] - pub limit: Option, - - /// A cursor for use in pagination. - /// - /// `starting_after` is the currency that defines your place in the list. - /// For instance, if you make a list request and receive 100 objects, ending with the exchange rate for currency X, your subsequent call can include `starting_after=X` in order to fetch the next page of the list. - #[serde(skip_serializing_if = "Option::is_none")] - pub starting_after: Option, -} - -impl<'a> ListExchangeRates<'a> { - pub fn new() -> Self { - ListExchangeRates { - ending_before: Default::default(), - expand: Default::default(), - limit: Default::default(), - starting_after: Default::default(), - } - } -} -impl Paginable for ListExchangeRates<'_> { - type O = ExchangeRate; - fn set_last(&mut self, item: Self::O) { - self.starting_after = Some(item.id()); - }} \ No newline at end of file diff --git a/src/resources/generated/fee_refund.rs b/src/resources/generated/fee_refund.rs deleted file mode 100644 index e2b84faee..000000000 --- a/src/resources/generated/fee_refund.rs +++ /dev/null @@ -1,52 +0,0 @@ -// ====================================== -// This file was automatically generated. -// ====================================== - -use serde::{Deserialize, Serialize}; - -use crate::ids::ApplicationFeeRefundId; -use crate::params::{Expandable, Metadata, Object, Timestamp}; -use crate::resources::{ApplicationFee, BalanceTransaction, Currency}; - -/// The resource representing a Stripe "FeeRefund". -/// -/// For more details see -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct ApplicationFeeRefund { - /// Unique identifier for the object. - pub id: ApplicationFeeRefundId, - - /// Amount, in cents (or local equivalent). - pub amount: i64, - - /// Balance transaction that describes the impact on your account balance. - pub balance_transaction: Option>, - - /// Time at which the object was created. - /// - /// Measured in seconds since the Unix epoch. - pub created: Timestamp, - - /// Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. - /// - /// Must be a [supported currency](https://stripe.com/docs/currencies). - pub currency: Currency, - - /// ID of the application fee that was refunded. - pub fee: Expandable, - - /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. - /// - /// This can be useful for storing additional information about the object in a structured format. - pub metadata: Option, -} - -impl Object for ApplicationFeeRefund { - type Id = ApplicationFeeRefundId; - fn id(&self) -> Self::Id { - self.id.clone() - } - fn object(&self) -> &'static str { - "fee_refund" - } -} diff --git a/src/resources/generated/file.rs b/src/resources/generated/file.rs deleted file mode 100644 index e88126ffd..000000000 --- a/src/resources/generated/file.rs +++ /dev/null @@ -1,192 +0,0 @@ -// ====================================== -// This file was automatically generated. -// ====================================== - -use serde::{Deserialize, Serialize}; - -use crate::client::{Client, Response}; -use crate::ids::FileId; -use crate::params::{Expand, List, Object, Paginable, RangeQuery, Timestamp}; -use crate::resources::FileLink; - -/// The resource representing a Stripe "File". -/// -/// For more details see -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct File { - /// Unique identifier for the object. - pub id: FileId, - - /// Time at which the object was created. - /// - /// Measured in seconds since the Unix epoch. - pub created: Timestamp, - - /// The file expires and isn't available at this time in epoch seconds. - pub expires_at: Option, - - /// The suitable name for saving the file to a filesystem. - pub filename: Option, - - /// A list of [file links](https://stripe.com/docs/api#file_links) that point at this file. - #[serde(skip_serializing_if = "Option::is_none")] - pub links: Option>, - - /// The [purpose](https://stripe.com/docs/file-upload#uploading-a-file) of the uploaded file. - pub purpose: FilePurpose, - - /// The size of the file object in bytes. - pub size: u64, - - /// A suitable title for the document. - pub title: Option, - - /// The returned file type (for example, `csv`, `pdf`, `jpg`, or `png`). - #[serde(rename = "type")] - pub type_: Option, - - /// Use your live secret API key to download the file from this URL. - pub url: Option, -} - -impl File { - /// Returns a list of the files that your account has access to. - /// - /// Stripe sorts and returns the files by their creation dates, placing the most recently created files at the top. - pub fn list(client: &Client, params: &ListFiles<'_>) -> Response> { - client.get_query("/files", ¶ms) - } - - /// Retrieves the details of an existing file object. - /// - /// After you supply a unique file ID, Stripe returns the corresponding file object. - /// Learn how to [access file contents](https://stripe.com/docs/file-upload#download-file-contents). - pub fn retrieve(client: &Client, id: &FileId, expand: &[&str]) -> Response { - client.get_query(&format!("/files/{}", id), &Expand { expand }) - } -} - -impl Object for File { - type Id = FileId; - fn id(&self) -> Self::Id { - self.id.clone() - } - fn object(&self) -> &'static str { - "file" - } -} - -/// The parameters for `File::list`. -#[derive(Clone, Debug, Serialize, Default)] -pub struct ListFiles<'a> { - #[serde(skip_serializing_if = "Option::is_none")] - pub created: Option>, - - /// A cursor for use in pagination. - /// - /// `ending_before` is an object ID that defines your place in the list. - /// For instance, if you make a list request and receive 100 objects, starting with `obj_bar`, your subsequent call can include `ending_before=obj_bar` in order to fetch the previous page of the list. - #[serde(skip_serializing_if = "Option::is_none")] - pub ending_before: Option, - - /// Specifies which fields in the response should be expanded. - #[serde(skip_serializing_if = "Expand::is_empty")] - pub expand: &'a [&'a str], - - /// A limit on the number of objects to be returned. - /// - /// Limit can range between 1 and 100, and the default is 10. - #[serde(skip_serializing_if = "Option::is_none")] - pub limit: Option, - - /// Filter queries by the file purpose. - /// - /// If you don't provide a purpose, the queries return unfiltered files. - #[serde(skip_serializing_if = "Option::is_none")] - pub purpose: Option, - - /// A cursor for use in pagination. - /// - /// `starting_after` is an object ID that defines your place in the list. - /// For instance, if you make a list request and receive 100 objects, ending with `obj_foo`, your subsequent call can include `starting_after=obj_foo` in order to fetch the next page of the list. - #[serde(skip_serializing_if = "Option::is_none")] - pub starting_after: Option, -} - -impl<'a> ListFiles<'a> { - pub fn new() -> Self { - ListFiles { - created: Default::default(), - ending_before: Default::default(), - expand: Default::default(), - limit: Default::default(), - purpose: Default::default(), - starting_after: Default::default(), - } - } -} -impl Paginable for ListFiles<'_> { - type O = File; - fn set_last(&mut self, item: Self::O) { - self.starting_after = Some(item.id()); - } -} -/// An enum representing the possible values of an `ListFiles`'s `purpose` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum FilePurpose { - AccountRequirement, - AdditionalVerification, - BusinessIcon, - BusinessLogo, - CustomerSignature, - DisputeEvidence, - DocumentProviderIdentityDocument, - FinanceReportRun, - IdentityDocument, - IdentityDocumentDownloadable, - PciDocument, - Selfie, - SigmaScheduledQuery, - TaxDocumentUserUpload, - TerminalReaderSplashscreen, -} - -impl FilePurpose { - pub fn as_str(self) -> &'static str { - match self { - FilePurpose::AccountRequirement => "account_requirement", - FilePurpose::AdditionalVerification => "additional_verification", - FilePurpose::BusinessIcon => "business_icon", - FilePurpose::BusinessLogo => "business_logo", - FilePurpose::CustomerSignature => "customer_signature", - FilePurpose::DisputeEvidence => "dispute_evidence", - FilePurpose::DocumentProviderIdentityDocument => "document_provider_identity_document", - FilePurpose::FinanceReportRun => "finance_report_run", - FilePurpose::IdentityDocument => "identity_document", - FilePurpose::IdentityDocumentDownloadable => "identity_document_downloadable", - FilePurpose::PciDocument => "pci_document", - FilePurpose::Selfie => "selfie", - FilePurpose::SigmaScheduledQuery => "sigma_scheduled_query", - FilePurpose::TaxDocumentUserUpload => "tax_document_user_upload", - FilePurpose::TerminalReaderSplashscreen => "terminal_reader_splashscreen", - } - } -} - -impl AsRef for FilePurpose { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for FilePurpose { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for FilePurpose { - fn default() -> Self { - Self::AccountRequirement - } -} diff --git a/src/resources/generated/file_created.rs b/src/resources/generated/file_created.rs deleted file mode 100644 index 0361e55db..000000000 --- a/src/resources/generated/file_created.rs +++ /dev/null @@ -1,10 +0,0 @@ -// ====================================== -// This file was automatically generated. -// ====================================== - -use serde::{Deserialize, Serialize}; - -/// The resource representing a Stripe "file.created". -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct FileCreated { -} diff --git a/src/resources/generated/file_link.rs b/src/resources/generated/file_link.rs deleted file mode 100644 index 7b30826cc..000000000 --- a/src/resources/generated/file_link.rs +++ /dev/null @@ -1,208 +0,0 @@ -// ====================================== -// This file was automatically generated. -// ====================================== - -use serde::{Deserialize, Serialize}; - -use crate::client::{Client, Response}; -use crate::ids::{FileId, FileLinkId}; -use crate::params::{Expand, Expandable, List, Metadata, Object, Paginable, RangeQuery, Timestamp}; -use crate::resources::{File, Scheduled}; - -/// The resource representing a Stripe "FileLink". -/// -/// For more details see -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct FileLink { - /// Unique identifier for the object. - pub id: FileLinkId, - - /// Time at which the object was created. - /// - /// Measured in seconds since the Unix epoch. - pub created: Timestamp, - - /// Returns if the link is already expired. - pub expired: bool, - - /// Time that the link expires. - pub expires_at: Option, - - /// The file object this link points to. - pub file: Expandable, - - /// Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. - pub livemode: bool, - - /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. - /// - /// This can be useful for storing additional information about the object in a structured format. - pub metadata: Metadata, - - /// The publicly accessible URL to download the file. - pub url: Option, -} - -impl FileLink { - /// Returns a list of file links. - pub fn list(client: &Client, params: &ListFileLinks<'_>) -> Response> { - client.get_query("/file_links", ¶ms) - } - - /// Creates a new file link object. - pub fn create(client: &Client, params: CreateFileLink<'_>) -> Response { - client.post_form("/file_links", ¶ms) - } - - /// Retrieves the file link with the given ID. - pub fn retrieve(client: &Client, id: &FileLinkId, expand: &[&str]) -> Response { - client.get_query(&format!("/file_links/{}", id), &Expand { expand }) - } - - /// Updates an existing file link object. - /// - /// Expired links can no longer be updated. - pub fn update( - client: &Client, - id: &FileLinkId, - params: UpdateFileLink<'_>, - ) -> Response { - client.post_form(&format!("/file_links/{}", id), ¶ms) - } -} - -impl Object for FileLink { - type Id = FileLinkId; - fn id(&self) -> Self::Id { - self.id.clone() - } - fn object(&self) -> &'static str { - "file_link" - } -} - -/// The parameters for `FileLink::create`. -#[derive(Clone, Debug, Serialize)] -pub struct CreateFileLink<'a> { - /// Specifies which fields in the response should be expanded. - #[serde(skip_serializing_if = "Expand::is_empty")] - pub expand: &'a [&'a str], - - /// The link isn't usable after this future timestamp. - #[serde(skip_serializing_if = "Option::is_none")] - pub expires_at: Option, - - /// The ID of the file. - /// - /// The file's `purpose` must be one of the following: `business_icon`, `business_logo`, `customer_signature`, `dispute_evidence`, `finance_report_run`, `identity_document_downloadable`, `pci_document`, `selfie`, `sigma_scheduled_query`, `tax_document_user_upload`, or `terminal_reader_splashscreen`. - pub file: FileId, - - /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. - /// - /// This can be useful for storing additional information about the object in a structured format. - /// Individual keys can be unset by posting an empty value to them. - /// All keys can be unset by posting an empty value to `metadata`. - #[serde(skip_serializing_if = "Option::is_none")] - pub metadata: Option, -} - -impl<'a> CreateFileLink<'a> { - pub fn new(file: FileId) -> Self { - CreateFileLink { - expand: Default::default(), - expires_at: Default::default(), - file, - metadata: Default::default(), - } - } -} - -/// The parameters for `FileLink::list`. -#[derive(Clone, Debug, Serialize, Default)] -pub struct ListFileLinks<'a> { - #[serde(skip_serializing_if = "Option::is_none")] - pub created: Option>, - - /// A cursor for use in pagination. - /// - /// `ending_before` is an object ID that defines your place in the list. - /// For instance, if you make a list request and receive 100 objects, starting with `obj_bar`, your subsequent call can include `ending_before=obj_bar` in order to fetch the previous page of the list. - #[serde(skip_serializing_if = "Option::is_none")] - pub ending_before: Option, - - /// Specifies which fields in the response should be expanded. - #[serde(skip_serializing_if = "Expand::is_empty")] - pub expand: &'a [&'a str], - - /// Filter links by their expiration status. - /// - /// By default, Stripe returns all links. - #[serde(skip_serializing_if = "Option::is_none")] - pub expired: Option, - - /// Only return links for the given file. - #[serde(skip_serializing_if = "Option::is_none")] - pub file: Option, - - /// A limit on the number of objects to be returned. - /// - /// Limit can range between 1 and 100, and the default is 10. - #[serde(skip_serializing_if = "Option::is_none")] - pub limit: Option, - - /// A cursor for use in pagination. - /// - /// `starting_after` is an object ID that defines your place in the list. - /// For instance, if you make a list request and receive 100 objects, ending with `obj_foo`, your subsequent call can include `starting_after=obj_foo` in order to fetch the next page of the list. - #[serde(skip_serializing_if = "Option::is_none")] - pub starting_after: Option, -} - -impl<'a> ListFileLinks<'a> { - pub fn new() -> Self { - ListFileLinks { - created: Default::default(), - ending_before: Default::default(), - expand: Default::default(), - expired: Default::default(), - file: Default::default(), - limit: Default::default(), - starting_after: Default::default(), - } - } -} -impl Paginable for ListFileLinks<'_> { - type O = FileLink; - fn set_last(&mut self, item: Self::O) { - self.starting_after = Some(item.id()); - } -} -/// The parameters for `FileLink::update`. -#[derive(Clone, Debug, Serialize, Default)] -pub struct UpdateFileLink<'a> { - /// Specifies which fields in the response should be expanded. - #[serde(skip_serializing_if = "Expand::is_empty")] - pub expand: &'a [&'a str], - - /// A future timestamp after which the link will no longer be usable, or `now` to expire the link immediately. - #[serde(skip_serializing_if = "Option::is_none")] - pub expires_at: Option, - - /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. - /// - /// This can be useful for storing additional information about the object in a structured format. - /// Individual keys can be unset by posting an empty value to them. - /// All keys can be unset by posting an empty value to `metadata`. - #[serde(skip_serializing_if = "Option::is_none")] - pub metadata: Option, -} - -impl<'a> UpdateFileLink<'a> { - pub fn new() -> Self { - UpdateFileLink { - expand: Default::default(), - expires_at: Default::default(), - metadata: Default::default(), - } - } -} diff --git a/src/resources/generated/financial_connections_account.rs b/src/resources/generated/financial_connections_account.rs deleted file mode 100644 index a7a2f7ed7..000000000 --- a/src/resources/generated/financial_connections_account.rs +++ /dev/null @@ -1,566 +0,0 @@ -// ====================================== -// This file was automatically generated. -// ====================================== - -use crate::ids::{FinancialConnectionsAccountId}; -use crate::params::{Expandable, Object, Timestamp}; -use crate::resources::{BankConnectionsResourceAccountholder, FinancialConnectionsAccountOwnership}; -use serde::{Deserialize, Serialize}; - -/// The resource representing a Stripe "BankConnectionsResourceLinkedAccount". -/// -/// For more details see -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct FinancialConnectionsAccount { - /// Unique identifier for the object. - pub id: FinancialConnectionsAccountId, - - /// The account holder that this account belongs to. - pub account_holder: Option, - - /// The most recent information about the account's balance. - pub balance: Option, - - /// The state of the most recent attempt to refresh the account balance. - pub balance_refresh: Option, - - /// The type of the account. - /// - /// Account category is further divided in `subcategory`. - pub category: FinancialConnectionsAccountCategory, - - /// Time at which the object was created. - /// - /// Measured in seconds since the Unix epoch. - pub created: Timestamp, - - /// A human-readable name that has been assigned to this account, either by the account holder or by the institution. - pub display_name: Option, - - /// The name of the institution that holds this account. - pub institution_name: String, - - /// The last 4 digits of the account number. - /// - /// If present, this will be 4 numeric characters. - pub last4: Option, - - /// Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. - pub livemode: bool, - - /// The most recent information about the account's owners. - pub ownership: Option>, - - /// The state of the most recent attempt to refresh the account owners. - pub ownership_refresh: Option, - - /// The list of permissions granted by this account. - pub permissions: Option>, - - /// The status of the link to the account. - pub status: FinancialConnectionsAccountStatus, - - /// If `category` is `cash`, one of: - /// - /// - `checking` - /// - `savings` - /// - `other` - /// - /// If `category` is `credit`, one of: - /// - /// - `mortgage` - /// - `line_of_credit` - /// - `credit_card` - /// - `other` - /// - /// If `category` is `investment` or `other`, this will be `other`. - pub subcategory: FinancialConnectionsAccountSubcategory, - - /// The list of data refresh subscriptions requested on this account. - pub subscriptions: Option>, - - /// The [PaymentMethod type](https://stripe.com/docs/api/payment_methods/object#payment_method_object-type)(s) that can be created from this account. - pub supported_payment_method_types: Vec, - - /// The state of the most recent attempt to refresh the account transactions. - pub transaction_refresh: Option, -} - -impl Object for FinancialConnectionsAccount { - type Id = FinancialConnectionsAccountId; - fn id(&self) -> Self::Id { - self.id.clone() - } - fn object(&self) -> &'static str { - "financial_connections.account" - } -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct BankConnectionsResourceBalance { - - /// The time that the external institution calculated this balance. - /// - /// Measured in seconds since the Unix epoch. - pub as_of: Timestamp, - - #[serde(skip_serializing_if = "Option::is_none")] - pub cash: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub credit: Option, - - /// The balances owed to (or by) the account holder. - /// - /// Each key is a three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. - /// - /// Each value is a integer amount. - /// - /// A positive amount indicates money owed to the account holder. - /// A negative amount indicates money owed by the account holder. - pub current: i64, - - /// The `type` of the balance. - /// - /// An additional hash is included on the balance with a name matching this value. - #[serde(rename = "type")] - pub type_: BankConnectionsResourceBalanceType, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct BankConnectionsResourceBalanceApiResourceCashBalance { - - /// The funds available to the account holder. - /// - /// Typically this is the current balance less any holds. Each key is a three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. Each value is a integer amount. - /// A positive amount indicates money owed to the account holder. - /// A negative amount indicates money owed by the account holder. - pub available: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct BankConnectionsResourceBalanceApiResourceCreditBalance { - - /// The credit that has been used by the account holder. - /// - /// Each key is a three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. - /// - /// Each value is a integer amount. - /// - /// A positive amount indicates money owed to the account holder. - /// A negative amount indicates money owed by the account holder. - pub used: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct BankConnectionsResourceBalanceRefresh { - - /// The time at which the last refresh attempt was initiated. - /// - /// Measured in seconds since the Unix epoch. - pub last_attempted_at: Timestamp, - - /// Time at which the next balance refresh can be initiated. - /// - /// This value will be `null` when `status` is `pending`. - /// Measured in seconds since the Unix epoch. - pub next_refresh_available_at: Option, - - /// The status of the last refresh attempt. - pub status: BankConnectionsResourceBalanceRefreshStatus, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct BankConnectionsResourceOwnershipRefresh { - - /// The time at which the last refresh attempt was initiated. - /// - /// Measured in seconds since the Unix epoch. - pub last_attempted_at: Timestamp, - - /// The status of the last refresh attempt. - pub status: BankConnectionsResourceOwnershipRefreshStatus, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct BankConnectionsResourceTransactionRefresh { - - /// Unique identifier for the object. - pub id: String, - - /// The time at which the last refresh attempt was initiated. - /// - /// Measured in seconds since the Unix epoch. - pub last_attempted_at: Timestamp, - - /// Time at which the next transaction refresh can be initiated. - /// - /// This value will be `null` when `status` is `pending`. - /// Measured in seconds since the Unix epoch. - pub next_refresh_available_at: Option, - - /// The status of the last refresh attempt. - pub status: BankConnectionsResourceTransactionRefreshStatus, -} - -/// An enum representing the possible values of an `BankConnectionsResourceBalanceRefresh`'s `status` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum BankConnectionsResourceBalanceRefreshStatus { - Failed, - Pending, - Succeeded, -} - -impl BankConnectionsResourceBalanceRefreshStatus { - pub fn as_str(self) -> &'static str { - match self { - BankConnectionsResourceBalanceRefreshStatus::Failed => "failed", - BankConnectionsResourceBalanceRefreshStatus::Pending => "pending", - BankConnectionsResourceBalanceRefreshStatus::Succeeded => "succeeded", - } - } -} - -impl AsRef for BankConnectionsResourceBalanceRefreshStatus { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for BankConnectionsResourceBalanceRefreshStatus { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for BankConnectionsResourceBalanceRefreshStatus { - fn default() -> Self { - Self::Failed - } -} - -/// An enum representing the possible values of an `BankConnectionsResourceBalance`'s `type` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum BankConnectionsResourceBalanceType { - Cash, - Credit, -} - -impl BankConnectionsResourceBalanceType { - pub fn as_str(self) -> &'static str { - match self { - BankConnectionsResourceBalanceType::Cash => "cash", - BankConnectionsResourceBalanceType::Credit => "credit", - } - } -} - -impl AsRef for BankConnectionsResourceBalanceType { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for BankConnectionsResourceBalanceType { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for BankConnectionsResourceBalanceType { - fn default() -> Self { - Self::Cash - } -} - -/// An enum representing the possible values of an `BankConnectionsResourceOwnershipRefresh`'s `status` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum BankConnectionsResourceOwnershipRefreshStatus { - Failed, - Pending, - Succeeded, -} - -impl BankConnectionsResourceOwnershipRefreshStatus { - pub fn as_str(self) -> &'static str { - match self { - BankConnectionsResourceOwnershipRefreshStatus::Failed => "failed", - BankConnectionsResourceOwnershipRefreshStatus::Pending => "pending", - BankConnectionsResourceOwnershipRefreshStatus::Succeeded => "succeeded", - } - } -} - -impl AsRef for BankConnectionsResourceOwnershipRefreshStatus { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for BankConnectionsResourceOwnershipRefreshStatus { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for BankConnectionsResourceOwnershipRefreshStatus { - fn default() -> Self { - Self::Failed - } -} - -/// An enum representing the possible values of an `BankConnectionsResourceTransactionRefresh`'s `status` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum BankConnectionsResourceTransactionRefreshStatus { - Failed, - Pending, - Succeeded, -} - -impl BankConnectionsResourceTransactionRefreshStatus { - pub fn as_str(self) -> &'static str { - match self { - BankConnectionsResourceTransactionRefreshStatus::Failed => "failed", - BankConnectionsResourceTransactionRefreshStatus::Pending => "pending", - BankConnectionsResourceTransactionRefreshStatus::Succeeded => "succeeded", - } - } -} - -impl AsRef for BankConnectionsResourceTransactionRefreshStatus { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for BankConnectionsResourceTransactionRefreshStatus { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for BankConnectionsResourceTransactionRefreshStatus { - fn default() -> Self { - Self::Failed - } -} - -/// An enum representing the possible values of an `FinancialConnectionsAccount`'s `category` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum FinancialConnectionsAccountCategory { - Cash, - Credit, - Investment, - Other, -} - -impl FinancialConnectionsAccountCategory { - pub fn as_str(self) -> &'static str { - match self { - FinancialConnectionsAccountCategory::Cash => "cash", - FinancialConnectionsAccountCategory::Credit => "credit", - FinancialConnectionsAccountCategory::Investment => "investment", - FinancialConnectionsAccountCategory::Other => "other", - } - } -} - -impl AsRef for FinancialConnectionsAccountCategory { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for FinancialConnectionsAccountCategory { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for FinancialConnectionsAccountCategory { - fn default() -> Self { - Self::Cash - } -} - -/// An enum representing the possible values of an `FinancialConnectionsAccount`'s `permissions` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum FinancialConnectionsAccountPermissions { - Balances, - Ownership, - PaymentMethod, - Transactions, -} - -impl FinancialConnectionsAccountPermissions { - pub fn as_str(self) -> &'static str { - match self { - FinancialConnectionsAccountPermissions::Balances => "balances", - FinancialConnectionsAccountPermissions::Ownership => "ownership", - FinancialConnectionsAccountPermissions::PaymentMethod => "payment_method", - FinancialConnectionsAccountPermissions::Transactions => "transactions", - } - } -} - -impl AsRef for FinancialConnectionsAccountPermissions { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for FinancialConnectionsAccountPermissions { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for FinancialConnectionsAccountPermissions { - fn default() -> Self { - Self::Balances - } -} - -/// An enum representing the possible values of an `FinancialConnectionsAccount`'s `status` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum FinancialConnectionsAccountStatus { - Active, - Disconnected, - Inactive, -} - -impl FinancialConnectionsAccountStatus { - pub fn as_str(self) -> &'static str { - match self { - FinancialConnectionsAccountStatus::Active => "active", - FinancialConnectionsAccountStatus::Disconnected => "disconnected", - FinancialConnectionsAccountStatus::Inactive => "inactive", - } - } -} - -impl AsRef for FinancialConnectionsAccountStatus { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for FinancialConnectionsAccountStatus { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for FinancialConnectionsAccountStatus { - fn default() -> Self { - Self::Active - } -} - -/// An enum representing the possible values of an `FinancialConnectionsAccount`'s `subcategory` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum FinancialConnectionsAccountSubcategory { - Checking, - CreditCard, - LineOfCredit, - Mortgage, - Other, - Savings, -} - -impl FinancialConnectionsAccountSubcategory { - pub fn as_str(self) -> &'static str { - match self { - FinancialConnectionsAccountSubcategory::Checking => "checking", - FinancialConnectionsAccountSubcategory::CreditCard => "credit_card", - FinancialConnectionsAccountSubcategory::LineOfCredit => "line_of_credit", - FinancialConnectionsAccountSubcategory::Mortgage => "mortgage", - FinancialConnectionsAccountSubcategory::Other => "other", - FinancialConnectionsAccountSubcategory::Savings => "savings", - } - } -} - -impl AsRef for FinancialConnectionsAccountSubcategory { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for FinancialConnectionsAccountSubcategory { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for FinancialConnectionsAccountSubcategory { - fn default() -> Self { - Self::Checking - } -} - -/// An enum representing the possible values of an `FinancialConnectionsAccount`'s `subscriptions` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum FinancialConnectionsAccountSubscriptions { - Transactions, -} - -impl FinancialConnectionsAccountSubscriptions { - pub fn as_str(self) -> &'static str { - match self { - FinancialConnectionsAccountSubscriptions::Transactions => "transactions", - } - } -} - -impl AsRef for FinancialConnectionsAccountSubscriptions { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for FinancialConnectionsAccountSubscriptions { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for FinancialConnectionsAccountSubscriptions { - fn default() -> Self { - Self::Transactions - } -} - -/// An enum representing the possible values of an `FinancialConnectionsAccount`'s `supported_payment_method_types` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum FinancialConnectionsAccountSupportedPaymentMethodTypes { - Link, - UsBankAccount, -} - -impl FinancialConnectionsAccountSupportedPaymentMethodTypes { - pub fn as_str(self) -> &'static str { - match self { - FinancialConnectionsAccountSupportedPaymentMethodTypes::Link => "link", - FinancialConnectionsAccountSupportedPaymentMethodTypes::UsBankAccount => "us_bank_account", - } - } -} - -impl AsRef for FinancialConnectionsAccountSupportedPaymentMethodTypes { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for FinancialConnectionsAccountSupportedPaymentMethodTypes { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for FinancialConnectionsAccountSupportedPaymentMethodTypes { - fn default() -> Self { - Self::Link - } -} diff --git a/src/resources/generated/financial_connections_account_created.rs b/src/resources/generated/financial_connections_account_created.rs deleted file mode 100644 index 232baafa5..000000000 --- a/src/resources/generated/financial_connections_account_created.rs +++ /dev/null @@ -1,10 +0,0 @@ -// ====================================== -// This file was automatically generated. -// ====================================== - -use serde::{Deserialize, Serialize}; - -/// The resource representing a Stripe "financial_connections.account.created". -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct FinancialConnectionsAccountCreated { -} diff --git a/src/resources/generated/financial_connections_account_deactivated.rs b/src/resources/generated/financial_connections_account_deactivated.rs deleted file mode 100644 index 1f321d12a..000000000 --- a/src/resources/generated/financial_connections_account_deactivated.rs +++ /dev/null @@ -1,10 +0,0 @@ -// ====================================== -// This file was automatically generated. -// ====================================== - -use serde::{Deserialize, Serialize}; - -/// The resource representing a Stripe "financial_connections.account.deactivated". -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct FinancialConnectionsAccountDeactivated { -} diff --git a/src/resources/generated/financial_connections_account_disconnected.rs b/src/resources/generated/financial_connections_account_disconnected.rs deleted file mode 100644 index 3f6d2898d..000000000 --- a/src/resources/generated/financial_connections_account_disconnected.rs +++ /dev/null @@ -1,10 +0,0 @@ -// ====================================== -// This file was automatically generated. -// ====================================== - -use serde::{Deserialize, Serialize}; - -/// The resource representing a Stripe "financial_connections.account.disconnected". -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct FinancialConnectionsAccountDisconnected { -} diff --git a/src/resources/generated/financial_connections_account_owner.rs b/src/resources/generated/financial_connections_account_owner.rs deleted file mode 100644 index 657886a30..000000000 --- a/src/resources/generated/financial_connections_account_owner.rs +++ /dev/null @@ -1,42 +0,0 @@ -// ====================================== -// This file was automatically generated. -// ====================================== - -use crate::ids::{FinancialConnectionsAccountOwnerId}; -use crate::params::{Object, Timestamp}; -use serde::{Deserialize, Serialize}; - -/// The resource representing a Stripe "BankConnectionsResourceOwner". -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct FinancialConnectionsAccountOwner { - /// Unique identifier for the object. - pub id: FinancialConnectionsAccountOwnerId, - - /// The email address of the owner. - pub email: Option, - - /// The full name of the owner. - pub name: String, - - /// The ownership object that this owner belongs to. - pub ownership: String, - - /// The raw phone number of the owner. - pub phone: Option, - - /// The raw physical address of the owner. - pub raw_address: Option, - - /// The timestamp of the refresh that updated this owner. - pub refreshed_at: Option, -} - -impl Object for FinancialConnectionsAccountOwner { - type Id = FinancialConnectionsAccountOwnerId; - fn id(&self) -> Self::Id { - self.id.clone() - } - fn object(&self) -> &'static str { - "financial_connections.account_owner" - } -} diff --git a/src/resources/generated/financial_connections_account_ownership.rs b/src/resources/generated/financial_connections_account_ownership.rs deleted file mode 100644 index 1ff6c9aa9..000000000 --- a/src/resources/generated/financial_connections_account_ownership.rs +++ /dev/null @@ -1,33 +0,0 @@ -// ====================================== -// This file was automatically generated. -// ====================================== - -use crate::ids::{FinancialConnectionsAccountOwnershipId}; -use crate::params::{List, Object, Timestamp}; -use crate::resources::{FinancialConnectionsAccountOwner}; -use serde::{Deserialize, Serialize}; - -/// The resource representing a Stripe "BankConnectionsResourceOwnership". -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct FinancialConnectionsAccountOwnership { - /// Unique identifier for the object. - pub id: FinancialConnectionsAccountOwnershipId, - - /// Time at which the object was created. - /// - /// Measured in seconds since the Unix epoch. - pub created: Timestamp, - - /// A paginated list of owners for this account. - pub owners: List, -} - -impl Object for FinancialConnectionsAccountOwnership { - type Id = FinancialConnectionsAccountOwnershipId; - fn id(&self) -> Self::Id { - self.id.clone() - } - fn object(&self) -> &'static str { - "financial_connections.account_ownership" - } -} diff --git a/src/resources/generated/financial_connections_account_reactivated.rs b/src/resources/generated/financial_connections_account_reactivated.rs deleted file mode 100644 index c8e075893..000000000 --- a/src/resources/generated/financial_connections_account_reactivated.rs +++ /dev/null @@ -1,10 +0,0 @@ -// ====================================== -// This file was automatically generated. -// ====================================== - -use serde::{Deserialize, Serialize}; - -/// The resource representing a Stripe "financial_connections.account.reactivated". -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct FinancialConnectionsAccountReactivated { -} diff --git a/src/resources/generated/financial_connections_account_refreshed_balance.rs b/src/resources/generated/financial_connections_account_refreshed_balance.rs deleted file mode 100644 index e011531d8..000000000 --- a/src/resources/generated/financial_connections_account_refreshed_balance.rs +++ /dev/null @@ -1,10 +0,0 @@ -// ====================================== -// This file was automatically generated. -// ====================================== - -use serde::{Deserialize, Serialize}; - -/// The resource representing a Stripe "financial_connections.account.refreshed_balance". -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct FinancialConnectionsAccountRefreshedBalance { -} diff --git a/src/resources/generated/financial_connections_account_refreshed_transactions.rs b/src/resources/generated/financial_connections_account_refreshed_transactions.rs deleted file mode 100644 index be6efbe2a..000000000 --- a/src/resources/generated/financial_connections_account_refreshed_transactions.rs +++ /dev/null @@ -1,10 +0,0 @@ -// ====================================== -// This file was automatically generated. -// ====================================== - -use serde::{Deserialize, Serialize}; - -/// The resource representing a Stripe "financial_connections.account.refreshed_transactions". -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct FinancialConnectionsAccountRefreshedTransactions { -} diff --git a/src/resources/generated/financial_connections_session.rs b/src/resources/generated/financial_connections_session.rs deleted file mode 100644 index 85036b049..000000000 --- a/src/resources/generated/financial_connections_session.rs +++ /dev/null @@ -1,325 +0,0 @@ -// ====================================== -// This file was automatically generated. -// ====================================== - -use crate::client::{Client, Response}; -use crate::ids::{FinancialConnectionsSessionId}; -use crate::params::{Expand, List, Object}; -use crate::resources::{BankConnectionsResourceAccountholder, FinancialConnectionsAccount}; -use serde::{Deserialize, Serialize}; - -/// The resource representing a Stripe "BankConnectionsResourceLinkAccountSession". -/// -/// For more details see -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct FinancialConnectionsSession { - /// Unique identifier for the object. - pub id: FinancialConnectionsSessionId, - - /// The account holder for whom accounts are collected in this session. - pub account_holder: Option, - - /// The accounts that were collected as part of this Session. - pub accounts: List, - - /// A value that will be passed to the client to launch the authentication flow. - pub client_secret: String, - - #[serde(skip_serializing_if = "Option::is_none")] - pub filters: Option, - - /// Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. - pub livemode: bool, - - /// Permissions requested for accounts collected during this session. - pub permissions: Vec, - - /// Data features requested to be retrieved upon account creation. - pub prefetch: Option>, - - /// For webview integrations only. - /// - /// Upon completing OAuth login in the native browser, the user will be redirected to this URL to return to your app. - #[serde(skip_serializing_if = "Option::is_none")] - pub return_url: Option, -} - -impl FinancialConnectionsSession { - - /// To launch the Financial Connections authorization flow, create a `Session`. - /// - /// The session’s `client_secret` can be used to launch the flow using Stripe.js. - pub fn create(client: &Client, params: CreateFinancialConnectionsSession<'_>) -> Response { - client.post_form("/financial_connections/sessions", ¶ms) - } -} - -impl Object for FinancialConnectionsSession { - type Id = FinancialConnectionsSessionId; - fn id(&self) -> Self::Id { - self.id.clone() - } - fn object(&self) -> &'static str { - "financial_connections.session" - } -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct BankConnectionsResourceLinkAccountSessionFilters { - - /// List of countries from which to filter accounts. - pub countries: Option>, -} - -/// The parameters for `FinancialConnectionsSession::create`. -#[derive(Clone, Debug, Serialize)] -pub struct CreateFinancialConnectionsSession<'a> { - - /// The account holder to link accounts for. - pub account_holder: CreateFinancialConnectionsSessionAccountHolder, - - /// Specifies which fields in the response should be expanded. - #[serde(skip_serializing_if = "Expand::is_empty")] - pub expand: &'a [&'a str], - - /// Filters to restrict the kinds of accounts to collect. - #[serde(skip_serializing_if = "Option::is_none")] - pub filters: Option, - - /// List of data features that you would like to request access to. - /// - /// Possible values are `balances`, `transactions`, `ownership`, and `payment_method`. - pub permissions: Vec, - - /// List of data features that you would like to retrieve upon account creation. - #[serde(skip_serializing_if = "Option::is_none")] - pub prefetch: Option>, - - /// For webview integrations only. - /// - /// Upon completing OAuth login in the native browser, the user will be redirected to this URL to return to your app. - #[serde(skip_serializing_if = "Option::is_none")] - pub return_url: Option<&'a str>, -} - -impl<'a> CreateFinancialConnectionsSession<'a> { - pub fn new(account_holder: CreateFinancialConnectionsSessionAccountHolder, permissions: Vec) -> Self { - CreateFinancialConnectionsSession { - account_holder, - expand: Default::default(), - filters: Default::default(), - permissions, - prefetch: Default::default(), - return_url: Default::default(), - } - } -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreateFinancialConnectionsSessionAccountHolder { - - /// The ID of the Stripe account whose accounts will be retrieved. - /// - /// Should only be present if `type` is `account`. - #[serde(skip_serializing_if = "Option::is_none")] - pub account: Option, - - /// The ID of the Stripe customer whose accounts will be retrieved. - /// - /// Should only be present if `type` is `customer`. - #[serde(skip_serializing_if = "Option::is_none")] - pub customer: Option, - - /// Type of account holder to collect accounts for. - #[serde(rename = "type")] - pub type_: CreateFinancialConnectionsSessionAccountHolderType, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreateFinancialConnectionsSessionFilters { - - /// List of countries from which to collect accounts. - pub countries: Vec, -} - -/// An enum representing the possible values of an `CreateFinancialConnectionsSessionAccountHolder`'s `type` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CreateFinancialConnectionsSessionAccountHolderType { - Account, - Customer, -} - -impl CreateFinancialConnectionsSessionAccountHolderType { - pub fn as_str(self) -> &'static str { - match self { - CreateFinancialConnectionsSessionAccountHolderType::Account => "account", - CreateFinancialConnectionsSessionAccountHolderType::Customer => "customer", - } - } -} - -impl AsRef for CreateFinancialConnectionsSessionAccountHolderType { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for CreateFinancialConnectionsSessionAccountHolderType { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for CreateFinancialConnectionsSessionAccountHolderType { - fn default() -> Self { - Self::Account - } -} - -/// An enum representing the possible values of an `CreateFinancialConnectionsSession`'s `permissions` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CreateFinancialConnectionsSessionPermissions { - Balances, - Ownership, - PaymentMethod, - Transactions, -} - -impl CreateFinancialConnectionsSessionPermissions { - pub fn as_str(self) -> &'static str { - match self { - CreateFinancialConnectionsSessionPermissions::Balances => "balances", - CreateFinancialConnectionsSessionPermissions::Ownership => "ownership", - CreateFinancialConnectionsSessionPermissions::PaymentMethod => "payment_method", - CreateFinancialConnectionsSessionPermissions::Transactions => "transactions", - } - } -} - -impl AsRef for CreateFinancialConnectionsSessionPermissions { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for CreateFinancialConnectionsSessionPermissions { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for CreateFinancialConnectionsSessionPermissions { - fn default() -> Self { - Self::Balances - } -} - -/// An enum representing the possible values of an `CreateFinancialConnectionsSession`'s `prefetch` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CreateFinancialConnectionsSessionPrefetch { - Balances, - Ownership, - Transactions, -} - -impl CreateFinancialConnectionsSessionPrefetch { - pub fn as_str(self) -> &'static str { - match self { - CreateFinancialConnectionsSessionPrefetch::Balances => "balances", - CreateFinancialConnectionsSessionPrefetch::Ownership => "ownership", - CreateFinancialConnectionsSessionPrefetch::Transactions => "transactions", - } - } -} - -impl AsRef for CreateFinancialConnectionsSessionPrefetch { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for CreateFinancialConnectionsSessionPrefetch { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for CreateFinancialConnectionsSessionPrefetch { - fn default() -> Self { - Self::Balances - } -} - -/// An enum representing the possible values of an `FinancialConnectionsSession`'s `permissions` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum FinancialConnectionsSessionPermissions { - Balances, - Ownership, - PaymentMethod, - Transactions, -} - -impl FinancialConnectionsSessionPermissions { - pub fn as_str(self) -> &'static str { - match self { - FinancialConnectionsSessionPermissions::Balances => "balances", - FinancialConnectionsSessionPermissions::Ownership => "ownership", - FinancialConnectionsSessionPermissions::PaymentMethod => "payment_method", - FinancialConnectionsSessionPermissions::Transactions => "transactions", - } - } -} - -impl AsRef for FinancialConnectionsSessionPermissions { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for FinancialConnectionsSessionPermissions { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for FinancialConnectionsSessionPermissions { - fn default() -> Self { - Self::Balances - } -} - -/// An enum representing the possible values of an `FinancialConnectionsSession`'s `prefetch` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum FinancialConnectionsSessionPrefetch { - Balances, - Ownership, - Transactions, -} - -impl FinancialConnectionsSessionPrefetch { - pub fn as_str(self) -> &'static str { - match self { - FinancialConnectionsSessionPrefetch::Balances => "balances", - FinancialConnectionsSessionPrefetch::Ownership => "ownership", - FinancialConnectionsSessionPrefetch::Transactions => "transactions", - } - } -} - -impl AsRef for FinancialConnectionsSessionPrefetch { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for FinancialConnectionsSessionPrefetch { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for FinancialConnectionsSessionPrefetch { - fn default() -> Self { - Self::Balances - } -} diff --git a/src/resources/generated/financial_connections_transaction.rs b/src/resources/generated/financial_connections_transaction.rs deleted file mode 100644 index ec33ab2e0..000000000 --- a/src/resources/generated/financial_connections_transaction.rs +++ /dev/null @@ -1,112 +0,0 @@ -// ====================================== -// This file was automatically generated. -// ====================================== - -use crate::ids::{FinancialConnectionsTransactionId}; -use crate::params::{Object, Timestamp}; -use crate::resources::{Currency}; -use serde::{Deserialize, Serialize}; - -/// The resource representing a Stripe "BankConnectionsResourceTransaction". -/// -/// For more details see -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct FinancialConnectionsTransaction { - /// Unique identifier for the object. - pub id: FinancialConnectionsTransactionId, - - /// The ID of the Financial Connections Account this transaction belongs to. - pub account: String, - - /// The amount of this transaction, in cents (or local equivalent). - pub amount: i64, - - /// Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. - /// - /// Must be a [supported currency](https://stripe.com/docs/currencies). - pub currency: Currency, - - /// The description of this transaction. - pub description: String, - - /// Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. - pub livemode: bool, - - /// The status of the transaction. - pub status: FinancialConnectionsTransactionStatus, - - pub status_transitions: BankConnectionsResourceTransactionResourceStatusTransitions, - - /// Time at which the transaction was transacted. - /// - /// Measured in seconds since the Unix epoch. - pub transacted_at: Timestamp, - - /// The token of the transaction refresh that last updated or created this transaction. - pub transaction_refresh: String, - - /// Time at which the object was last updated. - /// - /// Measured in seconds since the Unix epoch. - pub updated: Timestamp, -} - -impl Object for FinancialConnectionsTransaction { - type Id = FinancialConnectionsTransactionId; - fn id(&self) -> Self::Id { - self.id.clone() - } - fn object(&self) -> &'static str { - "financial_connections.transaction" - } -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct BankConnectionsResourceTransactionResourceStatusTransitions { - - /// Time at which this transaction posted. - /// - /// Measured in seconds since the Unix epoch. - pub posted_at: Option, - - /// Time at which this transaction was voided. - /// - /// Measured in seconds since the Unix epoch. - pub void_at: Option, -} - -/// An enum representing the possible values of an `FinancialConnectionsTransaction`'s `status` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum FinancialConnectionsTransactionStatus { - Pending, - Posted, - Void, -} - -impl FinancialConnectionsTransactionStatus { - pub fn as_str(self) -> &'static str { - match self { - FinancialConnectionsTransactionStatus::Pending => "pending", - FinancialConnectionsTransactionStatus::Posted => "posted", - FinancialConnectionsTransactionStatus::Void => "void", - } - } -} - -impl AsRef for FinancialConnectionsTransactionStatus { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for FinancialConnectionsTransactionStatus { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for FinancialConnectionsTransactionStatus { - fn default() -> Self { - Self::Pending - } -} diff --git a/src/resources/generated/funding_instructions.rs b/src/resources/generated/funding_instructions.rs deleted file mode 100644 index 272fc84f8..000000000 --- a/src/resources/generated/funding_instructions.rs +++ /dev/null @@ -1,326 +0,0 @@ -// ====================================== -// This file was automatically generated. -// ====================================== - -use crate::params::{Object}; -use crate::resources::{Currency}; -use serde::{Deserialize, Serialize}; - -/// The resource representing a Stripe "CustomerBalanceFundingInstructionsCustomerBalanceFundingInstructions". -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct FundingInstructions { - - pub bank_transfer: FundingInstructionsBankTransfer, - - /// Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. - /// - /// Must be a [supported currency](https://stripe.com/docs/currencies). - pub currency: Currency, - - /// The `funding_type` of the returned instructions. - pub funding_type: FundingInstructionsFundingType, - - /// Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. - pub livemode: bool, -} - -impl Object for FundingInstructions { - type Id = (); - fn id(&self) -> Self::Id {} - fn object(&self) -> &'static str { - "funding_instructions" - } -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct FundingInstructionsBankTransfer { - - /// The country of the bank account to fund. - pub country: String, - - /// A list of financial addresses that can be used to fund a particular balance. - pub financial_addresses: Vec, - - /// The bank_transfer type. - #[serde(rename = "type")] - pub type_: FundingInstructionsBankTransferType, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct FundingInstructionsBankTransferFinancialAddress { - - #[serde(skip_serializing_if = "Option::is_none")] - pub aba: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub iban: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub sort_code: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub spei: Option, - - /// The payment networks supported by this FinancialAddress. - #[serde(skip_serializing_if = "Option::is_none")] - pub supported_networks: Option>, - - #[serde(skip_serializing_if = "Option::is_none")] - pub swift: Option, - - /// The type of financial address. - #[serde(rename = "type")] - pub type_: FundingInstructionsBankTransferFinancialAddressType, - - #[serde(skip_serializing_if = "Option::is_none")] - pub zengin: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct FundingInstructionsBankTransferAbaRecord { - - /// The ABA account number. - pub account_number: String, - - /// The bank name. - pub bank_name: String, - - /// The ABA routing number. - pub routing_number: String, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct FundingInstructionsBankTransferIbanRecord { - - /// The name of the person or business that owns the bank account. - pub account_holder_name: String, - - /// The BIC/SWIFT code of the account. - pub bic: String, - - /// Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). - pub country: String, - - /// The IBAN of the account. - pub iban: String, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct FundingInstructionsBankTransferSortCodeRecord { - - /// The name of the person or business that owns the bank account. - pub account_holder_name: String, - - /// The account number. - pub account_number: String, - - /// The six-digit sort code. - pub sort_code: String, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct FundingInstructionsBankTransferSpeiRecord { - - /// The three-digit bank code. - pub bank_code: String, - - /// The short banking institution name. - pub bank_name: String, - - /// The CLABE number. - pub clabe: String, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct FundingInstructionsBankTransferSwiftRecord { - - /// The account number. - pub account_number: String, - - /// The bank name. - pub bank_name: String, - - /// The SWIFT code. - pub swift_code: String, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct FundingInstructionsBankTransferZenginRecord { - - /// The account holder name. - pub account_holder_name: Option, - - /// The account number. - pub account_number: Option, - - /// The bank account type. - /// - /// In Japan, this can only be `futsu` or `toza`. - pub account_type: Option, - - /// The bank code of the account. - pub bank_code: Option, - - /// The bank name of the account. - pub bank_name: Option, - - /// The branch code of the account. - pub branch_code: Option, - - /// The branch name of the account. - pub branch_name: Option, -} - -/// An enum representing the possible values of an `FundingInstructionsBankTransferFinancialAddress`'s `supported_networks` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum FundingInstructionsBankTransferFinancialAddressSupportedNetworks { - Ach, - Bacs, - DomesticWireUs, - Fps, - Sepa, - Spei, - Swift, - Zengin, -} - -impl FundingInstructionsBankTransferFinancialAddressSupportedNetworks { - pub fn as_str(self) -> &'static str { - match self { - FundingInstructionsBankTransferFinancialAddressSupportedNetworks::Ach => "ach", - FundingInstructionsBankTransferFinancialAddressSupportedNetworks::Bacs => "bacs", - FundingInstructionsBankTransferFinancialAddressSupportedNetworks::DomesticWireUs => "domestic_wire_us", - FundingInstructionsBankTransferFinancialAddressSupportedNetworks::Fps => "fps", - FundingInstructionsBankTransferFinancialAddressSupportedNetworks::Sepa => "sepa", - FundingInstructionsBankTransferFinancialAddressSupportedNetworks::Spei => "spei", - FundingInstructionsBankTransferFinancialAddressSupportedNetworks::Swift => "swift", - FundingInstructionsBankTransferFinancialAddressSupportedNetworks::Zengin => "zengin", - } - } -} - -impl AsRef for FundingInstructionsBankTransferFinancialAddressSupportedNetworks { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for FundingInstructionsBankTransferFinancialAddressSupportedNetworks { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for FundingInstructionsBankTransferFinancialAddressSupportedNetworks { - fn default() -> Self { - Self::Ach - } -} - -/// An enum representing the possible values of an `FundingInstructionsBankTransferFinancialAddress`'s `type` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum FundingInstructionsBankTransferFinancialAddressType { - Aba, - Iban, - SortCode, - Spei, - Swift, - Zengin, -} - -impl FundingInstructionsBankTransferFinancialAddressType { - pub fn as_str(self) -> &'static str { - match self { - FundingInstructionsBankTransferFinancialAddressType::Aba => "aba", - FundingInstructionsBankTransferFinancialAddressType::Iban => "iban", - FundingInstructionsBankTransferFinancialAddressType::SortCode => "sort_code", - FundingInstructionsBankTransferFinancialAddressType::Spei => "spei", - FundingInstructionsBankTransferFinancialAddressType::Swift => "swift", - FundingInstructionsBankTransferFinancialAddressType::Zengin => "zengin", - } - } -} - -impl AsRef for FundingInstructionsBankTransferFinancialAddressType { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for FundingInstructionsBankTransferFinancialAddressType { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for FundingInstructionsBankTransferFinancialAddressType { - fn default() -> Self { - Self::Aba - } -} - -/// An enum representing the possible values of an `FundingInstructionsBankTransfer`'s `type` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum FundingInstructionsBankTransferType { - EuBankTransfer, - JpBankTransfer, -} - -impl FundingInstructionsBankTransferType { - pub fn as_str(self) -> &'static str { - match self { - FundingInstructionsBankTransferType::EuBankTransfer => "eu_bank_transfer", - FundingInstructionsBankTransferType::JpBankTransfer => "jp_bank_transfer", - } - } -} - -impl AsRef for FundingInstructionsBankTransferType { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for FundingInstructionsBankTransferType { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for FundingInstructionsBankTransferType { - fn default() -> Self { - Self::EuBankTransfer - } -} - -/// An enum representing the possible values of an `FundingInstructions`'s `funding_type` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum FundingInstructionsFundingType { - BankTransfer, -} - -impl FundingInstructionsFundingType { - pub fn as_str(self) -> &'static str { - match self { - FundingInstructionsFundingType::BankTransfer => "bank_transfer", - } - } -} - -impl AsRef for FundingInstructionsFundingType { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for FundingInstructionsFundingType { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for FundingInstructionsFundingType { - fn default() -> Self { - Self::BankTransfer - } -} diff --git a/src/resources/generated/identity_verification_report.rs b/src/resources/generated/identity_verification_report.rs deleted file mode 100644 index d5c99bf97..000000000 --- a/src/resources/generated/identity_verification_report.rs +++ /dev/null @@ -1,625 +0,0 @@ -// ====================================== -// This file was automatically generated. -// ====================================== - -use crate::ids::{IdentityVerificationReportId}; -use crate::params::{Object, Timestamp}; -use crate::resources::{Address}; -use serde::{Deserialize, Serialize}; - -/// The resource representing a Stripe "GelatoVerificationReport". -/// -/// For more details see -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct IdentityVerificationReport { - /// Unique identifier for the object. - pub id: IdentityVerificationReportId, - - /// Time at which the object was created. - /// - /// Measured in seconds since the Unix epoch. - pub created: Timestamp, - - #[serde(skip_serializing_if = "Option::is_none")] - pub document: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub id_number: Option, - - /// Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. - pub livemode: bool, - - #[serde(skip_serializing_if = "Option::is_none")] - pub options: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub selfie: Option, - - /// Type of report. - #[serde(rename = "type")] - #[serde(skip_serializing_if = "Option::is_none")] - pub type_: Option, - - /// ID of the VerificationSession that created this report. - pub verification_session: Option, -} - -impl Object for IdentityVerificationReport { - type Id = IdentityVerificationReportId; - fn id(&self) -> Self::Id { - self.id.clone() - } - fn object(&self) -> &'static str { - "identity.verification_report" - } -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct GelatoDocumentReport { - - /// Address as it appears in the document. - pub address: Option
, - - /// Date of birth as it appears in the document. - pub dob: Option, - - /// Details on the verification error. - /// - /// Present when status is `unverified`. - pub error: Option, - - /// Expiration date of the document. - pub expiration_date: Option, - - /// Array of [File](https://stripe.com/docs/api/files) ids containing images for this document. - pub files: Option>, - - /// First name as it appears in the document. - pub first_name: Option, - - /// Issued date of the document. - pub issued_date: Option, - - /// Issuing country of the document. - pub issuing_country: Option, - - /// Last name as it appears in the document. - pub last_name: Option, - - /// Document ID number. - pub number: Option, - - /// Status of this `document` check. - pub status: GelatoDocumentReportStatus, - - /// Type of the document. - #[serde(rename = "type")] - pub type_: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct GelatoDataDocumentReportDateOfBirth { - - /// Numerical day between 1 and 31. - pub day: Option, - - /// Numerical month between 1 and 12. - pub month: Option, - - /// The four-digit year. - pub year: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct GelatoDataDocumentReportExpirationDate { - - /// Numerical day between 1 and 31. - pub day: Option, - - /// Numerical month between 1 and 12. - pub month: Option, - - /// The four-digit year. - pub year: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct GelatoDataDocumentReportIssuedDate { - - /// Numerical day between 1 and 31. - pub day: Option, - - /// Numerical month between 1 and 12. - pub month: Option, - - /// The four-digit year. - pub year: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct GelatoDocumentReportError { - - /// A short machine-readable string giving the reason for the verification failure. - pub code: Option, - - /// A human-readable message giving the reason for the failure. - /// - /// These messages can be shown to your users. - pub reason: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct GelatoIdNumberReport { - - /// Date of birth. - pub dob: Option, - - /// Details on the verification error. - /// - /// Present when status is `unverified`. - pub error: Option, - - /// First name. - pub first_name: Option, - - /// ID number. - /// - /// When `id_number_type` is `us_ssn`, only the last 4 digits are present. - pub id_number: Option, - - /// Type of ID number. - pub id_number_type: Option, - - /// Last name. - pub last_name: Option, - - /// Status of this `id_number` check. - pub status: GelatoIdNumberReportStatus, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct GelatoDataIdNumberReportDate { - - /// Numerical day between 1 and 31. - pub day: Option, - - /// Numerical month between 1 and 12. - pub month: Option, - - /// The four-digit year. - pub year: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct GelatoIdNumberReportError { - - /// A short machine-readable string giving the reason for the verification failure. - pub code: Option, - - /// A human-readable message giving the reason for the failure. - /// - /// These messages can be shown to your users. - pub reason: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct GelatoSelfieReport { - - /// ID of the [File](https://stripe.com/docs/api/files) holding the image of the identity document used in this check. - pub document: Option, - - /// Details on the verification error. - /// - /// Present when status is `unverified`. - pub error: Option, - - /// ID of the [File](https://stripe.com/docs/api/files) holding the image of the selfie used in this check. - pub selfie: Option, - - /// Status of this `selfie` check. - pub status: GelatoSelfieReportStatus, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct GelatoSelfieReportError { - - /// A short machine-readable string giving the reason for the verification failure. - pub code: Option, - - /// A human-readable message giving the reason for the failure. - /// - /// These messages can be shown to your users. - pub reason: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct GelatoVerificationReportOptions { - - #[serde(skip_serializing_if = "Option::is_none")] - pub document: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub id_number: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct GelatoReportDocumentOptions { - - /// Array of strings of allowed identity document types. - /// - /// If the provided identity document isn’t one of the allowed types, the verification check will fail with a document_type_not_allowed error code. - #[serde(skip_serializing_if = "Option::is_none")] - pub allowed_types: Option>, - - /// Collect an ID number and perform an [ID number check](https://stripe.com/docs/identity/verification-checks?type=id-number) with the document’s extracted name and date of birth. - #[serde(skip_serializing_if = "Option::is_none")] - pub require_id_number: Option, - - /// Disable image uploads, identity document images have to be captured using the device’s camera. - #[serde(skip_serializing_if = "Option::is_none")] - pub require_live_capture: Option, - - /// Capture a face image and perform a [selfie check](https://stripe.com/docs/identity/verification-checks?type=selfie) comparing a photo ID and a picture of your user’s face. - /// - /// [Learn more](https://stripe.com/docs/identity/selfie). - #[serde(skip_serializing_if = "Option::is_none")] - pub require_matching_selfie: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct GelatoReportIdNumberOptions { -} - -/// An enum representing the possible values of an `GelatoDocumentReportError`'s `code` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum GelatoDocumentReportErrorCode { - DocumentExpired, - DocumentTypeNotSupported, - DocumentUnverifiedOther, -} - -impl GelatoDocumentReportErrorCode { - pub fn as_str(self) -> &'static str { - match self { - GelatoDocumentReportErrorCode::DocumentExpired => "document_expired", - GelatoDocumentReportErrorCode::DocumentTypeNotSupported => "document_type_not_supported", - GelatoDocumentReportErrorCode::DocumentUnverifiedOther => "document_unverified_other", - } - } -} - -impl AsRef for GelatoDocumentReportErrorCode { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for GelatoDocumentReportErrorCode { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for GelatoDocumentReportErrorCode { - fn default() -> Self { - Self::DocumentExpired - } -} - -/// An enum representing the possible values of an `GelatoDocumentReport`'s `status` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum GelatoDocumentReportStatus { - Unverified, - Verified, -} - -impl GelatoDocumentReportStatus { - pub fn as_str(self) -> &'static str { - match self { - GelatoDocumentReportStatus::Unverified => "unverified", - GelatoDocumentReportStatus::Verified => "verified", - } - } -} - -impl AsRef for GelatoDocumentReportStatus { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for GelatoDocumentReportStatus { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for GelatoDocumentReportStatus { - fn default() -> Self { - Self::Unverified - } -} - -/// An enum representing the possible values of an `GelatoDocumentReport`'s `type` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum GelatoDocumentReportType { - DrivingLicense, - IdCard, - Passport, -} - -impl GelatoDocumentReportType { - pub fn as_str(self) -> &'static str { - match self { - GelatoDocumentReportType::DrivingLicense => "driving_license", - GelatoDocumentReportType::IdCard => "id_card", - GelatoDocumentReportType::Passport => "passport", - } - } -} - -impl AsRef for GelatoDocumentReportType { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for GelatoDocumentReportType { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for GelatoDocumentReportType { - fn default() -> Self { - Self::DrivingLicense - } -} - -/// An enum representing the possible values of an `GelatoIdNumberReportError`'s `code` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum GelatoIdNumberReportErrorCode { - IdNumberInsufficientDocumentData, - IdNumberMismatch, - IdNumberUnverifiedOther, -} - -impl GelatoIdNumberReportErrorCode { - pub fn as_str(self) -> &'static str { - match self { - GelatoIdNumberReportErrorCode::IdNumberInsufficientDocumentData => "id_number_insufficient_document_data", - GelatoIdNumberReportErrorCode::IdNumberMismatch => "id_number_mismatch", - GelatoIdNumberReportErrorCode::IdNumberUnverifiedOther => "id_number_unverified_other", - } - } -} - -impl AsRef for GelatoIdNumberReportErrorCode { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for GelatoIdNumberReportErrorCode { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for GelatoIdNumberReportErrorCode { - fn default() -> Self { - Self::IdNumberInsufficientDocumentData - } -} - -/// An enum representing the possible values of an `GelatoIdNumberReport`'s `id_number_type` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum GelatoIdNumberReportIdNumberType { - BrCpf, - SgNric, - UsSsn, -} - -impl GelatoIdNumberReportIdNumberType { - pub fn as_str(self) -> &'static str { - match self { - GelatoIdNumberReportIdNumberType::BrCpf => "br_cpf", - GelatoIdNumberReportIdNumberType::SgNric => "sg_nric", - GelatoIdNumberReportIdNumberType::UsSsn => "us_ssn", - } - } -} - -impl AsRef for GelatoIdNumberReportIdNumberType { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for GelatoIdNumberReportIdNumberType { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for GelatoIdNumberReportIdNumberType { - fn default() -> Self { - Self::BrCpf - } -} - -/// An enum representing the possible values of an `GelatoIdNumberReport`'s `status` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum GelatoIdNumberReportStatus { - Unverified, - Verified, -} - -impl GelatoIdNumberReportStatus { - pub fn as_str(self) -> &'static str { - match self { - GelatoIdNumberReportStatus::Unverified => "unverified", - GelatoIdNumberReportStatus::Verified => "verified", - } - } -} - -impl AsRef for GelatoIdNumberReportStatus { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for GelatoIdNumberReportStatus { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for GelatoIdNumberReportStatus { - fn default() -> Self { - Self::Unverified - } -} - -/// An enum representing the possible values of an `GelatoReportDocumentOptions`'s `allowed_types` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum GelatoReportDocumentOptionsAllowedTypes { - DrivingLicense, - IdCard, - Passport, -} - -impl GelatoReportDocumentOptionsAllowedTypes { - pub fn as_str(self) -> &'static str { - match self { - GelatoReportDocumentOptionsAllowedTypes::DrivingLicense => "driving_license", - GelatoReportDocumentOptionsAllowedTypes::IdCard => "id_card", - GelatoReportDocumentOptionsAllowedTypes::Passport => "passport", - } - } -} - -impl AsRef for GelatoReportDocumentOptionsAllowedTypes { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for GelatoReportDocumentOptionsAllowedTypes { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for GelatoReportDocumentOptionsAllowedTypes { - fn default() -> Self { - Self::DrivingLicense - } -} - -/// An enum representing the possible values of an `GelatoSelfieReportError`'s `code` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum GelatoSelfieReportErrorCode { - SelfieDocumentMissingPhoto, - SelfieFaceMismatch, - SelfieManipulated, - SelfieUnverifiedOther, -} - -impl GelatoSelfieReportErrorCode { - pub fn as_str(self) -> &'static str { - match self { - GelatoSelfieReportErrorCode::SelfieDocumentMissingPhoto => "selfie_document_missing_photo", - GelatoSelfieReportErrorCode::SelfieFaceMismatch => "selfie_face_mismatch", - GelatoSelfieReportErrorCode::SelfieManipulated => "selfie_manipulated", - GelatoSelfieReportErrorCode::SelfieUnverifiedOther => "selfie_unverified_other", - } - } -} - -impl AsRef for GelatoSelfieReportErrorCode { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for GelatoSelfieReportErrorCode { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for GelatoSelfieReportErrorCode { - fn default() -> Self { - Self::SelfieDocumentMissingPhoto - } -} - -/// An enum representing the possible values of an `GelatoSelfieReport`'s `status` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum GelatoSelfieReportStatus { - Unverified, - Verified, -} - -impl GelatoSelfieReportStatus { - pub fn as_str(self) -> &'static str { - match self { - GelatoSelfieReportStatus::Unverified => "unverified", - GelatoSelfieReportStatus::Verified => "verified", - } - } -} - -impl AsRef for GelatoSelfieReportStatus { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for GelatoSelfieReportStatus { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for GelatoSelfieReportStatus { - fn default() -> Self { - Self::Unverified - } -} - -/// An enum representing the possible values of an `IdentityVerificationReport`'s `type` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum IdentityVerificationReportType { - Document, - IdNumber, -} - -impl IdentityVerificationReportType { - pub fn as_str(self) -> &'static str { - match self { - IdentityVerificationReportType::Document => "document", - IdentityVerificationReportType::IdNumber => "id_number", - } - } -} - -impl AsRef for IdentityVerificationReportType { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for IdentityVerificationReportType { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for IdentityVerificationReportType { - fn default() -> Self { - Self::Document - } -} diff --git a/src/resources/generated/identity_verification_session.rs b/src/resources/generated/identity_verification_session.rs deleted file mode 100644 index 187d047c2..000000000 --- a/src/resources/generated/identity_verification_session.rs +++ /dev/null @@ -1,411 +0,0 @@ -// ====================================== -// This file was automatically generated. -// ====================================== - -use crate::ids::{IdentityVerificationSessionId}; -use crate::params::{Expandable, Metadata, Object, Timestamp}; -use crate::resources::{Address, IdentityVerificationReport}; -use serde::{Deserialize, Serialize}; - -/// The resource representing a Stripe "GelatoVerificationSession". -/// -/// For more details see -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct IdentityVerificationSession { - /// Unique identifier for the object. - pub id: IdentityVerificationSessionId, - - /// The short-lived client secret used by Stripe.js to [show a verification modal](https://stripe.com/docs/js/identity/modal) inside your app. - /// - /// This client secret expires after 24 hours and can only be used once. - /// Don’t store it, log it, embed it in a URL, or expose it to anyone other than the user. - /// Make sure that you have TLS enabled on any page that includes the client secret. - /// Refer to our docs on [passing the client secret to the frontend](https://stripe.com/docs/identity/verification-sessions#client-secret) to learn more. - pub client_secret: Option, - - /// Time at which the object was created. - /// - /// Measured in seconds since the Unix epoch. - pub created: Timestamp, - - /// If present, this property tells you the last error encountered when processing the verification. - pub last_error: Option, - - /// ID of the most recent VerificationReport. - /// - /// [Learn more about accessing detailed verification results.](https://stripe.com/docs/identity/verification-sessions#results). - pub last_verification_report: Option>, - - /// Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. - pub livemode: bool, - - /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. - /// - /// This can be useful for storing additional information about the object in a structured format. - pub metadata: Metadata, - - /// A set of options for the session’s verification checks. - pub options: Option, - - /// Redaction status of this VerificationSession. - /// - /// If the VerificationSession is not redacted, this field will be null. - pub redaction: Option, - - /// Status of this VerificationSession. - /// - /// [Learn more about the lifecycle of sessions](https://stripe.com/docs/identity/how-sessions-work). - pub status: IdentityVerificationSessionStatus, - - /// The type of [verification check](https://stripe.com/docs/identity/verification-checks) to be performed. - #[serde(rename = "type")] - pub type_: Option, - - /// The short-lived URL that you use to redirect a user to Stripe to submit their identity information. - /// - /// This URL expires after 48 hours and can only be used once. - /// Don’t store it, log it, send it in emails or expose it to anyone other than the user. - /// Refer to our docs on [verifying identity documents](https://stripe.com/docs/identity/verify-identity-documents?platform=web&type=redirect) to learn how to redirect users to Stripe. - pub url: Option, - - /// The user’s verified data. - pub verified_outputs: Option, -} - -impl Object for IdentityVerificationSession { - type Id = IdentityVerificationSessionId; - fn id(&self) -> Self::Id { - self.id.clone() - } - fn object(&self) -> &'static str { - "identity.verification_session" - } -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct GelatoSessionLastError { - - /// A short machine-readable string giving the reason for the verification or user-session failure. - pub code: Option, - - /// A message that explains the reason for verification or user-session failure. - pub reason: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct GelatoVerificationSessionOptions { - - #[serde(skip_serializing_if = "Option::is_none")] - pub document: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub id_number: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct GelatoSessionDocumentOptions { - - /// Array of strings of allowed identity document types. - /// - /// If the provided identity document isn’t one of the allowed types, the verification check will fail with a document_type_not_allowed error code. - #[serde(skip_serializing_if = "Option::is_none")] - pub allowed_types: Option>, - - /// Collect an ID number and perform an [ID number check](https://stripe.com/docs/identity/verification-checks?type=id-number) with the document’s extracted name and date of birth. - #[serde(skip_serializing_if = "Option::is_none")] - pub require_id_number: Option, - - /// Disable image uploads, identity document images have to be captured using the device’s camera. - #[serde(skip_serializing_if = "Option::is_none")] - pub require_live_capture: Option, - - /// Capture a face image and perform a [selfie check](https://stripe.com/docs/identity/verification-checks?type=selfie) comparing a photo ID and a picture of your user’s face. - /// - /// [Learn more](https://stripe.com/docs/identity/selfie). - #[serde(skip_serializing_if = "Option::is_none")] - pub require_matching_selfie: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct GelatoSessionIdNumberOptions { -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct GelatoVerifiedOutputs { - - /// The user's verified address. - pub address: Option
, - - /// The user’s verified date of birth. - pub dob: Option, - - /// The user's verified first name. - pub first_name: Option, - - /// The user's verified id number. - pub id_number: Option, - - /// The user's verified id number type. - pub id_number_type: Option, - - /// The user's verified last name. - pub last_name: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct GelatoDataVerifiedOutputsDate { - - /// Numerical day between 1 and 31. - pub day: Option, - - /// Numerical month between 1 and 12. - pub month: Option, - - /// The four-digit year. - pub year: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct VerificationSessionRedaction { - - /// Indicates whether this object and its related objects have been redacted or not. - pub status: VerificationSessionRedactionStatus, -} - -/// An enum representing the possible values of an `GelatoSessionDocumentOptions`'s `allowed_types` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum GelatoSessionDocumentOptionsAllowedTypes { - DrivingLicense, - IdCard, - Passport, -} - -impl GelatoSessionDocumentOptionsAllowedTypes { - pub fn as_str(self) -> &'static str { - match self { - GelatoSessionDocumentOptionsAllowedTypes::DrivingLicense => "driving_license", - GelatoSessionDocumentOptionsAllowedTypes::IdCard => "id_card", - GelatoSessionDocumentOptionsAllowedTypes::Passport => "passport", - } - } -} - -impl AsRef for GelatoSessionDocumentOptionsAllowedTypes { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for GelatoSessionDocumentOptionsAllowedTypes { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for GelatoSessionDocumentOptionsAllowedTypes { - fn default() -> Self { - Self::DrivingLicense - } -} - -/// An enum representing the possible values of an `GelatoSessionLastError`'s `code` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum GelatoSessionLastErrorCode { - Abandoned, - ConsentDeclined, - CountryNotSupported, - DeviceNotSupported, - DocumentExpired, - DocumentTypeNotSupported, - DocumentUnverifiedOther, - IdNumberInsufficientDocumentData, - IdNumberMismatch, - IdNumberUnverifiedOther, - SelfieDocumentMissingPhoto, - SelfieFaceMismatch, - SelfieManipulated, - SelfieUnverifiedOther, - UnderSupportedAge, -} - -impl GelatoSessionLastErrorCode { - pub fn as_str(self) -> &'static str { - match self { - GelatoSessionLastErrorCode::Abandoned => "abandoned", - GelatoSessionLastErrorCode::ConsentDeclined => "consent_declined", - GelatoSessionLastErrorCode::CountryNotSupported => "country_not_supported", - GelatoSessionLastErrorCode::DeviceNotSupported => "device_not_supported", - GelatoSessionLastErrorCode::DocumentExpired => "document_expired", - GelatoSessionLastErrorCode::DocumentTypeNotSupported => "document_type_not_supported", - GelatoSessionLastErrorCode::DocumentUnverifiedOther => "document_unverified_other", - GelatoSessionLastErrorCode::IdNumberInsufficientDocumentData => "id_number_insufficient_document_data", - GelatoSessionLastErrorCode::IdNumberMismatch => "id_number_mismatch", - GelatoSessionLastErrorCode::IdNumberUnverifiedOther => "id_number_unverified_other", - GelatoSessionLastErrorCode::SelfieDocumentMissingPhoto => "selfie_document_missing_photo", - GelatoSessionLastErrorCode::SelfieFaceMismatch => "selfie_face_mismatch", - GelatoSessionLastErrorCode::SelfieManipulated => "selfie_manipulated", - GelatoSessionLastErrorCode::SelfieUnverifiedOther => "selfie_unverified_other", - GelatoSessionLastErrorCode::UnderSupportedAge => "under_supported_age", - } - } -} - -impl AsRef for GelatoSessionLastErrorCode { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for GelatoSessionLastErrorCode { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for GelatoSessionLastErrorCode { - fn default() -> Self { - Self::Abandoned - } -} - -/// An enum representing the possible values of an `GelatoVerifiedOutputs`'s `id_number_type` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum GelatoVerifiedOutputsIdNumberType { - BrCpf, - SgNric, - UsSsn, -} - -impl GelatoVerifiedOutputsIdNumberType { - pub fn as_str(self) -> &'static str { - match self { - GelatoVerifiedOutputsIdNumberType::BrCpf => "br_cpf", - GelatoVerifiedOutputsIdNumberType::SgNric => "sg_nric", - GelatoVerifiedOutputsIdNumberType::UsSsn => "us_ssn", - } - } -} - -impl AsRef for GelatoVerifiedOutputsIdNumberType { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for GelatoVerifiedOutputsIdNumberType { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for GelatoVerifiedOutputsIdNumberType { - fn default() -> Self { - Self::BrCpf - } -} - -/// An enum representing the possible values of an `IdentityVerificationSession`'s `status` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum IdentityVerificationSessionStatus { - Canceled, - Processing, - RequiresInput, - Verified, -} - -impl IdentityVerificationSessionStatus { - pub fn as_str(self) -> &'static str { - match self { - IdentityVerificationSessionStatus::Canceled => "canceled", - IdentityVerificationSessionStatus::Processing => "processing", - IdentityVerificationSessionStatus::RequiresInput => "requires_input", - IdentityVerificationSessionStatus::Verified => "verified", - } - } -} - -impl AsRef for IdentityVerificationSessionStatus { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for IdentityVerificationSessionStatus { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for IdentityVerificationSessionStatus { - fn default() -> Self { - Self::Canceled - } -} - -/// An enum representing the possible values of an `IdentityVerificationSession`'s `type` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum IdentityVerificationSessionType { - Document, - IdNumber, -} - -impl IdentityVerificationSessionType { - pub fn as_str(self) -> &'static str { - match self { - IdentityVerificationSessionType::Document => "document", - IdentityVerificationSessionType::IdNumber => "id_number", - } - } -} - -impl AsRef for IdentityVerificationSessionType { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for IdentityVerificationSessionType { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for IdentityVerificationSessionType { - fn default() -> Self { - Self::Document - } -} - -/// An enum representing the possible values of an `VerificationSessionRedaction`'s `status` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum VerificationSessionRedactionStatus { - Processing, - Redacted, -} - -impl VerificationSessionRedactionStatus { - pub fn as_str(self) -> &'static str { - match self { - VerificationSessionRedactionStatus::Processing => "processing", - VerificationSessionRedactionStatus::Redacted => "redacted", - } - } -} - -impl AsRef for VerificationSessionRedactionStatus { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for VerificationSessionRedactionStatus { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for VerificationSessionRedactionStatus { - fn default() -> Self { - Self::Processing - } -} diff --git a/src/resources/generated/identity_verification_session_canceled.rs b/src/resources/generated/identity_verification_session_canceled.rs deleted file mode 100644 index eb35f0a22..000000000 --- a/src/resources/generated/identity_verification_session_canceled.rs +++ /dev/null @@ -1,10 +0,0 @@ -// ====================================== -// This file was automatically generated. -// ====================================== - -use serde::{Deserialize, Serialize}; - -/// The resource representing a Stripe "identity.verification_session.canceled". -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct IdentityVerificationSessionCanceled { -} diff --git a/src/resources/generated/identity_verification_session_created.rs b/src/resources/generated/identity_verification_session_created.rs deleted file mode 100644 index d66044d97..000000000 --- a/src/resources/generated/identity_verification_session_created.rs +++ /dev/null @@ -1,10 +0,0 @@ -// ====================================== -// This file was automatically generated. -// ====================================== - -use serde::{Deserialize, Serialize}; - -/// The resource representing a Stripe "identity.verification_session.created". -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct IdentityVerificationSessionCreated { -} diff --git a/src/resources/generated/identity_verification_session_processing.rs b/src/resources/generated/identity_verification_session_processing.rs deleted file mode 100644 index e2956dc9e..000000000 --- a/src/resources/generated/identity_verification_session_processing.rs +++ /dev/null @@ -1,10 +0,0 @@ -// ====================================== -// This file was automatically generated. -// ====================================== - -use serde::{Deserialize, Serialize}; - -/// The resource representing a Stripe "identity.verification_session.processing". -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct IdentityVerificationSessionProcessing { -} diff --git a/src/resources/generated/identity_verification_session_redacted.rs b/src/resources/generated/identity_verification_session_redacted.rs deleted file mode 100644 index 0e4212c7d..000000000 --- a/src/resources/generated/identity_verification_session_redacted.rs +++ /dev/null @@ -1,10 +0,0 @@ -// ====================================== -// This file was automatically generated. -// ====================================== - -use serde::{Deserialize, Serialize}; - -/// The resource representing a Stripe "identity.verification_session.redacted". -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct IdentityVerificationSessionRedacted { -} diff --git a/src/resources/generated/identity_verification_session_requires_input.rs b/src/resources/generated/identity_verification_session_requires_input.rs deleted file mode 100644 index e47d11994..000000000 --- a/src/resources/generated/identity_verification_session_requires_input.rs +++ /dev/null @@ -1,10 +0,0 @@ -// ====================================== -// This file was automatically generated. -// ====================================== - -use serde::{Deserialize, Serialize}; - -/// The resource representing a Stripe "identity.verification_session.requires_input". -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct IdentityVerificationSessionRequiresInput { -} diff --git a/src/resources/generated/identity_verification_session_verified.rs b/src/resources/generated/identity_verification_session_verified.rs deleted file mode 100644 index e7df8e30f..000000000 --- a/src/resources/generated/identity_verification_session_verified.rs +++ /dev/null @@ -1,10 +0,0 @@ -// ====================================== -// This file was automatically generated. -// ====================================== - -use serde::{Deserialize, Serialize}; - -/// The resource representing a Stripe "identity.verification_session.verified". -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct IdentityVerificationSessionVerified { -} diff --git a/src/resources/generated/invoice.rs b/src/resources/generated/invoice.rs deleted file mode 100644 index 267496ac8..000000000 --- a/src/resources/generated/invoice.rs +++ /dev/null @@ -1,2946 +0,0 @@ -// ====================================== -// This file was automatically generated. -// ====================================== - -use serde::{Deserialize, Serialize}; - -use crate::client::{Client, Response}; -use crate::ids::{CustomerId, InvoiceId, SubscriptionId}; -use crate::params::{ - CurrencyMap, Deleted, Expand, Expandable, List, Metadata, Object, Paginable, RangeQuery, - Timestamp, -}; -use crate::resources::{ - Account, Address, ApiErrors, Application, Charge, ConnectAccountReference, Currency, Customer, - Discount, InvoiceLineItem, InvoicePaymentMethodOptionsAcssDebit, - InvoicePaymentMethodOptionsBancontact, InvoicePaymentMethodOptionsCustomerBalance, - InvoicePaymentMethodOptionsKonbini, InvoicePaymentMethodOptionsUsBankAccount, - InvoiceSettingRenderingOptions, InvoicesShippingCost, PaymentIntent, PaymentMethod, - PaymentSource, Quote, Shipping, Subscription, TaxId, TaxRate, TestHelpersTestClock, -}; - -/// The resource representing a Stripe "Invoice". -/// -/// For more details see -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct Invoice { - /// Unique identifier for the object. - /// - /// This property is always present unless the invoice is an upcoming invoice. - /// See [Retrieve an upcoming invoice](https://stripe.com/docs/api/invoices/upcoming) for more details. - #[serde(default = "InvoiceId::none")] - pub id: InvoiceId, - - /// The country of the business associated with this invoice, most often the business creating the invoice. - #[serde(skip_serializing_if = "Option::is_none")] - pub account_country: Option, - - /// The public name of the business associated with this invoice, most often the business creating the invoice. - #[serde(skip_serializing_if = "Option::is_none")] - pub account_name: Option, - - /// The account tax IDs associated with the invoice. - /// - /// Only editable when the invoice is a draft. - #[serde(skip_serializing_if = "Option::is_none")] - pub account_tax_ids: Option>>, - - /// Final amount due at this time for this invoice. - /// - /// If the invoice's total is smaller than the minimum charge amount, for example, or if there is account credit that can be applied to the invoice, the `amount_due` may be 0. - /// If there is a positive `starting_balance` for the invoice (the customer owes money), the `amount_due` will also take that into account. - /// The charge that gets generated for the invoice will be for the amount specified in `amount_due`. - #[serde(skip_serializing_if = "Option::is_none")] - pub amount_due: Option, - - /// The amount, in cents (or local equivalent), that was paid. - #[serde(skip_serializing_if = "Option::is_none")] - pub amount_paid: Option, - - /// The difference between amount_due and amount_paid, in cents (or local equivalent). - #[serde(skip_serializing_if = "Option::is_none")] - pub amount_remaining: Option, - - /// This is the sum of all the shipping amounts. - #[serde(skip_serializing_if = "Option::is_none")] - pub amount_shipping: Option, - - /// ID of the Connect Application that created the invoice. - #[serde(skip_serializing_if = "Option::is_none")] - pub application: Option>, - - /// The fee in cents (or local equivalent) that will be applied to the invoice and transferred to the application owner's Stripe account when the invoice is paid. - #[serde(skip_serializing_if = "Option::is_none")] - pub application_fee_amount: Option, - - /// Number of payment attempts made for this invoice, from the perspective of the payment retry schedule. - /// - /// Any payment attempt counts as the first attempt, and subsequently only automatic retries increment the attempt count. - /// In other words, manual payment attempts after the first attempt do not affect the retry schedule. - #[serde(skip_serializing_if = "Option::is_none")] - pub attempt_count: Option, - - /// Whether an attempt has been made to pay the invoice. - /// - /// An invoice is not attempted until 1 hour after the `invoice.created` webhook, for example, so you might not want to display that invoice as unpaid to your users. - #[serde(skip_serializing_if = "Option::is_none")] - pub attempted: Option, - - /// Controls whether Stripe performs [automatic collection](https://stripe.com/docs/invoicing/integration/automatic-advancement-collection) of the invoice. - /// - /// If `false`, the invoice's state doesn't automatically advance without an explicit action. - #[serde(skip_serializing_if = "Option::is_none")] - pub auto_advance: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub automatic_tax: Option, - - /// Indicates the reason why the invoice was created. - /// - /// * `manual`: Unrelated to a subscription, for example, created via the invoice editor. - /// * `subscription`: No longer in use. - /// - /// Applies to subscriptions from before May 2018 where no distinction was made between updates, cycles, and thresholds. * `subscription_create`: A new subscription was created. * `subscription_cycle`: A subscription advanced into a new period. * `subscription_threshold`: A subscription reached a billing threshold. * `subscription_update`: A subscription was updated. * `upcoming`: Reserved for simulated invoices, per the upcoming invoice endpoint. - #[serde(skip_serializing_if = "Option::is_none")] - pub billing_reason: Option, - - /// ID of the latest charge generated for this invoice, if any. - #[serde(skip_serializing_if = "Option::is_none")] - pub charge: Option>, - - /// Either `charge_automatically`, or `send_invoice`. - /// - /// When charging automatically, Stripe will attempt to pay this invoice using the default source attached to the customer. - /// When sending an invoice, Stripe will email this invoice to the customer with payment instructions. - #[serde(skip_serializing_if = "Option::is_none")] - pub collection_method: Option, - - /// Time at which the object was created. - /// - /// Measured in seconds since the Unix epoch. - #[serde(skip_serializing_if = "Option::is_none")] - pub created: Option, - - /// Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. - /// - /// Must be a [supported currency](https://stripe.com/docs/currencies). - #[serde(skip_serializing_if = "Option::is_none")] - pub currency: Option, - - /// Custom fields displayed on the invoice. - #[serde(skip_serializing_if = "Option::is_none")] - pub custom_fields: Option>, - - /// The ID of the customer who will be billed. - #[serde(skip_serializing_if = "Option::is_none")] - pub customer: Option>, - - /// The customer's address. - /// - /// Until the invoice is finalized, this field will equal `customer.address`. - /// Once the invoice is finalized, this field will no longer be updated. - #[serde(skip_serializing_if = "Option::is_none")] - pub customer_address: Option
, - - /// The customer's email. - /// - /// Until the invoice is finalized, this field will equal `customer.email`. - /// Once the invoice is finalized, this field will no longer be updated. - #[serde(skip_serializing_if = "Option::is_none")] - pub customer_email: Option, - - /// The customer's name. - /// - /// Until the invoice is finalized, this field will equal `customer.name`. - /// Once the invoice is finalized, this field will no longer be updated. - #[serde(skip_serializing_if = "Option::is_none")] - pub customer_name: Option, - - /// The customer's phone number. - /// - /// Until the invoice is finalized, this field will equal `customer.phone`. - /// Once the invoice is finalized, this field will no longer be updated. - #[serde(skip_serializing_if = "Option::is_none")] - pub customer_phone: Option, - - /// The customer's shipping information. - /// - /// Until the invoice is finalized, this field will equal `customer.shipping`. - /// Once the invoice is finalized, this field will no longer be updated. - #[serde(skip_serializing_if = "Option::is_none")] - pub customer_shipping: Option, - - /// The customer's tax exempt status. - /// - /// Until the invoice is finalized, this field will equal `customer.tax_exempt`. - /// Once the invoice is finalized, this field will no longer be updated. - #[serde(skip_serializing_if = "Option::is_none")] - pub customer_tax_exempt: Option, - - /// The customer's tax IDs. - /// - /// Until the invoice is finalized, this field will contain the same tax IDs as `customer.tax_ids`. - /// Once the invoice is finalized, this field will no longer be updated. - #[serde(skip_serializing_if = "Option::is_none")] - pub customer_tax_ids: Option>, - - /// ID of the default payment method for the invoice. - /// - /// It must belong to the customer associated with the invoice. - /// If not set, defaults to the subscription's default payment method, if any, or to the default payment method in the customer's invoice settings. - #[serde(skip_serializing_if = "Option::is_none")] - pub default_payment_method: Option>, - - /// ID of the default payment source for the invoice. - /// - /// It must belong to the customer associated with the invoice and be in a chargeable state. - /// If not set, defaults to the subscription's default source, if any, or to the customer's default source. - #[serde(skip_serializing_if = "Option::is_none")] - pub default_source: Option>, - - /// The tax rates applied to this invoice, if any. - #[serde(skip_serializing_if = "Option::is_none")] - pub default_tax_rates: Option>, - - // Always true for a deleted object - #[serde(default)] - pub deleted: bool, - - /// An arbitrary string attached to the object. - /// - /// Often useful for displaying to users. - /// Referenced as 'memo' in the Dashboard. - #[serde(skip_serializing_if = "Option::is_none")] - pub description: Option, - - /// Describes the current discount applied to this invoice, if there is one. - /// - /// Not populated if there are multiple discounts. - #[serde(skip_serializing_if = "Option::is_none")] - pub discount: Option, - - /// The discounts applied to the invoice. - /// - /// Line item discounts are applied before invoice discounts. - /// Use `expand[]=discounts` to expand each discount. - #[serde(skip_serializing_if = "Option::is_none")] - pub discounts: Option>>, - - /// The date on which payment for this invoice is due. - /// - /// This value will be `null` for invoices where `collection_method=charge_automatically`. - #[serde(skip_serializing_if = "Option::is_none")] - pub due_date: Option, - - /// The date when this invoice is in effect. - /// - /// Same as `finalized_at` unless overwritten. - /// When defined, this value replaces the system-generated 'Date of issue' printed on the invoice PDF and receipt. - #[serde(skip_serializing_if = "Option::is_none")] - pub effective_at: Option, - - /// Ending customer balance after the invoice is finalized. - /// - /// Invoices are finalized approximately an hour after successful webhook delivery or when payment collection is attempted for the invoice. - /// If the invoice has not been finalized yet, this will be null. - #[serde(skip_serializing_if = "Option::is_none")] - pub ending_balance: Option, - - /// Footer displayed on the invoice. - #[serde(skip_serializing_if = "Option::is_none")] - pub footer: Option, - - /// Details of the invoice that was cloned. - /// - /// See the [revision documentation](https://stripe.com/docs/invoicing/invoice-revisions) for more details. - #[serde(skip_serializing_if = "Option::is_none")] - pub from_invoice: Option, - - /// The URL for the hosted invoice page, which allows customers to view and pay an invoice. - /// - /// If the invoice has not been finalized yet, this will be null. - #[serde(skip_serializing_if = "Option::is_none")] - pub hosted_invoice_url: Option, - - /// The link to download the PDF for the invoice. - /// - /// If the invoice has not been finalized yet, this will be null. - #[serde(skip_serializing_if = "Option::is_none")] - pub invoice_pdf: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub issuer: Option, - - /// The error encountered during the previous attempt to finalize the invoice. - /// - /// This field is cleared when the invoice is successfully finalized. - #[serde(skip_serializing_if = "Option::is_none")] - pub last_finalization_error: Option>, - - /// The ID of the most recent non-draft revision of this invoice. - #[serde(skip_serializing_if = "Option::is_none")] - pub latest_revision: Option>, - - /// The individual line items that make up the invoice. - /// - /// `lines` is sorted as follows: (1) pending invoice items (including prorations) in reverse chronological order, (2) subscription items in reverse chronological order, and (3) invoice items added after invoice creation in chronological order. - #[serde(skip_serializing_if = "Option::is_none")] - pub lines: Option>, - - /// Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. - #[serde(skip_serializing_if = "Option::is_none")] - pub livemode: Option, - - /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. - /// - /// This can be useful for storing additional information about the object in a structured format. - #[serde(skip_serializing_if = "Option::is_none")] - pub metadata: Option, - - /// The time at which payment will next be attempted. - /// - /// This value will be `null` for invoices where `collection_method=send_invoice`. - #[serde(skip_serializing_if = "Option::is_none")] - pub next_payment_attempt: Option, - - /// A unique, identifying string that appears on emails sent to the customer for this invoice. - /// - /// This starts with the customer's unique invoice_prefix if it is specified. - #[serde(skip_serializing_if = "Option::is_none")] - pub number: Option, - - /// The account (if any) for which the funds of the invoice payment are intended. - /// - /// If set, the invoice will be presented with the branding and support information of the specified account. - /// See the [Invoices with Connect](https://stripe.com/docs/billing/invoices/connect) documentation for details. - #[serde(skip_serializing_if = "Option::is_none")] - pub on_behalf_of: Option>, - - /// Whether payment was successfully collected for this invoice. - /// - /// An invoice can be paid (most commonly) with a charge or with credit from the customer's account balance. - #[serde(skip_serializing_if = "Option::is_none")] - pub paid: Option, - - /// Returns true if the invoice was manually marked paid, returns false if the invoice hasn't been paid yet or was paid on Stripe. - #[serde(skip_serializing_if = "Option::is_none")] - pub paid_out_of_band: Option, - - /// The PaymentIntent associated with this invoice. - /// - /// The PaymentIntent is generated when the invoice is finalized, and can then be used to pay the invoice. - /// Note that voiding an invoice will cancel the PaymentIntent. - #[serde(skip_serializing_if = "Option::is_none")] - pub payment_intent: Option>, - - #[serde(skip_serializing_if = "Option::is_none")] - pub payment_settings: Option, - - /// End of the usage period during which invoice items were added to this invoice. - #[serde(skip_serializing_if = "Option::is_none")] - pub period_end: Option, - - /// Start of the usage period during which invoice items were added to this invoice. - #[serde(skip_serializing_if = "Option::is_none")] - pub period_start: Option, - - /// Total amount of all post-payment credit notes issued for this invoice. - #[serde(skip_serializing_if = "Option::is_none")] - pub post_payment_credit_notes_amount: Option, - - /// Total amount of all pre-payment credit notes issued for this invoice. - #[serde(skip_serializing_if = "Option::is_none")] - pub pre_payment_credit_notes_amount: Option, - - /// The quote this invoice was generated from. - #[serde(skip_serializing_if = "Option::is_none")] - pub quote: Option>, - - /// This is the transaction number that appears on email receipts sent for this invoice. - #[serde(skip_serializing_if = "Option::is_none")] - pub receipt_number: Option, - - /// The rendering-related settings that control how the invoice is displayed on customer-facing surfaces such as PDF and Hosted Invoice Page. - #[serde(skip_serializing_if = "Option::is_none")] - pub rendering: Option, - - /// This is a legacy field that will be removed soon. - /// - /// For details about `rendering_options`, refer to `rendering` instead. - /// Options for invoice PDF rendering. - #[serde(skip_serializing_if = "Option::is_none")] - pub rendering_options: Option, - - /// The details of the cost of shipping, including the ShippingRate applied on the invoice. - #[serde(skip_serializing_if = "Option::is_none")] - pub shipping_cost: Option, - - /// Shipping details for the invoice. - /// - /// The Invoice PDF will use the `shipping_details` value if it is set, otherwise the PDF will render the shipping address from the customer. - #[serde(skip_serializing_if = "Option::is_none")] - pub shipping_details: Option, - - /// Starting customer balance before the invoice is finalized. - /// - /// If the invoice has not been finalized yet, this will be the current customer balance. - /// For revision invoices, this also includes any customer balance that was applied to the original invoice. - #[serde(skip_serializing_if = "Option::is_none")] - pub starting_balance: Option, - - /// Extra information about an invoice for the customer's credit card statement. - #[serde(skip_serializing_if = "Option::is_none")] - pub statement_descriptor: Option, - - /// The status of the invoice, one of `draft`, `open`, `paid`, `uncollectible`, or `void`. - /// - /// [Learn more](https://stripe.com/docs/billing/invoices/workflow#workflow-overview). - #[serde(skip_serializing_if = "Option::is_none")] - pub status: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub status_transitions: Option, - - /// The subscription that this invoice was prepared for, if any. - #[serde(skip_serializing_if = "Option::is_none")] - pub subscription: Option>, - - /// Details about the subscription that created this invoice. - #[serde(skip_serializing_if = "Option::is_none")] - pub subscription_details: Option, - - /// Only set for upcoming invoices that preview prorations. - /// - /// The time used to calculate prorations. - #[serde(skip_serializing_if = "Option::is_none")] - pub subscription_proration_date: Option, - - /// Total of all subscriptions, invoice items, and prorations on the invoice before any invoice level discount or exclusive tax is applied. - /// - /// Item discounts are already incorporated. - #[serde(skip_serializing_if = "Option::is_none")] - pub subtotal: Option, - - /// The integer amount in cents (or local equivalent) representing the subtotal of the invoice before any invoice level discount or tax is applied. - /// - /// Item discounts are already incorporated. - #[serde(skip_serializing_if = "Option::is_none")] - pub subtotal_excluding_tax: Option, - - /// The amount of tax on this invoice. - /// - /// This is the sum of all the tax amounts on this invoice. - #[serde(skip_serializing_if = "Option::is_none")] - pub tax: Option, - - /// ID of the test clock this invoice belongs to. - #[serde(skip_serializing_if = "Option::is_none")] - pub test_clock: Option>, - - #[serde(skip_serializing_if = "Option::is_none")] - pub threshold_reason: Option, - - /// Total after discounts and taxes. - #[serde(skip_serializing_if = "Option::is_none")] - pub total: Option, - - /// The aggregate amounts calculated per discount across all line items. - #[serde(skip_serializing_if = "Option::is_none")] - pub total_discount_amounts: Option>, - - /// The integer amount in cents (or local equivalent) representing the total amount of the invoice including all discounts but excluding all tax. - #[serde(skip_serializing_if = "Option::is_none")] - pub total_excluding_tax: Option, - - /// The aggregate amounts calculated per tax rate for all line items. - #[serde(skip_serializing_if = "Option::is_none")] - pub total_tax_amounts: Option>, - - /// The account (if any) the payment will be attributed to for tax reporting, and where funds from the payment will be transferred to for the invoice. - #[serde(skip_serializing_if = "Option::is_none")] - pub transfer_data: Option, - - /// Invoices are automatically paid or sent 1 hour after webhooks are delivered, or until all webhook delivery attempts have [been exhausted](https://stripe.com/docs/billing/webhooks#understand). - /// - /// This field tracks the time when webhooks for this invoice were successfully delivered. - /// If the invoice had no webhooks to deliver, this will be set while the invoice is being created. - #[serde(skip_serializing_if = "Option::is_none")] - pub webhooks_delivered_at: Option, -} - -impl Invoice { - /// You can list all invoices, or list the invoices for a specific customer. - /// - /// The invoices are returned sorted by creation date, with the most recently created invoices appearing first. - pub fn list(client: &Client, params: &ListInvoices<'_>) -> Response> { - client.get_query("/invoices", ¶ms) - } - - /// This endpoint creates a draft invoice for a given customer. - /// - /// The invoice remains a draft until you [finalize](https://stripe.com/docs/api#finalize_invoice) the invoice, which allows you to [pay](https://stripe.com/docs/api#pay_invoice) or [send](https://stripe.com/docs/api#send_invoice) the invoice to your customers. - pub fn create(client: &Client, params: CreateInvoice<'_>) -> Response { - client.post_form("/invoices", ¶ms) - } - - /// Retrieves the invoice with the given ID. - pub fn retrieve(client: &Client, id: &InvoiceId, expand: &[&str]) -> Response { - client.get_query(&format!("/invoices/{}", id), &Expand { expand }) - } - - /// Permanently deletes a one-off invoice draft. - /// - /// This cannot be undone. - /// Attempts to delete invoices that are no longer in a draft state will fail; once an invoice has been finalized or if an invoice is for a subscription, it must be [voided](https://stripe.com/docs/api#void_invoice). - pub fn delete(client: &Client, id: &InvoiceId) -> Response> { - client.delete(&format!("/invoices/{}", id)) - } -} - -impl Object for Invoice { - type Id = InvoiceId; - fn id(&self) -> Self::Id { - self.id.clone() - } - fn object(&self) -> &'static str { - "invoice" - } -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct AutomaticTax { - /// Whether Stripe automatically computes tax on this invoice. - /// - /// Note that incompatible invoice items (invoice items with manually specified [tax rates](https://stripe.com/docs/api/tax_rates), negative amounts, or `tax_behavior=unspecified`) cannot be added to automatic tax invoices. - pub enabled: bool, - - /// The account that's liable for tax. - /// - /// If set, the business address and tax registrations required to perform the tax calculation are loaded from this account. - /// The tax transaction is returned in the report of the connected account. - pub liability: Option, - - /// The status of the most recent automated tax calculation for this invoice. - pub status: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct DiscountsResourceDiscountAmount { - /// The amount, in cents (or local equivalent), of the discount. - pub amount: i64, - - /// The discount that was applied to get this discount amount. - pub discount: Expandable, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct InvoiceSettingCustomField { - /// The name of the custom field. - pub name: String, - - /// The value of the custom field. - pub value: String, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct TaxAmount { - /// The amount, in cents (or local equivalent), of the tax. - pub amount: i64, - - /// Whether this tax amount is inclusive or exclusive. - pub inclusive: bool, - - /// The tax rate that was applied to get this tax amount. - pub tax_rate: Expandable, - - /// The reasoning behind this tax, for example, if the product is tax exempt. - /// - /// The possible values for this field may be extended as new tax rules are supported. - pub taxability_reason: Option, - - /// The amount on which tax is calculated, in cents (or local equivalent). - pub taxable_amount: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct InvoiceThresholdReason { - /// The total invoice amount threshold boundary if it triggered the threshold invoice. - pub amount_gte: Option, - - /// Indicates which line items triggered a threshold invoice. - pub item_reasons: Vec, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct InvoiceItemThresholdReason { - /// The IDs of the line items that triggered the threshold invoice. - pub line_item_ids: Vec, - - /// The quantity threshold boundary that applied to the given line item. - pub usage_gte: i64, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct InvoiceTransferData { - /// The amount in cents (or local equivalent) that will be transferred to the destination account when the invoice is paid. - /// - /// By default, the entire amount is transferred to the destination. - pub amount: Option, - - /// The account where funds from the payment will be transferred to upon payment success. - pub destination: Expandable, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct InvoicesFromInvoice { - /// The relation between this invoice and the cloned invoice. - pub action: String, - - /// The invoice that was cloned. - pub invoice: Expandable, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct InvoicesInvoiceRendering { - /// How line-item prices and amounts will be displayed with respect to tax on invoice PDFs. - pub amount_tax_display: Option, - - /// Invoice pdf rendering options. - pub pdf: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct InvoiceRenderingPdf { - /// Page size of invoice pdf. - /// - /// Options include a4, letter, and auto. - /// If set to auto, page size will be switched to a4 or letter based on customer locale. - pub page_size: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct InvoicesPaymentSettings { - /// ID of the mandate to be used for this invoice. - /// - /// It must correspond to the payment method used to pay the invoice, including the invoice's default_payment_method or default_source, if set. - pub default_mandate: Option, - - /// Payment-method-specific configuration to provide to the invoice’s PaymentIntent. - pub payment_method_options: Option, - - /// The list of payment method types (e.g. - /// - /// card) to provide to the invoice’s PaymentIntent. - /// If not set, Stripe attempts to automatically determine the types to use by looking at the invoice’s default payment method, the subscription’s default payment method, the customer’s default payment method, and your [invoice template settings](https://dashboard.stripe.com/settings/billing/invoice). - pub payment_method_types: Option>, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct InvoicesPaymentMethodOptions { - /// If paying by `acss_debit`, this sub-hash contains details about the Canadian pre-authorized debit payment method options to pass to the invoice’s PaymentIntent. - pub acss_debit: Option, - - /// If paying by `bancontact`, this sub-hash contains details about the Bancontact payment method options to pass to the invoice’s PaymentIntent. - pub bancontact: Option, - - /// If paying by `card`, this sub-hash contains details about the Card payment method options to pass to the invoice’s PaymentIntent. - pub card: Option, - - /// If paying by `customer_balance`, this sub-hash contains details about the Bank transfer payment method options to pass to the invoice’s PaymentIntent. - pub customer_balance: Option, - - /// If paying by `konbini`, this sub-hash contains details about the Konbini payment method options to pass to the invoice’s PaymentIntent. - pub konbini: Option, - - /// If paying by `us_bank_account`, this sub-hash contains details about the ACH direct debit payment method options to pass to the invoice’s PaymentIntent. - pub us_bank_account: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct InvoicePaymentMethodOptionsCard { - #[serde(skip_serializing_if = "Option::is_none")] - pub installments: Option, - - /// We strongly recommend that you rely on our SCA Engine to automatically prompt your customers for authentication based on risk level and [other requirements](https://stripe.com/docs/strong-customer-authentication). - /// - /// However, if you wish to request 3D Secure based on logic from your own fraud engine, provide this option. - /// Read our guide on [manually requesting 3D Secure](https://stripe.com/docs/payments/3d-secure#manual-three-ds) for more information on how this configuration interacts with Radar and our SCA Engine. - pub request_three_d_secure: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct InvoiceInstallmentsCard { - /// Whether Installments are enabled for this Invoice. - pub enabled: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct InvoicesResourceInvoiceTaxId { - /// The type of the tax ID, one of `ad_nrt`, `ar_cuit`, `eu_vat`, `bo_tin`, `br_cnpj`, `br_cpf`, `cn_tin`, `co_nit`, `cr_tin`, `do_rcn`, `ec_ruc`, `eu_oss_vat`, `pe_ruc`, `ro_tin`, `rs_pib`, `sv_nit`, `uy_ruc`, `ve_rif`, `vn_tin`, `gb_vat`, `nz_gst`, `au_abn`, `au_arn`, `in_gst`, `no_vat`, `za_vat`, `ch_vat`, `mx_rfc`, `sg_uen`, `ru_inn`, `ru_kpp`, `ca_bn`, `hk_br`, `es_cif`, `tw_vat`, `th_vat`, `jp_cn`, `jp_rn`, `jp_trn`, `li_uid`, `my_itn`, `us_ein`, `kr_brn`, `ca_qst`, `ca_gst_hst`, `ca_pst_bc`, `ca_pst_mb`, `ca_pst_sk`, `my_sst`, `sg_gst`, `ae_trn`, `cl_tin`, `sa_vat`, `id_npwp`, `my_frp`, `il_vat`, `ge_vat`, `ua_vat`, `is_vat`, `bg_uic`, `hu_tin`, `si_tin`, `ke_pin`, `tr_tin`, `eg_tin`, `ph_tin`, or `unknown`. - #[serde(rename = "type")] - pub type_: TaxIdType, - - /// The value of the tax ID. - pub value: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct InvoicesStatusTransitions { - /// The time that the invoice draft was finalized. - pub finalized_at: Option, - - /// The time that the invoice was marked uncollectible. - pub marked_uncollectible_at: Option, - - /// The time that the invoice was paid. - pub paid_at: Option, - - /// The time that the invoice was voided. - pub voided_at: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct SubscriptionDetailsData { - /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that will reflect the metadata of the subscription at the time of invoice creation. - /// - /// *Note: This attribute is populated only for invoices created on or after June 29, 2023.*. - pub metadata: Option, -} - -/// The parameters for `Invoice::create`. -#[derive(Clone, Debug, Serialize, Default)] -pub struct CreateInvoice<'a> { - /// The account tax IDs associated with the invoice. - /// - /// Only editable when the invoice is a draft. - #[serde(skip_serializing_if = "Option::is_none")] - pub account_tax_ids: Option>, - - /// A fee in cents (or local equivalent) that will be applied to the invoice and transferred to the application owner's Stripe account. - /// - /// The request must be made with an OAuth key or the Stripe-Account header in order to take an application fee. - /// For more information, see the application fees [documentation](https://stripe.com/docs/billing/invoices/connect#collecting-fees). - #[serde(skip_serializing_if = "Option::is_none")] - pub application_fee_amount: Option, - - /// Controls whether Stripe performs [automatic collection](https://stripe.com/docs/invoicing/integration/automatic-advancement-collection) of the invoice. - /// - /// If `false`, the invoice's state doesn't automatically advance without an explicit action. - #[serde(skip_serializing_if = "Option::is_none")] - pub auto_advance: Option, - - /// Settings for automatic tax lookup for this invoice. - #[serde(skip_serializing_if = "Option::is_none")] - pub automatic_tax: Option, - - /// Either `charge_automatically`, or `send_invoice`. - /// - /// When charging automatically, Stripe will attempt to pay this invoice using the default source attached to the customer. - /// When sending an invoice, Stripe will email this invoice to the customer with payment instructions. - /// Defaults to `charge_automatically`. - #[serde(skip_serializing_if = "Option::is_none")] - pub collection_method: Option, - - /// The currency to create this invoice in. - /// - /// Defaults to that of `customer` if not specified. - #[serde(skip_serializing_if = "Option::is_none")] - pub currency: Option, - - /// A list of up to 4 custom fields to be displayed on the invoice. - #[serde(skip_serializing_if = "Option::is_none")] - pub custom_fields: Option>, - - /// The ID of the customer who will be billed. - #[serde(skip_serializing_if = "Option::is_none")] - pub customer: Option, - - /// The number of days from when the invoice is created until it is due. - /// - /// Valid only for invoices where `collection_method=send_invoice`. - #[serde(skip_serializing_if = "Option::is_none")] - pub days_until_due: Option, - - /// ID of the default payment method for the invoice. - /// - /// It must belong to the customer associated with the invoice. - /// If not set, defaults to the subscription's default payment method, if any, or to the default payment method in the customer's invoice settings. - #[serde(skip_serializing_if = "Option::is_none")] - pub default_payment_method: Option<&'a str>, - - /// ID of the default payment source for the invoice. - /// - /// It must belong to the customer associated with the invoice and be in a chargeable state. - /// If not set, defaults to the subscription's default source, if any, or to the customer's default source. - #[serde(skip_serializing_if = "Option::is_none")] - pub default_source: Option<&'a str>, - - /// The tax rates that will apply to any line item that does not have `tax_rates` set. - #[serde(skip_serializing_if = "Option::is_none")] - pub default_tax_rates: Option>, - - /// An arbitrary string attached to the object. - /// - /// Often useful for displaying to users. - /// Referenced as 'memo' in the Dashboard. - #[serde(skip_serializing_if = "Option::is_none")] - pub description: Option<&'a str>, - - /// The coupons to redeem into discounts for the invoice. - /// - /// If not specified, inherits the discount from the invoice's customer. - /// Pass an empty string to avoid inheriting any discounts. - #[serde(skip_serializing_if = "Option::is_none")] - pub discounts: Option>, - - /// The date on which payment for this invoice is due. - /// - /// Valid only for invoices where `collection_method=send_invoice`. - #[serde(skip_serializing_if = "Option::is_none")] - pub due_date: Option, - - /// The date when this invoice is in effect. - /// - /// Same as `finalized_at` unless overwritten. - /// When defined, this value replaces the system-generated 'Date of issue' printed on the invoice PDF and receipt. - #[serde(skip_serializing_if = "Option::is_none")] - pub effective_at: Option, - - /// Specifies which fields in the response should be expanded. - #[serde(skip_serializing_if = "Expand::is_empty")] - pub expand: &'a [&'a str], - - /// Footer to be displayed on the invoice. - #[serde(skip_serializing_if = "Option::is_none")] - pub footer: Option<&'a str>, - - /// Revise an existing invoice. - /// - /// The new invoice will be created in `status=draft`. - /// See the [revision documentation](https://stripe.com/docs/invoicing/invoice-revisions) for more details. - #[serde(skip_serializing_if = "Option::is_none")] - pub from_invoice: Option, - - /// The connected account that issues the invoice. - /// - /// The invoice is presented with the branding and support information of the specified account. - #[serde(skip_serializing_if = "Option::is_none")] - pub issuer: Option, - - /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. - /// - /// This can be useful for storing additional information about the object in a structured format. - /// Individual keys can be unset by posting an empty value to them. - /// All keys can be unset by posting an empty value to `metadata`. - #[serde(skip_serializing_if = "Option::is_none")] - pub metadata: Option, - - /// The account (if any) for which the funds of the invoice payment are intended. - /// - /// If set, the invoice will be presented with the branding and support information of the specified account. - /// See the [Invoices with Connect](https://stripe.com/docs/billing/invoices/connect) documentation for details. - #[serde(skip_serializing_if = "Option::is_none")] - pub on_behalf_of: Option<&'a str>, - - /// Configuration settings for the PaymentIntent that is generated when the invoice is finalized. - #[serde(skip_serializing_if = "Option::is_none")] - pub payment_settings: Option, - - /// How to handle pending invoice items on invoice creation. - /// - /// One of `include` or `exclude`. - /// `include` will include any pending invoice items, and will create an empty draft invoice if no pending invoice items exist. - /// `exclude` will always create an empty invoice draft regardless if there are pending invoice items or not. - /// Defaults to `exclude` if the parameter is omitted. - #[serde(skip_serializing_if = "Option::is_none")] - pub pending_invoice_items_behavior: Option, - - /// The rendering-related settings that control how the invoice is displayed on customer-facing surfaces such as PDF and Hosted Invoice Page. - #[serde(skip_serializing_if = "Option::is_none")] - pub rendering: Option, - - /// This is a legacy field that will be removed soon. - /// - /// For details about `rendering_options`, refer to `rendering` instead. - /// Options for invoice PDF rendering. - #[serde(skip_serializing_if = "Option::is_none")] - pub rendering_options: Option, - - /// Settings for the cost of shipping for this invoice. - #[serde(skip_serializing_if = "Option::is_none")] - pub shipping_cost: Option, - - /// Shipping details for the invoice. - /// - /// The Invoice PDF will use the `shipping_details` value if it is set, otherwise the PDF will render the shipping address from the customer. - #[serde(skip_serializing_if = "Option::is_none")] - pub shipping_details: Option, - - /// Extra information about a charge for the customer's credit card statement. - /// - /// It must contain at least one letter. - /// If not specified and this invoice is part of a subscription, the default `statement_descriptor` will be set to the first subscription item's product's `statement_descriptor`. - #[serde(skip_serializing_if = "Option::is_none")] - pub statement_descriptor: Option<&'a str>, - - /// The ID of the subscription to invoice, if any. - /// - /// If set, the created invoice will only include pending invoice items for that subscription. - /// The subscription's billing cycle and regular subscription events won't be affected. - #[serde(skip_serializing_if = "Option::is_none")] - pub subscription: Option, - - /// If specified, the funds from the invoice will be transferred to the destination and the ID of the resulting transfer will be found on the invoice's charge. - #[serde(skip_serializing_if = "Option::is_none")] - pub transfer_data: Option, -} - -impl<'a> CreateInvoice<'a> { - pub fn new() -> Self { - CreateInvoice { - account_tax_ids: Default::default(), - application_fee_amount: Default::default(), - auto_advance: Default::default(), - automatic_tax: Default::default(), - collection_method: Default::default(), - currency: Default::default(), - custom_fields: Default::default(), - customer: Default::default(), - days_until_due: Default::default(), - default_payment_method: Default::default(), - default_source: Default::default(), - default_tax_rates: Default::default(), - description: Default::default(), - discounts: Default::default(), - due_date: Default::default(), - effective_at: Default::default(), - expand: Default::default(), - footer: Default::default(), - from_invoice: Default::default(), - issuer: Default::default(), - metadata: Default::default(), - on_behalf_of: Default::default(), - payment_settings: Default::default(), - pending_invoice_items_behavior: Default::default(), - rendering: Default::default(), - rendering_options: Default::default(), - shipping_cost: Default::default(), - shipping_details: Default::default(), - statement_descriptor: Default::default(), - subscription: Default::default(), - transfer_data: Default::default(), - } - } -} - -/// The parameters for `Invoice::list`. -#[derive(Clone, Debug, Serialize, Default)] -pub struct ListInvoices<'a> { - /// The collection method of the invoice to retrieve. - /// - /// Either `charge_automatically` or `send_invoice`. - #[serde(skip_serializing_if = "Option::is_none")] - pub collection_method: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub created: Option>, - - /// Only return invoices for the customer specified by this customer ID. - #[serde(skip_serializing_if = "Option::is_none")] - pub customer: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub due_date: Option>, - - /// A cursor for use in pagination. - /// - /// `ending_before` is an object ID that defines your place in the list. - /// For instance, if you make a list request and receive 100 objects, starting with `obj_bar`, your subsequent call can include `ending_before=obj_bar` in order to fetch the previous page of the list. - #[serde(skip_serializing_if = "Option::is_none")] - pub ending_before: Option, - - /// Specifies which fields in the response should be expanded. - #[serde(skip_serializing_if = "Expand::is_empty")] - pub expand: &'a [&'a str], - - /// A limit on the number of objects to be returned. - /// - /// Limit can range between 1 and 100, and the default is 10. - #[serde(skip_serializing_if = "Option::is_none")] - pub limit: Option, - - /// A cursor for use in pagination. - /// - /// `starting_after` is an object ID that defines your place in the list. - /// For instance, if you make a list request and receive 100 objects, ending with `obj_foo`, your subsequent call can include `starting_after=obj_foo` in order to fetch the next page of the list. - #[serde(skip_serializing_if = "Option::is_none")] - pub starting_after: Option, - - /// The status of the invoice, one of `draft`, `open`, `paid`, `uncollectible`, or `void`. - /// - /// [Learn more](https://stripe.com/docs/billing/invoices/workflow#workflow-overview). - #[serde(skip_serializing_if = "Option::is_none")] - pub status: Option, - - /// Only return invoices for the subscription specified by this subscription ID. - #[serde(skip_serializing_if = "Option::is_none")] - pub subscription: Option, -} - -impl<'a> ListInvoices<'a> { - pub fn new() -> Self { - ListInvoices { - collection_method: Default::default(), - created: Default::default(), - customer: Default::default(), - due_date: Default::default(), - ending_before: Default::default(), - expand: Default::default(), - limit: Default::default(), - starting_after: Default::default(), - status: Default::default(), - subscription: Default::default(), - } - } -} -impl Paginable for ListInvoices<'_> { - type O = Invoice; - fn set_last(&mut self, item: Self::O) { - self.starting_after = Some(item.id()); - } -} -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreateInvoiceAutomaticTax { - /// Whether Stripe automatically computes tax on this invoice. - /// - /// Note that incompatible invoice items (invoice items with manually specified [tax rates](https://stripe.com/docs/api/tax_rates), negative amounts, or `tax_behavior=unspecified`) cannot be added to automatic tax invoices. - pub enabled: bool, - - /// The account that's liable for tax. - /// - /// If set, the business address and tax registrations required to perform the tax calculation are loaded from this account. - /// The tax transaction is returned in the report of the connected account. - #[serde(skip_serializing_if = "Option::is_none")] - pub liability: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreateInvoiceCustomFields { - /// The name of the custom field. - /// - /// This may be up to 30 characters. - pub name: String, - - /// The value of the custom field. - /// - /// This may be up to 30 characters. - pub value: String, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreateInvoiceDiscounts { - /// ID of the coupon to create a new discount for. - #[serde(skip_serializing_if = "Option::is_none")] - pub coupon: Option, - - /// ID of an existing discount on the object (or one of its ancestors) to reuse. - #[serde(skip_serializing_if = "Option::is_none")] - pub discount: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreateInvoiceFromInvoice { - /// The relation between the new invoice and the original invoice. - /// - /// Currently, only 'revision' is permitted. - pub action: CreateInvoiceFromInvoiceAction, - - /// The `id` of the invoice that will be cloned. - pub invoice: String, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreateInvoiceIssuer { - /// The connected account being referenced when `type` is `account`. - #[serde(skip_serializing_if = "Option::is_none")] - pub account: Option, - - /// Type of the account referenced in the request. - #[serde(rename = "type")] - pub type_: CreateInvoiceIssuerType, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreateInvoicePaymentSettings { - /// ID of the mandate to be used for this invoice. - /// - /// It must correspond to the payment method used to pay the invoice, including the invoice's default_payment_method or default_source, if set. - #[serde(skip_serializing_if = "Option::is_none")] - pub default_mandate: Option, - - /// Payment-method-specific configuration to provide to the invoice’s PaymentIntent. - #[serde(skip_serializing_if = "Option::is_none")] - pub payment_method_options: Option, - - /// The list of payment method types (e.g. - /// - /// card) to provide to the invoice’s PaymentIntent. - /// If not set, Stripe attempts to automatically determine the types to use by looking at the invoice’s default payment method, the subscription’s default payment method, the customer’s default payment method, and your [invoice template settings](https://dashboard.stripe.com/settings/billing/invoice). - #[serde(skip_serializing_if = "Option::is_none")] - pub payment_method_types: Option>, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreateInvoiceRendering { - /// How line-item prices and amounts will be displayed with respect to tax on invoice PDFs. - /// - /// One of `exclude_tax` or `include_inclusive_tax`. - /// `include_inclusive_tax` will include inclusive tax (and exclude exclusive tax) in invoice PDF amounts. - /// `exclude_tax` will exclude all tax (inclusive and exclusive alike) from invoice PDF amounts. - #[serde(skip_serializing_if = "Option::is_none")] - pub amount_tax_display: Option, - - /// Invoice pdf rendering options. - #[serde(skip_serializing_if = "Option::is_none")] - pub pdf: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreateInvoiceRenderingOptions { - /// How line-item prices and amounts will be displayed with respect to tax on invoice PDFs. - /// - /// One of `exclude_tax` or `include_inclusive_tax`. - /// `include_inclusive_tax` will include inclusive tax (and exclude exclusive tax) in invoice PDF amounts. - /// `exclude_tax` will exclude all tax (inclusive and exclusive alike) from invoice PDF amounts. - #[serde(skip_serializing_if = "Option::is_none")] - pub amount_tax_display: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreateInvoiceShippingCost { - /// The ID of the shipping rate to use for this order. - #[serde(skip_serializing_if = "Option::is_none")] - pub shipping_rate: Option, - - /// Parameters to create a new ad-hoc shipping rate for this order. - #[serde(skip_serializing_if = "Option::is_none")] - pub shipping_rate_data: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreateInvoiceShippingDetails { - /// Shipping address. - pub address: CreateInvoiceShippingDetailsAddress, - - /// Recipient name. - pub name: String, - - /// Recipient phone (including extension). - #[serde(skip_serializing_if = "Option::is_none")] - pub phone: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreateInvoiceTransferData { - /// The amount that will be transferred automatically when the invoice is paid. - /// - /// If no amount is set, the full amount is transferred. - #[serde(skip_serializing_if = "Option::is_none")] - pub amount: Option, - - /// ID of an existing, connected Stripe account. - pub destination: String, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreateInvoiceAutomaticTaxLiability { - /// The connected account being referenced when `type` is `account`. - #[serde(skip_serializing_if = "Option::is_none")] - pub account: Option, - - /// Type of the account referenced in the request. - #[serde(rename = "type")] - pub type_: CreateInvoiceAutomaticTaxLiabilityType, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreateInvoicePaymentSettingsPaymentMethodOptions { - /// If paying by `acss_debit`, this sub-hash contains details about the Canadian pre-authorized debit payment method options to pass to the invoice’s PaymentIntent. - #[serde(skip_serializing_if = "Option::is_none")] - pub acss_debit: Option, - - /// If paying by `bancontact`, this sub-hash contains details about the Bancontact payment method options to pass to the invoice’s PaymentIntent. - #[serde(skip_serializing_if = "Option::is_none")] - pub bancontact: Option, - - /// If paying by `card`, this sub-hash contains details about the Card payment method options to pass to the invoice’s PaymentIntent. - #[serde(skip_serializing_if = "Option::is_none")] - pub card: Option, - - /// If paying by `customer_balance`, this sub-hash contains details about the Bank transfer payment method options to pass to the invoice’s PaymentIntent. - #[serde(skip_serializing_if = "Option::is_none")] - pub customer_balance: Option, - - /// If paying by `konbini`, this sub-hash contains details about the Konbini payment method options to pass to the invoice’s PaymentIntent. - #[serde(skip_serializing_if = "Option::is_none")] - pub konbini: Option, - - /// If paying by `us_bank_account`, this sub-hash contains details about the ACH direct debit payment method options to pass to the invoice’s PaymentIntent. - #[serde(skip_serializing_if = "Option::is_none")] - pub us_bank_account: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreateInvoiceRenderingPdf { - /// Page size for invoice PDF. - /// - /// Can be set to `a4`, `letter`, or `auto`. If set to `auto`, invoice PDF page size defaults to `a4` for customers with Japanese locale and `letter` for customers with other locales. - #[serde(skip_serializing_if = "Option::is_none")] - pub page_size: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreateInvoiceShippingCostShippingRateData { - /// The estimated range for how long shipping will take, meant to be displayable to the customer. - /// - /// This will appear on CheckoutSessions. - #[serde(skip_serializing_if = "Option::is_none")] - pub delivery_estimate: Option, - - /// The name of the shipping rate, meant to be displayable to the customer. - /// - /// This will appear on CheckoutSessions. - pub display_name: String, - - /// Describes a fixed amount to charge for shipping. - /// - /// Must be present if type is `fixed_amount`. - #[serde(skip_serializing_if = "Option::is_none")] - pub fixed_amount: Option, - - /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. - /// - /// This can be useful for storing additional information about the object in a structured format. - /// Individual keys can be unset by posting an empty value to them. - /// All keys can be unset by posting an empty value to `metadata`. - #[serde(skip_serializing_if = "Option::is_none")] - pub metadata: Option, - - /// Specifies whether the rate is considered inclusive of taxes or exclusive of taxes. - /// - /// One of `inclusive`, `exclusive`, or `unspecified`. - #[serde(skip_serializing_if = "Option::is_none")] - pub tax_behavior: Option, - - /// A [tax code](https://stripe.com/docs/tax/tax-categories) ID. - /// - /// The Shipping tax code is `txcd_92010001`. - #[serde(skip_serializing_if = "Option::is_none")] - pub tax_code: Option, - - /// The type of calculation to use on the shipping rate. - /// - /// Can only be `fixed_amount` for now. - #[serde(rename = "type")] - #[serde(skip_serializing_if = "Option::is_none")] - pub type_: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreateInvoiceShippingDetailsAddress { - /// City, district, suburb, town, or village. - #[serde(skip_serializing_if = "Option::is_none")] - pub city: Option, - - /// Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). - #[serde(skip_serializing_if = "Option::is_none")] - pub country: Option, - - /// Address line 1 (e.g., street, PO Box, or company name). - #[serde(skip_serializing_if = "Option::is_none")] - pub line1: Option, - - /// Address line 2 (e.g., apartment, suite, unit, or building). - #[serde(skip_serializing_if = "Option::is_none")] - pub line2: Option, - - /// ZIP or postal code. - #[serde(skip_serializing_if = "Option::is_none")] - pub postal_code: Option, - - /// State, county, province, or region. - #[serde(skip_serializing_if = "Option::is_none")] - pub state: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreateInvoicePaymentSettingsPaymentMethodOptionsAcssDebit { - /// Additional fields for Mandate creation. - #[serde(skip_serializing_if = "Option::is_none")] - pub mandate_options: - Option, - - /// Verification method for the intent. - #[serde(skip_serializing_if = "Option::is_none")] - pub verification_method: - Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreateInvoicePaymentSettingsPaymentMethodOptionsBancontact { - /// Preferred language of the Bancontact authorization page that the customer is redirected to. - #[serde(skip_serializing_if = "Option::is_none")] - pub preferred_language: - Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreateInvoicePaymentSettingsPaymentMethodOptionsCard { - /// Installment configuration for payments attempted on this invoice (Mexico Only). - /// - /// For more information, see the [installments integration guide](https://stripe.com/docs/payments/installments). - #[serde(skip_serializing_if = "Option::is_none")] - pub installments: Option, - - /// We strongly recommend that you rely on our SCA Engine to automatically prompt your customers for authentication based on risk level and [other requirements](https://stripe.com/docs/strong-customer-authentication). - /// - /// However, if you wish to request 3D Secure based on logic from your own fraud engine, provide this option. - /// Read our guide on [manually requesting 3D Secure](https://stripe.com/docs/payments/3d-secure#manual-three-ds) for more information on how this configuration interacts with Radar and our SCA Engine. - #[serde(skip_serializing_if = "Option::is_none")] - pub request_three_d_secure: - Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreateInvoicePaymentSettingsPaymentMethodOptionsCustomerBalance { - /// Configuration for the bank transfer funding type, if the `funding_type` is set to `bank_transfer`. - #[serde(skip_serializing_if = "Option::is_none")] - pub bank_transfer: - Option, - - /// The funding method type to be used when there are not enough funds in the customer balance. - /// - /// Permitted values include: `bank_transfer`. - #[serde(skip_serializing_if = "Option::is_none")] - pub funding_type: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreateInvoicePaymentSettingsPaymentMethodOptionsKonbini {} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreateInvoicePaymentSettingsPaymentMethodOptionsUsBankAccount { - /// Additional fields for Financial Connections Session creation. - #[serde(skip_serializing_if = "Option::is_none")] - pub financial_connections: - Option, - - /// Verification method for the intent. - #[serde(skip_serializing_if = "Option::is_none")] - pub verification_method: - Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreateInvoiceShippingCostShippingRateDataDeliveryEstimate { - /// The upper bound of the estimated range. - /// - /// If empty, represents no upper bound i.e., infinite. - #[serde(skip_serializing_if = "Option::is_none")] - pub maximum: Option, - - /// The lower bound of the estimated range. - /// - /// If empty, represents no lower bound. - #[serde(skip_serializing_if = "Option::is_none")] - pub minimum: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreateInvoiceShippingCostShippingRateDataFixedAmount { - /// A non-negative integer in cents representing how much to charge. - pub amount: i64, - - /// Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. - /// - /// Must be a [supported currency](https://stripe.com/docs/currencies). - pub currency: Currency, - - /// Shipping rates defined in each available currency option. - /// - /// Each key must be a three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html) and a [supported currency](https://stripe.com/docs/currencies). - #[serde(skip_serializing_if = "Option::is_none")] - pub currency_options: - Option>, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreateInvoicePaymentSettingsPaymentMethodOptionsAcssDebitMandateOptions { - /// Transaction type of the mandate. - #[serde(skip_serializing_if = "Option::is_none")] - pub transaction_type: Option< - CreateInvoicePaymentSettingsPaymentMethodOptionsAcssDebitMandateOptionsTransactionType, - >, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreateInvoicePaymentSettingsPaymentMethodOptionsCardInstallments { - /// Setting to true enables installments for this invoice. - /// Setting to false will prevent any selected plan from applying to a payment. - #[serde(skip_serializing_if = "Option::is_none")] - pub enabled: Option, - - /// The selected installment plan to use for this invoice. - #[serde(skip_serializing_if = "Option::is_none")] - pub plan: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreateInvoicePaymentSettingsPaymentMethodOptionsCustomerBalanceBankTransfer { - /// Configuration for eu_bank_transfer funding type. - #[serde(skip_serializing_if = "Option::is_none")] - pub eu_bank_transfer: Option< - CreateInvoicePaymentSettingsPaymentMethodOptionsCustomerBalanceBankTransferEuBankTransfer, - >, - - /// The bank transfer type that can be used for funding. - /// - /// Permitted values include: `eu_bank_transfer`, `gb_bank_transfer`, `jp_bank_transfer`, `mx_bank_transfer`, or `us_bank_transfer`. - #[serde(rename = "type")] - #[serde(skip_serializing_if = "Option::is_none")] - pub type_: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreateInvoicePaymentSettingsPaymentMethodOptionsUsBankAccountFinancialConnections { - - /// The list of permissions to request. - /// - /// If this parameter is passed, the `payment_method` permission must be included. - /// Valid permissions include: `balances`, `ownership`, `payment_method`, and `transactions`. - #[serde(skip_serializing_if = "Option::is_none")] - pub permissions: Option>, - - /// List of data features that you would like to retrieve upon account creation. - #[serde(skip_serializing_if = "Option::is_none")] - pub prefetch: Option>, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreateInvoiceShippingCostShippingRateDataDeliveryEstimateMaximum { - /// A unit of time. - pub unit: CreateInvoiceShippingCostShippingRateDataDeliveryEstimateMaximumUnit, - - /// Must be greater than 0. - pub value: i64, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreateInvoiceShippingCostShippingRateDataDeliveryEstimateMinimum { - /// A unit of time. - pub unit: CreateInvoiceShippingCostShippingRateDataDeliveryEstimateMinimumUnit, - - /// Must be greater than 0. - pub value: i64, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreateInvoiceShippingCostShippingRateDataFixedAmountCurrencyOptions { - /// A non-negative integer in cents representing how much to charge. - pub amount: i64, - - /// Specifies whether the rate is considered inclusive of taxes or exclusive of taxes. - /// - /// One of `inclusive`, `exclusive`, or `unspecified`. - #[serde(skip_serializing_if = "Option::is_none")] - pub tax_behavior: - Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreateInvoicePaymentSettingsPaymentMethodOptionsCardInstallmentsPlan { - /// For `fixed_count` installment plans, this is the number of installment payments your customer will make to their credit card. - pub count: u64, - - /// For `fixed_count` installment plans, this is the interval between installment payments your customer will make to their credit card. - /// One of `month`. - pub interval: CreateInvoicePaymentSettingsPaymentMethodOptionsCardInstallmentsPlanInterval, - - /// Type of installment plan, one of `fixed_count`. - #[serde(rename = "type")] - pub type_: CreateInvoicePaymentSettingsPaymentMethodOptionsCardInstallmentsPlanType, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreateInvoicePaymentSettingsPaymentMethodOptionsCustomerBalanceBankTransferEuBankTransfer -{ - /// The desired country code of the bank account information. - /// - /// Permitted values include: `BE`, `DE`, `ES`, `FR`, `IE`, or `NL`. - pub country: String, -} - -/// An enum representing the possible values of an `AutomaticTax`'s `status` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum AutomaticTaxStatus { - Complete, - Failed, - RequiresLocationInputs, -} - -impl AutomaticTaxStatus { - pub fn as_str(self) -> &'static str { - match self { - AutomaticTaxStatus::Complete => "complete", - AutomaticTaxStatus::Failed => "failed", - AutomaticTaxStatus::RequiresLocationInputs => "requires_location_inputs", - } - } -} - -impl AsRef for AutomaticTaxStatus { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for AutomaticTaxStatus { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for AutomaticTaxStatus { - fn default() -> Self { - Self::Complete - } -} - -/// An enum representing the possible values of an `Invoice`'s `collection_method` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CollectionMethod { - ChargeAutomatically, - SendInvoice, -} - -impl CollectionMethod { - pub fn as_str(self) -> &'static str { - match self { - CollectionMethod::ChargeAutomatically => "charge_automatically", - CollectionMethod::SendInvoice => "send_invoice", - } - } -} - -impl AsRef for CollectionMethod { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for CollectionMethod { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for CollectionMethod { - fn default() -> Self { - Self::ChargeAutomatically - } -} - -/// An enum representing the possible values of an `CreateInvoiceAutomaticTaxLiability`'s `type` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CreateInvoiceAutomaticTaxLiabilityType { - Account, - #[serde(rename = "self")] - Self_, -} - -impl CreateInvoiceAutomaticTaxLiabilityType { - pub fn as_str(self) -> &'static str { - match self { - CreateInvoiceAutomaticTaxLiabilityType::Account => "account", - CreateInvoiceAutomaticTaxLiabilityType::Self_ => "self", - } - } -} - -impl AsRef for CreateInvoiceAutomaticTaxLiabilityType { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for CreateInvoiceAutomaticTaxLiabilityType { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for CreateInvoiceAutomaticTaxLiabilityType { - fn default() -> Self { - Self::Account - } -} - -/// An enum representing the possible values of an `CreateInvoiceFromInvoice`'s `action` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CreateInvoiceFromInvoiceAction { - Revision, -} - -impl CreateInvoiceFromInvoiceAction { - pub fn as_str(self) -> &'static str { - match self { - CreateInvoiceFromInvoiceAction::Revision => "revision", - } - } -} - -impl AsRef for CreateInvoiceFromInvoiceAction { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for CreateInvoiceFromInvoiceAction { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for CreateInvoiceFromInvoiceAction { - fn default() -> Self { - Self::Revision - } -} - -/// An enum representing the possible values of an `CreateInvoiceIssuer`'s `type` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CreateInvoiceIssuerType { - Account, - #[serde(rename = "self")] - Self_, -} - -impl CreateInvoiceIssuerType { - pub fn as_str(self) -> &'static str { - match self { - CreateInvoiceIssuerType::Account => "account", - CreateInvoiceIssuerType::Self_ => "self", - } - } -} - -impl AsRef for CreateInvoiceIssuerType { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for CreateInvoiceIssuerType { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for CreateInvoiceIssuerType { - fn default() -> Self { - Self::Account - } -} - -/// An enum representing the possible values of an `CreateInvoicePaymentSettingsPaymentMethodOptionsAcssDebitMandateOptions`'s `transaction_type` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CreateInvoicePaymentSettingsPaymentMethodOptionsAcssDebitMandateOptionsTransactionType { - Business, - Personal, -} - -impl CreateInvoicePaymentSettingsPaymentMethodOptionsAcssDebitMandateOptionsTransactionType { - pub fn as_str(self) -> &'static str { - match self { - CreateInvoicePaymentSettingsPaymentMethodOptionsAcssDebitMandateOptionsTransactionType::Business => "business", - CreateInvoicePaymentSettingsPaymentMethodOptionsAcssDebitMandateOptionsTransactionType::Personal => "personal", - } - } -} - -impl AsRef - for CreateInvoicePaymentSettingsPaymentMethodOptionsAcssDebitMandateOptionsTransactionType -{ - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display - for CreateInvoicePaymentSettingsPaymentMethodOptionsAcssDebitMandateOptionsTransactionType -{ - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default - for CreateInvoicePaymentSettingsPaymentMethodOptionsAcssDebitMandateOptionsTransactionType -{ - fn default() -> Self { - Self::Business - } -} - -/// An enum representing the possible values of an `CreateInvoicePaymentSettingsPaymentMethodOptionsAcssDebit`'s `verification_method` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CreateInvoicePaymentSettingsPaymentMethodOptionsAcssDebitVerificationMethod { - Automatic, - Instant, - Microdeposits, -} - -impl CreateInvoicePaymentSettingsPaymentMethodOptionsAcssDebitVerificationMethod { - pub fn as_str(self) -> &'static str { - match self { - CreateInvoicePaymentSettingsPaymentMethodOptionsAcssDebitVerificationMethod::Automatic => "automatic", - CreateInvoicePaymentSettingsPaymentMethodOptionsAcssDebitVerificationMethod::Instant => "instant", - CreateInvoicePaymentSettingsPaymentMethodOptionsAcssDebitVerificationMethod::Microdeposits => "microdeposits", - } - } -} - -impl AsRef for CreateInvoicePaymentSettingsPaymentMethodOptionsAcssDebitVerificationMethod { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display - for CreateInvoicePaymentSettingsPaymentMethodOptionsAcssDebitVerificationMethod -{ - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default - for CreateInvoicePaymentSettingsPaymentMethodOptionsAcssDebitVerificationMethod -{ - fn default() -> Self { - Self::Automatic - } -} - -/// An enum representing the possible values of an `CreateInvoicePaymentSettingsPaymentMethodOptionsBancontact`'s `preferred_language` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CreateInvoicePaymentSettingsPaymentMethodOptionsBancontactPreferredLanguage { - De, - En, - Fr, - Nl, -} - -impl CreateInvoicePaymentSettingsPaymentMethodOptionsBancontactPreferredLanguage { - pub fn as_str(self) -> &'static str { - match self { - CreateInvoicePaymentSettingsPaymentMethodOptionsBancontactPreferredLanguage::De => "de", - CreateInvoicePaymentSettingsPaymentMethodOptionsBancontactPreferredLanguage::En => "en", - CreateInvoicePaymentSettingsPaymentMethodOptionsBancontactPreferredLanguage::Fr => "fr", - CreateInvoicePaymentSettingsPaymentMethodOptionsBancontactPreferredLanguage::Nl => "nl", - } - } -} - -impl AsRef for CreateInvoicePaymentSettingsPaymentMethodOptionsBancontactPreferredLanguage { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display - for CreateInvoicePaymentSettingsPaymentMethodOptionsBancontactPreferredLanguage -{ - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default - for CreateInvoicePaymentSettingsPaymentMethodOptionsBancontactPreferredLanguage -{ - fn default() -> Self { - Self::De - } -} - -/// An enum representing the possible values of an `CreateInvoicePaymentSettingsPaymentMethodOptionsCardInstallmentsPlan`'s `interval` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CreateInvoicePaymentSettingsPaymentMethodOptionsCardInstallmentsPlanInterval { - Month, -} - -impl CreateInvoicePaymentSettingsPaymentMethodOptionsCardInstallmentsPlanInterval { - pub fn as_str(self) -> &'static str { - match self { - CreateInvoicePaymentSettingsPaymentMethodOptionsCardInstallmentsPlanInterval::Month => { - "month" - } - } - } -} - -impl AsRef for CreateInvoicePaymentSettingsPaymentMethodOptionsCardInstallmentsPlanInterval { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display - for CreateInvoicePaymentSettingsPaymentMethodOptionsCardInstallmentsPlanInterval -{ - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default - for CreateInvoicePaymentSettingsPaymentMethodOptionsCardInstallmentsPlanInterval -{ - fn default() -> Self { - Self::Month - } -} - -/// An enum representing the possible values of an `CreateInvoicePaymentSettingsPaymentMethodOptionsCardInstallmentsPlan`'s `type` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CreateInvoicePaymentSettingsPaymentMethodOptionsCardInstallmentsPlanType { - FixedCount, -} - -impl CreateInvoicePaymentSettingsPaymentMethodOptionsCardInstallmentsPlanType { - pub fn as_str(self) -> &'static str { - match self { - CreateInvoicePaymentSettingsPaymentMethodOptionsCardInstallmentsPlanType::FixedCount => "fixed_count", - } - } -} - -impl AsRef for CreateInvoicePaymentSettingsPaymentMethodOptionsCardInstallmentsPlanType { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display - for CreateInvoicePaymentSettingsPaymentMethodOptionsCardInstallmentsPlanType -{ - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default - for CreateInvoicePaymentSettingsPaymentMethodOptionsCardInstallmentsPlanType -{ - fn default() -> Self { - Self::FixedCount - } -} - -/// An enum representing the possible values of an `CreateInvoicePaymentSettingsPaymentMethodOptionsCard`'s `request_three_d_secure` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CreateInvoicePaymentSettingsPaymentMethodOptionsCardRequestThreeDSecure { - Any, - Automatic, - Challenge, -} - -impl CreateInvoicePaymentSettingsPaymentMethodOptionsCardRequestThreeDSecure { - pub fn as_str(self) -> &'static str { - match self { - CreateInvoicePaymentSettingsPaymentMethodOptionsCardRequestThreeDSecure::Any => "any", - CreateInvoicePaymentSettingsPaymentMethodOptionsCardRequestThreeDSecure::Automatic => { - "automatic" - } - CreateInvoicePaymentSettingsPaymentMethodOptionsCardRequestThreeDSecure::Challenge => { - "challenge" - } - } - } -} - -impl AsRef for CreateInvoicePaymentSettingsPaymentMethodOptionsCardRequestThreeDSecure { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for CreateInvoicePaymentSettingsPaymentMethodOptionsCardRequestThreeDSecure { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default - for CreateInvoicePaymentSettingsPaymentMethodOptionsCardRequestThreeDSecure -{ - fn default() -> Self { - Self::Any - } -} - -/// An enum representing the possible values of an `CreateInvoicePaymentSettingsPaymentMethodOptionsUsBankAccountFinancialConnections`'s `permissions` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CreateInvoicePaymentSettingsPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions -{ - Balances, - Ownership, - PaymentMethod, - Transactions, -} - -impl CreateInvoicePaymentSettingsPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions { - pub fn as_str(self) -> &'static str { - match self { - CreateInvoicePaymentSettingsPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions::Balances => "balances", - CreateInvoicePaymentSettingsPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions::Ownership => "ownership", - CreateInvoicePaymentSettingsPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions::PaymentMethod => "payment_method", - CreateInvoicePaymentSettingsPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions::Transactions => "transactions", - } - } -} - -impl AsRef - for CreateInvoicePaymentSettingsPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions -{ - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display - for CreateInvoicePaymentSettingsPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions -{ - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default - for CreateInvoicePaymentSettingsPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions -{ - fn default() -> Self { - Self::Balances - } -} - -/// An enum representing the possible values of an `CreateInvoicePaymentSettingsPaymentMethodOptionsUsBankAccountFinancialConnections`'s `prefetch` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CreateInvoicePaymentSettingsPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch { - Balances, - Transactions, -} - -impl CreateInvoicePaymentSettingsPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch { - pub fn as_str(self) -> &'static str { - match self { - CreateInvoicePaymentSettingsPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch::Balances => "balances", - CreateInvoicePaymentSettingsPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch::Transactions => "transactions", - } - } -} - -impl AsRef - for CreateInvoicePaymentSettingsPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch -{ - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display - for CreateInvoicePaymentSettingsPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch -{ - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default - for CreateInvoicePaymentSettingsPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch -{ - fn default() -> Self { - Self::Balances - } -} - -/// An enum representing the possible values of an `CreateInvoicePaymentSettingsPaymentMethodOptionsUsBankAccount`'s `verification_method` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CreateInvoicePaymentSettingsPaymentMethodOptionsUsBankAccountVerificationMethod { - Automatic, - Instant, - Microdeposits, -} - -impl CreateInvoicePaymentSettingsPaymentMethodOptionsUsBankAccountVerificationMethod { - pub fn as_str(self) -> &'static str { - match self { - CreateInvoicePaymentSettingsPaymentMethodOptionsUsBankAccountVerificationMethod::Automatic => "automatic", - CreateInvoicePaymentSettingsPaymentMethodOptionsUsBankAccountVerificationMethod::Instant => "instant", - CreateInvoicePaymentSettingsPaymentMethodOptionsUsBankAccountVerificationMethod::Microdeposits => "microdeposits", - } - } -} - -impl AsRef - for CreateInvoicePaymentSettingsPaymentMethodOptionsUsBankAccountVerificationMethod -{ - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display - for CreateInvoicePaymentSettingsPaymentMethodOptionsUsBankAccountVerificationMethod -{ - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default - for CreateInvoicePaymentSettingsPaymentMethodOptionsUsBankAccountVerificationMethod -{ - fn default() -> Self { - Self::Automatic - } -} - -/// An enum representing the possible values of an `CreateInvoicePaymentSettings`'s `payment_method_types` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CreateInvoicePaymentSettingsPaymentMethodTypes { - AchCreditTransfer, - AchDebit, - AcssDebit, - AuBecsDebit, - BacsDebit, - Bancontact, - Boleto, - Card, - Cashapp, - CustomerBalance, - Eps, - Fpx, - Giropay, - Grabpay, - Ideal, - Konbini, - Link, - P24, - Paynow, - Paypal, - Promptpay, - SepaCreditTransfer, - SepaDebit, - Sofort, - UsBankAccount, - WechatPay, -} - -impl CreateInvoicePaymentSettingsPaymentMethodTypes { - pub fn as_str(self) -> &'static str { - match self { - CreateInvoicePaymentSettingsPaymentMethodTypes::AchCreditTransfer => { - "ach_credit_transfer" - } - CreateInvoicePaymentSettingsPaymentMethodTypes::AchDebit => "ach_debit", - CreateInvoicePaymentSettingsPaymentMethodTypes::AcssDebit => "acss_debit", - CreateInvoicePaymentSettingsPaymentMethodTypes::AuBecsDebit => "au_becs_debit", - CreateInvoicePaymentSettingsPaymentMethodTypes::BacsDebit => "bacs_debit", - CreateInvoicePaymentSettingsPaymentMethodTypes::Bancontact => "bancontact", - CreateInvoicePaymentSettingsPaymentMethodTypes::Boleto => "boleto", - CreateInvoicePaymentSettingsPaymentMethodTypes::Card => "card", - CreateInvoicePaymentSettingsPaymentMethodTypes::Cashapp => "cashapp", - CreateInvoicePaymentSettingsPaymentMethodTypes::CustomerBalance => "customer_balance", - CreateInvoicePaymentSettingsPaymentMethodTypes::Eps => "eps", - CreateInvoicePaymentSettingsPaymentMethodTypes::Fpx => "fpx", - CreateInvoicePaymentSettingsPaymentMethodTypes::Giropay => "giropay", - CreateInvoicePaymentSettingsPaymentMethodTypes::Grabpay => "grabpay", - CreateInvoicePaymentSettingsPaymentMethodTypes::Ideal => "ideal", - CreateInvoicePaymentSettingsPaymentMethodTypes::Konbini => "konbini", - CreateInvoicePaymentSettingsPaymentMethodTypes::Link => "link", - CreateInvoicePaymentSettingsPaymentMethodTypes::P24 => "p24", - CreateInvoicePaymentSettingsPaymentMethodTypes::Paynow => "paynow", - CreateInvoicePaymentSettingsPaymentMethodTypes::Paypal => "paypal", - CreateInvoicePaymentSettingsPaymentMethodTypes::Promptpay => "promptpay", - CreateInvoicePaymentSettingsPaymentMethodTypes::SepaCreditTransfer => { - "sepa_credit_transfer" - } - CreateInvoicePaymentSettingsPaymentMethodTypes::SepaDebit => "sepa_debit", - CreateInvoicePaymentSettingsPaymentMethodTypes::Sofort => "sofort", - CreateInvoicePaymentSettingsPaymentMethodTypes::UsBankAccount => "us_bank_account", - CreateInvoicePaymentSettingsPaymentMethodTypes::WechatPay => "wechat_pay", - } - } -} - -impl AsRef for CreateInvoicePaymentSettingsPaymentMethodTypes { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for CreateInvoicePaymentSettingsPaymentMethodTypes { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for CreateInvoicePaymentSettingsPaymentMethodTypes { - fn default() -> Self { - Self::AchCreditTransfer - } -} - -/// An enum representing the possible values of an `CreateInvoiceRendering`'s `amount_tax_display` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CreateInvoiceRenderingAmountTaxDisplay { - ExcludeTax, - IncludeInclusiveTax, -} - -impl CreateInvoiceRenderingAmountTaxDisplay { - pub fn as_str(self) -> &'static str { - match self { - CreateInvoiceRenderingAmountTaxDisplay::ExcludeTax => "exclude_tax", - CreateInvoiceRenderingAmountTaxDisplay::IncludeInclusiveTax => "include_inclusive_tax", - } - } -} - -impl AsRef for CreateInvoiceRenderingAmountTaxDisplay { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for CreateInvoiceRenderingAmountTaxDisplay { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for CreateInvoiceRenderingAmountTaxDisplay { - fn default() -> Self { - Self::ExcludeTax - } -} - -/// An enum representing the possible values of an `CreateInvoiceRenderingOptions`'s `amount_tax_display` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CreateInvoiceRenderingOptionsAmountTaxDisplay { - ExcludeTax, - IncludeInclusiveTax, -} - -impl CreateInvoiceRenderingOptionsAmountTaxDisplay { - pub fn as_str(self) -> &'static str { - match self { - CreateInvoiceRenderingOptionsAmountTaxDisplay::ExcludeTax => "exclude_tax", - CreateInvoiceRenderingOptionsAmountTaxDisplay::IncludeInclusiveTax => { - "include_inclusive_tax" - } - } - } -} - -impl AsRef for CreateInvoiceRenderingOptionsAmountTaxDisplay { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for CreateInvoiceRenderingOptionsAmountTaxDisplay { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for CreateInvoiceRenderingOptionsAmountTaxDisplay { - fn default() -> Self { - Self::ExcludeTax - } -} - -/// An enum representing the possible values of an `CreateInvoiceRenderingPdf`'s `page_size` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CreateInvoiceRenderingPdfPageSize { - A4, - Auto, - Letter, -} - -impl CreateInvoiceRenderingPdfPageSize { - pub fn as_str(self) -> &'static str { - match self { - CreateInvoiceRenderingPdfPageSize::A4 => "a4", - CreateInvoiceRenderingPdfPageSize::Auto => "auto", - CreateInvoiceRenderingPdfPageSize::Letter => "letter", - } - } -} - -impl AsRef for CreateInvoiceRenderingPdfPageSize { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for CreateInvoiceRenderingPdfPageSize { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for CreateInvoiceRenderingPdfPageSize { - fn default() -> Self { - Self::A4 - } -} - -/// An enum representing the possible values of an `CreateInvoiceShippingCostShippingRateDataDeliveryEstimateMaximum`'s `unit` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CreateInvoiceShippingCostShippingRateDataDeliveryEstimateMaximumUnit { - BusinessDay, - Day, - Hour, - Month, - Week, -} - -impl CreateInvoiceShippingCostShippingRateDataDeliveryEstimateMaximumUnit { - pub fn as_str(self) -> &'static str { - match self { - CreateInvoiceShippingCostShippingRateDataDeliveryEstimateMaximumUnit::BusinessDay => { - "business_day" - } - CreateInvoiceShippingCostShippingRateDataDeliveryEstimateMaximumUnit::Day => "day", - CreateInvoiceShippingCostShippingRateDataDeliveryEstimateMaximumUnit::Hour => "hour", - CreateInvoiceShippingCostShippingRateDataDeliveryEstimateMaximumUnit::Month => "month", - CreateInvoiceShippingCostShippingRateDataDeliveryEstimateMaximumUnit::Week => "week", - } - } -} - -impl AsRef for CreateInvoiceShippingCostShippingRateDataDeliveryEstimateMaximumUnit { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for CreateInvoiceShippingCostShippingRateDataDeliveryEstimateMaximumUnit { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default - for CreateInvoiceShippingCostShippingRateDataDeliveryEstimateMaximumUnit -{ - fn default() -> Self { - Self::BusinessDay - } -} - -/// An enum representing the possible values of an `CreateInvoiceShippingCostShippingRateDataDeliveryEstimateMinimum`'s `unit` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CreateInvoiceShippingCostShippingRateDataDeliveryEstimateMinimumUnit { - BusinessDay, - Day, - Hour, - Month, - Week, -} - -impl CreateInvoiceShippingCostShippingRateDataDeliveryEstimateMinimumUnit { - pub fn as_str(self) -> &'static str { - match self { - CreateInvoiceShippingCostShippingRateDataDeliveryEstimateMinimumUnit::BusinessDay => { - "business_day" - } - CreateInvoiceShippingCostShippingRateDataDeliveryEstimateMinimumUnit::Day => "day", - CreateInvoiceShippingCostShippingRateDataDeliveryEstimateMinimumUnit::Hour => "hour", - CreateInvoiceShippingCostShippingRateDataDeliveryEstimateMinimumUnit::Month => "month", - CreateInvoiceShippingCostShippingRateDataDeliveryEstimateMinimumUnit::Week => "week", - } - } -} - -impl AsRef for CreateInvoiceShippingCostShippingRateDataDeliveryEstimateMinimumUnit { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for CreateInvoiceShippingCostShippingRateDataDeliveryEstimateMinimumUnit { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default - for CreateInvoiceShippingCostShippingRateDataDeliveryEstimateMinimumUnit -{ - fn default() -> Self { - Self::BusinessDay - } -} - -/// An enum representing the possible values of an `CreateInvoiceShippingCostShippingRateDataFixedAmountCurrencyOptions`'s `tax_behavior` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CreateInvoiceShippingCostShippingRateDataFixedAmountCurrencyOptionsTaxBehavior { - Exclusive, - Inclusive, - Unspecified, -} - -impl CreateInvoiceShippingCostShippingRateDataFixedAmountCurrencyOptionsTaxBehavior { - pub fn as_str(self) -> &'static str { - match self { - CreateInvoiceShippingCostShippingRateDataFixedAmountCurrencyOptionsTaxBehavior::Exclusive => "exclusive", - CreateInvoiceShippingCostShippingRateDataFixedAmountCurrencyOptionsTaxBehavior::Inclusive => "inclusive", - CreateInvoiceShippingCostShippingRateDataFixedAmountCurrencyOptionsTaxBehavior::Unspecified => "unspecified", - } - } -} - -impl AsRef for CreateInvoiceShippingCostShippingRateDataFixedAmountCurrencyOptionsTaxBehavior { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display - for CreateInvoiceShippingCostShippingRateDataFixedAmountCurrencyOptionsTaxBehavior -{ - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default - for CreateInvoiceShippingCostShippingRateDataFixedAmountCurrencyOptionsTaxBehavior -{ - fn default() -> Self { - Self::Exclusive - } -} - -/// An enum representing the possible values of an `CreateInvoiceShippingCostShippingRateData`'s `tax_behavior` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CreateInvoiceShippingCostShippingRateDataTaxBehavior { - Exclusive, - Inclusive, - Unspecified, -} - -impl CreateInvoiceShippingCostShippingRateDataTaxBehavior { - pub fn as_str(self) -> &'static str { - match self { - CreateInvoiceShippingCostShippingRateDataTaxBehavior::Exclusive => "exclusive", - CreateInvoiceShippingCostShippingRateDataTaxBehavior::Inclusive => "inclusive", - CreateInvoiceShippingCostShippingRateDataTaxBehavior::Unspecified => "unspecified", - } - } -} - -impl AsRef for CreateInvoiceShippingCostShippingRateDataTaxBehavior { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for CreateInvoiceShippingCostShippingRateDataTaxBehavior { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for CreateInvoiceShippingCostShippingRateDataTaxBehavior { - fn default() -> Self { - Self::Exclusive - } -} - -/// An enum representing the possible values of an `CreateInvoiceShippingCostShippingRateData`'s `type` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CreateInvoiceShippingCostShippingRateDataType { - FixedAmount, -} - -impl CreateInvoiceShippingCostShippingRateDataType { - pub fn as_str(self) -> &'static str { - match self { - CreateInvoiceShippingCostShippingRateDataType::FixedAmount => "fixed_amount", - } - } -} - -impl AsRef for CreateInvoiceShippingCostShippingRateDataType { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for CreateInvoiceShippingCostShippingRateDataType { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for CreateInvoiceShippingCostShippingRateDataType { - fn default() -> Self { - Self::FixedAmount - } -} - -/// An enum representing the possible values of an `Invoice`'s `billing_reason` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum InvoiceBillingReason { - AutomaticPendingInvoiceItemInvoice, - Manual, - QuoteAccept, - Subscription, - SubscriptionCreate, - SubscriptionCycle, - SubscriptionThreshold, - SubscriptionUpdate, - Upcoming, -} - -impl InvoiceBillingReason { - pub fn as_str(self) -> &'static str { - match self { - InvoiceBillingReason::AutomaticPendingInvoiceItemInvoice => { - "automatic_pending_invoice_item_invoice" - } - InvoiceBillingReason::Manual => "manual", - InvoiceBillingReason::QuoteAccept => "quote_accept", - InvoiceBillingReason::Subscription => "subscription", - InvoiceBillingReason::SubscriptionCreate => "subscription_create", - InvoiceBillingReason::SubscriptionCycle => "subscription_cycle", - InvoiceBillingReason::SubscriptionThreshold => "subscription_threshold", - InvoiceBillingReason::SubscriptionUpdate => "subscription_update", - InvoiceBillingReason::Upcoming => "upcoming", - } - } -} - -impl AsRef for InvoiceBillingReason { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for InvoiceBillingReason { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for InvoiceBillingReason { - fn default() -> Self { - Self::AutomaticPendingInvoiceItemInvoice - } -} - -/// An enum representing the possible values of an `Invoice`'s `customer_tax_exempt` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum InvoiceCustomerTaxExempt { - Exempt, - None, - Reverse, -} - -impl InvoiceCustomerTaxExempt { - pub fn as_str(self) -> &'static str { - match self { - InvoiceCustomerTaxExempt::Exempt => "exempt", - InvoiceCustomerTaxExempt::None => "none", - InvoiceCustomerTaxExempt::Reverse => "reverse", - } - } -} - -impl AsRef for InvoiceCustomerTaxExempt { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for InvoiceCustomerTaxExempt { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for InvoiceCustomerTaxExempt { - fn default() -> Self { - Self::Exempt - } -} - -/// An enum representing the possible values of an `InvoicePaymentMethodOptionsCard`'s `request_three_d_secure` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum InvoicePaymentMethodOptionsCardRequestThreeDSecure { - Any, - Automatic, - Challenge, -} - -impl InvoicePaymentMethodOptionsCardRequestThreeDSecure { - pub fn as_str(self) -> &'static str { - match self { - InvoicePaymentMethodOptionsCardRequestThreeDSecure::Any => "any", - InvoicePaymentMethodOptionsCardRequestThreeDSecure::Automatic => "automatic", - InvoicePaymentMethodOptionsCardRequestThreeDSecure::Challenge => "challenge", - } - } -} - -impl AsRef for InvoicePaymentMethodOptionsCardRequestThreeDSecure { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for InvoicePaymentMethodOptionsCardRequestThreeDSecure { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for InvoicePaymentMethodOptionsCardRequestThreeDSecure { - fn default() -> Self { - Self::Any - } -} - -/// An enum representing the possible values of an `CreateInvoice`'s `pending_invoice_items_behavior` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum InvoicePendingInvoiceItemsBehavior { - Exclude, - Include, - IncludeAndRequire, -} - -impl InvoicePendingInvoiceItemsBehavior { - pub fn as_str(self) -> &'static str { - match self { - InvoicePendingInvoiceItemsBehavior::Exclude => "exclude", - InvoicePendingInvoiceItemsBehavior::Include => "include", - InvoicePendingInvoiceItemsBehavior::IncludeAndRequire => "include_and_require", - } - } -} - -impl AsRef for InvoicePendingInvoiceItemsBehavior { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for InvoicePendingInvoiceItemsBehavior { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for InvoicePendingInvoiceItemsBehavior { - fn default() -> Self { - Self::Exclude - } -} - -/// An enum representing the possible values of an `InvoiceRenderingPdf`'s `page_size` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum InvoiceRenderingPdfPageSize { - A4, - Auto, - Letter, -} - -impl InvoiceRenderingPdfPageSize { - pub fn as_str(self) -> &'static str { - match self { - InvoiceRenderingPdfPageSize::A4 => "a4", - InvoiceRenderingPdfPageSize::Auto => "auto", - InvoiceRenderingPdfPageSize::Letter => "letter", - } - } -} - -impl AsRef for InvoiceRenderingPdfPageSize { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for InvoiceRenderingPdfPageSize { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for InvoiceRenderingPdfPageSize { - fn default() -> Self { - Self::A4 - } -} - -/// An enum representing the possible values of an `Invoice`'s `status` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum InvoiceStatus { - Draft, - Open, - Paid, - Uncollectible, - Void, -} - -impl InvoiceStatus { - pub fn as_str(self) -> &'static str { - match self { - InvoiceStatus::Draft => "draft", - InvoiceStatus::Open => "open", - InvoiceStatus::Paid => "paid", - InvoiceStatus::Uncollectible => "uncollectible", - InvoiceStatus::Void => "void", - } - } -} - -impl AsRef for InvoiceStatus { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for InvoiceStatus { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for InvoiceStatus { - fn default() -> Self { - Self::Draft - } -} - -/// An enum representing the possible values of an `InvoicesPaymentSettings`'s `payment_method_types` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum InvoicesPaymentSettingsPaymentMethodTypes { - AchCreditTransfer, - AchDebit, - AcssDebit, - AuBecsDebit, - BacsDebit, - Bancontact, - Boleto, - Card, - Cashapp, - CustomerBalance, - Eps, - Fpx, - Giropay, - Grabpay, - Ideal, - Konbini, - Link, - P24, - Paynow, - Paypal, - Promptpay, - SepaCreditTransfer, - SepaDebit, - Sofort, - UsBankAccount, - WechatPay, -} - -impl InvoicesPaymentSettingsPaymentMethodTypes { - pub fn as_str(self) -> &'static str { - match self { - InvoicesPaymentSettingsPaymentMethodTypes::AchCreditTransfer => "ach_credit_transfer", - InvoicesPaymentSettingsPaymentMethodTypes::AchDebit => "ach_debit", - InvoicesPaymentSettingsPaymentMethodTypes::AcssDebit => "acss_debit", - InvoicesPaymentSettingsPaymentMethodTypes::AuBecsDebit => "au_becs_debit", - InvoicesPaymentSettingsPaymentMethodTypes::BacsDebit => "bacs_debit", - InvoicesPaymentSettingsPaymentMethodTypes::Bancontact => "bancontact", - InvoicesPaymentSettingsPaymentMethodTypes::Boleto => "boleto", - InvoicesPaymentSettingsPaymentMethodTypes::Card => "card", - InvoicesPaymentSettingsPaymentMethodTypes::Cashapp => "cashapp", - InvoicesPaymentSettingsPaymentMethodTypes::CustomerBalance => "customer_balance", - InvoicesPaymentSettingsPaymentMethodTypes::Eps => "eps", - InvoicesPaymentSettingsPaymentMethodTypes::Fpx => "fpx", - InvoicesPaymentSettingsPaymentMethodTypes::Giropay => "giropay", - InvoicesPaymentSettingsPaymentMethodTypes::Grabpay => "grabpay", - InvoicesPaymentSettingsPaymentMethodTypes::Ideal => "ideal", - InvoicesPaymentSettingsPaymentMethodTypes::Konbini => "konbini", - InvoicesPaymentSettingsPaymentMethodTypes::Link => "link", - InvoicesPaymentSettingsPaymentMethodTypes::P24 => "p24", - InvoicesPaymentSettingsPaymentMethodTypes::Paynow => "paynow", - InvoicesPaymentSettingsPaymentMethodTypes::Paypal => "paypal", - InvoicesPaymentSettingsPaymentMethodTypes::Promptpay => "promptpay", - InvoicesPaymentSettingsPaymentMethodTypes::SepaCreditTransfer => "sepa_credit_transfer", - InvoicesPaymentSettingsPaymentMethodTypes::SepaDebit => "sepa_debit", - InvoicesPaymentSettingsPaymentMethodTypes::Sofort => "sofort", - InvoicesPaymentSettingsPaymentMethodTypes::UsBankAccount => "us_bank_account", - InvoicesPaymentSettingsPaymentMethodTypes::WechatPay => "wechat_pay", - } - } -} - -impl AsRef for InvoicesPaymentSettingsPaymentMethodTypes { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for InvoicesPaymentSettingsPaymentMethodTypes { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for InvoicesPaymentSettingsPaymentMethodTypes { - fn default() -> Self { - Self::AchCreditTransfer - } -} - -/// An enum representing the possible values of an `TaxAmount`'s `taxability_reason` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum TaxAmountTaxabilityReason { - CustomerExempt, - NotCollecting, - NotSubjectToTax, - NotSupported, - PortionProductExempt, - PortionReducedRated, - PortionStandardRated, - ProductExempt, - ProductExemptHoliday, - ProportionallyRated, - ReducedRated, - ReverseCharge, - StandardRated, - TaxableBasisReduced, - ZeroRated, -} - -impl TaxAmountTaxabilityReason { - pub fn as_str(self) -> &'static str { - match self { - TaxAmountTaxabilityReason::CustomerExempt => "customer_exempt", - TaxAmountTaxabilityReason::NotCollecting => "not_collecting", - TaxAmountTaxabilityReason::NotSubjectToTax => "not_subject_to_tax", - TaxAmountTaxabilityReason::NotSupported => "not_supported", - TaxAmountTaxabilityReason::PortionProductExempt => "portion_product_exempt", - TaxAmountTaxabilityReason::PortionReducedRated => "portion_reduced_rated", - TaxAmountTaxabilityReason::PortionStandardRated => "portion_standard_rated", - TaxAmountTaxabilityReason::ProductExempt => "product_exempt", - TaxAmountTaxabilityReason::ProductExemptHoliday => "product_exempt_holiday", - TaxAmountTaxabilityReason::ProportionallyRated => "proportionally_rated", - TaxAmountTaxabilityReason::ReducedRated => "reduced_rated", - TaxAmountTaxabilityReason::ReverseCharge => "reverse_charge", - TaxAmountTaxabilityReason::StandardRated => "standard_rated", - TaxAmountTaxabilityReason::TaxableBasisReduced => "taxable_basis_reduced", - TaxAmountTaxabilityReason::ZeroRated => "zero_rated", - } - } -} - -impl AsRef for TaxAmountTaxabilityReason { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for TaxAmountTaxabilityReason { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for TaxAmountTaxabilityReason { - fn default() -> Self { - Self::CustomerExempt - } -} - -/// An enum representing the possible values of an `InvoicesResourceInvoiceTaxId`'s `type` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum TaxIdType { - AdNrt, - AeTrn, - ArCuit, - AuAbn, - AuArn, - BgUic, - BoTin, - BrCnpj, - BrCpf, - CaBn, - CaGstHst, - CaPstBc, - CaPstMb, - CaPstSk, - CaQst, - ChVat, - ClTin, - CnTin, - CoNit, - CrTin, - DoRcn, - EcRuc, - EgTin, - EsCif, - EuOssVat, - EuVat, - GbVat, - GeVat, - HkBr, - HuTin, - IdNpwp, - IlVat, - InGst, - IsVat, - JpCn, - JpRn, - JpTrn, - KePin, - KrBrn, - LiUid, - MxRfc, - MyFrp, - MyItn, - MySst, - NoVat, - NzGst, - PeRuc, - PhTin, - RoTin, - RsPib, - RuInn, - RuKpp, - SaVat, - SgGst, - SgUen, - SiTin, - SvNit, - ThVat, - TrTin, - TwVat, - UaVat, - Unknown, - UsEin, - UyRuc, - VeRif, - VnTin, - ZaVat, -} - -impl TaxIdType { - pub fn as_str(self) -> &'static str { - match self { - TaxIdType::AdNrt => "ad_nrt", - TaxIdType::AeTrn => "ae_trn", - TaxIdType::ArCuit => "ar_cuit", - TaxIdType::AuAbn => "au_abn", - TaxIdType::AuArn => "au_arn", - TaxIdType::BgUic => "bg_uic", - TaxIdType::BoTin => "bo_tin", - TaxIdType::BrCnpj => "br_cnpj", - TaxIdType::BrCpf => "br_cpf", - TaxIdType::CaBn => "ca_bn", - TaxIdType::CaGstHst => "ca_gst_hst", - TaxIdType::CaPstBc => "ca_pst_bc", - TaxIdType::CaPstMb => "ca_pst_mb", - TaxIdType::CaPstSk => "ca_pst_sk", - TaxIdType::CaQst => "ca_qst", - TaxIdType::ChVat => "ch_vat", - TaxIdType::ClTin => "cl_tin", - TaxIdType::CnTin => "cn_tin", - TaxIdType::CoNit => "co_nit", - TaxIdType::CrTin => "cr_tin", - TaxIdType::DoRcn => "do_rcn", - TaxIdType::EcRuc => "ec_ruc", - TaxIdType::EgTin => "eg_tin", - TaxIdType::EsCif => "es_cif", - TaxIdType::EuOssVat => "eu_oss_vat", - TaxIdType::EuVat => "eu_vat", - TaxIdType::GbVat => "gb_vat", - TaxIdType::GeVat => "ge_vat", - TaxIdType::HkBr => "hk_br", - TaxIdType::HuTin => "hu_tin", - TaxIdType::IdNpwp => "id_npwp", - TaxIdType::IlVat => "il_vat", - TaxIdType::InGst => "in_gst", - TaxIdType::IsVat => "is_vat", - TaxIdType::JpCn => "jp_cn", - TaxIdType::JpRn => "jp_rn", - TaxIdType::JpTrn => "jp_trn", - TaxIdType::KePin => "ke_pin", - TaxIdType::KrBrn => "kr_brn", - TaxIdType::LiUid => "li_uid", - TaxIdType::MxRfc => "mx_rfc", - TaxIdType::MyFrp => "my_frp", - TaxIdType::MyItn => "my_itn", - TaxIdType::MySst => "my_sst", - TaxIdType::NoVat => "no_vat", - TaxIdType::NzGst => "nz_gst", - TaxIdType::PeRuc => "pe_ruc", - TaxIdType::PhTin => "ph_tin", - TaxIdType::RoTin => "ro_tin", - TaxIdType::RsPib => "rs_pib", - TaxIdType::RuInn => "ru_inn", - TaxIdType::RuKpp => "ru_kpp", - TaxIdType::SaVat => "sa_vat", - TaxIdType::SgGst => "sg_gst", - TaxIdType::SgUen => "sg_uen", - TaxIdType::SiTin => "si_tin", - TaxIdType::SvNit => "sv_nit", - TaxIdType::ThVat => "th_vat", - TaxIdType::TrTin => "tr_tin", - TaxIdType::TwVat => "tw_vat", - TaxIdType::UaVat => "ua_vat", - TaxIdType::Unknown => "unknown", - TaxIdType::UsEin => "us_ein", - TaxIdType::UyRuc => "uy_ruc", - TaxIdType::VeRif => "ve_rif", - TaxIdType::VnTin => "vn_tin", - TaxIdType::ZaVat => "za_vat", - } - } -} - -impl AsRef for TaxIdType { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for TaxIdType { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for TaxIdType { - fn default() -> Self { - Self::AdNrt - } -} diff --git a/src/resources/generated/invoice_created.rs b/src/resources/generated/invoice_created.rs deleted file mode 100644 index 294337c1a..000000000 --- a/src/resources/generated/invoice_created.rs +++ /dev/null @@ -1,10 +0,0 @@ -// ====================================== -// This file was automatically generated. -// ====================================== - -use serde::{Deserialize, Serialize}; - -/// The resource representing a Stripe "invoice.created". -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct InvoiceCreated { -} diff --git a/src/resources/generated/invoice_deleted.rs b/src/resources/generated/invoice_deleted.rs deleted file mode 100644 index b587d5a8d..000000000 --- a/src/resources/generated/invoice_deleted.rs +++ /dev/null @@ -1,10 +0,0 @@ -// ====================================== -// This file was automatically generated. -// ====================================== - -use serde::{Deserialize, Serialize}; - -/// The resource representing a Stripe "invoice.deleted". -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct InvoiceDeleted { -} diff --git a/src/resources/generated/invoice_finalization_failed.rs b/src/resources/generated/invoice_finalization_failed.rs deleted file mode 100644 index e491d782d..000000000 --- a/src/resources/generated/invoice_finalization_failed.rs +++ /dev/null @@ -1,10 +0,0 @@ -// ====================================== -// This file was automatically generated. -// ====================================== - -use serde::{Deserialize, Serialize}; - -/// The resource representing a Stripe "invoice.finalization_failed". -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct InvoiceFinalizationFailed { -} diff --git a/src/resources/generated/invoice_finalized.rs b/src/resources/generated/invoice_finalized.rs deleted file mode 100644 index 802a1713b..000000000 --- a/src/resources/generated/invoice_finalized.rs +++ /dev/null @@ -1,10 +0,0 @@ -// ====================================== -// This file was automatically generated. -// ====================================== - -use serde::{Deserialize, Serialize}; - -/// The resource representing a Stripe "invoice.finalized". -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct InvoiceFinalized { -} diff --git a/src/resources/generated/invoice_marked_uncollectible.rs b/src/resources/generated/invoice_marked_uncollectible.rs deleted file mode 100644 index 06f3de974..000000000 --- a/src/resources/generated/invoice_marked_uncollectible.rs +++ /dev/null @@ -1,10 +0,0 @@ -// ====================================== -// This file was automatically generated. -// ====================================== - -use serde::{Deserialize, Serialize}; - -/// The resource representing a Stripe "invoice.marked_uncollectible". -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct InvoiceMarkedUncollectible { -} diff --git a/src/resources/generated/invoice_paid.rs b/src/resources/generated/invoice_paid.rs deleted file mode 100644 index 1b8751dd2..000000000 --- a/src/resources/generated/invoice_paid.rs +++ /dev/null @@ -1,10 +0,0 @@ -// ====================================== -// This file was automatically generated. -// ====================================== - -use serde::{Deserialize, Serialize}; - -/// The resource representing a Stripe "invoice.paid". -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct InvoicePaid { -} diff --git a/src/resources/generated/invoice_payment_action_required.rs b/src/resources/generated/invoice_payment_action_required.rs deleted file mode 100644 index 33147b733..000000000 --- a/src/resources/generated/invoice_payment_action_required.rs +++ /dev/null @@ -1,10 +0,0 @@ -// ====================================== -// This file was automatically generated. -// ====================================== - -use serde::{Deserialize, Serialize}; - -/// The resource representing a Stripe "invoice.payment_action_required". -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct InvoicePaymentActionRequired { -} diff --git a/src/resources/generated/invoice_payment_failed.rs b/src/resources/generated/invoice_payment_failed.rs deleted file mode 100644 index e68287540..000000000 --- a/src/resources/generated/invoice_payment_failed.rs +++ /dev/null @@ -1,10 +0,0 @@ -// ====================================== -// This file was automatically generated. -// ====================================== - -use serde::{Deserialize, Serialize}; - -/// The resource representing a Stripe "invoice.payment_failed". -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct InvoicePaymentFailed { -} diff --git a/src/resources/generated/invoice_payment_method_options_acss_debit.rs b/src/resources/generated/invoice_payment_method_options_acss_debit.rs deleted file mode 100644 index b94d1fe29..000000000 --- a/src/resources/generated/invoice_payment_method_options_acss_debit.rs +++ /dev/null @@ -1,98 +0,0 @@ -// ====================================== -// This file was automatically generated. -// ====================================== - -use serde::{Deserialize, Serialize}; - -/// The resource representing a Stripe "invoice_payment_method_options_acss_debit". -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct InvoicePaymentMethodOptionsAcssDebit { - #[serde(skip_serializing_if = "Option::is_none")] - pub mandate_options: Option, - - /// Bank account verification method. - #[serde(skip_serializing_if = "Option::is_none")] - pub verification_method: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct InvoicePaymentMethodOptionsAcssDebitMandateOptions { - /// Transaction type of the mandate. - pub transaction_type: Option, -} - -/// An enum representing the possible values of an `InvoicePaymentMethodOptionsAcssDebitMandateOptions`'s `transaction_type` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum InvoicePaymentMethodOptionsAcssDebitMandateOptionsTransactionType { - Business, - Personal, -} - -impl InvoicePaymentMethodOptionsAcssDebitMandateOptionsTransactionType { - pub fn as_str(self) -> &'static str { - match self { - InvoicePaymentMethodOptionsAcssDebitMandateOptionsTransactionType::Business => { - "business" - } - InvoicePaymentMethodOptionsAcssDebitMandateOptionsTransactionType::Personal => { - "personal" - } - } - } -} - -impl AsRef for InvoicePaymentMethodOptionsAcssDebitMandateOptionsTransactionType { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for InvoicePaymentMethodOptionsAcssDebitMandateOptionsTransactionType { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for InvoicePaymentMethodOptionsAcssDebitMandateOptionsTransactionType { - fn default() -> Self { - Self::Business - } -} - -/// An enum representing the possible values of an `InvoicePaymentMethodOptionsAcssDebit`'s `verification_method` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum InvoicePaymentMethodOptionsAcssDebitVerificationMethod { - Automatic, - Instant, - Microdeposits, -} - -impl InvoicePaymentMethodOptionsAcssDebitVerificationMethod { - pub fn as_str(self) -> &'static str { - match self { - InvoicePaymentMethodOptionsAcssDebitVerificationMethod::Automatic => "automatic", - InvoicePaymentMethodOptionsAcssDebitVerificationMethod::Instant => "instant", - InvoicePaymentMethodOptionsAcssDebitVerificationMethod::Microdeposits => { - "microdeposits" - } - } - } -} - -impl AsRef for InvoicePaymentMethodOptionsAcssDebitVerificationMethod { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for InvoicePaymentMethodOptionsAcssDebitVerificationMethod { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for InvoicePaymentMethodOptionsAcssDebitVerificationMethod { - fn default() -> Self { - Self::Automatic - } -} diff --git a/src/resources/generated/invoice_payment_method_options_bancontact.rs b/src/resources/generated/invoice_payment_method_options_bancontact.rs deleted file mode 100644 index 0790a6dd8..000000000 --- a/src/resources/generated/invoice_payment_method_options_bancontact.rs +++ /dev/null @@ -1,50 +0,0 @@ -// ====================================== -// This file was automatically generated. -// ====================================== - -use serde::{Deserialize, Serialize}; - -/// The resource representing a Stripe "invoice_payment_method_options_bancontact". -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct InvoicePaymentMethodOptionsBancontact { - /// Preferred language of the Bancontact authorization page that the customer is redirected to. - pub preferred_language: InvoicePaymentMethodOptionsBancontactPreferredLanguage, -} - -/// An enum representing the possible values of an `InvoicePaymentMethodOptionsBancontact`'s `preferred_language` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum InvoicePaymentMethodOptionsBancontactPreferredLanguage { - De, - En, - Fr, - Nl, -} - -impl InvoicePaymentMethodOptionsBancontactPreferredLanguage { - pub fn as_str(self) -> &'static str { - match self { - InvoicePaymentMethodOptionsBancontactPreferredLanguage::De => "de", - InvoicePaymentMethodOptionsBancontactPreferredLanguage::En => "en", - InvoicePaymentMethodOptionsBancontactPreferredLanguage::Fr => "fr", - InvoicePaymentMethodOptionsBancontactPreferredLanguage::Nl => "nl", - } - } -} - -impl AsRef for InvoicePaymentMethodOptionsBancontactPreferredLanguage { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for InvoicePaymentMethodOptionsBancontactPreferredLanguage { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for InvoicePaymentMethodOptionsBancontactPreferredLanguage { - fn default() -> Self { - Self::De - } -} diff --git a/src/resources/generated/invoice_payment_method_options_customer_balance.rs b/src/resources/generated/invoice_payment_method_options_customer_balance.rs deleted file mode 100644 index f170a5e7a..000000000 --- a/src/resources/generated/invoice_payment_method_options_customer_balance.rs +++ /dev/null @@ -1,122 +0,0 @@ -// ====================================== -// This file was automatically generated. -// ====================================== - -use serde::{Deserialize, Serialize}; - -/// The resource representing a Stripe "invoice_payment_method_options_customer_balance". -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct InvoicePaymentMethodOptionsCustomerBalance { - #[serde(skip_serializing_if = "Option::is_none")] - pub bank_transfer: Option, - - /// The funding method type to be used when there are not enough funds in the customer balance. - /// - /// Permitted values include: `bank_transfer`. - pub funding_type: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct InvoicePaymentMethodOptionsCustomerBalanceBankTransfer { - #[serde(skip_serializing_if = "Option::is_none")] - pub eu_bank_transfer: - Option, - - /// The bank transfer type that can be used for funding. - /// - /// Permitted values include: `eu_bank_transfer`, `gb_bank_transfer`, `jp_bank_transfer`, `mx_bank_transfer`, or `us_bank_transfer`. - #[serde(rename = "type")] - pub type_: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct InvoicePaymentMethodOptionsCustomerBalanceBankTransferEuBankTransfer { - /// The desired country code of the bank account information. - /// - /// Permitted values include: `BE`, `DE`, `ES`, `FR`, `IE`, or `NL`. - pub country: InvoicePaymentMethodOptionsCustomerBalanceBankTransferEuBankTransferCountry, -} - -/// An enum representing the possible values of an `InvoicePaymentMethodOptionsCustomerBalanceBankTransferEuBankTransfer`'s `country` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum InvoicePaymentMethodOptionsCustomerBalanceBankTransferEuBankTransferCountry { - #[serde(rename = "BE")] - Be, - #[serde(rename = "DE")] - De, - #[serde(rename = "ES")] - Es, - #[serde(rename = "FR")] - Fr, - #[serde(rename = "IE")] - Ie, - #[serde(rename = "NL")] - Nl, -} - -impl InvoicePaymentMethodOptionsCustomerBalanceBankTransferEuBankTransferCountry { - pub fn as_str(self) -> &'static str { - match self { - InvoicePaymentMethodOptionsCustomerBalanceBankTransferEuBankTransferCountry::Be => "BE", - InvoicePaymentMethodOptionsCustomerBalanceBankTransferEuBankTransferCountry::De => "DE", - InvoicePaymentMethodOptionsCustomerBalanceBankTransferEuBankTransferCountry::Es => "ES", - InvoicePaymentMethodOptionsCustomerBalanceBankTransferEuBankTransferCountry::Fr => "FR", - InvoicePaymentMethodOptionsCustomerBalanceBankTransferEuBankTransferCountry::Ie => "IE", - InvoicePaymentMethodOptionsCustomerBalanceBankTransferEuBankTransferCountry::Nl => "NL", - } - } -} - -impl AsRef for InvoicePaymentMethodOptionsCustomerBalanceBankTransferEuBankTransferCountry { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display - for InvoicePaymentMethodOptionsCustomerBalanceBankTransferEuBankTransferCountry -{ - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default - for InvoicePaymentMethodOptionsCustomerBalanceBankTransferEuBankTransferCountry -{ - fn default() -> Self { - Self::Be - } -} - -/// An enum representing the possible values of an `InvoicePaymentMethodOptionsCustomerBalance`'s `funding_type` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum InvoicePaymentMethodOptionsCustomerBalanceFundingType { - BankTransfer, -} - -impl InvoicePaymentMethodOptionsCustomerBalanceFundingType { - pub fn as_str(self) -> &'static str { - match self { - InvoicePaymentMethodOptionsCustomerBalanceFundingType::BankTransfer => "bank_transfer", - } - } -} - -impl AsRef for InvoicePaymentMethodOptionsCustomerBalanceFundingType { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for InvoicePaymentMethodOptionsCustomerBalanceFundingType { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for InvoicePaymentMethodOptionsCustomerBalanceFundingType { - fn default() -> Self { - Self::BankTransfer - } -} diff --git a/src/resources/generated/invoice_payment_method_options_konbini.rs b/src/resources/generated/invoice_payment_method_options_konbini.rs deleted file mode 100644 index 87f7350d0..000000000 --- a/src/resources/generated/invoice_payment_method_options_konbini.rs +++ /dev/null @@ -1,9 +0,0 @@ -// ====================================== -// This file was automatically generated. -// ====================================== - -use serde::{Deserialize, Serialize}; - -/// The resource representing a Stripe "invoice_payment_method_options_konbini". -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct InvoicePaymentMethodOptionsKonbini {} diff --git a/src/resources/generated/invoice_payment_method_options_us_bank_account.rs b/src/resources/generated/invoice_payment_method_options_us_bank_account.rs deleted file mode 100644 index 5f47067a2..000000000 --- a/src/resources/generated/invoice_payment_method_options_us_bank_account.rs +++ /dev/null @@ -1,145 +0,0 @@ -// ====================================== -// This file was automatically generated. -// ====================================== - -use serde::{Deserialize, Serialize}; - -/// The resource representing a Stripe "invoice_payment_method_options_us_bank_account". -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct InvoicePaymentMethodOptionsUsBankAccount { - #[serde(skip_serializing_if = "Option::is_none")] - pub financial_connections: Option, - - /// Bank account verification method. - #[serde(skip_serializing_if = "Option::is_none")] - pub verification_method: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct InvoicePaymentMethodOptionsUsBankAccountLinkedAccountOptions { - /// The list of permissions to request. - /// - /// The `payment_method` permission must be included. - #[serde(skip_serializing_if = "Option::is_none")] - pub permissions: - Option>, - - /// Data features requested to be retrieved upon account creation. - pub prefetch: Option>, -} - -/// An enum representing the possible values of an `InvoicePaymentMethodOptionsUsBankAccountLinkedAccountOptions`'s `permissions` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum InvoicePaymentMethodOptionsUsBankAccountLinkedAccountOptionsPermissions { - Balances, - PaymentMethod, - Transactions, -} - -impl InvoicePaymentMethodOptionsUsBankAccountLinkedAccountOptionsPermissions { - pub fn as_str(self) -> &'static str { - match self { - InvoicePaymentMethodOptionsUsBankAccountLinkedAccountOptionsPermissions::Balances => "balances", - InvoicePaymentMethodOptionsUsBankAccountLinkedAccountOptionsPermissions::PaymentMethod => "payment_method", - InvoicePaymentMethodOptionsUsBankAccountLinkedAccountOptionsPermissions::Transactions => "transactions", - } - } -} - -impl AsRef for InvoicePaymentMethodOptionsUsBankAccountLinkedAccountOptionsPermissions { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for InvoicePaymentMethodOptionsUsBankAccountLinkedAccountOptionsPermissions { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default - for InvoicePaymentMethodOptionsUsBankAccountLinkedAccountOptionsPermissions -{ - fn default() -> Self { - Self::Balances - } -} - -/// An enum representing the possible values of an `InvoicePaymentMethodOptionsUsBankAccountLinkedAccountOptions`'s `prefetch` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum InvoicePaymentMethodOptionsUsBankAccountLinkedAccountOptionsPrefetch { - Balances, - Transactions, -} - -impl InvoicePaymentMethodOptionsUsBankAccountLinkedAccountOptionsPrefetch { - pub fn as_str(self) -> &'static str { - match self { - InvoicePaymentMethodOptionsUsBankAccountLinkedAccountOptionsPrefetch::Balances => { - "balances" - } - InvoicePaymentMethodOptionsUsBankAccountLinkedAccountOptionsPrefetch::Transactions => { - "transactions" - } - } - } -} - -impl AsRef for InvoicePaymentMethodOptionsUsBankAccountLinkedAccountOptionsPrefetch { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for InvoicePaymentMethodOptionsUsBankAccountLinkedAccountOptionsPrefetch { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default - for InvoicePaymentMethodOptionsUsBankAccountLinkedAccountOptionsPrefetch -{ - fn default() -> Self { - Self::Balances - } -} - -/// An enum representing the possible values of an `InvoicePaymentMethodOptionsUsBankAccount`'s `verification_method` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum InvoicePaymentMethodOptionsUsBankAccountVerificationMethod { - Automatic, - Instant, - Microdeposits, -} - -impl InvoicePaymentMethodOptionsUsBankAccountVerificationMethod { - pub fn as_str(self) -> &'static str { - match self { - InvoicePaymentMethodOptionsUsBankAccountVerificationMethod::Automatic => "automatic", - InvoicePaymentMethodOptionsUsBankAccountVerificationMethod::Instant => "instant", - InvoicePaymentMethodOptionsUsBankAccountVerificationMethod::Microdeposits => { - "microdeposits" - } - } - } -} - -impl AsRef for InvoicePaymentMethodOptionsUsBankAccountVerificationMethod { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for InvoicePaymentMethodOptionsUsBankAccountVerificationMethod { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for InvoicePaymentMethodOptionsUsBankAccountVerificationMethod { - fn default() -> Self { - Self::Automatic - } -} diff --git a/src/resources/generated/invoice_payment_succeeded.rs b/src/resources/generated/invoice_payment_succeeded.rs deleted file mode 100644 index 9c1112463..000000000 --- a/src/resources/generated/invoice_payment_succeeded.rs +++ /dev/null @@ -1,10 +0,0 @@ -// ====================================== -// This file was automatically generated. -// ====================================== - -use serde::{Deserialize, Serialize}; - -/// The resource representing a Stripe "invoice.payment_succeeded". -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct InvoicePaymentSucceeded { -} diff --git a/src/resources/generated/invoice_sent.rs b/src/resources/generated/invoice_sent.rs deleted file mode 100644 index 8ea535ea9..000000000 --- a/src/resources/generated/invoice_sent.rs +++ /dev/null @@ -1,10 +0,0 @@ -// ====================================== -// This file was automatically generated. -// ====================================== - -use serde::{Deserialize, Serialize}; - -/// The resource representing a Stripe "invoice.sent". -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct InvoiceSent { -} diff --git a/src/resources/generated/invoice_setting_rendering_options.rs b/src/resources/generated/invoice_setting_rendering_options.rs deleted file mode 100644 index 282332dfc..000000000 --- a/src/resources/generated/invoice_setting_rendering_options.rs +++ /dev/null @@ -1,12 +0,0 @@ -// ====================================== -// This file was automatically generated. -// ====================================== - -use serde::{Deserialize, Serialize}; - -/// The resource representing a Stripe "InvoiceSettingRenderingOptions". -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct InvoiceSettingRenderingOptions { - /// How line-item prices and amounts will be displayed with respect to tax on invoice PDFs. - pub amount_tax_display: Option, -} diff --git a/src/resources/generated/invoice_upcoming.rs b/src/resources/generated/invoice_upcoming.rs deleted file mode 100644 index 198adc223..000000000 --- a/src/resources/generated/invoice_upcoming.rs +++ /dev/null @@ -1,10 +0,0 @@ -// ====================================== -// This file was automatically generated. -// ====================================== - -use serde::{Deserialize, Serialize}; - -/// The resource representing a Stripe "invoice.upcoming". -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct InvoiceUpcoming { -} diff --git a/src/resources/generated/invoice_updated.rs b/src/resources/generated/invoice_updated.rs deleted file mode 100644 index 4e865fcf8..000000000 --- a/src/resources/generated/invoice_updated.rs +++ /dev/null @@ -1,10 +0,0 @@ -// ====================================== -// This file was automatically generated. -// ====================================== - -use serde::{Deserialize, Serialize}; - -/// The resource representing a Stripe "invoice.updated". -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct InvoiceUpdated { -} diff --git a/src/resources/generated/invoice_voided.rs b/src/resources/generated/invoice_voided.rs deleted file mode 100644 index 8de779135..000000000 --- a/src/resources/generated/invoice_voided.rs +++ /dev/null @@ -1,10 +0,0 @@ -// ====================================== -// This file was automatically generated. -// ====================================== - -use serde::{Deserialize, Serialize}; - -/// The resource representing a Stripe "invoice.voided". -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct InvoiceVoided { -} diff --git a/src/resources/generated/invoiceitem_created.rs b/src/resources/generated/invoiceitem_created.rs deleted file mode 100644 index 569a0f2a4..000000000 --- a/src/resources/generated/invoiceitem_created.rs +++ /dev/null @@ -1,10 +0,0 @@ -// ====================================== -// This file was automatically generated. -// ====================================== - -use serde::{Deserialize, Serialize}; - -/// The resource representing a Stripe "invoiceitem.created". -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct InvoiceitemCreated { -} diff --git a/src/resources/generated/invoiceitem_deleted.rs b/src/resources/generated/invoiceitem_deleted.rs deleted file mode 100644 index 8cffca6de..000000000 --- a/src/resources/generated/invoiceitem_deleted.rs +++ /dev/null @@ -1,10 +0,0 @@ -// ====================================== -// This file was automatically generated. -// ====================================== - -use serde::{Deserialize, Serialize}; - -/// The resource representing a Stripe "invoiceitem.deleted". -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct InvoiceitemDeleted { -} diff --git a/src/resources/generated/invoices_shipping_cost.rs b/src/resources/generated/invoices_shipping_cost.rs deleted file mode 100644 index c2ab9c430..000000000 --- a/src/resources/generated/invoices_shipping_cost.rs +++ /dev/null @@ -1,106 +0,0 @@ -// ====================================== -// This file was automatically generated. -// ====================================== - -use serde::{Deserialize, Serialize}; - -use crate::params::Expandable; -use crate::resources::{ShippingRate, TaxRate}; - -/// The resource representing a Stripe "InvoicesShippingCost". -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct InvoicesShippingCost { - /// Total shipping cost before any taxes are applied. - pub amount_subtotal: i64, - - /// Total tax amount applied due to shipping costs. - /// - /// If no tax was applied, defaults to 0. - pub amount_tax: i64, - - /// Total shipping cost after taxes are applied. - pub amount_total: i64, - - /// The ID of the ShippingRate for this invoice. - pub shipping_rate: Option>, - - /// The taxes applied to the shipping rate. - #[serde(skip_serializing_if = "Option::is_none")] - pub taxes: Option>, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct LineItemsTaxAmount { - /// Amount of tax applied for this rate. - pub amount: i64, - - pub rate: TaxRate, - - /// The reasoning behind this tax, for example, if the product is tax exempt. - /// - /// The possible values for this field may be extended as new tax rules are supported. - pub taxability_reason: Option, - - /// The amount on which tax is calculated, in cents (or local equivalent). - pub taxable_amount: Option, -} - -/// An enum representing the possible values of an `LineItemsTaxAmount`'s `taxability_reason` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum LineItemsTaxAmountTaxabilityReason { - CustomerExempt, - NotCollecting, - NotSubjectToTax, - NotSupported, - PortionProductExempt, - PortionReducedRated, - PortionStandardRated, - ProductExempt, - ProductExemptHoliday, - ProportionallyRated, - ReducedRated, - ReverseCharge, - StandardRated, - TaxableBasisReduced, - ZeroRated, -} - -impl LineItemsTaxAmountTaxabilityReason { - pub fn as_str(self) -> &'static str { - match self { - LineItemsTaxAmountTaxabilityReason::CustomerExempt => "customer_exempt", - LineItemsTaxAmountTaxabilityReason::NotCollecting => "not_collecting", - LineItemsTaxAmountTaxabilityReason::NotSubjectToTax => "not_subject_to_tax", - LineItemsTaxAmountTaxabilityReason::NotSupported => "not_supported", - LineItemsTaxAmountTaxabilityReason::PortionProductExempt => "portion_product_exempt", - LineItemsTaxAmountTaxabilityReason::PortionReducedRated => "portion_reduced_rated", - LineItemsTaxAmountTaxabilityReason::PortionStandardRated => "portion_standard_rated", - LineItemsTaxAmountTaxabilityReason::ProductExempt => "product_exempt", - LineItemsTaxAmountTaxabilityReason::ProductExemptHoliday => "product_exempt_holiday", - LineItemsTaxAmountTaxabilityReason::ProportionallyRated => "proportionally_rated", - LineItemsTaxAmountTaxabilityReason::ReducedRated => "reduced_rated", - LineItemsTaxAmountTaxabilityReason::ReverseCharge => "reverse_charge", - LineItemsTaxAmountTaxabilityReason::StandardRated => "standard_rated", - LineItemsTaxAmountTaxabilityReason::TaxableBasisReduced => "taxable_basis_reduced", - LineItemsTaxAmountTaxabilityReason::ZeroRated => "zero_rated", - } - } -} - -impl AsRef for LineItemsTaxAmountTaxabilityReason { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for LineItemsTaxAmountTaxabilityReason { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for LineItemsTaxAmountTaxabilityReason { - fn default() -> Self { - Self::CustomerExempt - } -} diff --git a/src/resources/generated/issuing_authorization.rs b/src/resources/generated/issuing_authorization.rs deleted file mode 100644 index 38250fa0a..000000000 --- a/src/resources/generated/issuing_authorization.rs +++ /dev/null @@ -1,438 +0,0 @@ -// ====================================== -// This file was automatically generated. -// ====================================== - -use serde::{Deserialize, Serialize}; - -use crate::ids::IssuingAuthorizationId; -use crate::params::{Expandable, Metadata, Object, Timestamp}; -use crate::resources::{ - BalanceTransaction, Currency, IssuingAuthorizationAmountDetails, IssuingAuthorizationCheck, - IssuingAuthorizationMethod, IssuingAuthorizationReason, IssuingCard, IssuingCardholder, - IssuingToken, IssuingTransaction, MerchantData, -}; - -/// The resource representing a Stripe "IssuingAuthorization". -/// -/// For more details see -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct IssuingAuthorization { - /// Unique identifier for the object. - pub id: IssuingAuthorizationId, - - /// The total amount that was authorized or rejected. - /// - /// This amount is in `currency` and in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal). - /// `amount` should be the same as `merchant_amount`, unless `currency` and `merchant_currency` are different. - pub amount: i64, - - /// Detailed breakdown of amount components. - /// - /// These amounts are denominated in `currency` and in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal). - pub amount_details: Option, - - /// Whether the authorization has been approved. - pub approved: bool, - - /// How the card details were provided. - pub authorization_method: IssuingAuthorizationMethod, - - /// List of balance transactions associated with this authorization. - pub balance_transactions: Vec, - - pub card: IssuingCard, - - /// The cardholder to whom this authorization belongs. - pub cardholder: Option>, - - /// Time at which the object was created. - /// - /// Measured in seconds since the Unix epoch. - pub created: Timestamp, - - /// The currency of the cardholder. - /// - /// This currency can be different from the currency presented at authorization and the `merchant_currency` field on this authorization. - /// Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. - /// Must be a [supported currency](https://stripe.com/docs/currencies). - pub currency: Currency, - - /// Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. - pub livemode: bool, - - /// The total amount that was authorized or rejected. - /// - /// This amount is in the `merchant_currency` and in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal). - /// `merchant_amount` should be the same as `amount`, unless `merchant_currency` and `currency` are different. - pub merchant_amount: i64, - - /// The local currency that was presented to the cardholder for the authorization. - /// - /// This currency can be different from the cardholder currency and the `currency` field on this authorization. - /// Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. - /// Must be a [supported currency](https://stripe.com/docs/currencies). - pub merchant_currency: Currency, - - pub merchant_data: MerchantData, - - /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. - /// - /// This can be useful for storing additional information about the object in a structured format. - pub metadata: Metadata, - - /// Details about the authorization, such as identifiers, set by the card network. - pub network_data: Option, - - /// The pending authorization request. - /// - /// This field will only be non-null during an `issuing_authorization.request` webhook. - pub pending_request: Option, - - /// History of every time a `pending_request` authorization was approved/declined, either by you directly or by Stripe (e.g. - /// - /// based on your spending_controls). - /// If the merchant changes the authorization by performing an incremental authorization, you can look at this field to see the previous requests for the authorization. - /// This field can be helpful in determining why a given authorization was approved/declined. - pub request_history: Vec, - - /// The current status of the authorization in its lifecycle. - pub status: IssuingAuthorizationStatus, - - /// [Token](https://stripe.com/docs/api/issuing/tokens/object) object used for this authorization. - /// - /// If a network token was not used for this authorization, this field will be null. - #[serde(skip_serializing_if = "Option::is_none")] - pub token: Option>, - - /// List of [transactions](https://stripe.com/docs/api/issuing/transactions) associated with this authorization. - pub transactions: Vec, - - /// [Treasury](https://stripe.com/docs/api/treasury) details related to this authorization if it was created on a [FinancialAccount](https://stripe.com/docs/api/treasury/financial_accounts). - #[serde(skip_serializing_if = "Option::is_none")] - pub treasury: Option, - - pub verification_data: IssuingAuthorizationVerificationData, - - /// The digital wallet used for this transaction. - /// - /// One of `apple_pay`, `google_pay`, or `samsung_pay`. - /// Will populate as `null` when no digital wallet was utilized. - pub wallet: Option, -} - -impl Object for IssuingAuthorization { - type Id = IssuingAuthorizationId; - fn id(&self) -> Self::Id { - self.id.clone() - } - fn object(&self) -> &'static str { - "issuing.authorization" - } -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct IssuingAuthorizationNetworkData { - /// Identifier assigned to the acquirer by the card network. - /// - /// Sometimes this value is not provided by the network; in this case, the value will be `null`. - pub acquiring_institution_id: Option, - - /// The System Trace Audit Number (STAN) is a 6-digit identifier assigned by the acquirer. - /// - /// Prefer `network_data.transaction_id` if present, unless you have special requirements. - pub system_trace_audit_number: Option, - - /// Unique identifier for the authorization assigned by the card network used to match subsequent messages, disputes, and transactions. - pub transaction_id: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct IssuingAuthorizationPendingRequest { - /// The additional amount Stripe will hold if the authorization is approved, in the card's [currency](https://stripe.com/docs/api#issuing_authorization_object-pending-request-currency) and in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal). - pub amount: i64, - - /// Detailed breakdown of amount components. - /// - /// These amounts are denominated in `currency` and in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal). - pub amount_details: Option, - - /// Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. - /// - /// Must be a [supported currency](https://stripe.com/docs/currencies). - pub currency: Currency, - - /// If set `true`, you may provide [amount](https://stripe.com/docs/api/issuing/authorizations/approve#approve_issuing_authorization-amount) to control how much to hold for the authorization. - pub is_amount_controllable: bool, - - /// The amount the merchant is requesting to be authorized in the `merchant_currency`. - /// - /// The amount is in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal). - pub merchant_amount: i64, - - /// The local currency the merchant is requesting to authorize. - pub merchant_currency: Currency, - - /// The card network's estimate of the likelihood that an authorization is fraudulent. - /// - /// Takes on values between 1 and 99. - pub network_risk_score: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct IssuingAuthorizationRequest { - /// The `pending_request.amount` at the time of the request, presented in your card's currency and in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal). - /// - /// Stripe held this amount from your account to fund the authorization if the request was approved. - pub amount: i64, - - /// Detailed breakdown of amount components. - /// - /// These amounts are denominated in `currency` and in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal). - pub amount_details: Option, - - /// Whether this request was approved. - pub approved: bool, - - /// A code created by Stripe which is shared with the merchant to validate the authorization. - /// - /// This field will be populated if the authorization message was approved. - /// The code typically starts with the letter "S", followed by a six-digit number. - /// For example, "S498162". - /// Please note that the code is not guaranteed to be unique across authorizations. - pub authorization_code: Option, - - /// Time at which the object was created. - /// - /// Measured in seconds since the Unix epoch. - pub created: Timestamp, - - /// Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. - /// - /// Must be a [supported currency](https://stripe.com/docs/currencies). - pub currency: Currency, - - /// The `pending_request.merchant_amount` at the time of the request, presented in the `merchant_currency` and in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal). - pub merchant_amount: i64, - - /// The currency that was collected by the merchant and presented to the cardholder for the authorization. - /// - /// Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. - /// Must be a [supported currency](https://stripe.com/docs/currencies). - pub merchant_currency: Currency, - - /// The card network's estimate of the likelihood that an authorization is fraudulent. - /// - /// Takes on values between 1 and 99. - pub network_risk_score: Option, - - /// When an authorization is approved or declined by you or by Stripe, this field provides additional detail on the reason for the outcome. - pub reason: IssuingAuthorizationReason, - - /// If the `request_history.reason` is `webhook_error` because the direct webhook response is invalid (for example, parsing errors or missing parameters), we surface a more detailed error message via this field. - pub reason_message: Option, - - /// Time when the card network received an authorization request from the acquirer in UTC. - /// - /// Referred to by networks as transmission time. - pub requested_at: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct IssuingAuthorizationTreasury { - /// The array of [ReceivedCredits](https://stripe.com/docs/api/treasury/received_credits) associated with this authorization. - pub received_credits: Vec, - - /// The array of [ReceivedDebits](https://stripe.com/docs/api/treasury/received_debits) associated with this authorization. - pub received_debits: Vec, - - /// The Treasury [Transaction](https://stripe.com/docs/api/treasury/transactions) associated with this authorization. - pub transaction: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct IssuingAuthorizationVerificationData { - /// Whether the cardholder provided an address first line and if it matched the cardholder’s `billing.address.line1`. - pub address_line1_check: IssuingAuthorizationCheck, - - /// Whether the cardholder provided a postal code and if it matched the cardholder’s `billing.address.postal_code`. - pub address_postal_code_check: IssuingAuthorizationCheck, - - /// The exemption applied to this authorization. - pub authentication_exemption: Option, - - /// Whether the cardholder provided a CVC and if it matched Stripe’s record. - pub cvc_check: IssuingAuthorizationCheck, - - /// Whether the cardholder provided an expiry date and if it matched Stripe’s record. - pub expiry_check: IssuingAuthorizationCheck, - - /// The postal code submitted as part of the authorization used for postal code verification. - pub postal_code: Option, - - /// 3D Secure details. - pub three_d_secure: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct IssuingAuthorizationAuthenticationExemption { - /// The entity that requested the exemption, either the acquiring merchant or the Issuing user. - pub claimed_by: IssuingAuthorizationAuthenticationExemptionClaimedBy, - - /// The specific exemption claimed for this authorization. - #[serde(rename = "type")] - pub type_: IssuingAuthorizationAuthenticationExemptionType, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct IssuingAuthorizationThreeDSecure { - /// The outcome of the 3D Secure authentication request. - pub result: IssuingAuthorizationThreeDSecureResult, -} - -/// An enum representing the possible values of an `IssuingAuthorizationAuthenticationExemption`'s `claimed_by` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum IssuingAuthorizationAuthenticationExemptionClaimedBy { - Acquirer, - Issuer, -} - -impl IssuingAuthorizationAuthenticationExemptionClaimedBy { - pub fn as_str(self) -> &'static str { - match self { - IssuingAuthorizationAuthenticationExemptionClaimedBy::Acquirer => "acquirer", - IssuingAuthorizationAuthenticationExemptionClaimedBy::Issuer => "issuer", - } - } -} - -impl AsRef for IssuingAuthorizationAuthenticationExemptionClaimedBy { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for IssuingAuthorizationAuthenticationExemptionClaimedBy { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for IssuingAuthorizationAuthenticationExemptionClaimedBy { - fn default() -> Self { - Self::Acquirer - } -} - -/// An enum representing the possible values of an `IssuingAuthorizationAuthenticationExemption`'s `type` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum IssuingAuthorizationAuthenticationExemptionType { - LowValueTransaction, - TransactionRiskAnalysis, - Unknown, -} - -impl IssuingAuthorizationAuthenticationExemptionType { - pub fn as_str(self) -> &'static str { - match self { - IssuingAuthorizationAuthenticationExemptionType::LowValueTransaction => { - "low_value_transaction" - } - IssuingAuthorizationAuthenticationExemptionType::TransactionRiskAnalysis => { - "transaction_risk_analysis" - } - IssuingAuthorizationAuthenticationExemptionType::Unknown => "unknown", - } - } -} - -impl AsRef for IssuingAuthorizationAuthenticationExemptionType { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for IssuingAuthorizationAuthenticationExemptionType { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for IssuingAuthorizationAuthenticationExemptionType { - fn default() -> Self { - Self::LowValueTransaction - } -} - -/// An enum representing the possible values of an `IssuingAuthorization`'s `status` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum IssuingAuthorizationStatus { - Closed, - Pending, - Reversed, -} - -impl IssuingAuthorizationStatus { - pub fn as_str(self) -> &'static str { - match self { - IssuingAuthorizationStatus::Closed => "closed", - IssuingAuthorizationStatus::Pending => "pending", - IssuingAuthorizationStatus::Reversed => "reversed", - } - } -} - -impl AsRef for IssuingAuthorizationStatus { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for IssuingAuthorizationStatus { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for IssuingAuthorizationStatus { - fn default() -> Self { - Self::Closed - } -} - -/// An enum representing the possible values of an `IssuingAuthorizationThreeDSecure`'s `result` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum IssuingAuthorizationThreeDSecureResult { - AttemptAcknowledged, - Authenticated, - Failed, - Required, -} - -impl IssuingAuthorizationThreeDSecureResult { - pub fn as_str(self) -> &'static str { - match self { - IssuingAuthorizationThreeDSecureResult::AttemptAcknowledged => "attempt_acknowledged", - IssuingAuthorizationThreeDSecureResult::Authenticated => "authenticated", - IssuingAuthorizationThreeDSecureResult::Failed => "failed", - IssuingAuthorizationThreeDSecureResult::Required => "required", - } - } -} - -impl AsRef for IssuingAuthorizationThreeDSecureResult { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for IssuingAuthorizationThreeDSecureResult { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for IssuingAuthorizationThreeDSecureResult { - fn default() -> Self { - Self::AttemptAcknowledged - } -} diff --git a/src/resources/generated/issuing_authorization_amount_details.rs b/src/resources/generated/issuing_authorization_amount_details.rs deleted file mode 100644 index 17e92a082..000000000 --- a/src/resources/generated/issuing_authorization_amount_details.rs +++ /dev/null @@ -1,16 +0,0 @@ -// ====================================== -// This file was automatically generated. -// ====================================== - -use serde::{Deserialize, Serialize}; - -/// The resource representing a Stripe "IssuingAuthorizationAmountDetails". -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct IssuingAuthorizationAmountDetails { - - /// The fee charged by the ATM for the cash withdrawal. - pub atm_fee: Option, - - /// The amount of cash requested by the cardholder. - pub cashback_amount: Option, -} diff --git a/src/resources/generated/issuing_authorization_created.rs b/src/resources/generated/issuing_authorization_created.rs deleted file mode 100644 index 6fa6502fb..000000000 --- a/src/resources/generated/issuing_authorization_created.rs +++ /dev/null @@ -1,10 +0,0 @@ -// ====================================== -// This file was automatically generated. -// ====================================== - -use serde::{Deserialize, Serialize}; - -/// The resource representing a Stripe "issuing_authorization.created". -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct IssuingAuthorizationCreated { -} diff --git a/src/resources/generated/issuing_authorization_request.rs b/src/resources/generated/issuing_authorization_request.rs deleted file mode 100644 index 1dd1313a9..000000000 --- a/src/resources/generated/issuing_authorization_request.rs +++ /dev/null @@ -1,10 +0,0 @@ -// ====================================== -// This file was automatically generated. -// ====================================== - -use serde::{Deserialize, Serialize}; - -/// The resource representing a Stripe "issuing_authorization.request". -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct IssuingAuthorizationRequest { -} diff --git a/src/resources/generated/issuing_authorization_updated.rs b/src/resources/generated/issuing_authorization_updated.rs deleted file mode 100644 index 2fea5c2f8..000000000 --- a/src/resources/generated/issuing_authorization_updated.rs +++ /dev/null @@ -1,10 +0,0 @@ -// ====================================== -// This file was automatically generated. -// ====================================== - -use serde::{Deserialize, Serialize}; - -/// The resource representing a Stripe "issuing_authorization.updated". -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct IssuingAuthorizationUpdated { -} diff --git a/src/resources/generated/issuing_card.rs b/src/resources/generated/issuing_card.rs deleted file mode 100644 index d05ad9820..000000000 --- a/src/resources/generated/issuing_card.rs +++ /dev/null @@ -1,1154 +0,0 @@ -// ====================================== -// This file was automatically generated. -// ====================================== - -use serde::{Deserialize, Serialize}; - -use crate::ids::IssuingCardId; -use crate::params::{Expandable, Metadata, Object, Timestamp}; -use crate::resources::{ - Address, CardBrand, Currency, IssuingCardShippingStatus, IssuingCardShippingType, - IssuingCardType, IssuingCardholder, MerchantCategory, -}; - -/// The resource representing a Stripe "IssuingCard". -/// -/// For more details see -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct IssuingCard { - /// Unique identifier for the object. - pub id: IssuingCardId, - - /// The brand of the card. - pub brand: CardBrand, - - /// The reason why the card was canceled. - pub cancellation_reason: Option, - - pub cardholder: IssuingCardholder, - - /// Time at which the object was created. - /// - /// Measured in seconds since the Unix epoch. - pub created: Timestamp, - - /// Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. - /// - /// Supported currencies are `usd` in the US, `eur` in the EU, and `gbp` in the UK. - pub currency: Currency, - - /// The card's CVC. - /// - /// For security reasons, this is only available for virtual cards, and will be omitted unless you explicitly request it with [the `expand` parameter](https://stripe.com/docs/api/expanding_objects). - /// Additionally, it's only available via the ["Retrieve a card" endpoint](https://stripe.com/docs/api/issuing/cards/retrieve), not via "List all cards" or any other endpoint. - #[serde(skip_serializing_if = "Option::is_none")] - pub cvc: Option, - - /// The expiration month of the card. - pub exp_month: i64, - - /// The expiration year of the card. - pub exp_year: i64, - - /// The financial account this card is attached to. - #[serde(skip_serializing_if = "Option::is_none")] - pub financial_account: Option, - - /// The last 4 digits of the card number. - pub last4: String, - - /// Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. - pub livemode: bool, - - /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. - /// - /// This can be useful for storing additional information about the object in a structured format. - pub metadata: Metadata, - - /// The full unredacted card number. - /// - /// For security reasons, this is only available for virtual cards, and will be omitted unless you explicitly request it with [the `expand` parameter](https://stripe.com/docs/api/expanding_objects). - /// Additionally, it's only available via the ["Retrieve a card" endpoint](https://stripe.com/docs/api/issuing/cards/retrieve), not via "List all cards" or any other endpoint. - #[serde(skip_serializing_if = "Option::is_none")] - pub number: Option, - - /// The latest card that replaces this card, if any. - pub replaced_by: Option>, - - /// The card this card replaces, if any. - pub replacement_for: Option>, - - /// The reason why the previous card needed to be replaced. - pub replacement_reason: Option, - - /// Where and how the card will be shipped. - pub shipping: Option, - - pub spending_controls: IssuingCardAuthorizationControls, - - /// Whether authorizations can be approved on this card. - /// - /// May be blocked from activating cards depending on past-due Cardholder requirements. - /// Defaults to `inactive`. - pub status: IssuingCardStatus, - - /// The type of the card. - #[serde(rename = "type")] - pub type_: IssuingCardType, - - /// Information relating to digital wallets (like Apple Pay and Google Pay). - pub wallets: Option, -} - -impl Object for IssuingCard { - type Id = IssuingCardId; - fn id(&self) -> Self::Id { - self.id.clone() - } - fn object(&self) -> &'static str { - "issuing.card" - } -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct IssuingCardAuthorizationControls { - /// Array of strings containing [categories](https://stripe.com/docs/api#issuing_authorization_object-merchant_data-category) of authorizations to allow. - /// - /// All other categories will be blocked. - /// Cannot be set with `blocked_categories`. - pub allowed_categories: Option>, - - /// Array of strings containing [categories](https://stripe.com/docs/api#issuing_authorization_object-merchant_data-category) of authorizations to decline. - /// - /// All other categories will be allowed. - /// Cannot be set with `allowed_categories`. - pub blocked_categories: Option>, - - /// Limit spending with amount-based rules that apply across any cards this card replaced (i.e., its `replacement_for` card and _that_ card's `replacement_for` card, up the chain). - pub spending_limits: Option>, - - /// Currency of the amounts within `spending_limits`. - /// - /// Always the same as the currency of the card. - pub spending_limits_currency: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct IssuingCardShipping { - pub address: Address, - - /// The delivery company that shipped a card. - pub carrier: Option, - - /// Additional information that may be required for clearing customs. - pub customs: Option, - - /// A unix timestamp representing a best estimate of when the card will be delivered. - pub eta: Option, - - /// Recipient name. - pub name: String, - - /// The phone number of the receiver of the shipment. - /// - /// Our courier partners will use this number to contact you in the event of card delivery issues. - /// For individual shipments to the EU/UK, if this field is empty, we will provide them with the phone number provided when the cardholder was initially created. - pub phone_number: Option, - - /// Whether a signature is required for card delivery. - /// - /// This feature is only supported for US users. - /// Standard shipping service does not support signature on delivery. - /// The default value for standard shipping service is false and for express and priority services is true. - pub require_signature: Option, - - /// Shipment service, such as `standard` or `express`. - pub service: IssuingCardShippingService, - - /// The delivery status of the card. - pub status: Option, - - /// A tracking number for a card shipment. - pub tracking_number: Option, - - /// A link to the shipping carrier's site where you can view detailed information about a card shipment. - pub tracking_url: Option, - - /// Packaging options. - #[serde(rename = "type")] - pub type_: IssuingCardShippingType, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct IssuingCardShippingCustoms { - /// A registration number used for customs in Europe. - /// - /// See [](https://www.gov.uk/eori) for the UK and [](https://ec.europa.eu/taxation_customs/business/customs-procedures-import-and-export/customs-procedures/economic-operators-registration-and-identification-number-eori_en) for the EU. - pub eori_number: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct IssuingCardSpendingLimit { - /// Maximum amount allowed to spend per interval. - /// - /// This amount is in the card's currency and in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal). - pub amount: i64, - - /// Array of strings containing [categories](https://stripe.com/docs/api#issuing_authorization_object-merchant_data-category) this limit applies to. - /// - /// Omitting this field will apply the limit to all categories. - pub categories: Option>, - - /// Interval (or event) to which the amount applies. - pub interval: IssuingCardSpendingLimitInterval, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct IssuingCardWallets { - pub apple_pay: IssuingCardApplePay, - - pub google_pay: IssuingCardGooglePay, - - /// Unique identifier for a card used with digital wallets. - pub primary_account_identifier: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct IssuingCardApplePay { - /// Apple Pay Eligibility. - pub eligible: bool, - - /// Reason the card is ineligible for Apple Pay. - pub ineligible_reason: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct IssuingCardGooglePay { - /// Google Pay Eligibility. - pub eligible: bool, - - /// Reason the card is ineligible for Google Pay. - pub ineligible_reason: Option, -} - -/// An enum representing the possible values of an `IssuingCardApplePay`'s `ineligible_reason` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum IssuingCardApplePayIneligibleReason { - MissingAgreement, - MissingCardholderContact, - UnsupportedRegion, -} - -impl IssuingCardApplePayIneligibleReason { - pub fn as_str(self) -> &'static str { - match self { - IssuingCardApplePayIneligibleReason::MissingAgreement => "missing_agreement", - IssuingCardApplePayIneligibleReason::MissingCardholderContact => { - "missing_cardholder_contact" - } - IssuingCardApplePayIneligibleReason::UnsupportedRegion => "unsupported_region", - } - } -} - -impl AsRef for IssuingCardApplePayIneligibleReason { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for IssuingCardApplePayIneligibleReason { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for IssuingCardApplePayIneligibleReason { - fn default() -> Self { - Self::MissingAgreement - } -} - -/// An enum representing the possible values of an `IssuingCard`'s `cancellation_reason` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum IssuingCardCancellationReason { - DesignRejected, - Lost, - Stolen, -} - -impl IssuingCardCancellationReason { - pub fn as_str(self) -> &'static str { - match self { - IssuingCardCancellationReason::DesignRejected => "design_rejected", - IssuingCardCancellationReason::Lost => "lost", - IssuingCardCancellationReason::Stolen => "stolen", - } - } -} - -impl AsRef for IssuingCardCancellationReason { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for IssuingCardCancellationReason { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for IssuingCardCancellationReason { - fn default() -> Self { - Self::DesignRejected - } -} - -/// An enum representing the possible values of an `IssuingCardGooglePay`'s `ineligible_reason` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum IssuingCardGooglePayIneligibleReason { - MissingAgreement, - MissingCardholderContact, - UnsupportedRegion, -} - -impl IssuingCardGooglePayIneligibleReason { - pub fn as_str(self) -> &'static str { - match self { - IssuingCardGooglePayIneligibleReason::MissingAgreement => "missing_agreement", - IssuingCardGooglePayIneligibleReason::MissingCardholderContact => { - "missing_cardholder_contact" - } - IssuingCardGooglePayIneligibleReason::UnsupportedRegion => "unsupported_region", - } - } -} - -impl AsRef for IssuingCardGooglePayIneligibleReason { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for IssuingCardGooglePayIneligibleReason { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for IssuingCardGooglePayIneligibleReason { - fn default() -> Self { - Self::MissingAgreement - } -} - -/// An enum representing the possible values of an `IssuingCard`'s `replacement_reason` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum IssuingCardReplacementReason { - Damaged, - Expired, - Lost, - Stolen, -} - -impl IssuingCardReplacementReason { - pub fn as_str(self) -> &'static str { - match self { - IssuingCardReplacementReason::Damaged => "damaged", - IssuingCardReplacementReason::Expired => "expired", - IssuingCardReplacementReason::Lost => "lost", - IssuingCardReplacementReason::Stolen => "stolen", - } - } -} - -impl AsRef for IssuingCardReplacementReason { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for IssuingCardReplacementReason { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for IssuingCardReplacementReason { - fn default() -> Self { - Self::Damaged - } -} - -/// An enum representing the possible values of an `IssuingCardShipping`'s `carrier` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum IssuingCardShippingCarrier { - Dhl, - Fedex, - RoyalMail, - Usps, -} - -impl IssuingCardShippingCarrier { - pub fn as_str(self) -> &'static str { - match self { - IssuingCardShippingCarrier::Dhl => "dhl", - IssuingCardShippingCarrier::Fedex => "fedex", - IssuingCardShippingCarrier::RoyalMail => "royal_mail", - IssuingCardShippingCarrier::Usps => "usps", - } - } -} - -impl AsRef for IssuingCardShippingCarrier { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for IssuingCardShippingCarrier { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for IssuingCardShippingCarrier { - fn default() -> Self { - Self::Dhl - } -} - -/// An enum representing the possible values of an `IssuingCardShipping`'s `service` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum IssuingCardShippingService { - Express, - Priority, - Standard, -} - -impl IssuingCardShippingService { - pub fn as_str(self) -> &'static str { - match self { - IssuingCardShippingService::Express => "express", - IssuingCardShippingService::Priority => "priority", - IssuingCardShippingService::Standard => "standard", - } - } -} - -impl AsRef for IssuingCardShippingService { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for IssuingCardShippingService { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for IssuingCardShippingService { - fn default() -> Self { - Self::Express - } -} - -/// An enum representing the possible values of an `IssuingCardSpendingLimit`'s `categories` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum IssuingCardSpendingLimitCategories { - AcRefrigerationRepair, - AccountingBookkeepingServices, - AdvertisingServices, - AgriculturalCooperative, - AirlinesAirCarriers, - AirportsFlyingFields, - AmbulanceServices, - AmusementParksCarnivals, - AntiqueReproductions, - AntiqueShops, - Aquariums, - ArchitecturalSurveyingServices, - ArtDealersAndGalleries, - ArtistsSupplyAndCraftShops, - AutoAndHomeSupplyStores, - AutoBodyRepairShops, - AutoPaintShops, - AutoServiceShops, - AutomatedCashDisburse, - AutomatedFuelDispensers, - AutomobileAssociations, - AutomotivePartsAndAccessoriesStores, - AutomotiveTireStores, - BailAndBondPayments, - Bakeries, - BandsOrchestras, - BarberAndBeautyShops, - BettingCasinoGambling, - BicycleShops, - BilliardPoolEstablishments, - BoatDealers, - BoatRentalsAndLeases, - BookStores, - BooksPeriodicalsAndNewspapers, - BowlingAlleys, - BusLines, - BusinessSecretarialSchools, - BuyingShoppingServices, - CableSatelliteAndOtherPayTelevisionAndRadio, - CameraAndPhotographicSupplyStores, - CandyNutAndConfectioneryStores, - CarAndTruckDealersNewUsed, - CarAndTruckDealersUsedOnly, - CarRentalAgencies, - CarWashes, - CarpentryServices, - CarpetUpholsteryCleaning, - Caterers, - CharitableAndSocialServiceOrganizationsFundraising, - ChemicalsAndAlliedProducts, - ChildCareServices, - ChildrensAndInfantsWearStores, - ChiropodistsPodiatrists, - Chiropractors, - CigarStoresAndStands, - CivicSocialFraternalAssociations, - CleaningAndMaintenance, - ClothingRental, - CollegesUniversities, - CommercialEquipment, - CommercialFootwear, - CommercialPhotographyArtAndGraphics, - CommuterTransportAndFerries, - ComputerNetworkServices, - ComputerProgramming, - ComputerRepair, - ComputerSoftwareStores, - ComputersPeripheralsAndSoftware, - ConcreteWorkServices, - ConstructionMaterials, - ConsultingPublicRelations, - CorrespondenceSchools, - CosmeticStores, - CounselingServices, - CountryClubs, - CourierServices, - CourtCosts, - CreditReportingAgencies, - CruiseLines, - DairyProductsStores, - DanceHallStudiosSchools, - DatingEscortServices, - DentistsOrthodontists, - DepartmentStores, - DetectiveAgencies, - DigitalGoodsApplications, - DigitalGoodsGames, - DigitalGoodsLargeVolume, - DigitalGoodsMedia, - DirectMarketingCatalogMerchant, - DirectMarketingCombinationCatalogAndRetailMerchant, - DirectMarketingInboundTelemarketing, - DirectMarketingInsuranceServices, - DirectMarketingOther, - DirectMarketingOutboundTelemarketing, - DirectMarketingSubscription, - DirectMarketingTravel, - DiscountStores, - Doctors, - DoorToDoorSales, - DraperyWindowCoveringAndUpholsteryStores, - DrinkingPlaces, - DrugStoresAndPharmacies, - DrugsDrugProprietariesAndDruggistSundries, - DryCleaners, - DurableGoods, - DutyFreeStores, - EatingPlacesRestaurants, - EducationalServices, - ElectricRazorStores, - ElectricVehicleCharging, - ElectricalPartsAndEquipment, - ElectricalServices, - ElectronicsRepairShops, - ElectronicsStores, - ElementarySecondarySchools, - EmergencyServicesGcasVisaUseOnly, - EmploymentTempAgencies, - EquipmentRental, - ExterminatingServices, - FamilyClothingStores, - FastFoodRestaurants, - FinancialInstitutions, - FinesGovernmentAdministrativeEntities, - FireplaceFireplaceScreensAndAccessoriesStores, - FloorCoveringStores, - Florists, - FloristsSuppliesNurseryStockAndFlowers, - FreezerAndLockerMeatProvisioners, - FuelDealersNonAutomotive, - FuneralServicesCrematories, - FurnitureHomeFurnishingsAndEquipmentStoresExceptAppliances, - FurnitureRepairRefinishing, - FurriersAndFurShops, - GeneralServices, - GiftCardNoveltyAndSouvenirShops, - GlassPaintAndWallpaperStores, - GlasswareCrystalStores, - GolfCoursesPublic, - GovernmentLicensedHorseDogRacingUsRegionOnly, - GovernmentLicensedOnlineCasionsOnlineGamblingUsRegionOnly, - GovernmentOwnedLotteriesNonUsRegion, - GovernmentOwnedLotteriesUsRegionOnly, - GovernmentServices, - GroceryStoresSupermarkets, - HardwareEquipmentAndSupplies, - HardwareStores, - HealthAndBeautySpas, - HearingAidsSalesAndSupplies, - HeatingPlumbingAC, - HobbyToyAndGameShops, - HomeSupplyWarehouseStores, - Hospitals, - HotelsMotelsAndResorts, - HouseholdApplianceStores, - IndustrialSupplies, - InformationRetrievalServices, - InsuranceDefault, - InsuranceUnderwritingPremiums, - IntraCompanyPurchases, - JewelryStoresWatchesClocksAndSilverwareStores, - LandscapingServices, - Laundries, - LaundryCleaningServices, - LegalServicesAttorneys, - LuggageAndLeatherGoodsStores, - LumberBuildingMaterialsStores, - ManualCashDisburse, - MarinasServiceAndSupplies, - Marketplaces, - MasonryStoneworkAndPlaster, - MassageParlors, - MedicalAndDentalLabs, - MedicalDentalOphthalmicAndHospitalEquipmentAndSupplies, - MedicalServices, - MembershipOrganizations, - MensAndBoysClothingAndAccessoriesStores, - MensWomensClothingStores, - MetalServiceCenters, - Miscellaneous, - MiscellaneousApparelAndAccessoryShops, - MiscellaneousAutoDealers, - MiscellaneousBusinessServices, - MiscellaneousFoodStores, - MiscellaneousGeneralMerchandise, - MiscellaneousGeneralServices, - MiscellaneousHomeFurnishingSpecialtyStores, - MiscellaneousPublishingAndPrinting, - MiscellaneousRecreationServices, - MiscellaneousRepairShops, - MiscellaneousSpecialtyRetail, - MobileHomeDealers, - MotionPictureTheaters, - MotorFreightCarriersAndTrucking, - MotorHomesDealers, - MotorVehicleSuppliesAndNewParts, - MotorcycleShopsAndDealers, - MotorcycleShopsDealers, - MusicStoresMusicalInstrumentsPianosAndSheetMusic, - NewsDealersAndNewsstands, - NonFiMoneyOrders, - NonFiStoredValueCardPurchaseLoad, - NondurableGoods, - NurseriesLawnAndGardenSupplyStores, - NursingPersonalCare, - OfficeAndCommercialFurniture, - OpticiansEyeglasses, - OptometristsOphthalmologist, - OrthopedicGoodsProstheticDevices, - Osteopaths, - PackageStoresBeerWineAndLiquor, - PaintsVarnishesAndSupplies, - ParkingLotsGarages, - PassengerRailways, - PawnShops, - PetShopsPetFoodAndSupplies, - PetroleumAndPetroleumProducts, - PhotoDeveloping, - PhotographicPhotocopyMicrofilmEquipmentAndSupplies, - PhotographicStudios, - PictureVideoProduction, - PieceGoodsNotionsAndOtherDryGoods, - PlumbingHeatingEquipmentAndSupplies, - PoliticalOrganizations, - PostalServicesGovernmentOnly, - PreciousStonesAndMetalsWatchesAndJewelry, - ProfessionalServices, - PublicWarehousingAndStorage, - QuickCopyReproAndBlueprint, - Railroads, - RealEstateAgentsAndManagersRentals, - RecordStores, - RecreationalVehicleRentals, - ReligiousGoodsStores, - ReligiousOrganizations, - RoofingSidingSheetMetal, - SecretarialSupportServices, - SecurityBrokersDealers, - ServiceStations, - SewingNeedleworkFabricAndPieceGoodsStores, - ShoeRepairHatCleaning, - ShoeStores, - SmallApplianceRepair, - SnowmobileDealers, - SpecialTradeServices, - SpecialtyCleaning, - SportingGoodsStores, - SportingRecreationCamps, - SportsAndRidingApparelStores, - SportsClubsFields, - StampAndCoinStores, - StationaryOfficeSuppliesPrintingAndWritingPaper, - StationeryStoresOfficeAndSchoolSupplyStores, - SwimmingPoolsSales, - TUiTravelGermany, - TailorsAlterations, - TaxPaymentsGovernmentAgencies, - TaxPreparationServices, - TaxicabsLimousines, - TelecommunicationEquipmentAndTelephoneSales, - TelecommunicationServices, - TelegraphServices, - TentAndAwningShops, - TestingLaboratories, - TheatricalTicketAgencies, - Timeshares, - TireRetreadingAndRepair, - TollsBridgeFees, - TouristAttractionsAndExhibits, - TowingServices, - TrailerParksCampgrounds, - TransportationServices, - TravelAgenciesTourOperators, - TruckStopIteration, - TruckUtilityTrailerRentals, - TypesettingPlateMakingAndRelatedServices, - TypewriterStores, - USFederalGovernmentAgenciesOrDepartments, - UniformsCommercialClothing, - UsedMerchandiseAndSecondhandStores, - Utilities, - VarietyStores, - VeterinaryServices, - VideoAmusementGameSupplies, - VideoGameArcades, - VideoTapeRentalStores, - VocationalTradeSchools, - WatchJewelryRepair, - WeldingRepair, - WholesaleClubs, - WigAndToupeeStores, - WiresMoneyOrders, - WomensAccessoryAndSpecialtyShops, - WomensReadyToWearStores, - WreckingAndSalvageYards, -} - -impl IssuingCardSpendingLimitCategories { - pub fn as_str(self) -> &'static str { - match self { - IssuingCardSpendingLimitCategories::AcRefrigerationRepair => "ac_refrigeration_repair", - IssuingCardSpendingLimitCategories::AccountingBookkeepingServices => "accounting_bookkeeping_services", - IssuingCardSpendingLimitCategories::AdvertisingServices => "advertising_services", - IssuingCardSpendingLimitCategories::AgriculturalCooperative => "agricultural_cooperative", - IssuingCardSpendingLimitCategories::AirlinesAirCarriers => "airlines_air_carriers", - IssuingCardSpendingLimitCategories::AirportsFlyingFields => "airports_flying_fields", - IssuingCardSpendingLimitCategories::AmbulanceServices => "ambulance_services", - IssuingCardSpendingLimitCategories::AmusementParksCarnivals => "amusement_parks_carnivals", - IssuingCardSpendingLimitCategories::AntiqueReproductions => "antique_reproductions", - IssuingCardSpendingLimitCategories::AntiqueShops => "antique_shops", - IssuingCardSpendingLimitCategories::Aquariums => "aquariums", - IssuingCardSpendingLimitCategories::ArchitecturalSurveyingServices => "architectural_surveying_services", - IssuingCardSpendingLimitCategories::ArtDealersAndGalleries => "art_dealers_and_galleries", - IssuingCardSpendingLimitCategories::ArtistsSupplyAndCraftShops => "artists_supply_and_craft_shops", - IssuingCardSpendingLimitCategories::AutoAndHomeSupplyStores => "auto_and_home_supply_stores", - IssuingCardSpendingLimitCategories::AutoBodyRepairShops => "auto_body_repair_shops", - IssuingCardSpendingLimitCategories::AutoPaintShops => "auto_paint_shops", - IssuingCardSpendingLimitCategories::AutoServiceShops => "auto_service_shops", - IssuingCardSpendingLimitCategories::AutomatedCashDisburse => "automated_cash_disburse", - IssuingCardSpendingLimitCategories::AutomatedFuelDispensers => "automated_fuel_dispensers", - IssuingCardSpendingLimitCategories::AutomobileAssociations => "automobile_associations", - IssuingCardSpendingLimitCategories::AutomotivePartsAndAccessoriesStores => "automotive_parts_and_accessories_stores", - IssuingCardSpendingLimitCategories::AutomotiveTireStores => "automotive_tire_stores", - IssuingCardSpendingLimitCategories::BailAndBondPayments => "bail_and_bond_payments", - IssuingCardSpendingLimitCategories::Bakeries => "bakeries", - IssuingCardSpendingLimitCategories::BandsOrchestras => "bands_orchestras", - IssuingCardSpendingLimitCategories::BarberAndBeautyShops => "barber_and_beauty_shops", - IssuingCardSpendingLimitCategories::BettingCasinoGambling => "betting_casino_gambling", - IssuingCardSpendingLimitCategories::BicycleShops => "bicycle_shops", - IssuingCardSpendingLimitCategories::BilliardPoolEstablishments => "billiard_pool_establishments", - IssuingCardSpendingLimitCategories::BoatDealers => "boat_dealers", - IssuingCardSpendingLimitCategories::BoatRentalsAndLeases => "boat_rentals_and_leases", - IssuingCardSpendingLimitCategories::BookStores => "book_stores", - IssuingCardSpendingLimitCategories::BooksPeriodicalsAndNewspapers => "books_periodicals_and_newspapers", - IssuingCardSpendingLimitCategories::BowlingAlleys => "bowling_alleys", - IssuingCardSpendingLimitCategories::BusLines => "bus_lines", - IssuingCardSpendingLimitCategories::BusinessSecretarialSchools => "business_secretarial_schools", - IssuingCardSpendingLimitCategories::BuyingShoppingServices => "buying_shopping_services", - IssuingCardSpendingLimitCategories::CableSatelliteAndOtherPayTelevisionAndRadio => "cable_satellite_and_other_pay_television_and_radio", - IssuingCardSpendingLimitCategories::CameraAndPhotographicSupplyStores => "camera_and_photographic_supply_stores", - IssuingCardSpendingLimitCategories::CandyNutAndConfectioneryStores => "candy_nut_and_confectionery_stores", - IssuingCardSpendingLimitCategories::CarAndTruckDealersNewUsed => "car_and_truck_dealers_new_used", - IssuingCardSpendingLimitCategories::CarAndTruckDealersUsedOnly => "car_and_truck_dealers_used_only", - IssuingCardSpendingLimitCategories::CarRentalAgencies => "car_rental_agencies", - IssuingCardSpendingLimitCategories::CarWashes => "car_washes", - IssuingCardSpendingLimitCategories::CarpentryServices => "carpentry_services", - IssuingCardSpendingLimitCategories::CarpetUpholsteryCleaning => "carpet_upholstery_cleaning", - IssuingCardSpendingLimitCategories::Caterers => "caterers", - IssuingCardSpendingLimitCategories::CharitableAndSocialServiceOrganizationsFundraising => "charitable_and_social_service_organizations_fundraising", - IssuingCardSpendingLimitCategories::ChemicalsAndAlliedProducts => "chemicals_and_allied_products", - IssuingCardSpendingLimitCategories::ChildCareServices => "child_care_services", - IssuingCardSpendingLimitCategories::ChildrensAndInfantsWearStores => "childrens_and_infants_wear_stores", - IssuingCardSpendingLimitCategories::ChiropodistsPodiatrists => "chiropodists_podiatrists", - IssuingCardSpendingLimitCategories::Chiropractors => "chiropractors", - IssuingCardSpendingLimitCategories::CigarStoresAndStands => "cigar_stores_and_stands", - IssuingCardSpendingLimitCategories::CivicSocialFraternalAssociations => "civic_social_fraternal_associations", - IssuingCardSpendingLimitCategories::CleaningAndMaintenance => "cleaning_and_maintenance", - IssuingCardSpendingLimitCategories::ClothingRental => "clothing_rental", - IssuingCardSpendingLimitCategories::CollegesUniversities => "colleges_universities", - IssuingCardSpendingLimitCategories::CommercialEquipment => "commercial_equipment", - IssuingCardSpendingLimitCategories::CommercialFootwear => "commercial_footwear", - IssuingCardSpendingLimitCategories::CommercialPhotographyArtAndGraphics => "commercial_photography_art_and_graphics", - IssuingCardSpendingLimitCategories::CommuterTransportAndFerries => "commuter_transport_and_ferries", - IssuingCardSpendingLimitCategories::ComputerNetworkServices => "computer_network_services", - IssuingCardSpendingLimitCategories::ComputerProgramming => "computer_programming", - IssuingCardSpendingLimitCategories::ComputerRepair => "computer_repair", - IssuingCardSpendingLimitCategories::ComputerSoftwareStores => "computer_software_stores", - IssuingCardSpendingLimitCategories::ComputersPeripheralsAndSoftware => "computers_peripherals_and_software", - IssuingCardSpendingLimitCategories::ConcreteWorkServices => "concrete_work_services", - IssuingCardSpendingLimitCategories::ConstructionMaterials => "construction_materials", - IssuingCardSpendingLimitCategories::ConsultingPublicRelations => "consulting_public_relations", - IssuingCardSpendingLimitCategories::CorrespondenceSchools => "correspondence_schools", - IssuingCardSpendingLimitCategories::CosmeticStores => "cosmetic_stores", - IssuingCardSpendingLimitCategories::CounselingServices => "counseling_services", - IssuingCardSpendingLimitCategories::CountryClubs => "country_clubs", - IssuingCardSpendingLimitCategories::CourierServices => "courier_services", - IssuingCardSpendingLimitCategories::CourtCosts => "court_costs", - IssuingCardSpendingLimitCategories::CreditReportingAgencies => "credit_reporting_agencies", - IssuingCardSpendingLimitCategories::CruiseLines => "cruise_lines", - IssuingCardSpendingLimitCategories::DairyProductsStores => "dairy_products_stores", - IssuingCardSpendingLimitCategories::DanceHallStudiosSchools => "dance_hall_studios_schools", - IssuingCardSpendingLimitCategories::DatingEscortServices => "dating_escort_services", - IssuingCardSpendingLimitCategories::DentistsOrthodontists => "dentists_orthodontists", - IssuingCardSpendingLimitCategories::DepartmentStores => "department_stores", - IssuingCardSpendingLimitCategories::DetectiveAgencies => "detective_agencies", - IssuingCardSpendingLimitCategories::DigitalGoodsApplications => "digital_goods_applications", - IssuingCardSpendingLimitCategories::DigitalGoodsGames => "digital_goods_games", - IssuingCardSpendingLimitCategories::DigitalGoodsLargeVolume => "digital_goods_large_volume", - IssuingCardSpendingLimitCategories::DigitalGoodsMedia => "digital_goods_media", - IssuingCardSpendingLimitCategories::DirectMarketingCatalogMerchant => "direct_marketing_catalog_merchant", - IssuingCardSpendingLimitCategories::DirectMarketingCombinationCatalogAndRetailMerchant => "direct_marketing_combination_catalog_and_retail_merchant", - IssuingCardSpendingLimitCategories::DirectMarketingInboundTelemarketing => "direct_marketing_inbound_telemarketing", - IssuingCardSpendingLimitCategories::DirectMarketingInsuranceServices => "direct_marketing_insurance_services", - IssuingCardSpendingLimitCategories::DirectMarketingOther => "direct_marketing_other", - IssuingCardSpendingLimitCategories::DirectMarketingOutboundTelemarketing => "direct_marketing_outbound_telemarketing", - IssuingCardSpendingLimitCategories::DirectMarketingSubscription => "direct_marketing_subscription", - IssuingCardSpendingLimitCategories::DirectMarketingTravel => "direct_marketing_travel", - IssuingCardSpendingLimitCategories::DiscountStores => "discount_stores", - IssuingCardSpendingLimitCategories::Doctors => "doctors", - IssuingCardSpendingLimitCategories::DoorToDoorSales => "door_to_door_sales", - IssuingCardSpendingLimitCategories::DraperyWindowCoveringAndUpholsteryStores => "drapery_window_covering_and_upholstery_stores", - IssuingCardSpendingLimitCategories::DrinkingPlaces => "drinking_places", - IssuingCardSpendingLimitCategories::DrugStoresAndPharmacies => "drug_stores_and_pharmacies", - IssuingCardSpendingLimitCategories::DrugsDrugProprietariesAndDruggistSundries => "drugs_drug_proprietaries_and_druggist_sundries", - IssuingCardSpendingLimitCategories::DryCleaners => "dry_cleaners", - IssuingCardSpendingLimitCategories::DurableGoods => "durable_goods", - IssuingCardSpendingLimitCategories::DutyFreeStores => "duty_free_stores", - IssuingCardSpendingLimitCategories::EatingPlacesRestaurants => "eating_places_restaurants", - IssuingCardSpendingLimitCategories::EducationalServices => "educational_services", - IssuingCardSpendingLimitCategories::ElectricRazorStores => "electric_razor_stores", - IssuingCardSpendingLimitCategories::ElectricVehicleCharging => "electric_vehicle_charging", - IssuingCardSpendingLimitCategories::ElectricalPartsAndEquipment => "electrical_parts_and_equipment", - IssuingCardSpendingLimitCategories::ElectricalServices => "electrical_services", - IssuingCardSpendingLimitCategories::ElectronicsRepairShops => "electronics_repair_shops", - IssuingCardSpendingLimitCategories::ElectronicsStores => "electronics_stores", - IssuingCardSpendingLimitCategories::ElementarySecondarySchools => "elementary_secondary_schools", - IssuingCardSpendingLimitCategories::EmergencyServicesGcasVisaUseOnly => "emergency_services_gcas_visa_use_only", - IssuingCardSpendingLimitCategories::EmploymentTempAgencies => "employment_temp_agencies", - IssuingCardSpendingLimitCategories::EquipmentRental => "equipment_rental", - IssuingCardSpendingLimitCategories::ExterminatingServices => "exterminating_services", - IssuingCardSpendingLimitCategories::FamilyClothingStores => "family_clothing_stores", - IssuingCardSpendingLimitCategories::FastFoodRestaurants => "fast_food_restaurants", - IssuingCardSpendingLimitCategories::FinancialInstitutions => "financial_institutions", - IssuingCardSpendingLimitCategories::FinesGovernmentAdministrativeEntities => "fines_government_administrative_entities", - IssuingCardSpendingLimitCategories::FireplaceFireplaceScreensAndAccessoriesStores => "fireplace_fireplace_screens_and_accessories_stores", - IssuingCardSpendingLimitCategories::FloorCoveringStores => "floor_covering_stores", - IssuingCardSpendingLimitCategories::Florists => "florists", - IssuingCardSpendingLimitCategories::FloristsSuppliesNurseryStockAndFlowers => "florists_supplies_nursery_stock_and_flowers", - IssuingCardSpendingLimitCategories::FreezerAndLockerMeatProvisioners => "freezer_and_locker_meat_provisioners", - IssuingCardSpendingLimitCategories::FuelDealersNonAutomotive => "fuel_dealers_non_automotive", - IssuingCardSpendingLimitCategories::FuneralServicesCrematories => "funeral_services_crematories", - IssuingCardSpendingLimitCategories::FurnitureHomeFurnishingsAndEquipmentStoresExceptAppliances => "furniture_home_furnishings_and_equipment_stores_except_appliances", - IssuingCardSpendingLimitCategories::FurnitureRepairRefinishing => "furniture_repair_refinishing", - IssuingCardSpendingLimitCategories::FurriersAndFurShops => "furriers_and_fur_shops", - IssuingCardSpendingLimitCategories::GeneralServices => "general_services", - IssuingCardSpendingLimitCategories::GiftCardNoveltyAndSouvenirShops => "gift_card_novelty_and_souvenir_shops", - IssuingCardSpendingLimitCategories::GlassPaintAndWallpaperStores => "glass_paint_and_wallpaper_stores", - IssuingCardSpendingLimitCategories::GlasswareCrystalStores => "glassware_crystal_stores", - IssuingCardSpendingLimitCategories::GolfCoursesPublic => "golf_courses_public", - IssuingCardSpendingLimitCategories::GovernmentLicensedHorseDogRacingUsRegionOnly => "government_licensed_horse_dog_racing_us_region_only", - IssuingCardSpendingLimitCategories::GovernmentLicensedOnlineCasionsOnlineGamblingUsRegionOnly => "government_licensed_online_casions_online_gambling_us_region_only", - IssuingCardSpendingLimitCategories::GovernmentOwnedLotteriesNonUsRegion => "government_owned_lotteries_non_us_region", - IssuingCardSpendingLimitCategories::GovernmentOwnedLotteriesUsRegionOnly => "government_owned_lotteries_us_region_only", - IssuingCardSpendingLimitCategories::GovernmentServices => "government_services", - IssuingCardSpendingLimitCategories::GroceryStoresSupermarkets => "grocery_stores_supermarkets", - IssuingCardSpendingLimitCategories::HardwareEquipmentAndSupplies => "hardware_equipment_and_supplies", - IssuingCardSpendingLimitCategories::HardwareStores => "hardware_stores", - IssuingCardSpendingLimitCategories::HealthAndBeautySpas => "health_and_beauty_spas", - IssuingCardSpendingLimitCategories::HearingAidsSalesAndSupplies => "hearing_aids_sales_and_supplies", - IssuingCardSpendingLimitCategories::HeatingPlumbingAC => "heating_plumbing_a_c", - IssuingCardSpendingLimitCategories::HobbyToyAndGameShops => "hobby_toy_and_game_shops", - IssuingCardSpendingLimitCategories::HomeSupplyWarehouseStores => "home_supply_warehouse_stores", - IssuingCardSpendingLimitCategories::Hospitals => "hospitals", - IssuingCardSpendingLimitCategories::HotelsMotelsAndResorts => "hotels_motels_and_resorts", - IssuingCardSpendingLimitCategories::HouseholdApplianceStores => "household_appliance_stores", - IssuingCardSpendingLimitCategories::IndustrialSupplies => "industrial_supplies", - IssuingCardSpendingLimitCategories::InformationRetrievalServices => "information_retrieval_services", - IssuingCardSpendingLimitCategories::InsuranceDefault => "insurance_default", - IssuingCardSpendingLimitCategories::InsuranceUnderwritingPremiums => "insurance_underwriting_premiums", - IssuingCardSpendingLimitCategories::IntraCompanyPurchases => "intra_company_purchases", - IssuingCardSpendingLimitCategories::JewelryStoresWatchesClocksAndSilverwareStores => "jewelry_stores_watches_clocks_and_silverware_stores", - IssuingCardSpendingLimitCategories::LandscapingServices => "landscaping_services", - IssuingCardSpendingLimitCategories::Laundries => "laundries", - IssuingCardSpendingLimitCategories::LaundryCleaningServices => "laundry_cleaning_services", - IssuingCardSpendingLimitCategories::LegalServicesAttorneys => "legal_services_attorneys", - IssuingCardSpendingLimitCategories::LuggageAndLeatherGoodsStores => "luggage_and_leather_goods_stores", - IssuingCardSpendingLimitCategories::LumberBuildingMaterialsStores => "lumber_building_materials_stores", - IssuingCardSpendingLimitCategories::ManualCashDisburse => "manual_cash_disburse", - IssuingCardSpendingLimitCategories::MarinasServiceAndSupplies => "marinas_service_and_supplies", - IssuingCardSpendingLimitCategories::Marketplaces => "marketplaces", - IssuingCardSpendingLimitCategories::MasonryStoneworkAndPlaster => "masonry_stonework_and_plaster", - IssuingCardSpendingLimitCategories::MassageParlors => "massage_parlors", - IssuingCardSpendingLimitCategories::MedicalAndDentalLabs => "medical_and_dental_labs", - IssuingCardSpendingLimitCategories::MedicalDentalOphthalmicAndHospitalEquipmentAndSupplies => "medical_dental_ophthalmic_and_hospital_equipment_and_supplies", - IssuingCardSpendingLimitCategories::MedicalServices => "medical_services", - IssuingCardSpendingLimitCategories::MembershipOrganizations => "membership_organizations", - IssuingCardSpendingLimitCategories::MensAndBoysClothingAndAccessoriesStores => "mens_and_boys_clothing_and_accessories_stores", - IssuingCardSpendingLimitCategories::MensWomensClothingStores => "mens_womens_clothing_stores", - IssuingCardSpendingLimitCategories::MetalServiceCenters => "metal_service_centers", - IssuingCardSpendingLimitCategories::Miscellaneous => "miscellaneous", - IssuingCardSpendingLimitCategories::MiscellaneousApparelAndAccessoryShops => "miscellaneous_apparel_and_accessory_shops", - IssuingCardSpendingLimitCategories::MiscellaneousAutoDealers => "miscellaneous_auto_dealers", - IssuingCardSpendingLimitCategories::MiscellaneousBusinessServices => "miscellaneous_business_services", - IssuingCardSpendingLimitCategories::MiscellaneousFoodStores => "miscellaneous_food_stores", - IssuingCardSpendingLimitCategories::MiscellaneousGeneralMerchandise => "miscellaneous_general_merchandise", - IssuingCardSpendingLimitCategories::MiscellaneousGeneralServices => "miscellaneous_general_services", - IssuingCardSpendingLimitCategories::MiscellaneousHomeFurnishingSpecialtyStores => "miscellaneous_home_furnishing_specialty_stores", - IssuingCardSpendingLimitCategories::MiscellaneousPublishingAndPrinting => "miscellaneous_publishing_and_printing", - IssuingCardSpendingLimitCategories::MiscellaneousRecreationServices => "miscellaneous_recreation_services", - IssuingCardSpendingLimitCategories::MiscellaneousRepairShops => "miscellaneous_repair_shops", - IssuingCardSpendingLimitCategories::MiscellaneousSpecialtyRetail => "miscellaneous_specialty_retail", - IssuingCardSpendingLimitCategories::MobileHomeDealers => "mobile_home_dealers", - IssuingCardSpendingLimitCategories::MotionPictureTheaters => "motion_picture_theaters", - IssuingCardSpendingLimitCategories::MotorFreightCarriersAndTrucking => "motor_freight_carriers_and_trucking", - IssuingCardSpendingLimitCategories::MotorHomesDealers => "motor_homes_dealers", - IssuingCardSpendingLimitCategories::MotorVehicleSuppliesAndNewParts => "motor_vehicle_supplies_and_new_parts", - IssuingCardSpendingLimitCategories::MotorcycleShopsAndDealers => "motorcycle_shops_and_dealers", - IssuingCardSpendingLimitCategories::MotorcycleShopsDealers => "motorcycle_shops_dealers", - IssuingCardSpendingLimitCategories::MusicStoresMusicalInstrumentsPianosAndSheetMusic => "music_stores_musical_instruments_pianos_and_sheet_music", - IssuingCardSpendingLimitCategories::NewsDealersAndNewsstands => "news_dealers_and_newsstands", - IssuingCardSpendingLimitCategories::NonFiMoneyOrders => "non_fi_money_orders", - IssuingCardSpendingLimitCategories::NonFiStoredValueCardPurchaseLoad => "non_fi_stored_value_card_purchase_load", - IssuingCardSpendingLimitCategories::NondurableGoods => "nondurable_goods", - IssuingCardSpendingLimitCategories::NurseriesLawnAndGardenSupplyStores => "nurseries_lawn_and_garden_supply_stores", - IssuingCardSpendingLimitCategories::NursingPersonalCare => "nursing_personal_care", - IssuingCardSpendingLimitCategories::OfficeAndCommercialFurniture => "office_and_commercial_furniture", - IssuingCardSpendingLimitCategories::OpticiansEyeglasses => "opticians_eyeglasses", - IssuingCardSpendingLimitCategories::OptometristsOphthalmologist => "optometrists_ophthalmologist", - IssuingCardSpendingLimitCategories::OrthopedicGoodsProstheticDevices => "orthopedic_goods_prosthetic_devices", - IssuingCardSpendingLimitCategories::Osteopaths => "osteopaths", - IssuingCardSpendingLimitCategories::PackageStoresBeerWineAndLiquor => "package_stores_beer_wine_and_liquor", - IssuingCardSpendingLimitCategories::PaintsVarnishesAndSupplies => "paints_varnishes_and_supplies", - IssuingCardSpendingLimitCategories::ParkingLotsGarages => "parking_lots_garages", - IssuingCardSpendingLimitCategories::PassengerRailways => "passenger_railways", - IssuingCardSpendingLimitCategories::PawnShops => "pawn_shops", - IssuingCardSpendingLimitCategories::PetShopsPetFoodAndSupplies => "pet_shops_pet_food_and_supplies", - IssuingCardSpendingLimitCategories::PetroleumAndPetroleumProducts => "petroleum_and_petroleum_products", - IssuingCardSpendingLimitCategories::PhotoDeveloping => "photo_developing", - IssuingCardSpendingLimitCategories::PhotographicPhotocopyMicrofilmEquipmentAndSupplies => "photographic_photocopy_microfilm_equipment_and_supplies", - IssuingCardSpendingLimitCategories::PhotographicStudios => "photographic_studios", - IssuingCardSpendingLimitCategories::PictureVideoProduction => "picture_video_production", - IssuingCardSpendingLimitCategories::PieceGoodsNotionsAndOtherDryGoods => "piece_goods_notions_and_other_dry_goods", - IssuingCardSpendingLimitCategories::PlumbingHeatingEquipmentAndSupplies => "plumbing_heating_equipment_and_supplies", - IssuingCardSpendingLimitCategories::PoliticalOrganizations => "political_organizations", - IssuingCardSpendingLimitCategories::PostalServicesGovernmentOnly => "postal_services_government_only", - IssuingCardSpendingLimitCategories::PreciousStonesAndMetalsWatchesAndJewelry => "precious_stones_and_metals_watches_and_jewelry", - IssuingCardSpendingLimitCategories::ProfessionalServices => "professional_services", - IssuingCardSpendingLimitCategories::PublicWarehousingAndStorage => "public_warehousing_and_storage", - IssuingCardSpendingLimitCategories::QuickCopyReproAndBlueprint => "quick_copy_repro_and_blueprint", - IssuingCardSpendingLimitCategories::Railroads => "railroads", - IssuingCardSpendingLimitCategories::RealEstateAgentsAndManagersRentals => "real_estate_agents_and_managers_rentals", - IssuingCardSpendingLimitCategories::RecordStores => "record_stores", - IssuingCardSpendingLimitCategories::RecreationalVehicleRentals => "recreational_vehicle_rentals", - IssuingCardSpendingLimitCategories::ReligiousGoodsStores => "religious_goods_stores", - IssuingCardSpendingLimitCategories::ReligiousOrganizations => "religious_organizations", - IssuingCardSpendingLimitCategories::RoofingSidingSheetMetal => "roofing_siding_sheet_metal", - IssuingCardSpendingLimitCategories::SecretarialSupportServices => "secretarial_support_services", - IssuingCardSpendingLimitCategories::SecurityBrokersDealers => "security_brokers_dealers", - IssuingCardSpendingLimitCategories::ServiceStations => "service_stations", - IssuingCardSpendingLimitCategories::SewingNeedleworkFabricAndPieceGoodsStores => "sewing_needlework_fabric_and_piece_goods_stores", - IssuingCardSpendingLimitCategories::ShoeRepairHatCleaning => "shoe_repair_hat_cleaning", - IssuingCardSpendingLimitCategories::ShoeStores => "shoe_stores", - IssuingCardSpendingLimitCategories::SmallApplianceRepair => "small_appliance_repair", - IssuingCardSpendingLimitCategories::SnowmobileDealers => "snowmobile_dealers", - IssuingCardSpendingLimitCategories::SpecialTradeServices => "special_trade_services", - IssuingCardSpendingLimitCategories::SpecialtyCleaning => "specialty_cleaning", - IssuingCardSpendingLimitCategories::SportingGoodsStores => "sporting_goods_stores", - IssuingCardSpendingLimitCategories::SportingRecreationCamps => "sporting_recreation_camps", - IssuingCardSpendingLimitCategories::SportsAndRidingApparelStores => "sports_and_riding_apparel_stores", - IssuingCardSpendingLimitCategories::SportsClubsFields => "sports_clubs_fields", - IssuingCardSpendingLimitCategories::StampAndCoinStores => "stamp_and_coin_stores", - IssuingCardSpendingLimitCategories::StationaryOfficeSuppliesPrintingAndWritingPaper => "stationary_office_supplies_printing_and_writing_paper", - IssuingCardSpendingLimitCategories::StationeryStoresOfficeAndSchoolSupplyStores => "stationery_stores_office_and_school_supply_stores", - IssuingCardSpendingLimitCategories::SwimmingPoolsSales => "swimming_pools_sales", - IssuingCardSpendingLimitCategories::TUiTravelGermany => "t_ui_travel_germany", - IssuingCardSpendingLimitCategories::TailorsAlterations => "tailors_alterations", - IssuingCardSpendingLimitCategories::TaxPaymentsGovernmentAgencies => "tax_payments_government_agencies", - IssuingCardSpendingLimitCategories::TaxPreparationServices => "tax_preparation_services", - IssuingCardSpendingLimitCategories::TaxicabsLimousines => "taxicabs_limousines", - IssuingCardSpendingLimitCategories::TelecommunicationEquipmentAndTelephoneSales => "telecommunication_equipment_and_telephone_sales", - IssuingCardSpendingLimitCategories::TelecommunicationServices => "telecommunication_services", - IssuingCardSpendingLimitCategories::TelegraphServices => "telegraph_services", - IssuingCardSpendingLimitCategories::TentAndAwningShops => "tent_and_awning_shops", - IssuingCardSpendingLimitCategories::TestingLaboratories => "testing_laboratories", - IssuingCardSpendingLimitCategories::TheatricalTicketAgencies => "theatrical_ticket_agencies", - IssuingCardSpendingLimitCategories::Timeshares => "timeshares", - IssuingCardSpendingLimitCategories::TireRetreadingAndRepair => "tire_retreading_and_repair", - IssuingCardSpendingLimitCategories::TollsBridgeFees => "tolls_bridge_fees", - IssuingCardSpendingLimitCategories::TouristAttractionsAndExhibits => "tourist_attractions_and_exhibits", - IssuingCardSpendingLimitCategories::TowingServices => "towing_services", - IssuingCardSpendingLimitCategories::TrailerParksCampgrounds => "trailer_parks_campgrounds", - IssuingCardSpendingLimitCategories::TransportationServices => "transportation_services", - IssuingCardSpendingLimitCategories::TravelAgenciesTourOperators => "travel_agencies_tour_operators", - IssuingCardSpendingLimitCategories::TruckStopIteration => "truck_stop_iteration", - IssuingCardSpendingLimitCategories::TruckUtilityTrailerRentals => "truck_utility_trailer_rentals", - IssuingCardSpendingLimitCategories::TypesettingPlateMakingAndRelatedServices => "typesetting_plate_making_and_related_services", - IssuingCardSpendingLimitCategories::TypewriterStores => "typewriter_stores", - IssuingCardSpendingLimitCategories::USFederalGovernmentAgenciesOrDepartments => "u_s_federal_government_agencies_or_departments", - IssuingCardSpendingLimitCategories::UniformsCommercialClothing => "uniforms_commercial_clothing", - IssuingCardSpendingLimitCategories::UsedMerchandiseAndSecondhandStores => "used_merchandise_and_secondhand_stores", - IssuingCardSpendingLimitCategories::Utilities => "utilities", - IssuingCardSpendingLimitCategories::VarietyStores => "variety_stores", - IssuingCardSpendingLimitCategories::VeterinaryServices => "veterinary_services", - IssuingCardSpendingLimitCategories::VideoAmusementGameSupplies => "video_amusement_game_supplies", - IssuingCardSpendingLimitCategories::VideoGameArcades => "video_game_arcades", - IssuingCardSpendingLimitCategories::VideoTapeRentalStores => "video_tape_rental_stores", - IssuingCardSpendingLimitCategories::VocationalTradeSchools => "vocational_trade_schools", - IssuingCardSpendingLimitCategories::WatchJewelryRepair => "watch_jewelry_repair", - IssuingCardSpendingLimitCategories::WeldingRepair => "welding_repair", - IssuingCardSpendingLimitCategories::WholesaleClubs => "wholesale_clubs", - IssuingCardSpendingLimitCategories::WigAndToupeeStores => "wig_and_toupee_stores", - IssuingCardSpendingLimitCategories::WiresMoneyOrders => "wires_money_orders", - IssuingCardSpendingLimitCategories::WomensAccessoryAndSpecialtyShops => "womens_accessory_and_specialty_shops", - IssuingCardSpendingLimitCategories::WomensReadyToWearStores => "womens_ready_to_wear_stores", - IssuingCardSpendingLimitCategories::WreckingAndSalvageYards => "wrecking_and_salvage_yards", - } - } -} - -impl AsRef for IssuingCardSpendingLimitCategories { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for IssuingCardSpendingLimitCategories { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for IssuingCardSpendingLimitCategories { - fn default() -> Self { - Self::AcRefrigerationRepair - } -} - -/// An enum representing the possible values of an `IssuingCardSpendingLimit`'s `interval` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum IssuingCardSpendingLimitInterval { - AllTime, - Daily, - Monthly, - PerAuthorization, - Weekly, - Yearly, -} - -impl IssuingCardSpendingLimitInterval { - pub fn as_str(self) -> &'static str { - match self { - IssuingCardSpendingLimitInterval::AllTime => "all_time", - IssuingCardSpendingLimitInterval::Daily => "daily", - IssuingCardSpendingLimitInterval::Monthly => "monthly", - IssuingCardSpendingLimitInterval::PerAuthorization => "per_authorization", - IssuingCardSpendingLimitInterval::Weekly => "weekly", - IssuingCardSpendingLimitInterval::Yearly => "yearly", - } - } -} - -impl AsRef for IssuingCardSpendingLimitInterval { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for IssuingCardSpendingLimitInterval { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for IssuingCardSpendingLimitInterval { - fn default() -> Self { - Self::AllTime - } -} - -/// An enum representing the possible values of an `IssuingCard`'s `status` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum IssuingCardStatus { - Active, - Canceled, - Inactive, -} - -impl IssuingCardStatus { - pub fn as_str(self) -> &'static str { - match self { - IssuingCardStatus::Active => "active", - IssuingCardStatus::Canceled => "canceled", - IssuingCardStatus::Inactive => "inactive", - } - } -} - -impl AsRef for IssuingCardStatus { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for IssuingCardStatus { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for IssuingCardStatus { - fn default() -> Self { - Self::Active - } -} diff --git a/src/resources/generated/issuing_card_created.rs b/src/resources/generated/issuing_card_created.rs deleted file mode 100644 index 0bb04dceb..000000000 --- a/src/resources/generated/issuing_card_created.rs +++ /dev/null @@ -1,10 +0,0 @@ -// ====================================== -// This file was automatically generated. -// ====================================== - -use serde::{Deserialize, Serialize}; - -/// The resource representing a Stripe "issuing_card.created". -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct IssuingCardCreated { -} diff --git a/src/resources/generated/issuing_card_updated.rs b/src/resources/generated/issuing_card_updated.rs deleted file mode 100644 index 068f6c86a..000000000 --- a/src/resources/generated/issuing_card_updated.rs +++ /dev/null @@ -1,10 +0,0 @@ -// ====================================== -// This file was automatically generated. -// ====================================== - -use serde::{Deserialize, Serialize}; - -/// The resource representing a Stripe "issuing_card.updated". -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct IssuingCardUpdated { -} diff --git a/src/resources/generated/issuing_cardholder.rs b/src/resources/generated/issuing_cardholder.rs deleted file mode 100644 index a992b662c..000000000 --- a/src/resources/generated/issuing_cardholder.rs +++ /dev/null @@ -1,1090 +0,0 @@ -// ====================================== -// This file was automatically generated. -// ====================================== - -use serde::{Deserialize, Serialize}; - -use crate::ids::IssuingCardholderId; -use crate::params::{Expandable, Metadata, Object, Timestamp}; -use crate::resources::{Address, Currency, File, MerchantCategory}; - -/// The resource representing a Stripe "IssuingCardholder". -/// -/// For more details see -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct IssuingCardholder { - /// Unique identifier for the object. - pub id: IssuingCardholderId, - - pub billing: IssuingCardholderAddress, - - /// Additional information about a `company` cardholder. - pub company: Option, - - /// Time at which the object was created. - /// - /// Measured in seconds since the Unix epoch. - pub created: Timestamp, - - /// The cardholder's email address. - pub email: Option, - - /// Additional information about an `individual` cardholder. - pub individual: Option, - - /// Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. - pub livemode: bool, - - /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. - /// - /// This can be useful for storing additional information about the object in a structured format. - pub metadata: Metadata, - - /// The cardholder's name. - /// - /// This will be printed on cards issued to them. - pub name: String, - - /// The cardholder's phone number. - /// - /// This is required for all cardholders who will be creating EU cards. - /// See the [3D Secure documentation](https://stripe.com/docs/issuing/3d-secure#when-is-3d-secure-applied) for more details. - pub phone_number: Option, - - /// The cardholder’s preferred locales (languages), ordered by preference. - /// - /// Locales can be `de`, `en`, `es`, `fr`, or `it`. This changes the language of the [3D Secure flow](https://stripe.com/docs/issuing/3d-secure) and one-time password messages sent to the cardholder. - pub preferred_locales: Option>, - - pub requirements: IssuingCardholderRequirements, - - /// Rules that control spending across this cardholder's cards. - /// - /// Refer to our [documentation](https://stripe.com/docs/issuing/controls/spending-controls) for more details. - pub spending_controls: Option, - - /// Specifies whether to permit authorizations on this cardholder's cards. - pub status: IssuingCardholderStatus, - - /// One of `individual` or `company`. - /// - /// See [Choose a cardholder type](https://stripe.com/docs/issuing/other/choose-cardholder) for more details. - #[serde(rename = "type")] - pub type_: IssuingCardholderType, -} - -impl Object for IssuingCardholder { - type Id = IssuingCardholderId; - fn id(&self) -> Self::Id { - self.id.clone() - } - fn object(&self) -> &'static str { - "issuing.cardholder" - } -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct IssuingCardholderAddress { - pub address: Address, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct IssuingCardholderAuthorizationControls { - /// Array of strings containing [categories](https://stripe.com/docs/api#issuing_authorization_object-merchant_data-category) of authorizations to allow. - /// - /// All other categories will be blocked. - /// Cannot be set with `blocked_categories`. - pub allowed_categories: Option>, - - /// Array of strings containing [categories](https://stripe.com/docs/api#issuing_authorization_object-merchant_data-category) of authorizations to decline. - /// - /// All other categories will be allowed. - /// Cannot be set with `allowed_categories`. - pub blocked_categories: Option>, - - /// Limit spending with amount-based rules that apply across this cardholder's cards. - pub spending_limits: Option>, - - /// Currency of the amounts within `spending_limits`. - pub spending_limits_currency: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct IssuingCardholderCompany { - /// Whether the company's business ID number was provided. - pub tax_id_provided: bool, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct IssuingCardholderIndividual { - /// Information related to the card_issuing program for this cardholder. - #[serde(skip_serializing_if = "Option::is_none")] - pub card_issuing: Option, - - /// The date of birth of this cardholder. - pub dob: Option, - - /// The first name of this cardholder. - /// - /// Required before activating Cards. - /// This field cannot contain any numbers, special characters (except periods, commas, hyphens, spaces and apostrophes) or non-latin letters. - pub first_name: Option, - - /// The last name of this cardholder. - /// - /// Required before activating Cards. - /// This field cannot contain any numbers, special characters (except periods, commas, hyphens, spaces and apostrophes) or non-latin letters. - pub last_name: Option, - - /// Government-issued ID document for this cardholder. - pub verification: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct IssuingCardholderCardIssuing { - /// Information about cardholder acceptance of Celtic [Authorized User Terms](https://stripe.com/docs/issuing/cards#accept-authorized-user-terms). - /// - /// Required for cards backed by a Celtic program. - pub user_terms_acceptance: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct IssuingCardholderIndividualDob { - /// The day of birth, between 1 and 31. - pub day: Option, - - /// The month of birth, between 1 and 12. - pub month: Option, - - /// The four-digit year of birth. - pub year: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct IssuingCardholderRequirements { - /// If `disabled_reason` is present, all cards will decline authorizations with `cardholder_verification_required` reason. - pub disabled_reason: Option, - - /// Array of fields that need to be collected in order to verify and re-enable the cardholder. - pub past_due: Option>, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct IssuingCardholderSpendingLimit { - /// Maximum amount allowed to spend per interval. - /// - /// This amount is in the card's currency and in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal). - pub amount: i64, - - /// Array of strings containing [categories](https://stripe.com/docs/api#issuing_authorization_object-merchant_data-category) this limit applies to. - /// - /// Omitting this field will apply the limit to all categories. - pub categories: Option>, - - /// Interval (or event) to which the amount applies. - pub interval: IssuingCardholderSpendingLimitInterval, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct IssuingCardholderUserTermsAcceptance { - /// The Unix timestamp marking when the cardholder accepted the Authorized User Terms. - pub date: Option, - - /// The IP address from which the cardholder accepted the Authorized User Terms. - pub ip: Option, - - /// The user agent of the browser from which the cardholder accepted the Authorized User Terms. - pub user_agent: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct IssuingCardholderVerification { - /// An identifying document, either a passport or local ID card. - pub document: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct IssuingCardholderIdDocument { - /// The back of a document returned by a [file upload](https://stripe.com/docs/api#create_file) with a `purpose` value of `identity_document`. - pub back: Option>, - - /// The front of a document returned by a [file upload](https://stripe.com/docs/api#create_file) with a `purpose` value of `identity_document`. - pub front: Option>, -} - -/// An enum representing the possible values of an `IssuingCardholder`'s `preferred_locales` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum IssuingCardholderPreferredLocales { - De, - En, - Es, - Fr, - It, -} - -impl IssuingCardholderPreferredLocales { - pub fn as_str(self) -> &'static str { - match self { - IssuingCardholderPreferredLocales::De => "de", - IssuingCardholderPreferredLocales::En => "en", - IssuingCardholderPreferredLocales::Es => "es", - IssuingCardholderPreferredLocales::Fr => "fr", - IssuingCardholderPreferredLocales::It => "it", - } - } -} - -impl AsRef for IssuingCardholderPreferredLocales { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for IssuingCardholderPreferredLocales { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for IssuingCardholderPreferredLocales { - fn default() -> Self { - Self::De - } -} - -/// An enum representing the possible values of an `IssuingCardholderRequirements`'s `disabled_reason` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum IssuingCardholderRequirementsDisabledReason { - Listed, - #[serde(rename = "rejected.listed")] - RejectedListed, - #[serde(rename = "requirements.past_due")] - RequirementsPastDue, - UnderReview, -} - -impl IssuingCardholderRequirementsDisabledReason { - pub fn as_str(self) -> &'static str { - match self { - IssuingCardholderRequirementsDisabledReason::Listed => "listed", - IssuingCardholderRequirementsDisabledReason::RejectedListed => "rejected.listed", - IssuingCardholderRequirementsDisabledReason::RequirementsPastDue => { - "requirements.past_due" - } - IssuingCardholderRequirementsDisabledReason::UnderReview => "under_review", - } - } -} - -impl AsRef for IssuingCardholderRequirementsDisabledReason { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for IssuingCardholderRequirementsDisabledReason { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for IssuingCardholderRequirementsDisabledReason { - fn default() -> Self { - Self::Listed - } -} - -/// An enum representing the possible values of an `IssuingCardholderRequirements`'s `past_due` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum IssuingCardholderRequirementsPastDue { - #[serde(rename = "company.tax_id")] - CompanyTaxId, - #[serde(rename = "individual.card_issuing.user_terms_acceptance.date")] - IndividualCardIssuingUserTermsAcceptanceDate, - #[serde(rename = "individual.card_issuing.user_terms_acceptance.ip")] - IndividualCardIssuingUserTermsAcceptanceIp, - #[serde(rename = "individual.dob.day")] - IndividualDobDay, - #[serde(rename = "individual.dob.month")] - IndividualDobMonth, - #[serde(rename = "individual.dob.year")] - IndividualDobYear, - #[serde(rename = "individual.first_name")] - IndividualFirstName, - #[serde(rename = "individual.last_name")] - IndividualLastName, - #[serde(rename = "individual.verification.document")] - IndividualVerificationDocument, -} - -impl IssuingCardholderRequirementsPastDue { - pub fn as_str(self) -> &'static str { - match self { - IssuingCardholderRequirementsPastDue::CompanyTaxId => "company.tax_id", - IssuingCardholderRequirementsPastDue::IndividualCardIssuingUserTermsAcceptanceDate => { - "individual.card_issuing.user_terms_acceptance.date" - } - IssuingCardholderRequirementsPastDue::IndividualCardIssuingUserTermsAcceptanceIp => { - "individual.card_issuing.user_terms_acceptance.ip" - } - IssuingCardholderRequirementsPastDue::IndividualDobDay => "individual.dob.day", - IssuingCardholderRequirementsPastDue::IndividualDobMonth => "individual.dob.month", - IssuingCardholderRequirementsPastDue::IndividualDobYear => "individual.dob.year", - IssuingCardholderRequirementsPastDue::IndividualFirstName => "individual.first_name", - IssuingCardholderRequirementsPastDue::IndividualLastName => "individual.last_name", - IssuingCardholderRequirementsPastDue::IndividualVerificationDocument => { - "individual.verification.document" - } - } - } -} - -impl AsRef for IssuingCardholderRequirementsPastDue { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for IssuingCardholderRequirementsPastDue { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for IssuingCardholderRequirementsPastDue { - fn default() -> Self { - Self::CompanyTaxId - } -} - -/// An enum representing the possible values of an `IssuingCardholderSpendingLimit`'s `categories` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum IssuingCardholderSpendingLimitCategories { - AcRefrigerationRepair, - AccountingBookkeepingServices, - AdvertisingServices, - AgriculturalCooperative, - AirlinesAirCarriers, - AirportsFlyingFields, - AmbulanceServices, - AmusementParksCarnivals, - AntiqueReproductions, - AntiqueShops, - Aquariums, - ArchitecturalSurveyingServices, - ArtDealersAndGalleries, - ArtistsSupplyAndCraftShops, - AutoAndHomeSupplyStores, - AutoBodyRepairShops, - AutoPaintShops, - AutoServiceShops, - AutomatedCashDisburse, - AutomatedFuelDispensers, - AutomobileAssociations, - AutomotivePartsAndAccessoriesStores, - AutomotiveTireStores, - BailAndBondPayments, - Bakeries, - BandsOrchestras, - BarberAndBeautyShops, - BettingCasinoGambling, - BicycleShops, - BilliardPoolEstablishments, - BoatDealers, - BoatRentalsAndLeases, - BookStores, - BooksPeriodicalsAndNewspapers, - BowlingAlleys, - BusLines, - BusinessSecretarialSchools, - BuyingShoppingServices, - CableSatelliteAndOtherPayTelevisionAndRadio, - CameraAndPhotographicSupplyStores, - CandyNutAndConfectioneryStores, - CarAndTruckDealersNewUsed, - CarAndTruckDealersUsedOnly, - CarRentalAgencies, - CarWashes, - CarpentryServices, - CarpetUpholsteryCleaning, - Caterers, - CharitableAndSocialServiceOrganizationsFundraising, - ChemicalsAndAlliedProducts, - ChildCareServices, - ChildrensAndInfantsWearStores, - ChiropodistsPodiatrists, - Chiropractors, - CigarStoresAndStands, - CivicSocialFraternalAssociations, - CleaningAndMaintenance, - ClothingRental, - CollegesUniversities, - CommercialEquipment, - CommercialFootwear, - CommercialPhotographyArtAndGraphics, - CommuterTransportAndFerries, - ComputerNetworkServices, - ComputerProgramming, - ComputerRepair, - ComputerSoftwareStores, - ComputersPeripheralsAndSoftware, - ConcreteWorkServices, - ConstructionMaterials, - ConsultingPublicRelations, - CorrespondenceSchools, - CosmeticStores, - CounselingServices, - CountryClubs, - CourierServices, - CourtCosts, - CreditReportingAgencies, - CruiseLines, - DairyProductsStores, - DanceHallStudiosSchools, - DatingEscortServices, - DentistsOrthodontists, - DepartmentStores, - DetectiveAgencies, - DigitalGoodsApplications, - DigitalGoodsGames, - DigitalGoodsLargeVolume, - DigitalGoodsMedia, - DirectMarketingCatalogMerchant, - DirectMarketingCombinationCatalogAndRetailMerchant, - DirectMarketingInboundTelemarketing, - DirectMarketingInsuranceServices, - DirectMarketingOther, - DirectMarketingOutboundTelemarketing, - DirectMarketingSubscription, - DirectMarketingTravel, - DiscountStores, - Doctors, - DoorToDoorSales, - DraperyWindowCoveringAndUpholsteryStores, - DrinkingPlaces, - DrugStoresAndPharmacies, - DrugsDrugProprietariesAndDruggistSundries, - DryCleaners, - DurableGoods, - DutyFreeStores, - EatingPlacesRestaurants, - EducationalServices, - ElectricRazorStores, - ElectricVehicleCharging, - ElectricalPartsAndEquipment, - ElectricalServices, - ElectronicsRepairShops, - ElectronicsStores, - ElementarySecondarySchools, - EmergencyServicesGcasVisaUseOnly, - EmploymentTempAgencies, - EquipmentRental, - ExterminatingServices, - FamilyClothingStores, - FastFoodRestaurants, - FinancialInstitutions, - FinesGovernmentAdministrativeEntities, - FireplaceFireplaceScreensAndAccessoriesStores, - FloorCoveringStores, - Florists, - FloristsSuppliesNurseryStockAndFlowers, - FreezerAndLockerMeatProvisioners, - FuelDealersNonAutomotive, - FuneralServicesCrematories, - FurnitureHomeFurnishingsAndEquipmentStoresExceptAppliances, - FurnitureRepairRefinishing, - FurriersAndFurShops, - GeneralServices, - GiftCardNoveltyAndSouvenirShops, - GlassPaintAndWallpaperStores, - GlasswareCrystalStores, - GolfCoursesPublic, - GovernmentLicensedHorseDogRacingUsRegionOnly, - GovernmentLicensedOnlineCasionsOnlineGamblingUsRegionOnly, - GovernmentOwnedLotteriesNonUsRegion, - GovernmentOwnedLotteriesUsRegionOnly, - GovernmentServices, - GroceryStoresSupermarkets, - HardwareEquipmentAndSupplies, - HardwareStores, - HealthAndBeautySpas, - HearingAidsSalesAndSupplies, - HeatingPlumbingAC, - HobbyToyAndGameShops, - HomeSupplyWarehouseStores, - Hospitals, - HotelsMotelsAndResorts, - HouseholdApplianceStores, - IndustrialSupplies, - InformationRetrievalServices, - InsuranceDefault, - InsuranceUnderwritingPremiums, - IntraCompanyPurchases, - JewelryStoresWatchesClocksAndSilverwareStores, - LandscapingServices, - Laundries, - LaundryCleaningServices, - LegalServicesAttorneys, - LuggageAndLeatherGoodsStores, - LumberBuildingMaterialsStores, - ManualCashDisburse, - MarinasServiceAndSupplies, - Marketplaces, - MasonryStoneworkAndPlaster, - MassageParlors, - MedicalAndDentalLabs, - MedicalDentalOphthalmicAndHospitalEquipmentAndSupplies, - MedicalServices, - MembershipOrganizations, - MensAndBoysClothingAndAccessoriesStores, - MensWomensClothingStores, - MetalServiceCenters, - Miscellaneous, - MiscellaneousApparelAndAccessoryShops, - MiscellaneousAutoDealers, - MiscellaneousBusinessServices, - MiscellaneousFoodStores, - MiscellaneousGeneralMerchandise, - MiscellaneousGeneralServices, - MiscellaneousHomeFurnishingSpecialtyStores, - MiscellaneousPublishingAndPrinting, - MiscellaneousRecreationServices, - MiscellaneousRepairShops, - MiscellaneousSpecialtyRetail, - MobileHomeDealers, - MotionPictureTheaters, - MotorFreightCarriersAndTrucking, - MotorHomesDealers, - MotorVehicleSuppliesAndNewParts, - MotorcycleShopsAndDealers, - MotorcycleShopsDealers, - MusicStoresMusicalInstrumentsPianosAndSheetMusic, - NewsDealersAndNewsstands, - NonFiMoneyOrders, - NonFiStoredValueCardPurchaseLoad, - NondurableGoods, - NurseriesLawnAndGardenSupplyStores, - NursingPersonalCare, - OfficeAndCommercialFurniture, - OpticiansEyeglasses, - OptometristsOphthalmologist, - OrthopedicGoodsProstheticDevices, - Osteopaths, - PackageStoresBeerWineAndLiquor, - PaintsVarnishesAndSupplies, - ParkingLotsGarages, - PassengerRailways, - PawnShops, - PetShopsPetFoodAndSupplies, - PetroleumAndPetroleumProducts, - PhotoDeveloping, - PhotographicPhotocopyMicrofilmEquipmentAndSupplies, - PhotographicStudios, - PictureVideoProduction, - PieceGoodsNotionsAndOtherDryGoods, - PlumbingHeatingEquipmentAndSupplies, - PoliticalOrganizations, - PostalServicesGovernmentOnly, - PreciousStonesAndMetalsWatchesAndJewelry, - ProfessionalServices, - PublicWarehousingAndStorage, - QuickCopyReproAndBlueprint, - Railroads, - RealEstateAgentsAndManagersRentals, - RecordStores, - RecreationalVehicleRentals, - ReligiousGoodsStores, - ReligiousOrganizations, - RoofingSidingSheetMetal, - SecretarialSupportServices, - SecurityBrokersDealers, - ServiceStations, - SewingNeedleworkFabricAndPieceGoodsStores, - ShoeRepairHatCleaning, - ShoeStores, - SmallApplianceRepair, - SnowmobileDealers, - SpecialTradeServices, - SpecialtyCleaning, - SportingGoodsStores, - SportingRecreationCamps, - SportsAndRidingApparelStores, - SportsClubsFields, - StampAndCoinStores, - StationaryOfficeSuppliesPrintingAndWritingPaper, - StationeryStoresOfficeAndSchoolSupplyStores, - SwimmingPoolsSales, - TUiTravelGermany, - TailorsAlterations, - TaxPaymentsGovernmentAgencies, - TaxPreparationServices, - TaxicabsLimousines, - TelecommunicationEquipmentAndTelephoneSales, - TelecommunicationServices, - TelegraphServices, - TentAndAwningShops, - TestingLaboratories, - TheatricalTicketAgencies, - Timeshares, - TireRetreadingAndRepair, - TollsBridgeFees, - TouristAttractionsAndExhibits, - TowingServices, - TrailerParksCampgrounds, - TransportationServices, - TravelAgenciesTourOperators, - TruckStopIteration, - TruckUtilityTrailerRentals, - TypesettingPlateMakingAndRelatedServices, - TypewriterStores, - USFederalGovernmentAgenciesOrDepartments, - UniformsCommercialClothing, - UsedMerchandiseAndSecondhandStores, - Utilities, - VarietyStores, - VeterinaryServices, - VideoAmusementGameSupplies, - VideoGameArcades, - VideoTapeRentalStores, - VocationalTradeSchools, - WatchJewelryRepair, - WeldingRepair, - WholesaleClubs, - WigAndToupeeStores, - WiresMoneyOrders, - WomensAccessoryAndSpecialtyShops, - WomensReadyToWearStores, - WreckingAndSalvageYards, -} - -impl IssuingCardholderSpendingLimitCategories { - pub fn as_str(self) -> &'static str { - match self { - IssuingCardholderSpendingLimitCategories::AcRefrigerationRepair => "ac_refrigeration_repair", - IssuingCardholderSpendingLimitCategories::AccountingBookkeepingServices => "accounting_bookkeeping_services", - IssuingCardholderSpendingLimitCategories::AdvertisingServices => "advertising_services", - IssuingCardholderSpendingLimitCategories::AgriculturalCooperative => "agricultural_cooperative", - IssuingCardholderSpendingLimitCategories::AirlinesAirCarriers => "airlines_air_carriers", - IssuingCardholderSpendingLimitCategories::AirportsFlyingFields => "airports_flying_fields", - IssuingCardholderSpendingLimitCategories::AmbulanceServices => "ambulance_services", - IssuingCardholderSpendingLimitCategories::AmusementParksCarnivals => "amusement_parks_carnivals", - IssuingCardholderSpendingLimitCategories::AntiqueReproductions => "antique_reproductions", - IssuingCardholderSpendingLimitCategories::AntiqueShops => "antique_shops", - IssuingCardholderSpendingLimitCategories::Aquariums => "aquariums", - IssuingCardholderSpendingLimitCategories::ArchitecturalSurveyingServices => "architectural_surveying_services", - IssuingCardholderSpendingLimitCategories::ArtDealersAndGalleries => "art_dealers_and_galleries", - IssuingCardholderSpendingLimitCategories::ArtistsSupplyAndCraftShops => "artists_supply_and_craft_shops", - IssuingCardholderSpendingLimitCategories::AutoAndHomeSupplyStores => "auto_and_home_supply_stores", - IssuingCardholderSpendingLimitCategories::AutoBodyRepairShops => "auto_body_repair_shops", - IssuingCardholderSpendingLimitCategories::AutoPaintShops => "auto_paint_shops", - IssuingCardholderSpendingLimitCategories::AutoServiceShops => "auto_service_shops", - IssuingCardholderSpendingLimitCategories::AutomatedCashDisburse => "automated_cash_disburse", - IssuingCardholderSpendingLimitCategories::AutomatedFuelDispensers => "automated_fuel_dispensers", - IssuingCardholderSpendingLimitCategories::AutomobileAssociations => "automobile_associations", - IssuingCardholderSpendingLimitCategories::AutomotivePartsAndAccessoriesStores => "automotive_parts_and_accessories_stores", - IssuingCardholderSpendingLimitCategories::AutomotiveTireStores => "automotive_tire_stores", - IssuingCardholderSpendingLimitCategories::BailAndBondPayments => "bail_and_bond_payments", - IssuingCardholderSpendingLimitCategories::Bakeries => "bakeries", - IssuingCardholderSpendingLimitCategories::BandsOrchestras => "bands_orchestras", - IssuingCardholderSpendingLimitCategories::BarberAndBeautyShops => "barber_and_beauty_shops", - IssuingCardholderSpendingLimitCategories::BettingCasinoGambling => "betting_casino_gambling", - IssuingCardholderSpendingLimitCategories::BicycleShops => "bicycle_shops", - IssuingCardholderSpendingLimitCategories::BilliardPoolEstablishments => "billiard_pool_establishments", - IssuingCardholderSpendingLimitCategories::BoatDealers => "boat_dealers", - IssuingCardholderSpendingLimitCategories::BoatRentalsAndLeases => "boat_rentals_and_leases", - IssuingCardholderSpendingLimitCategories::BookStores => "book_stores", - IssuingCardholderSpendingLimitCategories::BooksPeriodicalsAndNewspapers => "books_periodicals_and_newspapers", - IssuingCardholderSpendingLimitCategories::BowlingAlleys => "bowling_alleys", - IssuingCardholderSpendingLimitCategories::BusLines => "bus_lines", - IssuingCardholderSpendingLimitCategories::BusinessSecretarialSchools => "business_secretarial_schools", - IssuingCardholderSpendingLimitCategories::BuyingShoppingServices => "buying_shopping_services", - IssuingCardholderSpendingLimitCategories::CableSatelliteAndOtherPayTelevisionAndRadio => "cable_satellite_and_other_pay_television_and_radio", - IssuingCardholderSpendingLimitCategories::CameraAndPhotographicSupplyStores => "camera_and_photographic_supply_stores", - IssuingCardholderSpendingLimitCategories::CandyNutAndConfectioneryStores => "candy_nut_and_confectionery_stores", - IssuingCardholderSpendingLimitCategories::CarAndTruckDealersNewUsed => "car_and_truck_dealers_new_used", - IssuingCardholderSpendingLimitCategories::CarAndTruckDealersUsedOnly => "car_and_truck_dealers_used_only", - IssuingCardholderSpendingLimitCategories::CarRentalAgencies => "car_rental_agencies", - IssuingCardholderSpendingLimitCategories::CarWashes => "car_washes", - IssuingCardholderSpendingLimitCategories::CarpentryServices => "carpentry_services", - IssuingCardholderSpendingLimitCategories::CarpetUpholsteryCleaning => "carpet_upholstery_cleaning", - IssuingCardholderSpendingLimitCategories::Caterers => "caterers", - IssuingCardholderSpendingLimitCategories::CharitableAndSocialServiceOrganizationsFundraising => "charitable_and_social_service_organizations_fundraising", - IssuingCardholderSpendingLimitCategories::ChemicalsAndAlliedProducts => "chemicals_and_allied_products", - IssuingCardholderSpendingLimitCategories::ChildCareServices => "child_care_services", - IssuingCardholderSpendingLimitCategories::ChildrensAndInfantsWearStores => "childrens_and_infants_wear_stores", - IssuingCardholderSpendingLimitCategories::ChiropodistsPodiatrists => "chiropodists_podiatrists", - IssuingCardholderSpendingLimitCategories::Chiropractors => "chiropractors", - IssuingCardholderSpendingLimitCategories::CigarStoresAndStands => "cigar_stores_and_stands", - IssuingCardholderSpendingLimitCategories::CivicSocialFraternalAssociations => "civic_social_fraternal_associations", - IssuingCardholderSpendingLimitCategories::CleaningAndMaintenance => "cleaning_and_maintenance", - IssuingCardholderSpendingLimitCategories::ClothingRental => "clothing_rental", - IssuingCardholderSpendingLimitCategories::CollegesUniversities => "colleges_universities", - IssuingCardholderSpendingLimitCategories::CommercialEquipment => "commercial_equipment", - IssuingCardholderSpendingLimitCategories::CommercialFootwear => "commercial_footwear", - IssuingCardholderSpendingLimitCategories::CommercialPhotographyArtAndGraphics => "commercial_photography_art_and_graphics", - IssuingCardholderSpendingLimitCategories::CommuterTransportAndFerries => "commuter_transport_and_ferries", - IssuingCardholderSpendingLimitCategories::ComputerNetworkServices => "computer_network_services", - IssuingCardholderSpendingLimitCategories::ComputerProgramming => "computer_programming", - IssuingCardholderSpendingLimitCategories::ComputerRepair => "computer_repair", - IssuingCardholderSpendingLimitCategories::ComputerSoftwareStores => "computer_software_stores", - IssuingCardholderSpendingLimitCategories::ComputersPeripheralsAndSoftware => "computers_peripherals_and_software", - IssuingCardholderSpendingLimitCategories::ConcreteWorkServices => "concrete_work_services", - IssuingCardholderSpendingLimitCategories::ConstructionMaterials => "construction_materials", - IssuingCardholderSpendingLimitCategories::ConsultingPublicRelations => "consulting_public_relations", - IssuingCardholderSpendingLimitCategories::CorrespondenceSchools => "correspondence_schools", - IssuingCardholderSpendingLimitCategories::CosmeticStores => "cosmetic_stores", - IssuingCardholderSpendingLimitCategories::CounselingServices => "counseling_services", - IssuingCardholderSpendingLimitCategories::CountryClubs => "country_clubs", - IssuingCardholderSpendingLimitCategories::CourierServices => "courier_services", - IssuingCardholderSpendingLimitCategories::CourtCosts => "court_costs", - IssuingCardholderSpendingLimitCategories::CreditReportingAgencies => "credit_reporting_agencies", - IssuingCardholderSpendingLimitCategories::CruiseLines => "cruise_lines", - IssuingCardholderSpendingLimitCategories::DairyProductsStores => "dairy_products_stores", - IssuingCardholderSpendingLimitCategories::DanceHallStudiosSchools => "dance_hall_studios_schools", - IssuingCardholderSpendingLimitCategories::DatingEscortServices => "dating_escort_services", - IssuingCardholderSpendingLimitCategories::DentistsOrthodontists => "dentists_orthodontists", - IssuingCardholderSpendingLimitCategories::DepartmentStores => "department_stores", - IssuingCardholderSpendingLimitCategories::DetectiveAgencies => "detective_agencies", - IssuingCardholderSpendingLimitCategories::DigitalGoodsApplications => "digital_goods_applications", - IssuingCardholderSpendingLimitCategories::DigitalGoodsGames => "digital_goods_games", - IssuingCardholderSpendingLimitCategories::DigitalGoodsLargeVolume => "digital_goods_large_volume", - IssuingCardholderSpendingLimitCategories::DigitalGoodsMedia => "digital_goods_media", - IssuingCardholderSpendingLimitCategories::DirectMarketingCatalogMerchant => "direct_marketing_catalog_merchant", - IssuingCardholderSpendingLimitCategories::DirectMarketingCombinationCatalogAndRetailMerchant => "direct_marketing_combination_catalog_and_retail_merchant", - IssuingCardholderSpendingLimitCategories::DirectMarketingInboundTelemarketing => "direct_marketing_inbound_telemarketing", - IssuingCardholderSpendingLimitCategories::DirectMarketingInsuranceServices => "direct_marketing_insurance_services", - IssuingCardholderSpendingLimitCategories::DirectMarketingOther => "direct_marketing_other", - IssuingCardholderSpendingLimitCategories::DirectMarketingOutboundTelemarketing => "direct_marketing_outbound_telemarketing", - IssuingCardholderSpendingLimitCategories::DirectMarketingSubscription => "direct_marketing_subscription", - IssuingCardholderSpendingLimitCategories::DirectMarketingTravel => "direct_marketing_travel", - IssuingCardholderSpendingLimitCategories::DiscountStores => "discount_stores", - IssuingCardholderSpendingLimitCategories::Doctors => "doctors", - IssuingCardholderSpendingLimitCategories::DoorToDoorSales => "door_to_door_sales", - IssuingCardholderSpendingLimitCategories::DraperyWindowCoveringAndUpholsteryStores => "drapery_window_covering_and_upholstery_stores", - IssuingCardholderSpendingLimitCategories::DrinkingPlaces => "drinking_places", - IssuingCardholderSpendingLimitCategories::DrugStoresAndPharmacies => "drug_stores_and_pharmacies", - IssuingCardholderSpendingLimitCategories::DrugsDrugProprietariesAndDruggistSundries => "drugs_drug_proprietaries_and_druggist_sundries", - IssuingCardholderSpendingLimitCategories::DryCleaners => "dry_cleaners", - IssuingCardholderSpendingLimitCategories::DurableGoods => "durable_goods", - IssuingCardholderSpendingLimitCategories::DutyFreeStores => "duty_free_stores", - IssuingCardholderSpendingLimitCategories::EatingPlacesRestaurants => "eating_places_restaurants", - IssuingCardholderSpendingLimitCategories::EducationalServices => "educational_services", - IssuingCardholderSpendingLimitCategories::ElectricRazorStores => "electric_razor_stores", - IssuingCardholderSpendingLimitCategories::ElectricVehicleCharging => "electric_vehicle_charging", - IssuingCardholderSpendingLimitCategories::ElectricalPartsAndEquipment => "electrical_parts_and_equipment", - IssuingCardholderSpendingLimitCategories::ElectricalServices => "electrical_services", - IssuingCardholderSpendingLimitCategories::ElectronicsRepairShops => "electronics_repair_shops", - IssuingCardholderSpendingLimitCategories::ElectronicsStores => "electronics_stores", - IssuingCardholderSpendingLimitCategories::ElementarySecondarySchools => "elementary_secondary_schools", - IssuingCardholderSpendingLimitCategories::EmergencyServicesGcasVisaUseOnly => "emergency_services_gcas_visa_use_only", - IssuingCardholderSpendingLimitCategories::EmploymentTempAgencies => "employment_temp_agencies", - IssuingCardholderSpendingLimitCategories::EquipmentRental => "equipment_rental", - IssuingCardholderSpendingLimitCategories::ExterminatingServices => "exterminating_services", - IssuingCardholderSpendingLimitCategories::FamilyClothingStores => "family_clothing_stores", - IssuingCardholderSpendingLimitCategories::FastFoodRestaurants => "fast_food_restaurants", - IssuingCardholderSpendingLimitCategories::FinancialInstitutions => "financial_institutions", - IssuingCardholderSpendingLimitCategories::FinesGovernmentAdministrativeEntities => "fines_government_administrative_entities", - IssuingCardholderSpendingLimitCategories::FireplaceFireplaceScreensAndAccessoriesStores => "fireplace_fireplace_screens_and_accessories_stores", - IssuingCardholderSpendingLimitCategories::FloorCoveringStores => "floor_covering_stores", - IssuingCardholderSpendingLimitCategories::Florists => "florists", - IssuingCardholderSpendingLimitCategories::FloristsSuppliesNurseryStockAndFlowers => "florists_supplies_nursery_stock_and_flowers", - IssuingCardholderSpendingLimitCategories::FreezerAndLockerMeatProvisioners => "freezer_and_locker_meat_provisioners", - IssuingCardholderSpendingLimitCategories::FuelDealersNonAutomotive => "fuel_dealers_non_automotive", - IssuingCardholderSpendingLimitCategories::FuneralServicesCrematories => "funeral_services_crematories", - IssuingCardholderSpendingLimitCategories::FurnitureHomeFurnishingsAndEquipmentStoresExceptAppliances => "furniture_home_furnishings_and_equipment_stores_except_appliances", - IssuingCardholderSpendingLimitCategories::FurnitureRepairRefinishing => "furniture_repair_refinishing", - IssuingCardholderSpendingLimitCategories::FurriersAndFurShops => "furriers_and_fur_shops", - IssuingCardholderSpendingLimitCategories::GeneralServices => "general_services", - IssuingCardholderSpendingLimitCategories::GiftCardNoveltyAndSouvenirShops => "gift_card_novelty_and_souvenir_shops", - IssuingCardholderSpendingLimitCategories::GlassPaintAndWallpaperStores => "glass_paint_and_wallpaper_stores", - IssuingCardholderSpendingLimitCategories::GlasswareCrystalStores => "glassware_crystal_stores", - IssuingCardholderSpendingLimitCategories::GolfCoursesPublic => "golf_courses_public", - IssuingCardholderSpendingLimitCategories::GovernmentLicensedHorseDogRacingUsRegionOnly => "government_licensed_horse_dog_racing_us_region_only", - IssuingCardholderSpendingLimitCategories::GovernmentLicensedOnlineCasionsOnlineGamblingUsRegionOnly => "government_licensed_online_casions_online_gambling_us_region_only", - IssuingCardholderSpendingLimitCategories::GovernmentOwnedLotteriesNonUsRegion => "government_owned_lotteries_non_us_region", - IssuingCardholderSpendingLimitCategories::GovernmentOwnedLotteriesUsRegionOnly => "government_owned_lotteries_us_region_only", - IssuingCardholderSpendingLimitCategories::GovernmentServices => "government_services", - IssuingCardholderSpendingLimitCategories::GroceryStoresSupermarkets => "grocery_stores_supermarkets", - IssuingCardholderSpendingLimitCategories::HardwareEquipmentAndSupplies => "hardware_equipment_and_supplies", - IssuingCardholderSpendingLimitCategories::HardwareStores => "hardware_stores", - IssuingCardholderSpendingLimitCategories::HealthAndBeautySpas => "health_and_beauty_spas", - IssuingCardholderSpendingLimitCategories::HearingAidsSalesAndSupplies => "hearing_aids_sales_and_supplies", - IssuingCardholderSpendingLimitCategories::HeatingPlumbingAC => "heating_plumbing_a_c", - IssuingCardholderSpendingLimitCategories::HobbyToyAndGameShops => "hobby_toy_and_game_shops", - IssuingCardholderSpendingLimitCategories::HomeSupplyWarehouseStores => "home_supply_warehouse_stores", - IssuingCardholderSpendingLimitCategories::Hospitals => "hospitals", - IssuingCardholderSpendingLimitCategories::HotelsMotelsAndResorts => "hotels_motels_and_resorts", - IssuingCardholderSpendingLimitCategories::HouseholdApplianceStores => "household_appliance_stores", - IssuingCardholderSpendingLimitCategories::IndustrialSupplies => "industrial_supplies", - IssuingCardholderSpendingLimitCategories::InformationRetrievalServices => "information_retrieval_services", - IssuingCardholderSpendingLimitCategories::InsuranceDefault => "insurance_default", - IssuingCardholderSpendingLimitCategories::InsuranceUnderwritingPremiums => "insurance_underwriting_premiums", - IssuingCardholderSpendingLimitCategories::IntraCompanyPurchases => "intra_company_purchases", - IssuingCardholderSpendingLimitCategories::JewelryStoresWatchesClocksAndSilverwareStores => "jewelry_stores_watches_clocks_and_silverware_stores", - IssuingCardholderSpendingLimitCategories::LandscapingServices => "landscaping_services", - IssuingCardholderSpendingLimitCategories::Laundries => "laundries", - IssuingCardholderSpendingLimitCategories::LaundryCleaningServices => "laundry_cleaning_services", - IssuingCardholderSpendingLimitCategories::LegalServicesAttorneys => "legal_services_attorneys", - IssuingCardholderSpendingLimitCategories::LuggageAndLeatherGoodsStores => "luggage_and_leather_goods_stores", - IssuingCardholderSpendingLimitCategories::LumberBuildingMaterialsStores => "lumber_building_materials_stores", - IssuingCardholderSpendingLimitCategories::ManualCashDisburse => "manual_cash_disburse", - IssuingCardholderSpendingLimitCategories::MarinasServiceAndSupplies => "marinas_service_and_supplies", - IssuingCardholderSpendingLimitCategories::Marketplaces => "marketplaces", - IssuingCardholderSpendingLimitCategories::MasonryStoneworkAndPlaster => "masonry_stonework_and_plaster", - IssuingCardholderSpendingLimitCategories::MassageParlors => "massage_parlors", - IssuingCardholderSpendingLimitCategories::MedicalAndDentalLabs => "medical_and_dental_labs", - IssuingCardholderSpendingLimitCategories::MedicalDentalOphthalmicAndHospitalEquipmentAndSupplies => "medical_dental_ophthalmic_and_hospital_equipment_and_supplies", - IssuingCardholderSpendingLimitCategories::MedicalServices => "medical_services", - IssuingCardholderSpendingLimitCategories::MembershipOrganizations => "membership_organizations", - IssuingCardholderSpendingLimitCategories::MensAndBoysClothingAndAccessoriesStores => "mens_and_boys_clothing_and_accessories_stores", - IssuingCardholderSpendingLimitCategories::MensWomensClothingStores => "mens_womens_clothing_stores", - IssuingCardholderSpendingLimitCategories::MetalServiceCenters => "metal_service_centers", - IssuingCardholderSpendingLimitCategories::Miscellaneous => "miscellaneous", - IssuingCardholderSpendingLimitCategories::MiscellaneousApparelAndAccessoryShops => "miscellaneous_apparel_and_accessory_shops", - IssuingCardholderSpendingLimitCategories::MiscellaneousAutoDealers => "miscellaneous_auto_dealers", - IssuingCardholderSpendingLimitCategories::MiscellaneousBusinessServices => "miscellaneous_business_services", - IssuingCardholderSpendingLimitCategories::MiscellaneousFoodStores => "miscellaneous_food_stores", - IssuingCardholderSpendingLimitCategories::MiscellaneousGeneralMerchandise => "miscellaneous_general_merchandise", - IssuingCardholderSpendingLimitCategories::MiscellaneousGeneralServices => "miscellaneous_general_services", - IssuingCardholderSpendingLimitCategories::MiscellaneousHomeFurnishingSpecialtyStores => "miscellaneous_home_furnishing_specialty_stores", - IssuingCardholderSpendingLimitCategories::MiscellaneousPublishingAndPrinting => "miscellaneous_publishing_and_printing", - IssuingCardholderSpendingLimitCategories::MiscellaneousRecreationServices => "miscellaneous_recreation_services", - IssuingCardholderSpendingLimitCategories::MiscellaneousRepairShops => "miscellaneous_repair_shops", - IssuingCardholderSpendingLimitCategories::MiscellaneousSpecialtyRetail => "miscellaneous_specialty_retail", - IssuingCardholderSpendingLimitCategories::MobileHomeDealers => "mobile_home_dealers", - IssuingCardholderSpendingLimitCategories::MotionPictureTheaters => "motion_picture_theaters", - IssuingCardholderSpendingLimitCategories::MotorFreightCarriersAndTrucking => "motor_freight_carriers_and_trucking", - IssuingCardholderSpendingLimitCategories::MotorHomesDealers => "motor_homes_dealers", - IssuingCardholderSpendingLimitCategories::MotorVehicleSuppliesAndNewParts => "motor_vehicle_supplies_and_new_parts", - IssuingCardholderSpendingLimitCategories::MotorcycleShopsAndDealers => "motorcycle_shops_and_dealers", - IssuingCardholderSpendingLimitCategories::MotorcycleShopsDealers => "motorcycle_shops_dealers", - IssuingCardholderSpendingLimitCategories::MusicStoresMusicalInstrumentsPianosAndSheetMusic => "music_stores_musical_instruments_pianos_and_sheet_music", - IssuingCardholderSpendingLimitCategories::NewsDealersAndNewsstands => "news_dealers_and_newsstands", - IssuingCardholderSpendingLimitCategories::NonFiMoneyOrders => "non_fi_money_orders", - IssuingCardholderSpendingLimitCategories::NonFiStoredValueCardPurchaseLoad => "non_fi_stored_value_card_purchase_load", - IssuingCardholderSpendingLimitCategories::NondurableGoods => "nondurable_goods", - IssuingCardholderSpendingLimitCategories::NurseriesLawnAndGardenSupplyStores => "nurseries_lawn_and_garden_supply_stores", - IssuingCardholderSpendingLimitCategories::NursingPersonalCare => "nursing_personal_care", - IssuingCardholderSpendingLimitCategories::OfficeAndCommercialFurniture => "office_and_commercial_furniture", - IssuingCardholderSpendingLimitCategories::OpticiansEyeglasses => "opticians_eyeglasses", - IssuingCardholderSpendingLimitCategories::OptometristsOphthalmologist => "optometrists_ophthalmologist", - IssuingCardholderSpendingLimitCategories::OrthopedicGoodsProstheticDevices => "orthopedic_goods_prosthetic_devices", - IssuingCardholderSpendingLimitCategories::Osteopaths => "osteopaths", - IssuingCardholderSpendingLimitCategories::PackageStoresBeerWineAndLiquor => "package_stores_beer_wine_and_liquor", - IssuingCardholderSpendingLimitCategories::PaintsVarnishesAndSupplies => "paints_varnishes_and_supplies", - IssuingCardholderSpendingLimitCategories::ParkingLotsGarages => "parking_lots_garages", - IssuingCardholderSpendingLimitCategories::PassengerRailways => "passenger_railways", - IssuingCardholderSpendingLimitCategories::PawnShops => "pawn_shops", - IssuingCardholderSpendingLimitCategories::PetShopsPetFoodAndSupplies => "pet_shops_pet_food_and_supplies", - IssuingCardholderSpendingLimitCategories::PetroleumAndPetroleumProducts => "petroleum_and_petroleum_products", - IssuingCardholderSpendingLimitCategories::PhotoDeveloping => "photo_developing", - IssuingCardholderSpendingLimitCategories::PhotographicPhotocopyMicrofilmEquipmentAndSupplies => "photographic_photocopy_microfilm_equipment_and_supplies", - IssuingCardholderSpendingLimitCategories::PhotographicStudios => "photographic_studios", - IssuingCardholderSpendingLimitCategories::PictureVideoProduction => "picture_video_production", - IssuingCardholderSpendingLimitCategories::PieceGoodsNotionsAndOtherDryGoods => "piece_goods_notions_and_other_dry_goods", - IssuingCardholderSpendingLimitCategories::PlumbingHeatingEquipmentAndSupplies => "plumbing_heating_equipment_and_supplies", - IssuingCardholderSpendingLimitCategories::PoliticalOrganizations => "political_organizations", - IssuingCardholderSpendingLimitCategories::PostalServicesGovernmentOnly => "postal_services_government_only", - IssuingCardholderSpendingLimitCategories::PreciousStonesAndMetalsWatchesAndJewelry => "precious_stones_and_metals_watches_and_jewelry", - IssuingCardholderSpendingLimitCategories::ProfessionalServices => "professional_services", - IssuingCardholderSpendingLimitCategories::PublicWarehousingAndStorage => "public_warehousing_and_storage", - IssuingCardholderSpendingLimitCategories::QuickCopyReproAndBlueprint => "quick_copy_repro_and_blueprint", - IssuingCardholderSpendingLimitCategories::Railroads => "railroads", - IssuingCardholderSpendingLimitCategories::RealEstateAgentsAndManagersRentals => "real_estate_agents_and_managers_rentals", - IssuingCardholderSpendingLimitCategories::RecordStores => "record_stores", - IssuingCardholderSpendingLimitCategories::RecreationalVehicleRentals => "recreational_vehicle_rentals", - IssuingCardholderSpendingLimitCategories::ReligiousGoodsStores => "religious_goods_stores", - IssuingCardholderSpendingLimitCategories::ReligiousOrganizations => "religious_organizations", - IssuingCardholderSpendingLimitCategories::RoofingSidingSheetMetal => "roofing_siding_sheet_metal", - IssuingCardholderSpendingLimitCategories::SecretarialSupportServices => "secretarial_support_services", - IssuingCardholderSpendingLimitCategories::SecurityBrokersDealers => "security_brokers_dealers", - IssuingCardholderSpendingLimitCategories::ServiceStations => "service_stations", - IssuingCardholderSpendingLimitCategories::SewingNeedleworkFabricAndPieceGoodsStores => "sewing_needlework_fabric_and_piece_goods_stores", - IssuingCardholderSpendingLimitCategories::ShoeRepairHatCleaning => "shoe_repair_hat_cleaning", - IssuingCardholderSpendingLimitCategories::ShoeStores => "shoe_stores", - IssuingCardholderSpendingLimitCategories::SmallApplianceRepair => "small_appliance_repair", - IssuingCardholderSpendingLimitCategories::SnowmobileDealers => "snowmobile_dealers", - IssuingCardholderSpendingLimitCategories::SpecialTradeServices => "special_trade_services", - IssuingCardholderSpendingLimitCategories::SpecialtyCleaning => "specialty_cleaning", - IssuingCardholderSpendingLimitCategories::SportingGoodsStores => "sporting_goods_stores", - IssuingCardholderSpendingLimitCategories::SportingRecreationCamps => "sporting_recreation_camps", - IssuingCardholderSpendingLimitCategories::SportsAndRidingApparelStores => "sports_and_riding_apparel_stores", - IssuingCardholderSpendingLimitCategories::SportsClubsFields => "sports_clubs_fields", - IssuingCardholderSpendingLimitCategories::StampAndCoinStores => "stamp_and_coin_stores", - IssuingCardholderSpendingLimitCategories::StationaryOfficeSuppliesPrintingAndWritingPaper => "stationary_office_supplies_printing_and_writing_paper", - IssuingCardholderSpendingLimitCategories::StationeryStoresOfficeAndSchoolSupplyStores => "stationery_stores_office_and_school_supply_stores", - IssuingCardholderSpendingLimitCategories::SwimmingPoolsSales => "swimming_pools_sales", - IssuingCardholderSpendingLimitCategories::TUiTravelGermany => "t_ui_travel_germany", - IssuingCardholderSpendingLimitCategories::TailorsAlterations => "tailors_alterations", - IssuingCardholderSpendingLimitCategories::TaxPaymentsGovernmentAgencies => "tax_payments_government_agencies", - IssuingCardholderSpendingLimitCategories::TaxPreparationServices => "tax_preparation_services", - IssuingCardholderSpendingLimitCategories::TaxicabsLimousines => "taxicabs_limousines", - IssuingCardholderSpendingLimitCategories::TelecommunicationEquipmentAndTelephoneSales => "telecommunication_equipment_and_telephone_sales", - IssuingCardholderSpendingLimitCategories::TelecommunicationServices => "telecommunication_services", - IssuingCardholderSpendingLimitCategories::TelegraphServices => "telegraph_services", - IssuingCardholderSpendingLimitCategories::TentAndAwningShops => "tent_and_awning_shops", - IssuingCardholderSpendingLimitCategories::TestingLaboratories => "testing_laboratories", - IssuingCardholderSpendingLimitCategories::TheatricalTicketAgencies => "theatrical_ticket_agencies", - IssuingCardholderSpendingLimitCategories::Timeshares => "timeshares", - IssuingCardholderSpendingLimitCategories::TireRetreadingAndRepair => "tire_retreading_and_repair", - IssuingCardholderSpendingLimitCategories::TollsBridgeFees => "tolls_bridge_fees", - IssuingCardholderSpendingLimitCategories::TouristAttractionsAndExhibits => "tourist_attractions_and_exhibits", - IssuingCardholderSpendingLimitCategories::TowingServices => "towing_services", - IssuingCardholderSpendingLimitCategories::TrailerParksCampgrounds => "trailer_parks_campgrounds", - IssuingCardholderSpendingLimitCategories::TransportationServices => "transportation_services", - IssuingCardholderSpendingLimitCategories::TravelAgenciesTourOperators => "travel_agencies_tour_operators", - IssuingCardholderSpendingLimitCategories::TruckStopIteration => "truck_stop_iteration", - IssuingCardholderSpendingLimitCategories::TruckUtilityTrailerRentals => "truck_utility_trailer_rentals", - IssuingCardholderSpendingLimitCategories::TypesettingPlateMakingAndRelatedServices => "typesetting_plate_making_and_related_services", - IssuingCardholderSpendingLimitCategories::TypewriterStores => "typewriter_stores", - IssuingCardholderSpendingLimitCategories::USFederalGovernmentAgenciesOrDepartments => "u_s_federal_government_agencies_or_departments", - IssuingCardholderSpendingLimitCategories::UniformsCommercialClothing => "uniforms_commercial_clothing", - IssuingCardholderSpendingLimitCategories::UsedMerchandiseAndSecondhandStores => "used_merchandise_and_secondhand_stores", - IssuingCardholderSpendingLimitCategories::Utilities => "utilities", - IssuingCardholderSpendingLimitCategories::VarietyStores => "variety_stores", - IssuingCardholderSpendingLimitCategories::VeterinaryServices => "veterinary_services", - IssuingCardholderSpendingLimitCategories::VideoAmusementGameSupplies => "video_amusement_game_supplies", - IssuingCardholderSpendingLimitCategories::VideoGameArcades => "video_game_arcades", - IssuingCardholderSpendingLimitCategories::VideoTapeRentalStores => "video_tape_rental_stores", - IssuingCardholderSpendingLimitCategories::VocationalTradeSchools => "vocational_trade_schools", - IssuingCardholderSpendingLimitCategories::WatchJewelryRepair => "watch_jewelry_repair", - IssuingCardholderSpendingLimitCategories::WeldingRepair => "welding_repair", - IssuingCardholderSpendingLimitCategories::WholesaleClubs => "wholesale_clubs", - IssuingCardholderSpendingLimitCategories::WigAndToupeeStores => "wig_and_toupee_stores", - IssuingCardholderSpendingLimitCategories::WiresMoneyOrders => "wires_money_orders", - IssuingCardholderSpendingLimitCategories::WomensAccessoryAndSpecialtyShops => "womens_accessory_and_specialty_shops", - IssuingCardholderSpendingLimitCategories::WomensReadyToWearStores => "womens_ready_to_wear_stores", - IssuingCardholderSpendingLimitCategories::WreckingAndSalvageYards => "wrecking_and_salvage_yards", - } - } -} - -impl AsRef for IssuingCardholderSpendingLimitCategories { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for IssuingCardholderSpendingLimitCategories { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for IssuingCardholderSpendingLimitCategories { - fn default() -> Self { - Self::AcRefrigerationRepair - } -} - -/// An enum representing the possible values of an `IssuingCardholderSpendingLimit`'s `interval` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum IssuingCardholderSpendingLimitInterval { - AllTime, - Daily, - Monthly, - PerAuthorization, - Weekly, - Yearly, -} - -impl IssuingCardholderSpendingLimitInterval { - pub fn as_str(self) -> &'static str { - match self { - IssuingCardholderSpendingLimitInterval::AllTime => "all_time", - IssuingCardholderSpendingLimitInterval::Daily => "daily", - IssuingCardholderSpendingLimitInterval::Monthly => "monthly", - IssuingCardholderSpendingLimitInterval::PerAuthorization => "per_authorization", - IssuingCardholderSpendingLimitInterval::Weekly => "weekly", - IssuingCardholderSpendingLimitInterval::Yearly => "yearly", - } - } -} - -impl AsRef for IssuingCardholderSpendingLimitInterval { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for IssuingCardholderSpendingLimitInterval { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for IssuingCardholderSpendingLimitInterval { - fn default() -> Self { - Self::AllTime - } -} - -/// An enum representing the possible values of an `IssuingCardholder`'s `status` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum IssuingCardholderStatus { - Active, - Blocked, - Inactive, -} - -impl IssuingCardholderStatus { - pub fn as_str(self) -> &'static str { - match self { - IssuingCardholderStatus::Active => "active", - IssuingCardholderStatus::Blocked => "blocked", - IssuingCardholderStatus::Inactive => "inactive", - } - } -} - -impl AsRef for IssuingCardholderStatus { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for IssuingCardholderStatus { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for IssuingCardholderStatus { - fn default() -> Self { - Self::Active - } -} - -/// An enum representing the possible values of an `IssuingCardholder`'s `type` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum IssuingCardholderType { - Company, - Individual, -} - -impl IssuingCardholderType { - pub fn as_str(self) -> &'static str { - match self { - IssuingCardholderType::Company => "company", - IssuingCardholderType::Individual => "individual", - } - } -} - -impl AsRef for IssuingCardholderType { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for IssuingCardholderType { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for IssuingCardholderType { - fn default() -> Self { - Self::Company - } -} diff --git a/src/resources/generated/issuing_cardholder_created.rs b/src/resources/generated/issuing_cardholder_created.rs deleted file mode 100644 index c771d53dd..000000000 --- a/src/resources/generated/issuing_cardholder_created.rs +++ /dev/null @@ -1,10 +0,0 @@ -// ====================================== -// This file was automatically generated. -// ====================================== - -use serde::{Deserialize, Serialize}; - -/// The resource representing a Stripe "issuing_cardholder.created". -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct IssuingCardholderCreated { -} diff --git a/src/resources/generated/issuing_cardholder_updated.rs b/src/resources/generated/issuing_cardholder_updated.rs deleted file mode 100644 index d1d801275..000000000 --- a/src/resources/generated/issuing_cardholder_updated.rs +++ /dev/null @@ -1,10 +0,0 @@ -// ====================================== -// This file was automatically generated. -// ====================================== - -use serde::{Deserialize, Serialize}; - -/// The resource representing a Stripe "issuing_cardholder.updated". -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct IssuingCardholderUpdated { -} diff --git a/src/resources/generated/issuing_dispute.rs b/src/resources/generated/issuing_dispute.rs deleted file mode 100644 index 55b88e081..000000000 --- a/src/resources/generated/issuing_dispute.rs +++ /dev/null @@ -1,459 +0,0 @@ -// ====================================== -// This file was automatically generated. -// ====================================== - -use serde::{Deserialize, Serialize}; - -use crate::ids::IssuingDisputeId; -use crate::params::{Expandable, Metadata, Object, Timestamp}; -use crate::resources::{ - BalanceTransaction, Currency, File, IssuingDisputeStatus, IssuingTransaction, -}; - -/// The resource representing a Stripe "IssuingDispute". -/// -/// For more details see -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct IssuingDispute { - /// Unique identifier for the object. - pub id: IssuingDisputeId, - - /// Disputed amount in the card's currency and in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal). - /// - /// Usually the amount of the `transaction`, but can differ (usually because of currency fluctuation). - pub amount: i64, - - /// List of balance transactions associated with the dispute. - pub balance_transactions: Option>, - - /// Time at which the object was created. - /// - /// Measured in seconds since the Unix epoch. - pub created: Timestamp, - - /// The currency the `transaction` was made in. - pub currency: Currency, - - pub evidence: IssuingDisputeEvidence, - - /// Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. - pub livemode: bool, - - /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. - /// - /// This can be useful for storing additional information about the object in a structured format. - pub metadata: Metadata, - - /// Current status of the dispute. - pub status: IssuingDisputeStatus, - - /// The transaction being disputed. - pub transaction: Expandable, - - /// [Treasury](https://stripe.com/docs/api/treasury) details related to this dispute if it was created on a [FinancialAccount](/docs/api/treasury/financial_accounts. - #[serde(skip_serializing_if = "Option::is_none")] - pub treasury: Option, -} - -impl Object for IssuingDispute { - type Id = IssuingDisputeId; - fn id(&self) -> Self::Id { - self.id.clone() - } - fn object(&self) -> &'static str { - "issuing.dispute" - } -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct IssuingDisputeEvidence { - #[serde(skip_serializing_if = "Option::is_none")] - pub canceled: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub duplicate: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub fraudulent: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub merchandise_not_as_described: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub not_received: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub other: Option, - - /// The reason for filing the dispute. - /// - /// Its value will match the field containing the evidence. - pub reason: IssuingDisputeEvidenceReason, - - #[serde(skip_serializing_if = "Option::is_none")] - pub service_not_as_described: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct IssuingDisputeCanceledEvidence { - /// (ID of a [file upload](https://stripe.com/docs/guides/file-upload)) Additional documentation supporting the dispute. - pub additional_documentation: Option>, - - /// Date when order was canceled. - pub canceled_at: Option, - - /// Whether the cardholder was provided with a cancellation policy. - pub cancellation_policy_provided: Option, - - /// Reason for canceling the order. - pub cancellation_reason: Option, - - /// Date when the cardholder expected to receive the product. - pub expected_at: Option, - - /// Explanation of why the cardholder is disputing this transaction. - pub explanation: Option, - - /// Description of the merchandise or service that was purchased. - pub product_description: Option, - - /// Whether the product was a merchandise or service. - pub product_type: Option, - - /// Result of cardholder's attempt to return the product. - pub return_status: Option, - - /// Date when the product was returned or attempted to be returned. - pub returned_at: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct IssuingDisputeDuplicateEvidence { - /// (ID of a [file upload](https://stripe.com/docs/guides/file-upload)) Additional documentation supporting the dispute. - pub additional_documentation: Option>, - - /// (ID of a [file upload](https://stripe.com/docs/guides/file-upload)) Copy of the card statement showing that the product had already been paid for. - pub card_statement: Option>, - - /// (ID of a [file upload](https://stripe.com/docs/guides/file-upload)) Copy of the receipt showing that the product had been paid for in cash. - pub cash_receipt: Option>, - - /// (ID of a [file upload](https://stripe.com/docs/guides/file-upload)) Image of the front and back of the check that was used to pay for the product. - pub check_image: Option>, - - /// Explanation of why the cardholder is disputing this transaction. - pub explanation: Option, - - /// Transaction (e.g., ipi_...) that the disputed transaction is a duplicate of. - /// - /// Of the two or more transactions that are copies of each other, this is original undisputed one. - pub original_transaction: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct IssuingDisputeFraudulentEvidence { - /// (ID of a [file upload](https://stripe.com/docs/guides/file-upload)) Additional documentation supporting the dispute. - pub additional_documentation: Option>, - - /// Explanation of why the cardholder is disputing this transaction. - pub explanation: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct IssuingDisputeMerchandiseNotAsDescribedEvidence { - /// (ID of a [file upload](https://stripe.com/docs/guides/file-upload)) Additional documentation supporting the dispute. - pub additional_documentation: Option>, - - /// Explanation of why the cardholder is disputing this transaction. - pub explanation: Option, - - /// Date when the product was received. - pub received_at: Option, - - /// Description of the cardholder's attempt to return the product. - pub return_description: Option, - - /// Result of cardholder's attempt to return the product. - pub return_status: Option, - - /// Date when the product was returned or attempted to be returned. - pub returned_at: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct IssuingDisputeNotReceivedEvidence { - /// (ID of a [file upload](https://stripe.com/docs/guides/file-upload)) Additional documentation supporting the dispute. - pub additional_documentation: Option>, - - /// Date when the cardholder expected to receive the product. - pub expected_at: Option, - - /// Explanation of why the cardholder is disputing this transaction. - pub explanation: Option, - - /// Description of the merchandise or service that was purchased. - pub product_description: Option, - - /// Whether the product was a merchandise or service. - pub product_type: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct IssuingDisputeOtherEvidence { - /// (ID of a [file upload](https://stripe.com/docs/guides/file-upload)) Additional documentation supporting the dispute. - pub additional_documentation: Option>, - - /// Explanation of why the cardholder is disputing this transaction. - pub explanation: Option, - - /// Description of the merchandise or service that was purchased. - pub product_description: Option, - - /// Whether the product was a merchandise or service. - pub product_type: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct IssuingDisputeServiceNotAsDescribedEvidence { - /// (ID of a [file upload](https://stripe.com/docs/guides/file-upload)) Additional documentation supporting the dispute. - pub additional_documentation: Option>, - - /// Date when order was canceled. - pub canceled_at: Option, - - /// Reason for canceling the order. - pub cancellation_reason: Option, - - /// Explanation of why the cardholder is disputing this transaction. - pub explanation: Option, - - /// Date when the product was received. - pub received_at: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct IssuingDisputeTreasury { - /// The Treasury [DebitReversal](https://stripe.com/docs/api/treasury/debit_reversals) representing this Issuing dispute. - pub debit_reversal: Option, - - /// The Treasury [ReceivedDebit](https://stripe.com/docs/api/treasury/received_debits) that is being disputed. - pub received_debit: String, -} - -/// An enum representing the possible values of an `IssuingDisputeCanceledEvidence`'s `product_type` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum IssuingDisputeCanceledEvidenceProductType { - Merchandise, - Service, -} - -impl IssuingDisputeCanceledEvidenceProductType { - pub fn as_str(self) -> &'static str { - match self { - IssuingDisputeCanceledEvidenceProductType::Merchandise => "merchandise", - IssuingDisputeCanceledEvidenceProductType::Service => "service", - } - } -} - -impl AsRef for IssuingDisputeCanceledEvidenceProductType { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for IssuingDisputeCanceledEvidenceProductType { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for IssuingDisputeCanceledEvidenceProductType { - fn default() -> Self { - Self::Merchandise - } -} - -/// An enum representing the possible values of an `IssuingDisputeCanceledEvidence`'s `return_status` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum IssuingDisputeCanceledEvidenceReturnStatus { - MerchantRejected, - Successful, -} - -impl IssuingDisputeCanceledEvidenceReturnStatus { - pub fn as_str(self) -> &'static str { - match self { - IssuingDisputeCanceledEvidenceReturnStatus::MerchantRejected => "merchant_rejected", - IssuingDisputeCanceledEvidenceReturnStatus::Successful => "successful", - } - } -} - -impl AsRef for IssuingDisputeCanceledEvidenceReturnStatus { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for IssuingDisputeCanceledEvidenceReturnStatus { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for IssuingDisputeCanceledEvidenceReturnStatus { - fn default() -> Self { - Self::MerchantRejected - } -} - -/// An enum representing the possible values of an `IssuingDisputeEvidence`'s `reason` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum IssuingDisputeEvidenceReason { - Canceled, - Duplicate, - Fraudulent, - MerchandiseNotAsDescribed, - NotReceived, - Other, - ServiceNotAsDescribed, -} - -impl IssuingDisputeEvidenceReason { - pub fn as_str(self) -> &'static str { - match self { - IssuingDisputeEvidenceReason::Canceled => "canceled", - IssuingDisputeEvidenceReason::Duplicate => "duplicate", - IssuingDisputeEvidenceReason::Fraudulent => "fraudulent", - IssuingDisputeEvidenceReason::MerchandiseNotAsDescribed => { - "merchandise_not_as_described" - } - IssuingDisputeEvidenceReason::NotReceived => "not_received", - IssuingDisputeEvidenceReason::Other => "other", - IssuingDisputeEvidenceReason::ServiceNotAsDescribed => "service_not_as_described", - } - } -} - -impl AsRef for IssuingDisputeEvidenceReason { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for IssuingDisputeEvidenceReason { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for IssuingDisputeEvidenceReason { - fn default() -> Self { - Self::Canceled - } -} - -/// An enum representing the possible values of an `IssuingDisputeMerchandiseNotAsDescribedEvidence`'s `return_status` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum IssuingDisputeMerchandiseNotAsDescribedEvidenceReturnStatus { - MerchantRejected, - Successful, -} - -impl IssuingDisputeMerchandiseNotAsDescribedEvidenceReturnStatus { - pub fn as_str(self) -> &'static str { - match self { - IssuingDisputeMerchandiseNotAsDescribedEvidenceReturnStatus::MerchantRejected => { - "merchant_rejected" - } - IssuingDisputeMerchandiseNotAsDescribedEvidenceReturnStatus::Successful => "successful", - } - } -} - -impl AsRef for IssuingDisputeMerchandiseNotAsDescribedEvidenceReturnStatus { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for IssuingDisputeMerchandiseNotAsDescribedEvidenceReturnStatus { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for IssuingDisputeMerchandiseNotAsDescribedEvidenceReturnStatus { - fn default() -> Self { - Self::MerchantRejected - } -} - -/// An enum representing the possible values of an `IssuingDisputeNotReceivedEvidence`'s `product_type` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum IssuingDisputeNotReceivedEvidenceProductType { - Merchandise, - Service, -} - -impl IssuingDisputeNotReceivedEvidenceProductType { - pub fn as_str(self) -> &'static str { - match self { - IssuingDisputeNotReceivedEvidenceProductType::Merchandise => "merchandise", - IssuingDisputeNotReceivedEvidenceProductType::Service => "service", - } - } -} - -impl AsRef for IssuingDisputeNotReceivedEvidenceProductType { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for IssuingDisputeNotReceivedEvidenceProductType { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for IssuingDisputeNotReceivedEvidenceProductType { - fn default() -> Self { - Self::Merchandise - } -} - -/// An enum representing the possible values of an `IssuingDisputeOtherEvidence`'s `product_type` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum IssuingDisputeOtherEvidenceProductType { - Merchandise, - Service, -} - -impl IssuingDisputeOtherEvidenceProductType { - pub fn as_str(self) -> &'static str { - match self { - IssuingDisputeOtherEvidenceProductType::Merchandise => "merchandise", - IssuingDisputeOtherEvidenceProductType::Service => "service", - } - } -} - -impl AsRef for IssuingDisputeOtherEvidenceProductType { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for IssuingDisputeOtherEvidenceProductType { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for IssuingDisputeOtherEvidenceProductType { - fn default() -> Self { - Self::Merchandise - } -} diff --git a/src/resources/generated/issuing_dispute_closed.rs b/src/resources/generated/issuing_dispute_closed.rs deleted file mode 100644 index 817df7615..000000000 --- a/src/resources/generated/issuing_dispute_closed.rs +++ /dev/null @@ -1,10 +0,0 @@ -// ====================================== -// This file was automatically generated. -// ====================================== - -use serde::{Deserialize, Serialize}; - -/// The resource representing a Stripe "issuing_dispute.closed". -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct IssuingDisputeClosed { -} diff --git a/src/resources/generated/issuing_dispute_created.rs b/src/resources/generated/issuing_dispute_created.rs deleted file mode 100644 index 27b18a2e7..000000000 --- a/src/resources/generated/issuing_dispute_created.rs +++ /dev/null @@ -1,10 +0,0 @@ -// ====================================== -// This file was automatically generated. -// ====================================== - -use serde::{Deserialize, Serialize}; - -/// The resource representing a Stripe "issuing_dispute.created". -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct IssuingDisputeCreated { -} diff --git a/src/resources/generated/issuing_dispute_funds_reinstated.rs b/src/resources/generated/issuing_dispute_funds_reinstated.rs deleted file mode 100644 index 13c7130e7..000000000 --- a/src/resources/generated/issuing_dispute_funds_reinstated.rs +++ /dev/null @@ -1,10 +0,0 @@ -// ====================================== -// This file was automatically generated. -// ====================================== - -use serde::{Deserialize, Serialize}; - -/// The resource representing a Stripe "issuing_dispute.funds_reinstated". -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct IssuingDisputeFundsReinstated { -} diff --git a/src/resources/generated/issuing_dispute_submitted.rs b/src/resources/generated/issuing_dispute_submitted.rs deleted file mode 100644 index 45f2ed43f..000000000 --- a/src/resources/generated/issuing_dispute_submitted.rs +++ /dev/null @@ -1,10 +0,0 @@ -// ====================================== -// This file was automatically generated. -// ====================================== - -use serde::{Deserialize, Serialize}; - -/// The resource representing a Stripe "issuing_dispute.submitted". -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct IssuingDisputeSubmitted { -} diff --git a/src/resources/generated/issuing_dispute_updated.rs b/src/resources/generated/issuing_dispute_updated.rs deleted file mode 100644 index 7e465230d..000000000 --- a/src/resources/generated/issuing_dispute_updated.rs +++ /dev/null @@ -1,10 +0,0 @@ -// ====================================== -// This file was automatically generated. -// ====================================== - -use serde::{Deserialize, Serialize}; - -/// The resource representing a Stripe "issuing_dispute.updated". -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct IssuingDisputeUpdated { -} diff --git a/src/resources/generated/issuing_token.rs b/src/resources/generated/issuing_token.rs deleted file mode 100644 index a39a51b1f..000000000 --- a/src/resources/generated/issuing_token.rs +++ /dev/null @@ -1,545 +0,0 @@ -// ====================================== -// This file was automatically generated. -// ====================================== - -use serde::{Deserialize, Serialize}; - -use crate::ids::IssuingTokenId; -use crate::params::{Expandable, Object, Timestamp}; -use crate::resources::IssuingCard; - -/// The resource representing a Stripe "IssuingNetworkToken". -/// -/// For more details see -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct IssuingToken { - /// Unique identifier for the object. - pub id: IssuingTokenId, - - /// Card associated with this token. - pub card: Expandable, - - /// Time at which the object was created. - /// - /// Measured in seconds since the Unix epoch. - pub created: Timestamp, - - /// The hashed ID derived from the device ID from the card network associated with the token. - pub device_fingerprint: Option, - - /// The last four digits of the token. - #[serde(skip_serializing_if = "Option::is_none")] - pub last4: Option, - - /// Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. - pub livemode: bool, - - /// The token service provider / card network associated with the token. - pub network: IssuingTokenNetwork, - - #[serde(skip_serializing_if = "Option::is_none")] - pub network_data: Option, - - /// Time at which the token was last updated by the card network. - /// - /// Measured in seconds since the Unix epoch. - pub network_updated_at: Timestamp, - - /// The usage state of the token. - pub status: IssuingTokenStatus, - - /// The digital wallet for this token, if one was used. - #[serde(skip_serializing_if = "Option::is_none")] - pub wallet_provider: Option, -} - -impl Object for IssuingToken { - type Id = IssuingTokenId; - fn id(&self) -> Self::Id { - self.id.clone() - } - fn object(&self) -> &'static str { - "issuing.token" - } -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct IssuingNetworkTokenNetworkData { - #[serde(skip_serializing_if = "Option::is_none")] - pub device: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub mastercard: Option, - - /// The network that the token is associated with. - /// - /// An additional hash is included with a name matching this value, containing tokenization data specific to the card network. - #[serde(rename = "type")] - pub type_: IssuingNetworkTokenNetworkDataType, - - #[serde(skip_serializing_if = "Option::is_none")] - pub visa: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub wallet_provider: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct IssuingNetworkTokenDevice { - /// An obfuscated ID derived from the device ID. - #[serde(skip_serializing_if = "Option::is_none")] - pub device_fingerprint: Option, - - /// The IP address of the device at provisioning time. - #[serde(skip_serializing_if = "Option::is_none")] - pub ip_address: Option, - - /// The geographic latitude/longitude coordinates of the device at provisioning time. - /// - /// The format is [+-]decimal/[+-]decimal. - #[serde(skip_serializing_if = "Option::is_none")] - pub location: Option, - - /// The name of the device used for tokenization. - #[serde(skip_serializing_if = "Option::is_none")] - pub name: Option, - - /// The phone number of the device used for tokenization. - #[serde(skip_serializing_if = "Option::is_none")] - pub phone_number: Option, - - /// The type of device used for tokenization. - #[serde(rename = "type")] - #[serde(skip_serializing_if = "Option::is_none")] - pub type_: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct IssuingNetworkTokenMastercard { - /// A unique reference ID from MasterCard to represent the card account number. - #[serde(skip_serializing_if = "Option::is_none")] - pub card_reference_id: Option, - - /// The network-unique identifier for the token. - pub token_reference_id: String, - - /// The ID of the entity requesting tokenization, specific to MasterCard. - pub token_requestor_id: String, - - /// The name of the entity requesting tokenization, if known. - /// - /// This is directly provided from MasterCard. - #[serde(skip_serializing_if = "Option::is_none")] - pub token_requestor_name: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct IssuingNetworkTokenVisa { - /// A unique reference ID from Visa to represent the card account number. - pub card_reference_id: String, - - /// The network-unique identifier for the token. - pub token_reference_id: String, - - /// The ID of the entity requesting tokenization, specific to Visa. - pub token_requestor_id: String, - - /// Degree of risk associated with the token between `01` and `99`, with higher number indicating higher risk. - /// - /// A `00` value indicates the token was not scored by Visa. - #[serde(skip_serializing_if = "Option::is_none")] - pub token_risk_score: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct IssuingNetworkTokenWalletProvider { - /// The wallet provider-given account ID of the digital wallet the token belongs to. - #[serde(skip_serializing_if = "Option::is_none")] - pub account_id: Option, - - /// An evaluation on the trustworthiness of the wallet account between 1 and 5. - /// - /// A higher score indicates more trustworthy. - #[serde(skip_serializing_if = "Option::is_none")] - pub account_trust_score: Option, - - /// The method used for tokenizing a card. - #[serde(skip_serializing_if = "Option::is_none")] - pub card_number_source: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub cardholder_address: Option, - - /// The name of the cardholder tokenizing the card. - #[serde(skip_serializing_if = "Option::is_none")] - pub cardholder_name: Option, - - /// An evaluation on the trustworthiness of the device. - /// - /// A higher score indicates more trustworthy. - #[serde(skip_serializing_if = "Option::is_none")] - pub device_trust_score: Option, - - /// The hashed email address of the cardholder's account with the wallet provider. - #[serde(skip_serializing_if = "Option::is_none")] - pub hashed_account_email_address: Option, - - /// The reasons for suggested tokenization given by the card network. - #[serde(skip_serializing_if = "Option::is_none")] - pub reason_codes: Option>, - - /// The recommendation on responding to the tokenization request. - #[serde(skip_serializing_if = "Option::is_none")] - pub suggested_decision: Option, - - /// The version of the standard for mapping reason codes followed by the wallet provider. - #[serde(skip_serializing_if = "Option::is_none")] - pub suggested_decision_version: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct IssuingNetworkTokenAddress { - /// The street address of the cardholder tokenizing the card. - pub line1: String, - - /// The postal code of the cardholder tokenizing the card. - pub postal_code: String, -} - -/// An enum representing the possible values of an `IssuingNetworkTokenDevice`'s `type` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum IssuingNetworkTokenDeviceType { - Other, - Phone, - Watch, -} - -impl IssuingNetworkTokenDeviceType { - pub fn as_str(self) -> &'static str { - match self { - IssuingNetworkTokenDeviceType::Other => "other", - IssuingNetworkTokenDeviceType::Phone => "phone", - IssuingNetworkTokenDeviceType::Watch => "watch", - } - } -} - -impl AsRef for IssuingNetworkTokenDeviceType { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for IssuingNetworkTokenDeviceType { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for IssuingNetworkTokenDeviceType { - fn default() -> Self { - Self::Other - } -} - -/// An enum representing the possible values of an `IssuingNetworkTokenNetworkData`'s `type` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum IssuingNetworkTokenNetworkDataType { - Mastercard, - Visa, -} - -impl IssuingNetworkTokenNetworkDataType { - pub fn as_str(self) -> &'static str { - match self { - IssuingNetworkTokenNetworkDataType::Mastercard => "mastercard", - IssuingNetworkTokenNetworkDataType::Visa => "visa", - } - } -} - -impl AsRef for IssuingNetworkTokenNetworkDataType { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for IssuingNetworkTokenNetworkDataType { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for IssuingNetworkTokenNetworkDataType { - fn default() -> Self { - Self::Mastercard - } -} - -/// An enum representing the possible values of an `IssuingNetworkTokenWalletProvider`'s `card_number_source` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum IssuingNetworkTokenWalletProviderCardNumberSource { - App, - Manual, - OnFile, - Other, -} - -impl IssuingNetworkTokenWalletProviderCardNumberSource { - pub fn as_str(self) -> &'static str { - match self { - IssuingNetworkTokenWalletProviderCardNumberSource::App => "app", - IssuingNetworkTokenWalletProviderCardNumberSource::Manual => "manual", - IssuingNetworkTokenWalletProviderCardNumberSource::OnFile => "on_file", - IssuingNetworkTokenWalletProviderCardNumberSource::Other => "other", - } - } -} - -impl AsRef for IssuingNetworkTokenWalletProviderCardNumberSource { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for IssuingNetworkTokenWalletProviderCardNumberSource { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for IssuingNetworkTokenWalletProviderCardNumberSource { - fn default() -> Self { - Self::App - } -} - -/// An enum representing the possible values of an `IssuingNetworkTokenWalletProvider`'s `reason_codes` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum IssuingNetworkTokenWalletProviderReasonCodes { - AccountCardTooNew, - AccountRecentlyChanged, - AccountTooNew, - AccountTooNewSinceLaunch, - AdditionalDevice, - DataExpired, - DeferIdVDecision, - DeviceRecentlyLost, - GoodActivityHistory, - HasSuspendedTokens, - HighRisk, - InactiveAccount, - LongAccountTenure, - LowAccountScore, - LowDeviceScore, - LowPhoneNumberScore, - NetworkServiceError, - OutsideHomeTerritory, - ProvisioningCardholderMismatch, - ProvisioningDeviceAndCardholderMismatch, - ProvisioningDeviceMismatch, - SameDeviceNoPriorAuthentication, - SameDeviceSuccessfulPriorAuthentication, - SoftwareUpdate, - SuspiciousActivity, - TooManyDifferentCardholders, - TooManyRecentAttempts, - TooManyRecentTokens, -} - -impl IssuingNetworkTokenWalletProviderReasonCodes { - pub fn as_str(self) -> &'static str { - match self { - IssuingNetworkTokenWalletProviderReasonCodes::AccountCardTooNew => "account_card_too_new", - IssuingNetworkTokenWalletProviderReasonCodes::AccountRecentlyChanged => "account_recently_changed", - IssuingNetworkTokenWalletProviderReasonCodes::AccountTooNew => "account_too_new", - IssuingNetworkTokenWalletProviderReasonCodes::AccountTooNewSinceLaunch => "account_too_new_since_launch", - IssuingNetworkTokenWalletProviderReasonCodes::AdditionalDevice => "additional_device", - IssuingNetworkTokenWalletProviderReasonCodes::DataExpired => "data_expired", - IssuingNetworkTokenWalletProviderReasonCodes::DeferIdVDecision => "defer_id_v_decision", - IssuingNetworkTokenWalletProviderReasonCodes::DeviceRecentlyLost => "device_recently_lost", - IssuingNetworkTokenWalletProviderReasonCodes::GoodActivityHistory => "good_activity_history", - IssuingNetworkTokenWalletProviderReasonCodes::HasSuspendedTokens => "has_suspended_tokens", - IssuingNetworkTokenWalletProviderReasonCodes::HighRisk => "high_risk", - IssuingNetworkTokenWalletProviderReasonCodes::InactiveAccount => "inactive_account", - IssuingNetworkTokenWalletProviderReasonCodes::LongAccountTenure => "long_account_tenure", - IssuingNetworkTokenWalletProviderReasonCodes::LowAccountScore => "low_account_score", - IssuingNetworkTokenWalletProviderReasonCodes::LowDeviceScore => "low_device_score", - IssuingNetworkTokenWalletProviderReasonCodes::LowPhoneNumberScore => "low_phone_number_score", - IssuingNetworkTokenWalletProviderReasonCodes::NetworkServiceError => "network_service_error", - IssuingNetworkTokenWalletProviderReasonCodes::OutsideHomeTerritory => "outside_home_territory", - IssuingNetworkTokenWalletProviderReasonCodes::ProvisioningCardholderMismatch => "provisioning_cardholder_mismatch", - IssuingNetworkTokenWalletProviderReasonCodes::ProvisioningDeviceAndCardholderMismatch => "provisioning_device_and_cardholder_mismatch", - IssuingNetworkTokenWalletProviderReasonCodes::ProvisioningDeviceMismatch => "provisioning_device_mismatch", - IssuingNetworkTokenWalletProviderReasonCodes::SameDeviceNoPriorAuthentication => "same_device_no_prior_authentication", - IssuingNetworkTokenWalletProviderReasonCodes::SameDeviceSuccessfulPriorAuthentication => "same_device_successful_prior_authentication", - IssuingNetworkTokenWalletProviderReasonCodes::SoftwareUpdate => "software_update", - IssuingNetworkTokenWalletProviderReasonCodes::SuspiciousActivity => "suspicious_activity", - IssuingNetworkTokenWalletProviderReasonCodes::TooManyDifferentCardholders => "too_many_different_cardholders", - IssuingNetworkTokenWalletProviderReasonCodes::TooManyRecentAttempts => "too_many_recent_attempts", - IssuingNetworkTokenWalletProviderReasonCodes::TooManyRecentTokens => "too_many_recent_tokens", - } - } -} - -impl AsRef for IssuingNetworkTokenWalletProviderReasonCodes { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for IssuingNetworkTokenWalletProviderReasonCodes { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for IssuingNetworkTokenWalletProviderReasonCodes { - fn default() -> Self { - Self::AccountCardTooNew - } -} - -/// An enum representing the possible values of an `IssuingNetworkTokenWalletProvider`'s `suggested_decision` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum IssuingNetworkTokenWalletProviderSuggestedDecision { - Approve, - Decline, - RequireAuth, -} - -impl IssuingNetworkTokenWalletProviderSuggestedDecision { - pub fn as_str(self) -> &'static str { - match self { - IssuingNetworkTokenWalletProviderSuggestedDecision::Approve => "approve", - IssuingNetworkTokenWalletProviderSuggestedDecision::Decline => "decline", - IssuingNetworkTokenWalletProviderSuggestedDecision::RequireAuth => "require_auth", - } - } -} - -impl AsRef for IssuingNetworkTokenWalletProviderSuggestedDecision { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for IssuingNetworkTokenWalletProviderSuggestedDecision { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for IssuingNetworkTokenWalletProviderSuggestedDecision { - fn default() -> Self { - Self::Approve - } -} - -/// An enum representing the possible values of an `IssuingToken`'s `network` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum IssuingTokenNetwork { - Mastercard, - Visa, -} - -impl IssuingTokenNetwork { - pub fn as_str(self) -> &'static str { - match self { - IssuingTokenNetwork::Mastercard => "mastercard", - IssuingTokenNetwork::Visa => "visa", - } - } -} - -impl AsRef for IssuingTokenNetwork { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for IssuingTokenNetwork { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for IssuingTokenNetwork { - fn default() -> Self { - Self::Mastercard - } -} - -/// An enum representing the possible values of an `IssuingToken`'s `status` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum IssuingTokenStatus { - Active, - Deleted, - Requested, - Suspended, -} - -impl IssuingTokenStatus { - pub fn as_str(self) -> &'static str { - match self { - IssuingTokenStatus::Active => "active", - IssuingTokenStatus::Deleted => "deleted", - IssuingTokenStatus::Requested => "requested", - IssuingTokenStatus::Suspended => "suspended", - } - } -} - -impl AsRef for IssuingTokenStatus { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for IssuingTokenStatus { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for IssuingTokenStatus { - fn default() -> Self { - Self::Active - } -} - -/// An enum representing the possible values of an `IssuingToken`'s `wallet_provider` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum IssuingTokenWalletProvider { - ApplePay, - GooglePay, - SamsungPay, -} - -impl IssuingTokenWalletProvider { - pub fn as_str(self) -> &'static str { - match self { - IssuingTokenWalletProvider::ApplePay => "apple_pay", - IssuingTokenWalletProvider::GooglePay => "google_pay", - IssuingTokenWalletProvider::SamsungPay => "samsung_pay", - } - } -} - -impl AsRef for IssuingTokenWalletProvider { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for IssuingTokenWalletProvider { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for IssuingTokenWalletProvider { - fn default() -> Self { - Self::ApplePay - } -} diff --git a/src/resources/generated/issuing_token_created.rs b/src/resources/generated/issuing_token_created.rs deleted file mode 100644 index e8d2d0b15..000000000 --- a/src/resources/generated/issuing_token_created.rs +++ /dev/null @@ -1,10 +0,0 @@ -// ====================================== -// This file was automatically generated. -// ====================================== - -use serde::{Deserialize, Serialize}; - -/// The resource representing a Stripe "issuing_token.created". -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct IssuingTokenCreated { -} diff --git a/src/resources/generated/issuing_token_updated.rs b/src/resources/generated/issuing_token_updated.rs deleted file mode 100644 index 818bae824..000000000 --- a/src/resources/generated/issuing_token_updated.rs +++ /dev/null @@ -1,10 +0,0 @@ -// ====================================== -// This file was automatically generated. -// ====================================== - -use serde::{Deserialize, Serialize}; - -/// The resource representing a Stripe "issuing_token.updated". -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct IssuingTokenUpdated { -} diff --git a/src/resources/generated/issuing_transaction.rs b/src/resources/generated/issuing_transaction.rs deleted file mode 100644 index d22d88284..000000000 --- a/src/resources/generated/issuing_transaction.rs +++ /dev/null @@ -1,285 +0,0 @@ -// ====================================== -// This file was automatically generated. -// ====================================== - -use serde::{Deserialize, Serialize}; - -use crate::ids::IssuingTransactionId; -use crate::params::{Expandable, Metadata, Object, Timestamp}; -use crate::resources::{ - BalanceTransaction, Currency, IssuingAuthorization, IssuingCard, IssuingCardholder, - IssuingDispute, IssuingToken, IssuingTransactionType, MerchantData, -}; - -/// The resource representing a Stripe "IssuingTransaction". -/// -/// For more details see -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct IssuingTransaction { - /// Unique identifier for the object. - pub id: IssuingTransactionId, - - /// The transaction amount, which will be reflected in your balance. - /// - /// This amount is in your currency and in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal). - pub amount: i64, - - /// Detailed breakdown of amount components. - /// - /// These amounts are denominated in `currency` and in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal). - pub amount_details: Option, - - /// The `Authorization` object that led to this transaction. - pub authorization: Option>, - - /// ID of the [balance transaction](https://stripe.com/docs/api/balance_transactions) associated with this transaction. - pub balance_transaction: Option>, - - /// The card used to make this transaction. - pub card: Expandable, - - /// The cardholder to whom this transaction belongs. - pub cardholder: Option>, - - /// Time at which the object was created. - /// - /// Measured in seconds since the Unix epoch. - pub created: Timestamp, - - /// Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. - /// - /// Must be a [supported currency](https://stripe.com/docs/currencies). - pub currency: Currency, - - /// If you've disputed the transaction, the ID of the dispute. - pub dispute: Option>, - - /// Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. - pub livemode: bool, - - /// The amount that the merchant will receive, denominated in `merchant_currency` and in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal). - /// - /// It will be different from `amount` if the merchant is taking payment in a different currency. - pub merchant_amount: i64, - - /// The currency with which the merchant is taking payment. - pub merchant_currency: Currency, - - pub merchant_data: MerchantData, - - /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. - /// - /// This can be useful for storing additional information about the object in a structured format. - pub metadata: Metadata, - - /// Details about the transaction, such as processing dates, set by the card network. - pub network_data: Option, - - /// Additional purchase information that is optionally provided by the merchant. - pub purchase_details: Option, - - /// [Token](https://stripe.com/docs/api/issuing/tokens/object) object used for this transaction. - /// - /// If a network token was not used for this transaction, this field will be null. - #[serde(skip_serializing_if = "Option::is_none")] - pub token: Option>, - - /// [Treasury](https://stripe.com/docs/api/treasury) details related to this transaction if it was created on a [FinancialAccount](/docs/api/treasury/financial_accounts. - #[serde(skip_serializing_if = "Option::is_none")] - pub treasury: Option, - - /// The nature of the transaction. - #[serde(rename = "type")] - pub type_: IssuingTransactionType, - - /// The digital wallet used for this transaction. - /// - /// One of `apple_pay`, `google_pay`, or `samsung_pay`. - pub wallet: Option, -} - -impl Object for IssuingTransaction { - type Id = IssuingTransactionId; - fn id(&self) -> Self::Id { - self.id.clone() - } - fn object(&self) -> &'static str { - "issuing.transaction" - } -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct IssuingTransactionAmountDetails { - /// The fee charged by the ATM for the cash withdrawal. - pub atm_fee: Option, - - /// The amount of cash requested by the cardholder. - pub cashback_amount: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct IssuingTransactionNetworkData { - /// A code created by Stripe which is shared with the merchant to validate the authorization. - /// - /// This field will be populated if the authorization message was approved. - /// The code typically starts with the letter "S", followed by a six-digit number. - /// For example, "S498162". - /// Please note that the code is not guaranteed to be unique across authorizations. - pub authorization_code: Option, - - /// The date the transaction was processed by the card network. - /// - /// This can be different from the date the seller recorded the transaction depending on when the acquirer submits the transaction to the network. - pub processing_date: Option, - - /// Unique identifier for the authorization assigned by the card network used to match subsequent messages, disputes, and transactions. - pub transaction_id: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct IssuingTransactionPurchaseDetails { - /// Information about the flight that was purchased with this transaction. - pub flight: Option, - - /// Information about fuel that was purchased with this transaction. - pub fuel: Option, - - /// Information about lodging that was purchased with this transaction. - pub lodging: Option, - - /// The line items in the purchase. - pub receipt: Option>, - - /// A merchant-specific order number. - pub reference: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct IssuingTransactionFlightData { - /// The time that the flight departed. - pub departure_at: Option, - - /// The name of the passenger. - pub passenger_name: Option, - - /// Whether the ticket is refundable. - pub refundable: Option, - - /// The legs of the trip. - pub segments: Option>, - - /// The travel agency that issued the ticket. - pub travel_agency: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct IssuingTransactionFlightDataLeg { - /// The three-letter IATA airport code of the flight's destination. - pub arrival_airport_code: Option, - - /// The airline carrier code. - pub carrier: Option, - - /// The three-letter IATA airport code that the flight departed from. - pub departure_airport_code: Option, - - /// The flight number. - pub flight_number: Option, - - /// The flight's service class. - pub service_class: Option, - - /// Whether a stopover is allowed on this flight. - pub stopover_allowed: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct IssuingTransactionFuelData { - /// The type of fuel that was purchased. - /// - /// One of `diesel`, `unleaded_plus`, `unleaded_regular`, `unleaded_super`, or `other`. - #[serde(rename = "type")] - pub type_: String, - - /// The units for `volume_decimal`. - /// - /// One of `us_gallon` or `liter`. - pub unit: String, - - /// The cost in cents per each unit of fuel, represented as a decimal string with at most 12 decimal places. - pub unit_cost_decimal: String, - - /// The volume of the fuel that was pumped, represented as a decimal string with at most 12 decimal places. - pub volume_decimal: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct IssuingTransactionLodgingData { - /// The time of checking into the lodging. - pub check_in_at: Option, - - /// The number of nights stayed at the lodging. - pub nights: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct IssuingTransactionReceiptData { - /// The description of the item. - /// - /// The maximum length of this field is 26 characters. - pub description: Option, - - /// The quantity of the item. - pub quantity: Option, - - /// The total for this line item in cents. - pub total: Option, - - /// The unit cost of the item in cents. - pub unit_cost: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct IssuingTransactionTreasury { - /// The Treasury [ReceivedCredit](https://stripe.com/docs/api/treasury/received_credits) representing this Issuing transaction if it is a refund. - pub received_credit: Option, - - /// The Treasury [ReceivedDebit](https://stripe.com/docs/api/treasury/received_debits) representing this Issuing transaction if it is a capture. - pub received_debit: Option, -} - -/// An enum representing the possible values of an `IssuingTransaction`'s `wallet` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum IssuingTransactionWallet { - ApplePay, - GooglePay, - SamsungPay, -} - -impl IssuingTransactionWallet { - pub fn as_str(self) -> &'static str { - match self { - IssuingTransactionWallet::ApplePay => "apple_pay", - IssuingTransactionWallet::GooglePay => "google_pay", - IssuingTransactionWallet::SamsungPay => "samsung_pay", - } - } -} - -impl AsRef for IssuingTransactionWallet { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for IssuingTransactionWallet { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for IssuingTransactionWallet { - fn default() -> Self { - Self::ApplePay - } -} diff --git a/src/resources/generated/issuing_transaction_created.rs b/src/resources/generated/issuing_transaction_created.rs deleted file mode 100644 index 0799bb821..000000000 --- a/src/resources/generated/issuing_transaction_created.rs +++ /dev/null @@ -1,10 +0,0 @@ -// ====================================== -// This file was automatically generated. -// ====================================== - -use serde::{Deserialize, Serialize}; - -/// The resource representing a Stripe "issuing_transaction.created". -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct IssuingTransactionCreated { -} diff --git a/src/resources/generated/issuing_transaction_updated.rs b/src/resources/generated/issuing_transaction_updated.rs deleted file mode 100644 index 72f34b8a9..000000000 --- a/src/resources/generated/issuing_transaction_updated.rs +++ /dev/null @@ -1,10 +0,0 @@ -// ====================================== -// This file was automatically generated. -// ====================================== - -use serde::{Deserialize, Serialize}; - -/// The resource representing a Stripe "issuing_transaction.updated". -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct IssuingTransactionUpdated { -} diff --git a/src/resources/generated/item.rs b/src/resources/generated/item.rs deleted file mode 100644 index 5f012c684..000000000 --- a/src/resources/generated/item.rs +++ /dev/null @@ -1,151 +0,0 @@ -// ====================================== -// This file was automatically generated. -// ====================================== - -use serde::{Deserialize, Serialize}; - -use crate::ids::CheckoutSessionItemId; -use crate::params::Object; -use crate::resources::{Currency, Discount, Price, TaxRate}; - -/// The resource representing a Stripe "LineItem". -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CheckoutSessionItem { - /// Unique identifier for the object. - pub id: CheckoutSessionItemId, - - /// Total discount amount applied. - /// - /// If no discounts were applied, defaults to 0. - pub amount_discount: i64, - - /// Total before any discounts or taxes are applied. - pub amount_subtotal: i64, - - /// Total tax amount applied. - /// - /// If no tax was applied, defaults to 0. - pub amount_tax: i64, - - /// Total after discounts and taxes. - pub amount_total: i64, - - /// Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. - /// - /// Must be a [supported currency](https://stripe.com/docs/currencies). - pub currency: Currency, - - /// An arbitrary string attached to the object. - /// - /// Often useful for displaying to users. - /// Defaults to product name. - pub description: String, - - /// The discounts applied to the line item. - #[serde(skip_serializing_if = "Option::is_none")] - pub discounts: Option>, - - /// The price used to generate the line item. - pub price: Option, - - /// The quantity of products being purchased. - pub quantity: Option, - - /// The taxes applied to the line item. - #[serde(skip_serializing_if = "Option::is_none")] - pub taxes: Option>, -} - -impl Object for CheckoutSessionItem { - type Id = CheckoutSessionItemId; - fn id(&self) -> Self::Id { - self.id.clone() - } - fn object(&self) -> &'static str { - "item" - } -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct LineItemsDiscountAmount { - /// The amount discounted. - pub amount: i64, - - pub discount: Discount, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct LineItemsTaxAmount { - /// Amount of tax applied for this rate. - pub amount: i64, - - pub rate: TaxRate, - - /// The reasoning behind this tax, for example, if the product is tax exempt. - /// - /// The possible values for this field may be extended as new tax rules are supported. - pub taxability_reason: Option, - - /// The amount on which tax is calculated, in cents (or local equivalent). - pub taxable_amount: Option, -} - -/// An enum representing the possible values of an `LineItemsTaxAmount`'s `taxability_reason` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum LineItemsTaxAmountTaxabilityReason { - CustomerExempt, - NotCollecting, - NotSubjectToTax, - NotSupported, - PortionProductExempt, - PortionReducedRated, - PortionStandardRated, - ProductExempt, - ProductExemptHoliday, - ProportionallyRated, - ReducedRated, - ReverseCharge, - StandardRated, - TaxableBasisReduced, - ZeroRated, -} - -impl LineItemsTaxAmountTaxabilityReason { - pub fn as_str(self) -> &'static str { - match self { - LineItemsTaxAmountTaxabilityReason::CustomerExempt => "customer_exempt", - LineItemsTaxAmountTaxabilityReason::NotCollecting => "not_collecting", - LineItemsTaxAmountTaxabilityReason::NotSubjectToTax => "not_subject_to_tax", - LineItemsTaxAmountTaxabilityReason::NotSupported => "not_supported", - LineItemsTaxAmountTaxabilityReason::PortionProductExempt => "portion_product_exempt", - LineItemsTaxAmountTaxabilityReason::PortionReducedRated => "portion_reduced_rated", - LineItemsTaxAmountTaxabilityReason::PortionStandardRated => "portion_standard_rated", - LineItemsTaxAmountTaxabilityReason::ProductExempt => "product_exempt", - LineItemsTaxAmountTaxabilityReason::ProductExemptHoliday => "product_exempt_holiday", - LineItemsTaxAmountTaxabilityReason::ProportionallyRated => "proportionally_rated", - LineItemsTaxAmountTaxabilityReason::ReducedRated => "reduced_rated", - LineItemsTaxAmountTaxabilityReason::ReverseCharge => "reverse_charge", - LineItemsTaxAmountTaxabilityReason::StandardRated => "standard_rated", - LineItemsTaxAmountTaxabilityReason::TaxableBasisReduced => "taxable_basis_reduced", - LineItemsTaxAmountTaxabilityReason::ZeroRated => "zero_rated", - } - } -} - -impl AsRef for LineItemsTaxAmountTaxabilityReason { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for LineItemsTaxAmountTaxabilityReason { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for LineItemsTaxAmountTaxabilityReason { - fn default() -> Self { - Self::CustomerExempt - } -} diff --git a/src/resources/generated/line_item.rs b/src/resources/generated/line_item.rs deleted file mode 100644 index 3c54dab60..000000000 --- a/src/resources/generated/line_item.rs +++ /dev/null @@ -1,251 +0,0 @@ -// ====================================== -// This file was automatically generated. -// ====================================== - -use serde::{Deserialize, Serialize}; - -use crate::ids::InvoiceLineItemId; -use crate::params::{Expandable, Metadata, Object}; -use crate::resources::{ - Currency, Discount, InvoiceItem, Period, Plan, Price, Subscription, SubscriptionItem, TaxRate, -}; - -/// The resource representing a Stripe "InvoiceLineItem". -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct InvoiceLineItem { - /// Unique identifier for the object. - pub id: InvoiceLineItemId, - - /// The amount, in cents (or local equivalent). - pub amount: i64, - - /// The integer amount in cents (or local equivalent) representing the amount for this line item, excluding all tax and discounts. - pub amount_excluding_tax: Option, - - /// Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. - /// - /// Must be a [supported currency](https://stripe.com/docs/currencies). - pub currency: Currency, - - /// An arbitrary string attached to the object. - /// - /// Often useful for displaying to users. - pub description: Option, - - /// The amount of discount calculated per discount for this line item. - pub discount_amounts: Option>, - - /// If true, discounts will apply to this line item. - /// - /// Always false for prorations. - pub discountable: bool, - - /// The discounts applied to the invoice line item. - /// - /// Line item discounts are applied before invoice discounts. - /// Use `expand[]=discounts` to expand each discount. - pub discounts: Option>>, - - /// The ID of the [invoice item](https://stripe.com/docs/api/invoiceitems) associated with this line item if any. - #[serde(skip_serializing_if = "Option::is_none")] - pub invoice_item: Option>, - - /// Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. - pub livemode: bool, - - /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. - /// - /// This can be useful for storing additional information about the object in a structured format. - /// Note that for line items with `type=subscription` this will reflect the metadata of the subscription that caused the line item to be created. - pub metadata: Metadata, - - pub period: Option, - - /// The plan of the subscription, if the line item is a subscription or a proration. - pub plan: Option, - - /// The price of the line item. - pub price: Option, - - /// Whether this is a proration. - pub proration: bool, - - /// Additional details for proration line items. - pub proration_details: Option, - - /// The quantity of the subscription, if the line item is a subscription or a proration. - pub quantity: Option, - - /// The subscription that the invoice item pertains to, if any. - pub subscription: Option>, - - /// The subscription item that generated this line item. - /// - /// Left empty if the line item is not an explicit result of a subscription. - #[serde(skip_serializing_if = "Option::is_none")] - pub subscription_item: Option>, - - /// The amount of tax calculated per tax rate for this line item. - #[serde(skip_serializing_if = "Option::is_none")] - pub tax_amounts: Option>, - - /// The tax rates which apply to the line item. - #[serde(skip_serializing_if = "Option::is_none")] - pub tax_rates: Option>, - - /// A string identifying the type of the source of this line item, either an `invoiceitem` or a `subscription`. - #[serde(rename = "type")] - pub type_: InvoiceLineItemType, - - /// The amount in cents (or local equivalent) representing the unit amount for this line item, excluding all tax and discounts. - pub unit_amount_excluding_tax: Option, -} - -impl Object for InvoiceLineItem { - type Id = InvoiceLineItemId; - fn id(&self) -> Self::Id { - self.id.clone() - } - fn object(&self) -> &'static str { - "line_item" - } -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct DiscountsResourceDiscountAmount { - /// The amount, in cents (or local equivalent), of the discount. - pub amount: i64, - - /// The discount that was applied to get this discount amount. - pub discount: Expandable, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct TaxAmount { - /// The amount, in cents (or local equivalent), of the tax. - pub amount: i64, - - /// Whether this tax amount is inclusive or exclusive. - pub inclusive: bool, - - /// The tax rate that was applied to get this tax amount. - pub tax_rate: Expandable, - - /// The reasoning behind this tax, for example, if the product is tax exempt. - /// - /// The possible values for this field may be extended as new tax rules are supported. - pub taxability_reason: Option, - - /// The amount on which tax is calculated, in cents (or local equivalent). - pub taxable_amount: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct InvoicesResourceLineItemsProrationDetails { - /// For a credit proration `line_item`, the original debit line_items to which the credit proration applies. - pub credited_items: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct InvoicesResourceLineItemsCreditedItems { - /// Invoice containing the credited invoice line items. - pub invoice: String, - - /// Credited invoice line items. - pub invoice_line_items: Vec, -} - -/// An enum representing the possible values of an `InvoiceLineItem`'s `type` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum InvoiceLineItemType { - #[serde(rename = "invoiceitem")] - InvoiceItem, - Subscription, -} - -impl InvoiceLineItemType { - pub fn as_str(self) -> &'static str { - match self { - InvoiceLineItemType::InvoiceItem => "invoiceitem", - InvoiceLineItemType::Subscription => "subscription", - } - } -} - -impl AsRef for InvoiceLineItemType { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for InvoiceLineItemType { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for InvoiceLineItemType { - fn default() -> Self { - Self::InvoiceItem - } -} - -/// An enum representing the possible values of an `TaxAmount`'s `taxability_reason` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum TaxAmountTaxabilityReason { - CustomerExempt, - NotCollecting, - NotSubjectToTax, - NotSupported, - PortionProductExempt, - PortionReducedRated, - PortionStandardRated, - ProductExempt, - ProductExemptHoliday, - ProportionallyRated, - ReducedRated, - ReverseCharge, - StandardRated, - TaxableBasisReduced, - ZeroRated, -} - -impl TaxAmountTaxabilityReason { - pub fn as_str(self) -> &'static str { - match self { - TaxAmountTaxabilityReason::CustomerExempt => "customer_exempt", - TaxAmountTaxabilityReason::NotCollecting => "not_collecting", - TaxAmountTaxabilityReason::NotSubjectToTax => "not_subject_to_tax", - TaxAmountTaxabilityReason::NotSupported => "not_supported", - TaxAmountTaxabilityReason::PortionProductExempt => "portion_product_exempt", - TaxAmountTaxabilityReason::PortionReducedRated => "portion_reduced_rated", - TaxAmountTaxabilityReason::PortionStandardRated => "portion_standard_rated", - TaxAmountTaxabilityReason::ProductExempt => "product_exempt", - TaxAmountTaxabilityReason::ProductExemptHoliday => "product_exempt_holiday", - TaxAmountTaxabilityReason::ProportionallyRated => "proportionally_rated", - TaxAmountTaxabilityReason::ReducedRated => "reduced_rated", - TaxAmountTaxabilityReason::ReverseCharge => "reverse_charge", - TaxAmountTaxabilityReason::StandardRated => "standard_rated", - TaxAmountTaxabilityReason::TaxableBasisReduced => "taxable_basis_reduced", - TaxAmountTaxabilityReason::ZeroRated => "zero_rated", - } - } -} - -impl AsRef for TaxAmountTaxabilityReason { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for TaxAmountTaxabilityReason { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for TaxAmountTaxabilityReason { - fn default() -> Self { - Self::CustomerExempt - } -} diff --git a/src/resources/generated/linked_account_options_us_bank_account.rs b/src/resources/generated/linked_account_options_us_bank_account.rs deleted file mode 100644 index 890bc2468..000000000 --- a/src/resources/generated/linked_account_options_us_bank_account.rs +++ /dev/null @@ -1,96 +0,0 @@ -// ====================================== -// This file was automatically generated. -// ====================================== - -use serde::{Deserialize, Serialize}; - -/// The resource representing a Stripe "linked_account_options_us_bank_account". -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct LinkedAccountOptionsUsBankAccount { - /// The list of permissions to request. - /// - /// The `payment_method` permission must be included. - #[serde(skip_serializing_if = "Option::is_none")] - pub permissions: Option>, - - /// Data features requested to be retrieved upon account creation. - pub prefetch: Option>, - - /// For webview integrations only. - /// - /// Upon completing OAuth login in the native browser, the user will be redirected to this URL to return to your app. - #[serde(skip_serializing_if = "Option::is_none")] - pub return_url: Option, -} - -/// An enum representing the possible values of an `LinkedAccountOptionsUsBankAccount`'s `permissions` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum LinkedAccountOptionsUsBankAccountPermissions { - Balances, - Ownership, - PaymentMethod, - Transactions, -} - -impl LinkedAccountOptionsUsBankAccountPermissions { - pub fn as_str(self) -> &'static str { - match self { - LinkedAccountOptionsUsBankAccountPermissions::Balances => "balances", - LinkedAccountOptionsUsBankAccountPermissions::Ownership => "ownership", - LinkedAccountOptionsUsBankAccountPermissions::PaymentMethod => "payment_method", - LinkedAccountOptionsUsBankAccountPermissions::Transactions => "transactions", - } - } -} - -impl AsRef for LinkedAccountOptionsUsBankAccountPermissions { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for LinkedAccountOptionsUsBankAccountPermissions { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for LinkedAccountOptionsUsBankAccountPermissions { - fn default() -> Self { - Self::Balances - } -} - -/// An enum representing the possible values of an `LinkedAccountOptionsUsBankAccount`'s `prefetch` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum LinkedAccountOptionsUsBankAccountPrefetch { - Balances, - Transactions, -} - -impl LinkedAccountOptionsUsBankAccountPrefetch { - pub fn as_str(self) -> &'static str { - match self { - LinkedAccountOptionsUsBankAccountPrefetch::Balances => "balances", - LinkedAccountOptionsUsBankAccountPrefetch::Transactions => "transactions", - } - } -} - -impl AsRef for LinkedAccountOptionsUsBankAccountPrefetch { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for LinkedAccountOptionsUsBankAccountPrefetch { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for LinkedAccountOptionsUsBankAccountPrefetch { - fn default() -> Self { - Self::Balances - } -} diff --git a/src/resources/generated/login_link.rs b/src/resources/generated/login_link.rs deleted file mode 100644 index 07edb8ec0..000000000 --- a/src/resources/generated/login_link.rs +++ /dev/null @@ -1,29 +0,0 @@ -// ====================================== -// This file was automatically generated. -// ====================================== - -use serde::{Deserialize, Serialize}; - -use crate::params::{Object, Timestamp}; - -/// The resource representing a Stripe "LoginLink". -/// -/// For more details see -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct LoginLink { - /// Time at which the object was created. - /// - /// Measured in seconds since the Unix epoch. - pub created: Timestamp, - - /// The URL for the login link. - pub url: String, -} - -impl Object for LoginLink { - type Id = (); - fn id(&self) -> Self::Id {} - fn object(&self) -> &'static str { - "login_link" - } -} diff --git a/src/resources/generated/mandate.rs b/src/resources/generated/mandate.rs deleted file mode 100644 index ec4a08129..000000000 --- a/src/resources/generated/mandate.rs +++ /dev/null @@ -1,540 +0,0 @@ -// ====================================== -// This file was automatically generated. -// ====================================== - -use serde::{Deserialize, Serialize}; - -use crate::client::{Client, Response}; -use crate::ids::MandateId; -use crate::params::{Expand, Expandable, Object, Timestamp}; -use crate::resources::{Currency, PaymentMethod}; - -/// The resource representing a Stripe "Mandate". -/// -/// For more details see -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct Mandate { - /// Unique identifier for the object. - pub id: MandateId, - - pub customer_acceptance: CustomerAcceptance, - - /// Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. - pub livemode: bool, - - #[serde(skip_serializing_if = "Option::is_none")] - pub multi_use: Option, - - /// The account (if any) that the mandate is intended for. - #[serde(skip_serializing_if = "Option::is_none")] - pub on_behalf_of: Option, - - /// ID of the payment method associated with this mandate. - pub payment_method: Expandable, - - pub payment_method_details: MandatePaymentMethodDetails, - - #[serde(skip_serializing_if = "Option::is_none")] - pub single_use: Option, - - /// The mandate status indicates whether or not you can use it to initiate a payment. - pub status: MandateStatus, - - /// The type of the mandate. - #[serde(rename = "type")] - pub type_: MandateType, -} - -impl Mandate { - /// Retrieves a Mandate object. - pub fn retrieve(client: &Client, id: &MandateId, expand: &[&str]) -> Response { - client.get_query(&format!("/mandates/{}", id), &Expand { expand }) - } -} - -impl Object for Mandate { - type Id = MandateId; - fn id(&self) -> Self::Id { - self.id.clone() - } - fn object(&self) -> &'static str { - "mandate" - } -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CustomerAcceptance { - /// The time that the customer accepts the mandate. - pub accepted_at: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub offline: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub online: Option, - - /// The mandate includes the type of customer acceptance information, such as: `online` or `offline`. - #[serde(rename = "type")] - pub type_: CustomerAcceptanceType, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct MandateMultiUse {} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct MandatePaymentMethodDetails { - #[serde(skip_serializing_if = "Option::is_none")] - pub acss_debit: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub au_becs_debit: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub bacs_debit: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub card: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub cashapp: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub link: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub paypal: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub sepa_debit: Option, - - /// This mandate corresponds with a specific payment method type. - /// - /// The `payment_method_details` includes an additional hash with the same name and contains mandate information that's specific to that payment method. - #[serde(rename = "type")] - pub type_: String, - - #[serde(skip_serializing_if = "Option::is_none")] - pub us_bank_account: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CardMandatePaymentMethodDetails {} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct MandateAcssDebit { - /// List of Stripe products where this mandate can be selected automatically. - #[serde(skip_serializing_if = "Option::is_none")] - pub default_for: Option>, - - /// Description of the interval. - /// - /// Only required if the 'payment_schedule' parameter is 'interval' or 'combined'. - pub interval_description: Option, - - /// Payment schedule for the mandate. - pub payment_schedule: MandateAcssDebitPaymentSchedule, - - /// Transaction type of the mandate. - pub transaction_type: MandateAcssDebitTransactionType, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct MandateAuBecsDebit { - /// The URL of the mandate. - /// - /// This URL generally contains sensitive information about the customer and should be shared with them exclusively. - pub url: String, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct MandateBacsDebit { - /// The status of the mandate on the Bacs network. - /// - /// Can be one of `pending`, `revoked`, `refused`, or `accepted`. - pub network_status: MandateBacsDebitNetworkStatus, - - /// The unique reference identifying the mandate on the Bacs network. - pub reference: String, - - /// When the mandate is revoked on the Bacs network this field displays the reason for the revocation. - pub revocation_reason: Option, - - /// The URL that will contain the mandate that the customer has signed. - pub url: String, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct MandateCashapp {} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct MandateLink {} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct MandatePaypal { - /// The PayPal Billing Agreement ID (BAID). - /// - /// This is an ID generated by PayPal which represents the mandate between the merchant and the customer. - pub billing_agreement_id: Option, - - /// PayPal account PayerID. - /// - /// This identifier uniquely identifies the PayPal customer. - pub payer_id: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct MandateSepaDebit { - /// The unique reference of the mandate. - pub reference: String, - - /// The URL of the mandate. - /// - /// This URL generally contains sensitive information about the customer and should be shared with them exclusively. - pub url: String, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct MandateSingleUse { - /// The amount of the payment on a single use mandate. - pub amount: i64, - - /// The currency of the payment on a single use mandate. - pub currency: Currency, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct MandateUsBankAccount { - /// Mandate collection method. - #[serde(skip_serializing_if = "Option::is_none")] - pub collection_method: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct OfflineAcceptance {} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct OnlineAcceptance { - /// The customer accepts the mandate from this IP address. - pub ip_address: Option, - - /// The customer accepts the mandate using the user agent of the browser. - pub user_agent: Option, -} - -/// An enum representing the possible values of an `CustomerAcceptance`'s `type` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CustomerAcceptanceType { - Offline, - Online, -} - -impl CustomerAcceptanceType { - pub fn as_str(self) -> &'static str { - match self { - CustomerAcceptanceType::Offline => "offline", - CustomerAcceptanceType::Online => "online", - } - } -} - -impl AsRef for CustomerAcceptanceType { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for CustomerAcceptanceType { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for CustomerAcceptanceType { - fn default() -> Self { - Self::Offline - } -} - -/// An enum representing the possible values of an `MandateAcssDebit`'s `default_for` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum MandateAcssDebitDefaultFor { - Invoice, - Subscription, -} - -impl MandateAcssDebitDefaultFor { - pub fn as_str(self) -> &'static str { - match self { - MandateAcssDebitDefaultFor::Invoice => "invoice", - MandateAcssDebitDefaultFor::Subscription => "subscription", - } - } -} - -impl AsRef for MandateAcssDebitDefaultFor { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for MandateAcssDebitDefaultFor { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for MandateAcssDebitDefaultFor { - fn default() -> Self { - Self::Invoice - } -} - -/// An enum representing the possible values of an `MandateAcssDebit`'s `payment_schedule` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum MandateAcssDebitPaymentSchedule { - Combined, - Interval, - Sporadic, -} - -impl MandateAcssDebitPaymentSchedule { - pub fn as_str(self) -> &'static str { - match self { - MandateAcssDebitPaymentSchedule::Combined => "combined", - MandateAcssDebitPaymentSchedule::Interval => "interval", - MandateAcssDebitPaymentSchedule::Sporadic => "sporadic", - } - } -} - -impl AsRef for MandateAcssDebitPaymentSchedule { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for MandateAcssDebitPaymentSchedule { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for MandateAcssDebitPaymentSchedule { - fn default() -> Self { - Self::Combined - } -} - -/// An enum representing the possible values of an `MandateAcssDebit`'s `transaction_type` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum MandateAcssDebitTransactionType { - Business, - Personal, -} - -impl MandateAcssDebitTransactionType { - pub fn as_str(self) -> &'static str { - match self { - MandateAcssDebitTransactionType::Business => "business", - MandateAcssDebitTransactionType::Personal => "personal", - } - } -} - -impl AsRef for MandateAcssDebitTransactionType { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for MandateAcssDebitTransactionType { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for MandateAcssDebitTransactionType { - fn default() -> Self { - Self::Business - } -} - -/// An enum representing the possible values of an `MandateBacsDebit`'s `network_status` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum MandateBacsDebitNetworkStatus { - Accepted, - Pending, - Refused, - Revoked, -} - -impl MandateBacsDebitNetworkStatus { - pub fn as_str(self) -> &'static str { - match self { - MandateBacsDebitNetworkStatus::Accepted => "accepted", - MandateBacsDebitNetworkStatus::Pending => "pending", - MandateBacsDebitNetworkStatus::Refused => "refused", - MandateBacsDebitNetworkStatus::Revoked => "revoked", - } - } -} - -impl AsRef for MandateBacsDebitNetworkStatus { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for MandateBacsDebitNetworkStatus { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for MandateBacsDebitNetworkStatus { - fn default() -> Self { - Self::Accepted - } -} - -/// An enum representing the possible values of an `MandateBacsDebit`'s `revocation_reason` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum MandateBacsDebitRevocationReason { - AccountClosed, - BankAccountRestricted, - BankOwnershipChanged, - CouldNotProcess, - DebitNotAuthorized, -} - -impl MandateBacsDebitRevocationReason { - pub fn as_str(self) -> &'static str { - match self { - MandateBacsDebitRevocationReason::AccountClosed => "account_closed", - MandateBacsDebitRevocationReason::BankAccountRestricted => "bank_account_restricted", - MandateBacsDebitRevocationReason::BankOwnershipChanged => "bank_ownership_changed", - MandateBacsDebitRevocationReason::CouldNotProcess => "could_not_process", - MandateBacsDebitRevocationReason::DebitNotAuthorized => "debit_not_authorized", - } - } -} - -impl AsRef for MandateBacsDebitRevocationReason { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for MandateBacsDebitRevocationReason { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for MandateBacsDebitRevocationReason { - fn default() -> Self { - Self::AccountClosed - } -} - -/// An enum representing the possible values of an `Mandate`'s `status` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum MandateStatus { - Active, - Inactive, - Pending, -} - -impl MandateStatus { - pub fn as_str(self) -> &'static str { - match self { - MandateStatus::Active => "active", - MandateStatus::Inactive => "inactive", - MandateStatus::Pending => "pending", - } - } -} - -impl AsRef for MandateStatus { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for MandateStatus { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for MandateStatus { - fn default() -> Self { - Self::Active - } -} - -/// An enum representing the possible values of an `Mandate`'s `type` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum MandateType { - MultiUse, - SingleUse, -} - -impl MandateType { - pub fn as_str(self) -> &'static str { - match self { - MandateType::MultiUse => "multi_use", - MandateType::SingleUse => "single_use", - } - } -} - -impl AsRef for MandateType { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for MandateType { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for MandateType { - fn default() -> Self { - Self::MultiUse - } -} - -/// An enum representing the possible values of an `MandateUsBankAccount`'s `collection_method` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum MandateUsBankAccountCollectionMethod { - Paper, -} - -impl MandateUsBankAccountCollectionMethod { - pub fn as_str(self) -> &'static str { - match self { - MandateUsBankAccountCollectionMethod::Paper => "paper", - } - } -} - -impl AsRef for MandateUsBankAccountCollectionMethod { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for MandateUsBankAccountCollectionMethod { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for MandateUsBankAccountCollectionMethod { - fn default() -> Self { - Self::Paper - } -} diff --git a/src/resources/generated/mandate_updated.rs b/src/resources/generated/mandate_updated.rs deleted file mode 100644 index bfa867ee2..000000000 --- a/src/resources/generated/mandate_updated.rs +++ /dev/null @@ -1,10 +0,0 @@ -// ====================================== -// This file was automatically generated. -// ====================================== - -use serde::{Deserialize, Serialize}; - -/// The resource representing a Stripe "mandate.updated". -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct MandateUpdated { -} diff --git a/src/resources/generated/notification_event_data.rs b/src/resources/generated/notification_event_data.rs deleted file mode 100644 index 6bb13c4af..000000000 --- a/src/resources/generated/notification_event_data.rs +++ /dev/null @@ -1,21 +0,0 @@ -// ====================================== -// This file was automatically generated. -// ====================================== - -use serde::{Deserialize, Serialize}; - -/// The resource representing a Stripe "NotificationEventData". -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct NotificationEventData { - - /// Object containing the names of the updated attributes and their values prior to the event (only included in events of type `*.updated`). - /// - /// If an array attribute has any updated elements, this object contains the entire array. - /// In Stripe API versions 2017-04-06 or earlier, an updated array attribute in this object includes only the updated array elements. - #[serde(skip_serializing_if = "Option::is_none")] - pub previous_attributes: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct NotificationEventDataPreviousAttributes { -} diff --git a/src/resources/generated/payment_intent.rs b/src/resources/generated/payment_intent.rs deleted file mode 100644 index ea7a6c25c..000000000 --- a/src/resources/generated/payment_intent.rs +++ /dev/null @@ -1,14759 +0,0 @@ -// ====================================== -// This file was automatically generated. -// ====================================== - -use serde::{Deserialize, Serialize}; - -use crate::client::{Client, Response}; -use crate::ids::{ - CustomerId, MandateId, PaymentIntentId, PaymentMethodConfigurationId, PaymentMethodId, -}; -use crate::params::{Expand, Expandable, List, Metadata, Object, Paginable, RangeQuery, Timestamp}; -use crate::resources::{ - Account, ApiErrors, Application, Charge, Currency, Customer, Invoice, - LinkedAccountOptionsUsBankAccount, PaymentIntentNextActionCashappHandleRedirectOrDisplayQrCode, - PaymentIntentOffSession, PaymentMethod, - PaymentMethodConfigBizPaymentMethodConfigurationDetails, - PaymentMethodDetailsCardInstallmentsPlan, PaymentMethodOptionsCustomerBalanceEuBankAccount, - PaymentMethodOptionsUsBankAccountMandateOptions, PaymentSource, Review, Shipping, -}; - -/// The resource representing a Stripe "PaymentIntent". -/// -/// For more details see -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct PaymentIntent { - /// Unique identifier for the object. - pub id: PaymentIntentId, - - /// Amount intended to be collected by this PaymentIntent. - /// - /// A positive integer representing how much to charge in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal) (e.g., 100 cents to charge $1.00 or 100 to charge ¥100, a zero-decimal currency). - /// The minimum amount is $0.50 US or [equivalent in charge currency](https://stripe.com/docs/currencies#minimum-and-maximum-charge-amounts). - /// The amount value supports up to eight digits (e.g., a value of 99999999 for a USD charge of $999,999.99). - pub amount: i64, - - /// Amount that can be captured from this PaymentIntent. - pub amount_capturable: i64, - - #[serde(skip_serializing_if = "Option::is_none")] - pub amount_details: Option, - - /// Amount that this PaymentIntent collects. - pub amount_received: i64, - - /// ID of the Connect application that created the PaymentIntent. - pub application: Option>, - - /// The amount of the application fee (if any) that will be requested to be applied to the payment and transferred to the application owner's Stripe account. - /// - /// The amount of the application fee collected will be capped at the total payment amount. - /// For more information, see the PaymentIntents [use case for connected accounts](https://stripe.com/docs/payments/connected-accounts). - pub application_fee_amount: Option, - - /// Settings to configure compatible payment methods from the [Stripe Dashboard](https://dashboard.stripe.com/settings/payment_methods). - pub automatic_payment_methods: Option, - - /// Populated when `status` is `canceled`, this is the time at which the PaymentIntent was canceled. - /// - /// Measured in seconds since the Unix epoch. - pub canceled_at: Option, - - /// Reason for cancellation of this PaymentIntent, either user-provided (`duplicate`, `fraudulent`, `requested_by_customer`, or `abandoned`) or generated by Stripe internally (`failed_invoice`, `void_invoice`, or `automatic`). - pub cancellation_reason: Option, - - /// Controls when the funds will be captured from the customer's account. - pub capture_method: PaymentIntentCaptureMethod, - - /// The client secret of this PaymentIntent. - /// - /// Used for client-side retrieval using a publishable key. - /// The client secret can be used to complete a payment from your frontend. - /// It should not be stored, logged, or exposed to anyone other than the customer. - /// Make sure that you have TLS enabled on any page that includes the client secret. Refer to our docs to [accept a payment](https://stripe.com/docs/payments/accept-a-payment?ui=elements) and learn about how `client_secret` should be handled. - pub client_secret: Option, - - /// Describes whether we can confirm this PaymentIntent automatically, or if it requires customer action to confirm the payment. - pub confirmation_method: PaymentIntentConfirmationMethod, - - /// Time at which the object was created. - /// - /// Measured in seconds since the Unix epoch. - pub created: Timestamp, - - /// Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. - /// - /// Must be a [supported currency](https://stripe.com/docs/currencies). - pub currency: Currency, - - /// ID of the Customer this PaymentIntent belongs to, if one exists. - /// - /// Payment methods attached to other Customers cannot be used with this PaymentIntent. - /// - /// If present in combination with [setup_future_usage](https://stripe.com/docs/api#payment_intent_object-setup_future_usage), this PaymentIntent's payment method will be attached to the Customer after the PaymentIntent has been confirmed and any required actions from the user are complete. - pub customer: Option>, - - /// An arbitrary string attached to the object. - /// - /// Often useful for displaying to users. - pub description: Option, - - /// ID of the invoice that created this PaymentIntent, if it exists. - pub invoice: Option>, - - /// The payment error encountered in the previous PaymentIntent confirmation. - /// - /// It will be cleared if the PaymentIntent is later updated for any reason. - pub last_payment_error: Option>, - - /// The latest charge created by this PaymentIntent. - pub latest_charge: Option>, - - /// Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. - pub livemode: bool, - - /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. - /// - /// This can be useful for storing additional information about the object in a structured format. - /// Learn more about [storing information in metadata](https://stripe.com/docs/payments/payment-intents/creating-payment-intents#storing-information-in-metadata). - pub metadata: Metadata, - - /// If present, this property tells you what actions you need to take in order for your customer to fulfill a payment using the provided source. - pub next_action: Option, - - /// The account (if any) for which the funds of the PaymentIntent are intended. - /// - /// See the PaymentIntents [use case for connected accounts](https://stripe.com/docs/payments/connected-accounts) for details. - pub on_behalf_of: Option>, - - /// ID of the payment method used in this PaymentIntent. - pub payment_method: Option>, - - /// Information about the payment method configuration used for this PaymentIntent. - pub payment_method_configuration_details: - Option, - - /// Payment-method-specific configuration for this PaymentIntent. - pub payment_method_options: Option, - - /// The list of payment method types (e.g. - /// - /// card) that this PaymentIntent is allowed to use. - pub payment_method_types: Vec, - - /// If present, this property tells you about the processing state of the payment. - pub processing: Option, - - /// Email address that the receipt for the resulting payment will be sent to. - /// - /// If `receipt_email` is specified for a payment in live mode, a receipt will be sent regardless of your [email settings](https://dashboard.stripe.com/account/emails). - pub receipt_email: Option, - - /// ID of the review associated with this PaymentIntent, if any. - pub review: Option>, - - /// Indicates that you intend to make future payments with this PaymentIntent's payment method. - /// - /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. - /// - /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). - pub setup_future_usage: Option, - - /// Shipping information for this PaymentIntent. - pub shipping: Option, - - /// This is a legacy field that will be removed in the future. - /// - /// It is the ID of the Source object that is associated with this PaymentIntent, if one was supplied. - pub source: Option>, - - /// For card charges, use [statement_descriptor_suffix](https://stripe.com/docs/payments/account/statement-descriptors#dynamic). - /// - /// Otherwise, you can use this value as the complete description of a charge on your customers' statements. - /// It must contain at least one letter and be 1–22 characters long. - pub statement_descriptor: Option, - - /// Provides information about a card payment that customers see on their statements. - /// - /// Concatenated with the prefix (shortened descriptor) or statement descriptor that’s set on the account to form the complete statement descriptor. - /// Maximum 22 characters for the concatenated descriptor. - pub statement_descriptor_suffix: Option, - - /// Status of this PaymentIntent, one of `requires_payment_method`, `requires_confirmation`, `requires_action`, `processing`, `requires_capture`, `canceled`, or `succeeded`. - /// - /// Read more about each PaymentIntent [status](https://stripe.com/docs/payments/intents#intent-statuses). - pub status: PaymentIntentStatus, - - /// The data that automatically creates a Transfer after the payment finalizes. - /// - /// Learn more about the [use case for connected accounts](https://stripe.com/docs/payments/connected-accounts). - pub transfer_data: Option, - - /// A string that identifies the resulting payment as part of a group. - /// - /// Learn more about the [use case for connected accounts](https://stripe.com/docs/connect/separate-charges-and-transfers). - pub transfer_group: Option, -} - -impl PaymentIntent { - /// Returns a list of PaymentIntents. - pub fn list(client: &Client, params: &ListPaymentIntents<'_>) -> Response> { - client.get_query("/payment_intents", ¶ms) - } - - /// Creates a PaymentIntent object. - /// - /// After the PaymentIntent is created, attach a payment method and [confirm](https://stripe.com/docs/api/payment_intents/confirm) - /// to continue the payment. - /// - /// Learn more about [the available payment flows with the Payment Intents API](https://stripe.com/docs/payments/payment-intents). When you use `confirm=true` during creation, it’s equivalent to creating and confirming the PaymentIntent in the same call. - /// You can use any parameters available in the [confirm API](https://stripe.com/docs/api/payment_intents/confirm) when you supply `confirm=true`. - pub fn create(client: &Client, params: CreatePaymentIntent<'_>) -> Response { - client.post_form("/payment_intents", ¶ms) - } - - /// Retrieves the details of a PaymentIntent that has previously been created. - /// - /// You can retrieve a PaymentIntent client-side using a publishable key when the `client_secret` is in the query string. - /// If you retrieve a PaymentIntent with a publishable key, it only returns a subset of properties. - /// Refer to the [payment intent](https://stripe.com/docs/api#payment_intent_object) object reference for more details. - pub fn retrieve( - client: &Client, - id: &PaymentIntentId, - expand: &[&str], - ) -> Response { - client.get_query(&format!("/payment_intents/{}", id), &Expand { expand }) - } - - /// Updates properties on a PaymentIntent object without confirming. - /// - /// Depending on which properties you update, you might need to confirm the - /// PaymentIntent again. - /// - /// For example, updating the `payment_method` always requires you to confirm the PaymentIntent again. - /// If you prefer to update and confirm at the same time, we recommend updating properties through the [confirm API](https://stripe.com/docs/api/payment_intents/confirm) instead. - pub fn update( - client: &Client, - id: &PaymentIntentId, - params: UpdatePaymentIntent<'_>, - ) -> Response { - client.post_form(&format!("/payment_intents/{}", id), ¶ms) - } -} - -impl Object for PaymentIntent { - type Id = PaymentIntentId; - fn id(&self) -> Self::Id { - self.id.clone() - } - fn object(&self) -> &'static str { - "payment_intent" - } -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct PaymentFlowsAmountDetails { - #[serde(skip_serializing_if = "Option::is_none")] - pub tip: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct PaymentFlowsAmountDetailsResourceTip { - /// Portion of the amount that corresponds to a tip. - #[serde(skip_serializing_if = "Option::is_none")] - pub amount: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct PaymentFlowsAutomaticPaymentMethodsPaymentIntent { - /// Controls whether this PaymentIntent will accept redirect-based payment methods. - /// - /// Redirect-based payment methods may require your customer to be redirected to a payment method's app or site for authentication or additional steps. - /// - /// To [confirm](https://stripe.com/docs/api/payment_intents/confirm) this PaymentIntent, you may be required to provide a `return_url` to redirect customers back to your site after they authenticate or complete the payment. - #[serde(skip_serializing_if = "Option::is_none")] - pub allow_redirects: Option, - - /// Automatically calculates compatible payment methods. - pub enabled: bool, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct PaymentIntentNextAction { - #[serde(skip_serializing_if = "Option::is_none")] - pub alipay_handle_redirect: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub boleto_display_details: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub card_await_notification: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub cashapp_handle_redirect_or_display_qr_code: - Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub display_bank_transfer_instructions: - Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub konbini_display_details: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub oxxo_display_details: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub paynow_display_qr_code: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub pix_display_qr_code: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub promptpay_display_qr_code: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub redirect_to_url: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub swish_handle_redirect_or_display_qr_code: - Option, - - /// Type of the next action to perform, one of `redirect_to_url`, `use_stripe_sdk`, `alipay_handle_redirect`, `oxxo_display_details`, or `verify_with_microdeposits`. - #[serde(rename = "type")] - pub type_: String, - - /// When confirming a PaymentIntent with Stripe.js, Stripe.js depends on the contents of this dictionary to invoke authentication flows. - /// - /// The shape of the contents is subject to change and is only intended to be used by Stripe.js. - #[serde(skip_serializing_if = "Option::is_none")] - pub use_stripe_sdk: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub verify_with_microdeposits: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub wechat_pay_display_qr_code: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub wechat_pay_redirect_to_android_app: - Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub wechat_pay_redirect_to_ios_app: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct PaymentIntentNextActionAlipayHandleRedirect { - /// The native data to be used with Alipay SDK you must redirect your customer to in order to authenticate the payment in an Android App. - pub native_data: Option, - - /// The native URL you must redirect your customer to in order to authenticate the payment in an iOS App. - pub native_url: Option, - - /// If the customer does not exit their browser while authenticating, they will be redirected to this specified URL after completion. - pub return_url: Option, - - /// The URL you must redirect your customer to in order to authenticate the payment. - pub url: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct PaymentIntentNextActionBoleto { - /// The timestamp after which the boleto expires. - pub expires_at: Option, - - /// The URL to the hosted boleto voucher page, which allows customers to view the boleto voucher. - pub hosted_voucher_url: Option, - - /// The boleto number. - pub number: Option, - - /// The URL to the downloadable boleto voucher PDF. - pub pdf: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct PaymentIntentNextActionCardAwaitNotification { - /// The time that payment will be attempted. - /// - /// If customer approval is required, they need to provide approval before this time. - pub charge_attempt_at: Option, - - /// For payments greater than INR 15000, the customer must provide explicit approval of the payment with their bank. - /// - /// For payments of lower amount, no customer action is required. - pub customer_approval_required: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct PaymentIntentNextActionDisplayBankTransferInstructions { - /// The remaining amount that needs to be transferred to complete the payment. - pub amount_remaining: Option, - - /// Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. - /// - /// Must be a [supported currency](https://stripe.com/docs/currencies). - pub currency: Option, - - /// A list of financial addresses that can be used to fund the customer balance. - #[serde(skip_serializing_if = "Option::is_none")] - pub financial_addresses: Option>, - - /// A link to a hosted page that guides your customer through completing the transfer. - pub hosted_instructions_url: Option, - - /// A string identifying this payment. - /// - /// Instruct your customer to include this code in the reference or memo field of their bank transfer. - pub reference: Option, - - /// Type of bank transfer. - #[serde(rename = "type")] - pub type_: PaymentIntentNextActionDisplayBankTransferInstructionsType, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct FundingInstructionsBankTransferFinancialAddress { - #[serde(skip_serializing_if = "Option::is_none")] - pub aba: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub iban: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub sort_code: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub spei: Option, - - /// The payment networks supported by this FinancialAddress. - #[serde(skip_serializing_if = "Option::is_none")] - pub supported_networks: - Option>, - - #[serde(skip_serializing_if = "Option::is_none")] - pub swift: Option, - - /// The type of financial address. - #[serde(rename = "type")] - pub type_: FundingInstructionsBankTransferFinancialAddressType, - - #[serde(skip_serializing_if = "Option::is_none")] - pub zengin: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct FundingInstructionsBankTransferAbaRecord { - /// The ABA account number. - pub account_number: String, - - /// The bank name. - pub bank_name: String, - - /// The ABA routing number. - pub routing_number: String, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct FundingInstructionsBankTransferIbanRecord { - /// The name of the person or business that owns the bank account. - pub account_holder_name: String, - - /// The BIC/SWIFT code of the account. - pub bic: String, - - /// Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). - pub country: String, - - /// The IBAN of the account. - pub iban: String, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct FundingInstructionsBankTransferSortCodeRecord { - /// The name of the person or business that owns the bank account. - pub account_holder_name: String, - - /// The account number. - pub account_number: String, - - /// The six-digit sort code. - pub sort_code: String, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct FundingInstructionsBankTransferSpeiRecord { - /// The three-digit bank code. - pub bank_code: String, - - /// The short banking institution name. - pub bank_name: String, - - /// The CLABE number. - pub clabe: String, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct FundingInstructionsBankTransferSwiftRecord { - /// The account number. - pub account_number: String, - - /// The bank name. - pub bank_name: String, - - /// The SWIFT code. - pub swift_code: String, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct FundingInstructionsBankTransferZenginRecord { - /// The account holder name. - pub account_holder_name: Option, - - /// The account number. - pub account_number: Option, - - /// The bank account type. - /// - /// In Japan, this can only be `futsu` or `toza`. - pub account_type: Option, - - /// The bank code of the account. - pub bank_code: Option, - - /// The bank name of the account. - pub bank_name: Option, - - /// The branch code of the account. - pub branch_code: Option, - - /// The branch name of the account. - pub branch_name: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct PaymentIntentNextActionDisplayOxxoDetails { - /// The timestamp after which the OXXO voucher expires. - pub expires_after: Option, - - /// The URL for the hosted OXXO voucher page, which allows customers to view and print an OXXO voucher. - pub hosted_voucher_url: Option, - - /// OXXO reference number. - pub number: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct PaymentIntentNextActionKonbini { - /// The timestamp at which the pending Konbini payment expires. - pub expires_at: Timestamp, - - /// The URL for the Konbini payment instructions page, which allows customers to view and print a Konbini voucher. - pub hosted_voucher_url: Option, - - pub stores: PaymentIntentNextActionKonbiniStores, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct PaymentIntentNextActionKonbiniStores { - /// FamilyMart instruction details. - pub familymart: Option, - - /// Lawson instruction details. - pub lawson: Option, - - /// Ministop instruction details. - pub ministop: Option, - - /// Seicomart instruction details. - pub seicomart: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct PaymentIntentNextActionKonbiniFamilymart { - /// The confirmation number. - #[serde(skip_serializing_if = "Option::is_none")] - pub confirmation_number: Option, - - /// The payment code. - pub payment_code: String, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct PaymentIntentNextActionKonbiniLawson { - /// The confirmation number. - #[serde(skip_serializing_if = "Option::is_none")] - pub confirmation_number: Option, - - /// The payment code. - pub payment_code: String, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct PaymentIntentNextActionKonbiniMinistop { - /// The confirmation number. - #[serde(skip_serializing_if = "Option::is_none")] - pub confirmation_number: Option, - - /// The payment code. - pub payment_code: String, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct PaymentIntentNextActionKonbiniSeicomart { - /// The confirmation number. - #[serde(skip_serializing_if = "Option::is_none")] - pub confirmation_number: Option, - - /// The payment code. - pub payment_code: String, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct PaymentIntentNextActionPaynowDisplayQrCode { - /// The raw data string used to generate QR code, it should be used together with QR code library. - pub data: String, - - /// The URL to the hosted PayNow instructions page, which allows customers to view the PayNow QR code. - pub hosted_instructions_url: Option, - - /// The image_url_png string used to render QR code. - pub image_url_png: String, - - /// The image_url_svg string used to render QR code. - pub image_url_svg: String, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct PaymentIntentNextActionPixDisplayQrCode { - /// The raw data string used to generate QR code, it should be used together with QR code library. - #[serde(skip_serializing_if = "Option::is_none")] - pub data: Option, - - /// The date (unix timestamp) when the PIX expires. - #[serde(skip_serializing_if = "Option::is_none")] - pub expires_at: Option, - - /// The URL to the hosted pix instructions page, which allows customers to view the pix QR code. - #[serde(skip_serializing_if = "Option::is_none")] - pub hosted_instructions_url: Option, - - /// The image_url_png string used to render png QR code. - #[serde(skip_serializing_if = "Option::is_none")] - pub image_url_png: Option, - - /// The image_url_svg string used to render svg QR code. - #[serde(skip_serializing_if = "Option::is_none")] - pub image_url_svg: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct PaymentIntentNextActionPromptpayDisplayQrCode { - /// The raw data string used to generate QR code, it should be used together with QR code library. - pub data: String, - - /// The URL to the hosted PromptPay instructions page, which allows customers to view the PromptPay QR code. - pub hosted_instructions_url: String, - - /// The PNG path used to render the QR code, can be used as the source in an HTML img tag. - pub image_url_png: String, - - /// The SVG path used to render the QR code, can be used as the source in an HTML img tag. - pub image_url_svg: String, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct PaymentIntentNextActionRedirectToUrl { - /// If the customer does not exit their browser while authenticating, they will be redirected to this specified URL after completion. - pub return_url: Option, - - /// The URL you must redirect your customer to in order to authenticate the payment. - pub url: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct PaymentIntentNextActionSwishHandleRedirectOrDisplayQrCode { - /// The URL to the hosted Swish instructions page, which allows customers to view the QR code. - #[serde(skip_serializing_if = "Option::is_none")] - pub hosted_instructions_url: Option, - - /// The url for mobile redirect based auth. - #[serde(skip_serializing_if = "Option::is_none")] - pub mobile_auth_url: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub qr_code: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct PaymentIntentNextActionSwishQrCode { - /// The raw data string used to generate QR code, it should be used together with QR code library. - #[serde(skip_serializing_if = "Option::is_none")] - pub data: Option, - - /// The image_url_png string used to render QR code. - #[serde(skip_serializing_if = "Option::is_none")] - pub image_url_png: Option, - - /// The image_url_svg string used to render QR code. - #[serde(skip_serializing_if = "Option::is_none")] - pub image_url_svg: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct PaymentIntentNextActionVerifyWithMicrodeposits { - /// The timestamp when the microdeposits are expected to land. - pub arrival_date: Timestamp, - - /// The URL for the hosted verification page, which allows customers to verify their bank account. - pub hosted_verification_url: String, - - /// The type of the microdeposit sent to the customer. - /// - /// Used to distinguish between different verification methods. - pub microdeposit_type: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct PaymentIntentNextActionWechatPayDisplayQrCode { - /// The data being used to generate QR code. - pub data: String, - - /// The URL to the hosted WeChat Pay instructions page, which allows customers to view the WeChat Pay QR code. - pub hosted_instructions_url: String, - - /// The base64 image data for a pre-generated QR code. - pub image_data_url: String, - - /// The image_url_png string used to render QR code. - pub image_url_png: String, - - /// The image_url_svg string used to render QR code. - pub image_url_svg: String, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct PaymentIntentNextActionWechatPayRedirectToAndroidApp { - /// app_id is the APP ID registered on WeChat open platform. - pub app_id: String, - - /// nonce_str is a random string. - pub nonce_str: String, - - /// package is static value. - pub package: String, - - /// an unique merchant ID assigned by WeChat Pay. - pub partner_id: String, - - /// an unique trading ID assigned by WeChat Pay. - pub prepay_id: String, - - /// A signature. - pub sign: String, - - /// Specifies the current time in epoch format. - pub timestamp: String, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct PaymentIntentNextActionWechatPayRedirectToIosApp { - /// An universal link that redirect to WeChat Pay app. - pub native_url: String, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct PaymentIntentPaymentMethodOptions { - #[serde(skip_serializing_if = "Option::is_none")] - pub acss_debit: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub affirm: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub afterpay_clearpay: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub alipay: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub au_becs_debit: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub bacs_debit: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub bancontact: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub blik: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub boleto: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub card: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub card_present: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub cashapp: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub customer_balance: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub eps: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub fpx: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub giropay: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub grabpay: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub ideal: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub interac_present: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub klarna: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub konbini: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub link: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub oxxo: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub p24: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub paynow: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub paypal: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub pix: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub promptpay: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub revolut_pay: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub sepa_debit: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub sofort: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub swish: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub us_bank_account: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub wechat_pay: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub zip: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct PaymentIntentPaymentMethodOptionsAcssDebit { - #[serde(skip_serializing_if = "Option::is_none")] - pub mandate_options: Option, - - /// Indicates that you intend to make future payments with this PaymentIntent's payment method. - /// - /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. - /// - /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). - #[serde(skip_serializing_if = "Option::is_none")] - pub setup_future_usage: Option, - - /// Bank account verification method. - #[serde(skip_serializing_if = "Option::is_none")] - pub verification_method: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct PaymentIntentPaymentMethodOptionsAuBecsDebit { - /// Indicates that you intend to make future payments with this PaymentIntent's payment method. - /// - /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. - /// - /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). - #[serde(skip_serializing_if = "Option::is_none")] - pub setup_future_usage: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct PaymentIntentPaymentMethodOptionsBlik { - /// Indicates that you intend to make future payments with this PaymentIntent's payment method. - /// - /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. - /// - /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). - #[serde(skip_serializing_if = "Option::is_none")] - pub setup_future_usage: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct PaymentIntentPaymentMethodOptionsCard { - /// Controls when the funds will be captured from the customer's account. - #[serde(skip_serializing_if = "Option::is_none")] - pub capture_method: Option, - - /// Installment details for this payment (Mexico only). - /// - /// For more information, see the [installments integration guide](https://stripe.com/docs/payments/installments). - pub installments: Option, - - /// Configuration options for setting up an eMandate for cards issued in India. - pub mandate_options: Option, - - /// Selected network to process this payment intent on. - /// - /// Depends on the available networks of the card attached to the payment intent. - /// Can be only set confirm-time. - pub network: Option, - - /// Request ability to [capture beyond the standard authorization validity window](https://stripe.com/docs/payments/extended-authorization) for this PaymentIntent. - #[serde(skip_serializing_if = "Option::is_none")] - pub request_extended_authorization: - Option, - - /// Request ability to [increment the authorization](https://stripe.com/docs/payments/incremental-authorization) for this PaymentIntent. - #[serde(skip_serializing_if = "Option::is_none")] - pub request_incremental_authorization: - Option, - - /// Request ability to make [multiple captures](https://stripe.com/docs/payments/multicapture) for this PaymentIntent. - #[serde(skip_serializing_if = "Option::is_none")] - pub request_multicapture: Option, - - /// Request ability to [overcapture](https://stripe.com/docs/payments/overcapture) for this PaymentIntent. - #[serde(skip_serializing_if = "Option::is_none")] - pub request_overcapture: Option, - - /// We strongly recommend that you rely on our SCA Engine to automatically prompt your customers for authentication based on risk level and [other requirements](https://stripe.com/docs/strong-customer-authentication). - /// - /// However, if you wish to request 3D Secure based on logic from your own fraud engine, provide this option. - /// If not provided, this value defaults to `automatic`. - /// Read our guide on [manually requesting 3D Secure](https://stripe.com/docs/payments/3d-secure#manual-three-ds) for more information on how this configuration interacts with Radar and our SCA Engine. - pub request_three_d_secure: Option, - - /// When enabled, using a card that is attached to a customer will require the CVC to be provided again (i.e. - /// - /// using the cvc_token parameter). - #[serde(skip_serializing_if = "Option::is_none")] - pub require_cvc_recollection: Option, - - /// Indicates that you intend to make future payments with this PaymentIntent's payment method. - /// - /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. - /// - /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). - #[serde(skip_serializing_if = "Option::is_none")] - pub setup_future_usage: Option, - - /// Provides information about a card payment that customers see on their statements. - /// - /// Concatenated with the Kana prefix (shortened Kana descriptor) or Kana statement descriptor that’s set on the account to form the complete statement descriptor. - /// Maximum 22 characters. - /// On card statements, the *concatenation* of both prefix and suffix (including separators) will appear truncated to 22 characters. - #[serde(skip_serializing_if = "Option::is_none")] - pub statement_descriptor_suffix_kana: Option, - - /// Provides information about a card payment that customers see on their statements. - /// - /// Concatenated with the Kanji prefix (shortened Kanji descriptor) or Kanji statement descriptor that’s set on the account to form the complete statement descriptor. - /// Maximum 17 characters. - /// On card statements, the *concatenation* of both prefix and suffix (including separators) will appear truncated to 17 characters. - #[serde(skip_serializing_if = "Option::is_none")] - pub statement_descriptor_suffix_kanji: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct PaymentIntentPaymentMethodOptionsEps { - /// Indicates that you intend to make future payments with this PaymentIntent's payment method. - /// - /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. - /// - /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). - #[serde(skip_serializing_if = "Option::is_none")] - pub setup_future_usage: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct PaymentIntentPaymentMethodOptionsLink { - /// Controls when the funds will be captured from the customer's account. - #[serde(skip_serializing_if = "Option::is_none")] - pub capture_method: Option, - - /// [Deprecated] This is a legacy parameter that no longer has any function. - pub persistent_token: Option, - - /// Indicates that you intend to make future payments with this PaymentIntent's payment method. - /// - /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. - /// - /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). - #[serde(skip_serializing_if = "Option::is_none")] - pub setup_future_usage: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct PaymentIntentPaymentMethodOptionsMandateOptionsAcssDebit { - /// A URL for custom mandate text. - #[serde(skip_serializing_if = "Option::is_none")] - pub custom_mandate_url: Option, - - /// Description of the interval. - /// - /// Only required if the 'payment_schedule' parameter is 'interval' or 'combined'. - pub interval_description: Option, - - /// Payment schedule for the mandate. - pub payment_schedule: - Option, - - /// Transaction type of the mandate. - pub transaction_type: - Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct PaymentIntentPaymentMethodOptionsSepaDebit { - #[serde(skip_serializing_if = "Option::is_none")] - pub mandate_options: Option, - - /// Indicates that you intend to make future payments with this PaymentIntent's payment method. - /// - /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. - /// - /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). - #[serde(skip_serializing_if = "Option::is_none")] - pub setup_future_usage: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct PaymentIntentPaymentMethodOptionsMandateOptionsSepaDebit {} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct PaymentIntentPaymentMethodOptionsSwish { - /// The order ID displayed in the Swish app after the payment is authorized. - #[serde(skip_serializing_if = "Option::is_none")] - pub reference: Option, - - /// Indicates that you intend to make future payments with this PaymentIntent's payment method. - /// - /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. - /// - /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). - #[serde(skip_serializing_if = "Option::is_none")] - pub setup_future_usage: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct PaymentIntentPaymentMethodOptionsUsBankAccount { - #[serde(skip_serializing_if = "Option::is_none")] - pub financial_connections: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub mandate_options: Option, - - /// Preferred transaction settlement speed. - #[serde(skip_serializing_if = "Option::is_none")] - pub preferred_settlement_speed: - Option, - - /// Indicates that you intend to make future payments with this PaymentIntent's payment method. - /// - /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. - /// - /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). - #[serde(skip_serializing_if = "Option::is_none")] - pub setup_future_usage: Option, - - /// Bank account verification method. - #[serde(skip_serializing_if = "Option::is_none")] - pub verification_method: - Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct PaymentIntentProcessing { - #[serde(skip_serializing_if = "Option::is_none")] - pub card: Option, - - /// Type of the payment method for which payment is in `processing` state, one of `card`. - #[serde(rename = "type")] - pub type_: PaymentIntentProcessingType, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct PaymentIntentCardProcessing { - #[serde(skip_serializing_if = "Option::is_none")] - pub customer_notification: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct PaymentIntentProcessingCustomerNotification { - /// Whether customer approval has been requested for this payment. - /// - /// For payments greater than INR 15000 or mandate amount, the customer must provide explicit approval of the payment with their bank. - pub approval_requested: Option, - - /// If customer approval is required, they need to provide approval before this time. - pub completes_at: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct PaymentMethodOptionsAffirm { - /// Controls when the funds will be captured from the customer's account. - #[serde(skip_serializing_if = "Option::is_none")] - pub capture_method: Option, - - /// Preferred language of the Affirm authorization page that the customer is redirected to. - #[serde(skip_serializing_if = "Option::is_none")] - pub preferred_locale: Option, - - /// Indicates that you intend to make future payments with this PaymentIntent's payment method. - /// - /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. - /// - /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). - #[serde(skip_serializing_if = "Option::is_none")] - pub setup_future_usage: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct PaymentMethodOptionsAfterpayClearpay { - /// Controls when the funds will be captured from the customer's account. - #[serde(skip_serializing_if = "Option::is_none")] - pub capture_method: Option, - - /// An internal identifier or reference that this payment corresponds to. - /// - /// You must limit the identifier to 128 characters, and it can only contain letters, numbers, underscores, backslashes, and dashes. This field differs from the statement descriptor and item name. - pub reference: Option, - - /// Indicates that you intend to make future payments with this PaymentIntent's payment method. - /// - /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. - /// - /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). - #[serde(skip_serializing_if = "Option::is_none")] - pub setup_future_usage: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct PaymentMethodOptionsAlipay { - /// Indicates that you intend to make future payments with this PaymentIntent's payment method. - /// - /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. - /// - /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). - #[serde(skip_serializing_if = "Option::is_none")] - pub setup_future_usage: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct PaymentMethodOptionsBacsDebit { - /// Indicates that you intend to make future payments with this PaymentIntent's payment method. - /// - /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. - /// - /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). - #[serde(skip_serializing_if = "Option::is_none")] - pub setup_future_usage: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct PaymentMethodOptionsBancontact { - /// Preferred language of the Bancontact authorization page that the customer is redirected to. - pub preferred_language: PaymentMethodOptionsBancontactPreferredLanguage, - - /// Indicates that you intend to make future payments with this PaymentIntent's payment method. - /// - /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. - /// - /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). - #[serde(skip_serializing_if = "Option::is_none")] - pub setup_future_usage: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct PaymentMethodOptionsBoleto { - /// The number of calendar days before a Boleto voucher expires. - /// - /// For example, if you create a Boleto voucher on Monday and you set expires_after_days to 2, the Boleto voucher will expire on Wednesday at 23:59 America/Sao_Paulo time. - pub expires_after_days: u32, - - /// Indicates that you intend to make future payments with this PaymentIntent's payment method. - /// - /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. - /// - /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). - #[serde(skip_serializing_if = "Option::is_none")] - pub setup_future_usage: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct PaymentMethodOptionsCardInstallments { - /// Installment plans that may be selected for this PaymentIntent. - pub available_plans: Option>, - - /// Whether Installments are enabled for this PaymentIntent. - pub enabled: bool, - - /// Installment plan selected for this PaymentIntent. - pub plan: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct PaymentMethodOptionsCardMandateOptions { - /// Amount to be charged for future payments. - pub amount: i64, - - /// One of `fixed` or `maximum`. - /// - /// If `fixed`, the `amount` param refers to the exact amount to be charged in future payments. - /// If `maximum`, the amount charged can be up to the value passed for the `amount` param. - pub amount_type: PaymentMethodOptionsCardMandateOptionsAmountType, - - /// A description of the mandate or subscription that is meant to be displayed to the customer. - pub description: Option, - - /// End date of the mandate or subscription. - /// - /// If not provided, the mandate will be active until canceled. - /// If provided, end date should be after start date. - pub end_date: Option, - - /// Specifies payment frequency. - /// - /// One of `day`, `week`, `month`, `year`, or `sporadic`. - pub interval: PaymentMethodOptionsCardMandateOptionsInterval, - - /// The number of intervals between payments. - /// - /// For example, `interval=month` and `interval_count=3` indicates one payment every three months. - /// Maximum of one year interval allowed (1 year, 12 months, or 52 weeks). - /// This parameter is optional when `interval=sporadic`. - pub interval_count: Option, - - /// Unique identifier for the mandate or subscription. - pub reference: String, - - /// Start date of the mandate or subscription. - /// - /// Start date should not be lesser than yesterday. - pub start_date: Timestamp, - - /// Specifies the type of mandates supported. - /// - /// Possible values are `india`. - pub supported_types: Option>, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct PaymentMethodOptionsCardPresent { - /// Request ability to capture this payment beyond the standard [authorization validity window](https://stripe.com/docs/terminal/features/extended-authorizations#authorization-validity). - pub request_extended_authorization: Option, - - /// Request ability to [increment](https://stripe.com/docs/terminal/features/incremental-authorizations) this PaymentIntent if the combination of MCC and card brand is eligible. - /// - /// Check [incremental_authorization_supported](https://stripe.com/docs/api/charges/object#charge_object-payment_method_details-card_present-incremental_authorization_supported) in the [Confirm](https://stripe.com/docs/api/payment_intents/confirm) response to verify support. - pub request_incremental_authorization_support: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct PaymentMethodOptionsCashapp { - /// Controls when the funds will be captured from the customer's account. - #[serde(skip_serializing_if = "Option::is_none")] - pub capture_method: Option, - - /// Indicates that you intend to make future payments with this PaymentIntent's payment method. - /// - /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. - /// - /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). - #[serde(skip_serializing_if = "Option::is_none")] - pub setup_future_usage: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct PaymentMethodOptionsCustomerBalance { - #[serde(skip_serializing_if = "Option::is_none")] - pub bank_transfer: Option, - - /// The funding method type to be used when there are not enough funds in the customer balance. - /// - /// Permitted values include: `bank_transfer`. - pub funding_type: Option, - - /// Indicates that you intend to make future payments with this PaymentIntent's payment method. - /// - /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. - /// - /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). - #[serde(skip_serializing_if = "Option::is_none")] - pub setup_future_usage: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct PaymentMethodOptionsCustomerBalanceBankTransfer { - #[serde(skip_serializing_if = "Option::is_none")] - pub eu_bank_transfer: Option, - - /// List of address types that should be returned in the financial_addresses response. - /// - /// If not specified, all valid types will be returned. Permitted values include: `sort_code`, `zengin`, `iban`, or `spei`. - #[serde(skip_serializing_if = "Option::is_none")] - pub requested_address_types: - Option>, - - /// The bank transfer type that this PaymentIntent is allowed to use for funding Permitted values include: `eu_bank_transfer`, `gb_bank_transfer`, `jp_bank_transfer`, `mx_bank_transfer`, or `us_bank_transfer`. - #[serde(rename = "type")] - pub type_: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct PaymentMethodOptionsFpx { - /// Indicates that you intend to make future payments with this PaymentIntent's payment method. - /// - /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. - /// - /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). - #[serde(skip_serializing_if = "Option::is_none")] - pub setup_future_usage: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct PaymentMethodOptionsGiropay { - /// Indicates that you intend to make future payments with this PaymentIntent's payment method. - /// - /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. - /// - /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). - #[serde(skip_serializing_if = "Option::is_none")] - pub setup_future_usage: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct PaymentMethodOptionsGrabpay { - /// Indicates that you intend to make future payments with this PaymentIntent's payment method. - /// - /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. - /// - /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). - #[serde(skip_serializing_if = "Option::is_none")] - pub setup_future_usage: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct PaymentMethodOptionsIdeal { - /// Indicates that you intend to make future payments with this PaymentIntent's payment method. - /// - /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. - /// - /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). - #[serde(skip_serializing_if = "Option::is_none")] - pub setup_future_usage: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct PaymentMethodOptionsInteracPresent {} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct PaymentMethodOptionsKlarna { - /// Controls when the funds will be captured from the customer's account. - #[serde(skip_serializing_if = "Option::is_none")] - pub capture_method: Option, - - /// Preferred locale of the Klarna checkout page that the customer is redirected to. - pub preferred_locale: Option, - - /// Indicates that you intend to make future payments with this PaymentIntent's payment method. - /// - /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. - /// - /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). - #[serde(skip_serializing_if = "Option::is_none")] - pub setup_future_usage: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct PaymentMethodOptionsKonbini { - /// An optional 10 to 11 digit numeric-only string determining the confirmation code at applicable convenience stores. - pub confirmation_number: Option, - - /// The number of calendar days (between 1 and 60) after which Konbini payment instructions will expire. - /// - /// For example, if a PaymentIntent is confirmed with Konbini and `expires_after_days` set to 2 on Monday JST, the instructions will expire on Wednesday 23:59:59 JST. - pub expires_after_days: Option, - - /// The timestamp at which the Konbini payment instructions will expire. - /// - /// Only one of `expires_after_days` or `expires_at` may be set. - pub expires_at: Option, - - /// A product descriptor of up to 22 characters, which will appear to customers at the convenience store. - pub product_description: Option, - - /// Indicates that you intend to make future payments with this PaymentIntent's payment method. - /// - /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. - /// - /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). - #[serde(skip_serializing_if = "Option::is_none")] - pub setup_future_usage: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct PaymentMethodOptionsOxxo { - /// The number of calendar days before an OXXO invoice expires. - /// - /// For example, if you create an OXXO invoice on Monday and you set expires_after_days to 2, the OXXO invoice will expire on Wednesday at 23:59 America/Mexico_City time. - pub expires_after_days: u32, - - /// Indicates that you intend to make future payments with this PaymentIntent's payment method. - /// - /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. - /// - /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). - #[serde(skip_serializing_if = "Option::is_none")] - pub setup_future_usage: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct PaymentMethodOptionsP24 { - /// Indicates that you intend to make future payments with this PaymentIntent's payment method. - /// - /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. - /// - /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). - #[serde(skip_serializing_if = "Option::is_none")] - pub setup_future_usage: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct PaymentMethodOptionsPaynow { - /// Indicates that you intend to make future payments with this PaymentIntent's payment method. - /// - /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. - /// - /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). - #[serde(skip_serializing_if = "Option::is_none")] - pub setup_future_usage: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct PaymentMethodOptionsPaypal { - /// Controls when the funds will be captured from the customer's account. - #[serde(skip_serializing_if = "Option::is_none")] - pub capture_method: Option, - - /// Preferred locale of the PayPal checkout page that the customer is redirected to. - pub preferred_locale: Option, - - /// A reference of the PayPal transaction visible to customer which is mapped to PayPal's invoice ID. - /// - /// This must be a globally unique ID if you have configured in your PayPal settings to block multiple payments per invoice ID. - pub reference: Option, - - /// Indicates that you intend to make future payments with this PaymentIntent's payment method. - /// - /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. - /// - /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). - #[serde(skip_serializing_if = "Option::is_none")] - pub setup_future_usage: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct PaymentMethodOptionsPix { - /// The number of seconds (between 10 and 1209600) after which Pix payment will expire. - pub expires_after_seconds: Option, - - /// The timestamp at which the Pix expires. - pub expires_at: Option, - - /// Indicates that you intend to make future payments with this PaymentIntent's payment method. - /// - /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. - /// - /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). - #[serde(skip_serializing_if = "Option::is_none")] - pub setup_future_usage: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct PaymentMethodOptionsPromptpay { - /// Indicates that you intend to make future payments with this PaymentIntent's payment method. - /// - /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. - /// - /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). - #[serde(skip_serializing_if = "Option::is_none")] - pub setup_future_usage: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct PaymentMethodOptionsRevolutPay {} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct PaymentMethodOptionsSofort { - /// Preferred language of the SOFORT authorization page that the customer is redirected to. - pub preferred_language: Option, - - /// Indicates that you intend to make future payments with this PaymentIntent's payment method. - /// - /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. - /// - /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). - #[serde(skip_serializing_if = "Option::is_none")] - pub setup_future_usage: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct PaymentMethodOptionsWechatPay { - /// The app ID registered with WeChat Pay. - /// - /// Only required when client is ios or android. - pub app_id: Option, - - /// The client type that the end customer will pay from. - pub client: Option, - - /// Indicates that you intend to make future payments with this PaymentIntent's payment method. - /// - /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. - /// - /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). - #[serde(skip_serializing_if = "Option::is_none")] - pub setup_future_usage: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct PaymentMethodOptionsZip { - /// Indicates that you intend to make future payments with this PaymentIntent's payment method. - /// - /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. - /// - /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). - #[serde(skip_serializing_if = "Option::is_none")] - pub setup_future_usage: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct TransferData { - /// Amount intended to be collected by this PaymentIntent. - /// - /// A positive integer representing how much to charge in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal) (e.g., 100 cents to charge $1.00 or 100 to charge ¥100, a zero-decimal currency). - /// The minimum amount is $0.50 US or [equivalent in charge currency](https://stripe.com/docs/currencies#minimum-and-maximum-charge-amounts). - /// The amount value supports up to eight digits (e.g., a value of 99999999 for a USD charge of $999,999.99). - #[serde(skip_serializing_if = "Option::is_none")] - pub amount: Option, - - /// The account (if any) that the payment is attributed to for tax - /// reporting, and where funds from the payment are transferred to after - /// payment success. - pub destination: Expandable, -} - -/// The parameters for `PaymentIntent::create`. -#[derive(Clone, Debug, Serialize)] -pub struct CreatePaymentIntent<'a> { - /// Amount intended to be collected by this PaymentIntent. - /// - /// A positive integer representing how much to charge in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal) (e.g., 100 cents to charge $1.00 or 100 to charge ¥100, a zero-decimal currency). - /// The minimum amount is $0.50 US or [equivalent in charge currency](https://stripe.com/docs/currencies#minimum-and-maximum-charge-amounts). - /// The amount value supports up to eight digits (e.g., a value of 99999999 for a USD charge of $999,999.99). - pub amount: i64, - - /// The amount of the application fee (if any) that will be requested to be applied to the payment and transferred to the application owner's Stripe account. - /// - /// The amount of the application fee collected will be capped at the total payment amount. - /// For more information, see the PaymentIntents [use case for connected accounts](https://stripe.com/docs/payments/connected-accounts). - #[serde(skip_serializing_if = "Option::is_none")] - pub application_fee_amount: Option, - - /// When you enable this parameter, this PaymentIntent accepts payment methods that you enable in the Dashboard and that are compatible with this PaymentIntent's other parameters. - #[serde(skip_serializing_if = "Option::is_none")] - pub automatic_payment_methods: Option, - - /// Controls when the funds will be captured from the customer's account. - #[serde(skip_serializing_if = "Option::is_none")] - pub capture_method: Option, - - /// Set to `true` to attempt to [confirm this PaymentIntent](https://stripe.com/docs/api/payment_intents/confirm) this PaymentIntent immediately. - /// - /// This parameter defaults to `false`. - /// When creating and confirming a PaymentIntent at the same time, you can also provide the parameters available in the [Confirm API](https://stripe.com/docs/api/payment_intents/confirm). - #[serde(skip_serializing_if = "Option::is_none")] - pub confirm: Option, - - /// Describes whether we can confirm this PaymentIntent automatically, or if it requires customer action to confirm the payment. - #[serde(skip_serializing_if = "Option::is_none")] - pub confirmation_method: Option, - - /// Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. - /// - /// Must be a [supported currency](https://stripe.com/docs/currencies). - pub currency: Currency, - - /// ID of the Customer this PaymentIntent belongs to, if one exists. - /// - /// Payment methods attached to other Customers cannot be used with this PaymentIntent. - /// - /// If present in combination with [setup_future_usage](https://stripe.com/docs/api#payment_intent_object-setup_future_usage), this PaymentIntent's payment method will be attached to the Customer after the PaymentIntent has been confirmed and any required actions from the user are complete. - #[serde(skip_serializing_if = "Option::is_none")] - pub customer: Option, - - /// An arbitrary string attached to the object. - /// - /// Often useful for displaying to users. - #[serde(skip_serializing_if = "Option::is_none")] - pub description: Option<&'a str>, - - /// Set to `true` to fail the payment attempt if the PaymentIntent transitions into `requires_action`. - /// - /// Use this parameter for simpler integrations that don't handle customer actions, such as [saving cards without authentication](https://stripe.com/docs/payments/save-card-without-authentication). - /// This parameter can only be used with [`confirm=true`](https://stripe.com/docs/api/payment_intents/create#create_payment_intent-confirm). - #[serde(skip_serializing_if = "Option::is_none")] - pub error_on_requires_action: Option, - - /// Specifies which fields in the response should be expanded. - #[serde(skip_serializing_if = "Expand::is_empty")] - pub expand: &'a [&'a str], - - /// ID of the mandate that's used for this payment. - /// - /// This parameter can only be used with [`confirm=true`](https://stripe.com/docs/api/payment_intents/create#create_payment_intent-confirm). - #[serde(skip_serializing_if = "Option::is_none")] - pub mandate: Option, - - /// This hash contains details about the Mandate to create. - /// - /// This parameter can only be used with [`confirm=true`](https://stripe.com/docs/api/payment_intents/create#create_payment_intent-confirm). - #[serde(skip_serializing_if = "Option::is_none")] - pub mandate_data: Option, - - /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. - /// - /// This can be useful for storing additional information about the object in a structured format. - /// Individual keys can be unset by posting an empty value to them. - /// All keys can be unset by posting an empty value to `metadata`. - #[serde(skip_serializing_if = "Option::is_none")] - pub metadata: Option, - - /// Set to `true` to indicate that the customer isn't in your checkout flow during this payment attempt and can't authenticate. - /// - /// Use this parameter in scenarios where you collect card details and [charge them later](https://stripe.com/docs/payments/cards/charging-saved-cards). - /// This parameter can only be used with [`confirm=true`](https://stripe.com/docs/api/payment_intents/create#create_payment_intent-confirm). - #[serde(skip_serializing_if = "Option::is_none")] - pub off_session: Option, - - /// The Stripe account ID that these funds are intended for. - /// - /// Learn more about the [use case for connected accounts](https://stripe.com/docs/payments/connected-accounts). - #[serde(skip_serializing_if = "Option::is_none")] - pub on_behalf_of: Option<&'a str>, - - /// ID of the payment method (a PaymentMethod, Card, or [compatible Source](https://stripe.com/docs/payments/payment-methods#compatibility) object) to attach to this PaymentIntent. - /// - /// If you don't provide the `payment_method` parameter or the `source` parameter with `confirm=true`, `source` automatically populates with `customer.default_source` to improve migration for users of the Charges API. - /// - /// We recommend that you explicitly provide the `payment_method` moving forward. - #[serde(skip_serializing_if = "Option::is_none")] - pub payment_method: Option, - - /// The ID of the payment method configuration to use with this PaymentIntent. - #[serde(skip_serializing_if = "Option::is_none")] - pub payment_method_configuration: Option, - - /// If provided, this hash will be used to create a PaymentMethod. - /// - /// The new PaymentMethod will appear in the [payment_method](https://stripe.com/docs/api/payment_intents/object#payment_intent_object-payment_method) property on the PaymentIntent. - #[serde(skip_serializing_if = "Option::is_none")] - pub payment_method_data: Option, - - /// Payment method-specific configuration for this PaymentIntent. - #[serde(skip_serializing_if = "Option::is_none")] - pub payment_method_options: Option, - - /// The list of payment method types (for example, a card) that this PaymentIntent can use. - /// - /// If you don't provide this, it defaults to ["card"]. - /// Use `automatic_payment_methods` to manage payment methods from the [Stripe Dashboard](https://dashboard.stripe.com/settings/payment_methods). - #[serde(skip_serializing_if = "Option::is_none")] - pub payment_method_types: Option>, - - /// Options to configure Radar. - /// - /// Learn more about [Radar Sessions](https://stripe.com/docs/radar/radar-session). - #[serde(skip_serializing_if = "Option::is_none")] - pub radar_options: Option, - - /// Email address to send the receipt to. - /// - /// If you specify `receipt_email` for a payment in live mode, you send a receipt regardless of your [email settings](https://dashboard.stripe.com/account/emails). - #[serde(skip_serializing_if = "Option::is_none")] - pub receipt_email: Option<&'a str>, - - /// The URL to redirect your customer back to after they authenticate or cancel their payment on the payment method's app or site. - /// - /// If you'd prefer to redirect to a mobile application, you can alternatively supply an application URI scheme. - /// This parameter can only be used with [`confirm=true`](https://stripe.com/docs/api/payment_intents/create#create_payment_intent-confirm). - #[serde(skip_serializing_if = "Option::is_none")] - pub return_url: Option<&'a str>, - - /// Indicates that you intend to make future payments with this PaymentIntent's payment method. - /// - /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. - /// - /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). - #[serde(skip_serializing_if = "Option::is_none")] - pub setup_future_usage: Option, - - /// Shipping information for this PaymentIntent. - #[serde(skip_serializing_if = "Option::is_none")] - pub shipping: Option, - - /// For card charges, use [statement_descriptor_suffix](https://stripe.com/docs/payments/account/statement-descriptors#dynamic). - /// - /// Otherwise, you can use this value as the complete description of a charge on your customers' statements. - /// It must contain at least one letter and be 1–22 characters long. - #[serde(skip_serializing_if = "Option::is_none")] - pub statement_descriptor: Option<&'a str>, - - /// Provides information about a card payment that customers see on their statements. - /// - /// Concatenated with the prefix (shortened descriptor) or statement descriptor that’s set on the account to form the complete statement descriptor. - /// The concatenated descriptor must contain 1-22 characters. - #[serde(skip_serializing_if = "Option::is_none")] - pub statement_descriptor_suffix: Option<&'a str>, - - /// The parameters that you can use to automatically create a Transfer. - /// Learn more about the [use case for connected accounts](https://stripe.com/docs/payments/connected-accounts). - #[serde(skip_serializing_if = "Option::is_none")] - pub transfer_data: Option, - - /// A string that identifies the resulting payment as part of a group. - /// - /// Learn more about the [use case for connected accounts](https://stripe.com/docs/connect/separate-charges-and-transfers). - #[serde(skip_serializing_if = "Option::is_none")] - pub transfer_group: Option<&'a str>, - - /// Set to `true` when confirming server-side and using Stripe.js, iOS, or Android client-side SDKs to handle the next actions. - #[serde(skip_serializing_if = "Option::is_none")] - pub use_stripe_sdk: Option, -} - -impl<'a> CreatePaymentIntent<'a> { - pub fn new(amount: i64, currency: Currency) -> Self { - CreatePaymentIntent { - amount, - application_fee_amount: Default::default(), - automatic_payment_methods: Default::default(), - capture_method: Default::default(), - confirm: Default::default(), - confirmation_method: Default::default(), - currency, - customer: Default::default(), - description: Default::default(), - error_on_requires_action: Default::default(), - expand: Default::default(), - mandate: Default::default(), - mandate_data: Default::default(), - metadata: Default::default(), - off_session: Default::default(), - on_behalf_of: Default::default(), - payment_method: Default::default(), - payment_method_configuration: Default::default(), - payment_method_data: Default::default(), - payment_method_options: Default::default(), - payment_method_types: Default::default(), - radar_options: Default::default(), - receipt_email: Default::default(), - return_url: Default::default(), - setup_future_usage: Default::default(), - shipping: Default::default(), - statement_descriptor: Default::default(), - statement_descriptor_suffix: Default::default(), - transfer_data: Default::default(), - transfer_group: Default::default(), - use_stripe_sdk: Default::default(), - } - } -} - -/// The parameters for `PaymentIntent::list`. -#[derive(Clone, Debug, Serialize, Default)] -pub struct ListPaymentIntents<'a> { - /// A filter on the list, based on the object `created` field. - /// - /// The value can be a string with an integer Unix timestamp or a dictionary with a number of different query options. - #[serde(skip_serializing_if = "Option::is_none")] - pub created: Option>, - - /// Only return PaymentIntents for the customer that this customer ID specifies. - #[serde(skip_serializing_if = "Option::is_none")] - pub customer: Option, - - /// A cursor for use in pagination. - /// - /// `ending_before` is an object ID that defines your place in the list. - /// For instance, if you make a list request and receive 100 objects, starting with `obj_bar`, your subsequent call can include `ending_before=obj_bar` in order to fetch the previous page of the list. - #[serde(skip_serializing_if = "Option::is_none")] - pub ending_before: Option, - - /// Specifies which fields in the response should be expanded. - #[serde(skip_serializing_if = "Expand::is_empty")] - pub expand: &'a [&'a str], - - /// A limit on the number of objects to be returned. - /// - /// Limit can range between 1 and 100, and the default is 10. - #[serde(skip_serializing_if = "Option::is_none")] - pub limit: Option, - - /// A cursor for use in pagination. - /// - /// `starting_after` is an object ID that defines your place in the list. - /// For instance, if you make a list request and receive 100 objects, ending with `obj_foo`, your subsequent call can include `starting_after=obj_foo` in order to fetch the next page of the list. - #[serde(skip_serializing_if = "Option::is_none")] - pub starting_after: Option, -} - -impl<'a> ListPaymentIntents<'a> { - pub fn new() -> Self { - ListPaymentIntents { - created: Default::default(), - customer: Default::default(), - ending_before: Default::default(), - expand: Default::default(), - limit: Default::default(), - starting_after: Default::default(), - } - } -} -impl Paginable for ListPaymentIntents<'_> { - type O = PaymentIntent; - fn set_last(&mut self, item: Self::O) { - self.starting_after = Some(item.id()); - } -} -/// The parameters for `PaymentIntent::update`. -#[derive(Clone, Debug, Serialize, Default)] -pub struct UpdatePaymentIntent<'a> { - /// Amount intended to be collected by this PaymentIntent. - /// - /// A positive integer representing how much to charge in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal) (e.g., 100 cents to charge $1.00 or 100 to charge ¥100, a zero-decimal currency). - /// The minimum amount is $0.50 US or [equivalent in charge currency](https://stripe.com/docs/currencies#minimum-and-maximum-charge-amounts). - /// The amount value supports up to eight digits (e.g., a value of 99999999 for a USD charge of $999,999.99). - #[serde(skip_serializing_if = "Option::is_none")] - pub amount: Option, - - /// The amount of the application fee (if any) that will be requested to be applied to the payment and transferred to the application owner's Stripe account. - /// - /// The amount of the application fee collected will be capped at the total payment amount. - /// For more information, see the PaymentIntents [use case for connected accounts](https://stripe.com/docs/payments/connected-accounts). - #[serde(skip_serializing_if = "Option::is_none")] - pub application_fee_amount: Option, - - /// Controls when the funds will be captured from the customer's account. - #[serde(skip_serializing_if = "Option::is_none")] - pub capture_method: Option, - - /// Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. - /// - /// Must be a [supported currency](https://stripe.com/docs/currencies). - #[serde(skip_serializing_if = "Option::is_none")] - pub currency: Option, - - /// ID of the Customer this PaymentIntent belongs to, if one exists. - /// - /// Payment methods attached to other Customers cannot be used with this PaymentIntent. - /// - /// If present in combination with [setup_future_usage](https://stripe.com/docs/api#payment_intent_object-setup_future_usage), this PaymentIntent's payment method will be attached to the Customer after the PaymentIntent has been confirmed and any required actions from the user are complete. - #[serde(skip_serializing_if = "Option::is_none")] - pub customer: Option, - - /// An arbitrary string attached to the object. - /// - /// Often useful for displaying to users. - #[serde(skip_serializing_if = "Option::is_none")] - pub description: Option<&'a str>, - - /// Specifies which fields in the response should be expanded. - #[serde(skip_serializing_if = "Expand::is_empty")] - pub expand: &'a [&'a str], - - /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. - /// - /// This can be useful for storing additional information about the object in a structured format. - /// Individual keys can be unset by posting an empty value to them. - /// All keys can be unset by posting an empty value to `metadata`. - #[serde(skip_serializing_if = "Option::is_none")] - pub metadata: Option, - - /// ID of the payment method (a PaymentMethod, Card, or [compatible Source](https://stripe.com/docs/payments/payment-methods/transitioning#compatibility) object) to attach to this PaymentIntent. - #[serde(skip_serializing_if = "Option::is_none")] - pub payment_method: Option, - - /// The ID of the payment method configuration to use with this PaymentIntent. - #[serde(skip_serializing_if = "Option::is_none")] - pub payment_method_configuration: Option, - - /// If provided, this hash will be used to create a PaymentMethod. - /// - /// The new PaymentMethod will appear in the [payment_method](https://stripe.com/docs/api/payment_intents/object#payment_intent_object-payment_method) property on the PaymentIntent. - #[serde(skip_serializing_if = "Option::is_none")] - pub payment_method_data: Option, - - /// Payment-method-specific configuration for this PaymentIntent. - #[serde(skip_serializing_if = "Option::is_none")] - pub payment_method_options: Option, - - /// The list of payment method types (for example, card) that this PaymentIntent can use. - /// - /// Use `automatic_payment_methods` to manage payment methods from the [Stripe Dashboard](https://dashboard.stripe.com/settings/payment_methods). - #[serde(skip_serializing_if = "Option::is_none")] - pub payment_method_types: Option>, - - /// Email address that the receipt for the resulting payment will be sent to. - /// - /// If `receipt_email` is specified for a payment in live mode, a receipt will be sent regardless of your [email settings](https://dashboard.stripe.com/account/emails). - #[serde(skip_serializing_if = "Option::is_none")] - pub receipt_email: Option, - - /// Indicates that you intend to make future payments with this PaymentIntent's payment method. - /// - /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. - /// - /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. - #[serde(skip_serializing_if = "Option::is_none")] - pub setup_future_usage: Option, - - /// Shipping information for this PaymentIntent. - #[serde(skip_serializing_if = "Option::is_none")] - pub shipping: Option, - - /// For card charges, use [statement_descriptor_suffix](https://stripe.com/docs/payments/account/statement-descriptors#dynamic). - /// - /// Otherwise, you can use this value as the complete description of a charge on your customers' statements. - /// It must contain at least one letter and be 1–22 characters long. - #[serde(skip_serializing_if = "Option::is_none")] - pub statement_descriptor: Option<&'a str>, - - /// Provides information about a card payment that customers see on their statements. - /// - /// Concatenated with the prefix (shortened descriptor) or statement descriptor that’s set on the account to form the complete statement descriptor. - /// Maximum 22 characters for the concatenated descriptor. - #[serde(skip_serializing_if = "Option::is_none")] - pub statement_descriptor_suffix: Option<&'a str>, - - /// Use this parameter to automatically create a Transfer when the payment succeeds. - /// - /// Learn more about the [use case for connected accounts](https://stripe.com/docs/payments/connected-accounts). - #[serde(skip_serializing_if = "Option::is_none")] - pub transfer_data: Option, - - /// A string that identifies the resulting payment as part of a group. - /// - /// You can only provide `transfer_group` if it hasn't been set. - /// Learn more about the [use case for connected accounts](https://stripe.com/docs/payments/connected-accounts). - #[serde(skip_serializing_if = "Option::is_none")] - pub transfer_group: Option<&'a str>, -} - -impl<'a> UpdatePaymentIntent<'a> { - pub fn new() -> Self { - UpdatePaymentIntent { - amount: Default::default(), - application_fee_amount: Default::default(), - capture_method: Default::default(), - currency: Default::default(), - customer: Default::default(), - description: Default::default(), - expand: Default::default(), - metadata: Default::default(), - payment_method: Default::default(), - payment_method_configuration: Default::default(), - payment_method_data: Default::default(), - payment_method_options: Default::default(), - payment_method_types: Default::default(), - receipt_email: Default::default(), - setup_future_usage: Default::default(), - shipping: Default::default(), - statement_descriptor: Default::default(), - statement_descriptor_suffix: Default::default(), - transfer_data: Default::default(), - transfer_group: Default::default(), - } - } -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreatePaymentIntentAutomaticPaymentMethods { - /// Controls whether this PaymentIntent will accept redirect-based payment methods. - /// - /// Redirect-based payment methods may require your customer to be redirected to a payment method's app or site for authentication or additional steps. - /// - /// To [confirm](https://stripe.com/docs/api/payment_intents/confirm) this PaymentIntent, you may be required to provide a `return_url` to redirect customers back to your site after they authenticate or complete the payment. - #[serde(skip_serializing_if = "Option::is_none")] - pub allow_redirects: Option, - - /// Whether this feature is enabled. - pub enabled: bool, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreatePaymentIntentMandateData { - /// This hash contains details about the customer acceptance of the Mandate. - pub customer_acceptance: CreatePaymentIntentMandateDataCustomerAcceptance, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreatePaymentIntentPaymentMethodData { - /// If this is an `acss_debit` PaymentMethod, this hash contains details about the ACSS Debit payment method. - #[serde(skip_serializing_if = "Option::is_none")] - pub acss_debit: Option, - - /// If this is an `affirm` PaymentMethod, this hash contains details about the Affirm payment method. - #[serde(skip_serializing_if = "Option::is_none")] - pub affirm: Option, - - /// If this is an `AfterpayClearpay` PaymentMethod, this hash contains details about the AfterpayClearpay payment method. - #[serde(skip_serializing_if = "Option::is_none")] - pub afterpay_clearpay: Option, - - /// If this is an `Alipay` PaymentMethod, this hash contains details about the Alipay payment method. - #[serde(skip_serializing_if = "Option::is_none")] - pub alipay: Option, - - /// If this is an `au_becs_debit` PaymentMethod, this hash contains details about the bank account. - #[serde(skip_serializing_if = "Option::is_none")] - pub au_becs_debit: Option, - - /// If this is a `bacs_debit` PaymentMethod, this hash contains details about the Bacs Direct Debit bank account. - #[serde(skip_serializing_if = "Option::is_none")] - pub bacs_debit: Option, - - /// If this is a `bancontact` PaymentMethod, this hash contains details about the Bancontact payment method. - #[serde(skip_serializing_if = "Option::is_none")] - pub bancontact: Option, - - /// Billing information associated with the PaymentMethod that may be used or required by particular types of payment methods. - #[serde(skip_serializing_if = "Option::is_none")] - pub billing_details: Option, - - /// If this is a `blik` PaymentMethod, this hash contains details about the BLIK payment method. - #[serde(skip_serializing_if = "Option::is_none")] - pub blik: Option, - - /// If this is a `boleto` PaymentMethod, this hash contains details about the Boleto payment method. - #[serde(skip_serializing_if = "Option::is_none")] - pub boleto: Option, - - /// If this is a `cashapp` PaymentMethod, this hash contains details about the Cash App Pay payment method. - #[serde(skip_serializing_if = "Option::is_none")] - pub cashapp: Option, - - /// If this is a `customer_balance` PaymentMethod, this hash contains details about the CustomerBalance payment method. - #[serde(skip_serializing_if = "Option::is_none")] - pub customer_balance: Option, - - /// If this is an `eps` PaymentMethod, this hash contains details about the EPS payment method. - #[serde(skip_serializing_if = "Option::is_none")] - pub eps: Option, - - /// If this is an `fpx` PaymentMethod, this hash contains details about the FPX payment method. - #[serde(skip_serializing_if = "Option::is_none")] - pub fpx: Option, - - /// If this is a `giropay` PaymentMethod, this hash contains details about the Giropay payment method. - #[serde(skip_serializing_if = "Option::is_none")] - pub giropay: Option, - - /// If this is a `grabpay` PaymentMethod, this hash contains details about the GrabPay payment method. - #[serde(skip_serializing_if = "Option::is_none")] - pub grabpay: Option, - - /// If this is an `ideal` PaymentMethod, this hash contains details about the iDEAL payment method. - #[serde(skip_serializing_if = "Option::is_none")] - pub ideal: Option, - - /// If this is an `interac_present` PaymentMethod, this hash contains details about the Interac Present payment method. - #[serde(skip_serializing_if = "Option::is_none")] - pub interac_present: Option, - - /// If this is a `klarna` PaymentMethod, this hash contains details about the Klarna payment method. - #[serde(skip_serializing_if = "Option::is_none")] - pub klarna: Option, - - /// If this is a `konbini` PaymentMethod, this hash contains details about the Konbini payment method. - #[serde(skip_serializing_if = "Option::is_none")] - pub konbini: Option, - - /// If this is an `Link` PaymentMethod, this hash contains details about the Link payment method. - #[serde(skip_serializing_if = "Option::is_none")] - pub link: Option, - - /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. - /// - /// This can be useful for storing additional information about the object in a structured format. - /// Individual keys can be unset by posting an empty value to them. - /// All keys can be unset by posting an empty value to `metadata`. - #[serde(skip_serializing_if = "Option::is_none")] - pub metadata: Option, - - /// If this is an `oxxo` PaymentMethod, this hash contains details about the OXXO payment method. - #[serde(skip_serializing_if = "Option::is_none")] - pub oxxo: Option, - - /// If this is a `p24` PaymentMethod, this hash contains details about the P24 payment method. - #[serde(skip_serializing_if = "Option::is_none")] - pub p24: Option, - - /// If this is a `paynow` PaymentMethod, this hash contains details about the PayNow payment method. - #[serde(skip_serializing_if = "Option::is_none")] - pub paynow: Option, - - /// If this is a `paypal` PaymentMethod, this hash contains details about the PayPal payment method. - #[serde(skip_serializing_if = "Option::is_none")] - pub paypal: Option, - - /// If this is a `pix` PaymentMethod, this hash contains details about the Pix payment method. - #[serde(skip_serializing_if = "Option::is_none")] - pub pix: Option, - - /// If this is a `promptpay` PaymentMethod, this hash contains details about the PromptPay payment method. - #[serde(skip_serializing_if = "Option::is_none")] - pub promptpay: Option, - - /// Options to configure Radar. - /// - /// See [Radar Session](https://stripe.com/docs/radar/radar-session) for more information. - #[serde(skip_serializing_if = "Option::is_none")] - pub radar_options: Option, - - /// If this is a `Revolut Pay` PaymentMethod, this hash contains details about the Revolut Pay payment method. - #[serde(skip_serializing_if = "Option::is_none")] - pub revolut_pay: Option, - - /// If this is a `sepa_debit` PaymentMethod, this hash contains details about the SEPA debit bank account. - #[serde(skip_serializing_if = "Option::is_none")] - pub sepa_debit: Option, - - /// If this is a `sofort` PaymentMethod, this hash contains details about the SOFORT payment method. - #[serde(skip_serializing_if = "Option::is_none")] - pub sofort: Option, - - /// If this is a `swish` PaymentMethod, this hash contains details about the Swish payment method. - #[serde(skip_serializing_if = "Option::is_none")] - pub swish: Option, - - /// The type of the PaymentMethod. - /// - /// An additional hash is included on the PaymentMethod with a name matching this value. - /// It contains additional information specific to the PaymentMethod type. - #[serde(rename = "type")] - pub type_: CreatePaymentIntentPaymentMethodDataType, - - /// If this is an `us_bank_account` PaymentMethod, this hash contains details about the US bank account payment method. - #[serde(skip_serializing_if = "Option::is_none")] - pub us_bank_account: Option, - - /// If this is an `wechat_pay` PaymentMethod, this hash contains details about the wechat_pay payment method. - #[serde(skip_serializing_if = "Option::is_none")] - pub wechat_pay: Option, - - /// If this is a `zip` PaymentMethod, this hash contains details about the Zip payment method. - #[serde(skip_serializing_if = "Option::is_none")] - pub zip: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreatePaymentIntentPaymentMethodOptions { - /// If this is a `acss_debit` PaymentMethod, this sub-hash contains details about the ACSS Debit payment method options. - #[serde(skip_serializing_if = "Option::is_none")] - pub acss_debit: Option, - - /// If this is an `affirm` PaymentMethod, this sub-hash contains details about the Affirm payment method options. - #[serde(skip_serializing_if = "Option::is_none")] - pub affirm: Option, - - /// If this is a `afterpay_clearpay` PaymentMethod, this sub-hash contains details about the Afterpay Clearpay payment method options. - #[serde(skip_serializing_if = "Option::is_none")] - pub afterpay_clearpay: Option, - - /// If this is a `alipay` PaymentMethod, this sub-hash contains details about the Alipay payment method options. - #[serde(skip_serializing_if = "Option::is_none")] - pub alipay: Option, - - /// If this is a `au_becs_debit` PaymentMethod, this sub-hash contains details about the AU BECS Direct Debit payment method options. - #[serde(skip_serializing_if = "Option::is_none")] - pub au_becs_debit: Option, - - /// If this is a `bacs_debit` PaymentMethod, this sub-hash contains details about the BACS Debit payment method options. - #[serde(skip_serializing_if = "Option::is_none")] - pub bacs_debit: Option, - - /// If this is a `bancontact` PaymentMethod, this sub-hash contains details about the Bancontact payment method options. - #[serde(skip_serializing_if = "Option::is_none")] - pub bancontact: Option, - - /// If this is a `blik` PaymentMethod, this sub-hash contains details about the BLIK payment method options. - #[serde(skip_serializing_if = "Option::is_none")] - pub blik: Option, - - /// If this is a `boleto` PaymentMethod, this sub-hash contains details about the Boleto payment method options. - #[serde(skip_serializing_if = "Option::is_none")] - pub boleto: Option, - - /// Configuration for any card payments attempted on this PaymentIntent. - #[serde(skip_serializing_if = "Option::is_none")] - pub card: Option, - - /// If this is a `card_present` PaymentMethod, this sub-hash contains details about the Card Present payment method options. - #[serde(skip_serializing_if = "Option::is_none")] - pub card_present: Option, - - /// If this is a `cashapp` PaymentMethod, this sub-hash contains details about the Cash App Pay payment method options. - #[serde(skip_serializing_if = "Option::is_none")] - pub cashapp: Option, - - /// If this is a `customer balance` PaymentMethod, this sub-hash contains details about the customer balance payment method options. - #[serde(skip_serializing_if = "Option::is_none")] - pub customer_balance: Option, - - /// If this is a `eps` PaymentMethod, this sub-hash contains details about the EPS payment method options. - #[serde(skip_serializing_if = "Option::is_none")] - pub eps: Option, - - /// If this is a `fpx` PaymentMethod, this sub-hash contains details about the FPX payment method options. - #[serde(skip_serializing_if = "Option::is_none")] - pub fpx: Option, - - /// If this is a `giropay` PaymentMethod, this sub-hash contains details about the Giropay payment method options. - #[serde(skip_serializing_if = "Option::is_none")] - pub giropay: Option, - - /// If this is a `grabpay` PaymentMethod, this sub-hash contains details about the Grabpay payment method options. - #[serde(skip_serializing_if = "Option::is_none")] - pub grabpay: Option, - - /// If this is a `ideal` PaymentMethod, this sub-hash contains details about the Ideal payment method options. - #[serde(skip_serializing_if = "Option::is_none")] - pub ideal: Option, - - /// If this is a `interac_present` PaymentMethod, this sub-hash contains details about the Card Present payment method options. - #[serde(skip_serializing_if = "Option::is_none")] - pub interac_present: Option, - - /// If this is a `klarna` PaymentMethod, this sub-hash contains details about the Klarna payment method options. - #[serde(skip_serializing_if = "Option::is_none")] - pub klarna: Option, - - /// If this is a `konbini` PaymentMethod, this sub-hash contains details about the Konbini payment method options. - #[serde(skip_serializing_if = "Option::is_none")] - pub konbini: Option, - - /// If this is a `link` PaymentMethod, this sub-hash contains details about the Link payment method options. - #[serde(skip_serializing_if = "Option::is_none")] - pub link: Option, - - /// If this is a `oxxo` PaymentMethod, this sub-hash contains details about the OXXO payment method options. - #[serde(skip_serializing_if = "Option::is_none")] - pub oxxo: Option, - - /// If this is a `p24` PaymentMethod, this sub-hash contains details about the Przelewy24 payment method options. - #[serde(skip_serializing_if = "Option::is_none")] - pub p24: Option, - - /// If this is a `paynow` PaymentMethod, this sub-hash contains details about the PayNow payment method options. - #[serde(skip_serializing_if = "Option::is_none")] - pub paynow: Option, - - /// If this is a `paypal` PaymentMethod, this sub-hash contains details about the PayPal payment method options. - #[serde(skip_serializing_if = "Option::is_none")] - pub paypal: Option, - - /// If this is a `pix` PaymentMethod, this sub-hash contains details about the Pix payment method options. - #[serde(skip_serializing_if = "Option::is_none")] - pub pix: Option, - - /// If this is a `promptpay` PaymentMethod, this sub-hash contains details about the PromptPay payment method options. - #[serde(skip_serializing_if = "Option::is_none")] - pub promptpay: Option, - - /// If this is a `revolut_pay` PaymentMethod, this sub-hash contains details about the Revolut Pay payment method options. - #[serde(skip_serializing_if = "Option::is_none")] - pub revolut_pay: Option, - - /// If this is a `sepa_debit` PaymentIntent, this sub-hash contains details about the SEPA Debit payment method options. - #[serde(skip_serializing_if = "Option::is_none")] - pub sepa_debit: Option, - - /// If this is a `sofort` PaymentMethod, this sub-hash contains details about the SOFORT payment method options. - #[serde(skip_serializing_if = "Option::is_none")] - pub sofort: Option, - - /// If this is a `Swish` PaymentMethod, this sub-hash contains details about the Swish payment method options. - #[serde(skip_serializing_if = "Option::is_none")] - pub swish: Option, - - /// If this is a `us_bank_account` PaymentMethod, this sub-hash contains details about the US bank account payment method options. - #[serde(skip_serializing_if = "Option::is_none")] - pub us_bank_account: Option, - - /// If this is a `wechat_pay` PaymentMethod, this sub-hash contains details about the WeChat Pay payment method options. - #[serde(skip_serializing_if = "Option::is_none")] - pub wechat_pay: Option, - - /// If this is a `zip` PaymentMethod, this sub-hash contains details about the Zip payment method options. - #[serde(skip_serializing_if = "Option::is_none")] - pub zip: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreatePaymentIntentRadarOptions { - /// A [Radar Session](https://stripe.com/docs/radar/radar-session) is a snapshot of the browser metadata and device details that help Radar make more accurate predictions on your payments. - #[serde(skip_serializing_if = "Option::is_none")] - pub session: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreatePaymentIntentShipping { - /// Shipping address. - pub address: CreatePaymentIntentShippingAddress, - - /// The delivery service that shipped a physical product, such as Fedex, UPS, USPS, etc. - #[serde(skip_serializing_if = "Option::is_none")] - pub carrier: Option, - - /// Recipient name. - pub name: String, - - /// Recipient phone (including extension). - #[serde(skip_serializing_if = "Option::is_none")] - pub phone: Option, - - /// The tracking number for a physical product, obtained from the delivery service. - /// - /// If multiple tracking numbers were generated for this purchase, please separate them with commas. - #[serde(skip_serializing_if = "Option::is_none")] - pub tracking_number: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreatePaymentIntentTransferData { - /// The amount that will be transferred automatically when a charge succeeds. - /// The amount is capped at the total transaction amount and if no amount is set, - /// the full amount is transferred. - /// - /// If you intend to collect a fee and you need a more robust reporting experience, using - /// [application_fee_amount](https://stripe.com/docs/api/payment_intents/create#create_payment_intent-application_fee_amount) - /// might be a better fit for your integration. - #[serde(skip_serializing_if = "Option::is_none")] - pub amount: Option, - - /// If specified, successful charges will be attributed to the destination - /// account for tax reporting, and the funds from charges will be transferred - /// to the destination account. - /// - /// The ID of the resulting transfer will be returned on the successful charge's `transfer` field. - pub destination: String, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UpdatePaymentIntentPaymentMethodData { - /// If this is an `acss_debit` PaymentMethod, this hash contains details about the ACSS Debit payment method. - #[serde(skip_serializing_if = "Option::is_none")] - pub acss_debit: Option, - - /// If this is an `affirm` PaymentMethod, this hash contains details about the Affirm payment method. - #[serde(skip_serializing_if = "Option::is_none")] - pub affirm: Option, - - /// If this is an `AfterpayClearpay` PaymentMethod, this hash contains details about the AfterpayClearpay payment method. - #[serde(skip_serializing_if = "Option::is_none")] - pub afterpay_clearpay: Option, - - /// If this is an `Alipay` PaymentMethod, this hash contains details about the Alipay payment method. - #[serde(skip_serializing_if = "Option::is_none")] - pub alipay: Option, - - /// If this is an `au_becs_debit` PaymentMethod, this hash contains details about the bank account. - #[serde(skip_serializing_if = "Option::is_none")] - pub au_becs_debit: Option, - - /// If this is a `bacs_debit` PaymentMethod, this hash contains details about the Bacs Direct Debit bank account. - #[serde(skip_serializing_if = "Option::is_none")] - pub bacs_debit: Option, - - /// If this is a `bancontact` PaymentMethod, this hash contains details about the Bancontact payment method. - #[serde(skip_serializing_if = "Option::is_none")] - pub bancontact: Option, - - /// Billing information associated with the PaymentMethod that may be used or required by particular types of payment methods. - #[serde(skip_serializing_if = "Option::is_none")] - pub billing_details: Option, - - /// If this is a `blik` PaymentMethod, this hash contains details about the BLIK payment method. - #[serde(skip_serializing_if = "Option::is_none")] - pub blik: Option, - - /// If this is a `boleto` PaymentMethod, this hash contains details about the Boleto payment method. - #[serde(skip_serializing_if = "Option::is_none")] - pub boleto: Option, - - /// If this is a `cashapp` PaymentMethod, this hash contains details about the Cash App Pay payment method. - #[serde(skip_serializing_if = "Option::is_none")] - pub cashapp: Option, - - /// If this is a `customer_balance` PaymentMethod, this hash contains details about the CustomerBalance payment method. - #[serde(skip_serializing_if = "Option::is_none")] - pub customer_balance: Option, - - /// If this is an `eps` PaymentMethod, this hash contains details about the EPS payment method. - #[serde(skip_serializing_if = "Option::is_none")] - pub eps: Option, - - /// If this is an `fpx` PaymentMethod, this hash contains details about the FPX payment method. - #[serde(skip_serializing_if = "Option::is_none")] - pub fpx: Option, - - /// If this is a `giropay` PaymentMethod, this hash contains details about the Giropay payment method. - #[serde(skip_serializing_if = "Option::is_none")] - pub giropay: Option, - - /// If this is a `grabpay` PaymentMethod, this hash contains details about the GrabPay payment method. - #[serde(skip_serializing_if = "Option::is_none")] - pub grabpay: Option, - - /// If this is an `ideal` PaymentMethod, this hash contains details about the iDEAL payment method. - #[serde(skip_serializing_if = "Option::is_none")] - pub ideal: Option, - - /// If this is an `interac_present` PaymentMethod, this hash contains details about the Interac Present payment method. - #[serde(skip_serializing_if = "Option::is_none")] - pub interac_present: Option, - - /// If this is a `klarna` PaymentMethod, this hash contains details about the Klarna payment method. - #[serde(skip_serializing_if = "Option::is_none")] - pub klarna: Option, - - /// If this is a `konbini` PaymentMethod, this hash contains details about the Konbini payment method. - #[serde(skip_serializing_if = "Option::is_none")] - pub konbini: Option, - - /// If this is an `Link` PaymentMethod, this hash contains details about the Link payment method. - #[serde(skip_serializing_if = "Option::is_none")] - pub link: Option, - - /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. - /// - /// This can be useful for storing additional information about the object in a structured format. - /// Individual keys can be unset by posting an empty value to them. - /// All keys can be unset by posting an empty value to `metadata`. - #[serde(skip_serializing_if = "Option::is_none")] - pub metadata: Option, - - /// If this is an `oxxo` PaymentMethod, this hash contains details about the OXXO payment method. - #[serde(skip_serializing_if = "Option::is_none")] - pub oxxo: Option, - - /// If this is a `p24` PaymentMethod, this hash contains details about the P24 payment method. - #[serde(skip_serializing_if = "Option::is_none")] - pub p24: Option, - - /// If this is a `paynow` PaymentMethod, this hash contains details about the PayNow payment method. - #[serde(skip_serializing_if = "Option::is_none")] - pub paynow: Option, - - /// If this is a `paypal` PaymentMethod, this hash contains details about the PayPal payment method. - #[serde(skip_serializing_if = "Option::is_none")] - pub paypal: Option, - - /// If this is a `pix` PaymentMethod, this hash contains details about the Pix payment method. - #[serde(skip_serializing_if = "Option::is_none")] - pub pix: Option, - - /// If this is a `promptpay` PaymentMethod, this hash contains details about the PromptPay payment method. - #[serde(skip_serializing_if = "Option::is_none")] - pub promptpay: Option, - - /// Options to configure Radar. - /// - /// See [Radar Session](https://stripe.com/docs/radar/radar-session) for more information. - #[serde(skip_serializing_if = "Option::is_none")] - pub radar_options: Option, - - /// If this is a `Revolut Pay` PaymentMethod, this hash contains details about the Revolut Pay payment method. - #[serde(skip_serializing_if = "Option::is_none")] - pub revolut_pay: Option, - - /// If this is a `sepa_debit` PaymentMethod, this hash contains details about the SEPA debit bank account. - #[serde(skip_serializing_if = "Option::is_none")] - pub sepa_debit: Option, - - /// If this is a `sofort` PaymentMethod, this hash contains details about the SOFORT payment method. - #[serde(skip_serializing_if = "Option::is_none")] - pub sofort: Option, - - /// If this is a `swish` PaymentMethod, this hash contains details about the Swish payment method. - #[serde(skip_serializing_if = "Option::is_none")] - pub swish: Option, - - /// The type of the PaymentMethod. - /// - /// An additional hash is included on the PaymentMethod with a name matching this value. - /// It contains additional information specific to the PaymentMethod type. - #[serde(rename = "type")] - pub type_: UpdatePaymentIntentPaymentMethodDataType, - - /// If this is an `us_bank_account` PaymentMethod, this hash contains details about the US bank account payment method. - #[serde(skip_serializing_if = "Option::is_none")] - pub us_bank_account: Option, - - /// If this is an `wechat_pay` PaymentMethod, this hash contains details about the wechat_pay payment method. - #[serde(skip_serializing_if = "Option::is_none")] - pub wechat_pay: Option, - - /// If this is a `zip` PaymentMethod, this hash contains details about the Zip payment method. - #[serde(skip_serializing_if = "Option::is_none")] - pub zip: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UpdatePaymentIntentPaymentMethodOptions { - /// If this is a `acss_debit` PaymentMethod, this sub-hash contains details about the ACSS Debit payment method options. - #[serde(skip_serializing_if = "Option::is_none")] - pub acss_debit: Option, - - /// If this is an `affirm` PaymentMethod, this sub-hash contains details about the Affirm payment method options. - #[serde(skip_serializing_if = "Option::is_none")] - pub affirm: Option, - - /// If this is a `afterpay_clearpay` PaymentMethod, this sub-hash contains details about the Afterpay Clearpay payment method options. - #[serde(skip_serializing_if = "Option::is_none")] - pub afterpay_clearpay: Option, - - /// If this is a `alipay` PaymentMethod, this sub-hash contains details about the Alipay payment method options. - #[serde(skip_serializing_if = "Option::is_none")] - pub alipay: Option, - - /// If this is a `au_becs_debit` PaymentMethod, this sub-hash contains details about the AU BECS Direct Debit payment method options. - #[serde(skip_serializing_if = "Option::is_none")] - pub au_becs_debit: Option, - - /// If this is a `bacs_debit` PaymentMethod, this sub-hash contains details about the BACS Debit payment method options. - #[serde(skip_serializing_if = "Option::is_none")] - pub bacs_debit: Option, - - /// If this is a `bancontact` PaymentMethod, this sub-hash contains details about the Bancontact payment method options. - #[serde(skip_serializing_if = "Option::is_none")] - pub bancontact: Option, - - /// If this is a `blik` PaymentMethod, this sub-hash contains details about the BLIK payment method options. - #[serde(skip_serializing_if = "Option::is_none")] - pub blik: Option, - - /// If this is a `boleto` PaymentMethod, this sub-hash contains details about the Boleto payment method options. - #[serde(skip_serializing_if = "Option::is_none")] - pub boleto: Option, - - /// Configuration for any card payments attempted on this PaymentIntent. - #[serde(skip_serializing_if = "Option::is_none")] - pub card: Option, - - /// If this is a `card_present` PaymentMethod, this sub-hash contains details about the Card Present payment method options. - #[serde(skip_serializing_if = "Option::is_none")] - pub card_present: Option, - - /// If this is a `cashapp` PaymentMethod, this sub-hash contains details about the Cash App Pay payment method options. - #[serde(skip_serializing_if = "Option::is_none")] - pub cashapp: Option, - - /// If this is a `customer balance` PaymentMethod, this sub-hash contains details about the customer balance payment method options. - #[serde(skip_serializing_if = "Option::is_none")] - pub customer_balance: Option, - - /// If this is a `eps` PaymentMethod, this sub-hash contains details about the EPS payment method options. - #[serde(skip_serializing_if = "Option::is_none")] - pub eps: Option, - - /// If this is a `fpx` PaymentMethod, this sub-hash contains details about the FPX payment method options. - #[serde(skip_serializing_if = "Option::is_none")] - pub fpx: Option, - - /// If this is a `giropay` PaymentMethod, this sub-hash contains details about the Giropay payment method options. - #[serde(skip_serializing_if = "Option::is_none")] - pub giropay: Option, - - /// If this is a `grabpay` PaymentMethod, this sub-hash contains details about the Grabpay payment method options. - #[serde(skip_serializing_if = "Option::is_none")] - pub grabpay: Option, - - /// If this is a `ideal` PaymentMethod, this sub-hash contains details about the Ideal payment method options. - #[serde(skip_serializing_if = "Option::is_none")] - pub ideal: Option, - - /// If this is a `interac_present` PaymentMethod, this sub-hash contains details about the Card Present payment method options. - #[serde(skip_serializing_if = "Option::is_none")] - pub interac_present: Option, - - /// If this is a `klarna` PaymentMethod, this sub-hash contains details about the Klarna payment method options. - #[serde(skip_serializing_if = "Option::is_none")] - pub klarna: Option, - - /// If this is a `konbini` PaymentMethod, this sub-hash contains details about the Konbini payment method options. - #[serde(skip_serializing_if = "Option::is_none")] - pub konbini: Option, - - /// If this is a `link` PaymentMethod, this sub-hash contains details about the Link payment method options. - #[serde(skip_serializing_if = "Option::is_none")] - pub link: Option, - - /// If this is a `oxxo` PaymentMethod, this sub-hash contains details about the OXXO payment method options. - #[serde(skip_serializing_if = "Option::is_none")] - pub oxxo: Option, - - /// If this is a `p24` PaymentMethod, this sub-hash contains details about the Przelewy24 payment method options. - #[serde(skip_serializing_if = "Option::is_none")] - pub p24: Option, - - /// If this is a `paynow` PaymentMethod, this sub-hash contains details about the PayNow payment method options. - #[serde(skip_serializing_if = "Option::is_none")] - pub paynow: Option, - - /// If this is a `paypal` PaymentMethod, this sub-hash contains details about the PayPal payment method options. - #[serde(skip_serializing_if = "Option::is_none")] - pub paypal: Option, - - /// If this is a `pix` PaymentMethod, this sub-hash contains details about the Pix payment method options. - #[serde(skip_serializing_if = "Option::is_none")] - pub pix: Option, - - /// If this is a `promptpay` PaymentMethod, this sub-hash contains details about the PromptPay payment method options. - #[serde(skip_serializing_if = "Option::is_none")] - pub promptpay: Option, - - /// If this is a `revolut_pay` PaymentMethod, this sub-hash contains details about the Revolut Pay payment method options. - #[serde(skip_serializing_if = "Option::is_none")] - pub revolut_pay: Option, - - /// If this is a `sepa_debit` PaymentIntent, this sub-hash contains details about the SEPA Debit payment method options. - #[serde(skip_serializing_if = "Option::is_none")] - pub sepa_debit: Option, - - /// If this is a `sofort` PaymentMethod, this sub-hash contains details about the SOFORT payment method options. - #[serde(skip_serializing_if = "Option::is_none")] - pub sofort: Option, - - /// If this is a `Swish` PaymentMethod, this sub-hash contains details about the Swish payment method options. - #[serde(skip_serializing_if = "Option::is_none")] - pub swish: Option, - - /// If this is a `us_bank_account` PaymentMethod, this sub-hash contains details about the US bank account payment method options. - #[serde(skip_serializing_if = "Option::is_none")] - pub us_bank_account: Option, - - /// If this is a `wechat_pay` PaymentMethod, this sub-hash contains details about the WeChat Pay payment method options. - #[serde(skip_serializing_if = "Option::is_none")] - pub wechat_pay: Option, - - /// If this is a `zip` PaymentMethod, this sub-hash contains details about the Zip payment method options. - #[serde(skip_serializing_if = "Option::is_none")] - pub zip: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UpdatePaymentIntentShipping { - /// Shipping address. - pub address: UpdatePaymentIntentShippingAddress, - - /// The delivery service that shipped a physical product, such as Fedex, UPS, USPS, etc. - #[serde(skip_serializing_if = "Option::is_none")] - pub carrier: Option, - - /// Recipient name. - pub name: String, - - /// Recipient phone (including extension). - #[serde(skip_serializing_if = "Option::is_none")] - pub phone: Option, - - /// The tracking number for a physical product, obtained from the delivery service. - /// - /// If multiple tracking numbers were generated for this purchase, please separate them with commas. - #[serde(skip_serializing_if = "Option::is_none")] - pub tracking_number: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UpdatePaymentIntentTransferData { - /// The amount that will be transferred automatically when a charge succeeds. - #[serde(skip_serializing_if = "Option::is_none")] - pub amount: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreatePaymentIntentMandateDataCustomerAcceptance { - /// The time at which the customer accepted the Mandate. - #[serde(skip_serializing_if = "Option::is_none")] - pub accepted_at: Option, - - /// If this is a Mandate accepted offline, this hash contains details about the offline acceptance. - #[serde(skip_serializing_if = "Option::is_none")] - pub offline: Option, - - /// If this is a Mandate accepted online, this hash contains details about the online acceptance. - #[serde(skip_serializing_if = "Option::is_none")] - pub online: Option, - - /// The type of customer acceptance information included with the Mandate. - /// - /// One of `online` or `offline`. - #[serde(rename = "type")] - pub type_: CreatePaymentIntentMandateDataCustomerAcceptanceType, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreatePaymentIntentPaymentMethodDataAcssDebit { - /// Customer's bank account number. - pub account_number: String, - - /// Institution number of the customer's bank. - pub institution_number: String, - - /// Transit number of the customer's bank. - pub transit_number: String, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreatePaymentIntentPaymentMethodDataAffirm {} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreatePaymentIntentPaymentMethodDataAfterpayClearpay {} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreatePaymentIntentPaymentMethodDataAlipay {} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreatePaymentIntentPaymentMethodDataAuBecsDebit { - /// The account number for the bank account. - pub account_number: String, - - /// Bank-State-Branch number of the bank account. - pub bsb_number: String, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreatePaymentIntentPaymentMethodDataBacsDebit { - /// Account number of the bank account that the funds will be debited from. - #[serde(skip_serializing_if = "Option::is_none")] - pub account_number: Option, - - /// Sort code of the bank account. - /// - /// (e.g., `10-20-30`). - #[serde(skip_serializing_if = "Option::is_none")] - pub sort_code: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreatePaymentIntentPaymentMethodDataBancontact {} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreatePaymentIntentPaymentMethodDataBillingDetails { - /// Billing address. - #[serde(skip_serializing_if = "Option::is_none")] - pub address: Option, - - /// Email address. - #[serde(skip_serializing_if = "Option::is_none")] - pub email: Option, - - /// Full name. - #[serde(skip_serializing_if = "Option::is_none")] - pub name: Option, - - /// Billing phone number (including extension). - #[serde(skip_serializing_if = "Option::is_none")] - pub phone: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreatePaymentIntentPaymentMethodDataBlik {} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreatePaymentIntentPaymentMethodDataBoleto { - /// The tax ID of the customer (CPF for individual consumers or CNPJ for businesses consumers). - pub tax_id: String, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreatePaymentIntentPaymentMethodDataCashapp {} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreatePaymentIntentPaymentMethodDataCustomerBalance {} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreatePaymentIntentPaymentMethodDataEps { - /// The customer's bank. - #[serde(skip_serializing_if = "Option::is_none")] - pub bank: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreatePaymentIntentPaymentMethodDataFpx { - /// Account holder type for FPX transaction. - #[serde(skip_serializing_if = "Option::is_none")] - pub account_holder_type: Option, - - /// The customer's bank. - pub bank: CreatePaymentIntentPaymentMethodDataFpxBank, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreatePaymentIntentPaymentMethodDataGiropay {} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreatePaymentIntentPaymentMethodDataGrabpay {} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreatePaymentIntentPaymentMethodDataIdeal { - /// The customer's bank. - #[serde(skip_serializing_if = "Option::is_none")] - pub bank: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreatePaymentIntentPaymentMethodDataInteracPresent {} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreatePaymentIntentPaymentMethodDataKlarna { - /// Customer's date of birth. - #[serde(skip_serializing_if = "Option::is_none")] - pub dob: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreatePaymentIntentPaymentMethodDataKonbini {} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreatePaymentIntentPaymentMethodDataLink {} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreatePaymentIntentPaymentMethodDataOxxo {} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreatePaymentIntentPaymentMethodDataP24 { - /// The customer's bank. - #[serde(skip_serializing_if = "Option::is_none")] - pub bank: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreatePaymentIntentPaymentMethodDataPaynow {} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreatePaymentIntentPaymentMethodDataPaypal {} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreatePaymentIntentPaymentMethodDataPix {} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreatePaymentIntentPaymentMethodDataPromptpay {} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreatePaymentIntentPaymentMethodDataRadarOptions { - /// A [Radar Session](https://stripe.com/docs/radar/radar-session) is a snapshot of the browser metadata and device details that help Radar make more accurate predictions on your payments. - #[serde(skip_serializing_if = "Option::is_none")] - pub session: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreatePaymentIntentPaymentMethodDataRevolutPay {} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreatePaymentIntentPaymentMethodDataSepaDebit { - /// IBAN of the bank account. - pub iban: String, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreatePaymentIntentPaymentMethodDataSofort { - /// Two-letter ISO code representing the country the bank account is located in. - pub country: CreatePaymentIntentPaymentMethodDataSofortCountry, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreatePaymentIntentPaymentMethodDataSwish {} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreatePaymentIntentPaymentMethodDataUsBankAccount { - /// Account holder type: individual or company. - #[serde(skip_serializing_if = "Option::is_none")] - pub account_holder_type: - Option, - - /// Account number of the bank account. - #[serde(skip_serializing_if = "Option::is_none")] - pub account_number: Option, - - /// Account type: checkings or savings. - /// - /// Defaults to checking if omitted. - #[serde(skip_serializing_if = "Option::is_none")] - pub account_type: Option, - - /// The ID of a Financial Connections Account to use as a payment method. - #[serde(skip_serializing_if = "Option::is_none")] - pub financial_connections_account: Option, - - /// Routing number of the bank account. - #[serde(skip_serializing_if = "Option::is_none")] - pub routing_number: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreatePaymentIntentPaymentMethodDataWechatPay {} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreatePaymentIntentPaymentMethodDataZip {} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreatePaymentIntentPaymentMethodOptionsAcssDebit { - /// Additional fields for Mandate creation. - #[serde(skip_serializing_if = "Option::is_none")] - pub mandate_options: Option, - - /// Indicates that you intend to make future payments with this PaymentIntent's payment method. - /// - /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. - /// - /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. - #[serde(skip_serializing_if = "Option::is_none")] - pub setup_future_usage: - Option, - - /// Bank account verification method. - #[serde(skip_serializing_if = "Option::is_none")] - pub verification_method: - Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreatePaymentIntentPaymentMethodOptionsAffirm { - /// Controls when the funds will be captured from the customer's account. - /// - /// If provided, this parameter will override the top-level `capture_method` when finalizing the payment with this payment method type. - /// - /// If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter will unset the stored value for this payment method type. - #[serde(skip_serializing_if = "Option::is_none")] - pub capture_method: Option, - - /// Preferred language of the Affirm authorization page that the customer is redirected to. - #[serde(skip_serializing_if = "Option::is_none")] - pub preferred_locale: Option, - - /// Indicates that you intend to make future payments with this PaymentIntent's payment method. - /// - /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. - /// - /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. - #[serde(skip_serializing_if = "Option::is_none")] - pub setup_future_usage: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreatePaymentIntentPaymentMethodOptionsAfterpayClearpay { - /// Controls when the funds will be captured from the customer's account. - /// - /// If provided, this parameter will override the top-level `capture_method` when finalizing the payment with this payment method type. - /// - /// If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter will unset the stored value for this payment method type. - #[serde(skip_serializing_if = "Option::is_none")] - pub capture_method: - Option, - - /// An internal identifier or reference that this payment corresponds to. - /// - /// You must limit the identifier to 128 characters, and it can only contain letters, numbers, underscores, backslashes, and dashes. This field differs from the statement descriptor and item name. - #[serde(skip_serializing_if = "Option::is_none")] - pub reference: Option, - - /// Indicates that you intend to make future payments with this PaymentIntent's payment method. - /// - /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. - /// - /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. - #[serde(skip_serializing_if = "Option::is_none")] - pub setup_future_usage: - Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreatePaymentIntentPaymentMethodOptionsAlipay { - /// Indicates that you intend to make future payments with this PaymentIntent's payment method. - /// - /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. - /// - /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. - #[serde(skip_serializing_if = "Option::is_none")] - pub setup_future_usage: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreatePaymentIntentPaymentMethodOptionsAuBecsDebit { - /// Indicates that you intend to make future payments with this PaymentIntent's payment method. - /// - /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. - /// - /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. - #[serde(skip_serializing_if = "Option::is_none")] - pub setup_future_usage: - Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreatePaymentIntentPaymentMethodOptionsBacsDebit { - /// Indicates that you intend to make future payments with this PaymentIntent's payment method. - /// - /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. - /// - /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. - #[serde(skip_serializing_if = "Option::is_none")] - pub setup_future_usage: - Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreatePaymentIntentPaymentMethodOptionsBancontact { - /// Preferred language of the Bancontact authorization page that the customer is redirected to. - #[serde(skip_serializing_if = "Option::is_none")] - pub preferred_language: - Option, - - /// Indicates that you intend to make future payments with this PaymentIntent's payment method. - /// - /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. - /// - /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. - #[serde(skip_serializing_if = "Option::is_none")] - pub setup_future_usage: - Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreatePaymentIntentPaymentMethodOptionsBlik { - /// The 6-digit BLIK code that a customer has generated using their banking application. - /// - /// Can only be set on confirmation. - #[serde(skip_serializing_if = "Option::is_none")] - pub code: Option, - - /// Indicates that you intend to make future payments with this PaymentIntent's payment method. - /// - /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. - /// - /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. - #[serde(skip_serializing_if = "Option::is_none")] - pub setup_future_usage: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreatePaymentIntentPaymentMethodOptionsBoleto { - /// The number of calendar days before a Boleto voucher expires. - /// - /// For example, if you create a Boleto voucher on Monday and you set expires_after_days to 2, the Boleto invoice will expire on Wednesday at 23:59 America/Sao_Paulo time. - #[serde(skip_serializing_if = "Option::is_none")] - pub expires_after_days: Option, - - /// Indicates that you intend to make future payments with this PaymentIntent's payment method. - /// - /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. - /// - /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. - #[serde(skip_serializing_if = "Option::is_none")] - pub setup_future_usage: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreatePaymentIntentPaymentMethodOptionsCard { - /// Controls when the funds will be captured from the customer's account. - /// - /// If provided, this parameter will override the top-level `capture_method` when finalizing the payment with this payment method type. - /// - /// If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter will unset the stored value for this payment method type. - #[serde(skip_serializing_if = "Option::is_none")] - pub capture_method: Option, - - /// A single-use `cvc_update` Token that represents a card CVC value. - /// - /// When provided, the CVC value will be verified during the card payment attempt. - /// This parameter can only be provided during confirmation. - #[serde(skip_serializing_if = "Option::is_none")] - pub cvc_token: Option, - - /// Installment configuration for payments attempted on this PaymentIntent (Mexico Only). - /// - /// For more information, see the [installments integration guide](https://stripe.com/docs/payments/installments). - #[serde(skip_serializing_if = "Option::is_none")] - pub installments: Option, - - /// Configuration options for setting up an eMandate for cards issued in India. - #[serde(skip_serializing_if = "Option::is_none")] - pub mandate_options: Option, - - /// When specified, this parameter indicates that a transaction will be marked - /// as MOTO (Mail Order Telephone Order) and thus out of scope for SCA. - /// - /// This parameter can only be provided during confirmation. - #[serde(skip_serializing_if = "Option::is_none")] - pub moto: Option, - - /// Selected network to process this PaymentIntent on. - /// - /// Depends on the available networks of the card attached to the PaymentIntent. - /// Can be only set confirm-time. - #[serde(skip_serializing_if = "Option::is_none")] - pub network: Option, - - /// Request ability to [capture beyond the standard authorization validity window](https://stripe.com/docs/payments/extended-authorization) for this PaymentIntent. - #[serde(skip_serializing_if = "Option::is_none")] - pub request_extended_authorization: - Option, - - /// Request ability to [increment the authorization](https://stripe.com/docs/payments/incremental-authorization) for this PaymentIntent. - #[serde(skip_serializing_if = "Option::is_none")] - pub request_incremental_authorization: - Option, - - /// Request ability to make [multiple captures](https://stripe.com/docs/payments/multicapture) for this PaymentIntent. - #[serde(skip_serializing_if = "Option::is_none")] - pub request_multicapture: - Option, - - /// Request ability to [overcapture](https://stripe.com/docs/payments/overcapture) for this PaymentIntent. - #[serde(skip_serializing_if = "Option::is_none")] - pub request_overcapture: Option, - - /// We strongly recommend that you rely on our SCA Engine to automatically prompt your customers for authentication based on risk level and [other requirements](https://stripe.com/docs/strong-customer-authentication). - /// - /// However, if you wish to request 3D Secure based on logic from your own fraud engine, provide this option. - /// If not provided, this value defaults to `automatic`. - /// Read our guide on [manually requesting 3D Secure](https://stripe.com/docs/payments/3d-secure#manual-three-ds) for more information on how this configuration interacts with Radar and our SCA Engine. - #[serde(skip_serializing_if = "Option::is_none")] - pub request_three_d_secure: - Option, - - /// When enabled, using a card that is attached to a customer will require the CVC to be provided again (i.e. - /// - /// using the cvc_token parameter). - #[serde(skip_serializing_if = "Option::is_none")] - pub require_cvc_recollection: Option, - - /// Indicates that you intend to make future payments with this PaymentIntent's payment method. - /// - /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. - /// - /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. - #[serde(skip_serializing_if = "Option::is_none")] - pub setup_future_usage: Option, - - /// Provides information about a card payment that customers see on their statements. - /// - /// Concatenated with the Kana prefix (shortened Kana descriptor) or Kana statement descriptor that’s set on the account to form the complete statement descriptor. - /// Maximum 22 characters. - /// On card statements, the *concatenation* of both prefix and suffix (including separators) will appear truncated to 22 characters. - #[serde(skip_serializing_if = "Option::is_none")] - pub statement_descriptor_suffix_kana: Option, - - /// Provides information about a card payment that customers see on their statements. - /// - /// Concatenated with the Kanji prefix (shortened Kanji descriptor) or Kanji statement descriptor that’s set on the account to form the complete statement descriptor. - /// Maximum 17 characters. - /// On card statements, the *concatenation* of both prefix and suffix (including separators) will appear truncated to 17 characters. - #[serde(skip_serializing_if = "Option::is_none")] - pub statement_descriptor_suffix_kanji: Option, - - /// If 3D Secure authentication was performed with a third-party provider, - /// the authentication details to use for this payment. - #[serde(skip_serializing_if = "Option::is_none")] - pub three_d_secure: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreatePaymentIntentPaymentMethodOptionsCardPresent { - /// Request ability to capture this payment beyond the standard [authorization validity window](https://stripe.com/docs/terminal/features/extended-authorizations#authorization-validity). - #[serde(skip_serializing_if = "Option::is_none")] - pub request_extended_authorization: Option, - - /// Request ability to [increment](https://stripe.com/docs/terminal/features/incremental-authorizations) this PaymentIntent if the combination of MCC and card brand is eligible. - /// - /// Check [incremental_authorization_supported](https://stripe.com/docs/api/charges/object#charge_object-payment_method_details-card_present-incremental_authorization_supported) in the [Confirm](https://stripe.com/docs/api/payment_intents/confirm) response to verify support. - #[serde(skip_serializing_if = "Option::is_none")] - pub request_incremental_authorization_support: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreatePaymentIntentPaymentMethodOptionsCashapp { - /// Controls when the funds will be captured from the customer's account. - /// - /// If provided, this parameter will override the top-level `capture_method` when finalizing the payment with this payment method type. - /// - /// If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter will unset the stored value for this payment method type. - #[serde(skip_serializing_if = "Option::is_none")] - pub capture_method: Option, - - /// Indicates that you intend to make future payments with this PaymentIntent's payment method. - /// - /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. - /// - /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. - #[serde(skip_serializing_if = "Option::is_none")] - pub setup_future_usage: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreatePaymentIntentPaymentMethodOptionsCustomerBalance { - /// Configuration for the bank transfer funding type, if the `funding_type` is set to `bank_transfer`. - #[serde(skip_serializing_if = "Option::is_none")] - pub bank_transfer: Option, - - /// The funding method type to be used when there are not enough funds in the customer balance. - /// - /// Permitted values include: `bank_transfer`. - #[serde(skip_serializing_if = "Option::is_none")] - pub funding_type: Option, - - /// Indicates that you intend to make future payments with this PaymentIntent's payment method. - /// - /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. - /// - /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. - #[serde(skip_serializing_if = "Option::is_none")] - pub setup_future_usage: - Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreatePaymentIntentPaymentMethodOptionsEps { - /// Indicates that you intend to make future payments with this PaymentIntent's payment method. - /// - /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. - /// - /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. - #[serde(skip_serializing_if = "Option::is_none")] - pub setup_future_usage: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreatePaymentIntentPaymentMethodOptionsFpx { - /// Indicates that you intend to make future payments with this PaymentIntent's payment method. - /// - /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. - /// - /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. - #[serde(skip_serializing_if = "Option::is_none")] - pub setup_future_usage: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreatePaymentIntentPaymentMethodOptionsGiropay { - /// Indicates that you intend to make future payments with this PaymentIntent's payment method. - /// - /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. - /// - /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. - #[serde(skip_serializing_if = "Option::is_none")] - pub setup_future_usage: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreatePaymentIntentPaymentMethodOptionsGrabpay { - /// Indicates that you intend to make future payments with this PaymentIntent's payment method. - /// - /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. - /// - /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. - #[serde(skip_serializing_if = "Option::is_none")] - pub setup_future_usage: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreatePaymentIntentPaymentMethodOptionsIdeal { - /// Indicates that you intend to make future payments with this PaymentIntent's payment method. - /// - /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. - /// - /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. - #[serde(skip_serializing_if = "Option::is_none")] - pub setup_future_usage: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreatePaymentIntentPaymentMethodOptionsInteracPresent {} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreatePaymentIntentPaymentMethodOptionsKlarna { - /// Controls when the funds will be captured from the customer's account. - /// - /// If provided, this parameter will override the top-level `capture_method` when finalizing the payment with this payment method type. - /// - /// If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter will unset the stored value for this payment method type. - #[serde(skip_serializing_if = "Option::is_none")] - pub capture_method: Option, - - /// Preferred language of the Klarna authorization page that the customer is redirected to. - #[serde(skip_serializing_if = "Option::is_none")] - pub preferred_locale: Option, - - /// Indicates that you intend to make future payments with this PaymentIntent's payment method. - /// - /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. - /// - /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. - #[serde(skip_serializing_if = "Option::is_none")] - pub setup_future_usage: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreatePaymentIntentPaymentMethodOptionsKonbini { - /// An optional 10 to 11 digit numeric-only string determining the confirmation code at applicable convenience stores. - /// - /// Must not consist of only zeroes and could be rejected in case of insufficient uniqueness. - /// We recommend to use the customer's phone number. - #[serde(skip_serializing_if = "Option::is_none")] - pub confirmation_number: Option, - - /// The number of calendar days (between 1 and 60) after which Konbini payment instructions will expire. - /// - /// For example, if a PaymentIntent is confirmed with Konbini and `expires_after_days` set to 2 on Monday JST, the instructions will expire on Wednesday 23:59:59 JST. - /// Defaults to 3 days. - #[serde(skip_serializing_if = "Option::is_none")] - pub expires_after_days: Option, - - /// The timestamp at which the Konbini payment instructions will expire. - /// - /// Only one of `expires_after_days` or `expires_at` may be set. - #[serde(skip_serializing_if = "Option::is_none")] - pub expires_at: Option, - - /// A product descriptor of up to 22 characters, which will appear to customers at the convenience store. - #[serde(skip_serializing_if = "Option::is_none")] - pub product_description: Option, - - /// Indicates that you intend to make future payments with this PaymentIntent's payment method. - /// - /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. - /// - /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. - #[serde(skip_serializing_if = "Option::is_none")] - pub setup_future_usage: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreatePaymentIntentPaymentMethodOptionsLink { - /// Controls when the funds will be captured from the customer's account. - /// - /// If provided, this parameter will override the top-level `capture_method` when finalizing the payment with this payment method type. - /// - /// If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter will unset the stored value for this payment method type. - #[serde(skip_serializing_if = "Option::is_none")] - pub capture_method: Option, - - /// [Deprecated] This is a legacy parameter that no longer has any function. - #[serde(skip_serializing_if = "Option::is_none")] - pub persistent_token: Option, - - /// Indicates that you intend to make future payments with this PaymentIntent's payment method. - /// - /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. - /// - /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. - #[serde(skip_serializing_if = "Option::is_none")] - pub setup_future_usage: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreatePaymentIntentPaymentMethodOptionsOxxo { - /// The number of calendar days before an OXXO voucher expires. - /// - /// For example, if you create an OXXO voucher on Monday and you set expires_after_days to 2, the OXXO invoice will expire on Wednesday at 23:59 America/Mexico_City time. - #[serde(skip_serializing_if = "Option::is_none")] - pub expires_after_days: Option, - - /// Indicates that you intend to make future payments with this PaymentIntent's payment method. - /// - /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. - /// - /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. - #[serde(skip_serializing_if = "Option::is_none")] - pub setup_future_usage: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreatePaymentIntentPaymentMethodOptionsP24 { - /// Indicates that you intend to make future payments with this PaymentIntent's payment method. - /// - /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. - /// - /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. - #[serde(skip_serializing_if = "Option::is_none")] - pub setup_future_usage: Option, - - /// Confirm that the payer has accepted the P24 terms and conditions. - #[serde(skip_serializing_if = "Option::is_none")] - pub tos_shown_and_accepted: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreatePaymentIntentPaymentMethodOptionsPaynow { - /// Indicates that you intend to make future payments with this PaymentIntent's payment method. - /// - /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. - /// - /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. - #[serde(skip_serializing_if = "Option::is_none")] - pub setup_future_usage: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreatePaymentIntentPaymentMethodOptionsPaypal { - /// Controls when the funds will be captured from the customer's account. - #[serde(skip_serializing_if = "Option::is_none")] - pub capture_method: Option, - - /// [Preferred locale](https://stripe.com/docs/payments/paypal/supported-locales) of the PayPal checkout page that the customer is redirected to. - #[serde(skip_serializing_if = "Option::is_none")] - pub preferred_locale: Option, - - /// A reference of the PayPal transaction visible to customer which is mapped to PayPal's invoice ID. - /// - /// This must be a globally unique ID if you have configured in your PayPal settings to block multiple payments per invoice ID. - #[serde(skip_serializing_if = "Option::is_none")] - pub reference: Option, - - /// The risk correlation ID for an on-session payment using a saved PayPal payment method. - #[serde(skip_serializing_if = "Option::is_none")] - pub risk_correlation_id: Option, - - /// Indicates that you intend to make future payments with this PaymentIntent's payment method. - /// - /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. - /// - /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. - #[serde(skip_serializing_if = "Option::is_none")] - pub setup_future_usage: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreatePaymentIntentPaymentMethodOptionsPix { - /// The number of seconds (between 10 and 1209600) after which Pix payment will expire. - /// - /// Defaults to 86400 seconds. - #[serde(skip_serializing_if = "Option::is_none")] - pub expires_after_seconds: Option, - - /// The timestamp at which the Pix expires (between 10 and 1209600 seconds in the future). - /// - /// Defaults to 1 day in the future. - #[serde(skip_serializing_if = "Option::is_none")] - pub expires_at: Option, - - /// Indicates that you intend to make future payments with this PaymentIntent's payment method. - /// - /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. - /// - /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. - #[serde(skip_serializing_if = "Option::is_none")] - pub setup_future_usage: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreatePaymentIntentPaymentMethodOptionsPromptpay { - /// Indicates that you intend to make future payments with this PaymentIntent's payment method. - /// - /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. - /// - /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. - #[serde(skip_serializing_if = "Option::is_none")] - pub setup_future_usage: - Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreatePaymentIntentPaymentMethodOptionsRevolutPay { - /// Indicates that you intend to make future payments with this PaymentIntent's payment method. - /// - /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. - /// - /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). - #[serde(skip_serializing_if = "Option::is_none")] - pub setup_future_usage: - Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreatePaymentIntentPaymentMethodOptionsSepaDebit { - /// Additional fields for Mandate creation. - #[serde(skip_serializing_if = "Option::is_none")] - pub mandate_options: Option, - - /// Indicates that you intend to make future payments with this PaymentIntent's payment method. - /// - /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. - /// - /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. - #[serde(skip_serializing_if = "Option::is_none")] - pub setup_future_usage: - Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreatePaymentIntentPaymentMethodOptionsSofort { - /// Language shown to the payer on redirect. - #[serde(skip_serializing_if = "Option::is_none")] - pub preferred_language: Option, - - /// Indicates that you intend to make future payments with this PaymentIntent's payment method. - /// - /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. - /// - /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. - #[serde(skip_serializing_if = "Option::is_none")] - pub setup_future_usage: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreatePaymentIntentPaymentMethodOptionsSwish { - /// The order ID displayed in the Swish app after the payment is authorized. - #[serde(skip_serializing_if = "Option::is_none")] - pub reference: Option, - - /// Indicates that you intend to make future payments with this PaymentIntent's payment method. - /// - /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. - /// - /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. - #[serde(skip_serializing_if = "Option::is_none")] - pub setup_future_usage: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreatePaymentIntentPaymentMethodOptionsUsBankAccount { - /// Additional fields for Financial Connections Session creation. - #[serde(skip_serializing_if = "Option::is_none")] - pub financial_connections: - Option, - - /// Additional fields for Mandate creation. - #[serde(skip_serializing_if = "Option::is_none")] - pub mandate_options: Option, - - /// Additional fields for network related functions. - #[serde(skip_serializing_if = "Option::is_none")] - pub networks: Option, - - /// Preferred transaction settlement speed. - #[serde(skip_serializing_if = "Option::is_none")] - pub preferred_settlement_speed: - Option, - - /// Indicates that you intend to make future payments with this PaymentIntent's payment method. - /// - /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. - /// - /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. - #[serde(skip_serializing_if = "Option::is_none")] - pub setup_future_usage: - Option, - - /// Bank account verification method. - #[serde(skip_serializing_if = "Option::is_none")] - pub verification_method: - Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreatePaymentIntentPaymentMethodOptionsWechatPay { - /// The app ID registered with WeChat Pay. - /// - /// Only required when client is ios or android. - #[serde(skip_serializing_if = "Option::is_none")] - pub app_id: Option, - - /// The client type that the end customer will pay from. - pub client: CreatePaymentIntentPaymentMethodOptionsWechatPayClient, - - /// Indicates that you intend to make future payments with this PaymentIntent's payment method. - /// - /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. - /// - /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. - #[serde(skip_serializing_if = "Option::is_none")] - pub setup_future_usage: - Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreatePaymentIntentPaymentMethodOptionsZip { - /// Indicates that you intend to make future payments with this PaymentIntent's payment method. - /// - /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. - /// - /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. - #[serde(skip_serializing_if = "Option::is_none")] - pub setup_future_usage: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreatePaymentIntentShippingAddress { - /// City, district, suburb, town, or village. - #[serde(skip_serializing_if = "Option::is_none")] - pub city: Option, - - /// Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). - #[serde(skip_serializing_if = "Option::is_none")] - pub country: Option, - - /// Address line 1 (e.g., street, PO Box, or company name). - #[serde(skip_serializing_if = "Option::is_none")] - pub line1: Option, - - /// Address line 2 (e.g., apartment, suite, unit, or building). - #[serde(skip_serializing_if = "Option::is_none")] - pub line2: Option, - - /// ZIP or postal code. - #[serde(skip_serializing_if = "Option::is_none")] - pub postal_code: Option, - - /// State, county, province, or region. - #[serde(skip_serializing_if = "Option::is_none")] - pub state: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UpdatePaymentIntentPaymentMethodDataAcssDebit { - /// Customer's bank account number. - pub account_number: String, - - /// Institution number of the customer's bank. - pub institution_number: String, - - /// Transit number of the customer's bank. - pub transit_number: String, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UpdatePaymentIntentPaymentMethodDataAffirm {} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UpdatePaymentIntentPaymentMethodDataAfterpayClearpay {} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UpdatePaymentIntentPaymentMethodDataAlipay {} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UpdatePaymentIntentPaymentMethodDataAuBecsDebit { - /// The account number for the bank account. - pub account_number: String, - - /// Bank-State-Branch number of the bank account. - pub bsb_number: String, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UpdatePaymentIntentPaymentMethodDataBacsDebit { - /// Account number of the bank account that the funds will be debited from. - #[serde(skip_serializing_if = "Option::is_none")] - pub account_number: Option, - - /// Sort code of the bank account. - /// - /// (e.g., `10-20-30`). - #[serde(skip_serializing_if = "Option::is_none")] - pub sort_code: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UpdatePaymentIntentPaymentMethodDataBancontact {} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UpdatePaymentIntentPaymentMethodDataBillingDetails { - /// Billing address. - #[serde(skip_serializing_if = "Option::is_none")] - pub address: Option, - - /// Email address. - #[serde(skip_serializing_if = "Option::is_none")] - pub email: Option, - - /// Full name. - #[serde(skip_serializing_if = "Option::is_none")] - pub name: Option, - - /// Billing phone number (including extension). - #[serde(skip_serializing_if = "Option::is_none")] - pub phone: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UpdatePaymentIntentPaymentMethodDataBlik {} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UpdatePaymentIntentPaymentMethodDataBoleto { - /// The tax ID of the customer (CPF for individual consumers or CNPJ for businesses consumers). - pub tax_id: String, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UpdatePaymentIntentPaymentMethodDataCashapp {} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UpdatePaymentIntentPaymentMethodDataCustomerBalance {} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UpdatePaymentIntentPaymentMethodDataEps { - /// The customer's bank. - #[serde(skip_serializing_if = "Option::is_none")] - pub bank: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UpdatePaymentIntentPaymentMethodDataFpx { - /// Account holder type for FPX transaction. - #[serde(skip_serializing_if = "Option::is_none")] - pub account_holder_type: Option, - - /// The customer's bank. - pub bank: UpdatePaymentIntentPaymentMethodDataFpxBank, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UpdatePaymentIntentPaymentMethodDataGiropay {} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UpdatePaymentIntentPaymentMethodDataGrabpay {} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UpdatePaymentIntentPaymentMethodDataIdeal { - /// The customer's bank. - #[serde(skip_serializing_if = "Option::is_none")] - pub bank: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UpdatePaymentIntentPaymentMethodDataInteracPresent {} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UpdatePaymentIntentPaymentMethodDataKlarna { - /// Customer's date of birth. - #[serde(skip_serializing_if = "Option::is_none")] - pub dob: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UpdatePaymentIntentPaymentMethodDataKonbini {} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UpdatePaymentIntentPaymentMethodDataLink {} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UpdatePaymentIntentPaymentMethodDataOxxo {} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UpdatePaymentIntentPaymentMethodDataP24 { - /// The customer's bank. - #[serde(skip_serializing_if = "Option::is_none")] - pub bank: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UpdatePaymentIntentPaymentMethodDataPaynow {} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UpdatePaymentIntentPaymentMethodDataPaypal {} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UpdatePaymentIntentPaymentMethodDataPix {} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UpdatePaymentIntentPaymentMethodDataPromptpay {} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UpdatePaymentIntentPaymentMethodDataRadarOptions { - /// A [Radar Session](https://stripe.com/docs/radar/radar-session) is a snapshot of the browser metadata and device details that help Radar make more accurate predictions on your payments. - #[serde(skip_serializing_if = "Option::is_none")] - pub session: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UpdatePaymentIntentPaymentMethodDataRevolutPay {} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UpdatePaymentIntentPaymentMethodDataSepaDebit { - /// IBAN of the bank account. - pub iban: String, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UpdatePaymentIntentPaymentMethodDataSofort { - /// Two-letter ISO code representing the country the bank account is located in. - pub country: UpdatePaymentIntentPaymentMethodDataSofortCountry, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UpdatePaymentIntentPaymentMethodDataSwish {} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UpdatePaymentIntentPaymentMethodDataUsBankAccount { - /// Account holder type: individual or company. - #[serde(skip_serializing_if = "Option::is_none")] - pub account_holder_type: - Option, - - /// Account number of the bank account. - #[serde(skip_serializing_if = "Option::is_none")] - pub account_number: Option, - - /// Account type: checkings or savings. - /// - /// Defaults to checking if omitted. - #[serde(skip_serializing_if = "Option::is_none")] - pub account_type: Option, - - /// The ID of a Financial Connections Account to use as a payment method. - #[serde(skip_serializing_if = "Option::is_none")] - pub financial_connections_account: Option, - - /// Routing number of the bank account. - #[serde(skip_serializing_if = "Option::is_none")] - pub routing_number: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UpdatePaymentIntentPaymentMethodDataWechatPay {} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UpdatePaymentIntentPaymentMethodDataZip {} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UpdatePaymentIntentPaymentMethodOptionsAcssDebit { - /// Additional fields for Mandate creation. - #[serde(skip_serializing_if = "Option::is_none")] - pub mandate_options: Option, - - /// Indicates that you intend to make future payments with this PaymentIntent's payment method. - /// - /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. - /// - /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. - #[serde(skip_serializing_if = "Option::is_none")] - pub setup_future_usage: - Option, - - /// Bank account verification method. - #[serde(skip_serializing_if = "Option::is_none")] - pub verification_method: - Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UpdatePaymentIntentPaymentMethodOptionsAffirm { - /// Controls when the funds will be captured from the customer's account. - /// - /// If provided, this parameter will override the top-level `capture_method` when finalizing the payment with this payment method type. - /// - /// If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter will unset the stored value for this payment method type. - #[serde(skip_serializing_if = "Option::is_none")] - pub capture_method: Option, - - /// Preferred language of the Affirm authorization page that the customer is redirected to. - #[serde(skip_serializing_if = "Option::is_none")] - pub preferred_locale: Option, - - /// Indicates that you intend to make future payments with this PaymentIntent's payment method. - /// - /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. - /// - /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. - #[serde(skip_serializing_if = "Option::is_none")] - pub setup_future_usage: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UpdatePaymentIntentPaymentMethodOptionsAfterpayClearpay { - /// Controls when the funds will be captured from the customer's account. - /// - /// If provided, this parameter will override the top-level `capture_method` when finalizing the payment with this payment method type. - /// - /// If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter will unset the stored value for this payment method type. - #[serde(skip_serializing_if = "Option::is_none")] - pub capture_method: - Option, - - /// An internal identifier or reference that this payment corresponds to. - /// - /// You must limit the identifier to 128 characters, and it can only contain letters, numbers, underscores, backslashes, and dashes. This field differs from the statement descriptor and item name. - #[serde(skip_serializing_if = "Option::is_none")] - pub reference: Option, - - /// Indicates that you intend to make future payments with this PaymentIntent's payment method. - /// - /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. - /// - /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. - #[serde(skip_serializing_if = "Option::is_none")] - pub setup_future_usage: - Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UpdatePaymentIntentPaymentMethodOptionsAlipay { - /// Indicates that you intend to make future payments with this PaymentIntent's payment method. - /// - /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. - /// - /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. - #[serde(skip_serializing_if = "Option::is_none")] - pub setup_future_usage: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UpdatePaymentIntentPaymentMethodOptionsAuBecsDebit { - /// Indicates that you intend to make future payments with this PaymentIntent's payment method. - /// - /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. - /// - /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. - #[serde(skip_serializing_if = "Option::is_none")] - pub setup_future_usage: - Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UpdatePaymentIntentPaymentMethodOptionsBacsDebit { - /// Indicates that you intend to make future payments with this PaymentIntent's payment method. - /// - /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. - /// - /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. - #[serde(skip_serializing_if = "Option::is_none")] - pub setup_future_usage: - Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UpdatePaymentIntentPaymentMethodOptionsBancontact { - /// Preferred language of the Bancontact authorization page that the customer is redirected to. - #[serde(skip_serializing_if = "Option::is_none")] - pub preferred_language: - Option, - - /// Indicates that you intend to make future payments with this PaymentIntent's payment method. - /// - /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. - /// - /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. - #[serde(skip_serializing_if = "Option::is_none")] - pub setup_future_usage: - Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UpdatePaymentIntentPaymentMethodOptionsBlik { - /// The 6-digit BLIK code that a customer has generated using their banking application. - /// - /// Can only be set on confirmation. - #[serde(skip_serializing_if = "Option::is_none")] - pub code: Option, - - /// Indicates that you intend to make future payments with this PaymentIntent's payment method. - /// - /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. - /// - /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. - #[serde(skip_serializing_if = "Option::is_none")] - pub setup_future_usage: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UpdatePaymentIntentPaymentMethodOptionsBoleto { - /// The number of calendar days before a Boleto voucher expires. - /// - /// For example, if you create a Boleto voucher on Monday and you set expires_after_days to 2, the Boleto invoice will expire on Wednesday at 23:59 America/Sao_Paulo time. - #[serde(skip_serializing_if = "Option::is_none")] - pub expires_after_days: Option, - - /// Indicates that you intend to make future payments with this PaymentIntent's payment method. - /// - /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. - /// - /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. - #[serde(skip_serializing_if = "Option::is_none")] - pub setup_future_usage: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UpdatePaymentIntentPaymentMethodOptionsCard { - /// Controls when the funds will be captured from the customer's account. - /// - /// If provided, this parameter will override the top-level `capture_method` when finalizing the payment with this payment method type. - /// - /// If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter will unset the stored value for this payment method type. - #[serde(skip_serializing_if = "Option::is_none")] - pub capture_method: Option, - - /// A single-use `cvc_update` Token that represents a card CVC value. - /// - /// When provided, the CVC value will be verified during the card payment attempt. - /// This parameter can only be provided during confirmation. - #[serde(skip_serializing_if = "Option::is_none")] - pub cvc_token: Option, - - /// Installment configuration for payments attempted on this PaymentIntent (Mexico Only). - /// - /// For more information, see the [installments integration guide](https://stripe.com/docs/payments/installments). - #[serde(skip_serializing_if = "Option::is_none")] - pub installments: Option, - - /// Configuration options for setting up an eMandate for cards issued in India. - #[serde(skip_serializing_if = "Option::is_none")] - pub mandate_options: Option, - - /// When specified, this parameter indicates that a transaction will be marked - /// as MOTO (Mail Order Telephone Order) and thus out of scope for SCA. - /// - /// This parameter can only be provided during confirmation. - #[serde(skip_serializing_if = "Option::is_none")] - pub moto: Option, - - /// Selected network to process this PaymentIntent on. - /// - /// Depends on the available networks of the card attached to the PaymentIntent. - /// Can be only set confirm-time. - #[serde(skip_serializing_if = "Option::is_none")] - pub network: Option, - - /// Request ability to [capture beyond the standard authorization validity window](https://stripe.com/docs/payments/extended-authorization) for this PaymentIntent. - #[serde(skip_serializing_if = "Option::is_none")] - pub request_extended_authorization: - Option, - - /// Request ability to [increment the authorization](https://stripe.com/docs/payments/incremental-authorization) for this PaymentIntent. - #[serde(skip_serializing_if = "Option::is_none")] - pub request_incremental_authorization: - Option, - - /// Request ability to make [multiple captures](https://stripe.com/docs/payments/multicapture) for this PaymentIntent. - #[serde(skip_serializing_if = "Option::is_none")] - pub request_multicapture: - Option, - - /// Request ability to [overcapture](https://stripe.com/docs/payments/overcapture) for this PaymentIntent. - #[serde(skip_serializing_if = "Option::is_none")] - pub request_overcapture: Option, - - /// We strongly recommend that you rely on our SCA Engine to automatically prompt your customers for authentication based on risk level and [other requirements](https://stripe.com/docs/strong-customer-authentication). - /// - /// However, if you wish to request 3D Secure based on logic from your own fraud engine, provide this option. - /// If not provided, this value defaults to `automatic`. - /// Read our guide on [manually requesting 3D Secure](https://stripe.com/docs/payments/3d-secure#manual-three-ds) for more information on how this configuration interacts with Radar and our SCA Engine. - #[serde(skip_serializing_if = "Option::is_none")] - pub request_three_d_secure: - Option, - - /// When enabled, using a card that is attached to a customer will require the CVC to be provided again (i.e. - /// - /// using the cvc_token parameter). - #[serde(skip_serializing_if = "Option::is_none")] - pub require_cvc_recollection: Option, - - /// Indicates that you intend to make future payments with this PaymentIntent's payment method. - /// - /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. - /// - /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. - #[serde(skip_serializing_if = "Option::is_none")] - pub setup_future_usage: Option, - - /// Provides information about a card payment that customers see on their statements. - /// - /// Concatenated with the Kana prefix (shortened Kana descriptor) or Kana statement descriptor that’s set on the account to form the complete statement descriptor. - /// Maximum 22 characters. - /// On card statements, the *concatenation* of both prefix and suffix (including separators) will appear truncated to 22 characters. - #[serde(skip_serializing_if = "Option::is_none")] - pub statement_descriptor_suffix_kana: Option, - - /// Provides information about a card payment that customers see on their statements. - /// - /// Concatenated with the Kanji prefix (shortened Kanji descriptor) or Kanji statement descriptor that’s set on the account to form the complete statement descriptor. - /// Maximum 17 characters. - /// On card statements, the *concatenation* of both prefix and suffix (including separators) will appear truncated to 17 characters. - #[serde(skip_serializing_if = "Option::is_none")] - pub statement_descriptor_suffix_kanji: Option, - - /// If 3D Secure authentication was performed with a third-party provider, - /// the authentication details to use for this payment. - #[serde(skip_serializing_if = "Option::is_none")] - pub three_d_secure: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UpdatePaymentIntentPaymentMethodOptionsCardPresent { - /// Request ability to capture this payment beyond the standard [authorization validity window](https://stripe.com/docs/terminal/features/extended-authorizations#authorization-validity). - #[serde(skip_serializing_if = "Option::is_none")] - pub request_extended_authorization: Option, - - /// Request ability to [increment](https://stripe.com/docs/terminal/features/incremental-authorizations) this PaymentIntent if the combination of MCC and card brand is eligible. - /// - /// Check [incremental_authorization_supported](https://stripe.com/docs/api/charges/object#charge_object-payment_method_details-card_present-incremental_authorization_supported) in the [Confirm](https://stripe.com/docs/api/payment_intents/confirm) response to verify support. - #[serde(skip_serializing_if = "Option::is_none")] - pub request_incremental_authorization_support: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UpdatePaymentIntentPaymentMethodOptionsCashapp { - /// Controls when the funds will be captured from the customer's account. - /// - /// If provided, this parameter will override the top-level `capture_method` when finalizing the payment with this payment method type. - /// - /// If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter will unset the stored value for this payment method type. - #[serde(skip_serializing_if = "Option::is_none")] - pub capture_method: Option, - - /// Indicates that you intend to make future payments with this PaymentIntent's payment method. - /// - /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. - /// - /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. - #[serde(skip_serializing_if = "Option::is_none")] - pub setup_future_usage: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UpdatePaymentIntentPaymentMethodOptionsCustomerBalance { - /// Configuration for the bank transfer funding type, if the `funding_type` is set to `bank_transfer`. - #[serde(skip_serializing_if = "Option::is_none")] - pub bank_transfer: Option, - - /// The funding method type to be used when there are not enough funds in the customer balance. - /// - /// Permitted values include: `bank_transfer`. - #[serde(skip_serializing_if = "Option::is_none")] - pub funding_type: Option, - - /// Indicates that you intend to make future payments with this PaymentIntent's payment method. - /// - /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. - /// - /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. - #[serde(skip_serializing_if = "Option::is_none")] - pub setup_future_usage: - Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UpdatePaymentIntentPaymentMethodOptionsEps { - /// Indicates that you intend to make future payments with this PaymentIntent's payment method. - /// - /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. - /// - /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. - #[serde(skip_serializing_if = "Option::is_none")] - pub setup_future_usage: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UpdatePaymentIntentPaymentMethodOptionsFpx { - /// Indicates that you intend to make future payments with this PaymentIntent's payment method. - /// - /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. - /// - /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. - #[serde(skip_serializing_if = "Option::is_none")] - pub setup_future_usage: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UpdatePaymentIntentPaymentMethodOptionsGiropay { - /// Indicates that you intend to make future payments with this PaymentIntent's payment method. - /// - /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. - /// - /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. - #[serde(skip_serializing_if = "Option::is_none")] - pub setup_future_usage: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UpdatePaymentIntentPaymentMethodOptionsGrabpay { - /// Indicates that you intend to make future payments with this PaymentIntent's payment method. - /// - /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. - /// - /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. - #[serde(skip_serializing_if = "Option::is_none")] - pub setup_future_usage: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UpdatePaymentIntentPaymentMethodOptionsIdeal { - /// Indicates that you intend to make future payments with this PaymentIntent's payment method. - /// - /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. - /// - /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. - #[serde(skip_serializing_if = "Option::is_none")] - pub setup_future_usage: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UpdatePaymentIntentPaymentMethodOptionsInteracPresent {} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UpdatePaymentIntentPaymentMethodOptionsKlarna { - /// Controls when the funds will be captured from the customer's account. - /// - /// If provided, this parameter will override the top-level `capture_method` when finalizing the payment with this payment method type. - /// - /// If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter will unset the stored value for this payment method type. - #[serde(skip_serializing_if = "Option::is_none")] - pub capture_method: Option, - - /// Preferred language of the Klarna authorization page that the customer is redirected to. - #[serde(skip_serializing_if = "Option::is_none")] - pub preferred_locale: Option, - - /// Indicates that you intend to make future payments with this PaymentIntent's payment method. - /// - /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. - /// - /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. - #[serde(skip_serializing_if = "Option::is_none")] - pub setup_future_usage: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UpdatePaymentIntentPaymentMethodOptionsKonbini { - /// An optional 10 to 11 digit numeric-only string determining the confirmation code at applicable convenience stores. - /// - /// Must not consist of only zeroes and could be rejected in case of insufficient uniqueness. - /// We recommend to use the customer's phone number. - #[serde(skip_serializing_if = "Option::is_none")] - pub confirmation_number: Option, - - /// The number of calendar days (between 1 and 60) after which Konbini payment instructions will expire. - /// - /// For example, if a PaymentIntent is confirmed with Konbini and `expires_after_days` set to 2 on Monday JST, the instructions will expire on Wednesday 23:59:59 JST. - /// Defaults to 3 days. - #[serde(skip_serializing_if = "Option::is_none")] - pub expires_after_days: Option, - - /// The timestamp at which the Konbini payment instructions will expire. - /// - /// Only one of `expires_after_days` or `expires_at` may be set. - #[serde(skip_serializing_if = "Option::is_none")] - pub expires_at: Option, - - /// A product descriptor of up to 22 characters, which will appear to customers at the convenience store. - #[serde(skip_serializing_if = "Option::is_none")] - pub product_description: Option, - - /// Indicates that you intend to make future payments with this PaymentIntent's payment method. - /// - /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. - /// - /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. - #[serde(skip_serializing_if = "Option::is_none")] - pub setup_future_usage: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UpdatePaymentIntentPaymentMethodOptionsLink { - /// Controls when the funds will be captured from the customer's account. - /// - /// If provided, this parameter will override the top-level `capture_method` when finalizing the payment with this payment method type. - /// - /// If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter will unset the stored value for this payment method type. - #[serde(skip_serializing_if = "Option::is_none")] - pub capture_method: Option, - - /// [Deprecated] This is a legacy parameter that no longer has any function. - #[serde(skip_serializing_if = "Option::is_none")] - pub persistent_token: Option, - - /// Indicates that you intend to make future payments with this PaymentIntent's payment method. - /// - /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. - /// - /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. - #[serde(skip_serializing_if = "Option::is_none")] - pub setup_future_usage: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UpdatePaymentIntentPaymentMethodOptionsOxxo { - /// The number of calendar days before an OXXO voucher expires. - /// - /// For example, if you create an OXXO voucher on Monday and you set expires_after_days to 2, the OXXO invoice will expire on Wednesday at 23:59 America/Mexico_City time. - #[serde(skip_serializing_if = "Option::is_none")] - pub expires_after_days: Option, - - /// Indicates that you intend to make future payments with this PaymentIntent's payment method. - /// - /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. - /// - /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. - #[serde(skip_serializing_if = "Option::is_none")] - pub setup_future_usage: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UpdatePaymentIntentPaymentMethodOptionsP24 { - /// Indicates that you intend to make future payments with this PaymentIntent's payment method. - /// - /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. - /// - /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. - #[serde(skip_serializing_if = "Option::is_none")] - pub setup_future_usage: Option, - - /// Confirm that the payer has accepted the P24 terms and conditions. - #[serde(skip_serializing_if = "Option::is_none")] - pub tos_shown_and_accepted: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UpdatePaymentIntentPaymentMethodOptionsPaynow { - /// Indicates that you intend to make future payments with this PaymentIntent's payment method. - /// - /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. - /// - /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. - #[serde(skip_serializing_if = "Option::is_none")] - pub setup_future_usage: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UpdatePaymentIntentPaymentMethodOptionsPaypal { - /// Controls when the funds will be captured from the customer's account. - #[serde(skip_serializing_if = "Option::is_none")] - pub capture_method: Option, - - /// [Preferred locale](https://stripe.com/docs/payments/paypal/supported-locales) of the PayPal checkout page that the customer is redirected to. - #[serde(skip_serializing_if = "Option::is_none")] - pub preferred_locale: Option, - - /// A reference of the PayPal transaction visible to customer which is mapped to PayPal's invoice ID. - /// - /// This must be a globally unique ID if you have configured in your PayPal settings to block multiple payments per invoice ID. - #[serde(skip_serializing_if = "Option::is_none")] - pub reference: Option, - - /// The risk correlation ID for an on-session payment using a saved PayPal payment method. - #[serde(skip_serializing_if = "Option::is_none")] - pub risk_correlation_id: Option, - - /// Indicates that you intend to make future payments with this PaymentIntent's payment method. - /// - /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. - /// - /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. - #[serde(skip_serializing_if = "Option::is_none")] - pub setup_future_usage: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UpdatePaymentIntentPaymentMethodOptionsPix { - /// The number of seconds (between 10 and 1209600) after which Pix payment will expire. - /// - /// Defaults to 86400 seconds. - #[serde(skip_serializing_if = "Option::is_none")] - pub expires_after_seconds: Option, - - /// The timestamp at which the Pix expires (between 10 and 1209600 seconds in the future). - /// - /// Defaults to 1 day in the future. - #[serde(skip_serializing_if = "Option::is_none")] - pub expires_at: Option, - - /// Indicates that you intend to make future payments with this PaymentIntent's payment method. - /// - /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. - /// - /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. - #[serde(skip_serializing_if = "Option::is_none")] - pub setup_future_usage: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UpdatePaymentIntentPaymentMethodOptionsPromptpay { - /// Indicates that you intend to make future payments with this PaymentIntent's payment method. - /// - /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. - /// - /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. - #[serde(skip_serializing_if = "Option::is_none")] - pub setup_future_usage: - Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UpdatePaymentIntentPaymentMethodOptionsRevolutPay { - /// Indicates that you intend to make future payments with this PaymentIntent's payment method. - /// - /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. - /// - /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). - #[serde(skip_serializing_if = "Option::is_none")] - pub setup_future_usage: - Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UpdatePaymentIntentPaymentMethodOptionsSepaDebit { - /// Additional fields for Mandate creation. - #[serde(skip_serializing_if = "Option::is_none")] - pub mandate_options: Option, - - /// Indicates that you intend to make future payments with this PaymentIntent's payment method. - /// - /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. - /// - /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. - #[serde(skip_serializing_if = "Option::is_none")] - pub setup_future_usage: - Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UpdatePaymentIntentPaymentMethodOptionsSofort { - /// Language shown to the payer on redirect. - #[serde(skip_serializing_if = "Option::is_none")] - pub preferred_language: Option, - - /// Indicates that you intend to make future payments with this PaymentIntent's payment method. - /// - /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. - /// - /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. - #[serde(skip_serializing_if = "Option::is_none")] - pub setup_future_usage: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UpdatePaymentIntentPaymentMethodOptionsSwish { - /// The order ID displayed in the Swish app after the payment is authorized. - #[serde(skip_serializing_if = "Option::is_none")] - pub reference: Option, - - /// Indicates that you intend to make future payments with this PaymentIntent's payment method. - /// - /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. - /// - /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. - #[serde(skip_serializing_if = "Option::is_none")] - pub setup_future_usage: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UpdatePaymentIntentPaymentMethodOptionsUsBankAccount { - /// Additional fields for Financial Connections Session creation. - #[serde(skip_serializing_if = "Option::is_none")] - pub financial_connections: - Option, - - /// Additional fields for Mandate creation. - #[serde(skip_serializing_if = "Option::is_none")] - pub mandate_options: Option, - - /// Additional fields for network related functions. - #[serde(skip_serializing_if = "Option::is_none")] - pub networks: Option, - - /// Preferred transaction settlement speed. - #[serde(skip_serializing_if = "Option::is_none")] - pub preferred_settlement_speed: - Option, - - /// Indicates that you intend to make future payments with this PaymentIntent's payment method. - /// - /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. - /// - /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. - #[serde(skip_serializing_if = "Option::is_none")] - pub setup_future_usage: - Option, - - /// Bank account verification method. - #[serde(skip_serializing_if = "Option::is_none")] - pub verification_method: - Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UpdatePaymentIntentPaymentMethodOptionsWechatPay { - /// The app ID registered with WeChat Pay. - /// - /// Only required when client is ios or android. - #[serde(skip_serializing_if = "Option::is_none")] - pub app_id: Option, - - /// The client type that the end customer will pay from. - pub client: UpdatePaymentIntentPaymentMethodOptionsWechatPayClient, - - /// Indicates that you intend to make future payments with this PaymentIntent's payment method. - /// - /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. - /// - /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. - #[serde(skip_serializing_if = "Option::is_none")] - pub setup_future_usage: - Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UpdatePaymentIntentPaymentMethodOptionsZip { - /// Indicates that you intend to make future payments with this PaymentIntent's payment method. - /// - /// Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. - /// - /// If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. - #[serde(skip_serializing_if = "Option::is_none")] - pub setup_future_usage: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UpdatePaymentIntentShippingAddress { - /// City, district, suburb, town, or village. - #[serde(skip_serializing_if = "Option::is_none")] - pub city: Option, - - /// Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). - #[serde(skip_serializing_if = "Option::is_none")] - pub country: Option, - - /// Address line 1 (e.g., street, PO Box, or company name). - #[serde(skip_serializing_if = "Option::is_none")] - pub line1: Option, - - /// Address line 2 (e.g., apartment, suite, unit, or building). - #[serde(skip_serializing_if = "Option::is_none")] - pub line2: Option, - - /// ZIP or postal code. - #[serde(skip_serializing_if = "Option::is_none")] - pub postal_code: Option, - - /// State, county, province, or region. - #[serde(skip_serializing_if = "Option::is_none")] - pub state: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreatePaymentIntentMandateDataCustomerAcceptanceOffline {} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreatePaymentIntentMandateDataCustomerAcceptanceOnline { - /// The IP address from which the Mandate was accepted by the customer. - pub ip_address: String, - - /// The user agent of the browser from which the Mandate was accepted by the customer. - pub user_agent: String, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreatePaymentIntentPaymentMethodDataBillingDetailsAddress { - /// City, district, suburb, town, or village. - #[serde(skip_serializing_if = "Option::is_none")] - pub city: Option, - - /// Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). - #[serde(skip_serializing_if = "Option::is_none")] - pub country: Option, - - /// Address line 1 (e.g., street, PO Box, or company name). - #[serde(skip_serializing_if = "Option::is_none")] - pub line1: Option, - - /// Address line 2 (e.g., apartment, suite, unit, or building). - #[serde(skip_serializing_if = "Option::is_none")] - pub line2: Option, - - /// ZIP or postal code. - #[serde(skip_serializing_if = "Option::is_none")] - pub postal_code: Option, - - /// State, county, province, or region. - #[serde(skip_serializing_if = "Option::is_none")] - pub state: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreatePaymentIntentPaymentMethodDataKlarnaDob { - /// The day of birth, between 1 and 31. - pub day: i64, - - /// The month of birth, between 1 and 12. - pub month: i64, - - /// The four-digit year of birth. - pub year: i64, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreatePaymentIntentPaymentMethodOptionsAcssDebitMandateOptions { - /// A URL for custom mandate text to render during confirmation step. - /// The URL will be rendered with additional GET parameters `payment_intent` and `payment_intent_client_secret` when confirming a Payment Intent, - /// or `setup_intent` and `setup_intent_client_secret` when confirming a Setup Intent. - #[serde(skip_serializing_if = "Option::is_none")] - pub custom_mandate_url: Option, - - /// Description of the mandate interval. - /// - /// Only required if 'payment_schedule' parameter is 'interval' or 'combined'. - #[serde(skip_serializing_if = "Option::is_none")] - pub interval_description: Option, - - /// Payment schedule for the mandate. - #[serde(skip_serializing_if = "Option::is_none")] - pub payment_schedule: - Option, - - /// Transaction type of the mandate. - #[serde(skip_serializing_if = "Option::is_none")] - pub transaction_type: - Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreatePaymentIntentPaymentMethodOptionsCardInstallments { - /// Setting to true enables installments for this PaymentIntent. - /// This will cause the response to contain a list of available installment plans. - /// Setting to false will prevent any selected plan from applying to a charge. - #[serde(skip_serializing_if = "Option::is_none")] - pub enabled: Option, - - /// The selected installment plan to use for this payment attempt. - /// This parameter can only be provided during confirmation. - #[serde(skip_serializing_if = "Option::is_none")] - pub plan: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreatePaymentIntentPaymentMethodOptionsCardMandateOptions { - /// Amount to be charged for future payments. - pub amount: i64, - - /// One of `fixed` or `maximum`. - /// - /// If `fixed`, the `amount` param refers to the exact amount to be charged in future payments. - /// If `maximum`, the amount charged can be up to the value passed for the `amount` param. - pub amount_type: CreatePaymentIntentPaymentMethodOptionsCardMandateOptionsAmountType, - - /// A description of the mandate or subscription that is meant to be displayed to the customer. - #[serde(skip_serializing_if = "Option::is_none")] - pub description: Option, - - /// End date of the mandate or subscription. - /// - /// If not provided, the mandate will be active until canceled. - /// If provided, end date should be after start date. - #[serde(skip_serializing_if = "Option::is_none")] - pub end_date: Option, - - /// Specifies payment frequency. - /// - /// One of `day`, `week`, `month`, `year`, or `sporadic`. - pub interval: CreatePaymentIntentPaymentMethodOptionsCardMandateOptionsInterval, - - /// The number of intervals between payments. - /// - /// For example, `interval=month` and `interval_count=3` indicates one payment every three months. - /// Maximum of one year interval allowed (1 year, 12 months, or 52 weeks). - /// This parameter is optional when `interval=sporadic`. - #[serde(skip_serializing_if = "Option::is_none")] - pub interval_count: Option, - - /// Unique identifier for the mandate or subscription. - pub reference: String, - - /// Start date of the mandate or subscription. - /// - /// Start date should not be lesser than yesterday. - pub start_date: Timestamp, - - /// Specifies the type of mandates supported. - /// - /// Possible values are `india`. - #[serde(skip_serializing_if = "Option::is_none")] - pub supported_types: - Option>, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreatePaymentIntentPaymentMethodOptionsCardThreeDSecure { - /// The `transStatus` returned from the card Issuer’s ACS in the ARes. - #[serde(skip_serializing_if = "Option::is_none")] - pub ares_trans_status: - Option, - - /// The cryptogram, also known as the "authentication value" (AAV, CAVV or - /// AEVV). - /// - /// This value is 20 bytes, base64-encoded into a 28-character string. (Most 3D Secure providers will return the base64-encoded version, which is what you should specify here.). - pub cryptogram: String, - - /// The Electronic Commerce Indicator (ECI) is returned by your 3D Secure - /// provider and indicates what degree of authentication was performed. - #[serde(skip_serializing_if = "Option::is_none")] - pub electronic_commerce_indicator: - Option, - - /// The exemption requested via 3DS and accepted by the issuer at authentication time. - #[serde(skip_serializing_if = "Option::is_none")] - pub exemption_indicator: - Option, - - /// Network specific 3DS fields. - /// - /// Network specific arguments require an explicit card brand choice. - /// The parameter `payment_method_options.card.network`` must be populated accordingly. - #[serde(skip_serializing_if = "Option::is_none")] - pub network_options: - Option, - - /// The challenge indicator (`threeDSRequestorChallengeInd`) which was requested in the - /// AReq sent to the card Issuer's ACS. - /// - /// A string containing 2 digits from 01-99. - #[serde(skip_serializing_if = "Option::is_none")] - pub requestor_challenge_indicator: Option, - - /// For 3D Secure 1, the XID. - /// - /// For 3D Secure 2, the Directory Server Transaction ID (dsTransID). - pub transaction_id: String, - - /// The version of 3D Secure that was performed. - pub version: CreatePaymentIntentPaymentMethodOptionsCardThreeDSecureVersion, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreatePaymentIntentPaymentMethodOptionsCustomerBalanceBankTransfer { - /// Configuration for the eu_bank_transfer funding type. - #[serde(skip_serializing_if = "Option::is_none")] - pub eu_bank_transfer: - Option, - - /// List of address types that should be returned in the financial_addresses response. - /// - /// If not specified, all valid types will be returned. Permitted values include: `sort_code`, `zengin`, `iban`, or `spei`. - #[serde(skip_serializing_if = "Option::is_none")] - pub requested_address_types: Option< - Vec< - CreatePaymentIntentPaymentMethodOptionsCustomerBalanceBankTransferRequestedAddressTypes, - >, - >, - - /// The list of bank transfer types that this PaymentIntent is allowed to use for funding Permitted values include: `eu_bank_transfer`, `gb_bank_transfer`, `jp_bank_transfer`, `mx_bank_transfer`, or `us_bank_transfer`. - #[serde(rename = "type")] - pub type_: CreatePaymentIntentPaymentMethodOptionsCustomerBalanceBankTransferType, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreatePaymentIntentPaymentMethodOptionsSepaDebitMandateOptions {} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreatePaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnections { - /// The list of permissions to request. - /// - /// If this parameter is passed, the `payment_method` permission must be included. - /// Valid permissions include: `balances`, `ownership`, `payment_method`, and `transactions`. - #[serde(skip_serializing_if = "Option::is_none")] - pub permissions: Option< - Vec, - >, - - /// List of data features that you would like to retrieve upon account creation. - #[serde(skip_serializing_if = "Option::is_none")] - pub prefetch: Option< - Vec, - >, - - /// For webview integrations only. - /// - /// Upon completing OAuth login in the native browser, the user will be redirected to this URL to return to your app. - #[serde(skip_serializing_if = "Option::is_none")] - pub return_url: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreatePaymentIntentPaymentMethodOptionsUsBankAccountMandateOptions { - /// The method used to collect offline mandate customer acceptance. - #[serde(skip_serializing_if = "Option::is_none")] - pub collection_method: - Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreatePaymentIntentPaymentMethodOptionsUsBankAccountNetworks { - /// Triggers validations to run across the selected networks. - #[serde(skip_serializing_if = "Option::is_none")] - pub requested: - Option>, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UpdatePaymentIntentPaymentMethodDataBillingDetailsAddress { - /// City, district, suburb, town, or village. - #[serde(skip_serializing_if = "Option::is_none")] - pub city: Option, - - /// Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). - #[serde(skip_serializing_if = "Option::is_none")] - pub country: Option, - - /// Address line 1 (e.g., street, PO Box, or company name). - #[serde(skip_serializing_if = "Option::is_none")] - pub line1: Option, - - /// Address line 2 (e.g., apartment, suite, unit, or building). - #[serde(skip_serializing_if = "Option::is_none")] - pub line2: Option, - - /// ZIP or postal code. - #[serde(skip_serializing_if = "Option::is_none")] - pub postal_code: Option, - - /// State, county, province, or region. - #[serde(skip_serializing_if = "Option::is_none")] - pub state: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UpdatePaymentIntentPaymentMethodDataKlarnaDob { - /// The day of birth, between 1 and 31. - pub day: i64, - - /// The month of birth, between 1 and 12. - pub month: i64, - - /// The four-digit year of birth. - pub year: i64, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UpdatePaymentIntentPaymentMethodOptionsAcssDebitMandateOptions { - /// A URL for custom mandate text to render during confirmation step. - /// The URL will be rendered with additional GET parameters `payment_intent` and `payment_intent_client_secret` when confirming a Payment Intent, - /// or `setup_intent` and `setup_intent_client_secret` when confirming a Setup Intent. - #[serde(skip_serializing_if = "Option::is_none")] - pub custom_mandate_url: Option, - - /// Description of the mandate interval. - /// - /// Only required if 'payment_schedule' parameter is 'interval' or 'combined'. - #[serde(skip_serializing_if = "Option::is_none")] - pub interval_description: Option, - - /// Payment schedule for the mandate. - #[serde(skip_serializing_if = "Option::is_none")] - pub payment_schedule: - Option, - - /// Transaction type of the mandate. - #[serde(skip_serializing_if = "Option::is_none")] - pub transaction_type: - Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UpdatePaymentIntentPaymentMethodOptionsCardInstallments { - /// Setting to true enables installments for this PaymentIntent. - /// This will cause the response to contain a list of available installment plans. - /// Setting to false will prevent any selected plan from applying to a charge. - #[serde(skip_serializing_if = "Option::is_none")] - pub enabled: Option, - - /// The selected installment plan to use for this payment attempt. - /// This parameter can only be provided during confirmation. - #[serde(skip_serializing_if = "Option::is_none")] - pub plan: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UpdatePaymentIntentPaymentMethodOptionsCardMandateOptions { - /// Amount to be charged for future payments. - pub amount: i64, - - /// One of `fixed` or `maximum`. - /// - /// If `fixed`, the `amount` param refers to the exact amount to be charged in future payments. - /// If `maximum`, the amount charged can be up to the value passed for the `amount` param. - pub amount_type: UpdatePaymentIntentPaymentMethodOptionsCardMandateOptionsAmountType, - - /// A description of the mandate or subscription that is meant to be displayed to the customer. - #[serde(skip_serializing_if = "Option::is_none")] - pub description: Option, - - /// End date of the mandate or subscription. - /// - /// If not provided, the mandate will be active until canceled. - /// If provided, end date should be after start date. - #[serde(skip_serializing_if = "Option::is_none")] - pub end_date: Option, - - /// Specifies payment frequency. - /// - /// One of `day`, `week`, `month`, `year`, or `sporadic`. - pub interval: UpdatePaymentIntentPaymentMethodOptionsCardMandateOptionsInterval, - - /// The number of intervals between payments. - /// - /// For example, `interval=month` and `interval_count=3` indicates one payment every three months. - /// Maximum of one year interval allowed (1 year, 12 months, or 52 weeks). - /// This parameter is optional when `interval=sporadic`. - #[serde(skip_serializing_if = "Option::is_none")] - pub interval_count: Option, - - /// Unique identifier for the mandate or subscription. - pub reference: String, - - /// Start date of the mandate or subscription. - /// - /// Start date should not be lesser than yesterday. - pub start_date: Timestamp, - - /// Specifies the type of mandates supported. - /// - /// Possible values are `india`. - #[serde(skip_serializing_if = "Option::is_none")] - pub supported_types: - Option>, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UpdatePaymentIntentPaymentMethodOptionsCardThreeDSecure { - /// The `transStatus` returned from the card Issuer’s ACS in the ARes. - #[serde(skip_serializing_if = "Option::is_none")] - pub ares_trans_status: - Option, - - /// The cryptogram, also known as the "authentication value" (AAV, CAVV or - /// AEVV). - /// - /// This value is 20 bytes, base64-encoded into a 28-character string. (Most 3D Secure providers will return the base64-encoded version, which is what you should specify here.). - pub cryptogram: String, - - /// The Electronic Commerce Indicator (ECI) is returned by your 3D Secure - /// provider and indicates what degree of authentication was performed. - #[serde(skip_serializing_if = "Option::is_none")] - pub electronic_commerce_indicator: - Option, - - /// The exemption requested via 3DS and accepted by the issuer at authentication time. - #[serde(skip_serializing_if = "Option::is_none")] - pub exemption_indicator: - Option, - - /// Network specific 3DS fields. - /// - /// Network specific arguments require an explicit card brand choice. - /// The parameter `payment_method_options.card.network`` must be populated accordingly. - #[serde(skip_serializing_if = "Option::is_none")] - pub network_options: - Option, - - /// The challenge indicator (`threeDSRequestorChallengeInd`) which was requested in the - /// AReq sent to the card Issuer's ACS. - /// - /// A string containing 2 digits from 01-99. - #[serde(skip_serializing_if = "Option::is_none")] - pub requestor_challenge_indicator: Option, - - /// For 3D Secure 1, the XID. - /// - /// For 3D Secure 2, the Directory Server Transaction ID (dsTransID). - pub transaction_id: String, - - /// The version of 3D Secure that was performed. - pub version: UpdatePaymentIntentPaymentMethodOptionsCardThreeDSecureVersion, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UpdatePaymentIntentPaymentMethodOptionsCustomerBalanceBankTransfer { - /// Configuration for the eu_bank_transfer funding type. - #[serde(skip_serializing_if = "Option::is_none")] - pub eu_bank_transfer: - Option, - - /// List of address types that should be returned in the financial_addresses response. - /// - /// If not specified, all valid types will be returned. Permitted values include: `sort_code`, `zengin`, `iban`, or `spei`. - #[serde(skip_serializing_if = "Option::is_none")] - pub requested_address_types: Option< - Vec< - UpdatePaymentIntentPaymentMethodOptionsCustomerBalanceBankTransferRequestedAddressTypes, - >, - >, - - /// The list of bank transfer types that this PaymentIntent is allowed to use for funding Permitted values include: `eu_bank_transfer`, `gb_bank_transfer`, `jp_bank_transfer`, `mx_bank_transfer`, or `us_bank_transfer`. - #[serde(rename = "type")] - pub type_: UpdatePaymentIntentPaymentMethodOptionsCustomerBalanceBankTransferType, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UpdatePaymentIntentPaymentMethodOptionsSepaDebitMandateOptions {} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UpdatePaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnections { - /// The list of permissions to request. - /// - /// If this parameter is passed, the `payment_method` permission must be included. - /// Valid permissions include: `balances`, `ownership`, `payment_method`, and `transactions`. - #[serde(skip_serializing_if = "Option::is_none")] - pub permissions: Option< - Vec, - >, - - /// List of data features that you would like to retrieve upon account creation. - #[serde(skip_serializing_if = "Option::is_none")] - pub prefetch: Option< - Vec, - >, - - /// For webview integrations only. - /// - /// Upon completing OAuth login in the native browser, the user will be redirected to this URL to return to your app. - #[serde(skip_serializing_if = "Option::is_none")] - pub return_url: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UpdatePaymentIntentPaymentMethodOptionsUsBankAccountMandateOptions { - /// The method used to collect offline mandate customer acceptance. - #[serde(skip_serializing_if = "Option::is_none")] - pub collection_method: - Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UpdatePaymentIntentPaymentMethodOptionsUsBankAccountNetworks { - /// Triggers validations to run across the selected networks. - #[serde(skip_serializing_if = "Option::is_none")] - pub requested: - Option>, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreatePaymentIntentPaymentMethodOptionsCardInstallmentsPlan { - /// For `fixed_count` installment plans, this is the number of installment payments your customer will make to their credit card. - pub count: u64, - - /// For `fixed_count` installment plans, this is the interval between installment payments your customer will make to their credit card. - /// One of `month`. - pub interval: CreatePaymentIntentPaymentMethodOptionsCardInstallmentsPlanInterval, - - /// Type of installment plan, one of `fixed_count`. - #[serde(rename = "type")] - pub type_: CreatePaymentIntentPaymentMethodOptionsCardInstallmentsPlanType, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreatePaymentIntentPaymentMethodOptionsCardThreeDSecureNetworkOptions { - /// Cartes Bancaires-specific 3DS fields. - #[serde(skip_serializing_if = "Option::is_none")] - pub cartes_bancaires: Option< - CreatePaymentIntentPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancaires, - >, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreatePaymentIntentPaymentMethodOptionsCustomerBalanceBankTransferEuBankTransfer { - /// The desired country code of the bank account information. - /// - /// Permitted values include: `BE`, `DE`, `ES`, `FR`, `IE`, or `NL`. - pub country: String, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UpdatePaymentIntentPaymentMethodOptionsCardInstallmentsPlan { - /// For `fixed_count` installment plans, this is the number of installment payments your customer will make to their credit card. - pub count: u64, - - /// For `fixed_count` installment plans, this is the interval between installment payments your customer will make to their credit card. - /// One of `month`. - pub interval: UpdatePaymentIntentPaymentMethodOptionsCardInstallmentsPlanInterval, - - /// Type of installment plan, one of `fixed_count`. - #[serde(rename = "type")] - pub type_: UpdatePaymentIntentPaymentMethodOptionsCardInstallmentsPlanType, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UpdatePaymentIntentPaymentMethodOptionsCardThreeDSecureNetworkOptions { - /// Cartes Bancaires-specific 3DS fields. - #[serde(skip_serializing_if = "Option::is_none")] - pub cartes_bancaires: Option< - UpdatePaymentIntentPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancaires, - >, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UpdatePaymentIntentPaymentMethodOptionsCustomerBalanceBankTransferEuBankTransfer { - /// The desired country code of the bank account information. - /// - /// Permitted values include: `BE`, `DE`, `ES`, `FR`, `IE`, or `NL`. - pub country: String, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreatePaymentIntentPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancaires { - - /// The cryptogram calculation algorithm used by the card Issuer's ACS - /// to calculate the Authentication cryptogram. - /// - /// Also known as `cavvAlgorithm`. messageExtension: CB-AVALGO. - pub cb_avalgo: CreatePaymentIntentPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancairesCbAvalgo, - - /// The exemption indicator returned from Cartes Bancaires in the ARes. - /// message extension: CB-EXEMPTION; string (4 characters) - /// This is a 3 byte bitmap (low significant byte first and most significant - /// bit first) that has been Base64 encoded. - #[serde(skip_serializing_if = "Option::is_none")] - pub cb_exemption: Option, - - /// The risk score returned from Cartes Bancaires in the ARes. - /// message extension: CB-SCORE; numeric value 0-99. - #[serde(skip_serializing_if = "Option::is_none")] - pub cb_score: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UpdatePaymentIntentPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancaires { - - /// The cryptogram calculation algorithm used by the card Issuer's ACS - /// to calculate the Authentication cryptogram. - /// - /// Also known as `cavvAlgorithm`. messageExtension: CB-AVALGO. - pub cb_avalgo: UpdatePaymentIntentPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancairesCbAvalgo, - - /// The exemption indicator returned from Cartes Bancaires in the ARes. - /// message extension: CB-EXEMPTION; string (4 characters) - /// This is a 3 byte bitmap (low significant byte first and most significant - /// bit first) that has been Base64 encoded. - #[serde(skip_serializing_if = "Option::is_none")] - pub cb_exemption: Option, - - /// The risk score returned from Cartes Bancaires in the ARes. - /// message extension: CB-SCORE; numeric value 0-99. - #[serde(skip_serializing_if = "Option::is_none")] - pub cb_score: Option, -} - -/// An enum representing the possible values of an `CreatePaymentIntentAutomaticPaymentMethods`'s `allow_redirects` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CreatePaymentIntentAutomaticPaymentMethodsAllowRedirects { - Always, - Never, -} - -impl CreatePaymentIntentAutomaticPaymentMethodsAllowRedirects { - pub fn as_str(self) -> &'static str { - match self { - CreatePaymentIntentAutomaticPaymentMethodsAllowRedirects::Always => "always", - CreatePaymentIntentAutomaticPaymentMethodsAllowRedirects::Never => "never", - } - } -} - -impl AsRef for CreatePaymentIntentAutomaticPaymentMethodsAllowRedirects { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for CreatePaymentIntentAutomaticPaymentMethodsAllowRedirects { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for CreatePaymentIntentAutomaticPaymentMethodsAllowRedirects { - fn default() -> Self { - Self::Always - } -} - -/// An enum representing the possible values of an `CreatePaymentIntentMandateDataCustomerAcceptance`'s `type` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CreatePaymentIntentMandateDataCustomerAcceptanceType { - Offline, - Online, -} - -impl CreatePaymentIntentMandateDataCustomerAcceptanceType { - pub fn as_str(self) -> &'static str { - match self { - CreatePaymentIntentMandateDataCustomerAcceptanceType::Offline => "offline", - CreatePaymentIntentMandateDataCustomerAcceptanceType::Online => "online", - } - } -} - -impl AsRef for CreatePaymentIntentMandateDataCustomerAcceptanceType { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for CreatePaymentIntentMandateDataCustomerAcceptanceType { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for CreatePaymentIntentMandateDataCustomerAcceptanceType { - fn default() -> Self { - Self::Offline - } -} - -/// An enum representing the possible values of an `CreatePaymentIntentPaymentMethodDataEps`'s `bank` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CreatePaymentIntentPaymentMethodDataEpsBank { - ArzteUndApothekerBank, - AustrianAnadiBankAg, - BankAustria, - BankhausCarlSpangler, - BankhausSchelhammerUndSchatteraAg, - BawagPskAg, - BksBankAg, - BrullKallmusBankAg, - BtvVierLanderBank, - CapitalBankGraweGruppeAg, - DeutscheBankAg, - Dolomitenbank, - EasybankAg, - ErsteBankUndSparkassen, - HypoAlpeadriabankInternationalAg, - HypoBankBurgenlandAktiengesellschaft, - HypoNoeLbFurNiederosterreichUWien, - HypoOberosterreichSalzburgSteiermark, - HypoTirolBankAg, - HypoVorarlbergBankAg, - MarchfelderBank, - OberbankAg, - RaiffeisenBankengruppeOsterreich, - SchoellerbankAg, - SpardaBankWien, - VolksbankGruppe, - VolkskreditbankAg, - VrBankBraunau, -} - -impl CreatePaymentIntentPaymentMethodDataEpsBank { - pub fn as_str(self) -> &'static str { - match self { - CreatePaymentIntentPaymentMethodDataEpsBank::ArzteUndApothekerBank => { - "arzte_und_apotheker_bank" - } - CreatePaymentIntentPaymentMethodDataEpsBank::AustrianAnadiBankAg => { - "austrian_anadi_bank_ag" - } - CreatePaymentIntentPaymentMethodDataEpsBank::BankAustria => "bank_austria", - CreatePaymentIntentPaymentMethodDataEpsBank::BankhausCarlSpangler => { - "bankhaus_carl_spangler" - } - CreatePaymentIntentPaymentMethodDataEpsBank::BankhausSchelhammerUndSchatteraAg => { - "bankhaus_schelhammer_und_schattera_ag" - } - CreatePaymentIntentPaymentMethodDataEpsBank::BawagPskAg => "bawag_psk_ag", - CreatePaymentIntentPaymentMethodDataEpsBank::BksBankAg => "bks_bank_ag", - CreatePaymentIntentPaymentMethodDataEpsBank::BrullKallmusBankAg => { - "brull_kallmus_bank_ag" - } - CreatePaymentIntentPaymentMethodDataEpsBank::BtvVierLanderBank => { - "btv_vier_lander_bank" - } - CreatePaymentIntentPaymentMethodDataEpsBank::CapitalBankGraweGruppeAg => { - "capital_bank_grawe_gruppe_ag" - } - CreatePaymentIntentPaymentMethodDataEpsBank::DeutscheBankAg => "deutsche_bank_ag", - CreatePaymentIntentPaymentMethodDataEpsBank::Dolomitenbank => "dolomitenbank", - CreatePaymentIntentPaymentMethodDataEpsBank::EasybankAg => "easybank_ag", - CreatePaymentIntentPaymentMethodDataEpsBank::ErsteBankUndSparkassen => { - "erste_bank_und_sparkassen" - } - CreatePaymentIntentPaymentMethodDataEpsBank::HypoAlpeadriabankInternationalAg => { - "hypo_alpeadriabank_international_ag" - } - CreatePaymentIntentPaymentMethodDataEpsBank::HypoBankBurgenlandAktiengesellschaft => { - "hypo_bank_burgenland_aktiengesellschaft" - } - CreatePaymentIntentPaymentMethodDataEpsBank::HypoNoeLbFurNiederosterreichUWien => { - "hypo_noe_lb_fur_niederosterreich_u_wien" - } - CreatePaymentIntentPaymentMethodDataEpsBank::HypoOberosterreichSalzburgSteiermark => { - "hypo_oberosterreich_salzburg_steiermark" - } - CreatePaymentIntentPaymentMethodDataEpsBank::HypoTirolBankAg => "hypo_tirol_bank_ag", - CreatePaymentIntentPaymentMethodDataEpsBank::HypoVorarlbergBankAg => { - "hypo_vorarlberg_bank_ag" - } - CreatePaymentIntentPaymentMethodDataEpsBank::MarchfelderBank => "marchfelder_bank", - CreatePaymentIntentPaymentMethodDataEpsBank::OberbankAg => "oberbank_ag", - CreatePaymentIntentPaymentMethodDataEpsBank::RaiffeisenBankengruppeOsterreich => { - "raiffeisen_bankengruppe_osterreich" - } - CreatePaymentIntentPaymentMethodDataEpsBank::SchoellerbankAg => "schoellerbank_ag", - CreatePaymentIntentPaymentMethodDataEpsBank::SpardaBankWien => "sparda_bank_wien", - CreatePaymentIntentPaymentMethodDataEpsBank::VolksbankGruppe => "volksbank_gruppe", - CreatePaymentIntentPaymentMethodDataEpsBank::VolkskreditbankAg => "volkskreditbank_ag", - CreatePaymentIntentPaymentMethodDataEpsBank::VrBankBraunau => "vr_bank_braunau", - } - } -} - -impl AsRef for CreatePaymentIntentPaymentMethodDataEpsBank { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for CreatePaymentIntentPaymentMethodDataEpsBank { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for CreatePaymentIntentPaymentMethodDataEpsBank { - fn default() -> Self { - Self::ArzteUndApothekerBank - } -} - -/// An enum representing the possible values of an `CreatePaymentIntentPaymentMethodDataFpx`'s `account_holder_type` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CreatePaymentIntentPaymentMethodDataFpxAccountHolderType { - Company, - Individual, -} - -impl CreatePaymentIntentPaymentMethodDataFpxAccountHolderType { - pub fn as_str(self) -> &'static str { - match self { - CreatePaymentIntentPaymentMethodDataFpxAccountHolderType::Company => "company", - CreatePaymentIntentPaymentMethodDataFpxAccountHolderType::Individual => "individual", - } - } -} - -impl AsRef for CreatePaymentIntentPaymentMethodDataFpxAccountHolderType { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for CreatePaymentIntentPaymentMethodDataFpxAccountHolderType { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for CreatePaymentIntentPaymentMethodDataFpxAccountHolderType { - fn default() -> Self { - Self::Company - } -} - -/// An enum representing the possible values of an `CreatePaymentIntentPaymentMethodDataFpx`'s `bank` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CreatePaymentIntentPaymentMethodDataFpxBank { - AffinBank, - Agrobank, - AllianceBank, - Ambank, - BankIslam, - BankMuamalat, - BankOfChina, - BankRakyat, - Bsn, - Cimb, - DeutscheBank, - HongLeongBank, - Hsbc, - Kfh, - Maybank2e, - Maybank2u, - Ocbc, - PbEnterprise, - PublicBank, - Rhb, - StandardChartered, - Uob, -} - -impl CreatePaymentIntentPaymentMethodDataFpxBank { - pub fn as_str(self) -> &'static str { - match self { - CreatePaymentIntentPaymentMethodDataFpxBank::AffinBank => "affin_bank", - CreatePaymentIntentPaymentMethodDataFpxBank::Agrobank => "agrobank", - CreatePaymentIntentPaymentMethodDataFpxBank::AllianceBank => "alliance_bank", - CreatePaymentIntentPaymentMethodDataFpxBank::Ambank => "ambank", - CreatePaymentIntentPaymentMethodDataFpxBank::BankIslam => "bank_islam", - CreatePaymentIntentPaymentMethodDataFpxBank::BankMuamalat => "bank_muamalat", - CreatePaymentIntentPaymentMethodDataFpxBank::BankOfChina => "bank_of_china", - CreatePaymentIntentPaymentMethodDataFpxBank::BankRakyat => "bank_rakyat", - CreatePaymentIntentPaymentMethodDataFpxBank::Bsn => "bsn", - CreatePaymentIntentPaymentMethodDataFpxBank::Cimb => "cimb", - CreatePaymentIntentPaymentMethodDataFpxBank::DeutscheBank => "deutsche_bank", - CreatePaymentIntentPaymentMethodDataFpxBank::HongLeongBank => "hong_leong_bank", - CreatePaymentIntentPaymentMethodDataFpxBank::Hsbc => "hsbc", - CreatePaymentIntentPaymentMethodDataFpxBank::Kfh => "kfh", - CreatePaymentIntentPaymentMethodDataFpxBank::Maybank2e => "maybank2e", - CreatePaymentIntentPaymentMethodDataFpxBank::Maybank2u => "maybank2u", - CreatePaymentIntentPaymentMethodDataFpxBank::Ocbc => "ocbc", - CreatePaymentIntentPaymentMethodDataFpxBank::PbEnterprise => "pb_enterprise", - CreatePaymentIntentPaymentMethodDataFpxBank::PublicBank => "public_bank", - CreatePaymentIntentPaymentMethodDataFpxBank::Rhb => "rhb", - CreatePaymentIntentPaymentMethodDataFpxBank::StandardChartered => "standard_chartered", - CreatePaymentIntentPaymentMethodDataFpxBank::Uob => "uob", - } - } -} - -impl AsRef for CreatePaymentIntentPaymentMethodDataFpxBank { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for CreatePaymentIntentPaymentMethodDataFpxBank { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for CreatePaymentIntentPaymentMethodDataFpxBank { - fn default() -> Self { - Self::AffinBank - } -} - -/// An enum representing the possible values of an `CreatePaymentIntentPaymentMethodDataIdeal`'s `bank` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CreatePaymentIntentPaymentMethodDataIdealBank { - AbnAmro, - AsnBank, - Bunq, - Handelsbanken, - Ing, - Knab, - Moneyou, - N26, - Nn, - Rabobank, - Regiobank, - Revolut, - SnsBank, - TriodosBank, - VanLanschot, - Yoursafe, -} - -impl CreatePaymentIntentPaymentMethodDataIdealBank { - pub fn as_str(self) -> &'static str { - match self { - CreatePaymentIntentPaymentMethodDataIdealBank::AbnAmro => "abn_amro", - CreatePaymentIntentPaymentMethodDataIdealBank::AsnBank => "asn_bank", - CreatePaymentIntentPaymentMethodDataIdealBank::Bunq => "bunq", - CreatePaymentIntentPaymentMethodDataIdealBank::Handelsbanken => "handelsbanken", - CreatePaymentIntentPaymentMethodDataIdealBank::Ing => "ing", - CreatePaymentIntentPaymentMethodDataIdealBank::Knab => "knab", - CreatePaymentIntentPaymentMethodDataIdealBank::Moneyou => "moneyou", - CreatePaymentIntentPaymentMethodDataIdealBank::N26 => "n26", - CreatePaymentIntentPaymentMethodDataIdealBank::Nn => "nn", - CreatePaymentIntentPaymentMethodDataIdealBank::Rabobank => "rabobank", - CreatePaymentIntentPaymentMethodDataIdealBank::Regiobank => "regiobank", - CreatePaymentIntentPaymentMethodDataIdealBank::Revolut => "revolut", - CreatePaymentIntentPaymentMethodDataIdealBank::SnsBank => "sns_bank", - CreatePaymentIntentPaymentMethodDataIdealBank::TriodosBank => "triodos_bank", - CreatePaymentIntentPaymentMethodDataIdealBank::VanLanschot => "van_lanschot", - CreatePaymentIntentPaymentMethodDataIdealBank::Yoursafe => "yoursafe", - } - } -} - -impl AsRef for CreatePaymentIntentPaymentMethodDataIdealBank { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for CreatePaymentIntentPaymentMethodDataIdealBank { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for CreatePaymentIntentPaymentMethodDataIdealBank { - fn default() -> Self { - Self::AbnAmro - } -} - -/// An enum representing the possible values of an `CreatePaymentIntentPaymentMethodDataP24`'s `bank` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CreatePaymentIntentPaymentMethodDataP24Bank { - AliorBank, - BankMillennium, - BankNowyBfgSa, - BankPekaoSa, - BankiSpbdzielcze, - Blik, - BnpParibas, - Boz, - CitiHandlowy, - CreditAgricole, - Envelobank, - EtransferPocztowy24, - GetinBank, - Ideabank, - Ing, - Inteligo, - MbankMtransfer, - NestPrzelew, - NoblePay, - PbacZIpko, - PlusBank, - SantanderPrzelew24, - TmobileUsbugiBankowe, - ToyotaBank, - Velobank, - VolkswagenBank, -} - -impl CreatePaymentIntentPaymentMethodDataP24Bank { - pub fn as_str(self) -> &'static str { - match self { - CreatePaymentIntentPaymentMethodDataP24Bank::AliorBank => "alior_bank", - CreatePaymentIntentPaymentMethodDataP24Bank::BankMillennium => "bank_millennium", - CreatePaymentIntentPaymentMethodDataP24Bank::BankNowyBfgSa => "bank_nowy_bfg_sa", - CreatePaymentIntentPaymentMethodDataP24Bank::BankPekaoSa => "bank_pekao_sa", - CreatePaymentIntentPaymentMethodDataP24Bank::BankiSpbdzielcze => "banki_spbdzielcze", - CreatePaymentIntentPaymentMethodDataP24Bank::Blik => "blik", - CreatePaymentIntentPaymentMethodDataP24Bank::BnpParibas => "bnp_paribas", - CreatePaymentIntentPaymentMethodDataP24Bank::Boz => "boz", - CreatePaymentIntentPaymentMethodDataP24Bank::CitiHandlowy => "citi_handlowy", - CreatePaymentIntentPaymentMethodDataP24Bank::CreditAgricole => "credit_agricole", - CreatePaymentIntentPaymentMethodDataP24Bank::Envelobank => "envelobank", - CreatePaymentIntentPaymentMethodDataP24Bank::EtransferPocztowy24 => { - "etransfer_pocztowy24" - } - CreatePaymentIntentPaymentMethodDataP24Bank::GetinBank => "getin_bank", - CreatePaymentIntentPaymentMethodDataP24Bank::Ideabank => "ideabank", - CreatePaymentIntentPaymentMethodDataP24Bank::Ing => "ing", - CreatePaymentIntentPaymentMethodDataP24Bank::Inteligo => "inteligo", - CreatePaymentIntentPaymentMethodDataP24Bank::MbankMtransfer => "mbank_mtransfer", - CreatePaymentIntentPaymentMethodDataP24Bank::NestPrzelew => "nest_przelew", - CreatePaymentIntentPaymentMethodDataP24Bank::NoblePay => "noble_pay", - CreatePaymentIntentPaymentMethodDataP24Bank::PbacZIpko => "pbac_z_ipko", - CreatePaymentIntentPaymentMethodDataP24Bank::PlusBank => "plus_bank", - CreatePaymentIntentPaymentMethodDataP24Bank::SantanderPrzelew24 => { - "santander_przelew24" - } - CreatePaymentIntentPaymentMethodDataP24Bank::TmobileUsbugiBankowe => { - "tmobile_usbugi_bankowe" - } - CreatePaymentIntentPaymentMethodDataP24Bank::ToyotaBank => "toyota_bank", - CreatePaymentIntentPaymentMethodDataP24Bank::Velobank => "velobank", - CreatePaymentIntentPaymentMethodDataP24Bank::VolkswagenBank => "volkswagen_bank", - } - } -} - -impl AsRef for CreatePaymentIntentPaymentMethodDataP24Bank { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for CreatePaymentIntentPaymentMethodDataP24Bank { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for CreatePaymentIntentPaymentMethodDataP24Bank { - fn default() -> Self { - Self::AliorBank - } -} - -/// An enum representing the possible values of an `CreatePaymentIntentPaymentMethodDataSofort`'s `country` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CreatePaymentIntentPaymentMethodDataSofortCountry { - #[serde(rename = "AT")] - At, - #[serde(rename = "BE")] - Be, - #[serde(rename = "DE")] - De, - #[serde(rename = "ES")] - Es, - #[serde(rename = "IT")] - It, - #[serde(rename = "NL")] - Nl, -} - -impl CreatePaymentIntentPaymentMethodDataSofortCountry { - pub fn as_str(self) -> &'static str { - match self { - CreatePaymentIntentPaymentMethodDataSofortCountry::At => "AT", - CreatePaymentIntentPaymentMethodDataSofortCountry::Be => "BE", - CreatePaymentIntentPaymentMethodDataSofortCountry::De => "DE", - CreatePaymentIntentPaymentMethodDataSofortCountry::Es => "ES", - CreatePaymentIntentPaymentMethodDataSofortCountry::It => "IT", - CreatePaymentIntentPaymentMethodDataSofortCountry::Nl => "NL", - } - } -} - -impl AsRef for CreatePaymentIntentPaymentMethodDataSofortCountry { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for CreatePaymentIntentPaymentMethodDataSofortCountry { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for CreatePaymentIntentPaymentMethodDataSofortCountry { - fn default() -> Self { - Self::At - } -} - -/// An enum representing the possible values of an `CreatePaymentIntentPaymentMethodData`'s `type` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CreatePaymentIntentPaymentMethodDataType { - AcssDebit, - Affirm, - AfterpayClearpay, - Alipay, - AuBecsDebit, - BacsDebit, - Bancontact, - Blik, - Boleto, - Cashapp, - CustomerBalance, - Eps, - Fpx, - Giropay, - Grabpay, - Ideal, - Klarna, - Konbini, - Link, - Oxxo, - P24, - Paynow, - Paypal, - Pix, - Promptpay, - RevolutPay, - SepaDebit, - Sofort, - Swish, - UsBankAccount, - WechatPay, - Zip, -} - -impl CreatePaymentIntentPaymentMethodDataType { - pub fn as_str(self) -> &'static str { - match self { - CreatePaymentIntentPaymentMethodDataType::AcssDebit => "acss_debit", - CreatePaymentIntentPaymentMethodDataType::Affirm => "affirm", - CreatePaymentIntentPaymentMethodDataType::AfterpayClearpay => "afterpay_clearpay", - CreatePaymentIntentPaymentMethodDataType::Alipay => "alipay", - CreatePaymentIntentPaymentMethodDataType::AuBecsDebit => "au_becs_debit", - CreatePaymentIntentPaymentMethodDataType::BacsDebit => "bacs_debit", - CreatePaymentIntentPaymentMethodDataType::Bancontact => "bancontact", - CreatePaymentIntentPaymentMethodDataType::Blik => "blik", - CreatePaymentIntentPaymentMethodDataType::Boleto => "boleto", - CreatePaymentIntentPaymentMethodDataType::Cashapp => "cashapp", - CreatePaymentIntentPaymentMethodDataType::CustomerBalance => "customer_balance", - CreatePaymentIntentPaymentMethodDataType::Eps => "eps", - CreatePaymentIntentPaymentMethodDataType::Fpx => "fpx", - CreatePaymentIntentPaymentMethodDataType::Giropay => "giropay", - CreatePaymentIntentPaymentMethodDataType::Grabpay => "grabpay", - CreatePaymentIntentPaymentMethodDataType::Ideal => "ideal", - CreatePaymentIntentPaymentMethodDataType::Klarna => "klarna", - CreatePaymentIntentPaymentMethodDataType::Konbini => "konbini", - CreatePaymentIntentPaymentMethodDataType::Link => "link", - CreatePaymentIntentPaymentMethodDataType::Oxxo => "oxxo", - CreatePaymentIntentPaymentMethodDataType::P24 => "p24", - CreatePaymentIntentPaymentMethodDataType::Paynow => "paynow", - CreatePaymentIntentPaymentMethodDataType::Paypal => "paypal", - CreatePaymentIntentPaymentMethodDataType::Pix => "pix", - CreatePaymentIntentPaymentMethodDataType::Promptpay => "promptpay", - CreatePaymentIntentPaymentMethodDataType::RevolutPay => "revolut_pay", - CreatePaymentIntentPaymentMethodDataType::SepaDebit => "sepa_debit", - CreatePaymentIntentPaymentMethodDataType::Sofort => "sofort", - CreatePaymentIntentPaymentMethodDataType::Swish => "swish", - CreatePaymentIntentPaymentMethodDataType::UsBankAccount => "us_bank_account", - CreatePaymentIntentPaymentMethodDataType::WechatPay => "wechat_pay", - CreatePaymentIntentPaymentMethodDataType::Zip => "zip", - } - } -} - -impl AsRef for CreatePaymentIntentPaymentMethodDataType { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for CreatePaymentIntentPaymentMethodDataType { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for CreatePaymentIntentPaymentMethodDataType { - fn default() -> Self { - Self::AcssDebit - } -} - -/// An enum representing the possible values of an `CreatePaymentIntentPaymentMethodDataUsBankAccount`'s `account_holder_type` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CreatePaymentIntentPaymentMethodDataUsBankAccountAccountHolderType { - Company, - Individual, -} - -impl CreatePaymentIntentPaymentMethodDataUsBankAccountAccountHolderType { - pub fn as_str(self) -> &'static str { - match self { - CreatePaymentIntentPaymentMethodDataUsBankAccountAccountHolderType::Company => { - "company" - } - CreatePaymentIntentPaymentMethodDataUsBankAccountAccountHolderType::Individual => { - "individual" - } - } - } -} - -impl AsRef for CreatePaymentIntentPaymentMethodDataUsBankAccountAccountHolderType { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for CreatePaymentIntentPaymentMethodDataUsBankAccountAccountHolderType { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for CreatePaymentIntentPaymentMethodDataUsBankAccountAccountHolderType { - fn default() -> Self { - Self::Company - } -} - -/// An enum representing the possible values of an `CreatePaymentIntentPaymentMethodDataUsBankAccount`'s `account_type` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CreatePaymentIntentPaymentMethodDataUsBankAccountAccountType { - Checking, - Savings, -} - -impl CreatePaymentIntentPaymentMethodDataUsBankAccountAccountType { - pub fn as_str(self) -> &'static str { - match self { - CreatePaymentIntentPaymentMethodDataUsBankAccountAccountType::Checking => "checking", - CreatePaymentIntentPaymentMethodDataUsBankAccountAccountType::Savings => "savings", - } - } -} - -impl AsRef for CreatePaymentIntentPaymentMethodDataUsBankAccountAccountType { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for CreatePaymentIntentPaymentMethodDataUsBankAccountAccountType { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for CreatePaymentIntentPaymentMethodDataUsBankAccountAccountType { - fn default() -> Self { - Self::Checking - } -} - -/// An enum representing the possible values of an `CreatePaymentIntentPaymentMethodOptionsAcssDebitMandateOptions`'s `payment_schedule` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CreatePaymentIntentPaymentMethodOptionsAcssDebitMandateOptionsPaymentSchedule { - Combined, - Interval, - Sporadic, -} - -impl CreatePaymentIntentPaymentMethodOptionsAcssDebitMandateOptionsPaymentSchedule { - pub fn as_str(self) -> &'static str { - match self { - CreatePaymentIntentPaymentMethodOptionsAcssDebitMandateOptionsPaymentSchedule::Combined => "combined", - CreatePaymentIntentPaymentMethodOptionsAcssDebitMandateOptionsPaymentSchedule::Interval => "interval", - CreatePaymentIntentPaymentMethodOptionsAcssDebitMandateOptionsPaymentSchedule::Sporadic => "sporadic", - } - } -} - -impl AsRef for CreatePaymentIntentPaymentMethodOptionsAcssDebitMandateOptionsPaymentSchedule { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display - for CreatePaymentIntentPaymentMethodOptionsAcssDebitMandateOptionsPaymentSchedule -{ - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default - for CreatePaymentIntentPaymentMethodOptionsAcssDebitMandateOptionsPaymentSchedule -{ - fn default() -> Self { - Self::Combined - } -} - -/// An enum representing the possible values of an `CreatePaymentIntentPaymentMethodOptionsAcssDebitMandateOptions`'s `transaction_type` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CreatePaymentIntentPaymentMethodOptionsAcssDebitMandateOptionsTransactionType { - Business, - Personal, -} - -impl CreatePaymentIntentPaymentMethodOptionsAcssDebitMandateOptionsTransactionType { - pub fn as_str(self) -> &'static str { - match self { - CreatePaymentIntentPaymentMethodOptionsAcssDebitMandateOptionsTransactionType::Business => "business", - CreatePaymentIntentPaymentMethodOptionsAcssDebitMandateOptionsTransactionType::Personal => "personal", - } - } -} - -impl AsRef for CreatePaymentIntentPaymentMethodOptionsAcssDebitMandateOptionsTransactionType { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display - for CreatePaymentIntentPaymentMethodOptionsAcssDebitMandateOptionsTransactionType -{ - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default - for CreatePaymentIntentPaymentMethodOptionsAcssDebitMandateOptionsTransactionType -{ - fn default() -> Self { - Self::Business - } -} - -/// An enum representing the possible values of an `CreatePaymentIntentPaymentMethodOptionsAcssDebit`'s `setup_future_usage` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CreatePaymentIntentPaymentMethodOptionsAcssDebitSetupFutureUsage { - None, - OffSession, - OnSession, -} - -impl CreatePaymentIntentPaymentMethodOptionsAcssDebitSetupFutureUsage { - pub fn as_str(self) -> &'static str { - match self { - CreatePaymentIntentPaymentMethodOptionsAcssDebitSetupFutureUsage::None => "none", - CreatePaymentIntentPaymentMethodOptionsAcssDebitSetupFutureUsage::OffSession => { - "off_session" - } - CreatePaymentIntentPaymentMethodOptionsAcssDebitSetupFutureUsage::OnSession => { - "on_session" - } - } - } -} - -impl AsRef for CreatePaymentIntentPaymentMethodOptionsAcssDebitSetupFutureUsage { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for CreatePaymentIntentPaymentMethodOptionsAcssDebitSetupFutureUsage { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for CreatePaymentIntentPaymentMethodOptionsAcssDebitSetupFutureUsage { - fn default() -> Self { - Self::None - } -} - -/// An enum representing the possible values of an `CreatePaymentIntentPaymentMethodOptionsAcssDebit`'s `verification_method` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CreatePaymentIntentPaymentMethodOptionsAcssDebitVerificationMethod { - Automatic, - Instant, - Microdeposits, -} - -impl CreatePaymentIntentPaymentMethodOptionsAcssDebitVerificationMethod { - pub fn as_str(self) -> &'static str { - match self { - CreatePaymentIntentPaymentMethodOptionsAcssDebitVerificationMethod::Automatic => { - "automatic" - } - CreatePaymentIntentPaymentMethodOptionsAcssDebitVerificationMethod::Instant => { - "instant" - } - CreatePaymentIntentPaymentMethodOptionsAcssDebitVerificationMethod::Microdeposits => { - "microdeposits" - } - } - } -} - -impl AsRef for CreatePaymentIntentPaymentMethodOptionsAcssDebitVerificationMethod { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for CreatePaymentIntentPaymentMethodOptionsAcssDebitVerificationMethod { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for CreatePaymentIntentPaymentMethodOptionsAcssDebitVerificationMethod { - fn default() -> Self { - Self::Automatic - } -} - -/// An enum representing the possible values of an `CreatePaymentIntentPaymentMethodOptionsAffirm`'s `capture_method` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CreatePaymentIntentPaymentMethodOptionsAffirmCaptureMethod { - Manual, -} - -impl CreatePaymentIntentPaymentMethodOptionsAffirmCaptureMethod { - pub fn as_str(self) -> &'static str { - match self { - CreatePaymentIntentPaymentMethodOptionsAffirmCaptureMethod::Manual => "manual", - } - } -} - -impl AsRef for CreatePaymentIntentPaymentMethodOptionsAffirmCaptureMethod { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for CreatePaymentIntentPaymentMethodOptionsAffirmCaptureMethod { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for CreatePaymentIntentPaymentMethodOptionsAffirmCaptureMethod { - fn default() -> Self { - Self::Manual - } -} - -/// An enum representing the possible values of an `CreatePaymentIntentPaymentMethodOptionsAffirm`'s `setup_future_usage` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CreatePaymentIntentPaymentMethodOptionsAffirmSetupFutureUsage { - None, -} - -impl CreatePaymentIntentPaymentMethodOptionsAffirmSetupFutureUsage { - pub fn as_str(self) -> &'static str { - match self { - CreatePaymentIntentPaymentMethodOptionsAffirmSetupFutureUsage::None => "none", - } - } -} - -impl AsRef for CreatePaymentIntentPaymentMethodOptionsAffirmSetupFutureUsage { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for CreatePaymentIntentPaymentMethodOptionsAffirmSetupFutureUsage { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for CreatePaymentIntentPaymentMethodOptionsAffirmSetupFutureUsage { - fn default() -> Self { - Self::None - } -} - -/// An enum representing the possible values of an `CreatePaymentIntentPaymentMethodOptionsAfterpayClearpay`'s `capture_method` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CreatePaymentIntentPaymentMethodOptionsAfterpayClearpayCaptureMethod { - Manual, -} - -impl CreatePaymentIntentPaymentMethodOptionsAfterpayClearpayCaptureMethod { - pub fn as_str(self) -> &'static str { - match self { - CreatePaymentIntentPaymentMethodOptionsAfterpayClearpayCaptureMethod::Manual => { - "manual" - } - } - } -} - -impl AsRef for CreatePaymentIntentPaymentMethodOptionsAfterpayClearpayCaptureMethod { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for CreatePaymentIntentPaymentMethodOptionsAfterpayClearpayCaptureMethod { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default - for CreatePaymentIntentPaymentMethodOptionsAfterpayClearpayCaptureMethod -{ - fn default() -> Self { - Self::Manual - } -} - -/// An enum representing the possible values of an `CreatePaymentIntentPaymentMethodOptionsAfterpayClearpay`'s `setup_future_usage` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CreatePaymentIntentPaymentMethodOptionsAfterpayClearpaySetupFutureUsage { - None, -} - -impl CreatePaymentIntentPaymentMethodOptionsAfterpayClearpaySetupFutureUsage { - pub fn as_str(self) -> &'static str { - match self { - CreatePaymentIntentPaymentMethodOptionsAfterpayClearpaySetupFutureUsage::None => "none", - } - } -} - -impl AsRef for CreatePaymentIntentPaymentMethodOptionsAfterpayClearpaySetupFutureUsage { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for CreatePaymentIntentPaymentMethodOptionsAfterpayClearpaySetupFutureUsage { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default - for CreatePaymentIntentPaymentMethodOptionsAfterpayClearpaySetupFutureUsage -{ - fn default() -> Self { - Self::None - } -} - -/// An enum representing the possible values of an `CreatePaymentIntentPaymentMethodOptionsAlipay`'s `setup_future_usage` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CreatePaymentIntentPaymentMethodOptionsAlipaySetupFutureUsage { - None, - OffSession, -} - -impl CreatePaymentIntentPaymentMethodOptionsAlipaySetupFutureUsage { - pub fn as_str(self) -> &'static str { - match self { - CreatePaymentIntentPaymentMethodOptionsAlipaySetupFutureUsage::None => "none", - CreatePaymentIntentPaymentMethodOptionsAlipaySetupFutureUsage::OffSession => { - "off_session" - } - } - } -} - -impl AsRef for CreatePaymentIntentPaymentMethodOptionsAlipaySetupFutureUsage { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for CreatePaymentIntentPaymentMethodOptionsAlipaySetupFutureUsage { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for CreatePaymentIntentPaymentMethodOptionsAlipaySetupFutureUsage { - fn default() -> Self { - Self::None - } -} - -/// An enum representing the possible values of an `CreatePaymentIntentPaymentMethodOptionsAuBecsDebit`'s `setup_future_usage` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CreatePaymentIntentPaymentMethodOptionsAuBecsDebitSetupFutureUsage { - None, - OffSession, - OnSession, -} - -impl CreatePaymentIntentPaymentMethodOptionsAuBecsDebitSetupFutureUsage { - pub fn as_str(self) -> &'static str { - match self { - CreatePaymentIntentPaymentMethodOptionsAuBecsDebitSetupFutureUsage::None => "none", - CreatePaymentIntentPaymentMethodOptionsAuBecsDebitSetupFutureUsage::OffSession => { - "off_session" - } - CreatePaymentIntentPaymentMethodOptionsAuBecsDebitSetupFutureUsage::OnSession => { - "on_session" - } - } - } -} - -impl AsRef for CreatePaymentIntentPaymentMethodOptionsAuBecsDebitSetupFutureUsage { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for CreatePaymentIntentPaymentMethodOptionsAuBecsDebitSetupFutureUsage { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for CreatePaymentIntentPaymentMethodOptionsAuBecsDebitSetupFutureUsage { - fn default() -> Self { - Self::None - } -} - -/// An enum representing the possible values of an `CreatePaymentIntentPaymentMethodOptionsBacsDebit`'s `setup_future_usage` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CreatePaymentIntentPaymentMethodOptionsBacsDebitSetupFutureUsage { - None, - OffSession, - OnSession, -} - -impl CreatePaymentIntentPaymentMethodOptionsBacsDebitSetupFutureUsage { - pub fn as_str(self) -> &'static str { - match self { - CreatePaymentIntentPaymentMethodOptionsBacsDebitSetupFutureUsage::None => "none", - CreatePaymentIntentPaymentMethodOptionsBacsDebitSetupFutureUsage::OffSession => { - "off_session" - } - CreatePaymentIntentPaymentMethodOptionsBacsDebitSetupFutureUsage::OnSession => { - "on_session" - } - } - } -} - -impl AsRef for CreatePaymentIntentPaymentMethodOptionsBacsDebitSetupFutureUsage { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for CreatePaymentIntentPaymentMethodOptionsBacsDebitSetupFutureUsage { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for CreatePaymentIntentPaymentMethodOptionsBacsDebitSetupFutureUsage { - fn default() -> Self { - Self::None - } -} - -/// An enum representing the possible values of an `CreatePaymentIntentPaymentMethodOptionsBancontact`'s `preferred_language` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CreatePaymentIntentPaymentMethodOptionsBancontactPreferredLanguage { - De, - En, - Fr, - Nl, -} - -impl CreatePaymentIntentPaymentMethodOptionsBancontactPreferredLanguage { - pub fn as_str(self) -> &'static str { - match self { - CreatePaymentIntentPaymentMethodOptionsBancontactPreferredLanguage::De => "de", - CreatePaymentIntentPaymentMethodOptionsBancontactPreferredLanguage::En => "en", - CreatePaymentIntentPaymentMethodOptionsBancontactPreferredLanguage::Fr => "fr", - CreatePaymentIntentPaymentMethodOptionsBancontactPreferredLanguage::Nl => "nl", - } - } -} - -impl AsRef for CreatePaymentIntentPaymentMethodOptionsBancontactPreferredLanguage { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for CreatePaymentIntentPaymentMethodOptionsBancontactPreferredLanguage { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for CreatePaymentIntentPaymentMethodOptionsBancontactPreferredLanguage { - fn default() -> Self { - Self::De - } -} - -/// An enum representing the possible values of an `CreatePaymentIntentPaymentMethodOptionsBancontact`'s `setup_future_usage` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CreatePaymentIntentPaymentMethodOptionsBancontactSetupFutureUsage { - None, - OffSession, -} - -impl CreatePaymentIntentPaymentMethodOptionsBancontactSetupFutureUsage { - pub fn as_str(self) -> &'static str { - match self { - CreatePaymentIntentPaymentMethodOptionsBancontactSetupFutureUsage::None => "none", - CreatePaymentIntentPaymentMethodOptionsBancontactSetupFutureUsage::OffSession => { - "off_session" - } - } - } -} - -impl AsRef for CreatePaymentIntentPaymentMethodOptionsBancontactSetupFutureUsage { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for CreatePaymentIntentPaymentMethodOptionsBancontactSetupFutureUsage { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for CreatePaymentIntentPaymentMethodOptionsBancontactSetupFutureUsage { - fn default() -> Self { - Self::None - } -} - -/// An enum representing the possible values of an `CreatePaymentIntentPaymentMethodOptionsBlik`'s `setup_future_usage` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CreatePaymentIntentPaymentMethodOptionsBlikSetupFutureUsage { - None, -} - -impl CreatePaymentIntentPaymentMethodOptionsBlikSetupFutureUsage { - pub fn as_str(self) -> &'static str { - match self { - CreatePaymentIntentPaymentMethodOptionsBlikSetupFutureUsage::None => "none", - } - } -} - -impl AsRef for CreatePaymentIntentPaymentMethodOptionsBlikSetupFutureUsage { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for CreatePaymentIntentPaymentMethodOptionsBlikSetupFutureUsage { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for CreatePaymentIntentPaymentMethodOptionsBlikSetupFutureUsage { - fn default() -> Self { - Self::None - } -} - -/// An enum representing the possible values of an `CreatePaymentIntentPaymentMethodOptionsBoleto`'s `setup_future_usage` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CreatePaymentIntentPaymentMethodOptionsBoletoSetupFutureUsage { - None, - OffSession, - OnSession, -} - -impl CreatePaymentIntentPaymentMethodOptionsBoletoSetupFutureUsage { - pub fn as_str(self) -> &'static str { - match self { - CreatePaymentIntentPaymentMethodOptionsBoletoSetupFutureUsage::None => "none", - CreatePaymentIntentPaymentMethodOptionsBoletoSetupFutureUsage::OffSession => { - "off_session" - } - CreatePaymentIntentPaymentMethodOptionsBoletoSetupFutureUsage::OnSession => { - "on_session" - } - } - } -} - -impl AsRef for CreatePaymentIntentPaymentMethodOptionsBoletoSetupFutureUsage { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for CreatePaymentIntentPaymentMethodOptionsBoletoSetupFutureUsage { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for CreatePaymentIntentPaymentMethodOptionsBoletoSetupFutureUsage { - fn default() -> Self { - Self::None - } -} - -/// An enum representing the possible values of an `CreatePaymentIntentPaymentMethodOptionsCard`'s `capture_method` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CreatePaymentIntentPaymentMethodOptionsCardCaptureMethod { - Manual, -} - -impl CreatePaymentIntentPaymentMethodOptionsCardCaptureMethod { - pub fn as_str(self) -> &'static str { - match self { - CreatePaymentIntentPaymentMethodOptionsCardCaptureMethod::Manual => "manual", - } - } -} - -impl AsRef for CreatePaymentIntentPaymentMethodOptionsCardCaptureMethod { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for CreatePaymentIntentPaymentMethodOptionsCardCaptureMethod { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for CreatePaymentIntentPaymentMethodOptionsCardCaptureMethod { - fn default() -> Self { - Self::Manual - } -} - -/// An enum representing the possible values of an `CreatePaymentIntentPaymentMethodOptionsCardInstallmentsPlan`'s `interval` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CreatePaymentIntentPaymentMethodOptionsCardInstallmentsPlanInterval { - Month, -} - -impl CreatePaymentIntentPaymentMethodOptionsCardInstallmentsPlanInterval { - pub fn as_str(self) -> &'static str { - match self { - CreatePaymentIntentPaymentMethodOptionsCardInstallmentsPlanInterval::Month => "month", - } - } -} - -impl AsRef for CreatePaymentIntentPaymentMethodOptionsCardInstallmentsPlanInterval { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for CreatePaymentIntentPaymentMethodOptionsCardInstallmentsPlanInterval { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for CreatePaymentIntentPaymentMethodOptionsCardInstallmentsPlanInterval { - fn default() -> Self { - Self::Month - } -} - -/// An enum representing the possible values of an `CreatePaymentIntentPaymentMethodOptionsCardInstallmentsPlan`'s `type` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CreatePaymentIntentPaymentMethodOptionsCardInstallmentsPlanType { - FixedCount, -} - -impl CreatePaymentIntentPaymentMethodOptionsCardInstallmentsPlanType { - pub fn as_str(self) -> &'static str { - match self { - CreatePaymentIntentPaymentMethodOptionsCardInstallmentsPlanType::FixedCount => { - "fixed_count" - } - } - } -} - -impl AsRef for CreatePaymentIntentPaymentMethodOptionsCardInstallmentsPlanType { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for CreatePaymentIntentPaymentMethodOptionsCardInstallmentsPlanType { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for CreatePaymentIntentPaymentMethodOptionsCardInstallmentsPlanType { - fn default() -> Self { - Self::FixedCount - } -} - -/// An enum representing the possible values of an `CreatePaymentIntentPaymentMethodOptionsCardMandateOptions`'s `amount_type` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CreatePaymentIntentPaymentMethodOptionsCardMandateOptionsAmountType { - Fixed, - Maximum, -} - -impl CreatePaymentIntentPaymentMethodOptionsCardMandateOptionsAmountType { - pub fn as_str(self) -> &'static str { - match self { - CreatePaymentIntentPaymentMethodOptionsCardMandateOptionsAmountType::Fixed => "fixed", - CreatePaymentIntentPaymentMethodOptionsCardMandateOptionsAmountType::Maximum => { - "maximum" - } - } - } -} - -impl AsRef for CreatePaymentIntentPaymentMethodOptionsCardMandateOptionsAmountType { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for CreatePaymentIntentPaymentMethodOptionsCardMandateOptionsAmountType { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for CreatePaymentIntentPaymentMethodOptionsCardMandateOptionsAmountType { - fn default() -> Self { - Self::Fixed - } -} - -/// An enum representing the possible values of an `CreatePaymentIntentPaymentMethodOptionsCardMandateOptions`'s `interval` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CreatePaymentIntentPaymentMethodOptionsCardMandateOptionsInterval { - Day, - Month, - Sporadic, - Week, - Year, -} - -impl CreatePaymentIntentPaymentMethodOptionsCardMandateOptionsInterval { - pub fn as_str(self) -> &'static str { - match self { - CreatePaymentIntentPaymentMethodOptionsCardMandateOptionsInterval::Day => "day", - CreatePaymentIntentPaymentMethodOptionsCardMandateOptionsInterval::Month => "month", - CreatePaymentIntentPaymentMethodOptionsCardMandateOptionsInterval::Sporadic => { - "sporadic" - } - CreatePaymentIntentPaymentMethodOptionsCardMandateOptionsInterval::Week => "week", - CreatePaymentIntentPaymentMethodOptionsCardMandateOptionsInterval::Year => "year", - } - } -} - -impl AsRef for CreatePaymentIntentPaymentMethodOptionsCardMandateOptionsInterval { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for CreatePaymentIntentPaymentMethodOptionsCardMandateOptionsInterval { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for CreatePaymentIntentPaymentMethodOptionsCardMandateOptionsInterval { - fn default() -> Self { - Self::Day - } -} - -/// An enum representing the possible values of an `CreatePaymentIntentPaymentMethodOptionsCardMandateOptions`'s `supported_types` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CreatePaymentIntentPaymentMethodOptionsCardMandateOptionsSupportedTypes { - India, -} - -impl CreatePaymentIntentPaymentMethodOptionsCardMandateOptionsSupportedTypes { - pub fn as_str(self) -> &'static str { - match self { - CreatePaymentIntentPaymentMethodOptionsCardMandateOptionsSupportedTypes::India => { - "india" - } - } - } -} - -impl AsRef for CreatePaymentIntentPaymentMethodOptionsCardMandateOptionsSupportedTypes { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for CreatePaymentIntentPaymentMethodOptionsCardMandateOptionsSupportedTypes { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default - for CreatePaymentIntentPaymentMethodOptionsCardMandateOptionsSupportedTypes -{ - fn default() -> Self { - Self::India - } -} - -/// An enum representing the possible values of an `CreatePaymentIntentPaymentMethodOptionsCard`'s `network` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CreatePaymentIntentPaymentMethodOptionsCardNetwork { - Amex, - CartesBancaires, - Diners, - Discover, - EftposAu, - Interac, - Jcb, - Mastercard, - Unionpay, - Unknown, - Visa, -} - -impl CreatePaymentIntentPaymentMethodOptionsCardNetwork { - pub fn as_str(self) -> &'static str { - match self { - CreatePaymentIntentPaymentMethodOptionsCardNetwork::Amex => "amex", - CreatePaymentIntentPaymentMethodOptionsCardNetwork::CartesBancaires => { - "cartes_bancaires" - } - CreatePaymentIntentPaymentMethodOptionsCardNetwork::Diners => "diners", - CreatePaymentIntentPaymentMethodOptionsCardNetwork::Discover => "discover", - CreatePaymentIntentPaymentMethodOptionsCardNetwork::EftposAu => "eftpos_au", - CreatePaymentIntentPaymentMethodOptionsCardNetwork::Interac => "interac", - CreatePaymentIntentPaymentMethodOptionsCardNetwork::Jcb => "jcb", - CreatePaymentIntentPaymentMethodOptionsCardNetwork::Mastercard => "mastercard", - CreatePaymentIntentPaymentMethodOptionsCardNetwork::Unionpay => "unionpay", - CreatePaymentIntentPaymentMethodOptionsCardNetwork::Unknown => "unknown", - CreatePaymentIntentPaymentMethodOptionsCardNetwork::Visa => "visa", - } - } -} - -impl AsRef for CreatePaymentIntentPaymentMethodOptionsCardNetwork { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for CreatePaymentIntentPaymentMethodOptionsCardNetwork { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for CreatePaymentIntentPaymentMethodOptionsCardNetwork { - fn default() -> Self { - Self::Amex - } -} - -/// An enum representing the possible values of an `CreatePaymentIntentPaymentMethodOptionsCard`'s `request_extended_authorization` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CreatePaymentIntentPaymentMethodOptionsCardRequestExtendedAuthorization { - IfAvailable, - Never, -} - -impl CreatePaymentIntentPaymentMethodOptionsCardRequestExtendedAuthorization { - pub fn as_str(self) -> &'static str { - match self { - CreatePaymentIntentPaymentMethodOptionsCardRequestExtendedAuthorization::IfAvailable => "if_available", - CreatePaymentIntentPaymentMethodOptionsCardRequestExtendedAuthorization::Never => "never", - } - } -} - -impl AsRef for CreatePaymentIntentPaymentMethodOptionsCardRequestExtendedAuthorization { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for CreatePaymentIntentPaymentMethodOptionsCardRequestExtendedAuthorization { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default - for CreatePaymentIntentPaymentMethodOptionsCardRequestExtendedAuthorization -{ - fn default() -> Self { - Self::IfAvailable - } -} - -/// An enum representing the possible values of an `CreatePaymentIntentPaymentMethodOptionsCard`'s `request_incremental_authorization` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CreatePaymentIntentPaymentMethodOptionsCardRequestIncrementalAuthorization { - IfAvailable, - Never, -} - -impl CreatePaymentIntentPaymentMethodOptionsCardRequestIncrementalAuthorization { - pub fn as_str(self) -> &'static str { - match self { - CreatePaymentIntentPaymentMethodOptionsCardRequestIncrementalAuthorization::IfAvailable => "if_available", - CreatePaymentIntentPaymentMethodOptionsCardRequestIncrementalAuthorization::Never => "never", - } - } -} - -impl AsRef for CreatePaymentIntentPaymentMethodOptionsCardRequestIncrementalAuthorization { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display - for CreatePaymentIntentPaymentMethodOptionsCardRequestIncrementalAuthorization -{ - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default - for CreatePaymentIntentPaymentMethodOptionsCardRequestIncrementalAuthorization -{ - fn default() -> Self { - Self::IfAvailable - } -} - -/// An enum representing the possible values of an `CreatePaymentIntentPaymentMethodOptionsCard`'s `request_multicapture` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CreatePaymentIntentPaymentMethodOptionsCardRequestMulticapture { - IfAvailable, - Never, -} - -impl CreatePaymentIntentPaymentMethodOptionsCardRequestMulticapture { - pub fn as_str(self) -> &'static str { - match self { - CreatePaymentIntentPaymentMethodOptionsCardRequestMulticapture::IfAvailable => { - "if_available" - } - CreatePaymentIntentPaymentMethodOptionsCardRequestMulticapture::Never => "never", - } - } -} - -impl AsRef for CreatePaymentIntentPaymentMethodOptionsCardRequestMulticapture { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for CreatePaymentIntentPaymentMethodOptionsCardRequestMulticapture { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for CreatePaymentIntentPaymentMethodOptionsCardRequestMulticapture { - fn default() -> Self { - Self::IfAvailable - } -} - -/// An enum representing the possible values of an `CreatePaymentIntentPaymentMethodOptionsCard`'s `request_overcapture` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CreatePaymentIntentPaymentMethodOptionsCardRequestOvercapture { - IfAvailable, - Never, -} - -impl CreatePaymentIntentPaymentMethodOptionsCardRequestOvercapture { - pub fn as_str(self) -> &'static str { - match self { - CreatePaymentIntentPaymentMethodOptionsCardRequestOvercapture::IfAvailable => { - "if_available" - } - CreatePaymentIntentPaymentMethodOptionsCardRequestOvercapture::Never => "never", - } - } -} - -impl AsRef for CreatePaymentIntentPaymentMethodOptionsCardRequestOvercapture { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for CreatePaymentIntentPaymentMethodOptionsCardRequestOvercapture { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for CreatePaymentIntentPaymentMethodOptionsCardRequestOvercapture { - fn default() -> Self { - Self::IfAvailable - } -} - -/// An enum representing the possible values of an `CreatePaymentIntentPaymentMethodOptionsCard`'s `request_three_d_secure` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CreatePaymentIntentPaymentMethodOptionsCardRequestThreeDSecure { - Any, - Automatic, - Challenge, -} - -impl CreatePaymentIntentPaymentMethodOptionsCardRequestThreeDSecure { - pub fn as_str(self) -> &'static str { - match self { - CreatePaymentIntentPaymentMethodOptionsCardRequestThreeDSecure::Any => "any", - CreatePaymentIntentPaymentMethodOptionsCardRequestThreeDSecure::Automatic => { - "automatic" - } - CreatePaymentIntentPaymentMethodOptionsCardRequestThreeDSecure::Challenge => { - "challenge" - } - } - } -} - -impl AsRef for CreatePaymentIntentPaymentMethodOptionsCardRequestThreeDSecure { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for CreatePaymentIntentPaymentMethodOptionsCardRequestThreeDSecure { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for CreatePaymentIntentPaymentMethodOptionsCardRequestThreeDSecure { - fn default() -> Self { - Self::Any - } -} - -/// An enum representing the possible values of an `CreatePaymentIntentPaymentMethodOptionsCard`'s `setup_future_usage` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CreatePaymentIntentPaymentMethodOptionsCardSetupFutureUsage { - None, - OffSession, - OnSession, -} - -impl CreatePaymentIntentPaymentMethodOptionsCardSetupFutureUsage { - pub fn as_str(self) -> &'static str { - match self { - CreatePaymentIntentPaymentMethodOptionsCardSetupFutureUsage::None => "none", - CreatePaymentIntentPaymentMethodOptionsCardSetupFutureUsage::OffSession => { - "off_session" - } - CreatePaymentIntentPaymentMethodOptionsCardSetupFutureUsage::OnSession => "on_session", - } - } -} - -impl AsRef for CreatePaymentIntentPaymentMethodOptionsCardSetupFutureUsage { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for CreatePaymentIntentPaymentMethodOptionsCardSetupFutureUsage { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for CreatePaymentIntentPaymentMethodOptionsCardSetupFutureUsage { - fn default() -> Self { - Self::None - } -} - -/// An enum representing the possible values of an `CreatePaymentIntentPaymentMethodOptionsCardThreeDSecure`'s `ares_trans_status` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CreatePaymentIntentPaymentMethodOptionsCardThreeDSecureAresTransStatus { - #[serde(rename = "A")] - A, - #[serde(rename = "C")] - C, - #[serde(rename = "I")] - I, - #[serde(rename = "N")] - N, - #[serde(rename = "R")] - R, - #[serde(rename = "U")] - U, - #[serde(rename = "Y")] - Y, -} - -impl CreatePaymentIntentPaymentMethodOptionsCardThreeDSecureAresTransStatus { - pub fn as_str(self) -> &'static str { - match self { - CreatePaymentIntentPaymentMethodOptionsCardThreeDSecureAresTransStatus::A => "A", - CreatePaymentIntentPaymentMethodOptionsCardThreeDSecureAresTransStatus::C => "C", - CreatePaymentIntentPaymentMethodOptionsCardThreeDSecureAresTransStatus::I => "I", - CreatePaymentIntentPaymentMethodOptionsCardThreeDSecureAresTransStatus::N => "N", - CreatePaymentIntentPaymentMethodOptionsCardThreeDSecureAresTransStatus::R => "R", - CreatePaymentIntentPaymentMethodOptionsCardThreeDSecureAresTransStatus::U => "U", - CreatePaymentIntentPaymentMethodOptionsCardThreeDSecureAresTransStatus::Y => "Y", - } - } -} - -impl AsRef for CreatePaymentIntentPaymentMethodOptionsCardThreeDSecureAresTransStatus { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for CreatePaymentIntentPaymentMethodOptionsCardThreeDSecureAresTransStatus { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default - for CreatePaymentIntentPaymentMethodOptionsCardThreeDSecureAresTransStatus -{ - fn default() -> Self { - Self::A - } -} - -/// An enum representing the possible values of an `CreatePaymentIntentPaymentMethodOptionsCardThreeDSecure`'s `electronic_commerce_indicator` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CreatePaymentIntentPaymentMethodOptionsCardThreeDSecureElectronicCommerceIndicator { - #[serde(rename = "01")] - V01, - #[serde(rename = "02")] - V02, - #[serde(rename = "05")] - V05, - #[serde(rename = "06")] - V06, - #[serde(rename = "07")] - V07, -} - -impl CreatePaymentIntentPaymentMethodOptionsCardThreeDSecureElectronicCommerceIndicator { - pub fn as_str(self) -> &'static str { - match self { - CreatePaymentIntentPaymentMethodOptionsCardThreeDSecureElectronicCommerceIndicator::V01 => "01", - CreatePaymentIntentPaymentMethodOptionsCardThreeDSecureElectronicCommerceIndicator::V02 => "02", - CreatePaymentIntentPaymentMethodOptionsCardThreeDSecureElectronicCommerceIndicator::V05 => "05", - CreatePaymentIntentPaymentMethodOptionsCardThreeDSecureElectronicCommerceIndicator::V06 => "06", - CreatePaymentIntentPaymentMethodOptionsCardThreeDSecureElectronicCommerceIndicator::V07 => "07", - } - } -} - -impl AsRef - for CreatePaymentIntentPaymentMethodOptionsCardThreeDSecureElectronicCommerceIndicator -{ - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display - for CreatePaymentIntentPaymentMethodOptionsCardThreeDSecureElectronicCommerceIndicator -{ - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default - for CreatePaymentIntentPaymentMethodOptionsCardThreeDSecureElectronicCommerceIndicator -{ - fn default() -> Self { - Self::V01 - } -} - -/// An enum representing the possible values of an `CreatePaymentIntentPaymentMethodOptionsCardThreeDSecure`'s `exemption_indicator` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CreatePaymentIntentPaymentMethodOptionsCardThreeDSecureExemptionIndicator { - LowRisk, - None, -} - -impl CreatePaymentIntentPaymentMethodOptionsCardThreeDSecureExemptionIndicator { - pub fn as_str(self) -> &'static str { - match self { - CreatePaymentIntentPaymentMethodOptionsCardThreeDSecureExemptionIndicator::LowRisk => { - "low_risk" - } - CreatePaymentIntentPaymentMethodOptionsCardThreeDSecureExemptionIndicator::None => { - "none" - } - } - } -} - -impl AsRef for CreatePaymentIntentPaymentMethodOptionsCardThreeDSecureExemptionIndicator { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display - for CreatePaymentIntentPaymentMethodOptionsCardThreeDSecureExemptionIndicator -{ - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default - for CreatePaymentIntentPaymentMethodOptionsCardThreeDSecureExemptionIndicator -{ - fn default() -> Self { - Self::LowRisk - } -} - -/// An enum representing the possible values of an `CreatePaymentIntentPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancaires`'s `cb_avalgo` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CreatePaymentIntentPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancairesCbAvalgo -{ - #[serde(rename = "0")] - V0, - #[serde(rename = "1")] - V1, - #[serde(rename = "2")] - V2, - #[serde(rename = "3")] - V3, - #[serde(rename = "4")] - V4, - #[serde(rename = "A")] - A, -} - -impl CreatePaymentIntentPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancairesCbAvalgo { - pub fn as_str(self) -> &'static str { - match self { - CreatePaymentIntentPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancairesCbAvalgo::V0 => "0", - CreatePaymentIntentPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancairesCbAvalgo::V1 => "1", - CreatePaymentIntentPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancairesCbAvalgo::V2 => "2", - CreatePaymentIntentPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancairesCbAvalgo::V3 => "3", - CreatePaymentIntentPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancairesCbAvalgo::V4 => "4", - CreatePaymentIntentPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancairesCbAvalgo::A => "A", - } - } -} - -impl AsRef - for CreatePaymentIntentPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancairesCbAvalgo -{ - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display - for CreatePaymentIntentPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancairesCbAvalgo -{ - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default - for CreatePaymentIntentPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancairesCbAvalgo -{ - fn default() -> Self { - Self::V0 - } -} - -/// An enum representing the possible values of an `CreatePaymentIntentPaymentMethodOptionsCardThreeDSecure`'s `version` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CreatePaymentIntentPaymentMethodOptionsCardThreeDSecureVersion { - #[serde(rename = "1.0.2")] - V1_0_2, - #[serde(rename = "2.1.0")] - V2_1_0, - #[serde(rename = "2.2.0")] - V2_2_0, -} - -impl CreatePaymentIntentPaymentMethodOptionsCardThreeDSecureVersion { - pub fn as_str(self) -> &'static str { - match self { - CreatePaymentIntentPaymentMethodOptionsCardThreeDSecureVersion::V1_0_2 => "1.0.2", - CreatePaymentIntentPaymentMethodOptionsCardThreeDSecureVersion::V2_1_0 => "2.1.0", - CreatePaymentIntentPaymentMethodOptionsCardThreeDSecureVersion::V2_2_0 => "2.2.0", - } - } -} - -impl AsRef for CreatePaymentIntentPaymentMethodOptionsCardThreeDSecureVersion { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for CreatePaymentIntentPaymentMethodOptionsCardThreeDSecureVersion { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for CreatePaymentIntentPaymentMethodOptionsCardThreeDSecureVersion { - fn default() -> Self { - Self::V1_0_2 - } -} - -/// An enum representing the possible values of an `CreatePaymentIntentPaymentMethodOptionsCashapp`'s `capture_method` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CreatePaymentIntentPaymentMethodOptionsCashappCaptureMethod { - Manual, -} - -impl CreatePaymentIntentPaymentMethodOptionsCashappCaptureMethod { - pub fn as_str(self) -> &'static str { - match self { - CreatePaymentIntentPaymentMethodOptionsCashappCaptureMethod::Manual => "manual", - } - } -} - -impl AsRef for CreatePaymentIntentPaymentMethodOptionsCashappCaptureMethod { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for CreatePaymentIntentPaymentMethodOptionsCashappCaptureMethod { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for CreatePaymentIntentPaymentMethodOptionsCashappCaptureMethod { - fn default() -> Self { - Self::Manual - } -} - -/// An enum representing the possible values of an `CreatePaymentIntentPaymentMethodOptionsCashapp`'s `setup_future_usage` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CreatePaymentIntentPaymentMethodOptionsCashappSetupFutureUsage { - None, - OffSession, - OnSession, -} - -impl CreatePaymentIntentPaymentMethodOptionsCashappSetupFutureUsage { - pub fn as_str(self) -> &'static str { - match self { - CreatePaymentIntentPaymentMethodOptionsCashappSetupFutureUsage::None => "none", - CreatePaymentIntentPaymentMethodOptionsCashappSetupFutureUsage::OffSession => { - "off_session" - } - CreatePaymentIntentPaymentMethodOptionsCashappSetupFutureUsage::OnSession => { - "on_session" - } - } - } -} - -impl AsRef for CreatePaymentIntentPaymentMethodOptionsCashappSetupFutureUsage { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for CreatePaymentIntentPaymentMethodOptionsCashappSetupFutureUsage { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for CreatePaymentIntentPaymentMethodOptionsCashappSetupFutureUsage { - fn default() -> Self { - Self::None - } -} - -/// An enum representing the possible values of an `CreatePaymentIntentPaymentMethodOptionsCustomerBalanceBankTransfer`'s `requested_address_types` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CreatePaymentIntentPaymentMethodOptionsCustomerBalanceBankTransferRequestedAddressTypes { - Aba, - Iban, - Sepa, - SortCode, - Spei, - Swift, - Zengin, -} - -impl CreatePaymentIntentPaymentMethodOptionsCustomerBalanceBankTransferRequestedAddressTypes { - pub fn as_str(self) -> &'static str { - match self { - CreatePaymentIntentPaymentMethodOptionsCustomerBalanceBankTransferRequestedAddressTypes::Aba => "aba", - CreatePaymentIntentPaymentMethodOptionsCustomerBalanceBankTransferRequestedAddressTypes::Iban => "iban", - CreatePaymentIntentPaymentMethodOptionsCustomerBalanceBankTransferRequestedAddressTypes::Sepa => "sepa", - CreatePaymentIntentPaymentMethodOptionsCustomerBalanceBankTransferRequestedAddressTypes::SortCode => "sort_code", - CreatePaymentIntentPaymentMethodOptionsCustomerBalanceBankTransferRequestedAddressTypes::Spei => "spei", - CreatePaymentIntentPaymentMethodOptionsCustomerBalanceBankTransferRequestedAddressTypes::Swift => "swift", - CreatePaymentIntentPaymentMethodOptionsCustomerBalanceBankTransferRequestedAddressTypes::Zengin => "zengin", - } - } -} - -impl AsRef - for CreatePaymentIntentPaymentMethodOptionsCustomerBalanceBankTransferRequestedAddressTypes -{ - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display - for CreatePaymentIntentPaymentMethodOptionsCustomerBalanceBankTransferRequestedAddressTypes -{ - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default - for CreatePaymentIntentPaymentMethodOptionsCustomerBalanceBankTransferRequestedAddressTypes -{ - fn default() -> Self { - Self::Aba - } -} - -/// An enum representing the possible values of an `CreatePaymentIntentPaymentMethodOptionsCustomerBalanceBankTransfer`'s `type` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CreatePaymentIntentPaymentMethodOptionsCustomerBalanceBankTransferType { - EuBankTransfer, - GbBankTransfer, - JpBankTransfer, - MxBankTransfer, - UsBankTransfer, -} - -impl CreatePaymentIntentPaymentMethodOptionsCustomerBalanceBankTransferType { - pub fn as_str(self) -> &'static str { - match self { - CreatePaymentIntentPaymentMethodOptionsCustomerBalanceBankTransferType::EuBankTransfer => "eu_bank_transfer", - CreatePaymentIntentPaymentMethodOptionsCustomerBalanceBankTransferType::GbBankTransfer => "gb_bank_transfer", - CreatePaymentIntentPaymentMethodOptionsCustomerBalanceBankTransferType::JpBankTransfer => "jp_bank_transfer", - CreatePaymentIntentPaymentMethodOptionsCustomerBalanceBankTransferType::MxBankTransfer => "mx_bank_transfer", - CreatePaymentIntentPaymentMethodOptionsCustomerBalanceBankTransferType::UsBankTransfer => "us_bank_transfer", - } - } -} - -impl AsRef for CreatePaymentIntentPaymentMethodOptionsCustomerBalanceBankTransferType { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for CreatePaymentIntentPaymentMethodOptionsCustomerBalanceBankTransferType { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default - for CreatePaymentIntentPaymentMethodOptionsCustomerBalanceBankTransferType -{ - fn default() -> Self { - Self::EuBankTransfer - } -} - -/// An enum representing the possible values of an `CreatePaymentIntentPaymentMethodOptionsCustomerBalance`'s `funding_type` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CreatePaymentIntentPaymentMethodOptionsCustomerBalanceFundingType { - BankTransfer, -} - -impl CreatePaymentIntentPaymentMethodOptionsCustomerBalanceFundingType { - pub fn as_str(self) -> &'static str { - match self { - CreatePaymentIntentPaymentMethodOptionsCustomerBalanceFundingType::BankTransfer => { - "bank_transfer" - } - } - } -} - -impl AsRef for CreatePaymentIntentPaymentMethodOptionsCustomerBalanceFundingType { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for CreatePaymentIntentPaymentMethodOptionsCustomerBalanceFundingType { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for CreatePaymentIntentPaymentMethodOptionsCustomerBalanceFundingType { - fn default() -> Self { - Self::BankTransfer - } -} - -/// An enum representing the possible values of an `CreatePaymentIntentPaymentMethodOptionsCustomerBalance`'s `setup_future_usage` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CreatePaymentIntentPaymentMethodOptionsCustomerBalanceSetupFutureUsage { - None, -} - -impl CreatePaymentIntentPaymentMethodOptionsCustomerBalanceSetupFutureUsage { - pub fn as_str(self) -> &'static str { - match self { - CreatePaymentIntentPaymentMethodOptionsCustomerBalanceSetupFutureUsage::None => "none", - } - } -} - -impl AsRef for CreatePaymentIntentPaymentMethodOptionsCustomerBalanceSetupFutureUsage { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for CreatePaymentIntentPaymentMethodOptionsCustomerBalanceSetupFutureUsage { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default - for CreatePaymentIntentPaymentMethodOptionsCustomerBalanceSetupFutureUsage -{ - fn default() -> Self { - Self::None - } -} - -/// An enum representing the possible values of an `CreatePaymentIntentPaymentMethodOptionsEps`'s `setup_future_usage` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CreatePaymentIntentPaymentMethodOptionsEpsSetupFutureUsage { - None, -} - -impl CreatePaymentIntentPaymentMethodOptionsEpsSetupFutureUsage { - pub fn as_str(self) -> &'static str { - match self { - CreatePaymentIntentPaymentMethodOptionsEpsSetupFutureUsage::None => "none", - } - } -} - -impl AsRef for CreatePaymentIntentPaymentMethodOptionsEpsSetupFutureUsage { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for CreatePaymentIntentPaymentMethodOptionsEpsSetupFutureUsage { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for CreatePaymentIntentPaymentMethodOptionsEpsSetupFutureUsage { - fn default() -> Self { - Self::None - } -} - -/// An enum representing the possible values of an `CreatePaymentIntentPaymentMethodOptionsFpx`'s `setup_future_usage` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CreatePaymentIntentPaymentMethodOptionsFpxSetupFutureUsage { - None, -} - -impl CreatePaymentIntentPaymentMethodOptionsFpxSetupFutureUsage { - pub fn as_str(self) -> &'static str { - match self { - CreatePaymentIntentPaymentMethodOptionsFpxSetupFutureUsage::None => "none", - } - } -} - -impl AsRef for CreatePaymentIntentPaymentMethodOptionsFpxSetupFutureUsage { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for CreatePaymentIntentPaymentMethodOptionsFpxSetupFutureUsage { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for CreatePaymentIntentPaymentMethodOptionsFpxSetupFutureUsage { - fn default() -> Self { - Self::None - } -} - -/// An enum representing the possible values of an `CreatePaymentIntentPaymentMethodOptionsGiropay`'s `setup_future_usage` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CreatePaymentIntentPaymentMethodOptionsGiropaySetupFutureUsage { - None, -} - -impl CreatePaymentIntentPaymentMethodOptionsGiropaySetupFutureUsage { - pub fn as_str(self) -> &'static str { - match self { - CreatePaymentIntentPaymentMethodOptionsGiropaySetupFutureUsage::None => "none", - } - } -} - -impl AsRef for CreatePaymentIntentPaymentMethodOptionsGiropaySetupFutureUsage { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for CreatePaymentIntentPaymentMethodOptionsGiropaySetupFutureUsage { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for CreatePaymentIntentPaymentMethodOptionsGiropaySetupFutureUsage { - fn default() -> Self { - Self::None - } -} - -/// An enum representing the possible values of an `CreatePaymentIntentPaymentMethodOptionsGrabpay`'s `setup_future_usage` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CreatePaymentIntentPaymentMethodOptionsGrabpaySetupFutureUsage { - None, -} - -impl CreatePaymentIntentPaymentMethodOptionsGrabpaySetupFutureUsage { - pub fn as_str(self) -> &'static str { - match self { - CreatePaymentIntentPaymentMethodOptionsGrabpaySetupFutureUsage::None => "none", - } - } -} - -impl AsRef for CreatePaymentIntentPaymentMethodOptionsGrabpaySetupFutureUsage { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for CreatePaymentIntentPaymentMethodOptionsGrabpaySetupFutureUsage { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for CreatePaymentIntentPaymentMethodOptionsGrabpaySetupFutureUsage { - fn default() -> Self { - Self::None - } -} - -/// An enum representing the possible values of an `CreatePaymentIntentPaymentMethodOptionsIdeal`'s `setup_future_usage` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CreatePaymentIntentPaymentMethodOptionsIdealSetupFutureUsage { - None, - OffSession, -} - -impl CreatePaymentIntentPaymentMethodOptionsIdealSetupFutureUsage { - pub fn as_str(self) -> &'static str { - match self { - CreatePaymentIntentPaymentMethodOptionsIdealSetupFutureUsage::None => "none", - CreatePaymentIntentPaymentMethodOptionsIdealSetupFutureUsage::OffSession => { - "off_session" - } - } - } -} - -impl AsRef for CreatePaymentIntentPaymentMethodOptionsIdealSetupFutureUsage { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for CreatePaymentIntentPaymentMethodOptionsIdealSetupFutureUsage { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for CreatePaymentIntentPaymentMethodOptionsIdealSetupFutureUsage { - fn default() -> Self { - Self::None - } -} - -/// An enum representing the possible values of an `CreatePaymentIntentPaymentMethodOptionsKlarna`'s `capture_method` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CreatePaymentIntentPaymentMethodOptionsKlarnaCaptureMethod { - Manual, -} - -impl CreatePaymentIntentPaymentMethodOptionsKlarnaCaptureMethod { - pub fn as_str(self) -> &'static str { - match self { - CreatePaymentIntentPaymentMethodOptionsKlarnaCaptureMethod::Manual => "manual", - } - } -} - -impl AsRef for CreatePaymentIntentPaymentMethodOptionsKlarnaCaptureMethod { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for CreatePaymentIntentPaymentMethodOptionsKlarnaCaptureMethod { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for CreatePaymentIntentPaymentMethodOptionsKlarnaCaptureMethod { - fn default() -> Self { - Self::Manual - } -} - -/// An enum representing the possible values of an `CreatePaymentIntentPaymentMethodOptionsKlarna`'s `preferred_locale` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CreatePaymentIntentPaymentMethodOptionsKlarnaPreferredLocale { - #[serde(rename = "cs-CZ")] - CsCz, - #[serde(rename = "da-DK")] - DaDk, - #[serde(rename = "de-AT")] - DeAt, - #[serde(rename = "de-CH")] - DeCh, - #[serde(rename = "de-DE")] - DeDe, - #[serde(rename = "el-GR")] - ElGr, - #[serde(rename = "en-AT")] - EnAt, - #[serde(rename = "en-AU")] - EnAu, - #[serde(rename = "en-BE")] - EnBe, - #[serde(rename = "en-CA")] - EnCa, - #[serde(rename = "en-CH")] - EnCh, - #[serde(rename = "en-CZ")] - EnCz, - #[serde(rename = "en-DE")] - EnDe, - #[serde(rename = "en-DK")] - EnDk, - #[serde(rename = "en-ES")] - EnEs, - #[serde(rename = "en-FI")] - EnFi, - #[serde(rename = "en-FR")] - EnFr, - #[serde(rename = "en-GB")] - EnGb, - #[serde(rename = "en-GR")] - EnGr, - #[serde(rename = "en-IE")] - EnIe, - #[serde(rename = "en-IT")] - EnIt, - #[serde(rename = "en-NL")] - EnNl, - #[serde(rename = "en-NO")] - EnNo, - #[serde(rename = "en-NZ")] - EnNz, - #[serde(rename = "en-PL")] - EnPl, - #[serde(rename = "en-PT")] - EnPt, - #[serde(rename = "en-SE")] - EnSe, - #[serde(rename = "en-US")] - EnUs, - #[serde(rename = "es-ES")] - EsEs, - #[serde(rename = "es-US")] - EsUs, - #[serde(rename = "fi-FI")] - FiFi, - #[serde(rename = "fr-BE")] - FrBe, - #[serde(rename = "fr-CA")] - FrCa, - #[serde(rename = "fr-CH")] - FrCh, - #[serde(rename = "fr-FR")] - FrFr, - #[serde(rename = "it-CH")] - ItCh, - #[serde(rename = "it-IT")] - ItIt, - #[serde(rename = "nb-NO")] - NbNo, - #[serde(rename = "nl-BE")] - NlBe, - #[serde(rename = "nl-NL")] - NlNl, - #[serde(rename = "pl-PL")] - PlPl, - #[serde(rename = "pt-PT")] - PtPt, - #[serde(rename = "sv-FI")] - SvFi, - #[serde(rename = "sv-SE")] - SvSe, -} - -impl CreatePaymentIntentPaymentMethodOptionsKlarnaPreferredLocale { - pub fn as_str(self) -> &'static str { - match self { - CreatePaymentIntentPaymentMethodOptionsKlarnaPreferredLocale::CsCz => "cs-CZ", - CreatePaymentIntentPaymentMethodOptionsKlarnaPreferredLocale::DaDk => "da-DK", - CreatePaymentIntentPaymentMethodOptionsKlarnaPreferredLocale::DeAt => "de-AT", - CreatePaymentIntentPaymentMethodOptionsKlarnaPreferredLocale::DeCh => "de-CH", - CreatePaymentIntentPaymentMethodOptionsKlarnaPreferredLocale::DeDe => "de-DE", - CreatePaymentIntentPaymentMethodOptionsKlarnaPreferredLocale::ElGr => "el-GR", - CreatePaymentIntentPaymentMethodOptionsKlarnaPreferredLocale::EnAt => "en-AT", - CreatePaymentIntentPaymentMethodOptionsKlarnaPreferredLocale::EnAu => "en-AU", - CreatePaymentIntentPaymentMethodOptionsKlarnaPreferredLocale::EnBe => "en-BE", - CreatePaymentIntentPaymentMethodOptionsKlarnaPreferredLocale::EnCa => "en-CA", - CreatePaymentIntentPaymentMethodOptionsKlarnaPreferredLocale::EnCh => "en-CH", - CreatePaymentIntentPaymentMethodOptionsKlarnaPreferredLocale::EnCz => "en-CZ", - CreatePaymentIntentPaymentMethodOptionsKlarnaPreferredLocale::EnDe => "en-DE", - CreatePaymentIntentPaymentMethodOptionsKlarnaPreferredLocale::EnDk => "en-DK", - CreatePaymentIntentPaymentMethodOptionsKlarnaPreferredLocale::EnEs => "en-ES", - CreatePaymentIntentPaymentMethodOptionsKlarnaPreferredLocale::EnFi => "en-FI", - CreatePaymentIntentPaymentMethodOptionsKlarnaPreferredLocale::EnFr => "en-FR", - CreatePaymentIntentPaymentMethodOptionsKlarnaPreferredLocale::EnGb => "en-GB", - CreatePaymentIntentPaymentMethodOptionsKlarnaPreferredLocale::EnGr => "en-GR", - CreatePaymentIntentPaymentMethodOptionsKlarnaPreferredLocale::EnIe => "en-IE", - CreatePaymentIntentPaymentMethodOptionsKlarnaPreferredLocale::EnIt => "en-IT", - CreatePaymentIntentPaymentMethodOptionsKlarnaPreferredLocale::EnNl => "en-NL", - CreatePaymentIntentPaymentMethodOptionsKlarnaPreferredLocale::EnNo => "en-NO", - CreatePaymentIntentPaymentMethodOptionsKlarnaPreferredLocale::EnNz => "en-NZ", - CreatePaymentIntentPaymentMethodOptionsKlarnaPreferredLocale::EnPl => "en-PL", - CreatePaymentIntentPaymentMethodOptionsKlarnaPreferredLocale::EnPt => "en-PT", - CreatePaymentIntentPaymentMethodOptionsKlarnaPreferredLocale::EnSe => "en-SE", - CreatePaymentIntentPaymentMethodOptionsKlarnaPreferredLocale::EnUs => "en-US", - CreatePaymentIntentPaymentMethodOptionsKlarnaPreferredLocale::EsEs => "es-ES", - CreatePaymentIntentPaymentMethodOptionsKlarnaPreferredLocale::EsUs => "es-US", - CreatePaymentIntentPaymentMethodOptionsKlarnaPreferredLocale::FiFi => "fi-FI", - CreatePaymentIntentPaymentMethodOptionsKlarnaPreferredLocale::FrBe => "fr-BE", - CreatePaymentIntentPaymentMethodOptionsKlarnaPreferredLocale::FrCa => "fr-CA", - CreatePaymentIntentPaymentMethodOptionsKlarnaPreferredLocale::FrCh => "fr-CH", - CreatePaymentIntentPaymentMethodOptionsKlarnaPreferredLocale::FrFr => "fr-FR", - CreatePaymentIntentPaymentMethodOptionsKlarnaPreferredLocale::ItCh => "it-CH", - CreatePaymentIntentPaymentMethodOptionsKlarnaPreferredLocale::ItIt => "it-IT", - CreatePaymentIntentPaymentMethodOptionsKlarnaPreferredLocale::NbNo => "nb-NO", - CreatePaymentIntentPaymentMethodOptionsKlarnaPreferredLocale::NlBe => "nl-BE", - CreatePaymentIntentPaymentMethodOptionsKlarnaPreferredLocale::NlNl => "nl-NL", - CreatePaymentIntentPaymentMethodOptionsKlarnaPreferredLocale::PlPl => "pl-PL", - CreatePaymentIntentPaymentMethodOptionsKlarnaPreferredLocale::PtPt => "pt-PT", - CreatePaymentIntentPaymentMethodOptionsKlarnaPreferredLocale::SvFi => "sv-FI", - CreatePaymentIntentPaymentMethodOptionsKlarnaPreferredLocale::SvSe => "sv-SE", - } - } -} - -impl AsRef for CreatePaymentIntentPaymentMethodOptionsKlarnaPreferredLocale { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for CreatePaymentIntentPaymentMethodOptionsKlarnaPreferredLocale { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for CreatePaymentIntentPaymentMethodOptionsKlarnaPreferredLocale { - fn default() -> Self { - Self::CsCz - } -} - -/// An enum representing the possible values of an `CreatePaymentIntentPaymentMethodOptionsKlarna`'s `setup_future_usage` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CreatePaymentIntentPaymentMethodOptionsKlarnaSetupFutureUsage { - None, -} - -impl CreatePaymentIntentPaymentMethodOptionsKlarnaSetupFutureUsage { - pub fn as_str(self) -> &'static str { - match self { - CreatePaymentIntentPaymentMethodOptionsKlarnaSetupFutureUsage::None => "none", - } - } -} - -impl AsRef for CreatePaymentIntentPaymentMethodOptionsKlarnaSetupFutureUsage { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for CreatePaymentIntentPaymentMethodOptionsKlarnaSetupFutureUsage { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for CreatePaymentIntentPaymentMethodOptionsKlarnaSetupFutureUsage { - fn default() -> Self { - Self::None - } -} - -/// An enum representing the possible values of an `CreatePaymentIntentPaymentMethodOptionsKonbini`'s `setup_future_usage` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CreatePaymentIntentPaymentMethodOptionsKonbiniSetupFutureUsage { - None, -} - -impl CreatePaymentIntentPaymentMethodOptionsKonbiniSetupFutureUsage { - pub fn as_str(self) -> &'static str { - match self { - CreatePaymentIntentPaymentMethodOptionsKonbiniSetupFutureUsage::None => "none", - } - } -} - -impl AsRef for CreatePaymentIntentPaymentMethodOptionsKonbiniSetupFutureUsage { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for CreatePaymentIntentPaymentMethodOptionsKonbiniSetupFutureUsage { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for CreatePaymentIntentPaymentMethodOptionsKonbiniSetupFutureUsage { - fn default() -> Self { - Self::None - } -} - -/// An enum representing the possible values of an `CreatePaymentIntentPaymentMethodOptionsLink`'s `capture_method` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CreatePaymentIntentPaymentMethodOptionsLinkCaptureMethod { - Manual, -} - -impl CreatePaymentIntentPaymentMethodOptionsLinkCaptureMethod { - pub fn as_str(self) -> &'static str { - match self { - CreatePaymentIntentPaymentMethodOptionsLinkCaptureMethod::Manual => "manual", - } - } -} - -impl AsRef for CreatePaymentIntentPaymentMethodOptionsLinkCaptureMethod { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for CreatePaymentIntentPaymentMethodOptionsLinkCaptureMethod { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for CreatePaymentIntentPaymentMethodOptionsLinkCaptureMethod { - fn default() -> Self { - Self::Manual - } -} - -/// An enum representing the possible values of an `CreatePaymentIntentPaymentMethodOptionsLink`'s `setup_future_usage` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CreatePaymentIntentPaymentMethodOptionsLinkSetupFutureUsage { - None, - OffSession, -} - -impl CreatePaymentIntentPaymentMethodOptionsLinkSetupFutureUsage { - pub fn as_str(self) -> &'static str { - match self { - CreatePaymentIntentPaymentMethodOptionsLinkSetupFutureUsage::None => "none", - CreatePaymentIntentPaymentMethodOptionsLinkSetupFutureUsage::OffSession => { - "off_session" - } - } - } -} - -impl AsRef for CreatePaymentIntentPaymentMethodOptionsLinkSetupFutureUsage { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for CreatePaymentIntentPaymentMethodOptionsLinkSetupFutureUsage { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for CreatePaymentIntentPaymentMethodOptionsLinkSetupFutureUsage { - fn default() -> Self { - Self::None - } -} - -/// An enum representing the possible values of an `CreatePaymentIntentPaymentMethodOptionsOxxo`'s `setup_future_usage` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CreatePaymentIntentPaymentMethodOptionsOxxoSetupFutureUsage { - None, -} - -impl CreatePaymentIntentPaymentMethodOptionsOxxoSetupFutureUsage { - pub fn as_str(self) -> &'static str { - match self { - CreatePaymentIntentPaymentMethodOptionsOxxoSetupFutureUsage::None => "none", - } - } -} - -impl AsRef for CreatePaymentIntentPaymentMethodOptionsOxxoSetupFutureUsage { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for CreatePaymentIntentPaymentMethodOptionsOxxoSetupFutureUsage { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for CreatePaymentIntentPaymentMethodOptionsOxxoSetupFutureUsage { - fn default() -> Self { - Self::None - } -} - -/// An enum representing the possible values of an `CreatePaymentIntentPaymentMethodOptionsP24`'s `setup_future_usage` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CreatePaymentIntentPaymentMethodOptionsP24SetupFutureUsage { - None, -} - -impl CreatePaymentIntentPaymentMethodOptionsP24SetupFutureUsage { - pub fn as_str(self) -> &'static str { - match self { - CreatePaymentIntentPaymentMethodOptionsP24SetupFutureUsage::None => "none", - } - } -} - -impl AsRef for CreatePaymentIntentPaymentMethodOptionsP24SetupFutureUsage { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for CreatePaymentIntentPaymentMethodOptionsP24SetupFutureUsage { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for CreatePaymentIntentPaymentMethodOptionsP24SetupFutureUsage { - fn default() -> Self { - Self::None - } -} - -/// An enum representing the possible values of an `CreatePaymentIntentPaymentMethodOptionsPaynow`'s `setup_future_usage` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CreatePaymentIntentPaymentMethodOptionsPaynowSetupFutureUsage { - None, -} - -impl CreatePaymentIntentPaymentMethodOptionsPaynowSetupFutureUsage { - pub fn as_str(self) -> &'static str { - match self { - CreatePaymentIntentPaymentMethodOptionsPaynowSetupFutureUsage::None => "none", - } - } -} - -impl AsRef for CreatePaymentIntentPaymentMethodOptionsPaynowSetupFutureUsage { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for CreatePaymentIntentPaymentMethodOptionsPaynowSetupFutureUsage { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for CreatePaymentIntentPaymentMethodOptionsPaynowSetupFutureUsage { - fn default() -> Self { - Self::None - } -} - -/// An enum representing the possible values of an `CreatePaymentIntentPaymentMethodOptionsPaypal`'s `capture_method` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CreatePaymentIntentPaymentMethodOptionsPaypalCaptureMethod { - Manual, -} - -impl CreatePaymentIntentPaymentMethodOptionsPaypalCaptureMethod { - pub fn as_str(self) -> &'static str { - match self { - CreatePaymentIntentPaymentMethodOptionsPaypalCaptureMethod::Manual => "manual", - } - } -} - -impl AsRef for CreatePaymentIntentPaymentMethodOptionsPaypalCaptureMethod { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for CreatePaymentIntentPaymentMethodOptionsPaypalCaptureMethod { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for CreatePaymentIntentPaymentMethodOptionsPaypalCaptureMethod { - fn default() -> Self { - Self::Manual - } -} - -/// An enum representing the possible values of an `CreatePaymentIntentPaymentMethodOptionsPaypal`'s `preferred_locale` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CreatePaymentIntentPaymentMethodOptionsPaypalPreferredLocale { - #[serde(rename = "cs-CZ")] - CsCz, - #[serde(rename = "da-DK")] - DaDk, - #[serde(rename = "de-AT")] - DeAt, - #[serde(rename = "de-DE")] - DeDe, - #[serde(rename = "de-LU")] - DeLu, - #[serde(rename = "el-GR")] - ElGr, - #[serde(rename = "en-GB")] - EnGb, - #[serde(rename = "en-US")] - EnUs, - #[serde(rename = "es-ES")] - EsEs, - #[serde(rename = "fi-FI")] - FiFi, - #[serde(rename = "fr-BE")] - FrBe, - #[serde(rename = "fr-FR")] - FrFr, - #[serde(rename = "fr-LU")] - FrLu, - #[serde(rename = "hu-HU")] - HuHu, - #[serde(rename = "it-IT")] - ItIt, - #[serde(rename = "nl-BE")] - NlBe, - #[serde(rename = "nl-NL")] - NlNl, - #[serde(rename = "pl-PL")] - PlPl, - #[serde(rename = "pt-PT")] - PtPt, - #[serde(rename = "sk-SK")] - SkSk, - #[serde(rename = "sv-SE")] - SvSe, -} - -impl CreatePaymentIntentPaymentMethodOptionsPaypalPreferredLocale { - pub fn as_str(self) -> &'static str { - match self { - CreatePaymentIntentPaymentMethodOptionsPaypalPreferredLocale::CsCz => "cs-CZ", - CreatePaymentIntentPaymentMethodOptionsPaypalPreferredLocale::DaDk => "da-DK", - CreatePaymentIntentPaymentMethodOptionsPaypalPreferredLocale::DeAt => "de-AT", - CreatePaymentIntentPaymentMethodOptionsPaypalPreferredLocale::DeDe => "de-DE", - CreatePaymentIntentPaymentMethodOptionsPaypalPreferredLocale::DeLu => "de-LU", - CreatePaymentIntentPaymentMethodOptionsPaypalPreferredLocale::ElGr => "el-GR", - CreatePaymentIntentPaymentMethodOptionsPaypalPreferredLocale::EnGb => "en-GB", - CreatePaymentIntentPaymentMethodOptionsPaypalPreferredLocale::EnUs => "en-US", - CreatePaymentIntentPaymentMethodOptionsPaypalPreferredLocale::EsEs => "es-ES", - CreatePaymentIntentPaymentMethodOptionsPaypalPreferredLocale::FiFi => "fi-FI", - CreatePaymentIntentPaymentMethodOptionsPaypalPreferredLocale::FrBe => "fr-BE", - CreatePaymentIntentPaymentMethodOptionsPaypalPreferredLocale::FrFr => "fr-FR", - CreatePaymentIntentPaymentMethodOptionsPaypalPreferredLocale::FrLu => "fr-LU", - CreatePaymentIntentPaymentMethodOptionsPaypalPreferredLocale::HuHu => "hu-HU", - CreatePaymentIntentPaymentMethodOptionsPaypalPreferredLocale::ItIt => "it-IT", - CreatePaymentIntentPaymentMethodOptionsPaypalPreferredLocale::NlBe => "nl-BE", - CreatePaymentIntentPaymentMethodOptionsPaypalPreferredLocale::NlNl => "nl-NL", - CreatePaymentIntentPaymentMethodOptionsPaypalPreferredLocale::PlPl => "pl-PL", - CreatePaymentIntentPaymentMethodOptionsPaypalPreferredLocale::PtPt => "pt-PT", - CreatePaymentIntentPaymentMethodOptionsPaypalPreferredLocale::SkSk => "sk-SK", - CreatePaymentIntentPaymentMethodOptionsPaypalPreferredLocale::SvSe => "sv-SE", - } - } -} - -impl AsRef for CreatePaymentIntentPaymentMethodOptionsPaypalPreferredLocale { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for CreatePaymentIntentPaymentMethodOptionsPaypalPreferredLocale { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for CreatePaymentIntentPaymentMethodOptionsPaypalPreferredLocale { - fn default() -> Self { - Self::CsCz - } -} - -/// An enum representing the possible values of an `CreatePaymentIntentPaymentMethodOptionsPaypal`'s `setup_future_usage` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CreatePaymentIntentPaymentMethodOptionsPaypalSetupFutureUsage { - None, - OffSession, -} - -impl CreatePaymentIntentPaymentMethodOptionsPaypalSetupFutureUsage { - pub fn as_str(self) -> &'static str { - match self { - CreatePaymentIntentPaymentMethodOptionsPaypalSetupFutureUsage::None => "none", - CreatePaymentIntentPaymentMethodOptionsPaypalSetupFutureUsage::OffSession => { - "off_session" - } - } - } -} - -impl AsRef for CreatePaymentIntentPaymentMethodOptionsPaypalSetupFutureUsage { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for CreatePaymentIntentPaymentMethodOptionsPaypalSetupFutureUsage { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for CreatePaymentIntentPaymentMethodOptionsPaypalSetupFutureUsage { - fn default() -> Self { - Self::None - } -} - -/// An enum representing the possible values of an `CreatePaymentIntentPaymentMethodOptionsPix`'s `setup_future_usage` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CreatePaymentIntentPaymentMethodOptionsPixSetupFutureUsage { - None, -} - -impl CreatePaymentIntentPaymentMethodOptionsPixSetupFutureUsage { - pub fn as_str(self) -> &'static str { - match self { - CreatePaymentIntentPaymentMethodOptionsPixSetupFutureUsage::None => "none", - } - } -} - -impl AsRef for CreatePaymentIntentPaymentMethodOptionsPixSetupFutureUsage { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for CreatePaymentIntentPaymentMethodOptionsPixSetupFutureUsage { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for CreatePaymentIntentPaymentMethodOptionsPixSetupFutureUsage { - fn default() -> Self { - Self::None - } -} - -/// An enum representing the possible values of an `CreatePaymentIntentPaymentMethodOptionsPromptpay`'s `setup_future_usage` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CreatePaymentIntentPaymentMethodOptionsPromptpaySetupFutureUsage { - None, -} - -impl CreatePaymentIntentPaymentMethodOptionsPromptpaySetupFutureUsage { - pub fn as_str(self) -> &'static str { - match self { - CreatePaymentIntentPaymentMethodOptionsPromptpaySetupFutureUsage::None => "none", - } - } -} - -impl AsRef for CreatePaymentIntentPaymentMethodOptionsPromptpaySetupFutureUsage { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for CreatePaymentIntentPaymentMethodOptionsPromptpaySetupFutureUsage { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for CreatePaymentIntentPaymentMethodOptionsPromptpaySetupFutureUsage { - fn default() -> Self { - Self::None - } -} - -/// An enum representing the possible values of an `CreatePaymentIntentPaymentMethodOptionsRevolutPay`'s `setup_future_usage` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CreatePaymentIntentPaymentMethodOptionsRevolutPaySetupFutureUsage { - None, - OffSession, -} - -impl CreatePaymentIntentPaymentMethodOptionsRevolutPaySetupFutureUsage { - pub fn as_str(self) -> &'static str { - match self { - CreatePaymentIntentPaymentMethodOptionsRevolutPaySetupFutureUsage::None => "none", - CreatePaymentIntentPaymentMethodOptionsRevolutPaySetupFutureUsage::OffSession => { - "off_session" - } - } - } -} - -impl AsRef for CreatePaymentIntentPaymentMethodOptionsRevolutPaySetupFutureUsage { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for CreatePaymentIntentPaymentMethodOptionsRevolutPaySetupFutureUsage { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for CreatePaymentIntentPaymentMethodOptionsRevolutPaySetupFutureUsage { - fn default() -> Self { - Self::None - } -} - -/// An enum representing the possible values of an `CreatePaymentIntentPaymentMethodOptionsSepaDebit`'s `setup_future_usage` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CreatePaymentIntentPaymentMethodOptionsSepaDebitSetupFutureUsage { - None, - OffSession, - OnSession, -} - -impl CreatePaymentIntentPaymentMethodOptionsSepaDebitSetupFutureUsage { - pub fn as_str(self) -> &'static str { - match self { - CreatePaymentIntentPaymentMethodOptionsSepaDebitSetupFutureUsage::None => "none", - CreatePaymentIntentPaymentMethodOptionsSepaDebitSetupFutureUsage::OffSession => { - "off_session" - } - CreatePaymentIntentPaymentMethodOptionsSepaDebitSetupFutureUsage::OnSession => { - "on_session" - } - } - } -} - -impl AsRef for CreatePaymentIntentPaymentMethodOptionsSepaDebitSetupFutureUsage { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for CreatePaymentIntentPaymentMethodOptionsSepaDebitSetupFutureUsage { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for CreatePaymentIntentPaymentMethodOptionsSepaDebitSetupFutureUsage { - fn default() -> Self { - Self::None - } -} - -/// An enum representing the possible values of an `CreatePaymentIntentPaymentMethodOptionsSofort`'s `preferred_language` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CreatePaymentIntentPaymentMethodOptionsSofortPreferredLanguage { - De, - En, - Es, - Fr, - It, - Nl, - Pl, -} - -impl CreatePaymentIntentPaymentMethodOptionsSofortPreferredLanguage { - pub fn as_str(self) -> &'static str { - match self { - CreatePaymentIntentPaymentMethodOptionsSofortPreferredLanguage::De => "de", - CreatePaymentIntentPaymentMethodOptionsSofortPreferredLanguage::En => "en", - CreatePaymentIntentPaymentMethodOptionsSofortPreferredLanguage::Es => "es", - CreatePaymentIntentPaymentMethodOptionsSofortPreferredLanguage::Fr => "fr", - CreatePaymentIntentPaymentMethodOptionsSofortPreferredLanguage::It => "it", - CreatePaymentIntentPaymentMethodOptionsSofortPreferredLanguage::Nl => "nl", - CreatePaymentIntentPaymentMethodOptionsSofortPreferredLanguage::Pl => "pl", - } - } -} - -impl AsRef for CreatePaymentIntentPaymentMethodOptionsSofortPreferredLanguage { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for CreatePaymentIntentPaymentMethodOptionsSofortPreferredLanguage { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for CreatePaymentIntentPaymentMethodOptionsSofortPreferredLanguage { - fn default() -> Self { - Self::De - } -} - -/// An enum representing the possible values of an `CreatePaymentIntentPaymentMethodOptionsSofort`'s `setup_future_usage` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CreatePaymentIntentPaymentMethodOptionsSofortSetupFutureUsage { - None, - OffSession, -} - -impl CreatePaymentIntentPaymentMethodOptionsSofortSetupFutureUsage { - pub fn as_str(self) -> &'static str { - match self { - CreatePaymentIntentPaymentMethodOptionsSofortSetupFutureUsage::None => "none", - CreatePaymentIntentPaymentMethodOptionsSofortSetupFutureUsage::OffSession => { - "off_session" - } - } - } -} - -impl AsRef for CreatePaymentIntentPaymentMethodOptionsSofortSetupFutureUsage { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for CreatePaymentIntentPaymentMethodOptionsSofortSetupFutureUsage { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for CreatePaymentIntentPaymentMethodOptionsSofortSetupFutureUsage { - fn default() -> Self { - Self::None - } -} - -/// An enum representing the possible values of an `CreatePaymentIntentPaymentMethodOptionsSwish`'s `setup_future_usage` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CreatePaymentIntentPaymentMethodOptionsSwishSetupFutureUsage { - None, -} - -impl CreatePaymentIntentPaymentMethodOptionsSwishSetupFutureUsage { - pub fn as_str(self) -> &'static str { - match self { - CreatePaymentIntentPaymentMethodOptionsSwishSetupFutureUsage::None => "none", - } - } -} - -impl AsRef for CreatePaymentIntentPaymentMethodOptionsSwishSetupFutureUsage { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for CreatePaymentIntentPaymentMethodOptionsSwishSetupFutureUsage { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for CreatePaymentIntentPaymentMethodOptionsSwishSetupFutureUsage { - fn default() -> Self { - Self::None - } -} - -/// An enum representing the possible values of an `CreatePaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnections`'s `permissions` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CreatePaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions { - Balances, - Ownership, - PaymentMethod, - Transactions, -} - -impl CreatePaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions { - pub fn as_str(self) -> &'static str { - match self { - CreatePaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions::Balances => "balances", - CreatePaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions::Ownership => "ownership", - CreatePaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions::PaymentMethod => "payment_method", - CreatePaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions::Transactions => "transactions", - } - } -} - -impl AsRef - for CreatePaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions -{ - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display - for CreatePaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions -{ - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default - for CreatePaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions -{ - fn default() -> Self { - Self::Balances - } -} - -/// An enum representing the possible values of an `CreatePaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnections`'s `prefetch` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CreatePaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch { - Balances, - Transactions, -} - -impl CreatePaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch { - pub fn as_str(self) -> &'static str { - match self { - CreatePaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch::Balances => "balances", - CreatePaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch::Transactions => "transactions", - } - } -} - -impl AsRef - for CreatePaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch -{ - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display - for CreatePaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch -{ - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default - for CreatePaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch -{ - fn default() -> Self { - Self::Balances - } -} - -/// An enum representing the possible values of an `CreatePaymentIntentPaymentMethodOptionsUsBankAccountMandateOptions`'s `collection_method` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CreatePaymentIntentPaymentMethodOptionsUsBankAccountMandateOptionsCollectionMethod { - Paper, -} - -impl CreatePaymentIntentPaymentMethodOptionsUsBankAccountMandateOptionsCollectionMethod { - pub fn as_str(self) -> &'static str { - match self { - CreatePaymentIntentPaymentMethodOptionsUsBankAccountMandateOptionsCollectionMethod::Paper => "paper", - } - } -} - -impl AsRef - for CreatePaymentIntentPaymentMethodOptionsUsBankAccountMandateOptionsCollectionMethod -{ - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display - for CreatePaymentIntentPaymentMethodOptionsUsBankAccountMandateOptionsCollectionMethod -{ - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default - for CreatePaymentIntentPaymentMethodOptionsUsBankAccountMandateOptionsCollectionMethod -{ - fn default() -> Self { - Self::Paper - } -} - -/// An enum representing the possible values of an `CreatePaymentIntentPaymentMethodOptionsUsBankAccountNetworks`'s `requested` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CreatePaymentIntentPaymentMethodOptionsUsBankAccountNetworksRequested { - Ach, - UsDomesticWire, -} - -impl CreatePaymentIntentPaymentMethodOptionsUsBankAccountNetworksRequested { - pub fn as_str(self) -> &'static str { - match self { - CreatePaymentIntentPaymentMethodOptionsUsBankAccountNetworksRequested::Ach => "ach", - CreatePaymentIntentPaymentMethodOptionsUsBankAccountNetworksRequested::UsDomesticWire => "us_domestic_wire", - } - } -} - -impl AsRef for CreatePaymentIntentPaymentMethodOptionsUsBankAccountNetworksRequested { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for CreatePaymentIntentPaymentMethodOptionsUsBankAccountNetworksRequested { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default - for CreatePaymentIntentPaymentMethodOptionsUsBankAccountNetworksRequested -{ - fn default() -> Self { - Self::Ach - } -} - -/// An enum representing the possible values of an `CreatePaymentIntentPaymentMethodOptionsUsBankAccount`'s `preferred_settlement_speed` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CreatePaymentIntentPaymentMethodOptionsUsBankAccountPreferredSettlementSpeed { - Fastest, - Standard, -} - -impl CreatePaymentIntentPaymentMethodOptionsUsBankAccountPreferredSettlementSpeed { - pub fn as_str(self) -> &'static str { - match self { - CreatePaymentIntentPaymentMethodOptionsUsBankAccountPreferredSettlementSpeed::Fastest => "fastest", - CreatePaymentIntentPaymentMethodOptionsUsBankAccountPreferredSettlementSpeed::Standard => "standard", - } - } -} - -impl AsRef for CreatePaymentIntentPaymentMethodOptionsUsBankAccountPreferredSettlementSpeed { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display - for CreatePaymentIntentPaymentMethodOptionsUsBankAccountPreferredSettlementSpeed -{ - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default - for CreatePaymentIntentPaymentMethodOptionsUsBankAccountPreferredSettlementSpeed -{ - fn default() -> Self { - Self::Fastest - } -} - -/// An enum representing the possible values of an `CreatePaymentIntentPaymentMethodOptionsUsBankAccount`'s `setup_future_usage` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CreatePaymentIntentPaymentMethodOptionsUsBankAccountSetupFutureUsage { - None, - OffSession, - OnSession, -} - -impl CreatePaymentIntentPaymentMethodOptionsUsBankAccountSetupFutureUsage { - pub fn as_str(self) -> &'static str { - match self { - CreatePaymentIntentPaymentMethodOptionsUsBankAccountSetupFutureUsage::None => "none", - CreatePaymentIntentPaymentMethodOptionsUsBankAccountSetupFutureUsage::OffSession => { - "off_session" - } - CreatePaymentIntentPaymentMethodOptionsUsBankAccountSetupFutureUsage::OnSession => { - "on_session" - } - } - } -} - -impl AsRef for CreatePaymentIntentPaymentMethodOptionsUsBankAccountSetupFutureUsage { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for CreatePaymentIntentPaymentMethodOptionsUsBankAccountSetupFutureUsage { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default - for CreatePaymentIntentPaymentMethodOptionsUsBankAccountSetupFutureUsage -{ - fn default() -> Self { - Self::None - } -} - -/// An enum representing the possible values of an `CreatePaymentIntentPaymentMethodOptionsUsBankAccount`'s `verification_method` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CreatePaymentIntentPaymentMethodOptionsUsBankAccountVerificationMethod { - Automatic, - Instant, - Microdeposits, -} - -impl CreatePaymentIntentPaymentMethodOptionsUsBankAccountVerificationMethod { - pub fn as_str(self) -> &'static str { - match self { - CreatePaymentIntentPaymentMethodOptionsUsBankAccountVerificationMethod::Automatic => "automatic", - CreatePaymentIntentPaymentMethodOptionsUsBankAccountVerificationMethod::Instant => "instant", - CreatePaymentIntentPaymentMethodOptionsUsBankAccountVerificationMethod::Microdeposits => "microdeposits", - } - } -} - -impl AsRef for CreatePaymentIntentPaymentMethodOptionsUsBankAccountVerificationMethod { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for CreatePaymentIntentPaymentMethodOptionsUsBankAccountVerificationMethod { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default - for CreatePaymentIntentPaymentMethodOptionsUsBankAccountVerificationMethod -{ - fn default() -> Self { - Self::Automatic - } -} - -/// An enum representing the possible values of an `CreatePaymentIntentPaymentMethodOptionsWechatPay`'s `client` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CreatePaymentIntentPaymentMethodOptionsWechatPayClient { - Android, - Ios, - Web, -} - -impl CreatePaymentIntentPaymentMethodOptionsWechatPayClient { - pub fn as_str(self) -> &'static str { - match self { - CreatePaymentIntentPaymentMethodOptionsWechatPayClient::Android => "android", - CreatePaymentIntentPaymentMethodOptionsWechatPayClient::Ios => "ios", - CreatePaymentIntentPaymentMethodOptionsWechatPayClient::Web => "web", - } - } -} - -impl AsRef for CreatePaymentIntentPaymentMethodOptionsWechatPayClient { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for CreatePaymentIntentPaymentMethodOptionsWechatPayClient { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for CreatePaymentIntentPaymentMethodOptionsWechatPayClient { - fn default() -> Self { - Self::Android - } -} - -/// An enum representing the possible values of an `CreatePaymentIntentPaymentMethodOptionsWechatPay`'s `setup_future_usage` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CreatePaymentIntentPaymentMethodOptionsWechatPaySetupFutureUsage { - None, -} - -impl CreatePaymentIntentPaymentMethodOptionsWechatPaySetupFutureUsage { - pub fn as_str(self) -> &'static str { - match self { - CreatePaymentIntentPaymentMethodOptionsWechatPaySetupFutureUsage::None => "none", - } - } -} - -impl AsRef for CreatePaymentIntentPaymentMethodOptionsWechatPaySetupFutureUsage { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for CreatePaymentIntentPaymentMethodOptionsWechatPaySetupFutureUsage { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for CreatePaymentIntentPaymentMethodOptionsWechatPaySetupFutureUsage { - fn default() -> Self { - Self::None - } -} - -/// An enum representing the possible values of an `CreatePaymentIntentPaymentMethodOptionsZip`'s `setup_future_usage` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CreatePaymentIntentPaymentMethodOptionsZipSetupFutureUsage { - None, -} - -impl CreatePaymentIntentPaymentMethodOptionsZipSetupFutureUsage { - pub fn as_str(self) -> &'static str { - match self { - CreatePaymentIntentPaymentMethodOptionsZipSetupFutureUsage::None => "none", - } - } -} - -impl AsRef for CreatePaymentIntentPaymentMethodOptionsZipSetupFutureUsage { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for CreatePaymentIntentPaymentMethodOptionsZipSetupFutureUsage { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for CreatePaymentIntentPaymentMethodOptionsZipSetupFutureUsage { - fn default() -> Self { - Self::None - } -} - -/// An enum representing the possible values of an `FundingInstructionsBankTransferFinancialAddress`'s `supported_networks` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum FundingInstructionsBankTransferFinancialAddressSupportedNetworks { - Ach, - Bacs, - DomesticWireUs, - Fps, - Sepa, - Spei, - Swift, - Zengin, -} - -impl FundingInstructionsBankTransferFinancialAddressSupportedNetworks { - pub fn as_str(self) -> &'static str { - match self { - FundingInstructionsBankTransferFinancialAddressSupportedNetworks::Ach => "ach", - FundingInstructionsBankTransferFinancialAddressSupportedNetworks::Bacs => "bacs", - FundingInstructionsBankTransferFinancialAddressSupportedNetworks::DomesticWireUs => { - "domestic_wire_us" - } - FundingInstructionsBankTransferFinancialAddressSupportedNetworks::Fps => "fps", - FundingInstructionsBankTransferFinancialAddressSupportedNetworks::Sepa => "sepa", - FundingInstructionsBankTransferFinancialAddressSupportedNetworks::Spei => "spei", - FundingInstructionsBankTransferFinancialAddressSupportedNetworks::Swift => "swift", - FundingInstructionsBankTransferFinancialAddressSupportedNetworks::Zengin => "zengin", - } - } -} - -impl AsRef for FundingInstructionsBankTransferFinancialAddressSupportedNetworks { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for FundingInstructionsBankTransferFinancialAddressSupportedNetworks { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for FundingInstructionsBankTransferFinancialAddressSupportedNetworks { - fn default() -> Self { - Self::Ach - } -} - -/// An enum representing the possible values of an `FundingInstructionsBankTransferFinancialAddress`'s `type` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum FundingInstructionsBankTransferFinancialAddressType { - Aba, - Iban, - SortCode, - Spei, - Swift, - Zengin, -} - -impl FundingInstructionsBankTransferFinancialAddressType { - pub fn as_str(self) -> &'static str { - match self { - FundingInstructionsBankTransferFinancialAddressType::Aba => "aba", - FundingInstructionsBankTransferFinancialAddressType::Iban => "iban", - FundingInstructionsBankTransferFinancialAddressType::SortCode => "sort_code", - FundingInstructionsBankTransferFinancialAddressType::Spei => "spei", - FundingInstructionsBankTransferFinancialAddressType::Swift => "swift", - FundingInstructionsBankTransferFinancialAddressType::Zengin => "zengin", - } - } -} - -impl AsRef for FundingInstructionsBankTransferFinancialAddressType { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for FundingInstructionsBankTransferFinancialAddressType { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for FundingInstructionsBankTransferFinancialAddressType { - fn default() -> Self { - Self::Aba - } -} - -/// An enum representing the possible values of an `PaymentFlowsAutomaticPaymentMethodsPaymentIntent`'s `allow_redirects` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum PaymentFlowsAutomaticPaymentMethodsPaymentIntentAllowRedirects { - Always, - Never, -} - -impl PaymentFlowsAutomaticPaymentMethodsPaymentIntentAllowRedirects { - pub fn as_str(self) -> &'static str { - match self { - PaymentFlowsAutomaticPaymentMethodsPaymentIntentAllowRedirects::Always => "always", - PaymentFlowsAutomaticPaymentMethodsPaymentIntentAllowRedirects::Never => "never", - } - } -} - -impl AsRef for PaymentFlowsAutomaticPaymentMethodsPaymentIntentAllowRedirects { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for PaymentFlowsAutomaticPaymentMethodsPaymentIntentAllowRedirects { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for PaymentFlowsAutomaticPaymentMethodsPaymentIntentAllowRedirects { - fn default() -> Self { - Self::Always - } -} - -/// An enum representing the possible values of an `PaymentIntent`'s `cancellation_reason` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum PaymentIntentCancellationReason { - Abandoned, - Automatic, - Duplicate, - FailedInvoice, - Fraudulent, - RequestedByCustomer, - VoidInvoice, -} - -impl PaymentIntentCancellationReason { - pub fn as_str(self) -> &'static str { - match self { - PaymentIntentCancellationReason::Abandoned => "abandoned", - PaymentIntentCancellationReason::Automatic => "automatic", - PaymentIntentCancellationReason::Duplicate => "duplicate", - PaymentIntentCancellationReason::FailedInvoice => "failed_invoice", - PaymentIntentCancellationReason::Fraudulent => "fraudulent", - PaymentIntentCancellationReason::RequestedByCustomer => "requested_by_customer", - PaymentIntentCancellationReason::VoidInvoice => "void_invoice", - } - } -} - -impl AsRef for PaymentIntentCancellationReason { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for PaymentIntentCancellationReason { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for PaymentIntentCancellationReason { - fn default() -> Self { - Self::Abandoned - } -} - -/// An enum representing the possible values of an `PaymentIntent`'s `capture_method` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum PaymentIntentCaptureMethod { - Automatic, - AutomaticAsync, - Manual, -} - -impl PaymentIntentCaptureMethod { - pub fn as_str(self) -> &'static str { - match self { - PaymentIntentCaptureMethod::Automatic => "automatic", - PaymentIntentCaptureMethod::AutomaticAsync => "automatic_async", - PaymentIntentCaptureMethod::Manual => "manual", - } - } -} - -impl AsRef for PaymentIntentCaptureMethod { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for PaymentIntentCaptureMethod { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for PaymentIntentCaptureMethod { - fn default() -> Self { - Self::Automatic - } -} - -/// An enum representing the possible values of an `PaymentIntent`'s `confirmation_method` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum PaymentIntentConfirmationMethod { - Automatic, - Manual, -} - -impl PaymentIntentConfirmationMethod { - pub fn as_str(self) -> &'static str { - match self { - PaymentIntentConfirmationMethod::Automatic => "automatic", - PaymentIntentConfirmationMethod::Manual => "manual", - } - } -} - -impl AsRef for PaymentIntentConfirmationMethod { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for PaymentIntentConfirmationMethod { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for PaymentIntentConfirmationMethod { - fn default() -> Self { - Self::Automatic - } -} - -/// An enum representing the possible values of an `PaymentIntentNextActionDisplayBankTransferInstructions`'s `type` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum PaymentIntentNextActionDisplayBankTransferInstructionsType { - EuBankTransfer, - GbBankTransfer, - JpBankTransfer, - MxBankTransfer, - UsBankTransfer, -} - -impl PaymentIntentNextActionDisplayBankTransferInstructionsType { - pub fn as_str(self) -> &'static str { - match self { - PaymentIntentNextActionDisplayBankTransferInstructionsType::EuBankTransfer => { - "eu_bank_transfer" - } - PaymentIntentNextActionDisplayBankTransferInstructionsType::GbBankTransfer => { - "gb_bank_transfer" - } - PaymentIntentNextActionDisplayBankTransferInstructionsType::JpBankTransfer => { - "jp_bank_transfer" - } - PaymentIntentNextActionDisplayBankTransferInstructionsType::MxBankTransfer => { - "mx_bank_transfer" - } - PaymentIntentNextActionDisplayBankTransferInstructionsType::UsBankTransfer => { - "us_bank_transfer" - } - } - } -} - -impl AsRef for PaymentIntentNextActionDisplayBankTransferInstructionsType { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for PaymentIntentNextActionDisplayBankTransferInstructionsType { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for PaymentIntentNextActionDisplayBankTransferInstructionsType { - fn default() -> Self { - Self::EuBankTransfer - } -} - -/// An enum representing the possible values of an `PaymentIntentNextActionVerifyWithMicrodeposits`'s `microdeposit_type` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum PaymentIntentNextActionVerifyWithMicrodepositsMicrodepositType { - Amounts, - DescriptorCode, -} - -impl PaymentIntentNextActionVerifyWithMicrodepositsMicrodepositType { - pub fn as_str(self) -> &'static str { - match self { - PaymentIntentNextActionVerifyWithMicrodepositsMicrodepositType::Amounts => "amounts", - PaymentIntentNextActionVerifyWithMicrodepositsMicrodepositType::DescriptorCode => { - "descriptor_code" - } - } - } -} - -impl AsRef for PaymentIntentNextActionVerifyWithMicrodepositsMicrodepositType { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for PaymentIntentNextActionVerifyWithMicrodepositsMicrodepositType { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for PaymentIntentNextActionVerifyWithMicrodepositsMicrodepositType { - fn default() -> Self { - Self::Amounts - } -} - -/// An enum representing the possible values of an `PaymentIntentPaymentMethodOptionsAcssDebit`'s `setup_future_usage` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum PaymentIntentPaymentMethodOptionsAcssDebitSetupFutureUsage { - None, - OffSession, - OnSession, -} - -impl PaymentIntentPaymentMethodOptionsAcssDebitSetupFutureUsage { - pub fn as_str(self) -> &'static str { - match self { - PaymentIntentPaymentMethodOptionsAcssDebitSetupFutureUsage::None => "none", - PaymentIntentPaymentMethodOptionsAcssDebitSetupFutureUsage::OffSession => "off_session", - PaymentIntentPaymentMethodOptionsAcssDebitSetupFutureUsage::OnSession => "on_session", - } - } -} - -impl AsRef for PaymentIntentPaymentMethodOptionsAcssDebitSetupFutureUsage { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for PaymentIntentPaymentMethodOptionsAcssDebitSetupFutureUsage { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for PaymentIntentPaymentMethodOptionsAcssDebitSetupFutureUsage { - fn default() -> Self { - Self::None - } -} - -/// An enum representing the possible values of an `PaymentIntentPaymentMethodOptionsAcssDebit`'s `verification_method` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum PaymentIntentPaymentMethodOptionsAcssDebitVerificationMethod { - Automatic, - Instant, - Microdeposits, -} - -impl PaymentIntentPaymentMethodOptionsAcssDebitVerificationMethod { - pub fn as_str(self) -> &'static str { - match self { - PaymentIntentPaymentMethodOptionsAcssDebitVerificationMethod::Automatic => "automatic", - PaymentIntentPaymentMethodOptionsAcssDebitVerificationMethod::Instant => "instant", - PaymentIntentPaymentMethodOptionsAcssDebitVerificationMethod::Microdeposits => { - "microdeposits" - } - } - } -} - -impl AsRef for PaymentIntentPaymentMethodOptionsAcssDebitVerificationMethod { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for PaymentIntentPaymentMethodOptionsAcssDebitVerificationMethod { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for PaymentIntentPaymentMethodOptionsAcssDebitVerificationMethod { - fn default() -> Self { - Self::Automatic - } -} - -/// An enum representing the possible values of an `PaymentIntentPaymentMethodOptionsAuBecsDebit`'s `setup_future_usage` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum PaymentIntentPaymentMethodOptionsAuBecsDebitSetupFutureUsage { - None, - OffSession, - OnSession, -} - -impl PaymentIntentPaymentMethodOptionsAuBecsDebitSetupFutureUsage { - pub fn as_str(self) -> &'static str { - match self { - PaymentIntentPaymentMethodOptionsAuBecsDebitSetupFutureUsage::None => "none", - PaymentIntentPaymentMethodOptionsAuBecsDebitSetupFutureUsage::OffSession => { - "off_session" - } - PaymentIntentPaymentMethodOptionsAuBecsDebitSetupFutureUsage::OnSession => "on_session", - } - } -} - -impl AsRef for PaymentIntentPaymentMethodOptionsAuBecsDebitSetupFutureUsage { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for PaymentIntentPaymentMethodOptionsAuBecsDebitSetupFutureUsage { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for PaymentIntentPaymentMethodOptionsAuBecsDebitSetupFutureUsage { - fn default() -> Self { - Self::None - } -} - -/// An enum representing the possible values of an `PaymentIntentPaymentMethodOptionsBlik`'s `setup_future_usage` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum PaymentIntentPaymentMethodOptionsBlikSetupFutureUsage { - None, -} - -impl PaymentIntentPaymentMethodOptionsBlikSetupFutureUsage { - pub fn as_str(self) -> &'static str { - match self { - PaymentIntentPaymentMethodOptionsBlikSetupFutureUsage::None => "none", - } - } -} - -impl AsRef for PaymentIntentPaymentMethodOptionsBlikSetupFutureUsage { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for PaymentIntentPaymentMethodOptionsBlikSetupFutureUsage { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for PaymentIntentPaymentMethodOptionsBlikSetupFutureUsage { - fn default() -> Self { - Self::None - } -} - -/// An enum representing the possible values of an `PaymentIntentPaymentMethodOptionsCard`'s `capture_method` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum PaymentIntentPaymentMethodOptionsCardCaptureMethod { - Manual, -} - -impl PaymentIntentPaymentMethodOptionsCardCaptureMethod { - pub fn as_str(self) -> &'static str { - match self { - PaymentIntentPaymentMethodOptionsCardCaptureMethod::Manual => "manual", - } - } -} - -impl AsRef for PaymentIntentPaymentMethodOptionsCardCaptureMethod { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for PaymentIntentPaymentMethodOptionsCardCaptureMethod { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for PaymentIntentPaymentMethodOptionsCardCaptureMethod { - fn default() -> Self { - Self::Manual - } -} - -/// An enum representing the possible values of an `PaymentIntentPaymentMethodOptionsCard`'s `network` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum PaymentIntentPaymentMethodOptionsCardNetwork { - Amex, - CartesBancaires, - Diners, - Discover, - EftposAu, - Interac, - Jcb, - Mastercard, - Unionpay, - Unknown, - Visa, -} - -impl PaymentIntentPaymentMethodOptionsCardNetwork { - pub fn as_str(self) -> &'static str { - match self { - PaymentIntentPaymentMethodOptionsCardNetwork::Amex => "amex", - PaymentIntentPaymentMethodOptionsCardNetwork::CartesBancaires => "cartes_bancaires", - PaymentIntentPaymentMethodOptionsCardNetwork::Diners => "diners", - PaymentIntentPaymentMethodOptionsCardNetwork::Discover => "discover", - PaymentIntentPaymentMethodOptionsCardNetwork::EftposAu => "eftpos_au", - PaymentIntentPaymentMethodOptionsCardNetwork::Interac => "interac", - PaymentIntentPaymentMethodOptionsCardNetwork::Jcb => "jcb", - PaymentIntentPaymentMethodOptionsCardNetwork::Mastercard => "mastercard", - PaymentIntentPaymentMethodOptionsCardNetwork::Unionpay => "unionpay", - PaymentIntentPaymentMethodOptionsCardNetwork::Unknown => "unknown", - PaymentIntentPaymentMethodOptionsCardNetwork::Visa => "visa", - } - } -} - -impl AsRef for PaymentIntentPaymentMethodOptionsCardNetwork { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for PaymentIntentPaymentMethodOptionsCardNetwork { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for PaymentIntentPaymentMethodOptionsCardNetwork { - fn default() -> Self { - Self::Amex - } -} - -/// An enum representing the possible values of an `PaymentIntentPaymentMethodOptionsCard`'s `request_extended_authorization` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum PaymentIntentPaymentMethodOptionsCardRequestExtendedAuthorization { - IfAvailable, - Never, -} - -impl PaymentIntentPaymentMethodOptionsCardRequestExtendedAuthorization { - pub fn as_str(self) -> &'static str { - match self { - PaymentIntentPaymentMethodOptionsCardRequestExtendedAuthorization::IfAvailable => { - "if_available" - } - PaymentIntentPaymentMethodOptionsCardRequestExtendedAuthorization::Never => "never", - } - } -} - -impl AsRef for PaymentIntentPaymentMethodOptionsCardRequestExtendedAuthorization { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for PaymentIntentPaymentMethodOptionsCardRequestExtendedAuthorization { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for PaymentIntentPaymentMethodOptionsCardRequestExtendedAuthorization { - fn default() -> Self { - Self::IfAvailable - } -} - -/// An enum representing the possible values of an `PaymentIntentPaymentMethodOptionsCard`'s `request_incremental_authorization` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum PaymentIntentPaymentMethodOptionsCardRequestIncrementalAuthorization { - IfAvailable, - Never, -} - -impl PaymentIntentPaymentMethodOptionsCardRequestIncrementalAuthorization { - pub fn as_str(self) -> &'static str { - match self { - PaymentIntentPaymentMethodOptionsCardRequestIncrementalAuthorization::IfAvailable => { - "if_available" - } - PaymentIntentPaymentMethodOptionsCardRequestIncrementalAuthorization::Never => "never", - } - } -} - -impl AsRef for PaymentIntentPaymentMethodOptionsCardRequestIncrementalAuthorization { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for PaymentIntentPaymentMethodOptionsCardRequestIncrementalAuthorization { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default - for PaymentIntentPaymentMethodOptionsCardRequestIncrementalAuthorization -{ - fn default() -> Self { - Self::IfAvailable - } -} - -/// An enum representing the possible values of an `PaymentIntentPaymentMethodOptionsCard`'s `request_multicapture` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum PaymentIntentPaymentMethodOptionsCardRequestMulticapture { - IfAvailable, - Never, -} - -impl PaymentIntentPaymentMethodOptionsCardRequestMulticapture { - pub fn as_str(self) -> &'static str { - match self { - PaymentIntentPaymentMethodOptionsCardRequestMulticapture::IfAvailable => "if_available", - PaymentIntentPaymentMethodOptionsCardRequestMulticapture::Never => "never", - } - } -} - -impl AsRef for PaymentIntentPaymentMethodOptionsCardRequestMulticapture { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for PaymentIntentPaymentMethodOptionsCardRequestMulticapture { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for PaymentIntentPaymentMethodOptionsCardRequestMulticapture { - fn default() -> Self { - Self::IfAvailable - } -} - -/// An enum representing the possible values of an `PaymentIntentPaymentMethodOptionsCard`'s `request_overcapture` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum PaymentIntentPaymentMethodOptionsCardRequestOvercapture { - IfAvailable, - Never, -} - -impl PaymentIntentPaymentMethodOptionsCardRequestOvercapture { - pub fn as_str(self) -> &'static str { - match self { - PaymentIntentPaymentMethodOptionsCardRequestOvercapture::IfAvailable => "if_available", - PaymentIntentPaymentMethodOptionsCardRequestOvercapture::Never => "never", - } - } -} - -impl AsRef for PaymentIntentPaymentMethodOptionsCardRequestOvercapture { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for PaymentIntentPaymentMethodOptionsCardRequestOvercapture { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for PaymentIntentPaymentMethodOptionsCardRequestOvercapture { - fn default() -> Self { - Self::IfAvailable - } -} - -/// An enum representing the possible values of an `PaymentIntentPaymentMethodOptionsCard`'s `request_three_d_secure` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum PaymentIntentPaymentMethodOptionsCardRequestThreeDSecure { - Any, - Automatic, - Challenge, -} - -impl PaymentIntentPaymentMethodOptionsCardRequestThreeDSecure { - pub fn as_str(self) -> &'static str { - match self { - PaymentIntentPaymentMethodOptionsCardRequestThreeDSecure::Any => "any", - PaymentIntentPaymentMethodOptionsCardRequestThreeDSecure::Automatic => "automatic", - PaymentIntentPaymentMethodOptionsCardRequestThreeDSecure::Challenge => "challenge", - } - } -} - -impl AsRef for PaymentIntentPaymentMethodOptionsCardRequestThreeDSecure { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for PaymentIntentPaymentMethodOptionsCardRequestThreeDSecure { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for PaymentIntentPaymentMethodOptionsCardRequestThreeDSecure { - fn default() -> Self { - Self::Any - } -} - -/// An enum representing the possible values of an `PaymentIntentPaymentMethodOptionsCard`'s `setup_future_usage` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum PaymentIntentPaymentMethodOptionsCardSetupFutureUsage { - None, - OffSession, - OnSession, -} - -impl PaymentIntentPaymentMethodOptionsCardSetupFutureUsage { - pub fn as_str(self) -> &'static str { - match self { - PaymentIntentPaymentMethodOptionsCardSetupFutureUsage::None => "none", - PaymentIntentPaymentMethodOptionsCardSetupFutureUsage::OffSession => "off_session", - PaymentIntentPaymentMethodOptionsCardSetupFutureUsage::OnSession => "on_session", - } - } -} - -impl AsRef for PaymentIntentPaymentMethodOptionsCardSetupFutureUsage { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for PaymentIntentPaymentMethodOptionsCardSetupFutureUsage { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for PaymentIntentPaymentMethodOptionsCardSetupFutureUsage { - fn default() -> Self { - Self::None - } -} - -/// An enum representing the possible values of an `PaymentIntentPaymentMethodOptionsEps`'s `setup_future_usage` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum PaymentIntentPaymentMethodOptionsEpsSetupFutureUsage { - None, -} - -impl PaymentIntentPaymentMethodOptionsEpsSetupFutureUsage { - pub fn as_str(self) -> &'static str { - match self { - PaymentIntentPaymentMethodOptionsEpsSetupFutureUsage::None => "none", - } - } -} - -impl AsRef for PaymentIntentPaymentMethodOptionsEpsSetupFutureUsage { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for PaymentIntentPaymentMethodOptionsEpsSetupFutureUsage { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for PaymentIntentPaymentMethodOptionsEpsSetupFutureUsage { - fn default() -> Self { - Self::None - } -} - -/// An enum representing the possible values of an `PaymentIntentPaymentMethodOptionsLink`'s `capture_method` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum PaymentIntentPaymentMethodOptionsLinkCaptureMethod { - Manual, -} - -impl PaymentIntentPaymentMethodOptionsLinkCaptureMethod { - pub fn as_str(self) -> &'static str { - match self { - PaymentIntentPaymentMethodOptionsLinkCaptureMethod::Manual => "manual", - } - } -} - -impl AsRef for PaymentIntentPaymentMethodOptionsLinkCaptureMethod { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for PaymentIntentPaymentMethodOptionsLinkCaptureMethod { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for PaymentIntentPaymentMethodOptionsLinkCaptureMethod { - fn default() -> Self { - Self::Manual - } -} - -/// An enum representing the possible values of an `PaymentIntentPaymentMethodOptionsLink`'s `setup_future_usage` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum PaymentIntentPaymentMethodOptionsLinkSetupFutureUsage { - None, - OffSession, -} - -impl PaymentIntentPaymentMethodOptionsLinkSetupFutureUsage { - pub fn as_str(self) -> &'static str { - match self { - PaymentIntentPaymentMethodOptionsLinkSetupFutureUsage::None => "none", - PaymentIntentPaymentMethodOptionsLinkSetupFutureUsage::OffSession => "off_session", - } - } -} - -impl AsRef for PaymentIntentPaymentMethodOptionsLinkSetupFutureUsage { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for PaymentIntentPaymentMethodOptionsLinkSetupFutureUsage { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for PaymentIntentPaymentMethodOptionsLinkSetupFutureUsage { - fn default() -> Self { - Self::None - } -} - -/// An enum representing the possible values of an `PaymentIntentPaymentMethodOptionsMandateOptionsAcssDebit`'s `payment_schedule` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum PaymentIntentPaymentMethodOptionsMandateOptionsAcssDebitPaymentSchedule { - Combined, - Interval, - Sporadic, -} - -impl PaymentIntentPaymentMethodOptionsMandateOptionsAcssDebitPaymentSchedule { - pub fn as_str(self) -> &'static str { - match self { - PaymentIntentPaymentMethodOptionsMandateOptionsAcssDebitPaymentSchedule::Combined => { - "combined" - } - PaymentIntentPaymentMethodOptionsMandateOptionsAcssDebitPaymentSchedule::Interval => { - "interval" - } - PaymentIntentPaymentMethodOptionsMandateOptionsAcssDebitPaymentSchedule::Sporadic => { - "sporadic" - } - } - } -} - -impl AsRef for PaymentIntentPaymentMethodOptionsMandateOptionsAcssDebitPaymentSchedule { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for PaymentIntentPaymentMethodOptionsMandateOptionsAcssDebitPaymentSchedule { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default - for PaymentIntentPaymentMethodOptionsMandateOptionsAcssDebitPaymentSchedule -{ - fn default() -> Self { - Self::Combined - } -} - -/// An enum representing the possible values of an `PaymentIntentPaymentMethodOptionsMandateOptionsAcssDebit`'s `transaction_type` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum PaymentIntentPaymentMethodOptionsMandateOptionsAcssDebitTransactionType { - Business, - Personal, -} - -impl PaymentIntentPaymentMethodOptionsMandateOptionsAcssDebitTransactionType { - pub fn as_str(self) -> &'static str { - match self { - PaymentIntentPaymentMethodOptionsMandateOptionsAcssDebitTransactionType::Business => { - "business" - } - PaymentIntentPaymentMethodOptionsMandateOptionsAcssDebitTransactionType::Personal => { - "personal" - } - } - } -} - -impl AsRef for PaymentIntentPaymentMethodOptionsMandateOptionsAcssDebitTransactionType { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for PaymentIntentPaymentMethodOptionsMandateOptionsAcssDebitTransactionType { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default - for PaymentIntentPaymentMethodOptionsMandateOptionsAcssDebitTransactionType -{ - fn default() -> Self { - Self::Business - } -} - -/// An enum representing the possible values of an `PaymentIntentPaymentMethodOptionsSepaDebit`'s `setup_future_usage` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum PaymentIntentPaymentMethodOptionsSepaDebitSetupFutureUsage { - None, - OffSession, - OnSession, -} - -impl PaymentIntentPaymentMethodOptionsSepaDebitSetupFutureUsage { - pub fn as_str(self) -> &'static str { - match self { - PaymentIntentPaymentMethodOptionsSepaDebitSetupFutureUsage::None => "none", - PaymentIntentPaymentMethodOptionsSepaDebitSetupFutureUsage::OffSession => "off_session", - PaymentIntentPaymentMethodOptionsSepaDebitSetupFutureUsage::OnSession => "on_session", - } - } -} - -impl AsRef for PaymentIntentPaymentMethodOptionsSepaDebitSetupFutureUsage { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for PaymentIntentPaymentMethodOptionsSepaDebitSetupFutureUsage { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for PaymentIntentPaymentMethodOptionsSepaDebitSetupFutureUsage { - fn default() -> Self { - Self::None - } -} - -/// An enum representing the possible values of an `PaymentIntentPaymentMethodOptionsSwish`'s `setup_future_usage` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum PaymentIntentPaymentMethodOptionsSwishSetupFutureUsage { - None, -} - -impl PaymentIntentPaymentMethodOptionsSwishSetupFutureUsage { - pub fn as_str(self) -> &'static str { - match self { - PaymentIntentPaymentMethodOptionsSwishSetupFutureUsage::None => "none", - } - } -} - -impl AsRef for PaymentIntentPaymentMethodOptionsSwishSetupFutureUsage { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for PaymentIntentPaymentMethodOptionsSwishSetupFutureUsage { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for PaymentIntentPaymentMethodOptionsSwishSetupFutureUsage { - fn default() -> Self { - Self::None - } -} - -/// An enum representing the possible values of an `PaymentIntentPaymentMethodOptionsUsBankAccount`'s `preferred_settlement_speed` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum PaymentIntentPaymentMethodOptionsUsBankAccountPreferredSettlementSpeed { - Fastest, - Standard, -} - -impl PaymentIntentPaymentMethodOptionsUsBankAccountPreferredSettlementSpeed { - pub fn as_str(self) -> &'static str { - match self { - PaymentIntentPaymentMethodOptionsUsBankAccountPreferredSettlementSpeed::Fastest => { - "fastest" - } - PaymentIntentPaymentMethodOptionsUsBankAccountPreferredSettlementSpeed::Standard => { - "standard" - } - } - } -} - -impl AsRef for PaymentIntentPaymentMethodOptionsUsBankAccountPreferredSettlementSpeed { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for PaymentIntentPaymentMethodOptionsUsBankAccountPreferredSettlementSpeed { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default - for PaymentIntentPaymentMethodOptionsUsBankAccountPreferredSettlementSpeed -{ - fn default() -> Self { - Self::Fastest - } -} - -/// An enum representing the possible values of an `PaymentIntentPaymentMethodOptionsUsBankAccount`'s `setup_future_usage` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum PaymentIntentPaymentMethodOptionsUsBankAccountSetupFutureUsage { - None, - OffSession, - OnSession, -} - -impl PaymentIntentPaymentMethodOptionsUsBankAccountSetupFutureUsage { - pub fn as_str(self) -> &'static str { - match self { - PaymentIntentPaymentMethodOptionsUsBankAccountSetupFutureUsage::None => "none", - PaymentIntentPaymentMethodOptionsUsBankAccountSetupFutureUsage::OffSession => { - "off_session" - } - PaymentIntentPaymentMethodOptionsUsBankAccountSetupFutureUsage::OnSession => { - "on_session" - } - } - } -} - -impl AsRef for PaymentIntentPaymentMethodOptionsUsBankAccountSetupFutureUsage { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for PaymentIntentPaymentMethodOptionsUsBankAccountSetupFutureUsage { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for PaymentIntentPaymentMethodOptionsUsBankAccountSetupFutureUsage { - fn default() -> Self { - Self::None - } -} - -/// An enum representing the possible values of an `PaymentIntentPaymentMethodOptionsUsBankAccount`'s `verification_method` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum PaymentIntentPaymentMethodOptionsUsBankAccountVerificationMethod { - Automatic, - Instant, - Microdeposits, -} - -impl PaymentIntentPaymentMethodOptionsUsBankAccountVerificationMethod { - pub fn as_str(self) -> &'static str { - match self { - PaymentIntentPaymentMethodOptionsUsBankAccountVerificationMethod::Automatic => { - "automatic" - } - PaymentIntentPaymentMethodOptionsUsBankAccountVerificationMethod::Instant => "instant", - PaymentIntentPaymentMethodOptionsUsBankAccountVerificationMethod::Microdeposits => { - "microdeposits" - } - } - } -} - -impl AsRef for PaymentIntentPaymentMethodOptionsUsBankAccountVerificationMethod { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for PaymentIntentPaymentMethodOptionsUsBankAccountVerificationMethod { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for PaymentIntentPaymentMethodOptionsUsBankAccountVerificationMethod { - fn default() -> Self { - Self::Automatic - } -} - -/// An enum representing the possible values of an `PaymentIntentProcessing`'s `type` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum PaymentIntentProcessingType { - Card, -} - -impl PaymentIntentProcessingType { - pub fn as_str(self) -> &'static str { - match self { - PaymentIntentProcessingType::Card => "card", - } - } -} - -impl AsRef for PaymentIntentProcessingType { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for PaymentIntentProcessingType { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for PaymentIntentProcessingType { - fn default() -> Self { - Self::Card - } -} - -/// An enum representing the possible values of an `PaymentIntent`'s `setup_future_usage` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum PaymentIntentSetupFutureUsage { - OffSession, - OnSession, -} - -impl PaymentIntentSetupFutureUsage { - pub fn as_str(self) -> &'static str { - match self { - PaymentIntentSetupFutureUsage::OffSession => "off_session", - PaymentIntentSetupFutureUsage::OnSession => "on_session", - } - } -} - -impl AsRef for PaymentIntentSetupFutureUsage { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for PaymentIntentSetupFutureUsage { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for PaymentIntentSetupFutureUsage { - fn default() -> Self { - Self::OffSession - } -} - -/// An enum representing the possible values of an `UpdatePaymentIntent`'s `setup_future_usage` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum PaymentIntentSetupFutureUsageFilter { - OffSession, - OnSession, -} - -impl PaymentIntentSetupFutureUsageFilter { - pub fn as_str(self) -> &'static str { - match self { - PaymentIntentSetupFutureUsageFilter::OffSession => "off_session", - PaymentIntentSetupFutureUsageFilter::OnSession => "on_session", - } - } -} - -impl AsRef for PaymentIntentSetupFutureUsageFilter { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for PaymentIntentSetupFutureUsageFilter { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for PaymentIntentSetupFutureUsageFilter { - fn default() -> Self { - Self::OffSession - } -} - -/// An enum representing the possible values of an `PaymentIntent`'s `status` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum PaymentIntentStatus { - Canceled, - Processing, - RequiresAction, - RequiresCapture, - RequiresConfirmation, - RequiresPaymentMethod, - Succeeded, -} - -impl PaymentIntentStatus { - pub fn as_str(self) -> &'static str { - match self { - PaymentIntentStatus::Canceled => "canceled", - PaymentIntentStatus::Processing => "processing", - PaymentIntentStatus::RequiresAction => "requires_action", - PaymentIntentStatus::RequiresCapture => "requires_capture", - PaymentIntentStatus::RequiresConfirmation => "requires_confirmation", - PaymentIntentStatus::RequiresPaymentMethod => "requires_payment_method", - PaymentIntentStatus::Succeeded => "succeeded", - } - } -} - -impl AsRef for PaymentIntentStatus { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for PaymentIntentStatus { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for PaymentIntentStatus { - fn default() -> Self { - Self::Canceled - } -} - -/// An enum representing the possible values of an `PaymentMethodOptionsAffirm`'s `capture_method` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum PaymentMethodOptionsAffirmCaptureMethod { - Manual, -} - -impl PaymentMethodOptionsAffirmCaptureMethod { - pub fn as_str(self) -> &'static str { - match self { - PaymentMethodOptionsAffirmCaptureMethod::Manual => "manual", - } - } -} - -impl AsRef for PaymentMethodOptionsAffirmCaptureMethod { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for PaymentMethodOptionsAffirmCaptureMethod { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for PaymentMethodOptionsAffirmCaptureMethod { - fn default() -> Self { - Self::Manual - } -} - -/// An enum representing the possible values of an `PaymentMethodOptionsAffirm`'s `setup_future_usage` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum PaymentMethodOptionsAffirmSetupFutureUsage { - None, -} - -impl PaymentMethodOptionsAffirmSetupFutureUsage { - pub fn as_str(self) -> &'static str { - match self { - PaymentMethodOptionsAffirmSetupFutureUsage::None => "none", - } - } -} - -impl AsRef for PaymentMethodOptionsAffirmSetupFutureUsage { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for PaymentMethodOptionsAffirmSetupFutureUsage { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for PaymentMethodOptionsAffirmSetupFutureUsage { - fn default() -> Self { - Self::None - } -} - -/// An enum representing the possible values of an `PaymentMethodOptionsAfterpayClearpay`'s `capture_method` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum PaymentMethodOptionsAfterpayClearpayCaptureMethod { - Manual, -} - -impl PaymentMethodOptionsAfterpayClearpayCaptureMethod { - pub fn as_str(self) -> &'static str { - match self { - PaymentMethodOptionsAfterpayClearpayCaptureMethod::Manual => "manual", - } - } -} - -impl AsRef for PaymentMethodOptionsAfterpayClearpayCaptureMethod { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for PaymentMethodOptionsAfterpayClearpayCaptureMethod { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for PaymentMethodOptionsAfterpayClearpayCaptureMethod { - fn default() -> Self { - Self::Manual - } -} - -/// An enum representing the possible values of an `PaymentMethodOptionsAfterpayClearpay`'s `setup_future_usage` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum PaymentMethodOptionsAfterpayClearpaySetupFutureUsage { - None, -} - -impl PaymentMethodOptionsAfterpayClearpaySetupFutureUsage { - pub fn as_str(self) -> &'static str { - match self { - PaymentMethodOptionsAfterpayClearpaySetupFutureUsage::None => "none", - } - } -} - -impl AsRef for PaymentMethodOptionsAfterpayClearpaySetupFutureUsage { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for PaymentMethodOptionsAfterpayClearpaySetupFutureUsage { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for PaymentMethodOptionsAfterpayClearpaySetupFutureUsage { - fn default() -> Self { - Self::None - } -} - -/// An enum representing the possible values of an `PaymentMethodOptionsAlipay`'s `setup_future_usage` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum PaymentMethodOptionsAlipaySetupFutureUsage { - None, - OffSession, -} - -impl PaymentMethodOptionsAlipaySetupFutureUsage { - pub fn as_str(self) -> &'static str { - match self { - PaymentMethodOptionsAlipaySetupFutureUsage::None => "none", - PaymentMethodOptionsAlipaySetupFutureUsage::OffSession => "off_session", - } - } -} - -impl AsRef for PaymentMethodOptionsAlipaySetupFutureUsage { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for PaymentMethodOptionsAlipaySetupFutureUsage { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for PaymentMethodOptionsAlipaySetupFutureUsage { - fn default() -> Self { - Self::None - } -} - -/// An enum representing the possible values of an `PaymentMethodOptionsBacsDebit`'s `setup_future_usage` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum PaymentMethodOptionsBacsDebitSetupFutureUsage { - None, - OffSession, - OnSession, -} - -impl PaymentMethodOptionsBacsDebitSetupFutureUsage { - pub fn as_str(self) -> &'static str { - match self { - PaymentMethodOptionsBacsDebitSetupFutureUsage::None => "none", - PaymentMethodOptionsBacsDebitSetupFutureUsage::OffSession => "off_session", - PaymentMethodOptionsBacsDebitSetupFutureUsage::OnSession => "on_session", - } - } -} - -impl AsRef for PaymentMethodOptionsBacsDebitSetupFutureUsage { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for PaymentMethodOptionsBacsDebitSetupFutureUsage { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for PaymentMethodOptionsBacsDebitSetupFutureUsage { - fn default() -> Self { - Self::None - } -} - -/// An enum representing the possible values of an `PaymentMethodOptionsBancontact`'s `preferred_language` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum PaymentMethodOptionsBancontactPreferredLanguage { - De, - En, - Fr, - Nl, -} - -impl PaymentMethodOptionsBancontactPreferredLanguage { - pub fn as_str(self) -> &'static str { - match self { - PaymentMethodOptionsBancontactPreferredLanguage::De => "de", - PaymentMethodOptionsBancontactPreferredLanguage::En => "en", - PaymentMethodOptionsBancontactPreferredLanguage::Fr => "fr", - PaymentMethodOptionsBancontactPreferredLanguage::Nl => "nl", - } - } -} - -impl AsRef for PaymentMethodOptionsBancontactPreferredLanguage { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for PaymentMethodOptionsBancontactPreferredLanguage { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for PaymentMethodOptionsBancontactPreferredLanguage { - fn default() -> Self { - Self::De - } -} - -/// An enum representing the possible values of an `PaymentMethodOptionsBancontact`'s `setup_future_usage` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum PaymentMethodOptionsBancontactSetupFutureUsage { - None, - OffSession, -} - -impl PaymentMethodOptionsBancontactSetupFutureUsage { - pub fn as_str(self) -> &'static str { - match self { - PaymentMethodOptionsBancontactSetupFutureUsage::None => "none", - PaymentMethodOptionsBancontactSetupFutureUsage::OffSession => "off_session", - } - } -} - -impl AsRef for PaymentMethodOptionsBancontactSetupFutureUsage { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for PaymentMethodOptionsBancontactSetupFutureUsage { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for PaymentMethodOptionsBancontactSetupFutureUsage { - fn default() -> Self { - Self::None - } -} - -/// An enum representing the possible values of an `PaymentMethodOptionsBoleto`'s `setup_future_usage` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum PaymentMethodOptionsBoletoSetupFutureUsage { - None, - OffSession, - OnSession, -} - -impl PaymentMethodOptionsBoletoSetupFutureUsage { - pub fn as_str(self) -> &'static str { - match self { - PaymentMethodOptionsBoletoSetupFutureUsage::None => "none", - PaymentMethodOptionsBoletoSetupFutureUsage::OffSession => "off_session", - PaymentMethodOptionsBoletoSetupFutureUsage::OnSession => "on_session", - } - } -} - -impl AsRef for PaymentMethodOptionsBoletoSetupFutureUsage { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for PaymentMethodOptionsBoletoSetupFutureUsage { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for PaymentMethodOptionsBoletoSetupFutureUsage { - fn default() -> Self { - Self::None - } -} - -/// An enum representing the possible values of an `PaymentMethodOptionsCardMandateOptions`'s `amount_type` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum PaymentMethodOptionsCardMandateOptionsAmountType { - Fixed, - Maximum, -} - -impl PaymentMethodOptionsCardMandateOptionsAmountType { - pub fn as_str(self) -> &'static str { - match self { - PaymentMethodOptionsCardMandateOptionsAmountType::Fixed => "fixed", - PaymentMethodOptionsCardMandateOptionsAmountType::Maximum => "maximum", - } - } -} - -impl AsRef for PaymentMethodOptionsCardMandateOptionsAmountType { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for PaymentMethodOptionsCardMandateOptionsAmountType { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for PaymentMethodOptionsCardMandateOptionsAmountType { - fn default() -> Self { - Self::Fixed - } -} - -/// An enum representing the possible values of an `PaymentMethodOptionsCardMandateOptions`'s `interval` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum PaymentMethodOptionsCardMandateOptionsInterval { - Day, - Month, - Sporadic, - Week, - Year, -} - -impl PaymentMethodOptionsCardMandateOptionsInterval { - pub fn as_str(self) -> &'static str { - match self { - PaymentMethodOptionsCardMandateOptionsInterval::Day => "day", - PaymentMethodOptionsCardMandateOptionsInterval::Month => "month", - PaymentMethodOptionsCardMandateOptionsInterval::Sporadic => "sporadic", - PaymentMethodOptionsCardMandateOptionsInterval::Week => "week", - PaymentMethodOptionsCardMandateOptionsInterval::Year => "year", - } - } -} - -impl AsRef for PaymentMethodOptionsCardMandateOptionsInterval { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for PaymentMethodOptionsCardMandateOptionsInterval { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for PaymentMethodOptionsCardMandateOptionsInterval { - fn default() -> Self { - Self::Day - } -} - -/// An enum representing the possible values of an `PaymentMethodOptionsCardMandateOptions`'s `supported_types` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum PaymentMethodOptionsCardMandateOptionsSupportedTypes { - India, -} - -impl PaymentMethodOptionsCardMandateOptionsSupportedTypes { - pub fn as_str(self) -> &'static str { - match self { - PaymentMethodOptionsCardMandateOptionsSupportedTypes::India => "india", - } - } -} - -impl AsRef for PaymentMethodOptionsCardMandateOptionsSupportedTypes { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for PaymentMethodOptionsCardMandateOptionsSupportedTypes { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for PaymentMethodOptionsCardMandateOptionsSupportedTypes { - fn default() -> Self { - Self::India - } -} - -/// An enum representing the possible values of an `PaymentMethodOptionsCashapp`'s `capture_method` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum PaymentMethodOptionsCashappCaptureMethod { - Manual, -} - -impl PaymentMethodOptionsCashappCaptureMethod { - pub fn as_str(self) -> &'static str { - match self { - PaymentMethodOptionsCashappCaptureMethod::Manual => "manual", - } - } -} - -impl AsRef for PaymentMethodOptionsCashappCaptureMethod { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for PaymentMethodOptionsCashappCaptureMethod { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for PaymentMethodOptionsCashappCaptureMethod { - fn default() -> Self { - Self::Manual - } -} - -/// An enum representing the possible values of an `PaymentMethodOptionsCashapp`'s `setup_future_usage` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum PaymentMethodOptionsCashappSetupFutureUsage { - None, - OffSession, - OnSession, -} - -impl PaymentMethodOptionsCashappSetupFutureUsage { - pub fn as_str(self) -> &'static str { - match self { - PaymentMethodOptionsCashappSetupFutureUsage::None => "none", - PaymentMethodOptionsCashappSetupFutureUsage::OffSession => "off_session", - PaymentMethodOptionsCashappSetupFutureUsage::OnSession => "on_session", - } - } -} - -impl AsRef for PaymentMethodOptionsCashappSetupFutureUsage { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for PaymentMethodOptionsCashappSetupFutureUsage { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for PaymentMethodOptionsCashappSetupFutureUsage { - fn default() -> Self { - Self::None - } -} - -/// An enum representing the possible values of an `PaymentMethodOptionsCustomerBalanceBankTransfer`'s `requested_address_types` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum PaymentMethodOptionsCustomerBalanceBankTransferRequestedAddressTypes { - Aba, - Iban, - Sepa, - SortCode, - Spei, - Swift, - Zengin, -} - -impl PaymentMethodOptionsCustomerBalanceBankTransferRequestedAddressTypes { - pub fn as_str(self) -> &'static str { - match self { - PaymentMethodOptionsCustomerBalanceBankTransferRequestedAddressTypes::Aba => "aba", - PaymentMethodOptionsCustomerBalanceBankTransferRequestedAddressTypes::Iban => "iban", - PaymentMethodOptionsCustomerBalanceBankTransferRequestedAddressTypes::Sepa => "sepa", - PaymentMethodOptionsCustomerBalanceBankTransferRequestedAddressTypes::SortCode => { - "sort_code" - } - PaymentMethodOptionsCustomerBalanceBankTransferRequestedAddressTypes::Spei => "spei", - PaymentMethodOptionsCustomerBalanceBankTransferRequestedAddressTypes::Swift => "swift", - PaymentMethodOptionsCustomerBalanceBankTransferRequestedAddressTypes::Zengin => { - "zengin" - } - } - } -} - -impl AsRef for PaymentMethodOptionsCustomerBalanceBankTransferRequestedAddressTypes { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for PaymentMethodOptionsCustomerBalanceBankTransferRequestedAddressTypes { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default - for PaymentMethodOptionsCustomerBalanceBankTransferRequestedAddressTypes -{ - fn default() -> Self { - Self::Aba - } -} - -/// An enum representing the possible values of an `PaymentMethodOptionsCustomerBalanceBankTransfer`'s `type` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum PaymentMethodOptionsCustomerBalanceBankTransferType { - EuBankTransfer, - GbBankTransfer, - JpBankTransfer, - MxBankTransfer, - UsBankTransfer, -} - -impl PaymentMethodOptionsCustomerBalanceBankTransferType { - pub fn as_str(self) -> &'static str { - match self { - PaymentMethodOptionsCustomerBalanceBankTransferType::EuBankTransfer => { - "eu_bank_transfer" - } - PaymentMethodOptionsCustomerBalanceBankTransferType::GbBankTransfer => { - "gb_bank_transfer" - } - PaymentMethodOptionsCustomerBalanceBankTransferType::JpBankTransfer => { - "jp_bank_transfer" - } - PaymentMethodOptionsCustomerBalanceBankTransferType::MxBankTransfer => { - "mx_bank_transfer" - } - PaymentMethodOptionsCustomerBalanceBankTransferType::UsBankTransfer => { - "us_bank_transfer" - } - } - } -} - -impl AsRef for PaymentMethodOptionsCustomerBalanceBankTransferType { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for PaymentMethodOptionsCustomerBalanceBankTransferType { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for PaymentMethodOptionsCustomerBalanceBankTransferType { - fn default() -> Self { - Self::EuBankTransfer - } -} - -/// An enum representing the possible values of an `PaymentMethodOptionsCustomerBalance`'s `funding_type` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum PaymentMethodOptionsCustomerBalanceFundingType { - BankTransfer, -} - -impl PaymentMethodOptionsCustomerBalanceFundingType { - pub fn as_str(self) -> &'static str { - match self { - PaymentMethodOptionsCustomerBalanceFundingType::BankTransfer => "bank_transfer", - } - } -} - -impl AsRef for PaymentMethodOptionsCustomerBalanceFundingType { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for PaymentMethodOptionsCustomerBalanceFundingType { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for PaymentMethodOptionsCustomerBalanceFundingType { - fn default() -> Self { - Self::BankTransfer - } -} - -/// An enum representing the possible values of an `PaymentMethodOptionsCustomerBalance`'s `setup_future_usage` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum PaymentMethodOptionsCustomerBalanceSetupFutureUsage { - None, -} - -impl PaymentMethodOptionsCustomerBalanceSetupFutureUsage { - pub fn as_str(self) -> &'static str { - match self { - PaymentMethodOptionsCustomerBalanceSetupFutureUsage::None => "none", - } - } -} - -impl AsRef for PaymentMethodOptionsCustomerBalanceSetupFutureUsage { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for PaymentMethodOptionsCustomerBalanceSetupFutureUsage { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for PaymentMethodOptionsCustomerBalanceSetupFutureUsage { - fn default() -> Self { - Self::None - } -} - -/// An enum representing the possible values of an `PaymentMethodOptionsFpx`'s `setup_future_usage` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum PaymentMethodOptionsFpxSetupFutureUsage { - None, -} - -impl PaymentMethodOptionsFpxSetupFutureUsage { - pub fn as_str(self) -> &'static str { - match self { - PaymentMethodOptionsFpxSetupFutureUsage::None => "none", - } - } -} - -impl AsRef for PaymentMethodOptionsFpxSetupFutureUsage { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for PaymentMethodOptionsFpxSetupFutureUsage { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for PaymentMethodOptionsFpxSetupFutureUsage { - fn default() -> Self { - Self::None - } -} - -/// An enum representing the possible values of an `PaymentMethodOptionsGiropay`'s `setup_future_usage` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum PaymentMethodOptionsGiropaySetupFutureUsage { - None, -} - -impl PaymentMethodOptionsGiropaySetupFutureUsage { - pub fn as_str(self) -> &'static str { - match self { - PaymentMethodOptionsGiropaySetupFutureUsage::None => "none", - } - } -} - -impl AsRef for PaymentMethodOptionsGiropaySetupFutureUsage { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for PaymentMethodOptionsGiropaySetupFutureUsage { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for PaymentMethodOptionsGiropaySetupFutureUsage { - fn default() -> Self { - Self::None - } -} - -/// An enum representing the possible values of an `PaymentMethodOptionsGrabpay`'s `setup_future_usage` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum PaymentMethodOptionsGrabpaySetupFutureUsage { - None, -} - -impl PaymentMethodOptionsGrabpaySetupFutureUsage { - pub fn as_str(self) -> &'static str { - match self { - PaymentMethodOptionsGrabpaySetupFutureUsage::None => "none", - } - } -} - -impl AsRef for PaymentMethodOptionsGrabpaySetupFutureUsage { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for PaymentMethodOptionsGrabpaySetupFutureUsage { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for PaymentMethodOptionsGrabpaySetupFutureUsage { - fn default() -> Self { - Self::None - } -} - -/// An enum representing the possible values of an `PaymentMethodOptionsIdeal`'s `setup_future_usage` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum PaymentMethodOptionsIdealSetupFutureUsage { - None, - OffSession, -} - -impl PaymentMethodOptionsIdealSetupFutureUsage { - pub fn as_str(self) -> &'static str { - match self { - PaymentMethodOptionsIdealSetupFutureUsage::None => "none", - PaymentMethodOptionsIdealSetupFutureUsage::OffSession => "off_session", - } - } -} - -impl AsRef for PaymentMethodOptionsIdealSetupFutureUsage { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for PaymentMethodOptionsIdealSetupFutureUsage { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for PaymentMethodOptionsIdealSetupFutureUsage { - fn default() -> Self { - Self::None - } -} - -/// An enum representing the possible values of an `PaymentMethodOptionsKlarna`'s `capture_method` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum PaymentMethodOptionsKlarnaCaptureMethod { - Manual, -} - -impl PaymentMethodOptionsKlarnaCaptureMethod { - pub fn as_str(self) -> &'static str { - match self { - PaymentMethodOptionsKlarnaCaptureMethod::Manual => "manual", - } - } -} - -impl AsRef for PaymentMethodOptionsKlarnaCaptureMethod { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for PaymentMethodOptionsKlarnaCaptureMethod { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for PaymentMethodOptionsKlarnaCaptureMethod { - fn default() -> Self { - Self::Manual - } -} - -/// An enum representing the possible values of an `PaymentMethodOptionsKlarna`'s `setup_future_usage` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum PaymentMethodOptionsKlarnaSetupFutureUsage { - None, -} - -impl PaymentMethodOptionsKlarnaSetupFutureUsage { - pub fn as_str(self) -> &'static str { - match self { - PaymentMethodOptionsKlarnaSetupFutureUsage::None => "none", - } - } -} - -impl AsRef for PaymentMethodOptionsKlarnaSetupFutureUsage { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for PaymentMethodOptionsKlarnaSetupFutureUsage { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for PaymentMethodOptionsKlarnaSetupFutureUsage { - fn default() -> Self { - Self::None - } -} - -/// An enum representing the possible values of an `PaymentMethodOptionsKonbini`'s `setup_future_usage` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum PaymentMethodOptionsKonbiniSetupFutureUsage { - None, -} - -impl PaymentMethodOptionsKonbiniSetupFutureUsage { - pub fn as_str(self) -> &'static str { - match self { - PaymentMethodOptionsKonbiniSetupFutureUsage::None => "none", - } - } -} - -impl AsRef for PaymentMethodOptionsKonbiniSetupFutureUsage { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for PaymentMethodOptionsKonbiniSetupFutureUsage { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for PaymentMethodOptionsKonbiniSetupFutureUsage { - fn default() -> Self { - Self::None - } -} - -/// An enum representing the possible values of an `PaymentMethodOptionsOxxo`'s `setup_future_usage` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum PaymentMethodOptionsOxxoSetupFutureUsage { - None, -} - -impl PaymentMethodOptionsOxxoSetupFutureUsage { - pub fn as_str(self) -> &'static str { - match self { - PaymentMethodOptionsOxxoSetupFutureUsage::None => "none", - } - } -} - -impl AsRef for PaymentMethodOptionsOxxoSetupFutureUsage { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for PaymentMethodOptionsOxxoSetupFutureUsage { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for PaymentMethodOptionsOxxoSetupFutureUsage { - fn default() -> Self { - Self::None - } -} - -/// An enum representing the possible values of an `PaymentMethodOptionsP24`'s `setup_future_usage` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum PaymentMethodOptionsP24SetupFutureUsage { - None, -} - -impl PaymentMethodOptionsP24SetupFutureUsage { - pub fn as_str(self) -> &'static str { - match self { - PaymentMethodOptionsP24SetupFutureUsage::None => "none", - } - } -} - -impl AsRef for PaymentMethodOptionsP24SetupFutureUsage { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for PaymentMethodOptionsP24SetupFutureUsage { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for PaymentMethodOptionsP24SetupFutureUsage { - fn default() -> Self { - Self::None - } -} - -/// An enum representing the possible values of an `PaymentMethodOptionsPaynow`'s `setup_future_usage` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum PaymentMethodOptionsPaynowSetupFutureUsage { - None, -} - -impl PaymentMethodOptionsPaynowSetupFutureUsage { - pub fn as_str(self) -> &'static str { - match self { - PaymentMethodOptionsPaynowSetupFutureUsage::None => "none", - } - } -} - -impl AsRef for PaymentMethodOptionsPaynowSetupFutureUsage { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for PaymentMethodOptionsPaynowSetupFutureUsage { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for PaymentMethodOptionsPaynowSetupFutureUsage { - fn default() -> Self { - Self::None - } -} - -/// An enum representing the possible values of an `PaymentMethodOptionsPaypal`'s `capture_method` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum PaymentMethodOptionsPaypalCaptureMethod { - Manual, -} - -impl PaymentMethodOptionsPaypalCaptureMethod { - pub fn as_str(self) -> &'static str { - match self { - PaymentMethodOptionsPaypalCaptureMethod::Manual => "manual", - } - } -} - -impl AsRef for PaymentMethodOptionsPaypalCaptureMethod { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for PaymentMethodOptionsPaypalCaptureMethod { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for PaymentMethodOptionsPaypalCaptureMethod { - fn default() -> Self { - Self::Manual - } -} - -/// An enum representing the possible values of an `PaymentMethodOptionsPaypal`'s `setup_future_usage` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum PaymentMethodOptionsPaypalSetupFutureUsage { - None, - OffSession, -} - -impl PaymentMethodOptionsPaypalSetupFutureUsage { - pub fn as_str(self) -> &'static str { - match self { - PaymentMethodOptionsPaypalSetupFutureUsage::None => "none", - PaymentMethodOptionsPaypalSetupFutureUsage::OffSession => "off_session", - } - } -} - -impl AsRef for PaymentMethodOptionsPaypalSetupFutureUsage { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for PaymentMethodOptionsPaypalSetupFutureUsage { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for PaymentMethodOptionsPaypalSetupFutureUsage { - fn default() -> Self { - Self::None - } -} - -/// An enum representing the possible values of an `PaymentMethodOptionsPix`'s `setup_future_usage` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum PaymentMethodOptionsPixSetupFutureUsage { - None, -} - -impl PaymentMethodOptionsPixSetupFutureUsage { - pub fn as_str(self) -> &'static str { - match self { - PaymentMethodOptionsPixSetupFutureUsage::None => "none", - } - } -} - -impl AsRef for PaymentMethodOptionsPixSetupFutureUsage { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for PaymentMethodOptionsPixSetupFutureUsage { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for PaymentMethodOptionsPixSetupFutureUsage { - fn default() -> Self { - Self::None - } -} - -/// An enum representing the possible values of an `PaymentMethodOptionsPromptpay`'s `setup_future_usage` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum PaymentMethodOptionsPromptpaySetupFutureUsage { - None, -} - -impl PaymentMethodOptionsPromptpaySetupFutureUsage { - pub fn as_str(self) -> &'static str { - match self { - PaymentMethodOptionsPromptpaySetupFutureUsage::None => "none", - } - } -} - -impl AsRef for PaymentMethodOptionsPromptpaySetupFutureUsage { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for PaymentMethodOptionsPromptpaySetupFutureUsage { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for PaymentMethodOptionsPromptpaySetupFutureUsage { - fn default() -> Self { - Self::None - } -} - -/// An enum representing the possible values of an `PaymentMethodOptionsSofort`'s `preferred_language` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum PaymentMethodOptionsSofortPreferredLanguage { - De, - En, - Es, - Fr, - It, - Nl, - Pl, -} - -impl PaymentMethodOptionsSofortPreferredLanguage { - pub fn as_str(self) -> &'static str { - match self { - PaymentMethodOptionsSofortPreferredLanguage::De => "de", - PaymentMethodOptionsSofortPreferredLanguage::En => "en", - PaymentMethodOptionsSofortPreferredLanguage::Es => "es", - PaymentMethodOptionsSofortPreferredLanguage::Fr => "fr", - PaymentMethodOptionsSofortPreferredLanguage::It => "it", - PaymentMethodOptionsSofortPreferredLanguage::Nl => "nl", - PaymentMethodOptionsSofortPreferredLanguage::Pl => "pl", - } - } -} - -impl AsRef for PaymentMethodOptionsSofortPreferredLanguage { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for PaymentMethodOptionsSofortPreferredLanguage { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for PaymentMethodOptionsSofortPreferredLanguage { - fn default() -> Self { - Self::De - } -} - -/// An enum representing the possible values of an `PaymentMethodOptionsSofort`'s `setup_future_usage` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum PaymentMethodOptionsSofortSetupFutureUsage { - None, - OffSession, -} - -impl PaymentMethodOptionsSofortSetupFutureUsage { - pub fn as_str(self) -> &'static str { - match self { - PaymentMethodOptionsSofortSetupFutureUsage::None => "none", - PaymentMethodOptionsSofortSetupFutureUsage::OffSession => "off_session", - } - } -} - -impl AsRef for PaymentMethodOptionsSofortSetupFutureUsage { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for PaymentMethodOptionsSofortSetupFutureUsage { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for PaymentMethodOptionsSofortSetupFutureUsage { - fn default() -> Self { - Self::None - } -} - -/// An enum representing the possible values of an `PaymentMethodOptionsWechatPay`'s `client` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum PaymentMethodOptionsWechatPayClient { - Android, - Ios, - Web, -} - -impl PaymentMethodOptionsWechatPayClient { - pub fn as_str(self) -> &'static str { - match self { - PaymentMethodOptionsWechatPayClient::Android => "android", - PaymentMethodOptionsWechatPayClient::Ios => "ios", - PaymentMethodOptionsWechatPayClient::Web => "web", - } - } -} - -impl AsRef for PaymentMethodOptionsWechatPayClient { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for PaymentMethodOptionsWechatPayClient { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for PaymentMethodOptionsWechatPayClient { - fn default() -> Self { - Self::Android - } -} - -/// An enum representing the possible values of an `PaymentMethodOptionsWechatPay`'s `setup_future_usage` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum PaymentMethodOptionsWechatPaySetupFutureUsage { - None, -} - -impl PaymentMethodOptionsWechatPaySetupFutureUsage { - pub fn as_str(self) -> &'static str { - match self { - PaymentMethodOptionsWechatPaySetupFutureUsage::None => "none", - } - } -} - -impl AsRef for PaymentMethodOptionsWechatPaySetupFutureUsage { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for PaymentMethodOptionsWechatPaySetupFutureUsage { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for PaymentMethodOptionsWechatPaySetupFutureUsage { - fn default() -> Self { - Self::None - } -} - -/// An enum representing the possible values of an `PaymentMethodOptionsZip`'s `setup_future_usage` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum PaymentMethodOptionsZipSetupFutureUsage { - None, -} - -impl PaymentMethodOptionsZipSetupFutureUsage { - pub fn as_str(self) -> &'static str { - match self { - PaymentMethodOptionsZipSetupFutureUsage::None => "none", - } - } -} - -impl AsRef for PaymentMethodOptionsZipSetupFutureUsage { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for PaymentMethodOptionsZipSetupFutureUsage { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for PaymentMethodOptionsZipSetupFutureUsage { - fn default() -> Self { - Self::None - } -} - -/// An enum representing the possible values of an `UpdatePaymentIntentPaymentMethodDataEps`'s `bank` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum UpdatePaymentIntentPaymentMethodDataEpsBank { - ArzteUndApothekerBank, - AustrianAnadiBankAg, - BankAustria, - BankhausCarlSpangler, - BankhausSchelhammerUndSchatteraAg, - BawagPskAg, - BksBankAg, - BrullKallmusBankAg, - BtvVierLanderBank, - CapitalBankGraweGruppeAg, - DeutscheBankAg, - Dolomitenbank, - EasybankAg, - ErsteBankUndSparkassen, - HypoAlpeadriabankInternationalAg, - HypoBankBurgenlandAktiengesellschaft, - HypoNoeLbFurNiederosterreichUWien, - HypoOberosterreichSalzburgSteiermark, - HypoTirolBankAg, - HypoVorarlbergBankAg, - MarchfelderBank, - OberbankAg, - RaiffeisenBankengruppeOsterreich, - SchoellerbankAg, - SpardaBankWien, - VolksbankGruppe, - VolkskreditbankAg, - VrBankBraunau, -} - -impl UpdatePaymentIntentPaymentMethodDataEpsBank { - pub fn as_str(self) -> &'static str { - match self { - UpdatePaymentIntentPaymentMethodDataEpsBank::ArzteUndApothekerBank => { - "arzte_und_apotheker_bank" - } - UpdatePaymentIntentPaymentMethodDataEpsBank::AustrianAnadiBankAg => { - "austrian_anadi_bank_ag" - } - UpdatePaymentIntentPaymentMethodDataEpsBank::BankAustria => "bank_austria", - UpdatePaymentIntentPaymentMethodDataEpsBank::BankhausCarlSpangler => { - "bankhaus_carl_spangler" - } - UpdatePaymentIntentPaymentMethodDataEpsBank::BankhausSchelhammerUndSchatteraAg => { - "bankhaus_schelhammer_und_schattera_ag" - } - UpdatePaymentIntentPaymentMethodDataEpsBank::BawagPskAg => "bawag_psk_ag", - UpdatePaymentIntentPaymentMethodDataEpsBank::BksBankAg => "bks_bank_ag", - UpdatePaymentIntentPaymentMethodDataEpsBank::BrullKallmusBankAg => { - "brull_kallmus_bank_ag" - } - UpdatePaymentIntentPaymentMethodDataEpsBank::BtvVierLanderBank => { - "btv_vier_lander_bank" - } - UpdatePaymentIntentPaymentMethodDataEpsBank::CapitalBankGraweGruppeAg => { - "capital_bank_grawe_gruppe_ag" - } - UpdatePaymentIntentPaymentMethodDataEpsBank::DeutscheBankAg => "deutsche_bank_ag", - UpdatePaymentIntentPaymentMethodDataEpsBank::Dolomitenbank => "dolomitenbank", - UpdatePaymentIntentPaymentMethodDataEpsBank::EasybankAg => "easybank_ag", - UpdatePaymentIntentPaymentMethodDataEpsBank::ErsteBankUndSparkassen => { - "erste_bank_und_sparkassen" - } - UpdatePaymentIntentPaymentMethodDataEpsBank::HypoAlpeadriabankInternationalAg => { - "hypo_alpeadriabank_international_ag" - } - UpdatePaymentIntentPaymentMethodDataEpsBank::HypoBankBurgenlandAktiengesellschaft => { - "hypo_bank_burgenland_aktiengesellschaft" - } - UpdatePaymentIntentPaymentMethodDataEpsBank::HypoNoeLbFurNiederosterreichUWien => { - "hypo_noe_lb_fur_niederosterreich_u_wien" - } - UpdatePaymentIntentPaymentMethodDataEpsBank::HypoOberosterreichSalzburgSteiermark => { - "hypo_oberosterreich_salzburg_steiermark" - } - UpdatePaymentIntentPaymentMethodDataEpsBank::HypoTirolBankAg => "hypo_tirol_bank_ag", - UpdatePaymentIntentPaymentMethodDataEpsBank::HypoVorarlbergBankAg => { - "hypo_vorarlberg_bank_ag" - } - UpdatePaymentIntentPaymentMethodDataEpsBank::MarchfelderBank => "marchfelder_bank", - UpdatePaymentIntentPaymentMethodDataEpsBank::OberbankAg => "oberbank_ag", - UpdatePaymentIntentPaymentMethodDataEpsBank::RaiffeisenBankengruppeOsterreich => { - "raiffeisen_bankengruppe_osterreich" - } - UpdatePaymentIntentPaymentMethodDataEpsBank::SchoellerbankAg => "schoellerbank_ag", - UpdatePaymentIntentPaymentMethodDataEpsBank::SpardaBankWien => "sparda_bank_wien", - UpdatePaymentIntentPaymentMethodDataEpsBank::VolksbankGruppe => "volksbank_gruppe", - UpdatePaymentIntentPaymentMethodDataEpsBank::VolkskreditbankAg => "volkskreditbank_ag", - UpdatePaymentIntentPaymentMethodDataEpsBank::VrBankBraunau => "vr_bank_braunau", - } - } -} - -impl AsRef for UpdatePaymentIntentPaymentMethodDataEpsBank { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for UpdatePaymentIntentPaymentMethodDataEpsBank { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for UpdatePaymentIntentPaymentMethodDataEpsBank { - fn default() -> Self { - Self::ArzteUndApothekerBank - } -} - -/// An enum representing the possible values of an `UpdatePaymentIntentPaymentMethodDataFpx`'s `account_holder_type` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum UpdatePaymentIntentPaymentMethodDataFpxAccountHolderType { - Company, - Individual, -} - -impl UpdatePaymentIntentPaymentMethodDataFpxAccountHolderType { - pub fn as_str(self) -> &'static str { - match self { - UpdatePaymentIntentPaymentMethodDataFpxAccountHolderType::Company => "company", - UpdatePaymentIntentPaymentMethodDataFpxAccountHolderType::Individual => "individual", - } - } -} - -impl AsRef for UpdatePaymentIntentPaymentMethodDataFpxAccountHolderType { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for UpdatePaymentIntentPaymentMethodDataFpxAccountHolderType { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for UpdatePaymentIntentPaymentMethodDataFpxAccountHolderType { - fn default() -> Self { - Self::Company - } -} - -/// An enum representing the possible values of an `UpdatePaymentIntentPaymentMethodDataFpx`'s `bank` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum UpdatePaymentIntentPaymentMethodDataFpxBank { - AffinBank, - Agrobank, - AllianceBank, - Ambank, - BankIslam, - BankMuamalat, - BankOfChina, - BankRakyat, - Bsn, - Cimb, - DeutscheBank, - HongLeongBank, - Hsbc, - Kfh, - Maybank2e, - Maybank2u, - Ocbc, - PbEnterprise, - PublicBank, - Rhb, - StandardChartered, - Uob, -} - -impl UpdatePaymentIntentPaymentMethodDataFpxBank { - pub fn as_str(self) -> &'static str { - match self { - UpdatePaymentIntentPaymentMethodDataFpxBank::AffinBank => "affin_bank", - UpdatePaymentIntentPaymentMethodDataFpxBank::Agrobank => "agrobank", - UpdatePaymentIntentPaymentMethodDataFpxBank::AllianceBank => "alliance_bank", - UpdatePaymentIntentPaymentMethodDataFpxBank::Ambank => "ambank", - UpdatePaymentIntentPaymentMethodDataFpxBank::BankIslam => "bank_islam", - UpdatePaymentIntentPaymentMethodDataFpxBank::BankMuamalat => "bank_muamalat", - UpdatePaymentIntentPaymentMethodDataFpxBank::BankOfChina => "bank_of_china", - UpdatePaymentIntentPaymentMethodDataFpxBank::BankRakyat => "bank_rakyat", - UpdatePaymentIntentPaymentMethodDataFpxBank::Bsn => "bsn", - UpdatePaymentIntentPaymentMethodDataFpxBank::Cimb => "cimb", - UpdatePaymentIntentPaymentMethodDataFpxBank::DeutscheBank => "deutsche_bank", - UpdatePaymentIntentPaymentMethodDataFpxBank::HongLeongBank => "hong_leong_bank", - UpdatePaymentIntentPaymentMethodDataFpxBank::Hsbc => "hsbc", - UpdatePaymentIntentPaymentMethodDataFpxBank::Kfh => "kfh", - UpdatePaymentIntentPaymentMethodDataFpxBank::Maybank2e => "maybank2e", - UpdatePaymentIntentPaymentMethodDataFpxBank::Maybank2u => "maybank2u", - UpdatePaymentIntentPaymentMethodDataFpxBank::Ocbc => "ocbc", - UpdatePaymentIntentPaymentMethodDataFpxBank::PbEnterprise => "pb_enterprise", - UpdatePaymentIntentPaymentMethodDataFpxBank::PublicBank => "public_bank", - UpdatePaymentIntentPaymentMethodDataFpxBank::Rhb => "rhb", - UpdatePaymentIntentPaymentMethodDataFpxBank::StandardChartered => "standard_chartered", - UpdatePaymentIntentPaymentMethodDataFpxBank::Uob => "uob", - } - } -} - -impl AsRef for UpdatePaymentIntentPaymentMethodDataFpxBank { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for UpdatePaymentIntentPaymentMethodDataFpxBank { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for UpdatePaymentIntentPaymentMethodDataFpxBank { - fn default() -> Self { - Self::AffinBank - } -} - -/// An enum representing the possible values of an `UpdatePaymentIntentPaymentMethodDataIdeal`'s `bank` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum UpdatePaymentIntentPaymentMethodDataIdealBank { - AbnAmro, - AsnBank, - Bunq, - Handelsbanken, - Ing, - Knab, - Moneyou, - N26, - Nn, - Rabobank, - Regiobank, - Revolut, - SnsBank, - TriodosBank, - VanLanschot, - Yoursafe, -} - -impl UpdatePaymentIntentPaymentMethodDataIdealBank { - pub fn as_str(self) -> &'static str { - match self { - UpdatePaymentIntentPaymentMethodDataIdealBank::AbnAmro => "abn_amro", - UpdatePaymentIntentPaymentMethodDataIdealBank::AsnBank => "asn_bank", - UpdatePaymentIntentPaymentMethodDataIdealBank::Bunq => "bunq", - UpdatePaymentIntentPaymentMethodDataIdealBank::Handelsbanken => "handelsbanken", - UpdatePaymentIntentPaymentMethodDataIdealBank::Ing => "ing", - UpdatePaymentIntentPaymentMethodDataIdealBank::Knab => "knab", - UpdatePaymentIntentPaymentMethodDataIdealBank::Moneyou => "moneyou", - UpdatePaymentIntentPaymentMethodDataIdealBank::N26 => "n26", - UpdatePaymentIntentPaymentMethodDataIdealBank::Nn => "nn", - UpdatePaymentIntentPaymentMethodDataIdealBank::Rabobank => "rabobank", - UpdatePaymentIntentPaymentMethodDataIdealBank::Regiobank => "regiobank", - UpdatePaymentIntentPaymentMethodDataIdealBank::Revolut => "revolut", - UpdatePaymentIntentPaymentMethodDataIdealBank::SnsBank => "sns_bank", - UpdatePaymentIntentPaymentMethodDataIdealBank::TriodosBank => "triodos_bank", - UpdatePaymentIntentPaymentMethodDataIdealBank::VanLanschot => "van_lanschot", - UpdatePaymentIntentPaymentMethodDataIdealBank::Yoursafe => "yoursafe", - } - } -} - -impl AsRef for UpdatePaymentIntentPaymentMethodDataIdealBank { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for UpdatePaymentIntentPaymentMethodDataIdealBank { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for UpdatePaymentIntentPaymentMethodDataIdealBank { - fn default() -> Self { - Self::AbnAmro - } -} - -/// An enum representing the possible values of an `UpdatePaymentIntentPaymentMethodDataP24`'s `bank` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum UpdatePaymentIntentPaymentMethodDataP24Bank { - AliorBank, - BankMillennium, - BankNowyBfgSa, - BankPekaoSa, - BankiSpbdzielcze, - Blik, - BnpParibas, - Boz, - CitiHandlowy, - CreditAgricole, - Envelobank, - EtransferPocztowy24, - GetinBank, - Ideabank, - Ing, - Inteligo, - MbankMtransfer, - NestPrzelew, - NoblePay, - PbacZIpko, - PlusBank, - SantanderPrzelew24, - TmobileUsbugiBankowe, - ToyotaBank, - Velobank, - VolkswagenBank, -} - -impl UpdatePaymentIntentPaymentMethodDataP24Bank { - pub fn as_str(self) -> &'static str { - match self { - UpdatePaymentIntentPaymentMethodDataP24Bank::AliorBank => "alior_bank", - UpdatePaymentIntentPaymentMethodDataP24Bank::BankMillennium => "bank_millennium", - UpdatePaymentIntentPaymentMethodDataP24Bank::BankNowyBfgSa => "bank_nowy_bfg_sa", - UpdatePaymentIntentPaymentMethodDataP24Bank::BankPekaoSa => "bank_pekao_sa", - UpdatePaymentIntentPaymentMethodDataP24Bank::BankiSpbdzielcze => "banki_spbdzielcze", - UpdatePaymentIntentPaymentMethodDataP24Bank::Blik => "blik", - UpdatePaymentIntentPaymentMethodDataP24Bank::BnpParibas => "bnp_paribas", - UpdatePaymentIntentPaymentMethodDataP24Bank::Boz => "boz", - UpdatePaymentIntentPaymentMethodDataP24Bank::CitiHandlowy => "citi_handlowy", - UpdatePaymentIntentPaymentMethodDataP24Bank::CreditAgricole => "credit_agricole", - UpdatePaymentIntentPaymentMethodDataP24Bank::Envelobank => "envelobank", - UpdatePaymentIntentPaymentMethodDataP24Bank::EtransferPocztowy24 => { - "etransfer_pocztowy24" - } - UpdatePaymentIntentPaymentMethodDataP24Bank::GetinBank => "getin_bank", - UpdatePaymentIntentPaymentMethodDataP24Bank::Ideabank => "ideabank", - UpdatePaymentIntentPaymentMethodDataP24Bank::Ing => "ing", - UpdatePaymentIntentPaymentMethodDataP24Bank::Inteligo => "inteligo", - UpdatePaymentIntentPaymentMethodDataP24Bank::MbankMtransfer => "mbank_mtransfer", - UpdatePaymentIntentPaymentMethodDataP24Bank::NestPrzelew => "nest_przelew", - UpdatePaymentIntentPaymentMethodDataP24Bank::NoblePay => "noble_pay", - UpdatePaymentIntentPaymentMethodDataP24Bank::PbacZIpko => "pbac_z_ipko", - UpdatePaymentIntentPaymentMethodDataP24Bank::PlusBank => "plus_bank", - UpdatePaymentIntentPaymentMethodDataP24Bank::SantanderPrzelew24 => { - "santander_przelew24" - } - UpdatePaymentIntentPaymentMethodDataP24Bank::TmobileUsbugiBankowe => { - "tmobile_usbugi_bankowe" - } - UpdatePaymentIntentPaymentMethodDataP24Bank::ToyotaBank => "toyota_bank", - UpdatePaymentIntentPaymentMethodDataP24Bank::Velobank => "velobank", - UpdatePaymentIntentPaymentMethodDataP24Bank::VolkswagenBank => "volkswagen_bank", - } - } -} - -impl AsRef for UpdatePaymentIntentPaymentMethodDataP24Bank { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for UpdatePaymentIntentPaymentMethodDataP24Bank { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for UpdatePaymentIntentPaymentMethodDataP24Bank { - fn default() -> Self { - Self::AliorBank - } -} - -/// An enum representing the possible values of an `UpdatePaymentIntentPaymentMethodDataSofort`'s `country` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum UpdatePaymentIntentPaymentMethodDataSofortCountry { - #[serde(rename = "AT")] - At, - #[serde(rename = "BE")] - Be, - #[serde(rename = "DE")] - De, - #[serde(rename = "ES")] - Es, - #[serde(rename = "IT")] - It, - #[serde(rename = "NL")] - Nl, -} - -impl UpdatePaymentIntentPaymentMethodDataSofortCountry { - pub fn as_str(self) -> &'static str { - match self { - UpdatePaymentIntentPaymentMethodDataSofortCountry::At => "AT", - UpdatePaymentIntentPaymentMethodDataSofortCountry::Be => "BE", - UpdatePaymentIntentPaymentMethodDataSofortCountry::De => "DE", - UpdatePaymentIntentPaymentMethodDataSofortCountry::Es => "ES", - UpdatePaymentIntentPaymentMethodDataSofortCountry::It => "IT", - UpdatePaymentIntentPaymentMethodDataSofortCountry::Nl => "NL", - } - } -} - -impl AsRef for UpdatePaymentIntentPaymentMethodDataSofortCountry { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for UpdatePaymentIntentPaymentMethodDataSofortCountry { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for UpdatePaymentIntentPaymentMethodDataSofortCountry { - fn default() -> Self { - Self::At - } -} - -/// An enum representing the possible values of an `UpdatePaymentIntentPaymentMethodData`'s `type` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum UpdatePaymentIntentPaymentMethodDataType { - AcssDebit, - Affirm, - AfterpayClearpay, - Alipay, - AuBecsDebit, - BacsDebit, - Bancontact, - Blik, - Boleto, - Cashapp, - CustomerBalance, - Eps, - Fpx, - Giropay, - Grabpay, - Ideal, - Klarna, - Konbini, - Link, - Oxxo, - P24, - Paynow, - Paypal, - Pix, - Promptpay, - RevolutPay, - SepaDebit, - Sofort, - Swish, - UsBankAccount, - WechatPay, - Zip, -} - -impl UpdatePaymentIntentPaymentMethodDataType { - pub fn as_str(self) -> &'static str { - match self { - UpdatePaymentIntentPaymentMethodDataType::AcssDebit => "acss_debit", - UpdatePaymentIntentPaymentMethodDataType::Affirm => "affirm", - UpdatePaymentIntentPaymentMethodDataType::AfterpayClearpay => "afterpay_clearpay", - UpdatePaymentIntentPaymentMethodDataType::Alipay => "alipay", - UpdatePaymentIntentPaymentMethodDataType::AuBecsDebit => "au_becs_debit", - UpdatePaymentIntentPaymentMethodDataType::BacsDebit => "bacs_debit", - UpdatePaymentIntentPaymentMethodDataType::Bancontact => "bancontact", - UpdatePaymentIntentPaymentMethodDataType::Blik => "blik", - UpdatePaymentIntentPaymentMethodDataType::Boleto => "boleto", - UpdatePaymentIntentPaymentMethodDataType::Cashapp => "cashapp", - UpdatePaymentIntentPaymentMethodDataType::CustomerBalance => "customer_balance", - UpdatePaymentIntentPaymentMethodDataType::Eps => "eps", - UpdatePaymentIntentPaymentMethodDataType::Fpx => "fpx", - UpdatePaymentIntentPaymentMethodDataType::Giropay => "giropay", - UpdatePaymentIntentPaymentMethodDataType::Grabpay => "grabpay", - UpdatePaymentIntentPaymentMethodDataType::Ideal => "ideal", - UpdatePaymentIntentPaymentMethodDataType::Klarna => "klarna", - UpdatePaymentIntentPaymentMethodDataType::Konbini => "konbini", - UpdatePaymentIntentPaymentMethodDataType::Link => "link", - UpdatePaymentIntentPaymentMethodDataType::Oxxo => "oxxo", - UpdatePaymentIntentPaymentMethodDataType::P24 => "p24", - UpdatePaymentIntentPaymentMethodDataType::Paynow => "paynow", - UpdatePaymentIntentPaymentMethodDataType::Paypal => "paypal", - UpdatePaymentIntentPaymentMethodDataType::Pix => "pix", - UpdatePaymentIntentPaymentMethodDataType::Promptpay => "promptpay", - UpdatePaymentIntentPaymentMethodDataType::RevolutPay => "revolut_pay", - UpdatePaymentIntentPaymentMethodDataType::SepaDebit => "sepa_debit", - UpdatePaymentIntentPaymentMethodDataType::Sofort => "sofort", - UpdatePaymentIntentPaymentMethodDataType::Swish => "swish", - UpdatePaymentIntentPaymentMethodDataType::UsBankAccount => "us_bank_account", - UpdatePaymentIntentPaymentMethodDataType::WechatPay => "wechat_pay", - UpdatePaymentIntentPaymentMethodDataType::Zip => "zip", - } - } -} - -impl AsRef for UpdatePaymentIntentPaymentMethodDataType { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for UpdatePaymentIntentPaymentMethodDataType { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for UpdatePaymentIntentPaymentMethodDataType { - fn default() -> Self { - Self::AcssDebit - } -} - -/// An enum representing the possible values of an `UpdatePaymentIntentPaymentMethodDataUsBankAccount`'s `account_holder_type` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum UpdatePaymentIntentPaymentMethodDataUsBankAccountAccountHolderType { - Company, - Individual, -} - -impl UpdatePaymentIntentPaymentMethodDataUsBankAccountAccountHolderType { - pub fn as_str(self) -> &'static str { - match self { - UpdatePaymentIntentPaymentMethodDataUsBankAccountAccountHolderType::Company => { - "company" - } - UpdatePaymentIntentPaymentMethodDataUsBankAccountAccountHolderType::Individual => { - "individual" - } - } - } -} - -impl AsRef for UpdatePaymentIntentPaymentMethodDataUsBankAccountAccountHolderType { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for UpdatePaymentIntentPaymentMethodDataUsBankAccountAccountHolderType { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for UpdatePaymentIntentPaymentMethodDataUsBankAccountAccountHolderType { - fn default() -> Self { - Self::Company - } -} - -/// An enum representing the possible values of an `UpdatePaymentIntentPaymentMethodDataUsBankAccount`'s `account_type` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum UpdatePaymentIntentPaymentMethodDataUsBankAccountAccountType { - Checking, - Savings, -} - -impl UpdatePaymentIntentPaymentMethodDataUsBankAccountAccountType { - pub fn as_str(self) -> &'static str { - match self { - UpdatePaymentIntentPaymentMethodDataUsBankAccountAccountType::Checking => "checking", - UpdatePaymentIntentPaymentMethodDataUsBankAccountAccountType::Savings => "savings", - } - } -} - -impl AsRef for UpdatePaymentIntentPaymentMethodDataUsBankAccountAccountType { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for UpdatePaymentIntentPaymentMethodDataUsBankAccountAccountType { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for UpdatePaymentIntentPaymentMethodDataUsBankAccountAccountType { - fn default() -> Self { - Self::Checking - } -} - -/// An enum representing the possible values of an `UpdatePaymentIntentPaymentMethodOptionsAcssDebitMandateOptions`'s `payment_schedule` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum UpdatePaymentIntentPaymentMethodOptionsAcssDebitMandateOptionsPaymentSchedule { - Combined, - Interval, - Sporadic, -} - -impl UpdatePaymentIntentPaymentMethodOptionsAcssDebitMandateOptionsPaymentSchedule { - pub fn as_str(self) -> &'static str { - match self { - UpdatePaymentIntentPaymentMethodOptionsAcssDebitMandateOptionsPaymentSchedule::Combined => "combined", - UpdatePaymentIntentPaymentMethodOptionsAcssDebitMandateOptionsPaymentSchedule::Interval => "interval", - UpdatePaymentIntentPaymentMethodOptionsAcssDebitMandateOptionsPaymentSchedule::Sporadic => "sporadic", - } - } -} - -impl AsRef for UpdatePaymentIntentPaymentMethodOptionsAcssDebitMandateOptionsPaymentSchedule { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display - for UpdatePaymentIntentPaymentMethodOptionsAcssDebitMandateOptionsPaymentSchedule -{ - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default - for UpdatePaymentIntentPaymentMethodOptionsAcssDebitMandateOptionsPaymentSchedule -{ - fn default() -> Self { - Self::Combined - } -} - -/// An enum representing the possible values of an `UpdatePaymentIntentPaymentMethodOptionsAcssDebitMandateOptions`'s `transaction_type` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum UpdatePaymentIntentPaymentMethodOptionsAcssDebitMandateOptionsTransactionType { - Business, - Personal, -} - -impl UpdatePaymentIntentPaymentMethodOptionsAcssDebitMandateOptionsTransactionType { - pub fn as_str(self) -> &'static str { - match self { - UpdatePaymentIntentPaymentMethodOptionsAcssDebitMandateOptionsTransactionType::Business => "business", - UpdatePaymentIntentPaymentMethodOptionsAcssDebitMandateOptionsTransactionType::Personal => "personal", - } - } -} - -impl AsRef for UpdatePaymentIntentPaymentMethodOptionsAcssDebitMandateOptionsTransactionType { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display - for UpdatePaymentIntentPaymentMethodOptionsAcssDebitMandateOptionsTransactionType -{ - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default - for UpdatePaymentIntentPaymentMethodOptionsAcssDebitMandateOptionsTransactionType -{ - fn default() -> Self { - Self::Business - } -} - -/// An enum representing the possible values of an `UpdatePaymentIntentPaymentMethodOptionsAcssDebit`'s `setup_future_usage` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum UpdatePaymentIntentPaymentMethodOptionsAcssDebitSetupFutureUsage { - None, - OffSession, - OnSession, -} - -impl UpdatePaymentIntentPaymentMethodOptionsAcssDebitSetupFutureUsage { - pub fn as_str(self) -> &'static str { - match self { - UpdatePaymentIntentPaymentMethodOptionsAcssDebitSetupFutureUsage::None => "none", - UpdatePaymentIntentPaymentMethodOptionsAcssDebitSetupFutureUsage::OffSession => { - "off_session" - } - UpdatePaymentIntentPaymentMethodOptionsAcssDebitSetupFutureUsage::OnSession => { - "on_session" - } - } - } -} - -impl AsRef for UpdatePaymentIntentPaymentMethodOptionsAcssDebitSetupFutureUsage { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for UpdatePaymentIntentPaymentMethodOptionsAcssDebitSetupFutureUsage { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for UpdatePaymentIntentPaymentMethodOptionsAcssDebitSetupFutureUsage { - fn default() -> Self { - Self::None - } -} - -/// An enum representing the possible values of an `UpdatePaymentIntentPaymentMethodOptionsAcssDebit`'s `verification_method` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum UpdatePaymentIntentPaymentMethodOptionsAcssDebitVerificationMethod { - Automatic, - Instant, - Microdeposits, -} - -impl UpdatePaymentIntentPaymentMethodOptionsAcssDebitVerificationMethod { - pub fn as_str(self) -> &'static str { - match self { - UpdatePaymentIntentPaymentMethodOptionsAcssDebitVerificationMethod::Automatic => { - "automatic" - } - UpdatePaymentIntentPaymentMethodOptionsAcssDebitVerificationMethod::Instant => { - "instant" - } - UpdatePaymentIntentPaymentMethodOptionsAcssDebitVerificationMethod::Microdeposits => { - "microdeposits" - } - } - } -} - -impl AsRef for UpdatePaymentIntentPaymentMethodOptionsAcssDebitVerificationMethod { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for UpdatePaymentIntentPaymentMethodOptionsAcssDebitVerificationMethod { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for UpdatePaymentIntentPaymentMethodOptionsAcssDebitVerificationMethod { - fn default() -> Self { - Self::Automatic - } -} - -/// An enum representing the possible values of an `UpdatePaymentIntentPaymentMethodOptionsAffirm`'s `capture_method` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum UpdatePaymentIntentPaymentMethodOptionsAffirmCaptureMethod { - Manual, -} - -impl UpdatePaymentIntentPaymentMethodOptionsAffirmCaptureMethod { - pub fn as_str(self) -> &'static str { - match self { - UpdatePaymentIntentPaymentMethodOptionsAffirmCaptureMethod::Manual => "manual", - } - } -} - -impl AsRef for UpdatePaymentIntentPaymentMethodOptionsAffirmCaptureMethod { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for UpdatePaymentIntentPaymentMethodOptionsAffirmCaptureMethod { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for UpdatePaymentIntentPaymentMethodOptionsAffirmCaptureMethod { - fn default() -> Self { - Self::Manual - } -} - -/// An enum representing the possible values of an `UpdatePaymentIntentPaymentMethodOptionsAffirm`'s `setup_future_usage` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum UpdatePaymentIntentPaymentMethodOptionsAffirmSetupFutureUsage { - None, -} - -impl UpdatePaymentIntentPaymentMethodOptionsAffirmSetupFutureUsage { - pub fn as_str(self) -> &'static str { - match self { - UpdatePaymentIntentPaymentMethodOptionsAffirmSetupFutureUsage::None => "none", - } - } -} - -impl AsRef for UpdatePaymentIntentPaymentMethodOptionsAffirmSetupFutureUsage { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for UpdatePaymentIntentPaymentMethodOptionsAffirmSetupFutureUsage { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for UpdatePaymentIntentPaymentMethodOptionsAffirmSetupFutureUsage { - fn default() -> Self { - Self::None - } -} - -/// An enum representing the possible values of an `UpdatePaymentIntentPaymentMethodOptionsAfterpayClearpay`'s `capture_method` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum UpdatePaymentIntentPaymentMethodOptionsAfterpayClearpayCaptureMethod { - Manual, -} - -impl UpdatePaymentIntentPaymentMethodOptionsAfterpayClearpayCaptureMethod { - pub fn as_str(self) -> &'static str { - match self { - UpdatePaymentIntentPaymentMethodOptionsAfterpayClearpayCaptureMethod::Manual => { - "manual" - } - } - } -} - -impl AsRef for UpdatePaymentIntentPaymentMethodOptionsAfterpayClearpayCaptureMethod { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for UpdatePaymentIntentPaymentMethodOptionsAfterpayClearpayCaptureMethod { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default - for UpdatePaymentIntentPaymentMethodOptionsAfterpayClearpayCaptureMethod -{ - fn default() -> Self { - Self::Manual - } -} - -/// An enum representing the possible values of an `UpdatePaymentIntentPaymentMethodOptionsAfterpayClearpay`'s `setup_future_usage` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum UpdatePaymentIntentPaymentMethodOptionsAfterpayClearpaySetupFutureUsage { - None, -} - -impl UpdatePaymentIntentPaymentMethodOptionsAfterpayClearpaySetupFutureUsage { - pub fn as_str(self) -> &'static str { - match self { - UpdatePaymentIntentPaymentMethodOptionsAfterpayClearpaySetupFutureUsage::None => "none", - } - } -} - -impl AsRef for UpdatePaymentIntentPaymentMethodOptionsAfterpayClearpaySetupFutureUsage { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for UpdatePaymentIntentPaymentMethodOptionsAfterpayClearpaySetupFutureUsage { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default - for UpdatePaymentIntentPaymentMethodOptionsAfterpayClearpaySetupFutureUsage -{ - fn default() -> Self { - Self::None - } -} - -/// An enum representing the possible values of an `UpdatePaymentIntentPaymentMethodOptionsAlipay`'s `setup_future_usage` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum UpdatePaymentIntentPaymentMethodOptionsAlipaySetupFutureUsage { - None, - OffSession, -} - -impl UpdatePaymentIntentPaymentMethodOptionsAlipaySetupFutureUsage { - pub fn as_str(self) -> &'static str { - match self { - UpdatePaymentIntentPaymentMethodOptionsAlipaySetupFutureUsage::None => "none", - UpdatePaymentIntentPaymentMethodOptionsAlipaySetupFutureUsage::OffSession => { - "off_session" - } - } - } -} - -impl AsRef for UpdatePaymentIntentPaymentMethodOptionsAlipaySetupFutureUsage { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for UpdatePaymentIntentPaymentMethodOptionsAlipaySetupFutureUsage { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for UpdatePaymentIntentPaymentMethodOptionsAlipaySetupFutureUsage { - fn default() -> Self { - Self::None - } -} - -/// An enum representing the possible values of an `UpdatePaymentIntentPaymentMethodOptionsAuBecsDebit`'s `setup_future_usage` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum UpdatePaymentIntentPaymentMethodOptionsAuBecsDebitSetupFutureUsage { - None, - OffSession, - OnSession, -} - -impl UpdatePaymentIntentPaymentMethodOptionsAuBecsDebitSetupFutureUsage { - pub fn as_str(self) -> &'static str { - match self { - UpdatePaymentIntentPaymentMethodOptionsAuBecsDebitSetupFutureUsage::None => "none", - UpdatePaymentIntentPaymentMethodOptionsAuBecsDebitSetupFutureUsage::OffSession => { - "off_session" - } - UpdatePaymentIntentPaymentMethodOptionsAuBecsDebitSetupFutureUsage::OnSession => { - "on_session" - } - } - } -} - -impl AsRef for UpdatePaymentIntentPaymentMethodOptionsAuBecsDebitSetupFutureUsage { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for UpdatePaymentIntentPaymentMethodOptionsAuBecsDebitSetupFutureUsage { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for UpdatePaymentIntentPaymentMethodOptionsAuBecsDebitSetupFutureUsage { - fn default() -> Self { - Self::None - } -} - -/// An enum representing the possible values of an `UpdatePaymentIntentPaymentMethodOptionsBacsDebit`'s `setup_future_usage` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum UpdatePaymentIntentPaymentMethodOptionsBacsDebitSetupFutureUsage { - None, - OffSession, - OnSession, -} - -impl UpdatePaymentIntentPaymentMethodOptionsBacsDebitSetupFutureUsage { - pub fn as_str(self) -> &'static str { - match self { - UpdatePaymentIntentPaymentMethodOptionsBacsDebitSetupFutureUsage::None => "none", - UpdatePaymentIntentPaymentMethodOptionsBacsDebitSetupFutureUsage::OffSession => { - "off_session" - } - UpdatePaymentIntentPaymentMethodOptionsBacsDebitSetupFutureUsage::OnSession => { - "on_session" - } - } - } -} - -impl AsRef for UpdatePaymentIntentPaymentMethodOptionsBacsDebitSetupFutureUsage { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for UpdatePaymentIntentPaymentMethodOptionsBacsDebitSetupFutureUsage { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for UpdatePaymentIntentPaymentMethodOptionsBacsDebitSetupFutureUsage { - fn default() -> Self { - Self::None - } -} - -/// An enum representing the possible values of an `UpdatePaymentIntentPaymentMethodOptionsBancontact`'s `preferred_language` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum UpdatePaymentIntentPaymentMethodOptionsBancontactPreferredLanguage { - De, - En, - Fr, - Nl, -} - -impl UpdatePaymentIntentPaymentMethodOptionsBancontactPreferredLanguage { - pub fn as_str(self) -> &'static str { - match self { - UpdatePaymentIntentPaymentMethodOptionsBancontactPreferredLanguage::De => "de", - UpdatePaymentIntentPaymentMethodOptionsBancontactPreferredLanguage::En => "en", - UpdatePaymentIntentPaymentMethodOptionsBancontactPreferredLanguage::Fr => "fr", - UpdatePaymentIntentPaymentMethodOptionsBancontactPreferredLanguage::Nl => "nl", - } - } -} - -impl AsRef for UpdatePaymentIntentPaymentMethodOptionsBancontactPreferredLanguage { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for UpdatePaymentIntentPaymentMethodOptionsBancontactPreferredLanguage { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for UpdatePaymentIntentPaymentMethodOptionsBancontactPreferredLanguage { - fn default() -> Self { - Self::De - } -} - -/// An enum representing the possible values of an `UpdatePaymentIntentPaymentMethodOptionsBancontact`'s `setup_future_usage` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum UpdatePaymentIntentPaymentMethodOptionsBancontactSetupFutureUsage { - None, - OffSession, -} - -impl UpdatePaymentIntentPaymentMethodOptionsBancontactSetupFutureUsage { - pub fn as_str(self) -> &'static str { - match self { - UpdatePaymentIntentPaymentMethodOptionsBancontactSetupFutureUsage::None => "none", - UpdatePaymentIntentPaymentMethodOptionsBancontactSetupFutureUsage::OffSession => { - "off_session" - } - } - } -} - -impl AsRef for UpdatePaymentIntentPaymentMethodOptionsBancontactSetupFutureUsage { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for UpdatePaymentIntentPaymentMethodOptionsBancontactSetupFutureUsage { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for UpdatePaymentIntentPaymentMethodOptionsBancontactSetupFutureUsage { - fn default() -> Self { - Self::None - } -} - -/// An enum representing the possible values of an `UpdatePaymentIntentPaymentMethodOptionsBlik`'s `setup_future_usage` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum UpdatePaymentIntentPaymentMethodOptionsBlikSetupFutureUsage { - None, -} - -impl UpdatePaymentIntentPaymentMethodOptionsBlikSetupFutureUsage { - pub fn as_str(self) -> &'static str { - match self { - UpdatePaymentIntentPaymentMethodOptionsBlikSetupFutureUsage::None => "none", - } - } -} - -impl AsRef for UpdatePaymentIntentPaymentMethodOptionsBlikSetupFutureUsage { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for UpdatePaymentIntentPaymentMethodOptionsBlikSetupFutureUsage { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for UpdatePaymentIntentPaymentMethodOptionsBlikSetupFutureUsage { - fn default() -> Self { - Self::None - } -} - -/// An enum representing the possible values of an `UpdatePaymentIntentPaymentMethodOptionsBoleto`'s `setup_future_usage` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum UpdatePaymentIntentPaymentMethodOptionsBoletoSetupFutureUsage { - None, - OffSession, - OnSession, -} - -impl UpdatePaymentIntentPaymentMethodOptionsBoletoSetupFutureUsage { - pub fn as_str(self) -> &'static str { - match self { - UpdatePaymentIntentPaymentMethodOptionsBoletoSetupFutureUsage::None => "none", - UpdatePaymentIntentPaymentMethodOptionsBoletoSetupFutureUsage::OffSession => { - "off_session" - } - UpdatePaymentIntentPaymentMethodOptionsBoletoSetupFutureUsage::OnSession => { - "on_session" - } - } - } -} - -impl AsRef for UpdatePaymentIntentPaymentMethodOptionsBoletoSetupFutureUsage { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for UpdatePaymentIntentPaymentMethodOptionsBoletoSetupFutureUsage { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for UpdatePaymentIntentPaymentMethodOptionsBoletoSetupFutureUsage { - fn default() -> Self { - Self::None - } -} - -/// An enum representing the possible values of an `UpdatePaymentIntentPaymentMethodOptionsCard`'s `capture_method` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum UpdatePaymentIntentPaymentMethodOptionsCardCaptureMethod { - Manual, -} - -impl UpdatePaymentIntentPaymentMethodOptionsCardCaptureMethod { - pub fn as_str(self) -> &'static str { - match self { - UpdatePaymentIntentPaymentMethodOptionsCardCaptureMethod::Manual => "manual", - } - } -} - -impl AsRef for UpdatePaymentIntentPaymentMethodOptionsCardCaptureMethod { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for UpdatePaymentIntentPaymentMethodOptionsCardCaptureMethod { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for UpdatePaymentIntentPaymentMethodOptionsCardCaptureMethod { - fn default() -> Self { - Self::Manual - } -} - -/// An enum representing the possible values of an `UpdatePaymentIntentPaymentMethodOptionsCardInstallmentsPlan`'s `interval` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum UpdatePaymentIntentPaymentMethodOptionsCardInstallmentsPlanInterval { - Month, -} - -impl UpdatePaymentIntentPaymentMethodOptionsCardInstallmentsPlanInterval { - pub fn as_str(self) -> &'static str { - match self { - UpdatePaymentIntentPaymentMethodOptionsCardInstallmentsPlanInterval::Month => "month", - } - } -} - -impl AsRef for UpdatePaymentIntentPaymentMethodOptionsCardInstallmentsPlanInterval { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for UpdatePaymentIntentPaymentMethodOptionsCardInstallmentsPlanInterval { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for UpdatePaymentIntentPaymentMethodOptionsCardInstallmentsPlanInterval { - fn default() -> Self { - Self::Month - } -} - -/// An enum representing the possible values of an `UpdatePaymentIntentPaymentMethodOptionsCardInstallmentsPlan`'s `type` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum UpdatePaymentIntentPaymentMethodOptionsCardInstallmentsPlanType { - FixedCount, -} - -impl UpdatePaymentIntentPaymentMethodOptionsCardInstallmentsPlanType { - pub fn as_str(self) -> &'static str { - match self { - UpdatePaymentIntentPaymentMethodOptionsCardInstallmentsPlanType::FixedCount => { - "fixed_count" - } - } - } -} - -impl AsRef for UpdatePaymentIntentPaymentMethodOptionsCardInstallmentsPlanType { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for UpdatePaymentIntentPaymentMethodOptionsCardInstallmentsPlanType { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for UpdatePaymentIntentPaymentMethodOptionsCardInstallmentsPlanType { - fn default() -> Self { - Self::FixedCount - } -} - -/// An enum representing the possible values of an `UpdatePaymentIntentPaymentMethodOptionsCardMandateOptions`'s `amount_type` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum UpdatePaymentIntentPaymentMethodOptionsCardMandateOptionsAmountType { - Fixed, - Maximum, -} - -impl UpdatePaymentIntentPaymentMethodOptionsCardMandateOptionsAmountType { - pub fn as_str(self) -> &'static str { - match self { - UpdatePaymentIntentPaymentMethodOptionsCardMandateOptionsAmountType::Fixed => "fixed", - UpdatePaymentIntentPaymentMethodOptionsCardMandateOptionsAmountType::Maximum => { - "maximum" - } - } - } -} - -impl AsRef for UpdatePaymentIntentPaymentMethodOptionsCardMandateOptionsAmountType { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for UpdatePaymentIntentPaymentMethodOptionsCardMandateOptionsAmountType { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for UpdatePaymentIntentPaymentMethodOptionsCardMandateOptionsAmountType { - fn default() -> Self { - Self::Fixed - } -} - -/// An enum representing the possible values of an `UpdatePaymentIntentPaymentMethodOptionsCardMandateOptions`'s `interval` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum UpdatePaymentIntentPaymentMethodOptionsCardMandateOptionsInterval { - Day, - Month, - Sporadic, - Week, - Year, -} - -impl UpdatePaymentIntentPaymentMethodOptionsCardMandateOptionsInterval { - pub fn as_str(self) -> &'static str { - match self { - UpdatePaymentIntentPaymentMethodOptionsCardMandateOptionsInterval::Day => "day", - UpdatePaymentIntentPaymentMethodOptionsCardMandateOptionsInterval::Month => "month", - UpdatePaymentIntentPaymentMethodOptionsCardMandateOptionsInterval::Sporadic => { - "sporadic" - } - UpdatePaymentIntentPaymentMethodOptionsCardMandateOptionsInterval::Week => "week", - UpdatePaymentIntentPaymentMethodOptionsCardMandateOptionsInterval::Year => "year", - } - } -} - -impl AsRef for UpdatePaymentIntentPaymentMethodOptionsCardMandateOptionsInterval { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for UpdatePaymentIntentPaymentMethodOptionsCardMandateOptionsInterval { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for UpdatePaymentIntentPaymentMethodOptionsCardMandateOptionsInterval { - fn default() -> Self { - Self::Day - } -} - -/// An enum representing the possible values of an `UpdatePaymentIntentPaymentMethodOptionsCardMandateOptions`'s `supported_types` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum UpdatePaymentIntentPaymentMethodOptionsCardMandateOptionsSupportedTypes { - India, -} - -impl UpdatePaymentIntentPaymentMethodOptionsCardMandateOptionsSupportedTypes { - pub fn as_str(self) -> &'static str { - match self { - UpdatePaymentIntentPaymentMethodOptionsCardMandateOptionsSupportedTypes::India => { - "india" - } - } - } -} - -impl AsRef for UpdatePaymentIntentPaymentMethodOptionsCardMandateOptionsSupportedTypes { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for UpdatePaymentIntentPaymentMethodOptionsCardMandateOptionsSupportedTypes { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default - for UpdatePaymentIntentPaymentMethodOptionsCardMandateOptionsSupportedTypes -{ - fn default() -> Self { - Self::India - } -} - -/// An enum representing the possible values of an `UpdatePaymentIntentPaymentMethodOptionsCard`'s `network` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum UpdatePaymentIntentPaymentMethodOptionsCardNetwork { - Amex, - CartesBancaires, - Diners, - Discover, - EftposAu, - Interac, - Jcb, - Mastercard, - Unionpay, - Unknown, - Visa, -} - -impl UpdatePaymentIntentPaymentMethodOptionsCardNetwork { - pub fn as_str(self) -> &'static str { - match self { - UpdatePaymentIntentPaymentMethodOptionsCardNetwork::Amex => "amex", - UpdatePaymentIntentPaymentMethodOptionsCardNetwork::CartesBancaires => { - "cartes_bancaires" - } - UpdatePaymentIntentPaymentMethodOptionsCardNetwork::Diners => "diners", - UpdatePaymentIntentPaymentMethodOptionsCardNetwork::Discover => "discover", - UpdatePaymentIntentPaymentMethodOptionsCardNetwork::EftposAu => "eftpos_au", - UpdatePaymentIntentPaymentMethodOptionsCardNetwork::Interac => "interac", - UpdatePaymentIntentPaymentMethodOptionsCardNetwork::Jcb => "jcb", - UpdatePaymentIntentPaymentMethodOptionsCardNetwork::Mastercard => "mastercard", - UpdatePaymentIntentPaymentMethodOptionsCardNetwork::Unionpay => "unionpay", - UpdatePaymentIntentPaymentMethodOptionsCardNetwork::Unknown => "unknown", - UpdatePaymentIntentPaymentMethodOptionsCardNetwork::Visa => "visa", - } - } -} - -impl AsRef for UpdatePaymentIntentPaymentMethodOptionsCardNetwork { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for UpdatePaymentIntentPaymentMethodOptionsCardNetwork { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for UpdatePaymentIntentPaymentMethodOptionsCardNetwork { - fn default() -> Self { - Self::Amex - } -} - -/// An enum representing the possible values of an `UpdatePaymentIntentPaymentMethodOptionsCard`'s `request_extended_authorization` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum UpdatePaymentIntentPaymentMethodOptionsCardRequestExtendedAuthorization { - IfAvailable, - Never, -} - -impl UpdatePaymentIntentPaymentMethodOptionsCardRequestExtendedAuthorization { - pub fn as_str(self) -> &'static str { - match self { - UpdatePaymentIntentPaymentMethodOptionsCardRequestExtendedAuthorization::IfAvailable => "if_available", - UpdatePaymentIntentPaymentMethodOptionsCardRequestExtendedAuthorization::Never => "never", - } - } -} - -impl AsRef for UpdatePaymentIntentPaymentMethodOptionsCardRequestExtendedAuthorization { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for UpdatePaymentIntentPaymentMethodOptionsCardRequestExtendedAuthorization { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default - for UpdatePaymentIntentPaymentMethodOptionsCardRequestExtendedAuthorization -{ - fn default() -> Self { - Self::IfAvailable - } -} - -/// An enum representing the possible values of an `UpdatePaymentIntentPaymentMethodOptionsCard`'s `request_incremental_authorization` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum UpdatePaymentIntentPaymentMethodOptionsCardRequestIncrementalAuthorization { - IfAvailable, - Never, -} - -impl UpdatePaymentIntentPaymentMethodOptionsCardRequestIncrementalAuthorization { - pub fn as_str(self) -> &'static str { - match self { - UpdatePaymentIntentPaymentMethodOptionsCardRequestIncrementalAuthorization::IfAvailable => "if_available", - UpdatePaymentIntentPaymentMethodOptionsCardRequestIncrementalAuthorization::Never => "never", - } - } -} - -impl AsRef for UpdatePaymentIntentPaymentMethodOptionsCardRequestIncrementalAuthorization { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display - for UpdatePaymentIntentPaymentMethodOptionsCardRequestIncrementalAuthorization -{ - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default - for UpdatePaymentIntentPaymentMethodOptionsCardRequestIncrementalAuthorization -{ - fn default() -> Self { - Self::IfAvailable - } -} - -/// An enum representing the possible values of an `UpdatePaymentIntentPaymentMethodOptionsCard`'s `request_multicapture` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum UpdatePaymentIntentPaymentMethodOptionsCardRequestMulticapture { - IfAvailable, - Never, -} - -impl UpdatePaymentIntentPaymentMethodOptionsCardRequestMulticapture { - pub fn as_str(self) -> &'static str { - match self { - UpdatePaymentIntentPaymentMethodOptionsCardRequestMulticapture::IfAvailable => { - "if_available" - } - UpdatePaymentIntentPaymentMethodOptionsCardRequestMulticapture::Never => "never", - } - } -} - -impl AsRef for UpdatePaymentIntentPaymentMethodOptionsCardRequestMulticapture { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for UpdatePaymentIntentPaymentMethodOptionsCardRequestMulticapture { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for UpdatePaymentIntentPaymentMethodOptionsCardRequestMulticapture { - fn default() -> Self { - Self::IfAvailable - } -} - -/// An enum representing the possible values of an `UpdatePaymentIntentPaymentMethodOptionsCard`'s `request_overcapture` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum UpdatePaymentIntentPaymentMethodOptionsCardRequestOvercapture { - IfAvailable, - Never, -} - -impl UpdatePaymentIntentPaymentMethodOptionsCardRequestOvercapture { - pub fn as_str(self) -> &'static str { - match self { - UpdatePaymentIntentPaymentMethodOptionsCardRequestOvercapture::IfAvailable => { - "if_available" - } - UpdatePaymentIntentPaymentMethodOptionsCardRequestOvercapture::Never => "never", - } - } -} - -impl AsRef for UpdatePaymentIntentPaymentMethodOptionsCardRequestOvercapture { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for UpdatePaymentIntentPaymentMethodOptionsCardRequestOvercapture { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for UpdatePaymentIntentPaymentMethodOptionsCardRequestOvercapture { - fn default() -> Self { - Self::IfAvailable - } -} - -/// An enum representing the possible values of an `UpdatePaymentIntentPaymentMethodOptionsCard`'s `request_three_d_secure` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum UpdatePaymentIntentPaymentMethodOptionsCardRequestThreeDSecure { - Any, - Automatic, - Challenge, -} - -impl UpdatePaymentIntentPaymentMethodOptionsCardRequestThreeDSecure { - pub fn as_str(self) -> &'static str { - match self { - UpdatePaymentIntentPaymentMethodOptionsCardRequestThreeDSecure::Any => "any", - UpdatePaymentIntentPaymentMethodOptionsCardRequestThreeDSecure::Automatic => { - "automatic" - } - UpdatePaymentIntentPaymentMethodOptionsCardRequestThreeDSecure::Challenge => { - "challenge" - } - } - } -} - -impl AsRef for UpdatePaymentIntentPaymentMethodOptionsCardRequestThreeDSecure { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for UpdatePaymentIntentPaymentMethodOptionsCardRequestThreeDSecure { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for UpdatePaymentIntentPaymentMethodOptionsCardRequestThreeDSecure { - fn default() -> Self { - Self::Any - } -} - -/// An enum representing the possible values of an `UpdatePaymentIntentPaymentMethodOptionsCard`'s `setup_future_usage` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum UpdatePaymentIntentPaymentMethodOptionsCardSetupFutureUsage { - None, - OffSession, - OnSession, -} - -impl UpdatePaymentIntentPaymentMethodOptionsCardSetupFutureUsage { - pub fn as_str(self) -> &'static str { - match self { - UpdatePaymentIntentPaymentMethodOptionsCardSetupFutureUsage::None => "none", - UpdatePaymentIntentPaymentMethodOptionsCardSetupFutureUsage::OffSession => { - "off_session" - } - UpdatePaymentIntentPaymentMethodOptionsCardSetupFutureUsage::OnSession => "on_session", - } - } -} - -impl AsRef for UpdatePaymentIntentPaymentMethodOptionsCardSetupFutureUsage { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for UpdatePaymentIntentPaymentMethodOptionsCardSetupFutureUsage { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for UpdatePaymentIntentPaymentMethodOptionsCardSetupFutureUsage { - fn default() -> Self { - Self::None - } -} - -/// An enum representing the possible values of an `UpdatePaymentIntentPaymentMethodOptionsCardThreeDSecure`'s `ares_trans_status` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum UpdatePaymentIntentPaymentMethodOptionsCardThreeDSecureAresTransStatus { - #[serde(rename = "A")] - A, - #[serde(rename = "C")] - C, - #[serde(rename = "I")] - I, - #[serde(rename = "N")] - N, - #[serde(rename = "R")] - R, - #[serde(rename = "U")] - U, - #[serde(rename = "Y")] - Y, -} - -impl UpdatePaymentIntentPaymentMethodOptionsCardThreeDSecureAresTransStatus { - pub fn as_str(self) -> &'static str { - match self { - UpdatePaymentIntentPaymentMethodOptionsCardThreeDSecureAresTransStatus::A => "A", - UpdatePaymentIntentPaymentMethodOptionsCardThreeDSecureAresTransStatus::C => "C", - UpdatePaymentIntentPaymentMethodOptionsCardThreeDSecureAresTransStatus::I => "I", - UpdatePaymentIntentPaymentMethodOptionsCardThreeDSecureAresTransStatus::N => "N", - UpdatePaymentIntentPaymentMethodOptionsCardThreeDSecureAresTransStatus::R => "R", - UpdatePaymentIntentPaymentMethodOptionsCardThreeDSecureAresTransStatus::U => "U", - UpdatePaymentIntentPaymentMethodOptionsCardThreeDSecureAresTransStatus::Y => "Y", - } - } -} - -impl AsRef for UpdatePaymentIntentPaymentMethodOptionsCardThreeDSecureAresTransStatus { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for UpdatePaymentIntentPaymentMethodOptionsCardThreeDSecureAresTransStatus { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default - for UpdatePaymentIntentPaymentMethodOptionsCardThreeDSecureAresTransStatus -{ - fn default() -> Self { - Self::A - } -} - -/// An enum representing the possible values of an `UpdatePaymentIntentPaymentMethodOptionsCardThreeDSecure`'s `electronic_commerce_indicator` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum UpdatePaymentIntentPaymentMethodOptionsCardThreeDSecureElectronicCommerceIndicator { - #[serde(rename = "01")] - V01, - #[serde(rename = "02")] - V02, - #[serde(rename = "05")] - V05, - #[serde(rename = "06")] - V06, - #[serde(rename = "07")] - V07, -} - -impl UpdatePaymentIntentPaymentMethodOptionsCardThreeDSecureElectronicCommerceIndicator { - pub fn as_str(self) -> &'static str { - match self { - UpdatePaymentIntentPaymentMethodOptionsCardThreeDSecureElectronicCommerceIndicator::V01 => "01", - UpdatePaymentIntentPaymentMethodOptionsCardThreeDSecureElectronicCommerceIndicator::V02 => "02", - UpdatePaymentIntentPaymentMethodOptionsCardThreeDSecureElectronicCommerceIndicator::V05 => "05", - UpdatePaymentIntentPaymentMethodOptionsCardThreeDSecureElectronicCommerceIndicator::V06 => "06", - UpdatePaymentIntentPaymentMethodOptionsCardThreeDSecureElectronicCommerceIndicator::V07 => "07", - } - } -} - -impl AsRef - for UpdatePaymentIntentPaymentMethodOptionsCardThreeDSecureElectronicCommerceIndicator -{ - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display - for UpdatePaymentIntentPaymentMethodOptionsCardThreeDSecureElectronicCommerceIndicator -{ - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default - for UpdatePaymentIntentPaymentMethodOptionsCardThreeDSecureElectronicCommerceIndicator -{ - fn default() -> Self { - Self::V01 - } -} - -/// An enum representing the possible values of an `UpdatePaymentIntentPaymentMethodOptionsCardThreeDSecure`'s `exemption_indicator` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum UpdatePaymentIntentPaymentMethodOptionsCardThreeDSecureExemptionIndicator { - LowRisk, - None, -} - -impl UpdatePaymentIntentPaymentMethodOptionsCardThreeDSecureExemptionIndicator { - pub fn as_str(self) -> &'static str { - match self { - UpdatePaymentIntentPaymentMethodOptionsCardThreeDSecureExemptionIndicator::LowRisk => { - "low_risk" - } - UpdatePaymentIntentPaymentMethodOptionsCardThreeDSecureExemptionIndicator::None => { - "none" - } - } - } -} - -impl AsRef for UpdatePaymentIntentPaymentMethodOptionsCardThreeDSecureExemptionIndicator { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display - for UpdatePaymentIntentPaymentMethodOptionsCardThreeDSecureExemptionIndicator -{ - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default - for UpdatePaymentIntentPaymentMethodOptionsCardThreeDSecureExemptionIndicator -{ - fn default() -> Self { - Self::LowRisk - } -} - -/// An enum representing the possible values of an `UpdatePaymentIntentPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancaires`'s `cb_avalgo` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum UpdatePaymentIntentPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancairesCbAvalgo -{ - #[serde(rename = "0")] - V0, - #[serde(rename = "1")] - V1, - #[serde(rename = "2")] - V2, - #[serde(rename = "3")] - V3, - #[serde(rename = "4")] - V4, - #[serde(rename = "A")] - A, -} - -impl UpdatePaymentIntentPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancairesCbAvalgo { - pub fn as_str(self) -> &'static str { - match self { - UpdatePaymentIntentPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancairesCbAvalgo::V0 => "0", - UpdatePaymentIntentPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancairesCbAvalgo::V1 => "1", - UpdatePaymentIntentPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancairesCbAvalgo::V2 => "2", - UpdatePaymentIntentPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancairesCbAvalgo::V3 => "3", - UpdatePaymentIntentPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancairesCbAvalgo::V4 => "4", - UpdatePaymentIntentPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancairesCbAvalgo::A => "A", - } - } -} - -impl AsRef - for UpdatePaymentIntentPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancairesCbAvalgo -{ - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display - for UpdatePaymentIntentPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancairesCbAvalgo -{ - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default - for UpdatePaymentIntentPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancairesCbAvalgo -{ - fn default() -> Self { - Self::V0 - } -} - -/// An enum representing the possible values of an `UpdatePaymentIntentPaymentMethodOptionsCardThreeDSecure`'s `version` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum UpdatePaymentIntentPaymentMethodOptionsCardThreeDSecureVersion { - #[serde(rename = "1.0.2")] - V1_0_2, - #[serde(rename = "2.1.0")] - V2_1_0, - #[serde(rename = "2.2.0")] - V2_2_0, -} - -impl UpdatePaymentIntentPaymentMethodOptionsCardThreeDSecureVersion { - pub fn as_str(self) -> &'static str { - match self { - UpdatePaymentIntentPaymentMethodOptionsCardThreeDSecureVersion::V1_0_2 => "1.0.2", - UpdatePaymentIntentPaymentMethodOptionsCardThreeDSecureVersion::V2_1_0 => "2.1.0", - UpdatePaymentIntentPaymentMethodOptionsCardThreeDSecureVersion::V2_2_0 => "2.2.0", - } - } -} - -impl AsRef for UpdatePaymentIntentPaymentMethodOptionsCardThreeDSecureVersion { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for UpdatePaymentIntentPaymentMethodOptionsCardThreeDSecureVersion { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for UpdatePaymentIntentPaymentMethodOptionsCardThreeDSecureVersion { - fn default() -> Self { - Self::V1_0_2 - } -} - -/// An enum representing the possible values of an `UpdatePaymentIntentPaymentMethodOptionsCashapp`'s `capture_method` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum UpdatePaymentIntentPaymentMethodOptionsCashappCaptureMethod { - Manual, -} - -impl UpdatePaymentIntentPaymentMethodOptionsCashappCaptureMethod { - pub fn as_str(self) -> &'static str { - match self { - UpdatePaymentIntentPaymentMethodOptionsCashappCaptureMethod::Manual => "manual", - } - } -} - -impl AsRef for UpdatePaymentIntentPaymentMethodOptionsCashappCaptureMethod { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for UpdatePaymentIntentPaymentMethodOptionsCashappCaptureMethod { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for UpdatePaymentIntentPaymentMethodOptionsCashappCaptureMethod { - fn default() -> Self { - Self::Manual - } -} - -/// An enum representing the possible values of an `UpdatePaymentIntentPaymentMethodOptionsCashapp`'s `setup_future_usage` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum UpdatePaymentIntentPaymentMethodOptionsCashappSetupFutureUsage { - None, - OffSession, - OnSession, -} - -impl UpdatePaymentIntentPaymentMethodOptionsCashappSetupFutureUsage { - pub fn as_str(self) -> &'static str { - match self { - UpdatePaymentIntentPaymentMethodOptionsCashappSetupFutureUsage::None => "none", - UpdatePaymentIntentPaymentMethodOptionsCashappSetupFutureUsage::OffSession => { - "off_session" - } - UpdatePaymentIntentPaymentMethodOptionsCashappSetupFutureUsage::OnSession => { - "on_session" - } - } - } -} - -impl AsRef for UpdatePaymentIntentPaymentMethodOptionsCashappSetupFutureUsage { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for UpdatePaymentIntentPaymentMethodOptionsCashappSetupFutureUsage { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for UpdatePaymentIntentPaymentMethodOptionsCashappSetupFutureUsage { - fn default() -> Self { - Self::None - } -} - -/// An enum representing the possible values of an `UpdatePaymentIntentPaymentMethodOptionsCustomerBalanceBankTransfer`'s `requested_address_types` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum UpdatePaymentIntentPaymentMethodOptionsCustomerBalanceBankTransferRequestedAddressTypes { - Aba, - Iban, - Sepa, - SortCode, - Spei, - Swift, - Zengin, -} - -impl UpdatePaymentIntentPaymentMethodOptionsCustomerBalanceBankTransferRequestedAddressTypes { - pub fn as_str(self) -> &'static str { - match self { - UpdatePaymentIntentPaymentMethodOptionsCustomerBalanceBankTransferRequestedAddressTypes::Aba => "aba", - UpdatePaymentIntentPaymentMethodOptionsCustomerBalanceBankTransferRequestedAddressTypes::Iban => "iban", - UpdatePaymentIntentPaymentMethodOptionsCustomerBalanceBankTransferRequestedAddressTypes::Sepa => "sepa", - UpdatePaymentIntentPaymentMethodOptionsCustomerBalanceBankTransferRequestedAddressTypes::SortCode => "sort_code", - UpdatePaymentIntentPaymentMethodOptionsCustomerBalanceBankTransferRequestedAddressTypes::Spei => "spei", - UpdatePaymentIntentPaymentMethodOptionsCustomerBalanceBankTransferRequestedAddressTypes::Swift => "swift", - UpdatePaymentIntentPaymentMethodOptionsCustomerBalanceBankTransferRequestedAddressTypes::Zengin => "zengin", - } - } -} - -impl AsRef - for UpdatePaymentIntentPaymentMethodOptionsCustomerBalanceBankTransferRequestedAddressTypes -{ - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display - for UpdatePaymentIntentPaymentMethodOptionsCustomerBalanceBankTransferRequestedAddressTypes -{ - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default - for UpdatePaymentIntentPaymentMethodOptionsCustomerBalanceBankTransferRequestedAddressTypes -{ - fn default() -> Self { - Self::Aba - } -} - -/// An enum representing the possible values of an `UpdatePaymentIntentPaymentMethodOptionsCustomerBalanceBankTransfer`'s `type` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum UpdatePaymentIntentPaymentMethodOptionsCustomerBalanceBankTransferType { - EuBankTransfer, - GbBankTransfer, - JpBankTransfer, - MxBankTransfer, - UsBankTransfer, -} - -impl UpdatePaymentIntentPaymentMethodOptionsCustomerBalanceBankTransferType { - pub fn as_str(self) -> &'static str { - match self { - UpdatePaymentIntentPaymentMethodOptionsCustomerBalanceBankTransferType::EuBankTransfer => "eu_bank_transfer", - UpdatePaymentIntentPaymentMethodOptionsCustomerBalanceBankTransferType::GbBankTransfer => "gb_bank_transfer", - UpdatePaymentIntentPaymentMethodOptionsCustomerBalanceBankTransferType::JpBankTransfer => "jp_bank_transfer", - UpdatePaymentIntentPaymentMethodOptionsCustomerBalanceBankTransferType::MxBankTransfer => "mx_bank_transfer", - UpdatePaymentIntentPaymentMethodOptionsCustomerBalanceBankTransferType::UsBankTransfer => "us_bank_transfer", - } - } -} - -impl AsRef for UpdatePaymentIntentPaymentMethodOptionsCustomerBalanceBankTransferType { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for UpdatePaymentIntentPaymentMethodOptionsCustomerBalanceBankTransferType { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default - for UpdatePaymentIntentPaymentMethodOptionsCustomerBalanceBankTransferType -{ - fn default() -> Self { - Self::EuBankTransfer - } -} - -/// An enum representing the possible values of an `UpdatePaymentIntentPaymentMethodOptionsCustomerBalance`'s `funding_type` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum UpdatePaymentIntentPaymentMethodOptionsCustomerBalanceFundingType { - BankTransfer, -} - -impl UpdatePaymentIntentPaymentMethodOptionsCustomerBalanceFundingType { - pub fn as_str(self) -> &'static str { - match self { - UpdatePaymentIntentPaymentMethodOptionsCustomerBalanceFundingType::BankTransfer => { - "bank_transfer" - } - } - } -} - -impl AsRef for UpdatePaymentIntentPaymentMethodOptionsCustomerBalanceFundingType { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for UpdatePaymentIntentPaymentMethodOptionsCustomerBalanceFundingType { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for UpdatePaymentIntentPaymentMethodOptionsCustomerBalanceFundingType { - fn default() -> Self { - Self::BankTransfer - } -} - -/// An enum representing the possible values of an `UpdatePaymentIntentPaymentMethodOptionsCustomerBalance`'s `setup_future_usage` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum UpdatePaymentIntentPaymentMethodOptionsCustomerBalanceSetupFutureUsage { - None, -} - -impl UpdatePaymentIntentPaymentMethodOptionsCustomerBalanceSetupFutureUsage { - pub fn as_str(self) -> &'static str { - match self { - UpdatePaymentIntentPaymentMethodOptionsCustomerBalanceSetupFutureUsage::None => "none", - } - } -} - -impl AsRef for UpdatePaymentIntentPaymentMethodOptionsCustomerBalanceSetupFutureUsage { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for UpdatePaymentIntentPaymentMethodOptionsCustomerBalanceSetupFutureUsage { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default - for UpdatePaymentIntentPaymentMethodOptionsCustomerBalanceSetupFutureUsage -{ - fn default() -> Self { - Self::None - } -} - -/// An enum representing the possible values of an `UpdatePaymentIntentPaymentMethodOptionsEps`'s `setup_future_usage` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum UpdatePaymentIntentPaymentMethodOptionsEpsSetupFutureUsage { - None, -} - -impl UpdatePaymentIntentPaymentMethodOptionsEpsSetupFutureUsage { - pub fn as_str(self) -> &'static str { - match self { - UpdatePaymentIntentPaymentMethodOptionsEpsSetupFutureUsage::None => "none", - } - } -} - -impl AsRef for UpdatePaymentIntentPaymentMethodOptionsEpsSetupFutureUsage { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for UpdatePaymentIntentPaymentMethodOptionsEpsSetupFutureUsage { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for UpdatePaymentIntentPaymentMethodOptionsEpsSetupFutureUsage { - fn default() -> Self { - Self::None - } -} - -/// An enum representing the possible values of an `UpdatePaymentIntentPaymentMethodOptionsFpx`'s `setup_future_usage` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum UpdatePaymentIntentPaymentMethodOptionsFpxSetupFutureUsage { - None, -} - -impl UpdatePaymentIntentPaymentMethodOptionsFpxSetupFutureUsage { - pub fn as_str(self) -> &'static str { - match self { - UpdatePaymentIntentPaymentMethodOptionsFpxSetupFutureUsage::None => "none", - } - } -} - -impl AsRef for UpdatePaymentIntentPaymentMethodOptionsFpxSetupFutureUsage { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for UpdatePaymentIntentPaymentMethodOptionsFpxSetupFutureUsage { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for UpdatePaymentIntentPaymentMethodOptionsFpxSetupFutureUsage { - fn default() -> Self { - Self::None - } -} - -/// An enum representing the possible values of an `UpdatePaymentIntentPaymentMethodOptionsGiropay`'s `setup_future_usage` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum UpdatePaymentIntentPaymentMethodOptionsGiropaySetupFutureUsage { - None, -} - -impl UpdatePaymentIntentPaymentMethodOptionsGiropaySetupFutureUsage { - pub fn as_str(self) -> &'static str { - match self { - UpdatePaymentIntentPaymentMethodOptionsGiropaySetupFutureUsage::None => "none", - } - } -} - -impl AsRef for UpdatePaymentIntentPaymentMethodOptionsGiropaySetupFutureUsage { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for UpdatePaymentIntentPaymentMethodOptionsGiropaySetupFutureUsage { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for UpdatePaymentIntentPaymentMethodOptionsGiropaySetupFutureUsage { - fn default() -> Self { - Self::None - } -} - -/// An enum representing the possible values of an `UpdatePaymentIntentPaymentMethodOptionsGrabpay`'s `setup_future_usage` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum UpdatePaymentIntentPaymentMethodOptionsGrabpaySetupFutureUsage { - None, -} - -impl UpdatePaymentIntentPaymentMethodOptionsGrabpaySetupFutureUsage { - pub fn as_str(self) -> &'static str { - match self { - UpdatePaymentIntentPaymentMethodOptionsGrabpaySetupFutureUsage::None => "none", - } - } -} - -impl AsRef for UpdatePaymentIntentPaymentMethodOptionsGrabpaySetupFutureUsage { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for UpdatePaymentIntentPaymentMethodOptionsGrabpaySetupFutureUsage { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for UpdatePaymentIntentPaymentMethodOptionsGrabpaySetupFutureUsage { - fn default() -> Self { - Self::None - } -} - -/// An enum representing the possible values of an `UpdatePaymentIntentPaymentMethodOptionsIdeal`'s `setup_future_usage` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum UpdatePaymentIntentPaymentMethodOptionsIdealSetupFutureUsage { - None, - OffSession, -} - -impl UpdatePaymentIntentPaymentMethodOptionsIdealSetupFutureUsage { - pub fn as_str(self) -> &'static str { - match self { - UpdatePaymentIntentPaymentMethodOptionsIdealSetupFutureUsage::None => "none", - UpdatePaymentIntentPaymentMethodOptionsIdealSetupFutureUsage::OffSession => { - "off_session" - } - } - } -} - -impl AsRef for UpdatePaymentIntentPaymentMethodOptionsIdealSetupFutureUsage { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for UpdatePaymentIntentPaymentMethodOptionsIdealSetupFutureUsage { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for UpdatePaymentIntentPaymentMethodOptionsIdealSetupFutureUsage { - fn default() -> Self { - Self::None - } -} - -/// An enum representing the possible values of an `UpdatePaymentIntentPaymentMethodOptionsKlarna`'s `capture_method` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum UpdatePaymentIntentPaymentMethodOptionsKlarnaCaptureMethod { - Manual, -} - -impl UpdatePaymentIntentPaymentMethodOptionsKlarnaCaptureMethod { - pub fn as_str(self) -> &'static str { - match self { - UpdatePaymentIntentPaymentMethodOptionsKlarnaCaptureMethod::Manual => "manual", - } - } -} - -impl AsRef for UpdatePaymentIntentPaymentMethodOptionsKlarnaCaptureMethod { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for UpdatePaymentIntentPaymentMethodOptionsKlarnaCaptureMethod { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for UpdatePaymentIntentPaymentMethodOptionsKlarnaCaptureMethod { - fn default() -> Self { - Self::Manual - } -} - -/// An enum representing the possible values of an `UpdatePaymentIntentPaymentMethodOptionsKlarna`'s `preferred_locale` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum UpdatePaymentIntentPaymentMethodOptionsKlarnaPreferredLocale { - #[serde(rename = "cs-CZ")] - CsCz, - #[serde(rename = "da-DK")] - DaDk, - #[serde(rename = "de-AT")] - DeAt, - #[serde(rename = "de-CH")] - DeCh, - #[serde(rename = "de-DE")] - DeDe, - #[serde(rename = "el-GR")] - ElGr, - #[serde(rename = "en-AT")] - EnAt, - #[serde(rename = "en-AU")] - EnAu, - #[serde(rename = "en-BE")] - EnBe, - #[serde(rename = "en-CA")] - EnCa, - #[serde(rename = "en-CH")] - EnCh, - #[serde(rename = "en-CZ")] - EnCz, - #[serde(rename = "en-DE")] - EnDe, - #[serde(rename = "en-DK")] - EnDk, - #[serde(rename = "en-ES")] - EnEs, - #[serde(rename = "en-FI")] - EnFi, - #[serde(rename = "en-FR")] - EnFr, - #[serde(rename = "en-GB")] - EnGb, - #[serde(rename = "en-GR")] - EnGr, - #[serde(rename = "en-IE")] - EnIe, - #[serde(rename = "en-IT")] - EnIt, - #[serde(rename = "en-NL")] - EnNl, - #[serde(rename = "en-NO")] - EnNo, - #[serde(rename = "en-NZ")] - EnNz, - #[serde(rename = "en-PL")] - EnPl, - #[serde(rename = "en-PT")] - EnPt, - #[serde(rename = "en-SE")] - EnSe, - #[serde(rename = "en-US")] - EnUs, - #[serde(rename = "es-ES")] - EsEs, - #[serde(rename = "es-US")] - EsUs, - #[serde(rename = "fi-FI")] - FiFi, - #[serde(rename = "fr-BE")] - FrBe, - #[serde(rename = "fr-CA")] - FrCa, - #[serde(rename = "fr-CH")] - FrCh, - #[serde(rename = "fr-FR")] - FrFr, - #[serde(rename = "it-CH")] - ItCh, - #[serde(rename = "it-IT")] - ItIt, - #[serde(rename = "nb-NO")] - NbNo, - #[serde(rename = "nl-BE")] - NlBe, - #[serde(rename = "nl-NL")] - NlNl, - #[serde(rename = "pl-PL")] - PlPl, - #[serde(rename = "pt-PT")] - PtPt, - #[serde(rename = "sv-FI")] - SvFi, - #[serde(rename = "sv-SE")] - SvSe, -} - -impl UpdatePaymentIntentPaymentMethodOptionsKlarnaPreferredLocale { - pub fn as_str(self) -> &'static str { - match self { - UpdatePaymentIntentPaymentMethodOptionsKlarnaPreferredLocale::CsCz => "cs-CZ", - UpdatePaymentIntentPaymentMethodOptionsKlarnaPreferredLocale::DaDk => "da-DK", - UpdatePaymentIntentPaymentMethodOptionsKlarnaPreferredLocale::DeAt => "de-AT", - UpdatePaymentIntentPaymentMethodOptionsKlarnaPreferredLocale::DeCh => "de-CH", - UpdatePaymentIntentPaymentMethodOptionsKlarnaPreferredLocale::DeDe => "de-DE", - UpdatePaymentIntentPaymentMethodOptionsKlarnaPreferredLocale::ElGr => "el-GR", - UpdatePaymentIntentPaymentMethodOptionsKlarnaPreferredLocale::EnAt => "en-AT", - UpdatePaymentIntentPaymentMethodOptionsKlarnaPreferredLocale::EnAu => "en-AU", - UpdatePaymentIntentPaymentMethodOptionsKlarnaPreferredLocale::EnBe => "en-BE", - UpdatePaymentIntentPaymentMethodOptionsKlarnaPreferredLocale::EnCa => "en-CA", - UpdatePaymentIntentPaymentMethodOptionsKlarnaPreferredLocale::EnCh => "en-CH", - UpdatePaymentIntentPaymentMethodOptionsKlarnaPreferredLocale::EnCz => "en-CZ", - UpdatePaymentIntentPaymentMethodOptionsKlarnaPreferredLocale::EnDe => "en-DE", - UpdatePaymentIntentPaymentMethodOptionsKlarnaPreferredLocale::EnDk => "en-DK", - UpdatePaymentIntentPaymentMethodOptionsKlarnaPreferredLocale::EnEs => "en-ES", - UpdatePaymentIntentPaymentMethodOptionsKlarnaPreferredLocale::EnFi => "en-FI", - UpdatePaymentIntentPaymentMethodOptionsKlarnaPreferredLocale::EnFr => "en-FR", - UpdatePaymentIntentPaymentMethodOptionsKlarnaPreferredLocale::EnGb => "en-GB", - UpdatePaymentIntentPaymentMethodOptionsKlarnaPreferredLocale::EnGr => "en-GR", - UpdatePaymentIntentPaymentMethodOptionsKlarnaPreferredLocale::EnIe => "en-IE", - UpdatePaymentIntentPaymentMethodOptionsKlarnaPreferredLocale::EnIt => "en-IT", - UpdatePaymentIntentPaymentMethodOptionsKlarnaPreferredLocale::EnNl => "en-NL", - UpdatePaymentIntentPaymentMethodOptionsKlarnaPreferredLocale::EnNo => "en-NO", - UpdatePaymentIntentPaymentMethodOptionsKlarnaPreferredLocale::EnNz => "en-NZ", - UpdatePaymentIntentPaymentMethodOptionsKlarnaPreferredLocale::EnPl => "en-PL", - UpdatePaymentIntentPaymentMethodOptionsKlarnaPreferredLocale::EnPt => "en-PT", - UpdatePaymentIntentPaymentMethodOptionsKlarnaPreferredLocale::EnSe => "en-SE", - UpdatePaymentIntentPaymentMethodOptionsKlarnaPreferredLocale::EnUs => "en-US", - UpdatePaymentIntentPaymentMethodOptionsKlarnaPreferredLocale::EsEs => "es-ES", - UpdatePaymentIntentPaymentMethodOptionsKlarnaPreferredLocale::EsUs => "es-US", - UpdatePaymentIntentPaymentMethodOptionsKlarnaPreferredLocale::FiFi => "fi-FI", - UpdatePaymentIntentPaymentMethodOptionsKlarnaPreferredLocale::FrBe => "fr-BE", - UpdatePaymentIntentPaymentMethodOptionsKlarnaPreferredLocale::FrCa => "fr-CA", - UpdatePaymentIntentPaymentMethodOptionsKlarnaPreferredLocale::FrCh => "fr-CH", - UpdatePaymentIntentPaymentMethodOptionsKlarnaPreferredLocale::FrFr => "fr-FR", - UpdatePaymentIntentPaymentMethodOptionsKlarnaPreferredLocale::ItCh => "it-CH", - UpdatePaymentIntentPaymentMethodOptionsKlarnaPreferredLocale::ItIt => "it-IT", - UpdatePaymentIntentPaymentMethodOptionsKlarnaPreferredLocale::NbNo => "nb-NO", - UpdatePaymentIntentPaymentMethodOptionsKlarnaPreferredLocale::NlBe => "nl-BE", - UpdatePaymentIntentPaymentMethodOptionsKlarnaPreferredLocale::NlNl => "nl-NL", - UpdatePaymentIntentPaymentMethodOptionsKlarnaPreferredLocale::PlPl => "pl-PL", - UpdatePaymentIntentPaymentMethodOptionsKlarnaPreferredLocale::PtPt => "pt-PT", - UpdatePaymentIntentPaymentMethodOptionsKlarnaPreferredLocale::SvFi => "sv-FI", - UpdatePaymentIntentPaymentMethodOptionsKlarnaPreferredLocale::SvSe => "sv-SE", - } - } -} - -impl AsRef for UpdatePaymentIntentPaymentMethodOptionsKlarnaPreferredLocale { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for UpdatePaymentIntentPaymentMethodOptionsKlarnaPreferredLocale { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for UpdatePaymentIntentPaymentMethodOptionsKlarnaPreferredLocale { - fn default() -> Self { - Self::CsCz - } -} - -/// An enum representing the possible values of an `UpdatePaymentIntentPaymentMethodOptionsKlarna`'s `setup_future_usage` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum UpdatePaymentIntentPaymentMethodOptionsKlarnaSetupFutureUsage { - None, -} - -impl UpdatePaymentIntentPaymentMethodOptionsKlarnaSetupFutureUsage { - pub fn as_str(self) -> &'static str { - match self { - UpdatePaymentIntentPaymentMethodOptionsKlarnaSetupFutureUsage::None => "none", - } - } -} - -impl AsRef for UpdatePaymentIntentPaymentMethodOptionsKlarnaSetupFutureUsage { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for UpdatePaymentIntentPaymentMethodOptionsKlarnaSetupFutureUsage { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for UpdatePaymentIntentPaymentMethodOptionsKlarnaSetupFutureUsage { - fn default() -> Self { - Self::None - } -} - -/// An enum representing the possible values of an `UpdatePaymentIntentPaymentMethodOptionsKonbini`'s `setup_future_usage` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum UpdatePaymentIntentPaymentMethodOptionsKonbiniSetupFutureUsage { - None, -} - -impl UpdatePaymentIntentPaymentMethodOptionsKonbiniSetupFutureUsage { - pub fn as_str(self) -> &'static str { - match self { - UpdatePaymentIntentPaymentMethodOptionsKonbiniSetupFutureUsage::None => "none", - } - } -} - -impl AsRef for UpdatePaymentIntentPaymentMethodOptionsKonbiniSetupFutureUsage { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for UpdatePaymentIntentPaymentMethodOptionsKonbiniSetupFutureUsage { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for UpdatePaymentIntentPaymentMethodOptionsKonbiniSetupFutureUsage { - fn default() -> Self { - Self::None - } -} - -/// An enum representing the possible values of an `UpdatePaymentIntentPaymentMethodOptionsLink`'s `capture_method` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum UpdatePaymentIntentPaymentMethodOptionsLinkCaptureMethod { - Manual, -} - -impl UpdatePaymentIntentPaymentMethodOptionsLinkCaptureMethod { - pub fn as_str(self) -> &'static str { - match self { - UpdatePaymentIntentPaymentMethodOptionsLinkCaptureMethod::Manual => "manual", - } - } -} - -impl AsRef for UpdatePaymentIntentPaymentMethodOptionsLinkCaptureMethod { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for UpdatePaymentIntentPaymentMethodOptionsLinkCaptureMethod { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for UpdatePaymentIntentPaymentMethodOptionsLinkCaptureMethod { - fn default() -> Self { - Self::Manual - } -} - -/// An enum representing the possible values of an `UpdatePaymentIntentPaymentMethodOptionsLink`'s `setup_future_usage` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum UpdatePaymentIntentPaymentMethodOptionsLinkSetupFutureUsage { - None, - OffSession, -} - -impl UpdatePaymentIntentPaymentMethodOptionsLinkSetupFutureUsage { - pub fn as_str(self) -> &'static str { - match self { - UpdatePaymentIntentPaymentMethodOptionsLinkSetupFutureUsage::None => "none", - UpdatePaymentIntentPaymentMethodOptionsLinkSetupFutureUsage::OffSession => { - "off_session" - } - } - } -} - -impl AsRef for UpdatePaymentIntentPaymentMethodOptionsLinkSetupFutureUsage { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for UpdatePaymentIntentPaymentMethodOptionsLinkSetupFutureUsage { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for UpdatePaymentIntentPaymentMethodOptionsLinkSetupFutureUsage { - fn default() -> Self { - Self::None - } -} - -/// An enum representing the possible values of an `UpdatePaymentIntentPaymentMethodOptionsOxxo`'s `setup_future_usage` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum UpdatePaymentIntentPaymentMethodOptionsOxxoSetupFutureUsage { - None, -} - -impl UpdatePaymentIntentPaymentMethodOptionsOxxoSetupFutureUsage { - pub fn as_str(self) -> &'static str { - match self { - UpdatePaymentIntentPaymentMethodOptionsOxxoSetupFutureUsage::None => "none", - } - } -} - -impl AsRef for UpdatePaymentIntentPaymentMethodOptionsOxxoSetupFutureUsage { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for UpdatePaymentIntentPaymentMethodOptionsOxxoSetupFutureUsage { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for UpdatePaymentIntentPaymentMethodOptionsOxxoSetupFutureUsage { - fn default() -> Self { - Self::None - } -} - -/// An enum representing the possible values of an `UpdatePaymentIntentPaymentMethodOptionsP24`'s `setup_future_usage` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum UpdatePaymentIntentPaymentMethodOptionsP24SetupFutureUsage { - None, -} - -impl UpdatePaymentIntentPaymentMethodOptionsP24SetupFutureUsage { - pub fn as_str(self) -> &'static str { - match self { - UpdatePaymentIntentPaymentMethodOptionsP24SetupFutureUsage::None => "none", - } - } -} - -impl AsRef for UpdatePaymentIntentPaymentMethodOptionsP24SetupFutureUsage { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for UpdatePaymentIntentPaymentMethodOptionsP24SetupFutureUsage { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for UpdatePaymentIntentPaymentMethodOptionsP24SetupFutureUsage { - fn default() -> Self { - Self::None - } -} - -/// An enum representing the possible values of an `UpdatePaymentIntentPaymentMethodOptionsPaynow`'s `setup_future_usage` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum UpdatePaymentIntentPaymentMethodOptionsPaynowSetupFutureUsage { - None, -} - -impl UpdatePaymentIntentPaymentMethodOptionsPaynowSetupFutureUsage { - pub fn as_str(self) -> &'static str { - match self { - UpdatePaymentIntentPaymentMethodOptionsPaynowSetupFutureUsage::None => "none", - } - } -} - -impl AsRef for UpdatePaymentIntentPaymentMethodOptionsPaynowSetupFutureUsage { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for UpdatePaymentIntentPaymentMethodOptionsPaynowSetupFutureUsage { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for UpdatePaymentIntentPaymentMethodOptionsPaynowSetupFutureUsage { - fn default() -> Self { - Self::None - } -} - -/// An enum representing the possible values of an `UpdatePaymentIntentPaymentMethodOptionsPaypal`'s `capture_method` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum UpdatePaymentIntentPaymentMethodOptionsPaypalCaptureMethod { - Manual, -} - -impl UpdatePaymentIntentPaymentMethodOptionsPaypalCaptureMethod { - pub fn as_str(self) -> &'static str { - match self { - UpdatePaymentIntentPaymentMethodOptionsPaypalCaptureMethod::Manual => "manual", - } - } -} - -impl AsRef for UpdatePaymentIntentPaymentMethodOptionsPaypalCaptureMethod { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for UpdatePaymentIntentPaymentMethodOptionsPaypalCaptureMethod { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for UpdatePaymentIntentPaymentMethodOptionsPaypalCaptureMethod { - fn default() -> Self { - Self::Manual - } -} - -/// An enum representing the possible values of an `UpdatePaymentIntentPaymentMethodOptionsPaypal`'s `preferred_locale` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum UpdatePaymentIntentPaymentMethodOptionsPaypalPreferredLocale { - #[serde(rename = "cs-CZ")] - CsCz, - #[serde(rename = "da-DK")] - DaDk, - #[serde(rename = "de-AT")] - DeAt, - #[serde(rename = "de-DE")] - DeDe, - #[serde(rename = "de-LU")] - DeLu, - #[serde(rename = "el-GR")] - ElGr, - #[serde(rename = "en-GB")] - EnGb, - #[serde(rename = "en-US")] - EnUs, - #[serde(rename = "es-ES")] - EsEs, - #[serde(rename = "fi-FI")] - FiFi, - #[serde(rename = "fr-BE")] - FrBe, - #[serde(rename = "fr-FR")] - FrFr, - #[serde(rename = "fr-LU")] - FrLu, - #[serde(rename = "hu-HU")] - HuHu, - #[serde(rename = "it-IT")] - ItIt, - #[serde(rename = "nl-BE")] - NlBe, - #[serde(rename = "nl-NL")] - NlNl, - #[serde(rename = "pl-PL")] - PlPl, - #[serde(rename = "pt-PT")] - PtPt, - #[serde(rename = "sk-SK")] - SkSk, - #[serde(rename = "sv-SE")] - SvSe, -} - -impl UpdatePaymentIntentPaymentMethodOptionsPaypalPreferredLocale { - pub fn as_str(self) -> &'static str { - match self { - UpdatePaymentIntentPaymentMethodOptionsPaypalPreferredLocale::CsCz => "cs-CZ", - UpdatePaymentIntentPaymentMethodOptionsPaypalPreferredLocale::DaDk => "da-DK", - UpdatePaymentIntentPaymentMethodOptionsPaypalPreferredLocale::DeAt => "de-AT", - UpdatePaymentIntentPaymentMethodOptionsPaypalPreferredLocale::DeDe => "de-DE", - UpdatePaymentIntentPaymentMethodOptionsPaypalPreferredLocale::DeLu => "de-LU", - UpdatePaymentIntentPaymentMethodOptionsPaypalPreferredLocale::ElGr => "el-GR", - UpdatePaymentIntentPaymentMethodOptionsPaypalPreferredLocale::EnGb => "en-GB", - UpdatePaymentIntentPaymentMethodOptionsPaypalPreferredLocale::EnUs => "en-US", - UpdatePaymentIntentPaymentMethodOptionsPaypalPreferredLocale::EsEs => "es-ES", - UpdatePaymentIntentPaymentMethodOptionsPaypalPreferredLocale::FiFi => "fi-FI", - UpdatePaymentIntentPaymentMethodOptionsPaypalPreferredLocale::FrBe => "fr-BE", - UpdatePaymentIntentPaymentMethodOptionsPaypalPreferredLocale::FrFr => "fr-FR", - UpdatePaymentIntentPaymentMethodOptionsPaypalPreferredLocale::FrLu => "fr-LU", - UpdatePaymentIntentPaymentMethodOptionsPaypalPreferredLocale::HuHu => "hu-HU", - UpdatePaymentIntentPaymentMethodOptionsPaypalPreferredLocale::ItIt => "it-IT", - UpdatePaymentIntentPaymentMethodOptionsPaypalPreferredLocale::NlBe => "nl-BE", - UpdatePaymentIntentPaymentMethodOptionsPaypalPreferredLocale::NlNl => "nl-NL", - UpdatePaymentIntentPaymentMethodOptionsPaypalPreferredLocale::PlPl => "pl-PL", - UpdatePaymentIntentPaymentMethodOptionsPaypalPreferredLocale::PtPt => "pt-PT", - UpdatePaymentIntentPaymentMethodOptionsPaypalPreferredLocale::SkSk => "sk-SK", - UpdatePaymentIntentPaymentMethodOptionsPaypalPreferredLocale::SvSe => "sv-SE", - } - } -} - -impl AsRef for UpdatePaymentIntentPaymentMethodOptionsPaypalPreferredLocale { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for UpdatePaymentIntentPaymentMethodOptionsPaypalPreferredLocale { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for UpdatePaymentIntentPaymentMethodOptionsPaypalPreferredLocale { - fn default() -> Self { - Self::CsCz - } -} - -/// An enum representing the possible values of an `UpdatePaymentIntentPaymentMethodOptionsPaypal`'s `setup_future_usage` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum UpdatePaymentIntentPaymentMethodOptionsPaypalSetupFutureUsage { - None, - OffSession, -} - -impl UpdatePaymentIntentPaymentMethodOptionsPaypalSetupFutureUsage { - pub fn as_str(self) -> &'static str { - match self { - UpdatePaymentIntentPaymentMethodOptionsPaypalSetupFutureUsage::None => "none", - UpdatePaymentIntentPaymentMethodOptionsPaypalSetupFutureUsage::OffSession => { - "off_session" - } - } - } -} - -impl AsRef for UpdatePaymentIntentPaymentMethodOptionsPaypalSetupFutureUsage { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for UpdatePaymentIntentPaymentMethodOptionsPaypalSetupFutureUsage { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for UpdatePaymentIntentPaymentMethodOptionsPaypalSetupFutureUsage { - fn default() -> Self { - Self::None - } -} - -/// An enum representing the possible values of an `UpdatePaymentIntentPaymentMethodOptionsPix`'s `setup_future_usage` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum UpdatePaymentIntentPaymentMethodOptionsPixSetupFutureUsage { - None, -} - -impl UpdatePaymentIntentPaymentMethodOptionsPixSetupFutureUsage { - pub fn as_str(self) -> &'static str { - match self { - UpdatePaymentIntentPaymentMethodOptionsPixSetupFutureUsage::None => "none", - } - } -} - -impl AsRef for UpdatePaymentIntentPaymentMethodOptionsPixSetupFutureUsage { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for UpdatePaymentIntentPaymentMethodOptionsPixSetupFutureUsage { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for UpdatePaymentIntentPaymentMethodOptionsPixSetupFutureUsage { - fn default() -> Self { - Self::None - } -} - -/// An enum representing the possible values of an `UpdatePaymentIntentPaymentMethodOptionsPromptpay`'s `setup_future_usage` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum UpdatePaymentIntentPaymentMethodOptionsPromptpaySetupFutureUsage { - None, -} - -impl UpdatePaymentIntentPaymentMethodOptionsPromptpaySetupFutureUsage { - pub fn as_str(self) -> &'static str { - match self { - UpdatePaymentIntentPaymentMethodOptionsPromptpaySetupFutureUsage::None => "none", - } - } -} - -impl AsRef for UpdatePaymentIntentPaymentMethodOptionsPromptpaySetupFutureUsage { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for UpdatePaymentIntentPaymentMethodOptionsPromptpaySetupFutureUsage { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for UpdatePaymentIntentPaymentMethodOptionsPromptpaySetupFutureUsage { - fn default() -> Self { - Self::None - } -} - -/// An enum representing the possible values of an `UpdatePaymentIntentPaymentMethodOptionsRevolutPay`'s `setup_future_usage` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum UpdatePaymentIntentPaymentMethodOptionsRevolutPaySetupFutureUsage { - None, - OffSession, -} - -impl UpdatePaymentIntentPaymentMethodOptionsRevolutPaySetupFutureUsage { - pub fn as_str(self) -> &'static str { - match self { - UpdatePaymentIntentPaymentMethodOptionsRevolutPaySetupFutureUsage::None => "none", - UpdatePaymentIntentPaymentMethodOptionsRevolutPaySetupFutureUsage::OffSession => { - "off_session" - } - } - } -} - -impl AsRef for UpdatePaymentIntentPaymentMethodOptionsRevolutPaySetupFutureUsage { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for UpdatePaymentIntentPaymentMethodOptionsRevolutPaySetupFutureUsage { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for UpdatePaymentIntentPaymentMethodOptionsRevolutPaySetupFutureUsage { - fn default() -> Self { - Self::None - } -} - -/// An enum representing the possible values of an `UpdatePaymentIntentPaymentMethodOptionsSepaDebit`'s `setup_future_usage` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum UpdatePaymentIntentPaymentMethodOptionsSepaDebitSetupFutureUsage { - None, - OffSession, - OnSession, -} - -impl UpdatePaymentIntentPaymentMethodOptionsSepaDebitSetupFutureUsage { - pub fn as_str(self) -> &'static str { - match self { - UpdatePaymentIntentPaymentMethodOptionsSepaDebitSetupFutureUsage::None => "none", - UpdatePaymentIntentPaymentMethodOptionsSepaDebitSetupFutureUsage::OffSession => { - "off_session" - } - UpdatePaymentIntentPaymentMethodOptionsSepaDebitSetupFutureUsage::OnSession => { - "on_session" - } - } - } -} - -impl AsRef for UpdatePaymentIntentPaymentMethodOptionsSepaDebitSetupFutureUsage { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for UpdatePaymentIntentPaymentMethodOptionsSepaDebitSetupFutureUsage { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for UpdatePaymentIntentPaymentMethodOptionsSepaDebitSetupFutureUsage { - fn default() -> Self { - Self::None - } -} - -/// An enum representing the possible values of an `UpdatePaymentIntentPaymentMethodOptionsSofort`'s `preferred_language` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum UpdatePaymentIntentPaymentMethodOptionsSofortPreferredLanguage { - De, - En, - Es, - Fr, - It, - Nl, - Pl, -} - -impl UpdatePaymentIntentPaymentMethodOptionsSofortPreferredLanguage { - pub fn as_str(self) -> &'static str { - match self { - UpdatePaymentIntentPaymentMethodOptionsSofortPreferredLanguage::De => "de", - UpdatePaymentIntentPaymentMethodOptionsSofortPreferredLanguage::En => "en", - UpdatePaymentIntentPaymentMethodOptionsSofortPreferredLanguage::Es => "es", - UpdatePaymentIntentPaymentMethodOptionsSofortPreferredLanguage::Fr => "fr", - UpdatePaymentIntentPaymentMethodOptionsSofortPreferredLanguage::It => "it", - UpdatePaymentIntentPaymentMethodOptionsSofortPreferredLanguage::Nl => "nl", - UpdatePaymentIntentPaymentMethodOptionsSofortPreferredLanguage::Pl => "pl", - } - } -} - -impl AsRef for UpdatePaymentIntentPaymentMethodOptionsSofortPreferredLanguage { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for UpdatePaymentIntentPaymentMethodOptionsSofortPreferredLanguage { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for UpdatePaymentIntentPaymentMethodOptionsSofortPreferredLanguage { - fn default() -> Self { - Self::De - } -} - -/// An enum representing the possible values of an `UpdatePaymentIntentPaymentMethodOptionsSofort`'s `setup_future_usage` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum UpdatePaymentIntentPaymentMethodOptionsSofortSetupFutureUsage { - None, - OffSession, -} - -impl UpdatePaymentIntentPaymentMethodOptionsSofortSetupFutureUsage { - pub fn as_str(self) -> &'static str { - match self { - UpdatePaymentIntentPaymentMethodOptionsSofortSetupFutureUsage::None => "none", - UpdatePaymentIntentPaymentMethodOptionsSofortSetupFutureUsage::OffSession => { - "off_session" - } - } - } -} - -impl AsRef for UpdatePaymentIntentPaymentMethodOptionsSofortSetupFutureUsage { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for UpdatePaymentIntentPaymentMethodOptionsSofortSetupFutureUsage { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for UpdatePaymentIntentPaymentMethodOptionsSofortSetupFutureUsage { - fn default() -> Self { - Self::None - } -} - -/// An enum representing the possible values of an `UpdatePaymentIntentPaymentMethodOptionsSwish`'s `setup_future_usage` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum UpdatePaymentIntentPaymentMethodOptionsSwishSetupFutureUsage { - None, -} - -impl UpdatePaymentIntentPaymentMethodOptionsSwishSetupFutureUsage { - pub fn as_str(self) -> &'static str { - match self { - UpdatePaymentIntentPaymentMethodOptionsSwishSetupFutureUsage::None => "none", - } - } -} - -impl AsRef for UpdatePaymentIntentPaymentMethodOptionsSwishSetupFutureUsage { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for UpdatePaymentIntentPaymentMethodOptionsSwishSetupFutureUsage { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for UpdatePaymentIntentPaymentMethodOptionsSwishSetupFutureUsage { - fn default() -> Self { - Self::None - } -} - -/// An enum representing the possible values of an `UpdatePaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnections`'s `permissions` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum UpdatePaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions { - Balances, - Ownership, - PaymentMethod, - Transactions, -} - -impl UpdatePaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions { - pub fn as_str(self) -> &'static str { - match self { - UpdatePaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions::Balances => "balances", - UpdatePaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions::Ownership => "ownership", - UpdatePaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions::PaymentMethod => "payment_method", - UpdatePaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions::Transactions => "transactions", - } - } -} - -impl AsRef - for UpdatePaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions -{ - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display - for UpdatePaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions -{ - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default - for UpdatePaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions -{ - fn default() -> Self { - Self::Balances - } -} - -/// An enum representing the possible values of an `UpdatePaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnections`'s `prefetch` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum UpdatePaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch { - Balances, - Transactions, -} - -impl UpdatePaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch { - pub fn as_str(self) -> &'static str { - match self { - UpdatePaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch::Balances => "balances", - UpdatePaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch::Transactions => "transactions", - } - } -} - -impl AsRef - for UpdatePaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch -{ - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display - for UpdatePaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch -{ - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default - for UpdatePaymentIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch -{ - fn default() -> Self { - Self::Balances - } -} - -/// An enum representing the possible values of an `UpdatePaymentIntentPaymentMethodOptionsUsBankAccountMandateOptions`'s `collection_method` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum UpdatePaymentIntentPaymentMethodOptionsUsBankAccountMandateOptionsCollectionMethod { - Paper, -} - -impl UpdatePaymentIntentPaymentMethodOptionsUsBankAccountMandateOptionsCollectionMethod { - pub fn as_str(self) -> &'static str { - match self { - UpdatePaymentIntentPaymentMethodOptionsUsBankAccountMandateOptionsCollectionMethod::Paper => "paper", - } - } -} - -impl AsRef - for UpdatePaymentIntentPaymentMethodOptionsUsBankAccountMandateOptionsCollectionMethod -{ - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display - for UpdatePaymentIntentPaymentMethodOptionsUsBankAccountMandateOptionsCollectionMethod -{ - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default - for UpdatePaymentIntentPaymentMethodOptionsUsBankAccountMandateOptionsCollectionMethod -{ - fn default() -> Self { - Self::Paper - } -} - -/// An enum representing the possible values of an `UpdatePaymentIntentPaymentMethodOptionsUsBankAccountNetworks`'s `requested` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum UpdatePaymentIntentPaymentMethodOptionsUsBankAccountNetworksRequested { - Ach, - UsDomesticWire, -} - -impl UpdatePaymentIntentPaymentMethodOptionsUsBankAccountNetworksRequested { - pub fn as_str(self) -> &'static str { - match self { - UpdatePaymentIntentPaymentMethodOptionsUsBankAccountNetworksRequested::Ach => "ach", - UpdatePaymentIntentPaymentMethodOptionsUsBankAccountNetworksRequested::UsDomesticWire => "us_domestic_wire", - } - } -} - -impl AsRef for UpdatePaymentIntentPaymentMethodOptionsUsBankAccountNetworksRequested { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for UpdatePaymentIntentPaymentMethodOptionsUsBankAccountNetworksRequested { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default - for UpdatePaymentIntentPaymentMethodOptionsUsBankAccountNetworksRequested -{ - fn default() -> Self { - Self::Ach - } -} - -/// An enum representing the possible values of an `UpdatePaymentIntentPaymentMethodOptionsUsBankAccount`'s `preferred_settlement_speed` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum UpdatePaymentIntentPaymentMethodOptionsUsBankAccountPreferredSettlementSpeed { - Fastest, - Standard, -} - -impl UpdatePaymentIntentPaymentMethodOptionsUsBankAccountPreferredSettlementSpeed { - pub fn as_str(self) -> &'static str { - match self { - UpdatePaymentIntentPaymentMethodOptionsUsBankAccountPreferredSettlementSpeed::Fastest => "fastest", - UpdatePaymentIntentPaymentMethodOptionsUsBankAccountPreferredSettlementSpeed::Standard => "standard", - } - } -} - -impl AsRef for UpdatePaymentIntentPaymentMethodOptionsUsBankAccountPreferredSettlementSpeed { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display - for UpdatePaymentIntentPaymentMethodOptionsUsBankAccountPreferredSettlementSpeed -{ - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default - for UpdatePaymentIntentPaymentMethodOptionsUsBankAccountPreferredSettlementSpeed -{ - fn default() -> Self { - Self::Fastest - } -} - -/// An enum representing the possible values of an `UpdatePaymentIntentPaymentMethodOptionsUsBankAccount`'s `setup_future_usage` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum UpdatePaymentIntentPaymentMethodOptionsUsBankAccountSetupFutureUsage { - None, - OffSession, - OnSession, -} - -impl UpdatePaymentIntentPaymentMethodOptionsUsBankAccountSetupFutureUsage { - pub fn as_str(self) -> &'static str { - match self { - UpdatePaymentIntentPaymentMethodOptionsUsBankAccountSetupFutureUsage::None => "none", - UpdatePaymentIntentPaymentMethodOptionsUsBankAccountSetupFutureUsage::OffSession => { - "off_session" - } - UpdatePaymentIntentPaymentMethodOptionsUsBankAccountSetupFutureUsage::OnSession => { - "on_session" - } - } - } -} - -impl AsRef for UpdatePaymentIntentPaymentMethodOptionsUsBankAccountSetupFutureUsage { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for UpdatePaymentIntentPaymentMethodOptionsUsBankAccountSetupFutureUsage { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default - for UpdatePaymentIntentPaymentMethodOptionsUsBankAccountSetupFutureUsage -{ - fn default() -> Self { - Self::None - } -} - -/// An enum representing the possible values of an `UpdatePaymentIntentPaymentMethodOptionsUsBankAccount`'s `verification_method` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum UpdatePaymentIntentPaymentMethodOptionsUsBankAccountVerificationMethod { - Automatic, - Instant, - Microdeposits, -} - -impl UpdatePaymentIntentPaymentMethodOptionsUsBankAccountVerificationMethod { - pub fn as_str(self) -> &'static str { - match self { - UpdatePaymentIntentPaymentMethodOptionsUsBankAccountVerificationMethod::Automatic => "automatic", - UpdatePaymentIntentPaymentMethodOptionsUsBankAccountVerificationMethod::Instant => "instant", - UpdatePaymentIntentPaymentMethodOptionsUsBankAccountVerificationMethod::Microdeposits => "microdeposits", - } - } -} - -impl AsRef for UpdatePaymentIntentPaymentMethodOptionsUsBankAccountVerificationMethod { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for UpdatePaymentIntentPaymentMethodOptionsUsBankAccountVerificationMethod { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default - for UpdatePaymentIntentPaymentMethodOptionsUsBankAccountVerificationMethod -{ - fn default() -> Self { - Self::Automatic - } -} - -/// An enum representing the possible values of an `UpdatePaymentIntentPaymentMethodOptionsWechatPay`'s `client` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum UpdatePaymentIntentPaymentMethodOptionsWechatPayClient { - Android, - Ios, - Web, -} - -impl UpdatePaymentIntentPaymentMethodOptionsWechatPayClient { - pub fn as_str(self) -> &'static str { - match self { - UpdatePaymentIntentPaymentMethodOptionsWechatPayClient::Android => "android", - UpdatePaymentIntentPaymentMethodOptionsWechatPayClient::Ios => "ios", - UpdatePaymentIntentPaymentMethodOptionsWechatPayClient::Web => "web", - } - } -} - -impl AsRef for UpdatePaymentIntentPaymentMethodOptionsWechatPayClient { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for UpdatePaymentIntentPaymentMethodOptionsWechatPayClient { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for UpdatePaymentIntentPaymentMethodOptionsWechatPayClient { - fn default() -> Self { - Self::Android - } -} - -/// An enum representing the possible values of an `UpdatePaymentIntentPaymentMethodOptionsWechatPay`'s `setup_future_usage` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum UpdatePaymentIntentPaymentMethodOptionsWechatPaySetupFutureUsage { - None, -} - -impl UpdatePaymentIntentPaymentMethodOptionsWechatPaySetupFutureUsage { - pub fn as_str(self) -> &'static str { - match self { - UpdatePaymentIntentPaymentMethodOptionsWechatPaySetupFutureUsage::None => "none", - } - } -} - -impl AsRef for UpdatePaymentIntentPaymentMethodOptionsWechatPaySetupFutureUsage { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for UpdatePaymentIntentPaymentMethodOptionsWechatPaySetupFutureUsage { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for UpdatePaymentIntentPaymentMethodOptionsWechatPaySetupFutureUsage { - fn default() -> Self { - Self::None - } -} - -/// An enum representing the possible values of an `UpdatePaymentIntentPaymentMethodOptionsZip`'s `setup_future_usage` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum UpdatePaymentIntentPaymentMethodOptionsZipSetupFutureUsage { - None, -} - -impl UpdatePaymentIntentPaymentMethodOptionsZipSetupFutureUsage { - pub fn as_str(self) -> &'static str { - match self { - UpdatePaymentIntentPaymentMethodOptionsZipSetupFutureUsage::None => "none", - } - } -} - -impl AsRef for UpdatePaymentIntentPaymentMethodOptionsZipSetupFutureUsage { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for UpdatePaymentIntentPaymentMethodOptionsZipSetupFutureUsage { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for UpdatePaymentIntentPaymentMethodOptionsZipSetupFutureUsage { - fn default() -> Self { - Self::None - } -} diff --git a/src/resources/generated/payment_intent_amount_capturable_updated.rs b/src/resources/generated/payment_intent_amount_capturable_updated.rs deleted file mode 100644 index f4d81f9ac..000000000 --- a/src/resources/generated/payment_intent_amount_capturable_updated.rs +++ /dev/null @@ -1,10 +0,0 @@ -// ====================================== -// This file was automatically generated. -// ====================================== - -use serde::{Deserialize, Serialize}; - -/// The resource representing a Stripe "payment_intent.amount_capturable_updated". -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct PaymentIntentAmountCapturableUpdated { -} diff --git a/src/resources/generated/payment_intent_canceled.rs b/src/resources/generated/payment_intent_canceled.rs deleted file mode 100644 index f4acf4923..000000000 --- a/src/resources/generated/payment_intent_canceled.rs +++ /dev/null @@ -1,10 +0,0 @@ -// ====================================== -// This file was automatically generated. -// ====================================== - -use serde::{Deserialize, Serialize}; - -/// The resource representing a Stripe "payment_intent.canceled". -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct PaymentIntentCanceled { -} diff --git a/src/resources/generated/payment_intent_created.rs b/src/resources/generated/payment_intent_created.rs deleted file mode 100644 index 32f494a5d..000000000 --- a/src/resources/generated/payment_intent_created.rs +++ /dev/null @@ -1,10 +0,0 @@ -// ====================================== -// This file was automatically generated. -// ====================================== - -use serde::{Deserialize, Serialize}; - -/// The resource representing a Stripe "payment_intent.created". -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct PaymentIntentCreated { -} diff --git a/src/resources/generated/payment_intent_next_action_cashapp_handle_redirect_or_display_qr_code.rs b/src/resources/generated/payment_intent_next_action_cashapp_handle_redirect_or_display_qr_code.rs deleted file mode 100644 index 029b162ee..000000000 --- a/src/resources/generated/payment_intent_next_action_cashapp_handle_redirect_or_display_qr_code.rs +++ /dev/null @@ -1,31 +0,0 @@ -// ====================================== -// This file was automatically generated. -// ====================================== - -use serde::{Deserialize, Serialize}; - -use crate::params::Timestamp; - -/// The resource representing a Stripe "PaymentIntentNextActionCashappHandleRedirectOrDisplayQrCode". -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct PaymentIntentNextActionCashappHandleRedirectOrDisplayQrCode { - /// The URL to the hosted Cash App Pay instructions page, which allows customers to view the QR code, and supports QR code refreshing on expiration. - pub hosted_instructions_url: String, - - /// The url for mobile redirect based auth. - pub mobile_auth_url: String, - - pub qr_code: PaymentIntentNextActionCashappQrCode, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct PaymentIntentNextActionCashappQrCode { - /// The date (unix timestamp) when the QR code expires. - pub expires_at: Timestamp, - - /// The image_url_png string used to render QR code. - pub image_url_png: String, - - /// The image_url_svg string used to render QR code. - pub image_url_svg: String, -} diff --git a/src/resources/generated/payment_intent_partially_funded.rs b/src/resources/generated/payment_intent_partially_funded.rs deleted file mode 100644 index 562650b2b..000000000 --- a/src/resources/generated/payment_intent_partially_funded.rs +++ /dev/null @@ -1,10 +0,0 @@ -// ====================================== -// This file was automatically generated. -// ====================================== - -use serde::{Deserialize, Serialize}; - -/// The resource representing a Stripe "payment_intent.partially_funded". -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct PaymentIntentPartiallyFunded { -} diff --git a/src/resources/generated/payment_intent_payment_failed.rs b/src/resources/generated/payment_intent_payment_failed.rs deleted file mode 100644 index 30cc56529..000000000 --- a/src/resources/generated/payment_intent_payment_failed.rs +++ /dev/null @@ -1,10 +0,0 @@ -// ====================================== -// This file was automatically generated. -// ====================================== - -use serde::{Deserialize, Serialize}; - -/// The resource representing a Stripe "payment_intent.payment_failed". -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct PaymentIntentPaymentFailed { -} diff --git a/src/resources/generated/payment_intent_processing.rs b/src/resources/generated/payment_intent_processing.rs deleted file mode 100644 index b0f402fd3..000000000 --- a/src/resources/generated/payment_intent_processing.rs +++ /dev/null @@ -1,10 +0,0 @@ -// ====================================== -// This file was automatically generated. -// ====================================== - -use serde::{Deserialize, Serialize}; - -/// The resource representing a Stripe "payment_intent.processing". -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct PaymentIntentProcessing { -} diff --git a/src/resources/generated/payment_intent_requires_action.rs b/src/resources/generated/payment_intent_requires_action.rs deleted file mode 100644 index 9c5cc9684..000000000 --- a/src/resources/generated/payment_intent_requires_action.rs +++ /dev/null @@ -1,10 +0,0 @@ -// ====================================== -// This file was automatically generated. -// ====================================== - -use serde::{Deserialize, Serialize}; - -/// The resource representing a Stripe "payment_intent.requires_action". -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct PaymentIntentRequiresAction { -} diff --git a/src/resources/generated/payment_intent_succeeded.rs b/src/resources/generated/payment_intent_succeeded.rs deleted file mode 100644 index 53b389ee4..000000000 --- a/src/resources/generated/payment_intent_succeeded.rs +++ /dev/null @@ -1,10 +0,0 @@ -// ====================================== -// This file was automatically generated. -// ====================================== - -use serde::{Deserialize, Serialize}; - -/// The resource representing a Stripe "payment_intent.succeeded". -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct PaymentIntentSucceeded { -} diff --git a/src/resources/generated/payment_link.rs b/src/resources/generated/payment_link.rs deleted file mode 100644 index ff4b26102..000000000 --- a/src/resources/generated/payment_link.rs +++ /dev/null @@ -1,5397 +0,0 @@ -// ====================================== -// This file was automatically generated. -// ====================================== - -use serde::{Deserialize, Serialize}; - -use crate::client::{Client, Response}; -use crate::ids::PaymentLinkId; -use crate::params::{Expand, Expandable, List, Metadata, Object, Paginable}; -use crate::resources::{ - Account, Application, CheckoutSessionItem, ConnectAccountReference, Currency, - InvoiceSettingRenderingOptions, ShippingRate, SubscriptionsTrialsResourceTrialSettings, TaxId, -}; - -/// The resource representing a Stripe "PaymentLink". -/// -/// For more details see -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct PaymentLink { - /// Unique identifier for the object. - pub id: PaymentLinkId, - - /// Whether the payment link's `url` is active. - /// - /// If `false`, customers visiting the URL will be shown a page saying that the link has been deactivated. - pub active: bool, - - pub after_completion: PaymentLinksResourceAfterCompletion, - - /// Whether user redeemable promotion codes are enabled. - pub allow_promotion_codes: bool, - - /// The ID of the Connect application that created the Payment Link. - pub application: Option>, - - /// The amount of the application fee (if any) that will be requested to be applied to the payment and transferred to the application owner's Stripe account. - pub application_fee_amount: Option, - - /// This represents the percentage of the subscription invoice total that will be transferred to the application owner's Stripe account. - pub application_fee_percent: Option, - - pub automatic_tax: PaymentLinksResourceAutomaticTax, - - /// Configuration for collecting the customer's billing address. - pub billing_address_collection: PaymentLinkBillingAddressCollection, - - /// When set, provides configuration to gather active consent from customers. - pub consent_collection: Option, - - /// Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. - /// - /// Must be a [supported currency](https://stripe.com/docs/currencies). - pub currency: Currency, - - /// Collect additional information from your customer using custom fields. - /// - /// Up to 3 fields are supported. - pub custom_fields: Vec, - - pub custom_text: PaymentLinksResourceCustomText, - - /// Configuration for Customer creation during checkout. - pub customer_creation: PaymentLinkCustomerCreation, - - /// The custom message to be displayed to a customer when a payment link is no longer active. - pub inactive_message: Option, - - /// Configuration for creating invoice for payment mode payment links. - pub invoice_creation: Option, - - /// The line items representing what is being sold. - #[serde(skip_serializing_if = "Option::is_none")] - pub line_items: Option>, - - /// Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. - pub livemode: bool, - - /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. - /// - /// This can be useful for storing additional information about the object in a structured format. - pub metadata: Metadata, - - /// The account on behalf of which to charge. - /// - /// See the [Connect documentation](https://support.stripe.com/questions/sending-invoices-on-behalf-of-connected-accounts) for details. - pub on_behalf_of: Option>, - - /// Indicates the parameters to be passed to PaymentIntent creation during checkout. - pub payment_intent_data: Option, - - /// Configuration for collecting a payment method during checkout. - pub payment_method_collection: PaymentLinkPaymentMethodCollection, - - /// The list of payment method types that customers can use. - /// - /// When `null`, Stripe will dynamically show relevant payment methods you've enabled in your [payment method settings](https://dashboard.stripe.com/settings/payment_methods). - pub payment_method_types: Option>, - - pub phone_number_collection: PaymentLinksResourcePhoneNumberCollection, - - /// Settings that restrict the usage of a payment link. - pub restrictions: Option, - - /// Configuration for collecting the customer's shipping address. - pub shipping_address_collection: Option, - - /// The shipping rate options applied to the session. - pub shipping_options: Vec, - - /// Indicates the type of transaction being performed which customizes relevant text on the page, such as the submit button. - pub submit_type: PaymentLinkSubmitType, - - /// When creating a subscription, the specified configuration data will be used. - /// - /// There must be at least one line item with a recurring price to use `subscription_data`. - pub subscription_data: Option, - - pub tax_id_collection: PaymentLinksResourceTaxIdCollection, - - /// The account (if any) the payments will be attributed to for tax reporting, and where funds from each payment will be transferred to. - pub transfer_data: Option, - - /// The public URL that can be shared with customers. - pub url: String, -} - -impl PaymentLink { - /// Returns a list of your payment links. - pub fn list(client: &Client, params: &ListPaymentLinks<'_>) -> Response> { - client.get_query("/payment_links", ¶ms) - } - - /// Creates a payment link. - pub fn create(client: &Client, params: CreatePaymentLink<'_>) -> Response { - client.post_form("/payment_links", ¶ms) - } - - /// Retrieve a payment link. - pub fn retrieve(client: &Client, id: &PaymentLinkId, expand: &[&str]) -> Response { - client.get_query(&format!("/payment_links/{}", id), &Expand { expand }) - } - - /// Updates a payment link. - pub fn update( - client: &Client, - id: &PaymentLinkId, - params: UpdatePaymentLink<'_>, - ) -> Response { - client.post_form(&format!("/payment_links/{}", id), ¶ms) - } -} - -impl Object for PaymentLink { - type Id = PaymentLinkId; - fn id(&self) -> Self::Id { - self.id.clone() - } - fn object(&self) -> &'static str { - "payment_link" - } -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct PaymentLinksResourceAfterCompletion { - #[serde(skip_serializing_if = "Option::is_none")] - pub hosted_confirmation: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub redirect: Option, - - /// The specified behavior after the purchase is complete. - #[serde(rename = "type")] - pub type_: PaymentLinksResourceAfterCompletionType, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct PaymentLinksResourceAutomaticTax { - /// If `true`, tax will be calculated automatically using the customer's location. - pub enabled: bool, - - /// The account that's liable for tax. - /// - /// If set, the business address and tax registrations required to perform the tax calculation are loaded from this account. - /// The tax transaction is returned in the report of the connected account. - pub liability: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct PaymentLinksResourceCompletionBehaviorConfirmationPage { - /// The custom message that is displayed to the customer after the purchase is complete. - pub custom_message: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct PaymentLinksResourceCompletionBehaviorRedirect { - /// The URL the customer will be redirected to after the purchase is complete. - pub url: String, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct PaymentLinksResourceConsentCollection { - /// Settings related to the payment method reuse text shown in the Checkout UI. - pub payment_method_reuse_agreement: Option, - - /// If set to `auto`, enables the collection of customer consent for promotional communications. - pub promotions: Option, - - /// If set to `required`, it requires cutomers to accept the terms of service before being able to pay. - /// - /// If set to `none`, customers won't be shown a checkbox to accept the terms of service. - pub terms_of_service: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct PaymentLinksResourceCustomFields { - #[serde(skip_serializing_if = "Option::is_none")] - pub dropdown: Option, - - /// String of your choice that your integration can use to reconcile this field. - /// - /// Must be unique to this field, alphanumeric, and up to 200 characters. - pub key: String, - - pub label: PaymentLinksResourceCustomFieldsLabel, - - #[serde(skip_serializing_if = "Option::is_none")] - pub numeric: Option, - - /// Whether the customer is required to complete the field before completing the Checkout Session. - /// - /// Defaults to `false`. - pub optional: bool, - - #[serde(skip_serializing_if = "Option::is_none")] - pub text: Option, - - /// The type of the field. - #[serde(rename = "type")] - pub type_: PaymentLinksResourceCustomFieldsType, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct PaymentLinksResourceCustomFieldsDropdown { - /// The options available for the customer to select. - /// - /// Up to 200 options allowed. - pub options: Vec, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct PaymentLinksResourceCustomFieldsDropdownOption { - /// The label for the option, displayed to the customer. - /// - /// Up to 100 characters. - pub label: String, - - /// The value for this option, not displayed to the customer, used by your integration to reconcile the option selected by the customer. - /// - /// Must be unique to this option, alphanumeric, and up to 100 characters. - pub value: String, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct PaymentLinksResourceCustomFieldsLabel { - /// Custom text for the label, displayed to the customer. - /// - /// Up to 50 characters. - pub custom: Option, - - /// The type of the label. - #[serde(rename = "type")] - pub type_: PaymentLinksResourceCustomFieldsLabelType, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct PaymentLinksResourceCustomFieldsNumeric { - /// The maximum character length constraint for the customer's input. - pub maximum_length: Option, - - /// The minimum character length requirement for the customer's input. - pub minimum_length: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct PaymentLinksResourceCustomFieldsText { - /// The maximum character length constraint for the customer's input. - pub maximum_length: Option, - - /// The minimum character length requirement for the customer's input. - pub minimum_length: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct PaymentLinksResourceCustomText { - /// Custom text that should be displayed after the payment confirmation button. - pub after_submit: Option, - - /// Custom text that should be displayed alongside shipping address collection. - pub shipping_address: Option, - - /// Custom text that should be displayed alongside the payment confirmation button. - pub submit: Option, - - /// Custom text that should be displayed in place of the default terms of service agreement text. - pub terms_of_service_acceptance: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct PaymentLinksResourceCustomTextPosition { - /// Text may be up to 1200 characters in length. - pub message: String, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct PaymentLinksResourceInvoiceCreation { - /// Enable creating an invoice on successful payment. - pub enabled: bool, - - /// Configuration for the invoice. - /// - /// Default invoice values will be used if unspecified. - pub invoice_data: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct PaymentLinksResourceInvoiceSettings { - /// The account tax IDs associated with the invoice. - pub account_tax_ids: Option>>, - - /// A list of up to 4 custom fields to be displayed on the invoice. - pub custom_fields: Option>, - - /// An arbitrary string attached to the object. - /// - /// Often useful for displaying to users. - pub description: Option, - - /// Footer to be displayed on the invoice. - pub footer: Option, - - /// The connected account that issues the invoice. - /// - /// The invoice is presented with the branding and support information of the specified account. - pub issuer: Option, - - /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. - /// - /// This can be useful for storing additional information about the object in a structured format. - pub metadata: Option, - - /// Options for invoice PDF rendering. - pub rendering_options: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct InvoiceSettingCustomField { - /// The name of the custom field. - pub name: String, - - /// The value of the custom field. - pub value: String, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct PaymentLinksResourcePaymentIntentData { - /// Indicates when the funds will be captured from the customer's account. - pub capture_method: Option, - - /// An arbitrary string attached to the object. - /// - /// Often useful for displaying to users. - pub description: Option, - - /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that will set metadata on [Payment Intents](https://stripe.com/docs/api/payment_intents) generated from this payment link. - pub metadata: Metadata, - - /// Indicates that you intend to make future payments with the payment method collected during checkout. - pub setup_future_usage: Option, - - /// Extra information about the payment. - /// - /// This will appear on your customer's statement when this payment succeeds in creating a charge. - pub statement_descriptor: Option, - - /// Provides information about the charge that customers see on their statements. - /// - /// Concatenated with the prefix (shortened descriptor) or statement descriptor that's set on the account to form the complete statement descriptor. - /// Maximum 22 characters for the concatenated descriptor. - pub statement_descriptor_suffix: Option, - - /// A string that identifies the resulting payment as part of a group. - /// - /// See the PaymentIntents [use case for connected accounts](https://stripe.com/docs/connect/separate-charges-and-transfers) for details. - pub transfer_group: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct PaymentLinksResourcePaymentMethodReuseAgreement { - /// Determines the position and visibility of the payment method reuse agreement in the UI. - /// - /// When set to `auto`, Stripe's defaults will be used. When set to `hidden`, the payment method reuse agreement text will always be hidden in the UI. - pub position: PaymentLinksResourcePaymentMethodReuseAgreementPosition, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct PaymentLinksResourcePhoneNumberCollection { - /// If `true`, a phone number will be collected during checkout. - pub enabled: bool, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct PaymentLinksResourceRestrictions { - pub completed_sessions: PaymentLinksResourceCompletedSessions, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct PaymentLinksResourceCompletedSessions { - /// The current number of checkout sessions that have been completed on the payment link which count towards the `completed_sessions` restriction to be met. - pub count: u64, - - /// The maximum number of checkout sessions that can be completed for the `completed_sessions` restriction to be met. - pub limit: i64, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct PaymentLinksResourceShippingAddressCollection { - /// An array of two-letter ISO country codes representing which countries Checkout should provide as options for shipping locations. - /// - /// Unsupported country codes: `AS, CX, CC, CU, HM, IR, KP, MH, FM, NF, MP, PW, SD, SY, UM, VI`. - pub allowed_countries: Vec, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct PaymentLinksResourceShippingOption { - /// A non-negative integer in cents representing how much to charge. - pub shipping_amount: i64, - - /// The ID of the Shipping Rate to use for this shipping option. - pub shipping_rate: Expandable, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct PaymentLinksResourceSubscriptionData { - /// The subscription's description, meant to be displayable to the customer. - /// - /// Use this field to optionally store an explanation of the subscription for rendering in Stripe surfaces and certain local payment methods UIs. - pub description: Option, - - pub invoice_settings: PaymentLinksResourceSubscriptionDataInvoiceSettings, - - /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that will set metadata on [Subscriptions](https://stripe.com/docs/api/subscriptions) generated from this payment link. - pub metadata: Metadata, - - /// Integer representing the number of trial period days before the customer is charged for the first time. - pub trial_period_days: Option, - - /// Settings related to subscription trials. - pub trial_settings: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct PaymentLinksResourceSubscriptionDataInvoiceSettings { - pub issuer: ConnectAccountReference, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct PaymentLinksResourceTaxIdCollection { - /// Indicates whether tax ID collection is enabled for the session. - pub enabled: bool, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct PaymentLinksResourceTransferData { - /// The amount in cents (or local equivalent) that will be transferred to the destination account. - /// - /// By default, the entire amount is transferred to the destination. - pub amount: Option, - - /// The connected account receiving the transfer. - pub destination: Expandable, -} - -/// The parameters for `PaymentLink::create`. -#[derive(Clone, Debug, Serialize)] -pub struct CreatePaymentLink<'a> { - /// Behavior after the purchase is complete. - #[serde(skip_serializing_if = "Option::is_none")] - pub after_completion: Option, - - /// Enables user redeemable promotion codes. - #[serde(skip_serializing_if = "Option::is_none")] - pub allow_promotion_codes: Option, - - /// The amount of the application fee (if any) that will be requested to be applied to the payment and transferred to the application owner's Stripe account. - /// - /// Can only be applied when there are no line items with recurring prices. - #[serde(skip_serializing_if = "Option::is_none")] - pub application_fee_amount: Option, - - /// A non-negative decimal between 0 and 100, with at most two decimal places. - /// - /// This represents the percentage of the subscription invoice total that will be transferred to the application owner's Stripe account. - /// There must be at least 1 line item with a recurring price to use this field. - #[serde(skip_serializing_if = "Option::is_none")] - pub application_fee_percent: Option, - - /// Configuration for automatic tax collection. - #[serde(skip_serializing_if = "Option::is_none")] - pub automatic_tax: Option, - - /// Configuration for collecting the customer's billing address. - #[serde(skip_serializing_if = "Option::is_none")] - pub billing_address_collection: Option, - - /// Configure fields to gather active consent from customers. - #[serde(skip_serializing_if = "Option::is_none")] - pub consent_collection: Option, - - /// Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. - /// - /// Must be a [supported currency](https://stripe.com/docs/currencies) and supported by each line item's price. - #[serde(skip_serializing_if = "Option::is_none")] - pub currency: Option, - - /// Collect additional information from your customer using custom fields. - /// - /// Up to 3 fields are supported. - #[serde(skip_serializing_if = "Option::is_none")] - pub custom_fields: Option>, - - /// Display additional text for your customers using custom text. - #[serde(skip_serializing_if = "Option::is_none")] - pub custom_text: Option, - - /// Configures whether [checkout sessions](https://stripe.com/docs/api/checkout/sessions) created by this payment link create a [Customer](https://stripe.com/docs/api/customers). - #[serde(skip_serializing_if = "Option::is_none")] - pub customer_creation: Option, - - /// Specifies which fields in the response should be expanded. - #[serde(skip_serializing_if = "Expand::is_empty")] - pub expand: &'a [&'a str], - - /// The custom message to be displayed to a customer when a payment link is no longer active. - #[serde(skip_serializing_if = "Option::is_none")] - pub inactive_message: Option<&'a str>, - - /// Generate a post-purchase Invoice for one-time payments. - #[serde(skip_serializing_if = "Option::is_none")] - pub invoice_creation: Option, - - /// The line items representing what is being sold. - /// - /// Each line item represents an item being sold. - /// Up to 20 line items are supported. - pub line_items: Vec, - - /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. - /// - /// This can be useful for storing additional information about the object in a structured format. - /// Individual keys can be unset by posting an empty value to them. - /// All keys can be unset by posting an empty value to `metadata`. - /// Metadata associated with this Payment Link will automatically be copied to [checkout sessions](https://stripe.com/docs/api/checkout/sessions) created by this payment link. - #[serde(skip_serializing_if = "Option::is_none")] - pub metadata: Option, - - /// The account on behalf of which to charge. - #[serde(skip_serializing_if = "Option::is_none")] - pub on_behalf_of: Option<&'a str>, - - /// A subset of parameters to be passed to PaymentIntent creation for Checkout Sessions in `payment` mode. - #[serde(skip_serializing_if = "Option::is_none")] - pub payment_intent_data: Option, - - /// Specify whether Checkout should collect a payment method. - /// - /// When set to `if_required`, Checkout will not collect a payment method when the total due for the session is 0.This may occur if the Checkout Session includes a free trial or a discount. Can only be set in `subscription` mode. If you'd like information on how to collect a payment method outside of Checkout, read the guide on [configuring subscriptions with a free trial](https://stripe.com/docs/payments/checkout/free-trials). - #[serde(skip_serializing_if = "Option::is_none")] - pub payment_method_collection: Option, - - /// The list of payment method types that customers can use. - /// - /// If no value is passed, Stripe will dynamically show relevant payment methods from your [payment method settings](https://dashboard.stripe.com/settings/payment_methods) (20+ payment methods [supported](https://stripe.com/docs/payments/payment-methods/integration-options#payment-method-product-support)). - #[serde(skip_serializing_if = "Option::is_none")] - pub payment_method_types: Option>, - - /// Controls phone number collection settings during checkout. - /// - /// We recommend that you review your privacy policy and check with your legal contacts. - #[serde(skip_serializing_if = "Option::is_none")] - pub phone_number_collection: Option, - - /// Settings that restrict the usage of a payment link. - #[serde(skip_serializing_if = "Option::is_none")] - pub restrictions: Option, - - /// Configuration for collecting the customer's shipping address. - #[serde(skip_serializing_if = "Option::is_none")] - pub shipping_address_collection: Option, - - /// The shipping rate options to apply to [checkout sessions](https://stripe.com/docs/api/checkout/sessions) created by this payment link. - #[serde(skip_serializing_if = "Option::is_none")] - pub shipping_options: Option>, - - /// Describes the type of transaction being performed in order to customize relevant text on the page, such as the submit button. - /// - /// Changing this value will also affect the hostname in the [url](https://stripe.com/docs/api/payment_links/payment_links/object#url) property (example: `donate.stripe.com`). - #[serde(skip_serializing_if = "Option::is_none")] - pub submit_type: Option, - - /// When creating a subscription, the specified configuration data will be used. - /// - /// There must be at least one line item with a recurring price to use `subscription_data`. - #[serde(skip_serializing_if = "Option::is_none")] - pub subscription_data: Option, - - /// Controls tax ID collection during checkout. - #[serde(skip_serializing_if = "Option::is_none")] - pub tax_id_collection: Option, - - /// The account (if any) the payments will be attributed to for tax reporting, and where funds from each payment will be transferred to. - #[serde(skip_serializing_if = "Option::is_none")] - pub transfer_data: Option, -} - -impl<'a> CreatePaymentLink<'a> { - pub fn new(line_items: Vec) -> Self { - CreatePaymentLink { - after_completion: Default::default(), - allow_promotion_codes: Default::default(), - application_fee_amount: Default::default(), - application_fee_percent: Default::default(), - automatic_tax: Default::default(), - billing_address_collection: Default::default(), - consent_collection: Default::default(), - currency: Default::default(), - custom_fields: Default::default(), - custom_text: Default::default(), - customer_creation: Default::default(), - expand: Default::default(), - inactive_message: Default::default(), - invoice_creation: Default::default(), - line_items, - metadata: Default::default(), - on_behalf_of: Default::default(), - payment_intent_data: Default::default(), - payment_method_collection: Default::default(), - payment_method_types: Default::default(), - phone_number_collection: Default::default(), - restrictions: Default::default(), - shipping_address_collection: Default::default(), - shipping_options: Default::default(), - submit_type: Default::default(), - subscription_data: Default::default(), - tax_id_collection: Default::default(), - transfer_data: Default::default(), - } - } -} - -/// The parameters for `PaymentLink::list`. -#[derive(Clone, Debug, Serialize, Default)] -pub struct ListPaymentLinks<'a> { - /// Only return payment links that are active or inactive (e.g., pass `false` to list all inactive payment links). - #[serde(skip_serializing_if = "Option::is_none")] - pub active: Option, - - /// A cursor for use in pagination. - /// - /// `ending_before` is an object ID that defines your place in the list. - /// For instance, if you make a list request and receive 100 objects, starting with `obj_bar`, your subsequent call can include `ending_before=obj_bar` in order to fetch the previous page of the list. - #[serde(skip_serializing_if = "Option::is_none")] - pub ending_before: Option, - - /// Specifies which fields in the response should be expanded. - #[serde(skip_serializing_if = "Expand::is_empty")] - pub expand: &'a [&'a str], - - /// A limit on the number of objects to be returned. - /// - /// Limit can range between 1 and 100, and the default is 10. - #[serde(skip_serializing_if = "Option::is_none")] - pub limit: Option, - - /// A cursor for use in pagination. - /// - /// `starting_after` is an object ID that defines your place in the list. - /// For instance, if you make a list request and receive 100 objects, ending with `obj_foo`, your subsequent call can include `starting_after=obj_foo` in order to fetch the next page of the list. - #[serde(skip_serializing_if = "Option::is_none")] - pub starting_after: Option, -} - -impl<'a> ListPaymentLinks<'a> { - pub fn new() -> Self { - ListPaymentLinks { - active: Default::default(), - ending_before: Default::default(), - expand: Default::default(), - limit: Default::default(), - starting_after: Default::default(), - } - } -} -impl Paginable for ListPaymentLinks<'_> { - type O = PaymentLink; - fn set_last(&mut self, item: Self::O) { - self.starting_after = Some(item.id()); - } -} -/// The parameters for `PaymentLink::update`. -#[derive(Clone, Debug, Serialize, Default)] -pub struct UpdatePaymentLink<'a> { - /// Whether the payment link's `url` is active. - /// - /// If `false`, customers visiting the URL will be shown a page saying that the link has been deactivated. - #[serde(skip_serializing_if = "Option::is_none")] - pub active: Option, - - /// Behavior after the purchase is complete. - #[serde(skip_serializing_if = "Option::is_none")] - pub after_completion: Option, - - /// Enables user redeemable promotion codes. - #[serde(skip_serializing_if = "Option::is_none")] - pub allow_promotion_codes: Option, - - /// Configuration for automatic tax collection. - #[serde(skip_serializing_if = "Option::is_none")] - pub automatic_tax: Option, - - /// Configuration for collecting the customer's billing address. - #[serde(skip_serializing_if = "Option::is_none")] - pub billing_address_collection: Option, - - /// Collect additional information from your customer using custom fields. - /// - /// Up to 3 fields are supported. - #[serde(skip_serializing_if = "Option::is_none")] - pub custom_fields: Option>, - - /// Display additional text for your customers using custom text. - #[serde(skip_serializing_if = "Option::is_none")] - pub custom_text: Option, - - /// Configures whether [checkout sessions](https://stripe.com/docs/api/checkout/sessions) created by this payment link create a [Customer](https://stripe.com/docs/api/customers). - #[serde(skip_serializing_if = "Option::is_none")] - pub customer_creation: Option, - - /// Specifies which fields in the response should be expanded. - #[serde(skip_serializing_if = "Expand::is_empty")] - pub expand: &'a [&'a str], - - /// The custom message to be displayed to a customer when a payment link is no longer active. - #[serde(skip_serializing_if = "Option::is_none")] - pub inactive_message: Option, - - /// Generate a post-purchase Invoice for one-time payments. - #[serde(skip_serializing_if = "Option::is_none")] - pub invoice_creation: Option, - - /// The line items representing what is being sold. - /// - /// Each line item represents an item being sold. - /// Up to 20 line items are supported. - #[serde(skip_serializing_if = "Option::is_none")] - pub line_items: Option>, - - /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. - /// - /// This can be useful for storing additional information about the object in a structured format. - /// Individual keys can be unset by posting an empty value to them. - /// All keys can be unset by posting an empty value to `metadata`. - /// Metadata associated with this Payment Link will automatically be copied to [checkout sessions](https://stripe.com/docs/api/checkout/sessions) created by this payment link. - #[serde(skip_serializing_if = "Option::is_none")] - pub metadata: Option, - - /// A subset of parameters to be passed to PaymentIntent creation for Checkout Sessions in `payment` mode. - #[serde(skip_serializing_if = "Option::is_none")] - pub payment_intent_data: Option, - - /// Specify whether Checkout should collect a payment method. - /// - /// When set to `if_required`, Checkout will not collect a payment method when the total due for the session is 0.This may occur if the Checkout Session includes a free trial or a discount. Can only be set in `subscription` mode. If you'd like information on how to collect a payment method outside of Checkout, read the guide on [configuring subscriptions with a free trial](https://stripe.com/docs/payments/checkout/free-trials). - #[serde(skip_serializing_if = "Option::is_none")] - pub payment_method_collection: Option, - - /// The list of payment method types that customers can use. - /// - /// Pass an empty string to enable dynamic payment methods that use your [payment method settings](https://dashboard.stripe.com/settings/payment_methods). - #[serde(skip_serializing_if = "Option::is_none")] - pub payment_method_types: Option>, - - /// Settings that restrict the usage of a payment link. - #[serde(skip_serializing_if = "Option::is_none")] - pub restrictions: Option, - - /// Configuration for collecting the customer's shipping address. - #[serde(skip_serializing_if = "Option::is_none")] - pub shipping_address_collection: Option, - - /// When creating a subscription, the specified configuration data will be used. - /// - /// There must be at least one line item with a recurring price to use `subscription_data`. - #[serde(skip_serializing_if = "Option::is_none")] - pub subscription_data: Option, -} - -impl<'a> UpdatePaymentLink<'a> { - pub fn new() -> Self { - UpdatePaymentLink { - active: Default::default(), - after_completion: Default::default(), - allow_promotion_codes: Default::default(), - automatic_tax: Default::default(), - billing_address_collection: Default::default(), - custom_fields: Default::default(), - custom_text: Default::default(), - customer_creation: Default::default(), - expand: Default::default(), - inactive_message: Default::default(), - invoice_creation: Default::default(), - line_items: Default::default(), - metadata: Default::default(), - payment_intent_data: Default::default(), - payment_method_collection: Default::default(), - payment_method_types: Default::default(), - restrictions: Default::default(), - shipping_address_collection: Default::default(), - subscription_data: Default::default(), - } - } -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreatePaymentLinkAfterCompletion { - /// Configuration when `type=hosted_confirmation`. - #[serde(skip_serializing_if = "Option::is_none")] - pub hosted_confirmation: Option, - - /// Configuration when `type=redirect`. - #[serde(skip_serializing_if = "Option::is_none")] - pub redirect: Option, - - /// The specified behavior after the purchase is complete. - /// - /// Either `redirect` or `hosted_confirmation`. - #[serde(rename = "type")] - pub type_: CreatePaymentLinkAfterCompletionType, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreatePaymentLinkAutomaticTax { - /// If `true`, tax will be calculated automatically using the customer's location. - pub enabled: bool, - - /// The account that's liable for tax. - /// - /// If set, the business address and tax registrations required to perform the tax calculation are loaded from this account. - /// The tax transaction is returned in the report of the connected account. - #[serde(skip_serializing_if = "Option::is_none")] - pub liability: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreatePaymentLinkConsentCollection { - /// Determines the display of payment method reuse agreement text in the UI. - /// - /// If set to `hidden`, it will hide legal text related to the reuse of a payment method. - #[serde(skip_serializing_if = "Option::is_none")] - pub payment_method_reuse_agreement: - Option, - - /// If set to `auto`, enables the collection of customer consent for promotional communications. - /// - /// The Checkout Session will determine whether to display an option to opt into promotional communication from the merchant depending on the customer's locale. - /// Only available to US merchants. - #[serde(skip_serializing_if = "Option::is_none")] - pub promotions: Option, - - /// If set to `required`, it requires customers to check a terms of service checkbox before being able to pay. - /// There must be a valid terms of service URL set in your [Dashboard settings](https://dashboard.stripe.com/settings/public). - #[serde(skip_serializing_if = "Option::is_none")] - pub terms_of_service: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreatePaymentLinkCustomFields { - /// Configuration for `type=dropdown` fields. - #[serde(skip_serializing_if = "Option::is_none")] - pub dropdown: Option, - - /// String of your choice that your integration can use to reconcile this field. - /// - /// Must be unique to this field, alphanumeric, and up to 200 characters. - pub key: String, - - /// The label for the field, displayed to the customer. - pub label: CreatePaymentLinkCustomFieldsLabel, - - /// Configuration for `type=numeric` fields. - #[serde(skip_serializing_if = "Option::is_none")] - pub numeric: Option, - - /// Whether the customer is required to complete the field before completing the Checkout Session. - /// - /// Defaults to `false`. - #[serde(skip_serializing_if = "Option::is_none")] - pub optional: Option, - - /// Configuration for `type=text` fields. - #[serde(skip_serializing_if = "Option::is_none")] - pub text: Option, - - /// The type of the field. - #[serde(rename = "type")] - pub type_: CreatePaymentLinkCustomFieldsType, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreatePaymentLinkCustomText { - /// Custom text that should be displayed after the payment confirmation button. - #[serde(skip_serializing_if = "Option::is_none")] - pub after_submit: Option, - - /// Custom text that should be displayed alongside shipping address collection. - #[serde(skip_serializing_if = "Option::is_none")] - pub shipping_address: Option, - - /// Custom text that should be displayed alongside the payment confirmation button. - #[serde(skip_serializing_if = "Option::is_none")] - pub submit: Option, - - /// Custom text that should be displayed in place of the default terms of service agreement text. - #[serde(skip_serializing_if = "Option::is_none")] - pub terms_of_service_acceptance: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreatePaymentLinkInvoiceCreation { - /// Whether the feature is enabled. - pub enabled: bool, - - /// Invoice PDF configuration. - #[serde(skip_serializing_if = "Option::is_none")] - pub invoice_data: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreatePaymentLinkLineItems { - /// When set, provides configuration for this item’s quantity to be adjusted by the customer during checkout. - #[serde(skip_serializing_if = "Option::is_none")] - pub adjustable_quantity: Option, - - /// The ID of the [Price](https://stripe.com/docs/api/prices) or [Plan](https://stripe.com/docs/api/plans) object. - pub price: String, - - /// The quantity of the line item being purchased. - pub quantity: u64, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreatePaymentLinkPaymentIntentData { - /// Controls when the funds will be captured from the customer's account. - #[serde(skip_serializing_if = "Option::is_none")] - pub capture_method: Option, - - /// An arbitrary string attached to the object. - /// - /// Often useful for displaying to users. - #[serde(skip_serializing_if = "Option::is_none")] - pub description: Option, - - /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that will declaratively set metadata on [Payment Intents](https://stripe.com/docs/api/payment_intents) generated from this payment link. - /// - /// Unlike object-level metadata, this field is declarative. - /// Updates will clear prior values. - #[serde(skip_serializing_if = "Option::is_none")] - pub metadata: Option, - - /// Indicates that you intend to [make future payments](https://stripe.com/docs/payments/payment-intents#future-usage) with the payment method collected by this Checkout Session. - /// - /// When setting this to `on_session`, Checkout will show a notice to the customer that their payment details will be saved. - /// - /// When setting this to `off_session`, Checkout will show a notice to the customer that their payment details will be saved and used for future payments. - /// - /// If a Customer has been provided or Checkout creates a new Customer,Checkout will attach the payment method to the Customer. - /// - /// If Checkout does not create a Customer, the payment method is not attached to a Customer. - /// - /// To reuse the payment method, you can retrieve it from the Checkout Session's PaymentIntent. When processing card payments, Checkout also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as SCA. - #[serde(skip_serializing_if = "Option::is_none")] - pub setup_future_usage: Option, - - /// Extra information about the payment. - /// - /// This will appear on your customer's statement when this payment succeeds in creating a charge. - #[serde(skip_serializing_if = "Option::is_none")] - pub statement_descriptor: Option, - - /// Provides information about the charge that customers see on their statements. - /// - /// Concatenated with the prefix (shortened descriptor) or statement descriptor that's set on the account to form the complete statement descriptor. - /// Maximum 22 characters for the concatenated descriptor. - #[serde(skip_serializing_if = "Option::is_none")] - pub statement_descriptor_suffix: Option, - - /// A string that identifies the resulting payment as part of a group. - /// - /// See the PaymentIntents [use case for connected accounts](https://stripe.com/docs/connect/separate-charges-and-transfers) for details. - #[serde(skip_serializing_if = "Option::is_none")] - pub transfer_group: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreatePaymentLinkPhoneNumberCollection { - /// Set to `true` to enable phone number collection. - pub enabled: bool, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreatePaymentLinkRestrictions { - /// Configuration for the `completed_sessions` restriction type. - pub completed_sessions: CreatePaymentLinkRestrictionsCompletedSessions, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreatePaymentLinkShippingAddressCollection { - /// An array of two-letter ISO country codes representing which countries Checkout should provide as options for - /// shipping locations. - /// - /// Unsupported country codes: `AS, CX, CC, CU, HM, IR, KP, MH, FM, NF, MP, PW, SD, SY, UM, VI`. - pub allowed_countries: Vec, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreatePaymentLinkShippingOptions { - /// The ID of the Shipping Rate to use for this shipping option. - #[serde(skip_serializing_if = "Option::is_none")] - pub shipping_rate: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreatePaymentLinkSubscriptionData { - /// The subscription's description, meant to be displayable to the customer. - /// - /// Use this field to optionally store an explanation of the subscription for rendering in Stripe surfaces and certain local payment methods UIs. - #[serde(skip_serializing_if = "Option::is_none")] - pub description: Option, - - /// All invoices will be billed using the specified settings. - #[serde(skip_serializing_if = "Option::is_none")] - pub invoice_settings: Option, - - /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that will declaratively set metadata on [Subscriptions](https://stripe.com/docs/api/subscriptions) generated from this payment link. - /// - /// Unlike object-level metadata, this field is declarative. - /// Updates will clear prior values. - #[serde(skip_serializing_if = "Option::is_none")] - pub metadata: Option, - - /// Integer representing the number of trial period days before the customer is charged for the first time. - /// - /// Has to be at least 1. - #[serde(skip_serializing_if = "Option::is_none")] - pub trial_period_days: Option, - - /// Settings related to subscription trials. - #[serde(skip_serializing_if = "Option::is_none")] - pub trial_settings: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreatePaymentLinkTaxIdCollection { - /// Set to `true` to enable tax ID collection. - pub enabled: bool, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreatePaymentLinkTransferData { - /// The amount that will be transferred automatically when a charge succeeds. - #[serde(skip_serializing_if = "Option::is_none")] - pub amount: Option, - - /// If specified, successful charges will be attributed to the destination - /// account for tax reporting, and the funds from charges will be transferred - /// to the destination account. - /// - /// The ID of the resulting transfer will be returned on the successful charge's `transfer` field. - pub destination: String, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UpdatePaymentLinkAfterCompletion { - /// Configuration when `type=hosted_confirmation`. - #[serde(skip_serializing_if = "Option::is_none")] - pub hosted_confirmation: Option, - - /// Configuration when `type=redirect`. - #[serde(skip_serializing_if = "Option::is_none")] - pub redirect: Option, - - /// The specified behavior after the purchase is complete. - /// - /// Either `redirect` or `hosted_confirmation`. - #[serde(rename = "type")] - pub type_: UpdatePaymentLinkAfterCompletionType, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UpdatePaymentLinkAutomaticTax { - /// If `true`, tax will be calculated automatically using the customer's location. - pub enabled: bool, - - /// The account that's liable for tax. - /// - /// If set, the business address and tax registrations required to perform the tax calculation are loaded from this account. - /// The tax transaction is returned in the report of the connected account. - #[serde(skip_serializing_if = "Option::is_none")] - pub liability: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UpdatePaymentLinkCustomFields { - /// Configuration for `type=dropdown` fields. - #[serde(skip_serializing_if = "Option::is_none")] - pub dropdown: Option, - - /// String of your choice that your integration can use to reconcile this field. - /// - /// Must be unique to this field, alphanumeric, and up to 200 characters. - pub key: String, - - /// The label for the field, displayed to the customer. - pub label: UpdatePaymentLinkCustomFieldsLabel, - - /// Configuration for `type=numeric` fields. - #[serde(skip_serializing_if = "Option::is_none")] - pub numeric: Option, - - /// Whether the customer is required to complete the field before completing the Checkout Session. - /// - /// Defaults to `false`. - #[serde(skip_serializing_if = "Option::is_none")] - pub optional: Option, - - /// Configuration for `type=text` fields. - #[serde(skip_serializing_if = "Option::is_none")] - pub text: Option, - - /// The type of the field. - #[serde(rename = "type")] - pub type_: UpdatePaymentLinkCustomFieldsType, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UpdatePaymentLinkCustomText { - /// Custom text that should be displayed after the payment confirmation button. - #[serde(skip_serializing_if = "Option::is_none")] - pub after_submit: Option, - - /// Custom text that should be displayed alongside shipping address collection. - #[serde(skip_serializing_if = "Option::is_none")] - pub shipping_address: Option, - - /// Custom text that should be displayed alongside the payment confirmation button. - #[serde(skip_serializing_if = "Option::is_none")] - pub submit: Option, - - /// Custom text that should be displayed in place of the default terms of service agreement text. - #[serde(skip_serializing_if = "Option::is_none")] - pub terms_of_service_acceptance: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UpdatePaymentLinkInvoiceCreation { - /// Whether the feature is enabled. - pub enabled: bool, - - /// Invoice PDF configuration. - #[serde(skip_serializing_if = "Option::is_none")] - pub invoice_data: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UpdatePaymentLinkLineItems { - /// When set, provides configuration for this item’s quantity to be adjusted by the customer during checkout. - #[serde(skip_serializing_if = "Option::is_none")] - pub adjustable_quantity: Option, - - /// The ID of an existing line item on the payment link. - pub id: String, - - /// The quantity of the line item being purchased. - #[serde(skip_serializing_if = "Option::is_none")] - pub quantity: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UpdatePaymentLinkPaymentIntentData { - /// An arbitrary string attached to the object. - /// - /// Often useful for displaying to users. - #[serde(skip_serializing_if = "Option::is_none")] - pub description: Option, - - /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that will declaratively set metadata on [Payment Intents](https://stripe.com/docs/api/payment_intents) generated from this payment link. - /// - /// Unlike object-level metadata, this field is declarative. - /// Updates will clear prior values. - #[serde(skip_serializing_if = "Option::is_none")] - pub metadata: Option, - - /// Extra information about the payment. - /// - /// This will appear on your customer's statement when this payment succeeds in creating a charge. - #[serde(skip_serializing_if = "Option::is_none")] - pub statement_descriptor: Option, - - /// Provides information about the charge that customers see on their statements. - /// - /// Concatenated with the prefix (shortened descriptor) or statement descriptor that's set on the account to form the complete statement descriptor. - /// Maximum 22 characters for the concatenated descriptor. - #[serde(skip_serializing_if = "Option::is_none")] - pub statement_descriptor_suffix: Option, - - /// A string that identifies the resulting payment as part of a group. - /// - /// See the PaymentIntents [use case for connected accounts](https://stripe.com/docs/connect/separate-charges-and-transfers) for details. - #[serde(skip_serializing_if = "Option::is_none")] - pub transfer_group: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UpdatePaymentLinkRestrictions { - /// Configuration for the `completed_sessions` restriction type. - pub completed_sessions: UpdatePaymentLinkRestrictionsCompletedSessions, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UpdatePaymentLinkShippingAddressCollection { - /// An array of two-letter ISO country codes representing which countries Checkout should provide as options for - /// shipping locations. - /// - /// Unsupported country codes: `AS, CX, CC, CU, HM, IR, KP, MH, FM, NF, MP, PW, SD, SY, UM, VI`. - pub allowed_countries: Vec, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UpdatePaymentLinkSubscriptionData { - /// All invoices will be billed using the specified settings. - #[serde(skip_serializing_if = "Option::is_none")] - pub invoice_settings: Option, - - /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that will declaratively set metadata on [Subscriptions](https://stripe.com/docs/api/subscriptions) generated from this payment link. - /// - /// Unlike object-level metadata, this field is declarative. - /// Updates will clear prior values. - #[serde(skip_serializing_if = "Option::is_none")] - pub metadata: Option, - - /// Settings related to subscription trials. - #[serde(skip_serializing_if = "Option::is_none")] - pub trial_settings: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreatePaymentLinkAfterCompletionHostedConfirmation { - /// A custom message to display to the customer after the purchase is complete. - #[serde(skip_serializing_if = "Option::is_none")] - pub custom_message: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreatePaymentLinkAfterCompletionRedirect { - /// The URL the customer will be redirected to after the purchase is complete. - /// - /// You can embed `{CHECKOUT_SESSION_ID}` into the URL to have the `id` of the completed [checkout session](https://stripe.com/docs/api/checkout/sessions/object#checkout_session_object-id) included. - pub url: String, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreatePaymentLinkAutomaticTaxLiability { - /// The connected account being referenced when `type` is `account`. - #[serde(skip_serializing_if = "Option::is_none")] - pub account: Option, - - /// Type of the account referenced in the request. - #[serde(rename = "type")] - pub type_: CreatePaymentLinkAutomaticTaxLiabilityType, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreatePaymentLinkConsentCollectionPaymentMethodReuseAgreement { - /// Determines the position and visibility of the payment method reuse agreement in the UI. - /// - /// When set to `auto`, Stripe's defaults will be used. - /// When set to `hidden`, the payment method reuse agreement text will always be hidden in the UI. - pub position: CreatePaymentLinkConsentCollectionPaymentMethodReuseAgreementPosition, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreatePaymentLinkCustomFieldsDropdown { - /// The options available for the customer to select. - /// - /// Up to 200 options allowed. - pub options: Vec, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreatePaymentLinkCustomFieldsLabel { - /// Custom text for the label, displayed to the customer. - /// - /// Up to 50 characters. - pub custom: String, - - /// The type of the label. - #[serde(rename = "type")] - pub type_: CreatePaymentLinkCustomFieldsLabelType, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreatePaymentLinkCustomFieldsNumeric { - /// The maximum character length constraint for the customer's input. - #[serde(skip_serializing_if = "Option::is_none")] - pub maximum_length: Option, - - /// The minimum character length requirement for the customer's input. - #[serde(skip_serializing_if = "Option::is_none")] - pub minimum_length: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreatePaymentLinkCustomFieldsText { - /// The maximum character length constraint for the customer's input. - #[serde(skip_serializing_if = "Option::is_none")] - pub maximum_length: Option, - - /// The minimum character length requirement for the customer's input. - #[serde(skip_serializing_if = "Option::is_none")] - pub minimum_length: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreatePaymentLinkCustomTextAfterSubmit { - /// Text may be up to 1200 characters in length. - pub message: String, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreatePaymentLinkCustomTextShippingAddress { - /// Text may be up to 1200 characters in length. - pub message: String, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreatePaymentLinkCustomTextSubmit { - /// Text may be up to 1200 characters in length. - pub message: String, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreatePaymentLinkCustomTextTermsOfServiceAcceptance { - /// Text may be up to 1200 characters in length. - pub message: String, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreatePaymentLinkInvoiceCreationInvoiceData { - /// The account tax IDs associated with the invoice. - #[serde(skip_serializing_if = "Option::is_none")] - pub account_tax_ids: Option>, - - /// Default custom fields to be displayed on invoices for this customer. - #[serde(skip_serializing_if = "Option::is_none")] - pub custom_fields: Option>, - - /// An arbitrary string attached to the object. - /// - /// Often useful for displaying to users. - #[serde(skip_serializing_if = "Option::is_none")] - pub description: Option, - - /// Default footer to be displayed on invoices for this customer. - #[serde(skip_serializing_if = "Option::is_none")] - pub footer: Option, - - /// The connected account that issues the invoice. - /// - /// The invoice is presented with the branding and support information of the specified account. - #[serde(skip_serializing_if = "Option::is_none")] - pub issuer: Option, - - /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. - /// - /// This can be useful for storing additional information about the object in a structured format. - /// Individual keys can be unset by posting an empty value to them. - /// All keys can be unset by posting an empty value to `metadata`. - #[serde(skip_serializing_if = "Option::is_none")] - pub metadata: Option, - - /// Default options for invoice PDF rendering for this customer. - #[serde(skip_serializing_if = "Option::is_none")] - pub rendering_options: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreatePaymentLinkLineItemsAdjustableQuantity { - /// Set to true if the quantity can be adjusted to any non-negative Integer. - pub enabled: bool, - - /// The maximum quantity the customer can purchase. - /// - /// By default this value is 99. - /// You can specify a value up to 999. - #[serde(skip_serializing_if = "Option::is_none")] - pub maximum: Option, - - /// The minimum quantity the customer can purchase. - /// - /// By default this value is 0. - /// If there is only one item in the cart then that item's quantity cannot go down to 0. - #[serde(skip_serializing_if = "Option::is_none")] - pub minimum: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreatePaymentLinkRestrictionsCompletedSessions { - /// The maximum number of checkout sessions that can be completed for the `completed_sessions` restriction to be met. - pub limit: i64, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreatePaymentLinkSubscriptionDataInvoiceSettings { - /// The connected account that issues the invoice. - /// - /// The invoice is presented with the branding and support information of the specified account. - #[serde(skip_serializing_if = "Option::is_none")] - pub issuer: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreatePaymentLinkSubscriptionDataTrialSettings { - /// Defines how the subscription should behave when the user's free trial ends. - pub end_behavior: CreatePaymentLinkSubscriptionDataTrialSettingsEndBehavior, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UpdatePaymentLinkAfterCompletionHostedConfirmation { - /// A custom message to display to the customer after the purchase is complete. - #[serde(skip_serializing_if = "Option::is_none")] - pub custom_message: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UpdatePaymentLinkAfterCompletionRedirect { - /// The URL the customer will be redirected to after the purchase is complete. - /// - /// You can embed `{CHECKOUT_SESSION_ID}` into the URL to have the `id` of the completed [checkout session](https://stripe.com/docs/api/checkout/sessions/object#checkout_session_object-id) included. - pub url: String, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UpdatePaymentLinkAutomaticTaxLiability { - /// The connected account being referenced when `type` is `account`. - #[serde(skip_serializing_if = "Option::is_none")] - pub account: Option, - - /// Type of the account referenced in the request. - #[serde(rename = "type")] - pub type_: UpdatePaymentLinkAutomaticTaxLiabilityType, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UpdatePaymentLinkCustomFieldsDropdown { - /// The options available for the customer to select. - /// - /// Up to 200 options allowed. - pub options: Vec, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UpdatePaymentLinkCustomFieldsLabel { - /// Custom text for the label, displayed to the customer. - /// - /// Up to 50 characters. - pub custom: String, - - /// The type of the label. - #[serde(rename = "type")] - pub type_: UpdatePaymentLinkCustomFieldsLabelType, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UpdatePaymentLinkCustomFieldsNumeric { - /// The maximum character length constraint for the customer's input. - #[serde(skip_serializing_if = "Option::is_none")] - pub maximum_length: Option, - - /// The minimum character length requirement for the customer's input. - #[serde(skip_serializing_if = "Option::is_none")] - pub minimum_length: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UpdatePaymentLinkCustomFieldsText { - /// The maximum character length constraint for the customer's input. - #[serde(skip_serializing_if = "Option::is_none")] - pub maximum_length: Option, - - /// The minimum character length requirement for the customer's input. - #[serde(skip_serializing_if = "Option::is_none")] - pub minimum_length: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UpdatePaymentLinkCustomTextAfterSubmit { - /// Text may be up to 1200 characters in length. - pub message: String, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UpdatePaymentLinkCustomTextShippingAddress { - /// Text may be up to 1200 characters in length. - pub message: String, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UpdatePaymentLinkCustomTextSubmit { - /// Text may be up to 1200 characters in length. - pub message: String, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UpdatePaymentLinkCustomTextTermsOfServiceAcceptance { - /// Text may be up to 1200 characters in length. - pub message: String, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UpdatePaymentLinkInvoiceCreationInvoiceData { - /// The account tax IDs associated with the invoice. - #[serde(skip_serializing_if = "Option::is_none")] - pub account_tax_ids: Option>, - - /// Default custom fields to be displayed on invoices for this customer. - #[serde(skip_serializing_if = "Option::is_none")] - pub custom_fields: Option>, - - /// An arbitrary string attached to the object. - /// - /// Often useful for displaying to users. - #[serde(skip_serializing_if = "Option::is_none")] - pub description: Option, - - /// Default footer to be displayed on invoices for this customer. - #[serde(skip_serializing_if = "Option::is_none")] - pub footer: Option, - - /// The connected account that issues the invoice. - /// - /// The invoice is presented with the branding and support information of the specified account. - #[serde(skip_serializing_if = "Option::is_none")] - pub issuer: Option, - - /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. - /// - /// This can be useful for storing additional information about the object in a structured format. - /// Individual keys can be unset by posting an empty value to them. - /// All keys can be unset by posting an empty value to `metadata`. - #[serde(skip_serializing_if = "Option::is_none")] - pub metadata: Option, - - /// Default options for invoice PDF rendering for this customer. - #[serde(skip_serializing_if = "Option::is_none")] - pub rendering_options: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UpdatePaymentLinkLineItemsAdjustableQuantity { - /// Set to true if the quantity can be adjusted to any non-negative Integer. - pub enabled: bool, - - /// The maximum quantity the customer can purchase. - /// - /// By default this value is 99. - /// You can specify a value up to 999. - #[serde(skip_serializing_if = "Option::is_none")] - pub maximum: Option, - - /// The minimum quantity the customer can purchase. - /// - /// By default this value is 0. - /// If there is only one item in the cart then that item's quantity cannot go down to 0. - #[serde(skip_serializing_if = "Option::is_none")] - pub minimum: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UpdatePaymentLinkRestrictionsCompletedSessions { - /// The maximum number of checkout sessions that can be completed for the `completed_sessions` restriction to be met. - pub limit: i64, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UpdatePaymentLinkSubscriptionDataInvoiceSettings { - /// The connected account that issues the invoice. - /// - /// The invoice is presented with the branding and support information of the specified account. - #[serde(skip_serializing_if = "Option::is_none")] - pub issuer: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UpdatePaymentLinkSubscriptionDataTrialSettings { - /// Defines how the subscription should behave when the user's free trial ends. - pub end_behavior: UpdatePaymentLinkSubscriptionDataTrialSettingsEndBehavior, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreatePaymentLinkCustomFieldsDropdownOptions { - /// The label for the option, displayed to the customer. - /// - /// Up to 100 characters. - pub label: String, - - /// The value for this option, not displayed to the customer, used by your integration to reconcile the option selected by the customer. - /// - /// Must be unique to this option, alphanumeric, and up to 100 characters. - pub value: String, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreatePaymentLinkInvoiceCreationInvoiceDataCustomFields { - /// The name of the custom field. - /// - /// This may be up to 30 characters. - pub name: String, - - /// The value of the custom field. - /// - /// This may be up to 30 characters. - pub value: String, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreatePaymentLinkInvoiceCreationInvoiceDataIssuer { - /// The connected account being referenced when `type` is `account`. - #[serde(skip_serializing_if = "Option::is_none")] - pub account: Option, - - /// Type of the account referenced in the request. - #[serde(rename = "type")] - pub type_: CreatePaymentLinkInvoiceCreationInvoiceDataIssuerType, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreatePaymentLinkInvoiceCreationInvoiceDataRenderingOptions { - /// How line-item prices and amounts will be displayed with respect to tax on invoice PDFs. - /// - /// One of `exclude_tax` or `include_inclusive_tax`. - /// `include_inclusive_tax` will include inclusive tax (and exclude exclusive tax) in invoice PDF amounts. - /// `exclude_tax` will exclude all tax (inclusive and exclusive alike) from invoice PDF amounts. - #[serde(skip_serializing_if = "Option::is_none")] - pub amount_tax_display: - Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreatePaymentLinkSubscriptionDataInvoiceSettingsIssuer { - /// The connected account being referenced when `type` is `account`. - #[serde(skip_serializing_if = "Option::is_none")] - pub account: Option, - - /// Type of the account referenced in the request. - #[serde(rename = "type")] - pub type_: CreatePaymentLinkSubscriptionDataInvoiceSettingsIssuerType, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreatePaymentLinkSubscriptionDataTrialSettingsEndBehavior { - /// Indicates how the subscription should change when the trial ends if the user did not provide a payment method. - pub missing_payment_method: - CreatePaymentLinkSubscriptionDataTrialSettingsEndBehaviorMissingPaymentMethod, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UpdatePaymentLinkCustomFieldsDropdownOptions { - /// The label for the option, displayed to the customer. - /// - /// Up to 100 characters. - pub label: String, - - /// The value for this option, not displayed to the customer, used by your integration to reconcile the option selected by the customer. - /// - /// Must be unique to this option, alphanumeric, and up to 100 characters. - pub value: String, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UpdatePaymentLinkInvoiceCreationInvoiceDataCustomFields { - /// The name of the custom field. - /// - /// This may be up to 30 characters. - pub name: String, - - /// The value of the custom field. - /// - /// This may be up to 30 characters. - pub value: String, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UpdatePaymentLinkInvoiceCreationInvoiceDataIssuer { - /// The connected account being referenced when `type` is `account`. - #[serde(skip_serializing_if = "Option::is_none")] - pub account: Option, - - /// Type of the account referenced in the request. - #[serde(rename = "type")] - pub type_: UpdatePaymentLinkInvoiceCreationInvoiceDataIssuerType, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UpdatePaymentLinkInvoiceCreationInvoiceDataRenderingOptions { - /// How line-item prices and amounts will be displayed with respect to tax on invoice PDFs. - /// - /// One of `exclude_tax` or `include_inclusive_tax`. - /// `include_inclusive_tax` will include inclusive tax (and exclude exclusive tax) in invoice PDF amounts. - /// `exclude_tax` will exclude all tax (inclusive and exclusive alike) from invoice PDF amounts. - #[serde(skip_serializing_if = "Option::is_none")] - pub amount_tax_display: - Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UpdatePaymentLinkSubscriptionDataInvoiceSettingsIssuer { - /// The connected account being referenced when `type` is `account`. - #[serde(skip_serializing_if = "Option::is_none")] - pub account: Option, - - /// Type of the account referenced in the request. - #[serde(rename = "type")] - pub type_: UpdatePaymentLinkSubscriptionDataInvoiceSettingsIssuerType, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UpdatePaymentLinkSubscriptionDataTrialSettingsEndBehavior { - /// Indicates how the subscription should change when the trial ends if the user did not provide a payment method. - pub missing_payment_method: - UpdatePaymentLinkSubscriptionDataTrialSettingsEndBehaviorMissingPaymentMethod, -} - -/// An enum representing the possible values of an `CreatePaymentLinkAfterCompletion`'s `type` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CreatePaymentLinkAfterCompletionType { - HostedConfirmation, - Redirect, -} - -impl CreatePaymentLinkAfterCompletionType { - pub fn as_str(self) -> &'static str { - match self { - CreatePaymentLinkAfterCompletionType::HostedConfirmation => "hosted_confirmation", - CreatePaymentLinkAfterCompletionType::Redirect => "redirect", - } - } -} - -impl AsRef for CreatePaymentLinkAfterCompletionType { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for CreatePaymentLinkAfterCompletionType { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for CreatePaymentLinkAfterCompletionType { - fn default() -> Self { - Self::HostedConfirmation - } -} - -/// An enum representing the possible values of an `CreatePaymentLinkAutomaticTaxLiability`'s `type` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CreatePaymentLinkAutomaticTaxLiabilityType { - Account, - #[serde(rename = "self")] - Self_, -} - -impl CreatePaymentLinkAutomaticTaxLiabilityType { - pub fn as_str(self) -> &'static str { - match self { - CreatePaymentLinkAutomaticTaxLiabilityType::Account => "account", - CreatePaymentLinkAutomaticTaxLiabilityType::Self_ => "self", - } - } -} - -impl AsRef for CreatePaymentLinkAutomaticTaxLiabilityType { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for CreatePaymentLinkAutomaticTaxLiabilityType { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for CreatePaymentLinkAutomaticTaxLiabilityType { - fn default() -> Self { - Self::Account - } -} - -/// An enum representing the possible values of an `CreatePaymentLinkConsentCollectionPaymentMethodReuseAgreement`'s `position` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CreatePaymentLinkConsentCollectionPaymentMethodReuseAgreementPosition { - Auto, - Hidden, -} - -impl CreatePaymentLinkConsentCollectionPaymentMethodReuseAgreementPosition { - pub fn as_str(self) -> &'static str { - match self { - CreatePaymentLinkConsentCollectionPaymentMethodReuseAgreementPosition::Auto => "auto", - CreatePaymentLinkConsentCollectionPaymentMethodReuseAgreementPosition::Hidden => { - "hidden" - } - } - } -} - -impl AsRef for CreatePaymentLinkConsentCollectionPaymentMethodReuseAgreementPosition { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for CreatePaymentLinkConsentCollectionPaymentMethodReuseAgreementPosition { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default - for CreatePaymentLinkConsentCollectionPaymentMethodReuseAgreementPosition -{ - fn default() -> Self { - Self::Auto - } -} - -/// An enum representing the possible values of an `CreatePaymentLinkConsentCollection`'s `promotions` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CreatePaymentLinkConsentCollectionPromotions { - Auto, - None, -} - -impl CreatePaymentLinkConsentCollectionPromotions { - pub fn as_str(self) -> &'static str { - match self { - CreatePaymentLinkConsentCollectionPromotions::Auto => "auto", - CreatePaymentLinkConsentCollectionPromotions::None => "none", - } - } -} - -impl AsRef for CreatePaymentLinkConsentCollectionPromotions { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for CreatePaymentLinkConsentCollectionPromotions { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for CreatePaymentLinkConsentCollectionPromotions { - fn default() -> Self { - Self::Auto - } -} - -/// An enum representing the possible values of an `CreatePaymentLinkConsentCollection`'s `terms_of_service` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CreatePaymentLinkConsentCollectionTermsOfService { - None, - Required, -} - -impl CreatePaymentLinkConsentCollectionTermsOfService { - pub fn as_str(self) -> &'static str { - match self { - CreatePaymentLinkConsentCollectionTermsOfService::None => "none", - CreatePaymentLinkConsentCollectionTermsOfService::Required => "required", - } - } -} - -impl AsRef for CreatePaymentLinkConsentCollectionTermsOfService { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for CreatePaymentLinkConsentCollectionTermsOfService { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for CreatePaymentLinkConsentCollectionTermsOfService { - fn default() -> Self { - Self::None - } -} - -/// An enum representing the possible values of an `CreatePaymentLinkCustomFieldsLabel`'s `type` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CreatePaymentLinkCustomFieldsLabelType { - Custom, -} - -impl CreatePaymentLinkCustomFieldsLabelType { - pub fn as_str(self) -> &'static str { - match self { - CreatePaymentLinkCustomFieldsLabelType::Custom => "custom", - } - } -} - -impl AsRef for CreatePaymentLinkCustomFieldsLabelType { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for CreatePaymentLinkCustomFieldsLabelType { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for CreatePaymentLinkCustomFieldsLabelType { - fn default() -> Self { - Self::Custom - } -} - -/// An enum representing the possible values of an `CreatePaymentLinkCustomFields`'s `type` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CreatePaymentLinkCustomFieldsType { - Dropdown, - Numeric, - Text, -} - -impl CreatePaymentLinkCustomFieldsType { - pub fn as_str(self) -> &'static str { - match self { - CreatePaymentLinkCustomFieldsType::Dropdown => "dropdown", - CreatePaymentLinkCustomFieldsType::Numeric => "numeric", - CreatePaymentLinkCustomFieldsType::Text => "text", - } - } -} - -impl AsRef for CreatePaymentLinkCustomFieldsType { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for CreatePaymentLinkCustomFieldsType { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for CreatePaymentLinkCustomFieldsType { - fn default() -> Self { - Self::Dropdown - } -} - -/// An enum representing the possible values of an `CreatePaymentLinkInvoiceCreationInvoiceDataIssuer`'s `type` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CreatePaymentLinkInvoiceCreationInvoiceDataIssuerType { - Account, - #[serde(rename = "self")] - Self_, -} - -impl CreatePaymentLinkInvoiceCreationInvoiceDataIssuerType { - pub fn as_str(self) -> &'static str { - match self { - CreatePaymentLinkInvoiceCreationInvoiceDataIssuerType::Account => "account", - CreatePaymentLinkInvoiceCreationInvoiceDataIssuerType::Self_ => "self", - } - } -} - -impl AsRef for CreatePaymentLinkInvoiceCreationInvoiceDataIssuerType { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for CreatePaymentLinkInvoiceCreationInvoiceDataIssuerType { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for CreatePaymentLinkInvoiceCreationInvoiceDataIssuerType { - fn default() -> Self { - Self::Account - } -} - -/// An enum representing the possible values of an `CreatePaymentLinkInvoiceCreationInvoiceDataRenderingOptions`'s `amount_tax_display` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CreatePaymentLinkInvoiceCreationInvoiceDataRenderingOptionsAmountTaxDisplay { - ExcludeTax, - IncludeInclusiveTax, -} - -impl CreatePaymentLinkInvoiceCreationInvoiceDataRenderingOptionsAmountTaxDisplay { - pub fn as_str(self) -> &'static str { - match self { - CreatePaymentLinkInvoiceCreationInvoiceDataRenderingOptionsAmountTaxDisplay::ExcludeTax => "exclude_tax", - CreatePaymentLinkInvoiceCreationInvoiceDataRenderingOptionsAmountTaxDisplay::IncludeInclusiveTax => "include_inclusive_tax", - } - } -} - -impl AsRef for CreatePaymentLinkInvoiceCreationInvoiceDataRenderingOptionsAmountTaxDisplay { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display - for CreatePaymentLinkInvoiceCreationInvoiceDataRenderingOptionsAmountTaxDisplay -{ - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default - for CreatePaymentLinkInvoiceCreationInvoiceDataRenderingOptionsAmountTaxDisplay -{ - fn default() -> Self { - Self::ExcludeTax - } -} - -/// An enum representing the possible values of an `CreatePaymentLinkPaymentIntentData`'s `capture_method` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CreatePaymentLinkPaymentIntentDataCaptureMethod { - Automatic, - AutomaticAsync, - Manual, -} - -impl CreatePaymentLinkPaymentIntentDataCaptureMethod { - pub fn as_str(self) -> &'static str { - match self { - CreatePaymentLinkPaymentIntentDataCaptureMethod::Automatic => "automatic", - CreatePaymentLinkPaymentIntentDataCaptureMethod::AutomaticAsync => "automatic_async", - CreatePaymentLinkPaymentIntentDataCaptureMethod::Manual => "manual", - } - } -} - -impl AsRef for CreatePaymentLinkPaymentIntentDataCaptureMethod { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for CreatePaymentLinkPaymentIntentDataCaptureMethod { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for CreatePaymentLinkPaymentIntentDataCaptureMethod { - fn default() -> Self { - Self::Automatic - } -} - -/// An enum representing the possible values of an `CreatePaymentLinkPaymentIntentData`'s `setup_future_usage` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CreatePaymentLinkPaymentIntentDataSetupFutureUsage { - OffSession, - OnSession, -} - -impl CreatePaymentLinkPaymentIntentDataSetupFutureUsage { - pub fn as_str(self) -> &'static str { - match self { - CreatePaymentLinkPaymentIntentDataSetupFutureUsage::OffSession => "off_session", - CreatePaymentLinkPaymentIntentDataSetupFutureUsage::OnSession => "on_session", - } - } -} - -impl AsRef for CreatePaymentLinkPaymentIntentDataSetupFutureUsage { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for CreatePaymentLinkPaymentIntentDataSetupFutureUsage { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for CreatePaymentLinkPaymentIntentDataSetupFutureUsage { - fn default() -> Self { - Self::OffSession - } -} - -/// An enum representing the possible values of an `CreatePaymentLink`'s `payment_method_types` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CreatePaymentLinkPaymentMethodTypes { - Affirm, - AfterpayClearpay, - Alipay, - AuBecsDebit, - BacsDebit, - Bancontact, - Blik, - Boleto, - Card, - Cashapp, - Eps, - Fpx, - Giropay, - Grabpay, - Ideal, - Klarna, - Konbini, - Link, - Oxxo, - P24, - Paynow, - Paypal, - Pix, - Promptpay, - SepaDebit, - Sofort, - Swish, - UsBankAccount, - WechatPay, -} - -impl CreatePaymentLinkPaymentMethodTypes { - pub fn as_str(self) -> &'static str { - match self { - CreatePaymentLinkPaymentMethodTypes::Affirm => "affirm", - CreatePaymentLinkPaymentMethodTypes::AfterpayClearpay => "afterpay_clearpay", - CreatePaymentLinkPaymentMethodTypes::Alipay => "alipay", - CreatePaymentLinkPaymentMethodTypes::AuBecsDebit => "au_becs_debit", - CreatePaymentLinkPaymentMethodTypes::BacsDebit => "bacs_debit", - CreatePaymentLinkPaymentMethodTypes::Bancontact => "bancontact", - CreatePaymentLinkPaymentMethodTypes::Blik => "blik", - CreatePaymentLinkPaymentMethodTypes::Boleto => "boleto", - CreatePaymentLinkPaymentMethodTypes::Card => "card", - CreatePaymentLinkPaymentMethodTypes::Cashapp => "cashapp", - CreatePaymentLinkPaymentMethodTypes::Eps => "eps", - CreatePaymentLinkPaymentMethodTypes::Fpx => "fpx", - CreatePaymentLinkPaymentMethodTypes::Giropay => "giropay", - CreatePaymentLinkPaymentMethodTypes::Grabpay => "grabpay", - CreatePaymentLinkPaymentMethodTypes::Ideal => "ideal", - CreatePaymentLinkPaymentMethodTypes::Klarna => "klarna", - CreatePaymentLinkPaymentMethodTypes::Konbini => "konbini", - CreatePaymentLinkPaymentMethodTypes::Link => "link", - CreatePaymentLinkPaymentMethodTypes::Oxxo => "oxxo", - CreatePaymentLinkPaymentMethodTypes::P24 => "p24", - CreatePaymentLinkPaymentMethodTypes::Paynow => "paynow", - CreatePaymentLinkPaymentMethodTypes::Paypal => "paypal", - CreatePaymentLinkPaymentMethodTypes::Pix => "pix", - CreatePaymentLinkPaymentMethodTypes::Promptpay => "promptpay", - CreatePaymentLinkPaymentMethodTypes::SepaDebit => "sepa_debit", - CreatePaymentLinkPaymentMethodTypes::Sofort => "sofort", - CreatePaymentLinkPaymentMethodTypes::Swish => "swish", - CreatePaymentLinkPaymentMethodTypes::UsBankAccount => "us_bank_account", - CreatePaymentLinkPaymentMethodTypes::WechatPay => "wechat_pay", - } - } -} - -impl AsRef for CreatePaymentLinkPaymentMethodTypes { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for CreatePaymentLinkPaymentMethodTypes { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for CreatePaymentLinkPaymentMethodTypes { - fn default() -> Self { - Self::Affirm - } -} - -/// An enum representing the possible values of an `CreatePaymentLinkShippingAddressCollection`'s `allowed_countries` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CreatePaymentLinkShippingAddressCollectionAllowedCountries { - #[serde(rename = "AC")] - Ac, - #[serde(rename = "AD")] - Ad, - #[serde(rename = "AE")] - Ae, - #[serde(rename = "AF")] - Af, - #[serde(rename = "AG")] - Ag, - #[serde(rename = "AI")] - Ai, - #[serde(rename = "AL")] - Al, - #[serde(rename = "AM")] - Am, - #[serde(rename = "AO")] - Ao, - #[serde(rename = "AQ")] - Aq, - #[serde(rename = "AR")] - Ar, - #[serde(rename = "AT")] - At, - #[serde(rename = "AU")] - Au, - #[serde(rename = "AW")] - Aw, - #[serde(rename = "AX")] - Ax, - #[serde(rename = "AZ")] - Az, - #[serde(rename = "BA")] - Ba, - #[serde(rename = "BB")] - Bb, - #[serde(rename = "BD")] - Bd, - #[serde(rename = "BE")] - Be, - #[serde(rename = "BF")] - Bf, - #[serde(rename = "BG")] - Bg, - #[serde(rename = "BH")] - Bh, - #[serde(rename = "BI")] - Bi, - #[serde(rename = "BJ")] - Bj, - #[serde(rename = "BL")] - Bl, - #[serde(rename = "BM")] - Bm, - #[serde(rename = "BN")] - Bn, - #[serde(rename = "BO")] - Bo, - #[serde(rename = "BQ")] - Bq, - #[serde(rename = "BR")] - Br, - #[serde(rename = "BS")] - Bs, - #[serde(rename = "BT")] - Bt, - #[serde(rename = "BV")] - Bv, - #[serde(rename = "BW")] - Bw, - #[serde(rename = "BY")] - By, - #[serde(rename = "BZ")] - Bz, - #[serde(rename = "CA")] - Ca, - #[serde(rename = "CD")] - Cd, - #[serde(rename = "CF")] - Cf, - #[serde(rename = "CG")] - Cg, - #[serde(rename = "CH")] - Ch, - #[serde(rename = "CI")] - Ci, - #[serde(rename = "CK")] - Ck, - #[serde(rename = "CL")] - Cl, - #[serde(rename = "CM")] - Cm, - #[serde(rename = "CN")] - Cn, - #[serde(rename = "CO")] - Co, - #[serde(rename = "CR")] - Cr, - #[serde(rename = "CV")] - Cv, - #[serde(rename = "CW")] - Cw, - #[serde(rename = "CY")] - Cy, - #[serde(rename = "CZ")] - Cz, - #[serde(rename = "DE")] - De, - #[serde(rename = "DJ")] - Dj, - #[serde(rename = "DK")] - Dk, - #[serde(rename = "DM")] - Dm, - #[serde(rename = "DO")] - Do, - #[serde(rename = "DZ")] - Dz, - #[serde(rename = "EC")] - Ec, - #[serde(rename = "EE")] - Ee, - #[serde(rename = "EG")] - Eg, - #[serde(rename = "EH")] - Eh, - #[serde(rename = "ER")] - Er, - #[serde(rename = "ES")] - Es, - #[serde(rename = "ET")] - Et, - #[serde(rename = "FI")] - Fi, - #[serde(rename = "FJ")] - Fj, - #[serde(rename = "FK")] - Fk, - #[serde(rename = "FO")] - Fo, - #[serde(rename = "FR")] - Fr, - #[serde(rename = "GA")] - Ga, - #[serde(rename = "GB")] - Gb, - #[serde(rename = "GD")] - Gd, - #[serde(rename = "GE")] - Ge, - #[serde(rename = "GF")] - Gf, - #[serde(rename = "GG")] - Gg, - #[serde(rename = "GH")] - Gh, - #[serde(rename = "GI")] - Gi, - #[serde(rename = "GL")] - Gl, - #[serde(rename = "GM")] - Gm, - #[serde(rename = "GN")] - Gn, - #[serde(rename = "GP")] - Gp, - #[serde(rename = "GQ")] - Gq, - #[serde(rename = "GR")] - Gr, - #[serde(rename = "GS")] - Gs, - #[serde(rename = "GT")] - Gt, - #[serde(rename = "GU")] - Gu, - #[serde(rename = "GW")] - Gw, - #[serde(rename = "GY")] - Gy, - #[serde(rename = "HK")] - Hk, - #[serde(rename = "HN")] - Hn, - #[serde(rename = "HR")] - Hr, - #[serde(rename = "HT")] - Ht, - #[serde(rename = "HU")] - Hu, - #[serde(rename = "ID")] - Id, - #[serde(rename = "IE")] - Ie, - #[serde(rename = "IL")] - Il, - #[serde(rename = "IM")] - Im, - #[serde(rename = "IN")] - In, - #[serde(rename = "IO")] - Io, - #[serde(rename = "IQ")] - Iq, - #[serde(rename = "IS")] - Is, - #[serde(rename = "IT")] - It, - #[serde(rename = "JE")] - Je, - #[serde(rename = "JM")] - Jm, - #[serde(rename = "JO")] - Jo, - #[serde(rename = "JP")] - Jp, - #[serde(rename = "KE")] - Ke, - #[serde(rename = "KG")] - Kg, - #[serde(rename = "KH")] - Kh, - #[serde(rename = "KI")] - Ki, - #[serde(rename = "KM")] - Km, - #[serde(rename = "KN")] - Kn, - #[serde(rename = "KR")] - Kr, - #[serde(rename = "KW")] - Kw, - #[serde(rename = "KY")] - Ky, - #[serde(rename = "KZ")] - Kz, - #[serde(rename = "LA")] - La, - #[serde(rename = "LB")] - Lb, - #[serde(rename = "LC")] - Lc, - #[serde(rename = "LI")] - Li, - #[serde(rename = "LK")] - Lk, - #[serde(rename = "LR")] - Lr, - #[serde(rename = "LS")] - Ls, - #[serde(rename = "LT")] - Lt, - #[serde(rename = "LU")] - Lu, - #[serde(rename = "LV")] - Lv, - #[serde(rename = "LY")] - Ly, - #[serde(rename = "MA")] - Ma, - #[serde(rename = "MC")] - Mc, - #[serde(rename = "MD")] - Md, - #[serde(rename = "ME")] - Me, - #[serde(rename = "MF")] - Mf, - #[serde(rename = "MG")] - Mg, - #[serde(rename = "MK")] - Mk, - #[serde(rename = "ML")] - Ml, - #[serde(rename = "MM")] - Mm, - #[serde(rename = "MN")] - Mn, - #[serde(rename = "MO")] - Mo, - #[serde(rename = "MQ")] - Mq, - #[serde(rename = "MR")] - Mr, - #[serde(rename = "MS")] - Ms, - #[serde(rename = "MT")] - Mt, - #[serde(rename = "MU")] - Mu, - #[serde(rename = "MV")] - Mv, - #[serde(rename = "MW")] - Mw, - #[serde(rename = "MX")] - Mx, - #[serde(rename = "MY")] - My, - #[serde(rename = "MZ")] - Mz, - #[serde(rename = "NA")] - Na, - #[serde(rename = "NC")] - Nc, - #[serde(rename = "NE")] - Ne, - #[serde(rename = "NG")] - Ng, - #[serde(rename = "NI")] - Ni, - #[serde(rename = "NL")] - Nl, - #[serde(rename = "NO")] - No, - #[serde(rename = "NP")] - Np, - #[serde(rename = "NR")] - Nr, - #[serde(rename = "NU")] - Nu, - #[serde(rename = "NZ")] - Nz, - #[serde(rename = "OM")] - Om, - #[serde(rename = "PA")] - Pa, - #[serde(rename = "PE")] - Pe, - #[serde(rename = "PF")] - Pf, - #[serde(rename = "PG")] - Pg, - #[serde(rename = "PH")] - Ph, - #[serde(rename = "PK")] - Pk, - #[serde(rename = "PL")] - Pl, - #[serde(rename = "PM")] - Pm, - #[serde(rename = "PN")] - Pn, - #[serde(rename = "PR")] - Pr, - #[serde(rename = "PS")] - Ps, - #[serde(rename = "PT")] - Pt, - #[serde(rename = "PY")] - Py, - #[serde(rename = "QA")] - Qa, - #[serde(rename = "RE")] - Re, - #[serde(rename = "RO")] - Ro, - #[serde(rename = "RS")] - Rs, - #[serde(rename = "RU")] - Ru, - #[serde(rename = "RW")] - Rw, - #[serde(rename = "SA")] - Sa, - #[serde(rename = "SB")] - Sb, - #[serde(rename = "SC")] - Sc, - #[serde(rename = "SE")] - Se, - #[serde(rename = "SG")] - Sg, - #[serde(rename = "SH")] - Sh, - #[serde(rename = "SI")] - Si, - #[serde(rename = "SJ")] - Sj, - #[serde(rename = "SK")] - Sk, - #[serde(rename = "SL")] - Sl, - #[serde(rename = "SM")] - Sm, - #[serde(rename = "SN")] - Sn, - #[serde(rename = "SO")] - So, - #[serde(rename = "SR")] - Sr, - #[serde(rename = "SS")] - Ss, - #[serde(rename = "ST")] - St, - #[serde(rename = "SV")] - Sv, - #[serde(rename = "SX")] - Sx, - #[serde(rename = "SZ")] - Sz, - #[serde(rename = "TA")] - Ta, - #[serde(rename = "TC")] - Tc, - #[serde(rename = "TD")] - Td, - #[serde(rename = "TF")] - Tf, - #[serde(rename = "TG")] - Tg, - #[serde(rename = "TH")] - Th, - #[serde(rename = "TJ")] - Tj, - #[serde(rename = "TK")] - Tk, - #[serde(rename = "TL")] - Tl, - #[serde(rename = "TM")] - Tm, - #[serde(rename = "TN")] - Tn, - #[serde(rename = "TO")] - To, - #[serde(rename = "TR")] - Tr, - #[serde(rename = "TT")] - Tt, - #[serde(rename = "TV")] - Tv, - #[serde(rename = "TW")] - Tw, - #[serde(rename = "TZ")] - Tz, - #[serde(rename = "UA")] - Ua, - #[serde(rename = "UG")] - Ug, - #[serde(rename = "US")] - Us, - #[serde(rename = "UY")] - Uy, - #[serde(rename = "UZ")] - Uz, - #[serde(rename = "VA")] - Va, - #[serde(rename = "VC")] - Vc, - #[serde(rename = "VE")] - Ve, - #[serde(rename = "VG")] - Vg, - #[serde(rename = "VN")] - Vn, - #[serde(rename = "VU")] - Vu, - #[serde(rename = "WF")] - Wf, - #[serde(rename = "WS")] - Ws, - #[serde(rename = "XK")] - Xk, - #[serde(rename = "YE")] - Ye, - #[serde(rename = "YT")] - Yt, - #[serde(rename = "ZA")] - Za, - #[serde(rename = "ZM")] - Zm, - #[serde(rename = "ZW")] - Zw, - #[serde(rename = "ZZ")] - Zz, -} - -impl CreatePaymentLinkShippingAddressCollectionAllowedCountries { - pub fn as_str(self) -> &'static str { - match self { - CreatePaymentLinkShippingAddressCollectionAllowedCountries::Ac => "AC", - CreatePaymentLinkShippingAddressCollectionAllowedCountries::Ad => "AD", - CreatePaymentLinkShippingAddressCollectionAllowedCountries::Ae => "AE", - CreatePaymentLinkShippingAddressCollectionAllowedCountries::Af => "AF", - CreatePaymentLinkShippingAddressCollectionAllowedCountries::Ag => "AG", - CreatePaymentLinkShippingAddressCollectionAllowedCountries::Ai => "AI", - CreatePaymentLinkShippingAddressCollectionAllowedCountries::Al => "AL", - CreatePaymentLinkShippingAddressCollectionAllowedCountries::Am => "AM", - CreatePaymentLinkShippingAddressCollectionAllowedCountries::Ao => "AO", - CreatePaymentLinkShippingAddressCollectionAllowedCountries::Aq => "AQ", - CreatePaymentLinkShippingAddressCollectionAllowedCountries::Ar => "AR", - CreatePaymentLinkShippingAddressCollectionAllowedCountries::At => "AT", - CreatePaymentLinkShippingAddressCollectionAllowedCountries::Au => "AU", - CreatePaymentLinkShippingAddressCollectionAllowedCountries::Aw => "AW", - CreatePaymentLinkShippingAddressCollectionAllowedCountries::Ax => "AX", - CreatePaymentLinkShippingAddressCollectionAllowedCountries::Az => "AZ", - CreatePaymentLinkShippingAddressCollectionAllowedCountries::Ba => "BA", - CreatePaymentLinkShippingAddressCollectionAllowedCountries::Bb => "BB", - CreatePaymentLinkShippingAddressCollectionAllowedCountries::Bd => "BD", - CreatePaymentLinkShippingAddressCollectionAllowedCountries::Be => "BE", - CreatePaymentLinkShippingAddressCollectionAllowedCountries::Bf => "BF", - CreatePaymentLinkShippingAddressCollectionAllowedCountries::Bg => "BG", - CreatePaymentLinkShippingAddressCollectionAllowedCountries::Bh => "BH", - CreatePaymentLinkShippingAddressCollectionAllowedCountries::Bi => "BI", - CreatePaymentLinkShippingAddressCollectionAllowedCountries::Bj => "BJ", - CreatePaymentLinkShippingAddressCollectionAllowedCountries::Bl => "BL", - CreatePaymentLinkShippingAddressCollectionAllowedCountries::Bm => "BM", - CreatePaymentLinkShippingAddressCollectionAllowedCountries::Bn => "BN", - CreatePaymentLinkShippingAddressCollectionAllowedCountries::Bo => "BO", - CreatePaymentLinkShippingAddressCollectionAllowedCountries::Bq => "BQ", - CreatePaymentLinkShippingAddressCollectionAllowedCountries::Br => "BR", - CreatePaymentLinkShippingAddressCollectionAllowedCountries::Bs => "BS", - CreatePaymentLinkShippingAddressCollectionAllowedCountries::Bt => "BT", - CreatePaymentLinkShippingAddressCollectionAllowedCountries::Bv => "BV", - CreatePaymentLinkShippingAddressCollectionAllowedCountries::Bw => "BW", - CreatePaymentLinkShippingAddressCollectionAllowedCountries::By => "BY", - CreatePaymentLinkShippingAddressCollectionAllowedCountries::Bz => "BZ", - CreatePaymentLinkShippingAddressCollectionAllowedCountries::Ca => "CA", - CreatePaymentLinkShippingAddressCollectionAllowedCountries::Cd => "CD", - CreatePaymentLinkShippingAddressCollectionAllowedCountries::Cf => "CF", - CreatePaymentLinkShippingAddressCollectionAllowedCountries::Cg => "CG", - CreatePaymentLinkShippingAddressCollectionAllowedCountries::Ch => "CH", - CreatePaymentLinkShippingAddressCollectionAllowedCountries::Ci => "CI", - CreatePaymentLinkShippingAddressCollectionAllowedCountries::Ck => "CK", - CreatePaymentLinkShippingAddressCollectionAllowedCountries::Cl => "CL", - CreatePaymentLinkShippingAddressCollectionAllowedCountries::Cm => "CM", - CreatePaymentLinkShippingAddressCollectionAllowedCountries::Cn => "CN", - CreatePaymentLinkShippingAddressCollectionAllowedCountries::Co => "CO", - CreatePaymentLinkShippingAddressCollectionAllowedCountries::Cr => "CR", - CreatePaymentLinkShippingAddressCollectionAllowedCountries::Cv => "CV", - CreatePaymentLinkShippingAddressCollectionAllowedCountries::Cw => "CW", - CreatePaymentLinkShippingAddressCollectionAllowedCountries::Cy => "CY", - CreatePaymentLinkShippingAddressCollectionAllowedCountries::Cz => "CZ", - CreatePaymentLinkShippingAddressCollectionAllowedCountries::De => "DE", - CreatePaymentLinkShippingAddressCollectionAllowedCountries::Dj => "DJ", - CreatePaymentLinkShippingAddressCollectionAllowedCountries::Dk => "DK", - CreatePaymentLinkShippingAddressCollectionAllowedCountries::Dm => "DM", - CreatePaymentLinkShippingAddressCollectionAllowedCountries::Do => "DO", - CreatePaymentLinkShippingAddressCollectionAllowedCountries::Dz => "DZ", - CreatePaymentLinkShippingAddressCollectionAllowedCountries::Ec => "EC", - CreatePaymentLinkShippingAddressCollectionAllowedCountries::Ee => "EE", - CreatePaymentLinkShippingAddressCollectionAllowedCountries::Eg => "EG", - CreatePaymentLinkShippingAddressCollectionAllowedCountries::Eh => "EH", - CreatePaymentLinkShippingAddressCollectionAllowedCountries::Er => "ER", - CreatePaymentLinkShippingAddressCollectionAllowedCountries::Es => "ES", - CreatePaymentLinkShippingAddressCollectionAllowedCountries::Et => "ET", - CreatePaymentLinkShippingAddressCollectionAllowedCountries::Fi => "FI", - CreatePaymentLinkShippingAddressCollectionAllowedCountries::Fj => "FJ", - CreatePaymentLinkShippingAddressCollectionAllowedCountries::Fk => "FK", - CreatePaymentLinkShippingAddressCollectionAllowedCountries::Fo => "FO", - CreatePaymentLinkShippingAddressCollectionAllowedCountries::Fr => "FR", - CreatePaymentLinkShippingAddressCollectionAllowedCountries::Ga => "GA", - CreatePaymentLinkShippingAddressCollectionAllowedCountries::Gb => "GB", - CreatePaymentLinkShippingAddressCollectionAllowedCountries::Gd => "GD", - CreatePaymentLinkShippingAddressCollectionAllowedCountries::Ge => "GE", - CreatePaymentLinkShippingAddressCollectionAllowedCountries::Gf => "GF", - CreatePaymentLinkShippingAddressCollectionAllowedCountries::Gg => "GG", - CreatePaymentLinkShippingAddressCollectionAllowedCountries::Gh => "GH", - CreatePaymentLinkShippingAddressCollectionAllowedCountries::Gi => "GI", - CreatePaymentLinkShippingAddressCollectionAllowedCountries::Gl => "GL", - CreatePaymentLinkShippingAddressCollectionAllowedCountries::Gm => "GM", - CreatePaymentLinkShippingAddressCollectionAllowedCountries::Gn => "GN", - CreatePaymentLinkShippingAddressCollectionAllowedCountries::Gp => "GP", - CreatePaymentLinkShippingAddressCollectionAllowedCountries::Gq => "GQ", - CreatePaymentLinkShippingAddressCollectionAllowedCountries::Gr => "GR", - CreatePaymentLinkShippingAddressCollectionAllowedCountries::Gs => "GS", - CreatePaymentLinkShippingAddressCollectionAllowedCountries::Gt => "GT", - CreatePaymentLinkShippingAddressCollectionAllowedCountries::Gu => "GU", - CreatePaymentLinkShippingAddressCollectionAllowedCountries::Gw => "GW", - CreatePaymentLinkShippingAddressCollectionAllowedCountries::Gy => "GY", - CreatePaymentLinkShippingAddressCollectionAllowedCountries::Hk => "HK", - CreatePaymentLinkShippingAddressCollectionAllowedCountries::Hn => "HN", - CreatePaymentLinkShippingAddressCollectionAllowedCountries::Hr => "HR", - CreatePaymentLinkShippingAddressCollectionAllowedCountries::Ht => "HT", - CreatePaymentLinkShippingAddressCollectionAllowedCountries::Hu => "HU", - CreatePaymentLinkShippingAddressCollectionAllowedCountries::Id => "ID", - CreatePaymentLinkShippingAddressCollectionAllowedCountries::Ie => "IE", - CreatePaymentLinkShippingAddressCollectionAllowedCountries::Il => "IL", - CreatePaymentLinkShippingAddressCollectionAllowedCountries::Im => "IM", - CreatePaymentLinkShippingAddressCollectionAllowedCountries::In => "IN", - CreatePaymentLinkShippingAddressCollectionAllowedCountries::Io => "IO", - CreatePaymentLinkShippingAddressCollectionAllowedCountries::Iq => "IQ", - CreatePaymentLinkShippingAddressCollectionAllowedCountries::Is => "IS", - CreatePaymentLinkShippingAddressCollectionAllowedCountries::It => "IT", - CreatePaymentLinkShippingAddressCollectionAllowedCountries::Je => "JE", - CreatePaymentLinkShippingAddressCollectionAllowedCountries::Jm => "JM", - CreatePaymentLinkShippingAddressCollectionAllowedCountries::Jo => "JO", - CreatePaymentLinkShippingAddressCollectionAllowedCountries::Jp => "JP", - CreatePaymentLinkShippingAddressCollectionAllowedCountries::Ke => "KE", - CreatePaymentLinkShippingAddressCollectionAllowedCountries::Kg => "KG", - CreatePaymentLinkShippingAddressCollectionAllowedCountries::Kh => "KH", - CreatePaymentLinkShippingAddressCollectionAllowedCountries::Ki => "KI", - CreatePaymentLinkShippingAddressCollectionAllowedCountries::Km => "KM", - CreatePaymentLinkShippingAddressCollectionAllowedCountries::Kn => "KN", - CreatePaymentLinkShippingAddressCollectionAllowedCountries::Kr => "KR", - CreatePaymentLinkShippingAddressCollectionAllowedCountries::Kw => "KW", - CreatePaymentLinkShippingAddressCollectionAllowedCountries::Ky => "KY", - CreatePaymentLinkShippingAddressCollectionAllowedCountries::Kz => "KZ", - CreatePaymentLinkShippingAddressCollectionAllowedCountries::La => "LA", - CreatePaymentLinkShippingAddressCollectionAllowedCountries::Lb => "LB", - CreatePaymentLinkShippingAddressCollectionAllowedCountries::Lc => "LC", - CreatePaymentLinkShippingAddressCollectionAllowedCountries::Li => "LI", - CreatePaymentLinkShippingAddressCollectionAllowedCountries::Lk => "LK", - CreatePaymentLinkShippingAddressCollectionAllowedCountries::Lr => "LR", - CreatePaymentLinkShippingAddressCollectionAllowedCountries::Ls => "LS", - CreatePaymentLinkShippingAddressCollectionAllowedCountries::Lt => "LT", - CreatePaymentLinkShippingAddressCollectionAllowedCountries::Lu => "LU", - CreatePaymentLinkShippingAddressCollectionAllowedCountries::Lv => "LV", - CreatePaymentLinkShippingAddressCollectionAllowedCountries::Ly => "LY", - CreatePaymentLinkShippingAddressCollectionAllowedCountries::Ma => "MA", - CreatePaymentLinkShippingAddressCollectionAllowedCountries::Mc => "MC", - CreatePaymentLinkShippingAddressCollectionAllowedCountries::Md => "MD", - CreatePaymentLinkShippingAddressCollectionAllowedCountries::Me => "ME", - CreatePaymentLinkShippingAddressCollectionAllowedCountries::Mf => "MF", - CreatePaymentLinkShippingAddressCollectionAllowedCountries::Mg => "MG", - CreatePaymentLinkShippingAddressCollectionAllowedCountries::Mk => "MK", - CreatePaymentLinkShippingAddressCollectionAllowedCountries::Ml => "ML", - CreatePaymentLinkShippingAddressCollectionAllowedCountries::Mm => "MM", - CreatePaymentLinkShippingAddressCollectionAllowedCountries::Mn => "MN", - CreatePaymentLinkShippingAddressCollectionAllowedCountries::Mo => "MO", - CreatePaymentLinkShippingAddressCollectionAllowedCountries::Mq => "MQ", - CreatePaymentLinkShippingAddressCollectionAllowedCountries::Mr => "MR", - CreatePaymentLinkShippingAddressCollectionAllowedCountries::Ms => "MS", - CreatePaymentLinkShippingAddressCollectionAllowedCountries::Mt => "MT", - CreatePaymentLinkShippingAddressCollectionAllowedCountries::Mu => "MU", - CreatePaymentLinkShippingAddressCollectionAllowedCountries::Mv => "MV", - CreatePaymentLinkShippingAddressCollectionAllowedCountries::Mw => "MW", - CreatePaymentLinkShippingAddressCollectionAllowedCountries::Mx => "MX", - CreatePaymentLinkShippingAddressCollectionAllowedCountries::My => "MY", - CreatePaymentLinkShippingAddressCollectionAllowedCountries::Mz => "MZ", - CreatePaymentLinkShippingAddressCollectionAllowedCountries::Na => "NA", - CreatePaymentLinkShippingAddressCollectionAllowedCountries::Nc => "NC", - CreatePaymentLinkShippingAddressCollectionAllowedCountries::Ne => "NE", - CreatePaymentLinkShippingAddressCollectionAllowedCountries::Ng => "NG", - CreatePaymentLinkShippingAddressCollectionAllowedCountries::Ni => "NI", - CreatePaymentLinkShippingAddressCollectionAllowedCountries::Nl => "NL", - CreatePaymentLinkShippingAddressCollectionAllowedCountries::No => "NO", - CreatePaymentLinkShippingAddressCollectionAllowedCountries::Np => "NP", - CreatePaymentLinkShippingAddressCollectionAllowedCountries::Nr => "NR", - CreatePaymentLinkShippingAddressCollectionAllowedCountries::Nu => "NU", - CreatePaymentLinkShippingAddressCollectionAllowedCountries::Nz => "NZ", - CreatePaymentLinkShippingAddressCollectionAllowedCountries::Om => "OM", - CreatePaymentLinkShippingAddressCollectionAllowedCountries::Pa => "PA", - CreatePaymentLinkShippingAddressCollectionAllowedCountries::Pe => "PE", - CreatePaymentLinkShippingAddressCollectionAllowedCountries::Pf => "PF", - CreatePaymentLinkShippingAddressCollectionAllowedCountries::Pg => "PG", - CreatePaymentLinkShippingAddressCollectionAllowedCountries::Ph => "PH", - CreatePaymentLinkShippingAddressCollectionAllowedCountries::Pk => "PK", - CreatePaymentLinkShippingAddressCollectionAllowedCountries::Pl => "PL", - CreatePaymentLinkShippingAddressCollectionAllowedCountries::Pm => "PM", - CreatePaymentLinkShippingAddressCollectionAllowedCountries::Pn => "PN", - CreatePaymentLinkShippingAddressCollectionAllowedCountries::Pr => "PR", - CreatePaymentLinkShippingAddressCollectionAllowedCountries::Ps => "PS", - CreatePaymentLinkShippingAddressCollectionAllowedCountries::Pt => "PT", - CreatePaymentLinkShippingAddressCollectionAllowedCountries::Py => "PY", - CreatePaymentLinkShippingAddressCollectionAllowedCountries::Qa => "QA", - CreatePaymentLinkShippingAddressCollectionAllowedCountries::Re => "RE", - CreatePaymentLinkShippingAddressCollectionAllowedCountries::Ro => "RO", - CreatePaymentLinkShippingAddressCollectionAllowedCountries::Rs => "RS", - CreatePaymentLinkShippingAddressCollectionAllowedCountries::Ru => "RU", - CreatePaymentLinkShippingAddressCollectionAllowedCountries::Rw => "RW", - CreatePaymentLinkShippingAddressCollectionAllowedCountries::Sa => "SA", - CreatePaymentLinkShippingAddressCollectionAllowedCountries::Sb => "SB", - CreatePaymentLinkShippingAddressCollectionAllowedCountries::Sc => "SC", - CreatePaymentLinkShippingAddressCollectionAllowedCountries::Se => "SE", - CreatePaymentLinkShippingAddressCollectionAllowedCountries::Sg => "SG", - CreatePaymentLinkShippingAddressCollectionAllowedCountries::Sh => "SH", - CreatePaymentLinkShippingAddressCollectionAllowedCountries::Si => "SI", - CreatePaymentLinkShippingAddressCollectionAllowedCountries::Sj => "SJ", - CreatePaymentLinkShippingAddressCollectionAllowedCountries::Sk => "SK", - CreatePaymentLinkShippingAddressCollectionAllowedCountries::Sl => "SL", - CreatePaymentLinkShippingAddressCollectionAllowedCountries::Sm => "SM", - CreatePaymentLinkShippingAddressCollectionAllowedCountries::Sn => "SN", - CreatePaymentLinkShippingAddressCollectionAllowedCountries::So => "SO", - CreatePaymentLinkShippingAddressCollectionAllowedCountries::Sr => "SR", - CreatePaymentLinkShippingAddressCollectionAllowedCountries::Ss => "SS", - CreatePaymentLinkShippingAddressCollectionAllowedCountries::St => "ST", - CreatePaymentLinkShippingAddressCollectionAllowedCountries::Sv => "SV", - CreatePaymentLinkShippingAddressCollectionAllowedCountries::Sx => "SX", - CreatePaymentLinkShippingAddressCollectionAllowedCountries::Sz => "SZ", - CreatePaymentLinkShippingAddressCollectionAllowedCountries::Ta => "TA", - CreatePaymentLinkShippingAddressCollectionAllowedCountries::Tc => "TC", - CreatePaymentLinkShippingAddressCollectionAllowedCountries::Td => "TD", - CreatePaymentLinkShippingAddressCollectionAllowedCountries::Tf => "TF", - CreatePaymentLinkShippingAddressCollectionAllowedCountries::Tg => "TG", - CreatePaymentLinkShippingAddressCollectionAllowedCountries::Th => "TH", - CreatePaymentLinkShippingAddressCollectionAllowedCountries::Tj => "TJ", - CreatePaymentLinkShippingAddressCollectionAllowedCountries::Tk => "TK", - CreatePaymentLinkShippingAddressCollectionAllowedCountries::Tl => "TL", - CreatePaymentLinkShippingAddressCollectionAllowedCountries::Tm => "TM", - CreatePaymentLinkShippingAddressCollectionAllowedCountries::Tn => "TN", - CreatePaymentLinkShippingAddressCollectionAllowedCountries::To => "TO", - CreatePaymentLinkShippingAddressCollectionAllowedCountries::Tr => "TR", - CreatePaymentLinkShippingAddressCollectionAllowedCountries::Tt => "TT", - CreatePaymentLinkShippingAddressCollectionAllowedCountries::Tv => "TV", - CreatePaymentLinkShippingAddressCollectionAllowedCountries::Tw => "TW", - CreatePaymentLinkShippingAddressCollectionAllowedCountries::Tz => "TZ", - CreatePaymentLinkShippingAddressCollectionAllowedCountries::Ua => "UA", - CreatePaymentLinkShippingAddressCollectionAllowedCountries::Ug => "UG", - CreatePaymentLinkShippingAddressCollectionAllowedCountries::Us => "US", - CreatePaymentLinkShippingAddressCollectionAllowedCountries::Uy => "UY", - CreatePaymentLinkShippingAddressCollectionAllowedCountries::Uz => "UZ", - CreatePaymentLinkShippingAddressCollectionAllowedCountries::Va => "VA", - CreatePaymentLinkShippingAddressCollectionAllowedCountries::Vc => "VC", - CreatePaymentLinkShippingAddressCollectionAllowedCountries::Ve => "VE", - CreatePaymentLinkShippingAddressCollectionAllowedCountries::Vg => "VG", - CreatePaymentLinkShippingAddressCollectionAllowedCountries::Vn => "VN", - CreatePaymentLinkShippingAddressCollectionAllowedCountries::Vu => "VU", - CreatePaymentLinkShippingAddressCollectionAllowedCountries::Wf => "WF", - CreatePaymentLinkShippingAddressCollectionAllowedCountries::Ws => "WS", - CreatePaymentLinkShippingAddressCollectionAllowedCountries::Xk => "XK", - CreatePaymentLinkShippingAddressCollectionAllowedCountries::Ye => "YE", - CreatePaymentLinkShippingAddressCollectionAllowedCountries::Yt => "YT", - CreatePaymentLinkShippingAddressCollectionAllowedCountries::Za => "ZA", - CreatePaymentLinkShippingAddressCollectionAllowedCountries::Zm => "ZM", - CreatePaymentLinkShippingAddressCollectionAllowedCountries::Zw => "ZW", - CreatePaymentLinkShippingAddressCollectionAllowedCountries::Zz => "ZZ", - } - } -} - -impl AsRef for CreatePaymentLinkShippingAddressCollectionAllowedCountries { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for CreatePaymentLinkShippingAddressCollectionAllowedCountries { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for CreatePaymentLinkShippingAddressCollectionAllowedCountries { - fn default() -> Self { - Self::Ac - } -} - -/// An enum representing the possible values of an `CreatePaymentLinkSubscriptionDataInvoiceSettingsIssuer`'s `type` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CreatePaymentLinkSubscriptionDataInvoiceSettingsIssuerType { - Account, - #[serde(rename = "self")] - Self_, -} - -impl CreatePaymentLinkSubscriptionDataInvoiceSettingsIssuerType { - pub fn as_str(self) -> &'static str { - match self { - CreatePaymentLinkSubscriptionDataInvoiceSettingsIssuerType::Account => "account", - CreatePaymentLinkSubscriptionDataInvoiceSettingsIssuerType::Self_ => "self", - } - } -} - -impl AsRef for CreatePaymentLinkSubscriptionDataInvoiceSettingsIssuerType { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for CreatePaymentLinkSubscriptionDataInvoiceSettingsIssuerType { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for CreatePaymentLinkSubscriptionDataInvoiceSettingsIssuerType { - fn default() -> Self { - Self::Account - } -} - -/// An enum representing the possible values of an `CreatePaymentLinkSubscriptionDataTrialSettingsEndBehavior`'s `missing_payment_method` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CreatePaymentLinkSubscriptionDataTrialSettingsEndBehaviorMissingPaymentMethod { - Cancel, - CreateInvoice, - Pause, -} - -impl CreatePaymentLinkSubscriptionDataTrialSettingsEndBehaviorMissingPaymentMethod { - pub fn as_str(self) -> &'static str { - match self { - CreatePaymentLinkSubscriptionDataTrialSettingsEndBehaviorMissingPaymentMethod::Cancel => "cancel", - CreatePaymentLinkSubscriptionDataTrialSettingsEndBehaviorMissingPaymentMethod::CreateInvoice => "create_invoice", - CreatePaymentLinkSubscriptionDataTrialSettingsEndBehaviorMissingPaymentMethod::Pause => "pause", - } - } -} - -impl AsRef for CreatePaymentLinkSubscriptionDataTrialSettingsEndBehaviorMissingPaymentMethod { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display - for CreatePaymentLinkSubscriptionDataTrialSettingsEndBehaviorMissingPaymentMethod -{ - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default - for CreatePaymentLinkSubscriptionDataTrialSettingsEndBehaviorMissingPaymentMethod -{ - fn default() -> Self { - Self::Cancel - } -} - -/// An enum representing the possible values of an `PaymentLink`'s `billing_address_collection` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum PaymentLinkBillingAddressCollection { - Auto, - Required, -} - -impl PaymentLinkBillingAddressCollection { - pub fn as_str(self) -> &'static str { - match self { - PaymentLinkBillingAddressCollection::Auto => "auto", - PaymentLinkBillingAddressCollection::Required => "required", - } - } -} - -impl AsRef for PaymentLinkBillingAddressCollection { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for PaymentLinkBillingAddressCollection { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for PaymentLinkBillingAddressCollection { - fn default() -> Self { - Self::Auto - } -} - -/// An enum representing the possible values of an `PaymentLink`'s `customer_creation` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum PaymentLinkCustomerCreation { - Always, - IfRequired, -} - -impl PaymentLinkCustomerCreation { - pub fn as_str(self) -> &'static str { - match self { - PaymentLinkCustomerCreation::Always => "always", - PaymentLinkCustomerCreation::IfRequired => "if_required", - } - } -} - -impl AsRef for PaymentLinkCustomerCreation { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for PaymentLinkCustomerCreation { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for PaymentLinkCustomerCreation { - fn default() -> Self { - Self::Always - } -} - -/// An enum representing the possible values of an `PaymentLink`'s `payment_method_collection` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum PaymentLinkPaymentMethodCollection { - Always, - IfRequired, -} - -impl PaymentLinkPaymentMethodCollection { - pub fn as_str(self) -> &'static str { - match self { - PaymentLinkPaymentMethodCollection::Always => "always", - PaymentLinkPaymentMethodCollection::IfRequired => "if_required", - } - } -} - -impl AsRef for PaymentLinkPaymentMethodCollection { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for PaymentLinkPaymentMethodCollection { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for PaymentLinkPaymentMethodCollection { - fn default() -> Self { - Self::Always - } -} - -/// An enum representing the possible values of an `PaymentLink`'s `payment_method_types` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum PaymentLinkPaymentMethodTypes { - Affirm, - AfterpayClearpay, - Alipay, - AuBecsDebit, - BacsDebit, - Bancontact, - Blik, - Boleto, - Card, - Cashapp, - Eps, - Fpx, - Giropay, - Grabpay, - Ideal, - Klarna, - Konbini, - Link, - Oxxo, - P24, - Paynow, - Paypal, - Pix, - Promptpay, - SepaDebit, - Sofort, - Swish, - UsBankAccount, - WechatPay, -} - -impl PaymentLinkPaymentMethodTypes { - pub fn as_str(self) -> &'static str { - match self { - PaymentLinkPaymentMethodTypes::Affirm => "affirm", - PaymentLinkPaymentMethodTypes::AfterpayClearpay => "afterpay_clearpay", - PaymentLinkPaymentMethodTypes::Alipay => "alipay", - PaymentLinkPaymentMethodTypes::AuBecsDebit => "au_becs_debit", - PaymentLinkPaymentMethodTypes::BacsDebit => "bacs_debit", - PaymentLinkPaymentMethodTypes::Bancontact => "bancontact", - PaymentLinkPaymentMethodTypes::Blik => "blik", - PaymentLinkPaymentMethodTypes::Boleto => "boleto", - PaymentLinkPaymentMethodTypes::Card => "card", - PaymentLinkPaymentMethodTypes::Cashapp => "cashapp", - PaymentLinkPaymentMethodTypes::Eps => "eps", - PaymentLinkPaymentMethodTypes::Fpx => "fpx", - PaymentLinkPaymentMethodTypes::Giropay => "giropay", - PaymentLinkPaymentMethodTypes::Grabpay => "grabpay", - PaymentLinkPaymentMethodTypes::Ideal => "ideal", - PaymentLinkPaymentMethodTypes::Klarna => "klarna", - PaymentLinkPaymentMethodTypes::Konbini => "konbini", - PaymentLinkPaymentMethodTypes::Link => "link", - PaymentLinkPaymentMethodTypes::Oxxo => "oxxo", - PaymentLinkPaymentMethodTypes::P24 => "p24", - PaymentLinkPaymentMethodTypes::Paynow => "paynow", - PaymentLinkPaymentMethodTypes::Paypal => "paypal", - PaymentLinkPaymentMethodTypes::Pix => "pix", - PaymentLinkPaymentMethodTypes::Promptpay => "promptpay", - PaymentLinkPaymentMethodTypes::SepaDebit => "sepa_debit", - PaymentLinkPaymentMethodTypes::Sofort => "sofort", - PaymentLinkPaymentMethodTypes::Swish => "swish", - PaymentLinkPaymentMethodTypes::UsBankAccount => "us_bank_account", - PaymentLinkPaymentMethodTypes::WechatPay => "wechat_pay", - } - } -} - -impl AsRef for PaymentLinkPaymentMethodTypes { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for PaymentLinkPaymentMethodTypes { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for PaymentLinkPaymentMethodTypes { - fn default() -> Self { - Self::Affirm - } -} - -/// An enum representing the possible values of an `PaymentLink`'s `submit_type` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum PaymentLinkSubmitType { - Auto, - Book, - Donate, - Pay, -} - -impl PaymentLinkSubmitType { - pub fn as_str(self) -> &'static str { - match self { - PaymentLinkSubmitType::Auto => "auto", - PaymentLinkSubmitType::Book => "book", - PaymentLinkSubmitType::Donate => "donate", - PaymentLinkSubmitType::Pay => "pay", - } - } -} - -impl AsRef for PaymentLinkSubmitType { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for PaymentLinkSubmitType { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for PaymentLinkSubmitType { - fn default() -> Self { - Self::Auto - } -} - -/// An enum representing the possible values of an `PaymentLinksResourceAfterCompletion`'s `type` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum PaymentLinksResourceAfterCompletionType { - HostedConfirmation, - Redirect, -} - -impl PaymentLinksResourceAfterCompletionType { - pub fn as_str(self) -> &'static str { - match self { - PaymentLinksResourceAfterCompletionType::HostedConfirmation => "hosted_confirmation", - PaymentLinksResourceAfterCompletionType::Redirect => "redirect", - } - } -} - -impl AsRef for PaymentLinksResourceAfterCompletionType { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for PaymentLinksResourceAfterCompletionType { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for PaymentLinksResourceAfterCompletionType { - fn default() -> Self { - Self::HostedConfirmation - } -} - -/// An enum representing the possible values of an `PaymentLinksResourceConsentCollection`'s `promotions` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum PaymentLinksResourceConsentCollectionPromotions { - Auto, - None, -} - -impl PaymentLinksResourceConsentCollectionPromotions { - pub fn as_str(self) -> &'static str { - match self { - PaymentLinksResourceConsentCollectionPromotions::Auto => "auto", - PaymentLinksResourceConsentCollectionPromotions::None => "none", - } - } -} - -impl AsRef for PaymentLinksResourceConsentCollectionPromotions { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for PaymentLinksResourceConsentCollectionPromotions { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for PaymentLinksResourceConsentCollectionPromotions { - fn default() -> Self { - Self::Auto - } -} - -/// An enum representing the possible values of an `PaymentLinksResourceConsentCollection`'s `terms_of_service` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum PaymentLinksResourceConsentCollectionTermsOfService { - None, - Required, -} - -impl PaymentLinksResourceConsentCollectionTermsOfService { - pub fn as_str(self) -> &'static str { - match self { - PaymentLinksResourceConsentCollectionTermsOfService::None => "none", - PaymentLinksResourceConsentCollectionTermsOfService::Required => "required", - } - } -} - -impl AsRef for PaymentLinksResourceConsentCollectionTermsOfService { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for PaymentLinksResourceConsentCollectionTermsOfService { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for PaymentLinksResourceConsentCollectionTermsOfService { - fn default() -> Self { - Self::None - } -} - -/// An enum representing the possible values of an `PaymentLinksResourceCustomFieldsLabel`'s `type` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum PaymentLinksResourceCustomFieldsLabelType { - Custom, -} - -impl PaymentLinksResourceCustomFieldsLabelType { - pub fn as_str(self) -> &'static str { - match self { - PaymentLinksResourceCustomFieldsLabelType::Custom => "custom", - } - } -} - -impl AsRef for PaymentLinksResourceCustomFieldsLabelType { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for PaymentLinksResourceCustomFieldsLabelType { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for PaymentLinksResourceCustomFieldsLabelType { - fn default() -> Self { - Self::Custom - } -} - -/// An enum representing the possible values of an `PaymentLinksResourceCustomFields`'s `type` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum PaymentLinksResourceCustomFieldsType { - Dropdown, - Numeric, - Text, -} - -impl PaymentLinksResourceCustomFieldsType { - pub fn as_str(self) -> &'static str { - match self { - PaymentLinksResourceCustomFieldsType::Dropdown => "dropdown", - PaymentLinksResourceCustomFieldsType::Numeric => "numeric", - PaymentLinksResourceCustomFieldsType::Text => "text", - } - } -} - -impl AsRef for PaymentLinksResourceCustomFieldsType { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for PaymentLinksResourceCustomFieldsType { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for PaymentLinksResourceCustomFieldsType { - fn default() -> Self { - Self::Dropdown - } -} - -/// An enum representing the possible values of an `PaymentLinksResourcePaymentIntentData`'s `capture_method` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum PaymentLinksResourcePaymentIntentDataCaptureMethod { - Automatic, - AutomaticAsync, - Manual, -} - -impl PaymentLinksResourcePaymentIntentDataCaptureMethod { - pub fn as_str(self) -> &'static str { - match self { - PaymentLinksResourcePaymentIntentDataCaptureMethod::Automatic => "automatic", - PaymentLinksResourcePaymentIntentDataCaptureMethod::AutomaticAsync => "automatic_async", - PaymentLinksResourcePaymentIntentDataCaptureMethod::Manual => "manual", - } - } -} - -impl AsRef for PaymentLinksResourcePaymentIntentDataCaptureMethod { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for PaymentLinksResourcePaymentIntentDataCaptureMethod { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for PaymentLinksResourcePaymentIntentDataCaptureMethod { - fn default() -> Self { - Self::Automatic - } -} - -/// An enum representing the possible values of an `PaymentLinksResourcePaymentIntentData`'s `setup_future_usage` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum PaymentLinksResourcePaymentIntentDataSetupFutureUsage { - OffSession, - OnSession, -} - -impl PaymentLinksResourcePaymentIntentDataSetupFutureUsage { - pub fn as_str(self) -> &'static str { - match self { - PaymentLinksResourcePaymentIntentDataSetupFutureUsage::OffSession => "off_session", - PaymentLinksResourcePaymentIntentDataSetupFutureUsage::OnSession => "on_session", - } - } -} - -impl AsRef for PaymentLinksResourcePaymentIntentDataSetupFutureUsage { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for PaymentLinksResourcePaymentIntentDataSetupFutureUsage { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for PaymentLinksResourcePaymentIntentDataSetupFutureUsage { - fn default() -> Self { - Self::OffSession - } -} - -/// An enum representing the possible values of an `PaymentLinksResourcePaymentMethodReuseAgreement`'s `position` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum PaymentLinksResourcePaymentMethodReuseAgreementPosition { - Auto, - Hidden, -} - -impl PaymentLinksResourcePaymentMethodReuseAgreementPosition { - pub fn as_str(self) -> &'static str { - match self { - PaymentLinksResourcePaymentMethodReuseAgreementPosition::Auto => "auto", - PaymentLinksResourcePaymentMethodReuseAgreementPosition::Hidden => "hidden", - } - } -} - -impl AsRef for PaymentLinksResourcePaymentMethodReuseAgreementPosition { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for PaymentLinksResourcePaymentMethodReuseAgreementPosition { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for PaymentLinksResourcePaymentMethodReuseAgreementPosition { - fn default() -> Self { - Self::Auto - } -} - -/// An enum representing the possible values of an `PaymentLinksResourceShippingAddressCollection`'s `allowed_countries` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum PaymentLinksResourceShippingAddressCollectionAllowedCountries { - #[serde(rename = "AC")] - Ac, - #[serde(rename = "AD")] - Ad, - #[serde(rename = "AE")] - Ae, - #[serde(rename = "AF")] - Af, - #[serde(rename = "AG")] - Ag, - #[serde(rename = "AI")] - Ai, - #[serde(rename = "AL")] - Al, - #[serde(rename = "AM")] - Am, - #[serde(rename = "AO")] - Ao, - #[serde(rename = "AQ")] - Aq, - #[serde(rename = "AR")] - Ar, - #[serde(rename = "AT")] - At, - #[serde(rename = "AU")] - Au, - #[serde(rename = "AW")] - Aw, - #[serde(rename = "AX")] - Ax, - #[serde(rename = "AZ")] - Az, - #[serde(rename = "BA")] - Ba, - #[serde(rename = "BB")] - Bb, - #[serde(rename = "BD")] - Bd, - #[serde(rename = "BE")] - Be, - #[serde(rename = "BF")] - Bf, - #[serde(rename = "BG")] - Bg, - #[serde(rename = "BH")] - Bh, - #[serde(rename = "BI")] - Bi, - #[serde(rename = "BJ")] - Bj, - #[serde(rename = "BL")] - Bl, - #[serde(rename = "BM")] - Bm, - #[serde(rename = "BN")] - Bn, - #[serde(rename = "BO")] - Bo, - #[serde(rename = "BQ")] - Bq, - #[serde(rename = "BR")] - Br, - #[serde(rename = "BS")] - Bs, - #[serde(rename = "BT")] - Bt, - #[serde(rename = "BV")] - Bv, - #[serde(rename = "BW")] - Bw, - #[serde(rename = "BY")] - By, - #[serde(rename = "BZ")] - Bz, - #[serde(rename = "CA")] - Ca, - #[serde(rename = "CD")] - Cd, - #[serde(rename = "CF")] - Cf, - #[serde(rename = "CG")] - Cg, - #[serde(rename = "CH")] - Ch, - #[serde(rename = "CI")] - Ci, - #[serde(rename = "CK")] - Ck, - #[serde(rename = "CL")] - Cl, - #[serde(rename = "CM")] - Cm, - #[serde(rename = "CN")] - Cn, - #[serde(rename = "CO")] - Co, - #[serde(rename = "CR")] - Cr, - #[serde(rename = "CV")] - Cv, - #[serde(rename = "CW")] - Cw, - #[serde(rename = "CY")] - Cy, - #[serde(rename = "CZ")] - Cz, - #[serde(rename = "DE")] - De, - #[serde(rename = "DJ")] - Dj, - #[serde(rename = "DK")] - Dk, - #[serde(rename = "DM")] - Dm, - #[serde(rename = "DO")] - Do, - #[serde(rename = "DZ")] - Dz, - #[serde(rename = "EC")] - Ec, - #[serde(rename = "EE")] - Ee, - #[serde(rename = "EG")] - Eg, - #[serde(rename = "EH")] - Eh, - #[serde(rename = "ER")] - Er, - #[serde(rename = "ES")] - Es, - #[serde(rename = "ET")] - Et, - #[serde(rename = "FI")] - Fi, - #[serde(rename = "FJ")] - Fj, - #[serde(rename = "FK")] - Fk, - #[serde(rename = "FO")] - Fo, - #[serde(rename = "FR")] - Fr, - #[serde(rename = "GA")] - Ga, - #[serde(rename = "GB")] - Gb, - #[serde(rename = "GD")] - Gd, - #[serde(rename = "GE")] - Ge, - #[serde(rename = "GF")] - Gf, - #[serde(rename = "GG")] - Gg, - #[serde(rename = "GH")] - Gh, - #[serde(rename = "GI")] - Gi, - #[serde(rename = "GL")] - Gl, - #[serde(rename = "GM")] - Gm, - #[serde(rename = "GN")] - Gn, - #[serde(rename = "GP")] - Gp, - #[serde(rename = "GQ")] - Gq, - #[serde(rename = "GR")] - Gr, - #[serde(rename = "GS")] - Gs, - #[serde(rename = "GT")] - Gt, - #[serde(rename = "GU")] - Gu, - #[serde(rename = "GW")] - Gw, - #[serde(rename = "GY")] - Gy, - #[serde(rename = "HK")] - Hk, - #[serde(rename = "HN")] - Hn, - #[serde(rename = "HR")] - Hr, - #[serde(rename = "HT")] - Ht, - #[serde(rename = "HU")] - Hu, - #[serde(rename = "ID")] - Id, - #[serde(rename = "IE")] - Ie, - #[serde(rename = "IL")] - Il, - #[serde(rename = "IM")] - Im, - #[serde(rename = "IN")] - In, - #[serde(rename = "IO")] - Io, - #[serde(rename = "IQ")] - Iq, - #[serde(rename = "IS")] - Is, - #[serde(rename = "IT")] - It, - #[serde(rename = "JE")] - Je, - #[serde(rename = "JM")] - Jm, - #[serde(rename = "JO")] - Jo, - #[serde(rename = "JP")] - Jp, - #[serde(rename = "KE")] - Ke, - #[serde(rename = "KG")] - Kg, - #[serde(rename = "KH")] - Kh, - #[serde(rename = "KI")] - Ki, - #[serde(rename = "KM")] - Km, - #[serde(rename = "KN")] - Kn, - #[serde(rename = "KR")] - Kr, - #[serde(rename = "KW")] - Kw, - #[serde(rename = "KY")] - Ky, - #[serde(rename = "KZ")] - Kz, - #[serde(rename = "LA")] - La, - #[serde(rename = "LB")] - Lb, - #[serde(rename = "LC")] - Lc, - #[serde(rename = "LI")] - Li, - #[serde(rename = "LK")] - Lk, - #[serde(rename = "LR")] - Lr, - #[serde(rename = "LS")] - Ls, - #[serde(rename = "LT")] - Lt, - #[serde(rename = "LU")] - Lu, - #[serde(rename = "LV")] - Lv, - #[serde(rename = "LY")] - Ly, - #[serde(rename = "MA")] - Ma, - #[serde(rename = "MC")] - Mc, - #[serde(rename = "MD")] - Md, - #[serde(rename = "ME")] - Me, - #[serde(rename = "MF")] - Mf, - #[serde(rename = "MG")] - Mg, - #[serde(rename = "MK")] - Mk, - #[serde(rename = "ML")] - Ml, - #[serde(rename = "MM")] - Mm, - #[serde(rename = "MN")] - Mn, - #[serde(rename = "MO")] - Mo, - #[serde(rename = "MQ")] - Mq, - #[serde(rename = "MR")] - Mr, - #[serde(rename = "MS")] - Ms, - #[serde(rename = "MT")] - Mt, - #[serde(rename = "MU")] - Mu, - #[serde(rename = "MV")] - Mv, - #[serde(rename = "MW")] - Mw, - #[serde(rename = "MX")] - Mx, - #[serde(rename = "MY")] - My, - #[serde(rename = "MZ")] - Mz, - #[serde(rename = "NA")] - Na, - #[serde(rename = "NC")] - Nc, - #[serde(rename = "NE")] - Ne, - #[serde(rename = "NG")] - Ng, - #[serde(rename = "NI")] - Ni, - #[serde(rename = "NL")] - Nl, - #[serde(rename = "NO")] - No, - #[serde(rename = "NP")] - Np, - #[serde(rename = "NR")] - Nr, - #[serde(rename = "NU")] - Nu, - #[serde(rename = "NZ")] - Nz, - #[serde(rename = "OM")] - Om, - #[serde(rename = "PA")] - Pa, - #[serde(rename = "PE")] - Pe, - #[serde(rename = "PF")] - Pf, - #[serde(rename = "PG")] - Pg, - #[serde(rename = "PH")] - Ph, - #[serde(rename = "PK")] - Pk, - #[serde(rename = "PL")] - Pl, - #[serde(rename = "PM")] - Pm, - #[serde(rename = "PN")] - Pn, - #[serde(rename = "PR")] - Pr, - #[serde(rename = "PS")] - Ps, - #[serde(rename = "PT")] - Pt, - #[serde(rename = "PY")] - Py, - #[serde(rename = "QA")] - Qa, - #[serde(rename = "RE")] - Re, - #[serde(rename = "RO")] - Ro, - #[serde(rename = "RS")] - Rs, - #[serde(rename = "RU")] - Ru, - #[serde(rename = "RW")] - Rw, - #[serde(rename = "SA")] - Sa, - #[serde(rename = "SB")] - Sb, - #[serde(rename = "SC")] - Sc, - #[serde(rename = "SE")] - Se, - #[serde(rename = "SG")] - Sg, - #[serde(rename = "SH")] - Sh, - #[serde(rename = "SI")] - Si, - #[serde(rename = "SJ")] - Sj, - #[serde(rename = "SK")] - Sk, - #[serde(rename = "SL")] - Sl, - #[serde(rename = "SM")] - Sm, - #[serde(rename = "SN")] - Sn, - #[serde(rename = "SO")] - So, - #[serde(rename = "SR")] - Sr, - #[serde(rename = "SS")] - Ss, - #[serde(rename = "ST")] - St, - #[serde(rename = "SV")] - Sv, - #[serde(rename = "SX")] - Sx, - #[serde(rename = "SZ")] - Sz, - #[serde(rename = "TA")] - Ta, - #[serde(rename = "TC")] - Tc, - #[serde(rename = "TD")] - Td, - #[serde(rename = "TF")] - Tf, - #[serde(rename = "TG")] - Tg, - #[serde(rename = "TH")] - Th, - #[serde(rename = "TJ")] - Tj, - #[serde(rename = "TK")] - Tk, - #[serde(rename = "TL")] - Tl, - #[serde(rename = "TM")] - Tm, - #[serde(rename = "TN")] - Tn, - #[serde(rename = "TO")] - To, - #[serde(rename = "TR")] - Tr, - #[serde(rename = "TT")] - Tt, - #[serde(rename = "TV")] - Tv, - #[serde(rename = "TW")] - Tw, - #[serde(rename = "TZ")] - Tz, - #[serde(rename = "UA")] - Ua, - #[serde(rename = "UG")] - Ug, - #[serde(rename = "US")] - Us, - #[serde(rename = "UY")] - Uy, - #[serde(rename = "UZ")] - Uz, - #[serde(rename = "VA")] - Va, - #[serde(rename = "VC")] - Vc, - #[serde(rename = "VE")] - Ve, - #[serde(rename = "VG")] - Vg, - #[serde(rename = "VN")] - Vn, - #[serde(rename = "VU")] - Vu, - #[serde(rename = "WF")] - Wf, - #[serde(rename = "WS")] - Ws, - #[serde(rename = "XK")] - Xk, - #[serde(rename = "YE")] - Ye, - #[serde(rename = "YT")] - Yt, - #[serde(rename = "ZA")] - Za, - #[serde(rename = "ZM")] - Zm, - #[serde(rename = "ZW")] - Zw, - #[serde(rename = "ZZ")] - Zz, -} - -impl PaymentLinksResourceShippingAddressCollectionAllowedCountries { - pub fn as_str(self) -> &'static str { - match self { - PaymentLinksResourceShippingAddressCollectionAllowedCountries::Ac => "AC", - PaymentLinksResourceShippingAddressCollectionAllowedCountries::Ad => "AD", - PaymentLinksResourceShippingAddressCollectionAllowedCountries::Ae => "AE", - PaymentLinksResourceShippingAddressCollectionAllowedCountries::Af => "AF", - PaymentLinksResourceShippingAddressCollectionAllowedCountries::Ag => "AG", - PaymentLinksResourceShippingAddressCollectionAllowedCountries::Ai => "AI", - PaymentLinksResourceShippingAddressCollectionAllowedCountries::Al => "AL", - PaymentLinksResourceShippingAddressCollectionAllowedCountries::Am => "AM", - PaymentLinksResourceShippingAddressCollectionAllowedCountries::Ao => "AO", - PaymentLinksResourceShippingAddressCollectionAllowedCountries::Aq => "AQ", - PaymentLinksResourceShippingAddressCollectionAllowedCountries::Ar => "AR", - PaymentLinksResourceShippingAddressCollectionAllowedCountries::At => "AT", - PaymentLinksResourceShippingAddressCollectionAllowedCountries::Au => "AU", - PaymentLinksResourceShippingAddressCollectionAllowedCountries::Aw => "AW", - PaymentLinksResourceShippingAddressCollectionAllowedCountries::Ax => "AX", - PaymentLinksResourceShippingAddressCollectionAllowedCountries::Az => "AZ", - PaymentLinksResourceShippingAddressCollectionAllowedCountries::Ba => "BA", - PaymentLinksResourceShippingAddressCollectionAllowedCountries::Bb => "BB", - PaymentLinksResourceShippingAddressCollectionAllowedCountries::Bd => "BD", - PaymentLinksResourceShippingAddressCollectionAllowedCountries::Be => "BE", - PaymentLinksResourceShippingAddressCollectionAllowedCountries::Bf => "BF", - PaymentLinksResourceShippingAddressCollectionAllowedCountries::Bg => "BG", - PaymentLinksResourceShippingAddressCollectionAllowedCountries::Bh => "BH", - PaymentLinksResourceShippingAddressCollectionAllowedCountries::Bi => "BI", - PaymentLinksResourceShippingAddressCollectionAllowedCountries::Bj => "BJ", - PaymentLinksResourceShippingAddressCollectionAllowedCountries::Bl => "BL", - PaymentLinksResourceShippingAddressCollectionAllowedCountries::Bm => "BM", - PaymentLinksResourceShippingAddressCollectionAllowedCountries::Bn => "BN", - PaymentLinksResourceShippingAddressCollectionAllowedCountries::Bo => "BO", - PaymentLinksResourceShippingAddressCollectionAllowedCountries::Bq => "BQ", - PaymentLinksResourceShippingAddressCollectionAllowedCountries::Br => "BR", - PaymentLinksResourceShippingAddressCollectionAllowedCountries::Bs => "BS", - PaymentLinksResourceShippingAddressCollectionAllowedCountries::Bt => "BT", - PaymentLinksResourceShippingAddressCollectionAllowedCountries::Bv => "BV", - PaymentLinksResourceShippingAddressCollectionAllowedCountries::Bw => "BW", - PaymentLinksResourceShippingAddressCollectionAllowedCountries::By => "BY", - PaymentLinksResourceShippingAddressCollectionAllowedCountries::Bz => "BZ", - PaymentLinksResourceShippingAddressCollectionAllowedCountries::Ca => "CA", - PaymentLinksResourceShippingAddressCollectionAllowedCountries::Cd => "CD", - PaymentLinksResourceShippingAddressCollectionAllowedCountries::Cf => "CF", - PaymentLinksResourceShippingAddressCollectionAllowedCountries::Cg => "CG", - PaymentLinksResourceShippingAddressCollectionAllowedCountries::Ch => "CH", - PaymentLinksResourceShippingAddressCollectionAllowedCountries::Ci => "CI", - PaymentLinksResourceShippingAddressCollectionAllowedCountries::Ck => "CK", - PaymentLinksResourceShippingAddressCollectionAllowedCountries::Cl => "CL", - PaymentLinksResourceShippingAddressCollectionAllowedCountries::Cm => "CM", - PaymentLinksResourceShippingAddressCollectionAllowedCountries::Cn => "CN", - PaymentLinksResourceShippingAddressCollectionAllowedCountries::Co => "CO", - PaymentLinksResourceShippingAddressCollectionAllowedCountries::Cr => "CR", - PaymentLinksResourceShippingAddressCollectionAllowedCountries::Cv => "CV", - PaymentLinksResourceShippingAddressCollectionAllowedCountries::Cw => "CW", - PaymentLinksResourceShippingAddressCollectionAllowedCountries::Cy => "CY", - PaymentLinksResourceShippingAddressCollectionAllowedCountries::Cz => "CZ", - PaymentLinksResourceShippingAddressCollectionAllowedCountries::De => "DE", - PaymentLinksResourceShippingAddressCollectionAllowedCountries::Dj => "DJ", - PaymentLinksResourceShippingAddressCollectionAllowedCountries::Dk => "DK", - PaymentLinksResourceShippingAddressCollectionAllowedCountries::Dm => "DM", - PaymentLinksResourceShippingAddressCollectionAllowedCountries::Do => "DO", - PaymentLinksResourceShippingAddressCollectionAllowedCountries::Dz => "DZ", - PaymentLinksResourceShippingAddressCollectionAllowedCountries::Ec => "EC", - PaymentLinksResourceShippingAddressCollectionAllowedCountries::Ee => "EE", - PaymentLinksResourceShippingAddressCollectionAllowedCountries::Eg => "EG", - PaymentLinksResourceShippingAddressCollectionAllowedCountries::Eh => "EH", - PaymentLinksResourceShippingAddressCollectionAllowedCountries::Er => "ER", - PaymentLinksResourceShippingAddressCollectionAllowedCountries::Es => "ES", - PaymentLinksResourceShippingAddressCollectionAllowedCountries::Et => "ET", - PaymentLinksResourceShippingAddressCollectionAllowedCountries::Fi => "FI", - PaymentLinksResourceShippingAddressCollectionAllowedCountries::Fj => "FJ", - PaymentLinksResourceShippingAddressCollectionAllowedCountries::Fk => "FK", - PaymentLinksResourceShippingAddressCollectionAllowedCountries::Fo => "FO", - PaymentLinksResourceShippingAddressCollectionAllowedCountries::Fr => "FR", - PaymentLinksResourceShippingAddressCollectionAllowedCountries::Ga => "GA", - PaymentLinksResourceShippingAddressCollectionAllowedCountries::Gb => "GB", - PaymentLinksResourceShippingAddressCollectionAllowedCountries::Gd => "GD", - PaymentLinksResourceShippingAddressCollectionAllowedCountries::Ge => "GE", - PaymentLinksResourceShippingAddressCollectionAllowedCountries::Gf => "GF", - PaymentLinksResourceShippingAddressCollectionAllowedCountries::Gg => "GG", - PaymentLinksResourceShippingAddressCollectionAllowedCountries::Gh => "GH", - PaymentLinksResourceShippingAddressCollectionAllowedCountries::Gi => "GI", - PaymentLinksResourceShippingAddressCollectionAllowedCountries::Gl => "GL", - PaymentLinksResourceShippingAddressCollectionAllowedCountries::Gm => "GM", - PaymentLinksResourceShippingAddressCollectionAllowedCountries::Gn => "GN", - PaymentLinksResourceShippingAddressCollectionAllowedCountries::Gp => "GP", - PaymentLinksResourceShippingAddressCollectionAllowedCountries::Gq => "GQ", - PaymentLinksResourceShippingAddressCollectionAllowedCountries::Gr => "GR", - PaymentLinksResourceShippingAddressCollectionAllowedCountries::Gs => "GS", - PaymentLinksResourceShippingAddressCollectionAllowedCountries::Gt => "GT", - PaymentLinksResourceShippingAddressCollectionAllowedCountries::Gu => "GU", - PaymentLinksResourceShippingAddressCollectionAllowedCountries::Gw => "GW", - PaymentLinksResourceShippingAddressCollectionAllowedCountries::Gy => "GY", - PaymentLinksResourceShippingAddressCollectionAllowedCountries::Hk => "HK", - PaymentLinksResourceShippingAddressCollectionAllowedCountries::Hn => "HN", - PaymentLinksResourceShippingAddressCollectionAllowedCountries::Hr => "HR", - PaymentLinksResourceShippingAddressCollectionAllowedCountries::Ht => "HT", - PaymentLinksResourceShippingAddressCollectionAllowedCountries::Hu => "HU", - PaymentLinksResourceShippingAddressCollectionAllowedCountries::Id => "ID", - PaymentLinksResourceShippingAddressCollectionAllowedCountries::Ie => "IE", - PaymentLinksResourceShippingAddressCollectionAllowedCountries::Il => "IL", - PaymentLinksResourceShippingAddressCollectionAllowedCountries::Im => "IM", - PaymentLinksResourceShippingAddressCollectionAllowedCountries::In => "IN", - PaymentLinksResourceShippingAddressCollectionAllowedCountries::Io => "IO", - PaymentLinksResourceShippingAddressCollectionAllowedCountries::Iq => "IQ", - PaymentLinksResourceShippingAddressCollectionAllowedCountries::Is => "IS", - PaymentLinksResourceShippingAddressCollectionAllowedCountries::It => "IT", - PaymentLinksResourceShippingAddressCollectionAllowedCountries::Je => "JE", - PaymentLinksResourceShippingAddressCollectionAllowedCountries::Jm => "JM", - PaymentLinksResourceShippingAddressCollectionAllowedCountries::Jo => "JO", - PaymentLinksResourceShippingAddressCollectionAllowedCountries::Jp => "JP", - PaymentLinksResourceShippingAddressCollectionAllowedCountries::Ke => "KE", - PaymentLinksResourceShippingAddressCollectionAllowedCountries::Kg => "KG", - PaymentLinksResourceShippingAddressCollectionAllowedCountries::Kh => "KH", - PaymentLinksResourceShippingAddressCollectionAllowedCountries::Ki => "KI", - PaymentLinksResourceShippingAddressCollectionAllowedCountries::Km => "KM", - PaymentLinksResourceShippingAddressCollectionAllowedCountries::Kn => "KN", - PaymentLinksResourceShippingAddressCollectionAllowedCountries::Kr => "KR", - PaymentLinksResourceShippingAddressCollectionAllowedCountries::Kw => "KW", - PaymentLinksResourceShippingAddressCollectionAllowedCountries::Ky => "KY", - PaymentLinksResourceShippingAddressCollectionAllowedCountries::Kz => "KZ", - PaymentLinksResourceShippingAddressCollectionAllowedCountries::La => "LA", - PaymentLinksResourceShippingAddressCollectionAllowedCountries::Lb => "LB", - PaymentLinksResourceShippingAddressCollectionAllowedCountries::Lc => "LC", - PaymentLinksResourceShippingAddressCollectionAllowedCountries::Li => "LI", - PaymentLinksResourceShippingAddressCollectionAllowedCountries::Lk => "LK", - PaymentLinksResourceShippingAddressCollectionAllowedCountries::Lr => "LR", - PaymentLinksResourceShippingAddressCollectionAllowedCountries::Ls => "LS", - PaymentLinksResourceShippingAddressCollectionAllowedCountries::Lt => "LT", - PaymentLinksResourceShippingAddressCollectionAllowedCountries::Lu => "LU", - PaymentLinksResourceShippingAddressCollectionAllowedCountries::Lv => "LV", - PaymentLinksResourceShippingAddressCollectionAllowedCountries::Ly => "LY", - PaymentLinksResourceShippingAddressCollectionAllowedCountries::Ma => "MA", - PaymentLinksResourceShippingAddressCollectionAllowedCountries::Mc => "MC", - PaymentLinksResourceShippingAddressCollectionAllowedCountries::Md => "MD", - PaymentLinksResourceShippingAddressCollectionAllowedCountries::Me => "ME", - PaymentLinksResourceShippingAddressCollectionAllowedCountries::Mf => "MF", - PaymentLinksResourceShippingAddressCollectionAllowedCountries::Mg => "MG", - PaymentLinksResourceShippingAddressCollectionAllowedCountries::Mk => "MK", - PaymentLinksResourceShippingAddressCollectionAllowedCountries::Ml => "ML", - PaymentLinksResourceShippingAddressCollectionAllowedCountries::Mm => "MM", - PaymentLinksResourceShippingAddressCollectionAllowedCountries::Mn => "MN", - PaymentLinksResourceShippingAddressCollectionAllowedCountries::Mo => "MO", - PaymentLinksResourceShippingAddressCollectionAllowedCountries::Mq => "MQ", - PaymentLinksResourceShippingAddressCollectionAllowedCountries::Mr => "MR", - PaymentLinksResourceShippingAddressCollectionAllowedCountries::Ms => "MS", - PaymentLinksResourceShippingAddressCollectionAllowedCountries::Mt => "MT", - PaymentLinksResourceShippingAddressCollectionAllowedCountries::Mu => "MU", - PaymentLinksResourceShippingAddressCollectionAllowedCountries::Mv => "MV", - PaymentLinksResourceShippingAddressCollectionAllowedCountries::Mw => "MW", - PaymentLinksResourceShippingAddressCollectionAllowedCountries::Mx => "MX", - PaymentLinksResourceShippingAddressCollectionAllowedCountries::My => "MY", - PaymentLinksResourceShippingAddressCollectionAllowedCountries::Mz => "MZ", - PaymentLinksResourceShippingAddressCollectionAllowedCountries::Na => "NA", - PaymentLinksResourceShippingAddressCollectionAllowedCountries::Nc => "NC", - PaymentLinksResourceShippingAddressCollectionAllowedCountries::Ne => "NE", - PaymentLinksResourceShippingAddressCollectionAllowedCountries::Ng => "NG", - PaymentLinksResourceShippingAddressCollectionAllowedCountries::Ni => "NI", - PaymentLinksResourceShippingAddressCollectionAllowedCountries::Nl => "NL", - PaymentLinksResourceShippingAddressCollectionAllowedCountries::No => "NO", - PaymentLinksResourceShippingAddressCollectionAllowedCountries::Np => "NP", - PaymentLinksResourceShippingAddressCollectionAllowedCountries::Nr => "NR", - PaymentLinksResourceShippingAddressCollectionAllowedCountries::Nu => "NU", - PaymentLinksResourceShippingAddressCollectionAllowedCountries::Nz => "NZ", - PaymentLinksResourceShippingAddressCollectionAllowedCountries::Om => "OM", - PaymentLinksResourceShippingAddressCollectionAllowedCountries::Pa => "PA", - PaymentLinksResourceShippingAddressCollectionAllowedCountries::Pe => "PE", - PaymentLinksResourceShippingAddressCollectionAllowedCountries::Pf => "PF", - PaymentLinksResourceShippingAddressCollectionAllowedCountries::Pg => "PG", - PaymentLinksResourceShippingAddressCollectionAllowedCountries::Ph => "PH", - PaymentLinksResourceShippingAddressCollectionAllowedCountries::Pk => "PK", - PaymentLinksResourceShippingAddressCollectionAllowedCountries::Pl => "PL", - PaymentLinksResourceShippingAddressCollectionAllowedCountries::Pm => "PM", - PaymentLinksResourceShippingAddressCollectionAllowedCountries::Pn => "PN", - PaymentLinksResourceShippingAddressCollectionAllowedCountries::Pr => "PR", - PaymentLinksResourceShippingAddressCollectionAllowedCountries::Ps => "PS", - PaymentLinksResourceShippingAddressCollectionAllowedCountries::Pt => "PT", - PaymentLinksResourceShippingAddressCollectionAllowedCountries::Py => "PY", - PaymentLinksResourceShippingAddressCollectionAllowedCountries::Qa => "QA", - PaymentLinksResourceShippingAddressCollectionAllowedCountries::Re => "RE", - PaymentLinksResourceShippingAddressCollectionAllowedCountries::Ro => "RO", - PaymentLinksResourceShippingAddressCollectionAllowedCountries::Rs => "RS", - PaymentLinksResourceShippingAddressCollectionAllowedCountries::Ru => "RU", - PaymentLinksResourceShippingAddressCollectionAllowedCountries::Rw => "RW", - PaymentLinksResourceShippingAddressCollectionAllowedCountries::Sa => "SA", - PaymentLinksResourceShippingAddressCollectionAllowedCountries::Sb => "SB", - PaymentLinksResourceShippingAddressCollectionAllowedCountries::Sc => "SC", - PaymentLinksResourceShippingAddressCollectionAllowedCountries::Se => "SE", - PaymentLinksResourceShippingAddressCollectionAllowedCountries::Sg => "SG", - PaymentLinksResourceShippingAddressCollectionAllowedCountries::Sh => "SH", - PaymentLinksResourceShippingAddressCollectionAllowedCountries::Si => "SI", - PaymentLinksResourceShippingAddressCollectionAllowedCountries::Sj => "SJ", - PaymentLinksResourceShippingAddressCollectionAllowedCountries::Sk => "SK", - PaymentLinksResourceShippingAddressCollectionAllowedCountries::Sl => "SL", - PaymentLinksResourceShippingAddressCollectionAllowedCountries::Sm => "SM", - PaymentLinksResourceShippingAddressCollectionAllowedCountries::Sn => "SN", - PaymentLinksResourceShippingAddressCollectionAllowedCountries::So => "SO", - PaymentLinksResourceShippingAddressCollectionAllowedCountries::Sr => "SR", - PaymentLinksResourceShippingAddressCollectionAllowedCountries::Ss => "SS", - PaymentLinksResourceShippingAddressCollectionAllowedCountries::St => "ST", - PaymentLinksResourceShippingAddressCollectionAllowedCountries::Sv => "SV", - PaymentLinksResourceShippingAddressCollectionAllowedCountries::Sx => "SX", - PaymentLinksResourceShippingAddressCollectionAllowedCountries::Sz => "SZ", - PaymentLinksResourceShippingAddressCollectionAllowedCountries::Ta => "TA", - PaymentLinksResourceShippingAddressCollectionAllowedCountries::Tc => "TC", - PaymentLinksResourceShippingAddressCollectionAllowedCountries::Td => "TD", - PaymentLinksResourceShippingAddressCollectionAllowedCountries::Tf => "TF", - PaymentLinksResourceShippingAddressCollectionAllowedCountries::Tg => "TG", - PaymentLinksResourceShippingAddressCollectionAllowedCountries::Th => "TH", - PaymentLinksResourceShippingAddressCollectionAllowedCountries::Tj => "TJ", - PaymentLinksResourceShippingAddressCollectionAllowedCountries::Tk => "TK", - PaymentLinksResourceShippingAddressCollectionAllowedCountries::Tl => "TL", - PaymentLinksResourceShippingAddressCollectionAllowedCountries::Tm => "TM", - PaymentLinksResourceShippingAddressCollectionAllowedCountries::Tn => "TN", - PaymentLinksResourceShippingAddressCollectionAllowedCountries::To => "TO", - PaymentLinksResourceShippingAddressCollectionAllowedCountries::Tr => "TR", - PaymentLinksResourceShippingAddressCollectionAllowedCountries::Tt => "TT", - PaymentLinksResourceShippingAddressCollectionAllowedCountries::Tv => "TV", - PaymentLinksResourceShippingAddressCollectionAllowedCountries::Tw => "TW", - PaymentLinksResourceShippingAddressCollectionAllowedCountries::Tz => "TZ", - PaymentLinksResourceShippingAddressCollectionAllowedCountries::Ua => "UA", - PaymentLinksResourceShippingAddressCollectionAllowedCountries::Ug => "UG", - PaymentLinksResourceShippingAddressCollectionAllowedCountries::Us => "US", - PaymentLinksResourceShippingAddressCollectionAllowedCountries::Uy => "UY", - PaymentLinksResourceShippingAddressCollectionAllowedCountries::Uz => "UZ", - PaymentLinksResourceShippingAddressCollectionAllowedCountries::Va => "VA", - PaymentLinksResourceShippingAddressCollectionAllowedCountries::Vc => "VC", - PaymentLinksResourceShippingAddressCollectionAllowedCountries::Ve => "VE", - PaymentLinksResourceShippingAddressCollectionAllowedCountries::Vg => "VG", - PaymentLinksResourceShippingAddressCollectionAllowedCountries::Vn => "VN", - PaymentLinksResourceShippingAddressCollectionAllowedCountries::Vu => "VU", - PaymentLinksResourceShippingAddressCollectionAllowedCountries::Wf => "WF", - PaymentLinksResourceShippingAddressCollectionAllowedCountries::Ws => "WS", - PaymentLinksResourceShippingAddressCollectionAllowedCountries::Xk => "XK", - PaymentLinksResourceShippingAddressCollectionAllowedCountries::Ye => "YE", - PaymentLinksResourceShippingAddressCollectionAllowedCountries::Yt => "YT", - PaymentLinksResourceShippingAddressCollectionAllowedCountries::Za => "ZA", - PaymentLinksResourceShippingAddressCollectionAllowedCountries::Zm => "ZM", - PaymentLinksResourceShippingAddressCollectionAllowedCountries::Zw => "ZW", - PaymentLinksResourceShippingAddressCollectionAllowedCountries::Zz => "ZZ", - } - } -} - -impl AsRef for PaymentLinksResourceShippingAddressCollectionAllowedCountries { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for PaymentLinksResourceShippingAddressCollectionAllowedCountries { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for PaymentLinksResourceShippingAddressCollectionAllowedCountries { - fn default() -> Self { - Self::Ac - } -} - -/// An enum representing the possible values of an `UpdatePaymentLinkAfterCompletion`'s `type` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum UpdatePaymentLinkAfterCompletionType { - HostedConfirmation, - Redirect, -} - -impl UpdatePaymentLinkAfterCompletionType { - pub fn as_str(self) -> &'static str { - match self { - UpdatePaymentLinkAfterCompletionType::HostedConfirmation => "hosted_confirmation", - UpdatePaymentLinkAfterCompletionType::Redirect => "redirect", - } - } -} - -impl AsRef for UpdatePaymentLinkAfterCompletionType { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for UpdatePaymentLinkAfterCompletionType { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for UpdatePaymentLinkAfterCompletionType { - fn default() -> Self { - Self::HostedConfirmation - } -} - -/// An enum representing the possible values of an `UpdatePaymentLinkAutomaticTaxLiability`'s `type` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum UpdatePaymentLinkAutomaticTaxLiabilityType { - Account, - #[serde(rename = "self")] - Self_, -} - -impl UpdatePaymentLinkAutomaticTaxLiabilityType { - pub fn as_str(self) -> &'static str { - match self { - UpdatePaymentLinkAutomaticTaxLiabilityType::Account => "account", - UpdatePaymentLinkAutomaticTaxLiabilityType::Self_ => "self", - } - } -} - -impl AsRef for UpdatePaymentLinkAutomaticTaxLiabilityType { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for UpdatePaymentLinkAutomaticTaxLiabilityType { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for UpdatePaymentLinkAutomaticTaxLiabilityType { - fn default() -> Self { - Self::Account - } -} - -/// An enum representing the possible values of an `UpdatePaymentLinkCustomFieldsLabel`'s `type` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum UpdatePaymentLinkCustomFieldsLabelType { - Custom, -} - -impl UpdatePaymentLinkCustomFieldsLabelType { - pub fn as_str(self) -> &'static str { - match self { - UpdatePaymentLinkCustomFieldsLabelType::Custom => "custom", - } - } -} - -impl AsRef for UpdatePaymentLinkCustomFieldsLabelType { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for UpdatePaymentLinkCustomFieldsLabelType { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for UpdatePaymentLinkCustomFieldsLabelType { - fn default() -> Self { - Self::Custom - } -} - -/// An enum representing the possible values of an `UpdatePaymentLinkCustomFields`'s `type` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum UpdatePaymentLinkCustomFieldsType { - Dropdown, - Numeric, - Text, -} - -impl UpdatePaymentLinkCustomFieldsType { - pub fn as_str(self) -> &'static str { - match self { - UpdatePaymentLinkCustomFieldsType::Dropdown => "dropdown", - UpdatePaymentLinkCustomFieldsType::Numeric => "numeric", - UpdatePaymentLinkCustomFieldsType::Text => "text", - } - } -} - -impl AsRef for UpdatePaymentLinkCustomFieldsType { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for UpdatePaymentLinkCustomFieldsType { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for UpdatePaymentLinkCustomFieldsType { - fn default() -> Self { - Self::Dropdown - } -} - -/// An enum representing the possible values of an `UpdatePaymentLinkInvoiceCreationInvoiceDataIssuer`'s `type` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum UpdatePaymentLinkInvoiceCreationInvoiceDataIssuerType { - Account, - #[serde(rename = "self")] - Self_, -} - -impl UpdatePaymentLinkInvoiceCreationInvoiceDataIssuerType { - pub fn as_str(self) -> &'static str { - match self { - UpdatePaymentLinkInvoiceCreationInvoiceDataIssuerType::Account => "account", - UpdatePaymentLinkInvoiceCreationInvoiceDataIssuerType::Self_ => "self", - } - } -} - -impl AsRef for UpdatePaymentLinkInvoiceCreationInvoiceDataIssuerType { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for UpdatePaymentLinkInvoiceCreationInvoiceDataIssuerType { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for UpdatePaymentLinkInvoiceCreationInvoiceDataIssuerType { - fn default() -> Self { - Self::Account - } -} - -/// An enum representing the possible values of an `UpdatePaymentLinkInvoiceCreationInvoiceDataRenderingOptions`'s `amount_tax_display` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum UpdatePaymentLinkInvoiceCreationInvoiceDataRenderingOptionsAmountTaxDisplay { - ExcludeTax, - IncludeInclusiveTax, -} - -impl UpdatePaymentLinkInvoiceCreationInvoiceDataRenderingOptionsAmountTaxDisplay { - pub fn as_str(self) -> &'static str { - match self { - UpdatePaymentLinkInvoiceCreationInvoiceDataRenderingOptionsAmountTaxDisplay::ExcludeTax => "exclude_tax", - UpdatePaymentLinkInvoiceCreationInvoiceDataRenderingOptionsAmountTaxDisplay::IncludeInclusiveTax => "include_inclusive_tax", - } - } -} - -impl AsRef for UpdatePaymentLinkInvoiceCreationInvoiceDataRenderingOptionsAmountTaxDisplay { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display - for UpdatePaymentLinkInvoiceCreationInvoiceDataRenderingOptionsAmountTaxDisplay -{ - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default - for UpdatePaymentLinkInvoiceCreationInvoiceDataRenderingOptionsAmountTaxDisplay -{ - fn default() -> Self { - Self::ExcludeTax - } -} - -/// An enum representing the possible values of an `UpdatePaymentLink`'s `payment_method_types` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum UpdatePaymentLinkPaymentMethodTypes { - Affirm, - AfterpayClearpay, - Alipay, - AuBecsDebit, - BacsDebit, - Bancontact, - Blik, - Boleto, - Card, - Cashapp, - Eps, - Fpx, - Giropay, - Grabpay, - Ideal, - Klarna, - Konbini, - Link, - Oxxo, - P24, - Paynow, - Paypal, - Pix, - Promptpay, - SepaDebit, - Sofort, - Swish, - UsBankAccount, - WechatPay, -} - -impl UpdatePaymentLinkPaymentMethodTypes { - pub fn as_str(self) -> &'static str { - match self { - UpdatePaymentLinkPaymentMethodTypes::Affirm => "affirm", - UpdatePaymentLinkPaymentMethodTypes::AfterpayClearpay => "afterpay_clearpay", - UpdatePaymentLinkPaymentMethodTypes::Alipay => "alipay", - UpdatePaymentLinkPaymentMethodTypes::AuBecsDebit => "au_becs_debit", - UpdatePaymentLinkPaymentMethodTypes::BacsDebit => "bacs_debit", - UpdatePaymentLinkPaymentMethodTypes::Bancontact => "bancontact", - UpdatePaymentLinkPaymentMethodTypes::Blik => "blik", - UpdatePaymentLinkPaymentMethodTypes::Boleto => "boleto", - UpdatePaymentLinkPaymentMethodTypes::Card => "card", - UpdatePaymentLinkPaymentMethodTypes::Cashapp => "cashapp", - UpdatePaymentLinkPaymentMethodTypes::Eps => "eps", - UpdatePaymentLinkPaymentMethodTypes::Fpx => "fpx", - UpdatePaymentLinkPaymentMethodTypes::Giropay => "giropay", - UpdatePaymentLinkPaymentMethodTypes::Grabpay => "grabpay", - UpdatePaymentLinkPaymentMethodTypes::Ideal => "ideal", - UpdatePaymentLinkPaymentMethodTypes::Klarna => "klarna", - UpdatePaymentLinkPaymentMethodTypes::Konbini => "konbini", - UpdatePaymentLinkPaymentMethodTypes::Link => "link", - UpdatePaymentLinkPaymentMethodTypes::Oxxo => "oxxo", - UpdatePaymentLinkPaymentMethodTypes::P24 => "p24", - UpdatePaymentLinkPaymentMethodTypes::Paynow => "paynow", - UpdatePaymentLinkPaymentMethodTypes::Paypal => "paypal", - UpdatePaymentLinkPaymentMethodTypes::Pix => "pix", - UpdatePaymentLinkPaymentMethodTypes::Promptpay => "promptpay", - UpdatePaymentLinkPaymentMethodTypes::SepaDebit => "sepa_debit", - UpdatePaymentLinkPaymentMethodTypes::Sofort => "sofort", - UpdatePaymentLinkPaymentMethodTypes::Swish => "swish", - UpdatePaymentLinkPaymentMethodTypes::UsBankAccount => "us_bank_account", - UpdatePaymentLinkPaymentMethodTypes::WechatPay => "wechat_pay", - } - } -} - -impl AsRef for UpdatePaymentLinkPaymentMethodTypes { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for UpdatePaymentLinkPaymentMethodTypes { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for UpdatePaymentLinkPaymentMethodTypes { - fn default() -> Self { - Self::Affirm - } -} - -/// An enum representing the possible values of an `UpdatePaymentLinkShippingAddressCollection`'s `allowed_countries` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum UpdatePaymentLinkShippingAddressCollectionAllowedCountries { - #[serde(rename = "AC")] - Ac, - #[serde(rename = "AD")] - Ad, - #[serde(rename = "AE")] - Ae, - #[serde(rename = "AF")] - Af, - #[serde(rename = "AG")] - Ag, - #[serde(rename = "AI")] - Ai, - #[serde(rename = "AL")] - Al, - #[serde(rename = "AM")] - Am, - #[serde(rename = "AO")] - Ao, - #[serde(rename = "AQ")] - Aq, - #[serde(rename = "AR")] - Ar, - #[serde(rename = "AT")] - At, - #[serde(rename = "AU")] - Au, - #[serde(rename = "AW")] - Aw, - #[serde(rename = "AX")] - Ax, - #[serde(rename = "AZ")] - Az, - #[serde(rename = "BA")] - Ba, - #[serde(rename = "BB")] - Bb, - #[serde(rename = "BD")] - Bd, - #[serde(rename = "BE")] - Be, - #[serde(rename = "BF")] - Bf, - #[serde(rename = "BG")] - Bg, - #[serde(rename = "BH")] - Bh, - #[serde(rename = "BI")] - Bi, - #[serde(rename = "BJ")] - Bj, - #[serde(rename = "BL")] - Bl, - #[serde(rename = "BM")] - Bm, - #[serde(rename = "BN")] - Bn, - #[serde(rename = "BO")] - Bo, - #[serde(rename = "BQ")] - Bq, - #[serde(rename = "BR")] - Br, - #[serde(rename = "BS")] - Bs, - #[serde(rename = "BT")] - Bt, - #[serde(rename = "BV")] - Bv, - #[serde(rename = "BW")] - Bw, - #[serde(rename = "BY")] - By, - #[serde(rename = "BZ")] - Bz, - #[serde(rename = "CA")] - Ca, - #[serde(rename = "CD")] - Cd, - #[serde(rename = "CF")] - Cf, - #[serde(rename = "CG")] - Cg, - #[serde(rename = "CH")] - Ch, - #[serde(rename = "CI")] - Ci, - #[serde(rename = "CK")] - Ck, - #[serde(rename = "CL")] - Cl, - #[serde(rename = "CM")] - Cm, - #[serde(rename = "CN")] - Cn, - #[serde(rename = "CO")] - Co, - #[serde(rename = "CR")] - Cr, - #[serde(rename = "CV")] - Cv, - #[serde(rename = "CW")] - Cw, - #[serde(rename = "CY")] - Cy, - #[serde(rename = "CZ")] - Cz, - #[serde(rename = "DE")] - De, - #[serde(rename = "DJ")] - Dj, - #[serde(rename = "DK")] - Dk, - #[serde(rename = "DM")] - Dm, - #[serde(rename = "DO")] - Do, - #[serde(rename = "DZ")] - Dz, - #[serde(rename = "EC")] - Ec, - #[serde(rename = "EE")] - Ee, - #[serde(rename = "EG")] - Eg, - #[serde(rename = "EH")] - Eh, - #[serde(rename = "ER")] - Er, - #[serde(rename = "ES")] - Es, - #[serde(rename = "ET")] - Et, - #[serde(rename = "FI")] - Fi, - #[serde(rename = "FJ")] - Fj, - #[serde(rename = "FK")] - Fk, - #[serde(rename = "FO")] - Fo, - #[serde(rename = "FR")] - Fr, - #[serde(rename = "GA")] - Ga, - #[serde(rename = "GB")] - Gb, - #[serde(rename = "GD")] - Gd, - #[serde(rename = "GE")] - Ge, - #[serde(rename = "GF")] - Gf, - #[serde(rename = "GG")] - Gg, - #[serde(rename = "GH")] - Gh, - #[serde(rename = "GI")] - Gi, - #[serde(rename = "GL")] - Gl, - #[serde(rename = "GM")] - Gm, - #[serde(rename = "GN")] - Gn, - #[serde(rename = "GP")] - Gp, - #[serde(rename = "GQ")] - Gq, - #[serde(rename = "GR")] - Gr, - #[serde(rename = "GS")] - Gs, - #[serde(rename = "GT")] - Gt, - #[serde(rename = "GU")] - Gu, - #[serde(rename = "GW")] - Gw, - #[serde(rename = "GY")] - Gy, - #[serde(rename = "HK")] - Hk, - #[serde(rename = "HN")] - Hn, - #[serde(rename = "HR")] - Hr, - #[serde(rename = "HT")] - Ht, - #[serde(rename = "HU")] - Hu, - #[serde(rename = "ID")] - Id, - #[serde(rename = "IE")] - Ie, - #[serde(rename = "IL")] - Il, - #[serde(rename = "IM")] - Im, - #[serde(rename = "IN")] - In, - #[serde(rename = "IO")] - Io, - #[serde(rename = "IQ")] - Iq, - #[serde(rename = "IS")] - Is, - #[serde(rename = "IT")] - It, - #[serde(rename = "JE")] - Je, - #[serde(rename = "JM")] - Jm, - #[serde(rename = "JO")] - Jo, - #[serde(rename = "JP")] - Jp, - #[serde(rename = "KE")] - Ke, - #[serde(rename = "KG")] - Kg, - #[serde(rename = "KH")] - Kh, - #[serde(rename = "KI")] - Ki, - #[serde(rename = "KM")] - Km, - #[serde(rename = "KN")] - Kn, - #[serde(rename = "KR")] - Kr, - #[serde(rename = "KW")] - Kw, - #[serde(rename = "KY")] - Ky, - #[serde(rename = "KZ")] - Kz, - #[serde(rename = "LA")] - La, - #[serde(rename = "LB")] - Lb, - #[serde(rename = "LC")] - Lc, - #[serde(rename = "LI")] - Li, - #[serde(rename = "LK")] - Lk, - #[serde(rename = "LR")] - Lr, - #[serde(rename = "LS")] - Ls, - #[serde(rename = "LT")] - Lt, - #[serde(rename = "LU")] - Lu, - #[serde(rename = "LV")] - Lv, - #[serde(rename = "LY")] - Ly, - #[serde(rename = "MA")] - Ma, - #[serde(rename = "MC")] - Mc, - #[serde(rename = "MD")] - Md, - #[serde(rename = "ME")] - Me, - #[serde(rename = "MF")] - Mf, - #[serde(rename = "MG")] - Mg, - #[serde(rename = "MK")] - Mk, - #[serde(rename = "ML")] - Ml, - #[serde(rename = "MM")] - Mm, - #[serde(rename = "MN")] - Mn, - #[serde(rename = "MO")] - Mo, - #[serde(rename = "MQ")] - Mq, - #[serde(rename = "MR")] - Mr, - #[serde(rename = "MS")] - Ms, - #[serde(rename = "MT")] - Mt, - #[serde(rename = "MU")] - Mu, - #[serde(rename = "MV")] - Mv, - #[serde(rename = "MW")] - Mw, - #[serde(rename = "MX")] - Mx, - #[serde(rename = "MY")] - My, - #[serde(rename = "MZ")] - Mz, - #[serde(rename = "NA")] - Na, - #[serde(rename = "NC")] - Nc, - #[serde(rename = "NE")] - Ne, - #[serde(rename = "NG")] - Ng, - #[serde(rename = "NI")] - Ni, - #[serde(rename = "NL")] - Nl, - #[serde(rename = "NO")] - No, - #[serde(rename = "NP")] - Np, - #[serde(rename = "NR")] - Nr, - #[serde(rename = "NU")] - Nu, - #[serde(rename = "NZ")] - Nz, - #[serde(rename = "OM")] - Om, - #[serde(rename = "PA")] - Pa, - #[serde(rename = "PE")] - Pe, - #[serde(rename = "PF")] - Pf, - #[serde(rename = "PG")] - Pg, - #[serde(rename = "PH")] - Ph, - #[serde(rename = "PK")] - Pk, - #[serde(rename = "PL")] - Pl, - #[serde(rename = "PM")] - Pm, - #[serde(rename = "PN")] - Pn, - #[serde(rename = "PR")] - Pr, - #[serde(rename = "PS")] - Ps, - #[serde(rename = "PT")] - Pt, - #[serde(rename = "PY")] - Py, - #[serde(rename = "QA")] - Qa, - #[serde(rename = "RE")] - Re, - #[serde(rename = "RO")] - Ro, - #[serde(rename = "RS")] - Rs, - #[serde(rename = "RU")] - Ru, - #[serde(rename = "RW")] - Rw, - #[serde(rename = "SA")] - Sa, - #[serde(rename = "SB")] - Sb, - #[serde(rename = "SC")] - Sc, - #[serde(rename = "SE")] - Se, - #[serde(rename = "SG")] - Sg, - #[serde(rename = "SH")] - Sh, - #[serde(rename = "SI")] - Si, - #[serde(rename = "SJ")] - Sj, - #[serde(rename = "SK")] - Sk, - #[serde(rename = "SL")] - Sl, - #[serde(rename = "SM")] - Sm, - #[serde(rename = "SN")] - Sn, - #[serde(rename = "SO")] - So, - #[serde(rename = "SR")] - Sr, - #[serde(rename = "SS")] - Ss, - #[serde(rename = "ST")] - St, - #[serde(rename = "SV")] - Sv, - #[serde(rename = "SX")] - Sx, - #[serde(rename = "SZ")] - Sz, - #[serde(rename = "TA")] - Ta, - #[serde(rename = "TC")] - Tc, - #[serde(rename = "TD")] - Td, - #[serde(rename = "TF")] - Tf, - #[serde(rename = "TG")] - Tg, - #[serde(rename = "TH")] - Th, - #[serde(rename = "TJ")] - Tj, - #[serde(rename = "TK")] - Tk, - #[serde(rename = "TL")] - Tl, - #[serde(rename = "TM")] - Tm, - #[serde(rename = "TN")] - Tn, - #[serde(rename = "TO")] - To, - #[serde(rename = "TR")] - Tr, - #[serde(rename = "TT")] - Tt, - #[serde(rename = "TV")] - Tv, - #[serde(rename = "TW")] - Tw, - #[serde(rename = "TZ")] - Tz, - #[serde(rename = "UA")] - Ua, - #[serde(rename = "UG")] - Ug, - #[serde(rename = "US")] - Us, - #[serde(rename = "UY")] - Uy, - #[serde(rename = "UZ")] - Uz, - #[serde(rename = "VA")] - Va, - #[serde(rename = "VC")] - Vc, - #[serde(rename = "VE")] - Ve, - #[serde(rename = "VG")] - Vg, - #[serde(rename = "VN")] - Vn, - #[serde(rename = "VU")] - Vu, - #[serde(rename = "WF")] - Wf, - #[serde(rename = "WS")] - Ws, - #[serde(rename = "XK")] - Xk, - #[serde(rename = "YE")] - Ye, - #[serde(rename = "YT")] - Yt, - #[serde(rename = "ZA")] - Za, - #[serde(rename = "ZM")] - Zm, - #[serde(rename = "ZW")] - Zw, - #[serde(rename = "ZZ")] - Zz, -} - -impl UpdatePaymentLinkShippingAddressCollectionAllowedCountries { - pub fn as_str(self) -> &'static str { - match self { - UpdatePaymentLinkShippingAddressCollectionAllowedCountries::Ac => "AC", - UpdatePaymentLinkShippingAddressCollectionAllowedCountries::Ad => "AD", - UpdatePaymentLinkShippingAddressCollectionAllowedCountries::Ae => "AE", - UpdatePaymentLinkShippingAddressCollectionAllowedCountries::Af => "AF", - UpdatePaymentLinkShippingAddressCollectionAllowedCountries::Ag => "AG", - UpdatePaymentLinkShippingAddressCollectionAllowedCountries::Ai => "AI", - UpdatePaymentLinkShippingAddressCollectionAllowedCountries::Al => "AL", - UpdatePaymentLinkShippingAddressCollectionAllowedCountries::Am => "AM", - UpdatePaymentLinkShippingAddressCollectionAllowedCountries::Ao => "AO", - UpdatePaymentLinkShippingAddressCollectionAllowedCountries::Aq => "AQ", - UpdatePaymentLinkShippingAddressCollectionAllowedCountries::Ar => "AR", - UpdatePaymentLinkShippingAddressCollectionAllowedCountries::At => "AT", - UpdatePaymentLinkShippingAddressCollectionAllowedCountries::Au => "AU", - UpdatePaymentLinkShippingAddressCollectionAllowedCountries::Aw => "AW", - UpdatePaymentLinkShippingAddressCollectionAllowedCountries::Ax => "AX", - UpdatePaymentLinkShippingAddressCollectionAllowedCountries::Az => "AZ", - UpdatePaymentLinkShippingAddressCollectionAllowedCountries::Ba => "BA", - UpdatePaymentLinkShippingAddressCollectionAllowedCountries::Bb => "BB", - UpdatePaymentLinkShippingAddressCollectionAllowedCountries::Bd => "BD", - UpdatePaymentLinkShippingAddressCollectionAllowedCountries::Be => "BE", - UpdatePaymentLinkShippingAddressCollectionAllowedCountries::Bf => "BF", - UpdatePaymentLinkShippingAddressCollectionAllowedCountries::Bg => "BG", - UpdatePaymentLinkShippingAddressCollectionAllowedCountries::Bh => "BH", - UpdatePaymentLinkShippingAddressCollectionAllowedCountries::Bi => "BI", - UpdatePaymentLinkShippingAddressCollectionAllowedCountries::Bj => "BJ", - UpdatePaymentLinkShippingAddressCollectionAllowedCountries::Bl => "BL", - UpdatePaymentLinkShippingAddressCollectionAllowedCountries::Bm => "BM", - UpdatePaymentLinkShippingAddressCollectionAllowedCountries::Bn => "BN", - UpdatePaymentLinkShippingAddressCollectionAllowedCountries::Bo => "BO", - UpdatePaymentLinkShippingAddressCollectionAllowedCountries::Bq => "BQ", - UpdatePaymentLinkShippingAddressCollectionAllowedCountries::Br => "BR", - UpdatePaymentLinkShippingAddressCollectionAllowedCountries::Bs => "BS", - UpdatePaymentLinkShippingAddressCollectionAllowedCountries::Bt => "BT", - UpdatePaymentLinkShippingAddressCollectionAllowedCountries::Bv => "BV", - UpdatePaymentLinkShippingAddressCollectionAllowedCountries::Bw => "BW", - UpdatePaymentLinkShippingAddressCollectionAllowedCountries::By => "BY", - UpdatePaymentLinkShippingAddressCollectionAllowedCountries::Bz => "BZ", - UpdatePaymentLinkShippingAddressCollectionAllowedCountries::Ca => "CA", - UpdatePaymentLinkShippingAddressCollectionAllowedCountries::Cd => "CD", - UpdatePaymentLinkShippingAddressCollectionAllowedCountries::Cf => "CF", - UpdatePaymentLinkShippingAddressCollectionAllowedCountries::Cg => "CG", - UpdatePaymentLinkShippingAddressCollectionAllowedCountries::Ch => "CH", - UpdatePaymentLinkShippingAddressCollectionAllowedCountries::Ci => "CI", - UpdatePaymentLinkShippingAddressCollectionAllowedCountries::Ck => "CK", - UpdatePaymentLinkShippingAddressCollectionAllowedCountries::Cl => "CL", - UpdatePaymentLinkShippingAddressCollectionAllowedCountries::Cm => "CM", - UpdatePaymentLinkShippingAddressCollectionAllowedCountries::Cn => "CN", - UpdatePaymentLinkShippingAddressCollectionAllowedCountries::Co => "CO", - UpdatePaymentLinkShippingAddressCollectionAllowedCountries::Cr => "CR", - UpdatePaymentLinkShippingAddressCollectionAllowedCountries::Cv => "CV", - UpdatePaymentLinkShippingAddressCollectionAllowedCountries::Cw => "CW", - UpdatePaymentLinkShippingAddressCollectionAllowedCountries::Cy => "CY", - UpdatePaymentLinkShippingAddressCollectionAllowedCountries::Cz => "CZ", - UpdatePaymentLinkShippingAddressCollectionAllowedCountries::De => "DE", - UpdatePaymentLinkShippingAddressCollectionAllowedCountries::Dj => "DJ", - UpdatePaymentLinkShippingAddressCollectionAllowedCountries::Dk => "DK", - UpdatePaymentLinkShippingAddressCollectionAllowedCountries::Dm => "DM", - UpdatePaymentLinkShippingAddressCollectionAllowedCountries::Do => "DO", - UpdatePaymentLinkShippingAddressCollectionAllowedCountries::Dz => "DZ", - UpdatePaymentLinkShippingAddressCollectionAllowedCountries::Ec => "EC", - UpdatePaymentLinkShippingAddressCollectionAllowedCountries::Ee => "EE", - UpdatePaymentLinkShippingAddressCollectionAllowedCountries::Eg => "EG", - UpdatePaymentLinkShippingAddressCollectionAllowedCountries::Eh => "EH", - UpdatePaymentLinkShippingAddressCollectionAllowedCountries::Er => "ER", - UpdatePaymentLinkShippingAddressCollectionAllowedCountries::Es => "ES", - UpdatePaymentLinkShippingAddressCollectionAllowedCountries::Et => "ET", - UpdatePaymentLinkShippingAddressCollectionAllowedCountries::Fi => "FI", - UpdatePaymentLinkShippingAddressCollectionAllowedCountries::Fj => "FJ", - UpdatePaymentLinkShippingAddressCollectionAllowedCountries::Fk => "FK", - UpdatePaymentLinkShippingAddressCollectionAllowedCountries::Fo => "FO", - UpdatePaymentLinkShippingAddressCollectionAllowedCountries::Fr => "FR", - UpdatePaymentLinkShippingAddressCollectionAllowedCountries::Ga => "GA", - UpdatePaymentLinkShippingAddressCollectionAllowedCountries::Gb => "GB", - UpdatePaymentLinkShippingAddressCollectionAllowedCountries::Gd => "GD", - UpdatePaymentLinkShippingAddressCollectionAllowedCountries::Ge => "GE", - UpdatePaymentLinkShippingAddressCollectionAllowedCountries::Gf => "GF", - UpdatePaymentLinkShippingAddressCollectionAllowedCountries::Gg => "GG", - UpdatePaymentLinkShippingAddressCollectionAllowedCountries::Gh => "GH", - UpdatePaymentLinkShippingAddressCollectionAllowedCountries::Gi => "GI", - UpdatePaymentLinkShippingAddressCollectionAllowedCountries::Gl => "GL", - UpdatePaymentLinkShippingAddressCollectionAllowedCountries::Gm => "GM", - UpdatePaymentLinkShippingAddressCollectionAllowedCountries::Gn => "GN", - UpdatePaymentLinkShippingAddressCollectionAllowedCountries::Gp => "GP", - UpdatePaymentLinkShippingAddressCollectionAllowedCountries::Gq => "GQ", - UpdatePaymentLinkShippingAddressCollectionAllowedCountries::Gr => "GR", - UpdatePaymentLinkShippingAddressCollectionAllowedCountries::Gs => "GS", - UpdatePaymentLinkShippingAddressCollectionAllowedCountries::Gt => "GT", - UpdatePaymentLinkShippingAddressCollectionAllowedCountries::Gu => "GU", - UpdatePaymentLinkShippingAddressCollectionAllowedCountries::Gw => "GW", - UpdatePaymentLinkShippingAddressCollectionAllowedCountries::Gy => "GY", - UpdatePaymentLinkShippingAddressCollectionAllowedCountries::Hk => "HK", - UpdatePaymentLinkShippingAddressCollectionAllowedCountries::Hn => "HN", - UpdatePaymentLinkShippingAddressCollectionAllowedCountries::Hr => "HR", - UpdatePaymentLinkShippingAddressCollectionAllowedCountries::Ht => "HT", - UpdatePaymentLinkShippingAddressCollectionAllowedCountries::Hu => "HU", - UpdatePaymentLinkShippingAddressCollectionAllowedCountries::Id => "ID", - UpdatePaymentLinkShippingAddressCollectionAllowedCountries::Ie => "IE", - UpdatePaymentLinkShippingAddressCollectionAllowedCountries::Il => "IL", - UpdatePaymentLinkShippingAddressCollectionAllowedCountries::Im => "IM", - UpdatePaymentLinkShippingAddressCollectionAllowedCountries::In => "IN", - UpdatePaymentLinkShippingAddressCollectionAllowedCountries::Io => "IO", - UpdatePaymentLinkShippingAddressCollectionAllowedCountries::Iq => "IQ", - UpdatePaymentLinkShippingAddressCollectionAllowedCountries::Is => "IS", - UpdatePaymentLinkShippingAddressCollectionAllowedCountries::It => "IT", - UpdatePaymentLinkShippingAddressCollectionAllowedCountries::Je => "JE", - UpdatePaymentLinkShippingAddressCollectionAllowedCountries::Jm => "JM", - UpdatePaymentLinkShippingAddressCollectionAllowedCountries::Jo => "JO", - UpdatePaymentLinkShippingAddressCollectionAllowedCountries::Jp => "JP", - UpdatePaymentLinkShippingAddressCollectionAllowedCountries::Ke => "KE", - UpdatePaymentLinkShippingAddressCollectionAllowedCountries::Kg => "KG", - UpdatePaymentLinkShippingAddressCollectionAllowedCountries::Kh => "KH", - UpdatePaymentLinkShippingAddressCollectionAllowedCountries::Ki => "KI", - UpdatePaymentLinkShippingAddressCollectionAllowedCountries::Km => "KM", - UpdatePaymentLinkShippingAddressCollectionAllowedCountries::Kn => "KN", - UpdatePaymentLinkShippingAddressCollectionAllowedCountries::Kr => "KR", - UpdatePaymentLinkShippingAddressCollectionAllowedCountries::Kw => "KW", - UpdatePaymentLinkShippingAddressCollectionAllowedCountries::Ky => "KY", - UpdatePaymentLinkShippingAddressCollectionAllowedCountries::Kz => "KZ", - UpdatePaymentLinkShippingAddressCollectionAllowedCountries::La => "LA", - UpdatePaymentLinkShippingAddressCollectionAllowedCountries::Lb => "LB", - UpdatePaymentLinkShippingAddressCollectionAllowedCountries::Lc => "LC", - UpdatePaymentLinkShippingAddressCollectionAllowedCountries::Li => "LI", - UpdatePaymentLinkShippingAddressCollectionAllowedCountries::Lk => "LK", - UpdatePaymentLinkShippingAddressCollectionAllowedCountries::Lr => "LR", - UpdatePaymentLinkShippingAddressCollectionAllowedCountries::Ls => "LS", - UpdatePaymentLinkShippingAddressCollectionAllowedCountries::Lt => "LT", - UpdatePaymentLinkShippingAddressCollectionAllowedCountries::Lu => "LU", - UpdatePaymentLinkShippingAddressCollectionAllowedCountries::Lv => "LV", - UpdatePaymentLinkShippingAddressCollectionAllowedCountries::Ly => "LY", - UpdatePaymentLinkShippingAddressCollectionAllowedCountries::Ma => "MA", - UpdatePaymentLinkShippingAddressCollectionAllowedCountries::Mc => "MC", - UpdatePaymentLinkShippingAddressCollectionAllowedCountries::Md => "MD", - UpdatePaymentLinkShippingAddressCollectionAllowedCountries::Me => "ME", - UpdatePaymentLinkShippingAddressCollectionAllowedCountries::Mf => "MF", - UpdatePaymentLinkShippingAddressCollectionAllowedCountries::Mg => "MG", - UpdatePaymentLinkShippingAddressCollectionAllowedCountries::Mk => "MK", - UpdatePaymentLinkShippingAddressCollectionAllowedCountries::Ml => "ML", - UpdatePaymentLinkShippingAddressCollectionAllowedCountries::Mm => "MM", - UpdatePaymentLinkShippingAddressCollectionAllowedCountries::Mn => "MN", - UpdatePaymentLinkShippingAddressCollectionAllowedCountries::Mo => "MO", - UpdatePaymentLinkShippingAddressCollectionAllowedCountries::Mq => "MQ", - UpdatePaymentLinkShippingAddressCollectionAllowedCountries::Mr => "MR", - UpdatePaymentLinkShippingAddressCollectionAllowedCountries::Ms => "MS", - UpdatePaymentLinkShippingAddressCollectionAllowedCountries::Mt => "MT", - UpdatePaymentLinkShippingAddressCollectionAllowedCountries::Mu => "MU", - UpdatePaymentLinkShippingAddressCollectionAllowedCountries::Mv => "MV", - UpdatePaymentLinkShippingAddressCollectionAllowedCountries::Mw => "MW", - UpdatePaymentLinkShippingAddressCollectionAllowedCountries::Mx => "MX", - UpdatePaymentLinkShippingAddressCollectionAllowedCountries::My => "MY", - UpdatePaymentLinkShippingAddressCollectionAllowedCountries::Mz => "MZ", - UpdatePaymentLinkShippingAddressCollectionAllowedCountries::Na => "NA", - UpdatePaymentLinkShippingAddressCollectionAllowedCountries::Nc => "NC", - UpdatePaymentLinkShippingAddressCollectionAllowedCountries::Ne => "NE", - UpdatePaymentLinkShippingAddressCollectionAllowedCountries::Ng => "NG", - UpdatePaymentLinkShippingAddressCollectionAllowedCountries::Ni => "NI", - UpdatePaymentLinkShippingAddressCollectionAllowedCountries::Nl => "NL", - UpdatePaymentLinkShippingAddressCollectionAllowedCountries::No => "NO", - UpdatePaymentLinkShippingAddressCollectionAllowedCountries::Np => "NP", - UpdatePaymentLinkShippingAddressCollectionAllowedCountries::Nr => "NR", - UpdatePaymentLinkShippingAddressCollectionAllowedCountries::Nu => "NU", - UpdatePaymentLinkShippingAddressCollectionAllowedCountries::Nz => "NZ", - UpdatePaymentLinkShippingAddressCollectionAllowedCountries::Om => "OM", - UpdatePaymentLinkShippingAddressCollectionAllowedCountries::Pa => "PA", - UpdatePaymentLinkShippingAddressCollectionAllowedCountries::Pe => "PE", - UpdatePaymentLinkShippingAddressCollectionAllowedCountries::Pf => "PF", - UpdatePaymentLinkShippingAddressCollectionAllowedCountries::Pg => "PG", - UpdatePaymentLinkShippingAddressCollectionAllowedCountries::Ph => "PH", - UpdatePaymentLinkShippingAddressCollectionAllowedCountries::Pk => "PK", - UpdatePaymentLinkShippingAddressCollectionAllowedCountries::Pl => "PL", - UpdatePaymentLinkShippingAddressCollectionAllowedCountries::Pm => "PM", - UpdatePaymentLinkShippingAddressCollectionAllowedCountries::Pn => "PN", - UpdatePaymentLinkShippingAddressCollectionAllowedCountries::Pr => "PR", - UpdatePaymentLinkShippingAddressCollectionAllowedCountries::Ps => "PS", - UpdatePaymentLinkShippingAddressCollectionAllowedCountries::Pt => "PT", - UpdatePaymentLinkShippingAddressCollectionAllowedCountries::Py => "PY", - UpdatePaymentLinkShippingAddressCollectionAllowedCountries::Qa => "QA", - UpdatePaymentLinkShippingAddressCollectionAllowedCountries::Re => "RE", - UpdatePaymentLinkShippingAddressCollectionAllowedCountries::Ro => "RO", - UpdatePaymentLinkShippingAddressCollectionAllowedCountries::Rs => "RS", - UpdatePaymentLinkShippingAddressCollectionAllowedCountries::Ru => "RU", - UpdatePaymentLinkShippingAddressCollectionAllowedCountries::Rw => "RW", - UpdatePaymentLinkShippingAddressCollectionAllowedCountries::Sa => "SA", - UpdatePaymentLinkShippingAddressCollectionAllowedCountries::Sb => "SB", - UpdatePaymentLinkShippingAddressCollectionAllowedCountries::Sc => "SC", - UpdatePaymentLinkShippingAddressCollectionAllowedCountries::Se => "SE", - UpdatePaymentLinkShippingAddressCollectionAllowedCountries::Sg => "SG", - UpdatePaymentLinkShippingAddressCollectionAllowedCountries::Sh => "SH", - UpdatePaymentLinkShippingAddressCollectionAllowedCountries::Si => "SI", - UpdatePaymentLinkShippingAddressCollectionAllowedCountries::Sj => "SJ", - UpdatePaymentLinkShippingAddressCollectionAllowedCountries::Sk => "SK", - UpdatePaymentLinkShippingAddressCollectionAllowedCountries::Sl => "SL", - UpdatePaymentLinkShippingAddressCollectionAllowedCountries::Sm => "SM", - UpdatePaymentLinkShippingAddressCollectionAllowedCountries::Sn => "SN", - UpdatePaymentLinkShippingAddressCollectionAllowedCountries::So => "SO", - UpdatePaymentLinkShippingAddressCollectionAllowedCountries::Sr => "SR", - UpdatePaymentLinkShippingAddressCollectionAllowedCountries::Ss => "SS", - UpdatePaymentLinkShippingAddressCollectionAllowedCountries::St => "ST", - UpdatePaymentLinkShippingAddressCollectionAllowedCountries::Sv => "SV", - UpdatePaymentLinkShippingAddressCollectionAllowedCountries::Sx => "SX", - UpdatePaymentLinkShippingAddressCollectionAllowedCountries::Sz => "SZ", - UpdatePaymentLinkShippingAddressCollectionAllowedCountries::Ta => "TA", - UpdatePaymentLinkShippingAddressCollectionAllowedCountries::Tc => "TC", - UpdatePaymentLinkShippingAddressCollectionAllowedCountries::Td => "TD", - UpdatePaymentLinkShippingAddressCollectionAllowedCountries::Tf => "TF", - UpdatePaymentLinkShippingAddressCollectionAllowedCountries::Tg => "TG", - UpdatePaymentLinkShippingAddressCollectionAllowedCountries::Th => "TH", - UpdatePaymentLinkShippingAddressCollectionAllowedCountries::Tj => "TJ", - UpdatePaymentLinkShippingAddressCollectionAllowedCountries::Tk => "TK", - UpdatePaymentLinkShippingAddressCollectionAllowedCountries::Tl => "TL", - UpdatePaymentLinkShippingAddressCollectionAllowedCountries::Tm => "TM", - UpdatePaymentLinkShippingAddressCollectionAllowedCountries::Tn => "TN", - UpdatePaymentLinkShippingAddressCollectionAllowedCountries::To => "TO", - UpdatePaymentLinkShippingAddressCollectionAllowedCountries::Tr => "TR", - UpdatePaymentLinkShippingAddressCollectionAllowedCountries::Tt => "TT", - UpdatePaymentLinkShippingAddressCollectionAllowedCountries::Tv => "TV", - UpdatePaymentLinkShippingAddressCollectionAllowedCountries::Tw => "TW", - UpdatePaymentLinkShippingAddressCollectionAllowedCountries::Tz => "TZ", - UpdatePaymentLinkShippingAddressCollectionAllowedCountries::Ua => "UA", - UpdatePaymentLinkShippingAddressCollectionAllowedCountries::Ug => "UG", - UpdatePaymentLinkShippingAddressCollectionAllowedCountries::Us => "US", - UpdatePaymentLinkShippingAddressCollectionAllowedCountries::Uy => "UY", - UpdatePaymentLinkShippingAddressCollectionAllowedCountries::Uz => "UZ", - UpdatePaymentLinkShippingAddressCollectionAllowedCountries::Va => "VA", - UpdatePaymentLinkShippingAddressCollectionAllowedCountries::Vc => "VC", - UpdatePaymentLinkShippingAddressCollectionAllowedCountries::Ve => "VE", - UpdatePaymentLinkShippingAddressCollectionAllowedCountries::Vg => "VG", - UpdatePaymentLinkShippingAddressCollectionAllowedCountries::Vn => "VN", - UpdatePaymentLinkShippingAddressCollectionAllowedCountries::Vu => "VU", - UpdatePaymentLinkShippingAddressCollectionAllowedCountries::Wf => "WF", - UpdatePaymentLinkShippingAddressCollectionAllowedCountries::Ws => "WS", - UpdatePaymentLinkShippingAddressCollectionAllowedCountries::Xk => "XK", - UpdatePaymentLinkShippingAddressCollectionAllowedCountries::Ye => "YE", - UpdatePaymentLinkShippingAddressCollectionAllowedCountries::Yt => "YT", - UpdatePaymentLinkShippingAddressCollectionAllowedCountries::Za => "ZA", - UpdatePaymentLinkShippingAddressCollectionAllowedCountries::Zm => "ZM", - UpdatePaymentLinkShippingAddressCollectionAllowedCountries::Zw => "ZW", - UpdatePaymentLinkShippingAddressCollectionAllowedCountries::Zz => "ZZ", - } - } -} - -impl AsRef for UpdatePaymentLinkShippingAddressCollectionAllowedCountries { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for UpdatePaymentLinkShippingAddressCollectionAllowedCountries { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for UpdatePaymentLinkShippingAddressCollectionAllowedCountries { - fn default() -> Self { - Self::Ac - } -} - -/// An enum representing the possible values of an `UpdatePaymentLinkSubscriptionDataInvoiceSettingsIssuer`'s `type` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum UpdatePaymentLinkSubscriptionDataInvoiceSettingsIssuerType { - Account, - #[serde(rename = "self")] - Self_, -} - -impl UpdatePaymentLinkSubscriptionDataInvoiceSettingsIssuerType { - pub fn as_str(self) -> &'static str { - match self { - UpdatePaymentLinkSubscriptionDataInvoiceSettingsIssuerType::Account => "account", - UpdatePaymentLinkSubscriptionDataInvoiceSettingsIssuerType::Self_ => "self", - } - } -} - -impl AsRef for UpdatePaymentLinkSubscriptionDataInvoiceSettingsIssuerType { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for UpdatePaymentLinkSubscriptionDataInvoiceSettingsIssuerType { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for UpdatePaymentLinkSubscriptionDataInvoiceSettingsIssuerType { - fn default() -> Self { - Self::Account - } -} - -/// An enum representing the possible values of an `UpdatePaymentLinkSubscriptionDataTrialSettingsEndBehavior`'s `missing_payment_method` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum UpdatePaymentLinkSubscriptionDataTrialSettingsEndBehaviorMissingPaymentMethod { - Cancel, - CreateInvoice, - Pause, -} - -impl UpdatePaymentLinkSubscriptionDataTrialSettingsEndBehaviorMissingPaymentMethod { - pub fn as_str(self) -> &'static str { - match self { - UpdatePaymentLinkSubscriptionDataTrialSettingsEndBehaviorMissingPaymentMethod::Cancel => "cancel", - UpdatePaymentLinkSubscriptionDataTrialSettingsEndBehaviorMissingPaymentMethod::CreateInvoice => "create_invoice", - UpdatePaymentLinkSubscriptionDataTrialSettingsEndBehaviorMissingPaymentMethod::Pause => "pause", - } - } -} - -impl AsRef for UpdatePaymentLinkSubscriptionDataTrialSettingsEndBehaviorMissingPaymentMethod { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display - for UpdatePaymentLinkSubscriptionDataTrialSettingsEndBehaviorMissingPaymentMethod -{ - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default - for UpdatePaymentLinkSubscriptionDataTrialSettingsEndBehaviorMissingPaymentMethod -{ - fn default() -> Self { - Self::Cancel - } -} diff --git a/src/resources/generated/payment_link_created.rs b/src/resources/generated/payment_link_created.rs deleted file mode 100644 index 841590083..000000000 --- a/src/resources/generated/payment_link_created.rs +++ /dev/null @@ -1,10 +0,0 @@ -// ====================================== -// This file was automatically generated. -// ====================================== - -use serde::{Deserialize, Serialize}; - -/// The resource representing a Stripe "payment_link.created". -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct PaymentLinkCreated { -} diff --git a/src/resources/generated/payment_link_updated.rs b/src/resources/generated/payment_link_updated.rs deleted file mode 100644 index 4e78d6bb3..000000000 --- a/src/resources/generated/payment_link_updated.rs +++ /dev/null @@ -1,10 +0,0 @@ -// ====================================== -// This file was automatically generated. -// ====================================== - -use serde::{Deserialize, Serialize}; - -/// The resource representing a Stripe "payment_link.updated". -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct PaymentLinkUpdated { -} diff --git a/src/resources/generated/payment_method.rs b/src/resources/generated/payment_method.rs deleted file mode 100644 index 3a23dc401..000000000 --- a/src/resources/generated/payment_method.rs +++ /dev/null @@ -1,2917 +0,0 @@ -// ====================================== -// This file was automatically generated. -// ====================================== - -use serde::{Deserialize, Serialize}; - -use crate::client::{Client, Response}; -use crate::ids::{CustomerId, PaymentMethodId}; -use crate::params::{Expand, Expandable, List, Metadata, Object, Paginable, Timestamp}; -use crate::resources::{ - Address, BillingDetails, Charge, Customer, PaymentMethodCardPresentNetworks, RadarRadarOptions, - SetupAttempt, -}; - -/// The resource representing a Stripe "PaymentMethod". -/// -/// For more details see -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct PaymentMethod { - /// Unique identifier for the object. - pub id: PaymentMethodId, - - #[serde(skip_serializing_if = "Option::is_none")] - pub acss_debit: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub affirm: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub afterpay_clearpay: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub alipay: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub au_becs_debit: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub bacs_debit: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub bancontact: Option, - - pub billing_details: BillingDetails, - - #[serde(skip_serializing_if = "Option::is_none")] - pub blik: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub boleto: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub card: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub card_present: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub cashapp: Option, - - /// Time at which the object was created. - /// - /// Measured in seconds since the Unix epoch. - pub created: Timestamp, - - /// The ID of the Customer to which this PaymentMethod is saved. - /// - /// This will not be set when the PaymentMethod has not been saved to a Customer. - pub customer: Option>, - - #[serde(skip_serializing_if = "Option::is_none")] - pub customer_balance: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub eps: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub fpx: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub giropay: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub grabpay: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub ideal: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub interac_present: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub klarna: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub konbini: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub link: Option, - - /// Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. - pub livemode: bool, - - /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. - /// - /// This can be useful for storing additional information about the object in a structured format. - pub metadata: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub oxxo: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub p24: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub paynow: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub paypal: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub pix: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub promptpay: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub radar_options: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub revolut_pay: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub sepa_debit: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub sofort: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub swish: Option, - - /// The type of the PaymentMethod. - /// - /// An additional hash is included on the PaymentMethod with a name matching this value. - /// It contains additional information specific to the PaymentMethod type. - #[serde(rename = "type")] - pub type_: PaymentMethodType, - - #[serde(skip_serializing_if = "Option::is_none")] - pub us_bank_account: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub wechat_pay: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub zip: Option, -} - -impl PaymentMethod { - /// Returns a list of PaymentMethods for Treasury flows. - /// - /// If you want to list the PaymentMethods attached to a Customer for payments, you should use the [List a Customer’s PaymentMethods](https://stripe.com/docs/api/payment_methods/customer_list) API instead. - pub fn list(client: &Client, params: &ListPaymentMethods<'_>) -> Response> { - client.get_query("/payment_methods", ¶ms) - } - - /// Creates a PaymentMethod object. - /// - /// Read the [Stripe.js reference](https://stripe.com/docs/stripe-js/reference#stripe-create-payment-method) to learn how to create PaymentMethods via Stripe.js. Instead of creating a PaymentMethod directly, we recommend using the [PaymentIntents](https://stripe.com/docs/payments/accept-a-payment) API to accept a payment immediately or the [SetupIntent](https://stripe.com/docs/payments/save-and-reuse) API to collect payment method details ahead of a future payment. - pub fn create(client: &Client, params: CreatePaymentMethod<'_>) -> Response { - client.post_form("/payment_methods", ¶ms) - } - - /// Retrieves a PaymentMethod object attached to the StripeAccount. - /// - /// To retrieve a payment method attached to a Customer, you should use [Retrieve a Customer’s PaymentMethods](https://stripe.com/docs/api/payment_methods/customer). - pub fn retrieve( - client: &Client, - id: &PaymentMethodId, - expand: &[&str], - ) -> Response { - client.get_query(&format!("/payment_methods/{}", id), &Expand { expand }) - } - - /// Updates a PaymentMethod object. - /// - /// A PaymentMethod must be attached a customer to be updated. - pub fn update( - client: &Client, - id: &PaymentMethodId, - params: UpdatePaymentMethod<'_>, - ) -> Response { - client.post_form(&format!("/payment_methods/{}", id), ¶ms) - } -} - -impl Object for PaymentMethod { - type Id = PaymentMethodId; - fn id(&self) -> Self::Id { - self.id.clone() - } - fn object(&self) -> &'static str { - "payment_method" - } -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct PaymentFlowsPrivatePaymentMethodsAlipay {} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct PaymentMethodAcssDebit { - /// Name of the bank associated with the bank account. - pub bank_name: Option, - - /// Uniquely identifies this particular bank account. - /// - /// You can use this attribute to check whether two bank accounts are the same. - pub fingerprint: Option, - - /// Institution number of the bank account. - pub institution_number: Option, - - /// Last four digits of the bank account number. - pub last4: Option, - - /// Transit number of the bank account. - pub transit_number: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct PaymentMethodAffirm {} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct PaymentMethodAfterpayClearpay {} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct PaymentMethodAuBecsDebit { - /// Six-digit number identifying bank and branch associated with this bank account. - pub bsb_number: Option, - - /// Uniquely identifies this particular bank account. - /// - /// You can use this attribute to check whether two bank accounts are the same. - pub fingerprint: Option, - - /// Last four digits of the bank account number. - pub last4: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct PaymentMethodBacsDebit { - /// Uniquely identifies this particular bank account. - /// - /// You can use this attribute to check whether two bank accounts are the same. - pub fingerprint: Option, - - /// Last four digits of the bank account number. - pub last4: Option, - - /// Sort code of the bank account. - /// - /// (e.g., `10-20-30`). - pub sort_code: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct PaymentMethodBancontact {} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct PaymentMethodBlik {} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct PaymentMethodBoleto { - /// Uniquely identifies the customer tax id (CNPJ or CPF). - pub tax_id: String, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CardDetails { - /// Card brand. - /// - /// Can be `amex`, `diners`, `discover`, `eftpos_au`, `jcb`, `mastercard`, `unionpay`, `visa`, or `unknown`. - pub brand: String, - - /// Checks on Card address and CVC if provided. - pub checks: Option, - - /// Two-letter ISO code representing the country of the card. - /// - /// You could use this attribute to get a sense of the international breakdown of cards you've collected. - pub country: Option, - - /// A high-level description of the type of cards issued in this range. - /// - /// (For internal use only and not typically available in standard API requests.). - #[serde(skip_serializing_if = "Option::is_none")] - pub description: Option, - - /// Two-digit number representing the card's expiration month. - pub exp_month: i64, - - /// Four-digit number representing the card's expiration year. - pub exp_year: i64, - - /// Uniquely identifies this particular card number. - /// - /// You can use this attribute to check whether two customers who’ve signed up with you are using the same card number, for example. - /// For payment methods that tokenize card information (Apple Pay, Google Pay), the tokenized number might be provided instead of the underlying card number. *As of May 1, 2021, card fingerprint in India for Connect changed to allow two fingerprints for the same card---one for India and one for the rest of the world.*. - #[serde(skip_serializing_if = "Option::is_none")] - pub fingerprint: Option, - - /// Card funding type. - /// - /// Can be `credit`, `debit`, `prepaid`, or `unknown`. - pub funding: String, - - /// Issuer identification number of the card. - /// - /// (For internal use only and not typically available in standard API requests.). - #[serde(skip_serializing_if = "Option::is_none")] - pub iin: Option, - - /// The name of the card's issuing bank. - /// - /// (For internal use only and not typically available in standard API requests.). - #[serde(skip_serializing_if = "Option::is_none")] - pub issuer: Option, - - /// The last four digits of the card. - pub last4: String, - - /// Contains information about card networks that can be used to process the payment. - pub networks: Option, - - /// Contains details on how this Card may be used for 3D Secure authentication. - pub three_d_secure_usage: Option, - - /// If this Card is part of a card wallet, this contains the details of the card wallet. - pub wallet: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct Networks { - /// All available networks for the card. - pub available: Vec, - - /// The preferred network for co-branded cards. - /// - /// Can be `cartes_bancaires`, `mastercard`, `visa` or `invalid_preference` if requested network is not valid for the card. - pub preferred: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct PaymentMethodCardChecks { - /// If a address line1 was provided, results of the check, one of `pass`, `fail`, `unavailable`, or `unchecked`. - pub address_line1_check: Option, - - /// If a address postal code was provided, results of the check, one of `pass`, `fail`, `unavailable`, or `unchecked`. - pub address_postal_code_check: Option, - - /// If a CVC was provided, results of the check, one of `pass`, `fail`, `unavailable`, or `unchecked`. - pub cvc_check: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CardPresent { - /// Card brand. - /// - /// Can be `amex`, `diners`, `discover`, `eftpos_au`, `jcb`, `mastercard`, `unionpay`, `visa`, or `unknown`. - pub brand: Option, - - /// The cardholder name as read from the card, in [ISO 7813](https://en.wikipedia.org/wiki/ISO/IEC_7813) format. - /// - /// May include alphanumeric characters, special characters and first/last name separator (`/`). - /// In some cases, the cardholder name may not be available depending on how the issuer has configured the card. - /// Cardholder name is typically not available on swipe or contactless payments, such as those made with Apple Pay and Google Pay. - pub cardholder_name: Option, - - /// Two-letter ISO code representing the country of the card. - /// - /// You could use this attribute to get a sense of the international breakdown of cards you've collected. - pub country: Option, - - /// A high-level description of the type of cards issued in this range. - /// - /// (For internal use only and not typically available in standard API requests.). - #[serde(skip_serializing_if = "Option::is_none")] - pub description: Option, - - /// Two-digit number representing the card's expiration month. - pub exp_month: i64, - - /// Four-digit number representing the card's expiration year. - pub exp_year: i64, - - /// Uniquely identifies this particular card number. - /// - /// You can use this attribute to check whether two customers who’ve signed up with you are using the same card number, for example. - /// For payment methods that tokenize card information (Apple Pay, Google Pay), the tokenized number might be provided instead of the underlying card number. *As of May 1, 2021, card fingerprint in India for Connect changed to allow two fingerprints for the same card---one for India and one for the rest of the world.*. - pub fingerprint: Option, - - /// Card funding type. - /// - /// Can be `credit`, `debit`, `prepaid`, or `unknown`. - pub funding: Option, - - /// Issuer identification number of the card. - /// - /// (For internal use only and not typically available in standard API requests.). - #[serde(skip_serializing_if = "Option::is_none")] - pub iin: Option, - - /// The name of the card's issuing bank. - /// - /// (For internal use only and not typically available in standard API requests.). - #[serde(skip_serializing_if = "Option::is_none")] - pub issuer: Option, - - /// The last four digits of the card. - pub last4: Option, - - /// Contains information about card networks that can be used to process the payment. - pub networks: Option, - - /// How card details were read in this transaction. - pub read_method: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct WalletDetails { - #[serde(skip_serializing_if = "Option::is_none")] - pub amex_express_checkout: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub apple_pay: Option, - - /// (For tokenized numbers only.) The last four digits of the device account number. - pub dynamic_last4: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub google_pay: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub link: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub masterpass: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub samsung_pay: Option, - - /// The type of the card wallet, one of `amex_express_checkout`, `apple_pay`, `google_pay`, `masterpass`, `samsung_pay`, `visa_checkout`, or `link`. - /// - /// An additional hash is included on the Wallet subhash with a name matching this value. - /// It contains additional information specific to the card wallet type. - #[serde(rename = "type")] - pub type_: WalletDetailsType, - - #[serde(skip_serializing_if = "Option::is_none")] - pub visa_checkout: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct WalletAmexExpressCheckout {} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct WalletApplePay {} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct WalletGooglePay {} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct PaymentMethodCardWalletLink {} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct WalletMasterpass { - /// Owner's verified billing address. - /// - /// Values are verified or provided by the wallet directly (if supported) at the time of authorization or settlement. - /// They cannot be set or mutated. - pub billing_address: Option
, - - /// Owner's verified email. - /// - /// Values are verified or provided by the wallet directly (if supported) at the time of authorization or settlement. - /// They cannot be set or mutated. - pub email: Option, - - /// Owner's verified full name. - /// - /// Values are verified or provided by the wallet directly (if supported) at the time of authorization or settlement. - /// They cannot be set or mutated. - pub name: Option, - - /// Owner's verified shipping address. - /// - /// Values are verified or provided by the wallet directly (if supported) at the time of authorization or settlement. - /// They cannot be set or mutated. - pub shipping_address: Option
, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct WalletSamsungPay {} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct WalletVisaCheckout { - /// Owner's verified billing address. - /// - /// Values are verified or provided by the wallet directly (if supported) at the time of authorization or settlement. - /// They cannot be set or mutated. - pub billing_address: Option
, - - /// Owner's verified email. - /// - /// Values are verified or provided by the wallet directly (if supported) at the time of authorization or settlement. - /// They cannot be set or mutated. - pub email: Option, - - /// Owner's verified full name. - /// - /// Values are verified or provided by the wallet directly (if supported) at the time of authorization or settlement. - /// They cannot be set or mutated. - pub name: Option, - - /// Owner's verified shipping address. - /// - /// Values are verified or provided by the wallet directly (if supported) at the time of authorization or settlement. - /// They cannot be set or mutated. - pub shipping_address: Option
, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct PaymentMethodCashapp { - /// A unique and immutable identifier assigned by Cash App to every buyer. - pub buyer_id: Option, - - /// A public identifier for buyers using Cash App. - pub cashtag: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct PaymentMethodCustomerBalance {} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct PaymentMethodEps { - /// The customer's bank. - /// - /// Should be one of `arzte_und_apotheker_bank`, `austrian_anadi_bank_ag`, `bank_austria`, `bankhaus_carl_spangler`, `bankhaus_schelhammer_und_schattera_ag`, `bawag_psk_ag`, `bks_bank_ag`, `brull_kallmus_bank_ag`, `btv_vier_lander_bank`, `capital_bank_grawe_gruppe_ag`, `deutsche_bank_ag`, `dolomitenbank`, `easybank_ag`, `erste_bank_und_sparkassen`, `hypo_alpeadriabank_international_ag`, `hypo_noe_lb_fur_niederosterreich_u_wien`, `hypo_oberosterreich_salzburg_steiermark`, `hypo_tirol_bank_ag`, `hypo_vorarlberg_bank_ag`, `hypo_bank_burgenland_aktiengesellschaft`, `marchfelder_bank`, `oberbank_ag`, `raiffeisen_bankengruppe_osterreich`, `schoellerbank_ag`, `sparda_bank_wien`, `volksbank_gruppe`, `volkskreditbank_ag`, or `vr_bank_braunau`. - pub bank: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct PaymentMethodFpx { - /// Account holder type, if provided. - /// - /// Can be one of `individual` or `company`. - pub account_holder_type: Option, - - /// The customer's bank, if provided. - /// - /// Can be one of `affin_bank`, `agrobank`, `alliance_bank`, `ambank`, `bank_islam`, `bank_muamalat`, `bank_rakyat`, `bsn`, `cimb`, `hong_leong_bank`, `hsbc`, `kfh`, `maybank2u`, `ocbc`, `public_bank`, `rhb`, `standard_chartered`, `uob`, `deutsche_bank`, `maybank2e`, `pb_enterprise`, or `bank_of_china`. - pub bank: PaymentMethodFpxBank, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct PaymentMethodGiropay {} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct PaymentMethodGrabpay {} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct PaymentMethodIdeal { - /// The customer's bank, if provided. - /// - /// Can be one of `abn_amro`, `asn_bank`, `bunq`, `handelsbanken`, `ing`, `knab`, `moneyou`, `n26`, `nn`, `rabobank`, `regiobank`, `revolut`, `sns_bank`, `triodos_bank`, `van_lanschot`, or `yoursafe`. - pub bank: Option, - - /// The Bank Identifier Code of the customer's bank, if the bank was provided. - pub bic: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct PaymentMethodInteracPresent { - /// Card brand. - /// - /// Can be `interac`, `mastercard` or `visa`. - pub brand: Option, - - /// The cardholder name as read from the card, in [ISO 7813](https://en.wikipedia.org/wiki/ISO/IEC_7813) format. - /// - /// May include alphanumeric characters, special characters and first/last name separator (`/`). - /// In some cases, the cardholder name may not be available depending on how the issuer has configured the card. - /// Cardholder name is typically not available on swipe or contactless payments, such as those made with Apple Pay and Google Pay. - pub cardholder_name: Option, - - /// Two-letter ISO code representing the country of the card. - /// - /// You could use this attribute to get a sense of the international breakdown of cards you've collected. - pub country: Option, - - /// A high-level description of the type of cards issued in this range. - /// - /// (For internal use only and not typically available in standard API requests.). - #[serde(skip_serializing_if = "Option::is_none")] - pub description: Option, - - /// Two-digit number representing the card's expiration month. - pub exp_month: i64, - - /// Four-digit number representing the card's expiration year. - pub exp_year: i64, - - /// Uniquely identifies this particular card number. - /// - /// You can use this attribute to check whether two customers who’ve signed up with you are using the same card number, for example. - /// For payment methods that tokenize card information (Apple Pay, Google Pay), the tokenized number might be provided instead of the underlying card number. *As of May 1, 2021, card fingerprint in India for Connect changed to allow two fingerprints for the same card---one for India and one for the rest of the world.*. - pub fingerprint: Option, - - /// Card funding type. - /// - /// Can be `credit`, `debit`, `prepaid`, or `unknown`. - pub funding: Option, - - /// Issuer identification number of the card. - /// - /// (For internal use only and not typically available in standard API requests.). - #[serde(skip_serializing_if = "Option::is_none")] - pub iin: Option, - - /// The name of the card's issuing bank. - /// - /// (For internal use only and not typically available in standard API requests.). - #[serde(skip_serializing_if = "Option::is_none")] - pub issuer: Option, - - /// The last four digits of the card. - pub last4: Option, - - /// Contains information about card networks that can be used to process the payment. - pub networks: Option, - - /// EMV tag 5F2D. - /// - /// Preferred languages specified by the integrated circuit chip. - pub preferred_locales: Option>, - - /// How card details were read in this transaction. - pub read_method: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct PaymentMethodKlarna { - /// The customer's date of birth, if provided. - pub dob: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct PaymentFlowsPrivatePaymentMethodsKlarnaDob { - /// The day of birth, between 1 and 31. - pub day: Option, - - /// The month of birth, between 1 and 12. - pub month: Option, - - /// The four-digit year of birth. - pub year: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct PaymentMethodKonbini {} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct PaymentMethodLink { - /// Account owner's email address. - pub email: Option, - - /// [Deprecated] This is a legacy parameter that no longer has any function. - #[serde(skip_serializing_if = "Option::is_none")] - pub persistent_token: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct PaymentMethodOxxo {} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct PaymentMethodP24 { - /// The customer's bank, if provided. - pub bank: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct PaymentMethodPaynow {} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct PaymentMethodPaypal { - /// Owner's email. - /// - /// Values are provided by PayPal directly (if supported) at the time of authorization or settlement. - /// They cannot be set or mutated. - pub payer_email: Option, - - /// PayPal account PayerID. - /// - /// This identifier uniquely identifies the PayPal customer. - pub payer_id: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct PaymentMethodPix {} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct PaymentMethodPromptpay {} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct PaymentMethodRevolutPay {} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct PaymentMethodSepaDebit { - /// Bank code of bank associated with the bank account. - pub bank_code: Option, - - /// Branch code of bank associated with the bank account. - pub branch_code: Option, - - /// Two-letter ISO code representing the country the bank account is located in. - pub country: Option, - - /// Uniquely identifies this particular bank account. - /// - /// You can use this attribute to check whether two bank accounts are the same. - pub fingerprint: Option, - - /// Information about the object that generated this PaymentMethod. - pub generated_from: Option, - - /// Last four characters of the IBAN. - pub last4: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct PaymentMethodSofort { - /// Two-letter ISO code representing the country the bank account is located in. - pub country: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct PaymentMethodSwish {} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct PaymentMethodUsBankAccount { - /// Account holder type: individual or company. - pub account_holder_type: Option, - - /// Account type: checkings or savings. - /// - /// Defaults to checking if omitted. - pub account_type: Option, - - /// The name of the bank. - pub bank_name: Option, - - /// The ID of the Financial Connections Account used to create the payment method. - pub financial_connections_account: Option, - - /// Uniquely identifies this particular bank account. - /// - /// You can use this attribute to check whether two bank accounts are the same. - pub fingerprint: Option, - - /// Last four digits of the bank account number. - pub last4: Option, - - /// Contains information about US bank account networks that can be used. - pub networks: Option, - - /// Routing number of the bank account. - pub routing_number: Option, - - /// Contains information about the future reusability of this PaymentMethod. - pub status_details: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct PaymentMethodUsBankAccountStatusDetails { - #[serde(skip_serializing_if = "Option::is_none")] - pub blocked: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct PaymentMethodUsBankAccountBlocked { - /// The ACH network code that resulted in this block. - pub network_code: Option, - - /// The reason why this PaymentMethod's fingerprint has been blocked. - pub reason: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct PaymentMethodWechatPay {} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct PaymentMethodZip {} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct SepaDebitGeneratedFrom { - /// The ID of the Charge that generated this PaymentMethod, if any. - pub charge: Option>, - - /// The ID of the SetupAttempt that generated this PaymentMethod, if any. - pub setup_attempt: Option>, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct ThreeDSecureUsage { - /// Whether 3D Secure is supported on this card. - pub supported: bool, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UsBankAccountNetworks { - /// The preferred network. - pub preferred: Option, - - /// All supported networks. - pub supported: Vec, -} - -/// The parameters for `PaymentMethod::create`. -#[derive(Clone, Debug, Serialize, Default)] -pub struct CreatePaymentMethod<'a> { - /// If this is an `acss_debit` PaymentMethod, this hash contains details about the ACSS Debit payment method. - #[serde(skip_serializing_if = "Option::is_none")] - pub acss_debit: Option, - - /// If this is an `affirm` PaymentMethod, this hash contains details about the Affirm payment method. - #[serde(skip_serializing_if = "Option::is_none")] - pub affirm: Option, - - /// If this is an `AfterpayClearpay` PaymentMethod, this hash contains details about the AfterpayClearpay payment method. - #[serde(skip_serializing_if = "Option::is_none")] - pub afterpay_clearpay: Option, - - /// If this is an `Alipay` PaymentMethod, this hash contains details about the Alipay payment method. - #[serde(skip_serializing_if = "Option::is_none")] - pub alipay: Option, - - /// If this is an `au_becs_debit` PaymentMethod, this hash contains details about the bank account. - #[serde(skip_serializing_if = "Option::is_none")] - pub au_becs_debit: Option, - - /// If this is a `bacs_debit` PaymentMethod, this hash contains details about the Bacs Direct Debit bank account. - #[serde(skip_serializing_if = "Option::is_none")] - pub bacs_debit: Option, - - /// If this is a `bancontact` PaymentMethod, this hash contains details about the Bancontact payment method. - #[serde(skip_serializing_if = "Option::is_none")] - pub bancontact: Option, - - /// Billing information associated with the PaymentMethod that may be used or required by particular types of payment methods. - #[serde(skip_serializing_if = "Option::is_none")] - pub billing_details: Option, - - /// If this is a `blik` PaymentMethod, this hash contains details about the BLIK payment method. - #[serde(skip_serializing_if = "Option::is_none")] - pub blik: Option, - - /// If this is a `boleto` PaymentMethod, this hash contains details about the Boleto payment method. - #[serde(skip_serializing_if = "Option::is_none")] - pub boleto: Option, - - /// If this is a `card` PaymentMethod, this hash contains the user's card details. - /// - /// For backwards compatibility, you can alternatively provide a Stripe token (e.g., for Apple Pay, Amex Express Checkout, or legacy Checkout) into the card hash with format `card: {token: "tok_visa"}`. - /// When providing a card number, you must meet the requirements for [PCI compliance](https://stripe.com/docs/security#validating-pci-compliance). - /// We strongly recommend using Stripe.js instead of interacting with this API directly. - #[serde(skip_serializing_if = "Option::is_none")] - pub card: Option, - - /// If this is a `cashapp` PaymentMethod, this hash contains details about the Cash App Pay payment method. - #[serde(skip_serializing_if = "Option::is_none")] - pub cashapp: Option, - - /// The `Customer` to whom the original PaymentMethod is attached. - #[serde(skip_serializing_if = "Option::is_none")] - pub customer: Option, - - /// If this is a `customer_balance` PaymentMethod, this hash contains details about the CustomerBalance payment method. - #[serde(skip_serializing_if = "Option::is_none")] - pub customer_balance: Option, - - /// If this is an `eps` PaymentMethod, this hash contains details about the EPS payment method. - #[serde(skip_serializing_if = "Option::is_none")] - pub eps: Option, - - /// Specifies which fields in the response should be expanded. - #[serde(skip_serializing_if = "Expand::is_empty")] - pub expand: &'a [&'a str], - - /// If this is an `fpx` PaymentMethod, this hash contains details about the FPX payment method. - #[serde(skip_serializing_if = "Option::is_none")] - pub fpx: Option, - - /// If this is a `giropay` PaymentMethod, this hash contains details about the Giropay payment method. - #[serde(skip_serializing_if = "Option::is_none")] - pub giropay: Option, - - /// If this is a `grabpay` PaymentMethod, this hash contains details about the GrabPay payment method. - #[serde(skip_serializing_if = "Option::is_none")] - pub grabpay: Option, - - /// If this is an `ideal` PaymentMethod, this hash contains details about the iDEAL payment method. - #[serde(skip_serializing_if = "Option::is_none")] - pub ideal: Option, - - /// If this is an `interac_present` PaymentMethod, this hash contains details about the Interac Present payment method. - #[serde(skip_serializing_if = "Option::is_none")] - pub interac_present: Option, - - /// If this is a `klarna` PaymentMethod, this hash contains details about the Klarna payment method. - #[serde(skip_serializing_if = "Option::is_none")] - pub klarna: Option, - - /// If this is a `konbini` PaymentMethod, this hash contains details about the Konbini payment method. - #[serde(skip_serializing_if = "Option::is_none")] - pub konbini: Option, - - /// If this is an `Link` PaymentMethod, this hash contains details about the Link payment method. - #[serde(skip_serializing_if = "Option::is_none")] - pub link: Option, - - /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. - /// - /// This can be useful for storing additional information about the object in a structured format. - /// Individual keys can be unset by posting an empty value to them. - /// All keys can be unset by posting an empty value to `metadata`. - #[serde(skip_serializing_if = "Option::is_none")] - pub metadata: Option, - - /// If this is an `oxxo` PaymentMethod, this hash contains details about the OXXO payment method. - #[serde(skip_serializing_if = "Option::is_none")] - pub oxxo: Option, - - /// If this is a `p24` PaymentMethod, this hash contains details about the P24 payment method. - #[serde(skip_serializing_if = "Option::is_none")] - pub p24: Option, - - /// The PaymentMethod to share. - #[serde(skip_serializing_if = "Option::is_none")] - pub payment_method: Option, - - /// If this is a `paynow` PaymentMethod, this hash contains details about the PayNow payment method. - #[serde(skip_serializing_if = "Option::is_none")] - pub paynow: Option, - - /// If this is a `paypal` PaymentMethod, this hash contains details about the PayPal payment method. - #[serde(skip_serializing_if = "Option::is_none")] - pub paypal: Option, - - /// If this is a `pix` PaymentMethod, this hash contains details about the Pix payment method. - #[serde(skip_serializing_if = "Option::is_none")] - pub pix: Option, - - /// If this is a `promptpay` PaymentMethod, this hash contains details about the PromptPay payment method. - #[serde(skip_serializing_if = "Option::is_none")] - pub promptpay: Option, - - /// Options to configure Radar. - /// - /// See [Radar Session](https://stripe.com/docs/radar/radar-session) for more information. - #[serde(skip_serializing_if = "Option::is_none")] - pub radar_options: Option, - - /// If this is a `Revolut Pay` PaymentMethod, this hash contains details about the Revolut Pay payment method. - #[serde(skip_serializing_if = "Option::is_none")] - pub revolut_pay: Option, - - /// If this is a `sepa_debit` PaymentMethod, this hash contains details about the SEPA debit bank account. - #[serde(skip_serializing_if = "Option::is_none")] - pub sepa_debit: Option, - - /// If this is a `sofort` PaymentMethod, this hash contains details about the SOFORT payment method. - #[serde(skip_serializing_if = "Option::is_none")] - pub sofort: Option, - - /// If this is a `swish` PaymentMethod, this hash contains details about the Swish payment method. - #[serde(skip_serializing_if = "Option::is_none")] - pub swish: Option, - - /// The type of the PaymentMethod. - /// - /// An additional hash is included on the PaymentMethod with a name matching this value. - /// It contains additional information specific to the PaymentMethod type. - #[serde(rename = "type")] - #[serde(skip_serializing_if = "Option::is_none")] - pub type_: Option, - - /// If this is an `us_bank_account` PaymentMethod, this hash contains details about the US bank account payment method. - #[serde(skip_serializing_if = "Option::is_none")] - pub us_bank_account: Option, - - /// If this is an `wechat_pay` PaymentMethod, this hash contains details about the wechat_pay payment method. - #[serde(skip_serializing_if = "Option::is_none")] - pub wechat_pay: Option, - - /// If this is a `zip` PaymentMethod, this hash contains details about the Zip payment method. - #[serde(skip_serializing_if = "Option::is_none")] - pub zip: Option, -} - -impl<'a> CreatePaymentMethod<'a> { - pub fn new() -> Self { - CreatePaymentMethod { - acss_debit: Default::default(), - affirm: Default::default(), - afterpay_clearpay: Default::default(), - alipay: Default::default(), - au_becs_debit: Default::default(), - bacs_debit: Default::default(), - bancontact: Default::default(), - billing_details: Default::default(), - blik: Default::default(), - boleto: Default::default(), - card: Default::default(), - cashapp: Default::default(), - customer: Default::default(), - customer_balance: Default::default(), - eps: Default::default(), - expand: Default::default(), - fpx: Default::default(), - giropay: Default::default(), - grabpay: Default::default(), - ideal: Default::default(), - interac_present: Default::default(), - klarna: Default::default(), - konbini: Default::default(), - link: Default::default(), - metadata: Default::default(), - oxxo: Default::default(), - p24: Default::default(), - payment_method: Default::default(), - paynow: Default::default(), - paypal: Default::default(), - pix: Default::default(), - promptpay: Default::default(), - radar_options: Default::default(), - revolut_pay: Default::default(), - sepa_debit: Default::default(), - sofort: Default::default(), - swish: Default::default(), - type_: Default::default(), - us_bank_account: Default::default(), - wechat_pay: Default::default(), - zip: Default::default(), - } - } -} - -/// The parameters for `PaymentMethod::list`. -#[derive(Clone, Debug, Serialize, Default)] -pub struct ListPaymentMethods<'a> { - /// The ID of the customer whose PaymentMethods will be retrieved. - #[serde(skip_serializing_if = "Option::is_none")] - pub customer: Option, - - /// A cursor for use in pagination. - /// - /// `ending_before` is an object ID that defines your place in the list. - /// For instance, if you make a list request and receive 100 objects, starting with `obj_bar`, your subsequent call can include `ending_before=obj_bar` in order to fetch the previous page of the list. - #[serde(skip_serializing_if = "Option::is_none")] - pub ending_before: Option, - - /// Specifies which fields in the response should be expanded. - #[serde(skip_serializing_if = "Expand::is_empty")] - pub expand: &'a [&'a str], - - /// A limit on the number of objects to be returned. - /// - /// Limit can range between 1 and 100, and the default is 10. - #[serde(skip_serializing_if = "Option::is_none")] - pub limit: Option, - - /// A cursor for use in pagination. - /// - /// `starting_after` is an object ID that defines your place in the list. - /// For instance, if you make a list request and receive 100 objects, ending with `obj_foo`, your subsequent call can include `starting_after=obj_foo` in order to fetch the next page of the list. - #[serde(skip_serializing_if = "Option::is_none")] - pub starting_after: Option, - - /// An optional filter on the list, based on the object `type` field. - /// - /// Without the filter, the list includes all current and future payment method types. - /// If your integration expects only one type of payment method in the response, make sure to provide a type value in the request. - #[serde(rename = "type")] - #[serde(skip_serializing_if = "Option::is_none")] - pub type_: Option, -} - -impl<'a> ListPaymentMethods<'a> { - pub fn new() -> Self { - ListPaymentMethods { - customer: Default::default(), - ending_before: Default::default(), - expand: Default::default(), - limit: Default::default(), - starting_after: Default::default(), - type_: Default::default(), - } - } -} -impl Paginable for ListPaymentMethods<'_> { - type O = PaymentMethod; - fn set_last(&mut self, item: Self::O) { - self.starting_after = Some(item.id()); - } -} -/// The parameters for `PaymentMethod::update`. -#[derive(Clone, Debug, Serialize, Default)] -pub struct UpdatePaymentMethod<'a> { - /// Billing information associated with the PaymentMethod that may be used or required by particular types of payment methods. - #[serde(skip_serializing_if = "Option::is_none")] - pub billing_details: Option, - - /// If this is a `card` PaymentMethod, this hash contains the user's card details. - #[serde(skip_serializing_if = "Option::is_none")] - pub card: Option, - - /// Specifies which fields in the response should be expanded. - #[serde(skip_serializing_if = "Expand::is_empty")] - pub expand: &'a [&'a str], - - /// If this is an `Link` PaymentMethod, this hash contains details about the Link payment method. - #[serde(skip_serializing_if = "Option::is_none")] - pub link: Option, - - /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. - /// - /// This can be useful for storing additional information about the object in a structured format. - /// Individual keys can be unset by posting an empty value to them. - /// All keys can be unset by posting an empty value to `metadata`. - #[serde(skip_serializing_if = "Option::is_none")] - pub metadata: Option, - - /// If this is an `us_bank_account` PaymentMethod, this hash contains details about the US bank account payment method. - #[serde(skip_serializing_if = "Option::is_none")] - pub us_bank_account: Option, -} - -impl<'a> UpdatePaymentMethod<'a> { - pub fn new() -> Self { - UpdatePaymentMethod { - billing_details: Default::default(), - card: Default::default(), - expand: Default::default(), - link: Default::default(), - metadata: Default::default(), - us_bank_account: Default::default(), - } - } -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreatePaymentMethodAcssDebit { - /// Customer's bank account number. - pub account_number: String, - - /// Institution number of the customer's bank. - pub institution_number: String, - - /// Transit number of the customer's bank. - pub transit_number: String, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreatePaymentMethodAffirm {} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreatePaymentMethodAfterpayClearpay {} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreatePaymentMethodAlipay {} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreatePaymentMethodAuBecsDebit { - /// The account number for the bank account. - pub account_number: String, - - /// Bank-State-Branch number of the bank account. - pub bsb_number: String, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreatePaymentMethodBacsDebit { - /// Account number of the bank account that the funds will be debited from. - #[serde(skip_serializing_if = "Option::is_none")] - pub account_number: Option, - - /// Sort code of the bank account. - /// - /// (e.g., `10-20-30`). - #[serde(skip_serializing_if = "Option::is_none")] - pub sort_code: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreatePaymentMethodBancontact {} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreatePaymentMethodBlik {} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreatePaymentMethodBoleto { - /// The tax ID of the customer (CPF for individual consumers or CNPJ for businesses consumers). - pub tax_id: String, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreatePaymentMethodCashapp {} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreatePaymentMethodCustomerBalance {} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreatePaymentMethodEps { - /// The customer's bank. - #[serde(skip_serializing_if = "Option::is_none")] - pub bank: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreatePaymentMethodFpx { - /// Account holder type for FPX transaction. - #[serde(skip_serializing_if = "Option::is_none")] - pub account_holder_type: Option, - - /// The customer's bank. - pub bank: CreatePaymentMethodFpxBank, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreatePaymentMethodGiropay {} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreatePaymentMethodGrabpay {} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreatePaymentMethodIdeal { - /// The customer's bank. - #[serde(skip_serializing_if = "Option::is_none")] - pub bank: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreatePaymentMethodInteracPresent {} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreatePaymentMethodKlarna { - /// Customer's date of birth. - #[serde(skip_serializing_if = "Option::is_none")] - pub dob: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreatePaymentMethodKonbini {} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreatePaymentMethodLink {} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreatePaymentMethodOxxo {} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreatePaymentMethodP24 { - /// The customer's bank. - #[serde(skip_serializing_if = "Option::is_none")] - pub bank: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreatePaymentMethodPaynow {} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreatePaymentMethodPaypal {} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreatePaymentMethodPix {} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreatePaymentMethodPromptpay {} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreatePaymentMethodRadarOptions { - /// A [Radar Session](https://stripe.com/docs/radar/radar-session) is a snapshot of the browser metadata and device details that help Radar make more accurate predictions on your payments. - #[serde(skip_serializing_if = "Option::is_none")] - pub session: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreatePaymentMethodRevolutPay {} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreatePaymentMethodSepaDebit { - /// IBAN of the bank account. - pub iban: String, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreatePaymentMethodSofort { - /// Two-letter ISO code representing the country the bank account is located in. - pub country: CreatePaymentMethodSofortCountry, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreatePaymentMethodSwish {} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreatePaymentMethodUsBankAccount { - /// Account holder type: individual or company. - #[serde(skip_serializing_if = "Option::is_none")] - pub account_holder_type: Option, - - /// Account number of the bank account. - #[serde(skip_serializing_if = "Option::is_none")] - pub account_number: Option, - - /// Account type: checkings or savings. - /// - /// Defaults to checking if omitted. - #[serde(skip_serializing_if = "Option::is_none")] - pub account_type: Option, - - /// The ID of a Financial Connections Account to use as a payment method. - #[serde(skip_serializing_if = "Option::is_none")] - pub financial_connections_account: Option, - - /// Routing number of the bank account. - #[serde(skip_serializing_if = "Option::is_none")] - pub routing_number: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreatePaymentMethodWechatPay {} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreatePaymentMethodZip {} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UpdatePaymentMethodLink {} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UpdatePaymentMethodUsBankAccount { - /// Bank account holder type. - #[serde(skip_serializing_if = "Option::is_none")] - pub account_holder_type: Option, - - /// Bank account type. - #[serde(skip_serializing_if = "Option::is_none")] - pub account_type: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreatePaymentMethodKlarnaDob { - /// The day of birth, between 1 and 31. - pub day: i64, - - /// The month of birth, between 1 and 12. - pub month: i64, - - /// The four-digit year of birth. - pub year: i64, -} - -/// An enum representing the possible values of an `CardPresent`'s `read_method` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CardPresentReadMethod { - ContactEmv, - ContactlessEmv, - ContactlessMagstripeMode, - MagneticStripeFallback, - MagneticStripeTrack2, -} - -impl CardPresentReadMethod { - pub fn as_str(self) -> &'static str { - match self { - CardPresentReadMethod::ContactEmv => "contact_emv", - CardPresentReadMethod::ContactlessEmv => "contactless_emv", - CardPresentReadMethod::ContactlessMagstripeMode => "contactless_magstripe_mode", - CardPresentReadMethod::MagneticStripeFallback => "magnetic_stripe_fallback", - CardPresentReadMethod::MagneticStripeTrack2 => "magnetic_stripe_track2", - } - } -} - -impl AsRef for CardPresentReadMethod { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for CardPresentReadMethod { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for CardPresentReadMethod { - fn default() -> Self { - Self::ContactEmv - } -} - -/// An enum representing the possible values of an `CreatePaymentMethodEps`'s `bank` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CreatePaymentMethodEpsBank { - ArzteUndApothekerBank, - AustrianAnadiBankAg, - BankAustria, - BankhausCarlSpangler, - BankhausSchelhammerUndSchatteraAg, - BawagPskAg, - BksBankAg, - BrullKallmusBankAg, - BtvVierLanderBank, - CapitalBankGraweGruppeAg, - DeutscheBankAg, - Dolomitenbank, - EasybankAg, - ErsteBankUndSparkassen, - HypoAlpeadriabankInternationalAg, - HypoBankBurgenlandAktiengesellschaft, - HypoNoeLbFurNiederosterreichUWien, - HypoOberosterreichSalzburgSteiermark, - HypoTirolBankAg, - HypoVorarlbergBankAg, - MarchfelderBank, - OberbankAg, - RaiffeisenBankengruppeOsterreich, - SchoellerbankAg, - SpardaBankWien, - VolksbankGruppe, - VolkskreditbankAg, - VrBankBraunau, -} - -impl CreatePaymentMethodEpsBank { - pub fn as_str(self) -> &'static str { - match self { - CreatePaymentMethodEpsBank::ArzteUndApothekerBank => "arzte_und_apotheker_bank", - CreatePaymentMethodEpsBank::AustrianAnadiBankAg => "austrian_anadi_bank_ag", - CreatePaymentMethodEpsBank::BankAustria => "bank_austria", - CreatePaymentMethodEpsBank::BankhausCarlSpangler => "bankhaus_carl_spangler", - CreatePaymentMethodEpsBank::BankhausSchelhammerUndSchatteraAg => { - "bankhaus_schelhammer_und_schattera_ag" - } - CreatePaymentMethodEpsBank::BawagPskAg => "bawag_psk_ag", - CreatePaymentMethodEpsBank::BksBankAg => "bks_bank_ag", - CreatePaymentMethodEpsBank::BrullKallmusBankAg => "brull_kallmus_bank_ag", - CreatePaymentMethodEpsBank::BtvVierLanderBank => "btv_vier_lander_bank", - CreatePaymentMethodEpsBank::CapitalBankGraweGruppeAg => "capital_bank_grawe_gruppe_ag", - CreatePaymentMethodEpsBank::DeutscheBankAg => "deutsche_bank_ag", - CreatePaymentMethodEpsBank::Dolomitenbank => "dolomitenbank", - CreatePaymentMethodEpsBank::EasybankAg => "easybank_ag", - CreatePaymentMethodEpsBank::ErsteBankUndSparkassen => "erste_bank_und_sparkassen", - CreatePaymentMethodEpsBank::HypoAlpeadriabankInternationalAg => { - "hypo_alpeadriabank_international_ag" - } - CreatePaymentMethodEpsBank::HypoBankBurgenlandAktiengesellschaft => { - "hypo_bank_burgenland_aktiengesellschaft" - } - CreatePaymentMethodEpsBank::HypoNoeLbFurNiederosterreichUWien => { - "hypo_noe_lb_fur_niederosterreich_u_wien" - } - CreatePaymentMethodEpsBank::HypoOberosterreichSalzburgSteiermark => { - "hypo_oberosterreich_salzburg_steiermark" - } - CreatePaymentMethodEpsBank::HypoTirolBankAg => "hypo_tirol_bank_ag", - CreatePaymentMethodEpsBank::HypoVorarlbergBankAg => "hypo_vorarlberg_bank_ag", - CreatePaymentMethodEpsBank::MarchfelderBank => "marchfelder_bank", - CreatePaymentMethodEpsBank::OberbankAg => "oberbank_ag", - CreatePaymentMethodEpsBank::RaiffeisenBankengruppeOsterreich => { - "raiffeisen_bankengruppe_osterreich" - } - CreatePaymentMethodEpsBank::SchoellerbankAg => "schoellerbank_ag", - CreatePaymentMethodEpsBank::SpardaBankWien => "sparda_bank_wien", - CreatePaymentMethodEpsBank::VolksbankGruppe => "volksbank_gruppe", - CreatePaymentMethodEpsBank::VolkskreditbankAg => "volkskreditbank_ag", - CreatePaymentMethodEpsBank::VrBankBraunau => "vr_bank_braunau", - } - } -} - -impl AsRef for CreatePaymentMethodEpsBank { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for CreatePaymentMethodEpsBank { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for CreatePaymentMethodEpsBank { - fn default() -> Self { - Self::ArzteUndApothekerBank - } -} - -/// An enum representing the possible values of an `CreatePaymentMethodFpx`'s `account_holder_type` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CreatePaymentMethodFpxAccountHolderType { - Company, - Individual, -} - -impl CreatePaymentMethodFpxAccountHolderType { - pub fn as_str(self) -> &'static str { - match self { - CreatePaymentMethodFpxAccountHolderType::Company => "company", - CreatePaymentMethodFpxAccountHolderType::Individual => "individual", - } - } -} - -impl AsRef for CreatePaymentMethodFpxAccountHolderType { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for CreatePaymentMethodFpxAccountHolderType { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for CreatePaymentMethodFpxAccountHolderType { - fn default() -> Self { - Self::Company - } -} - -/// An enum representing the possible values of an `CreatePaymentMethodFpx`'s `bank` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CreatePaymentMethodFpxBank { - AffinBank, - Agrobank, - AllianceBank, - Ambank, - BankIslam, - BankMuamalat, - BankOfChina, - BankRakyat, - Bsn, - Cimb, - DeutscheBank, - HongLeongBank, - Hsbc, - Kfh, - Maybank2e, - Maybank2u, - Ocbc, - PbEnterprise, - PublicBank, - Rhb, - StandardChartered, - Uob, -} - -impl CreatePaymentMethodFpxBank { - pub fn as_str(self) -> &'static str { - match self { - CreatePaymentMethodFpxBank::AffinBank => "affin_bank", - CreatePaymentMethodFpxBank::Agrobank => "agrobank", - CreatePaymentMethodFpxBank::AllianceBank => "alliance_bank", - CreatePaymentMethodFpxBank::Ambank => "ambank", - CreatePaymentMethodFpxBank::BankIslam => "bank_islam", - CreatePaymentMethodFpxBank::BankMuamalat => "bank_muamalat", - CreatePaymentMethodFpxBank::BankOfChina => "bank_of_china", - CreatePaymentMethodFpxBank::BankRakyat => "bank_rakyat", - CreatePaymentMethodFpxBank::Bsn => "bsn", - CreatePaymentMethodFpxBank::Cimb => "cimb", - CreatePaymentMethodFpxBank::DeutscheBank => "deutsche_bank", - CreatePaymentMethodFpxBank::HongLeongBank => "hong_leong_bank", - CreatePaymentMethodFpxBank::Hsbc => "hsbc", - CreatePaymentMethodFpxBank::Kfh => "kfh", - CreatePaymentMethodFpxBank::Maybank2e => "maybank2e", - CreatePaymentMethodFpxBank::Maybank2u => "maybank2u", - CreatePaymentMethodFpxBank::Ocbc => "ocbc", - CreatePaymentMethodFpxBank::PbEnterprise => "pb_enterprise", - CreatePaymentMethodFpxBank::PublicBank => "public_bank", - CreatePaymentMethodFpxBank::Rhb => "rhb", - CreatePaymentMethodFpxBank::StandardChartered => "standard_chartered", - CreatePaymentMethodFpxBank::Uob => "uob", - } - } -} - -impl AsRef for CreatePaymentMethodFpxBank { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for CreatePaymentMethodFpxBank { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for CreatePaymentMethodFpxBank { - fn default() -> Self { - Self::AffinBank - } -} - -/// An enum representing the possible values of an `CreatePaymentMethodIdeal`'s `bank` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CreatePaymentMethodIdealBank { - AbnAmro, - AsnBank, - Bunq, - Handelsbanken, - Ing, - Knab, - Moneyou, - N26, - Nn, - Rabobank, - Regiobank, - Revolut, - SnsBank, - TriodosBank, - VanLanschot, - Yoursafe, -} - -impl CreatePaymentMethodIdealBank { - pub fn as_str(self) -> &'static str { - match self { - CreatePaymentMethodIdealBank::AbnAmro => "abn_amro", - CreatePaymentMethodIdealBank::AsnBank => "asn_bank", - CreatePaymentMethodIdealBank::Bunq => "bunq", - CreatePaymentMethodIdealBank::Handelsbanken => "handelsbanken", - CreatePaymentMethodIdealBank::Ing => "ing", - CreatePaymentMethodIdealBank::Knab => "knab", - CreatePaymentMethodIdealBank::Moneyou => "moneyou", - CreatePaymentMethodIdealBank::N26 => "n26", - CreatePaymentMethodIdealBank::Nn => "nn", - CreatePaymentMethodIdealBank::Rabobank => "rabobank", - CreatePaymentMethodIdealBank::Regiobank => "regiobank", - CreatePaymentMethodIdealBank::Revolut => "revolut", - CreatePaymentMethodIdealBank::SnsBank => "sns_bank", - CreatePaymentMethodIdealBank::TriodosBank => "triodos_bank", - CreatePaymentMethodIdealBank::VanLanschot => "van_lanschot", - CreatePaymentMethodIdealBank::Yoursafe => "yoursafe", - } - } -} - -impl AsRef for CreatePaymentMethodIdealBank { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for CreatePaymentMethodIdealBank { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for CreatePaymentMethodIdealBank { - fn default() -> Self { - Self::AbnAmro - } -} - -/// An enum representing the possible values of an `CreatePaymentMethodP24`'s `bank` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CreatePaymentMethodP24Bank { - AliorBank, - BankMillennium, - BankNowyBfgSa, - BankPekaoSa, - BankiSpbdzielcze, - Blik, - BnpParibas, - Boz, - CitiHandlowy, - CreditAgricole, - Envelobank, - EtransferPocztowy24, - GetinBank, - Ideabank, - Ing, - Inteligo, - MbankMtransfer, - NestPrzelew, - NoblePay, - PbacZIpko, - PlusBank, - SantanderPrzelew24, - TmobileUsbugiBankowe, - ToyotaBank, - Velobank, - VolkswagenBank, -} - -impl CreatePaymentMethodP24Bank { - pub fn as_str(self) -> &'static str { - match self { - CreatePaymentMethodP24Bank::AliorBank => "alior_bank", - CreatePaymentMethodP24Bank::BankMillennium => "bank_millennium", - CreatePaymentMethodP24Bank::BankNowyBfgSa => "bank_nowy_bfg_sa", - CreatePaymentMethodP24Bank::BankPekaoSa => "bank_pekao_sa", - CreatePaymentMethodP24Bank::BankiSpbdzielcze => "banki_spbdzielcze", - CreatePaymentMethodP24Bank::Blik => "blik", - CreatePaymentMethodP24Bank::BnpParibas => "bnp_paribas", - CreatePaymentMethodP24Bank::Boz => "boz", - CreatePaymentMethodP24Bank::CitiHandlowy => "citi_handlowy", - CreatePaymentMethodP24Bank::CreditAgricole => "credit_agricole", - CreatePaymentMethodP24Bank::Envelobank => "envelobank", - CreatePaymentMethodP24Bank::EtransferPocztowy24 => "etransfer_pocztowy24", - CreatePaymentMethodP24Bank::GetinBank => "getin_bank", - CreatePaymentMethodP24Bank::Ideabank => "ideabank", - CreatePaymentMethodP24Bank::Ing => "ing", - CreatePaymentMethodP24Bank::Inteligo => "inteligo", - CreatePaymentMethodP24Bank::MbankMtransfer => "mbank_mtransfer", - CreatePaymentMethodP24Bank::NestPrzelew => "nest_przelew", - CreatePaymentMethodP24Bank::NoblePay => "noble_pay", - CreatePaymentMethodP24Bank::PbacZIpko => "pbac_z_ipko", - CreatePaymentMethodP24Bank::PlusBank => "plus_bank", - CreatePaymentMethodP24Bank::SantanderPrzelew24 => "santander_przelew24", - CreatePaymentMethodP24Bank::TmobileUsbugiBankowe => "tmobile_usbugi_bankowe", - CreatePaymentMethodP24Bank::ToyotaBank => "toyota_bank", - CreatePaymentMethodP24Bank::Velobank => "velobank", - CreatePaymentMethodP24Bank::VolkswagenBank => "volkswagen_bank", - } - } -} - -impl AsRef for CreatePaymentMethodP24Bank { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for CreatePaymentMethodP24Bank { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for CreatePaymentMethodP24Bank { - fn default() -> Self { - Self::AliorBank - } -} - -/// An enum representing the possible values of an `CreatePaymentMethodSofort`'s `country` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CreatePaymentMethodSofortCountry { - #[serde(rename = "AT")] - At, - #[serde(rename = "BE")] - Be, - #[serde(rename = "DE")] - De, - #[serde(rename = "ES")] - Es, - #[serde(rename = "IT")] - It, - #[serde(rename = "NL")] - Nl, -} - -impl CreatePaymentMethodSofortCountry { - pub fn as_str(self) -> &'static str { - match self { - CreatePaymentMethodSofortCountry::At => "AT", - CreatePaymentMethodSofortCountry::Be => "BE", - CreatePaymentMethodSofortCountry::De => "DE", - CreatePaymentMethodSofortCountry::Es => "ES", - CreatePaymentMethodSofortCountry::It => "IT", - CreatePaymentMethodSofortCountry::Nl => "NL", - } - } -} - -impl AsRef for CreatePaymentMethodSofortCountry { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for CreatePaymentMethodSofortCountry { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for CreatePaymentMethodSofortCountry { - fn default() -> Self { - Self::At - } -} - -/// An enum representing the possible values of an `CreatePaymentMethodUsBankAccount`'s `account_holder_type` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CreatePaymentMethodUsBankAccountAccountHolderType { - Company, - Individual, -} - -impl CreatePaymentMethodUsBankAccountAccountHolderType { - pub fn as_str(self) -> &'static str { - match self { - CreatePaymentMethodUsBankAccountAccountHolderType::Company => "company", - CreatePaymentMethodUsBankAccountAccountHolderType::Individual => "individual", - } - } -} - -impl AsRef for CreatePaymentMethodUsBankAccountAccountHolderType { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for CreatePaymentMethodUsBankAccountAccountHolderType { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for CreatePaymentMethodUsBankAccountAccountHolderType { - fn default() -> Self { - Self::Company - } -} - -/// An enum representing the possible values of an `CreatePaymentMethodUsBankAccount`'s `account_type` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CreatePaymentMethodUsBankAccountAccountType { - Checking, - Savings, -} - -impl CreatePaymentMethodUsBankAccountAccountType { - pub fn as_str(self) -> &'static str { - match self { - CreatePaymentMethodUsBankAccountAccountType::Checking => "checking", - CreatePaymentMethodUsBankAccountAccountType::Savings => "savings", - } - } -} - -impl AsRef for CreatePaymentMethodUsBankAccountAccountType { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for CreatePaymentMethodUsBankAccountAccountType { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for CreatePaymentMethodUsBankAccountAccountType { - fn default() -> Self { - Self::Checking - } -} - -/// An enum representing the possible values of an `PaymentMethodEps`'s `bank` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum PaymentMethodEpsBank { - ArzteUndApothekerBank, - AustrianAnadiBankAg, - BankAustria, - BankhausCarlSpangler, - BankhausSchelhammerUndSchatteraAg, - BawagPskAg, - BksBankAg, - BrullKallmusBankAg, - BtvVierLanderBank, - CapitalBankGraweGruppeAg, - DeutscheBankAg, - Dolomitenbank, - EasybankAg, - ErsteBankUndSparkassen, - HypoAlpeadriabankInternationalAg, - HypoBankBurgenlandAktiengesellschaft, - HypoNoeLbFurNiederosterreichUWien, - HypoOberosterreichSalzburgSteiermark, - HypoTirolBankAg, - HypoVorarlbergBankAg, - MarchfelderBank, - OberbankAg, - RaiffeisenBankengruppeOsterreich, - SchoellerbankAg, - SpardaBankWien, - VolksbankGruppe, - VolkskreditbankAg, - VrBankBraunau, -} - -impl PaymentMethodEpsBank { - pub fn as_str(self) -> &'static str { - match self { - PaymentMethodEpsBank::ArzteUndApothekerBank => "arzte_und_apotheker_bank", - PaymentMethodEpsBank::AustrianAnadiBankAg => "austrian_anadi_bank_ag", - PaymentMethodEpsBank::BankAustria => "bank_austria", - PaymentMethodEpsBank::BankhausCarlSpangler => "bankhaus_carl_spangler", - PaymentMethodEpsBank::BankhausSchelhammerUndSchatteraAg => { - "bankhaus_schelhammer_und_schattera_ag" - } - PaymentMethodEpsBank::BawagPskAg => "bawag_psk_ag", - PaymentMethodEpsBank::BksBankAg => "bks_bank_ag", - PaymentMethodEpsBank::BrullKallmusBankAg => "brull_kallmus_bank_ag", - PaymentMethodEpsBank::BtvVierLanderBank => "btv_vier_lander_bank", - PaymentMethodEpsBank::CapitalBankGraweGruppeAg => "capital_bank_grawe_gruppe_ag", - PaymentMethodEpsBank::DeutscheBankAg => "deutsche_bank_ag", - PaymentMethodEpsBank::Dolomitenbank => "dolomitenbank", - PaymentMethodEpsBank::EasybankAg => "easybank_ag", - PaymentMethodEpsBank::ErsteBankUndSparkassen => "erste_bank_und_sparkassen", - PaymentMethodEpsBank::HypoAlpeadriabankInternationalAg => { - "hypo_alpeadriabank_international_ag" - } - PaymentMethodEpsBank::HypoBankBurgenlandAktiengesellschaft => { - "hypo_bank_burgenland_aktiengesellschaft" - } - PaymentMethodEpsBank::HypoNoeLbFurNiederosterreichUWien => { - "hypo_noe_lb_fur_niederosterreich_u_wien" - } - PaymentMethodEpsBank::HypoOberosterreichSalzburgSteiermark => { - "hypo_oberosterreich_salzburg_steiermark" - } - PaymentMethodEpsBank::HypoTirolBankAg => "hypo_tirol_bank_ag", - PaymentMethodEpsBank::HypoVorarlbergBankAg => "hypo_vorarlberg_bank_ag", - PaymentMethodEpsBank::MarchfelderBank => "marchfelder_bank", - PaymentMethodEpsBank::OberbankAg => "oberbank_ag", - PaymentMethodEpsBank::RaiffeisenBankengruppeOsterreich => { - "raiffeisen_bankengruppe_osterreich" - } - PaymentMethodEpsBank::SchoellerbankAg => "schoellerbank_ag", - PaymentMethodEpsBank::SpardaBankWien => "sparda_bank_wien", - PaymentMethodEpsBank::VolksbankGruppe => "volksbank_gruppe", - PaymentMethodEpsBank::VolkskreditbankAg => "volkskreditbank_ag", - PaymentMethodEpsBank::VrBankBraunau => "vr_bank_braunau", - } - } -} - -impl AsRef for PaymentMethodEpsBank { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for PaymentMethodEpsBank { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for PaymentMethodEpsBank { - fn default() -> Self { - Self::ArzteUndApothekerBank - } -} - -/// An enum representing the possible values of an `PaymentMethodFpx`'s `account_holder_type` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum PaymentMethodFpxAccountHolderType { - Company, - Individual, -} - -impl PaymentMethodFpxAccountHolderType { - pub fn as_str(self) -> &'static str { - match self { - PaymentMethodFpxAccountHolderType::Company => "company", - PaymentMethodFpxAccountHolderType::Individual => "individual", - } - } -} - -impl AsRef for PaymentMethodFpxAccountHolderType { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for PaymentMethodFpxAccountHolderType { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for PaymentMethodFpxAccountHolderType { - fn default() -> Self { - Self::Company - } -} - -/// An enum representing the possible values of an `PaymentMethodFpx`'s `bank` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum PaymentMethodFpxBank { - AffinBank, - Agrobank, - AllianceBank, - Ambank, - BankIslam, - BankMuamalat, - BankOfChina, - BankRakyat, - Bsn, - Cimb, - DeutscheBank, - HongLeongBank, - Hsbc, - Kfh, - Maybank2e, - Maybank2u, - Ocbc, - PbEnterprise, - PublicBank, - Rhb, - StandardChartered, - Uob, -} - -impl PaymentMethodFpxBank { - pub fn as_str(self) -> &'static str { - match self { - PaymentMethodFpxBank::AffinBank => "affin_bank", - PaymentMethodFpxBank::Agrobank => "agrobank", - PaymentMethodFpxBank::AllianceBank => "alliance_bank", - PaymentMethodFpxBank::Ambank => "ambank", - PaymentMethodFpxBank::BankIslam => "bank_islam", - PaymentMethodFpxBank::BankMuamalat => "bank_muamalat", - PaymentMethodFpxBank::BankOfChina => "bank_of_china", - PaymentMethodFpxBank::BankRakyat => "bank_rakyat", - PaymentMethodFpxBank::Bsn => "bsn", - PaymentMethodFpxBank::Cimb => "cimb", - PaymentMethodFpxBank::DeutscheBank => "deutsche_bank", - PaymentMethodFpxBank::HongLeongBank => "hong_leong_bank", - PaymentMethodFpxBank::Hsbc => "hsbc", - PaymentMethodFpxBank::Kfh => "kfh", - PaymentMethodFpxBank::Maybank2e => "maybank2e", - PaymentMethodFpxBank::Maybank2u => "maybank2u", - PaymentMethodFpxBank::Ocbc => "ocbc", - PaymentMethodFpxBank::PbEnterprise => "pb_enterprise", - PaymentMethodFpxBank::PublicBank => "public_bank", - PaymentMethodFpxBank::Rhb => "rhb", - PaymentMethodFpxBank::StandardChartered => "standard_chartered", - PaymentMethodFpxBank::Uob => "uob", - } - } -} - -impl AsRef for PaymentMethodFpxBank { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for PaymentMethodFpxBank { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for PaymentMethodFpxBank { - fn default() -> Self { - Self::AffinBank - } -} - -/// An enum representing the possible values of an `PaymentMethodIdeal`'s `bank` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum PaymentMethodIdealBank { - AbnAmro, - AsnBank, - Bunq, - Handelsbanken, - Ing, - Knab, - Moneyou, - N26, - Nn, - Rabobank, - Regiobank, - Revolut, - SnsBank, - TriodosBank, - VanLanschot, - Yoursafe, -} - -impl PaymentMethodIdealBank { - pub fn as_str(self) -> &'static str { - match self { - PaymentMethodIdealBank::AbnAmro => "abn_amro", - PaymentMethodIdealBank::AsnBank => "asn_bank", - PaymentMethodIdealBank::Bunq => "bunq", - PaymentMethodIdealBank::Handelsbanken => "handelsbanken", - PaymentMethodIdealBank::Ing => "ing", - PaymentMethodIdealBank::Knab => "knab", - PaymentMethodIdealBank::Moneyou => "moneyou", - PaymentMethodIdealBank::N26 => "n26", - PaymentMethodIdealBank::Nn => "nn", - PaymentMethodIdealBank::Rabobank => "rabobank", - PaymentMethodIdealBank::Regiobank => "regiobank", - PaymentMethodIdealBank::Revolut => "revolut", - PaymentMethodIdealBank::SnsBank => "sns_bank", - PaymentMethodIdealBank::TriodosBank => "triodos_bank", - PaymentMethodIdealBank::VanLanschot => "van_lanschot", - PaymentMethodIdealBank::Yoursafe => "yoursafe", - } - } -} - -impl AsRef for PaymentMethodIdealBank { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for PaymentMethodIdealBank { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for PaymentMethodIdealBank { - fn default() -> Self { - Self::AbnAmro - } -} - -/// An enum representing the possible values of an `PaymentMethodIdeal`'s `bic` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum PaymentMethodIdealBic { - #[serde(rename = "ABNANL2A")] - Abnanl2a, - #[serde(rename = "ASNBNL21")] - Asnbnl21, - #[serde(rename = "BITSNL2A")] - Bitsnl2a, - #[serde(rename = "BUNQNL2A")] - Bunqnl2a, - #[serde(rename = "FVLBNL22")] - Fvlbnl22, - #[serde(rename = "HANDNL2A")] - Handnl2a, - #[serde(rename = "INGBNL2A")] - Ingbnl2a, - #[serde(rename = "KNABNL2H")] - Knabnl2h, - #[serde(rename = "MOYONL21")] - Moyonl21, - #[serde(rename = "NNBANL2G")] - Nnbanl2g, - #[serde(rename = "NTSBDEB1")] - Ntsbdeb1, - #[serde(rename = "RABONL2U")] - Rabonl2u, - #[serde(rename = "RBRBNL21")] - Rbrbnl21, - #[serde(rename = "REVOIE23")] - Revoie23, - #[serde(rename = "REVOLT21")] - Revolt21, - #[serde(rename = "SNSBNL2A")] - Snsbnl2a, - #[serde(rename = "TRIONL2U")] - Trionl2u, -} - -impl PaymentMethodIdealBic { - pub fn as_str(self) -> &'static str { - match self { - PaymentMethodIdealBic::Abnanl2a => "ABNANL2A", - PaymentMethodIdealBic::Asnbnl21 => "ASNBNL21", - PaymentMethodIdealBic::Bitsnl2a => "BITSNL2A", - PaymentMethodIdealBic::Bunqnl2a => "BUNQNL2A", - PaymentMethodIdealBic::Fvlbnl22 => "FVLBNL22", - PaymentMethodIdealBic::Handnl2a => "HANDNL2A", - PaymentMethodIdealBic::Ingbnl2a => "INGBNL2A", - PaymentMethodIdealBic::Knabnl2h => "KNABNL2H", - PaymentMethodIdealBic::Moyonl21 => "MOYONL21", - PaymentMethodIdealBic::Nnbanl2g => "NNBANL2G", - PaymentMethodIdealBic::Ntsbdeb1 => "NTSBDEB1", - PaymentMethodIdealBic::Rabonl2u => "RABONL2U", - PaymentMethodIdealBic::Rbrbnl21 => "RBRBNL21", - PaymentMethodIdealBic::Revoie23 => "REVOIE23", - PaymentMethodIdealBic::Revolt21 => "REVOLT21", - PaymentMethodIdealBic::Snsbnl2a => "SNSBNL2A", - PaymentMethodIdealBic::Trionl2u => "TRIONL2U", - } - } -} - -impl AsRef for PaymentMethodIdealBic { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for PaymentMethodIdealBic { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for PaymentMethodIdealBic { - fn default() -> Self { - Self::Abnanl2a - } -} - -/// An enum representing the possible values of an `PaymentMethodInteracPresent`'s `read_method` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum PaymentMethodInteracPresentReadMethod { - ContactEmv, - ContactlessEmv, - ContactlessMagstripeMode, - MagneticStripeFallback, - MagneticStripeTrack2, -} - -impl PaymentMethodInteracPresentReadMethod { - pub fn as_str(self) -> &'static str { - match self { - PaymentMethodInteracPresentReadMethod::ContactEmv => "contact_emv", - PaymentMethodInteracPresentReadMethod::ContactlessEmv => "contactless_emv", - PaymentMethodInteracPresentReadMethod::ContactlessMagstripeMode => { - "contactless_magstripe_mode" - } - PaymentMethodInteracPresentReadMethod::MagneticStripeFallback => { - "magnetic_stripe_fallback" - } - PaymentMethodInteracPresentReadMethod::MagneticStripeTrack2 => "magnetic_stripe_track2", - } - } -} - -impl AsRef for PaymentMethodInteracPresentReadMethod { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for PaymentMethodInteracPresentReadMethod { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for PaymentMethodInteracPresentReadMethod { - fn default() -> Self { - Self::ContactEmv - } -} - -/// An enum representing the possible values of an `PaymentMethodP24`'s `bank` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum PaymentMethodP24Bank { - AliorBank, - BankMillennium, - BankNowyBfgSa, - BankPekaoSa, - BankiSpbdzielcze, - Blik, - BnpParibas, - Boz, - CitiHandlowy, - CreditAgricole, - Envelobank, - EtransferPocztowy24, - GetinBank, - Ideabank, - Ing, - Inteligo, - MbankMtransfer, - NestPrzelew, - NoblePay, - PbacZIpko, - PlusBank, - SantanderPrzelew24, - TmobileUsbugiBankowe, - ToyotaBank, - Velobank, - VolkswagenBank, -} - -impl PaymentMethodP24Bank { - pub fn as_str(self) -> &'static str { - match self { - PaymentMethodP24Bank::AliorBank => "alior_bank", - PaymentMethodP24Bank::BankMillennium => "bank_millennium", - PaymentMethodP24Bank::BankNowyBfgSa => "bank_nowy_bfg_sa", - PaymentMethodP24Bank::BankPekaoSa => "bank_pekao_sa", - PaymentMethodP24Bank::BankiSpbdzielcze => "banki_spbdzielcze", - PaymentMethodP24Bank::Blik => "blik", - PaymentMethodP24Bank::BnpParibas => "bnp_paribas", - PaymentMethodP24Bank::Boz => "boz", - PaymentMethodP24Bank::CitiHandlowy => "citi_handlowy", - PaymentMethodP24Bank::CreditAgricole => "credit_agricole", - PaymentMethodP24Bank::Envelobank => "envelobank", - PaymentMethodP24Bank::EtransferPocztowy24 => "etransfer_pocztowy24", - PaymentMethodP24Bank::GetinBank => "getin_bank", - PaymentMethodP24Bank::Ideabank => "ideabank", - PaymentMethodP24Bank::Ing => "ing", - PaymentMethodP24Bank::Inteligo => "inteligo", - PaymentMethodP24Bank::MbankMtransfer => "mbank_mtransfer", - PaymentMethodP24Bank::NestPrzelew => "nest_przelew", - PaymentMethodP24Bank::NoblePay => "noble_pay", - PaymentMethodP24Bank::PbacZIpko => "pbac_z_ipko", - PaymentMethodP24Bank::PlusBank => "plus_bank", - PaymentMethodP24Bank::SantanderPrzelew24 => "santander_przelew24", - PaymentMethodP24Bank::TmobileUsbugiBankowe => "tmobile_usbugi_bankowe", - PaymentMethodP24Bank::ToyotaBank => "toyota_bank", - PaymentMethodP24Bank::Velobank => "velobank", - PaymentMethodP24Bank::VolkswagenBank => "volkswagen_bank", - } - } -} - -impl AsRef for PaymentMethodP24Bank { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for PaymentMethodP24Bank { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for PaymentMethodP24Bank { - fn default() -> Self { - Self::AliorBank - } -} - -/// An enum representing the possible values of an `PaymentMethod`'s `type` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum PaymentMethodType { - AcssDebit, - Affirm, - AfterpayClearpay, - Alipay, - AuBecsDebit, - BacsDebit, - Bancontact, - Blik, - Boleto, - Card, - CardPresent, - Cashapp, - CustomerBalance, - Eps, - Fpx, - Giropay, - Grabpay, - Ideal, - InteracPresent, - Klarna, - Konbini, - Link, - Oxxo, - P24, - Paynow, - Paypal, - Pix, - Promptpay, - RevolutPay, - SepaDebit, - Sofort, - Swish, - UsBankAccount, - WechatPay, - Zip, -} - -impl PaymentMethodType { - pub fn as_str(self) -> &'static str { - match self { - PaymentMethodType::AcssDebit => "acss_debit", - PaymentMethodType::Affirm => "affirm", - PaymentMethodType::AfterpayClearpay => "afterpay_clearpay", - PaymentMethodType::Alipay => "alipay", - PaymentMethodType::AuBecsDebit => "au_becs_debit", - PaymentMethodType::BacsDebit => "bacs_debit", - PaymentMethodType::Bancontact => "bancontact", - PaymentMethodType::Blik => "blik", - PaymentMethodType::Boleto => "boleto", - PaymentMethodType::Card => "card", - PaymentMethodType::CardPresent => "card_present", - PaymentMethodType::Cashapp => "cashapp", - PaymentMethodType::CustomerBalance => "customer_balance", - PaymentMethodType::Eps => "eps", - PaymentMethodType::Fpx => "fpx", - PaymentMethodType::Giropay => "giropay", - PaymentMethodType::Grabpay => "grabpay", - PaymentMethodType::Ideal => "ideal", - PaymentMethodType::InteracPresent => "interac_present", - PaymentMethodType::Klarna => "klarna", - PaymentMethodType::Konbini => "konbini", - PaymentMethodType::Link => "link", - PaymentMethodType::Oxxo => "oxxo", - PaymentMethodType::P24 => "p24", - PaymentMethodType::Paynow => "paynow", - PaymentMethodType::Paypal => "paypal", - PaymentMethodType::Pix => "pix", - PaymentMethodType::Promptpay => "promptpay", - PaymentMethodType::RevolutPay => "revolut_pay", - PaymentMethodType::SepaDebit => "sepa_debit", - PaymentMethodType::Sofort => "sofort", - PaymentMethodType::Swish => "swish", - PaymentMethodType::UsBankAccount => "us_bank_account", - PaymentMethodType::WechatPay => "wechat_pay", - PaymentMethodType::Zip => "zip", - } - } -} - -impl AsRef for PaymentMethodType { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for PaymentMethodType { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for PaymentMethodType { - fn default() -> Self { - Self::AcssDebit - } -} - -/// An enum representing the possible values of an `ListPaymentMethods`'s `type_` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum PaymentMethodTypeFilter { - AcssDebit, - Affirm, - AfterpayClearpay, - Alipay, - AuBecsDebit, - BacsDebit, - Bancontact, - Blik, - Boleto, - Card, - Cashapp, - CustomerBalance, - Eps, - Fpx, - Giropay, - Grabpay, - Ideal, - Klarna, - Konbini, - Link, - Oxxo, - P24, - Paynow, - Paypal, - Pix, - Promptpay, - RevolutPay, - SepaDebit, - Sofort, - Swish, - UsBankAccount, - WechatPay, - Zip, -} - -impl PaymentMethodTypeFilter { - pub fn as_str(self) -> &'static str { - match self { - PaymentMethodTypeFilter::AcssDebit => "acss_debit", - PaymentMethodTypeFilter::Affirm => "affirm", - PaymentMethodTypeFilter::AfterpayClearpay => "afterpay_clearpay", - PaymentMethodTypeFilter::Alipay => "alipay", - PaymentMethodTypeFilter::AuBecsDebit => "au_becs_debit", - PaymentMethodTypeFilter::BacsDebit => "bacs_debit", - PaymentMethodTypeFilter::Bancontact => "bancontact", - PaymentMethodTypeFilter::Blik => "blik", - PaymentMethodTypeFilter::Boleto => "boleto", - PaymentMethodTypeFilter::Card => "card", - PaymentMethodTypeFilter::Cashapp => "cashapp", - PaymentMethodTypeFilter::CustomerBalance => "customer_balance", - PaymentMethodTypeFilter::Eps => "eps", - PaymentMethodTypeFilter::Fpx => "fpx", - PaymentMethodTypeFilter::Giropay => "giropay", - PaymentMethodTypeFilter::Grabpay => "grabpay", - PaymentMethodTypeFilter::Ideal => "ideal", - PaymentMethodTypeFilter::Klarna => "klarna", - PaymentMethodTypeFilter::Konbini => "konbini", - PaymentMethodTypeFilter::Link => "link", - PaymentMethodTypeFilter::Oxxo => "oxxo", - PaymentMethodTypeFilter::P24 => "p24", - PaymentMethodTypeFilter::Paynow => "paynow", - PaymentMethodTypeFilter::Paypal => "paypal", - PaymentMethodTypeFilter::Pix => "pix", - PaymentMethodTypeFilter::Promptpay => "promptpay", - PaymentMethodTypeFilter::RevolutPay => "revolut_pay", - PaymentMethodTypeFilter::SepaDebit => "sepa_debit", - PaymentMethodTypeFilter::Sofort => "sofort", - PaymentMethodTypeFilter::Swish => "swish", - PaymentMethodTypeFilter::UsBankAccount => "us_bank_account", - PaymentMethodTypeFilter::WechatPay => "wechat_pay", - PaymentMethodTypeFilter::Zip => "zip", - } - } -} - -impl AsRef for PaymentMethodTypeFilter { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for PaymentMethodTypeFilter { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for PaymentMethodTypeFilter { - fn default() -> Self { - Self::AcssDebit - } -} - -/// An enum representing the possible values of an `PaymentMethodUsBankAccount`'s `account_holder_type` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum PaymentMethodUsBankAccountAccountHolderType { - Company, - Individual, -} - -impl PaymentMethodUsBankAccountAccountHolderType { - pub fn as_str(self) -> &'static str { - match self { - PaymentMethodUsBankAccountAccountHolderType::Company => "company", - PaymentMethodUsBankAccountAccountHolderType::Individual => "individual", - } - } -} - -impl AsRef for PaymentMethodUsBankAccountAccountHolderType { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for PaymentMethodUsBankAccountAccountHolderType { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for PaymentMethodUsBankAccountAccountHolderType { - fn default() -> Self { - Self::Company - } -} - -/// An enum representing the possible values of an `PaymentMethodUsBankAccount`'s `account_type` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum PaymentMethodUsBankAccountAccountType { - Checking, - Savings, -} - -impl PaymentMethodUsBankAccountAccountType { - pub fn as_str(self) -> &'static str { - match self { - PaymentMethodUsBankAccountAccountType::Checking => "checking", - PaymentMethodUsBankAccountAccountType::Savings => "savings", - } - } -} - -impl AsRef for PaymentMethodUsBankAccountAccountType { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for PaymentMethodUsBankAccountAccountType { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for PaymentMethodUsBankAccountAccountType { - fn default() -> Self { - Self::Checking - } -} - -/// An enum representing the possible values of an `PaymentMethodUsBankAccountBlocked`'s `network_code` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum PaymentMethodUsBankAccountBlockedNetworkCode { - #[serde(rename = "R02")] - R02, - #[serde(rename = "R03")] - R03, - #[serde(rename = "R04")] - R04, - #[serde(rename = "R05")] - R05, - #[serde(rename = "R07")] - R07, - #[serde(rename = "R08")] - R08, - #[serde(rename = "R10")] - R10, - #[serde(rename = "R11")] - R11, - #[serde(rename = "R16")] - R16, - #[serde(rename = "R20")] - R20, - #[serde(rename = "R29")] - R29, - #[serde(rename = "R31")] - R31, -} - -impl PaymentMethodUsBankAccountBlockedNetworkCode { - pub fn as_str(self) -> &'static str { - match self { - PaymentMethodUsBankAccountBlockedNetworkCode::R02 => "R02", - PaymentMethodUsBankAccountBlockedNetworkCode::R03 => "R03", - PaymentMethodUsBankAccountBlockedNetworkCode::R04 => "R04", - PaymentMethodUsBankAccountBlockedNetworkCode::R05 => "R05", - PaymentMethodUsBankAccountBlockedNetworkCode::R07 => "R07", - PaymentMethodUsBankAccountBlockedNetworkCode::R08 => "R08", - PaymentMethodUsBankAccountBlockedNetworkCode::R10 => "R10", - PaymentMethodUsBankAccountBlockedNetworkCode::R11 => "R11", - PaymentMethodUsBankAccountBlockedNetworkCode::R16 => "R16", - PaymentMethodUsBankAccountBlockedNetworkCode::R20 => "R20", - PaymentMethodUsBankAccountBlockedNetworkCode::R29 => "R29", - PaymentMethodUsBankAccountBlockedNetworkCode::R31 => "R31", - } - } -} - -impl AsRef for PaymentMethodUsBankAccountBlockedNetworkCode { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for PaymentMethodUsBankAccountBlockedNetworkCode { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for PaymentMethodUsBankAccountBlockedNetworkCode { - fn default() -> Self { - Self::R02 - } -} - -/// An enum representing the possible values of an `PaymentMethodUsBankAccountBlocked`'s `reason` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum PaymentMethodUsBankAccountBlockedReason { - BankAccountClosed, - BankAccountFrozen, - BankAccountInvalidDetails, - BankAccountRestricted, - BankAccountUnusable, - DebitNotAuthorized, -} - -impl PaymentMethodUsBankAccountBlockedReason { - pub fn as_str(self) -> &'static str { - match self { - PaymentMethodUsBankAccountBlockedReason::BankAccountClosed => "bank_account_closed", - PaymentMethodUsBankAccountBlockedReason::BankAccountFrozen => "bank_account_frozen", - PaymentMethodUsBankAccountBlockedReason::BankAccountInvalidDetails => { - "bank_account_invalid_details" - } - PaymentMethodUsBankAccountBlockedReason::BankAccountRestricted => { - "bank_account_restricted" - } - PaymentMethodUsBankAccountBlockedReason::BankAccountUnusable => "bank_account_unusable", - PaymentMethodUsBankAccountBlockedReason::DebitNotAuthorized => "debit_not_authorized", - } - } -} - -impl AsRef for PaymentMethodUsBankAccountBlockedReason { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for PaymentMethodUsBankAccountBlockedReason { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for PaymentMethodUsBankAccountBlockedReason { - fn default() -> Self { - Self::BankAccountClosed - } -} - -/// An enum representing the possible values of an `UpdatePaymentMethodUsBankAccount`'s `account_holder_type` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum UpdatePaymentMethodUsBankAccountAccountHolderType { - Company, - Individual, -} - -impl UpdatePaymentMethodUsBankAccountAccountHolderType { - pub fn as_str(self) -> &'static str { - match self { - UpdatePaymentMethodUsBankAccountAccountHolderType::Company => "company", - UpdatePaymentMethodUsBankAccountAccountHolderType::Individual => "individual", - } - } -} - -impl AsRef for UpdatePaymentMethodUsBankAccountAccountHolderType { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for UpdatePaymentMethodUsBankAccountAccountHolderType { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for UpdatePaymentMethodUsBankAccountAccountHolderType { - fn default() -> Self { - Self::Company - } -} - -/// An enum representing the possible values of an `UpdatePaymentMethodUsBankAccount`'s `account_type` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum UpdatePaymentMethodUsBankAccountAccountType { - Checking, - Savings, -} - -impl UpdatePaymentMethodUsBankAccountAccountType { - pub fn as_str(self) -> &'static str { - match self { - UpdatePaymentMethodUsBankAccountAccountType::Checking => "checking", - UpdatePaymentMethodUsBankAccountAccountType::Savings => "savings", - } - } -} - -impl AsRef for UpdatePaymentMethodUsBankAccountAccountType { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for UpdatePaymentMethodUsBankAccountAccountType { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for UpdatePaymentMethodUsBankAccountAccountType { - fn default() -> Self { - Self::Checking - } -} - -/// An enum representing the possible values of an `UsBankAccountNetworks`'s `supported` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum UsBankAccountNetworksSupported { - Ach, - UsDomesticWire, -} - -impl UsBankAccountNetworksSupported { - pub fn as_str(self) -> &'static str { - match self { - UsBankAccountNetworksSupported::Ach => "ach", - UsBankAccountNetworksSupported::UsDomesticWire => "us_domestic_wire", - } - } -} - -impl AsRef for UsBankAccountNetworksSupported { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for UsBankAccountNetworksSupported { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for UsBankAccountNetworksSupported { - fn default() -> Self { - Self::Ach - } -} - -/// An enum representing the possible values of an `WalletDetails`'s `type` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum WalletDetailsType { - AmexExpressCheckout, - ApplePay, - GooglePay, - Link, - Masterpass, - SamsungPay, - VisaCheckout, -} - -impl WalletDetailsType { - pub fn as_str(self) -> &'static str { - match self { - WalletDetailsType::AmexExpressCheckout => "amex_express_checkout", - WalletDetailsType::ApplePay => "apple_pay", - WalletDetailsType::GooglePay => "google_pay", - WalletDetailsType::Link => "link", - WalletDetailsType::Masterpass => "masterpass", - WalletDetailsType::SamsungPay => "samsung_pay", - WalletDetailsType::VisaCheckout => "visa_checkout", - } - } -} - -impl AsRef for WalletDetailsType { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for WalletDetailsType { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for WalletDetailsType { - fn default() -> Self { - Self::AmexExpressCheckout - } -} - -/// If this is a `card` PaymentMethod, this hash contains the user's card details. -/// -/// For backwards compatibility, you can alternatively provide a Stripe token (e.g., for Apple Pay, Amex Express Checkout, or legacy Checkout) into the card hash with format `card: {token: "tok_visa"}`. -/// When providing a card number, you must meet the requirements for [PCI compliance](https://stripe.com/docs/security#validating-pci-compliance). -/// We strongly recommend using Stripe.js instead of interacting with this API directly. -#[derive(Clone, Debug, Deserialize, Serialize)] -#[serde(untagged, rename_all = "snake_case")] -pub enum CreatePaymentMethodCardUnion { - CardDetailsParams(CardDetailsParams), - TokenParams(TokenParams), -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CardDetailsParams { - /// The card's CVC. - /// - /// It is highly recommended to always include this value. - #[serde(skip_serializing_if = "Option::is_none")] - pub cvc: Option, - /// Two-digit number representing the card's expiration month. - pub exp_month: i32, - /// Four-digit number representing the card's expiration year. - pub exp_year: i32, - /// The card number, as a string without any separators. - pub number: String, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct TokenParams { - /// For backwards compatibility, you can alternatively provide a Stripe token (e.g., for Apple Pay, Amex Express Checkout, or legacy Checkout) into the card hash with format card: {token: "tok_visa"}. - pub token: String, -} - -/// If this is a `card` PaymentMethod, this hash contains the user's card details. -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UpdateApiParam { - /// Two-digit number representing the card's expiration month. - #[serde(skip_serializing_if = "Option::is_none")] - pub exp_month: Option, - /// Four-digit number representing the card's expiration year. - #[serde(skip_serializing_if = "Option::is_none")] - pub exp_year: Option, -} diff --git a/src/resources/generated/payment_method_attached.rs b/src/resources/generated/payment_method_attached.rs deleted file mode 100644 index c26a39ffd..000000000 --- a/src/resources/generated/payment_method_attached.rs +++ /dev/null @@ -1,10 +0,0 @@ -// ====================================== -// This file was automatically generated. -// ====================================== - -use serde::{Deserialize, Serialize}; - -/// The resource representing a Stripe "payment_method.attached". -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct PaymentMethodAttached { -} diff --git a/src/resources/generated/payment_method_automatically_updated.rs b/src/resources/generated/payment_method_automatically_updated.rs deleted file mode 100644 index 0b015404c..000000000 --- a/src/resources/generated/payment_method_automatically_updated.rs +++ /dev/null @@ -1,10 +0,0 @@ -// ====================================== -// This file was automatically generated. -// ====================================== - -use serde::{Deserialize, Serialize}; - -/// The resource representing a Stripe "payment_method.automatically_updated". -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct PaymentMethodAutomaticallyUpdated { -} diff --git a/src/resources/generated/payment_method_card_present_networks.rs b/src/resources/generated/payment_method_card_present_networks.rs deleted file mode 100644 index edc632cd5..000000000 --- a/src/resources/generated/payment_method_card_present_networks.rs +++ /dev/null @@ -1,15 +0,0 @@ -// ====================================== -// This file was automatically generated. -// ====================================== - -use serde::{Deserialize, Serialize}; - -/// The resource representing a Stripe "payment_method_card_present_networks". -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct PaymentMethodCardPresentNetworks { - /// All available networks for the card. - pub available: Vec, - - /// The preferred network for the card. - pub preferred: Option, -} diff --git a/src/resources/generated/payment_method_config_biz_payment_method_configuration_details.rs b/src/resources/generated/payment_method_config_biz_payment_method_configuration_details.rs deleted file mode 100644 index 0a18c7e4e..000000000 --- a/src/resources/generated/payment_method_config_biz_payment_method_configuration_details.rs +++ /dev/null @@ -1,12 +0,0 @@ -// ====================================== -// This file was automatically generated. -// ====================================== - -use serde::{Deserialize, Serialize}; - -/// The resource representing a Stripe "PaymentMethodConfigBizPaymentMethodConfigurationDetails". -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct PaymentMethodConfigBizPaymentMethodConfigurationDetails { - /// ID of the parent payment method configuration used. - pub parent: Option, -} diff --git a/src/resources/generated/payment_method_configuration.rs b/src/resources/generated/payment_method_configuration.rs deleted file mode 100644 index 71fd1b576..000000000 --- a/src/resources/generated/payment_method_configuration.rs +++ /dev/null @@ -1,4429 +0,0 @@ -// ====================================== -// This file was automatically generated. -// ====================================== - -use crate::client::{Client, Response}; -use crate::ids::{PaymentMethodConfigurationId}; -use crate::params::{Expand, List, Object, Paginable}; -use serde::{Deserialize, Serialize}; - -/// The resource representing a Stripe "PaymentMethodConfigResourcePaymentMethodConfiguration". -/// -/// For more details see -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct PaymentMethodConfiguration { - /// Unique identifier for the object. - pub id: PaymentMethodConfigurationId, - - #[serde(skip_serializing_if = "Option::is_none")] - pub acss_debit: Option, - - /// Whether the configuration can be used for new payments. - pub active: bool, - - #[serde(skip_serializing_if = "Option::is_none")] - pub affirm: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub afterpay_clearpay: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub alipay: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub apple_pay: Option, - - /// For child configs, the Connect application associated with the configuration. - pub application: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub au_becs_debit: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub bacs_debit: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub bancontact: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub blik: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub boleto: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub card: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub cartes_bancaires: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub cashapp: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub customer_balance: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub eps: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub fpx: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub giropay: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub google_pay: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub grabpay: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub ideal: Option, - - /// The default configuration is used whenever a payment method configuration is not specified. - pub is_default: bool, - - #[serde(skip_serializing_if = "Option::is_none")] - pub jcb: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub klarna: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub konbini: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub link: Option, - - /// Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. - pub livemode: bool, - - /// The configuration's name. - pub name: String, - - #[serde(skip_serializing_if = "Option::is_none")] - pub oxxo: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub p24: Option, - - /// For child configs, the configuration's parent configuration. - pub parent: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub paynow: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub paypal: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub promptpay: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub revolut_pay: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub sepa_debit: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub sofort: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub us_bank_account: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub wechat_pay: Option, -} - -impl PaymentMethodConfiguration { - - /// List payment method configurations. -pub fn list(client: &Client, params: &ListPaymentMethodConfigurations<'_>) -> Response> { - client.get_query("/payment_method_configurations", ¶ms) -} - - - /// Creates a payment method configuration. - pub fn create(client: &Client, params: CreatePaymentMethodConfiguration<'_>) -> Response { - client.post_form("/payment_method_configurations", ¶ms) - } - - /// Retrieve payment method configuration. - pub fn retrieve(client: &Client, id: &PaymentMethodConfigurationId, expand: &[&str]) -> Response { - client.get_query(&format!("/payment_method_configurations/{}", id), &Expand { expand }) - } - - /// Update payment method configuration. - pub fn update(client: &Client, id: &PaymentMethodConfigurationId, params: UpdatePaymentMethodConfiguration<'_>) -> Response { - client.post_form(&format!("/payment_method_configurations/{}", id), ¶ms) - } -} - -impl Object for PaymentMethodConfiguration { - type Id = PaymentMethodConfigurationId; - fn id(&self) -> Self::Id { - self.id.clone() - } - fn object(&self) -> &'static str { - "payment_method_configuration" - } -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct PaymentMethodConfigResourcePaymentMethodProperties { - - /// Whether this payment method may be offered at checkout. - /// - /// True if `display_preference` is `on` and the payment method's capability is active. - pub available: bool, - - pub display_preference: PaymentMethodConfigResourceDisplayPreference, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct PaymentMethodConfigResourceDisplayPreference { - - /// For child configs, whether or not the account's preference will be observed. - /// - /// If `false`, the parent configuration's default is used. - pub overridable: Option, - - /// The account's display preference. - pub preference: PaymentMethodConfigResourceDisplayPreferencePreference, - - /// The effective display preference value. - pub value: PaymentMethodConfigResourceDisplayPreferenceValue, -} - -/// The parameters for `PaymentMethodConfiguration::create`. -#[derive(Clone, Debug, Serialize, Default)] -pub struct CreatePaymentMethodConfiguration<'a> { - - /// Canadian pre-authorized debit payments, check this [page](https://stripe.com/docs/payments/acss-debit) for more details like country availability. - #[serde(skip_serializing_if = "Option::is_none")] - pub acss_debit: Option, - - /// [Affirm](https://www.affirm.com/) gives your customers a way to split purchases over a series of payments. - /// - /// Depending on the purchase, they can pay with four interest-free payments (Split Pay) or pay over a longer term (Installments), which might include interest. - /// Check this [page](https://stripe.com/docs/payments/affirm) for more details like country availability. - #[serde(skip_serializing_if = "Option::is_none")] - pub affirm: Option, - - /// Afterpay gives your customers a way to pay for purchases in installments, check this [page](https://stripe.com/docs/payments/afterpay-clearpay) for more details like country availability. - /// - /// Afterpay is particularly popular among businesses selling fashion, beauty, and sports products. - #[serde(skip_serializing_if = "Option::is_none")] - pub afterpay_clearpay: Option, - - /// Alipay is a digital wallet in China that has more than a billion active users worldwide. - /// - /// Alipay users can pay on the web or on a mobile device using login credentials or their Alipay app. - /// Alipay has a low dispute rate and reduces fraud by authenticating payments using the customer's login credentials. - /// Check this [page](https://stripe.com/docs/payments/alipay) for more details. - #[serde(skip_serializing_if = "Option::is_none")] - pub alipay: Option, - - /// Stripe users can accept [Apple Pay](/payments/apple-pay) in iOS applications in iOS 9 and later, and on the web in Safari starting with iOS 10 or macOS Sierra. - /// - /// There are no additional fees to process Apple Pay payments, and the [pricing](/pricing) is the same as other card transactions. - /// Check this [page](https://stripe.com/docs/apple-pay) for more details. - #[serde(skip_serializing_if = "Option::is_none")] - pub apple_pay: Option, - - /// Apple Pay Later, a payment method for customers to buy now and pay later, gives your customers a way to split purchases into four installments across six weeks. - #[serde(skip_serializing_if = "Option::is_none")] - pub apple_pay_later: Option, - - /// Stripe users in Australia can accept Bulk Electronic Clearing System (BECS) direct debit payments from customers with an Australian bank account. - /// - /// Check this [page](https://stripe.com/docs/payments/au-becs-debit) for more details. - #[serde(skip_serializing_if = "Option::is_none")] - pub au_becs_debit: Option, - - /// Stripe users in the UK can accept Bacs Direct Debit payments from customers with a UK bank account, check this [page](https://stripe.com/docs/payments/payment-methods/bacs-debit) for more details. - #[serde(skip_serializing_if = "Option::is_none")] - pub bacs_debit: Option, - - /// Bancontact is the most popular online payment method in Belgium, with over 15 million cards in circulation. - /// - /// [Customers](https://stripe.com/docs/api/customers) use a Bancontact card or mobile app linked to a Belgian bank account to make online payments that are secure, guaranteed, and confirmed immediately. - /// Check this [page](https://stripe.com/docs/payments/bancontact) for more details. - #[serde(skip_serializing_if = "Option::is_none")] - pub bancontact: Option, - - /// BLIK is a [single use](https://stripe.com/docs/payments/payment-methods#usage) payment method that requires customers to authenticate their payments. - /// - /// When customers want to pay online using BLIK, they request a six-digit code from their banking application and enter it into the payment collection form. - /// Check this [page](https://stripe.com/docs/payments/blik) for more details. - #[serde(skip_serializing_if = "Option::is_none")] - pub blik: Option, - - /// Boleto is an official (regulated by the Central Bank of Brazil) payment method in Brazil. - /// - /// Check this [page](https://stripe.com/docs/payments/boleto) for more details. - #[serde(skip_serializing_if = "Option::is_none")] - pub boleto: Option, - - /// Cards are a popular way for consumers and businesses to pay online or in person. - /// - /// Stripe supports global and local card networks. - #[serde(skip_serializing_if = "Option::is_none")] - pub card: Option, - - /// Cartes Bancaires is France's local card network. - /// - /// More than 95% of these cards are co-branded with either Visa or Mastercard, meaning you can process these cards over either Cartes Bancaires or the Visa or Mastercard networks. - /// Check this [page](https://stripe.com/docs/payments/cartes-bancaires) for more details. - #[serde(skip_serializing_if = "Option::is_none")] - pub cartes_bancaires: Option, - - /// Cash App is a popular consumer app in the US that allows customers to bank, invest, send, and receive money using their digital wallet. - /// - /// Check this [page](https://stripe.com/docs/payments/cash-app-pay) for more details. - #[serde(skip_serializing_if = "Option::is_none")] - pub cashapp: Option, - - /// Uses a customer’s [cash balance](https://stripe.com/docs/payments/customer-balance) for the payment. - /// - /// The cash balance can be funded via a bank transfer. - /// Check this [page](https://stripe.com/docs/payments/bank-transfers) for more details. - #[serde(skip_serializing_if = "Option::is_none")] - pub customer_balance: Option, - - /// EPS is an Austria-based payment method that allows customers to complete transactions online using their bank credentials. - /// - /// EPS is supported by all Austrian banks and is accepted by over 80% of Austrian online retailers. - /// Check this [page](https://stripe.com/docs/payments/eps) for more details. - #[serde(skip_serializing_if = "Option::is_none")] - pub eps: Option, - - /// Specifies which fields in the response should be expanded. - #[serde(skip_serializing_if = "Expand::is_empty")] - pub expand: &'a [&'a str], - - /// Financial Process Exchange (FPX) is a Malaysia-based payment method that allows customers to complete transactions online using their bank credentials. - /// - /// Bank Negara Malaysia (BNM), the Central Bank of Malaysia, and eleven other major Malaysian financial institutions are members of the PayNet Group, which owns and operates FPX. - /// It is one of the most popular online payment methods in Malaysia, with nearly 90 million transactions in 2018 according to BNM. - /// Check this [page](https://stripe.com/docs/payments/fpx) for more details. - #[serde(skip_serializing_if = "Option::is_none")] - pub fpx: Option, - - /// giropay is a German payment method based on online banking, introduced in 2006. - /// - /// It allows customers to complete transactions online using their online banking environment, with funds debited from their bank account. - /// Depending on their bank, customers confirm payments on giropay using a second factor of authentication or a PIN. - /// giropay accounts for 10% of online checkouts in Germany. - /// Check this [page](https://stripe.com/docs/payments/giropay) for more details. - #[serde(skip_serializing_if = "Option::is_none")] - pub giropay: Option, - - /// Google Pay allows customers to make payments in your app or website using any credit or debit card saved to their Google Account, including those from Google Play, YouTube, Chrome, or an Android device. - /// - /// Use the Google Pay API to request any credit or debit card stored in your customer's Google account. - /// Check this [page](https://stripe.com/docs/google-pay) for more details. - #[serde(skip_serializing_if = "Option::is_none")] - pub google_pay: Option, - - /// GrabPay is a payment method developed by [Grab](https://www.grab.com/sg/consumer/finance/pay/). - /// - /// GrabPay is a digital wallet - customers maintain a balance in their wallets that they pay out with. - /// Check this [page](https://stripe.com/docs/payments/grabpay) for more details. - #[serde(skip_serializing_if = "Option::is_none")] - pub grabpay: Option, - - /// iDEAL is a Netherlands-based payment method that allows customers to complete transactions online using their bank credentials. - /// - /// All major Dutch banks are members of Currence, the scheme that operates iDEAL, making it the most popular online payment method in the Netherlands with a share of online transactions close to 55%. - /// Check this [page](https://stripe.com/docs/payments/ideal) for more details. - #[serde(skip_serializing_if = "Option::is_none")] - pub ideal: Option, - - /// JCB is a credit card company based in Japan. - /// - /// JCB is currently available in Japan to businesses approved by JCB, and available to all businesses in Australia, Canada, Hong Kong, Japan, New Zealand, Singapore, Switzerland, United Kingdom, United States, and all countries in the European Economic Area except Iceland. - /// Check this [page](https://support.stripe.com/questions/accepting-japan-credit-bureau-%28jcb%29-payments) for more details. - #[serde(skip_serializing_if = "Option::is_none")] - pub jcb: Option, - - /// Klarna gives customers a range of [payment options](https://stripe.com/docs/payments/klarna#payment-options) during checkout. - /// - /// Available payment options vary depending on the customer's billing address and the transaction amount. - /// These payment options make it convenient for customers to purchase items in all price ranges. - /// Check this [page](https://stripe.com/docs/payments/klarna) for more details. - #[serde(skip_serializing_if = "Option::is_none")] - pub klarna: Option, - - /// Konbini allows customers in Japan to pay for bills and online purchases at convenience stores with cash. - /// - /// Check this [page](https://stripe.com/docs/payments/konbini) for more details. - #[serde(skip_serializing_if = "Option::is_none")] - pub konbini: Option, - - /// [Link](https://stripe.com/docs/payments/link) is a payment method network. - /// - /// With Link, users save their payment details once, then reuse that information to pay with one click for any business on the network. - #[serde(skip_serializing_if = "Option::is_none")] - pub link: Option, - - /// Configuration name. - #[serde(skip_serializing_if = "Option::is_none")] - pub name: Option<&'a str>, - - /// OXXO is a Mexican chain of convenience stores with thousands of locations across Latin America and represents nearly 20% of online transactions in Mexico. - /// - /// OXXO allows customers to pay bills and online purchases in-store with cash. - /// Check this [page](https://stripe.com/docs/payments/oxxo) for more details. - #[serde(skip_serializing_if = "Option::is_none")] - pub oxxo: Option, - - /// Przelewy24 is a Poland-based payment method aggregator that allows customers to complete transactions online using bank transfers and other methods. - /// - /// Bank transfers account for 30% of online payments in Poland and Przelewy24 provides a way for customers to pay with over 165 banks. - /// Check this [page](https://stripe.com/docs/payments/p24) for more details. - #[serde(skip_serializing_if = "Option::is_none")] - pub p24: Option, - - /// Configuration's parent configuration. - /// - /// Specify to create a child configuration. - #[serde(skip_serializing_if = "Option::is_none")] - pub parent: Option<&'a str>, - - /// PayNow is a Singapore-based payment method that allows customers to make a payment using their preferred app from participating banks and participating non-bank financial institutions. - /// - /// Check this [page](https://stripe.com/docs/payments/paynow) for more details. - #[serde(skip_serializing_if = "Option::is_none")] - pub paynow: Option, - - /// PayPal, a digital wallet popular with customers in Europe, allows your customers worldwide to pay using their PayPal account. - /// - /// Check this [page](https://stripe.com/docs/payments/paypal) for more details. - #[serde(skip_serializing_if = "Option::is_none")] - pub paypal: Option, - - /// PromptPay is a Thailand-based payment method that allows customers to make a payment using their preferred app from participating banks. - /// - /// Check this [page](https://stripe.com/docs/payments/promptpay) for more details. - #[serde(skip_serializing_if = "Option::is_none")] - pub promptpay: Option, - - /// Revolut Pay, developed by Revolut, a global finance app, is a digital wallet payment method. - /// - /// Revolut Pay uses the customer’s stored balance or cards to fund the payment, and offers the option for non-Revolut customers to save their details after their first purchase. - #[serde(skip_serializing_if = "Option::is_none")] - pub revolut_pay: Option, - - /// The [Single Euro Payments Area (SEPA)](https://en.wikipedia.org/wiki/Single_Euro_Payments_Area) is an initiative of the European Union to simplify payments within and across member countries. - /// - /// SEPA established and enforced banking standards to allow for the direct debiting of every EUR-denominated bank account within the SEPA region, check this [page](https://stripe.com/docs/payments/sepa-debit) for more details. - #[serde(skip_serializing_if = "Option::is_none")] - pub sepa_debit: Option, - - /// Stripe users in Europe and the United States can use the [Payment Intents API](https://stripe.com/docs/payments/payment-intents)—a single integration path for creating payments using any supported method—to accept [Sofort](https://www.sofort.com/) payments from customers. - /// - /// Check this [page](https://stripe.com/docs/payments/sofort) for more details. - #[serde(skip_serializing_if = "Option::is_none")] - pub sofort: Option, - - /// Stripe users in the United States can accept ACH direct debit payments from customers with a US bank account using the Automated Clearing House (ACH) payments system operated by Nacha. - /// - /// Check this [page](https://stripe.com/docs/payments/ach-debit) for more details. - #[serde(skip_serializing_if = "Option::is_none")] - pub us_bank_account: Option, - - /// WeChat, owned by Tencent, is China's leading mobile app with over 1 billion monthly active users. - /// - /// Chinese consumers can use WeChat Pay to pay for goods and services inside of businesses' apps and websites. - /// WeChat Pay users buy most frequently in gaming, e-commerce, travel, online education, and food/nutrition. - /// Check this [page](https://stripe.com/docs/payments/wechat-pay) for more details. - #[serde(skip_serializing_if = "Option::is_none")] - pub wechat_pay: Option, -} - -impl<'a> CreatePaymentMethodConfiguration<'a> { - pub fn new() -> Self { - CreatePaymentMethodConfiguration { - acss_debit: Default::default(), - affirm: Default::default(), - afterpay_clearpay: Default::default(), - alipay: Default::default(), - apple_pay: Default::default(), - apple_pay_later: Default::default(), - au_becs_debit: Default::default(), - bacs_debit: Default::default(), - bancontact: Default::default(), - blik: Default::default(), - boleto: Default::default(), - card: Default::default(), - cartes_bancaires: Default::default(), - cashapp: Default::default(), - customer_balance: Default::default(), - eps: Default::default(), - expand: Default::default(), - fpx: Default::default(), - giropay: Default::default(), - google_pay: Default::default(), - grabpay: Default::default(), - ideal: Default::default(), - jcb: Default::default(), - klarna: Default::default(), - konbini: Default::default(), - link: Default::default(), - name: Default::default(), - oxxo: Default::default(), - p24: Default::default(), - parent: Default::default(), - paynow: Default::default(), - paypal: Default::default(), - promptpay: Default::default(), - revolut_pay: Default::default(), - sepa_debit: Default::default(), - sofort: Default::default(), - us_bank_account: Default::default(), - wechat_pay: Default::default(), - } - } -} - -/// The parameters for `PaymentMethodConfiguration::list`. -#[derive(Clone, Debug, Serialize, Default)] -pub struct ListPaymentMethodConfigurations<'a> { - - /// The Connect application to filter by. - #[serde(skip_serializing_if = "Option::is_none")] - pub application: Option, - - /// Specifies which fields in the response should be expanded. - #[serde(skip_serializing_if = "Expand::is_empty")] - pub expand: &'a [&'a str], -} - -impl<'a> ListPaymentMethodConfigurations<'a> { - pub fn new() -> Self { - ListPaymentMethodConfigurations { - application: Default::default(), - expand: Default::default(), - } - } -} -impl Paginable for ListPaymentMethodConfigurations<'_> { - type O = PaymentMethodConfiguration; - fn set_last(&mut self, item: Self::O) { - self.starting_after = Some(item.id()); - }} -/// The parameters for `PaymentMethodConfiguration::update`. -#[derive(Clone, Debug, Serialize, Default)] -pub struct UpdatePaymentMethodConfiguration<'a> { - - /// Canadian pre-authorized debit payments, check this [page](https://stripe.com/docs/payments/acss-debit) for more details like country availability. - #[serde(skip_serializing_if = "Option::is_none")] - pub acss_debit: Option, - - /// Whether the configuration can be used for new payments. - #[serde(skip_serializing_if = "Option::is_none")] - pub active: Option, - - /// [Affirm](https://www.affirm.com/) gives your customers a way to split purchases over a series of payments. - /// - /// Depending on the purchase, they can pay with four interest-free payments (Split Pay) or pay over a longer term (Installments), which might include interest. - /// Check this [page](https://stripe.com/docs/payments/affirm) for more details like country availability. - #[serde(skip_serializing_if = "Option::is_none")] - pub affirm: Option, - - /// Afterpay gives your customers a way to pay for purchases in installments, check this [page](https://stripe.com/docs/payments/afterpay-clearpay) for more details like country availability. - /// - /// Afterpay is particularly popular among businesses selling fashion, beauty, and sports products. - #[serde(skip_serializing_if = "Option::is_none")] - pub afterpay_clearpay: Option, - - /// Alipay is a digital wallet in China that has more than a billion active users worldwide. - /// - /// Alipay users can pay on the web or on a mobile device using login credentials or their Alipay app. - /// Alipay has a low dispute rate and reduces fraud by authenticating payments using the customer's login credentials. - /// Check this [page](https://stripe.com/docs/payments/alipay) for more details. - #[serde(skip_serializing_if = "Option::is_none")] - pub alipay: Option, - - /// Stripe users can accept [Apple Pay](/payments/apple-pay) in iOS applications in iOS 9 and later, and on the web in Safari starting with iOS 10 or macOS Sierra. - /// - /// There are no additional fees to process Apple Pay payments, and the [pricing](/pricing) is the same as other card transactions. - /// Check this [page](https://stripe.com/docs/apple-pay) for more details. - #[serde(skip_serializing_if = "Option::is_none")] - pub apple_pay: Option, - - /// Apple Pay Later, a payment method for customers to buy now and pay later, gives your customers a way to split purchases into four installments across six weeks. - #[serde(skip_serializing_if = "Option::is_none")] - pub apple_pay_later: Option, - - /// Stripe users in Australia can accept Bulk Electronic Clearing System (BECS) direct debit payments from customers with an Australian bank account. - /// - /// Check this [page](https://stripe.com/docs/payments/au-becs-debit) for more details. - #[serde(skip_serializing_if = "Option::is_none")] - pub au_becs_debit: Option, - - /// Stripe users in the UK can accept Bacs Direct Debit payments from customers with a UK bank account, check this [page](https://stripe.com/docs/payments/payment-methods/bacs-debit) for more details. - #[serde(skip_serializing_if = "Option::is_none")] - pub bacs_debit: Option, - - /// Bancontact is the most popular online payment method in Belgium, with over 15 million cards in circulation. - /// - /// [Customers](https://stripe.com/docs/api/customers) use a Bancontact card or mobile app linked to a Belgian bank account to make online payments that are secure, guaranteed, and confirmed immediately. - /// Check this [page](https://stripe.com/docs/payments/bancontact) for more details. - #[serde(skip_serializing_if = "Option::is_none")] - pub bancontact: Option, - - /// BLIK is a [single use](https://stripe.com/docs/payments/payment-methods#usage) payment method that requires customers to authenticate their payments. - /// - /// When customers want to pay online using BLIK, they request a six-digit code from their banking application and enter it into the payment collection form. - /// Check this [page](https://stripe.com/docs/payments/blik) for more details. - #[serde(skip_serializing_if = "Option::is_none")] - pub blik: Option, - - /// Boleto is an official (regulated by the Central Bank of Brazil) payment method in Brazil. - /// - /// Check this [page](https://stripe.com/docs/payments/boleto) for more details. - #[serde(skip_serializing_if = "Option::is_none")] - pub boleto: Option, - - /// Cards are a popular way for consumers and businesses to pay online or in person. - /// - /// Stripe supports global and local card networks. - #[serde(skip_serializing_if = "Option::is_none")] - pub card: Option, - - /// Cartes Bancaires is France's local card network. - /// - /// More than 95% of these cards are co-branded with either Visa or Mastercard, meaning you can process these cards over either Cartes Bancaires or the Visa or Mastercard networks. - /// Check this [page](https://stripe.com/docs/payments/cartes-bancaires) for more details. - #[serde(skip_serializing_if = "Option::is_none")] - pub cartes_bancaires: Option, - - /// Cash App is a popular consumer app in the US that allows customers to bank, invest, send, and receive money using their digital wallet. - /// - /// Check this [page](https://stripe.com/docs/payments/cash-app-pay) for more details. - #[serde(skip_serializing_if = "Option::is_none")] - pub cashapp: Option, - - /// Uses a customer’s [cash balance](https://stripe.com/docs/payments/customer-balance) for the payment. - /// - /// The cash balance can be funded via a bank transfer. - /// Check this [page](https://stripe.com/docs/payments/bank-transfers) for more details. - #[serde(skip_serializing_if = "Option::is_none")] - pub customer_balance: Option, - - /// EPS is an Austria-based payment method that allows customers to complete transactions online using their bank credentials. - /// - /// EPS is supported by all Austrian banks and is accepted by over 80% of Austrian online retailers. - /// Check this [page](https://stripe.com/docs/payments/eps) for more details. - #[serde(skip_serializing_if = "Option::is_none")] - pub eps: Option, - - /// Specifies which fields in the response should be expanded. - #[serde(skip_serializing_if = "Expand::is_empty")] - pub expand: &'a [&'a str], - - /// Financial Process Exchange (FPX) is a Malaysia-based payment method that allows customers to complete transactions online using their bank credentials. - /// - /// Bank Negara Malaysia (BNM), the Central Bank of Malaysia, and eleven other major Malaysian financial institutions are members of the PayNet Group, which owns and operates FPX. - /// It is one of the most popular online payment methods in Malaysia, with nearly 90 million transactions in 2018 according to BNM. - /// Check this [page](https://stripe.com/docs/payments/fpx) for more details. - #[serde(skip_serializing_if = "Option::is_none")] - pub fpx: Option, - - /// giropay is a German payment method based on online banking, introduced in 2006. - /// - /// It allows customers to complete transactions online using their online banking environment, with funds debited from their bank account. - /// Depending on their bank, customers confirm payments on giropay using a second factor of authentication or a PIN. - /// giropay accounts for 10% of online checkouts in Germany. - /// Check this [page](https://stripe.com/docs/payments/giropay) for more details. - #[serde(skip_serializing_if = "Option::is_none")] - pub giropay: Option, - - /// Google Pay allows customers to make payments in your app or website using any credit or debit card saved to their Google Account, including those from Google Play, YouTube, Chrome, or an Android device. - /// - /// Use the Google Pay API to request any credit or debit card stored in your customer's Google account. - /// Check this [page](https://stripe.com/docs/google-pay) for more details. - #[serde(skip_serializing_if = "Option::is_none")] - pub google_pay: Option, - - /// GrabPay is a payment method developed by [Grab](https://www.grab.com/sg/consumer/finance/pay/). - /// - /// GrabPay is a digital wallet - customers maintain a balance in their wallets that they pay out with. - /// Check this [page](https://stripe.com/docs/payments/grabpay) for more details. - #[serde(skip_serializing_if = "Option::is_none")] - pub grabpay: Option, - - /// iDEAL is a Netherlands-based payment method that allows customers to complete transactions online using their bank credentials. - /// - /// All major Dutch banks are members of Currence, the scheme that operates iDEAL, making it the most popular online payment method in the Netherlands with a share of online transactions close to 55%. - /// Check this [page](https://stripe.com/docs/payments/ideal) for more details. - #[serde(skip_serializing_if = "Option::is_none")] - pub ideal: Option, - - /// JCB is a credit card company based in Japan. - /// - /// JCB is currently available in Japan to businesses approved by JCB, and available to all businesses in Australia, Canada, Hong Kong, Japan, New Zealand, Singapore, Switzerland, United Kingdom, United States, and all countries in the European Economic Area except Iceland. - /// Check this [page](https://support.stripe.com/questions/accepting-japan-credit-bureau-%28jcb%29-payments) for more details. - #[serde(skip_serializing_if = "Option::is_none")] - pub jcb: Option, - - /// Klarna gives customers a range of [payment options](https://stripe.com/docs/payments/klarna#payment-options) during checkout. - /// - /// Available payment options vary depending on the customer's billing address and the transaction amount. - /// These payment options make it convenient for customers to purchase items in all price ranges. - /// Check this [page](https://stripe.com/docs/payments/klarna) for more details. - #[serde(skip_serializing_if = "Option::is_none")] - pub klarna: Option, - - /// Konbini allows customers in Japan to pay for bills and online purchases at convenience stores with cash. - /// - /// Check this [page](https://stripe.com/docs/payments/konbini) for more details. - #[serde(skip_serializing_if = "Option::is_none")] - pub konbini: Option, - - /// [Link](https://stripe.com/docs/payments/link) is a payment method network. - /// - /// With Link, users save their payment details once, then reuse that information to pay with one click for any business on the network. - #[serde(skip_serializing_if = "Option::is_none")] - pub link: Option, - - /// Configuration name. - #[serde(skip_serializing_if = "Option::is_none")] - pub name: Option<&'a str>, - - /// OXXO is a Mexican chain of convenience stores with thousands of locations across Latin America and represents nearly 20% of online transactions in Mexico. - /// - /// OXXO allows customers to pay bills and online purchases in-store with cash. - /// Check this [page](https://stripe.com/docs/payments/oxxo) for more details. - #[serde(skip_serializing_if = "Option::is_none")] - pub oxxo: Option, - - /// Przelewy24 is a Poland-based payment method aggregator that allows customers to complete transactions online using bank transfers and other methods. - /// - /// Bank transfers account for 30% of online payments in Poland and Przelewy24 provides a way for customers to pay with over 165 banks. - /// Check this [page](https://stripe.com/docs/payments/p24) for more details. - #[serde(skip_serializing_if = "Option::is_none")] - pub p24: Option, - - /// PayNow is a Singapore-based payment method that allows customers to make a payment using their preferred app from participating banks and participating non-bank financial institutions. - /// - /// Check this [page](https://stripe.com/docs/payments/paynow) for more details. - #[serde(skip_serializing_if = "Option::is_none")] - pub paynow: Option, - - /// PayPal, a digital wallet popular with customers in Europe, allows your customers worldwide to pay using their PayPal account. - /// - /// Check this [page](https://stripe.com/docs/payments/paypal) for more details. - #[serde(skip_serializing_if = "Option::is_none")] - pub paypal: Option, - - /// PromptPay is a Thailand-based payment method that allows customers to make a payment using their preferred app from participating banks. - /// - /// Check this [page](https://stripe.com/docs/payments/promptpay) for more details. - #[serde(skip_serializing_if = "Option::is_none")] - pub promptpay: Option, - - /// Revolut Pay, developed by Revolut, a global finance app, is a digital wallet payment method. - /// - /// Revolut Pay uses the customer’s stored balance or cards to fund the payment, and offers the option for non-Revolut customers to save their details after their first purchase. - #[serde(skip_serializing_if = "Option::is_none")] - pub revolut_pay: Option, - - /// The [Single Euro Payments Area (SEPA)](https://en.wikipedia.org/wiki/Single_Euro_Payments_Area) is an initiative of the European Union to simplify payments within and across member countries. - /// - /// SEPA established and enforced banking standards to allow for the direct debiting of every EUR-denominated bank account within the SEPA region, check this [page](https://stripe.com/docs/payments/sepa-debit) for more details. - #[serde(skip_serializing_if = "Option::is_none")] - pub sepa_debit: Option, - - /// Stripe users in Europe and the United States can use the [Payment Intents API](https://stripe.com/docs/payments/payment-intents)—a single integration path for creating payments using any supported method—to accept [Sofort](https://www.sofort.com/) payments from customers. - /// - /// Check this [page](https://stripe.com/docs/payments/sofort) for more details. - #[serde(skip_serializing_if = "Option::is_none")] - pub sofort: Option, - - /// Stripe users in the United States can accept ACH direct debit payments from customers with a US bank account using the Automated Clearing House (ACH) payments system operated by Nacha. - /// - /// Check this [page](https://stripe.com/docs/payments/ach-debit) for more details. - #[serde(skip_serializing_if = "Option::is_none")] - pub us_bank_account: Option, - - /// WeChat, owned by Tencent, is China's leading mobile app with over 1 billion monthly active users. - /// - /// Chinese consumers can use WeChat Pay to pay for goods and services inside of businesses' apps and websites. - /// WeChat Pay users buy most frequently in gaming, e-commerce, travel, online education, and food/nutrition. - /// Check this [page](https://stripe.com/docs/payments/wechat-pay) for more details. - #[serde(skip_serializing_if = "Option::is_none")] - pub wechat_pay: Option, -} - -impl<'a> UpdatePaymentMethodConfiguration<'a> { - pub fn new() -> Self { - UpdatePaymentMethodConfiguration { - acss_debit: Default::default(), - active: Default::default(), - affirm: Default::default(), - afterpay_clearpay: Default::default(), - alipay: Default::default(), - apple_pay: Default::default(), - apple_pay_later: Default::default(), - au_becs_debit: Default::default(), - bacs_debit: Default::default(), - bancontact: Default::default(), - blik: Default::default(), - boleto: Default::default(), - card: Default::default(), - cartes_bancaires: Default::default(), - cashapp: Default::default(), - customer_balance: Default::default(), - eps: Default::default(), - expand: Default::default(), - fpx: Default::default(), - giropay: Default::default(), - google_pay: Default::default(), - grabpay: Default::default(), - ideal: Default::default(), - jcb: Default::default(), - klarna: Default::default(), - konbini: Default::default(), - link: Default::default(), - name: Default::default(), - oxxo: Default::default(), - p24: Default::default(), - paynow: Default::default(), - paypal: Default::default(), - promptpay: Default::default(), - revolut_pay: Default::default(), - sepa_debit: Default::default(), - sofort: Default::default(), - us_bank_account: Default::default(), - wechat_pay: Default::default(), - } - } -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreatePaymentMethodConfigurationAcssDebit { - - /// Whether or not the payment method should be displayed. - #[serde(skip_serializing_if = "Option::is_none")] - pub display_preference: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreatePaymentMethodConfigurationAffirm { - - /// Whether or not the payment method should be displayed. - #[serde(skip_serializing_if = "Option::is_none")] - pub display_preference: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreatePaymentMethodConfigurationAfterpayClearpay { - - /// Whether or not the payment method should be displayed. - #[serde(skip_serializing_if = "Option::is_none")] - pub display_preference: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreatePaymentMethodConfigurationAlipay { - - /// Whether or not the payment method should be displayed. - #[serde(skip_serializing_if = "Option::is_none")] - pub display_preference: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreatePaymentMethodConfigurationApplePay { - - /// Whether or not the payment method should be displayed. - #[serde(skip_serializing_if = "Option::is_none")] - pub display_preference: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreatePaymentMethodConfigurationApplePayLater { - - /// Whether or not the payment method should be displayed. - #[serde(skip_serializing_if = "Option::is_none")] - pub display_preference: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreatePaymentMethodConfigurationAuBecsDebit { - - /// Whether or not the payment method should be displayed. - #[serde(skip_serializing_if = "Option::is_none")] - pub display_preference: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreatePaymentMethodConfigurationBacsDebit { - - /// Whether or not the payment method should be displayed. - #[serde(skip_serializing_if = "Option::is_none")] - pub display_preference: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreatePaymentMethodConfigurationBancontact { - - /// Whether or not the payment method should be displayed. - #[serde(skip_serializing_if = "Option::is_none")] - pub display_preference: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreatePaymentMethodConfigurationBlik { - - /// Whether or not the payment method should be displayed. - #[serde(skip_serializing_if = "Option::is_none")] - pub display_preference: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreatePaymentMethodConfigurationBoleto { - - /// Whether or not the payment method should be displayed. - #[serde(skip_serializing_if = "Option::is_none")] - pub display_preference: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreatePaymentMethodConfigurationCartesBancaires { - - /// Whether or not the payment method should be displayed. - #[serde(skip_serializing_if = "Option::is_none")] - pub display_preference: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreatePaymentMethodConfigurationCashapp { - - /// Whether or not the payment method should be displayed. - #[serde(skip_serializing_if = "Option::is_none")] - pub display_preference: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreatePaymentMethodConfigurationCustomerBalance { - - /// Whether or not the payment method should be displayed. - #[serde(skip_serializing_if = "Option::is_none")] - pub display_preference: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreatePaymentMethodConfigurationEps { - - /// Whether or not the payment method should be displayed. - #[serde(skip_serializing_if = "Option::is_none")] - pub display_preference: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreatePaymentMethodConfigurationFpx { - - /// Whether or not the payment method should be displayed. - #[serde(skip_serializing_if = "Option::is_none")] - pub display_preference: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreatePaymentMethodConfigurationGiropay { - - /// Whether or not the payment method should be displayed. - #[serde(skip_serializing_if = "Option::is_none")] - pub display_preference: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreatePaymentMethodConfigurationGooglePay { - - /// Whether or not the payment method should be displayed. - #[serde(skip_serializing_if = "Option::is_none")] - pub display_preference: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreatePaymentMethodConfigurationGrabpay { - - /// Whether or not the payment method should be displayed. - #[serde(skip_serializing_if = "Option::is_none")] - pub display_preference: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreatePaymentMethodConfigurationIdeal { - - /// Whether or not the payment method should be displayed. - #[serde(skip_serializing_if = "Option::is_none")] - pub display_preference: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreatePaymentMethodConfigurationJcb { - - /// Whether or not the payment method should be displayed. - #[serde(skip_serializing_if = "Option::is_none")] - pub display_preference: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreatePaymentMethodConfigurationKlarna { - - /// Whether or not the payment method should be displayed. - #[serde(skip_serializing_if = "Option::is_none")] - pub display_preference: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreatePaymentMethodConfigurationKonbini { - - /// Whether or not the payment method should be displayed. - #[serde(skip_serializing_if = "Option::is_none")] - pub display_preference: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreatePaymentMethodConfigurationLink { - - /// Whether or not the payment method should be displayed. - #[serde(skip_serializing_if = "Option::is_none")] - pub display_preference: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreatePaymentMethodConfigurationOxxo { - - /// Whether or not the payment method should be displayed. - #[serde(skip_serializing_if = "Option::is_none")] - pub display_preference: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreatePaymentMethodConfigurationP24 { - - /// Whether or not the payment method should be displayed. - #[serde(skip_serializing_if = "Option::is_none")] - pub display_preference: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreatePaymentMethodConfigurationPaynow { - - /// Whether or not the payment method should be displayed. - #[serde(skip_serializing_if = "Option::is_none")] - pub display_preference: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreatePaymentMethodConfigurationPaypal { - - /// Whether or not the payment method should be displayed. - #[serde(skip_serializing_if = "Option::is_none")] - pub display_preference: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreatePaymentMethodConfigurationPromptpay { - - /// Whether or not the payment method should be displayed. - #[serde(skip_serializing_if = "Option::is_none")] - pub display_preference: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreatePaymentMethodConfigurationRevolutPay { - - /// Whether or not the payment method should be displayed. - #[serde(skip_serializing_if = "Option::is_none")] - pub display_preference: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreatePaymentMethodConfigurationSepaDebit { - - /// Whether or not the payment method should be displayed. - #[serde(skip_serializing_if = "Option::is_none")] - pub display_preference: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreatePaymentMethodConfigurationSofort { - - /// Whether or not the payment method should be displayed. - #[serde(skip_serializing_if = "Option::is_none")] - pub display_preference: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreatePaymentMethodConfigurationUsBankAccount { - - /// Whether or not the payment method should be displayed. - #[serde(skip_serializing_if = "Option::is_none")] - pub display_preference: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreatePaymentMethodConfigurationWechatPay { - - /// Whether or not the payment method should be displayed. - #[serde(skip_serializing_if = "Option::is_none")] - pub display_preference: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UpdatePaymentMethodConfigurationAcssDebit { - - /// Whether or not the payment method should be displayed. - #[serde(skip_serializing_if = "Option::is_none")] - pub display_preference: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UpdatePaymentMethodConfigurationAffirm { - - /// Whether or not the payment method should be displayed. - #[serde(skip_serializing_if = "Option::is_none")] - pub display_preference: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UpdatePaymentMethodConfigurationAfterpayClearpay { - - /// Whether or not the payment method should be displayed. - #[serde(skip_serializing_if = "Option::is_none")] - pub display_preference: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UpdatePaymentMethodConfigurationAlipay { - - /// Whether or not the payment method should be displayed. - #[serde(skip_serializing_if = "Option::is_none")] - pub display_preference: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UpdatePaymentMethodConfigurationApplePay { - - /// Whether or not the payment method should be displayed. - #[serde(skip_serializing_if = "Option::is_none")] - pub display_preference: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UpdatePaymentMethodConfigurationApplePayLater { - - /// Whether or not the payment method should be displayed. - #[serde(skip_serializing_if = "Option::is_none")] - pub display_preference: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UpdatePaymentMethodConfigurationAuBecsDebit { - - /// Whether or not the payment method should be displayed. - #[serde(skip_serializing_if = "Option::is_none")] - pub display_preference: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UpdatePaymentMethodConfigurationBacsDebit { - - /// Whether or not the payment method should be displayed. - #[serde(skip_serializing_if = "Option::is_none")] - pub display_preference: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UpdatePaymentMethodConfigurationBancontact { - - /// Whether or not the payment method should be displayed. - #[serde(skip_serializing_if = "Option::is_none")] - pub display_preference: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UpdatePaymentMethodConfigurationBlik { - - /// Whether or not the payment method should be displayed. - #[serde(skip_serializing_if = "Option::is_none")] - pub display_preference: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UpdatePaymentMethodConfigurationBoleto { - - /// Whether or not the payment method should be displayed. - #[serde(skip_serializing_if = "Option::is_none")] - pub display_preference: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UpdatePaymentMethodConfigurationCartesBancaires { - - /// Whether or not the payment method should be displayed. - #[serde(skip_serializing_if = "Option::is_none")] - pub display_preference: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UpdatePaymentMethodConfigurationCashapp { - - /// Whether or not the payment method should be displayed. - #[serde(skip_serializing_if = "Option::is_none")] - pub display_preference: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UpdatePaymentMethodConfigurationCustomerBalance { - - /// Whether or not the payment method should be displayed. - #[serde(skip_serializing_if = "Option::is_none")] - pub display_preference: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UpdatePaymentMethodConfigurationEps { - - /// Whether or not the payment method should be displayed. - #[serde(skip_serializing_if = "Option::is_none")] - pub display_preference: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UpdatePaymentMethodConfigurationFpx { - - /// Whether or not the payment method should be displayed. - #[serde(skip_serializing_if = "Option::is_none")] - pub display_preference: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UpdatePaymentMethodConfigurationGiropay { - - /// Whether or not the payment method should be displayed. - #[serde(skip_serializing_if = "Option::is_none")] - pub display_preference: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UpdatePaymentMethodConfigurationGooglePay { - - /// Whether or not the payment method should be displayed. - #[serde(skip_serializing_if = "Option::is_none")] - pub display_preference: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UpdatePaymentMethodConfigurationGrabpay { - - /// Whether or not the payment method should be displayed. - #[serde(skip_serializing_if = "Option::is_none")] - pub display_preference: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UpdatePaymentMethodConfigurationIdeal { - - /// Whether or not the payment method should be displayed. - #[serde(skip_serializing_if = "Option::is_none")] - pub display_preference: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UpdatePaymentMethodConfigurationJcb { - - /// Whether or not the payment method should be displayed. - #[serde(skip_serializing_if = "Option::is_none")] - pub display_preference: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UpdatePaymentMethodConfigurationKlarna { - - /// Whether or not the payment method should be displayed. - #[serde(skip_serializing_if = "Option::is_none")] - pub display_preference: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UpdatePaymentMethodConfigurationKonbini { - - /// Whether or not the payment method should be displayed. - #[serde(skip_serializing_if = "Option::is_none")] - pub display_preference: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UpdatePaymentMethodConfigurationLink { - - /// Whether or not the payment method should be displayed. - #[serde(skip_serializing_if = "Option::is_none")] - pub display_preference: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UpdatePaymentMethodConfigurationOxxo { - - /// Whether or not the payment method should be displayed. - #[serde(skip_serializing_if = "Option::is_none")] - pub display_preference: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UpdatePaymentMethodConfigurationP24 { - - /// Whether or not the payment method should be displayed. - #[serde(skip_serializing_if = "Option::is_none")] - pub display_preference: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UpdatePaymentMethodConfigurationPaynow { - - /// Whether or not the payment method should be displayed. - #[serde(skip_serializing_if = "Option::is_none")] - pub display_preference: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UpdatePaymentMethodConfigurationPaypal { - - /// Whether or not the payment method should be displayed. - #[serde(skip_serializing_if = "Option::is_none")] - pub display_preference: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UpdatePaymentMethodConfigurationPromptpay { - - /// Whether or not the payment method should be displayed. - #[serde(skip_serializing_if = "Option::is_none")] - pub display_preference: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UpdatePaymentMethodConfigurationRevolutPay { - - /// Whether or not the payment method should be displayed. - #[serde(skip_serializing_if = "Option::is_none")] - pub display_preference: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UpdatePaymentMethodConfigurationSepaDebit { - - /// Whether or not the payment method should be displayed. - #[serde(skip_serializing_if = "Option::is_none")] - pub display_preference: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UpdatePaymentMethodConfigurationSofort { - - /// Whether or not the payment method should be displayed. - #[serde(skip_serializing_if = "Option::is_none")] - pub display_preference: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UpdatePaymentMethodConfigurationUsBankAccount { - - /// Whether or not the payment method should be displayed. - #[serde(skip_serializing_if = "Option::is_none")] - pub display_preference: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UpdatePaymentMethodConfigurationWechatPay { - - /// Whether or not the payment method should be displayed. - #[serde(skip_serializing_if = "Option::is_none")] - pub display_preference: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreatePaymentMethodConfigurationAcssDebitDisplayPreference { - - /// The account's preference for whether or not to display this payment method. - #[serde(skip_serializing_if = "Option::is_none")] - pub preference: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreatePaymentMethodConfigurationAffirmDisplayPreference { - - /// The account's preference for whether or not to display this payment method. - #[serde(skip_serializing_if = "Option::is_none")] - pub preference: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreatePaymentMethodConfigurationAfterpayClearpayDisplayPreference { - - /// The account's preference for whether or not to display this payment method. - #[serde(skip_serializing_if = "Option::is_none")] - pub preference: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreatePaymentMethodConfigurationAlipayDisplayPreference { - - /// The account's preference for whether or not to display this payment method. - #[serde(skip_serializing_if = "Option::is_none")] - pub preference: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreatePaymentMethodConfigurationApplePayDisplayPreference { - - /// The account's preference for whether or not to display this payment method. - #[serde(skip_serializing_if = "Option::is_none")] - pub preference: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreatePaymentMethodConfigurationApplePayLaterDisplayPreference { - - /// The account's preference for whether or not to display this payment method. - #[serde(skip_serializing_if = "Option::is_none")] - pub preference: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreatePaymentMethodConfigurationAuBecsDebitDisplayPreference { - - /// The account's preference for whether or not to display this payment method. - #[serde(skip_serializing_if = "Option::is_none")] - pub preference: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreatePaymentMethodConfigurationBacsDebitDisplayPreference { - - /// The account's preference for whether or not to display this payment method. - #[serde(skip_serializing_if = "Option::is_none")] - pub preference: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreatePaymentMethodConfigurationBancontactDisplayPreference { - - /// The account's preference for whether or not to display this payment method. - #[serde(skip_serializing_if = "Option::is_none")] - pub preference: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreatePaymentMethodConfigurationBlikDisplayPreference { - - /// The account's preference for whether or not to display this payment method. - #[serde(skip_serializing_if = "Option::is_none")] - pub preference: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreatePaymentMethodConfigurationBoletoDisplayPreference { - - /// The account's preference for whether or not to display this payment method. - #[serde(skip_serializing_if = "Option::is_none")] - pub preference: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreatePaymentMethodConfigurationCartesBancairesDisplayPreference { - - /// The account's preference for whether or not to display this payment method. - #[serde(skip_serializing_if = "Option::is_none")] - pub preference: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreatePaymentMethodConfigurationCashappDisplayPreference { - - /// The account's preference for whether or not to display this payment method. - #[serde(skip_serializing_if = "Option::is_none")] - pub preference: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreatePaymentMethodConfigurationCustomerBalanceDisplayPreference { - - /// The account's preference for whether or not to display this payment method. - #[serde(skip_serializing_if = "Option::is_none")] - pub preference: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreatePaymentMethodConfigurationEpsDisplayPreference { - - /// The account's preference for whether or not to display this payment method. - #[serde(skip_serializing_if = "Option::is_none")] - pub preference: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreatePaymentMethodConfigurationFpxDisplayPreference { - - /// The account's preference for whether or not to display this payment method. - #[serde(skip_serializing_if = "Option::is_none")] - pub preference: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreatePaymentMethodConfigurationGiropayDisplayPreference { - - /// The account's preference for whether or not to display this payment method. - #[serde(skip_serializing_if = "Option::is_none")] - pub preference: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreatePaymentMethodConfigurationGooglePayDisplayPreference { - - /// The account's preference for whether or not to display this payment method. - #[serde(skip_serializing_if = "Option::is_none")] - pub preference: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreatePaymentMethodConfigurationGrabpayDisplayPreference { - - /// The account's preference for whether or not to display this payment method. - #[serde(skip_serializing_if = "Option::is_none")] - pub preference: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreatePaymentMethodConfigurationIdealDisplayPreference { - - /// The account's preference for whether or not to display this payment method. - #[serde(skip_serializing_if = "Option::is_none")] - pub preference: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreatePaymentMethodConfigurationJcbDisplayPreference { - - /// The account's preference for whether or not to display this payment method. - #[serde(skip_serializing_if = "Option::is_none")] - pub preference: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreatePaymentMethodConfigurationKlarnaDisplayPreference { - - /// The account's preference for whether or not to display this payment method. - #[serde(skip_serializing_if = "Option::is_none")] - pub preference: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreatePaymentMethodConfigurationKonbiniDisplayPreference { - - /// The account's preference for whether or not to display this payment method. - #[serde(skip_serializing_if = "Option::is_none")] - pub preference: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreatePaymentMethodConfigurationLinkDisplayPreference { - - /// The account's preference for whether or not to display this payment method. - #[serde(skip_serializing_if = "Option::is_none")] - pub preference: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreatePaymentMethodConfigurationOxxoDisplayPreference { - - /// The account's preference for whether or not to display this payment method. - #[serde(skip_serializing_if = "Option::is_none")] - pub preference: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreatePaymentMethodConfigurationP24DisplayPreference { - - /// The account's preference for whether or not to display this payment method. - #[serde(skip_serializing_if = "Option::is_none")] - pub preference: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreatePaymentMethodConfigurationPaynowDisplayPreference { - - /// The account's preference for whether or not to display this payment method. - #[serde(skip_serializing_if = "Option::is_none")] - pub preference: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreatePaymentMethodConfigurationPaypalDisplayPreference { - - /// The account's preference for whether or not to display this payment method. - #[serde(skip_serializing_if = "Option::is_none")] - pub preference: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreatePaymentMethodConfigurationPromptpayDisplayPreference { - - /// The account's preference for whether or not to display this payment method. - #[serde(skip_serializing_if = "Option::is_none")] - pub preference: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreatePaymentMethodConfigurationRevolutPayDisplayPreference { - - /// The account's preference for whether or not to display this payment method. - #[serde(skip_serializing_if = "Option::is_none")] - pub preference: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreatePaymentMethodConfigurationSepaDebitDisplayPreference { - - /// The account's preference for whether or not to display this payment method. - #[serde(skip_serializing_if = "Option::is_none")] - pub preference: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreatePaymentMethodConfigurationSofortDisplayPreference { - - /// The account's preference for whether or not to display this payment method. - #[serde(skip_serializing_if = "Option::is_none")] - pub preference: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreatePaymentMethodConfigurationUsBankAccountDisplayPreference { - - /// The account's preference for whether or not to display this payment method. - #[serde(skip_serializing_if = "Option::is_none")] - pub preference: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreatePaymentMethodConfigurationWechatPayDisplayPreference { - - /// The account's preference for whether or not to display this payment method. - #[serde(skip_serializing_if = "Option::is_none")] - pub preference: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UpdatePaymentMethodConfigurationAcssDebitDisplayPreference { - - /// The account's preference for whether or not to display this payment method. - #[serde(skip_serializing_if = "Option::is_none")] - pub preference: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UpdatePaymentMethodConfigurationAffirmDisplayPreference { - - /// The account's preference for whether or not to display this payment method. - #[serde(skip_serializing_if = "Option::is_none")] - pub preference: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UpdatePaymentMethodConfigurationAfterpayClearpayDisplayPreference { - - /// The account's preference for whether or not to display this payment method. - #[serde(skip_serializing_if = "Option::is_none")] - pub preference: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UpdatePaymentMethodConfigurationAlipayDisplayPreference { - - /// The account's preference for whether or not to display this payment method. - #[serde(skip_serializing_if = "Option::is_none")] - pub preference: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UpdatePaymentMethodConfigurationApplePayDisplayPreference { - - /// The account's preference for whether or not to display this payment method. - #[serde(skip_serializing_if = "Option::is_none")] - pub preference: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UpdatePaymentMethodConfigurationApplePayLaterDisplayPreference { - - /// The account's preference for whether or not to display this payment method. - #[serde(skip_serializing_if = "Option::is_none")] - pub preference: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UpdatePaymentMethodConfigurationAuBecsDebitDisplayPreference { - - /// The account's preference for whether or not to display this payment method. - #[serde(skip_serializing_if = "Option::is_none")] - pub preference: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UpdatePaymentMethodConfigurationBacsDebitDisplayPreference { - - /// The account's preference for whether or not to display this payment method. - #[serde(skip_serializing_if = "Option::is_none")] - pub preference: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UpdatePaymentMethodConfigurationBancontactDisplayPreference { - - /// The account's preference for whether or not to display this payment method. - #[serde(skip_serializing_if = "Option::is_none")] - pub preference: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UpdatePaymentMethodConfigurationBlikDisplayPreference { - - /// The account's preference for whether or not to display this payment method. - #[serde(skip_serializing_if = "Option::is_none")] - pub preference: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UpdatePaymentMethodConfigurationBoletoDisplayPreference { - - /// The account's preference for whether or not to display this payment method. - #[serde(skip_serializing_if = "Option::is_none")] - pub preference: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UpdatePaymentMethodConfigurationCartesBancairesDisplayPreference { - - /// The account's preference for whether or not to display this payment method. - #[serde(skip_serializing_if = "Option::is_none")] - pub preference: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UpdatePaymentMethodConfigurationCashappDisplayPreference { - - /// The account's preference for whether or not to display this payment method. - #[serde(skip_serializing_if = "Option::is_none")] - pub preference: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UpdatePaymentMethodConfigurationCustomerBalanceDisplayPreference { - - /// The account's preference for whether or not to display this payment method. - #[serde(skip_serializing_if = "Option::is_none")] - pub preference: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UpdatePaymentMethodConfigurationEpsDisplayPreference { - - /// The account's preference for whether or not to display this payment method. - #[serde(skip_serializing_if = "Option::is_none")] - pub preference: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UpdatePaymentMethodConfigurationFpxDisplayPreference { - - /// The account's preference for whether or not to display this payment method. - #[serde(skip_serializing_if = "Option::is_none")] - pub preference: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UpdatePaymentMethodConfigurationGiropayDisplayPreference { - - /// The account's preference for whether or not to display this payment method. - #[serde(skip_serializing_if = "Option::is_none")] - pub preference: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UpdatePaymentMethodConfigurationGooglePayDisplayPreference { - - /// The account's preference for whether or not to display this payment method. - #[serde(skip_serializing_if = "Option::is_none")] - pub preference: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UpdatePaymentMethodConfigurationGrabpayDisplayPreference { - - /// The account's preference for whether or not to display this payment method. - #[serde(skip_serializing_if = "Option::is_none")] - pub preference: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UpdatePaymentMethodConfigurationIdealDisplayPreference { - - /// The account's preference for whether or not to display this payment method. - #[serde(skip_serializing_if = "Option::is_none")] - pub preference: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UpdatePaymentMethodConfigurationJcbDisplayPreference { - - /// The account's preference for whether or not to display this payment method. - #[serde(skip_serializing_if = "Option::is_none")] - pub preference: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UpdatePaymentMethodConfigurationKlarnaDisplayPreference { - - /// The account's preference for whether or not to display this payment method. - #[serde(skip_serializing_if = "Option::is_none")] - pub preference: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UpdatePaymentMethodConfigurationKonbiniDisplayPreference { - - /// The account's preference for whether or not to display this payment method. - #[serde(skip_serializing_if = "Option::is_none")] - pub preference: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UpdatePaymentMethodConfigurationLinkDisplayPreference { - - /// The account's preference for whether or not to display this payment method. - #[serde(skip_serializing_if = "Option::is_none")] - pub preference: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UpdatePaymentMethodConfigurationOxxoDisplayPreference { - - /// The account's preference for whether or not to display this payment method. - #[serde(skip_serializing_if = "Option::is_none")] - pub preference: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UpdatePaymentMethodConfigurationP24DisplayPreference { - - /// The account's preference for whether or not to display this payment method. - #[serde(skip_serializing_if = "Option::is_none")] - pub preference: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UpdatePaymentMethodConfigurationPaynowDisplayPreference { - - /// The account's preference for whether or not to display this payment method. - #[serde(skip_serializing_if = "Option::is_none")] - pub preference: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UpdatePaymentMethodConfigurationPaypalDisplayPreference { - - /// The account's preference for whether or not to display this payment method. - #[serde(skip_serializing_if = "Option::is_none")] - pub preference: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UpdatePaymentMethodConfigurationPromptpayDisplayPreference { - - /// The account's preference for whether or not to display this payment method. - #[serde(skip_serializing_if = "Option::is_none")] - pub preference: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UpdatePaymentMethodConfigurationRevolutPayDisplayPreference { - - /// The account's preference for whether or not to display this payment method. - #[serde(skip_serializing_if = "Option::is_none")] - pub preference: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UpdatePaymentMethodConfigurationSepaDebitDisplayPreference { - - /// The account's preference for whether or not to display this payment method. - #[serde(skip_serializing_if = "Option::is_none")] - pub preference: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UpdatePaymentMethodConfigurationSofortDisplayPreference { - - /// The account's preference for whether or not to display this payment method. - #[serde(skip_serializing_if = "Option::is_none")] - pub preference: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UpdatePaymentMethodConfigurationUsBankAccountDisplayPreference { - - /// The account's preference for whether or not to display this payment method. - #[serde(skip_serializing_if = "Option::is_none")] - pub preference: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UpdatePaymentMethodConfigurationWechatPayDisplayPreference { - - /// The account's preference for whether or not to display this payment method. - #[serde(skip_serializing_if = "Option::is_none")] - pub preference: Option, -} - -/// An enum representing the possible values of an `CreatePaymentMethodConfigurationAcssDebitDisplayPreference`'s `preference` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CreatePaymentMethodConfigurationAcssDebitDisplayPreferencePreference { - None, - Off, - On, -} - -impl CreatePaymentMethodConfigurationAcssDebitDisplayPreferencePreference { - pub fn as_str(self) -> &'static str { - match self { - CreatePaymentMethodConfigurationAcssDebitDisplayPreferencePreference::None => "none", - CreatePaymentMethodConfigurationAcssDebitDisplayPreferencePreference::Off => "off", - CreatePaymentMethodConfigurationAcssDebitDisplayPreferencePreference::On => "on", - } - } -} - -impl AsRef for CreatePaymentMethodConfigurationAcssDebitDisplayPreferencePreference { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for CreatePaymentMethodConfigurationAcssDebitDisplayPreferencePreference { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for CreatePaymentMethodConfigurationAcssDebitDisplayPreferencePreference { - fn default() -> Self { - Self::None - } -} - -/// An enum representing the possible values of an `CreatePaymentMethodConfigurationAffirmDisplayPreference`'s `preference` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CreatePaymentMethodConfigurationAffirmDisplayPreferencePreference { - None, - Off, - On, -} - -impl CreatePaymentMethodConfigurationAffirmDisplayPreferencePreference { - pub fn as_str(self) -> &'static str { - match self { - CreatePaymentMethodConfigurationAffirmDisplayPreferencePreference::None => "none", - CreatePaymentMethodConfigurationAffirmDisplayPreferencePreference::Off => "off", - CreatePaymentMethodConfigurationAffirmDisplayPreferencePreference::On => "on", - } - } -} - -impl AsRef for CreatePaymentMethodConfigurationAffirmDisplayPreferencePreference { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for CreatePaymentMethodConfigurationAffirmDisplayPreferencePreference { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for CreatePaymentMethodConfigurationAffirmDisplayPreferencePreference { - fn default() -> Self { - Self::None - } -} - -/// An enum representing the possible values of an `CreatePaymentMethodConfigurationAfterpayClearpayDisplayPreference`'s `preference` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CreatePaymentMethodConfigurationAfterpayClearpayDisplayPreferencePreference { - None, - Off, - On, -} - -impl CreatePaymentMethodConfigurationAfterpayClearpayDisplayPreferencePreference { - pub fn as_str(self) -> &'static str { - match self { - CreatePaymentMethodConfigurationAfterpayClearpayDisplayPreferencePreference::None => "none", - CreatePaymentMethodConfigurationAfterpayClearpayDisplayPreferencePreference::Off => "off", - CreatePaymentMethodConfigurationAfterpayClearpayDisplayPreferencePreference::On => "on", - } - } -} - -impl AsRef for CreatePaymentMethodConfigurationAfterpayClearpayDisplayPreferencePreference { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for CreatePaymentMethodConfigurationAfterpayClearpayDisplayPreferencePreference { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for CreatePaymentMethodConfigurationAfterpayClearpayDisplayPreferencePreference { - fn default() -> Self { - Self::None - } -} - -/// An enum representing the possible values of an `CreatePaymentMethodConfigurationAlipayDisplayPreference`'s `preference` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CreatePaymentMethodConfigurationAlipayDisplayPreferencePreference { - None, - Off, - On, -} - -impl CreatePaymentMethodConfigurationAlipayDisplayPreferencePreference { - pub fn as_str(self) -> &'static str { - match self { - CreatePaymentMethodConfigurationAlipayDisplayPreferencePreference::None => "none", - CreatePaymentMethodConfigurationAlipayDisplayPreferencePreference::Off => "off", - CreatePaymentMethodConfigurationAlipayDisplayPreferencePreference::On => "on", - } - } -} - -impl AsRef for CreatePaymentMethodConfigurationAlipayDisplayPreferencePreference { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for CreatePaymentMethodConfigurationAlipayDisplayPreferencePreference { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for CreatePaymentMethodConfigurationAlipayDisplayPreferencePreference { - fn default() -> Self { - Self::None - } -} - -/// An enum representing the possible values of an `CreatePaymentMethodConfigurationApplePayDisplayPreference`'s `preference` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CreatePaymentMethodConfigurationApplePayDisplayPreferencePreference { - None, - Off, - On, -} - -impl CreatePaymentMethodConfigurationApplePayDisplayPreferencePreference { - pub fn as_str(self) -> &'static str { - match self { - CreatePaymentMethodConfigurationApplePayDisplayPreferencePreference::None => "none", - CreatePaymentMethodConfigurationApplePayDisplayPreferencePreference::Off => "off", - CreatePaymentMethodConfigurationApplePayDisplayPreferencePreference::On => "on", - } - } -} - -impl AsRef for CreatePaymentMethodConfigurationApplePayDisplayPreferencePreference { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for CreatePaymentMethodConfigurationApplePayDisplayPreferencePreference { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for CreatePaymentMethodConfigurationApplePayDisplayPreferencePreference { - fn default() -> Self { - Self::None - } -} - -/// An enum representing the possible values of an `CreatePaymentMethodConfigurationApplePayLaterDisplayPreference`'s `preference` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CreatePaymentMethodConfigurationApplePayLaterDisplayPreferencePreference { - None, - Off, - On, -} - -impl CreatePaymentMethodConfigurationApplePayLaterDisplayPreferencePreference { - pub fn as_str(self) -> &'static str { - match self { - CreatePaymentMethodConfigurationApplePayLaterDisplayPreferencePreference::None => "none", - CreatePaymentMethodConfigurationApplePayLaterDisplayPreferencePreference::Off => "off", - CreatePaymentMethodConfigurationApplePayLaterDisplayPreferencePreference::On => "on", - } - } -} - -impl AsRef for CreatePaymentMethodConfigurationApplePayLaterDisplayPreferencePreference { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for CreatePaymentMethodConfigurationApplePayLaterDisplayPreferencePreference { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for CreatePaymentMethodConfigurationApplePayLaterDisplayPreferencePreference { - fn default() -> Self { - Self::None - } -} - -/// An enum representing the possible values of an `CreatePaymentMethodConfigurationAuBecsDebitDisplayPreference`'s `preference` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CreatePaymentMethodConfigurationAuBecsDebitDisplayPreferencePreference { - None, - Off, - On, -} - -impl CreatePaymentMethodConfigurationAuBecsDebitDisplayPreferencePreference { - pub fn as_str(self) -> &'static str { - match self { - CreatePaymentMethodConfigurationAuBecsDebitDisplayPreferencePreference::None => "none", - CreatePaymentMethodConfigurationAuBecsDebitDisplayPreferencePreference::Off => "off", - CreatePaymentMethodConfigurationAuBecsDebitDisplayPreferencePreference::On => "on", - } - } -} - -impl AsRef for CreatePaymentMethodConfigurationAuBecsDebitDisplayPreferencePreference { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for CreatePaymentMethodConfigurationAuBecsDebitDisplayPreferencePreference { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for CreatePaymentMethodConfigurationAuBecsDebitDisplayPreferencePreference { - fn default() -> Self { - Self::None - } -} - -/// An enum representing the possible values of an `CreatePaymentMethodConfigurationBacsDebitDisplayPreference`'s `preference` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CreatePaymentMethodConfigurationBacsDebitDisplayPreferencePreference { - None, - Off, - On, -} - -impl CreatePaymentMethodConfigurationBacsDebitDisplayPreferencePreference { - pub fn as_str(self) -> &'static str { - match self { - CreatePaymentMethodConfigurationBacsDebitDisplayPreferencePreference::None => "none", - CreatePaymentMethodConfigurationBacsDebitDisplayPreferencePreference::Off => "off", - CreatePaymentMethodConfigurationBacsDebitDisplayPreferencePreference::On => "on", - } - } -} - -impl AsRef for CreatePaymentMethodConfigurationBacsDebitDisplayPreferencePreference { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for CreatePaymentMethodConfigurationBacsDebitDisplayPreferencePreference { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for CreatePaymentMethodConfigurationBacsDebitDisplayPreferencePreference { - fn default() -> Self { - Self::None - } -} - -/// An enum representing the possible values of an `CreatePaymentMethodConfigurationBancontactDisplayPreference`'s `preference` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CreatePaymentMethodConfigurationBancontactDisplayPreferencePreference { - None, - Off, - On, -} - -impl CreatePaymentMethodConfigurationBancontactDisplayPreferencePreference { - pub fn as_str(self) -> &'static str { - match self { - CreatePaymentMethodConfigurationBancontactDisplayPreferencePreference::None => "none", - CreatePaymentMethodConfigurationBancontactDisplayPreferencePreference::Off => "off", - CreatePaymentMethodConfigurationBancontactDisplayPreferencePreference::On => "on", - } - } -} - -impl AsRef for CreatePaymentMethodConfigurationBancontactDisplayPreferencePreference { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for CreatePaymentMethodConfigurationBancontactDisplayPreferencePreference { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for CreatePaymentMethodConfigurationBancontactDisplayPreferencePreference { - fn default() -> Self { - Self::None - } -} - -/// An enum representing the possible values of an `CreatePaymentMethodConfigurationBlikDisplayPreference`'s `preference` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CreatePaymentMethodConfigurationBlikDisplayPreferencePreference { - None, - Off, - On, -} - -impl CreatePaymentMethodConfigurationBlikDisplayPreferencePreference { - pub fn as_str(self) -> &'static str { - match self { - CreatePaymentMethodConfigurationBlikDisplayPreferencePreference::None => "none", - CreatePaymentMethodConfigurationBlikDisplayPreferencePreference::Off => "off", - CreatePaymentMethodConfigurationBlikDisplayPreferencePreference::On => "on", - } - } -} - -impl AsRef for CreatePaymentMethodConfigurationBlikDisplayPreferencePreference { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for CreatePaymentMethodConfigurationBlikDisplayPreferencePreference { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for CreatePaymentMethodConfigurationBlikDisplayPreferencePreference { - fn default() -> Self { - Self::None - } -} - -/// An enum representing the possible values of an `CreatePaymentMethodConfigurationBoletoDisplayPreference`'s `preference` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CreatePaymentMethodConfigurationBoletoDisplayPreferencePreference { - None, - Off, - On, -} - -impl CreatePaymentMethodConfigurationBoletoDisplayPreferencePreference { - pub fn as_str(self) -> &'static str { - match self { - CreatePaymentMethodConfigurationBoletoDisplayPreferencePreference::None => "none", - CreatePaymentMethodConfigurationBoletoDisplayPreferencePreference::Off => "off", - CreatePaymentMethodConfigurationBoletoDisplayPreferencePreference::On => "on", - } - } -} - -impl AsRef for CreatePaymentMethodConfigurationBoletoDisplayPreferencePreference { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for CreatePaymentMethodConfigurationBoletoDisplayPreferencePreference { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for CreatePaymentMethodConfigurationBoletoDisplayPreferencePreference { - fn default() -> Self { - Self::None - } -} - -/// An enum representing the possible values of an `CreatePaymentMethodConfigurationCartesBancairesDisplayPreference`'s `preference` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CreatePaymentMethodConfigurationCartesBancairesDisplayPreferencePreference { - None, - Off, - On, -} - -impl CreatePaymentMethodConfigurationCartesBancairesDisplayPreferencePreference { - pub fn as_str(self) -> &'static str { - match self { - CreatePaymentMethodConfigurationCartesBancairesDisplayPreferencePreference::None => "none", - CreatePaymentMethodConfigurationCartesBancairesDisplayPreferencePreference::Off => "off", - CreatePaymentMethodConfigurationCartesBancairesDisplayPreferencePreference::On => "on", - } - } -} - -impl AsRef for CreatePaymentMethodConfigurationCartesBancairesDisplayPreferencePreference { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for CreatePaymentMethodConfigurationCartesBancairesDisplayPreferencePreference { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for CreatePaymentMethodConfigurationCartesBancairesDisplayPreferencePreference { - fn default() -> Self { - Self::None - } -} - -/// An enum representing the possible values of an `CreatePaymentMethodConfigurationCashappDisplayPreference`'s `preference` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CreatePaymentMethodConfigurationCashappDisplayPreferencePreference { - None, - Off, - On, -} - -impl CreatePaymentMethodConfigurationCashappDisplayPreferencePreference { - pub fn as_str(self) -> &'static str { - match self { - CreatePaymentMethodConfigurationCashappDisplayPreferencePreference::None => "none", - CreatePaymentMethodConfigurationCashappDisplayPreferencePreference::Off => "off", - CreatePaymentMethodConfigurationCashappDisplayPreferencePreference::On => "on", - } - } -} - -impl AsRef for CreatePaymentMethodConfigurationCashappDisplayPreferencePreference { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for CreatePaymentMethodConfigurationCashappDisplayPreferencePreference { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for CreatePaymentMethodConfigurationCashappDisplayPreferencePreference { - fn default() -> Self { - Self::None - } -} - -/// An enum representing the possible values of an `CreatePaymentMethodConfigurationCustomerBalanceDisplayPreference`'s `preference` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CreatePaymentMethodConfigurationCustomerBalanceDisplayPreferencePreference { - None, - Off, - On, -} - -impl CreatePaymentMethodConfigurationCustomerBalanceDisplayPreferencePreference { - pub fn as_str(self) -> &'static str { - match self { - CreatePaymentMethodConfigurationCustomerBalanceDisplayPreferencePreference::None => "none", - CreatePaymentMethodConfigurationCustomerBalanceDisplayPreferencePreference::Off => "off", - CreatePaymentMethodConfigurationCustomerBalanceDisplayPreferencePreference::On => "on", - } - } -} - -impl AsRef for CreatePaymentMethodConfigurationCustomerBalanceDisplayPreferencePreference { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for CreatePaymentMethodConfigurationCustomerBalanceDisplayPreferencePreference { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for CreatePaymentMethodConfigurationCustomerBalanceDisplayPreferencePreference { - fn default() -> Self { - Self::None - } -} - -/// An enum representing the possible values of an `CreatePaymentMethodConfigurationEpsDisplayPreference`'s `preference` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CreatePaymentMethodConfigurationEpsDisplayPreferencePreference { - None, - Off, - On, -} - -impl CreatePaymentMethodConfigurationEpsDisplayPreferencePreference { - pub fn as_str(self) -> &'static str { - match self { - CreatePaymentMethodConfigurationEpsDisplayPreferencePreference::None => "none", - CreatePaymentMethodConfigurationEpsDisplayPreferencePreference::Off => "off", - CreatePaymentMethodConfigurationEpsDisplayPreferencePreference::On => "on", - } - } -} - -impl AsRef for CreatePaymentMethodConfigurationEpsDisplayPreferencePreference { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for CreatePaymentMethodConfigurationEpsDisplayPreferencePreference { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for CreatePaymentMethodConfigurationEpsDisplayPreferencePreference { - fn default() -> Self { - Self::None - } -} - -/// An enum representing the possible values of an `CreatePaymentMethodConfigurationFpxDisplayPreference`'s `preference` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CreatePaymentMethodConfigurationFpxDisplayPreferencePreference { - None, - Off, - On, -} - -impl CreatePaymentMethodConfigurationFpxDisplayPreferencePreference { - pub fn as_str(self) -> &'static str { - match self { - CreatePaymentMethodConfigurationFpxDisplayPreferencePreference::None => "none", - CreatePaymentMethodConfigurationFpxDisplayPreferencePreference::Off => "off", - CreatePaymentMethodConfigurationFpxDisplayPreferencePreference::On => "on", - } - } -} - -impl AsRef for CreatePaymentMethodConfigurationFpxDisplayPreferencePreference { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for CreatePaymentMethodConfigurationFpxDisplayPreferencePreference { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for CreatePaymentMethodConfigurationFpxDisplayPreferencePreference { - fn default() -> Self { - Self::None - } -} - -/// An enum representing the possible values of an `CreatePaymentMethodConfigurationGiropayDisplayPreference`'s `preference` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CreatePaymentMethodConfigurationGiropayDisplayPreferencePreference { - None, - Off, - On, -} - -impl CreatePaymentMethodConfigurationGiropayDisplayPreferencePreference { - pub fn as_str(self) -> &'static str { - match self { - CreatePaymentMethodConfigurationGiropayDisplayPreferencePreference::None => "none", - CreatePaymentMethodConfigurationGiropayDisplayPreferencePreference::Off => "off", - CreatePaymentMethodConfigurationGiropayDisplayPreferencePreference::On => "on", - } - } -} - -impl AsRef for CreatePaymentMethodConfigurationGiropayDisplayPreferencePreference { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for CreatePaymentMethodConfigurationGiropayDisplayPreferencePreference { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for CreatePaymentMethodConfigurationGiropayDisplayPreferencePreference { - fn default() -> Self { - Self::None - } -} - -/// An enum representing the possible values of an `CreatePaymentMethodConfigurationGooglePayDisplayPreference`'s `preference` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CreatePaymentMethodConfigurationGooglePayDisplayPreferencePreference { - None, - Off, - On, -} - -impl CreatePaymentMethodConfigurationGooglePayDisplayPreferencePreference { - pub fn as_str(self) -> &'static str { - match self { - CreatePaymentMethodConfigurationGooglePayDisplayPreferencePreference::None => "none", - CreatePaymentMethodConfigurationGooglePayDisplayPreferencePreference::Off => "off", - CreatePaymentMethodConfigurationGooglePayDisplayPreferencePreference::On => "on", - } - } -} - -impl AsRef for CreatePaymentMethodConfigurationGooglePayDisplayPreferencePreference { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for CreatePaymentMethodConfigurationGooglePayDisplayPreferencePreference { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for CreatePaymentMethodConfigurationGooglePayDisplayPreferencePreference { - fn default() -> Self { - Self::None - } -} - -/// An enum representing the possible values of an `CreatePaymentMethodConfigurationGrabpayDisplayPreference`'s `preference` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CreatePaymentMethodConfigurationGrabpayDisplayPreferencePreference { - None, - Off, - On, -} - -impl CreatePaymentMethodConfigurationGrabpayDisplayPreferencePreference { - pub fn as_str(self) -> &'static str { - match self { - CreatePaymentMethodConfigurationGrabpayDisplayPreferencePreference::None => "none", - CreatePaymentMethodConfigurationGrabpayDisplayPreferencePreference::Off => "off", - CreatePaymentMethodConfigurationGrabpayDisplayPreferencePreference::On => "on", - } - } -} - -impl AsRef for CreatePaymentMethodConfigurationGrabpayDisplayPreferencePreference { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for CreatePaymentMethodConfigurationGrabpayDisplayPreferencePreference { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for CreatePaymentMethodConfigurationGrabpayDisplayPreferencePreference { - fn default() -> Self { - Self::None - } -} - -/// An enum representing the possible values of an `CreatePaymentMethodConfigurationIdealDisplayPreference`'s `preference` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CreatePaymentMethodConfigurationIdealDisplayPreferencePreference { - None, - Off, - On, -} - -impl CreatePaymentMethodConfigurationIdealDisplayPreferencePreference { - pub fn as_str(self) -> &'static str { - match self { - CreatePaymentMethodConfigurationIdealDisplayPreferencePreference::None => "none", - CreatePaymentMethodConfigurationIdealDisplayPreferencePreference::Off => "off", - CreatePaymentMethodConfigurationIdealDisplayPreferencePreference::On => "on", - } - } -} - -impl AsRef for CreatePaymentMethodConfigurationIdealDisplayPreferencePreference { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for CreatePaymentMethodConfigurationIdealDisplayPreferencePreference { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for CreatePaymentMethodConfigurationIdealDisplayPreferencePreference { - fn default() -> Self { - Self::None - } -} - -/// An enum representing the possible values of an `CreatePaymentMethodConfigurationJcbDisplayPreference`'s `preference` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CreatePaymentMethodConfigurationJcbDisplayPreferencePreference { - None, - Off, - On, -} - -impl CreatePaymentMethodConfigurationJcbDisplayPreferencePreference { - pub fn as_str(self) -> &'static str { - match self { - CreatePaymentMethodConfigurationJcbDisplayPreferencePreference::None => "none", - CreatePaymentMethodConfigurationJcbDisplayPreferencePreference::Off => "off", - CreatePaymentMethodConfigurationJcbDisplayPreferencePreference::On => "on", - } - } -} - -impl AsRef for CreatePaymentMethodConfigurationJcbDisplayPreferencePreference { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for CreatePaymentMethodConfigurationJcbDisplayPreferencePreference { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for CreatePaymentMethodConfigurationJcbDisplayPreferencePreference { - fn default() -> Self { - Self::None - } -} - -/// An enum representing the possible values of an `CreatePaymentMethodConfigurationKlarnaDisplayPreference`'s `preference` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CreatePaymentMethodConfigurationKlarnaDisplayPreferencePreference { - None, - Off, - On, -} - -impl CreatePaymentMethodConfigurationKlarnaDisplayPreferencePreference { - pub fn as_str(self) -> &'static str { - match self { - CreatePaymentMethodConfigurationKlarnaDisplayPreferencePreference::None => "none", - CreatePaymentMethodConfigurationKlarnaDisplayPreferencePreference::Off => "off", - CreatePaymentMethodConfigurationKlarnaDisplayPreferencePreference::On => "on", - } - } -} - -impl AsRef for CreatePaymentMethodConfigurationKlarnaDisplayPreferencePreference { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for CreatePaymentMethodConfigurationKlarnaDisplayPreferencePreference { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for CreatePaymentMethodConfigurationKlarnaDisplayPreferencePreference { - fn default() -> Self { - Self::None - } -} - -/// An enum representing the possible values of an `CreatePaymentMethodConfigurationKonbiniDisplayPreference`'s `preference` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CreatePaymentMethodConfigurationKonbiniDisplayPreferencePreference { - None, - Off, - On, -} - -impl CreatePaymentMethodConfigurationKonbiniDisplayPreferencePreference { - pub fn as_str(self) -> &'static str { - match self { - CreatePaymentMethodConfigurationKonbiniDisplayPreferencePreference::None => "none", - CreatePaymentMethodConfigurationKonbiniDisplayPreferencePreference::Off => "off", - CreatePaymentMethodConfigurationKonbiniDisplayPreferencePreference::On => "on", - } - } -} - -impl AsRef for CreatePaymentMethodConfigurationKonbiniDisplayPreferencePreference { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for CreatePaymentMethodConfigurationKonbiniDisplayPreferencePreference { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for CreatePaymentMethodConfigurationKonbiniDisplayPreferencePreference { - fn default() -> Self { - Self::None - } -} - -/// An enum representing the possible values of an `CreatePaymentMethodConfigurationLinkDisplayPreference`'s `preference` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CreatePaymentMethodConfigurationLinkDisplayPreferencePreference { - None, - Off, - On, -} - -impl CreatePaymentMethodConfigurationLinkDisplayPreferencePreference { - pub fn as_str(self) -> &'static str { - match self { - CreatePaymentMethodConfigurationLinkDisplayPreferencePreference::None => "none", - CreatePaymentMethodConfigurationLinkDisplayPreferencePreference::Off => "off", - CreatePaymentMethodConfigurationLinkDisplayPreferencePreference::On => "on", - } - } -} - -impl AsRef for CreatePaymentMethodConfigurationLinkDisplayPreferencePreference { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for CreatePaymentMethodConfigurationLinkDisplayPreferencePreference { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for CreatePaymentMethodConfigurationLinkDisplayPreferencePreference { - fn default() -> Self { - Self::None - } -} - -/// An enum representing the possible values of an `CreatePaymentMethodConfigurationOxxoDisplayPreference`'s `preference` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CreatePaymentMethodConfigurationOxxoDisplayPreferencePreference { - None, - Off, - On, -} - -impl CreatePaymentMethodConfigurationOxxoDisplayPreferencePreference { - pub fn as_str(self) -> &'static str { - match self { - CreatePaymentMethodConfigurationOxxoDisplayPreferencePreference::None => "none", - CreatePaymentMethodConfigurationOxxoDisplayPreferencePreference::Off => "off", - CreatePaymentMethodConfigurationOxxoDisplayPreferencePreference::On => "on", - } - } -} - -impl AsRef for CreatePaymentMethodConfigurationOxxoDisplayPreferencePreference { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for CreatePaymentMethodConfigurationOxxoDisplayPreferencePreference { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for CreatePaymentMethodConfigurationOxxoDisplayPreferencePreference { - fn default() -> Self { - Self::None - } -} - -/// An enum representing the possible values of an `CreatePaymentMethodConfigurationP24DisplayPreference`'s `preference` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CreatePaymentMethodConfigurationP24DisplayPreferencePreference { - None, - Off, - On, -} - -impl CreatePaymentMethodConfigurationP24DisplayPreferencePreference { - pub fn as_str(self) -> &'static str { - match self { - CreatePaymentMethodConfigurationP24DisplayPreferencePreference::None => "none", - CreatePaymentMethodConfigurationP24DisplayPreferencePreference::Off => "off", - CreatePaymentMethodConfigurationP24DisplayPreferencePreference::On => "on", - } - } -} - -impl AsRef for CreatePaymentMethodConfigurationP24DisplayPreferencePreference { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for CreatePaymentMethodConfigurationP24DisplayPreferencePreference { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for CreatePaymentMethodConfigurationP24DisplayPreferencePreference { - fn default() -> Self { - Self::None - } -} - -/// An enum representing the possible values of an `CreatePaymentMethodConfigurationPaynowDisplayPreference`'s `preference` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CreatePaymentMethodConfigurationPaynowDisplayPreferencePreference { - None, - Off, - On, -} - -impl CreatePaymentMethodConfigurationPaynowDisplayPreferencePreference { - pub fn as_str(self) -> &'static str { - match self { - CreatePaymentMethodConfigurationPaynowDisplayPreferencePreference::None => "none", - CreatePaymentMethodConfigurationPaynowDisplayPreferencePreference::Off => "off", - CreatePaymentMethodConfigurationPaynowDisplayPreferencePreference::On => "on", - } - } -} - -impl AsRef for CreatePaymentMethodConfigurationPaynowDisplayPreferencePreference { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for CreatePaymentMethodConfigurationPaynowDisplayPreferencePreference { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for CreatePaymentMethodConfigurationPaynowDisplayPreferencePreference { - fn default() -> Self { - Self::None - } -} - -/// An enum representing the possible values of an `CreatePaymentMethodConfigurationPaypalDisplayPreference`'s `preference` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CreatePaymentMethodConfigurationPaypalDisplayPreferencePreference { - None, - Off, - On, -} - -impl CreatePaymentMethodConfigurationPaypalDisplayPreferencePreference { - pub fn as_str(self) -> &'static str { - match self { - CreatePaymentMethodConfigurationPaypalDisplayPreferencePreference::None => "none", - CreatePaymentMethodConfigurationPaypalDisplayPreferencePreference::Off => "off", - CreatePaymentMethodConfigurationPaypalDisplayPreferencePreference::On => "on", - } - } -} - -impl AsRef for CreatePaymentMethodConfigurationPaypalDisplayPreferencePreference { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for CreatePaymentMethodConfigurationPaypalDisplayPreferencePreference { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for CreatePaymentMethodConfigurationPaypalDisplayPreferencePreference { - fn default() -> Self { - Self::None - } -} - -/// An enum representing the possible values of an `CreatePaymentMethodConfigurationPromptpayDisplayPreference`'s `preference` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CreatePaymentMethodConfigurationPromptpayDisplayPreferencePreference { - None, - Off, - On, -} - -impl CreatePaymentMethodConfigurationPromptpayDisplayPreferencePreference { - pub fn as_str(self) -> &'static str { - match self { - CreatePaymentMethodConfigurationPromptpayDisplayPreferencePreference::None => "none", - CreatePaymentMethodConfigurationPromptpayDisplayPreferencePreference::Off => "off", - CreatePaymentMethodConfigurationPromptpayDisplayPreferencePreference::On => "on", - } - } -} - -impl AsRef for CreatePaymentMethodConfigurationPromptpayDisplayPreferencePreference { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for CreatePaymentMethodConfigurationPromptpayDisplayPreferencePreference { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for CreatePaymentMethodConfigurationPromptpayDisplayPreferencePreference { - fn default() -> Self { - Self::None - } -} - -/// An enum representing the possible values of an `CreatePaymentMethodConfigurationRevolutPayDisplayPreference`'s `preference` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CreatePaymentMethodConfigurationRevolutPayDisplayPreferencePreference { - None, - Off, - On, -} - -impl CreatePaymentMethodConfigurationRevolutPayDisplayPreferencePreference { - pub fn as_str(self) -> &'static str { - match self { - CreatePaymentMethodConfigurationRevolutPayDisplayPreferencePreference::None => "none", - CreatePaymentMethodConfigurationRevolutPayDisplayPreferencePreference::Off => "off", - CreatePaymentMethodConfigurationRevolutPayDisplayPreferencePreference::On => "on", - } - } -} - -impl AsRef for CreatePaymentMethodConfigurationRevolutPayDisplayPreferencePreference { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for CreatePaymentMethodConfigurationRevolutPayDisplayPreferencePreference { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for CreatePaymentMethodConfigurationRevolutPayDisplayPreferencePreference { - fn default() -> Self { - Self::None - } -} - -/// An enum representing the possible values of an `CreatePaymentMethodConfigurationSepaDebitDisplayPreference`'s `preference` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CreatePaymentMethodConfigurationSepaDebitDisplayPreferencePreference { - None, - Off, - On, -} - -impl CreatePaymentMethodConfigurationSepaDebitDisplayPreferencePreference { - pub fn as_str(self) -> &'static str { - match self { - CreatePaymentMethodConfigurationSepaDebitDisplayPreferencePreference::None => "none", - CreatePaymentMethodConfigurationSepaDebitDisplayPreferencePreference::Off => "off", - CreatePaymentMethodConfigurationSepaDebitDisplayPreferencePreference::On => "on", - } - } -} - -impl AsRef for CreatePaymentMethodConfigurationSepaDebitDisplayPreferencePreference { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for CreatePaymentMethodConfigurationSepaDebitDisplayPreferencePreference { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for CreatePaymentMethodConfigurationSepaDebitDisplayPreferencePreference { - fn default() -> Self { - Self::None - } -} - -/// An enum representing the possible values of an `CreatePaymentMethodConfigurationSofortDisplayPreference`'s `preference` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CreatePaymentMethodConfigurationSofortDisplayPreferencePreference { - None, - Off, - On, -} - -impl CreatePaymentMethodConfigurationSofortDisplayPreferencePreference { - pub fn as_str(self) -> &'static str { - match self { - CreatePaymentMethodConfigurationSofortDisplayPreferencePreference::None => "none", - CreatePaymentMethodConfigurationSofortDisplayPreferencePreference::Off => "off", - CreatePaymentMethodConfigurationSofortDisplayPreferencePreference::On => "on", - } - } -} - -impl AsRef for CreatePaymentMethodConfigurationSofortDisplayPreferencePreference { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for CreatePaymentMethodConfigurationSofortDisplayPreferencePreference { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for CreatePaymentMethodConfigurationSofortDisplayPreferencePreference { - fn default() -> Self { - Self::None - } -} - -/// An enum representing the possible values of an `CreatePaymentMethodConfigurationUsBankAccountDisplayPreference`'s `preference` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CreatePaymentMethodConfigurationUsBankAccountDisplayPreferencePreference { - None, - Off, - On, -} - -impl CreatePaymentMethodConfigurationUsBankAccountDisplayPreferencePreference { - pub fn as_str(self) -> &'static str { - match self { - CreatePaymentMethodConfigurationUsBankAccountDisplayPreferencePreference::None => "none", - CreatePaymentMethodConfigurationUsBankAccountDisplayPreferencePreference::Off => "off", - CreatePaymentMethodConfigurationUsBankAccountDisplayPreferencePreference::On => "on", - } - } -} - -impl AsRef for CreatePaymentMethodConfigurationUsBankAccountDisplayPreferencePreference { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for CreatePaymentMethodConfigurationUsBankAccountDisplayPreferencePreference { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for CreatePaymentMethodConfigurationUsBankAccountDisplayPreferencePreference { - fn default() -> Self { - Self::None - } -} - -/// An enum representing the possible values of an `CreatePaymentMethodConfigurationWechatPayDisplayPreference`'s `preference` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CreatePaymentMethodConfigurationWechatPayDisplayPreferencePreference { - None, - Off, - On, -} - -impl CreatePaymentMethodConfigurationWechatPayDisplayPreferencePreference { - pub fn as_str(self) -> &'static str { - match self { - CreatePaymentMethodConfigurationWechatPayDisplayPreferencePreference::None => "none", - CreatePaymentMethodConfigurationWechatPayDisplayPreferencePreference::Off => "off", - CreatePaymentMethodConfigurationWechatPayDisplayPreferencePreference::On => "on", - } - } -} - -impl AsRef for CreatePaymentMethodConfigurationWechatPayDisplayPreferencePreference { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for CreatePaymentMethodConfigurationWechatPayDisplayPreferencePreference { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for CreatePaymentMethodConfigurationWechatPayDisplayPreferencePreference { - fn default() -> Self { - Self::None - } -} - -/// An enum representing the possible values of an `PaymentMethodConfigResourceDisplayPreference`'s `preference` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum PaymentMethodConfigResourceDisplayPreferencePreference { - None, - Off, - On, -} - -impl PaymentMethodConfigResourceDisplayPreferencePreference { - pub fn as_str(self) -> &'static str { - match self { - PaymentMethodConfigResourceDisplayPreferencePreference::None => "none", - PaymentMethodConfigResourceDisplayPreferencePreference::Off => "off", - PaymentMethodConfigResourceDisplayPreferencePreference::On => "on", - } - } -} - -impl AsRef for PaymentMethodConfigResourceDisplayPreferencePreference { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for PaymentMethodConfigResourceDisplayPreferencePreference { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for PaymentMethodConfigResourceDisplayPreferencePreference { - fn default() -> Self { - Self::None - } -} - -/// An enum representing the possible values of an `PaymentMethodConfigResourceDisplayPreference`'s `value` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum PaymentMethodConfigResourceDisplayPreferenceValue { - Off, - On, -} - -impl PaymentMethodConfigResourceDisplayPreferenceValue { - pub fn as_str(self) -> &'static str { - match self { - PaymentMethodConfigResourceDisplayPreferenceValue::Off => "off", - PaymentMethodConfigResourceDisplayPreferenceValue::On => "on", - } - } -} - -impl AsRef for PaymentMethodConfigResourceDisplayPreferenceValue { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for PaymentMethodConfigResourceDisplayPreferenceValue { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for PaymentMethodConfigResourceDisplayPreferenceValue { - fn default() -> Self { - Self::Off - } -} - -/// An enum representing the possible values of an `UpdatePaymentMethodConfigurationAcssDebitDisplayPreference`'s `preference` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum UpdatePaymentMethodConfigurationAcssDebitDisplayPreferencePreference { - None, - Off, - On, -} - -impl UpdatePaymentMethodConfigurationAcssDebitDisplayPreferencePreference { - pub fn as_str(self) -> &'static str { - match self { - UpdatePaymentMethodConfigurationAcssDebitDisplayPreferencePreference::None => "none", - UpdatePaymentMethodConfigurationAcssDebitDisplayPreferencePreference::Off => "off", - UpdatePaymentMethodConfigurationAcssDebitDisplayPreferencePreference::On => "on", - } - } -} - -impl AsRef for UpdatePaymentMethodConfigurationAcssDebitDisplayPreferencePreference { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for UpdatePaymentMethodConfigurationAcssDebitDisplayPreferencePreference { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for UpdatePaymentMethodConfigurationAcssDebitDisplayPreferencePreference { - fn default() -> Self { - Self::None - } -} - -/// An enum representing the possible values of an `UpdatePaymentMethodConfigurationAffirmDisplayPreference`'s `preference` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum UpdatePaymentMethodConfigurationAffirmDisplayPreferencePreference { - None, - Off, - On, -} - -impl UpdatePaymentMethodConfigurationAffirmDisplayPreferencePreference { - pub fn as_str(self) -> &'static str { - match self { - UpdatePaymentMethodConfigurationAffirmDisplayPreferencePreference::None => "none", - UpdatePaymentMethodConfigurationAffirmDisplayPreferencePreference::Off => "off", - UpdatePaymentMethodConfigurationAffirmDisplayPreferencePreference::On => "on", - } - } -} - -impl AsRef for UpdatePaymentMethodConfigurationAffirmDisplayPreferencePreference { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for UpdatePaymentMethodConfigurationAffirmDisplayPreferencePreference { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for UpdatePaymentMethodConfigurationAffirmDisplayPreferencePreference { - fn default() -> Self { - Self::None - } -} - -/// An enum representing the possible values of an `UpdatePaymentMethodConfigurationAfterpayClearpayDisplayPreference`'s `preference` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum UpdatePaymentMethodConfigurationAfterpayClearpayDisplayPreferencePreference { - None, - Off, - On, -} - -impl UpdatePaymentMethodConfigurationAfterpayClearpayDisplayPreferencePreference { - pub fn as_str(self) -> &'static str { - match self { - UpdatePaymentMethodConfigurationAfterpayClearpayDisplayPreferencePreference::None => "none", - UpdatePaymentMethodConfigurationAfterpayClearpayDisplayPreferencePreference::Off => "off", - UpdatePaymentMethodConfigurationAfterpayClearpayDisplayPreferencePreference::On => "on", - } - } -} - -impl AsRef for UpdatePaymentMethodConfigurationAfterpayClearpayDisplayPreferencePreference { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for UpdatePaymentMethodConfigurationAfterpayClearpayDisplayPreferencePreference { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for UpdatePaymentMethodConfigurationAfterpayClearpayDisplayPreferencePreference { - fn default() -> Self { - Self::None - } -} - -/// An enum representing the possible values of an `UpdatePaymentMethodConfigurationAlipayDisplayPreference`'s `preference` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum UpdatePaymentMethodConfigurationAlipayDisplayPreferencePreference { - None, - Off, - On, -} - -impl UpdatePaymentMethodConfigurationAlipayDisplayPreferencePreference { - pub fn as_str(self) -> &'static str { - match self { - UpdatePaymentMethodConfigurationAlipayDisplayPreferencePreference::None => "none", - UpdatePaymentMethodConfigurationAlipayDisplayPreferencePreference::Off => "off", - UpdatePaymentMethodConfigurationAlipayDisplayPreferencePreference::On => "on", - } - } -} - -impl AsRef for UpdatePaymentMethodConfigurationAlipayDisplayPreferencePreference { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for UpdatePaymentMethodConfigurationAlipayDisplayPreferencePreference { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for UpdatePaymentMethodConfigurationAlipayDisplayPreferencePreference { - fn default() -> Self { - Self::None - } -} - -/// An enum representing the possible values of an `UpdatePaymentMethodConfigurationApplePayDisplayPreference`'s `preference` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum UpdatePaymentMethodConfigurationApplePayDisplayPreferencePreference { - None, - Off, - On, -} - -impl UpdatePaymentMethodConfigurationApplePayDisplayPreferencePreference { - pub fn as_str(self) -> &'static str { - match self { - UpdatePaymentMethodConfigurationApplePayDisplayPreferencePreference::None => "none", - UpdatePaymentMethodConfigurationApplePayDisplayPreferencePreference::Off => "off", - UpdatePaymentMethodConfigurationApplePayDisplayPreferencePreference::On => "on", - } - } -} - -impl AsRef for UpdatePaymentMethodConfigurationApplePayDisplayPreferencePreference { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for UpdatePaymentMethodConfigurationApplePayDisplayPreferencePreference { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for UpdatePaymentMethodConfigurationApplePayDisplayPreferencePreference { - fn default() -> Self { - Self::None - } -} - -/// An enum representing the possible values of an `UpdatePaymentMethodConfigurationApplePayLaterDisplayPreference`'s `preference` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum UpdatePaymentMethodConfigurationApplePayLaterDisplayPreferencePreference { - None, - Off, - On, -} - -impl UpdatePaymentMethodConfigurationApplePayLaterDisplayPreferencePreference { - pub fn as_str(self) -> &'static str { - match self { - UpdatePaymentMethodConfigurationApplePayLaterDisplayPreferencePreference::None => "none", - UpdatePaymentMethodConfigurationApplePayLaterDisplayPreferencePreference::Off => "off", - UpdatePaymentMethodConfigurationApplePayLaterDisplayPreferencePreference::On => "on", - } - } -} - -impl AsRef for UpdatePaymentMethodConfigurationApplePayLaterDisplayPreferencePreference { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for UpdatePaymentMethodConfigurationApplePayLaterDisplayPreferencePreference { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for UpdatePaymentMethodConfigurationApplePayLaterDisplayPreferencePreference { - fn default() -> Self { - Self::None - } -} - -/// An enum representing the possible values of an `UpdatePaymentMethodConfigurationAuBecsDebitDisplayPreference`'s `preference` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum UpdatePaymentMethodConfigurationAuBecsDebitDisplayPreferencePreference { - None, - Off, - On, -} - -impl UpdatePaymentMethodConfigurationAuBecsDebitDisplayPreferencePreference { - pub fn as_str(self) -> &'static str { - match self { - UpdatePaymentMethodConfigurationAuBecsDebitDisplayPreferencePreference::None => "none", - UpdatePaymentMethodConfigurationAuBecsDebitDisplayPreferencePreference::Off => "off", - UpdatePaymentMethodConfigurationAuBecsDebitDisplayPreferencePreference::On => "on", - } - } -} - -impl AsRef for UpdatePaymentMethodConfigurationAuBecsDebitDisplayPreferencePreference { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for UpdatePaymentMethodConfigurationAuBecsDebitDisplayPreferencePreference { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for UpdatePaymentMethodConfigurationAuBecsDebitDisplayPreferencePreference { - fn default() -> Self { - Self::None - } -} - -/// An enum representing the possible values of an `UpdatePaymentMethodConfigurationBacsDebitDisplayPreference`'s `preference` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum UpdatePaymentMethodConfigurationBacsDebitDisplayPreferencePreference { - None, - Off, - On, -} - -impl UpdatePaymentMethodConfigurationBacsDebitDisplayPreferencePreference { - pub fn as_str(self) -> &'static str { - match self { - UpdatePaymentMethodConfigurationBacsDebitDisplayPreferencePreference::None => "none", - UpdatePaymentMethodConfigurationBacsDebitDisplayPreferencePreference::Off => "off", - UpdatePaymentMethodConfigurationBacsDebitDisplayPreferencePreference::On => "on", - } - } -} - -impl AsRef for UpdatePaymentMethodConfigurationBacsDebitDisplayPreferencePreference { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for UpdatePaymentMethodConfigurationBacsDebitDisplayPreferencePreference { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for UpdatePaymentMethodConfigurationBacsDebitDisplayPreferencePreference { - fn default() -> Self { - Self::None - } -} - -/// An enum representing the possible values of an `UpdatePaymentMethodConfigurationBancontactDisplayPreference`'s `preference` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum UpdatePaymentMethodConfigurationBancontactDisplayPreferencePreference { - None, - Off, - On, -} - -impl UpdatePaymentMethodConfigurationBancontactDisplayPreferencePreference { - pub fn as_str(self) -> &'static str { - match self { - UpdatePaymentMethodConfigurationBancontactDisplayPreferencePreference::None => "none", - UpdatePaymentMethodConfigurationBancontactDisplayPreferencePreference::Off => "off", - UpdatePaymentMethodConfigurationBancontactDisplayPreferencePreference::On => "on", - } - } -} - -impl AsRef for UpdatePaymentMethodConfigurationBancontactDisplayPreferencePreference { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for UpdatePaymentMethodConfigurationBancontactDisplayPreferencePreference { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for UpdatePaymentMethodConfigurationBancontactDisplayPreferencePreference { - fn default() -> Self { - Self::None - } -} - -/// An enum representing the possible values of an `UpdatePaymentMethodConfigurationBlikDisplayPreference`'s `preference` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum UpdatePaymentMethodConfigurationBlikDisplayPreferencePreference { - None, - Off, - On, -} - -impl UpdatePaymentMethodConfigurationBlikDisplayPreferencePreference { - pub fn as_str(self) -> &'static str { - match self { - UpdatePaymentMethodConfigurationBlikDisplayPreferencePreference::None => "none", - UpdatePaymentMethodConfigurationBlikDisplayPreferencePreference::Off => "off", - UpdatePaymentMethodConfigurationBlikDisplayPreferencePreference::On => "on", - } - } -} - -impl AsRef for UpdatePaymentMethodConfigurationBlikDisplayPreferencePreference { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for UpdatePaymentMethodConfigurationBlikDisplayPreferencePreference { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for UpdatePaymentMethodConfigurationBlikDisplayPreferencePreference { - fn default() -> Self { - Self::None - } -} - -/// An enum representing the possible values of an `UpdatePaymentMethodConfigurationBoletoDisplayPreference`'s `preference` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum UpdatePaymentMethodConfigurationBoletoDisplayPreferencePreference { - None, - Off, - On, -} - -impl UpdatePaymentMethodConfigurationBoletoDisplayPreferencePreference { - pub fn as_str(self) -> &'static str { - match self { - UpdatePaymentMethodConfigurationBoletoDisplayPreferencePreference::None => "none", - UpdatePaymentMethodConfigurationBoletoDisplayPreferencePreference::Off => "off", - UpdatePaymentMethodConfigurationBoletoDisplayPreferencePreference::On => "on", - } - } -} - -impl AsRef for UpdatePaymentMethodConfigurationBoletoDisplayPreferencePreference { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for UpdatePaymentMethodConfigurationBoletoDisplayPreferencePreference { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for UpdatePaymentMethodConfigurationBoletoDisplayPreferencePreference { - fn default() -> Self { - Self::None - } -} - -/// An enum representing the possible values of an `UpdatePaymentMethodConfigurationCartesBancairesDisplayPreference`'s `preference` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum UpdatePaymentMethodConfigurationCartesBancairesDisplayPreferencePreference { - None, - Off, - On, -} - -impl UpdatePaymentMethodConfigurationCartesBancairesDisplayPreferencePreference { - pub fn as_str(self) -> &'static str { - match self { - UpdatePaymentMethodConfigurationCartesBancairesDisplayPreferencePreference::None => "none", - UpdatePaymentMethodConfigurationCartesBancairesDisplayPreferencePreference::Off => "off", - UpdatePaymentMethodConfigurationCartesBancairesDisplayPreferencePreference::On => "on", - } - } -} - -impl AsRef for UpdatePaymentMethodConfigurationCartesBancairesDisplayPreferencePreference { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for UpdatePaymentMethodConfigurationCartesBancairesDisplayPreferencePreference { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for UpdatePaymentMethodConfigurationCartesBancairesDisplayPreferencePreference { - fn default() -> Self { - Self::None - } -} - -/// An enum representing the possible values of an `UpdatePaymentMethodConfigurationCashappDisplayPreference`'s `preference` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum UpdatePaymentMethodConfigurationCashappDisplayPreferencePreference { - None, - Off, - On, -} - -impl UpdatePaymentMethodConfigurationCashappDisplayPreferencePreference { - pub fn as_str(self) -> &'static str { - match self { - UpdatePaymentMethodConfigurationCashappDisplayPreferencePreference::None => "none", - UpdatePaymentMethodConfigurationCashappDisplayPreferencePreference::Off => "off", - UpdatePaymentMethodConfigurationCashappDisplayPreferencePreference::On => "on", - } - } -} - -impl AsRef for UpdatePaymentMethodConfigurationCashappDisplayPreferencePreference { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for UpdatePaymentMethodConfigurationCashappDisplayPreferencePreference { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for UpdatePaymentMethodConfigurationCashappDisplayPreferencePreference { - fn default() -> Self { - Self::None - } -} - -/// An enum representing the possible values of an `UpdatePaymentMethodConfigurationCustomerBalanceDisplayPreference`'s `preference` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum UpdatePaymentMethodConfigurationCustomerBalanceDisplayPreferencePreference { - None, - Off, - On, -} - -impl UpdatePaymentMethodConfigurationCustomerBalanceDisplayPreferencePreference { - pub fn as_str(self) -> &'static str { - match self { - UpdatePaymentMethodConfigurationCustomerBalanceDisplayPreferencePreference::None => "none", - UpdatePaymentMethodConfigurationCustomerBalanceDisplayPreferencePreference::Off => "off", - UpdatePaymentMethodConfigurationCustomerBalanceDisplayPreferencePreference::On => "on", - } - } -} - -impl AsRef for UpdatePaymentMethodConfigurationCustomerBalanceDisplayPreferencePreference { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for UpdatePaymentMethodConfigurationCustomerBalanceDisplayPreferencePreference { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for UpdatePaymentMethodConfigurationCustomerBalanceDisplayPreferencePreference { - fn default() -> Self { - Self::None - } -} - -/// An enum representing the possible values of an `UpdatePaymentMethodConfigurationEpsDisplayPreference`'s `preference` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum UpdatePaymentMethodConfigurationEpsDisplayPreferencePreference { - None, - Off, - On, -} - -impl UpdatePaymentMethodConfigurationEpsDisplayPreferencePreference { - pub fn as_str(self) -> &'static str { - match self { - UpdatePaymentMethodConfigurationEpsDisplayPreferencePreference::None => "none", - UpdatePaymentMethodConfigurationEpsDisplayPreferencePreference::Off => "off", - UpdatePaymentMethodConfigurationEpsDisplayPreferencePreference::On => "on", - } - } -} - -impl AsRef for UpdatePaymentMethodConfigurationEpsDisplayPreferencePreference { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for UpdatePaymentMethodConfigurationEpsDisplayPreferencePreference { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for UpdatePaymentMethodConfigurationEpsDisplayPreferencePreference { - fn default() -> Self { - Self::None - } -} - -/// An enum representing the possible values of an `UpdatePaymentMethodConfigurationFpxDisplayPreference`'s `preference` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum UpdatePaymentMethodConfigurationFpxDisplayPreferencePreference { - None, - Off, - On, -} - -impl UpdatePaymentMethodConfigurationFpxDisplayPreferencePreference { - pub fn as_str(self) -> &'static str { - match self { - UpdatePaymentMethodConfigurationFpxDisplayPreferencePreference::None => "none", - UpdatePaymentMethodConfigurationFpxDisplayPreferencePreference::Off => "off", - UpdatePaymentMethodConfigurationFpxDisplayPreferencePreference::On => "on", - } - } -} - -impl AsRef for UpdatePaymentMethodConfigurationFpxDisplayPreferencePreference { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for UpdatePaymentMethodConfigurationFpxDisplayPreferencePreference { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for UpdatePaymentMethodConfigurationFpxDisplayPreferencePreference { - fn default() -> Self { - Self::None - } -} - -/// An enum representing the possible values of an `UpdatePaymentMethodConfigurationGiropayDisplayPreference`'s `preference` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum UpdatePaymentMethodConfigurationGiropayDisplayPreferencePreference { - None, - Off, - On, -} - -impl UpdatePaymentMethodConfigurationGiropayDisplayPreferencePreference { - pub fn as_str(self) -> &'static str { - match self { - UpdatePaymentMethodConfigurationGiropayDisplayPreferencePreference::None => "none", - UpdatePaymentMethodConfigurationGiropayDisplayPreferencePreference::Off => "off", - UpdatePaymentMethodConfigurationGiropayDisplayPreferencePreference::On => "on", - } - } -} - -impl AsRef for UpdatePaymentMethodConfigurationGiropayDisplayPreferencePreference { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for UpdatePaymentMethodConfigurationGiropayDisplayPreferencePreference { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for UpdatePaymentMethodConfigurationGiropayDisplayPreferencePreference { - fn default() -> Self { - Self::None - } -} - -/// An enum representing the possible values of an `UpdatePaymentMethodConfigurationGooglePayDisplayPreference`'s `preference` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum UpdatePaymentMethodConfigurationGooglePayDisplayPreferencePreference { - None, - Off, - On, -} - -impl UpdatePaymentMethodConfigurationGooglePayDisplayPreferencePreference { - pub fn as_str(self) -> &'static str { - match self { - UpdatePaymentMethodConfigurationGooglePayDisplayPreferencePreference::None => "none", - UpdatePaymentMethodConfigurationGooglePayDisplayPreferencePreference::Off => "off", - UpdatePaymentMethodConfigurationGooglePayDisplayPreferencePreference::On => "on", - } - } -} - -impl AsRef for UpdatePaymentMethodConfigurationGooglePayDisplayPreferencePreference { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for UpdatePaymentMethodConfigurationGooglePayDisplayPreferencePreference { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for UpdatePaymentMethodConfigurationGooglePayDisplayPreferencePreference { - fn default() -> Self { - Self::None - } -} - -/// An enum representing the possible values of an `UpdatePaymentMethodConfigurationGrabpayDisplayPreference`'s `preference` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum UpdatePaymentMethodConfigurationGrabpayDisplayPreferencePreference { - None, - Off, - On, -} - -impl UpdatePaymentMethodConfigurationGrabpayDisplayPreferencePreference { - pub fn as_str(self) -> &'static str { - match self { - UpdatePaymentMethodConfigurationGrabpayDisplayPreferencePreference::None => "none", - UpdatePaymentMethodConfigurationGrabpayDisplayPreferencePreference::Off => "off", - UpdatePaymentMethodConfigurationGrabpayDisplayPreferencePreference::On => "on", - } - } -} - -impl AsRef for UpdatePaymentMethodConfigurationGrabpayDisplayPreferencePreference { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for UpdatePaymentMethodConfigurationGrabpayDisplayPreferencePreference { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for UpdatePaymentMethodConfigurationGrabpayDisplayPreferencePreference { - fn default() -> Self { - Self::None - } -} - -/// An enum representing the possible values of an `UpdatePaymentMethodConfigurationIdealDisplayPreference`'s `preference` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum UpdatePaymentMethodConfigurationIdealDisplayPreferencePreference { - None, - Off, - On, -} - -impl UpdatePaymentMethodConfigurationIdealDisplayPreferencePreference { - pub fn as_str(self) -> &'static str { - match self { - UpdatePaymentMethodConfigurationIdealDisplayPreferencePreference::None => "none", - UpdatePaymentMethodConfigurationIdealDisplayPreferencePreference::Off => "off", - UpdatePaymentMethodConfigurationIdealDisplayPreferencePreference::On => "on", - } - } -} - -impl AsRef for UpdatePaymentMethodConfigurationIdealDisplayPreferencePreference { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for UpdatePaymentMethodConfigurationIdealDisplayPreferencePreference { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for UpdatePaymentMethodConfigurationIdealDisplayPreferencePreference { - fn default() -> Self { - Self::None - } -} - -/// An enum representing the possible values of an `UpdatePaymentMethodConfigurationJcbDisplayPreference`'s `preference` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum UpdatePaymentMethodConfigurationJcbDisplayPreferencePreference { - None, - Off, - On, -} - -impl UpdatePaymentMethodConfigurationJcbDisplayPreferencePreference { - pub fn as_str(self) -> &'static str { - match self { - UpdatePaymentMethodConfigurationJcbDisplayPreferencePreference::None => "none", - UpdatePaymentMethodConfigurationJcbDisplayPreferencePreference::Off => "off", - UpdatePaymentMethodConfigurationJcbDisplayPreferencePreference::On => "on", - } - } -} - -impl AsRef for UpdatePaymentMethodConfigurationJcbDisplayPreferencePreference { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for UpdatePaymentMethodConfigurationJcbDisplayPreferencePreference { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for UpdatePaymentMethodConfigurationJcbDisplayPreferencePreference { - fn default() -> Self { - Self::None - } -} - -/// An enum representing the possible values of an `UpdatePaymentMethodConfigurationKlarnaDisplayPreference`'s `preference` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum UpdatePaymentMethodConfigurationKlarnaDisplayPreferencePreference { - None, - Off, - On, -} - -impl UpdatePaymentMethodConfigurationKlarnaDisplayPreferencePreference { - pub fn as_str(self) -> &'static str { - match self { - UpdatePaymentMethodConfigurationKlarnaDisplayPreferencePreference::None => "none", - UpdatePaymentMethodConfigurationKlarnaDisplayPreferencePreference::Off => "off", - UpdatePaymentMethodConfigurationKlarnaDisplayPreferencePreference::On => "on", - } - } -} - -impl AsRef for UpdatePaymentMethodConfigurationKlarnaDisplayPreferencePreference { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for UpdatePaymentMethodConfigurationKlarnaDisplayPreferencePreference { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for UpdatePaymentMethodConfigurationKlarnaDisplayPreferencePreference { - fn default() -> Self { - Self::None - } -} - -/// An enum representing the possible values of an `UpdatePaymentMethodConfigurationKonbiniDisplayPreference`'s `preference` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum UpdatePaymentMethodConfigurationKonbiniDisplayPreferencePreference { - None, - Off, - On, -} - -impl UpdatePaymentMethodConfigurationKonbiniDisplayPreferencePreference { - pub fn as_str(self) -> &'static str { - match self { - UpdatePaymentMethodConfigurationKonbiniDisplayPreferencePreference::None => "none", - UpdatePaymentMethodConfigurationKonbiniDisplayPreferencePreference::Off => "off", - UpdatePaymentMethodConfigurationKonbiniDisplayPreferencePreference::On => "on", - } - } -} - -impl AsRef for UpdatePaymentMethodConfigurationKonbiniDisplayPreferencePreference { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for UpdatePaymentMethodConfigurationKonbiniDisplayPreferencePreference { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for UpdatePaymentMethodConfigurationKonbiniDisplayPreferencePreference { - fn default() -> Self { - Self::None - } -} - -/// An enum representing the possible values of an `UpdatePaymentMethodConfigurationLinkDisplayPreference`'s `preference` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum UpdatePaymentMethodConfigurationLinkDisplayPreferencePreference { - None, - Off, - On, -} - -impl UpdatePaymentMethodConfigurationLinkDisplayPreferencePreference { - pub fn as_str(self) -> &'static str { - match self { - UpdatePaymentMethodConfigurationLinkDisplayPreferencePreference::None => "none", - UpdatePaymentMethodConfigurationLinkDisplayPreferencePreference::Off => "off", - UpdatePaymentMethodConfigurationLinkDisplayPreferencePreference::On => "on", - } - } -} - -impl AsRef for UpdatePaymentMethodConfigurationLinkDisplayPreferencePreference { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for UpdatePaymentMethodConfigurationLinkDisplayPreferencePreference { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for UpdatePaymentMethodConfigurationLinkDisplayPreferencePreference { - fn default() -> Self { - Self::None - } -} - -/// An enum representing the possible values of an `UpdatePaymentMethodConfigurationOxxoDisplayPreference`'s `preference` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum UpdatePaymentMethodConfigurationOxxoDisplayPreferencePreference { - None, - Off, - On, -} - -impl UpdatePaymentMethodConfigurationOxxoDisplayPreferencePreference { - pub fn as_str(self) -> &'static str { - match self { - UpdatePaymentMethodConfigurationOxxoDisplayPreferencePreference::None => "none", - UpdatePaymentMethodConfigurationOxxoDisplayPreferencePreference::Off => "off", - UpdatePaymentMethodConfigurationOxxoDisplayPreferencePreference::On => "on", - } - } -} - -impl AsRef for UpdatePaymentMethodConfigurationOxxoDisplayPreferencePreference { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for UpdatePaymentMethodConfigurationOxxoDisplayPreferencePreference { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for UpdatePaymentMethodConfigurationOxxoDisplayPreferencePreference { - fn default() -> Self { - Self::None - } -} - -/// An enum representing the possible values of an `UpdatePaymentMethodConfigurationP24DisplayPreference`'s `preference` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum UpdatePaymentMethodConfigurationP24DisplayPreferencePreference { - None, - Off, - On, -} - -impl UpdatePaymentMethodConfigurationP24DisplayPreferencePreference { - pub fn as_str(self) -> &'static str { - match self { - UpdatePaymentMethodConfigurationP24DisplayPreferencePreference::None => "none", - UpdatePaymentMethodConfigurationP24DisplayPreferencePreference::Off => "off", - UpdatePaymentMethodConfigurationP24DisplayPreferencePreference::On => "on", - } - } -} - -impl AsRef for UpdatePaymentMethodConfigurationP24DisplayPreferencePreference { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for UpdatePaymentMethodConfigurationP24DisplayPreferencePreference { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for UpdatePaymentMethodConfigurationP24DisplayPreferencePreference { - fn default() -> Self { - Self::None - } -} - -/// An enum representing the possible values of an `UpdatePaymentMethodConfigurationPaynowDisplayPreference`'s `preference` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum UpdatePaymentMethodConfigurationPaynowDisplayPreferencePreference { - None, - Off, - On, -} - -impl UpdatePaymentMethodConfigurationPaynowDisplayPreferencePreference { - pub fn as_str(self) -> &'static str { - match self { - UpdatePaymentMethodConfigurationPaynowDisplayPreferencePreference::None => "none", - UpdatePaymentMethodConfigurationPaynowDisplayPreferencePreference::Off => "off", - UpdatePaymentMethodConfigurationPaynowDisplayPreferencePreference::On => "on", - } - } -} - -impl AsRef for UpdatePaymentMethodConfigurationPaynowDisplayPreferencePreference { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for UpdatePaymentMethodConfigurationPaynowDisplayPreferencePreference { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for UpdatePaymentMethodConfigurationPaynowDisplayPreferencePreference { - fn default() -> Self { - Self::None - } -} - -/// An enum representing the possible values of an `UpdatePaymentMethodConfigurationPaypalDisplayPreference`'s `preference` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum UpdatePaymentMethodConfigurationPaypalDisplayPreferencePreference { - None, - Off, - On, -} - -impl UpdatePaymentMethodConfigurationPaypalDisplayPreferencePreference { - pub fn as_str(self) -> &'static str { - match self { - UpdatePaymentMethodConfigurationPaypalDisplayPreferencePreference::None => "none", - UpdatePaymentMethodConfigurationPaypalDisplayPreferencePreference::Off => "off", - UpdatePaymentMethodConfigurationPaypalDisplayPreferencePreference::On => "on", - } - } -} - -impl AsRef for UpdatePaymentMethodConfigurationPaypalDisplayPreferencePreference { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for UpdatePaymentMethodConfigurationPaypalDisplayPreferencePreference { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for UpdatePaymentMethodConfigurationPaypalDisplayPreferencePreference { - fn default() -> Self { - Self::None - } -} - -/// An enum representing the possible values of an `UpdatePaymentMethodConfigurationPromptpayDisplayPreference`'s `preference` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum UpdatePaymentMethodConfigurationPromptpayDisplayPreferencePreference { - None, - Off, - On, -} - -impl UpdatePaymentMethodConfigurationPromptpayDisplayPreferencePreference { - pub fn as_str(self) -> &'static str { - match self { - UpdatePaymentMethodConfigurationPromptpayDisplayPreferencePreference::None => "none", - UpdatePaymentMethodConfigurationPromptpayDisplayPreferencePreference::Off => "off", - UpdatePaymentMethodConfigurationPromptpayDisplayPreferencePreference::On => "on", - } - } -} - -impl AsRef for UpdatePaymentMethodConfigurationPromptpayDisplayPreferencePreference { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for UpdatePaymentMethodConfigurationPromptpayDisplayPreferencePreference { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for UpdatePaymentMethodConfigurationPromptpayDisplayPreferencePreference { - fn default() -> Self { - Self::None - } -} - -/// An enum representing the possible values of an `UpdatePaymentMethodConfigurationRevolutPayDisplayPreference`'s `preference` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum UpdatePaymentMethodConfigurationRevolutPayDisplayPreferencePreference { - None, - Off, - On, -} - -impl UpdatePaymentMethodConfigurationRevolutPayDisplayPreferencePreference { - pub fn as_str(self) -> &'static str { - match self { - UpdatePaymentMethodConfigurationRevolutPayDisplayPreferencePreference::None => "none", - UpdatePaymentMethodConfigurationRevolutPayDisplayPreferencePreference::Off => "off", - UpdatePaymentMethodConfigurationRevolutPayDisplayPreferencePreference::On => "on", - } - } -} - -impl AsRef for UpdatePaymentMethodConfigurationRevolutPayDisplayPreferencePreference { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for UpdatePaymentMethodConfigurationRevolutPayDisplayPreferencePreference { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for UpdatePaymentMethodConfigurationRevolutPayDisplayPreferencePreference { - fn default() -> Self { - Self::None - } -} - -/// An enum representing the possible values of an `UpdatePaymentMethodConfigurationSepaDebitDisplayPreference`'s `preference` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum UpdatePaymentMethodConfigurationSepaDebitDisplayPreferencePreference { - None, - Off, - On, -} - -impl UpdatePaymentMethodConfigurationSepaDebitDisplayPreferencePreference { - pub fn as_str(self) -> &'static str { - match self { - UpdatePaymentMethodConfigurationSepaDebitDisplayPreferencePreference::None => "none", - UpdatePaymentMethodConfigurationSepaDebitDisplayPreferencePreference::Off => "off", - UpdatePaymentMethodConfigurationSepaDebitDisplayPreferencePreference::On => "on", - } - } -} - -impl AsRef for UpdatePaymentMethodConfigurationSepaDebitDisplayPreferencePreference { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for UpdatePaymentMethodConfigurationSepaDebitDisplayPreferencePreference { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for UpdatePaymentMethodConfigurationSepaDebitDisplayPreferencePreference { - fn default() -> Self { - Self::None - } -} - -/// An enum representing the possible values of an `UpdatePaymentMethodConfigurationSofortDisplayPreference`'s `preference` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum UpdatePaymentMethodConfigurationSofortDisplayPreferencePreference { - None, - Off, - On, -} - -impl UpdatePaymentMethodConfigurationSofortDisplayPreferencePreference { - pub fn as_str(self) -> &'static str { - match self { - UpdatePaymentMethodConfigurationSofortDisplayPreferencePreference::None => "none", - UpdatePaymentMethodConfigurationSofortDisplayPreferencePreference::Off => "off", - UpdatePaymentMethodConfigurationSofortDisplayPreferencePreference::On => "on", - } - } -} - -impl AsRef for UpdatePaymentMethodConfigurationSofortDisplayPreferencePreference { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for UpdatePaymentMethodConfigurationSofortDisplayPreferencePreference { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for UpdatePaymentMethodConfigurationSofortDisplayPreferencePreference { - fn default() -> Self { - Self::None - } -} - -/// An enum representing the possible values of an `UpdatePaymentMethodConfigurationUsBankAccountDisplayPreference`'s `preference` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum UpdatePaymentMethodConfigurationUsBankAccountDisplayPreferencePreference { - None, - Off, - On, -} - -impl UpdatePaymentMethodConfigurationUsBankAccountDisplayPreferencePreference { - pub fn as_str(self) -> &'static str { - match self { - UpdatePaymentMethodConfigurationUsBankAccountDisplayPreferencePreference::None => "none", - UpdatePaymentMethodConfigurationUsBankAccountDisplayPreferencePreference::Off => "off", - UpdatePaymentMethodConfigurationUsBankAccountDisplayPreferencePreference::On => "on", - } - } -} - -impl AsRef for UpdatePaymentMethodConfigurationUsBankAccountDisplayPreferencePreference { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for UpdatePaymentMethodConfigurationUsBankAccountDisplayPreferencePreference { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for UpdatePaymentMethodConfigurationUsBankAccountDisplayPreferencePreference { - fn default() -> Self { - Self::None - } -} - -/// An enum representing the possible values of an `UpdatePaymentMethodConfigurationWechatPayDisplayPreference`'s `preference` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum UpdatePaymentMethodConfigurationWechatPayDisplayPreferencePreference { - None, - Off, - On, -} - -impl UpdatePaymentMethodConfigurationWechatPayDisplayPreferencePreference { - pub fn as_str(self) -> &'static str { - match self { - UpdatePaymentMethodConfigurationWechatPayDisplayPreferencePreference::None => "none", - UpdatePaymentMethodConfigurationWechatPayDisplayPreferencePreference::Off => "off", - UpdatePaymentMethodConfigurationWechatPayDisplayPreferencePreference::On => "on", - } - } -} - -impl AsRef for UpdatePaymentMethodConfigurationWechatPayDisplayPreferencePreference { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for UpdatePaymentMethodConfigurationWechatPayDisplayPreferencePreference { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for UpdatePaymentMethodConfigurationWechatPayDisplayPreferencePreference { - fn default() -> Self { - Self::None - } -} - -/// Cards are a popular way for consumers and businesses to pay online or in person. -/// -/// Stripe supports global and local card networks. -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct PaymentMethodParam { - /// Whether or not the payment method should be displayed. - #[serde(skip_serializing_if = "Option::is_none")] - pub display_preference: Option, -} - -/// Whether or not the payment method should be displayed. -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct DisplayPreference { - /// The account's preference for whether or not to display this payment method. - #[serde(skip_serializing_if = "Option::is_none")] - pub preference: Option, -} diff --git a/src/resources/generated/payment_method_detached.rs b/src/resources/generated/payment_method_detached.rs deleted file mode 100644 index fbc66662c..000000000 --- a/src/resources/generated/payment_method_detached.rs +++ /dev/null @@ -1,10 +0,0 @@ -// ====================================== -// This file was automatically generated. -// ====================================== - -use serde::{Deserialize, Serialize}; - -/// The resource representing a Stripe "payment_method.detached". -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct PaymentMethodDetached { -} diff --git a/src/resources/generated/payment_method_details_card_installments_plan.rs b/src/resources/generated/payment_method_details_card_installments_plan.rs deleted file mode 100644 index 14486ab6c..000000000 --- a/src/resources/generated/payment_method_details_card_installments_plan.rs +++ /dev/null @@ -1,85 +0,0 @@ -// ====================================== -// This file was automatically generated. -// ====================================== - -use serde::{Deserialize, Serialize}; - -/// The resource representing a Stripe "payment_method_details_card_installments_plan". -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct PaymentMethodDetailsCardInstallmentsPlan { - - /// For `fixed_count` installment plans, this is the number of installment payments your customer will make to their credit card. - pub count: Option, - - /// For `fixed_count` installment plans, this is the interval between installment payments your customer will make to their credit card. - /// One of `month`. - pub interval: Option, - - /// Type of installment plan, one of `fixed_count`. - #[serde(rename = "type")] - pub type_: PaymentMethodDetailsCardInstallmentsPlanType, -} - -/// An enum representing the possible values of an `PaymentMethodDetailsCardInstallmentsPlan`'s `interval` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum PaymentMethodDetailsCardInstallmentsPlanInterval { - Month, -} - -impl PaymentMethodDetailsCardInstallmentsPlanInterval { - pub fn as_str(self) -> &'static str { - match self { - PaymentMethodDetailsCardInstallmentsPlanInterval::Month => "month", - } - } -} - -impl AsRef for PaymentMethodDetailsCardInstallmentsPlanInterval { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for PaymentMethodDetailsCardInstallmentsPlanInterval { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for PaymentMethodDetailsCardInstallmentsPlanInterval { - fn default() -> Self { - Self::Month - } -} - -/// An enum representing the possible values of an `PaymentMethodDetailsCardInstallmentsPlan`'s `type` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum PaymentMethodDetailsCardInstallmentsPlanType { - FixedCount, -} - -impl PaymentMethodDetailsCardInstallmentsPlanType { - pub fn as_str(self) -> &'static str { - match self { - PaymentMethodDetailsCardInstallmentsPlanType::FixedCount => "fixed_count", - } - } -} - -impl AsRef for PaymentMethodDetailsCardInstallmentsPlanType { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for PaymentMethodDetailsCardInstallmentsPlanType { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for PaymentMethodDetailsCardInstallmentsPlanType { - fn default() -> Self { - Self::FixedCount - } -} diff --git a/src/resources/generated/payment_method_details_card_wallet_apple_pay.rs b/src/resources/generated/payment_method_details_card_wallet_apple_pay.rs deleted file mode 100644 index 4785e2e29..000000000 --- a/src/resources/generated/payment_method_details_card_wallet_apple_pay.rs +++ /dev/null @@ -1,9 +0,0 @@ -// ====================================== -// This file was automatically generated. -// ====================================== - -use serde::{Deserialize, Serialize}; - -/// The resource representing a Stripe "payment_method_details_card_wallet_apple_pay". -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct PaymentMethodDetailsCardWalletApplePay {} diff --git a/src/resources/generated/payment_method_details_card_wallet_google_pay.rs b/src/resources/generated/payment_method_details_card_wallet_google_pay.rs deleted file mode 100644 index 36af4281c..000000000 --- a/src/resources/generated/payment_method_details_card_wallet_google_pay.rs +++ /dev/null @@ -1,9 +0,0 @@ -// ====================================== -// This file was automatically generated. -// ====================================== - -use serde::{Deserialize, Serialize}; - -/// The resource representing a Stripe "payment_method_details_card_wallet_google_pay". -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct PaymentMethodDetailsCardWalletGooglePay {} diff --git a/src/resources/generated/payment_method_domain.rs b/src/resources/generated/payment_method_domain.rs deleted file mode 100644 index 714568537..000000000 --- a/src/resources/generated/payment_method_domain.rs +++ /dev/null @@ -1,234 +0,0 @@ -// ====================================== -// This file was automatically generated. -// ====================================== - -use crate::client::{Client, Response}; -use crate::ids::{PaymentMethodDomainId}; -use crate::params::{Expand, List, Object, Paginable, Timestamp}; -use serde::{Deserialize, Serialize}; - -/// The resource representing a Stripe "PaymentMethodDomainResourcePaymentMethodDomain". -/// -/// For more details see -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct PaymentMethodDomain { - /// Unique identifier for the object. - pub id: PaymentMethodDomainId, - - pub apple_pay: PaymentMethodDomainResourcePaymentMethodStatus, - - /// Time at which the object was created. - /// - /// Measured in seconds since the Unix epoch. - pub created: Timestamp, - - /// The domain name that this payment method domain object represents. - pub domain_name: String, - - /// Whether this payment method domain is enabled. - /// - /// If the domain is not enabled, payment methods that require a payment method domain will not appear in Elements. - pub enabled: bool, - - pub google_pay: PaymentMethodDomainResourcePaymentMethodStatus, - - pub link: PaymentMethodDomainResourcePaymentMethodStatus, - - /// Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. - pub livemode: bool, - - pub paypal: PaymentMethodDomainResourcePaymentMethodStatus, -} - -impl PaymentMethodDomain { - - /// Lists the details of existing payment method domains. -pub fn list(client: &Client, params: &ListPaymentMethodDomains<'_>) -> Response> { - client.get_query("/payment_method_domains", ¶ms) -} - - - /// Creates a payment method domain. - pub fn create(client: &Client, params: CreatePaymentMethodDomain<'_>) -> Response { - client.post_form("/payment_method_domains", ¶ms) - } - - /// Retrieves the details of an existing payment method domain. - pub fn retrieve(client: &Client, id: &PaymentMethodDomainId, expand: &[&str]) -> Response { - client.get_query(&format!("/payment_method_domains/{}", id), &Expand { expand }) - } - - /// Updates an existing payment method domain. - pub fn update(client: &Client, id: &PaymentMethodDomainId, params: UpdatePaymentMethodDomain<'_>) -> Response { - client.post_form(&format!("/payment_method_domains/{}", id), ¶ms) - } -} - -impl Object for PaymentMethodDomain { - type Id = PaymentMethodDomainId; - fn id(&self) -> Self::Id { - self.id.clone() - } - fn object(&self) -> &'static str { - "payment_method_domain" - } -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct PaymentMethodDomainResourcePaymentMethodStatus { - - /// The status of the payment method on the domain. - pub status: PaymentMethodDomainResourcePaymentMethodStatusStatus, - - #[serde(skip_serializing_if = "Option::is_none")] - pub status_details: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct PaymentMethodDomainResourcePaymentMethodStatusDetails { - - /// The error message associated with the status of the payment method on the domain. - pub error_message: String, -} - -/// The parameters for `PaymentMethodDomain::create`. -#[derive(Clone, Debug, Serialize)] -pub struct CreatePaymentMethodDomain<'a> { - - /// The domain name that this payment method domain object represents. - pub domain_name: &'a str, - - /// Whether this payment method domain is enabled. - /// - /// If the domain is not enabled, payment methods that require a payment method domain will not appear in Elements. - #[serde(skip_serializing_if = "Option::is_none")] - pub enabled: Option, - - /// Specifies which fields in the response should be expanded. - #[serde(skip_serializing_if = "Expand::is_empty")] - pub expand: &'a [&'a str], -} - -impl<'a> CreatePaymentMethodDomain<'a> { - pub fn new(domain_name: &'a str) -> Self { - CreatePaymentMethodDomain { - domain_name, - enabled: Default::default(), - expand: Default::default(), - } - } -} - -/// The parameters for `PaymentMethodDomain::list`. -#[derive(Clone, Debug, Serialize, Default)] -pub struct ListPaymentMethodDomains<'a> { - - /// The domain name that this payment method domain object represents. - #[serde(skip_serializing_if = "Option::is_none")] - pub domain_name: Option<&'a str>, - - /// Whether this payment method domain is enabled. - /// - /// If the domain is not enabled, payment methods will not appear in Elements. - #[serde(skip_serializing_if = "Option::is_none")] - pub enabled: Option, - - /// A cursor for use in pagination. - /// - /// `ending_before` is an object ID that defines your place in the list. - /// For instance, if you make a list request and receive 100 objects, starting with `obj_bar`, your subsequent call can include `ending_before=obj_bar` in order to fetch the previous page of the list. - #[serde(skip_serializing_if = "Option::is_none")] - pub ending_before: Option, - - /// Specifies which fields in the response should be expanded. - #[serde(skip_serializing_if = "Expand::is_empty")] - pub expand: &'a [&'a str], - - /// A limit on the number of objects to be returned. - /// - /// Limit can range between 1 and 100, and the default is 10. - #[serde(skip_serializing_if = "Option::is_none")] - pub limit: Option, - - /// A cursor for use in pagination. - /// - /// `starting_after` is an object ID that defines your place in the list. - /// For instance, if you make a list request and receive 100 objects, ending with `obj_foo`, your subsequent call can include `starting_after=obj_foo` in order to fetch the next page of the list. - #[serde(skip_serializing_if = "Option::is_none")] - pub starting_after: Option, -} - -impl<'a> ListPaymentMethodDomains<'a> { - pub fn new() -> Self { - ListPaymentMethodDomains { - domain_name: Default::default(), - enabled: Default::default(), - ending_before: Default::default(), - expand: Default::default(), - limit: Default::default(), - starting_after: Default::default(), - } - } -} -impl Paginable for ListPaymentMethodDomains<'_> { - type O = PaymentMethodDomain; - fn set_last(&mut self, item: Self::O) { - self.starting_after = Some(item.id()); - }} -/// The parameters for `PaymentMethodDomain::update`. -#[derive(Clone, Debug, Serialize, Default)] -pub struct UpdatePaymentMethodDomain<'a> { - - /// Whether this payment method domain is enabled. - /// - /// If the domain is not enabled, payment methods that require a payment method domain will not appear in Elements. - #[serde(skip_serializing_if = "Option::is_none")] - pub enabled: Option, - - /// Specifies which fields in the response should be expanded. - #[serde(skip_serializing_if = "Expand::is_empty")] - pub expand: &'a [&'a str], -} - -impl<'a> UpdatePaymentMethodDomain<'a> { - pub fn new() -> Self { - UpdatePaymentMethodDomain { - enabled: Default::default(), - expand: Default::default(), - } - } -} - -/// An enum representing the possible values of an `PaymentMethodDomainResourcePaymentMethodStatus`'s `status` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum PaymentMethodDomainResourcePaymentMethodStatusStatus { - Active, - Inactive, -} - -impl PaymentMethodDomainResourcePaymentMethodStatusStatus { - pub fn as_str(self) -> &'static str { - match self { - PaymentMethodDomainResourcePaymentMethodStatusStatus::Active => "active", - PaymentMethodDomainResourcePaymentMethodStatusStatus::Inactive => "inactive", - } - } -} - -impl AsRef for PaymentMethodDomainResourcePaymentMethodStatusStatus { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for PaymentMethodDomainResourcePaymentMethodStatusStatus { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for PaymentMethodDomainResourcePaymentMethodStatusStatus { - fn default() -> Self { - Self::Active - } -} diff --git a/src/resources/generated/payment_method_options_customer_balance_eu_bank_account.rs b/src/resources/generated/payment_method_options_customer_balance_eu_bank_account.rs deleted file mode 100644 index 1505af091..000000000 --- a/src/resources/generated/payment_method_options_customer_balance_eu_bank_account.rs +++ /dev/null @@ -1,62 +0,0 @@ -// ====================================== -// This file was automatically generated. -// ====================================== - -use serde::{Deserialize, Serialize}; - -/// The resource representing a Stripe "payment_method_options_customer_balance_eu_bank_account". -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct PaymentMethodOptionsCustomerBalanceEuBankAccount { - /// The desired country code of the bank account information. - /// - /// Permitted values include: `BE`, `DE`, `ES`, `FR`, `IE`, or `NL`. - pub country: PaymentMethodOptionsCustomerBalanceEuBankAccountCountry, -} - -/// An enum representing the possible values of an `PaymentMethodOptionsCustomerBalanceEuBankAccount`'s `country` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum PaymentMethodOptionsCustomerBalanceEuBankAccountCountry { - #[serde(rename = "BE")] - Be, - #[serde(rename = "DE")] - De, - #[serde(rename = "ES")] - Es, - #[serde(rename = "FR")] - Fr, - #[serde(rename = "IE")] - Ie, - #[serde(rename = "NL")] - Nl, -} - -impl PaymentMethodOptionsCustomerBalanceEuBankAccountCountry { - pub fn as_str(self) -> &'static str { - match self { - PaymentMethodOptionsCustomerBalanceEuBankAccountCountry::Be => "BE", - PaymentMethodOptionsCustomerBalanceEuBankAccountCountry::De => "DE", - PaymentMethodOptionsCustomerBalanceEuBankAccountCountry::Es => "ES", - PaymentMethodOptionsCustomerBalanceEuBankAccountCountry::Fr => "FR", - PaymentMethodOptionsCustomerBalanceEuBankAccountCountry::Ie => "IE", - PaymentMethodOptionsCustomerBalanceEuBankAccountCountry::Nl => "NL", - } - } -} - -impl AsRef for PaymentMethodOptionsCustomerBalanceEuBankAccountCountry { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for PaymentMethodOptionsCustomerBalanceEuBankAccountCountry { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for PaymentMethodOptionsCustomerBalanceEuBankAccountCountry { - fn default() -> Self { - Self::Be - } -} diff --git a/src/resources/generated/payment_method_options_us_bank_account_mandate_options.rs b/src/resources/generated/payment_method_options_us_bank_account_mandate_options.rs deleted file mode 100644 index f255d7400..000000000 --- a/src/resources/generated/payment_method_options_us_bank_account_mandate_options.rs +++ /dev/null @@ -1,45 +0,0 @@ -// ====================================== -// This file was automatically generated. -// ====================================== - -use serde::{Deserialize, Serialize}; - -/// The resource representing a Stripe "payment_method_options_us_bank_account_mandate_options". -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct PaymentMethodOptionsUsBankAccountMandateOptions { - /// Mandate collection method. - #[serde(skip_serializing_if = "Option::is_none")] - pub collection_method: Option, -} - -/// An enum representing the possible values of an `PaymentMethodOptionsUsBankAccountMandateOptions`'s `collection_method` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum PaymentMethodOptionsUsBankAccountMandateOptionsCollectionMethod { - Paper, -} - -impl PaymentMethodOptionsUsBankAccountMandateOptionsCollectionMethod { - pub fn as_str(self) -> &'static str { - match self { - PaymentMethodOptionsUsBankAccountMandateOptionsCollectionMethod::Paper => "paper", - } - } -} - -impl AsRef for PaymentMethodOptionsUsBankAccountMandateOptionsCollectionMethod { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for PaymentMethodOptionsUsBankAccountMandateOptionsCollectionMethod { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for PaymentMethodOptionsUsBankAccountMandateOptionsCollectionMethod { - fn default() -> Self { - Self::Paper - } -} diff --git a/src/resources/generated/payment_method_updated.rs b/src/resources/generated/payment_method_updated.rs deleted file mode 100644 index 392a759aa..000000000 --- a/src/resources/generated/payment_method_updated.rs +++ /dev/null @@ -1,10 +0,0 @@ -// ====================================== -// This file was automatically generated. -// ====================================== - -use serde::{Deserialize, Serialize}; - -/// The resource representing a Stripe "payment_method.updated". -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct PaymentMethodUpdated { -} diff --git a/src/resources/generated/payout.rs b/src/resources/generated/payout.rs deleted file mode 100644 index c4739e516..000000000 --- a/src/resources/generated/payout.rs +++ /dev/null @@ -1,445 +0,0 @@ -// ====================================== -// This file was automatically generated. -// ====================================== - -use serde::{Deserialize, Serialize}; - -use crate::client::{Client, Response}; -use crate::ids::PayoutId; -use crate::params::{Expand, Expandable, List, Metadata, Object, Paginable, RangeQuery, Timestamp}; -use crate::resources::{BalanceTransaction, Currency, PayoutDestinationUnion}; - -/// The resource representing a Stripe "Payout". -/// -/// For more details see -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct Payout { - /// Unique identifier for the object. - pub id: PayoutId, - - /// The amount (in cents (or local equivalent)) that transfers to your bank account or debit card. - pub amount: i64, - - /// Date that you can expect the payout to arrive in the bank. - /// - /// This factors in delays to account for weekends or bank holidays. - pub arrival_date: Timestamp, - - /// Returns `true` if the payout is created by an [automated payout schedule](https://stripe.com/docs/payouts#payout-schedule) and `false` if it's [requested manually](https://stripe.com/docs/payouts#manual-payouts). - pub automatic: bool, - - /// ID of the balance transaction that describes the impact of this payout on your account balance. - pub balance_transaction: Option>, - - /// Time at which the object was created. - /// - /// Measured in seconds since the Unix epoch. - pub created: Timestamp, - - /// Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. - /// - /// Must be a [supported currency](https://stripe.com/docs/currencies). - pub currency: Currency, - - /// An arbitrary string attached to the object. - /// - /// Often useful for displaying to users. - pub description: Option, - - /// ID of the bank account or card the payout is sent to. - pub destination: Option>, - - /// If the payout fails or cancels, this is the ID of the balance transaction that reverses the initial balance transaction and returns the funds from the failed payout back in your balance. - pub failure_balance_transaction: Option>, - - /// Error code that provides a reason for a payout failure, if available. - /// - /// View our [list of failure codes](https://stripe.com/docs/api#payout_failures). - pub failure_code: Option, - - /// Message that provides the reason for a payout failure, if available. - pub failure_message: Option, - - /// Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. - pub livemode: bool, - - /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. - /// - /// This can be useful for storing additional information about the object in a structured format. - pub metadata: Option, - - /// The method used to send this payout, which can be `standard` or `instant`. - /// - /// `instant` is supported for payouts to debit cards and bank accounts in certain countries. - /// Learn more about [bank support for Instant Payouts](https://stripe.com/docs/payouts/instant-payouts-banks). - pub method: String, - - /// If the payout reverses another, this is the ID of the original payout. - pub original_payout: Option>, - - /// If `completed`, you can use the [Balance Transactions API](https://stripe.com/docs/api/balance_transactions/list#balance_transaction_list-payout) to list all balance transactions that are paid out in this payout. - pub reconciliation_status: PayoutReconciliationStatus, - - /// If the payout reverses, this is the ID of the payout that reverses this payout. - pub reversed_by: Option>, - - /// The source balance this payout came from, which can be one of the following: `card`, `fpx`, or `bank_account`. - pub source_type: String, - - /// Extra information about a payout that displays on the user's bank statement. - pub statement_descriptor: Option, - - /// Current status of the payout: `paid`, `pending`, `in_transit`, `canceled` or `failed`. - /// - /// A payout is `pending` until it's submitted to the bank, when it becomes `in_transit`. - /// The status changes to `paid` if the transaction succeeds, or to `failed` or `canceled` (within 5 business days). - /// Some payouts that fail might initially show as `paid`, then change to `failed`. - pub status: String, - - /// Can be `bank_account` or `card`. - #[serde(rename = "type")] - pub type_: PayoutType, -} - -impl Payout { - /// Returns a list of existing payouts sent to third-party bank accounts or payouts that Stripe sent to you. - /// - /// The payouts return in sorted order, with the most recently created payouts appearing first. - pub fn list(client: &Client, params: &ListPayouts<'_>) -> Response> { - client.get_query("/payouts", ¶ms) - } - - /// To send funds to your own bank account, create a new payout object. - /// - /// Your [Stripe balance](https://stripe.com/docs/api#balance) must cover the payout amount. - /// If it doesn’t, you receive an “Insufficient Funds” error. If your API key is in test mode, money won’t actually be sent, though every other action occurs as if you’re in live mode. If you create a manual payout on a Stripe account that uses multiple payment source types, you need to specify the source type balance that the payout draws from. - /// The [balance object](https://stripe.com/docs/api#balance_object) details available and pending amounts by source type. - pub fn create(client: &Client, params: CreatePayout<'_>) -> Response { - client.post_form("/payouts", ¶ms) - } - - /// Retrieves the details of an existing payout. - /// - /// Supply the unique payout ID from either a payout creation request or the payout list. - /// Stripe returns the corresponding payout information. - pub fn retrieve(client: &Client, id: &PayoutId, expand: &[&str]) -> Response { - client.get_query(&format!("/payouts/{}", id), &Expand { expand }) - } - - /// Updates the specified payout by setting the values of the parameters you pass. - /// - /// We don’t change parameters that you don’t provide. - /// This request only accepts the metadata as arguments. - pub fn update(client: &Client, id: &PayoutId, params: UpdatePayout<'_>) -> Response { - client.post_form(&format!("/payouts/{}", id), ¶ms) - } -} - -impl Object for Payout { - type Id = PayoutId; - fn id(&self) -> Self::Id { - self.id.clone() - } - fn object(&self) -> &'static str { - "payout" - } -} - -/// The parameters for `Payout::create`. -#[derive(Clone, Debug, Serialize)] -pub struct CreatePayout<'a> { - /// A positive integer in cents representing how much to payout. - pub amount: i64, - - /// Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. - /// - /// Must be a [supported currency](https://stripe.com/docs/currencies). - pub currency: Currency, - - /// An arbitrary string attached to the object. - /// - /// Often useful for displaying to users. - #[serde(skip_serializing_if = "Option::is_none")] - pub description: Option<&'a str>, - - /// The ID of a bank account or a card to send the payout to. - /// - /// If you don't provide a destination, we use the default external account for the specified currency. - #[serde(skip_serializing_if = "Option::is_none")] - pub destination: Option, - - /// Specifies which fields in the response should be expanded. - #[serde(skip_serializing_if = "Expand::is_empty")] - pub expand: &'a [&'a str], - - /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. - /// - /// This can be useful for storing additional information about the object in a structured format. - /// Individual keys can be unset by posting an empty value to them. - /// All keys can be unset by posting an empty value to `metadata`. - #[serde(skip_serializing_if = "Option::is_none")] - pub metadata: Option, - - /// The method used to send this payout, which is `standard` or `instant`. - /// - /// We support `instant` for payouts to debit cards and bank accounts in certain countries. - /// Learn more about [bank support for Instant Payouts](https://stripe.com/docs/payouts/instant-payouts-banks). - #[serde(skip_serializing_if = "Option::is_none")] - pub method: Option, - - /// The balance type of your Stripe balance to draw this payout from. - /// - /// Balances for different payment sources are kept separately. - /// You can find the amounts with the Balances API. - /// One of `bank_account`, `card`, or `fpx`. - #[serde(skip_serializing_if = "Option::is_none")] - pub source_type: Option, - - /// A string that displays on the recipient's bank or card statement (up to 22 characters). - /// - /// A `statement_descriptor` that's longer than 22 characters return an error. - /// Most banks truncate this information and display it inconsistently. - /// Some banks might not display it at all. - #[serde(skip_serializing_if = "Option::is_none")] - pub statement_descriptor: Option<&'a str>, -} - -impl<'a> CreatePayout<'a> { - pub fn new(amount: i64, currency: Currency) -> Self { - CreatePayout { - amount, - currency, - description: Default::default(), - destination: Default::default(), - expand: Default::default(), - metadata: Default::default(), - method: Default::default(), - source_type: Default::default(), - statement_descriptor: Default::default(), - } - } -} - -/// The parameters for `Payout::list`. -#[derive(Clone, Debug, Serialize, Default)] -pub struct ListPayouts<'a> { - #[serde(skip_serializing_if = "Option::is_none")] - pub arrival_date: Option>, - - #[serde(skip_serializing_if = "Option::is_none")] - pub created: Option>, - - /// The ID of an external account - only return payouts sent to this external account. - #[serde(skip_serializing_if = "Option::is_none")] - pub destination: Option, - - /// A cursor for use in pagination. - /// - /// `ending_before` is an object ID that defines your place in the list. - /// For instance, if you make a list request and receive 100 objects, starting with `obj_bar`, your subsequent call can include `ending_before=obj_bar` in order to fetch the previous page of the list. - #[serde(skip_serializing_if = "Option::is_none")] - pub ending_before: Option, - - /// Specifies which fields in the response should be expanded. - #[serde(skip_serializing_if = "Expand::is_empty")] - pub expand: &'a [&'a str], - - /// A limit on the number of objects to be returned. - /// - /// Limit can range between 1 and 100, and the default is 10. - #[serde(skip_serializing_if = "Option::is_none")] - pub limit: Option, - - /// A cursor for use in pagination. - /// - /// `starting_after` is an object ID that defines your place in the list. - /// For instance, if you make a list request and receive 100 objects, ending with `obj_foo`, your subsequent call can include `starting_after=obj_foo` in order to fetch the next page of the list. - #[serde(skip_serializing_if = "Option::is_none")] - pub starting_after: Option, - - /// Only return payouts that have the given status: `pending`, `paid`, `failed`, or `canceled`. - #[serde(skip_serializing_if = "Option::is_none")] - pub status: Option<&'a str>, -} - -impl<'a> ListPayouts<'a> { - pub fn new() -> Self { - ListPayouts { - arrival_date: Default::default(), - created: Default::default(), - destination: Default::default(), - ending_before: Default::default(), - expand: Default::default(), - limit: Default::default(), - starting_after: Default::default(), - status: Default::default(), - } - } -} -impl Paginable for ListPayouts<'_> { - type O = Payout; - fn set_last(&mut self, item: Self::O) { - self.starting_after = Some(item.id()); - } -} -/// The parameters for `Payout::update`. -#[derive(Clone, Debug, Serialize, Default)] -pub struct UpdatePayout<'a> { - /// Specifies which fields in the response should be expanded. - #[serde(skip_serializing_if = "Expand::is_empty")] - pub expand: &'a [&'a str], - - /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. - /// - /// This can be useful for storing additional information about the object in a structured format. - /// Individual keys can be unset by posting an empty value to them. - /// All keys can be unset by posting an empty value to `metadata`. - #[serde(skip_serializing_if = "Option::is_none")] - pub metadata: Option, -} - -impl<'a> UpdatePayout<'a> { - pub fn new() -> Self { - UpdatePayout { expand: Default::default(), metadata: Default::default() } - } -} - -/// An enum representing the possible values of an `CreatePayout`'s `method` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum PayoutMethod { - Instant, - Standard, -} - -impl PayoutMethod { - pub fn as_str(self) -> &'static str { - match self { - PayoutMethod::Instant => "instant", - PayoutMethod::Standard => "standard", - } - } -} - -impl AsRef for PayoutMethod { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for PayoutMethod { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for PayoutMethod { - fn default() -> Self { - Self::Instant - } -} - -/// An enum representing the possible values of an `Payout`'s `reconciliation_status` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum PayoutReconciliationStatus { - Completed, - InProgress, - NotApplicable, -} - -impl PayoutReconciliationStatus { - pub fn as_str(self) -> &'static str { - match self { - PayoutReconciliationStatus::Completed => "completed", - PayoutReconciliationStatus::InProgress => "in_progress", - PayoutReconciliationStatus::NotApplicable => "not_applicable", - } - } -} - -impl AsRef for PayoutReconciliationStatus { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for PayoutReconciliationStatus { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for PayoutReconciliationStatus { - fn default() -> Self { - Self::Completed - } -} - -/// An enum representing the possible values of an `CreatePayout`'s `source_type` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum PayoutSourceType { - BankAccount, - Card, - Fpx, -} - -impl PayoutSourceType { - pub fn as_str(self) -> &'static str { - match self { - PayoutSourceType::BankAccount => "bank_account", - PayoutSourceType::Card => "card", - PayoutSourceType::Fpx => "fpx", - } - } -} - -impl AsRef for PayoutSourceType { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for PayoutSourceType { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for PayoutSourceType { - fn default() -> Self { - Self::BankAccount - } -} - -/// An enum representing the possible values of an `Payout`'s `type` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum PayoutType { - BankAccount, - Card, -} - -impl PayoutType { - pub fn as_str(self) -> &'static str { - match self { - PayoutType::BankAccount => "bank_account", - PayoutType::Card => "card", - } - } -} - -impl AsRef for PayoutType { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for PayoutType { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for PayoutType { - fn default() -> Self { - Self::BankAccount - } -} diff --git a/src/resources/generated/payout_canceled.rs b/src/resources/generated/payout_canceled.rs deleted file mode 100644 index 5b2b5880b..000000000 --- a/src/resources/generated/payout_canceled.rs +++ /dev/null @@ -1,10 +0,0 @@ -// ====================================== -// This file was automatically generated. -// ====================================== - -use serde::{Deserialize, Serialize}; - -/// The resource representing a Stripe "payout.canceled". -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct PayoutCanceled { -} diff --git a/src/resources/generated/payout_created.rs b/src/resources/generated/payout_created.rs deleted file mode 100644 index e7d949101..000000000 --- a/src/resources/generated/payout_created.rs +++ /dev/null @@ -1,10 +0,0 @@ -// ====================================== -// This file was automatically generated. -// ====================================== - -use serde::{Deserialize, Serialize}; - -/// The resource representing a Stripe "payout.created". -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct PayoutCreated { -} diff --git a/src/resources/generated/payout_failed.rs b/src/resources/generated/payout_failed.rs deleted file mode 100644 index 6f87dfbba..000000000 --- a/src/resources/generated/payout_failed.rs +++ /dev/null @@ -1,10 +0,0 @@ -// ====================================== -// This file was automatically generated. -// ====================================== - -use serde::{Deserialize, Serialize}; - -/// The resource representing a Stripe "payout.failed". -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct PayoutFailed { -} diff --git a/src/resources/generated/payout_paid.rs b/src/resources/generated/payout_paid.rs deleted file mode 100644 index f8184664b..000000000 --- a/src/resources/generated/payout_paid.rs +++ /dev/null @@ -1,10 +0,0 @@ -// ====================================== -// This file was automatically generated. -// ====================================== - -use serde::{Deserialize, Serialize}; - -/// The resource representing a Stripe "payout.paid". -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct PayoutPaid { -} diff --git a/src/resources/generated/payout_reconciliation_completed.rs b/src/resources/generated/payout_reconciliation_completed.rs deleted file mode 100644 index 9668c307d..000000000 --- a/src/resources/generated/payout_reconciliation_completed.rs +++ /dev/null @@ -1,10 +0,0 @@ -// ====================================== -// This file was automatically generated. -// ====================================== - -use serde::{Deserialize, Serialize}; - -/// The resource representing a Stripe "payout.reconciliation_completed". -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct PayoutReconciliationCompleted { -} diff --git a/src/resources/generated/payout_updated.rs b/src/resources/generated/payout_updated.rs deleted file mode 100644 index 0ff3db8ec..000000000 --- a/src/resources/generated/payout_updated.rs +++ /dev/null @@ -1,10 +0,0 @@ -// ====================================== -// This file was automatically generated. -// ====================================== - -use serde::{Deserialize, Serialize}; - -/// The resource representing a Stripe "payout.updated". -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct PayoutUpdated { -} diff --git a/src/resources/generated/person.rs b/src/resources/generated/person.rs deleted file mode 100644 index 7ff2c6507..000000000 --- a/src/resources/generated/person.rs +++ /dev/null @@ -1,577 +0,0 @@ -// ====================================== -// This file was automatically generated. -// ====================================== - -use serde::{Deserialize, Serialize}; - -use crate::ids::PersonId; -use crate::params::{Expandable, Metadata, Object, Timestamp}; -use crate::resources::{Address, File}; - -/// The resource representing a Stripe "Person". -/// -/// For more details see -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct Person { - /// Unique identifier for the object. - pub id: PersonId, - - /// The account the person is associated with. - #[serde(skip_serializing_if = "Option::is_none")] - pub account: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub additional_tos_acceptances: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub address: Option
, - - /// The Kana variation of the person's address (Japan only). - #[serde(skip_serializing_if = "Option::is_none")] - pub address_kana: Option
, - - /// The Kanji variation of the person's address (Japan only). - #[serde(skip_serializing_if = "Option::is_none")] - pub address_kanji: Option
, - - /// Time at which the object was created. - /// - /// Measured in seconds since the Unix epoch. - #[serde(skip_serializing_if = "Option::is_none")] - pub created: Option, - - // Always true for a deleted object - #[serde(default)] - pub deleted: bool, - - #[serde(skip_serializing_if = "Option::is_none")] - pub dob: Option, - - /// The person's email address. - #[serde(skip_serializing_if = "Option::is_none")] - pub email: Option, - - /// The person's first name. - #[serde(skip_serializing_if = "Option::is_none")] - pub first_name: Option, - - /// The Kana variation of the person's first name (Japan only). - #[serde(skip_serializing_if = "Option::is_none")] - pub first_name_kana: Option, - - /// The Kanji variation of the person's first name (Japan only). - #[serde(skip_serializing_if = "Option::is_none")] - pub first_name_kanji: Option, - - /// A list of alternate names or aliases that the person is known by. - #[serde(skip_serializing_if = "Option::is_none")] - pub full_name_aliases: Option>, - - /// Information about the [upcoming new requirements for this person](https://stripe.com/docs/connect/custom-accounts/future-requirements), including what information needs to be collected, and by when. - #[serde(skip_serializing_if = "Option::is_none")] - pub future_requirements: Option, - - /// The person's gender (International regulations require either "male" or "female"). - #[serde(skip_serializing_if = "Option::is_none")] - pub gender: Option, - - /// Whether the person's `id_number` was provided. - /// - /// True if either the full ID number was provided or if only the required part of the ID number was provided (ex. - /// last four of an individual's SSN for the US indicated by `ssn_last_4_provided`). - #[serde(skip_serializing_if = "Option::is_none")] - pub id_number_provided: Option, - - /// Whether the person's `id_number_secondary` was provided. - #[serde(skip_serializing_if = "Option::is_none")] - pub id_number_secondary_provided: Option, - - /// The person's last name. - #[serde(skip_serializing_if = "Option::is_none")] - pub last_name: Option, - - /// The Kana variation of the person's last name (Japan only). - #[serde(skip_serializing_if = "Option::is_none")] - pub last_name_kana: Option, - - /// The Kanji variation of the person's last name (Japan only). - #[serde(skip_serializing_if = "Option::is_none")] - pub last_name_kanji: Option, - - /// The person's maiden name. - #[serde(skip_serializing_if = "Option::is_none")] - pub maiden_name: Option, - - /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. - /// - /// This can be useful for storing additional information about the object in a structured format. - #[serde(skip_serializing_if = "Option::is_none")] - pub metadata: Option, - - /// The country where the person is a national. - #[serde(skip_serializing_if = "Option::is_none")] - pub nationality: Option, - - /// The person's phone number. - #[serde(skip_serializing_if = "Option::is_none")] - pub phone: Option, - - /// Indicates if the person or any of their representatives, family members, or other closely related persons, declares that they hold or have held an important public job or function, in any jurisdiction. - #[serde(skip_serializing_if = "Option::is_none")] - pub political_exposure: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub registered_address: Option
, - - #[serde(skip_serializing_if = "Option::is_none")] - pub relationship: Option, - - /// Information about the requirements for this person, including what information needs to be collected, and by when. - #[serde(skip_serializing_if = "Option::is_none")] - pub requirements: Option, - - /// Whether the last four digits of the person's Social Security number have been provided (U.S. - /// - /// only). - #[serde(skip_serializing_if = "Option::is_none")] - pub ssn_last_4_provided: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub verification: Option, -} - -impl Object for Person { - type Id = PersonId; - fn id(&self) -> Self::Id { - self.id.clone() - } - fn object(&self) -> &'static str { - "person" - } -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct LegalEntityDob { - /// The day of birth, between 1 and 31. - pub day: Option, - - /// The month of birth, between 1 and 12. - pub month: Option, - - /// The four-digit year of birth. - pub year: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct PersonVerification { - /// A document showing address, either a passport, local ID card, or utility bill from a well-known utility company. - #[serde(skip_serializing_if = "Option::is_none")] - pub additional_document: Option, - - /// A user-displayable string describing the verification state for the person. - /// - /// For example, this may say "Provided identity information could not be verified". - #[serde(skip_serializing_if = "Option::is_none")] - pub details: Option, - - /// One of `document_address_mismatch`, `document_dob_mismatch`, `document_duplicate_type`, `document_id_number_mismatch`, `document_name_mismatch`, `document_nationality_mismatch`, `failed_keyed_identity`, or `failed_other`. - /// - /// A machine-readable code specifying the verification state for the person. - #[serde(skip_serializing_if = "Option::is_none")] - pub details_code: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub document: Option, - - /// The state of verification for the person. - /// - /// Possible values are `unverified`, `pending`, or `verified`. - pub status: String, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct PersonVerificationDocument { - /// The back of an ID returned by a [file upload](https://stripe.com/docs/api#create_file) with a `purpose` value of `identity_document`. - pub back: Option>, - - /// A user-displayable string describing the verification state of this document. - /// - /// For example, if a document is uploaded and the picture is too fuzzy, this may say "Identity document is too unclear to read". - pub details: Option, - - /// One of `document_corrupt`, `document_country_not_supported`, `document_expired`, `document_failed_copy`, `document_failed_other`, `document_failed_test_mode`, `document_fraudulent`, `document_failed_greyscale`, `document_incomplete`, `document_invalid`, `document_manipulated`, `document_missing_back`, `document_missing_front`, `document_not_readable`, `document_not_uploaded`, `document_photo_mismatch`, `document_too_large`, or `document_type_not_supported`. - /// - /// A machine-readable code specifying the verification state for this document. - pub details_code: Option, - - /// The front of an ID returned by a [file upload](https://stripe.com/docs/api#create_file) with a `purpose` value of `identity_document`. - pub front: Option>, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct PersonAdditionalTosAcceptances { - pub account: PersonAdditionalTosAcceptance, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct PersonAdditionalTosAcceptance { - /// The Unix timestamp marking when the legal guardian accepted the service agreement. - pub date: Option, - - /// The IP address from which the legal guardian accepted the service agreement. - pub ip: Option, - - /// The user agent of the browser from which the legal guardian accepted the service agreement. - pub user_agent: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct PersonFutureRequirements { - /// Fields that are due and can be satisfied by providing the corresponding alternative fields instead. - pub alternatives: Option>, - - /// Fields that need to be collected to keep the person's account enabled. - /// - /// If not collected by the account's `future_requirements[current_deadline]`, these fields will transition to the main `requirements` hash, and may immediately become `past_due`, but the account may also be given a grace period depending on the account's enablement state prior to transition. - pub currently_due: Vec, - - /// Fields that are `currently_due` and need to be collected again because validation or verification failed. - pub errors: Vec, - - /// Fields that need to be collected assuming all volume thresholds are reached. - /// - /// As they become required, they appear in `currently_due` as well, and the account's `future_requirements[current_deadline]` becomes set. - pub eventually_due: Vec, - - /// Fields that weren't collected by the account's `requirements.current_deadline`. - /// - /// These fields need to be collected to enable the person's account. - /// New fields will never appear here; `future_requirements.past_due` will always be a subset of `requirements.past_due`. - pub past_due: Vec, - - /// Fields that may become required depending on the results of verification or review. - /// - /// Will be an empty array unless an asynchronous verification is pending. - /// If verification fails, these fields move to `eventually_due` or `currently_due`. - pub pending_verification: Vec, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct AccountRequirementsAlternative { - /// Fields that can be provided to satisfy all fields in `original_fields_due`. - pub alternative_fields_due: Vec, - - /// Fields that are due and can be satisfied by providing all fields in `alternative_fields_due`. - pub original_fields_due: Vec, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct AccountRequirementsError { - /// The code for the type of error. - pub code: AccountRequirementsErrorCode, - - /// An informative message that indicates the error type and provides additional details about the error. - pub reason: String, - - /// The specific user onboarding requirement field (in the requirements hash) that needs to be resolved. - pub requirement: String, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct PersonRelationship { - /// Whether the person is a director of the account's legal entity. - /// - /// Directors are typically members of the governing board of the company, or responsible for ensuring the company meets its regulatory obligations. - pub director: Option, - - /// Whether the person has significant responsibility to control, manage, or direct the organization. - pub executive: Option, - - /// Whether the person is the legal guardian of the account's representative. - pub legal_guardian: Option, - - /// Whether the person is an owner of the account’s legal entity. - pub owner: Option, - - /// The percent owned by the person of the account's legal entity. - pub percent_ownership: Option, - - /// Whether the person is authorized as the primary representative of the account. - /// - /// This is the person nominated by the business to provide information about themselves, and general information about the account. - /// There can only be one representative at any given time. - /// At the time the account is created, this person should be set to the person responsible for opening the account. - pub representative: Option, - - /// The person's title (e.g., CEO, Support Engineer). - pub title: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct PersonRequirements { - /// Fields that are due and can be satisfied by providing the corresponding alternative fields instead. - pub alternatives: Option>, - - /// Fields that need to be collected to keep the person's account enabled. - /// - /// If not collected by the account's `current_deadline`, these fields appear in `past_due` as well, and the account is disabled. - pub currently_due: Vec, - - /// Fields that are `currently_due` and need to be collected again because validation or verification failed. - pub errors: Vec, - - /// Fields that need to be collected assuming all volume thresholds are reached. - /// - /// As they become required, they appear in `currently_due` as well, and the account's `current_deadline` becomes set. - pub eventually_due: Vec, - - /// Fields that weren't collected by the account's `current_deadline`. - /// - /// These fields need to be collected to enable the person's account. - pub past_due: Vec, - - /// Fields that may become required depending on the results of verification or review. - /// - /// Will be an empty array unless an asynchronous verification is pending. - /// If verification fails, these fields move to `eventually_due`, `currently_due`, or `past_due`. - pub pending_verification: Vec, -} - -/// An enum representing the possible values of an `AccountRequirementsError`'s `code` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum AccountRequirementsErrorCode { - InvalidAddressCityStatePostalCode, - InvalidAddressHighwayContractBox, - InvalidAddressPrivateMailbox, - InvalidBusinessProfileName, - InvalidBusinessProfileNameDenylisted, - InvalidCompanyNameDenylisted, - InvalidDobAgeOverMaximum, - #[serde(rename = "invalid_dob_age_under_18")] - InvalidDobAgeUnder18, - InvalidDobAgeUnderMinimum, - InvalidProductDescriptionLength, - InvalidProductDescriptionUrlMatch, - InvalidRepresentativeCountry, - InvalidStatementDescriptorBusinessMismatch, - InvalidStatementDescriptorDenylisted, - InvalidStatementDescriptorLength, - InvalidStatementDescriptorPrefixDenylisted, - InvalidStatementDescriptorPrefixMismatch, - InvalidStreetAddress, - InvalidTaxId, - InvalidTaxIdFormat, - InvalidTosAcceptance, - InvalidUrlDenylisted, - InvalidUrlFormat, - InvalidUrlLength, - InvalidUrlWebPresenceDetected, - InvalidUrlWebsiteBusinessInformationMismatch, - InvalidUrlWebsiteEmpty, - InvalidUrlWebsiteInaccessible, - InvalidUrlWebsiteInaccessibleGeoblocked, - InvalidUrlWebsiteInaccessiblePasswordProtected, - InvalidUrlWebsiteIncomplete, - InvalidUrlWebsiteIncompleteCancellationPolicy, - InvalidUrlWebsiteIncompleteCustomerServiceDetails, - InvalidUrlWebsiteIncompleteLegalRestrictions, - InvalidUrlWebsiteIncompleteRefundPolicy, - InvalidUrlWebsiteIncompleteReturnPolicy, - InvalidUrlWebsiteIncompleteTermsAndConditions, - InvalidUrlWebsiteIncompleteUnderConstruction, - InvalidUrlWebsiteOther, - InvalidValueOther, - VerificationDirectorsMismatch, - VerificationDocumentAddressMismatch, - VerificationDocumentAddressMissing, - VerificationDocumentCorrupt, - VerificationDocumentCountryNotSupported, - VerificationDocumentDirectorsMismatch, - VerificationDocumentDobMismatch, - VerificationDocumentDuplicateType, - VerificationDocumentExpired, - VerificationDocumentFailedCopy, - VerificationDocumentFailedGreyscale, - VerificationDocumentFailedOther, - VerificationDocumentFailedTestMode, - VerificationDocumentFraudulent, - VerificationDocumentIdNumberMismatch, - VerificationDocumentIdNumberMissing, - VerificationDocumentIncomplete, - VerificationDocumentInvalid, - VerificationDocumentIssueOrExpiryDateMissing, - VerificationDocumentManipulated, - VerificationDocumentMissingBack, - VerificationDocumentMissingFront, - VerificationDocumentNameMismatch, - VerificationDocumentNameMissing, - VerificationDocumentNationalityMismatch, - VerificationDocumentNotReadable, - VerificationDocumentNotSigned, - VerificationDocumentNotUploaded, - VerificationDocumentPhotoMismatch, - VerificationDocumentTooLarge, - VerificationDocumentTypeNotSupported, - VerificationExtraneousDirectors, - VerificationFailedAddressMatch, - VerificationFailedBusinessIecNumber, - VerificationFailedDocumentMatch, - VerificationFailedIdNumberMatch, - VerificationFailedKeyedIdentity, - VerificationFailedKeyedMatch, - VerificationFailedNameMatch, - VerificationFailedOther, - VerificationFailedResidentialAddress, - VerificationFailedTaxIdMatch, - VerificationFailedTaxIdNotIssued, - VerificationMissingDirectors, - VerificationMissingExecutives, - VerificationMissingOwners, - VerificationRequiresAdditionalMemorandumOfAssociations, -} - -impl AccountRequirementsErrorCode { - pub fn as_str(self) -> &'static str { - match self { - AccountRequirementsErrorCode::InvalidAddressCityStatePostalCode => "invalid_address_city_state_postal_code", - AccountRequirementsErrorCode::InvalidAddressHighwayContractBox => "invalid_address_highway_contract_box", - AccountRequirementsErrorCode::InvalidAddressPrivateMailbox => "invalid_address_private_mailbox", - AccountRequirementsErrorCode::InvalidBusinessProfileName => "invalid_business_profile_name", - AccountRequirementsErrorCode::InvalidBusinessProfileNameDenylisted => "invalid_business_profile_name_denylisted", - AccountRequirementsErrorCode::InvalidCompanyNameDenylisted => "invalid_company_name_denylisted", - AccountRequirementsErrorCode::InvalidDobAgeOverMaximum => "invalid_dob_age_over_maximum", - AccountRequirementsErrorCode::InvalidDobAgeUnder18 => "invalid_dob_age_under_18", - AccountRequirementsErrorCode::InvalidDobAgeUnderMinimum => "invalid_dob_age_under_minimum", - AccountRequirementsErrorCode::InvalidProductDescriptionLength => "invalid_product_description_length", - AccountRequirementsErrorCode::InvalidProductDescriptionUrlMatch => "invalid_product_description_url_match", - AccountRequirementsErrorCode::InvalidRepresentativeCountry => "invalid_representative_country", - AccountRequirementsErrorCode::InvalidStatementDescriptorBusinessMismatch => "invalid_statement_descriptor_business_mismatch", - AccountRequirementsErrorCode::InvalidStatementDescriptorDenylisted => "invalid_statement_descriptor_denylisted", - AccountRequirementsErrorCode::InvalidStatementDescriptorLength => "invalid_statement_descriptor_length", - AccountRequirementsErrorCode::InvalidStatementDescriptorPrefixDenylisted => "invalid_statement_descriptor_prefix_denylisted", - AccountRequirementsErrorCode::InvalidStatementDescriptorPrefixMismatch => "invalid_statement_descriptor_prefix_mismatch", - AccountRequirementsErrorCode::InvalidStreetAddress => "invalid_street_address", - AccountRequirementsErrorCode::InvalidTaxId => "invalid_tax_id", - AccountRequirementsErrorCode::InvalidTaxIdFormat => "invalid_tax_id_format", - AccountRequirementsErrorCode::InvalidTosAcceptance => "invalid_tos_acceptance", - AccountRequirementsErrorCode::InvalidUrlDenylisted => "invalid_url_denylisted", - AccountRequirementsErrorCode::InvalidUrlFormat => "invalid_url_format", - AccountRequirementsErrorCode::InvalidUrlLength => "invalid_url_length", - AccountRequirementsErrorCode::InvalidUrlWebPresenceDetected => "invalid_url_web_presence_detected", - AccountRequirementsErrorCode::InvalidUrlWebsiteBusinessInformationMismatch => "invalid_url_website_business_information_mismatch", - AccountRequirementsErrorCode::InvalidUrlWebsiteEmpty => "invalid_url_website_empty", - AccountRequirementsErrorCode::InvalidUrlWebsiteInaccessible => "invalid_url_website_inaccessible", - AccountRequirementsErrorCode::InvalidUrlWebsiteInaccessibleGeoblocked => "invalid_url_website_inaccessible_geoblocked", - AccountRequirementsErrorCode::InvalidUrlWebsiteInaccessiblePasswordProtected => "invalid_url_website_inaccessible_password_protected", - AccountRequirementsErrorCode::InvalidUrlWebsiteIncomplete => "invalid_url_website_incomplete", - AccountRequirementsErrorCode::InvalidUrlWebsiteIncompleteCancellationPolicy => "invalid_url_website_incomplete_cancellation_policy", - AccountRequirementsErrorCode::InvalidUrlWebsiteIncompleteCustomerServiceDetails => "invalid_url_website_incomplete_customer_service_details", - AccountRequirementsErrorCode::InvalidUrlWebsiteIncompleteLegalRestrictions => "invalid_url_website_incomplete_legal_restrictions", - AccountRequirementsErrorCode::InvalidUrlWebsiteIncompleteRefundPolicy => "invalid_url_website_incomplete_refund_policy", - AccountRequirementsErrorCode::InvalidUrlWebsiteIncompleteReturnPolicy => "invalid_url_website_incomplete_return_policy", - AccountRequirementsErrorCode::InvalidUrlWebsiteIncompleteTermsAndConditions => "invalid_url_website_incomplete_terms_and_conditions", - AccountRequirementsErrorCode::InvalidUrlWebsiteIncompleteUnderConstruction => "invalid_url_website_incomplete_under_construction", - AccountRequirementsErrorCode::InvalidUrlWebsiteOther => "invalid_url_website_other", - AccountRequirementsErrorCode::InvalidValueOther => "invalid_value_other", - AccountRequirementsErrorCode::VerificationDirectorsMismatch => "verification_directors_mismatch", - AccountRequirementsErrorCode::VerificationDocumentAddressMismatch => "verification_document_address_mismatch", - AccountRequirementsErrorCode::VerificationDocumentAddressMissing => "verification_document_address_missing", - AccountRequirementsErrorCode::VerificationDocumentCorrupt => "verification_document_corrupt", - AccountRequirementsErrorCode::VerificationDocumentCountryNotSupported => "verification_document_country_not_supported", - AccountRequirementsErrorCode::VerificationDocumentDirectorsMismatch => "verification_document_directors_mismatch", - AccountRequirementsErrorCode::VerificationDocumentDobMismatch => "verification_document_dob_mismatch", - AccountRequirementsErrorCode::VerificationDocumentDuplicateType => "verification_document_duplicate_type", - AccountRequirementsErrorCode::VerificationDocumentExpired => "verification_document_expired", - AccountRequirementsErrorCode::VerificationDocumentFailedCopy => "verification_document_failed_copy", - AccountRequirementsErrorCode::VerificationDocumentFailedGreyscale => "verification_document_failed_greyscale", - AccountRequirementsErrorCode::VerificationDocumentFailedOther => "verification_document_failed_other", - AccountRequirementsErrorCode::VerificationDocumentFailedTestMode => "verification_document_failed_test_mode", - AccountRequirementsErrorCode::VerificationDocumentFraudulent => "verification_document_fraudulent", - AccountRequirementsErrorCode::VerificationDocumentIdNumberMismatch => "verification_document_id_number_mismatch", - AccountRequirementsErrorCode::VerificationDocumentIdNumberMissing => "verification_document_id_number_missing", - AccountRequirementsErrorCode::VerificationDocumentIncomplete => "verification_document_incomplete", - AccountRequirementsErrorCode::VerificationDocumentInvalid => "verification_document_invalid", - AccountRequirementsErrorCode::VerificationDocumentIssueOrExpiryDateMissing => "verification_document_issue_or_expiry_date_missing", - AccountRequirementsErrorCode::VerificationDocumentManipulated => "verification_document_manipulated", - AccountRequirementsErrorCode::VerificationDocumentMissingBack => "verification_document_missing_back", - AccountRequirementsErrorCode::VerificationDocumentMissingFront => "verification_document_missing_front", - AccountRequirementsErrorCode::VerificationDocumentNameMismatch => "verification_document_name_mismatch", - AccountRequirementsErrorCode::VerificationDocumentNameMissing => "verification_document_name_missing", - AccountRequirementsErrorCode::VerificationDocumentNationalityMismatch => "verification_document_nationality_mismatch", - AccountRequirementsErrorCode::VerificationDocumentNotReadable => "verification_document_not_readable", - AccountRequirementsErrorCode::VerificationDocumentNotSigned => "verification_document_not_signed", - AccountRequirementsErrorCode::VerificationDocumentNotUploaded => "verification_document_not_uploaded", - AccountRequirementsErrorCode::VerificationDocumentPhotoMismatch => "verification_document_photo_mismatch", - AccountRequirementsErrorCode::VerificationDocumentTooLarge => "verification_document_too_large", - AccountRequirementsErrorCode::VerificationDocumentTypeNotSupported => "verification_document_type_not_supported", - AccountRequirementsErrorCode::VerificationExtraneousDirectors => "verification_extraneous_directors", - AccountRequirementsErrorCode::VerificationFailedAddressMatch => "verification_failed_address_match", - AccountRequirementsErrorCode::VerificationFailedBusinessIecNumber => "verification_failed_business_iec_number", - AccountRequirementsErrorCode::VerificationFailedDocumentMatch => "verification_failed_document_match", - AccountRequirementsErrorCode::VerificationFailedIdNumberMatch => "verification_failed_id_number_match", - AccountRequirementsErrorCode::VerificationFailedKeyedIdentity => "verification_failed_keyed_identity", - AccountRequirementsErrorCode::VerificationFailedKeyedMatch => "verification_failed_keyed_match", - AccountRequirementsErrorCode::VerificationFailedNameMatch => "verification_failed_name_match", - AccountRequirementsErrorCode::VerificationFailedOther => "verification_failed_other", - AccountRequirementsErrorCode::VerificationFailedResidentialAddress => "verification_failed_residential_address", - AccountRequirementsErrorCode::VerificationFailedTaxIdMatch => "verification_failed_tax_id_match", - AccountRequirementsErrorCode::VerificationFailedTaxIdNotIssued => "verification_failed_tax_id_not_issued", - AccountRequirementsErrorCode::VerificationMissingDirectors => "verification_missing_directors", - AccountRequirementsErrorCode::VerificationMissingExecutives => "verification_missing_executives", - AccountRequirementsErrorCode::VerificationMissingOwners => "verification_missing_owners", - AccountRequirementsErrorCode::VerificationRequiresAdditionalMemorandumOfAssociations => "verification_requires_additional_memorandum_of_associations", - } - } -} - -impl AsRef for AccountRequirementsErrorCode { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for AccountRequirementsErrorCode { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for AccountRequirementsErrorCode { - fn default() -> Self { - Self::InvalidAddressCityStatePostalCode - } -} - -/// An enum representing the possible values of an `Person`'s `political_exposure` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum PersonPoliticalExposure { - Existing, - None, -} - -impl PersonPoliticalExposure { - pub fn as_str(self) -> &'static str { - match self { - PersonPoliticalExposure::Existing => "existing", - PersonPoliticalExposure::None => "none", - } - } -} - -impl AsRef for PersonPoliticalExposure { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for PersonPoliticalExposure { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for PersonPoliticalExposure { - fn default() -> Self { - Self::Existing - } -} diff --git a/src/resources/generated/person_created.rs b/src/resources/generated/person_created.rs deleted file mode 100644 index 33282d27b..000000000 --- a/src/resources/generated/person_created.rs +++ /dev/null @@ -1,10 +0,0 @@ -// ====================================== -// This file was automatically generated. -// ====================================== - -use serde::{Deserialize, Serialize}; - -/// The resource representing a Stripe "person.created". -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct PersonCreated { -} diff --git a/src/resources/generated/person_deleted.rs b/src/resources/generated/person_deleted.rs deleted file mode 100644 index ed6f8da36..000000000 --- a/src/resources/generated/person_deleted.rs +++ /dev/null @@ -1,10 +0,0 @@ -// ====================================== -// This file was automatically generated. -// ====================================== - -use serde::{Deserialize, Serialize}; - -/// The resource representing a Stripe "person.deleted". -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct PersonDeleted { -} diff --git a/src/resources/generated/person_updated.rs b/src/resources/generated/person_updated.rs deleted file mode 100644 index 7ba255011..000000000 --- a/src/resources/generated/person_updated.rs +++ /dev/null @@ -1,10 +0,0 @@ -// ====================================== -// This file was automatically generated. -// ====================================== - -use serde::{Deserialize, Serialize}; - -/// The resource representing a Stripe "person.updated". -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct PersonUpdated { -} diff --git a/src/resources/generated/placeholders.rs b/src/resources/generated/placeholders.rs deleted file mode 100644 index 0d00ead63..000000000 --- a/src/resources/generated/placeholders.rs +++ /dev/null @@ -1,582 +0,0 @@ -use serde::{Deserialize, Serialize}; - -use crate::ids::*; -use crate::params::Object; - -#[cfg(not(feature = "connect"))] -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct Account { - pub id: AccountId, -} - -#[cfg(not(feature = "connect"))] -impl Object for Account { - type Id = AccountId; - fn id(&self) -> Self::Id { - self.id.clone() - } - fn object(&self) -> &'static str { - "account" - } -} - -#[cfg(not(feature = "connect"))] -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct Application { - pub id: ApplicationId, -} - -#[cfg(not(feature = "connect"))] -impl Object for Application { - type Id = ApplicationId; - fn id(&self) -> Self::Id { - self.id.clone() - } - fn object(&self) -> &'static str { - "application" - } -} - -#[cfg(not(feature = "connect"))] -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct ApplicationFee { - pub id: ApplicationFeeId, -} - -#[cfg(not(feature = "connect"))] -impl Object for ApplicationFee { - type Id = ApplicationFeeId; - fn id(&self) -> Self::Id { - self.id.clone() - } - fn object(&self) -> &'static str { - "application_fee" - } -} - -#[cfg(not(feature = "checkout"))] -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CheckoutSession { - pub id: CheckoutSessionId, -} - -#[cfg(not(feature = "checkout"))] -impl Object for CheckoutSession { - type Id = CheckoutSessionId; - fn id(&self) -> Self::Id { - self.id.clone() - } - fn object(&self) -> &'static str { - "checkout_session" - } -} - -#[cfg(not(feature = "connect"))] -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct ConnectCollectionTransfer { - pub id: ConnectCollectionTransferId, -} - -#[cfg(not(feature = "connect"))] -impl Object for ConnectCollectionTransfer { - type Id = ConnectCollectionTransferId; - fn id(&self) -> Self::Id { - self.id.clone() - } - fn object(&self) -> &'static str { - "connect_collection_transfer" - } -} - -#[cfg(not(feature = "billing"))] -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct Coupon { - pub id: CouponId, -} - -#[cfg(not(feature = "billing"))] -impl Object for Coupon { - type Id = CouponId; - fn id(&self) -> Self::Id { - self.id.clone() - } - fn object(&self) -> &'static str { - "coupon" - } -} - -#[cfg(not(feature = "billing"))] -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct Discount { - pub id: DiscountId, -} - -#[cfg(not(feature = "billing"))] -impl Object for Discount { - type Id = DiscountId; - fn id(&self) -> Self::Id { - self.id.clone() - } - fn object(&self) -> &'static str { - "discount" - } -} - -#[cfg(not(feature = "connect"))] -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct ApplicationFeeRefund { - pub id: ApplicationFeeRefundId, -} - -#[cfg(not(feature = "connect"))] -impl Object for ApplicationFeeRefund { - type Id = ApplicationFeeRefundId; - fn id(&self) -> Self::Id { - self.id.clone() - } - fn object(&self) -> &'static str { - "fee_refund" - } -} - -#[cfg(not(feature = "billing"))] -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct Invoice { - pub id: InvoiceId, -} - -#[cfg(not(feature = "billing"))] -impl Object for Invoice { - type Id = InvoiceId; - fn id(&self) -> Self::Id { - self.id.clone() - } - fn object(&self) -> &'static str { - "invoice" - } -} - -#[cfg(not(feature = "billing"))] -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct InvoiceItem { - pub id: InvoiceItemId, -} - -#[cfg(not(feature = "billing"))] -impl Object for InvoiceItem { - type Id = InvoiceItemId; - fn id(&self) -> Self::Id { - self.id.clone() - } - fn object(&self) -> &'static str { - "invoiceitem" - } -} - -#[cfg(not(feature = "issuing"))] -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct IssuingAuthorization { - pub id: IssuingAuthorizationId, -} - -#[cfg(not(feature = "issuing"))] -impl Object for IssuingAuthorization { - type Id = IssuingAuthorizationId; - fn id(&self) -> Self::Id { - self.id.clone() - } - fn object(&self) -> &'static str { - "issuing.authorization" - } -} - -#[cfg(not(feature = "issuing"))] -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct IssuingCard { - pub id: IssuingCardId, -} - -#[cfg(not(feature = "issuing"))] -impl Object for IssuingCard { - type Id = IssuingCardId; - fn id(&self) -> Self::Id { - self.id.clone() - } - fn object(&self) -> &'static str { - "issuing.card" - } -} - -#[cfg(not(feature = "issuing"))] -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct IssuingCardholder { - pub id: IssuingCardholderId, -} - -#[cfg(not(feature = "issuing"))] -impl Object for IssuingCardholder { - type Id = IssuingCardholderId; - fn id(&self) -> Self::Id { - self.id.clone() - } - fn object(&self) -> &'static str { - "issuing.cardholder" - } -} - -#[cfg(not(feature = "issuing"))] -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct IssuingDispute { - pub id: IssuingDisputeId, -} - -#[cfg(not(feature = "issuing"))] -impl Object for IssuingDispute { - type Id = IssuingDisputeId; - fn id(&self) -> Self::Id { - self.id.clone() - } - fn object(&self) -> &'static str { - "issuing.dispute" - } -} - -#[cfg(not(feature = "issuing"))] -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct IssuingTransaction { - pub id: IssuingTransactionId, -} - -#[cfg(not(feature = "issuing"))] -impl Object for IssuingTransaction { - type Id = IssuingTransactionId; - fn id(&self) -> Self::Id { - self.id.clone() - } - fn object(&self) -> &'static str { - "issuing.transaction" - } -} - -#[cfg(not(feature = "billing"))] -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct InvoiceLineItem { - pub id: InvoiceLineItemId, -} - -#[cfg(not(feature = "billing"))] -impl Object for InvoiceLineItem { - type Id = InvoiceLineItemId; - fn id(&self) -> Self::Id { - self.id.clone() - } - fn object(&self) -> &'static str { - "line_item" - } -} - -#[cfg(not(feature = "orders"))] -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct Order { - pub id: (), -} - -#[cfg(not(feature = "orders"))] -impl Object for Order { - type Id = (); - fn id(&self) -> Self::Id { - self.id - } - fn object(&self) -> &'static str { - "order" - } -} - -#[cfg(not(feature = "orders"))] -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct OrderItem { - pub id: (), -} - -#[cfg(not(feature = "orders"))] -impl Object for OrderItem { - type Id = (); - fn id(&self) -> Self::Id { - self.id - } - fn object(&self) -> &'static str { - "order_item" - } -} - -#[cfg(not(feature = "orders"))] -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct OrderReturn { - pub id: (), -} - -#[cfg(not(feature = "orders"))] -impl Object for OrderReturn { - type Id = (); - fn id(&self) -> Self::Id { - self.id - } - fn object(&self) -> &'static str { - "order_return" - } -} - -#[cfg(not(feature = "connect"))] -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct Person { - pub id: PersonId, -} - -#[cfg(not(feature = "connect"))] -impl Object for Person { - type Id = PersonId; - fn id(&self) -> Self::Id { - self.id.clone() - } - fn object(&self) -> &'static str { - "person" - } -} - -#[cfg(not(feature = "billing"))] -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct Plan { - pub id: PlanId, -} - -#[cfg(not(feature = "billing"))] -impl Object for Plan { - type Id = PlanId; - fn id(&self) -> Self::Id { - self.id.clone() - } - fn object(&self) -> &'static str { - "plan" - } -} - -#[cfg(not(feature = "fraud"))] -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct Review { - pub id: ReviewId, -} - -#[cfg(not(feature = "fraud"))] -impl Object for Review { - type Id = ReviewId; - fn id(&self) -> Self::Id { - self.id.clone() - } - fn object(&self) -> &'static str { - "review" - } -} - -#[cfg(not(feature = "sigma"))] -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct ScheduledQueryRun { - pub id: ScheduledQueryRunId, -} - -#[cfg(not(feature = "sigma"))] -impl Object for ScheduledQueryRun { - type Id = ScheduledQueryRunId; - fn id(&self) -> Self::Id { - self.id.clone() - } - fn object(&self) -> &'static str { - "scheduled_query_run" - } -} - -#[cfg(not(feature = "orders"))] -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct Sku { - pub id: (), -} - -#[cfg(not(feature = "orders"))] -impl Object for Sku { - type Id = (); - fn id(&self) -> Self::Id { - self.id - } - fn object(&self) -> &'static str { - "sku" - } -} - -#[cfg(not(feature = "billing"))] -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct Subscription { - pub id: SubscriptionId, -} - -#[cfg(not(feature = "billing"))] -impl Object for Subscription { - type Id = SubscriptionId; - fn id(&self) -> Self::Id { - self.id.clone() - } - fn object(&self) -> &'static str { - "subscription" - } -} - -#[cfg(not(feature = "billing"))] -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct SubscriptionItem { - pub id: SubscriptionItemId, -} - -#[cfg(not(feature = "billing"))] -impl Object for SubscriptionItem { - type Id = SubscriptionItemId; - fn id(&self) -> Self::Id { - self.id.clone() - } - fn object(&self) -> &'static str { - "subscription_item" - } -} - -#[cfg(not(feature = "billing"))] -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct SubscriptionSchedule { - pub id: SubscriptionScheduleId, -} - -#[cfg(not(feature = "billing"))] -impl Object for SubscriptionSchedule { - type Id = SubscriptionScheduleId; - fn id(&self) -> Self::Id { - self.id.clone() - } - fn object(&self) -> &'static str { - "subscription_schedule" - } -} - -#[cfg(not(feature = "billing"))] -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct SubscriptionScheduleRevision { - pub id: (), -} - -#[cfg(not(feature = "billing"))] -impl Object for SubscriptionScheduleRevision { - type Id = (); - fn id(&self) -> Self::Id { - self.id - } - fn object(&self) -> &'static str { - "subscription_schedule_revision" - } -} - -#[cfg(not(feature = "billing"))] -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct TaxId { - pub id: TaxIdId, -} - -#[cfg(not(feature = "billing"))] -impl Object for TaxId { - type Id = TaxIdId; - fn id(&self) -> Self::Id { - self.id.clone() - } - fn object(&self) -> &'static str { - "tax_id" - } -} - -#[cfg(not(feature = "billing"))] -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct TaxRate { - pub id: TaxRateId, -} - -#[cfg(not(feature = "billing"))] -impl Object for TaxRate { - type Id = TaxRateId; - fn id(&self) -> Self::Id { - self.id.clone() - } - fn object(&self) -> &'static str { - "tax_rate" - } -} - -#[cfg(not(feature = "connect"))] -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct Topup { - pub id: TopupId, -} - -#[cfg(not(feature = "connect"))] -impl Object for Topup { - type Id = TopupId; - fn id(&self) -> Self::Id { - self.id.clone() - } - fn object(&self) -> &'static str { - "topup" - } -} - -#[cfg(not(feature = "connect"))] -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct Transfer { - pub id: TransferId, -} - -#[cfg(not(feature = "connect"))] -impl Object for Transfer { - type Id = TransferId; - fn id(&self) -> Self::Id { - self.id.clone() - } - fn object(&self) -> &'static str { - "transfer" - } -} - -#[cfg(not(feature = "connect"))] -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct TransferReversal { - pub id: TransferReversalId, -} - -#[cfg(not(feature = "connect"))] -impl Object for TransferReversal { - type Id = TransferReversalId; - fn id(&self) -> Self::Id { - self.id.clone() - } - fn object(&self) -> &'static str { - "transfer_reversal" - } -} - -#[cfg(not(feature = "webhook-endpoints"))] -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct WebhookEndpoint { - pub id: WebhookEndpointId, -} - -#[cfg(not(feature = "webhook-endpoints"))] -impl Object for WebhookEndpoint { - type Id = WebhookEndpointId; - fn id(&self) -> Self::Id { - self.id.clone() - } - fn object(&self) -> &'static str { - "webhook_endpoint" - } -} diff --git a/src/resources/generated/plan.rs b/src/resources/generated/plan.rs deleted file mode 100644 index 495df6630..000000000 --- a/src/resources/generated/plan.rs +++ /dev/null @@ -1,516 +0,0 @@ -// ====================================== -// This file was automatically generated. -// ====================================== - -use serde::{Deserialize, Serialize}; - -use crate::client::{Client, Response}; -use crate::ids::PlanId; -use crate::params::{ - Deleted, Expand, Expandable, IdOrCreate, List, Metadata, Object, Paginable, RangeQuery, - Timestamp, -}; -use crate::resources::{CreateProduct, Currency, Product}; - -/// The resource representing a Stripe "Plan". -/// -/// For more details see -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct Plan { - /// Unique identifier for the object. - pub id: PlanId, - - /// Whether the plan can be used for new purchases. - #[serde(skip_serializing_if = "Option::is_none")] - pub active: Option, - - /// Specifies a usage aggregation strategy for plans of `usage_type=metered`. - /// - /// Allowed values are `sum` for summing up all usage during a period, `last_during_period` for using the last usage record reported within a period, `last_ever` for using the last usage record ever (across period bounds) or `max` which uses the usage record with the maximum reported usage during a period. - /// Defaults to `sum`. - #[serde(skip_serializing_if = "Option::is_none")] - pub aggregate_usage: Option, - - /// The unit amount in cents (or local equivalent) to be charged, represented as a whole integer if possible. - /// - /// Only set if `billing_scheme=per_unit`. - #[serde(skip_serializing_if = "Option::is_none")] - pub amount: Option, - - /// The unit amount in cents (or local equivalent) to be charged, represented as a decimal string with at most 12 decimal places. - /// - /// Only set if `billing_scheme=per_unit`. - #[serde(skip_serializing_if = "Option::is_none")] - pub amount_decimal: Option, - - /// Describes how to compute the price per period. - /// - /// Either `per_unit` or `tiered`. - /// `per_unit` indicates that the fixed amount (specified in `amount`) will be charged per unit in `quantity` (for plans with `usage_type=licensed`), or per unit of total usage (for plans with `usage_type=metered`). - /// `tiered` indicates that the unit pricing will be computed using a tiering strategy as defined using the `tiers` and `tiers_mode` attributes. - #[serde(skip_serializing_if = "Option::is_none")] - pub billing_scheme: Option, - - /// Time at which the object was created. - /// - /// Measured in seconds since the Unix epoch. - #[serde(skip_serializing_if = "Option::is_none")] - pub created: Option, - - /// Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. - /// - /// Must be a [supported currency](https://stripe.com/docs/currencies). - #[serde(skip_serializing_if = "Option::is_none")] - pub currency: Option, - - // Always true for a deleted object - #[serde(default)] - pub deleted: bool, - - /// The frequency at which a subscription is billed. - /// - /// One of `day`, `week`, `month` or `year`. - #[serde(skip_serializing_if = "Option::is_none")] - pub interval: Option, - - /// The number of intervals (specified in the `interval` attribute) between subscription billings. - /// - /// For example, `interval=month` and `interval_count=3` bills every 3 months. - #[serde(skip_serializing_if = "Option::is_none")] - pub interval_count: Option, - - /// Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. - #[serde(skip_serializing_if = "Option::is_none")] - pub livemode: Option, - - /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. - /// - /// This can be useful for storing additional information about the object in a structured format. - #[serde(skip_serializing_if = "Option::is_none")] - pub metadata: Option, - - /// A brief description of the plan, hidden from customers. - #[serde(skip_serializing_if = "Option::is_none")] - pub nickname: Option, - - /// The product whose pricing this plan determines. - #[serde(skip_serializing_if = "Option::is_none")] - pub product: Option>, - - /// Each element represents a pricing tier. - /// - /// This parameter requires `billing_scheme` to be set to `tiered`. - /// See also the documentation for `billing_scheme`. - #[serde(skip_serializing_if = "Option::is_none")] - pub tiers: Option>, - - /// Defines if the tiering price should be `graduated` or `volume` based. - /// - /// In `volume`-based tiering, the maximum quantity within a period determines the per unit price. - /// In `graduated` tiering, pricing can change as the quantity grows. - #[serde(skip_serializing_if = "Option::is_none")] - pub tiers_mode: Option, - - /// Apply a transformation to the reported usage or set quantity before computing the amount billed. - /// - /// Cannot be combined with `tiers`. - #[serde(skip_serializing_if = "Option::is_none")] - pub transform_usage: Option, - - /// Default number of trial days when subscribing a customer to this plan using [`trial_from_plan=true`](https://stripe.com/docs/api#create_subscription-trial_from_plan). - #[serde(skip_serializing_if = "Option::is_none")] - pub trial_period_days: Option, - - /// Configures how the quantity per period should be determined. - /// - /// Can be either `metered` or `licensed`. - /// `licensed` automatically bills the `quantity` set when adding it to a subscription. - /// `metered` aggregates the total usage based on usage records. - /// Defaults to `licensed`. - #[serde(skip_serializing_if = "Option::is_none")] - pub usage_type: Option, -} - -impl Plan { - /// Returns a list of your plans. - pub fn list(client: &Client, params: &ListPlans<'_>) -> Response> { - client.get_query("/plans", ¶ms) - } - - /// Retrieves the plan with the given ID. - pub fn retrieve(client: &Client, id: &PlanId, expand: &[&str]) -> Response { - client.get_query(&format!("/plans/{}", id), &Expand { expand }) - } - - /// Updates the specified plan by setting the values of the parameters passed. - /// - /// Any parameters not provided are left unchanged. - /// By design, you cannot change a plan’s ID, amount, currency, or billing cycle. - pub fn update(client: &Client, id: &PlanId, params: UpdatePlan<'_>) -> Response { - client.post_form(&format!("/plans/{}", id), ¶ms) - } - - /// Deleting plans means new subscribers can’t be added. - /// - /// Existing subscribers aren’t affected. - pub fn delete(client: &Client, id: &PlanId) -> Response> { - client.delete(&format!("/plans/{}", id)) - } -} - -impl Object for Plan { - type Id = PlanId; - fn id(&self) -> Self::Id { - self.id.clone() - } - fn object(&self) -> &'static str { - "plan" - } -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct PlanTier { - /// Price for the entire tier. - pub flat_amount: Option, - - /// Same as `flat_amount`, but contains a decimal value with at most 12 decimal places. - pub flat_amount_decimal: Option, - - /// Per unit price for units relevant to the tier. - pub unit_amount: Option, - - /// Same as `unit_amount`, but contains a decimal value with at most 12 decimal places. - pub unit_amount_decimal: Option, - - /// Up to and including to this quantity will be contained in the tier. - pub up_to: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct TransformUsage { - /// Divide usage by this number. - pub divide_by: i64, - - /// After division, either round the result `up` or `down`. - pub round: TransformUsageRound, -} - -/// The parameters for `Plan::list`. -#[derive(Clone, Debug, Serialize, Default)] -pub struct ListPlans<'a> { - /// Only return plans that are active or inactive (e.g., pass `false` to list all inactive plans). - #[serde(skip_serializing_if = "Option::is_none")] - pub active: Option, - - /// A filter on the list, based on the object `created` field. - /// - /// The value can be a string with an integer Unix timestamp, or it can be a dictionary with a number of different query options. - #[serde(skip_serializing_if = "Option::is_none")] - pub created: Option>, - - /// A cursor for use in pagination. - /// - /// `ending_before` is an object ID that defines your place in the list. - /// For instance, if you make a list request and receive 100 objects, starting with `obj_bar`, your subsequent call can include `ending_before=obj_bar` in order to fetch the previous page of the list. - #[serde(skip_serializing_if = "Option::is_none")] - pub ending_before: Option, - - /// Specifies which fields in the response should be expanded. - #[serde(skip_serializing_if = "Expand::is_empty")] - pub expand: &'a [&'a str], - - /// A limit on the number of objects to be returned. - /// - /// Limit can range between 1 and 100, and the default is 10. - #[serde(skip_serializing_if = "Option::is_none")] - pub limit: Option, - - /// Only return plans for the given product. - #[serde(skip_serializing_if = "Option::is_none")] - pub product: Option>>, - - /// A cursor for use in pagination. - /// - /// `starting_after` is an object ID that defines your place in the list. - /// For instance, if you make a list request and receive 100 objects, ending with `obj_foo`, your subsequent call can include `starting_after=obj_foo` in order to fetch the next page of the list. - #[serde(skip_serializing_if = "Option::is_none")] - pub starting_after: Option, -} - -impl<'a> ListPlans<'a> { - pub fn new() -> Self { - ListPlans { - active: Default::default(), - created: Default::default(), - ending_before: Default::default(), - expand: Default::default(), - limit: Default::default(), - product: Default::default(), - starting_after: Default::default(), - } - } -} -impl Paginable for ListPlans<'_> { - type O = Plan; - fn set_last(&mut self, item: Self::O) { - self.starting_after = Some(item.id()); - } -} -/// The parameters for `Plan::update`. -#[derive(Clone, Debug, Serialize, Default)] -pub struct UpdatePlan<'a> { - /// Whether the plan is currently available for new subscriptions. - #[serde(skip_serializing_if = "Option::is_none")] - pub active: Option, - - /// Specifies which fields in the response should be expanded. - #[serde(skip_serializing_if = "Expand::is_empty")] - pub expand: &'a [&'a str], - - /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. - /// - /// This can be useful for storing additional information about the object in a structured format. - /// Individual keys can be unset by posting an empty value to them. - /// All keys can be unset by posting an empty value to `metadata`. - #[serde(skip_serializing_if = "Option::is_none")] - pub metadata: Option, - - /// A brief description of the plan, hidden from customers. - #[serde(skip_serializing_if = "Option::is_none")] - pub nickname: Option<&'a str>, - - /// The product the plan belongs to. - /// - /// This cannot be changed once it has been used in a subscription or subscription schedule. - #[serde(skip_serializing_if = "Option::is_none")] - pub product: Option>>, - - /// Default number of trial days when subscribing a customer to this plan using [`trial_from_plan=true`](https://stripe.com/docs/api#create_subscription-trial_from_plan). - #[serde(skip_serializing_if = "Option::is_none")] - pub trial_period_days: Option, -} - -impl<'a> UpdatePlan<'a> { - pub fn new() -> Self { - UpdatePlan { - active: Default::default(), - expand: Default::default(), - metadata: Default::default(), - nickname: Default::default(), - product: Default::default(), - trial_period_days: Default::default(), - } - } -} - -/// An enum representing the possible values of an `Plan`'s `aggregate_usage` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum PlanAggregateUsage { - LastDuringPeriod, - LastEver, - Max, - Sum, -} - -impl PlanAggregateUsage { - pub fn as_str(self) -> &'static str { - match self { - PlanAggregateUsage::LastDuringPeriod => "last_during_period", - PlanAggregateUsage::LastEver => "last_ever", - PlanAggregateUsage::Max => "max", - PlanAggregateUsage::Sum => "sum", - } - } -} - -impl AsRef for PlanAggregateUsage { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for PlanAggregateUsage { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for PlanAggregateUsage { - fn default() -> Self { - Self::LastDuringPeriod - } -} - -/// An enum representing the possible values of an `Plan`'s `billing_scheme` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum PlanBillingScheme { - PerUnit, - Tiered, -} - -impl PlanBillingScheme { - pub fn as_str(self) -> &'static str { - match self { - PlanBillingScheme::PerUnit => "per_unit", - PlanBillingScheme::Tiered => "tiered", - } - } -} - -impl AsRef for PlanBillingScheme { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for PlanBillingScheme { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for PlanBillingScheme { - fn default() -> Self { - Self::PerUnit - } -} - -/// An enum representing the possible values of an `Plan`'s `interval` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum PlanInterval { - Day, - Month, - Week, - Year, -} - -impl PlanInterval { - pub fn as_str(self) -> &'static str { - match self { - PlanInterval::Day => "day", - PlanInterval::Month => "month", - PlanInterval::Week => "week", - PlanInterval::Year => "year", - } - } -} - -impl AsRef for PlanInterval { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for PlanInterval { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for PlanInterval { - fn default() -> Self { - Self::Day - } -} - -/// An enum representing the possible values of an `Plan`'s `tiers_mode` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum PlanTiersMode { - Graduated, - Volume, -} - -impl PlanTiersMode { - pub fn as_str(self) -> &'static str { - match self { - PlanTiersMode::Graduated => "graduated", - PlanTiersMode::Volume => "volume", - } - } -} - -impl AsRef for PlanTiersMode { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for PlanTiersMode { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for PlanTiersMode { - fn default() -> Self { - Self::Graduated - } -} - -/// An enum representing the possible values of an `Plan`'s `usage_type` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum PlanUsageType { - Licensed, - Metered, -} - -impl PlanUsageType { - pub fn as_str(self) -> &'static str { - match self { - PlanUsageType::Licensed => "licensed", - PlanUsageType::Metered => "metered", - } - } -} - -impl AsRef for PlanUsageType { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for PlanUsageType { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for PlanUsageType { - fn default() -> Self { - Self::Licensed - } -} - -/// An enum representing the possible values of an `TransformUsage`'s `round` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum TransformUsageRound { - Down, - Up, -} - -impl TransformUsageRound { - pub fn as_str(self) -> &'static str { - match self { - TransformUsageRound::Down => "down", - TransformUsageRound::Up => "up", - } - } -} - -impl AsRef for TransformUsageRound { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for TransformUsageRound { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for TransformUsageRound { - fn default() -> Self { - Self::Down - } -} diff --git a/src/resources/generated/plan_created.rs b/src/resources/generated/plan_created.rs deleted file mode 100644 index 6c517b096..000000000 --- a/src/resources/generated/plan_created.rs +++ /dev/null @@ -1,10 +0,0 @@ -// ====================================== -// This file was automatically generated. -// ====================================== - -use serde::{Deserialize, Serialize}; - -/// The resource representing a Stripe "plan.created". -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct PlanCreated { -} diff --git a/src/resources/generated/plan_deleted.rs b/src/resources/generated/plan_deleted.rs deleted file mode 100644 index b1e888a1d..000000000 --- a/src/resources/generated/plan_deleted.rs +++ /dev/null @@ -1,10 +0,0 @@ -// ====================================== -// This file was automatically generated. -// ====================================== - -use serde::{Deserialize, Serialize}; - -/// The resource representing a Stripe "plan.deleted". -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct PlanDeleted { -} diff --git a/src/resources/generated/plan_updated.rs b/src/resources/generated/plan_updated.rs deleted file mode 100644 index 0a99e2b71..000000000 --- a/src/resources/generated/plan_updated.rs +++ /dev/null @@ -1,10 +0,0 @@ -// ====================================== -// This file was automatically generated. -// ====================================== - -use serde::{Deserialize, Serialize}; - -/// The resource representing a Stripe "plan.updated". -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct PlanUpdated { -} diff --git a/src/resources/generated/platform_tax_fee.rs b/src/resources/generated/platform_tax_fee.rs deleted file mode 100644 index 816bc53cb..000000000 --- a/src/resources/generated/platform_tax_fee.rs +++ /dev/null @@ -1,35 +0,0 @@ -// ====================================== -// This file was automatically generated. -// ====================================== - -use serde::{Deserialize, Serialize}; - -use crate::ids::PlatformTaxFeeId; -use crate::params::Object; - -/// The resource representing a Stripe "PlatformTax". -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct PlatformTaxFee { - /// Unique identifier for the object. - pub id: PlatformTaxFeeId, - - /// The Connected account that incurred this charge. - pub account: String, - - /// The payment object that caused this tax to be inflicted. - pub source_transaction: String, - - /// The type of tax (VAT). - #[serde(rename = "type")] - pub type_: String, -} - -impl Object for PlatformTaxFee { - type Id = PlatformTaxFeeId; - fn id(&self) -> Self::Id { - self.id.clone() - } - fn object(&self) -> &'static str { - "platform_tax_fee" - } -} diff --git a/src/resources/generated/price.rs b/src/resources/generated/price.rs deleted file mode 100644 index eef046fe2..000000000 --- a/src/resources/generated/price.rs +++ /dev/null @@ -1,1460 +0,0 @@ -// ====================================== -// This file was automatically generated. -// ====================================== - -use serde::{Deserialize, Serialize}; - -use crate::client::{Client, Response}; -use crate::ids::PriceId; -use crate::params::{ - CurrencyMap, Expand, Expandable, IdOrCreate, List, Metadata, Object, Paginable, RangeQuery, - Timestamp, -}; -use crate::resources::{CreateProduct, Currency, CustomUnitAmount, Product, UpTo}; - -/// The resource representing a Stripe "Price". -/// -/// For more details see -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct Price { - /// Unique identifier for the object. - pub id: PriceId, - - /// Whether the price can be used for new purchases. - #[serde(skip_serializing_if = "Option::is_none")] - pub active: Option, - - /// Describes how to compute the price per period. - /// - /// Either `per_unit` or `tiered`. - /// `per_unit` indicates that the fixed amount (specified in `unit_amount` or `unit_amount_decimal`) will be charged per unit in `quantity` (for prices with `usage_type=licensed`), or per unit of total usage (for prices with `usage_type=metered`). - /// `tiered` indicates that the unit pricing will be computed using a tiering strategy as defined using the `tiers` and `tiers_mode` attributes. - #[serde(skip_serializing_if = "Option::is_none")] - pub billing_scheme: Option, - - /// Time at which the object was created. - /// - /// Measured in seconds since the Unix epoch. - #[serde(skip_serializing_if = "Option::is_none")] - pub created: Option, - - /// Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. - /// - /// Must be a [supported currency](https://stripe.com/docs/currencies). - #[serde(skip_serializing_if = "Option::is_none")] - pub currency: Option, - - /// Prices defined in each available currency option. - /// - /// Each key must be a three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html) and a [supported currency](https://stripe.com/docs/currencies). - #[serde(skip_serializing_if = "Option::is_none")] - pub currency_options: Option>, - - /// When set, provides configuration for the amount to be adjusted by the customer during Checkout Sessions and Payment Links. - #[serde(skip_serializing_if = "Option::is_none")] - pub custom_unit_amount: Option, - - // Always true for a deleted object - #[serde(default)] - pub deleted: bool, - - /// Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. - #[serde(skip_serializing_if = "Option::is_none")] - pub livemode: Option, - - /// A lookup key used to retrieve prices dynamically from a static string. - /// - /// This may be up to 200 characters. - #[serde(skip_serializing_if = "Option::is_none")] - pub lookup_key: Option, - - /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. - /// - /// This can be useful for storing additional information about the object in a structured format. - #[serde(skip_serializing_if = "Option::is_none")] - pub metadata: Option, - - /// A brief description of the price, hidden from customers. - #[serde(skip_serializing_if = "Option::is_none")] - pub nickname: Option, - - /// The ID of the product this price is associated with. - #[serde(skip_serializing_if = "Option::is_none")] - pub product: Option>, - - /// The recurring components of a price such as `interval` and `usage_type`. - #[serde(skip_serializing_if = "Option::is_none")] - pub recurring: Option, - - /// Only required if a [default tax behavior](https://stripe.com/docs/tax/products-prices-tax-categories-tax-behavior#setting-a-default-tax-behavior-(recommended)) was not provided in the Stripe Tax settings. - /// - /// Specifies whether the price is considered inclusive of taxes or exclusive of taxes. - /// One of `inclusive`, `exclusive`, or `unspecified`. - /// Once specified as either `inclusive` or `exclusive`, it cannot be changed. - #[serde(skip_serializing_if = "Option::is_none")] - pub tax_behavior: Option, - - /// Each element represents a pricing tier. - /// - /// This parameter requires `billing_scheme` to be set to `tiered`. - /// See also the documentation for `billing_scheme`. - #[serde(skip_serializing_if = "Option::is_none")] - pub tiers: Option>, - - /// Defines if the tiering price should be `graduated` or `volume` based. - /// - /// In `volume`-based tiering, the maximum quantity within a period determines the per unit price. - /// In `graduated` tiering, pricing can change as the quantity grows. - #[serde(skip_serializing_if = "Option::is_none")] - pub tiers_mode: Option, - - /// Apply a transformation to the reported usage or set quantity before computing the amount billed. - /// - /// Cannot be combined with `tiers`. - #[serde(skip_serializing_if = "Option::is_none")] - pub transform_quantity: Option, - - /// One of `one_time` or `recurring` depending on whether the price is for a one-time purchase or a recurring (subscription) purchase. - #[serde(rename = "type")] - #[serde(skip_serializing_if = "Option::is_none")] - pub type_: Option, - - /// The unit amount in cents (or local equivalent) to be charged, represented as a whole integer if possible. - /// - /// Only set if `billing_scheme=per_unit`. - #[serde(skip_serializing_if = "Option::is_none")] - pub unit_amount: Option, - - /// The unit amount in cents (or local equivalent) to be charged, represented as a decimal string with at most 12 decimal places. - /// - /// Only set if `billing_scheme=per_unit`. - #[serde(skip_serializing_if = "Option::is_none")] - pub unit_amount_decimal: Option, -} - -impl Price { - /// Returns a list of your active prices, excluding [inline prices](https://stripe.com/docs/products-prices/pricing-models#inline-pricing). - /// - /// For the list of inactive prices, set `active` to false. - pub fn list(client: &Client, params: &ListPrices<'_>) -> Response> { - client.get_query("/prices", ¶ms) - } - - /// Creates a new price for an existing product. - /// - /// The price can be recurring or one-time. - pub fn create(client: &Client, params: CreatePrice<'_>) -> Response { - client.post_form("/prices", ¶ms) - } - - /// Retrieves the price with the given ID. - pub fn retrieve(client: &Client, id: &PriceId, expand: &[&str]) -> Response { - client.get_query(&format!("/prices/{}", id), &Expand { expand }) - } - - /// Updates the specified price by setting the values of the parameters passed. - /// - /// Any parameters not provided are left unchanged. - pub fn update(client: &Client, id: &PriceId, params: UpdatePrice<'_>) -> Response { - client.post_form(&format!("/prices/{}", id), ¶ms) - } -} - -impl Object for Price { - type Id = PriceId; - fn id(&self) -> Self::Id { - self.id.clone() - } - fn object(&self) -> &'static str { - "price" - } -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CurrencyOption { - /// When set, provides configuration for the amount to be adjusted by the customer during Checkout Sessions and Payment Links. - pub custom_unit_amount: Option, - - /// Only required if a [default tax behavior](https://stripe.com/docs/tax/products-prices-tax-categories-tax-behavior#setting-a-default-tax-behavior-(recommended)) was not provided in the Stripe Tax settings. - /// - /// Specifies whether the price is considered inclusive of taxes or exclusive of taxes. - /// One of `inclusive`, `exclusive`, or `unspecified`. - /// Once specified as either `inclusive` or `exclusive`, it cannot be changed. - pub tax_behavior: Option, - - /// Each element represents a pricing tier. - /// - /// This parameter requires `billing_scheme` to be set to `tiered`. - /// See also the documentation for `billing_scheme`. - #[serde(skip_serializing_if = "Option::is_none")] - pub tiers: Option>, - - /// The unit amount in cents (or local equivalent) to be charged, represented as a whole integer if possible. - /// - /// Only set if `billing_scheme=per_unit`. - pub unit_amount: Option, - - /// The unit amount in cents (or local equivalent) to be charged, represented as a decimal string with at most 12 decimal places. - /// - /// Only set if `billing_scheme=per_unit`. - pub unit_amount_decimal: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct PriceTier { - /// Price for the entire tier. - pub flat_amount: Option, - - /// Same as `flat_amount`, but contains a decimal value with at most 12 decimal places. - pub flat_amount_decimal: Option, - - /// Per unit price for units relevant to the tier. - pub unit_amount: Option, - - /// Same as `unit_amount`, but contains a decimal value with at most 12 decimal places. - pub unit_amount_decimal: Option, - - /// Up to and including to this quantity will be contained in the tier. - pub up_to: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct Recurring { - /// Specifies a usage aggregation strategy for prices of `usage_type=metered`. - /// - /// Defaults to `sum`. - pub aggregate_usage: Option, - - /// The frequency at which a subscription is billed. - /// - /// One of `day`, `week`, `month` or `year`. - pub interval: RecurringInterval, - - /// The number of intervals (specified in the `interval` attribute) between subscription billings. - /// - /// For example, `interval=month` and `interval_count=3` bills every 3 months. - pub interval_count: u64, - - /// Default number of trial days when subscribing a customer to this price using [`trial_from_plan=true`](https://stripe.com/docs/api#create_subscription-trial_from_plan). - pub trial_period_days: Option, - - /// Configures how the quantity per period should be determined. - /// - /// Can be either `metered` or `licensed`. - /// `licensed` automatically bills the `quantity` set when adding it to a subscription. - /// `metered` aggregates the total usage based on usage records. - /// Defaults to `licensed`. - pub usage_type: RecurringUsageType, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct TransformQuantity { - /// Divide usage by this number. - pub divide_by: i64, - - /// After division, either round the result `up` or `down`. - pub round: TransformQuantityRound, -} - -/// The parameters for `Price::create`. -#[derive(Clone, Debug, Serialize)] -pub struct CreatePrice<'a> { - /// Whether the price can be used for new purchases. - /// - /// Defaults to `true`. - #[serde(skip_serializing_if = "Option::is_none")] - pub active: Option, - - /// Describes how to compute the price per period. - /// - /// Either `per_unit` or `tiered`. - /// `per_unit` indicates that the fixed amount (specified in `unit_amount` or `unit_amount_decimal`) will be charged per unit in `quantity` (for prices with `usage_type=licensed`), or per unit of total usage (for prices with `usage_type=metered`). - /// `tiered` indicates that the unit pricing will be computed using a tiering strategy as defined using the `tiers` and `tiers_mode` attributes. - #[serde(skip_serializing_if = "Option::is_none")] - pub billing_scheme: Option, - - /// Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. - /// - /// Must be a [supported currency](https://stripe.com/docs/currencies). - pub currency: Currency, - - /// Prices defined in each available currency option. - /// - /// Each key must be a three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html) and a [supported currency](https://stripe.com/docs/currencies). - #[serde(skip_serializing_if = "Option::is_none")] - pub currency_options: Option>, - - /// When set, provides configuration for the amount to be adjusted by the customer during Checkout Sessions and Payment Links. - #[serde(skip_serializing_if = "Option::is_none")] - pub custom_unit_amount: Option, - - /// Specifies which fields in the response should be expanded. - #[serde(skip_serializing_if = "Expand::is_empty")] - pub expand: &'a [&'a str], - - /// A lookup key used to retrieve prices dynamically from a static string. - /// - /// This may be up to 200 characters. - #[serde(skip_serializing_if = "Option::is_none")] - pub lookup_key: Option<&'a str>, - - /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. - /// - /// This can be useful for storing additional information about the object in a structured format. - /// Individual keys can be unset by posting an empty value to them. - /// All keys can be unset by posting an empty value to `metadata`. - #[serde(skip_serializing_if = "Option::is_none")] - pub metadata: Option, - - /// A brief description of the price, hidden from customers. - #[serde(skip_serializing_if = "Option::is_none")] - pub nickname: Option<&'a str>, - - /// The ID of the product that this price will belong to. - #[serde(skip_serializing_if = "Option::is_none")] - pub product: Option>>, - - /// These fields can be used to create a new product that this price will belong to. - #[serde(skip_serializing_if = "Option::is_none")] - pub product_data: Option, - - /// The recurring components of a price such as `interval` and `usage_type`. - #[serde(skip_serializing_if = "Option::is_none")] - pub recurring: Option, - - /// Only required if a [default tax behavior](https://stripe.com/docs/tax/products-prices-tax-categories-tax-behavior#setting-a-default-tax-behavior-(recommended)) was not provided in the Stripe Tax settings. - /// - /// Specifies whether the price is considered inclusive of taxes or exclusive of taxes. - /// One of `inclusive`, `exclusive`, or `unspecified`. - /// Once specified as either `inclusive` or `exclusive`, it cannot be changed. - #[serde(skip_serializing_if = "Option::is_none")] - pub tax_behavior: Option, - - /// Each element represents a pricing tier. - /// - /// This parameter requires `billing_scheme` to be set to `tiered`. - /// See also the documentation for `billing_scheme`. - #[serde(skip_serializing_if = "Option::is_none")] - pub tiers: Option>, - - /// Defines if the tiering price should be `graduated` or `volume` based. - /// - /// In `volume`-based tiering, the maximum quantity within a period determines the per unit price, in `graduated` tiering pricing can successively change as the quantity grows. - #[serde(skip_serializing_if = "Option::is_none")] - pub tiers_mode: Option, - - /// If set to true, will atomically remove the lookup key from the existing price, and assign it to this price. - #[serde(skip_serializing_if = "Option::is_none")] - pub transfer_lookup_key: Option, - - /// Apply a transformation to the reported usage or set quantity before computing the billed price. - /// - /// Cannot be combined with `tiers`. - #[serde(skip_serializing_if = "Option::is_none")] - pub transform_quantity: Option, - - /// A positive integer in cents (or local equivalent) (or 0 for a free price) representing how much to charge. - /// - /// One of `unit_amount` or `custom_unit_amount` is required, unless `billing_scheme=tiered`. - #[serde(skip_serializing_if = "Option::is_none")] - pub unit_amount: Option, - - /// Same as `unit_amount`, but accepts a decimal value in cents (or local equivalent) with at most 12 decimal places. - /// - /// Only one of `unit_amount` and `unit_amount_decimal` can be set. - #[serde(skip_serializing_if = "Option::is_none")] - pub unit_amount_decimal: Option<&'a str>, -} - -impl<'a> CreatePrice<'a> { - pub fn new(currency: Currency) -> Self { - CreatePrice { - active: Default::default(), - billing_scheme: Default::default(), - currency, - currency_options: Default::default(), - custom_unit_amount: Default::default(), - expand: Default::default(), - lookup_key: Default::default(), - metadata: Default::default(), - nickname: Default::default(), - product: Default::default(), - product_data: Default::default(), - recurring: Default::default(), - tax_behavior: Default::default(), - tiers: Default::default(), - tiers_mode: Default::default(), - transfer_lookup_key: Default::default(), - transform_quantity: Default::default(), - unit_amount: Default::default(), - unit_amount_decimal: Default::default(), - } - } -} - -/// The parameters for `Price::list`. -#[derive(Clone, Debug, Serialize, Default)] -pub struct ListPrices<'a> { - /// Only return prices that are active or inactive (e.g., pass `false` to list all inactive prices). - #[serde(skip_serializing_if = "Option::is_none")] - pub active: Option, - - /// A filter on the list, based on the object `created` field. - /// - /// The value can be a string with an integer Unix timestamp, or it can be a dictionary with a number of different query options. - #[serde(skip_serializing_if = "Option::is_none")] - pub created: Option>, - - /// Only return prices for the given currency. - #[serde(skip_serializing_if = "Option::is_none")] - pub currency: Option, - - /// A cursor for use in pagination. - /// - /// `ending_before` is an object ID that defines your place in the list. - /// For instance, if you make a list request and receive 100 objects, starting with `obj_bar`, your subsequent call can include `ending_before=obj_bar` in order to fetch the previous page of the list. - #[serde(skip_serializing_if = "Option::is_none")] - pub ending_before: Option, - - /// Specifies which fields in the response should be expanded. - #[serde(skip_serializing_if = "Expand::is_empty")] - pub expand: &'a [&'a str], - - /// A limit on the number of objects to be returned. - /// - /// Limit can range between 1 and 100, and the default is 10. - #[serde(skip_serializing_if = "Option::is_none")] - pub limit: Option, - - /// Only return the price with these lookup_keys, if any exist. - #[serde(skip_serializing_if = "Option::is_none")] - pub lookup_keys: Option>, - - /// Only return prices for the given product. - #[serde(skip_serializing_if = "Option::is_none")] - pub product: Option>>, - - /// Only return prices with these recurring fields. - #[serde(skip_serializing_if = "Option::is_none")] - pub recurring: Option, - - /// A cursor for use in pagination. - /// - /// `starting_after` is an object ID that defines your place in the list. - /// For instance, if you make a list request and receive 100 objects, ending with `obj_foo`, your subsequent call can include `starting_after=obj_foo` in order to fetch the next page of the list. - #[serde(skip_serializing_if = "Option::is_none")] - pub starting_after: Option, - - /// Only return prices of type `recurring` or `one_time`. - #[serde(rename = "type")] - #[serde(skip_serializing_if = "Option::is_none")] - pub type_: Option, -} - -impl<'a> ListPrices<'a> { - pub fn new() -> Self { - ListPrices { - active: Default::default(), - created: Default::default(), - currency: Default::default(), - ending_before: Default::default(), - expand: Default::default(), - limit: Default::default(), - lookup_keys: Default::default(), - product: Default::default(), - recurring: Default::default(), - starting_after: Default::default(), - type_: Default::default(), - } - } -} -impl Paginable for ListPrices<'_> { - type O = Price; - fn set_last(&mut self, item: Self::O) { - self.starting_after = Some(item.id()); - } -} -/// The parameters for `Price::update`. -#[derive(Clone, Debug, Serialize, Default)] -pub struct UpdatePrice<'a> { - /// Whether the price can be used for new purchases. - /// - /// Defaults to `true`. - #[serde(skip_serializing_if = "Option::is_none")] - pub active: Option, - - /// Prices defined in each available currency option. - /// - /// Each key must be a three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html) and a [supported currency](https://stripe.com/docs/currencies). - #[serde(skip_serializing_if = "Option::is_none")] - pub currency_options: Option>, - - /// Specifies which fields in the response should be expanded. - #[serde(skip_serializing_if = "Expand::is_empty")] - pub expand: &'a [&'a str], - - /// A lookup key used to retrieve prices dynamically from a static string. - /// - /// This may be up to 200 characters. - #[serde(skip_serializing_if = "Option::is_none")] - pub lookup_key: Option<&'a str>, - - /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. - /// - /// This can be useful for storing additional information about the object in a structured format. - /// Individual keys can be unset by posting an empty value to them. - /// All keys can be unset by posting an empty value to `metadata`. - #[serde(skip_serializing_if = "Option::is_none")] - pub metadata: Option, - - /// A brief description of the price, hidden from customers. - #[serde(skip_serializing_if = "Option::is_none")] - pub nickname: Option<&'a str>, - - /// Only required if a [default tax behavior](https://stripe.com/docs/tax/products-prices-tax-categories-tax-behavior#setting-a-default-tax-behavior-(recommended)) was not provided in the Stripe Tax settings. - /// - /// Specifies whether the price is considered inclusive of taxes or exclusive of taxes. - /// One of `inclusive`, `exclusive`, or `unspecified`. - /// Once specified as either `inclusive` or `exclusive`, it cannot be changed. - #[serde(skip_serializing_if = "Option::is_none")] - pub tax_behavior: Option, - - /// If set to true, will atomically remove the lookup key from the existing price, and assign it to this price. - #[serde(skip_serializing_if = "Option::is_none")] - pub transfer_lookup_key: Option, -} - -impl<'a> UpdatePrice<'a> { - pub fn new() -> Self { - UpdatePrice { - active: Default::default(), - currency_options: Default::default(), - expand: Default::default(), - lookup_key: Default::default(), - metadata: Default::default(), - nickname: Default::default(), - tax_behavior: Default::default(), - transfer_lookup_key: Default::default(), - } - } -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreatePriceCurrencyOptions { - /// When set, provides configuration for the amount to be adjusted by the customer during Checkout Sessions and Payment Links. - #[serde(skip_serializing_if = "Option::is_none")] - pub custom_unit_amount: Option, - - /// Only required if a [default tax behavior](https://stripe.com/docs/tax/products-prices-tax-categories-tax-behavior#setting-a-default-tax-behavior-(recommended)) was not provided in the Stripe Tax settings. - /// - /// Specifies whether the price is considered inclusive of taxes or exclusive of taxes. - /// One of `inclusive`, `exclusive`, or `unspecified`. - /// Once specified as either `inclusive` or `exclusive`, it cannot be changed. - #[serde(skip_serializing_if = "Option::is_none")] - pub tax_behavior: Option, - - /// Each element represents a pricing tier. - /// - /// This parameter requires `billing_scheme` to be set to `tiered`. - /// See also the documentation for `billing_scheme`. - #[serde(skip_serializing_if = "Option::is_none")] - pub tiers: Option>, - - /// A positive integer in cents (or local equivalent) (or 0 for a free price) representing how much to charge. - #[serde(skip_serializing_if = "Option::is_none")] - pub unit_amount: Option, - - /// Same as `unit_amount`, but accepts a decimal value in cents (or local equivalent) with at most 12 decimal places. - /// - /// Only one of `unit_amount` and `unit_amount_decimal` can be set. - #[serde(skip_serializing_if = "Option::is_none")] - pub unit_amount_decimal: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreatePriceCustomUnitAmount { - /// Pass in `true` to enable `custom_unit_amount`, otherwise omit `custom_unit_amount`. - pub enabled: bool, - - /// The maximum unit amount the customer can specify for this item. - #[serde(skip_serializing_if = "Option::is_none")] - pub maximum: Option, - - /// The minimum unit amount the customer can specify for this item. - /// - /// Must be at least the minimum charge amount. - #[serde(skip_serializing_if = "Option::is_none")] - pub minimum: Option, - - /// The starting unit amount which can be updated by the customer. - #[serde(skip_serializing_if = "Option::is_none")] - pub preset: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreatePriceProductData { - /// Whether the product is currently available for purchase. - /// - /// Defaults to `true`. - #[serde(skip_serializing_if = "Option::is_none")] - pub active: Option, - - /// The identifier for the product. - /// - /// Must be unique. - /// If not provided, an identifier will be randomly generated. - #[serde(skip_serializing_if = "Option::is_none")] - pub id: Option, - - /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. - /// - /// This can be useful for storing additional information about the object in a structured format. - /// Individual keys can be unset by posting an empty value to them. - /// All keys can be unset by posting an empty value to `metadata`. - #[serde(skip_serializing_if = "Option::is_none")] - pub metadata: Option, - - /// The product's name, meant to be displayable to the customer. - pub name: String, - - /// An arbitrary string to be displayed on your customer's credit card or bank statement. - /// - /// While most banks display this information consistently, some may display it incorrectly or not at all. This may be up to 22 characters. - /// The statement description may not include `<`, `>`, `\`, `"`, `'` characters, and will appear on your customer's statement in capital letters. - /// Non-ASCII characters are automatically stripped. - #[serde(skip_serializing_if = "Option::is_none")] - pub statement_descriptor: Option, - - /// A [tax code](https://stripe.com/docs/tax/tax-categories) ID. - #[serde(skip_serializing_if = "Option::is_none")] - pub tax_code: Option, - - /// A label that represents units of this product. - /// - /// When set, this will be included in customers' receipts, invoices, Checkout, and the customer portal. - #[serde(skip_serializing_if = "Option::is_none")] - pub unit_label: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreatePriceRecurring { - /// Specifies a usage aggregation strategy for prices of `usage_type=metered`. - /// - /// Defaults to `sum`. - #[serde(skip_serializing_if = "Option::is_none")] - pub aggregate_usage: Option, - - /// Specifies billing frequency. - /// - /// Either `day`, `week`, `month` or `year`. - pub interval: CreatePriceRecurringInterval, - - /// The number of intervals between subscription billings. - /// - /// For example, `interval=month` and `interval_count=3` bills every 3 months. - /// Maximum of three years interval allowed (3 years, 36 months, or 156 weeks). - #[serde(skip_serializing_if = "Option::is_none")] - pub interval_count: Option, - - /// Default number of trial days when subscribing a customer to this price using [`trial_from_plan=true`](https://stripe.com/docs/api#create_subscription-trial_from_plan). - #[serde(skip_serializing_if = "Option::is_none")] - pub trial_period_days: Option, - - /// Configures how the quantity per period should be determined. - /// - /// Can be either `metered` or `licensed`. - /// `licensed` automatically bills the `quantity` set when adding it to a subscription. - /// `metered` aggregates the total usage based on usage records. - /// Defaults to `licensed`. - #[serde(skip_serializing_if = "Option::is_none")] - pub usage_type: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreatePriceTiers { - /// The flat billing amount for an entire tier, regardless of the number of units in the tier. - #[serde(skip_serializing_if = "Option::is_none")] - pub flat_amount: Option, - - /// Same as `flat_amount`, but accepts a decimal value representing an integer in the minor units of the currency. - /// - /// Only one of `flat_amount` and `flat_amount_decimal` can be set. - #[serde(skip_serializing_if = "Option::is_none")] - pub flat_amount_decimal: Option, - - /// The per unit billing amount for each individual unit for which this tier applies. - #[serde(skip_serializing_if = "Option::is_none")] - pub unit_amount: Option, - - /// Same as `unit_amount`, but accepts a decimal value in cents (or local equivalent) with at most 12 decimal places. - /// - /// Only one of `unit_amount` and `unit_amount_decimal` can be set. - #[serde(skip_serializing_if = "Option::is_none")] - pub unit_amount_decimal: Option, - - /// Specifies the upper bound of this tier. - /// - /// The lower bound of a tier is the upper bound of the previous tier adding one. - /// Use `inf` to define a fallback tier. - pub up_to: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreatePriceTransformQuantity { - /// Divide usage by this number. - pub divide_by: i64, - - /// After division, either round the result `up` or `down`. - pub round: CreatePriceTransformQuantityRound, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct ListPricesRecurring { - /// Filter by billing frequency. - /// - /// Either `day`, `week`, `month` or `year`. - #[serde(skip_serializing_if = "Option::is_none")] - pub interval: Option, - - /// Filter by the usage type for this price. - /// - /// Can be either `metered` or `licensed`. - #[serde(skip_serializing_if = "Option::is_none")] - pub usage_type: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UpdatePriceCurrencyOptions { - /// When set, provides configuration for the amount to be adjusted by the customer during Checkout Sessions and Payment Links. - #[serde(skip_serializing_if = "Option::is_none")] - pub custom_unit_amount: Option, - - /// Only required if a [default tax behavior](https://stripe.com/docs/tax/products-prices-tax-categories-tax-behavior#setting-a-default-tax-behavior-(recommended)) was not provided in the Stripe Tax settings. - /// - /// Specifies whether the price is considered inclusive of taxes or exclusive of taxes. - /// One of `inclusive`, `exclusive`, or `unspecified`. - /// Once specified as either `inclusive` or `exclusive`, it cannot be changed. - #[serde(skip_serializing_if = "Option::is_none")] - pub tax_behavior: Option, - - /// Each element represents a pricing tier. - /// - /// This parameter requires `billing_scheme` to be set to `tiered`. - /// See also the documentation for `billing_scheme`. - #[serde(skip_serializing_if = "Option::is_none")] - pub tiers: Option>, - - /// A positive integer in cents (or local equivalent) (or 0 for a free price) representing how much to charge. - #[serde(skip_serializing_if = "Option::is_none")] - pub unit_amount: Option, - - /// Same as `unit_amount`, but accepts a decimal value in cents (or local equivalent) with at most 12 decimal places. - /// - /// Only one of `unit_amount` and `unit_amount_decimal` can be set. - #[serde(skip_serializing_if = "Option::is_none")] - pub unit_amount_decimal: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreatePriceCurrencyOptionsCustomUnitAmount { - /// Pass in `true` to enable `custom_unit_amount`, otherwise omit `custom_unit_amount`. - pub enabled: bool, - - /// The maximum unit amount the customer can specify for this item. - #[serde(skip_serializing_if = "Option::is_none")] - pub maximum: Option, - - /// The minimum unit amount the customer can specify for this item. - /// - /// Must be at least the minimum charge amount. - #[serde(skip_serializing_if = "Option::is_none")] - pub minimum: Option, - - /// The starting unit amount which can be updated by the customer. - #[serde(skip_serializing_if = "Option::is_none")] - pub preset: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreatePriceCurrencyOptionsTiers { - /// The flat billing amount for an entire tier, regardless of the number of units in the tier. - #[serde(skip_serializing_if = "Option::is_none")] - pub flat_amount: Option, - - /// Same as `flat_amount`, but accepts a decimal value representing an integer in the minor units of the currency. - /// - /// Only one of `flat_amount` and `flat_amount_decimal` can be set. - #[serde(skip_serializing_if = "Option::is_none")] - pub flat_amount_decimal: Option, - - /// The per unit billing amount for each individual unit for which this tier applies. - #[serde(skip_serializing_if = "Option::is_none")] - pub unit_amount: Option, - - /// Same as `unit_amount`, but accepts a decimal value in cents (or local equivalent) with at most 12 decimal places. - /// - /// Only one of `unit_amount` and `unit_amount_decimal` can be set. - #[serde(skip_serializing_if = "Option::is_none")] - pub unit_amount_decimal: Option, - - /// Specifies the upper bound of this tier. - /// - /// The lower bound of a tier is the upper bound of the previous tier adding one. - /// Use `inf` to define a fallback tier. - pub up_to: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UpdatePriceCurrencyOptionsCustomUnitAmount { - /// Pass in `true` to enable `custom_unit_amount`, otherwise omit `custom_unit_amount`. - pub enabled: bool, - - /// The maximum unit amount the customer can specify for this item. - #[serde(skip_serializing_if = "Option::is_none")] - pub maximum: Option, - - /// The minimum unit amount the customer can specify for this item. - /// - /// Must be at least the minimum charge amount. - #[serde(skip_serializing_if = "Option::is_none")] - pub minimum: Option, - - /// The starting unit amount which can be updated by the customer. - #[serde(skip_serializing_if = "Option::is_none")] - pub preset: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UpdatePriceCurrencyOptionsTiers { - /// The flat billing amount for an entire tier, regardless of the number of units in the tier. - #[serde(skip_serializing_if = "Option::is_none")] - pub flat_amount: Option, - - /// Same as `flat_amount`, but accepts a decimal value representing an integer in the minor units of the currency. - /// - /// Only one of `flat_amount` and `flat_amount_decimal` can be set. - #[serde(skip_serializing_if = "Option::is_none")] - pub flat_amount_decimal: Option, - - /// The per unit billing amount for each individual unit for which this tier applies. - #[serde(skip_serializing_if = "Option::is_none")] - pub unit_amount: Option, - - /// Same as `unit_amount`, but accepts a decimal value in cents (or local equivalent) with at most 12 decimal places. - /// - /// Only one of `unit_amount` and `unit_amount_decimal` can be set. - #[serde(skip_serializing_if = "Option::is_none")] - pub unit_amount_decimal: Option, - - /// Specifies the upper bound of this tier. - /// - /// The lower bound of a tier is the upper bound of the previous tier adding one. - /// Use `inf` to define a fallback tier. - pub up_to: Option, -} - -/// An enum representing the possible values of an `CreatePriceCurrencyOptions`'s `tax_behavior` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CreatePriceCurrencyOptionsTaxBehavior { - Exclusive, - Inclusive, - Unspecified, -} - -impl CreatePriceCurrencyOptionsTaxBehavior { - pub fn as_str(self) -> &'static str { - match self { - CreatePriceCurrencyOptionsTaxBehavior::Exclusive => "exclusive", - CreatePriceCurrencyOptionsTaxBehavior::Inclusive => "inclusive", - CreatePriceCurrencyOptionsTaxBehavior::Unspecified => "unspecified", - } - } -} - -impl AsRef for CreatePriceCurrencyOptionsTaxBehavior { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for CreatePriceCurrencyOptionsTaxBehavior { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for CreatePriceCurrencyOptionsTaxBehavior { - fn default() -> Self { - Self::Exclusive - } -} - -/// An enum representing the possible values of an `CreatePriceRecurring`'s `aggregate_usage` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CreatePriceRecurringAggregateUsage { - LastDuringPeriod, - LastEver, - Max, - Sum, -} - -impl CreatePriceRecurringAggregateUsage { - pub fn as_str(self) -> &'static str { - match self { - CreatePriceRecurringAggregateUsage::LastDuringPeriod => "last_during_period", - CreatePriceRecurringAggregateUsage::LastEver => "last_ever", - CreatePriceRecurringAggregateUsage::Max => "max", - CreatePriceRecurringAggregateUsage::Sum => "sum", - } - } -} - -impl AsRef for CreatePriceRecurringAggregateUsage { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for CreatePriceRecurringAggregateUsage { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for CreatePriceRecurringAggregateUsage { - fn default() -> Self { - Self::LastDuringPeriod - } -} - -/// An enum representing the possible values of an `CreatePriceRecurring`'s `interval` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CreatePriceRecurringInterval { - Day, - Month, - Week, - Year, -} - -impl CreatePriceRecurringInterval { - pub fn as_str(self) -> &'static str { - match self { - CreatePriceRecurringInterval::Day => "day", - CreatePriceRecurringInterval::Month => "month", - CreatePriceRecurringInterval::Week => "week", - CreatePriceRecurringInterval::Year => "year", - } - } -} - -impl AsRef for CreatePriceRecurringInterval { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for CreatePriceRecurringInterval { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for CreatePriceRecurringInterval { - fn default() -> Self { - Self::Day - } -} - -/// An enum representing the possible values of an `CreatePriceRecurring`'s `usage_type` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CreatePriceRecurringUsageType { - Licensed, - Metered, -} - -impl CreatePriceRecurringUsageType { - pub fn as_str(self) -> &'static str { - match self { - CreatePriceRecurringUsageType::Licensed => "licensed", - CreatePriceRecurringUsageType::Metered => "metered", - } - } -} - -impl AsRef for CreatePriceRecurringUsageType { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for CreatePriceRecurringUsageType { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for CreatePriceRecurringUsageType { - fn default() -> Self { - Self::Licensed - } -} - -/// An enum representing the possible values of an `CreatePriceTransformQuantity`'s `round` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CreatePriceTransformQuantityRound { - Down, - Up, -} - -impl CreatePriceTransformQuantityRound { - pub fn as_str(self) -> &'static str { - match self { - CreatePriceTransformQuantityRound::Down => "down", - CreatePriceTransformQuantityRound::Up => "up", - } - } -} - -impl AsRef for CreatePriceTransformQuantityRound { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for CreatePriceTransformQuantityRound { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for CreatePriceTransformQuantityRound { - fn default() -> Self { - Self::Down - } -} - -/// An enum representing the possible values of an `CurrencyOption`'s `tax_behavior` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CurrencyOptionTaxBehavior { - Exclusive, - Inclusive, - Unspecified, -} - -impl CurrencyOptionTaxBehavior { - pub fn as_str(self) -> &'static str { - match self { - CurrencyOptionTaxBehavior::Exclusive => "exclusive", - CurrencyOptionTaxBehavior::Inclusive => "inclusive", - CurrencyOptionTaxBehavior::Unspecified => "unspecified", - } - } -} - -impl AsRef for CurrencyOptionTaxBehavior { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for CurrencyOptionTaxBehavior { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for CurrencyOptionTaxBehavior { - fn default() -> Self { - Self::Exclusive - } -} - -/// An enum representing the possible values of an `ListPricesRecurring`'s `interval` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum ListPricesRecurringInterval { - Day, - Month, - Week, - Year, -} - -impl ListPricesRecurringInterval { - pub fn as_str(self) -> &'static str { - match self { - ListPricesRecurringInterval::Day => "day", - ListPricesRecurringInterval::Month => "month", - ListPricesRecurringInterval::Week => "week", - ListPricesRecurringInterval::Year => "year", - } - } -} - -impl AsRef for ListPricesRecurringInterval { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for ListPricesRecurringInterval { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for ListPricesRecurringInterval { - fn default() -> Self { - Self::Day - } -} - -/// An enum representing the possible values of an `ListPricesRecurring`'s `usage_type` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum ListPricesRecurringUsageType { - Licensed, - Metered, -} - -impl ListPricesRecurringUsageType { - pub fn as_str(self) -> &'static str { - match self { - ListPricesRecurringUsageType::Licensed => "licensed", - ListPricesRecurringUsageType::Metered => "metered", - } - } -} - -impl AsRef for ListPricesRecurringUsageType { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for ListPricesRecurringUsageType { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for ListPricesRecurringUsageType { - fn default() -> Self { - Self::Licensed - } -} - -/// An enum representing the possible values of an `Price`'s `billing_scheme` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum PriceBillingScheme { - PerUnit, - Tiered, -} - -impl PriceBillingScheme { - pub fn as_str(self) -> &'static str { - match self { - PriceBillingScheme::PerUnit => "per_unit", - PriceBillingScheme::Tiered => "tiered", - } - } -} - -impl AsRef for PriceBillingScheme { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for PriceBillingScheme { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for PriceBillingScheme { - fn default() -> Self { - Self::PerUnit - } -} - -/// An enum representing the possible values of an `Price`'s `tax_behavior` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum PriceTaxBehavior { - Exclusive, - Inclusive, - Unspecified, -} - -impl PriceTaxBehavior { - pub fn as_str(self) -> &'static str { - match self { - PriceTaxBehavior::Exclusive => "exclusive", - PriceTaxBehavior::Inclusive => "inclusive", - PriceTaxBehavior::Unspecified => "unspecified", - } - } -} - -impl AsRef for PriceTaxBehavior { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for PriceTaxBehavior { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for PriceTaxBehavior { - fn default() -> Self { - Self::Exclusive - } -} - -/// An enum representing the possible values of an `Price`'s `tiers_mode` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum PriceTiersMode { - Graduated, - Volume, -} - -impl PriceTiersMode { - pub fn as_str(self) -> &'static str { - match self { - PriceTiersMode::Graduated => "graduated", - PriceTiersMode::Volume => "volume", - } - } -} - -impl AsRef for PriceTiersMode { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for PriceTiersMode { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for PriceTiersMode { - fn default() -> Self { - Self::Graduated - } -} - -/// An enum representing the possible values of an `Price`'s `type` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum PriceType { - OneTime, - Recurring, -} - -impl PriceType { - pub fn as_str(self) -> &'static str { - match self { - PriceType::OneTime => "one_time", - PriceType::Recurring => "recurring", - } - } -} - -impl AsRef for PriceType { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for PriceType { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for PriceType { - fn default() -> Self { - Self::OneTime - } -} - -/// An enum representing the possible values of an `Recurring`'s `aggregate_usage` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum RecurringAggregateUsage { - LastDuringPeriod, - LastEver, - Max, - Sum, -} - -impl RecurringAggregateUsage { - pub fn as_str(self) -> &'static str { - match self { - RecurringAggregateUsage::LastDuringPeriod => "last_during_period", - RecurringAggregateUsage::LastEver => "last_ever", - RecurringAggregateUsage::Max => "max", - RecurringAggregateUsage::Sum => "sum", - } - } -} - -impl AsRef for RecurringAggregateUsage { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for RecurringAggregateUsage { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for RecurringAggregateUsage { - fn default() -> Self { - Self::LastDuringPeriod - } -} - -/// An enum representing the possible values of an `Recurring`'s `interval` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum RecurringInterval { - Day, - Month, - Week, - Year, -} - -impl RecurringInterval { - pub fn as_str(self) -> &'static str { - match self { - RecurringInterval::Day => "day", - RecurringInterval::Month => "month", - RecurringInterval::Week => "week", - RecurringInterval::Year => "year", - } - } -} - -impl AsRef for RecurringInterval { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for RecurringInterval { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for RecurringInterval { - fn default() -> Self { - Self::Day - } -} - -/// An enum representing the possible values of an `Recurring`'s `usage_type` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum RecurringUsageType { - Licensed, - Metered, -} - -impl RecurringUsageType { - pub fn as_str(self) -> &'static str { - match self { - RecurringUsageType::Licensed => "licensed", - RecurringUsageType::Metered => "metered", - } - } -} - -impl AsRef for RecurringUsageType { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for RecurringUsageType { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for RecurringUsageType { - fn default() -> Self { - Self::Licensed - } -} - -/// An enum representing the possible values of an `TransformQuantity`'s `round` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum TransformQuantityRound { - Down, - Up, -} - -impl TransformQuantityRound { - pub fn as_str(self) -> &'static str { - match self { - TransformQuantityRound::Down => "down", - TransformQuantityRound::Up => "up", - } - } -} - -impl AsRef for TransformQuantityRound { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for TransformQuantityRound { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for TransformQuantityRound { - fn default() -> Self { - Self::Down - } -} - -/// An enum representing the possible values of an `UpdatePriceCurrencyOptions`'s `tax_behavior` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum UpdatePriceCurrencyOptionsTaxBehavior { - Exclusive, - Inclusive, - Unspecified, -} - -impl UpdatePriceCurrencyOptionsTaxBehavior { - pub fn as_str(self) -> &'static str { - match self { - UpdatePriceCurrencyOptionsTaxBehavior::Exclusive => "exclusive", - UpdatePriceCurrencyOptionsTaxBehavior::Inclusive => "inclusive", - UpdatePriceCurrencyOptionsTaxBehavior::Unspecified => "unspecified", - } - } -} - -impl AsRef for UpdatePriceCurrencyOptionsTaxBehavior { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for UpdatePriceCurrencyOptionsTaxBehavior { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for UpdatePriceCurrencyOptionsTaxBehavior { - fn default() -> Self { - Self::Exclusive - } -} diff --git a/src/resources/generated/price_created.rs b/src/resources/generated/price_created.rs deleted file mode 100644 index 9ddccd2d2..000000000 --- a/src/resources/generated/price_created.rs +++ /dev/null @@ -1,10 +0,0 @@ -// ====================================== -// This file was automatically generated. -// ====================================== - -use serde::{Deserialize, Serialize}; - -/// The resource representing a Stripe "price.created". -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct PriceCreated { -} diff --git a/src/resources/generated/price_deleted.rs b/src/resources/generated/price_deleted.rs deleted file mode 100644 index 4eb76c1bf..000000000 --- a/src/resources/generated/price_deleted.rs +++ /dev/null @@ -1,10 +0,0 @@ -// ====================================== -// This file was automatically generated. -// ====================================== - -use serde::{Deserialize, Serialize}; - -/// The resource representing a Stripe "price.deleted". -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct PriceDeleted { -} diff --git a/src/resources/generated/price_updated.rs b/src/resources/generated/price_updated.rs deleted file mode 100644 index 71eb34643..000000000 --- a/src/resources/generated/price_updated.rs +++ /dev/null @@ -1,10 +0,0 @@ -// ====================================== -// This file was automatically generated. -// ====================================== - -use serde::{Deserialize, Serialize}; - -/// The resource representing a Stripe "price.updated". -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct PriceUpdated { -} diff --git a/src/resources/generated/product_created.rs b/src/resources/generated/product_created.rs deleted file mode 100644 index 35f03bb5f..000000000 --- a/src/resources/generated/product_created.rs +++ /dev/null @@ -1,10 +0,0 @@ -// ====================================== -// This file was automatically generated. -// ====================================== - -use serde::{Deserialize, Serialize}; - -/// The resource representing a Stripe "product.created". -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct ProductCreated { -} diff --git a/src/resources/generated/product_deleted.rs b/src/resources/generated/product_deleted.rs deleted file mode 100644 index d05ad9294..000000000 --- a/src/resources/generated/product_deleted.rs +++ /dev/null @@ -1,10 +0,0 @@ -// ====================================== -// This file was automatically generated. -// ====================================== - -use serde::{Deserialize, Serialize}; - -/// The resource representing a Stripe "product.deleted". -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct ProductDeleted { -} diff --git a/src/resources/generated/product_updated.rs b/src/resources/generated/product_updated.rs deleted file mode 100644 index af895c381..000000000 --- a/src/resources/generated/product_updated.rs +++ /dev/null @@ -1,10 +0,0 @@ -// ====================================== -// This file was automatically generated. -// ====================================== - -use serde::{Deserialize, Serialize}; - -/// The resource representing a Stripe "product.updated". -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct ProductUpdated { -} diff --git a/src/resources/generated/promotion_code.rs b/src/resources/generated/promotion_code.rs deleted file mode 100644 index c6b3b5b5f..000000000 --- a/src/resources/generated/promotion_code.rs +++ /dev/null @@ -1,247 +0,0 @@ -// ====================================== -// This file was automatically generated. -// ====================================== - -use serde::{Deserialize, Serialize}; - -use crate::client::{Client, Response}; -use crate::ids::{CouponId, CustomerId, PromotionCodeId}; -use crate::params::{ - CurrencyMap, Expand, Expandable, List, Metadata, Object, Paginable, RangeQuery, Timestamp, -}; -use crate::resources::{Coupon, Currency, Customer}; - -/// The resource representing a Stripe "PromotionCode". -/// -/// For more details see -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct PromotionCode { - /// Unique identifier for the object. - pub id: PromotionCodeId, - - /// Whether the promotion code is currently active. - /// - /// A promotion code is only active if the coupon is also valid. - pub active: bool, - - /// The customer-facing code. - /// - /// Regardless of case, this code must be unique across all active promotion codes for each customer. - pub code: String, - - pub coupon: Coupon, - - /// Time at which the object was created. - /// - /// Measured in seconds since the Unix epoch. - pub created: Timestamp, - - /// The customer that this promotion code can be used by. - pub customer: Option>, - - /// Date at which the promotion code can no longer be redeemed. - pub expires_at: Option, - - /// Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. - pub livemode: bool, - - /// Maximum number of times this promotion code can be redeemed. - pub max_redemptions: Option, - - /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. - /// - /// This can be useful for storing additional information about the object in a structured format. - pub metadata: Option, - - pub restrictions: PromotionCodesResourceRestrictions, - - /// Number of times this promotion code has been used. - pub times_redeemed: i64, -} - -impl PromotionCode { - /// Returns a list of your promotion codes. - pub fn list(client: &Client, params: &ListPromotionCodes<'_>) -> Response> { - client.get_query("/promotion_codes", ¶ms) - } - - /// Retrieves the promotion code with the given ID. - /// - /// In order to retrieve a promotion code by the customer-facing `code` use [list](https://stripe.com/docs/api/promotion_codes/list) with the desired `code`. - pub fn retrieve( - client: &Client, - id: &PromotionCodeId, - expand: &[&str], - ) -> Response { - client.get_query(&format!("/promotion_codes/{}", id), &Expand { expand }) - } - - /// Updates the specified promotion code by setting the values of the parameters passed. - /// - /// Most fields are, by design, not editable. - pub fn update( - client: &Client, - id: &PromotionCodeId, - params: UpdatePromotionCode<'_>, - ) -> Response { - client.post_form(&format!("/promotion_codes/{}", id), ¶ms) - } -} - -impl Object for PromotionCode { - type Id = PromotionCodeId; - fn id(&self) -> Self::Id { - self.id.clone() - } - fn object(&self) -> &'static str { - "promotion_code" - } -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct PromotionCodesResourceRestrictions { - /// Promotion code restrictions defined in each available currency option. - /// - /// Each key must be a three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html) and a [supported currency](https://stripe.com/docs/currencies). - #[serde(skip_serializing_if = "Option::is_none")] - pub currency_options: Option>, - - /// A Boolean indicating if the Promotion Code should only be redeemed for Customers without any successful payments or invoices. - pub first_time_transaction: bool, - - /// Minimum amount required to redeem this Promotion Code into a Coupon (e.g., a purchase must be $100 or more to work). - pub minimum_amount: Option, - - /// Three-letter [ISO code](https://stripe.com/docs/currencies) for minimum_amount. - pub minimum_amount_currency: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct PromotionCodeCurrencyOption { - /// Minimum amount required to redeem this Promotion Code into a Coupon (e.g., a purchase must be $100 or more to work). - pub minimum_amount: i64, -} - -/// The parameters for `PromotionCode::list`. -#[derive(Clone, Debug, Serialize, Default)] -pub struct ListPromotionCodes<'a> { - /// Filter promotion codes by whether they are active. - #[serde(skip_serializing_if = "Option::is_none")] - pub active: Option, - - /// Only return promotion codes that have this case-insensitive code. - #[serde(skip_serializing_if = "Option::is_none")] - pub code: Option<&'a str>, - - /// Only return promotion codes for this coupon. - #[serde(skip_serializing_if = "Option::is_none")] - pub coupon: Option, - - /// A filter on the list, based on the object `created` field. - /// - /// The value can be a string with an integer Unix timestamp, or it can be a dictionary with a number of different query options. - #[serde(skip_serializing_if = "Option::is_none")] - pub created: Option>, - - /// Only return promotion codes that are restricted to this customer. - #[serde(skip_serializing_if = "Option::is_none")] - pub customer: Option, - - /// A cursor for use in pagination. - /// - /// `ending_before` is an object ID that defines your place in the list. - /// For instance, if you make a list request and receive 100 objects, starting with `obj_bar`, your subsequent call can include `ending_before=obj_bar` in order to fetch the previous page of the list. - #[serde(skip_serializing_if = "Option::is_none")] - pub ending_before: Option, - - /// Specifies which fields in the response should be expanded. - #[serde(skip_serializing_if = "Expand::is_empty")] - pub expand: &'a [&'a str], - - /// A limit on the number of objects to be returned. - /// - /// Limit can range between 1 and 100, and the default is 10. - #[serde(skip_serializing_if = "Option::is_none")] - pub limit: Option, - - /// A cursor for use in pagination. - /// - /// `starting_after` is an object ID that defines your place in the list. - /// For instance, if you make a list request and receive 100 objects, ending with `obj_foo`, your subsequent call can include `starting_after=obj_foo` in order to fetch the next page of the list. - #[serde(skip_serializing_if = "Option::is_none")] - pub starting_after: Option, -} - -impl<'a> ListPromotionCodes<'a> { - pub fn new() -> Self { - ListPromotionCodes { - active: Default::default(), - code: Default::default(), - coupon: Default::default(), - created: Default::default(), - customer: Default::default(), - ending_before: Default::default(), - expand: Default::default(), - limit: Default::default(), - starting_after: Default::default(), - } - } -} -impl Paginable for ListPromotionCodes<'_> { - type O = PromotionCode; - fn set_last(&mut self, item: Self::O) { - self.starting_after = Some(item.id()); - } -} -/// The parameters for `PromotionCode::update`. -#[derive(Clone, Debug, Serialize, Default)] -pub struct UpdatePromotionCode<'a> { - /// Whether the promotion code is currently active. - /// - /// A promotion code can only be reactivated when the coupon is still valid and the promotion code is otherwise redeemable. - #[serde(skip_serializing_if = "Option::is_none")] - pub active: Option, - - /// Specifies which fields in the response should be expanded. - #[serde(skip_serializing_if = "Expand::is_empty")] - pub expand: &'a [&'a str], - - /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. - /// - /// This can be useful for storing additional information about the object in a structured format. - /// Individual keys can be unset by posting an empty value to them. - /// All keys can be unset by posting an empty value to `metadata`. - #[serde(skip_serializing_if = "Option::is_none")] - pub metadata: Option, - - /// Settings that restrict the redemption of the promotion code. - #[serde(skip_serializing_if = "Option::is_none")] - pub restrictions: Option, -} - -impl<'a> UpdatePromotionCode<'a> { - pub fn new() -> Self { - UpdatePromotionCode { - active: Default::default(), - expand: Default::default(), - metadata: Default::default(), - restrictions: Default::default(), - } - } -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UpdatePromotionCodeRestrictions { - /// Promotion codes defined in each available currency option. - /// - /// Each key must be a three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html) and a [supported currency](https://stripe.com/docs/currencies). - #[serde(skip_serializing_if = "Option::is_none")] - pub currency_options: Option>, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UpdatePromotionCodeRestrictionsCurrencyOptions { - /// Minimum amount required to redeem this Promotion Code into a Coupon (e.g., a purchase must be $100 or more to work). - #[serde(skip_serializing_if = "Option::is_none")] - pub minimum_amount: Option, -} diff --git a/src/resources/generated/promotion_code_created.rs b/src/resources/generated/promotion_code_created.rs deleted file mode 100644 index 3a9c60b6b..000000000 --- a/src/resources/generated/promotion_code_created.rs +++ /dev/null @@ -1,10 +0,0 @@ -// ====================================== -// This file was automatically generated. -// ====================================== - -use serde::{Deserialize, Serialize}; - -/// The resource representing a Stripe "promotion_code.created". -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct PromotionCodeCreated { -} diff --git a/src/resources/generated/promotion_code_updated.rs b/src/resources/generated/promotion_code_updated.rs deleted file mode 100644 index b766f8f7e..000000000 --- a/src/resources/generated/promotion_code_updated.rs +++ /dev/null @@ -1,10 +0,0 @@ -// ====================================== -// This file was automatically generated. -// ====================================== - -use serde::{Deserialize, Serialize}; - -/// The resource representing a Stripe "promotion_code.updated". -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct PromotionCodeUpdated { -} diff --git a/src/resources/generated/quote.rs b/src/resources/generated/quote.rs deleted file mode 100644 index a7b3beac3..000000000 --- a/src/resources/generated/quote.rs +++ /dev/null @@ -1,516 +0,0 @@ -// ====================================== -// This file was automatically generated. -// ====================================== - -use serde::{Deserialize, Serialize}; - -use crate::client::{Client, Response}; -use crate::ids::{CustomerId, QuoteId}; -use crate::params::{Expand, Expandable, List, Metadata, Object, Paginable, Timestamp}; -use crate::resources::{ - Account, Application, CheckoutSessionItem, ConnectAccountReference, Currency, Customer, - Discount, Invoice, QuotesResourceTotalDetails, Subscription, SubscriptionSchedule, TaxRate, - TestHelpersTestClock, -}; - -/// The resource representing a Stripe "Quote". -/// -/// For more details see -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct Quote { - /// Unique identifier for the object. - pub id: QuoteId, - - /// Total before any discounts or taxes are applied. - pub amount_subtotal: i64, - - /// Total after discounts and taxes are applied. - pub amount_total: i64, - - /// ID of the Connect Application that created the quote. - pub application: Option>, - - /// The amount of the application fee (if any) that will be requested to be applied to the payment and transferred to the application owner's Stripe account. - /// - /// Only applicable if there are no line items with recurring prices on the quote. - pub application_fee_amount: Option, - - /// A non-negative decimal between 0 and 100, with at most two decimal places. - /// - /// This represents the percentage of the subscription invoice total that will be transferred to the application owner's Stripe account. - /// Only applicable if there are line items with recurring prices on the quote. - pub application_fee_percent: Option, - - pub automatic_tax: QuotesResourceAutomaticTax, - - /// Either `charge_automatically`, or `send_invoice`. - /// - /// When charging automatically, Stripe will attempt to pay invoices at the end of the subscription cycle or on finalization using the default payment method attached to the subscription or customer. - /// When sending an invoice, Stripe will email your customer an invoice with payment instructions and mark the subscription as `active`. - /// Defaults to `charge_automatically`. - pub collection_method: QuoteCollectionMethod, - - pub computed: QuotesResourceComputed, - - /// Time at which the object was created. - /// - /// Measured in seconds since the Unix epoch. - pub created: Timestamp, - - /// Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. - /// - /// Must be a [supported currency](https://stripe.com/docs/currencies). - pub currency: Option, - - /// The customer which this quote belongs to. - /// - /// A customer is required before finalizing the quote. - /// Once specified, it cannot be changed. - pub customer: Option>, - - /// The tax rates applied to this quote. - #[serde(skip_serializing_if = "Option::is_none")] - pub default_tax_rates: Option>>, - - /// A description that will be displayed on the quote PDF. - pub description: Option, - - /// The discounts applied to this quote. - pub discounts: Vec>, - - /// The date on which the quote will be canceled if in `open` or `draft` status. - /// - /// Measured in seconds since the Unix epoch. - pub expires_at: Timestamp, - - /// A footer that will be displayed on the quote PDF. - pub footer: Option, - - /// Details of the quote that was cloned. - /// - /// See the [cloning documentation](https://stripe.com/docs/quotes/clone) for more details. - pub from_quote: Option, - - /// A header that will be displayed on the quote PDF. - pub header: Option, - - /// The invoice that was created from this quote. - pub invoice: Option>, - - pub invoice_settings: InvoiceSettingQuoteSetting, - - /// A list of items the customer is being quoted for. - #[serde(skip_serializing_if = "Option::is_none")] - pub line_items: Option>, - - /// Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. - pub livemode: bool, - - /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. - /// - /// This can be useful for storing additional information about the object in a structured format. - pub metadata: Metadata, - - /// A unique number that identifies this particular quote. - /// - /// This number is assigned once the quote is [finalized](https://stripe.com/docs/quotes/overview#finalize). - pub number: Option, - - /// The account on behalf of which to charge. - /// - /// See the [Connect documentation](https://support.stripe.com/questions/sending-invoices-on-behalf-of-connected-accounts) for details. - pub on_behalf_of: Option>, - - /// The status of the quote. - pub status: QuoteStatus, - - pub status_transitions: QuotesResourceStatusTransitions, - - /// The subscription that was created or updated from this quote. - pub subscription: Option>, - - pub subscription_data: QuotesResourceSubscriptionDataSubscriptionData, - - /// The subscription schedule that was created or updated from this quote. - pub subscription_schedule: Option>, - - /// ID of the test clock this quote belongs to. - pub test_clock: Option>, - - pub total_details: QuotesResourceTotalDetails, - - /// The account (if any) the payments will be attributed to for tax reporting, and where funds from each payment will be transferred to for each of the invoices. - pub transfer_data: Option, -} - -impl Quote { - /// Returns a list of your quotes. - pub fn list(client: &Client, params: &ListQuotes<'_>) -> Response> { - client.get_query("/quotes", ¶ms) - } - - /// Retrieves the quote with the given ID. - pub fn retrieve(client: &Client, id: &QuoteId, expand: &[&str]) -> Response { - client.get_query(&format!("/quotes/{}", id), &Expand { expand }) - } -} - -impl Object for Quote { - type Id = QuoteId; - fn id(&self) -> Self::Id { - self.id.clone() - } - fn object(&self) -> &'static str { - "quote" - } -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct InvoiceSettingQuoteSetting { - /// Number of days within which a customer must pay invoices generated by this quote. - /// - /// This value will be `null` for quotes where `collection_method=charge_automatically`. - pub days_until_due: Option, - - pub issuer: ConnectAccountReference, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct QuotesResourceAutomaticTax { - /// Automatically calculate taxes. - pub enabled: bool, - - /// The account that's liable for tax. - /// - /// If set, the business address and tax registrations required to perform the tax calculation are loaded from this account. - /// The tax transaction is returned in the report of the connected account. - pub liability: Option, - - /// The status of the most recent automated tax calculation for this quote. - pub status: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct QuotesResourceComputed { - /// The definitive totals and line items the customer will be charged on a recurring basis. - /// - /// Takes into account the line items with recurring prices and discounts with `duration=forever` coupons only. - /// Defaults to `null` if no inputted line items with recurring prices. - pub recurring: Option, - - pub upfront: QuotesResourceUpfront, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct QuotesResourceFromQuote { - /// Whether this quote is a revision of a different quote. - pub is_revision: bool, - - /// The quote that was cloned. - pub quote: Expandable, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct QuotesResourceRecurring { - /// Total before any discounts or taxes are applied. - pub amount_subtotal: i64, - - /// Total after discounts and taxes are applied. - pub amount_total: i64, - - /// The frequency at which a subscription is billed. - /// - /// One of `day`, `week`, `month` or `year`. - pub interval: QuotesResourceRecurringInterval, - - /// The number of intervals (specified in the `interval` attribute) between subscription billings. - /// - /// For example, `interval=month` and `interval_count=3` bills every 3 months. - pub interval_count: u64, - - pub total_details: QuotesResourceTotalDetails, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct QuotesResourceStatusTransitions { - /// The time that the quote was accepted. - /// - /// Measured in seconds since Unix epoch. - pub accepted_at: Option, - - /// The time that the quote was canceled. - /// - /// Measured in seconds since Unix epoch. - pub canceled_at: Option, - - /// The time that the quote was finalized. - /// - /// Measured in seconds since Unix epoch. - pub finalized_at: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct QuotesResourceSubscriptionDataSubscriptionData { - /// The subscription's description, meant to be displayable to the customer. - /// - /// Use this field to optionally store an explanation of the subscription for rendering in Stripe surfaces and certain local payment methods UIs. - pub description: Option, - - /// When creating a new subscription, the date of which the subscription schedule will start after the quote is accepted. - /// - /// This date is ignored if it is in the past when the quote is accepted. - /// Measured in seconds since the Unix epoch. - pub effective_date: Option, - - /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that will set metadata on the subscription or subscription schedule when the quote is accepted. - /// - /// If a recurring price is included in `line_items`, this field will be passed to the resulting subscription's `metadata` field. - /// If `subscription_data.effective_date` is used, this field will be passed to the resulting subscription schedule's `phases.metadata` field. - /// Unlike object-level metadata, this field is declarative. - /// Updates will clear prior values. - pub metadata: Option, - - /// Integer representing the number of trial period days before the customer is charged for the first time. - pub trial_period_days: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct QuotesResourceTransferData { - /// The amount in cents (or local equivalent) that will be transferred to the destination account when the invoice is paid. - /// - /// By default, the entire amount is transferred to the destination. - pub amount: Option, - - /// A non-negative decimal between 0 and 100, with at most two decimal places. - /// - /// This represents the percentage of the subscription invoice total that will be transferred to the destination account. - /// By default, the entire amount will be transferred to the destination. - pub amount_percent: Option, - - /// The account where funds from the payment will be transferred to upon payment success. - pub destination: Expandable, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct QuotesResourceUpfront { - /// Total before any discounts or taxes are applied. - pub amount_subtotal: i64, - - /// Total after discounts and taxes are applied. - pub amount_total: i64, - - /// The line items that will appear on the next invoice after this quote is accepted. - /// - /// This does not include pending invoice items that exist on the customer but may still be included in the next invoice. - #[serde(skip_serializing_if = "Option::is_none")] - pub line_items: Option>, - - pub total_details: QuotesResourceTotalDetails, -} - -/// The parameters for `Quote::list`. -#[derive(Clone, Debug, Serialize, Default)] -pub struct ListQuotes<'a> { - /// The ID of the customer whose quotes will be retrieved. - #[serde(skip_serializing_if = "Option::is_none")] - pub customer: Option, - - /// A cursor for use in pagination. - /// - /// `ending_before` is an object ID that defines your place in the list. - /// For instance, if you make a list request and receive 100 objects, starting with `obj_bar`, your subsequent call can include `ending_before=obj_bar` in order to fetch the previous page of the list. - #[serde(skip_serializing_if = "Option::is_none")] - pub ending_before: Option, - - /// Specifies which fields in the response should be expanded. - #[serde(skip_serializing_if = "Expand::is_empty")] - pub expand: &'a [&'a str], - - /// A limit on the number of objects to be returned. - /// - /// Limit can range between 1 and 100, and the default is 10. - #[serde(skip_serializing_if = "Option::is_none")] - pub limit: Option, - - /// A cursor for use in pagination. - /// - /// `starting_after` is an object ID that defines your place in the list. - /// For instance, if you make a list request and receive 100 objects, ending with `obj_foo`, your subsequent call can include `starting_after=obj_foo` in order to fetch the next page of the list. - #[serde(skip_serializing_if = "Option::is_none")] - pub starting_after: Option, - - /// The status of the quote. - #[serde(skip_serializing_if = "Option::is_none")] - pub status: Option, - - /// Provides a list of quotes that are associated with the specified test clock. - /// - /// The response will not include quotes with test clocks if this and the customer parameter is not set. - #[serde(skip_serializing_if = "Option::is_none")] - pub test_clock: Option<&'a str>, -} - -impl<'a> ListQuotes<'a> { - pub fn new() -> Self { - ListQuotes { - customer: Default::default(), - ending_before: Default::default(), - expand: Default::default(), - limit: Default::default(), - starting_after: Default::default(), - status: Default::default(), - test_clock: Default::default(), - } - } -} -impl Paginable for ListQuotes<'_> { - type O = Quote; - fn set_last(&mut self, item: Self::O) { - self.starting_after = Some(item.id()); - } -} -/// An enum representing the possible values of an `Quote`'s `collection_method` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum QuoteCollectionMethod { - ChargeAutomatically, - SendInvoice, -} - -impl QuoteCollectionMethod { - pub fn as_str(self) -> &'static str { - match self { - QuoteCollectionMethod::ChargeAutomatically => "charge_automatically", - QuoteCollectionMethod::SendInvoice => "send_invoice", - } - } -} - -impl AsRef for QuoteCollectionMethod { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for QuoteCollectionMethod { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for QuoteCollectionMethod { - fn default() -> Self { - Self::ChargeAutomatically - } -} - -/// An enum representing the possible values of an `Quote`'s `status` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum QuoteStatus { - Accepted, - Canceled, - Draft, - Open, -} - -impl QuoteStatus { - pub fn as_str(self) -> &'static str { - match self { - QuoteStatus::Accepted => "accepted", - QuoteStatus::Canceled => "canceled", - QuoteStatus::Draft => "draft", - QuoteStatus::Open => "open", - } - } -} - -impl AsRef for QuoteStatus { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for QuoteStatus { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for QuoteStatus { - fn default() -> Self { - Self::Accepted - } -} - -/// An enum representing the possible values of an `QuotesResourceAutomaticTax`'s `status` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum QuotesResourceAutomaticTaxStatus { - Complete, - Failed, - RequiresLocationInputs, -} - -impl QuotesResourceAutomaticTaxStatus { - pub fn as_str(self) -> &'static str { - match self { - QuotesResourceAutomaticTaxStatus::Complete => "complete", - QuotesResourceAutomaticTaxStatus::Failed => "failed", - QuotesResourceAutomaticTaxStatus::RequiresLocationInputs => "requires_location_inputs", - } - } -} - -impl AsRef for QuotesResourceAutomaticTaxStatus { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for QuotesResourceAutomaticTaxStatus { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for QuotesResourceAutomaticTaxStatus { - fn default() -> Self { - Self::Complete - } -} - -/// An enum representing the possible values of an `QuotesResourceRecurring`'s `interval` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum QuotesResourceRecurringInterval { - Day, - Month, - Week, - Year, -} - -impl QuotesResourceRecurringInterval { - pub fn as_str(self) -> &'static str { - match self { - QuotesResourceRecurringInterval::Day => "day", - QuotesResourceRecurringInterval::Month => "month", - QuotesResourceRecurringInterval::Week => "week", - QuotesResourceRecurringInterval::Year => "year", - } - } -} - -impl AsRef for QuotesResourceRecurringInterval { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for QuotesResourceRecurringInterval { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for QuotesResourceRecurringInterval { - fn default() -> Self { - Self::Day - } -} diff --git a/src/resources/generated/quote_accepted.rs b/src/resources/generated/quote_accepted.rs deleted file mode 100644 index 6f2c80150..000000000 --- a/src/resources/generated/quote_accepted.rs +++ /dev/null @@ -1,10 +0,0 @@ -// ====================================== -// This file was automatically generated. -// ====================================== - -use serde::{Deserialize, Serialize}; - -/// The resource representing a Stripe "quote.accepted". -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct QuoteAccepted { -} diff --git a/src/resources/generated/quote_canceled.rs b/src/resources/generated/quote_canceled.rs deleted file mode 100644 index d54dffaa0..000000000 --- a/src/resources/generated/quote_canceled.rs +++ /dev/null @@ -1,10 +0,0 @@ -// ====================================== -// This file was automatically generated. -// ====================================== - -use serde::{Deserialize, Serialize}; - -/// The resource representing a Stripe "quote.canceled". -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct QuoteCanceled { -} diff --git a/src/resources/generated/quote_created.rs b/src/resources/generated/quote_created.rs deleted file mode 100644 index 15bb1f97c..000000000 --- a/src/resources/generated/quote_created.rs +++ /dev/null @@ -1,10 +0,0 @@ -// ====================================== -// This file was automatically generated. -// ====================================== - -use serde::{Deserialize, Serialize}; - -/// The resource representing a Stripe "quote.created". -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct QuoteCreated { -} diff --git a/src/resources/generated/quote_finalized.rs b/src/resources/generated/quote_finalized.rs deleted file mode 100644 index 609d20fda..000000000 --- a/src/resources/generated/quote_finalized.rs +++ /dev/null @@ -1,10 +0,0 @@ -// ====================================== -// This file was automatically generated. -// ====================================== - -use serde::{Deserialize, Serialize}; - -/// The resource representing a Stripe "quote.finalized". -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct QuoteFinalized { -} diff --git a/src/resources/generated/quotes_resource_total_details.rs b/src/resources/generated/quotes_resource_total_details.rs deleted file mode 100644 index 94bf3821b..000000000 --- a/src/resources/generated/quotes_resource_total_details.rs +++ /dev/null @@ -1,116 +0,0 @@ -// ====================================== -// This file was automatically generated. -// ====================================== - -use serde::{Deserialize, Serialize}; - -use crate::resources::{Discount, TaxRate}; - -/// The resource representing a Stripe "QuotesResourceTotalDetails". -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct QuotesResourceTotalDetails { - /// This is the sum of all the discounts. - pub amount_discount: i64, - - /// This is the sum of all the shipping amounts. - pub amount_shipping: Option, - - /// This is the sum of all the tax amounts. - pub amount_tax: i64, - - #[serde(skip_serializing_if = "Option::is_none")] - pub breakdown: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct QuotesResourceTotalDetailsResourceBreakdown { - /// The aggregated discounts. - pub discounts: Vec, - - /// The aggregated tax amounts by rate. - pub taxes: Vec, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct LineItemsDiscountAmount { - /// The amount discounted. - pub amount: i64, - - pub discount: Discount, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct LineItemsTaxAmount { - /// Amount of tax applied for this rate. - pub amount: i64, - - pub rate: TaxRate, - - /// The reasoning behind this tax, for example, if the product is tax exempt. - /// - /// The possible values for this field may be extended as new tax rules are supported. - pub taxability_reason: Option, - - /// The amount on which tax is calculated, in cents (or local equivalent). - pub taxable_amount: Option, -} - -/// An enum representing the possible values of an `LineItemsTaxAmount`'s `taxability_reason` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum LineItemsTaxAmountTaxabilityReason { - CustomerExempt, - NotCollecting, - NotSubjectToTax, - NotSupported, - PortionProductExempt, - PortionReducedRated, - PortionStandardRated, - ProductExempt, - ProductExemptHoliday, - ProportionallyRated, - ReducedRated, - ReverseCharge, - StandardRated, - TaxableBasisReduced, - ZeroRated, -} - -impl LineItemsTaxAmountTaxabilityReason { - pub fn as_str(self) -> &'static str { - match self { - LineItemsTaxAmountTaxabilityReason::CustomerExempt => "customer_exempt", - LineItemsTaxAmountTaxabilityReason::NotCollecting => "not_collecting", - LineItemsTaxAmountTaxabilityReason::NotSubjectToTax => "not_subject_to_tax", - LineItemsTaxAmountTaxabilityReason::NotSupported => "not_supported", - LineItemsTaxAmountTaxabilityReason::PortionProductExempt => "portion_product_exempt", - LineItemsTaxAmountTaxabilityReason::PortionReducedRated => "portion_reduced_rated", - LineItemsTaxAmountTaxabilityReason::PortionStandardRated => "portion_standard_rated", - LineItemsTaxAmountTaxabilityReason::ProductExempt => "product_exempt", - LineItemsTaxAmountTaxabilityReason::ProductExemptHoliday => "product_exempt_holiday", - LineItemsTaxAmountTaxabilityReason::ProportionallyRated => "proportionally_rated", - LineItemsTaxAmountTaxabilityReason::ReducedRated => "reduced_rated", - LineItemsTaxAmountTaxabilityReason::ReverseCharge => "reverse_charge", - LineItemsTaxAmountTaxabilityReason::StandardRated => "standard_rated", - LineItemsTaxAmountTaxabilityReason::TaxableBasisReduced => "taxable_basis_reduced", - LineItemsTaxAmountTaxabilityReason::ZeroRated => "zero_rated", - } - } -} - -impl AsRef for LineItemsTaxAmountTaxabilityReason { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for LineItemsTaxAmountTaxabilityReason { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for LineItemsTaxAmountTaxabilityReason { - fn default() -> Self { - Self::CustomerExempt - } -} diff --git a/src/resources/generated/radar_early_fraud_warning_created.rs b/src/resources/generated/radar_early_fraud_warning_created.rs deleted file mode 100644 index 1bc27ebba..000000000 --- a/src/resources/generated/radar_early_fraud_warning_created.rs +++ /dev/null @@ -1,10 +0,0 @@ -// ====================================== -// This file was automatically generated. -// ====================================== - -use serde::{Deserialize, Serialize}; - -/// The resource representing a Stripe "radar.early_fraud_warning.created". -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct RadarEarlyFraudWarningCreated { -} diff --git a/src/resources/generated/radar_early_fraud_warning_updated.rs b/src/resources/generated/radar_early_fraud_warning_updated.rs deleted file mode 100644 index 441053feb..000000000 --- a/src/resources/generated/radar_early_fraud_warning_updated.rs +++ /dev/null @@ -1,10 +0,0 @@ -// ====================================== -// This file was automatically generated. -// ====================================== - -use serde::{Deserialize, Serialize}; - -/// The resource representing a Stripe "radar.early_fraud_warning.updated". -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct RadarEarlyFraudWarningUpdated { -} diff --git a/src/resources/generated/radar_value_list.rs b/src/resources/generated/radar_value_list.rs deleted file mode 100644 index 4d31a6339..000000000 --- a/src/resources/generated/radar_value_list.rs +++ /dev/null @@ -1,119 +0,0 @@ -// ====================================== -// This file was automatically generated. -// ====================================== - -use crate::ids::{RadarValueListId}; -use crate::params::{List, Metadata, Object, Timestamp}; -use crate::resources::{RadarValueListItem}; -use serde::{Deserialize, Serialize}; - -/// The resource representing a Stripe "RadarListList". -/// -/// For more details see -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct RadarValueList { - /// Unique identifier for the object. - pub id: RadarValueListId, - - /// The name of the value list for use in rules. - #[serde(skip_serializing_if = "Option::is_none")] - pub alias: Option, - - /// Time at which the object was created. - /// - /// Measured in seconds since the Unix epoch. - #[serde(skip_serializing_if = "Option::is_none")] - pub created: Option, - - /// The name or email address of the user who created this value list. - #[serde(skip_serializing_if = "Option::is_none")] - pub created_by: Option, - - // Always true for a deleted object - #[serde(default)] - pub deleted: bool, - - /// The type of items in the value list. - /// - /// One of `card_fingerprint`, `us_bank_account_fingerprint`, `sepa_debit_fingerprint`, `card_bin`, `email`, `ip_address`, `country`, `string`, `case_sensitive_string`, or `customer_id`. - #[serde(skip_serializing_if = "Option::is_none")] - pub item_type: Option, - - /// List of items contained within this value list. - #[serde(skip_serializing_if = "Option::is_none")] - pub list_items: Option>, - - /// Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. - #[serde(skip_serializing_if = "Option::is_none")] - pub livemode: Option, - - /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. - /// - /// This can be useful for storing additional information about the object in a structured format. - #[serde(skip_serializing_if = "Option::is_none")] - pub metadata: Option, - - /// The name of the value list. - #[serde(skip_serializing_if = "Option::is_none")] - pub name: Option, -} - -impl Object for RadarValueList { - type Id = RadarValueListId; - fn id(&self) -> Self::Id { - self.id.clone() - } - fn object(&self) -> &'static str { - "radar.value_list" - } -} - -/// An enum representing the possible values of an `RadarValueList`'s `item_type` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum RadarValueListItemType { - CardBin, - CardFingerprint, - CaseSensitiveString, - Country, - CustomerId, - Email, - IpAddress, - SepaDebitFingerprint, - String, - UsBankAccountFingerprint, -} - -impl RadarValueListItemType { - pub fn as_str(self) -> &'static str { - match self { - RadarValueListItemType::CardBin => "card_bin", - RadarValueListItemType::CardFingerprint => "card_fingerprint", - RadarValueListItemType::CaseSensitiveString => "case_sensitive_string", - RadarValueListItemType::Country => "country", - RadarValueListItemType::CustomerId => "customer_id", - RadarValueListItemType::Email => "email", - RadarValueListItemType::IpAddress => "ip_address", - RadarValueListItemType::SepaDebitFingerprint => "sepa_debit_fingerprint", - RadarValueListItemType::String => "string", - RadarValueListItemType::UsBankAccountFingerprint => "us_bank_account_fingerprint", - } - } -} - -impl AsRef for RadarValueListItemType { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for RadarValueListItemType { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for RadarValueListItemType { - fn default() -> Self { - Self::CardBin - } -} diff --git a/src/resources/generated/radar_value_list_item.rs b/src/resources/generated/radar_value_list_item.rs deleted file mode 100644 index 20fb78df1..000000000 --- a/src/resources/generated/radar_value_list_item.rs +++ /dev/null @@ -1,52 +0,0 @@ -// ====================================== -// This file was automatically generated. -// ====================================== - -use crate::ids::{RadarValueListItemId}; -use crate::params::{Object, Timestamp}; -use serde::{Deserialize, Serialize}; - -/// The resource representing a Stripe "RadarListListItem". -/// -/// For more details see -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct RadarValueListItem { - /// Unique identifier for the object. - pub id: RadarValueListItemId, - - /// Time at which the object was created. - /// - /// Measured in seconds since the Unix epoch. - #[serde(skip_serializing_if = "Option::is_none")] - pub created: Option, - - /// The name or email address of the user who added this item to the value list. - #[serde(skip_serializing_if = "Option::is_none")] - pub created_by: Option, - - // Always true for a deleted object - #[serde(default)] - pub deleted: bool, - - /// Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. - #[serde(skip_serializing_if = "Option::is_none")] - pub livemode: Option, - - /// The value of the item. - #[serde(skip_serializing_if = "Option::is_none")] - pub value: Option, - - /// The identifier of the value list this item belongs to. - #[serde(skip_serializing_if = "Option::is_none")] - pub value_list: Option, -} - -impl Object for RadarValueListItem { - type Id = RadarValueListItemId; - fn id(&self) -> Self::Id { - self.id.clone() - } - fn object(&self) -> &'static str { - "radar.value_list_item" - } -} diff --git a/src/resources/generated/refund.rs b/src/resources/generated/refund.rs deleted file mode 100644 index eec7f5897..000000000 --- a/src/resources/generated/refund.rs +++ /dev/null @@ -1,605 +0,0 @@ -// ====================================== -// This file was automatically generated. -// ====================================== - -use serde::{Deserialize, Serialize}; - -use crate::client::{Client, Response}; -use crate::ids::{ChargeId, CustomerId, PaymentIntentId, RefundId}; -use crate::params::{Expand, Expandable, List, Metadata, Object, Paginable, RangeQuery, Timestamp}; -use crate::resources::{BalanceTransaction, Charge, Currency, PaymentIntent, TransferReversal}; - -/// The resource representing a Stripe "Refund". -/// -/// For more details see -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct Refund { - /// Unique identifier for the object. - pub id: RefundId, - - /// Amount, in cents (or local equivalent). - pub amount: i64, - - /// Balance transaction that describes the impact on your account balance. - pub balance_transaction: Option>, - - /// ID of the charge that's refunded. - pub charge: Option>, - - /// Time at which the object was created. - /// - /// Measured in seconds since the Unix epoch. - pub created: Timestamp, - - /// Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. - /// - /// Must be a [supported currency](https://stripe.com/docs/currencies). - pub currency: Currency, - - /// An arbitrary string attached to the object. - /// - /// You can use this for displaying to users (available on non-card refunds only). - #[serde(skip_serializing_if = "Option::is_none")] - pub description: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub destination_details: Option, - - /// After the refund fails, this balance transaction describes the adjustment made on your account balance that reverses the initial balance transaction. - #[serde(skip_serializing_if = "Option::is_none")] - pub failure_balance_transaction: Option>, - - /// Provides the reason for the refund failure. - /// - /// Possible values are: `lost_or_stolen_card`, `expired_or_canceled_card`, `charge_for_pending_refund_disputed`, `insufficient_funds`, `declined`, `merchant_request`, or `unknown`. - #[serde(skip_serializing_if = "Option::is_none")] - pub failure_reason: Option, - - /// For payment methods without native refund support (for example, Konbini, PromptPay), provide an email address for the customer to receive refund instructions. - #[serde(skip_serializing_if = "Option::is_none")] - pub instructions_email: Option, - - /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. - /// - /// This can be useful for storing additional information about the object in a structured format. - pub metadata: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub next_action: Option, - - /// ID of the PaymentIntent that's refunded. - pub payment_intent: Option>, - - /// Reason for the refund, which is either user-provided (`duplicate`, `fraudulent`, or `requested_by_customer`) or generated by Stripe internally (`expired_uncaptured_charge`). - pub reason: Option, - - /// This is the transaction number that appears on email receipts sent for this refund. - pub receipt_number: Option, - - /// The transfer reversal that's associated with the refund. - /// - /// Only present if the charge came from another Stripe account. - pub source_transfer_reversal: Option>, - - /// Status of the refund. - /// - /// This can be `pending`, `requires_action`, `succeeded`, `failed`, or `canceled`. - /// Learn more about [failed refunds](https://stripe.com/docs/refunds#failed-refunds). - pub status: Option, - - /// This refers to the transfer reversal object if the accompanying transfer reverses. - /// - /// This is only applicable if the charge was created using the destination parameter. - pub transfer_reversal: Option>, -} - -impl Refund { - /// Returns a list of all refunds you created. - /// - /// We return the refunds in sorted order, with the most recent refunds appearing first The 10 most recent refunds are always available by default on the Charge object. - pub fn list(client: &Client, params: &ListRefunds<'_>) -> Response> { - client.get_query("/refunds", ¶ms) - } - - /// When you create a new refund, you must specify a Charge or a PaymentIntent object on which to create it. - /// - /// Creating a new refund will refund a charge that has previously been created but not yet refunded. - /// Funds will be refunded to the credit or debit card that was originally charged. - /// - /// You can optionally refund only part of a charge. - /// You can do so multiple times, until the entire charge has been refunded. - /// - /// Once entirely refunded, a charge can’t be refunded again. - /// This method will raise an error when called on an already-refunded charge, - /// or when trying to refund more money than is left on a charge. - pub fn create(client: &Client, params: CreateRefund<'_>) -> Response { - client.post_form("/refunds", ¶ms) - } - - /// Retrieves the details of an existing refund. - pub fn retrieve(client: &Client, id: &RefundId, expand: &[&str]) -> Response { - client.get_query(&format!("/refunds/{}", id), &Expand { expand }) - } - - /// Updates the refund that you specify by setting the values of the passed parameters. - /// - /// Any parameters that you don’t provide remain unchanged. This request only accepts `metadata` as an argument. - pub fn update(client: &Client, id: &RefundId, params: UpdateRefund<'_>) -> Response { - client.post_form(&format!("/refunds/{}", id), ¶ms) - } -} - -impl Object for Refund { - type Id = RefundId; - fn id(&self) -> Self::Id { - self.id.clone() - } - fn object(&self) -> &'static str { - "refund" - } -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct RefundDestinationDetails { - #[serde(skip_serializing_if = "Option::is_none")] - pub affirm: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub afterpay_clearpay: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub alipay: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub au_bank_transfer: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub blik: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub br_bank_transfer: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub card: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub cashapp: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub customer_cash_balance: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub eps: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub eu_bank_transfer: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub gb_bank_transfer: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub giropay: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub grabpay: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub jp_bank_transfer: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub klarna: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub mx_bank_transfer: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub p24: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub paynow: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub paypal: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub pix: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub revolut: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub sofort: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub swish: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub th_bank_transfer: Option, - - /// The type of transaction-specific details of the payment method used in the refund (e.g., `card`). - /// - /// An additional hash is included on `destination_details` with a name matching this value. - /// It contains information specific to the refund transaction. - #[serde(rename = "type")] - pub type_: String, - - #[serde(skip_serializing_if = "Option::is_none")] - pub us_bank_transfer: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub wechat_pay: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub zip: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct DestinationDetailsUnimplemented {} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct RefundDestinationDetailsCard { - /// Value of the reference number assigned to the refund. - #[serde(skip_serializing_if = "Option::is_none")] - pub reference: Option, - - /// Status of the reference number on the refund. - /// - /// This can be `pending`, `available` or `unavailable`. - #[serde(skip_serializing_if = "Option::is_none")] - pub reference_status: Option, - - /// Type of the reference number assigned to the refund. - #[serde(skip_serializing_if = "Option::is_none")] - pub reference_type: Option, - - /// The type of refund. - /// - /// This can be `refund`, `reversal`, or `pending`. - #[serde(rename = "type")] - pub type_: RefundDestinationDetailsCardType, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct RefundDestinationDetailsGeneric { - /// The reference assigned to the refund. - pub reference: Option, - - /// Status of the reference on the refund. - /// - /// This can be `pending`, `available` or `unavailable`. - pub reference_status: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct RefundNextAction { - /// Contains the refund details. - pub display_details: Option, - - /// Type of the next action to perform. - #[serde(rename = "type")] - pub type_: String, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct RefundNextActionDisplayDetails { - pub email_sent: EmailSent, - - /// The expiry timestamp. - pub expires_at: Timestamp, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct EmailSent { - /// The timestamp when the email was sent. - pub email_sent_at: Timestamp, - - /// The recipient's email address. - pub email_sent_to: String, -} - -/// The parameters for `Refund::create`. -#[derive(Clone, Debug, Serialize, Default)] -pub struct CreateRefund<'a> { - #[serde(skip_serializing_if = "Option::is_none")] - pub amount: Option, - - /// The identifier of the charge to refund. - #[serde(skip_serializing_if = "Option::is_none")] - pub charge: Option, - - /// Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. - /// - /// Must be a [supported currency](https://stripe.com/docs/currencies). - #[serde(skip_serializing_if = "Option::is_none")] - pub currency: Option, - - /// Customer whose customer balance to refund from. - #[serde(skip_serializing_if = "Option::is_none")] - pub customer: Option, - - /// Specifies which fields in the response should be expanded. - #[serde(skip_serializing_if = "Expand::is_empty")] - pub expand: &'a [&'a str], - - /// For payment methods without native refund support (e.g., Konbini, PromptPay), use this email from the customer to receive refund instructions. - #[serde(skip_serializing_if = "Option::is_none")] - pub instructions_email: Option<&'a str>, - - /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. - /// - /// This can be useful for storing additional information about the object in a structured format. - /// Individual keys can be unset by posting an empty value to them. - /// All keys can be unset by posting an empty value to `metadata`. - #[serde(skip_serializing_if = "Option::is_none")] - pub metadata: Option, - - /// Origin of the refund. - #[serde(skip_serializing_if = "Option::is_none")] - pub origin: Option, - - /// The identifier of the PaymentIntent to refund. - #[serde(skip_serializing_if = "Option::is_none")] - pub payment_intent: Option, - - /// String indicating the reason for the refund. - /// - /// If set, possible values are `duplicate`, `fraudulent`, and `requested_by_customer`. - /// If you believe the charge to be fraudulent, specifying `fraudulent` as the reason will add the associated card and email to your [block lists](https://stripe.com/docs/radar/lists), and will also help us improve our fraud detection algorithms. - #[serde(skip_serializing_if = "Option::is_none")] - pub reason: Option, - - /// Boolean indicating whether the application fee should be refunded when refunding this charge. - /// - /// If a full charge refund is given, the full application fee will be refunded. - /// Otherwise, the application fee will be refunded in an amount proportional to the amount of the charge refunded. - /// An application fee can be refunded only by the application that created the charge. - #[serde(skip_serializing_if = "Option::is_none")] - pub refund_application_fee: Option, - - /// Boolean indicating whether the transfer should be reversed when refunding this charge. - /// - /// The transfer will be reversed proportionally to the amount being refunded (either the entire or partial amount). A transfer can be reversed only by the application that created the charge. - #[serde(skip_serializing_if = "Option::is_none")] - pub reverse_transfer: Option, -} - -impl<'a> CreateRefund<'a> { - pub fn new() -> Self { - CreateRefund { - amount: Default::default(), - charge: Default::default(), - currency: Default::default(), - customer: Default::default(), - expand: Default::default(), - instructions_email: Default::default(), - metadata: Default::default(), - origin: Default::default(), - payment_intent: Default::default(), - reason: Default::default(), - refund_application_fee: Default::default(), - reverse_transfer: Default::default(), - } - } -} - -/// The parameters for `Refund::list`. -#[derive(Clone, Debug, Serialize, Default)] -pub struct ListRefunds<'a> { - /// Only return refunds for the charge specified by this charge ID. - #[serde(skip_serializing_if = "Option::is_none")] - pub charge: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub created: Option>, - - /// A cursor for use in pagination. - /// - /// `ending_before` is an object ID that defines your place in the list. - /// For instance, if you make a list request and receive 100 objects, starting with `obj_bar`, your subsequent call can include `ending_before=obj_bar` in order to fetch the previous page of the list. - #[serde(skip_serializing_if = "Option::is_none")] - pub ending_before: Option, - - /// Specifies which fields in the response should be expanded. - #[serde(skip_serializing_if = "Expand::is_empty")] - pub expand: &'a [&'a str], - - /// A limit on the number of objects to be returned. - /// - /// Limit can range between 1 and 100, and the default is 10. - #[serde(skip_serializing_if = "Option::is_none")] - pub limit: Option, - - /// Only return refunds for the PaymentIntent specified by this ID. - #[serde(skip_serializing_if = "Option::is_none")] - pub payment_intent: Option, - - /// A cursor for use in pagination. - /// - /// `starting_after` is an object ID that defines your place in the list. - /// For instance, if you make a list request and receive 100 objects, ending with `obj_foo`, your subsequent call can include `starting_after=obj_foo` in order to fetch the next page of the list. - #[serde(skip_serializing_if = "Option::is_none")] - pub starting_after: Option, -} - -impl<'a> ListRefunds<'a> { - pub fn new() -> Self { - ListRefunds { - charge: Default::default(), - created: Default::default(), - ending_before: Default::default(), - expand: Default::default(), - limit: Default::default(), - payment_intent: Default::default(), - starting_after: Default::default(), - } - } -} -impl Paginable for ListRefunds<'_> { - type O = Refund; - fn set_last(&mut self, item: Self::O) { - self.starting_after = Some(item.id()); - } -} -/// The parameters for `Refund::update`. -#[derive(Clone, Debug, Serialize, Default)] -pub struct UpdateRefund<'a> { - /// Specifies which fields in the response should be expanded. - #[serde(skip_serializing_if = "Expand::is_empty")] - pub expand: &'a [&'a str], - - /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. - /// - /// This can be useful for storing additional information about the object in a structured format. - /// Individual keys can be unset by posting an empty value to them. - /// All keys can be unset by posting an empty value to `metadata`. - #[serde(skip_serializing_if = "Option::is_none")] - pub metadata: Option, -} - -impl<'a> UpdateRefund<'a> { - pub fn new() -> Self { - UpdateRefund { expand: Default::default(), metadata: Default::default() } - } -} - -/// An enum representing the possible values of an `RefundDestinationDetailsCard`'s `type` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum RefundDestinationDetailsCardType { - Pending, - Refund, - Reversal, -} - -impl RefundDestinationDetailsCardType { - pub fn as_str(self) -> &'static str { - match self { - RefundDestinationDetailsCardType::Pending => "pending", - RefundDestinationDetailsCardType::Refund => "refund", - RefundDestinationDetailsCardType::Reversal => "reversal", - } - } -} - -impl AsRef for RefundDestinationDetailsCardType { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for RefundDestinationDetailsCardType { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for RefundDestinationDetailsCardType { - fn default() -> Self { - Self::Pending - } -} - -/// An enum representing the possible values of an `CreateRefund`'s `origin` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum RefundOrigin { - CustomerBalance, -} - -impl RefundOrigin { - pub fn as_str(self) -> &'static str { - match self { - RefundOrigin::CustomerBalance => "customer_balance", - } - } -} - -impl AsRef for RefundOrigin { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for RefundOrigin { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for RefundOrigin { - fn default() -> Self { - Self::CustomerBalance - } -} - -/// An enum representing the possible values of an `Refund`'s `reason` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum RefundReason { - Duplicate, - ExpiredUncapturedCharge, - Fraudulent, - RequestedByCustomer, -} - -impl RefundReason { - pub fn as_str(self) -> &'static str { - match self { - RefundReason::Duplicate => "duplicate", - RefundReason::ExpiredUncapturedCharge => "expired_uncaptured_charge", - RefundReason::Fraudulent => "fraudulent", - RefundReason::RequestedByCustomer => "requested_by_customer", - } - } -} - -impl AsRef for RefundReason { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for RefundReason { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for RefundReason { - fn default() -> Self { - Self::Duplicate - } -} - -/// An enum representing the possible values of an `CreateRefund`'s `reason` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum RefundReasonFilter { - Duplicate, - Fraudulent, - RequestedByCustomer, -} - -impl RefundReasonFilter { - pub fn as_str(self) -> &'static str { - match self { - RefundReasonFilter::Duplicate => "duplicate", - RefundReasonFilter::Fraudulent => "fraudulent", - RefundReasonFilter::RequestedByCustomer => "requested_by_customer", - } - } -} - -impl AsRef for RefundReasonFilter { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for RefundReasonFilter { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for RefundReasonFilter { - fn default() -> Self { - Self::Duplicate - } -} diff --git a/src/resources/generated/refund_created.rs b/src/resources/generated/refund_created.rs deleted file mode 100644 index 125e714da..000000000 --- a/src/resources/generated/refund_created.rs +++ /dev/null @@ -1,10 +0,0 @@ -// ====================================== -// This file was automatically generated. -// ====================================== - -use serde::{Deserialize, Serialize}; - -/// The resource representing a Stripe "refund.created". -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct RefundCreated { -} diff --git a/src/resources/generated/refund_updated.rs b/src/resources/generated/refund_updated.rs deleted file mode 100644 index 13fbae5f1..000000000 --- a/src/resources/generated/refund_updated.rs +++ /dev/null @@ -1,10 +0,0 @@ -// ====================================== -// This file was automatically generated. -// ====================================== - -use serde::{Deserialize, Serialize}; - -/// The resource representing a Stripe "refund.updated". -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct RefundUpdated { -} diff --git a/src/resources/generated/reporting_report_run.rs b/src/resources/generated/reporting_report_run.rs deleted file mode 100644 index 12c42f6f2..000000000 --- a/src/resources/generated/reporting_report_run.rs +++ /dev/null @@ -1,103 +0,0 @@ -// ====================================== -// This file was automatically generated. -// ====================================== - -use crate::ids::{ReportingReportRunId}; -use crate::params::{Object, Timestamp}; -use crate::resources::{Currency, File}; -use serde::{Deserialize, Serialize}; - -/// The resource representing a Stripe "reporting_report_run". -/// -/// For more details see -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct ReportingReportRun { - /// Unique identifier for the object. - pub id: ReportingReportRunId, - - /// Time at which the object was created. - /// - /// Measured in seconds since the Unix epoch. - pub created: Timestamp, - - /// If something should go wrong during the run, a message about the failure (populated when - /// `status=failed`). - pub error: Option, - - /// `true` if the report is run on live mode data and `false` if it is run on test mode data. - pub livemode: bool, - - pub parameters: FinancialReportingFinanceReportRunRunParameters, - - /// The ID of the [report type](https://stripe.com/docs/reports/report-types) to run, such as `"balance.summary.1"`. - pub report_type: String, - - /// The file object representing the result of the report run (populated when - /// `status=succeeded`). - pub result: Option, - - /// Status of this report run. - /// - /// This will be `pending` when the run is initially created. When the run finishes, this will be set to `succeeded` and the `result` field will be populated. Rarely, we may encounter an error, at which point this will be set to `failed` and the `error` field will be populated. - pub status: String, - - /// Timestamp at which this run successfully finished (populated when - /// `status=succeeded`). - /// - /// Measured in seconds since the Unix epoch. - pub succeeded_at: Option, -} - -impl Object for ReportingReportRun { - type Id = ReportingReportRunId; - fn id(&self) -> Self::Id { - self.id.clone() - } - fn object(&self) -> &'static str { - "reporting.report_run" - } -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct FinancialReportingFinanceReportRunRunParameters { - - /// The set of output columns requested for inclusion in the report run. - #[serde(skip_serializing_if = "Option::is_none")] - pub columns: Option>, - - /// Connected account ID by which to filter the report run. - #[serde(skip_serializing_if = "Option::is_none")] - pub connected_account: Option, - - /// Currency of objects to be included in the report run. - #[serde(skip_serializing_if = "Option::is_none")] - pub currency: Option, - - /// Ending timestamp of data to be included in the report run. - /// - /// Can be any UTC timestamp between 1 second after the user specified `interval_start` and 1 second before this report's last `data_available_end` value. - #[serde(skip_serializing_if = "Option::is_none")] - pub interval_end: Option, - - /// Starting timestamp of data to be included in the report run. - /// - /// Can be any UTC timestamp between 1 second after this report's `data_available_start` and 1 second before the user specified `interval_end` value. - #[serde(skip_serializing_if = "Option::is_none")] - pub interval_start: Option, - - /// Payout ID by which to filter the report run. - #[serde(skip_serializing_if = "Option::is_none")] - pub payout: Option, - - /// Category of balance transactions to be included in the report run. - #[serde(skip_serializing_if = "Option::is_none")] - pub reporting_category: Option, - - /// Defaults to `Etc/UTC`. - /// - /// The output timezone for all timestamps in the report. - /// A list of possible time zone values is maintained at the [IANA Time Zone Database](http://www.iana.org/time-zones). - /// Has no effect on `interval_start` or `interval_end`. - #[serde(skip_serializing_if = "Option::is_none")] - pub timezone: Option, -} diff --git a/src/resources/generated/reporting_report_run_failed.rs b/src/resources/generated/reporting_report_run_failed.rs deleted file mode 100644 index aaa5dd412..000000000 --- a/src/resources/generated/reporting_report_run_failed.rs +++ /dev/null @@ -1,10 +0,0 @@ -// ====================================== -// This file was automatically generated. -// ====================================== - -use serde::{Deserialize, Serialize}; - -/// The resource representing a Stripe "reporting.report_run.failed". -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct ReportingReportRunFailed { -} diff --git a/src/resources/generated/reporting_report_run_succeeded.rs b/src/resources/generated/reporting_report_run_succeeded.rs deleted file mode 100644 index 2e62a2fee..000000000 --- a/src/resources/generated/reporting_report_run_succeeded.rs +++ /dev/null @@ -1,10 +0,0 @@ -// ====================================== -// This file was automatically generated. -// ====================================== - -use serde::{Deserialize, Serialize}; - -/// The resource representing a Stripe "reporting.report_run.succeeded". -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct ReportingReportRunSucceeded { -} diff --git a/src/resources/generated/reporting_report_type.rs b/src/resources/generated/reporting_report_type.rs deleted file mode 100644 index 779b48891..000000000 --- a/src/resources/generated/reporting_report_type.rs +++ /dev/null @@ -1,57 +0,0 @@ -// ====================================== -// This file was automatically generated. -// ====================================== - -use crate::ids::{ReportingReportTypeId}; -use crate::params::{Object, Timestamp}; -use serde::{Deserialize, Serialize}; - -/// The resource representing a Stripe "reporting_report_type". -/// -/// For more details see -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct ReportingReportType { - /// The [ID of the Report Type](https://stripe.com/docs/reporting/statements/api#available-report-types), such as `balance.summary.1`. - pub id: ReportingReportTypeId, - - /// Most recent time for which this Report Type is available. - /// - /// Measured in seconds since the Unix epoch. - pub data_available_end: Timestamp, - - /// Earliest time for which this Report Type is available. - /// - /// Measured in seconds since the Unix epoch. - pub data_available_start: Timestamp, - - /// List of column names that are included by default when this Report Type gets run. - /// - /// (If the Report Type doesn't support the `columns` parameter, this will be null.). - pub default_columns: Option>, - - /// Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. - pub livemode: bool, - - /// Human-readable name of the Report Type. - pub name: String, - - /// When this Report Type was latest updated. - /// - /// Measured in seconds since the Unix epoch. - pub updated: Timestamp, - - /// Version of the Report Type. - /// - /// Different versions report with the same ID will have the same purpose, but may take different run parameters or have different result schemas. - pub version: i64, -} - -impl Object for ReportingReportType { - type Id = ReportingReportTypeId; - fn id(&self) -> Self::Id { - self.id.clone() - } - fn object(&self) -> &'static str { - "reporting.report_type" - } -} diff --git a/src/resources/generated/reporting_report_type_updated.rs b/src/resources/generated/reporting_report_type_updated.rs deleted file mode 100644 index 662b670ff..000000000 --- a/src/resources/generated/reporting_report_type_updated.rs +++ /dev/null @@ -1,10 +0,0 @@ -// ====================================== -// This file was automatically generated. -// ====================================== - -use serde::{Deserialize, Serialize}; - -/// The resource representing a Stripe "reporting.report_type.updated". -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct ReportingReportTypeUpdated { -} diff --git a/src/resources/generated/reserve_transaction.rs b/src/resources/generated/reserve_transaction.rs deleted file mode 100644 index 6b7b7da93..000000000 --- a/src/resources/generated/reserve_transaction.rs +++ /dev/null @@ -1,38 +0,0 @@ -// ====================================== -// This file was automatically generated. -// ====================================== - -use serde::{Deserialize, Serialize}; - -use crate::ids::ReserveTransactionId; -use crate::params::Object; -use crate::resources::Currency; - -/// The resource representing a Stripe "ReserveTransaction". -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct ReserveTransaction { - /// Unique identifier for the object. - pub id: ReserveTransactionId, - - pub amount: i64, - - /// Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. - /// - /// Must be a [supported currency](https://stripe.com/docs/currencies). - pub currency: Currency, - - /// An arbitrary string attached to the object. - /// - /// Often useful for displaying to users. - pub description: Option, -} - -impl Object for ReserveTransaction { - type Id = ReserveTransactionId; - fn id(&self) -> Self::Id { - self.id.clone() - } - fn object(&self) -> &'static str { - "reserve_transaction" - } -} diff --git a/src/resources/generated/review.rs b/src/resources/generated/review.rs deleted file mode 100644 index 3cb8a20f3..000000000 --- a/src/resources/generated/review.rs +++ /dev/null @@ -1,245 +0,0 @@ -// ====================================== -// This file was automatically generated. -// ====================================== - -use serde::{Deserialize, Serialize}; - -use crate::client::{Client, Response}; -use crate::ids::ReviewId; -use crate::params::{Expand, Expandable, List, Object, Paginable, RangeQuery, Timestamp}; -use crate::resources::{Charge, PaymentIntent, ReviewReason}; - -/// The resource representing a Stripe "RadarReview". -/// -/// For more details see -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct Review { - /// Unique identifier for the object. - pub id: ReviewId, - - /// The ZIP or postal code of the card used, if applicable. - pub billing_zip: Option, - - /// The charge associated with this review. - pub charge: Option>, - - /// The reason the review was closed, or null if it has not yet been closed. - /// - /// One of `approved`, `refunded`, `refunded_as_fraud`, `disputed`, or `redacted`. - pub closed_reason: Option, - - /// Time at which the object was created. - /// - /// Measured in seconds since the Unix epoch. - pub created: Timestamp, - - /// The IP address where the payment originated. - pub ip_address: Option, - - /// Information related to the location of the payment. - /// - /// Note that this information is an approximation and attempts to locate the nearest population center - it should not be used to determine a specific address. - pub ip_address_location: Option, - - /// Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. - pub livemode: bool, - - /// If `true`, the review needs action. - pub open: bool, - - /// The reason the review was opened. - /// - /// One of `rule` or `manual`. - pub opened_reason: ReviewOpenedReason, - - /// The PaymentIntent ID associated with this review, if one exists. - #[serde(skip_serializing_if = "Option::is_none")] - pub payment_intent: Option>, - - /// The reason the review is currently open or closed. - /// - /// One of `rule`, `manual`, `approved`, `refunded`, `refunded_as_fraud`, `disputed`, or `redacted`. - pub reason: ReviewReason, - - /// Information related to the browsing session of the user who initiated the payment. - pub session: Option, -} - -impl Review { - /// Returns a list of `Review` objects that have `open` set to `true`. - /// - /// The objects are sorted in descending order by creation date, with the most recently created object appearing first. - pub fn list(client: &Client, params: &ListReviews<'_>) -> Response> { - client.get_query("/reviews", ¶ms) - } - - /// Retrieves a `Review` object. - pub fn retrieve(client: &Client, id: &ReviewId, expand: &[&str]) -> Response { - client.get_query(&format!("/reviews/{}", id), &Expand { expand }) - } -} - -impl Object for Review { - type Id = ReviewId; - fn id(&self) -> Self::Id { - self.id.clone() - } - fn object(&self) -> &'static str { - "review" - } -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct RadarReviewResourceLocation { - /// The city where the payment originated. - pub city: Option, - - /// Two-letter ISO code representing the country where the payment originated. - pub country: Option, - - /// The geographic latitude where the payment originated. - pub latitude: Option, - - /// The geographic longitude where the payment originated. - pub longitude: Option, - - /// The state/county/province/region where the payment originated. - pub region: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct RadarReviewResourceSession { - /// The browser used in this browser session (e.g., `Chrome`). - pub browser: Option, - - /// Information about the device used for the browser session (e.g., `Samsung SM-G930T`). - pub device: Option, - - /// The platform for the browser session (e.g., `Macintosh`). - pub platform: Option, - - /// The version for the browser session (e.g., `61.0.3163.100`). - pub version: Option, -} - -/// The parameters for `Review::list`. -#[derive(Clone, Debug, Serialize, Default)] -pub struct ListReviews<'a> { - #[serde(skip_serializing_if = "Option::is_none")] - pub created: Option>, - - /// A cursor for use in pagination. - /// - /// `ending_before` is an object ID that defines your place in the list. - /// For instance, if you make a list request and receive 100 objects, starting with `obj_bar`, your subsequent call can include `ending_before=obj_bar` in order to fetch the previous page of the list. - #[serde(skip_serializing_if = "Option::is_none")] - pub ending_before: Option, - - /// Specifies which fields in the response should be expanded. - #[serde(skip_serializing_if = "Expand::is_empty")] - pub expand: &'a [&'a str], - - /// A limit on the number of objects to be returned. - /// - /// Limit can range between 1 and 100, and the default is 10. - #[serde(skip_serializing_if = "Option::is_none")] - pub limit: Option, - - /// A cursor for use in pagination. - /// - /// `starting_after` is an object ID that defines your place in the list. - /// For instance, if you make a list request and receive 100 objects, ending with `obj_foo`, your subsequent call can include `starting_after=obj_foo` in order to fetch the next page of the list. - #[serde(skip_serializing_if = "Option::is_none")] - pub starting_after: Option, -} - -impl<'a> ListReviews<'a> { - pub fn new() -> Self { - ListReviews { - created: Default::default(), - ending_before: Default::default(), - expand: Default::default(), - limit: Default::default(), - starting_after: Default::default(), - } - } -} -impl Paginable for ListReviews<'_> { - type O = Review; - fn set_last(&mut self, item: Self::O) { - self.starting_after = Some(item.id()); - } -} -/// An enum representing the possible values of an `Review`'s `closed_reason` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum ReviewClosedReason { - Approved, - Disputed, - Redacted, - Refunded, - RefundedAsFraud, -} - -impl ReviewClosedReason { - pub fn as_str(self) -> &'static str { - match self { - ReviewClosedReason::Approved => "approved", - ReviewClosedReason::Disputed => "disputed", - ReviewClosedReason::Redacted => "redacted", - ReviewClosedReason::Refunded => "refunded", - ReviewClosedReason::RefundedAsFraud => "refunded_as_fraud", - } - } -} - -impl AsRef for ReviewClosedReason { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for ReviewClosedReason { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for ReviewClosedReason { - fn default() -> Self { - Self::Approved - } -} - -/// An enum representing the possible values of an `Review`'s `opened_reason` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum ReviewOpenedReason { - Manual, - Rule, -} - -impl ReviewOpenedReason { - pub fn as_str(self) -> &'static str { - match self { - ReviewOpenedReason::Manual => "manual", - ReviewOpenedReason::Rule => "rule", - } - } -} - -impl AsRef for ReviewOpenedReason { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for ReviewOpenedReason { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for ReviewOpenedReason { - fn default() -> Self { - Self::Manual - } -} diff --git a/src/resources/generated/review_closed.rs b/src/resources/generated/review_closed.rs deleted file mode 100644 index 454024d95..000000000 --- a/src/resources/generated/review_closed.rs +++ /dev/null @@ -1,10 +0,0 @@ -// ====================================== -// This file was automatically generated. -// ====================================== - -use serde::{Deserialize, Serialize}; - -/// The resource representing a Stripe "review.closed". -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct ReviewClosed { -} diff --git a/src/resources/generated/review_opened.rs b/src/resources/generated/review_opened.rs deleted file mode 100644 index cd1d18998..000000000 --- a/src/resources/generated/review_opened.rs +++ /dev/null @@ -1,10 +0,0 @@ -// ====================================== -// This file was automatically generated. -// ====================================== - -use serde::{Deserialize, Serialize}; - -/// The resource representing a Stripe "review.opened". -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct ReviewOpened { -} diff --git a/src/resources/generated/scheduled_query_run.rs b/src/resources/generated/scheduled_query_run.rs deleted file mode 100644 index 0391e91d6..000000000 --- a/src/resources/generated/scheduled_query_run.rs +++ /dev/null @@ -1,63 +0,0 @@ -// ====================================== -// This file was automatically generated. -// ====================================== - -use serde::{Deserialize, Serialize}; - -use crate::ids::ScheduledQueryRunId; -use crate::params::{Object, Timestamp}; -use crate::resources::File; - -/// The resource representing a Stripe "ScheduledQueryRun". -/// -/// For more details see -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct ScheduledQueryRun { - /// Unique identifier for the object. - pub id: ScheduledQueryRunId, - - /// Time at which the object was created. - /// - /// Measured in seconds since the Unix epoch. - pub created: Timestamp, - - /// When the query was run, Sigma contained a snapshot of your Stripe data at this time. - pub data_load_time: Timestamp, - - #[serde(skip_serializing_if = "Option::is_none")] - pub error: Option, - - /// The file object representing the results of the query. - pub file: Option, - - /// Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. - pub livemode: bool, - - /// Time at which the result expires and is no longer available for download. - pub result_available_until: Timestamp, - - /// SQL for the query. - pub sql: String, - - /// The query's execution status, which will be `completed` for successful runs, and `canceled`, `failed`, or `timed_out` otherwise. - pub status: String, - - /// Title of the query. - pub title: String, -} - -impl Object for ScheduledQueryRun { - type Id = ScheduledQueryRunId; - fn id(&self) -> Self::Id { - self.id.clone() - } - fn object(&self) -> &'static str { - "scheduled_query_run" - } -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct SigmaScheduledQueryRunError { - /// Information about the run failure. - pub message: String, -} diff --git a/src/resources/generated/setup_attempt.rs b/src/resources/generated/setup_attempt.rs deleted file mode 100644 index 3a920a65d..000000000 --- a/src/resources/generated/setup_attempt.rs +++ /dev/null @@ -1,937 +0,0 @@ -// ====================================== -// This file was automatically generated. -// ====================================== - -use serde::{Deserialize, Serialize}; - -use crate::client::{Client, Response}; -use crate::ids::{SetupAttemptId, SetupIntentId}; -use crate::params::{Expand, Expandable, List, Object, Paginable, RangeQuery, Timestamp}; -use crate::resources::{ - Account, ApiErrors, Application, Customer, Mandate, PaymentMethod, - PaymentMethodDetailsCardWalletApplePay, PaymentMethodDetailsCardWalletGooglePay, SetupIntent, -}; - -/// The resource representing a Stripe "PaymentFlowsSetupIntentSetupAttempt". -/// -/// For more details see -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct SetupAttempt { - /// Unique identifier for the object. - pub id: SetupAttemptId, - - /// The value of [application](https://stripe.com/docs/api/setup_intents/object#setup_intent_object-application) on the SetupIntent at the time of this confirmation. - pub application: Option>, - - /// If present, the SetupIntent's payment method will be attached to the in-context Stripe Account. - /// - /// It can only be used for this Stripe Account’s own money movement flows like InboundTransfer and OutboundTransfers. - /// - /// It cannot be set to true when setting up a PaymentMethod for a Customer, and defaults to false when attaching a PaymentMethod to a Customer. - #[serde(skip_serializing_if = "Option::is_none")] - pub attach_to_self: Option, - - /// Time at which the object was created. - /// - /// Measured in seconds since the Unix epoch. - pub created: Timestamp, - - /// The value of [customer](https://stripe.com/docs/api/setup_intents/object#setup_intent_object-customer) on the SetupIntent at the time of this confirmation. - pub customer: Option>, - - /// Indicates the directions of money movement for which this payment method is intended to be used. - /// - /// Include `inbound` if you intend to use the payment method as the origin to pull funds from. - /// - /// Include `outbound` if you intend to use the payment method as the destination to send funds to. - /// You can include both if you intend to use the payment method for both purposes. - pub flow_directions: Option>, - - /// Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. - pub livemode: bool, - - /// The value of [on_behalf_of](https://stripe.com/docs/api/setup_intents/object#setup_intent_object-on_behalf_of) on the SetupIntent at the time of this confirmation. - pub on_behalf_of: Option>, - - /// ID of the payment method used with this SetupAttempt. - pub payment_method: Expandable, - - pub payment_method_details: SetupAttemptPaymentMethodDetails, - - /// The error encountered during this attempt to confirm the SetupIntent, if any. - pub setup_error: Option>, - - /// ID of the SetupIntent that this attempt belongs to. - pub setup_intent: Expandable, - - /// Status of this SetupAttempt, one of `requires_confirmation`, `requires_action`, `processing`, `succeeded`, `failed`, or `abandoned`. - pub status: String, - - /// The value of [usage](https://stripe.com/docs/api/setup_intents/object#setup_intent_object-usage) on the SetupIntent at the time of this confirmation, one of `off_session` or `on_session`. - pub usage: String, -} - -impl SetupAttempt { - /// Returns a list of SetupAttempts that associate with a provided SetupIntent. - pub fn list(client: &Client, params: &ListSetupAttempts<'_>) -> Response> { - client.get_query("/setup_attempts", ¶ms) - } -} - -impl Object for SetupAttempt { - type Id = SetupAttemptId; - fn id(&self) -> Self::Id { - self.id.clone() - } - fn object(&self) -> &'static str { - "setup_attempt" - } -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct SetupAttemptPaymentMethodDetails { - #[serde(skip_serializing_if = "Option::is_none")] - pub acss_debit: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub au_becs_debit: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub bacs_debit: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub bancontact: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub boleto: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub card: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub card_present: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub cashapp: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub ideal: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub klarna: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub link: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub paypal: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub sepa_debit: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub sofort: Option, - - /// The type of the payment method used in the SetupIntent (e.g., `card`). - /// - /// An additional hash is included on `payment_method_details` with a name matching this value. - /// It contains confirmation-specific information for the payment method. - #[serde(rename = "type")] - pub type_: String, - - #[serde(skip_serializing_if = "Option::is_none")] - pub us_bank_account: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct SetupAttemptPaymentMethodDetailsAcssDebit {} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct SetupAttemptPaymentMethodDetailsAuBecsDebit {} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct SetupAttemptPaymentMethodDetailsBacsDebit {} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct SetupAttemptPaymentMethodDetailsBancontact { - /// Bank code of bank associated with the bank account. - pub bank_code: Option, - - /// Name of the bank associated with the bank account. - pub bank_name: Option, - - /// Bank Identifier Code of the bank associated with the bank account. - pub bic: Option, - - /// The ID of the SEPA Direct Debit PaymentMethod which was generated by this SetupAttempt. - pub generated_sepa_debit: Option>, - - /// The mandate for the SEPA Direct Debit PaymentMethod which was generated by this SetupAttempt. - pub generated_sepa_debit_mandate: Option>, - - /// Last four characters of the IBAN. - pub iban_last4: Option, - - /// Preferred language of the Bancontact authorization page that the customer is redirected to. - /// Can be one of `en`, `de`, `fr`, or `nl`. - pub preferred_language: Option, - - /// Owner's verified full name. - /// - /// Values are verified or provided by Bancontact directly (if supported) at the time of authorization or settlement. - /// They cannot be set or mutated. - pub verified_name: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct SetupAttemptPaymentMethodDetailsBoleto {} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct SetupAttemptPaymentMethodDetailsCard { - /// Card brand. - /// - /// Can be `amex`, `diners`, `discover`, `eftpos_au`, `jcb`, `mastercard`, `unionpay`, `visa`, or `unknown`. - pub brand: Option, - - /// Check results by Card networks on Card address and CVC at the time of authorization. - pub checks: Option, - - /// Two-letter ISO code representing the country of the card. - /// - /// You could use this attribute to get a sense of the international breakdown of cards you've collected. - pub country: Option, - - /// A high-level description of the type of cards issued in this range. - /// - /// (For internal use only and not typically available in standard API requests.). - #[serde(skip_serializing_if = "Option::is_none")] - pub description: Option, - - /// Two-digit number representing the card's expiration month. - pub exp_month: Option, - - /// Four-digit number representing the card's expiration year. - pub exp_year: Option, - - /// Uniquely identifies this particular card number. - /// - /// You can use this attribute to check whether two customers who’ve signed up with you are using the same card number, for example. - /// For payment methods that tokenize card information (Apple Pay, Google Pay), the tokenized number might be provided instead of the underlying card number. *As of May 1, 2021, card fingerprint in India for Connect changed to allow two fingerprints for the same card---one for India and one for the rest of the world.*. - #[serde(skip_serializing_if = "Option::is_none")] - pub fingerprint: Option, - - /// Card funding type. - /// - /// Can be `credit`, `debit`, `prepaid`, or `unknown`. - pub funding: Option, - - /// Issuer identification number of the card. - /// - /// (For internal use only and not typically available in standard API requests.). - #[serde(skip_serializing_if = "Option::is_none")] - pub iin: Option, - - /// The name of the card's issuing bank. - /// - /// (For internal use only and not typically available in standard API requests.). - #[serde(skip_serializing_if = "Option::is_none")] - pub issuer: Option, - - /// The last four digits of the card. - pub last4: Option, - - /// Identifies which network this charge was processed on. - /// - /// Can be `amex`, `cartes_bancaires`, `diners`, `discover`, `eftpos_au`, `interac`, `jcb`, `mastercard`, `unionpay`, `visa`, or `unknown`. - pub network: Option, - - /// Populated if this authorization used 3D Secure authentication. - pub three_d_secure: Option, - - /// If this Card is part of a card wallet, this contains the details of the card wallet. - pub wallet: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct SetupAttemptPaymentMethodDetailsCardChecks { - /// If a address line1 was provided, results of the check, one of `pass`, `fail`, `unavailable`, or `unchecked`. - pub address_line1_check: Option, - - /// If a address postal code was provided, results of the check, one of `pass`, `fail`, `unavailable`, or `unchecked`. - pub address_postal_code_check: Option, - - /// If a CVC was provided, results of the check, one of `pass`, `fail`, `unavailable`, or `unchecked`. - pub cvc_check: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct SetupAttemptPaymentMethodDetailsCardPresent { - /// The ID of the Card PaymentMethod which was generated by this SetupAttempt. - pub generated_card: Option>, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct SetupAttemptPaymentMethodDetailsCardWallet { - #[serde(skip_serializing_if = "Option::is_none")] - pub apple_pay: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub google_pay: Option, - - /// The type of the card wallet, one of `apple_pay`, `google_pay`, or `link`. - /// - /// An additional hash is included on the Wallet subhash with a name matching this value. - /// It contains additional information specific to the card wallet type. - #[serde(rename = "type")] - pub type_: SetupAttemptPaymentMethodDetailsCardWalletType, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct SetupAttemptPaymentMethodDetailsCashapp {} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct SetupAttemptPaymentMethodDetailsIdeal { - /// The customer's bank. - /// - /// Can be one of `abn_amro`, `asn_bank`, `bunq`, `handelsbanken`, `ing`, `knab`, `moneyou`, `n26`, `nn`, `rabobank`, `regiobank`, `revolut`, `sns_bank`, `triodos_bank`, `van_lanschot`, or `yoursafe`. - pub bank: Option, - - /// The Bank Identifier Code of the customer's bank. - pub bic: Option, - - /// The ID of the SEPA Direct Debit PaymentMethod which was generated by this SetupAttempt. - pub generated_sepa_debit: Option>, - - /// The mandate for the SEPA Direct Debit PaymentMethod which was generated by this SetupAttempt. - pub generated_sepa_debit_mandate: Option>, - - /// Last four characters of the IBAN. - pub iban_last4: Option, - - /// Owner's verified full name. - /// - /// Values are verified or provided by iDEAL directly (if supported) at the time of authorization or settlement. - /// They cannot be set or mutated. - pub verified_name: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct SetupAttemptPaymentMethodDetailsKlarna {} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct SetupAttemptPaymentMethodDetailsLink {} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct SetupAttemptPaymentMethodDetailsPaypal {} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct SetupAttemptPaymentMethodDetailsSepaDebit {} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct SetupAttemptPaymentMethodDetailsSofort { - /// Bank code of bank associated with the bank account. - pub bank_code: Option, - - /// Name of the bank associated with the bank account. - pub bank_name: Option, - - /// Bank Identifier Code of the bank associated with the bank account. - pub bic: Option, - - /// The ID of the SEPA Direct Debit PaymentMethod which was generated by this SetupAttempt. - pub generated_sepa_debit: Option>, - - /// The mandate for the SEPA Direct Debit PaymentMethod which was generated by this SetupAttempt. - pub generated_sepa_debit_mandate: Option>, - - /// Last four characters of the IBAN. - pub iban_last4: Option, - - /// Preferred language of the Sofort authorization page that the customer is redirected to. - /// Can be one of `en`, `de`, `fr`, or `nl`. - pub preferred_language: Option, - - /// Owner's verified full name. - /// - /// Values are verified or provided by Sofort directly (if supported) at the time of authorization or settlement. - /// They cannot be set or mutated. - pub verified_name: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct SetupAttemptPaymentMethodDetailsUsBankAccount {} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct ThreeDSecureDetails { - /// For authenticated transactions: how the customer was authenticated by - /// the issuing bank. - pub authentication_flow: Option, - - /// The Electronic Commerce Indicator (ECI). - /// - /// A protocol-level field indicating what degree of authentication was performed. - pub electronic_commerce_indicator: Option, - - /// Indicates the outcome of 3D Secure authentication. - pub result: Option, - - /// Additional information about why 3D Secure succeeded or failed based - /// on the `result`. - pub result_reason: Option, - - /// The 3D Secure 1 XID or 3D Secure 2 Directory Server Transaction ID - /// (dsTransId) for this payment. - pub transaction_id: Option, - - /// The version of 3D Secure that was used. - pub version: Option, -} - -/// The parameters for `SetupAttempt::list`. -#[derive(Clone, Debug, Serialize)] -pub struct ListSetupAttempts<'a> { - /// A filter on the list, based on the object `created` field. - /// - /// The value can be a string with an integer Unix timestamp or a dictionary with a number of different query options. - #[serde(skip_serializing_if = "Option::is_none")] - pub created: Option>, - - /// A cursor for use in pagination. - /// - /// `ending_before` is an object ID that defines your place in the list. - /// For instance, if you make a list request and receive 100 objects, starting with `obj_bar`, your subsequent call can include `ending_before=obj_bar` in order to fetch the previous page of the list. - #[serde(skip_serializing_if = "Option::is_none")] - pub ending_before: Option, - - /// Specifies which fields in the response should be expanded. - #[serde(skip_serializing_if = "Expand::is_empty")] - pub expand: &'a [&'a str], - - /// A limit on the number of objects to be returned. - /// - /// Limit can range between 1 and 100, and the default is 10. - #[serde(skip_serializing_if = "Option::is_none")] - pub limit: Option, - - /// Only return SetupAttempts created by the SetupIntent specified by - /// this ID. - pub setup_intent: SetupIntentId, - - /// A cursor for use in pagination. - /// - /// `starting_after` is an object ID that defines your place in the list. - /// For instance, if you make a list request and receive 100 objects, ending with `obj_foo`, your subsequent call can include `starting_after=obj_foo` in order to fetch the next page of the list. - #[serde(skip_serializing_if = "Option::is_none")] - pub starting_after: Option, -} - -impl<'a> ListSetupAttempts<'a> { - pub fn new(setup_intent: SetupIntentId) -> Self { - ListSetupAttempts { - created: Default::default(), - ending_before: Default::default(), - expand: Default::default(), - limit: Default::default(), - setup_intent, - starting_after: Default::default(), - } - } -} -impl Paginable for ListSetupAttempts<'_> { - type O = SetupAttempt; - fn set_last(&mut self, item: Self::O) { - self.starting_after = Some(item.id()); - } -} -/// An enum representing the possible values of an `SetupAttempt`'s `flow_directions` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum SetupAttemptFlowDirections { - Inbound, - Outbound, -} - -impl SetupAttemptFlowDirections { - pub fn as_str(self) -> &'static str { - match self { - SetupAttemptFlowDirections::Inbound => "inbound", - SetupAttemptFlowDirections::Outbound => "outbound", - } - } -} - -impl AsRef for SetupAttemptFlowDirections { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for SetupAttemptFlowDirections { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for SetupAttemptFlowDirections { - fn default() -> Self { - Self::Inbound - } -} - -/// An enum representing the possible values of an `SetupAttemptPaymentMethodDetailsBancontact`'s `preferred_language` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum SetupAttemptPaymentMethodDetailsBancontactPreferredLanguage { - De, - En, - Fr, - Nl, -} - -impl SetupAttemptPaymentMethodDetailsBancontactPreferredLanguage { - pub fn as_str(self) -> &'static str { - match self { - SetupAttemptPaymentMethodDetailsBancontactPreferredLanguage::De => "de", - SetupAttemptPaymentMethodDetailsBancontactPreferredLanguage::En => "en", - SetupAttemptPaymentMethodDetailsBancontactPreferredLanguage::Fr => "fr", - SetupAttemptPaymentMethodDetailsBancontactPreferredLanguage::Nl => "nl", - } - } -} - -impl AsRef for SetupAttemptPaymentMethodDetailsBancontactPreferredLanguage { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for SetupAttemptPaymentMethodDetailsBancontactPreferredLanguage { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for SetupAttemptPaymentMethodDetailsBancontactPreferredLanguage { - fn default() -> Self { - Self::De - } -} - -/// An enum representing the possible values of an `SetupAttemptPaymentMethodDetailsCardWallet`'s `type` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum SetupAttemptPaymentMethodDetailsCardWalletType { - ApplePay, - GooglePay, - Link, -} - -impl SetupAttemptPaymentMethodDetailsCardWalletType { - pub fn as_str(self) -> &'static str { - match self { - SetupAttemptPaymentMethodDetailsCardWalletType::ApplePay => "apple_pay", - SetupAttemptPaymentMethodDetailsCardWalletType::GooglePay => "google_pay", - SetupAttemptPaymentMethodDetailsCardWalletType::Link => "link", - } - } -} - -impl AsRef for SetupAttemptPaymentMethodDetailsCardWalletType { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for SetupAttemptPaymentMethodDetailsCardWalletType { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for SetupAttemptPaymentMethodDetailsCardWalletType { - fn default() -> Self { - Self::ApplePay - } -} - -/// An enum representing the possible values of an `SetupAttemptPaymentMethodDetailsIdeal`'s `bank` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum SetupAttemptPaymentMethodDetailsIdealBank { - AbnAmro, - AsnBank, - Bunq, - Handelsbanken, - Ing, - Knab, - Moneyou, - N26, - Nn, - Rabobank, - Regiobank, - Revolut, - SnsBank, - TriodosBank, - VanLanschot, - Yoursafe, -} - -impl SetupAttemptPaymentMethodDetailsIdealBank { - pub fn as_str(self) -> &'static str { - match self { - SetupAttemptPaymentMethodDetailsIdealBank::AbnAmro => "abn_amro", - SetupAttemptPaymentMethodDetailsIdealBank::AsnBank => "asn_bank", - SetupAttemptPaymentMethodDetailsIdealBank::Bunq => "bunq", - SetupAttemptPaymentMethodDetailsIdealBank::Handelsbanken => "handelsbanken", - SetupAttemptPaymentMethodDetailsIdealBank::Ing => "ing", - SetupAttemptPaymentMethodDetailsIdealBank::Knab => "knab", - SetupAttemptPaymentMethodDetailsIdealBank::Moneyou => "moneyou", - SetupAttemptPaymentMethodDetailsIdealBank::N26 => "n26", - SetupAttemptPaymentMethodDetailsIdealBank::Nn => "nn", - SetupAttemptPaymentMethodDetailsIdealBank::Rabobank => "rabobank", - SetupAttemptPaymentMethodDetailsIdealBank::Regiobank => "regiobank", - SetupAttemptPaymentMethodDetailsIdealBank::Revolut => "revolut", - SetupAttemptPaymentMethodDetailsIdealBank::SnsBank => "sns_bank", - SetupAttemptPaymentMethodDetailsIdealBank::TriodosBank => "triodos_bank", - SetupAttemptPaymentMethodDetailsIdealBank::VanLanschot => "van_lanschot", - SetupAttemptPaymentMethodDetailsIdealBank::Yoursafe => "yoursafe", - } - } -} - -impl AsRef for SetupAttemptPaymentMethodDetailsIdealBank { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for SetupAttemptPaymentMethodDetailsIdealBank { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for SetupAttemptPaymentMethodDetailsIdealBank { - fn default() -> Self { - Self::AbnAmro - } -} - -/// An enum representing the possible values of an `SetupAttemptPaymentMethodDetailsIdeal`'s `bic` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum SetupAttemptPaymentMethodDetailsIdealBic { - #[serde(rename = "ABNANL2A")] - Abnanl2a, - #[serde(rename = "ASNBNL21")] - Asnbnl21, - #[serde(rename = "BITSNL2A")] - Bitsnl2a, - #[serde(rename = "BUNQNL2A")] - Bunqnl2a, - #[serde(rename = "FVLBNL22")] - Fvlbnl22, - #[serde(rename = "HANDNL2A")] - Handnl2a, - #[serde(rename = "INGBNL2A")] - Ingbnl2a, - #[serde(rename = "KNABNL2H")] - Knabnl2h, - #[serde(rename = "MOYONL21")] - Moyonl21, - #[serde(rename = "NNBANL2G")] - Nnbanl2g, - #[serde(rename = "NTSBDEB1")] - Ntsbdeb1, - #[serde(rename = "RABONL2U")] - Rabonl2u, - #[serde(rename = "RBRBNL21")] - Rbrbnl21, - #[serde(rename = "REVOIE23")] - Revoie23, - #[serde(rename = "REVOLT21")] - Revolt21, - #[serde(rename = "SNSBNL2A")] - Snsbnl2a, - #[serde(rename = "TRIONL2U")] - Trionl2u, -} - -impl SetupAttemptPaymentMethodDetailsIdealBic { - pub fn as_str(self) -> &'static str { - match self { - SetupAttemptPaymentMethodDetailsIdealBic::Abnanl2a => "ABNANL2A", - SetupAttemptPaymentMethodDetailsIdealBic::Asnbnl21 => "ASNBNL21", - SetupAttemptPaymentMethodDetailsIdealBic::Bitsnl2a => "BITSNL2A", - SetupAttemptPaymentMethodDetailsIdealBic::Bunqnl2a => "BUNQNL2A", - SetupAttemptPaymentMethodDetailsIdealBic::Fvlbnl22 => "FVLBNL22", - SetupAttemptPaymentMethodDetailsIdealBic::Handnl2a => "HANDNL2A", - SetupAttemptPaymentMethodDetailsIdealBic::Ingbnl2a => "INGBNL2A", - SetupAttemptPaymentMethodDetailsIdealBic::Knabnl2h => "KNABNL2H", - SetupAttemptPaymentMethodDetailsIdealBic::Moyonl21 => "MOYONL21", - SetupAttemptPaymentMethodDetailsIdealBic::Nnbanl2g => "NNBANL2G", - SetupAttemptPaymentMethodDetailsIdealBic::Ntsbdeb1 => "NTSBDEB1", - SetupAttemptPaymentMethodDetailsIdealBic::Rabonl2u => "RABONL2U", - SetupAttemptPaymentMethodDetailsIdealBic::Rbrbnl21 => "RBRBNL21", - SetupAttemptPaymentMethodDetailsIdealBic::Revoie23 => "REVOIE23", - SetupAttemptPaymentMethodDetailsIdealBic::Revolt21 => "REVOLT21", - SetupAttemptPaymentMethodDetailsIdealBic::Snsbnl2a => "SNSBNL2A", - SetupAttemptPaymentMethodDetailsIdealBic::Trionl2u => "TRIONL2U", - } - } -} - -impl AsRef for SetupAttemptPaymentMethodDetailsIdealBic { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for SetupAttemptPaymentMethodDetailsIdealBic { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for SetupAttemptPaymentMethodDetailsIdealBic { - fn default() -> Self { - Self::Abnanl2a - } -} - -/// An enum representing the possible values of an `SetupAttemptPaymentMethodDetailsSofort`'s `preferred_language` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum SetupAttemptPaymentMethodDetailsSofortPreferredLanguage { - De, - En, - Fr, - Nl, -} - -impl SetupAttemptPaymentMethodDetailsSofortPreferredLanguage { - pub fn as_str(self) -> &'static str { - match self { - SetupAttemptPaymentMethodDetailsSofortPreferredLanguage::De => "de", - SetupAttemptPaymentMethodDetailsSofortPreferredLanguage::En => "en", - SetupAttemptPaymentMethodDetailsSofortPreferredLanguage::Fr => "fr", - SetupAttemptPaymentMethodDetailsSofortPreferredLanguage::Nl => "nl", - } - } -} - -impl AsRef for SetupAttemptPaymentMethodDetailsSofortPreferredLanguage { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for SetupAttemptPaymentMethodDetailsSofortPreferredLanguage { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for SetupAttemptPaymentMethodDetailsSofortPreferredLanguage { - fn default() -> Self { - Self::De - } -} - -/// An enum representing the possible values of an `ThreeDSecureDetails`'s `authentication_flow` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum ThreeDSecureDetailsAuthenticationFlow { - Challenge, - Frictionless, -} - -impl ThreeDSecureDetailsAuthenticationFlow { - pub fn as_str(self) -> &'static str { - match self { - ThreeDSecureDetailsAuthenticationFlow::Challenge => "challenge", - ThreeDSecureDetailsAuthenticationFlow::Frictionless => "frictionless", - } - } -} - -impl AsRef for ThreeDSecureDetailsAuthenticationFlow { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for ThreeDSecureDetailsAuthenticationFlow { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for ThreeDSecureDetailsAuthenticationFlow { - fn default() -> Self { - Self::Challenge - } -} - -/// An enum representing the possible values of an `ThreeDSecureDetails`'s `electronic_commerce_indicator` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum ThreeDSecureDetailsElectronicCommerceIndicator { - #[serde(rename = "01")] - V01, - #[serde(rename = "02")] - V02, - #[serde(rename = "05")] - V05, - #[serde(rename = "06")] - V06, - #[serde(rename = "07")] - V07, -} - -impl ThreeDSecureDetailsElectronicCommerceIndicator { - pub fn as_str(self) -> &'static str { - match self { - ThreeDSecureDetailsElectronicCommerceIndicator::V01 => "01", - ThreeDSecureDetailsElectronicCommerceIndicator::V02 => "02", - ThreeDSecureDetailsElectronicCommerceIndicator::V05 => "05", - ThreeDSecureDetailsElectronicCommerceIndicator::V06 => "06", - ThreeDSecureDetailsElectronicCommerceIndicator::V07 => "07", - } - } -} - -impl AsRef for ThreeDSecureDetailsElectronicCommerceIndicator { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for ThreeDSecureDetailsElectronicCommerceIndicator { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for ThreeDSecureDetailsElectronicCommerceIndicator { - fn default() -> Self { - Self::V01 - } -} - -/// An enum representing the possible values of an `ThreeDSecureDetails`'s `result` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum ThreeDSecureDetailsResult { - AttemptAcknowledged, - Authenticated, - Exempted, - Failed, - NotSupported, - ProcessingError, -} - -impl ThreeDSecureDetailsResult { - pub fn as_str(self) -> &'static str { - match self { - ThreeDSecureDetailsResult::AttemptAcknowledged => "attempt_acknowledged", - ThreeDSecureDetailsResult::Authenticated => "authenticated", - ThreeDSecureDetailsResult::Exempted => "exempted", - ThreeDSecureDetailsResult::Failed => "failed", - ThreeDSecureDetailsResult::NotSupported => "not_supported", - ThreeDSecureDetailsResult::ProcessingError => "processing_error", - } - } -} - -impl AsRef for ThreeDSecureDetailsResult { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for ThreeDSecureDetailsResult { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for ThreeDSecureDetailsResult { - fn default() -> Self { - Self::AttemptAcknowledged - } -} - -/// An enum representing the possible values of an `ThreeDSecureDetails`'s `result_reason` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum ThreeDSecureDetailsResultReason { - Abandoned, - Bypassed, - Canceled, - CardNotEnrolled, - NetworkNotSupported, - ProtocolError, - Rejected, -} - -impl ThreeDSecureDetailsResultReason { - pub fn as_str(self) -> &'static str { - match self { - ThreeDSecureDetailsResultReason::Abandoned => "abandoned", - ThreeDSecureDetailsResultReason::Bypassed => "bypassed", - ThreeDSecureDetailsResultReason::Canceled => "canceled", - ThreeDSecureDetailsResultReason::CardNotEnrolled => "card_not_enrolled", - ThreeDSecureDetailsResultReason::NetworkNotSupported => "network_not_supported", - ThreeDSecureDetailsResultReason::ProtocolError => "protocol_error", - ThreeDSecureDetailsResultReason::Rejected => "rejected", - } - } -} - -impl AsRef for ThreeDSecureDetailsResultReason { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for ThreeDSecureDetailsResultReason { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for ThreeDSecureDetailsResultReason { - fn default() -> Self { - Self::Abandoned - } -} - -/// An enum representing the possible values of an `ThreeDSecureDetails`'s `version` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum ThreeDSecureDetailsVersion { - #[serde(rename = "1.0.2")] - V1_0_2, - #[serde(rename = "2.1.0")] - V2_1_0, - #[serde(rename = "2.2.0")] - V2_2_0, -} - -impl ThreeDSecureDetailsVersion { - pub fn as_str(self) -> &'static str { - match self { - ThreeDSecureDetailsVersion::V1_0_2 => "1.0.2", - ThreeDSecureDetailsVersion::V2_1_0 => "2.1.0", - ThreeDSecureDetailsVersion::V2_2_0 => "2.2.0", - } - } -} - -impl AsRef for ThreeDSecureDetailsVersion { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for ThreeDSecureDetailsVersion { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for ThreeDSecureDetailsVersion { - fn default() -> Self { - Self::V1_0_2 - } -} diff --git a/src/resources/generated/setup_intent.rs b/src/resources/generated/setup_intent.rs deleted file mode 100644 index 1decdd8e6..000000000 --- a/src/resources/generated/setup_intent.rs +++ /dev/null @@ -1,5580 +0,0 @@ -// ====================================== -// This file was automatically generated. -// ====================================== - -use serde::{Deserialize, Serialize}; - -use crate::client::{Client, Response}; -use crate::ids::{CustomerId, PaymentMethodConfigurationId, PaymentMethodId, SetupIntentId}; -use crate::params::{Expand, Expandable, List, Metadata, Object, Paginable, RangeQuery, Timestamp}; -use crate::resources::{ - Account, ApiErrors, Application, Currency, Customer, LinkedAccountOptionsUsBankAccount, - Mandate, PaymentIntentNextActionCashappHandleRedirectOrDisplayQrCode, PaymentMethod, - PaymentMethodConfigBizPaymentMethodConfigurationDetails, - PaymentMethodOptionsUsBankAccountMandateOptions, SetupAttempt, -}; - -/// The resource representing a Stripe "SetupIntent". -/// -/// For more details see -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct SetupIntent { - /// Unique identifier for the object. - pub id: SetupIntentId, - - /// ID of the Connect application that created the SetupIntent. - pub application: Option>, - - /// If present, the SetupIntent's payment method will be attached to the in-context Stripe Account. - /// - /// It can only be used for this Stripe Account’s own money movement flows like InboundTransfer and OutboundTransfers. - /// - /// It cannot be set to true when setting up a PaymentMethod for a Customer, and defaults to false when attaching a PaymentMethod to a Customer. - #[serde(skip_serializing_if = "Option::is_none")] - pub attach_to_self: Option, - - /// Settings for dynamic payment methods compatible with this Setup Intent. - pub automatic_payment_methods: Option, - - /// Reason for cancellation of this SetupIntent, one of `abandoned`, `requested_by_customer`, or `duplicate`. - pub cancellation_reason: Option, - - /// The client secret of this SetupIntent. - /// - /// Used for client-side retrieval using a publishable key. The client secret can be used to complete payment setup from your frontend. - /// It should not be stored, logged, or exposed to anyone other than the customer. - /// Make sure that you have TLS enabled on any page that includes the client secret. - pub client_secret: Option, - - /// Time at which the object was created. - /// - /// Measured in seconds since the Unix epoch. - pub created: Timestamp, - - /// ID of the Customer this SetupIntent belongs to, if one exists. - /// - /// If present, the SetupIntent's payment method will be attached to the Customer on successful setup. - /// - /// Payment methods attached to other Customers cannot be used with this SetupIntent. - pub customer: Option>, - - /// An arbitrary string attached to the object. - /// - /// Often useful for displaying to users. - pub description: Option, - - /// Indicates the directions of money movement for which this payment method is intended to be used. - /// - /// Include `inbound` if you intend to use the payment method as the origin to pull funds from. - /// - /// Include `outbound` if you intend to use the payment method as the destination to send funds to. - /// You can include both if you intend to use the payment method for both purposes. - pub flow_directions: Option>, - - /// The error encountered in the previous SetupIntent confirmation. - pub last_setup_error: Option>, - - /// The most recent SetupAttempt for this SetupIntent. - pub latest_attempt: Option>, - - /// Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. - pub livemode: bool, - - /// ID of the multi use Mandate generated by the SetupIntent. - pub mandate: Option>, - - /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. - /// - /// This can be useful for storing additional information about the object in a structured format. - pub metadata: Option, - - /// If present, this property tells you what actions you need to take in order for your customer to continue payment setup. - pub next_action: Option, - - /// The account (if any) for which the setup is intended. - pub on_behalf_of: Option>, - - /// ID of the payment method used with this SetupIntent. - pub payment_method: Option>, - - /// Information about the payment method configuration used for this Setup Intent. - pub payment_method_configuration_details: - Option, - - /// Payment method-specific configuration for this SetupIntent. - pub payment_method_options: Option, - - /// The list of payment method types (e.g. - /// - /// card) that this SetupIntent is allowed to set up. - pub payment_method_types: Vec, - - /// ID of the single_use Mandate generated by the SetupIntent. - pub single_use_mandate: Option>, - - /// [Status](https://stripe.com/docs/payments/intents#intent-statuses) of this SetupIntent, one of `requires_payment_method`, `requires_confirmation`, `requires_action`, `processing`, `canceled`, or `succeeded`. - pub status: SetupIntentStatus, - - /// Indicates how the payment method is intended to be used in the future. - /// - /// Use `on_session` if you intend to only reuse the payment method when the customer is in your checkout flow. - /// - /// Use `off_session` if your customer may or may not be in your checkout flow. - /// If not provided, this value defaults to `off_session`. - pub usage: String, -} - -impl SetupIntent { - /// Returns a list of SetupIntents. - pub fn list(client: &Client, params: &ListSetupIntents<'_>) -> Response> { - client.get_query("/setup_intents", ¶ms) - } - - /// Creates a SetupIntent object. - /// - /// After you create the SetupIntent, attach a payment method and [confirm](https://stripe.com/docs/api/setup_intents/confirm) - /// it to collect any required permissions to charge the payment method later. - pub fn create(client: &Client, params: CreateSetupIntent<'_>) -> Response { - client.post_form("/setup_intents", ¶ms) - } - - /// Retrieves the details of a SetupIntent that has previously been created. - /// - /// Client-side retrieval using a publishable key is allowed when the `client_secret` is provided in the query string. - /// When retrieved with a publishable key, only a subset of properties will be returned. - /// Please refer to the [SetupIntent](https://stripe.com/docs/api#setup_intent_object) object reference for more details. - pub fn retrieve(client: &Client, id: &SetupIntentId, expand: &[&str]) -> Response { - client.get_query(&format!("/setup_intents/{}", id), &Expand { expand }) - } - - /// Updates a SetupIntent object. - pub fn update( - client: &Client, - id: &SetupIntentId, - params: UpdateSetupIntent<'_>, - ) -> Response { - client.post_form(&format!("/setup_intents/{}", id), ¶ms) - } -} - -impl Object for SetupIntent { - type Id = SetupIntentId; - fn id(&self) -> Self::Id { - self.id.clone() - } - fn object(&self) -> &'static str { - "setup_intent" - } -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct PaymentFlowsAutomaticPaymentMethodsSetupIntent { - /// Controls whether this SetupIntent will accept redirect-based payment methods. - /// - /// Redirect-based payment methods may require your customer to be redirected to a payment method's app or site for authentication or additional steps. - /// - /// To [confirm](https://stripe.com/docs/api/setup_intents/confirm) this SetupIntent, you may be required to provide a `return_url` to redirect customers back to your site after they authenticate or complete the setup. - #[serde(skip_serializing_if = "Option::is_none")] - pub allow_redirects: Option, - - /// Automatically calculates compatible payment methods. - pub enabled: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct SetupIntentNextAction { - #[serde(skip_serializing_if = "Option::is_none")] - pub cashapp_handle_redirect_or_display_qr_code: - Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub redirect_to_url: Option, - - /// Type of the next action to perform, one of `redirect_to_url`, `use_stripe_sdk`, `alipay_handle_redirect`, `oxxo_display_details`, or `verify_with_microdeposits`. - #[serde(rename = "type")] - pub type_: String, - - /// When confirming a SetupIntent with Stripe.js, Stripe.js depends on the contents of this dictionary to invoke authentication flows. - /// - /// The shape of the contents is subject to change and is only intended to be used by Stripe.js. - #[serde(skip_serializing_if = "Option::is_none")] - pub use_stripe_sdk: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub verify_with_microdeposits: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct SetupIntentNextActionRedirectToUrl { - /// If the customer does not exit their browser while authenticating, they will be redirected to this specified URL after completion. - pub return_url: Option, - - /// The URL you must redirect your customer to in order to authenticate. - pub url: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct SetupIntentNextActionVerifyWithMicrodeposits { - /// The timestamp when the microdeposits are expected to land. - pub arrival_date: Timestamp, - - /// The URL for the hosted verification page, which allows customers to verify their bank account. - pub hosted_verification_url: String, - - /// The type of the microdeposit sent to the customer. - /// - /// Used to distinguish between different verification methods. - pub microdeposit_type: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct SetupIntentPaymentMethodOptions { - #[serde(skip_serializing_if = "Option::is_none")] - pub acss_debit: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub card: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub link: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub paypal: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub sepa_debit: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub us_bank_account: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct SetupIntentPaymentMethodOptionsAcssDebit { - /// Currency supported by the bank account. - pub currency: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub mandate_options: Option, - - /// Bank account verification method. - #[serde(skip_serializing_if = "Option::is_none")] - pub verification_method: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct SetupIntentPaymentMethodOptionsCard { - /// Configuration options for setting up an eMandate for cards issued in India. - pub mandate_options: Option, - - /// Selected network to process this SetupIntent on. - /// - /// Depends on the available networks of the card attached to the setup intent. - /// Can be only set confirm-time. - pub network: Option, - - /// We strongly recommend that you rely on our SCA Engine to automatically prompt your customers for authentication based on risk level and [other requirements](https://stripe.com/docs/strong-customer-authentication). - /// - /// However, if you wish to request 3D Secure based on logic from your own fraud engine, provide this option. - /// If not provided, this value defaults to `automatic`. - /// Read our guide on [manually requesting 3D Secure](https://stripe.com/docs/payments/3d-secure#manual-three-ds) for more information on how this configuration interacts with Radar and our SCA Engine. - pub request_three_d_secure: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct SetupIntentPaymentMethodOptionsCardMandateOptions { - /// Amount to be charged for future payments. - pub amount: i64, - - /// One of `fixed` or `maximum`. - /// - /// If `fixed`, the `amount` param refers to the exact amount to be charged in future payments. - /// If `maximum`, the amount charged can be up to the value passed for the `amount` param. - pub amount_type: SetupIntentPaymentMethodOptionsCardMandateOptionsAmountType, - - /// Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. - /// - /// Must be a [supported currency](https://stripe.com/docs/currencies). - pub currency: Currency, - - /// A description of the mandate or subscription that is meant to be displayed to the customer. - pub description: Option, - - /// End date of the mandate or subscription. - /// - /// If not provided, the mandate will be active until canceled. - /// If provided, end date should be after start date. - pub end_date: Option, - - /// Specifies payment frequency. - /// - /// One of `day`, `week`, `month`, `year`, or `sporadic`. - pub interval: SetupIntentPaymentMethodOptionsCardMandateOptionsInterval, - - /// The number of intervals between payments. - /// - /// For example, `interval=month` and `interval_count=3` indicates one payment every three months. - /// Maximum of one year interval allowed (1 year, 12 months, or 52 weeks). - /// This parameter is optional when `interval=sporadic`. - pub interval_count: Option, - - /// Unique identifier for the mandate or subscription. - pub reference: String, - - /// Start date of the mandate or subscription. - /// - /// Start date should not be lesser than yesterday. - pub start_date: Timestamp, - - /// Specifies the type of mandates supported. - /// - /// Possible values are `india`. - pub supported_types: - Option>, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct SetupIntentPaymentMethodOptionsLink { - /// [Deprecated] This is a legacy parameter that no longer has any function. - pub persistent_token: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct SetupIntentPaymentMethodOptionsMandateOptionsAcssDebit { - /// A URL for custom mandate text. - #[serde(skip_serializing_if = "Option::is_none")] - pub custom_mandate_url: Option, - - /// List of Stripe products where this mandate can be selected automatically. - #[serde(skip_serializing_if = "Option::is_none")] - pub default_for: Option>, - - /// Description of the interval. - /// - /// Only required if the 'payment_schedule' parameter is 'interval' or 'combined'. - pub interval_description: Option, - - /// Payment schedule for the mandate. - pub payment_schedule: - Option, - - /// Transaction type of the mandate. - pub transaction_type: - Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct SetupIntentPaymentMethodOptionsPaypal { - /// The PayPal Billing Agreement ID (BAID). - /// - /// This is an ID generated by PayPal which represents the mandate between the merchant and the customer. - pub billing_agreement_id: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct SetupIntentPaymentMethodOptionsSepaDebit { - #[serde(skip_serializing_if = "Option::is_none")] - pub mandate_options: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct SetupIntentPaymentMethodOptionsMandateOptionsSepaDebit {} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct SetupIntentPaymentMethodOptionsUsBankAccount { - #[serde(skip_serializing_if = "Option::is_none")] - pub financial_connections: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub mandate_options: Option, - - /// Bank account verification method. - #[serde(skip_serializing_if = "Option::is_none")] - pub verification_method: Option, -} - -/// The parameters for `SetupIntent::create`. -#[derive(Clone, Debug, Serialize, Default)] -pub struct CreateSetupIntent<'a> { - /// If present, the SetupIntent's payment method will be attached to the in-context Stripe Account. - /// - /// It can only be used for this Stripe Account’s own money movement flows like InboundTransfer and OutboundTransfers. - /// - /// It cannot be set to true when setting up a PaymentMethod for a Customer, and defaults to false when attaching a PaymentMethod to a Customer. - #[serde(skip_serializing_if = "Option::is_none")] - pub attach_to_self: Option, - - /// When you enable this parameter, this SetupIntent accepts payment methods that you enable in the Dashboard and that are compatible with its other parameters. - #[serde(skip_serializing_if = "Option::is_none")] - pub automatic_payment_methods: Option, - - /// Set to `true` to attempt to confirm this SetupIntent immediately. - /// - /// This parameter defaults to `false`. - /// If a card is the attached payment method, you can provide a `return_url` in case further authentication is necessary. - #[serde(skip_serializing_if = "Option::is_none")] - pub confirm: Option, - - /// ID of the Customer this SetupIntent belongs to, if one exists. - /// - /// If present, the SetupIntent's payment method will be attached to the Customer on successful setup. - /// - /// Payment methods attached to other Customers cannot be used with this SetupIntent. - #[serde(skip_serializing_if = "Option::is_none")] - pub customer: Option, - - /// An arbitrary string attached to the object. - /// - /// Often useful for displaying to users. - #[serde(skip_serializing_if = "Option::is_none")] - pub description: Option<&'a str>, - - /// Specifies which fields in the response should be expanded. - #[serde(skip_serializing_if = "Expand::is_empty")] - pub expand: &'a [&'a str], - - /// Indicates the directions of money movement for which this payment method is intended to be used. - /// - /// Include `inbound` if you intend to use the payment method as the origin to pull funds from. - /// - /// Include `outbound` if you intend to use the payment method as the destination to send funds to. - /// You can include both if you intend to use the payment method for both purposes. - #[serde(skip_serializing_if = "Option::is_none")] - pub flow_directions: Option>, - - /// This hash contains details about the mandate to create. - /// - /// This parameter can only be used with [`confirm=true`](https://stripe.com/docs/api/setup_intents/create#create_setup_intent-confirm). - #[serde(skip_serializing_if = "Option::is_none")] - pub mandate_data: Option, - - /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. - /// - /// This can be useful for storing additional information about the object in a structured format. - /// Individual keys can be unset by posting an empty value to them. - /// All keys can be unset by posting an empty value to `metadata`. - #[serde(skip_serializing_if = "Option::is_none")] - pub metadata: Option, - - /// The Stripe account ID created for this SetupIntent. - #[serde(skip_serializing_if = "Option::is_none")] - pub on_behalf_of: Option<&'a str>, - - /// ID of the payment method (a PaymentMethod, Card, or saved Source object) to attach to this SetupIntent. - #[serde(skip_serializing_if = "Option::is_none")] - pub payment_method: Option, - - /// The ID of the payment method configuration to use with this SetupIntent. - #[serde(skip_serializing_if = "Option::is_none")] - pub payment_method_configuration: Option, - - /// When included, this hash creates a PaymentMethod that is set as the [`payment_method`](https://stripe.com/docs/api/setup_intents/object#setup_intent_object-payment_method) - /// value in the SetupIntent. - #[serde(skip_serializing_if = "Option::is_none")] - pub payment_method_data: Option, - - /// Payment method-specific configuration for this SetupIntent. - #[serde(skip_serializing_if = "Option::is_none")] - pub payment_method_options: Option, - - /// The list of payment method types (for example, card) that this SetupIntent can use. - /// - /// If you don't provide this, it defaults to ["card"]. - #[serde(skip_serializing_if = "Option::is_none")] - pub payment_method_types: Option>, - - /// The URL to redirect your customer back to after they authenticate or cancel their payment on the payment method's app or site. - /// - /// To redirect to a mobile application, you can alternatively supply an application URI scheme. - /// This parameter can only be used with [`confirm=true`](https://stripe.com/docs/api/setup_intents/create#create_setup_intent-confirm). - #[serde(skip_serializing_if = "Option::is_none")] - pub return_url: Option<&'a str>, - - /// If you populate this hash, this SetupIntent generates a `single_use` mandate after successful completion. - #[serde(skip_serializing_if = "Option::is_none")] - pub single_use: Option, - - /// Set to `true` when confirming server-side and using Stripe.js, iOS, or Android client-side SDKs to handle the next actions. - #[serde(skip_serializing_if = "Option::is_none")] - pub use_stripe_sdk: Option, -} - -impl<'a> CreateSetupIntent<'a> { - pub fn new() -> Self { - CreateSetupIntent { - attach_to_self: Default::default(), - automatic_payment_methods: Default::default(), - confirm: Default::default(), - customer: Default::default(), - description: Default::default(), - expand: Default::default(), - flow_directions: Default::default(), - mandate_data: Default::default(), - metadata: Default::default(), - on_behalf_of: Default::default(), - payment_method: Default::default(), - payment_method_configuration: Default::default(), - payment_method_data: Default::default(), - payment_method_options: Default::default(), - payment_method_types: Default::default(), - return_url: Default::default(), - single_use: Default::default(), - use_stripe_sdk: Default::default(), - } - } -} - -/// The parameters for `SetupIntent::list`. -#[derive(Clone, Debug, Serialize, Default)] -pub struct ListSetupIntents<'a> { - /// If present, the SetupIntent's payment method will be attached to the in-context Stripe Account. - /// - /// It can only be used for this Stripe Account’s own money movement flows like InboundTransfer and OutboundTransfers. - /// - /// It cannot be set to true when setting up a PaymentMethod for a Customer, and defaults to false when attaching a PaymentMethod to a Customer. - #[serde(skip_serializing_if = "Option::is_none")] - pub attach_to_self: Option, - - /// A filter on the list, based on the object `created` field. - /// - /// The value can be a string with an integer Unix timestamp, or it can be a dictionary with a number of different query options. - #[serde(skip_serializing_if = "Option::is_none")] - pub created: Option>, - - /// Only return SetupIntents for the customer specified by this customer ID. - #[serde(skip_serializing_if = "Option::is_none")] - pub customer: Option, - - /// A cursor for use in pagination. - /// - /// `ending_before` is an object ID that defines your place in the list. - /// For instance, if you make a list request and receive 100 objects, starting with `obj_bar`, your subsequent call can include `ending_before=obj_bar` in order to fetch the previous page of the list. - #[serde(skip_serializing_if = "Option::is_none")] - pub ending_before: Option, - - /// Specifies which fields in the response should be expanded. - #[serde(skip_serializing_if = "Expand::is_empty")] - pub expand: &'a [&'a str], - - /// A limit on the number of objects to be returned. - /// - /// Limit can range between 1 and 100, and the default is 10. - #[serde(skip_serializing_if = "Option::is_none")] - pub limit: Option, - - /// Only return SetupIntents that associate with the specified payment method. - #[serde(skip_serializing_if = "Option::is_none")] - pub payment_method: Option, - - /// A cursor for use in pagination. - /// - /// `starting_after` is an object ID that defines your place in the list. - /// For instance, if you make a list request and receive 100 objects, ending with `obj_foo`, your subsequent call can include `starting_after=obj_foo` in order to fetch the next page of the list. - #[serde(skip_serializing_if = "Option::is_none")] - pub starting_after: Option, -} - -impl<'a> ListSetupIntents<'a> { - pub fn new() -> Self { - ListSetupIntents { - attach_to_self: Default::default(), - created: Default::default(), - customer: Default::default(), - ending_before: Default::default(), - expand: Default::default(), - limit: Default::default(), - payment_method: Default::default(), - starting_after: Default::default(), - } - } -} -impl Paginable for ListSetupIntents<'_> { - type O = SetupIntent; - fn set_last(&mut self, item: Self::O) { - self.starting_after = Some(item.id()); - } -} -/// The parameters for `SetupIntent::update`. -#[derive(Clone, Debug, Serialize, Default)] -pub struct UpdateSetupIntent<'a> { - /// If present, the SetupIntent's payment method will be attached to the in-context Stripe Account. - /// - /// It can only be used for this Stripe Account’s own money movement flows like InboundTransfer and OutboundTransfers. - /// - /// It cannot be set to true when setting up a PaymentMethod for a Customer, and defaults to false when attaching a PaymentMethod to a Customer. - #[serde(skip_serializing_if = "Option::is_none")] - pub attach_to_self: Option, - - /// ID of the Customer this SetupIntent belongs to, if one exists. - /// - /// If present, the SetupIntent's payment method will be attached to the Customer on successful setup. - /// - /// Payment methods attached to other Customers cannot be used with this SetupIntent. - #[serde(skip_serializing_if = "Option::is_none")] - pub customer: Option, - - /// An arbitrary string attached to the object. - /// - /// Often useful for displaying to users. - #[serde(skip_serializing_if = "Option::is_none")] - pub description: Option<&'a str>, - - /// Specifies which fields in the response should be expanded. - #[serde(skip_serializing_if = "Expand::is_empty")] - pub expand: &'a [&'a str], - - /// Indicates the directions of money movement for which this payment method is intended to be used. - /// - /// Include `inbound` if you intend to use the payment method as the origin to pull funds from. - /// - /// Include `outbound` if you intend to use the payment method as the destination to send funds to. - /// You can include both if you intend to use the payment method for both purposes. - #[serde(skip_serializing_if = "Option::is_none")] - pub flow_directions: Option>, - - /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. - /// - /// This can be useful for storing additional information about the object in a structured format. - /// Individual keys can be unset by posting an empty value to them. - /// All keys can be unset by posting an empty value to `metadata`. - #[serde(skip_serializing_if = "Option::is_none")] - pub metadata: Option, - - /// ID of the payment method (a PaymentMethod, Card, or saved Source object) to attach to this SetupIntent. - #[serde(skip_serializing_if = "Option::is_none")] - pub payment_method: Option, - - /// The ID of the payment method configuration to use with this SetupIntent. - #[serde(skip_serializing_if = "Option::is_none")] - pub payment_method_configuration: Option, - - /// When included, this hash creates a PaymentMethod that is set as the [`payment_method`](https://stripe.com/docs/api/setup_intents/object#setup_intent_object-payment_method) - /// value in the SetupIntent. - #[serde(skip_serializing_if = "Option::is_none")] - pub payment_method_data: Option, - - /// Payment method-specific configuration for this SetupIntent. - #[serde(skip_serializing_if = "Option::is_none")] - pub payment_method_options: Option, - - /// The list of payment method types (for example, card) that this SetupIntent can set up. - /// - /// If you don't provide this array, it defaults to ["card"]. - #[serde(skip_serializing_if = "Option::is_none")] - pub payment_method_types: Option>, -} - -impl<'a> UpdateSetupIntent<'a> { - pub fn new() -> Self { - UpdateSetupIntent { - attach_to_self: Default::default(), - customer: Default::default(), - description: Default::default(), - expand: Default::default(), - flow_directions: Default::default(), - metadata: Default::default(), - payment_method: Default::default(), - payment_method_configuration: Default::default(), - payment_method_data: Default::default(), - payment_method_options: Default::default(), - payment_method_types: Default::default(), - } - } -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreateSetupIntentAutomaticPaymentMethods { - /// Controls whether this SetupIntent will accept redirect-based payment methods. - /// - /// Redirect-based payment methods may require your customer to be redirected to a payment method's app or site for authentication or additional steps. - /// - /// To [confirm](https://stripe.com/docs/api/setup_intents/confirm) this SetupIntent, you may be required to provide a `return_url` to redirect customers back to your site after they authenticate or complete the setup. - #[serde(skip_serializing_if = "Option::is_none")] - pub allow_redirects: Option, - - /// Whether this feature is enabled. - pub enabled: bool, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreateSetupIntentMandateData { - /// This hash contains details about the customer acceptance of the Mandate. - pub customer_acceptance: CreateSetupIntentMandateDataCustomerAcceptance, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreateSetupIntentPaymentMethodData { - /// If this is an `acss_debit` PaymentMethod, this hash contains details about the ACSS Debit payment method. - #[serde(skip_serializing_if = "Option::is_none")] - pub acss_debit: Option, - - /// If this is an `affirm` PaymentMethod, this hash contains details about the Affirm payment method. - #[serde(skip_serializing_if = "Option::is_none")] - pub affirm: Option, - - /// If this is an `AfterpayClearpay` PaymentMethod, this hash contains details about the AfterpayClearpay payment method. - #[serde(skip_serializing_if = "Option::is_none")] - pub afterpay_clearpay: Option, - - /// If this is an `Alipay` PaymentMethod, this hash contains details about the Alipay payment method. - #[serde(skip_serializing_if = "Option::is_none")] - pub alipay: Option, - - /// If this is an `au_becs_debit` PaymentMethod, this hash contains details about the bank account. - #[serde(skip_serializing_if = "Option::is_none")] - pub au_becs_debit: Option, - - /// If this is a `bacs_debit` PaymentMethod, this hash contains details about the Bacs Direct Debit bank account. - #[serde(skip_serializing_if = "Option::is_none")] - pub bacs_debit: Option, - - /// If this is a `bancontact` PaymentMethod, this hash contains details about the Bancontact payment method. - #[serde(skip_serializing_if = "Option::is_none")] - pub bancontact: Option, - - /// Billing information associated with the PaymentMethod that may be used or required by particular types of payment methods. - #[serde(skip_serializing_if = "Option::is_none")] - pub billing_details: Option, - - /// If this is a `blik` PaymentMethod, this hash contains details about the BLIK payment method. - #[serde(skip_serializing_if = "Option::is_none")] - pub blik: Option, - - /// If this is a `boleto` PaymentMethod, this hash contains details about the Boleto payment method. - #[serde(skip_serializing_if = "Option::is_none")] - pub boleto: Option, - - /// If this is a `cashapp` PaymentMethod, this hash contains details about the Cash App Pay payment method. - #[serde(skip_serializing_if = "Option::is_none")] - pub cashapp: Option, - - /// If this is a `customer_balance` PaymentMethod, this hash contains details about the CustomerBalance payment method. - #[serde(skip_serializing_if = "Option::is_none")] - pub customer_balance: Option, - - /// If this is an `eps` PaymentMethod, this hash contains details about the EPS payment method. - #[serde(skip_serializing_if = "Option::is_none")] - pub eps: Option, - - /// If this is an `fpx` PaymentMethod, this hash contains details about the FPX payment method. - #[serde(skip_serializing_if = "Option::is_none")] - pub fpx: Option, - - /// If this is a `giropay` PaymentMethod, this hash contains details about the Giropay payment method. - #[serde(skip_serializing_if = "Option::is_none")] - pub giropay: Option, - - /// If this is a `grabpay` PaymentMethod, this hash contains details about the GrabPay payment method. - #[serde(skip_serializing_if = "Option::is_none")] - pub grabpay: Option, - - /// If this is an `ideal` PaymentMethod, this hash contains details about the iDEAL payment method. - #[serde(skip_serializing_if = "Option::is_none")] - pub ideal: Option, - - /// If this is an `interac_present` PaymentMethod, this hash contains details about the Interac Present payment method. - #[serde(skip_serializing_if = "Option::is_none")] - pub interac_present: Option, - - /// If this is a `klarna` PaymentMethod, this hash contains details about the Klarna payment method. - #[serde(skip_serializing_if = "Option::is_none")] - pub klarna: Option, - - /// If this is a `konbini` PaymentMethod, this hash contains details about the Konbini payment method. - #[serde(skip_serializing_if = "Option::is_none")] - pub konbini: Option, - - /// If this is an `Link` PaymentMethod, this hash contains details about the Link payment method. - #[serde(skip_serializing_if = "Option::is_none")] - pub link: Option, - - /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. - /// - /// This can be useful for storing additional information about the object in a structured format. - /// Individual keys can be unset by posting an empty value to them. - /// All keys can be unset by posting an empty value to `metadata`. - #[serde(skip_serializing_if = "Option::is_none")] - pub metadata: Option, - - /// If this is an `oxxo` PaymentMethod, this hash contains details about the OXXO payment method. - #[serde(skip_serializing_if = "Option::is_none")] - pub oxxo: Option, - - /// If this is a `p24` PaymentMethod, this hash contains details about the P24 payment method. - #[serde(skip_serializing_if = "Option::is_none")] - pub p24: Option, - - /// If this is a `paynow` PaymentMethod, this hash contains details about the PayNow payment method. - #[serde(skip_serializing_if = "Option::is_none")] - pub paynow: Option, - - /// If this is a `paypal` PaymentMethod, this hash contains details about the PayPal payment method. - #[serde(skip_serializing_if = "Option::is_none")] - pub paypal: Option, - - /// If this is a `pix` PaymentMethod, this hash contains details about the Pix payment method. - #[serde(skip_serializing_if = "Option::is_none")] - pub pix: Option, - - /// If this is a `promptpay` PaymentMethod, this hash contains details about the PromptPay payment method. - #[serde(skip_serializing_if = "Option::is_none")] - pub promptpay: Option, - - /// Options to configure Radar. - /// - /// See [Radar Session](https://stripe.com/docs/radar/radar-session) for more information. - #[serde(skip_serializing_if = "Option::is_none")] - pub radar_options: Option, - - /// If this is a `Revolut Pay` PaymentMethod, this hash contains details about the Revolut Pay payment method. - #[serde(skip_serializing_if = "Option::is_none")] - pub revolut_pay: Option, - - /// If this is a `sepa_debit` PaymentMethod, this hash contains details about the SEPA debit bank account. - #[serde(skip_serializing_if = "Option::is_none")] - pub sepa_debit: Option, - - /// If this is a `sofort` PaymentMethod, this hash contains details about the SOFORT payment method. - #[serde(skip_serializing_if = "Option::is_none")] - pub sofort: Option, - - /// If this is a `swish` PaymentMethod, this hash contains details about the Swish payment method. - #[serde(skip_serializing_if = "Option::is_none")] - pub swish: Option, - - /// The type of the PaymentMethod. - /// - /// An additional hash is included on the PaymentMethod with a name matching this value. - /// It contains additional information specific to the PaymentMethod type. - #[serde(rename = "type")] - pub type_: CreateSetupIntentPaymentMethodDataType, - - /// If this is an `us_bank_account` PaymentMethod, this hash contains details about the US bank account payment method. - #[serde(skip_serializing_if = "Option::is_none")] - pub us_bank_account: Option, - - /// If this is an `wechat_pay` PaymentMethod, this hash contains details about the wechat_pay payment method. - #[serde(skip_serializing_if = "Option::is_none")] - pub wechat_pay: Option, - - /// If this is a `zip` PaymentMethod, this hash contains details about the Zip payment method. - #[serde(skip_serializing_if = "Option::is_none")] - pub zip: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreateSetupIntentPaymentMethodOptions { - /// If this is a `acss_debit` SetupIntent, this sub-hash contains details about the ACSS Debit payment method options. - #[serde(skip_serializing_if = "Option::is_none")] - pub acss_debit: Option, - - /// Configuration for any card setup attempted on this SetupIntent. - #[serde(skip_serializing_if = "Option::is_none")] - pub card: Option, - - /// If this is a `link` PaymentMethod, this sub-hash contains details about the Link payment method options. - #[serde(skip_serializing_if = "Option::is_none")] - pub link: Option, - - /// If this is a `paypal` PaymentMethod, this sub-hash contains details about the PayPal payment method options. - #[serde(skip_serializing_if = "Option::is_none")] - pub paypal: Option, - - /// If this is a `sepa_debit` SetupIntent, this sub-hash contains details about the SEPA Debit payment method options. - #[serde(skip_serializing_if = "Option::is_none")] - pub sepa_debit: Option, - - /// If this is a `us_bank_account` SetupIntent, this sub-hash contains details about the US bank account payment method options. - #[serde(skip_serializing_if = "Option::is_none")] - pub us_bank_account: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreateSetupIntentSingleUse { - /// Amount the customer is granting permission to collect later. - /// - /// A positive integer representing how much to charge in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal) (e.g., 100 cents to charge $1.00 or 100 to charge ¥100, a zero-decimal currency). - /// The minimum amount is $0.50 US or [equivalent in charge currency](https://stripe.com/docs/currencies#minimum-and-maximum-charge-amounts). - /// The amount value supports up to eight digits (e.g., a value of 99999999 for a USD charge of $999,999.99). - pub amount: i64, - - /// Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. - /// - /// Must be a [supported currency](https://stripe.com/docs/currencies). - pub currency: Currency, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UpdateSetupIntentPaymentMethodData { - /// If this is an `acss_debit` PaymentMethod, this hash contains details about the ACSS Debit payment method. - #[serde(skip_serializing_if = "Option::is_none")] - pub acss_debit: Option, - - /// If this is an `affirm` PaymentMethod, this hash contains details about the Affirm payment method. - #[serde(skip_serializing_if = "Option::is_none")] - pub affirm: Option, - - /// If this is an `AfterpayClearpay` PaymentMethod, this hash contains details about the AfterpayClearpay payment method. - #[serde(skip_serializing_if = "Option::is_none")] - pub afterpay_clearpay: Option, - - /// If this is an `Alipay` PaymentMethod, this hash contains details about the Alipay payment method. - #[serde(skip_serializing_if = "Option::is_none")] - pub alipay: Option, - - /// If this is an `au_becs_debit` PaymentMethod, this hash contains details about the bank account. - #[serde(skip_serializing_if = "Option::is_none")] - pub au_becs_debit: Option, - - /// If this is a `bacs_debit` PaymentMethod, this hash contains details about the Bacs Direct Debit bank account. - #[serde(skip_serializing_if = "Option::is_none")] - pub bacs_debit: Option, - - /// If this is a `bancontact` PaymentMethod, this hash contains details about the Bancontact payment method. - #[serde(skip_serializing_if = "Option::is_none")] - pub bancontact: Option, - - /// Billing information associated with the PaymentMethod that may be used or required by particular types of payment methods. - #[serde(skip_serializing_if = "Option::is_none")] - pub billing_details: Option, - - /// If this is a `blik` PaymentMethod, this hash contains details about the BLIK payment method. - #[serde(skip_serializing_if = "Option::is_none")] - pub blik: Option, - - /// If this is a `boleto` PaymentMethod, this hash contains details about the Boleto payment method. - #[serde(skip_serializing_if = "Option::is_none")] - pub boleto: Option, - - /// If this is a `cashapp` PaymentMethod, this hash contains details about the Cash App Pay payment method. - #[serde(skip_serializing_if = "Option::is_none")] - pub cashapp: Option, - - /// If this is a `customer_balance` PaymentMethod, this hash contains details about the CustomerBalance payment method. - #[serde(skip_serializing_if = "Option::is_none")] - pub customer_balance: Option, - - /// If this is an `eps` PaymentMethod, this hash contains details about the EPS payment method. - #[serde(skip_serializing_if = "Option::is_none")] - pub eps: Option, - - /// If this is an `fpx` PaymentMethod, this hash contains details about the FPX payment method. - #[serde(skip_serializing_if = "Option::is_none")] - pub fpx: Option, - - /// If this is a `giropay` PaymentMethod, this hash contains details about the Giropay payment method. - #[serde(skip_serializing_if = "Option::is_none")] - pub giropay: Option, - - /// If this is a `grabpay` PaymentMethod, this hash contains details about the GrabPay payment method. - #[serde(skip_serializing_if = "Option::is_none")] - pub grabpay: Option, - - /// If this is an `ideal` PaymentMethod, this hash contains details about the iDEAL payment method. - #[serde(skip_serializing_if = "Option::is_none")] - pub ideal: Option, - - /// If this is an `interac_present` PaymentMethod, this hash contains details about the Interac Present payment method. - #[serde(skip_serializing_if = "Option::is_none")] - pub interac_present: Option, - - /// If this is a `klarna` PaymentMethod, this hash contains details about the Klarna payment method. - #[serde(skip_serializing_if = "Option::is_none")] - pub klarna: Option, - - /// If this is a `konbini` PaymentMethod, this hash contains details about the Konbini payment method. - #[serde(skip_serializing_if = "Option::is_none")] - pub konbini: Option, - - /// If this is an `Link` PaymentMethod, this hash contains details about the Link payment method. - #[serde(skip_serializing_if = "Option::is_none")] - pub link: Option, - - /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. - /// - /// This can be useful for storing additional information about the object in a structured format. - /// Individual keys can be unset by posting an empty value to them. - /// All keys can be unset by posting an empty value to `metadata`. - #[serde(skip_serializing_if = "Option::is_none")] - pub metadata: Option, - - /// If this is an `oxxo` PaymentMethod, this hash contains details about the OXXO payment method. - #[serde(skip_serializing_if = "Option::is_none")] - pub oxxo: Option, - - /// If this is a `p24` PaymentMethod, this hash contains details about the P24 payment method. - #[serde(skip_serializing_if = "Option::is_none")] - pub p24: Option, - - /// If this is a `paynow` PaymentMethod, this hash contains details about the PayNow payment method. - #[serde(skip_serializing_if = "Option::is_none")] - pub paynow: Option, - - /// If this is a `paypal` PaymentMethod, this hash contains details about the PayPal payment method. - #[serde(skip_serializing_if = "Option::is_none")] - pub paypal: Option, - - /// If this is a `pix` PaymentMethod, this hash contains details about the Pix payment method. - #[serde(skip_serializing_if = "Option::is_none")] - pub pix: Option, - - /// If this is a `promptpay` PaymentMethod, this hash contains details about the PromptPay payment method. - #[serde(skip_serializing_if = "Option::is_none")] - pub promptpay: Option, - - /// Options to configure Radar. - /// - /// See [Radar Session](https://stripe.com/docs/radar/radar-session) for more information. - #[serde(skip_serializing_if = "Option::is_none")] - pub radar_options: Option, - - /// If this is a `Revolut Pay` PaymentMethod, this hash contains details about the Revolut Pay payment method. - #[serde(skip_serializing_if = "Option::is_none")] - pub revolut_pay: Option, - - /// If this is a `sepa_debit` PaymentMethod, this hash contains details about the SEPA debit bank account. - #[serde(skip_serializing_if = "Option::is_none")] - pub sepa_debit: Option, - - /// If this is a `sofort` PaymentMethod, this hash contains details about the SOFORT payment method. - #[serde(skip_serializing_if = "Option::is_none")] - pub sofort: Option, - - /// If this is a `swish` PaymentMethod, this hash contains details about the Swish payment method. - #[serde(skip_serializing_if = "Option::is_none")] - pub swish: Option, - - /// The type of the PaymentMethod. - /// - /// An additional hash is included on the PaymentMethod with a name matching this value. - /// It contains additional information specific to the PaymentMethod type. - #[serde(rename = "type")] - pub type_: UpdateSetupIntentPaymentMethodDataType, - - /// If this is an `us_bank_account` PaymentMethod, this hash contains details about the US bank account payment method. - #[serde(skip_serializing_if = "Option::is_none")] - pub us_bank_account: Option, - - /// If this is an `wechat_pay` PaymentMethod, this hash contains details about the wechat_pay payment method. - #[serde(skip_serializing_if = "Option::is_none")] - pub wechat_pay: Option, - - /// If this is a `zip` PaymentMethod, this hash contains details about the Zip payment method. - #[serde(skip_serializing_if = "Option::is_none")] - pub zip: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UpdateSetupIntentPaymentMethodOptions { - /// If this is a `acss_debit` SetupIntent, this sub-hash contains details about the ACSS Debit payment method options. - #[serde(skip_serializing_if = "Option::is_none")] - pub acss_debit: Option, - - /// Configuration for any card setup attempted on this SetupIntent. - #[serde(skip_serializing_if = "Option::is_none")] - pub card: Option, - - /// If this is a `link` PaymentMethod, this sub-hash contains details about the Link payment method options. - #[serde(skip_serializing_if = "Option::is_none")] - pub link: Option, - - /// If this is a `paypal` PaymentMethod, this sub-hash contains details about the PayPal payment method options. - #[serde(skip_serializing_if = "Option::is_none")] - pub paypal: Option, - - /// If this is a `sepa_debit` SetupIntent, this sub-hash contains details about the SEPA Debit payment method options. - #[serde(skip_serializing_if = "Option::is_none")] - pub sepa_debit: Option, - - /// If this is a `us_bank_account` SetupIntent, this sub-hash contains details about the US bank account payment method options. - #[serde(skip_serializing_if = "Option::is_none")] - pub us_bank_account: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreateSetupIntentMandateDataCustomerAcceptance { - /// The time at which the customer accepted the Mandate. - #[serde(skip_serializing_if = "Option::is_none")] - pub accepted_at: Option, - - /// If this is a Mandate accepted offline, this hash contains details about the offline acceptance. - #[serde(skip_serializing_if = "Option::is_none")] - pub offline: Option, - - /// If this is a Mandate accepted online, this hash contains details about the online acceptance. - #[serde(skip_serializing_if = "Option::is_none")] - pub online: Option, - - /// The type of customer acceptance information included with the Mandate. - /// - /// One of `online` or `offline`. - #[serde(rename = "type")] - pub type_: CreateSetupIntentMandateDataCustomerAcceptanceType, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreateSetupIntentPaymentMethodDataAcssDebit { - /// Customer's bank account number. - pub account_number: String, - - /// Institution number of the customer's bank. - pub institution_number: String, - - /// Transit number of the customer's bank. - pub transit_number: String, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreateSetupIntentPaymentMethodDataAffirm {} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreateSetupIntentPaymentMethodDataAfterpayClearpay {} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreateSetupIntentPaymentMethodDataAlipay {} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreateSetupIntentPaymentMethodDataAuBecsDebit { - /// The account number for the bank account. - pub account_number: String, - - /// Bank-State-Branch number of the bank account. - pub bsb_number: String, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreateSetupIntentPaymentMethodDataBacsDebit { - /// Account number of the bank account that the funds will be debited from. - #[serde(skip_serializing_if = "Option::is_none")] - pub account_number: Option, - - /// Sort code of the bank account. - /// - /// (e.g., `10-20-30`). - #[serde(skip_serializing_if = "Option::is_none")] - pub sort_code: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreateSetupIntentPaymentMethodDataBancontact {} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreateSetupIntentPaymentMethodDataBillingDetails { - /// Billing address. - #[serde(skip_serializing_if = "Option::is_none")] - pub address: Option, - - /// Email address. - #[serde(skip_serializing_if = "Option::is_none")] - pub email: Option, - - /// Full name. - #[serde(skip_serializing_if = "Option::is_none")] - pub name: Option, - - /// Billing phone number (including extension). - #[serde(skip_serializing_if = "Option::is_none")] - pub phone: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreateSetupIntentPaymentMethodDataBlik {} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreateSetupIntentPaymentMethodDataBoleto { - /// The tax ID of the customer (CPF for individual consumers or CNPJ for businesses consumers). - pub tax_id: String, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreateSetupIntentPaymentMethodDataCashapp {} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreateSetupIntentPaymentMethodDataCustomerBalance {} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreateSetupIntentPaymentMethodDataEps { - /// The customer's bank. - #[serde(skip_serializing_if = "Option::is_none")] - pub bank: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreateSetupIntentPaymentMethodDataFpx { - /// Account holder type for FPX transaction. - #[serde(skip_serializing_if = "Option::is_none")] - pub account_holder_type: Option, - - /// The customer's bank. - pub bank: CreateSetupIntentPaymentMethodDataFpxBank, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreateSetupIntentPaymentMethodDataGiropay {} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreateSetupIntentPaymentMethodDataGrabpay {} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreateSetupIntentPaymentMethodDataIdeal { - /// The customer's bank. - #[serde(skip_serializing_if = "Option::is_none")] - pub bank: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreateSetupIntentPaymentMethodDataInteracPresent {} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreateSetupIntentPaymentMethodDataKlarna { - /// Customer's date of birth. - #[serde(skip_serializing_if = "Option::is_none")] - pub dob: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreateSetupIntentPaymentMethodDataKonbini {} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreateSetupIntentPaymentMethodDataLink {} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreateSetupIntentPaymentMethodDataOxxo {} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreateSetupIntentPaymentMethodDataP24 { - /// The customer's bank. - #[serde(skip_serializing_if = "Option::is_none")] - pub bank: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreateSetupIntentPaymentMethodDataPaynow {} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreateSetupIntentPaymentMethodDataPaypal {} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreateSetupIntentPaymentMethodDataPix {} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreateSetupIntentPaymentMethodDataPromptpay {} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreateSetupIntentPaymentMethodDataRadarOptions { - /// A [Radar Session](https://stripe.com/docs/radar/radar-session) is a snapshot of the browser metadata and device details that help Radar make more accurate predictions on your payments. - #[serde(skip_serializing_if = "Option::is_none")] - pub session: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreateSetupIntentPaymentMethodDataRevolutPay {} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreateSetupIntentPaymentMethodDataSepaDebit { - /// IBAN of the bank account. - pub iban: String, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreateSetupIntentPaymentMethodDataSofort { - /// Two-letter ISO code representing the country the bank account is located in. - pub country: CreateSetupIntentPaymentMethodDataSofortCountry, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreateSetupIntentPaymentMethodDataSwish {} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreateSetupIntentPaymentMethodDataUsBankAccount { - /// Account holder type: individual or company. - #[serde(skip_serializing_if = "Option::is_none")] - pub account_holder_type: - Option, - - /// Account number of the bank account. - #[serde(skip_serializing_if = "Option::is_none")] - pub account_number: Option, - - /// Account type: checkings or savings. - /// - /// Defaults to checking if omitted. - #[serde(skip_serializing_if = "Option::is_none")] - pub account_type: Option, - - /// The ID of a Financial Connections Account to use as a payment method. - #[serde(skip_serializing_if = "Option::is_none")] - pub financial_connections_account: Option, - - /// Routing number of the bank account. - #[serde(skip_serializing_if = "Option::is_none")] - pub routing_number: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreateSetupIntentPaymentMethodDataWechatPay {} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreateSetupIntentPaymentMethodDataZip {} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreateSetupIntentPaymentMethodOptionsAcssDebit { - /// Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. - /// - /// Must be a [supported currency](https://stripe.com/docs/currencies). - #[serde(skip_serializing_if = "Option::is_none")] - pub currency: Option, - - /// Additional fields for Mandate creation. - #[serde(skip_serializing_if = "Option::is_none")] - pub mandate_options: Option, - - /// Bank account verification method. - #[serde(skip_serializing_if = "Option::is_none")] - pub verification_method: - Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreateSetupIntentPaymentMethodOptionsCard { - /// Configuration options for setting up an eMandate for cards issued in India. - #[serde(skip_serializing_if = "Option::is_none")] - pub mandate_options: Option, - - /// When specified, this parameter signals that a card has been collected - /// as MOTO (Mail Order Telephone Order) and thus out of scope for SCA. - /// - /// This parameter can only be provided during confirmation. - #[serde(skip_serializing_if = "Option::is_none")] - pub moto: Option, - - /// Selected network to process this SetupIntent on. - /// - /// Depends on the available networks of the card attached to the SetupIntent. - /// Can be only set confirm-time. - #[serde(skip_serializing_if = "Option::is_none")] - pub network: Option, - - /// We strongly recommend that you rely on our SCA Engine to automatically prompt your customers for authentication based on risk level and [other requirements](https://stripe.com/docs/strong-customer-authentication). - /// - /// However, if you wish to request 3D Secure based on logic from your own fraud engine, provide this option. - /// If not provided, this value defaults to `automatic`. - /// Read our guide on [manually requesting 3D Secure](https://stripe.com/docs/payments/3d-secure#manual-three-ds) for more information on how this configuration interacts with Radar and our SCA Engine. - #[serde(skip_serializing_if = "Option::is_none")] - pub request_three_d_secure: - Option, - - /// If 3D Secure authentication was performed with a third-party provider, - /// the authentication details to use for this setup. - #[serde(skip_serializing_if = "Option::is_none")] - pub three_d_secure: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreateSetupIntentPaymentMethodOptionsLink { - /// [Deprecated] This is a legacy parameter that no longer has any function. - #[serde(skip_serializing_if = "Option::is_none")] - pub persistent_token: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreateSetupIntentPaymentMethodOptionsPaypal { - /// The PayPal Billing Agreement ID (BAID). - /// - /// This is an ID generated by PayPal which represents the mandate between the merchant and the customer. - #[serde(skip_serializing_if = "Option::is_none")] - pub billing_agreement_id: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreateSetupIntentPaymentMethodOptionsSepaDebit { - /// Additional fields for Mandate creation. - #[serde(skip_serializing_if = "Option::is_none")] - pub mandate_options: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreateSetupIntentPaymentMethodOptionsUsBankAccount { - /// Additional fields for Financial Connections Session creation. - #[serde(skip_serializing_if = "Option::is_none")] - pub financial_connections: - Option, - - /// Additional fields for Mandate creation. - #[serde(skip_serializing_if = "Option::is_none")] - pub mandate_options: Option, - - /// Additional fields for network related functions. - #[serde(skip_serializing_if = "Option::is_none")] - pub networks: Option, - - /// Bank account verification method. - #[serde(skip_serializing_if = "Option::is_none")] - pub verification_method: - Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UpdateSetupIntentPaymentMethodDataAcssDebit { - /// Customer's bank account number. - pub account_number: String, - - /// Institution number of the customer's bank. - pub institution_number: String, - - /// Transit number of the customer's bank. - pub transit_number: String, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UpdateSetupIntentPaymentMethodDataAffirm {} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UpdateSetupIntentPaymentMethodDataAfterpayClearpay {} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UpdateSetupIntentPaymentMethodDataAlipay {} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UpdateSetupIntentPaymentMethodDataAuBecsDebit { - /// The account number for the bank account. - pub account_number: String, - - /// Bank-State-Branch number of the bank account. - pub bsb_number: String, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UpdateSetupIntentPaymentMethodDataBacsDebit { - /// Account number of the bank account that the funds will be debited from. - #[serde(skip_serializing_if = "Option::is_none")] - pub account_number: Option, - - /// Sort code of the bank account. - /// - /// (e.g., `10-20-30`). - #[serde(skip_serializing_if = "Option::is_none")] - pub sort_code: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UpdateSetupIntentPaymentMethodDataBancontact {} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UpdateSetupIntentPaymentMethodDataBillingDetails { - /// Billing address. - #[serde(skip_serializing_if = "Option::is_none")] - pub address: Option, - - /// Email address. - #[serde(skip_serializing_if = "Option::is_none")] - pub email: Option, - - /// Full name. - #[serde(skip_serializing_if = "Option::is_none")] - pub name: Option, - - /// Billing phone number (including extension). - #[serde(skip_serializing_if = "Option::is_none")] - pub phone: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UpdateSetupIntentPaymentMethodDataBlik {} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UpdateSetupIntentPaymentMethodDataBoleto { - /// The tax ID of the customer (CPF for individual consumers or CNPJ for businesses consumers). - pub tax_id: String, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UpdateSetupIntentPaymentMethodDataCashapp {} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UpdateSetupIntentPaymentMethodDataCustomerBalance {} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UpdateSetupIntentPaymentMethodDataEps { - /// The customer's bank. - #[serde(skip_serializing_if = "Option::is_none")] - pub bank: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UpdateSetupIntentPaymentMethodDataFpx { - /// Account holder type for FPX transaction. - #[serde(skip_serializing_if = "Option::is_none")] - pub account_holder_type: Option, - - /// The customer's bank. - pub bank: UpdateSetupIntentPaymentMethodDataFpxBank, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UpdateSetupIntentPaymentMethodDataGiropay {} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UpdateSetupIntentPaymentMethodDataGrabpay {} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UpdateSetupIntentPaymentMethodDataIdeal { - /// The customer's bank. - #[serde(skip_serializing_if = "Option::is_none")] - pub bank: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UpdateSetupIntentPaymentMethodDataInteracPresent {} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UpdateSetupIntentPaymentMethodDataKlarna { - /// Customer's date of birth. - #[serde(skip_serializing_if = "Option::is_none")] - pub dob: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UpdateSetupIntentPaymentMethodDataKonbini {} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UpdateSetupIntentPaymentMethodDataLink {} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UpdateSetupIntentPaymentMethodDataOxxo {} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UpdateSetupIntentPaymentMethodDataP24 { - /// The customer's bank. - #[serde(skip_serializing_if = "Option::is_none")] - pub bank: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UpdateSetupIntentPaymentMethodDataPaynow {} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UpdateSetupIntentPaymentMethodDataPaypal {} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UpdateSetupIntentPaymentMethodDataPix {} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UpdateSetupIntentPaymentMethodDataPromptpay {} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UpdateSetupIntentPaymentMethodDataRadarOptions { - /// A [Radar Session](https://stripe.com/docs/radar/radar-session) is a snapshot of the browser metadata and device details that help Radar make more accurate predictions on your payments. - #[serde(skip_serializing_if = "Option::is_none")] - pub session: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UpdateSetupIntentPaymentMethodDataRevolutPay {} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UpdateSetupIntentPaymentMethodDataSepaDebit { - /// IBAN of the bank account. - pub iban: String, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UpdateSetupIntentPaymentMethodDataSofort { - /// Two-letter ISO code representing the country the bank account is located in. - pub country: UpdateSetupIntentPaymentMethodDataSofortCountry, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UpdateSetupIntentPaymentMethodDataSwish {} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UpdateSetupIntentPaymentMethodDataUsBankAccount { - /// Account holder type: individual or company. - #[serde(skip_serializing_if = "Option::is_none")] - pub account_holder_type: - Option, - - /// Account number of the bank account. - #[serde(skip_serializing_if = "Option::is_none")] - pub account_number: Option, - - /// Account type: checkings or savings. - /// - /// Defaults to checking if omitted. - #[serde(skip_serializing_if = "Option::is_none")] - pub account_type: Option, - - /// The ID of a Financial Connections Account to use as a payment method. - #[serde(skip_serializing_if = "Option::is_none")] - pub financial_connections_account: Option, - - /// Routing number of the bank account. - #[serde(skip_serializing_if = "Option::is_none")] - pub routing_number: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UpdateSetupIntentPaymentMethodDataWechatPay {} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UpdateSetupIntentPaymentMethodDataZip {} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UpdateSetupIntentPaymentMethodOptionsAcssDebit { - /// Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. - /// - /// Must be a [supported currency](https://stripe.com/docs/currencies). - #[serde(skip_serializing_if = "Option::is_none")] - pub currency: Option, - - /// Additional fields for Mandate creation. - #[serde(skip_serializing_if = "Option::is_none")] - pub mandate_options: Option, - - /// Bank account verification method. - #[serde(skip_serializing_if = "Option::is_none")] - pub verification_method: - Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UpdateSetupIntentPaymentMethodOptionsCard { - /// Configuration options for setting up an eMandate for cards issued in India. - #[serde(skip_serializing_if = "Option::is_none")] - pub mandate_options: Option, - - /// When specified, this parameter signals that a card has been collected - /// as MOTO (Mail Order Telephone Order) and thus out of scope for SCA. - /// - /// This parameter can only be provided during confirmation. - #[serde(skip_serializing_if = "Option::is_none")] - pub moto: Option, - - /// Selected network to process this SetupIntent on. - /// - /// Depends on the available networks of the card attached to the SetupIntent. - /// Can be only set confirm-time. - #[serde(skip_serializing_if = "Option::is_none")] - pub network: Option, - - /// We strongly recommend that you rely on our SCA Engine to automatically prompt your customers for authentication based on risk level and [other requirements](https://stripe.com/docs/strong-customer-authentication). - /// - /// However, if you wish to request 3D Secure based on logic from your own fraud engine, provide this option. - /// If not provided, this value defaults to `automatic`. - /// Read our guide on [manually requesting 3D Secure](https://stripe.com/docs/payments/3d-secure#manual-three-ds) for more information on how this configuration interacts with Radar and our SCA Engine. - #[serde(skip_serializing_if = "Option::is_none")] - pub request_three_d_secure: - Option, - - /// If 3D Secure authentication was performed with a third-party provider, - /// the authentication details to use for this setup. - #[serde(skip_serializing_if = "Option::is_none")] - pub three_d_secure: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UpdateSetupIntentPaymentMethodOptionsLink { - /// [Deprecated] This is a legacy parameter that no longer has any function. - #[serde(skip_serializing_if = "Option::is_none")] - pub persistent_token: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UpdateSetupIntentPaymentMethodOptionsPaypal { - /// The PayPal Billing Agreement ID (BAID). - /// - /// This is an ID generated by PayPal which represents the mandate between the merchant and the customer. - #[serde(skip_serializing_if = "Option::is_none")] - pub billing_agreement_id: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UpdateSetupIntentPaymentMethodOptionsSepaDebit { - /// Additional fields for Mandate creation. - #[serde(skip_serializing_if = "Option::is_none")] - pub mandate_options: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UpdateSetupIntentPaymentMethodOptionsUsBankAccount { - /// Additional fields for Financial Connections Session creation. - #[serde(skip_serializing_if = "Option::is_none")] - pub financial_connections: - Option, - - /// Additional fields for Mandate creation. - #[serde(skip_serializing_if = "Option::is_none")] - pub mandate_options: Option, - - /// Additional fields for network related functions. - #[serde(skip_serializing_if = "Option::is_none")] - pub networks: Option, - - /// Bank account verification method. - #[serde(skip_serializing_if = "Option::is_none")] - pub verification_method: - Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreateSetupIntentMandateDataCustomerAcceptanceOffline {} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreateSetupIntentMandateDataCustomerAcceptanceOnline { - /// The IP address from which the Mandate was accepted by the customer. - pub ip_address: String, - - /// The user agent of the browser from which the Mandate was accepted by the customer. - pub user_agent: String, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreateSetupIntentPaymentMethodDataBillingDetailsAddress { - /// City, district, suburb, town, or village. - #[serde(skip_serializing_if = "Option::is_none")] - pub city: Option, - - /// Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). - #[serde(skip_serializing_if = "Option::is_none")] - pub country: Option, - - /// Address line 1 (e.g., street, PO Box, or company name). - #[serde(skip_serializing_if = "Option::is_none")] - pub line1: Option, - - /// Address line 2 (e.g., apartment, suite, unit, or building). - #[serde(skip_serializing_if = "Option::is_none")] - pub line2: Option, - - /// ZIP or postal code. - #[serde(skip_serializing_if = "Option::is_none")] - pub postal_code: Option, - - /// State, county, province, or region. - #[serde(skip_serializing_if = "Option::is_none")] - pub state: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreateSetupIntentPaymentMethodDataKlarnaDob { - /// The day of birth, between 1 and 31. - pub day: i64, - - /// The month of birth, between 1 and 12. - pub month: i64, - - /// The four-digit year of birth. - pub year: i64, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreateSetupIntentPaymentMethodOptionsAcssDebitMandateOptions { - /// A URL for custom mandate text to render during confirmation step. - /// The URL will be rendered with additional GET parameters `payment_intent` and `payment_intent_client_secret` when confirming a Payment Intent, - /// or `setup_intent` and `setup_intent_client_secret` when confirming a Setup Intent. - #[serde(skip_serializing_if = "Option::is_none")] - pub custom_mandate_url: Option, - - /// List of Stripe products where this mandate can be selected automatically. - #[serde(skip_serializing_if = "Option::is_none")] - pub default_for: - Option>, - - /// Description of the mandate interval. - /// - /// Only required if 'payment_schedule' parameter is 'interval' or 'combined'. - #[serde(skip_serializing_if = "Option::is_none")] - pub interval_description: Option, - - /// Payment schedule for the mandate. - #[serde(skip_serializing_if = "Option::is_none")] - pub payment_schedule: - Option, - - /// Transaction type of the mandate. - #[serde(skip_serializing_if = "Option::is_none")] - pub transaction_type: - Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreateSetupIntentPaymentMethodOptionsCardMandateOptions { - /// Amount to be charged for future payments. - pub amount: i64, - - /// One of `fixed` or `maximum`. - /// - /// If `fixed`, the `amount` param refers to the exact amount to be charged in future payments. - /// If `maximum`, the amount charged can be up to the value passed for the `amount` param. - pub amount_type: CreateSetupIntentPaymentMethodOptionsCardMandateOptionsAmountType, - - /// Currency in which future payments will be charged. - /// - /// Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. - /// Must be a [supported currency](https://stripe.com/docs/currencies). - pub currency: Currency, - - /// A description of the mandate or subscription that is meant to be displayed to the customer. - #[serde(skip_serializing_if = "Option::is_none")] - pub description: Option, - - /// End date of the mandate or subscription. - /// - /// If not provided, the mandate will be active until canceled. - /// If provided, end date should be after start date. - #[serde(skip_serializing_if = "Option::is_none")] - pub end_date: Option, - - /// Specifies payment frequency. - /// - /// One of `day`, `week`, `month`, `year`, or `sporadic`. - pub interval: CreateSetupIntentPaymentMethodOptionsCardMandateOptionsInterval, - - /// The number of intervals between payments. - /// - /// For example, `interval=month` and `interval_count=3` indicates one payment every three months. - /// Maximum of one year interval allowed (1 year, 12 months, or 52 weeks). - /// This parameter is optional when `interval=sporadic`. - #[serde(skip_serializing_if = "Option::is_none")] - pub interval_count: Option, - - /// Unique identifier for the mandate or subscription. - pub reference: String, - - /// Start date of the mandate or subscription. - /// - /// Start date should not be lesser than yesterday. - pub start_date: Timestamp, - - /// Specifies the type of mandates supported. - /// - /// Possible values are `india`. - #[serde(skip_serializing_if = "Option::is_none")] - pub supported_types: - Option>, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreateSetupIntentPaymentMethodOptionsCardThreeDSecure { - /// The `transStatus` returned from the card Issuer’s ACS in the ARes. - #[serde(skip_serializing_if = "Option::is_none")] - pub ares_trans_status: - Option, - - /// The cryptogram, also known as the "authentication value" (AAV, CAVV or - /// AEVV). - /// - /// This value is 20 bytes, base64-encoded into a 28-character string. (Most 3D Secure providers will return the base64-encoded version, which is what you should specify here.). - #[serde(skip_serializing_if = "Option::is_none")] - pub cryptogram: Option, - - /// The Electronic Commerce Indicator (ECI) is returned by your 3D Secure - /// provider and indicates what degree of authentication was performed. - #[serde(skip_serializing_if = "Option::is_none")] - pub electronic_commerce_indicator: - Option, - - /// Network specific 3DS fields. - /// - /// Network specific arguments require an explicit card brand choice. - /// The parameter `payment_method_options.card.network`` must be populated accordingly. - #[serde(skip_serializing_if = "Option::is_none")] - pub network_options: - Option, - - /// The challenge indicator (`threeDSRequestorChallengeInd`) which was requested in the - /// AReq sent to the card Issuer's ACS. - /// - /// A string containing 2 digits from 01-99. - #[serde(skip_serializing_if = "Option::is_none")] - pub requestor_challenge_indicator: Option, - - /// For 3D Secure 1, the XID. - /// - /// For 3D Secure 2, the Directory Server Transaction ID (dsTransID). - #[serde(skip_serializing_if = "Option::is_none")] - pub transaction_id: Option, - - /// The version of 3D Secure that was performed. - #[serde(skip_serializing_if = "Option::is_none")] - pub version: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreateSetupIntentPaymentMethodOptionsSepaDebitMandateOptions {} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnections { - /// The list of permissions to request. - /// - /// If this parameter is passed, the `payment_method` permission must be included. - /// Valid permissions include: `balances`, `ownership`, `payment_method`, and `transactions`. - #[serde(skip_serializing_if = "Option::is_none")] - pub permissions: Option< - Vec, - >, - - /// List of data features that you would like to retrieve upon account creation. - #[serde(skip_serializing_if = "Option::is_none")] - pub prefetch: - Option>, - - /// For webview integrations only. - /// - /// Upon completing OAuth login in the native browser, the user will be redirected to this URL to return to your app. - #[serde(skip_serializing_if = "Option::is_none")] - pub return_url: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreateSetupIntentPaymentMethodOptionsUsBankAccountMandateOptions { - /// The method used to collect offline mandate customer acceptance. - #[serde(skip_serializing_if = "Option::is_none")] - pub collection_method: - Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreateSetupIntentPaymentMethodOptionsUsBankAccountNetworks { - /// Triggers validations to run across the selected networks. - #[serde(skip_serializing_if = "Option::is_none")] - pub requested: Option>, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UpdateSetupIntentPaymentMethodDataBillingDetailsAddress { - /// City, district, suburb, town, or village. - #[serde(skip_serializing_if = "Option::is_none")] - pub city: Option, - - /// Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). - #[serde(skip_serializing_if = "Option::is_none")] - pub country: Option, - - /// Address line 1 (e.g., street, PO Box, or company name). - #[serde(skip_serializing_if = "Option::is_none")] - pub line1: Option, - - /// Address line 2 (e.g., apartment, suite, unit, or building). - #[serde(skip_serializing_if = "Option::is_none")] - pub line2: Option, - - /// ZIP or postal code. - #[serde(skip_serializing_if = "Option::is_none")] - pub postal_code: Option, - - /// State, county, province, or region. - #[serde(skip_serializing_if = "Option::is_none")] - pub state: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UpdateSetupIntentPaymentMethodDataKlarnaDob { - /// The day of birth, between 1 and 31. - pub day: i64, - - /// The month of birth, between 1 and 12. - pub month: i64, - - /// The four-digit year of birth. - pub year: i64, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UpdateSetupIntentPaymentMethodOptionsAcssDebitMandateOptions { - /// A URL for custom mandate text to render during confirmation step. - /// The URL will be rendered with additional GET parameters `payment_intent` and `payment_intent_client_secret` when confirming a Payment Intent, - /// or `setup_intent` and `setup_intent_client_secret` when confirming a Setup Intent. - #[serde(skip_serializing_if = "Option::is_none")] - pub custom_mandate_url: Option, - - /// List of Stripe products where this mandate can be selected automatically. - #[serde(skip_serializing_if = "Option::is_none")] - pub default_for: - Option>, - - /// Description of the mandate interval. - /// - /// Only required if 'payment_schedule' parameter is 'interval' or 'combined'. - #[serde(skip_serializing_if = "Option::is_none")] - pub interval_description: Option, - - /// Payment schedule for the mandate. - #[serde(skip_serializing_if = "Option::is_none")] - pub payment_schedule: - Option, - - /// Transaction type of the mandate. - #[serde(skip_serializing_if = "Option::is_none")] - pub transaction_type: - Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UpdateSetupIntentPaymentMethodOptionsCardMandateOptions { - /// Amount to be charged for future payments. - pub amount: i64, - - /// One of `fixed` or `maximum`. - /// - /// If `fixed`, the `amount` param refers to the exact amount to be charged in future payments. - /// If `maximum`, the amount charged can be up to the value passed for the `amount` param. - pub amount_type: UpdateSetupIntentPaymentMethodOptionsCardMandateOptionsAmountType, - - /// Currency in which future payments will be charged. - /// - /// Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. - /// Must be a [supported currency](https://stripe.com/docs/currencies). - pub currency: Currency, - - /// A description of the mandate or subscription that is meant to be displayed to the customer. - #[serde(skip_serializing_if = "Option::is_none")] - pub description: Option, - - /// End date of the mandate or subscription. - /// - /// If not provided, the mandate will be active until canceled. - /// If provided, end date should be after start date. - #[serde(skip_serializing_if = "Option::is_none")] - pub end_date: Option, - - /// Specifies payment frequency. - /// - /// One of `day`, `week`, `month`, `year`, or `sporadic`. - pub interval: UpdateSetupIntentPaymentMethodOptionsCardMandateOptionsInterval, - - /// The number of intervals between payments. - /// - /// For example, `interval=month` and `interval_count=3` indicates one payment every three months. - /// Maximum of one year interval allowed (1 year, 12 months, or 52 weeks). - /// This parameter is optional when `interval=sporadic`. - #[serde(skip_serializing_if = "Option::is_none")] - pub interval_count: Option, - - /// Unique identifier for the mandate or subscription. - pub reference: String, - - /// Start date of the mandate or subscription. - /// - /// Start date should not be lesser than yesterday. - pub start_date: Timestamp, - - /// Specifies the type of mandates supported. - /// - /// Possible values are `india`. - #[serde(skip_serializing_if = "Option::is_none")] - pub supported_types: - Option>, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UpdateSetupIntentPaymentMethodOptionsCardThreeDSecure { - /// The `transStatus` returned from the card Issuer’s ACS in the ARes. - #[serde(skip_serializing_if = "Option::is_none")] - pub ares_trans_status: - Option, - - /// The cryptogram, also known as the "authentication value" (AAV, CAVV or - /// AEVV). - /// - /// This value is 20 bytes, base64-encoded into a 28-character string. (Most 3D Secure providers will return the base64-encoded version, which is what you should specify here.). - #[serde(skip_serializing_if = "Option::is_none")] - pub cryptogram: Option, - - /// The Electronic Commerce Indicator (ECI) is returned by your 3D Secure - /// provider and indicates what degree of authentication was performed. - #[serde(skip_serializing_if = "Option::is_none")] - pub electronic_commerce_indicator: - Option, - - /// Network specific 3DS fields. - /// - /// Network specific arguments require an explicit card brand choice. - /// The parameter `payment_method_options.card.network`` must be populated accordingly. - #[serde(skip_serializing_if = "Option::is_none")] - pub network_options: - Option, - - /// The challenge indicator (`threeDSRequestorChallengeInd`) which was requested in the - /// AReq sent to the card Issuer's ACS. - /// - /// A string containing 2 digits from 01-99. - #[serde(skip_serializing_if = "Option::is_none")] - pub requestor_challenge_indicator: Option, - - /// For 3D Secure 1, the XID. - /// - /// For 3D Secure 2, the Directory Server Transaction ID (dsTransID). - #[serde(skip_serializing_if = "Option::is_none")] - pub transaction_id: Option, - - /// The version of 3D Secure that was performed. - #[serde(skip_serializing_if = "Option::is_none")] - pub version: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UpdateSetupIntentPaymentMethodOptionsSepaDebitMandateOptions {} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UpdateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnections { - /// The list of permissions to request. - /// - /// If this parameter is passed, the `payment_method` permission must be included. - /// Valid permissions include: `balances`, `ownership`, `payment_method`, and `transactions`. - #[serde(skip_serializing_if = "Option::is_none")] - pub permissions: Option< - Vec, - >, - - /// List of data features that you would like to retrieve upon account creation. - #[serde(skip_serializing_if = "Option::is_none")] - pub prefetch: - Option>, - - /// For webview integrations only. - /// - /// Upon completing OAuth login in the native browser, the user will be redirected to this URL to return to your app. - #[serde(skip_serializing_if = "Option::is_none")] - pub return_url: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UpdateSetupIntentPaymentMethodOptionsUsBankAccountMandateOptions { - /// The method used to collect offline mandate customer acceptance. - #[serde(skip_serializing_if = "Option::is_none")] - pub collection_method: - Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UpdateSetupIntentPaymentMethodOptionsUsBankAccountNetworks { - /// Triggers validations to run across the selected networks. - #[serde(skip_serializing_if = "Option::is_none")] - pub requested: Option>, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreateSetupIntentPaymentMethodOptionsCardThreeDSecureNetworkOptions { - /// Cartes Bancaires-specific 3DS fields. - #[serde(skip_serializing_if = "Option::is_none")] - pub cartes_bancaires: - Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UpdateSetupIntentPaymentMethodOptionsCardThreeDSecureNetworkOptions { - /// Cartes Bancaires-specific 3DS fields. - #[serde(skip_serializing_if = "Option::is_none")] - pub cartes_bancaires: - Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreateSetupIntentPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancaires { - /// The cryptogram calculation algorithm used by the card Issuer's ACS - /// to calculate the Authentication cryptogram. - /// - /// Also known as `cavvAlgorithm`. messageExtension: CB-AVALGO. - pub cb_avalgo: - CreateSetupIntentPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancairesCbAvalgo, - - /// The exemption indicator returned from Cartes Bancaires in the ARes. - /// message extension: CB-EXEMPTION; string (4 characters) - /// This is a 3 byte bitmap (low significant byte first and most significant - /// bit first) that has been Base64 encoded. - #[serde(skip_serializing_if = "Option::is_none")] - pub cb_exemption: Option, - - /// The risk score returned from Cartes Bancaires in the ARes. - /// message extension: CB-SCORE; numeric value 0-99. - #[serde(skip_serializing_if = "Option::is_none")] - pub cb_score: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UpdateSetupIntentPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancaires { - /// The cryptogram calculation algorithm used by the card Issuer's ACS - /// to calculate the Authentication cryptogram. - /// - /// Also known as `cavvAlgorithm`. messageExtension: CB-AVALGO. - pub cb_avalgo: - UpdateSetupIntentPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancairesCbAvalgo, - - /// The exemption indicator returned from Cartes Bancaires in the ARes. - /// message extension: CB-EXEMPTION; string (4 characters) - /// This is a 3 byte bitmap (low significant byte first and most significant - /// bit first) that has been Base64 encoded. - #[serde(skip_serializing_if = "Option::is_none")] - pub cb_exemption: Option, - - /// The risk score returned from Cartes Bancaires in the ARes. - /// message extension: CB-SCORE; numeric value 0-99. - #[serde(skip_serializing_if = "Option::is_none")] - pub cb_score: Option, -} - -/// An enum representing the possible values of an `CreateSetupIntentAutomaticPaymentMethods`'s `allow_redirects` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CreateSetupIntentAutomaticPaymentMethodsAllowRedirects { - Always, - Never, -} - -impl CreateSetupIntentAutomaticPaymentMethodsAllowRedirects { - pub fn as_str(self) -> &'static str { - match self { - CreateSetupIntentAutomaticPaymentMethodsAllowRedirects::Always => "always", - CreateSetupIntentAutomaticPaymentMethodsAllowRedirects::Never => "never", - } - } -} - -impl AsRef for CreateSetupIntentAutomaticPaymentMethodsAllowRedirects { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for CreateSetupIntentAutomaticPaymentMethodsAllowRedirects { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for CreateSetupIntentAutomaticPaymentMethodsAllowRedirects { - fn default() -> Self { - Self::Always - } -} - -/// An enum representing the possible values of an `CreateSetupIntent`'s `flow_directions` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CreateSetupIntentFlowDirections { - Inbound, - Outbound, -} - -impl CreateSetupIntentFlowDirections { - pub fn as_str(self) -> &'static str { - match self { - CreateSetupIntentFlowDirections::Inbound => "inbound", - CreateSetupIntentFlowDirections::Outbound => "outbound", - } - } -} - -impl AsRef for CreateSetupIntentFlowDirections { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for CreateSetupIntentFlowDirections { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for CreateSetupIntentFlowDirections { - fn default() -> Self { - Self::Inbound - } -} - -/// An enum representing the possible values of an `CreateSetupIntentMandateDataCustomerAcceptance`'s `type` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CreateSetupIntentMandateDataCustomerAcceptanceType { - Offline, - Online, -} - -impl CreateSetupIntentMandateDataCustomerAcceptanceType { - pub fn as_str(self) -> &'static str { - match self { - CreateSetupIntentMandateDataCustomerAcceptanceType::Offline => "offline", - CreateSetupIntentMandateDataCustomerAcceptanceType::Online => "online", - } - } -} - -impl AsRef for CreateSetupIntentMandateDataCustomerAcceptanceType { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for CreateSetupIntentMandateDataCustomerAcceptanceType { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for CreateSetupIntentMandateDataCustomerAcceptanceType { - fn default() -> Self { - Self::Offline - } -} - -/// An enum representing the possible values of an `CreateSetupIntentPaymentMethodDataEps`'s `bank` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CreateSetupIntentPaymentMethodDataEpsBank { - ArzteUndApothekerBank, - AustrianAnadiBankAg, - BankAustria, - BankhausCarlSpangler, - BankhausSchelhammerUndSchatteraAg, - BawagPskAg, - BksBankAg, - BrullKallmusBankAg, - BtvVierLanderBank, - CapitalBankGraweGruppeAg, - DeutscheBankAg, - Dolomitenbank, - EasybankAg, - ErsteBankUndSparkassen, - HypoAlpeadriabankInternationalAg, - HypoBankBurgenlandAktiengesellschaft, - HypoNoeLbFurNiederosterreichUWien, - HypoOberosterreichSalzburgSteiermark, - HypoTirolBankAg, - HypoVorarlbergBankAg, - MarchfelderBank, - OberbankAg, - RaiffeisenBankengruppeOsterreich, - SchoellerbankAg, - SpardaBankWien, - VolksbankGruppe, - VolkskreditbankAg, - VrBankBraunau, -} - -impl CreateSetupIntentPaymentMethodDataEpsBank { - pub fn as_str(self) -> &'static str { - match self { - CreateSetupIntentPaymentMethodDataEpsBank::ArzteUndApothekerBank => { - "arzte_und_apotheker_bank" - } - CreateSetupIntentPaymentMethodDataEpsBank::AustrianAnadiBankAg => { - "austrian_anadi_bank_ag" - } - CreateSetupIntentPaymentMethodDataEpsBank::BankAustria => "bank_austria", - CreateSetupIntentPaymentMethodDataEpsBank::BankhausCarlSpangler => { - "bankhaus_carl_spangler" - } - CreateSetupIntentPaymentMethodDataEpsBank::BankhausSchelhammerUndSchatteraAg => { - "bankhaus_schelhammer_und_schattera_ag" - } - CreateSetupIntentPaymentMethodDataEpsBank::BawagPskAg => "bawag_psk_ag", - CreateSetupIntentPaymentMethodDataEpsBank::BksBankAg => "bks_bank_ag", - CreateSetupIntentPaymentMethodDataEpsBank::BrullKallmusBankAg => { - "brull_kallmus_bank_ag" - } - CreateSetupIntentPaymentMethodDataEpsBank::BtvVierLanderBank => "btv_vier_lander_bank", - CreateSetupIntentPaymentMethodDataEpsBank::CapitalBankGraweGruppeAg => { - "capital_bank_grawe_gruppe_ag" - } - CreateSetupIntentPaymentMethodDataEpsBank::DeutscheBankAg => "deutsche_bank_ag", - CreateSetupIntentPaymentMethodDataEpsBank::Dolomitenbank => "dolomitenbank", - CreateSetupIntentPaymentMethodDataEpsBank::EasybankAg => "easybank_ag", - CreateSetupIntentPaymentMethodDataEpsBank::ErsteBankUndSparkassen => { - "erste_bank_und_sparkassen" - } - CreateSetupIntentPaymentMethodDataEpsBank::HypoAlpeadriabankInternationalAg => { - "hypo_alpeadriabank_international_ag" - } - CreateSetupIntentPaymentMethodDataEpsBank::HypoBankBurgenlandAktiengesellschaft => { - "hypo_bank_burgenland_aktiengesellschaft" - } - CreateSetupIntentPaymentMethodDataEpsBank::HypoNoeLbFurNiederosterreichUWien => { - "hypo_noe_lb_fur_niederosterreich_u_wien" - } - CreateSetupIntentPaymentMethodDataEpsBank::HypoOberosterreichSalzburgSteiermark => { - "hypo_oberosterreich_salzburg_steiermark" - } - CreateSetupIntentPaymentMethodDataEpsBank::HypoTirolBankAg => "hypo_tirol_bank_ag", - CreateSetupIntentPaymentMethodDataEpsBank::HypoVorarlbergBankAg => { - "hypo_vorarlberg_bank_ag" - } - CreateSetupIntentPaymentMethodDataEpsBank::MarchfelderBank => "marchfelder_bank", - CreateSetupIntentPaymentMethodDataEpsBank::OberbankAg => "oberbank_ag", - CreateSetupIntentPaymentMethodDataEpsBank::RaiffeisenBankengruppeOsterreich => { - "raiffeisen_bankengruppe_osterreich" - } - CreateSetupIntentPaymentMethodDataEpsBank::SchoellerbankAg => "schoellerbank_ag", - CreateSetupIntentPaymentMethodDataEpsBank::SpardaBankWien => "sparda_bank_wien", - CreateSetupIntentPaymentMethodDataEpsBank::VolksbankGruppe => "volksbank_gruppe", - CreateSetupIntentPaymentMethodDataEpsBank::VolkskreditbankAg => "volkskreditbank_ag", - CreateSetupIntentPaymentMethodDataEpsBank::VrBankBraunau => "vr_bank_braunau", - } - } -} - -impl AsRef for CreateSetupIntentPaymentMethodDataEpsBank { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for CreateSetupIntentPaymentMethodDataEpsBank { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for CreateSetupIntentPaymentMethodDataEpsBank { - fn default() -> Self { - Self::ArzteUndApothekerBank - } -} - -/// An enum representing the possible values of an `CreateSetupIntentPaymentMethodDataFpx`'s `account_holder_type` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CreateSetupIntentPaymentMethodDataFpxAccountHolderType { - Company, - Individual, -} - -impl CreateSetupIntentPaymentMethodDataFpxAccountHolderType { - pub fn as_str(self) -> &'static str { - match self { - CreateSetupIntentPaymentMethodDataFpxAccountHolderType::Company => "company", - CreateSetupIntentPaymentMethodDataFpxAccountHolderType::Individual => "individual", - } - } -} - -impl AsRef for CreateSetupIntentPaymentMethodDataFpxAccountHolderType { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for CreateSetupIntentPaymentMethodDataFpxAccountHolderType { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for CreateSetupIntentPaymentMethodDataFpxAccountHolderType { - fn default() -> Self { - Self::Company - } -} - -/// An enum representing the possible values of an `CreateSetupIntentPaymentMethodDataFpx`'s `bank` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CreateSetupIntentPaymentMethodDataFpxBank { - AffinBank, - Agrobank, - AllianceBank, - Ambank, - BankIslam, - BankMuamalat, - BankOfChina, - BankRakyat, - Bsn, - Cimb, - DeutscheBank, - HongLeongBank, - Hsbc, - Kfh, - Maybank2e, - Maybank2u, - Ocbc, - PbEnterprise, - PublicBank, - Rhb, - StandardChartered, - Uob, -} - -impl CreateSetupIntentPaymentMethodDataFpxBank { - pub fn as_str(self) -> &'static str { - match self { - CreateSetupIntentPaymentMethodDataFpxBank::AffinBank => "affin_bank", - CreateSetupIntentPaymentMethodDataFpxBank::Agrobank => "agrobank", - CreateSetupIntentPaymentMethodDataFpxBank::AllianceBank => "alliance_bank", - CreateSetupIntentPaymentMethodDataFpxBank::Ambank => "ambank", - CreateSetupIntentPaymentMethodDataFpxBank::BankIslam => "bank_islam", - CreateSetupIntentPaymentMethodDataFpxBank::BankMuamalat => "bank_muamalat", - CreateSetupIntentPaymentMethodDataFpxBank::BankOfChina => "bank_of_china", - CreateSetupIntentPaymentMethodDataFpxBank::BankRakyat => "bank_rakyat", - CreateSetupIntentPaymentMethodDataFpxBank::Bsn => "bsn", - CreateSetupIntentPaymentMethodDataFpxBank::Cimb => "cimb", - CreateSetupIntentPaymentMethodDataFpxBank::DeutscheBank => "deutsche_bank", - CreateSetupIntentPaymentMethodDataFpxBank::HongLeongBank => "hong_leong_bank", - CreateSetupIntentPaymentMethodDataFpxBank::Hsbc => "hsbc", - CreateSetupIntentPaymentMethodDataFpxBank::Kfh => "kfh", - CreateSetupIntentPaymentMethodDataFpxBank::Maybank2e => "maybank2e", - CreateSetupIntentPaymentMethodDataFpxBank::Maybank2u => "maybank2u", - CreateSetupIntentPaymentMethodDataFpxBank::Ocbc => "ocbc", - CreateSetupIntentPaymentMethodDataFpxBank::PbEnterprise => "pb_enterprise", - CreateSetupIntentPaymentMethodDataFpxBank::PublicBank => "public_bank", - CreateSetupIntentPaymentMethodDataFpxBank::Rhb => "rhb", - CreateSetupIntentPaymentMethodDataFpxBank::StandardChartered => "standard_chartered", - CreateSetupIntentPaymentMethodDataFpxBank::Uob => "uob", - } - } -} - -impl AsRef for CreateSetupIntentPaymentMethodDataFpxBank { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for CreateSetupIntentPaymentMethodDataFpxBank { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for CreateSetupIntentPaymentMethodDataFpxBank { - fn default() -> Self { - Self::AffinBank - } -} - -/// An enum representing the possible values of an `CreateSetupIntentPaymentMethodDataIdeal`'s `bank` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CreateSetupIntentPaymentMethodDataIdealBank { - AbnAmro, - AsnBank, - Bunq, - Handelsbanken, - Ing, - Knab, - Moneyou, - N26, - Nn, - Rabobank, - Regiobank, - Revolut, - SnsBank, - TriodosBank, - VanLanschot, - Yoursafe, -} - -impl CreateSetupIntentPaymentMethodDataIdealBank { - pub fn as_str(self) -> &'static str { - match self { - CreateSetupIntentPaymentMethodDataIdealBank::AbnAmro => "abn_amro", - CreateSetupIntentPaymentMethodDataIdealBank::AsnBank => "asn_bank", - CreateSetupIntentPaymentMethodDataIdealBank::Bunq => "bunq", - CreateSetupIntentPaymentMethodDataIdealBank::Handelsbanken => "handelsbanken", - CreateSetupIntentPaymentMethodDataIdealBank::Ing => "ing", - CreateSetupIntentPaymentMethodDataIdealBank::Knab => "knab", - CreateSetupIntentPaymentMethodDataIdealBank::Moneyou => "moneyou", - CreateSetupIntentPaymentMethodDataIdealBank::N26 => "n26", - CreateSetupIntentPaymentMethodDataIdealBank::Nn => "nn", - CreateSetupIntentPaymentMethodDataIdealBank::Rabobank => "rabobank", - CreateSetupIntentPaymentMethodDataIdealBank::Regiobank => "regiobank", - CreateSetupIntentPaymentMethodDataIdealBank::Revolut => "revolut", - CreateSetupIntentPaymentMethodDataIdealBank::SnsBank => "sns_bank", - CreateSetupIntentPaymentMethodDataIdealBank::TriodosBank => "triodos_bank", - CreateSetupIntentPaymentMethodDataIdealBank::VanLanschot => "van_lanschot", - CreateSetupIntentPaymentMethodDataIdealBank::Yoursafe => "yoursafe", - } - } -} - -impl AsRef for CreateSetupIntentPaymentMethodDataIdealBank { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for CreateSetupIntentPaymentMethodDataIdealBank { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for CreateSetupIntentPaymentMethodDataIdealBank { - fn default() -> Self { - Self::AbnAmro - } -} - -/// An enum representing the possible values of an `CreateSetupIntentPaymentMethodDataP24`'s `bank` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CreateSetupIntentPaymentMethodDataP24Bank { - AliorBank, - BankMillennium, - BankNowyBfgSa, - BankPekaoSa, - BankiSpbdzielcze, - Blik, - BnpParibas, - Boz, - CitiHandlowy, - CreditAgricole, - Envelobank, - EtransferPocztowy24, - GetinBank, - Ideabank, - Ing, - Inteligo, - MbankMtransfer, - NestPrzelew, - NoblePay, - PbacZIpko, - PlusBank, - SantanderPrzelew24, - TmobileUsbugiBankowe, - ToyotaBank, - Velobank, - VolkswagenBank, -} - -impl CreateSetupIntentPaymentMethodDataP24Bank { - pub fn as_str(self) -> &'static str { - match self { - CreateSetupIntentPaymentMethodDataP24Bank::AliorBank => "alior_bank", - CreateSetupIntentPaymentMethodDataP24Bank::BankMillennium => "bank_millennium", - CreateSetupIntentPaymentMethodDataP24Bank::BankNowyBfgSa => "bank_nowy_bfg_sa", - CreateSetupIntentPaymentMethodDataP24Bank::BankPekaoSa => "bank_pekao_sa", - CreateSetupIntentPaymentMethodDataP24Bank::BankiSpbdzielcze => "banki_spbdzielcze", - CreateSetupIntentPaymentMethodDataP24Bank::Blik => "blik", - CreateSetupIntentPaymentMethodDataP24Bank::BnpParibas => "bnp_paribas", - CreateSetupIntentPaymentMethodDataP24Bank::Boz => "boz", - CreateSetupIntentPaymentMethodDataP24Bank::CitiHandlowy => "citi_handlowy", - CreateSetupIntentPaymentMethodDataP24Bank::CreditAgricole => "credit_agricole", - CreateSetupIntentPaymentMethodDataP24Bank::Envelobank => "envelobank", - CreateSetupIntentPaymentMethodDataP24Bank::EtransferPocztowy24 => { - "etransfer_pocztowy24" - } - CreateSetupIntentPaymentMethodDataP24Bank::GetinBank => "getin_bank", - CreateSetupIntentPaymentMethodDataP24Bank::Ideabank => "ideabank", - CreateSetupIntentPaymentMethodDataP24Bank::Ing => "ing", - CreateSetupIntentPaymentMethodDataP24Bank::Inteligo => "inteligo", - CreateSetupIntentPaymentMethodDataP24Bank::MbankMtransfer => "mbank_mtransfer", - CreateSetupIntentPaymentMethodDataP24Bank::NestPrzelew => "nest_przelew", - CreateSetupIntentPaymentMethodDataP24Bank::NoblePay => "noble_pay", - CreateSetupIntentPaymentMethodDataP24Bank::PbacZIpko => "pbac_z_ipko", - CreateSetupIntentPaymentMethodDataP24Bank::PlusBank => "plus_bank", - CreateSetupIntentPaymentMethodDataP24Bank::SantanderPrzelew24 => "santander_przelew24", - CreateSetupIntentPaymentMethodDataP24Bank::TmobileUsbugiBankowe => { - "tmobile_usbugi_bankowe" - } - CreateSetupIntentPaymentMethodDataP24Bank::ToyotaBank => "toyota_bank", - CreateSetupIntentPaymentMethodDataP24Bank::Velobank => "velobank", - CreateSetupIntentPaymentMethodDataP24Bank::VolkswagenBank => "volkswagen_bank", - } - } -} - -impl AsRef for CreateSetupIntentPaymentMethodDataP24Bank { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for CreateSetupIntentPaymentMethodDataP24Bank { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for CreateSetupIntentPaymentMethodDataP24Bank { - fn default() -> Self { - Self::AliorBank - } -} - -/// An enum representing the possible values of an `CreateSetupIntentPaymentMethodDataSofort`'s `country` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CreateSetupIntentPaymentMethodDataSofortCountry { - #[serde(rename = "AT")] - At, - #[serde(rename = "BE")] - Be, - #[serde(rename = "DE")] - De, - #[serde(rename = "ES")] - Es, - #[serde(rename = "IT")] - It, - #[serde(rename = "NL")] - Nl, -} - -impl CreateSetupIntentPaymentMethodDataSofortCountry { - pub fn as_str(self) -> &'static str { - match self { - CreateSetupIntentPaymentMethodDataSofortCountry::At => "AT", - CreateSetupIntentPaymentMethodDataSofortCountry::Be => "BE", - CreateSetupIntentPaymentMethodDataSofortCountry::De => "DE", - CreateSetupIntentPaymentMethodDataSofortCountry::Es => "ES", - CreateSetupIntentPaymentMethodDataSofortCountry::It => "IT", - CreateSetupIntentPaymentMethodDataSofortCountry::Nl => "NL", - } - } -} - -impl AsRef for CreateSetupIntentPaymentMethodDataSofortCountry { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for CreateSetupIntentPaymentMethodDataSofortCountry { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for CreateSetupIntentPaymentMethodDataSofortCountry { - fn default() -> Self { - Self::At - } -} - -/// An enum representing the possible values of an `CreateSetupIntentPaymentMethodData`'s `type` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CreateSetupIntentPaymentMethodDataType { - AcssDebit, - Affirm, - AfterpayClearpay, - Alipay, - AuBecsDebit, - BacsDebit, - Bancontact, - Blik, - Boleto, - Cashapp, - CustomerBalance, - Eps, - Fpx, - Giropay, - Grabpay, - Ideal, - Klarna, - Konbini, - Link, - Oxxo, - P24, - Paynow, - Paypal, - Pix, - Promptpay, - RevolutPay, - SepaDebit, - Sofort, - Swish, - UsBankAccount, - WechatPay, - Zip, -} - -impl CreateSetupIntentPaymentMethodDataType { - pub fn as_str(self) -> &'static str { - match self { - CreateSetupIntentPaymentMethodDataType::AcssDebit => "acss_debit", - CreateSetupIntentPaymentMethodDataType::Affirm => "affirm", - CreateSetupIntentPaymentMethodDataType::AfterpayClearpay => "afterpay_clearpay", - CreateSetupIntentPaymentMethodDataType::Alipay => "alipay", - CreateSetupIntentPaymentMethodDataType::AuBecsDebit => "au_becs_debit", - CreateSetupIntentPaymentMethodDataType::BacsDebit => "bacs_debit", - CreateSetupIntentPaymentMethodDataType::Bancontact => "bancontact", - CreateSetupIntentPaymentMethodDataType::Blik => "blik", - CreateSetupIntentPaymentMethodDataType::Boleto => "boleto", - CreateSetupIntentPaymentMethodDataType::Cashapp => "cashapp", - CreateSetupIntentPaymentMethodDataType::CustomerBalance => "customer_balance", - CreateSetupIntentPaymentMethodDataType::Eps => "eps", - CreateSetupIntentPaymentMethodDataType::Fpx => "fpx", - CreateSetupIntentPaymentMethodDataType::Giropay => "giropay", - CreateSetupIntentPaymentMethodDataType::Grabpay => "grabpay", - CreateSetupIntentPaymentMethodDataType::Ideal => "ideal", - CreateSetupIntentPaymentMethodDataType::Klarna => "klarna", - CreateSetupIntentPaymentMethodDataType::Konbini => "konbini", - CreateSetupIntentPaymentMethodDataType::Link => "link", - CreateSetupIntentPaymentMethodDataType::Oxxo => "oxxo", - CreateSetupIntentPaymentMethodDataType::P24 => "p24", - CreateSetupIntentPaymentMethodDataType::Paynow => "paynow", - CreateSetupIntentPaymentMethodDataType::Paypal => "paypal", - CreateSetupIntentPaymentMethodDataType::Pix => "pix", - CreateSetupIntentPaymentMethodDataType::Promptpay => "promptpay", - CreateSetupIntentPaymentMethodDataType::RevolutPay => "revolut_pay", - CreateSetupIntentPaymentMethodDataType::SepaDebit => "sepa_debit", - CreateSetupIntentPaymentMethodDataType::Sofort => "sofort", - CreateSetupIntentPaymentMethodDataType::Swish => "swish", - CreateSetupIntentPaymentMethodDataType::UsBankAccount => "us_bank_account", - CreateSetupIntentPaymentMethodDataType::WechatPay => "wechat_pay", - CreateSetupIntentPaymentMethodDataType::Zip => "zip", - } - } -} - -impl AsRef for CreateSetupIntentPaymentMethodDataType { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for CreateSetupIntentPaymentMethodDataType { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for CreateSetupIntentPaymentMethodDataType { - fn default() -> Self { - Self::AcssDebit - } -} - -/// An enum representing the possible values of an `CreateSetupIntentPaymentMethodDataUsBankAccount`'s `account_holder_type` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CreateSetupIntentPaymentMethodDataUsBankAccountAccountHolderType { - Company, - Individual, -} - -impl CreateSetupIntentPaymentMethodDataUsBankAccountAccountHolderType { - pub fn as_str(self) -> &'static str { - match self { - CreateSetupIntentPaymentMethodDataUsBankAccountAccountHolderType::Company => "company", - CreateSetupIntentPaymentMethodDataUsBankAccountAccountHolderType::Individual => { - "individual" - } - } - } -} - -impl AsRef for CreateSetupIntentPaymentMethodDataUsBankAccountAccountHolderType { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for CreateSetupIntentPaymentMethodDataUsBankAccountAccountHolderType { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for CreateSetupIntentPaymentMethodDataUsBankAccountAccountHolderType { - fn default() -> Self { - Self::Company - } -} - -/// An enum representing the possible values of an `CreateSetupIntentPaymentMethodDataUsBankAccount`'s `account_type` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CreateSetupIntentPaymentMethodDataUsBankAccountAccountType { - Checking, - Savings, -} - -impl CreateSetupIntentPaymentMethodDataUsBankAccountAccountType { - pub fn as_str(self) -> &'static str { - match self { - CreateSetupIntentPaymentMethodDataUsBankAccountAccountType::Checking => "checking", - CreateSetupIntentPaymentMethodDataUsBankAccountAccountType::Savings => "savings", - } - } -} - -impl AsRef for CreateSetupIntentPaymentMethodDataUsBankAccountAccountType { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for CreateSetupIntentPaymentMethodDataUsBankAccountAccountType { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for CreateSetupIntentPaymentMethodDataUsBankAccountAccountType { - fn default() -> Self { - Self::Checking - } -} - -/// An enum representing the possible values of an `CreateSetupIntentPaymentMethodOptionsAcssDebitMandateOptions`'s `default_for` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CreateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsDefaultFor { - Invoice, - Subscription, -} - -impl CreateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsDefaultFor { - pub fn as_str(self) -> &'static str { - match self { - CreateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsDefaultFor::Invoice => "invoice", - CreateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsDefaultFor::Subscription => "subscription", - } - } -} - -impl AsRef for CreateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsDefaultFor { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for CreateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsDefaultFor { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default - for CreateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsDefaultFor -{ - fn default() -> Self { - Self::Invoice - } -} - -/// An enum representing the possible values of an `CreateSetupIntentPaymentMethodOptionsAcssDebitMandateOptions`'s `payment_schedule` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CreateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsPaymentSchedule { - Combined, - Interval, - Sporadic, -} - -impl CreateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsPaymentSchedule { - pub fn as_str(self) -> &'static str { - match self { - CreateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsPaymentSchedule::Combined => "combined", - CreateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsPaymentSchedule::Interval => "interval", - CreateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsPaymentSchedule::Sporadic => "sporadic", - } - } -} - -impl AsRef for CreateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsPaymentSchedule { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display - for CreateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsPaymentSchedule -{ - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default - for CreateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsPaymentSchedule -{ - fn default() -> Self { - Self::Combined - } -} - -/// An enum representing the possible values of an `CreateSetupIntentPaymentMethodOptionsAcssDebitMandateOptions`'s `transaction_type` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CreateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsTransactionType { - Business, - Personal, -} - -impl CreateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsTransactionType { - pub fn as_str(self) -> &'static str { - match self { - CreateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsTransactionType::Business => "business", - CreateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsTransactionType::Personal => "personal", - } - } -} - -impl AsRef for CreateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsTransactionType { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display - for CreateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsTransactionType -{ - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default - for CreateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsTransactionType -{ - fn default() -> Self { - Self::Business - } -} - -/// An enum representing the possible values of an `CreateSetupIntentPaymentMethodOptionsAcssDebit`'s `verification_method` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CreateSetupIntentPaymentMethodOptionsAcssDebitVerificationMethod { - Automatic, - Instant, - Microdeposits, -} - -impl CreateSetupIntentPaymentMethodOptionsAcssDebitVerificationMethod { - pub fn as_str(self) -> &'static str { - match self { - CreateSetupIntentPaymentMethodOptionsAcssDebitVerificationMethod::Automatic => { - "automatic" - } - CreateSetupIntentPaymentMethodOptionsAcssDebitVerificationMethod::Instant => "instant", - CreateSetupIntentPaymentMethodOptionsAcssDebitVerificationMethod::Microdeposits => { - "microdeposits" - } - } - } -} - -impl AsRef for CreateSetupIntentPaymentMethodOptionsAcssDebitVerificationMethod { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for CreateSetupIntentPaymentMethodOptionsAcssDebitVerificationMethod { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for CreateSetupIntentPaymentMethodOptionsAcssDebitVerificationMethod { - fn default() -> Self { - Self::Automatic - } -} - -/// An enum representing the possible values of an `CreateSetupIntentPaymentMethodOptionsCardMandateOptions`'s `amount_type` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CreateSetupIntentPaymentMethodOptionsCardMandateOptionsAmountType { - Fixed, - Maximum, -} - -impl CreateSetupIntentPaymentMethodOptionsCardMandateOptionsAmountType { - pub fn as_str(self) -> &'static str { - match self { - CreateSetupIntentPaymentMethodOptionsCardMandateOptionsAmountType::Fixed => "fixed", - CreateSetupIntentPaymentMethodOptionsCardMandateOptionsAmountType::Maximum => "maximum", - } - } -} - -impl AsRef for CreateSetupIntentPaymentMethodOptionsCardMandateOptionsAmountType { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for CreateSetupIntentPaymentMethodOptionsCardMandateOptionsAmountType { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for CreateSetupIntentPaymentMethodOptionsCardMandateOptionsAmountType { - fn default() -> Self { - Self::Fixed - } -} - -/// An enum representing the possible values of an `CreateSetupIntentPaymentMethodOptionsCardMandateOptions`'s `interval` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CreateSetupIntentPaymentMethodOptionsCardMandateOptionsInterval { - Day, - Month, - Sporadic, - Week, - Year, -} - -impl CreateSetupIntentPaymentMethodOptionsCardMandateOptionsInterval { - pub fn as_str(self) -> &'static str { - match self { - CreateSetupIntentPaymentMethodOptionsCardMandateOptionsInterval::Day => "day", - CreateSetupIntentPaymentMethodOptionsCardMandateOptionsInterval::Month => "month", - CreateSetupIntentPaymentMethodOptionsCardMandateOptionsInterval::Sporadic => "sporadic", - CreateSetupIntentPaymentMethodOptionsCardMandateOptionsInterval::Week => "week", - CreateSetupIntentPaymentMethodOptionsCardMandateOptionsInterval::Year => "year", - } - } -} - -impl AsRef for CreateSetupIntentPaymentMethodOptionsCardMandateOptionsInterval { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for CreateSetupIntentPaymentMethodOptionsCardMandateOptionsInterval { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for CreateSetupIntentPaymentMethodOptionsCardMandateOptionsInterval { - fn default() -> Self { - Self::Day - } -} - -/// An enum representing the possible values of an `CreateSetupIntentPaymentMethodOptionsCardMandateOptions`'s `supported_types` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CreateSetupIntentPaymentMethodOptionsCardMandateOptionsSupportedTypes { - India, -} - -impl CreateSetupIntentPaymentMethodOptionsCardMandateOptionsSupportedTypes { - pub fn as_str(self) -> &'static str { - match self { - CreateSetupIntentPaymentMethodOptionsCardMandateOptionsSupportedTypes::India => "india", - } - } -} - -impl AsRef for CreateSetupIntentPaymentMethodOptionsCardMandateOptionsSupportedTypes { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for CreateSetupIntentPaymentMethodOptionsCardMandateOptionsSupportedTypes { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default - for CreateSetupIntentPaymentMethodOptionsCardMandateOptionsSupportedTypes -{ - fn default() -> Self { - Self::India - } -} - -/// An enum representing the possible values of an `CreateSetupIntentPaymentMethodOptionsCard`'s `network` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CreateSetupIntentPaymentMethodOptionsCardNetwork { - Amex, - CartesBancaires, - Diners, - Discover, - EftposAu, - Interac, - Jcb, - Mastercard, - Unionpay, - Unknown, - Visa, -} - -impl CreateSetupIntentPaymentMethodOptionsCardNetwork { - pub fn as_str(self) -> &'static str { - match self { - CreateSetupIntentPaymentMethodOptionsCardNetwork::Amex => "amex", - CreateSetupIntentPaymentMethodOptionsCardNetwork::CartesBancaires => "cartes_bancaires", - CreateSetupIntentPaymentMethodOptionsCardNetwork::Diners => "diners", - CreateSetupIntentPaymentMethodOptionsCardNetwork::Discover => "discover", - CreateSetupIntentPaymentMethodOptionsCardNetwork::EftposAu => "eftpos_au", - CreateSetupIntentPaymentMethodOptionsCardNetwork::Interac => "interac", - CreateSetupIntentPaymentMethodOptionsCardNetwork::Jcb => "jcb", - CreateSetupIntentPaymentMethodOptionsCardNetwork::Mastercard => "mastercard", - CreateSetupIntentPaymentMethodOptionsCardNetwork::Unionpay => "unionpay", - CreateSetupIntentPaymentMethodOptionsCardNetwork::Unknown => "unknown", - CreateSetupIntentPaymentMethodOptionsCardNetwork::Visa => "visa", - } - } -} - -impl AsRef for CreateSetupIntentPaymentMethodOptionsCardNetwork { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for CreateSetupIntentPaymentMethodOptionsCardNetwork { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for CreateSetupIntentPaymentMethodOptionsCardNetwork { - fn default() -> Self { - Self::Amex - } -} - -/// An enum representing the possible values of an `CreateSetupIntentPaymentMethodOptionsCard`'s `request_three_d_secure` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CreateSetupIntentPaymentMethodOptionsCardRequestThreeDSecure { - Any, - Automatic, - Challenge, -} - -impl CreateSetupIntentPaymentMethodOptionsCardRequestThreeDSecure { - pub fn as_str(self) -> &'static str { - match self { - CreateSetupIntentPaymentMethodOptionsCardRequestThreeDSecure::Any => "any", - CreateSetupIntentPaymentMethodOptionsCardRequestThreeDSecure::Automatic => "automatic", - CreateSetupIntentPaymentMethodOptionsCardRequestThreeDSecure::Challenge => "challenge", - } - } -} - -impl AsRef for CreateSetupIntentPaymentMethodOptionsCardRequestThreeDSecure { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for CreateSetupIntentPaymentMethodOptionsCardRequestThreeDSecure { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for CreateSetupIntentPaymentMethodOptionsCardRequestThreeDSecure { - fn default() -> Self { - Self::Any - } -} - -/// An enum representing the possible values of an `CreateSetupIntentPaymentMethodOptionsCardThreeDSecure`'s `ares_trans_status` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CreateSetupIntentPaymentMethodOptionsCardThreeDSecureAresTransStatus { - #[serde(rename = "A")] - A, - #[serde(rename = "C")] - C, - #[serde(rename = "I")] - I, - #[serde(rename = "N")] - N, - #[serde(rename = "R")] - R, - #[serde(rename = "U")] - U, - #[serde(rename = "Y")] - Y, -} - -impl CreateSetupIntentPaymentMethodOptionsCardThreeDSecureAresTransStatus { - pub fn as_str(self) -> &'static str { - match self { - CreateSetupIntentPaymentMethodOptionsCardThreeDSecureAresTransStatus::A => "A", - CreateSetupIntentPaymentMethodOptionsCardThreeDSecureAresTransStatus::C => "C", - CreateSetupIntentPaymentMethodOptionsCardThreeDSecureAresTransStatus::I => "I", - CreateSetupIntentPaymentMethodOptionsCardThreeDSecureAresTransStatus::N => "N", - CreateSetupIntentPaymentMethodOptionsCardThreeDSecureAresTransStatus::R => "R", - CreateSetupIntentPaymentMethodOptionsCardThreeDSecureAresTransStatus::U => "U", - CreateSetupIntentPaymentMethodOptionsCardThreeDSecureAresTransStatus::Y => "Y", - } - } -} - -impl AsRef for CreateSetupIntentPaymentMethodOptionsCardThreeDSecureAresTransStatus { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for CreateSetupIntentPaymentMethodOptionsCardThreeDSecureAresTransStatus { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default - for CreateSetupIntentPaymentMethodOptionsCardThreeDSecureAresTransStatus -{ - fn default() -> Self { - Self::A - } -} - -/// An enum representing the possible values of an `CreateSetupIntentPaymentMethodOptionsCardThreeDSecure`'s `electronic_commerce_indicator` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CreateSetupIntentPaymentMethodOptionsCardThreeDSecureElectronicCommerceIndicator { - #[serde(rename = "01")] - V01, - #[serde(rename = "02")] - V02, - #[serde(rename = "05")] - V05, - #[serde(rename = "06")] - V06, - #[serde(rename = "07")] - V07, -} - -impl CreateSetupIntentPaymentMethodOptionsCardThreeDSecureElectronicCommerceIndicator { - pub fn as_str(self) -> &'static str { - match self { - CreateSetupIntentPaymentMethodOptionsCardThreeDSecureElectronicCommerceIndicator::V01 => "01", - CreateSetupIntentPaymentMethodOptionsCardThreeDSecureElectronicCommerceIndicator::V02 => "02", - CreateSetupIntentPaymentMethodOptionsCardThreeDSecureElectronicCommerceIndicator::V05 => "05", - CreateSetupIntentPaymentMethodOptionsCardThreeDSecureElectronicCommerceIndicator::V06 => "06", - CreateSetupIntentPaymentMethodOptionsCardThreeDSecureElectronicCommerceIndicator::V07 => "07", - } - } -} - -impl AsRef - for CreateSetupIntentPaymentMethodOptionsCardThreeDSecureElectronicCommerceIndicator -{ - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display - for CreateSetupIntentPaymentMethodOptionsCardThreeDSecureElectronicCommerceIndicator -{ - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default - for CreateSetupIntentPaymentMethodOptionsCardThreeDSecureElectronicCommerceIndicator -{ - fn default() -> Self { - Self::V01 - } -} - -/// An enum representing the possible values of an `CreateSetupIntentPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancaires`'s `cb_avalgo` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CreateSetupIntentPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancairesCbAvalgo -{ - #[serde(rename = "0")] - V0, - #[serde(rename = "1")] - V1, - #[serde(rename = "2")] - V2, - #[serde(rename = "3")] - V3, - #[serde(rename = "4")] - V4, - #[serde(rename = "A")] - A, -} - -impl CreateSetupIntentPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancairesCbAvalgo { - pub fn as_str(self) -> &'static str { - match self { - CreateSetupIntentPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancairesCbAvalgo::V0 => "0", - CreateSetupIntentPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancairesCbAvalgo::V1 => "1", - CreateSetupIntentPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancairesCbAvalgo::V2 => "2", - CreateSetupIntentPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancairesCbAvalgo::V3 => "3", - CreateSetupIntentPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancairesCbAvalgo::V4 => "4", - CreateSetupIntentPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancairesCbAvalgo::A => "A", - } - } -} - -impl AsRef - for CreateSetupIntentPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancairesCbAvalgo -{ - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display - for CreateSetupIntentPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancairesCbAvalgo -{ - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default - for CreateSetupIntentPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancairesCbAvalgo -{ - fn default() -> Self { - Self::V0 - } -} - -/// An enum representing the possible values of an `CreateSetupIntentPaymentMethodOptionsCardThreeDSecure`'s `version` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CreateSetupIntentPaymentMethodOptionsCardThreeDSecureVersion { - #[serde(rename = "1.0.2")] - V1_0_2, - #[serde(rename = "2.1.0")] - V2_1_0, - #[serde(rename = "2.2.0")] - V2_2_0, -} - -impl CreateSetupIntentPaymentMethodOptionsCardThreeDSecureVersion { - pub fn as_str(self) -> &'static str { - match self { - CreateSetupIntentPaymentMethodOptionsCardThreeDSecureVersion::V1_0_2 => "1.0.2", - CreateSetupIntentPaymentMethodOptionsCardThreeDSecureVersion::V2_1_0 => "2.1.0", - CreateSetupIntentPaymentMethodOptionsCardThreeDSecureVersion::V2_2_0 => "2.2.0", - } - } -} - -impl AsRef for CreateSetupIntentPaymentMethodOptionsCardThreeDSecureVersion { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for CreateSetupIntentPaymentMethodOptionsCardThreeDSecureVersion { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for CreateSetupIntentPaymentMethodOptionsCardThreeDSecureVersion { - fn default() -> Self { - Self::V1_0_2 - } -} - -/// An enum representing the possible values of an `CreateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnections`'s `permissions` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CreateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions { - Balances, - Ownership, - PaymentMethod, - Transactions, -} - -impl CreateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions { - pub fn as_str(self) -> &'static str { - match self { - CreateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions::Balances => "balances", - CreateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions::Ownership => "ownership", - CreateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions::PaymentMethod => "payment_method", - CreateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions::Transactions => "transactions", - } - } -} - -impl AsRef - for CreateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions -{ - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display - for CreateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions -{ - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default - for CreateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions -{ - fn default() -> Self { - Self::Balances - } -} - -/// An enum representing the possible values of an `CreateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnections`'s `prefetch` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CreateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch { - Balances, - Transactions, -} - -impl CreateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch { - pub fn as_str(self) -> &'static str { - match self { - CreateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch::Balances => "balances", - CreateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch::Transactions => "transactions", - } - } -} - -impl AsRef for CreateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display - for CreateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch -{ - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default - for CreateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch -{ - fn default() -> Self { - Self::Balances - } -} - -/// An enum representing the possible values of an `CreateSetupIntentPaymentMethodOptionsUsBankAccountMandateOptions`'s `collection_method` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CreateSetupIntentPaymentMethodOptionsUsBankAccountMandateOptionsCollectionMethod { - Paper, -} - -impl CreateSetupIntentPaymentMethodOptionsUsBankAccountMandateOptionsCollectionMethod { - pub fn as_str(self) -> &'static str { - match self { - CreateSetupIntentPaymentMethodOptionsUsBankAccountMandateOptionsCollectionMethod::Paper => "paper", - } - } -} - -impl AsRef - for CreateSetupIntentPaymentMethodOptionsUsBankAccountMandateOptionsCollectionMethod -{ - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display - for CreateSetupIntentPaymentMethodOptionsUsBankAccountMandateOptionsCollectionMethod -{ - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default - for CreateSetupIntentPaymentMethodOptionsUsBankAccountMandateOptionsCollectionMethod -{ - fn default() -> Self { - Self::Paper - } -} - -/// An enum representing the possible values of an `CreateSetupIntentPaymentMethodOptionsUsBankAccountNetworks`'s `requested` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CreateSetupIntentPaymentMethodOptionsUsBankAccountNetworksRequested { - Ach, - UsDomesticWire, -} - -impl CreateSetupIntentPaymentMethodOptionsUsBankAccountNetworksRequested { - pub fn as_str(self) -> &'static str { - match self { - CreateSetupIntentPaymentMethodOptionsUsBankAccountNetworksRequested::Ach => "ach", - CreateSetupIntentPaymentMethodOptionsUsBankAccountNetworksRequested::UsDomesticWire => { - "us_domestic_wire" - } - } - } -} - -impl AsRef for CreateSetupIntentPaymentMethodOptionsUsBankAccountNetworksRequested { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for CreateSetupIntentPaymentMethodOptionsUsBankAccountNetworksRequested { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for CreateSetupIntentPaymentMethodOptionsUsBankAccountNetworksRequested { - fn default() -> Self { - Self::Ach - } -} - -/// An enum representing the possible values of an `CreateSetupIntentPaymentMethodOptionsUsBankAccount`'s `verification_method` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CreateSetupIntentPaymentMethodOptionsUsBankAccountVerificationMethod { - Automatic, - Instant, - Microdeposits, -} - -impl CreateSetupIntentPaymentMethodOptionsUsBankAccountVerificationMethod { - pub fn as_str(self) -> &'static str { - match self { - CreateSetupIntentPaymentMethodOptionsUsBankAccountVerificationMethod::Automatic => { - "automatic" - } - CreateSetupIntentPaymentMethodOptionsUsBankAccountVerificationMethod::Instant => { - "instant" - } - CreateSetupIntentPaymentMethodOptionsUsBankAccountVerificationMethod::Microdeposits => { - "microdeposits" - } - } - } -} - -impl AsRef for CreateSetupIntentPaymentMethodOptionsUsBankAccountVerificationMethod { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for CreateSetupIntentPaymentMethodOptionsUsBankAccountVerificationMethod { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default - for CreateSetupIntentPaymentMethodOptionsUsBankAccountVerificationMethod -{ - fn default() -> Self { - Self::Automatic - } -} - -/// An enum representing the possible values of an `PaymentFlowsAutomaticPaymentMethodsSetupIntent`'s `allow_redirects` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum PaymentFlowsAutomaticPaymentMethodsSetupIntentAllowRedirects { - Always, - Never, -} - -impl PaymentFlowsAutomaticPaymentMethodsSetupIntentAllowRedirects { - pub fn as_str(self) -> &'static str { - match self { - PaymentFlowsAutomaticPaymentMethodsSetupIntentAllowRedirects::Always => "always", - PaymentFlowsAutomaticPaymentMethodsSetupIntentAllowRedirects::Never => "never", - } - } -} - -impl AsRef for PaymentFlowsAutomaticPaymentMethodsSetupIntentAllowRedirects { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for PaymentFlowsAutomaticPaymentMethodsSetupIntentAllowRedirects { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for PaymentFlowsAutomaticPaymentMethodsSetupIntentAllowRedirects { - fn default() -> Self { - Self::Always - } -} - -/// An enum representing the possible values of an `SetupIntent`'s `cancellation_reason` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum SetupIntentCancellationReason { - Abandoned, - Duplicate, - RequestedByCustomer, -} - -impl SetupIntentCancellationReason { - pub fn as_str(self) -> &'static str { - match self { - SetupIntentCancellationReason::Abandoned => "abandoned", - SetupIntentCancellationReason::Duplicate => "duplicate", - SetupIntentCancellationReason::RequestedByCustomer => "requested_by_customer", - } - } -} - -impl AsRef for SetupIntentCancellationReason { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for SetupIntentCancellationReason { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for SetupIntentCancellationReason { - fn default() -> Self { - Self::Abandoned - } -} - -/// An enum representing the possible values of an `SetupIntent`'s `flow_directions` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum SetupIntentFlowDirections { - Inbound, - Outbound, -} - -impl SetupIntentFlowDirections { - pub fn as_str(self) -> &'static str { - match self { - SetupIntentFlowDirections::Inbound => "inbound", - SetupIntentFlowDirections::Outbound => "outbound", - } - } -} - -impl AsRef for SetupIntentFlowDirections { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for SetupIntentFlowDirections { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for SetupIntentFlowDirections { - fn default() -> Self { - Self::Inbound - } -} - -/// An enum representing the possible values of an `SetupIntentNextActionVerifyWithMicrodeposits`'s `microdeposit_type` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum SetupIntentNextActionVerifyWithMicrodepositsMicrodepositType { - Amounts, - DescriptorCode, -} - -impl SetupIntentNextActionVerifyWithMicrodepositsMicrodepositType { - pub fn as_str(self) -> &'static str { - match self { - SetupIntentNextActionVerifyWithMicrodepositsMicrodepositType::Amounts => "amounts", - SetupIntentNextActionVerifyWithMicrodepositsMicrodepositType::DescriptorCode => { - "descriptor_code" - } - } - } -} - -impl AsRef for SetupIntentNextActionVerifyWithMicrodepositsMicrodepositType { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for SetupIntentNextActionVerifyWithMicrodepositsMicrodepositType { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for SetupIntentNextActionVerifyWithMicrodepositsMicrodepositType { - fn default() -> Self { - Self::Amounts - } -} - -/// An enum representing the possible values of an `SetupIntentPaymentMethodOptionsAcssDebit`'s `verification_method` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum SetupIntentPaymentMethodOptionsAcssDebitVerificationMethod { - Automatic, - Instant, - Microdeposits, -} - -impl SetupIntentPaymentMethodOptionsAcssDebitVerificationMethod { - pub fn as_str(self) -> &'static str { - match self { - SetupIntentPaymentMethodOptionsAcssDebitVerificationMethod::Automatic => "automatic", - SetupIntentPaymentMethodOptionsAcssDebitVerificationMethod::Instant => "instant", - SetupIntentPaymentMethodOptionsAcssDebitVerificationMethod::Microdeposits => { - "microdeposits" - } - } - } -} - -impl AsRef for SetupIntentPaymentMethodOptionsAcssDebitVerificationMethod { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for SetupIntentPaymentMethodOptionsAcssDebitVerificationMethod { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for SetupIntentPaymentMethodOptionsAcssDebitVerificationMethod { - fn default() -> Self { - Self::Automatic - } -} - -/// An enum representing the possible values of an `SetupIntentPaymentMethodOptionsCardMandateOptions`'s `amount_type` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum SetupIntentPaymentMethodOptionsCardMandateOptionsAmountType { - Fixed, - Maximum, -} - -impl SetupIntentPaymentMethodOptionsCardMandateOptionsAmountType { - pub fn as_str(self) -> &'static str { - match self { - SetupIntentPaymentMethodOptionsCardMandateOptionsAmountType::Fixed => "fixed", - SetupIntentPaymentMethodOptionsCardMandateOptionsAmountType::Maximum => "maximum", - } - } -} - -impl AsRef for SetupIntentPaymentMethodOptionsCardMandateOptionsAmountType { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for SetupIntentPaymentMethodOptionsCardMandateOptionsAmountType { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for SetupIntentPaymentMethodOptionsCardMandateOptionsAmountType { - fn default() -> Self { - Self::Fixed - } -} - -/// An enum representing the possible values of an `SetupIntentPaymentMethodOptionsCardMandateOptions`'s `interval` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum SetupIntentPaymentMethodOptionsCardMandateOptionsInterval { - Day, - Month, - Sporadic, - Week, - Year, -} - -impl SetupIntentPaymentMethodOptionsCardMandateOptionsInterval { - pub fn as_str(self) -> &'static str { - match self { - SetupIntentPaymentMethodOptionsCardMandateOptionsInterval::Day => "day", - SetupIntentPaymentMethodOptionsCardMandateOptionsInterval::Month => "month", - SetupIntentPaymentMethodOptionsCardMandateOptionsInterval::Sporadic => "sporadic", - SetupIntentPaymentMethodOptionsCardMandateOptionsInterval::Week => "week", - SetupIntentPaymentMethodOptionsCardMandateOptionsInterval::Year => "year", - } - } -} - -impl AsRef for SetupIntentPaymentMethodOptionsCardMandateOptionsInterval { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for SetupIntentPaymentMethodOptionsCardMandateOptionsInterval { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for SetupIntentPaymentMethodOptionsCardMandateOptionsInterval { - fn default() -> Self { - Self::Day - } -} - -/// An enum representing the possible values of an `SetupIntentPaymentMethodOptionsCardMandateOptions`'s `supported_types` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum SetupIntentPaymentMethodOptionsCardMandateOptionsSupportedTypes { - India, -} - -impl SetupIntentPaymentMethodOptionsCardMandateOptionsSupportedTypes { - pub fn as_str(self) -> &'static str { - match self { - SetupIntentPaymentMethodOptionsCardMandateOptionsSupportedTypes::India => "india", - } - } -} - -impl AsRef for SetupIntentPaymentMethodOptionsCardMandateOptionsSupportedTypes { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for SetupIntentPaymentMethodOptionsCardMandateOptionsSupportedTypes { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for SetupIntentPaymentMethodOptionsCardMandateOptionsSupportedTypes { - fn default() -> Self { - Self::India - } -} - -/// An enum representing the possible values of an `SetupIntentPaymentMethodOptionsCard`'s `network` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum SetupIntentPaymentMethodOptionsCardNetwork { - Amex, - CartesBancaires, - Diners, - Discover, - EftposAu, - Interac, - Jcb, - Mastercard, - Unionpay, - Unknown, - Visa, -} - -impl SetupIntentPaymentMethodOptionsCardNetwork { - pub fn as_str(self) -> &'static str { - match self { - SetupIntentPaymentMethodOptionsCardNetwork::Amex => "amex", - SetupIntentPaymentMethodOptionsCardNetwork::CartesBancaires => "cartes_bancaires", - SetupIntentPaymentMethodOptionsCardNetwork::Diners => "diners", - SetupIntentPaymentMethodOptionsCardNetwork::Discover => "discover", - SetupIntentPaymentMethodOptionsCardNetwork::EftposAu => "eftpos_au", - SetupIntentPaymentMethodOptionsCardNetwork::Interac => "interac", - SetupIntentPaymentMethodOptionsCardNetwork::Jcb => "jcb", - SetupIntentPaymentMethodOptionsCardNetwork::Mastercard => "mastercard", - SetupIntentPaymentMethodOptionsCardNetwork::Unionpay => "unionpay", - SetupIntentPaymentMethodOptionsCardNetwork::Unknown => "unknown", - SetupIntentPaymentMethodOptionsCardNetwork::Visa => "visa", - } - } -} - -impl AsRef for SetupIntentPaymentMethodOptionsCardNetwork { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for SetupIntentPaymentMethodOptionsCardNetwork { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for SetupIntentPaymentMethodOptionsCardNetwork { - fn default() -> Self { - Self::Amex - } -} - -/// An enum representing the possible values of an `SetupIntentPaymentMethodOptionsCard`'s `request_three_d_secure` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum SetupIntentPaymentMethodOptionsCardRequestThreeDSecure { - Any, - Automatic, - Challenge, -} - -impl SetupIntentPaymentMethodOptionsCardRequestThreeDSecure { - pub fn as_str(self) -> &'static str { - match self { - SetupIntentPaymentMethodOptionsCardRequestThreeDSecure::Any => "any", - SetupIntentPaymentMethodOptionsCardRequestThreeDSecure::Automatic => "automatic", - SetupIntentPaymentMethodOptionsCardRequestThreeDSecure::Challenge => "challenge", - } - } -} - -impl AsRef for SetupIntentPaymentMethodOptionsCardRequestThreeDSecure { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for SetupIntentPaymentMethodOptionsCardRequestThreeDSecure { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for SetupIntentPaymentMethodOptionsCardRequestThreeDSecure { - fn default() -> Self { - Self::Any - } -} - -/// An enum representing the possible values of an `SetupIntentPaymentMethodOptionsMandateOptionsAcssDebit`'s `default_for` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum SetupIntentPaymentMethodOptionsMandateOptionsAcssDebitDefaultFor { - Invoice, - Subscription, -} - -impl SetupIntentPaymentMethodOptionsMandateOptionsAcssDebitDefaultFor { - pub fn as_str(self) -> &'static str { - match self { - SetupIntentPaymentMethodOptionsMandateOptionsAcssDebitDefaultFor::Invoice => "invoice", - SetupIntentPaymentMethodOptionsMandateOptionsAcssDebitDefaultFor::Subscription => { - "subscription" - } - } - } -} - -impl AsRef for SetupIntentPaymentMethodOptionsMandateOptionsAcssDebitDefaultFor { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for SetupIntentPaymentMethodOptionsMandateOptionsAcssDebitDefaultFor { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for SetupIntentPaymentMethodOptionsMandateOptionsAcssDebitDefaultFor { - fn default() -> Self { - Self::Invoice - } -} - -/// An enum representing the possible values of an `SetupIntentPaymentMethodOptionsMandateOptionsAcssDebit`'s `payment_schedule` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum SetupIntentPaymentMethodOptionsMandateOptionsAcssDebitPaymentSchedule { - Combined, - Interval, - Sporadic, -} - -impl SetupIntentPaymentMethodOptionsMandateOptionsAcssDebitPaymentSchedule { - pub fn as_str(self) -> &'static str { - match self { - SetupIntentPaymentMethodOptionsMandateOptionsAcssDebitPaymentSchedule::Combined => { - "combined" - } - SetupIntentPaymentMethodOptionsMandateOptionsAcssDebitPaymentSchedule::Interval => { - "interval" - } - SetupIntentPaymentMethodOptionsMandateOptionsAcssDebitPaymentSchedule::Sporadic => { - "sporadic" - } - } - } -} - -impl AsRef for SetupIntentPaymentMethodOptionsMandateOptionsAcssDebitPaymentSchedule { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for SetupIntentPaymentMethodOptionsMandateOptionsAcssDebitPaymentSchedule { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default - for SetupIntentPaymentMethodOptionsMandateOptionsAcssDebitPaymentSchedule -{ - fn default() -> Self { - Self::Combined - } -} - -/// An enum representing the possible values of an `SetupIntentPaymentMethodOptionsMandateOptionsAcssDebit`'s `transaction_type` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum SetupIntentPaymentMethodOptionsMandateOptionsAcssDebitTransactionType { - Business, - Personal, -} - -impl SetupIntentPaymentMethodOptionsMandateOptionsAcssDebitTransactionType { - pub fn as_str(self) -> &'static str { - match self { - SetupIntentPaymentMethodOptionsMandateOptionsAcssDebitTransactionType::Business => { - "business" - } - SetupIntentPaymentMethodOptionsMandateOptionsAcssDebitTransactionType::Personal => { - "personal" - } - } - } -} - -impl AsRef for SetupIntentPaymentMethodOptionsMandateOptionsAcssDebitTransactionType { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for SetupIntentPaymentMethodOptionsMandateOptionsAcssDebitTransactionType { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default - for SetupIntentPaymentMethodOptionsMandateOptionsAcssDebitTransactionType -{ - fn default() -> Self { - Self::Business - } -} - -/// An enum representing the possible values of an `SetupIntentPaymentMethodOptionsUsBankAccount`'s `verification_method` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum SetupIntentPaymentMethodOptionsUsBankAccountVerificationMethod { - Automatic, - Instant, - Microdeposits, -} - -impl SetupIntentPaymentMethodOptionsUsBankAccountVerificationMethod { - pub fn as_str(self) -> &'static str { - match self { - SetupIntentPaymentMethodOptionsUsBankAccountVerificationMethod::Automatic => { - "automatic" - } - SetupIntentPaymentMethodOptionsUsBankAccountVerificationMethod::Instant => "instant", - SetupIntentPaymentMethodOptionsUsBankAccountVerificationMethod::Microdeposits => { - "microdeposits" - } - } - } -} - -impl AsRef for SetupIntentPaymentMethodOptionsUsBankAccountVerificationMethod { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for SetupIntentPaymentMethodOptionsUsBankAccountVerificationMethod { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for SetupIntentPaymentMethodOptionsUsBankAccountVerificationMethod { - fn default() -> Self { - Self::Automatic - } -} - -/// An enum representing the possible values of an `SetupIntent`'s `status` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum SetupIntentStatus { - Canceled, - Processing, - RequiresAction, - RequiresConfirmation, - RequiresPaymentMethod, - Succeeded, -} - -impl SetupIntentStatus { - pub fn as_str(self) -> &'static str { - match self { - SetupIntentStatus::Canceled => "canceled", - SetupIntentStatus::Processing => "processing", - SetupIntentStatus::RequiresAction => "requires_action", - SetupIntentStatus::RequiresConfirmation => "requires_confirmation", - SetupIntentStatus::RequiresPaymentMethod => "requires_payment_method", - SetupIntentStatus::Succeeded => "succeeded", - } - } -} - -impl AsRef for SetupIntentStatus { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for SetupIntentStatus { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for SetupIntentStatus { - fn default() -> Self { - Self::Canceled - } -} - -/// An enum representing the possible values of an `UpdateSetupIntent`'s `flow_directions` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum UpdateSetupIntentFlowDirections { - Inbound, - Outbound, -} - -impl UpdateSetupIntentFlowDirections { - pub fn as_str(self) -> &'static str { - match self { - UpdateSetupIntentFlowDirections::Inbound => "inbound", - UpdateSetupIntentFlowDirections::Outbound => "outbound", - } - } -} - -impl AsRef for UpdateSetupIntentFlowDirections { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for UpdateSetupIntentFlowDirections { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for UpdateSetupIntentFlowDirections { - fn default() -> Self { - Self::Inbound - } -} - -/// An enum representing the possible values of an `UpdateSetupIntentPaymentMethodDataEps`'s `bank` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum UpdateSetupIntentPaymentMethodDataEpsBank { - ArzteUndApothekerBank, - AustrianAnadiBankAg, - BankAustria, - BankhausCarlSpangler, - BankhausSchelhammerUndSchatteraAg, - BawagPskAg, - BksBankAg, - BrullKallmusBankAg, - BtvVierLanderBank, - CapitalBankGraweGruppeAg, - DeutscheBankAg, - Dolomitenbank, - EasybankAg, - ErsteBankUndSparkassen, - HypoAlpeadriabankInternationalAg, - HypoBankBurgenlandAktiengesellschaft, - HypoNoeLbFurNiederosterreichUWien, - HypoOberosterreichSalzburgSteiermark, - HypoTirolBankAg, - HypoVorarlbergBankAg, - MarchfelderBank, - OberbankAg, - RaiffeisenBankengruppeOsterreich, - SchoellerbankAg, - SpardaBankWien, - VolksbankGruppe, - VolkskreditbankAg, - VrBankBraunau, -} - -impl UpdateSetupIntentPaymentMethodDataEpsBank { - pub fn as_str(self) -> &'static str { - match self { - UpdateSetupIntentPaymentMethodDataEpsBank::ArzteUndApothekerBank => { - "arzte_und_apotheker_bank" - } - UpdateSetupIntentPaymentMethodDataEpsBank::AustrianAnadiBankAg => { - "austrian_anadi_bank_ag" - } - UpdateSetupIntentPaymentMethodDataEpsBank::BankAustria => "bank_austria", - UpdateSetupIntentPaymentMethodDataEpsBank::BankhausCarlSpangler => { - "bankhaus_carl_spangler" - } - UpdateSetupIntentPaymentMethodDataEpsBank::BankhausSchelhammerUndSchatteraAg => { - "bankhaus_schelhammer_und_schattera_ag" - } - UpdateSetupIntentPaymentMethodDataEpsBank::BawagPskAg => "bawag_psk_ag", - UpdateSetupIntentPaymentMethodDataEpsBank::BksBankAg => "bks_bank_ag", - UpdateSetupIntentPaymentMethodDataEpsBank::BrullKallmusBankAg => { - "brull_kallmus_bank_ag" - } - UpdateSetupIntentPaymentMethodDataEpsBank::BtvVierLanderBank => "btv_vier_lander_bank", - UpdateSetupIntentPaymentMethodDataEpsBank::CapitalBankGraweGruppeAg => { - "capital_bank_grawe_gruppe_ag" - } - UpdateSetupIntentPaymentMethodDataEpsBank::DeutscheBankAg => "deutsche_bank_ag", - UpdateSetupIntentPaymentMethodDataEpsBank::Dolomitenbank => "dolomitenbank", - UpdateSetupIntentPaymentMethodDataEpsBank::EasybankAg => "easybank_ag", - UpdateSetupIntentPaymentMethodDataEpsBank::ErsteBankUndSparkassen => { - "erste_bank_und_sparkassen" - } - UpdateSetupIntentPaymentMethodDataEpsBank::HypoAlpeadriabankInternationalAg => { - "hypo_alpeadriabank_international_ag" - } - UpdateSetupIntentPaymentMethodDataEpsBank::HypoBankBurgenlandAktiengesellschaft => { - "hypo_bank_burgenland_aktiengesellschaft" - } - UpdateSetupIntentPaymentMethodDataEpsBank::HypoNoeLbFurNiederosterreichUWien => { - "hypo_noe_lb_fur_niederosterreich_u_wien" - } - UpdateSetupIntentPaymentMethodDataEpsBank::HypoOberosterreichSalzburgSteiermark => { - "hypo_oberosterreich_salzburg_steiermark" - } - UpdateSetupIntentPaymentMethodDataEpsBank::HypoTirolBankAg => "hypo_tirol_bank_ag", - UpdateSetupIntentPaymentMethodDataEpsBank::HypoVorarlbergBankAg => { - "hypo_vorarlberg_bank_ag" - } - UpdateSetupIntentPaymentMethodDataEpsBank::MarchfelderBank => "marchfelder_bank", - UpdateSetupIntentPaymentMethodDataEpsBank::OberbankAg => "oberbank_ag", - UpdateSetupIntentPaymentMethodDataEpsBank::RaiffeisenBankengruppeOsterreich => { - "raiffeisen_bankengruppe_osterreich" - } - UpdateSetupIntentPaymentMethodDataEpsBank::SchoellerbankAg => "schoellerbank_ag", - UpdateSetupIntentPaymentMethodDataEpsBank::SpardaBankWien => "sparda_bank_wien", - UpdateSetupIntentPaymentMethodDataEpsBank::VolksbankGruppe => "volksbank_gruppe", - UpdateSetupIntentPaymentMethodDataEpsBank::VolkskreditbankAg => "volkskreditbank_ag", - UpdateSetupIntentPaymentMethodDataEpsBank::VrBankBraunau => "vr_bank_braunau", - } - } -} - -impl AsRef for UpdateSetupIntentPaymentMethodDataEpsBank { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for UpdateSetupIntentPaymentMethodDataEpsBank { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for UpdateSetupIntentPaymentMethodDataEpsBank { - fn default() -> Self { - Self::ArzteUndApothekerBank - } -} - -/// An enum representing the possible values of an `UpdateSetupIntentPaymentMethodDataFpx`'s `account_holder_type` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum UpdateSetupIntentPaymentMethodDataFpxAccountHolderType { - Company, - Individual, -} - -impl UpdateSetupIntentPaymentMethodDataFpxAccountHolderType { - pub fn as_str(self) -> &'static str { - match self { - UpdateSetupIntentPaymentMethodDataFpxAccountHolderType::Company => "company", - UpdateSetupIntentPaymentMethodDataFpxAccountHolderType::Individual => "individual", - } - } -} - -impl AsRef for UpdateSetupIntentPaymentMethodDataFpxAccountHolderType { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for UpdateSetupIntentPaymentMethodDataFpxAccountHolderType { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for UpdateSetupIntentPaymentMethodDataFpxAccountHolderType { - fn default() -> Self { - Self::Company - } -} - -/// An enum representing the possible values of an `UpdateSetupIntentPaymentMethodDataFpx`'s `bank` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum UpdateSetupIntentPaymentMethodDataFpxBank { - AffinBank, - Agrobank, - AllianceBank, - Ambank, - BankIslam, - BankMuamalat, - BankOfChina, - BankRakyat, - Bsn, - Cimb, - DeutscheBank, - HongLeongBank, - Hsbc, - Kfh, - Maybank2e, - Maybank2u, - Ocbc, - PbEnterprise, - PublicBank, - Rhb, - StandardChartered, - Uob, -} - -impl UpdateSetupIntentPaymentMethodDataFpxBank { - pub fn as_str(self) -> &'static str { - match self { - UpdateSetupIntentPaymentMethodDataFpxBank::AffinBank => "affin_bank", - UpdateSetupIntentPaymentMethodDataFpxBank::Agrobank => "agrobank", - UpdateSetupIntentPaymentMethodDataFpxBank::AllianceBank => "alliance_bank", - UpdateSetupIntentPaymentMethodDataFpxBank::Ambank => "ambank", - UpdateSetupIntentPaymentMethodDataFpxBank::BankIslam => "bank_islam", - UpdateSetupIntentPaymentMethodDataFpxBank::BankMuamalat => "bank_muamalat", - UpdateSetupIntentPaymentMethodDataFpxBank::BankOfChina => "bank_of_china", - UpdateSetupIntentPaymentMethodDataFpxBank::BankRakyat => "bank_rakyat", - UpdateSetupIntentPaymentMethodDataFpxBank::Bsn => "bsn", - UpdateSetupIntentPaymentMethodDataFpxBank::Cimb => "cimb", - UpdateSetupIntentPaymentMethodDataFpxBank::DeutscheBank => "deutsche_bank", - UpdateSetupIntentPaymentMethodDataFpxBank::HongLeongBank => "hong_leong_bank", - UpdateSetupIntentPaymentMethodDataFpxBank::Hsbc => "hsbc", - UpdateSetupIntentPaymentMethodDataFpxBank::Kfh => "kfh", - UpdateSetupIntentPaymentMethodDataFpxBank::Maybank2e => "maybank2e", - UpdateSetupIntentPaymentMethodDataFpxBank::Maybank2u => "maybank2u", - UpdateSetupIntentPaymentMethodDataFpxBank::Ocbc => "ocbc", - UpdateSetupIntentPaymentMethodDataFpxBank::PbEnterprise => "pb_enterprise", - UpdateSetupIntentPaymentMethodDataFpxBank::PublicBank => "public_bank", - UpdateSetupIntentPaymentMethodDataFpxBank::Rhb => "rhb", - UpdateSetupIntentPaymentMethodDataFpxBank::StandardChartered => "standard_chartered", - UpdateSetupIntentPaymentMethodDataFpxBank::Uob => "uob", - } - } -} - -impl AsRef for UpdateSetupIntentPaymentMethodDataFpxBank { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for UpdateSetupIntentPaymentMethodDataFpxBank { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for UpdateSetupIntentPaymentMethodDataFpxBank { - fn default() -> Self { - Self::AffinBank - } -} - -/// An enum representing the possible values of an `UpdateSetupIntentPaymentMethodDataIdeal`'s `bank` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum UpdateSetupIntentPaymentMethodDataIdealBank { - AbnAmro, - AsnBank, - Bunq, - Handelsbanken, - Ing, - Knab, - Moneyou, - N26, - Nn, - Rabobank, - Regiobank, - Revolut, - SnsBank, - TriodosBank, - VanLanschot, - Yoursafe, -} - -impl UpdateSetupIntentPaymentMethodDataIdealBank { - pub fn as_str(self) -> &'static str { - match self { - UpdateSetupIntentPaymentMethodDataIdealBank::AbnAmro => "abn_amro", - UpdateSetupIntentPaymentMethodDataIdealBank::AsnBank => "asn_bank", - UpdateSetupIntentPaymentMethodDataIdealBank::Bunq => "bunq", - UpdateSetupIntentPaymentMethodDataIdealBank::Handelsbanken => "handelsbanken", - UpdateSetupIntentPaymentMethodDataIdealBank::Ing => "ing", - UpdateSetupIntentPaymentMethodDataIdealBank::Knab => "knab", - UpdateSetupIntentPaymentMethodDataIdealBank::Moneyou => "moneyou", - UpdateSetupIntentPaymentMethodDataIdealBank::N26 => "n26", - UpdateSetupIntentPaymentMethodDataIdealBank::Nn => "nn", - UpdateSetupIntentPaymentMethodDataIdealBank::Rabobank => "rabobank", - UpdateSetupIntentPaymentMethodDataIdealBank::Regiobank => "regiobank", - UpdateSetupIntentPaymentMethodDataIdealBank::Revolut => "revolut", - UpdateSetupIntentPaymentMethodDataIdealBank::SnsBank => "sns_bank", - UpdateSetupIntentPaymentMethodDataIdealBank::TriodosBank => "triodos_bank", - UpdateSetupIntentPaymentMethodDataIdealBank::VanLanschot => "van_lanschot", - UpdateSetupIntentPaymentMethodDataIdealBank::Yoursafe => "yoursafe", - } - } -} - -impl AsRef for UpdateSetupIntentPaymentMethodDataIdealBank { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for UpdateSetupIntentPaymentMethodDataIdealBank { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for UpdateSetupIntentPaymentMethodDataIdealBank { - fn default() -> Self { - Self::AbnAmro - } -} - -/// An enum representing the possible values of an `UpdateSetupIntentPaymentMethodDataP24`'s `bank` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum UpdateSetupIntentPaymentMethodDataP24Bank { - AliorBank, - BankMillennium, - BankNowyBfgSa, - BankPekaoSa, - BankiSpbdzielcze, - Blik, - BnpParibas, - Boz, - CitiHandlowy, - CreditAgricole, - Envelobank, - EtransferPocztowy24, - GetinBank, - Ideabank, - Ing, - Inteligo, - MbankMtransfer, - NestPrzelew, - NoblePay, - PbacZIpko, - PlusBank, - SantanderPrzelew24, - TmobileUsbugiBankowe, - ToyotaBank, - Velobank, - VolkswagenBank, -} - -impl UpdateSetupIntentPaymentMethodDataP24Bank { - pub fn as_str(self) -> &'static str { - match self { - UpdateSetupIntentPaymentMethodDataP24Bank::AliorBank => "alior_bank", - UpdateSetupIntentPaymentMethodDataP24Bank::BankMillennium => "bank_millennium", - UpdateSetupIntentPaymentMethodDataP24Bank::BankNowyBfgSa => "bank_nowy_bfg_sa", - UpdateSetupIntentPaymentMethodDataP24Bank::BankPekaoSa => "bank_pekao_sa", - UpdateSetupIntentPaymentMethodDataP24Bank::BankiSpbdzielcze => "banki_spbdzielcze", - UpdateSetupIntentPaymentMethodDataP24Bank::Blik => "blik", - UpdateSetupIntentPaymentMethodDataP24Bank::BnpParibas => "bnp_paribas", - UpdateSetupIntentPaymentMethodDataP24Bank::Boz => "boz", - UpdateSetupIntentPaymentMethodDataP24Bank::CitiHandlowy => "citi_handlowy", - UpdateSetupIntentPaymentMethodDataP24Bank::CreditAgricole => "credit_agricole", - UpdateSetupIntentPaymentMethodDataP24Bank::Envelobank => "envelobank", - UpdateSetupIntentPaymentMethodDataP24Bank::EtransferPocztowy24 => { - "etransfer_pocztowy24" - } - UpdateSetupIntentPaymentMethodDataP24Bank::GetinBank => "getin_bank", - UpdateSetupIntentPaymentMethodDataP24Bank::Ideabank => "ideabank", - UpdateSetupIntentPaymentMethodDataP24Bank::Ing => "ing", - UpdateSetupIntentPaymentMethodDataP24Bank::Inteligo => "inteligo", - UpdateSetupIntentPaymentMethodDataP24Bank::MbankMtransfer => "mbank_mtransfer", - UpdateSetupIntentPaymentMethodDataP24Bank::NestPrzelew => "nest_przelew", - UpdateSetupIntentPaymentMethodDataP24Bank::NoblePay => "noble_pay", - UpdateSetupIntentPaymentMethodDataP24Bank::PbacZIpko => "pbac_z_ipko", - UpdateSetupIntentPaymentMethodDataP24Bank::PlusBank => "plus_bank", - UpdateSetupIntentPaymentMethodDataP24Bank::SantanderPrzelew24 => "santander_przelew24", - UpdateSetupIntentPaymentMethodDataP24Bank::TmobileUsbugiBankowe => { - "tmobile_usbugi_bankowe" - } - UpdateSetupIntentPaymentMethodDataP24Bank::ToyotaBank => "toyota_bank", - UpdateSetupIntentPaymentMethodDataP24Bank::Velobank => "velobank", - UpdateSetupIntentPaymentMethodDataP24Bank::VolkswagenBank => "volkswagen_bank", - } - } -} - -impl AsRef for UpdateSetupIntentPaymentMethodDataP24Bank { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for UpdateSetupIntentPaymentMethodDataP24Bank { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for UpdateSetupIntentPaymentMethodDataP24Bank { - fn default() -> Self { - Self::AliorBank - } -} - -/// An enum representing the possible values of an `UpdateSetupIntentPaymentMethodDataSofort`'s `country` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum UpdateSetupIntentPaymentMethodDataSofortCountry { - #[serde(rename = "AT")] - At, - #[serde(rename = "BE")] - Be, - #[serde(rename = "DE")] - De, - #[serde(rename = "ES")] - Es, - #[serde(rename = "IT")] - It, - #[serde(rename = "NL")] - Nl, -} - -impl UpdateSetupIntentPaymentMethodDataSofortCountry { - pub fn as_str(self) -> &'static str { - match self { - UpdateSetupIntentPaymentMethodDataSofortCountry::At => "AT", - UpdateSetupIntentPaymentMethodDataSofortCountry::Be => "BE", - UpdateSetupIntentPaymentMethodDataSofortCountry::De => "DE", - UpdateSetupIntentPaymentMethodDataSofortCountry::Es => "ES", - UpdateSetupIntentPaymentMethodDataSofortCountry::It => "IT", - UpdateSetupIntentPaymentMethodDataSofortCountry::Nl => "NL", - } - } -} - -impl AsRef for UpdateSetupIntentPaymentMethodDataSofortCountry { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for UpdateSetupIntentPaymentMethodDataSofortCountry { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for UpdateSetupIntentPaymentMethodDataSofortCountry { - fn default() -> Self { - Self::At - } -} - -/// An enum representing the possible values of an `UpdateSetupIntentPaymentMethodData`'s `type` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum UpdateSetupIntentPaymentMethodDataType { - AcssDebit, - Affirm, - AfterpayClearpay, - Alipay, - AuBecsDebit, - BacsDebit, - Bancontact, - Blik, - Boleto, - Cashapp, - CustomerBalance, - Eps, - Fpx, - Giropay, - Grabpay, - Ideal, - Klarna, - Konbini, - Link, - Oxxo, - P24, - Paynow, - Paypal, - Pix, - Promptpay, - RevolutPay, - SepaDebit, - Sofort, - Swish, - UsBankAccount, - WechatPay, - Zip, -} - -impl UpdateSetupIntentPaymentMethodDataType { - pub fn as_str(self) -> &'static str { - match self { - UpdateSetupIntentPaymentMethodDataType::AcssDebit => "acss_debit", - UpdateSetupIntentPaymentMethodDataType::Affirm => "affirm", - UpdateSetupIntentPaymentMethodDataType::AfterpayClearpay => "afterpay_clearpay", - UpdateSetupIntentPaymentMethodDataType::Alipay => "alipay", - UpdateSetupIntentPaymentMethodDataType::AuBecsDebit => "au_becs_debit", - UpdateSetupIntentPaymentMethodDataType::BacsDebit => "bacs_debit", - UpdateSetupIntentPaymentMethodDataType::Bancontact => "bancontact", - UpdateSetupIntentPaymentMethodDataType::Blik => "blik", - UpdateSetupIntentPaymentMethodDataType::Boleto => "boleto", - UpdateSetupIntentPaymentMethodDataType::Cashapp => "cashapp", - UpdateSetupIntentPaymentMethodDataType::CustomerBalance => "customer_balance", - UpdateSetupIntentPaymentMethodDataType::Eps => "eps", - UpdateSetupIntentPaymentMethodDataType::Fpx => "fpx", - UpdateSetupIntentPaymentMethodDataType::Giropay => "giropay", - UpdateSetupIntentPaymentMethodDataType::Grabpay => "grabpay", - UpdateSetupIntentPaymentMethodDataType::Ideal => "ideal", - UpdateSetupIntentPaymentMethodDataType::Klarna => "klarna", - UpdateSetupIntentPaymentMethodDataType::Konbini => "konbini", - UpdateSetupIntentPaymentMethodDataType::Link => "link", - UpdateSetupIntentPaymentMethodDataType::Oxxo => "oxxo", - UpdateSetupIntentPaymentMethodDataType::P24 => "p24", - UpdateSetupIntentPaymentMethodDataType::Paynow => "paynow", - UpdateSetupIntentPaymentMethodDataType::Paypal => "paypal", - UpdateSetupIntentPaymentMethodDataType::Pix => "pix", - UpdateSetupIntentPaymentMethodDataType::Promptpay => "promptpay", - UpdateSetupIntentPaymentMethodDataType::RevolutPay => "revolut_pay", - UpdateSetupIntentPaymentMethodDataType::SepaDebit => "sepa_debit", - UpdateSetupIntentPaymentMethodDataType::Sofort => "sofort", - UpdateSetupIntentPaymentMethodDataType::Swish => "swish", - UpdateSetupIntentPaymentMethodDataType::UsBankAccount => "us_bank_account", - UpdateSetupIntentPaymentMethodDataType::WechatPay => "wechat_pay", - UpdateSetupIntentPaymentMethodDataType::Zip => "zip", - } - } -} - -impl AsRef for UpdateSetupIntentPaymentMethodDataType { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for UpdateSetupIntentPaymentMethodDataType { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for UpdateSetupIntentPaymentMethodDataType { - fn default() -> Self { - Self::AcssDebit - } -} - -/// An enum representing the possible values of an `UpdateSetupIntentPaymentMethodDataUsBankAccount`'s `account_holder_type` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum UpdateSetupIntentPaymentMethodDataUsBankAccountAccountHolderType { - Company, - Individual, -} - -impl UpdateSetupIntentPaymentMethodDataUsBankAccountAccountHolderType { - pub fn as_str(self) -> &'static str { - match self { - UpdateSetupIntentPaymentMethodDataUsBankAccountAccountHolderType::Company => "company", - UpdateSetupIntentPaymentMethodDataUsBankAccountAccountHolderType::Individual => { - "individual" - } - } - } -} - -impl AsRef for UpdateSetupIntentPaymentMethodDataUsBankAccountAccountHolderType { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for UpdateSetupIntentPaymentMethodDataUsBankAccountAccountHolderType { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for UpdateSetupIntentPaymentMethodDataUsBankAccountAccountHolderType { - fn default() -> Self { - Self::Company - } -} - -/// An enum representing the possible values of an `UpdateSetupIntentPaymentMethodDataUsBankAccount`'s `account_type` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum UpdateSetupIntentPaymentMethodDataUsBankAccountAccountType { - Checking, - Savings, -} - -impl UpdateSetupIntentPaymentMethodDataUsBankAccountAccountType { - pub fn as_str(self) -> &'static str { - match self { - UpdateSetupIntentPaymentMethodDataUsBankAccountAccountType::Checking => "checking", - UpdateSetupIntentPaymentMethodDataUsBankAccountAccountType::Savings => "savings", - } - } -} - -impl AsRef for UpdateSetupIntentPaymentMethodDataUsBankAccountAccountType { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for UpdateSetupIntentPaymentMethodDataUsBankAccountAccountType { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for UpdateSetupIntentPaymentMethodDataUsBankAccountAccountType { - fn default() -> Self { - Self::Checking - } -} - -/// An enum representing the possible values of an `UpdateSetupIntentPaymentMethodOptionsAcssDebitMandateOptions`'s `default_for` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum UpdateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsDefaultFor { - Invoice, - Subscription, -} - -impl UpdateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsDefaultFor { - pub fn as_str(self) -> &'static str { - match self { - UpdateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsDefaultFor::Invoice => "invoice", - UpdateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsDefaultFor::Subscription => "subscription", - } - } -} - -impl AsRef for UpdateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsDefaultFor { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for UpdateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsDefaultFor { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default - for UpdateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsDefaultFor -{ - fn default() -> Self { - Self::Invoice - } -} - -/// An enum representing the possible values of an `UpdateSetupIntentPaymentMethodOptionsAcssDebitMandateOptions`'s `payment_schedule` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum UpdateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsPaymentSchedule { - Combined, - Interval, - Sporadic, -} - -impl UpdateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsPaymentSchedule { - pub fn as_str(self) -> &'static str { - match self { - UpdateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsPaymentSchedule::Combined => "combined", - UpdateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsPaymentSchedule::Interval => "interval", - UpdateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsPaymentSchedule::Sporadic => "sporadic", - } - } -} - -impl AsRef for UpdateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsPaymentSchedule { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display - for UpdateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsPaymentSchedule -{ - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default - for UpdateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsPaymentSchedule -{ - fn default() -> Self { - Self::Combined - } -} - -/// An enum representing the possible values of an `UpdateSetupIntentPaymentMethodOptionsAcssDebitMandateOptions`'s `transaction_type` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum UpdateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsTransactionType { - Business, - Personal, -} - -impl UpdateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsTransactionType { - pub fn as_str(self) -> &'static str { - match self { - UpdateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsTransactionType::Business => "business", - UpdateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsTransactionType::Personal => "personal", - } - } -} - -impl AsRef for UpdateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsTransactionType { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display - for UpdateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsTransactionType -{ - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default - for UpdateSetupIntentPaymentMethodOptionsAcssDebitMandateOptionsTransactionType -{ - fn default() -> Self { - Self::Business - } -} - -/// An enum representing the possible values of an `UpdateSetupIntentPaymentMethodOptionsAcssDebit`'s `verification_method` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum UpdateSetupIntentPaymentMethodOptionsAcssDebitVerificationMethod { - Automatic, - Instant, - Microdeposits, -} - -impl UpdateSetupIntentPaymentMethodOptionsAcssDebitVerificationMethod { - pub fn as_str(self) -> &'static str { - match self { - UpdateSetupIntentPaymentMethodOptionsAcssDebitVerificationMethod::Automatic => { - "automatic" - } - UpdateSetupIntentPaymentMethodOptionsAcssDebitVerificationMethod::Instant => "instant", - UpdateSetupIntentPaymentMethodOptionsAcssDebitVerificationMethod::Microdeposits => { - "microdeposits" - } - } - } -} - -impl AsRef for UpdateSetupIntentPaymentMethodOptionsAcssDebitVerificationMethod { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for UpdateSetupIntentPaymentMethodOptionsAcssDebitVerificationMethod { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for UpdateSetupIntentPaymentMethodOptionsAcssDebitVerificationMethod { - fn default() -> Self { - Self::Automatic - } -} - -/// An enum representing the possible values of an `UpdateSetupIntentPaymentMethodOptionsCardMandateOptions`'s `amount_type` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum UpdateSetupIntentPaymentMethodOptionsCardMandateOptionsAmountType { - Fixed, - Maximum, -} - -impl UpdateSetupIntentPaymentMethodOptionsCardMandateOptionsAmountType { - pub fn as_str(self) -> &'static str { - match self { - UpdateSetupIntentPaymentMethodOptionsCardMandateOptionsAmountType::Fixed => "fixed", - UpdateSetupIntentPaymentMethodOptionsCardMandateOptionsAmountType::Maximum => "maximum", - } - } -} - -impl AsRef for UpdateSetupIntentPaymentMethodOptionsCardMandateOptionsAmountType { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for UpdateSetupIntentPaymentMethodOptionsCardMandateOptionsAmountType { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for UpdateSetupIntentPaymentMethodOptionsCardMandateOptionsAmountType { - fn default() -> Self { - Self::Fixed - } -} - -/// An enum representing the possible values of an `UpdateSetupIntentPaymentMethodOptionsCardMandateOptions`'s `interval` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum UpdateSetupIntentPaymentMethodOptionsCardMandateOptionsInterval { - Day, - Month, - Sporadic, - Week, - Year, -} - -impl UpdateSetupIntentPaymentMethodOptionsCardMandateOptionsInterval { - pub fn as_str(self) -> &'static str { - match self { - UpdateSetupIntentPaymentMethodOptionsCardMandateOptionsInterval::Day => "day", - UpdateSetupIntentPaymentMethodOptionsCardMandateOptionsInterval::Month => "month", - UpdateSetupIntentPaymentMethodOptionsCardMandateOptionsInterval::Sporadic => "sporadic", - UpdateSetupIntentPaymentMethodOptionsCardMandateOptionsInterval::Week => "week", - UpdateSetupIntentPaymentMethodOptionsCardMandateOptionsInterval::Year => "year", - } - } -} - -impl AsRef for UpdateSetupIntentPaymentMethodOptionsCardMandateOptionsInterval { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for UpdateSetupIntentPaymentMethodOptionsCardMandateOptionsInterval { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for UpdateSetupIntentPaymentMethodOptionsCardMandateOptionsInterval { - fn default() -> Self { - Self::Day - } -} - -/// An enum representing the possible values of an `UpdateSetupIntentPaymentMethodOptionsCardMandateOptions`'s `supported_types` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum UpdateSetupIntentPaymentMethodOptionsCardMandateOptionsSupportedTypes { - India, -} - -impl UpdateSetupIntentPaymentMethodOptionsCardMandateOptionsSupportedTypes { - pub fn as_str(self) -> &'static str { - match self { - UpdateSetupIntentPaymentMethodOptionsCardMandateOptionsSupportedTypes::India => "india", - } - } -} - -impl AsRef for UpdateSetupIntentPaymentMethodOptionsCardMandateOptionsSupportedTypes { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for UpdateSetupIntentPaymentMethodOptionsCardMandateOptionsSupportedTypes { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default - for UpdateSetupIntentPaymentMethodOptionsCardMandateOptionsSupportedTypes -{ - fn default() -> Self { - Self::India - } -} - -/// An enum representing the possible values of an `UpdateSetupIntentPaymentMethodOptionsCard`'s `network` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum UpdateSetupIntentPaymentMethodOptionsCardNetwork { - Amex, - CartesBancaires, - Diners, - Discover, - EftposAu, - Interac, - Jcb, - Mastercard, - Unionpay, - Unknown, - Visa, -} - -impl UpdateSetupIntentPaymentMethodOptionsCardNetwork { - pub fn as_str(self) -> &'static str { - match self { - UpdateSetupIntentPaymentMethodOptionsCardNetwork::Amex => "amex", - UpdateSetupIntentPaymentMethodOptionsCardNetwork::CartesBancaires => "cartes_bancaires", - UpdateSetupIntentPaymentMethodOptionsCardNetwork::Diners => "diners", - UpdateSetupIntentPaymentMethodOptionsCardNetwork::Discover => "discover", - UpdateSetupIntentPaymentMethodOptionsCardNetwork::EftposAu => "eftpos_au", - UpdateSetupIntentPaymentMethodOptionsCardNetwork::Interac => "interac", - UpdateSetupIntentPaymentMethodOptionsCardNetwork::Jcb => "jcb", - UpdateSetupIntentPaymentMethodOptionsCardNetwork::Mastercard => "mastercard", - UpdateSetupIntentPaymentMethodOptionsCardNetwork::Unionpay => "unionpay", - UpdateSetupIntentPaymentMethodOptionsCardNetwork::Unknown => "unknown", - UpdateSetupIntentPaymentMethodOptionsCardNetwork::Visa => "visa", - } - } -} - -impl AsRef for UpdateSetupIntentPaymentMethodOptionsCardNetwork { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for UpdateSetupIntentPaymentMethodOptionsCardNetwork { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for UpdateSetupIntentPaymentMethodOptionsCardNetwork { - fn default() -> Self { - Self::Amex - } -} - -/// An enum representing the possible values of an `UpdateSetupIntentPaymentMethodOptionsCard`'s `request_three_d_secure` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum UpdateSetupIntentPaymentMethodOptionsCardRequestThreeDSecure { - Any, - Automatic, - Challenge, -} - -impl UpdateSetupIntentPaymentMethodOptionsCardRequestThreeDSecure { - pub fn as_str(self) -> &'static str { - match self { - UpdateSetupIntentPaymentMethodOptionsCardRequestThreeDSecure::Any => "any", - UpdateSetupIntentPaymentMethodOptionsCardRequestThreeDSecure::Automatic => "automatic", - UpdateSetupIntentPaymentMethodOptionsCardRequestThreeDSecure::Challenge => "challenge", - } - } -} - -impl AsRef for UpdateSetupIntentPaymentMethodOptionsCardRequestThreeDSecure { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for UpdateSetupIntentPaymentMethodOptionsCardRequestThreeDSecure { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for UpdateSetupIntentPaymentMethodOptionsCardRequestThreeDSecure { - fn default() -> Self { - Self::Any - } -} - -/// An enum representing the possible values of an `UpdateSetupIntentPaymentMethodOptionsCardThreeDSecure`'s `ares_trans_status` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum UpdateSetupIntentPaymentMethodOptionsCardThreeDSecureAresTransStatus { - #[serde(rename = "A")] - A, - #[serde(rename = "C")] - C, - #[serde(rename = "I")] - I, - #[serde(rename = "N")] - N, - #[serde(rename = "R")] - R, - #[serde(rename = "U")] - U, - #[serde(rename = "Y")] - Y, -} - -impl UpdateSetupIntentPaymentMethodOptionsCardThreeDSecureAresTransStatus { - pub fn as_str(self) -> &'static str { - match self { - UpdateSetupIntentPaymentMethodOptionsCardThreeDSecureAresTransStatus::A => "A", - UpdateSetupIntentPaymentMethodOptionsCardThreeDSecureAresTransStatus::C => "C", - UpdateSetupIntentPaymentMethodOptionsCardThreeDSecureAresTransStatus::I => "I", - UpdateSetupIntentPaymentMethodOptionsCardThreeDSecureAresTransStatus::N => "N", - UpdateSetupIntentPaymentMethodOptionsCardThreeDSecureAresTransStatus::R => "R", - UpdateSetupIntentPaymentMethodOptionsCardThreeDSecureAresTransStatus::U => "U", - UpdateSetupIntentPaymentMethodOptionsCardThreeDSecureAresTransStatus::Y => "Y", - } - } -} - -impl AsRef for UpdateSetupIntentPaymentMethodOptionsCardThreeDSecureAresTransStatus { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for UpdateSetupIntentPaymentMethodOptionsCardThreeDSecureAresTransStatus { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default - for UpdateSetupIntentPaymentMethodOptionsCardThreeDSecureAresTransStatus -{ - fn default() -> Self { - Self::A - } -} - -/// An enum representing the possible values of an `UpdateSetupIntentPaymentMethodOptionsCardThreeDSecure`'s `electronic_commerce_indicator` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum UpdateSetupIntentPaymentMethodOptionsCardThreeDSecureElectronicCommerceIndicator { - #[serde(rename = "01")] - V01, - #[serde(rename = "02")] - V02, - #[serde(rename = "05")] - V05, - #[serde(rename = "06")] - V06, - #[serde(rename = "07")] - V07, -} - -impl UpdateSetupIntentPaymentMethodOptionsCardThreeDSecureElectronicCommerceIndicator { - pub fn as_str(self) -> &'static str { - match self { - UpdateSetupIntentPaymentMethodOptionsCardThreeDSecureElectronicCommerceIndicator::V01 => "01", - UpdateSetupIntentPaymentMethodOptionsCardThreeDSecureElectronicCommerceIndicator::V02 => "02", - UpdateSetupIntentPaymentMethodOptionsCardThreeDSecureElectronicCommerceIndicator::V05 => "05", - UpdateSetupIntentPaymentMethodOptionsCardThreeDSecureElectronicCommerceIndicator::V06 => "06", - UpdateSetupIntentPaymentMethodOptionsCardThreeDSecureElectronicCommerceIndicator::V07 => "07", - } - } -} - -impl AsRef - for UpdateSetupIntentPaymentMethodOptionsCardThreeDSecureElectronicCommerceIndicator -{ - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display - for UpdateSetupIntentPaymentMethodOptionsCardThreeDSecureElectronicCommerceIndicator -{ - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default - for UpdateSetupIntentPaymentMethodOptionsCardThreeDSecureElectronicCommerceIndicator -{ - fn default() -> Self { - Self::V01 - } -} - -/// An enum representing the possible values of an `UpdateSetupIntentPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancaires`'s `cb_avalgo` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum UpdateSetupIntentPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancairesCbAvalgo -{ - #[serde(rename = "0")] - V0, - #[serde(rename = "1")] - V1, - #[serde(rename = "2")] - V2, - #[serde(rename = "3")] - V3, - #[serde(rename = "4")] - V4, - #[serde(rename = "A")] - A, -} - -impl UpdateSetupIntentPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancairesCbAvalgo { - pub fn as_str(self) -> &'static str { - match self { - UpdateSetupIntentPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancairesCbAvalgo::V0 => "0", - UpdateSetupIntentPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancairesCbAvalgo::V1 => "1", - UpdateSetupIntentPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancairesCbAvalgo::V2 => "2", - UpdateSetupIntentPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancairesCbAvalgo::V3 => "3", - UpdateSetupIntentPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancairesCbAvalgo::V4 => "4", - UpdateSetupIntentPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancairesCbAvalgo::A => "A", - } - } -} - -impl AsRef - for UpdateSetupIntentPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancairesCbAvalgo -{ - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display - for UpdateSetupIntentPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancairesCbAvalgo -{ - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default - for UpdateSetupIntentPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancairesCbAvalgo -{ - fn default() -> Self { - Self::V0 - } -} - -/// An enum representing the possible values of an `UpdateSetupIntentPaymentMethodOptionsCardThreeDSecure`'s `version` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum UpdateSetupIntentPaymentMethodOptionsCardThreeDSecureVersion { - #[serde(rename = "1.0.2")] - V1_0_2, - #[serde(rename = "2.1.0")] - V2_1_0, - #[serde(rename = "2.2.0")] - V2_2_0, -} - -impl UpdateSetupIntentPaymentMethodOptionsCardThreeDSecureVersion { - pub fn as_str(self) -> &'static str { - match self { - UpdateSetupIntentPaymentMethodOptionsCardThreeDSecureVersion::V1_0_2 => "1.0.2", - UpdateSetupIntentPaymentMethodOptionsCardThreeDSecureVersion::V2_1_0 => "2.1.0", - UpdateSetupIntentPaymentMethodOptionsCardThreeDSecureVersion::V2_2_0 => "2.2.0", - } - } -} - -impl AsRef for UpdateSetupIntentPaymentMethodOptionsCardThreeDSecureVersion { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for UpdateSetupIntentPaymentMethodOptionsCardThreeDSecureVersion { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for UpdateSetupIntentPaymentMethodOptionsCardThreeDSecureVersion { - fn default() -> Self { - Self::V1_0_2 - } -} - -/// An enum representing the possible values of an `UpdateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnections`'s `permissions` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum UpdateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions { - Balances, - Ownership, - PaymentMethod, - Transactions, -} - -impl UpdateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions { - pub fn as_str(self) -> &'static str { - match self { - UpdateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions::Balances => "balances", - UpdateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions::Ownership => "ownership", - UpdateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions::PaymentMethod => "payment_method", - UpdateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions::Transactions => "transactions", - } - } -} - -impl AsRef - for UpdateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions -{ - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display - for UpdateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions -{ - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default - for UpdateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions -{ - fn default() -> Self { - Self::Balances - } -} - -/// An enum representing the possible values of an `UpdateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnections`'s `prefetch` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum UpdateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch { - Balances, - Transactions, -} - -impl UpdateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch { - pub fn as_str(self) -> &'static str { - match self { - UpdateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch::Balances => "balances", - UpdateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch::Transactions => "transactions", - } - } -} - -impl AsRef for UpdateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display - for UpdateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch -{ - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default - for UpdateSetupIntentPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch -{ - fn default() -> Self { - Self::Balances - } -} - -/// An enum representing the possible values of an `UpdateSetupIntentPaymentMethodOptionsUsBankAccountMandateOptions`'s `collection_method` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum UpdateSetupIntentPaymentMethodOptionsUsBankAccountMandateOptionsCollectionMethod { - Paper, -} - -impl UpdateSetupIntentPaymentMethodOptionsUsBankAccountMandateOptionsCollectionMethod { - pub fn as_str(self) -> &'static str { - match self { - UpdateSetupIntentPaymentMethodOptionsUsBankAccountMandateOptionsCollectionMethod::Paper => "paper", - } - } -} - -impl AsRef - for UpdateSetupIntentPaymentMethodOptionsUsBankAccountMandateOptionsCollectionMethod -{ - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display - for UpdateSetupIntentPaymentMethodOptionsUsBankAccountMandateOptionsCollectionMethod -{ - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default - for UpdateSetupIntentPaymentMethodOptionsUsBankAccountMandateOptionsCollectionMethod -{ - fn default() -> Self { - Self::Paper - } -} - -/// An enum representing the possible values of an `UpdateSetupIntentPaymentMethodOptionsUsBankAccountNetworks`'s `requested` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum UpdateSetupIntentPaymentMethodOptionsUsBankAccountNetworksRequested { - Ach, - UsDomesticWire, -} - -impl UpdateSetupIntentPaymentMethodOptionsUsBankAccountNetworksRequested { - pub fn as_str(self) -> &'static str { - match self { - UpdateSetupIntentPaymentMethodOptionsUsBankAccountNetworksRequested::Ach => "ach", - UpdateSetupIntentPaymentMethodOptionsUsBankAccountNetworksRequested::UsDomesticWire => { - "us_domestic_wire" - } - } - } -} - -impl AsRef for UpdateSetupIntentPaymentMethodOptionsUsBankAccountNetworksRequested { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for UpdateSetupIntentPaymentMethodOptionsUsBankAccountNetworksRequested { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for UpdateSetupIntentPaymentMethodOptionsUsBankAccountNetworksRequested { - fn default() -> Self { - Self::Ach - } -} - -/// An enum representing the possible values of an `UpdateSetupIntentPaymentMethodOptionsUsBankAccount`'s `verification_method` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum UpdateSetupIntentPaymentMethodOptionsUsBankAccountVerificationMethod { - Automatic, - Instant, - Microdeposits, -} - -impl UpdateSetupIntentPaymentMethodOptionsUsBankAccountVerificationMethod { - pub fn as_str(self) -> &'static str { - match self { - UpdateSetupIntentPaymentMethodOptionsUsBankAccountVerificationMethod::Automatic => { - "automatic" - } - UpdateSetupIntentPaymentMethodOptionsUsBankAccountVerificationMethod::Instant => { - "instant" - } - UpdateSetupIntentPaymentMethodOptionsUsBankAccountVerificationMethod::Microdeposits => { - "microdeposits" - } - } - } -} - -impl AsRef for UpdateSetupIntentPaymentMethodOptionsUsBankAccountVerificationMethod { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for UpdateSetupIntentPaymentMethodOptionsUsBankAccountVerificationMethod { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default - for UpdateSetupIntentPaymentMethodOptionsUsBankAccountVerificationMethod -{ - fn default() -> Self { - Self::Automatic - } -} diff --git a/src/resources/generated/setup_intent_canceled.rs b/src/resources/generated/setup_intent_canceled.rs deleted file mode 100644 index e14944e70..000000000 --- a/src/resources/generated/setup_intent_canceled.rs +++ /dev/null @@ -1,10 +0,0 @@ -// ====================================== -// This file was automatically generated. -// ====================================== - -use serde::{Deserialize, Serialize}; - -/// The resource representing a Stripe "setup_intent.canceled". -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct SetupIntentCanceled { -} diff --git a/src/resources/generated/setup_intent_created.rs b/src/resources/generated/setup_intent_created.rs deleted file mode 100644 index 0be62648d..000000000 --- a/src/resources/generated/setup_intent_created.rs +++ /dev/null @@ -1,10 +0,0 @@ -// ====================================== -// This file was automatically generated. -// ====================================== - -use serde::{Deserialize, Serialize}; - -/// The resource representing a Stripe "setup_intent.created". -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct SetupIntentCreated { -} diff --git a/src/resources/generated/setup_intent_requires_action.rs b/src/resources/generated/setup_intent_requires_action.rs deleted file mode 100644 index ee9bf2e55..000000000 --- a/src/resources/generated/setup_intent_requires_action.rs +++ /dev/null @@ -1,10 +0,0 @@ -// ====================================== -// This file was automatically generated. -// ====================================== - -use serde::{Deserialize, Serialize}; - -/// The resource representing a Stripe "setup_intent.requires_action". -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct SetupIntentRequiresAction { -} diff --git a/src/resources/generated/setup_intent_setup_failed.rs b/src/resources/generated/setup_intent_setup_failed.rs deleted file mode 100644 index 1a74f4495..000000000 --- a/src/resources/generated/setup_intent_setup_failed.rs +++ /dev/null @@ -1,10 +0,0 @@ -// ====================================== -// This file was automatically generated. -// ====================================== - -use serde::{Deserialize, Serialize}; - -/// The resource representing a Stripe "setup_intent.setup_failed". -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct SetupIntentSetupFailed { -} diff --git a/src/resources/generated/setup_intent_succeeded.rs b/src/resources/generated/setup_intent_succeeded.rs deleted file mode 100644 index edcb5a1ee..000000000 --- a/src/resources/generated/setup_intent_succeeded.rs +++ /dev/null @@ -1,10 +0,0 @@ -// ====================================== -// This file was automatically generated. -// ====================================== - -use serde::{Deserialize, Serialize}; - -/// The resource representing a Stripe "setup_intent.succeeded". -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct SetupIntentSucceeded { -} diff --git a/src/resources/generated/shipping_rate.rs b/src/resources/generated/shipping_rate.rs deleted file mode 100644 index 62ead279e..000000000 --- a/src/resources/generated/shipping_rate.rs +++ /dev/null @@ -1,712 +0,0 @@ -// ====================================== -// This file was automatically generated. -// ====================================== - -use serde::{Deserialize, Serialize}; - -use crate::client::{Client, Response}; -use crate::ids::{ShippingRateId, TaxCodeId}; -use crate::params::{ - CurrencyMap, Expand, Expandable, List, Metadata, Object, Paginable, RangeQuery, Timestamp, -}; -use crate::resources::{Currency, TaxCode}; - -/// The resource representing a Stripe "ShippingRate". -/// -/// For more details see -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct ShippingRate { - /// Unique identifier for the object. - pub id: ShippingRateId, - - /// Whether the shipping rate can be used for new purchases. - /// - /// Defaults to `true`. - pub active: bool, - - /// Time at which the object was created. - /// - /// Measured in seconds since the Unix epoch. - pub created: Timestamp, - - /// The estimated range for how long shipping will take, meant to be displayable to the customer. - /// - /// This will appear on CheckoutSessions. - pub delivery_estimate: Option, - - /// The name of the shipping rate, meant to be displayable to the customer. - /// - /// This will appear on CheckoutSessions. - pub display_name: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub fixed_amount: Option, - - /// Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. - pub livemode: bool, - - /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. - /// - /// This can be useful for storing additional information about the object in a structured format. - pub metadata: Metadata, - - /// Specifies whether the rate is considered inclusive of taxes or exclusive of taxes. - /// - /// One of `inclusive`, `exclusive`, or `unspecified`. - pub tax_behavior: Option, - - /// A [tax code](https://stripe.com/docs/tax/tax-categories) ID. - /// - /// The Shipping tax code is `txcd_92010001`. - pub tax_code: Option>, - - /// The type of calculation to use on the shipping rate. - /// - /// Can only be `fixed_amount` for now. - #[serde(rename = "type")] - pub type_: ShippingRateType, -} - -impl ShippingRate { - /// Returns a list of your shipping rates. - pub fn list(client: &Client, params: &ListShippingRates<'_>) -> Response> { - client.get_query("/shipping_rates", ¶ms) - } - - /// Creates a new shipping rate object. - pub fn create(client: &Client, params: CreateShippingRate<'_>) -> Response { - client.post_form("/shipping_rates", ¶ms) - } - - /// Returns the shipping rate object with the given ID. - pub fn retrieve( - client: &Client, - id: &ShippingRateId, - expand: &[&str], - ) -> Response { - client.get_query(&format!("/shipping_rates/{}", id), &Expand { expand }) - } - - /// Updates an existing shipping rate object. - pub fn update( - client: &Client, - id: &ShippingRateId, - params: UpdateShippingRate<'_>, - ) -> Response { - client.post_form(&format!("/shipping_rates/{}", id), ¶ms) - } -} - -impl Object for ShippingRate { - type Id = ShippingRateId; - fn id(&self) -> Self::Id { - self.id.clone() - } - fn object(&self) -> &'static str { - "shipping_rate" - } -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct ShippingRateDeliveryEstimate { - /// The upper bound of the estimated range. - /// - /// If empty, represents no upper bound i.e., infinite. - pub maximum: Option, - - /// The lower bound of the estimated range. - /// - /// If empty, represents no lower bound. - pub minimum: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct ShippingRateDeliveryEstimateBound { - /// A unit of time. - pub unit: ShippingRateDeliveryEstimateBoundUnit, - - /// Must be greater than 0. - pub value: i64, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct ShippingRateFixedAmount { - /// A non-negative integer in cents representing how much to charge. - pub amount: i64, - - /// Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. - /// - /// Must be a [supported currency](https://stripe.com/docs/currencies). - pub currency: Currency, - - /// Shipping rates defined in each available currency option. - /// - /// Each key must be a three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html) and a [supported currency](https://stripe.com/docs/currencies). - #[serde(skip_serializing_if = "Option::is_none")] - pub currency_options: Option>, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct ShippingRateCurrencyOption { - /// A non-negative integer in cents representing how much to charge. - pub amount: i64, - - /// Specifies whether the rate is considered inclusive of taxes or exclusive of taxes. - /// - /// One of `inclusive`, `exclusive`, or `unspecified`. - pub tax_behavior: ShippingRateCurrencyOptionTaxBehavior, -} - -/// The parameters for `ShippingRate::create`. -#[derive(Clone, Debug, Serialize)] -pub struct CreateShippingRate<'a> { - /// The estimated range for how long shipping will take, meant to be displayable to the customer. - /// - /// This will appear on CheckoutSessions. - #[serde(skip_serializing_if = "Option::is_none")] - pub delivery_estimate: Option, - - /// The name of the shipping rate, meant to be displayable to the customer. - /// - /// This will appear on CheckoutSessions. - pub display_name: &'a str, - - /// Specifies which fields in the response should be expanded. - #[serde(skip_serializing_if = "Expand::is_empty")] - pub expand: &'a [&'a str], - - /// Describes a fixed amount to charge for shipping. - /// - /// Must be present if type is `fixed_amount`. - #[serde(skip_serializing_if = "Option::is_none")] - pub fixed_amount: Option, - - /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. - /// - /// This can be useful for storing additional information about the object in a structured format. - /// Individual keys can be unset by posting an empty value to them. - /// All keys can be unset by posting an empty value to `metadata`. - #[serde(skip_serializing_if = "Option::is_none")] - pub metadata: Option, - - /// Specifies whether the rate is considered inclusive of taxes or exclusive of taxes. - /// - /// One of `inclusive`, `exclusive`, or `unspecified`. - #[serde(skip_serializing_if = "Option::is_none")] - pub tax_behavior: Option, - - /// A [tax code](https://stripe.com/docs/tax/tax-categories) ID. - /// - /// The Shipping tax code is `txcd_92010001`. - #[serde(skip_serializing_if = "Option::is_none")] - pub tax_code: Option, - - /// The type of calculation to use on the shipping rate. - /// - /// Can only be `fixed_amount` for now. - #[serde(rename = "type")] - #[serde(skip_serializing_if = "Option::is_none")] - pub type_: Option, -} - -impl<'a> CreateShippingRate<'a> { - pub fn new(display_name: &'a str) -> Self { - CreateShippingRate { - delivery_estimate: Default::default(), - display_name, - expand: Default::default(), - fixed_amount: Default::default(), - metadata: Default::default(), - tax_behavior: Default::default(), - tax_code: Default::default(), - type_: Default::default(), - } - } -} - -/// The parameters for `ShippingRate::list`. -#[derive(Clone, Debug, Serialize, Default)] -pub struct ListShippingRates<'a> { - /// Only return shipping rates that are active or inactive. - #[serde(skip_serializing_if = "Option::is_none")] - pub active: Option, - - /// A filter on the list, based on the object `created` field. - /// - /// The value can be a string with an integer Unix timestamp, or it can be a dictionary with a number of different query options. - #[serde(skip_serializing_if = "Option::is_none")] - pub created: Option>, - - /// Only return shipping rates for the given currency. - #[serde(skip_serializing_if = "Option::is_none")] - pub currency: Option, - - /// A cursor for use in pagination. - /// - /// `ending_before` is an object ID that defines your place in the list. - /// For instance, if you make a list request and receive 100 objects, starting with `obj_bar`, your subsequent call can include `ending_before=obj_bar` in order to fetch the previous page of the list. - #[serde(skip_serializing_if = "Option::is_none")] - pub ending_before: Option, - - /// Specifies which fields in the response should be expanded. - #[serde(skip_serializing_if = "Expand::is_empty")] - pub expand: &'a [&'a str], - - /// A limit on the number of objects to be returned. - /// - /// Limit can range between 1 and 100, and the default is 10. - #[serde(skip_serializing_if = "Option::is_none")] - pub limit: Option, - - /// A cursor for use in pagination. - /// - /// `starting_after` is an object ID that defines your place in the list. - /// For instance, if you make a list request and receive 100 objects, ending with `obj_foo`, your subsequent call can include `starting_after=obj_foo` in order to fetch the next page of the list. - #[serde(skip_serializing_if = "Option::is_none")] - pub starting_after: Option, -} - -impl<'a> ListShippingRates<'a> { - pub fn new() -> Self { - ListShippingRates { - active: Default::default(), - created: Default::default(), - currency: Default::default(), - ending_before: Default::default(), - expand: Default::default(), - limit: Default::default(), - starting_after: Default::default(), - } - } -} -impl Paginable for ListShippingRates<'_> { - type O = ShippingRate; - fn set_last(&mut self, item: Self::O) { - self.starting_after = Some(item.id()); - } -} -/// The parameters for `ShippingRate::update`. -#[derive(Clone, Debug, Serialize, Default)] -pub struct UpdateShippingRate<'a> { - /// Whether the shipping rate can be used for new purchases. - /// - /// Defaults to `true`. - #[serde(skip_serializing_if = "Option::is_none")] - pub active: Option, - - /// Specifies which fields in the response should be expanded. - #[serde(skip_serializing_if = "Expand::is_empty")] - pub expand: &'a [&'a str], - - /// Describes a fixed amount to charge for shipping. - /// - /// Must be present if type is `fixed_amount`. - #[serde(skip_serializing_if = "Option::is_none")] - pub fixed_amount: Option, - - /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. - /// - /// This can be useful for storing additional information about the object in a structured format. - /// Individual keys can be unset by posting an empty value to them. - /// All keys can be unset by posting an empty value to `metadata`. - #[serde(skip_serializing_if = "Option::is_none")] - pub metadata: Option, - - /// Specifies whether the rate is considered inclusive of taxes or exclusive of taxes. - /// - /// One of `inclusive`, `exclusive`, or `unspecified`. - #[serde(skip_serializing_if = "Option::is_none")] - pub tax_behavior: Option, -} - -impl<'a> UpdateShippingRate<'a> { - pub fn new() -> Self { - UpdateShippingRate { - active: Default::default(), - expand: Default::default(), - fixed_amount: Default::default(), - metadata: Default::default(), - tax_behavior: Default::default(), - } - } -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreateShippingRateDeliveryEstimate { - /// The upper bound of the estimated range. - /// - /// If empty, represents no upper bound i.e., infinite. - #[serde(skip_serializing_if = "Option::is_none")] - pub maximum: Option, - - /// The lower bound of the estimated range. - /// - /// If empty, represents no lower bound. - #[serde(skip_serializing_if = "Option::is_none")] - pub minimum: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreateShippingRateFixedAmount { - /// A non-negative integer in cents representing how much to charge. - pub amount: i64, - - /// Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. - /// - /// Must be a [supported currency](https://stripe.com/docs/currencies). - pub currency: Currency, - - /// Shipping rates defined in each available currency option. - /// - /// Each key must be a three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html) and a [supported currency](https://stripe.com/docs/currencies). - #[serde(skip_serializing_if = "Option::is_none")] - pub currency_options: Option>, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UpdateShippingRateFixedAmount { - /// Shipping rates defined in each available currency option. - /// - /// Each key must be a three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html) and a [supported currency](https://stripe.com/docs/currencies). - #[serde(skip_serializing_if = "Option::is_none")] - pub currency_options: Option>, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreateShippingRateDeliveryEstimateMaximum { - /// A unit of time. - pub unit: CreateShippingRateDeliveryEstimateMaximumUnit, - - /// Must be greater than 0. - pub value: i64, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreateShippingRateDeliveryEstimateMinimum { - /// A unit of time. - pub unit: CreateShippingRateDeliveryEstimateMinimumUnit, - - /// Must be greater than 0. - pub value: i64, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreateShippingRateFixedAmountCurrencyOptions { - /// A non-negative integer in cents representing how much to charge. - pub amount: i64, - - /// Specifies whether the rate is considered inclusive of taxes or exclusive of taxes. - /// - /// One of `inclusive`, `exclusive`, or `unspecified`. - #[serde(skip_serializing_if = "Option::is_none")] - pub tax_behavior: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UpdateShippingRateFixedAmountCurrencyOptions { - /// A non-negative integer in cents representing how much to charge. - #[serde(skip_serializing_if = "Option::is_none")] - pub amount: Option, - - /// Specifies whether the rate is considered inclusive of taxes or exclusive of taxes. - /// - /// One of `inclusive`, `exclusive`, or `unspecified`. - #[serde(skip_serializing_if = "Option::is_none")] - pub tax_behavior: Option, -} - -/// An enum representing the possible values of an `CreateShippingRateDeliveryEstimateMaximum`'s `unit` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CreateShippingRateDeliveryEstimateMaximumUnit { - BusinessDay, - Day, - Hour, - Month, - Week, -} - -impl CreateShippingRateDeliveryEstimateMaximumUnit { - pub fn as_str(self) -> &'static str { - match self { - CreateShippingRateDeliveryEstimateMaximumUnit::BusinessDay => "business_day", - CreateShippingRateDeliveryEstimateMaximumUnit::Day => "day", - CreateShippingRateDeliveryEstimateMaximumUnit::Hour => "hour", - CreateShippingRateDeliveryEstimateMaximumUnit::Month => "month", - CreateShippingRateDeliveryEstimateMaximumUnit::Week => "week", - } - } -} - -impl AsRef for CreateShippingRateDeliveryEstimateMaximumUnit { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for CreateShippingRateDeliveryEstimateMaximumUnit { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for CreateShippingRateDeliveryEstimateMaximumUnit { - fn default() -> Self { - Self::BusinessDay - } -} - -/// An enum representing the possible values of an `CreateShippingRateDeliveryEstimateMinimum`'s `unit` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CreateShippingRateDeliveryEstimateMinimumUnit { - BusinessDay, - Day, - Hour, - Month, - Week, -} - -impl CreateShippingRateDeliveryEstimateMinimumUnit { - pub fn as_str(self) -> &'static str { - match self { - CreateShippingRateDeliveryEstimateMinimumUnit::BusinessDay => "business_day", - CreateShippingRateDeliveryEstimateMinimumUnit::Day => "day", - CreateShippingRateDeliveryEstimateMinimumUnit::Hour => "hour", - CreateShippingRateDeliveryEstimateMinimumUnit::Month => "month", - CreateShippingRateDeliveryEstimateMinimumUnit::Week => "week", - } - } -} - -impl AsRef for CreateShippingRateDeliveryEstimateMinimumUnit { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for CreateShippingRateDeliveryEstimateMinimumUnit { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for CreateShippingRateDeliveryEstimateMinimumUnit { - fn default() -> Self { - Self::BusinessDay - } -} - -/// An enum representing the possible values of an `CreateShippingRateFixedAmountCurrencyOptions`'s `tax_behavior` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CreateShippingRateFixedAmountCurrencyOptionsTaxBehavior { - Exclusive, - Inclusive, - Unspecified, -} - -impl CreateShippingRateFixedAmountCurrencyOptionsTaxBehavior { - pub fn as_str(self) -> &'static str { - match self { - CreateShippingRateFixedAmountCurrencyOptionsTaxBehavior::Exclusive => "exclusive", - CreateShippingRateFixedAmountCurrencyOptionsTaxBehavior::Inclusive => "inclusive", - CreateShippingRateFixedAmountCurrencyOptionsTaxBehavior::Unspecified => "unspecified", - } - } -} - -impl AsRef for CreateShippingRateFixedAmountCurrencyOptionsTaxBehavior { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for CreateShippingRateFixedAmountCurrencyOptionsTaxBehavior { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for CreateShippingRateFixedAmountCurrencyOptionsTaxBehavior { - fn default() -> Self { - Self::Exclusive - } -} - -/// An enum representing the possible values of an `ShippingRateCurrencyOption`'s `tax_behavior` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum ShippingRateCurrencyOptionTaxBehavior { - Exclusive, - Inclusive, - Unspecified, -} - -impl ShippingRateCurrencyOptionTaxBehavior { - pub fn as_str(self) -> &'static str { - match self { - ShippingRateCurrencyOptionTaxBehavior::Exclusive => "exclusive", - ShippingRateCurrencyOptionTaxBehavior::Inclusive => "inclusive", - ShippingRateCurrencyOptionTaxBehavior::Unspecified => "unspecified", - } - } -} - -impl AsRef for ShippingRateCurrencyOptionTaxBehavior { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for ShippingRateCurrencyOptionTaxBehavior { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for ShippingRateCurrencyOptionTaxBehavior { - fn default() -> Self { - Self::Exclusive - } -} - -/// An enum representing the possible values of an `ShippingRateDeliveryEstimateBound`'s `unit` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum ShippingRateDeliveryEstimateBoundUnit { - BusinessDay, - Day, - Hour, - Month, - Week, -} - -impl ShippingRateDeliveryEstimateBoundUnit { - pub fn as_str(self) -> &'static str { - match self { - ShippingRateDeliveryEstimateBoundUnit::BusinessDay => "business_day", - ShippingRateDeliveryEstimateBoundUnit::Day => "day", - ShippingRateDeliveryEstimateBoundUnit::Hour => "hour", - ShippingRateDeliveryEstimateBoundUnit::Month => "month", - ShippingRateDeliveryEstimateBoundUnit::Week => "week", - } - } -} - -impl AsRef for ShippingRateDeliveryEstimateBoundUnit { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for ShippingRateDeliveryEstimateBoundUnit { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for ShippingRateDeliveryEstimateBoundUnit { - fn default() -> Self { - Self::BusinessDay - } -} - -/// An enum representing the possible values of an `ShippingRate`'s `tax_behavior` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum ShippingRateTaxBehavior { - Exclusive, - Inclusive, - Unspecified, -} - -impl ShippingRateTaxBehavior { - pub fn as_str(self) -> &'static str { - match self { - ShippingRateTaxBehavior::Exclusive => "exclusive", - ShippingRateTaxBehavior::Inclusive => "inclusive", - ShippingRateTaxBehavior::Unspecified => "unspecified", - } - } -} - -impl AsRef for ShippingRateTaxBehavior { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for ShippingRateTaxBehavior { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for ShippingRateTaxBehavior { - fn default() -> Self { - Self::Exclusive - } -} - -/// An enum representing the possible values of an `ShippingRate`'s `type` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum ShippingRateType { - FixedAmount, -} - -impl ShippingRateType { - pub fn as_str(self) -> &'static str { - match self { - ShippingRateType::FixedAmount => "fixed_amount", - } - } -} - -impl AsRef for ShippingRateType { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for ShippingRateType { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for ShippingRateType { - fn default() -> Self { - Self::FixedAmount - } -} - -/// An enum representing the possible values of an `UpdateShippingRateFixedAmountCurrencyOptions`'s `tax_behavior` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum UpdateShippingRateFixedAmountCurrencyOptionsTaxBehavior { - Exclusive, - Inclusive, - Unspecified, -} - -impl UpdateShippingRateFixedAmountCurrencyOptionsTaxBehavior { - pub fn as_str(self) -> &'static str { - match self { - UpdateShippingRateFixedAmountCurrencyOptionsTaxBehavior::Exclusive => "exclusive", - UpdateShippingRateFixedAmountCurrencyOptionsTaxBehavior::Inclusive => "inclusive", - UpdateShippingRateFixedAmountCurrencyOptionsTaxBehavior::Unspecified => "unspecified", - } - } -} - -impl AsRef for UpdateShippingRateFixedAmountCurrencyOptionsTaxBehavior { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for UpdateShippingRateFixedAmountCurrencyOptionsTaxBehavior { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for UpdateShippingRateFixedAmountCurrencyOptionsTaxBehavior { - fn default() -> Self { - Self::Exclusive - } -} diff --git a/src/resources/generated/sigma_scheduled_query_run_created.rs b/src/resources/generated/sigma_scheduled_query_run_created.rs deleted file mode 100644 index 184c31996..000000000 --- a/src/resources/generated/sigma_scheduled_query_run_created.rs +++ /dev/null @@ -1,10 +0,0 @@ -// ====================================== -// This file was automatically generated. -// ====================================== - -use serde::{Deserialize, Serialize}; - -/// The resource representing a Stripe "sigma.scheduled_query_run.created". -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct SigmaScheduledQueryRunCreated { -} diff --git a/src/resources/generated/source.rs b/src/resources/generated/source.rs deleted file mode 100644 index 612b2f5a5..000000000 --- a/src/resources/generated/source.rs +++ /dev/null @@ -1,1780 +0,0 @@ -// ====================================== -// This file was automatically generated. -// ====================================== - -use serde::{Deserialize, Serialize}; - -use crate::client::{Client, Response}; -use crate::ids::{CustomerId, SourceId, TokenId}; -use crate::params::{Expand, List, Metadata, Object, Paginable, Timestamp}; -use crate::resources::{ - Address, BillingDetails, Currency, Shipping, SourceRedirectFlowFailureReason, - SourceRedirectFlowStatus, SourceStatus, SourceUsage, -}; - -/// The resource representing a Stripe "Source". -/// -/// For more details see -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct Source { - /// Unique identifier for the object. - pub id: SourceId, - - #[serde(skip_serializing_if = "Option::is_none")] - pub ach_credit_transfer: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub ach_debit: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub acss_debit: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub alipay: Option, - - /// A positive integer in the smallest currency unit (that is, 100 cents for $1.00, or 1 for ¥1, Japanese Yen being a zero-decimal currency) representing the total amount associated with the source. - /// - /// This is the amount for which the source will be chargeable once ready. - /// Required for `single_use` sources. - pub amount: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub au_becs_debit: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub bancontact: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub card: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub card_present: Option, - - /// The client secret of the source. - /// - /// Used for client-side retrieval using a publishable key. - pub client_secret: String, - - #[serde(skip_serializing_if = "Option::is_none")] - pub code_verification: Option, - - /// Time at which the object was created. - /// - /// Measured in seconds since the Unix epoch. - pub created: Timestamp, - - /// Three-letter [ISO code for the currency](https://stripe.com/docs/currencies) associated with the source. - /// - /// This is the currency for which the source will be chargeable once ready. - /// Required for `single_use` sources. - pub currency: Option, - - /// The ID of the customer to which this source is attached. - /// - /// This will not be present when the source has not been attached to a customer. - #[serde(skip_serializing_if = "Option::is_none")] - pub customer: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub eps: Option, - - /// The authentication `flow` of the source. - /// - /// `flow` is one of `redirect`, `receiver`, `code_verification`, `none`. - pub flow: SourceFlow, - - #[serde(skip_serializing_if = "Option::is_none")] - pub giropay: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub ideal: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub klarna: Option, - - /// Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. - pub livemode: bool, - - /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. - /// - /// This can be useful for storing additional information about the object in a structured format. - pub metadata: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub multibanco: Option, - - /// Information about the owner of the payment instrument that may be used or required by particular source types. - pub owner: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub p24: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub receiver: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub redirect: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub sepa_credit_transfer: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub sepa_debit: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub sofort: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub source_order: Option, - - /// Extra information about a source. - /// - /// This will appear on your customer's statement every time you charge the source. - pub statement_descriptor: Option, - - /// The status of the source, one of `canceled`, `chargeable`, `consumed`, `failed`, or `pending`. - /// - /// Only `chargeable` sources can be used to create a charge. - pub status: SourceStatus, - - #[serde(skip_serializing_if = "Option::is_none")] - pub three_d_secure: Option, - - /// The `type` of the source. - /// - /// The `type` is a payment method, one of `ach_credit_transfer`, `ach_debit`, `alipay`, `bancontact`, `card`, `card_present`, `eps`, `giropay`, `ideal`, `multibanco`, `klarna`, `p24`, `sepa_debit`, `sofort`, `three_d_secure`, or `wechat`. - /// An additional hash is included on the source with a name matching this value. - /// It contains additional information specific to the [payment method](https://stripe.com/docs/sources) used. - #[serde(rename = "type")] - pub type_: SourceType, - - /// Either `reusable` or `single_use`. - /// - /// Whether this source should be reusable or not. - /// Some source types may or may not be reusable by construction, while others may leave the option at creation. - /// If an incompatible value is passed, an error will be returned. - pub usage: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub wechat: Option, -} - -impl Source { - /// List source transactions for a given source. - pub fn list(client: &Client, params: &ListSources<'_>) -> Response> { - client.get_query("/sources/{source}/source_transactions", ¶ms) - } - - /// Creates a new source object. - pub fn create(client: &Client, params: CreateSource<'_>) -> Response { - client.post_form("/sources", ¶ms) - } - - /// Retrieves an existing source object. - /// - /// Supply the unique source ID from a source creation request and Stripe will return the corresponding up-to-date source object information. - pub fn retrieve(client: &Client, id: &SourceId, expand: &[&str]) -> Response { - client.get_query(&format!("/sources/{}", id), &Expand { expand }) - } - - /// Updates the specified source by setting the values of the parameters passed. - /// - /// Any parameters not provided will be left unchanged. This request accepts the `metadata` and `owner` as arguments. - /// It is also possible to update type specific information for selected payment methods. - /// Please refer to our [payment method guides](https://stripe.com/docs/sources) for more detail. - pub fn update(client: &Client, id: &SourceId, params: UpdateSource<'_>) -> Response { - client.post_form(&format!("/sources/{}", id), ¶ms) - } -} - -impl Object for Source { - type Id = SourceId; - fn id(&self) -> Self::Id { - self.id.clone() - } - fn object(&self) -> &'static str { - "source" - } -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct SourceCodeVerificationFlow { - /// The number of attempts remaining to authenticate the source object with a verification code. - pub attempts_remaining: i64, - - /// The status of the code verification, either `pending` (awaiting verification, `attempts_remaining` should be greater than 0), `succeeded` (successful verification) or `failed` (failed verification, cannot be verified anymore as `attempts_remaining` should be 0). - pub status: String, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct SourceOrder { - /// A positive integer in the smallest currency unit (that is, 100 cents for $1.00, or 1 for ¥1, Japanese Yen being a zero-decimal currency) representing the total amount for the order. - pub amount: i64, - - /// Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. - /// - /// Must be a [supported currency](https://stripe.com/docs/currencies). - pub currency: Currency, - - /// The email address of the customer placing the order. - #[serde(skip_serializing_if = "Option::is_none")] - pub email: Option, - - /// List of items constituting the order. - pub items: Option>, - - #[serde(skip_serializing_if = "Option::is_none")] - pub shipping: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct SourceOrderItem { - /// The amount (price) for this order item. - pub amount: Option, - - /// This currency of this order item. - /// - /// Required when `amount` is present. - pub currency: Option, - - /// Human-readable description for this order item. - pub description: Option, - - /// The ID of the associated object for this line item. - /// - /// Expandable if not null (e.g., expandable to a SKU). - pub parent: Option, - - /// The quantity of this order item. - /// - /// When type is `sku`, this is the number of instances of the SKU to be ordered. - #[serde(skip_serializing_if = "Option::is_none")] - pub quantity: Option, - - /// The type of this order item. - /// - /// Must be `sku`, `tax`, or `shipping`. - #[serde(rename = "type")] - pub type_: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct SourceOwner { - /// Owner's address. - pub address: Option
, - - /// Owner's email address. - pub email: Option, - - /// Owner's full name. - pub name: Option, - - /// Owner's phone number (including extension). - pub phone: Option, - - /// Verified owner's address. - /// - /// Verified values are verified or provided by the payment method directly (and if supported) at the time of authorization or settlement. - /// They cannot be set or mutated. - pub verified_address: Option
, - - /// Verified owner's email address. - /// - /// Verified values are verified or provided by the payment method directly (and if supported) at the time of authorization or settlement. - /// They cannot be set or mutated. - pub verified_email: Option, - - /// Verified owner's full name. - /// - /// Verified values are verified or provided by the payment method directly (and if supported) at the time of authorization or settlement. - /// They cannot be set or mutated. - pub verified_name: Option, - - /// Verified owner's phone number (including extension). - /// - /// Verified values are verified or provided by the payment method directly (and if supported) at the time of authorization or settlement. - /// They cannot be set or mutated. - pub verified_phone: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct SourceReceiverFlow { - /// The address of the receiver source. - /// - /// This is the value that should be communicated to the customer to send their funds to. - pub address: Option, - - /// The total amount that was moved to your balance. - /// - /// This is almost always equal to the amount charged. - /// In rare cases when customers deposit excess funds and we are unable to refund those, those funds get moved to your balance and show up in amount_charged as well. - /// The amount charged is expressed in the source's currency. - pub amount_charged: i64, - - /// The total amount received by the receiver source. - /// - /// `amount_received = amount_returned + amount_charged` should be true for consumed sources unless customers deposit excess funds. - /// The amount received is expressed in the source's currency. - pub amount_received: i64, - - /// The total amount that was returned to the customer. - /// - /// The amount returned is expressed in the source's currency. - pub amount_returned: i64, - - /// Type of refund attribute method, one of `email`, `manual`, or `none`. - pub refund_attributes_method: String, - - /// Type of refund attribute status, one of `missing`, `requested`, or `available`. - pub refund_attributes_status: String, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct SourceRedirectFlow { - /// The failure reason for the redirect, either `user_abort` (the customer aborted or dropped out of the redirect flow), `declined` (the authentication failed or the transaction was declined), or `processing_error` (the redirect failed due to a technical error). - /// - /// Present only if the redirect status is `failed`. - pub failure_reason: Option, - - /// The URL you provide to redirect the customer to after they authenticated their payment. - pub return_url: String, - - /// The status of the redirect, either `pending` (ready to be used by your customer to authenticate the transaction), `succeeded` (succesful authentication, cannot be reused) or `not_required` (redirect should not be used) or `failed` (failed authentication, cannot be reused). - pub status: SourceRedirectFlowStatus, - - /// The URL provided to you to redirect a customer to as part of a `redirect` authentication flow. - pub url: String, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct SourceTypeAchCreditTransfer { - #[serde(skip_serializing_if = "Option::is_none")] - pub account_number: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub bank_name: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub fingerprint: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub refund_account_holder_name: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub refund_account_holder_type: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub refund_routing_number: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub routing_number: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub swift_code: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct SourceTypeAchDebit { - #[serde(skip_serializing_if = "Option::is_none")] - pub bank_name: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub country: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub fingerprint: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub last4: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub routing_number: Option, - - #[serde(rename = "type")] - #[serde(skip_serializing_if = "Option::is_none")] - pub type_: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct SourceTypeAcssDebit { - #[serde(skip_serializing_if = "Option::is_none")] - pub bank_address_city: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub bank_address_line_1: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub bank_address_line_2: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub bank_address_postal_code: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub bank_name: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub category: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub country: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub fingerprint: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub last4: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub routing_number: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct SourceTypeAlipay { - #[serde(skip_serializing_if = "Option::is_none")] - pub data_string: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub native_url: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub statement_descriptor: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct SourceTypeAuBecsDebit { - #[serde(skip_serializing_if = "Option::is_none")] - pub bsb_number: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub fingerprint: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub last4: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct SourceTypeBancontact { - #[serde(skip_serializing_if = "Option::is_none")] - pub bank_code: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub bank_name: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub bic: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub iban_last4: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub preferred_language: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub statement_descriptor: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct SourceTypeCard { - #[serde(skip_serializing_if = "Option::is_none")] - pub address_line1_check: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub address_zip_check: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub brand: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub country: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub cvc_check: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub description: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub dynamic_last4: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub exp_month: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub exp_year: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub fingerprint: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub funding: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub iin: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub issuer: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub last4: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub name: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub three_d_secure: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub tokenization_method: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct SourceTypeCardPresent { - #[serde(skip_serializing_if = "Option::is_none")] - pub application_cryptogram: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub application_preferred_name: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub authorization_code: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub authorization_response_code: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub brand: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub country: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub cvm_type: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub data_type: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub dedicated_file_name: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub description: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub emv_auth_data: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub evidence_customer_signature: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub evidence_transaction_certificate: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub exp_month: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub exp_year: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub fingerprint: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub funding: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub iin: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub issuer: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub last4: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub pos_device_id: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub pos_entry_mode: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub read_method: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub reader: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub terminal_verification_results: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub transaction_status_information: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct SourceTypeEps { - #[serde(skip_serializing_if = "Option::is_none")] - pub reference: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub statement_descriptor: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct SourceTypeGiropay { - #[serde(skip_serializing_if = "Option::is_none")] - pub bank_code: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub bank_name: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub bic: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub statement_descriptor: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct SourceTypeIdeal { - #[serde(skip_serializing_if = "Option::is_none")] - pub bank: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub bic: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub iban_last4: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub statement_descriptor: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct SourceTypeKlarna { - #[serde(skip_serializing_if = "Option::is_none")] - pub background_image_url: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub client_token: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub first_name: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub last_name: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub locale: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub logo_url: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub page_title: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub pay_later_asset_urls_descriptive: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub pay_later_asset_urls_standard: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub pay_later_name: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub pay_later_redirect_url: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub pay_now_asset_urls_descriptive: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub pay_now_asset_urls_standard: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub pay_now_name: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub pay_now_redirect_url: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub pay_over_time_asset_urls_descriptive: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub pay_over_time_asset_urls_standard: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub pay_over_time_name: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub pay_over_time_redirect_url: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub payment_method_categories: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub purchase_country: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub purchase_type: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub redirect_url: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub shipping_delay: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub shipping_first_name: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub shipping_last_name: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct SourceTypeMultibanco { - #[serde(skip_serializing_if = "Option::is_none")] - pub entity: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub reference: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub refund_account_holder_address_city: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub refund_account_holder_address_country: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub refund_account_holder_address_line1: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub refund_account_holder_address_line2: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub refund_account_holder_address_postal_code: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub refund_account_holder_address_state: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub refund_account_holder_name: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub refund_iban: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct SourceTypeP24 { - #[serde(skip_serializing_if = "Option::is_none")] - pub reference: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct SourceTypeSepaCreditTransfer { - #[serde(skip_serializing_if = "Option::is_none")] - pub bank_name: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub bic: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub iban: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub refund_account_holder_address_city: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub refund_account_holder_address_country: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub refund_account_holder_address_line1: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub refund_account_holder_address_line2: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub refund_account_holder_address_postal_code: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub refund_account_holder_address_state: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub refund_account_holder_name: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub refund_iban: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct SourceTypeSepaDebit { - #[serde(skip_serializing_if = "Option::is_none")] - pub bank_code: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub branch_code: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub country: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub fingerprint: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub last4: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub mandate_reference: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub mandate_url: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct SourceTypeSofort { - #[serde(skip_serializing_if = "Option::is_none")] - pub bank_code: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub bank_name: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub bic: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub country: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub iban_last4: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub preferred_language: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub statement_descriptor: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct SourceTypeThreeDSecure { - #[serde(skip_serializing_if = "Option::is_none")] - pub address_line1_check: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub address_zip_check: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub authenticated: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub brand: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub card: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub country: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub customer: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub cvc_check: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub description: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub dynamic_last4: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub exp_month: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub exp_year: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub fingerprint: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub funding: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub iin: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub issuer: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub last4: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub name: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub three_d_secure: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub tokenization_method: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct SourceTypeWechat { - #[serde(skip_serializing_if = "Option::is_none")] - pub prepay_id: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub qr_code_url: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub statement_descriptor: Option, -} - -/// The parameters for `Source::create`. -#[derive(Clone, Debug, Serialize, Default)] -pub struct CreateSource<'a> { - /// Amount associated with the source. - /// - /// This is the amount for which the source will be chargeable once ready. - /// Required for `single_use` sources. - /// Not supported for `receiver` type sources, where charge amount may not be specified until funds land. - #[serde(skip_serializing_if = "Option::is_none")] - pub amount: Option, - - /// Three-letter [ISO code for the currency](https://stripe.com/docs/currencies) associated with the source. - /// - /// This is the currency for which the source will be chargeable once ready. - #[serde(skip_serializing_if = "Option::is_none")] - pub currency: Option, - - /// The `Customer` to whom the original source is attached to. - /// - /// Must be set when the original source is not a `Source` (e.g., `Card`). - #[serde(skip_serializing_if = "Option::is_none")] - pub customer: Option, - - /// Specifies which fields in the response should be expanded. - #[serde(skip_serializing_if = "Expand::is_empty")] - pub expand: &'a [&'a str], - - /// The authentication `flow` of the source to create. - /// - /// `flow` is one of `redirect`, `receiver`, `code_verification`, `none`. - /// It is generally inferred unless a type supports multiple flows. - #[serde(skip_serializing_if = "Option::is_none")] - pub flow: Option, - - /// Information about a mandate possibility attached to a source object (generally for bank debits) as well as its acceptance status. - #[serde(skip_serializing_if = "Option::is_none")] - pub mandate: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub metadata: Option, - - /// The source to share. - #[serde(skip_serializing_if = "Option::is_none")] - pub original_source: Option<&'a str>, - - /// Information about the owner of the payment instrument that may be used or required by particular source types. - #[serde(skip_serializing_if = "Option::is_none")] - pub owner: Option, - - /// Optional parameters for the receiver flow. - /// - /// Can be set only if the source is a receiver (`flow` is `receiver`). - #[serde(skip_serializing_if = "Option::is_none")] - pub receiver: Option, - - /// Parameters required for the redirect flow. - /// - /// Required if the source is authenticated by a redirect (`flow` is `redirect`). - #[serde(skip_serializing_if = "Option::is_none")] - pub redirect: Option, - - /// Information about the items and shipping associated with the source. - /// - /// Required for transactional credit (for example Klarna) sources before you can charge it. - #[serde(skip_serializing_if = "Option::is_none")] - pub source_order: Option, - - /// An arbitrary string to be displayed on your customer's statement. - /// - /// As an example, if your website is `RunClub` and the item you're charging for is a race ticket, you may want to specify a `statement_descriptor` of `RunClub 5K race ticket.` While many payment types will display this information, some may not display it at all. - #[serde(skip_serializing_if = "Option::is_none")] - pub statement_descriptor: Option<&'a str>, - - /// An optional token used to create the source. - /// - /// When passed, token properties will override source parameters. - #[serde(skip_serializing_if = "Option::is_none")] - pub token: Option, - - /// The `type` of the source to create. - /// - /// Required unless `customer` and `original_source` are specified (see the [Cloning card Sources](https://stripe.com/docs/sources/connect#cloning-card-sources) guide). - #[serde(rename = "type")] - #[serde(skip_serializing_if = "Option::is_none")] - pub type_: Option<&'a str>, -} - -impl<'a> CreateSource<'a> { - pub fn new() -> Self { - CreateSource { - amount: Default::default(), - currency: Default::default(), - customer: Default::default(), - expand: Default::default(), - flow: Default::default(), - mandate: Default::default(), - metadata: Default::default(), - original_source: Default::default(), - owner: Default::default(), - receiver: Default::default(), - redirect: Default::default(), - source_order: Default::default(), - statement_descriptor: Default::default(), - token: Default::default(), - type_: Default::default(), - } - } -} - -/// The parameters for `Source::list`. -#[derive(Clone, Debug, Serialize)] -pub struct ListSources<'a> { - /// A cursor for use in pagination. - /// - /// `ending_before` is an object ID that defines your place in the list. - /// For instance, if you make a list request and receive 100 objects, starting with `obj_bar`, your subsequent call can include `ending_before=obj_bar` in order to fetch the previous page of the list. - #[serde(skip_serializing_if = "Option::is_none")] - pub ending_before: Option, - - /// Specifies which fields in the response should be expanded. - #[serde(skip_serializing_if = "Expand::is_empty")] - pub expand: &'a [&'a str], - - /// A limit on the number of objects to be returned. - /// - /// Limit can range between 1 and 100, and the default is 10. - #[serde(skip_serializing_if = "Option::is_none")] - pub limit: Option, - - /// A cursor for use in pagination. - /// - /// `starting_after` is an object ID that defines your place in the list. - /// For instance, if you make a list request and receive 100 objects, ending with `obj_foo`, your subsequent call can include `starting_after=obj_foo` in order to fetch the next page of the list. - #[serde(skip_serializing_if = "Option::is_none")] - pub starting_after: Option, -} - -impl<'a> ListSources<'a> { - pub fn new() -> Self { - ListSources { - ending_before: Default::default(), - expand: Default::default(), - limit: Default::default(), - starting_after: Default::default(), - } - } -} -impl Paginable for ListSources<'_> { - type O = Source; - fn set_last(&mut self, item: Self::O) { - self.starting_after = Some(item.id()); - } -} -/// The parameters for `Source::update`. -#[derive(Clone, Debug, Serialize, Default)] -pub struct UpdateSource<'a> { - /// Amount associated with the source. - #[serde(skip_serializing_if = "Option::is_none")] - pub amount: Option, - - /// Specifies which fields in the response should be expanded. - #[serde(skip_serializing_if = "Expand::is_empty")] - pub expand: &'a [&'a str], - - /// Information about a mandate possibility attached to a source object (generally for bank debits) as well as its acceptance status. - #[serde(skip_serializing_if = "Option::is_none")] - pub mandate: Option, - - /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. - /// - /// This can be useful for storing additional information about the object in a structured format. - /// Individual keys can be unset by posting an empty value to them. - /// All keys can be unset by posting an empty value to `metadata`. - #[serde(skip_serializing_if = "Option::is_none")] - pub metadata: Option, - - /// Information about the owner of the payment instrument that may be used or required by particular source types. - #[serde(skip_serializing_if = "Option::is_none")] - pub owner: Option, - - /// Information about the items and shipping associated with the source. - /// - /// Required for transactional credit (for example Klarna) sources before you can charge it. - #[serde(skip_serializing_if = "Option::is_none")] - pub source_order: Option, -} - -impl<'a> UpdateSource<'a> { - pub fn new() -> Self { - UpdateSource { - amount: Default::default(), - expand: Default::default(), - mandate: Default::default(), - metadata: Default::default(), - owner: Default::default(), - source_order: Default::default(), - } - } -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreateSourceReceiver { - /// The method Stripe should use to request information needed to process a refund or mispayment. - /// - /// Either `email` (an email is sent directly to the customer) or `manual` (a `source.refund_attributes_required` event is sent to your webhooks endpoint). - /// Refer to each payment method's documentation to learn which refund attributes may be required. - #[serde(skip_serializing_if = "Option::is_none")] - pub refund_attributes_method: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreateSourceRedirect { - /// The URL you provide to redirect the customer back to you after they authenticated their payment. - /// - /// It can use your application URI scheme in the context of a mobile application. - pub return_url: String, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreateSourceSourceOrder { - /// List of items constituting the order. - #[serde(skip_serializing_if = "Option::is_none")] - pub items: Option>, - - /// Shipping address for the order. - /// - /// Required if any of the SKUs are for products that have `shippable` set to true. - #[serde(skip_serializing_if = "Option::is_none")] - pub shipping: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct SourceMandateParams { - /// The parameters required to notify Stripe of a mandate acceptance or refusal by the customer. - #[serde(skip_serializing_if = "Option::is_none")] - pub acceptance: Option, - - /// The amount specified by the mandate. - /// - /// (Leave null for a mandate covering all amounts). - #[serde(skip_serializing_if = "Option::is_none")] - pub amount: Option, - - /// The currency specified by the mandate. - /// - /// (Must match `currency` of the source). - #[serde(skip_serializing_if = "Option::is_none")] - pub currency: Option, - - /// The interval of debits permitted by the mandate. - /// - /// Either `one_time` (just permitting a single debit), `scheduled` (with debits on an agreed schedule or for clearly-defined events), or `variable`(for debits with any frequency). - #[serde(skip_serializing_if = "Option::is_none")] - pub interval: Option, - - /// The method Stripe should use to notify the customer of upcoming debit instructions and/or mandate confirmation as required by the underlying debit network. - /// - /// Either `email` (an email is sent directly to the customer), `manual` (a `source.mandate_notification` event is sent to your webhooks endpoint and you should handle the notification) or `none` (the underlying debit network does not require any notification). - #[serde(skip_serializing_if = "Option::is_none")] - pub notification_method: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UpdateSourceSourceOrder { - /// List of items constituting the order. - #[serde(skip_serializing_if = "Option::is_none")] - pub items: Option>, - - /// Shipping address for the order. - /// - /// Required if any of the SKUs are for products that have `shippable` set to true. - #[serde(skip_serializing_if = "Option::is_none")] - pub shipping: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreateSourceSourceOrderItems { - #[serde(skip_serializing_if = "Option::is_none")] - pub amount: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub currency: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub description: Option, - - /// The ID of the SKU being ordered. - #[serde(skip_serializing_if = "Option::is_none")] - pub parent: Option, - - /// The quantity of this order item. - /// - /// When type is `sku`, this is the number of instances of the SKU to be ordered. - #[serde(skip_serializing_if = "Option::is_none")] - pub quantity: Option, - - #[serde(rename = "type")] - #[serde(skip_serializing_if = "Option::is_none")] - pub type_: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreateSourceSourceOrderShipping { - /// Shipping address. - pub address: CreateSourceSourceOrderShippingAddress, - - /// The delivery service that shipped a physical product, such as Fedex, UPS, USPS, etc. - #[serde(skip_serializing_if = "Option::is_none")] - pub carrier: Option, - - /// Recipient name. - #[serde(skip_serializing_if = "Option::is_none")] - pub name: Option, - - /// Recipient phone (including extension). - #[serde(skip_serializing_if = "Option::is_none")] - pub phone: Option, - - /// The tracking number for a physical product, obtained from the delivery service. - /// - /// If multiple tracking numbers were generated for this purchase, please separate them with commas. - #[serde(skip_serializing_if = "Option::is_none")] - pub tracking_number: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct SourceAcceptanceParams { - /// The Unix timestamp (in seconds) when the mandate was accepted or refused by the customer. - #[serde(skip_serializing_if = "Option::is_none")] - pub date: Option, - - /// The IP address from which the mandate was accepted or refused by the customer. - #[serde(skip_serializing_if = "Option::is_none")] - pub ip: Option, - - /// The parameters required to store a mandate accepted offline. - /// - /// Should only be set if `mandate[type]` is `offline`. - #[serde(skip_serializing_if = "Option::is_none")] - pub offline: Option, - - /// The parameters required to store a mandate accepted online. - /// - /// Should only be set if `mandate[type]` is `online`. - #[serde(skip_serializing_if = "Option::is_none")] - pub online: Option, - - /// The status of the mandate acceptance. - /// - /// Either `accepted` (the mandate was accepted) or `refused` (the mandate was refused). - pub status: SourceAcceptanceParamsStatus, - - /// The type of acceptance information included with the mandate. - /// - /// Either `online` or `offline`. - #[serde(rename = "type")] - #[serde(skip_serializing_if = "Option::is_none")] - pub type_: Option, - - /// The user agent of the browser from which the mandate was accepted or refused by the customer. - #[serde(skip_serializing_if = "Option::is_none")] - pub user_agent: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UpdateSourceSourceOrderItems { - #[serde(skip_serializing_if = "Option::is_none")] - pub amount: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub currency: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub description: Option, - - /// The ID of the SKU being ordered. - #[serde(skip_serializing_if = "Option::is_none")] - pub parent: Option, - - /// The quantity of this order item. - /// - /// When type is `sku`, this is the number of instances of the SKU to be ordered. - #[serde(skip_serializing_if = "Option::is_none")] - pub quantity: Option, - - #[serde(rename = "type")] - #[serde(skip_serializing_if = "Option::is_none")] - pub type_: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UpdateSourceSourceOrderShipping { - /// Shipping address. - pub address: UpdateSourceSourceOrderShippingAddress, - - /// The delivery service that shipped a physical product, such as Fedex, UPS, USPS, etc. - #[serde(skip_serializing_if = "Option::is_none")] - pub carrier: Option, - - /// Recipient name. - #[serde(skip_serializing_if = "Option::is_none")] - pub name: Option, - - /// Recipient phone (including extension). - #[serde(skip_serializing_if = "Option::is_none")] - pub phone: Option, - - /// The tracking number for a physical product, obtained from the delivery service. - /// - /// If multiple tracking numbers were generated for this purchase, please separate them with commas. - #[serde(skip_serializing_if = "Option::is_none")] - pub tracking_number: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreateSourceSourceOrderShippingAddress { - /// City, district, suburb, town, or village. - #[serde(skip_serializing_if = "Option::is_none")] - pub city: Option, - - /// Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). - #[serde(skip_serializing_if = "Option::is_none")] - pub country: Option, - - /// Address line 1 (e.g., street, PO Box, or company name). - pub line1: String, - - /// Address line 2 (e.g., apartment, suite, unit, or building). - #[serde(skip_serializing_if = "Option::is_none")] - pub line2: Option, - - /// ZIP or postal code. - #[serde(skip_serializing_if = "Option::is_none")] - pub postal_code: Option, - - /// State, county, province, or region. - #[serde(skip_serializing_if = "Option::is_none")] - pub state: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct SourceAcceptanceOfflineParams { - /// An email to contact you with if a copy of the mandate is requested, required if `type` is `offline`. - pub contact_email: String, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct SourceAcceptanceOnlineParams { - /// The Unix timestamp (in seconds) when the mandate was accepted or refused by the customer. - #[serde(skip_serializing_if = "Option::is_none")] - pub date: Option, - - /// The IP address from which the mandate was accepted or refused by the customer. - #[serde(skip_serializing_if = "Option::is_none")] - pub ip: Option, - - /// The user agent of the browser from which the mandate was accepted or refused by the customer. - #[serde(skip_serializing_if = "Option::is_none")] - pub user_agent: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UpdateSourceSourceOrderShippingAddress { - /// City, district, suburb, town, or village. - #[serde(skip_serializing_if = "Option::is_none")] - pub city: Option, - - /// Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). - #[serde(skip_serializing_if = "Option::is_none")] - pub country: Option, - - /// Address line 1 (e.g., street, PO Box, or company name). - pub line1: String, - - /// Address line 2 (e.g., apartment, suite, unit, or building). - #[serde(skip_serializing_if = "Option::is_none")] - pub line2: Option, - - /// ZIP or postal code. - #[serde(skip_serializing_if = "Option::is_none")] - pub postal_code: Option, - - /// State, county, province, or region. - #[serde(skip_serializing_if = "Option::is_none")] - pub state: Option, -} - -/// An enum representing the possible values of an `CreateSourceSourceOrderItems`'s `type` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CreateSourceSourceOrderItemsType { - Discount, - Shipping, - Sku, - Tax, -} - -impl CreateSourceSourceOrderItemsType { - pub fn as_str(self) -> &'static str { - match self { - CreateSourceSourceOrderItemsType::Discount => "discount", - CreateSourceSourceOrderItemsType::Shipping => "shipping", - CreateSourceSourceOrderItemsType::Sku => "sku", - CreateSourceSourceOrderItemsType::Tax => "tax", - } - } -} - -impl AsRef for CreateSourceSourceOrderItemsType { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for CreateSourceSourceOrderItemsType { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for CreateSourceSourceOrderItemsType { - fn default() -> Self { - Self::Discount - } -} - -/// An enum representing the possible values of an `SourceAcceptanceParams`'s `status` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum SourceAcceptanceParamsStatus { - Accepted, - Pending, - Refused, - Revoked, -} - -impl SourceAcceptanceParamsStatus { - pub fn as_str(self) -> &'static str { - match self { - SourceAcceptanceParamsStatus::Accepted => "accepted", - SourceAcceptanceParamsStatus::Pending => "pending", - SourceAcceptanceParamsStatus::Refused => "refused", - SourceAcceptanceParamsStatus::Revoked => "revoked", - } - } -} - -impl AsRef for SourceAcceptanceParamsStatus { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for SourceAcceptanceParamsStatus { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for SourceAcceptanceParamsStatus { - fn default() -> Self { - Self::Accepted - } -} - -/// An enum representing the possible values of an `SourceAcceptanceParams`'s `type` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum SourceAcceptanceParamsType { - Offline, - Online, -} - -impl SourceAcceptanceParamsType { - pub fn as_str(self) -> &'static str { - match self { - SourceAcceptanceParamsType::Offline => "offline", - SourceAcceptanceParamsType::Online => "online", - } - } -} - -impl AsRef for SourceAcceptanceParamsType { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for SourceAcceptanceParamsType { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for SourceAcceptanceParamsType { - fn default() -> Self { - Self::Offline - } -} - -/// An enum representing the possible values of an `CreateSource`'s `flow` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum SourceFlow { - CodeVerification, - None, - Receiver, - Redirect, -} - -impl SourceFlow { - pub fn as_str(self) -> &'static str { - match self { - SourceFlow::CodeVerification => "code_verification", - SourceFlow::None => "none", - SourceFlow::Receiver => "receiver", - SourceFlow::Redirect => "redirect", - } - } -} - -impl AsRef for SourceFlow { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for SourceFlow { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for SourceFlow { - fn default() -> Self { - Self::CodeVerification - } -} - -/// An enum representing the possible values of an `SourceMandateParams`'s `interval` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum SourceMandateInterval { - OneTime, - Scheduled, - Variable, -} - -impl SourceMandateInterval { - pub fn as_str(self) -> &'static str { - match self { - SourceMandateInterval::OneTime => "one_time", - SourceMandateInterval::Scheduled => "scheduled", - SourceMandateInterval::Variable => "variable", - } - } -} - -impl AsRef for SourceMandateInterval { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for SourceMandateInterval { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for SourceMandateInterval { - fn default() -> Self { - Self::OneTime - } -} - -/// An enum representing the possible values of an `SourceMandateParams`'s `notification_method` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum SourceMandateNotificationMethod { - DeprecatedNone, - Email, - Manual, - None, - StripeEmail, -} - -impl SourceMandateNotificationMethod { - pub fn as_str(self) -> &'static str { - match self { - SourceMandateNotificationMethod::DeprecatedNone => "deprecated_none", - SourceMandateNotificationMethod::Email => "email", - SourceMandateNotificationMethod::Manual => "manual", - SourceMandateNotificationMethod::None => "none", - SourceMandateNotificationMethod::StripeEmail => "stripe_email", - } - } -} - -impl AsRef for SourceMandateNotificationMethod { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for SourceMandateNotificationMethod { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for SourceMandateNotificationMethod { - fn default() -> Self { - Self::DeprecatedNone - } -} - -/// An enum representing the possible values of an `CreateSourceReceiver`'s `refund_attributes_method` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum SourceRefundNotificationMethod { - Email, - Manual, - None, -} - -impl SourceRefundNotificationMethod { - pub fn as_str(self) -> &'static str { - match self { - SourceRefundNotificationMethod::Email => "email", - SourceRefundNotificationMethod::Manual => "manual", - SourceRefundNotificationMethod::None => "none", - } - } -} - -impl AsRef for SourceRefundNotificationMethod { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for SourceRefundNotificationMethod { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for SourceRefundNotificationMethod { - fn default() -> Self { - Self::Email - } -} - -/// An enum representing the possible values of an `Source`'s `type` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum SourceType { - AchCreditTransfer, - AchDebit, - AcssDebit, - Alipay, - AuBecsDebit, - Bancontact, - Card, - CardPresent, - Eps, - Giropay, - Ideal, - Klarna, - Multibanco, - P24, - SepaCreditTransfer, - SepaDebit, - Sofort, - ThreeDSecure, - Wechat, -} - -impl SourceType { - pub fn as_str(self) -> &'static str { - match self { - SourceType::AchCreditTransfer => "ach_credit_transfer", - SourceType::AchDebit => "ach_debit", - SourceType::AcssDebit => "acss_debit", - SourceType::Alipay => "alipay", - SourceType::AuBecsDebit => "au_becs_debit", - SourceType::Bancontact => "bancontact", - SourceType::Card => "card", - SourceType::CardPresent => "card_present", - SourceType::Eps => "eps", - SourceType::Giropay => "giropay", - SourceType::Ideal => "ideal", - SourceType::Klarna => "klarna", - SourceType::Multibanco => "multibanco", - SourceType::P24 => "p24", - SourceType::SepaCreditTransfer => "sepa_credit_transfer", - SourceType::SepaDebit => "sepa_debit", - SourceType::Sofort => "sofort", - SourceType::ThreeDSecure => "three_d_secure", - SourceType::Wechat => "wechat", - } - } -} - -impl AsRef for SourceType { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for SourceType { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for SourceType { - fn default() -> Self { - Self::AchCreditTransfer - } -} - -/// An enum representing the possible values of an `UpdateSourceSourceOrderItems`'s `type` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum UpdateSourceSourceOrderItemsType { - Discount, - Shipping, - Sku, - Tax, -} - -impl UpdateSourceSourceOrderItemsType { - pub fn as_str(self) -> &'static str { - match self { - UpdateSourceSourceOrderItemsType::Discount => "discount", - UpdateSourceSourceOrderItemsType::Shipping => "shipping", - UpdateSourceSourceOrderItemsType::Sku => "sku", - UpdateSourceSourceOrderItemsType::Tax => "tax", - } - } -} - -impl AsRef for UpdateSourceSourceOrderItemsType { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for UpdateSourceSourceOrderItemsType { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for UpdateSourceSourceOrderItemsType { - fn default() -> Self { - Self::Discount - } -} diff --git a/src/resources/generated/source_canceled.rs b/src/resources/generated/source_canceled.rs deleted file mode 100644 index baadce21b..000000000 --- a/src/resources/generated/source_canceled.rs +++ /dev/null @@ -1,10 +0,0 @@ -// ====================================== -// This file was automatically generated. -// ====================================== - -use serde::{Deserialize, Serialize}; - -/// The resource representing a Stripe "source.canceled". -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct SourceCanceled { -} diff --git a/src/resources/generated/source_chargeable.rs b/src/resources/generated/source_chargeable.rs deleted file mode 100644 index 964cd0027..000000000 --- a/src/resources/generated/source_chargeable.rs +++ /dev/null @@ -1,10 +0,0 @@ -// ====================================== -// This file was automatically generated. -// ====================================== - -use serde::{Deserialize, Serialize}; - -/// The resource representing a Stripe "source.chargeable". -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct SourceChargeable { -} diff --git a/src/resources/generated/source_failed.rs b/src/resources/generated/source_failed.rs deleted file mode 100644 index 0d0f0608b..000000000 --- a/src/resources/generated/source_failed.rs +++ /dev/null @@ -1,10 +0,0 @@ -// ====================================== -// This file was automatically generated. -// ====================================== - -use serde::{Deserialize, Serialize}; - -/// The resource representing a Stripe "source.failed". -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct SourceFailed { -} diff --git a/src/resources/generated/source_mandate_notification.rs b/src/resources/generated/source_mandate_notification.rs deleted file mode 100644 index fb669fef4..000000000 --- a/src/resources/generated/source_mandate_notification.rs +++ /dev/null @@ -1,98 +0,0 @@ -// ====================================== -// This file was automatically generated. -// ====================================== - -use crate::ids::{SourceMandateNotificationId}; -use crate::params::{Object, Timestamp}; -use crate::resources::{Source}; -use serde::{Deserialize, Serialize}; - -/// The resource representing a Stripe "SourceMandateNotification". -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct SourceMandateNotification { - /// Unique identifier for the object. - pub id: SourceMandateNotificationId, - - #[serde(skip_serializing_if = "Option::is_none")] - pub acss_debit: Option, - - /// A positive integer in the smallest currency unit (that is, 100 cents for $1.00, or 1 for ¥1, Japanese Yen being a zero-decimal currency) representing the amount associated with the mandate notification. - /// - /// The amount is expressed in the currency of the underlying source. - /// Required if the notification type is `debit_initiated`. - pub amount: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub bacs_debit: Option, - - /// Time at which the object was created. - /// - /// Measured in seconds since the Unix epoch. - pub created: Timestamp, - - /// Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. - pub livemode: bool, - - /// The reason of the mandate notification. - /// - /// Valid reasons are `mandate_confirmed` or `debit_initiated`. - pub reason: String, - - #[serde(skip_serializing_if = "Option::is_none")] - pub sepa_debit: Option, - - pub source: Source, - - /// The status of the mandate notification. - /// - /// Valid statuses are `pending` or `submitted`. - pub status: String, - - /// The type of source this mandate notification is attached to. - /// - /// Should be the source type identifier code for the payment method, such as `three_d_secure`. - #[serde(rename = "type")] - pub type_: String, -} - -impl Object for SourceMandateNotification { - type Id = SourceMandateNotificationId; - fn id(&self) -> Self::Id { - self.id.clone() - } - fn object(&self) -> &'static str { - "source_mandate_notification" - } -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct SourceMandateNotificationAcssDebitData { - - /// The statement descriptor associate with the debit. - #[serde(skip_serializing_if = "Option::is_none")] - pub statement_descriptor: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct SourceMandateNotificationBacsDebitData { - - /// Last 4 digits of the account number associated with the debit. - #[serde(skip_serializing_if = "Option::is_none")] - pub last4: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct SourceMandateNotificationSepaDebitData { - - /// SEPA creditor ID. - #[serde(skip_serializing_if = "Option::is_none")] - pub creditor_identifier: Option, - - /// Last 4 digits of the account number associated with the debit. - #[serde(skip_serializing_if = "Option::is_none")] - pub last4: Option, - - /// Mandate reference associated with the debit. - #[serde(skip_serializing_if = "Option::is_none")] - pub mandate_reference: Option, -} diff --git a/src/resources/generated/source_refund_attributes_required.rs b/src/resources/generated/source_refund_attributes_required.rs deleted file mode 100644 index 5e39dcebf..000000000 --- a/src/resources/generated/source_refund_attributes_required.rs +++ /dev/null @@ -1,10 +0,0 @@ -// ====================================== -// This file was automatically generated. -// ====================================== - -use serde::{Deserialize, Serialize}; - -/// The resource representing a Stripe "source.refund_attributes_required". -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct SourceRefundAttributesRequired { -} diff --git a/src/resources/generated/source_transaction.rs b/src/resources/generated/source_transaction.rs deleted file mode 100644 index 1528d0a27..000000000 --- a/src/resources/generated/source_transaction.rs +++ /dev/null @@ -1,237 +0,0 @@ -// ====================================== -// This file was automatically generated. -// ====================================== - -use crate::ids::{ChargeId}; -use crate::params::{Object, Timestamp}; -use crate::resources::{Currency}; -use serde::{Deserialize, Serialize}; - -/// The resource representing a Stripe "SourceTransaction". -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct SourceTransaction { - /// Unique identifier for the object. - pub id: ChargeId, - - #[serde(skip_serializing_if = "Option::is_none")] - pub ach_credit_transfer: Option, - - /// A positive integer in the smallest currency unit (that is, 100 cents for $1.00, or 1 for ¥1, Japanese Yen being a zero-decimal currency) representing the amount your customer has pushed to the receiver. - pub amount: i64, - - #[serde(skip_serializing_if = "Option::is_none")] - pub chf_credit_transfer: Option, - - /// Time at which the object was created. - /// - /// Measured in seconds since the Unix epoch. - pub created: Timestamp, - - /// Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. - /// - /// Must be a [supported currency](https://stripe.com/docs/currencies). - pub currency: Currency, - - #[serde(skip_serializing_if = "Option::is_none")] - pub gbp_credit_transfer: Option, - - /// Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. - pub livemode: bool, - - #[serde(skip_serializing_if = "Option::is_none")] - pub paper_check: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub sepa_credit_transfer: Option, - - /// The ID of the source this transaction is attached to. - pub source: String, - - /// The status of the transaction, one of `succeeded`, `pending`, or `failed`. - pub status: String, - - /// The type of source this transaction is attached to. - #[serde(rename = "type")] - pub type_: SourceTransactionType, -} - -impl Object for SourceTransaction { - type Id = ChargeId; - fn id(&self) -> Self::Id { - self.id.clone() - } - fn object(&self) -> &'static str { - "source_transaction" - } -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct SourceTransactionAchCreditTransferData { - - /// Customer data associated with the transfer. - #[serde(skip_serializing_if = "Option::is_none")] - pub customer_data: Option, - - /// Bank account fingerprint associated with the transfer. - #[serde(skip_serializing_if = "Option::is_none")] - pub fingerprint: Option, - - /// Last 4 digits of the account number associated with the transfer. - #[serde(skip_serializing_if = "Option::is_none")] - pub last4: Option, - - /// Routing number associated with the transfer. - #[serde(skip_serializing_if = "Option::is_none")] - pub routing_number: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct SourceTransactionChfCreditTransferData { - - /// Reference associated with the transfer. - #[serde(skip_serializing_if = "Option::is_none")] - pub reference: Option, - - /// Sender's country address. - #[serde(skip_serializing_if = "Option::is_none")] - pub sender_address_country: Option, - - /// Sender's line 1 address. - #[serde(skip_serializing_if = "Option::is_none")] - pub sender_address_line1: Option, - - /// Sender's bank account IBAN. - #[serde(skip_serializing_if = "Option::is_none")] - pub sender_iban: Option, - - /// Sender's name. - #[serde(skip_serializing_if = "Option::is_none")] - pub sender_name: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct SourceTransactionGbpCreditTransferData { - - /// Bank account fingerprint associated with the Stripe owned bank account receiving the transfer. - #[serde(skip_serializing_if = "Option::is_none")] - pub fingerprint: Option, - - /// The credit transfer rails the sender used to push this transfer. - /// - /// The possible rails are: Faster Payments, BACS, CHAPS, and wire transfers. - /// Currently only Faster Payments is supported. - #[serde(skip_serializing_if = "Option::is_none")] - pub funding_method: Option, - - /// Last 4 digits of sender account number associated with the transfer. - #[serde(skip_serializing_if = "Option::is_none")] - pub last4: Option, - - /// Sender entered arbitrary information about the transfer. - #[serde(skip_serializing_if = "Option::is_none")] - pub reference: Option, - - /// Sender account number associated with the transfer. - #[serde(skip_serializing_if = "Option::is_none")] - pub sender_account_number: Option, - - /// Sender name associated with the transfer. - #[serde(skip_serializing_if = "Option::is_none")] - pub sender_name: Option, - - /// Sender sort code associated with the transfer. - #[serde(skip_serializing_if = "Option::is_none")] - pub sender_sort_code: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct SourceTransactionPaperCheckData { - - /// Time at which the deposited funds will be available for use. - /// - /// Measured in seconds since the Unix epoch. - #[serde(skip_serializing_if = "Option::is_none")] - pub available_at: Option, - - /// Comma-separated list of invoice IDs associated with the paper check. - #[serde(skip_serializing_if = "Option::is_none")] - pub invoices: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct SourceTransactionSepaCreditTransferData { - - /// Reference associated with the transfer. - #[serde(skip_serializing_if = "Option::is_none")] - pub reference: Option, - - /// Sender's bank account IBAN. - #[serde(skip_serializing_if = "Option::is_none")] - pub sender_iban: Option, - - /// Sender's name. - #[serde(skip_serializing_if = "Option::is_none")] - pub sender_name: Option, -} - -/// An enum representing the possible values of an `SourceTransaction`'s `type` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum SourceTransactionType { - AchCreditTransfer, - AchDebit, - Alipay, - Bancontact, - Card, - CardPresent, - Eps, - Giropay, - Ideal, - Klarna, - Multibanco, - P24, - SepaDebit, - Sofort, - ThreeDSecure, - Wechat, -} - -impl SourceTransactionType { - pub fn as_str(self) -> &'static str { - match self { - SourceTransactionType::AchCreditTransfer => "ach_credit_transfer", - SourceTransactionType::AchDebit => "ach_debit", - SourceTransactionType::Alipay => "alipay", - SourceTransactionType::Bancontact => "bancontact", - SourceTransactionType::Card => "card", - SourceTransactionType::CardPresent => "card_present", - SourceTransactionType::Eps => "eps", - SourceTransactionType::Giropay => "giropay", - SourceTransactionType::Ideal => "ideal", - SourceTransactionType::Klarna => "klarna", - SourceTransactionType::Multibanco => "multibanco", - SourceTransactionType::P24 => "p24", - SourceTransactionType::SepaDebit => "sepa_debit", - SourceTransactionType::Sofort => "sofort", - SourceTransactionType::ThreeDSecure => "three_d_secure", - SourceTransactionType::Wechat => "wechat", - } - } -} - -impl AsRef for SourceTransactionType { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for SourceTransactionType { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for SourceTransactionType { - fn default() -> Self { - Self::AchCreditTransfer - } -} diff --git a/src/resources/generated/source_transaction_created.rs b/src/resources/generated/source_transaction_created.rs deleted file mode 100644 index 8c9d947c4..000000000 --- a/src/resources/generated/source_transaction_created.rs +++ /dev/null @@ -1,10 +0,0 @@ -// ====================================== -// This file was automatically generated. -// ====================================== - -use serde::{Deserialize, Serialize}; - -/// The resource representing a Stripe "source.transaction.created". -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct SourceTransactionCreated { -} diff --git a/src/resources/generated/source_transaction_updated.rs b/src/resources/generated/source_transaction_updated.rs deleted file mode 100644 index b84350796..000000000 --- a/src/resources/generated/source_transaction_updated.rs +++ /dev/null @@ -1,10 +0,0 @@ -// ====================================== -// This file was automatically generated. -// ====================================== - -use serde::{Deserialize, Serialize}; - -/// The resource representing a Stripe "source.transaction.updated". -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct SourceTransactionUpdated { -} diff --git a/src/resources/generated/subscription.rs b/src/resources/generated/subscription.rs deleted file mode 100644 index a65328e78..000000000 --- a/src/resources/generated/subscription.rs +++ /dev/null @@ -1,3872 +0,0 @@ -// ====================================== -// This file was automatically generated. -// ====================================== - -use serde::{Deserialize, Serialize}; - -use crate::client::{Client, Response}; -use crate::ids::{CouponId, CustomerId, PlanId, PriceId, PromotionCodeId, SubscriptionId}; -use crate::params::{ - Deleted, Expand, Expandable, List, Metadata, Object, Paginable, RangeQuery, Timestamp, -}; -use crate::resources::{ - Account, Application, CollectionMethod, ConnectAccountReference, Currency, Customer, Discount, - Invoice, InvoicePaymentMethodOptionsAcssDebit, InvoicePaymentMethodOptionsBancontact, - InvoicePaymentMethodOptionsCustomerBalance, InvoicePaymentMethodOptionsKonbini, - InvoicePaymentMethodOptionsUsBankAccount, PaymentMethod, PaymentSource, Scheduled, SetupIntent, - SubscriptionBillingThresholds, SubscriptionItem, SubscriptionItemBillingThresholds, - SubscriptionSchedule, SubscriptionTransferData, SubscriptionsTrialsResourceTrialSettings, - TaxRate, TestHelpersTestClock, -}; - -/// The resource representing a Stripe "Subscription". -/// -/// For more details see -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct Subscription { - /// Unique identifier for the object. - pub id: SubscriptionId, - - /// ID of the Connect Application that created the subscription. - pub application: Option>, - - /// A non-negative decimal between 0 and 100, with at most two decimal places. - /// - /// This represents the percentage of the subscription invoice total that will be transferred to the application owner's Stripe account. - pub application_fee_percent: Option, - - pub automatic_tax: SubscriptionAutomaticTax, - - /// The reference point that aligns future [billing cycle](https://stripe.com/docs/subscriptions/billing-cycle) dates. - /// - /// It sets the day of week for `week` intervals, the day of month for `month` and `year` intervals, and the month of year for `year` intervals. - /// The timestamp is in UTC format. - pub billing_cycle_anchor: Timestamp, - - /// The fixed values used to calculate the `billing_cycle_anchor`. - pub billing_cycle_anchor_config: Option, - - /// Define thresholds at which an invoice will be sent, and the subscription advanced to a new billing period. - pub billing_thresholds: Option, - - /// A date in the future at which the subscription will automatically get canceled. - pub cancel_at: Option, - - /// If the subscription has been canceled with the `at_period_end` flag set to `true`, `cancel_at_period_end` on the subscription will be true. - /// - /// You can use this attribute to determine whether a subscription that has a status of active is scheduled to be canceled at the end of the current period. - pub cancel_at_period_end: bool, - - /// If the subscription has been canceled, the date of that cancellation. - /// - /// If the subscription was canceled with `cancel_at_period_end`, `canceled_at` will reflect the time of the most recent update request, not the end of the subscription period when the subscription is automatically moved to a canceled state. - pub canceled_at: Option, - - /// Details about why this subscription was cancelled. - pub cancellation_details: Option, - - /// Either `charge_automatically`, or `send_invoice`. - /// - /// When charging automatically, Stripe will attempt to pay this subscription at the end of the cycle using the default source attached to the customer. - /// When sending an invoice, Stripe will email your customer an invoice with payment instructions and mark the subscription as `active`. - pub collection_method: Option, - - /// Time at which the object was created. - /// - /// Measured in seconds since the Unix epoch. - pub created: Timestamp, - - /// Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. - /// - /// Must be a [supported currency](https://stripe.com/docs/currencies). - pub currency: Currency, - - /// End of the current period that the subscription has been invoiced for. - /// - /// At the end of this period, a new invoice will be created. - pub current_period_end: Timestamp, - - /// Start of the current period that the subscription has been invoiced for. - pub current_period_start: Timestamp, - - /// ID of the customer who owns the subscription. - pub customer: Expandable, - - /// Number of days a customer has to pay invoices generated by this subscription. - /// - /// This value will be `null` for subscriptions where `collection_method=charge_automatically`. - pub days_until_due: Option, - - /// ID of the default payment method for the subscription. - /// - /// It must belong to the customer associated with the subscription. - /// This takes precedence over `default_source`. - /// If neither are set, invoices will use the customer's [invoice_settings.default_payment_method](https://stripe.com/docs/api/customers/object#customer_object-invoice_settings-default_payment_method) or [default_source](https://stripe.com/docs/api/customers/object#customer_object-default_source). - pub default_payment_method: Option>, - - /// ID of the default payment source for the subscription. - /// - /// It must belong to the customer associated with the subscription and be in a chargeable state. - /// If `default_payment_method` is also set, `default_payment_method` will take precedence. - /// If neither are set, invoices will use the customer's [invoice_settings.default_payment_method](https://stripe.com/docs/api/customers/object#customer_object-invoice_settings-default_payment_method) or [default_source](https://stripe.com/docs/api/customers/object#customer_object-default_source). - pub default_source: Option>, - - /// The tax rates that will apply to any subscription item that does not have `tax_rates` set. - /// - /// Invoices created will have their `default_tax_rates` populated from the subscription. - #[serde(skip_serializing_if = "Option::is_none")] - pub default_tax_rates: Option>, - - /// The subscription's description, meant to be displayable to the customer. - /// - /// Use this field to optionally store an explanation of the subscription for rendering in Stripe surfaces and certain local payment methods UIs. - pub description: Option, - - /// Describes the current discount applied to this subscription, if there is one. - /// - /// When billing, a discount applied to a subscription overrides a discount applied on a customer-wide basis. - pub discount: Option, - - /// If the subscription has ended, the date the subscription ended. - pub ended_at: Option, - - /// List of subscription items, each with an attached price. - pub items: List, - - /// The most recent invoice this subscription has generated. - pub latest_invoice: Option>, - - /// Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. - pub livemode: bool, - - /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. - /// - /// This can be useful for storing additional information about the object in a structured format. - pub metadata: Metadata, - - /// Specifies the approximate timestamp on which any pending invoice items will be billed according to the schedule provided at `pending_invoice_item_interval`. - pub next_pending_invoice_item_invoice: Option, - - /// The account (if any) the charge was made on behalf of for charges associated with this subscription. - /// - /// See the Connect documentation for details. - pub on_behalf_of: Option>, - - /// If specified, payment collection for this subscription will be paused. - pub pause_collection: Option, - - /// Payment settings passed on to invoices created by the subscription. - pub payment_settings: Option, - - /// Specifies an interval for how often to bill for any pending invoice items. - /// - /// It is analogous to calling [Create an invoice](https://stripe.com/docs/api#create_invoice) for the given subscription at the specified interval. - pub pending_invoice_item_interval: Option, - - /// You can use this [SetupIntent](https://stripe.com/docs/api/setup_intents) to collect user authentication when creating a subscription without immediate payment or updating a subscription's payment method, allowing you to optimize for off-session payments. - /// - /// Learn more in the [SCA Migration Guide](https://stripe.com/docs/billing/migration/strong-customer-authentication#scenario-2). - pub pending_setup_intent: Option>, - - /// If specified, [pending updates](https://stripe.com/docs/billing/subscriptions/pending-updates) that will be applied to the subscription once the `latest_invoice` has been paid. - pub pending_update: Option, - - /// The schedule attached to the subscription. - pub schedule: Option>, - - /// Date when the subscription was first created. - /// - /// The date might differ from the `created` date due to backdating. - pub start_date: Timestamp, - - /// Possible values are `incomplete`, `incomplete_expired`, `trialing`, `active`, `past_due`, `canceled`, or `unpaid`. - /// - /// For `collection_method=charge_automatically` a subscription moves into `incomplete` if the initial payment attempt fails. - /// A subscription in this state can only have metadata and default_source updated. - /// Once the first invoice is paid, the subscription moves into an `active` state. - /// If the first invoice is not paid within 23 hours, the subscription transitions to `incomplete_expired`. - /// This is a terminal state, the open invoice will be voided and no further invoices will be generated. - /// A subscription that is currently in a trial period is `trialing` and moves to `active` when the trial period is over. - /// If subscription `collection_method=charge_automatically`, it becomes `past_due` when payment is required but cannot be paid (due to failed payment or awaiting additional user actions). - /// Once Stripe has exhausted all payment retry attempts, the subscription will become `canceled` or `unpaid` (depending on your subscriptions settings). - /// If subscription `collection_method=send_invoice` it becomes `past_due` when its invoice is not paid by the due date, and `canceled` or `unpaid` if it is still not paid by an additional deadline after that. - /// Note that when a subscription has a status of `unpaid`, no subsequent invoices will be attempted (invoices will be created, but then immediately automatically closed). - /// After receiving updated payment information from a customer, you may choose to reopen and pay their closed invoices. - pub status: SubscriptionStatus, - - /// ID of the test clock this subscription belongs to. - pub test_clock: Option>, - - /// The account (if any) the subscription's payments will be attributed to for tax reporting, and where funds from each payment will be transferred to for each of the subscription's invoices. - pub transfer_data: Option, - - /// If the subscription has a trial, the end of that trial. - pub trial_end: Option, - - /// Settings related to subscription trials. - pub trial_settings: Option, - - /// If the subscription has a trial, the beginning of that trial. - pub trial_start: Option, -} - -impl Subscription { - /// By default, returns a list of subscriptions that have not been canceled. - /// - /// In order to list canceled subscriptions, specify `status=canceled`. - pub fn list(client: &Client, params: &ListSubscriptions<'_>) -> Response> { - client.get_query("/subscriptions", ¶ms) - } - - /// Creates a new subscription on an existing customer. - /// - /// Each customer can have up to 500 active or scheduled subscriptions. When you create a subscription with `collection_method=charge_automatically`, the first invoice is finalized as part of the request. The `payment_behavior` parameter determines the exact behavior of the initial payment. To start subscriptions where the first invoice always begins in a `draft` status, use [subscription schedules](https://stripe.com/docs/billing/subscriptions/subscription-schedules#managing) instead. Schedules provide the flexibility to model more complex billing configurations that change over time. - pub fn create(client: &Client, params: CreateSubscription<'_>) -> Response { - client.post_form("/subscriptions", ¶ms) - } - - /// Retrieves the subscription with the given ID. - pub fn retrieve( - client: &Client, - id: &SubscriptionId, - expand: &[&str], - ) -> Response { - client.get_query(&format!("/subscriptions/{}", id), &Expand { expand }) - } - - /// Updates an existing subscription to match the specified parameters. - /// When changing prices or quantities, we optionally prorate the price we charge next month to make up for any price changes. - /// To preview how the proration is calculated, use the [upcoming invoice](https://stripe.com/docs/api/invoices/upcoming) endpoint. - /// - /// By default, we prorate subscription changes. - /// - /// For example, if a customer signs up on May 1 for a $100 price, they’ll be billed $100 immediately. - /// If on May 15 they switch to a $200 price, then on June 1 they’ll be billed $250 ($200 for a renewal of her subscription, plus a $50 prorating adjustment for half of the previous month’s $100 difference). - /// Similarly, a downgrade generates a credit that is applied to the next invoice. - /// We also prorate when you make quantity changes. Switching prices does not normally change the billing date or generate an immediate charge unless:
  • The billing interval is changed (for example, from monthly to yearly).
  • The subscription moves from free to paid, or paid to free.
  • A trial starts or ends.
In these cases, we apply a credit for the unused time on the previous price, immediately charge the customer using the new price, and reset the billing date. If you want to charge for an upgrade immediately, pass `proration_behavior` as `always_invoice` to create prorations, automatically invoice the customer for those proration adjustments, and attempt to collect payment. - /// If you pass `create_prorations`, the prorations are created but not automatically invoiced. - /// If you want to bill the customer for the prorations before the subscription’s renewal date, you need to manually [invoice the customer](https://stripe.com/docs/api/invoices/create). If you don’t want to prorate, set the `proration_behavior` option to `none`. - /// With this option, the customer is billed $100 on May 1 and $200 on June 1. - /// Similarly, if you set `proration_behavior` to `none` when switching between different billing intervals (for example, from monthly to yearly), we don’t generate any credits for the old subscription’s unused time. - /// We still reset the billing date and bill immediately for the new subscription. Updating the quantity on a subscription many times in an hour may result in [rate limiting](https://stripe.com/docs/rate-limits). - /// If you need to bill for a frequently changing quantity, consider integrating [usage-based billing](https://stripe.com/docs/billing/subscriptions/usage-based) instead. - pub fn update( - client: &Client, - id: &SubscriptionId, - params: UpdateSubscription<'_>, - ) -> Response { - client.post_form(&format!("/subscriptions/{}", id), ¶ms) - } - - /// Cancels a customer’s subscription immediately. - /// - /// The customer will not be charged again for the subscription. Note, however, that any pending invoice items that you’ve created will still be charged for at the end of the period, unless manually [deleted](https://stripe.com/docs/api#delete_invoiceitem). - /// If you’ve set the subscription to cancel at the end of the period, any pending prorations will also be left in place and collected at the end of the period. - /// But if the subscription is set to cancel immediately, pending prorations will be removed. By default, upon subscription cancellation, Stripe will stop automatic collection of all finalized invoices for the customer. - /// This is intended to prevent unexpected payment attempts after the customer has canceled a subscription. - /// However, you can resume automatic collection of the invoices manually after subscription cancellation to have us proceed. - /// Or, you could check for unpaid invoices before allowing the customer to cancel the subscription at all. - pub fn delete(client: &Client, id: &SubscriptionId) -> Response> { - client.delete(&format!("/subscriptions/{}", id)) - } -} - -impl Object for Subscription { - type Id = SubscriptionId; - fn id(&self) -> Self::Id { - self.id.clone() - } - fn object(&self) -> &'static str { - "subscription" - } -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CancellationDetails { - /// Additional comments about why the user canceled the subscription, if the subscription was canceled explicitly by the user. - pub comment: Option, - - /// The customer submitted reason for why they canceled, if the subscription was canceled explicitly by the user. - pub feedback: Option, - - /// Why this subscription was canceled. - pub reason: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct SubscriptionAutomaticTax { - /// Whether Stripe automatically computes tax on this subscription. - pub enabled: bool, - - /// The account that's liable for tax. - /// - /// If set, the business address and tax registrations required to perform the tax calculation are loaded from this account. - /// The tax transaction is returned in the report of the connected account. - pub liability: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct SubscriptionPendingInvoiceItemInterval { - /// Specifies invoicing frequency. - /// - /// Either `day`, `week`, `month` or `year`. - pub interval: PlanInterval, - - /// The number of intervals between invoices. - /// - /// For example, `interval=month` and `interval_count=3` bills every 3 months. - /// Maximum of one year interval allowed (1 year, 12 months, or 52 weeks). - pub interval_count: u64, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct SubscriptionsResourceBillingCycleAnchorConfig { - /// The day of the month of the billing_cycle_anchor. - pub day_of_month: i64, - - /// The hour of the day of the billing_cycle_anchor. - pub hour: Option, - - /// The minute of the hour of the billing_cycle_anchor. - pub minute: Option, - - /// The month to start full cycle billing periods. - pub month: Option, - - /// The second of the minute of the billing_cycle_anchor. - pub second: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct SubscriptionsResourcePauseCollection { - /// The payment collection behavior for this subscription while paused. - /// - /// One of `keep_as_draft`, `mark_uncollectible`, or `void`. - pub behavior: SubscriptionsResourcePauseCollectionBehavior, - - /// The time after which the subscription will resume collecting payments. - pub resumes_at: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct SubscriptionsResourcePaymentSettings { - /// Payment-method-specific configuration to provide to invoices created by the subscription. - pub payment_method_options: Option, - - /// The list of payment method types to provide to every invoice created by the subscription. - /// - /// If not set, Stripe attempts to automatically determine the types to use by looking at the invoice’s default payment method, the subscription’s default payment method, the customer’s default payment method, and your [invoice template settings](https://dashboard.stripe.com/settings/billing/invoice). - pub payment_method_types: Option>, - - /// Either `off`, or `on_subscription`. - /// - /// With `on_subscription` Stripe updates `subscription.default_payment_method` when a subscription payment succeeds. - pub save_default_payment_method: - Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct SubscriptionsResourcePaymentMethodOptions { - /// This sub-hash contains details about the Canadian pre-authorized debit payment method options to pass to invoices created by the subscription. - pub acss_debit: Option, - - /// This sub-hash contains details about the Bancontact payment method options to pass to invoices created by the subscription. - pub bancontact: Option, - - /// This sub-hash contains details about the Card payment method options to pass to invoices created by the subscription. - pub card: Option, - - /// This sub-hash contains details about the Bank transfer payment method options to pass to invoices created by the subscription. - pub customer_balance: Option, - - /// This sub-hash contains details about the Konbini payment method options to pass to invoices created by the subscription. - pub konbini: Option, - - /// This sub-hash contains details about the ACH direct debit payment method options to pass to invoices created by the subscription. - pub us_bank_account: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct SubscriptionPaymentMethodOptionsCard { - #[serde(skip_serializing_if = "Option::is_none")] - pub mandate_options: Option, - - /// Selected network to process this Subscription on. - /// - /// Depends on the available networks of the card attached to the Subscription. - /// Can be only set confirm-time. - pub network: Option, - - /// We strongly recommend that you rely on our SCA Engine to automatically prompt your customers for authentication based on risk level and [other requirements](https://stripe.com/docs/strong-customer-authentication). - /// - /// However, if you wish to request 3D Secure based on logic from your own fraud engine, provide this option. - /// Read our guide on [manually requesting 3D Secure](https://stripe.com/docs/payments/3d-secure#manual-three-ds) for more information on how this configuration interacts with Radar and our SCA Engine. - pub request_three_d_secure: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct InvoiceMandateOptionsCard { - /// Amount to be charged for future payments. - pub amount: Option, - - /// One of `fixed` or `maximum`. - /// - /// If `fixed`, the `amount` param refers to the exact amount to be charged in future payments. - /// If `maximum`, the amount charged can be up to the value passed for the `amount` param. - pub amount_type: Option, - - /// A description of the mandate or subscription that is meant to be displayed to the customer. - pub description: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct SubscriptionsResourcePendingUpdate { - /// If the update is applied, determines the date of the first full invoice, and, for plans with `month` or `year` intervals, the day of the month for subsequent invoices. - /// - /// The timestamp is in UTC format. - pub billing_cycle_anchor: Option, - - /// The point after which the changes reflected by this update will be discarded and no longer applied. - pub expires_at: Timestamp, - - /// List of subscription items, each with an attached plan, that will be set if the update is applied. - pub subscription_items: Option>, - - /// Unix timestamp representing the end of the trial period the customer will get before being charged for the first time, if the update is applied. - pub trial_end: Option, - - /// Indicates if a plan's `trial_period_days` should be applied to the subscription. - /// - /// Setting `trial_end` per subscription is preferred, and this defaults to `false`. - /// Setting this flag to `true` together with `trial_end` is not allowed. - /// See [Using trial periods on subscriptions](https://stripe.com/docs/billing/subscriptions/trials) to learn more. - pub trial_from_plan: Option, -} - -/// The parameters for `Subscription::create`. -#[derive(Clone, Debug, Serialize)] -pub struct CreateSubscription<'a> { - /// A list of prices and quantities that will generate invoice items appended to the next invoice for this subscription. - /// - /// You may pass up to 20 items. - #[serde(skip_serializing_if = "Option::is_none")] - pub add_invoice_items: Option>, - - /// A non-negative decimal between 0 and 100, with at most two decimal places. - /// - /// This represents the percentage of the subscription invoice total that will be transferred to the application owner's Stripe account. - /// The request must be made by a platform account on a connected account in order to set an application fee percentage. - /// For more information, see the application fees [documentation](https://stripe.com/docs/connect/subscriptions#collecting-fees-on-subscriptions). - #[serde(skip_serializing_if = "Option::is_none")] - pub application_fee_percent: Option, - - /// Automatic tax settings for this subscription. - /// - /// We recommend you only include this parameter when the existing value is being changed. - #[serde(skip_serializing_if = "Option::is_none")] - pub automatic_tax: Option, - - /// For new subscriptions, a past timestamp to backdate the subscription's start date to. - /// - /// If set, the first invoice will contain a proration for the timespan between the start date and the current time. - /// Can be combined with trials and the billing cycle anchor. - #[serde(skip_serializing_if = "Option::is_none")] - pub backdate_start_date: Option, - - /// A future timestamp in UTC format to anchor the subscription's [billing cycle](https://stripe.com/docs/subscriptions/billing-cycle). - /// - /// The anchor is the reference point that aligns future billing cycle dates. - /// It sets the day of week for `week` intervals, the day of month for `month` and `year` intervals, and the month of year for `year` intervals. - #[serde(skip_serializing_if = "Option::is_none")] - pub billing_cycle_anchor: Option, - - /// Mutually exclusive with billing_cycle_anchor and only valid with monthly and yearly price intervals. - /// - /// When provided, the billing_cycle_anchor is set to the next occurence of the day_of_month at the hour, minute, and second UTC. - #[serde(skip_serializing_if = "Option::is_none")] - pub billing_cycle_anchor_config: Option, - - /// Define thresholds at which an invoice will be sent, and the subscription advanced to a new billing period. - /// - /// Pass an empty string to remove previously-defined thresholds. - #[serde(skip_serializing_if = "Option::is_none")] - pub billing_thresholds: Option, - - /// A timestamp at which the subscription should cancel. - /// - /// If set to a date before the current period ends, this will cause a proration if prorations have been enabled using `proration_behavior`. - /// If set during a future period, this will always cause a proration for that period. - #[serde(skip_serializing_if = "Option::is_none")] - pub cancel_at: Option, - - /// Boolean indicating whether this subscription should cancel at the end of the current period. - #[serde(skip_serializing_if = "Option::is_none")] - pub cancel_at_period_end: Option, - - /// Either `charge_automatically`, or `send_invoice`. - /// - /// When charging automatically, Stripe will attempt to pay this subscription at the end of the cycle using the default source attached to the customer. - /// When sending an invoice, Stripe will email your customer an invoice with payment instructions and mark the subscription as `active`. - /// Defaults to `charge_automatically`. - #[serde(skip_serializing_if = "Option::is_none")] - pub collection_method: Option, - - /// The ID of the coupon to apply to this subscription. - /// - /// A coupon applied to a subscription will only affect invoices created for that particular subscription. - #[serde(skip_serializing_if = "Option::is_none")] - pub coupon: Option, - - /// Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. - /// - /// Must be a [supported currency](https://stripe.com/docs/currencies). - #[serde(skip_serializing_if = "Option::is_none")] - pub currency: Option, - - /// The identifier of the customer to subscribe. - pub customer: CustomerId, - - /// Number of days a customer has to pay invoices generated by this subscription. - /// - /// Valid only for subscriptions where `collection_method` is set to `send_invoice`. - #[serde(skip_serializing_if = "Option::is_none")] - pub days_until_due: Option, - - /// ID of the default payment method for the subscription. - /// - /// It must belong to the customer associated with the subscription. - /// This takes precedence over `default_source`. - /// If neither are set, invoices will use the customer's [invoice_settings.default_payment_method](https://stripe.com/docs/api/customers/object#customer_object-invoice_settings-default_payment_method) or [default_source](https://stripe.com/docs/api/customers/object#customer_object-default_source). - #[serde(skip_serializing_if = "Option::is_none")] - pub default_payment_method: Option<&'a str>, - - /// ID of the default payment source for the subscription. - /// - /// It must belong to the customer associated with the subscription and be in a chargeable state. - /// If `default_payment_method` is also set, `default_payment_method` will take precedence. - /// If neither are set, invoices will use the customer's [invoice_settings.default_payment_method](https://stripe.com/docs/api/customers/object#customer_object-invoice_settings-default_payment_method) or [default_source](https://stripe.com/docs/api/customers/object#customer_object-default_source). - #[serde(skip_serializing_if = "Option::is_none")] - pub default_source: Option<&'a str>, - - /// The tax rates that will apply to any subscription item that does not have `tax_rates` set. - /// - /// Invoices created will have their `default_tax_rates` populated from the subscription. - #[serde(skip_serializing_if = "Option::is_none")] - pub default_tax_rates: Option>, - - /// The subscription's description, meant to be displayable to the customer. - /// - /// Use this field to optionally store an explanation of the subscription for rendering in Stripe surfaces and certain local payment methods UIs. - #[serde(skip_serializing_if = "Option::is_none")] - pub description: Option<&'a str>, - - /// Specifies which fields in the response should be expanded. - #[serde(skip_serializing_if = "Expand::is_empty")] - pub expand: &'a [&'a str], - - /// All invoices will be billed using the specified settings. - #[serde(skip_serializing_if = "Option::is_none")] - pub invoice_settings: Option, - - /// A list of up to 20 subscription items, each with an attached price. - #[serde(skip_serializing_if = "Option::is_none")] - pub items: Option>, - - /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. - /// - /// This can be useful for storing additional information about the object in a structured format. - /// Individual keys can be unset by posting an empty value to them. - /// All keys can be unset by posting an empty value to `metadata`. - #[serde(skip_serializing_if = "Option::is_none")] - pub metadata: Option, - - /// Indicates if a customer is on or off-session while an invoice payment is attempted. - #[serde(skip_serializing_if = "Option::is_none")] - pub off_session: Option, - - /// The account on behalf of which to charge, for each of the subscription's invoices. - #[serde(skip_serializing_if = "Option::is_none")] - pub on_behalf_of: Option, - - /// Only applies to subscriptions with `collection_method=charge_automatically`. - /// - /// Use `allow_incomplete` to create subscriptions with `status=incomplete` if the first invoice cannot be paid. - /// - /// Creating subscriptions with this status allows you to manage scenarios where additional user actions are needed to pay a subscription's invoice. - /// For example, SCA regulation may require 3DS authentication to complete payment. - /// See the [SCA Migration Guide](https://stripe.com/docs/billing/migration/strong-customer-authentication) for Billing to learn more. - /// This is the default behavior. Use `default_incomplete` to create Subscriptions with `status=incomplete` when the first invoice requires payment, otherwise start as active. - /// Subscriptions transition to `status=active` when successfully confirming the payment intent on the first invoice. - /// This allows simpler management of scenarios where additional user actions are needed to pay a subscription’s invoice. - /// Such as failed payments, [SCA regulation](https://stripe.com/docs/billing/migration/strong-customer-authentication), or collecting a mandate for a bank debit payment method. - /// If the payment intent is not confirmed within 23 hours subscriptions transition to `status=incomplete_expired`, which is a terminal state. Use `error_if_incomplete` if you want Stripe to return an HTTP 402 status code if a subscription's first invoice cannot be paid. - /// For example, if a payment method requires 3DS authentication due to SCA regulation and further user action is needed, this parameter does not create a subscription and returns an error instead. - /// This was the default behavior for API versions prior to 2019-03-14. - /// See the [changelog](https://stripe.com/docs/upgrades#2019-03-14) to learn more. `pending_if_incomplete` is only used with updates and cannot be passed when creating a subscription. Subscriptions with `collection_method=send_invoice` are automatically activated regardless of the first invoice status. - #[serde(skip_serializing_if = "Option::is_none")] - pub payment_behavior: Option, - - /// Payment settings to pass to invoices created by the subscription. - #[serde(skip_serializing_if = "Option::is_none")] - pub payment_settings: Option, - - /// Specifies an interval for how often to bill for any pending invoice items. - /// - /// It is analogous to calling [Create an invoice](https://stripe.com/docs/api#create_invoice) for the given subscription at the specified interval. - #[serde(skip_serializing_if = "Option::is_none")] - pub pending_invoice_item_interval: Option, - - /// The API ID of a promotion code to apply to this subscription. - /// - /// A promotion code applied to a subscription will only affect invoices created for that particular subscription. - #[serde(skip_serializing_if = "Option::is_none")] - pub promotion_code: Option, - - /// Determines how to handle [prorations](https://stripe.com/docs/subscriptions/billing-cycle#prorations) resulting from the `billing_cycle_anchor`. - /// - /// If no value is passed, the default is `create_prorations`. - #[serde(skip_serializing_if = "Option::is_none")] - pub proration_behavior: Option, - - /// If specified, the funds from the subscription's invoices will be transferred to the destination and the ID of the resulting transfers will be found on the resulting charges. - #[serde(skip_serializing_if = "Option::is_none")] - pub transfer_data: Option, - - /// Unix timestamp representing the end of the trial period the customer will get before being charged for the first time. - /// - /// If set, trial_end will override the default trial period of the plan the customer is being subscribed to. - /// The special value `now` can be provided to end the customer's trial immediately. - /// Can be at most two years from `billing_cycle_anchor`. - /// See [Using trial periods on subscriptions](https://stripe.com/docs/billing/subscriptions/trials) to learn more. - #[serde(skip_serializing_if = "Option::is_none")] - pub trial_end: Option, - - /// Indicates if a plan's `trial_period_days` should be applied to the subscription. - /// - /// Setting `trial_end` per subscription is preferred, and this defaults to `false`. - /// Setting this flag to `true` together with `trial_end` is not allowed. - /// See [Using trial periods on subscriptions](https://stripe.com/docs/billing/subscriptions/trials) to learn more. - #[serde(skip_serializing_if = "Option::is_none")] - pub trial_from_plan: Option, - - /// Integer representing the number of trial period days before the customer is charged for the first time. - /// - /// This will always overwrite any trials that might apply via a subscribed plan. - /// See [Using trial periods on subscriptions](https://stripe.com/docs/billing/subscriptions/trials) to learn more. - #[serde(skip_serializing_if = "Option::is_none")] - pub trial_period_days: Option, - - /// Settings related to subscription trials. - #[serde(skip_serializing_if = "Option::is_none")] - pub trial_settings: Option, -} - -impl<'a> CreateSubscription<'a> { - pub fn new(customer: CustomerId) -> Self { - CreateSubscription { - add_invoice_items: Default::default(), - application_fee_percent: Default::default(), - automatic_tax: Default::default(), - backdate_start_date: Default::default(), - billing_cycle_anchor: Default::default(), - billing_cycle_anchor_config: Default::default(), - billing_thresholds: Default::default(), - cancel_at: Default::default(), - cancel_at_period_end: Default::default(), - collection_method: Default::default(), - coupon: Default::default(), - currency: Default::default(), - customer, - days_until_due: Default::default(), - default_payment_method: Default::default(), - default_source: Default::default(), - default_tax_rates: Default::default(), - description: Default::default(), - expand: Default::default(), - invoice_settings: Default::default(), - items: Default::default(), - metadata: Default::default(), - off_session: Default::default(), - on_behalf_of: Default::default(), - payment_behavior: Default::default(), - payment_settings: Default::default(), - pending_invoice_item_interval: Default::default(), - promotion_code: Default::default(), - proration_behavior: Default::default(), - transfer_data: Default::default(), - trial_end: Default::default(), - trial_from_plan: Default::default(), - trial_period_days: Default::default(), - trial_settings: Default::default(), - } - } -} - -/// The parameters for `Subscription::list`. -#[derive(Clone, Debug, Serialize, Default)] -pub struct ListSubscriptions<'a> { - /// Filter subscriptions by their automatic tax settings. - #[serde(skip_serializing_if = "Option::is_none")] - pub automatic_tax: Option, - - /// The collection method of the subscriptions to retrieve. - /// - /// Either `charge_automatically` or `send_invoice`. - #[serde(skip_serializing_if = "Option::is_none")] - pub collection_method: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub created: Option>, - - #[serde(skip_serializing_if = "Option::is_none")] - pub current_period_end: Option>, - - #[serde(skip_serializing_if = "Option::is_none")] - pub current_period_start: Option>, - - /// The ID of the customer whose subscriptions will be retrieved. - #[serde(skip_serializing_if = "Option::is_none")] - pub customer: Option, - - /// A cursor for use in pagination. - /// - /// `ending_before` is an object ID that defines your place in the list. - /// For instance, if you make a list request and receive 100 objects, starting with `obj_bar`, your subsequent call can include `ending_before=obj_bar` in order to fetch the previous page of the list. - #[serde(skip_serializing_if = "Option::is_none")] - pub ending_before: Option, - - /// Specifies which fields in the response should be expanded. - #[serde(skip_serializing_if = "Expand::is_empty")] - pub expand: &'a [&'a str], - - /// A limit on the number of objects to be returned. - /// - /// Limit can range between 1 and 100, and the default is 10. - #[serde(skip_serializing_if = "Option::is_none")] - pub limit: Option, - - /// The ID of the plan whose subscriptions will be retrieved. - #[serde(skip_serializing_if = "Option::is_none")] - pub plan: Option, - - /// Filter for subscriptions that contain this recurring price ID. - #[serde(skip_serializing_if = "Option::is_none")] - pub price: Option, - - /// A cursor for use in pagination. - /// - /// `starting_after` is an object ID that defines your place in the list. - /// For instance, if you make a list request and receive 100 objects, ending with `obj_foo`, your subsequent call can include `starting_after=obj_foo` in order to fetch the next page of the list. - #[serde(skip_serializing_if = "Option::is_none")] - pub starting_after: Option, - - /// The status of the subscriptions to retrieve. - /// - /// Passing in a value of `canceled` will return all canceled subscriptions, including those belonging to deleted customers. - /// Pass `ended` to find subscriptions that are canceled and subscriptions that are expired due to [incomplete payment](https://stripe.com/docs/billing/subscriptions/overview#subscription-statuses). - /// Passing in a value of `all` will return subscriptions of all statuses. - /// If no value is supplied, all subscriptions that have not been canceled are returned. - #[serde(skip_serializing_if = "Option::is_none")] - pub status: Option, - - /// Filter for subscriptions that are associated with the specified test clock. - /// - /// The response will not include subscriptions with test clocks if this and the customer parameter is not set. - #[serde(skip_serializing_if = "Option::is_none")] - pub test_clock: Option<&'a str>, -} - -impl<'a> ListSubscriptions<'a> { - pub fn new() -> Self { - ListSubscriptions { - automatic_tax: Default::default(), - collection_method: Default::default(), - created: Default::default(), - current_period_end: Default::default(), - current_period_start: Default::default(), - customer: Default::default(), - ending_before: Default::default(), - expand: Default::default(), - limit: Default::default(), - plan: Default::default(), - price: Default::default(), - starting_after: Default::default(), - status: Default::default(), - test_clock: Default::default(), - } - } -} -impl Paginable for ListSubscriptions<'_> { - type O = Subscription; - fn set_last(&mut self, item: Self::O) { - self.starting_after = Some(item.id()); - } -} -/// The parameters for `Subscription::update`. -#[derive(Clone, Debug, Serialize, Default)] -pub struct UpdateSubscription<'a> { - /// A list of prices and quantities that will generate invoice items appended to the next invoice for this subscription. - /// - /// You may pass up to 20 items. - #[serde(skip_serializing_if = "Option::is_none")] - pub add_invoice_items: Option>, - - /// A non-negative decimal between 0 and 100, with at most two decimal places. - /// - /// This represents the percentage of the subscription invoice total that will be transferred to the application owner's Stripe account. - /// The request must be made by a platform account on a connected account in order to set an application fee percentage. - /// For more information, see the application fees [documentation](https://stripe.com/docs/connect/subscriptions#collecting-fees-on-subscriptions). - #[serde(skip_serializing_if = "Option::is_none")] - pub application_fee_percent: Option, - - /// Automatic tax settings for this subscription. - /// - /// We recommend you only include this parameter when the existing value is being changed. - #[serde(skip_serializing_if = "Option::is_none")] - pub automatic_tax: Option, - - /// Either `now` or `unchanged`. - /// - /// Setting the value to `now` resets the subscription's billing cycle anchor to the current time (in UTC). - /// For more information, see the billing cycle [documentation](https://stripe.com/docs/billing/subscriptions/billing-cycle). - #[serde(skip_serializing_if = "Option::is_none")] - pub billing_cycle_anchor: Option, - - /// Define thresholds at which an invoice will be sent, and the subscription advanced to a new billing period. - /// - /// Pass an empty string to remove previously-defined thresholds. - #[serde(skip_serializing_if = "Option::is_none")] - pub billing_thresholds: Option, - - /// A timestamp at which the subscription should cancel. - /// - /// If set to a date before the current period ends, this will cause a proration if prorations have been enabled using `proration_behavior`. - /// If set during a future period, this will always cause a proration for that period. - #[serde(skip_serializing_if = "Option::is_none")] - pub cancel_at: Option, - - /// Boolean indicating whether this subscription should cancel at the end of the current period. - #[serde(skip_serializing_if = "Option::is_none")] - pub cancel_at_period_end: Option, - - /// Details about why this subscription was cancelled. - #[serde(skip_serializing_if = "Option::is_none")] - pub cancellation_details: Option, - - /// Either `charge_automatically`, or `send_invoice`. - /// - /// When charging automatically, Stripe will attempt to pay this subscription at the end of the cycle using the default source attached to the customer. - /// When sending an invoice, Stripe will email your customer an invoice with payment instructions and mark the subscription as `active`. - /// Defaults to `charge_automatically`. - #[serde(skip_serializing_if = "Option::is_none")] - pub collection_method: Option, - - /// The ID of the coupon to apply to this subscription. - /// - /// A coupon applied to a subscription will only affect invoices created for that particular subscription. - #[serde(skip_serializing_if = "Option::is_none")] - pub coupon: Option, - - /// Number of days a customer has to pay invoices generated by this subscription. - /// - /// Valid only for subscriptions where `collection_method` is set to `send_invoice`. - #[serde(skip_serializing_if = "Option::is_none")] - pub days_until_due: Option, - - /// ID of the default payment method for the subscription. - /// - /// It must belong to the customer associated with the subscription. - /// This takes precedence over `default_source`. - /// If neither are set, invoices will use the customer's [invoice_settings.default_payment_method](https://stripe.com/docs/api/customers/object#customer_object-invoice_settings-default_payment_method) or [default_source](https://stripe.com/docs/api/customers/object#customer_object-default_source). - #[serde(skip_serializing_if = "Option::is_none")] - pub default_payment_method: Option<&'a str>, - - /// ID of the default payment source for the subscription. - /// - /// It must belong to the customer associated with the subscription and be in a chargeable state. - /// If `default_payment_method` is also set, `default_payment_method` will take precedence. - /// If neither are set, invoices will use the customer's [invoice_settings.default_payment_method](https://stripe.com/docs/api/customers/object#customer_object-invoice_settings-default_payment_method) or [default_source](https://stripe.com/docs/api/customers/object#customer_object-default_source). - #[serde(skip_serializing_if = "Option::is_none")] - pub default_source: Option, - - /// The tax rates that will apply to any subscription item that does not have `tax_rates` set. - /// - /// Invoices created will have their `default_tax_rates` populated from the subscription. - /// Pass an empty string to remove previously-defined tax rates. - #[serde(skip_serializing_if = "Option::is_none")] - pub default_tax_rates: Option>, - - /// The subscription's description, meant to be displayable to the customer. - /// - /// Use this field to optionally store an explanation of the subscription for rendering in Stripe surfaces and certain local payment methods UIs. - #[serde(skip_serializing_if = "Option::is_none")] - pub description: Option, - - /// Specifies which fields in the response should be expanded. - #[serde(skip_serializing_if = "Expand::is_empty")] - pub expand: &'a [&'a str], - - /// All invoices will be billed using the specified settings. - #[serde(skip_serializing_if = "Option::is_none")] - pub invoice_settings: Option, - - /// A list of up to 20 subscription items, each with an attached price. - #[serde(skip_serializing_if = "Option::is_none")] - pub items: Option>, - - /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. - /// - /// This can be useful for storing additional information about the object in a structured format. - /// Individual keys can be unset by posting an empty value to them. - /// All keys can be unset by posting an empty value to `metadata`. - #[serde(skip_serializing_if = "Option::is_none")] - pub metadata: Option, - - /// Indicates if a customer is on or off-session while an invoice payment is attempted. - #[serde(skip_serializing_if = "Option::is_none")] - pub off_session: Option, - - /// The account on behalf of which to charge, for each of the subscription's invoices. - #[serde(skip_serializing_if = "Option::is_none")] - pub on_behalf_of: Option, - - /// If specified, payment collection for this subscription will be paused. - #[serde(skip_serializing_if = "Option::is_none")] - pub pause_collection: Option, - - /// Use `allow_incomplete` to transition the subscription to `status=past_due` if a payment is required but cannot be paid. - /// - /// This allows you to manage scenarios where additional user actions are needed to pay a subscription's invoice. - /// For example, SCA regulation may require 3DS authentication to complete payment. - /// See the [SCA Migration Guide](https://stripe.com/docs/billing/migration/strong-customer-authentication) for Billing to learn more. - /// This is the default behavior. Use `default_incomplete` to transition the subscription to `status=past_due` when payment is required and await explicit confirmation of the invoice's payment intent. - /// This allows simpler management of scenarios where additional user actions are needed to pay a subscription’s invoice. - /// Such as failed payments, [SCA regulation](https://stripe.com/docs/billing/migration/strong-customer-authentication), or collecting a mandate for a bank debit payment method. Use `pending_if_incomplete` to update the subscription using [pending updates](https://stripe.com/docs/billing/subscriptions/pending-updates). - /// When you use `pending_if_incomplete` you can only pass the parameters [supported by pending updates](https://stripe.com/docs/billing/pending-updates-reference#supported-attributes). Use `error_if_incomplete` if you want Stripe to return an HTTP 402 status code if a subscription's invoice cannot be paid. - /// For example, if a payment method requires 3DS authentication due to SCA regulation and further user action is needed, this parameter does not update the subscription and returns an error instead. - /// This was the default behavior for API versions prior to 2019-03-14. - /// See the [changelog](https://stripe.com/docs/upgrades#2019-03-14) to learn more. - #[serde(skip_serializing_if = "Option::is_none")] - pub payment_behavior: Option, - - /// Payment settings to pass to invoices created by the subscription. - #[serde(skip_serializing_if = "Option::is_none")] - pub payment_settings: Option, - - /// Specifies an interval for how often to bill for any pending invoice items. - /// - /// It is analogous to calling [Create an invoice](https://stripe.com/docs/api#create_invoice) for the given subscription at the specified interval. - #[serde(skip_serializing_if = "Option::is_none")] - pub pending_invoice_item_interval: Option, - - /// The promotion code to apply to this subscription. - /// - /// A promotion code applied to a subscription will only affect invoices created for that particular subscription. - #[serde(skip_serializing_if = "Option::is_none")] - pub promotion_code: Option, - - /// Determines how to handle [prorations](https://stripe.com/docs/subscriptions/billing-cycle#prorations) when the billing cycle changes (e.g., when switching plans, resetting `billing_cycle_anchor=now`, or starting a trial), or if an item's `quantity` changes. - /// - /// The default value is `create_prorations`. - #[serde(skip_serializing_if = "Option::is_none")] - pub proration_behavior: Option, - - /// If set, the proration will be calculated as though the subscription was updated at the given time. - /// - /// This can be used to apply exactly the same proration that was previewed with [upcoming invoice](https://stripe.com/docs/api#upcoming_invoice) endpoint. - /// It can also be used to implement custom proration logic, such as prorating by day instead of by second, by providing the time that you wish to use for proration calculations. - #[serde(skip_serializing_if = "Option::is_none")] - pub proration_date: Option, - - /// If specified, the funds from the subscription's invoices will be transferred to the destination and the ID of the resulting transfers will be found on the resulting charges. - /// - /// This will be unset if you POST an empty value. - #[serde(skip_serializing_if = "Option::is_none")] - pub transfer_data: Option, - - /// Unix timestamp representing the end of the trial period the customer will get before being charged for the first time. - /// - /// This will always overwrite any trials that might apply via a subscribed plan. - /// If set, trial_end will override the default trial period of the plan the customer is being subscribed to. - /// The special value `now` can be provided to end the customer's trial immediately. - /// Can be at most two years from `billing_cycle_anchor`. - #[serde(skip_serializing_if = "Option::is_none")] - pub trial_end: Option, - - /// Indicates if a plan's `trial_period_days` should be applied to the subscription. - /// - /// Setting `trial_end` per subscription is preferred, and this defaults to `false`. - /// Setting this flag to `true` together with `trial_end` is not allowed. - /// See [Using trial periods on subscriptions](https://stripe.com/docs/billing/subscriptions/trials) to learn more. - #[serde(skip_serializing_if = "Option::is_none")] - pub trial_from_plan: Option, - - /// Settings related to subscription trials. - #[serde(skip_serializing_if = "Option::is_none")] - pub trial_settings: Option, -} - -impl<'a> UpdateSubscription<'a> { - pub fn new() -> Self { - UpdateSubscription { - add_invoice_items: Default::default(), - application_fee_percent: Default::default(), - automatic_tax: Default::default(), - billing_cycle_anchor: Default::default(), - billing_thresholds: Default::default(), - cancel_at: Default::default(), - cancel_at_period_end: Default::default(), - cancellation_details: Default::default(), - collection_method: Default::default(), - coupon: Default::default(), - days_until_due: Default::default(), - default_payment_method: Default::default(), - default_source: Default::default(), - default_tax_rates: Default::default(), - description: Default::default(), - expand: Default::default(), - invoice_settings: Default::default(), - items: Default::default(), - metadata: Default::default(), - off_session: Default::default(), - on_behalf_of: Default::default(), - pause_collection: Default::default(), - payment_behavior: Default::default(), - payment_settings: Default::default(), - pending_invoice_item_interval: Default::default(), - promotion_code: Default::default(), - proration_behavior: Default::default(), - proration_date: Default::default(), - transfer_data: Default::default(), - trial_end: Default::default(), - trial_from_plan: Default::default(), - trial_settings: Default::default(), - } - } -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct AddInvoiceItems { - /// The ID of the price object. - #[serde(skip_serializing_if = "Option::is_none")] - pub price: Option, - - /// Data used to generate a new [Price](https://stripe.com/docs/api/prices) object inline. - #[serde(skip_serializing_if = "Option::is_none")] - pub price_data: Option, - - /// Quantity for this item. - /// - /// Defaults to 1. - #[serde(skip_serializing_if = "Option::is_none")] - pub quantity: Option, - - /// The tax rates which apply to the item. - /// - /// When set, the `default_tax_rates` do not apply to this item. - #[serde(skip_serializing_if = "Option::is_none")] - pub tax_rates: Option>, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreateSubscriptionAutomaticTax { - /// Enabled automatic tax calculation which will automatically compute tax rates on all invoices generated by the subscription. - pub enabled: bool, - - /// The account that's liable for tax. - /// - /// If set, the business address and tax registrations required to perform the tax calculation are loaded from this account. - /// The tax transaction is returned in the report of the connected account. - #[serde(skip_serializing_if = "Option::is_none")] - pub liability: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreateSubscriptionBillingCycleAnchorConfig { - /// The day of the month the billing_cycle_anchor should be. - /// - /// Ranges from 1 to 31. - pub day_of_month: i64, - - /// The hour of the day the billing_cycle_anchor should be. - /// - /// Ranges from 0 to 23. - #[serde(skip_serializing_if = "Option::is_none")] - pub hour: Option, - - /// The minute of the hour the billing_cycle_anchor should be. - /// - /// Ranges from 0 to 59. - #[serde(skip_serializing_if = "Option::is_none")] - pub minute: Option, - - /// The month to start full cycle billing periods. - /// - /// Ranges from 1 to 12. - #[serde(skip_serializing_if = "Option::is_none")] - pub month: Option, - - /// The second of the minute the billing_cycle_anchor should be. - /// - /// Ranges from 0 to 59. - #[serde(skip_serializing_if = "Option::is_none")] - pub second: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreateSubscriptionInvoiceSettings { - /// The account tax IDs associated with the subscription. - /// - /// Will be set on invoices generated by the subscription. - #[serde(skip_serializing_if = "Option::is_none")] - pub account_tax_ids: Option>, - - /// The connected account that issues the invoice. - /// - /// The invoice is presented with the branding and support information of the specified account. - #[serde(skip_serializing_if = "Option::is_none")] - pub issuer: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreateSubscriptionItems { - /// Define thresholds at which an invoice will be sent, and the subscription advanced to a new billing period. - /// - /// When updating, pass an empty string to remove previously-defined thresholds. - #[serde(skip_serializing_if = "Option::is_none")] - pub billing_thresholds: Option, - - /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. - /// - /// This can be useful for storing additional information about the object in a structured format. - /// Individual keys can be unset by posting an empty value to them. - /// All keys can be unset by posting an empty value to `metadata`. - #[serde(skip_serializing_if = "Option::is_none")] - pub metadata: Option, - - /// Plan ID for this item, as a string. - #[serde(skip_serializing_if = "Option::is_none")] - pub plan: Option, - - /// The ID of the price object. - #[serde(skip_serializing_if = "Option::is_none")] - pub price: Option, - - /// Data used to generate a new [Price](https://stripe.com/docs/api/prices) object inline. - #[serde(skip_serializing_if = "Option::is_none")] - pub price_data: Option, - - /// Quantity for this item. - #[serde(skip_serializing_if = "Option::is_none")] - pub quantity: Option, - - /// A list of [Tax Rate](https://stripe.com/docs/api/tax_rates) ids. - /// - /// These Tax Rates will override the [`default_tax_rates`](https://stripe.com/docs/api/subscriptions/create#create_subscription-default_tax_rates) on the Subscription. - /// When updating, pass an empty string to remove previously-defined tax rates. - #[serde(skip_serializing_if = "Option::is_none")] - pub tax_rates: Option>, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreateSubscriptionPaymentSettings { - /// Payment-method-specific configuration to provide to invoices created by the subscription. - #[serde(skip_serializing_if = "Option::is_none")] - pub payment_method_options: Option, - - /// The list of payment method types (e.g. - /// - /// card) to provide to the invoice’s PaymentIntent. - /// If not set, Stripe attempts to automatically determine the types to use by looking at the invoice’s default payment method, the subscription’s default payment method, the customer’s default payment method, and your [invoice template settings](https://dashboard.stripe.com/settings/billing/invoice). - #[serde(skip_serializing_if = "Option::is_none")] - pub payment_method_types: Option>, - - /// Either `off`, or `on_subscription`. - /// - /// With `on_subscription` Stripe updates `subscription.default_payment_method` when a subscription payment succeeds. - #[serde(skip_serializing_if = "Option::is_none")] - pub save_default_payment_method: - Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreateSubscriptionPendingInvoiceItemInterval { - /// Specifies invoicing frequency. - /// - /// Either `day`, `week`, `month` or `year`. - pub interval: PlanInterval, - - /// The number of intervals between invoices. - /// - /// For example, `interval=month` and `interval_count=3` bills every 3 months. - /// Maximum of one year interval allowed (1 year, 12 months, or 52 weeks). - #[serde(skip_serializing_if = "Option::is_none")] - pub interval_count: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreateSubscriptionTransferData { - /// A non-negative decimal between 0 and 100, with at most two decimal places. - /// - /// This represents the percentage of the subscription invoice total that will be transferred to the destination account. - /// By default, the entire amount is transferred to the destination. - #[serde(skip_serializing_if = "Option::is_none")] - pub amount_percent: Option, - - /// ID of an existing, connected Stripe account. - pub destination: String, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreateSubscriptionTrialSettings { - /// Defines how the subscription should behave when the user's free trial ends. - pub end_behavior: CreateSubscriptionTrialSettingsEndBehavior, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct ListSubscriptionsAutomaticTax { - /// Enabled automatic tax calculation which will automatically compute tax rates on all invoices generated by the subscription. - pub enabled: bool, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UpdateSubscriptionAutomaticTax { - /// Enabled automatic tax calculation which will automatically compute tax rates on all invoices generated by the subscription. - pub enabled: bool, - - /// The account that's liable for tax. - /// - /// If set, the business address and tax registrations required to perform the tax calculation are loaded from this account. - /// The tax transaction is returned in the report of the connected account. - #[serde(skip_serializing_if = "Option::is_none")] - pub liability: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UpdateSubscriptionCancellationDetails { - /// Additional comments about why the user canceled the subscription, if the subscription was canceled explicitly by the user. - #[serde(skip_serializing_if = "Option::is_none")] - pub comment: Option, - - /// The customer submitted reason for why they canceled, if the subscription was canceled explicitly by the user. - #[serde(skip_serializing_if = "Option::is_none")] - pub feedback: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UpdateSubscriptionInvoiceSettings { - /// The account tax IDs associated with the subscription. - /// - /// Will be set on invoices generated by the subscription. - #[serde(skip_serializing_if = "Option::is_none")] - pub account_tax_ids: Option>, - - /// The connected account that issues the invoice. - /// - /// The invoice is presented with the branding and support information of the specified account. - #[serde(skip_serializing_if = "Option::is_none")] - pub issuer: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UpdateSubscriptionItems { - /// Define thresholds at which an invoice will be sent, and the subscription advanced to a new billing period. - /// - /// When updating, pass an empty string to remove previously-defined thresholds. - #[serde(skip_serializing_if = "Option::is_none")] - pub billing_thresholds: Option, - - /// Delete all usage for a given subscription item. - /// - /// Allowed only when `deleted` is set to `true` and the current plan's `usage_type` is `metered`. - #[serde(skip_serializing_if = "Option::is_none")] - pub clear_usage: Option, - - /// A flag that, if set to `true`, will delete the specified item. - #[serde(skip_serializing_if = "Option::is_none")] - pub deleted: Option, - - /// Subscription item to update. - #[serde(skip_serializing_if = "Option::is_none")] - pub id: Option, - - /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. - /// - /// This can be useful for storing additional information about the object in a structured format. - /// Individual keys can be unset by posting an empty value to them. - /// All keys can be unset by posting an empty value to `metadata`. - #[serde(skip_serializing_if = "Option::is_none")] - pub metadata: Option, - - /// Plan ID for this item, as a string. - #[serde(skip_serializing_if = "Option::is_none")] - pub plan: Option, - - /// The ID of the price object. - /// - /// When changing a subscription item's price, `quantity` is set to 1 unless a `quantity` parameter is provided. - #[serde(skip_serializing_if = "Option::is_none")] - pub price: Option, - - /// Data used to generate a new [Price](https://stripe.com/docs/api/prices) object inline. - #[serde(skip_serializing_if = "Option::is_none")] - pub price_data: Option, - - /// Quantity for this item. - #[serde(skip_serializing_if = "Option::is_none")] - pub quantity: Option, - - /// A list of [Tax Rate](https://stripe.com/docs/api/tax_rates) ids. - /// - /// These Tax Rates will override the [`default_tax_rates`](https://stripe.com/docs/api/subscriptions/create#create_subscription-default_tax_rates) on the Subscription. - /// When updating, pass an empty string to remove previously-defined tax rates. - #[serde(skip_serializing_if = "Option::is_none")] - pub tax_rates: Option>, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UpdateSubscriptionPauseCollection { - /// The payment collection behavior for this subscription while paused. - /// - /// One of `keep_as_draft`, `mark_uncollectible`, or `void`. - pub behavior: UpdateSubscriptionPauseCollectionBehavior, - - /// The time after which the subscription will resume collecting payments. - #[serde(skip_serializing_if = "Option::is_none")] - pub resumes_at: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UpdateSubscriptionPaymentSettings { - /// Payment-method-specific configuration to provide to invoices created by the subscription. - #[serde(skip_serializing_if = "Option::is_none")] - pub payment_method_options: Option, - - /// The list of payment method types (e.g. - /// - /// card) to provide to the invoice’s PaymentIntent. - /// If not set, Stripe attempts to automatically determine the types to use by looking at the invoice’s default payment method, the subscription’s default payment method, the customer’s default payment method, and your [invoice template settings](https://dashboard.stripe.com/settings/billing/invoice). - #[serde(skip_serializing_if = "Option::is_none")] - pub payment_method_types: Option>, - - /// Either `off`, or `on_subscription`. - /// - /// With `on_subscription` Stripe updates `subscription.default_payment_method` when a subscription payment succeeds. - #[serde(skip_serializing_if = "Option::is_none")] - pub save_default_payment_method: - Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UpdateSubscriptionPendingInvoiceItemInterval { - /// Specifies invoicing frequency. - /// - /// Either `day`, `week`, `month` or `year`. - pub interval: PlanInterval, - - /// The number of intervals between invoices. - /// - /// For example, `interval=month` and `interval_count=3` bills every 3 months. - /// Maximum of one year interval allowed (1 year, 12 months, or 52 weeks). - #[serde(skip_serializing_if = "Option::is_none")] - pub interval_count: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UpdateSubscriptionTransferData { - /// A non-negative decimal between 0 and 100, with at most two decimal places. - /// - /// This represents the percentage of the subscription invoice total that will be transferred to the destination account. - /// By default, the entire amount is transferred to the destination. - #[serde(skip_serializing_if = "Option::is_none")] - pub amount_percent: Option, - - /// ID of an existing, connected Stripe account. - pub destination: String, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UpdateSubscriptionTrialSettings { - /// Defines how the subscription should behave when the user's free trial ends. - pub end_behavior: UpdateSubscriptionTrialSettingsEndBehavior, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreateSubscriptionAutomaticTaxLiability { - /// The connected account being referenced when `type` is `account`. - #[serde(skip_serializing_if = "Option::is_none")] - pub account: Option, - - /// Type of the account referenced in the request. - #[serde(rename = "type")] - pub type_: CreateSubscriptionAutomaticTaxLiabilityType, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreateSubscriptionInvoiceSettingsIssuer { - /// The connected account being referenced when `type` is `account`. - #[serde(skip_serializing_if = "Option::is_none")] - pub account: Option, - - /// Type of the account referenced in the request. - #[serde(rename = "type")] - pub type_: CreateSubscriptionInvoiceSettingsIssuerType, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreateSubscriptionItemsBillingThresholds { - /// Number of units that meets the billing threshold to advance the subscription to a new billing period (e.g., it takes 10 $5 units to meet a $50 [monetary threshold](https://stripe.com/docs/api/subscriptions/update#update_subscription-billing_thresholds-amount_gte)). - pub usage_gte: i64, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreateSubscriptionPaymentSettingsPaymentMethodOptions { - /// This sub-hash contains details about the Canadian pre-authorized debit payment method options to pass to the invoice’s PaymentIntent. - #[serde(skip_serializing_if = "Option::is_none")] - pub acss_debit: Option, - - /// This sub-hash contains details about the Bancontact payment method options to pass to the invoice’s PaymentIntent. - #[serde(skip_serializing_if = "Option::is_none")] - pub bancontact: Option, - - /// This sub-hash contains details about the Card payment method options to pass to the invoice’s PaymentIntent. - #[serde(skip_serializing_if = "Option::is_none")] - pub card: Option, - - /// This sub-hash contains details about the Bank transfer payment method options to pass to the invoice’s PaymentIntent. - #[serde(skip_serializing_if = "Option::is_none")] - pub customer_balance: - Option, - - /// This sub-hash contains details about the Konbini payment method options to pass to the invoice’s PaymentIntent. - #[serde(skip_serializing_if = "Option::is_none")] - pub konbini: Option, - - /// This sub-hash contains details about the ACH direct debit payment method options to pass to the invoice’s PaymentIntent. - #[serde(skip_serializing_if = "Option::is_none")] - pub us_bank_account: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreateSubscriptionTrialSettingsEndBehavior { - /// Indicates how the subscription should change when the trial ends if the user did not provide a payment method. - pub missing_payment_method: CreateSubscriptionTrialSettingsEndBehaviorMissingPaymentMethod, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct InvoiceItemPriceData { - /// Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. - /// - /// Must be a [supported currency](https://stripe.com/docs/currencies). - pub currency: Currency, - - /// The ID of the product that this price will belong to. - pub product: String, - - /// Only required if a [default tax behavior](https://stripe.com/docs/tax/products-prices-tax-categories-tax-behavior#setting-a-default-tax-behavior-(recommended)) was not provided in the Stripe Tax settings. - /// - /// Specifies whether the price is considered inclusive of taxes or exclusive of taxes. - /// One of `inclusive`, `exclusive`, or `unspecified`. - /// Once specified as either `inclusive` or `exclusive`, it cannot be changed. - #[serde(skip_serializing_if = "Option::is_none")] - pub tax_behavior: Option, - - /// A positive integer in cents (or local equivalent) (or 0 for a free price) representing how much to charge. - #[serde(skip_serializing_if = "Option::is_none")] - pub unit_amount: Option, - - /// Same as `unit_amount`, but accepts a decimal value in cents (or local equivalent) with at most 12 decimal places. - /// - /// Only one of `unit_amount` and `unit_amount_decimal` can be set. - #[serde(skip_serializing_if = "Option::is_none")] - pub unit_amount_decimal: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct SubscriptionItemPriceData { - /// Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. - /// - /// Must be a [supported currency](https://stripe.com/docs/currencies). - pub currency: Currency, - - /// The ID of the product that this price will belong to. - pub product: String, - - /// The recurring components of a price such as `interval` and `interval_count`. - pub recurring: SubscriptionItemPriceDataRecurring, - - /// Only required if a [default tax behavior](https://stripe.com/docs/tax/products-prices-tax-categories-tax-behavior#setting-a-default-tax-behavior-(recommended)) was not provided in the Stripe Tax settings. - /// - /// Specifies whether the price is considered inclusive of taxes or exclusive of taxes. - /// One of `inclusive`, `exclusive`, or `unspecified`. - /// Once specified as either `inclusive` or `exclusive`, it cannot be changed. - #[serde(skip_serializing_if = "Option::is_none")] - pub tax_behavior: Option, - - /// A positive integer in cents (or local equivalent) (or 0 for a free price) representing how much to charge. - #[serde(skip_serializing_if = "Option::is_none")] - pub unit_amount: Option, - - /// Same as `unit_amount`, but accepts a decimal value in cents (or local equivalent) with at most 12 decimal places. - /// - /// Only one of `unit_amount` and `unit_amount_decimal` can be set. - #[serde(skip_serializing_if = "Option::is_none")] - pub unit_amount_decimal: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UpdateSubscriptionAutomaticTaxLiability { - /// The connected account being referenced when `type` is `account`. - #[serde(skip_serializing_if = "Option::is_none")] - pub account: Option, - - /// Type of the account referenced in the request. - #[serde(rename = "type")] - pub type_: UpdateSubscriptionAutomaticTaxLiabilityType, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UpdateSubscriptionInvoiceSettingsIssuer { - /// The connected account being referenced when `type` is `account`. - #[serde(skip_serializing_if = "Option::is_none")] - pub account: Option, - - /// Type of the account referenced in the request. - #[serde(rename = "type")] - pub type_: UpdateSubscriptionInvoiceSettingsIssuerType, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UpdateSubscriptionPaymentSettingsPaymentMethodOptions { - /// This sub-hash contains details about the Canadian pre-authorized debit payment method options to pass to the invoice’s PaymentIntent. - #[serde(skip_serializing_if = "Option::is_none")] - pub acss_debit: Option, - - /// This sub-hash contains details about the Bancontact payment method options to pass to the invoice’s PaymentIntent. - #[serde(skip_serializing_if = "Option::is_none")] - pub bancontact: Option, - - /// This sub-hash contains details about the Card payment method options to pass to the invoice’s PaymentIntent. - #[serde(skip_serializing_if = "Option::is_none")] - pub card: Option, - - /// This sub-hash contains details about the Bank transfer payment method options to pass to the invoice’s PaymentIntent. - #[serde(skip_serializing_if = "Option::is_none")] - pub customer_balance: - Option, - - /// This sub-hash contains details about the Konbini payment method options to pass to the invoice’s PaymentIntent. - #[serde(skip_serializing_if = "Option::is_none")] - pub konbini: Option, - - /// This sub-hash contains details about the ACH direct debit payment method options to pass to the invoice’s PaymentIntent. - #[serde(skip_serializing_if = "Option::is_none")] - pub us_bank_account: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UpdateSubscriptionTrialSettingsEndBehavior { - /// Indicates how the subscription should change when the trial ends if the user did not provide a payment method. - pub missing_payment_method: UpdateSubscriptionTrialSettingsEndBehaviorMissingPaymentMethod, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreateSubscriptionPaymentSettingsPaymentMethodOptionsAcssDebit { - /// Additional fields for Mandate creation. - #[serde(skip_serializing_if = "Option::is_none")] - pub mandate_options: - Option, - - /// Verification method for the intent. - #[serde(skip_serializing_if = "Option::is_none")] - pub verification_method: - Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreateSubscriptionPaymentSettingsPaymentMethodOptionsBancontact { - /// Preferred language of the Bancontact authorization page that the customer is redirected to. - #[serde(skip_serializing_if = "Option::is_none")] - pub preferred_language: - Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreateSubscriptionPaymentSettingsPaymentMethodOptionsCard { - /// Configuration options for setting up an eMandate for cards issued in India. - #[serde(skip_serializing_if = "Option::is_none")] - pub mandate_options: - Option, - - /// Selected network to process this Subscription on. - /// - /// Depends on the available networks of the card attached to the Subscription. - /// Can be only set confirm-time. - #[serde(skip_serializing_if = "Option::is_none")] - pub network: Option, - - /// We strongly recommend that you rely on our SCA Engine to automatically prompt your customers for authentication based on risk level and [other requirements](https://stripe.com/docs/strong-customer-authentication). - /// - /// However, if you wish to request 3D Secure based on logic from your own fraud engine, provide this option. - /// Read our guide on [manually requesting 3D Secure](https://stripe.com/docs/payments/3d-secure#manual-three-ds) for more information on how this configuration interacts with Radar and our SCA Engine. - #[serde(skip_serializing_if = "Option::is_none")] - pub request_three_d_secure: - Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreateSubscriptionPaymentSettingsPaymentMethodOptionsCustomerBalance { - /// Configuration for the bank transfer funding type, if the `funding_type` is set to `bank_transfer`. - #[serde(skip_serializing_if = "Option::is_none")] - pub bank_transfer: - Option, - - /// The funding method type to be used when there are not enough funds in the customer balance. - /// - /// Permitted values include: `bank_transfer`. - #[serde(skip_serializing_if = "Option::is_none")] - pub funding_type: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreateSubscriptionPaymentSettingsPaymentMethodOptionsKonbini {} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreateSubscriptionPaymentSettingsPaymentMethodOptionsUsBankAccount { - /// Additional fields for Financial Connections Session creation. - #[serde(skip_serializing_if = "Option::is_none")] - pub financial_connections: Option< - CreateSubscriptionPaymentSettingsPaymentMethodOptionsUsBankAccountFinancialConnections, - >, - - /// Verification method for the intent. - #[serde(skip_serializing_if = "Option::is_none")] - pub verification_method: Option< - CreateSubscriptionPaymentSettingsPaymentMethodOptionsUsBankAccountVerificationMethod, - >, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct SubscriptionItemPriceDataRecurring { - /// Specifies billing frequency. - /// - /// Either `day`, `week`, `month` or `year`. - pub interval: PlanInterval, - - /// The number of intervals between subscription billings. - /// - /// For example, `interval=month` and `interval_count=3` bills every 3 months. - /// Maximum of three years interval allowed (3 years, 36 months, or 156 weeks). - #[serde(skip_serializing_if = "Option::is_none")] - pub interval_count: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UpdateSubscriptionPaymentSettingsPaymentMethodOptionsAcssDebit { - /// Additional fields for Mandate creation. - #[serde(skip_serializing_if = "Option::is_none")] - pub mandate_options: - Option, - - /// Verification method for the intent. - #[serde(skip_serializing_if = "Option::is_none")] - pub verification_method: - Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UpdateSubscriptionPaymentSettingsPaymentMethodOptionsBancontact { - /// Preferred language of the Bancontact authorization page that the customer is redirected to. - #[serde(skip_serializing_if = "Option::is_none")] - pub preferred_language: - Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UpdateSubscriptionPaymentSettingsPaymentMethodOptionsCard { - /// Configuration options for setting up an eMandate for cards issued in India. - #[serde(skip_serializing_if = "Option::is_none")] - pub mandate_options: - Option, - - /// Selected network to process this Subscription on. - /// - /// Depends on the available networks of the card attached to the Subscription. - /// Can be only set confirm-time. - #[serde(skip_serializing_if = "Option::is_none")] - pub network: Option, - - /// We strongly recommend that you rely on our SCA Engine to automatically prompt your customers for authentication based on risk level and [other requirements](https://stripe.com/docs/strong-customer-authentication). - /// - /// However, if you wish to request 3D Secure based on logic from your own fraud engine, provide this option. - /// Read our guide on [manually requesting 3D Secure](https://stripe.com/docs/payments/3d-secure#manual-three-ds) for more information on how this configuration interacts with Radar and our SCA Engine. - #[serde(skip_serializing_if = "Option::is_none")] - pub request_three_d_secure: - Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UpdateSubscriptionPaymentSettingsPaymentMethodOptionsCustomerBalance { - /// Configuration for the bank transfer funding type, if the `funding_type` is set to `bank_transfer`. - #[serde(skip_serializing_if = "Option::is_none")] - pub bank_transfer: - Option, - - /// The funding method type to be used when there are not enough funds in the customer balance. - /// - /// Permitted values include: `bank_transfer`. - #[serde(skip_serializing_if = "Option::is_none")] - pub funding_type: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UpdateSubscriptionPaymentSettingsPaymentMethodOptionsKonbini {} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UpdateSubscriptionPaymentSettingsPaymentMethodOptionsUsBankAccount { - /// Additional fields for Financial Connections Session creation. - #[serde(skip_serializing_if = "Option::is_none")] - pub financial_connections: Option< - UpdateSubscriptionPaymentSettingsPaymentMethodOptionsUsBankAccountFinancialConnections, - >, - - /// Verification method for the intent. - #[serde(skip_serializing_if = "Option::is_none")] - pub verification_method: Option< - UpdateSubscriptionPaymentSettingsPaymentMethodOptionsUsBankAccountVerificationMethod, - >, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreateSubscriptionPaymentSettingsPaymentMethodOptionsAcssDebitMandateOptions { - /// Transaction type of the mandate. - #[serde(skip_serializing_if = "Option::is_none")] - pub transaction_type: Option< - CreateSubscriptionPaymentSettingsPaymentMethodOptionsAcssDebitMandateOptionsTransactionType, - >, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreateSubscriptionPaymentSettingsPaymentMethodOptionsCardMandateOptions { - /// Amount to be charged for future payments. - #[serde(skip_serializing_if = "Option::is_none")] - pub amount: Option, - - /// One of `fixed` or `maximum`. - /// - /// If `fixed`, the `amount` param refers to the exact amount to be charged in future payments. - /// If `maximum`, the amount charged can be up to the value passed for the `amount` param. - #[serde(skip_serializing_if = "Option::is_none")] - pub amount_type: - Option, - - /// A description of the mandate or subscription that is meant to be displayed to the customer. - #[serde(skip_serializing_if = "Option::is_none")] - pub description: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreateSubscriptionPaymentSettingsPaymentMethodOptionsCustomerBalanceBankTransfer { - - /// Configuration for eu_bank_transfer funding type. - #[serde(skip_serializing_if = "Option::is_none")] - pub eu_bank_transfer: Option, - - /// The bank transfer type that can be used for funding. - /// - /// Permitted values include: `eu_bank_transfer`, `gb_bank_transfer`, `jp_bank_transfer`, `mx_bank_transfer`, or `us_bank_transfer`. - #[serde(rename = "type")] - #[serde(skip_serializing_if = "Option::is_none")] - pub type_: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreateSubscriptionPaymentSettingsPaymentMethodOptionsUsBankAccountFinancialConnections { - - /// The list of permissions to request. - /// - /// If this parameter is passed, the `payment_method` permission must be included. - /// Valid permissions include: `balances`, `ownership`, `payment_method`, and `transactions`. - #[serde(skip_serializing_if = "Option::is_none")] - pub permissions: Option>, - - /// List of data features that you would like to retrieve upon account creation. - #[serde(skip_serializing_if = "Option::is_none")] - pub prefetch: Option>, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UpdateSubscriptionPaymentSettingsPaymentMethodOptionsAcssDebitMandateOptions { - /// Transaction type of the mandate. - #[serde(skip_serializing_if = "Option::is_none")] - pub transaction_type: Option< - UpdateSubscriptionPaymentSettingsPaymentMethodOptionsAcssDebitMandateOptionsTransactionType, - >, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UpdateSubscriptionPaymentSettingsPaymentMethodOptionsCardMandateOptions { - /// Amount to be charged for future payments. - #[serde(skip_serializing_if = "Option::is_none")] - pub amount: Option, - - /// One of `fixed` or `maximum`. - /// - /// If `fixed`, the `amount` param refers to the exact amount to be charged in future payments. - /// If `maximum`, the amount charged can be up to the value passed for the `amount` param. - #[serde(skip_serializing_if = "Option::is_none")] - pub amount_type: - Option, - - /// A description of the mandate or subscription that is meant to be displayed to the customer. - #[serde(skip_serializing_if = "Option::is_none")] - pub description: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UpdateSubscriptionPaymentSettingsPaymentMethodOptionsCustomerBalanceBankTransfer { - - /// Configuration for eu_bank_transfer funding type. - #[serde(skip_serializing_if = "Option::is_none")] - pub eu_bank_transfer: Option, - - /// The bank transfer type that can be used for funding. - /// - /// Permitted values include: `eu_bank_transfer`, `gb_bank_transfer`, `jp_bank_transfer`, `mx_bank_transfer`, or `us_bank_transfer`. - #[serde(rename = "type")] - #[serde(skip_serializing_if = "Option::is_none")] - pub type_: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UpdateSubscriptionPaymentSettingsPaymentMethodOptionsUsBankAccountFinancialConnections { - - /// The list of permissions to request. - /// - /// If this parameter is passed, the `payment_method` permission must be included. - /// Valid permissions include: `balances`, `ownership`, `payment_method`, and `transactions`. - #[serde(skip_serializing_if = "Option::is_none")] - pub permissions: Option>, - - /// List of data features that you would like to retrieve upon account creation. - #[serde(skip_serializing_if = "Option::is_none")] - pub prefetch: Option>, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreateSubscriptionPaymentSettingsPaymentMethodOptionsCustomerBalanceBankTransferEuBankTransfer -{ - /// The desired country code of the bank account information. - /// - /// Permitted values include: `BE`, `DE`, `ES`, `FR`, `IE`, or `NL`. - pub country: String, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UpdateSubscriptionPaymentSettingsPaymentMethodOptionsCustomerBalanceBankTransferEuBankTransfer -{ - /// The desired country code of the bank account information. - /// - /// Permitted values include: `BE`, `DE`, `ES`, `FR`, `IE`, or `NL`. - pub country: String, -} - -/// An enum representing the possible values of an `CancellationDetails`'s `feedback` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CancellationDetailsFeedback { - CustomerService, - LowQuality, - MissingFeatures, - Other, - SwitchedService, - TooComplex, - TooExpensive, - Unused, -} - -impl CancellationDetailsFeedback { - pub fn as_str(self) -> &'static str { - match self { - CancellationDetailsFeedback::CustomerService => "customer_service", - CancellationDetailsFeedback::LowQuality => "low_quality", - CancellationDetailsFeedback::MissingFeatures => "missing_features", - CancellationDetailsFeedback::Other => "other", - CancellationDetailsFeedback::SwitchedService => "switched_service", - CancellationDetailsFeedback::TooComplex => "too_complex", - CancellationDetailsFeedback::TooExpensive => "too_expensive", - CancellationDetailsFeedback::Unused => "unused", - } - } -} - -impl AsRef for CancellationDetailsFeedback { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for CancellationDetailsFeedback { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for CancellationDetailsFeedback { - fn default() -> Self { - Self::CustomerService - } -} - -/// An enum representing the possible values of an `CancellationDetails`'s `reason` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CancellationDetailsReason { - CancellationRequested, - PaymentDisputed, - PaymentFailed, -} - -impl CancellationDetailsReason { - pub fn as_str(self) -> &'static str { - match self { - CancellationDetailsReason::CancellationRequested => "cancellation_requested", - CancellationDetailsReason::PaymentDisputed => "payment_disputed", - CancellationDetailsReason::PaymentFailed => "payment_failed", - } - } -} - -impl AsRef for CancellationDetailsReason { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for CancellationDetailsReason { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for CancellationDetailsReason { - fn default() -> Self { - Self::CancellationRequested - } -} - -/// An enum representing the possible values of an `CreateSubscriptionAutomaticTaxLiability`'s `type` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CreateSubscriptionAutomaticTaxLiabilityType { - Account, - #[serde(rename = "self")] - Self_, -} - -impl CreateSubscriptionAutomaticTaxLiabilityType { - pub fn as_str(self) -> &'static str { - match self { - CreateSubscriptionAutomaticTaxLiabilityType::Account => "account", - CreateSubscriptionAutomaticTaxLiabilityType::Self_ => "self", - } - } -} - -impl AsRef for CreateSubscriptionAutomaticTaxLiabilityType { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for CreateSubscriptionAutomaticTaxLiabilityType { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for CreateSubscriptionAutomaticTaxLiabilityType { - fn default() -> Self { - Self::Account - } -} - -/// An enum representing the possible values of an `CreateSubscriptionInvoiceSettingsIssuer`'s `type` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CreateSubscriptionInvoiceSettingsIssuerType { - Account, - #[serde(rename = "self")] - Self_, -} - -impl CreateSubscriptionInvoiceSettingsIssuerType { - pub fn as_str(self) -> &'static str { - match self { - CreateSubscriptionInvoiceSettingsIssuerType::Account => "account", - CreateSubscriptionInvoiceSettingsIssuerType::Self_ => "self", - } - } -} - -impl AsRef for CreateSubscriptionInvoiceSettingsIssuerType { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for CreateSubscriptionInvoiceSettingsIssuerType { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for CreateSubscriptionInvoiceSettingsIssuerType { - fn default() -> Self { - Self::Account - } -} - -/// An enum representing the possible values of an `CreateSubscriptionPaymentSettingsPaymentMethodOptionsAcssDebitMandateOptions`'s `transaction_type` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CreateSubscriptionPaymentSettingsPaymentMethodOptionsAcssDebitMandateOptionsTransactionType -{ - Business, - Personal, -} - -impl CreateSubscriptionPaymentSettingsPaymentMethodOptionsAcssDebitMandateOptionsTransactionType { - pub fn as_str(self) -> &'static str { - match self { - CreateSubscriptionPaymentSettingsPaymentMethodOptionsAcssDebitMandateOptionsTransactionType::Business => "business", - CreateSubscriptionPaymentSettingsPaymentMethodOptionsAcssDebitMandateOptionsTransactionType::Personal => "personal", - } - } -} - -impl AsRef - for CreateSubscriptionPaymentSettingsPaymentMethodOptionsAcssDebitMandateOptionsTransactionType -{ - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display - for CreateSubscriptionPaymentSettingsPaymentMethodOptionsAcssDebitMandateOptionsTransactionType -{ - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default - for CreateSubscriptionPaymentSettingsPaymentMethodOptionsAcssDebitMandateOptionsTransactionType -{ - fn default() -> Self { - Self::Business - } -} - -/// An enum representing the possible values of an `CreateSubscriptionPaymentSettingsPaymentMethodOptionsAcssDebit`'s `verification_method` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CreateSubscriptionPaymentSettingsPaymentMethodOptionsAcssDebitVerificationMethod { - Automatic, - Instant, - Microdeposits, -} - -impl CreateSubscriptionPaymentSettingsPaymentMethodOptionsAcssDebitVerificationMethod { - pub fn as_str(self) -> &'static str { - match self { - CreateSubscriptionPaymentSettingsPaymentMethodOptionsAcssDebitVerificationMethod::Automatic => "automatic", - CreateSubscriptionPaymentSettingsPaymentMethodOptionsAcssDebitVerificationMethod::Instant => "instant", - CreateSubscriptionPaymentSettingsPaymentMethodOptionsAcssDebitVerificationMethod::Microdeposits => "microdeposits", - } - } -} - -impl AsRef - for CreateSubscriptionPaymentSettingsPaymentMethodOptionsAcssDebitVerificationMethod -{ - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display - for CreateSubscriptionPaymentSettingsPaymentMethodOptionsAcssDebitVerificationMethod -{ - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default - for CreateSubscriptionPaymentSettingsPaymentMethodOptionsAcssDebitVerificationMethod -{ - fn default() -> Self { - Self::Automatic - } -} - -/// An enum representing the possible values of an `CreateSubscriptionPaymentSettingsPaymentMethodOptionsBancontact`'s `preferred_language` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CreateSubscriptionPaymentSettingsPaymentMethodOptionsBancontactPreferredLanguage { - De, - En, - Fr, - Nl, -} - -impl CreateSubscriptionPaymentSettingsPaymentMethodOptionsBancontactPreferredLanguage { - pub fn as_str(self) -> &'static str { - match self { - CreateSubscriptionPaymentSettingsPaymentMethodOptionsBancontactPreferredLanguage::De => "de", - CreateSubscriptionPaymentSettingsPaymentMethodOptionsBancontactPreferredLanguage::En => "en", - CreateSubscriptionPaymentSettingsPaymentMethodOptionsBancontactPreferredLanguage::Fr => "fr", - CreateSubscriptionPaymentSettingsPaymentMethodOptionsBancontactPreferredLanguage::Nl => "nl", - } - } -} - -impl AsRef - for CreateSubscriptionPaymentSettingsPaymentMethodOptionsBancontactPreferredLanguage -{ - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display - for CreateSubscriptionPaymentSettingsPaymentMethodOptionsBancontactPreferredLanguage -{ - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default - for CreateSubscriptionPaymentSettingsPaymentMethodOptionsBancontactPreferredLanguage -{ - fn default() -> Self { - Self::De - } -} - -/// An enum representing the possible values of an `CreateSubscriptionPaymentSettingsPaymentMethodOptionsCardMandateOptions`'s `amount_type` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CreateSubscriptionPaymentSettingsPaymentMethodOptionsCardMandateOptionsAmountType { - Fixed, - Maximum, -} - -impl CreateSubscriptionPaymentSettingsPaymentMethodOptionsCardMandateOptionsAmountType { - pub fn as_str(self) -> &'static str { - match self { - CreateSubscriptionPaymentSettingsPaymentMethodOptionsCardMandateOptionsAmountType::Fixed => "fixed", - CreateSubscriptionPaymentSettingsPaymentMethodOptionsCardMandateOptionsAmountType::Maximum => "maximum", - } - } -} - -impl AsRef - for CreateSubscriptionPaymentSettingsPaymentMethodOptionsCardMandateOptionsAmountType -{ - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display - for CreateSubscriptionPaymentSettingsPaymentMethodOptionsCardMandateOptionsAmountType -{ - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default - for CreateSubscriptionPaymentSettingsPaymentMethodOptionsCardMandateOptionsAmountType -{ - fn default() -> Self { - Self::Fixed - } -} - -/// An enum representing the possible values of an `CreateSubscriptionPaymentSettingsPaymentMethodOptionsCard`'s `network` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CreateSubscriptionPaymentSettingsPaymentMethodOptionsCardNetwork { - Amex, - CartesBancaires, - Diners, - Discover, - EftposAu, - Interac, - Jcb, - Mastercard, - Unionpay, - Unknown, - Visa, -} - -impl CreateSubscriptionPaymentSettingsPaymentMethodOptionsCardNetwork { - pub fn as_str(self) -> &'static str { - match self { - CreateSubscriptionPaymentSettingsPaymentMethodOptionsCardNetwork::Amex => "amex", - CreateSubscriptionPaymentSettingsPaymentMethodOptionsCardNetwork::CartesBancaires => { - "cartes_bancaires" - } - CreateSubscriptionPaymentSettingsPaymentMethodOptionsCardNetwork::Diners => "diners", - CreateSubscriptionPaymentSettingsPaymentMethodOptionsCardNetwork::Discover => { - "discover" - } - CreateSubscriptionPaymentSettingsPaymentMethodOptionsCardNetwork::EftposAu => { - "eftpos_au" - } - CreateSubscriptionPaymentSettingsPaymentMethodOptionsCardNetwork::Interac => "interac", - CreateSubscriptionPaymentSettingsPaymentMethodOptionsCardNetwork::Jcb => "jcb", - CreateSubscriptionPaymentSettingsPaymentMethodOptionsCardNetwork::Mastercard => { - "mastercard" - } - CreateSubscriptionPaymentSettingsPaymentMethodOptionsCardNetwork::Unionpay => { - "unionpay" - } - CreateSubscriptionPaymentSettingsPaymentMethodOptionsCardNetwork::Unknown => "unknown", - CreateSubscriptionPaymentSettingsPaymentMethodOptionsCardNetwork::Visa => "visa", - } - } -} - -impl AsRef for CreateSubscriptionPaymentSettingsPaymentMethodOptionsCardNetwork { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for CreateSubscriptionPaymentSettingsPaymentMethodOptionsCardNetwork { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for CreateSubscriptionPaymentSettingsPaymentMethodOptionsCardNetwork { - fn default() -> Self { - Self::Amex - } -} - -/// An enum representing the possible values of an `CreateSubscriptionPaymentSettingsPaymentMethodOptionsCard`'s `request_three_d_secure` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CreateSubscriptionPaymentSettingsPaymentMethodOptionsCardRequestThreeDSecure { - Any, - Automatic, - Challenge, -} - -impl CreateSubscriptionPaymentSettingsPaymentMethodOptionsCardRequestThreeDSecure { - pub fn as_str(self) -> &'static str { - match self { - CreateSubscriptionPaymentSettingsPaymentMethodOptionsCardRequestThreeDSecure::Any => "any", - CreateSubscriptionPaymentSettingsPaymentMethodOptionsCardRequestThreeDSecure::Automatic => "automatic", - CreateSubscriptionPaymentSettingsPaymentMethodOptionsCardRequestThreeDSecure::Challenge => "challenge", - } - } -} - -impl AsRef for CreateSubscriptionPaymentSettingsPaymentMethodOptionsCardRequestThreeDSecure { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display - for CreateSubscriptionPaymentSettingsPaymentMethodOptionsCardRequestThreeDSecure -{ - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default - for CreateSubscriptionPaymentSettingsPaymentMethodOptionsCardRequestThreeDSecure -{ - fn default() -> Self { - Self::Any - } -} - -/// An enum representing the possible values of an `CreateSubscriptionPaymentSettingsPaymentMethodOptionsUsBankAccountFinancialConnections`'s `permissions` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CreateSubscriptionPaymentSettingsPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions -{ - Balances, - Ownership, - PaymentMethod, - Transactions, -} - -impl CreateSubscriptionPaymentSettingsPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions { - pub fn as_str(self) -> &'static str { - match self { - CreateSubscriptionPaymentSettingsPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions::Balances => "balances", - CreateSubscriptionPaymentSettingsPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions::Ownership => "ownership", - CreateSubscriptionPaymentSettingsPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions::PaymentMethod => "payment_method", - CreateSubscriptionPaymentSettingsPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions::Transactions => "transactions", - } - } -} - -impl AsRef for CreateSubscriptionPaymentSettingsPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for CreateSubscriptionPaymentSettingsPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for CreateSubscriptionPaymentSettingsPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions { - fn default() -> Self { - Self::Balances - } -} - -/// An enum representing the possible values of an `CreateSubscriptionPaymentSettingsPaymentMethodOptionsUsBankAccountFinancialConnections`'s `prefetch` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CreateSubscriptionPaymentSettingsPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch -{ - Balances, - Transactions, -} - -impl - CreateSubscriptionPaymentSettingsPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch -{ - pub fn as_str(self) -> &'static str { - match self { - CreateSubscriptionPaymentSettingsPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch::Balances => "balances", - CreateSubscriptionPaymentSettingsPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch::Transactions => "transactions", - } - } -} - -impl AsRef for CreateSubscriptionPaymentSettingsPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for CreateSubscriptionPaymentSettingsPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for CreateSubscriptionPaymentSettingsPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch { - fn default() -> Self { - Self::Balances - } -} - -/// An enum representing the possible values of an `CreateSubscriptionPaymentSettingsPaymentMethodOptionsUsBankAccount`'s `verification_method` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CreateSubscriptionPaymentSettingsPaymentMethodOptionsUsBankAccountVerificationMethod { - Automatic, - Instant, - Microdeposits, -} - -impl CreateSubscriptionPaymentSettingsPaymentMethodOptionsUsBankAccountVerificationMethod { - pub fn as_str(self) -> &'static str { - match self { - CreateSubscriptionPaymentSettingsPaymentMethodOptionsUsBankAccountVerificationMethod::Automatic => "automatic", - CreateSubscriptionPaymentSettingsPaymentMethodOptionsUsBankAccountVerificationMethod::Instant => "instant", - CreateSubscriptionPaymentSettingsPaymentMethodOptionsUsBankAccountVerificationMethod::Microdeposits => "microdeposits", - } - } -} - -impl AsRef - for CreateSubscriptionPaymentSettingsPaymentMethodOptionsUsBankAccountVerificationMethod -{ - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display - for CreateSubscriptionPaymentSettingsPaymentMethodOptionsUsBankAccountVerificationMethod -{ - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default - for CreateSubscriptionPaymentSettingsPaymentMethodOptionsUsBankAccountVerificationMethod -{ - fn default() -> Self { - Self::Automatic - } -} - -/// An enum representing the possible values of an `CreateSubscriptionPaymentSettings`'s `payment_method_types` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CreateSubscriptionPaymentSettingsPaymentMethodTypes { - AchCreditTransfer, - AchDebit, - AcssDebit, - AuBecsDebit, - BacsDebit, - Bancontact, - Boleto, - Card, - Cashapp, - CustomerBalance, - Eps, - Fpx, - Giropay, - Grabpay, - Ideal, - Konbini, - Link, - P24, - Paynow, - Paypal, - Promptpay, - SepaCreditTransfer, - SepaDebit, - Sofort, - UsBankAccount, - WechatPay, -} - -impl CreateSubscriptionPaymentSettingsPaymentMethodTypes { - pub fn as_str(self) -> &'static str { - match self { - CreateSubscriptionPaymentSettingsPaymentMethodTypes::AchCreditTransfer => { - "ach_credit_transfer" - } - CreateSubscriptionPaymentSettingsPaymentMethodTypes::AchDebit => "ach_debit", - CreateSubscriptionPaymentSettingsPaymentMethodTypes::AcssDebit => "acss_debit", - CreateSubscriptionPaymentSettingsPaymentMethodTypes::AuBecsDebit => "au_becs_debit", - CreateSubscriptionPaymentSettingsPaymentMethodTypes::BacsDebit => "bacs_debit", - CreateSubscriptionPaymentSettingsPaymentMethodTypes::Bancontact => "bancontact", - CreateSubscriptionPaymentSettingsPaymentMethodTypes::Boleto => "boleto", - CreateSubscriptionPaymentSettingsPaymentMethodTypes::Card => "card", - CreateSubscriptionPaymentSettingsPaymentMethodTypes::Cashapp => "cashapp", - CreateSubscriptionPaymentSettingsPaymentMethodTypes::CustomerBalance => { - "customer_balance" - } - CreateSubscriptionPaymentSettingsPaymentMethodTypes::Eps => "eps", - CreateSubscriptionPaymentSettingsPaymentMethodTypes::Fpx => "fpx", - CreateSubscriptionPaymentSettingsPaymentMethodTypes::Giropay => "giropay", - CreateSubscriptionPaymentSettingsPaymentMethodTypes::Grabpay => "grabpay", - CreateSubscriptionPaymentSettingsPaymentMethodTypes::Ideal => "ideal", - CreateSubscriptionPaymentSettingsPaymentMethodTypes::Konbini => "konbini", - CreateSubscriptionPaymentSettingsPaymentMethodTypes::Link => "link", - CreateSubscriptionPaymentSettingsPaymentMethodTypes::P24 => "p24", - CreateSubscriptionPaymentSettingsPaymentMethodTypes::Paynow => "paynow", - CreateSubscriptionPaymentSettingsPaymentMethodTypes::Paypal => "paypal", - CreateSubscriptionPaymentSettingsPaymentMethodTypes::Promptpay => "promptpay", - CreateSubscriptionPaymentSettingsPaymentMethodTypes::SepaCreditTransfer => { - "sepa_credit_transfer" - } - CreateSubscriptionPaymentSettingsPaymentMethodTypes::SepaDebit => "sepa_debit", - CreateSubscriptionPaymentSettingsPaymentMethodTypes::Sofort => "sofort", - CreateSubscriptionPaymentSettingsPaymentMethodTypes::UsBankAccount => "us_bank_account", - CreateSubscriptionPaymentSettingsPaymentMethodTypes::WechatPay => "wechat_pay", - } - } -} - -impl AsRef for CreateSubscriptionPaymentSettingsPaymentMethodTypes { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for CreateSubscriptionPaymentSettingsPaymentMethodTypes { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for CreateSubscriptionPaymentSettingsPaymentMethodTypes { - fn default() -> Self { - Self::AchCreditTransfer - } -} - -/// An enum representing the possible values of an `CreateSubscriptionPaymentSettings`'s `save_default_payment_method` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CreateSubscriptionPaymentSettingsSaveDefaultPaymentMethod { - Off, - OnSubscription, -} - -impl CreateSubscriptionPaymentSettingsSaveDefaultPaymentMethod { - pub fn as_str(self) -> &'static str { - match self { - CreateSubscriptionPaymentSettingsSaveDefaultPaymentMethod::Off => "off", - CreateSubscriptionPaymentSettingsSaveDefaultPaymentMethod::OnSubscription => { - "on_subscription" - } - } - } -} - -impl AsRef for CreateSubscriptionPaymentSettingsSaveDefaultPaymentMethod { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for CreateSubscriptionPaymentSettingsSaveDefaultPaymentMethod { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for CreateSubscriptionPaymentSettingsSaveDefaultPaymentMethod { - fn default() -> Self { - Self::Off - } -} - -/// An enum representing the possible values of an `CreateSubscriptionTrialSettingsEndBehavior`'s `missing_payment_method` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CreateSubscriptionTrialSettingsEndBehaviorMissingPaymentMethod { - Cancel, - CreateInvoice, - Pause, -} - -impl CreateSubscriptionTrialSettingsEndBehaviorMissingPaymentMethod { - pub fn as_str(self) -> &'static str { - match self { - CreateSubscriptionTrialSettingsEndBehaviorMissingPaymentMethod::Cancel => "cancel", - CreateSubscriptionTrialSettingsEndBehaviorMissingPaymentMethod::CreateInvoice => { - "create_invoice" - } - CreateSubscriptionTrialSettingsEndBehaviorMissingPaymentMethod::Pause => "pause", - } - } -} - -impl AsRef for CreateSubscriptionTrialSettingsEndBehaviorMissingPaymentMethod { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for CreateSubscriptionTrialSettingsEndBehaviorMissingPaymentMethod { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for CreateSubscriptionTrialSettingsEndBehaviorMissingPaymentMethod { - fn default() -> Self { - Self::Cancel - } -} - -/// An enum representing the possible values of an `InvoiceItemPriceData`'s `tax_behavior` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum InvoiceItemPriceDataTaxBehavior { - Exclusive, - Inclusive, - Unspecified, -} - -impl InvoiceItemPriceDataTaxBehavior { - pub fn as_str(self) -> &'static str { - match self { - InvoiceItemPriceDataTaxBehavior::Exclusive => "exclusive", - InvoiceItemPriceDataTaxBehavior::Inclusive => "inclusive", - InvoiceItemPriceDataTaxBehavior::Unspecified => "unspecified", - } - } -} - -impl AsRef for InvoiceItemPriceDataTaxBehavior { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for InvoiceItemPriceDataTaxBehavior { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for InvoiceItemPriceDataTaxBehavior { - fn default() -> Self { - Self::Exclusive - } -} - -/// An enum representing the possible values of an `InvoiceMandateOptionsCard`'s `amount_type` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum InvoiceMandateOptionsCardAmountType { - Fixed, - Maximum, -} - -impl InvoiceMandateOptionsCardAmountType { - pub fn as_str(self) -> &'static str { - match self { - InvoiceMandateOptionsCardAmountType::Fixed => "fixed", - InvoiceMandateOptionsCardAmountType::Maximum => "maximum", - } - } -} - -impl AsRef for InvoiceMandateOptionsCardAmountType { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for InvoiceMandateOptionsCardAmountType { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for InvoiceMandateOptionsCardAmountType { - fn default() -> Self { - Self::Fixed - } -} - -/// An enum representing the possible values of an `SubscriptionPendingInvoiceItemInterval`'s `interval` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum PlanInterval { - Day, - Month, - Week, - Year, -} - -impl PlanInterval { - pub fn as_str(self) -> &'static str { - match self { - PlanInterval::Day => "day", - PlanInterval::Month => "month", - PlanInterval::Week => "week", - PlanInterval::Year => "year", - } - } -} - -impl AsRef for PlanInterval { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for PlanInterval { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for PlanInterval { - fn default() -> Self { - Self::Day - } -} - -/// An enum representing the possible values of an `UpdateSubscription`'s `billing_cycle_anchor` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum SubscriptionBillingCycleAnchor { - Now, - Unchanged, -} - -impl SubscriptionBillingCycleAnchor { - pub fn as_str(self) -> &'static str { - match self { - SubscriptionBillingCycleAnchor::Now => "now", - SubscriptionBillingCycleAnchor::Unchanged => "unchanged", - } - } -} - -impl AsRef for SubscriptionBillingCycleAnchor { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for SubscriptionBillingCycleAnchor { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for SubscriptionBillingCycleAnchor { - fn default() -> Self { - Self::Now - } -} - -/// An enum representing the possible values of an `SubscriptionItemPriceData`'s `tax_behavior` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum SubscriptionItemPriceDataTaxBehavior { - Exclusive, - Inclusive, - Unspecified, -} - -impl SubscriptionItemPriceDataTaxBehavior { - pub fn as_str(self) -> &'static str { - match self { - SubscriptionItemPriceDataTaxBehavior::Exclusive => "exclusive", - SubscriptionItemPriceDataTaxBehavior::Inclusive => "inclusive", - SubscriptionItemPriceDataTaxBehavior::Unspecified => "unspecified", - } - } -} - -impl AsRef for SubscriptionItemPriceDataTaxBehavior { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for SubscriptionItemPriceDataTaxBehavior { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for SubscriptionItemPriceDataTaxBehavior { - fn default() -> Self { - Self::Exclusive - } -} - -/// An enum representing the possible values of an `CreateSubscription`'s `payment_behavior` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum SubscriptionPaymentBehavior { - AllowIncomplete, - DefaultIncomplete, - ErrorIfIncomplete, - PendingIfIncomplete, -} - -impl SubscriptionPaymentBehavior { - pub fn as_str(self) -> &'static str { - match self { - SubscriptionPaymentBehavior::AllowIncomplete => "allow_incomplete", - SubscriptionPaymentBehavior::DefaultIncomplete => "default_incomplete", - SubscriptionPaymentBehavior::ErrorIfIncomplete => "error_if_incomplete", - SubscriptionPaymentBehavior::PendingIfIncomplete => "pending_if_incomplete", - } - } -} - -impl AsRef for SubscriptionPaymentBehavior { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for SubscriptionPaymentBehavior { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for SubscriptionPaymentBehavior { - fn default() -> Self { - Self::AllowIncomplete - } -} - -/// An enum representing the possible values of an `SubscriptionPaymentMethodOptionsCard`'s `network` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum SubscriptionPaymentMethodOptionsCardNetwork { - Amex, - CartesBancaires, - Diners, - Discover, - EftposAu, - Interac, - Jcb, - Mastercard, - Unionpay, - Unknown, - Visa, -} - -impl SubscriptionPaymentMethodOptionsCardNetwork { - pub fn as_str(self) -> &'static str { - match self { - SubscriptionPaymentMethodOptionsCardNetwork::Amex => "amex", - SubscriptionPaymentMethodOptionsCardNetwork::CartesBancaires => "cartes_bancaires", - SubscriptionPaymentMethodOptionsCardNetwork::Diners => "diners", - SubscriptionPaymentMethodOptionsCardNetwork::Discover => "discover", - SubscriptionPaymentMethodOptionsCardNetwork::EftposAu => "eftpos_au", - SubscriptionPaymentMethodOptionsCardNetwork::Interac => "interac", - SubscriptionPaymentMethodOptionsCardNetwork::Jcb => "jcb", - SubscriptionPaymentMethodOptionsCardNetwork::Mastercard => "mastercard", - SubscriptionPaymentMethodOptionsCardNetwork::Unionpay => "unionpay", - SubscriptionPaymentMethodOptionsCardNetwork::Unknown => "unknown", - SubscriptionPaymentMethodOptionsCardNetwork::Visa => "visa", - } - } -} - -impl AsRef for SubscriptionPaymentMethodOptionsCardNetwork { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for SubscriptionPaymentMethodOptionsCardNetwork { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for SubscriptionPaymentMethodOptionsCardNetwork { - fn default() -> Self { - Self::Amex - } -} - -/// An enum representing the possible values of an `SubscriptionPaymentMethodOptionsCard`'s `request_three_d_secure` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum SubscriptionPaymentMethodOptionsCardRequestThreeDSecure { - Any, - Automatic, - Challenge, -} - -impl SubscriptionPaymentMethodOptionsCardRequestThreeDSecure { - pub fn as_str(self) -> &'static str { - match self { - SubscriptionPaymentMethodOptionsCardRequestThreeDSecure::Any => "any", - SubscriptionPaymentMethodOptionsCardRequestThreeDSecure::Automatic => "automatic", - SubscriptionPaymentMethodOptionsCardRequestThreeDSecure::Challenge => "challenge", - } - } -} - -impl AsRef for SubscriptionPaymentMethodOptionsCardRequestThreeDSecure { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for SubscriptionPaymentMethodOptionsCardRequestThreeDSecure { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for SubscriptionPaymentMethodOptionsCardRequestThreeDSecure { - fn default() -> Self { - Self::Any - } -} - -/// An enum representing the possible values of an `CreateSubscription`'s `proration_behavior` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum SubscriptionProrationBehavior { - AlwaysInvoice, - CreateProrations, - None, -} - -impl SubscriptionProrationBehavior { - pub fn as_str(self) -> &'static str { - match self { - SubscriptionProrationBehavior::AlwaysInvoice => "always_invoice", - SubscriptionProrationBehavior::CreateProrations => "create_prorations", - SubscriptionProrationBehavior::None => "none", - } - } -} - -impl AsRef for SubscriptionProrationBehavior { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for SubscriptionProrationBehavior { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for SubscriptionProrationBehavior { - fn default() -> Self { - Self::AlwaysInvoice - } -} - -/// An enum representing the possible values of an `Subscription`'s `status` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum SubscriptionStatus { - Active, - Canceled, - Incomplete, - IncompleteExpired, - PastDue, - Paused, - Trialing, - Unpaid, -} - -impl SubscriptionStatus { - pub fn as_str(self) -> &'static str { - match self { - SubscriptionStatus::Active => "active", - SubscriptionStatus::Canceled => "canceled", - SubscriptionStatus::Incomplete => "incomplete", - SubscriptionStatus::IncompleteExpired => "incomplete_expired", - SubscriptionStatus::PastDue => "past_due", - SubscriptionStatus::Paused => "paused", - SubscriptionStatus::Trialing => "trialing", - SubscriptionStatus::Unpaid => "unpaid", - } - } -} - -impl AsRef for SubscriptionStatus { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for SubscriptionStatus { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for SubscriptionStatus { - fn default() -> Self { - Self::Active - } -} - -/// An enum representing the possible values of an `ListSubscriptions`'s `status` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum SubscriptionStatusFilter { - Active, - All, - Canceled, - Ended, - Incomplete, - IncompleteExpired, - PastDue, - Paused, - Trialing, - Unpaid, -} - -impl SubscriptionStatusFilter { - pub fn as_str(self) -> &'static str { - match self { - SubscriptionStatusFilter::Active => "active", - SubscriptionStatusFilter::All => "all", - SubscriptionStatusFilter::Canceled => "canceled", - SubscriptionStatusFilter::Ended => "ended", - SubscriptionStatusFilter::Incomplete => "incomplete", - SubscriptionStatusFilter::IncompleteExpired => "incomplete_expired", - SubscriptionStatusFilter::PastDue => "past_due", - SubscriptionStatusFilter::Paused => "paused", - SubscriptionStatusFilter::Trialing => "trialing", - SubscriptionStatusFilter::Unpaid => "unpaid", - } - } -} - -impl AsRef for SubscriptionStatusFilter { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for SubscriptionStatusFilter { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for SubscriptionStatusFilter { - fn default() -> Self { - Self::Active - } -} - -/// An enum representing the possible values of an `SubscriptionsResourcePauseCollection`'s `behavior` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum SubscriptionsResourcePauseCollectionBehavior { - KeepAsDraft, - MarkUncollectible, - Void, -} - -impl SubscriptionsResourcePauseCollectionBehavior { - pub fn as_str(self) -> &'static str { - match self { - SubscriptionsResourcePauseCollectionBehavior::KeepAsDraft => "keep_as_draft", - SubscriptionsResourcePauseCollectionBehavior::MarkUncollectible => "mark_uncollectible", - SubscriptionsResourcePauseCollectionBehavior::Void => "void", - } - } -} - -impl AsRef for SubscriptionsResourcePauseCollectionBehavior { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for SubscriptionsResourcePauseCollectionBehavior { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for SubscriptionsResourcePauseCollectionBehavior { - fn default() -> Self { - Self::KeepAsDraft - } -} - -/// An enum representing the possible values of an `SubscriptionsResourcePaymentSettings`'s `payment_method_types` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum SubscriptionsResourcePaymentSettingsPaymentMethodTypes { - AchCreditTransfer, - AchDebit, - AcssDebit, - AuBecsDebit, - BacsDebit, - Bancontact, - Boleto, - Card, - Cashapp, - CustomerBalance, - Eps, - Fpx, - Giropay, - Grabpay, - Ideal, - Konbini, - Link, - P24, - Paynow, - Paypal, - Promptpay, - SepaCreditTransfer, - SepaDebit, - Sofort, - UsBankAccount, - WechatPay, -} - -impl SubscriptionsResourcePaymentSettingsPaymentMethodTypes { - pub fn as_str(self) -> &'static str { - match self { - SubscriptionsResourcePaymentSettingsPaymentMethodTypes::AchCreditTransfer => { - "ach_credit_transfer" - } - SubscriptionsResourcePaymentSettingsPaymentMethodTypes::AchDebit => "ach_debit", - SubscriptionsResourcePaymentSettingsPaymentMethodTypes::AcssDebit => "acss_debit", - SubscriptionsResourcePaymentSettingsPaymentMethodTypes::AuBecsDebit => "au_becs_debit", - SubscriptionsResourcePaymentSettingsPaymentMethodTypes::BacsDebit => "bacs_debit", - SubscriptionsResourcePaymentSettingsPaymentMethodTypes::Bancontact => "bancontact", - SubscriptionsResourcePaymentSettingsPaymentMethodTypes::Boleto => "boleto", - SubscriptionsResourcePaymentSettingsPaymentMethodTypes::Card => "card", - SubscriptionsResourcePaymentSettingsPaymentMethodTypes::Cashapp => "cashapp", - SubscriptionsResourcePaymentSettingsPaymentMethodTypes::CustomerBalance => { - "customer_balance" - } - SubscriptionsResourcePaymentSettingsPaymentMethodTypes::Eps => "eps", - SubscriptionsResourcePaymentSettingsPaymentMethodTypes::Fpx => "fpx", - SubscriptionsResourcePaymentSettingsPaymentMethodTypes::Giropay => "giropay", - SubscriptionsResourcePaymentSettingsPaymentMethodTypes::Grabpay => "grabpay", - SubscriptionsResourcePaymentSettingsPaymentMethodTypes::Ideal => "ideal", - SubscriptionsResourcePaymentSettingsPaymentMethodTypes::Konbini => "konbini", - SubscriptionsResourcePaymentSettingsPaymentMethodTypes::Link => "link", - SubscriptionsResourcePaymentSettingsPaymentMethodTypes::P24 => "p24", - SubscriptionsResourcePaymentSettingsPaymentMethodTypes::Paynow => "paynow", - SubscriptionsResourcePaymentSettingsPaymentMethodTypes::Paypal => "paypal", - SubscriptionsResourcePaymentSettingsPaymentMethodTypes::Promptpay => "promptpay", - SubscriptionsResourcePaymentSettingsPaymentMethodTypes::SepaCreditTransfer => { - "sepa_credit_transfer" - } - SubscriptionsResourcePaymentSettingsPaymentMethodTypes::SepaDebit => "sepa_debit", - SubscriptionsResourcePaymentSettingsPaymentMethodTypes::Sofort => "sofort", - SubscriptionsResourcePaymentSettingsPaymentMethodTypes::UsBankAccount => { - "us_bank_account" - } - SubscriptionsResourcePaymentSettingsPaymentMethodTypes::WechatPay => "wechat_pay", - } - } -} - -impl AsRef for SubscriptionsResourcePaymentSettingsPaymentMethodTypes { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for SubscriptionsResourcePaymentSettingsPaymentMethodTypes { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for SubscriptionsResourcePaymentSettingsPaymentMethodTypes { - fn default() -> Self { - Self::AchCreditTransfer - } -} - -/// An enum representing the possible values of an `SubscriptionsResourcePaymentSettings`'s `save_default_payment_method` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum SubscriptionsResourcePaymentSettingsSaveDefaultPaymentMethod { - Off, - OnSubscription, -} - -impl SubscriptionsResourcePaymentSettingsSaveDefaultPaymentMethod { - pub fn as_str(self) -> &'static str { - match self { - SubscriptionsResourcePaymentSettingsSaveDefaultPaymentMethod::Off => "off", - SubscriptionsResourcePaymentSettingsSaveDefaultPaymentMethod::OnSubscription => { - "on_subscription" - } - } - } -} - -impl AsRef for SubscriptionsResourcePaymentSettingsSaveDefaultPaymentMethod { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for SubscriptionsResourcePaymentSettingsSaveDefaultPaymentMethod { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for SubscriptionsResourcePaymentSettingsSaveDefaultPaymentMethod { - fn default() -> Self { - Self::Off - } -} - -/// An enum representing the possible values of an `UpdateSubscriptionAutomaticTaxLiability`'s `type` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum UpdateSubscriptionAutomaticTaxLiabilityType { - Account, - #[serde(rename = "self")] - Self_, -} - -impl UpdateSubscriptionAutomaticTaxLiabilityType { - pub fn as_str(self) -> &'static str { - match self { - UpdateSubscriptionAutomaticTaxLiabilityType::Account => "account", - UpdateSubscriptionAutomaticTaxLiabilityType::Self_ => "self", - } - } -} - -impl AsRef for UpdateSubscriptionAutomaticTaxLiabilityType { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for UpdateSubscriptionAutomaticTaxLiabilityType { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for UpdateSubscriptionAutomaticTaxLiabilityType { - fn default() -> Self { - Self::Account - } -} - -/// An enum representing the possible values of an `UpdateSubscriptionCancellationDetails`'s `feedback` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum UpdateSubscriptionCancellationDetailsFeedback { - CustomerService, - LowQuality, - MissingFeatures, - Other, - SwitchedService, - TooComplex, - TooExpensive, - Unused, -} - -impl UpdateSubscriptionCancellationDetailsFeedback { - pub fn as_str(self) -> &'static str { - match self { - UpdateSubscriptionCancellationDetailsFeedback::CustomerService => "customer_service", - UpdateSubscriptionCancellationDetailsFeedback::LowQuality => "low_quality", - UpdateSubscriptionCancellationDetailsFeedback::MissingFeatures => "missing_features", - UpdateSubscriptionCancellationDetailsFeedback::Other => "other", - UpdateSubscriptionCancellationDetailsFeedback::SwitchedService => "switched_service", - UpdateSubscriptionCancellationDetailsFeedback::TooComplex => "too_complex", - UpdateSubscriptionCancellationDetailsFeedback::TooExpensive => "too_expensive", - UpdateSubscriptionCancellationDetailsFeedback::Unused => "unused", - } - } -} - -impl AsRef for UpdateSubscriptionCancellationDetailsFeedback { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for UpdateSubscriptionCancellationDetailsFeedback { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for UpdateSubscriptionCancellationDetailsFeedback { - fn default() -> Self { - Self::CustomerService - } -} - -/// An enum representing the possible values of an `UpdateSubscriptionInvoiceSettingsIssuer`'s `type` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum UpdateSubscriptionInvoiceSettingsIssuerType { - Account, - #[serde(rename = "self")] - Self_, -} - -impl UpdateSubscriptionInvoiceSettingsIssuerType { - pub fn as_str(self) -> &'static str { - match self { - UpdateSubscriptionInvoiceSettingsIssuerType::Account => "account", - UpdateSubscriptionInvoiceSettingsIssuerType::Self_ => "self", - } - } -} - -impl AsRef for UpdateSubscriptionInvoiceSettingsIssuerType { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for UpdateSubscriptionInvoiceSettingsIssuerType { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for UpdateSubscriptionInvoiceSettingsIssuerType { - fn default() -> Self { - Self::Account - } -} - -/// An enum representing the possible values of an `UpdateSubscriptionPauseCollection`'s `behavior` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum UpdateSubscriptionPauseCollectionBehavior { - KeepAsDraft, - MarkUncollectible, - Void, -} - -impl UpdateSubscriptionPauseCollectionBehavior { - pub fn as_str(self) -> &'static str { - match self { - UpdateSubscriptionPauseCollectionBehavior::KeepAsDraft => "keep_as_draft", - UpdateSubscriptionPauseCollectionBehavior::MarkUncollectible => "mark_uncollectible", - UpdateSubscriptionPauseCollectionBehavior::Void => "void", - } - } -} - -impl AsRef for UpdateSubscriptionPauseCollectionBehavior { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for UpdateSubscriptionPauseCollectionBehavior { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for UpdateSubscriptionPauseCollectionBehavior { - fn default() -> Self { - Self::KeepAsDraft - } -} - -/// An enum representing the possible values of an `UpdateSubscriptionPaymentSettingsPaymentMethodOptionsAcssDebitMandateOptions`'s `transaction_type` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum UpdateSubscriptionPaymentSettingsPaymentMethodOptionsAcssDebitMandateOptionsTransactionType -{ - Business, - Personal, -} - -impl UpdateSubscriptionPaymentSettingsPaymentMethodOptionsAcssDebitMandateOptionsTransactionType { - pub fn as_str(self) -> &'static str { - match self { - UpdateSubscriptionPaymentSettingsPaymentMethodOptionsAcssDebitMandateOptionsTransactionType::Business => "business", - UpdateSubscriptionPaymentSettingsPaymentMethodOptionsAcssDebitMandateOptionsTransactionType::Personal => "personal", - } - } -} - -impl AsRef - for UpdateSubscriptionPaymentSettingsPaymentMethodOptionsAcssDebitMandateOptionsTransactionType -{ - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display - for UpdateSubscriptionPaymentSettingsPaymentMethodOptionsAcssDebitMandateOptionsTransactionType -{ - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default - for UpdateSubscriptionPaymentSettingsPaymentMethodOptionsAcssDebitMandateOptionsTransactionType -{ - fn default() -> Self { - Self::Business - } -} - -/// An enum representing the possible values of an `UpdateSubscriptionPaymentSettingsPaymentMethodOptionsAcssDebit`'s `verification_method` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum UpdateSubscriptionPaymentSettingsPaymentMethodOptionsAcssDebitVerificationMethod { - Automatic, - Instant, - Microdeposits, -} - -impl UpdateSubscriptionPaymentSettingsPaymentMethodOptionsAcssDebitVerificationMethod { - pub fn as_str(self) -> &'static str { - match self { - UpdateSubscriptionPaymentSettingsPaymentMethodOptionsAcssDebitVerificationMethod::Automatic => "automatic", - UpdateSubscriptionPaymentSettingsPaymentMethodOptionsAcssDebitVerificationMethod::Instant => "instant", - UpdateSubscriptionPaymentSettingsPaymentMethodOptionsAcssDebitVerificationMethod::Microdeposits => "microdeposits", - } - } -} - -impl AsRef - for UpdateSubscriptionPaymentSettingsPaymentMethodOptionsAcssDebitVerificationMethod -{ - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display - for UpdateSubscriptionPaymentSettingsPaymentMethodOptionsAcssDebitVerificationMethod -{ - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default - for UpdateSubscriptionPaymentSettingsPaymentMethodOptionsAcssDebitVerificationMethod -{ - fn default() -> Self { - Self::Automatic - } -} - -/// An enum representing the possible values of an `UpdateSubscriptionPaymentSettingsPaymentMethodOptionsBancontact`'s `preferred_language` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum UpdateSubscriptionPaymentSettingsPaymentMethodOptionsBancontactPreferredLanguage { - De, - En, - Fr, - Nl, -} - -impl UpdateSubscriptionPaymentSettingsPaymentMethodOptionsBancontactPreferredLanguage { - pub fn as_str(self) -> &'static str { - match self { - UpdateSubscriptionPaymentSettingsPaymentMethodOptionsBancontactPreferredLanguage::De => "de", - UpdateSubscriptionPaymentSettingsPaymentMethodOptionsBancontactPreferredLanguage::En => "en", - UpdateSubscriptionPaymentSettingsPaymentMethodOptionsBancontactPreferredLanguage::Fr => "fr", - UpdateSubscriptionPaymentSettingsPaymentMethodOptionsBancontactPreferredLanguage::Nl => "nl", - } - } -} - -impl AsRef - for UpdateSubscriptionPaymentSettingsPaymentMethodOptionsBancontactPreferredLanguage -{ - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display - for UpdateSubscriptionPaymentSettingsPaymentMethodOptionsBancontactPreferredLanguage -{ - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default - for UpdateSubscriptionPaymentSettingsPaymentMethodOptionsBancontactPreferredLanguage -{ - fn default() -> Self { - Self::De - } -} - -/// An enum representing the possible values of an `UpdateSubscriptionPaymentSettingsPaymentMethodOptionsCardMandateOptions`'s `amount_type` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum UpdateSubscriptionPaymentSettingsPaymentMethodOptionsCardMandateOptionsAmountType { - Fixed, - Maximum, -} - -impl UpdateSubscriptionPaymentSettingsPaymentMethodOptionsCardMandateOptionsAmountType { - pub fn as_str(self) -> &'static str { - match self { - UpdateSubscriptionPaymentSettingsPaymentMethodOptionsCardMandateOptionsAmountType::Fixed => "fixed", - UpdateSubscriptionPaymentSettingsPaymentMethodOptionsCardMandateOptionsAmountType::Maximum => "maximum", - } - } -} - -impl AsRef - for UpdateSubscriptionPaymentSettingsPaymentMethodOptionsCardMandateOptionsAmountType -{ - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display - for UpdateSubscriptionPaymentSettingsPaymentMethodOptionsCardMandateOptionsAmountType -{ - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default - for UpdateSubscriptionPaymentSettingsPaymentMethodOptionsCardMandateOptionsAmountType -{ - fn default() -> Self { - Self::Fixed - } -} - -/// An enum representing the possible values of an `UpdateSubscriptionPaymentSettingsPaymentMethodOptionsCard`'s `network` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum UpdateSubscriptionPaymentSettingsPaymentMethodOptionsCardNetwork { - Amex, - CartesBancaires, - Diners, - Discover, - EftposAu, - Interac, - Jcb, - Mastercard, - Unionpay, - Unknown, - Visa, -} - -impl UpdateSubscriptionPaymentSettingsPaymentMethodOptionsCardNetwork { - pub fn as_str(self) -> &'static str { - match self { - UpdateSubscriptionPaymentSettingsPaymentMethodOptionsCardNetwork::Amex => "amex", - UpdateSubscriptionPaymentSettingsPaymentMethodOptionsCardNetwork::CartesBancaires => { - "cartes_bancaires" - } - UpdateSubscriptionPaymentSettingsPaymentMethodOptionsCardNetwork::Diners => "diners", - UpdateSubscriptionPaymentSettingsPaymentMethodOptionsCardNetwork::Discover => { - "discover" - } - UpdateSubscriptionPaymentSettingsPaymentMethodOptionsCardNetwork::EftposAu => { - "eftpos_au" - } - UpdateSubscriptionPaymentSettingsPaymentMethodOptionsCardNetwork::Interac => "interac", - UpdateSubscriptionPaymentSettingsPaymentMethodOptionsCardNetwork::Jcb => "jcb", - UpdateSubscriptionPaymentSettingsPaymentMethodOptionsCardNetwork::Mastercard => { - "mastercard" - } - UpdateSubscriptionPaymentSettingsPaymentMethodOptionsCardNetwork::Unionpay => { - "unionpay" - } - UpdateSubscriptionPaymentSettingsPaymentMethodOptionsCardNetwork::Unknown => "unknown", - UpdateSubscriptionPaymentSettingsPaymentMethodOptionsCardNetwork::Visa => "visa", - } - } -} - -impl AsRef for UpdateSubscriptionPaymentSettingsPaymentMethodOptionsCardNetwork { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for UpdateSubscriptionPaymentSettingsPaymentMethodOptionsCardNetwork { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for UpdateSubscriptionPaymentSettingsPaymentMethodOptionsCardNetwork { - fn default() -> Self { - Self::Amex - } -} - -/// An enum representing the possible values of an `UpdateSubscriptionPaymentSettingsPaymentMethodOptionsCard`'s `request_three_d_secure` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum UpdateSubscriptionPaymentSettingsPaymentMethodOptionsCardRequestThreeDSecure { - Any, - Automatic, - Challenge, -} - -impl UpdateSubscriptionPaymentSettingsPaymentMethodOptionsCardRequestThreeDSecure { - pub fn as_str(self) -> &'static str { - match self { - UpdateSubscriptionPaymentSettingsPaymentMethodOptionsCardRequestThreeDSecure::Any => "any", - UpdateSubscriptionPaymentSettingsPaymentMethodOptionsCardRequestThreeDSecure::Automatic => "automatic", - UpdateSubscriptionPaymentSettingsPaymentMethodOptionsCardRequestThreeDSecure::Challenge => "challenge", - } - } -} - -impl AsRef for UpdateSubscriptionPaymentSettingsPaymentMethodOptionsCardRequestThreeDSecure { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display - for UpdateSubscriptionPaymentSettingsPaymentMethodOptionsCardRequestThreeDSecure -{ - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default - for UpdateSubscriptionPaymentSettingsPaymentMethodOptionsCardRequestThreeDSecure -{ - fn default() -> Self { - Self::Any - } -} - -/// An enum representing the possible values of an `UpdateSubscriptionPaymentSettingsPaymentMethodOptionsUsBankAccountFinancialConnections`'s `permissions` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum UpdateSubscriptionPaymentSettingsPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions -{ - Balances, - Ownership, - PaymentMethod, - Transactions, -} - -impl UpdateSubscriptionPaymentSettingsPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions { - pub fn as_str(self) -> &'static str { - match self { - UpdateSubscriptionPaymentSettingsPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions::Balances => "balances", - UpdateSubscriptionPaymentSettingsPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions::Ownership => "ownership", - UpdateSubscriptionPaymentSettingsPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions::PaymentMethod => "payment_method", - UpdateSubscriptionPaymentSettingsPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions::Transactions => "transactions", - } - } -} - -impl AsRef for UpdateSubscriptionPaymentSettingsPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for UpdateSubscriptionPaymentSettingsPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for UpdateSubscriptionPaymentSettingsPaymentMethodOptionsUsBankAccountFinancialConnectionsPermissions { - fn default() -> Self { - Self::Balances - } -} - -/// An enum representing the possible values of an `UpdateSubscriptionPaymentSettingsPaymentMethodOptionsUsBankAccountFinancialConnections`'s `prefetch` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum UpdateSubscriptionPaymentSettingsPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch -{ - Balances, - Transactions, -} - -impl - UpdateSubscriptionPaymentSettingsPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch -{ - pub fn as_str(self) -> &'static str { - match self { - UpdateSubscriptionPaymentSettingsPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch::Balances => "balances", - UpdateSubscriptionPaymentSettingsPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch::Transactions => "transactions", - } - } -} - -impl AsRef for UpdateSubscriptionPaymentSettingsPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for UpdateSubscriptionPaymentSettingsPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for UpdateSubscriptionPaymentSettingsPaymentMethodOptionsUsBankAccountFinancialConnectionsPrefetch { - fn default() -> Self { - Self::Balances - } -} - -/// An enum representing the possible values of an `UpdateSubscriptionPaymentSettingsPaymentMethodOptionsUsBankAccount`'s `verification_method` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum UpdateSubscriptionPaymentSettingsPaymentMethodOptionsUsBankAccountVerificationMethod { - Automatic, - Instant, - Microdeposits, -} - -impl UpdateSubscriptionPaymentSettingsPaymentMethodOptionsUsBankAccountVerificationMethod { - pub fn as_str(self) -> &'static str { - match self { - UpdateSubscriptionPaymentSettingsPaymentMethodOptionsUsBankAccountVerificationMethod::Automatic => "automatic", - UpdateSubscriptionPaymentSettingsPaymentMethodOptionsUsBankAccountVerificationMethod::Instant => "instant", - UpdateSubscriptionPaymentSettingsPaymentMethodOptionsUsBankAccountVerificationMethod::Microdeposits => "microdeposits", - } - } -} - -impl AsRef - for UpdateSubscriptionPaymentSettingsPaymentMethodOptionsUsBankAccountVerificationMethod -{ - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display - for UpdateSubscriptionPaymentSettingsPaymentMethodOptionsUsBankAccountVerificationMethod -{ - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default - for UpdateSubscriptionPaymentSettingsPaymentMethodOptionsUsBankAccountVerificationMethod -{ - fn default() -> Self { - Self::Automatic - } -} - -/// An enum representing the possible values of an `UpdateSubscriptionPaymentSettings`'s `payment_method_types` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum UpdateSubscriptionPaymentSettingsPaymentMethodTypes { - AchCreditTransfer, - AchDebit, - AcssDebit, - AuBecsDebit, - BacsDebit, - Bancontact, - Boleto, - Card, - Cashapp, - CustomerBalance, - Eps, - Fpx, - Giropay, - Grabpay, - Ideal, - Konbini, - Link, - P24, - Paynow, - Paypal, - Promptpay, - SepaCreditTransfer, - SepaDebit, - Sofort, - UsBankAccount, - WechatPay, -} - -impl UpdateSubscriptionPaymentSettingsPaymentMethodTypes { - pub fn as_str(self) -> &'static str { - match self { - UpdateSubscriptionPaymentSettingsPaymentMethodTypes::AchCreditTransfer => { - "ach_credit_transfer" - } - UpdateSubscriptionPaymentSettingsPaymentMethodTypes::AchDebit => "ach_debit", - UpdateSubscriptionPaymentSettingsPaymentMethodTypes::AcssDebit => "acss_debit", - UpdateSubscriptionPaymentSettingsPaymentMethodTypes::AuBecsDebit => "au_becs_debit", - UpdateSubscriptionPaymentSettingsPaymentMethodTypes::BacsDebit => "bacs_debit", - UpdateSubscriptionPaymentSettingsPaymentMethodTypes::Bancontact => "bancontact", - UpdateSubscriptionPaymentSettingsPaymentMethodTypes::Boleto => "boleto", - UpdateSubscriptionPaymentSettingsPaymentMethodTypes::Card => "card", - UpdateSubscriptionPaymentSettingsPaymentMethodTypes::Cashapp => "cashapp", - UpdateSubscriptionPaymentSettingsPaymentMethodTypes::CustomerBalance => { - "customer_balance" - } - UpdateSubscriptionPaymentSettingsPaymentMethodTypes::Eps => "eps", - UpdateSubscriptionPaymentSettingsPaymentMethodTypes::Fpx => "fpx", - UpdateSubscriptionPaymentSettingsPaymentMethodTypes::Giropay => "giropay", - UpdateSubscriptionPaymentSettingsPaymentMethodTypes::Grabpay => "grabpay", - UpdateSubscriptionPaymentSettingsPaymentMethodTypes::Ideal => "ideal", - UpdateSubscriptionPaymentSettingsPaymentMethodTypes::Konbini => "konbini", - UpdateSubscriptionPaymentSettingsPaymentMethodTypes::Link => "link", - UpdateSubscriptionPaymentSettingsPaymentMethodTypes::P24 => "p24", - UpdateSubscriptionPaymentSettingsPaymentMethodTypes::Paynow => "paynow", - UpdateSubscriptionPaymentSettingsPaymentMethodTypes::Paypal => "paypal", - UpdateSubscriptionPaymentSettingsPaymentMethodTypes::Promptpay => "promptpay", - UpdateSubscriptionPaymentSettingsPaymentMethodTypes::SepaCreditTransfer => { - "sepa_credit_transfer" - } - UpdateSubscriptionPaymentSettingsPaymentMethodTypes::SepaDebit => "sepa_debit", - UpdateSubscriptionPaymentSettingsPaymentMethodTypes::Sofort => "sofort", - UpdateSubscriptionPaymentSettingsPaymentMethodTypes::UsBankAccount => "us_bank_account", - UpdateSubscriptionPaymentSettingsPaymentMethodTypes::WechatPay => "wechat_pay", - } - } -} - -impl AsRef for UpdateSubscriptionPaymentSettingsPaymentMethodTypes { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for UpdateSubscriptionPaymentSettingsPaymentMethodTypes { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for UpdateSubscriptionPaymentSettingsPaymentMethodTypes { - fn default() -> Self { - Self::AchCreditTransfer - } -} - -/// An enum representing the possible values of an `UpdateSubscriptionPaymentSettings`'s `save_default_payment_method` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum UpdateSubscriptionPaymentSettingsSaveDefaultPaymentMethod { - Off, - OnSubscription, -} - -impl UpdateSubscriptionPaymentSettingsSaveDefaultPaymentMethod { - pub fn as_str(self) -> &'static str { - match self { - UpdateSubscriptionPaymentSettingsSaveDefaultPaymentMethod::Off => "off", - UpdateSubscriptionPaymentSettingsSaveDefaultPaymentMethod::OnSubscription => { - "on_subscription" - } - } - } -} - -impl AsRef for UpdateSubscriptionPaymentSettingsSaveDefaultPaymentMethod { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for UpdateSubscriptionPaymentSettingsSaveDefaultPaymentMethod { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for UpdateSubscriptionPaymentSettingsSaveDefaultPaymentMethod { - fn default() -> Self { - Self::Off - } -} - -/// An enum representing the possible values of an `UpdateSubscriptionTrialSettingsEndBehavior`'s `missing_payment_method` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum UpdateSubscriptionTrialSettingsEndBehaviorMissingPaymentMethod { - Cancel, - CreateInvoice, - Pause, -} - -impl UpdateSubscriptionTrialSettingsEndBehaviorMissingPaymentMethod { - pub fn as_str(self) -> &'static str { - match self { - UpdateSubscriptionTrialSettingsEndBehaviorMissingPaymentMethod::Cancel => "cancel", - UpdateSubscriptionTrialSettingsEndBehaviorMissingPaymentMethod::CreateInvoice => { - "create_invoice" - } - UpdateSubscriptionTrialSettingsEndBehaviorMissingPaymentMethod::Pause => "pause", - } - } -} - -impl AsRef for UpdateSubscriptionTrialSettingsEndBehaviorMissingPaymentMethod { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for UpdateSubscriptionTrialSettingsEndBehaviorMissingPaymentMethod { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for UpdateSubscriptionTrialSettingsEndBehaviorMissingPaymentMethod { - fn default() -> Self { - Self::Cancel - } -} diff --git a/src/resources/generated/subscription_item.rs b/src/resources/generated/subscription_item.rs deleted file mode 100644 index dd5929829..000000000 --- a/src/resources/generated/subscription_item.rs +++ /dev/null @@ -1,551 +0,0 @@ -// ====================================== -// This file was automatically generated. -// ====================================== - -use serde::{Deserialize, Serialize}; - -use crate::client::{Client, Response}; -use crate::ids::{PlanId, PriceId, SubscriptionId, SubscriptionItemId}; -use crate::params::{Deleted, Expand, List, Metadata, Object, Paginable, Timestamp}; -use crate::resources::{Currency, Plan, Price, SubscriptionItemBillingThresholds, TaxRate}; - -/// The resource representing a Stripe "SubscriptionItem". -/// -/// For more details see -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct SubscriptionItem { - /// Unique identifier for the object. - pub id: SubscriptionItemId, - - /// Define thresholds at which an invoice will be sent, and the related subscription advanced to a new billing period. - #[serde(skip_serializing_if = "Option::is_none")] - pub billing_thresholds: Option, - - /// Time at which the object was created. - /// - /// Measured in seconds since the Unix epoch. - #[serde(skip_serializing_if = "Option::is_none")] - pub created: Option, - - // Always true for a deleted object - #[serde(default)] - pub deleted: bool, - - /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. - /// - /// This can be useful for storing additional information about the object in a structured format. - #[serde(skip_serializing_if = "Option::is_none")] - pub metadata: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub plan: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub price: Option, - - /// The [quantity](https://stripe.com/docs/subscriptions/quantities) of the plan to which the customer should be subscribed. - #[serde(skip_serializing_if = "Option::is_none")] - pub quantity: Option, - - /// The `subscription` this `subscription_item` belongs to. - #[serde(skip_serializing_if = "Option::is_none")] - pub subscription: Option, - - /// The tax rates which apply to this `subscription_item`. - /// - /// When set, the `default_tax_rates` on the subscription do not apply to this `subscription_item`. - #[serde(skip_serializing_if = "Option::is_none")] - pub tax_rates: Option>, -} - -impl SubscriptionItem { - /// Returns a list of your subscription items for a given subscription. - pub fn list( - client: &Client, - params: &ListSubscriptionItems<'_>, - ) -> Response> { - client.get_query("/subscription_items", ¶ms) - } - - /// Adds a new item to an existing subscription. - /// - /// No existing items will be changed or replaced. - pub fn create( - client: &Client, - params: CreateSubscriptionItem<'_>, - ) -> Response { - client.post_form("/subscription_items", ¶ms) - } - - /// Retrieves the subscription item with the given ID. - pub fn retrieve( - client: &Client, - id: &SubscriptionItemId, - expand: &[&str], - ) -> Response { - client.get_query(&format!("/subscription_items/{}", id), &Expand { expand }) - } - - /// Updates the plan or quantity of an item on a current subscription. - pub fn update( - client: &Client, - id: &SubscriptionItemId, - params: UpdateSubscriptionItem<'_>, - ) -> Response { - client.post_form(&format!("/subscription_items/{}", id), ¶ms) - } - - /// Deletes an item from the subscription. - /// - /// Removing a subscription item from a subscription will not cancel the subscription. - pub fn delete( - client: &Client, - id: &SubscriptionItemId, - ) -> Response> { - client.delete(&format!("/subscription_items/{}", id)) - } -} - -impl Object for SubscriptionItem { - type Id = SubscriptionItemId; - fn id(&self) -> Self::Id { - self.id.clone() - } - fn object(&self) -> &'static str { - "subscription_item" - } -} - -/// The parameters for `SubscriptionItem::create`. -#[derive(Clone, Debug, Serialize)] -pub struct CreateSubscriptionItem<'a> { - /// Define thresholds at which an invoice will be sent, and the subscription advanced to a new billing period. - /// - /// When updating, pass an empty string to remove previously-defined thresholds. - #[serde(skip_serializing_if = "Option::is_none")] - pub billing_thresholds: Option, - - /// Specifies which fields in the response should be expanded. - #[serde(skip_serializing_if = "Expand::is_empty")] - pub expand: &'a [&'a str], - - /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. - /// - /// This can be useful for storing additional information about the object in a structured format. - /// Individual keys can be unset by posting an empty value to them. - /// All keys can be unset by posting an empty value to `metadata`. - #[serde(skip_serializing_if = "Option::is_none")] - pub metadata: Option, - - /// Use `allow_incomplete` to transition the subscription to `status=past_due` if a payment is required but cannot be paid. - /// - /// This allows you to manage scenarios where additional user actions are needed to pay a subscription's invoice. - /// For example, SCA regulation may require 3DS authentication to complete payment. - /// See the [SCA Migration Guide](https://stripe.com/docs/billing/migration/strong-customer-authentication) for Billing to learn more. - /// This is the default behavior. Use `default_incomplete` to transition the subscription to `status=past_due` when payment is required and await explicit confirmation of the invoice's payment intent. - /// This allows simpler management of scenarios where additional user actions are needed to pay a subscription’s invoice. - /// Such as failed payments, [SCA regulation](https://stripe.com/docs/billing/migration/strong-customer-authentication), or collecting a mandate for a bank debit payment method. Use `pending_if_incomplete` to update the subscription using [pending updates](https://stripe.com/docs/billing/subscriptions/pending-updates). - /// When you use `pending_if_incomplete` you can only pass the parameters [supported by pending updates](https://stripe.com/docs/billing/pending-updates-reference#supported-attributes). Use `error_if_incomplete` if you want Stripe to return an HTTP 402 status code if a subscription's invoice cannot be paid. - /// For example, if a payment method requires 3DS authentication due to SCA regulation and further user action is needed, this parameter does not update the subscription and returns an error instead. - /// This was the default behavior for API versions prior to 2019-03-14. - /// See the [changelog](https://stripe.com/docs/upgrades#2019-03-14) to learn more. - #[serde(skip_serializing_if = "Option::is_none")] - pub payment_behavior: Option, - - /// The identifier of the plan to add to the subscription. - #[serde(skip_serializing_if = "Option::is_none")] - pub plan: Option, - - /// The ID of the price object. - #[serde(skip_serializing_if = "Option::is_none")] - pub price: Option, - - /// Data used to generate a new [Price](https://stripe.com/docs/api/prices) object inline. - #[serde(skip_serializing_if = "Option::is_none")] - pub price_data: Option, - - /// Determines how to handle [prorations](https://stripe.com/docs/subscriptions/billing-cycle#prorations) when the billing cycle changes (e.g., when switching plans, resetting `billing_cycle_anchor=now`, or starting a trial), or if an item's `quantity` changes. - /// - /// The default value is `create_prorations`. - #[serde(skip_serializing_if = "Option::is_none")] - pub proration_behavior: Option, - - /// If set, the proration will be calculated as though the subscription was updated at the given time. - /// - /// This can be used to apply the same proration that was previewed with the [upcoming invoice](https://stripe.com/docs/api#retrieve_customer_invoice) endpoint. - #[serde(skip_serializing_if = "Option::is_none")] - pub proration_date: Option, - - /// The quantity you'd like to apply to the subscription item you're creating. - #[serde(skip_serializing_if = "Option::is_none")] - pub quantity: Option, - - /// The identifier of the subscription to modify. - pub subscription: SubscriptionId, - - /// A list of [Tax Rate](https://stripe.com/docs/api/tax_rates) ids. - /// - /// These Tax Rates will override the [`default_tax_rates`](https://stripe.com/docs/api/subscriptions/create#create_subscription-default_tax_rates) on the Subscription. - /// When updating, pass an empty string to remove previously-defined tax rates. - #[serde(skip_serializing_if = "Option::is_none")] - pub tax_rates: Option>, -} - -impl<'a> CreateSubscriptionItem<'a> { - pub fn new(subscription: SubscriptionId) -> Self { - CreateSubscriptionItem { - billing_thresholds: Default::default(), - expand: Default::default(), - metadata: Default::default(), - payment_behavior: Default::default(), - plan: Default::default(), - price: Default::default(), - price_data: Default::default(), - proration_behavior: Default::default(), - proration_date: Default::default(), - quantity: Default::default(), - subscription, - tax_rates: Default::default(), - } - } -} - -/// The parameters for `SubscriptionItem::list`. -#[derive(Clone, Debug, Serialize)] -pub struct ListSubscriptionItems<'a> { - /// A cursor for use in pagination. - /// - /// `ending_before` is an object ID that defines your place in the list. - /// For instance, if you make a list request and receive 100 objects, starting with `obj_bar`, your subsequent call can include `ending_before=obj_bar` in order to fetch the previous page of the list. - #[serde(skip_serializing_if = "Option::is_none")] - pub ending_before: Option, - - /// Specifies which fields in the response should be expanded. - #[serde(skip_serializing_if = "Expand::is_empty")] - pub expand: &'a [&'a str], - - /// A limit on the number of objects to be returned. - /// - /// Limit can range between 1 and 100, and the default is 10. - #[serde(skip_serializing_if = "Option::is_none")] - pub limit: Option, - - /// A cursor for use in pagination. - /// - /// `starting_after` is an object ID that defines your place in the list. - /// For instance, if you make a list request and receive 100 objects, ending with `obj_foo`, your subsequent call can include `starting_after=obj_foo` in order to fetch the next page of the list. - #[serde(skip_serializing_if = "Option::is_none")] - pub starting_after: Option, - - /// The ID of the subscription whose items will be retrieved. - pub subscription: SubscriptionId, -} - -impl<'a> ListSubscriptionItems<'a> { - pub fn new(subscription: SubscriptionId) -> Self { - ListSubscriptionItems { - ending_before: Default::default(), - expand: Default::default(), - limit: Default::default(), - starting_after: Default::default(), - subscription, - } - } -} -impl Paginable for ListSubscriptionItems<'_> { - type O = SubscriptionItem; - fn set_last(&mut self, item: Self::O) { - self.starting_after = Some(item.id()); - } -} -/// The parameters for `SubscriptionItem::update`. -#[derive(Clone, Debug, Serialize, Default)] -pub struct UpdateSubscriptionItem<'a> { - /// Define thresholds at which an invoice will be sent, and the subscription advanced to a new billing period. - /// - /// When updating, pass an empty string to remove previously-defined thresholds. - #[serde(skip_serializing_if = "Option::is_none")] - pub billing_thresholds: Option, - - /// Specifies which fields in the response should be expanded. - #[serde(skip_serializing_if = "Expand::is_empty")] - pub expand: &'a [&'a str], - - /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. - /// - /// This can be useful for storing additional information about the object in a structured format. - /// Individual keys can be unset by posting an empty value to them. - /// All keys can be unset by posting an empty value to `metadata`. - #[serde(skip_serializing_if = "Option::is_none")] - pub metadata: Option, - - /// Indicates if a customer is on or off-session while an invoice payment is attempted. - #[serde(skip_serializing_if = "Option::is_none")] - pub off_session: Option, - - /// Use `allow_incomplete` to transition the subscription to `status=past_due` if a payment is required but cannot be paid. - /// - /// This allows you to manage scenarios where additional user actions are needed to pay a subscription's invoice. - /// For example, SCA regulation may require 3DS authentication to complete payment. - /// See the [SCA Migration Guide](https://stripe.com/docs/billing/migration/strong-customer-authentication) for Billing to learn more. - /// This is the default behavior. Use `default_incomplete` to transition the subscription to `status=past_due` when payment is required and await explicit confirmation of the invoice's payment intent. - /// This allows simpler management of scenarios where additional user actions are needed to pay a subscription’s invoice. - /// Such as failed payments, [SCA regulation](https://stripe.com/docs/billing/migration/strong-customer-authentication), or collecting a mandate for a bank debit payment method. Use `pending_if_incomplete` to update the subscription using [pending updates](https://stripe.com/docs/billing/subscriptions/pending-updates). - /// When you use `pending_if_incomplete` you can only pass the parameters [supported by pending updates](https://stripe.com/docs/billing/pending-updates-reference#supported-attributes). Use `error_if_incomplete` if you want Stripe to return an HTTP 402 status code if a subscription's invoice cannot be paid. - /// For example, if a payment method requires 3DS authentication due to SCA regulation and further user action is needed, this parameter does not update the subscription and returns an error instead. - /// This was the default behavior for API versions prior to 2019-03-14. - /// See the [changelog](https://stripe.com/docs/upgrades#2019-03-14) to learn more. - #[serde(skip_serializing_if = "Option::is_none")] - pub payment_behavior: Option, - - /// The identifier of the new plan for this subscription item. - #[serde(skip_serializing_if = "Option::is_none")] - pub plan: Option, - - /// The ID of the price object. - /// - /// When changing a subscription item's price, `quantity` is set to 1 unless a `quantity` parameter is provided. - #[serde(skip_serializing_if = "Option::is_none")] - pub price: Option, - - /// Data used to generate a new [Price](https://stripe.com/docs/api/prices) object inline. - #[serde(skip_serializing_if = "Option::is_none")] - pub price_data: Option, - - /// Determines how to handle [prorations](https://stripe.com/docs/subscriptions/billing-cycle#prorations) when the billing cycle changes (e.g., when switching plans, resetting `billing_cycle_anchor=now`, or starting a trial), or if an item's `quantity` changes. - /// - /// The default value is `create_prorations`. - #[serde(skip_serializing_if = "Option::is_none")] - pub proration_behavior: Option, - - /// If set, the proration will be calculated as though the subscription was updated at the given time. - /// - /// This can be used to apply the same proration that was previewed with the [upcoming invoice](https://stripe.com/docs/api#retrieve_customer_invoice) endpoint. - #[serde(skip_serializing_if = "Option::is_none")] - pub proration_date: Option, - - /// The quantity you'd like to apply to the subscription item you're creating. - #[serde(skip_serializing_if = "Option::is_none")] - pub quantity: Option, - - /// A list of [Tax Rate](https://stripe.com/docs/api/tax_rates) ids. - /// - /// These Tax Rates will override the [`default_tax_rates`](https://stripe.com/docs/api/subscriptions/create#create_subscription-default_tax_rates) on the Subscription. - /// When updating, pass an empty string to remove previously-defined tax rates. - #[serde(skip_serializing_if = "Option::is_none")] - pub tax_rates: Option>, -} - -impl<'a> UpdateSubscriptionItem<'a> { - pub fn new() -> Self { - UpdateSubscriptionItem { - billing_thresholds: Default::default(), - expand: Default::default(), - metadata: Default::default(), - off_session: Default::default(), - payment_behavior: Default::default(), - plan: Default::default(), - price: Default::default(), - price_data: Default::default(), - proration_behavior: Default::default(), - proration_date: Default::default(), - quantity: Default::default(), - tax_rates: Default::default(), - } - } -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct SubscriptionItemPriceData { - /// Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. - /// - /// Must be a [supported currency](https://stripe.com/docs/currencies). - pub currency: Currency, - - /// The ID of the product that this price will belong to. - pub product: String, - - /// The recurring components of a price such as `interval` and `interval_count`. - pub recurring: SubscriptionItemPriceDataRecurring, - - /// Only required if a [default tax behavior](https://stripe.com/docs/tax/products-prices-tax-categories-tax-behavior#setting-a-default-tax-behavior-(recommended)) was not provided in the Stripe Tax settings. - /// - /// Specifies whether the price is considered inclusive of taxes or exclusive of taxes. - /// One of `inclusive`, `exclusive`, or `unspecified`. - /// Once specified as either `inclusive` or `exclusive`, it cannot be changed. - #[serde(skip_serializing_if = "Option::is_none")] - pub tax_behavior: Option, - - /// A positive integer in cents (or local equivalent) (or 0 for a free price) representing how much to charge. - #[serde(skip_serializing_if = "Option::is_none")] - pub unit_amount: Option, - - /// Same as `unit_amount`, but accepts a decimal value in cents (or local equivalent) with at most 12 decimal places. - /// - /// Only one of `unit_amount` and `unit_amount_decimal` can be set. - #[serde(skip_serializing_if = "Option::is_none")] - pub unit_amount_decimal: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct SubscriptionItemPriceDataRecurring { - /// Specifies billing frequency. - /// - /// Either `day`, `week`, `month` or `year`. - pub interval: PlanInterval, - - /// The number of intervals between subscription billings. - /// - /// For example, `interval=month` and `interval_count=3` bills every 3 months. - /// Maximum of three years interval allowed (3 years, 36 months, or 156 weeks). - #[serde(skip_serializing_if = "Option::is_none")] - pub interval_count: Option, -} - -/// An enum representing the possible values of an `SubscriptionItemPriceDataRecurring`'s `interval` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum PlanInterval { - Day, - Month, - Week, - Year, -} - -impl PlanInterval { - pub fn as_str(self) -> &'static str { - match self { - PlanInterval::Day => "day", - PlanInterval::Month => "month", - PlanInterval::Week => "week", - PlanInterval::Year => "year", - } - } -} - -impl AsRef for PlanInterval { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for PlanInterval { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for PlanInterval { - fn default() -> Self { - Self::Day - } -} - -/// An enum representing the possible values of an `SubscriptionItemPriceData`'s `tax_behavior` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum SubscriptionItemPriceDataTaxBehavior { - Exclusive, - Inclusive, - Unspecified, -} - -impl SubscriptionItemPriceDataTaxBehavior { - pub fn as_str(self) -> &'static str { - match self { - SubscriptionItemPriceDataTaxBehavior::Exclusive => "exclusive", - SubscriptionItemPriceDataTaxBehavior::Inclusive => "inclusive", - SubscriptionItemPriceDataTaxBehavior::Unspecified => "unspecified", - } - } -} - -impl AsRef for SubscriptionItemPriceDataTaxBehavior { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for SubscriptionItemPriceDataTaxBehavior { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for SubscriptionItemPriceDataTaxBehavior { - fn default() -> Self { - Self::Exclusive - } -} - -/// An enum representing the possible values of an `CreateSubscriptionItem`'s `payment_behavior` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum SubscriptionPaymentBehavior { - AllowIncomplete, - DefaultIncomplete, - ErrorIfIncomplete, - PendingIfIncomplete, -} - -impl SubscriptionPaymentBehavior { - pub fn as_str(self) -> &'static str { - match self { - SubscriptionPaymentBehavior::AllowIncomplete => "allow_incomplete", - SubscriptionPaymentBehavior::DefaultIncomplete => "default_incomplete", - SubscriptionPaymentBehavior::ErrorIfIncomplete => "error_if_incomplete", - SubscriptionPaymentBehavior::PendingIfIncomplete => "pending_if_incomplete", - } - } -} - -impl AsRef for SubscriptionPaymentBehavior { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for SubscriptionPaymentBehavior { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for SubscriptionPaymentBehavior { - fn default() -> Self { - Self::AllowIncomplete - } -} - -/// An enum representing the possible values of an `CreateSubscriptionItem`'s `proration_behavior` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum SubscriptionProrationBehavior { - AlwaysInvoice, - CreateProrations, - None, -} - -impl SubscriptionProrationBehavior { - pub fn as_str(self) -> &'static str { - match self { - SubscriptionProrationBehavior::AlwaysInvoice => "always_invoice", - SubscriptionProrationBehavior::CreateProrations => "create_prorations", - SubscriptionProrationBehavior::None => "none", - } - } -} - -impl AsRef for SubscriptionProrationBehavior { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for SubscriptionProrationBehavior { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for SubscriptionProrationBehavior { - fn default() -> Self { - Self::AlwaysInvoice - } -} diff --git a/src/resources/generated/subscription_item_billing_thresholds.rs b/src/resources/generated/subscription_item_billing_thresholds.rs deleted file mode 100644 index 39cefc434..000000000 --- a/src/resources/generated/subscription_item_billing_thresholds.rs +++ /dev/null @@ -1,12 +0,0 @@ -// ====================================== -// This file was automatically generated. -// ====================================== - -use serde::{Deserialize, Serialize}; - -/// The resource representing a Stripe "SubscriptionItemBillingThresholds". -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct SubscriptionItemBillingThresholds { - /// Usage threshold that triggers the subscription to create an invoice. - pub usage_gte: Option, -} diff --git a/src/resources/generated/subscription_schedule.rs b/src/resources/generated/subscription_schedule.rs deleted file mode 100644 index 99a9030af..000000000 --- a/src/resources/generated/subscription_schedule.rs +++ /dev/null @@ -1,1931 +0,0 @@ -// ====================================== -// This file was automatically generated. -// ====================================== - -use serde::{Deserialize, Serialize}; - -use crate::client::{Client, Response}; -use crate::ids::{CustomerId, SubscriptionScheduleId}; -use crate::params::{Expand, Expandable, List, Metadata, Object, Paginable, RangeQuery, Timestamp}; -use crate::resources::{ - Account, Application, CollectionMethod, ConnectAccountReference, Coupon, Currency, Customer, - PaymentMethod, Plan, Price, Scheduled, Subscription, SubscriptionBillingThresholds, - SubscriptionItemBillingThresholds, SubscriptionTransferData, TaxId, TaxRate, - TestHelpersTestClock, -}; - -/// The resource representing a Stripe "SubscriptionSchedule". -/// -/// For more details see -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct SubscriptionSchedule { - /// Unique identifier for the object. - pub id: SubscriptionScheduleId, - - /// ID of the Connect Application that created the schedule. - pub application: Option>, - - /// Time at which the subscription schedule was canceled. - /// - /// Measured in seconds since the Unix epoch. - pub canceled_at: Option, - - /// Time at which the subscription schedule was completed. - /// - /// Measured in seconds since the Unix epoch. - pub completed_at: Option, - - /// Time at which the object was created. - /// - /// Measured in seconds since the Unix epoch. - pub created: Timestamp, - - /// Object representing the start and end dates for the current phase of the subscription schedule, if it is `active`. - pub current_phase: Option, - - /// ID of the customer who owns the subscription schedule. - pub customer: Expandable, - - pub default_settings: SubscriptionScheduleDefaultSettings, - - /// Behavior of the subscription schedule and underlying subscription when it ends. - /// - /// Possible values are `release` or `cancel` with the default being `release`. - /// `release` will end the subscription schedule and keep the underlying subscription running. - /// `cancel` will end the subscription schedule and cancel the underlying subscription. - pub end_behavior: SubscriptionScheduleEndBehavior, - - /// Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. - pub livemode: bool, - - /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. - /// - /// This can be useful for storing additional information about the object in a structured format. - pub metadata: Option, - - /// Configuration for the subscription schedule's phases. - pub phases: Vec, - - /// Time at which the subscription schedule was released. - /// - /// Measured in seconds since the Unix epoch. - pub released_at: Option, - - /// ID of the subscription once managed by the subscription schedule (if it is released). - pub released_subscription: Option, - - /// The present status of the subscription schedule. - /// - /// Possible values are `not_started`, `active`, `completed`, `released`, and `canceled`. - /// You can read more about the different states in our [behavior guide](https://stripe.com/docs/billing/subscriptions/subscription-schedules). - pub status: SubscriptionScheduleStatus, - - /// ID of the subscription managed by the subscription schedule. - pub subscription: Option>, - - /// ID of the test clock this subscription schedule belongs to. - pub test_clock: Option>, -} - -impl SubscriptionSchedule { - /// Retrieves the list of your subscription schedules. - pub fn list( - client: &Client, - params: &ListSubscriptionSchedules<'_>, - ) -> Response> { - client.get_query("/subscription_schedules", ¶ms) - } - - /// Creates a new subscription schedule object. - /// - /// Each customer can have up to 500 active or scheduled subscriptions. - pub fn create( - client: &Client, - params: CreateSubscriptionSchedule<'_>, - ) -> Response { - client.post_form("/subscription_schedules", ¶ms) - } - - /// Retrieves the details of an existing subscription schedule. - /// - /// You only need to supply the unique subscription schedule identifier that was returned upon subscription schedule creation. - pub fn retrieve( - client: &Client, - id: &SubscriptionScheduleId, - expand: &[&str], - ) -> Response { - client.get_query(&format!("/subscription_schedules/{}", id), &Expand { expand }) - } - - /// Updates an existing subscription schedule. - pub fn update( - client: &Client, - id: &SubscriptionScheduleId, - params: UpdateSubscriptionSchedule<'_>, - ) -> Response { - client.post_form(&format!("/subscription_schedules/{}", id), ¶ms) - } -} - -impl Object for SubscriptionSchedule { - type Id = SubscriptionScheduleId; - fn id(&self) -> Self::Id { - self.id.clone() - } - fn object(&self) -> &'static str { - "subscription_schedule" - } -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct SubscriptionScheduleCurrentPhase { - /// The end of this phase of the subscription schedule. - pub end_date: Timestamp, - - /// The start of this phase of the subscription schedule. - pub start_date: Timestamp, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct SubscriptionSchedulePhaseConfiguration { - /// A list of prices and quantities that will generate invoice items appended to the next invoice for this phase. - pub add_invoice_items: Vec, - - /// A non-negative decimal between 0 and 100, with at most two decimal places. - /// - /// This represents the percentage of the subscription invoice total that will be transferred to the application owner's Stripe account during this phase of the schedule. - pub application_fee_percent: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub automatic_tax: Option, - - /// Possible values are `phase_start` or `automatic`. - /// - /// If `phase_start` then billing cycle anchor of the subscription is set to the start of the phase when entering the phase. - /// If `automatic` then the billing cycle anchor is automatically modified as needed when entering the phase. - /// For more information, see the billing cycle [documentation](https://stripe.com/docs/billing/subscriptions/billing-cycle). - pub billing_cycle_anchor: Option, - - /// Define thresholds at which an invoice will be sent, and the subscription advanced to a new billing period. - pub billing_thresholds: Option, - - /// Either `charge_automatically`, or `send_invoice`. - /// - /// When charging automatically, Stripe will attempt to pay the underlying subscription at the end of each billing cycle using the default source attached to the customer. - /// When sending an invoice, Stripe will email your customer an invoice with payment instructions and mark the subscription as `active`. - pub collection_method: Option, - - /// ID of the coupon to use during this phase of the subscription schedule. - pub coupon: Option>, - - /// Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. - /// - /// Must be a [supported currency](https://stripe.com/docs/currencies). - pub currency: Currency, - - /// ID of the default payment method for the subscription schedule. - /// - /// It must belong to the customer associated with the subscription schedule. - /// If not set, invoices will use the default payment method in the customer's invoice settings. - pub default_payment_method: Option>, - - /// The default tax rates to apply to the subscription during this phase of the subscription schedule. - #[serde(skip_serializing_if = "Option::is_none")] - pub default_tax_rates: Option>, - - /// Subscription description, meant to be displayable to the customer. - /// - /// Use this field to optionally store an explanation of the subscription for rendering in Stripe surfaces and certain local payment methods UIs. - pub description: Option, - - /// The end of this phase of the subscription schedule. - pub end_date: Timestamp, - - /// The invoice settings applicable during this phase. - pub invoice_settings: Option, - - /// Subscription items to configure the subscription to during this phase of the subscription schedule. - pub items: Vec, - - /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to a phase. - /// - /// Metadata on a schedule's phase will update the underlying subscription's `metadata` when the phase is entered. - /// Updating the underlying subscription's `metadata` directly will not affect the current phase's `metadata`. - pub metadata: Option, - - /// The account (if any) the charge was made on behalf of for charges associated with the schedule's subscription. - /// - /// See the Connect documentation for details. - pub on_behalf_of: Option>, - - /// If the subscription schedule will prorate when transitioning to this phase. - /// - /// Possible values are `create_prorations` and `none`. - pub proration_behavior: SubscriptionProrationBehavior, - - /// The start of this phase of the subscription schedule. - pub start_date: Timestamp, - - /// The account (if any) the associated subscription's payments will be attributed to for tax reporting, and where funds from each payment will be transferred to for each of the subscription's invoices. - pub transfer_data: Option, - - /// When the trial ends within the phase. - pub trial_end: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct InvoiceSettingSubscriptionSchedulePhaseSetting { - /// The account tax IDs associated with this phase of the subscription schedule. - /// - /// Will be set on invoices generated by this phase of the subscription schedule. - #[serde(skip_serializing_if = "Option::is_none")] - pub account_tax_ids: Option>>, - - /// Number of days within which a customer must pay invoices generated by this subscription schedule. - /// - /// This value will be `null` for subscription schedules where `billing=charge_automatically`. - pub days_until_due: Option, - - /// The connected account that issues the invoice. - /// - /// The invoice is presented with the branding and support information of the specified account. - pub issuer: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct SchedulesPhaseAutomaticTax { - /// Whether Stripe automatically computes tax on invoices created during this phase. - pub enabled: bool, - - /// The account that's liable for tax. - /// - /// If set, the business address and tax registrations required to perform the tax calculation are loaded from this account. - /// The tax transaction is returned in the report of the connected account. - pub liability: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct SubscriptionScheduleAddInvoiceItem { - /// ID of the price used to generate the invoice item. - pub price: Expandable, - - /// The quantity of the invoice item. - pub quantity: Option, - - /// The tax rates which apply to the item. - /// - /// When set, the `default_tax_rates` do not apply to this item. - #[serde(skip_serializing_if = "Option::is_none")] - pub tax_rates: Option>, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct SubscriptionScheduleConfigurationItem { - /// Define thresholds at which an invoice will be sent, and the related subscription advanced to a new billing period. - pub billing_thresholds: Option, - - /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an item. - /// - /// Metadata on this item will update the underlying subscription item's `metadata` when the phase is entered. - pub metadata: Option, - - /// ID of the plan to which the customer should be subscribed. - pub plan: Expandable, - - /// ID of the price to which the customer should be subscribed. - pub price: Expandable, - - /// Quantity of the plan to which the customer should be subscribed. - #[serde(skip_serializing_if = "Option::is_none")] - pub quantity: Option, - - /// The tax rates which apply to this `phase_item`. - /// - /// When set, the `default_tax_rates` on the phase do not apply to this `phase_item`. - #[serde(skip_serializing_if = "Option::is_none")] - pub tax_rates: Option>, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct SubscriptionScheduleDefaultSettings { - /// A non-negative decimal between 0 and 100, with at most two decimal places. - /// - /// This represents the percentage of the subscription invoice total that will be transferred to the application owner's Stripe account during this phase of the schedule. - pub application_fee_percent: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub automatic_tax: Option, - - /// Possible values are `phase_start` or `automatic`. - /// - /// If `phase_start` then billing cycle anchor of the subscription is set to the start of the phase when entering the phase. - /// If `automatic` then the billing cycle anchor is automatically modified as needed when entering the phase. - /// For more information, see the billing cycle [documentation](https://stripe.com/docs/billing/subscriptions/billing-cycle). - pub billing_cycle_anchor: SubscriptionScheduleDefaultSettingsBillingCycleAnchor, - - /// Define thresholds at which an invoice will be sent, and the subscription advanced to a new billing period. - pub billing_thresholds: Option, - - /// Either `charge_automatically`, or `send_invoice`. - /// - /// When charging automatically, Stripe will attempt to pay the underlying subscription at the end of each billing cycle using the default source attached to the customer. - /// When sending an invoice, Stripe will email your customer an invoice with payment instructions and mark the subscription as `active`. - pub collection_method: Option, - - /// ID of the default payment method for the subscription schedule. - /// - /// If not set, invoices will use the default payment method in the customer's invoice settings. - pub default_payment_method: Option>, - - /// Subscription description, meant to be displayable to the customer. - /// - /// Use this field to optionally store an explanation of the subscription for rendering in Stripe surfaces and certain local payment methods UIs. - pub description: Option, - - pub invoice_settings: SubscriptionScheduleInvoiceSettings, - - /// The account (if any) the charge was made on behalf of for charges associated with the schedule's subscription. - /// - /// See the Connect documentation for details. - pub on_behalf_of: Option>, - - /// The account (if any) the associated subscription's payments will be attributed to for tax reporting, and where funds from each payment will be transferred to for each of the subscription's invoices. - pub transfer_data: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct SubscriptionSchedulesResourceDefaultSettingsAutomaticTax { - /// Whether Stripe automatically computes tax on invoices created during this phase. - pub enabled: bool, - - /// The account that's liable for tax. - /// - /// If set, the business address and tax registrations required to perform the tax calculation are loaded from this account. - /// The tax transaction is returned in the report of the connected account. - pub liability: Option, -} - -/// The parameters for `SubscriptionSchedule::create`. -#[derive(Clone, Debug, Serialize, Default)] -pub struct CreateSubscriptionSchedule<'a> { - /// The identifier of the customer to create the subscription schedule for. - #[serde(skip_serializing_if = "Option::is_none")] - pub customer: Option, - - /// Object representing the subscription schedule's default settings. - #[serde(skip_serializing_if = "Option::is_none")] - pub default_settings: Option, - - /// Behavior of the subscription schedule and underlying subscription when it ends. - /// - /// Possible values are `release` or `cancel` with the default being `release`. - /// `release` will end the subscription schedule and keep the underlying subscription running. - /// `cancel` will end the subscription schedule and cancel the underlying subscription. - #[serde(skip_serializing_if = "Option::is_none")] - pub end_behavior: Option, - - /// Specifies which fields in the response should be expanded. - #[serde(skip_serializing_if = "Expand::is_empty")] - pub expand: &'a [&'a str], - - /// Migrate an existing subscription to be managed by a subscription schedule. - /// - /// If this parameter is set, a subscription schedule will be created using the subscription's item(s), set to auto-renew using the subscription's interval. - /// When using this parameter, other parameters (such as phase values) cannot be set. - /// To create a subscription schedule with other modifications, we recommend making two separate API calls. - #[serde(skip_serializing_if = "Option::is_none")] - pub from_subscription: Option<&'a str>, - - /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. - /// - /// This can be useful for storing additional information about the object in a structured format. - /// Individual keys can be unset by posting an empty value to them. - /// All keys can be unset by posting an empty value to `metadata`. - #[serde(skip_serializing_if = "Option::is_none")] - pub metadata: Option, - - /// List representing phases of the subscription schedule. - /// - /// Each phase can be customized to have different durations, plans, and coupons. - /// If there are multiple phases, the `end_date` of one phase will always equal the `start_date` of the next phase. - #[serde(skip_serializing_if = "Option::is_none")] - pub phases: Option>, - - /// When the subscription schedule starts. - /// - /// We recommend using `now` so that it starts the subscription immediately. - /// You can also use a Unix timestamp to backdate the subscription so that it starts on a past date, or set a future date for the subscription to start on. - #[serde(skip_serializing_if = "Option::is_none")] - pub start_date: Option, -} - -impl<'a> CreateSubscriptionSchedule<'a> { - pub fn new() -> Self { - CreateSubscriptionSchedule { - customer: Default::default(), - default_settings: Default::default(), - end_behavior: Default::default(), - expand: Default::default(), - from_subscription: Default::default(), - metadata: Default::default(), - phases: Default::default(), - start_date: Default::default(), - } - } -} - -/// The parameters for `SubscriptionSchedule::list`. -#[derive(Clone, Debug, Serialize, Default)] -pub struct ListSubscriptionSchedules<'a> { - /// Only return subscription schedules that were created canceled the given date interval. - #[serde(skip_serializing_if = "Option::is_none")] - pub canceled_at: Option>, - - /// Only return subscription schedules that completed during the given date interval. - #[serde(skip_serializing_if = "Option::is_none")] - pub completed_at: Option>, - - /// Only return subscription schedules that were created during the given date interval. - #[serde(skip_serializing_if = "Option::is_none")] - pub created: Option>, - - /// Only return subscription schedules for the given customer. - #[serde(skip_serializing_if = "Option::is_none")] - pub customer: Option, - - /// A cursor for use in pagination. - /// - /// `ending_before` is an object ID that defines your place in the list. - /// For instance, if you make a list request and receive 100 objects, starting with `obj_bar`, your subsequent call can include `ending_before=obj_bar` in order to fetch the previous page of the list. - #[serde(skip_serializing_if = "Option::is_none")] - pub ending_before: Option, - - /// Specifies which fields in the response should be expanded. - #[serde(skip_serializing_if = "Expand::is_empty")] - pub expand: &'a [&'a str], - - /// A limit on the number of objects to be returned. - /// - /// Limit can range between 1 and 100, and the default is 10. - #[serde(skip_serializing_if = "Option::is_none")] - pub limit: Option, - - /// Only return subscription schedules that were released during the given date interval. - #[serde(skip_serializing_if = "Option::is_none")] - pub released_at: Option>, - - /// Only return subscription schedules that have not started yet. - #[serde(skip_serializing_if = "Option::is_none")] - pub scheduled: Option, - - /// A cursor for use in pagination. - /// - /// `starting_after` is an object ID that defines your place in the list. - /// For instance, if you make a list request and receive 100 objects, ending with `obj_foo`, your subsequent call can include `starting_after=obj_foo` in order to fetch the next page of the list. - #[serde(skip_serializing_if = "Option::is_none")] - pub starting_after: Option, -} - -impl<'a> ListSubscriptionSchedules<'a> { - pub fn new() -> Self { - ListSubscriptionSchedules { - canceled_at: Default::default(), - completed_at: Default::default(), - created: Default::default(), - customer: Default::default(), - ending_before: Default::default(), - expand: Default::default(), - limit: Default::default(), - released_at: Default::default(), - scheduled: Default::default(), - starting_after: Default::default(), - } - } -} -impl Paginable for ListSubscriptionSchedules<'_> { - type O = SubscriptionSchedule; - fn set_last(&mut self, item: Self::O) { - self.starting_after = Some(item.id()); - } -} -/// The parameters for `SubscriptionSchedule::update`. -#[derive(Clone, Debug, Serialize, Default)] -pub struct UpdateSubscriptionSchedule<'a> { - /// Object representing the subscription schedule's default settings. - #[serde(skip_serializing_if = "Option::is_none")] - pub default_settings: Option, - - /// Behavior of the subscription schedule and underlying subscription when it ends. - /// - /// Possible values are `release` or `cancel` with the default being `release`. - /// `release` will end the subscription schedule and keep the underlying subscription running. - /// `cancel` will end the subscription schedule and cancel the underlying subscription. - #[serde(skip_serializing_if = "Option::is_none")] - pub end_behavior: Option, - - /// Specifies which fields in the response should be expanded. - #[serde(skip_serializing_if = "Expand::is_empty")] - pub expand: &'a [&'a str], - - /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. - /// - /// This can be useful for storing additional information about the object in a structured format. - /// Individual keys can be unset by posting an empty value to them. - /// All keys can be unset by posting an empty value to `metadata`. - #[serde(skip_serializing_if = "Option::is_none")] - pub metadata: Option, - - /// List representing phases of the subscription schedule. - /// - /// Each phase can be customized to have different durations, plans, and coupons. - /// If there are multiple phases, the `end_date` of one phase will always equal the `start_date` of the next phase. - /// Note that past phases can be omitted. - #[serde(skip_serializing_if = "Option::is_none")] - pub phases: Option>, - - /// If the update changes the current phase, indicates whether the changes should be prorated. - /// - /// The default value is `create_prorations`. - #[serde(skip_serializing_if = "Option::is_none")] - pub proration_behavior: Option, -} - -impl<'a> UpdateSubscriptionSchedule<'a> { - pub fn new() -> Self { - UpdateSubscriptionSchedule { - default_settings: Default::default(), - end_behavior: Default::default(), - expand: Default::default(), - metadata: Default::default(), - phases: Default::default(), - proration_behavior: Default::default(), - } - } -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreateSubscriptionSchedulePhases { - /// A list of prices and quantities that will generate invoice items appended to the next invoice for this phase. - /// - /// You may pass up to 20 items. - #[serde(skip_serializing_if = "Option::is_none")] - pub add_invoice_items: Option>, - - /// A non-negative decimal between 0 and 100, with at most two decimal places. - /// - /// This represents the percentage of the subscription invoice total that will be transferred to the application owner's Stripe account. - /// The request must be made by a platform account on a connected account in order to set an application fee percentage. - /// For more information, see the application fees [documentation](https://stripe.com/docs/connect/subscriptions#collecting-fees-on-subscriptions). - #[serde(skip_serializing_if = "Option::is_none")] - pub application_fee_percent: Option, - - /// Automatic tax settings for this phase. - #[serde(skip_serializing_if = "Option::is_none")] - pub automatic_tax: Option, - - /// Can be set to `phase_start` to set the anchor to the start of the phase or `automatic` to automatically change it if needed. - /// - /// Cannot be set to `phase_start` if this phase specifies a trial. - /// For more information, see the billing cycle [documentation](https://stripe.com/docs/billing/subscriptions/billing-cycle). - #[serde(skip_serializing_if = "Option::is_none")] - pub billing_cycle_anchor: Option, - - /// Define thresholds at which an invoice will be sent, and the subscription advanced to a new billing period. - /// - /// Pass an empty string to remove previously-defined thresholds. - #[serde(skip_serializing_if = "Option::is_none")] - pub billing_thresholds: Option, - - /// Either `charge_automatically`, or `send_invoice`. - /// - /// When charging automatically, Stripe will attempt to pay the underlying subscription at the end of each billing cycle using the default source attached to the customer. - /// When sending an invoice, Stripe will email your customer an invoice with payment instructions and mark the subscription as `active`. - /// Defaults to `charge_automatically` on creation. - #[serde(skip_serializing_if = "Option::is_none")] - pub collection_method: Option, - - /// The identifier of the coupon to apply to this phase of the subscription schedule. - #[serde(skip_serializing_if = "Option::is_none")] - pub coupon: Option, - - /// Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. - /// - /// Must be a [supported currency](https://stripe.com/docs/currencies). - #[serde(skip_serializing_if = "Option::is_none")] - pub currency: Option, - - /// ID of the default payment method for the subscription schedule. - /// - /// It must belong to the customer associated with the subscription schedule. - /// If not set, invoices will use the default payment method in the customer's invoice settings. - #[serde(skip_serializing_if = "Option::is_none")] - pub default_payment_method: Option, - - /// A list of [Tax Rate](https://stripe.com/docs/api/tax_rates) ids. - /// - /// These Tax Rates will set the Subscription's [`default_tax_rates`](https://stripe.com/docs/api/subscriptions/create#create_subscription-default_tax_rates), which means they will be the Invoice's [`default_tax_rates`](https://stripe.com/docs/api/invoices/create#create_invoice-default_tax_rates) for any Invoices issued by the Subscription during this Phase. - #[serde(skip_serializing_if = "Option::is_none")] - pub default_tax_rates: Option>, - - /// Subscription description, meant to be displayable to the customer. - /// - /// Use this field to optionally store an explanation of the subscription for rendering in Stripe surfaces and certain local payment methods UIs. - #[serde(skip_serializing_if = "Option::is_none")] - pub description: Option, - - /// The date at which this phase of the subscription schedule ends. - /// - /// If set, `iterations` must not be set. - #[serde(skip_serializing_if = "Option::is_none")] - pub end_date: Option, - - /// All invoices will be billed using the specified settings. - #[serde(skip_serializing_if = "Option::is_none")] - pub invoice_settings: Option, - - /// List of configuration items, each with an attached price, to apply during this phase of the subscription schedule. - pub items: Vec, - - /// Integer representing the multiplier applied to the price interval. - /// - /// For example, `iterations=2` applied to a price with `interval=month` and `interval_count=3` results in a phase of duration `2 * 3 months = 6 months`. - /// If set, `end_date` must not be set. - #[serde(skip_serializing_if = "Option::is_none")] - pub iterations: Option, - - /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to a phase. - /// - /// Metadata on a schedule's phase will update the underlying subscription's `metadata` when the phase is entered, adding new keys and replacing existing keys in the subscription's `metadata`. - /// Individual keys in the subscription's `metadata` can be unset by posting an empty value to them in the phase's `metadata`. - /// To unset all keys in the subscription's `metadata`, update the subscription directly or unset every key individually from the phase's `metadata`. - #[serde(skip_serializing_if = "Option::is_none")] - pub metadata: Option, - - /// The account on behalf of which to charge, for each of the associated subscription's invoices. - #[serde(skip_serializing_if = "Option::is_none")] - pub on_behalf_of: Option, - - /// Whether the subscription schedule will create [prorations](https://stripe.com/docs/billing/subscriptions/prorations) when transitioning to this phase. - /// - /// The default value is `create_prorations`. - /// This setting controls prorations when a phase is started asynchronously and it is persisted as a field on the phase. - /// It's different from the request-level [proration_behavior](https://stripe.com/docs/api/subscription_schedules/update#update_subscription_schedule-proration_behavior) parameter which controls what happens if the update request affects the billing configuration of the current phase. - #[serde(skip_serializing_if = "Option::is_none")] - pub proration_behavior: Option, - - /// The data with which to automatically create a Transfer for each of the associated subscription's invoices. - #[serde(skip_serializing_if = "Option::is_none")] - pub transfer_data: Option, - - /// If set to true the entire phase is counted as a trial and the customer will not be charged for any fees. - #[serde(skip_serializing_if = "Option::is_none")] - pub trial: Option, - - /// Sets the phase to trialing from the start date to this date. - /// - /// Must be before the phase end date, can not be combined with `trial`. - #[serde(skip_serializing_if = "Option::is_none")] - pub trial_end: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct SubscriptionScheduleDefaultSettingsParams { - /// A non-negative decimal between 0 and 100, with at most two decimal places. - /// - /// This represents the percentage of the subscription invoice total that will be transferred to the application owner's Stripe account. - /// The request must be made by a platform account on a connected account in order to set an application fee percentage. - /// For more information, see the application fees [documentation](https://stripe.com/docs/connect/subscriptions#collecting-fees-on-subscriptions). - #[serde(skip_serializing_if = "Option::is_none")] - pub application_fee_percent: Option, - - /// Default settings for automatic tax computation. - #[serde(skip_serializing_if = "Option::is_none")] - pub automatic_tax: Option, - - /// Can be set to `phase_start` to set the anchor to the start of the phase or `automatic` to automatically change it if needed. - /// - /// Cannot be set to `phase_start` if this phase specifies a trial. - /// For more information, see the billing cycle [documentation](https://stripe.com/docs/billing/subscriptions/billing-cycle). - #[serde(skip_serializing_if = "Option::is_none")] - pub billing_cycle_anchor: Option, - - /// Define thresholds at which an invoice will be sent, and the subscription advanced to a new billing period. - /// - /// Pass an empty string to remove previously-defined thresholds. - #[serde(skip_serializing_if = "Option::is_none")] - pub billing_thresholds: Option, - - /// Either `charge_automatically`, or `send_invoice`. - /// - /// When charging automatically, Stripe will attempt to pay the underlying subscription at the end of each billing cycle using the default source attached to the customer. - /// When sending an invoice, Stripe will email your customer an invoice with payment instructions and mark the subscription as `active`. - /// Defaults to `charge_automatically` on creation. - #[serde(skip_serializing_if = "Option::is_none")] - pub collection_method: Option, - - /// ID of the default payment method for the subscription schedule. - /// - /// It must belong to the customer associated with the subscription schedule. - /// If not set, invoices will use the default payment method in the customer's invoice settings. - #[serde(skip_serializing_if = "Option::is_none")] - pub default_payment_method: Option, - - /// Subscription description, meant to be displayable to the customer. - /// - /// Use this field to optionally store an explanation of the subscription for rendering in Stripe surfaces and certain local payment methods UIs. - #[serde(skip_serializing_if = "Option::is_none")] - pub description: Option, - - /// All invoices will be billed using the specified settings. - #[serde(skip_serializing_if = "Option::is_none")] - pub invoice_settings: Option, - - /// The account on behalf of which to charge, for each of the associated subscription's invoices. - #[serde(skip_serializing_if = "Option::is_none")] - pub on_behalf_of: Option, - - /// The data with which to automatically create a Transfer for each of the associated subscription's invoices. - #[serde(skip_serializing_if = "Option::is_none")] - pub transfer_data: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UpdateSubscriptionSchedulePhases { - /// A list of prices and quantities that will generate invoice items appended to the next invoice for this phase. - /// - /// You may pass up to 20 items. - #[serde(skip_serializing_if = "Option::is_none")] - pub add_invoice_items: Option>, - - /// A non-negative decimal between 0 and 100, with at most two decimal places. - /// - /// This represents the percentage of the subscription invoice total that will be transferred to the application owner's Stripe account. - /// The request must be made by a platform account on a connected account in order to set an application fee percentage. - /// For more information, see the application fees [documentation](https://stripe.com/docs/connect/subscriptions#collecting-fees-on-subscriptions). - #[serde(skip_serializing_if = "Option::is_none")] - pub application_fee_percent: Option, - - /// Automatic tax settings for this phase. - #[serde(skip_serializing_if = "Option::is_none")] - pub automatic_tax: Option, - - /// Can be set to `phase_start` to set the anchor to the start of the phase or `automatic` to automatically change it if needed. - /// - /// Cannot be set to `phase_start` if this phase specifies a trial. - /// For more information, see the billing cycle [documentation](https://stripe.com/docs/billing/subscriptions/billing-cycle). - #[serde(skip_serializing_if = "Option::is_none")] - pub billing_cycle_anchor: Option, - - /// Define thresholds at which an invoice will be sent, and the subscription advanced to a new billing period. - /// - /// Pass an empty string to remove previously-defined thresholds. - #[serde(skip_serializing_if = "Option::is_none")] - pub billing_thresholds: Option, - - /// Either `charge_automatically`, or `send_invoice`. - /// - /// When charging automatically, Stripe will attempt to pay the underlying subscription at the end of each billing cycle using the default source attached to the customer. - /// When sending an invoice, Stripe will email your customer an invoice with payment instructions and mark the subscription as `active`. - /// Defaults to `charge_automatically` on creation. - #[serde(skip_serializing_if = "Option::is_none")] - pub collection_method: Option, - - /// The identifier of the coupon to apply to this phase of the subscription schedule. - #[serde(skip_serializing_if = "Option::is_none")] - pub coupon: Option, - - /// Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. - /// - /// Must be a [supported currency](https://stripe.com/docs/currencies). - #[serde(skip_serializing_if = "Option::is_none")] - pub currency: Option, - - /// ID of the default payment method for the subscription schedule. - /// - /// It must belong to the customer associated with the subscription schedule. - /// If not set, invoices will use the default payment method in the customer's invoice settings. - #[serde(skip_serializing_if = "Option::is_none")] - pub default_payment_method: Option, - - /// A list of [Tax Rate](https://stripe.com/docs/api/tax_rates) ids. - /// - /// These Tax Rates will set the Subscription's [`default_tax_rates`](https://stripe.com/docs/api/subscriptions/create#create_subscription-default_tax_rates), which means they will be the Invoice's [`default_tax_rates`](https://stripe.com/docs/api/invoices/create#create_invoice-default_tax_rates) for any Invoices issued by the Subscription during this Phase. - #[serde(skip_serializing_if = "Option::is_none")] - pub default_tax_rates: Option>, - - /// Subscription description, meant to be displayable to the customer. - /// - /// Use this field to optionally store an explanation of the subscription for rendering in Stripe surfaces and certain local payment methods UIs. - #[serde(skip_serializing_if = "Option::is_none")] - pub description: Option, - - /// The date at which this phase of the subscription schedule ends. - /// - /// If set, `iterations` must not be set. - #[serde(skip_serializing_if = "Option::is_none")] - pub end_date: Option, - - /// All invoices will be billed using the specified settings. - #[serde(skip_serializing_if = "Option::is_none")] - pub invoice_settings: Option, - - /// List of configuration items, each with an attached price, to apply during this phase of the subscription schedule. - pub items: Vec, - - /// Integer representing the multiplier applied to the price interval. - /// - /// For example, `iterations=2` applied to a price with `interval=month` and `interval_count=3` results in a phase of duration `2 * 3 months = 6 months`. - /// If set, `end_date` must not be set. - #[serde(skip_serializing_if = "Option::is_none")] - pub iterations: Option, - - /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to a phase. - /// - /// Metadata on a schedule's phase will update the underlying subscription's `metadata` when the phase is entered, adding new keys and replacing existing keys in the subscription's `metadata`. - /// Individual keys in the subscription's `metadata` can be unset by posting an empty value to them in the phase's `metadata`. - /// To unset all keys in the subscription's `metadata`, update the subscription directly or unset every key individually from the phase's `metadata`. - #[serde(skip_serializing_if = "Option::is_none")] - pub metadata: Option, - - /// The account on behalf of which to charge, for each of the associated subscription's invoices. - #[serde(skip_serializing_if = "Option::is_none")] - pub on_behalf_of: Option, - - /// Whether the subscription schedule will create [prorations](https://stripe.com/docs/billing/subscriptions/prorations) when transitioning to this phase. - /// - /// The default value is `create_prorations`. - /// This setting controls prorations when a phase is started asynchronously and it is persisted as a field on the phase. - /// It's different from the request-level [proration_behavior](https://stripe.com/docs/api/subscription_schedules/update#update_subscription_schedule-proration_behavior) parameter which controls what happens if the update request affects the billing configuration of the current phase. - #[serde(skip_serializing_if = "Option::is_none")] - pub proration_behavior: Option, - - /// The date at which this phase of the subscription schedule starts or `now`. - /// - /// Must be set on the first phase. - #[serde(skip_serializing_if = "Option::is_none")] - pub start_date: Option, - - /// The data with which to automatically create a Transfer for each of the associated subscription's invoices. - #[serde(skip_serializing_if = "Option::is_none")] - pub transfer_data: Option, - - /// If set to true the entire phase is counted as a trial and the customer will not be charged for any fees. - #[serde(skip_serializing_if = "Option::is_none")] - pub trial: Option, - - /// Sets the phase to trialing from the start date to this date. - /// - /// Must be before the phase end date, can not be combined with `trial`. - #[serde(skip_serializing_if = "Option::is_none")] - pub trial_end: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct AddInvoiceItems { - /// The ID of the price object. - #[serde(skip_serializing_if = "Option::is_none")] - pub price: Option, - - /// Data used to generate a new [Price](https://stripe.com/docs/api/prices) object inline. - #[serde(skip_serializing_if = "Option::is_none")] - pub price_data: Option, - - /// Quantity for this item. - /// - /// Defaults to 1. - #[serde(skip_serializing_if = "Option::is_none")] - pub quantity: Option, - - /// The tax rates which apply to the item. - /// - /// When set, the `default_tax_rates` do not apply to this item. - #[serde(skip_serializing_if = "Option::is_none")] - pub tax_rates: Option>, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreateSubscriptionSchedulePhasesAutomaticTax { - /// Enabled automatic tax calculation which will automatically compute tax rates on all invoices generated by the subscription. - pub enabled: bool, - - /// The account that's liable for tax. - /// - /// If set, the business address and tax registrations required to perform the tax calculation are loaded from this account. - /// The tax transaction is returned in the report of the connected account. - #[serde(skip_serializing_if = "Option::is_none")] - pub liability: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreateSubscriptionSchedulePhasesItems { - /// Define thresholds at which an invoice will be sent, and the subscription advanced to a new billing period. - /// - /// When updating, pass an empty string to remove previously-defined thresholds. - #[serde(skip_serializing_if = "Option::is_none")] - pub billing_thresholds: Option, - - /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to a configuration item. - /// - /// Metadata on a configuration item will update the underlying subscription item's `metadata` when the phase is entered, adding new keys and replacing existing keys. - /// Individual keys in the subscription item's `metadata` can be unset by posting an empty value to them in the configuration item's `metadata`. - /// To unset all keys in the subscription item's `metadata`, update the subscription item directly or unset every key individually from the configuration item's `metadata`. - #[serde(skip_serializing_if = "Option::is_none")] - pub metadata: Option, - - /// The plan ID to subscribe to. - /// - /// You may specify the same ID in `plan` and `price`. - #[serde(skip_serializing_if = "Option::is_none")] - pub plan: Option, - - /// The ID of the price object. - #[serde(skip_serializing_if = "Option::is_none")] - pub price: Option, - - /// Data used to generate a new [Price](https://stripe.com/docs/api/prices) object inline. - #[serde(skip_serializing_if = "Option::is_none")] - pub price_data: Option, - - /// Quantity for the given price. - /// - /// Can be set only if the price's `usage_type` is `licensed` and not `metered`. - #[serde(skip_serializing_if = "Option::is_none")] - pub quantity: Option, - - /// A list of [Tax Rate](https://stripe.com/docs/api/tax_rates) ids. - /// - /// These Tax Rates will override the [`default_tax_rates`](https://stripe.com/docs/api/subscriptions/create#create_subscription-default_tax_rates) on the Subscription. - /// When updating, pass an empty string to remove previously-defined tax rates. - #[serde(skip_serializing_if = "Option::is_none")] - pub tax_rates: Option>, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreateSubscriptionSchedulePhasesTransferData { - /// A non-negative decimal between 0 and 100, with at most two decimal places. - /// - /// This represents the percentage of the subscription invoice total that will be transferred to the destination account. - /// By default, the entire amount is transferred to the destination. - #[serde(skip_serializing_if = "Option::is_none")] - pub amount_percent: Option, - - /// ID of an existing, connected Stripe account. - pub destination: String, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct SubscriptionScheduleBillingThresholds { - /// Monetary threshold that triggers the subscription to advance to a new billing period. - #[serde(skip_serializing_if = "Option::is_none")] - pub amount_gte: Option, - - /// Indicates if the `billing_cycle_anchor` should be reset when a threshold is reached. - /// - /// If true, `billing_cycle_anchor` will be updated to the date/time the threshold was last reached; otherwise, the value will remain unchanged. - #[serde(skip_serializing_if = "Option::is_none")] - pub reset_billing_cycle_anchor: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct SubscriptionScheduleDefaultSettingsParamsAutomaticTax { - /// Enabled automatic tax calculation which will automatically compute tax rates on all invoices generated by the subscription. - pub enabled: bool, - - /// The account that's liable for tax. - /// - /// If set, the business address and tax registrations required to perform the tax calculation are loaded from this account. - /// The tax transaction is returned in the report of the connected account. - #[serde(skip_serializing_if = "Option::is_none")] - pub liability: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct SubscriptionScheduleDefaultSettingsParamsTransferData { - /// A non-negative decimal between 0 and 100, with at most two decimal places. - /// - /// This represents the percentage of the subscription invoice total that will be transferred to the destination account. - /// By default, the entire amount is transferred to the destination. - #[serde(skip_serializing_if = "Option::is_none")] - pub amount_percent: Option, - - /// ID of an existing, connected Stripe account. - pub destination: String, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct SubscriptionScheduleInvoiceSettings { - /// The account tax IDs associated with this phase of the subscription schedule. - /// - /// Will be set on invoices generated by this phase of the subscription schedule. - #[serde(skip_serializing_if = "Option::is_none")] - pub account_tax_ids: Option>, - - /// Number of days within which a customer must pay invoices generated by this subscription schedule. - /// - /// This value will be `null` for subscription schedules where `billing=charge_automatically`. - #[serde(skip_serializing_if = "Option::is_none")] - pub days_until_due: Option, - - /// The connected account that issues the invoice. - /// - /// The invoice is presented with the branding and support information of the specified account. - #[serde(skip_serializing_if = "Option::is_none")] - pub issuer: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UpdateSubscriptionSchedulePhasesAutomaticTax { - /// Enabled automatic tax calculation which will automatically compute tax rates on all invoices generated by the subscription. - pub enabled: bool, - - /// The account that's liable for tax. - /// - /// If set, the business address and tax registrations required to perform the tax calculation are loaded from this account. - /// The tax transaction is returned in the report of the connected account. - #[serde(skip_serializing_if = "Option::is_none")] - pub liability: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UpdateSubscriptionSchedulePhasesItems { - /// Define thresholds at which an invoice will be sent, and the subscription advanced to a new billing period. - /// - /// When updating, pass an empty string to remove previously-defined thresholds. - #[serde(skip_serializing_if = "Option::is_none")] - pub billing_thresholds: Option, - - /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to a configuration item. - /// - /// Metadata on a configuration item will update the underlying subscription item's `metadata` when the phase is entered, adding new keys and replacing existing keys. - /// Individual keys in the subscription item's `metadata` can be unset by posting an empty value to them in the configuration item's `metadata`. - /// To unset all keys in the subscription item's `metadata`, update the subscription item directly or unset every key individually from the configuration item's `metadata`. - #[serde(skip_serializing_if = "Option::is_none")] - pub metadata: Option, - - /// The plan ID to subscribe to. - /// - /// You may specify the same ID in `plan` and `price`. - #[serde(skip_serializing_if = "Option::is_none")] - pub plan: Option, - - /// The ID of the price object. - #[serde(skip_serializing_if = "Option::is_none")] - pub price: Option, - - /// Data used to generate a new [Price](https://stripe.com/docs/api/prices) object inline. - #[serde(skip_serializing_if = "Option::is_none")] - pub price_data: Option, - - /// Quantity for the given price. - /// - /// Can be set only if the price's `usage_type` is `licensed` and not `metered`. - #[serde(skip_serializing_if = "Option::is_none")] - pub quantity: Option, - - /// A list of [Tax Rate](https://stripe.com/docs/api/tax_rates) ids. - /// - /// These Tax Rates will override the [`default_tax_rates`](https://stripe.com/docs/api/subscriptions/create#create_subscription-default_tax_rates) on the Subscription. - /// When updating, pass an empty string to remove previously-defined tax rates. - #[serde(skip_serializing_if = "Option::is_none")] - pub tax_rates: Option>, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UpdateSubscriptionSchedulePhasesTransferData { - /// A non-negative decimal between 0 and 100, with at most two decimal places. - /// - /// This represents the percentage of the subscription invoice total that will be transferred to the destination account. - /// By default, the entire amount is transferred to the destination. - #[serde(skip_serializing_if = "Option::is_none")] - pub amount_percent: Option, - - /// ID of an existing, connected Stripe account. - pub destination: String, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreateSubscriptionSchedulePhasesAutomaticTaxLiability { - /// The connected account being referenced when `type` is `account`. - #[serde(skip_serializing_if = "Option::is_none")] - pub account: Option, - - /// Type of the account referenced in the request. - #[serde(rename = "type")] - pub type_: CreateSubscriptionSchedulePhasesAutomaticTaxLiabilityType, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreateSubscriptionSchedulePhasesItemsBillingThresholds { - /// Number of units that meets the billing threshold to advance the subscription to a new billing period (e.g., it takes 10 $5 units to meet a $50 [monetary threshold](https://stripe.com/docs/api/subscriptions/update#update_subscription-billing_thresholds-amount_gte)). - pub usage_gte: i64, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreateSubscriptionSchedulePhasesItemsPriceData { - /// Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. - /// - /// Must be a [supported currency](https://stripe.com/docs/currencies). - pub currency: Currency, - - /// The ID of the product that this price will belong to. - pub product: String, - - /// The recurring components of a price such as `interval` and `interval_count`. - pub recurring: CreateSubscriptionSchedulePhasesItemsPriceDataRecurring, - - /// Only required if a [default tax behavior](https://stripe.com/docs/tax/products-prices-tax-categories-tax-behavior#setting-a-default-tax-behavior-(recommended)) was not provided in the Stripe Tax settings. - /// - /// Specifies whether the price is considered inclusive of taxes or exclusive of taxes. - /// One of `inclusive`, `exclusive`, or `unspecified`. - /// Once specified as either `inclusive` or `exclusive`, it cannot be changed. - #[serde(skip_serializing_if = "Option::is_none")] - pub tax_behavior: Option, - - /// A positive integer in cents (or local equivalent) (or 0 for a free price) representing how much to charge. - #[serde(skip_serializing_if = "Option::is_none")] - pub unit_amount: Option, - - /// Same as `unit_amount`, but accepts a decimal value in cents (or local equivalent) with at most 12 decimal places. - /// - /// Only one of `unit_amount` and `unit_amount_decimal` can be set. - #[serde(skip_serializing_if = "Option::is_none")] - pub unit_amount_decimal: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct InvoiceItemPriceData { - /// Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. - /// - /// Must be a [supported currency](https://stripe.com/docs/currencies). - pub currency: Currency, - - /// The ID of the product that this price will belong to. - pub product: String, - - /// Only required if a [default tax behavior](https://stripe.com/docs/tax/products-prices-tax-categories-tax-behavior#setting-a-default-tax-behavior-(recommended)) was not provided in the Stripe Tax settings. - /// - /// Specifies whether the price is considered inclusive of taxes or exclusive of taxes. - /// One of `inclusive`, `exclusive`, or `unspecified`. - /// Once specified as either `inclusive` or `exclusive`, it cannot be changed. - #[serde(skip_serializing_if = "Option::is_none")] - pub tax_behavior: Option, - - /// A positive integer in cents (or local equivalent) (or 0 for a free price) representing how much to charge. - #[serde(skip_serializing_if = "Option::is_none")] - pub unit_amount: Option, - - /// Same as `unit_amount`, but accepts a decimal value in cents (or local equivalent) with at most 12 decimal places. - /// - /// Only one of `unit_amount` and `unit_amount_decimal` can be set. - #[serde(skip_serializing_if = "Option::is_none")] - pub unit_amount_decimal: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct SubscriptionScheduleDefaultSettingsParamsAutomaticTaxLiability { - /// The connected account being referenced when `type` is `account`. - #[serde(skip_serializing_if = "Option::is_none")] - pub account: Option, - - /// Type of the account referenced in the request. - #[serde(rename = "type")] - pub type_: SubscriptionScheduleDefaultSettingsParamsAutomaticTaxLiabilityType, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct SubscriptionScheduleInvoiceSettingsIssuer { - /// The connected account being referenced when `type` is `account`. - #[serde(skip_serializing_if = "Option::is_none")] - pub account: Option, - - /// Type of the account referenced in the request. - #[serde(rename = "type")] - pub type_: SubscriptionScheduleInvoiceSettingsIssuerType, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UpdateSubscriptionSchedulePhasesAutomaticTaxLiability { - /// The connected account being referenced when `type` is `account`. - #[serde(skip_serializing_if = "Option::is_none")] - pub account: Option, - - /// Type of the account referenced in the request. - #[serde(rename = "type")] - pub type_: UpdateSubscriptionSchedulePhasesAutomaticTaxLiabilityType, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UpdateSubscriptionSchedulePhasesItemsBillingThresholds { - /// Number of units that meets the billing threshold to advance the subscription to a new billing period (e.g., it takes 10 $5 units to meet a $50 [monetary threshold](https://stripe.com/docs/api/subscriptions/update#update_subscription-billing_thresholds-amount_gte)). - pub usage_gte: i64, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UpdateSubscriptionSchedulePhasesItemsPriceData { - /// Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. - /// - /// Must be a [supported currency](https://stripe.com/docs/currencies). - pub currency: Currency, - - /// The ID of the product that this price will belong to. - pub product: String, - - /// The recurring components of a price such as `interval` and `interval_count`. - pub recurring: UpdateSubscriptionSchedulePhasesItemsPriceDataRecurring, - - /// Only required if a [default tax behavior](https://stripe.com/docs/tax/products-prices-tax-categories-tax-behavior#setting-a-default-tax-behavior-(recommended)) was not provided in the Stripe Tax settings. - /// - /// Specifies whether the price is considered inclusive of taxes or exclusive of taxes. - /// One of `inclusive`, `exclusive`, or `unspecified`. - /// Once specified as either `inclusive` or `exclusive`, it cannot be changed. - #[serde(skip_serializing_if = "Option::is_none")] - pub tax_behavior: Option, - - /// A positive integer in cents (or local equivalent) (or 0 for a free price) representing how much to charge. - #[serde(skip_serializing_if = "Option::is_none")] - pub unit_amount: Option, - - /// Same as `unit_amount`, but accepts a decimal value in cents (or local equivalent) with at most 12 decimal places. - /// - /// Only one of `unit_amount` and `unit_amount_decimal` can be set. - #[serde(skip_serializing_if = "Option::is_none")] - pub unit_amount_decimal: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreateSubscriptionSchedulePhasesItemsPriceDataRecurring { - /// Specifies billing frequency. - /// - /// Either `day`, `week`, `month` or `year`. - pub interval: CreateSubscriptionSchedulePhasesItemsPriceDataRecurringInterval, - - /// The number of intervals between subscription billings. - /// - /// For example, `interval=month` and `interval_count=3` bills every 3 months. - /// Maximum of three years interval allowed (3 years, 36 months, or 156 weeks). - #[serde(skip_serializing_if = "Option::is_none")] - pub interval_count: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UpdateSubscriptionSchedulePhasesItemsPriceDataRecurring { - /// Specifies billing frequency. - /// - /// Either `day`, `week`, `month` or `year`. - pub interval: UpdateSubscriptionSchedulePhasesItemsPriceDataRecurringInterval, - - /// The number of intervals between subscription billings. - /// - /// For example, `interval=month` and `interval_count=3` bills every 3 months. - /// Maximum of three years interval allowed (3 years, 36 months, or 156 weeks). - #[serde(skip_serializing_if = "Option::is_none")] - pub interval_count: Option, -} - -/// An enum representing the possible values of an `CreateSubscriptionSchedulePhasesAutomaticTaxLiability`'s `type` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CreateSubscriptionSchedulePhasesAutomaticTaxLiabilityType { - Account, - #[serde(rename = "self")] - Self_, -} - -impl CreateSubscriptionSchedulePhasesAutomaticTaxLiabilityType { - pub fn as_str(self) -> &'static str { - match self { - CreateSubscriptionSchedulePhasesAutomaticTaxLiabilityType::Account => "account", - CreateSubscriptionSchedulePhasesAutomaticTaxLiabilityType::Self_ => "self", - } - } -} - -impl AsRef for CreateSubscriptionSchedulePhasesAutomaticTaxLiabilityType { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for CreateSubscriptionSchedulePhasesAutomaticTaxLiabilityType { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for CreateSubscriptionSchedulePhasesAutomaticTaxLiabilityType { - fn default() -> Self { - Self::Account - } -} - -/// An enum representing the possible values of an `CreateSubscriptionSchedulePhases`'s `billing_cycle_anchor` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CreateSubscriptionSchedulePhasesBillingCycleAnchor { - Automatic, - PhaseStart, -} - -impl CreateSubscriptionSchedulePhasesBillingCycleAnchor { - pub fn as_str(self) -> &'static str { - match self { - CreateSubscriptionSchedulePhasesBillingCycleAnchor::Automatic => "automatic", - CreateSubscriptionSchedulePhasesBillingCycleAnchor::PhaseStart => "phase_start", - } - } -} - -impl AsRef for CreateSubscriptionSchedulePhasesBillingCycleAnchor { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for CreateSubscriptionSchedulePhasesBillingCycleAnchor { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for CreateSubscriptionSchedulePhasesBillingCycleAnchor { - fn default() -> Self { - Self::Automatic - } -} - -/// An enum representing the possible values of an `CreateSubscriptionSchedulePhasesItemsPriceDataRecurring`'s `interval` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CreateSubscriptionSchedulePhasesItemsPriceDataRecurringInterval { - Day, - Month, - Week, - Year, -} - -impl CreateSubscriptionSchedulePhasesItemsPriceDataRecurringInterval { - pub fn as_str(self) -> &'static str { - match self { - CreateSubscriptionSchedulePhasesItemsPriceDataRecurringInterval::Day => "day", - CreateSubscriptionSchedulePhasesItemsPriceDataRecurringInterval::Month => "month", - CreateSubscriptionSchedulePhasesItemsPriceDataRecurringInterval::Week => "week", - CreateSubscriptionSchedulePhasesItemsPriceDataRecurringInterval::Year => "year", - } - } -} - -impl AsRef for CreateSubscriptionSchedulePhasesItemsPriceDataRecurringInterval { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for CreateSubscriptionSchedulePhasesItemsPriceDataRecurringInterval { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for CreateSubscriptionSchedulePhasesItemsPriceDataRecurringInterval { - fn default() -> Self { - Self::Day - } -} - -/// An enum representing the possible values of an `CreateSubscriptionSchedulePhasesItemsPriceData`'s `tax_behavior` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CreateSubscriptionSchedulePhasesItemsPriceDataTaxBehavior { - Exclusive, - Inclusive, - Unspecified, -} - -impl CreateSubscriptionSchedulePhasesItemsPriceDataTaxBehavior { - pub fn as_str(self) -> &'static str { - match self { - CreateSubscriptionSchedulePhasesItemsPriceDataTaxBehavior::Exclusive => "exclusive", - CreateSubscriptionSchedulePhasesItemsPriceDataTaxBehavior::Inclusive => "inclusive", - CreateSubscriptionSchedulePhasesItemsPriceDataTaxBehavior::Unspecified => "unspecified", - } - } -} - -impl AsRef for CreateSubscriptionSchedulePhasesItemsPriceDataTaxBehavior { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for CreateSubscriptionSchedulePhasesItemsPriceDataTaxBehavior { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for CreateSubscriptionSchedulePhasesItemsPriceDataTaxBehavior { - fn default() -> Self { - Self::Exclusive - } -} - -/// An enum representing the possible values of an `InvoiceItemPriceData`'s `tax_behavior` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum InvoiceItemPriceDataTaxBehavior { - Exclusive, - Inclusive, - Unspecified, -} - -impl InvoiceItemPriceDataTaxBehavior { - pub fn as_str(self) -> &'static str { - match self { - InvoiceItemPriceDataTaxBehavior::Exclusive => "exclusive", - InvoiceItemPriceDataTaxBehavior::Inclusive => "inclusive", - InvoiceItemPriceDataTaxBehavior::Unspecified => "unspecified", - } - } -} - -impl AsRef for InvoiceItemPriceDataTaxBehavior { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for InvoiceItemPriceDataTaxBehavior { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for InvoiceItemPriceDataTaxBehavior { - fn default() -> Self { - Self::Exclusive - } -} - -/// An enum representing the possible values of an `SubscriptionSchedulePhaseConfiguration`'s `proration_behavior` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum SubscriptionProrationBehavior { - AlwaysInvoice, - CreateProrations, - None, -} - -impl SubscriptionProrationBehavior { - pub fn as_str(self) -> &'static str { - match self { - SubscriptionProrationBehavior::AlwaysInvoice => "always_invoice", - SubscriptionProrationBehavior::CreateProrations => "create_prorations", - SubscriptionProrationBehavior::None => "none", - } - } -} - -impl AsRef for SubscriptionProrationBehavior { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for SubscriptionProrationBehavior { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for SubscriptionProrationBehavior { - fn default() -> Self { - Self::AlwaysInvoice - } -} - -/// An enum representing the possible values of an `SubscriptionScheduleDefaultSettings`'s `billing_cycle_anchor` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum SubscriptionScheduleDefaultSettingsBillingCycleAnchor { - Automatic, - PhaseStart, -} - -impl SubscriptionScheduleDefaultSettingsBillingCycleAnchor { - pub fn as_str(self) -> &'static str { - match self { - SubscriptionScheduleDefaultSettingsBillingCycleAnchor::Automatic => "automatic", - SubscriptionScheduleDefaultSettingsBillingCycleAnchor::PhaseStart => "phase_start", - } - } -} - -impl AsRef for SubscriptionScheduleDefaultSettingsBillingCycleAnchor { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for SubscriptionScheduleDefaultSettingsBillingCycleAnchor { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for SubscriptionScheduleDefaultSettingsBillingCycleAnchor { - fn default() -> Self { - Self::Automatic - } -} - -/// An enum representing the possible values of an `SubscriptionScheduleDefaultSettings`'s `collection_method` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum SubscriptionScheduleDefaultSettingsCollectionMethod { - ChargeAutomatically, - SendInvoice, -} - -impl SubscriptionScheduleDefaultSettingsCollectionMethod { - pub fn as_str(self) -> &'static str { - match self { - SubscriptionScheduleDefaultSettingsCollectionMethod::ChargeAutomatically => { - "charge_automatically" - } - SubscriptionScheduleDefaultSettingsCollectionMethod::SendInvoice => "send_invoice", - } - } -} - -impl AsRef for SubscriptionScheduleDefaultSettingsCollectionMethod { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for SubscriptionScheduleDefaultSettingsCollectionMethod { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for SubscriptionScheduleDefaultSettingsCollectionMethod { - fn default() -> Self { - Self::ChargeAutomatically - } -} - -/// An enum representing the possible values of an `SubscriptionScheduleDefaultSettingsParamsAutomaticTaxLiability`'s `type` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum SubscriptionScheduleDefaultSettingsParamsAutomaticTaxLiabilityType { - Account, - #[serde(rename = "self")] - Self_, -} - -impl SubscriptionScheduleDefaultSettingsParamsAutomaticTaxLiabilityType { - pub fn as_str(self) -> &'static str { - match self { - SubscriptionScheduleDefaultSettingsParamsAutomaticTaxLiabilityType::Account => { - "account" - } - SubscriptionScheduleDefaultSettingsParamsAutomaticTaxLiabilityType::Self_ => "self", - } - } -} - -impl AsRef for SubscriptionScheduleDefaultSettingsParamsAutomaticTaxLiabilityType { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for SubscriptionScheduleDefaultSettingsParamsAutomaticTaxLiabilityType { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for SubscriptionScheduleDefaultSettingsParamsAutomaticTaxLiabilityType { - fn default() -> Self { - Self::Account - } -} - -/// An enum representing the possible values of an `SubscriptionScheduleDefaultSettingsParams`'s `billing_cycle_anchor` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum SubscriptionScheduleDefaultSettingsParamsBillingCycleAnchor { - Automatic, - PhaseStart, -} - -impl SubscriptionScheduleDefaultSettingsParamsBillingCycleAnchor { - pub fn as_str(self) -> &'static str { - match self { - SubscriptionScheduleDefaultSettingsParamsBillingCycleAnchor::Automatic => "automatic", - SubscriptionScheduleDefaultSettingsParamsBillingCycleAnchor::PhaseStart => { - "phase_start" - } - } - } -} - -impl AsRef for SubscriptionScheduleDefaultSettingsParamsBillingCycleAnchor { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for SubscriptionScheduleDefaultSettingsParamsBillingCycleAnchor { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for SubscriptionScheduleDefaultSettingsParamsBillingCycleAnchor { - fn default() -> Self { - Self::Automatic - } -} - -/// An enum representing the possible values of an `SubscriptionSchedule`'s `end_behavior` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum SubscriptionScheduleEndBehavior { - Cancel, - None, - Release, - Renew, -} - -impl SubscriptionScheduleEndBehavior { - pub fn as_str(self) -> &'static str { - match self { - SubscriptionScheduleEndBehavior::Cancel => "cancel", - SubscriptionScheduleEndBehavior::None => "none", - SubscriptionScheduleEndBehavior::Release => "release", - SubscriptionScheduleEndBehavior::Renew => "renew", - } - } -} - -impl AsRef for SubscriptionScheduleEndBehavior { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for SubscriptionScheduleEndBehavior { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for SubscriptionScheduleEndBehavior { - fn default() -> Self { - Self::Cancel - } -} - -/// An enum representing the possible values of an `SubscriptionScheduleInvoiceSettingsIssuer`'s `type` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum SubscriptionScheduleInvoiceSettingsIssuerType { - Account, - #[serde(rename = "self")] - Self_, -} - -impl SubscriptionScheduleInvoiceSettingsIssuerType { - pub fn as_str(self) -> &'static str { - match self { - SubscriptionScheduleInvoiceSettingsIssuerType::Account => "account", - SubscriptionScheduleInvoiceSettingsIssuerType::Self_ => "self", - } - } -} - -impl AsRef for SubscriptionScheduleInvoiceSettingsIssuerType { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for SubscriptionScheduleInvoiceSettingsIssuerType { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for SubscriptionScheduleInvoiceSettingsIssuerType { - fn default() -> Self { - Self::Account - } -} - -/// An enum representing the possible values of an `SubscriptionSchedulePhaseConfiguration`'s `billing_cycle_anchor` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum SubscriptionSchedulePhaseConfigurationBillingCycleAnchor { - Automatic, - PhaseStart, -} - -impl SubscriptionSchedulePhaseConfigurationBillingCycleAnchor { - pub fn as_str(self) -> &'static str { - match self { - SubscriptionSchedulePhaseConfigurationBillingCycleAnchor::Automatic => "automatic", - SubscriptionSchedulePhaseConfigurationBillingCycleAnchor::PhaseStart => "phase_start", - } - } -} - -impl AsRef for SubscriptionSchedulePhaseConfigurationBillingCycleAnchor { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for SubscriptionSchedulePhaseConfigurationBillingCycleAnchor { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for SubscriptionSchedulePhaseConfigurationBillingCycleAnchor { - fn default() -> Self { - Self::Automatic - } -} - -/// An enum representing the possible values of an `SubscriptionSchedule`'s `status` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum SubscriptionScheduleStatus { - Active, - Canceled, - Completed, - NotStarted, - Released, -} - -impl SubscriptionScheduleStatus { - pub fn as_str(self) -> &'static str { - match self { - SubscriptionScheduleStatus::Active => "active", - SubscriptionScheduleStatus::Canceled => "canceled", - SubscriptionScheduleStatus::Completed => "completed", - SubscriptionScheduleStatus::NotStarted => "not_started", - SubscriptionScheduleStatus::Released => "released", - } - } -} - -impl AsRef for SubscriptionScheduleStatus { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for SubscriptionScheduleStatus { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for SubscriptionScheduleStatus { - fn default() -> Self { - Self::Active - } -} - -/// An enum representing the possible values of an `UpdateSubscriptionSchedulePhasesAutomaticTaxLiability`'s `type` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum UpdateSubscriptionSchedulePhasesAutomaticTaxLiabilityType { - Account, - #[serde(rename = "self")] - Self_, -} - -impl UpdateSubscriptionSchedulePhasesAutomaticTaxLiabilityType { - pub fn as_str(self) -> &'static str { - match self { - UpdateSubscriptionSchedulePhasesAutomaticTaxLiabilityType::Account => "account", - UpdateSubscriptionSchedulePhasesAutomaticTaxLiabilityType::Self_ => "self", - } - } -} - -impl AsRef for UpdateSubscriptionSchedulePhasesAutomaticTaxLiabilityType { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for UpdateSubscriptionSchedulePhasesAutomaticTaxLiabilityType { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for UpdateSubscriptionSchedulePhasesAutomaticTaxLiabilityType { - fn default() -> Self { - Self::Account - } -} - -/// An enum representing the possible values of an `UpdateSubscriptionSchedulePhases`'s `billing_cycle_anchor` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum UpdateSubscriptionSchedulePhasesBillingCycleAnchor { - Automatic, - PhaseStart, -} - -impl UpdateSubscriptionSchedulePhasesBillingCycleAnchor { - pub fn as_str(self) -> &'static str { - match self { - UpdateSubscriptionSchedulePhasesBillingCycleAnchor::Automatic => "automatic", - UpdateSubscriptionSchedulePhasesBillingCycleAnchor::PhaseStart => "phase_start", - } - } -} - -impl AsRef for UpdateSubscriptionSchedulePhasesBillingCycleAnchor { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for UpdateSubscriptionSchedulePhasesBillingCycleAnchor { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for UpdateSubscriptionSchedulePhasesBillingCycleAnchor { - fn default() -> Self { - Self::Automatic - } -} - -/// An enum representing the possible values of an `UpdateSubscriptionSchedulePhasesItemsPriceDataRecurring`'s `interval` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum UpdateSubscriptionSchedulePhasesItemsPriceDataRecurringInterval { - Day, - Month, - Week, - Year, -} - -impl UpdateSubscriptionSchedulePhasesItemsPriceDataRecurringInterval { - pub fn as_str(self) -> &'static str { - match self { - UpdateSubscriptionSchedulePhasesItemsPriceDataRecurringInterval::Day => "day", - UpdateSubscriptionSchedulePhasesItemsPriceDataRecurringInterval::Month => "month", - UpdateSubscriptionSchedulePhasesItemsPriceDataRecurringInterval::Week => "week", - UpdateSubscriptionSchedulePhasesItemsPriceDataRecurringInterval::Year => "year", - } - } -} - -impl AsRef for UpdateSubscriptionSchedulePhasesItemsPriceDataRecurringInterval { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for UpdateSubscriptionSchedulePhasesItemsPriceDataRecurringInterval { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for UpdateSubscriptionSchedulePhasesItemsPriceDataRecurringInterval { - fn default() -> Self { - Self::Day - } -} - -/// An enum representing the possible values of an `UpdateSubscriptionSchedulePhasesItemsPriceData`'s `tax_behavior` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum UpdateSubscriptionSchedulePhasesItemsPriceDataTaxBehavior { - Exclusive, - Inclusive, - Unspecified, -} - -impl UpdateSubscriptionSchedulePhasesItemsPriceDataTaxBehavior { - pub fn as_str(self) -> &'static str { - match self { - UpdateSubscriptionSchedulePhasesItemsPriceDataTaxBehavior::Exclusive => "exclusive", - UpdateSubscriptionSchedulePhasesItemsPriceDataTaxBehavior::Inclusive => "inclusive", - UpdateSubscriptionSchedulePhasesItemsPriceDataTaxBehavior::Unspecified => "unspecified", - } - } -} - -impl AsRef for UpdateSubscriptionSchedulePhasesItemsPriceDataTaxBehavior { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for UpdateSubscriptionSchedulePhasesItemsPriceDataTaxBehavior { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for UpdateSubscriptionSchedulePhasesItemsPriceDataTaxBehavior { - fn default() -> Self { - Self::Exclusive - } -} diff --git a/src/resources/generated/subscription_schedule_aborted.rs b/src/resources/generated/subscription_schedule_aborted.rs deleted file mode 100644 index 43bce4681..000000000 --- a/src/resources/generated/subscription_schedule_aborted.rs +++ /dev/null @@ -1,10 +0,0 @@ -// ====================================== -// This file was automatically generated. -// ====================================== - -use serde::{Deserialize, Serialize}; - -/// The resource representing a Stripe "subscription_schedule.aborted". -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct SubscriptionScheduleAborted { -} diff --git a/src/resources/generated/subscription_schedule_canceled.rs b/src/resources/generated/subscription_schedule_canceled.rs deleted file mode 100644 index 3854a27e2..000000000 --- a/src/resources/generated/subscription_schedule_canceled.rs +++ /dev/null @@ -1,10 +0,0 @@ -// ====================================== -// This file was automatically generated. -// ====================================== - -use serde::{Deserialize, Serialize}; - -/// The resource representing a Stripe "subscription_schedule.canceled". -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct SubscriptionScheduleCanceled { -} diff --git a/src/resources/generated/subscription_schedule_completed.rs b/src/resources/generated/subscription_schedule_completed.rs deleted file mode 100644 index 0714375fb..000000000 --- a/src/resources/generated/subscription_schedule_completed.rs +++ /dev/null @@ -1,10 +0,0 @@ -// ====================================== -// This file was automatically generated. -// ====================================== - -use serde::{Deserialize, Serialize}; - -/// The resource representing a Stripe "subscription_schedule.completed". -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct SubscriptionScheduleCompleted { -} diff --git a/src/resources/generated/subscription_schedule_created.rs b/src/resources/generated/subscription_schedule_created.rs deleted file mode 100644 index 4e2463a9e..000000000 --- a/src/resources/generated/subscription_schedule_created.rs +++ /dev/null @@ -1,10 +0,0 @@ -// ====================================== -// This file was automatically generated. -// ====================================== - -use serde::{Deserialize, Serialize}; - -/// The resource representing a Stripe "subscription_schedule.created". -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct SubscriptionScheduleCreated { -} diff --git a/src/resources/generated/subscription_schedule_expiring.rs b/src/resources/generated/subscription_schedule_expiring.rs deleted file mode 100644 index b03b76a23..000000000 --- a/src/resources/generated/subscription_schedule_expiring.rs +++ /dev/null @@ -1,10 +0,0 @@ -// ====================================== -// This file was automatically generated. -// ====================================== - -use serde::{Deserialize, Serialize}; - -/// The resource representing a Stripe "subscription_schedule.expiring". -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct SubscriptionScheduleExpiring { -} diff --git a/src/resources/generated/subscription_schedule_released.rs b/src/resources/generated/subscription_schedule_released.rs deleted file mode 100644 index c17ffd3f0..000000000 --- a/src/resources/generated/subscription_schedule_released.rs +++ /dev/null @@ -1,10 +0,0 @@ -// ====================================== -// This file was automatically generated. -// ====================================== - -use serde::{Deserialize, Serialize}; - -/// The resource representing a Stripe "subscription_schedule.released". -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct SubscriptionScheduleReleased { -} diff --git a/src/resources/generated/subscription_schedule_updated.rs b/src/resources/generated/subscription_schedule_updated.rs deleted file mode 100644 index e3c689158..000000000 --- a/src/resources/generated/subscription_schedule_updated.rs +++ /dev/null @@ -1,10 +0,0 @@ -// ====================================== -// This file was automatically generated. -// ====================================== - -use serde::{Deserialize, Serialize}; - -/// The resource representing a Stripe "subscription_schedule.updated". -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct SubscriptionScheduleUpdated { -} diff --git a/src/resources/generated/subscriptions_trials_resource_trial_settings.rs b/src/resources/generated/subscriptions_trials_resource_trial_settings.rs deleted file mode 100644 index 026391f40..000000000 --- a/src/resources/generated/subscriptions_trials_resource_trial_settings.rs +++ /dev/null @@ -1,55 +0,0 @@ -// ====================================== -// This file was automatically generated. -// ====================================== - -use serde::{Deserialize, Serialize}; - -/// The resource representing a Stripe "SubscriptionsTrialsResourceTrialSettings". -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct SubscriptionsTrialsResourceTrialSettings { - pub end_behavior: SubscriptionsTrialsResourceEndBehavior, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct SubscriptionsTrialsResourceEndBehavior { - /// Indicates how the subscription should change when the trial ends if the user did not provide a payment method. - pub missing_payment_method: SubscriptionsTrialsResourceEndBehaviorMissingPaymentMethod, -} - -/// An enum representing the possible values of an `SubscriptionsTrialsResourceEndBehavior`'s `missing_payment_method` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum SubscriptionsTrialsResourceEndBehaviorMissingPaymentMethod { - Cancel, - CreateInvoice, - Pause, -} - -impl SubscriptionsTrialsResourceEndBehaviorMissingPaymentMethod { - pub fn as_str(self) -> &'static str { - match self { - SubscriptionsTrialsResourceEndBehaviorMissingPaymentMethod::Cancel => "cancel", - SubscriptionsTrialsResourceEndBehaviorMissingPaymentMethod::CreateInvoice => { - "create_invoice" - } - SubscriptionsTrialsResourceEndBehaviorMissingPaymentMethod::Pause => "pause", - } - } -} - -impl AsRef for SubscriptionsTrialsResourceEndBehaviorMissingPaymentMethod { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for SubscriptionsTrialsResourceEndBehaviorMissingPaymentMethod { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for SubscriptionsTrialsResourceEndBehaviorMissingPaymentMethod { - fn default() -> Self { - Self::Cancel - } -} diff --git a/src/resources/generated/tax_calculation.rs b/src/resources/generated/tax_calculation.rs deleted file mode 100644 index 6f98acdc0..000000000 --- a/src/resources/generated/tax_calculation.rs +++ /dev/null @@ -1,560 +0,0 @@ -// ====================================== -// This file was automatically generated. -// ====================================== - -use serde::{Deserialize, Serialize}; - -use crate::ids::TaxCalculationId; -use crate::params::{List, Object, Timestamp}; -use crate::resources::{Currency, TaxCalculationLineItem, TaxProductResourceCustomerDetails}; - -/// The resource representing a Stripe "TaxProductResourceTaxCalculation". -/// -/// For more details see -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct TaxCalculation { - /// Unique identifier for the calculation. - pub id: TaxCalculationId, - - /// Total after taxes. - pub amount_total: i64, - - /// Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. - /// - /// Must be a [supported currency](https://stripe.com/docs/currencies). - pub currency: Currency, - - /// The ID of an existing [Customer](https://stripe.com/docs/api/customers/object) used for the resource. - pub customer: Option, - - pub customer_details: TaxProductResourceCustomerDetails, - - /// Timestamp of date at which the tax calculation will expire. - pub expires_at: Option, - - /// The list of items the customer is purchasing. - pub line_items: Option>, - - /// Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. - pub livemode: bool, - - /// The shipping cost details for the calculation. - pub shipping_cost: Option, - - /// The amount of tax to be collected on top of the line item prices. - pub tax_amount_exclusive: i64, - - /// The amount of tax already included in the line item prices. - pub tax_amount_inclusive: i64, - - /// Breakdown of individual tax amounts that add up to the total. - pub tax_breakdown: Vec, - - /// Timestamp of date at which the tax rules and rates in effect applies for the calculation. - pub tax_date: Timestamp, -} - -impl Object for TaxCalculation { - type Id = TaxCalculationId; - fn id(&self) -> Self::Id { - self.id.clone() - } - fn object(&self) -> &'static str { - "tax.calculation" - } -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct TaxProductResourceTaxBreakdown { - /// The amount of tax, in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal). - pub amount: i64, - - /// Specifies whether the tax amount is included in the line item amount. - pub inclusive: bool, - - pub tax_rate_details: TaxProductResourceTaxRateDetails, - - /// The reasoning behind this tax, for example, if the product is tax exempt. - /// - /// We might extend the possible values for this field to support new tax rules. - pub taxability_reason: TaxProductResourceTaxBreakdownTaxabilityReason, - - /// The amount on which tax is calculated, in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal). - pub taxable_amount: i64, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct TaxProductResourceTaxCalculationShippingCost { - /// The shipping amount in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal). - /// - /// If `tax_behavior=inclusive`, then this amount includes taxes. - /// Otherwise, taxes were calculated on top of this amount. - pub amount: i64, - - /// The amount of tax calculated for shipping, in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal). - pub amount_tax: i64, - - /// The ID of an existing [ShippingRate](https://stripe.com/docs/api/shipping_rates/object). - #[serde(skip_serializing_if = "Option::is_none")] - pub shipping_rate: Option, - - /// Specifies whether the `amount` includes taxes. - /// - /// If `tax_behavior=inclusive`, then the amount includes taxes. - pub tax_behavior: TaxProductResourceTaxCalculationShippingCostTaxBehavior, - - /// Detailed account of taxes relevant to shipping cost. - #[serde(skip_serializing_if = "Option::is_none")] - pub tax_breakdown: Option>, - - /// The [tax code](https://stripe.com/docs/tax/tax-categories) ID used for shipping. - pub tax_code: String, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct TaxProductResourceLineItemTaxBreakdown { - /// The amount of tax, in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal). - pub amount: i64, - - pub jurisdiction: TaxProductResourceJurisdiction, - - /// Indicates whether the jurisdiction was determined by the origin (merchant's address) or destination (customer's address). - pub sourcing: TaxProductResourceLineItemTaxBreakdownSourcing, - - /// Details regarding the rate for this tax. - /// - /// This field will be `null` when the tax is not imposed, for example if the product is exempt from tax. - pub tax_rate_details: Option, - - /// The reasoning behind this tax, for example, if the product is tax exempt. - /// - /// The possible values for this field may be extended as new tax rules are supported. - pub taxability_reason: TaxProductResourceLineItemTaxBreakdownTaxabilityReason, - - /// The amount on which tax is calculated, in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal). - pub taxable_amount: i64, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct TaxProductResourceJurisdiction { - /// Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). - pub country: String, - - /// A human-readable name for the jurisdiction imposing the tax. - pub display_name: String, - - /// Indicates the level of the jurisdiction imposing the tax. - pub level: TaxProductResourceJurisdictionLevel, - - /// [ISO 3166-2 subdivision code](https://en.wikipedia.org/wiki/ISO_3166-2:US), without country prefix. - /// - /// For example, "NY" for New York, United States. - pub state: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct TaxProductResourceLineItemTaxRateDetails { - /// A localized display name for tax type, intended to be human-readable. - /// - /// For example, "Local Sales and Use Tax", "Value-added tax (VAT)", or "Umsatzsteuer (USt.)". - pub display_name: String, - - /// The tax rate percentage as a string. - /// - /// For example, 8.5% is represented as "8.5". - pub percentage_decimal: String, - - /// The tax type, such as `vat` or `sales_tax`. - pub tax_type: TaxProductResourceLineItemTaxRateDetailsTaxType, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct TaxProductResourceTaxRateDetails { - /// Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). - pub country: Option, - - /// The tax rate percentage as a string. - /// - /// For example, 8.5% is represented as `"8.5"`. - pub percentage_decimal: String, - - /// State, county, province, or region. - pub state: Option, - - /// The tax type, such as `vat` or `sales_tax`. - pub tax_type: Option, -} - -/// An enum representing the possible values of an `TaxProductResourceJurisdiction`'s `level` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum TaxProductResourceJurisdictionLevel { - City, - Country, - County, - District, - State, -} - -impl TaxProductResourceJurisdictionLevel { - pub fn as_str(self) -> &'static str { - match self { - TaxProductResourceJurisdictionLevel::City => "city", - TaxProductResourceJurisdictionLevel::Country => "country", - TaxProductResourceJurisdictionLevel::County => "county", - TaxProductResourceJurisdictionLevel::District => "district", - TaxProductResourceJurisdictionLevel::State => "state", - } - } -} - -impl AsRef for TaxProductResourceJurisdictionLevel { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for TaxProductResourceJurisdictionLevel { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for TaxProductResourceJurisdictionLevel { - fn default() -> Self { - Self::City - } -} - -/// An enum representing the possible values of an `TaxProductResourceLineItemTaxBreakdown`'s `sourcing` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum TaxProductResourceLineItemTaxBreakdownSourcing { - Destination, - Origin, -} - -impl TaxProductResourceLineItemTaxBreakdownSourcing { - pub fn as_str(self) -> &'static str { - match self { - TaxProductResourceLineItemTaxBreakdownSourcing::Destination => "destination", - TaxProductResourceLineItemTaxBreakdownSourcing::Origin => "origin", - } - } -} - -impl AsRef for TaxProductResourceLineItemTaxBreakdownSourcing { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for TaxProductResourceLineItemTaxBreakdownSourcing { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for TaxProductResourceLineItemTaxBreakdownSourcing { - fn default() -> Self { - Self::Destination - } -} - -/// An enum representing the possible values of an `TaxProductResourceLineItemTaxBreakdown`'s `taxability_reason` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum TaxProductResourceLineItemTaxBreakdownTaxabilityReason { - CustomerExempt, - NotCollecting, - NotSubjectToTax, - NotSupported, - PortionProductExempt, - PortionReducedRated, - PortionStandardRated, - ProductExempt, - ProductExemptHoliday, - ProportionallyRated, - ReducedRated, - ReverseCharge, - StandardRated, - TaxableBasisReduced, - ZeroRated, -} - -impl TaxProductResourceLineItemTaxBreakdownTaxabilityReason { - pub fn as_str(self) -> &'static str { - match self { - TaxProductResourceLineItemTaxBreakdownTaxabilityReason::CustomerExempt => { - "customer_exempt" - } - TaxProductResourceLineItemTaxBreakdownTaxabilityReason::NotCollecting => { - "not_collecting" - } - TaxProductResourceLineItemTaxBreakdownTaxabilityReason::NotSubjectToTax => { - "not_subject_to_tax" - } - TaxProductResourceLineItemTaxBreakdownTaxabilityReason::NotSupported => "not_supported", - TaxProductResourceLineItemTaxBreakdownTaxabilityReason::PortionProductExempt => { - "portion_product_exempt" - } - TaxProductResourceLineItemTaxBreakdownTaxabilityReason::PortionReducedRated => { - "portion_reduced_rated" - } - TaxProductResourceLineItemTaxBreakdownTaxabilityReason::PortionStandardRated => { - "portion_standard_rated" - } - TaxProductResourceLineItemTaxBreakdownTaxabilityReason::ProductExempt => { - "product_exempt" - } - TaxProductResourceLineItemTaxBreakdownTaxabilityReason::ProductExemptHoliday => { - "product_exempt_holiday" - } - TaxProductResourceLineItemTaxBreakdownTaxabilityReason::ProportionallyRated => { - "proportionally_rated" - } - TaxProductResourceLineItemTaxBreakdownTaxabilityReason::ReducedRated => "reduced_rated", - TaxProductResourceLineItemTaxBreakdownTaxabilityReason::ReverseCharge => { - "reverse_charge" - } - TaxProductResourceLineItemTaxBreakdownTaxabilityReason::StandardRated => { - "standard_rated" - } - TaxProductResourceLineItemTaxBreakdownTaxabilityReason::TaxableBasisReduced => { - "taxable_basis_reduced" - } - TaxProductResourceLineItemTaxBreakdownTaxabilityReason::ZeroRated => "zero_rated", - } - } -} - -impl AsRef for TaxProductResourceLineItemTaxBreakdownTaxabilityReason { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for TaxProductResourceLineItemTaxBreakdownTaxabilityReason { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for TaxProductResourceLineItemTaxBreakdownTaxabilityReason { - fn default() -> Self { - Self::CustomerExempt - } -} - -/// An enum representing the possible values of an `TaxProductResourceLineItemTaxRateDetails`'s `tax_type` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum TaxProductResourceLineItemTaxRateDetailsTaxType { - AmusementTax, - CommunicationsTax, - Gst, - Hst, - Igst, - Jct, - LeaseTax, - Pst, - Qst, - Rst, - SalesTax, - Vat, -} - -impl TaxProductResourceLineItemTaxRateDetailsTaxType { - pub fn as_str(self) -> &'static str { - match self { - TaxProductResourceLineItemTaxRateDetailsTaxType::AmusementTax => "amusement_tax", - TaxProductResourceLineItemTaxRateDetailsTaxType::CommunicationsTax => { - "communications_tax" - } - TaxProductResourceLineItemTaxRateDetailsTaxType::Gst => "gst", - TaxProductResourceLineItemTaxRateDetailsTaxType::Hst => "hst", - TaxProductResourceLineItemTaxRateDetailsTaxType::Igst => "igst", - TaxProductResourceLineItemTaxRateDetailsTaxType::Jct => "jct", - TaxProductResourceLineItemTaxRateDetailsTaxType::LeaseTax => "lease_tax", - TaxProductResourceLineItemTaxRateDetailsTaxType::Pst => "pst", - TaxProductResourceLineItemTaxRateDetailsTaxType::Qst => "qst", - TaxProductResourceLineItemTaxRateDetailsTaxType::Rst => "rst", - TaxProductResourceLineItemTaxRateDetailsTaxType::SalesTax => "sales_tax", - TaxProductResourceLineItemTaxRateDetailsTaxType::Vat => "vat", - } - } -} - -impl AsRef for TaxProductResourceLineItemTaxRateDetailsTaxType { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for TaxProductResourceLineItemTaxRateDetailsTaxType { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for TaxProductResourceLineItemTaxRateDetailsTaxType { - fn default() -> Self { - Self::AmusementTax - } -} - -/// An enum representing the possible values of an `TaxProductResourceTaxBreakdown`'s `taxability_reason` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum TaxProductResourceTaxBreakdownTaxabilityReason { - CustomerExempt, - NotCollecting, - NotSubjectToTax, - NotSupported, - PortionProductExempt, - PortionReducedRated, - PortionStandardRated, - ProductExempt, - ProductExemptHoliday, - ProportionallyRated, - ReducedRated, - ReverseCharge, - StandardRated, - TaxableBasisReduced, - ZeroRated, -} - -impl TaxProductResourceTaxBreakdownTaxabilityReason { - pub fn as_str(self) -> &'static str { - match self { - TaxProductResourceTaxBreakdownTaxabilityReason::CustomerExempt => "customer_exempt", - TaxProductResourceTaxBreakdownTaxabilityReason::NotCollecting => "not_collecting", - TaxProductResourceTaxBreakdownTaxabilityReason::NotSubjectToTax => "not_subject_to_tax", - TaxProductResourceTaxBreakdownTaxabilityReason::NotSupported => "not_supported", - TaxProductResourceTaxBreakdownTaxabilityReason::PortionProductExempt => { - "portion_product_exempt" - } - TaxProductResourceTaxBreakdownTaxabilityReason::PortionReducedRated => { - "portion_reduced_rated" - } - TaxProductResourceTaxBreakdownTaxabilityReason::PortionStandardRated => { - "portion_standard_rated" - } - TaxProductResourceTaxBreakdownTaxabilityReason::ProductExempt => "product_exempt", - TaxProductResourceTaxBreakdownTaxabilityReason::ProductExemptHoliday => { - "product_exempt_holiday" - } - TaxProductResourceTaxBreakdownTaxabilityReason::ProportionallyRated => { - "proportionally_rated" - } - TaxProductResourceTaxBreakdownTaxabilityReason::ReducedRated => "reduced_rated", - TaxProductResourceTaxBreakdownTaxabilityReason::ReverseCharge => "reverse_charge", - TaxProductResourceTaxBreakdownTaxabilityReason::StandardRated => "standard_rated", - TaxProductResourceTaxBreakdownTaxabilityReason::TaxableBasisReduced => { - "taxable_basis_reduced" - } - TaxProductResourceTaxBreakdownTaxabilityReason::ZeroRated => "zero_rated", - } - } -} - -impl AsRef for TaxProductResourceTaxBreakdownTaxabilityReason { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for TaxProductResourceTaxBreakdownTaxabilityReason { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for TaxProductResourceTaxBreakdownTaxabilityReason { - fn default() -> Self { - Self::CustomerExempt - } -} - -/// An enum representing the possible values of an `TaxProductResourceTaxCalculationShippingCost`'s `tax_behavior` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum TaxProductResourceTaxCalculationShippingCostTaxBehavior { - Exclusive, - Inclusive, -} - -impl TaxProductResourceTaxCalculationShippingCostTaxBehavior { - pub fn as_str(self) -> &'static str { - match self { - TaxProductResourceTaxCalculationShippingCostTaxBehavior::Exclusive => "exclusive", - TaxProductResourceTaxCalculationShippingCostTaxBehavior::Inclusive => "inclusive", - } - } -} - -impl AsRef for TaxProductResourceTaxCalculationShippingCostTaxBehavior { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for TaxProductResourceTaxCalculationShippingCostTaxBehavior { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for TaxProductResourceTaxCalculationShippingCostTaxBehavior { - fn default() -> Self { - Self::Exclusive - } -} - -/// An enum representing the possible values of an `TaxProductResourceTaxRateDetails`'s `tax_type` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum TaxProductResourceTaxRateDetailsTaxType { - AmusementTax, - CommunicationsTax, - Gst, - Hst, - Igst, - Jct, - LeaseTax, - Pst, - Qst, - Rst, - SalesTax, - Vat, -} - -impl TaxProductResourceTaxRateDetailsTaxType { - pub fn as_str(self) -> &'static str { - match self { - TaxProductResourceTaxRateDetailsTaxType::AmusementTax => "amusement_tax", - TaxProductResourceTaxRateDetailsTaxType::CommunicationsTax => "communications_tax", - TaxProductResourceTaxRateDetailsTaxType::Gst => "gst", - TaxProductResourceTaxRateDetailsTaxType::Hst => "hst", - TaxProductResourceTaxRateDetailsTaxType::Igst => "igst", - TaxProductResourceTaxRateDetailsTaxType::Jct => "jct", - TaxProductResourceTaxRateDetailsTaxType::LeaseTax => "lease_tax", - TaxProductResourceTaxRateDetailsTaxType::Pst => "pst", - TaxProductResourceTaxRateDetailsTaxType::Qst => "qst", - TaxProductResourceTaxRateDetailsTaxType::Rst => "rst", - TaxProductResourceTaxRateDetailsTaxType::SalesTax => "sales_tax", - TaxProductResourceTaxRateDetailsTaxType::Vat => "vat", - } - } -} - -impl AsRef for TaxProductResourceTaxRateDetailsTaxType { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for TaxProductResourceTaxRateDetailsTaxType { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for TaxProductResourceTaxRateDetailsTaxType { - fn default() -> Self { - Self::AmusementTax - } -} diff --git a/src/resources/generated/tax_calculation_line_item.rs b/src/resources/generated/tax_calculation_line_item.rs deleted file mode 100644 index 2ced34f23..000000000 --- a/src/resources/generated/tax_calculation_line_item.rs +++ /dev/null @@ -1,364 +0,0 @@ -// ====================================== -// This file was automatically generated. -// ====================================== - -use serde::{Deserialize, Serialize}; - -use crate::ids::TaxCalculationLineItemId; -use crate::params::Object; - -/// The resource representing a Stripe "TaxProductResourceTaxCalculationLineItem". -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct TaxCalculationLineItem { - /// Unique identifier for the object. - pub id: TaxCalculationLineItemId, - - /// The line item amount in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal). - /// - /// If `tax_behavior=inclusive`, then this amount includes taxes. - /// Otherwise, taxes were calculated on top of this amount. - pub amount: i64, - - /// The amount of tax calculated for this line item, in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal). - pub amount_tax: i64, - - /// Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. - pub livemode: bool, - - /// The ID of an existing [Product](https://stripe.com/docs/api/products/object). - pub product: Option, - - /// The number of units of the item being purchased. - /// - /// For reversals, this is the quantity reversed. - pub quantity: u64, - - /// A custom identifier for this line item. - pub reference: Option, - - /// Specifies whether the `amount` includes taxes. - /// - /// If `tax_behavior=inclusive`, then the amount includes taxes. - pub tax_behavior: TaxCalculationLineItemTaxBehavior, - - /// Detailed account of taxes relevant to this line item. - pub tax_breakdown: Option>, - - /// The [tax code](https://stripe.com/docs/tax/tax-categories) ID used for this resource. - pub tax_code: String, -} - -impl Object for TaxCalculationLineItem { - type Id = TaxCalculationLineItemId; - fn id(&self) -> Self::Id { - self.id.clone() - } - fn object(&self) -> &'static str { - "tax.calculation_line_item" - } -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct TaxProductResourceLineItemTaxBreakdown { - /// The amount of tax, in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal). - pub amount: i64, - - pub jurisdiction: TaxProductResourceJurisdiction, - - /// Indicates whether the jurisdiction was determined by the origin (merchant's address) or destination (customer's address). - pub sourcing: TaxProductResourceLineItemTaxBreakdownSourcing, - - /// Details regarding the rate for this tax. - /// - /// This field will be `null` when the tax is not imposed, for example if the product is exempt from tax. - pub tax_rate_details: Option, - - /// The reasoning behind this tax, for example, if the product is tax exempt. - /// - /// The possible values for this field may be extended as new tax rules are supported. - pub taxability_reason: TaxProductResourceLineItemTaxBreakdownTaxabilityReason, - - /// The amount on which tax is calculated, in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal). - pub taxable_amount: i64, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct TaxProductResourceJurisdiction { - /// Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). - pub country: String, - - /// A human-readable name for the jurisdiction imposing the tax. - pub display_name: String, - - /// Indicates the level of the jurisdiction imposing the tax. - pub level: TaxProductResourceJurisdictionLevel, - - /// [ISO 3166-2 subdivision code](https://en.wikipedia.org/wiki/ISO_3166-2:US), without country prefix. - /// - /// For example, "NY" for New York, United States. - pub state: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct TaxProductResourceLineItemTaxRateDetails { - /// A localized display name for tax type, intended to be human-readable. - /// - /// For example, "Local Sales and Use Tax", "Value-added tax (VAT)", or "Umsatzsteuer (USt.)". - pub display_name: String, - - /// The tax rate percentage as a string. - /// - /// For example, 8.5% is represented as "8.5". - pub percentage_decimal: String, - - /// The tax type, such as `vat` or `sales_tax`. - pub tax_type: TaxProductResourceLineItemTaxRateDetailsTaxType, -} - -/// An enum representing the possible values of an `TaxCalculationLineItem`'s `tax_behavior` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum TaxCalculationLineItemTaxBehavior { - Exclusive, - Inclusive, -} - -impl TaxCalculationLineItemTaxBehavior { - pub fn as_str(self) -> &'static str { - match self { - TaxCalculationLineItemTaxBehavior::Exclusive => "exclusive", - TaxCalculationLineItemTaxBehavior::Inclusive => "inclusive", - } - } -} - -impl AsRef for TaxCalculationLineItemTaxBehavior { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for TaxCalculationLineItemTaxBehavior { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for TaxCalculationLineItemTaxBehavior { - fn default() -> Self { - Self::Exclusive - } -} - -/// An enum representing the possible values of an `TaxProductResourceJurisdiction`'s `level` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum TaxProductResourceJurisdictionLevel { - City, - Country, - County, - District, - State, -} - -impl TaxProductResourceJurisdictionLevel { - pub fn as_str(self) -> &'static str { - match self { - TaxProductResourceJurisdictionLevel::City => "city", - TaxProductResourceJurisdictionLevel::Country => "country", - TaxProductResourceJurisdictionLevel::County => "county", - TaxProductResourceJurisdictionLevel::District => "district", - TaxProductResourceJurisdictionLevel::State => "state", - } - } -} - -impl AsRef for TaxProductResourceJurisdictionLevel { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for TaxProductResourceJurisdictionLevel { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for TaxProductResourceJurisdictionLevel { - fn default() -> Self { - Self::City - } -} - -/// An enum representing the possible values of an `TaxProductResourceLineItemTaxBreakdown`'s `sourcing` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum TaxProductResourceLineItemTaxBreakdownSourcing { - Destination, - Origin, -} - -impl TaxProductResourceLineItemTaxBreakdownSourcing { - pub fn as_str(self) -> &'static str { - match self { - TaxProductResourceLineItemTaxBreakdownSourcing::Destination => "destination", - TaxProductResourceLineItemTaxBreakdownSourcing::Origin => "origin", - } - } -} - -impl AsRef for TaxProductResourceLineItemTaxBreakdownSourcing { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for TaxProductResourceLineItemTaxBreakdownSourcing { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for TaxProductResourceLineItemTaxBreakdownSourcing { - fn default() -> Self { - Self::Destination - } -} - -/// An enum representing the possible values of an `TaxProductResourceLineItemTaxBreakdown`'s `taxability_reason` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum TaxProductResourceLineItemTaxBreakdownTaxabilityReason { - CustomerExempt, - NotCollecting, - NotSubjectToTax, - NotSupported, - PortionProductExempt, - PortionReducedRated, - PortionStandardRated, - ProductExempt, - ProductExemptHoliday, - ProportionallyRated, - ReducedRated, - ReverseCharge, - StandardRated, - TaxableBasisReduced, - ZeroRated, -} - -impl TaxProductResourceLineItemTaxBreakdownTaxabilityReason { - pub fn as_str(self) -> &'static str { - match self { - TaxProductResourceLineItemTaxBreakdownTaxabilityReason::CustomerExempt => { - "customer_exempt" - } - TaxProductResourceLineItemTaxBreakdownTaxabilityReason::NotCollecting => { - "not_collecting" - } - TaxProductResourceLineItemTaxBreakdownTaxabilityReason::NotSubjectToTax => { - "not_subject_to_tax" - } - TaxProductResourceLineItemTaxBreakdownTaxabilityReason::NotSupported => "not_supported", - TaxProductResourceLineItemTaxBreakdownTaxabilityReason::PortionProductExempt => { - "portion_product_exempt" - } - TaxProductResourceLineItemTaxBreakdownTaxabilityReason::PortionReducedRated => { - "portion_reduced_rated" - } - TaxProductResourceLineItemTaxBreakdownTaxabilityReason::PortionStandardRated => { - "portion_standard_rated" - } - TaxProductResourceLineItemTaxBreakdownTaxabilityReason::ProductExempt => { - "product_exempt" - } - TaxProductResourceLineItemTaxBreakdownTaxabilityReason::ProductExemptHoliday => { - "product_exempt_holiday" - } - TaxProductResourceLineItemTaxBreakdownTaxabilityReason::ProportionallyRated => { - "proportionally_rated" - } - TaxProductResourceLineItemTaxBreakdownTaxabilityReason::ReducedRated => "reduced_rated", - TaxProductResourceLineItemTaxBreakdownTaxabilityReason::ReverseCharge => { - "reverse_charge" - } - TaxProductResourceLineItemTaxBreakdownTaxabilityReason::StandardRated => { - "standard_rated" - } - TaxProductResourceLineItemTaxBreakdownTaxabilityReason::TaxableBasisReduced => { - "taxable_basis_reduced" - } - TaxProductResourceLineItemTaxBreakdownTaxabilityReason::ZeroRated => "zero_rated", - } - } -} - -impl AsRef for TaxProductResourceLineItemTaxBreakdownTaxabilityReason { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for TaxProductResourceLineItemTaxBreakdownTaxabilityReason { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for TaxProductResourceLineItemTaxBreakdownTaxabilityReason { - fn default() -> Self { - Self::CustomerExempt - } -} - -/// An enum representing the possible values of an `TaxProductResourceLineItemTaxRateDetails`'s `tax_type` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum TaxProductResourceLineItemTaxRateDetailsTaxType { - AmusementTax, - CommunicationsTax, - Gst, - Hst, - Igst, - Jct, - LeaseTax, - Pst, - Qst, - Rst, - SalesTax, - Vat, -} - -impl TaxProductResourceLineItemTaxRateDetailsTaxType { - pub fn as_str(self) -> &'static str { - match self { - TaxProductResourceLineItemTaxRateDetailsTaxType::AmusementTax => "amusement_tax", - TaxProductResourceLineItemTaxRateDetailsTaxType::CommunicationsTax => { - "communications_tax" - } - TaxProductResourceLineItemTaxRateDetailsTaxType::Gst => "gst", - TaxProductResourceLineItemTaxRateDetailsTaxType::Hst => "hst", - TaxProductResourceLineItemTaxRateDetailsTaxType::Igst => "igst", - TaxProductResourceLineItemTaxRateDetailsTaxType::Jct => "jct", - TaxProductResourceLineItemTaxRateDetailsTaxType::LeaseTax => "lease_tax", - TaxProductResourceLineItemTaxRateDetailsTaxType::Pst => "pst", - TaxProductResourceLineItemTaxRateDetailsTaxType::Qst => "qst", - TaxProductResourceLineItemTaxRateDetailsTaxType::Rst => "rst", - TaxProductResourceLineItemTaxRateDetailsTaxType::SalesTax => "sales_tax", - TaxProductResourceLineItemTaxRateDetailsTaxType::Vat => "vat", - } - } -} - -impl AsRef for TaxProductResourceLineItemTaxRateDetailsTaxType { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for TaxProductResourceLineItemTaxRateDetailsTaxType { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for TaxProductResourceLineItemTaxRateDetailsTaxType { - fn default() -> Self { - Self::AmusementTax - } -} diff --git a/src/resources/generated/tax_code.rs b/src/resources/generated/tax_code.rs deleted file mode 100644 index 324517cde..000000000 --- a/src/resources/generated/tax_code.rs +++ /dev/null @@ -1,93 +0,0 @@ -// ====================================== -// This file was automatically generated. -// ====================================== - -use serde::{Deserialize, Serialize}; - -use crate::client::{Client, Response}; -use crate::ids::TaxCodeId; -use crate::params::{Expand, List, Object, Paginable}; - -/// The resource representing a Stripe "TaxProductResourceTaxCode". -/// -/// For more details see -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct TaxCode { - /// Unique identifier for the object. - pub id: TaxCodeId, - - /// A detailed description of which types of products the tax code represents. - pub description: String, - - /// A short name for the tax code. - pub name: String, -} - -impl TaxCode { - /// A list of [all tax codes available](https://stripe.com/docs/tax/tax-categories) to add to Products in order to allow specific tax calculations. - pub fn list(client: &Client, params: &ListTaxCodes<'_>) -> Response> { - client.get_query("/tax_codes", ¶ms) - } - - /// Retrieves the details of an existing tax code. - /// - /// Supply the unique tax code ID and Stripe will return the corresponding tax code information. - pub fn retrieve(client: &Client, id: &TaxCodeId, expand: &[&str]) -> Response { - client.get_query(&format!("/tax_codes/{}", id), &Expand { expand }) - } -} - -impl Object for TaxCode { - type Id = TaxCodeId; - fn id(&self) -> Self::Id { - self.id.clone() - } - fn object(&self) -> &'static str { - "tax_code" - } -} - -/// The parameters for `TaxCode::list`. -#[derive(Clone, Debug, Serialize, Default)] -pub struct ListTaxCodes<'a> { - /// A cursor for use in pagination. - /// - /// `ending_before` is an object ID that defines your place in the list. - /// For instance, if you make a list request and receive 100 objects, starting with `obj_bar`, your subsequent call can include `ending_before=obj_bar` in order to fetch the previous page of the list. - #[serde(skip_serializing_if = "Option::is_none")] - pub ending_before: Option, - - /// Specifies which fields in the response should be expanded. - #[serde(skip_serializing_if = "Expand::is_empty")] - pub expand: &'a [&'a str], - - /// A limit on the number of objects to be returned. - /// - /// Limit can range between 1 and 100, and the default is 10. - #[serde(skip_serializing_if = "Option::is_none")] - pub limit: Option, - - /// A cursor for use in pagination. - /// - /// `starting_after` is an object ID that defines your place in the list. - /// For instance, if you make a list request and receive 100 objects, ending with `obj_foo`, your subsequent call can include `starting_after=obj_foo` in order to fetch the next page of the list. - #[serde(skip_serializing_if = "Option::is_none")] - pub starting_after: Option, -} - -impl<'a> ListTaxCodes<'a> { - pub fn new() -> Self { - ListTaxCodes { - ending_before: Default::default(), - expand: Default::default(), - limit: Default::default(), - starting_after: Default::default(), - } - } -} -impl Paginable for ListTaxCodes<'_> { - type O = TaxCode; - fn set_last(&mut self, item: Self::O) { - self.starting_after = Some(item.id()); - } -} diff --git a/src/resources/generated/tax_deducted_at_source.rs b/src/resources/generated/tax_deducted_at_source.rs deleted file mode 100644 index 551c6544b..000000000 --- a/src/resources/generated/tax_deducted_at_source.rs +++ /dev/null @@ -1,38 +0,0 @@ -// ====================================== -// This file was automatically generated. -// ====================================== - -use serde::{Deserialize, Serialize}; - -use crate::ids::TaxDeductedAtSourceId; -use crate::params::{Object, Timestamp}; - -/// The resource representing a Stripe "TaxDeductedAtSource". -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct TaxDeductedAtSource { - /// Unique identifier for the object. - pub id: TaxDeductedAtSourceId, - - /// The end of the invoicing period. - /// - /// This TDS applies to Stripe fees collected during this invoicing period. - pub period_end: Timestamp, - - /// The start of the invoicing period. - /// - /// This TDS applies to Stripe fees collected during this invoicing period. - pub period_start: Timestamp, - - /// The TAN that was supplied to Stripe when TDS was assessed. - pub tax_deduction_account_number: String, -} - -impl Object for TaxDeductedAtSource { - type Id = TaxDeductedAtSourceId; - fn id(&self) -> Self::Id { - self.id.clone() - } - fn object(&self) -> &'static str { - "tax_deducted_at_source" - } -} diff --git a/src/resources/generated/tax_id.rs b/src/resources/generated/tax_id.rs deleted file mode 100644 index acf08422e..000000000 --- a/src/resources/generated/tax_id.rs +++ /dev/null @@ -1,720 +0,0 @@ -// ====================================== -// This file was automatically generated. -// ====================================== - -use serde::{Deserialize, Serialize}; - -use crate::client::{Client, Response}; -use crate::ids::TaxIdId; -use crate::params::{Deleted, Expand, Expandable, List, Object, Paginable, Timestamp}; -use crate::resources::{Account, Application, Customer}; - -/// The resource representing a Stripe "tax_id". -/// -/// For more details see -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct TaxId { - /// Unique identifier for the object. - pub id: TaxIdId, - - /// Two-letter ISO code representing the country of the tax ID. - #[serde(skip_serializing_if = "Option::is_none")] - pub country: Option, - - /// Time at which the object was created. - /// - /// Measured in seconds since the Unix epoch. - #[serde(skip_serializing_if = "Option::is_none")] - pub created: Option, - - /// ID of the customer. - #[serde(skip_serializing_if = "Option::is_none")] - pub customer: Option>, - - // Always true for a deleted object - #[serde(default)] - pub deleted: bool, - - /// Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. - #[serde(skip_serializing_if = "Option::is_none")] - pub livemode: Option, - - /// The account or customer the tax ID belongs to. - #[serde(skip_serializing_if = "Option::is_none")] - pub owner: Option, - - /// Type of the tax ID, one of `ad_nrt`, `ae_trn`, `ar_cuit`, `au_abn`, `au_arn`, `bg_uic`, `bo_tin`, `br_cnpj`, `br_cpf`, `ca_bn`, `ca_gst_hst`, `ca_pst_bc`, `ca_pst_mb`, `ca_pst_sk`, `ca_qst`, `ch_vat`, `cl_tin`, `cn_tin`, `co_nit`, `cr_tin`, `do_rcn`, `ec_ruc`, `eg_tin`, `es_cif`, `eu_oss_vat`, `eu_vat`, `gb_vat`, `ge_vat`, `hk_br`, `hu_tin`, `id_npwp`, `il_vat`, `in_gst`, `is_vat`, `jp_cn`, `jp_rn`, `jp_trn`, `ke_pin`, `kr_brn`, `li_uid`, `mx_rfc`, `my_frp`, `my_itn`, `my_sst`, `no_vat`, `nz_gst`, `pe_ruc`, `ph_tin`, `ro_tin`, `rs_pib`, `ru_inn`, `ru_kpp`, `sa_vat`, `sg_gst`, `sg_uen`, `si_tin`, `sv_nit`, `th_vat`, `tr_tin`, `tw_vat`, `ua_vat`, `us_ein`, `uy_ruc`, `ve_rif`, `vn_tin`, or `za_vat`. - /// - /// Note that some legacy tax IDs have type `unknown`. - #[serde(rename = "type")] - #[serde(skip_serializing_if = "Option::is_none")] - pub type_: Option, - - /// Value of the tax ID. - #[serde(skip_serializing_if = "Option::is_none")] - pub value: Option, - - /// Tax ID verification information. - #[serde(skip_serializing_if = "Option::is_none")] - pub verification: Option, -} - -impl TaxId { - /// Returns a list of tax IDs. - pub fn list(client: &Client, params: &ListTaxIds<'_>) -> Response> { - client.get_query("/tax_ids", ¶ms) - } - - /// Creates a new account or customer `tax_id` object. - pub fn create(client: &Client, params: CreateTaxId<'_>) -> Response { - client.post_form("/tax_ids", ¶ms) - } - - /// Retrieves an account or customer `tax_id` object. - pub fn retrieve(client: &Client, id: &TaxIdId, expand: &[&str]) -> Response { - client.get_query(&format!("/tax_ids/{}", id), &Expand { expand }) - } - - /// Deletes an existing account or customer `tax_id` object. - pub fn delete(client: &Client, id: &TaxIdId) -> Response> { - client.delete(&format!("/tax_ids/{}", id)) - } -} - -impl Object for TaxId { - type Id = TaxIdId; - fn id(&self) -> Self::Id { - self.id.clone() - } - fn object(&self) -> &'static str { - "tax_id" - } -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct TaxIDsOwner { - /// The account being referenced when `type` is `account`. - #[serde(skip_serializing_if = "Option::is_none")] - pub account: Option>, - - /// The Connect Application being referenced when `type` is `application`. - #[serde(skip_serializing_if = "Option::is_none")] - pub application: Option>, - - /// The customer being referenced when `type` is `customer`. - #[serde(skip_serializing_if = "Option::is_none")] - pub customer: Option>, - - /// Type of owner referenced. - #[serde(rename = "type")] - pub type_: TaxIDsOwnerType, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct TaxIdVerification { - /// Verification status, one of `pending`, `verified`, `unverified`, or `unavailable`. - pub status: TaxIdVerificationStatus, - - /// Verified address. - pub verified_address: Option, - - /// Verified name. - pub verified_name: Option, -} - -/// The parameters for `TaxId::create`. -#[derive(Clone, Debug, Serialize)] -pub struct CreateTaxId<'a> { - /// Specifies which fields in the response should be expanded. - #[serde(skip_serializing_if = "Expand::is_empty")] - pub expand: &'a [&'a str], - - /// The account or customer the tax ID belongs to. - /// - /// Defaults to `owner[type]=self`. - #[serde(skip_serializing_if = "Option::is_none")] - pub owner: Option, - - /// Type of the tax ID, one of `ad_nrt`, `ae_trn`, `ar_cuit`, `au_abn`, `au_arn`, `bg_uic`, `bo_tin`, `br_cnpj`, `br_cpf`, `ca_bn`, `ca_gst_hst`, `ca_pst_bc`, `ca_pst_mb`, `ca_pst_sk`, `ca_qst`, `ch_vat`, `cl_tin`, `cn_tin`, `co_nit`, `cr_tin`, `do_rcn`, `ec_ruc`, `eg_tin`, `es_cif`, `eu_oss_vat`, `eu_vat`, `gb_vat`, `ge_vat`, `hk_br`, `hu_tin`, `id_npwp`, `il_vat`, `in_gst`, `is_vat`, `jp_cn`, `jp_rn`, `jp_trn`, `ke_pin`, `kr_brn`, `li_uid`, `mx_rfc`, `my_frp`, `my_itn`, `my_sst`, `no_vat`, `nz_gst`, `pe_ruc`, `ph_tin`, `ro_tin`, `rs_pib`, `ru_inn`, `ru_kpp`, `sa_vat`, `sg_gst`, `sg_uen`, `si_tin`, `sv_nit`, `th_vat`, `tr_tin`, `tw_vat`, `ua_vat`, `us_ein`, `uy_ruc`, `ve_rif`, `vn_tin`, or `za_vat`. - #[serde(rename = "type")] - pub type_: TaxIdTypeFilter, - - /// Value of the tax ID. - pub value: &'a str, -} - -impl<'a> CreateTaxId<'a> { - pub fn new(type_: TaxIdTypeFilter, value: &'a str) -> Self { - CreateTaxId { expand: Default::default(), owner: Default::default(), type_, value } - } -} - -/// The parameters for `TaxId::list`. -#[derive(Clone, Debug, Serialize, Default)] -pub struct ListTaxIds<'a> { - /// A cursor for use in pagination. - /// - /// `ending_before` is an object ID that defines your place in the list. - /// For instance, if you make a list request and receive 100 objects, starting with `obj_bar`, your subsequent call can include `ending_before=obj_bar` in order to fetch the previous page of the list. - #[serde(skip_serializing_if = "Option::is_none")] - pub ending_before: Option, - - /// Specifies which fields in the response should be expanded. - #[serde(skip_serializing_if = "Expand::is_empty")] - pub expand: &'a [&'a str], - - /// A limit on the number of objects to be returned. - /// - /// Limit can range between 1 and 100, and the default is 10. - #[serde(skip_serializing_if = "Option::is_none")] - pub limit: Option, - - /// The account or customer the tax ID belongs to. - /// - /// Defaults to `owner[type]=self`. - #[serde(skip_serializing_if = "Option::is_none")] - pub owner: Option, - - /// A cursor for use in pagination. - /// - /// `starting_after` is an object ID that defines your place in the list. - /// For instance, if you make a list request and receive 100 objects, ending with `obj_foo`, your subsequent call can include `starting_after=obj_foo` in order to fetch the next page of the list. - #[serde(skip_serializing_if = "Option::is_none")] - pub starting_after: Option, -} - -impl<'a> ListTaxIds<'a> { - pub fn new() -> Self { - ListTaxIds { - ending_before: Default::default(), - expand: Default::default(), - limit: Default::default(), - owner: Default::default(), - starting_after: Default::default(), - } - } -} -impl Paginable for ListTaxIds<'_> { - type O = TaxId; - fn set_last(&mut self, item: Self::O) { - self.starting_after = Some(item.id()); - } -} -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreateTaxIdOwner { - /// Account the tax ID belongs to. - /// - /// Required when `type=account`. - #[serde(skip_serializing_if = "Option::is_none")] - pub account: Option, - - /// Customer the tax ID belongs to. - /// - /// Required when `type=customer`. - #[serde(skip_serializing_if = "Option::is_none")] - pub customer: Option, - - /// Type of owner referenced. - #[serde(rename = "type")] - pub type_: CreateTaxIdOwnerType, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct ListTaxIdsOwner { - /// Account the tax ID belongs to. - /// - /// Required when `type=account`. - #[serde(skip_serializing_if = "Option::is_none")] - pub account: Option, - - /// Customer the tax ID belongs to. - /// - /// Required when `type=customer`. - #[serde(skip_serializing_if = "Option::is_none")] - pub customer: Option, - - /// Type of owner referenced. - #[serde(rename = "type")] - pub type_: ListTaxIdsOwnerType, -} - -/// An enum representing the possible values of an `CreateTaxIdOwner`'s `type` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CreateTaxIdOwnerType { - Account, - Application, - Customer, - #[serde(rename = "self")] - Self_, -} - -impl CreateTaxIdOwnerType { - pub fn as_str(self) -> &'static str { - match self { - CreateTaxIdOwnerType::Account => "account", - CreateTaxIdOwnerType::Application => "application", - CreateTaxIdOwnerType::Customer => "customer", - CreateTaxIdOwnerType::Self_ => "self", - } - } -} - -impl AsRef for CreateTaxIdOwnerType { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for CreateTaxIdOwnerType { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for CreateTaxIdOwnerType { - fn default() -> Self { - Self::Account - } -} - -/// An enum representing the possible values of an `ListTaxIdsOwner`'s `type` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum ListTaxIdsOwnerType { - Account, - Application, - Customer, - #[serde(rename = "self")] - Self_, -} - -impl ListTaxIdsOwnerType { - pub fn as_str(self) -> &'static str { - match self { - ListTaxIdsOwnerType::Account => "account", - ListTaxIdsOwnerType::Application => "application", - ListTaxIdsOwnerType::Customer => "customer", - ListTaxIdsOwnerType::Self_ => "self", - } - } -} - -impl AsRef for ListTaxIdsOwnerType { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for ListTaxIdsOwnerType { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for ListTaxIdsOwnerType { - fn default() -> Self { - Self::Account - } -} - -/// An enum representing the possible values of an `TaxIDsOwner`'s `type` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum TaxIDsOwnerType { - Account, - Application, - Customer, - #[serde(rename = "self")] - Self_, -} - -impl TaxIDsOwnerType { - pub fn as_str(self) -> &'static str { - match self { - TaxIDsOwnerType::Account => "account", - TaxIDsOwnerType::Application => "application", - TaxIDsOwnerType::Customer => "customer", - TaxIDsOwnerType::Self_ => "self", - } - } -} - -impl AsRef for TaxIDsOwnerType { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for TaxIDsOwnerType { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for TaxIDsOwnerType { - fn default() -> Self { - Self::Account - } -} - -/// An enum representing the possible values of an `TaxId`'s `type` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum TaxIdType { - AdNrt, - AeTrn, - ArCuit, - AuAbn, - AuArn, - BgUic, - BoTin, - BrCnpj, - BrCpf, - CaBn, - CaGstHst, - CaPstBc, - CaPstMb, - CaPstSk, - CaQst, - ChVat, - ClTin, - CnTin, - CoNit, - CrTin, - DoRcn, - EcRuc, - EgTin, - EsCif, - EuOssVat, - EuVat, - GbVat, - GeVat, - HkBr, - HuTin, - IdNpwp, - IlVat, - InGst, - IsVat, - JpCn, - JpRn, - JpTrn, - KePin, - KrBrn, - LiUid, - MxRfc, - MyFrp, - MyItn, - MySst, - NoVat, - NzGst, - PeRuc, - PhTin, - RoTin, - RsPib, - RuInn, - RuKpp, - SaVat, - SgGst, - SgUen, - SiTin, - SvNit, - ThVat, - TrTin, - TwVat, - UaVat, - Unknown, - UsEin, - UyRuc, - VeRif, - VnTin, - ZaVat, -} - -impl TaxIdType { - pub fn as_str(self) -> &'static str { - match self { - TaxIdType::AdNrt => "ad_nrt", - TaxIdType::AeTrn => "ae_trn", - TaxIdType::ArCuit => "ar_cuit", - TaxIdType::AuAbn => "au_abn", - TaxIdType::AuArn => "au_arn", - TaxIdType::BgUic => "bg_uic", - TaxIdType::BoTin => "bo_tin", - TaxIdType::BrCnpj => "br_cnpj", - TaxIdType::BrCpf => "br_cpf", - TaxIdType::CaBn => "ca_bn", - TaxIdType::CaGstHst => "ca_gst_hst", - TaxIdType::CaPstBc => "ca_pst_bc", - TaxIdType::CaPstMb => "ca_pst_mb", - TaxIdType::CaPstSk => "ca_pst_sk", - TaxIdType::CaQst => "ca_qst", - TaxIdType::ChVat => "ch_vat", - TaxIdType::ClTin => "cl_tin", - TaxIdType::CnTin => "cn_tin", - TaxIdType::CoNit => "co_nit", - TaxIdType::CrTin => "cr_tin", - TaxIdType::DoRcn => "do_rcn", - TaxIdType::EcRuc => "ec_ruc", - TaxIdType::EgTin => "eg_tin", - TaxIdType::EsCif => "es_cif", - TaxIdType::EuOssVat => "eu_oss_vat", - TaxIdType::EuVat => "eu_vat", - TaxIdType::GbVat => "gb_vat", - TaxIdType::GeVat => "ge_vat", - TaxIdType::HkBr => "hk_br", - TaxIdType::HuTin => "hu_tin", - TaxIdType::IdNpwp => "id_npwp", - TaxIdType::IlVat => "il_vat", - TaxIdType::InGst => "in_gst", - TaxIdType::IsVat => "is_vat", - TaxIdType::JpCn => "jp_cn", - TaxIdType::JpRn => "jp_rn", - TaxIdType::JpTrn => "jp_trn", - TaxIdType::KePin => "ke_pin", - TaxIdType::KrBrn => "kr_brn", - TaxIdType::LiUid => "li_uid", - TaxIdType::MxRfc => "mx_rfc", - TaxIdType::MyFrp => "my_frp", - TaxIdType::MyItn => "my_itn", - TaxIdType::MySst => "my_sst", - TaxIdType::NoVat => "no_vat", - TaxIdType::NzGst => "nz_gst", - TaxIdType::PeRuc => "pe_ruc", - TaxIdType::PhTin => "ph_tin", - TaxIdType::RoTin => "ro_tin", - TaxIdType::RsPib => "rs_pib", - TaxIdType::RuInn => "ru_inn", - TaxIdType::RuKpp => "ru_kpp", - TaxIdType::SaVat => "sa_vat", - TaxIdType::SgGst => "sg_gst", - TaxIdType::SgUen => "sg_uen", - TaxIdType::SiTin => "si_tin", - TaxIdType::SvNit => "sv_nit", - TaxIdType::ThVat => "th_vat", - TaxIdType::TrTin => "tr_tin", - TaxIdType::TwVat => "tw_vat", - TaxIdType::UaVat => "ua_vat", - TaxIdType::Unknown => "unknown", - TaxIdType::UsEin => "us_ein", - TaxIdType::UyRuc => "uy_ruc", - TaxIdType::VeRif => "ve_rif", - TaxIdType::VnTin => "vn_tin", - TaxIdType::ZaVat => "za_vat", - } - } -} - -impl AsRef for TaxIdType { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for TaxIdType { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for TaxIdType { - fn default() -> Self { - Self::AdNrt - } -} - -/// An enum representing the possible values of an `CreateTaxId`'s `type_` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum TaxIdTypeFilter { - AdNrt, - AeTrn, - ArCuit, - AuAbn, - AuArn, - BgUic, - BoTin, - BrCnpj, - BrCpf, - CaBn, - CaGstHst, - CaPstBc, - CaPstMb, - CaPstSk, - CaQst, - ChVat, - ClTin, - CnTin, - CoNit, - CrTin, - DoRcn, - EcRuc, - EgTin, - EsCif, - EuOssVat, - EuVat, - GbVat, - GeVat, - HkBr, - HuTin, - IdNpwp, - IlVat, - InGst, - IsVat, - JpCn, - JpRn, - JpTrn, - KePin, - KrBrn, - LiUid, - MxRfc, - MyFrp, - MyItn, - MySst, - NoVat, - NzGst, - PeRuc, - PhTin, - RoTin, - RsPib, - RuInn, - RuKpp, - SaVat, - SgGst, - SgUen, - SiTin, - SvNit, - ThVat, - TrTin, - TwVat, - UaVat, - UsEin, - UyRuc, - VeRif, - VnTin, - ZaVat, -} - -impl TaxIdTypeFilter { - pub fn as_str(self) -> &'static str { - match self { - TaxIdTypeFilter::AdNrt => "ad_nrt", - TaxIdTypeFilter::AeTrn => "ae_trn", - TaxIdTypeFilter::ArCuit => "ar_cuit", - TaxIdTypeFilter::AuAbn => "au_abn", - TaxIdTypeFilter::AuArn => "au_arn", - TaxIdTypeFilter::BgUic => "bg_uic", - TaxIdTypeFilter::BoTin => "bo_tin", - TaxIdTypeFilter::BrCnpj => "br_cnpj", - TaxIdTypeFilter::BrCpf => "br_cpf", - TaxIdTypeFilter::CaBn => "ca_bn", - TaxIdTypeFilter::CaGstHst => "ca_gst_hst", - TaxIdTypeFilter::CaPstBc => "ca_pst_bc", - TaxIdTypeFilter::CaPstMb => "ca_pst_mb", - TaxIdTypeFilter::CaPstSk => "ca_pst_sk", - TaxIdTypeFilter::CaQst => "ca_qst", - TaxIdTypeFilter::ChVat => "ch_vat", - TaxIdTypeFilter::ClTin => "cl_tin", - TaxIdTypeFilter::CnTin => "cn_tin", - TaxIdTypeFilter::CoNit => "co_nit", - TaxIdTypeFilter::CrTin => "cr_tin", - TaxIdTypeFilter::DoRcn => "do_rcn", - TaxIdTypeFilter::EcRuc => "ec_ruc", - TaxIdTypeFilter::EgTin => "eg_tin", - TaxIdTypeFilter::EsCif => "es_cif", - TaxIdTypeFilter::EuOssVat => "eu_oss_vat", - TaxIdTypeFilter::EuVat => "eu_vat", - TaxIdTypeFilter::GbVat => "gb_vat", - TaxIdTypeFilter::GeVat => "ge_vat", - TaxIdTypeFilter::HkBr => "hk_br", - TaxIdTypeFilter::HuTin => "hu_tin", - TaxIdTypeFilter::IdNpwp => "id_npwp", - TaxIdTypeFilter::IlVat => "il_vat", - TaxIdTypeFilter::InGst => "in_gst", - TaxIdTypeFilter::IsVat => "is_vat", - TaxIdTypeFilter::JpCn => "jp_cn", - TaxIdTypeFilter::JpRn => "jp_rn", - TaxIdTypeFilter::JpTrn => "jp_trn", - TaxIdTypeFilter::KePin => "ke_pin", - TaxIdTypeFilter::KrBrn => "kr_brn", - TaxIdTypeFilter::LiUid => "li_uid", - TaxIdTypeFilter::MxRfc => "mx_rfc", - TaxIdTypeFilter::MyFrp => "my_frp", - TaxIdTypeFilter::MyItn => "my_itn", - TaxIdTypeFilter::MySst => "my_sst", - TaxIdTypeFilter::NoVat => "no_vat", - TaxIdTypeFilter::NzGst => "nz_gst", - TaxIdTypeFilter::PeRuc => "pe_ruc", - TaxIdTypeFilter::PhTin => "ph_tin", - TaxIdTypeFilter::RoTin => "ro_tin", - TaxIdTypeFilter::RsPib => "rs_pib", - TaxIdTypeFilter::RuInn => "ru_inn", - TaxIdTypeFilter::RuKpp => "ru_kpp", - TaxIdTypeFilter::SaVat => "sa_vat", - TaxIdTypeFilter::SgGst => "sg_gst", - TaxIdTypeFilter::SgUen => "sg_uen", - TaxIdTypeFilter::SiTin => "si_tin", - TaxIdTypeFilter::SvNit => "sv_nit", - TaxIdTypeFilter::ThVat => "th_vat", - TaxIdTypeFilter::TrTin => "tr_tin", - TaxIdTypeFilter::TwVat => "tw_vat", - TaxIdTypeFilter::UaVat => "ua_vat", - TaxIdTypeFilter::UsEin => "us_ein", - TaxIdTypeFilter::UyRuc => "uy_ruc", - TaxIdTypeFilter::VeRif => "ve_rif", - TaxIdTypeFilter::VnTin => "vn_tin", - TaxIdTypeFilter::ZaVat => "za_vat", - } - } -} - -impl AsRef for TaxIdTypeFilter { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for TaxIdTypeFilter { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for TaxIdTypeFilter { - fn default() -> Self { - Self::AdNrt - } -} - -/// An enum representing the possible values of an `TaxIdVerification`'s `status` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum TaxIdVerificationStatus { - Pending, - Unavailable, - Unverified, - Verified, -} - -impl TaxIdVerificationStatus { - pub fn as_str(self) -> &'static str { - match self { - TaxIdVerificationStatus::Pending => "pending", - TaxIdVerificationStatus::Unavailable => "unavailable", - TaxIdVerificationStatus::Unverified => "unverified", - TaxIdVerificationStatus::Verified => "verified", - } - } -} - -impl AsRef for TaxIdVerificationStatus { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for TaxIdVerificationStatus { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for TaxIdVerificationStatus { - fn default() -> Self { - Self::Pending - } -} diff --git a/src/resources/generated/tax_product_resource_customer_details.rs b/src/resources/generated/tax_product_resource_customer_details.rs deleted file mode 100644 index e44865f70..000000000 --- a/src/resources/generated/tax_product_resource_customer_details.rs +++ /dev/null @@ -1,293 +0,0 @@ -// ====================================== -// This file was automatically generated. -// ====================================== - -use serde::{Deserialize, Serialize}; - -/// The resource representing a Stripe "TaxProductResourceCustomerDetails". -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct TaxProductResourceCustomerDetails { - /// The customer's postal address (for example, home or business location). - pub address: Option, - - /// The type of customer address provided. - pub address_source: Option, - - /// The customer's IP address (IPv4 or IPv6). - pub ip_address: Option, - - /// The customer's tax IDs (for example, EU VAT numbers). - pub tax_ids: Vec, - - /// The taxability override used for taxation. - pub taxability_override: TaxProductResourceCustomerDetailsTaxabilityOverride, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct TaxProductResourceCustomerDetailsResourceTaxId { - /// The type of the tax ID, one of `ad_nrt`, `ar_cuit`, `eu_vat`, `bo_tin`, `br_cnpj`, `br_cpf`, `cn_tin`, `co_nit`, `cr_tin`, `do_rcn`, `ec_ruc`, `eu_oss_vat`, `pe_ruc`, `ro_tin`, `rs_pib`, `sv_nit`, `uy_ruc`, `ve_rif`, `vn_tin`, `gb_vat`, `nz_gst`, `au_abn`, `au_arn`, `in_gst`, `no_vat`, `za_vat`, `ch_vat`, `mx_rfc`, `sg_uen`, `ru_inn`, `ru_kpp`, `ca_bn`, `hk_br`, `es_cif`, `tw_vat`, `th_vat`, `jp_cn`, `jp_rn`, `jp_trn`, `li_uid`, `my_itn`, `us_ein`, `kr_brn`, `ca_qst`, `ca_gst_hst`, `ca_pst_bc`, `ca_pst_mb`, `ca_pst_sk`, `my_sst`, `sg_gst`, `ae_trn`, `cl_tin`, `sa_vat`, `id_npwp`, `my_frp`, `il_vat`, `ge_vat`, `ua_vat`, `is_vat`, `bg_uic`, `hu_tin`, `si_tin`, `ke_pin`, `tr_tin`, `eg_tin`, `ph_tin`, or `unknown`. - #[serde(rename = "type")] - pub type_: TaxProductResourceCustomerDetailsResourceTaxIdType, - - /// The value of the tax ID. - pub value: String, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct TaxProductResourcePostalAddress { - /// City, district, suburb, town, or village. - pub city: Option, - - /// Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). - pub country: String, - - /// Address line 1 (e.g., street, PO Box, or company name). - pub line1: Option, - - /// Address line 2 (e.g., apartment, suite, unit, or building). - pub line2: Option, - - /// ZIP or postal code. - pub postal_code: Option, - - /// State/province as an [ISO 3166-2](https://en.wikipedia.org/wiki/ISO_3166-2) subdivision code, without country prefix. - /// - /// Example: "NY" or "TX". - pub state: Option, -} - -/// An enum representing the possible values of an `TaxProductResourceCustomerDetails`'s `address_source` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum TaxProductResourceCustomerDetailsAddressSource { - Billing, - Shipping, -} - -impl TaxProductResourceCustomerDetailsAddressSource { - pub fn as_str(self) -> &'static str { - match self { - TaxProductResourceCustomerDetailsAddressSource::Billing => "billing", - TaxProductResourceCustomerDetailsAddressSource::Shipping => "shipping", - } - } -} - -impl AsRef for TaxProductResourceCustomerDetailsAddressSource { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for TaxProductResourceCustomerDetailsAddressSource { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for TaxProductResourceCustomerDetailsAddressSource { - fn default() -> Self { - Self::Billing - } -} - -/// An enum representing the possible values of an `TaxProductResourceCustomerDetailsResourceTaxId`'s `type` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum TaxProductResourceCustomerDetailsResourceTaxIdType { - AdNrt, - AeTrn, - ArCuit, - AuAbn, - AuArn, - BgUic, - BoTin, - BrCnpj, - BrCpf, - CaBn, - CaGstHst, - CaPstBc, - CaPstMb, - CaPstSk, - CaQst, - ChVat, - ClTin, - CnTin, - CoNit, - CrTin, - DoRcn, - EcRuc, - EgTin, - EsCif, - EuOssVat, - EuVat, - GbVat, - GeVat, - HkBr, - HuTin, - IdNpwp, - IlVat, - InGst, - IsVat, - JpCn, - JpRn, - JpTrn, - KePin, - KrBrn, - LiUid, - MxRfc, - MyFrp, - MyItn, - MySst, - NoVat, - NzGst, - PeRuc, - PhTin, - RoTin, - RsPib, - RuInn, - RuKpp, - SaVat, - SgGst, - SgUen, - SiTin, - SvNit, - ThVat, - TrTin, - TwVat, - UaVat, - Unknown, - UsEin, - UyRuc, - VeRif, - VnTin, - ZaVat, -} - -impl TaxProductResourceCustomerDetailsResourceTaxIdType { - pub fn as_str(self) -> &'static str { - match self { - TaxProductResourceCustomerDetailsResourceTaxIdType::AdNrt => "ad_nrt", - TaxProductResourceCustomerDetailsResourceTaxIdType::AeTrn => "ae_trn", - TaxProductResourceCustomerDetailsResourceTaxIdType::ArCuit => "ar_cuit", - TaxProductResourceCustomerDetailsResourceTaxIdType::AuAbn => "au_abn", - TaxProductResourceCustomerDetailsResourceTaxIdType::AuArn => "au_arn", - TaxProductResourceCustomerDetailsResourceTaxIdType::BgUic => "bg_uic", - TaxProductResourceCustomerDetailsResourceTaxIdType::BoTin => "bo_tin", - TaxProductResourceCustomerDetailsResourceTaxIdType::BrCnpj => "br_cnpj", - TaxProductResourceCustomerDetailsResourceTaxIdType::BrCpf => "br_cpf", - TaxProductResourceCustomerDetailsResourceTaxIdType::CaBn => "ca_bn", - TaxProductResourceCustomerDetailsResourceTaxIdType::CaGstHst => "ca_gst_hst", - TaxProductResourceCustomerDetailsResourceTaxIdType::CaPstBc => "ca_pst_bc", - TaxProductResourceCustomerDetailsResourceTaxIdType::CaPstMb => "ca_pst_mb", - TaxProductResourceCustomerDetailsResourceTaxIdType::CaPstSk => "ca_pst_sk", - TaxProductResourceCustomerDetailsResourceTaxIdType::CaQst => "ca_qst", - TaxProductResourceCustomerDetailsResourceTaxIdType::ChVat => "ch_vat", - TaxProductResourceCustomerDetailsResourceTaxIdType::ClTin => "cl_tin", - TaxProductResourceCustomerDetailsResourceTaxIdType::CnTin => "cn_tin", - TaxProductResourceCustomerDetailsResourceTaxIdType::CoNit => "co_nit", - TaxProductResourceCustomerDetailsResourceTaxIdType::CrTin => "cr_tin", - TaxProductResourceCustomerDetailsResourceTaxIdType::DoRcn => "do_rcn", - TaxProductResourceCustomerDetailsResourceTaxIdType::EcRuc => "ec_ruc", - TaxProductResourceCustomerDetailsResourceTaxIdType::EgTin => "eg_tin", - TaxProductResourceCustomerDetailsResourceTaxIdType::EsCif => "es_cif", - TaxProductResourceCustomerDetailsResourceTaxIdType::EuOssVat => "eu_oss_vat", - TaxProductResourceCustomerDetailsResourceTaxIdType::EuVat => "eu_vat", - TaxProductResourceCustomerDetailsResourceTaxIdType::GbVat => "gb_vat", - TaxProductResourceCustomerDetailsResourceTaxIdType::GeVat => "ge_vat", - TaxProductResourceCustomerDetailsResourceTaxIdType::HkBr => "hk_br", - TaxProductResourceCustomerDetailsResourceTaxIdType::HuTin => "hu_tin", - TaxProductResourceCustomerDetailsResourceTaxIdType::IdNpwp => "id_npwp", - TaxProductResourceCustomerDetailsResourceTaxIdType::IlVat => "il_vat", - TaxProductResourceCustomerDetailsResourceTaxIdType::InGst => "in_gst", - TaxProductResourceCustomerDetailsResourceTaxIdType::IsVat => "is_vat", - TaxProductResourceCustomerDetailsResourceTaxIdType::JpCn => "jp_cn", - TaxProductResourceCustomerDetailsResourceTaxIdType::JpRn => "jp_rn", - TaxProductResourceCustomerDetailsResourceTaxIdType::JpTrn => "jp_trn", - TaxProductResourceCustomerDetailsResourceTaxIdType::KePin => "ke_pin", - TaxProductResourceCustomerDetailsResourceTaxIdType::KrBrn => "kr_brn", - TaxProductResourceCustomerDetailsResourceTaxIdType::LiUid => "li_uid", - TaxProductResourceCustomerDetailsResourceTaxIdType::MxRfc => "mx_rfc", - TaxProductResourceCustomerDetailsResourceTaxIdType::MyFrp => "my_frp", - TaxProductResourceCustomerDetailsResourceTaxIdType::MyItn => "my_itn", - TaxProductResourceCustomerDetailsResourceTaxIdType::MySst => "my_sst", - TaxProductResourceCustomerDetailsResourceTaxIdType::NoVat => "no_vat", - TaxProductResourceCustomerDetailsResourceTaxIdType::NzGst => "nz_gst", - TaxProductResourceCustomerDetailsResourceTaxIdType::PeRuc => "pe_ruc", - TaxProductResourceCustomerDetailsResourceTaxIdType::PhTin => "ph_tin", - TaxProductResourceCustomerDetailsResourceTaxIdType::RoTin => "ro_tin", - TaxProductResourceCustomerDetailsResourceTaxIdType::RsPib => "rs_pib", - TaxProductResourceCustomerDetailsResourceTaxIdType::RuInn => "ru_inn", - TaxProductResourceCustomerDetailsResourceTaxIdType::RuKpp => "ru_kpp", - TaxProductResourceCustomerDetailsResourceTaxIdType::SaVat => "sa_vat", - TaxProductResourceCustomerDetailsResourceTaxIdType::SgGst => "sg_gst", - TaxProductResourceCustomerDetailsResourceTaxIdType::SgUen => "sg_uen", - TaxProductResourceCustomerDetailsResourceTaxIdType::SiTin => "si_tin", - TaxProductResourceCustomerDetailsResourceTaxIdType::SvNit => "sv_nit", - TaxProductResourceCustomerDetailsResourceTaxIdType::ThVat => "th_vat", - TaxProductResourceCustomerDetailsResourceTaxIdType::TrTin => "tr_tin", - TaxProductResourceCustomerDetailsResourceTaxIdType::TwVat => "tw_vat", - TaxProductResourceCustomerDetailsResourceTaxIdType::UaVat => "ua_vat", - TaxProductResourceCustomerDetailsResourceTaxIdType::Unknown => "unknown", - TaxProductResourceCustomerDetailsResourceTaxIdType::UsEin => "us_ein", - TaxProductResourceCustomerDetailsResourceTaxIdType::UyRuc => "uy_ruc", - TaxProductResourceCustomerDetailsResourceTaxIdType::VeRif => "ve_rif", - TaxProductResourceCustomerDetailsResourceTaxIdType::VnTin => "vn_tin", - TaxProductResourceCustomerDetailsResourceTaxIdType::ZaVat => "za_vat", - } - } -} - -impl AsRef for TaxProductResourceCustomerDetailsResourceTaxIdType { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for TaxProductResourceCustomerDetailsResourceTaxIdType { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for TaxProductResourceCustomerDetailsResourceTaxIdType { - fn default() -> Self { - Self::AdNrt - } -} - -/// An enum representing the possible values of an `TaxProductResourceCustomerDetails`'s `taxability_override` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum TaxProductResourceCustomerDetailsTaxabilityOverride { - CustomerExempt, - None, - ReverseCharge, -} - -impl TaxProductResourceCustomerDetailsTaxabilityOverride { - pub fn as_str(self) -> &'static str { - match self { - TaxProductResourceCustomerDetailsTaxabilityOverride::CustomerExempt => { - "customer_exempt" - } - TaxProductResourceCustomerDetailsTaxabilityOverride::None => "none", - TaxProductResourceCustomerDetailsTaxabilityOverride::ReverseCharge => "reverse_charge", - } - } -} - -impl AsRef for TaxProductResourceCustomerDetailsTaxabilityOverride { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for TaxProductResourceCustomerDetailsTaxabilityOverride { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for TaxProductResourceCustomerDetailsTaxabilityOverride { - fn default() -> Self { - Self::CustomerExempt - } -} diff --git a/src/resources/generated/tax_rate.rs b/src/resources/generated/tax_rate.rs deleted file mode 100644 index 9000974df..000000000 --- a/src/resources/generated/tax_rate.rs +++ /dev/null @@ -1,415 +0,0 @@ -// ====================================== -// This file was automatically generated. -// ====================================== - -use serde::{Deserialize, Serialize}; - -use crate::client::{Client, Response}; -use crate::ids::TaxRateId; -use crate::params::{Expand, List, Metadata, Object, Paginable, RangeQuery, Timestamp}; - -/// The resource representing a Stripe "TaxRate". -/// -/// For more details see -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct TaxRate { - /// Unique identifier for the object. - pub id: TaxRateId, - - /// Defaults to `true`. - /// - /// When set to `false`, this tax rate cannot be used with new applications or Checkout Sessions, but will still work for subscriptions and invoices that already have it set. - pub active: bool, - - /// Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). - pub country: Option, - - /// Time at which the object was created. - /// - /// Measured in seconds since the Unix epoch. - pub created: Timestamp, - - /// An arbitrary string attached to the tax rate for your internal use only. - /// - /// It will not be visible to your customers. - pub description: Option, - - /// The display name of the tax rates as it will appear to your customer on their receipt email, PDF, and the hosted invoice page. - pub display_name: String, - - /// Actual/effective tax rate percentage out of 100. - /// - /// For tax calculations with automatic_tax[enabled]=true, this percentage reflects the rate actually used to calculate tax based on the product's taxability and whether the user is registered to collect taxes in the corresponding jurisdiction. - pub effective_percentage: Option, - - /// This specifies if the tax rate is inclusive or exclusive. - pub inclusive: bool, - - /// The jurisdiction for the tax rate. - /// - /// You can use this label field for tax reporting purposes. - /// It also appears on your customer’s invoice. - pub jurisdiction: Option, - - /// The level of the jurisdiction that imposes this tax rate. - /// - /// Will be `null` for manually defined tax rates. - pub jurisdiction_level: Option, - - /// Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. - pub livemode: bool, - - /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. - /// - /// This can be useful for storing additional information about the object in a structured format. - pub metadata: Option, - - /// Tax rate percentage out of 100. - /// - /// For tax calculations with automatic_tax[enabled]=true, this percentage includes the statutory tax rate of non-taxable jurisdictions. - pub percentage: f64, - - /// [ISO 3166-2 subdivision code](https://en.wikipedia.org/wiki/ISO_3166-2:US), without country prefix. - /// - /// For example, "NY" for New York, United States. - pub state: Option, - - /// The high-level tax type, such as `vat` or `sales_tax`. - pub tax_type: Option, -} - -impl TaxRate { - /// Returns a list of your tax rates. - /// - /// Tax rates are returned sorted by creation date, with the most recently created tax rates appearing first. - pub fn list(client: &Client, params: &ListTaxRates<'_>) -> Response> { - client.get_query("/tax_rates", ¶ms) - } - - /// Creates a new tax rate. - pub fn create(client: &Client, params: CreateTaxRate<'_>) -> Response { - client.post_form("/tax_rates", ¶ms) - } - - /// Retrieves a tax rate with the given ID. - pub fn retrieve(client: &Client, id: &TaxRateId, expand: &[&str]) -> Response { - client.get_query(&format!("/tax_rates/{}", id), &Expand { expand }) - } - - /// Updates an existing tax rate. - pub fn update(client: &Client, id: &TaxRateId, params: UpdateTaxRate<'_>) -> Response { - client.post_form(&format!("/tax_rates/{}", id), ¶ms) - } -} - -impl Object for TaxRate { - type Id = TaxRateId; - fn id(&self) -> Self::Id { - self.id.clone() - } - fn object(&self) -> &'static str { - "tax_rate" - } -} - -/// The parameters for `TaxRate::create`. -#[derive(Clone, Debug, Serialize)] -pub struct CreateTaxRate<'a> { - /// Flag determining whether the tax rate is active or inactive (archived). - /// - /// Inactive tax rates cannot be used with new applications or Checkout Sessions, but will still work for subscriptions and invoices that already have it set. - #[serde(skip_serializing_if = "Option::is_none")] - pub active: Option, - - /// Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). - #[serde(skip_serializing_if = "Option::is_none")] - pub country: Option<&'a str>, - - /// An arbitrary string attached to the tax rate for your internal use only. - /// - /// It will not be visible to your customers. - #[serde(skip_serializing_if = "Option::is_none")] - pub description: Option<&'a str>, - - /// The display name of the tax rate, which will be shown to users. - pub display_name: &'a str, - - /// Specifies which fields in the response should be expanded. - #[serde(skip_serializing_if = "Expand::is_empty")] - pub expand: &'a [&'a str], - - /// This specifies if the tax rate is inclusive or exclusive. - pub inclusive: bool, - - /// The jurisdiction for the tax rate. - /// - /// You can use this label field for tax reporting purposes. - /// It also appears on your customer’s invoice. - #[serde(skip_serializing_if = "Option::is_none")] - pub jurisdiction: Option<&'a str>, - - /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. - /// - /// This can be useful for storing additional information about the object in a structured format. - /// Individual keys can be unset by posting an empty value to them. - /// All keys can be unset by posting an empty value to `metadata`. - #[serde(skip_serializing_if = "Option::is_none")] - pub metadata: Option, - - /// This represents the tax rate percent out of 100. - pub percentage: f64, - - /// [ISO 3166-2 subdivision code](https://en.wikipedia.org/wiki/ISO_3166-2:US), without country prefix. - /// - /// For example, "NY" for New York, United States. - #[serde(skip_serializing_if = "Option::is_none")] - pub state: Option<&'a str>, - - /// The high-level tax type, such as `vat` or `sales_tax`. - #[serde(skip_serializing_if = "Option::is_none")] - pub tax_type: Option, -} - -impl<'a> CreateTaxRate<'a> { - pub fn new(display_name: &'a str, percentage: f64) -> Self { - CreateTaxRate { - active: Default::default(), - country: Default::default(), - description: Default::default(), - display_name, - expand: Default::default(), - inclusive: Default::default(), - jurisdiction: Default::default(), - metadata: Default::default(), - percentage, - state: Default::default(), - tax_type: Default::default(), - } - } -} - -/// The parameters for `TaxRate::list`. -#[derive(Clone, Debug, Serialize, Default)] -pub struct ListTaxRates<'a> { - /// Optional flag to filter by tax rates that are either active or inactive (archived). - #[serde(skip_serializing_if = "Option::is_none")] - pub active: Option, - - /// Optional range for filtering created date. - #[serde(skip_serializing_if = "Option::is_none")] - pub created: Option>, - - /// A cursor for use in pagination. - /// - /// `ending_before` is an object ID that defines your place in the list. - /// For instance, if you make a list request and receive 100 objects, starting with `obj_bar`, your subsequent call can include `ending_before=obj_bar` in order to fetch the previous page of the list. - #[serde(skip_serializing_if = "Option::is_none")] - pub ending_before: Option, - - /// Specifies which fields in the response should be expanded. - #[serde(skip_serializing_if = "Expand::is_empty")] - pub expand: &'a [&'a str], - - /// Optional flag to filter by tax rates that are inclusive (or those that are not inclusive). - #[serde(skip_serializing_if = "Option::is_none")] - pub inclusive: Option, - - /// A limit on the number of objects to be returned. - /// - /// Limit can range between 1 and 100, and the default is 10. - #[serde(skip_serializing_if = "Option::is_none")] - pub limit: Option, - - /// A cursor for use in pagination. - /// - /// `starting_after` is an object ID that defines your place in the list. - /// For instance, if you make a list request and receive 100 objects, ending with `obj_foo`, your subsequent call can include `starting_after=obj_foo` in order to fetch the next page of the list. - #[serde(skip_serializing_if = "Option::is_none")] - pub starting_after: Option, -} - -impl<'a> ListTaxRates<'a> { - pub fn new() -> Self { - ListTaxRates { - active: Default::default(), - created: Default::default(), - ending_before: Default::default(), - expand: Default::default(), - inclusive: Default::default(), - limit: Default::default(), - starting_after: Default::default(), - } - } -} -impl Paginable for ListTaxRates<'_> { - type O = TaxRate; - fn set_last(&mut self, item: Self::O) { - self.starting_after = Some(item.id()); - } -} -/// The parameters for `TaxRate::update`. -#[derive(Clone, Debug, Serialize, Default)] -pub struct UpdateTaxRate<'a> { - /// Flag determining whether the tax rate is active or inactive (archived). - /// - /// Inactive tax rates cannot be used with new applications or Checkout Sessions, but will still work for subscriptions and invoices that already have it set. - #[serde(skip_serializing_if = "Option::is_none")] - pub active: Option, - - /// Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). - #[serde(skip_serializing_if = "Option::is_none")] - pub country: Option<&'a str>, - - /// An arbitrary string attached to the tax rate for your internal use only. - /// - /// It will not be visible to your customers. - #[serde(skip_serializing_if = "Option::is_none")] - pub description: Option<&'a str>, - - /// The display name of the tax rate, which will be shown to users. - #[serde(skip_serializing_if = "Option::is_none")] - pub display_name: Option<&'a str>, - - /// Specifies which fields in the response should be expanded. - #[serde(skip_serializing_if = "Expand::is_empty")] - pub expand: &'a [&'a str], - - /// The jurisdiction for the tax rate. - /// - /// You can use this label field for tax reporting purposes. - /// It also appears on your customer’s invoice. - #[serde(skip_serializing_if = "Option::is_none")] - pub jurisdiction: Option<&'a str>, - - /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. - /// - /// This can be useful for storing additional information about the object in a structured format. - /// Individual keys can be unset by posting an empty value to them. - /// All keys can be unset by posting an empty value to `metadata`. - #[serde(skip_serializing_if = "Option::is_none")] - pub metadata: Option, - - /// [ISO 3166-2 subdivision code](https://en.wikipedia.org/wiki/ISO_3166-2:US), without country prefix. - /// - /// For example, "NY" for New York, United States. - #[serde(skip_serializing_if = "Option::is_none")] - pub state: Option<&'a str>, - - /// The high-level tax type, such as `vat` or `sales_tax`. - #[serde(skip_serializing_if = "Option::is_none")] - pub tax_type: Option, -} - -impl<'a> UpdateTaxRate<'a> { - pub fn new() -> Self { - UpdateTaxRate { - active: Default::default(), - country: Default::default(), - description: Default::default(), - display_name: Default::default(), - expand: Default::default(), - jurisdiction: Default::default(), - metadata: Default::default(), - state: Default::default(), - tax_type: Default::default(), - } - } -} - -/// An enum representing the possible values of an `TaxRate`'s `jurisdiction_level` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum TaxRateJurisdictionLevel { - City, - Country, - County, - District, - Multiple, - State, -} - -impl TaxRateJurisdictionLevel { - pub fn as_str(self) -> &'static str { - match self { - TaxRateJurisdictionLevel::City => "city", - TaxRateJurisdictionLevel::Country => "country", - TaxRateJurisdictionLevel::County => "county", - TaxRateJurisdictionLevel::District => "district", - TaxRateJurisdictionLevel::Multiple => "multiple", - TaxRateJurisdictionLevel::State => "state", - } - } -} - -impl AsRef for TaxRateJurisdictionLevel { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for TaxRateJurisdictionLevel { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for TaxRateJurisdictionLevel { - fn default() -> Self { - Self::City - } -} - -/// An enum representing the possible values of an `TaxRate`'s `tax_type` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum TaxRateTaxType { - AmusementTax, - CommunicationsTax, - Gst, - Hst, - Igst, - Jct, - LeaseTax, - Pst, - Qst, - Rst, - SalesTax, - ServiceTax, - Vat, -} - -impl TaxRateTaxType { - pub fn as_str(self) -> &'static str { - match self { - TaxRateTaxType::AmusementTax => "amusement_tax", - TaxRateTaxType::CommunicationsTax => "communications_tax", - TaxRateTaxType::Gst => "gst", - TaxRateTaxType::Hst => "hst", - TaxRateTaxType::Igst => "igst", - TaxRateTaxType::Jct => "jct", - TaxRateTaxType::LeaseTax => "lease_tax", - TaxRateTaxType::Pst => "pst", - TaxRateTaxType::Qst => "qst", - TaxRateTaxType::Rst => "rst", - TaxRateTaxType::SalesTax => "sales_tax", - TaxRateTaxType::ServiceTax => "service_tax", - TaxRateTaxType::Vat => "vat", - } - } -} - -impl AsRef for TaxRateTaxType { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for TaxRateTaxType { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for TaxRateTaxType { - fn default() -> Self { - Self::AmusementTax - } -} diff --git a/src/resources/generated/tax_rate_created.rs b/src/resources/generated/tax_rate_created.rs deleted file mode 100644 index 591d87426..000000000 --- a/src/resources/generated/tax_rate_created.rs +++ /dev/null @@ -1,10 +0,0 @@ -// ====================================== -// This file was automatically generated. -// ====================================== - -use serde::{Deserialize, Serialize}; - -/// The resource representing a Stripe "tax_rate.created". -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct TaxRateCreated { -} diff --git a/src/resources/generated/tax_rate_updated.rs b/src/resources/generated/tax_rate_updated.rs deleted file mode 100644 index dc592e4e6..000000000 --- a/src/resources/generated/tax_rate_updated.rs +++ /dev/null @@ -1,10 +0,0 @@ -// ====================================== -// This file was automatically generated. -// ====================================== - -use serde::{Deserialize, Serialize}; - -/// The resource representing a Stripe "tax_rate.updated". -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct TaxRateUpdated { -} diff --git a/src/resources/generated/tax_registration.rs b/src/resources/generated/tax_registration.rs deleted file mode 100644 index 9200736f3..000000000 --- a/src/resources/generated/tax_registration.rs +++ /dev/null @@ -1,535 +0,0 @@ -// ====================================== -// This file was automatically generated. -// ====================================== - -use crate::ids::{TaxRegistrationId}; -use crate::params::{Object, Timestamp}; -use serde::{Deserialize, Serialize}; - -/// The resource representing a Stripe "TaxProductRegistrationsResourceTaxRegistration". -/// -/// For more details see -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct TaxRegistration { - /// Unique identifier for the object. - pub id: TaxRegistrationId, - - /// Time at which the registration becomes active. - /// - /// Measured in seconds since the Unix epoch. - pub active_from: Timestamp, - - /// Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). - pub country: String, - - pub country_options: TaxProductRegistrationsResourceCountryOptions, - - /// Time at which the object was created. - /// - /// Measured in seconds since the Unix epoch. - pub created: Timestamp, - - /// If set, the registration stops being active at this time. - /// - /// If not set, the registration will be active indefinitely. - /// Measured in seconds since the Unix epoch. - pub expires_at: Option, - - /// Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. - pub livemode: bool, - - /// The status of the registration. - /// - /// This field is present for convenience and can be deduced from `active_from` and `expires_at`. - pub status: TaxRegistrationStatus, -} - -impl Object for TaxRegistration { - type Id = TaxRegistrationId; - fn id(&self) -> Self::Id { - self.id.clone() - } - fn object(&self) -> &'static str { - "tax.registration" - } -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct TaxProductRegistrationsResourceCountryOptions { - - #[serde(skip_serializing_if = "Option::is_none")] - pub ae: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub at: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub au: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub be: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub bg: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub ca: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub ch: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub cl: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub co: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub cy: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub cz: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub de: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub dk: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub ee: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub es: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub fi: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub fr: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub gb: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub gr: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub hr: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub hu: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub id: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub ie: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub is: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub it: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub jp: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub kr: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub lt: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub lu: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub lv: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub mt: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub mx: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub my: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub nl: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub no: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub nz: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub pl: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub pt: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub ro: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub sa: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub se: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub sg: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub si: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub sk: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub th: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub tr: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub us: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub vn: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub za: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct TaxProductRegistrationsResourceCountryOptionsCanada { - - #[serde(skip_serializing_if = "Option::is_none")] - pub province_standard: Option, - - /// Type of registration in Canada. - #[serde(rename = "type")] - pub type_: TaxProductRegistrationsResourceCountryOptionsCanadaType, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct TaxProductRegistrationsResourceCountryOptionsCaProvinceStandard { - - /// Two-letter CA province code ([ISO 3166-2](https://en.wikipedia.org/wiki/ISO_3166-2)). - pub province: String, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct TaxProductRegistrationsResourceCountryOptionsDefault { - - /// Type of registration in `country`. - #[serde(rename = "type")] - pub type_: TaxProductRegistrationsResourceCountryOptionsDefaultType, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct TaxProductRegistrationsResourceCountryOptionsEurope { - - #[serde(skip_serializing_if = "Option::is_none")] - pub standard: Option, - - /// Type of registration in an EU country. - #[serde(rename = "type")] - pub type_: TaxProductRegistrationsResourceCountryOptionsEuropeType, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct TaxProductRegistrationsResourceCountryOptionsEuStandard { - - /// Place of supply scheme used in an EU standard registration. - pub place_of_supply_scheme: TaxProductRegistrationsResourceCountryOptionsEuStandardPlaceOfSupplyScheme, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct TaxProductRegistrationsResourceCountryOptionsSimplified { - - /// Type of registration in `country`. - #[serde(rename = "type")] - pub type_: TaxProductRegistrationsResourceCountryOptionsSimplifiedType, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct TaxProductRegistrationsResourceCountryOptionsUnitedStates { - - #[serde(skip_serializing_if = "Option::is_none")] - pub local_amusement_tax: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub local_lease_tax: Option, - - /// Two-letter US state code ([ISO 3166-2](https://en.wikipedia.org/wiki/ISO_3166-2)). - pub state: String, - - /// Type of registration in the US. - #[serde(rename = "type")] - pub type_: TaxProductRegistrationsResourceCountryOptionsUnitedStatesType, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct TaxProductRegistrationsResourceCountryOptionsUsLocalAmusementTax { - - /// A [FIPS code](https://www.census.gov/library/reference/code-lists/ansi.html) representing the local jurisdiction. - pub jurisdiction: String, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct TaxProductRegistrationsResourceCountryOptionsUsLocalLeaseTax { - - /// A [FIPS code](https://www.census.gov/library/reference/code-lists/ansi.html) representing the local jurisdiction. - pub jurisdiction: String, -} - -/// An enum representing the possible values of an `TaxProductRegistrationsResourceCountryOptionsCanada`'s `type` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum TaxProductRegistrationsResourceCountryOptionsCanadaType { - ProvinceStandard, - Simplified, - Standard, -} - -impl TaxProductRegistrationsResourceCountryOptionsCanadaType { - pub fn as_str(self) -> &'static str { - match self { - TaxProductRegistrationsResourceCountryOptionsCanadaType::ProvinceStandard => "province_standard", - TaxProductRegistrationsResourceCountryOptionsCanadaType::Simplified => "simplified", - TaxProductRegistrationsResourceCountryOptionsCanadaType::Standard => "standard", - } - } -} - -impl AsRef for TaxProductRegistrationsResourceCountryOptionsCanadaType { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for TaxProductRegistrationsResourceCountryOptionsCanadaType { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for TaxProductRegistrationsResourceCountryOptionsCanadaType { - fn default() -> Self { - Self::ProvinceStandard - } -} - -/// An enum representing the possible values of an `TaxProductRegistrationsResourceCountryOptionsDefault`'s `type` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum TaxProductRegistrationsResourceCountryOptionsDefaultType { - Standard, -} - -impl TaxProductRegistrationsResourceCountryOptionsDefaultType { - pub fn as_str(self) -> &'static str { - match self { - TaxProductRegistrationsResourceCountryOptionsDefaultType::Standard => "standard", - } - } -} - -impl AsRef for TaxProductRegistrationsResourceCountryOptionsDefaultType { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for TaxProductRegistrationsResourceCountryOptionsDefaultType { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for TaxProductRegistrationsResourceCountryOptionsDefaultType { - fn default() -> Self { - Self::Standard - } -} - -/// An enum representing the possible values of an `TaxProductRegistrationsResourceCountryOptionsEuStandard`'s `place_of_supply_scheme` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum TaxProductRegistrationsResourceCountryOptionsEuStandardPlaceOfSupplyScheme { - SmallSeller, - Standard, -} - -impl TaxProductRegistrationsResourceCountryOptionsEuStandardPlaceOfSupplyScheme { - pub fn as_str(self) -> &'static str { - match self { - TaxProductRegistrationsResourceCountryOptionsEuStandardPlaceOfSupplyScheme::SmallSeller => "small_seller", - TaxProductRegistrationsResourceCountryOptionsEuStandardPlaceOfSupplyScheme::Standard => "standard", - } - } -} - -impl AsRef for TaxProductRegistrationsResourceCountryOptionsEuStandardPlaceOfSupplyScheme { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for TaxProductRegistrationsResourceCountryOptionsEuStandardPlaceOfSupplyScheme { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for TaxProductRegistrationsResourceCountryOptionsEuStandardPlaceOfSupplyScheme { - fn default() -> Self { - Self::SmallSeller - } -} - -/// An enum representing the possible values of an `TaxProductRegistrationsResourceCountryOptionsEurope`'s `type` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum TaxProductRegistrationsResourceCountryOptionsEuropeType { - Ioss, - OssNonUnion, - OssUnion, - Standard, -} - -impl TaxProductRegistrationsResourceCountryOptionsEuropeType { - pub fn as_str(self) -> &'static str { - match self { - TaxProductRegistrationsResourceCountryOptionsEuropeType::Ioss => "ioss", - TaxProductRegistrationsResourceCountryOptionsEuropeType::OssNonUnion => "oss_non_union", - TaxProductRegistrationsResourceCountryOptionsEuropeType::OssUnion => "oss_union", - TaxProductRegistrationsResourceCountryOptionsEuropeType::Standard => "standard", - } - } -} - -impl AsRef for TaxProductRegistrationsResourceCountryOptionsEuropeType { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for TaxProductRegistrationsResourceCountryOptionsEuropeType { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for TaxProductRegistrationsResourceCountryOptionsEuropeType { - fn default() -> Self { - Self::Ioss - } -} - -/// An enum representing the possible values of an `TaxProductRegistrationsResourceCountryOptionsSimplified`'s `type` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum TaxProductRegistrationsResourceCountryOptionsSimplifiedType { - Simplified, -} - -impl TaxProductRegistrationsResourceCountryOptionsSimplifiedType { - pub fn as_str(self) -> &'static str { - match self { - TaxProductRegistrationsResourceCountryOptionsSimplifiedType::Simplified => "simplified", - } - } -} - -impl AsRef for TaxProductRegistrationsResourceCountryOptionsSimplifiedType { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for TaxProductRegistrationsResourceCountryOptionsSimplifiedType { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for TaxProductRegistrationsResourceCountryOptionsSimplifiedType { - fn default() -> Self { - Self::Simplified - } -} - -/// An enum representing the possible values of an `TaxProductRegistrationsResourceCountryOptionsUnitedStates`'s `type` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum TaxProductRegistrationsResourceCountryOptionsUnitedStatesType { - LocalAmusementTax, - LocalLeaseTax, - StateCommunicationsTax, - StateSalesTax, -} - -impl TaxProductRegistrationsResourceCountryOptionsUnitedStatesType { - pub fn as_str(self) -> &'static str { - match self { - TaxProductRegistrationsResourceCountryOptionsUnitedStatesType::LocalAmusementTax => "local_amusement_tax", - TaxProductRegistrationsResourceCountryOptionsUnitedStatesType::LocalLeaseTax => "local_lease_tax", - TaxProductRegistrationsResourceCountryOptionsUnitedStatesType::StateCommunicationsTax => "state_communications_tax", - TaxProductRegistrationsResourceCountryOptionsUnitedStatesType::StateSalesTax => "state_sales_tax", - } - } -} - -impl AsRef for TaxProductRegistrationsResourceCountryOptionsUnitedStatesType { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for TaxProductRegistrationsResourceCountryOptionsUnitedStatesType { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for TaxProductRegistrationsResourceCountryOptionsUnitedStatesType { - fn default() -> Self { - Self::LocalAmusementTax - } -} - -/// An enum representing the possible values of an `TaxRegistration`'s `status` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum TaxRegistrationStatus { - Active, - Expired, - Scheduled, -} - -impl TaxRegistrationStatus { - pub fn as_str(self) -> &'static str { - match self { - TaxRegistrationStatus::Active => "active", - TaxRegistrationStatus::Expired => "expired", - TaxRegistrationStatus::Scheduled => "scheduled", - } - } -} - -impl AsRef for TaxRegistrationStatus { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for TaxRegistrationStatus { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for TaxRegistrationStatus { - fn default() -> Self { - Self::Active - } -} diff --git a/src/resources/generated/tax_settings.rs b/src/resources/generated/tax_settings.rs deleted file mode 100644 index be6357b5d..000000000 --- a/src/resources/generated/tax_settings.rs +++ /dev/null @@ -1,150 +0,0 @@ -// ====================================== -// This file was automatically generated. -// ====================================== - -use crate::params::{Object}; -use crate::resources::{Address}; -use serde::{Deserialize, Serialize}; - -/// The resource representing a Stripe "TaxProductResourceTaxSettings". -/// -/// For more details see -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct TaxSettings { - - pub defaults: TaxProductResourceTaxSettingsDefaults, - - /// The place where your business is located. - pub head_office: Option, - - /// Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. - pub livemode: bool, - - /// The `active` status indicates you have all required settings to calculate tax. - /// - /// A status can transition out of `active` when new required settings are introduced. - pub status: TaxSettingsStatus, - - pub status_details: TaxProductResourceTaxSettingsStatusDetails, -} - -impl Object for TaxSettings { - type Id = (); - fn id(&self) -> Self::Id {} - fn object(&self) -> &'static str { - "tax.settings" - } -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct TaxProductResourceTaxSettingsDefaults { - - /// Default [tax behavior](https://stripe.com/docs/tax/products-prices-tax-categories-tax-behavior#tax-behavior) used to specify whether the price is considered inclusive of taxes or exclusive of taxes. - /// - /// If the item's price has a tax behavior set, it will take precedence over the default tax behavior. - pub tax_behavior: Option, - - /// Default [tax code](https://stripe.com/docs/tax/tax-categories) used to classify your products and prices. - pub tax_code: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct TaxProductResourceTaxSettingsHeadOffice { - - pub address: Address, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct TaxProductResourceTaxSettingsStatusDetails { - - #[serde(skip_serializing_if = "Option::is_none")] - pub active: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub pending: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct TaxProductResourceTaxSettingsStatusDetailsResourceActive { -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct TaxProductResourceTaxSettingsStatusDetailsResourcePending { - - /// The list of missing fields that are required to perform calculations. - /// - /// It includes the entry `head_office` when the status is `pending`. - /// It is recommended to set the optional values even if they aren't listed as required for calculating taxes. - /// Calculations can fail if missing fields aren't explicitly provided on every call. - pub missing_fields: Option>, -} - -/// An enum representing the possible values of an `TaxProductResourceTaxSettingsDefaults`'s `tax_behavior` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum TaxProductResourceTaxSettingsDefaultsTaxBehavior { - Exclusive, - Inclusive, - InferredByCurrency, -} - -impl TaxProductResourceTaxSettingsDefaultsTaxBehavior { - pub fn as_str(self) -> &'static str { - match self { - TaxProductResourceTaxSettingsDefaultsTaxBehavior::Exclusive => "exclusive", - TaxProductResourceTaxSettingsDefaultsTaxBehavior::Inclusive => "inclusive", - TaxProductResourceTaxSettingsDefaultsTaxBehavior::InferredByCurrency => "inferred_by_currency", - } - } -} - -impl AsRef for TaxProductResourceTaxSettingsDefaultsTaxBehavior { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for TaxProductResourceTaxSettingsDefaultsTaxBehavior { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for TaxProductResourceTaxSettingsDefaultsTaxBehavior { - fn default() -> Self { - Self::Exclusive - } -} - -/// An enum representing the possible values of an `TaxSettings`'s `status` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum TaxSettingsStatus { - Active, - Pending, -} - -impl TaxSettingsStatus { - pub fn as_str(self) -> &'static str { - match self { - TaxSettingsStatus::Active => "active", - TaxSettingsStatus::Pending => "pending", - } - } -} - -impl AsRef for TaxSettingsStatus { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for TaxSettingsStatus { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for TaxSettingsStatus { - fn default() -> Self { - Self::Active - } -} diff --git a/src/resources/generated/tax_settings_updated.rs b/src/resources/generated/tax_settings_updated.rs deleted file mode 100644 index f238e8e69..000000000 --- a/src/resources/generated/tax_settings_updated.rs +++ /dev/null @@ -1,10 +0,0 @@ -// ====================================== -// This file was automatically generated. -// ====================================== - -use serde::{Deserialize, Serialize}; - -/// The resource representing a Stripe "tax.settings.updated". -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct TaxSettingsUpdated { -} diff --git a/src/resources/generated/tax_transaction.rs b/src/resources/generated/tax_transaction.rs deleted file mode 100644 index 790efe1d7..000000000 --- a/src/resources/generated/tax_transaction.rs +++ /dev/null @@ -1,423 +0,0 @@ -// ====================================== -// This file was automatically generated. -// ====================================== - -use crate::ids::{TaxTransactionId}; -use crate::params::{List, Metadata, Object, Timestamp}; -use crate::resources::{Currency, TaxProductResourceCustomerDetails, TaxTransactionLineItem}; -use serde::{Deserialize, Serialize}; - -/// The resource representing a Stripe "TaxProductResourceTaxTransaction". -/// -/// For more details see -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct TaxTransaction { - /// Unique identifier for the transaction. - pub id: TaxTransactionId, - - /// Time at which the object was created. - /// - /// Measured in seconds since the Unix epoch. - pub created: Timestamp, - - /// Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. - /// - /// Must be a [supported currency](https://stripe.com/docs/currencies). - pub currency: Currency, - - /// The ID of an existing [Customer](https://stripe.com/docs/api/customers/object) used for the resource. - pub customer: Option, - - pub customer_details: TaxProductResourceCustomerDetails, - - /// The tax collected or refunded, by line item. - pub line_items: Option>, - - /// Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. - pub livemode: bool, - - /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. - /// - /// This can be useful for storing additional information about the object in a structured format. - pub metadata: Option, - - /// A custom unique identifier, such as 'myOrder_123'. - pub reference: String, - - /// If `type=reversal`, contains information about what was reversed. - pub reversal: Option, - - /// The shipping cost details for the transaction. - pub shipping_cost: Option, - - /// Timestamp of date at which the tax rules and rates in effect applies for the calculation. - pub tax_date: Timestamp, - - /// If `reversal`, this transaction reverses an earlier transaction. - #[serde(rename = "type")] - pub type_: TaxTransactionType, -} - -impl Object for TaxTransaction { - type Id = TaxTransactionId; - fn id(&self) -> Self::Id { - self.id.clone() - } - fn object(&self) -> &'static str { - "tax.transaction" - } -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct TaxProductResourceTaxTransactionResourceReversal { - - /// The `id` of the reversed `Transaction` object. - pub original_transaction: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct TaxProductResourceTaxTransactionShippingCost { - - /// The shipping amount in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal). - /// - /// If `tax_behavior=inclusive`, then this amount includes taxes. - /// Otherwise, taxes were calculated on top of this amount. - pub amount: i64, - - /// The amount of tax calculated for shipping, in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal). - pub amount_tax: i64, - - /// The ID of an existing [ShippingRate](https://stripe.com/docs/api/shipping_rates/object). - #[serde(skip_serializing_if = "Option::is_none")] - pub shipping_rate: Option, - - /// Specifies whether the `amount` includes taxes. - /// - /// If `tax_behavior=inclusive`, then the amount includes taxes. - pub tax_behavior: TaxProductResourceTaxTransactionShippingCostTaxBehavior, - - /// Detailed account of taxes relevant to shipping cost. - /// - /// (It is not populated for the transaction resource object and will be removed in the next API version.). - #[serde(skip_serializing_if = "Option::is_none")] - pub tax_breakdown: Option>, - - /// The [tax code](https://stripe.com/docs/tax/tax-categories) ID used for shipping. - pub tax_code: String, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct TaxProductResourceLineItemTaxBreakdown { - - /// The amount of tax, in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal). - pub amount: i64, - - pub jurisdiction: TaxProductResourceJurisdiction, - - /// Indicates whether the jurisdiction was determined by the origin (merchant's address) or destination (customer's address). - pub sourcing: TaxProductResourceLineItemTaxBreakdownSourcing, - - /// Details regarding the rate for this tax. - /// - /// This field will be `null` when the tax is not imposed, for example if the product is exempt from tax. - pub tax_rate_details: Option, - - /// The reasoning behind this tax, for example, if the product is tax exempt. - /// - /// The possible values for this field may be extended as new tax rules are supported. - pub taxability_reason: TaxProductResourceLineItemTaxBreakdownTaxabilityReason, - - /// The amount on which tax is calculated, in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal). - pub taxable_amount: i64, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct TaxProductResourceJurisdiction { - - /// Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). - pub country: String, - - /// A human-readable name for the jurisdiction imposing the tax. - pub display_name: String, - - /// Indicates the level of the jurisdiction imposing the tax. - pub level: TaxProductResourceJurisdictionLevel, - - /// [ISO 3166-2 subdivision code](https://en.wikipedia.org/wiki/ISO_3166-2:US), without country prefix. - /// - /// For example, "NY" for New York, United States. - pub state: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct TaxProductResourceLineItemTaxRateDetails { - - /// A localized display name for tax type, intended to be human-readable. - /// - /// For example, "Local Sales and Use Tax", "Value-added tax (VAT)", or "Umsatzsteuer (USt.)". - pub display_name: String, - - /// The tax rate percentage as a string. - /// - /// For example, 8.5% is represented as "8.5". - pub percentage_decimal: String, - - /// The tax type, such as `vat` or `sales_tax`. - pub tax_type: TaxProductResourceLineItemTaxRateDetailsTaxType, -} - -/// An enum representing the possible values of an `TaxProductResourceJurisdiction`'s `level` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum TaxProductResourceJurisdictionLevel { - City, - Country, - County, - District, - State, -} - -impl TaxProductResourceJurisdictionLevel { - pub fn as_str(self) -> &'static str { - match self { - TaxProductResourceJurisdictionLevel::City => "city", - TaxProductResourceJurisdictionLevel::Country => "country", - TaxProductResourceJurisdictionLevel::County => "county", - TaxProductResourceJurisdictionLevel::District => "district", - TaxProductResourceJurisdictionLevel::State => "state", - } - } -} - -impl AsRef for TaxProductResourceJurisdictionLevel { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for TaxProductResourceJurisdictionLevel { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for TaxProductResourceJurisdictionLevel { - fn default() -> Self { - Self::City - } -} - -/// An enum representing the possible values of an `TaxProductResourceLineItemTaxBreakdown`'s `sourcing` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum TaxProductResourceLineItemTaxBreakdownSourcing { - Destination, - Origin, -} - -impl TaxProductResourceLineItemTaxBreakdownSourcing { - pub fn as_str(self) -> &'static str { - match self { - TaxProductResourceLineItemTaxBreakdownSourcing::Destination => "destination", - TaxProductResourceLineItemTaxBreakdownSourcing::Origin => "origin", - } - } -} - -impl AsRef for TaxProductResourceLineItemTaxBreakdownSourcing { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for TaxProductResourceLineItemTaxBreakdownSourcing { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for TaxProductResourceLineItemTaxBreakdownSourcing { - fn default() -> Self { - Self::Destination - } -} - -/// An enum representing the possible values of an `TaxProductResourceLineItemTaxBreakdown`'s `taxability_reason` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum TaxProductResourceLineItemTaxBreakdownTaxabilityReason { - CustomerExempt, - NotCollecting, - NotSubjectToTax, - NotSupported, - PortionProductExempt, - PortionReducedRated, - PortionStandardRated, - ProductExempt, - ProductExemptHoliday, - ProportionallyRated, - ReducedRated, - ReverseCharge, - StandardRated, - TaxableBasisReduced, - ZeroRated, -} - -impl TaxProductResourceLineItemTaxBreakdownTaxabilityReason { - pub fn as_str(self) -> &'static str { - match self { - TaxProductResourceLineItemTaxBreakdownTaxabilityReason::CustomerExempt => "customer_exempt", - TaxProductResourceLineItemTaxBreakdownTaxabilityReason::NotCollecting => "not_collecting", - TaxProductResourceLineItemTaxBreakdownTaxabilityReason::NotSubjectToTax => "not_subject_to_tax", - TaxProductResourceLineItemTaxBreakdownTaxabilityReason::NotSupported => "not_supported", - TaxProductResourceLineItemTaxBreakdownTaxabilityReason::PortionProductExempt => "portion_product_exempt", - TaxProductResourceLineItemTaxBreakdownTaxabilityReason::PortionReducedRated => "portion_reduced_rated", - TaxProductResourceLineItemTaxBreakdownTaxabilityReason::PortionStandardRated => "portion_standard_rated", - TaxProductResourceLineItemTaxBreakdownTaxabilityReason::ProductExempt => "product_exempt", - TaxProductResourceLineItemTaxBreakdownTaxabilityReason::ProductExemptHoliday => "product_exempt_holiday", - TaxProductResourceLineItemTaxBreakdownTaxabilityReason::ProportionallyRated => "proportionally_rated", - TaxProductResourceLineItemTaxBreakdownTaxabilityReason::ReducedRated => "reduced_rated", - TaxProductResourceLineItemTaxBreakdownTaxabilityReason::ReverseCharge => "reverse_charge", - TaxProductResourceLineItemTaxBreakdownTaxabilityReason::StandardRated => "standard_rated", - TaxProductResourceLineItemTaxBreakdownTaxabilityReason::TaxableBasisReduced => "taxable_basis_reduced", - TaxProductResourceLineItemTaxBreakdownTaxabilityReason::ZeroRated => "zero_rated", - } - } -} - -impl AsRef for TaxProductResourceLineItemTaxBreakdownTaxabilityReason { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for TaxProductResourceLineItemTaxBreakdownTaxabilityReason { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for TaxProductResourceLineItemTaxBreakdownTaxabilityReason { - fn default() -> Self { - Self::CustomerExempt - } -} - -/// An enum representing the possible values of an `TaxProductResourceLineItemTaxRateDetails`'s `tax_type` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum TaxProductResourceLineItemTaxRateDetailsTaxType { - AmusementTax, - CommunicationsTax, - Gst, - Hst, - Igst, - Jct, - LeaseTax, - Pst, - Qst, - Rst, - SalesTax, - Vat, -} - -impl TaxProductResourceLineItemTaxRateDetailsTaxType { - pub fn as_str(self) -> &'static str { - match self { - TaxProductResourceLineItemTaxRateDetailsTaxType::AmusementTax => "amusement_tax", - TaxProductResourceLineItemTaxRateDetailsTaxType::CommunicationsTax => "communications_tax", - TaxProductResourceLineItemTaxRateDetailsTaxType::Gst => "gst", - TaxProductResourceLineItemTaxRateDetailsTaxType::Hst => "hst", - TaxProductResourceLineItemTaxRateDetailsTaxType::Igst => "igst", - TaxProductResourceLineItemTaxRateDetailsTaxType::Jct => "jct", - TaxProductResourceLineItemTaxRateDetailsTaxType::LeaseTax => "lease_tax", - TaxProductResourceLineItemTaxRateDetailsTaxType::Pst => "pst", - TaxProductResourceLineItemTaxRateDetailsTaxType::Qst => "qst", - TaxProductResourceLineItemTaxRateDetailsTaxType::Rst => "rst", - TaxProductResourceLineItemTaxRateDetailsTaxType::SalesTax => "sales_tax", - TaxProductResourceLineItemTaxRateDetailsTaxType::Vat => "vat", - } - } -} - -impl AsRef for TaxProductResourceLineItemTaxRateDetailsTaxType { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for TaxProductResourceLineItemTaxRateDetailsTaxType { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for TaxProductResourceLineItemTaxRateDetailsTaxType { - fn default() -> Self { - Self::AmusementTax - } -} - -/// An enum representing the possible values of an `TaxProductResourceTaxTransactionShippingCost`'s `tax_behavior` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum TaxProductResourceTaxTransactionShippingCostTaxBehavior { - Exclusive, - Inclusive, -} - -impl TaxProductResourceTaxTransactionShippingCostTaxBehavior { - pub fn as_str(self) -> &'static str { - match self { - TaxProductResourceTaxTransactionShippingCostTaxBehavior::Exclusive => "exclusive", - TaxProductResourceTaxTransactionShippingCostTaxBehavior::Inclusive => "inclusive", - } - } -} - -impl AsRef for TaxProductResourceTaxTransactionShippingCostTaxBehavior { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for TaxProductResourceTaxTransactionShippingCostTaxBehavior { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for TaxProductResourceTaxTransactionShippingCostTaxBehavior { - fn default() -> Self { - Self::Exclusive - } -} - -/// An enum representing the possible values of an `TaxTransaction`'s `type` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum TaxTransactionType { - Reversal, - Transaction, -} - -impl TaxTransactionType { - pub fn as_str(self) -> &'static str { - match self { - TaxTransactionType::Reversal => "reversal", - TaxTransactionType::Transaction => "transaction", - } - } -} - -impl AsRef for TaxTransactionType { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for TaxTransactionType { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for TaxTransactionType { - fn default() -> Self { - Self::Reversal - } -} diff --git a/src/resources/generated/tax_transaction_line_item.rs b/src/resources/generated/tax_transaction_line_item.rs deleted file mode 100644 index 8707265c5..000000000 --- a/src/resources/generated/tax_transaction_line_item.rs +++ /dev/null @@ -1,142 +0,0 @@ -// ====================================== -// This file was automatically generated. -// ====================================== - -use crate::ids::{TaxTransactionLineItemId}; -use crate::params::{Metadata, Object}; -use serde::{Deserialize, Serialize}; - -/// The resource representing a Stripe "TaxProductResourceTaxTransactionLineItem". -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct TaxTransactionLineItem { - /// Unique identifier for the object. - pub id: TaxTransactionLineItemId, - - /// The line item amount in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal). - /// - /// If `tax_behavior=inclusive`, then this amount includes taxes. - /// Otherwise, taxes were calculated on top of this amount. - pub amount: i64, - - /// The amount of tax calculated for this line item, in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal). - pub amount_tax: i64, - - /// Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. - pub livemode: bool, - - /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. - /// - /// This can be useful for storing additional information about the object in a structured format. - pub metadata: Option, - - /// The ID of an existing [Product](https://stripe.com/docs/api/products/object). - pub product: Option, - - /// The number of units of the item being purchased. - /// - /// For reversals, this is the quantity reversed. - pub quantity: u64, - - /// A custom identifier for this line item in the transaction. - pub reference: String, - - /// If `type=reversal`, contains information about what was reversed. - pub reversal: Option, - - /// Specifies whether the `amount` includes taxes. - /// - /// If `tax_behavior=inclusive`, then the amount includes taxes. - pub tax_behavior: TaxTransactionLineItemTaxBehavior, - - /// The [tax code](https://stripe.com/docs/tax/tax-categories) ID used for this resource. - pub tax_code: String, - - /// If `reversal`, this line item reverses an earlier transaction. - #[serde(rename = "type")] - pub type_: TaxTransactionLineItemType, -} - -impl Object for TaxTransactionLineItem { - type Id = TaxTransactionLineItemId; - fn id(&self) -> Self::Id { - self.id.clone() - } - fn object(&self) -> &'static str { - "tax.transaction_line_item" - } -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct TaxProductResourceTaxTransactionLineItemResourceReversal { - - /// The `id` of the line item to reverse in the original transaction. - pub original_line_item: String, -} - -/// An enum representing the possible values of an `TaxTransactionLineItem`'s `tax_behavior` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum TaxTransactionLineItemTaxBehavior { - Exclusive, - Inclusive, -} - -impl TaxTransactionLineItemTaxBehavior { - pub fn as_str(self) -> &'static str { - match self { - TaxTransactionLineItemTaxBehavior::Exclusive => "exclusive", - TaxTransactionLineItemTaxBehavior::Inclusive => "inclusive", - } - } -} - -impl AsRef for TaxTransactionLineItemTaxBehavior { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for TaxTransactionLineItemTaxBehavior { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for TaxTransactionLineItemTaxBehavior { - fn default() -> Self { - Self::Exclusive - } -} - -/// An enum representing the possible values of an `TaxTransactionLineItem`'s `type` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum TaxTransactionLineItemType { - Reversal, - Transaction, -} - -impl TaxTransactionLineItemType { - pub fn as_str(self) -> &'static str { - match self { - TaxTransactionLineItemType::Reversal => "reversal", - TaxTransactionLineItemType::Transaction => "transaction", - } - } -} - -impl AsRef for TaxTransactionLineItemType { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for TaxTransactionLineItemType { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for TaxTransactionLineItemType { - fn default() -> Self { - Self::Reversal - } -} diff --git a/src/resources/generated/terminal_configuration.rs b/src/resources/generated/terminal_configuration.rs deleted file mode 100644 index bdf26ba45..000000000 --- a/src/resources/generated/terminal_configuration.rs +++ /dev/null @@ -1,522 +0,0 @@ -// ====================================== -// This file was automatically generated. -// ====================================== - -use serde::{Deserialize, Serialize}; - -use crate::client::{Client, Response}; -use crate::ids::TerminalConfigurationId; -use crate::params::{Expand, Expandable, List, Object, Paginable}; -use crate::resources::File; - -/// The resource representing a Stripe "TerminalConfigurationConfiguration". -/// -/// For more details see -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct TerminalConfiguration { - /// Unique identifier for the object. - pub id: TerminalConfigurationId, - - #[serde(skip_serializing_if = "Option::is_none")] - pub bbpos_wisepos_e: Option, - - // Always true for a deleted object - #[serde(default)] - pub deleted: bool, - - /// Whether this Configuration is the default for your account. - #[serde(skip_serializing_if = "Option::is_none")] - pub is_account_default: Option, - - /// Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. - #[serde(skip_serializing_if = "Option::is_none")] - pub livemode: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub offline: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub tipping: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub verifone_p400: Option, -} - -impl TerminalConfiguration { - /// Returns a list of `Configuration` objects. - pub fn list( - client: &Client, - params: &ListTerminalConfigurations<'_>, - ) -> Response> { - client.get_query("/terminal/configurations", ¶ms) - } - - /// Creates a new `Configuration` object. - pub fn create( - client: &Client, - params: CreateTerminalConfiguration<'_>, - ) -> Response { - client.post_form("/terminal/configurations", ¶ms) - } -} - -impl Object for TerminalConfiguration { - type Id = TerminalConfigurationId; - fn id(&self) -> Self::Id { - self.id.clone() - } - fn object(&self) -> &'static str { - "terminal.configuration" - } -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct TerminalConfigurationConfigurationResourceDeviceTypeSpecificConfig { - /// A File ID representing an image you would like displayed on the reader. - #[serde(skip_serializing_if = "Option::is_none")] - pub splashscreen: Option>, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct TerminalConfigurationConfigurationResourceOfflineConfig { - /// Determines whether to allow transactions to be collected while reader is offline. - /// - /// Defaults to false. - pub enabled: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct TerminalConfigurationConfigurationResourceTipping { - #[serde(skip_serializing_if = "Option::is_none")] - pub aud: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub cad: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub chf: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub czk: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub dkk: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub eur: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub gbp: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub hkd: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub myr: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub nok: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub nzd: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub sek: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub sgd: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub usd: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct TerminalConfigurationConfigurationResourceCurrencySpecificConfig { - /// Fixed amounts displayed when collecting a tip. - #[serde(skip_serializing_if = "Option::is_none")] - pub fixed_amounts: Option>, - - /// Percentages displayed when collecting a tip. - #[serde(skip_serializing_if = "Option::is_none")] - pub percentages: Option>, - - /// Below this amount, fixed amounts will be displayed; above it, percentages will be displayed. - #[serde(skip_serializing_if = "Option::is_none")] - pub smart_tip_threshold: Option, -} - -/// The parameters for `TerminalConfiguration::create`. -#[derive(Clone, Debug, Serialize, Default)] -pub struct CreateTerminalConfiguration<'a> { - /// An object containing device type specific settings for BBPOS WisePOS E readers. - #[serde(skip_serializing_if = "Option::is_none")] - pub bbpos_wisepos_e: Option, - - /// Specifies which fields in the response should be expanded. - #[serde(skip_serializing_if = "Expand::is_empty")] - pub expand: &'a [&'a str], - - /// Configurations for collecting transactions offline. - #[serde(skip_serializing_if = "Option::is_none")] - pub offline: Option, - - /// Tipping configurations for readers supporting on-reader tips. - #[serde(skip_serializing_if = "Option::is_none")] - pub tipping: Option, - - /// An object containing device type specific settings for Verifone P400 readers. - #[serde(skip_serializing_if = "Option::is_none")] - pub verifone_p400: Option, -} - -impl<'a> CreateTerminalConfiguration<'a> { - pub fn new() -> Self { - CreateTerminalConfiguration { - bbpos_wisepos_e: Default::default(), - expand: Default::default(), - offline: Default::default(), - tipping: Default::default(), - verifone_p400: Default::default(), - } - } -} - -/// The parameters for `TerminalConfiguration::list`. -#[derive(Clone, Debug, Serialize, Default)] -pub struct ListTerminalConfigurations<'a> { - /// A cursor for use in pagination. - /// - /// `ending_before` is an object ID that defines your place in the list. - /// For instance, if you make a list request and receive 100 objects, starting with `obj_bar`, your subsequent call can include `ending_before=obj_bar` in order to fetch the previous page of the list. - #[serde(skip_serializing_if = "Option::is_none")] - pub ending_before: Option, - - /// Specifies which fields in the response should be expanded. - #[serde(skip_serializing_if = "Expand::is_empty")] - pub expand: &'a [&'a str], - - /// if present, only return the account default or non-default configurations. - #[serde(skip_serializing_if = "Option::is_none")] - pub is_account_default: Option, - - /// A limit on the number of objects to be returned. - /// - /// Limit can range between 1 and 100, and the default is 10. - #[serde(skip_serializing_if = "Option::is_none")] - pub limit: Option, - - /// A cursor for use in pagination. - /// - /// `starting_after` is an object ID that defines your place in the list. - /// For instance, if you make a list request and receive 100 objects, ending with `obj_foo`, your subsequent call can include `starting_after=obj_foo` in order to fetch the next page of the list. - #[serde(skip_serializing_if = "Option::is_none")] - pub starting_after: Option, -} - -impl<'a> ListTerminalConfigurations<'a> { - pub fn new() -> Self { - ListTerminalConfigurations { - ending_before: Default::default(), - expand: Default::default(), - is_account_default: Default::default(), - limit: Default::default(), - starting_after: Default::default(), - } - } -} -impl Paginable for ListTerminalConfigurations<'_> { - type O = TerminalConfiguration; - fn set_last(&mut self, item: Self::O) { - self.starting_after = Some(item.id()); - } -} -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreateTerminalConfigurationBbposWiseposE { - /// A File ID representing an image you would like displayed on the reader. - #[serde(skip_serializing_if = "Option::is_none")] - pub splashscreen: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreateTerminalConfigurationOffline { - /// Determines whether to allow transactions to be collected while reader is offline. - /// - /// Defaults to false. - pub enabled: bool, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreateTerminalConfigurationTipping { - /// Tipping configuration for AUD. - #[serde(skip_serializing_if = "Option::is_none")] - pub aud: Option, - - /// Tipping configuration for CAD. - #[serde(skip_serializing_if = "Option::is_none")] - pub cad: Option, - - /// Tipping configuration for CHF. - #[serde(skip_serializing_if = "Option::is_none")] - pub chf: Option, - - /// Tipping configuration for CZK. - #[serde(skip_serializing_if = "Option::is_none")] - pub czk: Option, - - /// Tipping configuration for DKK. - #[serde(skip_serializing_if = "Option::is_none")] - pub dkk: Option, - - /// Tipping configuration for EUR. - #[serde(skip_serializing_if = "Option::is_none")] - pub eur: Option, - - /// Tipping configuration for GBP. - #[serde(skip_serializing_if = "Option::is_none")] - pub gbp: Option, - - /// Tipping configuration for HKD. - #[serde(skip_serializing_if = "Option::is_none")] - pub hkd: Option, - - /// Tipping configuration for MYR. - #[serde(skip_serializing_if = "Option::is_none")] - pub myr: Option, - - /// Tipping configuration for NOK. - #[serde(skip_serializing_if = "Option::is_none")] - pub nok: Option, - - /// Tipping configuration for NZD. - #[serde(skip_serializing_if = "Option::is_none")] - pub nzd: Option, - - /// Tipping configuration for SEK. - #[serde(skip_serializing_if = "Option::is_none")] - pub sek: Option, - - /// Tipping configuration for SGD. - #[serde(skip_serializing_if = "Option::is_none")] - pub sgd: Option, - - /// Tipping configuration for USD. - #[serde(skip_serializing_if = "Option::is_none")] - pub usd: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreateTerminalConfigurationVerifoneP400 { - /// A File ID representing an image you would like displayed on the reader. - #[serde(skip_serializing_if = "Option::is_none")] - pub splashscreen: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreateTerminalConfigurationTippingAud { - /// Fixed amounts displayed when collecting a tip. - #[serde(skip_serializing_if = "Option::is_none")] - pub fixed_amounts: Option>, - - /// Percentages displayed when collecting a tip. - #[serde(skip_serializing_if = "Option::is_none")] - pub percentages: Option>, - - /// Below this amount, fixed amounts will be displayed; above it, percentages will be displayed. - #[serde(skip_serializing_if = "Option::is_none")] - pub smart_tip_threshold: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreateTerminalConfigurationTippingCad { - /// Fixed amounts displayed when collecting a tip. - #[serde(skip_serializing_if = "Option::is_none")] - pub fixed_amounts: Option>, - - /// Percentages displayed when collecting a tip. - #[serde(skip_serializing_if = "Option::is_none")] - pub percentages: Option>, - - /// Below this amount, fixed amounts will be displayed; above it, percentages will be displayed. - #[serde(skip_serializing_if = "Option::is_none")] - pub smart_tip_threshold: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreateTerminalConfigurationTippingChf { - /// Fixed amounts displayed when collecting a tip. - #[serde(skip_serializing_if = "Option::is_none")] - pub fixed_amounts: Option>, - - /// Percentages displayed when collecting a tip. - #[serde(skip_serializing_if = "Option::is_none")] - pub percentages: Option>, - - /// Below this amount, fixed amounts will be displayed; above it, percentages will be displayed. - #[serde(skip_serializing_if = "Option::is_none")] - pub smart_tip_threshold: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreateTerminalConfigurationTippingCzk { - /// Fixed amounts displayed when collecting a tip. - #[serde(skip_serializing_if = "Option::is_none")] - pub fixed_amounts: Option>, - - /// Percentages displayed when collecting a tip. - #[serde(skip_serializing_if = "Option::is_none")] - pub percentages: Option>, - - /// Below this amount, fixed amounts will be displayed; above it, percentages will be displayed. - #[serde(skip_serializing_if = "Option::is_none")] - pub smart_tip_threshold: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreateTerminalConfigurationTippingDkk { - /// Fixed amounts displayed when collecting a tip. - #[serde(skip_serializing_if = "Option::is_none")] - pub fixed_amounts: Option>, - - /// Percentages displayed when collecting a tip. - #[serde(skip_serializing_if = "Option::is_none")] - pub percentages: Option>, - - /// Below this amount, fixed amounts will be displayed; above it, percentages will be displayed. - #[serde(skip_serializing_if = "Option::is_none")] - pub smart_tip_threshold: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreateTerminalConfigurationTippingEur { - /// Fixed amounts displayed when collecting a tip. - #[serde(skip_serializing_if = "Option::is_none")] - pub fixed_amounts: Option>, - - /// Percentages displayed when collecting a tip. - #[serde(skip_serializing_if = "Option::is_none")] - pub percentages: Option>, - - /// Below this amount, fixed amounts will be displayed; above it, percentages will be displayed. - #[serde(skip_serializing_if = "Option::is_none")] - pub smart_tip_threshold: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreateTerminalConfigurationTippingGbp { - /// Fixed amounts displayed when collecting a tip. - #[serde(skip_serializing_if = "Option::is_none")] - pub fixed_amounts: Option>, - - /// Percentages displayed when collecting a tip. - #[serde(skip_serializing_if = "Option::is_none")] - pub percentages: Option>, - - /// Below this amount, fixed amounts will be displayed; above it, percentages will be displayed. - #[serde(skip_serializing_if = "Option::is_none")] - pub smart_tip_threshold: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreateTerminalConfigurationTippingHkd { - /// Fixed amounts displayed when collecting a tip. - #[serde(skip_serializing_if = "Option::is_none")] - pub fixed_amounts: Option>, - - /// Percentages displayed when collecting a tip. - #[serde(skip_serializing_if = "Option::is_none")] - pub percentages: Option>, - - /// Below this amount, fixed amounts will be displayed; above it, percentages will be displayed. - #[serde(skip_serializing_if = "Option::is_none")] - pub smart_tip_threshold: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreateTerminalConfigurationTippingMyr { - /// Fixed amounts displayed when collecting a tip. - #[serde(skip_serializing_if = "Option::is_none")] - pub fixed_amounts: Option>, - - /// Percentages displayed when collecting a tip. - #[serde(skip_serializing_if = "Option::is_none")] - pub percentages: Option>, - - /// Below this amount, fixed amounts will be displayed; above it, percentages will be displayed. - #[serde(skip_serializing_if = "Option::is_none")] - pub smart_tip_threshold: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreateTerminalConfigurationTippingNok { - /// Fixed amounts displayed when collecting a tip. - #[serde(skip_serializing_if = "Option::is_none")] - pub fixed_amounts: Option>, - - /// Percentages displayed when collecting a tip. - #[serde(skip_serializing_if = "Option::is_none")] - pub percentages: Option>, - - /// Below this amount, fixed amounts will be displayed; above it, percentages will be displayed. - #[serde(skip_serializing_if = "Option::is_none")] - pub smart_tip_threshold: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreateTerminalConfigurationTippingNzd { - /// Fixed amounts displayed when collecting a tip. - #[serde(skip_serializing_if = "Option::is_none")] - pub fixed_amounts: Option>, - - /// Percentages displayed when collecting a tip. - #[serde(skip_serializing_if = "Option::is_none")] - pub percentages: Option>, - - /// Below this amount, fixed amounts will be displayed; above it, percentages will be displayed. - #[serde(skip_serializing_if = "Option::is_none")] - pub smart_tip_threshold: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreateTerminalConfigurationTippingSek { - /// Fixed amounts displayed when collecting a tip. - #[serde(skip_serializing_if = "Option::is_none")] - pub fixed_amounts: Option>, - - /// Percentages displayed when collecting a tip. - #[serde(skip_serializing_if = "Option::is_none")] - pub percentages: Option>, - - /// Below this amount, fixed amounts will be displayed; above it, percentages will be displayed. - #[serde(skip_serializing_if = "Option::is_none")] - pub smart_tip_threshold: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreateTerminalConfigurationTippingSgd { - /// Fixed amounts displayed when collecting a tip. - #[serde(skip_serializing_if = "Option::is_none")] - pub fixed_amounts: Option>, - - /// Percentages displayed when collecting a tip. - #[serde(skip_serializing_if = "Option::is_none")] - pub percentages: Option>, - - /// Below this amount, fixed amounts will be displayed; above it, percentages will be displayed. - #[serde(skip_serializing_if = "Option::is_none")] - pub smart_tip_threshold: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreateTerminalConfigurationTippingUsd { - /// Fixed amounts displayed when collecting a tip. - #[serde(skip_serializing_if = "Option::is_none")] - pub fixed_amounts: Option>, - - /// Percentages displayed when collecting a tip. - #[serde(skip_serializing_if = "Option::is_none")] - pub percentages: Option>, - - /// Below this amount, fixed amounts will be displayed; above it, percentages will be displayed. - #[serde(skip_serializing_if = "Option::is_none")] - pub smart_tip_threshold: Option, -} diff --git a/src/resources/generated/terminal_connection_token.rs b/src/resources/generated/terminal_connection_token.rs deleted file mode 100644 index 3d3eff1f3..000000000 --- a/src/resources/generated/terminal_connection_token.rs +++ /dev/null @@ -1,66 +0,0 @@ -// ====================================== -// This file was automatically generated. -// ====================================== - -use serde::{Deserialize, Serialize}; - -use crate::client::{Client, Response}; -use crate::params::{Expand, Object}; - -/// The resource representing a Stripe "TerminalConnectionToken". -/// -/// For more details see -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct TerminalConnectionToken { - /// The id of the location that this connection token is scoped to. - /// - /// Note that location scoping only applies to internet-connected readers. - /// For more details, see [the docs on scoping connection tokens](https://stripe.com/docs/terminal/fleet/locations#connection-tokens). - #[serde(skip_serializing_if = "Option::is_none")] - pub location: Option, - - /// Your application should pass this token to the Stripe Terminal SDK. - pub secret: String, -} - -impl TerminalConnectionToken { - /// To connect to a reader the Stripe Terminal SDK needs to retrieve a short-lived connection token from Stripe, proxied through your server. - /// - /// On your backend, add an endpoint that creates and returns a connection token. - pub fn create( - client: &Client, - params: CreateTerminalConnectionToken<'_>, - ) -> Response { - client.post_form("/terminal/connection_tokens", ¶ms) - } -} - -impl Object for TerminalConnectionToken { - type Id = (); - fn id(&self) -> Self::Id {} - fn object(&self) -> &'static str { - "terminal.connection_token" - } -} - -/// The parameters for `TerminalConnectionToken::create`. -#[derive(Clone, Debug, Serialize, Default)] -pub struct CreateTerminalConnectionToken<'a> { - /// Specifies which fields in the response should be expanded. - #[serde(skip_serializing_if = "Expand::is_empty")] - pub expand: &'a [&'a str], - - /// The id of the location that this connection token is scoped to. - /// - /// If specified the connection token will only be usable with readers assigned to that location, otherwise the connection token will be usable with all readers. - /// Note that location scoping only applies to internet-connected readers. - /// For more details, see [the docs on scoping connection tokens](https://stripe.com/docs/terminal/fleet/locations#connection-tokens). - #[serde(skip_serializing_if = "Option::is_none")] - pub location: Option<&'a str>, -} - -impl<'a> CreateTerminalConnectionToken<'a> { - pub fn new() -> Self { - CreateTerminalConnectionToken { expand: Default::default(), location: Default::default() } - } -} diff --git a/src/resources/generated/terminal_location.rs b/src/resources/generated/terminal_location.rs deleted file mode 100644 index e8c28dd23..000000000 --- a/src/resources/generated/terminal_location.rs +++ /dev/null @@ -1,181 +0,0 @@ -// ====================================== -// This file was automatically generated. -// ====================================== - -use serde::{Deserialize, Serialize}; - -use crate::client::{Client, Response}; -use crate::ids::TerminalLocationId; -use crate::params::{Expand, List, Metadata, Object, Paginable}; -use crate::resources::Address; - -/// The resource representing a Stripe "TerminalLocationLocation". -/// -/// For more details see -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct TerminalLocation { - /// Unique identifier for the object. - pub id: TerminalLocationId, - - #[serde(skip_serializing_if = "Option::is_none")] - pub address: Option
, - - /// The ID of a configuration that will be used to customize all readers in this location. - #[serde(skip_serializing_if = "Option::is_none")] - pub configuration_overrides: Option, - - // Always true for a deleted object - #[serde(default)] - pub deleted: bool, - - /// The display name of the location. - #[serde(skip_serializing_if = "Option::is_none")] - pub display_name: Option, - - /// Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. - #[serde(skip_serializing_if = "Option::is_none")] - pub livemode: Option, - - /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. - /// - /// This can be useful for storing additional information about the object in a structured format. - #[serde(skip_serializing_if = "Option::is_none")] - pub metadata: Option, -} - -impl TerminalLocation { - /// Returns a list of `Location` objects. - pub fn list( - client: &Client, - params: &ListTerminalLocations<'_>, - ) -> Response> { - client.get_query("/terminal/locations", ¶ms) - } - - /// Creates a new `Location` object. - /// For further details, including which address fields are required in each country, see the [Manage locations](https://stripe.com/docs/terminal/fleet/locations) guide. - pub fn create( - client: &Client, - params: CreateTerminalLocation<'_>, - ) -> Response { - client.post_form("/terminal/locations", ¶ms) - } -} - -impl Object for TerminalLocation { - type Id = TerminalLocationId; - fn id(&self) -> Self::Id { - self.id.clone() - } - fn object(&self) -> &'static str { - "terminal.location" - } -} - -/// The parameters for `TerminalLocation::create`. -#[derive(Clone, Debug, Serialize)] -pub struct CreateTerminalLocation<'a> { - /// The full address of the location. - pub address: CreateTerminalLocationAddress, - - /// The ID of a configuration that will be used to customize all readers in this location. - #[serde(skip_serializing_if = "Option::is_none")] - pub configuration_overrides: Option<&'a str>, - - /// A name for the location. - pub display_name: &'a str, - - /// Specifies which fields in the response should be expanded. - #[serde(skip_serializing_if = "Expand::is_empty")] - pub expand: &'a [&'a str], - - /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. - /// - /// This can be useful for storing additional information about the object in a structured format. - /// Individual keys can be unset by posting an empty value to them. - /// All keys can be unset by posting an empty value to `metadata`. - #[serde(skip_serializing_if = "Option::is_none")] - pub metadata: Option, -} - -impl<'a> CreateTerminalLocation<'a> { - pub fn new(address: CreateTerminalLocationAddress, display_name: &'a str) -> Self { - CreateTerminalLocation { - address, - configuration_overrides: Default::default(), - display_name, - expand: Default::default(), - metadata: Default::default(), - } - } -} - -/// The parameters for `TerminalLocation::list`. -#[derive(Clone, Debug, Serialize, Default)] -pub struct ListTerminalLocations<'a> { - /// A cursor for use in pagination. - /// - /// `ending_before` is an object ID that defines your place in the list. - /// For instance, if you make a list request and receive 100 objects, starting with `obj_bar`, your subsequent call can include `ending_before=obj_bar` in order to fetch the previous page of the list. - #[serde(skip_serializing_if = "Option::is_none")] - pub ending_before: Option, - - /// Specifies which fields in the response should be expanded. - #[serde(skip_serializing_if = "Expand::is_empty")] - pub expand: &'a [&'a str], - - /// A limit on the number of objects to be returned. - /// - /// Limit can range between 1 and 100, and the default is 10. - #[serde(skip_serializing_if = "Option::is_none")] - pub limit: Option, - - /// A cursor for use in pagination. - /// - /// `starting_after` is an object ID that defines your place in the list. - /// For instance, if you make a list request and receive 100 objects, ending with `obj_foo`, your subsequent call can include `starting_after=obj_foo` in order to fetch the next page of the list. - #[serde(skip_serializing_if = "Option::is_none")] - pub starting_after: Option, -} - -impl<'a> ListTerminalLocations<'a> { - pub fn new() -> Self { - ListTerminalLocations { - ending_before: Default::default(), - expand: Default::default(), - limit: Default::default(), - starting_after: Default::default(), - } - } -} -impl Paginable for ListTerminalLocations<'_> { - type O = TerminalLocation; - fn set_last(&mut self, item: Self::O) { - self.starting_after = Some(item.id()); - } -} -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreateTerminalLocationAddress { - /// City, district, suburb, town, or village. - #[serde(skip_serializing_if = "Option::is_none")] - pub city: Option, - - /// Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). - pub country: String, - - /// Address line 1 (e.g., street, PO Box, or company name). - #[serde(skip_serializing_if = "Option::is_none")] - pub line1: Option, - - /// Address line 2 (e.g., apartment, suite, unit, or building). - #[serde(skip_serializing_if = "Option::is_none")] - pub line2: Option, - - /// ZIP or postal code. - #[serde(skip_serializing_if = "Option::is_none")] - pub postal_code: Option, - - /// State, county, province, or region. - #[serde(skip_serializing_if = "Option::is_none")] - pub state: Option, -} diff --git a/src/resources/generated/terminal_reader.rs b/src/resources/generated/terminal_reader.rs deleted file mode 100644 index c3454ca8c..000000000 --- a/src/resources/generated/terminal_reader.rs +++ /dev/null @@ -1,583 +0,0 @@ -// ====================================== -// This file was automatically generated. -// ====================================== - -use serde::{Deserialize, Serialize}; - -use crate::client::{Client, Response}; -use crate::ids::TerminalReaderId; -use crate::params::{Expand, Expandable, List, Metadata, Object, Paginable}; -use crate::resources::{Charge, Currency, PaymentIntent, Refund, SetupIntent, TerminalLocation}; - -/// The resource representing a Stripe "TerminalReaderReader". -/// -/// For more details see -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct TerminalReader { - /// Unique identifier for the object. - pub id: TerminalReaderId, - - /// The most recent action performed by the reader. - #[serde(skip_serializing_if = "Option::is_none")] - pub action: Option, - - // Always true for a deleted object - #[serde(default)] - pub deleted: bool, - - /// The current software version of the reader. - #[serde(skip_serializing_if = "Option::is_none")] - pub device_sw_version: Option, - - /// Type of reader, one of `bbpos_wisepad3`, `stripe_m2`, `bbpos_chipper2x`, `bbpos_wisepos_e`, `verifone_P400`, or `simulated_wisepos_e`. - #[serde(skip_serializing_if = "Option::is_none")] - pub device_type: Option, - - /// The local IP address of the reader. - #[serde(skip_serializing_if = "Option::is_none")] - pub ip_address: Option, - - /// Custom label given to the reader for easier identification. - #[serde(skip_serializing_if = "Option::is_none")] - pub label: Option, - - /// Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. - #[serde(skip_serializing_if = "Option::is_none")] - pub livemode: Option, - - /// The location identifier of the reader. - #[serde(skip_serializing_if = "Option::is_none")] - pub location: Option>, - - /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. - /// - /// This can be useful for storing additional information about the object in a structured format. - #[serde(skip_serializing_if = "Option::is_none")] - pub metadata: Option, - - /// Serial number of the reader. - #[serde(skip_serializing_if = "Option::is_none")] - pub serial_number: Option, - - /// The networking status of the reader. - #[serde(skip_serializing_if = "Option::is_none")] - pub status: Option, -} - -impl TerminalReader { - /// Returns a list of `Reader` objects. - pub fn list( - client: &Client, - params: &ListTerminalReaders<'_>, - ) -> Response> { - client.get_query("/terminal/readers", ¶ms) - } - - /// Creates a new `Reader` object. - pub fn create(client: &Client, params: CreateTerminalReader<'_>) -> Response { - client.post_form("/terminal/readers", ¶ms) - } -} - -impl Object for TerminalReader { - type Id = TerminalReaderId; - fn id(&self) -> Self::Id { - self.id.clone() - } - fn object(&self) -> &'static str { - "terminal.reader" - } -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct TerminalReaderReaderResourceReaderAction { - /// Failure code, only set if status is `failed`. - pub failure_code: Option, - - /// Detailed failure message, only set if status is `failed`. - pub failure_message: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub process_payment_intent: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub process_setup_intent: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub refund_payment: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub set_reader_display: Option, - - /// Status of the action performed by the reader. - pub status: TerminalReaderReaderResourceReaderActionStatus, - - /// Type of action performed by the reader. - #[serde(rename = "type")] - pub type_: TerminalReaderReaderResourceReaderActionType, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct TerminalReaderReaderResourceProcessPaymentIntentAction { - /// Most recent PaymentIntent processed by the reader. - pub payment_intent: Expandable, - - #[serde(skip_serializing_if = "Option::is_none")] - pub process_config: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct TerminalReaderReaderResourceProcessConfig { - /// Override showing a tipping selection screen on this transaction. - #[serde(skip_serializing_if = "Option::is_none")] - pub skip_tipping: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub tipping: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct TerminalReaderReaderResourceProcessSetupIntentAction { - /// ID of a card PaymentMethod generated from the card_present PaymentMethod that may be attached to a Customer for future transactions. - /// - /// Only present if it was possible to generate a card PaymentMethod. - #[serde(skip_serializing_if = "Option::is_none")] - pub generated_card: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub process_config: Option, - - /// Most recent SetupIntent processed by the reader. - pub setup_intent: Expandable, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct TerminalReaderReaderResourceProcessSetupConfig {} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct TerminalReaderReaderResourceRefundPaymentAction { - /// The amount being refunded. - #[serde(skip_serializing_if = "Option::is_none")] - pub amount: Option, - - /// Charge that is being refunded. - #[serde(skip_serializing_if = "Option::is_none")] - pub charge: Option>, - - /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. - /// - /// This can be useful for storing additional information about the object in a structured format. - #[serde(skip_serializing_if = "Option::is_none")] - pub metadata: Option, - - /// Payment intent that is being refunded. - #[serde(skip_serializing_if = "Option::is_none")] - pub payment_intent: Option>, - - /// The reason for the refund. - #[serde(skip_serializing_if = "Option::is_none")] - pub reason: Option, - - /// Unique identifier for the refund object. - #[serde(skip_serializing_if = "Option::is_none")] - pub refund: Option>, - - /// Boolean indicating whether the application fee should be refunded when refunding this charge. - /// - /// If a full charge refund is given, the full application fee will be refunded. - /// Otherwise, the application fee will be refunded in an amount proportional to the amount of the charge refunded. - /// An application fee can be refunded only by the application that created the charge. - #[serde(skip_serializing_if = "Option::is_none")] - pub refund_application_fee: Option, - - /// Boolean indicating whether the transfer should be reversed when refunding this charge. - /// - /// The transfer will be reversed proportionally to the amount being refunded (either the entire or partial amount). - /// A transfer can be reversed only by the application that created the charge. - #[serde(skip_serializing_if = "Option::is_none")] - pub reverse_transfer: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct TerminalReaderReaderResourceSetReaderDisplayAction { - /// Cart object to be displayed by the reader. - pub cart: Option, - - /// Type of information to be displayed by the reader. - #[serde(rename = "type")] - pub type_: TerminalReaderReaderResourceSetReaderDisplayActionType, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct TerminalReaderReaderResourceCart { - /// Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. - /// - /// Must be a [supported currency](https://stripe.com/docs/currencies). - pub currency: Currency, - - /// List of line items in the cart. - pub line_items: Vec, - - /// Tax amount for the entire cart. - /// - /// A positive integer in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal). - pub tax: Option, - - /// Total amount for the entire cart, including tax. - /// - /// A positive integer in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal). - pub total: i64, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct TerminalReaderReaderResourceLineItem { - /// The amount of the line item. - /// - /// A positive integer in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal). - pub amount: i64, - - /// Description of the line item. - pub description: String, - - /// The quantity of the line item. - pub quantity: u64, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct TerminalReaderReaderResourceTippingConfig { - /// Amount used to calculate tip suggestions on tipping selection screen for this transaction. - /// - /// Must be a positive integer in the smallest currency unit (e.g., 100 cents to represent $1.00 or 100 to represent ¥100, a zero-decimal currency). - #[serde(skip_serializing_if = "Option::is_none")] - pub amount_eligible: Option, -} - -/// The parameters for `TerminalReader::create`. -#[derive(Clone, Debug, Serialize)] -pub struct CreateTerminalReader<'a> { - /// Specifies which fields in the response should be expanded. - #[serde(skip_serializing_if = "Expand::is_empty")] - pub expand: &'a [&'a str], - - /// Custom label given to the reader for easier identification. - /// - /// If no label is specified, the registration code will be used. - #[serde(skip_serializing_if = "Option::is_none")] - pub label: Option<&'a str>, - - /// The location to assign the reader to. - #[serde(skip_serializing_if = "Option::is_none")] - pub location: Option<&'a str>, - - /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. - /// - /// This can be useful for storing additional information about the object in a structured format. - /// Individual keys can be unset by posting an empty value to them. - /// All keys can be unset by posting an empty value to `metadata`. - #[serde(skip_serializing_if = "Option::is_none")] - pub metadata: Option, - - /// A code generated by the reader used for registering to an account. - pub registration_code: &'a str, -} - -impl<'a> CreateTerminalReader<'a> { - pub fn new(registration_code: &'a str) -> Self { - CreateTerminalReader { - expand: Default::default(), - label: Default::default(), - location: Default::default(), - metadata: Default::default(), - registration_code, - } - } -} - -/// The parameters for `TerminalReader::list`. -#[derive(Clone, Debug, Serialize, Default)] -pub struct ListTerminalReaders<'a> { - /// Filters readers by device type. - #[serde(skip_serializing_if = "Option::is_none")] - pub device_type: Option, - - /// A cursor for use in pagination. - /// - /// `ending_before` is an object ID that defines your place in the list. - /// For instance, if you make a list request and receive 100 objects, starting with `obj_bar`, your subsequent call can include `ending_before=obj_bar` in order to fetch the previous page of the list. - #[serde(skip_serializing_if = "Option::is_none")] - pub ending_before: Option, - - /// Specifies which fields in the response should be expanded. - #[serde(skip_serializing_if = "Expand::is_empty")] - pub expand: &'a [&'a str], - - /// A limit on the number of objects to be returned. - /// - /// Limit can range between 1 and 100, and the default is 10. - #[serde(skip_serializing_if = "Option::is_none")] - pub limit: Option, - - /// A location ID to filter the response list to only readers at the specific location. - #[serde(skip_serializing_if = "Option::is_none")] - pub location: Option<&'a str>, - - /// Filters readers by serial number. - #[serde(skip_serializing_if = "Option::is_none")] - pub serial_number: Option<&'a str>, - - /// A cursor for use in pagination. - /// - /// `starting_after` is an object ID that defines your place in the list. - /// For instance, if you make a list request and receive 100 objects, ending with `obj_foo`, your subsequent call can include `starting_after=obj_foo` in order to fetch the next page of the list. - #[serde(skip_serializing_if = "Option::is_none")] - pub starting_after: Option, - - /// A status filter to filter readers to only offline or online readers. - #[serde(skip_serializing_if = "Option::is_none")] - pub status: Option, -} - -impl<'a> ListTerminalReaders<'a> { - pub fn new() -> Self { - ListTerminalReaders { - device_type: Default::default(), - ending_before: Default::default(), - expand: Default::default(), - limit: Default::default(), - location: Default::default(), - serial_number: Default::default(), - starting_after: Default::default(), - status: Default::default(), - } - } -} -impl Paginable for ListTerminalReaders<'_> { - type O = TerminalReader; - fn set_last(&mut self, item: Self::O) { - self.starting_after = Some(item.id()); - } -} -/// An enum representing the possible values of an `TerminalReader`'s `device_type` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum TerminalReaderDeviceType { - BbposChipper2x, - BbposWisepad3, - BbposWiseposE, - SimulatedWiseposE, - StripeM2, - #[serde(rename = "verifone_P400")] - VerifoneP400, -} - -impl TerminalReaderDeviceType { - pub fn as_str(self) -> &'static str { - match self { - TerminalReaderDeviceType::BbposChipper2x => "bbpos_chipper2x", - TerminalReaderDeviceType::BbposWisepad3 => "bbpos_wisepad3", - TerminalReaderDeviceType::BbposWiseposE => "bbpos_wisepos_e", - TerminalReaderDeviceType::SimulatedWiseposE => "simulated_wisepos_e", - TerminalReaderDeviceType::StripeM2 => "stripe_m2", - TerminalReaderDeviceType::VerifoneP400 => "verifone_P400", - } - } -} - -impl AsRef for TerminalReaderDeviceType { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for TerminalReaderDeviceType { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for TerminalReaderDeviceType { - fn default() -> Self { - Self::BbposChipper2x - } -} - -/// An enum representing the possible values of an `TerminalReaderReaderResourceReaderAction`'s `status` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum TerminalReaderReaderResourceReaderActionStatus { - Failed, - InProgress, - Succeeded, -} - -impl TerminalReaderReaderResourceReaderActionStatus { - pub fn as_str(self) -> &'static str { - match self { - TerminalReaderReaderResourceReaderActionStatus::Failed => "failed", - TerminalReaderReaderResourceReaderActionStatus::InProgress => "in_progress", - TerminalReaderReaderResourceReaderActionStatus::Succeeded => "succeeded", - } - } -} - -impl AsRef for TerminalReaderReaderResourceReaderActionStatus { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for TerminalReaderReaderResourceReaderActionStatus { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for TerminalReaderReaderResourceReaderActionStatus { - fn default() -> Self { - Self::Failed - } -} - -/// An enum representing the possible values of an `TerminalReaderReaderResourceReaderAction`'s `type` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum TerminalReaderReaderResourceReaderActionType { - ProcessPaymentIntent, - ProcessSetupIntent, - RefundPayment, - SetReaderDisplay, -} - -impl TerminalReaderReaderResourceReaderActionType { - pub fn as_str(self) -> &'static str { - match self { - TerminalReaderReaderResourceReaderActionType::ProcessPaymentIntent => { - "process_payment_intent" - } - TerminalReaderReaderResourceReaderActionType::ProcessSetupIntent => { - "process_setup_intent" - } - TerminalReaderReaderResourceReaderActionType::RefundPayment => "refund_payment", - TerminalReaderReaderResourceReaderActionType::SetReaderDisplay => "set_reader_display", - } - } -} - -impl AsRef for TerminalReaderReaderResourceReaderActionType { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for TerminalReaderReaderResourceReaderActionType { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for TerminalReaderReaderResourceReaderActionType { - fn default() -> Self { - Self::ProcessPaymentIntent - } -} - -/// An enum representing the possible values of an `TerminalReaderReaderResourceRefundPaymentAction`'s `reason` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum TerminalReaderReaderResourceRefundPaymentActionReason { - Duplicate, - Fraudulent, - RequestedByCustomer, -} - -impl TerminalReaderReaderResourceRefundPaymentActionReason { - pub fn as_str(self) -> &'static str { - match self { - TerminalReaderReaderResourceRefundPaymentActionReason::Duplicate => "duplicate", - TerminalReaderReaderResourceRefundPaymentActionReason::Fraudulent => "fraudulent", - TerminalReaderReaderResourceRefundPaymentActionReason::RequestedByCustomer => { - "requested_by_customer" - } - } - } -} - -impl AsRef for TerminalReaderReaderResourceRefundPaymentActionReason { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for TerminalReaderReaderResourceRefundPaymentActionReason { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for TerminalReaderReaderResourceRefundPaymentActionReason { - fn default() -> Self { - Self::Duplicate - } -} - -/// An enum representing the possible values of an `TerminalReaderReaderResourceSetReaderDisplayAction`'s `type` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum TerminalReaderReaderResourceSetReaderDisplayActionType { - Cart, -} - -impl TerminalReaderReaderResourceSetReaderDisplayActionType { - pub fn as_str(self) -> &'static str { - match self { - TerminalReaderReaderResourceSetReaderDisplayActionType::Cart => "cart", - } - } -} - -impl AsRef for TerminalReaderReaderResourceSetReaderDisplayActionType { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for TerminalReaderReaderResourceSetReaderDisplayActionType { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for TerminalReaderReaderResourceSetReaderDisplayActionType { - fn default() -> Self { - Self::Cart - } -} - -/// An enum representing the possible values of an `TerminalReader`'s `status` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum TerminalReaderStatus { - Offline, - Online, -} - -impl TerminalReaderStatus { - pub fn as_str(self) -> &'static str { - match self { - TerminalReaderStatus::Offline => "offline", - TerminalReaderStatus::Online => "online", - } - } -} - -impl AsRef for TerminalReaderStatus { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for TerminalReaderStatus { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for TerminalReaderStatus { - fn default() -> Self { - Self::Offline - } -} diff --git a/src/resources/generated/terminal_reader_action_failed.rs b/src/resources/generated/terminal_reader_action_failed.rs deleted file mode 100644 index 4d14fed20..000000000 --- a/src/resources/generated/terminal_reader_action_failed.rs +++ /dev/null @@ -1,10 +0,0 @@ -// ====================================== -// This file was automatically generated. -// ====================================== - -use serde::{Deserialize, Serialize}; - -/// The resource representing a Stripe "terminal.reader.action_failed". -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct TerminalReaderActionFailed { -} diff --git a/src/resources/generated/terminal_reader_action_succeeded.rs b/src/resources/generated/terminal_reader_action_succeeded.rs deleted file mode 100644 index 58a1d6fcf..000000000 --- a/src/resources/generated/terminal_reader_action_succeeded.rs +++ /dev/null @@ -1,10 +0,0 @@ -// ====================================== -// This file was automatically generated. -// ====================================== - -use serde::{Deserialize, Serialize}; - -/// The resource representing a Stripe "terminal.reader.action_succeeded". -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct TerminalReaderActionSucceeded { -} diff --git a/src/resources/generated/test_helpers_test_clock.rs b/src/resources/generated/test_helpers_test_clock.rs deleted file mode 100644 index da2f8bbf6..000000000 --- a/src/resources/generated/test_helpers_test_clock.rs +++ /dev/null @@ -1,91 +0,0 @@ -// ====================================== -// This file was automatically generated. -// ====================================== - -use serde::{Deserialize, Serialize}; - -use crate::ids::TestHelpersTestClockId; -use crate::params::{Object, Timestamp}; - -/// The resource representing a Stripe "TestClock". -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct TestHelpersTestClock { - /// Unique identifier for the object. - pub id: TestHelpersTestClockId, - - /// Time at which the object was created. - /// - /// Measured in seconds since the Unix epoch. - #[serde(skip_serializing_if = "Option::is_none")] - pub created: Option, - - // Always true for a deleted object - #[serde(default)] - pub deleted: bool, - - /// Time at which this clock is scheduled to auto delete. - #[serde(skip_serializing_if = "Option::is_none")] - pub deletes_after: Option, - - /// Time at which all objects belonging to this clock are frozen. - #[serde(skip_serializing_if = "Option::is_none")] - pub frozen_time: Option, - - /// Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. - #[serde(skip_serializing_if = "Option::is_none")] - pub livemode: Option, - - /// The custom name supplied at creation. - #[serde(skip_serializing_if = "Option::is_none")] - pub name: Option, - - /// The status of the Test Clock. - #[serde(skip_serializing_if = "Option::is_none")] - pub status: Option, -} - -impl Object for TestHelpersTestClock { - type Id = TestHelpersTestClockId; - fn id(&self) -> Self::Id { - self.id.clone() - } - fn object(&self) -> &'static str { - "test_helpers.test_clock" - } -} - -/// An enum representing the possible values of an `TestHelpersTestClock`'s `status` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum TestHelpersTestClockStatus { - Advancing, - InternalFailure, - Ready, -} - -impl TestHelpersTestClockStatus { - pub fn as_str(self) -> &'static str { - match self { - TestHelpersTestClockStatus::Advancing => "advancing", - TestHelpersTestClockStatus::InternalFailure => "internal_failure", - TestHelpersTestClockStatus::Ready => "ready", - } - } -} - -impl AsRef for TestHelpersTestClockStatus { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for TestHelpersTestClockStatus { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for TestHelpersTestClockStatus { - fn default() -> Self { - Self::Advancing - } -} diff --git a/src/resources/generated/test_helpers_test_clock_advancing.rs b/src/resources/generated/test_helpers_test_clock_advancing.rs deleted file mode 100644 index 237f564d9..000000000 --- a/src/resources/generated/test_helpers_test_clock_advancing.rs +++ /dev/null @@ -1,10 +0,0 @@ -// ====================================== -// This file was automatically generated. -// ====================================== - -use serde::{Deserialize, Serialize}; - -/// The resource representing a Stripe "test_helpers.test_clock.advancing". -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct TestHelpersTestClockAdvancing { -} diff --git a/src/resources/generated/test_helpers_test_clock_created.rs b/src/resources/generated/test_helpers_test_clock_created.rs deleted file mode 100644 index 0d2ba74d7..000000000 --- a/src/resources/generated/test_helpers_test_clock_created.rs +++ /dev/null @@ -1,10 +0,0 @@ -// ====================================== -// This file was automatically generated. -// ====================================== - -use serde::{Deserialize, Serialize}; - -/// The resource representing a Stripe "test_helpers.test_clock.created". -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct TestHelpersTestClockCreated { -} diff --git a/src/resources/generated/test_helpers_test_clock_deleted.rs b/src/resources/generated/test_helpers_test_clock_deleted.rs deleted file mode 100644 index bdd7157f9..000000000 --- a/src/resources/generated/test_helpers_test_clock_deleted.rs +++ /dev/null @@ -1,10 +0,0 @@ -// ====================================== -// This file was automatically generated. -// ====================================== - -use serde::{Deserialize, Serialize}; - -/// The resource representing a Stripe "test_helpers.test_clock.deleted". -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct TestHelpersTestClockDeleted { -} diff --git a/src/resources/generated/test_helpers_test_clock_internal_failure.rs b/src/resources/generated/test_helpers_test_clock_internal_failure.rs deleted file mode 100644 index f328e69c8..000000000 --- a/src/resources/generated/test_helpers_test_clock_internal_failure.rs +++ /dev/null @@ -1,10 +0,0 @@ -// ====================================== -// This file was automatically generated. -// ====================================== - -use serde::{Deserialize, Serialize}; - -/// The resource representing a Stripe "test_helpers.test_clock.internal_failure". -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct TestHelpersTestClockInternalFailure { -} diff --git a/src/resources/generated/test_helpers_test_clock_ready.rs b/src/resources/generated/test_helpers_test_clock_ready.rs deleted file mode 100644 index 1f23d2ff4..000000000 --- a/src/resources/generated/test_helpers_test_clock_ready.rs +++ /dev/null @@ -1,10 +0,0 @@ -// ====================================== -// This file was automatically generated. -// ====================================== - -use serde::{Deserialize, Serialize}; - -/// The resource representing a Stripe "test_helpers.test_clock.ready". -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct TestHelpersTestClockReady { -} diff --git a/src/resources/generated/token.rs b/src/resources/generated/token.rs deleted file mode 100644 index fd6001383..000000000 --- a/src/resources/generated/token.rs +++ /dev/null @@ -1,526 +0,0 @@ -// ====================================== -// This file was automatically generated. -// ====================================== - -use serde::{Deserialize, Serialize}; - -use crate::client::{Client, Response}; -use crate::ids::{CustomerId, TokenId}; -use crate::params::{Expand, Metadata, Object, Timestamp}; -use crate::resources::{Address, BankAccount, Card, CompanyParams, PersonParams, TokenType}; - -/// The resource representing a Stripe "Token". -/// -/// For more details see -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct Token { - /// Unique identifier for the object. - pub id: TokenId, - - #[serde(skip_serializing_if = "Option::is_none")] - pub bank_account: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub card: Option, - - /// IP address of the client that generates the token. - pub client_ip: Option, - - /// Time at which the object was created. - /// - /// Measured in seconds since the Unix epoch. - pub created: Timestamp, - - /// Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. - pub livemode: bool, - - /// Type of the token: `account`, `bank_account`, `card`, or `pii`. - #[serde(rename = "type")] - pub type_: TokenType, - - /// Determines if you have already used this token (you can only use tokens once). - pub used: bool, -} - -impl Token { - /// Creates a single-use token that represents a bank account’s details. - /// You can use this token with any API method in place of a bank account dictionary. - /// - /// You can only use this token once. - /// To do so, attach it to a [Custom account](https://stripe.com/docs/api#accounts). - pub fn create(client: &Client, params: CreateToken<'_>) -> Response { - client.post_form("/tokens", ¶ms) - } - - /// Retrieves the token with the given ID. - pub fn retrieve(client: &Client, id: &TokenId, expand: &[&str]) -> Response { - client.get_query(&format!("/tokens/{}", id), &Expand { expand }) - } -} - -impl Object for Token { - type Id = TokenId; - fn id(&self) -> Self::Id { - self.id.clone() - } - fn object(&self) -> &'static str { - "token" - } -} - -/// The parameters for `Token::create`. -#[derive(Clone, Debug, Serialize, Default)] -pub struct CreateToken<'a> { - /// Information for the account this token represents. - #[serde(skip_serializing_if = "Option::is_none")] - pub account: Option, - - /// The card this token will represent. - /// - /// If you also pass in a customer, the card must be the ID of a card belonging to the customer. - /// Otherwise, if you do not pass in a customer, this is a dictionary containing a user's credit card details, with the options described below. - #[serde(skip_serializing_if = "Option::is_none")] - pub card: Option, - - /// Create a token for the customer, which is owned by the application's account. - /// - /// You can only use this with an [OAuth access token](https://stripe.com/docs/connect/standard-accounts) or [Stripe-Account header](https://stripe.com/docs/connect/authentication). - /// Learn more about [cloning saved payment methods](https://stripe.com/docs/connect/cloning-saved-payment-methods). - #[serde(skip_serializing_if = "Option::is_none")] - pub customer: Option, - - /// The updated CVC value this token represents. - #[serde(skip_serializing_if = "Option::is_none")] - pub cvc_update: Option, - - /// Specifies which fields in the response should be expanded. - #[serde(skip_serializing_if = "Expand::is_empty")] - pub expand: &'a [&'a str], - - /// Information for the person this token represents. - #[serde(skip_serializing_if = "Option::is_none")] - pub person: Option, - - /// The PII this token represents. - #[serde(skip_serializing_if = "Option::is_none")] - pub pii: Option, -} - -impl<'a> CreateToken<'a> { - pub fn new() -> Self { - CreateToken { - account: Default::default(), - card: Default::default(), - customer: Default::default(), - cvc_update: Default::default(), - expand: Default::default(), - person: Default::default(), - pii: Default::default(), - } - } -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreateTokenAccount { - /// The business type. - #[serde(skip_serializing_if = "Option::is_none")] - pub business_type: Option, - - /// Information about the company or business. - #[serde(skip_serializing_if = "Option::is_none")] - pub company: Option, - - /// Information about the person represented by the account. - #[serde(skip_serializing_if = "Option::is_none")] - pub individual: Option, - - /// Whether the user described by the data in the token has been shown [the Stripe Connected Account Agreement](https://stripe.com/docs/connect/account-tokens#stripe-connected-account-agreement). - /// - /// When creating an account token to create a new Connect account, this value must be `true`. - #[serde(skip_serializing_if = "Option::is_none")] - pub tos_shown_and_accepted: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreateTokenCvcUpdate { - /// The CVC value, in string form. - pub cvc: String, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreateTokenPerson { - /// Details on the legal guardian's acceptance of the required Stripe agreements. - #[serde(skip_serializing_if = "Option::is_none")] - pub additional_tos_acceptances: Option, - - /// The person's address. - #[serde(skip_serializing_if = "Option::is_none")] - pub address: Option
, - - /// The Kana variation of the person's address (Japan only). - #[serde(skip_serializing_if = "Option::is_none")] - pub address_kana: Option
, - - /// The Kanji variation of the person's address (Japan only). - #[serde(skip_serializing_if = "Option::is_none")] - pub address_kanji: Option
, - - /// The person's date of birth. - #[serde(skip_serializing_if = "Option::is_none")] - pub dob: Option, - - /// Documents that may be submitted to satisfy various informational requests. - #[serde(skip_serializing_if = "Option::is_none")] - pub documents: Option, - - /// The person's email address. - #[serde(skip_serializing_if = "Option::is_none")] - pub email: Option, - - /// The person's first name. - #[serde(skip_serializing_if = "Option::is_none")] - pub first_name: Option, - - /// The Kana variation of the person's first name (Japan only). - #[serde(skip_serializing_if = "Option::is_none")] - pub first_name_kana: Option, - - /// The Kanji variation of the person's first name (Japan only). - #[serde(skip_serializing_if = "Option::is_none")] - pub first_name_kanji: Option, - - /// A list of alternate names or aliases that the person is known by. - #[serde(skip_serializing_if = "Option::is_none")] - pub full_name_aliases: Option>, - - /// The person's gender (International regulations require either "male" or "female"). - #[serde(skip_serializing_if = "Option::is_none")] - pub gender: Option, - - /// The person's ID number, as appropriate for their country. - /// - /// For example, a social security number in the U.S., social insurance number in Canada, etc. - /// Instead of the number itself, you can also provide a [PII token provided by Stripe.js](https://stripe.com/docs/js/tokens/create_token?type=pii). - #[serde(skip_serializing_if = "Option::is_none")] - pub id_number: Option, - - /// The person's secondary ID number, as appropriate for their country, will be used for enhanced verification checks. - /// - /// In Thailand, this would be the laser code found on the back of an ID card. - /// Instead of the number itself, you can also provide a [PII token provided by Stripe.js](https://stripe.com/docs/js/tokens/create_token?type=pii). - #[serde(skip_serializing_if = "Option::is_none")] - pub id_number_secondary: Option, - - /// The person's last name. - #[serde(skip_serializing_if = "Option::is_none")] - pub last_name: Option, - - /// The Kana variation of the person's last name (Japan only). - #[serde(skip_serializing_if = "Option::is_none")] - pub last_name_kana: Option, - - /// The Kanji variation of the person's last name (Japan only). - #[serde(skip_serializing_if = "Option::is_none")] - pub last_name_kanji: Option, - - /// The person's maiden name. - #[serde(skip_serializing_if = "Option::is_none")] - pub maiden_name: Option, - - /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. - /// - /// This can be useful for storing additional information about the object in a structured format. - /// Individual keys can be unset by posting an empty value to them. - /// All keys can be unset by posting an empty value to `metadata`. - #[serde(skip_serializing_if = "Option::is_none")] - pub metadata: Option, - - /// The country where the person is a national. - /// - /// Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)), or "XX" if unavailable. - #[serde(skip_serializing_if = "Option::is_none")] - pub nationality: Option, - - /// The person's phone number. - #[serde(skip_serializing_if = "Option::is_none")] - pub phone: Option, - - /// Indicates if the person or any of their representatives, family members, or other closely related persons, declares that they hold or have held an important public job or function, in any jurisdiction. - #[serde(skip_serializing_if = "Option::is_none")] - pub political_exposure: Option, - - /// The person's registered address. - #[serde(skip_serializing_if = "Option::is_none")] - pub registered_address: Option, - - /// The relationship that this person has with the account's legal entity. - #[serde(skip_serializing_if = "Option::is_none")] - pub relationship: Option, - - /// The last four digits of the person's Social Security number (U.S. - /// - /// only). - #[serde(skip_serializing_if = "Option::is_none")] - pub ssn_last_4: Option, - - /// The person's verification status. - #[serde(skip_serializing_if = "Option::is_none")] - pub verification: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreateTokenPii { - /// The `id_number` for the PII, in string form. - #[serde(skip_serializing_if = "Option::is_none")] - pub id_number: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreateTokenPersonAdditionalTosAcceptances { - /// Details on the legal guardian's acceptance of the main Stripe service agreement. - #[serde(skip_serializing_if = "Option::is_none")] - pub account: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreateTokenPersonDob { - /// The day of birth, between 1 and 31. - pub day: i64, - - /// The month of birth, between 1 and 12. - pub month: i64, - - /// The four-digit year of birth. - pub year: i64, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreateTokenPersonDocuments { - /// One or more documents that demonstrate proof that this person is authorized to represent the company. - #[serde(skip_serializing_if = "Option::is_none")] - pub company_authorization: Option, - - /// One or more documents showing the person's passport page with photo and personal data. - #[serde(skip_serializing_if = "Option::is_none")] - pub passport: Option, - - /// One or more documents showing the person's visa required for living in the country where they are residing. - #[serde(skip_serializing_if = "Option::is_none")] - pub visa: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreateTokenPersonRegisteredAddress { - /// City, district, suburb, town, or village. - #[serde(skip_serializing_if = "Option::is_none")] - pub city: Option, - - /// Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). - #[serde(skip_serializing_if = "Option::is_none")] - pub country: Option, - - /// Address line 1 (e.g., street, PO Box, or company name). - #[serde(skip_serializing_if = "Option::is_none")] - pub line1: Option, - - /// Address line 2 (e.g., apartment, suite, unit, or building). - #[serde(skip_serializing_if = "Option::is_none")] - pub line2: Option, - - /// ZIP or postal code. - #[serde(skip_serializing_if = "Option::is_none")] - pub postal_code: Option, - - /// State, county, province, or region. - #[serde(skip_serializing_if = "Option::is_none")] - pub state: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreateTokenPersonRelationship { - /// Whether the person is a director of the account's legal entity. - /// - /// Directors are typically members of the governing board of the company, or responsible for ensuring the company meets its regulatory obligations. - #[serde(skip_serializing_if = "Option::is_none")] - pub director: Option, - - /// Whether the person has significant responsibility to control, manage, or direct the organization. - #[serde(skip_serializing_if = "Option::is_none")] - pub executive: Option, - - /// Whether the person is the legal guardian of the account's representative. - #[serde(skip_serializing_if = "Option::is_none")] - pub legal_guardian: Option, - - /// Whether the person is an owner of the account’s legal entity. - #[serde(skip_serializing_if = "Option::is_none")] - pub owner: Option, - - /// The percent owned by the person of the account's legal entity. - #[serde(skip_serializing_if = "Option::is_none")] - pub percent_ownership: Option, - - /// Whether the person is authorized as the primary representative of the account. - /// - /// This is the person nominated by the business to provide information about themselves, and general information about the account. - /// There can only be one representative at any given time. - /// At the time the account is created, this person should be set to the person responsible for opening the account. - #[serde(skip_serializing_if = "Option::is_none")] - pub representative: Option, - - /// The person's title (e.g., CEO, Support Engineer). - #[serde(skip_serializing_if = "Option::is_none")] - pub title: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct PersonVerificationParams { - /// A document showing address, either a passport, local ID card, or utility bill from a well-known utility company. - #[serde(skip_serializing_if = "Option::is_none")] - pub additional_document: Option, - - /// An identifying document, either a passport or local ID card. - #[serde(skip_serializing_if = "Option::is_none")] - pub document: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreateTokenPersonAdditionalTosAcceptancesAccount { - /// The Unix timestamp marking when the account representative accepted the service agreement. - #[serde(skip_serializing_if = "Option::is_none")] - pub date: Option, - - /// The IP address from which the account representative accepted the service agreement. - #[serde(skip_serializing_if = "Option::is_none")] - pub ip: Option, - - /// The user agent of the browser from which the account representative accepted the service agreement. - #[serde(skip_serializing_if = "Option::is_none")] - pub user_agent: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreateTokenPersonDocumentsCompanyAuthorization { - /// One or more document ids returned by a [file upload](https://stripe.com/docs/api#create_file) with a `purpose` value of `account_requirement`. - #[serde(skip_serializing_if = "Option::is_none")] - pub files: Option>, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreateTokenPersonDocumentsPassport { - /// One or more document ids returned by a [file upload](https://stripe.com/docs/api#create_file) with a `purpose` value of `account_requirement`. - #[serde(skip_serializing_if = "Option::is_none")] - pub files: Option>, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreateTokenPersonDocumentsVisa { - /// One or more document ids returned by a [file upload](https://stripe.com/docs/api#create_file) with a `purpose` value of `account_requirement`. - #[serde(skip_serializing_if = "Option::is_none")] - pub files: Option>, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct VerificationDocumentParams { - /// The back of an ID returned by a [file upload](https://stripe.com/docs/api#create_file) with a `purpose` value of `identity_document`. - /// - /// The uploaded file needs to be a color image (smaller than 8,000px by 8,000px), in JPG, PNG, or PDF format, and less than 10 MB in size. - #[serde(skip_serializing_if = "Option::is_none")] - pub back: Option, - - /// The front of an ID returned by a [file upload](https://stripe.com/docs/api#create_file) with a `purpose` value of `identity_document`. - /// - /// The uploaded file needs to be a color image (smaller than 8,000px by 8,000px), in JPG, PNG, or PDF format, and less than 10 MB in size. - #[serde(skip_serializing_if = "Option::is_none")] - pub front: Option, -} - -/// An enum representing the possible values of an `CreateTokenAccount`'s `business_type` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum CreateTokenAccountBusinessType { - Company, - GovernmentEntity, - Individual, - NonProfit, -} - -impl CreateTokenAccountBusinessType { - pub fn as_str(self) -> &'static str { - match self { - CreateTokenAccountBusinessType::Company => "company", - CreateTokenAccountBusinessType::GovernmentEntity => "government_entity", - CreateTokenAccountBusinessType::Individual => "individual", - CreateTokenAccountBusinessType::NonProfit => "non_profit", - } - } -} - -impl AsRef for CreateTokenAccountBusinessType { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for CreateTokenAccountBusinessType { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for CreateTokenAccountBusinessType { - fn default() -> Self { - Self::Company - } -} - -/// The card this token will represent. -/// -/// If you also pass in a customer, the card must be the ID of a card belonging to the customer. -/// Otherwise, if you do not pass in a customer, this is a dictionary containing a user's credit card details, with the options described below. -#[derive(Clone, Debug, Deserialize, Serialize)] -#[serde(untagged, rename_all = "snake_case")] -pub enum CreateTokenCardUnion { - CreditCardSpecs(CreditCardSpecs), - String(String), -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreditCardSpecs { - /// City / District / Suburb / Town / Village. - #[serde(skip_serializing_if = "Option::is_none")] - pub address_city: Option, - /// Billing address country, if provided. - #[serde(skip_serializing_if = "Option::is_none")] - pub address_country: Option, - /// Address line 1 (Street address / PO Box / Company name). - #[serde(skip_serializing_if = "Option::is_none")] - pub address_line1: Option, - /// Address line 2 (Apartment / Suite / Unit / Building). - #[serde(skip_serializing_if = "Option::is_none")] - pub address_line2: Option, - /// State / County / Province / Region. - #[serde(skip_serializing_if = "Option::is_none")] - pub address_state: Option, - /// ZIP or postal code. - #[serde(skip_serializing_if = "Option::is_none")] - pub address_zip: Option, - /// Required in order to add the card to an account; in all other cases, this parameter is not used. - /// - /// When added to an account, the card (which must be a debit card) can be used as a transfer destination for funds in this currency. - #[serde(skip_serializing_if = "Option::is_none")] - pub currency: Option, - /// Card security code. - /// - /// Highly recommended to always include this value. - #[serde(skip_serializing_if = "Option::is_none")] - pub cvc: Option, - /// Two-digit number representing the card's expiration month. - pub exp_month: String, - /// Two- or four-digit number representing the card's expiration year. - pub exp_year: String, - /// Cardholder's full name. - #[serde(skip_serializing_if = "Option::is_none")] - pub name: Option, - /// The card number, as a string without any separators. - pub number: String, -} diff --git a/src/resources/generated/topup.rs b/src/resources/generated/topup.rs deleted file mode 100644 index 75d9946a4..000000000 --- a/src/resources/generated/topup.rs +++ /dev/null @@ -1,283 +0,0 @@ -// ====================================== -// This file was automatically generated. -// ====================================== - -use serde::{Deserialize, Serialize}; - -use crate::client::{Client, Response}; -use crate::ids::TopupId; -use crate::params::{Expand, Expandable, List, Metadata, Object, Paginable, RangeQuery, Timestamp}; -use crate::resources::{BalanceTransaction, Currency, Source}; - -/// The resource representing a Stripe "Topup". -/// -/// For more details see -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct Topup { - /// Unique identifier for the object. - pub id: TopupId, - - /// Amount transferred. - pub amount: i64, - - /// ID of the balance transaction that describes the impact of this top-up on your account balance. - /// - /// May not be specified depending on status of top-up. - pub balance_transaction: Option>, - - /// Time at which the object was created. - /// - /// Measured in seconds since the Unix epoch. - pub created: Timestamp, - - /// Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. - /// - /// Must be a [supported currency](https://stripe.com/docs/currencies). - pub currency: Currency, - - /// An arbitrary string attached to the object. - /// - /// Often useful for displaying to users. - pub description: Option, - - /// Date the funds are expected to arrive in your Stripe account for payouts. - /// - /// This factors in delays like weekends or bank holidays. - /// May not be specified depending on status of top-up. - pub expected_availability_date: Option, - - /// Error code explaining reason for top-up failure if available (see [the errors section](https://stripe.com/docs/api#errors) for a list of codes). - pub failure_code: Option, - - /// Message to user further explaining reason for top-up failure if available. - pub failure_message: Option, - - /// Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. - pub livemode: bool, - - /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. - /// - /// This can be useful for storing additional information about the object in a structured format. - pub metadata: Metadata, - - /// The source field is deprecated. - /// - /// It might not always be present in the API response. - pub source: Option, - - /// Extra information about a top-up. - /// - /// This will appear on your source's bank statement. - /// It must contain at least one letter. - pub statement_descriptor: Option, - - /// The status of the top-up is either `canceled`, `failed`, `pending`, `reversed`, or `succeeded`. - pub status: TopupStatus, - - /// A string that identifies this top-up as part of a group. - pub transfer_group: Option, -} - -impl Topup { - /// Returns a list of top-ups. - pub fn list(client: &Client, params: &ListTopups<'_>) -> Response> { - client.get_query("/topups", ¶ms) - } - - /// Retrieves the details of a top-up that has previously been created. - /// - /// Supply the unique top-up ID that was returned from your previous request, and Stripe will return the corresponding top-up information. - pub fn retrieve(client: &Client, id: &TopupId, expand: &[&str]) -> Response { - client.get_query(&format!("/topups/{}", id), &Expand { expand }) - } - - /// Updates the metadata of a top-up. - /// - /// Other top-up details are not editable by design. - pub fn update(client: &Client, id: &TopupId, params: UpdateTopup<'_>) -> Response { - client.post_form(&format!("/topups/{}", id), ¶ms) - } -} - -impl Object for Topup { - type Id = TopupId; - fn id(&self) -> Self::Id { - self.id.clone() - } - fn object(&self) -> &'static str { - "topup" - } -} - -/// The parameters for `Topup::list`. -#[derive(Clone, Debug, Serialize, Default)] -pub struct ListTopups<'a> { - /// A positive integer representing how much to transfer. - #[serde(skip_serializing_if = "Option::is_none")] - pub amount: Option>, - - /// A filter on the list, based on the object `created` field. - /// - /// The value can be a string with an integer Unix timestamp, or it can be a dictionary with a number of different query options. - #[serde(skip_serializing_if = "Option::is_none")] - pub created: Option>, - - /// A cursor for use in pagination. - /// - /// `ending_before` is an object ID that defines your place in the list. - /// For instance, if you make a list request and receive 100 objects, starting with `obj_bar`, your subsequent call can include `ending_before=obj_bar` in order to fetch the previous page of the list. - #[serde(skip_serializing_if = "Option::is_none")] - pub ending_before: Option, - - /// Specifies which fields in the response should be expanded. - #[serde(skip_serializing_if = "Expand::is_empty")] - pub expand: &'a [&'a str], - - /// A limit on the number of objects to be returned. - /// - /// Limit can range between 1 and 100, and the default is 10. - #[serde(skip_serializing_if = "Option::is_none")] - pub limit: Option, - - /// A cursor for use in pagination. - /// - /// `starting_after` is an object ID that defines your place in the list. - /// For instance, if you make a list request and receive 100 objects, ending with `obj_foo`, your subsequent call can include `starting_after=obj_foo` in order to fetch the next page of the list. - #[serde(skip_serializing_if = "Option::is_none")] - pub starting_after: Option, - - /// Only return top-ups that have the given status. - /// - /// One of `canceled`, `failed`, `pending` or `succeeded`. - #[serde(skip_serializing_if = "Option::is_none")] - pub status: Option, -} - -impl<'a> ListTopups<'a> { - pub fn new() -> Self { - ListTopups { - amount: Default::default(), - created: Default::default(), - ending_before: Default::default(), - expand: Default::default(), - limit: Default::default(), - starting_after: Default::default(), - status: Default::default(), - } - } -} -impl Paginable for ListTopups<'_> { - type O = Topup; - fn set_last(&mut self, item: Self::O) { - self.starting_after = Some(item.id()); - } -} -/// The parameters for `Topup::update`. -#[derive(Clone, Debug, Serialize, Default)] -pub struct UpdateTopup<'a> { - /// An arbitrary string attached to the object. - /// - /// Often useful for displaying to users. - #[serde(skip_serializing_if = "Option::is_none")] - pub description: Option<&'a str>, - - /// Specifies which fields in the response should be expanded. - #[serde(skip_serializing_if = "Expand::is_empty")] - pub expand: &'a [&'a str], - - /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. - /// - /// This can be useful for storing additional information about the object in a structured format. - /// Individual keys can be unset by posting an empty value to them. - /// All keys can be unset by posting an empty value to `metadata`. - #[serde(skip_serializing_if = "Option::is_none")] - pub metadata: Option, -} - -impl<'a> UpdateTopup<'a> { - pub fn new() -> Self { - UpdateTopup { - description: Default::default(), - expand: Default::default(), - metadata: Default::default(), - } - } -} - -/// An enum representing the possible values of an `Topup`'s `status` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum TopupStatus { - Canceled, - Failed, - Pending, - Reversed, - Succeeded, -} - -impl TopupStatus { - pub fn as_str(self) -> &'static str { - match self { - TopupStatus::Canceled => "canceled", - TopupStatus::Failed => "failed", - TopupStatus::Pending => "pending", - TopupStatus::Reversed => "reversed", - TopupStatus::Succeeded => "succeeded", - } - } -} - -impl AsRef for TopupStatus { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for TopupStatus { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for TopupStatus { - fn default() -> Self { - Self::Canceled - } -} - -/// An enum representing the possible values of an `ListTopups`'s `status` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum TopupStatusFilter { - Canceled, - Failed, - Pending, - Succeeded, -} - -impl TopupStatusFilter { - pub fn as_str(self) -> &'static str { - match self { - TopupStatusFilter::Canceled => "canceled", - TopupStatusFilter::Failed => "failed", - TopupStatusFilter::Pending => "pending", - TopupStatusFilter::Succeeded => "succeeded", - } - } -} - -impl AsRef for TopupStatusFilter { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for TopupStatusFilter { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for TopupStatusFilter { - fn default() -> Self { - Self::Canceled - } -} diff --git a/src/resources/generated/topup_canceled.rs b/src/resources/generated/topup_canceled.rs deleted file mode 100644 index 58e41154a..000000000 --- a/src/resources/generated/topup_canceled.rs +++ /dev/null @@ -1,10 +0,0 @@ -// ====================================== -// This file was automatically generated. -// ====================================== - -use serde::{Deserialize, Serialize}; - -/// The resource representing a Stripe "topup.canceled". -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct TopupCanceled { -} diff --git a/src/resources/generated/topup_created.rs b/src/resources/generated/topup_created.rs deleted file mode 100644 index 245db49ff..000000000 --- a/src/resources/generated/topup_created.rs +++ /dev/null @@ -1,10 +0,0 @@ -// ====================================== -// This file was automatically generated. -// ====================================== - -use serde::{Deserialize, Serialize}; - -/// The resource representing a Stripe "topup.created". -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct TopupCreated { -} diff --git a/src/resources/generated/topup_failed.rs b/src/resources/generated/topup_failed.rs deleted file mode 100644 index 17b7680c7..000000000 --- a/src/resources/generated/topup_failed.rs +++ /dev/null @@ -1,10 +0,0 @@ -// ====================================== -// This file was automatically generated. -// ====================================== - -use serde::{Deserialize, Serialize}; - -/// The resource representing a Stripe "topup.failed". -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct TopupFailed { -} diff --git a/src/resources/generated/topup_reversed.rs b/src/resources/generated/topup_reversed.rs deleted file mode 100644 index 41ed8dd98..000000000 --- a/src/resources/generated/topup_reversed.rs +++ /dev/null @@ -1,10 +0,0 @@ -// ====================================== -// This file was automatically generated. -// ====================================== - -use serde::{Deserialize, Serialize}; - -/// The resource representing a Stripe "topup.reversed". -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct TopupReversed { -} diff --git a/src/resources/generated/topup_succeeded.rs b/src/resources/generated/topup_succeeded.rs deleted file mode 100644 index c0dc6df8f..000000000 --- a/src/resources/generated/topup_succeeded.rs +++ /dev/null @@ -1,10 +0,0 @@ -// ====================================== -// This file was automatically generated. -// ====================================== - -use serde::{Deserialize, Serialize}; - -/// The resource representing a Stripe "topup.succeeded". -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct TopupSucceeded { -} diff --git a/src/resources/generated/transfer.rs b/src/resources/generated/transfer.rs deleted file mode 100644 index 2bfad37c1..000000000 --- a/src/resources/generated/transfer.rs +++ /dev/null @@ -1,320 +0,0 @@ -// ====================================== -// This file was automatically generated. -// ====================================== - -use serde::{Deserialize, Serialize}; - -use crate::client::{Client, Response}; -use crate::ids::{ChargeId, TransferId}; -use crate::params::{Expand, Expandable, List, Metadata, Object, Paginable, RangeQuery, Timestamp}; -use crate::resources::{Account, BalanceTransaction, Charge, Currency, TransferReversal}; - -/// The resource representing a Stripe "Transfer". -/// -/// For more details see -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct Transfer { - /// Unique identifier for the object. - pub id: TransferId, - - /// Amount in cents (or local equivalent) to be transferred. - pub amount: i64, - - /// Amount in cents (or local equivalent) reversed (can be less than the amount attribute on the transfer if a partial reversal was issued). - pub amount_reversed: i64, - - /// Balance transaction that describes the impact of this transfer on your account balance. - pub balance_transaction: Option>, - - /// Time that this record of the transfer was first created. - pub created: Timestamp, - - /// Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. - /// - /// Must be a [supported currency](https://stripe.com/docs/currencies). - pub currency: Currency, - - /// An arbitrary string attached to the object. - /// - /// Often useful for displaying to users. - pub description: Option, - - /// ID of the Stripe account the transfer was sent to. - pub destination: Option>, - - /// If the destination is a Stripe account, this will be the ID of the payment that the destination account received for the transfer. - #[serde(skip_serializing_if = "Option::is_none")] - pub destination_payment: Option>, - - /// Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. - pub livemode: bool, - - /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. - /// - /// This can be useful for storing additional information about the object in a structured format. - pub metadata: Metadata, - - /// A list of reversals that have been applied to the transfer. - pub reversals: List, - - /// Whether the transfer has been fully reversed. - /// - /// If the transfer is only partially reversed, this attribute will still be false. - pub reversed: bool, - - /// ID of the charge or payment that was used to fund the transfer. - /// - /// If null, the transfer was funded from the available balance. - pub source_transaction: Option>, - - /// The source balance this transfer came from. - /// - /// One of `card`, `fpx`, or `bank_account`. - #[serde(skip_serializing_if = "Option::is_none")] - pub source_type: Option, - - /// A string that identifies this transaction as part of a group. - /// - /// See the [Connect documentation](https://stripe.com/docs/connect/separate-charges-and-transfers#transfer-options) for details. - pub transfer_group: Option, -} - -impl Transfer { - /// Returns a list of existing transfers sent to connected accounts. - /// - /// The transfers are returned in sorted order, with the most recently created transfers appearing first. - pub fn list(client: &Client, params: &ListTransfers<'_>) -> Response> { - client.get_query("/transfers", ¶ms) - } - - /// To send funds from your Stripe account to a connected account, you create a new transfer object. - /// - /// Your [Stripe balance](https://stripe.com/docs/api#balance) must be able to cover the transfer amount, or you’ll receive an “Insufficient Funds” error. - pub fn create(client: &Client, params: CreateTransfer<'_>) -> Response { - client.post_form("/transfers", ¶ms) - } - - /// Retrieves the details of an existing transfer. - /// - /// Supply the unique transfer ID from either a transfer creation request or the transfer list, and Stripe will return the corresponding transfer information. - pub fn retrieve(client: &Client, id: &TransferId, expand: &[&str]) -> Response { - client.get_query(&format!("/transfers/{}", id), &Expand { expand }) - } - - /// Updates the specified transfer by setting the values of the parameters passed. - /// - /// Any parameters not provided will be left unchanged. This request accepts only metadata as an argument. - pub fn update( - client: &Client, - id: &TransferId, - params: UpdateTransfer<'_>, - ) -> Response { - client.post_form(&format!("/transfers/{}", id), ¶ms) - } -} - -impl Object for Transfer { - type Id = TransferId; - fn id(&self) -> Self::Id { - self.id.clone() - } - fn object(&self) -> &'static str { - "transfer" - } -} - -/// The parameters for `Transfer::create`. -#[derive(Clone, Debug, Serialize)] -pub struct CreateTransfer<'a> { - /// A positive integer in cents (or local equivalent) representing how much to transfer. - #[serde(skip_serializing_if = "Option::is_none")] - pub amount: Option, - - /// 3-letter [ISO code for currency](https://stripe.com/docs/payouts). - pub currency: Currency, - - /// An arbitrary string attached to the object. - /// - /// Often useful for displaying to users. - #[serde(skip_serializing_if = "Option::is_none")] - pub description: Option<&'a str>, - - /// The ID of a connected Stripe account. - /// - /// [See the Connect documentation](https://stripe.com/docs/connect/separate-charges-and-transfers) for details. - pub destination: String, - - /// Specifies which fields in the response should be expanded. - #[serde(skip_serializing_if = "Expand::is_empty")] - pub expand: &'a [&'a str], - - /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. - /// - /// This can be useful for storing additional information about the object in a structured format. - /// Individual keys can be unset by posting an empty value to them. - /// All keys can be unset by posting an empty value to `metadata`. - #[serde(skip_serializing_if = "Option::is_none")] - pub metadata: Option, - - /// You can use this parameter to transfer funds from a charge before they are added to your available balance. - /// - /// A pending balance will transfer immediately but the funds will not become available until the original charge becomes available. - /// [See the Connect documentation](https://stripe.com/docs/connect/separate-charges-and-transfers#transfer-availability) for details. - #[serde(skip_serializing_if = "Option::is_none")] - pub source_transaction: Option, - - /// The source balance to use for this transfer. - /// - /// One of `bank_account`, `card`, or `fpx`. - /// For most users, this will default to `card`. - #[serde(skip_serializing_if = "Option::is_none")] - pub source_type: Option, - - /// A string that identifies this transaction as part of a group. - /// - /// See the [Connect documentation](https://stripe.com/docs/connect/separate-charges-and-transfers#transfer-options) for details. - #[serde(skip_serializing_if = "Option::is_none")] - pub transfer_group: Option<&'a str>, -} - -impl<'a> CreateTransfer<'a> { - pub fn new(currency: Currency, destination: String) -> Self { - CreateTransfer { - amount: Default::default(), - currency, - description: Default::default(), - destination, - expand: Default::default(), - metadata: Default::default(), - source_transaction: Default::default(), - source_type: Default::default(), - transfer_group: Default::default(), - } - } -} - -/// The parameters for `Transfer::list`. -#[derive(Clone, Debug, Serialize, Default)] -pub struct ListTransfers<'a> { - #[serde(skip_serializing_if = "Option::is_none")] - pub created: Option>, - - /// Only return transfers for the destination specified by this account ID. - #[serde(skip_serializing_if = "Option::is_none")] - pub destination: Option, - - /// A cursor for use in pagination. - /// - /// `ending_before` is an object ID that defines your place in the list. - /// For instance, if you make a list request and receive 100 objects, starting with `obj_bar`, your subsequent call can include `ending_before=obj_bar` in order to fetch the previous page of the list. - #[serde(skip_serializing_if = "Option::is_none")] - pub ending_before: Option, - - /// Specifies which fields in the response should be expanded. - #[serde(skip_serializing_if = "Expand::is_empty")] - pub expand: &'a [&'a str], - - /// A limit on the number of objects to be returned. - /// - /// Limit can range between 1 and 100, and the default is 10. - #[serde(skip_serializing_if = "Option::is_none")] - pub limit: Option, - - /// A cursor for use in pagination. - /// - /// `starting_after` is an object ID that defines your place in the list. - /// For instance, if you make a list request and receive 100 objects, ending with `obj_foo`, your subsequent call can include `starting_after=obj_foo` in order to fetch the next page of the list. - #[serde(skip_serializing_if = "Option::is_none")] - pub starting_after: Option, - - /// Only return transfers with the specified transfer group. - #[serde(skip_serializing_if = "Option::is_none")] - pub transfer_group: Option<&'a str>, -} - -impl<'a> ListTransfers<'a> { - pub fn new() -> Self { - ListTransfers { - created: Default::default(), - destination: Default::default(), - ending_before: Default::default(), - expand: Default::default(), - limit: Default::default(), - starting_after: Default::default(), - transfer_group: Default::default(), - } - } -} -impl Paginable for ListTransfers<'_> { - type O = Transfer; - fn set_last(&mut self, item: Self::O) { - self.starting_after = Some(item.id()); - } -} -/// The parameters for `Transfer::update`. -#[derive(Clone, Debug, Serialize, Default)] -pub struct UpdateTransfer<'a> { - /// An arbitrary string attached to the object. - /// - /// Often useful for displaying to users. - #[serde(skip_serializing_if = "Option::is_none")] - pub description: Option<&'a str>, - - /// Specifies which fields in the response should be expanded. - #[serde(skip_serializing_if = "Expand::is_empty")] - pub expand: &'a [&'a str], - - /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. - /// - /// This can be useful for storing additional information about the object in a structured format. - /// Individual keys can be unset by posting an empty value to them. - /// All keys can be unset by posting an empty value to `metadata`. - #[serde(skip_serializing_if = "Option::is_none")] - pub metadata: Option, -} - -impl<'a> UpdateTransfer<'a> { - pub fn new() -> Self { - UpdateTransfer { - description: Default::default(), - expand: Default::default(), - metadata: Default::default(), - } - } -} - -/// An enum representing the possible values of an `CreateTransfer`'s `source_type` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum TransferSourceType { - BankAccount, - Card, - Fpx, -} - -impl TransferSourceType { - pub fn as_str(self) -> &'static str { - match self { - TransferSourceType::BankAccount => "bank_account", - TransferSourceType::Card => "card", - TransferSourceType::Fpx => "fpx", - } - } -} - -impl AsRef for TransferSourceType { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for TransferSourceType { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for TransferSourceType { - fn default() -> Self { - Self::BankAccount - } -} diff --git a/src/resources/generated/transfer_created.rs b/src/resources/generated/transfer_created.rs deleted file mode 100644 index 4ae6898d5..000000000 --- a/src/resources/generated/transfer_created.rs +++ /dev/null @@ -1,10 +0,0 @@ -// ====================================== -// This file was automatically generated. -// ====================================== - -use serde::{Deserialize, Serialize}; - -/// The resource representing a Stripe "transfer.created". -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct TransferCreated { -} diff --git a/src/resources/generated/transfer_reversal.rs b/src/resources/generated/transfer_reversal.rs deleted file mode 100644 index 342970dbc..000000000 --- a/src/resources/generated/transfer_reversal.rs +++ /dev/null @@ -1,58 +0,0 @@ -// ====================================== -// This file was automatically generated. -// ====================================== - -use serde::{Deserialize, Serialize}; - -use crate::ids::TransferReversalId; -use crate::params::{Expandable, Metadata, Object, Timestamp}; -use crate::resources::{BalanceTransaction, Currency, Refund, Transfer}; - -/// The resource representing a Stripe "TransferReversal". -/// -/// For more details see -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct TransferReversal { - /// Unique identifier for the object. - pub id: TransferReversalId, - - /// Amount, in cents (or local equivalent). - pub amount: i64, - - /// Balance transaction that describes the impact on your account balance. - pub balance_transaction: Option>, - - /// Time at which the object was created. - /// - /// Measured in seconds since the Unix epoch. - pub created: Timestamp, - - /// Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. - /// - /// Must be a [supported currency](https://stripe.com/docs/currencies). - pub currency: Currency, - - /// Linked payment refund for the transfer reversal. - pub destination_payment_refund: Option>, - - /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. - /// - /// This can be useful for storing additional information about the object in a structured format. - pub metadata: Option, - - /// ID of the refund responsible for the transfer reversal. - pub source_refund: Option>, - - /// ID of the transfer that was reversed. - pub transfer: Expandable, -} - -impl Object for TransferReversal { - type Id = TransferReversalId; - fn id(&self) -> Self::Id { - self.id.clone() - } - fn object(&self) -> &'static str { - "transfer_reversal" - } -} diff --git a/src/resources/generated/transfer_reversed.rs b/src/resources/generated/transfer_reversed.rs deleted file mode 100644 index 5a12386db..000000000 --- a/src/resources/generated/transfer_reversed.rs +++ /dev/null @@ -1,10 +0,0 @@ -// ====================================== -// This file was automatically generated. -// ====================================== - -use serde::{Deserialize, Serialize}; - -/// The resource representing a Stripe "transfer.reversed". -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct TransferReversed { -} diff --git a/src/resources/generated/transfer_updated.rs b/src/resources/generated/transfer_updated.rs deleted file mode 100644 index bf2bf62da..000000000 --- a/src/resources/generated/transfer_updated.rs +++ /dev/null @@ -1,10 +0,0 @@ -// ====================================== -// This file was automatically generated. -// ====================================== - -use serde::{Deserialize, Serialize}; - -/// The resource representing a Stripe "transfer.updated". -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct TransferUpdated { -} diff --git a/src/resources/generated/treasury_credit_reversal.rs b/src/resources/generated/treasury_credit_reversal.rs deleted file mode 100644 index 16318ed4d..000000000 --- a/src/resources/generated/treasury_credit_reversal.rs +++ /dev/null @@ -1,143 +0,0 @@ -// ====================================== -// This file was automatically generated. -// ====================================== - -use crate::ids::{TreasuryCreditReversalId}; -use crate::params::{Expandable, Metadata, Object, Timestamp}; -use crate::resources::{Currency, TreasuryTransaction}; -use serde::{Deserialize, Serialize}; - -/// The resource representing a Stripe "TreasuryReceivedCreditsResourceCreditReversal". -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct TreasuryCreditReversal { - /// Unique identifier for the object. - pub id: TreasuryCreditReversalId, - - /// Amount (in cents) transferred. - pub amount: i64, - - /// Time at which the object was created. - /// - /// Measured in seconds since the Unix epoch. - pub created: Timestamp, - - /// Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. - /// - /// Must be a [supported currency](https://stripe.com/docs/currencies). - pub currency: Currency, - - /// The FinancialAccount to reverse funds from. - pub financial_account: String, - - /// A [hosted transaction receipt](https://stripe.com/docs/treasury/moving-money/regulatory-receipts) URL that is provided when money movement is considered regulated under Stripe's money transmission licenses. - pub hosted_regulatory_receipt_url: Option, - - /// Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. - pub livemode: bool, - - /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. - /// - /// This can be useful for storing additional information about the object in a structured format. - pub metadata: Metadata, - - /// The rails used to reverse the funds. - pub network: TreasuryCreditReversalNetwork, - - /// The ReceivedCredit being reversed. - pub received_credit: String, - - /// Status of the CreditReversal. - pub status: TreasuryCreditReversalStatus, - - pub status_transitions: TreasuryReceivedCreditsResourceStatusTransitions, - - /// The Transaction associated with this object. - pub transaction: Option>, -} - -impl Object for TreasuryCreditReversal { - type Id = TreasuryCreditReversalId; - fn id(&self) -> Self::Id { - self.id.clone() - } - fn object(&self) -> &'static str { - "treasury.credit_reversal" - } -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct TreasuryReceivedCreditsResourceStatusTransitions { - - /// Timestamp describing when the CreditReversal changed status to `posted`. - pub posted_at: Option, -} - -/// An enum representing the possible values of an `TreasuryCreditReversal`'s `network` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum TreasuryCreditReversalNetwork { - Ach, - Stripe, -} - -impl TreasuryCreditReversalNetwork { - pub fn as_str(self) -> &'static str { - match self { - TreasuryCreditReversalNetwork::Ach => "ach", - TreasuryCreditReversalNetwork::Stripe => "stripe", - } - } -} - -impl AsRef for TreasuryCreditReversalNetwork { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for TreasuryCreditReversalNetwork { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for TreasuryCreditReversalNetwork { - fn default() -> Self { - Self::Ach - } -} - -/// An enum representing the possible values of an `TreasuryCreditReversal`'s `status` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum TreasuryCreditReversalStatus { - Canceled, - Posted, - Processing, -} - -impl TreasuryCreditReversalStatus { - pub fn as_str(self) -> &'static str { - match self { - TreasuryCreditReversalStatus::Canceled => "canceled", - TreasuryCreditReversalStatus::Posted => "posted", - TreasuryCreditReversalStatus::Processing => "processing", - } - } -} - -impl AsRef for TreasuryCreditReversalStatus { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for TreasuryCreditReversalStatus { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for TreasuryCreditReversalStatus { - fn default() -> Self { - Self::Canceled - } -} diff --git a/src/resources/generated/treasury_credit_reversal_created.rs b/src/resources/generated/treasury_credit_reversal_created.rs deleted file mode 100644 index 79a73b063..000000000 --- a/src/resources/generated/treasury_credit_reversal_created.rs +++ /dev/null @@ -1,10 +0,0 @@ -// ====================================== -// This file was automatically generated. -// ====================================== - -use serde::{Deserialize, Serialize}; - -/// The resource representing a Stripe "treasury.credit_reversal.created". -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct TreasuryCreditReversalCreated { -} diff --git a/src/resources/generated/treasury_credit_reversal_posted.rs b/src/resources/generated/treasury_credit_reversal_posted.rs deleted file mode 100644 index 39f626237..000000000 --- a/src/resources/generated/treasury_credit_reversal_posted.rs +++ /dev/null @@ -1,10 +0,0 @@ -// ====================================== -// This file was automatically generated. -// ====================================== - -use serde::{Deserialize, Serialize}; - -/// The resource representing a Stripe "treasury.credit_reversal.posted". -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct TreasuryCreditReversalPosted { -} diff --git a/src/resources/generated/treasury_debit_reversal.rs b/src/resources/generated/treasury_debit_reversal.rs deleted file mode 100644 index 09fcdadb2..000000000 --- a/src/resources/generated/treasury_debit_reversal.rs +++ /dev/null @@ -1,153 +0,0 @@ -// ====================================== -// This file was automatically generated. -// ====================================== - -use crate::ids::{TreasuryDebitReversalId}; -use crate::params::{Expandable, Metadata, Object, Timestamp}; -use crate::resources::{Currency, TreasuryTransaction}; -use serde::{Deserialize, Serialize}; - -/// The resource representing a Stripe "TreasuryReceivedDebitsResourceDebitReversal". -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct TreasuryDebitReversal { - /// Unique identifier for the object. - pub id: TreasuryDebitReversalId, - - /// Amount (in cents) transferred. - pub amount: i64, - - /// Time at which the object was created. - /// - /// Measured in seconds since the Unix epoch. - pub created: Timestamp, - - /// Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. - /// - /// Must be a [supported currency](https://stripe.com/docs/currencies). - pub currency: Currency, - - /// The FinancialAccount to reverse funds from. - pub financial_account: Option, - - /// A [hosted transaction receipt](https://stripe.com/docs/treasury/moving-money/regulatory-receipts) URL that is provided when money movement is considered regulated under Stripe's money transmission licenses. - pub hosted_regulatory_receipt_url: Option, - - /// Other flows linked to a DebitReversal. - pub linked_flows: Option, - - /// Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. - pub livemode: bool, - - /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. - /// - /// This can be useful for storing additional information about the object in a structured format. - pub metadata: Metadata, - - /// The rails used to reverse the funds. - pub network: TreasuryDebitReversalNetwork, - - /// The ReceivedDebit being reversed. - pub received_debit: String, - - /// Status of the DebitReversal. - pub status: TreasuryDebitReversalStatus, - - pub status_transitions: TreasuryReceivedDebitsResourceStatusTransitions, - - /// The Transaction associated with this object. - pub transaction: Option>, -} - -impl Object for TreasuryDebitReversal { - type Id = TreasuryDebitReversalId; - fn id(&self) -> Self::Id { - self.id.clone() - } - fn object(&self) -> &'static str { - "treasury.debit_reversal" - } -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct TreasuryReceivedDebitsResourceDebitReversalLinkedFlows { - - /// Set if there is an Issuing dispute associated with the DebitReversal. - pub issuing_dispute: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct TreasuryReceivedDebitsResourceStatusTransitions { - - /// Timestamp describing when the DebitReversal changed status to `completed`. - pub completed_at: Option, -} - -/// An enum representing the possible values of an `TreasuryDebitReversal`'s `network` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum TreasuryDebitReversalNetwork { - Ach, - Card, -} - -impl TreasuryDebitReversalNetwork { - pub fn as_str(self) -> &'static str { - match self { - TreasuryDebitReversalNetwork::Ach => "ach", - TreasuryDebitReversalNetwork::Card => "card", - } - } -} - -impl AsRef for TreasuryDebitReversalNetwork { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for TreasuryDebitReversalNetwork { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for TreasuryDebitReversalNetwork { - fn default() -> Self { - Self::Ach - } -} - -/// An enum representing the possible values of an `TreasuryDebitReversal`'s `status` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum TreasuryDebitReversalStatus { - Failed, - Processing, - Succeeded, -} - -impl TreasuryDebitReversalStatus { - pub fn as_str(self) -> &'static str { - match self { - TreasuryDebitReversalStatus::Failed => "failed", - TreasuryDebitReversalStatus::Processing => "processing", - TreasuryDebitReversalStatus::Succeeded => "succeeded", - } - } -} - -impl AsRef for TreasuryDebitReversalStatus { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for TreasuryDebitReversalStatus { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for TreasuryDebitReversalStatus { - fn default() -> Self { - Self::Failed - } -} diff --git a/src/resources/generated/treasury_debit_reversal_completed.rs b/src/resources/generated/treasury_debit_reversal_completed.rs deleted file mode 100644 index 3e39b0d17..000000000 --- a/src/resources/generated/treasury_debit_reversal_completed.rs +++ /dev/null @@ -1,10 +0,0 @@ -// ====================================== -// This file was automatically generated. -// ====================================== - -use serde::{Deserialize, Serialize}; - -/// The resource representing a Stripe "treasury.debit_reversal.completed". -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct TreasuryDebitReversalCompleted { -} diff --git a/src/resources/generated/treasury_debit_reversal_created.rs b/src/resources/generated/treasury_debit_reversal_created.rs deleted file mode 100644 index 32742fbe1..000000000 --- a/src/resources/generated/treasury_debit_reversal_created.rs +++ /dev/null @@ -1,10 +0,0 @@ -// ====================================== -// This file was automatically generated. -// ====================================== - -use serde::{Deserialize, Serialize}; - -/// The resource representing a Stripe "treasury.debit_reversal.created". -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct TreasuryDebitReversalCreated { -} diff --git a/src/resources/generated/treasury_debit_reversal_initial_credit_granted.rs b/src/resources/generated/treasury_debit_reversal_initial_credit_granted.rs deleted file mode 100644 index 5b4d510a8..000000000 --- a/src/resources/generated/treasury_debit_reversal_initial_credit_granted.rs +++ /dev/null @@ -1,10 +0,0 @@ -// ====================================== -// This file was automatically generated. -// ====================================== - -use serde::{Deserialize, Serialize}; - -/// The resource representing a Stripe "treasury.debit_reversal.initial_credit_granted". -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct TreasuryDebitReversalInitialCreditGranted { -} diff --git a/src/resources/generated/treasury_financial_account.rs b/src/resources/generated/treasury_financial_account.rs deleted file mode 100644 index 7e986bfc6..000000000 --- a/src/resources/generated/treasury_financial_account.rs +++ /dev/null @@ -1,518 +0,0 @@ -// ====================================== -// This file was automatically generated. -// ====================================== - -use crate::ids::{TreasuryFinancialAccountId}; -use crate::params::{Metadata, Object, Timestamp}; -use crate::resources::{TreasuryFinancialAccountFeatures}; -use serde::{Deserialize, Serialize}; - -/// The resource representing a Stripe "TreasuryFinancialAccountsResourceFinancialAccount". -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct TreasuryFinancialAccount { - /// Unique identifier for the object. - pub id: TreasuryFinancialAccountId, - - /// The array of paths to active Features in the Features hash. - #[serde(skip_serializing_if = "Option::is_none")] - pub active_features: Option>, - - pub balance: TreasuryFinancialAccountsResourceBalance, - - /// Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). - pub country: String, - - /// Time at which the object was created. - /// - /// Measured in seconds since the Unix epoch. - pub created: Timestamp, - - #[serde(skip_serializing_if = "Option::is_none")] - pub features: Option, - - /// The set of credentials that resolve to a FinancialAccount. - pub financial_addresses: Vec, - - /// Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. - pub livemode: bool, - - /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. - /// - /// This can be useful for storing additional information about the object in a structured format. - pub metadata: Option, - - /// The array of paths to pending Features in the Features hash. - #[serde(skip_serializing_if = "Option::is_none")] - pub pending_features: Option>, - - /// The set of functionalities that the platform can restrict on the FinancialAccount. - #[serde(skip_serializing_if = "Option::is_none")] - pub platform_restrictions: Option, - - /// The array of paths to restricted Features in the Features hash. - #[serde(skip_serializing_if = "Option::is_none")] - pub restricted_features: Option>, - - /// The enum specifying what state the account is in. - pub status: TreasuryFinancialAccountStatus, - - pub status_details: TreasuryFinancialAccountsResourceStatusDetails, - - /// The currencies the FinancialAccount can hold a balance in. - /// - /// Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. - pub supported_currencies: Vec, -} - -impl Object for TreasuryFinancialAccount { - type Id = TreasuryFinancialAccountId; - fn id(&self) -> Self::Id { - self.id.clone() - } - fn object(&self) -> &'static str { - "treasury.financial_account" - } -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct TreasuryFinancialAccountsResourceBalance { - - /// Funds the user can spend right now. - pub cash: i64, - - /// Funds not spendable yet, but will become available at a later time. - pub inbound_pending: i64, - - /// Funds in the account, but not spendable because they are being held for pending outbound flows. - pub outbound_pending: i64, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct TreasuryFinancialAccountsResourceFinancialAddress { - - #[serde(skip_serializing_if = "Option::is_none")] - pub aba: Option, - - /// The list of networks that the address supports. - #[serde(skip_serializing_if = "Option::is_none")] - pub supported_networks: Option>, - - /// The type of financial address. - #[serde(rename = "type")] - pub type_: TreasuryFinancialAccountsResourceFinancialAddressType, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct TreasuryFinancialAccountsResourceAbaRecord { - - /// The name of the person or business that owns the bank account. - pub account_holder_name: String, - - /// The account number. - pub account_number: Option, - - /// The last four characters of the account number. - pub account_number_last4: String, - - /// Name of the bank. - pub bank_name: String, - - /// Routing number for the account. - pub routing_number: String, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct TreasuryFinancialAccountsResourcePlatformRestrictions { - - /// Restricts all inbound money movement. - pub inbound_flows: Option, - - /// Restricts all outbound money movement. - pub outbound_flows: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct TreasuryFinancialAccountsResourceStatusDetails { - - /// Details related to the closure of this FinancialAccount. - pub closed: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct TreasuryFinancialAccountsResourceClosedStatusDetails { - - /// The array that contains reasons for a FinancialAccount closure. - pub reasons: Vec, -} - -/// An enum representing the possible values of an `TreasuryFinancialAccount`'s `active_features` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum TreasuryFinancialAccountActiveFeatures { - CardIssuing, - DepositInsurance, - #[serde(rename = "financial_addresses.aba")] - FinancialAddressesAba, - #[serde(rename = "inbound_transfers.ach")] - InboundTransfersAch, - IntraStripeFlows, - #[serde(rename = "outbound_payments.ach")] - OutboundPaymentsAch, - #[serde(rename = "outbound_payments.us_domestic_wire")] - OutboundPaymentsUsDomesticWire, - #[serde(rename = "outbound_transfers.ach")] - OutboundTransfersAch, - #[serde(rename = "outbound_transfers.us_domestic_wire")] - OutboundTransfersUsDomesticWire, - RemoteDepositCapture, -} - -impl TreasuryFinancialAccountActiveFeatures { - pub fn as_str(self) -> &'static str { - match self { - TreasuryFinancialAccountActiveFeatures::CardIssuing => "card_issuing", - TreasuryFinancialAccountActiveFeatures::DepositInsurance => "deposit_insurance", - TreasuryFinancialAccountActiveFeatures::FinancialAddressesAba => "financial_addresses.aba", - TreasuryFinancialAccountActiveFeatures::InboundTransfersAch => "inbound_transfers.ach", - TreasuryFinancialAccountActiveFeatures::IntraStripeFlows => "intra_stripe_flows", - TreasuryFinancialAccountActiveFeatures::OutboundPaymentsAch => "outbound_payments.ach", - TreasuryFinancialAccountActiveFeatures::OutboundPaymentsUsDomesticWire => "outbound_payments.us_domestic_wire", - TreasuryFinancialAccountActiveFeatures::OutboundTransfersAch => "outbound_transfers.ach", - TreasuryFinancialAccountActiveFeatures::OutboundTransfersUsDomesticWire => "outbound_transfers.us_domestic_wire", - TreasuryFinancialAccountActiveFeatures::RemoteDepositCapture => "remote_deposit_capture", - } - } -} - -impl AsRef for TreasuryFinancialAccountActiveFeatures { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for TreasuryFinancialAccountActiveFeatures { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for TreasuryFinancialAccountActiveFeatures { - fn default() -> Self { - Self::CardIssuing - } -} - -/// An enum representing the possible values of an `TreasuryFinancialAccount`'s `pending_features` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum TreasuryFinancialAccountPendingFeatures { - CardIssuing, - DepositInsurance, - #[serde(rename = "financial_addresses.aba")] - FinancialAddressesAba, - #[serde(rename = "inbound_transfers.ach")] - InboundTransfersAch, - IntraStripeFlows, - #[serde(rename = "outbound_payments.ach")] - OutboundPaymentsAch, - #[serde(rename = "outbound_payments.us_domestic_wire")] - OutboundPaymentsUsDomesticWire, - #[serde(rename = "outbound_transfers.ach")] - OutboundTransfersAch, - #[serde(rename = "outbound_transfers.us_domestic_wire")] - OutboundTransfersUsDomesticWire, - RemoteDepositCapture, -} - -impl TreasuryFinancialAccountPendingFeatures { - pub fn as_str(self) -> &'static str { - match self { - TreasuryFinancialAccountPendingFeatures::CardIssuing => "card_issuing", - TreasuryFinancialAccountPendingFeatures::DepositInsurance => "deposit_insurance", - TreasuryFinancialAccountPendingFeatures::FinancialAddressesAba => "financial_addresses.aba", - TreasuryFinancialAccountPendingFeatures::InboundTransfersAch => "inbound_transfers.ach", - TreasuryFinancialAccountPendingFeatures::IntraStripeFlows => "intra_stripe_flows", - TreasuryFinancialAccountPendingFeatures::OutboundPaymentsAch => "outbound_payments.ach", - TreasuryFinancialAccountPendingFeatures::OutboundPaymentsUsDomesticWire => "outbound_payments.us_domestic_wire", - TreasuryFinancialAccountPendingFeatures::OutboundTransfersAch => "outbound_transfers.ach", - TreasuryFinancialAccountPendingFeatures::OutboundTransfersUsDomesticWire => "outbound_transfers.us_domestic_wire", - TreasuryFinancialAccountPendingFeatures::RemoteDepositCapture => "remote_deposit_capture", - } - } -} - -impl AsRef for TreasuryFinancialAccountPendingFeatures { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for TreasuryFinancialAccountPendingFeatures { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for TreasuryFinancialAccountPendingFeatures { - fn default() -> Self { - Self::CardIssuing - } -} - -/// An enum representing the possible values of an `TreasuryFinancialAccount`'s `restricted_features` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum TreasuryFinancialAccountRestrictedFeatures { - CardIssuing, - DepositInsurance, - #[serde(rename = "financial_addresses.aba")] - FinancialAddressesAba, - #[serde(rename = "inbound_transfers.ach")] - InboundTransfersAch, - IntraStripeFlows, - #[serde(rename = "outbound_payments.ach")] - OutboundPaymentsAch, - #[serde(rename = "outbound_payments.us_domestic_wire")] - OutboundPaymentsUsDomesticWire, - #[serde(rename = "outbound_transfers.ach")] - OutboundTransfersAch, - #[serde(rename = "outbound_transfers.us_domestic_wire")] - OutboundTransfersUsDomesticWire, - RemoteDepositCapture, -} - -impl TreasuryFinancialAccountRestrictedFeatures { - pub fn as_str(self) -> &'static str { - match self { - TreasuryFinancialAccountRestrictedFeatures::CardIssuing => "card_issuing", - TreasuryFinancialAccountRestrictedFeatures::DepositInsurance => "deposit_insurance", - TreasuryFinancialAccountRestrictedFeatures::FinancialAddressesAba => "financial_addresses.aba", - TreasuryFinancialAccountRestrictedFeatures::InboundTransfersAch => "inbound_transfers.ach", - TreasuryFinancialAccountRestrictedFeatures::IntraStripeFlows => "intra_stripe_flows", - TreasuryFinancialAccountRestrictedFeatures::OutboundPaymentsAch => "outbound_payments.ach", - TreasuryFinancialAccountRestrictedFeatures::OutboundPaymentsUsDomesticWire => "outbound_payments.us_domestic_wire", - TreasuryFinancialAccountRestrictedFeatures::OutboundTransfersAch => "outbound_transfers.ach", - TreasuryFinancialAccountRestrictedFeatures::OutboundTransfersUsDomesticWire => "outbound_transfers.us_domestic_wire", - TreasuryFinancialAccountRestrictedFeatures::RemoteDepositCapture => "remote_deposit_capture", - } - } -} - -impl AsRef for TreasuryFinancialAccountRestrictedFeatures { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for TreasuryFinancialAccountRestrictedFeatures { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for TreasuryFinancialAccountRestrictedFeatures { - fn default() -> Self { - Self::CardIssuing - } -} - -/// An enum representing the possible values of an `TreasuryFinancialAccount`'s `status` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum TreasuryFinancialAccountStatus { - Closed, - Open, -} - -impl TreasuryFinancialAccountStatus { - pub fn as_str(self) -> &'static str { - match self { - TreasuryFinancialAccountStatus::Closed => "closed", - TreasuryFinancialAccountStatus::Open => "open", - } - } -} - -impl AsRef for TreasuryFinancialAccountStatus { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for TreasuryFinancialAccountStatus { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for TreasuryFinancialAccountStatus { - fn default() -> Self { - Self::Closed - } -} - -/// An enum representing the possible values of an `TreasuryFinancialAccountsResourceClosedStatusDetails`'s `reasons` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum TreasuryFinancialAccountsResourceClosedStatusDetailsReasons { - AccountRejected, - ClosedByPlatform, - Other, -} - -impl TreasuryFinancialAccountsResourceClosedStatusDetailsReasons { - pub fn as_str(self) -> &'static str { - match self { - TreasuryFinancialAccountsResourceClosedStatusDetailsReasons::AccountRejected => "account_rejected", - TreasuryFinancialAccountsResourceClosedStatusDetailsReasons::ClosedByPlatform => "closed_by_platform", - TreasuryFinancialAccountsResourceClosedStatusDetailsReasons::Other => "other", - } - } -} - -impl AsRef for TreasuryFinancialAccountsResourceClosedStatusDetailsReasons { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for TreasuryFinancialAccountsResourceClosedStatusDetailsReasons { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for TreasuryFinancialAccountsResourceClosedStatusDetailsReasons { - fn default() -> Self { - Self::AccountRejected - } -} - -/// An enum representing the possible values of an `TreasuryFinancialAccountsResourceFinancialAddress`'s `supported_networks` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum TreasuryFinancialAccountsResourceFinancialAddressSupportedNetworks { - Ach, - UsDomesticWire, -} - -impl TreasuryFinancialAccountsResourceFinancialAddressSupportedNetworks { - pub fn as_str(self) -> &'static str { - match self { - TreasuryFinancialAccountsResourceFinancialAddressSupportedNetworks::Ach => "ach", - TreasuryFinancialAccountsResourceFinancialAddressSupportedNetworks::UsDomesticWire => "us_domestic_wire", - } - } -} - -impl AsRef for TreasuryFinancialAccountsResourceFinancialAddressSupportedNetworks { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for TreasuryFinancialAccountsResourceFinancialAddressSupportedNetworks { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for TreasuryFinancialAccountsResourceFinancialAddressSupportedNetworks { - fn default() -> Self { - Self::Ach - } -} - -/// An enum representing the possible values of an `TreasuryFinancialAccountsResourceFinancialAddress`'s `type` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum TreasuryFinancialAccountsResourceFinancialAddressType { - Aba, -} - -impl TreasuryFinancialAccountsResourceFinancialAddressType { - pub fn as_str(self) -> &'static str { - match self { - TreasuryFinancialAccountsResourceFinancialAddressType::Aba => "aba", - } - } -} - -impl AsRef for TreasuryFinancialAccountsResourceFinancialAddressType { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for TreasuryFinancialAccountsResourceFinancialAddressType { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for TreasuryFinancialAccountsResourceFinancialAddressType { - fn default() -> Self { - Self::Aba - } -} - -/// An enum representing the possible values of an `TreasuryFinancialAccountsResourcePlatformRestrictions`'s `inbound_flows` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum TreasuryFinancialAccountsResourcePlatformRestrictionsInboundFlows { - Restricted, - Unrestricted, -} - -impl TreasuryFinancialAccountsResourcePlatformRestrictionsInboundFlows { - pub fn as_str(self) -> &'static str { - match self { - TreasuryFinancialAccountsResourcePlatformRestrictionsInboundFlows::Restricted => "restricted", - TreasuryFinancialAccountsResourcePlatformRestrictionsInboundFlows::Unrestricted => "unrestricted", - } - } -} - -impl AsRef for TreasuryFinancialAccountsResourcePlatformRestrictionsInboundFlows { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for TreasuryFinancialAccountsResourcePlatformRestrictionsInboundFlows { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for TreasuryFinancialAccountsResourcePlatformRestrictionsInboundFlows { - fn default() -> Self { - Self::Restricted - } -} - -/// An enum representing the possible values of an `TreasuryFinancialAccountsResourcePlatformRestrictions`'s `outbound_flows` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum TreasuryFinancialAccountsResourcePlatformRestrictionsOutboundFlows { - Restricted, - Unrestricted, -} - -impl TreasuryFinancialAccountsResourcePlatformRestrictionsOutboundFlows { - pub fn as_str(self) -> &'static str { - match self { - TreasuryFinancialAccountsResourcePlatformRestrictionsOutboundFlows::Restricted => "restricted", - TreasuryFinancialAccountsResourcePlatformRestrictionsOutboundFlows::Unrestricted => "unrestricted", - } - } -} - -impl AsRef for TreasuryFinancialAccountsResourcePlatformRestrictionsOutboundFlows { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for TreasuryFinancialAccountsResourcePlatformRestrictionsOutboundFlows { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for TreasuryFinancialAccountsResourcePlatformRestrictionsOutboundFlows { - fn default() -> Self { - Self::Restricted - } -} diff --git a/src/resources/generated/treasury_financial_account_closed.rs b/src/resources/generated/treasury_financial_account_closed.rs deleted file mode 100644 index 19d51e2f1..000000000 --- a/src/resources/generated/treasury_financial_account_closed.rs +++ /dev/null @@ -1,10 +0,0 @@ -// ====================================== -// This file was automatically generated. -// ====================================== - -use serde::{Deserialize, Serialize}; - -/// The resource representing a Stripe "treasury.financial_account.closed". -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct TreasuryFinancialAccountClosed { -} diff --git a/src/resources/generated/treasury_financial_account_created.rs b/src/resources/generated/treasury_financial_account_created.rs deleted file mode 100644 index ba60b0868..000000000 --- a/src/resources/generated/treasury_financial_account_created.rs +++ /dev/null @@ -1,10 +0,0 @@ -// ====================================== -// This file was automatically generated. -// ====================================== - -use serde::{Deserialize, Serialize}; - -/// The resource representing a Stripe "treasury.financial_account.created". -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct TreasuryFinancialAccountCreated { -} diff --git a/src/resources/generated/treasury_financial_account_features.rs b/src/resources/generated/treasury_financial_account_features.rs deleted file mode 100644 index ba5499f7d..000000000 --- a/src/resources/generated/treasury_financial_account_features.rs +++ /dev/null @@ -1,256 +0,0 @@ -// ====================================== -// This file was automatically generated. -// ====================================== - -use crate::params::{Object}; -use crate::resources::{TreasuryFinancialAccountsResourceAchToggleSettings, TreasuryFinancialAccountsResourceToggleSettings}; -use serde::{Deserialize, Serialize}; - -/// The resource representing a Stripe "TreasuryFinancialAccountsResourceFinancialAccountFeatures". -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct TreasuryFinancialAccountFeatures { - - #[serde(skip_serializing_if = "Option::is_none")] - pub card_issuing: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub deposit_insurance: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub financial_addresses: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub inbound_transfers: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub intra_stripe_flows: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub outbound_payments: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub outbound_transfers: Option, -} - -impl Object for TreasuryFinancialAccountFeatures { - type Id = (); - fn id(&self) -> Self::Id {} - fn object(&self) -> &'static str { - "treasury.financial_account_features" - } -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct TreasuryFinancialAccountsResourceFinancialAddressesFeatures { - - #[serde(skip_serializing_if = "Option::is_none")] - pub aba: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct TreasuryFinancialAccountsResourceAbaToggleSettings { - - /// Whether the FinancialAccount should have the Feature. - pub requested: bool, - - /// Whether the Feature is operational. - pub status: TreasuryFinancialAccountsResourceAbaToggleSettingsStatus, - - /// Additional details; includes at least one entry when the status is not `active`. - pub status_details: Vec, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct TreasuryFinancialAccountsResourceInboundTransfers { - - #[serde(skip_serializing_if = "Option::is_none")] - pub ach: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct TreasuryFinancialAccountsResourceOutboundPayments { - - #[serde(skip_serializing_if = "Option::is_none")] - pub ach: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub us_domestic_wire: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct TreasuryFinancialAccountsResourceOutboundTransfers { - - #[serde(skip_serializing_if = "Option::is_none")] - pub ach: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub us_domestic_wire: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct TreasuryFinancialAccountsResourceTogglesSettingStatusDetails { - - /// Represents the reason why the status is `pending` or `restricted`. - pub code: TreasuryFinancialAccountsResourceTogglesSettingStatusDetailsCode, - - /// Represents what the user should do, if anything, to activate the Feature. - pub resolution: Option, - - /// The `platform_restrictions` that are restricting this Feature. - #[serde(skip_serializing_if = "Option::is_none")] - pub restriction: Option, -} - -/// An enum representing the possible values of an `TreasuryFinancialAccountsResourceAbaToggleSettings`'s `status` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum TreasuryFinancialAccountsResourceAbaToggleSettingsStatus { - Active, - Pending, - Restricted, -} - -impl TreasuryFinancialAccountsResourceAbaToggleSettingsStatus { - pub fn as_str(self) -> &'static str { - match self { - TreasuryFinancialAccountsResourceAbaToggleSettingsStatus::Active => "active", - TreasuryFinancialAccountsResourceAbaToggleSettingsStatus::Pending => "pending", - TreasuryFinancialAccountsResourceAbaToggleSettingsStatus::Restricted => "restricted", - } - } -} - -impl AsRef for TreasuryFinancialAccountsResourceAbaToggleSettingsStatus { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for TreasuryFinancialAccountsResourceAbaToggleSettingsStatus { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for TreasuryFinancialAccountsResourceAbaToggleSettingsStatus { - fn default() -> Self { - Self::Active - } -} - -/// An enum representing the possible values of an `TreasuryFinancialAccountsResourceTogglesSettingStatusDetails`'s `code` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum TreasuryFinancialAccountsResourceTogglesSettingStatusDetailsCode { - Activating, - CapabilityNotRequested, - FinancialAccountClosed, - RejectedOther, - RejectedUnsupportedBusiness, - RequirementsPastDue, - RequirementsPendingVerification, - RestrictedByPlatform, - RestrictedOther, -} - -impl TreasuryFinancialAccountsResourceTogglesSettingStatusDetailsCode { - pub fn as_str(self) -> &'static str { - match self { - TreasuryFinancialAccountsResourceTogglesSettingStatusDetailsCode::Activating => "activating", - TreasuryFinancialAccountsResourceTogglesSettingStatusDetailsCode::CapabilityNotRequested => "capability_not_requested", - TreasuryFinancialAccountsResourceTogglesSettingStatusDetailsCode::FinancialAccountClosed => "financial_account_closed", - TreasuryFinancialAccountsResourceTogglesSettingStatusDetailsCode::RejectedOther => "rejected_other", - TreasuryFinancialAccountsResourceTogglesSettingStatusDetailsCode::RejectedUnsupportedBusiness => "rejected_unsupported_business", - TreasuryFinancialAccountsResourceTogglesSettingStatusDetailsCode::RequirementsPastDue => "requirements_past_due", - TreasuryFinancialAccountsResourceTogglesSettingStatusDetailsCode::RequirementsPendingVerification => "requirements_pending_verification", - TreasuryFinancialAccountsResourceTogglesSettingStatusDetailsCode::RestrictedByPlatform => "restricted_by_platform", - TreasuryFinancialAccountsResourceTogglesSettingStatusDetailsCode::RestrictedOther => "restricted_other", - } - } -} - -impl AsRef for TreasuryFinancialAccountsResourceTogglesSettingStatusDetailsCode { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for TreasuryFinancialAccountsResourceTogglesSettingStatusDetailsCode { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for TreasuryFinancialAccountsResourceTogglesSettingStatusDetailsCode { - fn default() -> Self { - Self::Activating - } -} - -/// An enum representing the possible values of an `TreasuryFinancialAccountsResourceTogglesSettingStatusDetails`'s `resolution` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum TreasuryFinancialAccountsResourceTogglesSettingStatusDetailsResolution { - ContactStripe, - ProvideInformation, - RemoveRestriction, -} - -impl TreasuryFinancialAccountsResourceTogglesSettingStatusDetailsResolution { - pub fn as_str(self) -> &'static str { - match self { - TreasuryFinancialAccountsResourceTogglesSettingStatusDetailsResolution::ContactStripe => "contact_stripe", - TreasuryFinancialAccountsResourceTogglesSettingStatusDetailsResolution::ProvideInformation => "provide_information", - TreasuryFinancialAccountsResourceTogglesSettingStatusDetailsResolution::RemoveRestriction => "remove_restriction", - } - } -} - -impl AsRef for TreasuryFinancialAccountsResourceTogglesSettingStatusDetailsResolution { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for TreasuryFinancialAccountsResourceTogglesSettingStatusDetailsResolution { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for TreasuryFinancialAccountsResourceTogglesSettingStatusDetailsResolution { - fn default() -> Self { - Self::ContactStripe - } -} - -/// An enum representing the possible values of an `TreasuryFinancialAccountsResourceTogglesSettingStatusDetails`'s `restriction` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum TreasuryFinancialAccountsResourceTogglesSettingStatusDetailsRestriction { - InboundFlows, - OutboundFlows, -} - -impl TreasuryFinancialAccountsResourceTogglesSettingStatusDetailsRestriction { - pub fn as_str(self) -> &'static str { - match self { - TreasuryFinancialAccountsResourceTogglesSettingStatusDetailsRestriction::InboundFlows => "inbound_flows", - TreasuryFinancialAccountsResourceTogglesSettingStatusDetailsRestriction::OutboundFlows => "outbound_flows", - } - } -} - -impl AsRef for TreasuryFinancialAccountsResourceTogglesSettingStatusDetailsRestriction { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for TreasuryFinancialAccountsResourceTogglesSettingStatusDetailsRestriction { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for TreasuryFinancialAccountsResourceTogglesSettingStatusDetailsRestriction { - fn default() -> Self { - Self::InboundFlows - } -} diff --git a/src/resources/generated/treasury_financial_account_features_status_updated.rs b/src/resources/generated/treasury_financial_account_features_status_updated.rs deleted file mode 100644 index 5820ec134..000000000 --- a/src/resources/generated/treasury_financial_account_features_status_updated.rs +++ /dev/null @@ -1,10 +0,0 @@ -// ====================================== -// This file was automatically generated. -// ====================================== - -use serde::{Deserialize, Serialize}; - -/// The resource representing a Stripe "treasury.financial_account.features_status_updated". -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct TreasuryFinancialAccountFeaturesStatusUpdated { -} diff --git a/src/resources/generated/treasury_financial_accounts_resource_ach_toggle_settings.rs b/src/resources/generated/treasury_financial_accounts_resource_ach_toggle_settings.rs deleted file mode 100644 index 133e36bd8..000000000 --- a/src/resources/generated/treasury_financial_accounts_resource_ach_toggle_settings.rs +++ /dev/null @@ -1,187 +0,0 @@ -// ====================================== -// This file was automatically generated. -// ====================================== - -use serde::{Deserialize, Serialize}; - -/// The resource representing a Stripe "TreasuryFinancialAccountsResourceAchToggleSettings". -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct TreasuryFinancialAccountsResourceAchToggleSettings { - - /// Whether the FinancialAccount should have the Feature. - pub requested: bool, - - /// Whether the Feature is operational. - pub status: TreasuryFinancialAccountsResourceAchToggleSettingsStatus, - - /// Additional details; includes at least one entry when the status is not `active`. - pub status_details: Vec, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct TreasuryFinancialAccountsResourceTogglesSettingStatusDetails { - - /// Represents the reason why the status is `pending` or `restricted`. - pub code: TreasuryFinancialAccountsResourceTogglesSettingStatusDetailsCode, - - /// Represents what the user should do, if anything, to activate the Feature. - pub resolution: Option, - - /// The `platform_restrictions` that are restricting this Feature. - #[serde(skip_serializing_if = "Option::is_none")] - pub restriction: Option, -} - -/// An enum representing the possible values of an `TreasuryFinancialAccountsResourceAchToggleSettings`'s `status` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum TreasuryFinancialAccountsResourceAchToggleSettingsStatus { - Active, - Pending, - Restricted, -} - -impl TreasuryFinancialAccountsResourceAchToggleSettingsStatus { - pub fn as_str(self) -> &'static str { - match self { - TreasuryFinancialAccountsResourceAchToggleSettingsStatus::Active => "active", - TreasuryFinancialAccountsResourceAchToggleSettingsStatus::Pending => "pending", - TreasuryFinancialAccountsResourceAchToggleSettingsStatus::Restricted => "restricted", - } - } -} - -impl AsRef for TreasuryFinancialAccountsResourceAchToggleSettingsStatus { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for TreasuryFinancialAccountsResourceAchToggleSettingsStatus { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for TreasuryFinancialAccountsResourceAchToggleSettingsStatus { - fn default() -> Self { - Self::Active - } -} - -/// An enum representing the possible values of an `TreasuryFinancialAccountsResourceTogglesSettingStatusDetails`'s `code` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum TreasuryFinancialAccountsResourceTogglesSettingStatusDetailsCode { - Activating, - CapabilityNotRequested, - FinancialAccountClosed, - RejectedOther, - RejectedUnsupportedBusiness, - RequirementsPastDue, - RequirementsPendingVerification, - RestrictedByPlatform, - RestrictedOther, -} - -impl TreasuryFinancialAccountsResourceTogglesSettingStatusDetailsCode { - pub fn as_str(self) -> &'static str { - match self { - TreasuryFinancialAccountsResourceTogglesSettingStatusDetailsCode::Activating => "activating", - TreasuryFinancialAccountsResourceTogglesSettingStatusDetailsCode::CapabilityNotRequested => "capability_not_requested", - TreasuryFinancialAccountsResourceTogglesSettingStatusDetailsCode::FinancialAccountClosed => "financial_account_closed", - TreasuryFinancialAccountsResourceTogglesSettingStatusDetailsCode::RejectedOther => "rejected_other", - TreasuryFinancialAccountsResourceTogglesSettingStatusDetailsCode::RejectedUnsupportedBusiness => "rejected_unsupported_business", - TreasuryFinancialAccountsResourceTogglesSettingStatusDetailsCode::RequirementsPastDue => "requirements_past_due", - TreasuryFinancialAccountsResourceTogglesSettingStatusDetailsCode::RequirementsPendingVerification => "requirements_pending_verification", - TreasuryFinancialAccountsResourceTogglesSettingStatusDetailsCode::RestrictedByPlatform => "restricted_by_platform", - TreasuryFinancialAccountsResourceTogglesSettingStatusDetailsCode::RestrictedOther => "restricted_other", - } - } -} - -impl AsRef for TreasuryFinancialAccountsResourceTogglesSettingStatusDetailsCode { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for TreasuryFinancialAccountsResourceTogglesSettingStatusDetailsCode { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for TreasuryFinancialAccountsResourceTogglesSettingStatusDetailsCode { - fn default() -> Self { - Self::Activating - } -} - -/// An enum representing the possible values of an `TreasuryFinancialAccountsResourceTogglesSettingStatusDetails`'s `resolution` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum TreasuryFinancialAccountsResourceTogglesSettingStatusDetailsResolution { - ContactStripe, - ProvideInformation, - RemoveRestriction, -} - -impl TreasuryFinancialAccountsResourceTogglesSettingStatusDetailsResolution { - pub fn as_str(self) -> &'static str { - match self { - TreasuryFinancialAccountsResourceTogglesSettingStatusDetailsResolution::ContactStripe => "contact_stripe", - TreasuryFinancialAccountsResourceTogglesSettingStatusDetailsResolution::ProvideInformation => "provide_information", - TreasuryFinancialAccountsResourceTogglesSettingStatusDetailsResolution::RemoveRestriction => "remove_restriction", - } - } -} - -impl AsRef for TreasuryFinancialAccountsResourceTogglesSettingStatusDetailsResolution { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for TreasuryFinancialAccountsResourceTogglesSettingStatusDetailsResolution { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for TreasuryFinancialAccountsResourceTogglesSettingStatusDetailsResolution { - fn default() -> Self { - Self::ContactStripe - } -} - -/// An enum representing the possible values of an `TreasuryFinancialAccountsResourceTogglesSettingStatusDetails`'s `restriction` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum TreasuryFinancialAccountsResourceTogglesSettingStatusDetailsRestriction { - InboundFlows, - OutboundFlows, -} - -impl TreasuryFinancialAccountsResourceTogglesSettingStatusDetailsRestriction { - pub fn as_str(self) -> &'static str { - match self { - TreasuryFinancialAccountsResourceTogglesSettingStatusDetailsRestriction::InboundFlows => "inbound_flows", - TreasuryFinancialAccountsResourceTogglesSettingStatusDetailsRestriction::OutboundFlows => "outbound_flows", - } - } -} - -impl AsRef for TreasuryFinancialAccountsResourceTogglesSettingStatusDetailsRestriction { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for TreasuryFinancialAccountsResourceTogglesSettingStatusDetailsRestriction { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for TreasuryFinancialAccountsResourceTogglesSettingStatusDetailsRestriction { - fn default() -> Self { - Self::InboundFlows - } -} diff --git a/src/resources/generated/treasury_financial_accounts_resource_toggle_settings.rs b/src/resources/generated/treasury_financial_accounts_resource_toggle_settings.rs deleted file mode 100644 index 951ff1c63..000000000 --- a/src/resources/generated/treasury_financial_accounts_resource_toggle_settings.rs +++ /dev/null @@ -1,187 +0,0 @@ -// ====================================== -// This file was automatically generated. -// ====================================== - -use serde::{Deserialize, Serialize}; - -/// The resource representing a Stripe "TreasuryFinancialAccountsResourceToggleSettings". -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct TreasuryFinancialAccountsResourceToggleSettings { - - /// Whether the FinancialAccount should have the Feature. - pub requested: bool, - - /// Whether the Feature is operational. - pub status: TreasuryFinancialAccountsResourceToggleSettingsStatus, - - /// Additional details; includes at least one entry when the status is not `active`. - pub status_details: Vec, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct TreasuryFinancialAccountsResourceTogglesSettingStatusDetails { - - /// Represents the reason why the status is `pending` or `restricted`. - pub code: TreasuryFinancialAccountsResourceTogglesSettingStatusDetailsCode, - - /// Represents what the user should do, if anything, to activate the Feature. - pub resolution: Option, - - /// The `platform_restrictions` that are restricting this Feature. - #[serde(skip_serializing_if = "Option::is_none")] - pub restriction: Option, -} - -/// An enum representing the possible values of an `TreasuryFinancialAccountsResourceToggleSettings`'s `status` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum TreasuryFinancialAccountsResourceToggleSettingsStatus { - Active, - Pending, - Restricted, -} - -impl TreasuryFinancialAccountsResourceToggleSettingsStatus { - pub fn as_str(self) -> &'static str { - match self { - TreasuryFinancialAccountsResourceToggleSettingsStatus::Active => "active", - TreasuryFinancialAccountsResourceToggleSettingsStatus::Pending => "pending", - TreasuryFinancialAccountsResourceToggleSettingsStatus::Restricted => "restricted", - } - } -} - -impl AsRef for TreasuryFinancialAccountsResourceToggleSettingsStatus { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for TreasuryFinancialAccountsResourceToggleSettingsStatus { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for TreasuryFinancialAccountsResourceToggleSettingsStatus { - fn default() -> Self { - Self::Active - } -} - -/// An enum representing the possible values of an `TreasuryFinancialAccountsResourceTogglesSettingStatusDetails`'s `code` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum TreasuryFinancialAccountsResourceTogglesSettingStatusDetailsCode { - Activating, - CapabilityNotRequested, - FinancialAccountClosed, - RejectedOther, - RejectedUnsupportedBusiness, - RequirementsPastDue, - RequirementsPendingVerification, - RestrictedByPlatform, - RestrictedOther, -} - -impl TreasuryFinancialAccountsResourceTogglesSettingStatusDetailsCode { - pub fn as_str(self) -> &'static str { - match self { - TreasuryFinancialAccountsResourceTogglesSettingStatusDetailsCode::Activating => "activating", - TreasuryFinancialAccountsResourceTogglesSettingStatusDetailsCode::CapabilityNotRequested => "capability_not_requested", - TreasuryFinancialAccountsResourceTogglesSettingStatusDetailsCode::FinancialAccountClosed => "financial_account_closed", - TreasuryFinancialAccountsResourceTogglesSettingStatusDetailsCode::RejectedOther => "rejected_other", - TreasuryFinancialAccountsResourceTogglesSettingStatusDetailsCode::RejectedUnsupportedBusiness => "rejected_unsupported_business", - TreasuryFinancialAccountsResourceTogglesSettingStatusDetailsCode::RequirementsPastDue => "requirements_past_due", - TreasuryFinancialAccountsResourceTogglesSettingStatusDetailsCode::RequirementsPendingVerification => "requirements_pending_verification", - TreasuryFinancialAccountsResourceTogglesSettingStatusDetailsCode::RestrictedByPlatform => "restricted_by_platform", - TreasuryFinancialAccountsResourceTogglesSettingStatusDetailsCode::RestrictedOther => "restricted_other", - } - } -} - -impl AsRef for TreasuryFinancialAccountsResourceTogglesSettingStatusDetailsCode { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for TreasuryFinancialAccountsResourceTogglesSettingStatusDetailsCode { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for TreasuryFinancialAccountsResourceTogglesSettingStatusDetailsCode { - fn default() -> Self { - Self::Activating - } -} - -/// An enum representing the possible values of an `TreasuryFinancialAccountsResourceTogglesSettingStatusDetails`'s `resolution` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum TreasuryFinancialAccountsResourceTogglesSettingStatusDetailsResolution { - ContactStripe, - ProvideInformation, - RemoveRestriction, -} - -impl TreasuryFinancialAccountsResourceTogglesSettingStatusDetailsResolution { - pub fn as_str(self) -> &'static str { - match self { - TreasuryFinancialAccountsResourceTogglesSettingStatusDetailsResolution::ContactStripe => "contact_stripe", - TreasuryFinancialAccountsResourceTogglesSettingStatusDetailsResolution::ProvideInformation => "provide_information", - TreasuryFinancialAccountsResourceTogglesSettingStatusDetailsResolution::RemoveRestriction => "remove_restriction", - } - } -} - -impl AsRef for TreasuryFinancialAccountsResourceTogglesSettingStatusDetailsResolution { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for TreasuryFinancialAccountsResourceTogglesSettingStatusDetailsResolution { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for TreasuryFinancialAccountsResourceTogglesSettingStatusDetailsResolution { - fn default() -> Self { - Self::ContactStripe - } -} - -/// An enum representing the possible values of an `TreasuryFinancialAccountsResourceTogglesSettingStatusDetails`'s `restriction` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum TreasuryFinancialAccountsResourceTogglesSettingStatusDetailsRestriction { - InboundFlows, - OutboundFlows, -} - -impl TreasuryFinancialAccountsResourceTogglesSettingStatusDetailsRestriction { - pub fn as_str(self) -> &'static str { - match self { - TreasuryFinancialAccountsResourceTogglesSettingStatusDetailsRestriction::InboundFlows => "inbound_flows", - TreasuryFinancialAccountsResourceTogglesSettingStatusDetailsRestriction::OutboundFlows => "outbound_flows", - } - } -} - -impl AsRef for TreasuryFinancialAccountsResourceTogglesSettingStatusDetailsRestriction { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for TreasuryFinancialAccountsResourceTogglesSettingStatusDetailsRestriction { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for TreasuryFinancialAccountsResourceTogglesSettingStatusDetailsRestriction { - fn default() -> Self { - Self::InboundFlows - } -} diff --git a/src/resources/generated/treasury_inbound_transfer.rs b/src/resources/generated/treasury_inbound_transfer.rs deleted file mode 100644 index d8c2013bc..000000000 --- a/src/resources/generated/treasury_inbound_transfer.rs +++ /dev/null @@ -1,389 +0,0 @@ -// ====================================== -// This file was automatically generated. -// ====================================== - -use crate::ids::{TreasuryInboundTransferId}; -use crate::params::{Expandable, Metadata, Object, Timestamp}; -use crate::resources::{Currency, TreasurySharedResourceBillingDetails, TreasuryTransaction}; -use serde::{Deserialize, Serialize}; - -/// The resource representing a Stripe "TreasuryInboundTransfersResourceInboundTransfer". -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct TreasuryInboundTransfer { - /// Unique identifier for the object. - pub id: TreasuryInboundTransferId, - - /// Amount (in cents) transferred. - pub amount: i64, - - /// Returns `true` if the InboundTransfer is able to be canceled. - pub cancelable: bool, - - /// Time at which the object was created. - /// - /// Measured in seconds since the Unix epoch. - pub created: Timestamp, - - /// Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. - /// - /// Must be a [supported currency](https://stripe.com/docs/currencies). - pub currency: Currency, - - /// An arbitrary string attached to the object. - /// - /// Often useful for displaying to users. - pub description: Option, - - /// Details about this InboundTransfer's failure. - /// - /// Only set when status is `failed`. - pub failure_details: Option, - - /// The FinancialAccount that received the funds. - pub financial_account: String, - - /// A [hosted transaction receipt](https://stripe.com/docs/treasury/moving-money/regulatory-receipts) URL that is provided when money movement is considered regulated under Stripe's money transmission licenses. - pub hosted_regulatory_receipt_url: Option, - - pub linked_flows: TreasuryInboundTransfersResourceInboundTransferResourceLinkedFlows, - - /// Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. - pub livemode: bool, - - /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. - /// - /// This can be useful for storing additional information about the object in a structured format. - pub metadata: Metadata, - - /// The origin payment method to be debited for an InboundTransfer. - pub origin_payment_method: String, - - /// Details about the PaymentMethod for an InboundTransfer. - pub origin_payment_method_details: Option, - - /// Returns `true` if the funds for an InboundTransfer were returned after the InboundTransfer went to the `succeeded` state. - pub returned: Option, - - /// Statement descriptor shown when funds are debited from the source. - /// - /// Not all payment networks support `statement_descriptor`. - pub statement_descriptor: String, - - /// Status of the InboundTransfer: `processing`, `succeeded`, `failed`, and `canceled`. - /// - /// An InboundTransfer is `processing` if it is created and pending. - /// The status changes to `succeeded` once the funds have been "confirmed" and a `transaction` is created and posted. - /// The status changes to `failed` if the transfer fails. - pub status: TreasuryInboundTransferStatus, - - pub status_transitions: TreasuryInboundTransfersResourceInboundTransferResourceStatusTransitions, - - /// The Transaction associated with this object. - pub transaction: Option>, -} - -impl Object for TreasuryInboundTransfer { - type Id = TreasuryInboundTransferId; - fn id(&self) -> Self::Id { - self.id.clone() - } - fn object(&self) -> &'static str { - "treasury.inbound_transfer" - } -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct InboundTransfers { - - pub billing_details: TreasurySharedResourceBillingDetails, - - /// The type of the payment method used in the InboundTransfer. - #[serde(rename = "type")] - pub type_: InboundTransfersType, - - #[serde(skip_serializing_if = "Option::is_none")] - pub us_bank_account: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct InboundTransfersPaymentMethodDetailsUsBankAccount { - - /// Account holder type: individual or company. - pub account_holder_type: Option, - - /// Account type: checkings or savings. - /// - /// Defaults to checking if omitted. - pub account_type: Option, - - /// Name of the bank associated with the bank account. - pub bank_name: Option, - - /// Uniquely identifies this particular bank account. - /// - /// You can use this attribute to check whether two bank accounts are the same. - pub fingerprint: Option, - - /// Last four digits of the bank account number. - pub last4: Option, - - /// The US bank account network used to debit funds. - pub network: InboundTransfersPaymentMethodDetailsUsBankAccountNetwork, - - /// Routing number of the bank account. - pub routing_number: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct TreasuryInboundTransfersResourceFailureDetails { - - /// Reason for the failure. - pub code: TreasuryInboundTransfersResourceFailureDetailsCode, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct TreasuryInboundTransfersResourceInboundTransferResourceLinkedFlows { - - /// If funds for this flow were returned after the flow went to the `succeeded` state, this field contains a reference to the ReceivedDebit return. - pub received_debit: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct TreasuryInboundTransfersResourceInboundTransferResourceStatusTransitions { - - /// Timestamp describing when an InboundTransfer changed status to `canceled`. - #[serde(skip_serializing_if = "Option::is_none")] - pub canceled_at: Option, - - /// Timestamp describing when an InboundTransfer changed status to `failed`. - pub failed_at: Option, - - /// Timestamp describing when an InboundTransfer changed status to `succeeded`. - pub succeeded_at: Option, -} - -/// An enum representing the possible values of an `InboundTransfersPaymentMethodDetailsUsBankAccount`'s `account_holder_type` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum InboundTransfersPaymentMethodDetailsUsBankAccountAccountHolderType { - Company, - Individual, -} - -impl InboundTransfersPaymentMethodDetailsUsBankAccountAccountHolderType { - pub fn as_str(self) -> &'static str { - match self { - InboundTransfersPaymentMethodDetailsUsBankAccountAccountHolderType::Company => "company", - InboundTransfersPaymentMethodDetailsUsBankAccountAccountHolderType::Individual => "individual", - } - } -} - -impl AsRef for InboundTransfersPaymentMethodDetailsUsBankAccountAccountHolderType { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for InboundTransfersPaymentMethodDetailsUsBankAccountAccountHolderType { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for InboundTransfersPaymentMethodDetailsUsBankAccountAccountHolderType { - fn default() -> Self { - Self::Company - } -} - -/// An enum representing the possible values of an `InboundTransfersPaymentMethodDetailsUsBankAccount`'s `account_type` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum InboundTransfersPaymentMethodDetailsUsBankAccountAccountType { - Checking, - Savings, -} - -impl InboundTransfersPaymentMethodDetailsUsBankAccountAccountType { - pub fn as_str(self) -> &'static str { - match self { - InboundTransfersPaymentMethodDetailsUsBankAccountAccountType::Checking => "checking", - InboundTransfersPaymentMethodDetailsUsBankAccountAccountType::Savings => "savings", - } - } -} - -impl AsRef for InboundTransfersPaymentMethodDetailsUsBankAccountAccountType { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for InboundTransfersPaymentMethodDetailsUsBankAccountAccountType { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for InboundTransfersPaymentMethodDetailsUsBankAccountAccountType { - fn default() -> Self { - Self::Checking - } -} - -/// An enum representing the possible values of an `InboundTransfersPaymentMethodDetailsUsBankAccount`'s `network` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum InboundTransfersPaymentMethodDetailsUsBankAccountNetwork { - Ach, -} - -impl InboundTransfersPaymentMethodDetailsUsBankAccountNetwork { - pub fn as_str(self) -> &'static str { - match self { - InboundTransfersPaymentMethodDetailsUsBankAccountNetwork::Ach => "ach", - } - } -} - -impl AsRef for InboundTransfersPaymentMethodDetailsUsBankAccountNetwork { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for InboundTransfersPaymentMethodDetailsUsBankAccountNetwork { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for InboundTransfersPaymentMethodDetailsUsBankAccountNetwork { - fn default() -> Self { - Self::Ach - } -} - -/// An enum representing the possible values of an `InboundTransfers`'s `type` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum InboundTransfersType { - UsBankAccount, -} - -impl InboundTransfersType { - pub fn as_str(self) -> &'static str { - match self { - InboundTransfersType::UsBankAccount => "us_bank_account", - } - } -} - -impl AsRef for InboundTransfersType { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for InboundTransfersType { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for InboundTransfersType { - fn default() -> Self { - Self::UsBankAccount - } -} - -/// An enum representing the possible values of an `TreasuryInboundTransfer`'s `status` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum TreasuryInboundTransferStatus { - Canceled, - Failed, - Processing, - Succeeded, -} - -impl TreasuryInboundTransferStatus { - pub fn as_str(self) -> &'static str { - match self { - TreasuryInboundTransferStatus::Canceled => "canceled", - TreasuryInboundTransferStatus::Failed => "failed", - TreasuryInboundTransferStatus::Processing => "processing", - TreasuryInboundTransferStatus::Succeeded => "succeeded", - } - } -} - -impl AsRef for TreasuryInboundTransferStatus { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for TreasuryInboundTransferStatus { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for TreasuryInboundTransferStatus { - fn default() -> Self { - Self::Canceled - } -} - -/// An enum representing the possible values of an `TreasuryInboundTransfersResourceFailureDetails`'s `code` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum TreasuryInboundTransfersResourceFailureDetailsCode { - AccountClosed, - AccountFrozen, - BankAccountRestricted, - BankOwnershipChanged, - DebitNotAuthorized, - IncorrectAccountHolderAddress, - IncorrectAccountHolderName, - IncorrectAccountHolderTaxId, - InsufficientFunds, - InvalidAccountNumber, - InvalidCurrency, - NoAccount, - Other, -} - -impl TreasuryInboundTransfersResourceFailureDetailsCode { - pub fn as_str(self) -> &'static str { - match self { - TreasuryInboundTransfersResourceFailureDetailsCode::AccountClosed => "account_closed", - TreasuryInboundTransfersResourceFailureDetailsCode::AccountFrozen => "account_frozen", - TreasuryInboundTransfersResourceFailureDetailsCode::BankAccountRestricted => "bank_account_restricted", - TreasuryInboundTransfersResourceFailureDetailsCode::BankOwnershipChanged => "bank_ownership_changed", - TreasuryInboundTransfersResourceFailureDetailsCode::DebitNotAuthorized => "debit_not_authorized", - TreasuryInboundTransfersResourceFailureDetailsCode::IncorrectAccountHolderAddress => "incorrect_account_holder_address", - TreasuryInboundTransfersResourceFailureDetailsCode::IncorrectAccountHolderName => "incorrect_account_holder_name", - TreasuryInboundTransfersResourceFailureDetailsCode::IncorrectAccountHolderTaxId => "incorrect_account_holder_tax_id", - TreasuryInboundTransfersResourceFailureDetailsCode::InsufficientFunds => "insufficient_funds", - TreasuryInboundTransfersResourceFailureDetailsCode::InvalidAccountNumber => "invalid_account_number", - TreasuryInboundTransfersResourceFailureDetailsCode::InvalidCurrency => "invalid_currency", - TreasuryInboundTransfersResourceFailureDetailsCode::NoAccount => "no_account", - TreasuryInboundTransfersResourceFailureDetailsCode::Other => "other", - } - } -} - -impl AsRef for TreasuryInboundTransfersResourceFailureDetailsCode { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for TreasuryInboundTransfersResourceFailureDetailsCode { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for TreasuryInboundTransfersResourceFailureDetailsCode { - fn default() -> Self { - Self::AccountClosed - } -} diff --git a/src/resources/generated/treasury_inbound_transfer_canceled.rs b/src/resources/generated/treasury_inbound_transfer_canceled.rs deleted file mode 100644 index e31160200..000000000 --- a/src/resources/generated/treasury_inbound_transfer_canceled.rs +++ /dev/null @@ -1,10 +0,0 @@ -// ====================================== -// This file was automatically generated. -// ====================================== - -use serde::{Deserialize, Serialize}; - -/// The resource representing a Stripe "treasury.inbound_transfer.canceled". -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct TreasuryInboundTransferCanceled { -} diff --git a/src/resources/generated/treasury_inbound_transfer_created.rs b/src/resources/generated/treasury_inbound_transfer_created.rs deleted file mode 100644 index 779fd4630..000000000 --- a/src/resources/generated/treasury_inbound_transfer_created.rs +++ /dev/null @@ -1,10 +0,0 @@ -// ====================================== -// This file was automatically generated. -// ====================================== - -use serde::{Deserialize, Serialize}; - -/// The resource representing a Stripe "treasury.inbound_transfer.created". -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct TreasuryInboundTransferCreated { -} diff --git a/src/resources/generated/treasury_inbound_transfer_failed.rs b/src/resources/generated/treasury_inbound_transfer_failed.rs deleted file mode 100644 index f61307820..000000000 --- a/src/resources/generated/treasury_inbound_transfer_failed.rs +++ /dev/null @@ -1,10 +0,0 @@ -// ====================================== -// This file was automatically generated. -// ====================================== - -use serde::{Deserialize, Serialize}; - -/// The resource representing a Stripe "treasury.inbound_transfer.failed". -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct TreasuryInboundTransferFailed { -} diff --git a/src/resources/generated/treasury_inbound_transfer_succeeded.rs b/src/resources/generated/treasury_inbound_transfer_succeeded.rs deleted file mode 100644 index 6ec140991..000000000 --- a/src/resources/generated/treasury_inbound_transfer_succeeded.rs +++ /dev/null @@ -1,10 +0,0 @@ -// ====================================== -// This file was automatically generated. -// ====================================== - -use serde::{Deserialize, Serialize}; - -/// The resource representing a Stripe "treasury.inbound_transfer.succeeded". -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct TreasuryInboundTransferSucceeded { -} diff --git a/src/resources/generated/treasury_outbound_payment.rs b/src/resources/generated/treasury_outbound_payment.rs deleted file mode 100644 index 5e9a7826f..000000000 --- a/src/resources/generated/treasury_outbound_payment.rs +++ /dev/null @@ -1,452 +0,0 @@ -// ====================================== -// This file was automatically generated. -// ====================================== - -use crate::ids::{TreasuryOutboundPaymentId}; -use crate::params::{Expandable, Metadata, Object, Timestamp}; -use crate::resources::{Currency, TreasurySharedResourceBillingDetails, TreasuryTransaction}; -use serde::{Deserialize, Serialize}; - -/// The resource representing a Stripe "TreasuryOutboundPaymentsResourceOutboundPayment". -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct TreasuryOutboundPayment { - /// Unique identifier for the object. - pub id: TreasuryOutboundPaymentId, - - /// Amount (in cents) transferred. - pub amount: i64, - - /// Returns `true` if the object can be canceled, and `false` otherwise. - pub cancelable: bool, - - /// Time at which the object was created. - /// - /// Measured in seconds since the Unix epoch. - pub created: Timestamp, - - /// Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. - /// - /// Must be a [supported currency](https://stripe.com/docs/currencies). - pub currency: Currency, - - /// ID of the [customer](https://stripe.com/docs/api/customers) to whom an OutboundPayment is sent. - pub customer: Option, - - /// An arbitrary string attached to the object. - /// - /// Often useful for displaying to users. - pub description: Option, - - /// The PaymentMethod via which an OutboundPayment is sent. - /// - /// This field can be empty if the OutboundPayment was created using `destination_payment_method_data`. - pub destination_payment_method: Option, - - /// Details about the PaymentMethod for an OutboundPayment. - pub destination_payment_method_details: Option, - - /// Details about the end user. - pub end_user_details: Option, - - /// The date when funds are expected to arrive in the destination account. - pub expected_arrival_date: Timestamp, - - /// The FinancialAccount that funds were pulled from. - pub financial_account: String, - - /// A [hosted transaction receipt](https://stripe.com/docs/treasury/moving-money/regulatory-receipts) URL that is provided when money movement is considered regulated under Stripe's money transmission licenses. - pub hosted_regulatory_receipt_url: Option, - - /// Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. - pub livemode: bool, - - /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. - /// - /// This can be useful for storing additional information about the object in a structured format. - pub metadata: Metadata, - - /// Details about a returned OutboundPayment. - /// - /// Only set when the status is `returned`. - pub returned_details: Option, - - /// The description that appears on the receiving end for an OutboundPayment (for example, bank statement for external bank transfer). - pub statement_descriptor: String, - - /// Current status of the OutboundPayment: `processing`, `failed`, `posted`, `returned`, `canceled`. - /// - /// An OutboundPayment is `processing` if it has been created and is pending. - /// The status changes to `posted` once the OutboundPayment has been "confirmed" and funds have left the account, or to `failed` or `canceled`. - /// If an OutboundPayment fails to arrive at its destination, its status will change to `returned`. - pub status: TreasuryOutboundPaymentStatus, - - pub status_transitions: TreasuryOutboundPaymentsResourceOutboundPaymentResourceStatusTransitions, - - /// The Transaction associated with this object. - pub transaction: Expandable, -} - -impl Object for TreasuryOutboundPayment { - type Id = TreasuryOutboundPaymentId; - fn id(&self) -> Self::Id { - self.id.clone() - } - fn object(&self) -> &'static str { - "treasury.outbound_payment" - } -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct OutboundPaymentsPaymentMethodDetails { - - pub billing_details: TreasurySharedResourceBillingDetails, - - #[serde(skip_serializing_if = "Option::is_none")] - pub financial_account: Option, - - /// The type of the payment method used in the OutboundPayment. - #[serde(rename = "type")] - pub type_: OutboundPaymentsPaymentMethodDetailsType, - - #[serde(skip_serializing_if = "Option::is_none")] - pub us_bank_account: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct OutboundPaymentsPaymentMethodDetailsFinancialAccount { - - /// Token of the FinancialAccount. - pub id: String, - - /// The rails used to send funds. - pub network: OutboundPaymentsPaymentMethodDetailsFinancialAccountNetwork, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct OutboundPaymentsPaymentMethodDetailsUsBankAccount { - - /// Account holder type: individual or company. - pub account_holder_type: Option, - - /// Account type: checkings or savings. - /// - /// Defaults to checking if omitted. - pub account_type: Option, - - /// Name of the bank associated with the bank account. - pub bank_name: Option, - - /// Uniquely identifies this particular bank account. - /// - /// You can use this attribute to check whether two bank accounts are the same. - pub fingerprint: Option, - - /// Last four digits of the bank account number. - pub last4: Option, - - /// The US bank account network used to send funds. - pub network: OutboundPaymentsPaymentMethodDetailsUsBankAccountNetwork, - - /// Routing number of the bank account. - pub routing_number: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct TreasuryOutboundPaymentsResourceOutboundPaymentResourceEndUserDetails { - - /// IP address of the user initiating the OutboundPayment. - /// - /// Set if `present` is set to `true`. - /// IP address collection is required for risk and compliance reasons. - /// This will be used to help determine if the OutboundPayment is authorized or should be blocked. - pub ip_address: Option, - - /// `true` if the OutboundPayment creation request is being made on behalf of an end user by a platform. - /// - /// Otherwise, `false`. - pub present: bool, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct TreasuryOutboundPaymentsResourceOutboundPaymentResourceStatusTransitions { - - /// Timestamp describing when an OutboundPayment changed status to `canceled`. - pub canceled_at: Option, - - /// Timestamp describing when an OutboundPayment changed status to `failed`. - pub failed_at: Option, - - /// Timestamp describing when an OutboundPayment changed status to `posted`. - pub posted_at: Option, - - /// Timestamp describing when an OutboundPayment changed status to `returned`. - pub returned_at: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct TreasuryOutboundPaymentsResourceReturnedStatus { - - /// Reason for the return. - pub code: TreasuryOutboundPaymentsResourceReturnedStatusCode, - - /// The Transaction associated with this object. - pub transaction: Expandable, -} - -/// An enum representing the possible values of an `OutboundPaymentsPaymentMethodDetailsFinancialAccount`'s `network` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum OutboundPaymentsPaymentMethodDetailsFinancialAccountNetwork { - Stripe, -} - -impl OutboundPaymentsPaymentMethodDetailsFinancialAccountNetwork { - pub fn as_str(self) -> &'static str { - match self { - OutboundPaymentsPaymentMethodDetailsFinancialAccountNetwork::Stripe => "stripe", - } - } -} - -impl AsRef for OutboundPaymentsPaymentMethodDetailsFinancialAccountNetwork { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for OutboundPaymentsPaymentMethodDetailsFinancialAccountNetwork { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for OutboundPaymentsPaymentMethodDetailsFinancialAccountNetwork { - fn default() -> Self { - Self::Stripe - } -} - -/// An enum representing the possible values of an `OutboundPaymentsPaymentMethodDetails`'s `type` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum OutboundPaymentsPaymentMethodDetailsType { - FinancialAccount, - UsBankAccount, -} - -impl OutboundPaymentsPaymentMethodDetailsType { - pub fn as_str(self) -> &'static str { - match self { - OutboundPaymentsPaymentMethodDetailsType::FinancialAccount => "financial_account", - OutboundPaymentsPaymentMethodDetailsType::UsBankAccount => "us_bank_account", - } - } -} - -impl AsRef for OutboundPaymentsPaymentMethodDetailsType { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for OutboundPaymentsPaymentMethodDetailsType { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for OutboundPaymentsPaymentMethodDetailsType { - fn default() -> Self { - Self::FinancialAccount - } -} - -/// An enum representing the possible values of an `OutboundPaymentsPaymentMethodDetailsUsBankAccount`'s `account_holder_type` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum OutboundPaymentsPaymentMethodDetailsUsBankAccountAccountHolderType { - Company, - Individual, -} - -impl OutboundPaymentsPaymentMethodDetailsUsBankAccountAccountHolderType { - pub fn as_str(self) -> &'static str { - match self { - OutboundPaymentsPaymentMethodDetailsUsBankAccountAccountHolderType::Company => "company", - OutboundPaymentsPaymentMethodDetailsUsBankAccountAccountHolderType::Individual => "individual", - } - } -} - -impl AsRef for OutboundPaymentsPaymentMethodDetailsUsBankAccountAccountHolderType { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for OutboundPaymentsPaymentMethodDetailsUsBankAccountAccountHolderType { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for OutboundPaymentsPaymentMethodDetailsUsBankAccountAccountHolderType { - fn default() -> Self { - Self::Company - } -} - -/// An enum representing the possible values of an `OutboundPaymentsPaymentMethodDetailsUsBankAccount`'s `account_type` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum OutboundPaymentsPaymentMethodDetailsUsBankAccountAccountType { - Checking, - Savings, -} - -impl OutboundPaymentsPaymentMethodDetailsUsBankAccountAccountType { - pub fn as_str(self) -> &'static str { - match self { - OutboundPaymentsPaymentMethodDetailsUsBankAccountAccountType::Checking => "checking", - OutboundPaymentsPaymentMethodDetailsUsBankAccountAccountType::Savings => "savings", - } - } -} - -impl AsRef for OutboundPaymentsPaymentMethodDetailsUsBankAccountAccountType { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for OutboundPaymentsPaymentMethodDetailsUsBankAccountAccountType { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for OutboundPaymentsPaymentMethodDetailsUsBankAccountAccountType { - fn default() -> Self { - Self::Checking - } -} - -/// An enum representing the possible values of an `OutboundPaymentsPaymentMethodDetailsUsBankAccount`'s `network` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum OutboundPaymentsPaymentMethodDetailsUsBankAccountNetwork { - Ach, - UsDomesticWire, -} - -impl OutboundPaymentsPaymentMethodDetailsUsBankAccountNetwork { - pub fn as_str(self) -> &'static str { - match self { - OutboundPaymentsPaymentMethodDetailsUsBankAccountNetwork::Ach => "ach", - OutboundPaymentsPaymentMethodDetailsUsBankAccountNetwork::UsDomesticWire => "us_domestic_wire", - } - } -} - -impl AsRef for OutboundPaymentsPaymentMethodDetailsUsBankAccountNetwork { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for OutboundPaymentsPaymentMethodDetailsUsBankAccountNetwork { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for OutboundPaymentsPaymentMethodDetailsUsBankAccountNetwork { - fn default() -> Self { - Self::Ach - } -} - -/// An enum representing the possible values of an `TreasuryOutboundPayment`'s `status` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum TreasuryOutboundPaymentStatus { - Canceled, - Failed, - Posted, - Processing, - Returned, -} - -impl TreasuryOutboundPaymentStatus { - pub fn as_str(self) -> &'static str { - match self { - TreasuryOutboundPaymentStatus::Canceled => "canceled", - TreasuryOutboundPaymentStatus::Failed => "failed", - TreasuryOutboundPaymentStatus::Posted => "posted", - TreasuryOutboundPaymentStatus::Processing => "processing", - TreasuryOutboundPaymentStatus::Returned => "returned", - } - } -} - -impl AsRef for TreasuryOutboundPaymentStatus { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for TreasuryOutboundPaymentStatus { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for TreasuryOutboundPaymentStatus { - fn default() -> Self { - Self::Canceled - } -} - -/// An enum representing the possible values of an `TreasuryOutboundPaymentsResourceReturnedStatus`'s `code` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum TreasuryOutboundPaymentsResourceReturnedStatusCode { - AccountClosed, - AccountFrozen, - BankAccountRestricted, - BankOwnershipChanged, - Declined, - IncorrectAccountHolderName, - InvalidAccountNumber, - InvalidCurrency, - NoAccount, - Other, -} - -impl TreasuryOutboundPaymentsResourceReturnedStatusCode { - pub fn as_str(self) -> &'static str { - match self { - TreasuryOutboundPaymentsResourceReturnedStatusCode::AccountClosed => "account_closed", - TreasuryOutboundPaymentsResourceReturnedStatusCode::AccountFrozen => "account_frozen", - TreasuryOutboundPaymentsResourceReturnedStatusCode::BankAccountRestricted => "bank_account_restricted", - TreasuryOutboundPaymentsResourceReturnedStatusCode::BankOwnershipChanged => "bank_ownership_changed", - TreasuryOutboundPaymentsResourceReturnedStatusCode::Declined => "declined", - TreasuryOutboundPaymentsResourceReturnedStatusCode::IncorrectAccountHolderName => "incorrect_account_holder_name", - TreasuryOutboundPaymentsResourceReturnedStatusCode::InvalidAccountNumber => "invalid_account_number", - TreasuryOutboundPaymentsResourceReturnedStatusCode::InvalidCurrency => "invalid_currency", - TreasuryOutboundPaymentsResourceReturnedStatusCode::NoAccount => "no_account", - TreasuryOutboundPaymentsResourceReturnedStatusCode::Other => "other", - } - } -} - -impl AsRef for TreasuryOutboundPaymentsResourceReturnedStatusCode { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for TreasuryOutboundPaymentsResourceReturnedStatusCode { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for TreasuryOutboundPaymentsResourceReturnedStatusCode { - fn default() -> Self { - Self::AccountClosed - } -} diff --git a/src/resources/generated/treasury_outbound_payment_canceled.rs b/src/resources/generated/treasury_outbound_payment_canceled.rs deleted file mode 100644 index a905f322d..000000000 --- a/src/resources/generated/treasury_outbound_payment_canceled.rs +++ /dev/null @@ -1,10 +0,0 @@ -// ====================================== -// This file was automatically generated. -// ====================================== - -use serde::{Deserialize, Serialize}; - -/// The resource representing a Stripe "treasury.outbound_payment.canceled". -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct TreasuryOutboundPaymentCanceled { -} diff --git a/src/resources/generated/treasury_outbound_payment_created.rs b/src/resources/generated/treasury_outbound_payment_created.rs deleted file mode 100644 index 7fd1ab305..000000000 --- a/src/resources/generated/treasury_outbound_payment_created.rs +++ /dev/null @@ -1,10 +0,0 @@ -// ====================================== -// This file was automatically generated. -// ====================================== - -use serde::{Deserialize, Serialize}; - -/// The resource representing a Stripe "treasury.outbound_payment.created". -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct TreasuryOutboundPaymentCreated { -} diff --git a/src/resources/generated/treasury_outbound_payment_expected_arrival_date_updated.rs b/src/resources/generated/treasury_outbound_payment_expected_arrival_date_updated.rs deleted file mode 100644 index f1c5c5af1..000000000 --- a/src/resources/generated/treasury_outbound_payment_expected_arrival_date_updated.rs +++ /dev/null @@ -1,10 +0,0 @@ -// ====================================== -// This file was automatically generated. -// ====================================== - -use serde::{Deserialize, Serialize}; - -/// The resource representing a Stripe "treasury.outbound_payment.expected_arrival_date_updated". -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct TreasuryOutboundPaymentExpectedArrivalDateUpdated { -} diff --git a/src/resources/generated/treasury_outbound_payment_failed.rs b/src/resources/generated/treasury_outbound_payment_failed.rs deleted file mode 100644 index 4457d3663..000000000 --- a/src/resources/generated/treasury_outbound_payment_failed.rs +++ /dev/null @@ -1,10 +0,0 @@ -// ====================================== -// This file was automatically generated. -// ====================================== - -use serde::{Deserialize, Serialize}; - -/// The resource representing a Stripe "treasury.outbound_payment.failed". -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct TreasuryOutboundPaymentFailed { -} diff --git a/src/resources/generated/treasury_outbound_payment_posted.rs b/src/resources/generated/treasury_outbound_payment_posted.rs deleted file mode 100644 index bc35e58bb..000000000 --- a/src/resources/generated/treasury_outbound_payment_posted.rs +++ /dev/null @@ -1,10 +0,0 @@ -// ====================================== -// This file was automatically generated. -// ====================================== - -use serde::{Deserialize, Serialize}; - -/// The resource representing a Stripe "treasury.outbound_payment.posted". -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct TreasuryOutboundPaymentPosted { -} diff --git a/src/resources/generated/treasury_outbound_payment_returned.rs b/src/resources/generated/treasury_outbound_payment_returned.rs deleted file mode 100644 index aa442e6cb..000000000 --- a/src/resources/generated/treasury_outbound_payment_returned.rs +++ /dev/null @@ -1,10 +0,0 @@ -// ====================================== -// This file was automatically generated. -// ====================================== - -use serde::{Deserialize, Serialize}; - -/// The resource representing a Stripe "treasury.outbound_payment.returned". -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct TreasuryOutboundPaymentReturned { -} diff --git a/src/resources/generated/treasury_outbound_transfer.rs b/src/resources/generated/treasury_outbound_transfer.rs deleted file mode 100644 index 1db7b7dde..000000000 --- a/src/resources/generated/treasury_outbound_transfer.rs +++ /dev/null @@ -1,380 +0,0 @@ -// ====================================== -// This file was automatically generated. -// ====================================== - -use crate::ids::{TreasuryOutboundTransferId}; -use crate::params::{Expandable, Metadata, Object, Timestamp}; -use crate::resources::{Currency, TreasurySharedResourceBillingDetails, TreasuryTransaction}; -use serde::{Deserialize, Serialize}; - -/// The resource representing a Stripe "TreasuryOutboundTransfersResourceOutboundTransfer". -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct TreasuryOutboundTransfer { - /// Unique identifier for the object. - pub id: TreasuryOutboundTransferId, - - /// Amount (in cents) transferred. - pub amount: i64, - - /// Returns `true` if the object can be canceled, and `false` otherwise. - pub cancelable: bool, - - /// Time at which the object was created. - /// - /// Measured in seconds since the Unix epoch. - pub created: Timestamp, - - /// Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. - /// - /// Must be a [supported currency](https://stripe.com/docs/currencies). - pub currency: Currency, - - /// An arbitrary string attached to the object. - /// - /// Often useful for displaying to users. - pub description: Option, - - /// The PaymentMethod used as the payment instrument for an OutboundTransfer. - pub destination_payment_method: Option, - - pub destination_payment_method_details: OutboundTransfersPaymentMethodDetails, - - /// The date when funds are expected to arrive in the destination account. - pub expected_arrival_date: Timestamp, - - /// The FinancialAccount that funds were pulled from. - pub financial_account: String, - - /// A [hosted transaction receipt](https://stripe.com/docs/treasury/moving-money/regulatory-receipts) URL that is provided when money movement is considered regulated under Stripe's money transmission licenses. - pub hosted_regulatory_receipt_url: Option, - - /// Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. - pub livemode: bool, - - /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. - /// - /// This can be useful for storing additional information about the object in a structured format. - pub metadata: Metadata, - - /// Details about a returned OutboundTransfer. - /// - /// Only set when the status is `returned`. - pub returned_details: Option, - - /// Information about the OutboundTransfer to be sent to the recipient account. - pub statement_descriptor: String, - - /// Current status of the OutboundTransfer: `processing`, `failed`, `canceled`, `posted`, `returned`. - /// - /// An OutboundTransfer is `processing` if it has been created and is pending. - /// The status changes to `posted` once the OutboundTransfer has been "confirmed" and funds have left the account, or to `failed` or `canceled`. - /// If an OutboundTransfer fails to arrive at its destination, its status will change to `returned`. - pub status: TreasuryOutboundTransferStatus, - - pub status_transitions: TreasuryOutboundTransfersResourceStatusTransitions, - - /// The Transaction associated with this object. - pub transaction: Expandable, -} - -impl Object for TreasuryOutboundTransfer { - type Id = TreasuryOutboundTransferId; - fn id(&self) -> Self::Id { - self.id.clone() - } - fn object(&self) -> &'static str { - "treasury.outbound_transfer" - } -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct OutboundTransfersPaymentMethodDetails { - - pub billing_details: TreasurySharedResourceBillingDetails, - - /// The type of the payment method used in the OutboundTransfer. - #[serde(rename = "type")] - pub type_: OutboundTransfersPaymentMethodDetailsType, - - #[serde(skip_serializing_if = "Option::is_none")] - pub us_bank_account: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct OutboundTransfersPaymentMethodDetailsUsBankAccount { - - /// Account holder type: individual or company. - pub account_holder_type: Option, - - /// Account type: checkings or savings. - /// - /// Defaults to checking if omitted. - pub account_type: Option, - - /// Name of the bank associated with the bank account. - pub bank_name: Option, - - /// Uniquely identifies this particular bank account. - /// - /// You can use this attribute to check whether two bank accounts are the same. - pub fingerprint: Option, - - /// Last four digits of the bank account number. - pub last4: Option, - - /// The US bank account network used to send funds. - pub network: OutboundTransfersPaymentMethodDetailsUsBankAccountNetwork, - - /// Routing number of the bank account. - pub routing_number: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct TreasuryOutboundTransfersResourceReturnedDetails { - - /// Reason for the return. - pub code: TreasuryOutboundTransfersResourceReturnedDetailsCode, - - /// The Transaction associated with this object. - pub transaction: Expandable, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct TreasuryOutboundTransfersResourceStatusTransitions { - - /// Timestamp describing when an OutboundTransfer changed status to `canceled`. - pub canceled_at: Option, - - /// Timestamp describing when an OutboundTransfer changed status to `failed`. - pub failed_at: Option, - - /// Timestamp describing when an OutboundTransfer changed status to `posted`. - pub posted_at: Option, - - /// Timestamp describing when an OutboundTransfer changed status to `returned`. - pub returned_at: Option, -} - -/// An enum representing the possible values of an `OutboundTransfersPaymentMethodDetails`'s `type` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum OutboundTransfersPaymentMethodDetailsType { - UsBankAccount, -} - -impl OutboundTransfersPaymentMethodDetailsType { - pub fn as_str(self) -> &'static str { - match self { - OutboundTransfersPaymentMethodDetailsType::UsBankAccount => "us_bank_account", - } - } -} - -impl AsRef for OutboundTransfersPaymentMethodDetailsType { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for OutboundTransfersPaymentMethodDetailsType { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for OutboundTransfersPaymentMethodDetailsType { - fn default() -> Self { - Self::UsBankAccount - } -} - -/// An enum representing the possible values of an `OutboundTransfersPaymentMethodDetailsUsBankAccount`'s `account_holder_type` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum OutboundTransfersPaymentMethodDetailsUsBankAccountAccountHolderType { - Company, - Individual, -} - -impl OutboundTransfersPaymentMethodDetailsUsBankAccountAccountHolderType { - pub fn as_str(self) -> &'static str { - match self { - OutboundTransfersPaymentMethodDetailsUsBankAccountAccountHolderType::Company => "company", - OutboundTransfersPaymentMethodDetailsUsBankAccountAccountHolderType::Individual => "individual", - } - } -} - -impl AsRef for OutboundTransfersPaymentMethodDetailsUsBankAccountAccountHolderType { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for OutboundTransfersPaymentMethodDetailsUsBankAccountAccountHolderType { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for OutboundTransfersPaymentMethodDetailsUsBankAccountAccountHolderType { - fn default() -> Self { - Self::Company - } -} - -/// An enum representing the possible values of an `OutboundTransfersPaymentMethodDetailsUsBankAccount`'s `account_type` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum OutboundTransfersPaymentMethodDetailsUsBankAccountAccountType { - Checking, - Savings, -} - -impl OutboundTransfersPaymentMethodDetailsUsBankAccountAccountType { - pub fn as_str(self) -> &'static str { - match self { - OutboundTransfersPaymentMethodDetailsUsBankAccountAccountType::Checking => "checking", - OutboundTransfersPaymentMethodDetailsUsBankAccountAccountType::Savings => "savings", - } - } -} - -impl AsRef for OutboundTransfersPaymentMethodDetailsUsBankAccountAccountType { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for OutboundTransfersPaymentMethodDetailsUsBankAccountAccountType { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for OutboundTransfersPaymentMethodDetailsUsBankAccountAccountType { - fn default() -> Self { - Self::Checking - } -} - -/// An enum representing the possible values of an `OutboundTransfersPaymentMethodDetailsUsBankAccount`'s `network` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum OutboundTransfersPaymentMethodDetailsUsBankAccountNetwork { - Ach, - UsDomesticWire, -} - -impl OutboundTransfersPaymentMethodDetailsUsBankAccountNetwork { - pub fn as_str(self) -> &'static str { - match self { - OutboundTransfersPaymentMethodDetailsUsBankAccountNetwork::Ach => "ach", - OutboundTransfersPaymentMethodDetailsUsBankAccountNetwork::UsDomesticWire => "us_domestic_wire", - } - } -} - -impl AsRef for OutboundTransfersPaymentMethodDetailsUsBankAccountNetwork { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for OutboundTransfersPaymentMethodDetailsUsBankAccountNetwork { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for OutboundTransfersPaymentMethodDetailsUsBankAccountNetwork { - fn default() -> Self { - Self::Ach - } -} - -/// An enum representing the possible values of an `TreasuryOutboundTransfer`'s `status` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum TreasuryOutboundTransferStatus { - Canceled, - Failed, - Posted, - Processing, - Returned, -} - -impl TreasuryOutboundTransferStatus { - pub fn as_str(self) -> &'static str { - match self { - TreasuryOutboundTransferStatus::Canceled => "canceled", - TreasuryOutboundTransferStatus::Failed => "failed", - TreasuryOutboundTransferStatus::Posted => "posted", - TreasuryOutboundTransferStatus::Processing => "processing", - TreasuryOutboundTransferStatus::Returned => "returned", - } - } -} - -impl AsRef for TreasuryOutboundTransferStatus { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for TreasuryOutboundTransferStatus { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for TreasuryOutboundTransferStatus { - fn default() -> Self { - Self::Canceled - } -} - -/// An enum representing the possible values of an `TreasuryOutboundTransfersResourceReturnedDetails`'s `code` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum TreasuryOutboundTransfersResourceReturnedDetailsCode { - AccountClosed, - AccountFrozen, - BankAccountRestricted, - BankOwnershipChanged, - Declined, - IncorrectAccountHolderName, - InvalidAccountNumber, - InvalidCurrency, - NoAccount, - Other, -} - -impl TreasuryOutboundTransfersResourceReturnedDetailsCode { - pub fn as_str(self) -> &'static str { - match self { - TreasuryOutboundTransfersResourceReturnedDetailsCode::AccountClosed => "account_closed", - TreasuryOutboundTransfersResourceReturnedDetailsCode::AccountFrozen => "account_frozen", - TreasuryOutboundTransfersResourceReturnedDetailsCode::BankAccountRestricted => "bank_account_restricted", - TreasuryOutboundTransfersResourceReturnedDetailsCode::BankOwnershipChanged => "bank_ownership_changed", - TreasuryOutboundTransfersResourceReturnedDetailsCode::Declined => "declined", - TreasuryOutboundTransfersResourceReturnedDetailsCode::IncorrectAccountHolderName => "incorrect_account_holder_name", - TreasuryOutboundTransfersResourceReturnedDetailsCode::InvalidAccountNumber => "invalid_account_number", - TreasuryOutboundTransfersResourceReturnedDetailsCode::InvalidCurrency => "invalid_currency", - TreasuryOutboundTransfersResourceReturnedDetailsCode::NoAccount => "no_account", - TreasuryOutboundTransfersResourceReturnedDetailsCode::Other => "other", - } - } -} - -impl AsRef for TreasuryOutboundTransfersResourceReturnedDetailsCode { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for TreasuryOutboundTransfersResourceReturnedDetailsCode { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for TreasuryOutboundTransfersResourceReturnedDetailsCode { - fn default() -> Self { - Self::AccountClosed - } -} diff --git a/src/resources/generated/treasury_outbound_transfer_canceled.rs b/src/resources/generated/treasury_outbound_transfer_canceled.rs deleted file mode 100644 index a541af78c..000000000 --- a/src/resources/generated/treasury_outbound_transfer_canceled.rs +++ /dev/null @@ -1,10 +0,0 @@ -// ====================================== -// This file was automatically generated. -// ====================================== - -use serde::{Deserialize, Serialize}; - -/// The resource representing a Stripe "treasury.outbound_transfer.canceled". -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct TreasuryOutboundTransferCanceled { -} diff --git a/src/resources/generated/treasury_outbound_transfer_created.rs b/src/resources/generated/treasury_outbound_transfer_created.rs deleted file mode 100644 index 902b376c1..000000000 --- a/src/resources/generated/treasury_outbound_transfer_created.rs +++ /dev/null @@ -1,10 +0,0 @@ -// ====================================== -// This file was automatically generated. -// ====================================== - -use serde::{Deserialize, Serialize}; - -/// The resource representing a Stripe "treasury.outbound_transfer.created". -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct TreasuryOutboundTransferCreated { -} diff --git a/src/resources/generated/treasury_outbound_transfer_expected_arrival_date_updated.rs b/src/resources/generated/treasury_outbound_transfer_expected_arrival_date_updated.rs deleted file mode 100644 index ebfefc92b..000000000 --- a/src/resources/generated/treasury_outbound_transfer_expected_arrival_date_updated.rs +++ /dev/null @@ -1,10 +0,0 @@ -// ====================================== -// This file was automatically generated. -// ====================================== - -use serde::{Deserialize, Serialize}; - -/// The resource representing a Stripe "treasury.outbound_transfer.expected_arrival_date_updated". -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct TreasuryOutboundTransferExpectedArrivalDateUpdated { -} diff --git a/src/resources/generated/treasury_outbound_transfer_failed.rs b/src/resources/generated/treasury_outbound_transfer_failed.rs deleted file mode 100644 index 8bb7c1176..000000000 --- a/src/resources/generated/treasury_outbound_transfer_failed.rs +++ /dev/null @@ -1,10 +0,0 @@ -// ====================================== -// This file was automatically generated. -// ====================================== - -use serde::{Deserialize, Serialize}; - -/// The resource representing a Stripe "treasury.outbound_transfer.failed". -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct TreasuryOutboundTransferFailed { -} diff --git a/src/resources/generated/treasury_outbound_transfer_posted.rs b/src/resources/generated/treasury_outbound_transfer_posted.rs deleted file mode 100644 index ce55d1610..000000000 --- a/src/resources/generated/treasury_outbound_transfer_posted.rs +++ /dev/null @@ -1,10 +0,0 @@ -// ====================================== -// This file was automatically generated. -// ====================================== - -use serde::{Deserialize, Serialize}; - -/// The resource representing a Stripe "treasury.outbound_transfer.posted". -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct TreasuryOutboundTransferPosted { -} diff --git a/src/resources/generated/treasury_outbound_transfer_returned.rs b/src/resources/generated/treasury_outbound_transfer_returned.rs deleted file mode 100644 index 4e13f2a07..000000000 --- a/src/resources/generated/treasury_outbound_transfer_returned.rs +++ /dev/null @@ -1,10 +0,0 @@ -// ====================================== -// This file was automatically generated. -// ====================================== - -use serde::{Deserialize, Serialize}; - -/// The resource representing a Stripe "treasury.outbound_transfer.returned". -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct TreasuryOutboundTransferReturned { -} diff --git a/src/resources/generated/treasury_received_credit.rs b/src/resources/generated/treasury_received_credit.rs deleted file mode 100644 index bebaebd7f..000000000 --- a/src/resources/generated/treasury_received_credit.rs +++ /dev/null @@ -1,314 +0,0 @@ -// ====================================== -// This file was automatically generated. -// ====================================== - -use crate::ids::{TreasuryReceivedCreditId}; -use crate::params::{Expandable, Object, Timestamp}; -use crate::resources::{Currency, Payout, TreasuryCreditReversal, TreasuryOutboundPayment, TreasurySharedResourceInitiatingPaymentMethodDetailsInitiatingPaymentMethodDetails, TreasuryTransaction}; -use serde::{Deserialize, Serialize}; - -/// The resource representing a Stripe "TreasuryReceivedCreditsResourceReceivedCredit". -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct TreasuryReceivedCredit { - /// Unique identifier for the object. - pub id: TreasuryReceivedCreditId, - - /// Amount (in cents) transferred. - pub amount: i64, - - /// Time at which the object was created. - /// - /// Measured in seconds since the Unix epoch. - pub created: Timestamp, - - /// Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. - /// - /// Must be a [supported currency](https://stripe.com/docs/currencies). - pub currency: Currency, - - /// An arbitrary string attached to the object. - /// - /// Often useful for displaying to users. - pub description: String, - - /// Reason for the failure. - /// - /// A ReceivedCredit might fail because the receiving FinancialAccount is closed or frozen. - pub failure_code: Option, - - /// The FinancialAccount that received the funds. - pub financial_account: Option, - - /// A [hosted transaction receipt](https://stripe.com/docs/treasury/moving-money/regulatory-receipts) URL that is provided when money movement is considered regulated under Stripe's money transmission licenses. - pub hosted_regulatory_receipt_url: Option, - - pub initiating_payment_method_details: TreasurySharedResourceInitiatingPaymentMethodDetailsInitiatingPaymentMethodDetails, - - pub linked_flows: TreasuryReceivedCreditsResourceLinkedFlows, - - /// Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. - pub livemode: bool, - - /// The rails used to send the funds. - pub network: TreasuryReceivedCreditNetwork, - - /// Details describing when a ReceivedCredit may be reversed. - pub reversal_details: Option, - - /// Status of the ReceivedCredit. - /// - /// ReceivedCredits are created either `succeeded` (approved) or `failed` (declined). - /// If a ReceivedCredit is declined, the failure reason can be found in the `failure_code` field. - pub status: TreasuryReceivedCreditStatus, - - /// The Transaction associated with this object. - pub transaction: Option>, -} - -impl Object for TreasuryReceivedCredit { - type Id = TreasuryReceivedCreditId; - fn id(&self) -> Self::Id { - self.id.clone() - } - fn object(&self) -> &'static str { - "treasury.received_credit" - } -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct TreasuryReceivedCreditsResourceLinkedFlows { - - /// The CreditReversal created as a result of this ReceivedCredit being reversed. - pub credit_reversal: Option, - - /// Set if the ReceivedCredit was created due to an [Issuing Authorization](https://stripe.com/docs/api#issuing_authorizations) object. - pub issuing_authorization: Option, - - /// Set if the ReceivedCredit is also viewable as an [Issuing transaction](https://stripe.com/docs/api#issuing_transactions) object. - pub issuing_transaction: Option, - - /// ID of the source flow. - /// - /// Set if `network` is `stripe` and the source flow is visible to the user. - /// Examples of source flows include OutboundPayments, payouts, or CreditReversals. - pub source_flow: Option, - - /// The expandable object of the source flow. - pub source_flow_details: Option, - - /// The type of flow that originated the ReceivedCredit (for example, `outbound_payment`). - pub source_flow_type: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct TreasuryReceivedCreditsResourceReversalDetails { - - /// Time before which a ReceivedCredit can be reversed. - pub deadline: Option, - - /// Set if a ReceivedCredit cannot be reversed. - pub restricted_reason: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct TreasuryReceivedCreditsResourceSourceFlowsDetails { - - #[serde(skip_serializing_if = "Option::is_none")] - pub credit_reversal: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub outbound_payment: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub payout: Option, - - /// The type of the source flow that originated the ReceivedCredit. - #[serde(rename = "type")] - pub type_: TreasuryReceivedCreditsResourceSourceFlowsDetailsType, -} - -/// An enum representing the possible values of an `TreasuryReceivedCredit`'s `failure_code` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum TreasuryReceivedCreditFailureCode { - AccountClosed, - AccountFrozen, - Other, -} - -impl TreasuryReceivedCreditFailureCode { - pub fn as_str(self) -> &'static str { - match self { - TreasuryReceivedCreditFailureCode::AccountClosed => "account_closed", - TreasuryReceivedCreditFailureCode::AccountFrozen => "account_frozen", - TreasuryReceivedCreditFailureCode::Other => "other", - } - } -} - -impl AsRef for TreasuryReceivedCreditFailureCode { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for TreasuryReceivedCreditFailureCode { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for TreasuryReceivedCreditFailureCode { - fn default() -> Self { - Self::AccountClosed - } -} - -/// An enum representing the possible values of an `TreasuryReceivedCredit`'s `network` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum TreasuryReceivedCreditNetwork { - Ach, - Card, - Stripe, - UsDomesticWire, -} - -impl TreasuryReceivedCreditNetwork { - pub fn as_str(self) -> &'static str { - match self { - TreasuryReceivedCreditNetwork::Ach => "ach", - TreasuryReceivedCreditNetwork::Card => "card", - TreasuryReceivedCreditNetwork::Stripe => "stripe", - TreasuryReceivedCreditNetwork::UsDomesticWire => "us_domestic_wire", - } - } -} - -impl AsRef for TreasuryReceivedCreditNetwork { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for TreasuryReceivedCreditNetwork { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for TreasuryReceivedCreditNetwork { - fn default() -> Self { - Self::Ach - } -} - -/// An enum representing the possible values of an `TreasuryReceivedCredit`'s `status` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum TreasuryReceivedCreditStatus { - Failed, - Succeeded, -} - -impl TreasuryReceivedCreditStatus { - pub fn as_str(self) -> &'static str { - match self { - TreasuryReceivedCreditStatus::Failed => "failed", - TreasuryReceivedCreditStatus::Succeeded => "succeeded", - } - } -} - -impl AsRef for TreasuryReceivedCreditStatus { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for TreasuryReceivedCreditStatus { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for TreasuryReceivedCreditStatus { - fn default() -> Self { - Self::Failed - } -} - -/// An enum representing the possible values of an `TreasuryReceivedCreditsResourceReversalDetails`'s `restricted_reason` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum TreasuryReceivedCreditsResourceReversalDetailsRestrictedReason { - AlreadyReversed, - DeadlinePassed, - NetworkRestricted, - Other, - SourceFlowRestricted, -} - -impl TreasuryReceivedCreditsResourceReversalDetailsRestrictedReason { - pub fn as_str(self) -> &'static str { - match self { - TreasuryReceivedCreditsResourceReversalDetailsRestrictedReason::AlreadyReversed => "already_reversed", - TreasuryReceivedCreditsResourceReversalDetailsRestrictedReason::DeadlinePassed => "deadline_passed", - TreasuryReceivedCreditsResourceReversalDetailsRestrictedReason::NetworkRestricted => "network_restricted", - TreasuryReceivedCreditsResourceReversalDetailsRestrictedReason::Other => "other", - TreasuryReceivedCreditsResourceReversalDetailsRestrictedReason::SourceFlowRestricted => "source_flow_restricted", - } - } -} - -impl AsRef for TreasuryReceivedCreditsResourceReversalDetailsRestrictedReason { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for TreasuryReceivedCreditsResourceReversalDetailsRestrictedReason { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for TreasuryReceivedCreditsResourceReversalDetailsRestrictedReason { - fn default() -> Self { - Self::AlreadyReversed - } -} - -/// An enum representing the possible values of an `TreasuryReceivedCreditsResourceSourceFlowsDetails`'s `type` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum TreasuryReceivedCreditsResourceSourceFlowsDetailsType { - CreditReversal, - Other, - OutboundPayment, - Payout, -} - -impl TreasuryReceivedCreditsResourceSourceFlowsDetailsType { - pub fn as_str(self) -> &'static str { - match self { - TreasuryReceivedCreditsResourceSourceFlowsDetailsType::CreditReversal => "credit_reversal", - TreasuryReceivedCreditsResourceSourceFlowsDetailsType::Other => "other", - TreasuryReceivedCreditsResourceSourceFlowsDetailsType::OutboundPayment => "outbound_payment", - TreasuryReceivedCreditsResourceSourceFlowsDetailsType::Payout => "payout", - } - } -} - -impl AsRef for TreasuryReceivedCreditsResourceSourceFlowsDetailsType { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for TreasuryReceivedCreditsResourceSourceFlowsDetailsType { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for TreasuryReceivedCreditsResourceSourceFlowsDetailsType { - fn default() -> Self { - Self::CreditReversal - } -} diff --git a/src/resources/generated/treasury_received_credit_created.rs b/src/resources/generated/treasury_received_credit_created.rs deleted file mode 100644 index 2e98e2795..000000000 --- a/src/resources/generated/treasury_received_credit_created.rs +++ /dev/null @@ -1,10 +0,0 @@ -// ====================================== -// This file was automatically generated. -// ====================================== - -use serde::{Deserialize, Serialize}; - -/// The resource representing a Stripe "treasury.received_credit.created". -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct TreasuryReceivedCreditCreated { -} diff --git a/src/resources/generated/treasury_received_credit_failed.rs b/src/resources/generated/treasury_received_credit_failed.rs deleted file mode 100644 index e1ced5303..000000000 --- a/src/resources/generated/treasury_received_credit_failed.rs +++ /dev/null @@ -1,10 +0,0 @@ -// ====================================== -// This file was automatically generated. -// ====================================== - -use serde::{Deserialize, Serialize}; - -/// The resource representing a Stripe "treasury.received_credit.failed". -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct TreasuryReceivedCreditFailed { -} diff --git a/src/resources/generated/treasury_received_credit_succeeded.rs b/src/resources/generated/treasury_received_credit_succeeded.rs deleted file mode 100644 index 81d017d17..000000000 --- a/src/resources/generated/treasury_received_credit_succeeded.rs +++ /dev/null @@ -1,10 +0,0 @@ -// ====================================== -// This file was automatically generated. -// ====================================== - -use serde::{Deserialize, Serialize}; - -/// The resource representing a Stripe "treasury.received_credit.succeeded". -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct TreasuryReceivedCreditSucceeded { -} diff --git a/src/resources/generated/treasury_received_debit.rs b/src/resources/generated/treasury_received_debit.rs deleted file mode 100644 index 3ef80636a..000000000 --- a/src/resources/generated/treasury_received_debit.rs +++ /dev/null @@ -1,251 +0,0 @@ -// ====================================== -// This file was automatically generated. -// ====================================== - -use crate::ids::{TreasuryReceivedDebitId}; -use crate::params::{Expandable, Object, Timestamp}; -use crate::resources::{Currency, TreasurySharedResourceInitiatingPaymentMethodDetailsInitiatingPaymentMethodDetails, TreasuryTransaction}; -use serde::{Deserialize, Serialize}; - -/// The resource representing a Stripe "TreasuryReceivedDebitsResourceReceivedDebit". -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct TreasuryReceivedDebit { - /// Unique identifier for the object. - pub id: TreasuryReceivedDebitId, - - /// Amount (in cents) transferred. - pub amount: i64, - - /// Time at which the object was created. - /// - /// Measured in seconds since the Unix epoch. - pub created: Timestamp, - - /// Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. - /// - /// Must be a [supported currency](https://stripe.com/docs/currencies). - pub currency: Currency, - - /// An arbitrary string attached to the object. - /// - /// Often useful for displaying to users. - pub description: String, - - /// Reason for the failure. - /// - /// A ReceivedDebit might fail because the FinancialAccount doesn't have sufficient funds, is closed, or is frozen. - pub failure_code: Option, - - /// The FinancialAccount that funds were pulled from. - pub financial_account: Option, - - /// A [hosted transaction receipt](https://stripe.com/docs/treasury/moving-money/regulatory-receipts) URL that is provided when money movement is considered regulated under Stripe's money transmission licenses. - pub hosted_regulatory_receipt_url: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub initiating_payment_method_details: Option, - - pub linked_flows: TreasuryReceivedDebitsResourceLinkedFlows, - - /// Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. - pub livemode: bool, - - /// The network used for the ReceivedDebit. - pub network: TreasuryReceivedDebitNetwork, - - /// Details describing when a ReceivedDebit might be reversed. - pub reversal_details: Option, - - /// Status of the ReceivedDebit. - /// - /// ReceivedDebits are created with a status of either `succeeded` (approved) or `failed` (declined). - /// The failure reason can be found under the `failure_code`. - pub status: TreasuryReceivedDebitStatus, - - /// The Transaction associated with this object. - pub transaction: Option>, -} - -impl Object for TreasuryReceivedDebit { - type Id = TreasuryReceivedDebitId; - fn id(&self) -> Self::Id { - self.id.clone() - } - fn object(&self) -> &'static str { - "treasury.received_debit" - } -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct TreasuryReceivedDebitsResourceLinkedFlows { - - /// The DebitReversal created as a result of this ReceivedDebit being reversed. - pub debit_reversal: Option, - - /// Set if the ReceivedDebit is associated with an InboundTransfer's return of funds. - pub inbound_transfer: Option, - - /// Set if the ReceivedDebit was created due to an [Issuing Authorization](https://stripe.com/docs/api#issuing_authorizations) object. - pub issuing_authorization: Option, - - /// Set if the ReceivedDebit is also viewable as an [Issuing Dispute](https://stripe.com/docs/api#issuing_disputes) object. - pub issuing_transaction: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct TreasuryReceivedDebitsResourceReversalDetails { - - /// Time before which a ReceivedDebit can be reversed. - pub deadline: Option, - - /// Set if a ReceivedDebit can't be reversed. - pub restricted_reason: Option, -} - -/// An enum representing the possible values of an `TreasuryReceivedDebit`'s `failure_code` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum TreasuryReceivedDebitFailureCode { - AccountClosed, - AccountFrozen, - InsufficientFunds, - Other, -} - -impl TreasuryReceivedDebitFailureCode { - pub fn as_str(self) -> &'static str { - match self { - TreasuryReceivedDebitFailureCode::AccountClosed => "account_closed", - TreasuryReceivedDebitFailureCode::AccountFrozen => "account_frozen", - TreasuryReceivedDebitFailureCode::InsufficientFunds => "insufficient_funds", - TreasuryReceivedDebitFailureCode::Other => "other", - } - } -} - -impl AsRef for TreasuryReceivedDebitFailureCode { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for TreasuryReceivedDebitFailureCode { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for TreasuryReceivedDebitFailureCode { - fn default() -> Self { - Self::AccountClosed - } -} - -/// An enum representing the possible values of an `TreasuryReceivedDebit`'s `network` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum TreasuryReceivedDebitNetwork { - Ach, - Card, - Stripe, -} - -impl TreasuryReceivedDebitNetwork { - pub fn as_str(self) -> &'static str { - match self { - TreasuryReceivedDebitNetwork::Ach => "ach", - TreasuryReceivedDebitNetwork::Card => "card", - TreasuryReceivedDebitNetwork::Stripe => "stripe", - } - } -} - -impl AsRef for TreasuryReceivedDebitNetwork { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for TreasuryReceivedDebitNetwork { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for TreasuryReceivedDebitNetwork { - fn default() -> Self { - Self::Ach - } -} - -/// An enum representing the possible values of an `TreasuryReceivedDebit`'s `status` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum TreasuryReceivedDebitStatus { - Failed, - Succeeded, -} - -impl TreasuryReceivedDebitStatus { - pub fn as_str(self) -> &'static str { - match self { - TreasuryReceivedDebitStatus::Failed => "failed", - TreasuryReceivedDebitStatus::Succeeded => "succeeded", - } - } -} - -impl AsRef for TreasuryReceivedDebitStatus { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for TreasuryReceivedDebitStatus { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for TreasuryReceivedDebitStatus { - fn default() -> Self { - Self::Failed - } -} - -/// An enum representing the possible values of an `TreasuryReceivedDebitsResourceReversalDetails`'s `restricted_reason` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum TreasuryReceivedDebitsResourceReversalDetailsRestrictedReason { - AlreadyReversed, - DeadlinePassed, - NetworkRestricted, - Other, - SourceFlowRestricted, -} - -impl TreasuryReceivedDebitsResourceReversalDetailsRestrictedReason { - pub fn as_str(self) -> &'static str { - match self { - TreasuryReceivedDebitsResourceReversalDetailsRestrictedReason::AlreadyReversed => "already_reversed", - TreasuryReceivedDebitsResourceReversalDetailsRestrictedReason::DeadlinePassed => "deadline_passed", - TreasuryReceivedDebitsResourceReversalDetailsRestrictedReason::NetworkRestricted => "network_restricted", - TreasuryReceivedDebitsResourceReversalDetailsRestrictedReason::Other => "other", - TreasuryReceivedDebitsResourceReversalDetailsRestrictedReason::SourceFlowRestricted => "source_flow_restricted", - } - } -} - -impl AsRef for TreasuryReceivedDebitsResourceReversalDetailsRestrictedReason { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for TreasuryReceivedDebitsResourceReversalDetailsRestrictedReason { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for TreasuryReceivedDebitsResourceReversalDetailsRestrictedReason { - fn default() -> Self { - Self::AlreadyReversed - } -} diff --git a/src/resources/generated/treasury_received_debit_created.rs b/src/resources/generated/treasury_received_debit_created.rs deleted file mode 100644 index f44b24713..000000000 --- a/src/resources/generated/treasury_received_debit_created.rs +++ /dev/null @@ -1,10 +0,0 @@ -// ====================================== -// This file was automatically generated. -// ====================================== - -use serde::{Deserialize, Serialize}; - -/// The resource representing a Stripe "treasury.received_debit.created". -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct TreasuryReceivedDebitCreated { -} diff --git a/src/resources/generated/treasury_shared_resource_billing_details.rs b/src/resources/generated/treasury_shared_resource_billing_details.rs deleted file mode 100644 index f7f4c71fa..000000000 --- a/src/resources/generated/treasury_shared_resource_billing_details.rs +++ /dev/null @@ -1,19 +0,0 @@ -// ====================================== -// This file was automatically generated. -// ====================================== - -use crate::resources::{Address}; -use serde::{Deserialize, Serialize}; - -/// The resource representing a Stripe "TreasurySharedResourceBillingDetails". -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct TreasurySharedResourceBillingDetails { - - pub address: Address, - - /// Email address. - pub email: Option, - - /// Full name. - pub name: Option, -} diff --git a/src/resources/generated/treasury_shared_resource_initiating_payment_method_details_initiating_payment_method_details.rs b/src/resources/generated/treasury_shared_resource_initiating_payment_method_details_initiating_payment_method_details.rs deleted file mode 100644 index de572ab51..000000000 --- a/src/resources/generated/treasury_shared_resource_initiating_payment_method_details_initiating_payment_method_details.rs +++ /dev/null @@ -1,164 +0,0 @@ -// ====================================== -// This file was automatically generated. -// ====================================== - -use crate::resources::{TreasurySharedResourceBillingDetails}; -use serde::{Deserialize, Serialize}; - -/// The resource representing a Stripe "TreasurySharedResourceInitiatingPaymentMethodDetailsInitiatingPaymentMethodDetails". -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct TreasurySharedResourceInitiatingPaymentMethodDetailsInitiatingPaymentMethodDetails { - - /// Set when `type` is `balance`. - #[serde(skip_serializing_if = "Option::is_none")] - pub balance: Option, - - pub billing_details: TreasurySharedResourceBillingDetails, - - #[serde(skip_serializing_if = "Option::is_none")] - pub financial_account: Option, - - /// Set when `type` is `issuing_card`. - /// - /// This is an [Issuing Card](https://stripe.com/docs/api#issuing_cards) ID. - #[serde(skip_serializing_if = "Option::is_none")] - pub issuing_card: Option, - - /// Polymorphic type matching the originating money movement's source. - /// - /// This can be an external account, a Stripe balance, or a FinancialAccount. - #[serde(rename = "type")] - pub type_: TreasurySharedResourceInitiatingPaymentMethodDetailsInitiatingPaymentMethodDetailsType, - - #[serde(skip_serializing_if = "Option::is_none")] - pub us_bank_account: Option, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct ReceivedPaymentMethodDetailsFinancialAccount { - - /// The FinancialAccount ID. - pub id: String, - - /// The rails the ReceivedCredit was sent over. - /// - /// A FinancialAccount can only send funds over `stripe`. - pub network: ReceivedPaymentMethodDetailsFinancialAccountNetwork, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct TreasurySharedResourceInitiatingPaymentMethodDetailsUsBankAccount { - - /// Bank name. - pub bank_name: Option, - - /// The last four digits of the bank account number. - pub last4: Option, - - /// The routing number for the bank account. - pub routing_number: Option, -} - -/// An enum representing the possible values of an `ReceivedPaymentMethodDetailsFinancialAccount`'s `network` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum ReceivedPaymentMethodDetailsFinancialAccountNetwork { - Stripe, -} - -impl ReceivedPaymentMethodDetailsFinancialAccountNetwork { - pub fn as_str(self) -> &'static str { - match self { - ReceivedPaymentMethodDetailsFinancialAccountNetwork::Stripe => "stripe", - } - } -} - -impl AsRef for ReceivedPaymentMethodDetailsFinancialAccountNetwork { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for ReceivedPaymentMethodDetailsFinancialAccountNetwork { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for ReceivedPaymentMethodDetailsFinancialAccountNetwork { - fn default() -> Self { - Self::Stripe - } -} - -/// An enum representing the possible values of an `TreasurySharedResourceInitiatingPaymentMethodDetailsInitiatingPaymentMethodDetails`'s `balance` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum TreasurySharedResourceInitiatingPaymentMethodDetailsInitiatingPaymentMethodDetailsBalance { - Payments, -} - -impl TreasurySharedResourceInitiatingPaymentMethodDetailsInitiatingPaymentMethodDetailsBalance { - pub fn as_str(self) -> &'static str { - match self { - TreasurySharedResourceInitiatingPaymentMethodDetailsInitiatingPaymentMethodDetailsBalance::Payments => "payments", - } - } -} - -impl AsRef for TreasurySharedResourceInitiatingPaymentMethodDetailsInitiatingPaymentMethodDetailsBalance { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for TreasurySharedResourceInitiatingPaymentMethodDetailsInitiatingPaymentMethodDetailsBalance { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for TreasurySharedResourceInitiatingPaymentMethodDetailsInitiatingPaymentMethodDetailsBalance { - fn default() -> Self { - Self::Payments - } -} - -/// An enum representing the possible values of an `TreasurySharedResourceInitiatingPaymentMethodDetailsInitiatingPaymentMethodDetails`'s `type` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum TreasurySharedResourceInitiatingPaymentMethodDetailsInitiatingPaymentMethodDetailsType { - Balance, - FinancialAccount, - IssuingCard, - Stripe, - UsBankAccount, -} - -impl TreasurySharedResourceInitiatingPaymentMethodDetailsInitiatingPaymentMethodDetailsType { - pub fn as_str(self) -> &'static str { - match self { - TreasurySharedResourceInitiatingPaymentMethodDetailsInitiatingPaymentMethodDetailsType::Balance => "balance", - TreasurySharedResourceInitiatingPaymentMethodDetailsInitiatingPaymentMethodDetailsType::FinancialAccount => "financial_account", - TreasurySharedResourceInitiatingPaymentMethodDetailsInitiatingPaymentMethodDetailsType::IssuingCard => "issuing_card", - TreasurySharedResourceInitiatingPaymentMethodDetailsInitiatingPaymentMethodDetailsType::Stripe => "stripe", - TreasurySharedResourceInitiatingPaymentMethodDetailsInitiatingPaymentMethodDetailsType::UsBankAccount => "us_bank_account", - } - } -} - -impl AsRef for TreasurySharedResourceInitiatingPaymentMethodDetailsInitiatingPaymentMethodDetailsType { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for TreasurySharedResourceInitiatingPaymentMethodDetailsInitiatingPaymentMethodDetailsType { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for TreasurySharedResourceInitiatingPaymentMethodDetailsInitiatingPaymentMethodDetailsType { - fn default() -> Self { - Self::Balance - } -} diff --git a/src/resources/generated/treasury_transaction.rs b/src/resources/generated/treasury_transaction.rs deleted file mode 100644 index d90664367..000000000 --- a/src/resources/generated/treasury_transaction.rs +++ /dev/null @@ -1,164 +0,0 @@ -// ====================================== -// This file was automatically generated. -// ====================================== - -use crate::ids::{TreasuryTransactionId}; -use crate::params::{List, Object, Timestamp}; -use crate::resources::{Currency, TreasuryTransactionEntry, TreasuryTransactionsResourceBalanceImpact, TreasuryTransactionsResourceFlowDetails}; -use serde::{Deserialize, Serialize}; - -/// The resource representing a Stripe "TreasuryTransactionsResourceTransaction". -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct TreasuryTransaction { - /// Unique identifier for the object. - pub id: TreasuryTransactionId, - - /// Amount (in cents) transferred. - pub amount: i64, - - pub balance_impact: TreasuryTransactionsResourceBalanceImpact, - - /// Time at which the object was created. - /// - /// Measured in seconds since the Unix epoch. - pub created: Timestamp, - - /// Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. - /// - /// Must be a [supported currency](https://stripe.com/docs/currencies). - pub currency: Currency, - - /// An arbitrary string attached to the object. - /// - /// Often useful for displaying to users. - pub description: String, - - /// A list of TransactionEntries that are part of this Transaction. - /// - /// This cannot be expanded in any list endpoints. - pub entries: Option>, - - /// The FinancialAccount associated with this object. - pub financial_account: String, - - /// ID of the flow that created the Transaction. - pub flow: Option, - - /// Details of the flow that created the Transaction. - pub flow_details: Option, - - /// Type of the flow that created the Transaction. - pub flow_type: TreasuryTransactionFlowType, - - /// Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. - pub livemode: bool, - - /// Status of the Transaction. - pub status: TreasuryTransactionStatus, - - pub status_transitions: TreasuryTransactionsResourceAbstractTransactionResourceStatusTransitions, -} - -impl Object for TreasuryTransaction { - type Id = TreasuryTransactionId; - fn id(&self) -> Self::Id { - self.id.clone() - } - fn object(&self) -> &'static str { - "treasury.transaction" - } -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct TreasuryTransactionsResourceAbstractTransactionResourceStatusTransitions { - - /// Timestamp describing when the Transaction changed status to `posted`. - pub posted_at: Option, - - /// Timestamp describing when the Transaction changed status to `void`. - pub void_at: Option, -} - -/// An enum representing the possible values of an `TreasuryTransaction`'s `flow_type` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum TreasuryTransactionFlowType { - CreditReversal, - DebitReversal, - InboundTransfer, - IssuingAuthorization, - Other, - OutboundPayment, - OutboundTransfer, - ReceivedCredit, - ReceivedDebit, -} - -impl TreasuryTransactionFlowType { - pub fn as_str(self) -> &'static str { - match self { - TreasuryTransactionFlowType::CreditReversal => "credit_reversal", - TreasuryTransactionFlowType::DebitReversal => "debit_reversal", - TreasuryTransactionFlowType::InboundTransfer => "inbound_transfer", - TreasuryTransactionFlowType::IssuingAuthorization => "issuing_authorization", - TreasuryTransactionFlowType::Other => "other", - TreasuryTransactionFlowType::OutboundPayment => "outbound_payment", - TreasuryTransactionFlowType::OutboundTransfer => "outbound_transfer", - TreasuryTransactionFlowType::ReceivedCredit => "received_credit", - TreasuryTransactionFlowType::ReceivedDebit => "received_debit", - } - } -} - -impl AsRef for TreasuryTransactionFlowType { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for TreasuryTransactionFlowType { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for TreasuryTransactionFlowType { - fn default() -> Self { - Self::CreditReversal - } -} - -/// An enum representing the possible values of an `TreasuryTransaction`'s `status` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum TreasuryTransactionStatus { - Open, - Posted, - Void, -} - -impl TreasuryTransactionStatus { - pub fn as_str(self) -> &'static str { - match self { - TreasuryTransactionStatus::Open => "open", - TreasuryTransactionStatus::Posted => "posted", - TreasuryTransactionStatus::Void => "void", - } - } -} - -impl AsRef for TreasuryTransactionStatus { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for TreasuryTransactionStatus { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for TreasuryTransactionStatus { - fn default() -> Self { - Self::Open - } -} diff --git a/src/resources/generated/treasury_transaction_entry.rs b/src/resources/generated/treasury_transaction_entry.rs deleted file mode 100644 index dab4d7839..000000000 --- a/src/resources/generated/treasury_transaction_entry.rs +++ /dev/null @@ -1,180 +0,0 @@ -// ====================================== -// This file was automatically generated. -// ====================================== - -use crate::ids::{TreasuryTransactionEntryId}; -use crate::params::{Expandable, Object, Timestamp}; -use crate::resources::{Currency, TreasuryTransaction, TreasuryTransactionsResourceBalanceImpact, TreasuryTransactionsResourceFlowDetails}; -use serde::{Deserialize, Serialize}; - -/// The resource representing a Stripe "TreasuryTransactionsResourceTransactionEntry". -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct TreasuryTransactionEntry { - /// Unique identifier for the object. - pub id: TreasuryTransactionEntryId, - - pub balance_impact: TreasuryTransactionsResourceBalanceImpact, - - /// Time at which the object was created. - /// - /// Measured in seconds since the Unix epoch. - pub created: Timestamp, - - /// Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. - /// - /// Must be a [supported currency](https://stripe.com/docs/currencies). - pub currency: Currency, - - /// When the TransactionEntry will impact the FinancialAccount's balance. - pub effective_at: Timestamp, - - /// The FinancialAccount associated with this object. - pub financial_account: String, - - /// Token of the flow associated with the TransactionEntry. - pub flow: Option, - - /// Details of the flow associated with the TransactionEntry. - pub flow_details: Option, - - /// Type of the flow associated with the TransactionEntry. - pub flow_type: TreasuryTransactionEntryFlowType, - - /// Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. - pub livemode: bool, - - /// The Transaction associated with this object. - pub transaction: Expandable, - - /// The specific money movement that generated the TransactionEntry. - #[serde(rename = "type")] - pub type_: TreasuryTransactionEntryType, -} - -impl Object for TreasuryTransactionEntry { - type Id = TreasuryTransactionEntryId; - fn id(&self) -> Self::Id { - self.id.clone() - } - fn object(&self) -> &'static str { - "treasury.transaction_entry" - } -} - -/// An enum representing the possible values of an `TreasuryTransactionEntry`'s `flow_type` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum TreasuryTransactionEntryFlowType { - CreditReversal, - DebitReversal, - InboundTransfer, - IssuingAuthorization, - Other, - OutboundPayment, - OutboundTransfer, - ReceivedCredit, - ReceivedDebit, -} - -impl TreasuryTransactionEntryFlowType { - pub fn as_str(self) -> &'static str { - match self { - TreasuryTransactionEntryFlowType::CreditReversal => "credit_reversal", - TreasuryTransactionEntryFlowType::DebitReversal => "debit_reversal", - TreasuryTransactionEntryFlowType::InboundTransfer => "inbound_transfer", - TreasuryTransactionEntryFlowType::IssuingAuthorization => "issuing_authorization", - TreasuryTransactionEntryFlowType::Other => "other", - TreasuryTransactionEntryFlowType::OutboundPayment => "outbound_payment", - TreasuryTransactionEntryFlowType::OutboundTransfer => "outbound_transfer", - TreasuryTransactionEntryFlowType::ReceivedCredit => "received_credit", - TreasuryTransactionEntryFlowType::ReceivedDebit => "received_debit", - } - } -} - -impl AsRef for TreasuryTransactionEntryFlowType { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for TreasuryTransactionEntryFlowType { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for TreasuryTransactionEntryFlowType { - fn default() -> Self { - Self::CreditReversal - } -} - -/// An enum representing the possible values of an `TreasuryTransactionEntry`'s `type` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum TreasuryTransactionEntryType { - CreditReversal, - CreditReversalPosting, - DebitReversal, - InboundTransfer, - InboundTransferReturn, - IssuingAuthorizationHold, - IssuingAuthorizationRelease, - Other, - OutboundPayment, - OutboundPaymentCancellation, - OutboundPaymentFailure, - OutboundPaymentPosting, - OutboundPaymentReturn, - OutboundTransfer, - OutboundTransferCancellation, - OutboundTransferFailure, - OutboundTransferPosting, - OutboundTransferReturn, - ReceivedCredit, - ReceivedDebit, -} - -impl TreasuryTransactionEntryType { - pub fn as_str(self) -> &'static str { - match self { - TreasuryTransactionEntryType::CreditReversal => "credit_reversal", - TreasuryTransactionEntryType::CreditReversalPosting => "credit_reversal_posting", - TreasuryTransactionEntryType::DebitReversal => "debit_reversal", - TreasuryTransactionEntryType::InboundTransfer => "inbound_transfer", - TreasuryTransactionEntryType::InboundTransferReturn => "inbound_transfer_return", - TreasuryTransactionEntryType::IssuingAuthorizationHold => "issuing_authorization_hold", - TreasuryTransactionEntryType::IssuingAuthorizationRelease => "issuing_authorization_release", - TreasuryTransactionEntryType::Other => "other", - TreasuryTransactionEntryType::OutboundPayment => "outbound_payment", - TreasuryTransactionEntryType::OutboundPaymentCancellation => "outbound_payment_cancellation", - TreasuryTransactionEntryType::OutboundPaymentFailure => "outbound_payment_failure", - TreasuryTransactionEntryType::OutboundPaymentPosting => "outbound_payment_posting", - TreasuryTransactionEntryType::OutboundPaymentReturn => "outbound_payment_return", - TreasuryTransactionEntryType::OutboundTransfer => "outbound_transfer", - TreasuryTransactionEntryType::OutboundTransferCancellation => "outbound_transfer_cancellation", - TreasuryTransactionEntryType::OutboundTransferFailure => "outbound_transfer_failure", - TreasuryTransactionEntryType::OutboundTransferPosting => "outbound_transfer_posting", - TreasuryTransactionEntryType::OutboundTransferReturn => "outbound_transfer_return", - TreasuryTransactionEntryType::ReceivedCredit => "received_credit", - TreasuryTransactionEntryType::ReceivedDebit => "received_debit", - } - } -} - -impl AsRef for TreasuryTransactionEntryType { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for TreasuryTransactionEntryType { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for TreasuryTransactionEntryType { - fn default() -> Self { - Self::CreditReversal - } -} diff --git a/src/resources/generated/treasury_transactions_resource_flow_details.rs b/src/resources/generated/treasury_transactions_resource_flow_details.rs deleted file mode 100644 index 8d89a2e7a..000000000 --- a/src/resources/generated/treasury_transactions_resource_flow_details.rs +++ /dev/null @@ -1,89 +0,0 @@ -// ====================================== -// This file was automatically generated. -// ====================================== - -use crate::resources::{IssuingAuthorization, TreasuryCreditReversal, TreasuryDebitReversal, TreasuryInboundTransfer, TreasuryOutboundPayment, TreasuryOutboundTransfer, TreasuryReceivedCredit, TreasuryReceivedDebit}; -use serde::{Deserialize, Serialize}; - -/// The resource representing a Stripe "TreasuryTransactionsResourceFlowDetails". -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct TreasuryTransactionsResourceFlowDetails { - - #[serde(skip_serializing_if = "Option::is_none")] - pub credit_reversal: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub debit_reversal: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub inbound_transfer: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub issuing_authorization: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub outbound_payment: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub outbound_transfer: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub received_credit: Option, - - #[serde(skip_serializing_if = "Option::is_none")] - pub received_debit: Option, - - /// Type of the flow that created the Transaction. - /// - /// Set to the same value as `flow_type`. - #[serde(rename = "type")] - pub type_: TreasuryTransactionsResourceFlowDetailsType, -} - -/// An enum representing the possible values of an `TreasuryTransactionsResourceFlowDetails`'s `type` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum TreasuryTransactionsResourceFlowDetailsType { - CreditReversal, - DebitReversal, - InboundTransfer, - IssuingAuthorization, - Other, - OutboundPayment, - OutboundTransfer, - ReceivedCredit, - ReceivedDebit, -} - -impl TreasuryTransactionsResourceFlowDetailsType { - pub fn as_str(self) -> &'static str { - match self { - TreasuryTransactionsResourceFlowDetailsType::CreditReversal => "credit_reversal", - TreasuryTransactionsResourceFlowDetailsType::DebitReversal => "debit_reversal", - TreasuryTransactionsResourceFlowDetailsType::InboundTransfer => "inbound_transfer", - TreasuryTransactionsResourceFlowDetailsType::IssuingAuthorization => "issuing_authorization", - TreasuryTransactionsResourceFlowDetailsType::Other => "other", - TreasuryTransactionsResourceFlowDetailsType::OutboundPayment => "outbound_payment", - TreasuryTransactionsResourceFlowDetailsType::OutboundTransfer => "outbound_transfer", - TreasuryTransactionsResourceFlowDetailsType::ReceivedCredit => "received_credit", - TreasuryTransactionsResourceFlowDetailsType::ReceivedDebit => "received_debit", - } - } -} - -impl AsRef for TreasuryTransactionsResourceFlowDetailsType { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for TreasuryTransactionsResourceFlowDetailsType { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for TreasuryTransactionsResourceFlowDetailsType { - fn default() -> Self { - Self::CreditReversal - } -} diff --git a/src/resources/generated/usage_record.rs b/src/resources/generated/usage_record.rs deleted file mode 100644 index 47d7bd4b8..000000000 --- a/src/resources/generated/usage_record.rs +++ /dev/null @@ -1,39 +0,0 @@ -// ====================================== -// This file was automatically generated. -// ====================================== - -use serde::{Deserialize, Serialize}; - -use crate::ids::UsageRecordId; -use crate::params::{Object, Timestamp}; - -/// The resource representing a Stripe "UsageRecord". -/// -/// For more details see -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UsageRecord { - /// Unique identifier for the object. - pub id: UsageRecordId, - - /// Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. - pub livemode: bool, - - /// The usage quantity for the specified date. - pub quantity: u64, - - /// The ID of the subscription item this usage record contains data for. - pub subscription_item: String, - - /// The timestamp when this usage occurred. - pub timestamp: Timestamp, -} - -impl Object for UsageRecord { - type Id = UsageRecordId; - fn id(&self) -> Self::Id { - self.id.clone() - } - fn object(&self) -> &'static str { - "usage_record" - } -} diff --git a/src/resources/generated/usage_record_summary.rs b/src/resources/generated/usage_record_summary.rs deleted file mode 100644 index db45835c7..000000000 --- a/src/resources/generated/usage_record_summary.rs +++ /dev/null @@ -1,52 +0,0 @@ -// ====================================== -// This file was automatically generated. -// ====================================== - -use serde::{Deserialize, Serialize}; - -use crate::ids::UsageRecordSummaryId; -use crate::params::{Object, Timestamp}; - -/// The resource representing a Stripe "UsageRecordSummary". -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct UsageRecordSummary { - /// Unique identifier for the object. - pub id: UsageRecordSummaryId, - - /// The invoice in which this usage period has been billed for. - pub invoice: Option, - - /// Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. - pub livemode: bool, - - pub period: Period, - - /// The ID of the subscription item this summary is describing. - pub subscription_item: String, - - /// The total usage within this usage period. - pub total_usage: i64, -} - -impl Object for UsageRecordSummary { - type Id = UsageRecordSummaryId; - fn id(&self) -> Self::Id { - self.id.clone() - } - fn object(&self) -> &'static str { - "usage_record_summary" - } -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct Period { - /// The end date of this usage period. - /// - /// All usage up to and including this point in time is included. - pub end: Option, - - /// The start date of this usage period. - /// - /// All usage after this point in time is included. - pub start: Option, -} diff --git a/src/resources/generated/version.rs b/src/resources/generated/version.rs deleted file mode 100644 index 3cdd9f3fe..000000000 --- a/src/resources/generated/version.rs +++ /dev/null @@ -1,3 +0,0 @@ -use crate::ApiVersion; - -pub const VERSION: ApiVersion = ApiVersion::V2023_10_16; diff --git a/src/resources/generated/webhook_endpoint.rs b/src/resources/generated/webhook_endpoint.rs deleted file mode 100644 index 0cccadfda..000000000 --- a/src/resources/generated/webhook_endpoint.rs +++ /dev/null @@ -1,1030 +0,0 @@ -// ====================================== -// This file was automatically generated. -// ====================================== - -use serde::{Deserialize, Serialize}; - -use crate::client::{Client, Response}; -use crate::ids::WebhookEndpointId; -use crate::params::{Deleted, Expand, List, Metadata, Object, Paginable, Timestamp}; -use crate::resources::{ApiVersion, WebhookEndpointStatus}; - -/// The resource representing a Stripe "NotificationWebhookEndpoint". -/// -/// For more details see -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct WebhookEndpoint { - /// Unique identifier for the object. - pub id: WebhookEndpointId, - - /// The API version events are rendered as for this webhook endpoint. - #[serde(skip_serializing_if = "Option::is_none")] - pub api_version: Option, - - /// The ID of the associated Connect application. - #[serde(skip_serializing_if = "Option::is_none")] - pub application: Option, - - /// Time at which the object was created. - /// - /// Measured in seconds since the Unix epoch. - #[serde(skip_serializing_if = "Option::is_none")] - pub created: Option, - - // Always true for a deleted object - #[serde(default)] - pub deleted: bool, - - /// An optional description of what the webhook is used for. - #[serde(skip_serializing_if = "Option::is_none")] - pub description: Option, - - /// The list of events to enable for this endpoint. - /// - /// `['*']` indicates that all events are enabled, except those that require explicit selection. - #[serde(skip_serializing_if = "Option::is_none")] - pub enabled_events: Option>, - - /// Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. - #[serde(skip_serializing_if = "Option::is_none")] - pub livemode: Option, - - /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. - /// - /// This can be useful for storing additional information about the object in a structured format. - #[serde(skip_serializing_if = "Option::is_none")] - pub metadata: Option, - - /// The endpoint's secret, used to generate [webhook signatures](https://stripe.com/docs/webhooks/signatures). - /// - /// Only returned at creation. - #[serde(skip_serializing_if = "Option::is_none")] - pub secret: Option, - - /// The status of the webhook. - /// - /// It can be `enabled` or `disabled`. - #[serde(skip_serializing_if = "Option::is_none")] - pub status: Option, - - /// The URL of the webhook endpoint. - #[serde(skip_serializing_if = "Option::is_none")] - pub url: Option, -} - -impl WebhookEndpoint { - /// Returns a list of your webhook endpoints. - pub fn list( - client: &Client, - params: &ListWebhookEndpoints<'_>, - ) -> Response> { - client.get_query("/webhook_endpoints", ¶ms) - } - - /// A webhook endpoint must have a `url` and a list of `enabled_events`. - /// - /// You may optionally specify the Boolean `connect` parameter. - /// If set to true, then a Connect webhook endpoint that notifies the specified `url` about events from all connected accounts is created; otherwise an account webhook endpoint that notifies the specified `url` only about events from your account is created. - /// You can also create webhook endpoints in the [webhooks settings](https://dashboard.stripe.com/account/webhooks) section of the Dashboard. - pub fn create(client: &Client, params: CreateWebhookEndpoint<'_>) -> Response { - client.post_form("/webhook_endpoints", ¶ms) - } - - /// Retrieves the webhook endpoint with the given ID. - pub fn retrieve( - client: &Client, - id: &WebhookEndpointId, - expand: &[&str], - ) -> Response { - client.get_query(&format!("/webhook_endpoints/{}", id), &Expand { expand }) - } - - /// Updates the webhook endpoint. - /// - /// You may edit the `url`, the list of `enabled_events`, and the status of your endpoint. - pub fn update( - client: &Client, - id: &WebhookEndpointId, - params: UpdateWebhookEndpoint<'_>, - ) -> Response { - client.post_form(&format!("/webhook_endpoints/{}", id), ¶ms) - } - - /// You can also delete webhook endpoints via the [webhook endpoint management](https://dashboard.stripe.com/account/webhooks) page of the Stripe dashboard. - pub fn delete(client: &Client, id: &WebhookEndpointId) -> Response> { - client.delete(&format!("/webhook_endpoints/{}", id)) - } -} - -impl Object for WebhookEndpoint { - type Id = WebhookEndpointId; - fn id(&self) -> Self::Id { - self.id.clone() - } - fn object(&self) -> &'static str { - "webhook_endpoint" - } -} - -/// The parameters for `WebhookEndpoint::create`. -#[derive(Clone, Debug, Serialize)] -pub struct CreateWebhookEndpoint<'a> { - /// Events sent to this endpoint will be generated with this Stripe Version instead of your account's default Stripe Version. - #[serde(skip_serializing_if = "Option::is_none")] - pub api_version: Option, - - /// Whether this endpoint should receive events from connected accounts (`true`), or from your account (`false`). - /// - /// Defaults to `false`. - #[serde(skip_serializing_if = "Option::is_none")] - pub connect: Option, - - /// An optional description of what the webhook is used for. - #[serde(skip_serializing_if = "Option::is_none")] - pub description: Option, - - /// The list of events to enable for this endpoint. - /// - /// You may specify `['*']` to enable all events, except those that require explicit selection. - pub enabled_events: Vec, - - /// Specifies which fields in the response should be expanded. - #[serde(skip_serializing_if = "Expand::is_empty")] - pub expand: &'a [&'a str], - - /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. - /// - /// This can be useful for storing additional information about the object in a structured format. - /// Individual keys can be unset by posting an empty value to them. - /// All keys can be unset by posting an empty value to `metadata`. - #[serde(skip_serializing_if = "Option::is_none")] - pub metadata: Option, - - /// The URL of the webhook endpoint. - pub url: &'a str, -} - -impl<'a> CreateWebhookEndpoint<'a> { - pub fn new(enabled_events: Vec, url: &'a str) -> Self { - CreateWebhookEndpoint { - api_version: Default::default(), - connect: Default::default(), - description: Default::default(), - enabled_events, - expand: Default::default(), - metadata: Default::default(), - url, - } - } -} - -/// The parameters for `WebhookEndpoint::list`. -#[derive(Clone, Debug, Serialize, Default)] -pub struct ListWebhookEndpoints<'a> { - /// A cursor for use in pagination. - /// - /// `ending_before` is an object ID that defines your place in the list. - /// For instance, if you make a list request and receive 100 objects, starting with `obj_bar`, your subsequent call can include `ending_before=obj_bar` in order to fetch the previous page of the list. - #[serde(skip_serializing_if = "Option::is_none")] - pub ending_before: Option, - - /// Specifies which fields in the response should be expanded. - #[serde(skip_serializing_if = "Expand::is_empty")] - pub expand: &'a [&'a str], - - /// A limit on the number of objects to be returned. - /// - /// Limit can range between 1 and 100, and the default is 10. - #[serde(skip_serializing_if = "Option::is_none")] - pub limit: Option, - - /// A cursor for use in pagination. - /// - /// `starting_after` is an object ID that defines your place in the list. - /// For instance, if you make a list request and receive 100 objects, ending with `obj_foo`, your subsequent call can include `starting_after=obj_foo` in order to fetch the next page of the list. - #[serde(skip_serializing_if = "Option::is_none")] - pub starting_after: Option, -} - -impl<'a> ListWebhookEndpoints<'a> { - pub fn new() -> Self { - ListWebhookEndpoints { - ending_before: Default::default(), - expand: Default::default(), - limit: Default::default(), - starting_after: Default::default(), - } - } -} -impl Paginable for ListWebhookEndpoints<'_> { - type O = WebhookEndpoint; - fn set_last(&mut self, item: Self::O) { - self.starting_after = Some(item.id()); - } -} -/// The parameters for `WebhookEndpoint::update`. -#[derive(Clone, Debug, Serialize, Default)] -pub struct UpdateWebhookEndpoint<'a> { - /// An optional description of what the webhook is used for. - #[serde(skip_serializing_if = "Option::is_none")] - pub description: Option, - - /// Disable the webhook endpoint if set to true. - #[serde(skip_serializing_if = "Option::is_none")] - pub disabled: Option, - - /// The list of events to enable for this endpoint. - /// - /// You may specify `['*']` to enable all events, except those that require explicit selection. - #[serde(skip_serializing_if = "Option::is_none")] - pub enabled_events: Option>, - - /// Specifies which fields in the response should be expanded. - #[serde(skip_serializing_if = "Expand::is_empty")] - pub expand: &'a [&'a str], - - /// Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. - /// - /// This can be useful for storing additional information about the object in a structured format. - /// Individual keys can be unset by posting an empty value to them. - /// All keys can be unset by posting an empty value to `metadata`. - #[serde(skip_serializing_if = "Option::is_none")] - pub metadata: Option, - - /// The URL of the webhook endpoint. - #[serde(skip_serializing_if = "Option::is_none")] - pub url: Option<&'a str>, -} - -impl<'a> UpdateWebhookEndpoint<'a> { - pub fn new() -> Self { - UpdateWebhookEndpoint { - description: Default::default(), - disabled: Default::default(), - enabled_events: Default::default(), - expand: Default::default(), - metadata: Default::default(), - url: Default::default(), - } - } -} - -/// An enum representing the possible values of an `CreateWebhookEndpoint`'s `enabled_events` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum EventFilter { - #[serde(rename = "*")] - All, - #[serde(rename = "account.application.authorized")] - AccountApplicationAuthorized, - #[serde(rename = "account.application.deauthorized")] - AccountApplicationDeauthorized, - #[serde(rename = "account.external_account.created")] - AccountExternalAccountCreated, - #[serde(rename = "account.external_account.deleted")] - AccountExternalAccountDeleted, - #[serde(rename = "account.external_account.updated")] - AccountExternalAccountUpdated, - #[serde(rename = "account.updated")] - AccountUpdated, - #[serde(rename = "application_fee.created")] - ApplicationFeeCreated, - #[serde(rename = "application_fee.refund.updated")] - ApplicationFeeRefundUpdated, - #[serde(rename = "application_fee.refunded")] - ApplicationFeeRefunded, - #[serde(rename = "balance.available")] - BalanceAvailable, - #[serde(rename = "billing_portal.configuration.created")] - BillingPortalConfigurationCreated, - #[serde(rename = "billing_portal.configuration.updated")] - BillingPortalConfigurationUpdated, - #[serde(rename = "billing_portal.session.created")] - BillingPortalSessionCreated, - #[serde(rename = "capability.updated")] - CapabilityUpdated, - #[serde(rename = "cash_balance.funds_available")] - CashBalanceFundsAvailable, - #[serde(rename = "charge.captured")] - ChargeCaptured, - #[serde(rename = "charge.dispute.closed")] - ChargeDisputeClosed, - #[serde(rename = "charge.dispute.created")] - ChargeDisputeCreated, - #[serde(rename = "charge.dispute.funds_reinstated")] - ChargeDisputeFundsReinstated, - #[serde(rename = "charge.dispute.funds_withdrawn")] - ChargeDisputeFundsWithdrawn, - #[serde(rename = "charge.dispute.updated")] - ChargeDisputeUpdated, - #[serde(rename = "charge.expired")] - ChargeExpired, - #[serde(rename = "charge.failed")] - ChargeFailed, - #[serde(rename = "charge.pending")] - ChargePending, - #[serde(rename = "charge.refund.updated")] - ChargeRefundUpdated, - #[serde(rename = "charge.refunded")] - ChargeRefunded, - #[serde(rename = "charge.succeeded")] - ChargeSucceeded, - #[serde(rename = "charge.updated")] - ChargeUpdated, - #[serde(rename = "checkout.session.async_payment_failed")] - CheckoutSessionAsyncPaymentFailed, - #[serde(rename = "checkout.session.async_payment_succeeded")] - CheckoutSessionAsyncPaymentSucceeded, - #[serde(rename = "checkout.session.completed")] - CheckoutSessionCompleted, - #[serde(rename = "checkout.session.expired")] - CheckoutSessionExpired, - #[serde(rename = "climate.order.canceled")] - ClimateOrderCanceled, - #[serde(rename = "climate.order.created")] - ClimateOrderCreated, - #[serde(rename = "climate.order.delayed")] - ClimateOrderDelayed, - #[serde(rename = "climate.order.delivered")] - ClimateOrderDelivered, - #[serde(rename = "climate.order.product_substituted")] - ClimateOrderProductSubstituted, - #[serde(rename = "climate.product.created")] - ClimateProductCreated, - #[serde(rename = "climate.product.pricing_updated")] - ClimateProductPricingUpdated, - #[serde(rename = "coupon.created")] - CouponCreated, - #[serde(rename = "coupon.deleted")] - CouponDeleted, - #[serde(rename = "coupon.updated")] - CouponUpdated, - #[serde(rename = "credit_note.created")] - CreditNoteCreated, - #[serde(rename = "credit_note.updated")] - CreditNoteUpdated, - #[serde(rename = "credit_note.voided")] - CreditNoteVoided, - #[serde(rename = "customer.created")] - CustomerCreated, - #[serde(rename = "customer.deleted")] - CustomerDeleted, - #[serde(rename = "customer.discount.created")] - CustomerDiscountCreated, - #[serde(rename = "customer.discount.deleted")] - CustomerDiscountDeleted, - #[serde(rename = "customer.discount.updated")] - CustomerDiscountUpdated, - #[serde(rename = "customer.source.created")] - CustomerSourceCreated, - #[serde(rename = "customer.source.deleted")] - CustomerSourceDeleted, - #[serde(rename = "customer.source.expiring")] - CustomerSourceExpiring, - #[serde(rename = "customer.source.updated")] - CustomerSourceUpdated, - #[serde(rename = "customer.subscription.created")] - CustomerSubscriptionCreated, - #[serde(rename = "customer.subscription.deleted")] - CustomerSubscriptionDeleted, - #[serde(rename = "customer.subscription.paused")] - CustomerSubscriptionPaused, - #[serde(rename = "customer.subscription.pending_update_applied")] - CustomerSubscriptionPendingUpdateApplied, - #[serde(rename = "customer.subscription.pending_update_expired")] - CustomerSubscriptionPendingUpdateExpired, - #[serde(rename = "customer.subscription.resumed")] - CustomerSubscriptionResumed, - #[serde(rename = "customer.subscription.trial_will_end")] - CustomerSubscriptionTrialWillEnd, - #[serde(rename = "customer.subscription.updated")] - CustomerSubscriptionUpdated, - #[serde(rename = "customer.tax_id.created")] - CustomerTaxIdCreated, - #[serde(rename = "customer.tax_id.deleted")] - CustomerTaxIdDeleted, - #[serde(rename = "customer.tax_id.updated")] - CustomerTaxIdUpdated, - #[serde(rename = "customer.updated")] - CustomerUpdated, - #[serde(rename = "customer_cash_balance_transaction.created")] - CustomerCashBalanceTransactionCreated, - #[serde(rename = "file.created")] - FileCreated, - #[serde(rename = "financial_connections.account.created")] - FinancialConnectionsAccountCreated, - #[serde(rename = "financial_connections.account.deactivated")] - FinancialConnectionsAccountDeactivated, - #[serde(rename = "financial_connections.account.disconnected")] - FinancialConnectionsAccountDisconnected, - #[serde(rename = "financial_connections.account.reactivated")] - FinancialConnectionsAccountReactivated, - #[serde(rename = "financial_connections.account.refreshed_balance")] - FinancialConnectionsAccountRefreshedBalance, - #[serde(rename = "financial_connections.account.refreshed_transactions")] - FinancialConnectionsAccountRefreshedTransactions, - #[serde(rename = "identity.verification_session.canceled")] - IdentityVerificationSessionCanceled, - #[serde(rename = "identity.verification_session.created")] - IdentityVerificationSessionCreated, - #[serde(rename = "identity.verification_session.processing")] - IdentityVerificationSessionProcessing, - #[serde(rename = "identity.verification_session.redacted")] - IdentityVerificationSessionRedacted, - #[serde(rename = "identity.verification_session.requires_input")] - IdentityVerificationSessionRequiresInput, - #[serde(rename = "identity.verification_session.verified")] - IdentityVerificationSessionVerified, - #[serde(rename = "invoice.created")] - InvoiceCreated, - #[serde(rename = "invoice.deleted")] - InvoiceDeleted, - #[serde(rename = "invoice.finalization_failed")] - InvoiceFinalizationFailed, - #[serde(rename = "invoice.finalized")] - InvoiceFinalized, - #[serde(rename = "invoice.marked_uncollectible")] - InvoiceMarkedUncollectible, - #[serde(rename = "invoice.paid")] - InvoicePaid, - #[serde(rename = "invoice.payment_action_required")] - InvoicePaymentActionRequired, - #[serde(rename = "invoice.payment_failed")] - InvoicePaymentFailed, - #[serde(rename = "invoice.payment_succeeded")] - InvoicePaymentSucceeded, - #[serde(rename = "invoice.sent")] - InvoiceSent, - #[serde(rename = "invoice.upcoming")] - InvoiceUpcoming, - #[serde(rename = "invoice.updated")] - InvoiceUpdated, - #[serde(rename = "invoice.voided")] - InvoiceVoided, - #[serde(rename = "invoiceitem.created")] - InvoiceitemCreated, - #[serde(rename = "invoiceitem.deleted")] - InvoiceitemDeleted, - #[serde(rename = "issuing_authorization.created")] - IssuingAuthorizationCreated, - #[serde(rename = "issuing_authorization.request")] - IssuingAuthorizationRequest, - #[serde(rename = "issuing_authorization.updated")] - IssuingAuthorizationUpdated, - #[serde(rename = "issuing_card.created")] - IssuingCardCreated, - #[serde(rename = "issuing_card.updated")] - IssuingCardUpdated, - #[serde(rename = "issuing_cardholder.created")] - IssuingCardholderCreated, - #[serde(rename = "issuing_cardholder.updated")] - IssuingCardholderUpdated, - #[serde(rename = "issuing_dispute.closed")] - IssuingDisputeClosed, - #[serde(rename = "issuing_dispute.created")] - IssuingDisputeCreated, - #[serde(rename = "issuing_dispute.funds_reinstated")] - IssuingDisputeFundsReinstated, - #[serde(rename = "issuing_dispute.submitted")] - IssuingDisputeSubmitted, - #[serde(rename = "issuing_dispute.updated")] - IssuingDisputeUpdated, - #[serde(rename = "issuing_token.created")] - IssuingTokenCreated, - #[serde(rename = "issuing_token.updated")] - IssuingTokenUpdated, - #[serde(rename = "issuing_transaction.created")] - IssuingTransactionCreated, - #[serde(rename = "issuing_transaction.updated")] - IssuingTransactionUpdated, - #[serde(rename = "mandate.updated")] - MandateUpdated, - #[serde(rename = "payment_intent.amount_capturable_updated")] - PaymentIntentAmountCapturableUpdated, - #[serde(rename = "payment_intent.canceled")] - PaymentIntentCanceled, - #[serde(rename = "payment_intent.created")] - PaymentIntentCreated, - #[serde(rename = "payment_intent.partially_funded")] - PaymentIntentPartiallyFunded, - #[serde(rename = "payment_intent.payment_failed")] - PaymentIntentPaymentFailed, - #[serde(rename = "payment_intent.processing")] - PaymentIntentProcessing, - #[serde(rename = "payment_intent.requires_action")] - PaymentIntentRequiresAction, - #[serde(rename = "payment_intent.succeeded")] - PaymentIntentSucceeded, - #[serde(rename = "payment_link.created")] - PaymentLinkCreated, - #[serde(rename = "payment_link.updated")] - PaymentLinkUpdated, - #[serde(rename = "payment_method.attached")] - PaymentMethodAttached, - #[serde(rename = "payment_method.automatically_updated")] - PaymentMethodAutomaticallyUpdated, - #[serde(rename = "payment_method.detached")] - PaymentMethodDetached, - #[serde(rename = "payment_method.updated")] - PaymentMethodUpdated, - #[serde(rename = "payout.canceled")] - PayoutCanceled, - #[serde(rename = "payout.created")] - PayoutCreated, - #[serde(rename = "payout.failed")] - PayoutFailed, - #[serde(rename = "payout.paid")] - PayoutPaid, - #[serde(rename = "payout.reconciliation_completed")] - PayoutReconciliationCompleted, - #[serde(rename = "payout.updated")] - PayoutUpdated, - #[serde(rename = "person.created")] - PersonCreated, - #[serde(rename = "person.deleted")] - PersonDeleted, - #[serde(rename = "person.updated")] - PersonUpdated, - #[serde(rename = "plan.created")] - PlanCreated, - #[serde(rename = "plan.deleted")] - PlanDeleted, - #[serde(rename = "plan.updated")] - PlanUpdated, - #[serde(rename = "price.created")] - PriceCreated, - #[serde(rename = "price.deleted")] - PriceDeleted, - #[serde(rename = "price.updated")] - PriceUpdated, - #[serde(rename = "product.created")] - ProductCreated, - #[serde(rename = "product.deleted")] - ProductDeleted, - #[serde(rename = "product.updated")] - ProductUpdated, - #[serde(rename = "promotion_code.created")] - PromotionCodeCreated, - #[serde(rename = "promotion_code.updated")] - PromotionCodeUpdated, - #[serde(rename = "quote.accepted")] - QuoteAccepted, - #[serde(rename = "quote.canceled")] - QuoteCanceled, - #[serde(rename = "quote.created")] - QuoteCreated, - #[serde(rename = "quote.finalized")] - QuoteFinalized, - #[serde(rename = "radar.early_fraud_warning.created")] - RadarEarlyFraudWarningCreated, - #[serde(rename = "radar.early_fraud_warning.updated")] - RadarEarlyFraudWarningUpdated, - #[serde(rename = "refund.created")] - RefundCreated, - #[serde(rename = "refund.updated")] - RefundUpdated, - #[serde(rename = "reporting.report_run.failed")] - ReportingReportRunFailed, - #[serde(rename = "reporting.report_run.succeeded")] - ReportingReportRunSucceeded, - #[serde(rename = "reporting.report_type.updated")] - ReportingReportTypeUpdated, - #[serde(rename = "review.closed")] - ReviewClosed, - #[serde(rename = "review.opened")] - ReviewOpened, - #[serde(rename = "setup_intent.canceled")] - SetupIntentCanceled, - #[serde(rename = "setup_intent.created")] - SetupIntentCreated, - #[serde(rename = "setup_intent.requires_action")] - SetupIntentRequiresAction, - #[serde(rename = "setup_intent.setup_failed")] - SetupIntentSetupFailed, - #[serde(rename = "setup_intent.succeeded")] - SetupIntentSucceeded, - #[serde(rename = "sigma.scheduled_query_run.created")] - SigmaScheduledQueryRunCreated, - #[serde(rename = "source.canceled")] - SourceCanceled, - #[serde(rename = "source.chargeable")] - SourceChargeable, - #[serde(rename = "source.failed")] - SourceFailed, - #[serde(rename = "source.mandate_notification")] - SourceMandateNotification, - #[serde(rename = "source.refund_attributes_required")] - SourceRefundAttributesRequired, - #[serde(rename = "source.transaction.created")] - SourceTransactionCreated, - #[serde(rename = "source.transaction.updated")] - SourceTransactionUpdated, - #[serde(rename = "subscription_schedule.aborted")] - SubscriptionScheduleAborted, - #[serde(rename = "subscription_schedule.canceled")] - SubscriptionScheduleCanceled, - #[serde(rename = "subscription_schedule.completed")] - SubscriptionScheduleCompleted, - #[serde(rename = "subscription_schedule.created")] - SubscriptionScheduleCreated, - #[serde(rename = "subscription_schedule.expiring")] - SubscriptionScheduleExpiring, - #[serde(rename = "subscription_schedule.released")] - SubscriptionScheduleReleased, - #[serde(rename = "subscription_schedule.updated")] - SubscriptionScheduleUpdated, - #[serde(rename = "tax.settings.updated")] - TaxSettingsUpdated, - #[serde(rename = "tax_rate.created")] - TaxRateCreated, - #[serde(rename = "tax_rate.updated")] - TaxRateUpdated, - #[serde(rename = "terminal.reader.action_failed")] - TerminalReaderActionFailed, - #[serde(rename = "terminal.reader.action_succeeded")] - TerminalReaderActionSucceeded, - #[serde(rename = "test_helpers.test_clock.advancing")] - TestHelpersTestClockAdvancing, - #[serde(rename = "test_helpers.test_clock.created")] - TestHelpersTestClockCreated, - #[serde(rename = "test_helpers.test_clock.deleted")] - TestHelpersTestClockDeleted, - #[serde(rename = "test_helpers.test_clock.internal_failure")] - TestHelpersTestClockInternalFailure, - #[serde(rename = "test_helpers.test_clock.ready")] - TestHelpersTestClockReady, - #[serde(rename = "topup.canceled")] - TopupCanceled, - #[serde(rename = "topup.created")] - TopupCreated, - #[serde(rename = "topup.failed")] - TopupFailed, - #[serde(rename = "topup.reversed")] - TopupReversed, - #[serde(rename = "topup.succeeded")] - TopupSucceeded, - #[serde(rename = "transfer.created")] - TransferCreated, - #[serde(rename = "transfer.reversed")] - TransferReversed, - #[serde(rename = "transfer.updated")] - TransferUpdated, - #[serde(rename = "treasury.credit_reversal.created")] - TreasuryCreditReversalCreated, - #[serde(rename = "treasury.credit_reversal.posted")] - TreasuryCreditReversalPosted, - #[serde(rename = "treasury.debit_reversal.completed")] - TreasuryDebitReversalCompleted, - #[serde(rename = "treasury.debit_reversal.created")] - TreasuryDebitReversalCreated, - #[serde(rename = "treasury.debit_reversal.initial_credit_granted")] - TreasuryDebitReversalInitialCreditGranted, - #[serde(rename = "treasury.financial_account.closed")] - TreasuryFinancialAccountClosed, - #[serde(rename = "treasury.financial_account.created")] - TreasuryFinancialAccountCreated, - #[serde(rename = "treasury.financial_account.features_status_updated")] - TreasuryFinancialAccountFeaturesStatusUpdated, - #[serde(rename = "treasury.inbound_transfer.canceled")] - TreasuryInboundTransferCanceled, - #[serde(rename = "treasury.inbound_transfer.created")] - TreasuryInboundTransferCreated, - #[serde(rename = "treasury.inbound_transfer.failed")] - TreasuryInboundTransferFailed, - #[serde(rename = "treasury.inbound_transfer.succeeded")] - TreasuryInboundTransferSucceeded, - #[serde(rename = "treasury.outbound_payment.canceled")] - TreasuryOutboundPaymentCanceled, - #[serde(rename = "treasury.outbound_payment.created")] - TreasuryOutboundPaymentCreated, - #[serde(rename = "treasury.outbound_payment.expected_arrival_date_updated")] - TreasuryOutboundPaymentExpectedArrivalDateUpdated, - #[serde(rename = "treasury.outbound_payment.failed")] - TreasuryOutboundPaymentFailed, - #[serde(rename = "treasury.outbound_payment.posted")] - TreasuryOutboundPaymentPosted, - #[serde(rename = "treasury.outbound_payment.returned")] - TreasuryOutboundPaymentReturned, - #[serde(rename = "treasury.outbound_transfer.canceled")] - TreasuryOutboundTransferCanceled, - #[serde(rename = "treasury.outbound_transfer.created")] - TreasuryOutboundTransferCreated, - #[serde(rename = "treasury.outbound_transfer.expected_arrival_date_updated")] - TreasuryOutboundTransferExpectedArrivalDateUpdated, - #[serde(rename = "treasury.outbound_transfer.failed")] - TreasuryOutboundTransferFailed, - #[serde(rename = "treasury.outbound_transfer.posted")] - TreasuryOutboundTransferPosted, - #[serde(rename = "treasury.outbound_transfer.returned")] - TreasuryOutboundTransferReturned, - #[serde(rename = "treasury.received_credit.created")] - TreasuryReceivedCreditCreated, - #[serde(rename = "treasury.received_credit.failed")] - TreasuryReceivedCreditFailed, - #[serde(rename = "treasury.received_credit.succeeded")] - TreasuryReceivedCreditSucceeded, - #[serde(rename = "treasury.received_debit.created")] - TreasuryReceivedDebitCreated, -} - -impl EventFilter { - pub fn as_str(self) -> &'static str { - match self { - EventFilter::All => "*", - EventFilter::AccountApplicationAuthorized => "account.application.authorized", - EventFilter::AccountApplicationDeauthorized => "account.application.deauthorized", - EventFilter::AccountExternalAccountCreated => "account.external_account.created", - EventFilter::AccountExternalAccountDeleted => "account.external_account.deleted", - EventFilter::AccountExternalAccountUpdated => "account.external_account.updated", - EventFilter::AccountUpdated => "account.updated", - EventFilter::ApplicationFeeCreated => "application_fee.created", - EventFilter::ApplicationFeeRefundUpdated => "application_fee.refund.updated", - EventFilter::ApplicationFeeRefunded => "application_fee.refunded", - EventFilter::BalanceAvailable => "balance.available", - EventFilter::BillingPortalConfigurationCreated => { - "billing_portal.configuration.created" - } - EventFilter::BillingPortalConfigurationUpdated => { - "billing_portal.configuration.updated" - } - EventFilter::BillingPortalSessionCreated => "billing_portal.session.created", - EventFilter::CapabilityUpdated => "capability.updated", - EventFilter::CashBalanceFundsAvailable => "cash_balance.funds_available", - EventFilter::ChargeCaptured => "charge.captured", - EventFilter::ChargeDisputeClosed => "charge.dispute.closed", - EventFilter::ChargeDisputeCreated => "charge.dispute.created", - EventFilter::ChargeDisputeFundsReinstated => "charge.dispute.funds_reinstated", - EventFilter::ChargeDisputeFundsWithdrawn => "charge.dispute.funds_withdrawn", - EventFilter::ChargeDisputeUpdated => "charge.dispute.updated", - EventFilter::ChargeExpired => "charge.expired", - EventFilter::ChargeFailed => "charge.failed", - EventFilter::ChargePending => "charge.pending", - EventFilter::ChargeRefundUpdated => "charge.refund.updated", - EventFilter::ChargeRefunded => "charge.refunded", - EventFilter::ChargeSucceeded => "charge.succeeded", - EventFilter::ChargeUpdated => "charge.updated", - EventFilter::CheckoutSessionAsyncPaymentFailed => { - "checkout.session.async_payment_failed" - } - EventFilter::CheckoutSessionAsyncPaymentSucceeded => { - "checkout.session.async_payment_succeeded" - } - EventFilter::CheckoutSessionCompleted => "checkout.session.completed", - EventFilter::CheckoutSessionExpired => "checkout.session.expired", - EventFilter::ClimateOrderCanceled => "climate.order.canceled", - EventFilter::ClimateOrderCreated => "climate.order.created", - EventFilter::ClimateOrderDelayed => "climate.order.delayed", - EventFilter::ClimateOrderDelivered => "climate.order.delivered", - EventFilter::ClimateOrderProductSubstituted => "climate.order.product_substituted", - EventFilter::ClimateProductCreated => "climate.product.created", - EventFilter::ClimateProductPricingUpdated => "climate.product.pricing_updated", - EventFilter::CouponCreated => "coupon.created", - EventFilter::CouponDeleted => "coupon.deleted", - EventFilter::CouponUpdated => "coupon.updated", - EventFilter::CreditNoteCreated => "credit_note.created", - EventFilter::CreditNoteUpdated => "credit_note.updated", - EventFilter::CreditNoteVoided => "credit_note.voided", - EventFilter::CustomerCreated => "customer.created", - EventFilter::CustomerDeleted => "customer.deleted", - EventFilter::CustomerDiscountCreated => "customer.discount.created", - EventFilter::CustomerDiscountDeleted => "customer.discount.deleted", - EventFilter::CustomerDiscountUpdated => "customer.discount.updated", - EventFilter::CustomerSourceCreated => "customer.source.created", - EventFilter::CustomerSourceDeleted => "customer.source.deleted", - EventFilter::CustomerSourceExpiring => "customer.source.expiring", - EventFilter::CustomerSourceUpdated => "customer.source.updated", - EventFilter::CustomerSubscriptionCreated => "customer.subscription.created", - EventFilter::CustomerSubscriptionDeleted => "customer.subscription.deleted", - EventFilter::CustomerSubscriptionPaused => "customer.subscription.paused", - EventFilter::CustomerSubscriptionPendingUpdateApplied => { - "customer.subscription.pending_update_applied" - } - EventFilter::CustomerSubscriptionPendingUpdateExpired => { - "customer.subscription.pending_update_expired" - } - EventFilter::CustomerSubscriptionResumed => "customer.subscription.resumed", - EventFilter::CustomerSubscriptionTrialWillEnd => "customer.subscription.trial_will_end", - EventFilter::CustomerSubscriptionUpdated => "customer.subscription.updated", - EventFilter::CustomerTaxIdCreated => "customer.tax_id.created", - EventFilter::CustomerTaxIdDeleted => "customer.tax_id.deleted", - EventFilter::CustomerTaxIdUpdated => "customer.tax_id.updated", - EventFilter::CustomerUpdated => "customer.updated", - EventFilter::CustomerCashBalanceTransactionCreated => { - "customer_cash_balance_transaction.created" - } - EventFilter::FileCreated => "file.created", - EventFilter::FinancialConnectionsAccountCreated => { - "financial_connections.account.created" - } - EventFilter::FinancialConnectionsAccountDeactivated => { - "financial_connections.account.deactivated" - } - EventFilter::FinancialConnectionsAccountDisconnected => { - "financial_connections.account.disconnected" - } - EventFilter::FinancialConnectionsAccountReactivated => { - "financial_connections.account.reactivated" - } - EventFilter::FinancialConnectionsAccountRefreshedBalance => { - "financial_connections.account.refreshed_balance" - } - EventFilter::FinancialConnectionsAccountRefreshedTransactions => { - "financial_connections.account.refreshed_transactions" - } - EventFilter::IdentityVerificationSessionCanceled => { - "identity.verification_session.canceled" - } - EventFilter::IdentityVerificationSessionCreated => { - "identity.verification_session.created" - } - EventFilter::IdentityVerificationSessionProcessing => { - "identity.verification_session.processing" - } - EventFilter::IdentityVerificationSessionRedacted => { - "identity.verification_session.redacted" - } - EventFilter::IdentityVerificationSessionRequiresInput => { - "identity.verification_session.requires_input" - } - EventFilter::IdentityVerificationSessionVerified => { - "identity.verification_session.verified" - } - EventFilter::InvoiceCreated => "invoice.created", - EventFilter::InvoiceDeleted => "invoice.deleted", - EventFilter::InvoiceFinalizationFailed => "invoice.finalization_failed", - EventFilter::InvoiceFinalized => "invoice.finalized", - EventFilter::InvoiceMarkedUncollectible => "invoice.marked_uncollectible", - EventFilter::InvoicePaid => "invoice.paid", - EventFilter::InvoicePaymentActionRequired => "invoice.payment_action_required", - EventFilter::InvoicePaymentFailed => "invoice.payment_failed", - EventFilter::InvoicePaymentSucceeded => "invoice.payment_succeeded", - EventFilter::InvoiceSent => "invoice.sent", - EventFilter::InvoiceUpcoming => "invoice.upcoming", - EventFilter::InvoiceUpdated => "invoice.updated", - EventFilter::InvoiceVoided => "invoice.voided", - EventFilter::InvoiceitemCreated => "invoiceitem.created", - EventFilter::InvoiceitemDeleted => "invoiceitem.deleted", - EventFilter::IssuingAuthorizationCreated => "issuing_authorization.created", - EventFilter::IssuingAuthorizationRequest => "issuing_authorization.request", - EventFilter::IssuingAuthorizationUpdated => "issuing_authorization.updated", - EventFilter::IssuingCardCreated => "issuing_card.created", - EventFilter::IssuingCardUpdated => "issuing_card.updated", - EventFilter::IssuingCardholderCreated => "issuing_cardholder.created", - EventFilter::IssuingCardholderUpdated => "issuing_cardholder.updated", - EventFilter::IssuingDisputeClosed => "issuing_dispute.closed", - EventFilter::IssuingDisputeCreated => "issuing_dispute.created", - EventFilter::IssuingDisputeFundsReinstated => "issuing_dispute.funds_reinstated", - EventFilter::IssuingDisputeSubmitted => "issuing_dispute.submitted", - EventFilter::IssuingDisputeUpdated => "issuing_dispute.updated", - EventFilter::IssuingTokenCreated => "issuing_token.created", - EventFilter::IssuingTokenUpdated => "issuing_token.updated", - EventFilter::IssuingTransactionCreated => "issuing_transaction.created", - EventFilter::IssuingTransactionUpdated => "issuing_transaction.updated", - EventFilter::MandateUpdated => "mandate.updated", - EventFilter::PaymentIntentAmountCapturableUpdated => { - "payment_intent.amount_capturable_updated" - } - EventFilter::PaymentIntentCanceled => "payment_intent.canceled", - EventFilter::PaymentIntentCreated => "payment_intent.created", - EventFilter::PaymentIntentPartiallyFunded => "payment_intent.partially_funded", - EventFilter::PaymentIntentPaymentFailed => "payment_intent.payment_failed", - EventFilter::PaymentIntentProcessing => "payment_intent.processing", - EventFilter::PaymentIntentRequiresAction => "payment_intent.requires_action", - EventFilter::PaymentIntentSucceeded => "payment_intent.succeeded", - EventFilter::PaymentLinkCreated => "payment_link.created", - EventFilter::PaymentLinkUpdated => "payment_link.updated", - EventFilter::PaymentMethodAttached => "payment_method.attached", - EventFilter::PaymentMethodAutomaticallyUpdated => { - "payment_method.automatically_updated" - } - EventFilter::PaymentMethodDetached => "payment_method.detached", - EventFilter::PaymentMethodUpdated => "payment_method.updated", - EventFilter::PayoutCanceled => "payout.canceled", - EventFilter::PayoutCreated => "payout.created", - EventFilter::PayoutFailed => "payout.failed", - EventFilter::PayoutPaid => "payout.paid", - EventFilter::PayoutReconciliationCompleted => "payout.reconciliation_completed", - EventFilter::PayoutUpdated => "payout.updated", - EventFilter::PersonCreated => "person.created", - EventFilter::PersonDeleted => "person.deleted", - EventFilter::PersonUpdated => "person.updated", - EventFilter::PlanCreated => "plan.created", - EventFilter::PlanDeleted => "plan.deleted", - EventFilter::PlanUpdated => "plan.updated", - EventFilter::PriceCreated => "price.created", - EventFilter::PriceDeleted => "price.deleted", - EventFilter::PriceUpdated => "price.updated", - EventFilter::ProductCreated => "product.created", - EventFilter::ProductDeleted => "product.deleted", - EventFilter::ProductUpdated => "product.updated", - EventFilter::PromotionCodeCreated => "promotion_code.created", - EventFilter::PromotionCodeUpdated => "promotion_code.updated", - EventFilter::QuoteAccepted => "quote.accepted", - EventFilter::QuoteCanceled => "quote.canceled", - EventFilter::QuoteCreated => "quote.created", - EventFilter::QuoteFinalized => "quote.finalized", - EventFilter::RadarEarlyFraudWarningCreated => "radar.early_fraud_warning.created", - EventFilter::RadarEarlyFraudWarningUpdated => "radar.early_fraud_warning.updated", - EventFilter::RefundCreated => "refund.created", - EventFilter::RefundUpdated => "refund.updated", - EventFilter::ReportingReportRunFailed => "reporting.report_run.failed", - EventFilter::ReportingReportRunSucceeded => "reporting.report_run.succeeded", - EventFilter::ReportingReportTypeUpdated => "reporting.report_type.updated", - EventFilter::ReviewClosed => "review.closed", - EventFilter::ReviewOpened => "review.opened", - EventFilter::SetupIntentCanceled => "setup_intent.canceled", - EventFilter::SetupIntentCreated => "setup_intent.created", - EventFilter::SetupIntentRequiresAction => "setup_intent.requires_action", - EventFilter::SetupIntentSetupFailed => "setup_intent.setup_failed", - EventFilter::SetupIntentSucceeded => "setup_intent.succeeded", - EventFilter::SigmaScheduledQueryRunCreated => "sigma.scheduled_query_run.created", - EventFilter::SourceCanceled => "source.canceled", - EventFilter::SourceChargeable => "source.chargeable", - EventFilter::SourceFailed => "source.failed", - EventFilter::SourceMandateNotification => "source.mandate_notification", - EventFilter::SourceRefundAttributesRequired => "source.refund_attributes_required", - EventFilter::SourceTransactionCreated => "source.transaction.created", - EventFilter::SourceTransactionUpdated => "source.transaction.updated", - EventFilter::SubscriptionScheduleAborted => "subscription_schedule.aborted", - EventFilter::SubscriptionScheduleCanceled => "subscription_schedule.canceled", - EventFilter::SubscriptionScheduleCompleted => "subscription_schedule.completed", - EventFilter::SubscriptionScheduleCreated => "subscription_schedule.created", - EventFilter::SubscriptionScheduleExpiring => "subscription_schedule.expiring", - EventFilter::SubscriptionScheduleReleased => "subscription_schedule.released", - EventFilter::SubscriptionScheduleUpdated => "subscription_schedule.updated", - EventFilter::TaxSettingsUpdated => "tax.settings.updated", - EventFilter::TaxRateCreated => "tax_rate.created", - EventFilter::TaxRateUpdated => "tax_rate.updated", - EventFilter::TerminalReaderActionFailed => "terminal.reader.action_failed", - EventFilter::TerminalReaderActionSucceeded => "terminal.reader.action_succeeded", - EventFilter::TestHelpersTestClockAdvancing => "test_helpers.test_clock.advancing", - EventFilter::TestHelpersTestClockCreated => "test_helpers.test_clock.created", - EventFilter::TestHelpersTestClockDeleted => "test_helpers.test_clock.deleted", - EventFilter::TestHelpersTestClockInternalFailure => { - "test_helpers.test_clock.internal_failure" - } - EventFilter::TestHelpersTestClockReady => "test_helpers.test_clock.ready", - EventFilter::TopupCanceled => "topup.canceled", - EventFilter::TopupCreated => "topup.created", - EventFilter::TopupFailed => "topup.failed", - EventFilter::TopupReversed => "topup.reversed", - EventFilter::TopupSucceeded => "topup.succeeded", - EventFilter::TransferCreated => "transfer.created", - EventFilter::TransferReversed => "transfer.reversed", - EventFilter::TransferUpdated => "transfer.updated", - EventFilter::TreasuryCreditReversalCreated => "treasury.credit_reversal.created", - EventFilter::TreasuryCreditReversalPosted => "treasury.credit_reversal.posted", - EventFilter::TreasuryDebitReversalCompleted => "treasury.debit_reversal.completed", - EventFilter::TreasuryDebitReversalCreated => "treasury.debit_reversal.created", - EventFilter::TreasuryDebitReversalInitialCreditGranted => { - "treasury.debit_reversal.initial_credit_granted" - } - EventFilter::TreasuryFinancialAccountClosed => "treasury.financial_account.closed", - EventFilter::TreasuryFinancialAccountCreated => "treasury.financial_account.created", - EventFilter::TreasuryFinancialAccountFeaturesStatusUpdated => { - "treasury.financial_account.features_status_updated" - } - EventFilter::TreasuryInboundTransferCanceled => "treasury.inbound_transfer.canceled", - EventFilter::TreasuryInboundTransferCreated => "treasury.inbound_transfer.created", - EventFilter::TreasuryInboundTransferFailed => "treasury.inbound_transfer.failed", - EventFilter::TreasuryInboundTransferSucceeded => "treasury.inbound_transfer.succeeded", - EventFilter::TreasuryOutboundPaymentCanceled => "treasury.outbound_payment.canceled", - EventFilter::TreasuryOutboundPaymentCreated => "treasury.outbound_payment.created", - EventFilter::TreasuryOutboundPaymentExpectedArrivalDateUpdated => { - "treasury.outbound_payment.expected_arrival_date_updated" - } - EventFilter::TreasuryOutboundPaymentFailed => "treasury.outbound_payment.failed", - EventFilter::TreasuryOutboundPaymentPosted => "treasury.outbound_payment.posted", - EventFilter::TreasuryOutboundPaymentReturned => "treasury.outbound_payment.returned", - EventFilter::TreasuryOutboundTransferCanceled => "treasury.outbound_transfer.canceled", - EventFilter::TreasuryOutboundTransferCreated => "treasury.outbound_transfer.created", - EventFilter::TreasuryOutboundTransferExpectedArrivalDateUpdated => { - "treasury.outbound_transfer.expected_arrival_date_updated" - } - EventFilter::TreasuryOutboundTransferFailed => "treasury.outbound_transfer.failed", - EventFilter::TreasuryOutboundTransferPosted => "treasury.outbound_transfer.posted", - EventFilter::TreasuryOutboundTransferReturned => "treasury.outbound_transfer.returned", - EventFilter::TreasuryReceivedCreditCreated => "treasury.received_credit.created", - EventFilter::TreasuryReceivedCreditFailed => "treasury.received_credit.failed", - EventFilter::TreasuryReceivedCreditSucceeded => "treasury.received_credit.succeeded", - EventFilter::TreasuryReceivedDebitCreated => "treasury.received_debit.created", - } - } -} - -impl AsRef for EventFilter { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for EventFilter { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} -impl std::default::Default for EventFilter { - fn default() -> Self { - Self::All - } -} diff --git a/src/resources/invoice_ext.rs b/src/resources/invoice_ext.rs deleted file mode 100644 index 93b5ef8f1..000000000 --- a/src/resources/invoice_ext.rs +++ /dev/null @@ -1,113 +0,0 @@ -use serde::Serialize; - -use crate::client::{Client, Response}; -use crate::ids::{CouponId, CustomerId, InvoiceId, PlanId, SubscriptionId, SubscriptionItemId}; -use crate::params::{Metadata, SearchList, Timestamp}; -use crate::resources::{CollectionMethod, Invoice}; - -#[deprecated(since = "0.12.0")] -pub type InvoiceCollectionMethod = CollectionMethod; - -impl Invoice { - /// Retrieves the details of an upcoming invoice_id - /// - /// For more details see . - pub fn upcoming(client: &Client, params: RetrieveUpcomingInvoice) -> Response { - client.get_query("/invoices/upcoming", ¶ms) - } - - /// Finalizes an invoice. - /// - /// For more details see . - pub fn finalize( - client: &Client, - invoice_id: &InvoiceId, - params: FinalizeInvoiceParams, - ) -> Response { - client.post_form(&format!("/invoices/{}/finalize", invoice_id), params) - } - - /// Pays an invoice. - /// - /// For more details see . - pub fn pay(client: &Client, invoice_id: &InvoiceId) -> Response { - client.post(&format!("/invoices/{}/pay", invoice_id)) - } - - /// Searches for an invoice. - /// - /// For more details see . - pub fn search(client: &Client, params: InvoiceSearchParams) -> Response> { - client.get_query("/invoices/search", params) - } -} - -#[derive(Clone, Debug, Serialize)] -pub struct RetrieveUpcomingInvoice { - pub customer: CustomerId, // this is a required param - #[serde(skip_serializing_if = "Option::is_none")] - pub coupon: Option, - #[serde(skip_serializing_if = "Option::is_none")] - pub subscription: Option, - #[serde(skip_serializing_if = "Option::is_none")] - pub subscription_items: Option, - #[serde(skip_serializing_if = "Option::is_none")] - pub subscription_prorate: Option, - #[serde(skip_serializing_if = "Option::is_none")] - pub subscription_proration_date: Option, - #[serde(skip_serializing_if = "Option::is_none")] - pub subscription_tax_percent: Option, - #[serde(skip_serializing_if = "Option::is_none")] - pub subscription_trial_end: Option, -} - -impl RetrieveUpcomingInvoice { - pub fn new(customer: CustomerId) -> Self { - RetrieveUpcomingInvoice { - customer, - coupon: None, - subscription: None, - subscription_items: None, - subscription_prorate: None, - subscription_proration_date: None, - subscription_tax_percent: None, - subscription_trial_end: None, - } - } -} - -#[derive(Clone, Debug, Serialize)] -pub struct SubscriptionItemFilter { - #[serde(skip_serializing_if = "Option::is_none")] - pub id: Option, - #[serde(skip_serializing_if = "Option::is_none")] - pub deleted: Option, - #[serde(skip_serializing_if = "Option::is_none")] - pub metadata: Option, - #[serde(skip_serializing_if = "Option::is_none")] - pub plan: Option, - #[serde(skip_serializing_if = "Option::is_none")] - pub quantity: Option, -} - -#[derive(Clone, Debug, Default, Serialize)] -pub struct InvoiceSearchParams<'a> { - pub query: String, - #[serde(skip_serializing_if = "Option::is_none")] - pub limit: Option, - #[serde(skip_serializing_if = "Option::is_none")] - pub page: Option, - pub expand: &'a [&'a str], -} - -impl<'a> InvoiceSearchParams<'a> { - pub fn new() -> InvoiceSearchParams<'a> { - InvoiceSearchParams { query: String::new(), limit: None, page: None, expand: &[] } - } -} - -#[derive(Clone, Debug, Default, Serialize)] -pub struct FinalizeInvoiceParams { - #[serde(skip_serializing_if = "Option::is_none")] - pub auto_advance: Option, -} diff --git a/src/resources/issuing_authorization_ext.rs b/src/resources/issuing_authorization_ext.rs deleted file mode 100644 index 8d262dc40..000000000 --- a/src/resources/issuing_authorization_ext.rs +++ /dev/null @@ -1,93 +0,0 @@ -use serde::{Deserialize, Serialize}; - -/// An enum representing the possible values of the `IssuingAuthorizationVerificationData` fields. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum IssuingAuthorizationCheck { - Match, - Mismatch, - NotProvided, -} - -impl std::default::Default for IssuingAuthorizationCheck { - fn default() -> Self { - Self::NotProvided - } -} - -/// An enum representing the possible values of the `IssuingAuthorization`'s `authorization_method` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum IssuingAuthorizationMethod { - KeyedIn, - Swipe, - Chip, - Contactless, - Online, -} - -impl std::default::Default for IssuingAuthorizationMethod { - fn default() -> Self { - Self::Online - } -} - -/// An enum representing the possible values of the `IssuingAuthorizationRequest`'s `reason` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum IssuingAuthorizationReason { - AuthenticationFailed, - AuthorizationControls, - CardActive, - CardInactive, - InsufficientFunds, - AccountComplianceDisabled, - AccountInactive, - SuspectedFraud, - WebhookApproved, - WebhookDeclined, - WebhookTimeout, -} - -impl std::default::Default for IssuingAuthorizationReason { - fn default() -> Self { - Self::AuthenticationFailed - } -} - -/// An enum representing the possible values of an `IssuingAuthorization`'s `wallet_provider` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum IssuingAuthorizationWalletProvider { - ApplePay, - GooglePay, - SamsungPay, -} - -impl IssuingAuthorizationWalletProvider { - pub fn as_str(self) -> &'static str { - match self { - IssuingAuthorizationWalletProvider::ApplePay => "apple_pay", - IssuingAuthorizationWalletProvider::GooglePay => "google_pay", - IssuingAuthorizationWalletProvider::SamsungPay => "samsung_pay", - } - } -} - -impl AsRef for IssuingAuthorizationWalletProvider { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for IssuingAuthorizationWalletProvider { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} - -impl std::default::Default for IssuingAuthorizationWalletProvider { - fn default() -> Self { - Self::ApplePay - } -} diff --git a/src/resources/issuing_card_ext.rs b/src/resources/issuing_card_ext.rs deleted file mode 100644 index 3a304b29b..000000000 --- a/src/resources/issuing_card_ext.rs +++ /dev/null @@ -1,137 +0,0 @@ -use serde::{Deserialize, Serialize}; - -/// An enum representing the possible values of an `IssuingCardPin`'s `status` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum IssuingCardPinStatus { - Active, - Blocked, -} - -impl IssuingCardPinStatus { - pub fn as_str(self) -> &'static str { - match self { - IssuingCardPinStatus::Active => "active", - IssuingCardPinStatus::Blocked => "blocked", - } - } -} - -impl AsRef for IssuingCardPinStatus { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for IssuingCardPinStatus { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} - -/// An enum representing the possible values of an `IssuingCardShipping`'s `status` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum IssuingCardShippingStatus { - Canceled, - Delivered, - Failure, - Pending, - Returned, - Shipped, -} - -impl IssuingCardShippingStatus { - pub fn as_str(self) -> &'static str { - match self { - IssuingCardShippingStatus::Canceled => "canceled", - IssuingCardShippingStatus::Delivered => "delivered", - IssuingCardShippingStatus::Failure => "failure", - IssuingCardShippingStatus::Pending => "pending", - IssuingCardShippingStatus::Returned => "returned", - IssuingCardShippingStatus::Shipped => "shipped", - } - } -} - -impl AsRef for IssuingCardShippingStatus { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for IssuingCardShippingStatus { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} - -/// An enum representing the possible values of an `IssuingCardShipping`'s `type` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum IssuingCardShippingType { - Bulk, - Individual, -} - -impl IssuingCardShippingType { - pub fn as_str(self) -> &'static str { - match self { - IssuingCardShippingType::Bulk => "bulk", - IssuingCardShippingType::Individual => "individual", - } - } -} - -impl AsRef for IssuingCardShippingType { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for IssuingCardShippingType { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} - -impl std::default::Default for IssuingCardShippingType { - fn default() -> Self { - Self::Individual - } -} - -/// An enum representing the possible values of an `IssuingCard`'s `type` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum IssuingCardType { - Physical, - Virtual, -} - -impl IssuingCardType { - pub fn as_str(self) -> &'static str { - match self { - IssuingCardType::Physical => "physical", - IssuingCardType::Virtual => "virtual", - } - } -} - -impl AsRef for IssuingCardType { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for IssuingCardType { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} - -impl std::default::Default for IssuingCardType { - fn default() -> Self { - Self::Physical - } -} diff --git a/src/resources/issuing_dispute_ext.rs b/src/resources/issuing_dispute_ext.rs deleted file mode 100644 index 850165ffe..000000000 --- a/src/resources/issuing_dispute_ext.rs +++ /dev/null @@ -1,69 +0,0 @@ -use serde::{Deserialize, Serialize}; - -/// An enum representing the possible values of an `IssuingDispute`'s `reason` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum IssuingDisputeReason { - Fraudulent, - Other, -} - -impl IssuingDisputeReason { - pub fn as_str(self) -> &'static str { - match self { - IssuingDisputeReason::Fraudulent => "fraudulent", - IssuingDisputeReason::Other => "other", - } - } -} - -impl AsRef for IssuingDisputeReason { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for IssuingDisputeReason { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} - -/// An enum representing the possible values of an `IssuingDispute`'s `status` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum IssuingDisputeStatus { - Lost, - UnderReview, - Unsubmitted, - Won, -} - -impl IssuingDisputeStatus { - pub fn as_str(self) -> &'static str { - match self { - IssuingDisputeStatus::Lost => "lost", - IssuingDisputeStatus::UnderReview => "under_review", - IssuingDisputeStatus::Unsubmitted => "unsubmitted", - IssuingDisputeStatus::Won => "won", - } - } -} - -impl AsRef for IssuingDisputeStatus { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for IssuingDisputeStatus { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} - -impl std::default::Default for IssuingDisputeStatus { - fn default() -> Self { - Self::Unsubmitted - } -} diff --git a/src/resources/issuing_merchant_data.rs b/src/resources/issuing_merchant_data.rs deleted file mode 100644 index da10ef759..000000000 --- a/src/resources/issuing_merchant_data.rs +++ /dev/null @@ -1,331 +0,0 @@ -use serde::{Deserialize, Serialize}; - -/// The resource representing a Stripe "IssuingAuthorizationMerchantData". -#[derive(Clone, Debug, Deserialize, Default, Serialize)] -pub struct MerchantData { - /// Identifier assigned to the seller by the card brand. - pub network_id: String, - - /// A categorization of the seller's type of business. - /// - /// See the [merchant categories guide](https://stripe.com/docs/issuing/merchant-categories) for a list of possible values. - pub category: MerchantCategory, - - /// Name of the seller. - #[serde(skip_serializing_if = "Option::is_none")] - pub name: Option, - - /// City where the seller is located. - #[serde(skip_serializing_if = "Option::is_none")] - pub city: Option, - - /// State where the seller is located. - #[serde(skip_serializing_if = "Option::is_none")] - pub state: Option, - - /// Country where the seller is located. - #[serde(skip_serializing_if = "Option::is_none")] - pub country: Option, - - /// Postal code where the seller is located. - #[serde(skip_serializing_if = "Option::is_none")] - pub postal_code: Option, -} - -/// An enum representing the industry of a merchant. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum MerchantCategory { - AcRefrigerationRepair, - AccountingBookkeepingServices, - AdvertisingServices, - AgriculturalCooperative, - AirlinesAirCarriers, - AirportsFlyingFields, - AmbulanceServices, - AmusementParksCarnivals, - AntiqueReproductions, - AntiqueShops, - Aquariums, - ArchitecturalSurveyingServices, - ArtDealersAndGalleries, - ArtistsSupplyAndCraftShops, - AutoAndHomeSupplyStores, - AutoBodyRepairShops, - AutoPaintShops, - AutoServiceShops, - AutomatedCashDisburse, - AutomatedFuelDispensers, - AutomobileAssociations, - AutomotivePartsAndAccessoriesStores, - AutomotiveTireStores, - BailAndBondPayments, - Bakeries, - BandsOrchestras, - BarberAndBeautyShops, - BettingCasinoGambling, - BicycleShops, - BilliardPoolEstablishments, - BoatDealers, - BoatRentalsAndLeases, - BookStores, - BooksPeriodicalsAndNewspapers, - BowlingAlleys, - BusLines, - BusinessSecretarialSchools, - BuyingShoppingServices, - CableSatelliteAndOtherPayTelevisionAndRadio, - CameraAndPhotographicSupplyStores, - CandyNutAndConfectioneryStores, - CarAndTruckDealersNewUsed, - CarAndTruckDealersUsedOnly, - CarRentalAgencies, - CarWashes, - CarpentryServices, - CarpetUpholsteryCleaning, - Caterers, - CharitableAndSocialServiceOrganizationsFundraising, - ChemicalsAndAlliedProducts, - ChidrensAndInfantsWearStores, - ChildCareServices, - ChiropodistsPodiatrists, - Chiropractors, - CigarStoresAndStands, - CivicSocialFraternalAssociations, - CleaningAndMaintenance, - ClothingRental, - CollegesUniversities, - CommercialEquipment, - CommercialFootwear, - CommercialPhotographyArtAndGraphics, - CommuterTransportAndFerries, - ComputerNetworkServices, - ComputerProgramming, - ComputerRepair, - ComputerSoftwareStores, - ComputersPeripheralsAndSoftware, - ConcreteWorkServices, - ConstructionMaterials, - ConsultingPublicRelations, - CorrespondenceSchools, - CosmeticStores, - CounselingServices, - CountryClubs, - CourierServices, - CourtCosts, - CreditReportingAgencies, - CruiseLines, - DairyProductsStores, - DanceHallStudiosSchools, - DatingEscortServices, - DentistsOrthodontists, - DepartmentStores, - DetectiveAgencies, - DirectMarketingCatalogMerchant, - DirectMarketingCombinationCatalogAndRetailMerchant, - DirectMarketingInboundTelemarketing, - DirectMarketingInsuranceServices, - DirectMarketingOther, - DirectMarketingOutboundTelemarketing, - DirectMarketingSubscription, - DirectMarketingTravel, - DiscountStores, - Doctors, - DoorToDoorSales, - DraperyWindowCoveringAndUpholsteryStores, - DrinkingPlaces, - DrugStoresAndPharmacies, - DrugsDrugProprietariesAndDruggistSundries, - DryCleaners, - DurableGoods, - DutyFreeStores, - EatingPlacesRestaurants, - EducationalServices, - ElectricRazorStores, - ElectricalPartsAndEquipment, - ElectricalServices, - ElectronicsRepairShops, - ElectronicsStores, - ElementarySecondarySchools, - EmploymentTempAgencies, - EquipmentRental, - ExterminatingServices, - FamilyClothingStores, - FastFoodRestaurants, - FinancialInstitutions, - FinesGovernmentAdministrativeEntities, - FireplaceFireplaceScreensAndAccessoriesStores, - FloorCoveringStores, - Florists, - FloristsSuppliesNurseryStockAndFlowers, - FreezerAndLockerMeatProvisioners, - FuelDealersNonAutomotive, - FuneralServicesCrematories, - FurnitureHomeFurnishingsAndEquipmentStoresExceptAppliances, - FurnitureRepairRefinishing, - FurriersAndFurShops, - GeneralServices, - GiftCardNoveltyAndSouvenirShops, - GlassPaintAndWallpaperStores, - GlasswareCrystalStores, - GolfCoursesPublic, - GovernmentServices, - GroceryStoresSupermarkets, - HardwareEquipmentAndSupplies, - HardwareStores, - HealthAndBeautySpas, - HearingAidsSalesAndSupplies, - #[serde(rename = "heating_plumbing_a_c")] - HeatingPlumbingAC, - HobbyToyAndGameShops, - HomeSupplyWarehouseStores, - Hospitals, - HotelsMotelsAndResorts, - HouseholdApplianceStores, - IndustrialSupplies, - InformationRetrievalServices, - InsuranceDefault, - InsuranceUnderwritingPremiums, - IntraCompanyPurchases, - JewelryStoresWatchesClocksAndSilverwareStores, - LandscapingServices, - Laundries, - LaundryCleaningServices, - LegalServicesAttorneys, - LuggageAndLeatherGoodsStores, - LumberBuildingMaterialsStores, - ManualCashDisburse, - MarinasServiceAndSupplies, - MasonryStoneworkAndPlaster, - MassageParlors, - MedicalAndDentalLabs, - MedicalDentalOphthalmicAndHospitalEquipmentAndSupplies, - MedicalServices, - MembershipOrganizations, - MensAndBoysClothingAndAccessoriesStores, - MensWomensClothingStores, - MetalServiceCenters, - Miscellaneous, - MiscellaneousApparelAndAccessoryShops, - MiscellaneousAutoDealers, - MiscellaneousBusinessServices, - MiscellaneousFoodStores, - MiscellaneousGeneralMerchandise, - MiscellaneousGeneralServices, - MiscellaneousHomeFurnishingSpecialtyStores, - MiscellaneousPublishingAndPrinting, - MiscellaneousRecreationServices, - MiscellaneousRepairShops, - MiscellaneousSpecialtyRetail, - MobileHomeDealers, - MotionPictureTheaters, - MotorFreightCarriersAndTrucking, - MotorHomesDealers, - MotorVehicleSuppliesAndNewParts, - MotorcycleShopsAndDealers, - MotorcycleShopsDealers, - MusicStoresMusicalInstrumentsPianosAndSheetMusic, - NewsDealersAndNewsstands, - NonFiMoneyOrders, - NonFiStoredValueCardPurchaseLoad, - NondurableGoods, - NurseriesLawnAndGardenSupplyStores, - NursingPersonalCare, - OfficeAndCommercialFurniture, - OpticiansEyeglasses, - OptometristsOphthalmologist, - OrthopedicGoodsProstheticDevices, - Osteopaths, - PackageStoresBeerWineAndLiquor, - PaintsVarnishesAndSupplies, - ParkingLotsGarages, - PassengerRailways, - PawnShops, - PetShopsPetFoodAndSupplies, - PetroleumAndPetroleumProducts, - PhotoDeveloping, - PhotographicPhotocopyMicrofilmEquipmentAndSupplies, - PhotographicStudios, - PictureVideoProduction, - PieceGoodsNotionsAndOtherDryGoods, - PlumbingHeatingEquipmentAndSupplies, - PoliticalOrganizations, - PostalServicesGovernmentOnly, - PreciousStonesAndMetalsWatchesAndJewelry, - ProfessionalServices, - PublicWarehousingAndStorage, - QuickCopyReproAndBlueprint, - Railroads, - RealEstateAgentsAndManagersRentals, - RecordStores, - RecreationalVehicleRentals, - ReligiousGoodsStores, - ReligiousOrganizations, - RoofingSidingSheetMetal, - SecretarialSupportServices, - SecurityBrokersDealers, - ServiceStations, - SewingNeedleworkFabricAndPieceGoodsStores, - ShoeRepairHatCleaning, - ShoeStores, - SmallApplianceRepair, - SnowmobileDealers, - SpecialTradeServices, - SpecialtyCleaning, - SportingGoodsStores, - SportingRecreationCamps, - SportsAndRidingApparelStores, - SportsClubsFields, - StampAndCoinStores, - StationaryOfficeSuppliesPrintingAndWritingPaper, - StationeryStoresOfficeAndSchoolSupplyStores, - SwimmingPoolsSales, - TUiTravelGermany, - TailorsAlterations, - TaxPaymentsGovernmentAgencies, - TaxPreparationServices, - TaxicabsLimousines, - TelecommunicationEquipmentAndTelephoneSales, - TelecommunicationServices, - TelegraphServices, - TentAndAwningShops, - TestingLaboratories, - TheatricalTicketAgencies, - Timeshares, - TireRetreadingAndRepair, - TollsBridgeFees, - TouristAttractionsAndExhibits, - TowingServices, - TrailerParksCampgrounds, - TransportationServices, - TravelAgenciesTourOperators, - TruckStopIteration, - TruckUtilityTrailerRentals, - TypesettingPlateMakingAndRelatedServices, - TypewriterStores, - #[serde(rename = "u_s_federal_government_agencies_or_departments")] - USFederalGovernmentAgenciesOrDepartments, - UniformsCommercialClothing, - UsedMerchandiseAndSecondhandStores, - Utilities, - VarietyStores, - VeterinaryServices, - VideoAmusementGameSupplies, - VideoGameArcades, - VideoTapeRentalStores, - VocationalTradeSchools, - WatchJewelryRepair, - WeldingRepair, - WholesaleClubs, - WigAndToupeeStores, - WiresMoneyOrders, - WomensAccessoryAndSpecialtyShops, - WomensReadyToWearStores, - WreckingAndSalvageYards, -} - -impl std::default::Default for MerchantCategory { - fn default() -> Self { - Self::Miscellaneous - } -} diff --git a/src/resources/issuing_transaction_ext.rs b/src/resources/issuing_transaction_ext.rs deleted file mode 100644 index 16d9ecdca..000000000 --- a/src/resources/issuing_transaction_ext.rs +++ /dev/null @@ -1,44 +0,0 @@ -use serde::{Deserialize, Serialize}; - -/// An enum representing the possible values of an `IssuingTransaction`'s `type` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum IssuingTransactionType { - Capture, - CashWithdrawal, - Dispute, - DisputeLoss, - Refund, - RefundReversal, -} - -impl IssuingTransactionType { - pub fn as_str(self) -> &'static str { - match self { - IssuingTransactionType::Capture => "capture", - IssuingTransactionType::CashWithdrawal => "cash_withdrawal", - IssuingTransactionType::Dispute => "dispute", - IssuingTransactionType::DisputeLoss => "dispute_loss", - IssuingTransactionType::Refund => "refund", - IssuingTransactionType::RefundReversal => "refund_reversal", - } - } -} - -impl AsRef for IssuingTransactionType { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for IssuingTransactionType { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} - -impl std::default::Default for IssuingTransactionType { - fn default() -> Self { - Self::Capture - } -} diff --git a/src/resources/line_item_ext.rs b/src/resources/line_item_ext.rs deleted file mode 100644 index 191805672..000000000 --- a/src/resources/line_item_ext.rs +++ /dev/null @@ -1,46 +0,0 @@ -use serde::{Deserialize, Serialize}; - -use crate::client::{Client, Response}; -use crate::ids::{CustomerId, InvoiceId}; -use crate::resources::{Currency, InvoiceLineItem}; - -impl InvoiceLineItem { - /// Creates an invoice line item. - /// - /// For more details see . - pub fn create(client: &Client, params: CreateInvoiceLineItem<'_>) -> Response { - client.post_form("/invoiceitems", ¶ms) - } -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreateInvoiceLineItem<'a> { - #[serde(skip_serializing_if = "Option::is_none")] - pub amount: Option, - #[serde(skip_serializing_if = "Option::is_none")] - pub currency: Option, - #[serde(skip_serializing_if = "Option::is_none")] - pub customer: Option, - #[serde(skip_serializing_if = "Option::is_none")] - pub description: Option<&'a str>, - #[serde(skip_serializing_if = "Option::is_none")] - pub discountable: Option, - #[serde(skip_serializing_if = "Option::is_none")] - pub invoice: Option, - #[serde(skip_serializing_if = "Option::is_none")] - pub subscription: Option, -} - -impl CreateInvoiceLineItem<'_> { - pub fn new() -> Self { - CreateInvoiceLineItem { - amount: None, - currency: None, - customer: None, - description: None, - discountable: None, - invoice: None, - subscription: None, - } - } -} diff --git a/src/resources/login_links_ext.rs b/src/resources/login_links_ext.rs deleted file mode 100644 index e8a26cf26..000000000 --- a/src/resources/login_links_ext.rs +++ /dev/null @@ -1,26 +0,0 @@ -use serde::Serialize; - -use crate::client::{Client, Response}; -use crate::params::Expand; -use crate::resources::LoginLink; -use crate::AccountId; - -#[derive(Clone, Debug, Serialize)] -pub struct CreateLoginLink<'a> { - /// Specifies which fields in the response should be expanded. - #[serde(skip_serializing_if = "Expand::is_empty")] - pub expand: &'a [&'a str], - - /// Where to redirect the user after they log out of their dashboard. - #[serde(skip_serializing_if = "Option::is_none")] - pub redirect_url: Option, -} - -impl LoginLink { - pub fn create(client: &Client, id: &AccountId, redirect_url: &str) -> Response { - let create_login_link = - CreateLoginLink { expand: &[], redirect_url: Some(redirect_url.to_string()) }; - - client.post_form(&format!("/accounts/{}/login_links", id), &create_login_link) - } -} diff --git a/src/resources/order_ext.rs b/src/resources/order_ext.rs deleted file mode 100644 index f18962171..000000000 --- a/src/resources/order_ext.rs +++ /dev/null @@ -1,34 +0,0 @@ -use serde::{Deserialize, Serialize}; - -/// An enum representing the possible values of an `ListOrders`'s `status` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum OrderStatusFilter { - Created, - Fulfilled, - Paid, - Refunded, -} - -impl OrderStatusFilter { - pub fn as_str(self) -> &'static str { - match self { - OrderStatusFilter::Created => "created", - OrderStatusFilter::Fulfilled => "fulfilled", - OrderStatusFilter::Paid => "paid", - OrderStatusFilter::Refunded => "refunded", - } - } -} - -impl AsRef for OrderStatusFilter { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for OrderStatusFilter { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} diff --git a/src/resources/payment_intent_ext.rs b/src/resources/payment_intent_ext.rs deleted file mode 100644 index 4f18679dc..000000000 --- a/src/resources/payment_intent_ext.rs +++ /dev/null @@ -1,233 +0,0 @@ -use serde::{Deserialize, Serialize}; - -use crate::client::{Client, Response}; -use crate::params::{Expandable, Metadata, SearchList}; -use crate::resources::{Currency, PaymentSource, Shipping}; -use crate::{PaymentIntent, PaymentIntentCancellationReason}; - -impl PaymentIntent { - /// Confirm that customer intends to pay with current or provided source. Upon confirmation, the PaymentIntent will attempt to initiate a payment. - /// - /// For more details see . - pub fn confirm( - client: &Client, - payment_intent_id: &str, - params: PaymentIntentConfirmParams<'_>, - ) -> Response { - client.post_form(&format!("/payment_intents/{}/confirm", payment_intent_id), params) - } - - /// Capture the funds of an existing uncaptured PaymentIntent where required_action="requires_capture". - /// - /// For more details see . - pub fn capture( - client: &Client, - payment_intent_id: &str, - params: CapturePaymentIntent, - ) -> Response { - client.post_form(&format!("/payment_intents/{}/capture", payment_intent_id), params) - } - - /// A PaymentIntent object can be canceled when it is in one of these statuses: requires_source, requires_capture, requires_confirmation, requires_source_action. - /// - /// For more details see . - pub fn cancel( - client: &Client, - payment_intent_id: &str, - params: CancelPaymentIntent, - ) -> Response { - client.post_form(&format!("/payment_intents/{}/cancel", payment_intent_id), params) - } - - /// Searches for a payment intent. - /// - /// For more details see . - pub fn search( - client: &Client, - params: PaymentIntentSearchParams, - ) -> Response> { - client.get_query("/payment_intents/search", params) - } -} -/// The resource representing a Stripe PaymentError object. -/// -/// For more details see . -#[derive(Clone, Debug, Deserialize, Serialize)] -pub struct PaymentError { - #[serde(rename = "type")] - pub payment_error_type: PaymentErrorType, - pub charge: Option, - pub code: Option, - pub decline_code: Option, - pub doc_url: Option, - pub message: Option, - pub param: Option, - pub source: Option>, -} - -/// The resource representing a Stripe PaymentErrorType object. -/// -/// For more details see . -#[derive(Deserialize, Serialize, PartialEq, Debug, Clone, Eq)] -pub enum PaymentErrorType { - #[serde(rename = "api_error")] - Api, - #[serde(rename = "api_connection_error")] - Connection, - #[serde(rename = "authentication_error")] - Authentication, - #[serde(rename = "card_error")] - Card, - #[serde(rename = "idempotency_error")] - Idempotency, - #[serde(rename = "invalid_request_error")] - InvalidRequest, - #[serde(rename = "rate_limit_error")] - RateLimit, - - /// A variant not yet supported by the library. - /// It is an error to send `Other` as part of a request. - #[serde(other, skip_serializing)] - Other, -} - -// TODO: This might be moved to `PaymentSourceType` if we determine -// that all of the variants are _always_ the same. -// -// In that case this can be replaced with a deprecated type alias. -/// Represents the way a `PaymentIntent` needs to be fulfilled. -#[derive(Deserialize, Serialize, PartialEq, Debug, Clone, Eq)] -#[serde(rename_all = "snake_case")] -pub enum PaymentIntentMethodType { - /// This `PaymentIntent` needs to be fulfilled through credit card payment. - Card, - /// This `PaymentIntent` needs to be fulfilled through an - /// [iDeal](https://stripe.com/docs/payments/ideal) payment. - Ideal, - /// This `PaymentIntent` needs to be fulfilled through a - /// [Sepa Direct Debit](https://stripe.com/docs/payments/sepa-debit) payment. - SepaDebit, -} - -/// The resource representing a Stripe CaptureMethod object. -/// -/// For more details see . -#[derive(Deserialize, Serialize, PartialEq, Debug, Clone, Eq)] -#[serde(rename_all = "snake_case")] -pub enum CaptureMethod { - Automatic, - Manual, - - /// A variant not yet supported by the library. - /// It is an error to send `Other` as part of a request. - #[serde(other, skip_serializing)] - Other, -} -/// The resource representing a Stripe ConfirmationMethod object. -/// -/// For more details see . -#[derive(Deserialize, Serialize, PartialEq, Debug, Clone, Eq)] -#[serde(rename_all = "snake_case")] -pub enum ConfirmationMethod { - Secret, - Publishable, - - /// A variant not yet supported by the library. - /// It is an error to send `Other` as part of a request. - #[serde(other, skip_serializing)] - Other, -} - -#[derive(Deserialize, Serialize, PartialEq, Debug, Clone, Eq)] -#[serde(rename_all = "snake_case")] -pub enum PaymentIntentNextActionType { - RedirectToUrl, - UseStripeSdk, - - /// A variant not yet supported by the library. - /// It is an error to send `Other` as part of a request. - #[serde(other, skip_serializing)] - Other, -} - -/// The set of parameters that can be used when updating a payment_intent object. -/// -/// For more details see -#[derive(Clone, Debug, Default, Serialize)] -pub struct PaymentIntentUpdateParams<'a> { - #[serde(skip_serializing_if = "Option::is_none")] - pub amount: Option, - #[serde(skip_serializing_if = "Option::is_none")] - pub application_fee_amount: Option, - #[serde(skip_serializing_if = "Option::is_none")] - pub currency: Option, - #[serde(skip_serializing_if = "Option::is_none")] - pub customer: Option<&'a str>, - #[serde(skip_serializing_if = "Option::is_none")] - pub description: Option<&'a str>, - #[serde(skip_serializing_if = "Option::is_none")] - pub metadata: Option, - #[serde(skip_serializing_if = "Option::is_none")] - pub receipt_email: Option<&'a str>, - #[serde(skip_serializing_if = "Option::is_none")] - pub save_source_to_customer: Option, - #[serde(skip_serializing_if = "Option::is_none")] - pub shipping: Option, - #[serde(skip_serializing_if = "Option::is_none")] - pub source: Option<&'a str>, - #[serde(skip_serializing_if = "Option::is_none")] - pub transfer_group: Option<&'a str>, -} - -/// The set of parameters that can be used when confirming a payment_intent object. -/// -/// For more details see -#[derive(Clone, Debug, Default, Serialize)] -pub struct PaymentIntentConfirmParams<'a> { - #[serde(skip_serializing_if = "Option::is_none")] - pub receipt_email: Option<&'a str>, - #[serde(skip_serializing_if = "Option::is_none")] - pub return_url: Option<&'a str>, - #[serde(skip_serializing_if = "Option::is_none")] - pub save_source_to_customer: Option, - #[serde(skip_serializing_if = "Option::is_none")] - pub shipping: Option, - #[serde(skip_serializing_if = "Option::is_none")] - pub source: Option<&'a str>, -} - -/// The set of parameters that can be used when capturing a payment_intent object. -/// -/// For more details see -#[derive(Clone, Debug, Default, Serialize)] -pub struct CapturePaymentIntent { - #[serde(skip_serializing_if = "Option::is_none")] - pub amount_to_capture: Option, - #[serde(skip_serializing_if = "Option::is_none")] - pub application_fee_amount: Option, -} - -/// The set of parameters that can be used when canceling a payment_intent object. -/// -/// For more details see -#[derive(Clone, Debug, Default, Serialize)] -pub struct CancelPaymentIntent { - #[serde(skip_serializing_if = "Option::is_none")] - pub cancellation_reason: Option, -} - -#[derive(Clone, Debug, Default, Serialize)] -pub struct PaymentIntentSearchParams<'a> { - pub query: String, - #[serde(skip_serializing_if = "Option::is_none")] - pub limit: Option, - #[serde(skip_serializing_if = "Option::is_none")] - pub page: Option, - pub expand: &'a [&'a str], -} - -impl<'a> PaymentIntentSearchParams<'a> { - pub fn new() -> PaymentIntentSearchParams<'a> { - PaymentIntentSearchParams { query: String::new(), limit: None, page: None, expand: &[] } - } -} diff --git a/src/resources/payment_method_ext.rs b/src/resources/payment_method_ext.rs deleted file mode 100644 index 9c7854386..000000000 --- a/src/resources/payment_method_ext.rs +++ /dev/null @@ -1,33 +0,0 @@ -use serde::{Deserialize, Serialize}; - -use crate::client::{Client, Response}; -use crate::ids::{CustomerId, PaymentMethodId}; -use crate::resources::PaymentMethod; - -/// The parameters for `PaymentMethod::attach` -/// -/// For more details see . -#[derive(Clone, Debug, Deserialize, Serialize)] -pub struct AttachPaymentMethod { - pub customer: CustomerId, -} - -impl PaymentMethod { - /// Attach a payment method to a customer - /// - /// For more details see . - pub fn attach( - client: &Client, - payment_method_id: &PaymentMethodId, - params: AttachPaymentMethod, - ) -> Response { - client.post_form(&format!("/payment_methods/{}/attach", payment_method_id), params) - } - - /// Detach a PaymentMethod from a Customer - /// - /// For more details see . - pub fn detach(client: &Client, payment_method_id: &PaymentMethodId) -> Response { - client.post(&format!("/payment_methods/{}/detach", payment_method_id)) - } -} diff --git a/src/resources/payment_source.rs b/src/resources/payment_source.rs deleted file mode 100644 index 54198d4cc..000000000 --- a/src/resources/payment_source.rs +++ /dev/null @@ -1,111 +0,0 @@ -use serde::ser::SerializeStruct; -use serde::{Deserialize, Serialize}; - -use crate::ids::{PaymentSourceId, SourceId, TokenId}; -use crate::params::Object; -use crate::resources::{Account, BankAccount, Card, Currency, Source}; - -/// A PaymentSourceParams represents all of the supported ways that can -/// be used to creating a new customer with a payment method or creating -/// a payment method directly for a customer via `Customer::attach_source`. -/// -/// Not to be confused with `SourceParams` which is used by `Source::create` -/// to create a source that is not necessarily attached to a customer. -#[derive(Clone, Debug, Serialize, Deserialize)] -#[serde(untagged)] -pub enum PaymentSourceParams { - /// Creates a payment method (e.g. card or bank account) from tokenized data, - /// using a token typically received from Stripe Elements. - Token(TokenId), - - /// Attach an existing source to an existing customer or - /// create a new customer from an existing source. - Source(SourceId), -} - -/// A PaymentSource represents a payment method _associated with a customer or charge_. -/// This value is usually returned as a subresource on another request. -/// -/// Not to be confused with `Source` which represents a "generic" payment method -/// returned by the `Source::get` (which could still be a credit card, etc) -/// but is not necessarily attached to either a customer or charge. -#[derive(Clone, Debug, Deserialize, Serialize)] -#[serde(tag = "object", rename_all = "snake_case")] -pub enum PaymentSource { - Card(Card), - Source(Source), - Account(Account), - BankAccount(BankAccount), -} - -impl Object for PaymentSource { - type Id = PaymentSourceId; - fn id(&self) -> Self::Id { - match self { - PaymentSource::Card(x) => PaymentSourceId::Card(x.id()), - PaymentSource::Source(x) => PaymentSourceId::Source(x.id()), - PaymentSource::Account(x) => PaymentSourceId::Account(x.id()), - PaymentSource::BankAccount(x) => PaymentSourceId::BankAccount(x.id()), - } - } - fn object(&self) -> &'static str { - match self { - PaymentSource::Card(x) => x.object(), - PaymentSource::Source(x) => x.object(), - PaymentSource::Account(x) => x.object(), - PaymentSource::BankAccount(x) => x.object(), - } - } -} - -#[derive(Clone, Debug, Default, Deserialize)] -pub struct BankAccountParams<'a> { - pub country: &'a str, - pub currency: Currency, - pub account_holder_name: Option<&'a str>, - pub account_holder_type: Option<&'a str>, - pub routing_number: Option<&'a str>, - pub account_number: &'a str, -} - -impl<'a> serde::ser::Serialize for BankAccountParams<'a> { - fn serialize(&self, serializer: S) -> Result - where - S: serde::ser::Serializer, - { - let mut s = serializer.serialize_struct("BankAccountParams", 6)?; - s.serialize_field("object", "bank_account")?; - s.serialize_field("country", &self.country)?; - s.serialize_field("currency", &self.currency)?; - s.serialize_field("account_holder_name", &self.account_holder_name)?; - s.serialize_field("routing_number", &self.routing_number)?; - s.serialize_field("account_number", &self.account_number)?; - s.end() - } -} - -#[derive(Clone, Debug, Default, Deserialize)] -pub struct CardParams<'a> { - pub exp_month: &'a str, // eg. "12" - pub exp_year: &'a str, // eg. "17" or 2017" - - pub number: &'a str, // card number - pub name: Option<&'a str>, // cardholder's full name - pub cvc: Option<&'a str>, // card security code -} - -impl<'a> serde::ser::Serialize for CardParams<'a> { - fn serialize(&self, serializer: S) -> Result - where - S: serde::ser::Serializer, - { - let mut s = serializer.serialize_struct("CardParams", 6)?; - s.serialize_field("object", "card")?; - s.serialize_field("exp_month", &self.exp_month)?; - s.serialize_field("exp_year", &self.exp_year)?; - s.serialize_field("number", &self.number)?; - s.serialize_field("name", &self.name)?; - s.serialize_field("cvc", &self.cvc)?; - s.end() - } -} diff --git a/src/resources/payout_ext.rs b/src/resources/payout_ext.rs deleted file mode 100644 index 44689cef0..000000000 --- a/src/resources/payout_ext.rs +++ /dev/null @@ -1,42 +0,0 @@ -use serde::{Deserialize, Serialize}; - -use crate::client::{Client, Response}; -use crate::ids::{PayoutDestinationId, PayoutId}; -use crate::params::Object; -use crate::resources::{BankAccount, Card, Payout}; - -impl Payout { - /// Cancels the payout. - /// - /// For more details see . - pub fn cancel(client: &Client, id: &PayoutId) -> Response { - client.post(&format!("/payouts/{}/cancel", id)) - } -} - -#[derive(Clone, Debug, Deserialize, Serialize)] -#[serde(untagged, rename_all = "snake_case")] -pub enum PayoutDestinationUnion { - BankAccount(BankAccount), - Card(Card), -} -impl std::default::Default for PayoutDestinationUnion { - fn default() -> Self { - Self::BankAccount(Default::default()) - } -} -impl Object for PayoutDestinationUnion { - type Id = PayoutDestinationId; - fn id(&self) -> Self::Id { - match self { - PayoutDestinationUnion::BankAccount(x) => PayoutDestinationId::BankAccount(x.id()), - PayoutDestinationUnion::Card(x) => PayoutDestinationId::Card(x.id()), - } - } - fn object(&self) -> &'static str { - match self { - PayoutDestinationUnion::BankAccount(x) => x.object(), - PayoutDestinationUnion::Card(x) => x.object(), - } - } -} diff --git a/src/resources/placeholders.rs b/src/resources/placeholders.rs deleted file mode 100644 index 55e891f79..000000000 --- a/src/resources/placeholders.rs +++ /dev/null @@ -1,34 +0,0 @@ -//! Structs of unknown origin that aren't picked -//! up by the codegen. - -use serde::{Deserialize, Serialize}; - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CountrySpecSupportedBankAccountCurrencies {} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct ExchangeRateRates {} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct IssuingAuthorizationAmountDetails {} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct NotificationEventData {} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct PaymentMethodDetailsCardInstallmentsPlan {} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct PaymentMethodDetailsCardPresent {} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct PaymentMethodDetailsCardWallet {} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct RadarValueListItem {} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct SubscriptionTransferData {} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct ThreeDSecureDetails {} diff --git a/src/resources/price_ext.rs b/src/resources/price_ext.rs deleted file mode 100644 index 549943697..000000000 --- a/src/resources/price_ext.rs +++ /dev/null @@ -1,29 +0,0 @@ -use serde::Serialize; - -use crate::params::SearchList; -use crate::{Client, Price, Response}; - -#[derive(Clone, Debug, Default, Serialize)] -pub struct PriceSearchParams<'a> { - pub query: String, - #[serde(skip_serializing_if = "Option::is_none")] - pub limit: Option, - #[serde(skip_serializing_if = "Option::is_none")] - pub page: Option, - pub expand: &'a [&'a str], -} - -impl<'a> PriceSearchParams<'a> { - pub fn new() -> PriceSearchParams<'a> { - PriceSearchParams { query: String::new(), limit: None, page: None, expand: &[] } - } -} - -impl Price { - /// Searches for a price. - /// - /// For more details see . - pub fn search(client: &Client, params: PriceSearchParams) -> Response> { - client.get_query("/prices/search", params) - } -} diff --git a/src/resources/product_ext.rs b/src/resources/product_ext.rs deleted file mode 100644 index 052136c92..000000000 --- a/src/resources/product_ext.rs +++ /dev/null @@ -1,29 +0,0 @@ -use serde::Serialize; - -use crate::params::SearchList; -use crate::{Client, Product, Response}; - -#[derive(Clone, Debug, Default, Serialize)] -pub struct ProductSearchParams<'a> { - pub query: String, - #[serde(skip_serializing_if = "Option::is_none")] - pub limit: Option, - #[serde(skip_serializing_if = "Option::is_none")] - pub page: Option, - pub expand: &'a [&'a str], -} - -impl<'a> ProductSearchParams<'a> { - pub fn new() -> ProductSearchParams<'a> { - ProductSearchParams { query: String::new(), limit: None, page: None, expand: &[] } - } -} - -impl Product { - /// Searches for a product. - /// - /// For more details see . - pub fn search(client: &Client, params: ProductSearchParams) -> Response> { - client.get_query("/products/search", params) - } -} diff --git a/src/resources/review_ext.rs b/src/resources/review_ext.rs deleted file mode 100644 index 9d68bd2ff..000000000 --- a/src/resources/review_ext.rs +++ /dev/null @@ -1,44 +0,0 @@ -use serde::{Deserialize, Serialize}; - -/// An enum representing the possible values of an `Review`'s `reason` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum ReviewReason { - Approved, - Disputed, - Manual, - Refunded, - RefundedAsFraud, - Rule, -} - -impl ReviewReason { - pub fn as_str(self) -> &'static str { - match self { - ReviewReason::Approved => "approved", - ReviewReason::Disputed => "disputed", - ReviewReason::Manual => "manual", - ReviewReason::Refunded => "refunded", - ReviewReason::RefundedAsFraud => "refunded_as_fraud", - ReviewReason::Rule => "rule", - } - } -} - -impl AsRef for ReviewReason { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for ReviewReason { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} - -impl std::default::Default for ReviewReason { - fn default() -> Self { - Self::Approved - } -} diff --git a/src/resources/setup_intent_ext.rs b/src/resources/setup_intent_ext.rs deleted file mode 100644 index 7fdf31ef4..000000000 --- a/src/resources/setup_intent_ext.rs +++ /dev/null @@ -1,58 +0,0 @@ -use serde::Serialize; - -use crate::client::{Client, Response}; -use crate::resources::SetupIntent; -use crate::{SetupIntentCancellationReason, SetupIntentId}; - -/// The set of parameters that can be used when confirming a setup_intent object. -/// -/// For more details see -#[derive(Clone, Debug, Serialize)] -pub struct ConfirmSetupIntent { - /// The client secret if on the client side - #[serde(skip_serializing_if = "Option::is_none")] - pub client_secret: Option, - - /// Specifies which payment method - #[serde(skip_serializing_if = "Option::is_none")] - pub payment_method: Option, - - // Mandate data and payment method options not implemented. If you want - // something better, create an issue and lets fix - /// The URL to redirect your customer back to after they authenticate on the payment method’s app or site. - #[serde(skip_serializing_if = "Option::is_none")] - pub return_url: Option, -} - -/// The set of parameters that can be used when canceling a setup_intent object. -/// -/// For more details see -#[derive(Clone, Debug, Default, Serialize)] -pub struct CancelSetupIntent { - #[serde(skip_serializing_if = "Option::is_none")] - pub cancellation_reason: Option, -} - -impl SetupIntent { - pub fn confirm( - client: &Client, - setup_id: &SetupIntentId, - params: ConfirmSetupIntent, - ) -> Response { - client.post_form(&format!("/setup_intents/{}/confirm", setup_id), ¶ms) - } - - /// A SetupIntent object can be canceled when it is in one of these statuses: requires_payment_method, requires_confirmation, or requires_action. - /// - /// For more details see . - pub fn cancel( - client: &Client, - setup_id: &SetupIntentId, - params: CancelSetupIntent, - ) -> Response { - client.post_form(&format!("/setup_intents/{}/cancel", setup_id), params) - } -} - -#[cfg(test)] -mod test {} diff --git a/src/resources/source_ext.rs b/src/resources/source_ext.rs deleted file mode 100644 index cb7c8c212..000000000 --- a/src/resources/source_ext.rs +++ /dev/null @@ -1,147 +0,0 @@ -use serde::{Deserialize, Serialize}; - -/// An enum representing the possible values of an `Source`'s `status` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum SourceStatus { - Canceled, - Chargeable, - Consumed, - Failed, - Pending, -} - -impl SourceStatus { - pub fn as_str(self) -> &'static str { - match self { - SourceStatus::Canceled => "canceled", - SourceStatus::Chargeable => "chargeable", - SourceStatus::Consumed => "consumed", - SourceStatus::Failed => "failed", - SourceStatus::Pending => "pending", - } - } -} - -impl AsRef for SourceStatus { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for SourceStatus { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} - -impl std::default::Default for SourceStatus { - fn default() -> Self { - Self::Pending - } -} - -/// An enum representing the possible values of an `Source`'s `usage` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum SourceUsage { - Reusable, - SingleUse, -} - -impl SourceUsage { - pub fn as_str(self) -> &'static str { - match self { - SourceUsage::Reusable => "reusable", - SourceUsage::SingleUse => "single_use", - } - } -} - -impl AsRef for SourceUsage { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for SourceUsage { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} - -/// An enum representing the possible values of an `SourceRedirectFlow`'s `failure_reason` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum SourceRedirectFlowFailureReason { - Declined, - ProcessingError, - UserAbort, -} - -impl SourceRedirectFlowFailureReason { - pub fn as_str(self) -> &'static str { - match self { - SourceRedirectFlowFailureReason::Declined => "declined", - SourceRedirectFlowFailureReason::ProcessingError => "processing_error", - SourceRedirectFlowFailureReason::UserAbort => "user_abort", - } - } -} - -impl AsRef for SourceRedirectFlowFailureReason { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for SourceRedirectFlowFailureReason { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} - -impl std::default::Default for SourceRedirectFlowFailureReason { - fn default() -> Self { - Self::Declined - } -} - -/// An enum representing the possible values of an `SourceRedirectFlow`'s `status` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum SourceRedirectFlowStatus { - Failed, - NotRequired, - Pending, - Succeeded, -} - -impl SourceRedirectFlowStatus { - pub fn as_str(self) -> &'static str { - match self { - SourceRedirectFlowStatus::Failed => "failed", - SourceRedirectFlowStatus::NotRequired => "not_required", - SourceRedirectFlowStatus::Pending => "pending", - SourceRedirectFlowStatus::Succeeded => "succeeded", - } - } -} - -impl AsRef for SourceRedirectFlowStatus { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for SourceRedirectFlowStatus { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} - -impl std::default::Default for SourceRedirectFlowStatus { - fn default() -> Self { - Self::Pending - } -} diff --git a/src/resources/subscription_ext.rs b/src/resources/subscription_ext.rs deleted file mode 100644 index 92c61ab8a..000000000 --- a/src/resources/subscription_ext.rs +++ /dev/null @@ -1,67 +0,0 @@ -use serde::Serialize; - -use crate::client::{Client, Response}; -use crate::ids::SubscriptionId; -use crate::params::SearchList; -use crate::resources::{CreateSubscriptionItems, Subscription}; -use crate::CancellationDetails; - -#[derive(Clone, Debug, Default, Serialize)] -pub struct CancelSubscription { - #[serde(skip_serializing_if = "Option::is_none")] - pub cancellation_details: Option, - #[serde(skip_serializing_if = "Option::is_none")] - pub invoice_now: Option, - #[serde(skip_serializing_if = "Option::is_none")] - pub prorate: Option, -} - -impl CancelSubscription { - pub fn new() -> CancelSubscription { - CancelSubscription { cancellation_details: None, invoice_now: None, prorate: None } - } -} - -#[derive(Clone, Debug, Default, Serialize)] -pub struct SubscriptionSearchParams<'a> { - pub query: String, - #[serde(skip_serializing_if = "Option::is_none")] - pub limit: Option, - #[serde(skip_serializing_if = "Option::is_none")] - pub page: Option, - pub expand: &'a [&'a str], -} - -impl<'a> SubscriptionSearchParams<'a> { - pub fn new() -> SubscriptionSearchParams<'a> { - SubscriptionSearchParams { query: String::new(), limit: None, page: None, expand: &[] } - } -} - -impl Subscription { - /// Cancels a subscription. - /// - /// For more details see . - pub fn cancel( - client: &Client, - subscription_id: &SubscriptionId, - params: CancelSubscription, - ) -> Response { - client.delete_query(&format!("/subscriptions/{}", subscription_id), params) - } - /// Searches for a subscription. - /// - /// For more details see . - pub fn search( - client: &Client, - params: SubscriptionSearchParams, - ) -> Response> { - client.get_query("/subscriptions/search", params) - } -} - -impl CreateSubscriptionItems { - pub fn new() -> Self { - Default::default() - } -} diff --git a/src/resources/token_ext.rs b/src/resources/token_ext.rs deleted file mode 100644 index e5b518ea2..000000000 --- a/src/resources/token_ext.rs +++ /dev/null @@ -1,40 +0,0 @@ -use serde::{Deserialize, Serialize}; - -/// An enum representing the possible values of an `Token`'s `type` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum TokenType { - Account, - BankAccount, - Card, - Pii, -} - -impl TokenType { - pub fn as_str(self) -> &'static str { - match self { - TokenType::Account => "account", - TokenType::BankAccount => "bank_account", - TokenType::Card => "card", - TokenType::Pii => "pii", - } - } -} - -impl AsRef for TokenType { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for TokenType { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} - -impl std::default::Default for TokenType { - fn default() -> Self { - Self::Account - } -} diff --git a/src/resources/transfer_reversal_ext.rs b/src/resources/transfer_reversal_ext.rs deleted file mode 100644 index aa7532845..000000000 --- a/src/resources/transfer_reversal_ext.rs +++ /dev/null @@ -1,35 +0,0 @@ -use serde::Deserialize; -use serde::Serialize; - -use crate::client::{Client, Response}; -use crate::params::Metadata; -use crate::resources::TransferReversal; -use crate::TransferId; - -/// The set of parameters that can be used when doing transfer reversal. -/// -/// For more details see . -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CreateTransferReversal { - #[serde(skip_serializing_if = "Option::is_none")] - pub amount: Option, - #[serde(skip_serializing_if = "Option::is_none")] - pub description: Option, - #[serde(skip_serializing_if = "Option::is_none")] - pub metadata: Option, - #[serde(skip_serializing_if = "Option::is_none")] - pub refund_application_fee: Option, -} - -impl TransferReversal { - /// Create Transfer Reversal - /// - /// For more details see . - pub fn create( - client: &Client, - transfer: &TransferId, - params: CreateTransferReversal, - ) -> Response { - client.post_form(&format!("/transfers/{}/reversals", transfer), params) - } -} diff --git a/src/resources/types.rs b/src/resources/types.rs deleted file mode 100644 index 259e1e990..000000000 --- a/src/resources/types.rs +++ /dev/null @@ -1,411 +0,0 @@ -use serde::{Deserialize, Serialize}; - -use crate::params::Timestamp; - -/// An enum representing the versions of the Stripe API. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum ApiVersion { - #[serde(rename = "2011-01-01")] - V2011_01_01, - #[serde(rename = "2011-06-21")] - V2011_06_21, - #[serde(rename = "2011-06-28")] - V2011_06_28, - #[serde(rename = "2011-08-01")] - V2011_08_01, - #[serde(rename = "2011-09-15")] - V2011_09_15, - #[serde(rename = "2011-11-17")] - V2011_11_17, - #[serde(rename = "2012-02-23")] - V2012_02_23, - #[serde(rename = "2012-03-25")] - V2012_03_25, - #[serde(rename = "2012-06-18")] - V2012_06_18, - #[serde(rename = "2012-06-28")] - V2012_06_28, - #[serde(rename = "2012-07-09")] - V2012_07_09, - #[serde(rename = "2012-09-24")] - V2012_09_24, - #[serde(rename = "2012-10-26")] - V2012_10_26, - #[serde(rename = "2012-11-07")] - V2012_11_07, - #[serde(rename = "2013-02-11")] - V2013_02_11, - #[serde(rename = "2013-02-13")] - V2013_02_13, - #[serde(rename = "2013-07-05")] - V2013_07_05, - #[serde(rename = "2013-08-12")] - V2013_08_12, - #[serde(rename = "2013-08-13")] - V2013_08_13, - #[serde(rename = "2013-10-29")] - V2013_10_29, - #[serde(rename = "2013-12-03")] - V2013_12_03, - #[serde(rename = "2014-01-31")] - V2014_01_31, - #[serde(rename = "2014-03-13")] - V2014_03_13, - #[serde(rename = "2014-03-28")] - V2014_03_28, - #[serde(rename = "2014-05-19")] - V2014_05_19, - #[serde(rename = "2014-06-13")] - V2014_06_13, - #[serde(rename = "2014-06-17")] - V2014_06_17, - #[serde(rename = "2014-07-22")] - V2014_07_22, - #[serde(rename = "2014-07-26")] - V2014_07_26, - #[serde(rename = "2014-08-04")] - V2014_08_04, - #[serde(rename = "2014-08-20")] - V2014_08_20, - #[serde(rename = "2014-09-08")] - V2014_09_08, - #[serde(rename = "2014-10-07")] - V2014_10_07, - #[serde(rename = "2014-11-05")] - V2014_11_05, - #[serde(rename = "2014-11-20")] - V2014_11_20, - #[serde(rename = "2014-12-08")] - V2014_12_08, - #[serde(rename = "2014-12-17")] - V2014_12_17, - #[serde(rename = "2014-12-22")] - V2014_12_22, - #[serde(rename = "2015-01-11")] - V2015_01_11, - #[serde(rename = "2015-01-26")] - V2015_01_26, - #[serde(rename = "2015-02-10")] - V2015_02_10, - #[serde(rename = "2015-02-16")] - V2015_02_16, - #[serde(rename = "2015-02-18")] - V2015_02_18, - #[serde(rename = "2015-03-24")] - V2015_03_24, - #[serde(rename = "2015-04-07")] - V2015_04_07, - #[serde(rename = "2015-06-15")] - V2015_06_15, - #[serde(rename = "2015-07-07")] - V2015_07_07, - #[serde(rename = "2015-07-13")] - V2015_07_13, - #[serde(rename = "2015-07-28")] - V2015_07_28, - #[serde(rename = "2015-08-07")] - V2015_08_07, - #[serde(rename = "2015-08-19")] - V2015_08_19, - #[serde(rename = "2015-09-03")] - V2015_09_03, - #[serde(rename = "2015-09-08")] - V2015_09_08, - #[serde(rename = "2015-09-23")] - V2015_09_23, - #[serde(rename = "2015-10-01")] - V2015_10_01, - #[serde(rename = "2015-10-12")] - V2015_10_12, - #[serde(rename = "2015-10-16")] - V2015_10_16, - #[serde(rename = "2016-02-03")] - V2016_02_03, - #[serde(rename = "2016-02-19")] - V2016_02_19, - #[serde(rename = "2016-02-22")] - V2016_02_22, - #[serde(rename = "2016-02-23")] - V2016_02_23, - #[serde(rename = "2016-02-29")] - V2016_02_29, - #[serde(rename = "2016-03-07")] - V2016_03_07, - #[serde(rename = "2016-06-15")] - V2016_06_15, - #[serde(rename = "2016-07-06")] - V2016_07_06, - #[serde(rename = "2016-10-19")] - V2016_10_19, - #[serde(rename = "2017-01-27")] - V2017_01_27, - #[serde(rename = "2017-02-14")] - V2017_02_14, - #[serde(rename = "2017-04-06")] - V2017_04_06, - #[serde(rename = "2017-05-25")] - V2017_05_25, - #[serde(rename = "2017-06-05")] - V2017_06_05, - #[serde(rename = "2017-08-15")] - V2017_08_15, - #[serde(rename = "2017-12-14")] - V2017_12_14, - #[serde(rename = "2018-01-23")] - V2018_01_23, - #[serde(rename = "2018-02-05")] - V2018_02_05, - #[serde(rename = "2018-02-06")] - V2018_02_06, - #[serde(rename = "2018-02-28")] - V2018_02_28, - #[serde(rename = "2018-05-21")] - V2018_05_21, - #[serde(rename = "2018-07-27")] - V2018_07_27, - #[serde(rename = "2018-08-23")] - V2018_08_23, - #[serde(rename = "2018-09-06")] - V2018_09_06, - #[serde(rename = "2018-09-24")] - V2018_09_24, - #[serde(rename = "2018-10-31")] - V2018_10_31, - #[serde(rename = "2018-11-08")] - V2018_11_08, - #[serde(rename = "2019-02-11")] - V2019_02_11, - #[serde(rename = "2019-02-19")] - V2019_02_19, - #[serde(rename = "2019-03-14")] - V2019_03_14, - #[serde(rename = "2019-05-16")] - V2019_05_16, - #[serde(rename = "2019-08-14")] - V2019_08_14, - #[serde(rename = "2019-09-09")] - V2019_09_09, - #[serde(rename = "2020-08-27")] - V2020_08_27, - #[serde(rename = "2022-08-01")] - V2022_08_01, - #[serde(rename = "2022-11-15")] - V2022_11_15, - #[serde(rename = "2023-08-16")] - V2023_08_16, - #[serde(rename = "2023-10-16")] - V2023_10_16, -} - -impl ApiVersion { - pub fn as_str(self) -> &'static str { - match self { - ApiVersion::V2011_01_01 => "2011-01-01", - ApiVersion::V2011_06_21 => "2011-06-21", - ApiVersion::V2011_06_28 => "2011-06-28", - ApiVersion::V2011_08_01 => "2011-08-01", - ApiVersion::V2011_09_15 => "2011-09-15", - ApiVersion::V2011_11_17 => "2011-11-17", - ApiVersion::V2012_02_23 => "2012-02-23", - ApiVersion::V2012_03_25 => "2012-03-25", - ApiVersion::V2012_06_18 => "2012-06-18", - ApiVersion::V2012_06_28 => "2012-06-28", - ApiVersion::V2012_07_09 => "2012-07-09", - ApiVersion::V2012_09_24 => "2012-09-24", - ApiVersion::V2012_10_26 => "2012-10-26", - ApiVersion::V2012_11_07 => "2012-11-07", - ApiVersion::V2013_02_11 => "2013-02-11", - ApiVersion::V2013_02_13 => "2013-02-13", - ApiVersion::V2013_07_05 => "2013-07-05", - ApiVersion::V2013_08_12 => "2013-08-12", - ApiVersion::V2013_08_13 => "2013-08-13", - ApiVersion::V2013_10_29 => "2013-10-29", - ApiVersion::V2013_12_03 => "2013-12-03", - ApiVersion::V2014_01_31 => "2014-01-31", - ApiVersion::V2014_03_13 => "2014-03-13", - ApiVersion::V2014_03_28 => "2014-03-28", - ApiVersion::V2014_05_19 => "2014-05-19", - ApiVersion::V2014_06_13 => "2014-06-13", - ApiVersion::V2014_06_17 => "2014-06-17", - ApiVersion::V2014_07_22 => "2014-07-22", - ApiVersion::V2014_07_26 => "2014-07-26", - ApiVersion::V2014_08_04 => "2014-08-04", - ApiVersion::V2014_08_20 => "2014-08-20", - ApiVersion::V2014_09_08 => "2014-09-08", - ApiVersion::V2014_10_07 => "2014-10-07", - ApiVersion::V2014_11_05 => "2014-11-05", - ApiVersion::V2014_11_20 => "2014-11-20", - ApiVersion::V2014_12_08 => "2014-12-08", - ApiVersion::V2014_12_17 => "2014-12-17", - ApiVersion::V2014_12_22 => "2014-12-22", - ApiVersion::V2015_01_11 => "2015-01-11", - ApiVersion::V2015_01_26 => "2015-01-26", - ApiVersion::V2015_02_10 => "2015-02-10", - ApiVersion::V2015_02_16 => "2015-02-16", - ApiVersion::V2015_02_18 => "2015-02-18", - ApiVersion::V2015_03_24 => "2015-03-24", - ApiVersion::V2015_04_07 => "2015-04-07", - ApiVersion::V2015_06_15 => "2015-06-15", - ApiVersion::V2015_07_07 => "2015-07-07", - ApiVersion::V2015_07_13 => "2015-07-13", - ApiVersion::V2015_07_28 => "2015-07-28", - ApiVersion::V2015_08_07 => "2015-08-07", - ApiVersion::V2015_08_19 => "2015-08-19", - ApiVersion::V2015_09_03 => "2015-09-03", - ApiVersion::V2015_09_08 => "2015-09-08", - ApiVersion::V2015_09_23 => "2015-09-23", - ApiVersion::V2015_10_01 => "2015-10-01", - ApiVersion::V2015_10_12 => "2015-10-12", - ApiVersion::V2015_10_16 => "2015-10-16", - ApiVersion::V2016_02_03 => "2016-02-03", - ApiVersion::V2016_02_19 => "2016-02-19", - ApiVersion::V2016_02_22 => "2016-02-22", - ApiVersion::V2016_02_23 => "2016-02-23", - ApiVersion::V2016_02_29 => "2016-02-29", - ApiVersion::V2016_03_07 => "2016-03-07", - ApiVersion::V2016_06_15 => "2016-06-15", - ApiVersion::V2016_07_06 => "2016-07-06", - ApiVersion::V2016_10_19 => "2016-10-19", - ApiVersion::V2017_01_27 => "2017-01-27", - ApiVersion::V2017_02_14 => "2017-02-14", - ApiVersion::V2017_04_06 => "2017-04-06", - ApiVersion::V2017_05_25 => "2017-05-25", - ApiVersion::V2017_06_05 => "2017-06-05", - ApiVersion::V2017_08_15 => "2017-08-15", - ApiVersion::V2017_12_14 => "2017-12-14", - ApiVersion::V2018_01_23 => "2018-01-23", - ApiVersion::V2018_02_05 => "2018-02-05", - ApiVersion::V2018_02_06 => "2018-02-06", - ApiVersion::V2018_02_28 => "2018-02-28", - ApiVersion::V2018_05_21 => "2018-05-21", - ApiVersion::V2018_07_27 => "2018-07-27", - ApiVersion::V2018_08_23 => "2018-08-23", - ApiVersion::V2018_09_06 => "2018-09-06", - ApiVersion::V2018_09_24 => "2018-09-24", - ApiVersion::V2018_10_31 => "2018-10-31", - ApiVersion::V2018_11_08 => "2018-11-08", - ApiVersion::V2019_02_11 => "2019-02-11", - ApiVersion::V2019_02_19 => "2019-02-19", - ApiVersion::V2019_03_14 => "2019-03-14", - ApiVersion::V2019_05_16 => "2019-05-16", - ApiVersion::V2019_08_14 => "2019-08-14", - ApiVersion::V2019_09_09 => "2019-09-09", - ApiVersion::V2020_08_27 => "2020-08-27", - ApiVersion::V2022_08_01 => "2022-08-01", - ApiVersion::V2022_11_15 => "2022-11-15", - ApiVersion::V2023_08_16 => "2023-08-16", - ApiVersion::V2023_10_16 => "2023-10-16", - } - } -} - -impl AsRef for ApiVersion { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for ApiVersion { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} - -/* Developers note -- DelayDays and DelayDaysOther are not worth the trouble - * to automate. Recommend letting the mapping stand*/ -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(untagged)] -pub enum DelayDays { - Days(u32), - Other(DelayDaysOther), -} - -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum DelayDaysOther { - Minimum, -} - -impl DelayDays { - pub fn days(n: u32) -> Self { - DelayDays::Days(n) - } - pub fn minimum() -> Self { - DelayDays::Other(DelayDaysOther::Minimum) - } -} - -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(untagged)] -pub enum Scheduled { - Timestamp(Timestamp), - Other(ScheduledOther), -} - -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum ScheduledOther { - Now, -} - -impl Scheduled { - pub fn at(ts: Timestamp) -> Self { - Scheduled::Timestamp(ts) - } - pub fn now() -> Self { - Scheduled::Other(ScheduledOther::Now) - } -} - -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(untagged)] -pub enum UpTo { - Max(u64), - Other(UpToOther), -} - -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum UpToOther { - Inf, -} - -impl UpTo { - pub fn max(n: u64) -> Self { - UpTo::Max(n) - } - pub fn now() -> Self { - UpTo::Other(UpToOther::Inf) - } -} - -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(untagged)] -pub enum PaymentIntentOffSession { - Exists(bool), - Other(OffSessionOther), -} - -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum OffSessionOther { - #[serde(rename = "one_off")] - OneOff, - #[serde(rename = "recurring")] - Recurring, -} - -impl PaymentIntentOffSession { - pub fn exists(n: bool) -> Self { - PaymentIntentOffSession::Exists(n) - } - pub fn frequency(n: OffSessionOther) -> Self { - match n { - OffSessionOther::OneOff => PaymentIntentOffSession::Other(OffSessionOther::OneOff), - OffSessionOther::Recurring => { - PaymentIntentOffSession::Other(OffSessionOther::Recurring) - } - } - } -} diff --git a/src/resources/usage_record_ext.rs b/src/resources/usage_record_ext.rs deleted file mode 100644 index 07032e59b..000000000 --- a/src/resources/usage_record_ext.rs +++ /dev/null @@ -1,44 +0,0 @@ -use serde::{Deserialize, Serialize}; - -use crate::{Client, Response, SubscriptionItemId, Timestamp, UsageRecord}; - -impl UsageRecord { - pub fn create( - client: &Client, - subscription_item_id: &SubscriptionItemId, - params: CreateUsageRecord, - ) -> Response { - client.post_form( - &format!("/subscription_items/{}/usage_records", subscription_item_id), - ¶ms, - ) - } -} - -/// The parameters for `UsageRecord::create`. -#[derive(Clone, Debug, Serialize, Default)] -pub struct CreateUsageRecord { - /// The usage quantity for the specified timestamp. - pub quantity: u64, - /// Valid values are `increment` (default) or `set`. - /// When using `increment` the specified `quantity` will be added to the usage at the specified timestamp. - /// The `set` action will overwrite the usage quantity at that timestamp. - /// If the subscription has [billing thresholds](https://stripe.com/docs/api/subscriptions/object#subscription_object-billing_thresholds), - /// `increment` is the only allowed value. - #[serde(skip_serializing_if = "Option::is_none")] - pub action: Option, - /// The timestamp for the usage event. - /// This timestamp must be within the current billing period of the subscription of the provided `subscription_item`, - /// and must not be in the future. When passing `"now"`, Stripe records usage for the current time. - /// Default is `"now"` if a value is not provided. - #[serde(skip_serializing_if = "Option::is_none")] - pub timestamp: Option, -} - -/// An enum representing the possible values of a `UsageRecord`'s `account` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum UsageRecordAction { - Increment, - Set, -} diff --git a/src/resources/webhook_endpoint_ext.rs b/src/resources/webhook_endpoint_ext.rs deleted file mode 100644 index 660d359cb..000000000 --- a/src/resources/webhook_endpoint_ext.rs +++ /dev/null @@ -1,30 +0,0 @@ -use serde::{Deserialize, Serialize}; - -/// An enum representing the possible values of an `WebhookEndpoint`'s `status` field. -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq)] -#[serde(rename_all = "snake_case")] -pub enum WebhookEndpointStatus { - Disabled, - Enabled, -} - -impl WebhookEndpointStatus { - pub fn as_str(self) -> &'static str { - match self { - WebhookEndpointStatus::Disabled => "disabled", - WebhookEndpointStatus::Enabled => "enabled", - } - } -} - -impl AsRef for WebhookEndpointStatus { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl std::fmt::Display for WebhookEndpointStatus { - fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { - self.as_str().fmt(f) - } -} diff --git a/src/resources/webhook_events.rs b/src/resources/webhook_events.rs deleted file mode 100644 index b041771d3..000000000 --- a/src/resources/webhook_events.rs +++ /dev/null @@ -1,666 +0,0 @@ -use std::collections::HashMap; - -use chrono::Utc; -#[cfg(feature = "webhook-events")] -use hmac::{Hmac, Mac}; -use serde::{Deserialize, Serialize}; -use serde_json::Value; -#[cfg(feature = "webhook-events")] -use sha2::Sha256; -use smart_default::SmartDefault; - -use crate::error::WebhookError; -use crate::resources::*; - -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq, Hash, SmartDefault)] -pub enum EventType { - #[serde(rename = "account.application.authorized")] - AccountApplicationAuthorized, - #[serde(rename = "account.application.deauthorized")] - AccountApplicationDeauthorized, - #[serde(rename = "account.external_account.created")] - AccountExternalAccountCreated, - #[serde(rename = "account.external_account.deleted")] - AccountExternalAccountDeleted, - #[serde(rename = "account.external_account.updated")] - AccountExternalAccountUpdated, - #[serde(rename = "account.updated")] - AccountUpdated, - #[serde(rename = "application_fee.created")] - ApplicationFeeCreated, - #[serde(rename = "application_fee.refund.updated")] - ApplicationFeeRefundUpdated, - #[serde(rename = "application_fee.refunded")] - ApplicationFeeRefunded, - #[serde(rename = "balance.available")] - BalanceAvailable, - #[serde(rename = "billing_portal.configuration.created")] - BillingPortalConfigurationCreated, - #[serde(rename = "billing_portal.configuration.updated")] - BillingPortalConfigurationUpdated, - #[serde(rename = "capability.updated")] - CapabilityUpdated, - #[serde(rename = "cash_balance.funds_available")] - CashBalanceFundsAvailable, - #[serde(rename = "charge.captured")] - ChargeCaptured, - #[serde(rename = "charge.dispute.closed")] - ChargeDisputeClosed, - #[serde(rename = "charge.dispute.created")] - ChargeDisputeCreated, - #[serde(rename = "charge.dispute.funds_reinstated")] - ChargeDisputeFundsReinstated, - #[serde(rename = "charge.dispute.funds_withdrawn")] - ChargeDisputeFundsWithdrawn, - #[serde(rename = "charge.dispute.updated")] - ChargeDisputeUpdated, - #[serde(rename = "charge.expired")] - ChargeExpired, - #[serde(rename = "charge.failed")] - ChargeFailed, - #[serde(rename = "charge.pending")] - ChargePending, - #[serde(rename = "charge.refund.updated")] - ChargeRefundUpdated, - #[serde(rename = "charge.refunded")] - ChargeRefunded, - #[serde(rename = "charge.succeeded")] - ChargeSucceeded, - #[serde(rename = "charge.updated")] - ChargeUpdated, - #[serde(rename = "checkout.session.async_payment_failed")] - CheckoutSessionAsyncPaymentFailed, - #[serde(rename = "checkout.session.async_payment_succeeded")] - CheckoutSessionAsyncPaymentSucceeded, - #[serde(rename = "checkout.session.completed")] - CheckoutSessionCompleted, - #[serde(rename = "checkout.session.expired")] - CheckoutSessionExpired, - #[serde(rename = "coupon.created")] - CouponCreated, - #[serde(rename = "coupon.deleted")] - CouponDeleted, - #[serde(rename = "coupon.updated")] - CouponUpdated, - #[serde(rename = "credit_note.created")] - CreditNoteCreated, - #[serde(rename = "credit_note.updated")] - CreditNoteUpdated, - #[serde(rename = "credit_note.voided")] - CreditNoteVoided, - #[serde(rename = "customer.created")] - CustomerCreated, - #[serde(rename = "customer.deleted")] - CustomerDeleted, - #[serde(rename = "customer.discount.created")] - CustomerDiscountCreated, - #[serde(rename = "customer.discount.deleted")] - CustomerDiscountDeleted, - #[serde(rename = "customer.discount.updated")] - CustomerDiscountUpdated, - #[serde(rename = "customer.source.created")] - CustomerSourceCreated, - #[serde(rename = "customer.source.deleted")] - CustomerSourceDeleted, - #[serde(rename = "customer.source.expiring")] - CustomerSourceExpiring, - #[serde(rename = "customer.source.updated")] - CustomerSourceUpdated, - #[serde(rename = "customer.subscription.created")] - CustomerSubscriptionCreated, - #[serde(rename = "customer.subscription.deleted")] - CustomerSubscriptionDeleted, - #[serde(rename = "customer.subscription.paused")] - CustomerSubscriptionPaused, - #[serde(rename = "customer.subscription.pending_update_applied")] - CustomerSubscriptionPendingUpdateApplied, - #[serde(rename = "customer.subscription.pending_update_expired")] - CustomerSubscriptionPendingUpdateExpired, - #[serde(rename = "customer.subscription.resumed")] - CustomerSubscriptionResumed, - #[serde(rename = "customer.subscription.trial_will_end")] - CustomerSubscriptionTrialWillEnd, - #[serde(rename = "customer.subscription.updated")] - CustomerSubscriptionUpdated, - #[serde(rename = "customer.tax_id.created")] - CustomerTaxIdCreated, - #[serde(rename = "customer.tax_id.deleted")] - CustomerTaxIdDeleted, - #[serde(rename = "customer.tax_id.updated")] - CustomerTaxIdUpdated, - #[serde(rename = "customer.updated")] - CustomerUpdated, - #[serde(rename = "file.created")] - FileCreated, - #[serde(rename = "identity.verification_session.canceled")] - IdentityVerificationSessionCanceled, - #[serde(rename = "identity.verification_session.created")] - IdentityVerificationSessionCreated, - #[serde(rename = "identity.verification_session.processing")] - IdentityVerificationSessionProcessing, - #[serde(rename = "identity.verification_session.redacted")] - IdentityVerificationSessionRedacted, - #[serde(rename = "identity.verification_session.requires_input")] - IdentityVerificationSessionRequiresInput, - #[serde(rename = "identity.verification_session.verified")] - IdentityVerificationSessionVerified, - #[serde(rename = "invoice.created")] - InvoiceCreated, - #[serde(rename = "invoice.deleted")] - InvoiceDeleted, - #[serde(rename = "invoice.finalization_failed")] - InvoiceFinalizationFailed, - #[serde(rename = "invoice.finalized")] - InvoiceFinalized, - #[serde(rename = "invoice.marked_uncollectible")] - InvoiceMarkedUncollectible, - #[serde(rename = "invoice.paid")] - InvoicePaid, - #[serde(rename = "invoice.payment_action_required")] - InvoicePaymentActionRequired, - #[serde(rename = "invoice.payment_failed")] - InvoicePaymentFailed, - #[serde(rename = "invoice.payment_succeeded")] - InvoicePaymentSucceeded, - #[serde(rename = "invoice.sent")] - InvoiceSent, - #[serde(rename = "invoice.upcoming")] - InvoiceUpcoming, - #[serde(rename = "invoice.updated")] - InvoiceUpdated, - #[serde(rename = "invoice.voided")] - InvoiceVoided, - #[serde(rename = "invoiceitem.created")] - InvoiceItemCreated, - #[serde(rename = "invoiceitem.deleted")] - InvoiceItemDeleted, - #[serde(rename = "invoiceitem.updated")] - InvoiceItemUpdated, - #[serde(rename = "issuing_authorization.created")] - IssuingAuthorizationCreated, - #[serde(rename = "issuing_authorization.request")] - IssuingAuthorizationRequest, - #[serde(rename = "issuing_authorization.updated")] - IssuingAuthorizationUpdated, - #[serde(rename = "issuing_card.created")] - IssuingCardCreated, - #[serde(rename = "issuing_card.updated")] - IssuingCardUpdated, - #[serde(rename = "issuing_cardholder.created")] - IssuingCardholderCreated, - #[serde(rename = "issuing_cardholder.updated")] - IssuingCardholderUpdated, - #[serde(rename = "issuing_dispute.closed")] - IssuingDisputeClosed, - #[serde(rename = "issuing_dispute.created")] - IssuingDisputeCreated, - #[serde(rename = "issuing_dispute.funds_reinstated")] - IssuingDisputeFundsReinstated, - #[serde(rename = "issuing_dispute.submitted")] - IssuingDisputeSubmitted, - #[serde(rename = "issuing_dispute.updated")] - IssuingDisputeUpdated, - #[serde(rename = "issuing_transaction.created")] - IssuingTransactionCreated, - #[serde(rename = "issuing_transaction.updated")] - IssuingTransactionUpdated, - #[serde(rename = "mandate.updated")] - MandateUpdated, - #[serde(rename = "order.created")] - OrderCreated, - #[serde(rename = "order.payment_failed")] - OrderPaymentFailed, - #[serde(rename = "order.payment_succeeded")] - OrderPaymentSucceeded, - #[serde(rename = "order.updated")] - OrderUpdated, - #[serde(rename = "order_return.created")] - OrderReturnCreated, - #[serde(rename = "order_return.updated")] - OrderReturnUpdated, - #[serde(rename = "payment_intent.amount_capturable_updated")] - PaymentIntentAmountCapturableUpdated, - #[serde(rename = "payment_intent.canceled")] - PaymentIntentCanceled, - #[serde(rename = "payment_intent.created")] - PaymentIntentCreated, - #[serde(rename = "payment_intent.partially_funded")] - PaymentIntentPartiallyFunded, - #[serde(rename = "payment_intent.payment_failed")] - PaymentIntentPaymentFailed, - #[serde(rename = "payment_intent.processing")] - PaymentIntentProcessing, - #[serde(rename = "payment_intent.requires_action")] - PaymentIntentRequiresAction, - #[serde(rename = "payment_intent.requires_capture")] - PaymentIntentRequiresCapture, - #[serde(rename = "payment_intent.succeeded")] - PaymentIntentSucceeded, - #[serde(rename = "payment_link.created")] - PaymentLinkCreated, - #[serde(rename = "payment_link.updated")] - PaymentLinkUpdated, - #[serde(rename = "payment_method.attached")] - PaymentMethodAttached, - #[serde(rename = "payment_method.automatically_updated")] - PaymentMethodAutomaticallyUpdated, - #[serde(rename = "payment_method.detached")] - PaymentMethodDetached, - #[serde(rename = "payment_method.updated")] - PaymentMethodUpdated, - #[serde(rename = "payout.canceled")] - PayoutCanceled, - #[serde(rename = "payout.created")] - PayoutCreated, - #[serde(rename = "payout.failed")] - PayoutFailed, - #[serde(rename = "payout.paid")] - PayoutPaid, - #[serde(rename = "payout.updated")] - PayoutUpdated, - #[serde(rename = "person.created")] - PersonCreated, - #[serde(rename = "person.deleted")] - PersonDeleted, - #[serde(rename = "person.updated")] - PersonUpdated, - #[serde(rename = "plan.created")] - PlanCreated, - #[serde(rename = "plan.deleted")] - PlanDeleted, - #[serde(rename = "plan.updated")] - PlanUpdated, - #[serde(rename = "price.created")] - PriceCreated, - #[serde(rename = "price.deleted")] - PriceDeleted, - #[serde(rename = "price.updated")] - PriceUpdated, - #[serde(rename = "product.created")] - ProductCreated, - #[serde(rename = "product.deleted")] - ProductDeleted, - #[serde(rename = "product.updated")] - ProductUpdated, - #[serde(rename = "promotion_code.created")] - PromotionCodeCreated, - #[serde(rename = "promotion_code.updated")] - PromotionCodeUpdated, - #[serde(rename = "quote.accepted")] - QuoteAccepted, - #[serde(rename = "quote.canceled")] - QuoteCanceled, - #[serde(rename = "quote.created")] - QuoteCreated, - #[serde(rename = "quote.finalized")] - QuoteFinalized, - #[serde(rename = "radar.early_fraud_warning.created")] - RadarEarlyFraudWarningCreated, - #[serde(rename = "radar.early_fraud_warning.updated")] - RadarEarlyFraudWarningUpdated, - #[serde(rename = "recipient.created")] - RecipientCreated, - #[serde(rename = "recipient.deleted")] - RecipientDeleted, - #[serde(rename = "recipient.updated")] - RecipientUpdated, - #[serde(rename = "reporting.report_run.failed")] - ReportingReportRunFailed, - #[serde(rename = "reporting.report_run.succeeded")] - ReportingReportRunSucceeded, - #[serde(rename = "reporting.report_type.updated")] - ReportingReportTypeUpdated, - #[serde(rename = "review.closed")] - ReviewClosed, - #[serde(rename = "review.opened")] - ReviewOpened, - #[serde(rename = "setup_intent.canceled")] - SetupIntentCanceled, - #[serde(rename = "setup_intent.created")] - SetupIntentCreated, - #[serde(rename = "setup_intent.requires_action")] - SetupIntentRequiresAction, - #[serde(rename = "setup_intent.setup_failed")] - SetupIntentSetupFailed, - #[serde(rename = "setup_intent.succeeded")] - SetupIntentSucceeded, - #[serde(rename = "sigma.scheduled_query_run.created")] - SigmaScheduledQueryRunCreated, - #[serde(rename = "sku.created")] - SkuCreated, - #[serde(rename = "sku.deleted")] - SkuDeleted, - #[serde(rename = "sku.updated")] - SkuUpdated, - #[serde(rename = "source.canceled")] - SourceCanceled, - #[serde(rename = "source.chargeable")] - SourceChargeable, - #[serde(rename = "source.failed")] - SourceFailed, - #[serde(rename = "source.mandate_notification")] - SourceMandateNotification, - #[serde(rename = "source.refund_attributes_required")] - SourceRefundAttributesRequired, - #[serde(rename = "source.transaction.created")] - SourceTransactionCreated, - #[serde(rename = "source.transaction.updated")] - SourceTransactionUpdated, - #[serde(rename = "subscription_schedule.aborted")] - SubscriptionScheduleAborted, - #[serde(rename = "subscription_schedule.canceled")] - SubscriptionScheduleCanceled, - #[serde(rename = "subscription_schedule.completed")] - SubscriptionScheduleCompleted, - #[serde(rename = "subscription_schedule.created")] - SubscriptionScheduleCreated, - #[serde(rename = "subscription_schedule.expiring")] - SubscriptionScheduleExpiring, - #[serde(rename = "subscription_schedule.released")] - SubscriptionScheduleReleased, - #[serde(rename = "subscription_schedule.updated")] - SubscriptionScheduleUpdated, - #[serde(rename = "tax_rate.created")] - TaxRateCreated, - #[serde(rename = "tax_rate.updated")] - TaxRateUpdated, - #[serde(rename = "terminal.reader.action_failed")] - TerminalReaderActionFailed, - #[serde(rename = "terminal.reader.action_succeeded")] - TerminalReaderActionSucceeded, - #[serde(rename = "test_helpers.test_clock.advancing")] - TestHelpersTestClockAdvancing, - #[serde(rename = "test_helpers.test_clock.created")] - TestHelpersTestClockCreated, - #[serde(rename = "test_helpers.test_clock.deleted")] - TestHelpersTestClockDeleted, - #[serde(rename = "test_helpers.test_clock.internal_failure")] - TestHelpersTestClockInternalFailure, - #[serde(rename = "test_helpers.test_clock.ready")] - TestHelpersTestClockReady, - #[serde(rename = "topup.canceled")] - TopupCanceled, - #[serde(rename = "topup.created")] - TopupCreated, - #[serde(rename = "topup.failed")] - TopupFailed, - #[serde(rename = "topup.reversed")] - TopupReversed, - #[serde(rename = "topup.succeeded")] - TopupSucceeded, - #[serde(rename = "transfer.created")] - TransferCreated, - #[serde(rename = "transfer.failed")] - TransferFailed, - #[serde(rename = "transfer.paid")] - TransferPaid, - #[serde(rename = "transfer.reversed")] - TransferReversed, - #[serde(rename = "transfer.updated")] - TransferUpdated, - #[serde(other)] - #[default] - Unknown, -} - -impl std::fmt::Display for EventType { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - f.write_str(&serde_json::to_string(self).unwrap()) - } -} - -/// The resource representing a Stripe "NotificationEventData". -/// -/// note: this is a manual override of the generated code; -/// see notification_event_data.rs for the (broken) codegen -#[derive(Clone, Debug, Deserialize, Serialize, Default)] -pub struct NotificationEventData { - pub object: EventObject, - #[serde(skip_serializing_if = "Option::is_none")] - pub previous_attributes: Option>, -} - -#[derive(Clone, Debug, Deserialize, Serialize)] -#[serde(tag = "object", rename_all = "snake_case")] -pub enum EventObject { - Account(Account), - #[serde(rename = "capability")] - AccountCapabilities(AccountCapabilities), - Application(Application), - ApplicationFee(ApplicationFee), - #[serde(rename = "fee_refund")] - ApplicationFeeRefund(ApplicationFeeRefund), - Balance(Balance), - BankAccount(BankAccount), - #[serde(rename = "billing_portal.configuration")] - BillingPortalConfiguration(BillingPortalConfiguration), - Card(Card), - Charge(Charge), - #[serde(rename = "checkout.session")] - CheckoutSession(CheckoutSession), - Coupon(Coupon), - Customer(Customer), - Discount(Discount), - Dispute(Dispute), - File(File), - Invoice(Invoice), - #[serde(rename = "invoiceitem")] - InvoiceItem(InvoiceItem), - #[serde(rename = "issuing.authorization")] - IssuingAuthorization(IssuingAuthorization), - #[serde(rename = "issuing.card")] - IssuingCard(IssuingCard), - #[serde(rename = "issuing.cardholder")] - IssuingCardholder(IssuingCardholder), - #[serde(rename = "issuing.dispute")] - IssuingDispute(IssuingDispute), - #[serde(rename = "issuing.transaction")] - IssuingTransaction(IssuingTransaction), - Mandate(Mandate), - PaymentIntent(PaymentIntent), - PaymentLink(PaymentLink), - PaymentMethod(PaymentMethod), - Payout(Payout), - Person(Person), - Plan(Plan), - Price(Price), - Product(Product), - PromotionCode(PromotionCode), - Quote(Quote), - Refund(Refund), - Review(Review), - SetupIntent(SetupIntent), - Subscription(Subscription), - SubscriptionSchedule(SubscriptionSchedule), - TaxId(TaxId), - TaxRate(TaxRate), - #[serde(rename = "test_helpers.test_clock")] - TestHelpersTestClock(TestHelpersTestClock), - Topup(Topup), - Transfer(Transfer), -} - -impl Default for EventObject { - fn default() -> Self { - EventObject::Account(Account::default()) - } -} - -#[cfg(feature = "webhook-events")] -pub struct Webhook { - current_timestamp: i64, -} - -#[cfg(feature = "webhook-events")] -impl Webhook { - /// Construct an event from a webhook payload and signature. - /// - /// # Errors - /// - /// This function will return a WebhookError if: - /// - the provided signature is invalid - /// - the provided secret is invalid - /// - the signature timestamp is older than 5 minutes - pub fn construct_event(payload: &str, sig: &str, secret: &str) -> Result { - Self { current_timestamp: Utc::now().timestamp() }.do_construct_event(payload, sig, secret) - } - - /// Construct an event from a webhook payload and signature, verifying its signature - /// using the provided timestamp. - /// - /// This is helpful for replaying requests in tests and should be avoided otherwise - /// in production use. - /// - /// # Errors - /// - /// This function will return a WebhookError if: - /// - the provided signature is invalid - /// - the provided secret is invalid - /// - the signature timestamp is older than 5 minutes from the provided timestamp - pub fn construct_event_with_timestamp( - payload: &str, - sig: &str, - secret: &str, - timestamp: i64, - ) -> Result { - Self { current_timestamp: timestamp }.do_construct_event(payload, sig, secret) - } - - fn do_construct_event( - self, - payload: &str, - sig: &str, - secret: &str, - ) -> Result { - // Get Stripe signature from header - let signature = Signature::parse(sig)?; - let signed_payload = format!("{}.{}", signature.t, payload); - - // Compute HMAC with the SHA256 hash function, using endpoing secret as key - // and signed_payload string as the message. - let mut mac = - Hmac::::new_from_slice(secret.as_bytes()).map_err(|_| WebhookError::BadKey)?; - mac.update(signed_payload.as_bytes()); - - let sig = hex::decode(signature.v1).map_err(|_| WebhookError::BadSignature)?; - - mac.verify_slice(sig.as_slice()).map_err(|_| WebhookError::BadSignature)?; - - // Get current timestamp to compare to signature timestamp - if (self.current_timestamp - signature.t).abs() > 300 { - return Err(WebhookError::BadTimestamp(signature.t)); - } - - Ok(serde_json::from_str(payload)?) - } -} - -#[cfg(feature = "webhook-events")] -#[derive(Debug)] -struct Signature<'r> { - t: i64, - v1: &'r str, -} - -#[cfg(feature = "webhook-events")] -impl<'r> Signature<'r> { - fn parse(raw: &'r str) -> Result, WebhookError> { - let headers: HashMap<&str, &str> = raw - .split(',') - .map(|header| { - let mut key_and_value = header.split('='); - let key = key_and_value.next(); - let value = key_and_value.next(); - (key, value) - }) - .filter_map(|(key, value)| match (key, value) { - (Some(key), Some(value)) => Some((key, value)), - _ => None, - }) - .collect(); - let t = headers.get("t").ok_or(WebhookError::BadSignature)?; - let v1 = headers.get("v1").ok_or(WebhookError::BadSignature)?; - Ok(Signature { t: t.parse::().map_err(WebhookError::BadHeader)?, v1 }) - } -} - -#[cfg(test)] -mod tests { - #[cfg(feature = "webhook-events")] - #[test] - fn test_signature_parse() { - use super::Signature; - - let raw_signature = - "t=1492774577,v1=5257a869e7ecebeda32affa62cdca3fa51cad7e77a0e56ff536d0ce8e108d8bd"; - let signature = Signature::parse(raw_signature).unwrap(); - assert_eq!(signature.t, 1492774577); - assert_eq!( - signature.v1, - "5257a869e7ecebeda32affa62cdca3fa51cad7e77a0e56ff536d0ce8e108d8bd" - ); - - let raw_signature_with_test_mode = "t=1492774577,v1=5257a869e7ecebeda32affa62cdca3fa51cad7e77a0e56ff536d0ce8e108d8bd,v0=6ffbb59b2300aae63f272406069a9788598b792a944a07aba816edb039989a39"; - let signature = Signature::parse(raw_signature_with_test_mode).unwrap(); - assert_eq!(signature.t, 1492774577); - assert_eq!( - signature.v1, - "5257a869e7ecebeda32affa62cdca3fa51cad7e77a0e56ff536d0ce8e108d8bd" - ); - } - - #[cfg(feature = "webhook-events")] - #[test] - fn test_webhook_construct_event() { - let payload = r#"{ - "id": "evt_123", - "object": "event", - "account": "acct_123", - "api_version": "2017-05-25", - "created": 1533204620, - "data": { - "object": { - "id": "ii_123", - "object": "invoiceitem", - "amount": 1000, - "currency": "usd", - "customer": "cus_123", - "date": 1533204620, - "description": "Test Invoice Item", - "discountable": false, - "invoice": "in_123", - "livemode": false, - "metadata": {}, - "period": { - "start": 1533204620, - "end": 1533204620 - }, - "proration": false, - "quantity": 3 - } - }, - "livemode": false, - "pending_webhooks": 1, - "request": { - "id": "req_123", - "idempotency_key": "idempotency-key-123" - }, - "type": "invoiceitem.created" -} -"#; - let event_timestamp = 1533204620; - let secret = "webhook_secret".to_string(); - let signature = format!("t={},v1=82216eca827bcb7b34b8055eb2d2d9e6bc13b9ac39ded14a61e69f70c565f53a,v0=63f3a72374a733066c4be69ed7f8e5ac85c22c9f0a6a612ab9a025a9e4ee7eef", event_timestamp); - - let webhook = super::Webhook { current_timestamp: event_timestamp }; - - let event = webhook - .do_construct_event(payload, &signature, &secret) - .expect("Failed to construct event"); - - assert_eq!(event.type_, super::EventType::InvoiceItemCreated); - assert_eq!(event.id, "evt_123".parse::().unwrap()); - assert_eq!(event.account, "acct_123".parse().ok()); - assert_eq!(event.created, 1533204620); - } -} diff --git a/stripe.json b/stripe.json deleted file mode 100644 index f22fbd265..000000000 --- a/stripe.json +++ /dev/null @@ -1,42430 +0,0 @@ -{ - "intro": { - "title": "Introduction", - "group_title": "Topics", - "group_anchor": "topics", - "anchor": "intro", - "section_anchor": "intro", - "subsection_anchors": [], - "path": "/", - "gate": false, - "display_on_load": true, - "data": { - "merchant": false, - "test_key": "sk_test_4eC39HqLyjWDarjtT1zdp7dc", - "user_email": null, - "login_as": null, - "section_type": "override", - "section_tag": "intro", - "version": null - } - }, - "authentication": { - "title": "Authentication", - "group_title": "Topics", - "group_anchor": "topics", - "anchor": "authentication", - "section_anchor": "authentication", - "subsection_anchors": [], - "path": "/authentication", - "gate": false, - "display_on_load": true, - "data": { - "example_explicit_api_key": "", - "merchant": false, - "request": "curl https://api.stripe.com/v1/charges \\\n -u sk_test_4eC39HqLyjWDarjtT1zdp7dc:\n# The colon prevents curl from asking for a password.", - "test_key": "sk_test_4eC39HqLyjWDarjtT1zdp7dc", - "section_type": "override", - "section_tag": "authentication", - "version": null - } - }, - "connected_accounts": { - "title": "Connected Accounts", - "group_title": "Topics", - "group_anchor": "topics", - "anchor": "connected_accounts", - "section_anchor": "connected_accounts", - "subsection_anchors": [], - "path": "/connected_accounts", - "gate": false, - "display_on_load": true, - "data": { - "example_explicit_account": "curl https://api.stripe.com/v1/charges/ch_3MWb7X2eZvKYlo2C1KB2kTo6 \\\n -u sk_test_4eC39HqLyjWDarjtT1zdp7dc: \\\n -H \"Stripe-Account: acct_1032D82eZvKYlo2C\" \\\n -G \n", - "section_type": "override", - "section_tag": "connected_accounts", - "version": null - } - }, - "errors": { - "title": "Errors", - "group_title": "Topics", - "group_anchor": "topics", - "anchor": "errors", - "section_anchor": "errors", - "subsection_anchors": ["error_handling"], - "path": "/errors", - "gate": false, - "display_on_load": true, - "data": { - "changes": {}, - "specs": { - "type": { - "name": "type", - "check": "string", - "validation": "string", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "The type of error returned. One of `api_error`, `card_error`, `idempotency_error`, or `invalid_request_error`", - "undocumented": false, - "html": "The type of error returned. One of \u003Ccode\u003Eapi_error\u003C/code\u003E, \u003Ccode\u003Ecard_error\u003C/code\u003E, \u003Ccode\u003Eidempotency_error\u003C/code\u003E, or \u003Ccode\u003Einvalid_request_error\u003C/code\u003E" - }, - "gate": false, - "hide_unset_desc": null, - "required": true, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "type" - }, - "charge": { - "name": "charge", - "check": "string", - "validation": "string", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "For card errors, the ID of the failed charge.", - "undocumented": false, - "html": "For card errors, the ID of the failed charge." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "charge", - "less_common": true - }, - "code": { - "name": "code", - "check": "string", - "validation": "string", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "For some errors that could be handled programmatically, a short string indicating the [error code](/docs/error-codes) reported.", - "undocumented": false, - "html": "For some errors that could be handled programmatically, a short string indicating the \u003Ca href=\"/docs/error-codes\"\u003Eerror code\u003C/a\u003E reported." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "code" - }, - "decline_code": { - "name": "decline_code", - "check": "string", - "validation": "string", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "For card errors resulting from a card issuer decline, a short string indicating the [card issuer's reason for the decline](/docs/declines#issuer-declines) if they provide one.", - "undocumented": false, - "html": "For card errors resulting from a card issuer decline, a short string indicating the \u003Ca href=\"/docs/declines#issuer-declines\"\u003Ecard issuer’s reason for the decline\u003C/a\u003E if they provide one." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "decline_code" - }, - "doc_url": { - "name": "doc_url", - "check": "string", - "validation": "string", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "A URL to more information about the [error code](/docs/error-codes) reported.", - "undocumented": false, - "html": "A URL to more information about the \u003Ca href=\"/docs/error-codes\"\u003Eerror code\u003C/a\u003E reported." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "doc_url", - "less_common": true - }, - "message": { - "name": "message", - "check": "string", - "validation": "string", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "A human-readable message providing more details about the error. For card errors, these messages can be shown to your users.", - "undocumented": false, - "html": "A human-readable message providing more details about the error. For card errors, these messages can be shown to your users." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "message" - }, - "param": { - "name": "param", - "check": "string", - "validation": "string", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "If the error is parameter-specific, the parameter related to the error. For example, you can use this to display a message near the correct form field.", - "undocumented": false, - "html": "If the error is parameter-specific, the parameter related to the error. For example, you can use this to display a message near the correct form field." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "param" - }, - "payment_intent": { - "name": "payment_intent", - "check": "hash", - "validation": "hash", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "The PaymentIntent object for errors returned on a request involving a PaymentIntent.", - "undocumented": false, - "html": "The PaymentIntent object for errors returned on a request involving a PaymentIntent." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "payment_intent", - "subspec": { - "id": { - "name": "id", - "check": "string", - "validation": "string", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Unique identifier for the object.", - "undocumented": false, - "html": "Unique identifier for the object." - }, - "gate": false, - "hide_unset_desc": null, - "required": true, - "default": null, - "badge_text": "retrievable with publishable key", - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "id" - }, - "object": { - "name": "object", - "check": "string", - "validation": "string", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "String representing the object's type. Objects of the same type share the same value.", - "undocumented": false, - "html": "String representing the object’s type. Objects of the same type share the same value." - }, - "gate": false, - "hide_unset_desc": null, - "required": true, - "default": null, - "badge_text": "retrievable with publishable key", - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "object", - "less_common": true - }, - "amount": { - "name": "amount", - "check": "integer", - "validation": "integer", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Amount intended to be collected by this PaymentIntent. A positive integer representing how much to charge in the [smallest currency unit](/docs/currencies#zero-decimal) (e.g., 100 cents to charge $1.00 or 100 to charge ¥100, a zero-decimal currency). The minimum amount is $0.50 US or [equivalent in charge currency](/docs/currencies#minimum-and-maximum-charge-amounts). The amount value supports up to eight digits (e.g., a value of 99999999 for a USD charge of $999,999.99).", - "undocumented": false, - "html": "Amount intended to be collected by this PaymentIntent. A positive integer representing how much to charge in the \u003Ca href=\"/docs/currencies#zero-decimal\"\u003Esmallest currency unit\u003C/a\u003E (e.g., 100 cents to charge $1.00 or 100 to charge ¥100, a zero-decimal currency). The minimum amount is $0.50 US or \u003Ca href=\"/docs/currencies#minimum-and-maximum-charge-amounts\"\u003Eequivalent in charge currency\u003C/a\u003E. The amount value supports up to eight digits (e.g., a value of 99999999 for a USD charge of $999,999.99)." - }, - "gate": false, - "hide_unset_desc": null, - "required": true, - "default": null, - "badge_text": "retrievable with publishable key", - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "amount" - }, - "amount_capturable": { - "name": "amount_capturable", - "check": "integer", - "validation": "integer", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Amount that can be captured from this PaymentIntent.", - "undocumented": false, - "html": "Amount that can be captured from this PaymentIntent." - }, - "gate": false, - "hide_unset_desc": null, - "required": true, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "amount_capturable", - "less_common": true - }, - "amount_details": { - "name": "amount_details", - "check": "hash", - "validation": "hash", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Details about items included in the amount", - "undocumented": false, - "html": "Details about items included in the amount" - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "subspec": { - "tip": { - "name": "tip", - "check": "hash", - "validation": "hash", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Portion of the amount that corresponds to a tip.\n", - "undocumented": false, - "html": "Portion of the amount that corresponds to a tip." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "subspec": { - "amount": { - "name": "amount", - "check": "nonnegative_integer", - "validation": "positive integer or zero", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Portion of the amount that corresponds to a tip.\n", - "undocumented": false, - "html": "Portion of the amount that corresponds to a tip." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "amount" - } - }, - "object_type": "tip" - } - }, - "object_type": "amount_details", - "less_common": true - }, - "amount_received": { - "name": "amount_received", - "check": "integer", - "validation": "integer", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Amount that was collected by this PaymentIntent.", - "undocumented": false, - "html": "Amount that was collected by this PaymentIntent." - }, - "gate": false, - "hide_unset_desc": null, - "required": true, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "amount_received", - "less_common": true - }, - "application": { - "name": "application", - "check": "string", - "validation": "string", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "ID of the Connect application that created the PaymentIntent.", - "undocumented": false, - "html": "ID of the Connect application that created the PaymentIntent." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": "Connect only", - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "user_expandable": ["application"], - "object_type": "application", - "less_common": true - }, - "application_fee_amount": { - "name": "application_fee_amount", - "check": "integer", - "validation": "integer", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "The amount of the application fee (if any) that will be requested to be applied to the payment and transferred to the application owner's Stripe account. The amount of the application fee collected will be capped at the total payment amount. For more information, see the PaymentIntents [use case for connected accounts](/docs/payments/connected-accounts).\n", - "undocumented": false, - "html": "The amount of the application fee (if any) that will be requested to be applied to the payment and transferred to the application owner’s Stripe account. The amount of the application fee collected will be capped at the total payment amount. For more information, see the PaymentIntents \u003Ca href=\"/docs/payments/connected-accounts\"\u003Euse case for connected accounts\u003C/a\u003E." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": "Connect only", - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "application_fee_amount", - "less_common": true - }, - "automatic_payment_methods": { - "name": "automatic_payment_methods", - "check": "hash", - "validation": "hash", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Settings to configure compatible payment methods from the [Stripe Dashboard](https://dashboard.stripe.com/settings/payment_methods)", - "undocumented": false, - "html": "Settings to configure compatible payment methods from the \u003Ca href=\"https://dashboard.stripe.com/settings/payment_methods\"\u003EStripe Dashboard\u003C/a\u003E" - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": "retrievable with publishable key", - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "subspec": { - "enabled": { - "name": "enabled", - "check": "boolean", - "validation": "boolean", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Automatically calculates compatible payment methods", - "undocumented": false, - "html": "Automatically calculates compatible payment methods" - }, - "gate": false, - "hide_unset_desc": null, - "required": true, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "enabled" - } - }, - "object_type": "automatic_payment_methods" - }, - "canceled_at": { - "name": "canceled_at", - "check": "timestamp", - "validation": "timestamp", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Populated when `status` is `canceled`, this is the time at which the PaymentIntent was canceled. Measured in seconds since the Unix epoch.", - "undocumented": false, - "html": "Populated when \u003Ccode\u003Estatus\u003C/code\u003E is \u003Ccode\u003Ecanceled\u003C/code\u003E, this is the time at which the PaymentIntent was canceled. Measured in seconds since the Unix epoch." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": "retrievable with publishable key", - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "canceled_at", - "less_common": true - }, - "cancellation_reason": { - "name": "cancellation_reason", - "check": "string", - "validation": "string", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Reason for cancellation of this PaymentIntent, either user-provided (`duplicate`, `fraudulent`, `requested_by_customer`, or `abandoned`) or generated by Stripe internally (`failed_invoice`, `void_invoice`, or `automatic`).", - "undocumented": false, - "html": "Reason for cancellation of this PaymentIntent, either user-provided (\u003Ccode\u003Eduplicate\u003C/code\u003E, \u003Ccode\u003Efraudulent\u003C/code\u003E, \u003Ccode\u003Erequested_by_customer\u003C/code\u003E, or \u003Ccode\u003Eabandoned\u003C/code\u003E) or generated by Stripe internally (\u003Ccode\u003Efailed_invoice\u003C/code\u003E, \u003Ccode\u003Evoid_invoice\u003C/code\u003E, or \u003Ccode\u003Eautomatic\u003C/code\u003E)." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": "retrievable with publishable key", - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "cancellation_reason", - "less_common": true - }, - "capture_method": { - "name": "capture_method", - "check": "string", - "validation": "string", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Controls when the funds will be captured from the customer's account.\n", - "undocumented": false, - "html": "Controls when the funds will be captured from the customer’s account." - }, - "gate": false, - "hide_unset_desc": null, - "required": true, - "default": null, - "badge_text": "retrievable with publishable key", - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "enum_values": { - "automatic": { - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "(Default) Stripe automatically captures funds when the customer authorizes the payment.", - "undocumented": false, - "html": "(Default) Stripe automatically captures funds when the customer authorizes the payment." - } - }, - "manual": { - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Place a hold on the funds when the customer authorizes the payment, but [don't capture the funds until later](/docs/payments/capture-later). (Not all payment methods support this.)", - "undocumented": false, - "html": "Place a hold on the funds when the customer authorizes the payment, but \u003Ca href=\"/docs/payments/capture-later\"\u003Edon’t capture the funds until later\u003C/a\u003E. (Not all payment methods support this.)" - } - } - }, - "object_type": "capture_method", - "less_common": true - }, - "client_secret": { - "name": "client_secret", - "check": "string", - "validation": "string", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "The client secret of this PaymentIntent. Used for client-side retrieval using a publishable key. \n\nThe client secret can be used to complete a payment from your frontend. It should not be stored, logged, or exposed to anyone other than the customer. Make sure that you have TLS enabled on any page that includes the client secret.\n\nRefer to our docs to [accept a payment](/docs/payments/accept-a-payment?ui=elements) and learn about how `client_secret` should be handled.", - "undocumented": false, - "html": "The client secret of this PaymentIntent. Used for client-side retrieval using a publishable key. \u003C/p\u003E\n\n\u003Cp\u003EThe client secret can be used to complete a payment from your frontend. It should not be stored, logged, or exposed to anyone other than the customer. Make sure that you have TLS enabled on any page that includes the client secret.\u003C/p\u003E\n\n\u003Cp\u003ERefer to our docs to \u003Ca href=\"/docs/payments/accept-a-payment?ui=elements\"\u003Eaccept a payment\u003C/a\u003E and learn about how \u003Ccode\u003Eclient_secret\u003C/code\u003E should be handled." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": "retrievable with publishable key", - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "client_secret" - }, - "confirmation_method": { - "name": "confirmation_method", - "check": "string", - "validation": "string", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "", - "undocumented": false, - "html": "" - }, - "gate": false, - "hide_unset_desc": null, - "required": true, - "default": null, - "badge_text": "retrievable with publishable key", - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "enum_values": { - "automatic": { - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "(Default) PaymentIntent can be confirmed using a publishable key. After `next_action`s are handled, no additional confirmation is required to complete the payment.", - "undocumented": false, - "html": "(Default) PaymentIntent can be confirmed using a publishable key. After \u003Ccode\u003Enext_action\u003C/code\u003Es are handled, no additional confirmation is required to complete the payment." - } - }, - "manual": { - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "All payment attempts must be made using a secret key. The PaymentIntent returns to the `requires_confirmation` state after handling `next_action`s, and requires your server to initiate each payment attempt with an explicit confirmation.", - "undocumented": false, - "html": "All payment attempts must be made using a secret key. The PaymentIntent returns to the \u003Ccode\u003Erequires_confirmation\u003C/code\u003E state after handling \u003Ccode\u003Enext_action\u003C/code\u003Es, and requires your server to initiate each payment attempt with an explicit confirmation." - } - } - }, - "object_type": "confirmation_method", - "less_common": true - }, - "created": { - "name": "created", - "check": "timestamp", - "validation": "timestamp", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Time at which the object was created. Measured in seconds since the Unix epoch.", - "undocumented": false, - "html": "Time at which the object was created. Measured in seconds since the Unix epoch." - }, - "gate": false, - "hide_unset_desc": null, - "required": true, - "default": null, - "badge_text": "retrievable with publishable key", - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "created", - "less_common": true - }, - "currency": { - "name": "currency", - "check": "currency", - "validation": "currency", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. Must be a [supported currency](https://stripe.com/docs/currencies).", - "undocumented": false, - "html": "Three-letter \u003Ca href=\"https://www.iso.org/iso-4217-currency-codes.html\"\u003EISO currency code\u003C/a\u003E, in lowercase. Must be a \u003Ca href=\"https://stripe.com/docs/currencies\"\u003Esupported currency\u003C/a\u003E." - }, - "gate": false, - "hide_unset_desc": null, - "required": true, - "default": null, - "badge_text": "retrievable with publishable key", - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "currency" - }, - "customer": { - "name": "customer", - "check": "string", - "validation": "string", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "ID of the Customer this PaymentIntent belongs to, if one exists.\n\nPayment methods attached to other Customers cannot be used with this PaymentIntent.\n\nIf present in combination with [setup_future_usage](#payment_intent_object-setup_future_usage), this PaymentIntent's payment method will be attached to the Customer after the PaymentIntent has been confirmed and any required actions from the user are complete.\n", - "undocumented": false, - "html": "ID of the Customer this PaymentIntent belongs to, if one exists.\u003C/p\u003E\n\n\u003Cp\u003EPayment methods attached to other Customers cannot be used with this PaymentIntent.\u003C/p\u003E\n\n\u003Cp\u003EIf present in combination with \u003Ca href=\"#payment_intent_object-setup_future_usage\"\u003Esetup_future_usage\u003C/a\u003E, this PaymentIntent’s payment method will be attached to the Customer after the PaymentIntent has been confirmed and any required actions from the user are complete." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "user_expandable": ["customer"], - "object_type": "customer" - }, - "description": { - "name": "description", - "check": "string", - "validation": "string", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "An arbitrary string attached to the object. Often useful for displaying to users.", - "undocumented": false, - "html": "An arbitrary string attached to the object. Often useful for displaying to users." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": "retrievable with publishable key", - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "description" - }, - "invoice": { - "name": "invoice", - "check": "string", - "validation": "string", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "ID of the invoice that created this PaymentIntent, if it exists.", - "undocumented": false, - "html": "ID of the invoice that created this PaymentIntent, if it exists." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "user_expandable": ["invoice"], - "object_type": "invoice", - "less_common": true - }, - "last_payment_error": { - "name": "last_payment_error", - "check": "hash", - "validation": "hash", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "The payment error encountered in the previous PaymentIntent confirmation. It will be cleared if the PaymentIntent is later updated for any reason.", - "undocumented": false, - "html": "The payment error encountered in the previous PaymentIntent confirmation. It will be cleared if the PaymentIntent is later updated for any reason." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": "retrievable with publishable key", - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "subspec": { - "charge": { - "name": "charge", - "check": "string", - "validation": "string", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "For card errors, the ID of the failed charge.", - "undocumented": false, - "html": "For card errors, the ID of the failed charge." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "charge", - "less_common": true - }, - "code": { - "name": "code", - "check": "string", - "validation": "string", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "For some errors that could be handled programmatically, a short string indicating the [error code](/docs/error-codes) reported.", - "undocumented": false, - "html": "For some errors that could be handled programmatically, a short string indicating the \u003Ca href=\"/docs/error-codes\"\u003Eerror code\u003C/a\u003E reported." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "code" - }, - "decline_code": { - "name": "decline_code", - "check": "string", - "validation": "string", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "For card errors resulting from a card issuer decline, a short string indicating the [card issuer's reason for the decline](/docs/declines#issuer-declines) if they provide one.", - "undocumented": false, - "html": "For card errors resulting from a card issuer decline, a short string indicating the \u003Ca href=\"/docs/declines#issuer-declines\"\u003Ecard issuer’s reason for the decline\u003C/a\u003E if they provide one." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "decline_code" - }, - "doc_url": { - "name": "doc_url", - "check": "string", - "validation": "string", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "A URL to more information about the [error code](/docs/error-codes) reported.", - "undocumented": false, - "html": "A URL to more information about the \u003Ca href=\"/docs/error-codes\"\u003Eerror code\u003C/a\u003E reported." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "doc_url", - "less_common": true - }, - "message": { - "name": "message", - "check": "string", - "validation": "string", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "A human-readable message providing more details about the error. For card errors, these messages can be shown to your users.", - "undocumented": false, - "html": "A human-readable message providing more details about the error. For card errors, these messages can be shown to your users." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "message" - }, - "param": { - "name": "param", - "check": "string", - "validation": "string", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "If the error is parameter-specific, the parameter related to the error. For example, you can use this to display a message near the correct form field.", - "undocumented": false, - "html": "If the error is parameter-specific, the parameter related to the error. For example, you can use this to display a message near the correct form field." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "param" - }, - "payment_method": { - "name": "payment_method", - "check": "hash", - "validation": "hash", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "The PaymentMethod object for errors returned on a request involving a PaymentMethod.", - "undocumented": false, - "html": "The PaymentMethod object for errors returned on a request involving a PaymentMethod." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "subspec": { - "id": { - "name": "id", - "check": "string", - "validation": "string", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Unique identifier for the object.", - "undocumented": false, - "html": "Unique identifier for the object." - }, - "gate": false, - "hide_unset_desc": null, - "required": true, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "id" - }, - "object": { - "name": "object", - "check": "string", - "validation": "string", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "String representing the object's type. Objects of the same type share the same value.", - "undocumented": false, - "html": "String representing the object’s type. Objects of the same type share the same value." - }, - "gate": false, - "hide_unset_desc": null, - "required": true, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "object", - "less_common": true - }, - "acss_debit": { - "name": "acss_debit", - "check": "hash", - "validation": "hash", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "If this is an `acss_debit` PaymentMethod, this hash contains details about the ACSS Debit payment method.", - "undocumented": false, - "html": "If this is an \u003Ccode\u003Eacss_debit\u003C/code\u003E PaymentMethod, this hash contains details about the ACSS Debit payment method." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "subspec": { - "bank_name": { - "name": "bank_name", - "check": "string", - "validation": "string", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Name of the bank associated with the bank account.", - "undocumented": false, - "html": "Name of the bank associated with the bank account." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "bank_name" - }, - "fingerprint": { - "name": "fingerprint", - "check": "string", - "validation": "string", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Uniquely identifies this particular bank account. You can use this attribute to check whether two bank accounts are the same.", - "undocumented": false, - "html": "Uniquely identifies this particular bank account. You can use this attribute to check whether two bank accounts are the same." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "fingerprint" - }, - "institution_number": { - "name": "institution_number", - "check": "string", - "validation": "string", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Institution number of the bank account.", - "undocumented": false, - "html": "Institution number of the bank account." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "institution_number" - }, - "last4": { - "name": "last4", - "check": "string", - "validation": "string", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Last four digits of the bank account number.", - "undocumented": false, - "html": "Last four digits of the bank account number." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "last4" - }, - "transit_number": { - "name": "transit_number", - "check": "string", - "validation": "string", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Transit number of the bank account.", - "undocumented": false, - "html": "Transit number of the bank account." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "transit_number" - } - }, - "object_type": "acss_debit", - "less_common": true - }, - "affirm": { - "name": "affirm", - "check": "hash", - "validation": "hash", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "If this is an `affirm` PaymentMethod, this hash contains details about the Affirm payment method.", - "undocumented": false, - "html": "If this is an \u003Ccode\u003Eaffirm\u003C/code\u003E PaymentMethod, this hash contains details about the Affirm payment method." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "subspec": {}, - "object_type": "affirm", - "less_common": true - }, - "afterpay_clearpay": { - "name": "afterpay_clearpay", - "check": "hash", - "validation": "hash", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "If this is an `AfterpayClearpay` PaymentMethod, this hash contains details about the AfterpayClearpay payment method.", - "undocumented": false, - "html": "If this is an \u003Ccode\u003EAfterpayClearpay\u003C/code\u003E PaymentMethod, this hash contains details about the AfterpayClearpay payment method." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "subspec": {}, - "object_type": "afterpay_clearpay", - "less_common": true - }, - "alipay": { - "name": "alipay", - "check": "hash", - "validation": "hash", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "If this is an `Alipay` PaymentMethod, this hash contains details about the Alipay payment method.", - "undocumented": false, - "html": "If this is an \u003Ccode\u003EAlipay\u003C/code\u003E PaymentMethod, this hash contains details about the Alipay payment method." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "subspec": {}, - "object_type": "alipay", - "less_common": true - }, - "au_becs_debit": { - "name": "au_becs_debit", - "check": "hash", - "validation": "hash", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "If this is an `au_becs_debit` PaymentMethod, this hash contains details about the bank account.", - "undocumented": false, - "html": "If this is an \u003Ccode\u003Eau_becs_debit\u003C/code\u003E PaymentMethod, this hash contains details about the bank account." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "subspec": { - "bsb_number": { - "name": "bsb_number", - "check": "string", - "validation": "string", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Six-digit number identifying bank and branch associated with this bank account.", - "undocumented": false, - "html": "Six-digit number identifying bank and branch associated with this bank account." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "bsb_number" - }, - "fingerprint": { - "name": "fingerprint", - "check": "string", - "validation": "string", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Uniquely identifies this particular bank account. You can use this attribute to check whether two bank accounts are the same.", - "undocumented": false, - "html": "Uniquely identifies this particular bank account. You can use this attribute to check whether two bank accounts are the same." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "fingerprint" - }, - "last4": { - "name": "last4", - "check": "string", - "validation": "string", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Last four digits of the bank account number.", - "undocumented": false, - "html": "Last four digits of the bank account number." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "last4" - } - }, - "object_type": "au_becs_debit", - "less_common": true - }, - "bacs_debit": { - "name": "bacs_debit", - "check": "hash", - "validation": "hash", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "If this is a `bacs_debit` PaymentMethod, this hash contains details about the Bacs Direct Debit bank account.", - "undocumented": false, - "html": "If this is a \u003Ccode\u003Ebacs_debit\u003C/code\u003E PaymentMethod, this hash contains details about the Bacs Direct Debit bank account." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "subspec": { - "fingerprint": { - "name": "fingerprint", - "check": "string", - "validation": "string", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Uniquely identifies this particular bank account. You can use this attribute to check whether two bank accounts are the same.", - "undocumented": false, - "html": "Uniquely identifies this particular bank account. You can use this attribute to check whether two bank accounts are the same." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "fingerprint" - }, - "last4": { - "name": "last4", - "check": "string", - "validation": "string", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Last four digits of the bank account number.", - "undocumented": false, - "html": "Last four digits of the bank account number." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "last4" - }, - "sort_code": { - "name": "sort_code", - "check": "string", - "validation": "string", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Sort code of the bank account. (e.g., `10-20-30`)", - "undocumented": false, - "html": "Sort code of the bank account. (e.g., \u003Ccode\u003E10-20-30\u003C/code\u003E)" - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "sort_code" - } - }, - "object_type": "bacs_debit", - "less_common": true - }, - "bancontact": { - "name": "bancontact", - "check": "hash", - "validation": "hash", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "If this is a `bancontact` PaymentMethod, this hash contains details about the Bancontact payment method.", - "undocumented": false, - "html": "If this is a \u003Ccode\u003Ebancontact\u003C/code\u003E PaymentMethod, this hash contains details about the Bancontact payment method." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "subspec": {}, - "object_type": "bancontact", - "less_common": true - }, - "billing_details": { - "name": "billing_details", - "check": "hash", - "validation": "hash", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Billing information associated with the PaymentMethod that may be used or required by particular types of payment methods.", - "undocumented": false, - "html": "Billing information associated with the PaymentMethod that may be used or required by particular types of payment methods." - }, - "gate": false, - "hide_unset_desc": null, - "required": true, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "subspec": { - "address": { - "name": "address", - "check": "hash", - "validation": "hash", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Billing address.", - "undocumented": false, - "html": "Billing address." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "subspec": { - "city": { - "name": "city", - "check": "string", - "validation": "string", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "City, district, suburb, town, or village.", - "undocumented": false, - "html": "City, district, suburb, town, or village." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "city" - }, - "country": { - "name": "country", - "check": "string", - "validation": "string", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)).", - "undocumented": false, - "html": "Two-letter country code (\u003Ca href=\"https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2\"\u003EISO 3166-1 alpha-2\u003C/a\u003E)." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "country" - }, - "line1": { - "name": "line1", - "check": "string", - "validation": "string", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Address line 1 (e.g., street, PO Box, or company name).", - "undocumented": false, - "html": "Address line 1 (e.g., street, PO Box, or company name)." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "line1" - }, - "line2": { - "name": "line2", - "check": "string", - "validation": "string", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Address line 2 (e.g., apartment, suite, unit, or building).", - "undocumented": false, - "html": "Address line 2 (e.g., apartment, suite, unit, or building)." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "line2" - }, - "postal_code": { - "name": "postal_code", - "check": "string", - "validation": "string", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "ZIP or postal code.", - "undocumented": false, - "html": "ZIP or postal code." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "postal_code" - }, - "state": { - "name": "state", - "check": "string", - "validation": "string", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "State, county, province, or region.", - "undocumented": false, - "html": "State, county, province, or region." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "state" - } - }, - "object_type": "address" - }, - "email": { - "name": "email", - "check": "string", - "validation": "string", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Email address.", - "undocumented": false, - "html": "Email address." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "email" - }, - "name": { - "name": "name", - "check": "string", - "validation": "string", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Full name.", - "undocumented": false, - "html": "Full name." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "name" - }, - "phone": { - "name": "phone", - "check": "string", - "validation": "string", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Billing phone number (including extension).", - "undocumented": false, - "html": "Billing phone number (including extension)." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "phone" - } - }, - "object_type": "billing_details" - }, - "blik": { - "name": "blik", - "check": "hash", - "validation": "hash", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "If this is a `blik` PaymentMethod, this hash contains details about the BLIK payment method.", - "undocumented": false, - "html": "If this is a \u003Ccode\u003Eblik\u003C/code\u003E PaymentMethod, this hash contains details about the BLIK payment method." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "subspec": {}, - "object_type": "blik", - "less_common": true - }, - "boleto": { - "name": "boleto", - "check": "hash", - "validation": "hash", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "If this is a `boleto` PaymentMethod, this hash contains details about the Boleto payment method.", - "undocumented": false, - "html": "If this is a \u003Ccode\u003Eboleto\u003C/code\u003E PaymentMethod, this hash contains details about the Boleto payment method." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "subspec": { - "fingerprint": { - "name": "fingerprint", - "check": "string", - "validation": "string", - "documentation": null, - "gate": true, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "fingerprint" - }, - "tax_id": { - "name": "tax_id", - "check": "string", - "validation": "string", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Uniquely identifies the customer tax id (CNPJ or CPF)", - "undocumented": false, - "html": "Uniquely identifies the customer tax id (CNPJ or CPF)" - }, - "gate": false, - "hide_unset_desc": null, - "required": true, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "tax_id" - } - }, - "object_type": "boleto", - "less_common": true - }, - "card": { - "name": "card", - "check": "hash", - "validation": "hash", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "If this is a `card` PaymentMethod, this hash contains the user's card details.", - "undocumented": false, - "html": "If this is a \u003Ccode\u003Ecard\u003C/code\u003E PaymentMethod, this hash contains the user’s card details." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "subspec": { - "brand": { - "name": "brand", - "check": "string", - "validation": "string", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Card brand. Can be `amex`, `diners`, `discover`, `jcb`, `mastercard`, `unionpay`, `visa`, or `unknown`.", - "undocumented": false, - "html": "Card brand. Can be \u003Ccode\u003Eamex\u003C/code\u003E, \u003Ccode\u003Ediners\u003C/code\u003E, \u003Ccode\u003Ediscover\u003C/code\u003E, \u003Ccode\u003Ejcb\u003C/code\u003E, \u003Ccode\u003Emastercard\u003C/code\u003E, \u003Ccode\u003Eunionpay\u003C/code\u003E, \u003Ccode\u003Evisa\u003C/code\u003E, or \u003Ccode\u003Eunknown\u003C/code\u003E." - }, - "gate": false, - "hide_unset_desc": null, - "required": true, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "brand" - }, - "checks": { - "name": "checks", - "check": "hash", - "validation": "hash", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Checks on Card address and CVC if provided.", - "undocumented": false, - "html": "Checks on Card address and CVC if provided." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "subspec": { - "address_line1_check": { - "name": "address_line1_check", - "check": "string", - "validation": "string", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "If a address line1 was provided, results of the check, one of `pass`, `fail`, `unavailable`, or `unchecked`.", - "undocumented": false, - "html": "If a address line1 was provided, results of the check, one of \u003Ccode\u003Epass\u003C/code\u003E, \u003Ccode\u003Efail\u003C/code\u003E, \u003Ccode\u003Eunavailable\u003C/code\u003E, or \u003Ccode\u003Eunchecked\u003C/code\u003E." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "address_line1_check" - }, - "address_postal_code_check": { - "name": "address_postal_code_check", - "check": "string", - "validation": "string", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "If a address postal code was provided, results of the check, one of `pass`, `fail`, `unavailable`, or `unchecked`.", - "undocumented": false, - "html": "If a address postal code was provided, results of the check, one of \u003Ccode\u003Epass\u003C/code\u003E, \u003Ccode\u003Efail\u003C/code\u003E, \u003Ccode\u003Eunavailable\u003C/code\u003E, or \u003Ccode\u003Eunchecked\u003C/code\u003E." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "address_postal_code_check" - }, - "cvc_check": { - "name": "cvc_check", - "check": "string", - "validation": "string", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "If a CVC was provided, results of the check, one of `pass`, `fail`, `unavailable`, or `unchecked`.", - "undocumented": false, - "html": "If a CVC was provided, results of the check, one of \u003Ccode\u003Epass\u003C/code\u003E, \u003Ccode\u003Efail\u003C/code\u003E, \u003Ccode\u003Eunavailable\u003C/code\u003E, or \u003Ccode\u003Eunchecked\u003C/code\u003E." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "cvc_check" - } - }, - "object_type": "checks" - }, - "country": { - "name": "country", - "check": "string", - "validation": "string", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Two-letter ISO code representing the country of the card. You could use this attribute to get a sense of the international breakdown of cards you've collected.", - "undocumented": false, - "html": "Two-letter ISO code representing the country of the card. You could use this attribute to get a sense of the international breakdown of cards you’ve collected." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "country" - }, - "exp_month": { - "name": "exp_month", - "check": "integer", - "validation": "integer", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Two-digit number representing the card's expiration month.", - "undocumented": false, - "html": "Two-digit number representing the card’s expiration month." - }, - "gate": false, - "hide_unset_desc": null, - "required": true, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "exp_month" - }, - "exp_year": { - "name": "exp_year", - "check": "integer", - "validation": "integer", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Four-digit number representing the card's expiration year.", - "undocumented": false, - "html": "Four-digit number representing the card’s expiration year." - }, - "gate": false, - "hide_unset_desc": null, - "required": true, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "exp_year" - }, - "fingerprint": { - "name": "fingerprint", - "check": "string", - "validation": "string", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Uniquely identifies this particular card number. You can use this attribute to check whether two customers who’ve signed up with you are using the same card number, for example. For payment methods that tokenize card information (Apple Pay, Google Pay), the tokenized number might be provided instead of the underlying card number.\n\n*Starting May 1, 2021, card fingerprint in India for Connect will change to allow two fingerprints for the same card --- one for India and one for the rest of the world.*\n", - "undocumented": false, - "html": "Uniquely identifies this particular card number. You can use this attribute to check whether two customers who’ve signed up with you are using the same card number, for example. For payment methods that tokenize card information (Apple Pay, Google Pay), the tokenized number might be provided instead of the underlying card number.\u003C/p\u003E\n\n\u003Cp\u003E\u003Cem\u003EStarting May 1, 2021, card fingerprint in India for Connect will change to allow two fingerprints for the same card — one for India and one for the rest of the world.\u003C/em\u003E" - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": "card_fingerprint_read", - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "fingerprint" - }, - "funding": { - "name": "funding", - "check": "string", - "validation": "string", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Card funding type. Can be `credit`, `debit`, `prepaid`, or `unknown`.", - "undocumented": false, - "html": "Card funding type. Can be \u003Ccode\u003Ecredit\u003C/code\u003E, \u003Ccode\u003Edebit\u003C/code\u003E, \u003Ccode\u003Eprepaid\u003C/code\u003E, or \u003Ccode\u003Eunknown\u003C/code\u003E." - }, - "gate": false, - "hide_unset_desc": null, - "required": true, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "funding" - }, - "generated_from": { - "name": "generated_from", - "check": "hash", - "validation": "hash", - "documentation": { - "gate_specific": { - "sdk_client_public": { - "gate_specific": {}, - "localize_terms": [], - "undocumented": true, - "html": null - } - }, - "localize_terms": [], - "markdown": "Details of the original PaymentMethod that created this object.", - "undocumented": false, - "html": "Details of the original PaymentMethod that created this object." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "subspec": { - "charge": { - "name": "charge", - "check": "string", - "validation": "string", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "The charge that created this object.", - "undocumented": false, - "html": "The charge that created this object." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "charge" - }, - "payment_method_details": { - "name": "payment_method_details", - "check": "hash", - "validation": "hash", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Transaction-specific details of the payment method used in the payment.", - "undocumented": false, - "html": "Transaction-specific details of the payment method used in the payment." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "subspec": { - "card_present": { - "name": "card_present", - "check": "hash", - "validation": "hash", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "This hash contains the snapshot of the `card_present` transaction-specific details which generated this `card` payment method.", - "undocumented": false, - "html": "This hash contains the snapshot of the \u003Ccode\u003Ecard_present\u003C/code\u003E transaction-specific details which generated this \u003Ccode\u003Ecard\u003C/code\u003E payment method." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "subspec": { - "amount_authorized": { - "name": "amount_authorized", - "check": "integer", - "validation": "integer", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "The authorized amount", - "undocumented": false, - "html": "The authorized amount" - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "amount_authorized" - }, - "brand": { - "name": "brand", - "check": "string", - "validation": "string", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Card brand. Can be `amex`, `diners`, `discover`, `jcb`, `mastercard`, `unionpay`, `visa`, or `unknown`.", - "undocumented": false, - "html": "Card brand. Can be \u003Ccode\u003Eamex\u003C/code\u003E, \u003Ccode\u003Ediners\u003C/code\u003E, \u003Ccode\u003Ediscover\u003C/code\u003E, \u003Ccode\u003Ejcb\u003C/code\u003E, \u003Ccode\u003Emastercard\u003C/code\u003E, \u003Ccode\u003Eunionpay\u003C/code\u003E, \u003Ccode\u003Evisa\u003C/code\u003E, or \u003Ccode\u003Eunknown\u003C/code\u003E." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "brand" - }, - "capture_before": { - "name": "capture_before", - "check": "timestamp", - "validation": "timestamp", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "When using manual capture, a future timestamp after which the charge will be automatically refunded if uncaptured.", - "undocumented": false, - "html": "When using manual capture, a future timestamp after which the charge will be automatically refunded if uncaptured." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "capture_before" - }, - "cardholder_name": { - "name": "cardholder_name", - "check": "string", - "validation": "string", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "The cardholder name as read from the card, in [ISO 7813](https://en.wikipedia.org/wiki/ISO/IEC_7813) format. May include alphanumeric characters, special characters and first/last name separator (`/`). In some cases, the cardholder name may not be available depending on how the issuer has configured the card. Cardholder name is typically not available on swipe or contactless payments, such as those made with Apple Pay and Google Pay.", - "undocumented": false, - "html": "The cardholder name as read from the card, in \u003Ca href=\"https://en.wikipedia.org/wiki/ISO/IEC_7813\"\u003EISO 7813\u003C/a\u003E format. May include alphanumeric characters, special characters and first/last name separator (\u003Ccode\u003E/\u003C/code\u003E). In some cases, the cardholder name may not be available depending on how the issuer has configured the card. Cardholder name is typically not available on swipe or contactless payments, such as those made with Apple Pay and Google Pay." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "cardholder_name" - }, - "country": { - "name": "country", - "check": "string", - "validation": "string", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Two-letter ISO code representing the country of the card. You could use this attribute to get a sense of the international breakdown of cards you've collected.", - "undocumented": false, - "html": "Two-letter ISO code representing the country of the card. You could use this attribute to get a sense of the international breakdown of cards you’ve collected." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "country" - }, - "emv_auth_data": { - "name": "emv_auth_data", - "check": "string", - "validation": "string", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Authorization response cryptogram.", - "undocumented": false, - "html": "Authorization response cryptogram." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "emv_auth_data" - }, - "exp_month": { - "name": "exp_month", - "check": "integer", - "validation": "integer", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Two-digit number representing the card's expiration month.", - "undocumented": false, - "html": "Two-digit number representing the card’s expiration month." - }, - "gate": false, - "hide_unset_desc": null, - "required": true, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "exp_month" - }, - "exp_year": { - "name": "exp_year", - "check": "integer", - "validation": "integer", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Four-digit number representing the card's expiration year.", - "undocumented": false, - "html": "Four-digit number representing the card’s expiration year." - }, - "gate": false, - "hide_unset_desc": null, - "required": true, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "exp_year" - }, - "fingerprint": { - "name": "fingerprint", - "check": "string", - "validation": "string", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Uniquely identifies this particular card number. You can use this attribute to check whether two customers who’ve signed up with you are using the same card number, for example. For payment methods that tokenize card information (Apple Pay, Google Pay), the tokenized number might be provided instead of the underlying card number.\n\n*Starting May 1, 2021, card fingerprint in India for Connect will change to allow two fingerprints for the same card --- one for India and one for the rest of the world.*\n", - "undocumented": false, - "html": "Uniquely identifies this particular card number. You can use this attribute to check whether two customers who’ve signed up with you are using the same card number, for example. For payment methods that tokenize card information (Apple Pay, Google Pay), the tokenized number might be provided instead of the underlying card number.\u003C/p\u003E\n\n\u003Cp\u003E\u003Cem\u003EStarting May 1, 2021, card fingerprint in India for Connect will change to allow two fingerprints for the same card — one for India and one for the rest of the world.\u003C/em\u003E" - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "fingerprint" - }, - "funding": { - "name": "funding", - "check": "string", - "validation": "string", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Card funding type. Can be `credit`, `debit`, `prepaid`, or `unknown`.", - "undocumented": false, - "html": "Card funding type. Can be \u003Ccode\u003Ecredit\u003C/code\u003E, \u003Ccode\u003Edebit\u003C/code\u003E, \u003Ccode\u003Eprepaid\u003C/code\u003E, or \u003Ccode\u003Eunknown\u003C/code\u003E." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "funding" - }, - "generated_card": { - "name": "generated_card", - "check": "string", - "validation": "string", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "ID of a card PaymentMethod generated from the card_present PaymentMethod that may be attached to a Customer for future transactions. Only present if it was possible to generate a card PaymentMethod.", - "undocumented": false, - "html": "ID of a card PaymentMethod generated from the card_present PaymentMethod that may be attached to a Customer for future transactions. Only present if it was possible to generate a card PaymentMethod." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "generated_card" - }, - "incremental_authorization_supported": { - "name": "incremental_authorization_supported", - "check": "boolean", - "validation": "boolean", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Whether this [PaymentIntent](/docs/api/payment_intents) is eligible for incremental authorizations. Request support using [request_incremental_authorization_support](/docs/api/payment_intents/create#create_payment_intent-payment_method_options-card_present-request_incremental_authorization_support).", - "undocumented": false, - "html": "Whether this \u003Ca href=\"/docs/api/payment_intents\"\u003EPaymentIntent\u003C/a\u003E is eligible for incremental authorizations. Request support using \u003Ca href=\"/docs/api/payment_intents/create#create_payment_intent-payment_method_options-card_present-request_incremental_authorization_support\"\u003Erequest_incremental_authorization_support\u003C/a\u003E." - }, - "gate": false, - "hide_unset_desc": null, - "required": true, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "incremental_authorization_supported" - }, - "last4": { - "name": "last4", - "check": "string", - "validation": "string", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "The last four digits of the card.", - "undocumented": false, - "html": "The last four digits of the card." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "last4" - }, - "network": { - "name": "network", - "check": "string", - "validation": "string", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Identifies which network this charge was processed on. Can be `amex`, `cartes_bancaires`, `diners`, `discover`, `interac`, `jcb`, `mastercard`, `unionpay`, `visa`, or `unknown`.", - "undocumented": false, - "html": "Identifies which network this charge was processed on. Can be \u003Ccode\u003Eamex\u003C/code\u003E, \u003Ccode\u003Ecartes_bancaires\u003C/code\u003E, \u003Ccode\u003Ediners\u003C/code\u003E, \u003Ccode\u003Ediscover\u003C/code\u003E, \u003Ccode\u003Einterac\u003C/code\u003E, \u003Ccode\u003Ejcb\u003C/code\u003E, \u003Ccode\u003Emastercard\u003C/code\u003E, \u003Ccode\u003Eunionpay\u003C/code\u003E, \u003Ccode\u003Evisa\u003C/code\u003E, or \u003Ccode\u003Eunknown\u003C/code\u003E." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "network" - }, - "overcapture_supported": { - "name": "overcapture_supported", - "check": "boolean", - "validation": "boolean", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Defines whether the authorized amount can be over-captured or not", - "undocumented": false, - "html": "Defines whether the authorized amount can be over-captured or not" - }, - "gate": false, - "hide_unset_desc": null, - "required": true, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "overcapture_supported" - }, - "read_method": { - "name": "read_method", - "check": "string", - "validation": "string", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "How card details were read in this transaction.", - "undocumented": false, - "html": "How card details were read in this transaction." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "enum_values": { - "contact_emv": { - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Inserting a chip card into the card reader.", - "undocumented": false, - "html": "Inserting a chip card into the card reader." - } - }, - "contactless_emv": { - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Tapping a contactless-enabled chip card or mobile wallet.", - "undocumented": false, - "html": "Tapping a contactless-enabled chip card or mobile wallet." - } - }, - "magnetic_stripe_track2": { - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Swiping a card using the magnetic stripe reader.", - "undocumented": false, - "html": "Swiping a card using the magnetic stripe reader." - } - }, - "magnetic_stripe_fallback": { - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "When inserting a chip card fails three times in a row, fallback to a magnetic stripe read.", - "undocumented": false, - "html": "When inserting a chip card fails three times in a row, fallback to a magnetic stripe read." - } - }, - "contactless_magstripe_mode": { - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Older standard for contactless payments that emulated a magnetic stripe read.", - "undocumented": false, - "html": "Older standard for contactless payments that emulated a magnetic stripe read." - } - } - }, - "object_type": "read_method" - }, - "receipt": { - "name": "receipt", - "check": "hash", - "validation": "hash", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "A collection of fields required to be displayed on receipts. Only required for EMV transactions.", - "undocumented": false, - "html": "A collection of fields required to be displayed on receipts. Only required for EMV transactions." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "subspec": { - "account_type": { - "name": "account_type", - "check": "string", - "validation": "string", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "The type of account being debited or credited", - "undocumented": false, - "html": "The type of account being debited or credited" - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "enum_values": { - "credit": { - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "A credit account, as when using a credit card", - "undocumented": false, - "html": "A credit account, as when using a credit card" - } - }, - "checking": { - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "A checking account, as when using a debit card", - "undocumented": false, - "html": "A checking account, as when using a debit card" - } - }, - "prepaid": { - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "A prepaid account, as when using a debit gift card", - "undocumented": false, - "html": "A prepaid account, as when using a debit gift card" - } - }, - "unknown": { - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "An unknown account", - "undocumented": false, - "html": "An unknown account" - } - } - }, - "object_type": "account_type" - }, - "application_cryptogram": { - "name": "application_cryptogram", - "check": "string", - "validation": "string", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "EMV tag 9F26, cryptogram generated by the integrated circuit chip.", - "undocumented": false, - "html": "EMV tag 9F26, cryptogram generated by the integrated circuit chip." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "application_cryptogram" - }, - "application_preferred_name": { - "name": "application_preferred_name", - "check": "string", - "validation": "string", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Mnenomic of the Application Identifier.", - "undocumented": false, - "html": "Mnenomic of the Application Identifier." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "application_preferred_name" - }, - "authorization_code": { - "name": "authorization_code", - "check": "string", - "validation": "string", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Identifier for this transaction.", - "undocumented": false, - "html": "Identifier for this transaction." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "authorization_code" - }, - "authorization_response_code": { - "name": "authorization_response_code", - "check": "string", - "validation": "string", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "EMV tag 8A. A code returned by the card issuer.", - "undocumented": false, - "html": "EMV tag 8A. A code returned by the card issuer." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "authorization_response_code" - }, - "cardholder_verification_method": { - "name": "cardholder_verification_method", - "check": "string", - "validation": "string", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "How the cardholder verified ownership of the card.", - "undocumented": false, - "html": "How the cardholder verified ownership of the card." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "cardholder_verification_method" - }, - "dedicated_file_name": { - "name": "dedicated_file_name", - "check": "string", - "validation": "string", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "EMV tag 84. Similar to the application identifier stored on the integrated circuit chip.", - "undocumented": false, - "html": "EMV tag 84. Similar to the application identifier stored on the integrated circuit chip." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "dedicated_file_name" - }, - "terminal_verification_results": { - "name": "terminal_verification_results", - "check": "string", - "validation": "string", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "The outcome of a series of EMV functions performed by the card reader.", - "undocumented": false, - "html": "The outcome of a series of EMV functions performed by the card reader." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "terminal_verification_results" - }, - "transaction_status_information": { - "name": "transaction_status_information", - "check": "string", - "validation": "string", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "An indication of various EMV functions performed during the transaction.", - "undocumented": false, - "html": "An indication of various EMV functions performed during the transaction." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "transaction_status_information" - } - }, - "object_type": "receipt" - } - }, - "object_type": "card_present" - }, - "type": { - "name": "type", - "check": "string", - "validation": "string", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "The type of payment method transaction-specific details from the transaction that generated this `card` payment method. Always `card_present`.", - "undocumented": false, - "html": "The type of payment method transaction-specific details from the transaction that generated this \u003Ccode\u003Ecard\u003C/code\u003E payment method. Always \u003Ccode\u003Ecard_present\u003C/code\u003E." - }, - "gate": false, - "hide_unset_desc": null, - "required": true, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "type" - } - }, - "object_type": "payment_method_details" - }, - "setup_attempt": { - "name": "setup_attempt", - "check": "string", - "validation": "string", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "The ID of the SetupAttempt that generated this PaymentMethod, if any.", - "undocumented": false, - "html": "The ID of the SetupAttempt that generated this PaymentMethod, if any." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "user_expandable": ["setup_attempt"], - "object_type": "setup_attempt" - } - }, - "object_type": "generated_from" - }, - "last4": { - "name": "last4", - "check": "string", - "validation": "string", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "The last four digits of the card.", - "undocumented": false, - "html": "The last four digits of the card." - }, - "gate": false, - "hide_unset_desc": null, - "required": true, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "last4" - }, - "networks": { - "name": "networks", - "check": "hash", - "validation": "hash", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Contains information about card networks that can be used to process the payment.", - "undocumented": false, - "html": "Contains information about card networks that can be used to process the payment." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "subspec": { - "available": { - "name": "available", - "check": "string_array", - "validation": "array containing strings", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "All available networks for the card.", - "undocumented": false, - "html": "All available networks for the card." - }, - "gate": false, - "hide_unset_desc": null, - "required": true, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "available" - }, - "preferred": { - "name": "preferred", - "check": "string", - "validation": "string", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "The preferred network for the card.", - "undocumented": false, - "html": "The preferred network for the card." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "preferred" - } - }, - "object_type": "networks" - }, - "three_d_secure_usage": { - "name": "three_d_secure_usage", - "check": "hash", - "validation": "hash", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Contains details on how this Card may be used for 3D Secure authentication.", - "undocumented": false, - "html": "Contains details on how this Card may be used for 3D Secure authentication." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "subspec": { - "supported": { - "name": "supported", - "check": "boolean", - "validation": "boolean", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Whether 3D Secure is supported on this card.", - "undocumented": false, - "html": "Whether 3D Secure is supported on this card." - }, - "gate": false, - "hide_unset_desc": null, - "required": true, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "supported" - } - }, - "object_type": "three_d_secure_usage" - }, - "wallet": { - "name": "wallet", - "check": "hash", - "validation": "hash", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "If this Card is part of a card wallet, this contains the details of the card wallet.", - "undocumented": false, - "html": "If this Card is part of a card wallet, this contains the details of the card wallet." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "subspec": { - "amex_express_checkout": { - "name": "amex_express_checkout", - "check": "hash", - "validation": "hash", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "If this is a `amex_express_checkout` card wallet, this hash contains details about the wallet.", - "undocumented": false, - "html": "If this is a \u003Ccode\u003Eamex_express_checkout\u003C/code\u003E card wallet, this hash contains details about the wallet." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "subspec": {}, - "object_type": "amex_express_checkout" - }, - "apple_pay": { - "name": "apple_pay", - "check": "hash", - "validation": "hash", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "If this is a `apple_pay` card wallet, this hash contains details about the wallet.", - "undocumented": false, - "html": "If this is a \u003Ccode\u003Eapple_pay\u003C/code\u003E card wallet, this hash contains details about the wallet." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "subspec": {}, - "object_type": "apple_pay" - }, - "dynamic_last4": { - "name": "dynamic_last4", - "check": "string", - "validation": "string", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "(For tokenized numbers only.) The last four digits of the device account number.", - "undocumented": false, - "html": "(For tokenized numbers only.) The last four digits of the device account number." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "dynamic_last4" - }, - "google_pay": { - "name": "google_pay", - "check": "hash", - "validation": "hash", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "If this is a `google_pay` card wallet, this hash contains details about the wallet.", - "undocumented": false, - "html": "If this is a \u003Ccode\u003Egoogle_pay\u003C/code\u003E card wallet, this hash contains details about the wallet." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "subspec": {}, - "object_type": "google_pay" - }, - "masterpass": { - "name": "masterpass", - "check": "hash", - "validation": "hash", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "If this is a `masterpass` card wallet, this hash contains details about the wallet.", - "undocumented": false, - "html": "If this is a \u003Ccode\u003Emasterpass\u003C/code\u003E card wallet, this hash contains details about the wallet." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "subspec": { - "billing_address": { - "name": "billing_address", - "check": "hash", - "validation": "hash", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Owner's verified billing address. Values are verified or provided by the wallet directly (if supported) at the time of authorization or settlement. They cannot be set or mutated.", - "undocumented": false, - "html": "Owner’s verified billing address. Values are verified or provided by the wallet directly (if supported) at the time of authorization or settlement. They cannot be set or mutated." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "subspec": { - "city": { - "name": "city", - "check": "string", - "validation": "string", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "City, district, suburb, town, or village.", - "undocumented": false, - "html": "City, district, suburb, town, or village." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "city" - }, - "country": { - "name": "country", - "check": "string", - "validation": "string", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)).", - "undocumented": false, - "html": "Two-letter country code (\u003Ca href=\"https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2\"\u003EISO 3166-1 alpha-2\u003C/a\u003E)." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "country" - }, - "line1": { - "name": "line1", - "check": "string", - "validation": "string", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Address line 1 (e.g., street, PO Box, or company name).", - "undocumented": false, - "html": "Address line 1 (e.g., street, PO Box, or company name)." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "line1" - }, - "line2": { - "name": "line2", - "check": "string", - "validation": "string", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Address line 2 (e.g., apartment, suite, unit, or building).", - "undocumented": false, - "html": "Address line 2 (e.g., apartment, suite, unit, or building)." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "line2" - }, - "postal_code": { - "name": "postal_code", - "check": "string", - "validation": "string", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "ZIP or postal code.", - "undocumented": false, - "html": "ZIP or postal code." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "postal_code" - }, - "state": { - "name": "state", - "check": "string", - "validation": "string", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "State, county, province, or region.", - "undocumented": false, - "html": "State, county, province, or region." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "state" - } - }, - "object_type": "billing_address" - }, - "email": { - "name": "email", - "check": "string", - "validation": "string", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Owner's verified email. Values are verified or provided by the wallet directly (if supported) at the time of authorization or settlement. They cannot be set or mutated.", - "undocumented": false, - "html": "Owner’s verified email. Values are verified or provided by the wallet directly (if supported) at the time of authorization or settlement. They cannot be set or mutated." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "email" - }, - "name": { - "name": "name", - "check": "string", - "validation": "string", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Owner's verified full name. Values are verified or provided by the wallet directly (if supported) at the time of authorization or settlement. They cannot be set or mutated.", - "undocumented": false, - "html": "Owner’s verified full name. Values are verified or provided by the wallet directly (if supported) at the time of authorization or settlement. They cannot be set or mutated." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "name" - }, - "shipping_address": { - "name": "shipping_address", - "check": "hash", - "validation": "hash", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Owner's verified shipping address. Values are verified or provided by the wallet directly (if supported) at the time of authorization or settlement. They cannot be set or mutated.", - "undocumented": false, - "html": "Owner’s verified shipping address. Values are verified or provided by the wallet directly (if supported) at the time of authorization or settlement. They cannot be set or mutated." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "subspec": { - "city": { - "name": "city", - "check": "string", - "validation": "string", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "City, district, suburb, town, or village.", - "undocumented": false, - "html": "City, district, suburb, town, or village." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "city" - }, - "country": { - "name": "country", - "check": "string", - "validation": "string", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)).", - "undocumented": false, - "html": "Two-letter country code (\u003Ca href=\"https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2\"\u003EISO 3166-1 alpha-2\u003C/a\u003E)." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "country" - }, - "line1": { - "name": "line1", - "check": "string", - "validation": "string", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Address line 1 (e.g., street, PO Box, or company name).", - "undocumented": false, - "html": "Address line 1 (e.g., street, PO Box, or company name)." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "line1" - }, - "line2": { - "name": "line2", - "check": "string", - "validation": "string", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Address line 2 (e.g., apartment, suite, unit, or building).", - "undocumented": false, - "html": "Address line 2 (e.g., apartment, suite, unit, or building)." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "line2" - }, - "postal_code": { - "name": "postal_code", - "check": "string", - "validation": "string", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "ZIP or postal code.", - "undocumented": false, - "html": "ZIP or postal code." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "postal_code" - }, - "state": { - "name": "state", - "check": "string", - "validation": "string", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "State, county, province, or region.", - "undocumented": false, - "html": "State, county, province, or region." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "state" - } - }, - "object_type": "shipping_address" - } - }, - "object_type": "masterpass" - }, - "samsung_pay": { - "name": "samsung_pay", - "check": "hash", - "validation": "hash", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "If this is a `samsung_pay` card wallet, this hash contains details about the wallet.", - "undocumented": false, - "html": "If this is a \u003Ccode\u003Esamsung_pay\u003C/code\u003E card wallet, this hash contains details about the wallet." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "subspec": {}, - "object_type": "samsung_pay" - }, - "type": { - "name": "type", - "check": "string", - "validation": "string", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "The type of the card wallet, one of `amex_express_checkout`, `apple_pay`, `google_pay`, `masterpass`, `samsung_pay`, or `visa_checkout`. An additional hash is included on the Wallet subhash with a name matching this value. It contains additional information specific to the card wallet type.", - "undocumented": false, - "html": "The type of the card wallet, one of \u003Ccode\u003Eamex_express_checkout\u003C/code\u003E, \u003Ccode\u003Eapple_pay\u003C/code\u003E, \u003Ccode\u003Egoogle_pay\u003C/code\u003E, \u003Ccode\u003Emasterpass\u003C/code\u003E, \u003Ccode\u003Esamsung_pay\u003C/code\u003E, or \u003Ccode\u003Evisa_checkout\u003C/code\u003E. An additional hash is included on the Wallet subhash with a name matching this value. It contains additional information specific to the card wallet type." - }, - "gate": false, - "hide_unset_desc": null, - "required": true, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "type" - }, - "visa_checkout": { - "name": "visa_checkout", - "check": "hash", - "validation": "hash", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "If this is a `visa_checkout` card wallet, this hash contains details about the wallet.", - "undocumented": false, - "html": "If this is a \u003Ccode\u003Evisa_checkout\u003C/code\u003E card wallet, this hash contains details about the wallet." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "subspec": { - "billing_address": { - "name": "billing_address", - "check": "hash", - "validation": "hash", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Owner's verified billing address. Values are verified or provided by the wallet directly (if supported) at the time of authorization or settlement. They cannot be set or mutated.", - "undocumented": false, - "html": "Owner’s verified billing address. Values are verified or provided by the wallet directly (if supported) at the time of authorization or settlement. They cannot be set or mutated." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "subspec": { - "city": { - "name": "city", - "check": "string", - "validation": "string", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "City, district, suburb, town, or village.", - "undocumented": false, - "html": "City, district, suburb, town, or village." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "city" - }, - "country": { - "name": "country", - "check": "string", - "validation": "string", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)).", - "undocumented": false, - "html": "Two-letter country code (\u003Ca href=\"https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2\"\u003EISO 3166-1 alpha-2\u003C/a\u003E)." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "country" - }, - "line1": { - "name": "line1", - "check": "string", - "validation": "string", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Address line 1 (e.g., street, PO Box, or company name).", - "undocumented": false, - "html": "Address line 1 (e.g., street, PO Box, or company name)." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "line1" - }, - "line2": { - "name": "line2", - "check": "string", - "validation": "string", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Address line 2 (e.g., apartment, suite, unit, or building).", - "undocumented": false, - "html": "Address line 2 (e.g., apartment, suite, unit, or building)." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "line2" - }, - "postal_code": { - "name": "postal_code", - "check": "string", - "validation": "string", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "ZIP or postal code.", - "undocumented": false, - "html": "ZIP or postal code." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "postal_code" - }, - "state": { - "name": "state", - "check": "string", - "validation": "string", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "State, county, province, or region.", - "undocumented": false, - "html": "State, county, province, or region." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "state" - } - }, - "object_type": "billing_address" - }, - "email": { - "name": "email", - "check": "string", - "validation": "string", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Owner's verified email. Values are verified or provided by the wallet directly (if supported) at the time of authorization or settlement. They cannot be set or mutated.", - "undocumented": false, - "html": "Owner’s verified email. Values are verified or provided by the wallet directly (if supported) at the time of authorization or settlement. They cannot be set or mutated." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "email" - }, - "name": { - "name": "name", - "check": "string", - "validation": "string", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Owner's verified full name. Values are verified or provided by the wallet directly (if supported) at the time of authorization or settlement. They cannot be set or mutated.", - "undocumented": false, - "html": "Owner’s verified full name. Values are verified or provided by the wallet directly (if supported) at the time of authorization or settlement. They cannot be set or mutated." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "name" - }, - "shipping_address": { - "name": "shipping_address", - "check": "hash", - "validation": "hash", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Owner's verified shipping address. Values are verified or provided by the wallet directly (if supported) at the time of authorization or settlement. They cannot be set or mutated.", - "undocumented": false, - "html": "Owner’s verified shipping address. Values are verified or provided by the wallet directly (if supported) at the time of authorization or settlement. They cannot be set or mutated." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "subspec": { - "city": { - "name": "city", - "check": "string", - "validation": "string", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "City, district, suburb, town, or village.", - "undocumented": false, - "html": "City, district, suburb, town, or village." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "city" - }, - "country": { - "name": "country", - "check": "string", - "validation": "string", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)).", - "undocumented": false, - "html": "Two-letter country code (\u003Ca href=\"https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2\"\u003EISO 3166-1 alpha-2\u003C/a\u003E)." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "country" - }, - "line1": { - "name": "line1", - "check": "string", - "validation": "string", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Address line 1 (e.g., street, PO Box, or company name).", - "undocumented": false, - "html": "Address line 1 (e.g., street, PO Box, or company name)." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "line1" - }, - "line2": { - "name": "line2", - "check": "string", - "validation": "string", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Address line 2 (e.g., apartment, suite, unit, or building).", - "undocumented": false, - "html": "Address line 2 (e.g., apartment, suite, unit, or building)." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "line2" - }, - "postal_code": { - "name": "postal_code", - "check": "string", - "validation": "string", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "ZIP or postal code.", - "undocumented": false, - "html": "ZIP or postal code." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "postal_code" - }, - "state": { - "name": "state", - "check": "string", - "validation": "string", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "State, county, province, or region.", - "undocumented": false, - "html": "State, county, province, or region." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "state" - } - }, - "object_type": "shipping_address" - } - }, - "object_type": "visa_checkout" - } - }, - "object_type": "wallet" - } - }, - "object_type": "card", - "less_common": true - }, - "card_present": { - "name": "card_present", - "check": "hash", - "validation": "hash", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "If this is a `card_present` PaymentMethod, this hash contains details about the Card Present payment method.", - "undocumented": false, - "html": "If this is a \u003Ccode\u003Ecard_present\u003C/code\u003E PaymentMethod, this hash contains details about the Card Present payment method." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "subspec": { - "brand": { - "name": "brand", - "check": "string", - "validation": "string", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Card brand. Can be `amex`, `diners`, `discover`, `jcb`, `mastercard`, `unionpay`, `visa`, or `unknown`.", - "undocumented": false, - "html": "Card brand. Can be \u003Ccode\u003Eamex\u003C/code\u003E, \u003Ccode\u003Ediners\u003C/code\u003E, \u003Ccode\u003Ediscover\u003C/code\u003E, \u003Ccode\u003Ejcb\u003C/code\u003E, \u003Ccode\u003Emastercard\u003C/code\u003E, \u003Ccode\u003Eunionpay\u003C/code\u003E, \u003Ccode\u003Evisa\u003C/code\u003E, or \u003Ccode\u003Eunknown\u003C/code\u003E." - }, - "gate": true, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "brand" - }, - "cardholder_name": { - "name": "cardholder_name", - "check": "string", - "validation": "string", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "The cardholder name as read from the card, in [ISO 7813](https://en.wikipedia.org/wiki/ISO/IEC_7813) format. May include alphanumeric characters, special characters and first/last name separator (`/`). In some cases, the cardholder name may not be available depending on how the issuer has configured the card. Cardholder name is typically not available on swipe or contactless payments, such as those made with Apple Pay and Google Pay.", - "undocumented": false, - "html": "The cardholder name as read from the card, in \u003Ca href=\"https://en.wikipedia.org/wiki/ISO/IEC_7813\"\u003EISO 7813\u003C/a\u003E format. May include alphanumeric characters, special characters and first/last name separator (\u003Ccode\u003E/\u003C/code\u003E). In some cases, the cardholder name may not be available depending on how the issuer has configured the card. Cardholder name is typically not available on swipe or contactless payments, such as those made with Apple Pay and Google Pay." - }, - "gate": true, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "cardholder_name" - }, - "country": { - "name": "country", - "check": "string", - "validation": "string", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Two-letter ISO code representing the country of the card. You could use this attribute to get a sense of the international breakdown of cards you've collected.", - "undocumented": false, - "html": "Two-letter ISO code representing the country of the card. You could use this attribute to get a sense of the international breakdown of cards you’ve collected." - }, - "gate": true, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "country" - }, - "exp_month": { - "name": "exp_month", - "check": "integer", - "validation": "integer", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Two-digit number representing the card's expiration month.", - "undocumented": false, - "html": "Two-digit number representing the card’s expiration month." - }, - "gate": true, - "hide_unset_desc": null, - "required": true, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "exp_month" - }, - "exp_year": { - "name": "exp_year", - "check": "integer", - "validation": "integer", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Four-digit number representing the card's expiration year.", - "undocumented": false, - "html": "Four-digit number representing the card’s expiration year." - }, - "gate": true, - "hide_unset_desc": null, - "required": true, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "exp_year" - }, - "fingerprint": { - "name": "fingerprint", - "check": "string", - "validation": "string", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Uniquely identifies this particular card number. You can use this attribute to check whether two customers who’ve signed up with you are using the same card number, for example. For payment methods that tokenize card information (Apple Pay, Google Pay), the tokenized number might be provided instead of the underlying card number.\n\n*Starting May 1, 2021, card fingerprint in India for Connect will change to allow two fingerprints for the same card --- one for India and one for the rest of the world.*\n", - "undocumented": false, - "html": "Uniquely identifies this particular card number. You can use this attribute to check whether two customers who’ve signed up with you are using the same card number, for example. For payment methods that tokenize card information (Apple Pay, Google Pay), the tokenized number might be provided instead of the underlying card number.\u003C/p\u003E\n\n\u003Cp\u003E\u003Cem\u003EStarting May 1, 2021, card fingerprint in India for Connect will change to allow two fingerprints for the same card — one for India and one for the rest of the world.\u003C/em\u003E" - }, - "gate": true, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "fingerprint" - }, - "funding": { - "name": "funding", - "check": "string", - "validation": "string", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Card funding type. Can be `credit`, `debit`, `prepaid`, or `unknown`.", - "undocumented": false, - "html": "Card funding type. Can be \u003Ccode\u003Ecredit\u003C/code\u003E, \u003Ccode\u003Edebit\u003C/code\u003E, \u003Ccode\u003Eprepaid\u003C/code\u003E, or \u003Ccode\u003Eunknown\u003C/code\u003E." - }, - "gate": true, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "funding" - }, - "last4": { - "name": "last4", - "check": "string", - "validation": "string", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "The last four digits of the card.", - "undocumented": false, - "html": "The last four digits of the card." - }, - "gate": true, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "last4" - }, - "networks": { - "name": "networks", - "check": "hash", - "validation": "hash", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Contains information about card networks that can be used to process the payment.", - "undocumented": false, - "html": "Contains information about card networks that can be used to process the payment." - }, - "gate": true, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "subspec": { - "available": { - "name": "available", - "check": "string_array", - "validation": "array containing strings", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "All available networks for the card.", - "undocumented": false, - "html": "All available networks for the card." - }, - "gate": false, - "hide_unset_desc": null, - "required": true, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "available" - }, - "preferred": { - "name": "preferred", - "check": "string", - "validation": "string", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "The preferred network for the card.", - "undocumented": false, - "html": "The preferred network for the card." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "preferred" - } - }, - "object_type": "networks" - }, - "read_method": { - "name": "read_method", - "check": "string", - "validation": "string", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "How card details were read in this transaction.", - "undocumented": false, - "html": "How card details were read in this transaction." - }, - "gate": true, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "enum_values": { - "contact_emv": { - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Inserting a chip card into the card reader.", - "undocumented": false, - "html": "Inserting a chip card into the card reader." - } - }, - "contactless_emv": { - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Tapping a contactless-enabled chip card or mobile wallet.", - "undocumented": false, - "html": "Tapping a contactless-enabled chip card or mobile wallet." - } - }, - "magnetic_stripe_track2": { - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Swiping a card using the magnetic stripe reader.", - "undocumented": false, - "html": "Swiping a card using the magnetic stripe reader." - } - }, - "magnetic_stripe_fallback": { - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "When inserting a chip card fails three times in a row, fallback to a magnetic stripe read.", - "undocumented": false, - "html": "When inserting a chip card fails three times in a row, fallback to a magnetic stripe read." - } - }, - "contactless_magstripe_mode": { - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Older standard for contactless payments that emulated a magnetic stripe read.", - "undocumented": false, - "html": "Older standard for contactless payments that emulated a magnetic stripe read." - } - } - }, - "object_type": "read_method" - } - }, - "object_type": "card_present", - "less_common": true - }, - "created": { - "name": "created", - "check": "timestamp", - "validation": "timestamp", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Time at which the object was created. Measured in seconds since the Unix epoch.", - "undocumented": false, - "html": "Time at which the object was created. Measured in seconds since the Unix epoch." - }, - "gate": false, - "hide_unset_desc": null, - "required": true, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "created", - "less_common": true - }, - "customer": { - "name": "customer", - "check": "string", - "validation": "string", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "The ID of the Customer to which this PaymentMethod is saved. This will not be set when the PaymentMethod has not been saved to a Customer.", - "undocumented": false, - "html": "The ID of the Customer to which this PaymentMethod is saved. This will not be set when the PaymentMethod has not been saved to a Customer." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "user_expandable": ["customer"], - "object_type": "customer" - }, - "customer_balance": { - "name": "customer_balance", - "check": "hash", - "validation": "hash", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "If this is a `customer_balance` PaymentMethod, this hash contains details about the CustomerBalance payment method.", - "undocumented": false, - "html": "If this is a \u003Ccode\u003Ecustomer_balance\u003C/code\u003E PaymentMethod, this hash contains details about the CustomerBalance payment method." - }, - "gate": true, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "subspec": {}, - "object_type": "customer_balance", - "less_common": true - }, - "eps": { - "name": "eps", - "check": "hash", - "validation": "hash", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "If this is an `eps` PaymentMethod, this hash contains details about the EPS payment method.", - "undocumented": false, - "html": "If this is an \u003Ccode\u003Eeps\u003C/code\u003E PaymentMethod, this hash contains details about the EPS payment method." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "subspec": { - "bank": { - "name": "bank", - "check": "string", - "validation": "string", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "The customer's bank. Should be one of `arzte_und_apotheker_bank`, `austrian_anadi_bank_ag`, `bank_austria`, `bankhaus_carl_spangler`, `bankhaus_schelhammer_und_schattera_ag`, `bawag_psk_ag`, `bks_bank_ag`, `brull_kallmus_bank_ag`, `btv_vier_lander_bank`, `capital_bank_grawe_gruppe_ag`, `deutsche_bank_ag`, `dolomitenbank`, `easybank_ag`, `erste_bank_und_sparkassen`, `hypo_alpeadriabank_international_ag`, `hypo_noe_lb_fur_niederosterreich_u_wien`, `hypo_oberosterreich_salzburg_steiermark`, `hypo_tirol_bank_ag`, `hypo_vorarlberg_bank_ag`, `hypo_bank_burgenland_aktiengesellschaft`, `marchfelder_bank`, `oberbank_ag`, `raiffeisen_bankengruppe_osterreich`, `schoellerbank_ag`, `sparda_bank_wien`, `volksbank_gruppe`, `volkskreditbank_ag`, or `vr_bank_braunau`.", - "undocumented": false, - "html": "The customer’s bank. Should be one of \u003Ccode\u003Earzte_und_apotheker_bank\u003C/code\u003E, \u003Ccode\u003Eaustrian_anadi_bank_ag\u003C/code\u003E, \u003Ccode\u003Ebank_austria\u003C/code\u003E, \u003Ccode\u003Ebankhaus_carl_spangler\u003C/code\u003E, \u003Ccode\u003Ebankhaus_schelhammer_und_schattera_ag\u003C/code\u003E, \u003Ccode\u003Ebawag_psk_ag\u003C/code\u003E, \u003Ccode\u003Ebks_bank_ag\u003C/code\u003E, \u003Ccode\u003Ebrull_kallmus_bank_ag\u003C/code\u003E, \u003Ccode\u003Ebtv_vier_lander_bank\u003C/code\u003E, \u003Ccode\u003Ecapital_bank_grawe_gruppe_ag\u003C/code\u003E, \u003Ccode\u003Edeutsche_bank_ag\u003C/code\u003E, \u003Ccode\u003Edolomitenbank\u003C/code\u003E, \u003Ccode\u003Eeasybank_ag\u003C/code\u003E, \u003Ccode\u003Eerste_bank_und_sparkassen\u003C/code\u003E, \u003Ccode\u003Ehypo_alpeadriabank_international_ag\u003C/code\u003E, \u003Ccode\u003Ehypo_noe_lb_fur_niederosterreich_u_wien\u003C/code\u003E, \u003Ccode\u003Ehypo_oberosterreich_salzburg_steiermark\u003C/code\u003E, \u003Ccode\u003Ehypo_tirol_bank_ag\u003C/code\u003E, \u003Ccode\u003Ehypo_vorarlberg_bank_ag\u003C/code\u003E, \u003Ccode\u003Ehypo_bank_burgenland_aktiengesellschaft\u003C/code\u003E, \u003Ccode\u003Emarchfelder_bank\u003C/code\u003E, \u003Ccode\u003Eoberbank_ag\u003C/code\u003E, \u003Ccode\u003Eraiffeisen_bankengruppe_osterreich\u003C/code\u003E, \u003Ccode\u003Eschoellerbank_ag\u003C/code\u003E, \u003Ccode\u003Esparda_bank_wien\u003C/code\u003E, \u003Ccode\u003Evolksbank_gruppe\u003C/code\u003E, \u003Ccode\u003Evolkskreditbank_ag\u003C/code\u003E, or \u003Ccode\u003Evr_bank_braunau\u003C/code\u003E." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "bank" - } - }, - "object_type": "eps", - "less_common": true - }, - "fpx": { - "name": "fpx", - "check": "hash", - "validation": "hash", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "If this is an `fpx` PaymentMethod, this hash contains details about the FPX payment method.", - "undocumented": false, - "html": "If this is an \u003Ccode\u003Efpx\u003C/code\u003E PaymentMethod, this hash contains details about the FPX payment method." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "subspec": { - "bank": { - "name": "bank", - "check": "string", - "validation": "string", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "The customer's bank, if provided. Can be one of `affin_bank`, `agrobank`, `alliance_bank`, `ambank`, `bank_islam`, `bank_muamalat`, `bank_rakyat`, `bsn`, `cimb`, `hong_leong_bank`, `hsbc`, `kfh`, `maybank2u`, `ocbc`, `public_bank`, `rhb`, `standard_chartered`, `uob`, `deutsche_bank`, `maybank2e`, `pb_enterprise`, or `bank_of_china`.", - "undocumented": false, - "html": "The customer’s bank, if provided. Can be one of \u003Ccode\u003Eaffin_bank\u003C/code\u003E, \u003Ccode\u003Eagrobank\u003C/code\u003E, \u003Ccode\u003Ealliance_bank\u003C/code\u003E, \u003Ccode\u003Eambank\u003C/code\u003E, \u003Ccode\u003Ebank_islam\u003C/code\u003E, \u003Ccode\u003Ebank_muamalat\u003C/code\u003E, \u003Ccode\u003Ebank_rakyat\u003C/code\u003E, \u003Ccode\u003Ebsn\u003C/code\u003E, \u003Ccode\u003Ecimb\u003C/code\u003E, \u003Ccode\u003Ehong_leong_bank\u003C/code\u003E, \u003Ccode\u003Ehsbc\u003C/code\u003E, \u003Ccode\u003Ekfh\u003C/code\u003E, \u003Ccode\u003Emaybank2u\u003C/code\u003E, \u003Ccode\u003Eocbc\u003C/code\u003E, \u003Ccode\u003Epublic_bank\u003C/code\u003E, \u003Ccode\u003Erhb\u003C/code\u003E, \u003Ccode\u003Estandard_chartered\u003C/code\u003E, \u003Ccode\u003Euob\u003C/code\u003E, \u003Ccode\u003Edeutsche_bank\u003C/code\u003E, \u003Ccode\u003Emaybank2e\u003C/code\u003E, \u003Ccode\u003Epb_enterprise\u003C/code\u003E, or \u003Ccode\u003Ebank_of_china\u003C/code\u003E." - }, - "gate": false, - "hide_unset_desc": null, - "required": true, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "bank" - } - }, - "object_type": "fpx", - "less_common": true - }, - "giropay": { - "name": "giropay", - "check": "hash", - "validation": "hash", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "If this is a `giropay` PaymentMethod, this hash contains details about the Giropay payment method.", - "undocumented": false, - "html": "If this is a \u003Ccode\u003Egiropay\u003C/code\u003E PaymentMethod, this hash contains details about the Giropay payment method." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "subspec": {}, - "object_type": "giropay", - "less_common": true - }, - "grabpay": { - "name": "grabpay", - "check": "hash", - "validation": "hash", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "If this is a `grabpay` PaymentMethod, this hash contains details about the GrabPay payment method.", - "undocumented": false, - "html": "If this is a \u003Ccode\u003Egrabpay\u003C/code\u003E PaymentMethod, this hash contains details about the GrabPay payment method." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "subspec": {}, - "object_type": "grabpay", - "less_common": true - }, - "ideal": { - "name": "ideal", - "check": "hash", - "validation": "hash", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "If this is an `ideal` PaymentMethod, this hash contains details about the iDEAL payment method.", - "undocumented": false, - "html": "If this is an \u003Ccode\u003Eideal\u003C/code\u003E PaymentMethod, this hash contains details about the iDEAL payment method." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "subspec": { - "bank": { - "name": "bank", - "check": "string", - "validation": "string", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "The customer's bank, if provided. Can be one of `abn_amro`, `asn_bank`, `bunq`, `handelsbanken`, `ing`, `knab`, `moneyou`, `rabobank`, `regiobank`, `revolut`, `sns_bank`, `triodos_bank`, or `van_lanschot`.", - "undocumented": false, - "html": "The customer’s bank, if provided. Can be one of \u003Ccode\u003Eabn_amro\u003C/code\u003E, \u003Ccode\u003Easn_bank\u003C/code\u003E, \u003Ccode\u003Ebunq\u003C/code\u003E, \u003Ccode\u003Ehandelsbanken\u003C/code\u003E, \u003Ccode\u003Eing\u003C/code\u003E, \u003Ccode\u003Eknab\u003C/code\u003E, \u003Ccode\u003Emoneyou\u003C/code\u003E, \u003Ccode\u003Erabobank\u003C/code\u003E, \u003Ccode\u003Eregiobank\u003C/code\u003E, \u003Ccode\u003Erevolut\u003C/code\u003E, \u003Ccode\u003Esns_bank\u003C/code\u003E, \u003Ccode\u003Etriodos_bank\u003C/code\u003E, or \u003Ccode\u003Evan_lanschot\u003C/code\u003E." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "bank" - }, - "bic": { - "name": "bic", - "check": "string", - "validation": "string", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "The Bank Identifier Code of the customer's bank, if the bank was provided.", - "undocumented": false, - "html": "The Bank Identifier Code of the customer’s bank, if the bank was provided." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "bic" - } - }, - "object_type": "ideal", - "less_common": true - }, - "interac_present": { - "name": "interac_present", - "check": "hash", - "validation": "hash", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "If this is an `interac_present` PaymentMethod, this hash contains details about the Interac Present payment method.", - "undocumented": false, - "html": "If this is an \u003Ccode\u003Einterac_present\u003C/code\u003E PaymentMethod, this hash contains details about the Interac Present payment method." - }, - "gate": true, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "subspec": { - "brand": { - "name": "brand", - "check": "string", - "validation": "string", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Card brand. Can be `interac`, `mastercard` or `visa`.", - "undocumented": false, - "html": "Card brand. Can be \u003Ccode\u003Einterac\u003C/code\u003E, \u003Ccode\u003Emastercard\u003C/code\u003E or \u003Ccode\u003Evisa\u003C/code\u003E." - }, - "gate": true, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "brand" - }, - "cardholder_name": { - "name": "cardholder_name", - "check": "string", - "validation": "string", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "The cardholder name as read from the card, in [ISO 7813](https://en.wikipedia.org/wiki/ISO/IEC_7813) format. May include alphanumeric characters, special characters and first/last name separator (`/`). In some cases, the cardholder name may not be available depending on how the issuer has configured the card. Cardholder name is typically not available on swipe or contactless payments, such as those made with Apple Pay and Google Pay.", - "undocumented": false, - "html": "The cardholder name as read from the card, in \u003Ca href=\"https://en.wikipedia.org/wiki/ISO/IEC_7813\"\u003EISO 7813\u003C/a\u003E format. May include alphanumeric characters, special characters and first/last name separator (\u003Ccode\u003E/\u003C/code\u003E). In some cases, the cardholder name may not be available depending on how the issuer has configured the card. Cardholder name is typically not available on swipe or contactless payments, such as those made with Apple Pay and Google Pay." - }, - "gate": true, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "cardholder_name" - }, - "country": { - "name": "country", - "check": "string", - "validation": "string", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Two-letter ISO code representing the country of the card. You could use this attribute to get a sense of the international breakdown of cards you've collected.", - "undocumented": false, - "html": "Two-letter ISO code representing the country of the card. You could use this attribute to get a sense of the international breakdown of cards you’ve collected." - }, - "gate": true, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "country" - }, - "exp_month": { - "name": "exp_month", - "check": "integer", - "validation": "integer", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Two-digit number representing the card's expiration month.", - "undocumented": false, - "html": "Two-digit number representing the card’s expiration month." - }, - "gate": true, - "hide_unset_desc": null, - "required": true, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "exp_month" - }, - "exp_year": { - "name": "exp_year", - "check": "integer", - "validation": "integer", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Four-digit number representing the card's expiration year.", - "undocumented": false, - "html": "Four-digit number representing the card’s expiration year." - }, - "gate": true, - "hide_unset_desc": null, - "required": true, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "exp_year" - }, - "fingerprint": { - "name": "fingerprint", - "check": "string", - "validation": "string", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Uniquely identifies this particular card number. You can use this attribute to check whether two customers who’ve signed up with you are using the same card number, for example. For payment methods that tokenize card information (Apple Pay, Google Pay), the tokenized number might be provided instead of the underlying card number.\n\n*Starting May 1, 2021, card fingerprint in India for Connect will change to allow two fingerprints for the same card --- one for India and one for the rest of the world.*\n", - "undocumented": false, - "html": "Uniquely identifies this particular card number. You can use this attribute to check whether two customers who’ve signed up with you are using the same card number, for example. For payment methods that tokenize card information (Apple Pay, Google Pay), the tokenized number might be provided instead of the underlying card number.\u003C/p\u003E\n\n\u003Cp\u003E\u003Cem\u003EStarting May 1, 2021, card fingerprint in India for Connect will change to allow two fingerprints for the same card — one for India and one for the rest of the world.\u003C/em\u003E" - }, - "gate": true, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "fingerprint" - }, - "funding": { - "name": "funding", - "check": "string", - "validation": "string", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Card funding type. Can be `credit`, `debit`, `prepaid`, or `unknown`.", - "undocumented": false, - "html": "Card funding type. Can be \u003Ccode\u003Ecredit\u003C/code\u003E, \u003Ccode\u003Edebit\u003C/code\u003E, \u003Ccode\u003Eprepaid\u003C/code\u003E, or \u003Ccode\u003Eunknown\u003C/code\u003E." - }, - "gate": true, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "funding" - }, - "last4": { - "name": "last4", - "check": "string", - "validation": "string", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "The last four digits of the card.", - "undocumented": false, - "html": "The last four digits of the card." - }, - "gate": true, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "last4" - }, - "networks": { - "name": "networks", - "check": "hash", - "validation": "hash", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Contains information about card networks that can be used to process the payment.", - "undocumented": false, - "html": "Contains information about card networks that can be used to process the payment." - }, - "gate": true, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "subspec": { - "available": { - "name": "available", - "check": "string_array", - "validation": "array containing strings", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "All available networks for the card.", - "undocumented": false, - "html": "All available networks for the card." - }, - "gate": false, - "hide_unset_desc": null, - "required": true, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "available" - }, - "preferred": { - "name": "preferred", - "check": "string", - "validation": "string", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "The preferred network for the card.", - "undocumented": false, - "html": "The preferred network for the card." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "preferred" - } - }, - "object_type": "networks" - }, - "preferred_locales": { - "name": "preferred_locales", - "check": "string_array", - "validation": "array containing strings", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "EMV tag 5F2D. Preferred languages specified by the integrated circuit chip.", - "undocumented": false, - "html": "EMV tag 5F2D. Preferred languages specified by the integrated circuit chip." - }, - "gate": true, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "preferred_locales" - }, - "read_method": { - "name": "read_method", - "check": "string", - "validation": "string", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "How card details were read in this transaction.", - "undocumented": false, - "html": "How card details were read in this transaction." - }, - "gate": true, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "enum_values": { - "contact_emv": { - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Inserting a chip card into the card reader.", - "undocumented": false, - "html": "Inserting a chip card into the card reader." - } - }, - "contactless_emv": { - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Tapping a contactless-enabled chip card or mobile wallet.", - "undocumented": false, - "html": "Tapping a contactless-enabled chip card or mobile wallet." - } - }, - "magnetic_stripe_track2": { - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Swiping a card using the magnetic stripe reader.", - "undocumented": false, - "html": "Swiping a card using the magnetic stripe reader." - } - }, - "magnetic_stripe_fallback": { - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "When inserting a chip card fails three times in a row, fallback to a magnetic stripe read.", - "undocumented": false, - "html": "When inserting a chip card fails three times in a row, fallback to a magnetic stripe read." - } - }, - "contactless_magstripe_mode": { - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Older standard for contactless payments that emulated a magnetic stripe read.", - "undocumented": false, - "html": "Older standard for contactless payments that emulated a magnetic stripe read." - } - } - }, - "object_type": "read_method" - } - }, - "object_type": "interac_present", - "less_common": true - }, - "klarna": { - "name": "klarna", - "check": "hash", - "validation": "hash", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "If this is a `klarna` PaymentMethod, this hash contains details about the Klarna payment method.", - "undocumented": false, - "html": "If this is a \u003Ccode\u003Eklarna\u003C/code\u003E PaymentMethod, this hash contains details about the Klarna payment method." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "subspec": { - "dob": { - "name": "dob", - "check": "hash", - "validation": "hash", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "The customer's date of birth, if provided.", - "undocumented": false, - "html": "The customer’s date of birth, if provided." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": true, - "subspec": { - "day": { - "name": "day", - "check": "positive_integer", - "validation": "positive integer", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "The day of birth, between 1 and 31.", - "undocumented": false, - "html": "The day of birth, between 1 and 31." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "day" - }, - "month": { - "name": "month", - "check": "positive_integer", - "validation": "positive integer", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "The month of birth, between 1 and 12.", - "undocumented": false, - "html": "The month of birth, between 1 and 12." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "month" - }, - "year": { - "name": "year", - "check": "positive_integer", - "validation": "positive integer", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "The four-digit year of birth.", - "undocumented": false, - "html": "The four-digit year of birth." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "year" - } - }, - "object_type": "dob" - } - }, - "object_type": "klarna", - "less_common": true - }, - "konbini": { - "name": "konbini", - "check": "hash", - "validation": "hash", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "If this is a `konbini` PaymentMethod, this hash contains details about the Konbini payment method.", - "undocumented": false, - "html": "If this is a \u003Ccode\u003Ekonbini\u003C/code\u003E PaymentMethod, this hash contains details about the Konbini payment method." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "subspec": {}, - "object_type": "konbini", - "less_common": true - }, - "link": { - "name": "link", - "check": "hash", - "validation": "hash", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "If this is an `Link` PaymentMethod, this hash contains details about the Link payment method.", - "undocumented": false, - "html": "If this is an \u003Ccode\u003ELink\u003C/code\u003E PaymentMethod, this hash contains details about the Link payment method." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "subspec": { - "email": { - "name": "email", - "check": "string", - "validation": "string", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Account owner's email address.", - "undocumented": false, - "html": "Account owner’s email address." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "email" - }, - "persistent_token": { - "name": "persistent_token", - "check": "string", - "validation": "string", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Token used for persistent Link logins.", - "undocumented": false, - "html": "Token used for persistent Link logins." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "persistent_token" - } - }, - "object_type": "link", - "less_common": true - }, - "livemode": { - "name": "livemode", - "check": "boolean", - "validation": "boolean", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode.", - "undocumented": false, - "html": "Has the value \u003Ccode\u003Etrue\u003C/code\u003E if the object exists in live mode or the value \u003Ccode\u003Efalse\u003C/code\u003E if the object exists in test mode." - }, - "gate": false, - "hide_unset_desc": null, - "required": true, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "livemode", - "less_common": true - }, - "metadata": { - "name": "metadata", - "check": "hash", - "validation": "hash", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Set of [key-value pairs](/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format.", - "undocumented": false, - "html": "Set of \u003Ca href=\"/docs/api/metadata\"\u003Ekey-value pairs\u003C/a\u003E that you can attach to an object. This can be useful for storing additional information about the object in a structured format." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "metadata" - }, - "oxxo": { - "name": "oxxo", - "check": "hash", - "validation": "hash", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "If this is an `oxxo` PaymentMethod, this hash contains details about the OXXO payment method.", - "undocumented": false, - "html": "If this is an \u003Ccode\u003Eoxxo\u003C/code\u003E PaymentMethod, this hash contains details about the OXXO payment method." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "subspec": {}, - "object_type": "oxxo", - "less_common": true - }, - "p24": { - "name": "p24", - "check": "hash", - "validation": "hash", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "If this is a `p24` PaymentMethod, this hash contains details about the P24 payment method.", - "undocumented": false, - "html": "If this is a \u003Ccode\u003Ep24\u003C/code\u003E PaymentMethod, this hash contains details about the P24 payment method." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "subspec": { - "bank": { - "name": "bank", - "check": "string", - "validation": "string", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "The customer's bank, if provided.", - "undocumented": false, - "html": "The customer’s bank, if provided." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "enum_values": { - "ing": { "documentation": null }, - "citi_handlowy": { "documentation": null }, - "tmobile_usbugi_bankowe": { "documentation": null }, - "plus_bank": { "documentation": null }, - "etransfer_pocztowy24": { "documentation": null }, - "banki_spbdzielcze": { "documentation": null }, - "bank_nowy_bfg_sa": { "documentation": null }, - "getin_bank": { "documentation": null }, - "blik": { "documentation": null }, - "noble_pay": { "documentation": null }, - "ideabank": { "documentation": null }, - "envelobank": { "documentation": null }, - "santander_przelew24": { "documentation": null }, - "nest_przelew": { "documentation": null }, - "mbank_mtransfer": { "documentation": null }, - "inteligo": { "documentation": null }, - "pbac_z_ipko": { "documentation": null }, - "bnp_paribas": { "documentation": null }, - "credit_agricole": { "documentation": null }, - "toyota_bank": { "documentation": null }, - "bank_pekao_sa": { "documentation": null }, - "volkswagen_bank": { "documentation": null }, - "bank_millennium": { "documentation": null }, - "alior_bank": { "documentation": null }, - "boz": { "documentation": null } - }, - "object_type": "bank" - } - }, - "object_type": "p24", - "less_common": true - }, - "paynow": { - "name": "paynow", - "check": "hash", - "validation": "hash", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "If this is a `paynow` PaymentMethod, this hash contains details about the PayNow payment method.", - "undocumented": false, - "html": "If this is a \u003Ccode\u003Epaynow\u003C/code\u003E PaymentMethod, this hash contains details about the PayNow payment method." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "subspec": {}, - "object_type": "paynow", - "less_common": true - }, - "pix": { - "name": "pix", - "check": "hash", - "validation": "hash", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "If this is a `pix` PaymentMethod, this hash contains details about the Pix payment method.", - "undocumented": false, - "html": "If this is a \u003Ccode\u003Epix\u003C/code\u003E PaymentMethod, this hash contains details about the Pix payment method." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "subspec": {}, - "object_type": "pix", - "less_common": true - }, - "promptpay": { - "name": "promptpay", - "check": "hash", - "validation": "hash", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "If this is a `promptpay` PaymentMethod, this hash contains details about the PromptPay payment method.", - "undocumented": false, - "html": "If this is a \u003Ccode\u003Epromptpay\u003C/code\u003E PaymentMethod, this hash contains details about the PromptPay payment method." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "subspec": {}, - "object_type": "promptpay", - "less_common": true - }, - "radar_options": { - "name": "radar_options", - "check": "hash", - "validation": "hash", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Options to configure Radar. See [Radar Session](/docs/radar/radar-session) for more information.", - "undocumented": false, - "html": "Options to configure Radar. See \u003Ca href=\"/docs/radar/radar-session\"\u003ERadar Session\u003C/a\u003E for more information." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "subspec": { - "session": { - "name": "session", - "check": "string", - "validation": "string", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "A [Radar Session](/docs/radar/radar-session) is a snapshot of the browser metadata and device details that help Radar make more accurate predictions on your payments.", - "undocumented": false, - "html": "A \u003Ca href=\"/docs/radar/radar-session\"\u003ERadar Session\u003C/a\u003E is a snapshot of the browser metadata and device details that help Radar make more accurate predictions on your payments." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "session" - } - }, - "object_type": "radar_options", - "less_common": true - }, - "sepa_debit": { - "name": "sepa_debit", - "check": "hash", - "validation": "hash", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "If this is a `sepa_debit` PaymentMethod, this hash contains details about the SEPA debit bank account.", - "undocumented": false, - "html": "If this is a \u003Ccode\u003Esepa_debit\u003C/code\u003E PaymentMethod, this hash contains details about the SEPA debit bank account." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "subspec": { - "bank_code": { - "name": "bank_code", - "check": "string", - "validation": "string", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Bank code of bank associated with the bank account.", - "undocumented": false, - "html": "Bank code of bank associated with the bank account." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "bank_code" - }, - "branch_code": { - "name": "branch_code", - "check": "string", - "validation": "string", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Branch code of bank associated with the bank account.", - "undocumented": false, - "html": "Branch code of bank associated with the bank account." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "branch_code" - }, - "country": { - "name": "country", - "check": "string", - "validation": "string", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Two-letter ISO code representing the country the bank account is located in.", - "undocumented": false, - "html": "Two-letter ISO code representing the country the bank account is located in." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "country" - }, - "fingerprint": { - "name": "fingerprint", - "check": "string", - "validation": "string", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Uniquely identifies this particular bank account. You can use this attribute to check whether two bank accounts are the same.", - "undocumented": false, - "html": "Uniquely identifies this particular bank account. You can use this attribute to check whether two bank accounts are the same." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "fingerprint" - }, - "generated_from": { - "name": "generated_from", - "check": "hash", - "validation": "hash", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Information about the object that generated this PaymentMethod.", - "undocumented": false, - "html": "Information about the object that generated this PaymentMethod." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "subspec": { - "charge": { - "name": "charge", - "check": "string", - "validation": "string", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "The ID of the Charge that generated this PaymentMethod, if any.", - "undocumented": false, - "html": "The ID of the Charge that generated this PaymentMethod, if any." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "user_expandable": ["charge"], - "object_type": "charge" - }, - "setup_attempt": { - "name": "setup_attempt", - "check": "string", - "validation": "string", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "The ID of the SetupAttempt that generated this PaymentMethod, if any.", - "undocumented": false, - "html": "The ID of the SetupAttempt that generated this PaymentMethod, if any." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "user_expandable": ["setup_attempt"], - "object_type": "setup_attempt" - } - }, - "object_type": "generated_from" - }, - "last4": { - "name": "last4", - "check": "string", - "validation": "string", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Last four characters of the IBAN.", - "undocumented": false, - "html": "Last four characters of the IBAN." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "last4" - } - }, - "object_type": "sepa_debit", - "less_common": true - }, - "sofort": { - "name": "sofort", - "check": "hash", - "validation": "hash", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "If this is a `sofort` PaymentMethod, this hash contains details about the SOFORT payment method.", - "undocumented": false, - "html": "If this is a \u003Ccode\u003Esofort\u003C/code\u003E PaymentMethod, this hash contains details about the SOFORT payment method." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "subspec": { - "country": { - "name": "country", - "check": "string", - "validation": "string", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Two-letter ISO code representing the country the bank account is located in.", - "undocumented": false, - "html": "Two-letter ISO code representing the country the bank account is located in." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "country" - } - }, - "object_type": "sofort", - "less_common": true - }, - "type": { - "name": "type", - "check": "string", - "validation": "string", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "The type of the PaymentMethod. An additional hash is included on the PaymentMethod with a name matching this value. It contains additional information specific to the PaymentMethod type.", - "undocumented": false, - "html": "The type of the PaymentMethod. An additional hash is included on the PaymentMethod with a name matching this value. It contains additional information specific to the PaymentMethod type." - }, - "gate": false, - "hide_unset_desc": null, - "required": true, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "enum_values": { - "acss_debit": { - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "[Pre-authorized debit payments](/docs/payments/acss-debit) are used to debit Canadian bank accounts through the Automated Clearing Settlement System (ACSS).", - "undocumented": false, - "html": "\u003Ca href=\"/docs/payments/acss-debit\"\u003EPre-authorized debit payments\u003C/a\u003E are used to debit Canadian bank accounts through the Automated Clearing Settlement System (ACSS)." - } - }, - "affirm": { - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "[Affirm](/docs/payments/affirm) is a buy now, pay later payment method in the US.", - "undocumented": false, - "html": "\u003Ca href=\"/docs/payments/affirm\"\u003EAffirm\u003C/a\u003E is a buy now, pay later payment method in the US." - } - }, - "afterpay_clearpay": { - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "[Afterpay / Clearpay](/docs/payments/afterpay-clearpay) is a buy now, pay later payment method used in Australia, Canada, France, New Zealand, Spain, the UK, and the US.", - "undocumented": false, - "html": "\u003Ca href=\"/docs/payments/afterpay-clearpay\"\u003EAfterpay / Clearpay\u003C/a\u003E is a buy now, pay later payment method used in Australia, Canada, France, New Zealand, Spain, the UK, and the US." - } - }, - "alipay": { - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "[Alipay](/docs/payments/alipay) is a digital wallet payment method used in China.", - "undocumented": false, - "html": "\u003Ca href=\"/docs/payments/alipay\"\u003EAlipay\u003C/a\u003E is a digital wallet payment method used in China." - } - }, - "au_becs_debit": { - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "[BECS Direct Debit](/docs/payments/au-becs-debit) is used to debit Australian bank accounts through the Bulk Electronic Clearing System (BECS).", - "undocumented": false, - "html": "\u003Ca href=\"/docs/payments/au-becs-debit\"\u003EBECS Direct Debit\u003C/a\u003E is used to debit Australian bank accounts through the Bulk Electronic Clearing System (BECS)." - } - }, - "bacs_debit": { - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "[Bacs Direct Debit](/docs/payments/payment-methods/bacs-debit) is used to debit UK bank accounts.", - "undocumented": false, - "html": "\u003Ca href=\"/docs/payments/payment-methods/bacs-debit\"\u003EBacs Direct Debit\u003C/a\u003E is used to debit UK bank accounts." - } - }, - "bancontact": { - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "[Bancontact](/docs/payments/bancontact) is a bank redirect payment method used in Belgium.", - "undocumented": false, - "html": "\u003Ca href=\"/docs/payments/bancontact\"\u003EBancontact\u003C/a\u003E is a bank redirect payment method used in Belgium." - } - }, - "blik": { - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "[BLIK](/docs/payments/blik) is a single-use payment method common in Poland.", - "undocumented": false, - "html": "\u003Ca href=\"/docs/payments/blik\"\u003EBLIK\u003C/a\u003E is a single-use payment method common in Poland." - } - }, - "boleto": { - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "[Boleto](/docs/payments/boleto) is a voucher-based payment method used in Brazil.", - "undocumented": false, - "html": "\u003Ca href=\"/docs/payments/boleto\"\u003EBoleto\u003C/a\u003E is a voucher-based payment method used in Brazil." - } - }, - "card": { - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "[Card payments](/docs/payments/payment-methods/overview#cards) are supported through many networks and card brands.", - "undocumented": false, - "html": "\u003Ca href=\"/docs/payments/payment-methods/overview#cards\"\u003ECard payments\u003C/a\u003E are supported through many networks and card brands." - } - }, - "card_present": { - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "[Stripe Terminal](/docs/terminal/payments/collect-payment) is used to collect in-person card payments.", - "undocumented": false, - "html": "\u003Ca href=\"/docs/terminal/payments/collect-payment\"\u003EStripe Terminal\u003C/a\u003E is used to collect in-person card payments." - } - }, - "customer_balance": { - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Uses a customer’s [cash balance](/docs/payments/customer-balance) for the payment.", - "undocumented": false, - "html": "Uses a customer’s \u003Ca href=\"/docs/payments/customer-balance\"\u003Ecash balance\u003C/a\u003E for the payment." - } - }, - "eps": { - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "[EPS](/docs/payments/eps) is an Austria-based bank redirect payment method.", - "undocumented": false, - "html": "\u003Ca href=\"/docs/payments/eps\"\u003EEPS\u003C/a\u003E is an Austria-based bank redirect payment method." - } - }, - "fpx": { - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "[FPX](/docs/payments/fpx) is a Malaysia-based bank redirect payment method.", - "undocumented": false, - "html": "\u003Ca href=\"/docs/payments/fpx\"\u003EFPX\u003C/a\u003E is a Malaysia-based bank redirect payment method." - } - }, - "giropay": { - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "[giropay](/docs/payments/giropay) is a German bank redirect payment method.", - "undocumented": false, - "html": "\u003Ca href=\"/docs/payments/giropay\"\u003Egiropay\u003C/a\u003E is a German bank redirect payment method." - } - }, - "grabpay": { - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "[GrabPay](/docs/payments/grabpay) is a digital wallet payment method used in Southeast Asia.", - "undocumented": false, - "html": "\u003Ca href=\"/docs/payments/grabpay\"\u003EGrabPay\u003C/a\u003E is a digital wallet payment method used in Southeast Asia." - } - }, - "ideal": { - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "[iDEAL](/docs/payments/ideal) is a Netherlands-based bank redirect payment method.", - "undocumented": false, - "html": "\u003Ca href=\"/docs/payments/ideal\"\u003EiDEAL\u003C/a\u003E is a Netherlands-based bank redirect payment method." - } - }, - "interac_present": { - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "[Stripe Terminal](/docs/terminal/payments/collect-payment) accepts [Interac](/docs/terminal/payments/regional?integration-country=CA#interac-payments) debit cards for in-person payments in Canada.", - "undocumented": false, - "html": "\u003Ca href=\"/docs/terminal/payments/collect-payment\"\u003EStripe Terminal\u003C/a\u003E accepts \u003Ca href=\"/docs/terminal/payments/regional?integration-country=CA#interac-payments\"\u003EInterac\u003C/a\u003E debit cards for in-person payments in Canada." - } - }, - "klarna": { - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "[Klarna](/docs/payments/klarna) is a global buy now, pay later payment method.", - "undocumented": false, - "html": "\u003Ca href=\"/docs/payments/klarna\"\u003EKlarna\u003C/a\u003E is a global buy now, pay later payment method." - } - }, - "konbini": { - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "[Konbini](/docs/payments/konbini) is a cash-based voucher payment method used in Japan.", - "undocumented": false, - "html": "\u003Ca href=\"/docs/payments/konbini\"\u003EKonbini\u003C/a\u003E is a cash-based voucher payment method used in Japan." - } - }, - "link": { - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "[Link](/docs/payments/link) allows customers to pay with their saved payment details.", - "undocumented": false, - "html": "\u003Ca href=\"/docs/payments/link\"\u003ELink\u003C/a\u003E allows customers to pay with their saved payment details." - } - }, - "oxxo": { - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "[OXXO](/docs/payments/oxxo) is a cash-based voucher payment method used in Mexico.", - "undocumented": false, - "html": "\u003Ca href=\"/docs/payments/oxxo\"\u003EOXXO\u003C/a\u003E is a cash-based voucher payment method used in Mexico." - } - }, - "p24": { - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "[Przelewy24](/docs/payments/p24) is a bank redirect payment method used in Poland.", - "undocumented": false, - "html": "\u003Ca href=\"/docs/payments/p24\"\u003EPrzelewy24\u003C/a\u003E is a bank redirect payment method used in Poland." - } - }, - "paynow": { - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "[PayNow](/docs/payments/paynow) is a QR code payment method used in Singapore.", - "undocumented": false, - "html": "\u003Ca href=\"/docs/payments/paynow\"\u003EPayNow\u003C/a\u003E is a QR code payment method used in Singapore." - } - }, - "pix": { - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "[Pix](/docs/payments/pix) is an instant bank transfer payment method in Brazil.", - "undocumented": false, - "html": "\u003Ca href=\"/docs/payments/pix\"\u003EPix\u003C/a\u003E is an instant bank transfer payment method in Brazil." - } - }, - "promptpay": { - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "[PromptPay](/docs/payments/promptpay) is an instant funds transfer service popular in Thailand.", - "undocumented": false, - "html": "\u003Ca href=\"/docs/payments/promptpay\"\u003EPromptPay\u003C/a\u003E is an instant funds transfer service popular in Thailand." - } - }, - "sepa_debit": { - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "[SEPA Direct Debit](/docs/payments/sepa-debit) is used to debit bank accounts within the Single Euro Payments Area (SEPA) region.", - "undocumented": false, - "html": "\u003Ca href=\"/docs/payments/sepa-debit\"\u003ESEPA Direct Debit\u003C/a\u003E is used to debit bank accounts within the Single Euro Payments Area (SEPA) region." - } - }, - "sofort": { - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "[Sofort](/docs/payments/sofort) is a bank redirect payment method used in Europe.", - "undocumented": false, - "html": "\u003Ca href=\"/docs/payments/sofort\"\u003ESofort\u003C/a\u003E is a bank redirect payment method used in Europe." - } - }, - "us_bank_account": { - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "[ACH Direct Debit](/docs/payments/ach-debit) is used to debit US bank accounts through the Automated Clearing House (ACH) payments system.", - "undocumented": false, - "html": "\u003Ca href=\"/docs/payments/ach-debit\"\u003EACH Direct Debit\u003C/a\u003E is used to debit US bank accounts through the Automated Clearing House (ACH) payments system." - } - }, - "wechat_pay": { - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "[WeChat Pay](/docs/payments/wechat-pay) is a digital wallet payment method based in China.", - "undocumented": false, - "html": "\u003Ca href=\"/docs/payments/wechat-pay\"\u003EWeChat Pay\u003C/a\u003E is a digital wallet payment method based in China." - } - } - }, - "object_type": "type" - }, - "us_bank_account": { - "name": "us_bank_account", - "check": "hash", - "validation": "hash", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "If this is an `us_bank_account` PaymentMethod, this hash contains details about the US bank account payment method.", - "undocumented": false, - "html": "If this is an \u003Ccode\u003Eus_bank_account\u003C/code\u003E PaymentMethod, this hash contains details about the US bank account payment method." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "subspec": { - "account_holder_type": { - "name": "account_holder_type", - "check": "string", - "validation": "string", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Account holder type: individual or company.", - "undocumented": false, - "html": "Account holder type: individual or company." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "enum_values": { - "individual": { - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Account belongs to an individual", - "undocumented": false, - "html": "Account belongs to an individual" - } - }, - "company": { - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Account belongs to a company", - "undocumented": false, - "html": "Account belongs to a company" - } - } - }, - "object_type": "account_holder_type" - }, - "account_type": { - "name": "account_type", - "check": "string", - "validation": "string", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Account type: checkings or savings. Defaults to checking if omitted.", - "undocumented": false, - "html": "Account type: checkings or savings. Defaults to checking if omitted." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "enum_values": { - "checking": { - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Bank account type is checking", - "undocumented": false, - "html": "Bank account type is checking" - } - }, - "savings": { - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Bank account type is savings", - "undocumented": false, - "html": "Bank account type is savings" - } - } - }, - "object_type": "account_type" - }, - "bank_name": { - "name": "bank_name", - "check": "string", - "validation": "string", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "The name of the bank.", - "undocumented": false, - "html": "The name of the bank." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "bank_name" - }, - "financial_connections_account": { - "name": "financial_connections_account", - "check": "string", - "validation": "string", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "The ID of the Financial Connections Account used to create the payment method.", - "undocumented": false, - "html": "The ID of the Financial Connections Account used to create the payment method." - }, - "gate": true, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "financial_connections_account" - }, - "fingerprint": { - "name": "fingerprint", - "check": "string", - "validation": "string", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Uniquely identifies this particular bank account. You can use this attribute to check whether two bank accounts are the same.", - "undocumented": false, - "html": "Uniquely identifies this particular bank account. You can use this attribute to check whether two bank accounts are the same." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "fingerprint" - }, - "last4": { - "name": "last4", - "check": "string", - "validation": "string", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Last four digits of the bank account number.", - "undocumented": false, - "html": "Last four digits of the bank account number." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "last4" - }, - "networks": { - "name": "networks", - "check": "hash", - "validation": "hash", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Contains information about US bank account networks that can be used.", - "undocumented": false, - "html": "Contains information about US bank account networks that can be used." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "subspec": { - "preferred": { - "name": "preferred", - "check": "string", - "validation": "string", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "The preferred network.", - "undocumented": false, - "html": "The preferred network." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "preferred" - }, - "supported": { - "name": "supported", - "check": "array", - "validation": "array", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "All supported networks.", - "undocumented": false, - "html": "All supported networks." - }, - "gate": false, - "hide_unset_desc": null, - "required": true, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "supported" - } - }, - "object_type": "networks" - }, - "routing_number": { - "name": "routing_number", - "check": "string", - "validation": "string", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Routing number of the bank account.", - "undocumented": false, - "html": "Routing number of the bank account." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "routing_number" - } - }, - "object_type": "us_bank_account", - "less_common": true - }, - "wechat_pay": { - "name": "wechat_pay", - "check": "hash", - "validation": "hash", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "If this is an `wechat_pay` PaymentMethod, this hash contains details about the wechat_pay payment method.", - "undocumented": false, - "html": "If this is an \u003Ccode\u003Ewechat_pay\u003C/code\u003E PaymentMethod, this hash contains details about the wechat_pay payment method." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "subspec": {}, - "object_type": "wechat_pay", - "less_common": true - } - }, - "object_type": "payment_method", - "less_common": true - }, - "payment_method_type": { - "name": "payment_method_type", - "check": "string", - "validation": "string", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "If the error is specific to the type of payment method, the payment method type that had a problem. This field is only populated for invoice-related errors.", - "undocumented": false, - "html": "If the error is specific to the type of payment method, the payment method type that had a problem. This field is only populated for invoice-related errors." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "payment_method_type", - "less_common": true - }, - "type": { - "name": "type", - "check": "string", - "validation": "string", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "The type of error returned. One of `api_error`, `card_error`, `idempotency_error`, or `invalid_request_error`", - "undocumented": false, - "html": "The type of error returned. One of \u003Ccode\u003Eapi_error\u003C/code\u003E, \u003Ccode\u003Ecard_error\u003C/code\u003E, \u003Ccode\u003Eidempotency_error\u003C/code\u003E, or \u003Ccode\u003Einvalid_request_error\u003C/code\u003E" - }, - "gate": false, - "hide_unset_desc": null, - "required": true, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "type" - } - }, - "object_type": "last_payment_error" - }, - "latest_charge": { - "name": "latest_charge", - "check": "string", - "validation": "string", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "The latest charge created by this payment intent.", - "undocumented": false, - "html": "The latest charge created by this payment intent." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "user_expandable": ["charge"], - "object_type": "latest_charge" - }, - "livemode": { - "name": "livemode", - "check": "boolean", - "validation": "boolean", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode.", - "undocumented": false, - "html": "Has the value \u003Ccode\u003Etrue\u003C/code\u003E if the object exists in live mode or the value \u003Ccode\u003Efalse\u003C/code\u003E if the object exists in test mode." - }, - "gate": false, - "hide_unset_desc": null, - "required": true, - "default": null, - "badge_text": "retrievable with publishable key", - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "livemode", - "less_common": true - }, - "metadata": { - "name": "metadata", - "check": "hash", - "validation": "hash", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Set of [key-value pairs](/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. For more information, see the [documentation](/docs/payments/payment-intents/creating-payment-intents#storing-information-in-metadata).", - "undocumented": false, - "html": "Set of \u003Ca href=\"/docs/api/metadata\"\u003Ekey-value pairs\u003C/a\u003E that you can attach to an object. This can be useful for storing additional information about the object in a structured format. For more information, see the \u003Ca href=\"/docs/payments/payment-intents/creating-payment-intents#storing-information-in-metadata\"\u003Edocumentation\u003C/a\u003E." - }, - "gate": false, - "hide_unset_desc": null, - "required": true, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "metadata" - }, - "next_action": { - "name": "next_action", - "check": "hash", - "validation": "hash", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "If present, this property tells you what actions you need to take in order for your customer to fulfill a payment using the provided source.", - "undocumented": false, - "html": "If present, this property tells you what actions you need to take in order for your customer to fulfill a payment using the provided source." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": "retrievable with publishable key", - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "subspec": { - "alipay_handle_redirect": { - "name": "alipay_handle_redirect", - "check": "hash", - "validation": "hash", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Contains instructions for authenticating a payment by redirecting your customer to Alipay App or website.", - "undocumented": false, - "html": "Contains instructions for authenticating a payment by redirecting your customer to Alipay App or website." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "subspec": { - "native_data": { - "name": "native_data", - "check": "string", - "validation": "string", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "The native data to be used with Alipay SDK you must redirect your customer to in order to authenticate the payment in an Android App.", - "undocumented": false, - "html": "The native data to be used with Alipay SDK you must redirect your customer to in order to authenticate the payment in an Android App." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "native_data" - }, - "native_url": { - "name": "native_url", - "check": "string", - "validation": "string", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "The native URL you must redirect your customer to in order to authenticate the payment in an iOS App.", - "undocumented": false, - "html": "The native URL you must redirect your customer to in order to authenticate the payment in an iOS App." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "native_url" - }, - "return_url": { - "name": "return_url", - "check": "string", - "validation": "string", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "If the customer does not exit their browser while authenticating, they will be redirected to this specified URL after completion.", - "undocumented": false, - "html": "If the customer does not exit their browser while authenticating, they will be redirected to this specified URL after completion." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "return_url" - }, - "url": { - "name": "url", - "check": "string", - "validation": "string", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "The URL you must redirect your customer to in order to authenticate the payment.", - "undocumented": false, - "html": "The URL you must redirect your customer to in order to authenticate the payment." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "url" - } - }, - "object_type": "alipay_handle_redirect" - }, - "boleto_display_details": { - "name": "boleto_display_details", - "check": "hash", - "validation": "hash", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Contains Boleto details necessary for the customer to complete the payment.", - "undocumented": false, - "html": "Contains Boleto details necessary for the customer to complete the payment." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "subspec": { - "expires_at": { - "name": "expires_at", - "check": "timestamp", - "validation": "timestamp", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "The timestamp after which the boleto expires.", - "undocumented": false, - "html": "The timestamp after which the boleto expires." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "expires_at" - }, - "hosted_voucher_url": { - "name": "hosted_voucher_url", - "check": "string", - "validation": "string", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "The URL to the hosted boleto voucher page, which allows customers to view the boleto voucher.", - "undocumented": false, - "html": "The URL to the hosted boleto voucher page, which allows customers to view the boleto voucher." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "hosted_voucher_url" - }, - "number": { - "name": "number", - "check": "string", - "validation": "string", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "The boleto number.", - "undocumented": false, - "html": "The boleto number." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "number" - }, - "pdf": { - "name": "pdf", - "check": "string", - "validation": "string", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "The URL to the downloadable boleto voucher PDF.", - "undocumented": false, - "html": "The URL to the downloadable boleto voucher PDF." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "pdf" - } - }, - "object_type": "boleto_display_details" - }, - "card_await_notification": { - "name": "card_await_notification", - "check": "hash", - "validation": "hash", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Contains instructions for processing off session recurring payments with Indian issued cards.", - "undocumented": false, - "html": "Contains instructions for processing off session recurring payments with Indian issued cards." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "subspec": { - "charge_attempt_at": { - "name": "charge_attempt_at", - "check": "timestamp", - "validation": "timestamp", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "The time that payment will be attempted. If customer approval is required, they need to provide approval before this time.", - "undocumented": false, - "html": "The time that payment will be attempted. If customer approval is required, they need to provide approval before this time." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "charge_attempt_at" - }, - "customer_approval_required": { - "name": "customer_approval_required", - "check": "boolean", - "validation": "boolean", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "For payments greater than INR 15000, the customer must provide explicit approval of the payment with their bank. For payments of lower amount, no customer action is required.", - "undocumented": false, - "html": "For payments greater than INR 15000, the customer must provide explicit approval of the payment with their bank. For payments of lower amount, no customer action is required." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "customer_approval_required" - } - }, - "object_type": "card_await_notification" - }, - "display_bank_transfer_instructions": { - "name": "display_bank_transfer_instructions", - "check": "hash", - "validation": "hash", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Contains the bank transfer details necessary for the customer to complete the payment.", - "undocumented": false, - "html": "Contains the bank transfer details necessary for the customer to complete the payment." - }, - "gate": true, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "subspec": { - "amount_remaining": { - "name": "amount_remaining", - "check": "integer", - "validation": "integer", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "The remaining amount that needs to be transferred to complete the payment.", - "undocumented": false, - "html": "The remaining amount that needs to be transferred to complete the payment." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "amount_remaining" - }, - "currency": { - "name": "currency", - "check": "currency", - "validation": "currency", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. Must be a [supported currency](https://stripe.com/docs/currencies).", - "undocumented": false, - "html": "Three-letter \u003Ca href=\"https://www.iso.org/iso-4217-currency-codes.html\"\u003EISO currency code\u003C/a\u003E, in lowercase. Must be a \u003Ca href=\"https://stripe.com/docs/currencies\"\u003Esupported currency\u003C/a\u003E." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "currency" - }, - "financial_addresses": { - "name": "financial_addresses", - "check": "array", - "validation": "array", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "A list of financial addresses that can be used to fund the customer balance", - "undocumented": false, - "html": "A list of financial addresses that can be used to fund the customer balance" - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "subspec": { - "iban": { - "name": "iban", - "check": "hash", - "validation": "hash", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "An IBAN-based FinancialAddress", - "undocumented": false, - "html": "An IBAN-based FinancialAddress" - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "subspec": { - "account_holder_name": { - "name": "account_holder_name", - "check": "string", - "validation": "string", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "The name of the person or business that owns the bank account", - "undocumented": false, - "html": "The name of the person or business that owns the bank account" - }, - "gate": false, - "hide_unset_desc": null, - "required": true, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "account_holder_name" - }, - "bic": { - "name": "bic", - "check": "string", - "validation": "string", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "The BIC/SWIFT code of the account.", - "undocumented": false, - "html": "The BIC/SWIFT code of the account." - }, - "gate": false, - "hide_unset_desc": null, - "required": true, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "bic" - }, - "country": { - "name": "country", - "check": "string", - "validation": "string", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)).", - "undocumented": false, - "html": "Two-letter country code (\u003Ca href=\"https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2\"\u003EISO 3166-1 alpha-2\u003C/a\u003E)." - }, - "gate": false, - "hide_unset_desc": null, - "required": true, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "country" - }, - "iban": { - "name": "iban", - "check": "string", - "validation": "string", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "The IBAN of the account.", - "undocumented": false, - "html": "The IBAN of the account." - }, - "gate": false, - "hide_unset_desc": null, - "required": true, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "iban" - } - }, - "object_type": "iban" - }, - "sort_code": { - "name": "sort_code", - "check": "hash", - "validation": "hash", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "An account number and sort code-based FinancialAddress", - "undocumented": false, - "html": "An account number and sort code-based FinancialAddress" - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "subspec": { - "account_holder_name": { - "name": "account_holder_name", - "check": "string", - "validation": "string", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "The name of the person or business that owns the bank account", - "undocumented": false, - "html": "The name of the person or business that owns the bank account" - }, - "gate": false, - "hide_unset_desc": null, - "required": true, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "account_holder_name" - }, - "account_number": { - "name": "account_number", - "check": "string", - "validation": "string", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "The account number", - "undocumented": false, - "html": "The account number" - }, - "gate": false, - "hide_unset_desc": null, - "required": true, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "account_number" - }, - "sort_code": { - "name": "sort_code", - "check": "string", - "validation": "string", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "The six-digit sort code", - "undocumented": false, - "html": "The six-digit sort code" - }, - "gate": false, - "hide_unset_desc": null, - "required": true, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "sort_code" - } - }, - "object_type": "sort_code" - }, - "spei": { - "name": "spei", - "check": "hash", - "validation": "hash", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "A SPEI-based FinancialAddress", - "undocumented": false, - "html": "A SPEI-based FinancialAddress" - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "subspec": { - "bank_code": { - "name": "bank_code", - "check": "string", - "validation": "string", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "The three-digit bank code", - "undocumented": false, - "html": "The three-digit bank code" - }, - "gate": false, - "hide_unset_desc": null, - "required": true, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "bank_code" - }, - "bank_name": { - "name": "bank_name", - "check": "string", - "validation": "string", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "The short banking institution name", - "undocumented": false, - "html": "The short banking institution name" - }, - "gate": false, - "hide_unset_desc": null, - "required": true, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "bank_name" - }, - "clabe": { - "name": "clabe", - "check": "string", - "validation": "string", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "The CLABE number", - "undocumented": false, - "html": "The CLABE number" - }, - "gate": false, - "hide_unset_desc": null, - "required": true, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "clabe" - } - }, - "object_type": "spei" - }, - "supported_networks": { - "name": "supported_networks", - "check": "array", - "validation": "array", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "The payment networks supported by this FinancialAddress", - "undocumented": false, - "html": "The payment networks supported by this FinancialAddress" - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "enum_values": { - "bacs": { "documentation": null }, - "fps": { "documentation": null }, - "sepa": { "documentation": null }, - "spei": { "documentation": null }, - "zengin": { "documentation": null } - }, - "object_type": "supported_networks" - }, - "type": { - "name": "type", - "check": "string", - "validation": "string", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "The type of financial address", - "undocumented": false, - "html": "The type of financial address" - }, - "gate": false, - "hide_unset_desc": null, - "required": true, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "enum_values": { - "iban": { "documentation": null }, - "sort_code": { "documentation": null }, - "spei": { "documentation": null }, - "zengin": { "documentation": null } - }, - "object_type": "type" - }, - "zengin": { - "name": "zengin", - "check": "hash", - "validation": "hash", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "A Zengin-based FinancialAddress", - "undocumented": false, - "html": "A Zengin-based FinancialAddress" - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "subspec": { - "account_holder_name": { - "name": "account_holder_name", - "check": "string", - "validation": "string", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "The account holder name", - "undocumented": false, - "html": "The account holder name" - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "account_holder_name" - }, - "account_number": { - "name": "account_number", - "check": "string", - "validation": "string", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "The account number", - "undocumented": false, - "html": "The account number" - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "account_number" - }, - "account_type": { - "name": "account_type", - "check": "string", - "validation": "string", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "The bank account type. In Japan, this can only be `futsu` or `toza`.", - "undocumented": false, - "html": "The bank account type. In Japan, this can only be \u003Ccode\u003Efutsu\u003C/code\u003E or \u003Ccode\u003Etoza\u003C/code\u003E." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "account_type" - }, - "bank_code": { - "name": "bank_code", - "check": "string", - "validation": "string", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "The bank code of the account", - "undocumented": false, - "html": "The bank code of the account" - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "bank_code" - }, - "bank_name": { - "name": "bank_name", - "check": "string", - "validation": "string", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "The bank name of the account", - "undocumented": false, - "html": "The bank name of the account" - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "bank_name" - }, - "branch_code": { - "name": "branch_code", - "check": "string", - "validation": "string", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "The branch code of the account", - "undocumented": false, - "html": "The branch code of the account" - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "branch_code" - }, - "branch_name": { - "name": "branch_name", - "check": "string", - "validation": "string", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "The branch name of the account", - "undocumented": false, - "html": "The branch name of the account" - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "branch_name" - } - }, - "object_type": "zengin" - } - }, - "object_type": "financial_addresses" - }, - "hosted_instructions_url": { - "name": "hosted_instructions_url", - "check": "string", - "validation": "string", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "A link to a hosted page that guides your customer through completing the transfer.", - "undocumented": false, - "html": "A link to a hosted page that guides your customer through completing the transfer." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "hosted_instructions_url" - }, - "reference": { - "name": "reference", - "check": "string", - "validation": "string", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "A string identifying this payment. Instruct your customer to include this code in the reference or memo field of their bank transfer.", - "undocumented": false, - "html": "A string identifying this payment. Instruct your customer to include this code in the reference or memo field of their bank transfer." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "reference" - }, - "type": { - "name": "type", - "check": "string", - "validation": "string", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Type of bank transfer", - "undocumented": false, - "html": "Type of bank transfer" - }, - "gate": false, - "hide_unset_desc": null, - "required": true, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "enum_values": { - "eu_bank_transfer": { - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "A bank transfer of type eu_bank_transfer", - "undocumented": false, - "html": "A bank transfer of type eu_bank_transfer" - } - }, - "gb_bank_transfer": { - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "A bank transfer of type gb_bank_transfer", - "undocumented": false, - "html": "A bank transfer of type gb_bank_transfer" - } - }, - "jp_bank_transfer": { - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "A bank transfer of type jp_bank_transfer", - "undocumented": false, - "html": "A bank transfer of type jp_bank_transfer" - } - }, - "mx_bank_transfer": { - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "A bank transfer of type mx_bank_transfer", - "undocumented": false, - "html": "A bank transfer of type mx_bank_transfer" - } - } - }, - "object_type": "type" - } - }, - "object_type": "display_bank_transfer_instructions" - }, - "konbini_display_details": { - "name": "konbini_display_details", - "check": "hash", - "validation": "hash", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Contains Konbini details necessary for the customer to complete the payment.", - "undocumented": false, - "html": "Contains Konbini details necessary for the customer to complete the payment." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "subspec": { - "expires_at": { - "name": "expires_at", - "check": "timestamp", - "validation": "timestamp", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "The timestamp at which the pending Konbini payment expires.", - "undocumented": false, - "html": "The timestamp at which the pending Konbini payment expires." - }, - "gate": false, - "hide_unset_desc": null, - "required": true, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "expires_at" - }, - "hosted_voucher_url": { - "name": "hosted_voucher_url", - "check": "string", - "validation": "string", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "The URL for the Konbini payment instructions page, which allows customers to view and print a Konbini voucher.", - "undocumented": false, - "html": "The URL for the Konbini payment instructions page, which allows customers to view and print a Konbini voucher." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "hosted_voucher_url" - }, - "stores": { - "name": "stores", - "check": "hash", - "validation": "hash", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Payment instruction details grouped by convenience store chain.", - "undocumented": false, - "html": "Payment instruction details grouped by convenience store chain." - }, - "gate": false, - "hide_unset_desc": null, - "required": true, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "subspec": { - "familymart": { - "name": "familymart", - "check": "hash", - "validation": "hash", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "FamilyMart instruction details.", - "undocumented": false, - "html": "FamilyMart instruction details." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "subspec": { - "confirmation_number": { - "name": "confirmation_number", - "check": "string", - "validation": "string", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "The confirmation number.", - "undocumented": false, - "html": "The confirmation number." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "confirmation_number" - }, - "payment_code": { - "name": "payment_code", - "check": "string", - "validation": "string", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "The payment code.", - "undocumented": false, - "html": "The payment code." - }, - "gate": false, - "hide_unset_desc": null, - "required": true, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "payment_code" - } - }, - "object_type": "familymart" - }, - "lawson": { - "name": "lawson", - "check": "hash", - "validation": "hash", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Lawson instruction details.", - "undocumented": false, - "html": "Lawson instruction details." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "subspec": { - "confirmation_number": { - "name": "confirmation_number", - "check": "string", - "validation": "string", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "The confirmation number.", - "undocumented": false, - "html": "The confirmation number." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "confirmation_number" - }, - "payment_code": { - "name": "payment_code", - "check": "string", - "validation": "string", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "The payment code.", - "undocumented": false, - "html": "The payment code." - }, - "gate": false, - "hide_unset_desc": null, - "required": true, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "payment_code" - } - }, - "object_type": "lawson" - }, - "ministop": { - "name": "ministop", - "check": "hash", - "validation": "hash", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Ministop instruction details.", - "undocumented": false, - "html": "Ministop instruction details." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "subspec": { - "confirmation_number": { - "name": "confirmation_number", - "check": "string", - "validation": "string", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "The confirmation number.", - "undocumented": false, - "html": "The confirmation number." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "confirmation_number" - }, - "payment_code": { - "name": "payment_code", - "check": "string", - "validation": "string", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "The payment code.", - "undocumented": false, - "html": "The payment code." - }, - "gate": false, - "hide_unset_desc": null, - "required": true, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "payment_code" - } - }, - "object_type": "ministop" - }, - "seicomart": { - "name": "seicomart", - "check": "hash", - "validation": "hash", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Seicomart instruction details.", - "undocumented": false, - "html": "Seicomart instruction details." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "subspec": { - "confirmation_number": { - "name": "confirmation_number", - "check": "string", - "validation": "string", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "The confirmation number.", - "undocumented": false, - "html": "The confirmation number." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "confirmation_number" - }, - "payment_code": { - "name": "payment_code", - "check": "string", - "validation": "string", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "The payment code.", - "undocumented": false, - "html": "The payment code." - }, - "gate": false, - "hide_unset_desc": null, - "required": true, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "payment_code" - } - }, - "object_type": "seicomart" - } - }, - "object_type": "stores" - } - }, - "object_type": "konbini_display_details" - }, - "oxxo_display_details": { - "name": "oxxo_display_details", - "check": "hash", - "validation": "hash", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Contains OXXO details necessary for the customer to complete the payment.", - "undocumented": false, - "html": "Contains OXXO details necessary for the customer to complete the payment." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "subspec": { - "expires_after": { - "name": "expires_after", - "check": "timestamp", - "validation": "timestamp", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "The timestamp after which the OXXO voucher expires.", - "undocumented": false, - "html": "The timestamp after which the OXXO voucher expires." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "expires_after" - }, - "hosted_voucher_url": { - "name": "hosted_voucher_url", - "check": "string", - "validation": "string", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "The URL for the hosted OXXO voucher page, which allows customers to view and print an OXXO voucher.", - "undocumented": false, - "html": "The URL for the hosted OXXO voucher page, which allows customers to view and print an OXXO voucher." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "hosted_voucher_url" - }, - "number": { - "name": "number", - "check": "string", - "validation": "string", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "OXXO reference number.", - "undocumented": false, - "html": "OXXO reference number." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "number" - } - }, - "object_type": "oxxo_display_details" - }, - "paynow_display_qr_code": { - "name": "paynow_display_qr_code", - "check": "hash", - "validation": "hash", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "The field that contains PayNow QR code info", - "undocumented": false, - "html": "The field that contains PayNow QR code info" - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "subspec": { - "data": { - "name": "data", - "check": "string", - "validation": "string", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "The raw data string used to generate QR code, it should be used together with QR code library.", - "undocumented": false, - "html": "The raw data string used to generate QR code, it should be used together with QR code library." - }, - "gate": false, - "hide_unset_desc": null, - "required": true, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "data" - }, - "hosted_instructions_url": { - "name": "hosted_instructions_url", - "check": "string", - "validation": "string", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "The URL to the hosted PayNow instructions page, which allows customers to view the PayNow QR code.", - "undocumented": false, - "html": "The URL to the hosted PayNow instructions page, which allows customers to view the PayNow QR code." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "hosted_instructions_url" - }, - "image_url_png": { - "name": "image_url_png", - "check": "string", - "validation": "string", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "The image_url_png string used to render QR code", - "undocumented": false, - "html": "The image_url_png string used to render QR code" - }, - "gate": false, - "hide_unset_desc": null, - "required": true, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "image_url_png" - }, - "image_url_svg": { - "name": "image_url_svg", - "check": "string", - "validation": "string", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "The image_url_svg string used to render QR code", - "undocumented": false, - "html": "The image_url_svg string used to render QR code" - }, - "gate": false, - "hide_unset_desc": null, - "required": true, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "image_url_svg" - } - }, - "object_type": "paynow_display_qr_code" - }, - "pix_display_qr_code": { - "name": "pix_display_qr_code", - "check": "hash", - "validation": "hash", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "The field that contains Pix QR code info", - "undocumented": false, - "html": "The field that contains Pix QR code info" - }, - "gate": true, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "subspec": { - "data": { - "name": "data", - "check": "string", - "validation": "string", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "The raw data string used to generate QR code, it should be used together with QR code library.", - "undocumented": false, - "html": "The raw data string used to generate QR code, it should be used together with QR code library." - }, - "gate": true, - "hide_unset_desc": null, - "required": true, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "data" - }, - "expires_at": { - "name": "expires_at", - "check": "integer", - "validation": "integer", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "The date (unix timestamp) when the PIX expires.", - "undocumented": false, - "html": "The date (unix timestamp) when the PIX expires." - }, - "gate": true, - "hide_unset_desc": null, - "required": true, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "expires_at" - }, - "hosted_instructions_url": { - "name": "hosted_instructions_url", - "check": "string", - "validation": "string", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "The URL to the hosted pix instructions page, which allows customers to view the pix QR code.", - "undocumented": false, - "html": "The URL to the hosted pix instructions page, which allows customers to view the pix QR code." - }, - "gate": true, - "hide_unset_desc": null, - "required": true, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "hosted_instructions_url" - }, - "image_url_png": { - "name": "image_url_png", - "check": "string", - "validation": "string", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "The image_url_png string used to render png QR code", - "undocumented": false, - "html": "The image_url_png string used to render png QR code" - }, - "gate": true, - "hide_unset_desc": null, - "required": true, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "image_url_png" - }, - "image_url_svg": { - "name": "image_url_svg", - "check": "string", - "validation": "string", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "The image_url_svg string used to render svg QR code", - "undocumented": false, - "html": "The image_url_svg string used to render svg QR code" - }, - "gate": true, - "hide_unset_desc": null, - "required": true, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "image_url_svg" - } - }, - "object_type": "pix_display_qr_code" - }, - "promptpay_display_qr_code": { - "name": "promptpay_display_qr_code", - "check": "hash", - "validation": "hash", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "The field that contains PromptPay QR code info", - "undocumented": false, - "html": "The field that contains PromptPay QR code info" - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "subspec": { - "data": { - "name": "data", - "check": "string", - "validation": "string", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "The raw data string used to generate QR code, it should be used together with QR code library.", - "undocumented": false, - "html": "The raw data string used to generate QR code, it should be used together with QR code library." - }, - "gate": false, - "hide_unset_desc": null, - "required": true, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "data" - }, - "hosted_instructions_url": { - "name": "hosted_instructions_url", - "check": "string", - "validation": "string", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "The URL to the hosted PromptPay instructions page, which allows customers to view the PromptPay QR code.", - "undocumented": false, - "html": "The URL to the hosted PromptPay instructions page, which allows customers to view the PromptPay QR code." - }, - "gate": false, - "hide_unset_desc": null, - "required": true, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "hosted_instructions_url" - }, - "image_url_png": { - "name": "image_url_png", - "check": "string", - "validation": "string", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "The PNG path used to render the QR code, can be used as the source in an HTML img tag", - "undocumented": false, - "html": "The PNG path used to render the QR code, can be used as the source in an HTML img tag" - }, - "gate": false, - "hide_unset_desc": null, - "required": true, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "image_url_png" - }, - "image_url_svg": { - "name": "image_url_svg", - "check": "string", - "validation": "string", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "The SVG path used to render the QR code, can be used as the source in an HTML img tag", - "undocumented": false, - "html": "The SVG path used to render the QR code, can be used as the source in an HTML img tag" - }, - "gate": false, - "hide_unset_desc": null, - "required": true, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "image_url_svg" - } - }, - "object_type": "promptpay_display_qr_code" - }, - "redirect_to_url": { - "name": "redirect_to_url", - "check": "hash", - "validation": "hash", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Contains instructions for authenticating a payment by redirecting your customer to another page or application.", - "undocumented": false, - "html": "Contains instructions for authenticating a payment by redirecting your customer to another page or application." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "subspec": { - "return_url": { - "name": "return_url", - "check": "string", - "validation": "string", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "If the customer does not exit their browser while authenticating, they will be redirected to this specified URL after completion.", - "undocumented": false, - "html": "If the customer does not exit their browser while authenticating, they will be redirected to this specified URL after completion." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "return_url" - }, - "url": { - "name": "url", - "check": "string", - "validation": "string", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "The URL you must redirect your customer to in order to authenticate the payment.", - "undocumented": false, - "html": "The URL you must redirect your customer to in order to authenticate the payment." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "url" - } - }, - "object_type": "redirect_to_url" - }, - "type": { - "name": "type", - "check": "string", - "validation": "string", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Type of the next action to perform, one of `redirect_to_url`, `use_stripe_sdk`, `alipay_handle_redirect`, `oxxo_display_details`, or `verify_with_microdeposits`.", - "undocumented": false, - "html": "Type of the next action to perform, one of \u003Ccode\u003Eredirect_to_url\u003C/code\u003E, \u003Ccode\u003Euse_stripe_sdk\u003C/code\u003E, \u003Ccode\u003Ealipay_handle_redirect\u003C/code\u003E, \u003Ccode\u003Eoxxo_display_details\u003C/code\u003E, or \u003Ccode\u003Everify_with_microdeposits\u003C/code\u003E." - }, - "gate": false, - "hide_unset_desc": null, - "required": true, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "type" - }, - "use_stripe_sdk": { - "name": "use_stripe_sdk", - "check": "hash", - "validation": "hash", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "When confirming a PaymentIntent with Stripe.js, Stripe.js depends on the contents of this \u003Ctranslate\u003Edictionary\u003C/translate\u003E to invoke authentication flows. The shape of the contents is subject to change and is only intended to be used by Stripe.js.", - "undocumented": false, - "html": "When confirming a PaymentIntent with Stripe.js, Stripe.js depends on the contents of this \u003Ctranslate\u003Edictionary\u003C/translate\u003E to invoke authentication flows. The shape of the contents is subject to change and is only intended to be used by Stripe.js." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "use_stripe_sdk" - }, - "verify_with_microdeposits": { - "name": "verify_with_microdeposits", - "check": "hash", - "validation": "hash", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Contains details describing microdeposits verification flow.", - "undocumented": false, - "html": "Contains details describing microdeposits verification flow." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "subspec": { - "arrival_date": { - "name": "arrival_date", - "check": "timestamp", - "validation": "timestamp", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "The timestamp when the microdeposits are expected to land.", - "undocumented": false, - "html": "The timestamp when the microdeposits are expected to land." - }, - "gate": false, - "hide_unset_desc": null, - "required": true, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "arrival_date" - }, - "hosted_verification_url": { - "name": "hosted_verification_url", - "check": "string", - "validation": "string", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "The URL for the hosted verification page, which allows customers to verify their bank account.", - "undocumented": false, - "html": "The URL for the hosted verification page, which allows customers to verify their bank account." - }, - "gate": false, - "hide_unset_desc": null, - "required": true, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "hosted_verification_url" - }, - "microdeposit_type": { - "name": "microdeposit_type", - "check": "string", - "validation": "string", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "The type of the microdeposit sent to the customer. Used to distinguish between different verification methods.", - "undocumented": false, - "html": "The type of the microdeposit sent to the customer. Used to distinguish between different verification methods." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "enum_values": { - "descriptor_code": { "documentation": null }, - "amounts": { "documentation": null } - }, - "object_type": "microdeposit_type" - } - }, - "object_type": "verify_with_microdeposits" - }, - "wechat_pay_display_qr_code": { - "name": "wechat_pay_display_qr_code", - "check": "hash", - "validation": "hash", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "The field that contains WeChat Pay QR code info", - "undocumented": false, - "html": "The field that contains WeChat Pay QR code info" - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "subspec": { - "data": { - "name": "data", - "check": "string", - "validation": "string", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "The data being used to generate QR code", - "undocumented": false, - "html": "The data being used to generate QR code" - }, - "gate": false, - "hide_unset_desc": null, - "required": true, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "data" - }, - "hosted_instructions_url": { - "name": "hosted_instructions_url", - "check": "string", - "validation": "string", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "The URL to the hosted WeChat Pay instructions page, which allows customers to view the WeChat Pay QR code.", - "undocumented": false, - "html": "The URL to the hosted WeChat Pay instructions page, which allows customers to view the WeChat Pay QR code." - }, - "gate": false, - "hide_unset_desc": null, - "required": true, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "hosted_instructions_url" - }, - "image_data_url": { - "name": "image_data_url", - "check": "string", - "validation": "string", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "The base64 image data for a pre-generated QR code", - "undocumented": false, - "html": "The base64 image data for a pre-generated QR code" - }, - "gate": false, - "hide_unset_desc": null, - "required": true, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "image_data_url" - }, - "image_url_png": { - "name": "image_url_png", - "check": "string", - "validation": "string", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "The image_url_png string used to render QR code", - "undocumented": false, - "html": "The image_url_png string used to render QR code" - }, - "gate": false, - "hide_unset_desc": null, - "required": true, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "image_url_png" - }, - "image_url_svg": { - "name": "image_url_svg", - "check": "string", - "validation": "string", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "The image_url_svg string used to render QR code", - "undocumented": false, - "html": "The image_url_svg string used to render QR code" - }, - "gate": false, - "hide_unset_desc": null, - "required": true, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "image_url_svg" - } - }, - "object_type": "wechat_pay_display_qr_code" - }, - "wechat_pay_redirect_to_android_app": { - "name": "wechat_pay_redirect_to_android_app", - "check": "hash", - "validation": "hash", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Info required for android app to app redirect", - "undocumented": false, - "html": "Info required for android app to app redirect" - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "subspec": { - "app_id": { - "name": "app_id", - "check": "string", - "validation": "string", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "app_id is the APP ID registered on WeChat open platform", - "undocumented": false, - "html": "app_id is the APP ID registered on WeChat open platform" - }, - "gate": false, - "hide_unset_desc": null, - "required": true, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "app_id" - }, - "nonce_str": { - "name": "nonce_str", - "check": "string", - "validation": "string", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "nonce_str is a random string", - "undocumented": false, - "html": "nonce_str is a random string" - }, - "gate": false, - "hide_unset_desc": null, - "required": true, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "nonce_str" - }, - "package": { - "name": "package", - "check": "string", - "validation": "string", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "package is static value", - "undocumented": false, - "html": "package is static value" - }, - "gate": false, - "hide_unset_desc": null, - "required": true, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "package" - }, - "partner_id": { - "name": "partner_id", - "check": "string", - "validation": "string", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "an unique merchant ID assigned by WeChat Pay", - "undocumented": false, - "html": "an unique merchant ID assigned by WeChat Pay" - }, - "gate": false, - "hide_unset_desc": null, - "required": true, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "partner_id" - }, - "prepay_id": { - "name": "prepay_id", - "check": "string", - "validation": "string", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "an unique trading ID assigned by WeChat Pay", - "undocumented": false, - "html": "an unique trading ID assigned by WeChat Pay" - }, - "gate": false, - "hide_unset_desc": null, - "required": true, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "prepay_id" - }, - "sign": { - "name": "sign", - "check": "string", - "validation": "string", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "A signature", - "undocumented": false, - "html": "A signature" - }, - "gate": false, - "hide_unset_desc": null, - "required": true, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "sign" - }, - "timestamp": { - "name": "timestamp", - "check": "string", - "validation": "string", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Specifies the current time in epoch format", - "undocumented": false, - "html": "Specifies the current time in epoch format" - }, - "gate": false, - "hide_unset_desc": null, - "required": true, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "timestamp" - } - }, - "object_type": "wechat_pay_redirect_to_android_app" - }, - "wechat_pay_redirect_to_ios_app": { - "name": "wechat_pay_redirect_to_ios_app", - "check": "hash", - "validation": "hash", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Info required for iOS app to app redirect", - "undocumented": false, - "html": "Info required for iOS app to app redirect" - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "subspec": { - "native_url": { - "name": "native_url", - "check": "string", - "validation": "string", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "An universal link that redirect to WeChat Pay app", - "undocumented": false, - "html": "An universal link that redirect to WeChat Pay app" - }, - "gate": false, - "hide_unset_desc": null, - "required": true, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "native_url" - } - }, - "object_type": "wechat_pay_redirect_to_ios_app" - } - }, - "object_type": "next_action" - }, - "on_behalf_of": { - "name": "on_behalf_of", - "check": "string", - "validation": "string", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "The account (if any) for which the funds of the PaymentIntent are intended. See the PaymentIntents [use case for connected accounts](/docs/payments/connected-accounts) for details.", - "undocumented": false, - "html": "The account (if any) for which the funds of the PaymentIntent are intended. See the PaymentIntents \u003Ca href=\"/docs/payments/connected-accounts\"\u003Euse case for connected accounts\u003C/a\u003E for details." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": "Connect only", - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "user_expandable": ["account"], - "object_type": "on_behalf_of", - "less_common": true - }, - "payment_method": { - "name": "payment_method", - "check": "string", - "validation": "string", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "ID of the payment method used in this PaymentIntent.", - "undocumented": false, - "html": "ID of the payment method used in this PaymentIntent." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": "retrievable with publishable key", - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "user_expandable": ["payment_method"], - "object_type": "payment_method" - }, - "payment_method_options": { - "name": "payment_method_options", - "check": "hash", - "validation": "hash", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Payment-method-specific configuration for this PaymentIntent.", - "undocumented": false, - "html": "Payment-method-specific configuration for this PaymentIntent." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "subspec": { - "acss_debit": { - "name": "acss_debit", - "check": "hash", - "validation": "hash", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "If the PaymentIntent's payment_method_types includes `acss_debit`, this hash contains the configurations that will be applied to each payment attempt of that type.\n", - "undocumented": false, - "html": "If the PaymentIntent’s payment_method_types includes \u003Ccode\u003Eacss_debit\u003C/code\u003E, this hash contains the configurations that will be applied to each payment attempt of that type." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "subspec": { - "mandate_options": { - "name": "mandate_options", - "check": "hash", - "validation": "hash", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Additional fields for Mandate creation", - "undocumented": false, - "html": "Additional fields for Mandate creation" - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "subspec": { - "custom_mandate_url": { - "name": "custom_mandate_url", - "check": "string", - "validation": "string", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "A URL for custom mandate text", - "undocumented": false, - "html": "A URL for custom mandate text" - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "custom_mandate_url" - }, - "interval_description": { - "name": "interval_description", - "check": "string", - "validation": "string", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Description of the interval. Only required if the 'payment_schedule' parameter is 'interval' or 'combined'.", - "undocumented": false, - "html": "Description of the interval. Only required if the ‘payment_schedule’ parameter is ‘interval’ or ‘combined’." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "interval_description" - }, - "payment_schedule": { - "name": "payment_schedule", - "check": "string", - "validation": "string", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Payment schedule for the mandate.", - "undocumented": false, - "html": "Payment schedule for the mandate." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "enum_values": { - "interval": { - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Payments are initiated at a regular pre-defined interval", - "undocumented": false, - "html": "Payments are initiated at a regular pre-defined interval" - } - }, - "sporadic": { - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Payments are initiated sporadically", - "undocumented": false, - "html": "Payments are initiated sporadically" - } - }, - "combined": { - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Payments can be initiated at a pre-defined interval or sporadically", - "undocumented": false, - "html": "Payments can be initiated at a pre-defined interval or sporadically" - } - } - }, - "object_type": "payment_schedule" - }, - "transaction_type": { - "name": "transaction_type", - "check": "string", - "validation": "string", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Transaction type of the mandate.", - "undocumented": false, - "html": "Transaction type of the mandate." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "enum_values": { - "personal": { - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Transactions are made for personal reasons", - "undocumented": false, - "html": "Transactions are made for personal reasons" - } - }, - "business": { - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Transactions are made for business reasons", - "undocumented": false, - "html": "Transactions are made for business reasons" - } - } - }, - "object_type": "transaction_type" - } - }, - "object_type": "mandate_options" - }, - "setup_future_usage": { - "name": "setup_future_usage", - "check": "string", - "validation": "string", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Indicates that you intend to make future payments with this PaymentIntent's payment method.\n\nProviding this parameter will [attach the payment method](/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](/docs/api/payment_methods/attach) to a Customer after the transaction completes.\n\nWhen processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](/docs/strong-customer-authentication).\n", - "undocumented": false, - "html": "Indicates that you intend to make future payments with this PaymentIntent’s payment method.\u003C/p\u003E\n\n\u003Cp\u003EProviding this parameter will \u003Ca href=\"/docs/payments/save-during-payment\"\u003Eattach the payment method\u003C/a\u003E to the PaymentIntent’s Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be \u003Ca href=\"/docs/api/payment_methods/attach\"\u003Eattached\u003C/a\u003E to a Customer after the transaction completes.\u003C/p\u003E\n\n\u003Cp\u003EWhen processing card payments, Stripe also uses \u003Ccode\u003Esetup_future_usage\u003C/code\u003E to dynamically optimize your payment flow and comply with regional legislation and network rules, such as \u003Ca href=\"/docs/strong-customer-authentication\"\u003ESCA\u003C/a\u003E." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "enum_values": { - "on_session": { - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Use `on_session` if you intend to only reuse the payment method when your customer is present in your checkout flow.", - "undocumented": false, - "html": "Use \u003Ccode\u003Eon_session\u003C/code\u003E if you intend to only reuse the payment method when your customer is present in your checkout flow." - } - }, - "off_session": { - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Use `off_session` if your customer may or may not be present in your checkout flow.", - "undocumented": false, - "html": "Use \u003Ccode\u003Eoff_session\u003C/code\u003E if your customer may or may not be present in your checkout flow." - } - }, - "none": { - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Use `none` if you do not intend to reuse this payment method and want to override the top-level `setup_future_usage` value for this payment method.", - "undocumented": false, - "html": "Use \u003Ccode\u003Enone\u003C/code\u003E if you do not intend to reuse this payment method and want to override the top-level \u003Ccode\u003Esetup_future_usage\u003C/code\u003E value for this payment method." - } - } - }, - "object_type": "setup_future_usage" - }, - "verification_method": { - "name": "verification_method", - "check": "string", - "validation": "string", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Bank account verification method.", - "undocumented": false, - "html": "Bank account verification method." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "enum_values": { - "automatic": { - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Instant verification with fallback to microdeposits.", - "undocumented": false, - "html": "Instant verification with fallback to microdeposits." - } - }, - "instant": { - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Instant verification.", - "undocumented": false, - "html": "Instant verification." - } - }, - "microdeposits": { - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Verification using microdeposits.", - "undocumented": false, - "html": "Verification using microdeposits." - } - } - }, - "object_type": "verification_method" - } - }, - "object_type": "acss_debit" - }, - "affirm": { - "name": "affirm", - "check": "hash", - "validation": "hash", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "If the PaymentIntent's payment_method_types includes `affirm`, this hash contains the configurations that will be applied to each payment attempt of that type.\n", - "undocumented": false, - "html": "If the PaymentIntent’s payment_method_types includes \u003Ccode\u003Eaffirm\u003C/code\u003E, this hash contains the configurations that will be applied to each payment attempt of that type." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "subspec": { - "capture_method": { - "name": "capture_method", - "check": "string", - "validation": "string", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Controls when the funds will be captured from the customer's account.\n", - "undocumented": false, - "html": "Controls when the funds will be captured from the customer’s account." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "enum_values": { - "manual": { - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Use `manual` if you intend to place the funds on hold and want to override the top-level `capture_method` value for this payment method.", - "undocumented": false, - "html": "Use \u003Ccode\u003Emanual\u003C/code\u003E if you intend to place the funds on hold and want to override the top-level \u003Ccode\u003Ecapture_method\u003C/code\u003E value for this payment method." - } - } - }, - "object_type": "capture_method" - }, - "setup_future_usage": { - "name": "setup_future_usage", - "check": "string", - "validation": "string", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Indicates that you intend to make future payments with this PaymentIntent's payment method.\n\nProviding this parameter will [attach the payment method](/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](/docs/api/payment_methods/attach) to a Customer after the transaction completes.\n\nWhen processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](/docs/strong-customer-authentication).\n", - "undocumented": false, - "html": "Indicates that you intend to make future payments with this PaymentIntent’s payment method.\u003C/p\u003E\n\n\u003Cp\u003EProviding this parameter will \u003Ca href=\"/docs/payments/save-during-payment\"\u003Eattach the payment method\u003C/a\u003E to the PaymentIntent’s Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be \u003Ca href=\"/docs/api/payment_methods/attach\"\u003Eattached\u003C/a\u003E to a Customer after the transaction completes.\u003C/p\u003E\n\n\u003Cp\u003EWhen processing card payments, Stripe also uses \u003Ccode\u003Esetup_future_usage\u003C/code\u003E to dynamically optimize your payment flow and comply with regional legislation and network rules, such as \u003Ca href=\"/docs/strong-customer-authentication\"\u003ESCA\u003C/a\u003E." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "enum_values": { - "none": { - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Use `none` if you do not intend to reuse this payment method and want to override the top-level `setup_future_usage` value for this payment method.", - "undocumented": false, - "html": "Use \u003Ccode\u003Enone\u003C/code\u003E if you do not intend to reuse this payment method and want to override the top-level \u003Ccode\u003Esetup_future_usage\u003C/code\u003E value for this payment method." - } - } - }, - "object_type": "setup_future_usage" - } - }, - "object_type": "affirm" - }, - "afterpay_clearpay": { - "name": "afterpay_clearpay", - "check": "hash", - "validation": "hash", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "If the PaymentIntent's payment_method_types includes `afterpay_clearpay`, this hash contains the configurations that will be applied to each payment attempt of that type.\n", - "undocumented": false, - "html": "If the PaymentIntent’s payment_method_types includes \u003Ccode\u003Eafterpay_clearpay\u003C/code\u003E, this hash contains the configurations that will be applied to each payment attempt of that type." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "subspec": { - "capture_method": { - "name": "capture_method", - "check": "string", - "validation": "string", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Controls when the funds will be captured from the customer's account.\n", - "undocumented": false, - "html": "Controls when the funds will be captured from the customer’s account." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "enum_values": { - "manual": { - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Use `manual` if you intend to place the funds on hold and want to override the top-level `capture_method` value for this payment method.", - "undocumented": false, - "html": "Use \u003Ccode\u003Emanual\u003C/code\u003E if you intend to place the funds on hold and want to override the top-level \u003Ccode\u003Ecapture_method\u003C/code\u003E value for this payment method." - } - } - }, - "object_type": "capture_method" - }, - "reference": { - "name": "reference", - "check": "string", - "validation": "string", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Order identifier shown to the customer in Afterpay’s online portal. We recommend using a value that helps you answer any questions a customer might have about\nthe payment. The identifier is limited to 128 characters and may contain only letters, digits, underscores, backslashes and dashes.\n", - "undocumented": false, - "html": "Order identifier shown to the customer in Afterpay’s online portal. We recommend using a value that helps you answer any questions a customer might have about\nthe payment. The identifier is limited to 128 characters and may contain only letters, digits, underscores, backslashes and dashes." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "reference" - }, - "setup_future_usage": { - "name": "setup_future_usage", - "check": "string", - "validation": "string", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Indicates that you intend to make future payments with this PaymentIntent's payment method.\n\nProviding this parameter will [attach the payment method](/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](/docs/api/payment_methods/attach) to a Customer after the transaction completes.\n\nWhen processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](/docs/strong-customer-authentication).\n", - "undocumented": false, - "html": "Indicates that you intend to make future payments with this PaymentIntent’s payment method.\u003C/p\u003E\n\n\u003Cp\u003EProviding this parameter will \u003Ca href=\"/docs/payments/save-during-payment\"\u003Eattach the payment method\u003C/a\u003E to the PaymentIntent’s Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be \u003Ca href=\"/docs/api/payment_methods/attach\"\u003Eattached\u003C/a\u003E to a Customer after the transaction completes.\u003C/p\u003E\n\n\u003Cp\u003EWhen processing card payments, Stripe also uses \u003Ccode\u003Esetup_future_usage\u003C/code\u003E to dynamically optimize your payment flow and comply with regional legislation and network rules, such as \u003Ca href=\"/docs/strong-customer-authentication\"\u003ESCA\u003C/a\u003E." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "enum_values": { - "none": { - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Use `none` if you do not intend to reuse this payment method and want to override the top-level `setup_future_usage` value for this payment method.", - "undocumented": false, - "html": "Use \u003Ccode\u003Enone\u003C/code\u003E if you do not intend to reuse this payment method and want to override the top-level \u003Ccode\u003Esetup_future_usage\u003C/code\u003E value for this payment method." - } - } - }, - "object_type": "setup_future_usage" - } - }, - "object_type": "afterpay_clearpay" - }, - "alipay": { - "name": "alipay", - "check": "hash", - "validation": "hash", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "If the PaymentIntent's payment_method_types includes `alipay`, this hash contains the configurations that will be applied to each payment attempt of that type.\n", - "undocumented": false, - "html": "If the PaymentIntent’s payment_method_types includes \u003Ccode\u003Ealipay\u003C/code\u003E, this hash contains the configurations that will be applied to each payment attempt of that type." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "subspec": { - "setup_future_usage": { - "name": "setup_future_usage", - "check": "string", - "validation": "string", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Indicates that you intend to make future payments with this PaymentIntent's payment method.\n\nProviding this parameter will [attach the payment method](/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](/docs/api/payment_methods/attach) to a Customer after the transaction completes.\n\nWhen processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](/docs/strong-customer-authentication).\n", - "undocumented": false, - "html": "Indicates that you intend to make future payments with this PaymentIntent’s payment method.\u003C/p\u003E\n\n\u003Cp\u003EProviding this parameter will \u003Ca href=\"/docs/payments/save-during-payment\"\u003Eattach the payment method\u003C/a\u003E to the PaymentIntent’s Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be \u003Ca href=\"/docs/api/payment_methods/attach\"\u003Eattached\u003C/a\u003E to a Customer after the transaction completes.\u003C/p\u003E\n\n\u003Cp\u003EWhen processing card payments, Stripe also uses \u003Ccode\u003Esetup_future_usage\u003C/code\u003E to dynamically optimize your payment flow and comply with regional legislation and network rules, such as \u003Ca href=\"/docs/strong-customer-authentication\"\u003ESCA\u003C/a\u003E." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "enum_values": { - "off_session": { - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Use `off_session` if your customer may or may not be present in your checkout flow.", - "undocumented": false, - "html": "Use \u003Ccode\u003Eoff_session\u003C/code\u003E if your customer may or may not be present in your checkout flow." - } - }, - "none": { - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Use `none` if you do not intend to reuse this payment method and want to override the top-level `setup_future_usage` value for this payment method.", - "undocumented": false, - "html": "Use \u003Ccode\u003Enone\u003C/code\u003E if you do not intend to reuse this payment method and want to override the top-level \u003Ccode\u003Esetup_future_usage\u003C/code\u003E value for this payment method." - } - } - }, - "object_type": "setup_future_usage" - } - }, - "object_type": "alipay" - }, - "au_becs_debit": { - "name": "au_becs_debit", - "check": "hash", - "validation": "hash", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "If the PaymentIntent's payment_method_types includes `au_becs_debit`, this hash contains the configurations that will be applied to each payment attempt of that type.\n", - "undocumented": false, - "html": "If the PaymentIntent’s payment_method_types includes \u003Ccode\u003Eau_becs_debit\u003C/code\u003E, this hash contains the configurations that will be applied to each payment attempt of that type." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "subspec": { - "setup_future_usage": { - "name": "setup_future_usage", - "check": "string", - "validation": "string", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Indicates that you intend to make future payments with this PaymentIntent's payment method.\n\nProviding this parameter will [attach the payment method](/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](/docs/api/payment_methods/attach) to a Customer after the transaction completes.\n\nWhen processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](/docs/strong-customer-authentication).\n", - "undocumented": false, - "html": "Indicates that you intend to make future payments with this PaymentIntent’s payment method.\u003C/p\u003E\n\n\u003Cp\u003EProviding this parameter will \u003Ca href=\"/docs/payments/save-during-payment\"\u003Eattach the payment method\u003C/a\u003E to the PaymentIntent’s Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be \u003Ca href=\"/docs/api/payment_methods/attach\"\u003Eattached\u003C/a\u003E to a Customer after the transaction completes.\u003C/p\u003E\n\n\u003Cp\u003EWhen processing card payments, Stripe also uses \u003Ccode\u003Esetup_future_usage\u003C/code\u003E to dynamically optimize your payment flow and comply with regional legislation and network rules, such as \u003Ca href=\"/docs/strong-customer-authentication\"\u003ESCA\u003C/a\u003E." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "enum_values": { - "on_session": { - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Use `on_session` if you intend to only reuse the payment method when your customer is present in your checkout flow.", - "undocumented": false, - "html": "Use \u003Ccode\u003Eon_session\u003C/code\u003E if you intend to only reuse the payment method when your customer is present in your checkout flow." - } - }, - "off_session": { - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Use `off_session` if your customer may or may not be present in your checkout flow.", - "undocumented": false, - "html": "Use \u003Ccode\u003Eoff_session\u003C/code\u003E if your customer may or may not be present in your checkout flow." - } - }, - "none": { - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Use `none` if you do not intend to reuse this payment method and want to override the top-level `setup_future_usage` value for this payment method.", - "undocumented": false, - "html": "Use \u003Ccode\u003Enone\u003C/code\u003E if you do not intend to reuse this payment method and want to override the top-level \u003Ccode\u003Esetup_future_usage\u003C/code\u003E value for this payment method." - } - } - }, - "object_type": "setup_future_usage" - } - }, - "object_type": "au_becs_debit" - }, - "bacs_debit": { - "name": "bacs_debit", - "check": "hash", - "validation": "hash", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "If the PaymentIntent's payment_method_types includes `bacs_debit`, this hash contains the configurations that will be applied to each payment attempt of that type.\n", - "undocumented": false, - "html": "If the PaymentIntent’s payment_method_types includes \u003Ccode\u003Ebacs_debit\u003C/code\u003E, this hash contains the configurations that will be applied to each payment attempt of that type." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "subspec": { - "setup_future_usage": { - "name": "setup_future_usage", - "check": "string", - "validation": "string", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Indicates that you intend to make future payments with this PaymentIntent's payment method.\n\nProviding this parameter will [attach the payment method](/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](/docs/api/payment_methods/attach) to a Customer after the transaction completes.\n\nWhen processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](/docs/strong-customer-authentication).\n", - "undocumented": false, - "html": "Indicates that you intend to make future payments with this PaymentIntent’s payment method.\u003C/p\u003E\n\n\u003Cp\u003EProviding this parameter will \u003Ca href=\"/docs/payments/save-during-payment\"\u003Eattach the payment method\u003C/a\u003E to the PaymentIntent’s Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be \u003Ca href=\"/docs/api/payment_methods/attach\"\u003Eattached\u003C/a\u003E to a Customer after the transaction completes.\u003C/p\u003E\n\n\u003Cp\u003EWhen processing card payments, Stripe also uses \u003Ccode\u003Esetup_future_usage\u003C/code\u003E to dynamically optimize your payment flow and comply with regional legislation and network rules, such as \u003Ca href=\"/docs/strong-customer-authentication\"\u003ESCA\u003C/a\u003E." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "enum_values": { - "on_session": { - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Use `on_session` if you intend to only reuse the payment method when your customer is present in your checkout flow.", - "undocumented": false, - "html": "Use \u003Ccode\u003Eon_session\u003C/code\u003E if you intend to only reuse the payment method when your customer is present in your checkout flow." - } - }, - "off_session": { - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Use `off_session` if your customer may or may not be present in your checkout flow.", - "undocumented": false, - "html": "Use \u003Ccode\u003Eoff_session\u003C/code\u003E if your customer may or may not be present in your checkout flow." - } - }, - "none": { - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Use `none` if you do not intend to reuse this payment method and want to override the top-level `setup_future_usage` value for this payment method.", - "undocumented": false, - "html": "Use \u003Ccode\u003Enone\u003C/code\u003E if you do not intend to reuse this payment method and want to override the top-level \u003Ccode\u003Esetup_future_usage\u003C/code\u003E value for this payment method." - } - } - }, - "object_type": "setup_future_usage" - } - }, - "object_type": "bacs_debit" - }, - "bancontact": { - "name": "bancontact", - "check": "hash", - "validation": "hash", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "If the PaymentIntent's payment_method_types includes `bancontact`, this hash contains the configurations that will be applied to each payment attempt of that type.\n", - "undocumented": false, - "html": "If the PaymentIntent’s payment_method_types includes \u003Ccode\u003Ebancontact\u003C/code\u003E, this hash contains the configurations that will be applied to each payment attempt of that type." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "subspec": { - "preferred_language": { - "name": "preferred_language", - "check": "string", - "validation": "string", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Preferred language of the Bancontact authorization page that the customer is redirected to.", - "undocumented": false, - "html": "Preferred language of the Bancontact authorization page that the customer is redirected to." - }, - "gate": false, - "hide_unset_desc": null, - "required": true, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "preferred_language" - }, - "setup_future_usage": { - "name": "setup_future_usage", - "check": "string", - "validation": "string", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Indicates that you intend to make future payments with this PaymentIntent's payment method.\n\nProviding this parameter will [attach the payment method](/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](/docs/api/payment_methods/attach) to a Customer after the transaction completes.\n\nWhen processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](/docs/strong-customer-authentication).\n", - "undocumented": false, - "html": "Indicates that you intend to make future payments with this PaymentIntent’s payment method.\u003C/p\u003E\n\n\u003Cp\u003EProviding this parameter will \u003Ca href=\"/docs/payments/save-during-payment\"\u003Eattach the payment method\u003C/a\u003E to the PaymentIntent’s Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be \u003Ca href=\"/docs/api/payment_methods/attach\"\u003Eattached\u003C/a\u003E to a Customer after the transaction completes.\u003C/p\u003E\n\n\u003Cp\u003EWhen processing card payments, Stripe also uses \u003Ccode\u003Esetup_future_usage\u003C/code\u003E to dynamically optimize your payment flow and comply with regional legislation and network rules, such as \u003Ca href=\"/docs/strong-customer-authentication\"\u003ESCA\u003C/a\u003E." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "enum_values": { - "off_session": { - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Use `off_session` if your customer may or may not be present in your checkout flow.", - "undocumented": false, - "html": "Use \u003Ccode\u003Eoff_session\u003C/code\u003E if your customer may or may not be present in your checkout flow." - } - }, - "none": { - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Use `none` if you do not intend to reuse this payment method and want to override the top-level `setup_future_usage` value for this payment method.", - "undocumented": false, - "html": "Use \u003Ccode\u003Enone\u003C/code\u003E if you do not intend to reuse this payment method and want to override the top-level \u003Ccode\u003Esetup_future_usage\u003C/code\u003E value for this payment method." - } - } - }, - "object_type": "setup_future_usage" - } - }, - "object_type": "bancontact" - }, - "blik": { - "name": "blik", - "check": "hash", - "validation": "hash", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "If the PaymentIntent's payment_method_types includes `blik`, this hash contains the configurations that will be applied to each payment attempt of that type.\n", - "undocumented": false, - "html": "If the PaymentIntent’s payment_method_types includes \u003Ccode\u003Eblik\u003C/code\u003E, this hash contains the configurations that will be applied to each payment attempt of that type." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "subspec": {}, - "object_type": "blik" - }, - "boleto": { - "name": "boleto", - "check": "hash", - "validation": "hash", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "If the PaymentIntent's payment_method_types includes `boleto`, this hash contains the configurations that will be applied to each payment attempt of that type.\n", - "undocumented": false, - "html": "If the PaymentIntent’s payment_method_types includes \u003Ccode\u003Eboleto\u003C/code\u003E, this hash contains the configurations that will be applied to each payment attempt of that type." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "subspec": { - "expires_after_days": { - "name": "expires_after_days", - "check": "integer", - "validation": "integer", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "The number of calendar days before a Boleto voucher expires. For example, if you create a Boleto voucher on Monday and you set expires_after_days to 2, the Boleto voucher will expire on Wednesday at 23:59 America/Sao_Paulo time.", - "undocumented": false, - "html": "The number of calendar days before a Boleto voucher expires. For example, if you create a Boleto voucher on Monday and you set expires_after_days to 2, the Boleto voucher will expire on Wednesday at 23:59 America/Sao_Paulo time." - }, - "gate": false, - "hide_unset_desc": null, - "required": true, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "expires_after_days" - }, - "setup_future_usage": { - "name": "setup_future_usage", - "check": "string", - "validation": "string", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Indicates that you intend to make future payments with this PaymentIntent's payment method.\n\nProviding this parameter will [attach the payment method](/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](/docs/api/payment_methods/attach) to a Customer after the transaction completes.\n\nWhen processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](/docs/strong-customer-authentication).\n", - "undocumented": false, - "html": "Indicates that you intend to make future payments with this PaymentIntent’s payment method.\u003C/p\u003E\n\n\u003Cp\u003EProviding this parameter will \u003Ca href=\"/docs/payments/save-during-payment\"\u003Eattach the payment method\u003C/a\u003E to the PaymentIntent’s Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be \u003Ca href=\"/docs/api/payment_methods/attach\"\u003Eattached\u003C/a\u003E to a Customer after the transaction completes.\u003C/p\u003E\n\n\u003Cp\u003EWhen processing card payments, Stripe also uses \u003Ccode\u003Esetup_future_usage\u003C/code\u003E to dynamically optimize your payment flow and comply with regional legislation and network rules, such as \u003Ca href=\"/docs/strong-customer-authentication\"\u003ESCA\u003C/a\u003E." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "enum_values": { - "on_session": { - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Use `on_session` if you intend to only reuse the payment method when your customer is present in your checkout flow.", - "undocumented": false, - "html": "Use \u003Ccode\u003Eon_session\u003C/code\u003E if you intend to only reuse the payment method when your customer is present in your checkout flow." - } - }, - "off_session": { - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Use `off_session` if your customer may or may not be present in your checkout flow.", - "undocumented": false, - "html": "Use \u003Ccode\u003Eoff_session\u003C/code\u003E if your customer may or may not be present in your checkout flow." - } - }, - "none": { - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Use `none` if you do not intend to reuse this payment method and want to override the top-level `setup_future_usage` value for this payment method.", - "undocumented": false, - "html": "Use \u003Ccode\u003Enone\u003C/code\u003E if you do not intend to reuse this payment method and want to override the top-level \u003Ccode\u003Esetup_future_usage\u003C/code\u003E value for this payment method." - } - } - }, - "object_type": "setup_future_usage" - } - }, - "object_type": "boleto" - }, - "card": { - "name": "card", - "check": "hash", - "validation": "hash", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "If the PaymentIntent's payment_method_types includes `card`, this hash contains the configurations that will be applied to each payment attempt of that type.\n", - "undocumented": false, - "html": "If the PaymentIntent’s payment_method_types includes \u003Ccode\u003Ecard\u003C/code\u003E, this hash contains the configurations that will be applied to each payment attempt of that type." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "subspec": { - "capture_method": { - "name": "capture_method", - "check": "string", - "validation": "string", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Controls when the funds will be captured from the customer's account.\n", - "undocumented": false, - "html": "Controls when the funds will be captured from the customer’s account." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "enum_values": { - "manual": { - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Use `manual` if you intend to place the funds on hold and want to override the top-level `capture_method` value for this payment method.", - "undocumented": false, - "html": "Use \u003Ccode\u003Emanual\u003C/code\u003E if you intend to place the funds on hold and want to override the top-level \u003Ccode\u003Ecapture_method\u003C/code\u003E value for this payment method." - } - } - }, - "object_type": "capture_method" - }, - "installments": { - "name": "installments", - "check": "hash", - "validation": "hash", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Installment details for this payment (Mexico only).\n\nFor more information, see the [installments integration guide](/docs/payments/installments).\n", - "undocumented": false, - "html": "Installment details for this payment (Mexico only).\u003C/p\u003E\n\n\u003Cp\u003EFor more information, see the \u003Ca href=\"/docs/payments/installments\"\u003Einstallments integration guide\u003C/a\u003E." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "subspec": { - "available_plans": { - "name": "available_plans", - "check": "array", - "validation": "array", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Installment plans that may be selected for this PaymentIntent.", - "undocumented": false, - "html": "Installment plans that may be selected for this PaymentIntent." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "subspec": { - "count": { - "name": "count", - "check": "integer", - "validation": "integer", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "For `fixed_count` installment plans, this is the number of installment payments your customer will make to their credit card.", - "undocumented": false, - "html": "For \u003Ccode\u003Efixed_count\u003C/code\u003E installment plans, this is the number of installment payments your customer will make to their credit card." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "count" - }, - "interval": { - "name": "interval", - "check": "string", - "validation": "string", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "For `fixed_count` installment plans, this is the interval between installment payments your customer will make to their credit card.\nOne of `month`.\n", - "undocumented": false, - "html": "For \u003Ccode\u003Efixed_count\u003C/code\u003E installment plans, this is the interval between installment payments your customer will make to their credit card.\nOne of \u003Ccode\u003Emonth\u003C/code\u003E." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "interval" - }, - "type": { - "name": "type", - "check": "string", - "validation": "string", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Type of installment plan, one of `fixed_count`.", - "undocumented": false, - "html": "Type of installment plan, one of \u003Ccode\u003Efixed_count\u003C/code\u003E." - }, - "gate": false, - "hide_unset_desc": null, - "required": true, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "type" - } - }, - "object_type": "available_plans" - }, - "enabled": { - "name": "enabled", - "check": "boolean", - "validation": "boolean", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Whether Installments are enabled for this PaymentIntent.", - "undocumented": false, - "html": "Whether Installments are enabled for this PaymentIntent." - }, - "gate": false, - "hide_unset_desc": null, - "required": true, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "enabled" - }, - "plan": { - "name": "plan", - "check": "hash", - "validation": "hash", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Installment plan selected for this PaymentIntent.", - "undocumented": false, - "html": "Installment plan selected for this PaymentIntent." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "subspec": { - "count": { - "name": "count", - "check": "integer", - "validation": "integer", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "For `fixed_count` installment plans, this is the number of installment payments your customer will make to their credit card.", - "undocumented": false, - "html": "For \u003Ccode\u003Efixed_count\u003C/code\u003E installment plans, this is the number of installment payments your customer will make to their credit card." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "count" - }, - "interval": { - "name": "interval", - "check": "string", - "validation": "string", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "For `fixed_count` installment plans, this is the interval between installment payments your customer will make to their credit card.\nOne of `month`.\n", - "undocumented": false, - "html": "For \u003Ccode\u003Efixed_count\u003C/code\u003E installment plans, this is the interval between installment payments your customer will make to their credit card.\nOne of \u003Ccode\u003Emonth\u003C/code\u003E." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "interval" - }, - "type": { - "name": "type", - "check": "string", - "validation": "string", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Type of installment plan, one of `fixed_count`.", - "undocumented": false, - "html": "Type of installment plan, one of \u003Ccode\u003Efixed_count\u003C/code\u003E." - }, - "gate": false, - "hide_unset_desc": null, - "required": true, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "type" - } - }, - "object_type": "plan" - } - }, - "object_type": "installments" - }, - "mandate_options": { - "name": "mandate_options", - "check": "hash", - "validation": "hash", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Configuration options for setting up an eMandate for cards issued in India.", - "undocumented": false, - "html": "Configuration options for setting up an eMandate for cards issued in India." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "subspec": { - "amount": { - "name": "amount", - "check": "positive_integer", - "validation": "positive integer", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Amount to be charged for future payments.", - "undocumented": false, - "html": "Amount to be charged for future payments." - }, - "gate": false, - "hide_unset_desc": null, - "required": true, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "amount" - }, - "amount_type": { - "name": "amount_type", - "check": "string", - "validation": "string", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "One of `fixed` or `maximum`. If `fixed`, the `amount` param refers to the exact amount to be charged in future payments. If `maximum`, the amount charged can be up to the value passed for the `amount` param.\n", - "undocumented": false, - "html": "One of \u003Ccode\u003Efixed\u003C/code\u003E or \u003Ccode\u003Emaximum\u003C/code\u003E. If \u003Ccode\u003Efixed\u003C/code\u003E, the \u003Ccode\u003Eamount\u003C/code\u003E param refers to the exact amount to be charged in future payments. If \u003Ccode\u003Emaximum\u003C/code\u003E, the amount charged can be up to the value passed for the \u003Ccode\u003Eamount\u003C/code\u003E param." - }, - "gate": false, - "hide_unset_desc": null, - "required": true, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "amount_type" - }, - "description": { - "name": "description", - "check": "string", - "validation": "string", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "A description of the mandate or subscription that is meant to be displayed to the customer.", - "undocumented": false, - "html": "A description of the mandate or subscription that is meant to be displayed to the customer." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "description" - }, - "end_date": { - "name": "end_date", - "check": "timestamp", - "validation": "timestamp", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "End date of the mandate or subscription. If not provided, the mandate will be active until canceled. If provided, end date should be after start date.\n", - "undocumented": false, - "html": "End date of the mandate or subscription. If not provided, the mandate will be active until canceled. If provided, end date should be after start date." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "end_date" - }, - "interval": { - "name": "interval", - "check": "string", - "validation": "string", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Specifies payment frequency. One of `day`, `week`, `month`, `year`, or `sporadic`.\n", - "undocumented": false, - "html": "Specifies payment frequency. One of \u003Ccode\u003Eday\u003C/code\u003E, \u003Ccode\u003Eweek\u003C/code\u003E, \u003Ccode\u003Emonth\u003C/code\u003E, \u003Ccode\u003Eyear\u003C/code\u003E, or \u003Ccode\u003Esporadic\u003C/code\u003E." - }, - "gate": false, - "hide_unset_desc": null, - "required": true, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "interval" - }, - "interval_count": { - "name": "interval_count", - "check": "positive_integer", - "validation": "positive integer", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "The number of intervals between payments. For example, `interval=month` and `interval_count=3` indicates one payment every three months. Maximum of one year interval allowed (1 year, 12 months, or 52 weeks). This parameter is optional when `interval=sporadic`.\n", - "undocumented": false, - "html": "The number of intervals between payments. For example, \u003Ccode\u003Einterval=month\u003C/code\u003E and \u003Ccode\u003Einterval_count=3\u003C/code\u003E indicates one payment every three months. Maximum of one year interval allowed (1 year, 12 months, or 52 weeks). This parameter is optional when \u003Ccode\u003Einterval=sporadic\u003C/code\u003E." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "interval_count" - }, - "reference": { - "name": "reference", - "check": "string", - "validation": "string", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Unique identifier for the mandate or subscription.", - "undocumented": false, - "html": "Unique identifier for the mandate or subscription." - }, - "gate": false, - "hide_unset_desc": null, - "required": true, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "reference" - }, - "start_date": { - "name": "start_date", - "check": "timestamp", - "validation": "timestamp", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Start date of the mandate or subscription. Start date should not be lesser than yesterday.\n", - "undocumented": false, - "html": "Start date of the mandate or subscription. Start date should not be lesser than yesterday." - }, - "gate": false, - "hide_unset_desc": null, - "required": true, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "start_date" - }, - "supported_types": { - "name": "supported_types", - "check": "array", - "validation": "array", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Specifies the type of mandates supported. Possible values are `india`.\n", - "undocumented": false, - "html": "Specifies the type of mandates supported. Possible values are \u003Ccode\u003Eindia\u003C/code\u003E." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "supported_types" - } - }, - "object_type": "mandate_options" - }, - "network": { - "name": "network", - "check": "string", - "validation": "string", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Selected network to process this payment intent on. Depends on the available networks of the card attached to the payment intent. Can be only set confirm-time.", - "undocumented": false, - "html": "Selected network to process this payment intent on. Depends on the available networks of the card attached to the payment intent. Can be only set confirm-time." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "network" - }, - "request_three_d_secure": { - "name": "request_three_d_secure", - "check": "string", - "validation": "string", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "We strongly recommend that you rely on our SCA Engine to automatically prompt your customers for authentication based on risk level and [other requirements](/docs/strong-customer-authentication). However, if you wish to request 3D Secure based on logic from your own fraud engine, provide this option. Permitted values include: `automatic` or `any`. If not provided, defaults to `automatic`. Read our guide on [manually requesting 3D Secure](/docs/payments/3d-secure#manual-three-ds) for more information on how this configuration interacts with Radar and our SCA Engine.", - "undocumented": false, - "html": "We strongly recommend that you rely on our SCA Engine to automatically prompt your customers for authentication based on risk level and \u003Ca href=\"/docs/strong-customer-authentication\"\u003Eother requirements\u003C/a\u003E. However, if you wish to request 3D Secure based on logic from your own fraud engine, provide this option. Permitted values include: \u003Ccode\u003Eautomatic\u003C/code\u003E or \u003Ccode\u003Eany\u003C/code\u003E. If not provided, defaults to \u003Ccode\u003Eautomatic\u003C/code\u003E. Read our guide on \u003Ca href=\"/docs/payments/3d-secure#manual-three-ds\"\u003Emanually requesting 3D Secure\u003C/a\u003E for more information on how this configuration interacts with Radar and our SCA Engine." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": "advanced", - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "request_three_d_secure" - }, - "setup_future_usage": { - "name": "setup_future_usage", - "check": "string", - "validation": "string", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Indicates that you intend to make future payments with this PaymentIntent's payment method.\n\nProviding this parameter will [attach the payment method](/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](/docs/api/payment_methods/attach) to a Customer after the transaction completes.\n\nWhen processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](/docs/strong-customer-authentication).\n", - "undocumented": false, - "html": "Indicates that you intend to make future payments with this PaymentIntent’s payment method.\u003C/p\u003E\n\n\u003Cp\u003EProviding this parameter will \u003Ca href=\"/docs/payments/save-during-payment\"\u003Eattach the payment method\u003C/a\u003E to the PaymentIntent’s Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be \u003Ca href=\"/docs/api/payment_methods/attach\"\u003Eattached\u003C/a\u003E to a Customer after the transaction completes.\u003C/p\u003E\n\n\u003Cp\u003EWhen processing card payments, Stripe also uses \u003Ccode\u003Esetup_future_usage\u003C/code\u003E to dynamically optimize your payment flow and comply with regional legislation and network rules, such as \u003Ca href=\"/docs/strong-customer-authentication\"\u003ESCA\u003C/a\u003E." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "enum_values": { - "on_session": { - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Use `on_session` if you intend to only reuse the payment method when your customer is present in your checkout flow.", - "undocumented": false, - "html": "Use \u003Ccode\u003Eon_session\u003C/code\u003E if you intend to only reuse the payment method when your customer is present in your checkout flow." - } - }, - "off_session": { - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Use `off_session` if your customer may or may not be present in your checkout flow.", - "undocumented": false, - "html": "Use \u003Ccode\u003Eoff_session\u003C/code\u003E if your customer may or may not be present in your checkout flow." - } - }, - "none": { - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Use `none` if you do not intend to reuse this payment method and want to override the top-level `setup_future_usage` value for this payment method.", - "undocumented": false, - "html": "Use \u003Ccode\u003Enone\u003C/code\u003E if you do not intend to reuse this payment method and want to override the top-level \u003Ccode\u003Esetup_future_usage\u003C/code\u003E value for this payment method." - } - } - }, - "object_type": "setup_future_usage" - }, - "statement_descriptor_suffix_kana": { - "name": "statement_descriptor_suffix_kana", - "check": "string", - "validation": "string", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Provides information about a card payment that customers see on their statements. Concatenated with the Kana prefix (shortened Kana descriptor) or Kana statement descriptor that’s set on the account to form the complete statement descriptor. Maximum 22 characters. On card statements, the *concatenation* of both prefix and suffix (including separators) will appear truncated to 22 characters.", - "undocumented": false, - "html": "Provides information about a card payment that customers see on their statements. Concatenated with the Kana prefix (shortened Kana descriptor) or Kana statement descriptor that’s set on the account to form the complete statement descriptor. Maximum 22 characters. On card statements, the \u003Cem\u003Econcatenation\u003C/em\u003E of both prefix and suffix (including separators) will appear truncated to 22 characters." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "statement_descriptor_suffix_kana" - }, - "statement_descriptor_suffix_kanji": { - "name": "statement_descriptor_suffix_kanji", - "check": "string", - "validation": "string", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Provides information about a card payment that customers see on their statements. Concatenated with the Kanji prefix (shortened Kanji descriptor) or Kanji statement descriptor that’s set on the account to form the complete statement descriptor. Maximum 17 characters. On card statements, the *concatenation* of both prefix and suffix (including separators) will appear truncated to 17 characters.", - "undocumented": false, - "html": "Provides information about a card payment that customers see on their statements. Concatenated with the Kanji prefix (shortened Kanji descriptor) or Kanji statement descriptor that’s set on the account to form the complete statement descriptor. Maximum 17 characters. On card statements, the \u003Cem\u003Econcatenation\u003C/em\u003E of both prefix and suffix (including separators) will appear truncated to 17 characters." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "statement_descriptor_suffix_kanji" - } - }, - "object_type": "card" - }, - "card_present": { - "name": "card_present", - "check": "hash", - "validation": "hash", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "If the PaymentIntent's payment_method_types includes `card_present`, this hash contains the configurations that will be applied to each payment attempt of that type.\n", - "undocumented": false, - "html": "If the PaymentIntent’s payment_method_types includes \u003Ccode\u003Ecard_present\u003C/code\u003E, this hash contains the configurations that will be applied to each payment attempt of that type." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "subspec": { - "capture_method": { - "name": "capture_method", - "check": "string", - "validation": "string", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Controls when the funds will be captured from the customer's account.\n", - "undocumented": false, - "html": "Controls when the funds will be captured from the customer’s account." - }, - "gate": true, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "enum_values": { - "manual_preferred": { - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Use `manual_preferred` if you prefer `manual` capture_method but support falling back to `automatic` based on the presented payment method.", - "undocumented": false, - "html": "Use \u003Ccode\u003Emanual_preferred\u003C/code\u003E if you prefer \u003Ccode\u003Emanual\u003C/code\u003E capture_method but support falling back to \u003Ccode\u003Eautomatic\u003C/code\u003E based on the presented payment method." - } - } - }, - "object_type": "capture_method" - }, - "request_extended_authorization": { - "name": "request_extended_authorization", - "check": "boolean", - "validation": "boolean", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Request ability to capture this payment beyond the standard [authorization validity window](/docs/terminal/features/extended-authorizations#authorization-validity)", - "undocumented": false, - "html": "Request ability to capture this payment beyond the standard \u003Ca href=\"/docs/terminal/features/extended-authorizations#authorization-validity\"\u003Eauthorization validity window\u003C/a\u003E" - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "request_extended_authorization" - }, - "request_incremental_authorization_support": { - "name": "request_incremental_authorization_support", - "check": "boolean", - "validation": "boolean", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Request ability to [increment](/docs/terminal/features/incremental-authorizations) this PaymentIntent if the combination of MCC and card brand is eligible. Check [incremental_authorization_supported](/docs/api/charges/object#charge_object-payment_method_details-card_present-incremental_authorization_supported) in the [Confirm](/docs/api/payment_intents/confirm) response to verify support.", - "undocumented": false, - "html": "Request ability to \u003Ca href=\"/docs/terminal/features/incremental-authorizations\"\u003Eincrement\u003C/a\u003E this PaymentIntent if the combination of MCC and card brand is eligible. Check \u003Ca href=\"/docs/api/charges/object#charge_object-payment_method_details-card_present-incremental_authorization_supported\"\u003Eincremental_authorization_supported\u003C/a\u003E in the \u003Ca href=\"/docs/api/payment_intents/confirm\"\u003EConfirm\u003C/a\u003E response to verify support." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "request_incremental_authorization_support" - } - }, - "object_type": "card_present" - }, - "customer_balance": { - "name": "customer_balance", - "check": "hash", - "validation": "hash", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "If the PaymentIntent's payment_method_types includes `customer_balance`, this hash contains the configurations that will be applied to each payment attempt of that type.\n", - "undocumented": false, - "html": "If the PaymentIntent’s payment_method_types includes \u003Ccode\u003Ecustomer_balance\u003C/code\u003E, this hash contains the configurations that will be applied to each payment attempt of that type." - }, - "gate": true, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "subspec": { - "bank_transfer": { - "name": "bank_transfer", - "check": "hash", - "validation": "hash", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Configuration for the bank transfer funding type, if the `funding_type` is set to `bank_transfer`.\n", - "undocumented": false, - "html": "Configuration for the bank transfer funding type, if the \u003Ccode\u003Efunding_type\u003C/code\u003E is set to \u003Ccode\u003Ebank_transfer\u003C/code\u003E." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "subspec": { - "eu_bank_transfer": { - "name": "eu_bank_transfer", - "check": "hash", - "validation": "hash", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Configuration for eu_bank_transfer", - "undocumented": false, - "html": "Configuration for eu_bank_transfer" - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "subspec": { - "country": { - "name": "country", - "check": "string", - "validation": "string", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "The desired country code of the bank account information. Permitted values include: `BE`, `DE`, `ES`, `FR`, `IE`, or `NL`.\n", - "undocumented": false, - "html": "The desired country code of the bank account information. Permitted values include: \u003Ccode\u003EBE\u003C/code\u003E, \u003Ccode\u003EDE\u003C/code\u003E, \u003Ccode\u003EES\u003C/code\u003E, \u003Ccode\u003EFR\u003C/code\u003E, \u003Ccode\u003EIE\u003C/code\u003E, or \u003Ccode\u003ENL\u003C/code\u003E." - }, - "gate": false, - "hide_unset_desc": null, - "required": true, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "country" - } - }, - "object_type": "eu_bank_transfer" - }, - "requested_address_types": { - "name": "requested_address_types", - "check": "array", - "validation": "array", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "List of address types that should be returned in the financial_addresses response. If not specified, all valid types will be returned.\n\nPermitted values include: `sort_code`, `zengin`, `iban`, or `spei`.\n", - "undocumented": false, - "html": "List of address types that should be returned in the financial_addresses response. If not specified, all valid types will be returned.\u003C/p\u003E\n\n\u003Cp\u003EPermitted values include: \u003Ccode\u003Esort_code\u003C/code\u003E, \u003Ccode\u003Ezengin\u003C/code\u003E, \u003Ccode\u003Eiban\u003C/code\u003E, or \u003Ccode\u003Espei\u003C/code\u003E." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "enum_values": { - "sort_code": { - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "sort_code bank account address type", - "undocumented": false, - "html": "sort_code bank account address type" - } - }, - "zengin": { - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "zengin bank account address type", - "undocumented": false, - "html": "zengin bank account address type" - } - }, - "sepa": { - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "sepa bank account address type", - "undocumented": false, - "html": "sepa bank account address type" - } - }, - "spei": { - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "spei bank account address type", - "undocumented": false, - "html": "spei bank account address type" - } - }, - "iban": { - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "iban bank account address type", - "undocumented": false, - "html": "iban bank account address type" - } - } - }, - "object_type": "requested_address_types" - }, - "type": { - "name": "type", - "check": "string", - "validation": "string", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "The bank transfer type that this PaymentIntent is allowed to use for funding Permitted values include: `eu_bank_transfer`, `gb_bank_transfer`, `jp_bank_transfer`, or `mx_bank_transfer`.\n", - "undocumented": false, - "html": "The bank transfer type that this PaymentIntent is allowed to use for funding Permitted values include: \u003Ccode\u003Eeu_bank_transfer\u003C/code\u003E, \u003Ccode\u003Egb_bank_transfer\u003C/code\u003E, \u003Ccode\u003Ejp_bank_transfer\u003C/code\u003E, or \u003Ccode\u003Emx_bank_transfer\u003C/code\u003E." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "enum_values": { - "eu_bank_transfer": { - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "A bank transfer of type eu_bank_transfer", - "undocumented": false, - "html": "A bank transfer of type eu_bank_transfer" - } - }, - "gb_bank_transfer": { - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "A bank transfer of type gb_bank_transfer", - "undocumented": false, - "html": "A bank transfer of type gb_bank_transfer" - } - }, - "jp_bank_transfer": { - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "A bank transfer of type jp_bank_transfer", - "undocumented": false, - "html": "A bank transfer of type jp_bank_transfer" - } - }, - "mx_bank_transfer": { - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "A bank transfer of type mx_bank_transfer", - "undocumented": false, - "html": "A bank transfer of type mx_bank_transfer" - } - } - }, - "object_type": "type" - } - }, - "object_type": "bank_transfer" - }, - "funding_type": { - "name": "funding_type", - "check": "string", - "validation": "string", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "The funding method type to be used when there are not enough funds in the customer balance. Permitted values include: `bank_transfer`.\n", - "undocumented": false, - "html": "The funding method type to be used when there are not enough funds in the customer balance. Permitted values include: \u003Ccode\u003Ebank_transfer\u003C/code\u003E." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "funding_type" - }, - "setup_future_usage": { - "name": "setup_future_usage", - "check": "string", - "validation": "string", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Indicates that you intend to make future payments with this PaymentIntent's payment method.\n\nProviding this parameter will [attach the payment method](/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](/docs/api/payment_methods/attach) to a Customer after the transaction completes.\n\nWhen processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](/docs/strong-customer-authentication).\n", - "undocumented": false, - "html": "Indicates that you intend to make future payments with this PaymentIntent’s payment method.\u003C/p\u003E\n\n\u003Cp\u003EProviding this parameter will \u003Ca href=\"/docs/payments/save-during-payment\"\u003Eattach the payment method\u003C/a\u003E to the PaymentIntent’s Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be \u003Ca href=\"/docs/api/payment_methods/attach\"\u003Eattached\u003C/a\u003E to a Customer after the transaction completes.\u003C/p\u003E\n\n\u003Cp\u003EWhen processing card payments, Stripe also uses \u003Ccode\u003Esetup_future_usage\u003C/code\u003E to dynamically optimize your payment flow and comply with regional legislation and network rules, such as \u003Ca href=\"/docs/strong-customer-authentication\"\u003ESCA\u003C/a\u003E." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "enum_values": { - "none": { - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Use `none` if you do not intend to reuse this payment method and want to override the top-level `setup_future_usage` value for this payment method.", - "undocumented": false, - "html": "Use \u003Ccode\u003Enone\u003C/code\u003E if you do not intend to reuse this payment method and want to override the top-level \u003Ccode\u003Esetup_future_usage\u003C/code\u003E value for this payment method." - } - } - }, - "object_type": "setup_future_usage" - } - }, - "object_type": "customer_balance" - }, - "eps": { - "name": "eps", - "check": "hash", - "validation": "hash", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "If the PaymentIntent's payment_method_types includes `eps`, this hash contains the configurations that will be applied to each payment attempt of that type.\n", - "undocumented": false, - "html": "If the PaymentIntent’s payment_method_types includes \u003Ccode\u003Eeps\u003C/code\u003E, this hash contains the configurations that will be applied to each payment attempt of that type." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "subspec": { - "setup_future_usage": { - "name": "setup_future_usage", - "check": "string", - "validation": "string", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Indicates that you intend to make future payments with this PaymentIntent's payment method.\n\nProviding this parameter will [attach the payment method](/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](/docs/api/payment_methods/attach) to a Customer after the transaction completes.\n\nWhen processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](/docs/strong-customer-authentication).\n", - "undocumented": false, - "html": "Indicates that you intend to make future payments with this PaymentIntent’s payment method.\u003C/p\u003E\n\n\u003Cp\u003EProviding this parameter will \u003Ca href=\"/docs/payments/save-during-payment\"\u003Eattach the payment method\u003C/a\u003E to the PaymentIntent’s Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be \u003Ca href=\"/docs/api/payment_methods/attach\"\u003Eattached\u003C/a\u003E to a Customer after the transaction completes.\u003C/p\u003E\n\n\u003Cp\u003EWhen processing card payments, Stripe also uses \u003Ccode\u003Esetup_future_usage\u003C/code\u003E to dynamically optimize your payment flow and comply with regional legislation and network rules, such as \u003Ca href=\"/docs/strong-customer-authentication\"\u003ESCA\u003C/a\u003E." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "enum_values": { - "none": { - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Use `none` if you do not intend to reuse this payment method and want to override the top-level `setup_future_usage` value for this payment method.", - "undocumented": false, - "html": "Use \u003Ccode\u003Enone\u003C/code\u003E if you do not intend to reuse this payment method and want to override the top-level \u003Ccode\u003Esetup_future_usage\u003C/code\u003E value for this payment method." - } - } - }, - "object_type": "setup_future_usage" - } - }, - "object_type": "eps" - }, - "fpx": { - "name": "fpx", - "check": "hash", - "validation": "hash", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "If the PaymentIntent's payment_method_types includes `fpx`, this hash contains the configurations that will be applied to each payment attempt of that type.\n", - "undocumented": false, - "html": "If the PaymentIntent’s payment_method_types includes \u003Ccode\u003Efpx\u003C/code\u003E, this hash contains the configurations that will be applied to each payment attempt of that type." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "subspec": { - "setup_future_usage": { - "name": "setup_future_usage", - "check": "string", - "validation": "string", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Indicates that you intend to make future payments with this PaymentIntent's payment method.\n\nProviding this parameter will [attach the payment method](/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](/docs/api/payment_methods/attach) to a Customer after the transaction completes.\n\nWhen processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](/docs/strong-customer-authentication).\n", - "undocumented": false, - "html": "Indicates that you intend to make future payments with this PaymentIntent’s payment method.\u003C/p\u003E\n\n\u003Cp\u003EProviding this parameter will \u003Ca href=\"/docs/payments/save-during-payment\"\u003Eattach the payment method\u003C/a\u003E to the PaymentIntent’s Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be \u003Ca href=\"/docs/api/payment_methods/attach\"\u003Eattached\u003C/a\u003E to a Customer after the transaction completes.\u003C/p\u003E\n\n\u003Cp\u003EWhen processing card payments, Stripe also uses \u003Ccode\u003Esetup_future_usage\u003C/code\u003E to dynamically optimize your payment flow and comply with regional legislation and network rules, such as \u003Ca href=\"/docs/strong-customer-authentication\"\u003ESCA\u003C/a\u003E." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "enum_values": { - "none": { - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Use `none` if you do not intend to reuse this payment method and want to override the top-level `setup_future_usage` value for this payment method.", - "undocumented": false, - "html": "Use \u003Ccode\u003Enone\u003C/code\u003E if you do not intend to reuse this payment method and want to override the top-level \u003Ccode\u003Esetup_future_usage\u003C/code\u003E value for this payment method." - } - } - }, - "object_type": "setup_future_usage" - } - }, - "object_type": "fpx" - }, - "giropay": { - "name": "giropay", - "check": "hash", - "validation": "hash", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "If the PaymentIntent's payment_method_types includes `giropay`, this hash contains the configurations that will be applied to each payment attempt of that type.\n", - "undocumented": false, - "html": "If the PaymentIntent’s payment_method_types includes \u003Ccode\u003Egiropay\u003C/code\u003E, this hash contains the configurations that will be applied to each payment attempt of that type." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "subspec": { - "setup_future_usage": { - "name": "setup_future_usage", - "check": "string", - "validation": "string", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Indicates that you intend to make future payments with this PaymentIntent's payment method.\n\nProviding this parameter will [attach the payment method](/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](/docs/api/payment_methods/attach) to a Customer after the transaction completes.\n\nWhen processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](/docs/strong-customer-authentication).\n", - "undocumented": false, - "html": "Indicates that you intend to make future payments with this PaymentIntent’s payment method.\u003C/p\u003E\n\n\u003Cp\u003EProviding this parameter will \u003Ca href=\"/docs/payments/save-during-payment\"\u003Eattach the payment method\u003C/a\u003E to the PaymentIntent’s Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be \u003Ca href=\"/docs/api/payment_methods/attach\"\u003Eattached\u003C/a\u003E to a Customer after the transaction completes.\u003C/p\u003E\n\n\u003Cp\u003EWhen processing card payments, Stripe also uses \u003Ccode\u003Esetup_future_usage\u003C/code\u003E to dynamically optimize your payment flow and comply with regional legislation and network rules, such as \u003Ca href=\"/docs/strong-customer-authentication\"\u003ESCA\u003C/a\u003E." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "enum_values": { - "none": { - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Use `none` if you do not intend to reuse this payment method and want to override the top-level `setup_future_usage` value for this payment method.", - "undocumented": false, - "html": "Use \u003Ccode\u003Enone\u003C/code\u003E if you do not intend to reuse this payment method and want to override the top-level \u003Ccode\u003Esetup_future_usage\u003C/code\u003E value for this payment method." - } - } - }, - "object_type": "setup_future_usage" - } - }, - "object_type": "giropay" - }, - "grabpay": { - "name": "grabpay", - "check": "hash", - "validation": "hash", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "If the PaymentIntent's payment_method_types includes `grabpay`, this hash contains the configurations that will be applied to each payment attempt of that type.\n", - "undocumented": false, - "html": "If the PaymentIntent’s payment_method_types includes \u003Ccode\u003Egrabpay\u003C/code\u003E, this hash contains the configurations that will be applied to each payment attempt of that type." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "subspec": { - "setup_future_usage": { - "name": "setup_future_usage", - "check": "string", - "validation": "string", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Indicates that you intend to make future payments with this PaymentIntent's payment method.\n\nProviding this parameter will [attach the payment method](/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](/docs/api/payment_methods/attach) to a Customer after the transaction completes.\n\nWhen processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](/docs/strong-customer-authentication).\n", - "undocumented": false, - "html": "Indicates that you intend to make future payments with this PaymentIntent’s payment method.\u003C/p\u003E\n\n\u003Cp\u003EProviding this parameter will \u003Ca href=\"/docs/payments/save-during-payment\"\u003Eattach the payment method\u003C/a\u003E to the PaymentIntent’s Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be \u003Ca href=\"/docs/api/payment_methods/attach\"\u003Eattached\u003C/a\u003E to a Customer after the transaction completes.\u003C/p\u003E\n\n\u003Cp\u003EWhen processing card payments, Stripe also uses \u003Ccode\u003Esetup_future_usage\u003C/code\u003E to dynamically optimize your payment flow and comply with regional legislation and network rules, such as \u003Ca href=\"/docs/strong-customer-authentication\"\u003ESCA\u003C/a\u003E." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "enum_values": { - "none": { - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Use `none` if you do not intend to reuse this payment method and want to override the top-level `setup_future_usage` value for this payment method.", - "undocumented": false, - "html": "Use \u003Ccode\u003Enone\u003C/code\u003E if you do not intend to reuse this payment method and want to override the top-level \u003Ccode\u003Esetup_future_usage\u003C/code\u003E value for this payment method." - } - } - }, - "object_type": "setup_future_usage" - } - }, - "object_type": "grabpay" - }, - "ideal": { - "name": "ideal", - "check": "hash", - "validation": "hash", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "If the PaymentIntent's payment_method_types includes `ideal`, this hash contains the configurations that will be applied to each payment attempt of that type.\n", - "undocumented": false, - "html": "If the PaymentIntent’s payment_method_types includes \u003Ccode\u003Eideal\u003C/code\u003E, this hash contains the configurations that will be applied to each payment attempt of that type." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "subspec": { - "setup_future_usage": { - "name": "setup_future_usage", - "check": "string", - "validation": "string", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Indicates that you intend to make future payments with this PaymentIntent's payment method.\n\nProviding this parameter will [attach the payment method](/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](/docs/api/payment_methods/attach) to a Customer after the transaction completes.\n\nWhen processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](/docs/strong-customer-authentication).\n", - "undocumented": false, - "html": "Indicates that you intend to make future payments with this PaymentIntent’s payment method.\u003C/p\u003E\n\n\u003Cp\u003EProviding this parameter will \u003Ca href=\"/docs/payments/save-during-payment\"\u003Eattach the payment method\u003C/a\u003E to the PaymentIntent’s Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be \u003Ca href=\"/docs/api/payment_methods/attach\"\u003Eattached\u003C/a\u003E to a Customer after the transaction completes.\u003C/p\u003E\n\n\u003Cp\u003EWhen processing card payments, Stripe also uses \u003Ccode\u003Esetup_future_usage\u003C/code\u003E to dynamically optimize your payment flow and comply with regional legislation and network rules, such as \u003Ca href=\"/docs/strong-customer-authentication\"\u003ESCA\u003C/a\u003E." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "enum_values": { - "off_session": { - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Use `off_session` if your customer may or may not be present in your checkout flow.", - "undocumented": false, - "html": "Use \u003Ccode\u003Eoff_session\u003C/code\u003E if your customer may or may not be present in your checkout flow." - } - }, - "none": { - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Use `none` if you do not intend to reuse this payment method and want to override the top-level `setup_future_usage` value for this payment method.", - "undocumented": false, - "html": "Use \u003Ccode\u003Enone\u003C/code\u003E if you do not intend to reuse this payment method and want to override the top-level \u003Ccode\u003Esetup_future_usage\u003C/code\u003E value for this payment method." - } - } - }, - "object_type": "setup_future_usage" - } - }, - "object_type": "ideal" - }, - "interac_present": { - "name": "interac_present", - "check": "hash", - "validation": "hash", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "If the PaymentIntent's payment_method_types includes `interac_present`, this hash contains the configurations that will be applied to each payment attempt of that type.\n", - "undocumented": false, - "html": "If the PaymentIntent’s payment_method_types includes \u003Ccode\u003Einterac_present\u003C/code\u003E, this hash contains the configurations that will be applied to each payment attempt of that type." - }, - "gate": true, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "subspec": {}, - "object_type": "interac_present" - }, - "klarna": { - "name": "klarna", - "check": "hash", - "validation": "hash", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "If the PaymentIntent's payment_method_types includes `klarna`, this hash contains the configurations that will be applied to each payment attempt of that type.\n", - "undocumented": false, - "html": "If the PaymentIntent’s payment_method_types includes \u003Ccode\u003Eklarna\u003C/code\u003E, this hash contains the configurations that will be applied to each payment attempt of that type." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "subspec": { - "capture_method": { - "name": "capture_method", - "check": "string", - "validation": "string", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Controls when the funds will be captured from the customer's account.\n", - "undocumented": false, - "html": "Controls when the funds will be captured from the customer’s account." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "enum_values": { - "manual": { - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Use `manual` if you intend to place the funds on hold and want to override the top-level `capture_method` value for this payment method.", - "undocumented": false, - "html": "Use \u003Ccode\u003Emanual\u003C/code\u003E if you intend to place the funds on hold and want to override the top-level \u003Ccode\u003Ecapture_method\u003C/code\u003E value for this payment method." - } - } - }, - "object_type": "capture_method" - }, - "preferred_locale": { - "name": "preferred_locale", - "check": "string", - "validation": "string", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Preferred locale of the Klarna checkout page that the customer is redirected to.", - "undocumented": false, - "html": "Preferred locale of the Klarna checkout page that the customer is redirected to." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "preferred_locale" - }, - "setup_future_usage": { - "name": "setup_future_usage", - "check": "string", - "validation": "string", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Indicates that you intend to make future payments with this PaymentIntent's payment method.\n\nProviding this parameter will [attach the payment method](/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](/docs/api/payment_methods/attach) to a Customer after the transaction completes.\n\nWhen processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](/docs/strong-customer-authentication).\n", - "undocumented": false, - "html": "Indicates that you intend to make future payments with this PaymentIntent’s payment method.\u003C/p\u003E\n\n\u003Cp\u003EProviding this parameter will \u003Ca href=\"/docs/payments/save-during-payment\"\u003Eattach the payment method\u003C/a\u003E to the PaymentIntent’s Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be \u003Ca href=\"/docs/api/payment_methods/attach\"\u003Eattached\u003C/a\u003E to a Customer after the transaction completes.\u003C/p\u003E\n\n\u003Cp\u003EWhen processing card payments, Stripe also uses \u003Ccode\u003Esetup_future_usage\u003C/code\u003E to dynamically optimize your payment flow and comply with regional legislation and network rules, such as \u003Ca href=\"/docs/strong-customer-authentication\"\u003ESCA\u003C/a\u003E." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "enum_values": { - "none": { - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Use `none` if you do not intend to reuse this payment method and want to override the top-level `setup_future_usage` value for this payment method.", - "undocumented": false, - "html": "Use \u003Ccode\u003Enone\u003C/code\u003E if you do not intend to reuse this payment method and want to override the top-level \u003Ccode\u003Esetup_future_usage\u003C/code\u003E value for this payment method." - } - } - }, - "object_type": "setup_future_usage" - } - }, - "object_type": "klarna" - }, - "konbini": { - "name": "konbini", - "check": "hash", - "validation": "hash", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "If the PaymentIntent's payment_method_types includes `konbini`, this hash contains the configurations that will be applied to each payment attempt of that type.\n", - "undocumented": false, - "html": "If the PaymentIntent’s payment_method_types includes \u003Ccode\u003Ekonbini\u003C/code\u003E, this hash contains the configurations that will be applied to each payment attempt of that type." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "subspec": { - "confirmation_number": { - "name": "confirmation_number", - "check": "string", - "validation": "string", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "An optional 10 to 11 digit numeric-only string determining the confirmation code at applicable convenience stores.", - "undocumented": false, - "html": "An optional 10 to 11 digit numeric-only string determining the confirmation code at applicable convenience stores." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "confirmation_number" - }, - "expires_after_days": { - "name": "expires_after_days", - "check": "integer", - "validation": "integer", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "The number of calendar days (between 1 and 60) after which Konbini payment instructions will expire. For example, if a PaymentIntent is confirmed with Konbini and `expires_after_days` set to 2 on Monday JST, the instructions will expire on Wednesday 23:59:59 JST.", - "undocumented": false, - "html": "The number of calendar days (between 1 and 60) after which Konbini payment instructions will expire. For example, if a PaymentIntent is confirmed with Konbini and \u003Ccode\u003Eexpires_after_days\u003C/code\u003E set to 2 on Monday JST, the instructions will expire on Wednesday 23:59:59 JST." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "expires_after_days" - }, - "expires_at": { - "name": "expires_at", - "check": "timestamp", - "validation": "timestamp", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "The timestamp at which the Konbini payment instructions will expire. Only one of `expires_after_days` or `expires_at` may be set.", - "undocumented": false, - "html": "The timestamp at which the Konbini payment instructions will expire. Only one of \u003Ccode\u003Eexpires_after_days\u003C/code\u003E or \u003Ccode\u003Eexpires_at\u003C/code\u003E may be set." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "expires_at" - }, - "product_description": { - "name": "product_description", - "check": "string", - "validation": "string", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "A product descriptor of up to 22 characters, which will appear to customers at the convenience store.", - "undocumented": false, - "html": "A product descriptor of up to 22 characters, which will appear to customers at the convenience store." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "product_description" - }, - "setup_future_usage": { - "name": "setup_future_usage", - "check": "string", - "validation": "string", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Indicates that you intend to make future payments with this PaymentIntent's payment method.\n\nProviding this parameter will [attach the payment method](/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](/docs/api/payment_methods/attach) to a Customer after the transaction completes.\n\nWhen processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](/docs/strong-customer-authentication).\n", - "undocumented": false, - "html": "Indicates that you intend to make future payments with this PaymentIntent’s payment method.\u003C/p\u003E\n\n\u003Cp\u003EProviding this parameter will \u003Ca href=\"/docs/payments/save-during-payment\"\u003Eattach the payment method\u003C/a\u003E to the PaymentIntent’s Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be \u003Ca href=\"/docs/api/payment_methods/attach\"\u003Eattached\u003C/a\u003E to a Customer after the transaction completes.\u003C/p\u003E\n\n\u003Cp\u003EWhen processing card payments, Stripe also uses \u003Ccode\u003Esetup_future_usage\u003C/code\u003E to dynamically optimize your payment flow and comply with regional legislation and network rules, such as \u003Ca href=\"/docs/strong-customer-authentication\"\u003ESCA\u003C/a\u003E." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "enum_values": { - "none": { - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Use `none` if you do not intend to reuse this payment method and want to override the top-level `setup_future_usage` value for this payment method.", - "undocumented": false, - "html": "Use \u003Ccode\u003Enone\u003C/code\u003E if you do not intend to reuse this payment method and want to override the top-level \u003Ccode\u003Esetup_future_usage\u003C/code\u003E value for this payment method." - } - } - }, - "object_type": "setup_future_usage" - } - }, - "object_type": "konbini" - }, - "link": { - "name": "link", - "check": "hash", - "validation": "hash", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "If the PaymentIntent's payment_method_types includes `link`, this hash contains the configurations that will be applied to each payment attempt of that type.\n", - "undocumented": false, - "html": "If the PaymentIntent’s payment_method_types includes \u003Ccode\u003Elink\u003C/code\u003E, this hash contains the configurations that will be applied to each payment attempt of that type." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "subspec": { - "capture_method": { - "name": "capture_method", - "check": "string", - "validation": "string", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Controls when the funds will be captured from the customer's account.\n", - "undocumented": false, - "html": "Controls when the funds will be captured from the customer’s account." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "enum_values": { - "manual": { - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Use `manual` if you intend to place the funds on hold and want to override the top-level `capture_method` value for this payment method.", - "undocumented": false, - "html": "Use \u003Ccode\u003Emanual\u003C/code\u003E if you intend to place the funds on hold and want to override the top-level \u003Ccode\u003Ecapture_method\u003C/code\u003E value for this payment method." - } - } - }, - "object_type": "capture_method" - }, - "persistent_token": { - "name": "persistent_token", - "check": "string", - "validation": "string", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Token used for persistent Link logins.", - "undocumented": false, - "html": "Token used for persistent Link logins." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "persistent_token" - }, - "setup_future_usage": { - "name": "setup_future_usage", - "check": "string", - "validation": "string", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Indicates that you intend to make future payments with this PaymentIntent's payment method.\n\nProviding this parameter will [attach the payment method](/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](/docs/api/payment_methods/attach) to a Customer after the transaction completes.\n\nWhen processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](/docs/strong-customer-authentication).\n", - "undocumented": false, - "html": "Indicates that you intend to make future payments with this PaymentIntent’s payment method.\u003C/p\u003E\n\n\u003Cp\u003EProviding this parameter will \u003Ca href=\"/docs/payments/save-during-payment\"\u003Eattach the payment method\u003C/a\u003E to the PaymentIntent’s Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be \u003Ca href=\"/docs/api/payment_methods/attach\"\u003Eattached\u003C/a\u003E to a Customer after the transaction completes.\u003C/p\u003E\n\n\u003Cp\u003EWhen processing card payments, Stripe also uses \u003Ccode\u003Esetup_future_usage\u003C/code\u003E to dynamically optimize your payment flow and comply with regional legislation and network rules, such as \u003Ca href=\"/docs/strong-customer-authentication\"\u003ESCA\u003C/a\u003E." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "enum_values": { - "off_session": { - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Use `off_session` if your customer may or may not be present in your checkout flow.", - "undocumented": false, - "html": "Use \u003Ccode\u003Eoff_session\u003C/code\u003E if your customer may or may not be present in your checkout flow." - } - }, - "none": { - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Use `none` if you do not intend to reuse this payment method and want to override the top-level `setup_future_usage` value for this payment method.", - "undocumented": false, - "html": "Use \u003Ccode\u003Enone\u003C/code\u003E if you do not intend to reuse this payment method and want to override the top-level \u003Ccode\u003Esetup_future_usage\u003C/code\u003E value for this payment method." - } - } - }, - "object_type": "setup_future_usage" - } - }, - "object_type": "link" - }, - "oxxo": { - "name": "oxxo", - "check": "hash", - "validation": "hash", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "If the PaymentIntent's payment_method_types includes `oxxo`, this hash contains the configurations that will be applied to each payment attempt of that type.\n", - "undocumented": false, - "html": "If the PaymentIntent’s payment_method_types includes \u003Ccode\u003Eoxxo\u003C/code\u003E, this hash contains the configurations that will be applied to each payment attempt of that type." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "subspec": { - "expires_after_days": { - "name": "expires_after_days", - "check": "integer", - "validation": "integer", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "The number of calendar days before an OXXO invoice expires. For example, if you create an OXXO invoice on Monday and you set expires_after_days to 2, the OXXO invoice will expire on Wednesday at 23:59 America/Mexico_City time.", - "undocumented": false, - "html": "The number of calendar days before an OXXO invoice expires. For example, if you create an OXXO invoice on Monday and you set expires_after_days to 2, the OXXO invoice will expire on Wednesday at 23:59 America/Mexico_City time." - }, - "gate": false, - "hide_unset_desc": null, - "required": true, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "expires_after_days" - }, - "setup_future_usage": { - "name": "setup_future_usage", - "check": "string", - "validation": "string", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Indicates that you intend to make future payments with this PaymentIntent's payment method.\n\nProviding this parameter will [attach the payment method](/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](/docs/api/payment_methods/attach) to a Customer after the transaction completes.\n\nWhen processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](/docs/strong-customer-authentication).\n", - "undocumented": false, - "html": "Indicates that you intend to make future payments with this PaymentIntent’s payment method.\u003C/p\u003E\n\n\u003Cp\u003EProviding this parameter will \u003Ca href=\"/docs/payments/save-during-payment\"\u003Eattach the payment method\u003C/a\u003E to the PaymentIntent’s Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be \u003Ca href=\"/docs/api/payment_methods/attach\"\u003Eattached\u003C/a\u003E to a Customer after the transaction completes.\u003C/p\u003E\n\n\u003Cp\u003EWhen processing card payments, Stripe also uses \u003Ccode\u003Esetup_future_usage\u003C/code\u003E to dynamically optimize your payment flow and comply with regional legislation and network rules, such as \u003Ca href=\"/docs/strong-customer-authentication\"\u003ESCA\u003C/a\u003E." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "enum_values": { - "none": { - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Use `none` if you do not intend to reuse this payment method and want to override the top-level `setup_future_usage` value for this payment method.", - "undocumented": false, - "html": "Use \u003Ccode\u003Enone\u003C/code\u003E if you do not intend to reuse this payment method and want to override the top-level \u003Ccode\u003Esetup_future_usage\u003C/code\u003E value for this payment method." - } - } - }, - "object_type": "setup_future_usage" - } - }, - "object_type": "oxxo" - }, - "p24": { - "name": "p24", - "check": "hash", - "validation": "hash", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "If the PaymentIntent's payment_method_types includes `p24`, this hash contains the configurations that will be applied to each payment attempt of that type.\n", - "undocumented": false, - "html": "If the PaymentIntent’s payment_method_types includes \u003Ccode\u003Ep24\u003C/code\u003E, this hash contains the configurations that will be applied to each payment attempt of that type." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "subspec": { - "setup_future_usage": { - "name": "setup_future_usage", - "check": "string", - "validation": "string", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Indicates that you intend to make future payments with this PaymentIntent's payment method.\n\nProviding this parameter will [attach the payment method](/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](/docs/api/payment_methods/attach) to a Customer after the transaction completes.\n\nWhen processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](/docs/strong-customer-authentication).\n", - "undocumented": false, - "html": "Indicates that you intend to make future payments with this PaymentIntent’s payment method.\u003C/p\u003E\n\n\u003Cp\u003EProviding this parameter will \u003Ca href=\"/docs/payments/save-during-payment\"\u003Eattach the payment method\u003C/a\u003E to the PaymentIntent’s Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be \u003Ca href=\"/docs/api/payment_methods/attach\"\u003Eattached\u003C/a\u003E to a Customer after the transaction completes.\u003C/p\u003E\n\n\u003Cp\u003EWhen processing card payments, Stripe also uses \u003Ccode\u003Esetup_future_usage\u003C/code\u003E to dynamically optimize your payment flow and comply with regional legislation and network rules, such as \u003Ca href=\"/docs/strong-customer-authentication\"\u003ESCA\u003C/a\u003E." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "enum_values": { - "none": { - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Use `none` if you do not intend to reuse this payment method and want to override the top-level `setup_future_usage` value for this payment method.", - "undocumented": false, - "html": "Use \u003Ccode\u003Enone\u003C/code\u003E if you do not intend to reuse this payment method and want to override the top-level \u003Ccode\u003Esetup_future_usage\u003C/code\u003E value for this payment method." - } - } - }, - "object_type": "setup_future_usage" - } - }, - "object_type": "p24" - }, - "paynow": { - "name": "paynow", - "check": "hash", - "validation": "hash", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "If the PaymentIntent's payment_method_types includes `paynow`, this hash contains the configurations that will be applied to each payment attempt of that type.\n", - "undocumented": false, - "html": "If the PaymentIntent’s payment_method_types includes \u003Ccode\u003Epaynow\u003C/code\u003E, this hash contains the configurations that will be applied to each payment attempt of that type." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "subspec": { - "setup_future_usage": { - "name": "setup_future_usage", - "check": "string", - "validation": "string", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Indicates that you intend to make future payments with this PaymentIntent's payment method.\n\nProviding this parameter will [attach the payment method](/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](/docs/api/payment_methods/attach) to a Customer after the transaction completes.\n\nWhen processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](/docs/strong-customer-authentication).\n", - "undocumented": false, - "html": "Indicates that you intend to make future payments with this PaymentIntent’s payment method.\u003C/p\u003E\n\n\u003Cp\u003EProviding this parameter will \u003Ca href=\"/docs/payments/save-during-payment\"\u003Eattach the payment method\u003C/a\u003E to the PaymentIntent’s Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be \u003Ca href=\"/docs/api/payment_methods/attach\"\u003Eattached\u003C/a\u003E to a Customer after the transaction completes.\u003C/p\u003E\n\n\u003Cp\u003EWhen processing card payments, Stripe also uses \u003Ccode\u003Esetup_future_usage\u003C/code\u003E to dynamically optimize your payment flow and comply with regional legislation and network rules, such as \u003Ca href=\"/docs/strong-customer-authentication\"\u003ESCA\u003C/a\u003E." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "enum_values": { - "none": { - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Use `none` if you do not intend to reuse this payment method and want to override the top-level `setup_future_usage` value for this payment method.", - "undocumented": false, - "html": "Use \u003Ccode\u003Enone\u003C/code\u003E if you do not intend to reuse this payment method and want to override the top-level \u003Ccode\u003Esetup_future_usage\u003C/code\u003E value for this payment method." - } - } - }, - "object_type": "setup_future_usage" - } - }, - "object_type": "paynow" - }, - "pix": { - "name": "pix", - "check": "hash", - "validation": "hash", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "If the PaymentIntent's payment_method_types includes `pix`, this hash contains the configurations that will be applied to each payment attempt of that type.\n", - "undocumented": false, - "html": "If the PaymentIntent’s payment_method_types includes \u003Ccode\u003Epix\u003C/code\u003E, this hash contains the configurations that will be applied to each payment attempt of that type." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "subspec": { - "expires_after_seconds": { - "name": "expires_after_seconds", - "check": "integer", - "validation": "integer", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "The number of seconds (between 10 and 1209600) after which Pix payment will expire.", - "undocumented": false, - "html": "The number of seconds (between 10 and 1209600) after which Pix payment will expire." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "expires_after_seconds" - }, - "expires_at": { - "name": "expires_at", - "check": "integer", - "validation": "integer", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "The timestamp at which the Pix expires.", - "undocumented": false, - "html": "The timestamp at which the Pix expires." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "expires_at" - }, - "setup_future_usage": { - "name": "setup_future_usage", - "check": "string", - "validation": "string", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Indicates that you intend to make future payments with this PaymentIntent's payment method.\n\nProviding this parameter will [attach the payment method](/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](/docs/api/payment_methods/attach) to a Customer after the transaction completes.\n\nWhen processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](/docs/strong-customer-authentication).\n", - "undocumented": false, - "html": "Indicates that you intend to make future payments with this PaymentIntent’s payment method.\u003C/p\u003E\n\n\u003Cp\u003EProviding this parameter will \u003Ca href=\"/docs/payments/save-during-payment\"\u003Eattach the payment method\u003C/a\u003E to the PaymentIntent’s Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be \u003Ca href=\"/docs/api/payment_methods/attach\"\u003Eattached\u003C/a\u003E to a Customer after the transaction completes.\u003C/p\u003E\n\n\u003Cp\u003EWhen processing card payments, Stripe also uses \u003Ccode\u003Esetup_future_usage\u003C/code\u003E to dynamically optimize your payment flow and comply with regional legislation and network rules, such as \u003Ca href=\"/docs/strong-customer-authentication\"\u003ESCA\u003C/a\u003E." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "enum_values": { - "none": { - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Use `none` if you do not intend to reuse this payment method and want to override the top-level `setup_future_usage` value for this payment method.", - "undocumented": false, - "html": "Use \u003Ccode\u003Enone\u003C/code\u003E if you do not intend to reuse this payment method and want to override the top-level \u003Ccode\u003Esetup_future_usage\u003C/code\u003E value for this payment method." - } - } - }, - "object_type": "setup_future_usage" - } - }, - "object_type": "pix" - }, - "promptpay": { - "name": "promptpay", - "check": "hash", - "validation": "hash", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "If the PaymentIntent's payment_method_types includes `promptpay`, this hash contains the configurations that will be applied to each payment attempt of that type.\n", - "undocumented": false, - "html": "If the PaymentIntent’s payment_method_types includes \u003Ccode\u003Epromptpay\u003C/code\u003E, this hash contains the configurations that will be applied to each payment attempt of that type." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "subspec": { - "setup_future_usage": { - "name": "setup_future_usage", - "check": "string", - "validation": "string", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Indicates that you intend to make future payments with this PaymentIntent's payment method.\n\nProviding this parameter will [attach the payment method](/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](/docs/api/payment_methods/attach) to a Customer after the transaction completes.\n\nWhen processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](/docs/strong-customer-authentication).\n", - "undocumented": false, - "html": "Indicates that you intend to make future payments with this PaymentIntent’s payment method.\u003C/p\u003E\n\n\u003Cp\u003EProviding this parameter will \u003Ca href=\"/docs/payments/save-during-payment\"\u003Eattach the payment method\u003C/a\u003E to the PaymentIntent’s Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be \u003Ca href=\"/docs/api/payment_methods/attach\"\u003Eattached\u003C/a\u003E to a Customer after the transaction completes.\u003C/p\u003E\n\n\u003Cp\u003EWhen processing card payments, Stripe also uses \u003Ccode\u003Esetup_future_usage\u003C/code\u003E to dynamically optimize your payment flow and comply with regional legislation and network rules, such as \u003Ca href=\"/docs/strong-customer-authentication\"\u003ESCA\u003C/a\u003E." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "enum_values": { - "none": { - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Use `none` if you do not intend to reuse this payment method and want to override the top-level `setup_future_usage` value for this payment method.", - "undocumented": false, - "html": "Use \u003Ccode\u003Enone\u003C/code\u003E if you do not intend to reuse this payment method and want to override the top-level \u003Ccode\u003Esetup_future_usage\u003C/code\u003E value for this payment method." - } - } - }, - "object_type": "setup_future_usage" - } - }, - "object_type": "promptpay" - }, - "sepa_debit": { - "name": "sepa_debit", - "check": "hash", - "validation": "hash", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "If the PaymentIntent's payment_method_types includes `sepa_debit`, this hash contains the configurations that will be applied to each payment attempt of that type.\n", - "undocumented": false, - "html": "If the PaymentIntent’s payment_method_types includes \u003Ccode\u003Esepa_debit\u003C/code\u003E, this hash contains the configurations that will be applied to each payment attempt of that type." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "subspec": { - "mandate_options": { - "name": "mandate_options", - "check": "hash", - "validation": "hash", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Additional fields for Mandate creation", - "undocumented": false, - "html": "Additional fields for Mandate creation" - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "subspec": {}, - "object_type": "mandate_options" - }, - "setup_future_usage": { - "name": "setup_future_usage", - "check": "string", - "validation": "string", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Indicates that you intend to make future payments with this PaymentIntent's payment method.\n\nProviding this parameter will [attach the payment method](/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](/docs/api/payment_methods/attach) to a Customer after the transaction completes.\n\nWhen processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](/docs/strong-customer-authentication).\n", - "undocumented": false, - "html": "Indicates that you intend to make future payments with this PaymentIntent’s payment method.\u003C/p\u003E\n\n\u003Cp\u003EProviding this parameter will \u003Ca href=\"/docs/payments/save-during-payment\"\u003Eattach the payment method\u003C/a\u003E to the PaymentIntent’s Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be \u003Ca href=\"/docs/api/payment_methods/attach\"\u003Eattached\u003C/a\u003E to a Customer after the transaction completes.\u003C/p\u003E\n\n\u003Cp\u003EWhen processing card payments, Stripe also uses \u003Ccode\u003Esetup_future_usage\u003C/code\u003E to dynamically optimize your payment flow and comply with regional legislation and network rules, such as \u003Ca href=\"/docs/strong-customer-authentication\"\u003ESCA\u003C/a\u003E." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "enum_values": { - "on_session": { - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Use `on_session` if you intend to only reuse the payment method when your customer is present in your checkout flow.", - "undocumented": false, - "html": "Use \u003Ccode\u003Eon_session\u003C/code\u003E if you intend to only reuse the payment method when your customer is present in your checkout flow." - } - }, - "off_session": { - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Use `off_session` if your customer may or may not be present in your checkout flow.", - "undocumented": false, - "html": "Use \u003Ccode\u003Eoff_session\u003C/code\u003E if your customer may or may not be present in your checkout flow." - } - }, - "none": { - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Use `none` if you do not intend to reuse this payment method and want to override the top-level `setup_future_usage` value for this payment method.", - "undocumented": false, - "html": "Use \u003Ccode\u003Enone\u003C/code\u003E if you do not intend to reuse this payment method and want to override the top-level \u003Ccode\u003Esetup_future_usage\u003C/code\u003E value for this payment method." - } - } - }, - "object_type": "setup_future_usage" - } - }, - "object_type": "sepa_debit" - }, - "sofort": { - "name": "sofort", - "check": "hash", - "validation": "hash", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "If the PaymentIntent's payment_method_types includes `sofort`, this hash contains the configurations that will be applied to each payment attempt of that type.\n", - "undocumented": false, - "html": "If the PaymentIntent’s payment_method_types includes \u003Ccode\u003Esofort\u003C/code\u003E, this hash contains the configurations that will be applied to each payment attempt of that type." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "subspec": { - "preferred_language": { - "name": "preferred_language", - "check": "string", - "validation": "string", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Preferred language of the SOFORT authorization page that the customer is redirected to.", - "undocumented": false, - "html": "Preferred language of the SOFORT authorization page that the customer is redirected to." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "preferred_language" - }, - "setup_future_usage": { - "name": "setup_future_usage", - "check": "string", - "validation": "string", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Indicates that you intend to make future payments with this PaymentIntent's payment method.\n\nProviding this parameter will [attach the payment method](/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](/docs/api/payment_methods/attach) to a Customer after the transaction completes.\n\nWhen processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](/docs/strong-customer-authentication).\n", - "undocumented": false, - "html": "Indicates that you intend to make future payments with this PaymentIntent’s payment method.\u003C/p\u003E\n\n\u003Cp\u003EProviding this parameter will \u003Ca href=\"/docs/payments/save-during-payment\"\u003Eattach the payment method\u003C/a\u003E to the PaymentIntent’s Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be \u003Ca href=\"/docs/api/payment_methods/attach\"\u003Eattached\u003C/a\u003E to a Customer after the transaction completes.\u003C/p\u003E\n\n\u003Cp\u003EWhen processing card payments, Stripe also uses \u003Ccode\u003Esetup_future_usage\u003C/code\u003E to dynamically optimize your payment flow and comply with regional legislation and network rules, such as \u003Ca href=\"/docs/strong-customer-authentication\"\u003ESCA\u003C/a\u003E." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "enum_values": { - "off_session": { - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Use `off_session` if your customer may or may not be present in your checkout flow.", - "undocumented": false, - "html": "Use \u003Ccode\u003Eoff_session\u003C/code\u003E if your customer may or may not be present in your checkout flow." - } - }, - "none": { - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Use `none` if you do not intend to reuse this payment method and want to override the top-level `setup_future_usage` value for this payment method.", - "undocumented": false, - "html": "Use \u003Ccode\u003Enone\u003C/code\u003E if you do not intend to reuse this payment method and want to override the top-level \u003Ccode\u003Esetup_future_usage\u003C/code\u003E value for this payment method." - } - } - }, - "object_type": "setup_future_usage" - } - }, - "object_type": "sofort" - }, - "us_bank_account": { - "name": "us_bank_account", - "check": "hash", - "validation": "hash", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "If the PaymentIntent's payment_method_types includes `us_bank_account`, this hash contains the configurations that will be applied to each payment attempt of that type.\n", - "undocumented": false, - "html": "If the PaymentIntent’s payment_method_types includes \u003Ccode\u003Eus_bank_account\u003C/code\u003E, this hash contains the configurations that will be applied to each payment attempt of that type." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "subspec": { - "financial_connections": { - "name": "financial_connections", - "check": "hash", - "validation": "hash", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Additional fields for Financial Connections Session creation", - "undocumented": false, - "html": "Additional fields for Financial Connections Session creation" - }, - "gate": true, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "subspec": { - "permissions": { - "name": "permissions", - "check": "array", - "validation": "array", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "The list of permissions to request. The `payment_method` permission must be included.", - "undocumented": false, - "html": "The list of permissions to request. The \u003Ccode\u003Epayment_method\u003C/code\u003E permission must be included." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "enum_values": { - "payment_method": { - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Allows the creation of a payment method from the account.", - "undocumented": false, - "html": "Allows the creation of a payment method from the account." - } - }, - "balances": { - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Allows accessing balance data from the account.", - "undocumented": false, - "html": "Allows accessing balance data from the account." - } - }, - "transactions": { - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Allows accessing transactions data from the account.", - "undocumented": false, - "html": "Allows accessing transactions data from the account." - } - }, - "ownership": { - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Allows accessing ownership data from the account.", - "undocumented": false, - "html": "Allows accessing ownership data from the account." - } - } - }, - "object_type": "permissions" - } - }, - "object_type": "financial_connections" - }, - "setup_future_usage": { - "name": "setup_future_usage", - "check": "string", - "validation": "string", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Indicates that you intend to make future payments with this PaymentIntent's payment method.\n\nProviding this parameter will [attach the payment method](/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](/docs/api/payment_methods/attach) to a Customer after the transaction completes.\n\nWhen processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](/docs/strong-customer-authentication).\n", - "undocumented": false, - "html": "Indicates that you intend to make future payments with this PaymentIntent’s payment method.\u003C/p\u003E\n\n\u003Cp\u003EProviding this parameter will \u003Ca href=\"/docs/payments/save-during-payment\"\u003Eattach the payment method\u003C/a\u003E to the PaymentIntent’s Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be \u003Ca href=\"/docs/api/payment_methods/attach\"\u003Eattached\u003C/a\u003E to a Customer after the transaction completes.\u003C/p\u003E\n\n\u003Cp\u003EWhen processing card payments, Stripe also uses \u003Ccode\u003Esetup_future_usage\u003C/code\u003E to dynamically optimize your payment flow and comply with regional legislation and network rules, such as \u003Ca href=\"/docs/strong-customer-authentication\"\u003ESCA\u003C/a\u003E." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "enum_values": { - "on_session": { - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Use `on_session` if you intend to only reuse the payment method when your customer is present in your checkout flow.", - "undocumented": false, - "html": "Use \u003Ccode\u003Eon_session\u003C/code\u003E if you intend to only reuse the payment method when your customer is present in your checkout flow." - } - }, - "off_session": { - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Use `off_session` if your customer may or may not be present in your checkout flow.", - "undocumented": false, - "html": "Use \u003Ccode\u003Eoff_session\u003C/code\u003E if your customer may or may not be present in your checkout flow." - } - }, - "none": { - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Use `none` if you do not intend to reuse this payment method and want to override the top-level `setup_future_usage` value for this payment method.", - "undocumented": false, - "html": "Use \u003Ccode\u003Enone\u003C/code\u003E if you do not intend to reuse this payment method and want to override the top-level \u003Ccode\u003Esetup_future_usage\u003C/code\u003E value for this payment method." - } - } - }, - "object_type": "setup_future_usage" - }, - "verification_method": { - "name": "verification_method", - "check": "string", - "validation": "string", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Bank account verification method.", - "undocumented": false, - "html": "Bank account verification method." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "enum_values": { - "automatic": { - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Instant verification with fallback to microdeposits.", - "undocumented": false, - "html": "Instant verification with fallback to microdeposits." - } - }, - "instant": { - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Instant verification only.", - "undocumented": false, - "html": "Instant verification only." - } - }, - "microdeposits": { - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Verification using microdeposits. Cannot be used with Stripe Checkout or Hosted Invoices.", - "undocumented": false, - "html": "Verification using microdeposits. Cannot be used with Stripe Checkout or Hosted Invoices." - } - } - }, - "object_type": "verification_method" - } - }, - "object_type": "us_bank_account" - }, - "wechat_pay": { - "name": "wechat_pay", - "check": "hash", - "validation": "hash", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "If the PaymentIntent's payment_method_types includes `wechat_pay`, this hash contains the configurations that will be applied to each payment attempt of that type.\n", - "undocumented": false, - "html": "If the PaymentIntent’s payment_method_types includes \u003Ccode\u003Ewechat_pay\u003C/code\u003E, this hash contains the configurations that will be applied to each payment attempt of that type." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "subspec": { - "app_id": { - "name": "app_id", - "check": "string", - "validation": "string", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "The app ID registered with WeChat Pay. Only required when client is ios or android.", - "undocumented": false, - "html": "The app ID registered with WeChat Pay. Only required when client is ios or android." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "app_id" - }, - "client": { - "name": "client", - "check": "string", - "validation": "string", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "The client type that the end customer will pay from", - "undocumented": false, - "html": "The client type that the end customer will pay from" - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "enum_values": { - "web": { - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "The end customer will pay from web browser", - "undocumented": false, - "html": "The end customer will pay from web browser" - } - }, - "ios": { - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "The end customer will pay from an iOS app", - "undocumented": false, - "html": "The end customer will pay from an iOS app" - } - }, - "android": { - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "The end customer will pay from an Android app", - "undocumented": false, - "html": "The end customer will pay from an Android app" - } - } - }, - "object_type": "client" - }, - "setup_future_usage": { - "name": "setup_future_usage", - "check": "string", - "validation": "string", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Indicates that you intend to make future payments with this PaymentIntent's payment method.\n\nProviding this parameter will [attach the payment method](/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](/docs/api/payment_methods/attach) to a Customer after the transaction completes.\n\nWhen processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](/docs/strong-customer-authentication).\n", - "undocumented": false, - "html": "Indicates that you intend to make future payments with this PaymentIntent’s payment method.\u003C/p\u003E\n\n\u003Cp\u003EProviding this parameter will \u003Ca href=\"/docs/payments/save-during-payment\"\u003Eattach the payment method\u003C/a\u003E to the PaymentIntent’s Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be \u003Ca href=\"/docs/api/payment_methods/attach\"\u003Eattached\u003C/a\u003E to a Customer after the transaction completes.\u003C/p\u003E\n\n\u003Cp\u003EWhen processing card payments, Stripe also uses \u003Ccode\u003Esetup_future_usage\u003C/code\u003E to dynamically optimize your payment flow and comply with regional legislation and network rules, such as \u003Ca href=\"/docs/strong-customer-authentication\"\u003ESCA\u003C/a\u003E." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "enum_values": { - "none": { - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Use `none` if you do not intend to reuse this payment method and want to override the top-level `setup_future_usage` value for this payment method.", - "undocumented": false, - "html": "Use \u003Ccode\u003Enone\u003C/code\u003E if you do not intend to reuse this payment method and want to override the top-level \u003Ccode\u003Esetup_future_usage\u003C/code\u003E value for this payment method." - } - } - }, - "object_type": "setup_future_usage" - } - }, - "object_type": "wechat_pay" - } - }, - "object_type": "payment_method_options", - "less_common": true - }, - "payment_method_types": { - "name": "payment_method_types", - "check": "string_array", - "validation": "array containing strings", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "The list of payment method types (e.g. card) that this PaymentIntent is allowed to use.", - "undocumented": false, - "html": "The list of payment method types (e.g. card) that this PaymentIntent is allowed to use." - }, - "gate": false, - "hide_unset_desc": null, - "required": true, - "default": null, - "badge_text": "retrievable with publishable key", - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "payment_method_types" - }, - "processing": { - "name": "processing", - "check": "hash", - "validation": "hash", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "If present, this property tells you about the processing state of the payment.", - "undocumented": false, - "html": "If present, this property tells you about the processing state of the payment." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": "retrievable with publishable key", - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "subspec": { - "card": { - "name": "card", - "check": "hash", - "validation": "hash", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "If the PaymentIntent's payment_method_types includes `card`, this hash contains the details on the `processing` state of the payment.\n", - "undocumented": false, - "html": "If the PaymentIntent’s payment_method_types includes \u003Ccode\u003Ecard\u003C/code\u003E, this hash contains the details on the \u003Ccode\u003Eprocessing\u003C/code\u003E state of the payment." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "subspec": { - "customer_notification": { - "name": "customer_notification", - "check": "hash", - "validation": "hash", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "For recurring payments of Indian cards, this hash contains details on whether customer approval is required, and until when the payment will be in `processing` state", - "undocumented": false, - "html": "For recurring payments of Indian cards, this hash contains details on whether customer approval is required, and until when the payment will be in \u003Ccode\u003Eprocessing\u003C/code\u003E state" - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "subspec": { - "approval_requested": { - "name": "approval_requested", - "check": "boolean", - "validation": "boolean", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Whether customer approval has been requested for this payment. For payments greater than INR 15000 or mandate amount, the customer must provide explicit approval of the payment with their bank.", - "undocumented": false, - "html": "Whether customer approval has been requested for this payment. For payments greater than INR 15000 or mandate amount, the customer must provide explicit approval of the payment with their bank." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "approval_requested" - }, - "completes_at": { - "name": "completes_at", - "check": "timestamp", - "validation": "timestamp", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "If customer approval is required, they need to provide approval before this time.", - "undocumented": false, - "html": "If customer approval is required, they need to provide approval before this time." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "completes_at" - } - }, - "object_type": "customer_notification" - } - }, - "object_type": "card" - }, - "type": { - "name": "type", - "check": "string", - "validation": "string", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Type of the payment method for which payment is in `processing` state, one of `card`.", - "undocumented": false, - "html": "Type of the payment method for which payment is in \u003Ccode\u003Eprocessing\u003C/code\u003E state, one of \u003Ccode\u003Ecard\u003C/code\u003E." - }, - "gate": false, - "hide_unset_desc": null, - "required": true, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "type" - } - }, - "object_type": "processing", - "less_common": true - }, - "receipt_email": { - "name": "receipt_email", - "check": "string", - "validation": "string", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Email address that the receipt for the resulting payment will be sent to. If `receipt_email` is specified for a payment in live mode, a receipt will be sent regardless of your [email settings](https://dashboard.stripe.com/account/emails).", - "undocumented": false, - "html": "Email address that the receipt for the resulting payment will be sent to. If \u003Ccode\u003Ereceipt_email\u003C/code\u003E is specified for a payment in live mode, a receipt will be sent regardless of your \u003Ca href=\"https://dashboard.stripe.com/account/emails\"\u003Eemail settings\u003C/a\u003E." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": "retrievable with publishable key", - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "receipt_email" - }, - "review": { - "name": "review", - "check": "string", - "validation": "string", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "ID of the review associated with this PaymentIntent, if any.", - "undocumented": false, - "html": "ID of the review associated with this PaymentIntent, if any." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "user_expandable": ["review"], - "object_type": "review", - "less_common": true - }, - "setup_future_usage": { - "name": "setup_future_usage", - "check": "string", - "validation": "string", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Indicates that you intend to make future payments with this PaymentIntent's payment method.\n\nProviding this parameter will [attach the payment method](/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](/docs/api/payment_methods/attach) to a Customer after the transaction completes.\n\nWhen processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](/docs/strong-customer-authentication).\n", - "undocumented": false, - "html": "Indicates that you intend to make future payments with this PaymentIntent’s payment method.\u003C/p\u003E\n\n\u003Cp\u003EProviding this parameter will \u003Ca href=\"/docs/payments/save-during-payment\"\u003Eattach the payment method\u003C/a\u003E to the PaymentIntent’s Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be \u003Ca href=\"/docs/api/payment_methods/attach\"\u003Eattached\u003C/a\u003E to a Customer after the transaction completes.\u003C/p\u003E\n\n\u003Cp\u003EWhen processing card payments, Stripe also uses \u003Ccode\u003Esetup_future_usage\u003C/code\u003E to dynamically optimize your payment flow and comply with regional legislation and network rules, such as \u003Ca href=\"/docs/strong-customer-authentication\"\u003ESCA\u003C/a\u003E." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": "retrievable with publishable key", - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "enum_values": { - "on_session": { - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Use `on_session` if you intend to only reuse the payment method when your customer is present in your checkout flow.", - "undocumented": false, - "html": "Use \u003Ccode\u003Eon_session\u003C/code\u003E if you intend to only reuse the payment method when your customer is present in your checkout flow." - } - }, - "off_session": { - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Use `off_session` if your customer may or may not be present in your checkout flow.", - "undocumented": false, - "html": "Use \u003Ccode\u003Eoff_session\u003C/code\u003E if your customer may or may not be present in your checkout flow." - } - } - }, - "object_type": "setup_future_usage" - }, - "shipping": { - "name": "shipping", - "check": "hash", - "validation": "hash", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Shipping information for this PaymentIntent.", - "undocumented": false, - "html": "Shipping information for this PaymentIntent." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": "retrievable with publishable key", - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "subspec": { - "address": { - "name": "address", - "check": "hash", - "validation": "hash", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Shipping address.", - "undocumented": false, - "html": "Shipping address." - }, - "gate": false, - "hide_unset_desc": null, - "required": true, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "subspec": { - "city": { - "name": "city", - "check": "string", - "validation": "string", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "City, district, suburb, town, or village.", - "undocumented": false, - "html": "City, district, suburb, town, or village." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "city" - }, - "country": { - "name": "country", - "check": "string", - "validation": "string", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)).", - "undocumented": false, - "html": "Two-letter country code (\u003Ca href=\"https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2\"\u003EISO 3166-1 alpha-2\u003C/a\u003E)." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "country" - }, - "line1": { - "name": "line1", - "check": "string", - "validation": "string", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Address line 1 (e.g., street, PO Box, or company name).", - "undocumented": false, - "html": "Address line 1 (e.g., street, PO Box, or company name)." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "line1" - }, - "line2": { - "name": "line2", - "check": "string", - "validation": "string", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Address line 2 (e.g., apartment, suite, unit, or building).", - "undocumented": false, - "html": "Address line 2 (e.g., apartment, suite, unit, or building)." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "line2" - }, - "postal_code": { - "name": "postal_code", - "check": "string", - "validation": "string", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "ZIP or postal code.", - "undocumented": false, - "html": "ZIP or postal code." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "postal_code" - }, - "state": { - "name": "state", - "check": "string", - "validation": "string", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "State, county, province, or region.", - "undocumented": false, - "html": "State, county, province, or region." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "state" - } - }, - "object_type": "address" - }, - "carrier": { - "name": "carrier", - "check": "string", - "validation": "string", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "The delivery service that shipped a physical product, such as Fedex, UPS, USPS, etc.", - "undocumented": false, - "html": "The delivery service that shipped a physical product, such as Fedex, UPS, USPS, etc." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "carrier" - }, - "name": { - "name": "name", - "check": "string", - "validation": "string", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Recipient name.", - "undocumented": false, - "html": "Recipient name." - }, - "gate": false, - "hide_unset_desc": null, - "required": true, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "name" - }, - "phone": { - "name": "phone", - "check": "string", - "validation": "string", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Recipient phone (including extension).", - "undocumented": false, - "html": "Recipient phone (including extension)." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "phone" - }, - "tracking_number": { - "name": "tracking_number", - "check": "string", - "validation": "string", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "The tracking number for a physical product, obtained from the delivery service. If multiple tracking numbers were generated for this purchase, please separate them with commas.", - "undocumented": false, - "html": "The tracking number for a physical product, obtained from the delivery service. If multiple tracking numbers were generated for this purchase, please separate them with commas." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "tracking_number" - } - }, - "object_type": "shipping" - }, - "statement_descriptor": { - "name": "statement_descriptor", - "check": "string", - "validation": "string", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "For non-card charges, you can use this value as the complete description that appears on your customers’ statements. Must contain at least one letter, maximum 22 characters.", - "undocumented": false, - "html": "For non-card charges, you can use this value as the complete description that appears on your customers’ statements. Must contain at least one letter, maximum 22 characters." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "statement_descriptor" - }, - "statement_descriptor_suffix": { - "name": "statement_descriptor_suffix", - "check": "string", - "validation": "string", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Provides information about a card payment that customers see on their statements. Concatenated with the prefix (shortened descriptor) or statement descriptor that’s set on the account to form the complete statement descriptor. Maximum 22 characters for the concatenated descriptor.", - "undocumented": false, - "html": "Provides information about a card payment that customers see on their statements. Concatenated with the prefix (shortened descriptor) or statement descriptor that’s set on the account to form the complete statement descriptor. Maximum 22 characters for the concatenated descriptor." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "statement_descriptor_suffix" - }, - "status": { - "name": "status", - "check": "string", - "validation": "string", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Status of this PaymentIntent, one of `requires_payment_method`, `requires_confirmation`, `requires_action`, `processing`, `requires_capture`, `canceled`, or `succeeded`. Read more about each PaymentIntent [status](/docs/payments/intents#intent-statuses).", - "undocumented": false, - "html": "Status of this PaymentIntent, one of \u003Ccode\u003Erequires_payment_method\u003C/code\u003E, \u003Ccode\u003Erequires_confirmation\u003C/code\u003E, \u003Ccode\u003Erequires_action\u003C/code\u003E, \u003Ccode\u003Eprocessing\u003C/code\u003E, \u003Ccode\u003Erequires_capture\u003C/code\u003E, \u003Ccode\u003Ecanceled\u003C/code\u003E, or \u003Ccode\u003Esucceeded\u003C/code\u003E. Read more about each PaymentIntent \u003Ca href=\"/docs/payments/intents#intent-statuses\"\u003Estatus\u003C/a\u003E." - }, - "gate": false, - "hide_unset_desc": null, - "required": true, - "default": null, - "badge_text": "retrievable with publishable key", - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "status" - }, - "transfer_data": { - "name": "transfer_data", - "check": "hash", - "validation": "hash", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "The data with which to automatically create a Transfer when the payment is finalized. See the PaymentIntents [use case for connected accounts](/docs/payments/connected-accounts) for details.", - "undocumented": false, - "html": "The data with which to automatically create a Transfer when the payment is finalized. See the PaymentIntents \u003Ca href=\"/docs/payments/connected-accounts\"\u003Euse case for connected accounts\u003C/a\u003E for details." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": "Connect only", - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "subspec": { - "amount": { - "name": "amount", - "check": "integer", - "validation": "integer", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Amount intended to be collected by this PaymentIntent. A positive integer representing how much to charge in the [smallest currency unit](/docs/currencies#zero-decimal) (e.g., 100 cents to charge $1.00 or 100 to charge ¥100, a zero-decimal currency). The minimum amount is $0.50 US or [equivalent in charge currency](/docs/currencies#minimum-and-maximum-charge-amounts). The amount value supports up to eight digits (e.g., a value of 99999999 for a USD charge of $999,999.99).", - "undocumented": false, - "html": "Amount intended to be collected by this PaymentIntent. A positive integer representing how much to charge in the \u003Ca href=\"/docs/currencies#zero-decimal\"\u003Esmallest currency unit\u003C/a\u003E (e.g., 100 cents to charge $1.00 or 100 to charge ¥100, a zero-decimal currency). The minimum amount is $0.50 US or \u003Ca href=\"/docs/currencies#minimum-and-maximum-charge-amounts\"\u003Eequivalent in charge currency\u003C/a\u003E. The amount value supports up to eight digits (e.g., a value of 99999999 for a USD charge of $999,999.99)." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "amount" - }, - "destination": { - "name": "destination", - "check": "string", - "validation": "string", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "The account (if any) the payment will be attributed to for tax\nreporting, and where funds from the payment will be transferred to upon\npayment success.\n", - "undocumented": false, - "html": "The account (if any) the payment will be attributed to for tax\nreporting, and where funds from the payment will be transferred to upon\npayment success." - }, - "gate": false, - "hide_unset_desc": null, - "required": true, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "user_expandable": ["account"], - "object_type": "destination" - } - }, - "object_type": "transfer_data", - "less_common": true - }, - "transfer_group": { - "name": "transfer_group", - "check": "string", - "validation": "string", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "A string that identifies the resulting payment as part of a group. See the PaymentIntents [use case for connected accounts](/docs/payments/connected-accounts) for details.", - "undocumented": false, - "html": "A string that identifies the resulting payment as part of a group. See the PaymentIntents \u003Ca href=\"/docs/payments/connected-accounts\"\u003Euse case for connected accounts\u003C/a\u003E for details." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": "Connect only", - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "transfer_group", - "less_common": true - } - } - }, - "payment_method": { - "name": "payment_method", - "check": "hash", - "validation": "hash", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "The PaymentMethod object for errors returned on a request involving a PaymentMethod.", - "undocumented": false, - "html": "The PaymentMethod object for errors returned on a request involving a PaymentMethod." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "subspec": { - "id": { - "name": "id", - "check": "string", - "validation": "string", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Unique identifier for the object.", - "undocumented": false, - "html": "Unique identifier for the object." - }, - "gate": false, - "hide_unset_desc": null, - "required": true, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "id" - }, - "object": { - "name": "object", - "check": "string", - "validation": "string", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "String representing the object's type. Objects of the same type share the same value.", - "undocumented": false, - "html": "String representing the object’s type. Objects of the same type share the same value." - }, - "gate": false, - "hide_unset_desc": null, - "required": true, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "object", - "less_common": true - }, - "acss_debit": { - "name": "acss_debit", - "check": "hash", - "validation": "hash", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "If this is an `acss_debit` PaymentMethod, this hash contains details about the ACSS Debit payment method.", - "undocumented": false, - "html": "If this is an \u003Ccode\u003Eacss_debit\u003C/code\u003E PaymentMethod, this hash contains details about the ACSS Debit payment method." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "subspec": { - "bank_name": { - "name": "bank_name", - "check": "string", - "validation": "string", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Name of the bank associated with the bank account.", - "undocumented": false, - "html": "Name of the bank associated with the bank account." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "bank_name" - }, - "fingerprint": { - "name": "fingerprint", - "check": "string", - "validation": "string", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Uniquely identifies this particular bank account. You can use this attribute to check whether two bank accounts are the same.", - "undocumented": false, - "html": "Uniquely identifies this particular bank account. You can use this attribute to check whether two bank accounts are the same." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "fingerprint" - }, - "institution_number": { - "name": "institution_number", - "check": "string", - "validation": "string", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Institution number of the bank account.", - "undocumented": false, - "html": "Institution number of the bank account." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "institution_number" - }, - "last4": { - "name": "last4", - "check": "string", - "validation": "string", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Last four digits of the bank account number.", - "undocumented": false, - "html": "Last four digits of the bank account number." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "last4" - }, - "transit_number": { - "name": "transit_number", - "check": "string", - "validation": "string", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Transit number of the bank account.", - "undocumented": false, - "html": "Transit number of the bank account." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "transit_number" - } - }, - "object_type": "acss_debit", - "less_common": true - }, - "affirm": { - "name": "affirm", - "check": "hash", - "validation": "hash", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "If this is an `affirm` PaymentMethod, this hash contains details about the Affirm payment method.", - "undocumented": false, - "html": "If this is an \u003Ccode\u003Eaffirm\u003C/code\u003E PaymentMethod, this hash contains details about the Affirm payment method." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "subspec": {}, - "object_type": "affirm", - "less_common": true - }, - "afterpay_clearpay": { - "name": "afterpay_clearpay", - "check": "hash", - "validation": "hash", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "If this is an `AfterpayClearpay` PaymentMethod, this hash contains details about the AfterpayClearpay payment method.", - "undocumented": false, - "html": "If this is an \u003Ccode\u003EAfterpayClearpay\u003C/code\u003E PaymentMethod, this hash contains details about the AfterpayClearpay payment method." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "subspec": {}, - "object_type": "afterpay_clearpay", - "less_common": true - }, - "alipay": { - "name": "alipay", - "check": "hash", - "validation": "hash", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "If this is an `Alipay` PaymentMethod, this hash contains details about the Alipay payment method.", - "undocumented": false, - "html": "If this is an \u003Ccode\u003EAlipay\u003C/code\u003E PaymentMethod, this hash contains details about the Alipay payment method." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "subspec": {}, - "object_type": "alipay", - "less_common": true - }, - "au_becs_debit": { - "name": "au_becs_debit", - "check": "hash", - "validation": "hash", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "If this is an `au_becs_debit` PaymentMethod, this hash contains details about the bank account.", - "undocumented": false, - "html": "If this is an \u003Ccode\u003Eau_becs_debit\u003C/code\u003E PaymentMethod, this hash contains details about the bank account." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "subspec": { - "bsb_number": { - "name": "bsb_number", - "check": "string", - "validation": "string", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Six-digit number identifying bank and branch associated with this bank account.", - "undocumented": false, - "html": "Six-digit number identifying bank and branch associated with this bank account." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "bsb_number" - }, - "fingerprint": { - "name": "fingerprint", - "check": "string", - "validation": "string", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Uniquely identifies this particular bank account. You can use this attribute to check whether two bank accounts are the same.", - "undocumented": false, - "html": "Uniquely identifies this particular bank account. You can use this attribute to check whether two bank accounts are the same." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "fingerprint" - }, - "last4": { - "name": "last4", - "check": "string", - "validation": "string", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Last four digits of the bank account number.", - "undocumented": false, - "html": "Last four digits of the bank account number." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "last4" - } - }, - "object_type": "au_becs_debit", - "less_common": true - }, - "bacs_debit": { - "name": "bacs_debit", - "check": "hash", - "validation": "hash", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "If this is a `bacs_debit` PaymentMethod, this hash contains details about the Bacs Direct Debit bank account.", - "undocumented": false, - "html": "If this is a \u003Ccode\u003Ebacs_debit\u003C/code\u003E PaymentMethod, this hash contains details about the Bacs Direct Debit bank account." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "subspec": { - "fingerprint": { - "name": "fingerprint", - "check": "string", - "validation": "string", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Uniquely identifies this particular bank account. You can use this attribute to check whether two bank accounts are the same.", - "undocumented": false, - "html": "Uniquely identifies this particular bank account. You can use this attribute to check whether two bank accounts are the same." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "fingerprint" - }, - "last4": { - "name": "last4", - "check": "string", - "validation": "string", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Last four digits of the bank account number.", - "undocumented": false, - "html": "Last four digits of the bank account number." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "last4" - }, - "sort_code": { - "name": "sort_code", - "check": "string", - "validation": "string", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Sort code of the bank account. (e.g., `10-20-30`)", - "undocumented": false, - "html": "Sort code of the bank account. (e.g., \u003Ccode\u003E10-20-30\u003C/code\u003E)" - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "sort_code" - } - }, - "object_type": "bacs_debit", - "less_common": true - }, - "bancontact": { - "name": "bancontact", - "check": "hash", - "validation": "hash", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "If this is a `bancontact` PaymentMethod, this hash contains details about the Bancontact payment method.", - "undocumented": false, - "html": "If this is a \u003Ccode\u003Ebancontact\u003C/code\u003E PaymentMethod, this hash contains details about the Bancontact payment method." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "subspec": {}, - "object_type": "bancontact", - "less_common": true - }, - "billing_details": { - "name": "billing_details", - "check": "hash", - "validation": "hash", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Billing information associated with the PaymentMethod that may be used or required by particular types of payment methods.", - "undocumented": false, - "html": "Billing information associated with the PaymentMethod that may be used or required by particular types of payment methods." - }, - "gate": false, - "hide_unset_desc": null, - "required": true, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "subspec": { - "address": { - "name": "address", - "check": "hash", - "validation": "hash", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Billing address.", - "undocumented": false, - "html": "Billing address." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "subspec": { - "city": { - "name": "city", - "check": "string", - "validation": "string", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "City, district, suburb, town, or village.", - "undocumented": false, - "html": "City, district, suburb, town, or village." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "city" - }, - "country": { - "name": "country", - "check": "string", - "validation": "string", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)).", - "undocumented": false, - "html": "Two-letter country code (\u003Ca href=\"https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2\"\u003EISO 3166-1 alpha-2\u003C/a\u003E)." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "country" - }, - "line1": { - "name": "line1", - "check": "string", - "validation": "string", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Address line 1 (e.g., street, PO Box, or company name).", - "undocumented": false, - "html": "Address line 1 (e.g., street, PO Box, or company name)." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "line1" - }, - "line2": { - "name": "line2", - "check": "string", - "validation": "string", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Address line 2 (e.g., apartment, suite, unit, or building).", - "undocumented": false, - "html": "Address line 2 (e.g., apartment, suite, unit, or building)." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "line2" - }, - "postal_code": { - "name": "postal_code", - "check": "string", - "validation": "string", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "ZIP or postal code.", - "undocumented": false, - "html": "ZIP or postal code." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "postal_code" - }, - "state": { - "name": "state", - "check": "string", - "validation": "string", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "State, county, province, or region.", - "undocumented": false, - "html": "State, county, province, or region." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "state" - } - }, - "object_type": "address" - }, - "email": { - "name": "email", - "check": "string", - "validation": "string", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Email address.", - "undocumented": false, - "html": "Email address." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "email" - }, - "name": { - "name": "name", - "check": "string", - "validation": "string", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Full name.", - "undocumented": false, - "html": "Full name." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "name" - }, - "phone": { - "name": "phone", - "check": "string", - "validation": "string", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Billing phone number (including extension).", - "undocumented": false, - "html": "Billing phone number (including extension)." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "phone" - } - }, - "object_type": "billing_details" - }, - "blik": { - "name": "blik", - "check": "hash", - "validation": "hash", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "If this is a `blik` PaymentMethod, this hash contains details about the BLIK payment method.", - "undocumented": false, - "html": "If this is a \u003Ccode\u003Eblik\u003C/code\u003E PaymentMethod, this hash contains details about the BLIK payment method." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "subspec": {}, - "object_type": "blik", - "less_common": true - }, - "boleto": { - "name": "boleto", - "check": "hash", - "validation": "hash", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "If this is a `boleto` PaymentMethod, this hash contains details about the Boleto payment method.", - "undocumented": false, - "html": "If this is a \u003Ccode\u003Eboleto\u003C/code\u003E PaymentMethod, this hash contains details about the Boleto payment method." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "subspec": { - "fingerprint": { - "name": "fingerprint", - "check": "string", - "validation": "string", - "documentation": null, - "gate": true, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "fingerprint" - }, - "tax_id": { - "name": "tax_id", - "check": "string", - "validation": "string", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Uniquely identifies the customer tax id (CNPJ or CPF)", - "undocumented": false, - "html": "Uniquely identifies the customer tax id (CNPJ or CPF)" - }, - "gate": false, - "hide_unset_desc": null, - "required": true, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "tax_id" - } - }, - "object_type": "boleto", - "less_common": true - }, - "card": { - "name": "card", - "check": "hash", - "validation": "hash", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "If this is a `card` PaymentMethod, this hash contains the user's card details.", - "undocumented": false, - "html": "If this is a \u003Ccode\u003Ecard\u003C/code\u003E PaymentMethod, this hash contains the user’s card details." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "subspec": { - "brand": { - "name": "brand", - "check": "string", - "validation": "string", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Card brand. Can be `amex`, `diners`, `discover`, `jcb`, `mastercard`, `unionpay`, `visa`, or `unknown`.", - "undocumented": false, - "html": "Card brand. Can be \u003Ccode\u003Eamex\u003C/code\u003E, \u003Ccode\u003Ediners\u003C/code\u003E, \u003Ccode\u003Ediscover\u003C/code\u003E, \u003Ccode\u003Ejcb\u003C/code\u003E, \u003Ccode\u003Emastercard\u003C/code\u003E, \u003Ccode\u003Eunionpay\u003C/code\u003E, \u003Ccode\u003Evisa\u003C/code\u003E, or \u003Ccode\u003Eunknown\u003C/code\u003E." - }, - "gate": false, - "hide_unset_desc": null, - "required": true, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "brand" - }, - "checks": { - "name": "checks", - "check": "hash", - "validation": "hash", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Checks on Card address and CVC if provided.", - "undocumented": false, - "html": "Checks on Card address and CVC if provided." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "subspec": { - "address_line1_check": { - "name": "address_line1_check", - "check": "string", - "validation": "string", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "If a address line1 was provided, results of the check, one of `pass`, `fail`, `unavailable`, or `unchecked`.", - "undocumented": false, - "html": "If a address line1 was provided, results of the check, one of \u003Ccode\u003Epass\u003C/code\u003E, \u003Ccode\u003Efail\u003C/code\u003E, \u003Ccode\u003Eunavailable\u003C/code\u003E, or \u003Ccode\u003Eunchecked\u003C/code\u003E." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "address_line1_check" - }, - "address_postal_code_check": { - "name": "address_postal_code_check", - "check": "string", - "validation": "string", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "If a address postal code was provided, results of the check, one of `pass`, `fail`, `unavailable`, or `unchecked`.", - "undocumented": false, - "html": "If a address postal code was provided, results of the check, one of \u003Ccode\u003Epass\u003C/code\u003E, \u003Ccode\u003Efail\u003C/code\u003E, \u003Ccode\u003Eunavailable\u003C/code\u003E, or \u003Ccode\u003Eunchecked\u003C/code\u003E." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "address_postal_code_check" - }, - "cvc_check": { - "name": "cvc_check", - "check": "string", - "validation": "string", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "If a CVC was provided, results of the check, one of `pass`, `fail`, `unavailable`, or `unchecked`.", - "undocumented": false, - "html": "If a CVC was provided, results of the check, one of \u003Ccode\u003Epass\u003C/code\u003E, \u003Ccode\u003Efail\u003C/code\u003E, \u003Ccode\u003Eunavailable\u003C/code\u003E, or \u003Ccode\u003Eunchecked\u003C/code\u003E." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "cvc_check" - } - }, - "object_type": "checks" - }, - "country": { - "name": "country", - "check": "string", - "validation": "string", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Two-letter ISO code representing the country of the card. You could use this attribute to get a sense of the international breakdown of cards you've collected.", - "undocumented": false, - "html": "Two-letter ISO code representing the country of the card. You could use this attribute to get a sense of the international breakdown of cards you’ve collected." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "country" - }, - "exp_month": { - "name": "exp_month", - "check": "integer", - "validation": "integer", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Two-digit number representing the card's expiration month.", - "undocumented": false, - "html": "Two-digit number representing the card’s expiration month." - }, - "gate": false, - "hide_unset_desc": null, - "required": true, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "exp_month" - }, - "exp_year": { - "name": "exp_year", - "check": "integer", - "validation": "integer", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Four-digit number representing the card's expiration year.", - "undocumented": false, - "html": "Four-digit number representing the card’s expiration year." - }, - "gate": false, - "hide_unset_desc": null, - "required": true, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "exp_year" - }, - "fingerprint": { - "name": "fingerprint", - "check": "string", - "validation": "string", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Uniquely identifies this particular card number. You can use this attribute to check whether two customers who’ve signed up with you are using the same card number, for example. For payment methods that tokenize card information (Apple Pay, Google Pay), the tokenized number might be provided instead of the underlying card number.\n\n*Starting May 1, 2021, card fingerprint in India for Connect will change to allow two fingerprints for the same card --- one for India and one for the rest of the world.*\n", - "undocumented": false, - "html": "Uniquely identifies this particular card number. You can use this attribute to check whether two customers who’ve signed up with you are using the same card number, for example. For payment methods that tokenize card information (Apple Pay, Google Pay), the tokenized number might be provided instead of the underlying card number.\u003C/p\u003E\n\n\u003Cp\u003E\u003Cem\u003EStarting May 1, 2021, card fingerprint in India for Connect will change to allow two fingerprints for the same card — one for India and one for the rest of the world.\u003C/em\u003E" - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": "card_fingerprint_read", - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "fingerprint" - }, - "funding": { - "name": "funding", - "check": "string", - "validation": "string", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Card funding type. Can be `credit`, `debit`, `prepaid`, or `unknown`.", - "undocumented": false, - "html": "Card funding type. Can be \u003Ccode\u003Ecredit\u003C/code\u003E, \u003Ccode\u003Edebit\u003C/code\u003E, \u003Ccode\u003Eprepaid\u003C/code\u003E, or \u003Ccode\u003Eunknown\u003C/code\u003E." - }, - "gate": false, - "hide_unset_desc": null, - "required": true, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "funding" - }, - "generated_from": { - "name": "generated_from", - "check": "hash", - "validation": "hash", - "documentation": { - "gate_specific": { - "sdk_client_public": { - "gate_specific": {}, - "localize_terms": [], - "undocumented": true, - "html": null - } - }, - "localize_terms": [], - "markdown": "Details of the original PaymentMethod that created this object.", - "undocumented": false, - "html": "Details of the original PaymentMethod that created this object." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "subspec": { - "charge": { - "name": "charge", - "check": "string", - "validation": "string", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "The charge that created this object.", - "undocumented": false, - "html": "The charge that created this object." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "charge" - }, - "payment_method_details": { - "name": "payment_method_details", - "check": "hash", - "validation": "hash", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Transaction-specific details of the payment method used in the payment.", - "undocumented": false, - "html": "Transaction-specific details of the payment method used in the payment." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "subspec": { - "card_present": { - "name": "card_present", - "check": "hash", - "validation": "hash", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "This hash contains the snapshot of the `card_present` transaction-specific details which generated this `card` payment method.", - "undocumented": false, - "html": "This hash contains the snapshot of the \u003Ccode\u003Ecard_present\u003C/code\u003E transaction-specific details which generated this \u003Ccode\u003Ecard\u003C/code\u003E payment method." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "subspec": { - "amount_authorized": { - "name": "amount_authorized", - "check": "integer", - "validation": "integer", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "The authorized amount", - "undocumented": false, - "html": "The authorized amount" - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "amount_authorized" - }, - "brand": { - "name": "brand", - "check": "string", - "validation": "string", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Card brand. Can be `amex`, `diners`, `discover`, `jcb`, `mastercard`, `unionpay`, `visa`, or `unknown`.", - "undocumented": false, - "html": "Card brand. Can be \u003Ccode\u003Eamex\u003C/code\u003E, \u003Ccode\u003Ediners\u003C/code\u003E, \u003Ccode\u003Ediscover\u003C/code\u003E, \u003Ccode\u003Ejcb\u003C/code\u003E, \u003Ccode\u003Emastercard\u003C/code\u003E, \u003Ccode\u003Eunionpay\u003C/code\u003E, \u003Ccode\u003Evisa\u003C/code\u003E, or \u003Ccode\u003Eunknown\u003C/code\u003E." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "brand" - }, - "capture_before": { - "name": "capture_before", - "check": "timestamp", - "validation": "timestamp", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "When using manual capture, a future timestamp after which the charge will be automatically refunded if uncaptured.", - "undocumented": false, - "html": "When using manual capture, a future timestamp after which the charge will be automatically refunded if uncaptured." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "capture_before" - }, - "cardholder_name": { - "name": "cardholder_name", - "check": "string", - "validation": "string", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "The cardholder name as read from the card, in [ISO 7813](https://en.wikipedia.org/wiki/ISO/IEC_7813) format. May include alphanumeric characters, special characters and first/last name separator (`/`). In some cases, the cardholder name may not be available depending on how the issuer has configured the card. Cardholder name is typically not available on swipe or contactless payments, such as those made with Apple Pay and Google Pay.", - "undocumented": false, - "html": "The cardholder name as read from the card, in \u003Ca href=\"https://en.wikipedia.org/wiki/ISO/IEC_7813\"\u003EISO 7813\u003C/a\u003E format. May include alphanumeric characters, special characters and first/last name separator (\u003Ccode\u003E/\u003C/code\u003E). In some cases, the cardholder name may not be available depending on how the issuer has configured the card. Cardholder name is typically not available on swipe or contactless payments, such as those made with Apple Pay and Google Pay." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "cardholder_name" - }, - "country": { - "name": "country", - "check": "string", - "validation": "string", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Two-letter ISO code representing the country of the card. You could use this attribute to get a sense of the international breakdown of cards you've collected.", - "undocumented": false, - "html": "Two-letter ISO code representing the country of the card. You could use this attribute to get a sense of the international breakdown of cards you’ve collected." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "country" - }, - "emv_auth_data": { - "name": "emv_auth_data", - "check": "string", - "validation": "string", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Authorization response cryptogram.", - "undocumented": false, - "html": "Authorization response cryptogram." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "emv_auth_data" - }, - "exp_month": { - "name": "exp_month", - "check": "integer", - "validation": "integer", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Two-digit number representing the card's expiration month.", - "undocumented": false, - "html": "Two-digit number representing the card’s expiration month." - }, - "gate": false, - "hide_unset_desc": null, - "required": true, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "exp_month" - }, - "exp_year": { - "name": "exp_year", - "check": "integer", - "validation": "integer", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Four-digit number representing the card's expiration year.", - "undocumented": false, - "html": "Four-digit number representing the card’s expiration year." - }, - "gate": false, - "hide_unset_desc": null, - "required": true, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "exp_year" - }, - "fingerprint": { - "name": "fingerprint", - "check": "string", - "validation": "string", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Uniquely identifies this particular card number. You can use this attribute to check whether two customers who’ve signed up with you are using the same card number, for example. For payment methods that tokenize card information (Apple Pay, Google Pay), the tokenized number might be provided instead of the underlying card number.\n\n*Starting May 1, 2021, card fingerprint in India for Connect will change to allow two fingerprints for the same card --- one for India and one for the rest of the world.*\n", - "undocumented": false, - "html": "Uniquely identifies this particular card number. You can use this attribute to check whether two customers who’ve signed up with you are using the same card number, for example. For payment methods that tokenize card information (Apple Pay, Google Pay), the tokenized number might be provided instead of the underlying card number.\u003C/p\u003E\n\n\u003Cp\u003E\u003Cem\u003EStarting May 1, 2021, card fingerprint in India for Connect will change to allow two fingerprints for the same card — one for India and one for the rest of the world.\u003C/em\u003E" - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "fingerprint" - }, - "funding": { - "name": "funding", - "check": "string", - "validation": "string", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Card funding type. Can be `credit`, `debit`, `prepaid`, or `unknown`.", - "undocumented": false, - "html": "Card funding type. Can be \u003Ccode\u003Ecredit\u003C/code\u003E, \u003Ccode\u003Edebit\u003C/code\u003E, \u003Ccode\u003Eprepaid\u003C/code\u003E, or \u003Ccode\u003Eunknown\u003C/code\u003E." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "funding" - }, - "generated_card": { - "name": "generated_card", - "check": "string", - "validation": "string", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "ID of a card PaymentMethod generated from the card_present PaymentMethod that may be attached to a Customer for future transactions. Only present if it was possible to generate a card PaymentMethod.", - "undocumented": false, - "html": "ID of a card PaymentMethod generated from the card_present PaymentMethod that may be attached to a Customer for future transactions. Only present if it was possible to generate a card PaymentMethod." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "generated_card" - }, - "incremental_authorization_supported": { - "name": "incremental_authorization_supported", - "check": "boolean", - "validation": "boolean", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Whether this [PaymentIntent](/docs/api/payment_intents) is eligible for incremental authorizations. Request support using [request_incremental_authorization_support](/docs/api/payment_intents/create#create_payment_intent-payment_method_options-card_present-request_incremental_authorization_support).", - "undocumented": false, - "html": "Whether this \u003Ca href=\"/docs/api/payment_intents\"\u003EPaymentIntent\u003C/a\u003E is eligible for incremental authorizations. Request support using \u003Ca href=\"/docs/api/payment_intents/create#create_payment_intent-payment_method_options-card_present-request_incremental_authorization_support\"\u003Erequest_incremental_authorization_support\u003C/a\u003E." - }, - "gate": false, - "hide_unset_desc": null, - "required": true, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "incremental_authorization_supported" - }, - "last4": { - "name": "last4", - "check": "string", - "validation": "string", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "The last four digits of the card.", - "undocumented": false, - "html": "The last four digits of the card." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "last4" - }, - "network": { - "name": "network", - "check": "string", - "validation": "string", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Identifies which network this charge was processed on. Can be `amex`, `cartes_bancaires`, `diners`, `discover`, `interac`, `jcb`, `mastercard`, `unionpay`, `visa`, or `unknown`.", - "undocumented": false, - "html": "Identifies which network this charge was processed on. Can be \u003Ccode\u003Eamex\u003C/code\u003E, \u003Ccode\u003Ecartes_bancaires\u003C/code\u003E, \u003Ccode\u003Ediners\u003C/code\u003E, \u003Ccode\u003Ediscover\u003C/code\u003E, \u003Ccode\u003Einterac\u003C/code\u003E, \u003Ccode\u003Ejcb\u003C/code\u003E, \u003Ccode\u003Emastercard\u003C/code\u003E, \u003Ccode\u003Eunionpay\u003C/code\u003E, \u003Ccode\u003Evisa\u003C/code\u003E, or \u003Ccode\u003Eunknown\u003C/code\u003E." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "network" - }, - "overcapture_supported": { - "name": "overcapture_supported", - "check": "boolean", - "validation": "boolean", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Defines whether the authorized amount can be over-captured or not", - "undocumented": false, - "html": "Defines whether the authorized amount can be over-captured or not" - }, - "gate": false, - "hide_unset_desc": null, - "required": true, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "overcapture_supported" - }, - "read_method": { - "name": "read_method", - "check": "string", - "validation": "string", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "How card details were read in this transaction.", - "undocumented": false, - "html": "How card details were read in this transaction." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "enum_values": { - "contact_emv": { - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Inserting a chip card into the card reader.", - "undocumented": false, - "html": "Inserting a chip card into the card reader." - } - }, - "contactless_emv": { - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Tapping a contactless-enabled chip card or mobile wallet.", - "undocumented": false, - "html": "Tapping a contactless-enabled chip card or mobile wallet." - } - }, - "magnetic_stripe_track2": { - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Swiping a card using the magnetic stripe reader.", - "undocumented": false, - "html": "Swiping a card using the magnetic stripe reader." - } - }, - "magnetic_stripe_fallback": { - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "When inserting a chip card fails three times in a row, fallback to a magnetic stripe read.", - "undocumented": false, - "html": "When inserting a chip card fails three times in a row, fallback to a magnetic stripe read." - } - }, - "contactless_magstripe_mode": { - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Older standard for contactless payments that emulated a magnetic stripe read.", - "undocumented": false, - "html": "Older standard for contactless payments that emulated a magnetic stripe read." - } - } - }, - "object_type": "read_method" - }, - "receipt": { - "name": "receipt", - "check": "hash", - "validation": "hash", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "A collection of fields required to be displayed on receipts. Only required for EMV transactions.", - "undocumented": false, - "html": "A collection of fields required to be displayed on receipts. Only required for EMV transactions." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "subspec": { - "account_type": { - "name": "account_type", - "check": "string", - "validation": "string", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "The type of account being debited or credited", - "undocumented": false, - "html": "The type of account being debited or credited" - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "enum_values": { - "credit": { - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "A credit account, as when using a credit card", - "undocumented": false, - "html": "A credit account, as when using a credit card" - } - }, - "checking": { - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "A checking account, as when using a debit card", - "undocumented": false, - "html": "A checking account, as when using a debit card" - } - }, - "prepaid": { - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "A prepaid account, as when using a debit gift card", - "undocumented": false, - "html": "A prepaid account, as when using a debit gift card" - } - }, - "unknown": { - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "An unknown account", - "undocumented": false, - "html": "An unknown account" - } - } - }, - "object_type": "account_type" - }, - "application_cryptogram": { - "name": "application_cryptogram", - "check": "string", - "validation": "string", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "EMV tag 9F26, cryptogram generated by the integrated circuit chip.", - "undocumented": false, - "html": "EMV tag 9F26, cryptogram generated by the integrated circuit chip." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "application_cryptogram" - }, - "application_preferred_name": { - "name": "application_preferred_name", - "check": "string", - "validation": "string", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Mnenomic of the Application Identifier.", - "undocumented": false, - "html": "Mnenomic of the Application Identifier." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "application_preferred_name" - }, - "authorization_code": { - "name": "authorization_code", - "check": "string", - "validation": "string", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Identifier for this transaction.", - "undocumented": false, - "html": "Identifier for this transaction." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "authorization_code" - }, - "authorization_response_code": { - "name": "authorization_response_code", - "check": "string", - "validation": "string", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "EMV tag 8A. A code returned by the card issuer.", - "undocumented": false, - "html": "EMV tag 8A. A code returned by the card issuer." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "authorization_response_code" - }, - "cardholder_verification_method": { - "name": "cardholder_verification_method", - "check": "string", - "validation": "string", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "How the cardholder verified ownership of the card.", - "undocumented": false, - "html": "How the cardholder verified ownership of the card." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "cardholder_verification_method" - }, - "dedicated_file_name": { - "name": "dedicated_file_name", - "check": "string", - "validation": "string", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "EMV tag 84. Similar to the application identifier stored on the integrated circuit chip.", - "undocumented": false, - "html": "EMV tag 84. Similar to the application identifier stored on the integrated circuit chip." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "dedicated_file_name" - }, - "terminal_verification_results": { - "name": "terminal_verification_results", - "check": "string", - "validation": "string", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "The outcome of a series of EMV functions performed by the card reader.", - "undocumented": false, - "html": "The outcome of a series of EMV functions performed by the card reader." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "terminal_verification_results" - }, - "transaction_status_information": { - "name": "transaction_status_information", - "check": "string", - "validation": "string", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "An indication of various EMV functions performed during the transaction.", - "undocumented": false, - "html": "An indication of various EMV functions performed during the transaction." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "transaction_status_information" - } - }, - "object_type": "receipt" - } - }, - "object_type": "card_present" - }, - "type": { - "name": "type", - "check": "string", - "validation": "string", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "The type of payment method transaction-specific details from the transaction that generated this `card` payment method. Always `card_present`.", - "undocumented": false, - "html": "The type of payment method transaction-specific details from the transaction that generated this \u003Ccode\u003Ecard\u003C/code\u003E payment method. Always \u003Ccode\u003Ecard_present\u003C/code\u003E." - }, - "gate": false, - "hide_unset_desc": null, - "required": true, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "type" - } - }, - "object_type": "payment_method_details" - }, - "setup_attempt": { - "name": "setup_attempt", - "check": "string", - "validation": "string", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "The ID of the SetupAttempt that generated this PaymentMethod, if any.", - "undocumented": false, - "html": "The ID of the SetupAttempt that generated this PaymentMethod, if any." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "user_expandable": ["setup_attempt"], - "object_type": "setup_attempt" - } - }, - "object_type": "generated_from" - }, - "last4": { - "name": "last4", - "check": "string", - "validation": "string", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "The last four digits of the card.", - "undocumented": false, - "html": "The last four digits of the card." - }, - "gate": false, - "hide_unset_desc": null, - "required": true, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "last4" - }, - "networks": { - "name": "networks", - "check": "hash", - "validation": "hash", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Contains information about card networks that can be used to process the payment.", - "undocumented": false, - "html": "Contains information about card networks that can be used to process the payment." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "subspec": { - "available": { - "name": "available", - "check": "string_array", - "validation": "array containing strings", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "All available networks for the card.", - "undocumented": false, - "html": "All available networks for the card." - }, - "gate": false, - "hide_unset_desc": null, - "required": true, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "available" - }, - "preferred": { - "name": "preferred", - "check": "string", - "validation": "string", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "The preferred network for the card.", - "undocumented": false, - "html": "The preferred network for the card." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "preferred" - } - }, - "object_type": "networks" - }, - "three_d_secure_usage": { - "name": "three_d_secure_usage", - "check": "hash", - "validation": "hash", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Contains details on how this Card may be used for 3D Secure authentication.", - "undocumented": false, - "html": "Contains details on how this Card may be used for 3D Secure authentication." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "subspec": { - "supported": { - "name": "supported", - "check": "boolean", - "validation": "boolean", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Whether 3D Secure is supported on this card.", - "undocumented": false, - "html": "Whether 3D Secure is supported on this card." - }, - "gate": false, - "hide_unset_desc": null, - "required": true, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "supported" - } - }, - "object_type": "three_d_secure_usage" - }, - "wallet": { - "name": "wallet", - "check": "hash", - "validation": "hash", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "If this Card is part of a card wallet, this contains the details of the card wallet.", - "undocumented": false, - "html": "If this Card is part of a card wallet, this contains the details of the card wallet." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "subspec": { - "amex_express_checkout": { - "name": "amex_express_checkout", - "check": "hash", - "validation": "hash", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "If this is a `amex_express_checkout` card wallet, this hash contains details about the wallet.", - "undocumented": false, - "html": "If this is a \u003Ccode\u003Eamex_express_checkout\u003C/code\u003E card wallet, this hash contains details about the wallet." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "subspec": {}, - "object_type": "amex_express_checkout" - }, - "apple_pay": { - "name": "apple_pay", - "check": "hash", - "validation": "hash", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "If this is a `apple_pay` card wallet, this hash contains details about the wallet.", - "undocumented": false, - "html": "If this is a \u003Ccode\u003Eapple_pay\u003C/code\u003E card wallet, this hash contains details about the wallet." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "subspec": {}, - "object_type": "apple_pay" - }, - "dynamic_last4": { - "name": "dynamic_last4", - "check": "string", - "validation": "string", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "(For tokenized numbers only.) The last four digits of the device account number.", - "undocumented": false, - "html": "(For tokenized numbers only.) The last four digits of the device account number." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "dynamic_last4" - }, - "google_pay": { - "name": "google_pay", - "check": "hash", - "validation": "hash", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "If this is a `google_pay` card wallet, this hash contains details about the wallet.", - "undocumented": false, - "html": "If this is a \u003Ccode\u003Egoogle_pay\u003C/code\u003E card wallet, this hash contains details about the wallet." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "subspec": {}, - "object_type": "google_pay" - }, - "masterpass": { - "name": "masterpass", - "check": "hash", - "validation": "hash", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "If this is a `masterpass` card wallet, this hash contains details about the wallet.", - "undocumented": false, - "html": "If this is a \u003Ccode\u003Emasterpass\u003C/code\u003E card wallet, this hash contains details about the wallet." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "subspec": { - "billing_address": { - "name": "billing_address", - "check": "hash", - "validation": "hash", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Owner's verified billing address. Values are verified or provided by the wallet directly (if supported) at the time of authorization or settlement. They cannot be set or mutated.", - "undocumented": false, - "html": "Owner’s verified billing address. Values are verified or provided by the wallet directly (if supported) at the time of authorization or settlement. They cannot be set or mutated." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "subspec": { - "city": { - "name": "city", - "check": "string", - "validation": "string", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "City, district, suburb, town, or village.", - "undocumented": false, - "html": "City, district, suburb, town, or village." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "city" - }, - "country": { - "name": "country", - "check": "string", - "validation": "string", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)).", - "undocumented": false, - "html": "Two-letter country code (\u003Ca href=\"https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2\"\u003EISO 3166-1 alpha-2\u003C/a\u003E)." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "country" - }, - "line1": { - "name": "line1", - "check": "string", - "validation": "string", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Address line 1 (e.g., street, PO Box, or company name).", - "undocumented": false, - "html": "Address line 1 (e.g., street, PO Box, or company name)." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "line1" - }, - "line2": { - "name": "line2", - "check": "string", - "validation": "string", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Address line 2 (e.g., apartment, suite, unit, or building).", - "undocumented": false, - "html": "Address line 2 (e.g., apartment, suite, unit, or building)." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "line2" - }, - "postal_code": { - "name": "postal_code", - "check": "string", - "validation": "string", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "ZIP or postal code.", - "undocumented": false, - "html": "ZIP or postal code." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "postal_code" - }, - "state": { - "name": "state", - "check": "string", - "validation": "string", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "State, county, province, or region.", - "undocumented": false, - "html": "State, county, province, or region." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "state" - } - }, - "object_type": "billing_address" - }, - "email": { - "name": "email", - "check": "string", - "validation": "string", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Owner's verified email. Values are verified or provided by the wallet directly (if supported) at the time of authorization or settlement. They cannot be set or mutated.", - "undocumented": false, - "html": "Owner’s verified email. Values are verified or provided by the wallet directly (if supported) at the time of authorization or settlement. They cannot be set or mutated." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "email" - }, - "name": { - "name": "name", - "check": "string", - "validation": "string", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Owner's verified full name. Values are verified or provided by the wallet directly (if supported) at the time of authorization or settlement. They cannot be set or mutated.", - "undocumented": false, - "html": "Owner’s verified full name. Values are verified or provided by the wallet directly (if supported) at the time of authorization or settlement. They cannot be set or mutated." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "name" - }, - "shipping_address": { - "name": "shipping_address", - "check": "hash", - "validation": "hash", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Owner's verified shipping address. Values are verified or provided by the wallet directly (if supported) at the time of authorization or settlement. They cannot be set or mutated.", - "undocumented": false, - "html": "Owner’s verified shipping address. Values are verified or provided by the wallet directly (if supported) at the time of authorization or settlement. They cannot be set or mutated." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "subspec": { - "city": { - "name": "city", - "check": "string", - "validation": "string", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "City, district, suburb, town, or village.", - "undocumented": false, - "html": "City, district, suburb, town, or village." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "city" - }, - "country": { - "name": "country", - "check": "string", - "validation": "string", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)).", - "undocumented": false, - "html": "Two-letter country code (\u003Ca href=\"https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2\"\u003EISO 3166-1 alpha-2\u003C/a\u003E)." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "country" - }, - "line1": { - "name": "line1", - "check": "string", - "validation": "string", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Address line 1 (e.g., street, PO Box, or company name).", - "undocumented": false, - "html": "Address line 1 (e.g., street, PO Box, or company name)." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "line1" - }, - "line2": { - "name": "line2", - "check": "string", - "validation": "string", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Address line 2 (e.g., apartment, suite, unit, or building).", - "undocumented": false, - "html": "Address line 2 (e.g., apartment, suite, unit, or building)." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "line2" - }, - "postal_code": { - "name": "postal_code", - "check": "string", - "validation": "string", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "ZIP or postal code.", - "undocumented": false, - "html": "ZIP or postal code." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "postal_code" - }, - "state": { - "name": "state", - "check": "string", - "validation": "string", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "State, county, province, or region.", - "undocumented": false, - "html": "State, county, province, or region." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "state" - } - }, - "object_type": "shipping_address" - } - }, - "object_type": "masterpass" - }, - "samsung_pay": { - "name": "samsung_pay", - "check": "hash", - "validation": "hash", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "If this is a `samsung_pay` card wallet, this hash contains details about the wallet.", - "undocumented": false, - "html": "If this is a \u003Ccode\u003Esamsung_pay\u003C/code\u003E card wallet, this hash contains details about the wallet." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "subspec": {}, - "object_type": "samsung_pay" - }, - "type": { - "name": "type", - "check": "string", - "validation": "string", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "The type of the card wallet, one of `amex_express_checkout`, `apple_pay`, `google_pay`, `masterpass`, `samsung_pay`, or `visa_checkout`. An additional hash is included on the Wallet subhash with a name matching this value. It contains additional information specific to the card wallet type.", - "undocumented": false, - "html": "The type of the card wallet, one of \u003Ccode\u003Eamex_express_checkout\u003C/code\u003E, \u003Ccode\u003Eapple_pay\u003C/code\u003E, \u003Ccode\u003Egoogle_pay\u003C/code\u003E, \u003Ccode\u003Emasterpass\u003C/code\u003E, \u003Ccode\u003Esamsung_pay\u003C/code\u003E, or \u003Ccode\u003Evisa_checkout\u003C/code\u003E. An additional hash is included on the Wallet subhash with a name matching this value. It contains additional information specific to the card wallet type." - }, - "gate": false, - "hide_unset_desc": null, - "required": true, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "type" - }, - "visa_checkout": { - "name": "visa_checkout", - "check": "hash", - "validation": "hash", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "If this is a `visa_checkout` card wallet, this hash contains details about the wallet.", - "undocumented": false, - "html": "If this is a \u003Ccode\u003Evisa_checkout\u003C/code\u003E card wallet, this hash contains details about the wallet." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "subspec": { - "billing_address": { - "name": "billing_address", - "check": "hash", - "validation": "hash", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Owner's verified billing address. Values are verified or provided by the wallet directly (if supported) at the time of authorization or settlement. They cannot be set or mutated.", - "undocumented": false, - "html": "Owner’s verified billing address. Values are verified or provided by the wallet directly (if supported) at the time of authorization or settlement. They cannot be set or mutated." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "subspec": { - "city": { - "name": "city", - "check": "string", - "validation": "string", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "City, district, suburb, town, or village.", - "undocumented": false, - "html": "City, district, suburb, town, or village." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "city" - }, - "country": { - "name": "country", - "check": "string", - "validation": "string", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)).", - "undocumented": false, - "html": "Two-letter country code (\u003Ca href=\"https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2\"\u003EISO 3166-1 alpha-2\u003C/a\u003E)." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "country" - }, - "line1": { - "name": "line1", - "check": "string", - "validation": "string", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Address line 1 (e.g., street, PO Box, or company name).", - "undocumented": false, - "html": "Address line 1 (e.g., street, PO Box, or company name)." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "line1" - }, - "line2": { - "name": "line2", - "check": "string", - "validation": "string", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Address line 2 (e.g., apartment, suite, unit, or building).", - "undocumented": false, - "html": "Address line 2 (e.g., apartment, suite, unit, or building)." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "line2" - }, - "postal_code": { - "name": "postal_code", - "check": "string", - "validation": "string", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "ZIP or postal code.", - "undocumented": false, - "html": "ZIP or postal code." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "postal_code" - }, - "state": { - "name": "state", - "check": "string", - "validation": "string", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "State, county, province, or region.", - "undocumented": false, - "html": "State, county, province, or region." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "state" - } - }, - "object_type": "billing_address" - }, - "email": { - "name": "email", - "check": "string", - "validation": "string", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Owner's verified email. Values are verified or provided by the wallet directly (if supported) at the time of authorization or settlement. They cannot be set or mutated.", - "undocumented": false, - "html": "Owner’s verified email. Values are verified or provided by the wallet directly (if supported) at the time of authorization or settlement. They cannot be set or mutated." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "email" - }, - "name": { - "name": "name", - "check": "string", - "validation": "string", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Owner's verified full name. Values are verified or provided by the wallet directly (if supported) at the time of authorization or settlement. They cannot be set or mutated.", - "undocumented": false, - "html": "Owner’s verified full name. Values are verified or provided by the wallet directly (if supported) at the time of authorization or settlement. They cannot be set or mutated." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "name" - }, - "shipping_address": { - "name": "shipping_address", - "check": "hash", - "validation": "hash", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Owner's verified shipping address. Values are verified or provided by the wallet directly (if supported) at the time of authorization or settlement. They cannot be set or mutated.", - "undocumented": false, - "html": "Owner’s verified shipping address. Values are verified or provided by the wallet directly (if supported) at the time of authorization or settlement. They cannot be set or mutated." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "subspec": { - "city": { - "name": "city", - "check": "string", - "validation": "string", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "City, district, suburb, town, or village.", - "undocumented": false, - "html": "City, district, suburb, town, or village." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "city" - }, - "country": { - "name": "country", - "check": "string", - "validation": "string", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)).", - "undocumented": false, - "html": "Two-letter country code (\u003Ca href=\"https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2\"\u003EISO 3166-1 alpha-2\u003C/a\u003E)." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "country" - }, - "line1": { - "name": "line1", - "check": "string", - "validation": "string", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Address line 1 (e.g., street, PO Box, or company name).", - "undocumented": false, - "html": "Address line 1 (e.g., street, PO Box, or company name)." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "line1" - }, - "line2": { - "name": "line2", - "check": "string", - "validation": "string", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Address line 2 (e.g., apartment, suite, unit, or building).", - "undocumented": false, - "html": "Address line 2 (e.g., apartment, suite, unit, or building)." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "line2" - }, - "postal_code": { - "name": "postal_code", - "check": "string", - "validation": "string", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "ZIP or postal code.", - "undocumented": false, - "html": "ZIP or postal code." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "postal_code" - }, - "state": { - "name": "state", - "check": "string", - "validation": "string", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "State, county, province, or region.", - "undocumented": false, - "html": "State, county, province, or region." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "state" - } - }, - "object_type": "shipping_address" - } - }, - "object_type": "visa_checkout" - } - }, - "object_type": "wallet" - } - }, - "object_type": "card", - "less_common": true - }, - "card_present": { - "name": "card_present", - "check": "hash", - "validation": "hash", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "If this is a `card_present` PaymentMethod, this hash contains details about the Card Present payment method.", - "undocumented": false, - "html": "If this is a \u003Ccode\u003Ecard_present\u003C/code\u003E PaymentMethod, this hash contains details about the Card Present payment method." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "subspec": { - "brand": { - "name": "brand", - "check": "string", - "validation": "string", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Card brand. Can be `amex`, `diners`, `discover`, `jcb`, `mastercard`, `unionpay`, `visa`, or `unknown`.", - "undocumented": false, - "html": "Card brand. Can be \u003Ccode\u003Eamex\u003C/code\u003E, \u003Ccode\u003Ediners\u003C/code\u003E, \u003Ccode\u003Ediscover\u003C/code\u003E, \u003Ccode\u003Ejcb\u003C/code\u003E, \u003Ccode\u003Emastercard\u003C/code\u003E, \u003Ccode\u003Eunionpay\u003C/code\u003E, \u003Ccode\u003Evisa\u003C/code\u003E, or \u003Ccode\u003Eunknown\u003C/code\u003E." - }, - "gate": true, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "brand" - }, - "cardholder_name": { - "name": "cardholder_name", - "check": "string", - "validation": "string", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "The cardholder name as read from the card, in [ISO 7813](https://en.wikipedia.org/wiki/ISO/IEC_7813) format. May include alphanumeric characters, special characters and first/last name separator (`/`). In some cases, the cardholder name may not be available depending on how the issuer has configured the card. Cardholder name is typically not available on swipe or contactless payments, such as those made with Apple Pay and Google Pay.", - "undocumented": false, - "html": "The cardholder name as read from the card, in \u003Ca href=\"https://en.wikipedia.org/wiki/ISO/IEC_7813\"\u003EISO 7813\u003C/a\u003E format. May include alphanumeric characters, special characters and first/last name separator (\u003Ccode\u003E/\u003C/code\u003E). In some cases, the cardholder name may not be available depending on how the issuer has configured the card. Cardholder name is typically not available on swipe or contactless payments, such as those made with Apple Pay and Google Pay." - }, - "gate": true, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "cardholder_name" - }, - "country": { - "name": "country", - "check": "string", - "validation": "string", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Two-letter ISO code representing the country of the card. You could use this attribute to get a sense of the international breakdown of cards you've collected.", - "undocumented": false, - "html": "Two-letter ISO code representing the country of the card. You could use this attribute to get a sense of the international breakdown of cards you’ve collected." - }, - "gate": true, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "country" - }, - "exp_month": { - "name": "exp_month", - "check": "integer", - "validation": "integer", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Two-digit number representing the card's expiration month.", - "undocumented": false, - "html": "Two-digit number representing the card’s expiration month." - }, - "gate": true, - "hide_unset_desc": null, - "required": true, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "exp_month" - }, - "exp_year": { - "name": "exp_year", - "check": "integer", - "validation": "integer", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Four-digit number representing the card's expiration year.", - "undocumented": false, - "html": "Four-digit number representing the card’s expiration year." - }, - "gate": true, - "hide_unset_desc": null, - "required": true, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "exp_year" - }, - "fingerprint": { - "name": "fingerprint", - "check": "string", - "validation": "string", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Uniquely identifies this particular card number. You can use this attribute to check whether two customers who’ve signed up with you are using the same card number, for example. For payment methods that tokenize card information (Apple Pay, Google Pay), the tokenized number might be provided instead of the underlying card number.\n\n*Starting May 1, 2021, card fingerprint in India for Connect will change to allow two fingerprints for the same card --- one for India and one for the rest of the world.*\n", - "undocumented": false, - "html": "Uniquely identifies this particular card number. You can use this attribute to check whether two customers who’ve signed up with you are using the same card number, for example. For payment methods that tokenize card information (Apple Pay, Google Pay), the tokenized number might be provided instead of the underlying card number.\u003C/p\u003E\n\n\u003Cp\u003E\u003Cem\u003EStarting May 1, 2021, card fingerprint in India for Connect will change to allow two fingerprints for the same card — one for India and one for the rest of the world.\u003C/em\u003E" - }, - "gate": true, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "fingerprint" - }, - "funding": { - "name": "funding", - "check": "string", - "validation": "string", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Card funding type. Can be `credit`, `debit`, `prepaid`, or `unknown`.", - "undocumented": false, - "html": "Card funding type. Can be \u003Ccode\u003Ecredit\u003C/code\u003E, \u003Ccode\u003Edebit\u003C/code\u003E, \u003Ccode\u003Eprepaid\u003C/code\u003E, or \u003Ccode\u003Eunknown\u003C/code\u003E." - }, - "gate": true, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "funding" - }, - "last4": { - "name": "last4", - "check": "string", - "validation": "string", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "The last four digits of the card.", - "undocumented": false, - "html": "The last four digits of the card." - }, - "gate": true, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "last4" - }, - "networks": { - "name": "networks", - "check": "hash", - "validation": "hash", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Contains information about card networks that can be used to process the payment.", - "undocumented": false, - "html": "Contains information about card networks that can be used to process the payment." - }, - "gate": true, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "subspec": { - "available": { - "name": "available", - "check": "string_array", - "validation": "array containing strings", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "All available networks for the card.", - "undocumented": false, - "html": "All available networks for the card." - }, - "gate": false, - "hide_unset_desc": null, - "required": true, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "available" - }, - "preferred": { - "name": "preferred", - "check": "string", - "validation": "string", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "The preferred network for the card.", - "undocumented": false, - "html": "The preferred network for the card." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "preferred" - } - }, - "object_type": "networks" - }, - "read_method": { - "name": "read_method", - "check": "string", - "validation": "string", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "How card details were read in this transaction.", - "undocumented": false, - "html": "How card details were read in this transaction." - }, - "gate": true, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "enum_values": { - "contact_emv": { - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Inserting a chip card into the card reader.", - "undocumented": false, - "html": "Inserting a chip card into the card reader." - } - }, - "contactless_emv": { - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Tapping a contactless-enabled chip card or mobile wallet.", - "undocumented": false, - "html": "Tapping a contactless-enabled chip card or mobile wallet." - } - }, - "magnetic_stripe_track2": { - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Swiping a card using the magnetic stripe reader.", - "undocumented": false, - "html": "Swiping a card using the magnetic stripe reader." - } - }, - "magnetic_stripe_fallback": { - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "When inserting a chip card fails three times in a row, fallback to a magnetic stripe read.", - "undocumented": false, - "html": "When inserting a chip card fails three times in a row, fallback to a magnetic stripe read." - } - }, - "contactless_magstripe_mode": { - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Older standard for contactless payments that emulated a magnetic stripe read.", - "undocumented": false, - "html": "Older standard for contactless payments that emulated a magnetic stripe read." - } - } - }, - "object_type": "read_method" - } - }, - "object_type": "card_present", - "less_common": true - }, - "created": { - "name": "created", - "check": "timestamp", - "validation": "timestamp", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Time at which the object was created. Measured in seconds since the Unix epoch.", - "undocumented": false, - "html": "Time at which the object was created. Measured in seconds since the Unix epoch." - }, - "gate": false, - "hide_unset_desc": null, - "required": true, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "created", - "less_common": true - }, - "customer": { - "name": "customer", - "check": "string", - "validation": "string", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "The ID of the Customer to which this PaymentMethod is saved. This will not be set when the PaymentMethod has not been saved to a Customer.", - "undocumented": false, - "html": "The ID of the Customer to which this PaymentMethod is saved. This will not be set when the PaymentMethod has not been saved to a Customer." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "user_expandable": ["customer"], - "object_type": "customer" - }, - "customer_balance": { - "name": "customer_balance", - "check": "hash", - "validation": "hash", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "If this is a `customer_balance` PaymentMethod, this hash contains details about the CustomerBalance payment method.", - "undocumented": false, - "html": "If this is a \u003Ccode\u003Ecustomer_balance\u003C/code\u003E PaymentMethod, this hash contains details about the CustomerBalance payment method." - }, - "gate": true, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "subspec": {}, - "object_type": "customer_balance", - "less_common": true - }, - "eps": { - "name": "eps", - "check": "hash", - "validation": "hash", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "If this is an `eps` PaymentMethod, this hash contains details about the EPS payment method.", - "undocumented": false, - "html": "If this is an \u003Ccode\u003Eeps\u003C/code\u003E PaymentMethod, this hash contains details about the EPS payment method." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "subspec": { - "bank": { - "name": "bank", - "check": "string", - "validation": "string", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "The customer's bank. Should be one of `arzte_und_apotheker_bank`, `austrian_anadi_bank_ag`, `bank_austria`, `bankhaus_carl_spangler`, `bankhaus_schelhammer_und_schattera_ag`, `bawag_psk_ag`, `bks_bank_ag`, `brull_kallmus_bank_ag`, `btv_vier_lander_bank`, `capital_bank_grawe_gruppe_ag`, `deutsche_bank_ag`, `dolomitenbank`, `easybank_ag`, `erste_bank_und_sparkassen`, `hypo_alpeadriabank_international_ag`, `hypo_noe_lb_fur_niederosterreich_u_wien`, `hypo_oberosterreich_salzburg_steiermark`, `hypo_tirol_bank_ag`, `hypo_vorarlberg_bank_ag`, `hypo_bank_burgenland_aktiengesellschaft`, `marchfelder_bank`, `oberbank_ag`, `raiffeisen_bankengruppe_osterreich`, `schoellerbank_ag`, `sparda_bank_wien`, `volksbank_gruppe`, `volkskreditbank_ag`, or `vr_bank_braunau`.", - "undocumented": false, - "html": "The customer’s bank. Should be one of \u003Ccode\u003Earzte_und_apotheker_bank\u003C/code\u003E, \u003Ccode\u003Eaustrian_anadi_bank_ag\u003C/code\u003E, \u003Ccode\u003Ebank_austria\u003C/code\u003E, \u003Ccode\u003Ebankhaus_carl_spangler\u003C/code\u003E, \u003Ccode\u003Ebankhaus_schelhammer_und_schattera_ag\u003C/code\u003E, \u003Ccode\u003Ebawag_psk_ag\u003C/code\u003E, \u003Ccode\u003Ebks_bank_ag\u003C/code\u003E, \u003Ccode\u003Ebrull_kallmus_bank_ag\u003C/code\u003E, \u003Ccode\u003Ebtv_vier_lander_bank\u003C/code\u003E, \u003Ccode\u003Ecapital_bank_grawe_gruppe_ag\u003C/code\u003E, \u003Ccode\u003Edeutsche_bank_ag\u003C/code\u003E, \u003Ccode\u003Edolomitenbank\u003C/code\u003E, \u003Ccode\u003Eeasybank_ag\u003C/code\u003E, \u003Ccode\u003Eerste_bank_und_sparkassen\u003C/code\u003E, \u003Ccode\u003Ehypo_alpeadriabank_international_ag\u003C/code\u003E, \u003Ccode\u003Ehypo_noe_lb_fur_niederosterreich_u_wien\u003C/code\u003E, \u003Ccode\u003Ehypo_oberosterreich_salzburg_steiermark\u003C/code\u003E, \u003Ccode\u003Ehypo_tirol_bank_ag\u003C/code\u003E, \u003Ccode\u003Ehypo_vorarlberg_bank_ag\u003C/code\u003E, \u003Ccode\u003Ehypo_bank_burgenland_aktiengesellschaft\u003C/code\u003E, \u003Ccode\u003Emarchfelder_bank\u003C/code\u003E, \u003Ccode\u003Eoberbank_ag\u003C/code\u003E, \u003Ccode\u003Eraiffeisen_bankengruppe_osterreich\u003C/code\u003E, \u003Ccode\u003Eschoellerbank_ag\u003C/code\u003E, \u003Ccode\u003Esparda_bank_wien\u003C/code\u003E, \u003Ccode\u003Evolksbank_gruppe\u003C/code\u003E, \u003Ccode\u003Evolkskreditbank_ag\u003C/code\u003E, or \u003Ccode\u003Evr_bank_braunau\u003C/code\u003E." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "bank" - } - }, - "object_type": "eps", - "less_common": true - }, - "fpx": { - "name": "fpx", - "check": "hash", - "validation": "hash", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "If this is an `fpx` PaymentMethod, this hash contains details about the FPX payment method.", - "undocumented": false, - "html": "If this is an \u003Ccode\u003Efpx\u003C/code\u003E PaymentMethod, this hash contains details about the FPX payment method." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "subspec": { - "bank": { - "name": "bank", - "check": "string", - "validation": "string", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "The customer's bank, if provided. Can be one of `affin_bank`, `agrobank`, `alliance_bank`, `ambank`, `bank_islam`, `bank_muamalat`, `bank_rakyat`, `bsn`, `cimb`, `hong_leong_bank`, `hsbc`, `kfh`, `maybank2u`, `ocbc`, `public_bank`, `rhb`, `standard_chartered`, `uob`, `deutsche_bank`, `maybank2e`, `pb_enterprise`, or `bank_of_china`.", - "undocumented": false, - "html": "The customer’s bank, if provided. Can be one of \u003Ccode\u003Eaffin_bank\u003C/code\u003E, \u003Ccode\u003Eagrobank\u003C/code\u003E, \u003Ccode\u003Ealliance_bank\u003C/code\u003E, \u003Ccode\u003Eambank\u003C/code\u003E, \u003Ccode\u003Ebank_islam\u003C/code\u003E, \u003Ccode\u003Ebank_muamalat\u003C/code\u003E, \u003Ccode\u003Ebank_rakyat\u003C/code\u003E, \u003Ccode\u003Ebsn\u003C/code\u003E, \u003Ccode\u003Ecimb\u003C/code\u003E, \u003Ccode\u003Ehong_leong_bank\u003C/code\u003E, \u003Ccode\u003Ehsbc\u003C/code\u003E, \u003Ccode\u003Ekfh\u003C/code\u003E, \u003Ccode\u003Emaybank2u\u003C/code\u003E, \u003Ccode\u003Eocbc\u003C/code\u003E, \u003Ccode\u003Epublic_bank\u003C/code\u003E, \u003Ccode\u003Erhb\u003C/code\u003E, \u003Ccode\u003Estandard_chartered\u003C/code\u003E, \u003Ccode\u003Euob\u003C/code\u003E, \u003Ccode\u003Edeutsche_bank\u003C/code\u003E, \u003Ccode\u003Emaybank2e\u003C/code\u003E, \u003Ccode\u003Epb_enterprise\u003C/code\u003E, or \u003Ccode\u003Ebank_of_china\u003C/code\u003E." - }, - "gate": false, - "hide_unset_desc": null, - "required": true, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "bank" - } - }, - "object_type": "fpx", - "less_common": true - }, - "giropay": { - "name": "giropay", - "check": "hash", - "validation": "hash", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "If this is a `giropay` PaymentMethod, this hash contains details about the Giropay payment method.", - "undocumented": false, - "html": "If this is a \u003Ccode\u003Egiropay\u003C/code\u003E PaymentMethod, this hash contains details about the Giropay payment method." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "subspec": {}, - "object_type": "giropay", - "less_common": true - }, - "grabpay": { - "name": "grabpay", - "check": "hash", - "validation": "hash", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "If this is a `grabpay` PaymentMethod, this hash contains details about the GrabPay payment method.", - "undocumented": false, - "html": "If this is a \u003Ccode\u003Egrabpay\u003C/code\u003E PaymentMethod, this hash contains details about the GrabPay payment method." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "subspec": {}, - "object_type": "grabpay", - "less_common": true - }, - "ideal": { - "name": "ideal", - "check": "hash", - "validation": "hash", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "If this is an `ideal` PaymentMethod, this hash contains details about the iDEAL payment method.", - "undocumented": false, - "html": "If this is an \u003Ccode\u003Eideal\u003C/code\u003E PaymentMethod, this hash contains details about the iDEAL payment method." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "subspec": { - "bank": { - "name": "bank", - "check": "string", - "validation": "string", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "The customer's bank, if provided. Can be one of `abn_amro`, `asn_bank`, `bunq`, `handelsbanken`, `ing`, `knab`, `moneyou`, `rabobank`, `regiobank`, `revolut`, `sns_bank`, `triodos_bank`, or `van_lanschot`.", - "undocumented": false, - "html": "The customer’s bank, if provided. Can be one of \u003Ccode\u003Eabn_amro\u003C/code\u003E, \u003Ccode\u003Easn_bank\u003C/code\u003E, \u003Ccode\u003Ebunq\u003C/code\u003E, \u003Ccode\u003Ehandelsbanken\u003C/code\u003E, \u003Ccode\u003Eing\u003C/code\u003E, \u003Ccode\u003Eknab\u003C/code\u003E, \u003Ccode\u003Emoneyou\u003C/code\u003E, \u003Ccode\u003Erabobank\u003C/code\u003E, \u003Ccode\u003Eregiobank\u003C/code\u003E, \u003Ccode\u003Erevolut\u003C/code\u003E, \u003Ccode\u003Esns_bank\u003C/code\u003E, \u003Ccode\u003Etriodos_bank\u003C/code\u003E, or \u003Ccode\u003Evan_lanschot\u003C/code\u003E." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "bank" - }, - "bic": { - "name": "bic", - "check": "string", - "validation": "string", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "The Bank Identifier Code of the customer's bank, if the bank was provided.", - "undocumented": false, - "html": "The Bank Identifier Code of the customer’s bank, if the bank was provided." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "bic" - } - }, - "object_type": "ideal", - "less_common": true - }, - "interac_present": { - "name": "interac_present", - "check": "hash", - "validation": "hash", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "If this is an `interac_present` PaymentMethod, this hash contains details about the Interac Present payment method.", - "undocumented": false, - "html": "If this is an \u003Ccode\u003Einterac_present\u003C/code\u003E PaymentMethod, this hash contains details about the Interac Present payment method." - }, - "gate": true, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "subspec": { - "brand": { - "name": "brand", - "check": "string", - "validation": "string", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Card brand. Can be `interac`, `mastercard` or `visa`.", - "undocumented": false, - "html": "Card brand. Can be \u003Ccode\u003Einterac\u003C/code\u003E, \u003Ccode\u003Emastercard\u003C/code\u003E or \u003Ccode\u003Evisa\u003C/code\u003E." - }, - "gate": true, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "brand" - }, - "cardholder_name": { - "name": "cardholder_name", - "check": "string", - "validation": "string", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "The cardholder name as read from the card, in [ISO 7813](https://en.wikipedia.org/wiki/ISO/IEC_7813) format. May include alphanumeric characters, special characters and first/last name separator (`/`). In some cases, the cardholder name may not be available depending on how the issuer has configured the card. Cardholder name is typically not available on swipe or contactless payments, such as those made with Apple Pay and Google Pay.", - "undocumented": false, - "html": "The cardholder name as read from the card, in \u003Ca href=\"https://en.wikipedia.org/wiki/ISO/IEC_7813\"\u003EISO 7813\u003C/a\u003E format. May include alphanumeric characters, special characters and first/last name separator (\u003Ccode\u003E/\u003C/code\u003E). In some cases, the cardholder name may not be available depending on how the issuer has configured the card. Cardholder name is typically not available on swipe or contactless payments, such as those made with Apple Pay and Google Pay." - }, - "gate": true, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "cardholder_name" - }, - "country": { - "name": "country", - "check": "string", - "validation": "string", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Two-letter ISO code representing the country of the card. You could use this attribute to get a sense of the international breakdown of cards you've collected.", - "undocumented": false, - "html": "Two-letter ISO code representing the country of the card. You could use this attribute to get a sense of the international breakdown of cards you’ve collected." - }, - "gate": true, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "country" - }, - "exp_month": { - "name": "exp_month", - "check": "integer", - "validation": "integer", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Two-digit number representing the card's expiration month.", - "undocumented": false, - "html": "Two-digit number representing the card’s expiration month." - }, - "gate": true, - "hide_unset_desc": null, - "required": true, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "exp_month" - }, - "exp_year": { - "name": "exp_year", - "check": "integer", - "validation": "integer", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Four-digit number representing the card's expiration year.", - "undocumented": false, - "html": "Four-digit number representing the card’s expiration year." - }, - "gate": true, - "hide_unset_desc": null, - "required": true, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "exp_year" - }, - "fingerprint": { - "name": "fingerprint", - "check": "string", - "validation": "string", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Uniquely identifies this particular card number. You can use this attribute to check whether two customers who’ve signed up with you are using the same card number, for example. For payment methods that tokenize card information (Apple Pay, Google Pay), the tokenized number might be provided instead of the underlying card number.\n\n*Starting May 1, 2021, card fingerprint in India for Connect will change to allow two fingerprints for the same card --- one for India and one for the rest of the world.*\n", - "undocumented": false, - "html": "Uniquely identifies this particular card number. You can use this attribute to check whether two customers who’ve signed up with you are using the same card number, for example. For payment methods that tokenize card information (Apple Pay, Google Pay), the tokenized number might be provided instead of the underlying card number.\u003C/p\u003E\n\n\u003Cp\u003E\u003Cem\u003EStarting May 1, 2021, card fingerprint in India for Connect will change to allow two fingerprints for the same card — one for India and one for the rest of the world.\u003C/em\u003E" - }, - "gate": true, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "fingerprint" - }, - "funding": { - "name": "funding", - "check": "string", - "validation": "string", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Card funding type. Can be `credit`, `debit`, `prepaid`, or `unknown`.", - "undocumented": false, - "html": "Card funding type. Can be \u003Ccode\u003Ecredit\u003C/code\u003E, \u003Ccode\u003Edebit\u003C/code\u003E, \u003Ccode\u003Eprepaid\u003C/code\u003E, or \u003Ccode\u003Eunknown\u003C/code\u003E." - }, - "gate": true, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "funding" - }, - "last4": { - "name": "last4", - "check": "string", - "validation": "string", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "The last four digits of the card.", - "undocumented": false, - "html": "The last four digits of the card." - }, - "gate": true, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "last4" - }, - "networks": { - "name": "networks", - "check": "hash", - "validation": "hash", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Contains information about card networks that can be used to process the payment.", - "undocumented": false, - "html": "Contains information about card networks that can be used to process the payment." - }, - "gate": true, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "subspec": { - "available": { - "name": "available", - "check": "string_array", - "validation": "array containing strings", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "All available networks for the card.", - "undocumented": false, - "html": "All available networks for the card." - }, - "gate": false, - "hide_unset_desc": null, - "required": true, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "available" - }, - "preferred": { - "name": "preferred", - "check": "string", - "validation": "string", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "The preferred network for the card.", - "undocumented": false, - "html": "The preferred network for the card." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "preferred" - } - }, - "object_type": "networks" - }, - "preferred_locales": { - "name": "preferred_locales", - "check": "string_array", - "validation": "array containing strings", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "EMV tag 5F2D. Preferred languages specified by the integrated circuit chip.", - "undocumented": false, - "html": "EMV tag 5F2D. Preferred languages specified by the integrated circuit chip." - }, - "gate": true, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "preferred_locales" - }, - "read_method": { - "name": "read_method", - "check": "string", - "validation": "string", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "How card details were read in this transaction.", - "undocumented": false, - "html": "How card details were read in this transaction." - }, - "gate": true, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "enum_values": { - "contact_emv": { - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Inserting a chip card into the card reader.", - "undocumented": false, - "html": "Inserting a chip card into the card reader." - } - }, - "contactless_emv": { - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Tapping a contactless-enabled chip card or mobile wallet.", - "undocumented": false, - "html": "Tapping a contactless-enabled chip card or mobile wallet." - } - }, - "magnetic_stripe_track2": { - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Swiping a card using the magnetic stripe reader.", - "undocumented": false, - "html": "Swiping a card using the magnetic stripe reader." - } - }, - "magnetic_stripe_fallback": { - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "When inserting a chip card fails three times in a row, fallback to a magnetic stripe read.", - "undocumented": false, - "html": "When inserting a chip card fails three times in a row, fallback to a magnetic stripe read." - } - }, - "contactless_magstripe_mode": { - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Older standard for contactless payments that emulated a magnetic stripe read.", - "undocumented": false, - "html": "Older standard for contactless payments that emulated a magnetic stripe read." - } - } - }, - "object_type": "read_method" - } - }, - "object_type": "interac_present", - "less_common": true - }, - "klarna": { - "name": "klarna", - "check": "hash", - "validation": "hash", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "If this is a `klarna` PaymentMethod, this hash contains details about the Klarna payment method.", - "undocumented": false, - "html": "If this is a \u003Ccode\u003Eklarna\u003C/code\u003E PaymentMethod, this hash contains details about the Klarna payment method." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "subspec": { - "dob": { - "name": "dob", - "check": "hash", - "validation": "hash", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "The customer's date of birth, if provided.", - "undocumented": false, - "html": "The customer’s date of birth, if provided." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": true, - "subspec": { - "day": { - "name": "day", - "check": "positive_integer", - "validation": "positive integer", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "The day of birth, between 1 and 31.", - "undocumented": false, - "html": "The day of birth, between 1 and 31." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "day" - }, - "month": { - "name": "month", - "check": "positive_integer", - "validation": "positive integer", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "The month of birth, between 1 and 12.", - "undocumented": false, - "html": "The month of birth, between 1 and 12." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "month" - }, - "year": { - "name": "year", - "check": "positive_integer", - "validation": "positive integer", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "The four-digit year of birth.", - "undocumented": false, - "html": "The four-digit year of birth." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "year" - } - }, - "object_type": "dob" - } - }, - "object_type": "klarna", - "less_common": true - }, - "konbini": { - "name": "konbini", - "check": "hash", - "validation": "hash", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "If this is a `konbini` PaymentMethod, this hash contains details about the Konbini payment method.", - "undocumented": false, - "html": "If this is a \u003Ccode\u003Ekonbini\u003C/code\u003E PaymentMethod, this hash contains details about the Konbini payment method." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "subspec": {}, - "object_type": "konbini", - "less_common": true - }, - "link": { - "name": "link", - "check": "hash", - "validation": "hash", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "If this is an `Link` PaymentMethod, this hash contains details about the Link payment method.", - "undocumented": false, - "html": "If this is an \u003Ccode\u003ELink\u003C/code\u003E PaymentMethod, this hash contains details about the Link payment method." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "subspec": { - "email": { - "name": "email", - "check": "string", - "validation": "string", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Account owner's email address.", - "undocumented": false, - "html": "Account owner’s email address." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "email" - }, - "persistent_token": { - "name": "persistent_token", - "check": "string", - "validation": "string", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Token used for persistent Link logins.", - "undocumented": false, - "html": "Token used for persistent Link logins." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "persistent_token" - } - }, - "object_type": "link", - "less_common": true - }, - "livemode": { - "name": "livemode", - "check": "boolean", - "validation": "boolean", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode.", - "undocumented": false, - "html": "Has the value \u003Ccode\u003Etrue\u003C/code\u003E if the object exists in live mode or the value \u003Ccode\u003Efalse\u003C/code\u003E if the object exists in test mode." - }, - "gate": false, - "hide_unset_desc": null, - "required": true, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "livemode", - "less_common": true - }, - "metadata": { - "name": "metadata", - "check": "hash", - "validation": "hash", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Set of [key-value pairs](/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format.", - "undocumented": false, - "html": "Set of \u003Ca href=\"/docs/api/metadata\"\u003Ekey-value pairs\u003C/a\u003E that you can attach to an object. This can be useful for storing additional information about the object in a structured format." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "metadata" - }, - "oxxo": { - "name": "oxxo", - "check": "hash", - "validation": "hash", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "If this is an `oxxo` PaymentMethod, this hash contains details about the OXXO payment method.", - "undocumented": false, - "html": "If this is an \u003Ccode\u003Eoxxo\u003C/code\u003E PaymentMethod, this hash contains details about the OXXO payment method." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "subspec": {}, - "object_type": "oxxo", - "less_common": true - }, - "p24": { - "name": "p24", - "check": "hash", - "validation": "hash", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "If this is a `p24` PaymentMethod, this hash contains details about the P24 payment method.", - "undocumented": false, - "html": "If this is a \u003Ccode\u003Ep24\u003C/code\u003E PaymentMethod, this hash contains details about the P24 payment method." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "subspec": { - "bank": { - "name": "bank", - "check": "string", - "validation": "string", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "The customer's bank, if provided.", - "undocumented": false, - "html": "The customer’s bank, if provided." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "enum_values": { - "ing": { "documentation": null }, - "citi_handlowy": { "documentation": null }, - "tmobile_usbugi_bankowe": { "documentation": null }, - "plus_bank": { "documentation": null }, - "etransfer_pocztowy24": { "documentation": null }, - "banki_spbdzielcze": { "documentation": null }, - "bank_nowy_bfg_sa": { "documentation": null }, - "getin_bank": { "documentation": null }, - "blik": { "documentation": null }, - "noble_pay": { "documentation": null }, - "ideabank": { "documentation": null }, - "envelobank": { "documentation": null }, - "santander_przelew24": { "documentation": null }, - "nest_przelew": { "documentation": null }, - "mbank_mtransfer": { "documentation": null }, - "inteligo": { "documentation": null }, - "pbac_z_ipko": { "documentation": null }, - "bnp_paribas": { "documentation": null }, - "credit_agricole": { "documentation": null }, - "toyota_bank": { "documentation": null }, - "bank_pekao_sa": { "documentation": null }, - "volkswagen_bank": { "documentation": null }, - "bank_millennium": { "documentation": null }, - "alior_bank": { "documentation": null }, - "boz": { "documentation": null } - }, - "object_type": "bank" - } - }, - "object_type": "p24", - "less_common": true - }, - "paynow": { - "name": "paynow", - "check": "hash", - "validation": "hash", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "If this is a `paynow` PaymentMethod, this hash contains details about the PayNow payment method.", - "undocumented": false, - "html": "If this is a \u003Ccode\u003Epaynow\u003C/code\u003E PaymentMethod, this hash contains details about the PayNow payment method." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "subspec": {}, - "object_type": "paynow", - "less_common": true - }, - "pix": { - "name": "pix", - "check": "hash", - "validation": "hash", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "If this is a `pix` PaymentMethod, this hash contains details about the Pix payment method.", - "undocumented": false, - "html": "If this is a \u003Ccode\u003Epix\u003C/code\u003E PaymentMethod, this hash contains details about the Pix payment method." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "subspec": {}, - "object_type": "pix", - "less_common": true - }, - "promptpay": { - "name": "promptpay", - "check": "hash", - "validation": "hash", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "If this is a `promptpay` PaymentMethod, this hash contains details about the PromptPay payment method.", - "undocumented": false, - "html": "If this is a \u003Ccode\u003Epromptpay\u003C/code\u003E PaymentMethod, this hash contains details about the PromptPay payment method." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "subspec": {}, - "object_type": "promptpay", - "less_common": true - }, - "radar_options": { - "name": "radar_options", - "check": "hash", - "validation": "hash", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Options to configure Radar. See [Radar Session](/docs/radar/radar-session) for more information.", - "undocumented": false, - "html": "Options to configure Radar. See \u003Ca href=\"/docs/radar/radar-session\"\u003ERadar Session\u003C/a\u003E for more information." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "subspec": { - "session": { - "name": "session", - "check": "string", - "validation": "string", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "A [Radar Session](/docs/radar/radar-session) is a snapshot of the browser metadata and device details that help Radar make more accurate predictions on your payments.", - "undocumented": false, - "html": "A \u003Ca href=\"/docs/radar/radar-session\"\u003ERadar Session\u003C/a\u003E is a snapshot of the browser metadata and device details that help Radar make more accurate predictions on your payments." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "session" - } - }, - "object_type": "radar_options", - "less_common": true - }, - "sepa_debit": { - "name": "sepa_debit", - "check": "hash", - "validation": "hash", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "If this is a `sepa_debit` PaymentMethod, this hash contains details about the SEPA debit bank account.", - "undocumented": false, - "html": "If this is a \u003Ccode\u003Esepa_debit\u003C/code\u003E PaymentMethod, this hash contains details about the SEPA debit bank account." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "subspec": { - "bank_code": { - "name": "bank_code", - "check": "string", - "validation": "string", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Bank code of bank associated with the bank account.", - "undocumented": false, - "html": "Bank code of bank associated with the bank account." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "bank_code" - }, - "branch_code": { - "name": "branch_code", - "check": "string", - "validation": "string", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Branch code of bank associated with the bank account.", - "undocumented": false, - "html": "Branch code of bank associated with the bank account." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "branch_code" - }, - "country": { - "name": "country", - "check": "string", - "validation": "string", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Two-letter ISO code representing the country the bank account is located in.", - "undocumented": false, - "html": "Two-letter ISO code representing the country the bank account is located in." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "country" - }, - "fingerprint": { - "name": "fingerprint", - "check": "string", - "validation": "string", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Uniquely identifies this particular bank account. You can use this attribute to check whether two bank accounts are the same.", - "undocumented": false, - "html": "Uniquely identifies this particular bank account. You can use this attribute to check whether two bank accounts are the same." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "fingerprint" - }, - "generated_from": { - "name": "generated_from", - "check": "hash", - "validation": "hash", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Information about the object that generated this PaymentMethod.", - "undocumented": false, - "html": "Information about the object that generated this PaymentMethod." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "subspec": { - "charge": { - "name": "charge", - "check": "string", - "validation": "string", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "The ID of the Charge that generated this PaymentMethod, if any.", - "undocumented": false, - "html": "The ID of the Charge that generated this PaymentMethod, if any." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "user_expandable": ["charge"], - "object_type": "charge" - }, - "setup_attempt": { - "name": "setup_attempt", - "check": "string", - "validation": "string", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "The ID of the SetupAttempt that generated this PaymentMethod, if any.", - "undocumented": false, - "html": "The ID of the SetupAttempt that generated this PaymentMethod, if any." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "user_expandable": ["setup_attempt"], - "object_type": "setup_attempt" - } - }, - "object_type": "generated_from" - }, - "last4": { - "name": "last4", - "check": "string", - "validation": "string", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Last four characters of the IBAN.", - "undocumented": false, - "html": "Last four characters of the IBAN." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "last4" - } - }, - "object_type": "sepa_debit", - "less_common": true - }, - "sofort": { - "name": "sofort", - "check": "hash", - "validation": "hash", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "If this is a `sofort` PaymentMethod, this hash contains details about the SOFORT payment method.", - "undocumented": false, - "html": "If this is a \u003Ccode\u003Esofort\u003C/code\u003E PaymentMethod, this hash contains details about the SOFORT payment method." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "subspec": { - "country": { - "name": "country", - "check": "string", - "validation": "string", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Two-letter ISO code representing the country the bank account is located in.", - "undocumented": false, - "html": "Two-letter ISO code representing the country the bank account is located in." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "country" - } - }, - "object_type": "sofort", - "less_common": true - }, - "type": { - "name": "type", - "check": "string", - "validation": "string", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "The type of the PaymentMethod. An additional hash is included on the PaymentMethod with a name matching this value. It contains additional information specific to the PaymentMethod type.", - "undocumented": false, - "html": "The type of the PaymentMethod. An additional hash is included on the PaymentMethod with a name matching this value. It contains additional information specific to the PaymentMethod type." - }, - "gate": false, - "hide_unset_desc": null, - "required": true, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "enum_values": { - "acss_debit": { - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "[Pre-authorized debit payments](/docs/payments/acss-debit) are used to debit Canadian bank accounts through the Automated Clearing Settlement System (ACSS).", - "undocumented": false, - "html": "\u003Ca href=\"/docs/payments/acss-debit\"\u003EPre-authorized debit payments\u003C/a\u003E are used to debit Canadian bank accounts through the Automated Clearing Settlement System (ACSS)." - } - }, - "affirm": { - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "[Affirm](/docs/payments/affirm) is a buy now, pay later payment method in the US.", - "undocumented": false, - "html": "\u003Ca href=\"/docs/payments/affirm\"\u003EAffirm\u003C/a\u003E is a buy now, pay later payment method in the US." - } - }, - "afterpay_clearpay": { - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "[Afterpay / Clearpay](/docs/payments/afterpay-clearpay) is a buy now, pay later payment method used in Australia, Canada, France, New Zealand, Spain, the UK, and the US.", - "undocumented": false, - "html": "\u003Ca href=\"/docs/payments/afterpay-clearpay\"\u003EAfterpay / Clearpay\u003C/a\u003E is a buy now, pay later payment method used in Australia, Canada, France, New Zealand, Spain, the UK, and the US." - } - }, - "alipay": { - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "[Alipay](/docs/payments/alipay) is a digital wallet payment method used in China.", - "undocumented": false, - "html": "\u003Ca href=\"/docs/payments/alipay\"\u003EAlipay\u003C/a\u003E is a digital wallet payment method used in China." - } - }, - "au_becs_debit": { - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "[BECS Direct Debit](/docs/payments/au-becs-debit) is used to debit Australian bank accounts through the Bulk Electronic Clearing System (BECS).", - "undocumented": false, - "html": "\u003Ca href=\"/docs/payments/au-becs-debit\"\u003EBECS Direct Debit\u003C/a\u003E is used to debit Australian bank accounts through the Bulk Electronic Clearing System (BECS)." - } - }, - "bacs_debit": { - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "[Bacs Direct Debit](/docs/payments/payment-methods/bacs-debit) is used to debit UK bank accounts.", - "undocumented": false, - "html": "\u003Ca href=\"/docs/payments/payment-methods/bacs-debit\"\u003EBacs Direct Debit\u003C/a\u003E is used to debit UK bank accounts." - } - }, - "bancontact": { - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "[Bancontact](/docs/payments/bancontact) is a bank redirect payment method used in Belgium.", - "undocumented": false, - "html": "\u003Ca href=\"/docs/payments/bancontact\"\u003EBancontact\u003C/a\u003E is a bank redirect payment method used in Belgium." - } - }, - "blik": { - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "[BLIK](/docs/payments/blik) is a single-use payment method common in Poland.", - "undocumented": false, - "html": "\u003Ca href=\"/docs/payments/blik\"\u003EBLIK\u003C/a\u003E is a single-use payment method common in Poland." - } - }, - "boleto": { - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "[Boleto](/docs/payments/boleto) is a voucher-based payment method used in Brazil.", - "undocumented": false, - "html": "\u003Ca href=\"/docs/payments/boleto\"\u003EBoleto\u003C/a\u003E is a voucher-based payment method used in Brazil." - } - }, - "card": { - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "[Card payments](/docs/payments/payment-methods/overview#cards) are supported through many networks and card brands.", - "undocumented": false, - "html": "\u003Ca href=\"/docs/payments/payment-methods/overview#cards\"\u003ECard payments\u003C/a\u003E are supported through many networks and card brands." - } - }, - "card_present": { - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "[Stripe Terminal](/docs/terminal/payments/collect-payment) is used to collect in-person card payments.", - "undocumented": false, - "html": "\u003Ca href=\"/docs/terminal/payments/collect-payment\"\u003EStripe Terminal\u003C/a\u003E is used to collect in-person card payments." - } - }, - "customer_balance": { - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Uses a customer’s [cash balance](/docs/payments/customer-balance) for the payment.", - "undocumented": false, - "html": "Uses a customer’s \u003Ca href=\"/docs/payments/customer-balance\"\u003Ecash balance\u003C/a\u003E for the payment." - } - }, - "eps": { - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "[EPS](/docs/payments/eps) is an Austria-based bank redirect payment method.", - "undocumented": false, - "html": "\u003Ca href=\"/docs/payments/eps\"\u003EEPS\u003C/a\u003E is an Austria-based bank redirect payment method." - } - }, - "fpx": { - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "[FPX](/docs/payments/fpx) is a Malaysia-based bank redirect payment method.", - "undocumented": false, - "html": "\u003Ca href=\"/docs/payments/fpx\"\u003EFPX\u003C/a\u003E is a Malaysia-based bank redirect payment method." - } - }, - "giropay": { - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "[giropay](/docs/payments/giropay) is a German bank redirect payment method.", - "undocumented": false, - "html": "\u003Ca href=\"/docs/payments/giropay\"\u003Egiropay\u003C/a\u003E is a German bank redirect payment method." - } - }, - "grabpay": { - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "[GrabPay](/docs/payments/grabpay) is a digital wallet payment method used in Southeast Asia.", - "undocumented": false, - "html": "\u003Ca href=\"/docs/payments/grabpay\"\u003EGrabPay\u003C/a\u003E is a digital wallet payment method used in Southeast Asia." - } - }, - "ideal": { - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "[iDEAL](/docs/payments/ideal) is a Netherlands-based bank redirect payment method.", - "undocumented": false, - "html": "\u003Ca href=\"/docs/payments/ideal\"\u003EiDEAL\u003C/a\u003E is a Netherlands-based bank redirect payment method." - } - }, - "interac_present": { - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "[Stripe Terminal](/docs/terminal/payments/collect-payment) accepts [Interac](/docs/terminal/payments/regional?integration-country=CA#interac-payments) debit cards for in-person payments in Canada.", - "undocumented": false, - "html": "\u003Ca href=\"/docs/terminal/payments/collect-payment\"\u003EStripe Terminal\u003C/a\u003E accepts \u003Ca href=\"/docs/terminal/payments/regional?integration-country=CA#interac-payments\"\u003EInterac\u003C/a\u003E debit cards for in-person payments in Canada." - } - }, - "klarna": { - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "[Klarna](/docs/payments/klarna) is a global buy now, pay later payment method.", - "undocumented": false, - "html": "\u003Ca href=\"/docs/payments/klarna\"\u003EKlarna\u003C/a\u003E is a global buy now, pay later payment method." - } - }, - "konbini": { - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "[Konbini](/docs/payments/konbini) is a cash-based voucher payment method used in Japan.", - "undocumented": false, - "html": "\u003Ca href=\"/docs/payments/konbini\"\u003EKonbini\u003C/a\u003E is a cash-based voucher payment method used in Japan." - } - }, - "link": { - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "[Link](/docs/payments/link) allows customers to pay with their saved payment details.", - "undocumented": false, - "html": "\u003Ca href=\"/docs/payments/link\"\u003ELink\u003C/a\u003E allows customers to pay with their saved payment details." - } - }, - "oxxo": { - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "[OXXO](/docs/payments/oxxo) is a cash-based voucher payment method used in Mexico.", - "undocumented": false, - "html": "\u003Ca href=\"/docs/payments/oxxo\"\u003EOXXO\u003C/a\u003E is a cash-based voucher payment method used in Mexico." - } - }, - "p24": { - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "[Przelewy24](/docs/payments/p24) is a bank redirect payment method used in Poland.", - "undocumented": false, - "html": "\u003Ca href=\"/docs/payments/p24\"\u003EPrzelewy24\u003C/a\u003E is a bank redirect payment method used in Poland." - } - }, - "paynow": { - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "[PayNow](/docs/payments/paynow) is a QR code payment method used in Singapore.", - "undocumented": false, - "html": "\u003Ca href=\"/docs/payments/paynow\"\u003EPayNow\u003C/a\u003E is a QR code payment method used in Singapore." - } - }, - "pix": { - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "[Pix](/docs/payments/pix) is an instant bank transfer payment method in Brazil.", - "undocumented": false, - "html": "\u003Ca href=\"/docs/payments/pix\"\u003EPix\u003C/a\u003E is an instant bank transfer payment method in Brazil." - } - }, - "promptpay": { - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "[PromptPay](/docs/payments/promptpay) is an instant funds transfer service popular in Thailand.", - "undocumented": false, - "html": "\u003Ca href=\"/docs/payments/promptpay\"\u003EPromptPay\u003C/a\u003E is an instant funds transfer service popular in Thailand." - } - }, - "sepa_debit": { - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "[SEPA Direct Debit](/docs/payments/sepa-debit) is used to debit bank accounts within the Single Euro Payments Area (SEPA) region.", - "undocumented": false, - "html": "\u003Ca href=\"/docs/payments/sepa-debit\"\u003ESEPA Direct Debit\u003C/a\u003E is used to debit bank accounts within the Single Euro Payments Area (SEPA) region." - } - }, - "sofort": { - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "[Sofort](/docs/payments/sofort) is a bank redirect payment method used in Europe.", - "undocumented": false, - "html": "\u003Ca href=\"/docs/payments/sofort\"\u003ESofort\u003C/a\u003E is a bank redirect payment method used in Europe." - } - }, - "us_bank_account": { - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "[ACH Direct Debit](/docs/payments/ach-debit) is used to debit US bank accounts through the Automated Clearing House (ACH) payments system.", - "undocumented": false, - "html": "\u003Ca href=\"/docs/payments/ach-debit\"\u003EACH Direct Debit\u003C/a\u003E is used to debit US bank accounts through the Automated Clearing House (ACH) payments system." - } - }, - "wechat_pay": { - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "[WeChat Pay](/docs/payments/wechat-pay) is a digital wallet payment method based in China.", - "undocumented": false, - "html": "\u003Ca href=\"/docs/payments/wechat-pay\"\u003EWeChat Pay\u003C/a\u003E is a digital wallet payment method based in China." - } - } - }, - "object_type": "type" - }, - "us_bank_account": { - "name": "us_bank_account", - "check": "hash", - "validation": "hash", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "If this is an `us_bank_account` PaymentMethod, this hash contains details about the US bank account payment method.", - "undocumented": false, - "html": "If this is an \u003Ccode\u003Eus_bank_account\u003C/code\u003E PaymentMethod, this hash contains details about the US bank account payment method." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "subspec": { - "account_holder_type": { - "name": "account_holder_type", - "check": "string", - "validation": "string", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Account holder type: individual or company.", - "undocumented": false, - "html": "Account holder type: individual or company." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "enum_values": { - "individual": { - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Account belongs to an individual", - "undocumented": false, - "html": "Account belongs to an individual" - } - }, - "company": { - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Account belongs to a company", - "undocumented": false, - "html": "Account belongs to a company" - } - } - }, - "object_type": "account_holder_type" - }, - "account_type": { - "name": "account_type", - "check": "string", - "validation": "string", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Account type: checkings or savings. Defaults to checking if omitted.", - "undocumented": false, - "html": "Account type: checkings or savings. Defaults to checking if omitted." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "enum_values": { - "checking": { - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Bank account type is checking", - "undocumented": false, - "html": "Bank account type is checking" - } - }, - "savings": { - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Bank account type is savings", - "undocumented": false, - "html": "Bank account type is savings" - } - } - }, - "object_type": "account_type" - }, - "bank_name": { - "name": "bank_name", - "check": "string", - "validation": "string", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "The name of the bank.", - "undocumented": false, - "html": "The name of the bank." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "bank_name" - }, - "financial_connections_account": { - "name": "financial_connections_account", - "check": "string", - "validation": "string", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "The ID of the Financial Connections Account used to create the payment method.", - "undocumented": false, - "html": "The ID of the Financial Connections Account used to create the payment method." - }, - "gate": true, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "financial_connections_account" - }, - "fingerprint": { - "name": "fingerprint", - "check": "string", - "validation": "string", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Uniquely identifies this particular bank account. You can use this attribute to check whether two bank accounts are the same.", - "undocumented": false, - "html": "Uniquely identifies this particular bank account. You can use this attribute to check whether two bank accounts are the same." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "fingerprint" - }, - "last4": { - "name": "last4", - "check": "string", - "validation": "string", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Last four digits of the bank account number.", - "undocumented": false, - "html": "Last four digits of the bank account number." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "last4" - }, - "networks": { - "name": "networks", - "check": "hash", - "validation": "hash", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Contains information about US bank account networks that can be used.", - "undocumented": false, - "html": "Contains information about US bank account networks that can be used." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "subspec": { - "preferred": { - "name": "preferred", - "check": "string", - "validation": "string", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "The preferred network.", - "undocumented": false, - "html": "The preferred network." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "preferred" - }, - "supported": { - "name": "supported", - "check": "array", - "validation": "array", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "All supported networks.", - "undocumented": false, - "html": "All supported networks." - }, - "gate": false, - "hide_unset_desc": null, - "required": true, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "supported" - } - }, - "object_type": "networks" - }, - "routing_number": { - "name": "routing_number", - "check": "string", - "validation": "string", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Routing number of the bank account.", - "undocumented": false, - "html": "Routing number of the bank account." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "routing_number" - } - }, - "object_type": "us_bank_account", - "less_common": true - }, - "wechat_pay": { - "name": "wechat_pay", - "check": "hash", - "validation": "hash", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "If this is an `wechat_pay` PaymentMethod, this hash contains details about the wechat_pay payment method.", - "undocumented": false, - "html": "If this is an \u003Ccode\u003Ewechat_pay\u003C/code\u003E PaymentMethod, this hash contains details about the wechat_pay payment method." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "subspec": {}, - "object_type": "wechat_pay", - "less_common": true - } - }, - "object_type": "payment_method", - "less_common": true - }, - "payment_method_type": { - "name": "payment_method_type", - "check": "string", - "validation": "string", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "If the error is specific to the type of payment method, the payment method type that had a problem. This field is only populated for invoice-related errors.", - "undocumented": false, - "html": "If the error is specific to the type of payment method, the payment method type that had a problem. This field is only populated for invoice-related errors." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "payment_method_type", - "less_common": true - }, - "request_log_url": { - "name": "request_log_url", - "check": "string", - "validation": "string", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "A URL to the request log entry in your dashboard.", - "undocumented": false, - "html": "A URL to the request log entry in your dashboard." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "request_log_url", - "less_common": true - }, - "setup_intent": { - "name": "setup_intent", - "check": "hash", - "validation": "hash", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "The SetupIntent object for errors returned on a request involving a SetupIntent.", - "undocumented": false, - "html": "The SetupIntent object for errors returned on a request involving a SetupIntent." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "setup_intent", - "less_common": true, - "subspec": { - "id": { - "name": "id", - "check": "string", - "validation": "string", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Unique identifier for the object.", - "undocumented": false, - "html": "Unique identifier for the object." - }, - "gate": false, - "hide_unset_desc": null, - "required": true, - "default": null, - "badge_text": "retrievable with publishable key", - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "id" - }, - "object": { - "name": "object", - "check": "string", - "validation": "string", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "String representing the object's type. Objects of the same type share the same value.", - "undocumented": false, - "html": "String representing the object’s type. Objects of the same type share the same value." - }, - "gate": false, - "hide_unset_desc": null, - "required": true, - "default": null, - "badge_text": "retrievable with publishable key", - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "object", - "less_common": true - }, - "application": { - "name": "application", - "check": "string", - "validation": "string", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "ID of the Connect application that created the SetupIntent.", - "undocumented": false, - "html": "ID of the Connect application that created the SetupIntent." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": "Connect only", - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "user_expandable": ["application"], - "object_type": "application", - "less_common": true - }, - "attach_to_self": { - "name": "attach_to_self", - "check": "boolean", - "validation": "boolean", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "If present, the SetupIntent's payment method will be attached to the in-context Stripe Account.\n\nIt can only be used for this Stripe Account’s own money movement flows like InboundTransfer and OutboundTransfers. It cannot be set to true when setting up a PaymentMethod for a Customer, and defaults to false when attaching a PaymentMethod to a Customer.\n", - "undocumented": false, - "html": "If present, the SetupIntent’s payment method will be attached to the in-context Stripe Account.\u003C/p\u003E\n\n\u003Cp\u003EIt can only be used for this Stripe Account’s own money movement flows like InboundTransfer and OutboundTransfers. It cannot be set to true when setting up a PaymentMethod for a Customer, and defaults to false when attaching a PaymentMethod to a Customer." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "attach_to_self", - "less_common": true - }, - "cancellation_reason": { - "name": "cancellation_reason", - "check": "string", - "validation": "string", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Reason for cancellation of this SetupIntent, one of `abandoned`, `requested_by_customer`, or `duplicate`.", - "undocumented": false, - "html": "Reason for cancellation of this SetupIntent, one of \u003Ccode\u003Eabandoned\u003C/code\u003E, \u003Ccode\u003Erequested_by_customer\u003C/code\u003E, or \u003Ccode\u003Eduplicate\u003C/code\u003E." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": "retrievable with publishable key", - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "cancellation_reason", - "less_common": true - }, - "client_secret": { - "name": "client_secret", - "check": "string", - "validation": "string", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "The client secret of this SetupIntent. Used for client-side retrieval using a publishable key.\n\nThe client secret can be used to complete payment setup from your frontend. It should not be stored, logged, or exposed to anyone other than the customer. Make sure that you have TLS enabled on any page that includes the client secret.", - "undocumented": false, - "html": "The client secret of this SetupIntent. Used for client-side retrieval using a publishable key.\u003C/p\u003E\n\n\u003Cp\u003EThe client secret can be used to complete payment setup from your frontend. It should not be stored, logged, or exposed to anyone other than the customer. Make sure that you have TLS enabled on any page that includes the client secret." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": "retrievable with publishable key", - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "client_secret" - }, - "created": { - "name": "created", - "check": "timestamp", - "validation": "timestamp", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Time at which the object was created. Measured in seconds since the Unix epoch.", - "undocumented": false, - "html": "Time at which the object was created. Measured in seconds since the Unix epoch." - }, - "gate": false, - "hide_unset_desc": null, - "required": true, - "default": null, - "badge_text": "retrievable with publishable key", - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "created", - "less_common": true - }, - "customer": { - "name": "customer", - "check": "string", - "validation": "string", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "ID of the Customer this SetupIntent belongs to, if one exists.\n\nIf present, the SetupIntent's payment method will be attached to the Customer on successful setup. Payment methods attached to other Customers cannot be used with this SetupIntent.\n", - "undocumented": false, - "html": "ID of the Customer this SetupIntent belongs to, if one exists.\u003C/p\u003E\n\n\u003Cp\u003EIf present, the SetupIntent’s payment method will be attached to the Customer on successful setup. Payment methods attached to other Customers cannot be used with this SetupIntent." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "user_expandable": ["customer"], - "object_type": "customer" - }, - "description": { - "name": "description", - "check": "string", - "validation": "string", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "An arbitrary string attached to the object. Often useful for displaying to users.", - "undocumented": false, - "html": "An arbitrary string attached to the object. Often useful for displaying to users." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": "retrievable with publishable key", - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "description" - }, - "flow_directions": { - "name": "flow_directions", - "check": "array", - "validation": "array", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Indicates the directions of money movement for which this payment method is intended to be used.\n\nInclude `inbound` if you intend to use the payment method as the origin to pull funds from. Include `outbound` if you intend to use the payment method as the destination to send funds to. You can include both if you intend to use the payment method for both purposes.\n", - "undocumented": false, - "html": "Indicates the directions of money movement for which this payment method is intended to be used.\u003C/p\u003E\n\n\u003Cp\u003EInclude \u003Ccode\u003Einbound\u003C/code\u003E if you intend to use the payment method as the origin to pull funds from. Include \u003Ccode\u003Eoutbound\u003C/code\u003E if you intend to use the payment method as the destination to send funds to. You can include both if you intend to use the payment method for both purposes." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "flow_directions", - "less_common": true - }, - "last_setup_error": { - "name": "last_setup_error", - "check": "hash", - "validation": "hash", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "The error encountered in the previous SetupIntent confirmation.", - "undocumented": false, - "html": "The error encountered in the previous SetupIntent confirmation." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": "retrievable with publishable key", - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "subspec": { - "code": { - "name": "code", - "check": "string", - "validation": "string", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "For some errors that could be handled programmatically, a short string indicating the [error code](/docs/error-codes) reported.", - "undocumented": false, - "html": "For some errors that could be handled programmatically, a short string indicating the \u003Ca href=\"/docs/error-codes\"\u003Eerror code\u003C/a\u003E reported." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "code" - }, - "decline_code": { - "name": "decline_code", - "check": "string", - "validation": "string", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "For card errors resulting from a card issuer decline, a short string indicating the [card issuer's reason for the decline](/docs/declines#issuer-declines) if they provide one.", - "undocumented": false, - "html": "For card errors resulting from a card issuer decline, a short string indicating the \u003Ca href=\"/docs/declines#issuer-declines\"\u003Ecard issuer’s reason for the decline\u003C/a\u003E if they provide one." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "decline_code" - }, - "doc_url": { - "name": "doc_url", - "check": "string", - "validation": "string", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "A URL to more information about the [error code](/docs/error-codes) reported.", - "undocumented": false, - "html": "A URL to more information about the \u003Ca href=\"/docs/error-codes\"\u003Eerror code\u003C/a\u003E reported." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "doc_url", - "less_common": true - }, - "message": { - "name": "message", - "check": "string", - "validation": "string", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "A human-readable message providing more details about the error. For card errors, these messages can be shown to your users.", - "undocumented": false, - "html": "A human-readable message providing more details about the error. For card errors, these messages can be shown to your users." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "message" - }, - "param": { - "name": "param", - "check": "string", - "validation": "string", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "If the error is parameter-specific, the parameter related to the error. For example, you can use this to display a message near the correct form field.", - "undocumented": false, - "html": "If the error is parameter-specific, the parameter related to the error. For example, you can use this to display a message near the correct form field." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "param" - }, - "payment_method": { - "name": "payment_method", - "check": "hash", - "validation": "hash", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "The PaymentMethod object for errors returned on a request involving a PaymentMethod.", - "undocumented": false, - "html": "The PaymentMethod object for errors returned on a request involving a PaymentMethod." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "subspec": { - "id": { - "name": "id", - "check": "string", - "validation": "string", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Unique identifier for the object.", - "undocumented": false, - "html": "Unique identifier for the object." - }, - "gate": false, - "hide_unset_desc": null, - "required": true, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "id" - }, - "object": { - "name": "object", - "check": "string", - "validation": "string", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "String representing the object's type. Objects of the same type share the same value.", - "undocumented": false, - "html": "String representing the object’s type. Objects of the same type share the same value." - }, - "gate": false, - "hide_unset_desc": null, - "required": true, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "object", - "less_common": true - }, - "acss_debit": { - "name": "acss_debit", - "check": "hash", - "validation": "hash", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "If this is an `acss_debit` PaymentMethod, this hash contains details about the ACSS Debit payment method.", - "undocumented": false, - "html": "If this is an \u003Ccode\u003Eacss_debit\u003C/code\u003E PaymentMethod, this hash contains details about the ACSS Debit payment method." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "subspec": { - "bank_name": { - "name": "bank_name", - "check": "string", - "validation": "string", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Name of the bank associated with the bank account.", - "undocumented": false, - "html": "Name of the bank associated with the bank account." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "bank_name" - }, - "fingerprint": { - "name": "fingerprint", - "check": "string", - "validation": "string", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Uniquely identifies this particular bank account. You can use this attribute to check whether two bank accounts are the same.", - "undocumented": false, - "html": "Uniquely identifies this particular bank account. You can use this attribute to check whether two bank accounts are the same." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "fingerprint" - }, - "institution_number": { - "name": "institution_number", - "check": "string", - "validation": "string", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Institution number of the bank account.", - "undocumented": false, - "html": "Institution number of the bank account." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "institution_number" - }, - "last4": { - "name": "last4", - "check": "string", - "validation": "string", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Last four digits of the bank account number.", - "undocumented": false, - "html": "Last four digits of the bank account number." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "last4" - }, - "transit_number": { - "name": "transit_number", - "check": "string", - "validation": "string", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Transit number of the bank account.", - "undocumented": false, - "html": "Transit number of the bank account." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "transit_number" - } - }, - "object_type": "acss_debit", - "less_common": true - }, - "affirm": { - "name": "affirm", - "check": "hash", - "validation": "hash", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "If this is an `affirm` PaymentMethod, this hash contains details about the Affirm payment method.", - "undocumented": false, - "html": "If this is an \u003Ccode\u003Eaffirm\u003C/code\u003E PaymentMethod, this hash contains details about the Affirm payment method." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "subspec": {}, - "object_type": "affirm", - "less_common": true - }, - "afterpay_clearpay": { - "name": "afterpay_clearpay", - "check": "hash", - "validation": "hash", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "If this is an `AfterpayClearpay` PaymentMethod, this hash contains details about the AfterpayClearpay payment method.", - "undocumented": false, - "html": "If this is an \u003Ccode\u003EAfterpayClearpay\u003C/code\u003E PaymentMethod, this hash contains details about the AfterpayClearpay payment method." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "subspec": {}, - "object_type": "afterpay_clearpay", - "less_common": true - }, - "alipay": { - "name": "alipay", - "check": "hash", - "validation": "hash", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "If this is an `Alipay` PaymentMethod, this hash contains details about the Alipay payment method.", - "undocumented": false, - "html": "If this is an \u003Ccode\u003EAlipay\u003C/code\u003E PaymentMethod, this hash contains details about the Alipay payment method." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "subspec": {}, - "object_type": "alipay", - "less_common": true - }, - "au_becs_debit": { - "name": "au_becs_debit", - "check": "hash", - "validation": "hash", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "If this is an `au_becs_debit` PaymentMethod, this hash contains details about the bank account.", - "undocumented": false, - "html": "If this is an \u003Ccode\u003Eau_becs_debit\u003C/code\u003E PaymentMethod, this hash contains details about the bank account." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "subspec": { - "bsb_number": { - "name": "bsb_number", - "check": "string", - "validation": "string", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Six-digit number identifying bank and branch associated with this bank account.", - "undocumented": false, - "html": "Six-digit number identifying bank and branch associated with this bank account." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "bsb_number" - }, - "fingerprint": { - "name": "fingerprint", - "check": "string", - "validation": "string", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Uniquely identifies this particular bank account. You can use this attribute to check whether two bank accounts are the same.", - "undocumented": false, - "html": "Uniquely identifies this particular bank account. You can use this attribute to check whether two bank accounts are the same." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "fingerprint" - }, - "last4": { - "name": "last4", - "check": "string", - "validation": "string", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Last four digits of the bank account number.", - "undocumented": false, - "html": "Last four digits of the bank account number." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "last4" - } - }, - "object_type": "au_becs_debit", - "less_common": true - }, - "bacs_debit": { - "name": "bacs_debit", - "check": "hash", - "validation": "hash", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "If this is a `bacs_debit` PaymentMethod, this hash contains details about the Bacs Direct Debit bank account.", - "undocumented": false, - "html": "If this is a \u003Ccode\u003Ebacs_debit\u003C/code\u003E PaymentMethod, this hash contains details about the Bacs Direct Debit bank account." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "subspec": { - "fingerprint": { - "name": "fingerprint", - "check": "string", - "validation": "string", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Uniquely identifies this particular bank account. You can use this attribute to check whether two bank accounts are the same.", - "undocumented": false, - "html": "Uniquely identifies this particular bank account. You can use this attribute to check whether two bank accounts are the same." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "fingerprint" - }, - "last4": { - "name": "last4", - "check": "string", - "validation": "string", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Last four digits of the bank account number.", - "undocumented": false, - "html": "Last four digits of the bank account number." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "last4" - }, - "sort_code": { - "name": "sort_code", - "check": "string", - "validation": "string", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Sort code of the bank account. (e.g., `10-20-30`)", - "undocumented": false, - "html": "Sort code of the bank account. (e.g., \u003Ccode\u003E10-20-30\u003C/code\u003E)" - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "sort_code" - } - }, - "object_type": "bacs_debit", - "less_common": true - }, - "bancontact": { - "name": "bancontact", - "check": "hash", - "validation": "hash", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "If this is a `bancontact` PaymentMethod, this hash contains details about the Bancontact payment method.", - "undocumented": false, - "html": "If this is a \u003Ccode\u003Ebancontact\u003C/code\u003E PaymentMethod, this hash contains details about the Bancontact payment method." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "subspec": {}, - "object_type": "bancontact", - "less_common": true - }, - "billing_details": { - "name": "billing_details", - "check": "hash", - "validation": "hash", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Billing information associated with the PaymentMethod that may be used or required by particular types of payment methods.", - "undocumented": false, - "html": "Billing information associated with the PaymentMethod that may be used or required by particular types of payment methods." - }, - "gate": false, - "hide_unset_desc": null, - "required": true, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "subspec": { - "address": { - "name": "address", - "check": "hash", - "validation": "hash", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Billing address.", - "undocumented": false, - "html": "Billing address." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "subspec": { - "city": { - "name": "city", - "check": "string", - "validation": "string", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "City, district, suburb, town, or village.", - "undocumented": false, - "html": "City, district, suburb, town, or village." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "city" - }, - "country": { - "name": "country", - "check": "string", - "validation": "string", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)).", - "undocumented": false, - "html": "Two-letter country code (\u003Ca href=\"https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2\"\u003EISO 3166-1 alpha-2\u003C/a\u003E)." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "country" - }, - "line1": { - "name": "line1", - "check": "string", - "validation": "string", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Address line 1 (e.g., street, PO Box, or company name).", - "undocumented": false, - "html": "Address line 1 (e.g., street, PO Box, or company name)." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "line1" - }, - "line2": { - "name": "line2", - "check": "string", - "validation": "string", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Address line 2 (e.g., apartment, suite, unit, or building).", - "undocumented": false, - "html": "Address line 2 (e.g., apartment, suite, unit, or building)." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "line2" - }, - "postal_code": { - "name": "postal_code", - "check": "string", - "validation": "string", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "ZIP or postal code.", - "undocumented": false, - "html": "ZIP or postal code." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "postal_code" - }, - "state": { - "name": "state", - "check": "string", - "validation": "string", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "State, county, province, or region.", - "undocumented": false, - "html": "State, county, province, or region." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "state" - } - }, - "object_type": "address" - }, - "email": { - "name": "email", - "check": "string", - "validation": "string", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Email address.", - "undocumented": false, - "html": "Email address." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "email" - }, - "name": { - "name": "name", - "check": "string", - "validation": "string", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Full name.", - "undocumented": false, - "html": "Full name." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "name" - }, - "phone": { - "name": "phone", - "check": "string", - "validation": "string", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Billing phone number (including extension).", - "undocumented": false, - "html": "Billing phone number (including extension)." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "phone" - } - }, - "object_type": "billing_details" - }, - "blik": { - "name": "blik", - "check": "hash", - "validation": "hash", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "If this is a `blik` PaymentMethod, this hash contains details about the BLIK payment method.", - "undocumented": false, - "html": "If this is a \u003Ccode\u003Eblik\u003C/code\u003E PaymentMethod, this hash contains details about the BLIK payment method." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "subspec": {}, - "object_type": "blik", - "less_common": true - }, - "boleto": { - "name": "boleto", - "check": "hash", - "validation": "hash", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "If this is a `boleto` PaymentMethod, this hash contains details about the Boleto payment method.", - "undocumented": false, - "html": "If this is a \u003Ccode\u003Eboleto\u003C/code\u003E PaymentMethod, this hash contains details about the Boleto payment method." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "subspec": { - "fingerprint": { - "name": "fingerprint", - "check": "string", - "validation": "string", - "documentation": null, - "gate": true, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "fingerprint" - }, - "tax_id": { - "name": "tax_id", - "check": "string", - "validation": "string", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Uniquely identifies the customer tax id (CNPJ or CPF)", - "undocumented": false, - "html": "Uniquely identifies the customer tax id (CNPJ or CPF)" - }, - "gate": false, - "hide_unset_desc": null, - "required": true, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "tax_id" - } - }, - "object_type": "boleto", - "less_common": true - }, - "card": { - "name": "card", - "check": "hash", - "validation": "hash", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "If this is a `card` PaymentMethod, this hash contains the user's card details.", - "undocumented": false, - "html": "If this is a \u003Ccode\u003Ecard\u003C/code\u003E PaymentMethod, this hash contains the user’s card details." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "subspec": { - "brand": { - "name": "brand", - "check": "string", - "validation": "string", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Card brand. Can be `amex`, `diners`, `discover`, `jcb`, `mastercard`, `unionpay`, `visa`, or `unknown`.", - "undocumented": false, - "html": "Card brand. Can be \u003Ccode\u003Eamex\u003C/code\u003E, \u003Ccode\u003Ediners\u003C/code\u003E, \u003Ccode\u003Ediscover\u003C/code\u003E, \u003Ccode\u003Ejcb\u003C/code\u003E, \u003Ccode\u003Emastercard\u003C/code\u003E, \u003Ccode\u003Eunionpay\u003C/code\u003E, \u003Ccode\u003Evisa\u003C/code\u003E, or \u003Ccode\u003Eunknown\u003C/code\u003E." - }, - "gate": false, - "hide_unset_desc": null, - "required": true, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "brand" - }, - "checks": { - "name": "checks", - "check": "hash", - "validation": "hash", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Checks on Card address and CVC if provided.", - "undocumented": false, - "html": "Checks on Card address and CVC if provided." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "subspec": { - "address_line1_check": { - "name": "address_line1_check", - "check": "string", - "validation": "string", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "If a address line1 was provided, results of the check, one of `pass`, `fail`, `unavailable`, or `unchecked`.", - "undocumented": false, - "html": "If a address line1 was provided, results of the check, one of \u003Ccode\u003Epass\u003C/code\u003E, \u003Ccode\u003Efail\u003C/code\u003E, \u003Ccode\u003Eunavailable\u003C/code\u003E, or \u003Ccode\u003Eunchecked\u003C/code\u003E." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "address_line1_check" - }, - "address_postal_code_check": { - "name": "address_postal_code_check", - "check": "string", - "validation": "string", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "If a address postal code was provided, results of the check, one of `pass`, `fail`, `unavailable`, or `unchecked`.", - "undocumented": false, - "html": "If a address postal code was provided, results of the check, one of \u003Ccode\u003Epass\u003C/code\u003E, \u003Ccode\u003Efail\u003C/code\u003E, \u003Ccode\u003Eunavailable\u003C/code\u003E, or \u003Ccode\u003Eunchecked\u003C/code\u003E." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "address_postal_code_check" - }, - "cvc_check": { - "name": "cvc_check", - "check": "string", - "validation": "string", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "If a CVC was provided, results of the check, one of `pass`, `fail`, `unavailable`, or `unchecked`.", - "undocumented": false, - "html": "If a CVC was provided, results of the check, one of \u003Ccode\u003Epass\u003C/code\u003E, \u003Ccode\u003Efail\u003C/code\u003E, \u003Ccode\u003Eunavailable\u003C/code\u003E, or \u003Ccode\u003Eunchecked\u003C/code\u003E." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "cvc_check" - } - }, - "object_type": "checks" - }, - "country": { - "name": "country", - "check": "string", - "validation": "string", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Two-letter ISO code representing the country of the card. You could use this attribute to get a sense of the international breakdown of cards you've collected.", - "undocumented": false, - "html": "Two-letter ISO code representing the country of the card. You could use this attribute to get a sense of the international breakdown of cards you’ve collected." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "country" - }, - "exp_month": { - "name": "exp_month", - "check": "integer", - "validation": "integer", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Two-digit number representing the card's expiration month.", - "undocumented": false, - "html": "Two-digit number representing the card’s expiration month." - }, - "gate": false, - "hide_unset_desc": null, - "required": true, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "exp_month" - }, - "exp_year": { - "name": "exp_year", - "check": "integer", - "validation": "integer", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Four-digit number representing the card's expiration year.", - "undocumented": false, - "html": "Four-digit number representing the card’s expiration year." - }, - "gate": false, - "hide_unset_desc": null, - "required": true, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "exp_year" - }, - "fingerprint": { - "name": "fingerprint", - "check": "string", - "validation": "string", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Uniquely identifies this particular card number. You can use this attribute to check whether two customers who’ve signed up with you are using the same card number, for example. For payment methods that tokenize card information (Apple Pay, Google Pay), the tokenized number might be provided instead of the underlying card number.\n\n*Starting May 1, 2021, card fingerprint in India for Connect will change to allow two fingerprints for the same card --- one for India and one for the rest of the world.*\n", - "undocumented": false, - "html": "Uniquely identifies this particular card number. You can use this attribute to check whether two customers who’ve signed up with you are using the same card number, for example. For payment methods that tokenize card information (Apple Pay, Google Pay), the tokenized number might be provided instead of the underlying card number.\u003C/p\u003E\n\n\u003Cp\u003E\u003Cem\u003EStarting May 1, 2021, card fingerprint in India for Connect will change to allow two fingerprints for the same card — one for India and one for the rest of the world.\u003C/em\u003E" - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": "card_fingerprint_read", - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "fingerprint" - }, - "funding": { - "name": "funding", - "check": "string", - "validation": "string", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Card funding type. Can be `credit`, `debit`, `prepaid`, or `unknown`.", - "undocumented": false, - "html": "Card funding type. Can be \u003Ccode\u003Ecredit\u003C/code\u003E, \u003Ccode\u003Edebit\u003C/code\u003E, \u003Ccode\u003Eprepaid\u003C/code\u003E, or \u003Ccode\u003Eunknown\u003C/code\u003E." - }, - "gate": false, - "hide_unset_desc": null, - "required": true, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "funding" - }, - "generated_from": { - "name": "generated_from", - "check": "hash", - "validation": "hash", - "documentation": { - "gate_specific": { - "sdk_client_public": { - "gate_specific": {}, - "localize_terms": [], - "undocumented": true, - "html": null - } - }, - "localize_terms": [], - "markdown": "Details of the original PaymentMethod that created this object.", - "undocumented": false, - "html": "Details of the original PaymentMethod that created this object." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "subspec": { - "charge": { - "name": "charge", - "check": "string", - "validation": "string", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "The charge that created this object.", - "undocumented": false, - "html": "The charge that created this object." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "charge" - }, - "payment_method_details": { - "name": "payment_method_details", - "check": "hash", - "validation": "hash", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Transaction-specific details of the payment method used in the payment.", - "undocumented": false, - "html": "Transaction-specific details of the payment method used in the payment." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "subspec": { - "card_present": { - "name": "card_present", - "check": "hash", - "validation": "hash", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "This hash contains the snapshot of the `card_present` transaction-specific details which generated this `card` payment method.", - "undocumented": false, - "html": "This hash contains the snapshot of the \u003Ccode\u003Ecard_present\u003C/code\u003E transaction-specific details which generated this \u003Ccode\u003Ecard\u003C/code\u003E payment method." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "subspec": { - "amount_authorized": { - "name": "amount_authorized", - "check": "integer", - "validation": "integer", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "The authorized amount", - "undocumented": false, - "html": "The authorized amount" - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "amount_authorized" - }, - "brand": { - "name": "brand", - "check": "string", - "validation": "string", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Card brand. Can be `amex`, `diners`, `discover`, `jcb`, `mastercard`, `unionpay`, `visa`, or `unknown`.", - "undocumented": false, - "html": "Card brand. Can be \u003Ccode\u003Eamex\u003C/code\u003E, \u003Ccode\u003Ediners\u003C/code\u003E, \u003Ccode\u003Ediscover\u003C/code\u003E, \u003Ccode\u003Ejcb\u003C/code\u003E, \u003Ccode\u003Emastercard\u003C/code\u003E, \u003Ccode\u003Eunionpay\u003C/code\u003E, \u003Ccode\u003Evisa\u003C/code\u003E, or \u003Ccode\u003Eunknown\u003C/code\u003E." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "brand" - }, - "capture_before": { - "name": "capture_before", - "check": "timestamp", - "validation": "timestamp", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "When using manual capture, a future timestamp after which the charge will be automatically refunded if uncaptured.", - "undocumented": false, - "html": "When using manual capture, a future timestamp after which the charge will be automatically refunded if uncaptured." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "capture_before" - }, - "cardholder_name": { - "name": "cardholder_name", - "check": "string", - "validation": "string", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "The cardholder name as read from the card, in [ISO 7813](https://en.wikipedia.org/wiki/ISO/IEC_7813) format. May include alphanumeric characters, special characters and first/last name separator (`/`). In some cases, the cardholder name may not be available depending on how the issuer has configured the card. Cardholder name is typically not available on swipe or contactless payments, such as those made with Apple Pay and Google Pay.", - "undocumented": false, - "html": "The cardholder name as read from the card, in \u003Ca href=\"https://en.wikipedia.org/wiki/ISO/IEC_7813\"\u003EISO 7813\u003C/a\u003E format. May include alphanumeric characters, special characters and first/last name separator (\u003Ccode\u003E/\u003C/code\u003E). In some cases, the cardholder name may not be available depending on how the issuer has configured the card. Cardholder name is typically not available on swipe or contactless payments, such as those made with Apple Pay and Google Pay." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "cardholder_name" - }, - "country": { - "name": "country", - "check": "string", - "validation": "string", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Two-letter ISO code representing the country of the card. You could use this attribute to get a sense of the international breakdown of cards you've collected.", - "undocumented": false, - "html": "Two-letter ISO code representing the country of the card. You could use this attribute to get a sense of the international breakdown of cards you’ve collected." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "country" - }, - "emv_auth_data": { - "name": "emv_auth_data", - "check": "string", - "validation": "string", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Authorization response cryptogram.", - "undocumented": false, - "html": "Authorization response cryptogram." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "emv_auth_data" - }, - "exp_month": { - "name": "exp_month", - "check": "integer", - "validation": "integer", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Two-digit number representing the card's expiration month.", - "undocumented": false, - "html": "Two-digit number representing the card’s expiration month." - }, - "gate": false, - "hide_unset_desc": null, - "required": true, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "exp_month" - }, - "exp_year": { - "name": "exp_year", - "check": "integer", - "validation": "integer", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Four-digit number representing the card's expiration year.", - "undocumented": false, - "html": "Four-digit number representing the card’s expiration year." - }, - "gate": false, - "hide_unset_desc": null, - "required": true, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "exp_year" - }, - "fingerprint": { - "name": "fingerprint", - "check": "string", - "validation": "string", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Uniquely identifies this particular card number. You can use this attribute to check whether two customers who’ve signed up with you are using the same card number, for example. For payment methods that tokenize card information (Apple Pay, Google Pay), the tokenized number might be provided instead of the underlying card number.\n\n*Starting May 1, 2021, card fingerprint in India for Connect will change to allow two fingerprints for the same card --- one for India and one for the rest of the world.*\n", - "undocumented": false, - "html": "Uniquely identifies this particular card number. You can use this attribute to check whether two customers who’ve signed up with you are using the same card number, for example. For payment methods that tokenize card information (Apple Pay, Google Pay), the tokenized number might be provided instead of the underlying card number.\u003C/p\u003E\n\n\u003Cp\u003E\u003Cem\u003EStarting May 1, 2021, card fingerprint in India for Connect will change to allow two fingerprints for the same card — one for India and one for the rest of the world.\u003C/em\u003E" - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "fingerprint" - }, - "funding": { - "name": "funding", - "check": "string", - "validation": "string", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Card funding type. Can be `credit`, `debit`, `prepaid`, or `unknown`.", - "undocumented": false, - "html": "Card funding type. Can be \u003Ccode\u003Ecredit\u003C/code\u003E, \u003Ccode\u003Edebit\u003C/code\u003E, \u003Ccode\u003Eprepaid\u003C/code\u003E, or \u003Ccode\u003Eunknown\u003C/code\u003E." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "funding" - }, - "generated_card": { - "name": "generated_card", - "check": "string", - "validation": "string", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "ID of a card PaymentMethod generated from the card_present PaymentMethod that may be attached to a Customer for future transactions. Only present if it was possible to generate a card PaymentMethod.", - "undocumented": false, - "html": "ID of a card PaymentMethod generated from the card_present PaymentMethod that may be attached to a Customer for future transactions. Only present if it was possible to generate a card PaymentMethod." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "generated_card" - }, - "incremental_authorization_supported": { - "name": "incremental_authorization_supported", - "check": "boolean", - "validation": "boolean", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Whether this [PaymentIntent](/docs/api/payment_intents) is eligible for incremental authorizations. Request support using [request_incremental_authorization_support](/docs/api/payment_intents/create#create_payment_intent-payment_method_options-card_present-request_incremental_authorization_support).", - "undocumented": false, - "html": "Whether this \u003Ca href=\"/docs/api/payment_intents\"\u003EPaymentIntent\u003C/a\u003E is eligible for incremental authorizations. Request support using \u003Ca href=\"/docs/api/payment_intents/create#create_payment_intent-payment_method_options-card_present-request_incremental_authorization_support\"\u003Erequest_incremental_authorization_support\u003C/a\u003E." - }, - "gate": false, - "hide_unset_desc": null, - "required": true, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "incremental_authorization_supported" - }, - "last4": { - "name": "last4", - "check": "string", - "validation": "string", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "The last four digits of the card.", - "undocumented": false, - "html": "The last four digits of the card." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "last4" - }, - "network": { - "name": "network", - "check": "string", - "validation": "string", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Identifies which network this charge was processed on. Can be `amex`, `cartes_bancaires`, `diners`, `discover`, `interac`, `jcb`, `mastercard`, `unionpay`, `visa`, or `unknown`.", - "undocumented": false, - "html": "Identifies which network this charge was processed on. Can be \u003Ccode\u003Eamex\u003C/code\u003E, \u003Ccode\u003Ecartes_bancaires\u003C/code\u003E, \u003Ccode\u003Ediners\u003C/code\u003E, \u003Ccode\u003Ediscover\u003C/code\u003E, \u003Ccode\u003Einterac\u003C/code\u003E, \u003Ccode\u003Ejcb\u003C/code\u003E, \u003Ccode\u003Emastercard\u003C/code\u003E, \u003Ccode\u003Eunionpay\u003C/code\u003E, \u003Ccode\u003Evisa\u003C/code\u003E, or \u003Ccode\u003Eunknown\u003C/code\u003E." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "network" - }, - "overcapture_supported": { - "name": "overcapture_supported", - "check": "boolean", - "validation": "boolean", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Defines whether the authorized amount can be over-captured or not", - "undocumented": false, - "html": "Defines whether the authorized amount can be over-captured or not" - }, - "gate": false, - "hide_unset_desc": null, - "required": true, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "overcapture_supported" - }, - "read_method": { - "name": "read_method", - "check": "string", - "validation": "string", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "How card details were read in this transaction.", - "undocumented": false, - "html": "How card details were read in this transaction." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "enum_values": { - "contact_emv": { - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Inserting a chip card into the card reader.", - "undocumented": false, - "html": "Inserting a chip card into the card reader." - } - }, - "contactless_emv": { - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Tapping a contactless-enabled chip card or mobile wallet.", - "undocumented": false, - "html": "Tapping a contactless-enabled chip card or mobile wallet." - } - }, - "magnetic_stripe_track2": { - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Swiping a card using the magnetic stripe reader.", - "undocumented": false, - "html": "Swiping a card using the magnetic stripe reader." - } - }, - "magnetic_stripe_fallback": { - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "When inserting a chip card fails three times in a row, fallback to a magnetic stripe read.", - "undocumented": false, - "html": "When inserting a chip card fails three times in a row, fallback to a magnetic stripe read." - } - }, - "contactless_magstripe_mode": { - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Older standard for contactless payments that emulated a magnetic stripe read.", - "undocumented": false, - "html": "Older standard for contactless payments that emulated a magnetic stripe read." - } - } - }, - "object_type": "read_method" - }, - "receipt": { - "name": "receipt", - "check": "hash", - "validation": "hash", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "A collection of fields required to be displayed on receipts. Only required for EMV transactions.", - "undocumented": false, - "html": "A collection of fields required to be displayed on receipts. Only required for EMV transactions." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "subspec": { - "account_type": { - "name": "account_type", - "check": "string", - "validation": "string", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "The type of account being debited or credited", - "undocumented": false, - "html": "The type of account being debited or credited" - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "enum_values": { - "credit": { - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "A credit account, as when using a credit card", - "undocumented": false, - "html": "A credit account, as when using a credit card" - } - }, - "checking": { - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "A checking account, as when using a debit card", - "undocumented": false, - "html": "A checking account, as when using a debit card" - } - }, - "prepaid": { - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "A prepaid account, as when using a debit gift card", - "undocumented": false, - "html": "A prepaid account, as when using a debit gift card" - } - }, - "unknown": { - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "An unknown account", - "undocumented": false, - "html": "An unknown account" - } - } - }, - "object_type": "account_type" - }, - "application_cryptogram": { - "name": "application_cryptogram", - "check": "string", - "validation": "string", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "EMV tag 9F26, cryptogram generated by the integrated circuit chip.", - "undocumented": false, - "html": "EMV tag 9F26, cryptogram generated by the integrated circuit chip." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "application_cryptogram" - }, - "application_preferred_name": { - "name": "application_preferred_name", - "check": "string", - "validation": "string", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Mnenomic of the Application Identifier.", - "undocumented": false, - "html": "Mnenomic of the Application Identifier." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "application_preferred_name" - }, - "authorization_code": { - "name": "authorization_code", - "check": "string", - "validation": "string", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Identifier for this transaction.", - "undocumented": false, - "html": "Identifier for this transaction." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "authorization_code" - }, - "authorization_response_code": { - "name": "authorization_response_code", - "check": "string", - "validation": "string", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "EMV tag 8A. A code returned by the card issuer.", - "undocumented": false, - "html": "EMV tag 8A. A code returned by the card issuer." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "authorization_response_code" - }, - "cardholder_verification_method": { - "name": "cardholder_verification_method", - "check": "string", - "validation": "string", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "How the cardholder verified ownership of the card.", - "undocumented": false, - "html": "How the cardholder verified ownership of the card." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "cardholder_verification_method" - }, - "dedicated_file_name": { - "name": "dedicated_file_name", - "check": "string", - "validation": "string", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "EMV tag 84. Similar to the application identifier stored on the integrated circuit chip.", - "undocumented": false, - "html": "EMV tag 84. Similar to the application identifier stored on the integrated circuit chip." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "dedicated_file_name" - }, - "terminal_verification_results": { - "name": "terminal_verification_results", - "check": "string", - "validation": "string", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "The outcome of a series of EMV functions performed by the card reader.", - "undocumented": false, - "html": "The outcome of a series of EMV functions performed by the card reader." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "terminal_verification_results" - }, - "transaction_status_information": { - "name": "transaction_status_information", - "check": "string", - "validation": "string", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "An indication of various EMV functions performed during the transaction.", - "undocumented": false, - "html": "An indication of various EMV functions performed during the transaction." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "transaction_status_information" - } - }, - "object_type": "receipt" - } - }, - "object_type": "card_present" - }, - "type": { - "name": "type", - "check": "string", - "validation": "string", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "The type of payment method transaction-specific details from the transaction that generated this `card` payment method. Always `card_present`.", - "undocumented": false, - "html": "The type of payment method transaction-specific details from the transaction that generated this \u003Ccode\u003Ecard\u003C/code\u003E payment method. Always \u003Ccode\u003Ecard_present\u003C/code\u003E." - }, - "gate": false, - "hide_unset_desc": null, - "required": true, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "type" - } - }, - "object_type": "payment_method_details" - }, - "setup_attempt": { - "name": "setup_attempt", - "check": "string", - "validation": "string", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "The ID of the SetupAttempt that generated this PaymentMethod, if any.", - "undocumented": false, - "html": "The ID of the SetupAttempt that generated this PaymentMethod, if any." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "user_expandable": ["setup_attempt"], - "object_type": "setup_attempt" - } - }, - "object_type": "generated_from" - }, - "last4": { - "name": "last4", - "check": "string", - "validation": "string", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "The last four digits of the card.", - "undocumented": false, - "html": "The last four digits of the card." - }, - "gate": false, - "hide_unset_desc": null, - "required": true, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "last4" - }, - "networks": { - "name": "networks", - "check": "hash", - "validation": "hash", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Contains information about card networks that can be used to process the payment.", - "undocumented": false, - "html": "Contains information about card networks that can be used to process the payment." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "subspec": { - "available": { - "name": "available", - "check": "string_array", - "validation": "array containing strings", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "All available networks for the card.", - "undocumented": false, - "html": "All available networks for the card." - }, - "gate": false, - "hide_unset_desc": null, - "required": true, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "available" - }, - "preferred": { - "name": "preferred", - "check": "string", - "validation": "string", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "The preferred network for the card.", - "undocumented": false, - "html": "The preferred network for the card." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "preferred" - } - }, - "object_type": "networks" - }, - "three_d_secure_usage": { - "name": "three_d_secure_usage", - "check": "hash", - "validation": "hash", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Contains details on how this Card may be used for 3D Secure authentication.", - "undocumented": false, - "html": "Contains details on how this Card may be used for 3D Secure authentication." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "subspec": { - "supported": { - "name": "supported", - "check": "boolean", - "validation": "boolean", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Whether 3D Secure is supported on this card.", - "undocumented": false, - "html": "Whether 3D Secure is supported on this card." - }, - "gate": false, - "hide_unset_desc": null, - "required": true, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "supported" - } - }, - "object_type": "three_d_secure_usage" - }, - "wallet": { - "name": "wallet", - "check": "hash", - "validation": "hash", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "If this Card is part of a card wallet, this contains the details of the card wallet.", - "undocumented": false, - "html": "If this Card is part of a card wallet, this contains the details of the card wallet." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "subspec": { - "amex_express_checkout": { - "name": "amex_express_checkout", - "check": "hash", - "validation": "hash", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "If this is a `amex_express_checkout` card wallet, this hash contains details about the wallet.", - "undocumented": false, - "html": "If this is a \u003Ccode\u003Eamex_express_checkout\u003C/code\u003E card wallet, this hash contains details about the wallet." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "subspec": {}, - "object_type": "amex_express_checkout" - }, - "apple_pay": { - "name": "apple_pay", - "check": "hash", - "validation": "hash", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "If this is a `apple_pay` card wallet, this hash contains details about the wallet.", - "undocumented": false, - "html": "If this is a \u003Ccode\u003Eapple_pay\u003C/code\u003E card wallet, this hash contains details about the wallet." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "subspec": {}, - "object_type": "apple_pay" - }, - "dynamic_last4": { - "name": "dynamic_last4", - "check": "string", - "validation": "string", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "(For tokenized numbers only.) The last four digits of the device account number.", - "undocumented": false, - "html": "(For tokenized numbers only.) The last four digits of the device account number." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "dynamic_last4" - }, - "google_pay": { - "name": "google_pay", - "check": "hash", - "validation": "hash", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "If this is a `google_pay` card wallet, this hash contains details about the wallet.", - "undocumented": false, - "html": "If this is a \u003Ccode\u003Egoogle_pay\u003C/code\u003E card wallet, this hash contains details about the wallet." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "subspec": {}, - "object_type": "google_pay" - }, - "masterpass": { - "name": "masterpass", - "check": "hash", - "validation": "hash", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "If this is a `masterpass` card wallet, this hash contains details about the wallet.", - "undocumented": false, - "html": "If this is a \u003Ccode\u003Emasterpass\u003C/code\u003E card wallet, this hash contains details about the wallet." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "subspec": { - "billing_address": { - "name": "billing_address", - "check": "hash", - "validation": "hash", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Owner's verified billing address. Values are verified or provided by the wallet directly (if supported) at the time of authorization or settlement. They cannot be set or mutated.", - "undocumented": false, - "html": "Owner’s verified billing address. Values are verified or provided by the wallet directly (if supported) at the time of authorization or settlement. They cannot be set or mutated." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "subspec": { - "city": { - "name": "city", - "check": "string", - "validation": "string", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "City, district, suburb, town, or village.", - "undocumented": false, - "html": "City, district, suburb, town, or village." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "city" - }, - "country": { - "name": "country", - "check": "string", - "validation": "string", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)).", - "undocumented": false, - "html": "Two-letter country code (\u003Ca href=\"https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2\"\u003EISO 3166-1 alpha-2\u003C/a\u003E)." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "country" - }, - "line1": { - "name": "line1", - "check": "string", - "validation": "string", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Address line 1 (e.g., street, PO Box, or company name).", - "undocumented": false, - "html": "Address line 1 (e.g., street, PO Box, or company name)." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "line1" - }, - "line2": { - "name": "line2", - "check": "string", - "validation": "string", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Address line 2 (e.g., apartment, suite, unit, or building).", - "undocumented": false, - "html": "Address line 2 (e.g., apartment, suite, unit, or building)." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "line2" - }, - "postal_code": { - "name": "postal_code", - "check": "string", - "validation": "string", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "ZIP or postal code.", - "undocumented": false, - "html": "ZIP or postal code." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "postal_code" - }, - "state": { - "name": "state", - "check": "string", - "validation": "string", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "State, county, province, or region.", - "undocumented": false, - "html": "State, county, province, or region." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "state" - } - }, - "object_type": "billing_address" - }, - "email": { - "name": "email", - "check": "string", - "validation": "string", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Owner's verified email. Values are verified or provided by the wallet directly (if supported) at the time of authorization or settlement. They cannot be set or mutated.", - "undocumented": false, - "html": "Owner’s verified email. Values are verified or provided by the wallet directly (if supported) at the time of authorization or settlement. They cannot be set or mutated." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "email" - }, - "name": { - "name": "name", - "check": "string", - "validation": "string", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Owner's verified full name. Values are verified or provided by the wallet directly (if supported) at the time of authorization or settlement. They cannot be set or mutated.", - "undocumented": false, - "html": "Owner’s verified full name. Values are verified or provided by the wallet directly (if supported) at the time of authorization or settlement. They cannot be set or mutated." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "name" - }, - "shipping_address": { - "name": "shipping_address", - "check": "hash", - "validation": "hash", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Owner's verified shipping address. Values are verified or provided by the wallet directly (if supported) at the time of authorization or settlement. They cannot be set or mutated.", - "undocumented": false, - "html": "Owner’s verified shipping address. Values are verified or provided by the wallet directly (if supported) at the time of authorization or settlement. They cannot be set or mutated." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "subspec": { - "city": { - "name": "city", - "check": "string", - "validation": "string", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "City, district, suburb, town, or village.", - "undocumented": false, - "html": "City, district, suburb, town, or village." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "city" - }, - "country": { - "name": "country", - "check": "string", - "validation": "string", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)).", - "undocumented": false, - "html": "Two-letter country code (\u003Ca href=\"https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2\"\u003EISO 3166-1 alpha-2\u003C/a\u003E)." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "country" - }, - "line1": { - "name": "line1", - "check": "string", - "validation": "string", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Address line 1 (e.g., street, PO Box, or company name).", - "undocumented": false, - "html": "Address line 1 (e.g., street, PO Box, or company name)." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "line1" - }, - "line2": { - "name": "line2", - "check": "string", - "validation": "string", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Address line 2 (e.g., apartment, suite, unit, or building).", - "undocumented": false, - "html": "Address line 2 (e.g., apartment, suite, unit, or building)." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "line2" - }, - "postal_code": { - "name": "postal_code", - "check": "string", - "validation": "string", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "ZIP or postal code.", - "undocumented": false, - "html": "ZIP or postal code." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "postal_code" - }, - "state": { - "name": "state", - "check": "string", - "validation": "string", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "State, county, province, or region.", - "undocumented": false, - "html": "State, county, province, or region." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "state" - } - }, - "object_type": "shipping_address" - } - }, - "object_type": "masterpass" - }, - "samsung_pay": { - "name": "samsung_pay", - "check": "hash", - "validation": "hash", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "If this is a `samsung_pay` card wallet, this hash contains details about the wallet.", - "undocumented": false, - "html": "If this is a \u003Ccode\u003Esamsung_pay\u003C/code\u003E card wallet, this hash contains details about the wallet." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "subspec": {}, - "object_type": "samsung_pay" - }, - "type": { - "name": "type", - "check": "string", - "validation": "string", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "The type of the card wallet, one of `amex_express_checkout`, `apple_pay`, `google_pay`, `masterpass`, `samsung_pay`, or `visa_checkout`. An additional hash is included on the Wallet subhash with a name matching this value. It contains additional information specific to the card wallet type.", - "undocumented": false, - "html": "The type of the card wallet, one of \u003Ccode\u003Eamex_express_checkout\u003C/code\u003E, \u003Ccode\u003Eapple_pay\u003C/code\u003E, \u003Ccode\u003Egoogle_pay\u003C/code\u003E, \u003Ccode\u003Emasterpass\u003C/code\u003E, \u003Ccode\u003Esamsung_pay\u003C/code\u003E, or \u003Ccode\u003Evisa_checkout\u003C/code\u003E. An additional hash is included on the Wallet subhash with a name matching this value. It contains additional information specific to the card wallet type." - }, - "gate": false, - "hide_unset_desc": null, - "required": true, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "type" - }, - "visa_checkout": { - "name": "visa_checkout", - "check": "hash", - "validation": "hash", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "If this is a `visa_checkout` card wallet, this hash contains details about the wallet.", - "undocumented": false, - "html": "If this is a \u003Ccode\u003Evisa_checkout\u003C/code\u003E card wallet, this hash contains details about the wallet." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "subspec": { - "billing_address": { - "name": "billing_address", - "check": "hash", - "validation": "hash", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Owner's verified billing address. Values are verified or provided by the wallet directly (if supported) at the time of authorization or settlement. They cannot be set or mutated.", - "undocumented": false, - "html": "Owner’s verified billing address. Values are verified or provided by the wallet directly (if supported) at the time of authorization or settlement. They cannot be set or mutated." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "subspec": { - "city": { - "name": "city", - "check": "string", - "validation": "string", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "City, district, suburb, town, or village.", - "undocumented": false, - "html": "City, district, suburb, town, or village." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "city" - }, - "country": { - "name": "country", - "check": "string", - "validation": "string", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)).", - "undocumented": false, - "html": "Two-letter country code (\u003Ca href=\"https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2\"\u003EISO 3166-1 alpha-2\u003C/a\u003E)." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "country" - }, - "line1": { - "name": "line1", - "check": "string", - "validation": "string", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Address line 1 (e.g., street, PO Box, or company name).", - "undocumented": false, - "html": "Address line 1 (e.g., street, PO Box, or company name)." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "line1" - }, - "line2": { - "name": "line2", - "check": "string", - "validation": "string", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Address line 2 (e.g., apartment, suite, unit, or building).", - "undocumented": false, - "html": "Address line 2 (e.g., apartment, suite, unit, or building)." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "line2" - }, - "postal_code": { - "name": "postal_code", - "check": "string", - "validation": "string", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "ZIP or postal code.", - "undocumented": false, - "html": "ZIP or postal code." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "postal_code" - }, - "state": { - "name": "state", - "check": "string", - "validation": "string", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "State, county, province, or region.", - "undocumented": false, - "html": "State, county, province, or region." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "state" - } - }, - "object_type": "billing_address" - }, - "email": { - "name": "email", - "check": "string", - "validation": "string", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Owner's verified email. Values are verified or provided by the wallet directly (if supported) at the time of authorization or settlement. They cannot be set or mutated.", - "undocumented": false, - "html": "Owner’s verified email. Values are verified or provided by the wallet directly (if supported) at the time of authorization or settlement. They cannot be set or mutated." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "email" - }, - "name": { - "name": "name", - "check": "string", - "validation": "string", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Owner's verified full name. Values are verified or provided by the wallet directly (if supported) at the time of authorization or settlement. They cannot be set or mutated.", - "undocumented": false, - "html": "Owner’s verified full name. Values are verified or provided by the wallet directly (if supported) at the time of authorization or settlement. They cannot be set or mutated." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "name" - }, - "shipping_address": { - "name": "shipping_address", - "check": "hash", - "validation": "hash", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Owner's verified shipping address. Values are verified or provided by the wallet directly (if supported) at the time of authorization or settlement. They cannot be set or mutated.", - "undocumented": false, - "html": "Owner’s verified shipping address. Values are verified or provided by the wallet directly (if supported) at the time of authorization or settlement. They cannot be set or mutated." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "subspec": { - "city": { - "name": "city", - "check": "string", - "validation": "string", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "City, district, suburb, town, or village.", - "undocumented": false, - "html": "City, district, suburb, town, or village." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "city" - }, - "country": { - "name": "country", - "check": "string", - "validation": "string", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)).", - "undocumented": false, - "html": "Two-letter country code (\u003Ca href=\"https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2\"\u003EISO 3166-1 alpha-2\u003C/a\u003E)." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "country" - }, - "line1": { - "name": "line1", - "check": "string", - "validation": "string", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Address line 1 (e.g., street, PO Box, or company name).", - "undocumented": false, - "html": "Address line 1 (e.g., street, PO Box, or company name)." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "line1" - }, - "line2": { - "name": "line2", - "check": "string", - "validation": "string", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Address line 2 (e.g., apartment, suite, unit, or building).", - "undocumented": false, - "html": "Address line 2 (e.g., apartment, suite, unit, or building)." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "line2" - }, - "postal_code": { - "name": "postal_code", - "check": "string", - "validation": "string", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "ZIP or postal code.", - "undocumented": false, - "html": "ZIP or postal code." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "postal_code" - }, - "state": { - "name": "state", - "check": "string", - "validation": "string", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "State, county, province, or region.", - "undocumented": false, - "html": "State, county, province, or region." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "state" - } - }, - "object_type": "shipping_address" - } - }, - "object_type": "visa_checkout" - } - }, - "object_type": "wallet" - } - }, - "object_type": "card", - "less_common": true - }, - "card_present": { - "name": "card_present", - "check": "hash", - "validation": "hash", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "If this is a `card_present` PaymentMethod, this hash contains details about the Card Present payment method.", - "undocumented": false, - "html": "If this is a \u003Ccode\u003Ecard_present\u003C/code\u003E PaymentMethod, this hash contains details about the Card Present payment method." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "subspec": { - "brand": { - "name": "brand", - "check": "string", - "validation": "string", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Card brand. Can be `amex`, `diners`, `discover`, `jcb`, `mastercard`, `unionpay`, `visa`, or `unknown`.", - "undocumented": false, - "html": "Card brand. Can be \u003Ccode\u003Eamex\u003C/code\u003E, \u003Ccode\u003Ediners\u003C/code\u003E, \u003Ccode\u003Ediscover\u003C/code\u003E, \u003Ccode\u003Ejcb\u003C/code\u003E, \u003Ccode\u003Emastercard\u003C/code\u003E, \u003Ccode\u003Eunionpay\u003C/code\u003E, \u003Ccode\u003Evisa\u003C/code\u003E, or \u003Ccode\u003Eunknown\u003C/code\u003E." - }, - "gate": true, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "brand" - }, - "cardholder_name": { - "name": "cardholder_name", - "check": "string", - "validation": "string", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "The cardholder name as read from the card, in [ISO 7813](https://en.wikipedia.org/wiki/ISO/IEC_7813) format. May include alphanumeric characters, special characters and first/last name separator (`/`). In some cases, the cardholder name may not be available depending on how the issuer has configured the card. Cardholder name is typically not available on swipe or contactless payments, such as those made with Apple Pay and Google Pay.", - "undocumented": false, - "html": "The cardholder name as read from the card, in \u003Ca href=\"https://en.wikipedia.org/wiki/ISO/IEC_7813\"\u003EISO 7813\u003C/a\u003E format. May include alphanumeric characters, special characters and first/last name separator (\u003Ccode\u003E/\u003C/code\u003E). In some cases, the cardholder name may not be available depending on how the issuer has configured the card. Cardholder name is typically not available on swipe or contactless payments, such as those made with Apple Pay and Google Pay." - }, - "gate": true, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "cardholder_name" - }, - "country": { - "name": "country", - "check": "string", - "validation": "string", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Two-letter ISO code representing the country of the card. You could use this attribute to get a sense of the international breakdown of cards you've collected.", - "undocumented": false, - "html": "Two-letter ISO code representing the country of the card. You could use this attribute to get a sense of the international breakdown of cards you’ve collected." - }, - "gate": true, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "country" - }, - "exp_month": { - "name": "exp_month", - "check": "integer", - "validation": "integer", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Two-digit number representing the card's expiration month.", - "undocumented": false, - "html": "Two-digit number representing the card’s expiration month." - }, - "gate": true, - "hide_unset_desc": null, - "required": true, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "exp_month" - }, - "exp_year": { - "name": "exp_year", - "check": "integer", - "validation": "integer", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Four-digit number representing the card's expiration year.", - "undocumented": false, - "html": "Four-digit number representing the card’s expiration year." - }, - "gate": true, - "hide_unset_desc": null, - "required": true, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "exp_year" - }, - "fingerprint": { - "name": "fingerprint", - "check": "string", - "validation": "string", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Uniquely identifies this particular card number. You can use this attribute to check whether two customers who’ve signed up with you are using the same card number, for example. For payment methods that tokenize card information (Apple Pay, Google Pay), the tokenized number might be provided instead of the underlying card number.\n\n*Starting May 1, 2021, card fingerprint in India for Connect will change to allow two fingerprints for the same card --- one for India and one for the rest of the world.*\n", - "undocumented": false, - "html": "Uniquely identifies this particular card number. You can use this attribute to check whether two customers who’ve signed up with you are using the same card number, for example. For payment methods that tokenize card information (Apple Pay, Google Pay), the tokenized number might be provided instead of the underlying card number.\u003C/p\u003E\n\n\u003Cp\u003E\u003Cem\u003EStarting May 1, 2021, card fingerprint in India for Connect will change to allow two fingerprints for the same card — one for India and one for the rest of the world.\u003C/em\u003E" - }, - "gate": true, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "fingerprint" - }, - "funding": { - "name": "funding", - "check": "string", - "validation": "string", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Card funding type. Can be `credit`, `debit`, `prepaid`, or `unknown`.", - "undocumented": false, - "html": "Card funding type. Can be \u003Ccode\u003Ecredit\u003C/code\u003E, \u003Ccode\u003Edebit\u003C/code\u003E, \u003Ccode\u003Eprepaid\u003C/code\u003E, or \u003Ccode\u003Eunknown\u003C/code\u003E." - }, - "gate": true, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "funding" - }, - "last4": { - "name": "last4", - "check": "string", - "validation": "string", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "The last four digits of the card.", - "undocumented": false, - "html": "The last four digits of the card." - }, - "gate": true, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "last4" - }, - "networks": { - "name": "networks", - "check": "hash", - "validation": "hash", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Contains information about card networks that can be used to process the payment.", - "undocumented": false, - "html": "Contains information about card networks that can be used to process the payment." - }, - "gate": true, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "subspec": { - "available": { - "name": "available", - "check": "string_array", - "validation": "array containing strings", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "All available networks for the card.", - "undocumented": false, - "html": "All available networks for the card." - }, - "gate": false, - "hide_unset_desc": null, - "required": true, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "available" - }, - "preferred": { - "name": "preferred", - "check": "string", - "validation": "string", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "The preferred network for the card.", - "undocumented": false, - "html": "The preferred network for the card." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "preferred" - } - }, - "object_type": "networks" - }, - "read_method": { - "name": "read_method", - "check": "string", - "validation": "string", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "How card details were read in this transaction.", - "undocumented": false, - "html": "How card details were read in this transaction." - }, - "gate": true, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "enum_values": { - "contact_emv": { - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Inserting a chip card into the card reader.", - "undocumented": false, - "html": "Inserting a chip card into the card reader." - } - }, - "contactless_emv": { - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Tapping a contactless-enabled chip card or mobile wallet.", - "undocumented": false, - "html": "Tapping a contactless-enabled chip card or mobile wallet." - } - }, - "magnetic_stripe_track2": { - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Swiping a card using the magnetic stripe reader.", - "undocumented": false, - "html": "Swiping a card using the magnetic stripe reader." - } - }, - "magnetic_stripe_fallback": { - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "When inserting a chip card fails three times in a row, fallback to a magnetic stripe read.", - "undocumented": false, - "html": "When inserting a chip card fails three times in a row, fallback to a magnetic stripe read." - } - }, - "contactless_magstripe_mode": { - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Older standard for contactless payments that emulated a magnetic stripe read.", - "undocumented": false, - "html": "Older standard for contactless payments that emulated a magnetic stripe read." - } - } - }, - "object_type": "read_method" - } - }, - "object_type": "card_present", - "less_common": true - }, - "created": { - "name": "created", - "check": "timestamp", - "validation": "timestamp", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Time at which the object was created. Measured in seconds since the Unix epoch.", - "undocumented": false, - "html": "Time at which the object was created. Measured in seconds since the Unix epoch." - }, - "gate": false, - "hide_unset_desc": null, - "required": true, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "created", - "less_common": true - }, - "customer": { - "name": "customer", - "check": "string", - "validation": "string", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "The ID of the Customer to which this PaymentMethod is saved. This will not be set when the PaymentMethod has not been saved to a Customer.", - "undocumented": false, - "html": "The ID of the Customer to which this PaymentMethod is saved. This will not be set when the PaymentMethod has not been saved to a Customer." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "user_expandable": ["customer"], - "object_type": "customer" - }, - "customer_balance": { - "name": "customer_balance", - "check": "hash", - "validation": "hash", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "If this is a `customer_balance` PaymentMethod, this hash contains details about the CustomerBalance payment method.", - "undocumented": false, - "html": "If this is a \u003Ccode\u003Ecustomer_balance\u003C/code\u003E PaymentMethod, this hash contains details about the CustomerBalance payment method." - }, - "gate": true, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "subspec": {}, - "object_type": "customer_balance", - "less_common": true - }, - "eps": { - "name": "eps", - "check": "hash", - "validation": "hash", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "If this is an `eps` PaymentMethod, this hash contains details about the EPS payment method.", - "undocumented": false, - "html": "If this is an \u003Ccode\u003Eeps\u003C/code\u003E PaymentMethod, this hash contains details about the EPS payment method." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "subspec": { - "bank": { - "name": "bank", - "check": "string", - "validation": "string", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "The customer's bank. Should be one of `arzte_und_apotheker_bank`, `austrian_anadi_bank_ag`, `bank_austria`, `bankhaus_carl_spangler`, `bankhaus_schelhammer_und_schattera_ag`, `bawag_psk_ag`, `bks_bank_ag`, `brull_kallmus_bank_ag`, `btv_vier_lander_bank`, `capital_bank_grawe_gruppe_ag`, `deutsche_bank_ag`, `dolomitenbank`, `easybank_ag`, `erste_bank_und_sparkassen`, `hypo_alpeadriabank_international_ag`, `hypo_noe_lb_fur_niederosterreich_u_wien`, `hypo_oberosterreich_salzburg_steiermark`, `hypo_tirol_bank_ag`, `hypo_vorarlberg_bank_ag`, `hypo_bank_burgenland_aktiengesellschaft`, `marchfelder_bank`, `oberbank_ag`, `raiffeisen_bankengruppe_osterreich`, `schoellerbank_ag`, `sparda_bank_wien`, `volksbank_gruppe`, `volkskreditbank_ag`, or `vr_bank_braunau`.", - "undocumented": false, - "html": "The customer’s bank. Should be one of \u003Ccode\u003Earzte_und_apotheker_bank\u003C/code\u003E, \u003Ccode\u003Eaustrian_anadi_bank_ag\u003C/code\u003E, \u003Ccode\u003Ebank_austria\u003C/code\u003E, \u003Ccode\u003Ebankhaus_carl_spangler\u003C/code\u003E, \u003Ccode\u003Ebankhaus_schelhammer_und_schattera_ag\u003C/code\u003E, \u003Ccode\u003Ebawag_psk_ag\u003C/code\u003E, \u003Ccode\u003Ebks_bank_ag\u003C/code\u003E, \u003Ccode\u003Ebrull_kallmus_bank_ag\u003C/code\u003E, \u003Ccode\u003Ebtv_vier_lander_bank\u003C/code\u003E, \u003Ccode\u003Ecapital_bank_grawe_gruppe_ag\u003C/code\u003E, \u003Ccode\u003Edeutsche_bank_ag\u003C/code\u003E, \u003Ccode\u003Edolomitenbank\u003C/code\u003E, \u003Ccode\u003Eeasybank_ag\u003C/code\u003E, \u003Ccode\u003Eerste_bank_und_sparkassen\u003C/code\u003E, \u003Ccode\u003Ehypo_alpeadriabank_international_ag\u003C/code\u003E, \u003Ccode\u003Ehypo_noe_lb_fur_niederosterreich_u_wien\u003C/code\u003E, \u003Ccode\u003Ehypo_oberosterreich_salzburg_steiermark\u003C/code\u003E, \u003Ccode\u003Ehypo_tirol_bank_ag\u003C/code\u003E, \u003Ccode\u003Ehypo_vorarlberg_bank_ag\u003C/code\u003E, \u003Ccode\u003Ehypo_bank_burgenland_aktiengesellschaft\u003C/code\u003E, \u003Ccode\u003Emarchfelder_bank\u003C/code\u003E, \u003Ccode\u003Eoberbank_ag\u003C/code\u003E, \u003Ccode\u003Eraiffeisen_bankengruppe_osterreich\u003C/code\u003E, \u003Ccode\u003Eschoellerbank_ag\u003C/code\u003E, \u003Ccode\u003Esparda_bank_wien\u003C/code\u003E, \u003Ccode\u003Evolksbank_gruppe\u003C/code\u003E, \u003Ccode\u003Evolkskreditbank_ag\u003C/code\u003E, or \u003Ccode\u003Evr_bank_braunau\u003C/code\u003E." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "bank" - } - }, - "object_type": "eps", - "less_common": true - }, - "fpx": { - "name": "fpx", - "check": "hash", - "validation": "hash", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "If this is an `fpx` PaymentMethod, this hash contains details about the FPX payment method.", - "undocumented": false, - "html": "If this is an \u003Ccode\u003Efpx\u003C/code\u003E PaymentMethod, this hash contains details about the FPX payment method." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "subspec": { - "bank": { - "name": "bank", - "check": "string", - "validation": "string", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "The customer's bank, if provided. Can be one of `affin_bank`, `agrobank`, `alliance_bank`, `ambank`, `bank_islam`, `bank_muamalat`, `bank_rakyat`, `bsn`, `cimb`, `hong_leong_bank`, `hsbc`, `kfh`, `maybank2u`, `ocbc`, `public_bank`, `rhb`, `standard_chartered`, `uob`, `deutsche_bank`, `maybank2e`, `pb_enterprise`, or `bank_of_china`.", - "undocumented": false, - "html": "The customer’s bank, if provided. Can be one of \u003Ccode\u003Eaffin_bank\u003C/code\u003E, \u003Ccode\u003Eagrobank\u003C/code\u003E, \u003Ccode\u003Ealliance_bank\u003C/code\u003E, \u003Ccode\u003Eambank\u003C/code\u003E, \u003Ccode\u003Ebank_islam\u003C/code\u003E, \u003Ccode\u003Ebank_muamalat\u003C/code\u003E, \u003Ccode\u003Ebank_rakyat\u003C/code\u003E, \u003Ccode\u003Ebsn\u003C/code\u003E, \u003Ccode\u003Ecimb\u003C/code\u003E, \u003Ccode\u003Ehong_leong_bank\u003C/code\u003E, \u003Ccode\u003Ehsbc\u003C/code\u003E, \u003Ccode\u003Ekfh\u003C/code\u003E, \u003Ccode\u003Emaybank2u\u003C/code\u003E, \u003Ccode\u003Eocbc\u003C/code\u003E, \u003Ccode\u003Epublic_bank\u003C/code\u003E, \u003Ccode\u003Erhb\u003C/code\u003E, \u003Ccode\u003Estandard_chartered\u003C/code\u003E, \u003Ccode\u003Euob\u003C/code\u003E, \u003Ccode\u003Edeutsche_bank\u003C/code\u003E, \u003Ccode\u003Emaybank2e\u003C/code\u003E, \u003Ccode\u003Epb_enterprise\u003C/code\u003E, or \u003Ccode\u003Ebank_of_china\u003C/code\u003E." - }, - "gate": false, - "hide_unset_desc": null, - "required": true, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "bank" - } - }, - "object_type": "fpx", - "less_common": true - }, - "giropay": { - "name": "giropay", - "check": "hash", - "validation": "hash", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "If this is a `giropay` PaymentMethod, this hash contains details about the Giropay payment method.", - "undocumented": false, - "html": "If this is a \u003Ccode\u003Egiropay\u003C/code\u003E PaymentMethod, this hash contains details about the Giropay payment method." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "subspec": {}, - "object_type": "giropay", - "less_common": true - }, - "grabpay": { - "name": "grabpay", - "check": "hash", - "validation": "hash", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "If this is a `grabpay` PaymentMethod, this hash contains details about the GrabPay payment method.", - "undocumented": false, - "html": "If this is a \u003Ccode\u003Egrabpay\u003C/code\u003E PaymentMethod, this hash contains details about the GrabPay payment method." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "subspec": {}, - "object_type": "grabpay", - "less_common": true - }, - "ideal": { - "name": "ideal", - "check": "hash", - "validation": "hash", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "If this is an `ideal` PaymentMethod, this hash contains details about the iDEAL payment method.", - "undocumented": false, - "html": "If this is an \u003Ccode\u003Eideal\u003C/code\u003E PaymentMethod, this hash contains details about the iDEAL payment method." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "subspec": { - "bank": { - "name": "bank", - "check": "string", - "validation": "string", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "The customer's bank, if provided. Can be one of `abn_amro`, `asn_bank`, `bunq`, `handelsbanken`, `ing`, `knab`, `moneyou`, `rabobank`, `regiobank`, `revolut`, `sns_bank`, `triodos_bank`, or `van_lanschot`.", - "undocumented": false, - "html": "The customer’s bank, if provided. Can be one of \u003Ccode\u003Eabn_amro\u003C/code\u003E, \u003Ccode\u003Easn_bank\u003C/code\u003E, \u003Ccode\u003Ebunq\u003C/code\u003E, \u003Ccode\u003Ehandelsbanken\u003C/code\u003E, \u003Ccode\u003Eing\u003C/code\u003E, \u003Ccode\u003Eknab\u003C/code\u003E, \u003Ccode\u003Emoneyou\u003C/code\u003E, \u003Ccode\u003Erabobank\u003C/code\u003E, \u003Ccode\u003Eregiobank\u003C/code\u003E, \u003Ccode\u003Erevolut\u003C/code\u003E, \u003Ccode\u003Esns_bank\u003C/code\u003E, \u003Ccode\u003Etriodos_bank\u003C/code\u003E, or \u003Ccode\u003Evan_lanschot\u003C/code\u003E." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "bank" - }, - "bic": { - "name": "bic", - "check": "string", - "validation": "string", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "The Bank Identifier Code of the customer's bank, if the bank was provided.", - "undocumented": false, - "html": "The Bank Identifier Code of the customer’s bank, if the bank was provided." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "bic" - } - }, - "object_type": "ideal", - "less_common": true - }, - "interac_present": { - "name": "interac_present", - "check": "hash", - "validation": "hash", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "If this is an `interac_present` PaymentMethod, this hash contains details about the Interac Present payment method.", - "undocumented": false, - "html": "If this is an \u003Ccode\u003Einterac_present\u003C/code\u003E PaymentMethod, this hash contains details about the Interac Present payment method." - }, - "gate": true, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "subspec": { - "brand": { - "name": "brand", - "check": "string", - "validation": "string", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Card brand. Can be `interac`, `mastercard` or `visa`.", - "undocumented": false, - "html": "Card brand. Can be \u003Ccode\u003Einterac\u003C/code\u003E, \u003Ccode\u003Emastercard\u003C/code\u003E or \u003Ccode\u003Evisa\u003C/code\u003E." - }, - "gate": true, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "brand" - }, - "cardholder_name": { - "name": "cardholder_name", - "check": "string", - "validation": "string", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "The cardholder name as read from the card, in [ISO 7813](https://en.wikipedia.org/wiki/ISO/IEC_7813) format. May include alphanumeric characters, special characters and first/last name separator (`/`). In some cases, the cardholder name may not be available depending on how the issuer has configured the card. Cardholder name is typically not available on swipe or contactless payments, such as those made with Apple Pay and Google Pay.", - "undocumented": false, - "html": "The cardholder name as read from the card, in \u003Ca href=\"https://en.wikipedia.org/wiki/ISO/IEC_7813\"\u003EISO 7813\u003C/a\u003E format. May include alphanumeric characters, special characters and first/last name separator (\u003Ccode\u003E/\u003C/code\u003E). In some cases, the cardholder name may not be available depending on how the issuer has configured the card. Cardholder name is typically not available on swipe or contactless payments, such as those made with Apple Pay and Google Pay." - }, - "gate": true, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "cardholder_name" - }, - "country": { - "name": "country", - "check": "string", - "validation": "string", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Two-letter ISO code representing the country of the card. You could use this attribute to get a sense of the international breakdown of cards you've collected.", - "undocumented": false, - "html": "Two-letter ISO code representing the country of the card. You could use this attribute to get a sense of the international breakdown of cards you’ve collected." - }, - "gate": true, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "country" - }, - "exp_month": { - "name": "exp_month", - "check": "integer", - "validation": "integer", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Two-digit number representing the card's expiration month.", - "undocumented": false, - "html": "Two-digit number representing the card’s expiration month." - }, - "gate": true, - "hide_unset_desc": null, - "required": true, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "exp_month" - }, - "exp_year": { - "name": "exp_year", - "check": "integer", - "validation": "integer", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Four-digit number representing the card's expiration year.", - "undocumented": false, - "html": "Four-digit number representing the card’s expiration year." - }, - "gate": true, - "hide_unset_desc": null, - "required": true, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "exp_year" - }, - "fingerprint": { - "name": "fingerprint", - "check": "string", - "validation": "string", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Uniquely identifies this particular card number. You can use this attribute to check whether two customers who’ve signed up with you are using the same card number, for example. For payment methods that tokenize card information (Apple Pay, Google Pay), the tokenized number might be provided instead of the underlying card number.\n\n*Starting May 1, 2021, card fingerprint in India for Connect will change to allow two fingerprints for the same card --- one for India and one for the rest of the world.*\n", - "undocumented": false, - "html": "Uniquely identifies this particular card number. You can use this attribute to check whether two customers who’ve signed up with you are using the same card number, for example. For payment methods that tokenize card information (Apple Pay, Google Pay), the tokenized number might be provided instead of the underlying card number.\u003C/p\u003E\n\n\u003Cp\u003E\u003Cem\u003EStarting May 1, 2021, card fingerprint in India for Connect will change to allow two fingerprints for the same card — one for India and one for the rest of the world.\u003C/em\u003E" - }, - "gate": true, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "fingerprint" - }, - "funding": { - "name": "funding", - "check": "string", - "validation": "string", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Card funding type. Can be `credit`, `debit`, `prepaid`, or `unknown`.", - "undocumented": false, - "html": "Card funding type. Can be \u003Ccode\u003Ecredit\u003C/code\u003E, \u003Ccode\u003Edebit\u003C/code\u003E, \u003Ccode\u003Eprepaid\u003C/code\u003E, or \u003Ccode\u003Eunknown\u003C/code\u003E." - }, - "gate": true, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "funding" - }, - "last4": { - "name": "last4", - "check": "string", - "validation": "string", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "The last four digits of the card.", - "undocumented": false, - "html": "The last four digits of the card." - }, - "gate": true, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "last4" - }, - "networks": { - "name": "networks", - "check": "hash", - "validation": "hash", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Contains information about card networks that can be used to process the payment.", - "undocumented": false, - "html": "Contains information about card networks that can be used to process the payment." - }, - "gate": true, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "subspec": { - "available": { - "name": "available", - "check": "string_array", - "validation": "array containing strings", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "All available networks for the card.", - "undocumented": false, - "html": "All available networks for the card." - }, - "gate": false, - "hide_unset_desc": null, - "required": true, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "available" - }, - "preferred": { - "name": "preferred", - "check": "string", - "validation": "string", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "The preferred network for the card.", - "undocumented": false, - "html": "The preferred network for the card." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "preferred" - } - }, - "object_type": "networks" - }, - "preferred_locales": { - "name": "preferred_locales", - "check": "string_array", - "validation": "array containing strings", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "EMV tag 5F2D. Preferred languages specified by the integrated circuit chip.", - "undocumented": false, - "html": "EMV tag 5F2D. Preferred languages specified by the integrated circuit chip." - }, - "gate": true, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "preferred_locales" - }, - "read_method": { - "name": "read_method", - "check": "string", - "validation": "string", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "How card details were read in this transaction.", - "undocumented": false, - "html": "How card details were read in this transaction." - }, - "gate": true, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "enum_values": { - "contact_emv": { - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Inserting a chip card into the card reader.", - "undocumented": false, - "html": "Inserting a chip card into the card reader." - } - }, - "contactless_emv": { - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Tapping a contactless-enabled chip card or mobile wallet.", - "undocumented": false, - "html": "Tapping a contactless-enabled chip card or mobile wallet." - } - }, - "magnetic_stripe_track2": { - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Swiping a card using the magnetic stripe reader.", - "undocumented": false, - "html": "Swiping a card using the magnetic stripe reader." - } - }, - "magnetic_stripe_fallback": { - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "When inserting a chip card fails three times in a row, fallback to a magnetic stripe read.", - "undocumented": false, - "html": "When inserting a chip card fails three times in a row, fallback to a magnetic stripe read." - } - }, - "contactless_magstripe_mode": { - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Older standard for contactless payments that emulated a magnetic stripe read.", - "undocumented": false, - "html": "Older standard for contactless payments that emulated a magnetic stripe read." - } - } - }, - "object_type": "read_method" - } - }, - "object_type": "interac_present", - "less_common": true - }, - "klarna": { - "name": "klarna", - "check": "hash", - "validation": "hash", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "If this is a `klarna` PaymentMethod, this hash contains details about the Klarna payment method.", - "undocumented": false, - "html": "If this is a \u003Ccode\u003Eklarna\u003C/code\u003E PaymentMethod, this hash contains details about the Klarna payment method." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "subspec": { - "dob": { - "name": "dob", - "check": "hash", - "validation": "hash", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "The customer's date of birth, if provided.", - "undocumented": false, - "html": "The customer’s date of birth, if provided." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": true, - "subspec": { - "day": { - "name": "day", - "check": "positive_integer", - "validation": "positive integer", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "The day of birth, between 1 and 31.", - "undocumented": false, - "html": "The day of birth, between 1 and 31." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "day" - }, - "month": { - "name": "month", - "check": "positive_integer", - "validation": "positive integer", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "The month of birth, between 1 and 12.", - "undocumented": false, - "html": "The month of birth, between 1 and 12." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "month" - }, - "year": { - "name": "year", - "check": "positive_integer", - "validation": "positive integer", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "The four-digit year of birth.", - "undocumented": false, - "html": "The four-digit year of birth." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "year" - } - }, - "object_type": "dob" - } - }, - "object_type": "klarna", - "less_common": true - }, - "konbini": { - "name": "konbini", - "check": "hash", - "validation": "hash", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "If this is a `konbini` PaymentMethod, this hash contains details about the Konbini payment method.", - "undocumented": false, - "html": "If this is a \u003Ccode\u003Ekonbini\u003C/code\u003E PaymentMethod, this hash contains details about the Konbini payment method." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "subspec": {}, - "object_type": "konbini", - "less_common": true - }, - "link": { - "name": "link", - "check": "hash", - "validation": "hash", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "If this is an `Link` PaymentMethod, this hash contains details about the Link payment method.", - "undocumented": false, - "html": "If this is an \u003Ccode\u003ELink\u003C/code\u003E PaymentMethod, this hash contains details about the Link payment method." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "subspec": { - "email": { - "name": "email", - "check": "string", - "validation": "string", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Account owner's email address.", - "undocumented": false, - "html": "Account owner’s email address." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "email" - }, - "persistent_token": { - "name": "persistent_token", - "check": "string", - "validation": "string", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Token used for persistent Link logins.", - "undocumented": false, - "html": "Token used for persistent Link logins." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "persistent_token" - } - }, - "object_type": "link", - "less_common": true - }, - "livemode": { - "name": "livemode", - "check": "boolean", - "validation": "boolean", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode.", - "undocumented": false, - "html": "Has the value \u003Ccode\u003Etrue\u003C/code\u003E if the object exists in live mode or the value \u003Ccode\u003Efalse\u003C/code\u003E if the object exists in test mode." - }, - "gate": false, - "hide_unset_desc": null, - "required": true, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "livemode", - "less_common": true - }, - "metadata": { - "name": "metadata", - "check": "hash", - "validation": "hash", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Set of [key-value pairs](/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format.", - "undocumented": false, - "html": "Set of \u003Ca href=\"/docs/api/metadata\"\u003Ekey-value pairs\u003C/a\u003E that you can attach to an object. This can be useful for storing additional information about the object in a structured format." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "metadata" - }, - "oxxo": { - "name": "oxxo", - "check": "hash", - "validation": "hash", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "If this is an `oxxo` PaymentMethod, this hash contains details about the OXXO payment method.", - "undocumented": false, - "html": "If this is an \u003Ccode\u003Eoxxo\u003C/code\u003E PaymentMethod, this hash contains details about the OXXO payment method." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "subspec": {}, - "object_type": "oxxo", - "less_common": true - }, - "p24": { - "name": "p24", - "check": "hash", - "validation": "hash", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "If this is a `p24` PaymentMethod, this hash contains details about the P24 payment method.", - "undocumented": false, - "html": "If this is a \u003Ccode\u003Ep24\u003C/code\u003E PaymentMethod, this hash contains details about the P24 payment method." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "subspec": { - "bank": { - "name": "bank", - "check": "string", - "validation": "string", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "The customer's bank, if provided.", - "undocumented": false, - "html": "The customer’s bank, if provided." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "enum_values": { - "ing": { "documentation": null }, - "citi_handlowy": { "documentation": null }, - "tmobile_usbugi_bankowe": { "documentation": null }, - "plus_bank": { "documentation": null }, - "etransfer_pocztowy24": { "documentation": null }, - "banki_spbdzielcze": { "documentation": null }, - "bank_nowy_bfg_sa": { "documentation": null }, - "getin_bank": { "documentation": null }, - "blik": { "documentation": null }, - "noble_pay": { "documentation": null }, - "ideabank": { "documentation": null }, - "envelobank": { "documentation": null }, - "santander_przelew24": { "documentation": null }, - "nest_przelew": { "documentation": null }, - "mbank_mtransfer": { "documentation": null }, - "inteligo": { "documentation": null }, - "pbac_z_ipko": { "documentation": null }, - "bnp_paribas": { "documentation": null }, - "credit_agricole": { "documentation": null }, - "toyota_bank": { "documentation": null }, - "bank_pekao_sa": { "documentation": null }, - "volkswagen_bank": { "documentation": null }, - "bank_millennium": { "documentation": null }, - "alior_bank": { "documentation": null }, - "boz": { "documentation": null } - }, - "object_type": "bank" - } - }, - "object_type": "p24", - "less_common": true - }, - "paynow": { - "name": "paynow", - "check": "hash", - "validation": "hash", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "If this is a `paynow` PaymentMethod, this hash contains details about the PayNow payment method.", - "undocumented": false, - "html": "If this is a \u003Ccode\u003Epaynow\u003C/code\u003E PaymentMethod, this hash contains details about the PayNow payment method." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "subspec": {}, - "object_type": "paynow", - "less_common": true - }, - "pix": { - "name": "pix", - "check": "hash", - "validation": "hash", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "If this is a `pix` PaymentMethod, this hash contains details about the Pix payment method.", - "undocumented": false, - "html": "If this is a \u003Ccode\u003Epix\u003C/code\u003E PaymentMethod, this hash contains details about the Pix payment method." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "subspec": {}, - "object_type": "pix", - "less_common": true - }, - "promptpay": { - "name": "promptpay", - "check": "hash", - "validation": "hash", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "If this is a `promptpay` PaymentMethod, this hash contains details about the PromptPay payment method.", - "undocumented": false, - "html": "If this is a \u003Ccode\u003Epromptpay\u003C/code\u003E PaymentMethod, this hash contains details about the PromptPay payment method." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "subspec": {}, - "object_type": "promptpay", - "less_common": true - }, - "radar_options": { - "name": "radar_options", - "check": "hash", - "validation": "hash", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Options to configure Radar. See [Radar Session](/docs/radar/radar-session) for more information.", - "undocumented": false, - "html": "Options to configure Radar. See \u003Ca href=\"/docs/radar/radar-session\"\u003ERadar Session\u003C/a\u003E for more information." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "subspec": { - "session": { - "name": "session", - "check": "string", - "validation": "string", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "A [Radar Session](/docs/radar/radar-session) is a snapshot of the browser metadata and device details that help Radar make more accurate predictions on your payments.", - "undocumented": false, - "html": "A \u003Ca href=\"/docs/radar/radar-session\"\u003ERadar Session\u003C/a\u003E is a snapshot of the browser metadata and device details that help Radar make more accurate predictions on your payments." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "session" - } - }, - "object_type": "radar_options", - "less_common": true - }, - "sepa_debit": { - "name": "sepa_debit", - "check": "hash", - "validation": "hash", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "If this is a `sepa_debit` PaymentMethod, this hash contains details about the SEPA debit bank account.", - "undocumented": false, - "html": "If this is a \u003Ccode\u003Esepa_debit\u003C/code\u003E PaymentMethod, this hash contains details about the SEPA debit bank account." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "subspec": { - "bank_code": { - "name": "bank_code", - "check": "string", - "validation": "string", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Bank code of bank associated with the bank account.", - "undocumented": false, - "html": "Bank code of bank associated with the bank account." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "bank_code" - }, - "branch_code": { - "name": "branch_code", - "check": "string", - "validation": "string", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Branch code of bank associated with the bank account.", - "undocumented": false, - "html": "Branch code of bank associated with the bank account." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "branch_code" - }, - "country": { - "name": "country", - "check": "string", - "validation": "string", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Two-letter ISO code representing the country the bank account is located in.", - "undocumented": false, - "html": "Two-letter ISO code representing the country the bank account is located in." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "country" - }, - "fingerprint": { - "name": "fingerprint", - "check": "string", - "validation": "string", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Uniquely identifies this particular bank account. You can use this attribute to check whether two bank accounts are the same.", - "undocumented": false, - "html": "Uniquely identifies this particular bank account. You can use this attribute to check whether two bank accounts are the same." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "fingerprint" - }, - "generated_from": { - "name": "generated_from", - "check": "hash", - "validation": "hash", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Information about the object that generated this PaymentMethod.", - "undocumented": false, - "html": "Information about the object that generated this PaymentMethod." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "subspec": { - "charge": { - "name": "charge", - "check": "string", - "validation": "string", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "The ID of the Charge that generated this PaymentMethod, if any.", - "undocumented": false, - "html": "The ID of the Charge that generated this PaymentMethod, if any." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "user_expandable": ["charge"], - "object_type": "charge" - }, - "setup_attempt": { - "name": "setup_attempt", - "check": "string", - "validation": "string", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "The ID of the SetupAttempt that generated this PaymentMethod, if any.", - "undocumented": false, - "html": "The ID of the SetupAttempt that generated this PaymentMethod, if any." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "user_expandable": ["setup_attempt"], - "object_type": "setup_attempt" - } - }, - "object_type": "generated_from" - }, - "last4": { - "name": "last4", - "check": "string", - "validation": "string", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Last four characters of the IBAN.", - "undocumented": false, - "html": "Last four characters of the IBAN." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "last4" - } - }, - "object_type": "sepa_debit", - "less_common": true - }, - "sofort": { - "name": "sofort", - "check": "hash", - "validation": "hash", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "If this is a `sofort` PaymentMethod, this hash contains details about the SOFORT payment method.", - "undocumented": false, - "html": "If this is a \u003Ccode\u003Esofort\u003C/code\u003E PaymentMethod, this hash contains details about the SOFORT payment method." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "subspec": { - "country": { - "name": "country", - "check": "string", - "validation": "string", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Two-letter ISO code representing the country the bank account is located in.", - "undocumented": false, - "html": "Two-letter ISO code representing the country the bank account is located in." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "country" - } - }, - "object_type": "sofort", - "less_common": true - }, - "type": { - "name": "type", - "check": "string", - "validation": "string", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "The type of the PaymentMethod. An additional hash is included on the PaymentMethod with a name matching this value. It contains additional information specific to the PaymentMethod type.", - "undocumented": false, - "html": "The type of the PaymentMethod. An additional hash is included on the PaymentMethod with a name matching this value. It contains additional information specific to the PaymentMethod type." - }, - "gate": false, - "hide_unset_desc": null, - "required": true, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "enum_values": { - "acss_debit": { - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "[Pre-authorized debit payments](/docs/payments/acss-debit) are used to debit Canadian bank accounts through the Automated Clearing Settlement System (ACSS).", - "undocumented": false, - "html": "\u003Ca href=\"/docs/payments/acss-debit\"\u003EPre-authorized debit payments\u003C/a\u003E are used to debit Canadian bank accounts through the Automated Clearing Settlement System (ACSS)." - } - }, - "affirm": { - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "[Affirm](/docs/payments/affirm) is a buy now, pay later payment method in the US.", - "undocumented": false, - "html": "\u003Ca href=\"/docs/payments/affirm\"\u003EAffirm\u003C/a\u003E is a buy now, pay later payment method in the US." - } - }, - "afterpay_clearpay": { - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "[Afterpay / Clearpay](/docs/payments/afterpay-clearpay) is a buy now, pay later payment method used in Australia, Canada, France, New Zealand, Spain, the UK, and the US.", - "undocumented": false, - "html": "\u003Ca href=\"/docs/payments/afterpay-clearpay\"\u003EAfterpay / Clearpay\u003C/a\u003E is a buy now, pay later payment method used in Australia, Canada, France, New Zealand, Spain, the UK, and the US." - } - }, - "alipay": { - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "[Alipay](/docs/payments/alipay) is a digital wallet payment method used in China.", - "undocumented": false, - "html": "\u003Ca href=\"/docs/payments/alipay\"\u003EAlipay\u003C/a\u003E is a digital wallet payment method used in China." - } - }, - "au_becs_debit": { - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "[BECS Direct Debit](/docs/payments/au-becs-debit) is used to debit Australian bank accounts through the Bulk Electronic Clearing System (BECS).", - "undocumented": false, - "html": "\u003Ca href=\"/docs/payments/au-becs-debit\"\u003EBECS Direct Debit\u003C/a\u003E is used to debit Australian bank accounts through the Bulk Electronic Clearing System (BECS)." - } - }, - "bacs_debit": { - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "[Bacs Direct Debit](/docs/payments/payment-methods/bacs-debit) is used to debit UK bank accounts.", - "undocumented": false, - "html": "\u003Ca href=\"/docs/payments/payment-methods/bacs-debit\"\u003EBacs Direct Debit\u003C/a\u003E is used to debit UK bank accounts." - } - }, - "bancontact": { - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "[Bancontact](/docs/payments/bancontact) is a bank redirect payment method used in Belgium.", - "undocumented": false, - "html": "\u003Ca href=\"/docs/payments/bancontact\"\u003EBancontact\u003C/a\u003E is a bank redirect payment method used in Belgium." - } - }, - "blik": { - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "[BLIK](/docs/payments/blik) is a single-use payment method common in Poland.", - "undocumented": false, - "html": "\u003Ca href=\"/docs/payments/blik\"\u003EBLIK\u003C/a\u003E is a single-use payment method common in Poland." - } - }, - "boleto": { - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "[Boleto](/docs/payments/boleto) is a voucher-based payment method used in Brazil.", - "undocumented": false, - "html": "\u003Ca href=\"/docs/payments/boleto\"\u003EBoleto\u003C/a\u003E is a voucher-based payment method used in Brazil." - } - }, - "card": { - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "[Card payments](/docs/payments/payment-methods/overview#cards) are supported through many networks and card brands.", - "undocumented": false, - "html": "\u003Ca href=\"/docs/payments/payment-methods/overview#cards\"\u003ECard payments\u003C/a\u003E are supported through many networks and card brands." - } - }, - "card_present": { - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "[Stripe Terminal](/docs/terminal/payments/collect-payment) is used to collect in-person card payments.", - "undocumented": false, - "html": "\u003Ca href=\"/docs/terminal/payments/collect-payment\"\u003EStripe Terminal\u003C/a\u003E is used to collect in-person card payments." - } - }, - "customer_balance": { - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Uses a customer’s [cash balance](/docs/payments/customer-balance) for the payment.", - "undocumented": false, - "html": "Uses a customer’s \u003Ca href=\"/docs/payments/customer-balance\"\u003Ecash balance\u003C/a\u003E for the payment." - } - }, - "eps": { - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "[EPS](/docs/payments/eps) is an Austria-based bank redirect payment method.", - "undocumented": false, - "html": "\u003Ca href=\"/docs/payments/eps\"\u003EEPS\u003C/a\u003E is an Austria-based bank redirect payment method." - } - }, - "fpx": { - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "[FPX](/docs/payments/fpx) is a Malaysia-based bank redirect payment method.", - "undocumented": false, - "html": "\u003Ca href=\"/docs/payments/fpx\"\u003EFPX\u003C/a\u003E is a Malaysia-based bank redirect payment method." - } - }, - "giropay": { - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "[giropay](/docs/payments/giropay) is a German bank redirect payment method.", - "undocumented": false, - "html": "\u003Ca href=\"/docs/payments/giropay\"\u003Egiropay\u003C/a\u003E is a German bank redirect payment method." - } - }, - "grabpay": { - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "[GrabPay](/docs/payments/grabpay) is a digital wallet payment method used in Southeast Asia.", - "undocumented": false, - "html": "\u003Ca href=\"/docs/payments/grabpay\"\u003EGrabPay\u003C/a\u003E is a digital wallet payment method used in Southeast Asia." - } - }, - "ideal": { - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "[iDEAL](/docs/payments/ideal) is a Netherlands-based bank redirect payment method.", - "undocumented": false, - "html": "\u003Ca href=\"/docs/payments/ideal\"\u003EiDEAL\u003C/a\u003E is a Netherlands-based bank redirect payment method." - } - }, - "interac_present": { - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "[Stripe Terminal](/docs/terminal/payments/collect-payment) accepts [Interac](/docs/terminal/payments/regional?integration-country=CA#interac-payments) debit cards for in-person payments in Canada.", - "undocumented": false, - "html": "\u003Ca href=\"/docs/terminal/payments/collect-payment\"\u003EStripe Terminal\u003C/a\u003E accepts \u003Ca href=\"/docs/terminal/payments/regional?integration-country=CA#interac-payments\"\u003EInterac\u003C/a\u003E debit cards for in-person payments in Canada." - } - }, - "klarna": { - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "[Klarna](/docs/payments/klarna) is a global buy now, pay later payment method.", - "undocumented": false, - "html": "\u003Ca href=\"/docs/payments/klarna\"\u003EKlarna\u003C/a\u003E is a global buy now, pay later payment method." - } - }, - "konbini": { - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "[Konbini](/docs/payments/konbini) is a cash-based voucher payment method used in Japan.", - "undocumented": false, - "html": "\u003Ca href=\"/docs/payments/konbini\"\u003EKonbini\u003C/a\u003E is a cash-based voucher payment method used in Japan." - } - }, - "link": { - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "[Link](/docs/payments/link) allows customers to pay with their saved payment details.", - "undocumented": false, - "html": "\u003Ca href=\"/docs/payments/link\"\u003ELink\u003C/a\u003E allows customers to pay with their saved payment details." - } - }, - "oxxo": { - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "[OXXO](/docs/payments/oxxo) is a cash-based voucher payment method used in Mexico.", - "undocumented": false, - "html": "\u003Ca href=\"/docs/payments/oxxo\"\u003EOXXO\u003C/a\u003E is a cash-based voucher payment method used in Mexico." - } - }, - "p24": { - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "[Przelewy24](/docs/payments/p24) is a bank redirect payment method used in Poland.", - "undocumented": false, - "html": "\u003Ca href=\"/docs/payments/p24\"\u003EPrzelewy24\u003C/a\u003E is a bank redirect payment method used in Poland." - } - }, - "paynow": { - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "[PayNow](/docs/payments/paynow) is a QR code payment method used in Singapore.", - "undocumented": false, - "html": "\u003Ca href=\"/docs/payments/paynow\"\u003EPayNow\u003C/a\u003E is a QR code payment method used in Singapore." - } - }, - "pix": { - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "[Pix](/docs/payments/pix) is an instant bank transfer payment method in Brazil.", - "undocumented": false, - "html": "\u003Ca href=\"/docs/payments/pix\"\u003EPix\u003C/a\u003E is an instant bank transfer payment method in Brazil." - } - }, - "promptpay": { - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "[PromptPay](/docs/payments/promptpay) is an instant funds transfer service popular in Thailand.", - "undocumented": false, - "html": "\u003Ca href=\"/docs/payments/promptpay\"\u003EPromptPay\u003C/a\u003E is an instant funds transfer service popular in Thailand." - } - }, - "sepa_debit": { - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "[SEPA Direct Debit](/docs/payments/sepa-debit) is used to debit bank accounts within the Single Euro Payments Area (SEPA) region.", - "undocumented": false, - "html": "\u003Ca href=\"/docs/payments/sepa-debit\"\u003ESEPA Direct Debit\u003C/a\u003E is used to debit bank accounts within the Single Euro Payments Area (SEPA) region." - } - }, - "sofort": { - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "[Sofort](/docs/payments/sofort) is a bank redirect payment method used in Europe.", - "undocumented": false, - "html": "\u003Ca href=\"/docs/payments/sofort\"\u003ESofort\u003C/a\u003E is a bank redirect payment method used in Europe." - } - }, - "us_bank_account": { - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "[ACH Direct Debit](/docs/payments/ach-debit) is used to debit US bank accounts through the Automated Clearing House (ACH) payments system.", - "undocumented": false, - "html": "\u003Ca href=\"/docs/payments/ach-debit\"\u003EACH Direct Debit\u003C/a\u003E is used to debit US bank accounts through the Automated Clearing House (ACH) payments system." - } - }, - "wechat_pay": { - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "[WeChat Pay](/docs/payments/wechat-pay) is a digital wallet payment method based in China.", - "undocumented": false, - "html": "\u003Ca href=\"/docs/payments/wechat-pay\"\u003EWeChat Pay\u003C/a\u003E is a digital wallet payment method based in China." - } - } - }, - "object_type": "type" - }, - "us_bank_account": { - "name": "us_bank_account", - "check": "hash", - "validation": "hash", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "If this is an `us_bank_account` PaymentMethod, this hash contains details about the US bank account payment method.", - "undocumented": false, - "html": "If this is an \u003Ccode\u003Eus_bank_account\u003C/code\u003E PaymentMethod, this hash contains details about the US bank account payment method." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "subspec": { - "account_holder_type": { - "name": "account_holder_type", - "check": "string", - "validation": "string", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Account holder type: individual or company.", - "undocumented": false, - "html": "Account holder type: individual or company." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "enum_values": { - "individual": { - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Account belongs to an individual", - "undocumented": false, - "html": "Account belongs to an individual" - } - }, - "company": { - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Account belongs to a company", - "undocumented": false, - "html": "Account belongs to a company" - } - } - }, - "object_type": "account_holder_type" - }, - "account_type": { - "name": "account_type", - "check": "string", - "validation": "string", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Account type: checkings or savings. Defaults to checking if omitted.", - "undocumented": false, - "html": "Account type: checkings or savings. Defaults to checking if omitted." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "enum_values": { - "checking": { - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Bank account type is checking", - "undocumented": false, - "html": "Bank account type is checking" - } - }, - "savings": { - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Bank account type is savings", - "undocumented": false, - "html": "Bank account type is savings" - } - } - }, - "object_type": "account_type" - }, - "bank_name": { - "name": "bank_name", - "check": "string", - "validation": "string", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "The name of the bank.", - "undocumented": false, - "html": "The name of the bank." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "bank_name" - }, - "financial_connections_account": { - "name": "financial_connections_account", - "check": "string", - "validation": "string", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "The ID of the Financial Connections Account used to create the payment method.", - "undocumented": false, - "html": "The ID of the Financial Connections Account used to create the payment method." - }, - "gate": true, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "financial_connections_account" - }, - "fingerprint": { - "name": "fingerprint", - "check": "string", - "validation": "string", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Uniquely identifies this particular bank account. You can use this attribute to check whether two bank accounts are the same.", - "undocumented": false, - "html": "Uniquely identifies this particular bank account. You can use this attribute to check whether two bank accounts are the same." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "fingerprint" - }, - "last4": { - "name": "last4", - "check": "string", - "validation": "string", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Last four digits of the bank account number.", - "undocumented": false, - "html": "Last four digits of the bank account number." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "last4" - }, - "networks": { - "name": "networks", - "check": "hash", - "validation": "hash", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Contains information about US bank account networks that can be used.", - "undocumented": false, - "html": "Contains information about US bank account networks that can be used." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "subspec": { - "preferred": { - "name": "preferred", - "check": "string", - "validation": "string", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "The preferred network.", - "undocumented": false, - "html": "The preferred network." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "preferred" - }, - "supported": { - "name": "supported", - "check": "array", - "validation": "array", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "All supported networks.", - "undocumented": false, - "html": "All supported networks." - }, - "gate": false, - "hide_unset_desc": null, - "required": true, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "supported" - } - }, - "object_type": "networks" - }, - "routing_number": { - "name": "routing_number", - "check": "string", - "validation": "string", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Routing number of the bank account.", - "undocumented": false, - "html": "Routing number of the bank account." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "routing_number" - } - }, - "object_type": "us_bank_account", - "less_common": true - }, - "wechat_pay": { - "name": "wechat_pay", - "check": "hash", - "validation": "hash", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "If this is an `wechat_pay` PaymentMethod, this hash contains details about the wechat_pay payment method.", - "undocumented": false, - "html": "If this is an \u003Ccode\u003Ewechat_pay\u003C/code\u003E PaymentMethod, this hash contains details about the wechat_pay payment method." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "subspec": {}, - "object_type": "wechat_pay", - "less_common": true - } - }, - "object_type": "payment_method", - "less_common": true - }, - "payment_method_type": { - "name": "payment_method_type", - "check": "string", - "validation": "string", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "If the error is specific to the type of payment method, the payment method type that had a problem. This field is only populated for invoice-related errors.", - "undocumented": false, - "html": "If the error is specific to the type of payment method, the payment method type that had a problem. This field is only populated for invoice-related errors." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "payment_method_type", - "less_common": true - }, - "type": { - "name": "type", - "check": "string", - "validation": "string", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "The type of error returned. One of `api_error`, `card_error`, `idempotency_error`, or `invalid_request_error`", - "undocumented": false, - "html": "The type of error returned. One of \u003Ccode\u003Eapi_error\u003C/code\u003E, \u003Ccode\u003Ecard_error\u003C/code\u003E, \u003Ccode\u003Eidempotency_error\u003C/code\u003E, or \u003Ccode\u003Einvalid_request_error\u003C/code\u003E" - }, - "gate": false, - "hide_unset_desc": null, - "required": true, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "type" - } - }, - "object_type": "last_setup_error" - }, - "latest_attempt": { - "name": "latest_attempt", - "check": "string", - "validation": "string", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "The most recent SetupAttempt for this SetupIntent.", - "undocumented": false, - "html": "The most recent SetupAttempt for this SetupIntent." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "user_expandable": ["setup_attempt"], - "object_type": "latest_attempt", - "less_common": true - }, - "livemode": { - "name": "livemode", - "check": "boolean", - "validation": "boolean", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode.", - "undocumented": false, - "html": "Has the value \u003Ccode\u003Etrue\u003C/code\u003E if the object exists in live mode or the value \u003Ccode\u003Efalse\u003C/code\u003E if the object exists in test mode." - }, - "gate": false, - "hide_unset_desc": null, - "required": true, - "default": null, - "badge_text": "retrievable with publishable key", - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "livemode", - "less_common": true - }, - "mandate": { - "name": "mandate", - "check": "string", - "validation": "string", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "ID of the multi use Mandate generated by the SetupIntent.", - "undocumented": false, - "html": "ID of the multi use Mandate generated by the SetupIntent." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "user_expandable": ["mandate"], - "object_type": "mandate", - "less_common": true - }, - "metadata": { - "name": "metadata", - "check": "hash", - "validation": "hash", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Set of [key-value pairs](/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format.", - "undocumented": false, - "html": "Set of \u003Ca href=\"/docs/api/metadata\"\u003Ekey-value pairs\u003C/a\u003E that you can attach to an object. This can be useful for storing additional information about the object in a structured format." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "metadata" - }, - "next_action": { - "name": "next_action", - "check": "hash", - "validation": "hash", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "If present, this property tells you what actions you need to take in order for your customer to continue payment setup.", - "undocumented": false, - "html": "If present, this property tells you what actions you need to take in order for your customer to continue payment setup." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": "retrievable with publishable key", - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "subspec": { - "redirect_to_url": { - "name": "redirect_to_url", - "check": "hash", - "validation": "hash", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Contains instructions for authenticating a payment by redirecting your customer to another page or application.", - "undocumented": false, - "html": "Contains instructions for authenticating a payment by redirecting your customer to another page or application." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "subspec": { - "return_url": { - "name": "return_url", - "check": "string", - "validation": "string", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "If the customer does not exit their browser while authenticating, they will be redirected to this specified URL after completion.", - "undocumented": false, - "html": "If the customer does not exit their browser while authenticating, they will be redirected to this specified URL after completion." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "return_url" - }, - "url": { - "name": "url", - "check": "string", - "validation": "string", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "The URL you must redirect your customer to in order to authenticate.", - "undocumented": false, - "html": "The URL you must redirect your customer to in order to authenticate." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "url" - } - }, - "object_type": "redirect_to_url" - }, - "type": { - "name": "type", - "check": "string", - "validation": "string", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Type of the next action to perform, one of `redirect_to_url`, `use_stripe_sdk`, `alipay_handle_redirect`, `oxxo_display_details`, or `verify_with_microdeposits`.", - "undocumented": false, - "html": "Type of the next action to perform, one of \u003Ccode\u003Eredirect_to_url\u003C/code\u003E, \u003Ccode\u003Euse_stripe_sdk\u003C/code\u003E, \u003Ccode\u003Ealipay_handle_redirect\u003C/code\u003E, \u003Ccode\u003Eoxxo_display_details\u003C/code\u003E, or \u003Ccode\u003Everify_with_microdeposits\u003C/code\u003E." - }, - "gate": false, - "hide_unset_desc": null, - "required": true, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "type" - }, - "use_stripe_sdk": { - "name": "use_stripe_sdk", - "check": "hash", - "validation": "hash", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "When confirming a SetupIntent with Stripe.js, Stripe.js depends on the contents of this \u003Ctranslate\u003Edictionary\u003C/translate\u003E to invoke authentication flows. The shape of the contents is subject to change and is only intended to be used by Stripe.js.", - "undocumented": false, - "html": "When confirming a SetupIntent with Stripe.js, Stripe.js depends on the contents of this \u003Ctranslate\u003Edictionary\u003C/translate\u003E to invoke authentication flows. The shape of the contents is subject to change and is only intended to be used by Stripe.js." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "use_stripe_sdk" - }, - "verify_with_microdeposits": { - "name": "verify_with_microdeposits", - "check": "hash", - "validation": "hash", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Contains details describing microdeposits verification flow.", - "undocumented": false, - "html": "Contains details describing microdeposits verification flow." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "subspec": { - "arrival_date": { - "name": "arrival_date", - "check": "timestamp", - "validation": "timestamp", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "The timestamp when the microdeposits are expected to land.", - "undocumented": false, - "html": "The timestamp when the microdeposits are expected to land." - }, - "gate": false, - "hide_unset_desc": null, - "required": true, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "arrival_date" - }, - "hosted_verification_url": { - "name": "hosted_verification_url", - "check": "string", - "validation": "string", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "The URL for the hosted verification page, which allows customers to verify their bank account.", - "undocumented": false, - "html": "The URL for the hosted verification page, which allows customers to verify their bank account." - }, - "gate": false, - "hide_unset_desc": null, - "required": true, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "hosted_verification_url" - }, - "microdeposit_type": { - "name": "microdeposit_type", - "check": "string", - "validation": "string", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "The type of the microdeposit sent to the customer. Used to distinguish between different verification methods.", - "undocumented": false, - "html": "The type of the microdeposit sent to the customer. Used to distinguish between different verification methods." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "enum_values": { - "descriptor_code": { "documentation": null }, - "amounts": { "documentation": null } - }, - "object_type": "microdeposit_type" - } - }, - "object_type": "verify_with_microdeposits" - } - }, - "object_type": "next_action" - }, - "on_behalf_of": { - "name": "on_behalf_of", - "check": "string", - "validation": "string", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "The account (if any) for which the setup is intended.", - "undocumented": false, - "html": "The account (if any) for which the setup is intended." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": "Connect only", - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "user_expandable": ["account"], - "object_type": "on_behalf_of", - "less_common": true - }, - "payment_method": { - "name": "payment_method", - "check": "string", - "validation": "string", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "ID of the payment method used with this SetupIntent.", - "undocumented": false, - "html": "ID of the payment method used with this SetupIntent." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": "retrievable with publishable key", - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "user_expandable": ["payment_method"], - "object_type": "payment_method" - }, - "payment_method_options": { - "name": "payment_method_options", - "check": "hash", - "validation": "hash", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Payment-method-specific configuration for this SetupIntent.", - "undocumented": false, - "html": "Payment-method-specific configuration for this SetupIntent." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "subspec": { - "acss_debit": { - "name": "acss_debit", - "check": "hash", - "validation": "hash", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "If the SetupIntent's payment_method_types includes `acss_debit`, this hash contains the configurations that will be applied to each setup attempt of that type.\n", - "undocumented": false, - "html": "If the SetupIntent’s payment_method_types includes \u003Ccode\u003Eacss_debit\u003C/code\u003E, this hash contains the configurations that will be applied to each setup attempt of that type." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "subspec": { - "currency": { - "name": "currency", - "check": "string", - "validation": "string", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Currency supported by the bank account", - "undocumented": false, - "html": "Currency supported by the bank account" - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "enum_values": { - "cad": { - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Canadian dollars", - "undocumented": false, - "html": "Canadian dollars" - } - }, - "usd": { - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "US dollars", - "undocumented": false, - "html": "US dollars" - } - } - }, - "object_type": "currency" - }, - "mandate_options": { - "name": "mandate_options", - "check": "hash", - "validation": "hash", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Additional fields for Mandate creation", - "undocumented": false, - "html": "Additional fields for Mandate creation" - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "subspec": { - "custom_mandate_url": { - "name": "custom_mandate_url", - "check": "string", - "validation": "string", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "A URL for custom mandate text", - "undocumented": false, - "html": "A URL for custom mandate text" - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "custom_mandate_url" - }, - "default_for": { - "name": "default_for", - "check": "array", - "validation": "array", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "List of Stripe products where this mandate can be selected automatically.", - "undocumented": false, - "html": "List of Stripe products where this mandate can be selected automatically." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "enum_values": { - "invoice": { - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Enables payments for Stripe Invoices. 'subscription' must also be provided.", - "undocumented": false, - "html": "Enables payments for Stripe Invoices. ‘subscription’ must also be provided." - } - }, - "subscription": { - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Enables payments for Stripe Subscriptions. 'invoice' must also be provided.", - "undocumented": false, - "html": "Enables payments for Stripe Subscriptions. ‘invoice’ must also be provided." - } - } - }, - "object_type": "default_for" - }, - "interval_description": { - "name": "interval_description", - "check": "string", - "validation": "string", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Description of the interval. Only required if the 'payment_schedule' parameter is 'interval' or 'combined'.", - "undocumented": false, - "html": "Description of the interval. Only required if the ‘payment_schedule’ parameter is ‘interval’ or ‘combined’." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "interval_description" - }, - "payment_schedule": { - "name": "payment_schedule", - "check": "string", - "validation": "string", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Payment schedule for the mandate.", - "undocumented": false, - "html": "Payment schedule for the mandate." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "enum_values": { - "interval": { - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Payments are initiated at a regular pre-defined interval", - "undocumented": false, - "html": "Payments are initiated at a regular pre-defined interval" - } - }, - "sporadic": { - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Payments are initiated sporadically", - "undocumented": false, - "html": "Payments are initiated sporadically" - } - }, - "combined": { - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Payments can be initiated at a pre-defined interval or sporadically", - "undocumented": false, - "html": "Payments can be initiated at a pre-defined interval or sporadically" - } - } - }, - "object_type": "payment_schedule" - }, - "transaction_type": { - "name": "transaction_type", - "check": "string", - "validation": "string", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Transaction type of the mandate.", - "undocumented": false, - "html": "Transaction type of the mandate." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "enum_values": { - "personal": { - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Transactions are made for personal reasons", - "undocumented": false, - "html": "Transactions are made for personal reasons" - } - }, - "business": { - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Transactions are made for business reasons", - "undocumented": false, - "html": "Transactions are made for business reasons" - } - } - }, - "object_type": "transaction_type" - } - }, - "object_type": "mandate_options" - }, - "verification_method": { - "name": "verification_method", - "check": "string", - "validation": "string", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Bank account verification method.", - "undocumented": false, - "html": "Bank account verification method." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "enum_values": { - "automatic": { - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Instant verification with fallback to microdeposits.", - "undocumented": false, - "html": "Instant verification with fallback to microdeposits." - } - }, - "instant": { - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Instant verification.", - "undocumented": false, - "html": "Instant verification." - } - }, - "microdeposits": { - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Verification using microdeposits.", - "undocumented": false, - "html": "Verification using microdeposits." - } - } - }, - "object_type": "verification_method" - } - }, - "object_type": "acss_debit" - }, - "blik": { - "name": "blik", - "check": "hash", - "validation": "hash", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "If the SetupIntent's payment_method_types includes `blik`, this hash contains the configurations that will be applied to each setup attempt of that type.\n", - "undocumented": false, - "html": "If the SetupIntent’s payment_method_types includes \u003Ccode\u003Eblik\u003C/code\u003E, this hash contains the configurations that will be applied to each setup attempt of that type." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "subspec": { - "mandate_options": { - "name": "mandate_options", - "check": "hash", - "validation": "hash", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Details of the reusable mandate.", - "undocumented": false, - "html": "Details of the reusable mandate." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "subspec": { - "expires_after": { - "name": "expires_after", - "check": "timestamp", - "validation": "timestamp", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Date at which the mandate expires.", - "undocumented": false, - "html": "Date at which the mandate expires." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "expires_after" - }, - "off_session": { - "name": "off_session", - "check": "hash", - "validation": "hash", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Details for off-session mandates.", - "undocumented": false, - "html": "Details for off-session mandates." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "subspec": { - "amount": { - "name": "amount", - "check": "integer", - "validation": "integer", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Amount of each recurring payment.", - "undocumented": false, - "html": "Amount of each recurring payment." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "amount" - }, - "currency": { - "name": "currency", - "check": "string", - "validation": "string", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Currency of each recurring payment.", - "undocumented": false, - "html": "Currency of each recurring payment." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "currency" - }, - "interval": { - "name": "interval", - "check": "string", - "validation": "string", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Frequency interval of each recurring payment.", - "undocumented": false, - "html": "Frequency interval of each recurring payment." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "enum_values": { - "day": { - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Payments recur every day.", - "undocumented": false, - "html": "Payments recur every day." - } - }, - "week": { - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Payments recur every week.", - "undocumented": false, - "html": "Payments recur every week." - } - }, - "month": { - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Payments recur every month.", - "undocumented": false, - "html": "Payments recur every month." - } - }, - "year": { - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Payments recur every year.", - "undocumented": false, - "html": "Payments recur every year." - } - } - }, - "object_type": "interval" - }, - "interval_count": { - "name": "interval_count", - "check": "integer", - "validation": "integer", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Frequency indicator of each recurring payment.", - "undocumented": false, - "html": "Frequency indicator of each recurring payment." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "interval_count" - } - }, - "object_type": "off_session" - }, - "type": { - "name": "type", - "check": "string", - "validation": "string", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Type of the mandate.", - "undocumented": false, - "html": "Type of the mandate." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "enum_values": { - "on_session": { - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Mandate for on-session payments.", - "undocumented": false, - "html": "Mandate for on-session payments." - } - }, - "off_session": { - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Mandate for off-session payments.", - "undocumented": false, - "html": "Mandate for off-session payments." - } - } - }, - "object_type": "type" - } - }, - "object_type": "mandate_options" - } - }, - "object_type": "blik" - }, - "card": { - "name": "card", - "check": "hash", - "validation": "hash", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "If the SetupIntent's payment_method_types includes `card`, this hash contains the configurations that will be applied to each setup attempt of that type.\n", - "undocumented": false, - "html": "If the SetupIntent’s payment_method_types includes \u003Ccode\u003Ecard\u003C/code\u003E, this hash contains the configurations that will be applied to each setup attempt of that type." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "subspec": { - "mandate_options": { - "name": "mandate_options", - "check": "hash", - "validation": "hash", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Configuration options for setting up an eMandate for cards issued in India.", - "undocumented": false, - "html": "Configuration options for setting up an eMandate for cards issued in India." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "subspec": { - "amount": { - "name": "amount", - "check": "positive_integer", - "validation": "positive integer", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Amount to be charged for future payments.", - "undocumented": false, - "html": "Amount to be charged for future payments." - }, - "gate": false, - "hide_unset_desc": null, - "required": true, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "amount" - }, - "amount_type": { - "name": "amount_type", - "check": "string", - "validation": "string", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "One of `fixed` or `maximum`. If `fixed`, the `amount` param refers to the exact amount to be charged in future payments. If `maximum`, the amount charged can be up to the value passed for the `amount` param.\n", - "undocumented": false, - "html": "One of \u003Ccode\u003Efixed\u003C/code\u003E or \u003Ccode\u003Emaximum\u003C/code\u003E. If \u003Ccode\u003Efixed\u003C/code\u003E, the \u003Ccode\u003Eamount\u003C/code\u003E param refers to the exact amount to be charged in future payments. If \u003Ccode\u003Emaximum\u003C/code\u003E, the amount charged can be up to the value passed for the \u003Ccode\u003Eamount\u003C/code\u003E param." - }, - "gate": false, - "hide_unset_desc": null, - "required": true, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "amount_type" - }, - "currency": { - "name": "currency", - "check": "currency", - "validation": "currency", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. Must be a [supported currency](https://stripe.com/docs/currencies).", - "undocumented": false, - "html": "Three-letter \u003Ca href=\"https://www.iso.org/iso-4217-currency-codes.html\"\u003EISO currency code\u003C/a\u003E, in lowercase. Must be a \u003Ca href=\"https://stripe.com/docs/currencies\"\u003Esupported currency\u003C/a\u003E." - }, - "gate": false, - "hide_unset_desc": null, - "required": true, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "currency" - }, - "description": { - "name": "description", - "check": "string", - "validation": "string", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "A description of the mandate or subscription that is meant to be displayed to the customer.", - "undocumented": false, - "html": "A description of the mandate or subscription that is meant to be displayed to the customer." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "description" - }, - "end_date": { - "name": "end_date", - "check": "timestamp", - "validation": "timestamp", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "End date of the mandate or subscription. If not provided, the mandate will be active until canceled. If provided, end date should be after start date.\n", - "undocumented": false, - "html": "End date of the mandate or subscription. If not provided, the mandate will be active until canceled. If provided, end date should be after start date." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "end_date" - }, - "interval": { - "name": "interval", - "check": "string", - "validation": "string", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Specifies payment frequency. One of `day`, `week`, `month`, `year`, or `sporadic`.\n", - "undocumented": false, - "html": "Specifies payment frequency. One of \u003Ccode\u003Eday\u003C/code\u003E, \u003Ccode\u003Eweek\u003C/code\u003E, \u003Ccode\u003Emonth\u003C/code\u003E, \u003Ccode\u003Eyear\u003C/code\u003E, or \u003Ccode\u003Esporadic\u003C/code\u003E." - }, - "gate": false, - "hide_unset_desc": null, - "required": true, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "interval" - }, - "interval_count": { - "name": "interval_count", - "check": "positive_integer", - "validation": "positive integer", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "The number of intervals between payments. For example, `interval=month` and `interval_count=3` indicates one payment every three months. Maximum of one year interval allowed (1 year, 12 months, or 52 weeks). This parameter is optional when `interval=sporadic`.\n", - "undocumented": false, - "html": "The number of intervals between payments. For example, \u003Ccode\u003Einterval=month\u003C/code\u003E and \u003Ccode\u003Einterval_count=3\u003C/code\u003E indicates one payment every three months. Maximum of one year interval allowed (1 year, 12 months, or 52 weeks). This parameter is optional when \u003Ccode\u003Einterval=sporadic\u003C/code\u003E." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "interval_count" - }, - "reference": { - "name": "reference", - "check": "string", - "validation": "string", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Unique identifier for the mandate or subscription.", - "undocumented": false, - "html": "Unique identifier for the mandate or subscription." - }, - "gate": false, - "hide_unset_desc": null, - "required": true, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "reference" - }, - "start_date": { - "name": "start_date", - "check": "timestamp", - "validation": "timestamp", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Start date of the mandate or subscription. Start date should not be lesser than yesterday.\n", - "undocumented": false, - "html": "Start date of the mandate or subscription. Start date should not be lesser than yesterday." - }, - "gate": false, - "hide_unset_desc": null, - "required": true, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "start_date" - }, - "supported_types": { - "name": "supported_types", - "check": "array", - "validation": "array", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Specifies the type of mandates supported. Possible values are `india`.\n", - "undocumented": false, - "html": "Specifies the type of mandates supported. Possible values are \u003Ccode\u003Eindia\u003C/code\u003E." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "supported_types" - } - }, - "object_type": "mandate_options" - }, - "network": { - "name": "network", - "check": "string", - "validation": "string", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Selected network to process this SetupIntent on. Depends on the available networks of the card attached to the setup intent. Can be only set confirm-time.", - "undocumented": false, - "html": "Selected network to process this SetupIntent on. Depends on the available networks of the card attached to the setup intent. Can be only set confirm-time." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "network" - }, - "request_three_d_secure": { - "name": "request_three_d_secure", - "check": "string", - "validation": "string", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "We strongly recommend that you rely on our SCA Engine to automatically prompt your customers for authentication based on risk level and [other requirements](/docs/strong-customer-authentication). However, if you wish to request 3D Secure based on logic from your own fraud engine, provide this option. Permitted values include: `automatic` or `any`. If not provided, defaults to `automatic`. Read our guide on [manually requesting 3D Secure](/docs/payments/3d-secure#manual-three-ds) for more information on how this configuration interacts with Radar and our SCA Engine.", - "undocumented": false, - "html": "We strongly recommend that you rely on our SCA Engine to automatically prompt your customers for authentication based on risk level and \u003Ca href=\"/docs/strong-customer-authentication\"\u003Eother requirements\u003C/a\u003E. However, if you wish to request 3D Secure based on logic from your own fraud engine, provide this option. Permitted values include: \u003Ccode\u003Eautomatic\u003C/code\u003E or \u003Ccode\u003Eany\u003C/code\u003E. If not provided, defaults to \u003Ccode\u003Eautomatic\u003C/code\u003E. Read our guide on \u003Ca href=\"/docs/payments/3d-secure#manual-three-ds\"\u003Emanually requesting 3D Secure\u003C/a\u003E for more information on how this configuration interacts with Radar and our SCA Engine." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": "advanced", - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "request_three_d_secure" - } - }, - "object_type": "card" - }, - "link": { - "name": "link", - "check": "hash", - "validation": "hash", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "If the SetupIntent's payment_method_types includes `link`, this hash contains the configurations that will be applied to each setup attempt of that type.\n", - "undocumented": false, - "html": "If the SetupIntent’s payment_method_types includes \u003Ccode\u003Elink\u003C/code\u003E, this hash contains the configurations that will be applied to each setup attempt of that type." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "subspec": { - "persistent_token": { - "name": "persistent_token", - "check": "string", - "validation": "string", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Token used for persistent Link logins.", - "undocumented": false, - "html": "Token used for persistent Link logins." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "persistent_token" - } - }, - "object_type": "link" - }, - "sepa_debit": { - "name": "sepa_debit", - "check": "hash", - "validation": "hash", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "If the SetupIntent's payment_method_types includes `sepa_debit`, this hash contains the configurations that will be applied to each setup attempt of that type.\n", - "undocumented": false, - "html": "If the SetupIntent’s payment_method_types includes \u003Ccode\u003Esepa_debit\u003C/code\u003E, this hash contains the configurations that will be applied to each setup attempt of that type." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "subspec": { - "mandate_options": { - "name": "mandate_options", - "check": "hash", - "validation": "hash", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Additional fields for Mandate creation", - "undocumented": false, - "html": "Additional fields for Mandate creation" - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "subspec": {}, - "object_type": "mandate_options" - } - }, - "object_type": "sepa_debit" - }, - "us_bank_account": { - "name": "us_bank_account", - "check": "hash", - "validation": "hash", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "If the SetupIntent's payment_method_types includes `us_bank_account`, this hash contains the configurations that will be applied to each setup attempt of that type.\n", - "undocumented": false, - "html": "If the SetupIntent’s payment_method_types includes \u003Ccode\u003Eus_bank_account\u003C/code\u003E, this hash contains the configurations that will be applied to each setup attempt of that type." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "subspec": { - "financial_connections": { - "name": "financial_connections", - "check": "hash", - "validation": "hash", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Additional fields for Financial Connections Session creation", - "undocumented": false, - "html": "Additional fields for Financial Connections Session creation" - }, - "gate": true, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "subspec": { - "permissions": { - "name": "permissions", - "check": "array", - "validation": "array", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "The list of permissions to request. The `payment_method` permission must be included.", - "undocumented": false, - "html": "The list of permissions to request. The \u003Ccode\u003Epayment_method\u003C/code\u003E permission must be included." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "enum_values": { - "payment_method": { - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Allows the creation of a payment method from the account.", - "undocumented": false, - "html": "Allows the creation of a payment method from the account." - } - }, - "balances": { - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Allows accessing balance data from the account.", - "undocumented": false, - "html": "Allows accessing balance data from the account." - } - }, - "transactions": { - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Allows accessing transactions data from the account.", - "undocumented": false, - "html": "Allows accessing transactions data from the account." - } - }, - "ownership": { - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Allows accessing ownership data from the account.", - "undocumented": false, - "html": "Allows accessing ownership data from the account." - } - } - }, - "object_type": "permissions" - } - }, - "object_type": "financial_connections" - }, - "verification_method": { - "name": "verification_method", - "check": "string", - "validation": "string", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Bank account verification method.", - "undocumented": false, - "html": "Bank account verification method." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "enum_values": { - "automatic": { - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Instant verification with fallback to microdeposits.", - "undocumented": false, - "html": "Instant verification with fallback to microdeposits." - } - }, - "instant": { - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Instant verification only.", - "undocumented": false, - "html": "Instant verification only." - } - }, - "microdeposits": { - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Verification using microdeposits. Cannot be used with Stripe Checkout or Hosted Invoices.", - "undocumented": false, - "html": "Verification using microdeposits. Cannot be used with Stripe Checkout or Hosted Invoices." - } - } - }, - "object_type": "verification_method" - } - }, - "object_type": "us_bank_account" - } - }, - "object_type": "payment_method_options", - "less_common": true - }, - "payment_method_types": { - "name": "payment_method_types", - "check": "string_array", - "validation": "array containing strings", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "The list of payment method types (e.g. card) that this SetupIntent is allowed to set up.", - "undocumented": false, - "html": "The list of payment method types (e.g. card) that this SetupIntent is allowed to set up." - }, - "gate": false, - "hide_unset_desc": null, - "required": true, - "default": null, - "badge_text": "retrievable with publishable key", - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "payment_method_types" - }, - "single_use_mandate": { - "name": "single_use_mandate", - "check": "string", - "validation": "string", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "ID of the single_use Mandate generated by the SetupIntent.", - "undocumented": false, - "html": "ID of the single_use Mandate generated by the SetupIntent." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "user_expandable": ["mandate"], - "object_type": "single_use_mandate", - "less_common": true - }, - "status": { - "name": "status", - "check": "string", - "validation": "string", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "[Status](/docs/payments/intents#intent-statuses) of this SetupIntent, one of `requires_payment_method`, `requires_confirmation`, `requires_action`, `processing`, `canceled`, or `succeeded`. ", - "undocumented": false, - "html": "\u003Ca href=\"/docs/payments/intents#intent-statuses\"\u003EStatus\u003C/a\u003E of this SetupIntent, one of \u003Ccode\u003Erequires_payment_method\u003C/code\u003E, \u003Ccode\u003Erequires_confirmation\u003C/code\u003E, \u003Ccode\u003Erequires_action\u003C/code\u003E, \u003Ccode\u003Eprocessing\u003C/code\u003E, \u003Ccode\u003Ecanceled\u003C/code\u003E, or \u003Ccode\u003Esucceeded\u003C/code\u003E. " - }, - "gate": false, - "hide_unset_desc": null, - "required": true, - "default": null, - "badge_text": "retrievable with publishable key", - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "status" - }, - "usage": { - "name": "usage", - "check": "string", - "validation": "string", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Indicates how the payment method is intended to be used in the future.\n\nUse `on_session` if you intend to only reuse the payment method when the customer is in your checkout flow. Use `off_session` if your customer may or may not be in your checkout flow. If not provided, this value defaults to `off_session`.\n", - "undocumented": false, - "html": "Indicates how the payment method is intended to be used in the future.\u003C/p\u003E\n\n\u003Cp\u003EUse \u003Ccode\u003Eon_session\u003C/code\u003E if you intend to only reuse the payment method when the customer is in your checkout flow. Use \u003Ccode\u003Eoff_session\u003C/code\u003E if your customer may or may not be in your checkout flow. If not provided, this value defaults to \u003Ccode\u003Eoff_session\u003C/code\u003E." - }, - "gate": false, - "hide_unset_desc": null, - "required": true, - "default": null, - "badge_text": "retrievable with publishable key", - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "usage" - } - } - }, - "source": { - "name": "source", - "check": "hash", - "validation": "hash", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "The source object for errors returned on a request involving a source.", - "undocumented": false, - "html": "The source object for errors returned on a request involving a source." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "source", - "less_common": true - } - }, - "status_codes": { - "200 - OK": "Everything worked as expected.", - "400 - Bad Request": "The request was unacceptable, often due to missing a required\n parameter.", - "401 - Unauthorized": "No valid API key provided.", - "402 - Request Failed": "The parameters were valid but the request failed.", - "403 - Forbidden": "The API key doesn't have permissions to perform the request.", - "404 - Not Found": "The requested resource doesn't exist.", - "409 - Conflict": "The request conflicts with another request (perhaps due to\n using the same idempotent key).", - "429 - Too Many Requests": "Too many requests hit the API too quickly. We recommend an\n exponential backoff of your requests.", - "500, 502, 503, 504 - Server Errors": "Something went wrong on Stripe's end. (These are rare.)" - }, - "error_types": { - "api_error": "API errors cover any other type of problem (e.g., a temporary\n problem with Stripe's servers), and are extremely\n uncommon.", - "card_error": "Card errors are the most common type of error you should\n expect to handle. They result when the user enters a card that\n can't be charged for some reason.", - "idempotency_error": "Idempotency errors occur when an `Idempotency-Key`\n is re-used on a request that does not match the first request's\n API endpoint and parameters.", - "invalid_request_error": "Invalid request errors arise when your request has invalid\n parameters." - }, - "section_type": "override", - "section_tag": "errors", - "version": null - } - }, - "error_handling": { - "title": "Handling errors", - "group_title": "Topics", - "group_anchor": "topics", - "anchor": "error_handling", - "section_anchor": "errors", - "subsection_anchors": null, - "path": "/errors/handling", - "gate": false, - "display_on_load": true, - "data": { - "catching_errors": "# Select a client library to see examples of handling different kinds of errors.", - "section_type": "override", - "section_tag": "error_handling", - "version": null - } - }, - "expanding_objects": { - "title": "Expanding Responses", - "group_title": "Topics", - "group_anchor": "topics", - "anchor": "expanding_objects", - "section_anchor": "expanding_objects", - "subsection_anchors": [], - "path": "/expanding_objects", - "gate": false, - "display_on_load": true, - "data": { - "request": "curl https://api.stripe.com/v1/charges/ch_3MWb7X2eZvKYlo2C1KB2kTo6 \\\n -u sk_test_4eC39HqLyjWDarjtT1zdp7dc: \\\n -d \"expand[]\"=customer \\\n -d \"expand[]\"=\"invoice.subscription\" \\\n -G \n", - "response": "{\n \"id\": \"ch_3MWb7X2eZvKYlo2C1KB2kTo6\",\n \"object\": \"charge\",\n \"customer\": {\n \"id\": \"cu_14HOtK2eZvKYlo2CPM0hlYU6\",\n \"object\": \"customer\",\n ...\n },\n \"invoice\": {\n \"id\": \"in_1MWb7X2eZvKYlo2CyCNOr7gc\",\n \"object\": \"invoice\",\n \"subscription\": {\n \"id\": \"su_1MWTmm2eZvKYlo2CljDPJAXI\",\n \"object\": \"subscription\",\n ...\n },\n ...\n },\n ...\n}\n", - "section_type": "override", - "section_tag": "expanding_objects", - "version": null - } - }, - "idempotent_requests": { - "title": "Idempotent Requests", - "group_title": "Topics", - "group_anchor": "topics", - "anchor": "idempotent_requests", - "section_anchor": "idempotent_requests", - "subsection_anchors": [], - "path": "/idempotent_requests", - "gate": false, - "display_on_load": true, - "data": { - "request": "curl https://api.stripe.com/v1/charges \\\n -u sk_test_4eC39HqLyjWDarjtT1zdp7dc: \\\n -H \"Idempotency-Key: CT8tudz1NP1rlrBL\" \\\n -d amount=2000 \\\n -d currency=usd \\\n -d description=\"My First Test Charge (created for API docs at https://www.stripe.com/docs/api)\" \\\n -d source=tok_amex\n", - "section_type": "override", - "section_tag": "idempotent_requests", - "version": null - } - }, - "metadata": { - "title": "Metadata", - "group_title": "Topics", - "group_anchor": "topics", - "anchor": "metadata", - "section_anchor": "metadata", - "subsection_anchors": [], - "path": "/metadata", - "gate": false, - "display_on_load": true, - "data": { - "max_metadata_hash_length": 50, - "max_metadata_key_length": 40, - "max_metadata_val_length": 500, - "request": "curl https://api.stripe.com/v1/charges \\\n -u sk_test_4eC39HqLyjWDarjtT1zdp7dc: \\\n -d amount=2000 \\\n -d currency=usd \\\n -d source=tok_mastercard \\\n -d \"metadata[order_id]\"=6735\n", - "response": "{\n \"id\": \"ch_3MWb7X2eZvKYlo2C1KB2kTo6\",\n \"object\": \"charge\",\n \"amount\": 100,\n \"amount_captured\": 0,\n \"amount_refunded\": 0,\n \"application\": null,\n \"application_fee\": null,\n \"application_fee_amount\": null,\n \"balance_transaction\": \"txn_1032HU2eZvKYlo2CEPtcnUvl\",\n \"billing_details\": {\n \"address\": {\n \"city\": null,\n \"country\": null,\n \"line1\": null,\n \"line2\": null,\n \"postal_code\": null,\n \"state\": null\n },\n \"email\": null,\n \"name\": \"Jenny Rosen\",\n \"phone\": null\n },\n \"calculated_statement_descriptor\": null,\n \"captured\": false,\n \"created\": 1675237963,\n \"currency\": \"usd\",\n \"customer\": null,\n \"description\": \"My First Test Charge (created for API docs)\",\n \"disputed\": false,\n \"failure_balance_transaction\": null,\n \"failure_code\": null,\n \"failure_message\": null,\n \"fraud_details\": {\n },\n \"invoice\": null,\n \"livemode\": false,\n \"metadata\": {\n \"order_id\": \"6735\"\n },\n \"on_behalf_of\": null,\n \"outcome\": null,\n \"paid\": true,\n \"payment_intent\": null,\n \"payment_method\": \"card_19yUNL2eZvKYlo2CNGsN6EWH\",\n \"payment_method_details\": {\n \"card\": {\n \"brand\": \"visa\",\n \"checks\": {\n \"address_line1_check\": null,\n \"address_postal_code_check\": null,\n \"cvc_check\": \"unchecked\"\n },\n \"country\": \"US\",\n \"exp_month\": 12,\n \"exp_year\": 2020,\n \"fingerprint\": \"Xt5EWLLDS7FJjR1c\",\n \"funding\": \"credit\",\n \"installments\": null,\n \"last4\": \"4242\",\n \"mandate\": null,\n \"moto\": null,\n \"network\": \"visa\",\n \"three_d_secure\": null,\n \"wallet\": null\n },\n \"type\": \"card\"\n },\n \"receipt_email\": null,\n \"receipt_number\": null,\n \"receipt_url\": \"https://pay.stripe.com/receipts/payment/CAcaFwoVYWNjdF8xMDMyRDgyZVp2S1lsbzJDKMu06J4GMgZ4ImztWGw6LBYRWL0yYgVbwr5-BuvCWt-87N58fiDJrNN9KIJ_pXcMXf3ZCnM4EgEKjLVd\",\n \"redaction\": null,\n \"refunded\": false,\n \"refunds\": {\n \"object\": \"list\",\n \"data\": [\n\n ],\n \"has_more\": false,\n \"url\": \"/v1/charges/ch_3MWb7X2eZvKYlo2C1KB2kTo6/refunds\"\n },\n \"review\": null,\n \"shipping\": null,\n \"source_transfer\": null,\n \"statement_descriptor\": null,\n \"statement_descriptor_suffix\": null,\n \"status\": \"succeeded\",\n \"transfer_data\": null,\n \"transfer_group\": null\n}", - "section_type": "override", - "section_tag": "metadata", - "version": null - } - }, - "pagination": { - "title": "Pagination", - "group_title": "Topics", - "group_anchor": "topics", - "anchor": "pagination", - "section_anchor": "pagination", - "subsection_anchors": ["search_pagination", "auto_pagination"], - "path": "/pagination", - "gate": false, - "display_on_load": true, - "data": { - "example_auto_pagination": "# The auto-pagination feature is specific to Stripe's\n # libraries and cannot be used directly with curl.\n", - "request_data": { - "test_key": "sk_test_4eC39HqLyjWDarjtT1zdp7dc", - "action_type": "list", - "action_name": null, - "action_path": null, - "resource_name": "customer", - "parent_resource_name": null, - "namespace": null, - "test_helper": false, - "request_params": { "limit": 3 }, - "url_params": {}, - "overridden_languages": [], - "preamble_comment": null - }, - "response": "{\n \"object\": \"list\",\n \"url\": \"/v1/customers\",\n \"has_more\": false,\n \"data\": [\n {\n \"id\": \"cus_4QFOF3xrvBT2nU\",\n \"object\": \"customer\",\n \"address\": null,\n \"balance\": 0,\n \"created\": 1405641986,\n \"currency\": \"usd\",\n \"default_source\": \"card_14HOtJ2eZvKYlo2CD2lt4r4W\",\n \"delinquent\": true,\n \"description\": \"someone@example.com for Coderwall\",\n \"discount\": null,\n \"email\": \"namedaa4a2aa-1ff9-4235-a8a8-3896844a1c54@test.com\",\n \"invoice_prefix\": \"93EC0E1\",\n \"invoice_settings\": {\n \"custom_fields\": null,\n \"default_payment_method\": null,\n \"footer\": null,\n \"rendering_options\": null\n },\n \"livemode\": false,\n \"metadata\": {\n \"CustomerReferenceId\": \"16527612\",\n \"CustomerReferenceType\": \"reedonline\",\n \"tag-key\": \"tag-value\",\n \"meta-key\": \"meta-value\",\n \"order_id\": \"6735\",\n \"order_id_1\": \"6735\"\n },\n \"name\": \"priyal26\",\n \"next_invoice_sequence\": 572508,\n \"phone\": null,\n \"preferred_locales\": [\n \n ],\n \"shipping\": null,\n \"tax_exempt\": \"none\",\n \"test_clock\": null\n },\n {...},\n {...}\n ]\n}\n", - "section_type": "override", - "section_tag": "pagination", - "version": null - } - }, - "search_pagination": { - "title": "Search", - "group_title": "Topics", - "group_anchor": "topics", - "anchor": "search_pagination", - "section_anchor": "pagination", - "subsection_anchors": null, - "path": "/pagination/search", - "gate": false, - "display_on_load": true, - "data": { - "section_type": "override", - "title": "Search customers", - "description": "Search for customers you’ve previously created using Stripe’s \u003Ca href=\"/docs/search#search-query-language\"\u003ESearch Query Language\u003C/a\u003E.\nDon’t use search in read-after-write flows where strict consistency is necessary. Under normal operating\nconditions, data is searchable in less than a minute. Occasionally, propagation of new or updated data can be up\nto an hour behind during outages. Search functionality is not available to merchants in India.", - "top_level_changes": [], - "changes": {}, - "version": null, - "returns": "A dictionary with a \u003Ccode\u003Edata\u003C/code\u003E property that contains an array of up to \u003Ccode\u003Elimit\u003C/code\u003E customers. If no objects match the\nquery, the resulting array will be empty. See the related guide on \u003Ca href=\"/docs/expand#lists\"\u003Eexpanding properties in lists\u003C/a\u003E.", - "section_tag": "search_pagination", - "specs": { - "query": { - "name": "query", - "check": null, - "validation": "", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "The search query string. See [search query language](/docs/search#search-query-language) and the list of supported [query fields for customers](/docs/search#query-fields-for-customers).", - "undocumented": false, - "html": "The search query string. See \u003Ca href=\"/docs/search#search-query-language\"\u003Esearch query language\u003C/a\u003E and the list of supported \u003Ca href=\"/docs/search#query-fields-for-customers\"\u003Equery fields for customers\u003C/a\u003E." - }, - "gate": false, - "hide_unset_desc": false, - "required": true, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "deprecated_allow_empty": false, - "object_type": "query" - }, - "limit": { - "name": "limit", - "check": null, - "validation": "", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 10.", - "undocumented": false, - "html": "A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 10." - }, - "gate": false, - "hide_unset_desc": false, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "object_type": "limit" - }, - "page": { - "name": "page", - "check": null, - "validation": "", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "A cursor for pagination across multiple pages of results. Don't include this parameter on the first call. Use the next_page value returned in a previous response to request subsequent results.", - "undocumented": false, - "html": "A cursor for pagination across multiple pages of results. Don’t include this parameter on the first call. Use the next_page value returned in a previous response to request subsequent results." - }, - "gate": false, - "hide_unset_desc": false, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "deprecated_allow_empty": false, - "object_type": "page" - } - }, - "supported_languages": null, - "action": "method", - "curl_definition": "GET /v1/customers/search", - "request": "curl https://api.stripe.com/v1/customers/search \\\n -u sk_test_4eC39HqLyjWDarjtT1zdp7dc: \\\n --data-urlencode query=\"name:'fakename' AND metadata['foo']:'bar'\" \\\n -G\n", - "request_data": { - "test_key": "sk_test_4eC39HqLyjWDarjtT1zdp7dc", - "action_type": "custom", - "action_name": "search", - "action_path": "search", - "resource_name": "customer", - "parent_resource_name": null, - "namespace": null, - "test_helper": false, - "request_params": { "query": "name:'fakename' AND metadata['foo']:'bar'" }, - "url_params": {}, - "overridden_languages": ["curl", "java", "go"], - "preamble_comment": null - }, - "response": "{\n \"object\": \"search_result\",\n \"url\": \"/v1/customers/search\",\n \"has_more\": false,\n \"data\": [\n {\n \"id\": \"cus_4QFOF3xrvBT2nU\",\n \"object\": \"customer\",\n \"address\": null,\n \"balance\": 0,\n \"created\": 1405641986,\n \"currency\": \"usd\",\n \"default_source\": \"card_14HOtJ2eZvKYlo2CD2lt4r4W\",\n \"delinquent\": true,\n \"description\": \"someone@example.com for Coderwall\",\n \"discount\": null,\n \"email\": \"namedaa4a2aa-1ff9-4235-a8a8-3896844a1c54@test.com\",\n \"invoice_prefix\": \"93EC0E1\",\n \"invoice_settings\": {\n \"custom_fields\": null,\n \"default_payment_method\": null,\n \"footer\": null,\n \"rendering_options\": null\n },\n \"livemode\": false,\n \"metadata\": {\n \"foo\": \"bar\"\n },\n \"name\": \"fakename\",\n \"next_invoice_sequence\": 572508,\n \"phone\": null,\n \"preferred_locales\": [\n \n ],\n \"shipping\": null,\n \"tax_exempt\": \"none\",\n \"test_clock\": null\n },\n {...},\n {...}\n ]\n}\n" - } - }, - "auto_pagination": { - "title": "Auto-pagination", - "group_title": "Topics", - "group_anchor": "topics", - "anchor": "auto_pagination", - "section_anchor": "pagination", - "subsection_anchors": null, - "path": "/pagination/auto", - "gate": false, - "display_on_load": true, - "data": { - "request": "# The auto-pagination feature is specific to Stripe's\n # libraries and cannot be used directly with curl.\n", - "section_type": "override", - "section_tag": "auto_pagination", - "version": null - } - }, - "request_ids": { - "title": "Request IDs", - "group_title": "Topics", - "group_anchor": "topics", - "anchor": "request_ids", - "section_anchor": "request_ids", - "subsection_anchors": [], - "path": "/request_ids", - "gate": false, - "display_on_load": true, - "data": { - "request": "curl https://api.stripe.com/v1/customers \\\n -u sk_test_4eC39HqLyjWDarjtT1zdp7dc: \\\n -D \"-\" \\\n -X POST\n", - "section_type": "override", - "section_tag": "request_ids", - "version": null - } - }, - "versioning": { - "title": "Versioning", - "group_title": "Topics", - "group_anchor": "topics", - "anchor": "versioning", - "section_anchor": "versioning", - "subsection_anchors": [], - "path": "/versioning", - "gate": false, - "display_on_load": true, - "data": { - "current_version": "2022-11-15", - "example_version_on_request": "", - "merchant": false, - "request": "curl https://api.stripe.com/v1/charges \\\n -u sk_test_4eC39HqLyjWDarjtT1zdp7dc: \\\n -H \"Stripe-Version: 2022-11-15\"\n", - "section_type": "override", - "section_tag": "versioning", - "version": null - } - }, - "balance": { - "title": "Balance", - "group_title": "Core Resources", - "group_anchor": "core_resources", - "anchor": "balance", - "section_anchor": "balance", - "subsection_anchors": ["balance_object", "retrieve_balance"], - "path": "/balance", - "gate": false, - "display_on_load": false, - "data": { - "section_type": "resource", - "title": "Balance", - "description": "This is an object representing your Stripe balance. You can retrieve it to see\nthe balance currently on your Stripe account.\n\nYou can also retrieve the balance history, which contains a list of\n[transactions](/docs/reporting/balance-transaction-types) that contributed to the balance\n(charges, payouts, and so forth).\n\nThe available and pending amounts for each currency are broken down further by\npayment source types.\n\nRelated guide: [Understanding Connect Account Balances](/docs/connect/account-balances).\n", - "section_tag": "balance", - "subsection_summaries": [ - { "anchor": "balance_object", "curl_definition": null }, - { "anchor": "retrieve_balance", "curl_definition": "GET /v1/balance" } - ] - } - }, - "balance_object": { - "title": "The balance object", - "group_title": "Core Resources", - "group_anchor": "core_resources", - "anchor": "balance_object", - "section_anchor": "balance", - "subsection_anchors": null, - "path": "/balance/balance_object", - "gate": false, - "display_on_load": false - }, - "retrieve_balance": { - "title": "Retrieve balance", - "group_title": "Core Resources", - "group_anchor": "core_resources", - "anchor": "retrieve_balance", - "section_anchor": "balance", - "subsection_anchors": null, - "path": "/balance/balance_retrieve", - "gate": false, - "display_on_load": false - }, - "balance_transactions": { - "title": "Balance Transactions", - "group_title": "Core Resources", - "group_anchor": "core_resources", - "anchor": "balance_transactions", - "section_anchor": "balance_transactions", - "subsection_anchors": [ - "balance_transaction_object", - "balance_transaction_retrieve", - "balance_transaction_list" - ], - "path": "/balance_transactions", - "gate": false, - "display_on_load": false, - "data": { - "section_type": "resource", - "title": "Balance Transactions", - "description": "Balance transactions represent funds moving through your Stripe account.\nThey're created for every type of transaction that comes into or flows out of your Stripe account balance.\n\nRelated guide: [Balance Transaction Types](/docs/reports/balance-transaction-types).\n", - "section_tag": "balance_transactions", - "subsection_summaries": [ - { "anchor": "balance_transaction_object", "curl_definition": null }, - { - "anchor": "balance_transaction_retrieve", - "curl_definition": "GET /v1/balance_transactions/:id" - }, - { "anchor": "balance_transaction_list", "curl_definition": "GET /v1/balance_transactions" } - ] - } - }, - "balance_transaction_object": { - "title": "The balance transaction object", - "group_title": "Core Resources", - "group_anchor": "core_resources", - "anchor": "balance_transaction_object", - "section_anchor": "balance_transactions", - "subsection_anchors": null, - "path": "/balance_transactions/object", - "gate": false, - "display_on_load": false - }, - "balance_transaction_retrieve": { - "title": "Retrieve a balance transaction", - "group_title": "Core Resources", - "group_anchor": "core_resources", - "anchor": "balance_transaction_retrieve", - "section_anchor": "balance_transactions", - "subsection_anchors": null, - "path": "/balance_transactions/retrieve", - "gate": false, - "display_on_load": false - }, - "balance_transaction_list": { - "title": "List all balance transactions", - "group_title": "Core Resources", - "group_anchor": "core_resources", - "anchor": "balance_transaction_list", - "section_anchor": "balance_transactions", - "subsection_anchors": null, - "path": "/balance_transactions/list", - "gate": false, - "display_on_load": false - }, - "charges": { - "title": "Charges", - "group_title": "Core Resources", - "group_anchor": "core_resources", - "anchor": "charges", - "section_anchor": "charges", - "subsection_anchors": [ - "charge_object", - "create_charge", - "retrieve_charge", - "update_charge", - "capture_charge", - "list_charges", - "search_charges" - ], - "path": "/charges", - "gate": false, - "display_on_load": false, - "data": { - "section_type": "resource", - "title": "Charges", - "description": "To charge a credit or a debit card, you create a `Charge` object. You can\nretrieve and refund individual charges as well as list all charges. Charges\nare identified by a unique, random ID.\n\nRelated guide: [Accept a payment with the Charges API](/docs/payments/accept-a-payment-charges).\n", - "section_tag": "charges", - "subsection_summaries": [ - { "anchor": "charge_object", "curl_definition": null }, - { "anchor": "create_charge", "curl_definition": "POST /v1/charges" }, - { "anchor": "retrieve_charge", "curl_definition": "GET /v1/charges/:id" }, - { "anchor": "update_charge", "curl_definition": "POST /v1/charges/:id" }, - { "anchor": "capture_charge", "curl_definition": "POST /v1/charges/:id/capture" }, - { "anchor": "list_charges", "curl_definition": "GET /v1/charges" }, - { "anchor": "search_charges", "curl_definition": "GET /v1/charges/search" } - ] - } - }, - "charge_object": { - "title": "The charge object", - "group_title": "Core Resources", - "group_anchor": "core_resources", - "anchor": "charge_object", - "section_anchor": "charges", - "subsection_anchors": null, - "path": "/charges/object", - "gate": false, - "display_on_load": false - }, - "create_charge": { - "title": "Create a charge", - "group_title": "Core Resources", - "group_anchor": "core_resources", - "anchor": "create_charge", - "section_anchor": "charges", - "subsection_anchors": null, - "path": "/charges/create", - "gate": false, - "display_on_load": false - }, - "retrieve_charge": { - "title": "Retrieve a charge", - "group_title": "Core Resources", - "group_anchor": "core_resources", - "anchor": "retrieve_charge", - "section_anchor": "charges", - "subsection_anchors": null, - "path": "/charges/retrieve", - "gate": false, - "display_on_load": false - }, - "update_charge": { - "title": "Update a charge", - "group_title": "Core Resources", - "group_anchor": "core_resources", - "anchor": "update_charge", - "section_anchor": "charges", - "subsection_anchors": null, - "path": "/charges/update", - "gate": false, - "display_on_load": false - }, - "capture_charge": { - "title": "Capture a charge", - "group_title": "Core Resources", - "group_anchor": "core_resources", - "anchor": "capture_charge", - "section_anchor": "charges", - "subsection_anchors": null, - "path": "/charges/capture", - "gate": false, - "display_on_load": false - }, - "list_charges": { - "title": "List all charges", - "group_title": "Core Resources", - "group_anchor": "core_resources", - "anchor": "list_charges", - "section_anchor": "charges", - "subsection_anchors": null, - "path": "/charges/list", - "gate": false, - "display_on_load": false - }, - "search_charges": { - "title": "Search charges", - "group_title": "Core Resources", - "group_anchor": "core_resources", - "anchor": "search_charges", - "section_anchor": "charges", - "subsection_anchors": null, - "path": "/charges/search", - "gate": false, - "display_on_load": false - }, - "customers": { - "title": "Customers", - "group_title": "Core Resources", - "group_anchor": "core_resources", - "anchor": "customers", - "section_anchor": "customers", - "subsection_anchors": [ - "customer_object", - "create_customer", - "retrieve_customer", - "update_customer", - "delete_customer", - "list_customers", - "search_customers" - ], - "path": "/customers", - "gate": false, - "display_on_load": false, - "data": { - "section_type": "resource", - "title": "Customers", - "description": "This object represents a customer of your business. It lets you create recurring charges and track payments that belong to the same customer.\n\nRelated guide: [Save a card during payment](/docs/payments/save-during-payment).\n", - "section_tag": "customers", - "subsection_summaries": [ - { "anchor": "customer_object", "curl_definition": null }, - { "anchor": "create_customer", "curl_definition": "POST /v1/customers" }, - { "anchor": "retrieve_customer", "curl_definition": "GET /v1/customers/:id" }, - { "anchor": "update_customer", "curl_definition": "POST /v1/customers/:id" }, - { "anchor": "delete_customer", "curl_definition": "DELETE /v1/customers/:id" }, - { "anchor": "list_customers", "curl_definition": "GET /v1/customers" }, - { "anchor": "search_customers", "curl_definition": "GET /v1/customers/search" } - ] - } - }, - "customer_object": { - "title": "The customer object", - "group_title": "Core Resources", - "group_anchor": "core_resources", - "anchor": "customer_object", - "section_anchor": "customers", - "subsection_anchors": null, - "path": "/customers/object", - "gate": false, - "display_on_load": false - }, - "create_customer": { - "title": "Create a customer", - "group_title": "Core Resources", - "group_anchor": "core_resources", - "anchor": "create_customer", - "section_anchor": "customers", - "subsection_anchors": null, - "path": "/customers/create", - "gate": false, - "display_on_load": false - }, - "retrieve_customer": { - "title": "Retrieve a customer", - "group_title": "Core Resources", - "group_anchor": "core_resources", - "anchor": "retrieve_customer", - "section_anchor": "customers", - "subsection_anchors": null, - "path": "/customers/retrieve", - "gate": false, - "display_on_load": false - }, - "update_customer": { - "title": "Update a customer", - "group_title": "Core Resources", - "group_anchor": "core_resources", - "anchor": "update_customer", - "section_anchor": "customers", - "subsection_anchors": null, - "path": "/customers/update", - "gate": false, - "display_on_load": false - }, - "delete_customer": { - "title": "Delete a customer", - "group_title": "Core Resources", - "group_anchor": "core_resources", - "anchor": "delete_customer", - "section_anchor": "customers", - "subsection_anchors": null, - "path": "/customers/delete", - "gate": false, - "display_on_load": false - }, - "list_customers": { - "title": "List all customers", - "group_title": "Core Resources", - "group_anchor": "core_resources", - "anchor": "list_customers", - "section_anchor": "customers", - "subsection_anchors": null, - "path": "/customers/list", - "gate": false, - "display_on_load": false - }, - "search_customers": { - "title": "Search customers", - "group_title": "Core Resources", - "group_anchor": "core_resources", - "anchor": "search_customers", - "section_anchor": "customers", - "subsection_anchors": null, - "path": "/customers/search", - "gate": false, - "display_on_load": false - }, - "disputes": { - "title": "Disputes", - "group_title": "Core Resources", - "group_anchor": "core_resources", - "anchor": "disputes", - "section_anchor": "disputes", - "subsection_anchors": [ - "dispute_object", - "dispute_evidence_object", - "retrieve_dispute", - "update_dispute", - "close_dispute", - "list_disputes" - ], - "path": "/disputes", - "gate": false, - "display_on_load": false, - "data": { - "section_type": "resource", - "title": "Disputes", - "description": "A dispute occurs when a customer questions your charge with their card issuer.\nWhen this happens, you're given the opportunity to respond to the dispute with\nevidence that shows that the charge is legitimate. You can find more\ninformation about the dispute process in our [Disputes and\nFraud](/docs/disputes) documentation.\n\nRelated guide: [Disputes and Fraud](/docs/disputes).\n", - "section_tag": "disputes", - "subsection_summaries": [ - { "anchor": "dispute_object", "curl_definition": null }, - { "anchor": "dispute_evidence_object", "curl_definition": null }, - { "anchor": "retrieve_dispute", "curl_definition": "GET /v1/disputes/:id" }, - { "anchor": "update_dispute", "curl_definition": "POST /v1/disputes/:id" }, - { "anchor": "close_dispute", "curl_definition": "POST /v1/disputes/:id/close" }, - { "anchor": "list_disputes", "curl_definition": "GET /v1/disputes" } - ] - } - }, - "dispute_object": { - "title": "The dispute object", - "group_title": "Core Resources", - "group_anchor": "core_resources", - "anchor": "dispute_object", - "section_anchor": "disputes", - "subsection_anchors": null, - "path": "/disputes/object", - "gate": false, - "display_on_load": false - }, - "dispute_evidence_object": { - "title": "The dispute evidence object", - "group_title": "Core Resources", - "group_anchor": "core_resources", - "anchor": "dispute_evidence_object", - "section_anchor": "disputes", - "subsection_anchors": null, - "path": "/disputes/evidence_object", - "gate": false, - "display_on_load": false - }, - "retrieve_dispute": { - "title": "Retrieve a dispute", - "group_title": "Core Resources", - "group_anchor": "core_resources", - "anchor": "retrieve_dispute", - "section_anchor": "disputes", - "subsection_anchors": null, - "path": "/disputes/retrieve", - "gate": false, - "display_on_load": false - }, - "update_dispute": { - "title": "Update a dispute", - "group_title": "Core Resources", - "group_anchor": "core_resources", - "anchor": "update_dispute", - "section_anchor": "disputes", - "subsection_anchors": null, - "path": "/disputes/update", - "gate": false, - "display_on_load": false - }, - "close_dispute": { - "title": "Close a dispute", - "group_title": "Core Resources", - "group_anchor": "core_resources", - "anchor": "close_dispute", - "section_anchor": "disputes", - "subsection_anchors": null, - "path": "/disputes/close", - "gate": false, - "display_on_load": false - }, - "list_disputes": { - "title": "List all disputes", - "group_title": "Core Resources", - "group_anchor": "core_resources", - "anchor": "list_disputes", - "section_anchor": "disputes", - "subsection_anchors": null, - "path": "/disputes/list", - "gate": false, - "display_on_load": false - }, - "events": { - "title": "Events", - "group_title": "Core Resources", - "group_anchor": "core_resources", - "anchor": "events", - "section_anchor": "events", - "subsection_anchors": ["event_object", "retrieve_event", "list_events", "event_types"], - "path": "/events", - "gate": false, - "display_on_load": false, - "data": { - "section_type": "resource", - "title": "Events", - "description": "Events are our way of letting you know when something interesting happens in\nyour account. When an interesting event occurs, we create a new `Event`\nobject. For example, when a charge succeeds, we create a `charge.succeeded`\nevent; and when an invoice payment attempt fails, we create an\n`invoice.payment_failed` event. Note that many API requests may cause multiple\nevents to be created. For example, if you create a new subscription for a\ncustomer, you will receive both a `customer.subscription.created` event and a\n`charge.succeeded` event.\n\nEvents occur when the state of another API resource changes. The state of that\nresource at the time of the change is embedded in the event's data field. For\nexample, a `charge.succeeded` event will contain a charge, and an\n`invoice.payment_failed` event will contain an invoice.\n\nAs with other API resources, you can use endpoints to retrieve an\n[individual event](#retrieve_event) or a [list of events](#list_events)\nfrom the API. We also have a separate\n[webhooks](http://en.wikipedia.org/wiki/Webhook) system for sending the\n`Event` objects directly to an endpoint on your server. Webhooks are managed\nin your\n[account settings](https://dashboard.stripe.com/account/webhooks),\nand our [Using Webhooks](/docs/webhooks) guide will help you get set up.\n\nWhen using [Connect](/docs/connect), you can also receive notifications of\nevents that occur in connected accounts. For these events, there will be an\nadditional `account` attribute in the received `Event` object.\n\n**NOTE:** Right now, access to events through the [Retrieve Event API](#retrieve_event) is\nguaranteed only for 30 days.\n", - "section_tag": "events", - "subsection_summaries": [ - { "anchor": "event_object", "curl_definition": null }, - { "anchor": "retrieve_event", "curl_definition": "GET /v1/events/:id" }, - { "anchor": "list_events", "curl_definition": "GET /v1/events" }, - { "anchor": "event_types", "curl_definition": null } - ] - } - }, - "event_object": { - "title": "The event object", - "group_title": "Core Resources", - "group_anchor": "core_resources", - "anchor": "event_object", - "section_anchor": "events", - "subsection_anchors": null, - "path": "/events/object", - "gate": false, - "display_on_load": false - }, - "retrieve_event": { - "title": "Retrieve an event", - "group_title": "Core Resources", - "group_anchor": "core_resources", - "anchor": "retrieve_event", - "section_anchor": "events", - "subsection_anchors": null, - "path": "/events/retrieve", - "gate": false, - "display_on_load": false - }, - "list_events": { - "title": "List all events", - "group_title": "Core Resources", - "group_anchor": "core_resources", - "anchor": "list_events", - "section_anchor": "events", - "subsection_anchors": null, - "path": "/events/list", - "gate": false, - "display_on_load": false - }, - "event_types": { - "title": "Types of events", - "group_title": "Core Resources", - "group_anchor": "core_resources", - "anchor": "event_types", - "section_anchor": "events", - "subsection_anchors": null, - "path": "/events/types", - "gate": false, - "display_on_load": false - }, - "files": { - "title": "Files", - "group_title": "Core Resources", - "group_anchor": "core_resources", - "anchor": "files", - "section_anchor": "files", - "subsection_anchors": ["file_object", "create_file", "retrieve_file", "list_files"], - "path": "/files", - "gate": false, - "display_on_load": false, - "data": { - "section_type": "resource", - "title": "Files", - "description": "This is an object representing a file hosted on Stripe's servers. The\nfile may have been uploaded by yourself using the [create file](#create_file)\nrequest (for example, when uploading dispute evidence) or it may have\nbeen created by Stripe (for example, the results of a [Sigma scheduled\nquery](#scheduled_queries)).\n\nRelated guide: [File Upload Guide](/docs/file-upload).\n", - "section_tag": "files", - "subsection_summaries": [ - { "anchor": "file_object", "curl_definition": null }, - { "anchor": "create_file", "curl_definition": "POST https://files.stripe.com/v1/files" }, - { "anchor": "retrieve_file", "curl_definition": "GET /v1/files/:id" }, - { "anchor": "list_files", "curl_definition": "GET /v1/files" } - ] - } - }, - "file_object": { - "title": "The file object", - "group_title": "Core Resources", - "group_anchor": "core_resources", - "anchor": "file_object", - "section_anchor": "files", - "subsection_anchors": null, - "path": "/files/object", - "gate": false, - "display_on_load": false - }, - "create_file": { - "title": "Create a file", - "group_title": "Core Resources", - "group_anchor": "core_resources", - "anchor": "create_file", - "section_anchor": "files", - "subsection_anchors": null, - "path": "/files/create", - "gate": false, - "display_on_load": false - }, - "retrieve_file": { - "title": "Retrieve a file", - "group_title": "Core Resources", - "group_anchor": "core_resources", - "anchor": "retrieve_file", - "section_anchor": "files", - "subsection_anchors": null, - "path": "/files/retrieve", - "gate": false, - "display_on_load": false - }, - "list_files": { - "title": "List all files", - "group_title": "Core Resources", - "group_anchor": "core_resources", - "anchor": "list_files", - "section_anchor": "files", - "subsection_anchors": null, - "path": "/files/list", - "gate": false, - "display_on_load": false - }, - "file_links": { - "title": "File Links", - "group_title": "Core Resources", - "group_anchor": "core_resources", - "anchor": "file_links", - "section_anchor": "file_links", - "subsection_anchors": [ - "file_link_object", - "create_file_link", - "retrieve_file_link", - "update_file_link", - "list_file_links" - ], - "path": "/file_links", - "gate": false, - "display_on_load": false, - "data": { - "section_type": "resource", - "title": "File Links", - "description": "To share the contents of a `File` object with non-Stripe users, you can\ncreate a `FileLink`. `FileLink`s contain a URL that can be used to\nretrieve the contents of the file without authentication.\n", - "section_tag": "file_links", - "subsection_summaries": [ - { "anchor": "file_link_object", "curl_definition": null }, - { "anchor": "create_file_link", "curl_definition": "POST /v1/file_links" }, - { "anchor": "retrieve_file_link", "curl_definition": "GET /v1/file_links/:id" }, - { "anchor": "update_file_link", "curl_definition": "POST /v1/file_links/:id" }, - { "anchor": "list_file_links", "curl_definition": "GET /v1/file_links" } - ] - } - }, - "file_link_object": { - "title": "The file link object", - "group_title": "Core Resources", - "group_anchor": "core_resources", - "anchor": "file_link_object", - "section_anchor": "file_links", - "subsection_anchors": null, - "path": "/file_links/object", - "gate": false, - "display_on_load": false - }, - "create_file_link": { - "title": "Create a file link", - "group_title": "Core Resources", - "group_anchor": "core_resources", - "anchor": "create_file_link", - "section_anchor": "file_links", - "subsection_anchors": null, - "path": "/file_links/create", - "gate": false, - "display_on_load": false - }, - "retrieve_file_link": { - "title": "Retrieve a file link", - "group_title": "Core Resources", - "group_anchor": "core_resources", - "anchor": "retrieve_file_link", - "section_anchor": "file_links", - "subsection_anchors": null, - "path": "/file_links/retrieve", - "gate": false, - "display_on_load": false - }, - "update_file_link": { - "title": "Update a file link", - "group_title": "Core Resources", - "group_anchor": "core_resources", - "anchor": "update_file_link", - "section_anchor": "file_links", - "subsection_anchors": null, - "path": "/file_links/update", - "gate": false, - "display_on_load": false - }, - "list_file_links": { - "title": "List all file links", - "group_title": "Core Resources", - "group_anchor": "core_resources", - "anchor": "list_file_links", - "section_anchor": "file_links", - "subsection_anchors": null, - "path": "/file_links/list", - "gate": false, - "display_on_load": false - }, - "mandates": { - "title": "Mandates", - "group_title": "Core Resources", - "group_anchor": "core_resources", - "anchor": "mandates", - "section_anchor": "mandates", - "subsection_anchors": ["mandate_object", "retrieve_mandate"], - "path": "/mandates", - "gate": false, - "display_on_load": false, - "data": { - "section_type": "resource", - "title": "Mandates", - "description": "A Mandate is a record of the permission a customer has given you to debit their payment method.\n", - "section_tag": "mandates", - "subsection_summaries": [ - { "anchor": "mandate_object", "curl_definition": null }, - { "anchor": "retrieve_mandate", "curl_definition": "GET /v1/mandates/:id" } - ] - } - }, - "mandate_object": { - "title": "The Mandates object", - "group_title": "Core Resources", - "group_anchor": "core_resources", - "anchor": "mandate_object", - "section_anchor": "mandates", - "subsection_anchors": null, - "path": "/mandates/object", - "gate": false, - "display_on_load": false - }, - "retrieve_mandate": { - "title": "Retrieve a Mandate", - "group_title": "Core Resources", - "group_anchor": "core_resources", - "anchor": "retrieve_mandate", - "section_anchor": "mandates", - "subsection_anchors": null, - "path": "/mandates/retrieve", - "gate": false, - "display_on_load": false - }, - "payment_intents": { - "title": "PaymentIntents", - "group_title": "Core Resources", - "group_anchor": "core_resources", - "anchor": "payment_intents", - "section_anchor": "payment_intents", - "subsection_anchors": [ - "payment_intent_object", - "create_payment_intent", - "retrieve_payment_intent", - "update_payment_intent", - "confirm_payment_intent", - "capture_payment_intent", - "cancel_payment_intent", - "list_payment_intents", - "increment_authorization", - "search_payment_intents", - "verify_microdeposits_payment_intent", - "apply_customer_balance" - ], - "path": "/payment_intents", - "gate": false, - "display_on_load": false, - "data": { - "section_type": "resource", - "title": "PaymentIntents", - "description": "A PaymentIntent guides you through the process of collecting a payment from your customer.\nWe recommend that you create exactly one PaymentIntent for each order or\ncustomer session in your system. You can reference the PaymentIntent later to\nsee the history of payment attempts for a particular session.\n\nA PaymentIntent transitions through\n[multiple statuses](/docs/payments/intents#intent-statuses)\nthroughout its lifetime as it interfaces with Stripe.js to perform\nauthentication flows and ultimately creates at most one successful charge.\n\nRelated guide: [Payment Intents API](/docs/payments/payment-intents).\n", - "section_tag": "payment_intents", - "subsection_summaries": [ - { "anchor": "payment_intent_object", "curl_definition": null }, - { "anchor": "create_payment_intent", "curl_definition": "POST /v1/payment_intents" }, - { "anchor": "retrieve_payment_intent", "curl_definition": "GET /v1/payment_intents/:id" }, - { "anchor": "update_payment_intent", "curl_definition": "POST /v1/payment_intents/:id" }, - { - "anchor": "confirm_payment_intent", - "curl_definition": "POST /v1/payment_intents/:id/confirm" - }, - { - "anchor": "capture_payment_intent", - "curl_definition": "POST /v1/payment_intents/:id/capture" - }, - { - "anchor": "cancel_payment_intent", - "curl_definition": "POST /v1/payment_intents/:id/cancel" - }, - { "anchor": "list_payment_intents", "curl_definition": "GET /v1/payment_intents" }, - { - "anchor": "increment_authorization", - "curl_definition": "POST /v1/payment_intents/:id/increment_authorization" - }, - { "anchor": "search_payment_intents", "curl_definition": "GET /v1/payment_intents/search" }, - { - "anchor": "verify_microdeposits_payment_intent", - "curl_definition": "POST /v1/payment_intents/:id/verify_microdeposits" - }, - { - "anchor": "apply_customer_balance", - "curl_definition": "POST /v1/payment_intents/:id/apply_customer_balance" - } - ] - } - }, - "payment_intent_object": { - "title": "The PaymentIntent object", - "group_title": "Core Resources", - "group_anchor": "core_resources", - "anchor": "payment_intent_object", - "section_anchor": "payment_intents", - "subsection_anchors": null, - "path": "/payment_intents/object", - "gate": false, - "display_on_load": false - }, - "create_payment_intent": { - "title": "Create a PaymentIntent", - "group_title": "Core Resources", - "group_anchor": "core_resources", - "anchor": "create_payment_intent", - "section_anchor": "payment_intents", - "subsection_anchors": null, - "path": "/payment_intents/create", - "gate": false, - "display_on_load": false - }, - "retrieve_payment_intent": { - "title": "Retrieve a PaymentIntent", - "group_title": "Core Resources", - "group_anchor": "core_resources", - "anchor": "retrieve_payment_intent", - "section_anchor": "payment_intents", - "subsection_anchors": null, - "path": "/payment_intents/retrieve", - "gate": false, - "display_on_load": false - }, - "update_payment_intent": { - "title": "Update a PaymentIntent", - "group_title": "Core Resources", - "group_anchor": "core_resources", - "anchor": "update_payment_intent", - "section_anchor": "payment_intents", - "subsection_anchors": null, - "path": "/payment_intents/update", - "gate": false, - "display_on_load": false - }, - "confirm_payment_intent": { - "title": "Confirm a PaymentIntent", - "group_title": "Core Resources", - "group_anchor": "core_resources", - "anchor": "confirm_payment_intent", - "section_anchor": "payment_intents", - "subsection_anchors": null, - "path": "/payment_intents/confirm", - "gate": false, - "display_on_load": false - }, - "capture_payment_intent": { - "title": "Capture a PaymentIntent", - "group_title": "Core Resources", - "group_anchor": "core_resources", - "anchor": "capture_payment_intent", - "section_anchor": "payment_intents", - "subsection_anchors": null, - "path": "/payment_intents/capture", - "gate": false, - "display_on_load": false - }, - "cancel_payment_intent": { - "title": "Cancel a PaymentIntent", - "group_title": "Core Resources", - "group_anchor": "core_resources", - "anchor": "cancel_payment_intent", - "section_anchor": "payment_intents", - "subsection_anchors": null, - "path": "/payment_intents/cancel", - "gate": false, - "display_on_load": false - }, - "list_payment_intents": { - "title": "List all PaymentIntents", - "group_title": "Core Resources", - "group_anchor": "core_resources", - "anchor": "list_payment_intents", - "section_anchor": "payment_intents", - "subsection_anchors": null, - "path": "/payment_intents/list", - "gate": false, - "display_on_load": false - }, - "increment_authorization": { - "title": "Increment an authorization", - "group_title": "Core Resources", - "group_anchor": "core_resources", - "anchor": "increment_authorization", - "section_anchor": "payment_intents", - "subsection_anchors": null, - "path": "/payment_intents/increment_authorization", - "gate": false, - "display_on_load": false - }, - "search_payment_intents": { - "title": "Search PaymentIntents", - "group_title": "Core Resources", - "group_anchor": "core_resources", - "anchor": "search_payment_intents", - "section_anchor": "payment_intents", - "subsection_anchors": null, - "path": "/payment_intents/search", - "gate": false, - "display_on_load": false - }, - "verify_microdeposits_payment_intent": { - "title": "Verify microdeposits on a PaymentIntent", - "group_title": "Core Resources", - "group_anchor": "core_resources", - "anchor": "verify_microdeposits_payment_intent", - "section_anchor": "payment_intents", - "subsection_anchors": null, - "path": "/payment_intents/verify_microdeposits", - "gate": false, - "display_on_load": false - }, - "apply_customer_balance": { - "title": "Reconcile a customer_balance PaymentIntent", - "group_title": "Core Resources", - "group_anchor": "core_resources", - "anchor": "apply_customer_balance", - "section_anchor": "payment_intents", - "subsection_anchors": null, - "path": "/payment_intents/apply_customer_balance", - "gate": false, - "display_on_load": false - }, - "setup_intents": { - "title": "SetupIntents", - "group_title": "Core Resources", - "group_anchor": "core_resources", - "anchor": "setup_intents", - "section_anchor": "setup_intents", - "subsection_anchors": [ - "setup_intent_object", - "create_setup_intent", - "retrieve_setup_intent", - "update_setup_intent", - "confirm_setup_intent", - "cancel_setup_intent", - "list_setup_intents", - "verify_microdeposits_setup_intent" - ], - "path": "/setup_intents", - "gate": false, - "display_on_load": false, - "data": { - "section_type": "resource", - "title": "SetupIntents", - "description": "A SetupIntent guides you through the process of setting up and saving a customer's payment credentials for future payments.\nFor example, you could use a SetupIntent to set up and save your customer's card without immediately collecting a payment.\nLater, you can use [PaymentIntents](#payment_intents) to drive the payment flow.\n\nCreate a SetupIntent as soon as you're ready to collect your customer's payment credentials.\nDo not maintain long-lived, unconfirmed SetupIntents as they may no longer be valid.\nThe SetupIntent then transitions through multiple [statuses](/docs/payments/intents#intent-statuses) as it guides\nyou through the setup process.\n\nSuccessful SetupIntents result in payment credentials that are optimized for future payments.\nFor example, cardholders in [certain regions](/guides/strong-customer-authentication) may need to be run through\n[Strong Customer Authentication](/docs/strong-customer-authentication) at the time of payment method collection\nin order to streamline later [off-session payments](/docs/payments/setup-intents).\nIf the SetupIntent is used with a [Customer](#setup_intent_object-customer), upon success,\nit will automatically attach the resulting payment method to that Customer.\nWe recommend using SetupIntents or [setup_future_usage](#payment_intent_object-setup_future_usage) on\nPaymentIntents to save payment methods in order to prevent saving invalid or unoptimized payment methods.\n\nBy using SetupIntents, you ensure that your customers experience the minimum set of required friction,\neven as regulations change over time.\n\nRelated guide: [Setup Intents API](/docs/payments/setup-intents).\n", - "section_tag": "setup_intents", - "subsection_summaries": [ - { "anchor": "setup_intent_object", "curl_definition": null }, - { "anchor": "create_setup_intent", "curl_definition": "POST /v1/setup_intents" }, - { "anchor": "retrieve_setup_intent", "curl_definition": "GET /v1/setup_intents/:id" }, - { "anchor": "update_setup_intent", "curl_definition": "POST /v1/setup_intents/:id" }, - { - "anchor": "confirm_setup_intent", - "curl_definition": "POST /v1/setup_intents/:id/confirm" - }, - { "anchor": "cancel_setup_intent", "curl_definition": "POST /v1/setup_intents/:id/cancel" }, - { "anchor": "list_setup_intents", "curl_definition": "GET /v1/setup_intents" }, - { - "anchor": "verify_microdeposits_setup_intent", - "curl_definition": "POST /v1/setup_intents/:id/verify_microdeposits" - } - ] - } - }, - "setup_intent_object": { - "title": "The SetupIntent object", - "group_title": "Core Resources", - "group_anchor": "core_resources", - "anchor": "setup_intent_object", - "section_anchor": "setup_intents", - "subsection_anchors": null, - "path": "/setup_intents/object", - "gate": false, - "display_on_load": false - }, - "create_setup_intent": { - "title": "Create a SetupIntent", - "group_title": "Core Resources", - "group_anchor": "core_resources", - "anchor": "create_setup_intent", - "section_anchor": "setup_intents", - "subsection_anchors": null, - "path": "/setup_intents/create", - "gate": false, - "display_on_load": false - }, - "retrieve_setup_intent": { - "title": "Retrieve a SetupIntent", - "group_title": "Core Resources", - "group_anchor": "core_resources", - "anchor": "retrieve_setup_intent", - "section_anchor": "setup_intents", - "subsection_anchors": null, - "path": "/setup_intents/retrieve", - "gate": false, - "display_on_load": false - }, - "update_setup_intent": { - "title": "Update a SetupIntent", - "group_title": "Core Resources", - "group_anchor": "core_resources", - "anchor": "update_setup_intent", - "section_anchor": "setup_intents", - "subsection_anchors": null, - "path": "/setup_intents/update", - "gate": false, - "display_on_load": false - }, - "confirm_setup_intent": { - "title": "Confirm a SetupIntent", - "group_title": "Core Resources", - "group_anchor": "core_resources", - "anchor": "confirm_setup_intent", - "section_anchor": "setup_intents", - "subsection_anchors": null, - "path": "/setup_intents/confirm", - "gate": false, - "display_on_load": false - }, - "cancel_setup_intent": { - "title": "Cancel a SetupIntent", - "group_title": "Core Resources", - "group_anchor": "core_resources", - "anchor": "cancel_setup_intent", - "section_anchor": "setup_intents", - "subsection_anchors": null, - "path": "/setup_intents/cancel", - "gate": false, - "display_on_load": false - }, - "list_setup_intents": { - "title": "List all SetupIntents", - "group_title": "Core Resources", - "group_anchor": "core_resources", - "anchor": "list_setup_intents", - "section_anchor": "setup_intents", - "subsection_anchors": null, - "path": "/setup_intents/list", - "gate": false, - "display_on_load": false - }, - "verify_microdeposits_setup_intent": { - "title": "Verify microdeposits on a SetupIntent", - "group_title": "Core Resources", - "group_anchor": "core_resources", - "anchor": "verify_microdeposits_setup_intent", - "section_anchor": "setup_intents", - "subsection_anchors": null, - "path": "/setup_intents/verify_microdeposits", - "gate": false, - "display_on_load": false - }, - "setup_attempts": { - "title": "SetupAttempts", - "group_title": "Core Resources", - "group_anchor": "core_resources", - "anchor": "setup_attempts", - "section_anchor": "setup_attempts", - "subsection_anchors": ["setup_attempt_object", "list_setup_attempts"], - "path": "/setup_attempts", - "gate": false, - "display_on_load": false, - "data": { - "section_type": "resource", - "title": "SetupAttempts", - "description": "A SetupAttempt describes one attempted confirmation of a SetupIntent,\nwhether that confirmation was successful or unsuccessful. You can use\nSetupAttempts to inspect details of a specific attempt at setting up a\npayment method using a SetupIntent.\n", - "section_tag": "setup_attempts", - "subsection_summaries": [ - { "anchor": "setup_attempt_object", "curl_definition": null }, - { "anchor": "list_setup_attempts", "curl_definition": "GET /v1/setup_attempts" } - ] - } - }, - "setup_attempt_object": { - "title": "The SetupAttempt object", - "group_title": "Core Resources", - "group_anchor": "core_resources", - "anchor": "setup_attempt_object", - "section_anchor": "setup_attempts", - "subsection_anchors": null, - "path": "/setup_attempts/object", - "gate": false, - "display_on_load": false - }, - "list_setup_attempts": { - "title": "List all SetupAttempts", - "group_title": "Core Resources", - "group_anchor": "core_resources", - "anchor": "list_setup_attempts", - "section_anchor": "setup_attempts", - "subsection_anchors": null, - "path": "/setup_attempts/list", - "gate": false, - "display_on_load": false - }, - "payouts": { - "title": "Payouts", - "group_title": "Core Resources", - "group_anchor": "core_resources", - "anchor": "payouts", - "section_anchor": "payouts", - "subsection_anchors": [ - "payout_object", - "create_payout", - "retrieve_payout", - "update_payout", - "list_payouts", - "cancel_payout", - "reverse_payout", - "payout_failures" - ], - "path": "/payouts", - "gate": false, - "display_on_load": false, - "data": { - "section_type": "resource", - "title": "Payouts", - "description": "A `Payout` object is created when you receive funds from Stripe, or when you\ninitiate a payout to either a bank account or debit card of a [connected\nStripe account](/docs/connect/bank-debit-card-payouts). You can retrieve individual payouts,\nas well as list all payouts. Payouts are made on [varying\nschedules](/docs/connect/manage-payout-schedule), depending on your country and\nindustry.\n\nRelated guide: [Receiving Payouts](/docs/payouts).\n", - "section_tag": "payouts", - "subsection_summaries": [ - { "anchor": "payout_object", "curl_definition": null }, - { "anchor": "create_payout", "curl_definition": "POST /v1/payouts" }, - { "anchor": "retrieve_payout", "curl_definition": "GET /v1/payouts/:id" }, - { "anchor": "update_payout", "curl_definition": "POST /v1/payouts/:id" }, - { "anchor": "list_payouts", "curl_definition": "GET /v1/payouts" }, - { "anchor": "cancel_payout", "curl_definition": "POST /v1/payouts/:id/cancel" }, - { "anchor": "reverse_payout", "curl_definition": "POST /v1/payouts/:id/reverse" }, - { "anchor": "payout_failures", "curl_definition": null } - ] - } - }, - "payout_object": { - "title": "The payout object", - "group_title": "Core Resources", - "group_anchor": "core_resources", - "anchor": "payout_object", - "section_anchor": "payouts", - "subsection_anchors": null, - "path": "/payouts/object", - "gate": false, - "display_on_load": false - }, - "create_payout": { - "title": "Create a payout", - "group_title": "Core Resources", - "group_anchor": "core_resources", - "anchor": "create_payout", - "section_anchor": "payouts", - "subsection_anchors": null, - "path": "/payouts/create", - "gate": false, - "display_on_load": false - }, - "retrieve_payout": { - "title": "Retrieve a payout", - "group_title": "Core Resources", - "group_anchor": "core_resources", - "anchor": "retrieve_payout", - "section_anchor": "payouts", - "subsection_anchors": null, - "path": "/payouts/retrieve", - "gate": false, - "display_on_load": false - }, - "update_payout": { - "title": "Update a payout", - "group_title": "Core Resources", - "group_anchor": "core_resources", - "anchor": "update_payout", - "section_anchor": "payouts", - "subsection_anchors": null, - "path": "/payouts/update", - "gate": false, - "display_on_load": false - }, - "list_payouts": { - "title": "List all payouts", - "group_title": "Core Resources", - "group_anchor": "core_resources", - "anchor": "list_payouts", - "section_anchor": "payouts", - "subsection_anchors": null, - "path": "/payouts/list", - "gate": false, - "display_on_load": false - }, - "cancel_payout": { - "title": "Cancel a payout", - "group_title": "Core Resources", - "group_anchor": "core_resources", - "anchor": "cancel_payout", - "section_anchor": "payouts", - "subsection_anchors": null, - "path": "/payouts/cancel", - "gate": false, - "display_on_load": false - }, - "reverse_payout": { - "title": "Reverse a payout", - "group_title": "Core Resources", - "group_anchor": "core_resources", - "anchor": "reverse_payout", - "section_anchor": "payouts", - "subsection_anchors": null, - "path": "/payouts/reverse", - "gate": false, - "display_on_load": false - }, - "payout_failures": { - "title": "Types of payout failures", - "group_title": "Core Resources", - "group_anchor": "core_resources", - "anchor": "payout_failures", - "section_anchor": "payouts", - "subsection_anchors": null, - "path": "/payouts/failures", - "gate": false, - "display_on_load": false - }, - "refunds": { - "title": "Refunds", - "group_title": "Core Resources", - "group_anchor": "core_resources", - "anchor": "refunds", - "section_anchor": "refunds", - "subsection_anchors": [ - "refund_object", - "create_refund", - "retrieve_refund", - "update_refund", - "cancel_refund", - "list_refunds" - ], - "path": "/refunds", - "gate": false, - "display_on_load": false, - "data": { - "section_type": "resource", - "title": "Refunds", - "description": "`Refund` objects allow you to refund a charge that has previously been created\nbut not yet refunded. Funds will be refunded to the credit or debit card that\nwas originally charged.\n\nRelated guide: [Refunds](/docs/refunds).\n", - "section_tag": "refunds", - "subsection_summaries": [ - { "anchor": "refund_object", "curl_definition": null }, - { "anchor": "create_refund", "curl_definition": "POST /v1/refunds" }, - { "anchor": "retrieve_refund", "curl_definition": "GET /v1/refunds/:id" }, - { "anchor": "update_refund", "curl_definition": "POST /v1/refunds/:id" }, - { "anchor": "cancel_refund", "curl_definition": "POST /v1/refunds/:id/cancel" }, - { "anchor": "list_refunds", "curl_definition": "GET /v1/refunds" } - ] - } - }, - "refund_object": { - "title": "The refund object", - "group_title": "Core Resources", - "group_anchor": "core_resources", - "anchor": "refund_object", - "section_anchor": "refunds", - "subsection_anchors": null, - "path": "/refunds/object", - "gate": false, - "display_on_load": false - }, - "create_refund": { - "title": "Create a refund", - "group_title": "Core Resources", - "group_anchor": "core_resources", - "anchor": "create_refund", - "section_anchor": "refunds", - "subsection_anchors": null, - "path": "/refunds/create", - "gate": false, - "display_on_load": false - }, - "retrieve_refund": { - "title": "Retrieve a refund", - "group_title": "Core Resources", - "group_anchor": "core_resources", - "anchor": "retrieve_refund", - "section_anchor": "refunds", - "subsection_anchors": null, - "path": "/refunds/retrieve", - "gate": false, - "display_on_load": false - }, - "update_refund": { - "title": "Update a refund", - "group_title": "Core Resources", - "group_anchor": "core_resources", - "anchor": "update_refund", - "section_anchor": "refunds", - "subsection_anchors": null, - "path": "/refunds/update", - "gate": false, - "display_on_load": false - }, - "cancel_refund": { - "title": "Cancel a refund", - "group_title": "Core Resources", - "group_anchor": "core_resources", - "anchor": "cancel_refund", - "section_anchor": "refunds", - "subsection_anchors": null, - "path": "/refunds/cancel", - "gate": false, - "display_on_load": false - }, - "list_refunds": { - "title": "List all refunds", - "group_title": "Core Resources", - "group_anchor": "core_resources", - "anchor": "list_refunds", - "section_anchor": "refunds", - "subsection_anchors": null, - "path": "/refunds/list", - "gate": false, - "display_on_load": false - }, - "tokens": { - "title": "Tokens", - "group_title": "Core Resources", - "group_anchor": "core_resources", - "anchor": "tokens", - "section_anchor": "tokens", - "subsection_anchors": [ - "token_object", - "create_card_token", - "create_bank_account_token", - "create_pii_token", - "create_account_token", - "create_person_token", - "create_cvc_update_token", - "retrieve_token" - ], - "path": "/tokens", - "gate": false, - "display_on_load": false, - "data": { - "section_type": "resource", - "title": "Tokens", - "description": "Tokenization is the process Stripe uses to collect sensitive card or bank\naccount details, or personally identifiable information (PII), directly from\nyour customers in a secure manner. A token representing this information is\nreturned to your server to use. You should use our\n[recommended payments integrations](/docs/payments) to perform this process\nclient-side. This ensures that no sensitive card data touches your server,\nand allows your integration to operate in a PCI-compliant way.\n\nIf you cannot use client-side tokenization, you can also create tokens using\nthe API with either your publishable or secret API key. Keep in mind that if\nyour integration uses this method, you are responsible for any PCI compliance\nthat may be required, and you must keep your secret API key safe. Unlike with\nclient-side tokenization, your customer's information is not sent directly to\nStripe, so we cannot determine how it is handled or stored.\n\nTokens cannot be stored or used more than once. To store card or bank account\ninformation for later use, you can create [Customer](/docs/api#customers)\nobjects or [Custom accounts](/docs/api#external_accounts). Note that\n[Radar](/docs/radar), our integrated solution for automatic fraud protection,\nperforms best with integrations that use client-side tokenization.\n\nRelated guide: [Accept a payment](/docs/payments/accept-a-payment-charges#web-create-token)\n", - "section_tag": "tokens", - "subsection_summaries": [ - { "anchor": "token_object", "curl_definition": null }, - { "anchor": "create_card_token", "curl_definition": "POST /v1/tokens" }, - { "anchor": "create_bank_account_token", "curl_definition": "POST /v1/tokens" }, - { "anchor": "create_pii_token", "curl_definition": "POST /v1/tokens" }, - { "anchor": "create_account_token", "curl_definition": "POST /v1/tokens" }, - { "anchor": "create_person_token", "curl_definition": "POST /v1/tokens" }, - { "anchor": "create_cvc_update_token", "curl_definition": "POST /v1/tokens" }, - { "anchor": "retrieve_token", "curl_definition": "GET /v1/tokens/:id" } - ] - } - }, - "token_object": { - "title": "The token object", - "group_title": "Core Resources", - "group_anchor": "core_resources", - "anchor": "token_object", - "section_anchor": "tokens", - "subsection_anchors": null, - "path": "/tokens/object", - "gate": false, - "display_on_load": false - }, - "create_card_token": { - "title": "Create a card token", - "group_title": "Core Resources", - "group_anchor": "core_resources", - "anchor": "create_card_token", - "section_anchor": "tokens", - "subsection_anchors": null, - "path": "/tokens/create_card", - "gate": false, - "display_on_load": false - }, - "create_bank_account_token": { - "title": "Create a bank account token", - "group_title": "Core Resources", - "group_anchor": "core_resources", - "anchor": "create_bank_account_token", - "section_anchor": "tokens", - "subsection_anchors": null, - "path": "/tokens/create_bank_account", - "gate": false, - "display_on_load": false - }, - "create_pii_token": { - "title": "Create a PII token", - "group_title": "Core Resources", - "group_anchor": "core_resources", - "anchor": "create_pii_token", - "section_anchor": "tokens", - "subsection_anchors": null, - "path": "/tokens/create_pii", - "gate": false, - "display_on_load": false - }, - "create_account_token": { - "title": "Create an account token", - "group_title": "Core Resources", - "group_anchor": "core_resources", - "anchor": "create_account_token", - "section_anchor": "tokens", - "subsection_anchors": null, - "path": "/tokens/create_account", - "gate": false, - "display_on_load": false - }, - "create_person_token": { - "title": "Create a person token", - "group_title": "Core Resources", - "group_anchor": "core_resources", - "anchor": "create_person_token", - "section_anchor": "tokens", - "subsection_anchors": null, - "path": "/tokens/create_person", - "gate": false, - "display_on_load": false - }, - "create_cvc_update_token": { - "title": "Create a CVC update token", - "group_title": "Core Resources", - "group_anchor": "core_resources", - "anchor": "create_cvc_update_token", - "section_anchor": "tokens", - "subsection_anchors": null, - "path": "/tokens/create_cvc_update", - "gate": false, - "display_on_load": false - }, - "retrieve_token": { - "title": "Retrieve a token", - "group_title": "Core Resources", - "group_anchor": "core_resources", - "anchor": "retrieve_token", - "section_anchor": "tokens", - "subsection_anchors": null, - "path": "/tokens/retrieve", - "gate": false, - "display_on_load": false - }, - "payment_methods": { - "title": "PaymentMethods", - "group_title": "Payment Methods", - "group_anchor": "payment_methods_heading", - "anchor": "payment_methods", - "section_anchor": "payment_methods", - "subsection_anchors": [ - "payment_method_object", - "create_payment_method", - "retrieve_payment_method", - "retrieve_customer_payment_method", - "update_payment_method", - "list_payment_methods", - "list_customer_payment_methods", - "customer_attach_payment_method", - "customer_detach_payment_method" - ], - "path": "/payment_methods", - "gate": false, - "display_on_load": false, - "data": { - "section_type": "resource", - "title": "PaymentMethods", - "description": "PaymentMethod objects represent your customer's payment instruments.\nYou can use them with [PaymentIntents](/docs/payments/payment-intents) to collect payments or save them to\nCustomer objects to store instrument details for future payments.\n\nRelated guides: [Payment Methods](/docs/payments/payment-methods) and [More Payment Scenarios](/docs/payments/more-payment-scenarios).\n", - "section_tag": "payment_methods", - "subsection_summaries": [ - { "anchor": "payment_method_object", "curl_definition": null }, - { "anchor": "create_payment_method", "curl_definition": "POST /v1/payment_methods" }, - { "anchor": "retrieve_payment_method", "curl_definition": "GET /v1/payment_methods/:id" }, - { - "anchor": "retrieve_customer_payment_method", - "curl_definition": "GET /v1/customers/:customer/payment_methods/:payment_method" - }, - { "anchor": "update_payment_method", "curl_definition": "POST /v1/payment_methods/:id" }, - { "anchor": "list_payment_methods", "curl_definition": "GET /v1/payment_methods" }, - { - "anchor": "list_customer_payment_methods", - "curl_definition": "GET /v1/customers/:customer/payment_methods" - }, - { - "anchor": "customer_attach_payment_method", - "curl_definition": "POST /v1/payment_methods/:id/attach" - }, - { - "anchor": "customer_detach_payment_method", - "curl_definition": "POST /v1/payment_methods/:id/detach" - } - ] - } - }, - "payment_method_object": { - "title": "The PaymentMethod object", - "group_title": "Payment Methods", - "group_anchor": "payment_methods_heading", - "anchor": "payment_method_object", - "section_anchor": "payment_methods", - "subsection_anchors": null, - "path": "/payment_methods/object", - "gate": false, - "display_on_load": false - }, - "create_payment_method": { - "title": "Create a PaymentMethod", - "group_title": "Payment Methods", - "group_anchor": "payment_methods_heading", - "anchor": "create_payment_method", - "section_anchor": "payment_methods", - "subsection_anchors": null, - "path": "/payment_methods/create", - "gate": false, - "display_on_load": false - }, - "retrieve_payment_method": { - "title": "Retrieve a PaymentMethod", - "group_title": "Payment Methods", - "group_anchor": "payment_methods_heading", - "anchor": "retrieve_payment_method", - "section_anchor": "payment_methods", - "subsection_anchors": null, - "path": "/payment_methods/retrieve", - "gate": false, - "display_on_load": false - }, - "retrieve_customer_payment_method": { - "title": "Retrieve a Customer's PaymentMethod", - "group_title": "Payment Methods", - "group_anchor": "payment_methods_heading", - "anchor": "retrieve_customer_payment_method", - "section_anchor": "payment_methods", - "subsection_anchors": null, - "path": "/payment_methods/customer", - "gate": false, - "display_on_load": false - }, - "update_payment_method": { - "title": "Update a PaymentMethod", - "group_title": "Payment Methods", - "group_anchor": "payment_methods_heading", - "anchor": "update_payment_method", - "section_anchor": "payment_methods", - "subsection_anchors": null, - "path": "/payment_methods/update", - "gate": false, - "display_on_load": false - }, - "list_payment_methods": { - "title": "List PaymentMethods", - "group_title": "Payment Methods", - "group_anchor": "payment_methods_heading", - "anchor": "list_payment_methods", - "section_anchor": "payment_methods", - "subsection_anchors": null, - "path": "/payment_methods/list", - "gate": false, - "display_on_load": false - }, - "list_customer_payment_methods": { - "title": "List a Customer's PaymentMethods", - "group_title": "Payment Methods", - "group_anchor": "payment_methods_heading", - "anchor": "list_customer_payment_methods", - "section_anchor": "payment_methods", - "subsection_anchors": null, - "path": "/payment_methods/customer_list", - "gate": false, - "display_on_load": false - }, - "customer_attach_payment_method": { - "title": "Attach a PaymentMethod to a Customer", - "group_title": "Payment Methods", - "group_anchor": "payment_methods_heading", - "anchor": "customer_attach_payment_method", - "section_anchor": "payment_methods", - "subsection_anchors": null, - "path": "/payment_methods/attach", - "gate": false, - "display_on_load": false - }, - "customer_detach_payment_method": { - "title": "Detach a PaymentMethod from a Customer", - "group_title": "Payment Methods", - "group_anchor": "payment_methods_heading", - "anchor": "customer_detach_payment_method", - "section_anchor": "payment_methods", - "subsection_anchors": null, - "path": "/payment_methods/detach", - "gate": false, - "display_on_load": false - }, - "bank_accounts": { - "title": "Bank Accounts", - "group_title": "Payment Methods", - "group_anchor": "payment_methods_heading", - "anchor": "bank_accounts", - "section_anchor": "bank_accounts", - "subsection_anchors": [ - "customer_bank_account_object", - "customer_create_bank_account", - "customer_retrieve_bank_account", - "customer_update_bank_account", - "customer_verify_bank_account", - "customer_delete_bank_account", - "customer_list_bank_accounts" - ], - "path": "/customer_bank_accounts", - "gate": false, - "display_on_load": false, - "data": { - "section_type": "resource", - "title": "Bank Accounts", - "description": "These bank accounts are payment methods on `Customer` objects.\n\nOn the other hand [External Accounts](/docs/api#external_accounts) are transfer\ndestinations on `Account` objects for [Custom accounts](/docs/connect/custom-accounts).\nThey can be bank accounts or debit cards as well, and are documented in the links above.\n\nRelated guide: [Bank Debits and Transfers](/docs/payments/bank-debits-transfers).\n", - "section_tag": "bank_accounts", - "subsection_summaries": [ - { "anchor": "customer_bank_account_object", "curl_definition": null }, - { - "anchor": "customer_create_bank_account", - "curl_definition": "POST /v1/customers/:id/sources" - }, - { - "anchor": "customer_retrieve_bank_account", - "curl_definition": "GET /v1/customers/:id/sources/:id" - }, - { - "anchor": "customer_update_bank_account", - "curl_definition": "POST /v1/customers/:id/sources/:id" - }, - { - "anchor": "customer_verify_bank_account", - "curl_definition": "POST /v1/customers/:id/sources/:id/verify" - }, - { - "anchor": "customer_delete_bank_account", - "curl_definition": "DELETE /v1/customers/:id/sources/:id" - }, - { - "anchor": "customer_list_bank_accounts", - "curl_definition": "GET /v1/customers/:id/sources?object=bank_account" - } - ] - } - }, - "customer_bank_account_object": { - "title": "The bank account object", - "group_title": "Payment Methods", - "group_anchor": "payment_methods_heading", - "anchor": "customer_bank_account_object", - "section_anchor": "bank_accounts", - "subsection_anchors": null, - "path": "/customer_bank_accounts/object", - "gate": false, - "display_on_load": false - }, - "customer_create_bank_account": { - "title": "Create a bank account", - "group_title": "Payment Methods", - "group_anchor": "payment_methods_heading", - "anchor": "customer_create_bank_account", - "section_anchor": "bank_accounts", - "subsection_anchors": null, - "path": "/customer_bank_accounts/create", - "gate": false, - "display_on_load": false - }, - "customer_retrieve_bank_account": { - "title": "Retrieve a bank account", - "group_title": "Payment Methods", - "group_anchor": "payment_methods_heading", - "anchor": "customer_retrieve_bank_account", - "section_anchor": "bank_accounts", - "subsection_anchors": null, - "path": "/customer_bank_accounts/retrieve", - "gate": false, - "display_on_load": false - }, - "customer_update_bank_account": { - "title": "Update a bank account", - "group_title": "Payment Methods", - "group_anchor": "payment_methods_heading", - "anchor": "customer_update_bank_account", - "section_anchor": "bank_accounts", - "subsection_anchors": null, - "path": "/customer_bank_accounts/update", - "gate": false, - "display_on_load": false - }, - "customer_verify_bank_account": { - "title": "Verify a bank account", - "group_title": "Payment Methods", - "group_anchor": "payment_methods_heading", - "anchor": "customer_verify_bank_account", - "section_anchor": "bank_accounts", - "subsection_anchors": null, - "path": "/customer_bank_accounts/verify", - "gate": false, - "display_on_load": false - }, - "customer_delete_bank_account": { - "title": "Delete a bank account", - "group_title": "Payment Methods", - "group_anchor": "payment_methods_heading", - "anchor": "customer_delete_bank_account", - "section_anchor": "bank_accounts", - "subsection_anchors": null, - "path": "/customer_bank_accounts/delete", - "gate": false, - "display_on_load": false - }, - "customer_list_bank_accounts": { - "title": "List all bank accounts", - "group_title": "Payment Methods", - "group_anchor": "payment_methods_heading", - "anchor": "customer_list_bank_accounts", - "section_anchor": "bank_accounts", - "subsection_anchors": null, - "path": "/customer_bank_accounts/list", - "gate": false, - "display_on_load": false - }, - "cash_balance": { - "title": "Cash Balance", - "group_title": "Payment Methods", - "group_anchor": "payment_methods_heading", - "anchor": "cash_balance", - "section_anchor": "cash_balance", - "subsection_anchors": [ - "cash_balance_object", - "retrieve_cash_balance", - "update_cash_balance", - "customer_cash_balance_transaction_object", - "retrieve_cash_balance_transaction", - "list_cash_balance_transactions", - "fund_cash_balance" - ], - "path": "/cash_balance", - "gate": false, - "display_on_load": false, - "data": { - "section_type": "resource", - "title": "Cash balance", - "description": "A customer's `Cash balance` represents real funds. Customers can add funds to their cash balance by sending a bank transfer. These funds can be used for payment and can eventually be paid out to your bank account.\n", - "section_tag": "cash_balance", - "subsection_summaries": [ - { "anchor": "cash_balance_object", "curl_definition": null }, - { - "anchor": "retrieve_cash_balance", - "curl_definition": "GET /v1/customers/:id/cash_balance" - }, - { - "anchor": "update_cash_balance", - "curl_definition": "POST /v1/customers/:id/cash_balance" - }, - { "anchor": "customer_cash_balance_transaction_object", "curl_definition": null }, - { - "anchor": "retrieve_cash_balance_transaction", - "curl_definition": "GET /v1/customers/:id/cash_balance_transactions/:id" - }, - { - "anchor": "list_cash_balance_transactions", - "curl_definition": "GET /v1/customers/:id/cash_balance_transactions" - }, - { - "anchor": "fund_cash_balance", - "curl_definition": "POST /v1/test_helpers/customers/{:customer}/fund_cash_balance" - } - ] - } - }, - "cash_balance_object": { - "title": "The cash balance object", - "group_title": "Payment Methods", - "group_anchor": "payment_methods_heading", - "anchor": "cash_balance_object", - "section_anchor": "cash_balance", - "subsection_anchors": null, - "path": "/cash_balance/object", - "gate": false, - "display_on_load": false - }, - "retrieve_cash_balance": { - "title": "Retrieve a cash balance", - "group_title": "Payment Methods", - "group_anchor": "payment_methods_heading", - "anchor": "retrieve_cash_balance", - "section_anchor": "cash_balance", - "subsection_anchors": null, - "path": "/cash_balance/retrieve", - "gate": true, - "display_on_load": false - }, - "update_cash_balance": { - "title": "Update a cash balance's settings", - "group_title": "Payment Methods", - "group_anchor": "payment_methods_heading", - "anchor": "update_cash_balance", - "section_anchor": "cash_balance", - "subsection_anchors": null, - "path": "/cash_balance/update", - "gate": true, - "display_on_load": false - }, - "customer_cash_balance_transaction_object": { - "title": "The cash balance transaction object", - "group_title": "Payment Methods", - "group_anchor": "payment_methods_heading", - "anchor": "customer_cash_balance_transaction_object", - "section_anchor": "cash_balance", - "subsection_anchors": null, - "path": "/cash_balance_transactions/object", - "gate": false, - "display_on_load": false - }, - "retrieve_cash_balance_transaction": { - "title": "Retrieve a cash balance transaction", - "group_title": "Payment Methods", - "group_anchor": "payment_methods_heading", - "anchor": "retrieve_cash_balance_transaction", - "section_anchor": "cash_balance", - "subsection_anchors": null, - "path": "/cash_balance_transactions/retrieve", - "gate": false, - "display_on_load": false - }, - "list_cash_balance_transactions": { - "title": "List cash balance transactions", - "group_title": "Payment Methods", - "group_anchor": "payment_methods_heading", - "anchor": "list_cash_balance_transactions", - "section_anchor": "cash_balance", - "subsection_anchors": null, - "path": "/cash_balance_transactions/list", - "gate": false, - "display_on_load": false - }, - "fund_cash_balance": { - "title": "Fund a test mode cash balance", - "group_title": "Payment Methods", - "group_anchor": "payment_methods_heading", - "anchor": "fund_cash_balance", - "section_anchor": "cash_balance", - "subsection_anchors": null, - "path": "/cash_balance_transactions/fund_cash_balance", - "gate": false, - "display_on_load": false - }, - "cards": { - "title": "Cards", - "group_title": "Payment Methods", - "group_anchor": "payment_methods_heading", - "anchor": "cards", - "section_anchor": "cards", - "subsection_anchors": [ - "card_object", - "create_card", - "retrieve_card", - "update_card", - "delete_card", - "list_cards" - ], - "path": "/cards", - "gate": false, - "display_on_load": false, - "data": { - "section_type": "resource", - "title": "Cards", - "description": "You can store multiple cards on a customer in order to charge the customer\nlater. You can also store multiple debit cards on a recipient in order to\ntransfer to those cards later.\n\nRelated guide: [Card Payments with Sources](/docs/sources/cards).\n", - "section_tag": "cards", - "subsection_summaries": [ - { "anchor": "card_object", "curl_definition": null }, - { "anchor": "create_card", "curl_definition": "POST /v1/customers/:id/sources" }, - { "anchor": "retrieve_card", "curl_definition": "GET /v1/customers/:id/sources/:id" }, - { "anchor": "update_card", "curl_definition": "POST /v1/customers/:id/sources/:id" }, - { "anchor": "delete_card", "curl_definition": "DELETE /v1/customers/:id/sources/:id" }, - { "anchor": "list_cards", "curl_definition": "GET /v1/customers/:id/sources?object=card" } - ] - } - }, - "card_object": { - "title": "The card object", - "group_title": "Payment Methods", - "group_anchor": "payment_methods_heading", - "anchor": "card_object", - "section_anchor": "cards", - "subsection_anchors": null, - "path": "/cards/object", - "gate": false, - "display_on_load": false - }, - "create_card": { - "title": "Create a card", - "group_title": "Payment Methods", - "group_anchor": "payment_methods_heading", - "anchor": "create_card", - "section_anchor": "cards", - "subsection_anchors": null, - "path": "/cards/create", - "gate": false, - "display_on_load": false - }, - "retrieve_card": { - "title": "Retrieve a card", - "group_title": "Payment Methods", - "group_anchor": "payment_methods_heading", - "anchor": "retrieve_card", - "section_anchor": "cards", - "subsection_anchors": null, - "path": "/cards/retrieve", - "gate": false, - "display_on_load": false - }, - "update_card": { - "title": "Update a card", - "group_title": "Payment Methods", - "group_anchor": "payment_methods_heading", - "anchor": "update_card", - "section_anchor": "cards", - "subsection_anchors": null, - "path": "/cards/update", - "gate": false, - "display_on_load": false - }, - "delete_card": { - "title": "Delete a card", - "group_title": "Payment Methods", - "group_anchor": "payment_methods_heading", - "anchor": "delete_card", - "section_anchor": "cards", - "subsection_anchors": null, - "path": "/cards/delete", - "gate": false, - "display_on_load": false - }, - "list_cards": { - "title": "List all cards", - "group_title": "Payment Methods", - "group_anchor": "payment_methods_heading", - "anchor": "list_cards", - "section_anchor": "cards", - "subsection_anchors": null, - "path": "/cards/list", - "gate": false, - "display_on_load": false - }, - "sources": { - "title": "Sources", - "group_title": "Payment Methods", - "group_anchor": "payment_methods_heading", - "anchor": "sources", - "section_anchor": "sources", - "subsection_anchors": [ - "source_object", - "create_source", - "retrieve_source", - "update_source", - "attach_source", - "detach_source" - ], - "path": "/sources", - "gate": false, - "display_on_load": false, - "data": { - "section_type": "resource", - "title": "Sources", - "description": "`Source` objects allow you to accept a variety of payment methods. They\nrepresent a customer's payment instrument, and can be used with the Stripe API\njust like a `Card` object: once chargeable, they can be charged, or can be\nattached to customers.\n\nStripe doesn't recommend using the deprecated [Sources API](/docs/api/sources).\nWe recommend that you adopt the [PaymentMethods API](/docs/api/payment_methods).\nThis newer API provides access to our latest features and payment method types.\n\nRelated guides: [Sources API](/docs/sources) and [Sources \u0026 Customers](/docs/sources/customers).\n", - "section_tag": "sources", - "subsection_summaries": [ - { "anchor": "source_object", "curl_definition": null }, - { "anchor": "create_source", "curl_definition": "POST /v1/sources" }, - { "anchor": "retrieve_source", "curl_definition": "GET /v1/sources/:id" }, - { "anchor": "update_source", "curl_definition": "POST /v1/sources/:id" }, - { "anchor": "attach_source", "curl_definition": "POST /v1/customers/:id/sources" }, - { "anchor": "detach_source", "curl_definition": "DELETE /v1/customers/:id/sources/:id" } - ] - } - }, - "source_object": { - "title": "The source object", - "group_title": "Payment Methods", - "group_anchor": "payment_methods_heading", - "anchor": "source_object", - "section_anchor": "sources", - "subsection_anchors": null, - "path": "/sources/object", - "gate": false, - "display_on_load": false - }, - "create_source": { - "title": "Create a source", - "group_title": "Payment Methods", - "group_anchor": "payment_methods_heading", - "anchor": "create_source", - "section_anchor": "sources", - "subsection_anchors": null, - "path": "/sources/create", - "gate": false, - "display_on_load": false - }, - "retrieve_source": { - "title": "Retrieve a source", - "group_title": "Payment Methods", - "group_anchor": "payment_methods_heading", - "anchor": "retrieve_source", - "section_anchor": "sources", - "subsection_anchors": null, - "path": "/sources/retrieve", - "gate": false, - "display_on_load": false - }, - "update_source": { - "title": "Update a source", - "group_title": "Payment Methods", - "group_anchor": "payment_methods_heading", - "anchor": "update_source", - "section_anchor": "sources", - "subsection_anchors": null, - "path": "/sources/update", - "gate": false, - "display_on_load": false - }, - "attach_source": { - "title": "Attach a source", - "group_title": "Payment Methods", - "group_anchor": "payment_methods_heading", - "anchor": "attach_source", - "section_anchor": "sources", - "subsection_anchors": null, - "path": "/sources/attach", - "gate": false, - "display_on_load": false - }, - "detach_source": { - "title": "Detach a source", - "group_title": "Payment Methods", - "group_anchor": "payment_methods_heading", - "anchor": "detach_source", - "section_anchor": "sources", - "subsection_anchors": null, - "path": "/sources/detach", - "gate": false, - "display_on_load": false - }, - "products": { - "title": "Products", - "group_title": "Products", - "group_anchor": "products_section", - "anchor": "products", - "section_anchor": "products", - "subsection_anchors": [ - "product_object", - "create_product", - "retrieve_product", - "update_product", - "list_products", - "delete_product", - "search_products" - ], - "path": "/products", - "gate": false, - "display_on_load": false, - "data": { - "section_type": "resource", - "title": "Products", - "description": "Products describe the specific goods or services you offer to your customers.\nFor example, you might offer a Standard and Premium version of your goods or service; each version would be a separate Product.\nThey can be used in conjunction with [Prices](#prices) to configure pricing in Payment Links, Checkout, and Subscriptions.\n\nRelated guides: [Set up a subscription](/docs/billing/subscriptions/set-up-subscription),\n[share a Payment Link](/docs/payments/payment-links/overview),\n[accept payments with Checkout](/docs/payments/accept-a-payment#create-product-prices-upfront),\nand more about [Products and Prices](/docs/products-prices/overview)\n", - "section_tag": "products", - "subsection_summaries": [ - { "anchor": "product_object", "curl_definition": null }, - { "anchor": "create_product", "curl_definition": "POST /v1/products" }, - { "anchor": "retrieve_product", "curl_definition": "GET /v1/products/:id" }, - { "anchor": "update_product", "curl_definition": "POST /v1/products/:id" }, - { "anchor": "list_products", "curl_definition": "GET /v1/products" }, - { "anchor": "delete_product", "curl_definition": "DELETE /v1/products/:id" }, - { "anchor": "search_products", "curl_definition": "GET /v1/products/search" } - ] - } - }, - "product_object": { - "title": "The product object", - "group_title": "Products", - "group_anchor": "products_section", - "anchor": "product_object", - "section_anchor": "products", - "subsection_anchors": null, - "path": "/products/object", - "gate": false, - "display_on_load": false - }, - "create_product": { - "title": "Create a product", - "group_title": "Products", - "group_anchor": "products_section", - "anchor": "create_product", - "section_anchor": "products", - "subsection_anchors": null, - "path": "/products/create", - "gate": false, - "display_on_load": false - }, - "retrieve_product": { - "title": "Retrieve a product", - "group_title": "Products", - "group_anchor": "products_section", - "anchor": "retrieve_product", - "section_anchor": "products", - "subsection_anchors": null, - "path": "/products/retrieve", - "gate": false, - "display_on_load": false - }, - "update_product": { - "title": "Update a product", - "group_title": "Products", - "group_anchor": "products_section", - "anchor": "update_product", - "section_anchor": "products", - "subsection_anchors": null, - "path": "/products/update", - "gate": false, - "display_on_load": false - }, - "list_products": { - "title": "List all products", - "group_title": "Products", - "group_anchor": "products_section", - "anchor": "list_products", - "section_anchor": "products", - "subsection_anchors": null, - "path": "/products/list", - "gate": false, - "display_on_load": false - }, - "delete_product": { - "title": "Delete a product", - "group_title": "Products", - "group_anchor": "products_section", - "anchor": "delete_product", - "section_anchor": "products", - "subsection_anchors": null, - "path": "/products/delete", - "gate": false, - "display_on_load": false - }, - "search_products": { - "title": "Search products", - "group_title": "Products", - "group_anchor": "products_section", - "anchor": "search_products", - "section_anchor": "products", - "subsection_anchors": null, - "path": "/products/search", - "gate": false, - "display_on_load": false - }, - "prices": { - "title": "Prices", - "group_title": "Products", - "group_anchor": "products_section", - "anchor": "prices", - "section_anchor": "prices", - "subsection_anchors": [ - "price_object", - "create_price", - "retrieve_price", - "update_price", - "list_prices", - "search_prices" - ], - "path": "/prices", - "gate": false, - "display_on_load": false, - "data": { - "section_type": "resource", - "title": "Prices", - "description": "Prices define the unit cost, currency, and (optional) billing cycle for both recurring and one-time purchases of products.\n[Products](#products) help you track inventory or provisioning, and prices help you track payment terms. Different physical goods or levels of service should be represented by products, and pricing options should be represented by prices. This approach lets you change prices without having to change your provisioning scheme.\n\nFor example, you might have a single \"gold\" product that has prices for $10/month, $100/year, and €9 once.\n\nRelated guides: [Set up a subscription](/docs/billing/subscriptions/set-up-subscription), [create an invoice](/docs/billing/invoices/create), and more about [products and prices](/docs/products-prices/overview).\n", - "section_tag": "prices", - "subsection_summaries": [ - { "anchor": "price_object", "curl_definition": null }, - { "anchor": "create_price", "curl_definition": "POST /v1/prices" }, - { "anchor": "retrieve_price", "curl_definition": "GET /v1/prices/:id" }, - { "anchor": "update_price", "curl_definition": "POST /v1/prices/:id" }, - { "anchor": "list_prices", "curl_definition": "GET /v1/prices" }, - { "anchor": "search_prices", "curl_definition": "GET /v1/prices/search" } - ] - } - }, - "price_object": { - "title": "The price object", - "group_title": "Products", - "group_anchor": "products_section", - "anchor": "price_object", - "section_anchor": "prices", - "subsection_anchors": null, - "path": "/prices/object", - "gate": false, - "display_on_load": false - }, - "create_price": { - "title": "Create a price", - "group_title": "Products", - "group_anchor": "products_section", - "anchor": "create_price", - "section_anchor": "prices", - "subsection_anchors": null, - "path": "/prices/create", - "gate": false, - "display_on_load": false - }, - "retrieve_price": { - "title": "Retrieve a price", - "group_title": "Products", - "group_anchor": "products_section", - "anchor": "retrieve_price", - "section_anchor": "prices", - "subsection_anchors": null, - "path": "/prices/retrieve", - "gate": false, - "display_on_load": false - }, - "update_price": { - "title": "Update a price", - "group_title": "Products", - "group_anchor": "products_section", - "anchor": "update_price", - "section_anchor": "prices", - "subsection_anchors": null, - "path": "/prices/update", - "gate": false, - "display_on_load": false - }, - "list_prices": { - "title": "List all prices", - "group_title": "Products", - "group_anchor": "products_section", - "anchor": "list_prices", - "section_anchor": "prices", - "subsection_anchors": null, - "path": "/prices/list", - "gate": false, - "display_on_load": false - }, - "search_prices": { - "title": "Search prices", - "group_title": "Products", - "group_anchor": "products_section", - "anchor": "search_prices", - "section_anchor": "prices", - "subsection_anchors": null, - "path": "/prices/search", - "gate": false, - "display_on_load": false - }, - "coupons": { - "title": "Coupons", - "group_title": "Products", - "group_anchor": "products_section", - "anchor": "coupons", - "section_anchor": "coupons", - "subsection_anchors": [ - "coupon_object", - "create_coupon", - "retrieve_coupon", - "update_coupon", - "delete_coupon", - "list_coupons" - ], - "path": "/coupons", - "gate": false, - "display_on_load": false, - "data": { - "section_type": "resource", - "title": "Coupons", - "description": "A coupon contains information about a percent-off or amount-off discount you\nmight want to apply to a customer. Coupons may be applied to [subscriptions](#subscriptions), [invoices](#invoices),\n[checkout sessions](/docs/api/checkout/sessions), [quotes](#quotes), and more. Coupons do not work with conventional one-off [charges](#create_charge) or [payment intents](/docs/api/payment_intents).\n", - "section_tag": "coupons", - "subsection_summaries": [ - { "anchor": "coupon_object", "curl_definition": null }, - { "anchor": "create_coupon", "curl_definition": "POST /v1/coupons" }, - { "anchor": "retrieve_coupon", "curl_definition": "GET /v1/coupons/:id" }, - { "anchor": "update_coupon", "curl_definition": "POST /v1/coupons/:id" }, - { "anchor": "delete_coupon", "curl_definition": "DELETE /v1/coupons/:id" }, - { "anchor": "list_coupons", "curl_definition": "GET /v1/coupons" } - ] - } - }, - "coupon_object": { - "title": "The coupon object", - "group_title": "Products", - "group_anchor": "products_section", - "anchor": "coupon_object", - "section_anchor": "coupons", - "subsection_anchors": null, - "path": "/coupons/object", - "gate": false, - "display_on_load": false - }, - "create_coupon": { - "title": "Create a coupon", - "group_title": "Products", - "group_anchor": "products_section", - "anchor": "create_coupon", - "section_anchor": "coupons", - "subsection_anchors": null, - "path": "/coupons/create", - "gate": false, - "display_on_load": false - }, - "retrieve_coupon": { - "title": "Retrieve a coupon", - "group_title": "Products", - "group_anchor": "products_section", - "anchor": "retrieve_coupon", - "section_anchor": "coupons", - "subsection_anchors": null, - "path": "/coupons/retrieve", - "gate": false, - "display_on_load": false - }, - "update_coupon": { - "title": "Update a coupon", - "group_title": "Products", - "group_anchor": "products_section", - "anchor": "update_coupon", - "section_anchor": "coupons", - "subsection_anchors": null, - "path": "/coupons/update", - "gate": false, - "display_on_load": false - }, - "delete_coupon": { - "title": "Delete a coupon", - "group_title": "Products", - "group_anchor": "products_section", - "anchor": "delete_coupon", - "section_anchor": "coupons", - "subsection_anchors": null, - "path": "/coupons/delete", - "gate": false, - "display_on_load": false - }, - "list_coupons": { - "title": "List all coupons", - "group_title": "Products", - "group_anchor": "products_section", - "anchor": "list_coupons", - "section_anchor": "coupons", - "subsection_anchors": null, - "path": "/coupons/list", - "gate": false, - "display_on_load": false - }, - "promotion_codes": { - "title": "Promotion Codes", - "group_title": "Products", - "group_anchor": "products_section", - "anchor": "promotion_codes", - "section_anchor": "promotion_codes", - "subsection_anchors": [ - "promotion_code_object", - "create_promotion_code", - "update_promotion_code", - "retrieve_promotion_code", - "list_promotion_code" - ], - "path": "/promotion_codes", - "gate": false, - "display_on_load": false, - "data": { - "section_type": "resource", - "title": "Promotion Code", - "description": "A Promotion Code represents a customer-redeemable code for a [coupon](#coupons). It can be used to\ncreate multiple codes for a single coupon.\n", - "section_tag": "promotion_codes", - "subsection_summaries": [ - { "anchor": "promotion_code_object", "curl_definition": null }, - { "anchor": "create_promotion_code", "curl_definition": "POST /v1/promotion_codes" }, - { "anchor": "update_promotion_code", "curl_definition": "POST /v1/promotion_codes/:id" }, - { "anchor": "retrieve_promotion_code", "curl_definition": "GET /v1/promotion_codes/:id" }, - { "anchor": "list_promotion_code", "curl_definition": "GET /v1/promotion_codes" } - ] - } - }, - "promotion_code_object": { - "title": "The promotion code object", - "group_title": "Products", - "group_anchor": "products_section", - "anchor": "promotion_code_object", - "section_anchor": "promotion_codes", - "subsection_anchors": null, - "path": "/promotion_codes/object", - "gate": false, - "display_on_load": false - }, - "create_promotion_code": { - "title": "Create a promotion code", - "group_title": "Products", - "group_anchor": "products_section", - "anchor": "create_promotion_code", - "section_anchor": "promotion_codes", - "subsection_anchors": null, - "path": "/promotion_codes/create", - "gate": false, - "display_on_load": false - }, - "update_promotion_code": { - "title": "Update a promotion code", - "group_title": "Products", - "group_anchor": "products_section", - "anchor": "update_promotion_code", - "section_anchor": "promotion_codes", - "subsection_anchors": null, - "path": "/promotion_codes/update", - "gate": false, - "display_on_load": false - }, - "retrieve_promotion_code": { - "title": "Retrieve a promotion code", - "group_title": "Products", - "group_anchor": "products_section", - "anchor": "retrieve_promotion_code", - "section_anchor": "promotion_codes", - "subsection_anchors": null, - "path": "/promotion_codes/retrieve", - "gate": false, - "display_on_load": false - }, - "list_promotion_code": { - "title": "List all promotion codes", - "group_title": "Products", - "group_anchor": "products_section", - "anchor": "list_promotion_code", - "section_anchor": "promotion_codes", - "subsection_anchors": null, - "path": "/promotion_codes/list", - "gate": false, - "display_on_load": false - }, - "discounts": { - "title": "Discounts", - "group_title": "Products", - "group_anchor": "products_section", - "anchor": "discounts", - "section_anchor": "discounts", - "subsection_anchors": ["discount_object", "delete_discount", "delete_subscription_discount"], - "path": "/discounts", - "gate": false, - "display_on_load": false, - "data": { - "section_type": "resource", - "title": "Discounts", - "description": "A discount represents the actual application of a [coupon](#coupons) or [promotion code](#promotion_codes).\nIt contains information about when the discount began, when it will end, and what it is applied to.\n\nRelated guide: [Applying Discounts to Subscriptions](/docs/billing/subscriptions/discounts).\n", - "section_tag": "discounts", - "subsection_summaries": [ - { "anchor": "discount_object", "curl_definition": null }, - { "anchor": "delete_discount", "curl_definition": "DELETE /v1/customers/:id/discount" }, - { - "anchor": "delete_subscription_discount", - "curl_definition": "DELETE /v1/subscriptions/:id/discount" - } - ] - } - }, - "discount_object": { - "title": "The discount object", - "group_title": "Products", - "group_anchor": "products_section", - "anchor": "discount_object", - "section_anchor": "discounts", - "subsection_anchors": null, - "path": "/discounts/object", - "gate": false, - "display_on_load": false - }, - "delete_discount": { - "title": "Delete a customer discount", - "group_title": "Products", - "group_anchor": "products_section", - "anchor": "delete_discount", - "section_anchor": "discounts", - "subsection_anchors": null, - "path": "/discounts/delete", - "gate": false, - "display_on_load": false - }, - "delete_subscription_discount": { - "title": "Delete a subscription discount", - "group_title": "Products", - "group_anchor": "products_section", - "anchor": "delete_subscription_discount", - "section_anchor": "discounts", - "subsection_anchors": null, - "path": "/discounts/subscription_delete", - "gate": false, - "display_on_load": false - }, - "tax_codes": { - "title": "Tax Codes", - "group_title": "Products", - "group_anchor": "products_section", - "anchor": "tax_codes", - "section_anchor": "tax_codes", - "subsection_anchors": ["tax_code_object", "list_tax_codes", "retrieve_taxcode"], - "path": "/tax_codes", - "gate": false, - "display_on_load": false, - "data": { - "section_type": "resource", - "title": "Tax Code", - "description": "[Tax codes](https://stripe.com/docs/tax/tax-categories) classify goods and services for tax purposes.\n", - "section_tag": "tax_codes", - "subsection_summaries": [ - { "anchor": "tax_code_object", "curl_definition": null }, - { "anchor": "list_tax_codes", "curl_definition": "GET /v1/tax_codes" }, - { "anchor": "retrieve_taxcode", "curl_definition": "GET /v1/tax_codes/:id" } - ] - } - }, - "tax_code_object": { - "title": "The tax code object", - "group_title": "Products", - "group_anchor": "products_section", - "anchor": "tax_code_object", - "section_anchor": "tax_codes", - "subsection_anchors": null, - "path": "/tax_codes/object", - "gate": false, - "display_on_load": false - }, - "list_tax_codes": { - "title": "List all tax codes", - "group_title": "Products", - "group_anchor": "products_section", - "anchor": "list_tax_codes", - "section_anchor": "tax_codes", - "subsection_anchors": null, - "path": "/tax_codes/list", - "gate": false, - "display_on_load": false - }, - "retrieve_taxcode": { - "title": "Retrieve a tax code", - "group_title": "Products", - "group_anchor": "products_section", - "anchor": "retrieve_taxcode", - "section_anchor": "tax_codes", - "subsection_anchors": null, - "path": "/tax_codes/retrieve", - "gate": false, - "display_on_load": false - }, - "tax_rates": { - "title": "Tax Rates", - "group_title": "Products", - "group_anchor": "products_section", - "anchor": "tax_rates", - "section_anchor": "tax_rates", - "subsection_anchors": [ - "tax_rate_object", - "create_tax_rate", - "retrieve_tax_rate", - "update_tax_rate", - "list_tax_rates" - ], - "path": "/tax_rates", - "gate": false, - "display_on_load": false, - "data": { - "section_type": "resource", - "title": "Tax Rate", - "description": "Tax rates can be applied to [invoices](/docs/billing/invoices/tax-rates), [subscriptions](/docs/billing/subscriptions/taxes) and [Checkout Sessions](/docs/payments/checkout/set-up-a-subscription#tax-rates) to collect tax.\n\nRelated guide: [Tax Rates](/docs/billing/taxes/tax-rates).\n", - "section_tag": "tax_rates", - "subsection_summaries": [ - { "anchor": "tax_rate_object", "curl_definition": null }, - { "anchor": "create_tax_rate", "curl_definition": "POST /v1/tax_rates" }, - { "anchor": "retrieve_tax_rate", "curl_definition": "GET /v1/tax_rates/:id" }, - { "anchor": "update_tax_rate", "curl_definition": "POST /v1/tax_rates/:id" }, - { "anchor": "list_tax_rates", "curl_definition": "GET /v1/tax_rates" } - ] - } - }, - "tax_rate_object": { - "title": "The tax rate object", - "group_title": "Products", - "group_anchor": "products_section", - "anchor": "tax_rate_object", - "section_anchor": "tax_rates", - "subsection_anchors": null, - "path": "/tax_rates/object", - "gate": false, - "display_on_load": false - }, - "create_tax_rate": { - "title": "Create a tax rate", - "group_title": "Products", - "group_anchor": "products_section", - "anchor": "create_tax_rate", - "section_anchor": "tax_rates", - "subsection_anchors": null, - "path": "/tax_rates/create", - "gate": false, - "display_on_load": false - }, - "retrieve_tax_rate": { - "title": "Retrieves a tax rate", - "group_title": "Products", - "group_anchor": "products_section", - "anchor": "retrieve_tax_rate", - "section_anchor": "tax_rates", - "subsection_anchors": null, - "path": "/tax_rates/retrieve", - "gate": false, - "display_on_load": false - }, - "update_tax_rate": { - "title": "Update a tax rate", - "group_title": "Products", - "group_anchor": "products_section", - "anchor": "update_tax_rate", - "section_anchor": "tax_rates", - "subsection_anchors": null, - "path": "/tax_rates/update", - "gate": false, - "display_on_load": false - }, - "list_tax_rates": { - "title": "List all tax rates", - "group_title": "Products", - "group_anchor": "products_section", - "anchor": "list_tax_rates", - "section_anchor": "tax_rates", - "subsection_anchors": null, - "path": "/tax_rates/list", - "gate": false, - "display_on_load": false - }, - "shipping_rates": { - "title": "Shipping Rates", - "group_title": "Products", - "group_anchor": "products_section", - "anchor": "shipping_rates", - "section_anchor": "shipping_rates", - "subsection_anchors": [ - "shipping_rate_object", - "create_shipping_rate", - "retrieve_shipping_rate", - "update_shipping_rate", - "list_shipping_rates" - ], - "path": "/shipping_rates", - "gate": false, - "display_on_load": false, - "data": { - "section_type": "resource", - "title": "Shipping Rates", - "description": "Shipping rates describe the price of shipping presented to your customers and can be\napplied to [Checkout Sessions](/docs/payments/checkout/shipping)\nand [Orders](/docs/orders/shipping) to collect shipping costs.\n", - "section_tag": "shipping_rates", - "subsection_summaries": [ - { "anchor": "shipping_rate_object", "curl_definition": null }, - { "anchor": "create_shipping_rate", "curl_definition": "POST /v1/shipping_rates" }, - { "anchor": "retrieve_shipping_rate", "curl_definition": "GET /v1/shipping_rates/:id" }, - { "anchor": "update_shipping_rate", "curl_definition": "POST /v1/shipping_rates/:id" }, - { "anchor": "list_shipping_rates", "curl_definition": "GET /v1/shipping_rates" } - ] - } - }, - "shipping_rate_object": { - "title": "The shipping rate object", - "group_title": "Products", - "group_anchor": "products_section", - "anchor": "shipping_rate_object", - "section_anchor": "shipping_rates", - "subsection_anchors": null, - "path": "/shipping_rates/object", - "gate": false, - "display_on_load": false - }, - "create_shipping_rate": { - "title": "Create a shipping rate", - "group_title": "Products", - "group_anchor": "products_section", - "anchor": "create_shipping_rate", - "section_anchor": "shipping_rates", - "subsection_anchors": null, - "path": "/shipping_rates/create", - "gate": false, - "display_on_load": false - }, - "retrieve_shipping_rate": { - "title": "Retrieve a shipping rate", - "group_title": "Products", - "group_anchor": "products_section", - "anchor": "retrieve_shipping_rate", - "section_anchor": "shipping_rates", - "subsection_anchors": null, - "path": "/shipping_rates/retrieve", - "gate": false, - "display_on_load": false - }, - "update_shipping_rate": { - "title": "Update a shipping rate", - "group_title": "Products", - "group_anchor": "products_section", - "anchor": "update_shipping_rate", - "section_anchor": "shipping_rates", - "subsection_anchors": null, - "path": "/shipping_rates/update", - "gate": false, - "display_on_load": false - }, - "list_shipping_rates": { - "title": "List all shipping rates", - "group_title": "Products", - "group_anchor": "products_section", - "anchor": "list_shipping_rates", - "section_anchor": "shipping_rates", - "subsection_anchors": null, - "path": "/shipping_rates/list", - "gate": false, - "display_on_load": false - }, - "checkout_sessions": { - "title": "Checkout Sessions", - "group_title": "Checkout", - "group_anchor": "checkout", - "anchor": "checkout_sessions", - "section_anchor": "checkout_sessions", - "subsection_anchors": [ - "checkout_session_object", - "create_checkout_session", - "expire_checkout_session", - "retrieve_checkout_session", - "list_checkout_sessions", - "retrieve_checkout_session_line_items" - ], - "path": "/checkout/sessions", - "gate": false, - "display_on_load": false, - "data": { - "section_type": "resource", - "title": "Sessions", - "description": "A Checkout Session represents your customer's session as they pay for\none-time purchases or subscriptions through [Checkout](/docs/payments/checkout)\nor [Payment Links](/docs/payments/payment-links). We recommend creating a\nnew Session each time your customer attempts to pay.\n\nOnce payment is successful, the Checkout Session will contain a reference\nto the [Customer](/docs/api/customers), and either the successful\n[PaymentIntent](/docs/api/payment_intents) or an active\n[Subscription](/docs/api/subscriptions).\n\nYou can create a Checkout Session on your server and pass its ID to the\nclient to begin Checkout.\n\nRelated guide: [Checkout Quickstart](/docs/checkout/quickstart).\n", - "section_tag": "checkout_sessions", - "subsection_summaries": [ - { "anchor": "checkout_session_object", "curl_definition": null }, - { "anchor": "create_checkout_session", "curl_definition": "POST /v1/checkout/sessions" }, - { - "anchor": "expire_checkout_session", - "curl_definition": "POST /v1/checkout/sessions/:id/expire" - }, - { - "anchor": "retrieve_checkout_session", - "curl_definition": "GET /v1/checkout/sessions/:id" - }, - { "anchor": "list_checkout_sessions", "curl_definition": "GET /v1/checkout/sessions" }, - { - "anchor": "retrieve_checkout_session_line_items", - "curl_definition": "GET /v1/checkout/sessions/:id/line_items" - } - ] - } - }, - "checkout_session_object": { - "title": "The Checkout Session object", - "group_title": "Checkout", - "group_anchor": "checkout", - "anchor": "checkout_session_object", - "section_anchor": "checkout_sessions", - "subsection_anchors": null, - "path": "/checkout/sessions/object", - "gate": false, - "display_on_load": false - }, - "create_checkout_session": { - "title": "Create a Checkout Session", - "group_title": "Checkout", - "group_anchor": "checkout", - "anchor": "create_checkout_session", - "section_anchor": "checkout_sessions", - "subsection_anchors": null, - "path": "/checkout/sessions/create", - "gate": false, - "display_on_load": false - }, - "expire_checkout_session": { - "title": "Expire a Checkout Session", - "group_title": "Checkout", - "group_anchor": "checkout", - "anchor": "expire_checkout_session", - "section_anchor": "checkout_sessions", - "subsection_anchors": null, - "path": "/checkout/sessions/expire", - "gate": false, - "display_on_load": false - }, - "retrieve_checkout_session": { - "title": "Retrieve a Checkout Session", - "group_title": "Checkout", - "group_anchor": "checkout", - "anchor": "retrieve_checkout_session", - "section_anchor": "checkout_sessions", - "subsection_anchors": null, - "path": "/checkout/sessions/retrieve", - "gate": false, - "display_on_load": false - }, - "list_checkout_sessions": { - "title": "List all Checkout Sessions", - "group_title": "Checkout", - "group_anchor": "checkout", - "anchor": "list_checkout_sessions", - "section_anchor": "checkout_sessions", - "subsection_anchors": null, - "path": "/checkout/sessions/list", - "gate": false, - "display_on_load": false - }, - "retrieve_checkout_session_line_items": { - "title": "Retrieve a Checkout Session's line items", - "group_title": "Checkout", - "group_anchor": "checkout", - "anchor": "retrieve_checkout_session_line_items", - "section_anchor": "checkout_sessions", - "subsection_anchors": null, - "path": "/checkout/sessions/line_items", - "gate": false, - "display_on_load": false - }, - "payment_links": { - "title": "Payment Links", - "group_title": "Payment Links", - "group_anchor": "payment_links_section", - "anchor": "payment_links", - "section_anchor": "payment_links", - "subsection_anchors": [ - "payment_link_object", - "create_payment_link", - "retrieve_payment_link", - "update_payment_link", - "list_payment_link", - "retrieve_payment_link_line_items" - ], - "path": "/payment_links/payment_links", - "gate": false, - "display_on_load": true, - "data": { - "section_type": "resource", - "title": "Payment Link", - "description": "A payment link is a shareable URL that will take your customers to a hosted payment page. A payment link can be shared and used multiple times.\n\nWhen a customer opens a payment link it will open a new [checkout session](/docs/api/checkout/sessions) to render the payment page. You can use [checkout session events](/docs/api/events/types#event_types-checkout.session.completed) to track payments through payment links.\n\nRelated guide: [Payment Links API](/docs/payments/payment-links/api)\n", - "section_tag": "payment_links", - "subsection_summaries": [ - { "anchor": "payment_link_object", "curl_definition": null }, - { "anchor": "create_payment_link", "curl_definition": "POST /v1/payment_links" }, - { "anchor": "retrieve_payment_link", "curl_definition": "GET /v1/payment_links/:id" }, - { "anchor": "update_payment_link", "curl_definition": "POST /v1/payment_links/:id" }, - { "anchor": "list_payment_link", "curl_definition": "GET /v1/payment_links" }, - { - "anchor": "retrieve_payment_link_line_items", - "curl_definition": "GET /v1/payment_links/:id/line_items" - } - ] - } - }, - "payment_link_object": { - "title": "The payment link object", - "group_title": "Payment Links", - "group_anchor": "payment_links_section", - "anchor": "payment_link_object", - "section_anchor": "payment_links", - "subsection_anchors": null, - "path": "/payment_links/payment_links/object", - "gate": false, - "display_on_load": true, - "data": { - "section_type": "response", - "section_tag": "payment_link_object", - "doc_object_type": "payment_link", - "object_type": "payment_link", - "title": "The payment link object", - "specs": { - "id": { - "name": "id", - "check": "string", - "validation": "string", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Unique identifier for the object.", - "undocumented": false, - "html": "Unique identifier for the object." - }, - "gate": false, - "hide_unset_desc": null, - "required": true, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "id" - }, - "object": { - "name": "object", - "check": "string", - "validation": "string", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "String representing the object's type. Objects of the same type share the same value.", - "undocumented": false, - "html": "String representing the object’s type. Objects of the same type share the same value." - }, - "gate": false, - "hide_unset_desc": null, - "required": true, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "object", - "less_common": true - }, - "active": { - "name": "active", - "check": "boolean", - "validation": "boolean", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Whether the payment link's `url` is active. If `false`, customers visiting the URL will be shown a page saying that the link has been deactivated.", - "undocumented": false, - "html": "Whether the payment link’s \u003Ccode\u003Eurl\u003C/code\u003E is active. If \u003Ccode\u003Efalse\u003C/code\u003E, customers visiting the URL will be shown a page saying that the link has been deactivated." - }, - "gate": false, - "hide_unset_desc": null, - "required": true, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "active" - }, - "after_completion": { - "name": "after_completion", - "check": "hash", - "validation": "hash", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Behavior after the purchase is complete.", - "undocumented": false, - "html": "Behavior after the purchase is complete." - }, - "gate": false, - "hide_unset_desc": null, - "required": true, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "subspec": { - "hosted_confirmation": { - "name": "hosted_confirmation", - "check": "hash", - "validation": "hash", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Configuration when `type=hosted_confirmation`.", - "undocumented": false, - "html": "Configuration when \u003Ccode\u003Etype=hosted_confirmation\u003C/code\u003E." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "subspec": { - "custom_message": { - "name": "custom_message", - "check": "string", - "validation": "string", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "The custom message that is displayed to the customer after the purchase is complete.", - "undocumented": false, - "html": "The custom message that is displayed to the customer after the purchase is complete." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "custom_message" - } - }, - "object_type": "hosted_confirmation" - }, - "redirect": { - "name": "redirect", - "check": "hash", - "validation": "hash", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Configuration when `type=redirect`.", - "undocumented": false, - "html": "Configuration when \u003Ccode\u003Etype=redirect\u003C/code\u003E." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "subspec": { - "url": { - "name": "url", - "check": "string", - "validation": "string", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "The URL the customer will be redirected to after the purchase is complete.", - "undocumented": false, - "html": "The URL the customer will be redirected to after the purchase is complete." - }, - "gate": false, - "hide_unset_desc": null, - "required": true, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "url" - } - }, - "object_type": "redirect" - }, - "type": { - "name": "type", - "check": "string", - "validation": "string", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "The specified behavior after the purchase is complete.", - "undocumented": false, - "html": "The specified behavior after the purchase is complete." - }, - "gate": false, - "hide_unset_desc": null, - "required": true, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "enum_values": { - "redirect": { - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Redirects the customer to the specified `url` after the purchase is complete.", - "undocumented": false, - "html": "Redirects the customer to the specified \u003Ccode\u003Eurl\u003C/code\u003E after the purchase is complete." - } - }, - "hosted_confirmation": { - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Displays a message on the hosted surface after the purchase is complete.", - "undocumented": false, - "html": "Displays a message on the hosted surface after the purchase is complete." - } - } - }, - "object_type": "type" - } - }, - "object_type": "after_completion", - "less_common": true - }, - "allow_promotion_codes": { - "name": "allow_promotion_codes", - "check": "boolean", - "validation": "boolean", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Whether user redeemable promotion codes are enabled.", - "undocumented": false, - "html": "Whether user redeemable promotion codes are enabled." - }, - "gate": false, - "hide_unset_desc": null, - "required": true, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "allow_promotion_codes", - "less_common": true - }, - "application_fee_amount": { - "name": "application_fee_amount", - "check": "integer", - "validation": "integer", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "The amount of the application fee (if any) that will be requested to be applied to the payment and transferred to the application owner's Stripe account. ", - "undocumented": false, - "html": "The amount of the application fee (if any) that will be requested to be applied to the payment and transferred to the application owner’s Stripe account. " - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": "Connect only", - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "application_fee_amount", - "less_common": true - }, - "application_fee_percent": { - "name": "application_fee_percent", - "check": "decimal", - "validation": "decimal", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "This represents the percentage of the subscription invoice subtotal that will be transferred to the application owner's Stripe account.", - "undocumented": false, - "html": "This represents the percentage of the subscription invoice subtotal that will be transferred to the application owner’s Stripe account." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": "Connect only", - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "application_fee_percent", - "less_common": true - }, - "automatic_tax": { - "name": "automatic_tax", - "check": "hash", - "validation": "hash", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Configuration details for automatic tax collection.", - "undocumented": false, - "html": "Configuration details for automatic tax collection." - }, - "gate": false, - "hide_unset_desc": null, - "required": true, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "subspec": { - "enabled": { - "name": "enabled", - "check": "boolean", - "validation": "boolean", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "If `true`, tax will be calculated automatically using the customer's location.", - "undocumented": false, - "html": "If \u003Ccode\u003Etrue\u003C/code\u003E, tax will be calculated automatically using the customer’s location." - }, - "gate": false, - "hide_unset_desc": null, - "required": true, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "enabled" - } - }, - "object_type": "automatic_tax", - "less_common": true - }, - "billing_address_collection": { - "name": "billing_address_collection", - "check": "string", - "validation": "string", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Configuration for collecting the customer's billing address.", - "undocumented": false, - "html": "Configuration for collecting the customer’s billing address." - }, - "gate": false, - "hide_unset_desc": null, - "required": true, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "enum_values": { - "auto": { - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Checkout will only collect the billing address when necessary.", - "undocumented": false, - "badge_text": "Default", - "html": "Checkout will only collect the billing address when necessary." - } - }, - "required": { - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Checkout will always collect the customer's billing address.", - "undocumented": false, - "html": "Checkout will always collect the customer’s billing address." - } - } - }, - "object_type": "billing_address_collection", - "less_common": true - }, - "consent_collection": { - "name": "consent_collection", - "check": "hash", - "validation": "hash", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "When set, provides configuration to gather active consent from customers.", - "undocumented": false, - "html": "When set, provides configuration to gather active consent from customers." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "subspec": { - "promotions": { - "name": "promotions", - "check": "string", - "validation": "string", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "If set to `auto`, enables the collection of customer consent for promotional communications.", - "undocumented": false, - "html": "If set to \u003Ccode\u003Eauto\u003C/code\u003E, enables the collection of customer consent for promotional communications." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "promotions" - }, - "terms_of_service": { - "name": "terms_of_service", - "check": "string", - "validation": "string", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "If set to `required`, it requires cutomers to accept the terms of service before being able to pay. If set to `none`, customers won't be shown a checkbox to accept the terms of service.", - "undocumented": false, - "html": "If set to \u003Ccode\u003Erequired\u003C/code\u003E, it requires cutomers to accept the terms of service before being able to pay. If set to \u003Ccode\u003Enone\u003C/code\u003E, customers won’t be shown a checkbox to accept the terms of service." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "terms_of_service" - } - }, - "object_type": "consent_collection", - "less_common": true - }, - "currency": { - "name": "currency", - "check": "currency", - "validation": "currency", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. Must be a [supported currency](https://stripe.com/docs/currencies).", - "undocumented": false, - "html": "Three-letter \u003Ca href=\"https://www.iso.org/iso-4217-currency-codes.html\"\u003EISO currency code\u003C/a\u003E, in lowercase. Must be a \u003Ca href=\"https://stripe.com/docs/currencies\"\u003Esupported currency\u003C/a\u003E." - }, - "gate": false, - "hide_unset_desc": null, - "required": true, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "currency", - "less_common": true - }, - "custom_text": { - "name": "custom_text", - "check": "hash", - "validation": "hash", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Display additional text for your customers using custom text. ", - "undocumented": false, - "html": "Display additional text for your customers using custom text. " - }, - "gate": false, - "hide_unset_desc": null, - "required": true, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "subspec": { - "shipping_address": { - "name": "shipping_address", - "check": "hash", - "validation": "hash", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Custom text that should be displayed alongside shipping address collection.", - "undocumented": false, - "html": "Custom text that should be displayed alongside shipping address collection." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "subspec": { - "message": { - "name": "message", - "check": "string", - "validation": "string", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Text may be up to 1000 characters in length.", - "undocumented": false, - "html": "Text may be up to 1000 characters in length." - }, - "gate": false, - "hide_unset_desc": null, - "required": true, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "message" - } - }, - "object_type": "shipping_address" - }, - "submit": { - "name": "submit", - "check": "hash", - "validation": "hash", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Custom text that should be displayed alongside the payment confirmation button.", - "undocumented": false, - "html": "Custom text that should be displayed alongside the payment confirmation button." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "subspec": { - "message": { - "name": "message", - "check": "string", - "validation": "string", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Text may be up to 1000 characters in length.", - "undocumented": false, - "html": "Text may be up to 1000 characters in length." - }, - "gate": false, - "hide_unset_desc": null, - "required": true, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "message" - } - }, - "object_type": "submit" - } - }, - "object_type": "custom_text", - "less_common": true - }, - "customer_creation": { - "name": "customer_creation", - "check": "string", - "validation": "string", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Configuration for Customer creation during checkout.", - "undocumented": false, - "html": "Configuration for Customer creation during checkout." - }, - "gate": false, - "hide_unset_desc": null, - "required": true, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "enum_values": { - "if_required": { - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "The Checkout Session will only create a [Customer](/docs/api/customers) if it is required for Session confirmation.\nCurrently, only `subscription` mode Sessions require a Customer.\n", - "undocumented": false, - "html": "The Checkout Session will only create a \u003Ca href=\"/docs/api/customers\"\u003ECustomer\u003C/a\u003E if it is required for Session confirmation.\nCurrently, only \u003Ccode\u003Esubscription\u003C/code\u003E mode Sessions require a Customer." - } - }, - "always": { - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "The Checkout Session will always create a [Customer](/docs/api/customers) when a Session confirmation is attempted.\n", - "undocumented": false, - "html": "The Checkout Session will always create a \u003Ca href=\"/docs/api/customers\"\u003ECustomer\u003C/a\u003E when a Session confirmation is attempted." - } - } - }, - "object_type": "customer_creation", - "less_common": true - }, - "line_items": { - "name": "line_items", - "check": "hash", - "validation": "hash", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "The line items representing what is being sold.", - "undocumented": false, - "html": "The line items representing what is being sold." - }, - "gate": false, - "hide_unset_desc": null, - "required": true, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": true, - "subspec": { - "object": { - "name": "object", - "check": "string", - "validation": "string", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "String representing the object's type. Objects of the same type share the same value. Always has the value `list`.", - "undocumented": false, - "html": "String representing the object’s type. Objects of the same type share the same value. Always has the value \u003Ccode\u003Elist\u003C/code\u003E." - }, - "gate": false, - "hide_unset_desc": null, - "required": true, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "object" - }, - "data": { - "name": "data", - "check": "array", - "validation": "array", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Details about each object.", - "undocumented": false, - "html": "Details about each object." - }, - "gate": false, - "hide_unset_desc": null, - "required": true, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "subspec": { - "id": { - "name": "id", - "check": "string", - "validation": "string", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Unique identifier for the object.", - "undocumented": false, - "html": "Unique identifier for the object." - }, - "gate": false, - "hide_unset_desc": null, - "required": true, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "id" - }, - "object": { - "name": "object", - "check": "string", - "validation": "string", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "String representing the object's type. Objects of the same type share the same value.", - "undocumented": false, - "html": "String representing the object’s type. Objects of the same type share the same value." - }, - "gate": false, - "hide_unset_desc": null, - "required": true, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "object" - }, - "amount_discount": { - "name": "amount_discount", - "check": "integer", - "validation": "integer", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Total discount amount applied. If no discounts were applied, defaults to 0.", - "undocumented": false, - "html": "Total discount amount applied. If no discounts were applied, defaults to 0." - }, - "gate": false, - "hide_unset_desc": null, - "required": true, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "amount_discount" - }, - "amount_subtotal": { - "name": "amount_subtotal", - "check": "integer", - "validation": "integer", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Total before any discounts or taxes are applied.", - "undocumented": false, - "html": "Total before any discounts or taxes are applied." - }, - "gate": false, - "hide_unset_desc": null, - "required": true, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "amount_subtotal" - }, - "amount_tax": { - "name": "amount_tax", - "check": "integer", - "validation": "integer", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Total tax amount applied. If no tax was applied, defaults to 0.", - "undocumented": false, - "html": "Total tax amount applied. If no tax was applied, defaults to 0." - }, - "gate": false, - "hide_unset_desc": null, - "required": true, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "amount_tax" - }, - "amount_total": { - "name": "amount_total", - "check": "integer", - "validation": "integer", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Total after discounts and taxes.", - "undocumented": false, - "html": "Total after discounts and taxes." - }, - "gate": false, - "hide_unset_desc": null, - "required": true, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "amount_total" - }, - "currency": { - "name": "currency", - "check": "currency", - "validation": "currency", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. Must be a [supported currency](https://stripe.com/docs/currencies).", - "undocumented": false, - "html": "Three-letter \u003Ca href=\"https://www.iso.org/iso-4217-currency-codes.html\"\u003EISO currency code\u003C/a\u003E, in lowercase. Must be a \u003Ca href=\"https://stripe.com/docs/currencies\"\u003Esupported currency\u003C/a\u003E." - }, - "gate": false, - "hide_unset_desc": null, - "required": true, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "currency" - }, - "description": { - "name": "description", - "check": "string", - "validation": "string", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "An arbitrary string attached to the object. Often useful for displaying to users. Defaults to product name.", - "undocumented": false, - "html": "An arbitrary string attached to the object. Often useful for displaying to users. Defaults to product name." - }, - "gate": false, - "hide_unset_desc": null, - "required": true, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "description" - }, - "discounts": { - "name": "discounts", - "check": "array", - "validation": "array", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "The discounts applied to the line item.", - "undocumented": false, - "html": "The discounts applied to the line item." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": true, - "subspec": { - "amount": { - "name": "amount", - "check": "integer", - "validation": "integer", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "The amount discounted.", - "undocumented": false, - "html": "The amount discounted." - }, - "gate": false, - "hide_unset_desc": null, - "required": true, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "amount" - }, - "discount": { - "name": "discount", - "check": "hash", - "validation": "hash", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "The discount applied.", - "undocumented": false, - "html": "The discount applied." - }, - "gate": false, - "hide_unset_desc": null, - "required": true, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "resource_type": "discount", - "resource_type_link": "#discount_object", - "object_type": "discount" - } - }, - "object_type": "discounts" - }, - "price": { - "name": "price", - "check": "hash", - "validation": "hash", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "The price used to generate the line item.", - "undocumented": false, - "html": "The price used to generate the line item." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "subspec": { - "id": { - "name": "id", - "check": "string", - "validation": "string", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Unique identifier for the object.", - "undocumented": false, - "html": "Unique identifier for the object." - }, - "gate": false, - "hide_unset_desc": null, - "required": true, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "id" - }, - "object": { - "name": "object", - "check": "string", - "validation": "string", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "String representing the object's type. Objects of the same type share the same value.", - "undocumented": false, - "html": "String representing the object’s type. Objects of the same type share the same value." - }, - "gate": false, - "hide_unset_desc": null, - "required": true, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "object", - "less_common": true - }, - "active": { - "name": "active", - "check": "boolean", - "validation": "boolean", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Whether the price can be used for new purchases.", - "undocumented": false, - "html": "Whether the price can be used for new purchases." - }, - "gate": false, - "hide_unset_desc": null, - "required": true, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "active" - }, - "billing_scheme": { - "name": "billing_scheme", - "check": "string", - "validation": "string", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Describes how to compute the price per period. Either `per_unit` or `tiered`. `per_unit` indicates that the fixed amount (specified in `unit_amount` or `unit_amount_decimal`) will be charged per unit in `quantity` (for prices with `usage_type=licensed`), or per unit of total usage (for prices with `usage_type=metered`). `tiered` indicates that the unit pricing will be computed using a tiering strategy as defined using the `tiers` and `tiers_mode` attributes.", - "undocumented": false, - "html": "Describes how to compute the price per period. Either \u003Ccode\u003Eper_unit\u003C/code\u003E or \u003Ccode\u003Etiered\u003C/code\u003E. \u003Ccode\u003Eper_unit\u003C/code\u003E indicates that the fixed amount (specified in \u003Ccode\u003Eunit_amount\u003C/code\u003E or \u003Ccode\u003Eunit_amount_decimal\u003C/code\u003E) will be charged per unit in \u003Ccode\u003Equantity\u003C/code\u003E (for prices with \u003Ccode\u003Eusage_type=licensed\u003C/code\u003E), or per unit of total usage (for prices with \u003Ccode\u003Eusage_type=metered\u003C/code\u003E). \u003Ccode\u003Etiered\u003C/code\u003E indicates that the unit pricing will be computed using a tiering strategy as defined using the \u003Ccode\u003Etiers\u003C/code\u003E and \u003Ccode\u003Etiers_mode\u003C/code\u003E attributes." - }, - "gate": false, - "hide_unset_desc": null, - "required": true, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "billing_scheme", - "less_common": true - }, - "created": { - "name": "created", - "check": "timestamp", - "validation": "timestamp", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Time at which the object was created. Measured in seconds since the Unix epoch.", - "undocumented": false, - "html": "Time at which the object was created. Measured in seconds since the Unix epoch." - }, - "gate": false, - "hide_unset_desc": null, - "required": true, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "created", - "less_common": true - }, - "currency": { - "name": "currency", - "check": "currency", - "validation": "currency", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. Must be a [supported currency](https://stripe.com/docs/currencies).", - "undocumented": false, - "html": "Three-letter \u003Ca href=\"https://www.iso.org/iso-4217-currency-codes.html\"\u003EISO currency code\u003C/a\u003E, in lowercase. Must be a \u003Ca href=\"https://stripe.com/docs/currencies\"\u003Esupported currency\u003C/a\u003E." - }, - "gate": false, - "hide_unset_desc": null, - "required": true, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "currency" - }, - "currency_options": { - "name": "currency_options", - "check": "hash", - "validation": "hash", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Prices defined in each available currency option. Each key must be a three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html) and a [supported currency](https://stripe.com/docs/currencies). For example, to get your price in `eur`, fetch the value of the `eur` key in `currency_options`.", - "undocumented": false, - "html": "Prices defined in each available currency option. Each key must be a three-letter \u003Ca href=\"https://www.iso.org/iso-4217-currency-codes.html\"\u003EISO currency code\u003C/a\u003E and a \u003Ca href=\"https://stripe.com/docs/currencies\"\u003Esupported currency\u003C/a\u003E. For example, to get your price in \u003Ccode\u003Eeur\u003C/code\u003E, fetch the value of the \u003Ccode\u003Eeur\u003C/code\u003E key in \u003Ccode\u003Ecurrency_options\u003C/code\u003E." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": true, - "map_key_name_for_docs": "currency", - "subspec": { - "custom_unit_amount": { - "name": "\u003Ccurrency\u003E.custom_unit_amount", - "check": "hash", - "validation": "hash", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "When set, provides configuration for the amount to be adjusted by the customer during Checkout Sessions and Payment Links.", - "undocumented": false, - "html": "When set, provides configuration for the amount to be adjusted by the customer during Checkout Sessions and Payment Links." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "subspec": { - "maximum": { - "name": "maximum", - "check": "nonnegative_integer", - "validation": "positive integer or zero", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "The maximum unit amount the customer can specify for this item.", - "undocumented": false, - "html": "The maximum unit amount the customer can specify for this item." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "maximum" - }, - "minimum": { - "name": "minimum", - "check": "nonnegative_integer", - "validation": "positive integer or zero", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "The minimum unit amount the customer can specify for this item. Must be at least the minimum charge amount.", - "undocumented": false, - "html": "The minimum unit amount the customer can specify for this item. Must be at least the minimum charge amount." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "minimum" - }, - "preset": { - "name": "preset", - "check": "nonnegative_integer", - "validation": "positive integer or zero", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "The starting unit amount which can be updated by the customer.", - "undocumented": false, - "html": "The starting unit amount which can be updated by the customer." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "preset" - } - }, - "object_type": "custom_unit_amount", - "less_common": true - }, - "tax_behavior": { - "name": "\u003Ccurrency\u003E.tax_behavior", - "check": "string", - "validation": "string", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Specifies whether the price is considered inclusive of taxes or exclusive of taxes. One of `inclusive`, `exclusive`, or `unspecified`. Once specified as either `inclusive` or `exclusive`, it cannot be changed.", - "undocumented": false, - "html": "Specifies whether the price is considered inclusive of taxes or exclusive of taxes. One of \u003Ccode\u003Einclusive\u003C/code\u003E, \u003Ccode\u003Eexclusive\u003C/code\u003E, or \u003Ccode\u003Eunspecified\u003C/code\u003E. Once specified as either \u003Ccode\u003Einclusive\u003C/code\u003E or \u003Ccode\u003Eexclusive\u003C/code\u003E, it cannot be changed." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "tax_behavior", - "less_common": true - }, - "tiers": { - "name": "\u003Ccurrency\u003E.tiers", - "check": "array", - "validation": "array", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Each element represents a pricing tier. This parameter requires `billing_scheme` to be set to `tiered`. See also the documentation for `billing_scheme`.", - "undocumented": false, - "html": "Each element represents a pricing tier. This parameter requires \u003Ccode\u003Ebilling_scheme\u003C/code\u003E to be set to \u003Ccode\u003Etiered\u003C/code\u003E. See also the documentation for \u003Ccode\u003Ebilling_scheme\u003C/code\u003E." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": true, - "subspec": { - "flat_amount": { - "name": "flat_amount", - "check": "integer", - "validation": "integer", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Price for the entire tier.", - "undocumented": false, - "html": "Price for the entire tier." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "flat_amount" - }, - "flat_amount_decimal": { - "name": "flat_amount_decimal", - "check": "decimal_string", - "validation": "decimal string", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Same as `flat_amount`, but contains a decimal value with at most 12 decimal places.", - "undocumented": false, - "html": "Same as \u003Ccode\u003Eflat_amount\u003C/code\u003E, but contains a decimal value with at most 12 decimal places." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "flat_amount_decimal" - }, - "unit_amount": { - "name": "unit_amount", - "check": "integer", - "validation": "integer", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Per unit price for units relevant to the tier.", - "undocumented": false, - "html": "Per unit price for units relevant to the tier." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "unit_amount" - }, - "unit_amount_decimal": { - "name": "unit_amount_decimal", - "check": "decimal_string", - "validation": "decimal string", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Same as `unit_amount`, but contains a decimal value with at most 12 decimal places.", - "undocumented": false, - "html": "Same as \u003Ccode\u003Eunit_amount\u003C/code\u003E, but contains a decimal value with at most 12 decimal places." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "unit_amount_decimal" - }, - "up_to": { - "name": "up_to", - "check": "integer", - "validation": "integer", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Up to and including to this quantity will be contained in the tier.", - "undocumented": false, - "html": "Up to and including to this quantity will be contained in the tier." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "up_to" - } - }, - "object_type": "tiers", - "less_common": true - }, - "unit_amount": { - "name": "\u003Ccurrency\u003E.unit_amount", - "check": "integer", - "validation": "integer", - "documentation": { - "gate_specific": {}, - "localize_terms": ["currency_sub_unit"], - "markdown": "The unit amount in sen to be charged, represented as a whole integer if possible. Only set if `billing_scheme=per_unit`.", - "undocumented": false, - "html": "The unit amount in sen to be charged, represented as a whole integer if possible. Only set if \u003Ccode\u003Ebilling_scheme=per_unit\u003C/code\u003E." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "unit_amount" - }, - "unit_amount_decimal": { - "name": "\u003Ccurrency\u003E.unit_amount_decimal", - "check": "decimal_string", - "validation": "decimal string", - "documentation": { - "gate_specific": {}, - "localize_terms": ["currency_sub_unit"], - "markdown": "The unit amount in sen to be charged, represented as a decimal string with at most 12 decimal places. Only set if `billing_scheme=per_unit`.", - "undocumented": false, - "html": "The unit amount in sen to be charged, represented as a decimal string with at most 12 decimal places. Only set if \u003Ccode\u003Ebilling_scheme=per_unit\u003C/code\u003E." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "unit_amount_decimal", - "less_common": true - } - }, - "object_type": "currency_options", - "less_common": true - }, - "custom_unit_amount": { - "name": "custom_unit_amount", - "check": "hash", - "validation": "hash", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "When set, provides configuration for the amount to be adjusted by the customer during Checkout Sessions and Payment Links.", - "undocumented": false, - "html": "When set, provides configuration for the amount to be adjusted by the customer during Checkout Sessions and Payment Links." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "subspec": { - "maximum": { - "name": "maximum", - "check": "nonnegative_integer", - "validation": "positive integer or zero", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "The maximum unit amount the customer can specify for this item.", - "undocumented": false, - "html": "The maximum unit amount the customer can specify for this item." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "maximum" - }, - "minimum": { - "name": "minimum", - "check": "nonnegative_integer", - "validation": "positive integer or zero", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "The minimum unit amount the customer can specify for this item. Must be at least the minimum charge amount.", - "undocumented": false, - "html": "The minimum unit amount the customer can specify for this item. Must be at least the minimum charge amount." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "minimum" - }, - "preset": { - "name": "preset", - "check": "nonnegative_integer", - "validation": "positive integer or zero", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "The starting unit amount which can be updated by the customer.", - "undocumented": false, - "html": "The starting unit amount which can be updated by the customer." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "preset" - } - }, - "object_type": "custom_unit_amount", - "less_common": true - }, - "livemode": { - "name": "livemode", - "check": "boolean", - "validation": "boolean", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode.", - "undocumented": false, - "html": "Has the value \u003Ccode\u003Etrue\u003C/code\u003E if the object exists in live mode or the value \u003Ccode\u003Efalse\u003C/code\u003E if the object exists in test mode." - }, - "gate": false, - "hide_unset_desc": null, - "required": true, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "livemode", - "less_common": true - }, - "lookup_key": { - "name": "lookup_key", - "check": "string", - "validation": "string", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "A lookup key used to retrieve prices dynamically from a static string. This may be up to 200 characters.", - "undocumented": false, - "html": "A lookup key used to retrieve prices dynamically from a static string. This may be up to 200 characters." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "lookup_key", - "less_common": true - }, - "metadata": { - "name": "metadata", - "check": "hash", - "validation": "hash", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Set of [key-value pairs](/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format.", - "undocumented": false, - "html": "Set of \u003Ca href=\"/docs/api/metadata\"\u003Ekey-value pairs\u003C/a\u003E that you can attach to an object. This can be useful for storing additional information about the object in a structured format." - }, - "gate": false, - "hide_unset_desc": null, - "required": true, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "metadata" - }, - "nickname": { - "name": "nickname", - "check": "string", - "validation": "string", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "A brief description of the price, hidden from customers.", - "undocumented": false, - "html": "A brief description of the price, hidden from customers." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "nickname" - }, - "product": { - "name": "product", - "check": "string", - "validation": "string", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "The ID of the product this price is associated with.", - "undocumented": false, - "html": "The ID of the product this price is associated with." - }, - "gate": false, - "hide_unset_desc": null, - "required": true, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "user_expandable": ["product"], - "object_type": "product" - }, - "recurring": { - "name": "recurring", - "check": "hash", - "validation": "hash", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "The recurring components of a price such as `interval` and `usage_type`.", - "undocumented": false, - "html": "The recurring components of a price such as \u003Ccode\u003Einterval\u003C/code\u003E and \u003Ccode\u003Eusage_type\u003C/code\u003E." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "subspec": { - "aggregate_usage": { - "name": "aggregate_usage", - "check": "string", - "validation": "string", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Specifies a usage aggregation strategy for prices of `usage_type=metered`. Allowed values are `sum` for summing up all usage during a period, `last_during_period` for using the last usage record reported within a period, `last_ever` for using the last usage record ever (across period bounds) or `max` which uses the usage record with the maximum reported usage during a period. Defaults to `sum`.", - "undocumented": false, - "html": "Specifies a usage aggregation strategy for prices of \u003Ccode\u003Eusage_type=metered\u003C/code\u003E. Allowed values are \u003Ccode\u003Esum\u003C/code\u003E for summing up all usage during a period, \u003Ccode\u003Elast_during_period\u003C/code\u003E for using the last usage record reported within a period, \u003Ccode\u003Elast_ever\u003C/code\u003E for using the last usage record ever (across period bounds) or \u003Ccode\u003Emax\u003C/code\u003E which uses the usage record with the maximum reported usage during a period. Defaults to \u003Ccode\u003Esum\u003C/code\u003E." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "aggregate_usage", - "less_common": true - }, - "interval": { - "name": "interval", - "check": "string", - "validation": "string", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "The frequency at which a subscription is billed. One of `day`, `week`, `month` or `year`.", - "undocumented": false, - "html": "The frequency at which a subscription is billed. One of \u003Ccode\u003Eday\u003C/code\u003E, \u003Ccode\u003Eweek\u003C/code\u003E, \u003Ccode\u003Emonth\u003C/code\u003E or \u003Ccode\u003Eyear\u003C/code\u003E." - }, - "gate": false, - "hide_unset_desc": null, - "required": true, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "enum_values": { - "month": { "documentation": null }, - "year": { "documentation": null }, - "week": { "documentation": null }, - "day": { "documentation": null } - }, - "object_type": "interval" - }, - "interval_count": { - "name": "interval_count", - "check": "positive_integer", - "validation": "positive integer", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "The number of intervals (specified in the `interval` attribute) between subscription billings. For example, `interval=month` and `interval_count=3` bills every 3 months.", - "undocumented": false, - "html": "The number of intervals (specified in the \u003Ccode\u003Einterval\u003C/code\u003E attribute) between subscription billings. For example, \u003Ccode\u003Einterval=month\u003C/code\u003E and \u003Ccode\u003Einterval_count=3\u003C/code\u003E bills every 3 months." - }, - "gate": false, - "hide_unset_desc": null, - "required": true, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "interval_count", - "less_common": true - }, - "usage_type": { - "name": "usage_type", - "check": "string", - "validation": "string", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Configures how the quantity per period should be determined. Can be either `metered` or `licensed`. `licensed` automatically bills the `quantity` set when adding it to a subscription. `metered` aggregates the total usage based on usage records. Defaults to `licensed`.", - "undocumented": false, - "html": "Configures how the quantity per period should be determined. Can be either \u003Ccode\u003Emetered\u003C/code\u003E or \u003Ccode\u003Elicensed\u003C/code\u003E. \u003Ccode\u003Elicensed\u003C/code\u003E automatically bills the \u003Ccode\u003Equantity\u003C/code\u003E set when adding it to a subscription. \u003Ccode\u003Emetered\u003C/code\u003E aggregates the total usage based on usage records. Defaults to \u003Ccode\u003Elicensed\u003C/code\u003E." - }, - "gate": false, - "hide_unset_desc": null, - "required": true, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "enum_values": { - "metered": { "documentation": null }, - "licensed": { "documentation": null } - }, - "object_type": "usage_type", - "less_common": true - } - }, - "object_type": "recurring" - }, - "tax_behavior": { - "name": "tax_behavior", - "check": "string", - "validation": "string", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Specifies whether the price is considered inclusive of taxes or exclusive of taxes. One of `inclusive`, `exclusive`, or `unspecified`. Once specified as either `inclusive` or `exclusive`, it cannot be changed.", - "undocumented": false, - "html": "Specifies whether the price is considered inclusive of taxes or exclusive of taxes. One of \u003Ccode\u003Einclusive\u003C/code\u003E, \u003Ccode\u003Eexclusive\u003C/code\u003E, or \u003Ccode\u003Eunspecified\u003C/code\u003E. Once specified as either \u003Ccode\u003Einclusive\u003C/code\u003E or \u003Ccode\u003Eexclusive\u003C/code\u003E, it cannot be changed." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "tax_behavior", - "less_common": true - }, - "tiers": { - "name": "tiers", - "check": "array", - "validation": "array", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Each element represents a pricing tier. This parameter requires `billing_scheme` to be set to `tiered`. See also the documentation for `billing_scheme`.", - "undocumented": false, - "html": "Each element represents a pricing tier. This parameter requires \u003Ccode\u003Ebilling_scheme\u003C/code\u003E to be set to \u003Ccode\u003Etiered\u003C/code\u003E. See also the documentation for \u003Ccode\u003Ebilling_scheme\u003C/code\u003E." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": true, - "subspec": { - "flat_amount": { - "name": "flat_amount", - "check": "integer", - "validation": "integer", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Price for the entire tier.", - "undocumented": false, - "html": "Price for the entire tier." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "flat_amount" - }, - "flat_amount_decimal": { - "name": "flat_amount_decimal", - "check": "decimal_string", - "validation": "decimal string", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Same as `flat_amount`, but contains a decimal value with at most 12 decimal places.", - "undocumented": false, - "html": "Same as \u003Ccode\u003Eflat_amount\u003C/code\u003E, but contains a decimal value with at most 12 decimal places." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "flat_amount_decimal" - }, - "unit_amount": { - "name": "unit_amount", - "check": "integer", - "validation": "integer", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Per unit price for units relevant to the tier.", - "undocumented": false, - "html": "Per unit price for units relevant to the tier." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "unit_amount" - }, - "unit_amount_decimal": { - "name": "unit_amount_decimal", - "check": "decimal_string", - "validation": "decimal string", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Same as `unit_amount`, but contains a decimal value with at most 12 decimal places.", - "undocumented": false, - "html": "Same as \u003Ccode\u003Eunit_amount\u003C/code\u003E, but contains a decimal value with at most 12 decimal places." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "unit_amount_decimal" - }, - "up_to": { - "name": "up_to", - "check": "integer", - "validation": "integer", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Up to and including to this quantity will be contained in the tier.", - "undocumented": false, - "html": "Up to and including to this quantity will be contained in the tier." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "up_to" - } - }, - "object_type": "tiers", - "less_common": true - }, - "tiers_mode": { - "name": "tiers_mode", - "check": "string", - "validation": "string", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Defines if the tiering price should be `graduated` or `volume` based. In `volume`-based tiering, the maximum quantity within a period determines the per unit price. In `graduated` tiering, pricing can change as the quantity grows.", - "undocumented": false, - "html": "Defines if the tiering price should be \u003Ccode\u003Egraduated\u003C/code\u003E or \u003Ccode\u003Evolume\u003C/code\u003E based. In \u003Ccode\u003Evolume\u003C/code\u003E-based tiering, the maximum quantity within a period determines the per unit price. In \u003Ccode\u003Egraduated\u003C/code\u003E tiering, pricing can change as the quantity grows." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "tiers_mode", - "less_common": true - }, - "transform_quantity": { - "name": "transform_quantity", - "check": "hash", - "validation": "hash", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Apply a transformation to the reported usage or set quantity before computing the amount billed. Cannot be combined with `tiers`.", - "undocumented": false, - "html": "Apply a transformation to the reported usage or set quantity before computing the amount billed. Cannot be combined with \u003Ccode\u003Etiers\u003C/code\u003E." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "subspec": { - "divide_by": { - "name": "divide_by", - "check": "integer", - "validation": "integer", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Divide usage by this number.", - "undocumented": false, - "html": "Divide usage by this number." - }, - "gate": false, - "hide_unset_desc": null, - "required": true, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "divide_by" - }, - "round": { - "name": "round", - "check": "string", - "validation": "string", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "After division, either round the result `up` or `down`.", - "undocumented": false, - "html": "After division, either round the result \u003Ccode\u003Eup\u003C/code\u003E or \u003Ccode\u003Edown\u003C/code\u003E." - }, - "gate": false, - "hide_unset_desc": null, - "required": true, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "enum_values": { - "up": { "documentation": null }, - "down": { "documentation": null } - }, - "object_type": "round" - } - }, - "object_type": "transform_quantity", - "less_common": true - }, - "type": { - "name": "type", - "check": "string", - "validation": "string", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "One of `one_time` or `recurring` depending on whether the price is for a one-time purchase or a recurring (subscription) purchase.", - "undocumented": false, - "html": "One of \u003Ccode\u003Eone_time\u003C/code\u003E or \u003Ccode\u003Erecurring\u003C/code\u003E depending on whether the price is for a one-time purchase or a recurring (subscription) purchase." - }, - "gate": false, - "hide_unset_desc": null, - "required": true, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "type" - }, - "unit_amount": { - "name": "unit_amount", - "check": "integer", - "validation": "integer", - "documentation": { - "gate_specific": {}, - "localize_terms": ["currency_sub_unit"], - "markdown": "The unit amount in sen to be charged, represented as a whole integer if possible. Only set if `billing_scheme=per_unit`.", - "undocumented": false, - "html": "The unit amount in sen to be charged, represented as a whole integer if possible. Only set if \u003Ccode\u003Ebilling_scheme=per_unit\u003C/code\u003E." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "unit_amount" - }, - "unit_amount_decimal": { - "name": "unit_amount_decimal", - "check": "decimal_string", - "validation": "decimal string", - "documentation": { - "gate_specific": {}, - "localize_terms": ["currency_sub_unit"], - "markdown": "The unit amount in sen to be charged, represented as a decimal string with at most 12 decimal places. Only set if `billing_scheme=per_unit`.", - "undocumented": false, - "html": "The unit amount in sen to be charged, represented as a decimal string with at most 12 decimal places. Only set if \u003Ccode\u003Ebilling_scheme=per_unit\u003C/code\u003E." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "unit_amount_decimal", - "less_common": true - } - }, - "object_type": "price" - }, - "quantity": { - "name": "quantity", - "check": "nonnegative_integer", - "validation": "positive integer or zero", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "The quantity of products being purchased.", - "undocumented": false, - "html": "The quantity of products being purchased." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "quantity" - }, - "taxes": { - "name": "taxes", - "check": "array", - "validation": "array", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "The taxes applied to the line item.", - "undocumented": false, - "html": "The taxes applied to the line item." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": true, - "subspec": { - "amount": { - "name": "amount", - "check": "integer", - "validation": "integer", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Amount of tax applied for this rate.", - "undocumented": false, - "html": "Amount of tax applied for this rate." - }, - "gate": false, - "hide_unset_desc": null, - "required": true, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "amount" - }, - "rate": { - "name": "rate", - "check": "hash", - "validation": "hash", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "The tax rate applied.", - "undocumented": false, - "html": "The tax rate applied." - }, - "gate": false, - "hide_unset_desc": null, - "required": true, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "subspec": { - "id": { - "name": "id", - "check": "string", - "validation": "string", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Unique identifier for the object.", - "undocumented": false, - "html": "Unique identifier for the object." - }, - "gate": false, - "hide_unset_desc": null, - "required": true, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "id" - }, - "object": { - "name": "object", - "check": "string", - "validation": "string", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "String representing the object's type. Objects of the same type share the same value.", - "undocumented": false, - "html": "String representing the object’s type. Objects of the same type share the same value." - }, - "gate": false, - "hide_unset_desc": null, - "required": true, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "object", - "less_common": true - }, - "active": { - "name": "active", - "check": "boolean", - "validation": "boolean", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Defaults to `true`. When set to `false`, this tax rate cannot be used with new applications or Checkout Sessions, but will still work for subscriptions and invoices that already have it set.", - "undocumented": false, - "html": "Defaults to \u003Ccode\u003Etrue\u003C/code\u003E. When set to \u003Ccode\u003Efalse\u003C/code\u003E, this tax rate cannot be used with new applications or Checkout Sessions, but will still work for subscriptions and invoices that already have it set." - }, - "gate": false, - "hide_unset_desc": null, - "required": true, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "active" - }, - "country": { - "name": "country", - "check": "string", - "validation": "string", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)).", - "undocumented": false, - "html": "Two-letter country code (\u003Ca href=\"https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2\"\u003EISO 3166-1 alpha-2\u003C/a\u003E)." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "country" - }, - "created": { - "name": "created", - "check": "timestamp", - "validation": "timestamp", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Time at which the object was created. Measured in seconds since the Unix epoch.", - "undocumented": false, - "html": "Time at which the object was created. Measured in seconds since the Unix epoch." - }, - "gate": false, - "hide_unset_desc": null, - "required": true, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "created", - "less_common": true - }, - "description": { - "name": "description", - "check": "string", - "validation": "string", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "An arbitrary string attached to the tax rate for your internal use only. It will not be visible to your customers.", - "undocumented": false, - "html": "An arbitrary string attached to the tax rate for your internal use only. It will not be visible to your customers." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "description" - }, - "display_name": { - "name": "display_name", - "check": "string", - "validation": "string", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "The display name of the tax rates as it will appear to your customer on their receipt email, PDF, and the hosted invoice page.", - "undocumented": false, - "html": "The display name of the tax rates as it will appear to your customer on their receipt email, PDF, and the hosted invoice page." - }, - "gate": false, - "hide_unset_desc": null, - "required": true, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "display_name" - }, - "inclusive": { - "name": "inclusive", - "check": "boolean", - "validation": "boolean", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "This specifies if the tax rate is inclusive or exclusive.", - "undocumented": false, - "html": "This specifies if the tax rate is inclusive or exclusive." - }, - "gate": false, - "hide_unset_desc": null, - "required": true, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "inclusive" - }, - "jurisdiction": { - "name": "jurisdiction", - "check": "string", - "validation": "string", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "The jurisdiction for the tax rate. You can use this label field for tax reporting purposes. It also appears on your customer’s invoice.", - "undocumented": false, - "html": "The jurisdiction for the tax rate. You can use this label field for tax reporting purposes. It also appears on your customer’s invoice." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "jurisdiction" - }, - "livemode": { - "name": "livemode", - "check": "boolean", - "validation": "boolean", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode.", - "undocumented": false, - "html": "Has the value \u003Ccode\u003Etrue\u003C/code\u003E if the object exists in live mode or the value \u003Ccode\u003Efalse\u003C/code\u003E if the object exists in test mode." - }, - "gate": false, - "hide_unset_desc": null, - "required": true, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "livemode", - "less_common": true - }, - "metadata": { - "name": "metadata", - "check": "hash", - "validation": "hash", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Set of [key-value pairs](/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format.", - "undocumented": false, - "html": "Set of \u003Ca href=\"/docs/api/metadata\"\u003Ekey-value pairs\u003C/a\u003E that you can attach to an object. This can be useful for storing additional information about the object in a structured format." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "metadata" - }, - "percentage": { - "name": "percentage", - "check": "decimal", - "validation": "decimal", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "This represents the tax rate percent out of 100.", - "undocumented": false, - "html": "This represents the tax rate percent out of 100." - }, - "gate": false, - "hide_unset_desc": null, - "required": true, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "percentage" - }, - "state": { - "name": "state", - "check": "string", - "validation": "string", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "[ISO 3166-2 subdivision code](https://en.wikipedia.org/wiki/ISO_3166-2:US), without country prefix. For example, \"NY\" for New York, United States.", - "undocumented": false, - "html": "\u003Ca href=\"https://en.wikipedia.org/wiki/ISO_3166-2:US\"\u003EISO 3166-2 subdivision code\u003C/a\u003E, without country prefix. For example, “NY” for New York, United States." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "state" - }, - "tax_type": { - "name": "tax_type", - "check": "string", - "validation": "string", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "The high-level tax type, such as `vat` or `sales_tax`.", - "undocumented": false, - "html": "The high-level tax type, such as \u003Ccode\u003Evat\u003C/code\u003E or \u003Ccode\u003Esales_tax\u003C/code\u003E." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "tax_type", - "less_common": true - } - }, - "object_type": "tax_rate" - } - }, - "object_type": "taxes" - } - }, - "object_type": "item" - }, - "has_more": { - "name": "has_more", - "check": "boolean", - "validation": "boolean", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "True if this list has another page of items after this one that can be fetched.", - "undocumented": false, - "html": "True if this list has another page of items after this one that can be fetched." - }, - "gate": false, - "hide_unset_desc": null, - "required": true, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "has_more" - }, - "url": { - "name": "url", - "check": "string", - "validation": "string", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "The URL where this list can be accessed.", - "undocumented": false, - "html": "The URL where this list can be accessed." - }, - "gate": false, - "hide_unset_desc": null, - "required": true, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "url" - } - }, - "object_type": "list" - }, - "livemode": { - "name": "livemode", - "check": "boolean", - "validation": "boolean", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode.", - "undocumented": false, - "html": "Has the value \u003Ccode\u003Etrue\u003C/code\u003E if the object exists in live mode or the value \u003Ccode\u003Efalse\u003C/code\u003E if the object exists in test mode." - }, - "gate": false, - "hide_unset_desc": null, - "required": true, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "livemode", - "less_common": true - }, - "metadata": { - "name": "metadata", - "check": "hash", - "validation": "hash", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Set of [key-value pairs](/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format.", - "undocumented": false, - "html": "Set of \u003Ca href=\"/docs/api/metadata\"\u003Ekey-value pairs\u003C/a\u003E that you can attach to an object. This can be useful for storing additional information about the object in a structured format." - }, - "gate": false, - "hide_unset_desc": null, - "required": true, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "metadata" - }, - "on_behalf_of": { - "name": "on_behalf_of", - "check": "string", - "validation": "string", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "The account on behalf of which to charge. See the [Connect documentation](https://support.stripe.com/questions/sending-invoices-on-behalf-of-connected-accounts) for details.", - "undocumented": false, - "html": "The account on behalf of which to charge. See the \u003Ca href=\"https://support.stripe.com/questions/sending-invoices-on-behalf-of-connected-accounts\"\u003EConnect documentation\u003C/a\u003E for details." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": "Connect only", - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "user_expandable": ["account"], - "object_type": "on_behalf_of", - "less_common": true - }, - "payment_intent_data": { - "name": "payment_intent_data", - "check": "hash", - "validation": "hash", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Indicates the parameters to be passed to PaymentIntent creation during checkout.", - "undocumented": false, - "html": "Indicates the parameters to be passed to PaymentIntent creation during checkout." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "subspec": { - "capture_method": { - "name": "capture_method", - "check": "string", - "validation": "string", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Indicates when the funds will be captured from the customer's account.", - "undocumented": false, - "html": "Indicates when the funds will be captured from the customer’s account." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "enum_values": { - "automatic": { - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "(Default) Stripe automatically captures funds when the customer authorizes the payment.", - "undocumented": false, - "html": "(Default) Stripe automatically captures funds when the customer authorizes the payment." - } - }, - "manual": { - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Place a hold on the funds when the customer authorizes the payment, but [don't capture the funds until later](/docs/payments/capture-later). (Not all payment methods support this.)", - "undocumented": false, - "html": "Place a hold on the funds when the customer authorizes the payment, but \u003Ca href=\"/docs/payments/capture-later\"\u003Edon’t capture the funds until later\u003C/a\u003E. (Not all payment methods support this.)" - } - } - }, - "object_type": "capture_method" - }, - "setup_future_usage": { - "name": "setup_future_usage", - "check": "string", - "validation": "string", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Indicates that you intend to make future payments with the payment method collected during checkout.", - "undocumented": false, - "html": "Indicates that you intend to make future payments with the payment method collected during checkout." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "enum_values": { - "on_session": { - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Use `on_session` if you intend to only reuse the payment method when your customer is present in your checkout flow.", - "undocumented": false, - "html": "Use \u003Ccode\u003Eon_session\u003C/code\u003E if you intend to only reuse the payment method when your customer is present in your checkout flow." - } - }, - "off_session": { - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Use `off_session` if your customer may or may not be present in your checkout flow.", - "undocumented": false, - "html": "Use \u003Ccode\u003Eoff_session\u003C/code\u003E if your customer may or may not be present in your checkout flow." - } - } - }, - "object_type": "setup_future_usage" - } - }, - "object_type": "payment_intent_data", - "less_common": true - }, - "payment_method_collection": { - "name": "payment_method_collection", - "check": "string", - "validation": "string", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Configuration for collecting a payment method during checkout.", - "undocumented": false, - "html": "Configuration for collecting a payment method during checkout." - }, - "gate": false, - "hide_unset_desc": null, - "required": true, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "enum_values": { - "always": { - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "The Checkout Session will always collect a PaymentMethod.\n", - "undocumented": false, - "html": "The Checkout Session will always collect a PaymentMethod." - } - }, - "if_required": { - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "The Checkout Session will only collect a PaymentMethod if there is an amount due.\n", - "undocumented": false, - "html": "The Checkout Session will only collect a PaymentMethod if there is an amount due." - } - } - }, - "object_type": "payment_method_collection", - "less_common": true - }, - "payment_method_types": { - "name": "payment_method_types", - "check": "array", - "validation": "array", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "The list of payment method types that customers can use. When `null`, Stripe will dynamically show relevant payment methods you've enabled in your [payment method settings](https://dashboard.stripe.com/settings/payment_methods).", - "undocumented": false, - "html": "The list of payment method types that customers can use. When \u003Ccode\u003Enull\u003C/code\u003E, Stripe will dynamically show relevant payment methods you’ve enabled in your \u003Ca href=\"https://dashboard.stripe.com/settings/payment_methods\"\u003Epayment method settings\u003C/a\u003E." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "enum_values": { - "card": { "documentation": null }, - "affirm": { "documentation": null }, - "promptpay": { "documentation": null }, - "bacs_debit": { "documentation": null }, - "bancontact": { "documentation": null }, - "blik": { "documentation": null }, - "boleto": { "documentation": null }, - "eps": { "documentation": null }, - "fpx": { "documentation": null }, - "giropay": { "documentation": null }, - "grabpay": { "documentation": null }, - "ideal": { "documentation": null }, - "klarna": { "documentation": null }, - "konbini": { "documentation": null }, - "oxxo": { "documentation": null }, - "p24": { "documentation": null }, - "paynow": { "documentation": null }, - "pix": { "documentation": null }, - "afterpay_clearpay": { "documentation": null }, - "alipay": { "documentation": null }, - "au_becs_debit": { "documentation": null }, - "sepa_debit": { "documentation": null }, - "sofort": { "documentation": null }, - "us_bank_account": { "documentation": null }, - "wechat_pay": { "documentation": null } - }, - "object_type": "payment_method_types" - }, - "phone_number_collection": { - "name": "phone_number_collection", - "check": "hash", - "validation": "hash", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Controls phone number collection settings during checkout.", - "undocumented": false, - "html": "Controls phone number collection settings during checkout." - }, - "gate": false, - "hide_unset_desc": null, - "required": true, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "subspec": { - "enabled": { - "name": "enabled", - "check": "boolean", - "validation": "boolean", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "If `true`, a phone number will be collected during checkout.", - "undocumented": false, - "html": "If \u003Ccode\u003Etrue\u003C/code\u003E, a phone number will be collected during checkout." - }, - "gate": false, - "hide_unset_desc": null, - "required": true, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "enabled" - } - }, - "object_type": "phone_number_collection", - "less_common": true - }, - "shipping_address_collection": { - "name": "shipping_address_collection", - "check": "hash", - "validation": "hash", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Configuration for collecting the customer's shipping address.", - "undocumented": false, - "html": "Configuration for collecting the customer’s shipping address." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "subspec": { - "allowed_countries": { - "name": "allowed_countries", - "check": "array", - "validation": "array", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "An array of two-letter ISO country codes representing which countries Checkout should provide as options for shipping locations. Unsupported country codes: `AS, CX, CC, CU, HM, IR, KP, MH, FM, NF, MP, PW, SD, SY, UM, VI`.\n", - "undocumented": false, - "html": "An array of two-letter ISO country codes representing which countries Checkout should provide as options for shipping locations. Unsupported country codes: \u003Ccode\u003EAS, CX, CC, CU, HM, IR, KP, MH, FM, NF, MP, PW, SD, SY, UM, VI\u003C/code\u003E." - }, - "gate": false, - "hide_unset_desc": null, - "required": true, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "enum_values": { - "AC": { "documentation": null }, - "AD": { "documentation": null }, - "AE": { "documentation": null }, - "AF": { "documentation": null }, - "AG": { "documentation": null }, - "AI": { "documentation": null }, - "AL": { "documentation": null }, - "AM": { "documentation": null }, - "AO": { "documentation": null }, - "AQ": { "documentation": null }, - "AR": { "documentation": null }, - "AT": { "documentation": null }, - "AU": { "documentation": null }, - "AW": { "documentation": null }, - "AX": { "documentation": null }, - "AZ": { "documentation": null }, - "BA": { "documentation": null }, - "BB": { "documentation": null }, - "BD": { "documentation": null }, - "BE": { "documentation": null }, - "BF": { "documentation": null }, - "BG": { "documentation": null }, - "BH": { "documentation": null }, - "BI": { "documentation": null }, - "BJ": { "documentation": null }, - "BL": { "documentation": null }, - "BM": { "documentation": null }, - "BN": { "documentation": null }, - "BO": { "documentation": null }, - "BQ": { "documentation": null }, - "BR": { "documentation": null }, - "BS": { "documentation": null }, - "BT": { "documentation": null }, - "BV": { "documentation": null }, - "BW": { "documentation": null }, - "BY": { "documentation": null }, - "BZ": { "documentation": null }, - "CA": { "documentation": null }, - "CD": { "documentation": null }, - "CF": { "documentation": null }, - "CG": { "documentation": null }, - "CH": { "documentation": null }, - "CI": { "documentation": null }, - "CK": { "documentation": null }, - "CL": { "documentation": null }, - "CM": { "documentation": null }, - "CN": { "documentation": null }, - "CO": { "documentation": null }, - "CR": { "documentation": null }, - "CV": { "documentation": null }, - "CW": { "documentation": null }, - "CY": { "documentation": null }, - "CZ": { "documentation": null }, - "DE": { "documentation": null }, - "DJ": { "documentation": null }, - "DK": { "documentation": null }, - "DM": { "documentation": null }, - "DO": { "documentation": null }, - "DZ": { "documentation": null }, - "EC": { "documentation": null }, - "EE": { "documentation": null }, - "EG": { "documentation": null }, - "EH": { "documentation": null }, - "ER": { "documentation": null }, - "ES": { "documentation": null }, - "ET": { "documentation": null }, - "FI": { "documentation": null }, - "FJ": { "documentation": null }, - "FK": { "documentation": null }, - "FO": { "documentation": null }, - "FR": { "documentation": null }, - "GA": { "documentation": null }, - "GB": { "documentation": null }, - "GD": { "documentation": null }, - "GE": { "documentation": null }, - "GF": { "documentation": null }, - "GG": { "documentation": null }, - "GH": { "documentation": null }, - "GI": { "documentation": null }, - "GL": { "documentation": null }, - "GM": { "documentation": null }, - "GN": { "documentation": null }, - "GP": { "documentation": null }, - "GQ": { "documentation": null }, - "GR": { "documentation": null }, - "GS": { "documentation": null }, - "GT": { "documentation": null }, - "GU": { "documentation": null }, - "GW": { "documentation": null }, - "GY": { "documentation": null }, - "HK": { "documentation": null }, - "HN": { "documentation": null }, - "HR": { "documentation": null }, - "HT": { "documentation": null }, - "HU": { "documentation": null }, - "ID": { "documentation": null }, - "IE": { "documentation": null }, - "IL": { "documentation": null }, - "IM": { "documentation": null }, - "IN": { "documentation": null }, - "IO": { "documentation": null }, - "IQ": { "documentation": null }, - "IS": { "documentation": null }, - "IT": { "documentation": null }, - "JE": { "documentation": null }, - "JM": { "documentation": null }, - "JO": { "documentation": null }, - "JP": { "documentation": null }, - "KE": { "documentation": null }, - "KG": { "documentation": null }, - "KH": { "documentation": null }, - "KI": { "documentation": null }, - "KM": { "documentation": null }, - "KN": { "documentation": null }, - "KR": { "documentation": null }, - "KW": { "documentation": null }, - "KY": { "documentation": null }, - "KZ": { "documentation": null }, - "LA": { "documentation": null }, - "LB": { "documentation": null }, - "LC": { "documentation": null }, - "LI": { "documentation": null }, - "LK": { "documentation": null }, - "LR": { "documentation": null }, - "LS": { "documentation": null }, - "LT": { "documentation": null }, - "LU": { "documentation": null }, - "LV": { "documentation": null }, - "LY": { "documentation": null }, - "MA": { "documentation": null }, - "MC": { "documentation": null }, - "MD": { "documentation": null }, - "ME": { "documentation": null }, - "MF": { "documentation": null }, - "MG": { "documentation": null }, - "MK": { "documentation": null }, - "ML": { "documentation": null }, - "MM": { "documentation": null }, - "MN": { "documentation": null }, - "MO": { "documentation": null }, - "MQ": { "documentation": null }, - "MR": { "documentation": null }, - "MS": { "documentation": null }, - "MT": { "documentation": null }, - "MU": { "documentation": null }, - "MV": { "documentation": null }, - "MW": { "documentation": null }, - "MX": { "documentation": null }, - "MY": { "documentation": null }, - "MZ": { "documentation": null }, - "NA": { "documentation": null }, - "NC": { "documentation": null }, - "NE": { "documentation": null }, - "NG": { "documentation": null }, - "NI": { "documentation": null }, - "NL": { "documentation": null }, - "NO": { "documentation": null }, - "NP": { "documentation": null }, - "NR": { "documentation": null }, - "NU": { "documentation": null }, - "NZ": { "documentation": null }, - "OM": { "documentation": null }, - "PA": { "documentation": null }, - "PE": { "documentation": null }, - "PF": { "documentation": null }, - "PG": { "documentation": null }, - "PH": { "documentation": null }, - "PK": { "documentation": null }, - "PL": { "documentation": null }, - "PM": { "documentation": null }, - "PN": { "documentation": null }, - "PR": { "documentation": null }, - "PS": { "documentation": null }, - "PT": { "documentation": null }, - "PY": { "documentation": null }, - "QA": { "documentation": null }, - "RE": { "documentation": null }, - "RO": { "documentation": null }, - "RS": { "documentation": null }, - "RU": { "documentation": null }, - "RW": { "documentation": null }, - "SA": { "documentation": null }, - "SB": { "documentation": null }, - "SC": { "documentation": null }, - "SE": { "documentation": null }, - "SG": { "documentation": null }, - "SH": { "documentation": null }, - "SI": { "documentation": null }, - "SJ": { "documentation": null }, - "SK": { "documentation": null }, - "SL": { "documentation": null }, - "SM": { "documentation": null }, - "SN": { "documentation": null }, - "SO": { "documentation": null }, - "SR": { "documentation": null }, - "SS": { "documentation": null }, - "ST": { "documentation": null }, - "SV": { "documentation": null }, - "SX": { "documentation": null }, - "SZ": { "documentation": null }, - "TA": { "documentation": null }, - "TC": { "documentation": null }, - "TD": { "documentation": null }, - "TF": { "documentation": null }, - "TG": { "documentation": null }, - "TH": { "documentation": null }, - "TJ": { "documentation": null }, - "TK": { "documentation": null }, - "TL": { "documentation": null }, - "TM": { "documentation": null }, - "TN": { "documentation": null }, - "TO": { "documentation": null }, - "TR": { "documentation": null }, - "TT": { "documentation": null }, - "TV": { "documentation": null }, - "TW": { "documentation": null }, - "TZ": { "documentation": null }, - "UA": { "documentation": null }, - "UG": { "documentation": null }, - "US": { "documentation": null }, - "UY": { "documentation": null }, - "UZ": { "documentation": null }, - "VA": { "documentation": null }, - "VC": { "documentation": null }, - "VE": { "documentation": null }, - "VG": { "documentation": null }, - "VN": { "documentation": null }, - "VU": { "documentation": null }, - "WF": { "documentation": null }, - "WS": { "documentation": null }, - "XK": { "documentation": null }, - "YE": { "documentation": null }, - "YT": { "documentation": null }, - "ZA": { "documentation": null }, - "ZM": { "documentation": null }, - "ZW": { "documentation": null }, - "ZZ": { "documentation": null } - }, - "object_type": "allowed_countries" - } - }, - "object_type": "shipping_address_collection", - "less_common": true - }, - "shipping_options": { - "name": "shipping_options", - "check": "array", - "validation": "array", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "The shipping rate options applied to the session.", - "undocumented": false, - "html": "The shipping rate options applied to the session." - }, - "gate": false, - "hide_unset_desc": null, - "required": true, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "subspec": { - "shipping_amount": { - "name": "shipping_amount", - "check": "integer", - "validation": "integer", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "A non-negative integer in cents representing how much to charge.", - "undocumented": false, - "html": "A non-negative integer in cents representing how much to charge." - }, - "gate": false, - "hide_unset_desc": null, - "required": true, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "shipping_amount" - }, - "shipping_rate": { - "name": "shipping_rate", - "check": "string", - "validation": "string", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "The ID of the Shipping Rate to use for this shipping option.", - "undocumented": false, - "html": "The ID of the Shipping Rate to use for this shipping option." - }, - "gate": false, - "hide_unset_desc": null, - "required": true, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "user_expandable": ["shipping_rate"], - "object_type": "shipping_rate" - } - }, - "object_type": "shipping_options", - "less_common": true - }, - "submit_type": { - "name": "submit_type", - "check": "string", - "validation": "string", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Indicates the type of transaction being performed which customizes relevant text on the page, such as the submit button.", - "undocumented": false, - "html": "Indicates the type of transaction being performed which customizes relevant text on the page, such as the submit button." - }, - "gate": false, - "hide_unset_desc": null, - "required": true, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "enum_values": { - "auto": { "documentation": null }, - "pay": { "documentation": null }, - "book": { "documentation": null }, - "donate": { "documentation": null } - }, - "object_type": "submit_type", - "less_common": true - }, - "subscription_data": { - "name": "subscription_data", - "check": "hash", - "validation": "hash", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "When creating a subscription, the specified configuration data will be used. There must be at least one line item with a recurring price to use `subscription_data`.", - "undocumented": false, - "html": "When creating a subscription, the specified configuration data will be used. There must be at least one line item with a recurring price to use \u003Ccode\u003Esubscription_data\u003C/code\u003E." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "subspec": { - "description": { - "name": "description", - "check": "string", - "validation": "string", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "The subscription's description, meant to be displayable to the customer. Use this field to optionally store an explanation of the subscription.", - "undocumented": false, - "html": "The subscription’s description, meant to be displayable to the customer. Use this field to optionally store an explanation of the subscription." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "description" - }, - "trial_period_days": { - "name": "trial_period_days", - "check": "integer", - "validation": "integer", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Integer representing the number of trial period days before the customer is charged for the first time.", - "undocumented": false, - "html": "Integer representing the number of trial period days before the customer is charged for the first time." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "trial_period_days" - } - }, - "object_type": "subscription_data", - "less_common": true - }, - "tax_id_collection": { - "name": "tax_id_collection", - "check": "hash", - "validation": "hash", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Details on the state of tax ID collection for the payment link.", - "undocumented": false, - "html": "Details on the state of tax ID collection for the payment link." - }, - "gate": false, - "hide_unset_desc": null, - "required": true, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "subspec": { - "enabled": { - "name": "enabled", - "check": "boolean", - "validation": "boolean", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Indicates whether tax ID collection is enabled for the session.", - "undocumented": false, - "html": "Indicates whether tax ID collection is enabled for the session." - }, - "gate": false, - "hide_unset_desc": null, - "required": true, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "enabled" - } - }, - "object_type": "tax_id_collection", - "less_common": true - }, - "transfer_data": { - "name": "transfer_data", - "check": "hash", - "validation": "hash", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "The account (if any) the payments will be attributed to for tax reporting, and where funds from each payment will be transferred to.", - "undocumented": false, - "html": "The account (if any) the payments will be attributed to for tax reporting, and where funds from each payment will be transferred to." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": "Connect only", - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "subspec": { - "amount": { - "name": "amount", - "check": "integer", - "validation": "integer", - "documentation": { - "gate_specific": {}, - "localize_terms": ["currency_sub_unit"], - "markdown": "The amount in sen that will be transferred to the destination account. By default, the entire amount is transferred to the destination.", - "undocumented": false, - "html": "The amount in sen that will be transferred to the destination account. By default, the entire amount is transferred to the destination." - }, - "gate": false, - "hide_unset_desc": null, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "amount" - }, - "destination": { - "name": "destination", - "check": "string", - "validation": "string", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "The connected account receiving the transfer.", - "undocumented": false, - "html": "The connected account receiving the transfer." - }, - "gate": false, - "hide_unset_desc": null, - "required": true, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "user_expandable": ["account"], - "object_type": "destination" - } - }, - "object_type": "transfer_data", - "less_common": true - }, - "url": { - "name": "url", - "check": "string", - "validation": "string", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "The public URL that can be shared with customers.", - "undocumented": false, - "html": "The public URL that can be shared with customers." - }, - "gate": false, - "hide_unset_desc": null, - "required": true, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "includable": null, - "object_type": "url" - } - }, - "snippets": [ - { - "prefix": "", - "code": "{\n \"id\": \"plink_1MWb7e2eZvKYlo2CTAnxRZDR\",\n \"object\": \"payment_link\",\n \"active\": true,\n \"after_completion\": {\n \"hosted_confirmation\": {\n \"custom_message\": null\n },\n \"type\": \"hosted_confirmation\"\n },\n \"allow_promotion_codes\": false,\n \"application_fee_amount\": null,\n \"application_fee_percent\": null,\n \"automatic_tax\": {\n \"enabled\": false\n },\n \"billing_address_collection\": \"auto\",\n \"consent_collection\": null,\n \"currency\": \"usd\",\n \"custom_text\": {\n \"shipping_address\": null,\n \"submit\": null\n },\n \"customer_creation\": \"always\",\n \"livemode\": false,\n \"metadata\": {\n },\n \"on_behalf_of\": null,\n \"payment_intent_data\": null,\n \"payment_method_collection\": \"always\",\n \"payment_method_types\": null,\n \"phone_number_collection\": {\n \"enabled\": false\n },\n \"shipping_address_collection\": null,\n \"shipping_options\": [\n\n ],\n \"submit_type\": \"auto\",\n \"subscription_data\": null,\n \"tax_id_collection\": {\n \"enabled\": false\n },\n \"transfer_data\": null,\n \"url\": \"https://buy.stripe.com/test_5kAcPyarJaIPaQg4gg\"\n}" - } - ], - "top_level_changes": [], - "changes": {}, - "version": null - } - }, - "create_payment_link": { - "title": "Create a payment link", - "group_title": "Payment Links", - "group_anchor": "payment_links_section", - "anchor": "create_payment_link", - "section_anchor": "payment_links", - "subsection_anchors": null, - "path": "/payment_links/payment_links/create", - "gate": false, - "display_on_load": true, - "data": { - "section_type": "request", - "title": "Create a payment link", - "description": "Creates a payment link.", - "top_level_changes": [], - "changes": {}, - "version": null, - "returns": "Returns the payment link.", - "section_tag": "create_payment_link", - "specs": { - "line_items": { - "name": "line_items", - "check": null, - "validation": "", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "The line items representing what is being sold. Each line item represents an item being sold. Up to 20 line items are supported.", - "undocumented": false, - "html": "The line items representing what is being sold. Each line item represents an item being sold. Up to 20 line items are supported." - }, - "gate": false, - "hide_unset_desc": false, - "required": true, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "deprecated_allow_empty": false, - "array_contents_spec": { - "price": { - "name": "price", - "check": null, - "validation": "", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "The ID of the [Price](/docs/api/prices) or [Plan](/docs/api/plans) object.", - "undocumented": false, - "html": "The ID of the \u003Ca href=\"/docs/api/prices\"\u003EPrice\u003C/a\u003E or \u003Ca href=\"/docs/api/plans\"\u003EPlan\u003C/a\u003E object." - }, - "gate": false, - "hide_unset_desc": false, - "required": true, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "deprecated_allow_empty": false, - "object_type": "price" - }, - "quantity": { - "name": "quantity", - "check": null, - "validation": "", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "The quantity of the line item being purchased.", - "undocumented": false, - "html": "The quantity of the line item being purchased." - }, - "gate": false, - "hide_unset_desc": false, - "required": true, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "object_type": "quantity" - }, - "adjustable_quantity": { - "name": "adjustable_quantity", - "check": null, - "validation": "", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "When set, provides configuration for this item’s quantity to be adjusted by the customer during checkout.", - "undocumented": false, - "html": "When set, provides configuration for this item’s quantity to be adjusted by the customer during checkout." - }, - "gate": false, - "hide_unset_desc": false, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "subspec": { - "enabled": { - "name": "enabled", - "check": null, - "validation": "", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Set to true if the quantity can be adjusted to any non-negative Integer.", - "undocumented": false, - "html": "Set to true if the quantity can be adjusted to any non-negative Integer." - }, - "gate": false, - "hide_unset_desc": false, - "required": true, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "object_type": "enabled" - }, - "maximum": { - "name": "maximum", - "check": null, - "validation": "", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "The maximum quantity the customer can purchase. By default this value is 99. You can specify a value up to 999.", - "undocumented": false, - "html": "The maximum quantity the customer can purchase. By default this value is 99. You can specify a value up to 999." - }, - "gate": false, - "hide_unset_desc": false, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "object_type": "maximum" - }, - "minimum": { - "name": "minimum", - "check": null, - "validation": "", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "The minimum quantity the customer can purchase. By default this value is 0. If there is only one item in the cart then that item's quantity cannot go down to 0.", - "undocumented": false, - "html": "The minimum quantity the customer can purchase. By default this value is 0. If there is only one item in the cart then that item’s quantity cannot go down to 0." - }, - "gate": false, - "hide_unset_desc": false, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "object_type": "minimum" - } - }, - "deprecated_allow_empty": false, - "object_type": "adjustable_quantity" - } - }, - "object_type": "line_items" - }, - "after_completion": { - "name": "after_completion", - "check": null, - "validation": "", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Behavior after the purchase is complete.", - "undocumented": false, - "html": "Behavior after the purchase is complete." - }, - "gate": false, - "hide_unset_desc": false, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "subspec": { - "type": { - "name": "type", - "check": null, - "validation": "", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "The specified behavior after the purchase is complete. Either `redirect` or `hosted_confirmation`.", - "undocumented": false, - "html": "The specified behavior after the purchase is complete. Either \u003Ccode\u003Eredirect\u003C/code\u003E or \u003Ccode\u003Ehosted_confirmation\u003C/code\u003E." - }, - "gate": false, - "hide_unset_desc": false, - "required": true, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "enum_values": { - "redirect": { - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Redirects the customer to the specified `url` after the purchase is complete.", - "undocumented": false, - "html": "Redirects the customer to the specified \u003Ccode\u003Eurl\u003C/code\u003E after the purchase is complete." - } - }, - "hosted_confirmation": { - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Displays a message on the hosted surface after the purchase is complete.", - "undocumented": false, - "html": "Displays a message on the hosted surface after the purchase is complete." - } - } - }, - "object_type": "type" - }, - "hosted_confirmation": { - "name": "hosted_confirmation", - "check": null, - "validation": "", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Configuration when `type=hosted_confirmation`.", - "undocumented": false, - "html": "Configuration when \u003Ccode\u003Etype=hosted_confirmation\u003C/code\u003E." - }, - "gate": false, - "hide_unset_desc": false, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "subspec": { - "custom_message": { - "name": "custom_message", - "check": null, - "validation": "", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "A custom message to display to the customer after the purchase is complete.", - "undocumented": false, - "html": "A custom message to display to the customer after the purchase is complete." - }, - "gate": false, - "hide_unset_desc": false, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "deprecated_allow_empty": false, - "object_type": "custom_message" - } - }, - "deprecated_allow_empty": false, - "object_type": "hosted_confirmation" - }, - "redirect": { - "name": "redirect", - "check": null, - "validation": "", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Configuration when `type=redirect`.", - "undocumented": false, - "html": "Configuration when \u003Ccode\u003Etype=redirect\u003C/code\u003E." - }, - "gate": false, - "hide_unset_desc": false, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "subspec": { - "url": { - "name": "url", - "check": null, - "validation": "", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "The URL the customer will be redirected to after the purchase is complete. You can embed `{CHECKOUT_SESSION_ID}` into the URL to have the `id` of the completed [checkout session](/docs/api/checkout/sessions/object#checkout_session_object-id) included.", - "undocumented": false, - "html": "The URL the customer will be redirected to after the purchase is complete. You can embed \u003Ccode\u003E{CHECKOUT_SESSION_ID}\u003C/code\u003E into the URL to have the \u003Ccode\u003Eid\u003C/code\u003E of the completed \u003Ca href=\"/docs/api/checkout/sessions/object#checkout_session_object-id\"\u003Echeckout session\u003C/a\u003E included." - }, - "gate": false, - "hide_unset_desc": false, - "required": true, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "deprecated_allow_empty": false, - "object_type": "url" - } - }, - "deprecated_allow_empty": false, - "object_type": "redirect" - } - }, - "deprecated_allow_empty": false, - "object_type": "after_completion", - "less_common": true - }, - "allow_promotion_codes": { - "name": "allow_promotion_codes", - "check": null, - "validation": "", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Enables user redeemable promotion codes.", - "undocumented": false, - "html": "Enables user redeemable promotion codes." - }, - "gate": false, - "hide_unset_desc": false, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "object_type": "allow_promotion_codes", - "less_common": true - }, - "application_fee_amount": { - "name": "application_fee_amount", - "check": null, - "validation": "", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "The amount of the application fee (if any) that will be requested to be applied to the payment and transferred to the application owner's Stripe account. Can only be applied when there are no line items with recurring prices.", - "undocumented": false, - "html": "The amount of the application fee (if any) that will be requested to be applied to the payment and transferred to the application owner’s Stripe account. Can only be applied when there are no line items with recurring prices." - }, - "gate": false, - "hide_unset_desc": false, - "required": false, - "default": null, - "badge_text": "Connect only", - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "object_type": "application_fee_amount", - "less_common": true - }, - "application_fee_percent": { - "name": "application_fee_percent", - "check": null, - "validation": "", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "A non-negative decimal between 0 and 100, with at most two decimal places. This represents the percentage of the subscription invoice subtotal that will be transferred to the application owner's Stripe account. There must be at least 1 line item with a recurring price to use this field.", - "undocumented": false, - "html": "A non-negative decimal between 0 and 100, with at most two decimal places. This represents the percentage of the subscription invoice subtotal that will be transferred to the application owner’s Stripe account. There must be at least 1 line item with a recurring price to use this field." - }, - "gate": false, - "hide_unset_desc": false, - "required": false, - "default": null, - "badge_text": "Connect only", - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "object_type": "application_fee_percent", - "less_common": true - }, - "automatic_tax": { - "name": "automatic_tax", - "check": null, - "validation": "", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Configuration for automatic tax collection.", - "undocumented": false, - "html": "Configuration for automatic tax collection." - }, - "gate": false, - "hide_unset_desc": false, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "subspec": { - "enabled": { - "name": "enabled", - "check": null, - "validation": "", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "If `true`, tax will be calculated automatically using the customer's location.", - "undocumented": false, - "html": "If \u003Ccode\u003Etrue\u003C/code\u003E, tax will be calculated automatically using the customer’s location." - }, - "gate": false, - "hide_unset_desc": false, - "required": true, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "object_type": "enabled" - } - }, - "deprecated_allow_empty": false, - "object_type": "automatic_tax", - "less_common": true - }, - "billing_address_collection": { - "name": "billing_address_collection", - "check": null, - "validation": "", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Configuration for collecting the customer's billing address.", - "undocumented": false, - "html": "Configuration for collecting the customer’s billing address." - }, - "gate": false, - "hide_unset_desc": false, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "enum_values": { - "auto": { - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Checkout will only collect the billing address when necessary.", - "undocumented": false, - "badge_text": "Default", - "html": "Checkout will only collect the billing address when necessary." - } - }, - "required": { - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Checkout will always collect the customer's billing address.", - "undocumented": false, - "html": "Checkout will always collect the customer’s billing address." - } - } - }, - "object_type": "billing_address_collection", - "less_common": true - }, - "consent_collection": { - "name": "consent_collection", - "check": null, - "validation": "", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Configure fields to gather active consent from customers.", - "undocumented": false, - "html": "Configure fields to gather active consent from customers." - }, - "gate": false, - "hide_unset_desc": false, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "subspec": { - "promotions": { - "name": "promotions", - "check": null, - "validation": "", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "If set to `auto`, enables the collection of customer consent for promotional communications. The Checkout\nSession will determine whether to display an option to opt into promotional communication\nfrom the merchant depending on the customer's locale. Only available to US merchants.\n", - "undocumented": false, - "html": "If set to \u003Ccode\u003Eauto\u003C/code\u003E, enables the collection of customer consent for promotional communications. The Checkout\nSession will determine whether to display an option to opt into promotional communication\nfrom the merchant depending on the customer’s locale. Only available to US merchants." - }, - "gate": false, - "hide_unset_desc": false, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "enum_values": { - "auto": { - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Enable the collection of customer consent for promotional communications.\nThe Checkout Session will determine whether to display an option to opt into promotional\ncommunication from the merchant depending on if a customer is provided, and if that customer\nhas consented to receiving promotional communications from the merchant in the past.\n", - "undocumented": false, - "html": "Enable the collection of customer consent for promotional communications.\nThe Checkout Session will determine whether to display an option to opt into promotional\ncommunication from the merchant depending on if a customer is provided, and if that customer\nhas consented to receiving promotional communications from the merchant in the past." - } - }, - "none": { - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Checkout will not collect customer consent for promotional communications.\n", - "undocumented": false, - "html": "Checkout will not collect customer consent for promotional communications." - } - } - }, - "object_type": "promotions" - }, - "terms_of_service": { - "name": "terms_of_service", - "check": null, - "validation": "", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "If set to `required`, it requires customers to check a terms of service checkbox before being able to pay.\nThere must be a valid terms of service URL set in your [Dashboard settings](https://dashboard.stripe.com/settings/public).\n", - "undocumented": false, - "html": "If set to \u003Ccode\u003Erequired\u003C/code\u003E, it requires customers to check a terms of service checkbox before being able to pay.\nThere must be a valid terms of service URL set in your \u003Ca href=\"https://dashboard.stripe.com/settings/public\"\u003EDashboard settings\u003C/a\u003E." - }, - "gate": false, - "hide_unset_desc": false, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "enum_values": { - "required": { - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Displays a checkbox for the terms of service agreement which requires customer to check before being able to pay.\n", - "undocumented": false, - "html": "Displays a checkbox for the terms of service agreement which requires customer to check before being able to pay." - } - }, - "none": { - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Does not display checkbox for the terms of service agreement.\n", - "undocumented": false, - "html": "Does not display checkbox for the terms of service agreement." - } - } - }, - "object_type": "terms_of_service" - } - }, - "deprecated_allow_empty": false, - "object_type": "consent_collection", - "less_common": true - }, - "currency": { - "name": "currency", - "check": null, - "validation": "", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. Must be a [supported currency](https://stripe.com/docs/currencies) and supported by each line item's price.", - "undocumented": false, - "html": "Three-letter \u003Ca href=\"https://www.iso.org/iso-4217-currency-codes.html\"\u003EISO currency code\u003C/a\u003E, in lowercase. Must be a \u003Ca href=\"https://stripe.com/docs/currencies\"\u003Esupported currency\u003C/a\u003E and supported by each line item’s price." - }, - "gate": false, - "hide_unset_desc": false, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "object_type": "currency", - "less_common": true - }, - "custom_text": { - "name": "custom_text", - "check": null, - "validation": "", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Display additional text for your customers using custom text. ", - "undocumented": false, - "html": "Display additional text for your customers using custom text. " - }, - "gate": false, - "hide_unset_desc": false, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "subspec": { - "shipping_address": { - "name": "shipping_address", - "check": null, - "validation": "", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Custom text that should be displayed alongside shipping address collection.", - "undocumented": false, - "html": "Custom text that should be displayed alongside shipping address collection." - }, - "gate": false, - "hide_unset_desc": false, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "subspec": { - "message": { - "name": "message", - "check": null, - "validation": "", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Text may be up to 1000 characters in length.", - "undocumented": false, - "html": "Text may be up to 1000 characters in length." - }, - "gate": false, - "hide_unset_desc": false, - "required": true, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "deprecated_allow_empty": false, - "object_type": "message" - } - }, - "deprecated_allow_empty": false, - "object_type": "shipping_address" - }, - "submit": { - "name": "submit", - "check": null, - "validation": "", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Custom text that should be displayed alongside the payment confirmation button.", - "undocumented": false, - "html": "Custom text that should be displayed alongside the payment confirmation button." - }, - "gate": false, - "hide_unset_desc": false, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "subspec": { - "message": { - "name": "message", - "check": null, - "validation": "", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Text may be up to 1000 characters in length.", - "undocumented": false, - "html": "Text may be up to 1000 characters in length." - }, - "gate": false, - "hide_unset_desc": false, - "required": true, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "deprecated_allow_empty": false, - "object_type": "message" - } - }, - "deprecated_allow_empty": false, - "object_type": "submit" - } - }, - "deprecated_allow_empty": false, - "object_type": "custom_text", - "less_common": true - }, - "customer_creation": { - "name": "customer_creation", - "check": null, - "validation": "", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Configures whether [checkout sessions](/docs/api/checkout/sessions) created by this payment link create a [Customer](/docs/api/customers).", - "undocumented": false, - "html": "Configures whether \u003Ca href=\"/docs/api/checkout/sessions\"\u003Echeckout sessions\u003C/a\u003E created by this payment link create a \u003Ca href=\"/docs/api/customers\"\u003ECustomer\u003C/a\u003E." - }, - "gate": false, - "hide_unset_desc": false, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "enum_values": { - "if_required": { - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "The Checkout Session will only create a [Customer](/docs/api/customers) if it is required for Session confirmation.\nCurrently, only `subscription` mode Sessions require a Customer.\n", - "undocumented": false, - "html": "The Checkout Session will only create a \u003Ca href=\"/docs/api/customers\"\u003ECustomer\u003C/a\u003E if it is required for Session confirmation.\nCurrently, only \u003Ccode\u003Esubscription\u003C/code\u003E mode Sessions require a Customer." - } - }, - "always": { - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "The Checkout Session will always create a [Customer](/docs/api/customers) when a Session confirmation is attempted.\n", - "undocumented": false, - "html": "The Checkout Session will always create a \u003Ca href=\"/docs/api/customers\"\u003ECustomer\u003C/a\u003E when a Session confirmation is attempted." - } - } - }, - "object_type": "customer_creation", - "less_common": true - }, - "metadata": { - "name": "metadata", - "check": null, - "validation": "", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Set of [key-value pairs](/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`. Metadata associated with this Payment Link will automatically be copied to [checkout sessions](/docs/api/checkout/sessions) created by this payment link.", - "undocumented": false, - "html": "Set of \u003Ca href=\"/docs/api/metadata\"\u003Ekey-value pairs\u003C/a\u003E that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to \u003Ccode\u003Emetadata\u003C/code\u003E. Metadata associated with this Payment Link will automatically be copied to \u003Ca href=\"/docs/api/checkout/sessions\"\u003Echeckout sessions\u003C/a\u003E created by this payment link." - }, - "gate": false, - "hide_unset_desc": false, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "object_type": "metadata" - }, - "on_behalf_of": { - "name": "on_behalf_of", - "check": null, - "validation": "", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "The account on behalf of which to charge.", - "undocumented": false, - "html": "The account on behalf of which to charge." - }, - "gate": false, - "hide_unset_desc": false, - "required": false, - "default": null, - "badge_text": "Connect only", - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "object_type": "on_behalf_of", - "less_common": true - }, - "payment_intent_data": { - "name": "payment_intent_data", - "check": null, - "validation": "", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "A subset of parameters to be passed to PaymentIntent creation for Checkout Sessions in `payment` mode.", - "undocumented": false, - "html": "A subset of parameters to be passed to PaymentIntent creation for Checkout Sessions in \u003Ccode\u003Epayment\u003C/code\u003E mode." - }, - "gate": false, - "hide_unset_desc": false, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "subspec": { - "capture_method": { - "name": "capture_method", - "check": null, - "validation": "", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Controls when the funds will be captured from the customer's account.\n", - "undocumented": false, - "html": "Controls when the funds will be captured from the customer’s account." - }, - "gate": false, - "hide_unset_desc": false, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "enum_values": { - "automatic": { - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "(Default) Stripe automatically captures funds when the customer authorizes the payment.", - "undocumented": false, - "html": "(Default) Stripe automatically captures funds when the customer authorizes the payment." - } - }, - "manual": { - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Place a hold on the funds when the customer authorizes the payment, but [don't capture the funds until later](/docs/payments/capture-later). (Not all payment methods support this.)", - "undocumented": false, - "html": "Place a hold on the funds when the customer authorizes the payment, but \u003Ca href=\"/docs/payments/capture-later\"\u003Edon’t capture the funds until later\u003C/a\u003E. (Not all payment methods support this.)" - } - } - }, - "object_type": "capture_method" - }, - "setup_future_usage": { - "name": "setup_future_usage", - "check": null, - "validation": "", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Indicates that you intend to [make future payments](/docs/payments/payment-intents#future-usage) with the payment method collected by this Checkout Session.\n\nWhen setting this to `on_session`, Checkout will show a notice to the customer that their payment details will be saved.\n\nWhen setting this to `off_session`, Checkout will show a notice to the customer that their payment details will be saved and used for future payments.\n\nIf a Customer has been provided or Checkout creates a new Customer,Checkout will attach the payment method to the Customer.\n\nIf Checkout does not create a Customer, the payment method is not attached to a Customer. To reuse the payment method, you can retrieve it from the Checkout Session's PaymentIntent.\n\nWhen processing card payments, Checkout also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as SCA.", - "undocumented": false, - "html": "Indicates that you intend to \u003Ca href=\"/docs/payments/payment-intents#future-usage\"\u003Emake future payments\u003C/a\u003E with the payment method collected by this Checkout Session.\u003C/p\u003E\n\n\u003Cp\u003EWhen setting this to \u003Ccode\u003Eon_session\u003C/code\u003E, Checkout will show a notice to the customer that their payment details will be saved.\u003C/p\u003E\n\n\u003Cp\u003EWhen setting this to \u003Ccode\u003Eoff_session\u003C/code\u003E, Checkout will show a notice to the customer that their payment details will be saved and used for future payments.\u003C/p\u003E\n\n\u003Cp\u003EIf a Customer has been provided or Checkout creates a new Customer,Checkout will attach the payment method to the Customer.\u003C/p\u003E\n\n\u003Cp\u003EIf Checkout does not create a Customer, the payment method is not attached to a Customer. To reuse the payment method, you can retrieve it from the Checkout Session’s PaymentIntent.\u003C/p\u003E\n\n\u003Cp\u003EWhen processing card payments, Checkout also uses \u003Ccode\u003Esetup_future_usage\u003C/code\u003E to dynamically optimize your payment flow and comply with regional legislation and network rules, such as SCA." - }, - "gate": false, - "hide_unset_desc": false, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "enum_values": { - "on_session": { - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Use `on_session` if you intend to only reuse the payment method when your customer is present in your checkout flow.", - "undocumented": false, - "html": "Use \u003Ccode\u003Eon_session\u003C/code\u003E if you intend to only reuse the payment method when your customer is present in your checkout flow." - } - }, - "off_session": { - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Use `off_session` if your customer may or may not be present in your checkout flow.", - "undocumented": false, - "html": "Use \u003Ccode\u003Eoff_session\u003C/code\u003E if your customer may or may not be present in your checkout flow." - } - } - }, - "object_type": "setup_future_usage" - } - }, - "deprecated_allow_empty": false, - "object_type": "payment_intent_data", - "less_common": true - }, - "payment_method_collection": { - "name": "payment_method_collection", - "check": null, - "validation": "", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Specify whether Checkout should collect a payment method. When set to `if_required`, Checkout will not collect a payment method when the total due for the session is 0.This may occur if the Checkout Session includes a free trial or a discount.\n\nCan only be set in `subscription` mode.\n\nIf you'd like information on how to collect a payment method outside of Checkout, read the guide on [configuring subscriptions with a free trial](/docs/payments/checkout/free-trials).", - "undocumented": false, - "html": "Specify whether Checkout should collect a payment method. When set to \u003Ccode\u003Eif_required\u003C/code\u003E, Checkout will not collect a payment method when the total due for the session is 0.This may occur if the Checkout Session includes a free trial or a discount.\u003C/p\u003E\n\n\u003Cp\u003ECan only be set in \u003Ccode\u003Esubscription\u003C/code\u003E mode.\u003C/p\u003E\n\n\u003Cp\u003EIf you’d like information on how to collect a payment method outside of Checkout, read the guide on \u003Ca href=\"/docs/payments/checkout/free-trials\"\u003Econfiguring subscriptions with a free trial\u003C/a\u003E." - }, - "gate": false, - "hide_unset_desc": false, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "enum_values": { - "always": { - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "The Checkout Session will always collect a PaymentMethod.\n", - "undocumented": false, - "html": "The Checkout Session will always collect a PaymentMethod." - } - }, - "if_required": { - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "The Checkout Session will only collect a PaymentMethod if there is an amount due.\n", - "undocumented": false, - "html": "The Checkout Session will only collect a PaymentMethod if there is an amount due." - } - } - }, - "object_type": "payment_method_collection", - "less_common": true - }, - "payment_method_types": { - "name": "payment_method_types", - "check": null, - "validation": "", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "The list of payment method types that customers can use. If no value is passed, Stripe will dynamically show relevant payment methods from your [payment method settings](https://dashboard.stripe.com/settings/payment_methods) (20+ payment methods [supported](/docs/payments/payment-methods/integration-options#payment-method-product-support)).", - "undocumented": false, - "html": "The list of payment method types that customers can use. If no value is passed, Stripe will dynamically show relevant payment methods from your \u003Ca href=\"https://dashboard.stripe.com/settings/payment_methods\"\u003Epayment method settings\u003C/a\u003E (20+ payment methods \u003Ca href=\"/docs/payments/payment-methods/integration-options#payment-method-product-support\"\u003Esupported\u003C/a\u003E)." - }, - "gate": false, - "hide_unset_desc": false, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "deprecated_allow_empty": false, - "enum_values": { - "card": { "documentation": null }, - "affirm": { "documentation": null }, - "promptpay": { "documentation": null }, - "bacs_debit": { "documentation": null }, - "bancontact": { "documentation": null }, - "blik": { "documentation": null }, - "boleto": { "documentation": null }, - "eps": { "documentation": null }, - "fpx": { "documentation": null }, - "giropay": { "documentation": null }, - "grabpay": { "documentation": null }, - "ideal": { "documentation": null }, - "klarna": { "documentation": null }, - "konbini": { "documentation": null }, - "oxxo": { "documentation": null }, - "p24": { "documentation": null }, - "paynow": { "documentation": null }, - "pix": { "documentation": null }, - "afterpay_clearpay": { "documentation": null }, - "alipay": { "documentation": null }, - "au_becs_debit": { "documentation": null }, - "sepa_debit": { "documentation": null }, - "sofort": { "documentation": null }, - "us_bank_account": { "documentation": null }, - "wechat_pay": { "documentation": null } - }, - "object_type": "payment_method_types" - }, - "phone_number_collection": { - "name": "phone_number_collection", - "check": null, - "validation": "", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Controls phone number collection settings during checkout.\n\nWe recommend that you review your privacy policy and check with your legal contacts.\n", - "undocumented": false, - "html": "Controls phone number collection settings during checkout.\u003C/p\u003E\n\n\u003Cp\u003EWe recommend that you review your privacy policy and check with your legal contacts." - }, - "gate": false, - "hide_unset_desc": false, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "subspec": { - "enabled": { - "name": "enabled", - "check": null, - "validation": "", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Set to `true` to enable phone number collection.", - "undocumented": false, - "html": "Set to \u003Ccode\u003Etrue\u003C/code\u003E to enable phone number collection." - }, - "gate": false, - "hide_unset_desc": false, - "required": true, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "object_type": "enabled" - } - }, - "deprecated_allow_empty": false, - "object_type": "phone_number_collection", - "less_common": true - }, - "shipping_address_collection": { - "name": "shipping_address_collection", - "check": null, - "validation": "", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Configuration for collecting the customer's shipping address.", - "undocumented": false, - "html": "Configuration for collecting the customer’s shipping address." - }, - "gate": false, - "hide_unset_desc": false, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "subspec": { - "allowed_countries": { - "name": "allowed_countries", - "check": null, - "validation": "", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "An array of two-letter ISO country codes representing which countries Checkout should provide as options for\nshipping locations. Unsupported country codes: `AS, CX, CC, CU, HM, IR, KP, MH, FM, NF, MP, PW, SD, SY, UM, VI`.\n", - "undocumented": false, - "html": "An array of two-letter ISO country codes representing which countries Checkout should provide as options for\nshipping locations. Unsupported country codes: \u003Ccode\u003EAS, CX, CC, CU, HM, IR, KP, MH, FM, NF, MP, PW, SD, SY, UM, VI\u003C/code\u003E." - }, - "gate": false, - "hide_unset_desc": false, - "required": true, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "deprecated_allow_empty": false, - "enum_values": { - "AC": { "documentation": null }, - "AD": { "documentation": null }, - "AE": { "documentation": null }, - "AF": { "documentation": null }, - "AG": { "documentation": null }, - "AI": { "documentation": null }, - "AL": { "documentation": null }, - "AM": { "documentation": null }, - "AO": { "documentation": null }, - "AQ": { "documentation": null }, - "AR": { "documentation": null }, - "AT": { "documentation": null }, - "AU": { "documentation": null }, - "AW": { "documentation": null }, - "AX": { "documentation": null }, - "AZ": { "documentation": null }, - "BA": { "documentation": null }, - "BB": { "documentation": null }, - "BD": { "documentation": null }, - "BE": { "documentation": null }, - "BF": { "documentation": null }, - "BG": { "documentation": null }, - "BH": { "documentation": null }, - "BI": { "documentation": null }, - "BJ": { "documentation": null }, - "BL": { "documentation": null }, - "BM": { "documentation": null }, - "BN": { "documentation": null }, - "BO": { "documentation": null }, - "BQ": { "documentation": null }, - "BR": { "documentation": null }, - "BS": { "documentation": null }, - "BT": { "documentation": null }, - "BV": { "documentation": null }, - "BW": { "documentation": null }, - "BY": { "documentation": null }, - "BZ": { "documentation": null }, - "CA": { "documentation": null }, - "CD": { "documentation": null }, - "CF": { "documentation": null }, - "CG": { "documentation": null }, - "CH": { "documentation": null }, - "CI": { "documentation": null }, - "CK": { "documentation": null }, - "CL": { "documentation": null }, - "CM": { "documentation": null }, - "CN": { "documentation": null }, - "CO": { "documentation": null }, - "CR": { "documentation": null }, - "CV": { "documentation": null }, - "CW": { "documentation": null }, - "CY": { "documentation": null }, - "CZ": { "documentation": null }, - "DE": { "documentation": null }, - "DJ": { "documentation": null }, - "DK": { "documentation": null }, - "DM": { "documentation": null }, - "DO": { "documentation": null }, - "DZ": { "documentation": null }, - "EC": { "documentation": null }, - "EE": { "documentation": null }, - "EG": { "documentation": null }, - "EH": { "documentation": null }, - "ER": { "documentation": null }, - "ES": { "documentation": null }, - "ET": { "documentation": null }, - "FI": { "documentation": null }, - "FJ": { "documentation": null }, - "FK": { "documentation": null }, - "FO": { "documentation": null }, - "FR": { "documentation": null }, - "GA": { "documentation": null }, - "GB": { "documentation": null }, - "GD": { "documentation": null }, - "GE": { "documentation": null }, - "GF": { "documentation": null }, - "GG": { "documentation": null }, - "GH": { "documentation": null }, - "GI": { "documentation": null }, - "GL": { "documentation": null }, - "GM": { "documentation": null }, - "GN": { "documentation": null }, - "GP": { "documentation": null }, - "GQ": { "documentation": null }, - "GR": { "documentation": null }, - "GS": { "documentation": null }, - "GT": { "documentation": null }, - "GU": { "documentation": null }, - "GW": { "documentation": null }, - "GY": { "documentation": null }, - "HK": { "documentation": null }, - "HN": { "documentation": null }, - "HR": { "documentation": null }, - "HT": { "documentation": null }, - "HU": { "documentation": null }, - "ID": { "documentation": null }, - "IE": { "documentation": null }, - "IL": { "documentation": null }, - "IM": { "documentation": null }, - "IN": { "documentation": null }, - "IO": { "documentation": null }, - "IQ": { "documentation": null }, - "IS": { "documentation": null }, - "IT": { "documentation": null }, - "JE": { "documentation": null }, - "JM": { "documentation": null }, - "JO": { "documentation": null }, - "JP": { "documentation": null }, - "KE": { "documentation": null }, - "KG": { "documentation": null }, - "KH": { "documentation": null }, - "KI": { "documentation": null }, - "KM": { "documentation": null }, - "KN": { "documentation": null }, - "KR": { "documentation": null }, - "KW": { "documentation": null }, - "KY": { "documentation": null }, - "KZ": { "documentation": null }, - "LA": { "documentation": null }, - "LB": { "documentation": null }, - "LC": { "documentation": null }, - "LI": { "documentation": null }, - "LK": { "documentation": null }, - "LR": { "documentation": null }, - "LS": { "documentation": null }, - "LT": { "documentation": null }, - "LU": { "documentation": null }, - "LV": { "documentation": null }, - "LY": { "documentation": null }, - "MA": { "documentation": null }, - "MC": { "documentation": null }, - "MD": { "documentation": null }, - "ME": { "documentation": null }, - "MF": { "documentation": null }, - "MG": { "documentation": null }, - "MK": { "documentation": null }, - "ML": { "documentation": null }, - "MM": { "documentation": null }, - "MN": { "documentation": null }, - "MO": { "documentation": null }, - "MQ": { "documentation": null }, - "MR": { "documentation": null }, - "MS": { "documentation": null }, - "MT": { "documentation": null }, - "MU": { "documentation": null }, - "MV": { "documentation": null }, - "MW": { "documentation": null }, - "MX": { "documentation": null }, - "MY": { "documentation": null }, - "MZ": { "documentation": null }, - "NA": { "documentation": null }, - "NC": { "documentation": null }, - "NE": { "documentation": null }, - "NG": { "documentation": null }, - "NI": { "documentation": null }, - "NL": { "documentation": null }, - "NO": { "documentation": null }, - "NP": { "documentation": null }, - "NR": { "documentation": null }, - "NU": { "documentation": null }, - "NZ": { "documentation": null }, - "OM": { "documentation": null }, - "PA": { "documentation": null }, - "PE": { "documentation": null }, - "PF": { "documentation": null }, - "PG": { "documentation": null }, - "PH": { "documentation": null }, - "PK": { "documentation": null }, - "PL": { "documentation": null }, - "PM": { "documentation": null }, - "PN": { "documentation": null }, - "PR": { "documentation": null }, - "PS": { "documentation": null }, - "PT": { "documentation": null }, - "PY": { "documentation": null }, - "QA": { "documentation": null }, - "RE": { "documentation": null }, - "RO": { "documentation": null }, - "RS": { "documentation": null }, - "RU": { "documentation": null }, - "RW": { "documentation": null }, - "SA": { "documentation": null }, - "SB": { "documentation": null }, - "SC": { "documentation": null }, - "SE": { "documentation": null }, - "SG": { "documentation": null }, - "SH": { "documentation": null }, - "SI": { "documentation": null }, - "SJ": { "documentation": null }, - "SK": { "documentation": null }, - "SL": { "documentation": null }, - "SM": { "documentation": null }, - "SN": { "documentation": null }, - "SO": { "documentation": null }, - "SR": { "documentation": null }, - "SS": { "documentation": null }, - "ST": { "documentation": null }, - "SV": { "documentation": null }, - "SX": { "documentation": null }, - "SZ": { "documentation": null }, - "TA": { "documentation": null }, - "TC": { "documentation": null }, - "TD": { "documentation": null }, - "TF": { "documentation": null }, - "TG": { "documentation": null }, - "TH": { "documentation": null }, - "TJ": { "documentation": null }, - "TK": { "documentation": null }, - "TL": { "documentation": null }, - "TM": { "documentation": null }, - "TN": { "documentation": null }, - "TO": { "documentation": null }, - "TR": { "documentation": null }, - "TT": { "documentation": null }, - "TV": { "documentation": null }, - "TW": { "documentation": null }, - "TZ": { "documentation": null }, - "UA": { "documentation": null }, - "UG": { "documentation": null }, - "US": { "documentation": null }, - "UY": { "documentation": null }, - "UZ": { "documentation": null }, - "VA": { "documentation": null }, - "VC": { "documentation": null }, - "VE": { "documentation": null }, - "VG": { "documentation": null }, - "VN": { "documentation": null }, - "VU": { "documentation": null }, - "WF": { "documentation": null }, - "WS": { "documentation": null }, - "XK": { "documentation": null }, - "YE": { "documentation": null }, - "YT": { "documentation": null }, - "ZA": { "documentation": null }, - "ZM": { "documentation": null }, - "ZW": { "documentation": null }, - "ZZ": { "documentation": null } - }, - "object_type": "allowed_countries" - } - }, - "deprecated_allow_empty": false, - "object_type": "shipping_address_collection", - "less_common": true - }, - "shipping_options": { - "name": "shipping_options", - "check": null, - "validation": "", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "The shipping rate options to apply to [checkout sessions](/docs/api/checkout/sessions) created by this payment link.", - "undocumented": false, - "html": "The shipping rate options to apply to \u003Ca href=\"/docs/api/checkout/sessions\"\u003Echeckout sessions\u003C/a\u003E created by this payment link." - }, - "gate": false, - "hide_unset_desc": false, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "deprecated_allow_empty": false, - "array_contents_spec": { - "shipping_rate": { - "name": "shipping_rate", - "check": null, - "validation": "", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "The ID of the Shipping Rate to use for this shipping option.", - "undocumented": false, - "html": "The ID of the Shipping Rate to use for this shipping option." - }, - "gate": false, - "hide_unset_desc": false, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "deprecated_allow_empty": false, - "object_type": "shipping_rate" - } - }, - "object_type": "shipping_options", - "less_common": true - }, - "submit_type": { - "name": "submit_type", - "check": null, - "validation": "", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Describes the type of transaction being performed in order to customize relevant text on the page, such as the submit button. Changing this value will also affect the hostname in the [url](/docs/api/payment_links/payment_links/object#url) property (example: `donate.stripe.com`).", - "undocumented": false, - "html": "Describes the type of transaction being performed in order to customize relevant text on the page, such as the submit button. Changing this value will also affect the hostname in the \u003Ca href=\"/docs/api/payment_links/payment_links/object#url\"\u003Eurl\u003C/a\u003E property (example: \u003Ccode\u003Edonate.stripe.com\u003C/code\u003E)." - }, - "gate": false, - "hide_unset_desc": false, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "enum_values": { - "auto": { "documentation": null }, - "pay": { "documentation": null }, - "book": { "documentation": null }, - "donate": { "documentation": null } - }, - "object_type": "submit_type", - "less_common": true - }, - "subscription_data": { - "name": "subscription_data", - "check": null, - "validation": "", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "When creating a subscription, the specified configuration data will be used. There must be at least one line item with a recurring price to use `subscription_data`.", - "undocumented": false, - "html": "When creating a subscription, the specified configuration data will be used. There must be at least one line item with a recurring price to use \u003Ccode\u003Esubscription_data\u003C/code\u003E." - }, - "gate": false, - "hide_unset_desc": false, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "subspec": { - "description": { - "name": "description", - "check": null, - "validation": "", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "The subscription's description, meant to be displayable to the customer. Use this field to optionally store an explanation of the subscription.", - "undocumented": false, - "html": "The subscription’s description, meant to be displayable to the customer. Use this field to optionally store an explanation of the subscription." - }, - "gate": false, - "hide_unset_desc": false, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "deprecated_allow_empty": false, - "object_type": "description" - }, - "trial_period_days": { - "name": "trial_period_days", - "check": null, - "validation": "", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Integer representing the number of trial period days before the customer is charged for the first time. Has to be at least 1.", - "undocumented": false, - "html": "Integer representing the number of trial period days before the customer is charged for the first time. Has to be at least 1." - }, - "gate": false, - "hide_unset_desc": false, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "object_type": "trial_period_days" - } - }, - "deprecated_allow_empty": false, - "object_type": "subscription_data", - "less_common": true - }, - "tax_id_collection": { - "name": "tax_id_collection", - "check": null, - "validation": "", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Controls tax ID collection during checkout.", - "undocumented": false, - "html": "Controls tax ID collection during checkout." - }, - "gate": false, - "hide_unset_desc": false, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "subspec": { - "enabled": { - "name": "enabled", - "check": null, - "validation": "", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Set to `true` to enable tax ID collection.", - "undocumented": false, - "html": "Set to \u003Ccode\u003Etrue\u003C/code\u003E to enable tax ID collection." - }, - "gate": false, - "hide_unset_desc": false, - "required": true, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "object_type": "enabled" - } - }, - "deprecated_allow_empty": false, - "object_type": "tax_id_collection", - "less_common": true - }, - "transfer_data": { - "name": "transfer_data", - "check": null, - "validation": "", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "The account (if any) the payments will be attributed to for tax reporting, and where funds from each payment will be transferred to.", - "undocumented": false, - "html": "The account (if any) the payments will be attributed to for tax reporting, and where funds from each payment will be transferred to." - }, - "gate": false, - "hide_unset_desc": false, - "required": false, - "default": null, - "badge_text": "Connect only", - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "subspec": { - "destination": { - "name": "destination", - "check": null, - "validation": "", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "If specified, successful charges will be attributed to the destination\naccount for tax reporting, and the funds from charges will be transferred\nto the destination account. The ID of the resulting transfer will be\nreturned on the successful charge's `transfer` field.\n", - "undocumented": false, - "html": "If specified, successful charges will be attributed to the destination\naccount for tax reporting, and the funds from charges will be transferred\nto the destination account. The ID of the resulting transfer will be\nreturned on the successful charge’s \u003Ccode\u003Etransfer\u003C/code\u003E field." - }, - "gate": false, - "hide_unset_desc": false, - "required": true, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "object_type": "destination" - }, - "amount": { - "name": "amount", - "check": null, - "validation": "", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "The amount that will be transferred automatically when a charge succeeds.", - "undocumented": false, - "html": "The amount that will be transferred automatically when a charge succeeds." - }, - "gate": false, - "hide_unset_desc": false, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "object_type": "amount" - } - }, - "deprecated_allow_empty": false, - "object_type": "transfer_data", - "less_common": true - } - }, - "supported_languages": null, - "action": "method", - "curl_definition": "POST /v1/payment_links", - "request": null, - "request_data": { - "test_key": "sk_test_4eC39HqLyjWDarjtT1zdp7dc", - "action_type": "create", - "action_name": null, - "action_path": null, - "resource_name": "payment_link", - "parent_resource_name": null, - "namespace": null, - "test_helper": false, - "request_params": { - "line_items": [{ "price": "price_1MWZrQ2eZvKYlo2CFNmBYW1q", "quantity": 1 }] - }, - "url_params": {}, - "overridden_languages": [], - "preamble_comment": null - }, - "response": "{\n \"id\": \"plink_1MWb7e2eZvKYlo2CTAnxRZDR\",\n \"object\": \"payment_link\",\n \"active\": true,\n \"after_completion\": {\n \"hosted_confirmation\": {\n \"custom_message\": null\n },\n \"type\": \"hosted_confirmation\"\n },\n \"allow_promotion_codes\": false,\n \"application_fee_amount\": null,\n \"application_fee_percent\": null,\n \"automatic_tax\": {\n \"enabled\": false\n },\n \"billing_address_collection\": \"auto\",\n \"consent_collection\": null,\n \"currency\": \"usd\",\n \"custom_text\": {\n \"shipping_address\": null,\n \"submit\": null\n },\n \"customer_creation\": \"always\",\n \"livemode\": false,\n \"metadata\": {\n },\n \"on_behalf_of\": null,\n \"payment_intent_data\": null,\n \"payment_method_collection\": \"always\",\n \"payment_method_types\": null,\n \"phone_number_collection\": {\n \"enabled\": false\n },\n \"shipping_address_collection\": null,\n \"shipping_options\": [\n\n ],\n \"submit_type\": \"auto\",\n \"subscription_data\": null,\n \"tax_id_collection\": {\n \"enabled\": false\n },\n \"transfer_data\": null,\n \"url\": \"https://buy.stripe.com/test_5kAcPyarJaIPaQg4gg\"\n}" - } - }, - "retrieve_payment_link": { - "title": "Retrieve payment link", - "group_title": "Payment Links", - "group_anchor": "payment_links_section", - "anchor": "retrieve_payment_link", - "section_anchor": "payment_links", - "subsection_anchors": null, - "path": "/payment_links/payment_links/retrieve", - "gate": false, - "display_on_load": true, - "data": { - "section_type": "request", - "title": "Retrieve payment link", - "description": "Retrieve a payment link.", - "top_level_changes": [], - "changes": {}, - "version": null, - "returns": "Returns the payment link.", - "section_tag": "retrieve_payment_link", - "specs": {}, - "supported_languages": null, - "action": "method", - "curl_definition": "GET /v1/payment_links/:id", - "request": null, - "request_data": { - "test_key": "sk_test_4eC39HqLyjWDarjtT1zdp7dc", - "action_type": "retrieve", - "action_name": null, - "action_path": null, - "resource_name": "payment_link", - "parent_resource_name": null, - "namespace": null, - "test_helper": false, - "request_params": {}, - "url_params": { "id": "plink_1MWb7e2eZvKYlo2CTAnxRZDR" }, - "overridden_languages": [], - "preamble_comment": null - }, - "response": "{\n \"id\": \"plink_1MWb7e2eZvKYlo2CTAnxRZDR\",\n \"object\": \"payment_link\",\n \"active\": true,\n \"after_completion\": {\n \"hosted_confirmation\": {\n \"custom_message\": null\n },\n \"type\": \"hosted_confirmation\"\n },\n \"allow_promotion_codes\": false,\n \"application_fee_amount\": null,\n \"application_fee_percent\": null,\n \"automatic_tax\": {\n \"enabled\": false\n },\n \"billing_address_collection\": \"auto\",\n \"consent_collection\": null,\n \"currency\": \"usd\",\n \"custom_text\": {\n \"shipping_address\": null,\n \"submit\": null\n },\n \"customer_creation\": \"always\",\n \"livemode\": false,\n \"metadata\": {\n },\n \"on_behalf_of\": null,\n \"payment_intent_data\": null,\n \"payment_method_collection\": \"always\",\n \"payment_method_types\": null,\n \"phone_number_collection\": {\n \"enabled\": false\n },\n \"shipping_address_collection\": null,\n \"shipping_options\": [\n\n ],\n \"submit_type\": \"auto\",\n \"subscription_data\": null,\n \"tax_id_collection\": {\n \"enabled\": false\n },\n \"transfer_data\": null,\n \"url\": \"https://buy.stripe.com/test_5kAcPyarJaIPaQg4gg\"\n}" - } - }, - "update_payment_link": { - "title": "Update a payment link", - "group_title": "Payment Links", - "group_anchor": "payment_links_section", - "anchor": "update_payment_link", - "section_anchor": "payment_links", - "subsection_anchors": null, - "path": "/payment_links/payment_links/update", - "gate": false, - "display_on_load": true, - "data": { - "section_type": "request", - "title": "Update a payment link", - "description": "Updates a payment link.", - "top_level_changes": [], - "changes": {}, - "version": null, - "returns": "Updated payment link.", - "section_tag": "update_payment_link", - "specs": { - "active": { - "name": "active", - "check": null, - "validation": "", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Whether the payment link's `url` is active. If `false`, customers visiting the URL will be shown a page saying that the link has been deactivated.", - "undocumented": false, - "html": "Whether the payment link’s \u003Ccode\u003Eurl\u003C/code\u003E is active. If \u003Ccode\u003Efalse\u003C/code\u003E, customers visiting the URL will be shown a page saying that the link has been deactivated." - }, - "gate": false, - "hide_unset_desc": false, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "object_type": "active" - }, - "after_completion": { - "name": "after_completion", - "check": null, - "validation": "", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Behavior after the purchase is complete.", - "undocumented": false, - "html": "Behavior after the purchase is complete." - }, - "gate": false, - "hide_unset_desc": false, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "subspec": { - "type": { - "name": "type", - "check": null, - "validation": "", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "The specified behavior after the purchase is complete. Either `redirect` or `hosted_confirmation`.", - "undocumented": false, - "html": "The specified behavior after the purchase is complete. Either \u003Ccode\u003Eredirect\u003C/code\u003E or \u003Ccode\u003Ehosted_confirmation\u003C/code\u003E." - }, - "gate": false, - "hide_unset_desc": false, - "required": true, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "enum_values": { - "redirect": { - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Redirects the customer to the specified `url` after the purchase is complete.", - "undocumented": false, - "html": "Redirects the customer to the specified \u003Ccode\u003Eurl\u003C/code\u003E after the purchase is complete." - } - }, - "hosted_confirmation": { - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Displays a message on the hosted surface after the purchase is complete.", - "undocumented": false, - "html": "Displays a message on the hosted surface after the purchase is complete." - } - } - }, - "object_type": "type" - }, - "hosted_confirmation": { - "name": "hosted_confirmation", - "check": null, - "validation": "", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Configuration when `type=hosted_confirmation`.", - "undocumented": false, - "html": "Configuration when \u003Ccode\u003Etype=hosted_confirmation\u003C/code\u003E." - }, - "gate": false, - "hide_unset_desc": false, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "subspec": { - "custom_message": { - "name": "custom_message", - "check": null, - "validation": "", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "A custom message to display to the customer after the purchase is complete.", - "undocumented": false, - "html": "A custom message to display to the customer after the purchase is complete." - }, - "gate": false, - "hide_unset_desc": false, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "deprecated_allow_empty": false, - "object_type": "custom_message" - } - }, - "deprecated_allow_empty": false, - "object_type": "hosted_confirmation" - }, - "redirect": { - "name": "redirect", - "check": null, - "validation": "", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Configuration when `type=redirect`.", - "undocumented": false, - "html": "Configuration when \u003Ccode\u003Etype=redirect\u003C/code\u003E." - }, - "gate": false, - "hide_unset_desc": false, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "subspec": { - "url": { - "name": "url", - "check": null, - "validation": "", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "The URL the customer will be redirected to after the purchase is complete. You can embed `{CHECKOUT_SESSION_ID}` into the URL to have the `id` of the completed [checkout session](/docs/api/checkout/sessions/object#checkout_session_object-id) included.", - "undocumented": false, - "html": "The URL the customer will be redirected to after the purchase is complete. You can embed \u003Ccode\u003E{CHECKOUT_SESSION_ID}\u003C/code\u003E into the URL to have the \u003Ccode\u003Eid\u003C/code\u003E of the completed \u003Ca href=\"/docs/api/checkout/sessions/object#checkout_session_object-id\"\u003Echeckout session\u003C/a\u003E included." - }, - "gate": false, - "hide_unset_desc": false, - "required": true, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "deprecated_allow_empty": false, - "object_type": "url" - } - }, - "deprecated_allow_empty": false, - "object_type": "redirect" - } - }, - "deprecated_allow_empty": false, - "object_type": "after_completion", - "less_common": true - }, - "allow_promotion_codes": { - "name": "allow_promotion_codes", - "check": null, - "validation": "", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Enables user redeemable promotion codes.", - "undocumented": false, - "html": "Enables user redeemable promotion codes." - }, - "gate": false, - "hide_unset_desc": false, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "object_type": "allow_promotion_codes", - "less_common": true - }, - "automatic_tax": { - "name": "automatic_tax", - "check": null, - "validation": "", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Configuration for automatic tax collection.", - "undocumented": false, - "html": "Configuration for automatic tax collection." - }, - "gate": false, - "hide_unset_desc": false, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "subspec": { - "enabled": { - "name": "enabled", - "check": null, - "validation": "", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "If `true`, tax will be calculated automatically using the customer's location.", - "undocumented": false, - "html": "If \u003Ccode\u003Etrue\u003C/code\u003E, tax will be calculated automatically using the customer’s location." - }, - "gate": false, - "hide_unset_desc": false, - "required": true, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "object_type": "enabled" - } - }, - "deprecated_allow_empty": false, - "object_type": "automatic_tax", - "less_common": true - }, - "billing_address_collection": { - "name": "billing_address_collection", - "check": null, - "validation": "", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Configuration for collecting the customer's billing address.", - "undocumented": false, - "html": "Configuration for collecting the customer’s billing address." - }, - "gate": false, - "hide_unset_desc": false, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "enum_values": { - "auto": { - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Checkout will only collect the billing address when necessary.", - "undocumented": false, - "badge_text": "Default", - "html": "Checkout will only collect the billing address when necessary." - } - }, - "required": { - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Checkout will always collect the customer's billing address.", - "undocumented": false, - "html": "Checkout will always collect the customer’s billing address." - } - } - }, - "object_type": "billing_address_collection", - "less_common": true - }, - "custom_text": { - "name": "custom_text", - "check": null, - "validation": "", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Display additional text for your customers using custom text. ", - "undocumented": false, - "html": "Display additional text for your customers using custom text. " - }, - "gate": false, - "hide_unset_desc": false, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "subspec": { - "shipping_address": { - "name": "shipping_address", - "check": null, - "validation": "", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Custom text that should be displayed alongside shipping address collection.", - "undocumented": false, - "html": "Custom text that should be displayed alongside shipping address collection." - }, - "gate": false, - "hide_unset_desc": false, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "subspec": { - "message": { - "name": "message", - "check": null, - "validation": "", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Text may be up to 1000 characters in length.", - "undocumented": false, - "html": "Text may be up to 1000 characters in length." - }, - "gate": false, - "hide_unset_desc": false, - "required": true, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "deprecated_allow_empty": false, - "object_type": "message" - } - }, - "deprecated_allow_empty": false, - "object_type": "shipping_address" - }, - "submit": { - "name": "submit", - "check": null, - "validation": "", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Custom text that should be displayed alongside the payment confirmation button.", - "undocumented": false, - "html": "Custom text that should be displayed alongside the payment confirmation button." - }, - "gate": false, - "hide_unset_desc": false, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "subspec": { - "message": { - "name": "message", - "check": null, - "validation": "", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Text may be up to 1000 characters in length.", - "undocumented": false, - "html": "Text may be up to 1000 characters in length." - }, - "gate": false, - "hide_unset_desc": false, - "required": true, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "deprecated_allow_empty": false, - "object_type": "message" - } - }, - "deprecated_allow_empty": false, - "object_type": "submit" - } - }, - "deprecated_allow_empty": false, - "object_type": "custom_text", - "less_common": true - }, - "customer_creation": { - "name": "customer_creation", - "check": null, - "validation": "", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Configures whether [checkout sessions](/docs/api/checkout/sessions) created by this payment link create a [Customer](/docs/api/customers).", - "undocumented": false, - "html": "Configures whether \u003Ca href=\"/docs/api/checkout/sessions\"\u003Echeckout sessions\u003C/a\u003E created by this payment link create a \u003Ca href=\"/docs/api/customers\"\u003ECustomer\u003C/a\u003E." - }, - "gate": false, - "hide_unset_desc": false, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "enum_values": { - "if_required": { - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "The Checkout Session will only create a [Customer](/docs/api/customers) if it is required for Session confirmation.\nCurrently, only `subscription` mode Sessions require a Customer.\n", - "undocumented": false, - "html": "The Checkout Session will only create a \u003Ca href=\"/docs/api/customers\"\u003ECustomer\u003C/a\u003E if it is required for Session confirmation.\nCurrently, only \u003Ccode\u003Esubscription\u003C/code\u003E mode Sessions require a Customer." - } - }, - "always": { - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "The Checkout Session will always create a [Customer](/docs/api/customers) when a Session confirmation is attempted.\n", - "undocumented": false, - "html": "The Checkout Session will always create a \u003Ca href=\"/docs/api/customers\"\u003ECustomer\u003C/a\u003E when a Session confirmation is attempted." - } - } - }, - "object_type": "customer_creation", - "less_common": true - }, - "line_items": { - "name": "line_items", - "check": null, - "validation": "", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "The line items representing what is being sold. Each line item represents an item being sold. Up to 20 line items are supported.", - "undocumented": false, - "html": "The line items representing what is being sold. Each line item represents an item being sold. Up to 20 line items are supported." - }, - "gate": false, - "hide_unset_desc": false, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "deprecated_allow_empty": false, - "array_contents_spec": { - "id": { - "name": "id", - "check": null, - "validation": "", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "The ID of an existing line item on the payment link.", - "undocumented": false, - "html": "The ID of an existing line item on the payment link." - }, - "gate": false, - "hide_unset_desc": false, - "required": true, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "deprecated_allow_empty": false, - "object_type": "id" - }, - "adjustable_quantity": { - "name": "adjustable_quantity", - "check": null, - "validation": "", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "When set, provides configuration for this item’s quantity to be adjusted by the customer during checkout.", - "undocumented": false, - "html": "When set, provides configuration for this item’s quantity to be adjusted by the customer during checkout." - }, - "gate": false, - "hide_unset_desc": false, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "subspec": { - "enabled": { - "name": "enabled", - "check": null, - "validation": "", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Set to true if the quantity can be adjusted to any non-negative Integer.", - "undocumented": false, - "html": "Set to true if the quantity can be adjusted to any non-negative Integer." - }, - "gate": false, - "hide_unset_desc": false, - "required": true, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "object_type": "enabled" - }, - "maximum": { - "name": "maximum", - "check": null, - "validation": "", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "The maximum quantity the customer can purchase. By default this value is 99. You can specify a value up to 999.", - "undocumented": false, - "html": "The maximum quantity the customer can purchase. By default this value is 99. You can specify a value up to 999." - }, - "gate": false, - "hide_unset_desc": false, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "object_type": "maximum" - }, - "minimum": { - "name": "minimum", - "check": null, - "validation": "", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "The minimum quantity the customer can purchase. By default this value is 0. If there is only one item in the cart then that item's quantity cannot go down to 0.", - "undocumented": false, - "html": "The minimum quantity the customer can purchase. By default this value is 0. If there is only one item in the cart then that item’s quantity cannot go down to 0." - }, - "gate": false, - "hide_unset_desc": false, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "object_type": "minimum" - } - }, - "deprecated_allow_empty": false, - "object_type": "adjustable_quantity" - }, - "quantity": { - "name": "quantity", - "check": null, - "validation": "", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "The quantity of the line item being purchased.", - "undocumented": false, - "html": "The quantity of the line item being purchased." - }, - "gate": false, - "hide_unset_desc": false, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "object_type": "quantity" - } - }, - "object_type": "line_items" - }, - "metadata": { - "name": "metadata", - "check": null, - "validation": "", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Set of [key-value pairs](/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`. Metadata associated with this Payment Link will automatically be copied to [checkout sessions](/docs/api/checkout/sessions) created by this payment link.", - "undocumented": false, - "html": "Set of \u003Ca href=\"/docs/api/metadata\"\u003Ekey-value pairs\u003C/a\u003E that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to \u003Ccode\u003Emetadata\u003C/code\u003E. Metadata associated with this Payment Link will automatically be copied to \u003Ca href=\"/docs/api/checkout/sessions\"\u003Echeckout sessions\u003C/a\u003E created by this payment link." - }, - "gate": false, - "hide_unset_desc": false, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "object_type": "metadata" - }, - "payment_method_collection": { - "name": "payment_method_collection", - "check": null, - "validation": "", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Specify whether Checkout should collect a payment method. When set to `if_required`, Checkout will not collect a payment method when the total due for the session is 0.This may occur if the Checkout Session includes a free trial or a discount.\n\nCan only be set in `subscription` mode.\n\nIf you'd like information on how to collect a payment method outside of Checkout, read the guide on [configuring subscriptions with a free trial](/docs/payments/checkout/free-trials).", - "undocumented": false, - "html": "Specify whether Checkout should collect a payment method. When set to \u003Ccode\u003Eif_required\u003C/code\u003E, Checkout will not collect a payment method when the total due for the session is 0.This may occur if the Checkout Session includes a free trial or a discount.\u003C/p\u003E\n\n\u003Cp\u003ECan only be set in \u003Ccode\u003Esubscription\u003C/code\u003E mode.\u003C/p\u003E\n\n\u003Cp\u003EIf you’d like information on how to collect a payment method outside of Checkout, read the guide on \u003Ca href=\"/docs/payments/checkout/free-trials\"\u003Econfiguring subscriptions with a free trial\u003C/a\u003E." - }, - "gate": false, - "hide_unset_desc": false, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "enum_values": { - "always": { - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "The Checkout Session will always collect a PaymentMethod.\n", - "undocumented": false, - "html": "The Checkout Session will always collect a PaymentMethod." - } - }, - "if_required": { - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "The Checkout Session will only collect a PaymentMethod if there is an amount due.\n", - "undocumented": false, - "html": "The Checkout Session will only collect a PaymentMethod if there is an amount due." - } - } - }, - "object_type": "payment_method_collection", - "less_common": true - }, - "payment_method_types": { - "name": "payment_method_types", - "check": null, - "validation": "", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "The list of payment method types that customers can use. Pass an empty string to enable automatic payment methods that use your [payment method settings](https://dashboard.stripe.com/settings/payment_methods).", - "undocumented": false, - "html": "The list of payment method types that customers can use. Pass an empty string to enable automatic payment methods that use your \u003Ca href=\"https://dashboard.stripe.com/settings/payment_methods\"\u003Epayment method settings\u003C/a\u003E." - }, - "gate": false, - "hide_unset_desc": false, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "deprecated_allow_empty": false, - "enum_values": { - "card": { "documentation": null }, - "affirm": { "documentation": null }, - "promptpay": { "documentation": null }, - "bacs_debit": { "documentation": null }, - "bancontact": { "documentation": null }, - "blik": { "documentation": null }, - "boleto": { "documentation": null }, - "eps": { "documentation": null }, - "fpx": { "documentation": null }, - "giropay": { "documentation": null }, - "grabpay": { "documentation": null }, - "ideal": { "documentation": null }, - "klarna": { "documentation": null }, - "konbini": { "documentation": null }, - "oxxo": { "documentation": null }, - "p24": { "documentation": null }, - "paynow": { "documentation": null }, - "pix": { "documentation": null }, - "afterpay_clearpay": { "documentation": null }, - "alipay": { "documentation": null }, - "au_becs_debit": { "documentation": null }, - "sepa_debit": { "documentation": null }, - "sofort": { "documentation": null }, - "us_bank_account": { "documentation": null }, - "wechat_pay": { "documentation": null } - }, - "object_type": "payment_method_types" - }, - "shipping_address_collection": { - "name": "shipping_address_collection", - "check": null, - "validation": "", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Configuration for collecting the customer's shipping address.", - "undocumented": false, - "html": "Configuration for collecting the customer’s shipping address." - }, - "gate": false, - "hide_unset_desc": false, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "subspec": { - "allowed_countries": { - "name": "allowed_countries", - "check": null, - "validation": "", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "An array of two-letter ISO country codes representing which countries Checkout should provide as options for\nshipping locations. Unsupported country codes: `AS, CX, CC, CU, HM, IR, KP, MH, FM, NF, MP, PW, SD, SY, UM, VI`.\n", - "undocumented": false, - "html": "An array of two-letter ISO country codes representing which countries Checkout should provide as options for\nshipping locations. Unsupported country codes: \u003Ccode\u003EAS, CX, CC, CU, HM, IR, KP, MH, FM, NF, MP, PW, SD, SY, UM, VI\u003C/code\u003E." - }, - "gate": false, - "hide_unset_desc": false, - "required": true, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "deprecated_allow_empty": false, - "enum_values": { - "AC": { "documentation": null }, - "AD": { "documentation": null }, - "AE": { "documentation": null }, - "AF": { "documentation": null }, - "AG": { "documentation": null }, - "AI": { "documentation": null }, - "AL": { "documentation": null }, - "AM": { "documentation": null }, - "AO": { "documentation": null }, - "AQ": { "documentation": null }, - "AR": { "documentation": null }, - "AT": { "documentation": null }, - "AU": { "documentation": null }, - "AW": { "documentation": null }, - "AX": { "documentation": null }, - "AZ": { "documentation": null }, - "BA": { "documentation": null }, - "BB": { "documentation": null }, - "BD": { "documentation": null }, - "BE": { "documentation": null }, - "BF": { "documentation": null }, - "BG": { "documentation": null }, - "BH": { "documentation": null }, - "BI": { "documentation": null }, - "BJ": { "documentation": null }, - "BL": { "documentation": null }, - "BM": { "documentation": null }, - "BN": { "documentation": null }, - "BO": { "documentation": null }, - "BQ": { "documentation": null }, - "BR": { "documentation": null }, - "BS": { "documentation": null }, - "BT": { "documentation": null }, - "BV": { "documentation": null }, - "BW": { "documentation": null }, - "BY": { "documentation": null }, - "BZ": { "documentation": null }, - "CA": { "documentation": null }, - "CD": { "documentation": null }, - "CF": { "documentation": null }, - "CG": { "documentation": null }, - "CH": { "documentation": null }, - "CI": { "documentation": null }, - "CK": { "documentation": null }, - "CL": { "documentation": null }, - "CM": { "documentation": null }, - "CN": { "documentation": null }, - "CO": { "documentation": null }, - "CR": { "documentation": null }, - "CV": { "documentation": null }, - "CW": { "documentation": null }, - "CY": { "documentation": null }, - "CZ": { "documentation": null }, - "DE": { "documentation": null }, - "DJ": { "documentation": null }, - "DK": { "documentation": null }, - "DM": { "documentation": null }, - "DO": { "documentation": null }, - "DZ": { "documentation": null }, - "EC": { "documentation": null }, - "EE": { "documentation": null }, - "EG": { "documentation": null }, - "EH": { "documentation": null }, - "ER": { "documentation": null }, - "ES": { "documentation": null }, - "ET": { "documentation": null }, - "FI": { "documentation": null }, - "FJ": { "documentation": null }, - "FK": { "documentation": null }, - "FO": { "documentation": null }, - "FR": { "documentation": null }, - "GA": { "documentation": null }, - "GB": { "documentation": null }, - "GD": { "documentation": null }, - "GE": { "documentation": null }, - "GF": { "documentation": null }, - "GG": { "documentation": null }, - "GH": { "documentation": null }, - "GI": { "documentation": null }, - "GL": { "documentation": null }, - "GM": { "documentation": null }, - "GN": { "documentation": null }, - "GP": { "documentation": null }, - "GQ": { "documentation": null }, - "GR": { "documentation": null }, - "GS": { "documentation": null }, - "GT": { "documentation": null }, - "GU": { "documentation": null }, - "GW": { "documentation": null }, - "GY": { "documentation": null }, - "HK": { "documentation": null }, - "HN": { "documentation": null }, - "HR": { "documentation": null }, - "HT": { "documentation": null }, - "HU": { "documentation": null }, - "ID": { "documentation": null }, - "IE": { "documentation": null }, - "IL": { "documentation": null }, - "IM": { "documentation": null }, - "IN": { "documentation": null }, - "IO": { "documentation": null }, - "IQ": { "documentation": null }, - "IS": { "documentation": null }, - "IT": { "documentation": null }, - "JE": { "documentation": null }, - "JM": { "documentation": null }, - "JO": { "documentation": null }, - "JP": { "documentation": null }, - "KE": { "documentation": null }, - "KG": { "documentation": null }, - "KH": { "documentation": null }, - "KI": { "documentation": null }, - "KM": { "documentation": null }, - "KN": { "documentation": null }, - "KR": { "documentation": null }, - "KW": { "documentation": null }, - "KY": { "documentation": null }, - "KZ": { "documentation": null }, - "LA": { "documentation": null }, - "LB": { "documentation": null }, - "LC": { "documentation": null }, - "LI": { "documentation": null }, - "LK": { "documentation": null }, - "LR": { "documentation": null }, - "LS": { "documentation": null }, - "LT": { "documentation": null }, - "LU": { "documentation": null }, - "LV": { "documentation": null }, - "LY": { "documentation": null }, - "MA": { "documentation": null }, - "MC": { "documentation": null }, - "MD": { "documentation": null }, - "ME": { "documentation": null }, - "MF": { "documentation": null }, - "MG": { "documentation": null }, - "MK": { "documentation": null }, - "ML": { "documentation": null }, - "MM": { "documentation": null }, - "MN": { "documentation": null }, - "MO": { "documentation": null }, - "MQ": { "documentation": null }, - "MR": { "documentation": null }, - "MS": { "documentation": null }, - "MT": { "documentation": null }, - "MU": { "documentation": null }, - "MV": { "documentation": null }, - "MW": { "documentation": null }, - "MX": { "documentation": null }, - "MY": { "documentation": null }, - "MZ": { "documentation": null }, - "NA": { "documentation": null }, - "NC": { "documentation": null }, - "NE": { "documentation": null }, - "NG": { "documentation": null }, - "NI": { "documentation": null }, - "NL": { "documentation": null }, - "NO": { "documentation": null }, - "NP": { "documentation": null }, - "NR": { "documentation": null }, - "NU": { "documentation": null }, - "NZ": { "documentation": null }, - "OM": { "documentation": null }, - "PA": { "documentation": null }, - "PE": { "documentation": null }, - "PF": { "documentation": null }, - "PG": { "documentation": null }, - "PH": { "documentation": null }, - "PK": { "documentation": null }, - "PL": { "documentation": null }, - "PM": { "documentation": null }, - "PN": { "documentation": null }, - "PR": { "documentation": null }, - "PS": { "documentation": null }, - "PT": { "documentation": null }, - "PY": { "documentation": null }, - "QA": { "documentation": null }, - "RE": { "documentation": null }, - "RO": { "documentation": null }, - "RS": { "documentation": null }, - "RU": { "documentation": null }, - "RW": { "documentation": null }, - "SA": { "documentation": null }, - "SB": { "documentation": null }, - "SC": { "documentation": null }, - "SE": { "documentation": null }, - "SG": { "documentation": null }, - "SH": { "documentation": null }, - "SI": { "documentation": null }, - "SJ": { "documentation": null }, - "SK": { "documentation": null }, - "SL": { "documentation": null }, - "SM": { "documentation": null }, - "SN": { "documentation": null }, - "SO": { "documentation": null }, - "SR": { "documentation": null }, - "SS": { "documentation": null }, - "ST": { "documentation": null }, - "SV": { "documentation": null }, - "SX": { "documentation": null }, - "SZ": { "documentation": null }, - "TA": { "documentation": null }, - "TC": { "documentation": null }, - "TD": { "documentation": null }, - "TF": { "documentation": null }, - "TG": { "documentation": null }, - "TH": { "documentation": null }, - "TJ": { "documentation": null }, - "TK": { "documentation": null }, - "TL": { "documentation": null }, - "TM": { "documentation": null }, - "TN": { "documentation": null }, - "TO": { "documentation": null }, - "TR": { "documentation": null }, - "TT": { "documentation": null }, - "TV": { "documentation": null }, - "TW": { "documentation": null }, - "TZ": { "documentation": null }, - "UA": { "documentation": null }, - "UG": { "documentation": null }, - "US": { "documentation": null }, - "UY": { "documentation": null }, - "UZ": { "documentation": null }, - "VA": { "documentation": null }, - "VC": { "documentation": null }, - "VE": { "documentation": null }, - "VG": { "documentation": null }, - "VN": { "documentation": null }, - "VU": { "documentation": null }, - "WF": { "documentation": null }, - "WS": { "documentation": null }, - "XK": { "documentation": null }, - "YE": { "documentation": null }, - "YT": { "documentation": null }, - "ZA": { "documentation": null }, - "ZM": { "documentation": null }, - "ZW": { "documentation": null }, - "ZZ": { "documentation": null } - }, - "object_type": "allowed_countries" - } - }, - "deprecated_allow_empty": false, - "object_type": "shipping_address_collection", - "less_common": true - } - }, - "supported_languages": null, - "action": "method", - "curl_definition": "POST /v1/payment_links/:id", - "request": null, - "request_data": { - "test_key": "sk_test_4eC39HqLyjWDarjtT1zdp7dc", - "action_type": "update", - "action_name": null, - "action_path": null, - "resource_name": "payment_link", - "parent_resource_name": null, - "namespace": null, - "test_helper": false, - "request_params": { "active": false }, - "url_params": { "id": "plink_1MWb7e2eZvKYlo2CTAnxRZDR" }, - "overridden_languages": [], - "preamble_comment": null - }, - "response": "{\n \"id\": \"plink_1MWb7e2eZvKYlo2CTAnxRZDR\",\n \"object\": \"payment_link\",\n \"active\": false,\n \"after_completion\": {\n \"hosted_confirmation\": {\n \"custom_message\": null\n },\n \"type\": \"hosted_confirmation\"\n },\n \"allow_promotion_codes\": false,\n \"application_fee_amount\": null,\n \"application_fee_percent\": null,\n \"automatic_tax\": {\n \"enabled\": false\n },\n \"billing_address_collection\": \"auto\",\n \"consent_collection\": null,\n \"currency\": \"usd\",\n \"custom_text\": {\n \"shipping_address\": null,\n \"submit\": null\n },\n \"customer_creation\": \"always\",\n \"livemode\": false,\n \"metadata\": {\n },\n \"on_behalf_of\": null,\n \"payment_intent_data\": null,\n \"payment_method_collection\": \"always\",\n \"payment_method_types\": null,\n \"phone_number_collection\": {\n \"enabled\": false\n },\n \"shipping_address_collection\": null,\n \"shipping_options\": [\n\n ],\n \"submit_type\": \"auto\",\n \"subscription_data\": null,\n \"tax_id_collection\": {\n \"enabled\": false\n },\n \"transfer_data\": null,\n \"url\": \"https://buy.stripe.com/test_5kAcPyarJaIPaQg4gg\"\n}" - } - }, - "list_payment_link": { - "title": "List all payment links", - "group_title": "Payment Links", - "group_anchor": "payment_links_section", - "anchor": "list_payment_link", - "section_anchor": "payment_links", - "subsection_anchors": null, - "path": "/payment_links/payment_links/list", - "gate": false, - "display_on_load": true, - "data": { - "section_type": "request", - "title": "List all payment links", - "description": "Returns a list of your payment links.", - "top_level_changes": [], - "changes": {}, - "version": null, - "returns": "A dictionary with a \u003Ccode\u003Edata\u003C/code\u003E property that contains an array of up to \u003Ccode\u003Elimit\u003C/code\u003E payment links, starting after payment link \u003Ccode\u003Estarting_after\u003C/code\u003E. Each entry in the array is a separate payment link object. If no more payment links are available, the resulting array will be empty. This request should never return an error.", - "section_tag": "list_payment_link", - "specs": { - "active": { - "name": "active", - "check": null, - "validation": "", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "Only return payment links that are active or inactive (e.g., pass `false` to list all inactive payment links).", - "undocumented": false, - "html": "Only return payment links that are active or inactive (e.g., pass \u003Ccode\u003Efalse\u003C/code\u003E to list all inactive payment links)." - }, - "gate": false, - "hide_unset_desc": false, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "object_type": "active" - }, - "ending_before": { - "name": "ending_before", - "check": null, - "validation": "", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "A cursor for use in pagination. `ending_before` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, starting with `obj_bar`, your subsequent call can include `ending_before=obj_bar` in order to fetch the previous page of the list.", - "undocumented": false, - "html": "A cursor for use in pagination. \u003Ccode\u003Eending_before\u003C/code\u003E is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, starting with \u003Ccode\u003Eobj_bar\u003C/code\u003E, your subsequent call can include \u003Ccode\u003Eending_before=obj_bar\u003C/code\u003E in order to fetch the previous page of the list." - }, - "gate": false, - "hide_unset_desc": false, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "deprecated_allow_empty": false, - "object_type": "ending_before", - "less_common": true - }, - "limit": { - "name": "limit", - "check": null, - "validation": "", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 10.", - "undocumented": false, - "html": "A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 10." - }, - "gate": false, - "hide_unset_desc": false, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "object_type": "limit", - "less_common": true - }, - "starting_after": { - "name": "starting_after", - "check": null, - "validation": "", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "A cursor for use in pagination. `starting_after` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with `obj_foo`, your subsequent call can include `starting_after=obj_foo` in order to fetch the next page of the list.", - "undocumented": false, - "html": "A cursor for use in pagination. \u003Ccode\u003Estarting_after\u003C/code\u003E is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with \u003Ccode\u003Eobj_foo\u003C/code\u003E, your subsequent call can include \u003Ccode\u003Estarting_after=obj_foo\u003C/code\u003E in order to fetch the next page of the list." - }, - "gate": false, - "hide_unset_desc": false, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "deprecated_allow_empty": false, - "object_type": "starting_after", - "less_common": true - } - }, - "supported_languages": null, - "action": "method", - "curl_definition": "GET /v1/payment_links", - "request": null, - "request_data": { - "test_key": "sk_test_4eC39HqLyjWDarjtT1zdp7dc", - "action_type": "list", - "action_name": null, - "action_path": null, - "resource_name": "payment_link", - "parent_resource_name": null, - "namespace": null, - "test_helper": false, - "request_params": { "limit": 3 }, - "url_params": {}, - "overridden_languages": [], - "preamble_comment": null - }, - "response": "{\n \"object\": \"list\",\n \"url\": \"/v1/payment_links\",\n \"has_more\": false,\n \"data\": [\n {\n \"id\": \"plink_1MWb7e2eZvKYlo2CTAnxRZDR\",\n \"object\": \"payment_link\",\n \"active\": true,\n \"after_completion\": {\n \"hosted_confirmation\": {\n \"custom_message\": null\n },\n \"type\": \"hosted_confirmation\"\n },\n \"allow_promotion_codes\": false,\n \"application_fee_amount\": null,\n \"application_fee_percent\": null,\n \"automatic_tax\": {\n \"enabled\": false\n },\n \"billing_address_collection\": \"auto\",\n \"consent_collection\": null,\n \"currency\": \"usd\",\n \"custom_text\": {\n \"shipping_address\": null,\n \"submit\": null\n },\n \"customer_creation\": \"always\",\n \"livemode\": false,\n \"metadata\": {\n },\n \"on_behalf_of\": null,\n \"payment_intent_data\": null,\n \"payment_method_collection\": \"always\",\n \"payment_method_types\": null,\n \"phone_number_collection\": {\n \"enabled\": false\n },\n \"shipping_address_collection\": null,\n \"shipping_options\": [\n \n ],\n \"submit_type\": \"auto\",\n \"subscription_data\": null,\n \"tax_id_collection\": {\n \"enabled\": false\n },\n \"transfer_data\": null,\n \"url\": \"https://buy.stripe.com/test_5kAcPyarJaIPaQg4gg\"\n },\n {...},\n {...}\n ]\n}\n" - } - }, - "retrieve_payment_link_line_items": { - "title": "Retrieve a payment link's line items", - "group_title": "Payment Links", - "group_anchor": "payment_links_section", - "anchor": "retrieve_payment_link_line_items", - "section_anchor": "payment_links", - "subsection_anchors": null, - "path": "/payment_links/line_items", - "gate": false, - "display_on_load": true, - "data": { - "section_type": "request", - "title": "Retrieve a payment link's line items", - "description": "When retrieving a payment link, there is an includable \u003Cstrong\u003Eline_items\u003C/strong\u003E property containing the first handful of those items. There is also a URL where you can retrieve the full (paginated) list of line items.", - "top_level_changes": [], - "changes": {}, - "version": null, - "returns": "A dictionary with a \u003Ccode\u003Edata\u003C/code\u003E property that contains an array of up to \u003Ccode\u003Elimit\u003C/code\u003E payment link line items, starting after Line Item \u003Ccode\u003Estarting_after\u003C/code\u003E. Each entry in the array is a separate Line Item object. If no more line items are available, the resulting array will be empty. ", - "section_tag": "retrieve_payment_link_line_items", - "specs": { - "ending_before": { - "name": "ending_before", - "check": null, - "validation": "", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "A cursor for use in pagination. `ending_before` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, starting with `obj_bar`, your subsequent call can include `ending_before=obj_bar` in order to fetch the previous page of the list.", - "undocumented": false, - "html": "A cursor for use in pagination. \u003Ccode\u003Eending_before\u003C/code\u003E is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, starting with \u003Ccode\u003Eobj_bar\u003C/code\u003E, your subsequent call can include \u003Ccode\u003Eending_before=obj_bar\u003C/code\u003E in order to fetch the previous page of the list." - }, - "gate": false, - "hide_unset_desc": false, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "deprecated_allow_empty": false, - "object_type": "ending_before", - "less_common": true - }, - "limit": { - "name": "limit", - "check": null, - "validation": "", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 10.", - "undocumented": false, - "html": "A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 10." - }, - "gate": false, - "hide_unset_desc": false, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "object_type": "limit", - "less_common": true - }, - "starting_after": { - "name": "starting_after", - "check": null, - "validation": "", - "documentation": { - "gate_specific": {}, - "localize_terms": [], - "markdown": "A cursor for use in pagination. `starting_after` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with `obj_foo`, your subsequent call can include `starting_after=obj_foo` in order to fetch the next page of the list.", - "undocumented": false, - "html": "A cursor for use in pagination. \u003Ccode\u003Estarting_after\u003C/code\u003E is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with \u003Ccode\u003Eobj_foo\u003C/code\u003E, your subsequent call can include \u003Ccode\u003Estarting_after=obj_foo\u003C/code\u003E in order to fetch the next page of the list." - }, - "gate": false, - "hide_unset_desc": false, - "required": false, - "default": null, - "badge_text": null, - "requirement_text": null, - "permission": null, - "hide_nil": null, - "is_country_specific": false, - "deprecated_allow_empty": false, - "object_type": "starting_after", - "less_common": true - } - }, - "supported_languages": null, - "action": "method", - "curl_definition": "GET /v1/payment_links/:id/line_items", - "request": "curl https://api.stripe.com/v1/payment_links/plink_1MWb7e2eZvKYlo2CTAnxRZDR/line_items \\\n -u sk_test_4eC39HqLyjWDarjtT1zdp7dc:\n", - "request_data": null, - "response": "{\n \"object\": \"list\",\n \"url\": \"/v1/payment_links/plink_1MWb7e2eZvKYlo2CTAnxRZDR/line_items\",\n \"has_more\": false,\n \"data\": [\n {\n \"id\": \"li_1MWb7e2eZvKYlo2CouWkOJkL\",\n \"object\": \"item\",\n \"amount_discount\": 0,\n \"amount_subtotal\": 0,\n \"amount_tax\": 0,\n \"amount_total\": 0,\n \"currency\": \"usd\",\n \"description\": \"Gold Special\",\n \"price\": {\n \"id\": \"price_1MWXoV2eZvKYlo2CxNVrmRLD\",\n \"object\": \"price\",\n \"active\": true,\n \"billing_scheme\": \"per_unit\",\n \"created\": 1675225251,\n \"currency\": \"usd\",\n \"custom_unit_amount\": null,\n \"livemode\": false,\n \"lookup_key\": null,\n \"metadata\": {\n },\n \"nickname\": null,\n \"product\": \"prod_NH60TC6ig2RLb2\",\n \"recurring\": null,\n \"tax_behavior\": \"unspecified\",\n \"tiers_mode\": null,\n \"transform_quantity\": null,\n \"type\": \"one_time\",\n \"unit_amount\": 2000,\n \"unit_amount_decimal\": \"2000\"\n },\n \"quantity\": 1\n },\n {...},\n {...}\n ]\n}\n" - } - }, - "credit_notes": { - "title": "Credit Notes", - "group_title": "Billing", - "group_anchor": "billing", - "anchor": "credit_notes", - "section_anchor": "credit_notes", - "subsection_anchors": [ - "credit_note_object", - "credit_note_line_item_object", - "preview_credit_note", - "create_credit_note", - "retrieve_credit_note", - "update_credit_note", - "credit_note_lines", - "credit_note_preview_lines", - "void_credit_note", - "list_credit_notes" - ], - "path": "/credit_notes", - "gate": false, - "display_on_load": false, - "data": { - "section_type": "resource", - "title": "Credit Note", - "description": "Issue a credit note to adjust an invoice's amount after the invoice is finalized.\n\nRelated guide: [Credit Notes](/docs/billing/invoices/credit-notes).\n", - "section_tag": "credit_notes", - "subsection_summaries": [ - { "anchor": "credit_note_object", "curl_definition": null }, - { "anchor": "credit_note_line_item_object", "curl_definition": null }, - { "anchor": "preview_credit_note", "curl_definition": "GET /v1/credit_notes/preview" }, - { "anchor": "create_credit_note", "curl_definition": "POST /v1/credit_notes" }, - { "anchor": "retrieve_credit_note", "curl_definition": "GET /v1/credit_notes/:id" }, - { "anchor": "update_credit_note", "curl_definition": "POST /v1/credit_notes/:id" }, - { - "anchor": "credit_note_lines", - "curl_definition": "GET /v1/credit_notes/:credit_note/lines" - }, - { - "anchor": "credit_note_preview_lines", - "curl_definition": "GET /v1/credit_notes/preview/lines" - }, - { "anchor": "void_credit_note", "curl_definition": "POST /v1/credit_notes/:id/void" }, - { "anchor": "list_credit_notes", "curl_definition": "GET /v1/credit_notes" } - ] - } - }, - "credit_note_object": { - "title": "The credit note object", - "group_title": "Billing", - "group_anchor": "billing", - "anchor": "credit_note_object", - "section_anchor": "credit_notes", - "subsection_anchors": null, - "path": "/credit_notes/object", - "gate": false, - "display_on_load": false - }, - "credit_note_line_item_object": { - "title": "The (Credit Note) line item object", - "group_title": "Billing", - "group_anchor": "billing", - "anchor": "credit_note_line_item_object", - "section_anchor": "credit_notes", - "subsection_anchors": null, - "path": "/credit_notes/line_item", - "gate": false, - "display_on_load": false - }, - "preview_credit_note": { - "title": "Preview a credit note", - "group_title": "Billing", - "group_anchor": "billing", - "anchor": "preview_credit_note", - "section_anchor": "credit_notes", - "subsection_anchors": null, - "path": "/credit_notes/preview", - "gate": false, - "display_on_load": false - }, - "create_credit_note": { - "title": "Create a credit note", - "group_title": "Billing", - "group_anchor": "billing", - "anchor": "create_credit_note", - "section_anchor": "credit_notes", - "subsection_anchors": null, - "path": "/credit_notes/create", - "gate": false, - "display_on_load": false - }, - "retrieve_credit_note": { - "title": "Retrieve a credit note", - "group_title": "Billing", - "group_anchor": "billing", - "anchor": "retrieve_credit_note", - "section_anchor": "credit_notes", - "subsection_anchors": null, - "path": "/credit_notes/retrieve", - "gate": false, - "display_on_load": false - }, - "update_credit_note": { - "title": "Update a credit note", - "group_title": "Billing", - "group_anchor": "billing", - "anchor": "update_credit_note", - "section_anchor": "credit_notes", - "subsection_anchors": null, - "path": "/credit_notes/update", - "gate": false, - "display_on_load": false - }, - "credit_note_lines": { - "title": "Retrieve a credit note's line items", - "group_title": "Billing", - "group_anchor": "billing", - "anchor": "credit_note_lines", - "section_anchor": "credit_notes", - "subsection_anchors": null, - "path": "/credit_notes/lines", - "gate": false, - "display_on_load": false - }, - "credit_note_preview_lines": { - "title": "Retrieve a credit note preview's line items", - "group_title": "Billing", - "group_anchor": "billing", - "anchor": "credit_note_preview_lines", - "section_anchor": "credit_notes", - "subsection_anchors": null, - "path": "/credit_notes/preview_lines", - "gate": false, - "display_on_load": false - }, - "void_credit_note": { - "title": "Void a credit note", - "group_title": "Billing", - "group_anchor": "billing", - "anchor": "void_credit_note", - "section_anchor": "credit_notes", - "subsection_anchors": null, - "path": "/credit_notes/void", - "gate": false, - "display_on_load": false - }, - "list_credit_notes": { - "title": "List all credit notes", - "group_title": "Billing", - "group_anchor": "billing", - "anchor": "list_credit_notes", - "section_anchor": "credit_notes", - "subsection_anchors": null, - "path": "/credit_notes/list", - "gate": false, - "display_on_load": false - }, - "customer_balance_transactions": { - "title": "Customer Balance Transactions", - "group_title": "Billing", - "group_anchor": "billing", - "anchor": "customer_balance_transactions", - "section_anchor": "customer_balance_transactions", - "subsection_anchors": [ - "customer_balance_transaction_object", - "create_customer_balance_transaction", - "retrieve_customer_balance_transaction", - "update_customer_balance_transaction", - "list_customer_balance_transactions" - ], - "path": "/customer_balance_transactions", - "gate": false, - "display_on_load": false, - "data": { - "section_type": "resource", - "title": "Customer Balance Transaction", - "description": "Each customer has a [`balance`](/docs/api/customers/object#customer_object-balance) value,\nwhich denotes a debit or credit that's automatically applied to their next invoice upon finalization.\nYou may modify the value directly by using the [update customer API](/docs/api/customers/update),\nor by creating a Customer Balance Transaction, which increments or decrements the customer's `balance` by the specified `amount`.\n\nRelated guide: [Customer Balance](/docs/billing/customer/balance) to learn more.\n", - "section_tag": "customer_balance_transactions", - "subsection_summaries": [ - { "anchor": "customer_balance_transaction_object", "curl_definition": null }, - { - "anchor": "create_customer_balance_transaction", - "curl_definition": "POST /v1/customers/:id/balance_transactions" - }, - { - "anchor": "retrieve_customer_balance_transaction", - "curl_definition": "GET /v1/customers/:id/balance_transactions/:id" - }, - { - "anchor": "update_customer_balance_transaction", - "curl_definition": "POST /v1/customers/:id/balance_transactions/:id" - }, - { - "anchor": "list_customer_balance_transactions", - "curl_definition": "GET /v1/customers/:id/balance_transactions" - } - ] - } - }, - "customer_balance_transaction_object": { - "title": "The customer balance transaction object", - "group_title": "Billing", - "group_anchor": "billing", - "anchor": "customer_balance_transaction_object", - "section_anchor": "customer_balance_transactions", - "subsection_anchors": null, - "path": "/customer_balance_transactions/object", - "gate": false, - "display_on_load": false - }, - "create_customer_balance_transaction": { - "title": "Create a customer balance transaction", - "group_title": "Billing", - "group_anchor": "billing", - "anchor": "create_customer_balance_transaction", - "section_anchor": "customer_balance_transactions", - "subsection_anchors": null, - "path": "/customer_balance_transactions/create", - "gate": false, - "display_on_load": false - }, - "retrieve_customer_balance_transaction": { - "title": "Retrieve a customer balance transaction", - "group_title": "Billing", - "group_anchor": "billing", - "anchor": "retrieve_customer_balance_transaction", - "section_anchor": "customer_balance_transactions", - "subsection_anchors": null, - "path": "/customer_balance_transactions/retrieve", - "gate": false, - "display_on_load": false - }, - "update_customer_balance_transaction": { - "title": "Update a customer credit balance transaction", - "group_title": "Billing", - "group_anchor": "billing", - "anchor": "update_customer_balance_transaction", - "section_anchor": "customer_balance_transactions", - "subsection_anchors": null, - "path": "/customer_balance_transactions/update", - "gate": false, - "display_on_load": false - }, - "list_customer_balance_transactions": { - "title": "List customer balance transactions", - "group_title": "Billing", - "group_anchor": "billing", - "anchor": "list_customer_balance_transactions", - "section_anchor": "customer_balance_transactions", - "subsection_anchors": null, - "path": "/customer_balance_transactions/list", - "gate": false, - "display_on_load": false - }, - "customer_portal": { - "title": "Customer Portal", - "group_title": "Billing", - "group_anchor": "billing", - "anchor": "customer_portal", - "section_anchor": "customer_portal", - "subsection_anchors": [ - "portal_session_object", - "portal_configuration_object", - "create_portal_session", - "create_portal_configuration", - "update_portal_configuration", - "retrieve_portal_configuration", - "all_portal_configurations" - ], - "path": "/customer_portal", - "gate": false, - "display_on_load": false, - "data": { - "section_type": "resource", - "title": "Customer Portal", - "description": "The Billing customer portal is a Stripe-hosted UI for subscription and\nbilling management.\n\nA portal configuration describes the functionality and features that you\nwant to provide to your customers through the portal.\n\nA portal session describes the instantiation of the customer portal for\na particular customer. By visiting the session's URL, the customer\ncan manage their subscriptions and billing details. For security reasons,\nsessions are short-lived and will expire if the customer does not visit the URL.\nCreate sessions on-demand when customers intend to manage their subscriptions\nand billing details.\n\nLearn more in the [integration guide](/docs/billing/subscriptions/integrating-customer-portal).\n", - "section_tag": "customer_portal", - "subsection_summaries": [ - { "anchor": "portal_session_object", "curl_definition": null }, - { "anchor": "portal_configuration_object", "curl_definition": null }, - { - "anchor": "create_portal_session", - "curl_definition": "POST /v1/billing_portal/sessions" - }, - { - "anchor": "create_portal_configuration", - "curl_definition": "POST /v1/billing_portal/configurations" - }, - { - "anchor": "update_portal_configuration", - "curl_definition": "POST /v1/billing_portal/configurations/:id" - }, - { - "anchor": "retrieve_portal_configuration", - "curl_definition": "GET /v1/billing_portal/configurations/:id" - }, - { - "anchor": "all_portal_configurations", - "curl_definition": "GET /v1/billing_portal/configurations" - } - ] - } - }, - "portal_session_object": { - "title": "The portal session object", - "group_title": "Billing", - "group_anchor": "billing", - "anchor": "portal_session_object", - "section_anchor": "customer_portal", - "subsection_anchors": null, - "path": "/customer_portal/session", - "gate": false, - "display_on_load": false - }, - "portal_configuration_object": { - "title": "The portal configuration object", - "group_title": "Billing", - "group_anchor": "billing", - "anchor": "portal_configuration_object", - "section_anchor": "customer_portal", - "subsection_anchors": null, - "path": "/customer_portal/configuration", - "gate": false, - "display_on_load": false - }, - "create_portal_session": { - "title": "Create a portal session", - "group_title": "Billing", - "group_anchor": "billing", - "anchor": "create_portal_session", - "section_anchor": "customer_portal", - "subsection_anchors": null, - "path": "/customer_portal/sessions/create", - "gate": false, - "display_on_load": false - }, - "create_portal_configuration": { - "title": "Create a portal configuration", - "group_title": "Billing", - "group_anchor": "billing", - "anchor": "create_portal_configuration", - "section_anchor": "customer_portal", - "subsection_anchors": null, - "path": "/customer_portal/configurations/create", - "gate": false, - "display_on_load": false - }, - "update_portal_configuration": { - "title": "Update a portal configuration", - "group_title": "Billing", - "group_anchor": "billing", - "anchor": "update_portal_configuration", - "section_anchor": "customer_portal", - "subsection_anchors": null, - "path": "/customer_portal/configurations/update", - "gate": false, - "display_on_load": false - }, - "retrieve_portal_configuration": { - "title": "Retrieve a portal configuration", - "group_title": "Billing", - "group_anchor": "billing", - "anchor": "retrieve_portal_configuration", - "section_anchor": "customer_portal", - "subsection_anchors": null, - "path": "/customer_portal/configurations/retrieve", - "gate": false, - "display_on_load": false - }, - "all_portal_configurations": { - "title": "List portal configurations", - "group_title": "Billing", - "group_anchor": "billing", - "anchor": "all_portal_configurations", - "section_anchor": "customer_portal", - "subsection_anchors": null, - "path": "/customer_portal/configurations/list", - "gate": false, - "display_on_load": false - }, - "customer_tax_ids": { - "title": "Customer Tax IDs", - "group_title": "Billing", - "group_anchor": "billing", - "anchor": "customer_tax_ids", - "section_anchor": "customer_tax_ids", - "subsection_anchors": [ - "tax_id_object", - "create_tax_id", - "retrieve_tax_id", - "delete_tax_id", - "list_tax_ids" - ], - "path": "/customer_tax_ids", - "gate": false, - "display_on_load": false, - "data": { - "section_type": "resource", - "title": "Customer Tax IDs", - "description": "You can add one or multiple tax IDs to a [customer](/docs/api/customers).\nA customer's tax IDs are displayed on invoices and credit notes issued for the customer.\n\nRelated guide: [Customer Tax Identification Numbers](/docs/billing/taxes/tax-ids).\n", - "section_tag": "customer_tax_ids", - "subsection_summaries": [ - { "anchor": "tax_id_object", "curl_definition": null }, - { "anchor": "create_tax_id", "curl_definition": "POST /v1/customers/:id/tax_ids" }, - { "anchor": "retrieve_tax_id", "curl_definition": "GET /v1/customers/:id/tax_ids/:id" }, - { "anchor": "delete_tax_id", "curl_definition": "DELETE /v1/customers/:id/tax_ids/:id" }, - { "anchor": "list_tax_ids", "curl_definition": "GET /v1/customers/:id/tax_ids" } - ] - } - }, - "tax_id_object": { - "title": "The tax ID object", - "group_title": "Billing", - "group_anchor": "billing", - "anchor": "tax_id_object", - "section_anchor": "customer_tax_ids", - "subsection_anchors": null, - "path": "/customer_tax_ids/object", - "gate": false, - "display_on_load": false - }, - "create_tax_id": { - "title": "Create a tax ID", - "group_title": "Billing", - "group_anchor": "billing", - "anchor": "create_tax_id", - "section_anchor": "customer_tax_ids", - "subsection_anchors": null, - "path": "/customer_tax_ids/create", - "gate": false, - "display_on_load": false - }, - "retrieve_tax_id": { - "title": "Retrieve a tax ID", - "group_title": "Billing", - "group_anchor": "billing", - "anchor": "retrieve_tax_id", - "section_anchor": "customer_tax_ids", - "subsection_anchors": null, - "path": "/customer_tax_ids/retrieve", - "gate": false, - "display_on_load": false - }, - "delete_tax_id": { - "title": "Delete a tax ID", - "group_title": "Billing", - "group_anchor": "billing", - "anchor": "delete_tax_id", - "section_anchor": "customer_tax_ids", - "subsection_anchors": null, - "path": "/customer_tax_ids/delete", - "gate": false, - "display_on_load": false - }, - "list_tax_ids": { - "title": "List all tax IDs", - "group_title": "Billing", - "group_anchor": "billing", - "anchor": "list_tax_ids", - "section_anchor": "customer_tax_ids", - "subsection_anchors": null, - "path": "/customer_tax_ids/list", - "gate": false, - "display_on_load": false - }, - "invoices": { - "title": "Invoices", - "group_title": "Billing", - "group_anchor": "billing", - "anchor": "invoices", - "section_anchor": "invoices", - "subsection_anchors": [ - "invoice_object", - "invoice_line_item_object", - "create_invoice", - "retrieve_invoice", - "update_invoice", - "delete_invoice", - "finalize_invoice", - "pay_invoice", - "send_invoice", - "void_invoice", - "mark_uncollectible_invoice", - "invoice_lines", - "upcoming_invoice", - "upcoming_invoice_lines", - "list_invoices", - "search_invoices" - ], - "path": "/invoices", - "gate": false, - "display_on_load": false, - "data": { - "section_type": "resource", - "title": "Invoices", - "description": "Invoices are statements of amounts owed by a customer, and are either\ngenerated one-off, or generated periodically from a subscription.\n\nThey contain [invoice items](#invoiceitems), and proration adjustments\nthat may be caused by subscription upgrades/downgrades (if necessary).\n\nIf your invoice is configured to be billed through automatic charges,\nStripe automatically finalizes your invoice and attempts payment. Note\nthat finalizing the invoice,\n[when automatic](/docs/billing/invoices/workflow/#auto_advance), does\nnot happen immediately as the invoice is created. Stripe waits\nuntil one hour after the last webhook was successfully sent (or the last\nwebhook timed out after failing). If you (and the platforms you may have\nconnected to) have no webhooks configured, Stripe waits one hour after\ncreation to finalize the invoice.\n\nIf your invoice is configured to be billed by sending an email, then based on your\n[email settings](https://dashboard.stripe.com/account/billing/automatic),\nStripe will email the invoice to your customer and await payment. These\nemails can contain a link to a hosted page to pay the invoice.\n\nStripe applies any customer credit on the account before determining the\namount due for the invoice (i.e., the amount that will be actually\ncharged). If the amount due for the invoice is less than Stripe's [minimum allowed charge\nper currency](/docs/currencies#minimum-and-maximum-charge-amounts), the\ninvoice is automatically marked paid, and we add the amount due to the\ncustomer's credit balance which is applied to the next invoice.\n\nMore details on the customer's credit balance are\n[here](/docs/billing/customer/balance).\n\nRelated guide: [Send Invoices to Customers](/docs/billing/invoices/sending).\n", - "section_tag": "invoices", - "subsection_summaries": [ - { "anchor": "invoice_object", "curl_definition": null }, - { "anchor": "invoice_line_item_object", "curl_definition": null }, - { "anchor": "create_invoice", "curl_definition": "POST /v1/invoices" }, - { "anchor": "retrieve_invoice", "curl_definition": "GET /v1/invoices/:id" }, - { "anchor": "update_invoice", "curl_definition": "POST /v1/invoices/:id" }, - { "anchor": "delete_invoice", "curl_definition": "DELETE /v1/invoices/:id" }, - { "anchor": "finalize_invoice", "curl_definition": "POST /v1/invoices/:id/finalize" }, - { "anchor": "pay_invoice", "curl_definition": "POST /v1/invoices/:id/pay" }, - { "anchor": "send_invoice", "curl_definition": "POST /v1/invoices/:id/send" }, - { "anchor": "void_invoice", "curl_definition": "POST /v1/invoices/:id/void" }, - { - "anchor": "mark_uncollectible_invoice", - "curl_definition": "POST /v1/invoices/:id/mark_uncollectible" - }, - { "anchor": "invoice_lines", "curl_definition": "GET /v1/invoices/:id/lines" }, - { "anchor": "upcoming_invoice", "curl_definition": "GET /v1/invoices/upcoming" }, - { - "anchor": "upcoming_invoice_lines", - "curl_definition": "GET /v1/invoices/upcoming/lines" - }, - { "anchor": "list_invoices", "curl_definition": "GET /v1/invoices" }, - { "anchor": "search_invoices", "curl_definition": "GET /v1/invoices/search" } - ] - } - }, - "invoice_object": { - "title": "The Invoice object", - "group_title": "Billing", - "group_anchor": "billing", - "anchor": "invoice_object", - "section_anchor": "invoices", - "subsection_anchors": null, - "path": "/invoices/object", - "gate": false, - "display_on_load": false - }, - "invoice_line_item_object": { - "title": "The (Invoice) Line Item object", - "group_title": "Billing", - "group_anchor": "billing", - "anchor": "invoice_line_item_object", - "section_anchor": "invoices", - "subsection_anchors": null, - "path": "/invoices/line_item", - "gate": false, - "display_on_load": false - }, - "create_invoice": { - "title": "Create an invoice", - "group_title": "Billing", - "group_anchor": "billing", - "anchor": "create_invoice", - "section_anchor": "invoices", - "subsection_anchors": null, - "path": "/invoices/create", - "gate": false, - "display_on_load": false - }, - "retrieve_invoice": { - "title": "Retrieve an invoice", - "group_title": "Billing", - "group_anchor": "billing", - "anchor": "retrieve_invoice", - "section_anchor": "invoices", - "subsection_anchors": null, - "path": "/invoices/retrieve", - "gate": false, - "display_on_load": false - }, - "update_invoice": { - "title": "Update an invoice", - "group_title": "Billing", - "group_anchor": "billing", - "anchor": "update_invoice", - "section_anchor": "invoices", - "subsection_anchors": null, - "path": "/invoices/update", - "gate": false, - "display_on_load": false - }, - "delete_invoice": { - "title": "Delete a draft invoice", - "group_title": "Billing", - "group_anchor": "billing", - "anchor": "delete_invoice", - "section_anchor": "invoices", - "subsection_anchors": null, - "path": "/invoices/delete", - "gate": false, - "display_on_load": false - }, - "finalize_invoice": { - "title": "Finalize an invoice", - "group_title": "Billing", - "group_anchor": "billing", - "anchor": "finalize_invoice", - "section_anchor": "invoices", - "subsection_anchors": null, - "path": "/invoices/finalize", - "gate": false, - "display_on_load": false - }, - "pay_invoice": { - "title": "Pay an invoice", - "group_title": "Billing", - "group_anchor": "billing", - "anchor": "pay_invoice", - "section_anchor": "invoices", - "subsection_anchors": null, - "path": "/invoices/pay", - "gate": false, - "display_on_load": false - }, - "send_invoice": { - "title": "Send an invoice for manual payment", - "group_title": "Billing", - "group_anchor": "billing", - "anchor": "send_invoice", - "section_anchor": "invoices", - "subsection_anchors": null, - "path": "/invoices/send", - "gate": false, - "display_on_load": false - }, - "void_invoice": { - "title": "Void an invoice", - "group_title": "Billing", - "group_anchor": "billing", - "anchor": "void_invoice", - "section_anchor": "invoices", - "subsection_anchors": null, - "path": "/invoices/void", - "gate": false, - "display_on_load": false - }, - "mark_uncollectible_invoice": { - "title": "Mark an invoice as uncollectible", - "group_title": "Billing", - "group_anchor": "billing", - "anchor": "mark_uncollectible_invoice", - "section_anchor": "invoices", - "subsection_anchors": null, - "path": "/invoices/mark_uncollectible", - "gate": false, - "display_on_load": false - }, - "invoice_lines": { - "title": "Retrieve an invoice's line items", - "group_title": "Billing", - "group_anchor": "billing", - "anchor": "invoice_lines", - "section_anchor": "invoices", - "subsection_anchors": null, - "path": "/invoices/invoice_lines", - "gate": false, - "display_on_load": false - }, - "upcoming_invoice": { - "title": "Retrieve an upcoming invoice", - "group_title": "Billing", - "group_anchor": "billing", - "anchor": "upcoming_invoice", - "section_anchor": "invoices", - "subsection_anchors": null, - "path": "/invoices/upcoming", - "gate": false, - "display_on_load": false - }, - "upcoming_invoice_lines": { - "title": "Retrieve an upcoming invoice's line items", - "group_title": "Billing", - "group_anchor": "billing", - "anchor": "upcoming_invoice_lines", - "section_anchor": "invoices", - "subsection_anchors": null, - "path": "/invoices/upcoming_invoice_lines", - "gate": false, - "display_on_load": false - }, - "list_invoices": { - "title": "List all invoices", - "group_title": "Billing", - "group_anchor": "billing", - "anchor": "list_invoices", - "section_anchor": "invoices", - "subsection_anchors": null, - "path": "/invoices/list", - "gate": false, - "display_on_load": false - }, - "search_invoices": { - "title": "Search invoices", - "group_title": "Billing", - "group_anchor": "billing", - "anchor": "search_invoices", - "section_anchor": "invoices", - "subsection_anchors": null, - "path": "/invoices/search", - "gate": false, - "display_on_load": false - }, - "invoiceitems": { - "title": "Invoice Items", - "group_title": "Billing", - "group_anchor": "billing", - "anchor": "invoiceitems", - "section_anchor": "invoiceitems", - "subsection_anchors": [ - "invoiceitem_object", - "create_invoiceitem", - "retrieve_invoiceitem", - "update_invoiceitem", - "delete_invoiceitem", - "list_invoiceitems" - ], - "path": "/invoiceitems", - "gate": false, - "display_on_load": false, - "data": { - "section_type": "resource", - "title": "Invoice Items", - "description": "Sometimes you want to add a charge or credit to a customer, but actually\ncharge or credit the customer's card only at the end of a regular billing\ncycle. This is useful for combining several charges (to minimize\nper-transaction fees), or for having Stripe tabulate your usage-based billing\ntotals.\n\nRelated guide: [Subscription Invoices](/docs/billing/invoices/subscription#adding-upcoming-invoice-items).\n", - "section_tag": "invoiceitems", - "subsection_summaries": [ - { "anchor": "invoiceitem_object", "curl_definition": null }, - { "anchor": "create_invoiceitem", "curl_definition": "POST /v1/invoiceitems" }, - { "anchor": "retrieve_invoiceitem", "curl_definition": "GET /v1/invoiceitems/:id" }, - { "anchor": "update_invoiceitem", "curl_definition": "POST /v1/invoiceitems/:id" }, - { "anchor": "delete_invoiceitem", "curl_definition": "DELETE /v1/invoiceitems/:id" }, - { "anchor": "list_invoiceitems", "curl_definition": "GET /v1/invoiceitems" } - ] - } - }, - "invoiceitem_object": { - "title": "The invoiceitem object", - "group_title": "Billing", - "group_anchor": "billing", - "anchor": "invoiceitem_object", - "section_anchor": "invoiceitems", - "subsection_anchors": null, - "path": "/invoiceitems/object", - "gate": false, - "display_on_load": false - }, - "create_invoiceitem": { - "title": "Create an invoice item", - "group_title": "Billing", - "group_anchor": "billing", - "anchor": "create_invoiceitem", - "section_anchor": "invoiceitems", - "subsection_anchors": null, - "path": "/invoiceitems/create", - "gate": false, - "display_on_load": false - }, - "retrieve_invoiceitem": { - "title": "Retrieve an invoice item", - "group_title": "Billing", - "group_anchor": "billing", - "anchor": "retrieve_invoiceitem", - "section_anchor": "invoiceitems", - "subsection_anchors": null, - "path": "/invoiceitems/retrieve", - "gate": false, - "display_on_load": false - }, - "update_invoiceitem": { - "title": "Update an invoice item", - "group_title": "Billing", - "group_anchor": "billing", - "anchor": "update_invoiceitem", - "section_anchor": "invoiceitems", - "subsection_anchors": null, - "path": "/invoiceitems/update", - "gate": false, - "display_on_load": false - }, - "delete_invoiceitem": { - "title": "Delete an invoice item", - "group_title": "Billing", - "group_anchor": "billing", - "anchor": "delete_invoiceitem", - "section_anchor": "invoiceitems", - "subsection_anchors": null, - "path": "/invoiceitems/delete", - "gate": false, - "display_on_load": false - }, - "list_invoiceitems": { - "title": "List all invoice items", - "group_title": "Billing", - "group_anchor": "billing", - "anchor": "list_invoiceitems", - "section_anchor": "invoiceitems", - "subsection_anchors": null, - "path": "/invoiceitems/list", - "gate": false, - "display_on_load": false - }, - "plans": { - "title": "Plans", - "group_title": "Billing", - "group_anchor": "billing", - "anchor": "plans", - "section_anchor": "plans", - "subsection_anchors": [ - "plan_object", - "create_plan", - "retrieve_plan", - "update_plan", - "delete_plan", - "list_plans" - ], - "path": "/plans", - "gate": false, - "display_on_load": false, - "data": { - "section_type": "resource", - "title": "Plans", - "description": "You can now model subscriptions more flexibly using the [Prices API](#prices). It replaces the Plans API and is backwards compatible to simplify your migration.\n\nPlans define the base price, currency, and billing cycle for recurring purchases of products.\n[Products](#products) help you track inventory or provisioning, and plans help you track pricing. Different physical goods or levels of service should be represented by products, and pricing options should be represented by plans. This approach lets you change prices without having to change your provisioning scheme.\n\nFor example, you might have a single \"gold\" product that has plans for $10/month, $100/year, €9/month, and €90/year.\n\nRelated guides: [Set up a subscription](/docs/billing/subscriptions/set-up-subscription) and more about [products and prices](/docs/products-prices/overview).\n", - "section_tag": "plans", - "subsection_summaries": [ - { "anchor": "plan_object", "curl_definition": null }, - { "anchor": "create_plan", "curl_definition": "POST /v1/plans" }, - { "anchor": "retrieve_plan", "curl_definition": "GET /v1/plans/:id" }, - { "anchor": "update_plan", "curl_definition": "POST /v1/plans/:id" }, - { "anchor": "delete_plan", "curl_definition": "DELETE /v1/plans/:id" }, - { "anchor": "list_plans", "curl_definition": "GET /v1/plans" } - ] - } - }, - "plan_object": { - "title": "The plan object", - "group_title": "Billing", - "group_anchor": "billing", - "anchor": "plan_object", - "section_anchor": "plans", - "subsection_anchors": null, - "path": "/plans/object", - "gate": false, - "display_on_load": false - }, - "create_plan": { - "title": "Create a plan", - "group_title": "Billing", - "group_anchor": "billing", - "anchor": "create_plan", - "section_anchor": "plans", - "subsection_anchors": null, - "path": "/plans/create", - "gate": false, - "display_on_load": false - }, - "retrieve_plan": { - "title": "Retrieve a plan", - "group_title": "Billing", - "group_anchor": "billing", - "anchor": "retrieve_plan", - "section_anchor": "plans", - "subsection_anchors": null, - "path": "/plans/retrieve", - "gate": false, - "display_on_load": false - }, - "update_plan": { - "title": "Update a plan", - "group_title": "Billing", - "group_anchor": "billing", - "anchor": "update_plan", - "section_anchor": "plans", - "subsection_anchors": null, - "path": "/plans/update", - "gate": false, - "display_on_load": false - }, - "delete_plan": { - "title": "Delete a plan", - "group_title": "Billing", - "group_anchor": "billing", - "anchor": "delete_plan", - "section_anchor": "plans", - "subsection_anchors": null, - "path": "/plans/delete", - "gate": false, - "display_on_load": false - }, - "list_plans": { - "title": "List all plans", - "group_title": "Billing", - "group_anchor": "billing", - "anchor": "list_plans", - "section_anchor": "plans", - "subsection_anchors": null, - "path": "/plans/list", - "gate": false, - "display_on_load": false - }, - "quotes": { - "title": "Quotes", - "group_title": "Billing", - "group_anchor": "billing", - "anchor": "quotes", - "section_anchor": "quotes", - "subsection_anchors": [ - "quote_object", - "create_quote", - "retrieve_quote", - "update_quote", - "finalize_quote", - "accept_quote", - "cancel_quote", - "download_pdf_method", - "list_line_item", - "list_upfront_line_item", - "list_quote" - ], - "path": "/quotes", - "gate": false, - "display_on_load": false, - "data": { - "section_type": "resource", - "title": "Quote", - "description": "A Quote is a way to model prices that you'd like to provide to a customer.\nOnce accepted, it will automatically create an invoice, subscription or subscription schedule.\n", - "section_tag": "quotes", - "subsection_summaries": [ - { "anchor": "quote_object", "curl_definition": null }, - { "anchor": "create_quote", "curl_definition": "POST /v1/quotes" }, - { "anchor": "retrieve_quote", "curl_definition": "GET /v1/quotes/:id" }, - { "anchor": "update_quote", "curl_definition": "POST /v1/quotes/:id" }, - { "anchor": "finalize_quote", "curl_definition": "POST /v1/quotes/:id/finalize" }, - { "anchor": "accept_quote", "curl_definition": "POST /v1/quotes/:id/accept" }, - { "anchor": "cancel_quote", "curl_definition": "POST /v1/quotes/:id/cancel" }, - { - "anchor": "download_pdf_method", - "curl_definition": "GET https://files.stripe.com/v1/quotes/:id/pdf" - }, - { "anchor": "list_line_item", "curl_definition": "GET /v1/quotes/:id/line_items" }, - { - "anchor": "list_upfront_line_item", - "curl_definition": "GET /v1/quotes/:id/computed_upfront_line_items" - }, - { "anchor": "list_quote", "curl_definition": "GET /v1/quotes" } - ] - } - }, - "quote_object": { - "title": "The quote object", - "group_title": "Billing", - "group_anchor": "billing", - "anchor": "quote_object", - "section_anchor": "quotes", - "subsection_anchors": null, - "path": "/quotes/object", - "gate": false, - "display_on_load": false - }, - "create_quote": { - "title": "Create a quote", - "group_title": "Billing", - "group_anchor": "billing", - "anchor": "create_quote", - "section_anchor": "quotes", - "subsection_anchors": null, - "path": "/quotes/create", - "gate": false, - "display_on_load": false - }, - "retrieve_quote": { - "title": "Retrieve a quote", - "group_title": "Billing", - "group_anchor": "billing", - "anchor": "retrieve_quote", - "section_anchor": "quotes", - "subsection_anchors": null, - "path": "/quotes/retrieve", - "gate": false, - "display_on_load": false - }, - "update_quote": { - "title": "Update a quote", - "group_title": "Billing", - "group_anchor": "billing", - "anchor": "update_quote", - "section_anchor": "quotes", - "subsection_anchors": null, - "path": "/quotes/update", - "gate": false, - "display_on_load": false - }, - "finalize_quote": { - "title": "Finalize a quote", - "group_title": "Billing", - "group_anchor": "billing", - "anchor": "finalize_quote", - "section_anchor": "quotes", - "subsection_anchors": null, - "path": "/quotes/finalize", - "gate": false, - "display_on_load": false - }, - "accept_quote": { - "title": "Accept a quote", - "group_title": "Billing", - "group_anchor": "billing", - "anchor": "accept_quote", - "section_anchor": "quotes", - "subsection_anchors": null, - "path": "/quotes/accept", - "gate": false, - "display_on_load": false - }, - "cancel_quote": { - "title": "Cancel a quote", - "group_title": "Billing", - "group_anchor": "billing", - "anchor": "cancel_quote", - "section_anchor": "quotes", - "subsection_anchors": null, - "path": "/quotes/cancel", - "gate": false, - "display_on_load": false - }, - "download_pdf_method": { - "title": "Download quote PDF", - "group_title": "Billing", - "group_anchor": "billing", - "anchor": "download_pdf_method", - "section_anchor": "quotes", - "subsection_anchors": null, - "path": "/quotes/pdf", - "gate": false, - "display_on_load": false - }, - "list_line_item": { - "title": "Retrieve a quote's line items", - "group_title": "Billing", - "group_anchor": "billing", - "anchor": "list_line_item", - "section_anchor": "quotes", - "subsection_anchors": null, - "path": "/quotes/line_items/list", - "gate": false, - "display_on_load": false - }, - "list_upfront_line_item": { - "title": "Retrieve a quote's upfront line items", - "group_title": "Billing", - "group_anchor": "billing", - "anchor": "list_upfront_line_item", - "section_anchor": "quotes", - "subsection_anchors": null, - "path": "/quotes/line_items/upfront/list", - "gate": false, - "display_on_load": false - }, - "list_quote": { - "title": "List all quotes", - "group_title": "Billing", - "group_anchor": "billing", - "anchor": "list_quote", - "section_anchor": "quotes", - "subsection_anchors": null, - "path": "/quotes/list", - "gate": false, - "display_on_load": false - }, - "subscriptions": { - "title": "Subscriptions", - "group_title": "Billing", - "group_anchor": "billing", - "anchor": "subscriptions", - "section_anchor": "subscriptions", - "subsection_anchors": [ - "subscription_object", - "create_subscription", - "retrieve_subscription", - "update_subscription", - "cancel_subscription", - "list_subscriptions", - "subscriptions_search" - ], - "path": "/subscriptions", - "gate": false, - "display_on_load": false, - "data": { - "section_type": "resource", - "title": "Subscriptions", - "description": "Subscriptions allow you to charge a customer on a recurring basis.\n\nRelated guide: [Creating Subscriptions](/docs/billing/subscriptions/creating).\n", - "section_tag": "subscriptions", - "subsection_summaries": [ - { "anchor": "subscription_object", "curl_definition": null }, - { "anchor": "create_subscription", "curl_definition": "POST /v1/subscriptions" }, - { "anchor": "retrieve_subscription", "curl_definition": "GET /v1/subscriptions/:id" }, - { "anchor": "update_subscription", "curl_definition": "POST /v1/subscriptions/:id" }, - { "anchor": "cancel_subscription", "curl_definition": "DELETE /v1/subscriptions/:id" }, - { "anchor": "list_subscriptions", "curl_definition": "GET /v1/subscriptions" }, - { "anchor": "subscriptions_search", "curl_definition": "GET /v1/subscriptions/search" } - ] - } - }, - "subscription_object": { - "title": "The subscription object", - "group_title": "Billing", - "group_anchor": "billing", - "anchor": "subscription_object", - "section_anchor": "subscriptions", - "subsection_anchors": null, - "path": "/subscriptions/object", - "gate": false, - "display_on_load": false - }, - "create_subscription": { - "title": "Create a subscription", - "group_title": "Billing", - "group_anchor": "billing", - "anchor": "create_subscription", - "section_anchor": "subscriptions", - "subsection_anchors": null, - "path": "/subscriptions/create", - "gate": false, - "display_on_load": false - }, - "retrieve_subscription": { - "title": "Retrieve a subscription", - "group_title": "Billing", - "group_anchor": "billing", - "anchor": "retrieve_subscription", - "section_anchor": "subscriptions", - "subsection_anchors": null, - "path": "/subscriptions/retrieve", - "gate": false, - "display_on_load": false - }, - "update_subscription": { - "title": "Update a subscription", - "group_title": "Billing", - "group_anchor": "billing", - "anchor": "update_subscription", - "section_anchor": "subscriptions", - "subsection_anchors": null, - "path": "/subscriptions/update", - "gate": false, - "display_on_load": false - }, - "cancel_subscription": { - "title": "Cancel a subscription", - "group_title": "Billing", - "group_anchor": "billing", - "anchor": "cancel_subscription", - "section_anchor": "subscriptions", - "subsection_anchors": null, - "path": "/subscriptions/cancel", - "gate": false, - "display_on_load": false - }, - "list_subscriptions": { - "title": "List subscriptions", - "group_title": "Billing", - "group_anchor": "billing", - "anchor": "list_subscriptions", - "section_anchor": "subscriptions", - "subsection_anchors": null, - "path": "/subscriptions/list", - "gate": false, - "display_on_load": false - }, - "subscriptions_search": { - "title": "Search subscriptions", - "group_title": "Billing", - "group_anchor": "billing", - "anchor": "subscriptions_search", - "section_anchor": "subscriptions", - "subsection_anchors": null, - "path": "/subscriptions/search", - "gate": false, - "display_on_load": false - }, - "subscription_items": { - "title": "Subscription Items", - "group_title": "Billing", - "group_anchor": "billing", - "anchor": "subscription_items", - "section_anchor": "subscription_items", - "subsection_anchors": [ - "subscription_item_object", - "create_subscription_item", - "retrieve_subscription_item", - "update_subscription_item", - "delete_subscription_item", - "list_subscription_items" - ], - "path": "/subscription_items", - "gate": false, - "display_on_load": false, - "data": { - "section_type": "resource", - "title": "Subscription Items", - "description": "Subscription items allow you to create customer subscriptions with more than\none plan, making it easy to represent complex billing relationships.\n", - "section_tag": "subscription_items", - "subsection_summaries": [ - { "anchor": "subscription_item_object", "curl_definition": null }, - { "anchor": "create_subscription_item", "curl_definition": "POST /v1/subscription_items" }, - { - "anchor": "retrieve_subscription_item", - "curl_definition": "GET /v1/subscription_items/:id" - }, - { - "anchor": "update_subscription_item", - "curl_definition": "POST /v1/subscription_items/:id" - }, - { - "anchor": "delete_subscription_item", - "curl_definition": "DELETE /v1/subscription_items/:id" - }, - { "anchor": "list_subscription_items", "curl_definition": "GET /v1/subscription_items" } - ] - } - }, - "subscription_item_object": { - "title": "The subscription item object", - "group_title": "Billing", - "group_anchor": "billing", - "anchor": "subscription_item_object", - "section_anchor": "subscription_items", - "subsection_anchors": null, - "path": "/subscription_items/object", - "gate": false, - "display_on_load": false - }, - "create_subscription_item": { - "title": "Create a subscription item", - "group_title": "Billing", - "group_anchor": "billing", - "anchor": "create_subscription_item", - "section_anchor": "subscription_items", - "subsection_anchors": null, - "path": "/subscription_items/create", - "gate": false, - "display_on_load": false - }, - "retrieve_subscription_item": { - "title": "Retrieve a subscription item", - "group_title": "Billing", - "group_anchor": "billing", - "anchor": "retrieve_subscription_item", - "section_anchor": "subscription_items", - "subsection_anchors": null, - "path": "/subscription_items/retrieve", - "gate": false, - "display_on_load": false - }, - "update_subscription_item": { - "title": "Update a subscription item", - "group_title": "Billing", - "group_anchor": "billing", - "anchor": "update_subscription_item", - "section_anchor": "subscription_items", - "subsection_anchors": null, - "path": "/subscription_items/update", - "gate": false, - "display_on_load": false - }, - "delete_subscription_item": { - "title": "Delete a subscription item", - "group_title": "Billing", - "group_anchor": "billing", - "anchor": "delete_subscription_item", - "section_anchor": "subscription_items", - "subsection_anchors": null, - "path": "/subscription_items/delete", - "gate": false, - "display_on_load": false - }, - "list_subscription_items": { - "title": "List all subscription items", - "group_title": "Billing", - "group_anchor": "billing", - "anchor": "list_subscription_items", - "section_anchor": "subscription_items", - "subsection_anchors": null, - "path": "/subscription_items/list", - "gate": false, - "display_on_load": false - }, - "subscription_schedules": { - "title": "Subscription Schedules", - "group_title": "Billing", - "group_anchor": "billing", - "anchor": "subscription_schedules", - "section_anchor": "subscription_schedules", - "subsection_anchors": [ - "subscription_schedule_object", - "create_subscription_schedule", - "retrieve_subscription_schedule", - "update_subscription_schedule", - "cancel_subscription_schedule", - "release_subscription_schedule", - "list_subscription_schedules" - ], - "path": "/subscription_schedules", - "gate": false, - "display_on_load": false, - "data": { - "section_type": "resource", - "title": "Subscription Schedule", - "description": "A subscription schedule allows you to create and manage the lifecycle of a subscription by predefining expected changes.\n\nRelated guide: [Subscription Schedules](/docs/billing/subscriptions/subscription-schedules).\n", - "section_tag": "subscription_schedules", - "subsection_summaries": [ - { "anchor": "subscription_schedule_object", "curl_definition": null }, - { - "anchor": "create_subscription_schedule", - "curl_definition": "POST /v1/subscription_schedules" - }, - { - "anchor": "retrieve_subscription_schedule", - "curl_definition": "GET /v1/subscription_schedules/:id" - }, - { - "anchor": "update_subscription_schedule", - "curl_definition": "POST /v1/subscription_schedules/:id" - }, - { - "anchor": "cancel_subscription_schedule", - "curl_definition": "POST /v1/subscription_schedules/:id/cancel" - }, - { - "anchor": "release_subscription_schedule", - "curl_definition": "POST /v1/subscription_schedules/:id/release" - }, - { - "anchor": "list_subscription_schedules", - "curl_definition": "GET /v1/subscription_schedules" - } - ] - } - }, - "subscription_schedule_object": { - "title": "The schedule object", - "group_title": "Billing", - "group_anchor": "billing", - "anchor": "subscription_schedule_object", - "section_anchor": "subscription_schedules", - "subsection_anchors": null, - "path": "/subscription_schedules/object", - "gate": false, - "display_on_load": false - }, - "create_subscription_schedule": { - "title": "Create a schedule", - "group_title": "Billing", - "group_anchor": "billing", - "anchor": "create_subscription_schedule", - "section_anchor": "subscription_schedules", - "subsection_anchors": null, - "path": "/subscription_schedules/create", - "gate": false, - "display_on_load": false - }, - "retrieve_subscription_schedule": { - "title": "Retrieve a schedule", - "group_title": "Billing", - "group_anchor": "billing", - "anchor": "retrieve_subscription_schedule", - "section_anchor": "subscription_schedules", - "subsection_anchors": null, - "path": "/subscription_schedules/retrieve", - "gate": false, - "display_on_load": false - }, - "update_subscription_schedule": { - "title": "Update a schedule", - "group_title": "Billing", - "group_anchor": "billing", - "anchor": "update_subscription_schedule", - "section_anchor": "subscription_schedules", - "subsection_anchors": null, - "path": "/subscription_schedules/update", - "gate": false, - "display_on_load": false - }, - "cancel_subscription_schedule": { - "title": "Cancel a schedule", - "group_title": "Billing", - "group_anchor": "billing", - "anchor": "cancel_subscription_schedule", - "section_anchor": "subscription_schedules", - "subsection_anchors": null, - "path": "/subscription_schedules/cancel", - "gate": false, - "display_on_load": false - }, - "release_subscription_schedule": { - "title": "Release a schedule", - "group_title": "Billing", - "group_anchor": "billing", - "anchor": "release_subscription_schedule", - "section_anchor": "subscription_schedules", - "subsection_anchors": null, - "path": "/subscription_schedules/release", - "gate": false, - "display_on_load": false - }, - "list_subscription_schedules": { - "title": "List all schedules", - "group_title": "Billing", - "group_anchor": "billing", - "anchor": "list_subscription_schedules", - "section_anchor": "subscription_schedules", - "subsection_anchors": null, - "path": "/subscription_schedules/list", - "gate": false, - "display_on_load": false - }, - "test_clocks": { - "title": "Test Clocks", - "group_title": "Billing", - "group_anchor": "billing", - "anchor": "test_clocks", - "section_anchor": "test_clocks", - "subsection_anchors": [ - "test_clock_object", - "create_test_clock", - "retrieve_test_clock", - "delete_test_clock", - "advance_test_clock", - "list_test_clocks" - ], - "path": "/test_clocks", - "gate": false, - "display_on_load": false, - "data": { - "section_type": "resource", - "title": "Test Clocks", - "description": "A test clock enables deterministic control over objects in testmode. With a test clock, you can create\nobjects at a frozen time in the past or future, and advance to a specific future time to observe webhooks and state changes. After the clock advances,\nyou can either validate the current state of your scenario (and test your assumptions), change the current state of your scenario (and test more complex scenarios), or keep advancing forward in time.\n", - "section_tag": "test_clocks", - "subsection_summaries": [ - { "anchor": "test_clock_object", "curl_definition": null }, - { "anchor": "create_test_clock", "curl_definition": "POST /v1/test_helpers/test_clocks" }, - { - "anchor": "retrieve_test_clock", - "curl_definition": "GET /v1/test_helpers/test_clocks/:id" - }, - { - "anchor": "delete_test_clock", - "curl_definition": "DELETE /v1/test_helpers/test_clocks/:id" - }, - { - "anchor": "advance_test_clock", - "curl_definition": "POST /v1/test_helpers/test_clocks/:id/advance" - }, - { "anchor": "list_test_clocks", "curl_definition": "GET /v1/test_helpers/test_clocks" } - ] - } - }, - "test_clock_object": { - "title": "The test clock object", - "group_title": "Billing", - "group_anchor": "billing", - "anchor": "test_clock_object", - "section_anchor": "test_clocks", - "subsection_anchors": null, - "path": "/test_clocks/object", - "gate": false, - "display_on_load": false - }, - "create_test_clock": { - "title": "Create a test clock", - "group_title": "Billing", - "group_anchor": "billing", - "anchor": "create_test_clock", - "section_anchor": "test_clocks", - "subsection_anchors": null, - "path": "/test_clocks/create", - "gate": false, - "display_on_load": false - }, - "retrieve_test_clock": { - "title": "Retrieve a test clock", - "group_title": "Billing", - "group_anchor": "billing", - "anchor": "retrieve_test_clock", - "section_anchor": "test_clocks", - "subsection_anchors": null, - "path": "/test_clocks/retrieve", - "gate": false, - "display_on_load": false - }, - "delete_test_clock": { - "title": "Delete a test clock", - "group_title": "Billing", - "group_anchor": "billing", - "anchor": "delete_test_clock", - "section_anchor": "test_clocks", - "subsection_anchors": null, - "path": "/test_clocks/delete", - "gate": false, - "display_on_load": false - }, - "advance_test_clock": { - "title": "Advance a test clock", - "group_title": "Billing", - "group_anchor": "billing", - "anchor": "advance_test_clock", - "section_anchor": "test_clocks", - "subsection_anchors": null, - "path": "/test_clocks/advance", - "gate": false, - "display_on_load": false - }, - "list_test_clocks": { - "title": "List all test clocks", - "group_title": "Billing", - "group_anchor": "billing", - "anchor": "list_test_clocks", - "section_anchor": "test_clocks", - "subsection_anchors": null, - "path": "/test_clocks/list", - "gate": false, - "display_on_load": false - }, - "usage_records": { - "title": "Usage Records", - "group_title": "Billing", - "group_anchor": "billing", - "anchor": "usage_records", - "section_anchor": "usage_records", - "subsection_anchors": [ - "usage_record_object", - "usage_record_create", - "usage_record_summary_all" - ], - "path": "/usage_records", - "gate": false, - "display_on_load": false, - "data": { - "section_type": "resource", - "title": "Usage Records", - "description": "Usage records allow you to report customer usage and metrics to Stripe for\nmetered billing of subscription prices.\n\nRelated guide: [Metered Billing](/docs/billing/subscriptions/metered-billing).\n", - "section_tag": "usage_records", - "subsection_summaries": [ - { "anchor": "usage_record_object", "curl_definition": null }, - { - "anchor": "usage_record_create", - "curl_definition": "POST /v1/subscription_items/:id/usage_records" - }, - { - "anchor": "usage_record_summary_all", - "curl_definition": "GET /v1/subscription_items/:id/usage_record_summaries" - } - ] - } - }, - "usage_record_object": { - "title": "The usage record object", - "group_title": "Billing", - "group_anchor": "billing", - "anchor": "usage_record_object", - "section_anchor": "usage_records", - "subsection_anchors": null, - "path": "/usage_records/object", - "gate": false, - "display_on_load": false - }, - "usage_record_create": { - "title": "Create a usage record", - "group_title": "Billing", - "group_anchor": "billing", - "anchor": "usage_record_create", - "section_anchor": "usage_records", - "subsection_anchors": null, - "path": "/usage_records/create", - "gate": false, - "display_on_load": false - }, - "usage_record_summary_all": { - "title": "List all subscription item period summaries", - "group_title": "Billing", - "group_anchor": "billing", - "anchor": "usage_record_summary_all", - "section_anchor": "usage_records", - "subsection_anchors": null, - "path": "/usage_records/subscription_item_summary_list", - "gate": false, - "display_on_load": false - }, - "accounts": { - "title": "Accounts", - "group_title": "Connect", - "group_anchor": "connect", - "anchor": "accounts", - "section_anchor": "accounts", - "subsection_anchors": [ - "account_object", - "create_account", - "retrieve_account", - "update_account", - "delete_account", - "reject_account", - "list_accounts", - "login_link_object", - "create_login_link" - ], - "path": "/accounts", - "gate": false, - "display_on_load": false, - "data": { - "section_type": "resource", - "title": "Accounts", - "description": "This is an object representing a Stripe account. You can retrieve it to see\nproperties on the account like its current e-mail address or if the account is\nenabled yet to make live charges.\n\nSome properties, marked below, are available only to platforms that want to\n[create and manage Express or Custom accounts](/docs/connect/accounts).\n", - "section_tag": "accounts", - "subsection_summaries": [ - { "anchor": "account_object", "curl_definition": null }, - { "anchor": "create_account", "curl_definition": "POST /v1/accounts" }, - { "anchor": "retrieve_account", "curl_definition": "GET /v1/accounts/:id" }, - { "anchor": "update_account", "curl_definition": "POST /v1/accounts/:id" }, - { "anchor": "delete_account", "curl_definition": "DELETE /v1/accounts/:id" }, - { "anchor": "reject_account", "curl_definition": "POST /v1/accounts/:id/reject" }, - { "anchor": "list_accounts", "curl_definition": "GET /v1/accounts" }, - { "anchor": "login_link_object", "curl_definition": null }, - { "anchor": "create_login_link", "curl_definition": "POST /v1/accounts/:id/login_links" } - ] - } - }, - "account_object": { - "title": "The account object", - "group_title": "Connect", - "group_anchor": "connect", - "anchor": "account_object", - "section_anchor": "accounts", - "subsection_anchors": null, - "path": "/accounts/object", - "gate": false, - "display_on_load": false - }, - "create_account": { - "title": "Create an account", - "group_title": "Connect", - "group_anchor": "connect", - "anchor": "create_account", - "section_anchor": "accounts", - "subsection_anchors": null, - "path": "/accounts/create", - "gate": false, - "display_on_load": false - }, - "retrieve_account": { - "title": "Retrieve account", - "group_title": "Connect", - "group_anchor": "connect", - "anchor": "retrieve_account", - "section_anchor": "accounts", - "subsection_anchors": null, - "path": "/accounts/retrieve", - "gate": false, - "display_on_load": false - }, - "update_account": { - "title": "Update an account", - "group_title": "Connect", - "group_anchor": "connect", - "anchor": "update_account", - "section_anchor": "accounts", - "subsection_anchors": null, - "path": "/accounts/update", - "gate": false, - "display_on_load": false - }, - "delete_account": { - "title": "Delete an account", - "group_title": "Connect", - "group_anchor": "connect", - "anchor": "delete_account", - "section_anchor": "accounts", - "subsection_anchors": null, - "path": "/accounts/delete", - "gate": false, - "display_on_load": false - }, - "reject_account": { - "title": "Reject an account", - "group_title": "Connect", - "group_anchor": "connect", - "anchor": "reject_account", - "section_anchor": "accounts", - "subsection_anchors": null, - "path": "/account/reject", - "gate": false, - "display_on_load": false - }, - "list_accounts": { - "title": "List all connected accounts", - "group_title": "Connect", - "group_anchor": "connect", - "anchor": "list_accounts", - "section_anchor": "accounts", - "subsection_anchors": null, - "path": "/accounts/list", - "gate": false, - "display_on_load": false - }, - "login_link_object": { - "title": "The login link object", - "group_title": "Connect", - "group_anchor": "connect", - "anchor": "login_link_object", - "section_anchor": "accounts", - "subsection_anchors": null, - "path": "/account/login_link", - "gate": false, - "display_on_load": false - }, - "create_login_link": { - "title": "Create a login link", - "group_title": "Connect", - "group_anchor": "connect", - "anchor": "create_login_link", - "section_anchor": "accounts", - "subsection_anchors": null, - "path": "/account/create_login_link", - "gate": false, - "display_on_load": false - }, - "account_links": { - "title": "Account Links", - "group_title": "Connect", - "group_anchor": "connect", - "anchor": "account_links", - "section_anchor": "account_links", - "subsection_anchors": ["account_link_object", "create_account_link"], - "path": "/account_links", - "gate": false, - "display_on_load": false, - "data": { - "section_type": "resource", - "title": "Account Links", - "description": "Account Links are the means by which a Connect platform grants a connected account permission to access\nStripe-hosted applications, such as Connect Onboarding.\n\nRelated guide: [Connect Onboarding](/docs/connect/connect-onboarding).\n", - "section_tag": "account_links", - "subsection_summaries": [ - { "anchor": "account_link_object", "curl_definition": null }, - { "anchor": "create_account_link", "curl_definition": "POST /v1/account_links" } - ] - } - }, - "account_link_object": { - "title": "The account link object", - "group_title": "Connect", - "group_anchor": "connect", - "anchor": "account_link_object", - "section_anchor": "account_links", - "subsection_anchors": null, - "path": "/account_links/object", - "gate": false, - "display_on_load": false - }, - "create_account_link": { - "title": "Create an account link", - "group_title": "Connect", - "group_anchor": "connect", - "anchor": "create_account_link", - "section_anchor": "account_links", - "subsection_anchors": null, - "path": "/account_links/create", - "gate": false, - "display_on_load": false - }, - "account_sessions": { - "title": "Account Sessions", - "group_title": "Connect", - "group_anchor": "connect", - "anchor": "account_sessions", - "section_anchor": "account_sessions", - "subsection_anchors": ["account_session_object", "create_account_session"], - "path": "/account_sessions", - "gate": true, - "display_on_load": false, - "data": { - "section_type": "resource", - "title": "Account Session", - "description": "An AccountSession allows a Connect platform to grant access to a connected account in Connect embedded UIs.\n\nWe recommend that you create an AccountSession each time you need to display an embedded UI\nto your user. Do not save AccountSessions to your database as they expire relatively\nquickly, and cannot be used more than once.\n\nRelated guide: [Connect embedded UIs](/docs/connect/get-started-connect-embedded-uis).\n", - "section_tag": "account_sessions", - "subsection_summaries": [ - { "anchor": "account_session_object", "curl_definition": null }, - { "anchor": "create_account_session", "curl_definition": "POST /v1/account_sessions" } - ] - } - }, - "account_session_object": { - "title": "The account session object", - "group_title": "Connect", - "group_anchor": "connect", - "anchor": "account_session_object", - "section_anchor": "account_sessions", - "subsection_anchors": null, - "path": "/account_sessions/object", - "gate": false, - "display_on_load": false - }, - "create_account_session": { - "title": "Create an Account Session", - "group_title": "Connect", - "group_anchor": "connect", - "anchor": "create_account_session", - "section_anchor": "account_sessions", - "subsection_anchors": null, - "path": "/account_sessions/create", - "gate": false, - "display_on_load": false - }, - "application_fees": { - "title": "Application Fees", - "group_title": "Connect", - "group_anchor": "connect", - "anchor": "application_fees", - "section_anchor": "application_fees", - "subsection_anchors": [ - "application_fee_object", - "retrieve_application_fee", - "list_application_fees" - ], - "path": "/application_fees", - "gate": false, - "display_on_load": false, - "data": { - "section_type": "resource", - "title": "Application Fees", - "description": "When you collect a transaction fee on top of a charge made for your user\n(using [Connect](/docs/connect)), an `Application Fee` object is created in\nyour account. You can list, retrieve, and refund application fees.\n\nRelated guide: [Collecting Application Fees](/docs/connect/direct-charges#collecting-fees).\n", - "section_tag": "application_fees", - "subsection_summaries": [ - { "anchor": "application_fee_object", "curl_definition": null }, - { "anchor": "retrieve_application_fee", "curl_definition": "GET /v1/application_fees/:id" }, - { "anchor": "list_application_fees", "curl_definition": "GET /v1/application_fees" } - ] - } - }, - "application_fee_object": { - "title": "The application fee object", - "group_title": "Connect", - "group_anchor": "connect", - "anchor": "application_fee_object", - "section_anchor": "application_fees", - "subsection_anchors": null, - "path": "/application_fees/object", - "gate": false, - "display_on_load": false - }, - "retrieve_application_fee": { - "title": "Retrieve an application fee", - "group_title": "Connect", - "group_anchor": "connect", - "anchor": "retrieve_application_fee", - "section_anchor": "application_fees", - "subsection_anchors": null, - "path": "/application_fees/retrieve", - "gate": false, - "display_on_load": false - }, - "list_application_fees": { - "title": "List all application fees", - "group_title": "Connect", - "group_anchor": "connect", - "anchor": "list_application_fees", - "section_anchor": "application_fees", - "subsection_anchors": null, - "path": "/application_fees/list", - "gate": false, - "display_on_load": false - }, - "fee_refunds": { - "title": "Application Fee Refunds", - "group_title": "Connect", - "group_anchor": "connect", - "anchor": "fee_refunds", - "section_anchor": "fee_refunds", - "subsection_anchors": [ - "fee_refund_object", - "create_fee_refund", - "retrieve_fee_refund", - "update_fee_refund", - "list_fee_refunds" - ], - "path": "/fee_refunds", - "gate": false, - "display_on_load": false, - "data": { - "section_type": "resource", - "title": "Application Fee Refunds", - "description": "`Application Fee Refund` objects allow you to refund an application fee that\nhas previously been created but not yet refunded. Funds will be refunded to\nthe Stripe account from which the fee was originally collected.\n\nRelated guide: [Refunding Application Fees](/docs/connect/destination-charges#refunding-app-fee).\n", - "section_tag": "fee_refunds", - "subsection_summaries": [ - { "anchor": "fee_refund_object", "curl_definition": null }, - { - "anchor": "create_fee_refund", - "curl_definition": "POST /v1/application_fees/:id/refunds" - }, - { - "anchor": "retrieve_fee_refund", - "curl_definition": "GET /v1/application_fees/:id/refunds/:id" - }, - { - "anchor": "update_fee_refund", - "curl_definition": "POST /v1/application_fees/:id/refunds/:id" - }, - { "anchor": "list_fee_refunds", "curl_definition": "GET /v1/application_fees/:id/refunds" } - ] - } - }, - "fee_refund_object": { - "title": "The application fee refund object", - "group_title": "Connect", - "group_anchor": "connect", - "anchor": "fee_refund_object", - "section_anchor": "fee_refunds", - "subsection_anchors": null, - "path": "/fee_refunds/object", - "gate": false, - "display_on_load": false - }, - "create_fee_refund": { - "title": "Create an application fee refund", - "group_title": "Connect", - "group_anchor": "connect", - "anchor": "create_fee_refund", - "section_anchor": "fee_refunds", - "subsection_anchors": null, - "path": "/fee_refunds/create", - "gate": false, - "display_on_load": false - }, - "retrieve_fee_refund": { - "title": "Retrieve an application fee refund", - "group_title": "Connect", - "group_anchor": "connect", - "anchor": "retrieve_fee_refund", - "section_anchor": "fee_refunds", - "subsection_anchors": null, - "path": "/fee_refunds/retrieve", - "gate": false, - "display_on_load": false - }, - "update_fee_refund": { - "title": "Update an application fee refund", - "group_title": "Connect", - "group_anchor": "connect", - "anchor": "update_fee_refund", - "section_anchor": "fee_refunds", - "subsection_anchors": null, - "path": "/fee_refunds/update", - "gate": false, - "display_on_load": false - }, - "list_fee_refunds": { - "title": "List all application fee refunds", - "group_title": "Connect", - "group_anchor": "connect", - "anchor": "list_fee_refunds", - "section_anchor": "fee_refunds", - "subsection_anchors": null, - "path": "/fee_refunds/list", - "gate": false, - "display_on_load": false - }, - "capabilities": { - "title": "Capabilities", - "group_title": "Connect", - "group_anchor": "connect", - "anchor": "capabilities", - "section_anchor": "capabilities", - "subsection_anchors": [ - "capability_object", - "retrieve_capability", - "update_capability", - "list_capability" - ], - "path": "/capabilities", - "gate": false, - "display_on_load": false, - "data": { - "section_type": "resource", - "title": "Capabilities", - "description": "This is an object representing a capability for a Stripe account.\n\nRelated guide: [Account capabilities](/docs/connect/account-capabilities).\n", - "section_tag": "capabilities", - "subsection_summaries": [ - { "anchor": "capability_object", "curl_definition": null }, - { - "anchor": "retrieve_capability", - "curl_definition": "GET /v1/accounts/:id/capabilities/:id" - }, - { - "anchor": "update_capability", - "curl_definition": "POST /v1/accounts/:id/capabilities/:id" - }, - { "anchor": "list_capability", "curl_definition": "GET /v1/accounts/:id/capabilities" } - ] - } - }, - "capability_object": { - "title": "The capability object", - "group_title": "Connect", - "group_anchor": "connect", - "anchor": "capability_object", - "section_anchor": "capabilities", - "subsection_anchors": null, - "path": "/capabilities/object", - "gate": false, - "display_on_load": false - }, - "retrieve_capability": { - "title": "Retrieve an Account Capability", - "group_title": "Connect", - "group_anchor": "connect", - "anchor": "retrieve_capability", - "section_anchor": "capabilities", - "subsection_anchors": null, - "path": "/capabilities/retrieve", - "gate": false, - "display_on_load": false - }, - "update_capability": { - "title": "Update an Account Capability", - "group_title": "Connect", - "group_anchor": "connect", - "anchor": "update_capability", - "section_anchor": "capabilities", - "subsection_anchors": null, - "path": "/capabilities/update", - "gate": false, - "display_on_load": false - }, - "list_capability": { - "title": "List all account capabilities", - "group_title": "Connect", - "group_anchor": "connect", - "anchor": "list_capability", - "section_anchor": "capabilities", - "subsection_anchors": null, - "path": "/capabilities/list", - "gate": false, - "display_on_load": false - }, - "country_specs": { - "title": "Country Specs", - "group_title": "Connect", - "group_anchor": "connect", - "anchor": "country_specs", - "section_anchor": "country_specs", - "subsection_anchors": ["country_spec_object", "list_country_specs", "retrieve_country_spec"], - "path": "/country_specs", - "gate": false, - "display_on_load": false, - "data": { - "section_type": "resource", - "title": "Country Specs", - "description": "Stripe needs to collect certain pieces of information about each account\ncreated. These requirements can differ depending on the account's country. The\nCountry Specs API makes these rules available to your integration.\n\nYou can also view the information from this API call as [an online\nguide](/docs/connect/required-verification-information).\n", - "section_tag": "country_specs", - "subsection_summaries": [ - { "anchor": "country_spec_object", "curl_definition": null }, - { "anchor": "list_country_specs", "curl_definition": "GET /v1/country_specs" }, - { "anchor": "retrieve_country_spec", "curl_definition": "GET /v1/country_specs/:id" } - ] - } - }, - "country_spec_object": { - "title": "The country spec object", - "group_title": "Connect", - "group_anchor": "connect", - "anchor": "country_spec_object", - "section_anchor": "country_specs", - "subsection_anchors": null, - "path": "/country_specs/object", - "gate": false, - "display_on_load": false - }, - "list_country_specs": { - "title": "List Country Specs", - "group_title": "Connect", - "group_anchor": "connect", - "anchor": "list_country_specs", - "section_anchor": "country_specs", - "subsection_anchors": null, - "path": "/country_specs/list", - "gate": false, - "display_on_load": false - }, - "retrieve_country_spec": { - "title": "Retrieve a Country Spec", - "group_title": "Connect", - "group_anchor": "connect", - "anchor": "retrieve_country_spec", - "section_anchor": "country_specs", - "subsection_anchors": null, - "path": "/country_specs/retrieve", - "gate": false, - "display_on_load": false - }, - "external_accounts": { - "title": "External Accounts", - "group_title": "Connect", - "group_anchor": "connect", - "anchor": "external_accounts", - "section_anchor": "external_accounts", - "subsection_anchors": [ - "account_bank_account_object", - "account_create_bank_account", - "account_retrieve_bank_account", - "account_update_bank_account", - "account_delete_bank_account", - "account_list_bank_accounts", - "account_card_object", - "account_create_card", - "account_retrieve_card", - "account_update_card", - "account_delete_card", - "account_list_cards" - ], - "path": "/external_accounts", - "gate": false, - "display_on_load": false, - "data": { - "section_type": "resource", - "title": "External Accounts", - "description": "External Accounts are transfer destinations on `Account` objects for\n[connected accounts](/docs/connect/accounts). They can be bank accounts or\ndebit cards.\n\n[Bank accounts](/docs/api#customer_bank_account_object) and [debit\ncards](/docs/api#card_object) can also be used as payment sources\non regular charges, and are documented in the links above.\n\nRelated guide: [Setting Bank and Debit Card Payouts](/docs/connect/bank-debit-card-payouts).\n", - "section_tag": "external_accounts", - "subsection_summaries": [ - { "anchor": "account_bank_account_object", "curl_definition": null }, - { - "anchor": "account_create_bank_account", - "curl_definition": "POST /v1/accounts/:id/external_accounts" - }, - { - "anchor": "account_retrieve_bank_account", - "curl_definition": "GET /v1/accounts/:id/external_accounts/:id" - }, - { - "anchor": "account_update_bank_account", - "curl_definition": "POST /v1/accounts/:id/external_accounts/:id" - }, - { - "anchor": "account_delete_bank_account", - "curl_definition": "DELETE /v1/accounts/:id/external_accounts/:id" - }, - { - "anchor": "account_list_bank_accounts", - "curl_definition": "GET /v1/accounts/:id/external_accounts?object=bank_account" - }, - { "anchor": "account_card_object", "curl_definition": null }, - { - "anchor": "account_create_card", - "curl_definition": "POST /v1/accounts/:id/external_accounts" - }, - { - "anchor": "account_retrieve_card", - "curl_definition": "GET /v1/accounts/:id/external_accounts/:id" - }, - { - "anchor": "account_update_card", - "curl_definition": "POST /v1/accounts/:id/external_accounts/:id" - }, - { - "anchor": "account_delete_card", - "curl_definition": "DELETE /v1/accounts/:id/external_accounts/:id" - }, - { - "anchor": "account_list_cards", - "curl_definition": "GET /v1/accounts/:id/external_accounts?object=card" - } - ] - } - }, - "account_bank_account_object": { - "title": "The (account) bank account object", - "group_title": "Connect", - "group_anchor": "connect", - "anchor": "account_bank_account_object", - "section_anchor": "external_accounts", - "subsection_anchors": null, - "path": "/external_account_bank_accounts/object", - "gate": false, - "display_on_load": false - }, - "account_create_bank_account": { - "title": "Create a bank account", - "group_title": "Connect", - "group_anchor": "connect", - "anchor": "account_create_bank_account", - "section_anchor": "external_accounts", - "subsection_anchors": null, - "path": "/external_account_bank_accounts/create", - "gate": false, - "display_on_load": false - }, - "account_retrieve_bank_account": { - "title": "Retrieve a bank account", - "group_title": "Connect", - "group_anchor": "connect", - "anchor": "account_retrieve_bank_account", - "section_anchor": "external_accounts", - "subsection_anchors": null, - "path": "/external_account_bank_accounts/retrieve", - "gate": false, - "display_on_load": false - }, - "account_update_bank_account": { - "title": "Update a bank account", - "group_title": "Connect", - "group_anchor": "connect", - "anchor": "account_update_bank_account", - "section_anchor": "external_accounts", - "subsection_anchors": null, - "path": "/external_account_bank_accounts/update", - "gate": false, - "display_on_load": false - }, - "account_delete_bank_account": { - "title": "Delete a bank account", - "group_title": "Connect", - "group_anchor": "connect", - "anchor": "account_delete_bank_account", - "section_anchor": "external_accounts", - "subsection_anchors": null, - "path": "/external_account_bank_accounts/delete", - "gate": false, - "display_on_load": false - }, - "account_list_bank_accounts": { - "title": "List all bank accounts", - "group_title": "Connect", - "group_anchor": "connect", - "anchor": "account_list_bank_accounts", - "section_anchor": "external_accounts", - "subsection_anchors": null, - "path": "/external_account_bank_accounts/list", - "gate": false, - "display_on_load": false - }, - "account_card_object": { - "title": "The (account) card object", - "group_title": "Connect", - "group_anchor": "connect", - "anchor": "account_card_object", - "section_anchor": "external_accounts", - "subsection_anchors": null, - "path": "/external_account_cards/object", - "gate": false, - "display_on_load": false - }, - "account_create_card": { - "title": "Create a card", - "group_title": "Connect", - "group_anchor": "connect", - "anchor": "account_create_card", - "section_anchor": "external_accounts", - "subsection_anchors": null, - "path": "/external_account_cards/create", - "gate": false, - "display_on_load": false - }, - "account_retrieve_card": { - "title": "Retrieve a card", - "group_title": "Connect", - "group_anchor": "connect", - "anchor": "account_retrieve_card", - "section_anchor": "external_accounts", - "subsection_anchors": null, - "path": "/external_account_cards/retrieve", - "gate": false, - "display_on_load": false - }, - "account_update_card": { - "title": "Update a card", - "group_title": "Connect", - "group_anchor": "connect", - "anchor": "account_update_card", - "section_anchor": "external_accounts", - "subsection_anchors": null, - "path": "/external_account_cards/update", - "gate": false, - "display_on_load": false - }, - "account_delete_card": { - "title": "Delete a card", - "group_title": "Connect", - "group_anchor": "connect", - "anchor": "account_delete_card", - "section_anchor": "external_accounts", - "subsection_anchors": null, - "path": "/external_account_cards/delete", - "gate": false, - "display_on_load": false - }, - "account_list_cards": { - "title": "List all cards", - "group_title": "Connect", - "group_anchor": "connect", - "anchor": "account_list_cards", - "section_anchor": "external_accounts", - "subsection_anchors": null, - "path": "/external_account_cards/list", - "gate": false, - "display_on_load": false - }, - "persons": { - "title": "Persons", - "group_title": "Connect", - "group_anchor": "connect", - "anchor": "persons", - "section_anchor": "persons", - "subsection_anchors": [ - "person_object", - "create_person", - "retrieve_person", - "update_person", - "delete_person", - "list_person" - ], - "path": "/persons", - "gate": false, - "display_on_load": false, - "data": { - "section_type": "resource", - "title": "Person", - "description": "This is an object representing a person associated with a Stripe account.\n\nA platform cannot access a Standard or Express account's persons after the account starts onboarding, such as after generating an account link for the account.\nSee the [Standard onboarding](/docs/connect/standard-accounts) or [Express onboarding documentation](/docs/connect/express-accounts) for information about platform pre-filling and account onboarding steps.\n\nRelated guide: [Handling Identity Verification with the API](/docs/connect/identity-verification-api#person-information).\n", - "section_tag": "persons", - "subsection_summaries": [ - { "anchor": "person_object", "curl_definition": null }, - { "anchor": "create_person", "curl_definition": "POST /v1/accounts/:id/persons" }, - { "anchor": "retrieve_person", "curl_definition": "GET /v1/accounts/:id/persons/:id" }, - { "anchor": "update_person", "curl_definition": "POST /v1/accounts/:id/persons/:id" }, - { "anchor": "delete_person", "curl_definition": "DELETE /v1/accounts/:id/persons/:id" }, - { "anchor": "list_person", "curl_definition": "GET /v1/accounts/:id/persons" } - ] - } - }, - "person_object": { - "title": "The person object", - "group_title": "Connect", - "group_anchor": "connect", - "anchor": "person_object", - "section_anchor": "persons", - "subsection_anchors": null, - "path": "/persons/object", - "gate": false, - "display_on_load": false - }, - "create_person": { - "title": "Create a person", - "group_title": "Connect", - "group_anchor": "connect", - "anchor": "create_person", - "section_anchor": "persons", - "subsection_anchors": null, - "path": "/persons/create", - "gate": false, - "display_on_load": false - }, - "retrieve_person": { - "title": "Retrieve a person", - "group_title": "Connect", - "group_anchor": "connect", - "anchor": "retrieve_person", - "section_anchor": "persons", - "subsection_anchors": null, - "path": "/persons/retrieve", - "gate": false, - "display_on_load": false - }, - "update_person": { - "title": "Update a person", - "group_title": "Connect", - "group_anchor": "connect", - "anchor": "update_person", - "section_anchor": "persons", - "subsection_anchors": null, - "path": "/persons/update", - "gate": false, - "display_on_load": false - }, - "delete_person": { - "title": "Delete a person", - "group_title": "Connect", - "group_anchor": "connect", - "anchor": "delete_person", - "section_anchor": "persons", - "subsection_anchors": null, - "path": "/persons/delete", - "gate": false, - "display_on_load": false - }, - "list_person": { - "title": "List all persons", - "group_title": "Connect", - "group_anchor": "connect", - "anchor": "list_person", - "section_anchor": "persons", - "subsection_anchors": null, - "path": "/persons/list", - "gate": false, - "display_on_load": false - }, - "topups": { - "title": "Top-ups", - "group_title": "Connect", - "group_anchor": "connect", - "anchor": "topups", - "section_anchor": "topups", - "subsection_anchors": [ - "topup_object", - "create_topup", - "retrieve_topup", - "update_topup", - "list_topups", - "cancel_topup" - ], - "path": "/topups", - "gate": false, - "display_on_load": false, - "data": { - "section_type": "resource", - "title": "Top-ups", - "description": "To top up your Stripe balance, you create a top-up object. You can retrieve\nindividual top-ups, as well as list all top-ups. Top-ups are identified by a\nunique, random ID.\n\nRelated guide: [Topping Up your Platform Account](/docs/connect/top-ups).\n", - "section_tag": "topups", - "subsection_summaries": [ - { "anchor": "topup_object", "curl_definition": null }, - { "anchor": "create_topup", "curl_definition": "POST /v1/topups" }, - { "anchor": "retrieve_topup", "curl_definition": "GET /v1/topups/:id" }, - { "anchor": "update_topup", "curl_definition": "POST /v1/topups/:id" }, - { "anchor": "list_topups", "curl_definition": "GET /v1/topups" }, - { "anchor": "cancel_topup", "curl_definition": "POST /v1/topups/:id/cancel" } - ] - } - }, - "topup_object": { - "title": "The top-up object", - "group_title": "Connect", - "group_anchor": "connect", - "anchor": "topup_object", - "section_anchor": "topups", - "subsection_anchors": null, - "path": "/topups/object", - "gate": false, - "display_on_load": false - }, - "create_topup": { - "title": "Create a top-up", - "group_title": "Connect", - "group_anchor": "connect", - "anchor": "create_topup", - "section_anchor": "topups", - "subsection_anchors": null, - "path": "/topups/create", - "gate": false, - "display_on_load": false - }, - "retrieve_topup": { - "title": "Retrieve a top-up", - "group_title": "Connect", - "group_anchor": "connect", - "anchor": "retrieve_topup", - "section_anchor": "topups", - "subsection_anchors": null, - "path": "/topups/retrieve", - "gate": false, - "display_on_load": false - }, - "update_topup": { - "title": "Update a top-up", - "group_title": "Connect", - "group_anchor": "connect", - "anchor": "update_topup", - "section_anchor": "topups", - "subsection_anchors": null, - "path": "/topups/update", - "gate": false, - "display_on_load": false - }, - "list_topups": { - "title": "List all top-ups", - "group_title": "Connect", - "group_anchor": "connect", - "anchor": "list_topups", - "section_anchor": "topups", - "subsection_anchors": null, - "path": "/topups/list", - "gate": false, - "display_on_load": false - }, - "cancel_topup": { - "title": "Cancel a top-up", - "group_title": "Connect", - "group_anchor": "connect", - "anchor": "cancel_topup", - "section_anchor": "topups", - "subsection_anchors": null, - "path": "/topups/cancel", - "gate": false, - "display_on_load": false - }, - "transfers": { - "title": "Transfers", - "group_title": "Connect", - "group_anchor": "connect", - "anchor": "transfers", - "section_anchor": "transfers", - "subsection_anchors": [ - "transfer_object", - "create_transfer", - "retrieve_transfer", - "update_transfer", - "list_transfers" - ], - "path": "/transfers", - "gate": false, - "display_on_load": false, - "data": { - "section_type": "resource", - "title": "Transfers", - "description": "A `Transfer` object is created when you move funds between Stripe accounts as\npart of Connect.\n\nBefore April 6, 2017, transfers also represented movement of funds from a\nStripe account to a card or bank account. This behavior has since been split\nout into a [Payout](#payout_object) object, with corresponding payout endpoints. For more\ninformation, read about the\n[transfer/payout split](/docs/transfer-payout-split).\n\nRelated guide: [Creating Separate Charges and Transfers](/docs/connect/charges-transfers).\n", - "section_tag": "transfers", - "subsection_summaries": [ - { "anchor": "transfer_object", "curl_definition": null }, - { "anchor": "create_transfer", "curl_definition": "POST /v1/transfers" }, - { "anchor": "retrieve_transfer", "curl_definition": "GET /v1/transfers/:id" }, - { "anchor": "update_transfer", "curl_definition": "POST /v1/transfers/:id" }, - { "anchor": "list_transfers", "curl_definition": "GET /v1/transfers" } - ] - } - }, - "transfer_object": { - "title": "The transfer object", - "group_title": "Connect", - "group_anchor": "connect", - "anchor": "transfer_object", - "section_anchor": "transfers", - "subsection_anchors": null, - "path": "/transfers/object", - "gate": false, - "display_on_load": false - }, - "create_transfer": { - "title": "Create a transfer", - "group_title": "Connect", - "group_anchor": "connect", - "anchor": "create_transfer", - "section_anchor": "transfers", - "subsection_anchors": null, - "path": "/transfers/create", - "gate": false, - "display_on_load": false - }, - "retrieve_transfer": { - "title": "Retrieve a transfer", - "group_title": "Connect", - "group_anchor": "connect", - "anchor": "retrieve_transfer", - "section_anchor": "transfers", - "subsection_anchors": null, - "path": "/transfers/retrieve", - "gate": false, - "display_on_load": false - }, - "update_transfer": { - "title": "Update a transfer", - "group_title": "Connect", - "group_anchor": "connect", - "anchor": "update_transfer", - "section_anchor": "transfers", - "subsection_anchors": null, - "path": "/transfers/update", - "gate": false, - "display_on_load": false - }, - "list_transfers": { - "title": "List all transfers", - "group_title": "Connect", - "group_anchor": "connect", - "anchor": "list_transfers", - "section_anchor": "transfers", - "subsection_anchors": null, - "path": "/transfers/list", - "gate": false, - "display_on_load": false - }, - "transfer_reversals": { - "title": "Transfer Reversals", - "group_title": "Connect", - "group_anchor": "connect", - "anchor": "transfer_reversals", - "section_anchor": "transfer_reversals", - "subsection_anchors": [ - "transfer_reversal_object", - "create_transfer_reversal", - "retrieve_transfer_reversal", - "update_transfer_reversal", - "list_transfer_reversals" - ], - "path": "/transfer_reversals", - "gate": false, - "display_on_load": false, - "data": { - "section_type": "resource", - "title": "Transfer Reversals", - "description": "[Stripe Connect](/docs/connect) platforms can reverse transfers made to a\nconnected account, either entirely or partially, and can also specify whether\nto refund any related application fees. Transfer reversals add to the\nplatform's balance and subtract from the destination account's balance.\n\nReversing a transfer that was made for a [destination\ncharge](/docs/connect/destination-charges) is allowed only up to the amount of\nthe charge. It is possible to reverse a\n[transfer_group](/docs/connect/charges-transfers#transfer-options)\ntransfer only if the destination account has enough balance to cover the\nreversal.\n\nRelated guide: [Reversing Transfers](/docs/connect/charges-transfers#reversing-transfers).\n", - "section_tag": "transfer_reversals", - "subsection_summaries": [ - { "anchor": "transfer_reversal_object", "curl_definition": null }, - { - "anchor": "create_transfer_reversal", - "curl_definition": "POST /v1/transfers/:id/reversals" - }, - { - "anchor": "retrieve_transfer_reversal", - "curl_definition": "GET /v1/transfers/:id/reversals/:id" - }, - { - "anchor": "update_transfer_reversal", - "curl_definition": "POST /v1/transfers/:id/reversals/:id" - }, - { - "anchor": "list_transfer_reversals", - "curl_definition": "GET /v1/transfers/:id/reversals" - } - ] - } - }, - "transfer_reversal_object": { - "title": "The transfer reversal object", - "group_title": "Connect", - "group_anchor": "connect", - "anchor": "transfer_reversal_object", - "section_anchor": "transfer_reversals", - "subsection_anchors": null, - "path": "/transfer_reversals/object", - "gate": false, - "display_on_load": false - }, - "create_transfer_reversal": { - "title": "Create a transfer reversal", - "group_title": "Connect", - "group_anchor": "connect", - "anchor": "create_transfer_reversal", - "section_anchor": "transfer_reversals", - "subsection_anchors": null, - "path": "/transfer_reversals/create", - "gate": false, - "display_on_load": false - }, - "retrieve_transfer_reversal": { - "title": "Retrieve a reversal", - "group_title": "Connect", - "group_anchor": "connect", - "anchor": "retrieve_transfer_reversal", - "section_anchor": "transfer_reversals", - "subsection_anchors": null, - "path": "/transfer_reversals/retrieve", - "gate": false, - "display_on_load": false - }, - "update_transfer_reversal": { - "title": "Update a reversal", - "group_title": "Connect", - "group_anchor": "connect", - "anchor": "update_transfer_reversal", - "section_anchor": "transfer_reversals", - "subsection_anchors": null, - "path": "/transfer_reversals/update", - "gate": false, - "display_on_load": false - }, - "list_transfer_reversals": { - "title": "List all reversals", - "group_title": "Connect", - "group_anchor": "connect", - "anchor": "list_transfer_reversals", - "section_anchor": "transfer_reversals", - "subsection_anchors": null, - "path": "/transfer_reversals/list", - "gate": false, - "display_on_load": false - }, - "secret_management": { - "title": "Secret Management", - "group_title": "Connect", - "group_anchor": "connect", - "anchor": "secret_management", - "section_anchor": "secret_management", - "subsection_anchors": [ - "secret_object", - "set_secret", - "find_secret", - "delete_secret", - "list_secret" - ], - "path": "/secret_management", - "gate": false, - "display_on_load": false, - "data": { - "section_type": "resource", - "title": "Secrets", - "description": "Secret Store is an API that allows Stripe Apps developers to securely persist secrets for use by UI Extensions and app backends.\n\nThe primary resource in Secret Store is a `secret`. Other apps can't view secrets created by an app. Additionally, secrets are scoped to provide further permission control.\n\nAll Dashboard users and the app backend share `account` scoped secrets. Use the `account` scope for secrets that don't change per-user, like a third-party API key.\n\nA `user` scoped secret is accessible by the app backend and one specific Dashboard user. Use the `user` scope for per-user secrets like per-user OAuth tokens, where different users might have different permissions.\n\nRelated guide: [Store data between page reloads](/docs/stripe-apps/store-auth-data-custom-objects).\n", - "section_tag": "secret_management", - "subsection_summaries": [ - { "anchor": "secret_object", "curl_definition": null }, - { "anchor": "set_secret", "curl_definition": "POST /v1/apps/secrets" }, - { "anchor": "find_secret", "curl_definition": "GET /v1/apps/secrets/find" }, - { "anchor": "delete_secret", "curl_definition": "POST /v1/apps/secrets/delete" }, - { "anchor": "list_secret", "curl_definition": "GET /v1/apps/secrets" } - ] - } - }, - "secret_object": { - "title": "The Secret object", - "group_title": "Connect", - "group_anchor": "connect", - "anchor": "secret_object", - "section_anchor": "secret_management", - "subsection_anchors": null, - "path": "/apps/secret_store/secret_resource", - "gate": false, - "display_on_load": false - }, - "set_secret": { - "title": "Set a secret", - "group_title": "Connect", - "group_anchor": "connect", - "anchor": "set_secret", - "section_anchor": "secret_management", - "subsection_anchors": null, - "path": "/apps/secret_store/set", - "gate": false, - "display_on_load": false - }, - "find_secret": { - "title": "Find a secret", - "group_title": "Connect", - "group_anchor": "connect", - "anchor": "find_secret", - "section_anchor": "secret_management", - "subsection_anchors": null, - "path": "/apps/secret_store/find", - "gate": false, - "display_on_load": false - }, - "delete_secret": { - "title": "Delete a secret", - "group_title": "Connect", - "group_anchor": "connect", - "anchor": "delete_secret", - "section_anchor": "secret_management", - "subsection_anchors": null, - "path": "/apps/secret_store/delete", - "gate": false, - "display_on_load": false - }, - "list_secret": { - "title": "List secrets", - "group_title": "Connect", - "group_anchor": "connect", - "anchor": "list_secret", - "section_anchor": "secret_management", - "subsection_anchors": null, - "path": "/apps/secret_store/list", - "gate": false, - "display_on_load": false - }, - "early_fraud_warnings": { - "title": "Early Fraud Warnings", - "group_title": "Fraud", - "group_anchor": "fraud", - "anchor": "early_fraud_warnings", - "section_anchor": "early_fraud_warnings", - "subsection_anchors": [ - "early_fraud_warning_object", - "retrieve_early_fraud_warning", - "list_early_fraud_warnings" - ], - "path": "/radar/early_fraud_warnings", - "gate": false, - "display_on_load": false, - "data": { - "section_type": "resource", - "title": "Early Fraud Warning", - "description": "An early fraud warning indicates that the card issuer has notified us that a\ncharge may be fraudulent.\n\nRelated guide: [Early Fraud Warnings](/docs/disputes/measuring#early-fraud-warnings).\n", - "section_tag": "early_fraud_warnings", - "subsection_summaries": [ - { "anchor": "early_fraud_warning_object", "curl_definition": null }, - { - "anchor": "retrieve_early_fraud_warning", - "curl_definition": "GET /v1/radar/early_fraud_warnings/:id" - }, - { - "anchor": "list_early_fraud_warnings", - "curl_definition": "GET /v1/radar/early_fraud_warnings" - } - ] - } - }, - "early_fraud_warning_object": { - "title": "The early fraud warning object", - "group_title": "Fraud", - "group_anchor": "fraud", - "anchor": "early_fraud_warning_object", - "section_anchor": "early_fraud_warnings", - "subsection_anchors": null, - "path": "/radar/early_fraud_warnings/object", - "gate": false, - "display_on_load": false - }, - "retrieve_early_fraud_warning": { - "title": "Retrieve an early fraud warning", - "group_title": "Fraud", - "group_anchor": "fraud", - "anchor": "retrieve_early_fraud_warning", - "section_anchor": "early_fraud_warnings", - "subsection_anchors": null, - "path": "/radar/early_fraud_warnings/retrieve", - "gate": false, - "display_on_load": false - }, - "list_early_fraud_warnings": { - "title": "List all early fraud warnings", - "group_title": "Fraud", - "group_anchor": "fraud", - "anchor": "list_early_fraud_warnings", - "section_anchor": "early_fraud_warnings", - "subsection_anchors": null, - "path": "/radar/early_fraud_warnings/list", - "gate": false, - "display_on_load": false - }, - "reviews": { - "title": "Reviews", - "group_title": "Fraud", - "group_anchor": "fraud", - "anchor": "reviews", - "section_anchor": "reviews", - "subsection_anchors": ["review_object", "approve_review", "retrieve_review", "list_reviews"], - "path": "/radar/reviews", - "gate": false, - "display_on_load": false, - "data": { - "section_type": "resource", - "title": "Reviews", - "description": "Reviews can be used to supplement automated fraud detection with human expertise.\n\nLearn more about [Radar](/radar) and reviewing payments\n[here](/docs/radar/reviews).\n", - "section_tag": "reviews", - "subsection_summaries": [ - { "anchor": "review_object", "curl_definition": null }, - { "anchor": "approve_review", "curl_definition": "POST /v1/reviews/:id/approve" }, - { "anchor": "retrieve_review", "curl_definition": "GET /v1/reviews/:id" }, - { "anchor": "list_reviews", "curl_definition": "GET /v1/reviews" } - ] - } - }, - "review_object": { - "title": "The review object", - "group_title": "Fraud", - "group_anchor": "fraud", - "anchor": "review_object", - "section_anchor": "reviews", - "subsection_anchors": null, - "path": "/radar/reviews/object", - "gate": false, - "display_on_load": false - }, - "approve_review": { - "title": "Approve a review", - "group_title": "Fraud", - "group_anchor": "fraud", - "anchor": "approve_review", - "section_anchor": "reviews", - "subsection_anchors": null, - "path": "/radar/reviews/approve", - "gate": false, - "display_on_load": false - }, - "retrieve_review": { - "title": "Retrieve a review", - "group_title": "Fraud", - "group_anchor": "fraud", - "anchor": "retrieve_review", - "section_anchor": "reviews", - "subsection_anchors": null, - "path": "/radar/reviews/retrieve", - "gate": false, - "display_on_load": false - }, - "list_reviews": { - "title": "List all open reviews", - "group_title": "Fraud", - "group_anchor": "fraud", - "anchor": "list_reviews", - "section_anchor": "reviews", - "subsection_anchors": null, - "path": "/radar/reviews/list", - "gate": false, - "display_on_load": false - }, - "value_lists": { - "title": "Value Lists", - "group_title": "Fraud", - "group_anchor": "fraud", - "anchor": "value_lists", - "section_anchor": "value_lists", - "subsection_anchors": [ - "radar_value_list_object", - "create_value_list", - "retrieve_value_list", - "update_value_list", - "delete_value_list", - "list_value_lists" - ], - "path": "/radar/value_lists", - "gate": false, - "display_on_load": false, - "data": { - "section_type": "resource", - "title": "Value Lists", - "description": "Value lists allow you to group values together which can then be referenced in rules.\n\nRelated guide: [Default Stripe Lists](/docs/radar/lists#managing-list-items).\n", - "section_tag": "value_lists", - "subsection_summaries": [ - { "anchor": "radar_value_list_object", "curl_definition": null }, - { "anchor": "create_value_list", "curl_definition": "POST /v1/radar/value_lists" }, - { "anchor": "retrieve_value_list", "curl_definition": "GET /v1/radar/value_lists/:id" }, - { "anchor": "update_value_list", "curl_definition": "POST /v1/radar/value_lists/:id" }, - { "anchor": "delete_value_list", "curl_definition": "DELETE /v1/radar/value_lists/:id" }, - { "anchor": "list_value_lists", "curl_definition": "GET /v1/radar/value_lists" } - ] - } - }, - "radar_value_list_object": { - "title": "The value list object", - "group_title": "Fraud", - "group_anchor": "fraud", - "anchor": "radar_value_list_object", - "section_anchor": "value_lists", - "subsection_anchors": null, - "path": "/radar/value_lists/object", - "gate": false, - "display_on_load": false - }, - "create_value_list": { - "title": "Create a value list", - "group_title": "Fraud", - "group_anchor": "fraud", - "anchor": "create_value_list", - "section_anchor": "value_lists", - "subsection_anchors": null, - "path": "/radar/value_lists/create", - "gate": false, - "display_on_load": false - }, - "retrieve_value_list": { - "title": "Retrieve a value list", - "group_title": "Fraud", - "group_anchor": "fraud", - "anchor": "retrieve_value_list", - "section_anchor": "value_lists", - "subsection_anchors": null, - "path": "/radar/value_lists/retrieve", - "gate": false, - "display_on_load": false - }, - "update_value_list": { - "title": "Update a value list", - "group_title": "Fraud", - "group_anchor": "fraud", - "anchor": "update_value_list", - "section_anchor": "value_lists", - "subsection_anchors": null, - "path": "/radar/value_lists/update", - "gate": false, - "display_on_load": false - }, - "delete_value_list": { - "title": "Delete a value list", - "group_title": "Fraud", - "group_anchor": "fraud", - "anchor": "delete_value_list", - "section_anchor": "value_lists", - "subsection_anchors": null, - "path": "/radar/value_lists/delete", - "gate": false, - "display_on_load": false - }, - "list_value_lists": { - "title": "List all value lists", - "group_title": "Fraud", - "group_anchor": "fraud", - "anchor": "list_value_lists", - "section_anchor": "value_lists", - "subsection_anchors": null, - "path": "/radar/value_lists/list", - "gate": false, - "display_on_load": false - }, - "value_list_items": { - "title": "Value List Items", - "group_title": "Fraud", - "group_anchor": "fraud", - "anchor": "value_list_items", - "section_anchor": "value_list_items", - "subsection_anchors": [ - "radar_value_list_item_object", - "create_value_list_item", - "retrieve_value_list_item", - "delete_value_list_item", - "list_value_list_items" - ], - "path": "/radar/value_list_items", - "gate": false, - "display_on_load": false, - "data": { - "section_type": "resource", - "title": "Value List Items", - "description": "Value list items allow you to add specific values to a given Radar value list, which can then be used in rules.\n\nRelated guide: [Managing List Items](/docs/radar/lists#managing-list-items).\n", - "section_tag": "value_list_items", - "subsection_summaries": [ - { "anchor": "radar_value_list_item_object", "curl_definition": null }, - { - "anchor": "create_value_list_item", - "curl_definition": "POST /v1/radar/value_list_items" - }, - { - "anchor": "retrieve_value_list_item", - "curl_definition": "GET /v1/radar/value_list_items/:id" - }, - { - "anchor": "delete_value_list_item", - "curl_definition": "DELETE /v1/radar/value_list_items/:id" - }, - { "anchor": "list_value_list_items", "curl_definition": "GET /v1/radar/value_list_items" } - ] - } - }, - "radar_value_list_item_object": { - "title": "The value list item object", - "group_title": "Fraud", - "group_anchor": "fraud", - "anchor": "radar_value_list_item_object", - "section_anchor": "value_list_items", - "subsection_anchors": null, - "path": "/radar/value_list_items/object", - "gate": false, - "display_on_load": false - }, - "create_value_list_item": { - "title": "Create a value list item", - "group_title": "Fraud", - "group_anchor": "fraud", - "anchor": "create_value_list_item", - "section_anchor": "value_list_items", - "subsection_anchors": null, - "path": "/radar/value_list_items/create", - "gate": false, - "display_on_load": false - }, - "retrieve_value_list_item": { - "title": "Retrieve a value list item", - "group_title": "Fraud", - "group_anchor": "fraud", - "anchor": "retrieve_value_list_item", - "section_anchor": "value_list_items", - "subsection_anchors": null, - "path": "/radar/value_list_items/retrieve", - "gate": false, - "display_on_load": false - }, - "delete_value_list_item": { - "title": "Delete a value list item", - "group_title": "Fraud", - "group_anchor": "fraud", - "anchor": "delete_value_list_item", - "section_anchor": "value_list_items", - "subsection_anchors": null, - "path": "/radar/value_list_items/delete", - "gate": false, - "display_on_load": false - }, - "list_value_list_items": { - "title": "List all value list items", - "group_title": "Fraud", - "group_anchor": "fraud", - "anchor": "list_value_list_items", - "section_anchor": "value_list_items", - "subsection_anchors": null, - "path": "/radar/value_list_items/list", - "gate": false, - "display_on_load": false - }, - "issuing_authorizations": { - "title": "Authorizations", - "group_title": "Issuing", - "group_anchor": "issuing", - "anchor": "issuing_authorizations", - "section_anchor": "issuing_authorizations", - "subsection_anchors": [ - "issuing_authorization_object", - "retrieve_issuing_authorization", - "update_issuing_authorization", - "approve_issuing_authorization", - "decline_issuing_authorization", - "list_issuing_authorizations" - ], - "path": "/issuing/authorizations", - "gate": false, - "display_on_load": false, - "data": { - "section_type": "resource", - "title": "Authorizations", - "description": "When an [issued card](/docs/issuing) is used to make a purchase, an Issuing `Authorization`\nobject is created. [Authorizations](/docs/issuing/purchases/authorizations) must be approved for the\npurchase to be completed successfully.\n\nRelated guide: [Issued Card Authorizations](/docs/issuing/purchases/authorizations).\n", - "section_tag": "issuing_authorizations", - "subsection_summaries": [ - { "anchor": "issuing_authorization_object", "curl_definition": null }, - { - "anchor": "retrieve_issuing_authorization", - "curl_definition": "GET /v1/issuing/authorizations/:id" - }, - { - "anchor": "update_issuing_authorization", - "curl_definition": "POST /v1/issuing/authorizations/:id" - }, - { - "anchor": "approve_issuing_authorization", - "curl_definition": "POST /v1/issuing/authorizations/:id/approve" - }, - { - "anchor": "decline_issuing_authorization", - "curl_definition": "POST /v1/issuing/authorizations/:id/decline" - }, - { - "anchor": "list_issuing_authorizations", - "curl_definition": "GET /v1/issuing/authorizations" - } - ] - } - }, - "issuing_authorization_object": { - "title": "The Authorization object", - "group_title": "Issuing", - "group_anchor": "issuing", - "anchor": "issuing_authorization_object", - "section_anchor": "issuing_authorizations", - "subsection_anchors": null, - "path": "/issuing/authorizations/object", - "gate": false, - "display_on_load": false - }, - "retrieve_issuing_authorization": { - "title": "Retrieve an authorization", - "group_title": "Issuing", - "group_anchor": "issuing", - "anchor": "retrieve_issuing_authorization", - "section_anchor": "issuing_authorizations", - "subsection_anchors": null, - "path": "/issuing/authorizations/retrieve", - "gate": false, - "display_on_load": false - }, - "update_issuing_authorization": { - "title": "Update an authorization", - "group_title": "Issuing", - "group_anchor": "issuing", - "anchor": "update_issuing_authorization", - "section_anchor": "issuing_authorizations", - "subsection_anchors": null, - "path": "/issuing/authorizations/update", - "gate": false, - "display_on_load": false - }, - "approve_issuing_authorization": { - "title": "Approve an authorization", - "group_title": "Issuing", - "group_anchor": "issuing", - "anchor": "approve_issuing_authorization", - "section_anchor": "issuing_authorizations", - "subsection_anchors": null, - "path": "/issuing/authorizations/approve", - "gate": false, - "display_on_load": false - }, - "decline_issuing_authorization": { - "title": "Decline an authorization", - "group_title": "Issuing", - "group_anchor": "issuing", - "anchor": "decline_issuing_authorization", - "section_anchor": "issuing_authorizations", - "subsection_anchors": null, - "path": "/issuing/authorizations/decline", - "gate": false, - "display_on_load": false - }, - "list_issuing_authorizations": { - "title": "List all authorizations", - "group_title": "Issuing", - "group_anchor": "issuing", - "anchor": "list_issuing_authorizations", - "section_anchor": "issuing_authorizations", - "subsection_anchors": null, - "path": "/issuing/authorizations/list", - "gate": false, - "display_on_load": false - }, - "issuing_cardholders": { - "title": "Cardholders", - "group_title": "Issuing", - "group_anchor": "issuing", - "anchor": "issuing_cardholders", - "section_anchor": "issuing_cardholders", - "subsection_anchors": [ - "issuing_cardholder_object", - "create_issuing_cardholder", - "retrieve_issuing_cardholder", - "update_issuing_cardholder", - "list_issuing_cardholders" - ], - "path": "/issuing/cardholders", - "gate": false, - "display_on_load": false, - "data": { - "section_type": "resource", - "title": "Cardholders", - "description": "An Issuing `Cardholder` object represents an individual or business entity who is [issued](/docs/issuing) cards.\n\nRelated guide: [How to create a Cardholder](/docs/issuing/cards#create-cardholder)\n", - "section_tag": "issuing_cardholders", - "subsection_summaries": [ - { "anchor": "issuing_cardholder_object", "curl_definition": null }, - { - "anchor": "create_issuing_cardholder", - "curl_definition": "POST /v1/issuing/cardholders" - }, - { - "anchor": "retrieve_issuing_cardholder", - "curl_definition": "GET /v1/issuing/cardholders/:id" - }, - { - "anchor": "update_issuing_cardholder", - "curl_definition": "POST /v1/issuing/cardholders/:id" - }, - { "anchor": "list_issuing_cardholders", "curl_definition": "GET /v1/issuing/cardholders" } - ] - } - }, - "issuing_cardholder_object": { - "title": "The Cardholder object", - "group_title": "Issuing", - "group_anchor": "issuing", - "anchor": "issuing_cardholder_object", - "section_anchor": "issuing_cardholders", - "subsection_anchors": null, - "path": "/issuing/cardholders/object", - "gate": false, - "display_on_load": false - }, - "create_issuing_cardholder": { - "title": "Create a cardholder", - "group_title": "Issuing", - "group_anchor": "issuing", - "anchor": "create_issuing_cardholder", - "section_anchor": "issuing_cardholders", - "subsection_anchors": null, - "path": "/issuing/cardholders/create", - "gate": false, - "display_on_load": false - }, - "retrieve_issuing_cardholder": { - "title": "Retrieve a cardholder", - "group_title": "Issuing", - "group_anchor": "issuing", - "anchor": "retrieve_issuing_cardholder", - "section_anchor": "issuing_cardholders", - "subsection_anchors": null, - "path": "/issuing/cardholders/retrieve", - "gate": false, - "display_on_load": false - }, - "update_issuing_cardholder": { - "title": "Update a cardholder", - "group_title": "Issuing", - "group_anchor": "issuing", - "anchor": "update_issuing_cardholder", - "section_anchor": "issuing_cardholders", - "subsection_anchors": null, - "path": "/issuing/cardholders/update", - "gate": false, - "display_on_load": false - }, - "list_issuing_cardholders": { - "title": "List all cardholders", - "group_title": "Issuing", - "group_anchor": "issuing", - "anchor": "list_issuing_cardholders", - "section_anchor": "issuing_cardholders", - "subsection_anchors": null, - "path": "/issuing/cardholders/list", - "gate": false, - "display_on_load": false - }, - "issuing_cards": { - "title": "Cards", - "group_title": "Issuing", - "group_anchor": "issuing", - "anchor": "issuing_cards", - "section_anchor": "issuing_cards", - "subsection_anchors": [ - "issuing_card_object", - "create_issuing_card", - "retrieve_issuing_card", - "update_issuing_card", - "list_issuing_cards", - "test_mode_ship_physical_card", - "test_mode_deliver_physical_card", - "test_mode_return_physical_card", - "test_mode_fail_physical_card" - ], - "path": "/issuing/cards", - "gate": false, - "display_on_load": false, - "data": { - "section_type": "resource", - "title": "Cards", - "description": "You can [create physical or virtual cards](/docs/issuing/cards) that are issued to cardholders.", - "section_tag": "issuing_cards", - "subsection_summaries": [ - { "anchor": "issuing_card_object", "curl_definition": null }, - { "anchor": "create_issuing_card", "curl_definition": "POST /v1/issuing/cards" }, - { "anchor": "retrieve_issuing_card", "curl_definition": "GET /v1/issuing/cards/:id" }, - { "anchor": "update_issuing_card", "curl_definition": "POST /v1/issuing/cards/:id" }, - { "anchor": "list_issuing_cards", "curl_definition": "GET /v1/issuing/cards" }, - { - "anchor": "test_mode_ship_physical_card", - "curl_definition": "POST /v1/test_helpers/issuing/cards/{:card}/shipping/ship" - }, - { - "anchor": "test_mode_deliver_physical_card", - "curl_definition": "POST /v1/test_helpers/issuing/cards/{:card}/shipping/deliver" - }, - { - "anchor": "test_mode_return_physical_card", - "curl_definition": "POST /v1/test_helpers/issuing/cards/{:card}/shipping/return" - }, - { - "anchor": "test_mode_fail_physical_card", - "curl_definition": "POST /v1/test_helpers/issuing/cards/{:card}/shipping/fail" - } - ] - } - }, - "issuing_card_object": { - "title": "The Card object", - "group_title": "Issuing", - "group_anchor": "issuing", - "anchor": "issuing_card_object", - "section_anchor": "issuing_cards", - "subsection_anchors": null, - "path": "/issuing/cards/object", - "gate": false, - "display_on_load": false - }, - "create_issuing_card": { - "title": "Create a card", - "group_title": "Issuing", - "group_anchor": "issuing", - "anchor": "create_issuing_card", - "section_anchor": "issuing_cards", - "subsection_anchors": null, - "path": "/issuing/cards/create", - "gate": false, - "display_on_load": false - }, - "retrieve_issuing_card": { - "title": "Retrieve a card", - "group_title": "Issuing", - "group_anchor": "issuing", - "anchor": "retrieve_issuing_card", - "section_anchor": "issuing_cards", - "subsection_anchors": null, - "path": "/issuing/cards/retrieve", - "gate": false, - "display_on_load": false - }, - "update_issuing_card": { - "title": "Update a card", - "group_title": "Issuing", - "group_anchor": "issuing", - "anchor": "update_issuing_card", - "section_anchor": "issuing_cards", - "subsection_anchors": null, - "path": "/issuing/cards/update", - "gate": false, - "display_on_load": false - }, - "list_issuing_cards": { - "title": "List all cards", - "group_title": "Issuing", - "group_anchor": "issuing", - "anchor": "list_issuing_cards", - "section_anchor": "issuing_cards", - "subsection_anchors": null, - "path": "/issuing/cards/list", - "gate": false, - "display_on_load": false - }, - "test_mode_ship_physical_card": { - "title": "Ship a testmode card", - "group_title": "Issuing", - "group_anchor": "issuing", - "anchor": "test_mode_ship_physical_card", - "section_anchor": "issuing_cards", - "subsection_anchors": null, - "path": "/issuing/cards/test_mode_ship", - "gate": false, - "display_on_load": false - }, - "test_mode_deliver_physical_card": { - "title": "Deliver a testmode card", - "group_title": "Issuing", - "group_anchor": "issuing", - "anchor": "test_mode_deliver_physical_card", - "section_anchor": "issuing_cards", - "subsection_anchors": null, - "path": "/issuing/cards/test_mode_deliver", - "gate": false, - "display_on_load": false - }, - "test_mode_return_physical_card": { - "title": "Return a testmode card", - "group_title": "Issuing", - "group_anchor": "issuing", - "anchor": "test_mode_return_physical_card", - "section_anchor": "issuing_cards", - "subsection_anchors": null, - "path": "/issuing/cards/test_mode_return", - "gate": false, - "display_on_load": false - }, - "test_mode_fail_physical_card": { - "title": "Fail a testmode card", - "group_title": "Issuing", - "group_anchor": "issuing", - "anchor": "test_mode_fail_physical_card", - "section_anchor": "issuing_cards", - "subsection_anchors": null, - "path": "/issuing/cards/test_mode_fail", - "gate": false, - "display_on_load": false - }, - "issuing_disputes": { - "title": "Disputes", - "group_title": "Issuing", - "group_anchor": "issuing", - "anchor": "issuing_disputes", - "section_anchor": "issuing_disputes", - "subsection_anchors": [ - "issuing_dispute_object", - "create_issuing_dispute", - "submit_issuing_dispute", - "retrieve_issuing_dispute", - "update_issuing_dispute", - "list_issuing_disputes" - ], - "path": "/issuing/disputes", - "gate": false, - "display_on_load": false, - "data": { - "section_type": "resource", - "title": "Disputes", - "description": "As a [card issuer](/docs/issuing), you can dispute transactions that the cardholder does not recognize, suspects to be fraudulent, or has other issues with.\n\nRelated guide: [Disputing Transactions](/docs/issuing/purchases/disputes)\n", - "section_tag": "issuing_disputes", - "subsection_summaries": [ - { "anchor": "issuing_dispute_object", "curl_definition": null }, - { "anchor": "create_issuing_dispute", "curl_definition": "POST /v1/issuing/disputes" }, - { - "anchor": "submit_issuing_dispute", - "curl_definition": "POST /v1/issuing/disputes/:id/submit" - }, - { "anchor": "retrieve_issuing_dispute", "curl_definition": "GET /v1/issuing/disputes/:id" }, - { "anchor": "update_issuing_dispute", "curl_definition": "POST /v1/issuing/disputes/:id" }, - { "anchor": "list_issuing_disputes", "curl_definition": "GET /v1/issuing/disputes" } - ] - } - }, - "issuing_dispute_object": { - "title": "The Dispute object", - "group_title": "Issuing", - "group_anchor": "issuing", - "anchor": "issuing_dispute_object", - "section_anchor": "issuing_disputes", - "subsection_anchors": null, - "path": "/issuing/disputes/object", - "gate": false, - "display_on_load": false - }, - "create_issuing_dispute": { - "title": "Create a dispute", - "group_title": "Issuing", - "group_anchor": "issuing", - "anchor": "create_issuing_dispute", - "section_anchor": "issuing_disputes", - "subsection_anchors": null, - "path": "/issuing/disputes/create", - "gate": false, - "display_on_load": false - }, - "submit_issuing_dispute": { - "title": "Submit a dispute", - "group_title": "Issuing", - "group_anchor": "issuing", - "anchor": "submit_issuing_dispute", - "section_anchor": "issuing_disputes", - "subsection_anchors": null, - "path": "/issuing/dispute/submit", - "gate": false, - "display_on_load": false - }, - "retrieve_issuing_dispute": { - "title": "Retrieve a dispute", - "group_title": "Issuing", - "group_anchor": "issuing", - "anchor": "retrieve_issuing_dispute", - "section_anchor": "issuing_disputes", - "subsection_anchors": null, - "path": "/issuing/disputes/retrieve", - "gate": false, - "display_on_load": false - }, - "update_issuing_dispute": { - "title": "Update a dispute", - "group_title": "Issuing", - "group_anchor": "issuing", - "anchor": "update_issuing_dispute", - "section_anchor": "issuing_disputes", - "subsection_anchors": null, - "path": "/issuing/disputes/update", - "gate": false, - "display_on_load": false - }, - "list_issuing_disputes": { - "title": "List all disputes", - "group_title": "Issuing", - "group_anchor": "issuing", - "anchor": "list_issuing_disputes", - "section_anchor": "issuing_disputes", - "subsection_anchors": null, - "path": "/issuing/disputes/list", - "gate": false, - "display_on_load": false - }, - "issuing_funding_instructions": { - "title": "Funding Instructions", - "group_title": "Issuing", - "group_anchor": "issuing", - "anchor": "issuing_funding_instructions", - "section_anchor": "issuing_funding_instructions", - "subsection_anchors": [ - "issuing_funding_instructions_object", - "create_issuing_funding_instructions", - "list_issuing_funding_instructions", - "fund_issuing_funding_instruction" - ], - "path": "/issuing/funding_instructions", - "gate": false, - "display_on_load": false, - "data": { - "section_type": "resource", - "title": "Funding Instructions", - "description": "Funding Instructions contain reusable bank account and routing information. Push funds\nto these addresses via bank transfer to [top up Issuing Balances](/docs/issuing/funding/balance).\n", - "section_tag": "issuing_funding_instructions", - "subsection_summaries": [ - { "anchor": "issuing_funding_instructions_object", "curl_definition": null }, - { - "anchor": "create_issuing_funding_instructions", - "curl_definition": "POST /v1/issuing/funding_instructions" - }, - { - "anchor": "list_issuing_funding_instructions", - "curl_definition": "GET /v1/issuing/funding_instructions" - }, - { - "anchor": "fund_issuing_funding_instruction", - "curl_definition": "POST /v1/test_helpers/issuing/fund_balance" - } - ] - } - }, - "issuing_funding_instructions_object": { - "title": "The FundingInstruction object", - "group_title": "Issuing", - "group_anchor": "issuing", - "anchor": "issuing_funding_instructions_object", - "section_anchor": "issuing_funding_instructions", - "subsection_anchors": null, - "path": "/issuing/funding_instructions/object", - "gate": false, - "display_on_load": false - }, - "create_issuing_funding_instructions": { - "title": "Create funding instructions", - "group_title": "Issuing", - "group_anchor": "issuing", - "anchor": "create_issuing_funding_instructions", - "section_anchor": "issuing_funding_instructions", - "subsection_anchors": null, - "path": "/issuing/funding_instructions/create", - "gate": false, - "display_on_load": false - }, - "list_issuing_funding_instructions": { - "title": "List all funding instructions", - "group_title": "Issuing", - "group_anchor": "issuing", - "anchor": "list_issuing_funding_instructions", - "section_anchor": "issuing_funding_instructions", - "subsection_anchors": null, - "path": "/issuing/funding_instructions/list", - "gate": false, - "display_on_load": false - }, - "fund_issuing_funding_instruction": { - "title": "Simulate a top up", - "group_title": "Issuing", - "group_anchor": "issuing", - "anchor": "fund_issuing_funding_instruction", - "section_anchor": "issuing_funding_instructions", - "subsection_anchors": null, - "path": "/issuing/funding_instructions/fund", - "gate": false, - "display_on_load": false - }, - "issuing_transactions": { - "title": "Transactions", - "group_title": "Issuing", - "group_anchor": "issuing", - "anchor": "issuing_transactions", - "section_anchor": "issuing_transactions", - "subsection_anchors": [ - "issuing_transaction_object", - "retrieve_issuing_transaction", - "update_issuing_transaction", - "list_issuing_transactions" - ], - "path": "/issuing/transactions", - "gate": false, - "display_on_load": false, - "data": { - "section_type": "resource", - "title": "Transactions", - "description": "Any use of an [issued card](/docs/issuing) that results in funds entering or leaving\nyour Stripe account, such as a completed purchase or refund, is represented by an Issuing\n`Transaction` object.\n\nRelated guide: [Issued Card Transactions](/docs/issuing/purchases/transactions).\n", - "section_tag": "issuing_transactions", - "subsection_summaries": [ - { "anchor": "issuing_transaction_object", "curl_definition": null }, - { - "anchor": "retrieve_issuing_transaction", - "curl_definition": "GET /v1/issuing/transactions/:id" - }, - { - "anchor": "update_issuing_transaction", - "curl_definition": "POST /v1/issuing/transactions/:id" - }, - { "anchor": "list_issuing_transactions", "curl_definition": "GET /v1/issuing/transactions" } - ] - } - }, - "issuing_transaction_object": { - "title": "The Transaction object", - "group_title": "Issuing", - "group_anchor": "issuing", - "anchor": "issuing_transaction_object", - "section_anchor": "issuing_transactions", - "subsection_anchors": null, - "path": "/issuing/transactions/object", - "gate": false, - "display_on_load": false - }, - "retrieve_issuing_transaction": { - "title": "Retrieve a transaction", - "group_title": "Issuing", - "group_anchor": "issuing", - "anchor": "retrieve_issuing_transaction", - "section_anchor": "issuing_transactions", - "subsection_anchors": null, - "path": "/issuing/transactions/retrieve", - "gate": false, - "display_on_load": false - }, - "update_issuing_transaction": { - "title": "Update a transaction", - "group_title": "Issuing", - "group_anchor": "issuing", - "anchor": "update_issuing_transaction", - "section_anchor": "issuing_transactions", - "subsection_anchors": null, - "path": "/issuing/transactions/update", - "gate": false, - "display_on_load": false - }, - "list_issuing_transactions": { - "title": "List all transactions", - "group_title": "Issuing", - "group_anchor": "issuing", - "anchor": "list_issuing_transactions", - "section_anchor": "issuing_transactions", - "subsection_anchors": null, - "path": "/issuing/transactions/list", - "gate": false, - "display_on_load": false - }, - "terminal_connection_tokens": { - "title": "Connection Tokens", - "group_title": "Terminal", - "group_anchor": "terminal", - "anchor": "terminal_connection_tokens", - "section_anchor": "terminal_connection_tokens", - "subsection_anchors": ["terminal_connection_token_object", "create_terminal_connection_token"], - "path": "/terminal/connection_tokens", - "gate": false, - "display_on_load": false, - "data": { - "section_type": "resource", - "title": "Connection Token", - "description": "A Connection Token is used by the Stripe Terminal SDK to connect to a reader.\n\nRelated guide: [Fleet Management](/docs/terminal/fleet/locations).\n", - "section_tag": "terminal_connection_tokens", - "subsection_summaries": [ - { "anchor": "terminal_connection_token_object", "curl_definition": null }, - { - "anchor": "create_terminal_connection_token", - "curl_definition": "POST /v1/terminal/connection_tokens" - } - ] - } - }, - "terminal_connection_token_object": { - "title": "The connection token object", - "group_title": "Terminal", - "group_anchor": "terminal", - "anchor": "terminal_connection_token_object", - "section_anchor": "terminal_connection_tokens", - "subsection_anchors": null, - "path": "/terminal/connection_tokens/object", - "gate": false, - "display_on_load": false - }, - "create_terminal_connection_token": { - "title": "Create a Connection Token", - "group_title": "Terminal", - "group_anchor": "terminal", - "anchor": "create_terminal_connection_token", - "section_anchor": "terminal_connection_tokens", - "subsection_anchors": null, - "path": "/terminal/connection_tokens/create", - "gate": false, - "display_on_load": false - }, - "terminal_locations": { - "title": "Locations", - "group_title": "Terminal", - "group_anchor": "terminal", - "anchor": "terminal_locations", - "section_anchor": "terminal_locations", - "subsection_anchors": [ - "terminal_location_object", - "create_terminal_location", - "retrieve_terminal_location", - "update_terminal_location", - "delete_terminal_location", - "list_terminal_locations" - ], - "path": "/terminal/locations", - "gate": false, - "display_on_load": false, - "data": { - "section_type": "resource", - "title": "Location", - "description": "A Location represents a grouping of readers.\n\nRelated guide: [Fleet Management](/docs/terminal/fleet/locations).\n", - "section_tag": "terminal_locations", - "subsection_summaries": [ - { "anchor": "terminal_location_object", "curl_definition": null }, - { "anchor": "create_terminal_location", "curl_definition": "POST /v1/terminal/locations" }, - { - "anchor": "retrieve_terminal_location", - "curl_definition": "GET /v1/terminal/locations/:id" - }, - { - "anchor": "update_terminal_location", - "curl_definition": "POST /v1/terminal/locations/:id" - }, - { - "anchor": "delete_terminal_location", - "curl_definition": "DELETE /v1/terminal/locations/:id" - }, - { "anchor": "list_terminal_locations", "curl_definition": "GET /v1/terminal/locations" } - ] - } - }, - "terminal_location_object": { - "title": "The location object", - "group_title": "Terminal", - "group_anchor": "terminal", - "anchor": "terminal_location_object", - "section_anchor": "terminal_locations", - "subsection_anchors": null, - "path": "/terminal/locations/object", - "gate": false, - "display_on_load": false - }, - "create_terminal_location": { - "title": "Create a Location", - "group_title": "Terminal", - "group_anchor": "terminal", - "anchor": "create_terminal_location", - "section_anchor": "terminal_locations", - "subsection_anchors": null, - "path": "/terminal/locations/create", - "gate": false, - "display_on_load": false - }, - "retrieve_terminal_location": { - "title": "Retrieve a Location", - "group_title": "Terminal", - "group_anchor": "terminal", - "anchor": "retrieve_terminal_location", - "section_anchor": "terminal_locations", - "subsection_anchors": null, - "path": "/terminal/locations/retrieve", - "gate": false, - "display_on_load": false - }, - "update_terminal_location": { - "title": "Update a Location", - "group_title": "Terminal", - "group_anchor": "terminal", - "anchor": "update_terminal_location", - "section_anchor": "terminal_locations", - "subsection_anchors": null, - "path": "/terminal/locations/update", - "gate": false, - "display_on_load": false - }, - "delete_terminal_location": { - "title": "Delete a Location", - "group_title": "Terminal", - "group_anchor": "terminal", - "anchor": "delete_terminal_location", - "section_anchor": "terminal_locations", - "subsection_anchors": null, - "path": "/terminal/locations/delete", - "gate": false, - "display_on_load": false - }, - "list_terminal_locations": { - "title": "List all Locations", - "group_title": "Terminal", - "group_anchor": "terminal", - "anchor": "list_terminal_locations", - "section_anchor": "terminal_locations", - "subsection_anchors": null, - "path": "/terminal/locations/list", - "gate": false, - "display_on_load": false - }, - "terminal_readers": { - "title": "Readers", - "group_title": "Terminal", - "group_anchor": "terminal", - "anchor": "terminal_readers", - "section_anchor": "terminal_readers", - "subsection_anchors": [ - "terminal_reader_object", - "create_terminal_reader", - "retrieve_terminal_reader", - "update_terminal_reader", - "delete_terminal_reader", - "list_terminal_reader", - "process_payment_intent", - "process_setup_intent", - "set_reader_display", - "cancel_action", - "present_payment_method" - ], - "path": "/terminal/readers", - "gate": false, - "display_on_load": false, - "data": { - "section_type": "resource", - "title": "Reader", - "description": "A Reader represents a physical device for accepting payment details.\n\nRelated guide: [Connecting to a Reader](/docs/terminal/payments/connect-reader).\n", - "section_tag": "terminal_readers", - "subsection_summaries": [ - { "anchor": "terminal_reader_object", "curl_definition": null }, - { "anchor": "create_terminal_reader", "curl_definition": "POST /v1/terminal/readers" }, - { "anchor": "retrieve_terminal_reader", "curl_definition": "GET /v1/terminal/readers/:id" }, - { "anchor": "update_terminal_reader", "curl_definition": "POST /v1/terminal/readers/:id" }, - { - "anchor": "delete_terminal_reader", - "curl_definition": "DELETE /v1/terminal/readers/:id" - }, - { "anchor": "list_terminal_reader", "curl_definition": "GET /v1/terminal/readers" }, - { - "anchor": "process_payment_intent", - "curl_definition": "POST /v1/terminal/readers/:id/process_payment_intent" - }, - { - "anchor": "process_setup_intent", - "curl_definition": "POST /v1/terminal/readers/:id/process_setup_intent" - }, - { - "anchor": "set_reader_display", - "curl_definition": "POST /v1/terminal/readers/:id/set_reader_display" - }, - { - "anchor": "cancel_action", - "curl_definition": "POST /v1/terminal/readers/:id/cancel_action" - }, - { - "anchor": "present_payment_method", - "curl_definition": "POST /v1/test_helpers/terminal/readers/:id/present_payment_method" - } - ] - } - }, - "terminal_reader_object": { - "title": "The reader object", - "group_title": "Terminal", - "group_anchor": "terminal", - "anchor": "terminal_reader_object", - "section_anchor": "terminal_readers", - "subsection_anchors": null, - "path": "/terminal/readers/object", - "gate": false, - "display_on_load": false - }, - "create_terminal_reader": { - "title": "Create a Reader", - "group_title": "Terminal", - "group_anchor": "terminal", - "anchor": "create_terminal_reader", - "section_anchor": "terminal_readers", - "subsection_anchors": null, - "path": "/terminal/readers/create", - "gate": false, - "display_on_load": false - }, - "retrieve_terminal_reader": { - "title": "Retrieve a Reader", - "group_title": "Terminal", - "group_anchor": "terminal", - "anchor": "retrieve_terminal_reader", - "section_anchor": "terminal_readers", - "subsection_anchors": null, - "path": "/terminal/readers/retrieve", - "gate": false, - "display_on_load": false - }, - "update_terminal_reader": { - "title": "Update a Reader", - "group_title": "Terminal", - "group_anchor": "terminal", - "anchor": "update_terminal_reader", - "section_anchor": "terminal_readers", - "subsection_anchors": null, - "path": "/terminal/readers/update", - "gate": false, - "display_on_load": false - }, - "delete_terminal_reader": { - "title": "Delete a Reader", - "group_title": "Terminal", - "group_anchor": "terminal", - "anchor": "delete_terminal_reader", - "section_anchor": "terminal_readers", - "subsection_anchors": null, - "path": "/terminal/readers/delete", - "gate": false, - "display_on_load": false - }, - "list_terminal_reader": { - "title": "List all Readers", - "group_title": "Terminal", - "group_anchor": "terminal", - "anchor": "list_terminal_reader", - "section_anchor": "terminal_readers", - "subsection_anchors": null, - "path": "/terminal/readers/list", - "gate": false, - "display_on_load": false - }, - "process_payment_intent": { - "title": "Hand-off a PaymentIntent to a Reader", - "group_title": "Terminal", - "group_anchor": "terminal", - "anchor": "process_payment_intent", - "section_anchor": "terminal_readers", - "subsection_anchors": null, - "path": "/terminal/readers/process_payment_intent", - "gate": false, - "display_on_load": false - }, - "process_setup_intent": { - "title": "Hand-off a SetupIntent to a Reader", - "group_title": "Terminal", - "group_anchor": "terminal", - "anchor": "process_setup_intent", - "section_anchor": "terminal_readers", - "subsection_anchors": null, - "path": "/terminal/readers/process_setup_intent", - "gate": false, - "display_on_load": false - }, - "set_reader_display": { - "title": "Set reader display", - "group_title": "Terminal", - "group_anchor": "terminal", - "anchor": "set_reader_display", - "section_anchor": "terminal_readers", - "subsection_anchors": null, - "path": "/terminal/readers/set_reader_display", - "gate": false, - "display_on_load": false - }, - "cancel_action": { - "title": "Cancel the current reader action", - "group_title": "Terminal", - "group_anchor": "terminal", - "anchor": "cancel_action", - "section_anchor": "terminal_readers", - "subsection_anchors": null, - "path": "/terminal/readers/cancel_action", - "gate": false, - "display_on_load": false - }, - "present_payment_method": { - "title": "Simulate presenting a payment method", - "group_title": "Terminal", - "group_anchor": "terminal", - "anchor": "present_payment_method", - "section_anchor": "terminal_readers", - "subsection_anchors": null, - "path": "/terminal/readers/present_payment_method", - "gate": false, - "display_on_load": false - }, - "terminal_hardware_products": { - "title": "Hardware Products", - "group_title": "Terminal", - "group_anchor": "terminal", - "anchor": "terminal_hardware_products", - "section_anchor": "terminal_hardware_products", - "subsection_anchors": [ - "terminal_hardware_product_object", - "retrieve_terminal_hardware_product", - "list_terminal_hardware_product" - ], - "path": "/terminal/hardware_products", - "gate": false, - "display_on_load": false, - "data": { - "section_type": "resource", - "title": "TerminalHardwareProduct", - "description": "A TerminalHardwareProduct is a category of hardware devices that are generally similar, but may have variations depending on the country it’s shipped to.\n\nTerminalHardwareSKUs represent variations within the same Product (for example, a country specific device). For example, WisePOS E is a TerminalHardwareProduct and a WisePOS E - US and WisePOS E - UK are TerminalHardwareSKUs.\n", - "section_tag": "terminal_hardware_products", - "subsection_summaries": [ - { "anchor": "terminal_hardware_product_object", "curl_definition": null }, - { - "anchor": "retrieve_terminal_hardware_product", - "curl_definition": "GET /v1/terminal/hardware_products/:id" - }, - { - "anchor": "list_terminal_hardware_product", - "curl_definition": "GET /v1/terminal/hardware_products" - } - ] - } - }, - "terminal_hardware_product_object": { - "title": "The Terminal Hardware Product object", - "group_title": "Terminal", - "group_anchor": "terminal", - "anchor": "terminal_hardware_product_object", - "section_anchor": "terminal_hardware_products", - "subsection_anchors": null, - "path": "/terminal/hardware_products/object", - "gate": false, - "display_on_load": false - }, - "retrieve_terminal_hardware_product": { - "title": "Retrieve a Terminal Hardware Product", - "group_title": "Terminal", - "group_anchor": "terminal", - "anchor": "retrieve_terminal_hardware_product", - "section_anchor": "terminal_hardware_products", - "subsection_anchors": null, - "path": "/terminal/hardware_products/retrieve", - "gate": false, - "display_on_load": false - }, - "list_terminal_hardware_product": { - "title": "List all Terminal Hardware Products", - "group_title": "Terminal", - "group_anchor": "terminal", - "anchor": "list_terminal_hardware_product", - "section_anchor": "terminal_hardware_products", - "subsection_anchors": null, - "path": "/terminal/hardware_products/list", - "gate": false, - "display_on_load": false - }, - "terminal_hardware_shipping_methods": { - "title": "Hardware Shipping Methods", - "group_title": "Terminal", - "group_anchor": "terminal", - "anchor": "terminal_hardware_shipping_methods", - "section_anchor": "terminal_hardware_shipping_methods", - "subsection_anchors": [ - "terminal_hardware_shipping_method_object", - "retrieve_terminal_hardware_shipping_method", - "list_terminal_hardware_shipping_method" - ], - "path": "/terminal/hardware_shipping_methods", - "gate": false, - "display_on_load": false, - "data": { - "section_type": "resource", - "title": "TerminalHardwareShippingMethod", - "description": "A TerminalHardwareShipping represents a Shipping Method for Terminal hardware. A Shipping Method is a country-specific representation of a way to ship hardware, containing information such as the country, name, and expected delivery date.\n", - "section_tag": "terminal_hardware_shipping_methods", - "subsection_summaries": [ - { "anchor": "terminal_hardware_shipping_method_object", "curl_definition": null }, - { - "anchor": "retrieve_terminal_hardware_shipping_method", - "curl_definition": "GET /v1/terminal/hardware_shipping_methods/:id" - }, - { - "anchor": "list_terminal_hardware_shipping_method", - "curl_definition": "GET /v1/terminal/hardware_shipping_methods" - } - ] - } - }, - "terminal_hardware_shipping_method_object": { - "title": "The Terminal Hardware Shipping Method object", - "group_title": "Terminal", - "group_anchor": "terminal", - "anchor": "terminal_hardware_shipping_method_object", - "section_anchor": "terminal_hardware_shipping_methods", - "subsection_anchors": null, - "path": "/terminal/hardware_shipping_methods/object", - "gate": false, - "display_on_load": false - }, - "retrieve_terminal_hardware_shipping_method": { - "title": "Retrieve a Terminal Hardware Shipping Method", - "group_title": "Terminal", - "group_anchor": "terminal", - "anchor": "retrieve_terminal_hardware_shipping_method", - "section_anchor": "terminal_hardware_shipping_methods", - "subsection_anchors": null, - "path": "/terminal/hardware_shipping_methods/retrieve", - "gate": false, - "display_on_load": false - }, - "list_terminal_hardware_shipping_method": { - "title": "List all Terminal Hardware Shipping Methods", - "group_title": "Terminal", - "group_anchor": "terminal", - "anchor": "list_terminal_hardware_shipping_method", - "section_anchor": "terminal_hardware_shipping_methods", - "subsection_anchors": null, - "path": "/terminal/hardware_shipping_methods/list", - "gate": false, - "display_on_load": false - }, - "terminal_configuration": { - "title": "Configurations", - "group_title": "Terminal", - "group_anchor": "terminal", - "anchor": "terminal_configuration", - "section_anchor": "terminal_configuration", - "subsection_anchors": [ - "terminal_configuration_object", - "create_configuration", - "retrieve_configuration", - "update_configuration", - "delete_configuration", - "list_configuration" - ], - "path": "/terminal/configuration", - "gate": false, - "display_on_load": false, - "data": { - "section_type": "resource", - "title": "Configuration", - "description": "A Configurations object represents how features should be configured for terminal readers.\n", - "section_tag": "terminal_configuration", - "subsection_summaries": [ - { "anchor": "terminal_configuration_object", "curl_definition": null }, - { "anchor": "create_configuration", "curl_definition": "POST /v1/terminal/configurations" }, - { - "anchor": "retrieve_configuration", - "curl_definition": "GET /v1/terminal/configurations/:id" - }, - { - "anchor": "update_configuration", - "curl_definition": "POST /v1/terminal/configurations/:id" - }, - { - "anchor": "delete_configuration", - "curl_definition": "DELETE /v1/terminal/configurations/:id" - }, - { "anchor": "list_configuration", "curl_definition": "GET /v1/terminal/configurations" } - ] - } - }, - "terminal_configuration_object": { - "title": "The Configuration object", - "group_title": "Terminal", - "group_anchor": "terminal", - "anchor": "terminal_configuration_object", - "section_anchor": "terminal_configuration", - "subsection_anchors": null, - "path": "/terminal/configuration/object", - "gate": false, - "display_on_load": false - }, - "create_configuration": { - "title": "Create a Configuration", - "group_title": "Terminal", - "group_anchor": "terminal", - "anchor": "create_configuration", - "section_anchor": "terminal_configuration", - "subsection_anchors": null, - "path": "/terminal/configuration/create", - "gate": false, - "display_on_load": false - }, - "retrieve_configuration": { - "title": "Retrieve a Configuration", - "group_title": "Terminal", - "group_anchor": "terminal", - "anchor": "retrieve_configuration", - "section_anchor": "terminal_configuration", - "subsection_anchors": null, - "path": "/terminal/configuration/retrieve", - "gate": false, - "display_on_load": false - }, - "update_configuration": { - "title": "Update a Configuration", - "group_title": "Terminal", - "group_anchor": "terminal", - "anchor": "update_configuration", - "section_anchor": "terminal_configuration", - "subsection_anchors": null, - "path": "/terminal/configuration/update", - "gate": false, - "display_on_load": false - }, - "delete_configuration": { - "title": "Delete a Configuration", - "group_title": "Terminal", - "group_anchor": "terminal", - "anchor": "delete_configuration", - "section_anchor": "terminal_configuration", - "subsection_anchors": null, - "path": "/terminal/configuration/delete", - "gate": false, - "display_on_load": false - }, - "list_configuration": { - "title": "List all Configurations", - "group_title": "Terminal", - "group_anchor": "terminal", - "anchor": "list_configuration", - "section_anchor": "terminal_configuration", - "subsection_anchors": null, - "path": "/terminal/configuration/list", - "gate": false, - "display_on_load": false - }, - "financial_accounts": { - "title": "FinancialAccounts", - "group_title": "Treasury", - "group_anchor": "treasury", - "anchor": "financial_accounts", - "section_anchor": "financial_accounts", - "subsection_anchors": [ - "financial_account_object", - "create_financial_account", - "update_financial_account", - "retrieve_financial_account", - "list_financial_account" - ], - "path": "/treasury/financial_accounts", - "gate": false, - "display_on_load": false, - "data": { - "section_type": "resource", - "title": "FinancialAccounts", - "description": "Stripe Treasury provides users with a container for money called a FinancialAccount that is separate from their Payments balance.\nFinancialAccounts serve as the source and destination of Treasury’s money movement APIs.\n", - "section_tag": "financial_accounts", - "subsection_summaries": [ - { "anchor": "financial_account_object", "curl_definition": null }, - { - "anchor": "create_financial_account", - "curl_definition": "POST /v1/treasury/financial_accounts" - }, - { - "anchor": "update_financial_account", - "curl_definition": "POST /v1/treasury/financial_accounts/:id" - }, - { - "anchor": "retrieve_financial_account", - "curl_definition": "GET /v1/treasury/financial_accounts/:id" - }, - { - "anchor": "list_financial_account", - "curl_definition": "GET /v1/treasury/financial_accounts" - } - ] - } - }, - "financial_account_object": { - "title": "The FinancialAccount object", - "group_title": "Treasury", - "group_anchor": "treasury", - "anchor": "financial_account_object", - "section_anchor": "financial_accounts", - "subsection_anchors": null, - "path": "/treasury/financial_accounts/object", - "gate": false, - "display_on_load": false - }, - "create_financial_account": { - "title": "Create a FinancialAccount", - "group_title": "Treasury", - "group_anchor": "treasury", - "anchor": "create_financial_account", - "section_anchor": "financial_accounts", - "subsection_anchors": null, - "path": "/treasury/financial_accounts/create", - "gate": false, - "display_on_load": false - }, - "update_financial_account": { - "title": "Update a FinancialAccount", - "group_title": "Treasury", - "group_anchor": "treasury", - "anchor": "update_financial_account", - "section_anchor": "financial_accounts", - "subsection_anchors": null, - "path": "/treasury/financial_accounts/update", - "gate": false, - "display_on_load": false - }, - "retrieve_financial_account": { - "title": "Retrieve a FinancialAccount", - "group_title": "Treasury", - "group_anchor": "treasury", - "anchor": "retrieve_financial_account", - "section_anchor": "financial_accounts", - "subsection_anchors": null, - "path": "/treasury/financial_accounts/retrieve", - "gate": false, - "display_on_load": false - }, - "list_financial_account": { - "title": "List all FinancialAccounts", - "group_title": "Treasury", - "group_anchor": "treasury", - "anchor": "list_financial_account", - "section_anchor": "financial_accounts", - "subsection_anchors": null, - "path": "/treasury/financial_accounts/list", - "gate": false, - "display_on_load": false - }, - "financial_account_features": { - "title": "FinancialAccount Features", - "group_title": "Treasury", - "group_anchor": "treasury", - "anchor": "financial_account_features", - "section_anchor": "financial_account_features", - "subsection_anchors": [ - "financial_account_features_object", - "update_financial_acccount_features", - "retrieve_financial_account_features" - ], - "path": "/treasury/financial_account_features", - "gate": false, - "display_on_load": false, - "data": { - "section_type": "resource", - "title": "FinancialAccount Features", - "description": "Encodes whether a FinancialAccount has access to a particular Feature, with a `status` enum and associated `status_details`.\nStripe or the platform can control Features via the requested field.\n", - "section_tag": "financial_account_features", - "subsection_summaries": [ - { "anchor": "financial_account_features_object", "curl_definition": null }, - { - "anchor": "update_financial_acccount_features", - "curl_definition": "POST /v1/treasury/financial_accounts/:id/features" - }, - { - "anchor": "retrieve_financial_account_features", - "curl_definition": "GET /v1/treasury/financial_accounts/:id/features" - } - ] - } - }, - "financial_account_features_object": { - "title": "The FinancialAccount Feature object", - "group_title": "Treasury", - "group_anchor": "treasury", - "anchor": "financial_account_features_object", - "section_anchor": "financial_account_features", - "subsection_anchors": null, - "path": "/treasury/financial_account_features/object", - "gate": false, - "display_on_load": false - }, - "update_financial_acccount_features": { - "title": "Update FinancialAccount Features", - "group_title": "Treasury", - "group_anchor": "treasury", - "anchor": "update_financial_acccount_features", - "section_anchor": "financial_account_features", - "subsection_anchors": null, - "path": "/treasury/financial_account_features/update", - "gate": false, - "display_on_load": false - }, - "retrieve_financial_account_features": { - "title": "Retrieve FinancialAccount Features", - "group_title": "Treasury", - "group_anchor": "treasury", - "anchor": "retrieve_financial_account_features", - "section_anchor": "financial_account_features", - "subsection_anchors": null, - "path": "/treasury/financial_account_features/retrieve", - "gate": false, - "display_on_load": false - }, - "transactions": { - "title": "Transactions", - "group_title": "Treasury", - "group_anchor": "treasury", - "anchor": "transactions", - "section_anchor": "transactions", - "subsection_anchors": ["transaction_object", "retrieve_transaction", "list_transactions"], - "path": "/treasury/transactions", - "gate": false, - "display_on_load": false, - "data": { - "section_type": "resource", - "title": "Transactions", - "description": "Transactions represent changes to a [FinancialAccount's](#financial_accounts) balance.\n", - "section_tag": "transactions", - "subsection_summaries": [ - { "anchor": "transaction_object", "curl_definition": null }, - { - "anchor": "retrieve_transaction", - "curl_definition": "GET /v1/treasury/transactions/:id" - }, - { "anchor": "list_transactions", "curl_definition": "GET /v1/treasury/transactions" } - ] - } - }, - "transaction_object": { - "title": "The Transaction object", - "group_title": "Treasury", - "group_anchor": "treasury", - "anchor": "transaction_object", - "section_anchor": "transactions", - "subsection_anchors": null, - "path": "/treasury/transactions/object", - "gate": false, - "display_on_load": false - }, - "retrieve_transaction": { - "title": "Retrieve a Transaction", - "group_title": "Treasury", - "group_anchor": "treasury", - "anchor": "retrieve_transaction", - "section_anchor": "transactions", - "subsection_anchors": null, - "path": "/treasury/transactions/retrieve", - "gate": false, - "display_on_load": false - }, - "list_transactions": { - "title": "List all Transactions", - "group_title": "Treasury", - "group_anchor": "treasury", - "anchor": "list_transactions", - "section_anchor": "transactions", - "subsection_anchors": null, - "path": "/treasury/transactions/list", - "gate": false, - "display_on_load": false - }, - "transaction_entries": { - "title": "TransactionEntries", - "group_title": "Treasury", - "group_anchor": "treasury", - "anchor": "transaction_entries", - "section_anchor": "transaction_entries", - "subsection_anchors": [ - "transaction_entry_object", - "retrieve_transaction_entry", - "list_transaction_entries" - ], - "path": "/treasury/transaction_entries", - "gate": false, - "display_on_load": false, - "data": { - "section_type": "resource", - "title": "TransactionEntries", - "description": "TransactionEntries represent individual units of money movements within a single [Transaction](#transactions).\n", - "section_tag": "transaction_entries", - "subsection_summaries": [ - { "anchor": "transaction_entry_object", "curl_definition": null }, - { - "anchor": "retrieve_transaction_entry", - "curl_definition": "GET /v1/treasury/transaction_entries/:id" - }, - { - "anchor": "list_transaction_entries", - "curl_definition": "GET /v1/treasury/transaction_entries" - } - ] - } - }, - "transaction_entry_object": { - "title": "The TransactionEntry object", - "group_title": "Treasury", - "group_anchor": "treasury", - "anchor": "transaction_entry_object", - "section_anchor": "transaction_entries", - "subsection_anchors": null, - "path": "/treasury/transaction_entries/object", - "gate": false, - "display_on_load": false - }, - "retrieve_transaction_entry": { - "title": "Retrieve a TransactionEntry", - "group_title": "Treasury", - "group_anchor": "treasury", - "anchor": "retrieve_transaction_entry", - "section_anchor": "transaction_entries", - "subsection_anchors": null, - "path": "/treasury/transaction_entries/retrieve", - "gate": false, - "display_on_load": false - }, - "list_transaction_entries": { - "title": "List all TransactionEntries", - "group_title": "Treasury", - "group_anchor": "treasury", - "anchor": "list_transaction_entries", - "section_anchor": "transaction_entries", - "subsection_anchors": null, - "path": "/treasury/transaction_entries/list", - "gate": false, - "display_on_load": false - }, - "outbound_transfers": { - "title": "OutboundTransfers", - "group_title": "Treasury", - "group_anchor": "treasury", - "anchor": "outbound_transfers", - "section_anchor": "outbound_transfers", - "subsection_anchors": [ - "outbound_transfer_object", - "create_outbound_transfer", - "cancel_outbound_transfer", - "retrieve_outbound_transfer", - "list_outbound_transfers", - "test_mode_post_outbound_transfer", - "test_mode_return_outbound_transfer", - "test_mode_fail_outbound_transfer" - ], - "path": "/treasury/outbound_transfers", - "gate": false, - "display_on_load": false, - "data": { - "section_type": "resource", - "title": "OutboundTransfers", - "description": "Use OutboundTransfers to transfer funds from a [FinancialAccount](#financial_accounts) to a PaymentMethod belonging to the same entity. To send funds to a different party, use [OutboundPayments](#outbound_payments) instead. You can send funds over ACH rails or through a domestic wire transfer to a user's own external bank account.\n\nSimulate OutboundTransfer state changes with the `/v1/test_helpers/treasury/outbound_transfers` endpoints. These methods can only be called on test mode objects.\n", - "section_tag": "outbound_transfers", - "subsection_summaries": [ - { "anchor": "outbound_transfer_object", "curl_definition": null }, - { - "anchor": "create_outbound_transfer", - "curl_definition": "POST /v1/treasury/outbound_transfers" - }, - { - "anchor": "cancel_outbound_transfer", - "curl_definition": "POST /v1/treasury/outbound_transfers/:id/cancel" - }, - { - "anchor": "retrieve_outbound_transfer", - "curl_definition": "GET /v1/treasury/outbound_transfers/:id" - }, - { - "anchor": "list_outbound_transfers", - "curl_definition": "GET /v1/treasury/outbound_transfers" - }, - { - "anchor": "test_mode_post_outbound_transfer", - "curl_definition": "POST /v1/test_helpers/treasury/outbound_transfers/:id/post" - }, - { - "anchor": "test_mode_return_outbound_transfer", - "curl_definition": "POST /v1/test_helpers/treasury/outbound_transfers/:id/return" - }, - { - "anchor": "test_mode_fail_outbound_transfer", - "curl_definition": "POST /v1/test_helpers/treasury/outbound_transfers/:id/fail" - } - ] - } - }, - "outbound_transfer_object": { - "title": "The OutboundTransfer object", - "group_title": "Treasury", - "group_anchor": "treasury", - "anchor": "outbound_transfer_object", - "section_anchor": "outbound_transfers", - "subsection_anchors": null, - "path": "/treasury/outbound_transfers/object", - "gate": false, - "display_on_load": false - }, - "create_outbound_transfer": { - "title": "Create an OutboundTransfer", - "group_title": "Treasury", - "group_anchor": "treasury", - "anchor": "create_outbound_transfer", - "section_anchor": "outbound_transfers", - "subsection_anchors": null, - "path": "/treasury/outbound_transfers/create", - "gate": false, - "display_on_load": false - }, - "cancel_outbound_transfer": { - "title": "Cancel an OutboundTransfer", - "group_title": "Treasury", - "group_anchor": "treasury", - "anchor": "cancel_outbound_transfer", - "section_anchor": "outbound_transfers", - "subsection_anchors": null, - "path": "/treasury/outbound_transfers/cancel", - "gate": false, - "display_on_load": false - }, - "retrieve_outbound_transfer": { - "title": "Retrieve an OutboundTransfer", - "group_title": "Treasury", - "group_anchor": "treasury", - "anchor": "retrieve_outbound_transfer", - "section_anchor": "outbound_transfers", - "subsection_anchors": null, - "path": "/treasury/outbound_transfers/retrieve", - "gate": false, - "display_on_load": false - }, - "list_outbound_transfers": { - "title": "List all OutboundTransfers", - "group_title": "Treasury", - "group_anchor": "treasury", - "anchor": "list_outbound_transfers", - "section_anchor": "outbound_transfers", - "subsection_anchors": null, - "path": "/treasury/outbound_transfers/list", - "gate": false, - "display_on_load": false - }, - "test_mode_post_outbound_transfer": { - "title": "Test mode: Post an OutboundTransfer", - "group_title": "Treasury", - "group_anchor": "treasury", - "anchor": "test_mode_post_outbound_transfer", - "section_anchor": "outbound_transfers", - "subsection_anchors": null, - "path": "/treasury/outbound_transfers/test_mode_post", - "gate": false, - "display_on_load": false - }, - "test_mode_return_outbound_transfer": { - "title": "Test mode: Return an OutboundTransfer", - "group_title": "Treasury", - "group_anchor": "treasury", - "anchor": "test_mode_return_outbound_transfer", - "section_anchor": "outbound_transfers", - "subsection_anchors": null, - "path": "/treasury/outbound_transfers/test_mode_return", - "gate": false, - "display_on_load": false - }, - "test_mode_fail_outbound_transfer": { - "title": "Test mode: Fail an OutboundTransfer", - "group_title": "Treasury", - "group_anchor": "treasury", - "anchor": "test_mode_fail_outbound_transfer", - "section_anchor": "outbound_transfers", - "subsection_anchors": null, - "path": "/treasury/outbound_transfers/test_mode_fail", - "gate": false, - "display_on_load": false - }, - "outbound_payments": { - "title": "OutboundPayments", - "group_title": "Treasury", - "group_anchor": "treasury", - "anchor": "outbound_payments", - "section_anchor": "outbound_payments", - "subsection_anchors": [ - "outbound_payment_object", - "create_outbound_payment", - "cancel_outbound_payment", - "retrieve_outbound_payment", - "list_outbound_payment", - "test_mode_outbound_payment_post", - "test_mode_outbound_payment_return", - "test_mode_outbound_payment_fail" - ], - "path": "/treasury/outbound_payments", - "gate": false, - "display_on_load": false, - "data": { - "section_type": "resource", - "title": "Outbound Payments", - "description": "Use OutboundPayments to send funds to another party's external bank account or [FinancialAccount](#financial_accounts). To send money to an account belonging to the same user, use an [OutboundTransfer](#outbound_transfers).\n\nSimulate OutboundPayment state changes with the `/v1/test_helpers/treasury/outbound_payments` endpoints. These methods can only be called on test mode objects.\n", - "section_tag": "outbound_payments", - "subsection_summaries": [ - { "anchor": "outbound_payment_object", "curl_definition": null }, - { - "anchor": "create_outbound_payment", - "curl_definition": "POST /v1/treasury/outbound_payments" - }, - { - "anchor": "cancel_outbound_payment", - "curl_definition": "POST /v1/treasury/outbound_payments/:id/cancel" - }, - { - "anchor": "retrieve_outbound_payment", - "curl_definition": "GET /v1/treasury/outbound_payments/:id" - }, - { - "anchor": "list_outbound_payment", - "curl_definition": "GET /v1/treasury/outbound_payments" - }, - { - "anchor": "test_mode_outbound_payment_post", - "curl_definition": "POST /v1/test_helpers/treasury/outbound_payments/:id/post" - }, - { - "anchor": "test_mode_outbound_payment_return", - "curl_definition": "POST /v1/test_helpers/treasury/outbound_payments/:id/return" - }, - { - "anchor": "test_mode_outbound_payment_fail", - "curl_definition": "POST /v1/test_helpers/treasury/outbound_payments/:id/fail" - } - ] - } - }, - "outbound_payment_object": { - "title": "The OutboundPayment object", - "group_title": "Treasury", - "group_anchor": "treasury", - "anchor": "outbound_payment_object", - "section_anchor": "outbound_payments", - "subsection_anchors": null, - "path": "/treasury/outbound_payments/object", - "gate": false, - "display_on_load": false - }, - "create_outbound_payment": { - "title": "Create an OutboundPayment", - "group_title": "Treasury", - "group_anchor": "treasury", - "anchor": "create_outbound_payment", - "section_anchor": "outbound_payments", - "subsection_anchors": null, - "path": "/treasury/outbound_payments/create", - "gate": false, - "display_on_load": false - }, - "cancel_outbound_payment": { - "title": "Cancel an OutboundPayment", - "group_title": "Treasury", - "group_anchor": "treasury", - "anchor": "cancel_outbound_payment", - "section_anchor": "outbound_payments", - "subsection_anchors": null, - "path": "/treasury/outbound_payments/cancel", - "gate": false, - "display_on_load": false - }, - "retrieve_outbound_payment": { - "title": "Retrieve an OutboundPayment", - "group_title": "Treasury", - "group_anchor": "treasury", - "anchor": "retrieve_outbound_payment", - "section_anchor": "outbound_payments", - "subsection_anchors": null, - "path": "/treasury/outbound_payments/retrieve", - "gate": false, - "display_on_load": false - }, - "list_outbound_payment": { - "title": "List all OutboundPayments", - "group_title": "Treasury", - "group_anchor": "treasury", - "anchor": "list_outbound_payment", - "section_anchor": "outbound_payments", - "subsection_anchors": null, - "path": "/treasury/outbound_payments/list", - "gate": false, - "display_on_load": false - }, - "test_mode_outbound_payment_post": { - "title": "Test mode: Post an OutboundPayment", - "group_title": "Treasury", - "group_anchor": "treasury", - "anchor": "test_mode_outbound_payment_post", - "section_anchor": "outbound_payments", - "subsection_anchors": null, - "path": "/treasury/outbound_payments/test_mode_post", - "gate": false, - "display_on_load": false - }, - "test_mode_outbound_payment_return": { - "title": "Test mode: Return an OutboundPayment", - "group_title": "Treasury", - "group_anchor": "treasury", - "anchor": "test_mode_outbound_payment_return", - "section_anchor": "outbound_payments", - "subsection_anchors": null, - "path": "/treasury/outbound_payments/test_mode_return", - "gate": false, - "display_on_load": false - }, - "test_mode_outbound_payment_fail": { - "title": "Test mode: Fail an OutboundPayment", - "group_title": "Treasury", - "group_anchor": "treasury", - "anchor": "test_mode_outbound_payment_fail", - "section_anchor": "outbound_payments", - "subsection_anchors": null, - "path": "/treasury/outbound_payments/test_mode_fail", - "gate": false, - "display_on_load": false - }, - "inbound_transfers": { - "title": "InboundTransfers", - "group_title": "Treasury", - "group_anchor": "treasury", - "anchor": "inbound_transfers", - "section_anchor": "inbound_transfers", - "subsection_anchors": [ - "inbound_transfer_object", - "create_inbound_transfer", - "cancel_inbound_transfer", - "retrieve_inbound_transfer", - "list_inbound_transfer", - "test_mode_inbound_transfer_fail", - "test_mode_inbound_transfer_return", - "test_mode_inbound_transfer_succeed" - ], - "path": "/treasury/inbound_transfers", - "gate": false, - "display_on_load": false, - "data": { - "section_type": "resource", - "title": "InboundTransfers", - "description": "Use [InboundTransfers](/docs/treasury/moving-money/financial-accounts/into/inbound-transfers) to add funds to your [FinancialAccount](#financial_accounts) via a PaymentMethod that is owned by you. The funds will be transferred via an ACH debit.\n", - "section_tag": "inbound_transfers", - "subsection_summaries": [ - { "anchor": "inbound_transfer_object", "curl_definition": null }, - { - "anchor": "create_inbound_transfer", - "curl_definition": "POST /v1/treasury/inbound_transfers" - }, - { - "anchor": "cancel_inbound_transfer", - "curl_definition": "POST /v1/treasury/inbound_transfers/:id/cancel" - }, - { - "anchor": "retrieve_inbound_transfer", - "curl_definition": "GET /v1/treasury/inbound_transfers/:id" - }, - { - "anchor": "list_inbound_transfer", - "curl_definition": "GET /v1/treasury/inbound_transfers" - }, - { - "anchor": "test_mode_inbound_transfer_fail", - "curl_definition": "POST /v1/test_helpers/treasury/inbound_transfers/:id/fail" - }, - { - "anchor": "test_mode_inbound_transfer_return", - "curl_definition": "POST /v1/test_helpers/treasury/inbound_transfers/:id/return" - }, - { - "anchor": "test_mode_inbound_transfer_succeed", - "curl_definition": "POST /v1/test_helpers/treasury/inbound_transfers/:id/succeed" - } - ] - } - }, - "inbound_transfer_object": { - "title": "The InboundTransfer object", - "group_title": "Treasury", - "group_anchor": "treasury", - "anchor": "inbound_transfer_object", - "section_anchor": "inbound_transfers", - "subsection_anchors": null, - "path": "/treasury/inbound_transfers/object", - "gate": false, - "display_on_load": false - }, - "create_inbound_transfer": { - "title": "Create an InboundTransfer", - "group_title": "Treasury", - "group_anchor": "treasury", - "anchor": "create_inbound_transfer", - "section_anchor": "inbound_transfers", - "subsection_anchors": null, - "path": "/treasury/inbound_transfers/create", - "gate": false, - "display_on_load": false - }, - "cancel_inbound_transfer": { - "title": "Cancel an InboundTransfer", - "group_title": "Treasury", - "group_anchor": "treasury", - "anchor": "cancel_inbound_transfer", - "section_anchor": "inbound_transfers", - "subsection_anchors": null, - "path": "/treasury/inbound_transfers/cancel", - "gate": false, - "display_on_load": false - }, - "retrieve_inbound_transfer": { - "title": "Retrieve an InboundTransfer", - "group_title": "Treasury", - "group_anchor": "treasury", - "anchor": "retrieve_inbound_transfer", - "section_anchor": "inbound_transfers", - "subsection_anchors": null, - "path": "/treasury/inbound_transfers/retrieve", - "gate": false, - "display_on_load": false - }, - "list_inbound_transfer": { - "title": "List all InboundTransfers", - "group_title": "Treasury", - "group_anchor": "treasury", - "anchor": "list_inbound_transfer", - "section_anchor": "inbound_transfers", - "subsection_anchors": null, - "path": "/treasury/inbound_transfers/list", - "gate": false, - "display_on_load": false - }, - "test_mode_inbound_transfer_fail": { - "title": "Test mode: Fail an InboundTransfer", - "group_title": "Treasury", - "group_anchor": "treasury", - "anchor": "test_mode_inbound_transfer_fail", - "section_anchor": "inbound_transfers", - "subsection_anchors": null, - "path": "/treasury/inbound_transfers/test_mode_fail", - "gate": false, - "display_on_load": false - }, - "test_mode_inbound_transfer_return": { - "title": "Test mode: Return an InboundTransfer", - "group_title": "Treasury", - "group_anchor": "treasury", - "anchor": "test_mode_inbound_transfer_return", - "section_anchor": "inbound_transfers", - "subsection_anchors": null, - "path": "/treasury/inbound_transfers/test_mode_return", - "gate": false, - "display_on_load": false - }, - "test_mode_inbound_transfer_succeed": { - "title": "Test mode: Succeed an InboundTransfer", - "group_title": "Treasury", - "group_anchor": "treasury", - "anchor": "test_mode_inbound_transfer_succeed", - "section_anchor": "inbound_transfers", - "subsection_anchors": null, - "path": "/treasury/inbound_transfers/test_mode_succeed", - "gate": false, - "display_on_load": false - }, - "received_credits": { - "title": "ReceivedCredits", - "group_title": "Treasury", - "group_anchor": "treasury", - "anchor": "received_credits", - "section_anchor": "received_credits", - "subsection_anchors": [ - "received_credit_object", - "retrieve_received_credit", - "list_received_credit", - "test_mode_create_received_credit" - ], - "path": "/treasury/received_credits", - "gate": false, - "display_on_load": false, - "data": { - "section_type": "resource", - "title": "ReceivedCredits", - "description": "ReceivedCredits represent funds sent to a [FinancialAccount](#financial_accounts) (for example, via ACH or wire). These money movements are not initiated from the FinancialAccount.\n", - "section_tag": "received_credits", - "subsection_summaries": [ - { "anchor": "received_credit_object", "curl_definition": null }, - { - "anchor": "retrieve_received_credit", - "curl_definition": "GET /v1/treasury/received_credits/:id" - }, - { - "anchor": "list_received_credit", - "curl_definition": "GET /v1/treasury/received_credits" - }, - { - "anchor": "test_mode_create_received_credit", - "curl_definition": "POST /v1/test_helpers/treasury/received_credits" - } - ] - } - }, - "received_credit_object": { - "title": "The ReceivedCredit object", - "group_title": "Treasury", - "group_anchor": "treasury", - "anchor": "received_credit_object", - "section_anchor": "received_credits", - "subsection_anchors": null, - "path": "/treasury/received_credits/object", - "gate": false, - "display_on_load": false - }, - "retrieve_received_credit": { - "title": "Retrieve a ReceivedCredit", - "group_title": "Treasury", - "group_anchor": "treasury", - "anchor": "retrieve_received_credit", - "section_anchor": "received_credits", - "subsection_anchors": null, - "path": "/treasury/received_credits/retrieve", - "gate": false, - "display_on_load": false - }, - "list_received_credit": { - "title": "List all ReceivedCredits", - "group_title": "Treasury", - "group_anchor": "treasury", - "anchor": "list_received_credit", - "section_anchor": "received_credits", - "subsection_anchors": null, - "path": "/treasury/received_credits/list", - "gate": false, - "display_on_load": false - }, - "test_mode_create_received_credit": { - "title": "Test mode: Create a ReceivedCredit", - "group_title": "Treasury", - "group_anchor": "treasury", - "anchor": "test_mode_create_received_credit", - "section_anchor": "received_credits", - "subsection_anchors": null, - "path": "/treasury/received_credits/test_mode_create", - "gate": false, - "display_on_load": false - }, - "received_debits": { - "title": "ReceivedDebits", - "group_title": "Treasury", - "group_anchor": "treasury", - "anchor": "received_debits", - "section_anchor": "received_debits", - "subsection_anchors": [ - "received_debit_object", - "retrieve_received_debit", - "list_received_debit", - "test_mode_create_received_debit" - ], - "path": "/treasury/received_debits", - "gate": false, - "display_on_load": false, - "data": { - "section_type": "resource", - "title": "ReceivedDebits", - "description": "ReceivedDebits represent funds pulled from a [FinancialAccount](#financial_accounts). These are not initiated from the FinancialAccount.\n", - "section_tag": "received_debits", - "subsection_summaries": [ - { "anchor": "received_debit_object", "curl_definition": null }, - { - "anchor": "retrieve_received_debit", - "curl_definition": "GET /v1/treasury/received_debits/:id" - }, - { "anchor": "list_received_debit", "curl_definition": "GET /v1/treasury/received_debits" }, - { - "anchor": "test_mode_create_received_debit", - "curl_definition": "POST /v1/test_helpers/treasury/received_debits" - } - ] - } - }, - "received_debit_object": { - "title": "The ReceivedDebit object", - "group_title": "Treasury", - "group_anchor": "treasury", - "anchor": "received_debit_object", - "section_anchor": "received_debits", - "subsection_anchors": null, - "path": "/treasury/received_debits/object", - "gate": false, - "display_on_load": false - }, - "retrieve_received_debit": { - "title": "Retrieve a ReceivedDebit", - "group_title": "Treasury", - "group_anchor": "treasury", - "anchor": "retrieve_received_debit", - "section_anchor": "received_debits", - "subsection_anchors": null, - "path": "/treasury/received_debits/retrieve", - "gate": false, - "display_on_load": false - }, - "list_received_debit": { - "title": "List all ReceivedDebits", - "group_title": "Treasury", - "group_anchor": "treasury", - "anchor": "list_received_debit", - "section_anchor": "received_debits", - "subsection_anchors": null, - "path": "/treasury/received_debits/list", - "gate": false, - "display_on_load": false - }, - "test_mode_create_received_debit": { - "title": "Test mode: Create a ReceivedDebit", - "group_title": "Treasury", - "group_anchor": "treasury", - "anchor": "test_mode_create_received_debit", - "section_anchor": "received_debits", - "subsection_anchors": null, - "path": "/treasury/received_debits/test_mode_create", - "gate": false, - "display_on_load": false - }, - "credit_reversals": { - "title": "CreditReversals", - "group_title": "Treasury", - "group_anchor": "treasury", - "anchor": "credit_reversals", - "section_anchor": "credit_reversals", - "subsection_anchors": [ - "credit_reversal_object", - "create_credit_reversal", - "retrieve_credit_reversal", - "list_credit_reversal" - ], - "path": "/treasury/credit_reversals", - "gate": false, - "display_on_load": false, - "data": { - "section_type": "resource", - "title": "CreditReversals", - "description": "You can reverse some [ReceivedCredits](#received_credits) depending on their network and source flow. Reversing a ReceivedCredit leads to the creation of a new object known as a CreditReversal.\n", - "section_tag": "credit_reversals", - "subsection_summaries": [ - { "anchor": "credit_reversal_object", "curl_definition": null }, - { - "anchor": "create_credit_reversal", - "curl_definition": "POST /v1/treasury/credit_reversals" - }, - { - "anchor": "retrieve_credit_reversal", - "curl_definition": "GET /v1/treasury/credit_reversals/:id" - }, - { "anchor": "list_credit_reversal", "curl_definition": "GET /v1/treasury/credit_reversals" } - ] - } - }, - "credit_reversal_object": { - "title": "The CreditReversal object", - "group_title": "Treasury", - "group_anchor": "treasury", - "anchor": "credit_reversal_object", - "section_anchor": "credit_reversals", - "subsection_anchors": null, - "path": "/treasury/credit_reversals/object", - "gate": false, - "display_on_load": false - }, - "create_credit_reversal": { - "title": "Create a CreditReversal", - "group_title": "Treasury", - "group_anchor": "treasury", - "anchor": "create_credit_reversal", - "section_anchor": "credit_reversals", - "subsection_anchors": null, - "path": "/treasury/credit_reversals/create", - "gate": false, - "display_on_load": false - }, - "retrieve_credit_reversal": { - "title": "Retrieve a CreditReversal", - "group_title": "Treasury", - "group_anchor": "treasury", - "anchor": "retrieve_credit_reversal", - "section_anchor": "credit_reversals", - "subsection_anchors": null, - "path": "/treasury/credit_reversals/retrieve", - "gate": false, - "display_on_load": false - }, - "list_credit_reversal": { - "title": "List all CreditReversals", - "group_title": "Treasury", - "group_anchor": "treasury", - "anchor": "list_credit_reversal", - "section_anchor": "credit_reversals", - "subsection_anchors": null, - "path": "/treasury/credit_reversals/list", - "gate": false, - "display_on_load": false - }, - "debit_reversals": { - "title": "DebitReversals", - "group_title": "Treasury", - "group_anchor": "treasury", - "anchor": "debit_reversals", - "section_anchor": "debit_reversals", - "subsection_anchors": [ - "debit_reversal_object", - "create_debit_reversal", - "retrieve_debit_reversal", - "list_debit_reversal" - ], - "path": "/treasury/debit_reversals", - "gate": false, - "display_on_load": false, - "data": { - "section_type": "resource", - "title": "DebitReversals", - "description": "You can reverse some [ReceivedDebits](#received_debits) depending on their network and source flow. Reversing a ReceivedDebit leads to the creation of a new object known as a DebitReversal.\n", - "section_tag": "debit_reversals", - "subsection_summaries": [ - { "anchor": "debit_reversal_object", "curl_definition": null }, - { - "anchor": "create_debit_reversal", - "curl_definition": "POST /v1/treasury/debit_reversals" - }, - { - "anchor": "retrieve_debit_reversal", - "curl_definition": "GET /v1/treasury/debit_reversals/:id" - }, - { "anchor": "list_debit_reversal", "curl_definition": "GET /v1/treasury/debit_reversals" } - ] - } - }, - "debit_reversal_object": { - "title": "The DebitReversal object", - "group_title": "Treasury", - "group_anchor": "treasury", - "anchor": "debit_reversal_object", - "section_anchor": "debit_reversals", - "subsection_anchors": null, - "path": "/treasury/debit_reversals/object", - "gate": false, - "display_on_load": false - }, - "create_debit_reversal": { - "title": "Create a DebitReversal", - "group_title": "Treasury", - "group_anchor": "treasury", - "anchor": "create_debit_reversal", - "section_anchor": "debit_reversals", - "subsection_anchors": null, - "path": "/treasury/debit_reversals/create", - "gate": false, - "display_on_load": false - }, - "retrieve_debit_reversal": { - "title": "Retrieve a DebitReversal", - "group_title": "Treasury", - "group_anchor": "treasury", - "anchor": "retrieve_debit_reversal", - "section_anchor": "debit_reversals", - "subsection_anchors": null, - "path": "/treasury/debit_reversals/retrieve", - "gate": false, - "display_on_load": false - }, - "list_debit_reversal": { - "title": "List all DebitReversals", - "group_title": "Treasury", - "group_anchor": "treasury", - "anchor": "list_debit_reversal", - "section_anchor": "debit_reversals", - "subsection_anchors": null, - "path": "/treasury/debit_reversals/list", - "gate": false, - "display_on_load": false - }, - "scheduled_queries": { - "title": "Scheduled Queries", - "group_title": "Sigma", - "group_anchor": "sigma", - "anchor": "scheduled_queries", - "section_anchor": "scheduled_queries", - "subsection_anchors": [ - "scheduled_query_run_object", - "retrieve_scheduled_query_run", - "list_scheduled_query_run" - ], - "path": "/sigma/scheduled_queries", - "gate": false, - "display_on_load": false, - "data": { - "section_type": "resource", - "title": "Scheduled Queries", - "description": "If you have [scheduled a Sigma query](/docs/sigma/scheduled-queries), you'll\nreceive a `sigma.scheduled_query_run.created` webhook each time the query\nruns. The webhook contains a `ScheduledQueryRun` object, which you can use to\nretrieve the query results.\n", - "section_tag": "scheduled_queries", - "subsection_summaries": [ - { "anchor": "scheduled_query_run_object", "curl_definition": null }, - { - "anchor": "retrieve_scheduled_query_run", - "curl_definition": "GET /v1/sigma/scheduled_query_runs/:id" - }, - { - "anchor": "list_scheduled_query_run", - "curl_definition": "GET /v1/sigma/scheduled_query_runs" - } - ] - } - }, - "scheduled_query_run_object": { - "title": "The scheduled query run object", - "group_title": "Sigma", - "group_anchor": "sigma", - "anchor": "scheduled_query_run_object", - "section_anchor": "scheduled_queries", - "subsection_anchors": null, - "path": "/sigma/scheduled_queries/object", - "gate": false, - "display_on_load": false - }, - "retrieve_scheduled_query_run": { - "title": "Retrieve a scheduled query run", - "group_title": "Sigma", - "group_anchor": "sigma", - "anchor": "retrieve_scheduled_query_run", - "section_anchor": "scheduled_queries", - "subsection_anchors": null, - "path": "/sigma/scheduled_queries/retrieve", - "gate": false, - "display_on_load": false - }, - "list_scheduled_query_run": { - "title": "List all scheduled query runs", - "group_title": "Sigma", - "group_anchor": "sigma", - "anchor": "list_scheduled_query_run", - "section_anchor": "scheduled_queries", - "subsection_anchors": null, - "path": "/sigma/scheduled_queries/list", - "gate": false, - "display_on_load": false - }, - "reporting_report_run": { - "title": "Report Runs", - "group_title": "Reporting", - "group_anchor": "reporting", - "anchor": "reporting_report_run", - "section_anchor": "reporting_report_run", - "subsection_anchors": [ - "reporting_report_run_object", - "create_reporting_report_run", - "retrieve_reporting_report_run", - "list_reporting_report_run" - ], - "path": "/reporting/report_run", - "gate": false, - "display_on_load": false, - "data": { - "section_type": "resource", - "title": "Report Runs", - "description": "The Report Run object represents an instance of a report type generated with\nspecific run parameters. Once the object is created, Stripe begins processing the report.\nWhen the report has finished running, it will give you a reference to a file\nwhere you can retrieve your results. For an overview, see\n[API Access to Reports](/docs/reporting/statements/api).\n\nNote that certain report types can only be run based on your live-mode data (not test-mode\ndata), and will error when queried without a [live-mode API key](/docs/keys#test-live-modes).\n", - "section_tag": "reporting_report_run", - "subsection_summaries": [ - { "anchor": "reporting_report_run_object", "curl_definition": null }, - { - "anchor": "create_reporting_report_run", - "curl_definition": "POST /v1/reporting/report_runs" - }, - { - "anchor": "retrieve_reporting_report_run", - "curl_definition": "GET /v1/reporting/report_runs/:id" - }, - { - "anchor": "list_reporting_report_run", - "curl_definition": "GET /v1/reporting/report_runs" - } - ] - } - }, - "reporting_report_run_object": { - "title": "The Report Run object", - "group_title": "Reporting", - "group_anchor": "reporting", - "anchor": "reporting_report_run_object", - "section_anchor": "reporting_report_run", - "subsection_anchors": null, - "path": "/reporting/report_run/object", - "gate": false, - "display_on_load": false - }, - "create_reporting_report_run": { - "title": "Create a Report Run", - "group_title": "Reporting", - "group_anchor": "reporting", - "anchor": "create_reporting_report_run", - "section_anchor": "reporting_report_run", - "subsection_anchors": null, - "path": "/reporting/report_run/create", - "gate": false, - "display_on_load": false - }, - "retrieve_reporting_report_run": { - "title": "Retrieve a Report Run", - "group_title": "Reporting", - "group_anchor": "reporting", - "anchor": "retrieve_reporting_report_run", - "section_anchor": "reporting_report_run", - "subsection_anchors": null, - "path": "/reporting/report_run/retrieve", - "gate": false, - "display_on_load": false - }, - "list_reporting_report_run": { - "title": "List all Report Runs", - "group_title": "Reporting", - "group_anchor": "reporting", - "anchor": "list_reporting_report_run", - "section_anchor": "reporting_report_run", - "subsection_anchors": null, - "path": "/reporting/report_run/list", - "gate": false, - "display_on_load": false - }, - "reporting_report_type": { - "title": "Report Types", - "group_title": "Reporting", - "group_anchor": "reporting", - "anchor": "reporting_report_type", - "section_anchor": "reporting_report_type", - "subsection_anchors": [ - "reporting_report_type_object", - "retrieve_reporting_report_type", - "list_reporting_report_type" - ], - "path": "/reporting/report_type", - "gate": false, - "display_on_load": false, - "data": { - "section_type": "resource", - "title": "Report Types", - "description": "The Report Type resource corresponds to a particular type of report, such as\nthe \"Activity summary\" or \"Itemized payouts\" reports. These objects are\nidentified by an ID belonging to a set of enumerated values. See\n[API Access to Reports documentation](/docs/reporting/statements/api)\nfor those Report Type IDs, along with required and optional parameters.\n\nNote that certain report types can only be run based on your live-mode data (not test-mode\ndata), and will error when queried without a [live-mode API key](/docs/keys#test-live-modes).\n", - "section_tag": "reporting_report_type", - "subsection_summaries": [ - { "anchor": "reporting_report_type_object", "curl_definition": null }, - { - "anchor": "retrieve_reporting_report_type", - "curl_definition": "GET /v1/reporting/report_types/:id" - }, - { - "anchor": "list_reporting_report_type", - "curl_definition": "GET /v1/reporting/report_types" - } - ] - } - }, - "reporting_report_type_object": { - "title": "The Report Type object", - "group_title": "Reporting", - "group_anchor": "reporting", - "anchor": "reporting_report_type_object", - "section_anchor": "reporting_report_type", - "subsection_anchors": null, - "path": "/reporting/report_type/object", - "gate": false, - "display_on_load": false - }, - "retrieve_reporting_report_type": { - "title": "Retrieve a Report Type", - "group_title": "Reporting", - "group_anchor": "reporting", - "anchor": "retrieve_reporting_report_type", - "section_anchor": "reporting_report_type", - "subsection_anchors": null, - "path": "/reporting/report_type/retrieve", - "gate": false, - "display_on_load": false - }, - "list_reporting_report_type": { - "title": "List all Report Types", - "group_title": "Reporting", - "group_anchor": "reporting", - "anchor": "list_reporting_report_type", - "section_anchor": "reporting_report_type", - "subsection_anchors": null, - "path": "/reporting/report_type/list", - "gate": false, - "display_on_load": false - }, - "financial_connections_accounts": { - "title": "Accounts", - "group_title": "Financial Connections", - "group_anchor": "financial_connections", - "anchor": "financial_connections_accounts", - "section_anchor": "financial_connections_accounts", - "subsection_anchors": [ - "financial_connections_account_object", - "financial_connections_retrieve_account", - "financial_connections_refresh_account", - "financial_connections_subscribe_account", - "financial_connections_unsubscribe_account", - "financial_connections_disconnect_account", - "financial_connections_list_accounts" - ], - "path": "/financial_connections/accounts", - "gate": false, - "display_on_load": false, - "data": { - "section_type": "resource", - "title": "Accounts", - "description": "A Financial Connections Account represents an account that exists outside of Stripe, to which you have been granted some degree of access.\n", - "section_tag": "financial_connections_accounts", - "subsection_summaries": [ - { "anchor": "financial_connections_account_object", "curl_definition": null }, - { - "anchor": "financial_connections_retrieve_account", - "curl_definition": "GET /v1/financial_connections/accounts/:id" - }, - { - "anchor": "financial_connections_refresh_account", - "curl_definition": "POST /v1/financial_connections/accounts/:id/refresh" - }, - { - "anchor": "financial_connections_subscribe_account", - "curl_definition": "POST /v1/financial_connections/accounts/:id/subscribe" - }, - { - "anchor": "financial_connections_unsubscribe_account", - "curl_definition": "POST /v1/financial_connections/accounts/:id/unsubscribe" - }, - { - "anchor": "financial_connections_disconnect_account", - "curl_definition": "POST /v1/financial_connections/accounts/:id/disconnect" - }, - { - "anchor": "financial_connections_list_accounts", - "curl_definition": "GET /v1/financial_connections/accounts" - } - ] - } - }, - "financial_connections_account_object": { - "title": "The Account object", - "group_title": "Financial Connections", - "group_anchor": "financial_connections", - "anchor": "financial_connections_account_object", - "section_anchor": "financial_connections_accounts", - "subsection_anchors": null, - "path": "/financial_connections/accounts/object", - "gate": false, - "display_on_load": false - }, - "financial_connections_retrieve_account": { - "title": "Retrieve an Account", - "group_title": "Financial Connections", - "group_anchor": "financial_connections", - "anchor": "financial_connections_retrieve_account", - "section_anchor": "financial_connections_accounts", - "subsection_anchors": null, - "path": "/financial_connections/accounts/retrieve", - "gate": false, - "display_on_load": false - }, - "financial_connections_refresh_account": { - "title": "Refresh Account data", - "group_title": "Financial Connections", - "group_anchor": "financial_connections", - "anchor": "financial_connections_refresh_account", - "section_anchor": "financial_connections_accounts", - "subsection_anchors": null, - "path": "/financial_connections/accounts/refresh", - "gate": false, - "display_on_load": false - }, - "financial_connections_subscribe_account": { - "title": "Subscribe to data refreshes for an Account", - "group_title": "Financial Connections", - "group_anchor": "financial_connections", - "anchor": "financial_connections_subscribe_account", - "section_anchor": "financial_connections_accounts", - "subsection_anchors": null, - "path": "/financial_connections/accounts/subscribe", - "gate": false, - "display_on_load": false - }, - "financial_connections_unsubscribe_account": { - "title": "Unsubscribe from data refreshes for an Account", - "group_title": "Financial Connections", - "group_anchor": "financial_connections", - "anchor": "financial_connections_unsubscribe_account", - "section_anchor": "financial_connections_accounts", - "subsection_anchors": null, - "path": "/financial_connections/accounts/unsubscribe", - "gate": false, - "display_on_load": false - }, - "financial_connections_disconnect_account": { - "title": "Disconnect an Account", - "group_title": "Financial Connections", - "group_anchor": "financial_connections", - "anchor": "financial_connections_disconnect_account", - "section_anchor": "financial_connections_accounts", - "subsection_anchors": null, - "path": "/financial_connections/accounts/disconnect", - "gate": false, - "display_on_load": false - }, - "financial_connections_list_accounts": { - "title": "List Accounts", - "group_title": "Financial Connections", - "group_anchor": "financial_connections", - "anchor": "financial_connections_list_accounts", - "section_anchor": "financial_connections_accounts", - "subsection_anchors": null, - "path": "/financial_connections/accounts/list", - "gate": false, - "display_on_load": false - }, - "financial_connections_ownership": { - "title": "Account Ownership", - "group_title": "Financial Connections", - "group_anchor": "financial_connections", - "anchor": "financial_connections_ownership", - "section_anchor": "financial_connections_ownership", - "subsection_anchors": [ - "financial_connections_ownership_object", - "financial_connections_owner_object", - "financial_connections_list_account_owners" - ], - "path": "/financial_connections/ownership", - "gate": false, - "display_on_load": false, - "data": { - "section_type": "resource", - "title": "Account Ownership", - "description": "Describes a snapshot of the owners of an account at a particular point in time.", - "section_tag": "financial_connections_ownership", - "subsection_summaries": [ - { "anchor": "financial_connections_ownership_object", "curl_definition": null }, - { "anchor": "financial_connections_owner_object", "curl_definition": null }, - { - "anchor": "financial_connections_list_account_owners", - "curl_definition": "GET /v1/financial_connections/accounts/:id/owners?ownership=:ownership_id" - } - ] - } - }, - "financial_connections_ownership_object": { - "title": "The Account Ownership object", - "group_title": "Financial Connections", - "group_anchor": "financial_connections", - "anchor": "financial_connections_ownership_object", - "section_anchor": "financial_connections_ownership", - "subsection_anchors": null, - "path": "/financial_connections/ownership/object", - "gate": false, - "display_on_load": false - }, - "financial_connections_owner_object": { - "title": "The Account Owner object", - "group_title": "Financial Connections", - "group_anchor": "financial_connections", - "anchor": "financial_connections_owner_object", - "section_anchor": "financial_connections_ownership", - "subsection_anchors": null, - "path": "/financial_connections/ownership/owner-object", - "gate": false, - "display_on_load": false - }, - "financial_connections_list_account_owners": { - "title": "List Account Owners", - "group_title": "Financial Connections", - "group_anchor": "financial_connections", - "anchor": "financial_connections_list_account_owners", - "section_anchor": "financial_connections_ownership", - "subsection_anchors": null, - "path": "/financial_connections/ownership/list", - "gate": false, - "display_on_load": false - }, - "financial_connections_session": { - "title": "Sessions", - "group_title": "Financial Connections", - "group_anchor": "financial_connections", - "anchor": "financial_connections_session", - "section_anchor": "financial_connections_session", - "subsection_anchors": [ - "financial_connections_session_object", - "financial_connections_create_session", - "financial_connections_retrieve_session" - ], - "path": "/financial_connections/session", - "gate": false, - "display_on_load": false, - "data": { - "section_type": "resource", - "title": "Session", - "description": "A Financial Connections Session is the secure way to programmatically launch the client-side Stripe.js modal that lets your users link their accounts.\n", - "section_tag": "financial_connections_session", - "subsection_summaries": [ - { "anchor": "financial_connections_session_object", "curl_definition": null }, - { - "anchor": "financial_connections_create_session", - "curl_definition": "POST /v1/financial_connections/sessions" - }, - { - "anchor": "financial_connections_retrieve_session", - "curl_definition": "GET /v1/financial_connections/sessions/:id" - } - ] - } - }, - "financial_connections_session_object": { - "title": "The Session object", - "group_title": "Financial Connections", - "group_anchor": "financial_connections", - "anchor": "financial_connections_session_object", - "section_anchor": "financial_connections_session", - "subsection_anchors": null, - "path": "/financial_connections/sessions/object", - "gate": false, - "display_on_load": false - }, - "financial_connections_create_session": { - "title": "Create a Session", - "group_title": "Financial Connections", - "group_anchor": "financial_connections", - "anchor": "financial_connections_create_session", - "section_anchor": "financial_connections_session", - "subsection_anchors": null, - "path": "/financial_connections/sessions/create", - "gate": false, - "display_on_load": false - }, - "financial_connections_retrieve_session": { - "title": "Retrieve a Session", - "group_title": "Financial Connections", - "group_anchor": "financial_connections", - "anchor": "financial_connections_retrieve_session", - "section_anchor": "financial_connections_session", - "subsection_anchors": null, - "path": "/financial_connections/sessions/retrieve", - "gate": false, - "display_on_load": false - }, - "financial_connections_transaction": { - "title": "Transactions", - "group_title": "Financial Connections", - "group_anchor": "financial_connections", - "anchor": "financial_connections_transaction", - "section_anchor": "financial_connections_transaction", - "subsection_anchors": [ - "financial_connections_transaction_object", - "financial_connections_list_transactions" - ], - "path": "/financial_connections/transaction", - "gate": false, - "display_on_load": false, - "data": { - "section_type": "resource", - "title": "Transactions", - "description": "A Transaction represents a real transaction that affects a Financial Connections Account balance.\n", - "section_tag": "financial_connections_transaction", - "subsection_summaries": [ - { "anchor": "financial_connections_transaction_object", "curl_definition": null }, - { - "anchor": "financial_connections_list_transactions", - "curl_definition": "GET /v1/financial_connections/transactions" - } - ] - } - }, - "financial_connections_transaction_object": { - "title": "The Transaction object", - "group_title": "Financial Connections", - "group_anchor": "financial_connections", - "anchor": "financial_connections_transaction_object", - "section_anchor": "financial_connections_transaction", - "subsection_anchors": null, - "path": "/financial_connections/transactions/object", - "gate": false, - "display_on_load": false - }, - "financial_connections_list_transactions": { - "title": "List Transactions", - "group_title": "Financial Connections", - "group_anchor": "financial_connections", - "anchor": "financial_connections_list_transactions", - "section_anchor": "financial_connections_transaction", - "subsection_anchors": null, - "path": "/financial_connections/transactions/list", - "gate": false, - "display_on_load": false - }, - "identity_verification_sessions": { - "title": "VerificationSessions", - "group_title": "Identity", - "group_anchor": "identity", - "anchor": "identity_verification_sessions", - "section_anchor": "identity_verification_sessions", - "subsection_anchors": [ - "identity_verification_session_object", - "create_identity_verification_session", - "list_identity_verification_session", - "retrieve_identity_verification_session", - "update_identity_verification_session", - "cancel_identity_verification_session", - "redact_identity_verification_session" - ], - "path": "/identity/verification_sessions", - "gate": false, - "display_on_load": false, - "data": { - "section_type": "resource", - "title": "VerificationSession", - "description": "A VerificationSession guides you through the process of collecting and verifying the identities\nof your users. It contains details about the type of verification, such as what [verification\ncheck](/docs/identity/verification-checks) to perform. Only create one VerificationSession for\neach verification in your system.\n\nA VerificationSession transitions through [multiple\nstatuses](/docs/identity/how-sessions-work) throughout its lifetime as it progresses through\nthe verification flow. The VerificationSession contains the user's verified data after\nverification checks are complete.\n\nRelated guide: [The Verification Sessions API](/docs/identity/verification-sessions)\n", - "section_tag": "identity_verification_sessions", - "subsection_summaries": [ - { "anchor": "identity_verification_session_object", "curl_definition": null }, - { - "anchor": "create_identity_verification_session", - "curl_definition": "POST /v1/identity/verification_sessions" - }, - { - "anchor": "list_identity_verification_session", - "curl_definition": "GET /v1/identity/verification_sessions" - }, - { - "anchor": "retrieve_identity_verification_session", - "curl_definition": "GET /v1/identity/verification_sessions/:id" - }, - { - "anchor": "update_identity_verification_session", - "curl_definition": "POST /v1/identity/verification_sessions/:id" - }, - { - "anchor": "cancel_identity_verification_session", - "curl_definition": "POST /v1/identity/verification_sessions/:id/cancel" - }, - { - "anchor": "redact_identity_verification_session", - "curl_definition": "POST /v1/identity/verification_sessions/:id/redact" - } - ] - } - }, - "identity_verification_session_object": { - "title": "The VerificationSession object", - "group_title": "Identity", - "group_anchor": "identity", - "anchor": "identity_verification_session_object", - "section_anchor": "identity_verification_sessions", - "subsection_anchors": null, - "path": "/identity/verification_sessions/object", - "gate": false, - "display_on_load": false - }, - "create_identity_verification_session": { - "title": "Create a VerificationSession", - "group_title": "Identity", - "group_anchor": "identity", - "anchor": "create_identity_verification_session", - "section_anchor": "identity_verification_sessions", - "subsection_anchors": null, - "path": "/identity/verification_sessions/create", - "gate": false, - "display_on_load": false - }, - "list_identity_verification_session": { - "title": "List VerificationSessions", - "group_title": "Identity", - "group_anchor": "identity", - "anchor": "list_identity_verification_session", - "section_anchor": "identity_verification_sessions", - "subsection_anchors": null, - "path": "/identity/verification_sessions/list", - "gate": false, - "display_on_load": false - }, - "retrieve_identity_verification_session": { - "title": "Retrieve a VerificationSession", - "group_title": "Identity", - "group_anchor": "identity", - "anchor": "retrieve_identity_verification_session", - "section_anchor": "identity_verification_sessions", - "subsection_anchors": null, - "path": "/identity/verification_sessions/retrieve", - "gate": false, - "display_on_load": false - }, - "update_identity_verification_session": { - "title": "Update a VerificationSession", - "group_title": "Identity", - "group_anchor": "identity", - "anchor": "update_identity_verification_session", - "section_anchor": "identity_verification_sessions", - "subsection_anchors": null, - "path": "/identity/verification_sessions/update", - "gate": false, - "display_on_load": false - }, - "cancel_identity_verification_session": { - "title": "Cancel a VerificationSession", - "group_title": "Identity", - "group_anchor": "identity", - "anchor": "cancel_identity_verification_session", - "section_anchor": "identity_verification_sessions", - "subsection_anchors": null, - "path": "/identity/verification_sessions/cancel", - "gate": false, - "display_on_load": false - }, - "redact_identity_verification_session": { - "title": "Redact a VerificationSession", - "group_title": "Identity", - "group_anchor": "identity", - "anchor": "redact_identity_verification_session", - "section_anchor": "identity_verification_sessions", - "subsection_anchors": null, - "path": "/identity/verification_sessions/redact", - "gate": false, - "display_on_load": false - }, - "identity_verification_reports": { - "title": "VerificationReports", - "group_title": "Identity", - "group_anchor": "identity", - "anchor": "identity_verification_reports", - "section_anchor": "identity_verification_reports", - "subsection_anchors": [ - "identity_verification_report_object", - "retrieve_identity_verification_report", - "list_identity_verification_report" - ], - "path": "/identity/verification_reports", - "gate": false, - "display_on_load": false, - "data": { - "section_type": "resource", - "title": "VerificationReport", - "description": "A VerificationReport is the result of an attempt to collect and verify data from a user.\nThe collection of verification checks performed is determined from the `type` and `options`\nparameters used. You can find the result of each verification check performed in the\nappropriate sub-resource: `document`, `id_number`, `selfie`.\n\nEach VerificationReport contains a copy of any data collected by the user as well as\nreference IDs which can be used to access collected images through the [FileUpload](/docs/api/files)\nAPI. To configure and create VerificationReports, use the\n[VerificationSession](/docs/api/identity/verification_sessions) API.\n\nRelated guides: [Accessing verification results](/docs/identity/verification-sessions#results).\n", - "section_tag": "identity_verification_reports", - "subsection_summaries": [ - { "anchor": "identity_verification_report_object", "curl_definition": null }, - { - "anchor": "retrieve_identity_verification_report", - "curl_definition": "GET /v1/identity/verification_reports/:id" - }, - { - "anchor": "list_identity_verification_report", - "curl_definition": "GET /v1/identity/verification_reports" - } - ] - } - }, - "identity_verification_report_object": { - "title": "The VerificationReport object", - "group_title": "Identity", - "group_anchor": "identity", - "anchor": "identity_verification_report_object", - "section_anchor": "identity_verification_reports", - "subsection_anchors": null, - "path": "/identity/verification_reports/object", - "gate": false, - "display_on_load": false - }, - "retrieve_identity_verification_report": { - "title": "Retrieve a VerificationReport", - "group_title": "Identity", - "group_anchor": "identity", - "anchor": "retrieve_identity_verification_report", - "section_anchor": "identity_verification_reports", - "subsection_anchors": null, - "path": "/identity/verification_reports/retrieve", - "gate": false, - "display_on_load": false - }, - "list_identity_verification_report": { - "title": "List VerificationReports", - "group_title": "Identity", - "group_anchor": "identity", - "anchor": "list_identity_verification_report", - "section_anchor": "identity_verification_reports", - "subsection_anchors": null, - "path": "/identity/verification_reports/list", - "gate": false, - "display_on_load": false - }, - "webhook_endpoints": { - "title": "Webhook Endpoints", - "group_title": "Webhooks", - "group_anchor": "webhooks", - "anchor": "webhook_endpoints", - "section_anchor": "webhook_endpoints", - "subsection_anchors": [ - "webhook_endpoint_object", - "create_webhook_endpoint", - "retrieve_webhook_endpoint", - "update_webhook_endpoint", - "list_webhook_endpoints", - "delete_webhook_endpoints" - ], - "path": "/webhook_endpoints", - "gate": false, - "display_on_load": false, - "data": { - "section_type": "resource", - "title": "Webhook Endpoints", - "description": "You can configure [webhook endpoints](/docs/webhooks/) via the API to be\nnotified about events that happen in your Stripe account or connected\naccounts.\n\nMost users configure webhooks from [the dashboard](https://dashboard.stripe.com/webhooks), which provides a user interface for registering and testing your webhook endpoints.\n\nRelated guide: [Setting up Webhooks](/docs/webhooks/configure).\n", - "section_tag": "webhook_endpoints", - "subsection_summaries": [ - { "anchor": "webhook_endpoint_object", "curl_definition": null }, - { "anchor": "create_webhook_endpoint", "curl_definition": "POST /v1/webhook_endpoints" }, - { - "anchor": "retrieve_webhook_endpoint", - "curl_definition": "GET /v1/webhook_endpoints/:id" - }, - { - "anchor": "update_webhook_endpoint", - "curl_definition": "POST /v1/webhook_endpoints/:id" - }, - { "anchor": "list_webhook_endpoints", "curl_definition": "GET /v1/webhook_endpoints" }, - { - "anchor": "delete_webhook_endpoints", - "curl_definition": "DELETE /v1/webhook_endpoints/:id" - } - ] - } - }, - "webhook_endpoint_object": { - "title": "The webhook endpoint object", - "group_title": "Webhooks", - "group_anchor": "webhooks", - "anchor": "webhook_endpoint_object", - "section_anchor": "webhook_endpoints", - "subsection_anchors": null, - "path": "/webhook_endpoints/object", - "gate": false, - "display_on_load": false - }, - "create_webhook_endpoint": { - "title": "Create a webhook endpoint", - "group_title": "Webhooks", - "group_anchor": "webhooks", - "anchor": "create_webhook_endpoint", - "section_anchor": "webhook_endpoints", - "subsection_anchors": null, - "path": "/webhook_endpoints/create", - "gate": false, - "display_on_load": false - }, - "retrieve_webhook_endpoint": { - "title": "Retrieve a webhook endpoint", - "group_title": "Webhooks", - "group_anchor": "webhooks", - "anchor": "retrieve_webhook_endpoint", - "section_anchor": "webhook_endpoints", - "subsection_anchors": null, - "path": "/webhook_endpoints/retrieve", - "gate": false, - "display_on_load": false - }, - "update_webhook_endpoint": { - "title": "Update a webhook endpoint", - "group_title": "Webhooks", - "group_anchor": "webhooks", - "anchor": "update_webhook_endpoint", - "section_anchor": "webhook_endpoints", - "subsection_anchors": null, - "path": "/webhook_endpoints/update", - "gate": false, - "display_on_load": false - }, - "list_webhook_endpoints": { - "title": "List all webhook endpoints", - "group_title": "Webhooks", - "group_anchor": "webhooks", - "anchor": "list_webhook_endpoints", - "section_anchor": "webhook_endpoints", - "subsection_anchors": null, - "path": "/webhook_endpoints/list", - "gate": false, - "display_on_load": false - }, - "delete_webhook_endpoints": { - "title": "Delete a webhook endpoint", - "group_title": "Webhooks", - "group_anchor": "webhooks", - "anchor": "delete_webhook_endpoints", - "section_anchor": "webhook_endpoints", - "subsection_anchors": null, - "path": "/webhook_endpoints/delete", - "gate": false, - "display_on_load": false - } -} diff --git a/stripe_types/Cargo.toml b/stripe_types/Cargo.toml new file mode 100644 index 000000000..067503983 --- /dev/null +++ b/stripe_types/Cargo.toml @@ -0,0 +1,20 @@ +[package] +name = "stripe_types" +version.workspace = true +description.workspace = true +edition.workspace = true +rust-version.workspace = true +authors.workspace = true +license.workspace = true +homepage.workspace = true +repository.workspace = true +keywords.workspace = true +categories.workspace = true + +[dependencies] +serde = {workspace = true } +smol_str.workspace = true +serde_json.workspace = true + +[dev-dependencies] +serde_qs = "0.12.0" \ No newline at end of file diff --git a/src/resources/currency.rs b/stripe_types/src/currency.rs similarity index 92% rename from src/resources/currency.rs rename to stripe_types/src/currency.rs index c7ea58068..6bf2ade64 100644 --- a/src/resources/currency.rs +++ b/stripe_types/src/currency.rs @@ -1,11 +1,9 @@ use serde::{Deserialize, Serialize}; -use crate::params::to_snakecase; - /// Currency is the list of supported currencies. /// /// For more details see . -#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq, Hash)] +#[derive(Copy, Clone, Debug, Deserialize, Serialize, Eq, PartialEq, Hash, Default)] pub enum Currency { #[serde(rename = "byn")] BYN, // Belarusian Ruble @@ -262,6 +260,7 @@ pub enum Currency { #[serde(rename = "ugx")] UGX, // Ugandan Shilling #[serde(rename = "usd")] + #[default] USD, // United States Dollar #[serde(rename = "uyu")] UYU, // Uruguayan Peso @@ -291,15 +290,9 @@ pub enum Currency { ZMW, // Zambian Kwacha } -impl Default for Currency { - fn default() -> Self { - Currency::USD - } -} - impl std::fmt::Display for Currency { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - write!(f, "{}", to_snakecase(&format!("{:?}", self))) + write!(f, "{}", format!("{:?}", self).to_ascii_lowercase()) } } @@ -307,6 +300,8 @@ impl std::str::FromStr for Currency { type Err = ParseCurrencyError; fn from_str(s: &str) -> Result { match s { + "byn" => Ok(Currency::BYN), + "mmk" => Ok(Currency::MMK), "aed" => Ok(Currency::AED), "afn" => Ok(Currency::AFN), "all" => Ok(Currency::ALL), @@ -466,3 +461,35 @@ impl std::error::Error for ParseCurrencyError { "unknown currency code" } } + +#[cfg(test)] +mod tests { + use super::*; + #[test] + fn debug_currency() { + assert_eq!(format!("{:?}", Currency::AED), "AED"); + assert_eq!(format!("{:?}", Currency::USD), "USD"); + assert_eq!(format!("{:?}", Currency::ZMW), "ZMW"); + } + + #[test] + fn display_currency() { + assert_eq!(format!("{}", Currency::AED), "aed"); + assert_eq!(format!("{}", Currency::USD), "usd"); + assert_eq!(format!("{}", Currency::ZMW), "zmw"); + } + + #[test] + fn serialize_currency() { + assert_eq!(serde_json::to_string(&Currency::AED).unwrap(), "\"aed\""); + assert_eq!(serde_json::to_string(&Currency::USD).unwrap(), "\"usd\""); + assert_eq!(serde_json::to_string(&Currency::ZMW).unwrap(), "\"zmw\""); + } + + #[test] + fn deserialize_currency() { + assert_eq!(serde_json::from_str::("\"aed\"").unwrap(), Currency::AED); + assert_eq!(serde_json::from_str::("\"usd\"").unwrap(), Currency::USD); + assert_eq!(serde_json::from_str::("\"zmw\"").unwrap(), Currency::ZMW); + } +} diff --git a/stripe_types/src/expandable.rs b/stripe_types/src/expandable.rs new file mode 100644 index 000000000..2d942c107 --- /dev/null +++ b/stripe_types/src/expandable.rs @@ -0,0 +1,56 @@ +use serde::{Deserialize, Serialize}; + +use crate::Object; + +/// An id or object. +/// +/// By default stripe will return an id for most fields, but if more detail is +/// necessary the `expand` parameter can be provided to ask for the id to be +/// loaded as an object instead. +/// +/// For more details see . +#[derive(Clone, Debug, Serialize, Deserialize)] // TODO: Implement deserialize by hand for better error messages +#[serde(untagged)] +pub enum Expandable { + Id(T::Id), + Object(Box), +} + +impl Default for Expandable +where + T::Id: Default, +{ + fn default() -> Self { + Expandable::Id(Default::default()) + } +} + +impl Expandable { + pub fn is_object(&self) -> bool { + match self { + Expandable::Id(_) => false, + Expandable::Object(_) => true, + } + } + + pub fn as_object(&self) -> Option<&T> { + match self { + Expandable::Id(_) => None, + Expandable::Object(obj) => Some(obj), + } + } + + pub fn id(&self) -> &T::Id { + match self { + Expandable::Id(id) => id, + Expandable::Object(obj) => obj.id(), + } + } + + pub fn into_object(self) -> Option { + match self { + Expandable::Id(_) => None, + Expandable::Object(obj) => Some(*obj), + } + } +} diff --git a/stripe_types/src/ids.rs b/stripe_types/src/ids.rs new file mode 100644 index 000000000..ad722fb27 --- /dev/null +++ b/stripe_types/src/ids.rs @@ -0,0 +1,336 @@ +#[doc(hidden)] +#[macro_export] +macro_rules! def_id_serde_impls { + ($struct_name:ident) => { + impl serde::Serialize for $struct_name { + fn serialize(&self, serializer: S) -> Result + where + S: serde::ser::Serializer, + { + self.as_str().serialize(serializer) + } + } + + impl<'de> serde::Deserialize<'de> for $struct_name { + fn deserialize(deserializer: D) -> Result + where + D: serde::de::Deserializer<'de>, + { + let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?; + s.parse::().map_err(::serde::de::Error::custom) + } + } + }; +} + +#[doc(hidden)] +#[macro_export] +macro_rules! def_id { + ($struct_name:ident) => { + #[derive(Clone, Debug, Default, Eq, PartialEq, Hash)] + pub struct $struct_name(smol_str::SmolStr); + + impl $struct_name { + /// Extracts a string slice containing the entire id. + #[inline] + pub fn as_str(&self) -> &str { + self.0.as_str() + } + + /// Obtain a reference to the underlying `SmolStr`. + #[inline] + pub fn inner(&self) -> &smol_str::SmolStr { + &self.0 + } + } + + impl stripe_types::AsCursor for $struct_name { + fn as_cursor(&self) -> &str { + self.0.as_str() + } + } + + impl PartialEq for $struct_name { + fn eq(&self, other: &str) -> bool { + self.as_str() == other + } + } + + impl PartialEq<&str> for $struct_name { + fn eq(&self, other: &&str) -> bool { + self.as_str() == *other + } + } + + impl PartialEq for $struct_name { + fn eq(&self, other: &String) -> bool { + self.as_str() == other + } + } + + impl PartialOrd for $struct_name { + fn partial_cmp(&self, other: &Self) -> Option { + Some(self.cmp(other)) + } + } + + impl Ord for $struct_name { + fn cmp(&self, other: &Self) -> std::cmp::Ordering { + self.as_str().cmp(other.as_str()) + } + } + + impl AsRef for $struct_name { + fn as_ref(&self) -> &str { + self.as_str() + } + } + + impl std::ops::Deref for $struct_name { + type Target = str; + + fn deref(&self) -> &str { + self.as_str() + } + } + + impl std::fmt::Display for $struct_name { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + self.0.fmt(f) + } + } + + impl std::str::FromStr for $struct_name { + type Err = $crate::ParseIdError; + + fn from_str(s: &str) -> Result { + Ok($struct_name(s.into())) + } + } + + $crate::def_id_serde_impls!($struct_name); + }; + ($struct_name:ident, $prefix:literal $(| $alt_prefix:literal)*) => { + /// An id for the corresponding object type. + /// + /// This type _typically_ will not allocate and + /// therefore is usually cheaply clonable. + #[derive(Clone, Debug, Default, Eq, PartialEq, Hash)] + pub struct $struct_name(smol_str::SmolStr); + + impl $struct_name { + /// The valid prefixes of the id type (e.g. [`ch_`, `py_`\ for a `ChargeId`). + #[inline] + pub fn prefixes() -> &'static [&'static str] { + &[$prefix$(, $alt_prefix)*] + } + + /// Extracts a string slice containing the entire id. + #[inline] + pub fn as_str(&self) -> &str { + self.0.as_str() + } + + /// Obtain a reference to the underlying `SmolStr`. + #[inline] + pub fn inner(&self) -> &smol_str::SmolStr { + &self.0 + } + + /// Check is provided prefix would be a valid prefix for id's of this type + pub fn is_valid_prefix(prefix: &str) -> bool { + prefix == $prefix $( || prefix == $alt_prefix )* + } + } + + impl stripe_types::AsCursor for $struct_name { + fn as_cursor(&self) -> &str { + self.0.as_str() + } + } + + impl PartialEq for $struct_name { + fn eq(&self, other: &str) -> bool { + self.as_str() == other + } + } + + impl PartialEq<&str> for $struct_name { + fn eq(&self, other: &&str) -> bool { + self.as_str() == *other + } + } + + impl PartialEq for $struct_name { + fn eq(&self, other: &String) -> bool { + self.as_str() == other + } + } + + impl PartialOrd for $struct_name { + fn partial_cmp(&self, other: &Self) -> Option { + Some(self.cmp(other)) + } + } + + impl Ord for $struct_name { + fn cmp(&self, other: &Self) -> std::cmp::Ordering { + self.as_str().cmp(other.as_str()) + } + } + + impl AsRef for $struct_name { + fn as_ref(&self) -> &str { + self.as_str() + } + } + + impl std::ops::Deref for $struct_name { + type Target = str; + + fn deref(&self) -> &str { + self.as_str() + } + } + + impl std::fmt::Display for $struct_name { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + self.0.fmt(f) + } + } + + impl std::str::FromStr for $struct_name { + type Err = $crate::ParseIdError; + + fn from_str(s: &str) -> Result { + if !s.starts_with($prefix) $( + && !s.starts_with($alt_prefix) + )* { + Err($crate::ParseIdError { + typename: stringify!($struct_name), + expected: stringify!(id to start with $prefix $(or $alt_prefix)*), + }) + } else { + Ok($struct_name(s.into())) + } + } + } + + $crate::def_id_serde_impls!($struct_name); + }; +} + +#[derive(Copy, Clone, Debug)] +pub struct ParseIdError { + pub typename: &'static str, + pub expected: &'static str, +} + +impl std::fmt::Display for ParseIdError { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + write!(f, "invalid `{}`, expected {}", self.typename, self.expected) + } +} + +impl std::error::Error for ParseIdError { + fn description(&self) -> &str { + "error parsing an id" + } +} + +// Allow dead code in the tests to avoid warnings around unused code in macro expansions +#[allow(dead_code)] +#[cfg(test)] +mod tests { + use std::str::FromStr; + + use serde::de::DeserializeOwned; + use serde::Serialize; + + def_id!(ChargeId, "ch_" | "py_"); + def_id!(InvoiceId, "in_"); + def_id!(CustomerId, "cus_"); + def_id!(PriceId, "price_"); + def_id!(ProductId); + def_id!(PaymentMethodId, "pm_" | "card_" | "src_" | "ba_"); + def_id!(RefundId, "re_" | "pyr_"); + def_id!(SubscriptionId, "sub_"); + + fn assert_ser_de_roundtrip(id: &str) + where + T: DeserializeOwned + Serialize + FromStr + std::fmt::Display + std::fmt::Debug, + ::Err: std::fmt::Debug, + { + let parsed_id = T::from_str(id).expect("Could not parse id"); + let ser = serde_json::to_string(&parsed_id).expect("Could not serialize id"); + let deser: T = serde_json::from_str(&ser).expect("Could not deserialize id"); + assert_eq!(deser.to_string(), id.to_string()); + } + + fn assert_deser_err(id: &str) { + let json_str = format!(r#""{}""#, id); + let deser: Result = serde_json::from_str(&json_str); + assert!(deser.is_err(), "Expected error, got {:?}", deser); + } + + #[test] + fn test_ser_de_roundtrip() { + // Single prefixes + for id in ["in_12345", "in_"] { + assert_ser_de_roundtrip::(id); + } + assert_ser_de_roundtrip::("price_abc"); + + // Case where multiple possible prefixes + for id in ["re_bcd", "pyr_123"] { + assert_ser_de_roundtrip::(id); + } + + // Case where id can be anything + for id in ["anything", ""] { + assert_ser_de_roundtrip::(id); + } + } + + #[test] + fn test_deser_err() { + // Single prefix + assert_deser_err::("in"); + + for id in ["sub", ""] { + assert_deser_err::(id); + } + + // Case where multiple possible prefixes + for id in ["abc_bcd", "pyr_123"] { + assert_deser_err::(id); + } + } + + #[test] + fn test_parse_customer() { + assert!("cus_123".parse::().is_ok()); + let bad_parse = "zzz_123".parse::(); + assert!(bad_parse.is_err()); + if let Err(err) = bad_parse { + assert_eq!( + format!("{}", err), + "invalid `CustomerId`, expected id to start with \"cus_\"" + ); + } + } + + #[test] + fn test_parse_charge() { + assert!("ch_123".parse::().is_ok()); + assert!("py_123".parse::().is_ok()); + let bad_parse = "zz_123".parse::(); + assert!(bad_parse.is_err()); + if let Err(err) = bad_parse { + assert_eq!( + format!("{}", err), + "invalid `ChargeId`, expected id to start with \"ch_\" or \"py_\"" + ); + } + } +} diff --git a/stripe_types/src/lib.rs b/stripe_types/src/lib.rs new file mode 100644 index 000000000..08e1a4ec8 --- /dev/null +++ b/stripe_types/src/lib.rs @@ -0,0 +1,16 @@ +//! This crate provides Rust bindings for core types to the Stripe HTTP API. + +mod currency; +mod expandable; +mod ids; +mod pagination; +mod params; + +pub use currency::{Currency, ParseCurrencyError}; +pub use expandable::*; +pub use ids::*; +pub use pagination::*; +pub use params::*; + +// Allow generated code to use absolute paths starting with `stripe` instead of `crate` +extern crate self as stripe_types; diff --git a/stripe_types/src/pagination.rs b/stripe_types/src/pagination.rs new file mode 100644 index 000000000..5b3f43338 --- /dev/null +++ b/stripe_types/src/pagination.rs @@ -0,0 +1,187 @@ +use std::fmt::Debug; + +use serde::de::DeserializeOwned; +use serde::{Deserialize, Serialize}; +use serde_json::Value; + +/// Implemented by types which represent stripe objects. +pub trait Object { + /// The canonical id type for this object. + type Id: AsCursorOpt; + /// The id of the object. + fn id(&self) -> &Self::Id; +} + +pub trait AsCursorOpt { + fn as_cursor_opt(&self) -> Option<&str>; +} + +pub trait AsCursor { + fn as_cursor(&self) -> &str; +} + +impl AsCursor for smol_str::SmolStr { + fn as_cursor(&self) -> &str { + self.as_str() + } +} + +impl AsCursorOpt for T { + fn as_cursor_opt(&self) -> Option<&str> { + Some(self.as_cursor()) + } +} + +impl AsCursorOpt for Option { + fn as_cursor_opt(&self) -> Option<&str> { + self.as_ref().map(|id| id.as_cursor()) + } +} + +/// A trait allowing `List` and `SearchList` to be treated the same. Not part of the +/// public API. +/// +/// NB: this trait is designed specifically for `List` and `SearchList` and may not be sensible +/// in other cases. One gotcha is that `into_parts` and `from_parts` do not necessarily +/// round-trip, e.g. `SearchList` will lose the `next_page` field since that +/// is not part of the shared list impl. We account for this by ensuring to call `update_params` +/// before breaking the `SearchList` into pieces. +#[doc(hidden)] +pub trait PaginableList: DeserializeOwned { + /// Underlying single element type, e.g. `Account` + type Data; + + /// Break into the shared parts list pagination requires + fn into_parts(self) -> ListParts; + + /// Reconstruct from the shared parts list pagination requires + fn from_parts(parts: ListParts) -> Self; + + /// Update the current parameter set, with `self` as the most + /// recently fetched page. + /// + /// NB: this should also set `has_more` to `false` explicitly if we don't have a new cursor. + /// (This seems redundant with `has_more` but is used to provide extra protection + /// against any possibility where `has_more` is `true`, but the cursor is back to `None`, + /// potentially leading to an infinite pagination loop). + fn update_params(&mut self, params: &mut Value); +} + +/// Specific list parts relied on by the client for pagination. +#[doc(hidden)] +#[derive(Debug)] +pub struct ListParts { + pub total_count: Option, + pub url: String, + pub data: Vec, + pub has_more: bool, +} + +impl PaginableList for List { + type Data = T; + + fn into_parts(self) -> ListParts { + ListParts { + total_count: self.total_count, + url: self.url, + data: self.data, + has_more: self.has_more, + } + } + + fn from_parts(parts: ListParts) -> Self { + Self { + data: parts.data, + has_more: parts.has_more, + total_count: parts.total_count, + url: parts.url, + } + } + + fn update_params(&mut self, params: &mut Value) { + if let Some(new_cursor) = self.data.last().and_then(|l| l.id().as_cursor_opt()) { + params["starting_after"] = Value::String(new_cursor.into()); + } else { + self.has_more = false; + } + } +} + +/// A single page of a cursor-paginated list of an object. +/// +/// For more details, see +#[derive(Debug, Serialize, Deserialize)] +pub struct List { + pub data: Vec, + pub has_more: bool, + pub total_count: Option, + pub url: String, +} + +impl Clone for List { + fn clone(&self) -> Self { + List { + data: self.data.clone(), + has_more: self.has_more, + total_count: self.total_count, + url: self.url.clone(), + } + } +} + +/// A single page of a cursor-paginated list of a search object. +/// +/// For more details, see +#[derive(Debug, Deserialize, Serialize)] +pub struct SearchList { + pub url: String, + pub has_more: bool, + pub data: Vec, + pub next_page: Option, + pub total_count: Option, +} + +impl Clone for SearchList { + fn clone(&self) -> Self { + SearchList { + data: self.data.clone(), + has_more: self.has_more, + total_count: self.total_count, + url: self.url.clone(), + next_page: self.next_page.clone(), + } + } +} + +impl PaginableList for SearchList { + type Data = T; + + /// NB: here we lose `next_page`, so we should be sure to `update_params` + /// before calling this. + fn into_parts(self) -> ListParts { + ListParts { + total_count: self.total_count, + url: self.url, + data: self.data, + has_more: self.has_more, + } + } + + fn from_parts(parts: ListParts) -> Self { + Self { + url: parts.url, + has_more: parts.has_more, + data: parts.data, + next_page: None, + total_count: parts.total_count, + } + } + + fn update_params(&mut self, params: &mut Value) { + if let Some(next_page) = self.next_page.take() { + params["page"] = Value::String(next_page); + } else { + self.has_more = false; + } + } +} diff --git a/stripe_types/src/params.rs b/stripe_types/src/params.rs new file mode 100644 index 000000000..837daa096 --- /dev/null +++ b/stripe_types/src/params.rs @@ -0,0 +1,134 @@ +use std::collections::HashMap; + +use serde::{Deserializer, Serialize, Serializer}; + +#[derive(Copy, Clone, Eq, PartialEq, Debug)] +pub struct AlwaysTrue; + +impl serde::Serialize for AlwaysTrue { + fn serialize(&self, serializer: S) -> Result + where + S: Serializer, + { + serializer.serialize_bool(true) + } +} + +impl<'de> serde::Deserialize<'de> for AlwaysTrue { + fn deserialize(deserializer: D) -> Result + where + D: Deserializer<'de>, + { + let bool_: bool = serde::Deserialize::deserialize(deserializer)?; + if !bool_ { + Err(serde::de::Error::custom("Expected value to always be `true`")) + } else { + Ok(AlwaysTrue) + } + } +} + +pub type Metadata = HashMap; +pub type Timestamp = i64; + +#[derive(Copy, Clone, Debug, Serialize, Default)] +pub struct RangeBoundsTs { + pub gt: Option, + pub gte: Option, + pub lt: Option, + pub lte: Option, +} + +/// A set of generic request parameters that can be used on +/// list endpoints to filter their results by some timestamp. +#[derive(Copy, Clone, Debug, Serialize)] +#[serde(untagged)] +pub enum RangeQueryTs { + Exact(Timestamp), + Bounds(RangeBoundsTs), +} + +impl RangeQueryTs { + /// Filter results to exactly match a given value + pub fn eq(value: Timestamp) -> Self { + Self::Exact(value) + } + + /// Filter results to be after a given value + pub fn gt(value: Timestamp) -> Self { + Self::Bounds(RangeBoundsTs { gt: Some(value), ..Default::default() }) + } + + /// Filter results to be after or equal to a given value + pub fn gte(value: Timestamp) -> Self { + Self::Bounds(RangeBoundsTs { gte: Some(value), ..Default::default() }) + } + + /// Filter results to be before to a given value + pub fn lt(value: Timestamp) -> Self { + Self::Bounds(RangeBoundsTs { lt: Some(value), ..Default::default() }) + } + + /// Filter results to be before or equal to a given value + pub fn lte(value: Timestamp) -> Self { + Self::Bounds(RangeBoundsTs { lte: Some(value), ..Default::default() }) + } +} + +#[cfg(test)] +mod tests { + use super::*; + + fn urldecode(input: String) -> String { + input.replace("%5B", "[").replace("%5D", "]") + } + + // A smaller version of `ListCustomer`, used to test de/serialization of `RangeQueryTs` + #[derive(Clone, Debug, Default, serde::Serialize)] + struct TestListCustomer { + #[serde(skip_serializing_if = "Option::is_none")] + pub created: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub ending_before: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub limit: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub starting_after: Option, + } + + impl TestListCustomer { + fn new() -> Self { + Self::default() + } + } + + #[test] + fn serialize_range_query() { + let query = RangeQueryTs::Bounds(RangeBoundsTs { + gt: None, + gte: Some(1501598702), + lt: Some(1504233902), + lte: None, + }); + assert_eq!(urldecode(serde_qs::to_string(&query).unwrap()), "gte=1501598702<=1504233902"); + + let mut params = TestListCustomer::new(); + params.created = Some(RangeQueryTs::eq(1501598702)); + params.limit = Some(3); + assert_eq!(urldecode(serde_qs::to_string(¶ms).unwrap()), "created=1501598702&limit=3"); + + let mut params = TestListCustomer::new(); + params.created = Some(RangeQueryTs::gte(1501598702)); + params.limit = Some(3); + assert_eq!( + urldecode(serde_qs::to_string(¶ms).unwrap()), + "created[gte]=1501598702&limit=3" + ); + + let mut params = TestListCustomer::new(); + params.created = Some(query); + params.limit = Some(3); + let encoded = urldecode(serde_qs::to_string(¶ms).unwrap()); + assert_eq!(encoded, "created[gte]=1501598702&created[lt]=1504233902&limit=3"); + } +} diff --git a/stripe_webhook/Cargo.toml b/stripe_webhook/Cargo.toml new file mode 100644 index 000000000..f37595c9b --- /dev/null +++ b/stripe_webhook/Cargo.toml @@ -0,0 +1,30 @@ +[package] +name = "stripe_webhook" +version.workspace = true +description.workspace = true +edition.workspace = true +rust-version.workspace = true +authors.workspace = true +license.workspace = true +homepage.workspace = true +repository.workspace = true +keywords.workspace = true +categories.workspace = true + +[dependencies] +stripe_types = {path = "../stripe_types"} +stripe_shared = {path = "../generated/stripe_shared"} +hmac = "0.12" +sha2 = "0.10" +hex = "0.4" +chrono = { version = "0.4", default-features = false, features = ["clock"] } +thiserror = "1.0.24" +serde_json.workspace = true +serde.workspace = true + +stripe_core = {path = "../generated/stripe_core", optional = true} +stripe_checkout = {path = "../generated/stripe_checkout", optional = true} +stripe_billing = {path = "../generated/stripe_billing", optional = true} + +[package.metadata.docs.rs] +features = ["stripe_core", "stripe_checkout", "stripe_billing"] \ No newline at end of file diff --git a/stripe_webhook/src/error.rs b/stripe_webhook/src/error.rs new file mode 100644 index 000000000..00649a7f2 --- /dev/null +++ b/stripe_webhook/src/error.rs @@ -0,0 +1,16 @@ +use std::num::ParseIntError; + +/// An error encountered when communicating with the Stripe API webhooks. +#[derive(Debug, thiserror::Error)] +pub enum WebhookError { + #[error("invalid key length")] + BadKey, + #[error("error parsing timestamp")] + BadHeader(#[from] ParseIntError), + #[error("error comparing signatures")] + BadSignature, + #[error("error comparing timestamps - over tolerance")] + BadTimestamp(i64), + #[error("error parsing event object")] + BadParse(#[from] serde_json::Error), +} diff --git a/stripe_webhook/src/generated/mod.rs b/stripe_webhook/src/generated/mod.rs new file mode 100644 index 000000000..65ffb1753 --- /dev/null +++ b/stripe_webhook/src/generated/mod.rs @@ -0,0 +1,1227 @@ +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +#[serde(tag = "object")] +pub enum AccountExternalAccountCreated { + #[serde(rename = "bank_account")] + BankAccount(stripe_shared::BankAccount), + #[serde(rename = "card")] + Card(stripe_shared::Card), + #[serde(rename = "source")] + Source(stripe_shared::Source), +} +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +#[serde(tag = "object")] +pub enum AccountExternalAccountDeleted { + #[serde(rename = "bank_account")] + BankAccount(stripe_shared::BankAccount), + #[serde(rename = "card")] + Card(stripe_shared::Card), + #[serde(rename = "source")] + Source(stripe_shared::Source), +} +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +#[serde(tag = "object")] +pub enum AccountExternalAccountUpdated { + #[serde(rename = "bank_account")] + BankAccount(stripe_shared::BankAccount), + #[serde(rename = "card")] + Card(stripe_shared::Card), + #[serde(rename = "source")] + Source(stripe_shared::Source), +} +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +#[serde(tag = "object")] +pub enum CustomerSourceCreated { + #[serde(rename = "bank_account")] + BankAccount(stripe_shared::BankAccount), + #[serde(rename = "card")] + Card(stripe_shared::Card), + #[serde(rename = "source")] + Source(stripe_shared::Source), +} +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +#[serde(tag = "object")] +pub enum CustomerSourceDeleted { + #[serde(rename = "bank_account")] + BankAccount(stripe_shared::BankAccount), + #[serde(rename = "card")] + Card(stripe_shared::Card), + #[serde(rename = "source")] + Source(stripe_shared::Source), +} +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +#[serde(tag = "object")] +pub enum CustomerSourceExpiring { + #[serde(rename = "card")] + Card(stripe_shared::Card), + #[serde(rename = "source")] + Source(stripe_shared::Source), +} +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +#[serde(tag = "object")] +pub enum CustomerSourceUpdated { + #[serde(rename = "bank_account")] + BankAccount(stripe_shared::BankAccount), + #[serde(rename = "card")] + Card(stripe_shared::Card), + #[serde(rename = "source")] + Source(stripe_shared::Source), +} +#[derive(Clone, Debug)] +#[non_exhaustive] +/// The event data for a webhook event. +pub enum EventObject { + /// Occurs whenever a user authorizes an application. Sent to the related application only. + AccountApplicationAuthorized(stripe_shared::Application), + /// Occurs whenever a user deauthorizes an application. Sent to the related application only. + AccountApplicationDeauthorized(stripe_shared::Application), + /// Occurs whenever an external account is created. + AccountExternalAccountCreated(AccountExternalAccountCreated), + /// Occurs whenever an external account is deleted. + AccountExternalAccountDeleted(AccountExternalAccountDeleted), + /// Occurs whenever an external account is updated. + AccountExternalAccountUpdated(AccountExternalAccountUpdated), + /// Occurs whenever an account status or property has changed. + AccountUpdated(stripe_shared::Account), + /// Occurs whenever an application fee is created on a charge. + ApplicationFeeCreated(stripe_shared::ApplicationFee), + /// Occurs whenever an application fee refund is updated. + ApplicationFeeRefundUpdated(stripe_shared::ApplicationFeeRefund), + /// Occurs whenever an application fee is refunded, whether from refunding a charge or from [refunding the application fee directly](#fee_refunds). + /// This includes partial refunds. + ApplicationFeeRefunded(stripe_shared::ApplicationFee), + /// Occurs whenever your Stripe balance has been updated (e.g., when a charge is available to be paid out). + /// By default, Stripe automatically transfers funds in your balance to your bank account on a daily basis. + /// This event is not fired for negative transactions. + #[cfg(feature = "stripe_core")] + BalanceAvailable(stripe_core::Balance), + /// Occurs whenever a portal configuration is created. + #[cfg(feature = "stripe_billing")] + BillingPortalConfigurationCreated(stripe_billing::BillingPortalConfiguration), + /// Occurs whenever a portal configuration is updated. + #[cfg(feature = "stripe_billing")] + BillingPortalConfigurationUpdated(stripe_billing::BillingPortalConfiguration), + /// Occurs whenever a portal session is created. + #[cfg(feature = "stripe_billing")] + BillingPortalSessionCreated(stripe_billing::BillingPortalSession), + /// Occurs whenever a capability has new requirements or a new status. + CapabilityUpdated(stripe_shared::Capability), + /// Occurs whenever there is a positive remaining cash balance after Stripe automatically reconciles new funds into the cash balance. + /// If you enabled manual reconciliation, this webhook will fire whenever there are new funds into the cash balance. + CashBalanceFundsAvailable(stripe_shared::CashBalance), + /// Occurs whenever a previously uncaptured charge is captured. + ChargeCaptured(stripe_shared::Charge), + /// Occurs when a dispute is closed and the dispute status changes to `lost`, `warning_closed`, or `won`. + ChargeDisputeClosed(stripe_shared::Dispute), + /// Occurs whenever a customer disputes a charge with their bank. + ChargeDisputeCreated(stripe_shared::Dispute), + /// Occurs when funds are reinstated to your account after a dispute is closed. + /// This includes [partially refunded payments](/docs/disputes#disputes-on-partially-refunded-payments). + ChargeDisputeFundsReinstated(stripe_shared::Dispute), + /// Occurs when funds are removed from your account due to a dispute. + ChargeDisputeFundsWithdrawn(stripe_shared::Dispute), + /// Occurs when the dispute is updated (usually with evidence). + ChargeDisputeUpdated(stripe_shared::Dispute), + /// Occurs whenever an uncaptured charge expires. + ChargeExpired(stripe_shared::Charge), + /// Occurs whenever a failed charge attempt occurs. + ChargeFailed(stripe_shared::Charge), + /// Occurs whenever a pending charge is created. + ChargePending(stripe_shared::Charge), + /// Occurs whenever a refund is updated, on selected payment methods. + ChargeRefundUpdated(stripe_shared::Refund), + /// Occurs whenever a charge is refunded, including partial refunds. + ChargeRefunded(stripe_shared::Charge), + /// Occurs whenever a charge is successful. + ChargeSucceeded(stripe_shared::Charge), + /// Occurs whenever a charge description or metadata is updated, or upon an asynchronous capture. + ChargeUpdated(stripe_shared::Charge), + /// Occurs when a payment intent using a delayed payment method fails. + #[cfg(feature = "stripe_checkout")] + CheckoutSessionAsyncPaymentFailed(stripe_checkout::CheckoutSession), + /// Occurs when a payment intent using a delayed payment method finally succeeds. + #[cfg(feature = "stripe_checkout")] + CheckoutSessionAsyncPaymentSucceeded(stripe_checkout::CheckoutSession), + /// Occurs when a Checkout Session has been successfully completed. + #[cfg(feature = "stripe_checkout")] + CheckoutSessionCompleted(stripe_checkout::CheckoutSession), + /// Occurs when a Checkout Session is expired. + #[cfg(feature = "stripe_checkout")] + CheckoutSessionExpired(stripe_checkout::CheckoutSession), + /// Occurs when a Climate order is canceled. + #[cfg(feature = "stripe_misc")] + ClimateOrderCanceled(stripe_misc::ClimateOrder), + /// Occurs when a Climate order is created. + #[cfg(feature = "stripe_misc")] + ClimateOrderCreated(stripe_misc::ClimateOrder), + /// Occurs when a Climate order is delayed. + #[cfg(feature = "stripe_misc")] + ClimateOrderDelayed(stripe_misc::ClimateOrder), + /// Occurs when a Climate order is delivered. + #[cfg(feature = "stripe_misc")] + ClimateOrderDelivered(stripe_misc::ClimateOrder), + /// Occurs when a Climate order's product is substituted for another. + #[cfg(feature = "stripe_misc")] + ClimateOrderProductSubstituted(stripe_misc::ClimateOrder), + /// Occurs when a Climate product is created. + #[cfg(feature = "stripe_misc")] + ClimateProductCreated(stripe_misc::ClimateProduct), + /// Occurs when a Climate product is updated. + #[cfg(feature = "stripe_misc")] + ClimateProductPricingUpdated(stripe_misc::ClimateProduct), + /// Occurs whenever a coupon is created. + CouponCreated(stripe_shared::Coupon), + /// Occurs whenever a coupon is deleted. + CouponDeleted(stripe_shared::Coupon), + /// Occurs whenever a coupon is updated. + CouponUpdated(stripe_shared::Coupon), + /// Occurs whenever a credit note is created. + CreditNoteCreated(stripe_shared::CreditNote), + /// Occurs whenever a credit note is updated. + CreditNoteUpdated(stripe_shared::CreditNote), + /// Occurs whenever a credit note is voided. + CreditNoteVoided(stripe_shared::CreditNote), + /// Occurs whenever a new customer is created. + CustomerCreated(stripe_shared::Customer), + /// Occurs whenever a customer is deleted. + CustomerDeleted(stripe_shared::Customer), + /// Occurs whenever a coupon is attached to a customer. + CustomerDiscountCreated(stripe_shared::Discount), + /// Occurs whenever a coupon is removed from a customer. + CustomerDiscountDeleted(stripe_shared::Discount), + /// Occurs whenever a customer is switched from one coupon to another. + CustomerDiscountUpdated(stripe_shared::Discount), + /// Occurs whenever a new source is created for a customer. + CustomerSourceCreated(CustomerSourceCreated), + /// Occurs whenever a source is removed from a customer. + CustomerSourceDeleted(CustomerSourceDeleted), + /// Occurs whenever a card or source will expire at the end of the month. + CustomerSourceExpiring(CustomerSourceExpiring), + /// Occurs whenever a source's details are changed. + CustomerSourceUpdated(CustomerSourceUpdated), + /// Occurs whenever a customer is signed up for a new plan. + CustomerSubscriptionCreated(stripe_shared::Subscription), + /// Occurs whenever a customer's subscription ends. + CustomerSubscriptionDeleted(stripe_shared::Subscription), + /// Occurs whenever a customer's subscription is paused. + /// Only applies when subscriptions enter `status=paused`, not when [payment collection](/docs/billing/subscriptions/pause) is paused. + CustomerSubscriptionPaused(stripe_shared::Subscription), + /// Occurs whenever a customer's subscription's pending update is applied, and the subscription is updated. + CustomerSubscriptionPendingUpdateApplied(stripe_shared::Subscription), + /// Occurs whenever a customer's subscription's pending update expires before the related invoice is paid. + CustomerSubscriptionPendingUpdateExpired(stripe_shared::Subscription), + /// Occurs whenever a customer's subscription is no longer paused. + /// Only applies when a `status=paused` subscription is [resumed](/docs/api/subscriptions/resume), not when [payment collection](/docs/billing/subscriptions/pause) is resumed. + CustomerSubscriptionResumed(stripe_shared::Subscription), + /// Occurs three days before a subscription's trial period is scheduled to end, or when a trial is ended immediately (using `trial_end=now`). + CustomerSubscriptionTrialWillEnd(stripe_shared::Subscription), + /// Occurs whenever a subscription changes (e.g., switching from one plan to another, or changing the status from trial to active). + CustomerSubscriptionUpdated(stripe_shared::Subscription), + /// Occurs whenever a tax ID is created for a customer. + CustomerTaxIdCreated(stripe_shared::TaxId), + /// Occurs whenever a tax ID is deleted from a customer. + CustomerTaxIdDeleted(stripe_shared::TaxId), + /// Occurs whenever a customer's tax ID is updated. + CustomerTaxIdUpdated(stripe_shared::TaxId), + /// Occurs whenever any property of a customer changes. + CustomerUpdated(stripe_shared::Customer), + /// Occurs whenever a new customer cash balance transactions is created. + CustomerCashBalanceTransactionCreated(stripe_shared::CustomerCashBalanceTransaction), + /// Occurs whenever a new Stripe-generated file is available for your account. + FileCreated(stripe_shared::File), + /// Occurs when a new Financial Connections account is created. + #[cfg(feature = "stripe_misc")] + FinancialConnectionsAccountCreated(stripe_misc::FinancialConnectionsAccount), + /// Occurs when a Financial Connections account's status is updated from `active` to `inactive`. + #[cfg(feature = "stripe_misc")] + FinancialConnectionsAccountDeactivated(stripe_misc::FinancialConnectionsAccount), + /// Occurs when a Financial Connections account is disconnected. + #[cfg(feature = "stripe_misc")] + FinancialConnectionsAccountDisconnected(stripe_misc::FinancialConnectionsAccount), + /// Occurs when a Financial Connections account's status is updated from `inactive` to `active`. + #[cfg(feature = "stripe_misc")] + FinancialConnectionsAccountReactivated(stripe_misc::FinancialConnectionsAccount), + /// Occurs when an Account’s `balance_refresh` status transitions from `pending` to either `succeeded` or `failed`. + #[cfg(feature = "stripe_misc")] + FinancialConnectionsAccountRefreshedBalance(stripe_misc::FinancialConnectionsAccount), + /// Occurs when an Account’s `transaction_refresh` status transitions from `pending` to either `succeeded` or `failed`. + #[cfg(feature = "stripe_misc")] + FinancialConnectionsAccountRefreshedTransactions(stripe_misc::FinancialConnectionsAccount), + /// Occurs whenever a VerificationSession is canceled + #[cfg(feature = "stripe_misc")] + IdentityVerificationSessionCanceled(stripe_misc::IdentityVerificationSession), + /// Occurs whenever a VerificationSession is created + #[cfg(feature = "stripe_misc")] + IdentityVerificationSessionCreated(stripe_misc::IdentityVerificationSession), + /// Occurs whenever a VerificationSession transitions to processing + #[cfg(feature = "stripe_misc")] + IdentityVerificationSessionProcessing(stripe_misc::IdentityVerificationSession), + /// Occurs whenever a VerificationSession is redacted. + #[cfg(feature = "stripe_misc")] + IdentityVerificationSessionRedacted(stripe_misc::IdentityVerificationSession), + /// Occurs whenever a VerificationSession transitions to require user input + #[cfg(feature = "stripe_misc")] + IdentityVerificationSessionRequiresInput(stripe_misc::IdentityVerificationSession), + /// Occurs whenever a VerificationSession transitions to verified + #[cfg(feature = "stripe_misc")] + IdentityVerificationSessionVerified(stripe_misc::IdentityVerificationSession), + /// Occurs whenever a new invoice is created. + /// To learn how webhooks can be used with this event, and how they can affect it, see [Using Webhooks with Subscriptions](/docs/subscriptions/webhooks). + InvoiceCreated(stripe_shared::Invoice), + /// Occurs whenever a draft invoice is deleted. + InvoiceDeleted(stripe_shared::Invoice), + /// Occurs whenever a draft invoice cannot be finalized. + /// See the invoice’s [last finalization error](/docs/api/invoices/object#invoice_object-last_finalization_error) for details. + InvoiceFinalizationFailed(stripe_shared::Invoice), + /// Occurs whenever a draft invoice is finalized and updated to be an open invoice. + InvoiceFinalized(stripe_shared::Invoice), + /// Occurs whenever an invoice is marked uncollectible. + InvoiceMarkedUncollectible(stripe_shared::Invoice), + /// Occurs whenever an invoice payment attempt succeeds or an invoice is marked as paid out-of-band. + InvoicePaid(stripe_shared::Invoice), + /// Occurs whenever an invoice payment attempt requires further user action to complete. + InvoicePaymentActionRequired(stripe_shared::Invoice), + /// Occurs whenever an invoice payment attempt fails, due either to a declined payment or to the lack of a stored payment method. + InvoicePaymentFailed(stripe_shared::Invoice), + /// Occurs whenever an invoice payment attempt succeeds. + InvoicePaymentSucceeded(stripe_shared::Invoice), + /// Occurs whenever an invoice email is sent out. + InvoiceSent(stripe_shared::Invoice), + /// Occurs X number of days before a subscription is scheduled to create an invoice that is automatically charged—where X is determined by your [subscriptions settings](https://dashboard.stripe.com/account/billing/automatic). + /// Note: The received `Invoice` object will not have an invoice ID. + InvoiceUpcoming(stripe_shared::Invoice), + /// Occurs whenever an invoice changes (e.g., the invoice amount). + InvoiceUpdated(stripe_shared::Invoice), + /// Occurs whenever an invoice is voided. + InvoiceVoided(stripe_shared::Invoice), + /// Occurs whenever an invoice item is created. + InvoiceitemCreated(stripe_shared::InvoiceItem), + /// Occurs whenever an invoice item is deleted. + InvoiceitemDeleted(stripe_shared::InvoiceItem), + /// Occurs whenever an authorization is created. + IssuingAuthorizationCreated(stripe_shared::IssuingAuthorization), + /// Represents a synchronous request for authorization, see [Using your integration to handle authorization requests](/docs/issuing/purchases/authorizations#authorization-handling). + IssuingAuthorizationRequest(stripe_shared::IssuingAuthorization), + /// Occurs whenever an authorization is updated. + IssuingAuthorizationUpdated(stripe_shared::IssuingAuthorization), + /// Occurs whenever a card is created. + IssuingCardCreated(stripe_shared::IssuingCard), + /// Occurs whenever a card is updated. + IssuingCardUpdated(stripe_shared::IssuingCard), + /// Occurs whenever a cardholder is created. + IssuingCardholderCreated(stripe_shared::IssuingCardholder), + /// Occurs whenever a cardholder is updated. + IssuingCardholderUpdated(stripe_shared::IssuingCardholder), + /// Occurs whenever a dispute is won, lost or expired. + IssuingDisputeClosed(stripe_shared::IssuingDispute), + /// Occurs whenever a dispute is created. + IssuingDisputeCreated(stripe_shared::IssuingDispute), + /// Occurs whenever funds are reinstated to your account for an Issuing dispute. + IssuingDisputeFundsReinstated(stripe_shared::IssuingDispute), + /// Occurs whenever a dispute is submitted. + IssuingDisputeSubmitted(stripe_shared::IssuingDispute), + /// Occurs whenever a dispute is updated. + IssuingDisputeUpdated(stripe_shared::IssuingDispute), + /// Occurs whenever an issuing digital wallet token is created. + IssuingTokenCreated(stripe_shared::IssuingToken), + /// Occurs whenever an issuing digital wallet token is updated. + IssuingTokenUpdated(stripe_shared::IssuingToken), + /// Occurs whenever an issuing transaction is created. + IssuingTransactionCreated(stripe_shared::IssuingTransaction), + /// Occurs whenever an issuing transaction is updated. + IssuingTransactionUpdated(stripe_shared::IssuingTransaction), + /// Occurs whenever a Mandate is updated. + MandateUpdated(stripe_shared::Mandate), + /// Occurs when a PaymentIntent has funds to be captured. + /// Check the `amount_capturable` property on the PaymentIntent to determine the amount that can be captured. + /// You may capture the PaymentIntent with an `amount_to_capture` value up to the specified amount. + /// [Learn more about capturing PaymentIntents.](https://stripe.com/docs/api/payment_intents/capture). + PaymentIntentAmountCapturableUpdated(stripe_shared::PaymentIntent), + /// Occurs when a PaymentIntent is canceled. + PaymentIntentCanceled(stripe_shared::PaymentIntent), + /// Occurs when a new PaymentIntent is created. + PaymentIntentCreated(stripe_shared::PaymentIntent), + /// Occurs when funds are applied to a customer_balance PaymentIntent and the 'amount_remaining' changes. + PaymentIntentPartiallyFunded(stripe_shared::PaymentIntent), + /// Occurs when a PaymentIntent has failed the attempt to create a payment method or a payment. + PaymentIntentPaymentFailed(stripe_shared::PaymentIntent), + /// Occurs when a PaymentIntent has started processing. + PaymentIntentProcessing(stripe_shared::PaymentIntent), + /// Occurs when a PaymentIntent transitions to requires_action state + PaymentIntentRequiresAction(stripe_shared::PaymentIntent), + /// Occurs when a PaymentIntent has successfully completed payment. + PaymentIntentSucceeded(stripe_shared::PaymentIntent), + /// Occurs when a payment link is created. + PaymentLinkCreated(stripe_shared::PaymentLink), + /// Occurs when a payment link is updated. + PaymentLinkUpdated(stripe_shared::PaymentLink), + /// Occurs whenever a new payment method is attached to a customer. + PaymentMethodAttached(stripe_shared::PaymentMethod), + /// Occurs whenever a payment method's details are automatically updated by the network. + PaymentMethodAutomaticallyUpdated(stripe_shared::PaymentMethod), + /// Occurs whenever a payment method is detached from a customer. + PaymentMethodDetached(stripe_shared::PaymentMethod), + /// Occurs whenever a payment method is updated via the [PaymentMethod update API](https://stripe.com/docs/api/payment_methods/update). + PaymentMethodUpdated(stripe_shared::PaymentMethod), + /// Occurs whenever a payout is canceled. + PayoutCanceled(stripe_shared::Payout), + /// Occurs whenever a payout is created. + PayoutCreated(stripe_shared::Payout), + /// Occurs whenever a payout attempt fails. + PayoutFailed(stripe_shared::Payout), + /// Occurs whenever a payout is *expected* to be available in the destination account. + /// If the payout fails, a `payout.failed` notification is also sent, at a later time. + PayoutPaid(stripe_shared::Payout), + /// Occurs whenever balance transactions paid out in an automatic payout can be queried. + PayoutReconciliationCompleted(stripe_shared::Payout), + /// Occurs whenever a payout is updated. + PayoutUpdated(stripe_shared::Payout), + /// Occurs whenever a person associated with an account is created. + PersonCreated(stripe_shared::Person), + /// Occurs whenever a person associated with an account is deleted. + PersonDeleted(stripe_shared::Person), + /// Occurs whenever a person associated with an account is updated. + PersonUpdated(stripe_shared::Person), + /// Occurs whenever a plan is created. + PlanCreated(stripe_shared::Plan), + /// Occurs whenever a plan is deleted. + PlanDeleted(stripe_shared::Plan), + /// Occurs whenever a plan is updated. + PlanUpdated(stripe_shared::Plan), + /// Occurs whenever a price is created. + PriceCreated(stripe_shared::Price), + /// Occurs whenever a price is deleted. + PriceDeleted(stripe_shared::Price), + /// Occurs whenever a price is updated. + PriceUpdated(stripe_shared::Price), + /// Occurs whenever a product is created. + ProductCreated(stripe_shared::Product), + /// Occurs whenever a product is deleted. + ProductDeleted(stripe_shared::Product), + /// Occurs whenever a product is updated. + ProductUpdated(stripe_shared::Product), + /// Occurs whenever a promotion code is created. + PromotionCodeCreated(stripe_shared::PromotionCode), + /// Occurs whenever a promotion code is updated. + PromotionCodeUpdated(stripe_shared::PromotionCode), + /// Occurs whenever a quote is accepted. + QuoteAccepted(stripe_shared::Quote), + /// Occurs whenever a quote is canceled. + QuoteCanceled(stripe_shared::Quote), + /// Occurs whenever a quote is created. + QuoteCreated(stripe_shared::Quote), + /// Occurs whenever a quote is finalized. + QuoteFinalized(stripe_shared::Quote), + /// Occurs whenever an early fraud warning is created. + #[cfg(feature = "stripe_fraud")] + RadarEarlyFraudWarningCreated(stripe_fraud::RadarEarlyFraudWarning), + /// Occurs whenever an early fraud warning is updated. + #[cfg(feature = "stripe_fraud")] + RadarEarlyFraudWarningUpdated(stripe_fraud::RadarEarlyFraudWarning), + /// Occurs whenever a refund from a customer's cash balance is created. + RefundCreated(stripe_shared::Refund), + /// Occurs whenever a refund from a customer's cash balance is updated. + RefundUpdated(stripe_shared::Refund), + /// Occurs whenever a requested `ReportRun` failed to complete. + #[cfg(feature = "stripe_misc")] + ReportingReportRunFailed(stripe_misc::ReportingReportRun), + /// Occurs whenever a requested `ReportRun` completed successfully. + #[cfg(feature = "stripe_misc")] + ReportingReportRunSucceeded(stripe_misc::ReportingReportRun), + /// Occurs whenever a `ReportType` is updated (typically to indicate that a new day's data has come available). + #[cfg(feature = "stripe_misc")] + ReportingReportTypeUpdated(stripe_misc::ReportingReportType), + /// Occurs whenever a review is closed. + /// The review's `reason` field indicates why: `approved`, `disputed`, `refunded`, or `refunded_as_fraud`. + ReviewClosed(stripe_shared::Review), + /// Occurs whenever a review is opened. + ReviewOpened(stripe_shared::Review), + /// Occurs when a SetupIntent is canceled. + SetupIntentCanceled(stripe_shared::SetupIntent), + /// Occurs when a new SetupIntent is created. + SetupIntentCreated(stripe_shared::SetupIntent), + /// Occurs when a SetupIntent is in requires_action state. + SetupIntentRequiresAction(stripe_shared::SetupIntent), + /// Occurs when a SetupIntent has failed the attempt to setup a payment method. + SetupIntentSetupFailed(stripe_shared::SetupIntent), + /// Occurs when an SetupIntent has successfully setup a payment method. + SetupIntentSucceeded(stripe_shared::SetupIntent), + /// Occurs whenever a Sigma scheduled query run finishes. + #[cfg(feature = "stripe_misc")] + SigmaScheduledQueryRunCreated(stripe_misc::ScheduledQueryRun), + /// Occurs whenever a source is canceled. + SourceCanceled(stripe_shared::Source), + /// Occurs whenever a source transitions to chargeable. + SourceChargeable(stripe_shared::Source), + /// Occurs whenever a source fails. + SourceFailed(stripe_shared::Source), + /// Occurs whenever a source mandate notification method is set to manual. + #[cfg(feature = "stripe_payment")] + SourceMandateNotification(stripe_payment::SourceMandateNotification), + /// Occurs whenever the refund attributes are required on a receiver source to process a refund or a mispayment. + SourceRefundAttributesRequired(stripe_shared::Source), + /// Occurs whenever a source transaction is created. + SourceTransactionCreated(stripe_shared::SourceTransaction), + /// Occurs whenever a source transaction is updated. + SourceTransactionUpdated(stripe_shared::SourceTransaction), + /// Occurs whenever a subscription schedule is canceled due to the underlying subscription being canceled because of delinquency. + SubscriptionScheduleAborted(stripe_shared::SubscriptionSchedule), + /// Occurs whenever a subscription schedule is canceled. + SubscriptionScheduleCanceled(stripe_shared::SubscriptionSchedule), + /// Occurs whenever a new subscription schedule is completed. + SubscriptionScheduleCompleted(stripe_shared::SubscriptionSchedule), + /// Occurs whenever a new subscription schedule is created. + SubscriptionScheduleCreated(stripe_shared::SubscriptionSchedule), + /// Occurs 7 days before a subscription schedule will expire. + SubscriptionScheduleExpiring(stripe_shared::SubscriptionSchedule), + /// Occurs whenever a new subscription schedule is released. + SubscriptionScheduleReleased(stripe_shared::SubscriptionSchedule), + /// Occurs whenever a subscription schedule is updated. + SubscriptionScheduleUpdated(stripe_shared::SubscriptionSchedule), + /// Occurs whenever tax settings is updated. + #[cfg(feature = "stripe_misc")] + TaxSettingsUpdated(stripe_misc::TaxSettings), + /// Occurs whenever a new tax rate is created. + TaxRateCreated(stripe_shared::TaxRate), + /// Occurs whenever a tax rate is updated. + TaxRateUpdated(stripe_shared::TaxRate), + /// Occurs whenever an action sent to a Terminal reader failed. + #[cfg(feature = "stripe_terminal")] + TerminalReaderActionFailed(stripe_terminal::TerminalReader), + /// Occurs whenever an action sent to a Terminal reader was successful. + #[cfg(feature = "stripe_terminal")] + TerminalReaderActionSucceeded(stripe_terminal::TerminalReader), + /// Occurs whenever a test clock starts advancing. + TestHelpersTestClockAdvancing(stripe_shared::TestHelpersTestClock), + /// Occurs whenever a test clock is created. + TestHelpersTestClockCreated(stripe_shared::TestHelpersTestClock), + /// Occurs whenever a test clock is deleted. + TestHelpersTestClockDeleted(stripe_shared::TestHelpersTestClock), + /// Occurs whenever a test clock fails to advance its frozen time. + TestHelpersTestClockInternalFailure(stripe_shared::TestHelpersTestClock), + /// Occurs whenever a test clock transitions to a ready status. + TestHelpersTestClockReady(stripe_shared::TestHelpersTestClock), + /// Occurs whenever a top-up is canceled. + TopupCanceled(stripe_shared::Topup), + /// Occurs whenever a top-up is created. + TopupCreated(stripe_shared::Topup), + /// Occurs whenever a top-up fails. + TopupFailed(stripe_shared::Topup), + /// Occurs whenever a top-up is reversed. + TopupReversed(stripe_shared::Topup), + /// Occurs whenever a top-up succeeds. + TopupSucceeded(stripe_shared::Topup), + /// Occurs whenever a transfer is created. + TransferCreated(stripe_shared::Transfer), + /// Occurs whenever a transfer is reversed, including partial reversals. + TransferReversed(stripe_shared::Transfer), + /// Occurs whenever a transfer's description or metadata is updated. + TransferUpdated(stripe_shared::Transfer), + /// Occurs whenever an CreditReversal is submitted and created. + #[cfg(feature = "stripe_treasury")] + TreasuryCreditReversalCreated(stripe_treasury::TreasuryCreditReversal), + /// Occurs whenever an CreditReversal post is posted. + #[cfg(feature = "stripe_treasury")] + TreasuryCreditReversalPosted(stripe_treasury::TreasuryCreditReversal), + /// Occurs whenever a DebitReversal is completed. + #[cfg(feature = "stripe_treasury")] + TreasuryDebitReversalCompleted(stripe_treasury::TreasuryDebitReversal), + /// Occurs whenever a DebitReversal is created. + #[cfg(feature = "stripe_treasury")] + TreasuryDebitReversalCreated(stripe_treasury::TreasuryDebitReversal), + /// Occurs whenever an initial credit is granted on a DebitReversal. + #[cfg(feature = "stripe_treasury")] + TreasuryDebitReversalInitialCreditGranted(stripe_treasury::TreasuryDebitReversal), + /// Occurs whenever the status of the FinancialAccount becomes closed. + #[cfg(feature = "stripe_treasury")] + TreasuryFinancialAccountClosed(stripe_treasury::TreasuryFinancialAccount), + /// Occurs whenever a new FinancialAccount is created. + #[cfg(feature = "stripe_treasury")] + TreasuryFinancialAccountCreated(stripe_treasury::TreasuryFinancialAccount), + /// Occurs whenever the statuses of any features within an existing FinancialAccount are updated. + #[cfg(feature = "stripe_treasury")] + TreasuryFinancialAccountFeaturesStatusUpdated(stripe_treasury::TreasuryFinancialAccount), + /// Occurs whenever an InboundTransfer is canceled. + #[cfg(feature = "stripe_treasury")] + TreasuryInboundTransferCanceled(stripe_treasury::TreasuryInboundTransfer), + /// Occurs whenever an InboundTransfer is created. + #[cfg(feature = "stripe_treasury")] + TreasuryInboundTransferCreated(stripe_treasury::TreasuryInboundTransfer), + /// Occurs whenever an InboundTransfer has failed. + #[cfg(feature = "stripe_treasury")] + TreasuryInboundTransferFailed(stripe_treasury::TreasuryInboundTransfer), + /// Occurs whenever an InboundTransfer has succeeded. + #[cfg(feature = "stripe_treasury")] + TreasuryInboundTransferSucceeded(stripe_treasury::TreasuryInboundTransfer), + /// Occurs whenever an OutboundPayment is canceled. + #[cfg(feature = "stripe_treasury")] + TreasuryOutboundPaymentCanceled(stripe_treasury::TreasuryOutboundPayment), + /// Occurs whenever a new OutboundPayment is successfully created. + #[cfg(feature = "stripe_treasury")] + TreasuryOutboundPaymentCreated(stripe_treasury::TreasuryOutboundPayment), + /// Occurs whenever the arrival date on an OutboundPayment updates. + #[cfg(feature = "stripe_treasury")] + TreasuryOutboundPaymentExpectedArrivalDateUpdated(stripe_treasury::TreasuryOutboundPayment), + /// Occurs whenever an OutboundPayment fails. + #[cfg(feature = "stripe_treasury")] + TreasuryOutboundPaymentFailed(stripe_treasury::TreasuryOutboundPayment), + /// Occurs whenever an OutboundPayment posts. + #[cfg(feature = "stripe_treasury")] + TreasuryOutboundPaymentPosted(stripe_treasury::TreasuryOutboundPayment), + /// Occurs whenever an OutboundPayment was returned. + #[cfg(feature = "stripe_treasury")] + TreasuryOutboundPaymentReturned(stripe_treasury::TreasuryOutboundPayment), + /// Occurs whenever an OutboundTransfer is canceled. + #[cfg(feature = "stripe_treasury")] + TreasuryOutboundTransferCanceled(stripe_treasury::TreasuryOutboundTransfer), + /// Occurs whenever an OutboundTransfer is created. + #[cfg(feature = "stripe_treasury")] + TreasuryOutboundTransferCreated(stripe_treasury::TreasuryOutboundTransfer), + /// Occurs whenever the arrival date on an OutboundTransfer updates. + #[cfg(feature = "stripe_treasury")] + TreasuryOutboundTransferExpectedArrivalDateUpdated(stripe_treasury::TreasuryOutboundTransfer), + /// Occurs whenever an OutboundTransfer has failed. + #[cfg(feature = "stripe_treasury")] + TreasuryOutboundTransferFailed(stripe_treasury::TreasuryOutboundTransfer), + /// Occurs whenever an OutboundTransfer is posted. + #[cfg(feature = "stripe_treasury")] + TreasuryOutboundTransferPosted(stripe_treasury::TreasuryOutboundTransfer), + /// Occurs whenever an OutboundTransfer is returned. + #[cfg(feature = "stripe_treasury")] + TreasuryOutboundTransferReturned(stripe_treasury::TreasuryOutboundTransfer), + /// Occurs whenever a received_credit is created as a result of funds being pushed by another account. + #[cfg(feature = "stripe_treasury")] + TreasuryReceivedCreditCreated(stripe_treasury::TreasuryReceivedCredit), + /// Occurs whenever a received_credit transitions to failed state. Only applicable for check deposits. + #[cfg(feature = "stripe_treasury")] + TreasuryReceivedCreditFailed(stripe_treasury::TreasuryReceivedCredit), + /// Occurs whenever a received_credit transitions to succeeded state. + /// Only applicable for check deposits. + #[cfg(feature = "stripe_treasury")] + TreasuryReceivedCreditSucceeded(stripe_treasury::TreasuryReceivedCredit), + /// Occurs whenever a received_debit is created as a result of funds being pulled by another account. + #[cfg(feature = "stripe_treasury")] + TreasuryReceivedDebitCreated(stripe_treasury::TreasuryReceivedDebit), + Unknown(serde_json::Value), +} +impl EventObject { + pub(crate) fn from_raw_data(typ: &str, data: serde_json::Value) -> serde_json::Result { + Ok(match typ { + "account.application.authorized" => { + EventObject::AccountApplicationAuthorized(serde_json::from_value(data)?) + } + "account.application.deauthorized" => { + EventObject::AccountApplicationDeauthorized(serde_json::from_value(data)?) + } + "account.external_account.created" => { + EventObject::AccountExternalAccountCreated(serde_json::from_value(data)?) + } + "account.external_account.deleted" => { + EventObject::AccountExternalAccountDeleted(serde_json::from_value(data)?) + } + "account.external_account.updated" => { + EventObject::AccountExternalAccountUpdated(serde_json::from_value(data)?) + } + "account.updated" => EventObject::AccountUpdated(serde_json::from_value(data)?), + "application_fee.created" => { + EventObject::ApplicationFeeCreated(serde_json::from_value(data)?) + } + "application_fee.refund.updated" => { + EventObject::ApplicationFeeRefundUpdated(serde_json::from_value(data)?) + } + "application_fee.refunded" => { + EventObject::ApplicationFeeRefunded(serde_json::from_value(data)?) + } + #[cfg(feature = "stripe_core")] + "balance.available" => EventObject::BalanceAvailable(serde_json::from_value(data)?), + #[cfg(feature = "stripe_billing")] + "billing_portal.configuration.created" => { + EventObject::BillingPortalConfigurationCreated(serde_json::from_value(data)?) + } + #[cfg(feature = "stripe_billing")] + "billing_portal.configuration.updated" => { + EventObject::BillingPortalConfigurationUpdated(serde_json::from_value(data)?) + } + #[cfg(feature = "stripe_billing")] + "billing_portal.session.created" => { + EventObject::BillingPortalSessionCreated(serde_json::from_value(data)?) + } + "capability.updated" => EventObject::CapabilityUpdated(serde_json::from_value(data)?), + "cash_balance.funds_available" => { + EventObject::CashBalanceFundsAvailable(serde_json::from_value(data)?) + } + "charge.captured" => EventObject::ChargeCaptured(serde_json::from_value(data)?), + "charge.dispute.closed" => { + EventObject::ChargeDisputeClosed(serde_json::from_value(data)?) + } + "charge.dispute.created" => { + EventObject::ChargeDisputeCreated(serde_json::from_value(data)?) + } + "charge.dispute.funds_reinstated" => { + EventObject::ChargeDisputeFundsReinstated(serde_json::from_value(data)?) + } + "charge.dispute.funds_withdrawn" => { + EventObject::ChargeDisputeFundsWithdrawn(serde_json::from_value(data)?) + } + "charge.dispute.updated" => { + EventObject::ChargeDisputeUpdated(serde_json::from_value(data)?) + } + "charge.expired" => EventObject::ChargeExpired(serde_json::from_value(data)?), + "charge.failed" => EventObject::ChargeFailed(serde_json::from_value(data)?), + "charge.pending" => EventObject::ChargePending(serde_json::from_value(data)?), + "charge.refund.updated" => { + EventObject::ChargeRefundUpdated(serde_json::from_value(data)?) + } + "charge.refunded" => EventObject::ChargeRefunded(serde_json::from_value(data)?), + "charge.succeeded" => EventObject::ChargeSucceeded(serde_json::from_value(data)?), + "charge.updated" => EventObject::ChargeUpdated(serde_json::from_value(data)?), + #[cfg(feature = "stripe_checkout")] + "checkout.session.async_payment_failed" => { + EventObject::CheckoutSessionAsyncPaymentFailed(serde_json::from_value(data)?) + } + #[cfg(feature = "stripe_checkout")] + "checkout.session.async_payment_succeeded" => { + EventObject::CheckoutSessionAsyncPaymentSucceeded(serde_json::from_value(data)?) + } + #[cfg(feature = "stripe_checkout")] + "checkout.session.completed" => { + EventObject::CheckoutSessionCompleted(serde_json::from_value(data)?) + } + #[cfg(feature = "stripe_checkout")] + "checkout.session.expired" => { + EventObject::CheckoutSessionExpired(serde_json::from_value(data)?) + } + #[cfg(feature = "stripe_misc")] + "climate.order.canceled" => { + EventObject::ClimateOrderCanceled(serde_json::from_value(data)?) + } + #[cfg(feature = "stripe_misc")] + "climate.order.created" => { + EventObject::ClimateOrderCreated(serde_json::from_value(data)?) + } + #[cfg(feature = "stripe_misc")] + "climate.order.delayed" => { + EventObject::ClimateOrderDelayed(serde_json::from_value(data)?) + } + #[cfg(feature = "stripe_misc")] + "climate.order.delivered" => { + EventObject::ClimateOrderDelivered(serde_json::from_value(data)?) + } + #[cfg(feature = "stripe_misc")] + "climate.order.product_substituted" => { + EventObject::ClimateOrderProductSubstituted(serde_json::from_value(data)?) + } + #[cfg(feature = "stripe_misc")] + "climate.product.created" => { + EventObject::ClimateProductCreated(serde_json::from_value(data)?) + } + #[cfg(feature = "stripe_misc")] + "climate.product.pricing_updated" => { + EventObject::ClimateProductPricingUpdated(serde_json::from_value(data)?) + } + "coupon.created" => EventObject::CouponCreated(serde_json::from_value(data)?), + "coupon.deleted" => EventObject::CouponDeleted(serde_json::from_value(data)?), + "coupon.updated" => EventObject::CouponUpdated(serde_json::from_value(data)?), + "credit_note.created" => EventObject::CreditNoteCreated(serde_json::from_value(data)?), + "credit_note.updated" => EventObject::CreditNoteUpdated(serde_json::from_value(data)?), + "credit_note.voided" => EventObject::CreditNoteVoided(serde_json::from_value(data)?), + "customer.created" => EventObject::CustomerCreated(serde_json::from_value(data)?), + "customer.deleted" => EventObject::CustomerDeleted(serde_json::from_value(data)?), + "customer.discount.created" => { + EventObject::CustomerDiscountCreated(serde_json::from_value(data)?) + } + "customer.discount.deleted" => { + EventObject::CustomerDiscountDeleted(serde_json::from_value(data)?) + } + "customer.discount.updated" => { + EventObject::CustomerDiscountUpdated(serde_json::from_value(data)?) + } + "customer.source.created" => { + EventObject::CustomerSourceCreated(serde_json::from_value(data)?) + } + "customer.source.deleted" => { + EventObject::CustomerSourceDeleted(serde_json::from_value(data)?) + } + "customer.source.expiring" => { + EventObject::CustomerSourceExpiring(serde_json::from_value(data)?) + } + "customer.source.updated" => { + EventObject::CustomerSourceUpdated(serde_json::from_value(data)?) + } + "customer.subscription.created" => { + EventObject::CustomerSubscriptionCreated(serde_json::from_value(data)?) + } + "customer.subscription.deleted" => { + EventObject::CustomerSubscriptionDeleted(serde_json::from_value(data)?) + } + "customer.subscription.paused" => { + EventObject::CustomerSubscriptionPaused(serde_json::from_value(data)?) + } + "customer.subscription.pending_update_applied" => { + EventObject::CustomerSubscriptionPendingUpdateApplied(serde_json::from_value(data)?) + } + "customer.subscription.pending_update_expired" => { + EventObject::CustomerSubscriptionPendingUpdateExpired(serde_json::from_value(data)?) + } + "customer.subscription.resumed" => { + EventObject::CustomerSubscriptionResumed(serde_json::from_value(data)?) + } + "customer.subscription.trial_will_end" => { + EventObject::CustomerSubscriptionTrialWillEnd(serde_json::from_value(data)?) + } + "customer.subscription.updated" => { + EventObject::CustomerSubscriptionUpdated(serde_json::from_value(data)?) + } + "customer.tax_id.created" => { + EventObject::CustomerTaxIdCreated(serde_json::from_value(data)?) + } + "customer.tax_id.deleted" => { + EventObject::CustomerTaxIdDeleted(serde_json::from_value(data)?) + } + "customer.tax_id.updated" => { + EventObject::CustomerTaxIdUpdated(serde_json::from_value(data)?) + } + "customer.updated" => EventObject::CustomerUpdated(serde_json::from_value(data)?), + "customer_cash_balance_transaction.created" => { + EventObject::CustomerCashBalanceTransactionCreated(serde_json::from_value(data)?) + } + "file.created" => EventObject::FileCreated(serde_json::from_value(data)?), + #[cfg(feature = "stripe_misc")] + "financial_connections.account.created" => { + EventObject::FinancialConnectionsAccountCreated(serde_json::from_value(data)?) + } + #[cfg(feature = "stripe_misc")] + "financial_connections.account.deactivated" => { + EventObject::FinancialConnectionsAccountDeactivated(serde_json::from_value(data)?) + } + #[cfg(feature = "stripe_misc")] + "financial_connections.account.disconnected" => { + EventObject::FinancialConnectionsAccountDisconnected(serde_json::from_value(data)?) + } + #[cfg(feature = "stripe_misc")] + "financial_connections.account.reactivated" => { + EventObject::FinancialConnectionsAccountReactivated(serde_json::from_value(data)?) + } + #[cfg(feature = "stripe_misc")] + "financial_connections.account.refreshed_balance" => { + EventObject::FinancialConnectionsAccountRefreshedBalance(serde_json::from_value( + data, + )?) + } + #[cfg(feature = "stripe_misc")] + "financial_connections.account.refreshed_transactions" => { + EventObject::FinancialConnectionsAccountRefreshedTransactions( + serde_json::from_value(data)?, + ) + } + #[cfg(feature = "stripe_misc")] + "identity.verification_session.canceled" => { + EventObject::IdentityVerificationSessionCanceled(serde_json::from_value(data)?) + } + #[cfg(feature = "stripe_misc")] + "identity.verification_session.created" => { + EventObject::IdentityVerificationSessionCreated(serde_json::from_value(data)?) + } + #[cfg(feature = "stripe_misc")] + "identity.verification_session.processing" => { + EventObject::IdentityVerificationSessionProcessing(serde_json::from_value(data)?) + } + #[cfg(feature = "stripe_misc")] + "identity.verification_session.redacted" => { + EventObject::IdentityVerificationSessionRedacted(serde_json::from_value(data)?) + } + #[cfg(feature = "stripe_misc")] + "identity.verification_session.requires_input" => { + EventObject::IdentityVerificationSessionRequiresInput(serde_json::from_value(data)?) + } + #[cfg(feature = "stripe_misc")] + "identity.verification_session.verified" => { + EventObject::IdentityVerificationSessionVerified(serde_json::from_value(data)?) + } + "invoice.created" => EventObject::InvoiceCreated(serde_json::from_value(data)?), + "invoice.deleted" => EventObject::InvoiceDeleted(serde_json::from_value(data)?), + "invoice.finalization_failed" => { + EventObject::InvoiceFinalizationFailed(serde_json::from_value(data)?) + } + "invoice.finalized" => EventObject::InvoiceFinalized(serde_json::from_value(data)?), + "invoice.marked_uncollectible" => { + EventObject::InvoiceMarkedUncollectible(serde_json::from_value(data)?) + } + "invoice.paid" => EventObject::InvoicePaid(serde_json::from_value(data)?), + "invoice.payment_action_required" => { + EventObject::InvoicePaymentActionRequired(serde_json::from_value(data)?) + } + "invoice.payment_failed" => { + EventObject::InvoicePaymentFailed(serde_json::from_value(data)?) + } + "invoice.payment_succeeded" => { + EventObject::InvoicePaymentSucceeded(serde_json::from_value(data)?) + } + "invoice.sent" => EventObject::InvoiceSent(serde_json::from_value(data)?), + "invoice.upcoming" => EventObject::InvoiceUpcoming(serde_json::from_value(data)?), + "invoice.updated" => EventObject::InvoiceUpdated(serde_json::from_value(data)?), + "invoice.voided" => EventObject::InvoiceVoided(serde_json::from_value(data)?), + "invoiceitem.created" => EventObject::InvoiceitemCreated(serde_json::from_value(data)?), + "invoiceitem.deleted" => EventObject::InvoiceitemDeleted(serde_json::from_value(data)?), + "issuing_authorization.created" => { + EventObject::IssuingAuthorizationCreated(serde_json::from_value(data)?) + } + "issuing_authorization.request" => { + EventObject::IssuingAuthorizationRequest(serde_json::from_value(data)?) + } + "issuing_authorization.updated" => { + EventObject::IssuingAuthorizationUpdated(serde_json::from_value(data)?) + } + "issuing_card.created" => { + EventObject::IssuingCardCreated(serde_json::from_value(data)?) + } + "issuing_card.updated" => { + EventObject::IssuingCardUpdated(serde_json::from_value(data)?) + } + "issuing_cardholder.created" => { + EventObject::IssuingCardholderCreated(serde_json::from_value(data)?) + } + "issuing_cardholder.updated" => { + EventObject::IssuingCardholderUpdated(serde_json::from_value(data)?) + } + "issuing_dispute.closed" => { + EventObject::IssuingDisputeClosed(serde_json::from_value(data)?) + } + "issuing_dispute.created" => { + EventObject::IssuingDisputeCreated(serde_json::from_value(data)?) + } + "issuing_dispute.funds_reinstated" => { + EventObject::IssuingDisputeFundsReinstated(serde_json::from_value(data)?) + } + "issuing_dispute.submitted" => { + EventObject::IssuingDisputeSubmitted(serde_json::from_value(data)?) + } + "issuing_dispute.updated" => { + EventObject::IssuingDisputeUpdated(serde_json::from_value(data)?) + } + "issuing_token.created" => { + EventObject::IssuingTokenCreated(serde_json::from_value(data)?) + } + "issuing_token.updated" => { + EventObject::IssuingTokenUpdated(serde_json::from_value(data)?) + } + "issuing_transaction.created" => { + EventObject::IssuingTransactionCreated(serde_json::from_value(data)?) + } + "issuing_transaction.updated" => { + EventObject::IssuingTransactionUpdated(serde_json::from_value(data)?) + } + "mandate.updated" => EventObject::MandateUpdated(serde_json::from_value(data)?), + "payment_intent.amount_capturable_updated" => { + EventObject::PaymentIntentAmountCapturableUpdated(serde_json::from_value(data)?) + } + "payment_intent.canceled" => { + EventObject::PaymentIntentCanceled(serde_json::from_value(data)?) + } + "payment_intent.created" => { + EventObject::PaymentIntentCreated(serde_json::from_value(data)?) + } + "payment_intent.partially_funded" => { + EventObject::PaymentIntentPartiallyFunded(serde_json::from_value(data)?) + } + "payment_intent.payment_failed" => { + EventObject::PaymentIntentPaymentFailed(serde_json::from_value(data)?) + } + "payment_intent.processing" => { + EventObject::PaymentIntentProcessing(serde_json::from_value(data)?) + } + "payment_intent.requires_action" => { + EventObject::PaymentIntentRequiresAction(serde_json::from_value(data)?) + } + "payment_intent.succeeded" => { + EventObject::PaymentIntentSucceeded(serde_json::from_value(data)?) + } + "payment_link.created" => { + EventObject::PaymentLinkCreated(serde_json::from_value(data)?) + } + "payment_link.updated" => { + EventObject::PaymentLinkUpdated(serde_json::from_value(data)?) + } + "payment_method.attached" => { + EventObject::PaymentMethodAttached(serde_json::from_value(data)?) + } + "payment_method.automatically_updated" => { + EventObject::PaymentMethodAutomaticallyUpdated(serde_json::from_value(data)?) + } + "payment_method.detached" => { + EventObject::PaymentMethodDetached(serde_json::from_value(data)?) + } + "payment_method.updated" => { + EventObject::PaymentMethodUpdated(serde_json::from_value(data)?) + } + "payout.canceled" => EventObject::PayoutCanceled(serde_json::from_value(data)?), + "payout.created" => EventObject::PayoutCreated(serde_json::from_value(data)?), + "payout.failed" => EventObject::PayoutFailed(serde_json::from_value(data)?), + "payout.paid" => EventObject::PayoutPaid(serde_json::from_value(data)?), + "payout.reconciliation_completed" => { + EventObject::PayoutReconciliationCompleted(serde_json::from_value(data)?) + } + "payout.updated" => EventObject::PayoutUpdated(serde_json::from_value(data)?), + "person.created" => EventObject::PersonCreated(serde_json::from_value(data)?), + "person.deleted" => EventObject::PersonDeleted(serde_json::from_value(data)?), + "person.updated" => EventObject::PersonUpdated(serde_json::from_value(data)?), + "plan.created" => EventObject::PlanCreated(serde_json::from_value(data)?), + "plan.deleted" => EventObject::PlanDeleted(serde_json::from_value(data)?), + "plan.updated" => EventObject::PlanUpdated(serde_json::from_value(data)?), + "price.created" => EventObject::PriceCreated(serde_json::from_value(data)?), + "price.deleted" => EventObject::PriceDeleted(serde_json::from_value(data)?), + "price.updated" => EventObject::PriceUpdated(serde_json::from_value(data)?), + "product.created" => EventObject::ProductCreated(serde_json::from_value(data)?), + "product.deleted" => EventObject::ProductDeleted(serde_json::from_value(data)?), + "product.updated" => EventObject::ProductUpdated(serde_json::from_value(data)?), + "promotion_code.created" => { + EventObject::PromotionCodeCreated(serde_json::from_value(data)?) + } + "promotion_code.updated" => { + EventObject::PromotionCodeUpdated(serde_json::from_value(data)?) + } + "quote.accepted" => EventObject::QuoteAccepted(serde_json::from_value(data)?), + "quote.canceled" => EventObject::QuoteCanceled(serde_json::from_value(data)?), + "quote.created" => EventObject::QuoteCreated(serde_json::from_value(data)?), + "quote.finalized" => EventObject::QuoteFinalized(serde_json::from_value(data)?), + #[cfg(feature = "stripe_fraud")] + "radar.early_fraud_warning.created" => { + EventObject::RadarEarlyFraudWarningCreated(serde_json::from_value(data)?) + } + #[cfg(feature = "stripe_fraud")] + "radar.early_fraud_warning.updated" => { + EventObject::RadarEarlyFraudWarningUpdated(serde_json::from_value(data)?) + } + "refund.created" => EventObject::RefundCreated(serde_json::from_value(data)?), + "refund.updated" => EventObject::RefundUpdated(serde_json::from_value(data)?), + #[cfg(feature = "stripe_misc")] + "reporting.report_run.failed" => { + EventObject::ReportingReportRunFailed(serde_json::from_value(data)?) + } + #[cfg(feature = "stripe_misc")] + "reporting.report_run.succeeded" => { + EventObject::ReportingReportRunSucceeded(serde_json::from_value(data)?) + } + #[cfg(feature = "stripe_misc")] + "reporting.report_type.updated" => { + EventObject::ReportingReportTypeUpdated(serde_json::from_value(data)?) + } + "review.closed" => EventObject::ReviewClosed(serde_json::from_value(data)?), + "review.opened" => EventObject::ReviewOpened(serde_json::from_value(data)?), + "setup_intent.canceled" => { + EventObject::SetupIntentCanceled(serde_json::from_value(data)?) + } + "setup_intent.created" => { + EventObject::SetupIntentCreated(serde_json::from_value(data)?) + } + "setup_intent.requires_action" => { + EventObject::SetupIntentRequiresAction(serde_json::from_value(data)?) + } + "setup_intent.setup_failed" => { + EventObject::SetupIntentSetupFailed(serde_json::from_value(data)?) + } + "setup_intent.succeeded" => { + EventObject::SetupIntentSucceeded(serde_json::from_value(data)?) + } + #[cfg(feature = "stripe_misc")] + "sigma.scheduled_query_run.created" => { + EventObject::SigmaScheduledQueryRunCreated(serde_json::from_value(data)?) + } + "source.canceled" => EventObject::SourceCanceled(serde_json::from_value(data)?), + "source.chargeable" => EventObject::SourceChargeable(serde_json::from_value(data)?), + "source.failed" => EventObject::SourceFailed(serde_json::from_value(data)?), + #[cfg(feature = "stripe_payment")] + "source.mandate_notification" => { + EventObject::SourceMandateNotification(serde_json::from_value(data)?) + } + "source.refund_attributes_required" => { + EventObject::SourceRefundAttributesRequired(serde_json::from_value(data)?) + } + "source.transaction.created" => { + EventObject::SourceTransactionCreated(serde_json::from_value(data)?) + } + "source.transaction.updated" => { + EventObject::SourceTransactionUpdated(serde_json::from_value(data)?) + } + "subscription_schedule.aborted" => { + EventObject::SubscriptionScheduleAborted(serde_json::from_value(data)?) + } + "subscription_schedule.canceled" => { + EventObject::SubscriptionScheduleCanceled(serde_json::from_value(data)?) + } + "subscription_schedule.completed" => { + EventObject::SubscriptionScheduleCompleted(serde_json::from_value(data)?) + } + "subscription_schedule.created" => { + EventObject::SubscriptionScheduleCreated(serde_json::from_value(data)?) + } + "subscription_schedule.expiring" => { + EventObject::SubscriptionScheduleExpiring(serde_json::from_value(data)?) + } + "subscription_schedule.released" => { + EventObject::SubscriptionScheduleReleased(serde_json::from_value(data)?) + } + "subscription_schedule.updated" => { + EventObject::SubscriptionScheduleUpdated(serde_json::from_value(data)?) + } + #[cfg(feature = "stripe_misc")] + "tax.settings.updated" => { + EventObject::TaxSettingsUpdated(serde_json::from_value(data)?) + } + "tax_rate.created" => EventObject::TaxRateCreated(serde_json::from_value(data)?), + "tax_rate.updated" => EventObject::TaxRateUpdated(serde_json::from_value(data)?), + #[cfg(feature = "stripe_terminal")] + "terminal.reader.action_failed" => { + EventObject::TerminalReaderActionFailed(serde_json::from_value(data)?) + } + #[cfg(feature = "stripe_terminal")] + "terminal.reader.action_succeeded" => { + EventObject::TerminalReaderActionSucceeded(serde_json::from_value(data)?) + } + "test_helpers.test_clock.advancing" => { + EventObject::TestHelpersTestClockAdvancing(serde_json::from_value(data)?) + } + "test_helpers.test_clock.created" => { + EventObject::TestHelpersTestClockCreated(serde_json::from_value(data)?) + } + "test_helpers.test_clock.deleted" => { + EventObject::TestHelpersTestClockDeleted(serde_json::from_value(data)?) + } + "test_helpers.test_clock.internal_failure" => { + EventObject::TestHelpersTestClockInternalFailure(serde_json::from_value(data)?) + } + "test_helpers.test_clock.ready" => { + EventObject::TestHelpersTestClockReady(serde_json::from_value(data)?) + } + "topup.canceled" => EventObject::TopupCanceled(serde_json::from_value(data)?), + "topup.created" => EventObject::TopupCreated(serde_json::from_value(data)?), + "topup.failed" => EventObject::TopupFailed(serde_json::from_value(data)?), + "topup.reversed" => EventObject::TopupReversed(serde_json::from_value(data)?), + "topup.succeeded" => EventObject::TopupSucceeded(serde_json::from_value(data)?), + "transfer.created" => EventObject::TransferCreated(serde_json::from_value(data)?), + "transfer.reversed" => EventObject::TransferReversed(serde_json::from_value(data)?), + "transfer.updated" => EventObject::TransferUpdated(serde_json::from_value(data)?), + #[cfg(feature = "stripe_treasury")] + "treasury.credit_reversal.created" => { + EventObject::TreasuryCreditReversalCreated(serde_json::from_value(data)?) + } + #[cfg(feature = "stripe_treasury")] + "treasury.credit_reversal.posted" => { + EventObject::TreasuryCreditReversalPosted(serde_json::from_value(data)?) + } + #[cfg(feature = "stripe_treasury")] + "treasury.debit_reversal.completed" => { + EventObject::TreasuryDebitReversalCompleted(serde_json::from_value(data)?) + } + #[cfg(feature = "stripe_treasury")] + "treasury.debit_reversal.created" => { + EventObject::TreasuryDebitReversalCreated(serde_json::from_value(data)?) + } + #[cfg(feature = "stripe_treasury")] + "treasury.debit_reversal.initial_credit_granted" => { + EventObject::TreasuryDebitReversalInitialCreditGranted(serde_json::from_value( + data, + )?) + } + #[cfg(feature = "stripe_treasury")] + "treasury.financial_account.closed" => { + EventObject::TreasuryFinancialAccountClosed(serde_json::from_value(data)?) + } + #[cfg(feature = "stripe_treasury")] + "treasury.financial_account.created" => { + EventObject::TreasuryFinancialAccountCreated(serde_json::from_value(data)?) + } + #[cfg(feature = "stripe_treasury")] + "treasury.financial_account.features_status_updated" => { + EventObject::TreasuryFinancialAccountFeaturesStatusUpdated(serde_json::from_value( + data, + )?) + } + #[cfg(feature = "stripe_treasury")] + "treasury.inbound_transfer.canceled" => { + EventObject::TreasuryInboundTransferCanceled(serde_json::from_value(data)?) + } + #[cfg(feature = "stripe_treasury")] + "treasury.inbound_transfer.created" => { + EventObject::TreasuryInboundTransferCreated(serde_json::from_value(data)?) + } + #[cfg(feature = "stripe_treasury")] + "treasury.inbound_transfer.failed" => { + EventObject::TreasuryInboundTransferFailed(serde_json::from_value(data)?) + } + #[cfg(feature = "stripe_treasury")] + "treasury.inbound_transfer.succeeded" => { + EventObject::TreasuryInboundTransferSucceeded(serde_json::from_value(data)?) + } + #[cfg(feature = "stripe_treasury")] + "treasury.outbound_payment.canceled" => { + EventObject::TreasuryOutboundPaymentCanceled(serde_json::from_value(data)?) + } + #[cfg(feature = "stripe_treasury")] + "treasury.outbound_payment.created" => { + EventObject::TreasuryOutboundPaymentCreated(serde_json::from_value(data)?) + } + #[cfg(feature = "stripe_treasury")] + "treasury.outbound_payment.expected_arrival_date_updated" => { + EventObject::TreasuryOutboundPaymentExpectedArrivalDateUpdated( + serde_json::from_value(data)?, + ) + } + #[cfg(feature = "stripe_treasury")] + "treasury.outbound_payment.failed" => { + EventObject::TreasuryOutboundPaymentFailed(serde_json::from_value(data)?) + } + #[cfg(feature = "stripe_treasury")] + "treasury.outbound_payment.posted" => { + EventObject::TreasuryOutboundPaymentPosted(serde_json::from_value(data)?) + } + #[cfg(feature = "stripe_treasury")] + "treasury.outbound_payment.returned" => { + EventObject::TreasuryOutboundPaymentReturned(serde_json::from_value(data)?) + } + #[cfg(feature = "stripe_treasury")] + "treasury.outbound_transfer.canceled" => { + EventObject::TreasuryOutboundTransferCanceled(serde_json::from_value(data)?) + } + #[cfg(feature = "stripe_treasury")] + "treasury.outbound_transfer.created" => { + EventObject::TreasuryOutboundTransferCreated(serde_json::from_value(data)?) + } + #[cfg(feature = "stripe_treasury")] + "treasury.outbound_transfer.expected_arrival_date_updated" => { + EventObject::TreasuryOutboundTransferExpectedArrivalDateUpdated( + serde_json::from_value(data)?, + ) + } + #[cfg(feature = "stripe_treasury")] + "treasury.outbound_transfer.failed" => { + EventObject::TreasuryOutboundTransferFailed(serde_json::from_value(data)?) + } + #[cfg(feature = "stripe_treasury")] + "treasury.outbound_transfer.posted" => { + EventObject::TreasuryOutboundTransferPosted(serde_json::from_value(data)?) + } + #[cfg(feature = "stripe_treasury")] + "treasury.outbound_transfer.returned" => { + EventObject::TreasuryOutboundTransferReturned(serde_json::from_value(data)?) + } + #[cfg(feature = "stripe_treasury")] + "treasury.received_credit.created" => { + EventObject::TreasuryReceivedCreditCreated(serde_json::from_value(data)?) + } + #[cfg(feature = "stripe_treasury")] + "treasury.received_credit.failed" => { + EventObject::TreasuryReceivedCreditFailed(serde_json::from_value(data)?) + } + #[cfg(feature = "stripe_treasury")] + "treasury.received_credit.succeeded" => { + EventObject::TreasuryReceivedCreditSucceeded(serde_json::from_value(data)?) + } + #[cfg(feature = "stripe_treasury")] + "treasury.received_debit.created" => { + EventObject::TreasuryReceivedDebitCreated(serde_json::from_value(data)?) + } + + _ => EventObject::Unknown(data), + }) + } +} diff --git a/stripe_webhook/src/lib.rs b/stripe_webhook/src/lib.rs new file mode 100644 index 000000000..380a1e3d4 --- /dev/null +++ b/stripe_webhook/src/lib.rs @@ -0,0 +1,14 @@ +#![allow(clippy::large_enum_variant)] +//! This crate provides Rust bindings for handling [Stripe webhook events](https://stripe.com/docs/webhooks). +//! +//! Please see the associated examples for basic usage with +//! [axum](https://github.com/tokio-rs/axum), [actix-web](https://github.com/actix/actix-web), +//! and [rocket](https://rocket.rs/) +mod error; +mod generated; +mod webhook; + +pub use error::WebhookError; +pub use generated::*; +pub use stripe_shared::event::EventType; +pub use webhook::{Event, Webhook}; diff --git a/stripe_webhook/src/webhook.rs b/stripe_webhook/src/webhook.rs new file mode 100644 index 000000000..184b900a9 --- /dev/null +++ b/stripe_webhook/src/webhook.rs @@ -0,0 +1,316 @@ +use std::collections::HashMap; +use std::str::FromStr; + +use chrono::Utc; +use hmac::{Hmac, Mac}; +use sha2::Sha256; +use stripe_shared::event::EventType; +use stripe_shared::ApiVersion; + +use crate::{EventObject, WebhookError}; + +#[derive(Clone, Debug)] +pub struct Event { + /// The connected account that originated the event. + pub account: Option, + /// The Stripe API version used to render `data`. + /// + /// *Note: This property is populated only for events on or after October 31, 2014*. + pub api_version: Option, + /// Time at which the object was created. + /// + /// Measured in seconds since the Unix epoch. + pub created: stripe_types::Timestamp, + pub data: EventData, + /// Unique identifier for the object. + pub id: stripe_shared::event::EventId, + /// Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + pub livemode: bool, + /// Number of webhooks that have yet to be successfully delivered (i.e., to return a 20x response) to the URLs you've specified. + pub pending_webhooks: i64, + /// Information on the API request that instigated the event. + pub request: Option, + /// Description of the event (e.g., `invoice.created` or `charge.refunded`). + pub type_: EventType, +} + +#[derive(Clone, Debug)] +pub struct EventData { + /// Object containing the API resource relevant to the event. + /// + /// For example, an `invoice.created` event will have a full [invoice object](https://stripe.com/docs/api#invoice_object) as the value of the object key. + pub object: EventObject, + /// Object containing the names of the updated attributes and their values prior to the event (only included in events of type `*.updated`). + /// + /// If an array attribute has any updated elements, this object contains the entire array. + /// In Stripe API versions 2017-04-06 or earlier, an updated array attribute in this object includes only the updated array elements. + pub previous_attributes: Option, +} + +pub struct Webhook { + current_timestamp: i64, +} + +impl Webhook { + /// Construct an event from a webhook payload and signature. + /// + /// # Errors + /// + /// This function will return a WebhookError if: + /// - the provided signature is invalid + /// - the provided secret is invalid + /// - the signature timestamp is older than 5 minutes + pub fn construct_event(payload: &str, sig: &str, secret: &str) -> Result { + Self { current_timestamp: Utc::now().timestamp() }.do_construct_event(payload, sig, secret) + } + + /// Construct an event from a webhook payload and signature, verifying its signature + /// using the provided timestamp. + /// + /// This is helpful for replaying requests in tests and should be avoided otherwise + /// in production use. + /// + /// # Errors + /// + /// This function will return a WebhookError if: + /// - the provided signature is invalid + /// - the provided secret is invalid + /// - the signature timestamp is older than 5 minutes from the provided timestamp + pub fn construct_event_with_timestamp( + payload: &str, + sig: &str, + secret: &str, + timestamp: i64, + ) -> Result { + Self { current_timestamp: timestamp }.do_construct_event(payload, sig, secret) + } + + fn do_construct_event( + self, + payload: &str, + sig: &str, + secret: &str, + ) -> Result { + // Get Stripe signature from header + let signature = Signature::parse(sig)?; + let signed_payload = format!("{}.{}", signature.t, payload); + + // Compute HMAC with the SHA256 hash function, using endpoint secret as key + // and signed_payload string as the message. + let mut mac = + Hmac::::new_from_slice(secret.as_bytes()).map_err(|_| WebhookError::BadKey)?; + mac.update(signed_payload.as_bytes()); + + let sig = hex::decode(signature.v1).map_err(|_| WebhookError::BadSignature)?; + mac.verify_slice(sig.as_slice()).map_err(|_| WebhookError::BadSignature)?; + + // Get current timestamp to compare to signature timestamp + if (self.current_timestamp - signature.t).abs() > 300 { + return Err(WebhookError::BadTimestamp(signature.t)); + } + + let base_evt: stripe_shared::Event = serde_json::from_str(payload)?; + + Ok(Event { + account: base_evt.account, + api_version: base_evt + .api_version + .map(|s| ApiVersion::from_str(&s).unwrap_or(ApiVersion::Unknown)), + created: base_evt.created, + data: EventData { + object: EventObject::from_raw_data(base_evt.type_.as_str(), base_evt.data.object)?, + previous_attributes: base_evt.data.previous_attributes, + }, + id: base_evt.id, + livemode: base_evt.livemode, + pending_webhooks: base_evt.pending_webhooks, + request: base_evt.request, + type_: base_evt.type_, + }) + } +} + +#[derive(Debug)] +struct Signature<'r> { + t: i64, + v1: &'r str, +} + +impl<'r> Signature<'r> { + fn parse(raw: &'r str) -> Result, WebhookError> { + let headers: HashMap<&str, &str> = raw + .split(',') + .map(|header| { + let mut key_and_value = header.split('='); + let key = key_and_value.next(); + let value = key_and_value.next(); + (key, value) + }) + .filter_map(|(key, value)| match (key, value) { + (Some(key), Some(value)) => Some((key, value)), + _ => None, + }) + .collect(); + let t = headers.get("t").ok_or(WebhookError::BadSignature)?; + let v1 = headers.get("v1").ok_or(WebhookError::BadSignature)?; + Ok(Signature { t: t.parse::().map_err(WebhookError::BadHeader)?, v1 }) + } +} + +#[cfg(test)] +mod tests { + use serde_json::{json, Value}; + + use super::*; + use crate::{AccountExternalAccountCreated, EventType}; + + const WEBHOOK_SECRET: &str = "secret"; + + #[test] + fn test_signature_parse() { + let raw_signature = + "t=1492774577,v1=5257a869e7ecebeda32affa62cdca3fa51cad7e77a0e56ff536d0ce8e108d8bd"; + let signature = Signature::parse(raw_signature).unwrap(); + assert_eq!(signature.t, 1492774577); + assert_eq!( + signature.v1, + "5257a869e7ecebeda32affa62cdca3fa51cad7e77a0e56ff536d0ce8e108d8bd" + ); + + let raw_signature_with_test_mode = "t=1492774577,v1=5257a869e7ecebeda32affa62cdca3fa51cad7e77a0e56ff536d0ce8e108d8bd,v0=6ffbb59b2300aae63f272406069a9788598b792a944a07aba816edb039989a39"; + let signature = Signature::parse(raw_signature_with_test_mode).unwrap(); + assert_eq!(signature.t, 1492774577); + assert_eq!( + signature.v1, + "5257a869e7ecebeda32affa62cdca3fa51cad7e77a0e56ff536d0ce8e108d8bd" + ); + } + + fn get_mock_stripe_sig(msg: &str, timestamp: i64) -> String { + let signed_payload = format!("{timestamp}.{msg}"); + + let mut mac = Hmac::::new_from_slice(WEBHOOK_SECRET.as_bytes()).unwrap(); + + mac.update(signed_payload.as_bytes()); + let result = mac.finalize().into_bytes(); + let v1 = hex::encode(&result[..]); + format!("t={timestamp},v1={v1}") + } + + fn mock_webhook_event(event_type: EventType, data: Value) -> Value { + json!({ + "id": "evt_123", + "object": "event", + "account": "acct_123", + "api_version": "2017-05-25", + "created": 1533204620, + "livemode": false, + "pending_webhooks": 1, + "request": { + "id": "req_123", + "idempotency_key": "idempotency-key-123" + }, + "data": { + "object": data, + }, + "type": Value::String(event_type.to_string()) + }) + } + + #[track_caller] + fn parse_mock_webhook_event(event_type: EventType, data: Value) -> EventObject { + let now = Utc::now().timestamp(); + let payload = mock_webhook_event(event_type, data).to_string(); + let sig = get_mock_stripe_sig(&payload, now); + + let webhook = Webhook { current_timestamp: now }; + let parsed = webhook.do_construct_event(&payload, &sig, WEBHOOK_SECRET).unwrap(); + assert_eq!(parsed.type_, event_type); + parsed.data.object + } + + #[test] + fn test_webhook_construct_event() { + let object = json!({ + "id": "ii_123", + "object": "invoiceitem", + "amount": 1000, + "currency": "usd", + "customer": "cus_123", + "date": 1533204620, + "description": "Test Invoice Item", + "discountable": false, + "invoice": "in_123", + "livemode": false, + "metadata": {}, + "period": { + "start": 1533204620, + "end": 1533204620 + }, + "proration": false, + "quantity": 3 + }); + let payload = mock_webhook_event(EventType::InvoiceitemCreated, object); + let event_timestamp = 1533204620; + let signature = format!("t={event_timestamp},v1=5a81ebe328da1df19581cbc6c7377920947ffd30b56eebcc7ba9a6938a090965,v0=63f3a72374a733066c4be69ed7f8e5ac85c22c9f0a6a612ab9a025a9e4ee7eef"); + + let webhook = Webhook { current_timestamp: event_timestamp }; + + let event = webhook + .do_construct_event(&payload.to_string(), &signature, WEBHOOK_SECRET) + .expect("Failed to construct event"); + + assert_eq!(event.type_, EventType::InvoiceitemCreated); + assert_eq!(event.id.as_str(), "evt_123",); + assert_eq!(event.account, "acct_123".parse().ok()); + assert_eq!(event.created, 1533204620); + + let EventObject::InvoiceitemCreated(invoice) = event.data.object else { + panic!("expected invoice item created"); + }; + assert_eq!(invoice.id.as_str(), "ii_123"); + assert_eq!(invoice.quantity, 3); + } + + #[cfg(feature = "stripe_billing")] + #[test] + // https://github.com/arlyon/async-stripe/issues/455 + fn test_billing_portal_session() { + let object = json!({ + "configuration": "bpc_123", + "created": 1533204620, + "customer": "cus_123", + "id": "bps_123", + "livemode": false, + "url": "http://localhost:3000" + }); + let result = parse_mock_webhook_event(EventType::BillingPortalSessionCreated, object); + let EventObject::BillingPortalSessionCreated(session) = result else { + panic!("expected billing portal session"); + }; + assert_eq!(session.url, "http://localhost:3000"); + assert_eq!(session.id.as_str(), "bps_123"); + assert_eq!(session.configuration.id().as_str(), "bpc_123"); + } + + #[test] + fn deserialize_polymorphic() { + let object = json!({ + "object": "bank_account", + "country": "us", + "currency": "gbp", + "id": "ba_123", + "last4": "1234", + "status": "status", + }); + let result = parse_mock_webhook_event(EventType::AccountExternalAccountCreated, object); + let EventObject::AccountExternalAccountCreated(AccountExternalAccountCreated::BankAccount( + bank_account, + )) = result + else { + panic!("unexpected type parsed"); + }; + assert_eq!(bank_account.id.as_str(), "ba_123"); + assert_eq!(bank_account.last4, "1234"); + } +} diff --git a/tests/Cargo.toml b/tests/Cargo.toml new file mode 100644 index 000000000..9ad327741 --- /dev/null +++ b/tests/Cargo.toml @@ -0,0 +1,35 @@ +[package] +name = "async-stripe-tests" +version = "0.1.0" +edition = "2021" +publish = false + +[dev-dependencies] +serde.workspace = true +serde_json = "1" +serde_qs = "0.12.0" +chrono = "0.4.26" +httpmock = "0.6.7" +wiremock = "0.5.22" +futures-util = { version = "0.3.21" } +tokio = { version = "1.24.1", features = ["rt", "macros"] } +stripe_types = {path = "../stripe_types"} +async-stripe = {path = "../async-stripe"} +stripe_connect = {path = "../generated/stripe_connect", features = ["account", "transfer_reversal"]} +stripe_billing = {path = "../generated/stripe_billing", features = ["invoice", "plan", "subscription", "subscription_item", "usage_record"]} +stripe_core = {path = "../generated/stripe_core", features = ["customer", "charge", "token"]} +stripe_checkout = {path = "../generated/stripe_checkout", features = ["checkout_session"]} +stripe_product = {path = "../generated/stripe_product", features = ["product", "price", "promotion_code"]} +stripe_misc = {path = "../generated/stripe_misc"} + +[features] +async = [] +blocking = [] + +runtime-tokio-hyper = ["async-stripe/runtime-tokio-hyper", "async"] +runtime-tokio-hyper-rustls = ["async-stripe/runtime-tokio-hyper-rustls", "async"] +runtime-tokio-hyper-rustls-webpki = ["async-stripe/runtime-tokio-hyper-rustls-webpki", "async"] +runtime-blocking = ["async-stripe/runtime-blocking", "blocking"] +runtime-blocking-rustls = ["async-stripe/runtime-blocking-rustls", "blocking"] +runtime-blocking-rustls-webpki = ["async-stripe/runtime-blocking-rustls-webpki", "blocking"] +runtime-async-std-surf = ["async-stripe/runtime-async-std-surf", "async"] \ No newline at end of file diff --git a/tests/account.rs b/tests/account.rs deleted file mode 100644 index 87306fdee..000000000 --- a/tests/account.rs +++ /dev/null @@ -1,17 +0,0 @@ -mod mock; - -#[test] -#[cfg(feature = "blocking")] -fn is_account_listable() { - mock::with_client(|client| { - let result = stripe::Account::list(client, &stripe::ListAccounts::new()); - let list = match result { - Err(err) => panic!("{}", err), - Ok(ok) => ok, - }; - - // Check to ensure we are deserializing _something_ and this test - // actually validates something worthwhile. - assert!(list.data.len() > 0); - }); -} diff --git a/tests/charge.rs b/tests/charge.rs deleted file mode 100644 index b42cda0d0..000000000 --- a/tests/charge.rs +++ /dev/null @@ -1,41 +0,0 @@ -mod mock; - -#[test] -#[cfg(feature = "blocking")] -fn is_charge_retrievable() { - mock::with_client(|client| { - let id = "ch_123".parse().unwrap(); - let result = stripe::Charge::retrieve(client, &id, &[]); - let charge = match result { - Err(err) => panic!("{}", err), - Ok(ok) => ok, - }; - assert_eq!(charge.id, "ch_123"); - if let Some(cus) = charge.customer { - assert!(!cus.is_object()); - } - if let Some(inv) = charge.invoice { - assert!(!inv.is_object()); - } - }); -} - -#[test] -#[cfg(feature = "blocking")] -fn is_charge_expandable() { - mock::with_client(|client| { - let id = "ch_123".parse().unwrap(); - let result = stripe::Charge::retrieve(client, &id, &[]); - let charge = match result { - Err(err) => panic!("{}", err), - Ok(ok) => ok, - }; - assert_eq!(charge.id, "ch_123"); - if let Some(cus) = charge.customer { - assert!(cus.is_object()); - } - if let Some(inv) = charge.invoice { - assert!(inv.is_object()); - } - }); -} diff --git a/tests/checkout.rs b/tests/checkout.rs deleted file mode 100644 index 99fd6a40f..000000000 --- a/tests/checkout.rs +++ /dev/null @@ -1,16 +0,0 @@ -mod mock; - -#[test] -#[ignore] // stripe-mock doesn't include the `created` flag: https://github.com/stripe/stripe-mock/issues/371 -#[cfg(feature = "blocking")] -fn is_checkout_session_retrievable() { - mock::with_client(|client| { - let id = "cs_test_123".parse().unwrap(); - let result = stripe::CheckoutSession::retrieve(client, &id, &[]); - let session = match result { - Err(err) => panic!("{}", err), - Ok(ok) => ok, - }; - assert_eq!(session.id, "cs_test_123"); - }); -} diff --git a/tests/customer.rs b/tests/customer.rs deleted file mode 100644 index 82b74a438..000000000 --- a/tests/customer.rs +++ /dev/null @@ -1,32 +0,0 @@ -mod mock; - -#[cfg(feature = "blocking")] -fn customer_create_and_delete(client: &stripe::Client) { - let customer_params = stripe::CreateCustomer::new(); - let customer = stripe::Customer::create(client, customer_params).unwrap(); - let result = stripe::Customer::delete(client, &customer.id); - match result { - Ok(deleted) => assert!(deleted.deleted, "customer wasn't deleted"), - Err(err) => panic!("{}", err), - } -} - -#[test] -#[cfg(feature = "blocking")] -fn customer_create_and_delete_without_account() { - mock::with_client(|client| { - customer_create_and_delete(client); - }); -} - -#[test] -#[cfg(feature = "blocking")] -fn customer_create_and_delete_with_account() { - mock::with_client(|client| { - let client = client - .to_owned() - .with_client_id("ca_123".parse().unwrap()) - .with_stripe_account("acct_123".parse().unwrap()); - customer_create_and_delete(&client); - }); -} diff --git a/tests/mock/mod.rs b/tests/mock/mod.rs deleted file mode 100644 index c21d7c693..000000000 --- a/tests/mock/mod.rs +++ /dev/null @@ -1,14 +0,0 @@ -//! Setup and teardown for the stripe mock service. - -#[allow(dead_code)] -pub fn with_client(test: T) -> () -where - T: FnOnce(&stripe::Client) -> () + std::panic::UnwindSafe, -{ - let result = std::panic::catch_unwind(|| { - let client = stripe::Client::from_url("http://localhost:12111", "sk_test_123"); - test(&client) - }); - - assert!(result.is_ok()) -} diff --git a/tests/plan_interval.rs b/tests/plan_interval.rs deleted file mode 100644 index 413e1b59e..000000000 --- a/tests/plan_interval.rs +++ /dev/null @@ -1,44 +0,0 @@ -//! Basic tests to ensure that the plan interval types -//! are exported properly. Mainly just needs to compile. - -mod mock; - -#[test] -#[cfg(feature = "blocking")] -fn can_create_plan() { - let id = "price_123".parse().unwrap(); - mock::with_client(|client| { - let mut plan = stripe::Plan::retrieve(client, &id, &[]).unwrap(); - plan.interval = Some(stripe::PlanInterval::Month); - }); -} - -#[test] -#[cfg(feature = "blocking")] -fn can_create_subscription_interval() { - let _recurring = stripe::SubscriptionPriceDataRecurring { - interval: stripe::SubscriptionInterval::Month, - interval_count: Some(100), - }; -} - -#[test] -#[cfg(feature = "blocking")] -fn can_create_subscription_plan_interval() { - mock::with_client(|client| { - let id = "sub_123".parse().unwrap(); - let mut create = stripe::CreateSubscriptionItem::new(id); - create.price_data = Some(stripe::SubscriptionItemPriceData { - currency: stripe::Currency::USD, - product: "My Product".to_string(), - recurring: stripe::SubscriptionItemPriceDataRecurring { - interval: stripe::SubscriptionItemInterval::Day, - interval_count: Some(6), - }, - tax_behavior: None, - unit_amount: None, - unit_amount_decimal: None, - }); - let _result = stripe::SubscriptionItem::create(client, create).unwrap(); - }); -} diff --git a/tests/subscription.rs b/tests/subscription.rs deleted file mode 100644 index 9635b116c..000000000 --- a/tests/subscription.rs +++ /dev/null @@ -1,43 +0,0 @@ -mod mock; - -#[test] -#[cfg(feature = "blocking")] -fn is_subscription_retrievable() { - mock::with_client(|client| { - let id = "sub_123".parse().unwrap(); - let result = stripe::Subscription::retrieve(client, &id, &[]); - let subscription = match result { - Err(err) => panic!("{}", err), - Ok(ok) => ok, - }; - assert_eq!(subscription.id, "sub_123"); - assert!(!subscription.customer.is_object()); - }); -} - -#[test] -#[cfg(feature = "blocking")] -fn is_subscription_expandable() { - mock::with_client(|client| { - let id = "sub_123".parse().unwrap(); - let result = stripe::Subscription::retrieve( - client, - &id, - &[ - "customer", - // "schedule", - // "latest_invoice", - // "pending_setup_intent", - // "default_source", - // "default_tax_rates", - // "default_payment_method", - ], - ); - let subscription = match result { - Err(err) => panic!("{}", err), - Ok(ok) => ok, - }; - assert_eq!(subscription.id, "sub_123"); - assert!(subscription.customer.is_object()); - }); -} diff --git a/tests/subscription_item.rs b/tests/subscription_item.rs deleted file mode 100644 index f432338bc..000000000 --- a/tests/subscription_item.rs +++ /dev/null @@ -1,21 +0,0 @@ -mod mock; - -#[test] -#[cfg(feature = "blocking")] -fn can_create_usage_record() { - let subscription_item_id = "si_JVbsG8wiy20ycs".parse().unwrap(); - mock::with_client(|client| { - let usage_record = stripe::UsageRecord::create( - client, - &subscription_item_id, - stripe::CreateUsageRecord { - quantity: 42, - action: Some(stripe::UsageRecordAction::Increment), - timestamp: Some(chrono::Utc::now().timestamp()), - }, - ) - .unwrap(); - assert_eq!(usage_record.quantity, 42); - assert_eq!(usage_record.subscription_item, subscription_item_id.as_str()); - }); -} diff --git a/tests/tests/it/async_tests/mod.rs b/tests/tests/it/async_tests/mod.rs new file mode 100644 index 000000000..bfe793d59 --- /dev/null +++ b/tests/tests/it/async_tests/mod.rs @@ -0,0 +1 @@ +mod pagination; diff --git a/tests/tests/it/async_tests/pagination.rs b/tests/tests/it/async_tests/pagination.rs new file mode 100644 index 000000000..dfbabe60f --- /dev/null +++ b/tests/tests/it/async_tests/pagination.rs @@ -0,0 +1,176 @@ +use futures_util::StreamExt; +use futures_util::TryStreamExt; +use stripe::PaginationExt; +use stripe::{AccountId, Client}; +use stripe_connect::account::ListAccount; +use stripe_core::customer::{ListCustomer, SearchCustomer}; +use stripe_core::{Customer, CustomerId}; + +use crate::mock::get_client; +use crate::pagination_utils::{cons_cus_id, parse_cus_id, PaginationMock, PaginationMockKind}; + +const PAGINATION_KINDS: [PaginationMockKind; 2] = + [PaginationMockKind::List, PaginationMockKind::Search]; + +#[tokio::test] +async fn is_account_listable() { + let client = get_client(); + let expected_id: AccountId = "acct_1OPouMJN5vQBdWEx".parse().unwrap(); + + // Paginating from nothing + let result = + ListAccount::new().paginate().stream(&client).try_collect::>().await.unwrap(); + assert_eq!(result.len(), 1); + assert_eq!(result.first().unwrap().id, expected_id); + + // Should be same result making a single request, then paginating that returned list since there's no + // additional data + let result = ListAccount::new().send(&client).await.unwrap(); + assert_eq!(result.data.len(), 1); + assert_eq!(result.data.first().unwrap().id, expected_id); + + let result = result.into_paginator().stream(&client).try_collect::>().await.unwrap(); + assert_eq!(result.len(), 1); + assert_eq!(result.first().unwrap().id, expected_id); +} + +#[tokio::test] +async fn is_customer_searchable() { + let client = get_client(); + let expected_id: CustomerId = "cus_PEHTtYpY7elppN".parse().unwrap(); + + // Paginating from nothing + let result = SearchCustomer::new("unused_query") + .paginate() + .stream(&client) + .try_collect::>() + .await + .unwrap(); + assert_eq!(result.len(), 1); + assert_eq!(result.first().unwrap().id, expected_id); + + // Should be same result making a single request, then paginating that returned list since there's no + // additional data + let result = SearchCustomer::new("unused_query").send(&client).await.unwrap(); + assert_eq!(result.data.len(), 1); + assert_eq!(result.data.first().unwrap().id, expected_id); + + let result = result.into_paginator().stream(&client).try_collect::>().await.unwrap(); + assert_eq!(result.len(), 1); + assert_eq!(result.first().unwrap().id, expected_id); +} + +/// `PaginationMock` docs best explain how the mock pagination works. This function ensures +/// that we both fetched the correct data and made the correct series of API calls when paginating +/// all data from `initial_cursor` onward. +/// +// FIXME: add `track_caller` once that's supported for async on stable so easier to see any +// failing cases +async fn check_get_all( + kind: PaginationMockKind, + customer_count: usize, + limit: Option, + initial_cursor: Option, + expected_cursors: Vec>, +) { + let mocker = PaginationMock::new(customer_count, kind).await; + let client = Client::from_url(&*mocker.url(), "fake_key"); + let initial_cursor_str = initial_cursor.map(cons_cus_id); + let items: Vec = match kind { + PaginationMockKind::List => { + let params = ListCustomer { + limit, + starting_after: initial_cursor_str.as_deref(), + ..Default::default() + }; + params.paginate().stream(&client).try_collect().await.unwrap() + } + PaginationMockKind::Search => { + let params = SearchCustomer { + limit, + page: initial_cursor_str.as_deref(), + query: "unused", + expand: None, + }; + params.paginate().stream(&client).try_collect().await.unwrap() + } + }; + + mocker.assert_cursors_received(&expected_cursors).await; + let all_ids_received = items.into_iter().map(|c| c.id.to_string()).collect::>(); + let expected_ids = if let Some(start_cursor) = initial_cursor { + mocker.all_ids_after(start_cursor) + } else { + mocker.all_ids() + }; + assert_eq!(all_ids_received, expected_ids); +} + +/// `PaginationMock` docs best explain how the mock pagination works. This function ensures +/// that we both fetched the correct data and made the correct series of API calls when paginating +/// any amount of data from `initial_cursor` onward. +/// +// FIXME: add `track_caller` once that's supported for async on stable so easier to see any +// failing cases +async fn check_partial( + kind: PaginationMockKind, + count_to_get: usize, + initial_cursor: Option, + expected_cursors: Vec>, + expected_ids_received: Vec, +) { + let mocker = PaginationMock::new(10, kind).await; + let client = Client::from_url(&*mocker.url(), "fake_key"); + let initial_cursor_str = initial_cursor.map(cons_cus_id); + let items: Vec = match kind { + PaginationMockKind::List => { + let params = ListCustomer { + limit: Some(5), + starting_after: initial_cursor_str.as_deref(), + ..Default::default() + }; + params.paginate().stream(&client).take(count_to_get).try_collect().await.unwrap() + } + PaginationMockKind::Search => { + let params = SearchCustomer { + limit: Some(5), + page: initial_cursor_str.as_deref(), + query: "unused", + expand: None, + }; + params.paginate().stream(&client).take(count_to_get).try_collect().await.unwrap() + } + }; + + mocker.assert_cursors_received(&expected_cursors).await; + let all_ids_received = + items.into_iter().map(|c| parse_cus_id(c.id.as_str())).collect::>(); + assert_eq!(all_ids_received, expected_ids_received); +} + +#[tokio::test] +async fn pagination_get_all() { + for kind in PAGINATION_KINDS { + check_get_all(kind, 0, None, None, vec![None]).await; + check_get_all(kind, 2, None, None, vec![None]).await; + check_get_all(kind, 2, Some(1), None, vec![None, Some(1)]).await; + check_get_all(kind, 10, Some(3), None, vec![None, Some(3), Some(6), Some(9)]).await; + } +} + +#[tokio::test] +async fn pagination_starting_not_at_beginning() { + for kind in PAGINATION_KINDS { + check_get_all(kind, 2, None, Some(1), vec![Some(1)]).await; + check_get_all(kind, 10, Some(3), Some(4), vec![Some(4), Some(7), Some(10)]).await; + } +} + +#[tokio::test] +async fn partial_pagination() { + for kind in PAGINATION_KINDS { + check_partial(kind, 2, None, vec![None], vec![1, 2]).await; + check_partial(kind, 2, Some(2), vec![Some(2)], vec![3, 4]).await; + check_partial(kind, 7, Some(1), vec![Some(1), Some(6)], vec![2, 3, 4, 5, 6, 7, 8]).await; + } +} diff --git a/tests/tests/it/blocking/account.rs b/tests/tests/it/blocking/account.rs new file mode 100644 index 000000000..733665089 --- /dev/null +++ b/tests/tests/it/blocking/account.rs @@ -0,0 +1,33 @@ +use stripe::AccountId; +use stripe_connect::account::{CapabilitiesParam, CapabilityParam, CreateAccount, ListAccount}; +use stripe_connect::AccountCapabilitiesStatus; + +use crate::mock::get_client; + +#[test] +fn is_account_listable() { + let client = get_client(); + let expected_id: AccountId = "acct_1OPouMJN5vQBdWEx".parse().unwrap(); + let result = ListAccount::new().send(&client).unwrap(); + + // Check to ensure we are deserializing _something_ and this test + // actually validates something worthwhile. + assert_eq!(result.data.len(), 1); + assert_eq!(result.data.first().unwrap().id, expected_id); + + let result = ListAccount::new().paginate().get_all(&client).unwrap(); + assert_eq!(result.len(), 1); + assert_eq!(result.first().unwrap().id, expected_id); +} + +#[test] +fn create_account() { + let client = get_client(); + let mut create = CreateAccount::new(); + let mut capabilities = CapabilitiesParam::new(); + capabilities.acss_debit_payments = Some(CapabilityParam { requested: Some(true) }); + create.capabilities = Some(capabilities); + let result = create.send(&client).unwrap(); + assert_eq!(result.email, Some("site@stripe.com".to_string())); + assert_eq!(result.capabilities.unwrap().card_payments, Some(AccountCapabilitiesStatus::Active)); +} diff --git a/tests/tests/it/blocking/charge.rs b/tests/tests/it/blocking/charge.rs new file mode 100644 index 000000000..7c4c4be84 --- /dev/null +++ b/tests/tests/it/blocking/charge.rs @@ -0,0 +1,15 @@ +use stripe_core::charge::RetrieveCharge; + +use crate::mock::get_client; + +#[test] +fn is_charge_retrievable() { + let client = get_client(); + + let id = "ch_123".parse().unwrap(); + let charge = RetrieveCharge::new().send(&client, &id).unwrap(); + assert_eq!(charge.id, "ch_123"); + assert!(charge.customer.is_none()); + assert!(charge.invoice.is_none()); + assert_eq!(charge.refunds.unwrap().data.len(), 1); +} diff --git a/tests/tests/it/blocking/checkout.rs b/tests/tests/it/blocking/checkout.rs new file mode 100644 index 000000000..ef7ac60c2 --- /dev/null +++ b/tests/tests/it/blocking/checkout.rs @@ -0,0 +1,12 @@ +use stripe_checkout::checkout_session::RetrieveCheckoutSession; + +use crate::mock::get_client; + +#[test] +fn is_checkout_session_retrievable() { + let client = get_client(); + + let id = "cs_test_123".parse().unwrap(); + let session = RetrieveCheckoutSession::new().send(&client, &id).unwrap(); + assert_eq!(session.id, "cs_test_123"); +} diff --git a/tests/tests/it/blocking/customer.rs b/tests/tests/it/blocking/customer.rs new file mode 100644 index 000000000..ede5ac27f --- /dev/null +++ b/tests/tests/it/blocking/customer.rs @@ -0,0 +1,41 @@ +use stripe_core::customer::{ + CreateCustomer, DeleteCustomer, RetrieveCustomer, RetrieveCustomerReturned, +}; + +use crate::mock::get_client; + +fn customer_create_and_delete(client: &stripe::Client) { + // NB: the create step is not required for deletion to work since the stripe mock is stateless + let customer = CreateCustomer::new().send(client).unwrap(); + let result = DeleteCustomer::new().send(client, &customer.id).unwrap(); + assert_eq!(result.id, customer.id); +} + +#[test] +fn customer_create_and_delete_without_account() { + let client = get_client(); + customer_create_and_delete(&client); +} + +#[test] +fn customer_create_and_delete_with_account() { + let client = get_client() + .with_client_id("ca_123".parse().unwrap()) + .with_stripe_account("acct_123".parse().unwrap()); + customer_create_and_delete(&client); +} + +#[test] +fn retrieve_customer() { + let client = get_client(); + let id = "cus_123".parse().unwrap(); + let ret = RetrieveCustomer::new().send(&client, &id).unwrap(); + match ret { + RetrieveCustomerReturned::Customer(cust) => { + assert_eq!(cust.id, id); + assert_eq!(cust.invoice_prefix, Some("B4749BD".into())); + assert_eq!(cust.created, 1234567890); + } + RetrieveCustomerReturned::DeletedCustomer(_) => panic!("expected non-deleted response"), + } +} diff --git a/tests/tests/it/blocking/invoice.rs b/tests/tests/it/blocking/invoice.rs new file mode 100644 index 000000000..d2a7ab107 --- /dev/null +++ b/tests/tests/it/blocking/invoice.rs @@ -0,0 +1,61 @@ +use stripe_billing::invoice::{ + FinalizeInvoiceInvoice, PayInvoice, RetrieveInvoice, UpcomingInvoice, + UpcomingInvoiceSubscriptionItems, +}; + +use crate::mock::get_client; + +// Smoke test, https://github.com/arlyon/async-stripe/issues/396 +#[test] +fn is_invoice_retrievable() { + let client = get_client(); + + let mut retriever = RetrieveInvoice::new(); + retriever.expand = Some(&["charge.balance_transaction"]); + let id = "in_123".parse().unwrap(); + let result = retriever.send(&client, &id).unwrap(); + let charge = result.charge.unwrap(); + assert!(charge.is_object()); +} + +// https://github.com/arlyon/async-stripe/issues/446 +// https://github.com/arlyon/async-stripe/issues/352 +#[test] +fn is_invoice_payable() { + let client = get_client(); + + let mut payer = PayInvoice::new(); + payer.forgive = Some(true); + payer.off_session = Some(true); + payer.paid_out_of_band = Some(true); + let id = "in_123".parse().unwrap(); + let result = payer.send(&client, &id).unwrap(); + assert_eq!(result.id, Some(id)); + assert_eq!(result.paid_out_of_band, true); +} + +#[test] +// https://github.com/arlyon/async-stripe/issues/442 +fn finalize_invoice() { + let client = get_client(); + + let mut finalize = FinalizeInvoiceInvoice::new(); + finalize.auto_advance = Some(true); + let id = "in_123".parse().unwrap(); + let result = finalize.send(&client, &id).unwrap(); + assert_eq!(result.id, Some(id)); + assert_eq!(result.auto_advance, Some(true)); +} + +#[test] +// https://github.com/arlyon/async-stripe/blob/ca5269ebcf9cbd7005f3fecedc63cc31718680a6/src/resources/invoice_ext.rs#L35 +fn upcoming_invoice() { + let client = get_client(); + + let mut upcoming = UpcomingInvoice::new(); + let items = vec![UpcomingInvoiceSubscriptionItems::new()]; + upcoming.subscription_items = Some(&items); + let result = upcoming.send(&client).unwrap(); + assert_eq!(result.subtotal, 1000); + assert_eq!(result.amount_due, 1000); +} diff --git a/tests/tests/it/blocking/mod.rs b/tests/tests/it/blocking/mod.rs new file mode 100644 index 000000000..bdfde9e88 --- /dev/null +++ b/tests/tests/it/blocking/mod.rs @@ -0,0 +1,13 @@ +mod account; +mod charge; +mod checkout; +mod customer; +mod invoice; +mod plan_interval; +mod price; +mod product; +mod promotion_code; +mod subscription; +mod subscription_item; +mod token; +mod transfer_reversal; diff --git a/tests/tests/it/blocking/plan_interval.rs b/tests/tests/it/blocking/plan_interval.rs new file mode 100644 index 000000000..121632309 --- /dev/null +++ b/tests/tests/it/blocking/plan_interval.rs @@ -0,0 +1,39 @@ +//! Basic tests to ensure that the plan interval types +//! are exported properly. Mainly just needs to compile. + +use stripe_billing::plan::RetrievePlan; +use stripe_billing::subscription_item::{ + CreateSubscriptionItem, CreateSubscriptionItemPriceData, + CreateSubscriptionItemPriceDataRecurring, CreateSubscriptionItemPriceDataRecurringInterval, +}; +use stripe_billing::PlanInterval; + +use crate::mock::get_client; + +#[test] +fn can_create_plan() { + let client = get_client(); + + let id = "price_123".parse().unwrap(); + let plan = RetrievePlan::new().send(&client, &id).unwrap(); + assert_eq!(plan.interval, PlanInterval::Month); + assert_eq!(plan.amount, Some(2000)); +} + +#[test] +// See ignore reason in subscription testing +#[ignore] +fn can_create_subscription_plan_interval() { + let client = get_client(); + + let id = "sub_123"; + let mut create = CreateSubscriptionItem::new(id); + create.price_data = Some(CreateSubscriptionItemPriceData::new( + stripe_types::Currency::USD, + "My Product", + CreateSubscriptionItemPriceDataRecurring::new( + CreateSubscriptionItemPriceDataRecurringInterval::Day, + ), + )); + let _result = create.send(&client).unwrap(); +} diff --git a/tests/tests/it/blocking/price.rs b/tests/tests/it/blocking/price.rs new file mode 100644 index 000000000..d148cc945 --- /dev/null +++ b/tests/tests/it/blocking/price.rs @@ -0,0 +1,26 @@ +use std::collections::HashMap; + +use stripe_product::price::{UpdatePrice, UpdatePriceCurrencyOptions}; +use stripe_product::PriceTaxBehavior; +use stripe_types::Currency; + +use crate::mock::get_client; + +#[test] +// https://github.com/arlyon/async-stripe/issues/417 +fn update_price() { + let client = get_client(); + + let mut update = UpdatePrice::new(); + let mut currency_opts = HashMap::new(); + let mut opt = UpdatePriceCurrencyOptions::new(); + opt.unit_amount = Some(4); + currency_opts.insert(Currency::USD, opt); + update.currency_options = Some(¤cy_opts); + + let price_id = "price_123".parse().unwrap(); + + let price = update.send(&client, &price_id).unwrap(); + assert_eq!(price.id, price_id); + assert_eq!(price.tax_behavior, Some(PriceTaxBehavior::Unspecified)); +} diff --git a/tests/tests/it/blocking/product.rs b/tests/tests/it/blocking/product.rs new file mode 100644 index 000000000..8d68706fa --- /dev/null +++ b/tests/tests/it/blocking/product.rs @@ -0,0 +1,18 @@ +use stripe_product::product::{CreateProduct, Features}; + +use crate::mock::get_client; + +#[test] +// FIXME: stripe-mock is missing required `type` field +#[ignore] +// https://github.com/arlyon/async-stripe/issues/437 +fn create_product() { + let client = get_client(); + + let mut create = CreateProduct::new("my product"); + let features = vec![Features::new("great feature")]; + create.features = Some(&features); + + let product = create.send(&client).unwrap(); + assert_eq!(product.features.first().unwrap().name, Some("great feature".into())); +} diff --git a/tests/tests/it/blocking/promotion_code.rs b/tests/tests/it/blocking/promotion_code.rs new file mode 100644 index 000000000..db21622f3 --- /dev/null +++ b/tests/tests/it/blocking/promotion_code.rs @@ -0,0 +1,15 @@ +use stripe_product::promotion_code::CreatePromotionCode; + +use crate::mock::get_client; + +#[test] +// https://github.com/arlyon/async-stripe/issues/389 +fn create_promotion_code() { + let client = get_client(); + + let mut create = CreatePromotionCode::new("code"); + create.active = Some(true); + + let result = create.send(&client).unwrap(); + assert!(result.active); +} diff --git a/tests/tests/it/blocking/subscription.rs b/tests/tests/it/blocking/subscription.rs new file mode 100644 index 000000000..a96b82962 --- /dev/null +++ b/tests/tests/it/blocking/subscription.rs @@ -0,0 +1,46 @@ +use stripe_billing::subscription::{ + CancelSubscription, CancelSubscriptionCancellationDetails, RetrieveSubscription, +}; + +use crate::mock::get_client; + +#[test] +// Test ignored because the spec implies `plan` is required, but stripe-mock does not +// include it when sending a `subscription_item` +#[ignore] +fn is_subscription_retrievable() { + let client = get_client(); + + let id = "sub_123".parse().unwrap(); + let subscription = RetrieveSubscription::new().send(&client, &id).unwrap(); + assert_eq!(subscription.id, "sub_123"); + assert!(!subscription.customer.is_object()); +} + +#[test] +#[ignore] +fn is_subscription_expandable() { + let client = get_client(); + + let id = "sub_123".parse().unwrap(); + let mut retrieve = RetrieveSubscription::new(); + retrieve.expand = Some(&["customer"]); + let subscription = retrieve.send(&client, &id).unwrap(); + assert_eq!(subscription.id, "sub_123"); + assert!(subscription.customer.is_object()); +} + +#[test] +#[ignore] +/// https://github.com/arlyon/async-stripe/issues/394 +/// https://github.com/arlyon/async-stripe/issues/419 +fn can_prorate_when_cancelling_subscription() { + let client = get_client(); + + let id = "sub_123".parse().unwrap(); + let mut cancel = CancelSubscription::new(); + cancel.cancellation_details = Some(CancelSubscriptionCancellationDetails::new()); + cancel.prorate = Some(true); + let result = cancel.send(&client, &id).unwrap(); + assert_eq!(result.id, id); +} diff --git a/tests/tests/it/blocking/subscription_item.rs b/tests/tests/it/blocking/subscription_item.rs new file mode 100644 index 000000000..402710b18 --- /dev/null +++ b/tests/tests/it/blocking/subscription_item.rs @@ -0,0 +1,22 @@ +use chrono::Utc; +use stripe_billing::usage_record::{ + CreateUsageRecord, CreateUsageRecordAction, CreateUsageRecordTimestamp, +}; + +use crate::mock::get_client; + +#[test] +fn can_create_usage_record() { + let client = get_client(); + + let subscription_item_id = "si_JVbsG8wiy20ycs".parse().unwrap(); + let creator = CreateUsageRecord { + quantity: 42, + action: Some(CreateUsageRecordAction::Increment), + timestamp: Some(CreateUsageRecordTimestamp::Timestamp(Utc::now().timestamp())), + expand: None, + }; + let usage_record = creator.send(&client, &subscription_item_id).unwrap(); + assert_eq!(usage_record.quantity, 42); + assert_eq!(usage_record.subscription_item, subscription_item_id.as_str()); +} diff --git a/tests/tests/it/blocking/token.rs b/tests/tests/it/blocking/token.rs new file mode 100644 index 000000000..15843f5b3 --- /dev/null +++ b/tests/tests/it/blocking/token.rs @@ -0,0 +1,19 @@ +use stripe_core::token::{CreateToken, CreateTokenAccount, CreateTokenAccountBusinessType}; + +use crate::mock::get_client; + +// https://github.com/arlyon/async-stripe/issues/423 +#[test] +fn create_account_token_smoke_test() { + let client = get_client(); + + let mut acct = CreateTokenAccount::new(); + acct.tos_shown_and_accepted = Some(true); + acct.business_type = Some(CreateTokenAccountBusinessType::Individual); + let mut create = CreateToken::new(); + create.account = Some(acct); + + let stripe_acct_token = create.send(&client).unwrap(); + assert!(!stripe_acct_token.used); + assert!(!stripe_acct_token.livemode); +} diff --git a/tests/tests/it/blocking/transfer_reversal.rs b/tests/tests/it/blocking/transfer_reversal.rs new file mode 100644 index 000000000..72a8e0b17 --- /dev/null +++ b/tests/tests/it/blocking/transfer_reversal.rs @@ -0,0 +1,17 @@ +use stripe_connect::transfer_reversal::CreateTransferReversal; + +use crate::mock::get_client; + +// https://github.com/arlyon/async-stripe/issues/399 +#[test] +fn create_transfer_reversal() { + let client = get_client(); + + let mut create = CreateTransferReversal::new(); + let id = "tr_Ll53U0VONALFk36".parse().unwrap(); + create.refund_application_fee = Some(true); + create.amount = Some(4); + + let created = create.send(&client, &id).unwrap(); + assert_eq!(created.amount, 4); +} diff --git a/tests/encoding.rs b/tests/tests/it/deser.rs similarity index 61% rename from tests/encoding.rs rename to tests/tests/it/deser.rs index 7664dfc68..a04e4e1c2 100644 --- a/tests/encoding.rs +++ b/tests/tests/it/deser.rs @@ -1,120 +1,9 @@ -#![recursion_limit = "256"] use serde_json::json; - -#[test] -fn debug_currency() { - use stripe::Currency; - assert_eq!(format!("{:?}", Currency::AED), "AED"); - assert_eq!(format!("{:?}", Currency::USD), "USD"); - assert_eq!(format!("{:?}", Currency::ZMW), "ZMW"); -} - -#[test] -fn display_currency() { - use stripe::Currency; - assert_eq!(format!("{}", Currency::AED), "aed"); - assert_eq!(format!("{}", Currency::USD), "usd"); - assert_eq!(format!("{}", Currency::ZMW), "zmw"); -} - -#[test] -fn serialize_currency() { - use stripe::Currency; - assert_eq!(serde_json::to_string(&Currency::AED).unwrap(), "\"aed\""); - assert_eq!(serde_json::to_string(&Currency::USD).unwrap(), "\"usd\""); - assert_eq!(serde_json::to_string(&Currency::ZMW).unwrap(), "\"zmw\""); -} - -#[test] -fn deserialize_currency() { - use stripe::Currency; - assert_eq!(serde_json::from_str::("\"aed\"").unwrap(), Currency::AED); - assert_eq!(serde_json::from_str::("\"usd\"").unwrap(), Currency::USD); - assert_eq!(serde_json::from_str::("\"zmw\"").unwrap(), Currency::ZMW); -} - -#[test] -fn serialize_range_query() { - use stripe::{ListCustomers, RangeBounds, RangeQuery}; - - let query = RangeQuery::Bounds(RangeBounds { - gt: None, - gte: Some(1501598702), - lt: Some(1504233902), - lte: None, - }); - assert_eq!(urldecode(serde_qs::to_string(&query).unwrap()), "gte=1501598702<=1504233902"); - - let mut params = ListCustomers::new(); - params.created = Some(RangeQuery::eq(1501598702)); - params.limit = Some(3); - assert_eq!(urldecode(serde_qs::to_string(¶ms).unwrap()), "created=1501598702&limit=3"); - - let mut params = ListCustomers::new(); - params.created = Some(RangeQuery::gte(1501598702)); - params.limit = Some(3); - assert_eq!(urldecode(serde_qs::to_string(¶ms).unwrap()), "created[gte]=1501598702&limit=3"); - - let mut params = ListCustomers::new(); - params.created = Some(query); - params.limit = Some(3); - let encoded = urldecode(serde_qs::to_string(¶ms).unwrap()); - assert_eq!(encoded, "created[gte]=1501598702&created[lt]=1504233902&limit=3"); -} - -fn urldecode(input: String) -> String { - input.replace("%5B", "[").replace("%5D", "]") -} - -#[test] -fn deserialize_payment_source_params() { - use stripe::{PaymentSourceParams, SourceId, TokenId}; - - let examples = [ - ( - json!("src_xyzABC123"), - Some(PaymentSourceParams::Source("src_xyzABC123".parse::().unwrap())), - ), - ( - json!("tok_189g322eZvKYlo2CeoPw2sdy"), - Some(PaymentSourceParams::Token( - "tok_189g322eZvKYlo2CeoPw2sdy".parse::().unwrap(), - )), - ), - ]; - - for (value, expected) in &examples { - let input = serde_json::to_string(value).unwrap(); - let parsed: Option = serde_json::from_str(&input).ok(); - assert_eq!(json!(parsed), json!(expected)); - } -} - -#[test] -fn serialize_payment_source_params() { - use stripe::{PaymentSourceParams, SourceId, TokenId}; - - let examples = [ - ( - PaymentSourceParams::Source("src_xyzABC123".parse::().unwrap()), - json!("src_xyzABC123"), - ), - ( - PaymentSourceParams::Token("tok_189g322eZvKYlo2CeoPw2sdy".parse::().unwrap()), - json!("tok_189g322eZvKYlo2CeoPw2sdy"), - ), - ]; - - for (params, expected) in &examples { - let value = serde_json::to_value(params).unwrap(); - assert_eq!(&value, expected); - } -} +use stripe_core::{Charge, ChargeStatus, Customer}; +use stripe_types::Currency; #[test] fn deserialize_customer_with_card() { - use stripe::Customer; - let example = json!({ "id": "cus_1234", "object": "customer", @@ -179,8 +68,6 @@ fn deserialize_customer_with_card() { #[test] fn deserialize_customer_with_source() { - use stripe::Customer; - let example = json!({ "id": "cus_5678", "object": "customer", @@ -261,9 +148,8 @@ fn deserialize_customer_with_source() { } #[test] -#[cfg(feature = "event")] fn deserialize_checkout_event() { - use stripe::Event; + use stripe_core::Event; let example = json!({ "created": 1326853478, @@ -313,3 +199,30 @@ fn deserialize_checkout_event() { let result = serde_json::from_value::(example); assert!(result.is_ok(), "expected ok; was {:?}", result); } + +#[test] +// https://github.com/arlyon/async-stripe/issues/456 +// NB: deserialization test because `stripe_mock` always includes `refunds` +fn deserialize_charge_with_no_refunds() { + let example = json!({ + "amount": 0, + "billing_details": {}, + "amount_captured": 0, + "amount_refunded": 0, + "captured": true, + "currency": "cad", + "created": 1703349829, + "disputed": false, + "id": "ch_123", + "livemode": false, + "metadata": {}, + "paid": false, + "status": "pending", + "refunded": false, + }); + let charge: Charge = serde_json::from_value(example).unwrap(); + assert_eq!(charge.id.as_str(), "ch_123"); + assert_eq!(charge.currency, Currency::CAD); + assert_eq!(charge.status, ChargeStatus::Pending); + assert_eq!(charge.created, 1703349829); +} diff --git a/tests/tests/it/main.rs b/tests/tests/it/main.rs new file mode 100644 index 000000000..a0366d4b0 --- /dev/null +++ b/tests/tests/it/main.rs @@ -0,0 +1,14 @@ +// Needed for `json!` usage in tests +#![recursion_limit = "256"] +mod deser; +mod mock; +mod price; + +#[cfg(feature = "async")] +mod async_tests; +#[cfg(feature = "blocking")] +mod blocking; +// NB: pagination utils ideally could be used for blocking tests as well, but tricky because the `MockServer` is async +// and the blocking client unconditionally creates its own runtime already +#[cfg(feature = "async")] +mod pagination_utils; diff --git a/tests/tests/it/mock.rs b/tests/tests/it/mock.rs new file mode 100644 index 000000000..ce36957c3 --- /dev/null +++ b/tests/tests/it/mock.rs @@ -0,0 +1,7 @@ +//! Setup for the stripe mock service. + +use stripe::Client; + +pub fn get_client() -> Client { + Client::from_url("http://localhost:12111", "sk_test_123") +} diff --git a/tests/tests/it/pagination_utils.rs b/tests/tests/it/pagination_utils.rs new file mode 100644 index 000000000..6dcb7a358 --- /dev/null +++ b/tests/tests/it/pagination_utils.rs @@ -0,0 +1,188 @@ +//! Utilities defined to help test different pagination scenarios more easily. +use std::cmp::min; + +use serde_json::{json, Value}; +use wiremock::matchers::{method, path}; +use wiremock::{Mock, MockServer, Request, ResponseTemplate}; + +/// Basic mock customer data +fn mock_customer_data(customer_id: &str) -> Value { + json!({ + "id": customer_id, + "object": "customer", + "balance": 0, + "created": 1649316731, + "currency": "gbp", + "delinquent": false, + "email": null, + "invoice_prefix": "4AF7482", + "invoice_settings": {}, + "livemode": false, + "metadata": {}, + "preferred_locales": [], + "tax_exempt": "none" + }) +} + +fn mock_customer_list(customer_ids: &[String], has_more: bool) -> Value { + let data = customer_ids.iter().map(|id| mock_customer_data(id)).collect::>(); + json!({ + "object": "list", + "data": data, + "has_more": has_more, + "url": "/v1/customers" + }) +} + +fn mock_customer_search_list( + customer_ids: &[String], + has_more: bool, + next_page: Option<&String>, +) -> Value { + let data = customer_ids.iter().map(|id| mock_customer_data(id)).collect::>(); + json!({ + "object": "search_result", + "data": data, + "has_more": has_more, + "url": "/v1/customers/search", + "next_page": next_page + }) +} + +fn extract_params(req: &Request) -> serde_json::Map { + if let Some(query) = req.url.query() { + serde_qs::from_str(query).expect("invalid list customer request") + } else { + Default::default() + } +} + +/// Extract an index from a customer id in the format expected by our mocks +pub fn parse_cus_id(cus_id: &str) -> usize { + cus_id.trim_start_matches("cus_").parse().expect("expected usize") +} + +/// Construct a customer id from an index in the format expected by our mocks +pub fn cons_cus_id(id: usize) -> String { + format!("cus_{id}") +} + +/// Are we testing `List` or `SearchList`? +#[derive(Copy, Clone, Debug)] +pub enum PaginationMockKind { + List, + Search, +} + +impl PaginationMockKind { + /// Expected pagination cursor for this kind of operation + fn cursor_name(self) -> &'static str { + match self { + Self::List => "starting_after", + Self::Search => "page", + } + } + + fn extract_cursor_value(self, value: &serde_json::Map) -> Option { + Some(value.get(self.cursor_name())?.as_str().unwrap().to_string()) + } + + fn api_url(self) -> &'static str { + match self { + Self::List => "/v1/customers", + Self::Search => "/v1/customers/search", + } + } +} + +/// A super-simple mock server for testing pagination for either list or search requests +/// +/// Given a customer_count of `n`, the server will pretend it has mocked customer data +/// with ids `cus_1, cus_2, ..., cus_n`. +/// +/// For either the `starting_after` or `page` cursor of `cus_n`, the server will respond +/// with `cus_n+1, cus_n+2, ...` until either the `limit` param is reached or the last item is returned. +/// +/// This naive pagination should still ensure cursors are set correctly, and we make the correct number +/// of requests and paginate items in the right order. +#[derive(Debug)] +pub struct PaginationMock { + server: MockServer, + customer_count: usize, + kind: PaginationMockKind, +} + +impl PaginationMock { + pub async fn new(customer_count: usize, kind: PaginationMockKind) -> Self { + let server = MockServer::start().await; + let mock = Mock::given(method("GET")).and(path(kind.api_url())).respond_with( + move |req: &Request| { + let params = extract_params(req); + let limit: usize = params + .get("limit") + .map(|s| s.as_str().unwrap().parse().expect("invalid limit")) + .unwrap_or(10); + let next_customer_id: usize = + if let Some(cursor) = kind.extract_cursor_value(¶ms) { + parse_cus_id(&cursor) + 1 + } else { + 1 + }; + + let last_customer_id = min(customer_count, next_customer_id + limit - 1); + let has_more = last_customer_id != customer_count; + let id_batch_to_return = + (next_customer_id..=last_customer_id).map(cons_cus_id).collect::>(); + + if has_more { + assert_eq!(id_batch_to_return.len(), limit); + } + let mock_ret = match kind { + PaginationMockKind::List => mock_customer_list(&id_batch_to_return, has_more), + PaginationMockKind::Search => mock_customer_search_list( + &id_batch_to_return, + has_more, + id_batch_to_return.last(), + ), + }; + ResponseTemplate::new(200).set_body_json(mock_ret) + }, + ); + server.register(mock).await; + Self { server, customer_count, kind } + } + + pub fn url(&self) -> String { + self.server.uri() + } + + /// All ids we should have collected if we paginated from scratch and got everything + pub fn all_ids(&self) -> Vec { + (1..=self.customer_count).map(cons_cus_id).collect() + } + + /// All ids we should have collected if we paginated everything starting from + /// `after` + pub fn all_ids_after(&self, after: usize) -> Vec { + (after + 1..=self.customer_count).map(cons_cus_id).collect() + } + + /// Check that we received the expected requests. For example, `expected` might be + /// [None, 1, 4, 7], signaling that our mock saw 4 requests, first one without + /// a cursor, then `cus_1`, `cus_4`, `cus_7`. + pub async fn assert_cursors_received(&self, expected: &[Option]) { + let requests = self.server.received_requests().await.expect("we are recording requests"); + for (req, expected) in requests.iter().zip(expected) { + let params = extract_params(req); + if let Some(cursor) = self.kind.extract_cursor_value(¶ms) { + assert_eq!(Some(parse_cus_id(&cursor)), *expected) + } else { + assert!( + expected.is_none(), + "Received no query param, expected {}", + expected.unwrap() + ); + } + } + } +} diff --git a/tests/price.rs b/tests/tests/it/price.rs similarity index 95% rename from tests/price.rs rename to tests/tests/it/price.rs index 9ba0d2dcc..4f85341f5 100644 --- a/tests/price.rs +++ b/tests/tests/it/price.rs @@ -1,12 +1,10 @@ -mod mock; +use stripe_product::{CurrencyOptionTaxBehavior, Price}; +use stripe_types::Currency; // Using fixture for this test because the stripe-mock server does not (currently [2023-05-25]) support the `currency_options` field. // See: https://github.com/stripe/stripe-mock/issues/420 #[test] -#[cfg(feature = "blocking")] fn deserialize_currency_options() { - use stripe::{Currency, CurrencyOptionTaxBehavior, Price}; - let fixture = r#" { "id": "price_1234", From 854d34fd186de93dee474a556339a74f79382645 Mon Sep 17 00:00:00 2001 From: Matthew Zeitlin <37011898+mzeitlin11@users.noreply.github.com> Date: Tue, 19 Mar 2024 21:16:35 -0400 Subject: [PATCH 2/6] Make workflows run on next --- .github/workflows/async-stripe.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/async-stripe.yml b/.github/workflows/async-stripe.yml index 09f83a19b..0e1f9f31e 100644 --- a/.github/workflows/async-stripe.yml +++ b/.github/workflows/async-stripe.yml @@ -3,9 +3,11 @@ on: push: branches: - master + - next pull_request: branches: - master + - next env: RUSTFLAGS: -Dwarnings From 32b0b1de205872bbd67ed0df358b5ef9769cbd88 Mon Sep 17 00:00:00 2001 From: Matthew Zeitlin <37011898+mzeitlin11@users.noreply.github.com> Date: Tue, 19 Mar 2024 21:26:32 -0400 Subject: [PATCH 3/6] try bumping msrv --- Cargo.toml | 4 +-- README.md | 71 ++++++++++++++++++++++++++++----------- openapi/Cargo.toml | 4 +-- openapi/src/components.rs | 2 +- 4 files changed, 56 insertions(+), 25 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index eb7f3960b..afa6c7ef0 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -19,7 +19,7 @@ exclude = ["openapi"] [workspace.package] version = "0.22.2" description = "API bindings for the Stripe HTTP API" -rust-version = "1.68.0" +rust-version = "1.73.0" authors = [ "Anna Baldwin ", "Kevin Stenerson ", @@ -36,7 +36,7 @@ categories = ["api-bindings"] edition = "2021" [workspace.dependencies] -serde = {version = ">=1.0.79", features = ["derive"] } # we use `serde(other)` which was introduced in 1.0.79 +serde = { version = ">=1.0.79", features = ["derive"] } # we use `serde(other)` which was introduced in 1.0.79 http-types = { version = "2.12.0", default-features = false } smol_str = { version = "0.2.0", features = ["serde"] } serde_json = "1.0" \ No newline at end of file diff --git a/README.md b/README.md index 21bbb5f61..25ceacae1 100644 --- a/README.md +++ b/README.md @@ -6,21 +6,30 @@ Convenient rust bindings and types for the Stripe HTTP API aiming to support the entire API surface. Not the case? Please open an issue. We update our -definitions [every week](https://github.com/arlyon/async-stripe/actions/workflows/openapi.yml) to ensure that we are up to date. -Want to see a changelog of the Stripe API? [Look no further](https://stripe.com/docs/changelog). +definitions [every week](https://github.com/arlyon/async-stripe/actions/workflows/openapi.yml) +to ensure that we are up to date. +Want to see a changelog of the Stripe +API? [Look no further](https://stripe.com/docs/changelog). ## Documentation -See the [Rust API docs](https://docs.rs/async-stripe), the [examples](/examples), or [payments.rs](https://payments.rs). +See the [Rust API docs](https://docs.rs/async-stripe), the [examples](/examples), +or [payments.rs](https://payments.rs). ## Example -This asynchronous example uses `Tokio` to create a [Stripe Customer](https://stripe.com/docs/api/customers/object). Your `Cargo.toml` could look like this: + +This asynchronous example uses `Tokio` to create +a [Stripe Customer](https://stripe.com/docs/api/customers/object). Your `Cargo.toml` could +look like this: + ```toml tokio = { version = "1", features = ["full"] } async-stripe = { version = "0.28", features = ["runtime-tokio-hyper"] } -stripe_core = { version = "0.28", features = ["customer"]} +stripe_core = { version = "0.28", features = ["customer"] } ``` + And then the code: + ```rust #[tokio::main] async fn main() -> Result<(), Box> { @@ -41,22 +50,30 @@ async fn main() -> Result<(), Box> { Ok(()) } ``` + A full list of examples can be found in the [examples](/examples). ## Relevant Crates ### Stripe Client -The main entry point is the `async-stripe` crate which provides a client for making Stripe API requests. -`async-stripe` is compatible with the [`async-std`](https://github.com/async-rs/async-std) and [`tokio`](https://github.com/tokio-rs/tokio) runtimes and the `native-tls` and `rustls` backends. When adding the dependency, you must select a runtime feature. + +The main entry point is the `async-stripe` crate which provides a client for making Stripe +API requests. +`async-stripe` is compatible with the [`async-std`](https://github.com/async-rs/async-std) +and [`tokio`](https://github.com/tokio-rs/tokio) runtimes and the `native-tls` +and `rustls` backends. When adding the dependency, you must select a runtime feature. #### Installation + ```toml [dependencies] async-stripe = { version = "0.31", features = ["runtime-tokio-hyper"] } ``` #### Feature Flags + `async-stripe` supports the following features combining runtime and TLS choices: + - `runtime-tokio-hyper` - `runtime-tokio-hyper-rustls` - `runtime-tokio-hyper-rustls-webpki` @@ -66,10 +83,14 @@ async-stripe = { version = "0.31", features = ["runtime-tokio-hyper"] } - `runtime-async-std-surf` ### Stripe Request Crates -To actually make requests with the client, you will have to use crates like `stripe-*`, which define requests for a subset of the `Stripe` API. For example, -`stripe_connect` includes all requests under the `Connect` part of the sidebar in the [Stripe API docs](https://stripe.com/docs/api) + +To actually make requests with the client, you will have to use crates like `stripe-*`, +which define requests for a subset of the `Stripe` API. For example, +`stripe_connect` includes all requests under the `Connect` part of the sidebar in +the [Stripe API docs](https://stripe.com/docs/api) The organization of the Stripe API chunks into crates is currently: + - `stripe_billing`: `Billing` - `stripe_checkout`: `Checkout` - `stripe_connect`: `Connect` @@ -83,15 +104,21 @@ The organization of the Stripe API chunks into crates is currently: - `stripe_misc`: `Tax`, `Identity`, `Reporting`, `Sigma`, `Financial Connections` and `Webhooks` -To help minimize compile times, within each of these crates, API requests are gated by features. For example, -making requests related to [Accounts](https://stripe.com/docs/api/accounts) requires enabling the `account` +To help minimize compile times, within each of these crates, API requests are gated by +features. For example, +making requests related to [Accounts](https://stripe.com/docs/api/accounts) requires +enabling the `account` feature flag in `stripe_connect`. -For a full, up-to-date list of where each Stripe API request lives, please see [this table](crate_info.md) +For a full, up-to-date list of where each Stripe API request lives, please +see [this table](crate_info.md) ### Stripe Webhooks -The `stripe_webhook` crate includes functionality for receiving and validating [Stripe Webhook Events](https://stripe.com/docs/webhooks). -The [examples](/examples) directory includes examples for listening to webhooks with `axum`, `actix-web`, and `rocket`. + +The `stripe_webhook` crate includes functionality for receiving and +validating [Stripe Webhook Events](https://stripe.com/docs/webhooks). +The [examples](/examples) directory includes examples for listening to webhooks +with `axum`, `actix-web`, and `rocket`. ## API Versions @@ -100,15 +127,18 @@ This library always tracks the latest version of the stripe API. https://github.com/arlyon/async-stripe/blob/f0fd7115aa3b7500134da10f848c8e93ba8eca2e/src/resources/generated/version.rs#L1-L3 If you want to find a version -that matches the API you are on, you can easily navigate back through the git blame in that file. -Set the corresponding crate version depending on which version of the Stripe API you are pinned to. +that matches the API you are on, you can easily navigate back through the git blame in +that file. +Set the corresponding crate version depending on which version of the Stripe API you are +pinned to. If you don't see the specific version you are on, prefer the next available version. - ## MSRV -We currently have `1.68.0` pinned in CI, so any version of rustc newer than that should work. -If this is not the case, please open an issue. As a policy, we permit MSRV increases in non-breaking releases. +We currently have `1.73.0` pinned in CI, so any version of rustc newer than that should +work. +If this is not the case, please open an issue. As a policy, we permit MSRV increases in +non-breaking releases. If you have a compelling usecase for bumping it, we are usually open to do so, as long as the rust version is not too new (generally 3 releases). @@ -123,7 +153,8 @@ We would not be here without them! :) Licensed under either of -- Apache License, Version 2.0, ([LICENSE-APACHE](LICENSE-APACHE) or ) +- Apache License, Version 2.0, ([LICENSE-APACHE](LICENSE-APACHE) + or ) - MIT license ([LICENSE-MIT](LICENSE-MIT) or ) at your option. diff --git a/openapi/Cargo.toml b/openapi/Cargo.toml index b03208a4c..7e7eb13a9 100644 --- a/openapi/Cargo.toml +++ b/openapi/Cargo.toml @@ -18,8 +18,8 @@ serde_json = "1" toml = "0.8.8" anyhow = "1.0.34" tracing = "0.1.36" -openapiv3 = "2.0.0" -indexmap = "2.1.0" +openapiv3 = "2" +indexmap = "2.2.5" tracing-subscriber = "0.3.15" tabled = "0.14.0" clap = { version = "4.3", features = ["derive"] } diff --git a/openapi/src/components.rs b/openapi/src/components.rs index 80ad8ef4b..b0d3a2d05 100644 --- a/openapi/src/components.rs +++ b/openapi/src/components.rs @@ -198,7 +198,7 @@ impl Components { debug!("Filtering unused components: {unused:#?}"); for unused_mod in unused { - self.components.remove(unused_mod.as_ref()); + self.components.shift_remove(unused_mod.as_ref()); } } } From 1b02be8276211894a45f562a46e88893ba663214 Mon Sep 17 00:00:00 2001 From: Matthew Zeitlin <37011898+mzeitlin11@users.noreply.github.com> Date: Tue, 19 Mar 2024 21:30:49 -0400 Subject: [PATCH 4/6] try bumping msrv --- .github/ISSUE_TEMPLATE/bug_report.yml | 4 ++-- .github/workflows/async-stripe.yml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/ISSUE_TEMPLATE/bug_report.yml b/.github/ISSUE_TEMPLATE/bug_report.yml index e82b642e6..89bf92be9 100644 --- a/.github/ISSUE_TEMPLATE/bug_report.yml +++ b/.github/ISSUE_TEMPLATE/bug_report.yml @@ -1,6 +1,6 @@ name: Bug report description: Create a report to help us improve -labels: ["bug"] +labels: [ "bug" ] body: - type: markdown attributes: @@ -51,7 +51,7 @@ body: id: language-version attributes: label: Rust version - placeholder: Our MSRV is 1.68.0 + placeholder: Our MSRV is 1.73.0 validations: required: true - type: input diff --git a/.github/workflows/async-stripe.yml b/.github/workflows/async-stripe.yml index 0e1f9f31e..01e6e1f0e 100644 --- a/.github/workflows/async-stripe.yml +++ b/.github/workflows/async-stripe.yml @@ -11,7 +11,7 @@ on: env: RUSTFLAGS: -Dwarnings - rust_min: 1.68 + rust_min: 1.73 jobs: format: From e7b7da3476431f717f30142f89a5be301c49e006 Mon Sep 17 00:00:00 2001 From: Matthew Zeitlin <37011898+mzeitlin11@users.noreply.github.com> Date: Tue, 19 Mar 2024 21:44:43 -0400 Subject: [PATCH 5/6] more post merge changes --- generated/stripe_billing/src/mod.rs | 8 ++++---- generated/stripe_misc/src/mod.rs | 12 ++++++------ generated/stripe_payment/src/mod.rs | 3 ++- generated/stripe_shared/src/mod.rs | 16 ++++++++-------- tests/tests/it/blocking/subscription_item.rs | 11 +++++++---- tests/tests/it/blocking/transfer_reversal.rs | 4 ++-- 6 files changed, 29 insertions(+), 25 deletions(-) diff --git a/generated/stripe_billing/src/mod.rs b/generated/stripe_billing/src/mod.rs index 86d826774..354f802ff 100644 --- a/generated/stripe_billing/src/mod.rs +++ b/generated/stripe_billing/src/mod.rs @@ -41,9 +41,7 @@ pub use stripe_shared::invoices_shipping_cost::*; pub use stripe_shared::invoices_status_transitions::*; pub mod invoice_line_item; pub use stripe_shared::invoice_line_item::*; -pub mod usage_record_summary; pub use stripe_shared::period::*; -pub use stripe_shared::usage_record_summary::*; pub mod plan; pub use stripe_shared::plan::*; pub use stripe_shared::plan_tier::*; @@ -148,9 +146,7 @@ pub use stripe_shared::quotes_resource_total_details_resource_breakdown::*; pub use stripe_shared::quotes_resource_transfer_data::*; pub use stripe_shared::quotes_resource_upfront::*; pub use stripe_shared::schedules_phase_automatic_tax::*; -pub use usage_record::types::*; pub mod subscription; -pub mod usage_record; pub use stripe_shared::subscription::*; pub use stripe_shared::subscription_automatic_tax::*; pub use stripe_shared::subscription_billing_thresholds::*; @@ -181,3 +177,7 @@ pub use stripe_shared::tax_id_verification::*; pub mod test_helpers_test_clock; pub use stripe_shared::test_helpers_test_clock::*; pub use stripe_shared::transform_usage::*; +pub use usage_record::types::*; +pub mod usage_record; +pub mod usage_record_summary; +pub use stripe_shared::usage_record_summary::*; diff --git a/generated/stripe_misc/src/mod.rs b/generated/stripe_misc/src/mod.rs index 3ad279696..35e7c18a4 100644 --- a/generated/stripe_misc/src/mod.rs +++ b/generated/stripe_misc/src/mod.rs @@ -72,12 +72,6 @@ pub use climate_removals_products_price::*; pub mod deleted_apple_pay_domain; #[doc(inline)] pub use deleted_apple_pay_domain::*; -pub use webhook_endpoint::types::*; -#[doc(hidden)] -pub mod verification_session_redaction; -pub mod webhook_endpoint; -#[doc(inline)] -pub use verification_session_redaction::*; #[doc(hidden)] pub mod deleted_webhook_endpoint; #[doc(inline)] @@ -318,3 +312,9 @@ pub use tax_product_resource_tax_transaction_resource_reversal::*; pub mod tax_product_resource_tax_transaction_shipping_cost; #[doc(inline)] pub use tax_product_resource_tax_transaction_shipping_cost::*; +#[doc(hidden)] +pub mod verification_session_redaction; +#[doc(inline)] +pub use verification_session_redaction::*; +pub use webhook_endpoint::types::*; +pub mod webhook_endpoint; diff --git a/generated/stripe_payment/src/mod.rs b/generated/stripe_payment/src/mod.rs index b720fbeaa..523419582 100644 --- a/generated/stripe_payment/src/mod.rs +++ b/generated/stripe_payment/src/mod.rs @@ -11,7 +11,7 @@ extern crate self as stripe_payment; pub mod bank_account; pub use stripe_shared::bank_account::*; pub mod card; -pub use stripe_shared::card::*;pub use stripe_shared::card_issuing_account_terms_of_service::*;pub use stripe_shared::card_mandate_payment_method_details::*;pub use stripe_shared::deleted_bank_account::*;pub use stripe_shared::deleted_card::*;pub use stripe_shared::deleted_external_account::*;pub use stripe_shared::deleted_payment_source::*;pub use stripe_shared::external_account_requirements::*;pub use stripe_shared::networks::*;pub use stripe_shared::us_bank_account_networks::*;pub use stripe_shared::payment_flows_private_payment_methods_alipay::*;pub use stripe_shared::payment_flows_private_payment_methods_alipay_details::*;pub use stripe_shared::payment_flows_private_payment_methods_card_details_api_resource_enterprise_features_extended_authorization_extended_authorization::*;pub use stripe_shared::payment_flows_private_payment_methods_card_details_api_resource_enterprise_features_incremental_authorization_incremental_authorization::*;pub use stripe_shared::payment_flows_private_payment_methods_card_details_api_resource_enterprise_features_overcapture_overcapture::*;pub use stripe_shared::payment_flows_private_payment_methods_card_details_api_resource_multicapture::*;pub use stripe_shared::payment_flows_private_payment_methods_klarna_dob::*; +pub use stripe_shared::card::*;pub use stripe_shared::card_issuing_account_terms_of_service::*;pub use stripe_shared::card_mandate_payment_method_details::*;pub use stripe_shared::deleted_bank_account::*;pub use stripe_shared::deleted_card::*;pub use stripe_shared::deleted_external_account::*;pub use stripe_shared::deleted_payment_source::*;pub use stripe_shared::external_account_requirements::*;pub use stripe_shared::networks::*;pub use stripe_shared::payment_flows_private_payment_methods_alipay::*;pub use stripe_shared::payment_flows_private_payment_methods_alipay_details::*;pub use stripe_shared::payment_flows_private_payment_methods_card_details_api_resource_enterprise_features_extended_authorization_extended_authorization::*;pub use stripe_shared::payment_flows_private_payment_methods_card_details_api_resource_enterprise_features_incremental_authorization_incremental_authorization::*;pub use stripe_shared::payment_flows_private_payment_methods_card_details_api_resource_enterprise_features_overcapture_overcapture::*;pub use stripe_shared::payment_flows_private_payment_methods_card_details_api_resource_multicapture::*;pub use stripe_shared::payment_flows_private_payment_methods_klarna_dob::*; pub mod payment_link; pub use stripe_shared::payment_link::*; pub use stripe_shared::payment_links_resource_after_completion::*; @@ -250,3 +250,4 @@ pub use stripe_shared::source_type_three_d_secure::*; pub use stripe_shared::source_type_wechat::*; pub use stripe_shared::three_d_secure_details_charge::*; pub use stripe_shared::three_d_secure_usage::*; +pub use stripe_shared::us_bank_account_networks::*; diff --git a/generated/stripe_shared/src/mod.rs b/generated/stripe_shared/src/mod.rs index 24d3f3fea..5f938b9c6 100644 --- a/generated/stripe_shared/src/mod.rs +++ b/generated/stripe_shared/src/mod.rs @@ -985,10 +985,6 @@ pub mod payment_flows_automatic_payment_methods_setup_intent; #[doc(inline)] pub use payment_flows_automatic_payment_methods_setup_intent::*; #[doc(hidden)] -pub mod us_bank_account_networks; -#[doc(inline)] -pub use us_bank_account_networks::*; -#[doc(hidden)] pub mod payment_flows_private_payment_methods_alipay; #[doc(inline)] pub use payment_flows_private_payment_methods_alipay::*; @@ -1177,10 +1173,6 @@ pub mod payment_intent_processing_customer_notification; #[doc(inline)] pub use payment_intent_processing_customer_notification::*; #[doc(hidden)] -pub mod usage_record_summary; -#[doc(inline)] -pub use usage_record_summary::*; -#[doc(hidden)] pub mod payment_link; #[doc(inline)] pub use payment_link::*; @@ -2460,6 +2452,14 @@ pub use transform_quantity::*; pub mod transform_usage; #[doc(inline)] pub use transform_usage::*; +#[doc(hidden)] +pub mod us_bank_account_networks; +#[doc(inline)] +pub use us_bank_account_networks::*; +#[doc(hidden)] +pub mod usage_record_summary; +#[doc(inline)] +pub use usage_record_summary::*; pub mod api_version; pub use api_version::ApiVersion; pub mod version; diff --git a/tests/tests/it/blocking/subscription_item.rs b/tests/tests/it/blocking/subscription_item.rs index 402710b18..a6e470223 100644 --- a/tests/tests/it/blocking/subscription_item.rs +++ b/tests/tests/it/blocking/subscription_item.rs @@ -1,6 +1,7 @@ use chrono::Utc; use stripe_billing::usage_record::{ - CreateUsageRecord, CreateUsageRecordAction, CreateUsageRecordTimestamp, + CreateSubscriptionItemUsageRecord, CreateSubscriptionItemUsageRecordAction, + CreateSubscriptionItemUsageRecordTimestamp, }; use crate::mock::get_client; @@ -10,10 +11,12 @@ fn can_create_usage_record() { let client = get_client(); let subscription_item_id = "si_JVbsG8wiy20ycs".parse().unwrap(); - let creator = CreateUsageRecord { + let creator = CreateSubscriptionItemUsageRecord { quantity: 42, - action: Some(CreateUsageRecordAction::Increment), - timestamp: Some(CreateUsageRecordTimestamp::Timestamp(Utc::now().timestamp())), + action: Some(CreateSubscriptionItemUsageRecordAction::Increment), + timestamp: Some(CreateSubscriptionItemUsageRecordTimestamp::Timestamp( + Utc::now().timestamp(), + )), expand: None, }; let usage_record = creator.send(&client, &subscription_item_id).unwrap(); diff --git a/tests/tests/it/blocking/transfer_reversal.rs b/tests/tests/it/blocking/transfer_reversal.rs index 72a8e0b17..d2761a4d0 100644 --- a/tests/tests/it/blocking/transfer_reversal.rs +++ b/tests/tests/it/blocking/transfer_reversal.rs @@ -1,4 +1,4 @@ -use stripe_connect::transfer_reversal::CreateTransferReversal; +use stripe_connect::transfer_reversal::CreateIdTransferReversal; use crate::mock::get_client; @@ -7,7 +7,7 @@ use crate::mock::get_client; fn create_transfer_reversal() { let client = get_client(); - let mut create = CreateTransferReversal::new(); + let mut create = CreateIdTransferReversal::new(); let id = "tr_Ll53U0VONALFk36".parse().unwrap(); create.refund_application_fee = Some(true); create.amount = Some(4); From 00aa8976f18befc07b7f17b3400bfb7cf730d0f4 Mon Sep 17 00:00:00 2001 From: Matthew Zeitlin <37011898+mzeitlin11@users.noreply.github.com> Date: Wed, 20 Mar 2024 16:35:49 -0400 Subject: [PATCH 6/6] Remove default derive for id --- CHANGELOG.md | 1 + openapi/src/requests.rs | 6 ------ stripe_types/src/ids.rs | 4 ++-- 3 files changed, 3 insertions(+), 8 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 23f92cc34..30c879147 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -163,6 +163,7 @@ they stay up to date, preventing errors error deserialization errors like (https does not include the status code. - The `id` method on `Expandable` now returns a reference: `&T::Id`. All id types implement `Clone` so to achieve the previous behavior, use `.id().clone()`. +- `*Id` types no longer derive `default`. The previous default was an empty string, which will never be a valid id - Removed the `AsRef` implementation for enums, use `as_str` instead. Since most of these changes are related to code generation, it is likely there are some diff --git a/openapi/src/requests.rs b/openapi/src/requests.rs index c51f9427a..6b1ec6394 100644 --- a/openapi/src/requests.rs +++ b/openapi/src/requests.rs @@ -78,12 +78,6 @@ fn deduplicate_method_names<'a>( let has_dup_name = base_names.iter().any(|(&key, name)| key != req_key && name == curr_name); if has_dup_name { - if req.path_params.is_empty() { - dbg!(req); - dbg!(curr_name); - dbg!(req_key); - dbg!(base_names); - } let path_param = req.path_params.first().expect("Expected path parameter on duplicate method"); dedupped.insert(req_key, format!("{curr_name}_{}", path_param.name)); diff --git a/stripe_types/src/ids.rs b/stripe_types/src/ids.rs index ad722fb27..36e123179 100644 --- a/stripe_types/src/ids.rs +++ b/stripe_types/src/ids.rs @@ -27,7 +27,7 @@ macro_rules! def_id_serde_impls { #[macro_export] macro_rules! def_id { ($struct_name:ident) => { - #[derive(Clone, Debug, Default, Eq, PartialEq, Hash)] + #[derive(Clone, Debug, Eq, PartialEq, Hash)] pub struct $struct_name(smol_str::SmolStr); impl $struct_name { @@ -115,7 +115,7 @@ macro_rules! def_id { /// /// This type _typically_ will not allocate and /// therefore is usually cheaply clonable. - #[derive(Clone, Debug, Default, Eq, PartialEq, Hash)] + #[derive(Clone, Debug, Eq, PartialEq, Hash)] pub struct $struct_name(smol_str::SmolStr); impl $struct_name {